summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--.qmake.conf4
-rwxr-xr-xbin/syncqt.pl18
-rw-r--r--config.tests/arch/write_info.pri8
-rw-r--r--config_help.txt9
-rwxr-xr-xconfigure2
-rw-r--r--configure.json61
-rw-r--r--configure.pri42
-rw-r--r--doc/global/config.qdocconf6
-rw-r--r--doc/global/qt-cpp-defines.qdocconf1
-rw-r--r--doc/src/images/macmainwindow.pngbin39579 -> 0 bytes
-rw-r--r--examples/corelib/mimetypes/mimetypebrowser/main.cpp4
-rw-r--r--examples/corelib/serialization/convert/cborconverter.cpp2
-rw-r--r--examples/corelib/serialization/convert/textconverter.cpp6
-rw-r--r--examples/corelib/threads/doc/src/mandelbrot.qdoc4
-rw-r--r--examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp2
-rw-r--r--examples/corelib/tools/customtype/message.cpp15
-rw-r--r--examples/corelib/tools/customtype/message.h7
-rw-r--r--examples/corelib/tools/customtypesending/message.cpp13
-rw-r--r--examples/corelib/tools/customtypesending/message.h7
-rw-r--r--examples/corelib/tools/doc/src/customtype.qdoc12
-rw-r--r--examples/embedded/raycasting/raycasting.cpp4
-rw-r--r--examples/network/bearermonitor/bearermonitor.pro2
-rw-r--r--examples/network/downloadmanager/downloadmanager.cpp4
-rw-r--r--examples/network/downloadmanager/downloadmanager.h2
-rw-r--r--examples/network/http/httpwindow.cpp24
-rw-r--r--examples/network/http/httpwindow.h8
-rw-r--r--examples/network/http/main.cpp4
-rw-r--r--examples/network/secureudpserver/server.cpp23
-rw-r--r--examples/network/secureudpserver/server.h8
-rw-r--r--examples/network/torrent/ratecontroller.cpp14
-rw-r--r--examples/network/torrent/ratecontroller.h4
-rw-r--r--examples/network/torrent/torrentclient.cpp60
-rw-r--r--examples/opengl/contextinfo/widget.cpp2
-rw-r--r--examples/opengl/legacy/hellogl/glwidget.cpp4
-rw-r--r--examples/opengl/legacy/overpainting/glwidget.cpp10
-rw-r--r--examples/opengl/qopenglwidget/glwidget.cpp7
-rw-r--r--examples/opengl/qopenglwidget/glwidget.h4
-rw-r--r--examples/opengl/qopenglwindow/background_renderer.cpp11
-rw-r--r--examples/opengl/qopenglwindow/background_renderer.h11
-rw-r--r--examples/opengl/threadedqopenglwidget/main.cpp10
-rw-r--r--examples/qtconcurrent/wordcount/main.cpp19
-rw-r--r--examples/sql/doc/src/cachedtable.qdoc8
-rw-r--r--examples/sql/relationaltablemodel/relationaltablemodel.cpp10
-rw-r--r--examples/vulkan/hellovulkancubes/renderer.cpp7
-rw-r--r--examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp14
-rw-r--r--examples/widgets/animation/easing/window.cpp7
-rw-r--r--examples/widgets/animation/stickman/animation.cpp18
-rw-r--r--examples/widgets/animation/stickman/animation.h4
-rw-r--r--examples/widgets/animation/stickman/graphicsview.cpp12
-rw-r--r--examples/widgets/animation/stickman/graphicsview.h12
-rw-r--r--examples/widgets/animation/stickman/lifecycle.cpp19
-rw-r--r--examples/widgets/animation/stickman/lifecycle.h11
-rw-r--r--examples/widgets/animation/stickman/node.h4
-rw-r--r--examples/widgets/animation/stickman/rectbutton.cpp7
-rw-r--r--examples/widgets/animation/stickman/rectbutton.h8
-rw-r--r--examples/widgets/animation/stickman/stickman.cpp29
-rw-r--r--examples/widgets/animation/stickman/stickman.h13
-rw-r--r--examples/widgets/animation/sub-attaq/animationmanager.cpp17
-rw-r--r--examples/widgets/animation/sub-attaq/animationmanager.h10
-rw-r--r--examples/widgets/animation/sub-attaq/boat.cpp19
-rw-r--r--examples/widgets/animation/sub-attaq/boat.h7
-rw-r--r--examples/widgets/animation/sub-attaq/boat_p.h20
-rw-r--r--examples/widgets/animation/sub-attaq/bomb.cpp19
-rw-r--r--examples/widgets/animation/sub-attaq/bomb.h6
-rw-r--r--examples/widgets/animation/sub-attaq/graphicsscene.cpp73
-rw-r--r--examples/widgets/animation/sub-attaq/graphicsscene.h21
-rw-r--r--examples/widgets/animation/sub-attaq/mainwindow.cpp7
-rw-r--r--examples/widgets/animation/sub-attaq/mainwindow.h8
-rw-r--r--examples/widgets/animation/sub-attaq/pixmapitem.cpp5
-rw-r--r--examples/widgets/animation/sub-attaq/pixmapitem.h8
-rw-r--r--examples/widgets/animation/sub-attaq/progressitem.cpp7
-rw-r--r--examples/widgets/animation/sub-attaq/progressitem.h8
-rw-r--r--examples/widgets/animation/sub-attaq/qanimationstate.cpp4
-rw-r--r--examples/widgets/animation/sub-attaq/qanimationstate.h10
-rw-r--r--examples/widgets/animation/sub-attaq/states.cpp28
-rw-r--r--examples/widgets/animation/sub-attaq/states.h24
-rw-r--r--examples/widgets/animation/sub-attaq/submarine.cpp26
-rw-r--r--examples/widgets/animation/sub-attaq/submarine.h11
-rw-r--r--examples/widgets/animation/sub-attaq/submarine_p.h9
-rw-r--r--examples/widgets/animation/sub-attaq/textinformationitem.cpp9
-rw-r--r--examples/widgets/animation/sub-attaq/textinformationitem.h6
-rw-r--r--examples/widgets/animation/sub-attaq/torpedo.cpp23
-rw-r--r--examples/widgets/animation/sub-attaq/torpedo.h6
-rw-r--r--examples/widgets/desktop/screenshot/main.cpp5
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.cpp2
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.cpp4
-rw-r--r--examples/widgets/dialogs/classwizard/classwizard.h12
-rw-r--r--examples/widgets/dialogs/extension/finddialog.h2
-rw-r--r--examples/widgets/dialogs/findfiles/window.h2
-rw-r--r--examples/widgets/dialogs/licensewizard/licensewizard.h12
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.cpp3
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.h2
-rw-r--r--examples/widgets/dialogs/standarddialogs/main.cpp4
-rw-r--r--examples/widgets/dialogs/tabdialog/tabdialog.h8
-rw-r--r--examples/widgets/doc/src/application.qdoc9
-rw-r--r--examples/widgets/doc/src/calculator.qdoc3
-rw-r--r--examples/widgets/doc/src/collidingmice-example.qdoc3
-rw-r--r--examples/widgets/doc/src/diagramscene.qdoc4
-rw-r--r--examples/widgets/doc/src/icons.qdoc7
-rw-r--r--examples/widgets/doc/src/stardelegate.qdoc2
-rw-r--r--examples/widgets/doc/src/tooltips.qdoc2
-rw-r--r--examples/widgets/effects/blurpicker/blurpicker.h2
-rw-r--r--examples/widgets/effects/fademessage/fademessage.h2
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.cpp28
-rw-r--r--examples/widgets/gestures/imagegestures/imagewidget.h10
-rw-r--r--examples/widgets/gestures/imagegestures/main.cpp2
-rw-r--r--examples/widgets/gestures/imagegestures/mainwidget.cpp2
-rw-r--r--examples/widgets/gestures/imagegestures/mainwidget.h4
-rw-r--r--examples/widgets/graphicsview/anchorlayout/main.cpp2
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp31
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h9
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/window.h6
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.cpp23
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.h37
-rw-r--r--examples/widgets/graphicsview/boxes/gltrianglemesh.h3
-rw-r--r--examples/widgets/graphicsview/boxes/main.cpp12
-rw-r--r--examples/widgets/graphicsview/boxes/qtbox.cpp39
-rw-r--r--examples/widgets/graphicsview/boxes/qtbox.h11
-rw-r--r--examples/widgets/graphicsview/boxes/roundedbox.h12
-rw-r--r--examples/widgets/graphicsview/boxes/scene.cpp84
-rw-r--r--examples/widgets/graphicsview/boxes/scene.h25
-rw-r--r--examples/widgets/graphicsview/boxes/trackball.cpp17
-rw-r--r--examples/widgets/graphicsview/boxes/trackball.h25
-rw-r--r--examples/widgets/graphicsview/chip/chip.cpp4
-rw-r--r--examples/widgets/graphicsview/chip/mainwindow.cpp8
-rw-r--r--examples/widgets/graphicsview/chip/mainwindow.h2
-rw-r--r--examples/widgets/graphicsview/chip/view.cpp4
-rw-r--r--examples/widgets/graphicsview/chip/view.h2
-rw-r--r--examples/widgets/graphicsview/collidingmice/main.cpp5
-rw-r--r--examples/widgets/graphicsview/collidingmice/mouse.cpp12
-rw-r--r--examples/widgets/graphicsview/collidingmice/mouse.h6
-rw-r--r--examples/widgets/graphicsview/diagramscene/arrow.cpp24
-rw-r--r--examples/widgets/graphicsview/diagramscene/arrow.h18
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramitem.cpp18
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramitem.h17
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramscene.cpp12
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramscene.h2
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramtextitem.h6
-rw-r--r--examples/widgets/graphicsview/diagramscene/mainwindow.cpp4
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/coloritem.cpp14
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/main.cpp13
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/robot.cpp15
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/robot.h22
-rw-r--r--examples/widgets/graphicsview/elasticnodes/edge.cpp8
-rw-r--r--examples/widgets/graphicsview/elasticnodes/edge.h2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/graphwidget.cpp6
-rw-r--r--examples/widgets/graphicsview/elasticnodes/graphwidget.h4
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.cpp2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/node.h9
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/customproxy.cpp11
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/customproxy.h6
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp2
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.h2
-rw-r--r--examples/widgets/graphicsview/flowlayout/flowlayout.cpp19
-rw-r--r--examples/widgets/graphicsview/flowlayout/flowlayout.h6
-rw-r--r--examples/widgets/graphicsview/flowlayout/main.cpp6
-rw-r--r--examples/widgets/graphicsview/flowlayout/window.cpp16
-rw-r--r--examples/widgets/graphicsview/flowlayout/window.h3
-rw-r--r--examples/widgets/graphicsview/padnavigator/flippablepad.cpp4
-rw-r--r--examples/widgets/graphicsview/padnavigator/flippablepad.h4
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.cpp14
-rw-r--r--examples/widgets/graphicsview/padnavigator/padnavigator.h7
-rw-r--r--examples/widgets/graphicsview/padnavigator/roundrectitem.cpp4
-rw-r--r--examples/widgets/graphicsview/padnavigator/roundrectitem.h4
-rw-r--r--examples/widgets/graphicsview/padnavigator/splashitem.h4
-rw-r--r--examples/widgets/graphicsview/simpleanchorlayout/main.cpp22
-rw-r--r--examples/widgets/graphicsview/weatheranchorlayout/main.cpp20
-rw-r--r--examples/widgets/itemviews/dirview/main.cpp12
-rw-r--r--examples/widgets/itemviews/frozencolumn/main.cpp2
-rw-r--r--examples/widgets/itemviews/interview/model.cpp4
-rw-r--r--examples/widgets/itemviews/stardelegate/main.cpp9
-rw-r--r--examples/widgets/mainwindows/application/mainwindow.cpp34
-rw-r--r--examples/widgets/mainwindows/mdi/mainwindow.cpp2
-rw-r--r--examples/widgets/mainwindows/mdi/mdichild.cpp27
-rw-r--r--examples/widgets/mainwindows/sdi/mainwindow.cpp31
-rw-r--r--examples/widgets/painting/affine/xform.cpp7
-rw-r--r--examples/widgets/painting/composition/composition.cpp12
-rw-r--r--examples/widgets/painting/composition/composition.h10
-rw-r--r--examples/widgets/painting/composition/main.cpp6
-rw-r--r--examples/widgets/painting/deform/pathdeform.cpp2
-rw-r--r--examples/widgets/painting/deform/pathdeform.h4
-rw-r--r--examples/widgets/painting/fontsampler/mainwindow.h2
-rw-r--r--examples/widgets/painting/gradients/gradients.cpp34
-rw-r--r--examples/widgets/painting/gradients/gradients.h2
-rw-r--r--examples/widgets/painting/gradients/main.cpp4
-rw-r--r--examples/widgets/painting/painterpaths/renderarea.h2
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.cpp90
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.h2
-rw-r--r--examples/widgets/painting/shared/arthurstyle.cpp4
-rw-r--r--examples/widgets/painting/shared/arthurstyle.h2
-rw-r--r--examples/widgets/painting/shared/arthurwidgets.cpp6
-rw-r--r--examples/widgets/painting/shared/fbopaintdevice.cpp6
-rw-r--r--examples/widgets/painting/shared/fbopaintdevice.h4
-rw-r--r--examples/widgets/painting/shared/hoverpoints.cpp7
-rw-r--r--examples/widgets/painting/transformations/renderarea.h2
-rw-r--r--examples/widgets/qnx/foreignwindows/collector.cpp176
-rw-r--r--examples/widgets/qnx/foreignwindows/collector.h (renamed from src/plugins/platforms/mirclient/qmirclientscreenobserver.h)57
-rw-r--r--examples/widgets/qnx/foreignwindows/foreignwindows.pro11
-rw-r--r--examples/widgets/qnx/foreignwindows/main.cpp (renamed from src/plugins/platforms/mirclient/qmirclientdesktopwindow.cpp)21
-rw-r--r--examples/widgets/richtext/textedit/example.md102
-rw-r--r--examples/widgets/richtext/textedit/images/mac/checkbox-checked.pngbin0 -> 1167 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/mac/checkbox.pngbin0 -> 779 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/mac/format-indent-less.pngbin0 -> 1201 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/mac/format-indent-more.pngbin0 -> 993 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/win/checkbox-checked.pngbin0 -> 1167 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/win/checkbox.pngbin0 -> 779 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/win/format-indent-less.pngbin0 -> 1201 bytes
-rw-r--r--examples/widgets/richtext/textedit/images/win/format-indent-more.pngbin0 -> 993 bytes
-rw-r--r--examples/widgets/richtext/textedit/main.cpp4
-rw-r--r--examples/widgets/richtext/textedit/textedit.cpp151
-rw-r--r--examples/widgets/richtext/textedit/textedit.h7
-rw-r--r--examples/widgets/richtext/textedit/textedit.qrc8
-rw-r--r--examples/widgets/scroller/graphicsview/main.cpp2
-rw-r--r--examples/widgets/statemachine/eventtransitions/main.cpp9
-rw-r--r--examples/widgets/statemachine/factorial/main.cpp12
-rw-r--r--examples/widgets/statemachine/trafficlight/main.cpp16
-rw-r--r--examples/widgets/tools/codecs/encodingdialog.cpp2
-rw-r--r--examples/widgets/tools/codecs/mainwindow.cpp24
-rw-r--r--examples/widgets/tools/codecs/mainwindow.h6
-rw-r--r--examples/widgets/tools/codecs/previewform.cpp24
-rw-r--r--examples/widgets/tools/codecs/previewform.h4
-rw-r--r--examples/widgets/tools/completer/fsmodel.h2
-rw-r--r--examples/widgets/tools/completer/mainwindow.cpp41
-rw-r--r--examples/widgets/tools/completer/mainwindow.h21
-rw-r--r--examples/widgets/tools/customcompleter/mainwindow.cpp17
-rw-r--r--examples/widgets/tools/customcompleter/mainwindow.h8
-rw-r--r--examples/widgets/tools/customcompleter/textedit.cpp13
-rw-r--r--examples/widgets/tools/customcompleter/textedit.h4
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/echointerface.h3
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/echowindow.cpp14
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/main.cpp2
-rw-r--r--examples/widgets/tools/echoplugin/plugin/echoplugin.cpp2
-rw-r--r--examples/widgets/tools/i18n/languagechooser.cpp56
-rw-r--r--examples/widgets/tools/i18n/languagechooser.h16
-rw-r--r--examples/widgets/tools/i18n/mainwindow.cpp22
-rw-r--r--examples/widgets/tools/i18n/mainwindow.h2
-rw-r--r--examples/widgets/tools/plugandpaint/app/interfaces.h6
-rw-r--r--examples/widgets/tools/plugandpaint/app/mainwindow.cpp21
-rw-r--r--examples/widgets/tools/plugandpaint/app/paintarea.cpp7
-rw-r--r--examples/widgets/tools/plugandpaint/app/plugindialog.cpp2
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.cpp6
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h8
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.cpp5
-rw-r--r--examples/widgets/tools/regexp/regexpdialog.h2
-rw-r--r--examples/widgets/tools/regularexpression/regularexpressiondialog.h2
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.cpp17
-rw-r--r--examples/widgets/tools/settingseditor/locationdialog.h2
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.cpp20
-rw-r--r--examples/widgets/tools/settingseditor/mainwindow.h12
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.cpp38
-rw-r--r--examples/widgets/tools/settingseditor/settingstree.h13
-rw-r--r--examples/widgets/tools/settingseditor/variantdelegate.cpp18
-rw-r--r--examples/widgets/tools/settingseditor/variantdelegate.h6
-rw-r--r--examples/widgets/tools/styleplugin/plugin/simplestyle.cpp2
-rw-r--r--examples/widgets/tools/styleplugin/plugin/simplestyle.h6
-rw-r--r--examples/widgets/tools/styleplugin/plugin/simplestyleplugin.cpp6
-rw-r--r--examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h7
-rw-r--r--examples/widgets/tools/styleplugin/stylewindow/main.cpp3
-rw-r--r--examples/widgets/tools/styleplugin/stylewindow/stylewindow.cpp4
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.cpp53
-rw-r--r--examples/widgets/tools/treemodelcompleter/mainwindow.h22
-rw-r--r--examples/widgets/tools/treemodelcompleter/treemodelcompleter.cpp12
-rw-r--r--examples/widgets/tools/treemodelcompleter/treemodelcompleter.h4
-rw-r--r--examples/widgets/tools/undo/commands.cpp36
-rw-r--r--examples/widgets/tools/undo/commands.h14
-rw-r--r--examples/widgets/tools/undo/document.cpp30
-rw-r--r--examples/widgets/tools/undo/document.h15
-rw-r--r--examples/widgets/tools/undo/mainwindow.cpp53
-rw-r--r--examples/widgets/tools/undo/mainwindow.h2
-rw-r--r--examples/widgets/tools/undoframework/commands.cpp20
-rw-r--r--examples/widgets/tools/undoframework/commands.h6
-rw-r--r--examples/widgets/tools/undoframework/diagramitem.cpp9
-rw-r--r--examples/widgets/tools/undoframework/diagramitem.h5
-rw-r--r--examples/widgets/tools/undoframework/diagramscene.cpp17
-rw-r--r--examples/widgets/tools/undoframework/diagramscene.h4
-rw-r--r--examples/widgets/tools/undoframework/main.cpp2
-rw-r--r--examples/widgets/tools/undoframework/mainwindow.cpp9
-rw-r--r--examples/widgets/tools/undoframework/mainwindow.h28
-rw-r--r--examples/widgets/touch/fingerpaint/scribblearea.h2
-rw-r--r--examples/widgets/touch/pinchzoom/graphicsview.cpp6
-rw-r--r--examples/widgets/touch/pinchzoom/graphicsview.h4
-rw-r--r--examples/widgets/touch/pinchzoom/main.cpp7
-rw-r--r--examples/widgets/touch/pinchzoom/mouse.cpp10
-rw-r--r--examples/widgets/touch/pinchzoom/mouse.h6
-rw-r--r--examples/widgets/tutorials/addressbook/part1/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part2/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part3/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part4/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part5/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part5/finddialog.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part6/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part6/finddialog.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part7/addressbook.h2
-rw-r--r--examples/widgets/tutorials/addressbook/part7/finddialog.h2
-rw-r--r--examples/widgets/tutorials/modelview/3_changingmodel/main.cpp2
-rw-r--r--examples/widgets/tutorials/modelview/7_selections/mainwindow.h2
-rw-r--r--examples/widgets/tutorials/notepad/notepad.h2
-rw-r--r--examples/widgets/widgets/analogclock/analogclock.cpp4
-rw-r--r--examples/widgets/widgets/calculator/button.cpp2
-rw-r--r--examples/widgets/widgets/calculator/calculator.cpp22
-rw-r--r--examples/widgets/widgets/calendarwidget/main.cpp2
-rw-r--r--examples/widgets/widgets/calendarwidget/window.cpp19
-rw-r--r--examples/widgets/widgets/charactermap/characterwidget.cpp37
-rw-r--r--examples/widgets/widgets/charactermap/characterwidget.h6
-rw-r--r--examples/widgets/widgets/charactermap/mainwindow.cpp29
-rw-r--r--examples/widgets/widgets/codeeditor/codeeditor.cpp11
-rw-r--r--examples/widgets/widgets/codeeditor/codeeditor.h13
-rw-r--r--examples/widgets/widgets/codeeditor/main.cpp2
-rw-r--r--examples/widgets/widgets/digitalclock/digitalclock.cpp3
-rw-r--r--examples/widgets/widgets/groupbox/window.cpp9
-rw-r--r--examples/widgets/widgets/icons/iconpreviewarea.cpp43
-rw-r--r--examples/widgets/widgets/icons/iconsizespinbox.cpp2
-rw-r--r--examples/widgets/widgets/icons/imagedelegate.cpp2
-rw-r--r--examples/widgets/widgets/icons/main.cpp4
-rw-r--r--examples/widgets/widgets/icons/mainwindow.cpp27
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.cpp25
-rw-r--r--examples/widgets/widgets/imageviewer/imageviewer.h2
-rw-r--r--examples/widgets/widgets/lineedits/window.cpp13
-rw-r--r--examples/widgets/widgets/mousebuttons/buttontester.cpp11
-rw-r--r--examples/widgets/widgets/movie/movieplayer.cpp10
-rw-r--r--examples/widgets/widgets/scribble/mainwindow.cpp27
-rw-r--r--examples/widgets/widgets/scribble/scribblearea.cpp11
-rw-r--r--examples/widgets/widgets/scribble/scribblearea.h8
-rw-r--r--examples/widgets/widgets/shapedclock/shapedclock.cpp9
-rw-r--r--examples/widgets/widgets/sliders/slidersgroup.cpp5
-rw-r--r--examples/widgets/widgets/sliders/window.cpp9
-rw-r--r--examples/widgets/widgets/spinboxes/window.cpp12
-rw-r--r--examples/widgets/widgets/styles/norwegianwoodstyle.cpp5
-rw-r--r--examples/widgets/widgets/styles/widgetgallery.cpp21
-rw-r--r--examples/widgets/widgets/stylesheet/main.cpp2
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.cpp4
-rw-r--r--examples/widgets/widgets/stylesheet/mainwindow.h2
-rw-r--r--examples/widgets/widgets/stylesheet/stylesheeteditor.cpp4
-rw-r--r--examples/widgets/widgets/tablet/main.cpp2
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.cpp11
-rw-r--r--examples/widgets/widgets/tablet/mainwindow.h2
-rw-r--r--examples/widgets/widgets/tablet/tabletapplication.cpp2
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.cpp30
-rw-r--r--examples/widgets/widgets/tablet/tabletcanvas.h25
-rw-r--r--examples/widgets/widgets/tetrix/tetrixboard.cpp10
-rw-r--r--examples/widgets/widgets/tetrix/tetrixpiece.cpp2
-rw-r--r--examples/widgets/widgets/tetrix/tetrixwindow.cpp15
-rw-r--r--examples/widgets/widgets/tooltips/main.cpp2
-rw-r--r--examples/widgets/widgets/tooltips/sortingbox.cpp14
-rw-r--r--examples/widgets/widgets/tooltips/sortingbox.h2
-rw-r--r--examples/widgets/widgets/validators/validatorwidget.cpp2
-rw-r--r--examples/widgets/widgets/wiggly/wigglywidget.cpp9
-rw-r--r--examples/widgets/widgets/windowflags/controllerwindow.cpp30
-rw-r--r--examples/widgets/widgets/windowflags/previewwindow.cpp21
-rw-r--r--examples/widgets/windowcontainer/windowcontainer.cpp53
-rw-r--r--examples/xml/dombookmarks/mainwindow.cpp2
-rw-r--r--examples/xml/htmlinfo/main.cpp18
-rw-r--r--examples/xml/saxbookmarks/mainwindow.cpp2
-rw-r--r--examples/xml/streambookmarks/mainwindow.cpp2
-rw-r--r--mkspecs/android-clang/qmake.conf121
-rw-r--r--mkspecs/android-g++/qmake.conf35
-rw-r--r--mkspecs/android-g++/qplatformdefs.h177
-rw-r--r--mkspecs/common/android-base-head.conf72
-rw-r--r--mkspecs/common/android-base-tail.conf90
-rw-r--r--mkspecs/common/clang.conf6
-rw-r--r--mkspecs/common/g++-win32.conf2
-rw-r--r--mkspecs/common/gcc-base.conf2
-rw-r--r--mkspecs/common/mac.conf1
-rw-r--r--mkspecs/common/macx.conf8
-rw-r--r--mkspecs/common/msvc-desktop.conf2
-rw-r--r--mkspecs/common/rtems-base.conf73
-rw-r--r--mkspecs/common/rtems/qplatformdefs.h (renamed from src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h)47
-rw-r--r--mkspecs/devices/linux-imx8-g++/qmake.conf41
-rw-r--r--mkspecs/devices/linux-imx8-g++/qplatformdefs.h (renamed from src/plugins/platforms/mirclient/qmirclientdesktopwindow.h)19
-rw-r--r--mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf40
-rw-r--r--mkspecs/devices/linux-rasp-pi4-v3d-g++/qplatformdefs.h (renamed from src/plugins/platforms/mirclient/qmirclienttheme.h)23
-rw-r--r--mkspecs/features/android/android.prf57
-rw-r--r--mkspecs/features/android/android_deployment_settings.prf37
-rw-r--r--mkspecs/features/android/default_pre.prf77
-rw-r--r--mkspecs/features/android/resolve_config.prf10
-rw-r--r--mkspecs/features/create_cmake.prf110
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in51
-rw-r--r--mkspecs/features/data/cmake/Qt5ImportPlugin.cpp.in2
-rw-r--r--mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in95
-rw-r--r--mkspecs/features/data/testserver/Dockerfile29
-rw-r--r--mkspecs/features/data/testserver/docker-compose-common.yml38
-rw-r--r--mkspecs/features/exclusive_builds.prf9
-rw-r--r--mkspecs/features/exclusive_builds_post.prf2
-rw-r--r--mkspecs/features/lex.prf50
-rw-r--r--mkspecs/features/ltcg.prf2
-rw-r--r--mkspecs/features/mac/default_post.prf3
-rw-r--r--mkspecs/features/mac/no_warn_empty_obj_files.prf7
-rw-r--r--mkspecs/features/qmake_use.prf8
-rw-r--r--mkspecs/features/qml_module.prf17
-rw-r--r--mkspecs/features/qml_plugin.prf2
-rw-r--r--mkspecs/features/qmltestcase.prf10
-rw-r--r--mkspecs/features/qt_android_deps.prf6
-rw-r--r--mkspecs/features/qt_build_config.prf7
-rw-r--r--mkspecs/features/qt_common.prf4
-rw-r--r--mkspecs/features/qt_configure.prf120
-rw-r--r--mkspecs/features/qt_docs.prf25
-rw-r--r--mkspecs/features/qt_functions.prf19
-rw-r--r--mkspecs/features/qt_helper_lib.prf33
-rw-r--r--mkspecs/features/qt_module.prf11
-rw-r--r--mkspecs/features/qt_module_pris.prf27
-rw-r--r--mkspecs/features/qt_plugin.prf3
-rw-r--r--mkspecs/features/sanitizer.prf25
-rw-r--r--mkspecs/features/testcase.prf16
-rw-r--r--mkspecs/features/unsupported/testserver.prf (renamed from tests/auto/testserver.pri)29
-rw-r--r--mkspecs/features/win32/dumpcpp.prf16
-rw-r--r--mkspecs/features/yacc.prf59
-rw-r--r--mkspecs/macx-clang/Info.plist.app2
-rw-r--r--mkspecs/macx-clang/Info.plist.lib2
-rw-r--r--mkspecs/macx-g++/Info.plist.app2
-rw-r--r--mkspecs/macx-g++/Info.plist.lib2
-rw-r--r--mkspecs/macx-icc/Info.plist.app2
-rw-r--r--mkspecs/macx-icc/Info.plist.lib2
-rw-r--r--mkspecs/macx-ios-clang/Info.plist.app2
-rw-r--r--mkspecs/macx-ios-clang/Info.plist.lib2
-rw-r--r--mkspecs/macx-ios-clang/qmake.conf2
-rw-r--r--mkspecs/macx-tvos-clang/Info.plist.app2
-rw-r--r--mkspecs/macx-tvos-clang/Info.plist.lib2
-rw-r--r--mkspecs/macx-tvos-clang/qmake.conf2
-rw-r--r--mkspecs/macx-watchos-clang/Info.plist.app2
-rw-r--r--mkspecs/macx-watchos-clang/Info.plist.lib2
-rw-r--r--mkspecs/macx-watchos-clang/qmake.conf2
-rw-r--r--mkspecs/win32-clang-g++/qmake.conf8
-rw-r--r--mkspecs/win32-clang-msvc/qmake.conf7
-rw-r--r--qmake/Makefile.unix75
-rw-r--r--qmake/Makefile.win3219
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp39
-rw-r--r--qmake/generators/mac/pbuilder_pbx.h7
-rw-r--r--qmake/generators/makefile.cpp440
-rw-r--r--qmake/generators/makefile.h18
-rw-r--r--qmake/generators/makefiledeps.cpp186
-rw-r--r--qmake/generators/makefiledeps.h19
-rw-r--r--qmake/generators/metamakefile.cpp80
-rw-r--r--qmake/generators/projectgenerator.cpp20
-rw-r--r--qmake/generators/projectgenerator.h5
-rw-r--r--qmake/generators/unix/unixmake.cpp51
-rw-r--r--qmake/generators/unix/unixmake.h12
-rw-r--r--qmake/generators/unix/unixmake2.cpp257
-rw-r--r--qmake/generators/win32/mingw_make.cpp62
-rw-r--r--qmake/generators/win32/mingw_make.h6
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp16
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp23
-rw-r--r--qmake/generators/win32/msvc_nmake.h11
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp1
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h2
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp22
-rw-r--r--qmake/generators/win32/winmakefile.cpp169
-rw-r--r--qmake/generators/win32/winmakefile.h10
-rw-r--r--qmake/generators/xmloutput.cpp6
-rw-r--r--qmake/library/ioutils.cpp1
-rw-r--r--qmake/library/proitems.cpp4
-rw-r--r--qmake/library/proitems.h7
-rw-r--r--qmake/library/qmakebuiltins.cpp15
-rw-r--r--qmake/library/qmakeevaluator.cpp32
-rw-r--r--qmake/library/qmakeevaluator.h15
-rw-r--r--qmake/library/qmakeevaluator_p.h2
-rw-r--r--qmake/library/qmakeglobals.cpp1
-rw-r--r--qmake/library/qmakeparser.cpp2
-rw-r--r--qmake/library/qmakeparser.h1
-rw-r--r--qmake/option.cpp8
-rw-r--r--qmake/option.h1
-rw-r--r--qmake/project.cpp8
-rw-r--r--qmake/project.h6
-rw-r--r--qmake/qmake.pro24
-rw-r--r--src/3rdparty/VulkanMemoryAllocator.pri1
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/LICENSE.txt19
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch402
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch14
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch13
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/qt_attribution.json16
-rw-r--r--src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h16790
-rw-r--r--src/3rdparty/double-conversion/README8
-rw-r--r--src/3rdparty/double-conversion/double-conversion.cc30
-rw-r--r--src/3rdparty/double-conversion/double-conversion.pri4
-rw-r--r--src/3rdparty/double-conversion/ieee.h4
-rw-r--r--src/3rdparty/double-conversion/include/double-conversion/utils.h15
-rw-r--r--src/3rdparty/double-conversion/qt_attribution.json4
-rw-r--r--src/3rdparty/forkfd/forkfd.c188
-rw-r--r--src/3rdparty/forkfd/forkfd.h5
-rw-r--r--src/3rdparty/forkfd/forkfd_atomic.h39
-rw-r--r--src/3rdparty/forkfd/forkfd_c11.h64
-rw-r--r--src/3rdparty/forkfd/forkfd_freebsd.c101
-rw-r--r--src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp2
-rw-r--r--src/3rdparty/harfbuzz/tests/shaping/main.cpp4
-rw-r--r--src/3rdparty/libjpeg/jconfig.h2
-rw-r--r--src/3rdparty/libjpeg/jconfigint.h2
-rw-r--r--src/3rdparty/libjpeg/qt_attribution.json2
-rw-r--r--src/3rdparty/libjpeg/src/ChangeLog.md38
-rw-r--r--src/3rdparty/libjpeg/src/README.md28
-rw-r--r--src/3rdparty/libjpeg/src/jchuff.c6
-rw-r--r--src/3rdparty/libjpeg/src/jcmaster.c2
-rw-r--r--src/3rdparty/libjpeg/src/jdhuff.c10
-rw-r--r--src/3rdparty/libjpeg/src/jdmerge.c2
-rw-r--r--src/3rdparty/libjpeg/src/jdsample.c14
-rw-r--r--src/3rdparty/md4c.pri3
-rw-r--r--src/3rdparty/md4c/LICENSE.md22
-rw-r--r--src/3rdparty/md4c/md4c.c6173
-rw-r--r--src/3rdparty/md4c/md4c.h373
-rw-r--r--src/3rdparty/md4c/qt_attribution.json15
-rw-r--r--src/3rdparty/pcre2/patches/0001-fix-rtems-build-undefine-madvise.patch28
-rw-r--r--src/3rdparty/pcre2/src/sljit/sljitUtils.c2
-rw-r--r--src/3rdparty/sha3/brg_endian.h2
-rw-r--r--src/3rdparty/sqlite.pri8
-rw-r--r--src/3rdparty/sqlite/patches/0001-Fix-CVE-2019-16168-in-SQLite.patch42
-rw-r--r--src/3rdparty/sqlite/qt_attribution.json4
-rw-r--r--src/3rdparty/sqlite/sqlite3.c9186
-rw-r--r--src/3rdparty/sqlite/sqlite3.h81
-rw-r--r--src/android/jar/jar.pro1
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java19
-rw-r--r--src/android/java/java.pro2
-rw-r--r--src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java306
-rw-r--r--src/android/templates/AndroidManifest.xml7
-rw-r--r--src/android/templates/build.gradle9
-rw-r--r--src/android/templates/res/values/libs.xml15
-rw-r--r--src/android/templates/templates.pro2
-rw-r--r--src/angle/src/config.pri1
-rw-r--r--src/concurrent/qtconcurrentcompilertest.h2
-rw-r--r--src/concurrent/qtconcurrentfilterkernel.h2
-rw-r--r--src/concurrent/qtconcurrentfunctionwrappers.h2
-rw-r--r--src/concurrent/qtconcurrentiteratekernel.h8
-rw-r--r--src/concurrent/qtconcurrentmapkernel.h22
-rw-r--r--src/concurrent/qtconcurrentreducekernel.h12
-rw-r--r--src/concurrent/qtconcurrentrun.h8
-rw-r--r--src/concurrent/qtconcurrentthreadengine.cpp10
-rw-r--r--src/corelib/Qt5AndroidSupport.cmake197
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in6
-rw-r--r--src/corelib/Qt5CoreMacros.cmake32
-rw-r--r--src/corelib/Qt5ModuleLocation.cmake.in2
-rw-r--r--src/corelib/animation/qabstractanimation.cpp16
-rw-r--r--src/corelib/animation/qabstractanimation_p.h2
-rw-r--r--src/corelib/animation/qanimationgroup_p.h2
-rw-r--r--src/corelib/animation/qpropertyanimation.cpp18
-rw-r--r--src/corelib/animation/qpropertyanimation_p.h2
-rw-r--r--src/corelib/animation/qsequentialanimationgroup_p.h2
-rw-r--r--src/corelib/animation/qvariantanimation.cpp9
-rw-r--r--src/corelib/codecs/qlatincodec.cpp22
-rw-r--r--src/corelib/codecs/qtextcodec.cpp69
-rw-r--r--src/corelib/codecs/qtextcodec_p.h2
-rw-r--r--src/corelib/codecs/qutfcodec.cpp10
-rw-r--r--src/corelib/codecs/qutfcodec_p.h2
-rw-r--r--src/corelib/configure.json149
-rw-r--r--src/corelib/corelib.pro24
-rw-r--r--src/corelib/doc/snippets/cmake-macros/examples.cmake11
-rw-r--r--src/corelib/doc/snippets/code/doc_src_containers.cpp8
-rw-r--r--src/corelib/doc/snippets/code/doc_src_qset.cpp8
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp4
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp14
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp28
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp16
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp10
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp30
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp12
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp6
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp4
-rw-r--r--src/corelib/doc/snippets/hellotrmain.cpp4
-rw-r--r--src/corelib/doc/snippets/qstack/main.cpp2
-rw-r--r--src/corelib/doc/snippets/qstringlist/main.cpp6
-rw-r--r--src/corelib/doc/src/cmake-macros.qdoc69
-rw-r--r--src/corelib/doc/src/containers.qdoc8
-rw-r--r--src/corelib/doc/src/includes/containers-range-constructor.qdocinc2
-rw-r--r--src/corelib/eval.pri4
-rw-r--r--src/corelib/global/archdetect.cpp4
-rw-r--r--src/corelib/global/global.pri17
-rw-r--r--src/corelib/global/qcompilerdetection.h13
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h5
-rw-r--r--src/corelib/global/qflags.h90
-rw-r--r--src/corelib/global/qfloat16.cpp88
-rw-r--r--src/corelib/global/qfloat16.h157
-rw-r--r--src/corelib/global/qfloat16_f16c.c4
-rw-r--r--src/corelib/global/qfloat16tables.cpp3266
-rw-r--r--src/corelib/global/qglobal.cpp197
-rw-r--r--src/corelib/global/qglobal.h190
-rw-r--r--src/corelib/global/qglobalstatic.h25
-rw-r--r--src/corelib/global/qhooks.cpp2
-rw-r--r--src/corelib/global/qlibraryinfo.cpp237
-rw-r--r--src/corelib/global/qlibraryinfo.h4
-rw-r--r--src/corelib/global/qlogging.cpp102
-rw-r--r--src/corelib/global/qlogging.h25
-rw-r--r--src/corelib/global/qmalloc.cpp8
-rw-r--r--src/corelib/global/qmemory_p.h (renamed from src/corelib/global/qfloat16_p.h)54
-rw-r--r--src/corelib/global/qnamespace.h66
-rw-r--r--src/corelib/global/qnamespace.qdoc45
-rw-r--r--src/corelib/global/qnumeric.cpp28
-rw-r--r--src/corelib/global/qnumeric.h11
-rw-r--r--src/corelib/global/qnumeric_p.h28
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp2
-rw-r--r--src/corelib/global/qoperatingsystemversion.h2
-rw-r--r--src/corelib/global/qoperatingsystemversion_win.cpp4
-rw-r--r--src/corelib/global/qprocessordetection.h14
-rw-r--r--src/corelib/global/qrandom.cpp34
-rw-r--r--src/corelib/global/qrandom.h6
-rw-r--r--src/corelib/global/qrandom_p.h4
-rw-r--r--src/corelib/global/qsystemdetection.h11
-rw-r--r--src/corelib/global/qtrace_p.h2
-rw-r--r--src/corelib/global/qtypeinfo.h3
-rw-r--r--src/corelib/io/forkfd_qt.cpp31
-rw-r--r--src/corelib/io/io.pri5
-rw-r--r--src/corelib/io/qabstractfileengine.cpp10
-rw-r--r--src/corelib/io/qabstractfileengine_p.h2
-rw-r--r--src/corelib/io/qbuffer.cpp2
-rw-r--r--src/corelib/io/qdebug.cpp42
-rw-r--r--src/corelib/io/qdebug.h15
-rw-r--r--src/corelib/io/qdir.cpp46
-rw-r--r--src/corelib/io/qdir.h8
-rw-r--r--src/corelib/io/qdir_p.h6
-rw-r--r--src/corelib/io/qdiriterator.cpp45
-rw-r--r--src/corelib/io/qfile.cpp55
-rw-r--r--src/corelib/io/qfile.h10
-rw-r--r--src/corelib/io/qfiledevice.cpp14
-rw-r--r--src/corelib/io/qfiledevice_p.h4
-rw-r--r--src/corelib/io/qfileinfo.cpp89
-rw-r--r--src/corelib/io/qfileinfo.h8
-rw-r--r--src/corelib/io/qfileinfo_p.h10
-rw-r--r--src/corelib/io/qfileselector.cpp6
-rw-r--r--src/corelib/io/qfilesystemengine.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_p.h32
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp60
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp27
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp6
-rw-r--r--src/corelib/io/qfilesystemmetadata_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp93
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.mm34
-rw-r--r--src/corelib/io/qfilesystemwatcher_inotify.cpp54
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp27
-rw-r--r--src/corelib/io/qfilesystemwatcher_polling.cpp41
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp82
-rw-r--r--src/corelib/io/qfsfileengine.cpp16
-rw-r--r--src/corelib/io/qfsfileengine_p.h2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp20
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/corelib/io/qipaddress.cpp14
-rw-r--r--src/corelib/io/qipaddress_p.h2
-rw-r--r--src/corelib/io/qlockfile_unix.cpp7
-rw-r--r--src/corelib/io/qloggingcategory.cpp18
-rw-r--r--src/corelib/io/qloggingcategory.h51
-rw-r--r--src/corelib/io/qloggingregistry.cpp11
-rw-r--r--src/corelib/io/qnoncontiguousbytedevice.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp11
-rw-r--r--src/corelib/io/qprocess.h9
-rw-r--r--src/corelib/io/qprocess_p.h54
-rw-r--r--src/corelib/io/qprocess_unix.cpp14
-rw-r--r--src/corelib/io/qresource.cpp110
-rw-r--r--src/corelib/io/qresource.h5
-rw-r--r--src/corelib/io/qresource_p.h2
-rw-r--r--src/corelib/io/qsavefile.cpp40
-rw-r--r--src/corelib/io/qsettings.cpp52
-rw-r--r--src/corelib/io/qsettings_win.cpp30
-rw-r--r--src/corelib/io/qstandardpaths_android.cpp2
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp110
-rw-r--r--src/corelib/io/qstorageinfo.h6
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp4
-rw-r--r--src/corelib/io/qt_attribution.json2
-rw-r--r--src/corelib/io/qtemporaryfile.cpp22
-rw-r--r--src/corelib/io/qtemporaryfile_p.h6
-rw-r--r--src/corelib/io/qtldurl.cpp14
-rw-r--r--src/corelib/io/qurl.cpp79
-rw-r--r--src/corelib/io/qurl.h12
-rw-r--r--src/corelib/io/qurl_p.h2
-rw-r--r--src/corelib/io/qurlidna.cpp11
-rw-r--r--src/corelib/io/qurlquery.cpp24
-rw-r--r--src/corelib/io/qurlquery.h10
-rw-r--r--src/corelib/io/qurlrecode.cpp4
-rw-r--r--src/corelib/io/qurltlds_p.h27587
-rw-r--r--src/corelib/io/qwindowspipereader.cpp4
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp4
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp41
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h40
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel_p.h2
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel_p.h2
-rw-r--r--src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp2
-rw-r--r--src/corelib/itemmodels/qconcatenatetablesproxymodel.h2
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp4
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.h10
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel_p.h2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp104
-rw-r--r--src/corelib/itemmodels/qtransposeproxymodel.h2
-rw-r--r--src/corelib/kernel/kernel.pri8
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp6
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.h4
-rw-r--r--src/corelib/kernel/qabstractnativeeventfilter.cpp1
-rw-r--r--src/corelib/kernel/qabstractnativeeventfilter.h4
-rw-r--r--src/corelib/kernel/qbasictimer.cpp85
-rw-r--r--src/corelib/kernel/qbasictimer.h31
-rw-r--r--src/corelib/kernel/qcore_foundation.mm18
-rw-r--r--src/corelib/kernel/qcore_mac.cpp3
-rw-r--r--src/corelib/kernel/qcore_mac_objc.mm8
-rw-r--r--src/corelib/kernel/qcore_mac_p.h22
-rw-r--r--src/corelib/kernel/qcore_unix.cpp4
-rw-r--r--src/corelib/kernel/qcore_unix_p.h10
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp149
-rw-r--r--src/corelib/kernel/qcoreapplication.h4
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h14
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp9
-rw-r--r--src/corelib/kernel/qcoreevent.cpp14
-rw-r--r--src/corelib/kernel/qcoreevent.h2
-rw-r--r--src/corelib/kernel/qcoreglobaldata.cpp4
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp24
-rw-r--r--src/corelib/kernel/qdeadlinetimer.h50
-rw-r--r--src/corelib/kernel/qelapsedtimer.cpp8
-rw-r--r--src/corelib/kernel/qelapsedtimer.h30
-rw-r--r--src/corelib/kernel/qelapsedtimer_generic.cpp22
-rw-r--r--src/corelib/kernel/qelapsedtimer_mac.cpp24
-rw-r--r--src/corelib/kernel/qelapsedtimer_unix.cpp24
-rw-r--r--src/corelib/kernel/qelapsedtimer_win.cpp22
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm15
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf_p.h6
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp6
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib_p.h6
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp8
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix_p.h22
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp172
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h5
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp23
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt_p.h2
-rw-r--r--src/corelib/kernel/qeventloop.cpp12
-rw-r--r--src/corelib/kernel/qeventloop_p.h4
-rw-r--r--src/corelib/kernel/qfunctions_fake_env_p.h4
-rw-r--r--src/corelib/kernel/qjni.cpp8
-rw-r--r--src/corelib/kernel/qmetaobject.cpp63
-rw-r--r--src/corelib/kernel/qmetaobject.h3
-rw-r--r--src/corelib/kernel/qmetaobject_moc_p.h4
-rw-r--r--src/corelib/kernel/qmetaobject_p.h18
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder.cpp12
-rw-r--r--src/corelib/kernel/qmetaobjectbuilder_p.h8
-rw-r--r--src/corelib/kernel/qmetatype.cpp79
-rw-r--r--src/corelib/kernel/qmetatype.h22
-rw-r--r--src/corelib/kernel/qmetatype_p.h18
-rw-r--r--src/corelib/kernel/qmetatypeswitcher_p.h2
-rw-r--r--src/corelib/kernel/qobject.cpp1271
-rw-r--r--src/corelib/kernel/qobject.h52
-rw-r--r--src/corelib/kernel/qobject_p.h319
-rw-r--r--src/corelib/kernel/qobjectdefs.h74
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h4
-rw-r--r--src/corelib/kernel/qpointer.h26
-rw-r--r--src/corelib/kernel/qpoll.cpp9
-rw-r--r--src/corelib/kernel/qppsattribute.cpp2
-rw-r--r--src/corelib/kernel/qppsattribute_p.h2
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp19
-rw-r--r--src/corelib/kernel/qsharedmemory.h29
-rw-r--r--src/corelib/kernel/qsharedmemory_p.h16
-rw-r--r--src/corelib/kernel/qsharedmemory_unix.cpp7
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp5
-rw-r--r--src/corelib/kernel/qsignalmapper.cpp8
-rw-r--r--src/corelib/kernel/qsignalmapper.h6
-rw-r--r--src/corelib/kernel/qsocketnotifier.cpp6
-rw-r--r--src/corelib/kernel/qsystemerror.cpp2
-rw-r--r--src/corelib/kernel/qsystemsemaphore_systemv.cpp6
-rw-r--r--src/corelib/kernel/qtcore_eval.cpp560
-rw-r--r--src/corelib/kernel/qtestsupport_core.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp33
-rw-r--r--src/corelib/kernel/qtimer.h2
-rw-r--r--src/corelib/kernel/qtimerinfo_unix.cpp8
-rw-r--r--src/corelib/kernel/qtranslator.cpp3
-rw-r--r--src/corelib/kernel/qvariant.cpp65
-rw-r--r--src/corelib/kernel/qvariant.h100
-rw-r--r--src/corelib/kernel/qvariant_p.h10
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp6
-rw-r--r--src/corelib/kernel/qwinregistry.cpp120
-rw-r--r--src/corelib/kernel/qwinregistry_p.h (renamed from src/corelib/thread/qmutexpool_p.h)53
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern.cpp6
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern_p.h2
-rw-r--r--src/corelib/mimetypes/qmimemagicrule_p.h2
-rw-r--r--src/corelib/mimetypes/qmimemagicrulematcher_p.h2
-rw-r--r--src/corelib/mimetypes/qmimeprovider.cpp3
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp28
-rw-r--r--src/corelib/mimetypes/qmimetype.h12
-rw-r--r--src/corelib/mimetypes/qmimetype_p.h21
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp3
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp16
-rw-r--r--src/corelib/plugin/qlibrary.cpp38
-rw-r--r--src/corelib/plugin/qlibrary_p.h4
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp41
-rw-r--r--src/corelib/plugin/qplugin.h32
-rw-r--r--src/corelib/plugin/qplugin_p.h6
-rw-r--r--src/corelib/plugin/qpluginloader.cpp11
-rw-r--r--src/corelib/plugin/quuid.cpp16
-rw-r--r--src/corelib/plugin/quuid.h44
-rw-r--r--src/corelib/serialization/qcborvalue.cpp38
-rw-r--r--src/corelib/serialization/qcborvalue.h3
-rw-r--r--src/corelib/serialization/qcborvalue_p.h56
-rw-r--r--src/corelib/serialization/qdatastream.cpp19
-rw-r--r--src/corelib/serialization/qdatastream.h34
-rw-r--r--src/corelib/serialization/qjson.cpp6
-rw-r--r--src/corelib/serialization/qjson_p.h113
-rw-r--r--src/corelib/serialization/qjsonarray.cpp8
-rw-r--r--src/corelib/serialization/qjsonarray.h10
-rw-r--r--src/corelib/serialization/qjsondocument.cpp21
-rw-r--r--src/corelib/serialization/qjsondocument.h9
-rw-r--r--src/corelib/serialization/qjsonobject.cpp317
-rw-r--r--src/corelib/serialization/qjsonobject.h51
-rw-r--r--src/corelib/serialization/qjsonparser.cpp6
-rw-r--r--src/corelib/serialization/qjsonvalue.cpp27
-rw-r--r--src/corelib/serialization/qjsonvalue.h9
-rw-r--r--src/corelib/serialization/qtextstream.cpp134
-rw-r--r--src/corelib/serialization/qtextstream.h26
-rw-r--r--src/corelib/serialization/qxmlstream.cpp44
-rw-r--r--src/corelib/serialization/qxmlstream.g2
-rw-r--r--src/corelib/serialization/qxmlstream.h34
-rw-r--r--src/corelib/serialization/qxmlstream_p.h10
-rw-r--r--src/corelib/statemachine/qstate_p.h8
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp65
-rw-r--r--src/corelib/statemachine/qstatemachine.h3
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h26
-rw-r--r--src/corelib/text/UNICODE_LICENSE.txt (renamed from src/corelib/tools/UNICODE_LICENSE.txt)0
-rw-r--r--src/corelib/text/qbytearray.cpp (renamed from src/corelib/tools/qbytearray.cpp)165
-rw-r--r--src/corelib/text/qbytearray.h (renamed from src/corelib/tools/qbytearray.h)118
-rw-r--r--src/corelib/text/qbytearray_p.h (renamed from src/corelib/tools/qbytearray_p.h)2
-rw-r--r--src/corelib/text/qbytearraylist.cpp (renamed from src/corelib/tools/qbytearraylist.cpp)0
-rw-r--r--src/corelib/text/qbytearraylist.h (renamed from src/corelib/tools/qbytearraylist.h)3
-rw-r--r--src/corelib/text/qbytearraymatcher.cpp (renamed from src/corelib/tools/qbytearraymatcher.cpp)12
-rw-r--r--src/corelib/text/qbytearraymatcher.h (renamed from src/corelib/tools/qbytearraymatcher.h)14
-rw-r--r--src/corelib/text/qbytedata_p.h (renamed from src/corelib/tools/qbytedata_p.h)2
-rw-r--r--src/corelib/text/qchar.cpp (renamed from src/corelib/tools/qchar.cpp)102
-rw-r--r--src/corelib/text/qchar.h (renamed from src/corelib/tools/qchar.h)264
-rw-r--r--src/corelib/text/qcollator.cpp (renamed from src/corelib/tools/qcollator.cpp)130
-rw-r--r--src/corelib/text/qcollator.h (renamed from src/corelib/tools/qcollator.h)23
-rw-r--r--src/corelib/text/qcollator_icu.cpp (renamed from src/corelib/tools/qcollator_icu.cpp)41
-rw-r--r--src/corelib/text/qcollator_macx.cpp (renamed from src/corelib/tools/qcollator_macx.cpp)46
-rw-r--r--src/corelib/text/qcollator_p.h (renamed from src/corelib/tools/qcollator_p.h)0
-rw-r--r--src/corelib/text/qcollator_posix.cpp (renamed from src/corelib/tools/qcollator_posix.cpp)14
-rw-r--r--src/corelib/text/qcollator_win.cpp (renamed from src/corelib/tools/qcollator_win.cpp)34
-rw-r--r--src/corelib/text/qdoublescanprint_p.h (renamed from src/corelib/tools/qdoublescanprint_p.h)0
-rw-r--r--src/corelib/text/qharfbuzz.cpp (renamed from src/corelib/tools/qharfbuzz.cpp)0
-rw-r--r--src/corelib/text/qharfbuzz_p.h (renamed from src/corelib/tools/qharfbuzz_p.h)0
-rw-r--r--src/corelib/text/qlocale.cpp (renamed from src/corelib/tools/qlocale.cpp)847
-rw-r--r--src/corelib/text/qlocale.h (renamed from src/corelib/tools/qlocale.h)40
-rw-r--r--src/corelib/text/qlocale.qdoc (renamed from src/corelib/tools/qlocale.qdoc)9
-rw-r--r--src/corelib/text/qlocale_data_p.h6874
-rw-r--r--src/corelib/text/qlocale_icu.cpp (renamed from src/corelib/tools/qlocale_icu.cpp)0
-rw-r--r--src/corelib/text/qlocale_mac.mm (renamed from src/corelib/tools/qlocale_mac.mm)8
-rw-r--r--src/corelib/text/qlocale_p.h (renamed from src/corelib/tools/qlocale_p.h)58
-rw-r--r--src/corelib/text/qlocale_tools.cpp (renamed from src/corelib/tools/qlocale_tools.cpp)8
-rw-r--r--src/corelib/text/qlocale_tools_p.h (renamed from src/corelib/tools/qlocale_tools_p.h)0
-rw-r--r--src/corelib/text/qlocale_unix.cpp (renamed from src/corelib/tools/qlocale_unix.cpp)8
-rw-r--r--src/corelib/text/qlocale_win.cpp (renamed from src/corelib/tools/qlocale_win.cpp)16
-rw-r--r--src/corelib/text/qregexp.cpp (renamed from src/corelib/tools/qregexp.cpp)39
-rw-r--r--src/corelib/text/qregexp.h (renamed from src/corelib/tools/qregexp.h)10
-rw-r--r--src/corelib/text/qregularexpression.cpp (renamed from src/corelib/tools/qregularexpression.cpp)37
-rw-r--r--src/corelib/text/qregularexpression.h (renamed from src/corelib/tools/qregularexpression.h)24
-rw-r--r--src/corelib/text/qstring.cpp (renamed from src/corelib/tools/qstring.cpp)1147
-rw-r--r--src/corelib/text/qstring.h (renamed from src/corelib/tools/qstring.h)725
-rw-r--r--src/corelib/text/qstring_compat.cpp (renamed from src/corelib/tools/qstring_compat.cpp)0
-rw-r--r--src/corelib/text/qstring_mips_dsp_asm.S (renamed from src/corelib/tools/qstring_mips_dsp_asm.S)0
-rw-r--r--src/corelib/text/qstringalgorithms.h (renamed from src/corelib/tools/qstringalgorithms.h)52
-rw-r--r--src/corelib/text/qstringalgorithms_p.h (renamed from src/corelib/tools/qstringalgorithms_p.h)4
-rw-r--r--src/corelib/text/qstringbuilder.cpp (renamed from src/corelib/tools/qstringbuilder.cpp)2
-rw-r--r--src/corelib/text/qstringbuilder.h (renamed from src/corelib/tools/qstringbuilder.h)12
-rw-r--r--src/corelib/text/qstringiterator.qdoc (renamed from src/corelib/tools/qstringiterator.qdoc)0
-rw-r--r--src/corelib/text/qstringiterator_p.h (renamed from src/corelib/tools/qstringiterator_p.h)0
-rw-r--r--src/corelib/text/qstringlist.cpp (renamed from src/corelib/tools/qstringlist.cpp)72
-rw-r--r--src/corelib/text/qstringlist.h (renamed from src/corelib/tools/qstringlist.h)87
-rw-r--r--src/corelib/text/qstringliteral.h (renamed from src/corelib/tools/qstringliteral.h)9
-rw-r--r--src/corelib/text/qstringmatcher.cpp (renamed from src/corelib/tools/qstringmatcher.cpp)88
-rw-r--r--src/corelib/text/qstringmatcher.h (renamed from src/corelib/tools/qstringmatcher.h)5
-rw-r--r--src/corelib/text/qstringview.cpp (renamed from src/corelib/tools/qstringview.cpp)100
-rw-r--r--src/corelib/text/qstringview.h (renamed from src/corelib/tools/qstringview.h)121
-rw-r--r--src/corelib/text/qt_attribution.json (renamed from src/corelib/tools/qt_attribution.json)6
-rw-r--r--src/corelib/text/qtextboundaryfinder.cpp (renamed from src/corelib/tools/qtextboundaryfinder.cpp)0
-rw-r--r--src/corelib/text/qtextboundaryfinder.h (renamed from src/corelib/tools/qtextboundaryfinder.h)0
-rw-r--r--src/corelib/text/qunicodetables.cpp (renamed from src/corelib/tools/qunicodetables.cpp)5320
-rw-r--r--src/corelib/text/qunicodetables_p.h (renamed from src/corelib/tools/qunicodetables_p.h)79
-rw-r--r--src/corelib/text/qunicodetools.cpp (renamed from src/corelib/tools/qunicodetools.cpp)29
-rw-r--r--src/corelib/text/qunicodetools_p.h (renamed from src/corelib/tools/qunicodetools_p.h)1
-rw-r--r--src/corelib/text/qvsnprintf.cpp (renamed from src/corelib/tools/qvsnprintf.cpp)0
-rw-r--r--src/corelib/text/text.pri100
-rw-r--r--src/corelib/thread/qatomic.cpp75
-rw-r--r--src/corelib/thread/qatomic.h24
-rw-r--r--src/corelib/thread/qatomic_bootstrap.h10
-rw-r--r--src/corelib/thread/qatomic_cxx11.h106
-rw-r--r--src/corelib/thread/qatomic_msvc.h94
-rw-r--r--src/corelib/thread/qbasicatomic.h206
-rw-r--r--src/corelib/thread/qfutex_p.h32
-rw-r--r--src/corelib/thread/qfuture.h82
-rw-r--r--src/corelib/thread/qfutureinterface.cpp47
-rw-r--r--src/corelib/thread/qfutureinterface.h13
-rw-r--r--src/corelib/thread/qfutureinterface_p.h4
-rw-r--r--src/corelib/thread/qfuturewatcher.cpp6
-rw-r--r--src/corelib/thread/qgenericatomic.h120
-rw-r--r--src/corelib/thread/qlocking_p.h119
-rw-r--r--src/corelib/thread/qmutex.cpp158
-rw-r--r--src/corelib/thread/qmutex.h90
-rw-r--r--src/corelib/thread/qmutex_linux.cpp12
-rw-r--r--src/corelib/thread/qmutex_mac.cpp2
-rw-r--r--src/corelib/thread/qmutex_p.h14
-rw-r--r--src/corelib/thread/qmutex_unix.cpp6
-rw-r--r--src/corelib/thread/qmutex_win.cpp2
-rw-r--r--src/corelib/thread/qmutexpool.cpp151
-rw-r--r--src/corelib/thread/qorderedmutexlocker_p.h62
-rw-r--r--src/corelib/thread/qreadwritelock.cpp25
-rw-r--r--src/corelib/thread/qreadwritelock.h36
-rw-r--r--src/corelib/thread/qreadwritelock_p.h18
-rw-r--r--src/corelib/thread/qresultstore.h4
-rw-r--r--src/corelib/thread/qsemaphore.cpp6
-rw-r--r--src/corelib/thread/qsemaphore.h14
-rw-r--r--src/corelib/thread/qthread.cpp45
-rw-r--r--src/corelib/thread/qthread.h6
-rw-r--r--src/corelib/thread/qthread_p.h20
-rw-r--r--src/corelib/thread/qthread_unix.cpp64
-rw-r--r--src/corelib/thread/qthread_win.cpp20
-rw-r--r--src/corelib/thread/qthreadpool_p.h2
-rw-r--r--src/corelib/thread/qthreadstorage.cpp6
-rw-r--r--src/corelib/thread/qthreadstorage.h4
-rw-r--r--src/corelib/thread/qwaitcondition_unix.cpp2
-rw-r--r--src/corelib/thread/thread.pri3
-rw-r--r--src/corelib/time/qcalendar.cpp1109
-rw-r--r--src/corelib/time/qcalendar.h193
-rw-r--r--src/corelib/time/qcalendarbackend_p.h144
-rw-r--r--src/corelib/time/qcalendarmath_p.h77
-rw-r--r--src/corelib/time/qdatetime.cpp (renamed from src/corelib/tools/qdatetime.cpp)1502
-rw-r--r--src/corelib/time/qdatetime.h (renamed from src/corelib/tools/qdatetime.h)87
-rw-r--r--src/corelib/time/qdatetime_p.h (renamed from src/corelib/tools/qdatetime_p.h)24
-rw-r--r--src/corelib/time/qdatetimeparser.cpp (renamed from src/corelib/tools/qdatetimeparser.cpp)259
-rw-r--r--src/corelib/time/qdatetimeparser_p.h (renamed from src/corelib/tools/qdatetimeparser_p.h)24
-rw-r--r--src/corelib/time/qgregoriancalendar.cpp175
-rw-r--r--src/corelib/time/qgregoriancalendar_p.h90
-rw-r--r--src/corelib/time/qhijricalendar.cpp126
-rw-r--r--src/corelib/time/qhijricalendar_data_p.h1205
-rw-r--r--src/corelib/time/qhijricalendar_p.h83
-rw-r--r--src/corelib/time/qislamiccivilcalendar.cpp127
-rw-r--r--src/corelib/time/qislamiccivilcalendar_p.h76
-rw-r--r--src/corelib/time/qjalalicalendar.cpp212
-rw-r--r--src/corelib/time/qjalalicalendar_data_p.h906
-rw-r--r--src/corelib/time/qjalalicalendar_p.h86
-rw-r--r--src/corelib/time/qjuliancalendar.cpp128
-rw-r--r--src/corelib/time/qjuliancalendar_p.h74
-rw-r--r--src/corelib/time/qmilankoviccalendar.cpp139
-rw-r--r--src/corelib/time/qmilankoviccalendar_p.h74
-rw-r--r--src/corelib/time/qromancalendar.cpp105
-rw-r--r--src/corelib/time/qromancalendar_data_p.h2661
-rw-r--r--src/corelib/time/qromancalendar_p.h79
-rw-r--r--src/corelib/time/qtimezone.cpp (renamed from src/corelib/tools/qtimezone.cpp)2
-rw-r--r--src/corelib/time/qtimezone.h (renamed from src/corelib/tools/qtimezone.h)8
-rw-r--r--src/corelib/time/qtimezoneprivate.cpp (renamed from src/corelib/tools/qtimezoneprivate.cpp)0
-rw-r--r--src/corelib/time/qtimezoneprivate_android.cpp (renamed from src/corelib/tools/qtimezoneprivate_android.cpp)0
-rw-r--r--src/corelib/time/qtimezoneprivate_data_p.h1262
-rw-r--r--src/corelib/time/qtimezoneprivate_icu.cpp (renamed from src/corelib/tools/qtimezoneprivate_icu.cpp)0
-rw-r--r--src/corelib/time/qtimezoneprivate_mac.mm (renamed from src/corelib/tools/qtimezoneprivate_mac.mm)0
-rw-r--r--src/corelib/time/qtimezoneprivate_p.h (renamed from src/corelib/tools/qtimezoneprivate_p.h)6
-rw-r--r--src/corelib/time/qtimezoneprivate_tz.cpp (renamed from src/corelib/tools/qtimezoneprivate_tz.cpp)38
-rw-r--r--src/corelib/time/qtimezoneprivate_win.cpp (renamed from src/corelib/tools/qtimezoneprivate_win.cpp)123
-rw-r--r--src/corelib/time/time.pri71
-rw-r--r--src/corelib/tools/qalgorithms.h66
-rw-r--r--src/corelib/tools/qarraydata.cpp117
-rw-r--r--src/corelib/tools/qarraydata.h48
-rw-r--r--src/corelib/tools/qarraydataops.h4
-rw-r--r--src/corelib/tools/qarraydatapointer.h23
-rw-r--r--src/corelib/tools/qbitarray.h12
-rw-r--r--src/corelib/tools/qcache.h18
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp4
-rw-r--r--src/corelib/tools/qcommandlineoption.h6
-rw-r--r--src/corelib/tools/qcommandlineparser.cpp58
-rw-r--r--src/corelib/tools/qcontainerfwd.h2
-rw-r--r--src/corelib/tools/qcontainertools_impl.h132
-rw-r--r--src/corelib/tools/qcontiguouscache.h20
-rw-r--r--src/corelib/tools/qcryptographichash.cpp4
-rw-r--r--src/corelib/tools/qeasingcurve.cpp69
-rw-r--r--src/corelib/tools/qeasingcurve.h11
-rw-r--r--src/corelib/tools/qfreelist_p.h16
-rw-r--r--src/corelib/tools/qhash.cpp66
-rw-r--r--src/corelib/tools/qhash.h118
-rw-r--r--src/corelib/tools/qhashfunctions.h100
-rw-r--r--src/corelib/tools/qiterator.h15
-rw-r--r--src/corelib/tools/qline.cpp28
-rw-r--r--src/corelib/tools/qline.h9
-rw-r--r--src/corelib/tools/qlinkedlist.cpp18
-rw-r--r--src/corelib/tools/qlinkedlist.h99
-rw-r--r--src/corelib/tools/qlist.cpp22
-rw-r--r--src/corelib/tools/qlist.h173
-rw-r--r--src/corelib/tools/qlocale_data_p.h8789
-rw-r--r--src/corelib/tools/qmap.cpp30
-rw-r--r--src/corelib/tools/qmap.h35
-rw-r--r--src/corelib/tools/qmargins.h208
-rw-r--r--src/corelib/tools/qpair.h37
-rw-r--r--src/corelib/tools/qpair.qdoc1
-rw-r--r--src/corelib/tools/qpoint.cpp23
-rw-r--r--src/corelib/tools/qpoint.h10
-rw-r--r--src/corelib/tools/qqueue.h4
-rw-r--r--src/corelib/tools/qrect.cpp26
-rw-r--r--src/corelib/tools/qrect.h624
-rw-r--r--src/corelib/tools/qrefcount.h26
-rw-r--r--src/corelib/tools/qringbuffer.cpp4
-rw-r--r--src/corelib/tools/qringbuffer_p.h14
-rw-r--r--src/corelib/tools/qscopedpointer.h38
-rw-r--r--src/corelib/tools/qscopedvaluerollback.h14
-rw-r--r--src/corelib/tools/qscopeguard.h20
-rw-r--r--src/corelib/tools/qset.h94
-rw-r--r--src/corelib/tools/qset.qdoc18
-rw-r--r--src/corelib/tools/qshareddata.h62
-rw-r--r--src/corelib/tools/qsharedpointer.cpp68
-rw-r--r--src/corelib/tools/qsharedpointer.h6
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h219
-rw-r--r--src/corelib/tools/qsimd.cpp6
-rw-r--r--src/corelib/tools/qsimd_p.h8
-rw-r--r--src/corelib/tools/qsize.cpp26
-rw-r--r--src/corelib/tools/qsize.h265
-rw-r--r--src/corelib/tools/qstack.h2
-rw-r--r--src/corelib/tools/qtimeline.cpp35
-rw-r--r--src/corelib/tools/qtimeline.h4
-rw-r--r--src/corelib/tools/qtimezoneprivate_data_p.h1154
-rw-r--r--src/corelib/tools/qtools_p.h18
-rw-r--r--src/corelib/tools/qvarlengtharray.h56
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc16
-rw-r--r--src/corelib/tools/qvector.h145
-rw-r--r--src/corelib/tools/qvector.qdoc41
-rw-r--r--src/corelib/tools/qversionnumber.cpp6
-rw-r--r--src/corelib/tools/qversionnumber.h50
-rw-r--r--src/corelib/tools/tools.pri133
-rw-r--r--src/dbus/dbus.pro10
-rw-r--r--src/dbus/doc/snippets/code/src_qdbus_qdbusargument.cpp2
-rw-r--r--src/dbus/qdbus_symbols.cpp15
-rw-r--r--src/dbus/qdbusabstractinterface.cpp133
-rw-r--r--src/dbus/qdbusabstractinterface.h94
-rw-r--r--src/dbus/qdbusargument.cpp4
-rw-r--r--src/dbus/qdbusargument.h8
-rw-r--r--src/dbus/qdbusargument_p.h6
-rw-r--r--src/dbus/qdbusconnection.cpp13
-rw-r--r--src/dbus/qdbusconnection.h8
-rw-r--r--src/dbus/qdbusconnection_p.h10
-rw-r--r--src/dbus/qdbusconnectioninterface.cpp12
-rw-r--r--src/dbus/qdbusconnectioninterface.h2
-rw-r--r--src/dbus/qdbuserror.h11
-rw-r--r--src/dbus/qdbusextratypes.cpp8
-rw-r--r--src/dbus/qdbusextratypes.h23
-rw-r--r--src/dbus/qdbusintegrator.cpp44
-rw-r--r--src/dbus/qdbusintegrator_p.h25
-rw-r--r--src/dbus/qdbusinternalfilters.cpp20
-rw-r--r--src/dbus/qdbusmarshaller.cpp12
-rw-r--r--src/dbus/qdbusmessage.h6
-rw-r--r--src/dbus/qdbusmetaobject.cpp2
-rw-r--r--src/dbus/qdbusmetatype.cpp4
-rw-r--r--src/dbus/qdbuspendingcall.cpp21
-rw-r--r--src/dbus/qdbuspendingcall.h6
-rw-r--r--src/dbus/qdbuspendingcall_p.h2
-rw-r--r--src/dbus/qdbuspendingreply.cpp4
-rw-r--r--src/dbus/qdbuspendingreply.h2
-rw-r--r--src/dbus/qdbusreply.cpp4
-rw-r--r--src/dbus/qdbusserver.cpp4
-rw-r--r--src/dbus/qdbusunixfiledescriptor.cpp10
-rw-r--r--src/dbus/qdbusunixfiledescriptor.h10
-rw-r--r--src/dbus/qdbusutil_p.h14
-rw-r--r--src/dbus/qdbusxmlgenerator.cpp14
-rw-r--r--src/gui/accessible/qaccessible.cpp4
-rw-r--r--src/gui/accessible/qaccessiblecache_p.h2
-rw-r--r--src/gui/configure.json91
-rw-r--r--src/gui/doc/qtgui.qdocconf3
-rw-r--r--src/gui/doc/snippets/textblock-fragments/mainwindow.cpp2
-rw-r--r--src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp2
-rw-r--r--src/gui/doc/snippets/textdocumentendsnippet.cpp2
-rw-r--r--src/gui/doc/src/includes/qt-colors.qdocinc86
-rw-r--r--src/gui/doc/src/includes/svg-colors.qdocinc594
-rw-r--r--src/gui/doc/src/richtext.qdoc69
-rw-r--r--src/gui/gui.pro1
-rw-r--r--src/gui/image/image.pri19
-rw-r--r--src/gui/image/qbitmap.h2
-rw-r--r--src/gui/image/qicon.cpp8
-rw-r--r--src/gui/image/qicon.h12
-rw-r--r--src/gui/image/qiconengine.h2
-rw-r--r--src/gui/image/qimage.cpp204
-rw-r--r--src/gui/image/qimage.h33
-rw-r--r--src/gui/image/qimage_conversions.cpp379
-rw-r--r--src/gui/image/qimage_p.h30
-rw-r--r--src/gui/image/qimage_ssse3.cpp7
-rw-r--r--src/gui/image/qimagereader.cpp35
-rw-r--r--src/gui/image/qmovie.cpp18
-rw-r--r--src/gui/image/qpicture.cpp6
-rw-r--r--src/gui/image/qpicture.h6
-rw-r--r--src/gui/image/qpixmap.cpp12
-rw-r--r--src/gui/image/qpixmap.h8
-rw-r--r--src/gui/image/qpixmap_win.cpp3
-rw-r--r--src/gui/image/qpixmapcache.cpp2
-rw-r--r--src/gui/image/qpixmapcache.h10
-rw-r--r--src/gui/image/qpixmapcache_p.h2
-rw-r--r--src/gui/image/qpnghandler.cpp108
-rw-r--r--src/gui/image/qppmhandler_p.h2
-rw-r--r--src/gui/image/qxbmhandler.cpp1
-rw-r--r--src/gui/image/qxpmhandler.cpp41
-rw-r--r--src/gui/itemmodels/qstandarditemmodel_p.h12
-rw-r--r--src/gui/kernel/kernel.pri2
-rw-r--r--src/gui/kernel/qcursor.cpp2
-rw-r--r--src/gui/kernel/qcursor.h14
-rw-r--r--src/gui/kernel/qdnd_p.h6
-rw-r--r--src/gui/kernel/qevent.cpp378
-rw-r--r--src/gui/kernel/qevent.h54
-rw-r--r--src/gui/kernel/qevent_p.h6
-rw-r--r--src/gui/kernel/qguiapplication.cpp177
-rw-r--r--src/gui/kernel/qguiapplication.h3
-rw-r--r--src/gui/kernel/qguiapplication_p.h27
-rw-r--r--src/gui/kernel/qguivariant.cpp1
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp357
-rw-r--r--src/gui/kernel/qhighdpiscaling_p.h25
-rw-r--r--src/gui/kernel/qinputdevicemanager.cpp4
-rw-r--r--src/gui/kernel/qinputdevicemanager_p.h4
-rw-r--r--src/gui/kernel/qinputdevicemanager_p_p.h5
-rw-r--r--src/gui/kernel/qinputmethod_p.h2
-rw-r--r--src/gui/kernel/qkeysequence.cpp13
-rw-r--r--src/gui/kernel/qkeysequence.h10
-rw-r--r--src/gui/kernel/qopenglcontext.cpp16
-rw-r--r--src/gui/kernel/qopenglcontext_p.h27
-rw-r--r--src/gui/kernel/qpalette.cpp6
-rw-r--r--src/gui/kernel/qpalette.h8
-rw-r--r--src/gui/kernel/qpixelformat.h64
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp6
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h4
-rw-r--r--src/gui/kernel/qplatformintegration.h2
-rw-r--r--src/gui/kernel/qplatformscreen.cpp22
-rw-r--r--src/gui/kernel/qplatformscreen.h3
-rw-r--r--src/gui/kernel/qplatformtheme.h2
-rw-r--r--src/gui/kernel/qplatformwindow.cpp13
-rw-r--r--src/gui/kernel/qplatformwindow.h6
-rw-r--r--src/gui/kernel/qscreen.cpp15
-rw-r--r--src/gui/kernel/qscreen_p.h18
-rw-r--r--src/gui/kernel/qsessionmanager.cpp6
-rw-r--r--src/gui/kernel/qshapedpixmapdndwindow_p.h2
-rw-r--r--src/gui/kernel/qsimpledrag.cpp1
-rw-r--r--src/gui/kernel/qstylehints.cpp44
-rw-r--r--src/gui/kernel/qstylehints.h4
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp2
-rw-r--r--src/gui/kernel/qtouchdevice.cpp42
-rw-r--r--src/gui/kernel/qwindow.cpp9
-rw-r--r--src/gui/kernel/qwindow.h4
-rw-r--r--src/gui/kernel/qwindow_p.h90
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp37
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h9
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h17
-rw-r--r--src/gui/math3d/qgenericmatrix.h4
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp10
-rw-r--r--src/gui/opengl/qopengl.cpp4
-rw-r--r--src/gui/opengl/qopengldebug.cpp2
-rw-r--r--src/gui/opengl/qopengldebug.h6
-rw-r--r--src/gui/opengl/qopenglengineshadermanager_p.h2
-rw-r--r--src/gui/opengl/qopengles2ext.h442
-rw-r--r--src/gui/opengl/qopenglext.h555
-rw-r--r--src/gui/opengl/qopenglextensions_p.h2
-rw-r--r--src/gui/opengl/qopenglframebufferobject.cpp2
-rw-r--r--src/gui/opengl/qopenglframebufferobject_p.h8
-rw-r--r--src/gui/opengl/qopenglfunctions_1_0.cpp4
-rw-r--r--src/gui/opengl/qopenglfunctions_1_1.cpp8
-rw-r--r--src/gui/opengl/qopenglfunctions_1_2.cpp12
-rw-r--r--src/gui/opengl/qopenglfunctions_1_3.cpp16
-rw-r--r--src/gui/opengl/qopenglfunctions_1_4.cpp20
-rw-r--r--src/gui/opengl/qopenglfunctions_1_5.cpp22
-rw-r--r--src/gui/opengl/qopenglfunctions_2_0.cpp24
-rw-r--r--src/gui/opengl/qopenglfunctions_2_1.cpp26
-rw-r--r--src/gui/opengl/qopenglfunctions_3_0.cpp28
-rw-r--r--src/gui/opengl/qopenglfunctions_3_1.cpp20
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp32
-rw-r--r--src/gui/opengl/qopenglfunctions_3_2_core.cpp22
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp36
-rw-r--r--src/gui/opengl/qopenglfunctions_3_3_core.cpp24
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp38
-rw-r--r--src/gui/opengl/qopenglfunctions_4_0_core.cpp26
-rw-r--r--src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp40
-rw-r--r--src/gui/opengl/qopenglfunctions_4_1_core.cpp28
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp42
-rw-r--r--src/gui/opengl/qopenglfunctions_4_2_core.cpp30
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp44
-rw-r--r--src/gui/opengl/qopenglfunctions_4_3_core.cpp32
-rw-r--r--src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp46
-rw-r--r--src/gui/opengl/qopenglfunctions_4_4_core.cpp34
-rw-r--r--src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp50
-rw-r--r--src/gui/opengl/qopenglfunctions_4_5_core.cpp36
-rw-r--r--src/gui/opengl/qopenglgradientcache_p.h2
-rw-r--r--src/gui/opengl/qopenglpaintengine.cpp8
-rw-r--r--src/gui/opengl/qopenglpaintengine_p.h8
-rw-r--r--src/gui/opengl/qopenglpixeltransferoptions.h6
-rw-r--r--src/gui/opengl/qopenglprogrambinarycache.cpp96
-rw-r--r--src/gui/opengl/qopenglprogrambinarycache_p.h44
-rw-r--r--src/gui/opengl/qopenglqueryhelper_p.h24
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp137
-rw-r--r--src/gui/opengl/qopengltexture.cpp263
-rw-r--r--src/gui/opengl/qopengltexture.h26
-rw-r--r--src/gui/opengl/qopengltexture_p.h4
-rw-r--r--src/gui/opengl/qopengltextureglyphcache_p.h2
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h18
-rw-r--r--src/gui/opengl/qopengltextureuploader.cpp18
-rw-r--r--src/gui/opengl/qopenglversionfunctions.h2
-rw-r--r--src/gui/painting/painting.pri58
-rw-r--r--src/gui/painting/qbezier.cpp34
-rw-r--r--src/gui/painting/qbezier_p.h40
-rw-r--r--src/gui/painting/qblendfunctions_p.h16
-rw-r--r--src/gui/painting/qbrush.cpp55
-rw-r--r--src/gui/painting/qbrush.h15
-rw-r--r--src/gui/painting/qcolor.cpp438
-rw-r--r--src/gui/painting/qcolor.h373
-rw-r--r--src/gui/painting/qcolormatrix_p.h237
-rw-r--r--src/gui/painting/qcolorspace.cpp796
-rw-r--r--src/gui/painting/qcolorspace.h158
-rw-r--r--src/gui/painting/qcolorspace_p.h160
-rw-r--r--src/gui/painting/qcolortransferfunction_p.h203
-rw-r--r--src/gui/painting/qcolortransfertable_p.h245
-rw-r--r--src/gui/painting/qcolortransform.cpp720
-rw-r--r--src/gui/painting/qcolortransform.h91
-rw-r--r--src/gui/painting/qcolortransform_p.h91
-rw-r--r--src/gui/painting/qcolortrc_p.h148
-rw-r--r--src/gui/painting/qcolortrclut.cpp (renamed from src/gui/painting/qcolorprofile.cpp)41
-rw-r--r--src/gui/painting/qcolortrclut_p.h (renamed from src/gui/painting/qcolorprofile_p.h)72
-rw-r--r--src/gui/painting/qcompositionfunctions.cpp710
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h4
-rw-r--r--src/gui/painting/qdatabuffer_p.h4
-rw-r--r--src/gui/painting/qdrawhelper.cpp611
-rw-r--r--src/gui/painting/qdrawhelper_avx2.cpp6
-rw-r--r--src/gui/painting/qdrawhelper_p.h8
-rw-r--r--src/gui/painting/qdrawhelper_sse4.cpp2
-rw-r--r--src/gui/painting/qdrawhelper_ssse3.cpp45
-rw-r--r--src/gui/painting/qicc.cpp776
-rw-r--r--src/gui/painting/qicc_p.h (renamed from src/plugins/platforms/mirclient/qmirclientappstatecontroller.h)44
-rw-r--r--src/gui/painting/qimagescale.cpp7
-rw-r--r--src/gui/painting/qmatrix.cpp6
-rw-r--r--src/gui/painting/qmatrix.h10
-rw-r--r--src/gui/painting/qoutlinemapper.cpp5
-rw-r--r--src/gui/painting/qoutlinemapper_p.h4
-rw-r--r--src/gui/painting/qpagedpaintdevice.cpp1
-rw-r--r--src/gui/painting/qpagedpaintdevice.h1
-rw-r--r--src/gui/painting/qpagelayout.h6
-rw-r--r--src/gui/painting/qpagesize.cpp8
-rw-r--r--src/gui/painting/qpagesize.h6
-rw-r--r--src/gui/painting/qpaintdevice.cpp2
-rw-r--r--src/gui/painting/qpaintdevice.h2
-rw-r--r--src/gui/painting/qpaintengine_p.h6
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp157
-rw-r--r--src/gui/painting/qpaintengine_raster_p.h24
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp28
-rw-r--r--src/gui/painting/qpainter.h6
-rw-r--r--src/gui/painting/qpainter_p.h9
-rw-r--r--src/gui/painting/qpainterpath.cpp34
-rw-r--r--src/gui/painting/qpainterpath.h8
-rw-r--r--src/gui/painting/qpainterpath_p.h48
-rw-r--r--src/gui/painting/qpathclipper_p.h12
-rw-r--r--src/gui/painting/qpdf.cpp24
-rw-r--r--src/gui/painting/qpdf_p.h1
-rw-r--r--src/gui/painting/qpdfwriter.cpp18
-rw-r--r--src/gui/painting/qpdfwriter.h6
-rw-r--r--src/gui/painting/qpen.cpp10
-rw-r--r--src/gui/painting/qpen.h12
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp31
-rw-r--r--src/gui/painting/qplatformbackingstore.h7
-rw-r--r--src/gui/painting/qpolygon.h22
-rw-r--r--src/gui/painting/qrbtree_p.h14
-rw-r--r--src/gui/painting/qregion.cpp12
-rw-r--r--src/gui/painting/qregion.h28
-rw-r--r--src/gui/painting/qrgba64_p.h2
-rw-r--r--src/gui/painting/qstroker.cpp11
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp12
-rw-r--r--src/gui/painting/qtextureglyphcache_p.h2
-rw-r--r--src/gui/painting/qtransform.cpp16
-rw-r--r--src/gui/painting/qtransform.h14
-rw-r--r--src/gui/painting/qtriangulator_p.h27
-rw-r--r--src/gui/painting/qvectorpath_p.h8
-rw-r--r--src/gui/platform/wasm/qwasmlocalfileaccess.cpp37
-rw-r--r--src/gui/platform/wasm/qwasmlocalfileaccess_p.h2
-rw-r--r--src/gui/rhi/cs_tdr_p.h225
-rw-r--r--src/gui/rhi/qrhi.cpp5709
-rw-r--r--src/gui/rhi/qrhi_p.h1555
-rw-r--r--src/gui/rhi/qrhi_p_p.h551
-rw-r--r--src/gui/rhi/qrhid3d11.cpp4110
-rw-r--r--src/gui/rhi/qrhid3d11_p.h79
-rw-r--r--src/gui/rhi/qrhid3d11_p_p.h725
-rw-r--r--src/gui/rhi/qrhigles2.cpp3927
-rw-r--r--src/gui/rhi/qrhigles2_p.h84
-rw-r--r--src/gui/rhi/qrhigles2_p_p.h841
-rw-r--r--src/gui/rhi/qrhimetal.mm3731
-rw-r--r--src/gui/rhi/qrhimetal_p.h80
-rw-r--r--src/gui/rhi/qrhimetal_p_p.h460
-rw-r--r--src/gui/rhi/qrhinull.cpp900
-rw-r--r--src/gui/rhi/qrhinull_p.h69
-rw-r--r--src/gui/rhi/qrhinull_p_p.h303
-rw-r--r--src/gui/rhi/qrhiprofiler.cpp606
-rw-r--r--src/gui/rhi/qrhiprofiler_p.h120
-rw-r--r--src/gui/rhi/qrhiprofiler_p_p.h121
-rw-r--r--src/gui/rhi/qrhivulkan.cpp6492
-rw-r--r--src/gui/rhi/qrhivulkan_p.h90
-rw-r--r--src/gui/rhi/qrhivulkan_p_p.h949
-rw-r--r--src/gui/rhi/qrhivulkanext_p.h81
-rw-r--r--src/gui/rhi/qshader.cpp699
-rw-r--r--src/gui/rhi/qshader_p.h229
-rw-r--r--src/gui/rhi/qshader_p_p.h86
-rw-r--r--src/gui/rhi/qshaderdescription.cpp1122
-rw-r--r--src/gui/rhi/qshaderdescription_p.h281
-rw-r--r--src/gui/rhi/qshaderdescription_p_p.h98
-rw-r--r--src/gui/rhi/rhi.pri57
-rw-r--r--src/gui/rhi/tdr.hlsl9
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.cpp31
-rw-r--r--src/gui/text/qabstracttextdocumentlayout.h1
-rw-r--r--src/gui/text/qabstracttextdocumentlayout_p.h6
-rw-r--r--src/gui/text/qcssparser.cpp23
-rw-r--r--src/gui/text/qcssparser_p.h16
-rw-r--r--src/gui/text/qdistancefield.cpp2
-rw-r--r--src/gui/text/qdistancefield_p.h2
-rw-r--r--src/gui/text/qfont.cpp144
-rw-r--r--src/gui/text/qfont.h12
-rw-r--r--src/gui/text/qfont_p.h41
-rw-r--r--src/gui/text/qfontdatabase.cpp41
-rw-r--r--src/gui/text/qfontengine.cpp12
-rw-r--r--src/gui/text/qfontengine_p.h29
-rw-r--r--src/gui/text/qfontengine_qpf2.cpp6
-rw-r--r--src/gui/text/qfontmetrics.cpp27
-rw-r--r--src/gui/text/qfontmetrics.h16
-rw-r--r--src/gui/text/qfragmentmap_p.h2
-rw-r--r--src/gui/text/qglyphrun.cpp2
-rw-r--r--src/gui/text/qglyphrun.h6
-rw-r--r--src/gui/text/qglyphrun_p.h2
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp13
-rw-r--r--src/gui/text/qplatformfontdatabase.h4
-rw-r--r--src/gui/text/qrawfont.cpp2
-rw-r--r--src/gui/text/qrawfont.h8
-rw-r--r--src/gui/text/qrawfont_p.h24
-rw-r--r--src/gui/text/qstatictext.cpp4
-rw-r--r--src/gui/text/qstatictext.h6
-rw-r--r--src/gui/text/qstatictext_p.h2
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp7
-rw-r--r--src/gui/text/qtextcursor.h6
-rw-r--r--src/gui/text/qtextdocument.cpp198
-rw-r--r--src/gui/text/qtextdocument.h23
-rw-r--r--src/gui/text/qtextdocument_p.cpp18
-rw-r--r--src/gui/text/qtextdocument_p.h7
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp41
-rw-r--r--src/gui/text/qtextdocumentfragment_p.h6
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp1027
-rw-r--r--src/gui/text/qtextdocumentwriter.cpp19
-rw-r--r--src/gui/text/qtextengine.cpp36
-rw-r--r--src/gui/text/qtextengine_p.h20
-rw-r--r--src/gui/text/qtextformat.cpp344
-rw-r--r--src/gui/text/qtextformat.h127
-rw-r--r--src/gui/text/qtexthtmlparser.cpp94
-rw-r--r--src/gui/text/qtexthtmlparser_p.h11
-rw-r--r--src/gui/text/qtextimagehandler_p.h2
-rw-r--r--src/gui/text/qtextmarkdownimporter.cpp601
-rw-r--r--src/gui/text/qtextmarkdownimporter_p.h145
-rw-r--r--src/gui/text/qtextmarkdownwriter.cpp565
-rw-r--r--src/gui/text/qtextmarkdownwriter_p.h98
-rw-r--r--src/gui/text/qtextobject.cpp4
-rw-r--r--src/gui/text/qtextobject.h8
-rw-r--r--src/gui/text/qtextobject_p.h2
-rw-r--r--src/gui/text/qtextodfwriter.cpp6
-rw-r--r--src/gui/text/qtexttable_p.h2
-rw-r--r--src/gui/text/qzipreader_p.h4
-rw-r--r--src/gui/text/text.pri19
-rw-r--r--src/gui/util/qdesktopservices.cpp6
-rw-r--r--src/gui/util/qgridlayoutengine_p.h8
-rw-r--r--src/gui/util/qshaderformat.cpp24
-rw-r--r--src/gui/util/qshaderformat_p.h26
-rw-r--r--src/gui/util/qshadergraph.cpp12
-rw-r--r--src/gui/util/qshadergraph_p.h16
-rw-r--r--src/gui/util/qshadergraphloader.cpp14
-rw-r--r--src/gui/util/qshadergraphloader_p.h14
-rw-r--r--src/gui/util/qshaderlanguage_p.h2
-rw-r--r--src/gui/util/qshadernode.cpp16
-rw-r--r--src/gui/util/qshadernode_p.h18
-rw-r--r--src/gui/util/qshadernodeport.cpp4
-rw-r--r--src/gui/util/qshadernodeport_p.h6
-rw-r--r--src/gui/util/qshadernodesloader.cpp10
-rw-r--r--src/gui/util/qshadernodesloader_p.h10
-rw-r--r--src/gui/util/qvalidator.h1
-rw-r--r--src/gui/util/util.pri9
-rw-r--r--src/gui/vulkan/qplatformvulkaninstance.cpp5
-rw-r--r--src/gui/vulkan/qplatformvulkaninstance.h1
-rw-r--r--src/gui/vulkan/qvulkaninstance.cpp46
-rw-r--r--src/gui/vulkan/qvulkaninstance.h17
-rw-r--r--src/gui/vulkan/qvulkanwindow.cpp16
-rw-r--r--src/gui/vulkan/qvulkanwindow_p.h2
-rw-r--r--src/gui/vulkan/vulkan.pri72
-rw-r--r--src/network/access/access.pri6
-rw-r--r--src/network/access/http2/hpack.cpp5
-rw-r--r--src/network/access/http2/hpack_p.h1
-rw-r--r--src/network/access/http2/http2frames.cpp4
-rw-r--r--src/network/access/http2/http2protocol.cpp116
-rw-r--r--src/network/access/http2/http2protocol_p.h64
-rw-r--r--src/network/access/qabstractnetworkcache.h6
-rw-r--r--src/network/access/qftp.cpp19
-rw-r--r--src/network/access/qftp_p.h7
-rw-r--r--src/network/access/qhsts.cpp4
-rw-r--r--src/network/access/qhstspolicy.h4
-rw-r--r--src/network/access/qhttp2configuration.cpp312
-rw-r--r--src/network/access/qhttp2configuration.h100
-rw-r--r--src/network/access/qhttp2protocolhandler.cpp84
-rw-r--r--src/network/access/qhttp2protocolhandler_p.h27
-rw-r--r--src/network/access/qhttpmultipart.h6
-rw-r--r--src/network/access/qhttpmultipart_p.h2
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp70
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h25
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp18
-rw-r--r--src/network/access/qhttpnetworkreply.cpp3
-rw-r--r--src/network/access/qhttpnetworkreply_p.h2
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp6
-rw-r--r--src/network/access/qhttpthreaddelegate_p.h13
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager_p.h4
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp10
-rw-r--r--src/network/access/qnetworkaccesscache.cpp32
-rw-r--r--src/network/access/qnetworkaccessftpbackend.cpp7
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp184
-rw-r--r--src/network/access/qnetworkaccessmanager.h5
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h10
-rw-r--r--src/network/access/qnetworkcookie.cpp1
-rw-r--r--src/network/access/qnetworkcookie.h6
-rw-r--r--src/network/access/qnetworkdiskcache_p.h4
-rw-r--r--src/network/access/qnetworkreply.cpp5
-rw-r--r--src/network/access/qnetworkreply.h6
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp79
-rw-r--r--src/network/access/qnetworkreplyhttpimpl_p.h2
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp24
-rw-r--r--src/network/access/qnetworkreplyimpl_p.h8
-rw-r--r--src/network/access/qnetworkrequest.cpp92
-rw-r--r--src/network/access/qnetworkrequest.h15
-rw-r--r--src/network/access/qspdyprotocolhandler.cpp15
-rw-r--r--src/network/access/qspdyprotocolhandler_p.h2
-rw-r--r--src/network/bearer/qbearerengine.cpp11
-rw-r--r--src/network/bearer/qbearerengine_p.h4
-rw-r--r--src/network/bearer/qbearerplugin_p.h2
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp71
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.h2
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp29
-rw-r--r--src/network/bearer/qnetworkconfiguration.h6
-rw-r--r--src/network/bearer/qnetworkconfiguration_p.h10
-rw-r--r--src/network/bearer/qnetworksession_p.h4
-rw-r--r--src/network/bearer/qsharednetworksession.cpp44
-rw-r--r--src/network/bearer/qsharednetworksession_p.h16
-rw-r--r--src/network/configure.json68
-rw-r--r--src/network/kernel/kernel.pri16
-rw-r--r--src/network/kernel/qauthenticator.cpp413
-rw-r--r--src/network/kernel/qauthenticator_p.h17
-rw-r--r--src/network/kernel/qdnslookup.h30
-rw-r--r--src/network/kernel/qdnslookup_p.h2
-rw-r--r--src/network/kernel/qdnslookup_win.cpp1
-rw-r--r--src/network/kernel/qhostaddress.cpp2
-rw-r--r--src/network/kernel/qhostaddress.h11
-rw-r--r--src/network/kernel/qhostinfo.cpp425
-rw-r--r--src/network/kernel/qhostinfo.h8
-rw-r--r--src/network/kernel/qhostinfo_p.h102
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp139
-rw-r--r--src/network/kernel/qhostinfo_win.cpp110
-rw-r--r--src/network/kernel/qnetconmonitor_darwin.mm419
-rw-r--r--src/network/kernel/qnetconmonitor_p.h126
-rw-r--r--src/network/kernel/qnetconmonitor_stub.cpp141
-rw-r--r--src/network/kernel/qnetconmonitor_win.cpp712
-rw-r--r--src/network/kernel/qnetworkdatagram.h6
-rw-r--r--src/network/kernel/qnetworkinterface.h12
-rw-r--r--src/network/kernel/qnetworkinterface_p.h2
-rw-r--r--src/network/kernel/qnetworkinterface_unix_p.h2
-rw-r--r--src/network/kernel/qnetworkproxy.cpp9
-rw-r--r--src/network/kernel/qnetworkproxy.h12
-rw-r--r--src/network/network.pro2
-rw-r--r--src/network/socket/qabstractsocketengine_p.h12
-rw-r--r--src/network/socket/qhttpsocketengine.cpp2
-rw-r--r--src/network/socket/qhttpsocketengine_p.h8
-rw-r--r--src/network/socket/qlocalserver_p.h2
-rw-r--r--src/network/socket/qnativesocketengine_p.h10
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp3
-rw-r--r--src/network/socket/qsctpserver.cpp7
-rw-r--r--src/network/socket/qsocks5socketengine.cpp12
-rw-r--r--src/network/socket/qsocks5socketengine_p.h10
-rw-r--r--src/network/socket/socket.pri2
-rw-r--r--src/network/ssl/qasn1element_p.h4
-rw-r--r--src/network/ssl/qdtls.cpp2
-rw-r--r--src/network/ssl/qdtls_openssl.cpp2
-rw-r--r--src/network/ssl/qocspresponse.cpp6
-rw-r--r--src/network/ssl/qocspresponse.h10
-rw-r--r--src/network/ssl/qsslcertificate.h10
-rw-r--r--src/network/ssl/qsslcertificate_openssl.cpp15
-rw-r--r--src/network/ssl/qsslcertificate_p.h2
-rw-r--r--src/network/ssl/qsslcertificate_qt.cpp2
-rw-r--r--src/network/ssl/qsslcertificateextension.h6
-rw-r--r--src/network/ssl/qsslcipher.h6
-rw-r--r--src/network/ssl/qsslconfiguration.h6
-rw-r--r--src/network/ssl/qsslcontext_openssl11.cpp2
-rw-r--r--src/network/ssl/qsslcontext_openssl_p.h2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.cpp12
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.h24
-rw-r--r--src/network/ssl/qsslellipticcurve.h18
-rw-r--r--src/network/ssl/qsslellipticcurve_dummy.cpp2
-rw-r--r--src/network/ssl/qsslellipticcurve_openssl.cpp2
-rw-r--r--src/network/ssl/qsslerror.cpp9
-rw-r--r--src/network/ssl/qsslerror.h10
-rw-r--r--src/network/ssl/qsslkey.h7
-rw-r--r--src/network/ssl/qsslkey_mac.cpp22
-rw-r--r--src/network/ssl/qsslkey_openssl.cpp9
-rw-r--r--src/network/ssl/qsslkey_p.cpp18
-rw-r--r--src/network/ssl/qsslkey_p.h7
-rw-r--r--src/network/ssl/qsslkey_qt.cpp50
-rw-r--r--src/network/ssl/qsslkey_schannel.cpp4
-rw-r--r--src/network/ssl/qsslkey_winrt.cpp9
-rw-r--r--src/network/ssl/qsslpresharedkeyauthenticator.h6
-rw-r--r--src/network/ssl/qsslsocket.cpp35
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp5
-rw-r--r--src/network/ssl/qsslsocket_openssl11.cpp8
-rw-r--r--src/network/ssl/qsslsocket_openssl11_symbols_p.h1
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp127
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols_p.h12
-rw-r--r--src/network/ssl/qsslsocket_opensslpre11.cpp1
-rw-r--r--src/network/ssl/qsslsocket_qt.cpp1
-rw-r--r--src/network/ssl/qsslsocket_schannel.cpp2
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp1
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp8
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h4
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h2
-rw-r--r--src/opengl/qgl.cpp11
-rw-r--r--src/opengl/qgl_p.h12
-rw-r--r--src/opengl/qglcolormap.cpp2
-rw-r--r--src/opengl/qglcolormap.h2
-rw-r--r--src/opengl/qglframebufferobject.cpp2
-rw-r--r--src/opengl/qglframebufferobject_p.h6
-rw-r--r--src/opengl/qglpixelbuffer_p.h2
-rw-r--r--src/opengl/qgraphicsshadereffect_p.h2
-rw-r--r--src/platformheaders/nativecontexts/qeglnativecontext.h4
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_p.h2
-rw-r--r--src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h2
-rw-r--r--src/platformsupport/edid/qedidparser.cpp8
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h2
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h4
-rw-r--r--src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h4
-rw-r--r--src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h2
-rw-r--r--src/platformsupport/fbconvenience/qfbvthandler_p.h2
-rw-r--r--src/platformsupport/fbconvenience/qfbwindow.cpp5
-rw-r--r--src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp4
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp326
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h6
-rw-r--r--src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp2
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm352
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h3
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp101
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp4
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h4
-rw-r--r--src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp7
-rw-r--r--src/platformsupport/fontdatabases/windows/windows.pri4
-rw-r--r--src/platformsupport/fontdatabases/winrt/winrt.pri4
-rw-r--r--src/platformsupport/glxconvenience/qglxconvenience.cpp4
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp31
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h12
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp76
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h8
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp6
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h4
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp65
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h8
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp22
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h4
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp61
-rw-r--r--src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h9
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp66
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp60
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h7
-rw-r--r--src/platformsupport/input/libinput/qlibinputhandler.cpp3
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer.cpp18
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer_p.h1
-rw-r--r--src/platformsupport/input/libinput/qlibinputtouch_p.h2
-rw-r--r--src/platformsupport/input/shared/devicehandlerlist_p.h95
-rw-r--r--src/platformsupport/input/shared/qevdevutil.cpp (renamed from src/widgets/util/qscroller_mac.mm)48
-rw-r--r--src/platformsupport/input/shared/qevdevutil_p.h (renamed from src/plugins/platforms/mirclient/qmirclientglcontext.h)49
-rw-r--r--src/platformsupport/input/shared/shared.pri3
-rw-r--r--src/platformsupport/input/tslib/qtslib.cpp32
-rw-r--r--src/platformsupport/input/tslib/qtslib_p.h9
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice.cpp54
-rw-r--r--src/platformsupport/kmsconvenience/qkmsdevice_p.h1
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp9
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/cache_p.h2
-rw-r--r--src/platformsupport/linuxaccessibility/dbusconnection_p.h2
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h2
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h16
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h22
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp12
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h4
-rw-r--r--src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp16
-rw-r--r--src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h4
-rw-r--r--src/platformsupport/vkconvenience/qvkconvenience.cpp2
-rw-r--r--src/platformsupport/vkconvenience/qvkconvenience_p.h2
-rw-r--r--src/plugins/bearer/android/jar/jar.pro2
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp45
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.h2
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp9
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux_p.h6
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.h8
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm70
-rw-r--r--src/plugins/bearer/generic/qgenericengine.h2
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux.cpp15
-rw-r--r--src/plugins/bearer/linux_common/qofonoservice_linux_p.h10
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.cpp4
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.h4
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp37
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerservice.h22
-rw-r--r--src/plugins/bearer/nla/nla.pro2
-rw-r--r--src/plugins/bearer/nla/qnlaengine.cpp39
-rw-r--r--src/plugins/bearer/qbearerengine_impl.h2
-rw-r--r--src/plugins/bearer/qnetworksession_impl.h2
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp43
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h6
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxy.h2
-rw-r--r--src/plugins/platforms/android/android.pro12
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp26
-rw-r--r--src/plugins/platforms/android/androidjnimain.h1
-rw-r--r--src/plugins/platforms/android/androidjnimenu.cpp4
-rw-r--r--src/plugins/platforms/android/main.cpp (renamed from src/plugins/platforms/mirclient/qmirclientplugin.h)25
-rw-r--r--src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp356
-rw-r--r--src/plugins/platforms/android/qandroidassetsfileenginehandler.h8
-rw-r--r--src/plugins/platforms/android/qandroideventdispatcher.cpp4
-rw-r--r--src/plugins/platforms/android/qandroideventdispatcher.h2
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.cpp8
-rw-r--r--src/plugins/platforms/android/qandroidplatformscreen.h2
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.cpp5
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm272
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplication.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm118
-rw-r--r--src/plugins/platforms/cocoa/qcocoabackingstore.mm31
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm28
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm71
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h5
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoansmenu.h13
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.h9
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.mm55
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm11
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm35
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h19
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm26
-rw-r--r--src/plugins/platforms/cocoa/qnsview_accessibility.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_complextext.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview_dragging.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm221
-rw-r--r--src/plugins/platforms/cocoa/qnsview_gestures.mm12
-rw-r--r--src/plugins/platforms/cocoa/qnsview_keys.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview_menus.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm13
-rw-r--r--src/plugins/platforms/cocoa/qnsview_tablet.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_touch.mm10
-rw-r--r--src/plugins/platforms/cocoa/qnswindow.mm4
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac_p.h6
-rw-r--r--src/plugins/platforms/direct2d/direct2d.pro4
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp20
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h1
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp27
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h2
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp2
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfscursor_p.h4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h4
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp5
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp2
-rw-r--r--src/plugins/platforms/haiku/qhaikuapplication.cpp5
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm2
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.mm2
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp2
-rw-r--r--src/plugins/platforms/mirclient/mirclient.json3
-rw-r--r--src/plugins/platforms/mirclient/mirclient.pro61
-rw-r--r--src/plugins/platforms/mirclient/qmirclientappstatecontroller.cpp102
-rw-r--r--src/plugins/platforms/mirclient/qmirclientbackingstore.cpp157
-rw-r--r--src/plugins/platforms/mirclient/qmirclientbackingstore.h74
-rw-r--r--src/plugins/platforms/mirclient/qmirclientclipboard.cpp181
-rw-r--r--src/plugins/platforms/mirclient/qmirclientclipboard.h92
-rw-r--r--src/plugins/platforms/mirclient/qmirclientcursor.cpp209
-rw-r--r--src/plugins/platforms/mirclient/qmirclientcursor.h64
-rw-r--r--src/plugins/platforms/mirclient/qmirclientdebugextension.cpp79
-rw-r--r--src/plugins/platforms/mirclient/qmirclientglcontext.cpp132
-rw-r--r--src/plugins/platforms/mirclient/qmirclientinput.cpp708
-rw-r--r--src/plugins/platforms/mirclient/qmirclientinput.h86
-rw-r--r--src/plugins/platforms/mirclient/qmirclientintegration.cpp412
-rw-r--r--src/plugins/platforms/mirclient/qmirclientintegration.h131
-rw-r--r--src/plugins/platforms/mirclient/qmirclientlogging.h55
-rw-r--r--src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp217
-rw-r--r--src/plugins/platforms/mirclient/qmirclientnativeinterface.h83
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplatformservices.cpp75
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplatformservices.h57
-rw-r--r--src/plugins/platforms/mirclient/qmirclientplugin.cpp56
-rw-r--r--src/plugins/platforms/mirclient/qmirclientscreen.cpp262
-rw-r--r--src/plugins/platforms/mirclient/qmirclientscreen.h106
-rw-r--r--src/plugins/platforms/mirclient/qmirclientscreenobserver.cpp161
-rw-r--r--src/plugins/platforms/mirclient/qmirclientwindow.cpp968
-rw-r--r--src/plugins/platforms/mirclient/qmirclientwindow.h118
-rw-r--r--src/plugins/platforms/offscreen/qoffscreencommon.cpp3
-rw-r--r--src/plugins/platforms/openwfd/qopenwfdscreen.h1
-rw-r--r--src/plugins/platforms/platforms.pro2
-rw-r--r--src/plugins/platforms/qnx/qnx.pro2
-rw-r--r--src/plugins/platforms/qnx/qqnxforeignwindow.cpp (renamed from src/plugins/platforms/mirclient/qmirclienttheme.cpp)38
-rw-r--r--src/plugins/platforms/qnx/qqnxforeignwindow.h (renamed from src/plugins/platforms/mirclient/qmirclientdebugextension.h)34
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp34
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.h7
-rw-r--r--src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp55
-rw-r--r--src/plugins/platforms/qnx/qqnxscreentraits.h127
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp96
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h8
-rw-r--r--src/plugins/platforms/vnc/qvnc_p.h2
-rw-r--r--src/plugins/platforms/vnc/qvncclient.cpp13
-rw-r--r--src/plugins/platforms/vnc/qvncscreen.h6
-rw-r--r--src/plugins/platforms/wasm/qtlogo.svg29
-rw-r--r--src/plugins/platforms/wasm/qwasmbackingstore.cpp9
-rw-r--r--src/plugins/platforms/wasm/qwasmbackingstore.h1
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp4
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.cpp64
-rw-r--r--src/plugins/platforms/wasm/qwasmeventtranslator.h36
-rw-r--r--src/plugins/platforms/wasm/qwasmfontdatabase.cpp11
-rw-r--r--src/plugins/platforms/wasm/wasm.pro2
-rw-r--r--src/plugins/platforms/wasm/wasm_shell.html2
-rw-r--r--src/plugins/platforms/windows/qwin10helpers.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.cpp17
-rw-r--r--src/plugins/platforms/windows/qwindowsclipboard.h6
-rw-r--r--src/plugins/platforms/windows/qwindowscombase.h2
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp62
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h6
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowscursor.h6
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp30
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.h8
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsgdinativeinterface.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.h12
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp6
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.h5
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsmenu.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowsmenu.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp20
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.h6
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp24
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsnativeinterface.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsole.cpp16
-rw-r--r--src/plugins/platforms/windows/qwindowsopenglcontext.h8
-rw-r--r--src/plugins/platforms/windows/qwindowsopengltester.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp42
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp20
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.h8
-rw-r--r--src/plugins/platforms/windows/qwindowsservices.cpp29
-rw-r--r--src/plugins/platforms/windows/qwindowssessionmanager.h2
-rw-r--r--src/plugins/platforms/windows/qwindowssystemtrayicon.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.h2
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.h4
-rw-r--r--src/plugins/platforms/windows/qwindowsthreadpoolrunner.h2
-rw-r--r--src/plugins/platforms/windows/qwindowsvulkaninstance.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsvulkaninstance.h2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp139
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h56
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp4
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp6
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp9
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h2
-rw-r--r--src/plugins/platforms/windows/uiautomation/uiautomation.pri3
-rw-r--r--src/plugins/platforms/windows/windows.pri16
-rw-r--r--src/plugins/platforms/windows/windows.pro3
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp8
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.cpp12
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.cpp12
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.cpp26
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.h2
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.cpp10
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.cpp18
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.cpp18
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.cpp18
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.cpp38
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.cpp21
-rw-r--r--src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.cpp11
-rw-r--r--src/plugins/platforms/winrt/winrt.pro3
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp4
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp2
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp2
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qt_x11_p.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_basic.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbdrag.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbobject.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp23
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbsessionmanager.cpp5
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp6
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h2
-rw-r--r--src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h2
-rw-r--r--src/plugins/printsupport/windows/windows.pro3
-rw-r--r--src/plugins/sqldrivers/ibase/qsql_ibase.cpp8
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc_p.h4
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql.cpp63
-rw-r--r--src/plugins/sqldrivers/psql/qsql_psql_p.h1
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp2
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h4
-rw-r--r--src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp1
-rw-r--r--src/plugins/sqldrivers/sqlite2/smain.cpp1
-rw-r--r--src/plugins/sqldrivers/tds/main.cpp1
-rw-r--r--src/plugins/sqldrivers/tds/qsql_tds.cpp2
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm189
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h119
-rw-r--r--src/plugins/styles/windowsvista/main.cpp4
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp122
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h2
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp197
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h61
-rw-r--r--src/plugins/styles/windowsvista/windowsvista.pro2
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h6
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.cpp2
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_unix.cpp26
-rw-r--r--src/printsupport/dialogs/qprintdialog_unix.cpp12
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp14
-rw-r--r--src/printsupport/kernel/kernel.pri5
-rw-r--r--src/printsupport/kernel/qcups.cpp6
-rw-r--r--src/printsupport/kernel/qprintdevice_p.h2
-rw-r--r--src/sql/doc/snippets/sqldatabase/sqldatabase.cpp4
-rw-r--r--src/sql/doc/src/sql-driver.qdoc4
-rw-r--r--src/sql/kernel/qsqldatabase.cpp2
-rw-r--r--src/sql/kernel/qsqlerror.cpp2
-rw-r--r--src/sql/kernel/qsqlerror.h6
-rw-r--r--src/sql/kernel/qsqlquery.cpp4
-rw-r--r--src/sql/kernel/qsqlrecord.cpp2
-rw-r--r--src/sql/kernel/qsqlresult.cpp1
-rw-r--r--src/sql/models/qsqlquerymodel_p.h2
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.h4
-rw-r--r--src/sql/models/qsqltablemodel.cpp2
-rw-r--r--src/sql/models/qsqltablemodel_p.h2
-rw-r--r--src/src.pro28
-rw-r--r--src/testlib/configure.json6
-rw-r--r--src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp48
-rw-r--r--src/testlib/doc/src/qttestlib-manual.qdoc5
-rw-r--r--src/testlib/qabstracttestlogger.cpp2
-rw-r--r--src/testlib/qabstracttestlogger_p.h11
-rw-r--r--src/testlib/qbenchmark.cpp32
-rw-r--r--src/testlib/qbenchmark_p.h54
-rw-r--r--src/testlib/qbenchmarkevent.cpp13
-rw-r--r--src/testlib/qbenchmarkevent_p.h6
-rw-r--r--src/testlib/qbenchmarkmeasurement_p.h4
-rw-r--r--src/testlib/qbenchmarkperfevents.cpp7
-rw-r--r--src/testlib/qbenchmarkperfevents_p.h22
-rw-r--r--src/testlib/qbenchmarkvalgrind.cpp8
-rw-r--r--src/testlib/qbenchmarkvalgrind_p.h2
-rw-r--r--src/testlib/qcsvbenchmarklogger.cpp4
-rw-r--r--src/testlib/qcsvbenchmarklogger_p.h4
-rw-r--r--src/testlib/qplaintestlogger.cpp4
-rw-r--r--src/testlib/qplaintestlogger_p.h6
-rw-r--r--src/testlib/qsignaldumper.cpp15
-rw-r--r--src/testlib/qsignalspy.h71
-rw-r--r--src/testlib/qsignalspy.qdoc22
-rw-r--r--src/testlib/qtaptestlogger.cpp28
-rw-r--r--src/testlib/qtaptestlogger_p.h4
-rw-r--r--src/testlib/qteamcitylogger.cpp10
-rw-r--r--src/testlib/qteamcitylogger_p.h4
-rw-r--r--src/testlib/qtest.h80
-rw-r--r--src/testlib/qtest_gui.h16
-rw-r--r--src/testlib/qtestaccessible.h2
-rw-r--r--src/testlib/qtestblacklist.cpp9
-rw-r--r--src/testlib/qtestcase.cpp281
-rw-r--r--src/testlib/qtestcase.h44
-rw-r--r--src/testlib/qtestcoreelement_p.h12
-rw-r--r--src/testlib/qtestcorelist_p.h8
-rw-r--r--src/testlib/qtestdata.cpp10
-rw-r--r--src/testlib/qtestelement.cpp2
-rw-r--r--src/testlib/qtestelement_p.h4
-rw-r--r--src/testlib/qtestelementattribute.cpp10
-rw-r--r--src/testlib/qtestelementattribute_p.h4
-rw-r--r--src/testlib/qtesteventloop.h9
-rw-r--r--src/testlib/qtestlog.cpp16
-rw-r--r--src/testlib/qtestlog_p.h7
-rw-r--r--src/testlib/qtestresult.cpp178
-rw-r--r--src/testlib/qtestresult_p.h32
-rw-r--r--src/testlib/qtesttable.cpp24
-rw-r--r--src/testlib/qtestxunitstreamer.cpp5
-rw-r--r--src/testlib/qxmltestlogger.cpp29
-rw-r--r--src/testlib/qxmltestlogger_p.h4
-rw-r--r--src/testlib/qxunittestlogger.cpp11
-rw-r--r--src/testlib/qxunittestlogger_p.h18
-rw-r--r--src/testlib/testlib.pro9
-rw-r--r--src/tools/androiddeployqt/main.cpp1390
-rw-r--r--src/tools/androidtestrunner/androidtestrunner.pro13
-rw-r--r--src/tools/androidtestrunner/main.cpp490
-rw-r--r--src/tools/bootstrap/bootstrap.pro49
-rw-r--r--src/tools/moc/generator.cpp17
-rw-r--r--src/tools/moc/generator.h2
-rw-r--r--src/tools/moc/keywords.cpp357
-rw-r--r--src/tools/moc/moc.cpp85
-rw-r--r--src/tools/moc/moc.h4
-rw-r--r--src/tools/moc/parser.h6
-rw-r--r--src/tools/moc/token.h1
-rw-r--r--src/tools/moc/util/generate_keywords.cpp1
-rw-r--r--src/tools/moc/util/generate_keywords.pro1
-rw-r--r--src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp1
-rw-r--r--src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp330
-rw-r--r--src/tools/qfloat16-tables/qfloat16-tables.pro9
-rw-r--r--src/tools/qlalr/cppgenerator.cpp209
-rw-r--r--src/tools/qlalr/dotgraph.cpp22
-rw-r--r--src/tools/qlalr/lalr.cpp32
-rw-r--r--src/tools/qlalr/lalr.g12
-rw-r--r--src/tools/qlalr/lalr.h130
-rw-r--r--src/tools/qlalr/main.cpp26
-rw-r--r--src/tools/qlalr/parsetable.cpp26
-rw-r--r--src/tools/qlalr/recognizer.cpp12
-rw-r--r--src/tools/qvkgen/qvkgen.cpp45
-rw-r--r--src/tools/rcc/main.cpp77
-rw-r--r--src/tools/rcc/rcc.cpp196
-rw-r--r--src/tools/rcc/rcc.h4
-rw-r--r--src/tools/tracegen/etw.cpp1
-rw-r--r--src/tools/tracegen/lttng.cpp1
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.cpp2
-rw-r--r--src/tools/uic/cpp/cppwriteincludes.h10
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.cpp969
-rw-r--r--src/tools/uic/cpp/cppwriteinitialization.h41
-rw-r--r--src/tools/uic/customwidgetsinfo.cpp4
-rw-r--r--src/tools/uic/customwidgetsinfo.h2
-rw-r--r--src/tools/uic/databaseinfo.cpp9
-rw-r--r--src/tools/uic/driver.cpp61
-rw-r--r--src/tools/uic/driver.h22
-rw-r--r--src/tools/uic/main.cpp17
-rw-r--r--src/tools/uic/python/python.pri8
-rw-r--r--src/tools/uic/python/pythonwritedeclaration.cpp73
-rw-r--r--src/tools/uic/python/pythonwritedeclaration.h62
-rw-r--r--src/tools/uic/python/pythonwriteimports.cpp94
-rw-r--r--src/tools/uic/python/pythonwriteimports.h58
-rw-r--r--src/tools/uic/qclass_lib_map.h2
-rw-r--r--src/tools/uic/shared/language.cpp282
-rw-r--r--src/tools/uic/shared/language.h127
-rw-r--r--src/tools/uic/treewalker.h5
-rw-r--r--src/tools/uic/ui4.cpp7
-rw-r--r--src/tools/uic/ui4.h8
-rw-r--r--src/tools/uic/uic.cpp99
-rw-r--r--src/tools/uic/uic.h3
-rw-r--r--src/tools/uic/uic.pro1
-rw-r--r--src/tools/uic/utils.h49
-rw-r--r--src/widgets/accessible/qaccessiblemenu.cpp13
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp20
-rw-r--r--src/widgets/accessible/qaccessiblewidgets.cpp4
-rw-r--r--src/widgets/accessible/simplewidgets.cpp3
-rw-r--r--src/widgets/configure.json7
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp7
-rw-r--r--src/widgets/dialogs/qdialog.cpp17
-rw-r--r--src/widgets/dialogs/qdialog_p.h20
-rw-r--r--src/widgets/dialogs/qerrormessage.cpp6
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp123
-rw-r--r--src/widgets/dialogs/qfiledialog.h5
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h20
-rw-r--r--src/widgets/dialogs/qfileinfogatherer.cpp143
-rw-r--r--src/widgets/dialogs/qfileinfogatherer_p.h28
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp160
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.h17
-rw-r--r--src/widgets/dialogs/qfilesystemmodel_p.h61
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp4
-rw-r--r--src/widgets/dialogs/qfscompleter_p.h4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp13
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp4
-rw-r--r--src/widgets/dialogs/qsidebar_p.h6
-rw-r--r--src/widgets/dialogs/qwizard.cpp22
-rw-r--r--src/widgets/dialogs/qwizard.h4
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp62
-rw-r--r--src/widgets/dialogs/qwizard_win_p.h24
-rw-r--r--src/widgets/doc/snippets/code/doc_src_styles.cpp5
-rw-r--r--src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp5
-rw-r--r--src/widgets/doc/snippets/macmainwindow.mm290
-rw-r--r--src/widgets/doc/snippets/timeline/main.cpp4
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc2
-rw-r--r--src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc4
-rw-r--r--src/widgets/effects/qgraphicseffect_p.h8
-rw-r--r--src/widgets/effects/qpixmapfilter_p.h8
-rw-r--r--src/widgets/graphicsview/graphicsview.pri7
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.h12
-rw-r--r--src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp25
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsitem_p.h28
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.cpp33
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.h5
-rw-r--r--src/widgets/graphicsview/qgraphicslayout.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicslayout_p.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicslayout_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp59
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp49
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene_p.h8
-rw-r--r--src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicssceneindex_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsscenelinearindex_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicstransform_p.h2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp77
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsview_p.h22
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp154
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.h2
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.cpp47
-rw-r--r--src/widgets/graphicsview/qgraphicswidget_p.h12
-rw-r--r--src/widgets/graphicsview/qsimplex_p.cpp2
-rw-r--r--src/widgets/graphicsview/qsimplex_p.h2
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp48
-rw-r--r--src/widgets/itemviews/qcolumnview_p.h4
-rw-r--r--src/widgets/itemviews/qcolumnviewgrip_p.h4
-rw-r--r--src/widgets/itemviews/qdirmodel.cpp4
-rw-r--r--src/widgets/itemviews/qheaderview.cpp84
-rw-r--r--src/widgets/itemviews/qheaderview_p.h2
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp8
-rw-r--r--src/widgets/itemviews/qlistview.cpp21
-rw-r--r--src/widgets/itemviews/qlistview_p.h2
-rw-r--r--src/widgets/itemviews/qlistwidget.cpp6
-rw-r--r--src/widgets/itemviews/qtableview.cpp63
-rw-r--r--src/widgets/itemviews/qtableview_p.h11
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp4
-rw-r--r--src/widgets/itemviews/qtreeview.cpp35
-rw-r--r--src/widgets/itemviews/qtreeview.h2
-rw-r--r--src/widgets/itemviews/qtreeview_p.h4
-rw-r--r--src/widgets/itemviews/qtreewidget.cpp4
-rw-r--r--src/widgets/itemviews/qtreewidget_p.h4
-rw-r--r--src/widgets/kernel/kernel.pri11
-rw-r--r--src/widgets/kernel/mac.pri5
-rw-r--r--src/widgets/kernel/qaction.cpp85
-rw-r--r--src/widgets/kernel/qaction.h4
-rw-r--r--src/widgets/kernel/qaction_p.h18
-rw-r--r--src/widgets/kernel/qactiongroup.cpp119
-rw-r--r--src/widgets/kernel/qactiongroup.h11
-rw-r--r--src/widgets/kernel/qapplication.cpp163
-rw-r--r--src/widgets/kernel/qapplication_p.h60
-rw-r--r--src/widgets/kernel/qboxlayout.cpp2
-rw-r--r--src/widgets/kernel/qdesktopwidget.cpp16
-rw-r--r--src/widgets/kernel/qdesktopwidget_p.h2
-rw-r--r--src/widgets/kernel/qformlayout.cpp4
-rw-r--r--src/widgets/kernel/qgesture_p.h2
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp66
-rw-r--r--src/widgets/kernel/qlayout.cpp6
-rw-r--r--src/widgets/kernel/qlayout_p.h2
-rw-r--r--src/widgets/kernel/qlayoutengine_p.h6
-rw-r--r--src/widgets/kernel/qlayoutitem.cpp11
-rw-r--r--src/widgets/kernel/qopenglwidget.cpp11
-rw-r--r--src/widgets/kernel/qshortcut.cpp82
-rw-r--r--src/widgets/kernel/qsizepolicy.cpp4
-rw-r--r--src/widgets/kernel/qsizepolicy.h56
-rw-r--r--src/widgets/kernel/qtooltip.cpp47
-rw-r--r--src/widgets/kernel/qtooltip.h2
-rw-r--r--src/widgets/kernel/qwhatsthis.cpp30
-rw-r--r--src/widgets/kernel/qwhatsthis.h2
-rw-r--r--src/widgets/kernel/qwidget.cpp1040
-rw-r--r--src/widgets/kernel/qwidget.h14
-rw-r--r--src/widgets/kernel/qwidget_p.h308
-rw-r--r--src/widgets/kernel/qwidgetbackingstore_p.h311
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager.cpp (renamed from src/widgets/kernel/qwidgetbackingstore.cpp)1257
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager_p.h153
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp46
-rw-r--r--src/widgets/kernel/qwidgetwindow_p.h4
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp2
-rw-r--r--src/widgets/kernel/qwindowcontainer_p.h2
-rw-r--r--src/widgets/kernel/win.pri5
-rw-r--r--src/widgets/statemachine/qbasickeyeventtransition_p.h6
-rw-r--r--src/widgets/statemachine/qbasicmouseeventtransition_p.h4
-rw-r--r--src/widgets/styles/qcommonstyle.cpp141
-rw-r--r--src/widgets/styles/qcommonstyle_p.h2
-rw-r--r--src/widgets/styles/qfusionstyle.cpp70
-rw-r--r--src/widgets/styles/qfusionstyle_p.h18
-rw-r--r--src/widgets/styles/qpixmapstyle.cpp8
-rw-r--r--src/widgets/styles/qpixmapstyle_p.h2
-rw-r--r--src/widgets/styles/qproxystyle_p.h2
-rw-r--r--src/widgets/styles/qstyle.cpp18
-rw-r--r--src/widgets/styles/qstyle.h7
-rw-r--r--src/widgets/styles/qstyle_p.h2
-rw-r--r--src/widgets/styles/qstylehelper.cpp43
-rw-r--r--src/widgets/styles/qstylehelper_p.h13
-rw-r--r--src/widgets/styles/qstyleoption.cpp9
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp52
-rw-r--r--src/widgets/styles/qstylesheetstyle_p.h32
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp75
-rw-r--r--src/widgets/styles/qwindowsstyle_p.h22
-rw-r--r--src/widgets/styles/qwindowsstyle_p_p.h8
-rw-r--r--src/widgets/util/qcompleter.cpp13
-rw-r--r--src/widgets/util/qcompleter_p.h2
-rw-r--r--src/widgets/util/qflickgesture.cpp23
-rw-r--r--src/widgets/util/qflickgesture_p.h2
-rw-r--r--src/widgets/util/qscroller.cpp3
-rw-r--r--src/widgets/util/qscrollerproperties.cpp7
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp11
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp4
-rw-r--r--src/widgets/util/qundostack_p.h4
-rw-r--r--src/widgets/util/util.pri4
-rw-r--r--src/widgets/widgets.pro2
-rw-r--r--src/widgets/widgets/qabstractbutton.cpp7
-rw-r--r--src/widgets/widgets/qabstractscrollarea.cpp162
-rw-r--r--src/widgets/widgets/qabstractscrollarea_p.h9
-rw-r--r--src/widgets/widgets/qabstractslider.cpp32
-rw-r--r--src/widgets/widgets/qabstractslider_p.h2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp54
-rw-r--r--src/widgets/widgets/qabstractspinbox_p.h2
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp434
-rw-r--r--src/widgets/widgets/qcalendarwidget.h5
-rw-r--r--src/widgets/widgets/qcombobox.cpp133
-rw-r--r--src/widgets/widgets/qcombobox.h10
-rw-r--r--src/widgets/widgets/qcombobox_p.h14
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp120
-rw-r--r--src/widgets/widgets/qdatetimeedit.h4
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h22
-rw-r--r--src/widgets/widgets/qdialogbuttonbox.cpp13
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp52
-rw-r--r--src/widgets/widgets/qdockarealayout_p.h6
-rw-r--r--src/widgets/widgets/qdockwidget.cpp43
-rw-r--r--src/widgets/widgets/qdockwidget_p.h8
-rw-r--r--src/widgets/widgets/qeffects.cpp10
-rw-r--r--src/widgets/widgets/qgroupbox.cpp8
-rw-r--r--src/widgets/widgets/qlineedit.cpp99
-rw-r--r--src/widgets/widgets/qlineedit.h3
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp28
-rw-r--r--src/widgets/widgets/qlineedit_p.h19
-rw-r--r--src/widgets/widgets/qmaccocoaviewcontainer_mac.mm26
-rw-r--r--src/widgets/widgets/qmainwindow.cpp6
-rw-r--r--src/widgets/widgets/qmainwindow.h2
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp67
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h14
-rw-r--r--src/widgets/widgets/qmdiarea.cpp21
-rw-r--r--src/widgets/widgets/qmdiarea_p.h4
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp49
-rw-r--r--src/widgets/widgets/qmdisubwindow_p.h8
-rw-r--r--src/widgets/widgets/qmenu.cpp57
-rw-r--r--src/widgets/widgets/qmenu_p.h8
-rw-r--r--src/widgets/widgets/qmenubar.cpp4
-rw-r--r--src/widgets/widgets/qmenubar_p.h4
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp30
-rw-r--r--src/widgets/widgets/qpushbutton.cpp32
-rw-r--r--src/widgets/widgets/qpushbutton_p.h3
-rw-r--r--src/widgets/widgets/qrubberband.cpp13
-rw-r--r--src/widgets/widgets/qscrollarea.cpp5
-rw-r--r--src/widgets/widgets/qscrollarea_p.h2
-rw-r--r--src/widgets/widgets/qscrollbar.cpp10
-rw-r--r--src/widgets/widgets/qsizegrip.cpp34
-rw-r--r--src/widgets/widgets/qslider.cpp3
-rw-r--r--src/widgets/widgets/qspinbox.cpp55
-rw-r--r--src/widgets/widgets/qspinbox.h8
-rw-r--r--src/widgets/widgets/qsplashscreen.cpp6
-rw-r--r--src/widgets/widgets/qsplitter.cpp11
-rw-r--r--src/widgets/widgets/qsplitter_p.h6
-rw-r--r--src/widgets/widgets/qstatusbar.cpp41
-rw-r--r--src/widgets/widgets/qtabbar.cpp33
-rw-r--r--src/widgets/widgets/qtabbar_p.h10
-rw-r--r--src/widgets/widgets/qtabwidget.cpp7
-rw-r--r--src/widgets/widgets/qtextbrowser.cpp122
-rw-r--r--src/widgets/widgets/qtextbrowser.h11
-rw-r--r--src/widgets/widgets/qtextedit.cpp114
-rw-r--r--src/widgets/widgets/qtextedit.h14
-rw-r--r--src/widgets/widgets/qtextedit_p.h3
-rw-r--r--src/widgets/widgets/qtoolbar.cpp10
-rw-r--r--src/widgets/widgets/qtoolbar_p.h2
-rw-r--r--src/widgets/widgets/qtoolbararealayout_p.h2
-rw-r--r--src/widgets/widgets/qtoolbarlayout_p.h2
-rw-r--r--src/widgets/widgets/qtoolbox.cpp86
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp20
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h28
-rw-r--r--src/widgets/widgets/qwidgetresizehandler.cpp15
-rw-r--r--src/widgets/widgets/qwidgetresizehandler_p.h2
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp96
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h29
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p_p.h8
-rw-r--r--src/winmain/winmain.pro2
-rw-r--r--src/xml/doc/snippets/code/src_xml_dom_qdom.cpp8
-rw-r--r--src/xml/dom/qdom.cpp240
-rw-r--r--src/xml/qtxmlglobal.h2
-rw-r--r--src/xml/sax/qxml.cpp128
-rw-r--r--src/xml/sax/qxml.h8
-rw-r--r--src/xml/sax/qxml_p.h2
-rw-r--r--sync.profile3
-rwxr-xr-xtests/auto/android/runtests_androiddeployqt.pl550
-rw-r--r--tests/auto/cmake/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/cmake.pro7
-rw-r--r--tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.json1
-rw-r--r--tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.pro9
-rw-r--r--tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp10
-rw-r--r--tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h70
-rw-r--r--tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.json1
-rw-r--r--tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.pro10
-rw-r--r--tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp10
-rw-r--r--tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h70
-rw-r--r--tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.json1
-rw-r--r--tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.pro10
-rw-r--r--tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp10
-rw-r--r--tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h70
-rw-r--r--tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.json1
-rw-r--r--tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.pro10
-rw-r--r--tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp10
-rw-r--r--tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h70
-rw-r--r--tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.json1
-rw-r--r--tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.pro10
-rw-r--r--tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp10
-rw-r--r--tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h70
-rw-r--r--tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.json1
-rw-r--r--tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.pro9
-rw-r--r--tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp10
-rw-r--r--tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h70
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins.pro36
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins1/fake.cpp34
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins1/mockplugins1.pro10
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h72
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins2/fake.cpp34
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins2/mockplugins2.pro4
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins3/fake.cpp34
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins3/mockplugins3.pro11
-rw-r--r--tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h72
-rw-r--r--tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_import_plugins/CMakeLists.txt111
-rw-r--r--tests/auto/cmake/test_import_plugins/check.cpp.in8
-rw-r--r--tests/auto/cmake/test_import_plugins/main.cpp101
-rw-r--r--tests/auto/cmake/test_interface/CMakeLists.txt3
-rw-r--r--tests/auto/cmake/test_moc_macro_target/CMakeLists.txt4
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro1
-rw-r--r--tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp24
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro1
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp57
-rw-r--r--tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp40
-rw-r--r--tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp11
-rw-r--r--tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST1
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/BLACKLIST5
-rw-r--r--tests/auto/corelib/animation/qpropertyanimation/BLACKLIST6
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST8
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp2
-rw-r--r--tests/auto/corelib/corelib.pro2
-rw-r--r--tests/auto/corelib/global/global.pro3
-rw-r--r--tests/auto/corelib/global/qflags/tst_qflags.cpp11
-rw-r--r--tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp230
-rw-r--r--tests/auto/corelib/global/qglobal/qglobal.c2
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp4
-rw-r--r--tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp18
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp28
-rw-r--r--tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp404
-rw-r--r--tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp4
-rw-r--r--tests/auto/corelib/global/qwinregistry/qwinregistry.pro8
-rw-r--r--tests/auto/corelib/global/qwinregistry/tst_qwinregistry.cpp (renamed from tests/auto/testlib/selftests/alive/tst_alive.cpp)70
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp6
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp10
-rw-r--r--tests/auto/corelib/io/qdir/Info.plist2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp32
-rw-r--r--tests/auto/corelib/io/qfile/BLACKLIST7
-rw-r--r--tests/auto/corelib/io/qfile/test.pro2
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp8
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp219
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST3
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp12
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp2
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.pro2
-rw-r--r--tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp6
-rw-r--r--tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/BLACKLIST7
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro2
-rw-r--r--tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro2
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp256
-rw-r--r--tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro2
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp70
-rw-r--r--tests/auto/corelib/io/qsettings/qsettings.pro2
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp54
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp14
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp2
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp151
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp18
-rw-r--r--tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp20
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp95
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp32
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp2
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp24
-rw-r--r--tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST3
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST6
-rw-r--r--tests/auto/corelib/kernel/qeventloop/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/qeventloop.pro2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp6
-rw-r--r--tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp16
-rw-r--r--tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp6
-rw-r--r--tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp6
-rw-r--r--tests/auto/corelib/kernel/qmetatype/qmetatype.pro1
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp28
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h2
-rw-r--r--tests/auto/corelib/kernel/qobject/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp316
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp3
-rw-r--r--tests/auto/corelib/kernel/qsignalblocker/tst_qsignalblocker.cpp5
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST4
-rw-r--r--tests/auto/corelib/kernel/qtimer/BLACKLIST5
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp147
-rw-r--r--tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp2
-rw-r--r--tests/auto/corelib/kernel/qvariant/qvariant.pro1
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp551
-rw-r--r--tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp4
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/lib.pro2
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro14
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst/tst.pro2
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp8
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst/tst.pro2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp1
-rw-r--r--tests/auto/corelib/serialization/json/tst_qtjson.cpp70
-rw-r--r--tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp2
-rw-r--r--tests/auto/corelib/serialization/qdatastream/qdatastream.pro2
-rw-r--r--tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp168
-rw-r--r--tests/auto/corelib/serialization/qtextstream/BLACKLIST2
-rw-r--r--tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/main.cpp2
-rw-r--r--tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp118
-rw-r--r--tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp30
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp26
-rw-r--r--tests/auto/corelib/text/qbytearray/.gitattributes (renamed from tests/auto/corelib/tools/qbytearray/.gitattributes)0
-rw-r--r--tests/auto/corelib/text/qbytearray/.gitignore (renamed from tests/auto/corelib/tools/qbytearray/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qbytearray/android_testdata.qrc (renamed from tests/auto/corelib/tools/qbytearray/android_testdata.qrc)0
-rw-r--r--tests/auto/corelib/text/qbytearray/qbytearray.pro (renamed from tests/auto/corelib/tools/qbytearray/qbytearray.pro)0
-rw-r--r--tests/auto/corelib/text/qbytearray/rfc3252.txt (renamed from tests/auto/corelib/tools/qbytearray/rfc3252.txt)0
-rw-r--r--tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp (renamed from tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp)35
-rw-r--r--tests/auto/corelib/text/qbytearray/tst_qbytearray_mac.mm (renamed from tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm)0
-rw-r--r--tests/auto/corelib/text/qbytearraylist/qbytearraylist.pro (renamed from tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro)0
-rw-r--r--tests/auto/corelib/text/qbytearraylist/tst_qbytearraylist.cpp (renamed from tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp)14
-rw-r--r--tests/auto/corelib/text/qbytearraymatcher/qbytearraymatcher.pro (renamed from tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro)0
-rw-r--r--tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp (renamed from tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp)0
-rw-r--r--tests/auto/corelib/text/qbytedatabuffer/.gitignore (renamed from tests/auto/corelib/tools/qbytedatabuffer/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qbytedatabuffer/qbytedatabuffer.pro (renamed from tests/auto/corelib/tools/qbytedatabuffer/qbytedatabuffer.pro)0
-rw-r--r--tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp (renamed from tests/auto/corelib/tools/qbytedatabuffer/tst_qbytedatabuffer.cpp)0
-rw-r--r--tests/auto/corelib/text/qchar/.gitignore (renamed from tests/auto/corelib/tools/qchar/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qchar/data/NormalizationTest.txt (renamed from tests/auto/corelib/tools/qchar/data/NormalizationTest.txt)0
-rw-r--r--tests/auto/corelib/text/qchar/qchar.pro (renamed from tests/auto/corelib/tools/qchar/qchar.pro)0
-rw-r--r--tests/auto/corelib/text/qchar/testdata.qrc (renamed from tests/auto/corelib/tools/qchar/testdata.qrc)0
-rw-r--r--tests/auto/corelib/text/qchar/tst_qchar.cpp (renamed from tests/auto/corelib/tools/qchar/tst_qchar.cpp)0
-rw-r--r--tests/auto/corelib/text/qcollator/qcollator.pro (renamed from tests/auto/corelib/tools/qcollator/qcollator.pro)1
-rw-r--r--tests/auto/corelib/text/qcollator/tst_qcollator.cpp (renamed from tests/auto/corelib/tools/qcollator/tst_qcollator.cpp)6
-rw-r--r--tests/auto/corelib/text/qlatin1string/.gitignore (renamed from tests/auto/corelib/tools/qlatin1string/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qlatin1string/qlatin1string.pro (renamed from tests/auto/corelib/tools/qlatin1string/qlatin1string.pro)0
-rw-r--r--tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp (renamed from tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp)42
-rw-r--r--tests/auto/corelib/text/qlocale/.gitignore (renamed from tests/auto/corelib/tools/qlocale/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qlocale/qlocale.pro (renamed from tests/auto/corelib/tools/qlocale/qlocale.pro)0
-rw-r--r--tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp (renamed from tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp)0
-rw-r--r--tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.pro (renamed from tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro)0
-rw-r--r--tests/auto/corelib/text/qlocale/test/test.pro (renamed from tests/auto/corelib/tools/qlocale/test/test.pro)0
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp (renamed from tests/auto/corelib/tools/qlocale/tst_qlocale.cpp)21
-rw-r--r--tests/auto/corelib/text/qregexp/.gitignore (renamed from tests/auto/corelib/tools/qregexp/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qregexp/qregexp.pro (renamed from tests/auto/corelib/tools/qregexp/qregexp.pro)0
-rw-r--r--tests/auto/corelib/text/qregexp/tst_qregexp.cpp (renamed from tests/auto/corelib/tools/qregexp/tst_qregexp.cpp)0
-rw-r--r--tests/auto/corelib/text/qregularexpression/.gitignore (renamed from tests/auto/corelib/tools/qregularexpression/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qregularexpression/qregularexpression.pro (renamed from tests/auto/corelib/tools/qregularexpression/qregularexpression.pro)0
-rw-r--r--tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp (renamed from tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp)0
-rw-r--r--tests/auto/corelib/text/qstring/.gitignore (renamed from tests/auto/corelib/tools/qstring/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qstring/double_data.h (renamed from tests/auto/corelib/tools/qstring/double_data.h)0
-rw-r--r--tests/auto/corelib/text/qstring/qstring.pro (renamed from tests/auto/corelib/tools/qstring/qstring.pro)3
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp (renamed from tests/auto/corelib/tools/qstring/tst_qstring.cpp)192
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring_mac.mm (renamed from tests/auto/corelib/tools/qstring/tst_qstring_mac.mm)0
-rw-r--r--tests/auto/corelib/text/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro (renamed from tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro)0
-rw-r--r--tests/auto/corelib/text/qstring_no_cast_from_bytearray/tst_qstring_no_cast_from_bytearray.cpp (renamed from tests/auto/corelib/tools/qstring_no_cast_from_bytearray/tst_qstring_no_cast_from_bytearray.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/.gitignore (renamed from tests/auto/corelib/tools/qstringapisymmetry/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/qstringapisymmetry.pro (renamed from tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro)0
-rw-r--r--tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp (renamed from tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp)564
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder.pro (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder.pro)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder1/qstringbuilder1.pro (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder2/qstringbuilder2.pro (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder3/qstringbuilder3.pro (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder4/qstringbuilder4.pro (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro)0
-rw-r--r--tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp (renamed from tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringiterator/qstringiterator.pro (renamed from tests/auto/corelib/tools/qstringiterator/qstringiterator.pro)0
-rw-r--r--tests/auto/corelib/text/qstringiterator/tst_qstringiterator.cpp (renamed from tests/auto/corelib/tools/qstringiterator/tst_qstringiterator.cpp)0
-rw-r--r--tests/auto/corelib/text/qstringlist/.gitignore (renamed from tests/auto/corelib/tools/qstringlist/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qstringlist/qstringlist.pro (renamed from tests/auto/corelib/tools/qstringlist/qstringlist.pro)0
-rw-r--r--tests/auto/corelib/text/qstringlist/tst_qstringlist.cpp (renamed from tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp)59
-rw-r--r--tests/auto/corelib/text/qstringmatcher/.gitignore (renamed from tests/auto/corelib/tools/qstringmatcher/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qstringmatcher/qstringmatcher.pro (renamed from tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro)0
-rw-r--r--tests/auto/corelib/text/qstringmatcher/tst_qstringmatcher.cpp (renamed from tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp)6
-rw-r--r--tests/auto/corelib/text/qstringref/qstringref.pro (renamed from tests/auto/corelib/tools/qstringref/qstringref.pro)0
-rw-r--r--tests/auto/corelib/text/qstringref/tst_qstringref.cpp (renamed from tests/auto/corelib/tools/qstringref/tst_qstringref.cpp)24
-rw-r--r--tests/auto/corelib/text/qstringview/.gitignore (renamed from tests/auto/corelib/tools/qstringview/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qstringview/qstringview.pro (renamed from tests/auto/corelib/tools/qstringview/qstringview.pro)0
-rw-r--r--tests/auto/corelib/text/qstringview/tst_qstringview.cpp (renamed from tests/auto/corelib/tools/qstringview/tst_qstringview.cpp)53
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/.gitignore (renamed from tests/auto/corelib/tools/qtextboundaryfinder/.gitignore)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/data/GraphemeBreakTest.txt (renamed from tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/data/LineBreakTest.txt (renamed from tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/data/SentenceBreakTest.txt (renamed from tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/data/WordBreakTest.txt (renamed from tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/qtextboundaryfinder.pro (renamed from tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/testdata.qrc (renamed from tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc)0
-rw-r--r--tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp (renamed from tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp)2
-rw-r--r--tests/auto/corelib/text/text.pro23
-rw-r--r--tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp53
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp202
-rw-r--r--tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp176
-rw-r--r--tests/auto/corelib/thread/qfuture/qfuture.pro1
-rw-r--r--tests/auto/corelib/thread/qfuture/tst_qfuture.cpp67
-rw-r--r--tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp3
-rw-r--r--tests/auto/corelib/thread/qmutex/tst_qmutex.cpp33
-rw-r--r--tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp6
-rw-r--r--tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp27
-rw-r--r--tests/auto/corelib/thread/qsemaphore/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qthread/BLACKLIST5
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp54
-rw-r--r--tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp8
-rw-r--r--tests/auto/corelib/thread/qthreadpool/BLACKLIST5
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp89
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp12
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp32
-rw-r--r--tests/auto/corelib/time/qcalendar/qcalendar.pro5
-rw-r--r--tests/auto/corelib/time/qcalendar/tst_qcalendar.cpp236
-rw-r--r--tests/auto/corelib/time/qdate/.gitignore (renamed from tests/auto/corelib/tools/qdate/.gitignore)0
-rw-r--r--tests/auto/corelib/time/qdate/qdate.pro (renamed from tests/auto/corelib/tools/qdate/qdate.pro)2
-rw-r--r--tests/auto/corelib/time/qdate/tst_qdate.cpp (renamed from tests/auto/corelib/tools/qdate/tst_qdate.cpp)200
-rw-r--r--tests/auto/corelib/time/qdatetime/.gitignore (renamed from tests/auto/corelib/tools/qdatetime/.gitignore)0
-rw-r--r--tests/auto/corelib/time/qdatetime/qdatetime.pro (renamed from tests/auto/corelib/tools/qdatetime/qdatetime.pro)0
-rw-r--r--tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp (renamed from tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp)93
-rw-r--r--tests/auto/corelib/time/qdatetime/tst_qdatetime_mac.mm (renamed from tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm)0
-rw-r--r--tests/auto/corelib/time/qtime/.gitignore (renamed from tests/auto/corelib/tools/qtime/.gitignore)0
-rw-r--r--tests/auto/corelib/time/qtime/qtime.pro (renamed from tests/auto/corelib/tools/qtime/qtime.pro)0
-rw-r--r--tests/auto/corelib/time/qtime/tst_qtime.cpp (renamed from tests/auto/corelib/tools/qtime/tst_qtime.cpp)5
-rw-r--r--tests/auto/corelib/time/qtimezone/BLACKLIST (renamed from tests/auto/corelib/tools/qtimezone/BLACKLIST)0
-rw-r--r--tests/auto/corelib/time/qtimezone/qtimezone.pro (renamed from tests/auto/corelib/tools/qtimezone/qtimezone.pro)0
-rw-r--r--tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp (renamed from tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp)11
-rw-r--r--tests/auto/corelib/time/qtimezone/tst_qtimezone_darwin.mm (renamed from tests/auto/corelib/tools/qtimezone/tst_qtimezone_darwin.mm)0
-rw-r--r--tests/auto/corelib/time/time.pro7
-rw-r--r--tests/auto/corelib/tools/collections/collections.pro2
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp124
-rw-r--r--tests/auto/corelib/tools/containerapisymmetry/containerapisymmetry.pro1
-rw-r--r--tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp723
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp65
-rw-r--r--tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp58
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp2
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp79
-rw-r--r--tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp4
-rw-r--r--tests/auto/corelib/tools/qdatetime/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp50
-rw-r--r--tests/auto/corelib/tools/qhash/qhash.pro2
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp6
-rw-r--r--tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp36
-rw-r--r--tests/auto/corelib/tools/qline/tst_qline.cpp9
-rw-r--r--tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro3
-rw-r--r--tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp30
-rw-r--r--tests/auto/corelib/tools/qlist/qlist.pro2
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp40
-rw-r--r--tests/auto/corelib/tools/qlocale/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qmap/qmap.pro2
-rw-r--r--tests/auto/corelib/tools/qmap/tst_qmap.cpp4
-rw-r--r--tests/auto/corelib/tools/qpair/qpair.pro3
-rw-r--r--tests/auto/corelib/tools/qpair/tst_qpair.cpp26
-rw-r--r--tests/auto/corelib/tools/qpoint/tst_qpoint.cpp7
-rw-r--r--tests/auto/corelib/tools/qpointf/tst_qpointf.cpp7
-rw-r--r--tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp42
-rw-r--r--tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp13
-rw-r--r--tests/auto/corelib/tools/qset/qset.pro4
-rw-r--r--tests/auto/corelib/tools/qset/tst_qset.cpp40
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp265
-rw-r--r--tests/auto/corelib/tools/qsize/tst_qsize.cpp44
-rw-r--r--tests/auto/corelib/tools/qsizef/tst_qsizef.cpp44
-rw-r--r--tests/auto/corelib/tools/qtimeline/BLACKLIST8
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro2
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp77
-rw-r--r--tests/auto/corelib/tools/qvector/qvector.pro2
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp101
-rw-r--r--tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp19
-rw-r--r--tests/auto/corelib/tools/tools.pro25
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST0
-rw-r--r--tests/auto/dbus/qdbusconnection_spyhook/BLACKLIST0
-rw-r--r--tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp4
-rw-r--r--tests/auto/gui/gui.pro1
-rw-r--r--tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp8
-rw-r--r--tests/auto/gui/image/qimage/qimage.pro2
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp39
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp39
-rw-r--r--tests/auto/gui/image/qpixmap/qpixmap.pro2
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp13
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp44
-rw-r--r--tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp2
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp10
-rw-r--r--tests/auto/gui/kernel/noqteventloop/noqteventloop.pro2
-rw-r--r--tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp36
-rw-r--r--tests/auto/gui/kernel/qdrag/tst_qdrag.cpp9
-rw-r--r--tests/auto/gui/kernel/qguiapplication/BLACKLIST5
-rw-r--r--tests/auto/gui/kernel/qguiapplication/qguiapplication.pro1
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp54
-rw-r--r--tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST4
-rw-r--r--tests/auto/gui/kernel/qguieventloop/BLACKLIST2
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp2
-rw-r--r--tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp4
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp2
-rw-r--r--tests/auto/gui/kernel/qpalette/tst_qpalette.cpp8
-rw-r--r--tests/auto/gui/kernel/qtouchevent/BLACKLIST6
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp14
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST28
-rw-r--r--tests/auto/gui/kernel/qwindow/qwindow.pro2
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp8
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp4
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp3
-rw-r--r--tests/auto/gui/painting/painting.pro1
-rw-r--r--tests/auto/gui/painting/qbrush/tst_qbrush.cpp6
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp469
-rw-r--r--tests/auto/gui/painting/qcolorspace/qcolorspace.pro9
-rw-r--r--tests/auto/gui/painting/qcolorspace/resources/HP_ZR30w.iccbin0 -> 1856 bytes
-rw-r--r--tests/auto/gui/painting/qcolorspace/resources/ProPhoto.jpgbin0 -> 30900 bytes
-rw-r--r--tests/auto/gui/painting/qcolorspace/resources/sRGB2014.iccbin0 -> 3024 bytes
-rw-r--r--tests/auto/gui/painting/qcolorspace/tst_qcolorspace.cpp448
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp143
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp4
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.cpp2
-rw-r--r--tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp13
-rw-r--r--tests/auto/gui/painting/qpen/tst_qpen.cpp8
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp24
-rw-r--r--tests/auto/gui/qopengl/BLACKLIST8
-rw-r--r--tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp6
-rw-r--r--tests/auto/gui/rhi/qrhi/data/compile.bat48
-rw-r--r--tests/auto/gui/rhi/qrhi/data/qt256.pngbin0 -> 6208 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simple.frag8
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simple.frag.qsbbin0 -> 908 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simple.vert10
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simple.vert.qsbbin0 -> 958 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simpletextured.frag13
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simpletextured.frag.qsbbin0 -> 1479 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simpletextured.vert14
-rw-r--r--tests/auto/gui/rhi/qrhi/data/simpletextured.vert.qsbbin0 -> 1195 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/data/textured.frag19
-rw-r--r--tests/auto/gui/rhi/qrhi/data/textured.frag.qsbbin0 -> 1997 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/data/textured.vert19
-rw-r--r--tests/auto/gui/rhi/qrhi/data/textured.vert.qsbbin0 -> 1708 bytes
-rw-r--r--tests/auto/gui/rhi/qrhi/qrhi.pro8
-rw-r--r--tests/auto/gui/rhi/qrhi/qrhi.qrc5
-rw-r--r--tests/auto/gui/rhi/qrhi/tst_qrhi.cpp1732
-rw-r--r--tests/auto/gui/rhi/qshader/data/color.vert18
-rw-r--r--tests/auto/gui/rhi/qshader/data/color.vert.qsbbin0 -> 1847 bytes
-rw-r--r--tests/auto/gui/rhi/qshader/data/color_simple.vert.qsbbin0 -> 813 bytes
-rw-r--r--tests/auto/gui/rhi/qshader/qshader.pro8
-rw-r--r--tests/auto/gui/rhi/qshader/qshader.qrc5
-rw-r--r--tests/auto/gui/rhi/qshader/tst_qshader.cpp233
-rw-r--r--tests/auto/gui/rhi/rhi.pro4
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp29
-rw-r--r--tests/auto/gui/text/qfont/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp26
-rw-r--r--tests/auto/gui/text/qfontcache/tst_qfontcache.cpp2
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp4
-rw-r--r--tests/auto/gui/text/qglyphrun/BLACKLIST1
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp2
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp29
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp153
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/BLACKLIST4
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp40
-rw-r--r--tests/auto/gui/text/qtextlist/tst_qtextlist.cpp2
-rw-r--r--tests/auto/gui/text/qtextmarkdownimporter/data/headingBulletsContinuations.md28
-rw-r--r--tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md17
-rw-r--r--tests/auto/gui/text/qtextmarkdownimporter/qtextmarkdownimporter.pro9
-rw-r--r--tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp226
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/blockquotes.md62
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/example.md95
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/headingsAndLists.md12
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/data/wordWrap.md13
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/qtextmarkdownwriter.pro9
-rw-r--r--tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp473
-rw-r--r--tests/auto/gui/text/qtexttable/qtexttable.pro2
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp150
-rw-r--r--tests/auto/gui/text/text.pro4
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp4
-rw-r--r--tests/auto/network-settings.h76
-rw-r--r--tests/auto/network/access/http2/http2srv.cpp10
-rw-r--r--tests/auto/network/access/http2/http2srv.h12
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp138
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/BLACKLIST2
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro2
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp7
-rw-r--r--tests/auto/network/access/qftp/BLACKLIST6
-rw-r--r--tests/auto/network/access/qftp/qftp.pro3
-rw-r--r--tests/auto/network/access/qftp/tst_qftp.cpp178
-rw-r--r--tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro3
-rw-r--r--tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp76
-rw-r--r--tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp13
-rw-r--r--tests/auto/network/access/qnetworkreply/BLACKLIST133
-rw-r--r--tests/auto/network/access/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp259
-rw-r--r--tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp7
-rw-r--r--tests/auto/network/access/spdy/BLACKLIST7
-rw-r--r--tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp8
-rw-r--r--tests/auto/network/kernel/qdnslookup/BLACKLIST2
-rw-r--r--tests/auto/network/kernel/qhostaddress/qhostaddress.pro2
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp3
-rw-r--r--tests/auto/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp3
-rw-r--r--tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp2
-rw-r--r--tests/auto/network/socket/platformsocketengine/BLACKLIST10
-rw-r--r--tests/auto/network/socket/platformsocketengine/platformsocketengine.pri2
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp6
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/BLACKLIST4
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro5
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp49
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp7
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/BLACKLIST11
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro6
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp42
-rw-r--r--tests/auto/network/socket/qtcpserver/BLACKLIST17
-rw-r--r--tests/auto/network/socket/qtcpserver/crashingServer/main.cpp4
-rw-r--r--tests/auto/network/socket/qtcpserver/test/test.pro8
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp48
-rw-r--r--tests/auto/network/socket/qtcpsocket/BLACKLIST10
-rw-r--r--tests/auto/network/socket/qtcpsocket/test/test.pro8
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp186
-rw-r--r--tests/auto/network/socket/qudpsocket/BLACKLIST26
-rw-r--r--tests/auto/network/socket/qudpsocket/clientserver/main.cpp2
-rw-r--r--tests/auto/network/socket/qudpsocket/test/test.pro8
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp22
-rw-r--r--tests/auto/network/ssl/qsslcertificate/BLACKLIST12
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp10
-rw-r--r--tests/auto/network/ssl/qsslkey/BLACKLIST9
-rw-r--r--tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes128.pem30
-rw-r--r--tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes192.pem30
-rw-r--r--tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes256.pem30
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp150
-rw-r--r--tests/auto/network/ssl/qsslsocket/BLACKLIST6
-rw-r--r--tests/auto/network/ssl/qsslsocket/certs/qt-test-server-cert.pem16
-rw-r--r--tests/auto/network/ssl/qsslsocket/qsslsocket.pro7
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp441
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro6
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp51
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro6
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp24
-rw-r--r--tests/auto/opengl/qgl/BLACKLIST31
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp7
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp22
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp2
-rw-r--r--tests/auto/other/gestures/BLACKLIST14
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp62
-rw-r--r--tests/auto/other/lancelot/paintcommands.h4
-rw-r--r--tests/auto/other/lancelot/scripts/fillrect.qps121
-rw-r--r--tests/auto/other/lancelot/scripts/fillrect_aa.qps121
-rw-r--r--tests/auto/other/macplist/tst_macplist.cpp10
-rw-r--r--tests/auto/other/networkselftest/BLACKLIST5
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp5
-rw-r--r--tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp19
-rw-r--r--tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h2
-rw-r--r--tests/auto/other/qaccessibility/qaccessibility.pro3
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp1
-rw-r--r--tests/auto/other/qaccessibilitymac/BLACKLIST2
-rw-r--r--tests/auto/other/qfocusevent/BLACKLIST6
-rw-r--r--tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/BLACKLIST2
-rw-r--r--tests/auto/other/qobjectrace/tst_qobjectrace.cpp20
-rw-r--r--tests/auto/other/toolsupport/tst_toolsupport.cpp10
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp8
-rw-r--r--tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp37
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_databases.h13
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp4
-rw-r--r--tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp87
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp90
-rw-r--r--tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp2
-rw-r--r--tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp7
-rw-r--r--tests/auto/testlib/initmain/initmain.pro5
-rw-r--r--tests/auto/testlib/initmain/tst_initmain.cpp56
-rw-r--r--tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp2
-rw-r--r--tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp52
-rw-r--r--tests/auto/testlib/selftests/alive/.gitignore1
-rw-r--r--tests/auto/testlib/selftests/alive/alive.pro10
-rw-r--r--tests/auto/testlib/selftests/alive/qtestalive.cpp147
-rw-r--r--tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp21
-rw-r--r--tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp8
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml12
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.tap142
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.teamcity6
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt10
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml12
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml8
-rw-r--r--tests/auto/testlib/selftests/expected_crashes_5.txt5
-rw-r--r--tests/auto/testlib/selftests/expected_float.lightxml197
-rw-r--r--tests/auto/testlib/selftests/expected_float.tap641
-rw-r--r--tests/auto/testlib/selftests/expected_float.teamcity106
-rw-r--r--tests/auto/testlib/selftests/expected_float.txt125
-rw-r--r--tests/auto/testlib/selftests/expected_float.xml197
-rw-r--r--tests/auto/testlib/selftests/expected_float.xunitxml86
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.lightxml155
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.tap77
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.teamcity47
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.txt94
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.xml155
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.xunitxml128
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.lightxml585
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.tap153
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.teamcity64
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.txt151
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.xml588
-rw-r--r--tests/auto/testlib/selftests/expected_signaldumper.xunitxml288
-rw-r--r--tests/auto/testlib/selftests/float/tst_float.cpp187
-rwxr-xr-xtests/auto/testlib/selftests/generate_expected_output.py12
-rw-r--r--tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp44
-rw-r--r--tests/auto/testlib/selftests/selftests.pri2
-rw-r--r--tests/auto/testlib/selftests/signaldumper/signaldumper.pro9
-rw-r--r--tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp428
-rw-r--r--tests/auto/testlib/selftests/silent/tst_silent.cpp21
-rw-r--r--tests/auto/testlib/selftests/sleep/tst_sleep.cpp3
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp28
-rw-r--r--tests/auto/testlib/testlib.pro1
-rw-r--r--tests/auto/tools/moc/cxx-attributes.h103
-rw-r--r--tests/auto/tools/moc/cxx11-enums.h18
-rw-r--r--tests/auto/tools/moc/moc.pro3
-rw-r--r--tests/auto/tools/moc/parse-defines.h11
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp83
-rw-r--r--tests/auto/tools/qmake/testcompiler.cpp18
-rw-r--r--tests/auto/tools/qmake/testcompiler.h8
-rw-r--r--tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro5
-rw-r--r--tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp4
-rw-r--r--tests/auto/tools/qmake/testdata/windows_resources/inter.inc1
-rw-r--r--tests/auto/tools/qmake/testdata/windows_resources/main.cpp1
-rw-r--r--tests/auto/tools/qmake/testdata/windows_resources/version.inc28
-rw-r--r--tests/auto/tools/qmake/testdata/windows_resources/windows_resources.pro4
-rw-r--r--tests/auto/tools/qmake/testdata/windows_resources/windows_resources.rc2
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp53
-rw-r--r--tests/auto/tools/qmakelib/qmakelib.pro2
-rw-r--r--tests/auto/tools/rcc/data/depfile/simple.d.expected1
-rw-r--r--tests/auto/tools/rcc/data/depfile/simple.qrc6
-rw-r--r--tests/auto/tools/rcc/data/depfile/specialchar$file.txt1
-rw-r--r--tests/auto/tools/rcc/data/depfile/specialchar.d.expected1
-rw-r--r--tests/auto/tools/rcc/data/depfile/specialchar.qrc6
-rw-r--r--tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected68
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp278
-rw-r--r--tests/auto/tools/uic/baseline/dialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/dialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/qfiledialog.ui.h2
-rw-r--r--tests/auto/tools/uic/tst_uic.cpp166
-rw-r--r--tests/auto/widgets/dialogs/qdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp43
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp13
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST4
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp16
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST11
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp379
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/BLACKLIST4
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp4
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp4
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/BLACKLIST3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp21
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp6
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp16
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST10
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp744
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST20
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp35
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp3
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/BLACKLIST1
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp38
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp6
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp4
-rw-r--r--tests/auto/widgets/itemviews/qtableview/BLACKLIST3
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp1440
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp415
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp1027
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp857
-rw-r--r--tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp189
-rw-r--r--tests/auto/widgets/kernel/kernel.pro2
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp60
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp81
-rw-r--r--tests/auto/widgets/kernel/qapplication/BLACKLIST1
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp8
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp70
-rw-r--r--tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp21
-rw-r--r--tests/auto/widgets/kernel/qformlayout/qformlayout.pro2
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp21
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp12
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp4
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp750
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST34
-rw-r--r--tests/auto/widgets/kernel/qwidget/qwidget.pro2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp79
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/BLACKLIST4
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/button.pngbin1785 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/combobox.pngbin1808 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/lineedit.pngbin953 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/mdi.pngbin3092 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/menu.pngbin1139 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/radiobutton.pngbin1498 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/slider.pngbin1074 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/mac/spinbox.pngbin1299 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/button.pngbin722 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/combobox.pngbin809 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/lineedit.pngbin530 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/menu.pngbin646 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/radiobutton.pngbin844 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/slider.pngbin575 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/images/vista/spinbox.pngbin583 -> 0 bytes
-rw-r--r--tests/auto/widgets/styles/qstyle/qstyle.pro5
-rw-r--r--tests/auto/widgets/styles/qstyle/testdata.qrc19
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp124
-rw-r--r--tests/auto/widgets/util/qcompleter/BLACKLIST6
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp4
-rw-r--r--tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp10
-rw-r--r--tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp32
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp37
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp46
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp6
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST4
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp26
-rw-r--r--tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qframe/tst_qframe.cpp4
-rw-r--r--tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp6
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp2
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp20
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/BLACKLIST19
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp6
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp9
-rw-r--r--tests/auto/widgets/widgets/qmenu/BLACKLIST12
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp21
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp8
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/BLACKLIST6
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp3
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp5
-rw-r--r--tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp7
-rw-r--r--tests/auto/widgets/widgets/qspinbox/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp32
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp4
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/heading.html2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/markdown.md2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/markdown.really2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/quotesAndFractions.md1
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp92
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp54
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/BLACKLIST2
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp3
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp4
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp12
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak5
-rw-r--r--tests/baselineserver/shared/baselineprotocol.cpp4
-rw-r--r--tests/benchmarks/corelib/corelib.pro2
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp24
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp5
-rw-r--r--tests/benchmarks/corelib/kernel/kernel.pro3
-rw-r--r--tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp88
-rw-r--r--tests/benchmarks/corelib/text/qbytearray/main.cpp (renamed from tests/benchmarks/corelib/tools/qbytearray/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/text/qbytearray/qbytearray.pro (renamed from tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro)0
-rw-r--r--tests/benchmarks/corelib/text/qchar/main.cpp (renamed from tests/benchmarks/corelib/tools/qchar/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/text/qchar/qchar.pro (renamed from tests/benchmarks/corelib/tools/qchar/qchar.pro)0
-rw-r--r--tests/benchmarks/corelib/text/qlocale/main.cpp (renamed from tests/benchmarks/corelib/tools/qlocale/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/text/qlocale/qlocale.pro (renamed from tests/benchmarks/corelib/tools/qlocale/qlocale.pro)0
-rw-r--r--tests/benchmarks/corelib/text/qregexp/main.cpp (renamed from tests/benchmarks/corelib/tools/qregexp/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/text/qregexp/qregexp.pro (renamed from tests/benchmarks/corelib/tools/qregexp/qregexp.pro)0
-rw-r--r--tests/benchmarks/corelib/text/qregexp/qregexp.qrc (renamed from tests/benchmarks/corelib/tools/qregexp/qregexp.qrc)0
-rw-r--r--tests/benchmarks/corelib/text/qstring/main.cpp (renamed from tests/benchmarks/corelib/tools/qstring/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/text/qstring/qstring.pro (renamed from tests/benchmarks/corelib/tools/qstring/qstring.pro)0
-rw-r--r--tests/benchmarks/corelib/text/qstringbuilder/main.cpp (renamed from tests/benchmarks/corelib/tools/qstringbuilder/main.cpp)2
-rw-r--r--tests/benchmarks/corelib/text/qstringbuilder/qstringbuilder.pro (renamed from tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro)0
-rw-r--r--tests/benchmarks/corelib/text/qstringlist/.gitignore (renamed from tests/benchmarks/corelib/tools/qstringlist/.gitignore)0
-rw-r--r--tests/benchmarks/corelib/text/qstringlist/main.cpp (renamed from tests/benchmarks/corelib/tools/qstringlist/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/text/qstringlist/qstringlist.pro (renamed from tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro)0
-rw-r--r--tests/benchmarks/corelib/text/text.pro9
-rw-r--r--tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro3
-rw-r--r--tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp91
-rw-r--r--tests/benchmarks/corelib/time/qdate/qdate.pro4
-rw-r--r--tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp213
-rw-r--r--tests/benchmarks/corelib/time/qdatetime/main.cpp574
-rw-r--r--tests/benchmarks/corelib/time/qdatetime/qdatetime.pro (renamed from tests/benchmarks/corelib/tools/qdatetime/qdatetime.pro)0
-rw-r--r--tests/benchmarks/corelib/time/qtimezone/main.cpp (renamed from tests/benchmarks/corelib/tools/qtimezone/main.cpp)0
-rw-r--r--tests/benchmarks/corelib/time/qtimezone/qtimezone.pro (renamed from tests/benchmarks/corelib/tools/qtimezone/qtimezone.pro)0
-rw-r--r--tests/benchmarks/corelib/time/time.pro5
-rw-r--r--tests/benchmarks/corelib/tools/qdatetime/main.cpp604
-rw-r--r--tests/benchmarks/corelib/tools/qhash/paths_small_data.txt56
-rw-r--r--tests/benchmarks/corelib/tools/qvector/qrawvector.h7
-rw-r--r--tests/benchmarks/corelib/tools/tools.pro9
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp28
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro2
-rw-r--r--tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp17
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp4
-rw-r--r--tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp12
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp2
-rw-r--r--tests/benchmarks/opengl/main.cpp5
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp1
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp2
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp2
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp2
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp5
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp12
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp5
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp6
-rw-r--r--tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp2
-rw-r--r--tests/libfuzzer/gui/iccparser/iccparser.pro3
-rw-r--r--tests/libfuzzer/gui/iccparser/main.cpp37
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/setHtml/main.cpp2
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp34
-rw-r--r--tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro4
-rw-r--r--tests/libfuzzer/gui/text/qtextlayout/beginLayout/beginLayout.pro3
-rw-r--r--tests/libfuzzer/gui/text/qtextlayout/beginLayout/main.cpp36
-rw-r--r--tests/manual/diaglib/diaglib.pri2
-rw-r--r--tests/manual/diaglib/nativewindowdump_win.cpp71
-rw-r--r--tests/manual/diaglib/textdump.cpp3
-rw-r--r--tests/manual/dialogs/printdialogpanel.cpp3
-rw-r--r--tests/manual/highdpi/dragwidget.cpp2
-rw-r--r--tests/manual/highdpi/highdpi.pro1
-rw-r--r--tests/manual/highdpi/main.cpp89
-rw-r--r--tests/manual/keypadnavigation/main.cpp37
-rw-r--r--tests/manual/lance/main.cpp13
-rw-r--r--tests/manual/lance/widgets.h1
-rw-r--r--tests/manual/manual.pro5
-rw-r--r--tests/manual/markdown/html2md.cpp64
-rw-r--r--tests/manual/markdown/html2md.pro6
-rw-r--r--tests/manual/qcursor/qcursorhighdpi/main.cpp13
-rw-r--r--tests/manual/qdesktopwidget/main.cpp2
-rw-r--r--tests/manual/qgraphicslayout/flicker/window.h2
-rw-r--r--tests/manual/qnetconmonitor/qnetconmonitor.pro4
-rw-r--r--tests/manual/qnetconmonitor/tst_qnetconmonitor.cpp220
-rw-r--r--tests/manual/qscreen/main.cpp5
-rw-r--r--tests/manual/qtexttableborders/main.cpp39
-rw-r--r--tests/manual/qtexttableborders/qtexttableborders.pro10
-rw-r--r--tests/manual/qtexttableborders/resources.qrc6
-rw-r--r--tests/manual/qtexttableborders/table-border-test-header.html129
-rw-r--r--tests/manual/qtexttableborders/table-border-test.html171
-rw-r--r--tests/manual/qtexttableborders/widget.cpp125
-rw-r--r--tests/manual/qtexttableborders/widget.h56
-rw-r--r--tests/manual/qtexttableborders/widget.ui79
-rw-r--r--tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp200
-rw-r--r--tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.pro8
-rw-r--r--tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.qrc7
-rw-r--r--tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp213
-rw-r--r--tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.pro8
-rw-r--r--tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.qrc8
-rw-r--r--tests/manual/rhi/computebuffer/buffer.comp41
-rw-r--r--tests/manual/rhi/computebuffer/buffer.comp.qsbbin0 -> 2160 bytes
-rwxr-xr-xtests/manual/rhi/computebuffer/buildshaders.bat3
-rw-r--r--tests/manual/rhi/computebuffer/computebuffer.cpp205
-rw-r--r--tests/manual/rhi/computebuffer/computebuffer.pro8
-rw-r--r--tests/manual/rhi/computebuffer/computebuffer.qrc7
-rw-r--r--tests/manual/rhi/computebuffer/main.frag8
-rw-r--r--tests/manual/rhi/computebuffer/main.frag.qsbbin0 -> 672 bytes
-rw-r--r--tests/manual/rhi/computebuffer/main.vert11
-rw-r--r--tests/manual/rhi/computebuffer/main.vert.qsbbin0 -> 852 bytes
-rwxr-xr-xtests/manual/rhi/computeimage/buildshaders.bat1
-rw-r--r--tests/manual/rhi/computeimage/computeimage.cpp228
-rw-r--r--tests/manual/rhi/computeimage/computeimage.pro8
-rw-r--r--tests/manual/rhi/computeimage/computeimage.qrc8
-rw-r--r--tests/manual/rhi/computeimage/image.comp20
-rw-r--r--tests/manual/rhi/computeimage/image.comp.qsbbin0 -> 1811 bytes
-rw-r--r--tests/manual/rhi/cubemap/buildshaders.bat2
-rw-r--r--tests/manual/rhi/cubemap/c.pngbin0 -> 27923 bytes
-rw-r--r--tests/manual/rhi/cubemap/cubemap.cpp179
-rw-r--r--tests/manual/rhi/cubemap/cubemap.frag10
-rw-r--r--tests/manual/rhi/cubemap/cubemap.frag.qsbbin0 -> 1311 bytes
-rw-r--r--tests/manual/rhi/cubemap/cubemap.pro8
-rw-r--r--tests/manual/rhi/cubemap/cubemap.qrc7
-rw-r--r--tests/manual/rhi/cubemap/cubemap.vert15
-rw-r--r--tests/manual/rhi/cubemap/cubemap.vert.qsbbin0 -> 1499 bytes
-rw-r--r--tests/manual/rhi/cubemap_scissor/cubemap_scissor.cpp241
-rw-r--r--tests/manual/rhi/cubemap_scissor/cubemap_scissor.pro8
-rw-r--r--tests/manual/rhi/cubemap_scissor/cubemap_scissor.qrc7
-rw-r--r--tests/manual/rhi/floattexture/floattexture.cpp328
-rw-r--r--tests/manual/rhi/floattexture/floattexture.pro8
-rw-r--r--tests/manual/rhi/floattexture/floattexture.qrc7
-rw-r--r--tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp550
-rw-r--r--tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.pro8
-rw-r--r--tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.qrc6
-rw-r--r--tests/manual/rhi/instancing/buildshaders.bat2
-rw-r--r--tests/manual/rhi/instancing/inst.frag9
-rw-r--r--tests/manual/rhi/instancing/inst.frag.qsbbin0 -> 936 bytes
-rw-r--r--tests/manual/rhi/instancing/inst.vert25
-rw-r--r--tests/manual/rhi/instancing/inst.vert.qsbbin0 -> 1792 bytes
-rw-r--r--tests/manual/rhi/instancing/instancing.cpp175
-rw-r--r--tests/manual/rhi/instancing/instancing.pro8
-rw-r--r--tests/manual/rhi/instancing/instancing.qrc6
-rw-r--r--tests/manual/rhi/mrt/buildshaders.bat2
-rw-r--r--tests/manual/rhi/mrt/mrt.cpp294
-rw-r--r--tests/manual/rhi/mrt/mrt.frag22
-rw-r--r--tests/manual/rhi/mrt/mrt.frag.qsbbin0 -> 1934 bytes
-rw-r--r--tests/manual/rhi/mrt/mrt.pro8
-rw-r--r--tests/manual/rhi/mrt/mrt.qrc8
-rw-r--r--tests/manual/rhi/mrt/mrt.vert19
-rw-r--r--tests/manual/rhi/mrt/mrt.vert.qsbbin0 -> 1633 bytes
-rw-r--r--tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp259
-rw-r--r--tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.pro8
-rw-r--r--tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.qrc8
-rw-r--r--tests/manual/rhi/msaatexture/msaatexture.cpp329
-rw-r--r--tests/manual/rhi/msaatexture/msaatexture.pro8
-rw-r--r--tests/manual/rhi/msaatexture/msaatexture.qrc9
-rw-r--r--tests/manual/rhi/multiwindow/multiwindow.cpp640
-rw-r--r--tests/manual/rhi/multiwindow/multiwindow.pro8
-rw-r--r--tests/manual/rhi/multiwindow/multiwindow.qrc6
-rw-r--r--tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp831
-rw-r--r--tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.pro12
-rw-r--r--tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.qrc7
-rw-r--r--tests/manual/rhi/multiwindow_threaded/window.cpp142
-rw-r--r--tests/manual/rhi/multiwindow_threaded/window.h86
-rw-r--r--tests/manual/rhi/offscreen/offscreen.cpp366
-rw-r--r--tests/manual/rhi/offscreen/offscreen.pro9
-rw-r--r--tests/manual/rhi/offscreen/offscreen.qrc6
-rw-r--r--tests/manual/rhi/qrhiprof/qrhiprof.cpp671
-rw-r--r--tests/manual/rhi/qrhiprof/qrhiprof.pro6
-rw-r--r--tests/manual/rhi/rhi.pro26
-rw-r--r--tests/manual/rhi/shadowmap/buildshaders.bat4
-rwxr-xr-xtests/manual/rhi/shadowmap/buildshaders.sh5
-rw-r--r--tests/manual/rhi/shadowmap/main.frag30
-rw-r--r--tests/manual/rhi/shadowmap/main.frag.qsbbin0 -> 2489 bytes
-rw-r--r--tests/manual/rhi/shadowmap/main.vert20
-rw-r--r--tests/manual/rhi/shadowmap/main.vert.qsbbin0 -> 1595 bytes
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.cpp304
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.frag5
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.frag.qsbbin0 -> 408 bytes
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.pro8
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.qrc8
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.vert14
-rw-r--r--tests/manual/rhi/shadowmap/shadowmap.vert.qsbbin0 -> 1215 bytes
-rw-r--r--tests/manual/rhi/shared/OpenfootageNET_fieldairport-512.hdrbin0 -> 385303 bytes
-rw-r--r--tests/manual/rhi/shared/buildshaders.bat5
-rw-r--r--tests/manual/rhi/shared/bwqt224_64.pngbin0 -> 6339 bytes
-rw-r--r--tests/manual/rhi/shared/bwqt224_64_nomips.ddsbin0 -> 9712 bytes
-rw-r--r--tests/manual/rhi/shared/color.frag15
-rw-r--r--tests/manual/rhi/shared/color.frag.qsbbin0 -> 1483 bytes
-rw-r--r--tests/manual/rhi/shared/color.vert19
-rw-r--r--tests/manual/rhi/shared/color.vert.qsbbin0 -> 1648 bytes
-rw-r--r--tests/manual/rhi/shared/cube.h119
-rw-r--r--tests/manual/rhi/shared/dds_bc1.h137
-rw-r--r--tests/manual/rhi/shared/examplefw.h583
-rw-r--r--tests/manual/rhi/shared/qt256.pngbin0 -> 6208 bytes
-rw-r--r--tests/manual/rhi/shared/qt256_bc1_9mips.ddsbin0 -> 43832 bytes
-rw-r--r--tests/manual/rhi/shared/texture.frag18
-rw-r--r--tests/manual/rhi/shared/texture.frag.qsbbin0 -> 1710 bytes
-rw-r--r--tests/manual/rhi/shared/texture.vert21
-rw-r--r--tests/manual/rhi/shared/texture.vert.qsbbin0 -> 1897 bytes
-rw-r--r--tests/manual/rhi/shared/texture_ms4.frag20
-rw-r--r--tests/manual/rhi/shared/texture_ms4.frag.qsbbin0 -> 1847 bytes
-rw-r--r--tests/manual/rhi/texuploads/texuploads.cpp313
-rw-r--r--tests/manual/rhi/texuploads/texuploads.pro8
-rw-r--r--tests/manual/rhi/texuploads/texuploads.qrc7
-rw-r--r--tests/manual/rhi/triquadcube/quadrenderer.cpp148
-rw-r--r--tests/manual/rhi/triquadcube/quadrenderer.h87
-rw-r--r--tests/manual/rhi/triquadcube/texturedcuberenderer.cpp224
-rw-r--r--tests/manual/rhi/triquadcube/texturedcuberenderer.h86
-rw-r--r--tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp292
-rw-r--r--tests/manual/rhi/triquadcube/triangleoncuberenderer.h95
-rw-r--r--tests/manual/rhi/triquadcube/trianglerenderer.cpp202
-rw-r--r--tests/manual/rhi/triquadcube/trianglerenderer.h93
-rw-r--r--tests/manual/rhi/triquadcube/triquadcube.cpp281
-rw-r--r--tests/manual/rhi/triquadcube/triquadcube.pro18
-rw-r--r--tests/manual/rhi/triquadcube/triquadcube.qrc9
-rw-r--r--tests/manual/socketengine/main.cpp2
-rw-r--r--tests/manual/textrendering/glyphshaping/main.cpp2
-rw-r--r--tests/manual/wasm/localfiles/localfiles.pro8
-rw-r--r--tests/manual/wasm/localfiles/main.cpp100
-rw-r--r--tests/shared/filesystem.h2
-rwxr-xr-xtests/testserver/apache2/apache2.sh3
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol-expire.cgi7
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol.cgi13
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol200.cgi9
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag200.cgi5
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag304.cgi11
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires200.cgi5
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires304.cgi11
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified200.cgi5
-rwxr-xr-xtests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified304.cgi11
-rw-r--r--tests/testserver/apache2/testdata/www/htdocs/rfcs/.gitattributes1
-rw-r--r--tests/testserver/apache2/testdata/www/htdocs/rfcs/rfc2616.html8380
-rwxr-xr-xtests/testserver/common/startup.sh17
-rwxr-xr-xtests/testserver/cyrus/cyrus.sh40
-rw-r--r--tests/testserver/docker-compose-bridge-network.yml157
-rw-r--r--tests/testserver/docker-compose-for-macOS.yml100
-rw-r--r--tests/testserver/docker-compose-for-windows.yml100
-rw-r--r--tests/testserver/docker-compose-host-network.yml102
-rw-r--r--tests/testserver/docker-compose.yml83
-rwxr-xr-xtests/testserver/echo/echo.sh7
-rwxr-xr-xtests/testserver/ftp-proxy/ftp-proxy.sh4
-rwxr-xr-xtests/testserver/iptables/iptables.sh34
-rw-r--r--tests/testserver/vsftpd/testdata/vsftpd.conf4
-rwxr-xr-xtests/testserver/vsftpd/vsftpd.sh4
-rw-r--r--util/corelib/qurl-generateTLDs/main.cpp163
-rw-r--r--util/glgen/codegenerator.cpp2
-rw-r--r--util/glgen/legacyspecparser.cpp2
-rw-r--r--util/lexgen/generator.cpp6
-rw-r--r--util/lexgen/nfa.cpp2
-rw-r--r--util/local_database/README1
-rwxr-xr-xutil/local_database/cldr2qtimezone.py431
-rw-r--r--util/locale_database/README5
-rwxr-xr-xutil/locale_database/cldr2qlocalexml.py (renamed from util/local_database/cldr2qlocalexml.py)56
-rwxr-xr-xutil/locale_database/cldr2qtimezone.py459
-rwxr-xr-xutil/locale_database/dateconverter.py (renamed from util/local_database/dateconverter.py)0
-rw-r--r--util/locale_database/enumdata.py (renamed from util/local_database/enumdata.py)7
-rw-r--r--util/locale_database/formattags.txt (renamed from util/local_database/formattags.txt)0
-rw-r--r--util/locale_database/localexml.py (renamed from util/local_database/localexml.py)104
-rwxr-xr-xutil/locale_database/qlocalexml2cpp.py (renamed from util/local_database/qlocalexml2cpp.py)142
-rw-r--r--util/locale_database/testlocales/localemodel.cpp (renamed from util/local_database/testlocales/localemodel.cpp)0
-rw-r--r--util/locale_database/testlocales/localemodel.h (renamed from util/local_database/testlocales/localemodel.h)0
-rw-r--r--util/locale_database/testlocales/localewidget.cpp (renamed from util/local_database/testlocales/localewidget.cpp)0
-rw-r--r--util/locale_database/testlocales/localewidget.h (renamed from util/local_database/testlocales/localewidget.h)0
-rw-r--r--util/locale_database/testlocales/main.cpp (renamed from util/local_database/testlocales/main.cpp)0
-rw-r--r--util/locale_database/testlocales/testlocales.pro (renamed from util/local_database/testlocales/testlocales.pro)0
-rw-r--r--util/locale_database/xpathlite.py (renamed from util/local_database/xpathlite.py)28
-rw-r--r--util/qfloat16-tables/gen_qfloat16_tables.cpp (renamed from src/tools/qfloat16-tables/gen_qfloat16_tables.cpp)110
-rw-r--r--util/qfloat16-tables/qfloat16-tables.pro2
-rw-r--r--util/unicode/README6
-rw-r--r--util/unicode/codecs/big5/main.cpp4
-rw-r--r--util/unicode/main.cpp146
3124 files changed, 190887 insertions, 73343 deletions
diff --git a/.gitignore b/.gitignore
index b9188d84f7..e4079c6b4d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,8 +56,6 @@ qt*-config.pri
/src/angle/src/QtANGLE/libANGLE/
/src/angle/src/libGLESv2/libANGLE/
-/src/corelib/global/qfloat16tables.cpp
-
/examples/*/*/*
!/examples/*/*/*[.]*
!/examples/*/*/README
diff --git a/.qmake.conf b/.qmake.conf
index c3e87640c3..5c64c10981 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,7 +1,9 @@
load(qt_build_config)
CONFIG += warning_clean
+DEFINES += QT_NO_JAVA_STYLE_ITERATORS
+
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
-MODULE_VERSION = 5.13.2
+MODULE_VERSION = 5.14.0
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 11ae5845eb..72996a526e 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -79,9 +79,6 @@ normalizePath(\$out_basedir);
our $build_basedir;
our $basedir;
-# Make sure we use Windows line endings for chomp and friends on Windows.
-$INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys");
-
# will be defined based on the modules sync.profile
our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %deprecatedheaders);
our (@qpa_headers, @private_headers);
@@ -182,10 +179,10 @@ sub shouldMasterInclude {
my ($iheader) = @_;
return 0 if (basename($iheader) =~ /_/);
return 0 if (basename($iheader) =~ /qconfig/);
+ local $/ = "\x0a";
if (open(F, "<$iheader")) {
while (<F>) {
- chomp;
- chop if /\r$/;
+ s/\x0d?\x0a//;
return 0 if (/^\#pragma qt_no_master_include$/);
}
close(F);
@@ -216,11 +213,11 @@ sub classNames {
my $ihdrbase = basename($iheader);
my $parsable = "";
+ local $/ = "\x0a";
if(open(F, "<$iheader")) {
while(<F>) {
+ s/\x0d?\x0a//;
my $line = $_;
- chomp $line;
- chop $line if ($line =~ /\r$/);
if($line =~ /^\#/) {
$$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
@@ -234,6 +231,7 @@ sub classNames {
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro
+ $line .= ";" if($line =~ m/^QT_DEPRECATED_X\(.*\)[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro
$line .= ";" if($line =~ m/^QT_WARNING_(PUSH|POP|DISABLE_\w+\(.*\))[\r\n]*$/); # qt macros
$$requires = $1 if ($line =~ m/^QT_REQUIRE_CONFIG\((.*)\);[\r\n]*$/);
@@ -339,6 +337,7 @@ sub check_header {
$header_skip_qt_begin_namespace_test = 1 if ($ignore_for_qt_begin_namespace_check{$header});
}
+ local $/ = "\x0a";
open(F, "<$iheader") or return;
my $qt_begin_namespace_found = 0;
my $qt_end_namespace_found = 0;
@@ -347,7 +346,7 @@ sub check_header {
my $stop_processing = 0;
my $we_mean_it = 0;
while ($line = <F>) {
- chomp $line;
+ $line =~ s/\x0d?\x0a//;
my $output_line = 1;
if ($line =~ /^ *\# *pragma (qt_no_included_check|qt_sync_stop_processing)/) {
$stop_processing = 1;
@@ -968,9 +967,10 @@ foreach my $lib (@modules_to_sync) {
#push @files, "$out_basedir/include/Qt/$t" if(-e "$out_basedir/include/Qt/$t");
foreach my $file (@files) {
my $remove_file = 0;
+ local $/ = "\x0a";
if(open(F, "<$file")) {
while(my $line = <F>) {
- chomp $line;
+ $line =~ s/\x0d?\x0a//;
if($line =~ /^\#include \"([^\"]*)\"$/) {
my $include = $1;
$include = $subdir . "/" . $include unless(substr($include, 0, 1) eq "/");
diff --git a/config.tests/arch/write_info.pri b/config.tests/arch/write_info.pri
index 79f980c873..5b43ce1cd5 100644
--- a/config.tests/arch/write_info.pri
+++ b/config.tests/arch/write_info.pri
@@ -3,14 +3,8 @@ targetinfofile ~= s/pro$/target.txt/
win32 {
ext = .exe
-} else:android {
- file_prefix = lib
- ext = .so
} else:wasm {
- equals(WASM_OBJECT_FILES, 1): \
- ext = .o
- else: \
- ext = .wasm
+ ext = .wasm
}
content = $${file_prefix}$${TARGET}$${ext}
diff --git a/config_help.txt b/config_help.txt
index 3a82d83bc0..94471d27cf 100644
--- a/config_help.txt
+++ b/config_help.txt
@@ -122,6 +122,7 @@ Build options:
-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
-qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
+ -qtlibinfix-plugins .. Rename Qt plugins according to -qtlibinfix [no]
-testcocoon .......... Instrument with the TestCocoon code coverage tool [no]
-gcov ................ Instrument with the GCov code coverage tool [no]
@@ -202,9 +203,8 @@ Build environment:
-android-ndk-platform Set Android platform
-android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
[$ANDROID_NDK_HOST]
- -android-arch ........ Set Android architecture (armeabi, armeabi-v7a,
- arm64-v8a, x86, x86_64)
- -android-toolchain-version ... Set Android toolchain version
+ -android-abis ....... Comma separated Android abis, default is:
+ armeabi-v7a,arm64-v8a,x86,x86_64
-android-style-assets Automatically extract style assets from the device at
run time. This option makes the Android style behave
correctly, but also makes the Android platform plugin
@@ -241,7 +241,7 @@ Core options:
-inotify ............. Enable inotify support
-iconv ............... Enable iconv(3) support [posix/sun/gnu/no] (Unix only)
-icu ................. Enable ICU support [auto]
- -pcre ................ Select used libpcre2 [system/qt]
+ -pcre ................ Select used libpcre2 [system/qt/no]
-pps ................. Enable PPS support [auto] (QNX only)
-zlib ................ Select used zlib [system/qt]
@@ -297,7 +297,6 @@ Gui, printing, widget options:
-gbm ............... Enable backends for GBM [auto] (Linux only)
-kms ............... Enable backends for KMS [auto] (Linux only)
-linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only)
- -mirclient ......... Enable Mir client support [no] (Linux only)
-xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no]
(-qt-xcb still uses system version of libxcb itself)
diff --git a/configure b/configure
index ef7bad1bfc..19016d5c12 100755
--- a/configure
+++ b/configure
@@ -358,7 +358,7 @@ if [ -z "$QT_MAJOR_VERSION" ]; then
fi
#-------------------------------------------------------------------------------
-# initalize variables
+# initialize variables
#-------------------------------------------------------------------------------
# QTDIR may be set and point to an old or system-wide Qt installation
diff --git a/configure.json b/configure.json
index af55bb6fd2..159fdf12fa 100644
--- a/configure.json
+++ b/configure.json
@@ -51,11 +51,11 @@
"translationdir": "string",
"android-arch": "string",
+ "android-abis": "string",
"android-ndk": "string",
"android-ndk-host": "string",
"android-ndk-platform": "string",
"android-sdk": "string",
- "android-toolchain-version": "string",
"android-style-assets": "boolean",
"appstore-compliant": "boolean",
@@ -110,6 +110,7 @@
"profile": "boolean",
"qreal": "string",
"qtlibinfix": { "type": "string", "name": "qt_libinfix" },
+ "qtlibinfix-plugins": { "type": "boolean", "name": "qt_libinfix_plugins" },
"qtnamespace": { "type": "string", "name": "qt_namespace" },
"reduce-exports": { "type": "boolean", "name": "reduce_exports" },
"reduce-relocations": { "type": "boolean", "name": "reduce_relocations" },
@@ -221,6 +222,21 @@
{ "type": "pkgConfig", "args": "libudev" },
"-ludev"
]
+ },
+ "libdl": {
+ "label": "dlopen()",
+ "test": {
+ "main": [
+ "dlclose(dlopen(0, 0));",
+ "dlsym(RTLD_DEFAULT, 0);",
+ "dlerror();"
+ ]
+ },
+ "headers": "dlfcn.h",
+ "sources": [
+ "",
+ "-ldl"
+ ]
}
},
@@ -468,6 +484,17 @@
]
}
},
+ "signaling_nan": {
+ "label": "Signaling NaN for doubles",
+ "type": "compile",
+ "test": {
+ "head": [ "#include <limits>" ],
+ "main": [
+ "using B = std::numeric_limits<double>;",
+ "static_assert(B::has_signaling_NaN, \"System lacks signaling NaN\");"
+ ]
+ }
+ },
"sse2": {
"label": "SSE2 instructions",
"type": "x86Simd"
@@ -640,7 +667,7 @@
"shared": {
"label": "Building shared libraries",
"autoDetect": "!config.uikit",
- "condition": "!config.integrity && !config.wasm",
+ "condition": "!config.integrity && !config.wasm && !config.rtems",
"output": [
"shared",
"publicFeature",
@@ -693,7 +720,7 @@
"autoDetect": "false",
"enable" : "input.linker == 'gold' || features.use_gold_linker_alias" ,
"disable" : "input.linker == 'bfd' || input.linker == 'lld'",
- "condition": "!config.win32 && !config.integrity && !config.wasm && tests.use_gold_linker",
+ "condition": "!config.win32 && !config.integrity && !config.wasm && !config.rtems && tests.use_gold_linker",
"output": [ "privateConfig", "useGoldLinker" ]
},
"use_lld_linker": {
@@ -750,7 +777,7 @@
"debug_and_release": {
"label": "Compile libs in debug and release mode",
"autoDetect": "input.debug == ''",
- "condition": "config.darwin || config.win32",
+ "condition": "config.darwin || (config.win32 && !config.gcc)",
"output": [ "publicFeature", "publicQtConfig", "debugAndRelease" ]
},
"force_debug_info": {
@@ -791,6 +818,7 @@
"rpath": {
"label": "Build with RPATH",
"autoDetect": "var.QMAKE_LFLAGS_RPATH != '' && features.shared",
+ "condition": "!config.android",
"output": [ "publicFeature", "publicQtConfig" ]
},
"rpath_dir": {
@@ -827,7 +855,7 @@
},
"largefile": {
"label": "Large file support",
- "condition": "!config.android && !config.integrity && !config.winrt",
+ "condition": "!config.android && !config.integrity && !config.winrt && !config.rtems",
"output": [
"privateConfig",
{ "type": "define", "name": "QT_LARGEFILE_SUPPORT", "value": 64 }
@@ -989,6 +1017,11 @@
{ "type": "define", "name": "QT_REDUCE_RELOCATIONS" }
]
},
+ "signaling_nan": {
+ "label": "Signaling NaN",
+ "condition": "tests.signaling_nan",
+ "output": [ "publicFeature" ]
+ },
"sse2": {
"label": "SSE2",
"condition": "(arch.i386 || arch.x86_64) && tests.sse2",
@@ -1304,6 +1337,12 @@
"condition": "libs.libudev",
"output": [ "privateFeature" ]
},
+ "qt_libinfix_plugins": {
+ "label": "Use QT_LIBINFIX for Plugins",
+ "autoDetect": false,
+ "enable": "input.qt_libinfix != '' && input.qt_libinfix_plugins == 'yes'",
+ "output": [ "privateConfig" ]
+ },
"compile_examples": {
"label": "Compile examples",
"autoDetect": "!config.wasm",
@@ -1333,6 +1372,17 @@
"autoDetect": false,
"condition": "!features.shared",
"output": [ "publicConfig", "publicQtConfig" ]
+ },
+ "dlopen": {
+ "label": "dlopen()",
+ "condition": "config.unix && libs.libdl",
+ "output": [ "privateFeature" ]
+ },
+ "relocatable": {
+ "label": "Relocatable",
+ "autoDetect": "features.shared",
+ "condition": "features.dlopen || config.win32 || !features.shared",
+ "output": [ "privateFeature" ]
}
},
@@ -1459,6 +1509,7 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
"args": "enable_gdb_index",
"condition": "config.gcc && !config.clang && (features.debug || features.force_debug_info || features.debug_and_release)"
},
+ "relocatable",
"precompile_header",
"ltcg",
{
diff --git a/configure.pri b/configure.pri
index 16e2fccd77..97b9f3bf63 100644
--- a/configure.pri
+++ b/configure.pri
@@ -573,14 +573,7 @@ defineTest(qtConfOutput_prepareOptions) {
qtConfFatalError("Cannot find Android NDK." \
"Please use -android-ndk option to specify one.")
- ndk_tc_ver = $$eval(config.input.android-toolchain-version)
- isEmpty(ndk_tc_ver): \
- ndk_tc_ver = 4.9
- !exists($$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt/*): \
- qtConfFatalError("Cannot detect Android NDK toolchain." \
- "Please use -android-toolchain-version to specify it.")
-
- ndk_tc_pfx = $$ndk_root/toolchains/arm-linux-androideabi-$$ndk_tc_ver/prebuilt
+ ndk_tc_pfx = $$ndk_root/toolchains/llvm/prebuilt
ndk_host = $$eval(config.input.android-ndk-host)
isEmpty(ndk_host): \
ndk_host = $$getenv(ANDROID_NDK_HOST)
@@ -618,10 +611,11 @@ defineTest(qtConfOutput_prepareOptions) {
qtConfFatalError("Specified Android NDK host is invalid.")
}
- target_arch = $$eval(config.input.android-arch)
- isEmpty(target_arch): \
- target_arch = armeabi-v7a
-
+ android_abis = $$eval(config.input.android-abis)
+ isEmpty(android_abis): \
+ android_abis = $$eval(config.input.android-arch)
+ isEmpty(android_abis): \
+ android_abis = armeabi-v7a,arm64-v8a,x86,x86_64
platform = $$eval(config.input.android-ndk-platform)
isEmpty(platform): \
platform = android-21
@@ -631,8 +625,7 @@ defineTest(qtConfOutput_prepareOptions) {
"DEFAULT_ANDROID_NDK_ROOT = $$val_escape(ndk_root)" \
"DEFAULT_ANDROID_PLATFORM = $$platform" \
"DEFAULT_ANDROID_NDK_HOST = $$ndk_host" \
- "DEFAULT_ANDROID_TARGET_ARCH = $$target_arch" \
- "DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION = $$ndk_tc_ver"
+ "DEFAULT_ANDROID_ABIS = $$split(android_abis, ',')"
}
export($${currentConfig}.output.devicePro)
@@ -776,6 +769,11 @@ defineTest(qtConfOutput_preparePaths) {
have_hostprefix = true
}
+ equals(config.input.prefix, $$config.input.extprefix): \
+ qmake_crossbuild = false
+ else: \
+ qmake_crossbuild = true
+
PREFIX_COMPLAINTS =
PREFIX_REMINDER = false
win32: \
@@ -815,6 +813,18 @@ defineTest(qtConfOutput_preparePaths) {
processQtPath(host, hostdatadir, $$config.rel_input.archdatadir)
}
+ win32:$$qtConfEvaluate("features.shared") {
+ # Windows DLLs are in the bin dir.
+ libloc_absolute_path = $$absolute_path($$config.rel_input.bindir, $$config.input.prefix)
+ } else {
+ libloc_absolute_path = $$absolute_path($$config.rel_input.libdir, $$config.input.prefix)
+ }
+ config.input.liblocation_to_prefix = $$relative_path($$config.input.prefix, $$libloc_absolute_path)
+
+ hostbindir_absolute_path = $$absolute_path($$config.rel_input.hostbindir, $$config.input.hostprefix)
+ config.input.hostbindir_to_hostprefix = $$relative_path($$config.input.hostprefix, $$hostbindir_absolute_path)
+ config.input.hostbindir_to_extprefix = $$relative_path($$config.input.extprefix, $$hostbindir_absolute_path)
+
!isEmpty(PREFIX_COMPLAINTS) {
PREFIX_COMPLAINTS = "$$join(PREFIX_COMPLAINTS, "$$escape_expand(\\n)Note: ")"
$$PREFIX_REMINDER: \
@@ -877,9 +887,13 @@ defineTest(qtConfOutput_preparePaths) {
";" \
"" \
"$${LITERAL_HASH}define QT_CONFIGURE_SETTINGS_PATH \"$$config.rel_input.sysconfdir\"" \
+ "$${LITERAL_HASH}define QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH \"$$config.input.liblocation_to_prefix\"" \
+ "$${LITERAL_HASH}define QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH \"$$config.input.hostbindir_to_extprefix\"" \
+ "$${LITERAL_HASH}define QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH \"$$config.input.hostbindir_to_hostprefix\"" \
"" \
"$${LITERAL_HASH}ifdef QT_BUILD_QMAKE" \
"$${LITERAL_HASH} define QT_CONFIGURE_SYSROOTIFY_PREFIX $$qmake_sysrootify" \
+ "$${LITERAL_HASH} define QT_CONFIGURE_CROSSBUILD $$qmake_crossbuild" \
"$${LITERAL_HASH}endif" \
"" \
"$${LITERAL_HASH}define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12" \
diff --git a/doc/global/config.qdocconf b/doc/global/config.qdocconf
index 0b276c400f..16d4e5c63a 100644
--- a/doc/global/config.qdocconf
+++ b/doc/global/config.qdocconf
@@ -11,6 +11,12 @@ dita.metadata.default.audience = programmer
navigation.homepage = index.html
navigation.hometitle = "Qt $QT_VER"
+#Words to ignore for auto-linking
+ignorewords += \
+ macOS \
+ WebChannel \
+ OpenGL
+
sourcedirs += includes $$BUILDDIR
url = http://doc.qt.io/qt-5
diff --git a/doc/global/qt-cpp-defines.qdocconf b/doc/global/qt-cpp-defines.qdocconf
index a486470187..4cf895b05e 100644
--- a/doc/global/qt-cpp-defines.qdocconf
+++ b/doc/global/qt-cpp-defines.qdocconf
@@ -118,6 +118,7 @@ Cpp.ignoretokens += \
Q_POSITIONING_EXPORT \
Q_MULTIMEDIA_EXPORT \
Q_NAMESPACE \
+ Q_NAMESPACE_EXPORT \
Q_NETWORK_EXPORT \
Q_NEVER_INLINE \
Q_NORETURN \
diff --git a/doc/src/images/macmainwindow.png b/doc/src/images/macmainwindow.png
deleted file mode 100644
index 84eb11ca5e..0000000000
--- a/doc/src/images/macmainwindow.png
+++ /dev/null
Binary files differ
diff --git a/examples/corelib/mimetypes/mimetypebrowser/main.cpp b/examples/corelib/mimetypes/mimetypebrowser/main.cpp
index cf87004a01..679d97dc7b 100644
--- a/examples/corelib/mimetypes/mimetypebrowser/main.cpp
+++ b/examples/corelib/mimetypes/mimetypebrowser/main.cpp
@@ -51,7 +51,7 @@
#include "mainwindow.h"
#include <QApplication>
-#include <QDesktopWidget>
+#include <QScreen>
#include <QCommandLineParser>
#include <QCommandLineOption>
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
parser.process(app);
MainWindow mainWindow;
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mainWindow);
+ const QRect availableGeometry = mainWindow.screen()->availableGeometry();
mainWindow.resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
mainWindow.show();
diff --git a/examples/corelib/serialization/convert/cborconverter.cpp b/examples/corelib/serialization/convert/cborconverter.cpp
index ad69983eb1..f907bb0af6 100644
--- a/examples/corelib/serialization/convert/cborconverter.cpp
+++ b/examples/corelib/serialization/convert/cborconverter.cpp
@@ -226,7 +226,7 @@ void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents, cons
QTextStream out(f);
out << convertFromVariant(contents, Double).toDiagnosticNotation(opts)
- << endl;
+ << Qt::endl;
}
CborConverter::CborConverter()
diff --git a/examples/corelib/serialization/convert/textconverter.cpp b/examples/corelib/serialization/convert/textconverter.cpp
index e80e69a0b5..7aed08f96c 100644
--- a/examples/corelib/serialization/convert/textconverter.cpp
+++ b/examples/corelib/serialization/convert/textconverter.cpp
@@ -66,7 +66,7 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
case QVariant::String: {
const QStringList list = v.toStringList();
for (const QString &s : list)
- out << s << endl;
+ out << s << Qt::endl;
break;
}
@@ -80,11 +80,11 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
}
case QMetaType::Nullptr:
- out << "(null)" << endl;
+ out << "(null)" << Qt::endl;
break;
default:
- out << v.toString() << endl;
+ out << v.toString() << Qt::endl;
break;
}
}
diff --git a/examples/corelib/threads/doc/src/mandelbrot.qdoc b/examples/corelib/threads/doc/src/mandelbrot.qdoc
index 274874632e..9e3fdc1dfe 100644
--- a/examples/corelib/threads/doc/src/mandelbrot.qdoc
+++ b/examples/corelib/threads/doc/src/mandelbrot.qdoc
@@ -304,8 +304,8 @@
\snippet threads/mandelbrot/mandelbrotwidget.cpp 12
The wheel event handler is reimplemented to make the mouse wheel
- control the zoom level. QWheelEvent::delta() returns the angle of
- the wheel mouse movement, in eights of a degree. For most mice,
+ control the zoom level. QWheelEvent::angleDelta() returns the angle
+ of the wheel mouse movement, in eighths of a degree. For most mice,
one wheel step corresponds to 15 degrees. We find out how many
mouse steps we have and determine the resulting zoom factor.
For example, if we have two wheel steps in the positive direction
diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
index 71d0abb09f..822791533b 100644
--- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
+++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp
@@ -176,7 +176,7 @@ void MandelbrotWidget::keyPressEvent(QKeyEvent *event)
//! [12]
void MandelbrotWidget::wheelEvent(QWheelEvent *event)
{
- int numDegrees = event->delta() / 8;
+ int numDegrees = event->angleDelta().y() / 8;
double numSteps = numDegrees / 15.0f;
zoom(pow(ZoomInFactor, numSteps));
}
diff --git a/examples/corelib/tools/customtype/message.cpp b/examples/corelib/tools/customtype/message.cpp
index cc96aee978..e83697cb74 100644
--- a/examples/corelib/tools/customtype/message.cpp
+++ b/examples/corelib/tools/customtype/message.cpp
@@ -52,21 +52,6 @@
#include <QDebug>
-//! [Message class implementation]
-Message::Message()
-{
-}
-
-Message::Message(const Message &other)
- : m_body(other.m_body), m_headers(other.m_headers)
-{
-}
-
-Message::~Message()
-{
-}
-//! [Message class implementation]
-
Message::Message(const QString &body, const QStringList &headers)
: m_body(body), m_headers(headers)
{
diff --git a/examples/corelib/tools/customtype/message.h b/examples/corelib/tools/customtype/message.h
index c1b8243237..bc30c45425 100644
--- a/examples/corelib/tools/customtype/message.h
+++ b/examples/corelib/tools/customtype/message.h
@@ -58,9 +58,10 @@
class Message
{
public:
- Message();
- Message(const Message &other);
- ~Message();
+ Message() = default;
+ ~Message() = default;
+ Message(const Message &) = default;
+ Message &operator=(const Message &) = default;
Message(const QString &body, const QStringList &headers);
diff --git a/examples/corelib/tools/customtypesending/message.cpp b/examples/corelib/tools/customtypesending/message.cpp
index 9386b93898..76f90e5144 100644
--- a/examples/corelib/tools/customtypesending/message.cpp
+++ b/examples/corelib/tools/customtypesending/message.cpp
@@ -50,19 +50,6 @@
#include "message.h"
-Message::Message()
-{
-}
-
-Message::Message(const Message &other)
- : m_body(other.m_body), m_headers(other.m_headers)
-{
-}
-
-Message::~Message()
-{
-}
-
Message::Message(const QString &body, const QStringList &headers)
: m_body(body), m_headers(headers)
{
diff --git a/examples/corelib/tools/customtypesending/message.h b/examples/corelib/tools/customtypesending/message.h
index a93f111e45..38b5c8205f 100644
--- a/examples/corelib/tools/customtypesending/message.h
+++ b/examples/corelib/tools/customtypesending/message.h
@@ -58,9 +58,10 @@
class Message
{
public:
- Message();
- Message(const Message &other);
- ~Message();
+ Message() = default;
+ ~Message() = default;
+ Message(const Message &) = default;
+ Message &operator=(const Message &) = default;
Message(const QString &body, const QStringList &headers);
diff --git a/examples/corelib/tools/doc/src/customtype.qdoc b/examples/corelib/tools/doc/src/customtype.qdoc
index 91b814808a..fb63bc539c 100644
--- a/examples/corelib/tools/doc/src/customtype.qdoc
+++ b/examples/corelib/tools/doc/src/customtype.qdoc
@@ -81,11 +81,6 @@
\section1 The Message Class Implementation
- The implementation of the default constructor, copy constructor and destructor
- are straightforward for the \c Message class:
-
- \snippet tools/customtype/message.cpp Message class implementation
-
The streaming operator is implemented in the following way:
\snippet tools/customtype/message.cpp custom type streaming operator
@@ -117,8 +112,8 @@
\snippet tools/customtype/main.cpp storing a custom value
- Alternatively, the QVariant::fromValue() and qVariantSetValue() functions
- can be used if you are using a compiler without support for member template
+ Alternatively, the QVariant::fromValue() function can be used if
+ you are using a compiler without support for member template
functions.
The value can be retrieved using the QVariant::value() member template
@@ -126,9 +121,6 @@
\snippet tools/customtype/main.cpp retrieving a custom value
- Alternatively, the qVariantValue() template function can be used if
- you are using a compiler without support for member template functions.
-
\section1 Further Reading
The custom \c Message type can also be used with direct signal-slot
diff --git a/examples/embedded/raycasting/raycasting.cpp b/examples/embedded/raycasting/raycasting.cpp
index d37b9f5d2e..7213811213 100644
--- a/examples/embedded/raycasting/raycasting.cpp
+++ b/examples/embedded/raycasting/raycasting.cpp
@@ -255,11 +255,7 @@ public:
protected:
void resizeEvent(QResizeEvent*) {
-#if defined(Q_OS_WINCE_WM)
- touchDevice = true;
-#else
touchDevice = false;
-#endif
if (touchDevice) {
if (width() < height()) {
trackPad = QRect(0, height() / 2, width(), height() / 2);
diff --git a/examples/network/bearermonitor/bearermonitor.pro b/examples/network/bearermonitor/bearermonitor.pro
index 7d90b408e0..16ac41298a 100644
--- a/examples/network/bearermonitor/bearermonitor.pro
+++ b/examples/network/bearermonitor/bearermonitor.pro
@@ -13,7 +13,7 @@ FORMS = bearermonitor_240_320.ui \
bearermonitor_640_480.ui \
sessionwidget.ui
-win32:LIBS += -lws2_32
+win32: QMAKE_USE += ws2_32
CONFIG += console
diff --git a/examples/network/downloadmanager/downloadmanager.cpp b/examples/network/downloadmanager/downloadmanager.cpp
index e820b4ff70..9e0c03c6af 100644
--- a/examples/network/downloadmanager/downloadmanager.cpp
+++ b/examples/network/downloadmanager/downloadmanager.cpp
@@ -132,7 +132,7 @@ void DownloadManager::startNextDownload()
// prepare the output
printf("Downloading %s...\n", url.toEncoded().constData());
- downloadTime.start();
+ downloadTimer.start();
}
void DownloadManager::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
@@ -140,7 +140,7 @@ void DownloadManager::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
progressBar.setStatus(bytesReceived, bytesTotal);
// calculate the download speed
- double speed = bytesReceived * 1000.0 / downloadTime.elapsed();
+ double speed = bytesReceived * 1000.0 / downloadTimer.elapsed();
QString unit;
if (speed < 1024) {
unit = "bytes/sec";
diff --git a/examples/network/downloadmanager/downloadmanager.h b/examples/network/downloadmanager/downloadmanager.h
index 4bc6351ff9..818a774f1f 100644
--- a/examples/network/downloadmanager/downloadmanager.h
+++ b/examples/network/downloadmanager/downloadmanager.h
@@ -83,7 +83,7 @@ private:
QQueue<QUrl> downloadQueue;
QNetworkReply *currentDownload = nullptr;
QFile output;
- QTime downloadTime;
+ QElapsedTimer downloadTimer;
TextProgressBar progressBar;
int downloadedCount = 0;
diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp
index 39ffb3cc87..c7bf0c0dff 100644
--- a/examples/network/http/httpwindow.cpp
+++ b/examples/network/http/httpwindow.cpp
@@ -48,13 +48,14 @@
**
****************************************************************************/
+#include "httpwindow.h"
+
+#include "ui_authenticationdialog.h"
+
#include <QtWidgets>
#include <QtNetwork>
#include <QUrl>
-#include "httpwindow.h"
-#include "ui_authenticationdialog.h"
-
#if QT_CONFIG(ssl)
const char defaultUrl[] = "https://www.qt.io/";
#else
@@ -74,6 +75,10 @@ ProgressDialog::ProgressDialog(const QUrl &url, QWidget *parent)
setMinimumSize(QSize(400, 75));
}
+ProgressDialog::~ProgressDialog()
+{
+}
+
void ProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
{
setMaximum(totalBytes);
@@ -137,6 +142,10 @@ HttpWindow::HttpWindow(QWidget *parent)
urlLineEdit->setFocus();
}
+HttpWindow::~HttpWindow()
+{
+}
+
void HttpWindow::startRequest(const QUrl &requestedUrl)
{
url = requestedUrl;
@@ -204,9 +213,9 @@ void HttpWindow::downloadFile()
startRequest(newUrl);
}
-QFile *HttpWindow::openFileForWrite(const QString &fileName)
+std::unique_ptr<QFile> HttpWindow::openFileForWrite(const QString &fileName)
{
- QScopedPointer<QFile> file(new QFile(fileName));
+ std::unique_ptr<QFile> file(new QFile(fileName));
if (!file->open(QIODevice::WriteOnly)) {
QMessageBox::information(this, tr("Error"),
tr("Unable to save the file %1: %2.")
@@ -214,7 +223,7 @@ QFile *HttpWindow::openFileForWrite(const QString &fileName)
file->errorString()));
return nullptr;
}
- return file.take();
+ return file;
}
void HttpWindow::cancelDownload()
@@ -231,8 +240,7 @@ void HttpWindow::httpFinished()
if (file) {
fi.setFile(file->fileName());
file->close();
- delete file;
- file = nullptr;
+ file.reset();
}
if (httpRequestAborted) {
diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h
index 20ad2bb4da..f7bd0047de 100644
--- a/examples/network/http/httpwindow.h
+++ b/examples/network/http/httpwindow.h
@@ -55,6 +55,8 @@
#include <QNetworkAccessManager>
#include <QUrl>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QFile;
class QLabel;
@@ -72,6 +74,7 @@ class ProgressDialog : public QProgressDialog {
public:
explicit ProgressDialog(const QUrl &url, QWidget *parent = nullptr);
+ ~ProgressDialog();
public slots:
void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
@@ -83,6 +86,7 @@ class HttpWindow : public QDialog
public:
explicit HttpWindow(QWidget *parent = nullptr);
+ ~HttpWindow();
void startRequest(const QUrl &requestedUrl);
@@ -98,7 +102,7 @@ private slots:
#endif
private:
- QFile *openFileForWrite(const QString &fileName);
+ std::unique_ptr<QFile> openFileForWrite(const QString &fileName);
QLabel *statusLabel;
QLineEdit *urlLineEdit;
@@ -110,7 +114,7 @@ private:
QUrl url;
QNetworkAccessManager qnam;
QNetworkReply *reply;
- QFile *file;
+ std::unique_ptr<QFile> file;
bool httpRequestAborted;
};
diff --git a/examples/network/http/main.cpp b/examples/network/http/main.cpp
index b7d254ff22..f126c7846a 100644
--- a/examples/network/http/main.cpp
+++ b/examples/network/http/main.cpp
@@ -49,8 +49,8 @@
****************************************************************************/
#include <QApplication>
-#include <QDesktopWidget>
#include <QDir>
+#include <QScreen>
#include "httpwindow.h"
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
HttpWindow httpWin;
- const QRect availableSize = QApplication::desktop()->availableGeometry(&httpWin);
+ const QRect availableSize = httpWin.screen()->availableGeometry();
httpWin.resize(availableSize.width() / 5, availableSize.height() / 5);
httpWin.move((availableSize.width() - httpWin.width()) / 2, (availableSize.height() - httpWin.height()) / 2);
diff --git a/examples/network/secureudpserver/server.cpp b/examples/network/secureudpserver/server.cpp
index 0d83fa9b51..450eb9e68d 100644
--- a/examples/network/secureudpserver/server.cpp
+++ b/examples/network/secureudpserver/server.cpp
@@ -62,7 +62,7 @@ QString peer_info(const QHostAddress &address, quint16 port)
return info.arg(address.toString()).arg(port);
}
-QString connection_info(QSharedPointer<QDtls> connection)
+QString connection_info(QDtls *connection)
{
QString info(DtlsServer::tr("Session cipher: "));
info += connection->sessionCipher().name();
@@ -157,7 +157,7 @@ void DtlsServer::readyRead()
}
const auto client = std::find_if(knownClients.begin(), knownClients.end(),
- [&](const DtlsConnection &connection){
+ [&](const std::unique_ptr<QDtls> &connection){
return connection->peerAddress() == peerAddress
&& connection->peerPort() == peerPort;
});
@@ -170,7 +170,7 @@ void DtlsServer::readyRead()
//! [6]
if ((*client)->isConnectionEncrypted()) {
- decryptDatagram(*client, dgram);
+ decryptDatagram(client->get(), dgram);
if ((*client)->dtlsError() == QDtlsError::RemoteClosedConnectionError)
knownClients.erase(client);
return;
@@ -178,7 +178,7 @@ void DtlsServer::readyRead()
//! [6]
//! [7]
- doHandshake(*client, dgram);
+ doHandshake(client->get(), dgram);
//! [7]
}
@@ -205,13 +205,13 @@ void DtlsServer::handleNewConnection(const QHostAddress &peerAddress,
emit infoMessage(peerInfo + tr(": verified, starting a handshake"));
//! [8]
//! [9]
- DtlsConnection newConnection(new QDtls(QSslSocket::SslServerMode));
+ std::unique_ptr<QDtls> newConnection{new QDtls{QSslSocket::SslServerMode}};
newConnection->setDtlsConfiguration(serverConfiguration);
newConnection->setPeer(peerAddress, peerPort);
- newConnection->connect(newConnection.data(), &QDtls::pskRequired,
+ newConnection->connect(newConnection.get(), &QDtls::pskRequired,
this, &DtlsServer::pskRequired);
- knownClients.push_back(newConnection);
- doHandshake(newConnection, clientHello);
+ knownClients.push_back(std::move(newConnection));
+ doHandshake(knownClients.back().get(), clientHello);
//! [9]
} else if (cookieSender.dtlsError() != QDtlsError::NoError) {
emit errorMessage(tr("DTLS error: ") + cookieSender.dtlsErrorString());
@@ -221,7 +221,7 @@ void DtlsServer::handleNewConnection(const QHostAddress &peerAddress,
}
//! [11]
-void DtlsServer::doHandshake(DtlsConnection newConnection, const QByteArray &clientHello)
+void DtlsServer::doHandshake(QDtls *newConnection, const QByteArray &clientHello)
{
const bool result = newConnection->doHandshake(&serverSocket, clientHello);
if (!result) {
@@ -246,7 +246,7 @@ void DtlsServer::doHandshake(DtlsConnection newConnection, const QByteArray &cli
//! [11]
//! [12]
-void DtlsServer::decryptDatagram(DtlsConnection connection, const QByteArray &clientMessage)
+void DtlsServer::decryptDatagram(QDtls *connection, const QByteArray &clientMessage)
{
Q_ASSERT(connection->isConnectionEncrypted());
@@ -266,10 +266,9 @@ void DtlsServer::decryptDatagram(DtlsConnection connection, const QByteArray &cl
//! [14]
void DtlsServer::shutdown()
{
- for (DtlsConnection &connection : knownClients)
+ for (const auto &connection : qExchange(knownClients, {}))
connection->shutdown(&serverSocket);
- knownClients.clear();
serverSocket.close();
}
//! [14]
diff --git a/examples/network/secureudpserver/server.h b/examples/network/secureudpserver/server.h
index b720368e7b..1af8aef8a2 100644
--- a/examples/network/secureudpserver/server.h
+++ b/examples/network/secureudpserver/server.h
@@ -54,6 +54,7 @@
#include <QtNetwork>
#include <vector>
+#include <memory>
QT_BEGIN_NAMESPACE
@@ -86,9 +87,8 @@ private:
void handleNewConnection(const QHostAddress &peerAddress, quint16 peerPort,
const QByteArray &clientHello);
- using DtlsConnection = QSharedPointer<QDtls>;
- void doHandshake(DtlsConnection newConnection, const QByteArray &clientHello);
- void decryptDatagram(DtlsConnection connection, const QByteArray &clientMessage);
+ void doHandshake(QDtls *newConnection, const QByteArray &clientHello);
+ void decryptDatagram(QDtls *connection, const QByteArray &clientMessage);
void shutdown();
bool listening = false;
@@ -96,7 +96,7 @@ private:
QSslConfiguration serverConfiguration;
QDtlsClientVerifier cookieSender;
- QVector<DtlsConnection> knownClients;
+ std::vector<std::unique_ptr<QDtls>> knownClients;
Q_DISABLE_COPY(DtlsServer)
};
diff --git a/examples/network/torrent/ratecontroller.cpp b/examples/network/torrent/ratecontroller.cpp
index 47b49dba30..96474806f5 100644
--- a/examples/network/torrent/ratecontroller.cpp
+++ b/examples/network/torrent/ratecontroller.cpp
@@ -96,8 +96,8 @@ void RateController::transfer()
if (sockets.isEmpty())
return;
- int msecs = 1000;
- if (!stopWatch.isNull())
+ qint64 msecs = 1000;
+ if (stopWatch.isValid())
msecs = qMin(msecs, stopWatch.elapsed());
qint64 bytesToWrite = (upLimit * msecs) / 1000;
@@ -123,11 +123,11 @@ void RateController::transfer()
qint64 writeChunk = qMax<qint64>(1, bytesToWrite / pendingSockets.size());
qint64 readChunk = qMax<qint64>(1, bytesToRead / pendingSockets.size());
- QSetIterator<PeerWireClient *> it(pendingSockets);
- while (it.hasNext() && (bytesToWrite > 0 || bytesToRead > 0)) {
- PeerWireClient *socket = it.next();
+ for (auto it = pendingSockets.begin(), end = pendingSockets.end(); it != end && (bytesToWrite > 0 || bytesToRead > 0); /*erasing*/) {
+ auto current = it++;
+ PeerWireClient *socket = *current;
if (socket->state() != QAbstractSocket::ConnectedState) {
- pendingSockets.remove(socket);
+ pendingSockets.erase(current);
continue;
}
@@ -156,7 +156,7 @@ void RateController::transfer()
if (dataTransferred && socket->canTransferMore())
canTransferMore = true;
else
- pendingSockets.remove(socket);
+ pendingSockets.erase(current);
}
} while (canTransferMore && (bytesToWrite > 0 || bytesToRead > 0) && !pendingSockets.isEmpty());
diff --git a/examples/network/torrent/ratecontroller.h b/examples/network/torrent/ratecontroller.h
index a4aa596ce1..f8bff0cc36 100644
--- a/examples/network/torrent/ratecontroller.h
+++ b/examples/network/torrent/ratecontroller.h
@@ -53,7 +53,7 @@
#include <QObject>
#include <QSet>
-#include <QTime>
+#include <QElapsedTimer>
class PeerWireClient;
@@ -79,7 +79,7 @@ public slots:
void scheduleTransfer();
private:
- QTime stopWatch;
+ QElapsedTimer stopWatch;
QSet<PeerWireClient *> sockets;
int upLimit;
int downLimit;
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp
index d01a5f3d9e..bddf3caa1a 100644
--- a/examples/network/torrent/torrentclient.cpp
+++ b/examples/network/torrent/torrentclient.cpp
@@ -720,9 +720,9 @@ QList<TorrentPeer *> TorrentClient::weighedFreePeers() const
qint64 now = QDateTime::currentSecsSinceEpoch();
QList<TorrentPeer *> freePeers;
QMap<QString, int> connectionsPerPeer;
- for (TorrentPeer *peer : d->peers) {
+ for (TorrentPeer *peer : qAsConst(d->peers)) {
bool busy = false;
- for (PeerWireClient *client : d->connections) {
+ for (PeerWireClient *client : qAsConst(d->connections)) {
if (client->state() == PeerWireClient::ConnectedState
&& client->peerAddress() == peer->address
&& client->peerPort() == peer->port) {
@@ -874,8 +874,7 @@ void TorrentClient::removeClient()
// Remove the client from RateController and all structures.
RateController::instance()->removeSocket(client);
d->connections.removeAll(client);
- QMultiMap<PeerWireClient *, TorrentPiece *>::Iterator it = d->payloads.find(client);
- while (it != d->payloads.end() && it.key() == client) {
+ for (auto it = d->payloads.find(client); it != d->payloads.end() && it.key() == client; /*erasing*/) {
TorrentPiece *piece = it.value();
piece->inProgress = false;
piece->requestedBlocks.fill(false);
@@ -883,9 +882,12 @@ void TorrentClient::removeClient()
}
// Remove pending read requests.
- QMapIterator<int, PeerWireClient *> it2(d->readIds);
- while (it2.findNext(client))
- d->readIds.remove(it2.key());
+ for (auto it = d->readIds.begin(), end = d->readIds.end(); it != end; /*erasing*/) {
+ if (it.value() == client)
+ it = d->readIds.erase(it);
+ else
+ ++it;
+ }
// Delete the client later.
disconnect(client, SIGNAL(disconnected()), this, SLOT(removeClient()));
@@ -1084,25 +1086,25 @@ void TorrentClient::scheduleUploads()
// seeding, we sort by upload speed. Seeds are left out; there's
// no use in unchoking them.
QList<PeerWireClient *> allClients = d->connections;
- QMultiMap<int, PeerWireClient *> transferSpeeds;
+ QVector<QPair<qint64, PeerWireClient *>> transferSpeeds;
for (PeerWireClient *client : qAsConst(allClients)) {
if (client->state() == QAbstractSocket::ConnectedState
&& client->availablePieces().count(true) != d->pieceCount) {
if (d->state == Seeding) {
- transferSpeeds.insert(client->uploadSpeed(), client);
+ transferSpeeds.push_back({client->uploadSpeed(), client});
} else {
- transferSpeeds.insert(client->downloadSpeed(), client);
+ transferSpeeds.push_back({client->downloadSpeed(), client});
}
}
}
+ std::sort(transferSpeeds.begin(), transferSpeeds.end());
+
// Unchoke the top 'MaxUploads' downloaders (peers that we are
// uploading to) and choke all others.
int maxUploaders = MaxUploads;
- QMapIterator<int, PeerWireClient *> it(transferSpeeds);
- it.toBack();
- while (it.hasPrevious()) {
- PeerWireClient *client = it.previous().value();
+ for (auto rit = transferSpeeds.crbegin(), rend = transferSpeeds.crend(); rit != rend; ++rit) {
+ PeerWireClient *client = rit->second;
bool interested = (client->peerWireState() & PeerWireClient::PeerIsInterested);
if (maxUploaders) {
@@ -1484,30 +1486,26 @@ void TorrentClient::addToPeerList(const QList<TorrentPeer> &peerList)
// of the peers that have no (or low) activity.
int maxPeers = ConnectionManager::instance()->maxConnections() * 3;
if (d->peers.size() > maxPeers) {
+ auto tooMany = d->peers.size() - maxPeers;
+
// Find what peers are currently connected & active
- QSet<TorrentPeer *> activePeers;
- for (TorrentPeer *peer : qAsConst(d->peers)) {
+ const auto firstNInactivePeers = [&tooMany, this] (TorrentPeer *peer) {
+ if (!tooMany)
+ return false;
for (const PeerWireClient *client : qAsConst(d->connections)) {
if (client->peer() == peer && (client->downloadSpeed() + client->uploadSpeed()) > 1024)
- activePeers << peer;
+ return false;
}
- }
-
+ --tooMany;
+ return true;
+ };
// Remove inactive peers from the peer list until we're below
// the max connections count.
- QList<int> toRemove;
- for (int i = 0; i < d->peers.size() && (d->peers.size() - toRemove.size()) > maxPeers; ++i) {
- if (!activePeers.contains(d->peers.at(i)))
- toRemove << i;
- }
- QListIterator<int> toRemoveIterator(toRemove);
- toRemoveIterator.toBack();
- while (toRemoveIterator.hasPrevious())
- d->peers.removeAt(toRemoveIterator.previous());
-
+ d->peers.erase(std::remove_if(d->peers.begin(), d->peers.end(),
+ firstNInactivePeers),
+ d->peers.end());
// If we still have too many peers, remove the oldest ones.
- while (d->peers.size() > maxPeers)
- d->peers.takeFirst();
+ d->peers.erase(d->peers.begin(), d->peers.begin() + tooMany);
}
if (d->state != Paused && d->state != Stopping && d->state != Idle) {
diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp
index b1b7076503..0762c91662 100644
--- a/examples/opengl/contextinfo/widget.cpp
+++ b/examples/opengl/contextinfo/widget.cpp
@@ -384,7 +384,7 @@ void Widget::renderWindowReady()
m_output->append(tr("Qt OpenGL library handle: %1")
.arg(QString::number(qintptr(QOpenGLContext::openGLModuleHandle()), 16)));
- QList<QByteArray> extensionList = context->extensions().toList();
+ QList<QByteArray> extensionList = context->extensions().values();
std::sort(extensionList.begin(), extensionList.end());
m_extensions->append(tr("Found %1 extensions:").arg(extensionList.count()));
for (const QByteArray &ext : qAsConst(extensionList))
diff --git a/examples/opengl/legacy/hellogl/glwidget.cpp b/examples/opengl/legacy/hellogl/glwidget.cpp
index 22934136e5..059a9bb96d 100644
--- a/examples/opengl/legacy/hellogl/glwidget.cpp
+++ b/examples/opengl/legacy/hellogl/glwidget.cpp
@@ -140,10 +140,10 @@ void GLWidget::initializeGL()
{
initializeOpenGLFunctions();
- qglClearColor(qtPurple.dark());
+ qglClearColor(qtPurple.darker());
logo = new QtLogo(this, 64);
- logo->setColor(qtGreen.dark());
+ logo->setColor(qtGreen.darker());
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
diff --git a/examples/opengl/legacy/overpainting/glwidget.cpp b/examples/opengl/legacy/overpainting/glwidget.cpp
index f98d043c5c..c4558ce785 100644
--- a/examples/opengl/legacy/overpainting/glwidget.cpp
+++ b/examples/opengl/legacy/overpainting/glwidget.cpp
@@ -130,7 +130,7 @@ void GLWidget::initializeGL()
glEnable(GL_MULTISAMPLE);
logo = new QtLogo(this);
- logo->setColor(qtGreen.dark());
+ logo->setColor(qtGreen.darker());
}
//! [2]
@@ -163,7 +163,7 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [4]
//! [6]
- qglClearColor(qtPurple.dark());
+ qglClearColor(qtPurple.darker());
glShadeModel(GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
@@ -247,12 +247,8 @@ void GLWidget::createBubbles(int number)
//! [13]
void GLWidget::animate()
{
- QMutableListIterator<Bubble*> iter(bubbles);
-
- while (iter.hasNext()) {
- Bubble *bubble = iter.next();
+ for (Bubble *bubble : qAsConst(bubbles))
bubble->move(rect());
- }
update();
}
//! [13]
diff --git a/examples/opengl/qopenglwidget/glwidget.cpp b/examples/opengl/qopenglwidget/glwidget.cpp
index 946b2bec67..5057291f12 100644
--- a/examples/opengl/qopenglwidget/glwidget.cpp
+++ b/examples/opengl/qopenglwidget/glwidget.cpp
@@ -399,12 +399,9 @@ void GLWidget::paintGL()
painter.end();
- QMutableListIterator<Bubble*> iter(m_bubbles);
-
- while (iter.hasNext()) {
- Bubble *bubble = iter.next();
+ for (Bubble *bubble : qAsConst(m_bubbles))
bubble->move(rect());
- }
+
if (!(m_frames % 100)) {
m_time.start();
m_frames = 0;
diff --git a/examples/opengl/qopenglwidget/glwidget.h b/examples/opengl/qopenglwidget/glwidget.h
index de7805a907..0ad2581cb8 100644
--- a/examples/opengl/qopenglwidget/glwidget.h
+++ b/examples/opengl/qopenglwidget/glwidget.h
@@ -56,7 +56,7 @@
#include <QOpenGLBuffer>
#include <QVector3D>
#include <QMatrix4x4>
-#include <QTime>
+#include <QElapsedTimer>
#include <QVector>
#include <QPushButton>
@@ -106,7 +106,7 @@ private:
bool m_qtLogo;
QList<Bubble *> m_bubbles;
int m_frames;
- QTime m_time;
+ QElapsedTimer m_time;
QOpenGLShader *m_vshader1;
QOpenGLShader *m_fshader1;
QOpenGLShader *m_vshader2;
diff --git a/examples/opengl/qopenglwindow/background_renderer.cpp b/examples/opengl/qopenglwindow/background_renderer.cpp
index 9da1b9bf99..acbbe74841 100644
--- a/examples/opengl/qopenglwindow/background_renderer.cpp
+++ b/examples/opengl/qopenglwindow/background_renderer.cpp
@@ -91,6 +91,9 @@ FragmentToy::FragmentToy(const QString &fragmentSource, QObject *parent)
}
}
+FragmentToy::~FragmentToy()
+ = default;
+
void FragmentToy::draw(const QSize &windowSize)
{
if (!m_program)
@@ -120,7 +123,7 @@ void FragmentToy::draw(const QSize &windowSize)
if (!m_vertex_shader->compileSourceCode(vertex_shader)) {
qWarning() << "Failed to compile the vertex shader:" << m_vertex_shader->log();
}
- if (!m_program->addShader(m_vertex_shader.data())) {
+ if (!m_program->addShader(m_vertex_shader.get())) {
qWarning() << "Failed to add vertex shader to program:" << m_program->log();
}
}
@@ -153,7 +156,7 @@ void FragmentToy::draw(const QSize &windowSize)
}
if (m_fragment_shader) {
- if (!m_program->addShader(m_fragment_shader.data())) {
+ if (!m_program->addShader(m_fragment_shader.get())) {
qWarning() << "Failed to add fragment shader to program:" << m_program->log();
}
}
@@ -197,14 +200,14 @@ void FragmentToy::fileChanged(const QString &path)
m_fragment_file_last_modified = fragment_source.lastModified();
m_recompile_shaders = true;
if (m_program) {
- m_program->removeShader(m_fragment_shader.data());
+ m_program->removeShader(m_fragment_shader.get());
m_fragment_shader.reset(nullptr);
}
}
} else {
m_recompile_shaders = true;
if (m_program) {
- m_program->removeShader(m_fragment_shader.data());
+ m_program->removeShader(m_fragment_shader.get());
m_fragment_shader.reset(nullptr);
}
}
diff --git a/examples/opengl/qopenglwindow/background_renderer.h b/examples/opengl/qopenglwindow/background_renderer.h
index d99b7ddbeb..0e3caf5981 100644
--- a/examples/opengl/qopenglwindow/background_renderer.h
+++ b/examples/opengl/qopenglwindow/background_renderer.h
@@ -62,11 +62,14 @@
#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions>
+#include <memory>
+
class FragmentToy : public QObject, protected QOpenGLFunctions
{
Q_OBJECT
public:
- FragmentToy(const QString &fragmentSource, QObject *parent = 0);
+ explicit FragmentToy(const QString &fragmentSource, QObject *parent = nullptr);
+ ~FragmentToy();
void draw(const QSize &windowSize);
@@ -79,9 +82,9 @@ private:
QString m_fragment_file;
QDateTime m_fragment_file_last_modified;
- QScopedPointer<QOpenGLShaderProgram> m_program;
- QScopedPointer<QOpenGLShader> m_vertex_shader;
- QScopedPointer<QOpenGLShader> m_fragment_shader;
+ std::unique_ptr<QOpenGLShaderProgram> m_program;
+ std::unique_ptr<QOpenGLShader> m_vertex_shader;
+ std::unique_ptr<QOpenGLShader> m_fragment_shader;
QOpenGLVertexArrayObject m_vao;
QOpenGLBuffer m_vertex_buffer;
GLuint m_vertex_coord_pos;
diff --git a/examples/opengl/threadedqopenglwidget/main.cpp b/examples/opengl/threadedqopenglwidget/main.cpp
index b9e491040f..975def030b 100644
--- a/examples/opengl/threadedqopenglwidget/main.cpp
+++ b/examples/opengl/threadedqopenglwidget/main.cpp
@@ -50,7 +50,7 @@
#include <QApplication>
#include <QMainWindow>
-#include <QDesktopWidget>
+#include <QScreen>
#include <QSurfaceFormat>
#include <QOpenGLContext>
#include <QCommandLineParser>
@@ -58,6 +58,8 @@
#include "mainwindow.h"
#include "glwidget.h"
+#include <memory>
+
static QString getGlString(QOpenGLFunctions *functions, GLenum name)
{
if (const GLubyte *p = functions->glGetString(name))
@@ -88,7 +90,7 @@ int main( int argc, char ** argv )
// The rendering for the four QOpenGLWidgets happens on four separate threads.
GLWidget topLevelGlWidget;
- QPoint pos = QApplication::desktop()->availableGeometry(&topLevelGlWidget).topLeft() + QPoint(200, 200);
+ QPoint pos = topLevelGlWidget.screen()->availableGeometry().topLeft() + QPoint(200, 200);
topLevelGlWidget.setWindowTitle(QStringLiteral("Threaded QOpenGLWidget example top level"));
topLevelGlWidget.resize(200, 200);
topLevelGlWidget.move(pos);
@@ -104,8 +106,8 @@ int main( int argc, char ** argv )
const QString toolTip = supportsThreading ? glInfo : glInfo + QStringLiteral("\ndoes not support threaded OpenGL.");
topLevelGlWidget.setToolTip(toolTip);
- QScopedPointer<MainWindow> mw1;
- QScopedPointer<MainWindow> mw2;
+ std::unique_ptr<MainWindow> mw1;
+ std::unique_ptr<MainWindow> mw2;
if (!parser.isSet(singleOption)) {
if (supportsThreading) {
pos += QPoint(100, 100);
diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp
index ff7ea24ee7..ae8542a761 100644
--- a/examples/qtconcurrent/wordcount/main.cpp
+++ b/examples/qtconcurrent/wordcount/main.cpp
@@ -54,7 +54,7 @@
#include <QString>
#include <QStringList>
#include <QDir>
-#include <QTime>
+#include <QElapsedTimer>
#include <QApplication>
#include <QDebug>
@@ -126,11 +126,8 @@ WordCount countWords(const QString &file)
// at a time.
void reduce(WordCount &result, const WordCount &w)
{
- QMapIterator<QString, int> i(w);
- while (i.hasNext()) {
- i.next();
+ for (auto i = w.begin(), end = w.end(); i != end; ++i)
result[i.key()] += i.value();
- }
}
int main(int argc, char** argv)
@@ -149,19 +146,19 @@ int main(int argc, char** argv)
int singleThreadTime = 0;
{
- QTime time;
- time.start();
+ QElapsedTimer timer;
+ timer.start();
WordCount total = singleThreadedWordCount(files);
- singleThreadTime = time.elapsed();
+ singleThreadTime = timer.elapsed();
qDebug() << "single thread" << singleThreadTime;
}
int mapReduceTime = 0;
{
- QTime time;
- time.start();
+ QElapsedTimer timer;
+ timer.start();
WordCount total = mappedReduced(files, countWords, reduce);
- mapReduceTime = time.elapsed();
+ mapReduceTime = timer.elapsed();
qDebug() << "MapReduce" << mapReduceTime;
}
qDebug() << "MapReduce speedup x" << ((double)singleThreadTime - (double)mapReduceTime) / (double)mapReduceTime + 1;
diff --git a/examples/sql/doc/src/cachedtable.qdoc b/examples/sql/doc/src/cachedtable.qdoc
index 2db80f9c8e..0dd7928e21 100644
--- a/examples/sql/doc/src/cachedtable.qdoc
+++ b/examples/sql/doc/src/cachedtable.qdoc
@@ -43,15 +43,15 @@
\section1 TableEditor Class Definition
- The \c TableEditor class inherits QDialog making the table editor
+ The \c TableEditor class inherits QWidget making the table editor
widget a top-level dialog window.
\snippet cachedtable/tableeditor.h 0
The \c TableEditor constructor takes two arguments: The first is a
- pointer to the parent widget and is passed on to the base class
- constructor. The other is a reference to the database table the \c
- TableEditor object will operate on.
+ reference to the database table the \c TableEditor object will operate
+ on. The other is a pointer to the parent widget and is passed on to the
+ base class constructor.
Note the QSqlTableModel variable declaration: As we will see in
this example, the QSqlTableModel class can be used to provide data
diff --git a/examples/sql/relationaltablemodel/relationaltablemodel.cpp b/examples/sql/relationaltablemodel/relationaltablemodel.cpp
index c3c7d48d70..df4eae6e6e 100644
--- a/examples/sql/relationaltablemodel/relationaltablemodel.cpp
+++ b/examples/sql/relationaltablemodel/relationaltablemodel.cpp
@@ -53,6 +53,8 @@
#include "../connection.h"
+#include <memory>
+
void initializeModel(QSqlRelationalTableModel *model)
{
//! [0]
@@ -76,12 +78,12 @@ void initializeModel(QSqlRelationalTableModel *model)
model->select();
}
-QTableView *createView(const QString &title, QSqlTableModel *model)
+std::unique_ptr<QTableView> createView(const QString &title, QSqlTableModel *model)
{
//! [4]
- QTableView *view = new QTableView;
+ std::unique_ptr<QTableView> view{new QTableView};
view->setModel(model);
- view->setItemDelegate(new QSqlRelationalDelegate(view));
+ view->setItemDelegate(new QSqlRelationalDelegate(view.get()));
//! [4]
view->setWindowTitle(title);
return view;
@@ -118,7 +120,7 @@ int main(int argc, char *argv[])
initializeModel(&model);
- QScopedPointer<QTableView> view(createView(QObject::tr("Relational Table Model"), &model));
+ std::unique_ptr<QTableView> view = createView(QObject::tr("Relational Table Model"), &model);
view->show();
return app.exec();
diff --git a/examples/vulkan/hellovulkancubes/renderer.cpp b/examples/vulkan/hellovulkancubes/renderer.cpp
index 5ada79ce79..f104d79002 100644
--- a/examples/vulkan/hellovulkancubes/renderer.cpp
+++ b/examples/vulkan/hellovulkancubes/renderer.cpp
@@ -49,6 +49,7 @@
****************************************************************************/
#include "renderer.h"
+#include "qrandom.h"
#include <QVulkanFunctions>
#include <QtConcurrentRun>
#include <QTime>
@@ -77,8 +78,6 @@ Renderer::Renderer(VulkanWindow *w, int initialCount)
m_cam(QVector3D(0.0f, 0.0f, 20.0f)), // starting camera position
m_instCount(initialCount)
{
- qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
-
m_floorModel.translate(0, -5, 0);
m_floorModel.rotate(-90, 1, 0, 0);
m_floorModel.scale(20, 100, 1);
@@ -793,7 +792,9 @@ void Renderer::ensureInstanceBuffer()
qDebug("Preparing instances %d..%d", m_preparedInstCount, m_instCount - 1);
char *p = m_instData.data();
p += m_preparedInstCount * PER_INSTANCE_DATA_SIZE;
- auto gen = [](float a, float b) { return float((qrand() % int(b - a + 1)) + a); };
+ auto gen = [](int a, int b) {
+ return float(QRandomGenerator::global()->bounded(double(b - a)) + a);
+ };
for (int i = m_preparedInstCount; i < m_instCount; ++i) {
// Apply a random translation to each instance of the mesh.
float t[] = { gen(-5, 5), gen(-4, 6), gen(-30, 5) };
diff --git a/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp b/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp
index 81daa9bb96..cf95a0e6a0 100644
--- a/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp
+++ b/examples/vulkan/hellovulkanwidget/hellovulkanwidget.cpp
@@ -140,12 +140,12 @@ void VulkanRenderer::initResources()
m_devFuncs = inst->deviceFunctions(m_window->device());
QString info;
- info += QString().sprintf("Number of physical devices: %d\n", m_window->availablePhysicalDevices().count());
+ info += QString::asprintf("Number of physical devices: %d\n", m_window->availablePhysicalDevices().count());
QVulkanFunctions *f = inst->functions();
VkPhysicalDeviceProperties props;
f->vkGetPhysicalDeviceProperties(m_window->physicalDevice(), &props);
- info += QString().sprintf("Active physical device name: '%s' version %d.%d.%d\nAPI version %d.%d.%d\n",
+ info += QString::asprintf("Active physical device name: '%s' version %d.%d.%d\nAPI version %d.%d.%d\n",
props.deviceName,
VK_VERSION_MAJOR(props.driverVersion), VK_VERSION_MINOR(props.driverVersion),
VK_VERSION_PATCH(props.driverVersion),
@@ -154,19 +154,19 @@ void VulkanRenderer::initResources()
info += QStringLiteral("Supported instance layers:\n");
for (const QVulkanLayer &layer : inst->supportedLayers())
- info += QString().sprintf(" %s v%u\n", layer.name.constData(), layer.version);
+ info += QString::asprintf(" %s v%u\n", layer.name.constData(), layer.version);
info += QStringLiteral("Enabled instance layers:\n");
for (const QByteArray &layer : inst->layers())
- info += QString().sprintf(" %s\n", layer.constData());
+ info += QString::asprintf(" %s\n", layer.constData());
info += QStringLiteral("Supported instance extensions:\n");
for (const QVulkanExtension &ext : inst->supportedExtensions())
- info += QString().sprintf(" %s v%u\n", ext.name.constData(), ext.version);
+ info += QString::asprintf(" %s v%u\n", ext.name.constData(), ext.version);
info += QStringLiteral("Enabled instance extensions:\n");
for (const QByteArray &ext : inst->extensions())
- info += QString().sprintf(" %s\n", ext.constData());
+ info += QString::asprintf(" %s\n", ext.constData());
- info += QString().sprintf("Color format: %u\nDepth-stencil format: %u\n",
+ info += QString::asprintf("Color format: %u\nDepth-stencil format: %u\n",
m_window->colorFormat(), m_window->depthStencilFormat());
info += QStringLiteral("Supported sample counts:");
diff --git a/examples/widgets/animation/easing/window.cpp b/examples/widgets/animation/easing/window.cpp
index aa12147388..d1d6348361 100644
--- a/examples/widgets/animation/easing/window.cpp
+++ b/examples/widgets/animation/easing/window.cpp
@@ -55,11 +55,10 @@ Window::Window(QWidget *parent)
m_iconSize(64, 64)
{
m_ui.setupUi(this);
- QButtonGroup *buttonGroup = findChild<QButtonGroup *>(); // ### workaround for uic in 4.4
m_ui.easingCurvePicker->setIconSize(m_iconSize);
m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50);
- buttonGroup->setId(m_ui.lineRadio, 0);
- buttonGroup->setId(m_ui.circleRadio, 1);
+ m_ui.buttonGroup->setId(m_ui.lineRadio, 0);
+ m_ui.buttonGroup->setId(m_ui.circleRadio, 1);
QEasingCurve dummy;
m_ui.periodSpinBox->setValue(dummy.period());
@@ -68,7 +67,7 @@ Window::Window(QWidget *parent)
connect(m_ui.easingCurvePicker, &QListWidget::currentRowChanged,
this, &Window::curveChanged);
- connect(buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
+ connect(m_ui.buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked),
this, &Window::pathChanged);
connect(m_ui.periodSpinBox, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &Window::periodChanged);
diff --git a/examples/widgets/animation/stickman/animation.cpp b/examples/widgets/animation/stickman/animation.cpp
index 5c2d1682af..73d79adc84 100644
--- a/examples/widgets/animation/stickman/animation.cpp
+++ b/examples/widgets/animation/stickman/animation.cpp
@@ -50,16 +50,13 @@
#include "animation.h"
-#include <QPointF>
-#include <QVector>
#include <QIODevice>
#include <QDataStream>
class Frame
{
public:
- Frame() {
- }
+ Frame() = default;
int nodeCount() const
{
@@ -85,9 +82,8 @@ private:
QVector<QPointF> m_nodePositions;
};
-Animation::Animation()
+Animation::Animation() : m_currentFrame(0)
{
- m_currentFrame = 0;
m_frames.append(new Frame);
}
@@ -103,6 +99,8 @@ void Animation::setTotalFrames(int totalFrames)
while (totalFrames < m_frames.size())
delete m_frames.takeLast();
+
+ setCurrentFrame(m_currentFrame);
}
int Animation::totalFrames() const
@@ -112,7 +110,7 @@ int Animation::totalFrames() const
void Animation::setCurrentFrame(int currentFrame)
{
- m_currentFrame = qMax(qMin(currentFrame, totalFrames()-1), 0);
+ m_currentFrame = qBound(0, currentFrame, totalFrames() - 1);
}
int Animation::currentFrame() const
@@ -177,18 +175,16 @@ void Animation::load(QIODevice *device)
int frameCount;
stream >> frameCount;
- for (int i=0; i<frameCount; ++i) {
-
+ for (int i = 0; i < frameCount; ++i) {
int nodeCount;
stream >> nodeCount;
Frame *frame = new Frame;
frame->setNodeCount(nodeCount);
- for (int j=0; j<nodeCount; ++j) {
+ for (int j = 0; j < nodeCount; ++j) {
QPointF pos;
stream >> pos;
-
frame->setNodePos(j, pos);
}
diff --git a/examples/widgets/animation/stickman/animation.h b/examples/widgets/animation/stickman/animation.h
index e57847aeaa..5cc1133ac0 100644
--- a/examples/widgets/animation/stickman/animation.h
+++ b/examples/widgets/animation/stickman/animation.h
@@ -52,8 +52,8 @@
#define ANIMATION_H
#include <QPointF>
-#include <QList>
#include <QString>
+#include <QVector>
class Frame;
QT_BEGIN_NAMESPACE
@@ -85,7 +85,7 @@ public:
private:
QString m_name;
- QList<Frame *> m_frames;
+ QVector<Frame *> m_frames;
int m_currentFrame;
};
diff --git a/examples/widgets/animation/stickman/graphicsview.cpp b/examples/widgets/animation/stickman/graphicsview.cpp
index 7058e15345..0f5800cff3 100644
--- a/examples/widgets/animation/stickman/graphicsview.cpp
+++ b/examples/widgets/animation/stickman/graphicsview.cpp
@@ -51,13 +51,8 @@
#include "graphicsview.h"
#include "stickman.h"
-#include <QtGui/QKeyEvent>
-#include <QtWidgets/QGraphicsScene>
-#include <QtWidgets/QGraphicsView>
-
-GraphicsView::GraphicsView(QWidget *parent)
- : QGraphicsView(parent), m_editor(nullptr)
-{}
+#include <QKeyEvent>
+#include <QGraphicsScene>
void GraphicsView::keyPressEvent(QKeyEvent *e)
{
@@ -66,7 +61,8 @@ void GraphicsView::keyPressEvent(QKeyEvent *e)
emit keyPressed(Qt::Key(e->key()));
}
-void GraphicsView::resizeEvent(QResizeEvent *)
+void GraphicsView::resizeEvent(QResizeEvent *e)
{
fitInView(scene()->sceneRect());
+ QGraphicsView::resizeEvent(e);
}
diff --git a/examples/widgets/animation/stickman/graphicsview.h b/examples/widgets/animation/stickman/graphicsview.h
index 361fee219d..29f4c6237e 100644
--- a/examples/widgets/animation/stickman/graphicsview.h
+++ b/examples/widgets/animation/stickman/graphicsview.h
@@ -51,24 +51,20 @@
#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H
-#include <QtWidgets/QGraphicsView>
+#include <QGraphicsView>
-class MainWindow;
class GraphicsView: public QGraphicsView
{
Q_OBJECT
public:
- GraphicsView(QWidget *parent = nullptr);
+ using QGraphicsView::QGraphicsView;
protected:
- void resizeEvent(QResizeEvent *event) override;
- void keyPressEvent(QKeyEvent *) override;
+ void resizeEvent(QResizeEvent *e) override;
+ void keyPressEvent(QKeyEvent *e) override;
signals:
void keyPressed(int key);
-
-private:
- MainWindow *m_editor;
};
#endif
diff --git a/examples/widgets/animation/stickman/lifecycle.cpp b/examples/widgets/animation/stickman/lifecycle.cpp
index 046e3f4cd1..5ad284c590 100644
--- a/examples/widgets/animation/stickman/lifecycle.cpp
+++ b/examples/widgets/animation/stickman/lifecycle.cpp
@@ -54,8 +54,15 @@
#include "animation.h"
#include "graphicsview.h"
-#include <QtCore>
-#include <QtWidgets>
+#include <QEventTransition>
+#include <QFile>
+#include <QParallelAnimationGroup>
+#include <QPropertyAnimation>
+#include <QRandomGenerator>
+#include <QSignalTransition>
+#include <QState>
+#include <QStateMachine>
+#include <QTimer>
class KeyPressTransition: public QSignalTransition
{
@@ -107,7 +114,7 @@ LifeCycle::LifeCycle(StickMan *stickMan, GraphicsView *keyReceiver)
// Create animation group to be used for all transitions
m_animationGroup = new QParallelAnimationGroup();
const int stickManNodeCount = m_stickMan->nodeCount();
- for (int i=0; i<stickManNodeCount; ++i) {
+ for (int i = 0; i < stickManNodeCount; ++i) {
QPropertyAnimation *pa = new QPropertyAnimation(m_stickMan->node(i), "pos");
m_animationGroup->addAnimation(pa);
}
@@ -175,7 +182,7 @@ void LifeCycle::addActivity(const QString &fileName, Qt::Key key, QObject *sende
QState *state = makeState(m_alive, fileName);
m_alive->addTransition(new KeyPressTransition(m_keyReceiver, key, state));
- if (sender || signal)
+ if (sender && signal)
m_alive->addTransition(sender, signal, state);
}
@@ -192,13 +199,13 @@ QState *LifeCycle::makeState(QState *parentState, const QString &animationFileNa
const int frameCount = animation.totalFrames();
QState *previousState = nullptr;
- for (int i=0; i<frameCount; ++i) {
+ for (int i = 0; i < frameCount; ++i) {
animation.setCurrentFrame(i);
//! [1]
QState *frameState = new QState(topLevel);
const int nodeCount = animation.nodeCount();
- for (int j=0; j<nodeCount; ++j)
+ for (int j = 0; j < nodeCount; ++j)
frameState->assignProperty(m_stickMan->node(j), "pos", animation.nodePos(j));
//! [1]
diff --git a/examples/widgets/animation/stickman/lifecycle.h b/examples/widgets/animation/stickman/lifecycle.h
index e3f9876676..21ab99276d 100644
--- a/examples/widgets/animation/stickman/lifecycle.h
+++ b/examples/widgets/animation/stickman/lifecycle.h
@@ -53,16 +53,16 @@
#include <Qt>
-class StickMan;
QT_BEGIN_NAMESPACE
-class QStateMachine;
-class QAnimationGroup;
-class QState;
class QAbstractState;
class QAbstractTransition;
+class QAnimationGroup;
class QObject;
+class QState;
+class QStateMachine;
QT_END_NAMESPACE
class GraphicsView;
+class StickMan;
class LifeCycle
{
public:
@@ -70,7 +70,8 @@ public:
~LifeCycle();
void setDeathAnimation(const QString &fileName);
- void addActivity(const QString &fileName, Qt::Key key, QObject *sender = NULL, const char *signal = NULL);
+ void addActivity(const QString &fileName, Qt::Key key,
+ QObject *sender = nullptr, const char *signal = nullptr);
void start();
diff --git a/examples/widgets/animation/stickman/node.h b/examples/widgets/animation/stickman/node.h
index 679999b7e8..2b393c60c1 100644
--- a/examples/widgets/animation/stickman/node.h
+++ b/examples/widgets/animation/stickman/node.h
@@ -51,13 +51,13 @@
#ifndef NODE_H
#define NODE_H
-#include <QGraphicsItem>
+#include <QGraphicsObject>
class Node: public QGraphicsObject
{
Q_OBJECT
public:
- explicit Node(const QPointF &pos, QGraphicsItem *parent = 0);
+ explicit Node(const QPointF &pos, QGraphicsItem *parent = nullptr);
~Node();
QRectF boundingRect() const override;
diff --git a/examples/widgets/animation/stickman/rectbutton.cpp b/examples/widgets/animation/stickman/rectbutton.cpp
index 7eea94ae6f..5174d0aeaf 100644
--- a/examples/widgets/animation/stickman/rectbutton.cpp
+++ b/examples/widgets/animation/stickman/rectbutton.cpp
@@ -51,12 +51,7 @@
#include "rectbutton.h"
#include <QPainter>
-RectButton::RectButton(QString buttonText) : m_ButtonText(buttonText)
-{
-}
-
-
-RectButton::~RectButton()
+RectButton::RectButton(const QString &buttonText) : m_ButtonText(buttonText)
{
}
diff --git a/examples/widgets/animation/stickman/rectbutton.h b/examples/widgets/animation/stickman/rectbutton.h
index ab47bad0f7..ee6cd3f530 100644
--- a/examples/widgets/animation/stickman/rectbutton.h
+++ b/examples/widgets/animation/stickman/rectbutton.h
@@ -57,19 +57,19 @@ class RectButton : public QGraphicsObject
{
Q_OBJECT
public:
- RectButton(QString buttonText);
- ~RectButton();
+ RectButton(const QString &buttonText);
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
- QString m_ButtonText;
-
void mousePressEvent (QGraphicsSceneMouseEvent *event) override;
signals:
void clicked();
+
+private:
+ QString m_ButtonText;
};
#endif // RECTBUTTON_H
diff --git a/examples/widgets/animation/stickman/stickman.cpp b/examples/widgets/animation/stickman/stickman.cpp
index 5725f64eec..3f373b6b52 100644
--- a/examples/widgets/animation/stickman/stickman.cpp
+++ b/examples/widgets/animation/stickman/stickman.cpp
@@ -52,10 +52,9 @@
#include "node.h"
#include <QPainter>
-#include <QTimer>
-#include <qmath.h>
+#include <QtMath>
-static const qreal Coords[NodeCount * 2] = {
+static constexpr qreal Coords[NodeCount * 2] = {
0.0, -150.0, // head, #0
0.0, -100.0, // body pentagon, top->bottom, left->right, #1 - 5
@@ -81,7 +80,7 @@ static const qreal Coords[NodeCount * 2] = {
};
-static const int Bones[BoneCount * 2] = {
+static constexpr int Bones[BoneCount * 2] = {
0, 1, // neck
1, 2, // body
@@ -117,19 +116,13 @@ static const int Bones[BoneCount * 2] = {
StickMan::StickMan()
{
- m_sticks = true;
- m_isDead = false;
- m_pixmap = QPixmap("images/head.png");
- m_penColor = Qt::white;
- m_fillColor = Qt::black;
-
// Set up start position of limbs
- for (int i=0; i<NodeCount; ++i) {
+ for (int i = 0; i < NodeCount; ++i) {
m_nodes[i] = new Node(QPointF(Coords[i * 2], Coords[i * 2 + 1]), this);
connect(m_nodes[i], &Node::positionChanged, this, &StickMan::childPositionChanged);
}
- for (int i=0; i<BoneCount; ++i) {
+ for (int i = 0; i < BoneCount; ++i) {
int n1 = Bones[i * 2];
int n2 = Bones[i * 2 + 1];
@@ -137,16 +130,12 @@ StickMan::StickMan()
Node *node2 = m_nodes[n2];
QPointF dist = node1->pos() - node2->pos();
- m_perfectBoneLengths[i] = sqrt(pow(dist.x(),2) + pow(dist.y(),2));
+ m_perfectBoneLengths[i] = sqrt(pow(dist.x(), 2) + pow(dist.y(), 2));
}
startTimer(10);
}
-StickMan::~StickMan()
-{
-}
-
void StickMan::childPositionChanged()
{
prepareGeometryChange();
@@ -155,7 +144,7 @@ void StickMan::childPositionChanged()
void StickMan::setDrawSticks(bool on)
{
m_sticks = on;
- for (int i=0;i<nodeCount();++i) {
+ for (int i = 0; i < nodeCount(); ++i) {
Node *node = m_nodes[i];
node->setVisible(on);
}
@@ -188,7 +177,7 @@ void StickMan::stabilize()
{
static const qreal threshold = 0.001;
- for (int i=0; i<BoneCount; ++i) {
+ for (int i = 0; i < BoneCount; ++i) {
int n1 = Bones[i * 2];
int n2 = Bones[i * 2 + 1];
@@ -236,7 +225,7 @@ void StickMan::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge
stabilize();
if (m_sticks) {
painter->setPen(Qt::white);
- for (int i=0; i<BoneCount; ++i) {
+ for (int i = 0; i < BoneCount; ++i) {
int n1 = Bones[i * 2];
int n2 = Bones[i * 2 + 1];
diff --git a/examples/widgets/animation/stickman/stickman.h b/examples/widgets/animation/stickman/stickman.h
index f2311a0358..63c02abc8f 100644
--- a/examples/widgets/animation/stickman/stickman.h
+++ b/examples/widgets/animation/stickman/stickman.h
@@ -57,8 +57,6 @@ static const int NodeCount = 16;
static const int BoneCount = 24;
class Node;
-QT_BEGIN_NAMESPACE
-QT_END_NAMESPACE
class StickMan: public QGraphicsObject
{
Q_OBJECT
@@ -67,7 +65,6 @@ class StickMan: public QGraphicsObject
Q_PROPERTY(bool isDead WRITE setIsDead READ isDead)
public:
StickMan();
- ~StickMan();
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
@@ -101,13 +98,11 @@ private:
Node *m_nodes[NodeCount];
qreal m_perfectBoneLengths[BoneCount];
- uint m_sticks : 1;
- uint m_isDead : 1;
- uint m_reserved : 30;
+ bool m_sticks = true;
+ bool m_isDead = false;
- QPixmap m_pixmap;
- QColor m_penColor;
- QColor m_fillColor;
+ QColor m_penColor = Qt::white;
+ QColor m_fillColor = Qt::black;
};
#endif // STICKMAN_H
diff --git a/examples/widgets/animation/sub-attaq/animationmanager.cpp b/examples/widgets/animation/sub-attaq/animationmanager.cpp
index a611641613..261cbd1e1c 100644
--- a/examples/widgets/animation/sub-attaq/animationmanager.cpp
+++ b/examples/widgets/animation/sub-attaq/animationmanager.cpp
@@ -51,22 +51,13 @@
//Own
#include "animationmanager.h"
-//Qt
-#include <QtCore/QAbstractAnimation>
-#include <QtCore/QDebug>
-
-// the universe's only animation manager
-AnimationManager *AnimationManager::instance = nullptr;
-
-AnimationManager::AnimationManager()
-{
-}
+#include <QAbstractAnimation>
AnimationManager *AnimationManager::self()
{
- if (!instance)
- instance = new AnimationManager;
- return instance;
+ // the universe's only animation manager
+ static AnimationManager s_instance;
+ return &s_instance;
}
void AnimationManager::registerAnimation(QAbstractAnimation *anim)
diff --git a/examples/widgets/animation/sub-attaq/animationmanager.h b/examples/widgets/animation/sub-attaq/animationmanager.h
index 9365fa1f1e..5ddea66e80 100644
--- a/examples/widgets/animation/sub-attaq/animationmanager.h
+++ b/examples/widgets/animation/sub-attaq/animationmanager.h
@@ -51,7 +51,7 @@
#ifndef ANIMATIONMANAGER_H
#define ANIMATIONMANAGER_H
-#include <QtCore/QObject>
+#include <QObject>
QT_BEGIN_NAMESPACE
class QAbstractAnimation;
@@ -59,9 +59,10 @@ QT_END_NAMESPACE
class AnimationManager : public QObject
{
-Q_OBJECT
+ Q_OBJECT
+ AnimationManager() = default;
+ ~AnimationManager() = default;
public:
- AnimationManager();
void registerAnimation(QAbstractAnimation *anim);
void unregisterAnimation(QAbstractAnimation *anim);
void unregisterAllAnimations();
@@ -75,8 +76,7 @@ private slots:
void unregisterAnimation_helper(QObject *obj);
private:
- static AnimationManager *instance;
- QList<QAbstractAnimation *> animations;
+ QVector<QAbstractAnimation *> animations;
};
#endif // ANIMATIONMANAGER_H
diff --git a/examples/widgets/animation/sub-attaq/boat.cpp b/examples/widgets/animation/sub-attaq/boat.cpp
index 9037d54878..d5fa314b60 100644
--- a/examples/widgets/animation/sub-attaq/boat.cpp
+++ b/examples/widgets/animation/sub-attaq/boat.cpp
@@ -52,18 +52,17 @@
#include "boat.h"
#include "boat_p.h"
#include "bomb.h"
-#include "pixmapitem.h"
#include "graphicsscene.h"
#include "animationmanager.h"
#include "qanimationstate.h"
//Qt
-#include <QtCore/QPropertyAnimation>
-#include <QtCore/QStateMachine>
-#include <QtCore/QHistoryState>
-#include <QtCore/QFinalState>
-#include <QtCore/QState>
-#include <QtCore/QSequentialAnimationGroup>
+#include <QFinalState>
+#include <QHistoryState>
+#include <QPropertyAnimation>
+#include <QSequentialAnimationGroup>
+#include <QState>
+#include <QStateMachine>
static QAbstractAnimation *setupDestroyAnimation(Boat *boat)
{
@@ -181,7 +180,7 @@ Boat::Boat()
launchStateLeft->addTransition(historyState);
launchStateRight->addTransition(historyState);
- QFinalState *final = new QFinalState(machine);
+ QFinalState *finalState = new QFinalState(machine);
//This state play the destroyed animation
QAnimationState *destroyedState = new QAnimationState(machine);
@@ -191,10 +190,10 @@ Boat::Boat()
moving->addTransition(this, &Boat::boatDestroyed, destroyedState);
//Transition to final state when the destroyed animation is finished
- destroyedState->addTransition(destroyedState, &QAnimationState::animationFinished, final);
+ destroyedState->addTransition(destroyedState, &QAnimationState::animationFinished, finalState);
//The machine has finished to be executed, then the boat is dead
- connect(machine,&QState::finished, this, &Boat::boatExecutionFinished);
+ connect(machine, &QState::finished, this, &Boat::boatExecutionFinished);
}
diff --git a/examples/widgets/animation/sub-attaq/boat.h b/examples/widgets/animation/sub-attaq/boat.h
index a75e2b1474..22f2f0f7c1 100644
--- a/examples/widgets/animation/sub-attaq/boat.h
+++ b/examples/widgets/animation/sub-attaq/boat.h
@@ -48,12 +48,11 @@
**
****************************************************************************/
-#ifndef __BOAT__H__
-#define __BOAT__H__
+#ifndef BOAT_H
+#define BOAT_H
#include "pixmapitem.h"
-class Bomb;
QT_BEGIN_NAMESPACE
class QVariantAnimation;
class QAbstractAnimation;
@@ -101,4 +100,4 @@ private:
QStateMachine *machine;
};
-#endif //__BOAT__H__
+#endif // BOAT_H
diff --git a/examples/widgets/animation/sub-attaq/boat_p.h b/examples/widgets/animation/sub-attaq/boat_p.h
index 8ebfeb27f5..bb1a783392 100644
--- a/examples/widgets/animation/sub-attaq/boat_p.h
+++ b/examples/widgets/animation/sub-attaq/boat_p.h
@@ -67,7 +67,9 @@
#include "graphicsscene.h"
// Qt
-#include <QtWidgets/QKeyEventTransition>
+#include <QGraphicsRotation>
+#include <QKeyEventTransition>
+#include <QState>
static const int MAX_BOMB = 5;
@@ -88,7 +90,7 @@ protected:
return (boat->currentSpeed() == 1);
}
private:
- Boat * boat;
+ Boat *boat;
};
//These transtion test if we have to move the boat (i.e current speed was 0 or another value)
@@ -118,7 +120,7 @@ protected:
boat->updateBoatMovement();
}
private:
- Boat * boat;
+ Boat *boat;
int key;
};
@@ -139,7 +141,7 @@ protected:
return (boat->bombsLaunched() < MAX_BOMB);
}
private:
- Boat * boat;
+ Boat *boat;
};
//This state is describing when the boat is moving right
@@ -157,7 +159,7 @@ protected:
boat->updateBoatMovement();
}
private:
- Boat * boat;
+ Boat *boat;
};
//This state is describing when the boat is moving left
@@ -175,7 +177,7 @@ protected:
boat->updateBoatMovement();
}
private:
- Boat * boat;
+ Boat *boat;
};
//This state is describing when the boat is in a stand by position
@@ -194,7 +196,7 @@ protected:
boat->updateBoatMovement();
}
private:
- Boat * boat;
+ Boat *boat;
};
//This state is describing the launch of the torpedo on the right
@@ -216,7 +218,7 @@ protected:
boat->setBombsLaunched(boat->bombsLaunched() + 1);
}
private:
- Boat * boat;
+ Boat *boat;
};
//This state is describing the launch of the torpedo on the left
@@ -238,7 +240,7 @@ protected:
boat->setBombsLaunched(boat->bombsLaunched() + 1);
}
private:
- Boat * boat;
+ Boat *boat;
};
#endif // BOAT_P_H
diff --git a/examples/widgets/animation/sub-attaq/bomb.cpp b/examples/widgets/animation/sub-attaq/bomb.cpp
index 2b865137dd..0b9c365662 100644
--- a/examples/widgets/animation/sub-attaq/bomb.cpp
+++ b/examples/widgets/animation/sub-attaq/bomb.cpp
@@ -51,15 +51,14 @@
//Own
#include "bomb.h"
#include "submarine.h"
-#include "pixmapitem.h"
#include "animationmanager.h"
#include "qanimationstate.h"
//Qt
-#include <QtCore/QSequentialAnimationGroup>
-#include <QtCore/QPropertyAnimation>
-#include <QtCore/QStateMachine>
-#include <QtCore/QFinalState>
+#include <QFinalState>
+#include <QPropertyAnimation>
+#include <QSequentialAnimationGroup>
+#include <QStateMachine>
Bomb::Bomb() : PixmapItem(QString("bomb"), GraphicsScene::Big)
{
@@ -83,7 +82,7 @@ void Bomb::launch(Bomb::Direction direction)
anim->setEndValue(QPointF(x() + delta*2,scene()->height()));
anim->setDuration(y()/2*60);
launchAnimation->addAnimation(anim);
- connect(anim,&QVariantAnimation::valueChanged,this,&Bomb::onAnimationLaunchValueChanged);
+ connect(anim, &QVariantAnimation::valueChanged, this, &Bomb::onAnimationLaunchValueChanged);
connect(this, &Bomb::bombExploded, launchAnimation, &QAbstractAnimation::stop);
//We setup the state machine of the bomb
QStateMachine *machine = new QStateMachine(this);
@@ -93,18 +92,18 @@ void Bomb::launch(Bomb::Direction direction)
launched->setAnimation(launchAnimation);
//End
- QFinalState *final = new QFinalState(machine);
+ QFinalState *finalState = new QFinalState(machine);
machine->setInitialState(launched);
//### Add a nice animation when the bomb is destroyed
- launched->addTransition(this, &Bomb::bombExploded,final);
+ launched->addTransition(this, &Bomb::bombExploded, finalState);
//If the animation is finished, then we move to the final state
- launched->addTransition(launched, &QAnimationState::animationFinished, final);
+ launched->addTransition(launched, &QAnimationState::animationFinished, finalState);
//The machine has finished to be executed, then the boat is dead
- connect(machine,&QState::finished,this, &Bomb::bombExecutionFinished);
+ connect(machine,&QState::finished, this, &Bomb::bombExecutionFinished);
machine->start();
diff --git a/examples/widgets/animation/sub-attaq/bomb.h b/examples/widgets/animation/sub-attaq/bomb.h
index 8e893f81e3..9ae54b4d81 100644
--- a/examples/widgets/animation/sub-attaq/bomb.h
+++ b/examples/widgets/animation/sub-attaq/bomb.h
@@ -48,8 +48,8 @@
**
****************************************************************************/
-#ifndef __BOMB__H__
-#define __BOMB__H__
+#ifndef BOMB_H
+#define BOMB_H
#include "pixmapitem.h"
@@ -73,4 +73,4 @@ private slots:
void onAnimationLaunchValueChanged(const QVariant &);
};
-#endif //__BOMB__H__
+#endif // BOMB_H
diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.cpp b/examples/widgets/animation/sub-attaq/graphicsscene.cpp
index 8f0dfc1357..c7e2d269c8 100644
--- a/examples/widgets/animation/sub-attaq/graphicsscene.cpp
+++ b/examples/widgets/animation/sub-attaq/graphicsscene.cpp
@@ -55,38 +55,33 @@
#include "submarine.h"
#include "torpedo.h"
#include "bomb.h"
-#include "pixmapitem.h"
#include "animationmanager.h"
#include "qanimationstate.h"
#include "progressitem.h"
#include "textinformationitem.h"
//Qt
-#include <QtCore/QPropertyAnimation>
-#include <QtCore/QSequentialAnimationGroup>
-#include <QtCore/QParallelAnimationGroup>
-#include <QtCore/QStateMachine>
-#include <QtCore/QFinalState>
-#include <QtCore/QPauseAnimation>
-#include <QtWidgets/QAction>
-#include <QtCore/QDir>
-#include <QtWidgets/QApplication>
-#include <QtWidgets/QMessageBox>
-#include <QtWidgets/QGraphicsView>
-#include <QtWidgets/QGraphicsSceneMouseEvent>
-#include <QtCore/QXmlStreamReader>
-
-GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode)
- : QGraphicsScene(x , y, width, height), mode(mode), boat(new Boat)
+#include <QAction>
+#include <QApplication>
+#include <QFile>
+#include <QFinalState>
+#include <QParallelAnimationGroup>
+#include <QPropertyAnimation>
+#include <QSequentialAnimationGroup>
+#include <QStateMachine>
+#include <QXmlStreamReader>
+
+GraphicsScene::GraphicsScene(int x, int y, int width, int height, Mode mode, QObject *parent)
+ : QGraphicsScene(x, y, width, height, parent), mode(mode), boat(new Boat)
{
- PixmapItem *backgroundItem = new PixmapItem(QString("background"),mode);
+ PixmapItem *backgroundItem = new PixmapItem(QStringLiteral("background"), mode);
backgroundItem->setZValue(1);
backgroundItem->setPos(0,0);
addItem(backgroundItem);
- PixmapItem *surfaceItem = new PixmapItem(QString("surface"),mode);
+ PixmapItem *surfaceItem = new PixmapItem(QStringLiteral("surface"), mode);
surfaceItem->setZValue(3);
- surfaceItem->setPos(0,sealLevel() - surfaceItem->boundingRect().height()/2);
+ surfaceItem->setPos(0, sealLevel() - surfaceItem->boundingRect().height() / 2);
addItem(surfaceItem);
//The item that display score and level
@@ -137,8 +132,8 @@ qreal GraphicsScene::sealLevel() const
void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction)
{
- static const int nLetters = 10;
- static struct {
+ static constexpr int nLetters = 10;
+ static constexpr struct {
char const *pix;
qreal initX, initY;
qreal destX, destY;
@@ -154,8 +149,8 @@ void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction)
{"q", 200, 2000, 510, 250 },
{"excl", 0, 2000, 570, 220 } };
- QSequentialAnimationGroup * lettersGroupMoving = new QSequentialAnimationGroup(this);
- QParallelAnimationGroup * lettersGroupFading = new QParallelAnimationGroup(this);
+ QSequentialAnimationGroup *lettersGroupMoving = new QSequentialAnimationGroup(this);
+ QParallelAnimationGroup *lettersGroupFading = new QParallelAnimationGroup(this);
for (int i = 0; i < nLetters; ++i) {
PixmapItem *logo = new PixmapItem(QLatin1String(":/logo-") + logoData[i].pix, this);
@@ -180,7 +175,7 @@ void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction)
PlayState *gameState = new PlayState(this, machine);
//Final state
- QFinalState *final = new QFinalState(machine);
+ QFinalState *finalState = new QFinalState(machine);
//Animation when the player enter in the game
QAnimationState *lettersMovingState = new QAnimationState(machine);
@@ -198,8 +193,8 @@ void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction)
gameState->addTransition(newAction, &QAction::triggered, gameState);
//Wanna quit, then connect to CTRL+Q
- gameState->addTransition(quitAction, &QAction::triggered, final);
- lettersMovingState->addTransition(quitAction, &QAction::triggered, final);
+ gameState->addTransition(quitAction, &QAction::triggered, finalState);
+ lettersMovingState->addTransition(quitAction, &QAction::triggered, finalState);
//Welcome screen is the initial state
machine->setInitialState(lettersMovingState);
@@ -213,21 +208,24 @@ void GraphicsScene::setupScene(QAction *newAction, QAction *quitAction)
void GraphicsScene::addItem(Bomb *bomb)
{
bombs.insert(bomb);
- connect(bomb,&Bomb::bombExecutionFinished,this, &GraphicsScene::onBombExecutionFinished);
+ connect(bomb, &Bomb::bombExecutionFinished,
+ this, &GraphicsScene::onBombExecutionFinished);
QGraphicsScene::addItem(bomb);
}
void GraphicsScene::addItem(Torpedo *torpedo)
{
torpedos.insert(torpedo);
- connect(torpedo,&Torpedo::torpedoExecutionFinished,this, &GraphicsScene::onTorpedoExecutionFinished);
+ connect(torpedo, &Torpedo::torpedoExecutionFinished,
+ this, &GraphicsScene::onTorpedoExecutionFinished);
QGraphicsScene::addItem(torpedo);
}
void GraphicsScene::addItem(SubMarine *submarine)
{
submarines.insert(submarine);
- connect(submarine,&SubMarine::subMarineExecutionFinished,this, &GraphicsScene::onSubMarineExecutionFinished);
+ connect(submarine, &SubMarine::subMarineExecutionFinished,
+ this, &GraphicsScene::onSubMarineExecutionFinished);
QGraphicsScene::addItem(submarine);
}
@@ -239,15 +237,18 @@ void GraphicsScene::addItem(QGraphicsItem *item)
void GraphicsScene::onBombExecutionFinished()
{
Bomb *bomb = qobject_cast<Bomb *>(sender());
+ if (!bomb)
+ return;
bombs.remove(bomb);
bomb->deleteLater();
- if (boat)
- boat->setBombsLaunched(boat->bombsLaunched() - 1);
+ boat->setBombsLaunched(boat->bombsLaunched() - 1);
}
void GraphicsScene::onTorpedoExecutionFinished()
{
Torpedo *torpedo = qobject_cast<Torpedo *>(sender());
+ if (!torpedo)
+ return;
torpedos.remove(torpedo);
torpedo->deleteLater();
}
@@ -255,6 +256,8 @@ void GraphicsScene::onTorpedoExecutionFinished()
void GraphicsScene::onSubMarineExecutionFinished()
{
SubMarine *submarine = qobject_cast<SubMarine *>(sender());
+ if (!submarine)
+ return;
submarines.remove(submarine);
if (submarines.count() == 0)
emit allSubMarineDestroyed(submarine->points());
@@ -266,16 +269,22 @@ void GraphicsScene::onSubMarineExecutionFinished()
void GraphicsScene::clearScene()
{
for (SubMarine *sub : qAsConst(submarines)) {
+ // make sure to not go into onSubMarineExecutionFinished
+ sub->disconnect(this);
sub->destroy();
sub->deleteLater();
}
for (Torpedo *torpedo : qAsConst(torpedos)) {
+ // make sure to not go into onTorpedoExecutionFinished
+ torpedo->disconnect(this);
torpedo->destroy();
torpedo->deleteLater();
}
for (Bomb *bomb : qAsConst(bombs)) {
+ // make sure to not go into onBombExecutionFinished
+ bomb->disconnect(this);
bomb->destroy();
bomb->deleteLater();
}
diff --git a/examples/widgets/animation/sub-attaq/graphicsscene.h b/examples/widgets/animation/sub-attaq/graphicsscene.h
index 86c3414bbb..dd3719bc10 100644
--- a/examples/widgets/animation/sub-attaq/graphicsscene.h
+++ b/examples/widgets/animation/sub-attaq/graphicsscene.h
@@ -48,13 +48,12 @@
**
****************************************************************************/
-#ifndef __GRAPHICSSCENE__H__
-#define __GRAPHICSSCENE__H__
+#ifndef GRAPHICSSCENE_H
+#define GRAPHICSSCENE_H
//Qt
-#include <QtWidgets/QGraphicsScene>
-#include <QtCore/QSet>
-#include <QtCore/QState>
+#include <QGraphicsScene>
+#include <QSet>
class Boat;
@@ -78,18 +77,18 @@ public:
};
struct SubmarineDescription {
- int type;
- int points;
+ int type = 0;
+ int points = 0;
QString name;
};
struct LevelDescription {
- int id;
+ int id = 0;
QString name;
- QList<QPair<int,int> > submarines;
+ QVector<QPair<int, int>> submarines;
};
- GraphicsScene(int x, int y, int width, int height, Mode mode = Big);
+ GraphicsScene(int x, int y, int width, int height, Mode mode, QObject *parent = nullptr);
qreal sealLevel() const;
void setupScene(QAction *newAction, QAction *quitAction);
void addItem(Bomb *bomb);
@@ -127,5 +126,5 @@ private:
friend class UpdateScoreTransition;
};
-#endif //__GRAPHICSSCENE__H__
+#endif // GRAPHICSSCENE_H
diff --git a/examples/widgets/animation/sub-attaq/mainwindow.cpp b/examples/widgets/animation/sub-attaq/mainwindow.cpp
index a4bb15b383..8f545ecebd 100644
--- a/examples/widgets/animation/sub-attaq/mainwindow.cpp
+++ b/examples/widgets/animation/sub-attaq/mainwindow.cpp
@@ -56,11 +56,10 @@
#include <QGraphicsView>
#include <QApplication>
#include <QMenu>
-#include <QMenuBar>
#include <QLayout>
#ifndef QT_NO_OPENGL
-# include <QtOpenGL/QtOpenGL>
+# include <QtOpenGL>
#endif
MainWindow::MainWindow(QWidget *parent)
@@ -74,10 +73,10 @@ MainWindow::MainWindow(QWidget *parent)
quitAction->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q));
if (QApplication::arguments().contains("-fullscreen")) {
- scene = new GraphicsScene(0, 0, 750, 400, GraphicsScene::Small);
+ scene = new GraphicsScene(0, 0, 750, 400, GraphicsScene::Small, this);
setWindowState(Qt::WindowFullScreen);
} else {
- scene = new GraphicsScene(0, 0, 880, 630);
+ scene = new GraphicsScene(0, 0, 880, 630, GraphicsScene::Big, this);
layout()->setSizeConstraint(QLayout::SetFixedSize);
}
diff --git a/examples/widgets/animation/sub-attaq/mainwindow.h b/examples/widgets/animation/sub-attaq/mainwindow.h
index c4fb9d324d..660acfaa0a 100644
--- a/examples/widgets/animation/sub-attaq/mainwindow.h
+++ b/examples/widgets/animation/sub-attaq/mainwindow.h
@@ -48,11 +48,11 @@
**
****************************************************************************/
-#ifndef __MAINWINDOW__H__
-#define __MAINWINDOW__H__
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
//Qt
-#include <QtWidgets/QMainWindow>
+#include <QMainWindow>
class GraphicsScene;
QT_BEGIN_NAMESPACE
class QGraphicsView;
@@ -69,4 +69,4 @@ private:
QGraphicsView *view;
};
-#endif //__MAINWINDOW__H__
+#endif // MAINWINDOW_H
diff --git a/examples/widgets/animation/sub-attaq/pixmapitem.cpp b/examples/widgets/animation/sub-attaq/pixmapitem.cpp
index 9475d5c3f8..a8581d881a 100644
--- a/examples/widgets/animation/sub-attaq/pixmapitem.cpp
+++ b/examples/widgets/animation/sub-attaq/pixmapitem.cpp
@@ -54,7 +54,7 @@
//Qt
#include <QPainter>
-PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphicsItem * parent)
+PixmapItem::PixmapItem(const QString &fileName, GraphicsScene::Mode mode, QGraphicsItem *parent)
: QGraphicsObject(parent)
{
if (mode == GraphicsScene::Big)
@@ -63,7 +63,8 @@ PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphi
pix = QPixmap(QStringLiteral(":/small/") + fileName);
}
-PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) : QGraphicsObject(), pix(fileName)
+PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene)
+ : QGraphicsObject(), pix(fileName)
{
scene->addItem(this);
}
diff --git a/examples/widgets/animation/sub-attaq/pixmapitem.h b/examples/widgets/animation/sub-attaq/pixmapitem.h
index ec5c01857f..45e2ca806f 100644
--- a/examples/widgets/animation/sub-attaq/pixmapitem.h
+++ b/examples/widgets/animation/sub-attaq/pixmapitem.h
@@ -48,14 +48,14 @@
**
****************************************************************************/
-#ifndef __PIXMAPITEM__H__
-#define __PIXMAPITEM__H__
+#ifndef PIXMAPITEM_H
+#define PIXMAPITEM_H
//Own
#include "graphicsscene.h"
//Qt
-#include <QtWidgets/QGraphicsObject>
+#include <QGraphicsObject>
class PixmapItem : public QGraphicsObject
{
@@ -69,4 +69,4 @@ private:
QPixmap pix;
};
-#endif //__PIXMAPITEM__H__
+#endif // PIXMAPITEM_H
diff --git a/examples/widgets/animation/sub-attaq/progressitem.cpp b/examples/widgets/animation/sub-attaq/progressitem.cpp
index 8b6b367710..350dbb7bbd 100644
--- a/examples/widgets/animation/sub-attaq/progressitem.cpp
+++ b/examples/widgets/animation/sub-attaq/progressitem.cpp
@@ -49,10 +49,11 @@
****************************************************************************/
#include "progressitem.h"
-#include "pixmapitem.h"
-ProgressItem::ProgressItem (QGraphicsItem * parent)
- : QGraphicsTextItem(parent), currentLevel(1), currentScore(0)
+#include <QFont>
+
+ProgressItem::ProgressItem(QGraphicsItem *parent)
+ : QGraphicsTextItem(parent)
{
setFont(QFont("Comic Sans MS"));
setPos(parentItem()->boundingRect().topRight() - QPointF(180, -5));
diff --git a/examples/widgets/animation/sub-attaq/progressitem.h b/examples/widgets/animation/sub-attaq/progressitem.h
index 23f5407978..f76b168151 100644
--- a/examples/widgets/animation/sub-attaq/progressitem.h
+++ b/examples/widgets/animation/sub-attaq/progressitem.h
@@ -52,19 +52,19 @@
#define PROGRESSITEM_H
//Qt
-#include <QtWidgets/QGraphicsTextItem>
+#include <QGraphicsTextItem>
class ProgressItem : public QGraphicsTextItem
{
public:
- ProgressItem(QGraphicsItem * parent = 0);
+ ProgressItem(QGraphicsItem *parent = nullptr);
void setLevel(int level);
void setScore(int score);
private:
void updateProgress();
- int currentLevel;
- int currentScore;
+ int currentLevel = 1;
+ int currentScore = 0;
};
#endif // PROGRESSITEM_H
diff --git a/examples/widgets/animation/sub-attaq/qanimationstate.cpp b/examples/widgets/animation/sub-attaq/qanimationstate.cpp
index ce99f9080d..6da085561b 100644
--- a/examples/widgets/animation/sub-attaq/qanimationstate.cpp
+++ b/examples/widgets/animation/sub-attaq/qanimationstate.cpp
@@ -50,7 +50,7 @@
#include "qanimationstate.h"
-#include <QtCore/qstate.h>
+#include <QAbstractAnimation>
QT_BEGIN_NAMESPACE
@@ -106,7 +106,7 @@ void QAnimationState::setAnimation(QAbstractAnimation *animation)
return;
//Disconnect from the previous animation if exist
- if(m_animation)
+ if (m_animation)
disconnect(m_animation, &QAbstractAnimation::finished, this, &QAnimationState::animationFinished);
m_animation = animation;
diff --git a/examples/widgets/animation/sub-attaq/qanimationstate.h b/examples/widgets/animation/sub-attaq/qanimationstate.h
index 063b119058..24759851ba 100644
--- a/examples/widgets/animation/sub-attaq/qanimationstate.h
+++ b/examples/widgets/animation/sub-attaq/qanimationstate.h
@@ -51,13 +51,7 @@
#ifndef QANIMATIONSTATE_H
#define QANIMATIONSTATE_H
-#ifndef QT_STATEMACHINE_SOLUTION
-# include <QtCore/qstate.h>
-# include <QtCore/qabstractanimation.h>
-#else
-# include "qstate.h"
-# include "qabstractanimation.h"
-#endif
+#include <QState>
QT_BEGIN_NAMESPACE
@@ -67,7 +61,7 @@ class QAnimationState : public QState
{
Q_OBJECT
public:
- QAnimationState(QState *parent = 0);
+ QAnimationState(QState *parent = nullptr);
~QAnimationState();
void setAnimation(QAbstractAnimation *animation);
diff --git a/examples/widgets/animation/sub-attaq/states.cpp b/examples/widgets/animation/sub-attaq/states.cpp
index cda10ccdaf..c7e2738aad 100644
--- a/examples/widgets/animation/sub-attaq/states.cpp
+++ b/examples/widgets/animation/sub-attaq/states.cpp
@@ -59,12 +59,12 @@
#include "textinformationitem.h"
//Qt
-#include <QtWidgets/QMessageBox>
-#include <QtWidgets/QGraphicsView>
-#include <QtCore/QStateMachine>
-#include <QtWidgets/QKeyEventTransition>
-#include <QtCore/QFinalState>
-#include <QtCore/QRandomGenerator>
+#include <QFinalState>
+#include <QGraphicsView>
+#include <QKeyEventTransition>
+#include <QMessageBox>
+#include <QRandomGenerator>
+#include <QStateMachine>
PlayState::PlayState(GraphicsScene *scene, QState *parent)
: QState(parent), scene(scene), machine(nullptr),
@@ -146,7 +146,7 @@ void PlayState::onEntry(QEvent *)
machine->setInitialState(levelState);
//Final state
- QFinalState *final = new QFinalState(machine);
+ QFinalState *finalState = new QFinalState(machine);
//This transition is triggered when the player press space after completing a level
CustomSpaceTransition *spaceTransition = new CustomSpaceTransition(scene->views().at(0), this, QEvent::KeyPress, Qt::Key_Space);
@@ -154,7 +154,7 @@ void PlayState::onEntry(QEvent *)
winState->addTransition(spaceTransition);
//We lost we should reach the final state
- lostState->addTransition(lostState, &QState::finished, final);
+ lostState->addTransition(lostState, &QState::finished, finalState);
machine->start();
}
@@ -181,11 +181,9 @@ void LevelState::initializeLevel()
scene->progressItem->setScore(game->score);
scene->progressItem->setLevel(game->currentLevel + 1);
- GraphicsScene::LevelDescription currentLevelDescription = scene->levelsData.value(game->currentLevel);
+ const GraphicsScene::LevelDescription currentLevelDescription = scene->levelsData.value(game->currentLevel);
+ for (const QPair<int,int> &subContent : currentLevelDescription.submarines) {
- for (int i = 0; i < currentLevelDescription.submarines.size(); ++i ) {
-
- QPair<int,int> subContent = currentLevelDescription.submarines.at(i);
GraphicsScene::SubmarineDescription submarineDesc = scene->submarinesData.at(subContent.first);
for (int j = 0; j < subContent.second; ++j ) {
@@ -202,9 +200,10 @@ void LevelState::initializeLevel()
}
/** Pause State */
-PauseState::PauseState(GraphicsScene *scene, QState *parent) : QState(parent),scene(scene)
+PauseState::PauseState(GraphicsScene *scene, QState *parent) : QState(parent), scene(scene)
{
}
+
void PauseState::onEntry(QEvent *)
{
AnimationManager::self()->pauseAll();
@@ -324,8 +323,7 @@ bool WinTransition::eventTest(QEvent *event)
/** Space transition */
CustomSpaceTransition::CustomSpaceTransition(QWidget *widget, PlayState *game, QEvent::Type type, int key)
- : QKeyEventTransition(widget, type, key),
- game(game)
+ : QKeyEventTransition(widget, type, key), game(game)
{
}
diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h
index cd68e319c2..b3651e1c82 100644
--- a/examples/widgets/animation/sub-attaq/states.h
+++ b/examples/widgets/animation/sub-attaq/states.h
@@ -52,15 +52,11 @@
#define STATES_H
//Qt
-#include <QtCore/QState>
-#include <QtCore/QSignalTransition>
-#include <QtCore/QPropertyAnimation>
-#include <QtWidgets/QKeyEventTransition>
-#include <QtCore/QSet>
+#include <QKeyEventTransition>
+#include <QSignalTransition>
+#include <QState>
class GraphicsScene;
-class Boat;
-class SubMarine;
QT_BEGIN_NAMESPACE
class QStateMachine;
QT_END_NAMESPACE
@@ -68,7 +64,7 @@ QT_END_NAMESPACE
class PlayState : public QState
{
public:
- explicit PlayState(GraphicsScene *scene, QState *parent = 0);
+ explicit PlayState(GraphicsScene *scene, QState *parent = nullptr);
~PlayState();
protected:
@@ -92,7 +88,7 @@ private :
class LevelState : public QState
{
public:
- LevelState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
+ LevelState(GraphicsScene *scene, PlayState *game, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
private :
@@ -104,7 +100,7 @@ private :
class PauseState : public QState
{
public:
- explicit PauseState(GraphicsScene *scene, QState *parent = 0);
+ explicit PauseState(GraphicsScene *scene, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
@@ -116,7 +112,7 @@ private :
class LostState : public QState
{
public:
- LostState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
+ LostState(GraphicsScene *scene, PlayState *game, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
@@ -129,7 +125,7 @@ private :
class WinState : public QState
{
public:
- WinState(GraphicsScene *scene, PlayState *game, QState *parent = 0);
+ WinState(GraphicsScene *scene, PlayState *game, QState *parent = nullptr);
protected:
void onEntry(QEvent *) override;
@@ -154,7 +150,7 @@ public:
protected:
bool eventTest(QEvent *event) override;
private:
- PlayState * game;
+ PlayState *game;
GraphicsScene *scene;
};
@@ -166,7 +162,7 @@ public:
protected:
bool eventTest(QEvent *event) override;
private:
- PlayState * game;
+ PlayState *game;
GraphicsScene *scene;
};
diff --git a/examples/widgets/animation/sub-attaq/submarine.cpp b/examples/widgets/animation/sub-attaq/submarine.cpp
index 775e75ceed..a4ca376045 100644
--- a/examples/widgets/animation/sub-attaq/submarine.cpp
+++ b/examples/widgets/animation/sub-attaq/submarine.cpp
@@ -52,15 +52,14 @@
#include "submarine.h"
#include "submarine_p.h"
#include "torpedo.h"
-#include "pixmapitem.h"
#include "graphicsscene.h"
#include "animationmanager.h"
#include "qanimationstate.h"
-#include <QtCore/QPropertyAnimation>
-#include <QtCore/QStateMachine>
-#include <QtCore/QFinalState>
-#include <QtCore/QSequentialAnimationGroup>
+#include <QFinalState>
+#include <QPropertyAnimation>
+#include <QStateMachine>
+#include <QSequentialAnimationGroup>
static QAbstractAnimation *setupDestroyAnimation(SubMarine *sub)
{
@@ -86,9 +85,8 @@ SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QSt
graphicsRotation = new QGraphicsRotation(this);
graphicsRotation->setAxis(Qt::YAxis);
- graphicsRotation->setOrigin(QVector3D(size().width()/2, size().height()/2, 0));
- QList<QGraphicsTransform *> r;
- r.append(graphicsRotation);
+ graphicsRotation->setOrigin(QVector3D(size().width() / 2, size().height() / 2, 0));
+ QList<QGraphicsTransform *> r({graphicsRotation});
setTransformations(r);
//We setup the state machine of the submarine
@@ -112,7 +110,7 @@ SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QSt
machine->setInitialState(moving);
//End
- QFinalState *final = new QFinalState(machine);
+ QFinalState *finalState = new QFinalState(machine);
//If the moving animation is finished we move to the return state
movement->addTransition(movement, &QAnimationState::animationFinished, rotation);
@@ -128,7 +126,7 @@ SubMarine::SubMarine(int type, const QString &name, int points) : PixmapItem(QSt
moving->addTransition(this, &SubMarine::subMarineDestroyed, destroyedState);
//Transition to final state when the destroyed animation is finished
- destroyedState->addTransition(destroyedState, &QAnimationState::animationFinished, final);
+ destroyedState->addTransition(destroyedState, &QAnimationState::animationFinished, finalState);
//The machine has finished to be executed, then the submarine is dead
connect(machine,&QState::finished,this, &SubMarine::subMarineExecutionFinished);
@@ -145,9 +143,8 @@ void SubMarine::setCurrentDirection(SubMarine::Movement direction)
{
if (this->direction == direction)
return;
- if (direction == SubMarine::Right && this->direction == SubMarine::None) {
+ if (direction == SubMarine::Right && this->direction == SubMarine::None)
graphicsRotation->setAngle(180);
- }
this->direction = direction;
}
@@ -158,9 +155,8 @@ enum SubMarine::Movement SubMarine::currentDirection() const
void SubMarine::setCurrentSpeed(int speed)
{
- if (speed < 0 || speed > 3) {
+ if (speed < 0 || speed > 3)
qWarning("SubMarine::setCurrentSpeed : The speed is invalid");
- }
this->speed = speed;
emit subMarineStateChanged();
}
@@ -172,7 +168,7 @@ int SubMarine::currentSpeed() const
void SubMarine::launchTorpedo(int speed)
{
- Torpedo * torp = new Torpedo();
+ Torpedo *torp = new Torpedo;
GraphicsScene *scene = static_cast<GraphicsScene *>(this->scene());
scene->addItem(torp);
torp->setPos(pos());
diff --git a/examples/widgets/animation/sub-attaq/submarine.h b/examples/widgets/animation/sub-attaq/submarine.h
index d145c9cbee..256683ec70 100644
--- a/examples/widgets/animation/sub-attaq/submarine.h
+++ b/examples/widgets/animation/sub-attaq/submarine.h
@@ -48,15 +48,12 @@
**
****************************************************************************/
-#ifndef __SUBMARINE__H__
-#define __SUBMARINE__H__
-
-//Qt
-#include <QtWidgets/QGraphicsTransform>
+#ifndef SUBMARINE_H
+#define SUBMARINE_H
#include "pixmapitem.h"
-class Torpedo;
+#include <QGraphicsRotation>
class SubMarine : public PixmapItem
{
@@ -99,4 +96,4 @@ private:
QGraphicsRotation *graphicsRotation;
};
-#endif //__SUBMARINE__H__
+#endif // SUBMARINE_H
diff --git a/examples/widgets/animation/sub-attaq/submarine_p.h b/examples/widgets/animation/sub-attaq/submarine_p.h
index 1c2cb7ceac..36807dade3 100644
--- a/examples/widgets/animation/sub-attaq/submarine_p.h
+++ b/examples/widgets/animation/sub-attaq/submarine_p.h
@@ -68,16 +68,15 @@
#include "qanimationstate.h"
//Qt
-#include <QtCore/QPropertyAnimation>
-#include <QtCore/QRandomGenerator>
-#include <QtWidgets/QGraphicsScene>
+#include <QPropertyAnimation>
+#include <QRandomGenerator>
//This state is describing when the boat is moving right
class MovementState : public QAnimationState
{
Q_OBJECT
public:
- explicit MovementState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent)
+ explicit MovementState(SubMarine *submarine, QState *parent = nullptr) : QAnimationState(parent)
{
movementAnimation = new QPropertyAnimation(submarine, "pos");
connect(movementAnimation, &QPropertyAnimation::valueChanged,
@@ -117,7 +116,7 @@ private:
class ReturnState : public QAnimationState
{
public:
- explicit ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent)
+ explicit ReturnState(SubMarine *submarine, QState *parent = nullptr) : QAnimationState(parent)
{
returnAnimation = new QPropertyAnimation(submarine->rotation(), "angle");
returnAnimation->setDuration(500);
diff --git a/examples/widgets/animation/sub-attaq/textinformationitem.cpp b/examples/widgets/animation/sub-attaq/textinformationitem.cpp
index 16f787125d..4d4934f63d 100644
--- a/examples/widgets/animation/sub-attaq/textinformationitem.cpp
+++ b/examples/widgets/animation/sub-attaq/textinformationitem.cpp
@@ -50,14 +50,15 @@
#include "textinformationitem.h"
#include "pixmapitem.h"
-TextInformationItem::TextInformationItem (QGraphicsItem * parent)
+TextInformationItem::TextInformationItem (QGraphicsItem *parent)
: QGraphicsTextItem(parent)
{
setFont(QFont("Comic Sans MS", 15));
}
-#include <QDebug>
-void TextInformationItem::setMessage(const QString& text)
+
+void TextInformationItem::setMessage(const QString &text)
{
setHtml(text);
- setPos(parentItem()->boundingRect().center().x() - boundingRect().size().width()/2 , parentItem()->boundingRect().center().y());
+ setPos(parentItem()->boundingRect().center().x() - boundingRect().size().width() / 2,
+ parentItem()->boundingRect().center().y());
}
diff --git a/examples/widgets/animation/sub-attaq/textinformationitem.h b/examples/widgets/animation/sub-attaq/textinformationitem.h
index aa6f913e48..0a0b618460 100644
--- a/examples/widgets/animation/sub-attaq/textinformationitem.h
+++ b/examples/widgets/animation/sub-attaq/textinformationitem.h
@@ -52,13 +52,13 @@
#define TEXTINFORMATIONITEM_H
//Qt
-#include <QtWidgets/QGraphicsTextItem>
+#include <QGraphicsTextItem>
class TextInformationItem : public QGraphicsTextItem
{
public:
- TextInformationItem(QGraphicsItem * parent = 0);
- void setMessage(const QString& text);
+ TextInformationItem(QGraphicsItem *parent = nullptr);
+ void setMessage(const QString &text);
};
#endif // TEXTINFORMATIONITEM_H
diff --git a/examples/widgets/animation/sub-attaq/torpedo.cpp b/examples/widgets/animation/sub-attaq/torpedo.cpp
index 92a3833452..7395aa39ac 100644
--- a/examples/widgets/animation/sub-attaq/torpedo.cpp
+++ b/examples/widgets/animation/sub-attaq/torpedo.cpp
@@ -50,15 +50,14 @@
//Own
#include "torpedo.h"
-#include "pixmapitem.h"
#include "boat.h"
#include "graphicsscene.h"
#include "animationmanager.h"
#include "qanimationstate.h"
-#include <QtCore/QPropertyAnimation>
-#include <QtCore/QStateMachine>
-#include <QtCore/QFinalState>
+#include <QPropertyAnimation>
+#include <QStateMachine>
+#include <QFinalState>
Torpedo::Torpedo() : PixmapItem(QString::fromLatin1("torpedo"),GraphicsScene::Big),
currentSpeed(0)
@@ -70,11 +69,11 @@ void Torpedo::launch()
{
QPropertyAnimation *launchAnimation = new QPropertyAnimation(this, "pos");
AnimationManager::self()->registerAnimation(launchAnimation);
- launchAnimation->setEndValue(QPointF(x(),qobject_cast<GraphicsScene *>(scene())->sealLevel() - 15));
+ launchAnimation->setEndValue(QPointF(x(), qobject_cast<GraphicsScene *>(scene())->sealLevel() - 15));
launchAnimation->setEasingCurve(QEasingCurve::InQuad);
- launchAnimation->setDuration(y()/currentSpeed*10);
- connect(launchAnimation,&QVariantAnimation::valueChanged,this,&Torpedo::onAnimationLaunchValueChanged);
- connect(this,&Torpedo::torpedoExploded, launchAnimation, &QAbstractAnimation::stop);
+ launchAnimation->setDuration(y() / currentSpeed * 10);
+ connect(launchAnimation, &QVariantAnimation::valueChanged, this, &Torpedo::onAnimationLaunchValueChanged);
+ connect(this, &Torpedo::torpedoExploded, launchAnimation, &QAbstractAnimation::stop);
//We setup the state machine of the torpedo
QStateMachine *machine = new QStateMachine(this);
@@ -84,18 +83,18 @@ void Torpedo::launch()
launched->setAnimation(launchAnimation);
//End
- QFinalState *final = new QFinalState(machine);
+ QFinalState *finalState = new QFinalState(machine);
machine->setInitialState(launched);
//### Add a nice animation when the torpedo is destroyed
- launched->addTransition(this, &Torpedo::torpedoExploded,final);
+ launched->addTransition(this, &Torpedo::torpedoExploded, finalState);
//If the animation is finished, then we move to the final state
- launched->addTransition(launched, &QAnimationState::animationFinished, final);
+ launched->addTransition(launched, &QAnimationState::animationFinished, finalState);
//The machine has finished to be executed, then the boat is dead
- connect(machine,&QState::finished,this, &Torpedo::torpedoExecutionFinished);
+ connect(machine, &QState::finished, this, &Torpedo::torpedoExecutionFinished);
machine->start();
}
diff --git a/examples/widgets/animation/sub-attaq/torpedo.h b/examples/widgets/animation/sub-attaq/torpedo.h
index bd04bd79aa..7ac853d4e9 100644
--- a/examples/widgets/animation/sub-attaq/torpedo.h
+++ b/examples/widgets/animation/sub-attaq/torpedo.h
@@ -48,8 +48,8 @@
**
****************************************************************************/
-#ifndef __TORPEDO__H__
-#define __TORPEDO__H__
+#ifndef TORPEDO_H
+#define TORPEDO_H
#include "pixmapitem.h"
@@ -73,4 +73,4 @@ private:
int currentSpeed;
};
-#endif //__TORPEDO__H__
+#endif // TORPEDO_H
diff --git a/examples/widgets/desktop/screenshot/main.cpp b/examples/widgets/desktop/screenshot/main.cpp
index 825c40b236..96b0d57daa 100644
--- a/examples/widgets/desktop/screenshot/main.cpp
+++ b/examples/widgets/desktop/screenshot/main.cpp
@@ -49,7 +49,7 @@
****************************************************************************/
#include <QApplication>
-#include <QDesktopWidget>
+#include <QScreen>
#include "screenshot.h"
@@ -58,7 +58,8 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
Screenshot screenshot;
- screenshot.move(QApplication::desktop()->availableGeometry(&screenshot).topLeft() + QPoint(20, 20));
+ screenshot.move(screenshot.screen()->availableGeometry().topLeft() + QPoint(20, 20));
screenshot.show();
+
return app.exec();
}
diff --git a/examples/widgets/desktop/screenshot/screenshot.cpp b/examples/widgets/desktop/screenshot/screenshot.cpp
index 715e6c780e..ce5597bbdd 100644
--- a/examples/widgets/desktop/screenshot/screenshot.cpp
+++ b/examples/widgets/desktop/screenshot/screenshot.cpp
@@ -59,7 +59,7 @@ Screenshot::Screenshot()
screenshotLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
screenshotLabel->setAlignment(Qt::AlignCenter);
- const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ const QRect screenGeometry = screen()->geometry();
screenshotLabel->setMinimumSize(screenGeometry.width() / 8, screenGeometry.height() / 8);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
diff --git a/examples/widgets/dialogs/classwizard/classwizard.cpp b/examples/widgets/dialogs/classwizard/classwizard.cpp
index 81adf85b0d..8421289eab 100644
--- a/examples/widgets/dialogs/classwizard/classwizard.cpp
+++ b/examples/widgets/dialogs/classwizard/classwizard.cpp
@@ -118,9 +118,9 @@ void ClassWizard::accept()
block += "public:\n";
if (field("qobjectCtor").toBool()) {
- block += " " + className + "(QObject *parent = 0);\n";
+ block += " " + className + "(QObject *parent = nullptr);\n";
} else if (field("qwidgetCtor").toBool()) {
- block += " " + className + "(QWidget *parent = 0);\n";
+ block += " " + className + "(QWidget *parent = nullptr);\n";
} else if (field("defaultCtor").toBool()) {
block += " " + className + "();\n";
if (field("copyCtor").toBool()) {
diff --git a/examples/widgets/dialogs/classwizard/classwizard.h b/examples/widgets/dialogs/classwizard/classwizard.h
index fee0f6df66..0c386f0553 100644
--- a/examples/widgets/dialogs/classwizard/classwizard.h
+++ b/examples/widgets/dialogs/classwizard/classwizard.h
@@ -67,7 +67,7 @@ class ClassWizard : public QWizard
Q_OBJECT
public:
- ClassWizard(QWidget *parent = 0);
+ ClassWizard(QWidget *parent = nullptr);
void accept() override;
};
@@ -79,7 +79,7 @@ class IntroPage : public QWizardPage
Q_OBJECT
public:
- IntroPage(QWidget *parent = 0);
+ IntroPage(QWidget *parent = nullptr);
private:
QLabel *label;
@@ -92,7 +92,7 @@ class ClassInfoPage : public QWizardPage
Q_OBJECT
public:
- ClassInfoPage(QWidget *parent = 0);
+ ClassInfoPage(QWidget *parent = nullptr);
private:
QLabel *classNameLabel;
@@ -114,7 +114,7 @@ class CodeStylePage : public QWizardPage
Q_OBJECT
public:
- CodeStylePage(QWidget *parent = 0);
+ CodeStylePage(QWidget *parent = nullptr);
protected:
void initializePage() override;
@@ -135,7 +135,7 @@ class OutputFilesPage : public QWizardPage
Q_OBJECT
public:
- OutputFilesPage(QWidget *parent = 0);
+ OutputFilesPage(QWidget *parent = nullptr);
protected:
void initializePage() override;
@@ -154,7 +154,7 @@ class ConclusionPage : public QWizardPage
Q_OBJECT
public:
- ConclusionPage(QWidget *parent = 0);
+ ConclusionPage(QWidget *parent = nullptr);
protected:
void initializePage() override;
diff --git a/examples/widgets/dialogs/extension/finddialog.h b/examples/widgets/dialogs/extension/finddialog.h
index 858e1c929b..9b4b5b5f3d 100644
--- a/examples/widgets/dialogs/extension/finddialog.h
+++ b/examples/widgets/dialogs/extension/finddialog.h
@@ -68,7 +68,7 @@ class FindDialog : public QDialog
Q_OBJECT
public:
- FindDialog(QWidget *parent = 0);
+ FindDialog(QWidget *parent = nullptr);
private:
QLabel *label;
diff --git a/examples/widgets/dialogs/findfiles/window.h b/examples/widgets/dialogs/findfiles/window.h
index 949df704bb..b74ba5e70c 100644
--- a/examples/widgets/dialogs/findfiles/window.h
+++ b/examples/widgets/dialogs/findfiles/window.h
@@ -68,7 +68,7 @@ class Window : public QWidget
Q_OBJECT
public:
- Window(QWidget *parent = 0);
+ Window(QWidget *parent = nullptr);
private slots:
void browse();
diff --git a/examples/widgets/dialogs/licensewizard/licensewizard.h b/examples/widgets/dialogs/licensewizard/licensewizard.h
index c7709d88b3..e2890e484f 100644
--- a/examples/widgets/dialogs/licensewizard/licensewizard.h
+++ b/examples/widgets/dialogs/licensewizard/licensewizard.h
@@ -72,7 +72,7 @@ public:
Page_Conclusion };
//! [2]
- LicenseWizard(QWidget *parent = 0);
+ LicenseWizard(QWidget *parent = nullptr);
private slots:
void showHelp();
@@ -86,7 +86,7 @@ class IntroPage : public QWizardPage
Q_OBJECT
public:
- IntroPage(QWidget *parent = 0);
+ IntroPage(QWidget *parent = nullptr);
int nextId() const override;
@@ -103,7 +103,7 @@ class EvaluatePage : public QWizardPage
Q_OBJECT
public:
- EvaluatePage(QWidget *parent = 0);
+ EvaluatePage(QWidget *parent = nullptr);
int nextId() const override;
@@ -120,7 +120,7 @@ class RegisterPage : public QWizardPage
Q_OBJECT
public:
- RegisterPage(QWidget *parent = 0);
+ RegisterPage(QWidget *parent = nullptr);
int nextId() const override;
@@ -136,7 +136,7 @@ class DetailsPage : public QWizardPage
Q_OBJECT
public:
- DetailsPage(QWidget *parent = 0);
+ DetailsPage(QWidget *parent = nullptr);
int nextId() const override;
@@ -155,7 +155,7 @@ class ConclusionPage : public QWizardPage
Q_OBJECT
public:
- ConclusionPage(QWidget *parent = 0);
+ ConclusionPage(QWidget *parent = nullptr);
void initializePage() override;
int nextId() const override;
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.cpp b/examples/widgets/dialogs/standarddialogs/dialog.cpp
index 1830b21e8f..df77d03567 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.cpp
+++ b/examples/widgets/dialogs/standarddialogs/dialog.cpp
@@ -287,7 +287,6 @@ Dialog::Dialog(QWidget *parent)
fileDialogOptionsWidget->addCheckBox(tr("Show directories only"), QFileDialog::ShowDirsOnly);
fileDialogOptionsWidget->addCheckBox(tr("Do not resolve symlinks"), QFileDialog::DontResolveSymlinks);
fileDialogOptionsWidget->addCheckBox(tr("Do not confirm overwrite"), QFileDialog::DontConfirmOverwrite);
- fileDialogOptionsWidget->addCheckBox(tr("Do not use sheet"), QFileDialog::DontUseSheet);
fileDialogOptionsWidget->addCheckBox(tr("Readonly"), QFileDialog::ReadOnly);
fileDialogOptionsWidget->addCheckBox(tr("Hide name filter details"), QFileDialog::HideNameFilterDetails);
fileDialogOptionsWidget->addCheckBox(tr("Do not use custom directory icons (Windows)"), QFileDialog::DontUseCustomDirectoryIcons);
@@ -318,7 +317,7 @@ void Dialog::setInteger()
{
//! [0]
bool ok;
- int i = QInputDialog::getInt(this, tr("QInputDialog::getInteger()"),
+ int i = QInputDialog::getInt(this, tr("QInputDialog::getInt()"),
tr("Percentage:"), 25, 0, 100, 1, &ok);
if (ok)
integerLabel->setText(tr("%1%").arg(i));
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.h b/examples/widgets/dialogs/standarddialogs/dialog.h
index 0d1c8d3e54..6d9cbdc07a 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.h
+++ b/examples/widgets/dialogs/standarddialogs/dialog.h
@@ -66,7 +66,7 @@ class Dialog : public QWidget
Q_OBJECT
public:
- Dialog(QWidget *parent = 0);
+ Dialog(QWidget *parent = nullptr);
private slots:
void setInteger();
diff --git a/examples/widgets/dialogs/standarddialogs/main.cpp b/examples/widgets/dialogs/standarddialogs/main.cpp
index f7417f0e45..19ed2bf66f 100644
--- a/examples/widgets/dialogs/standarddialogs/main.cpp
+++ b/examples/widgets/dialogs/standarddialogs/main.cpp
@@ -49,8 +49,8 @@
****************************************************************************/
#include <QApplication>
+#include <QScreen>
#include <QStyleHints>
-#include <QDesktopWidget>
#include <QTranslator>
#include <QLocale>
#include <QLibraryInfo>
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
Dialog dialog;
if (!QGuiApplication::styleHints()->showIsFullScreen() && !QGuiApplication::styleHints()->showIsMaximized()) {
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(&dialog);
+ const QRect availableGeometry = dialog.screen()->availableGeometry();
dialog.resize(availableGeometry.width() / 3, availableGeometry.height() * 2 / 3);
dialog.move((availableGeometry.width() - dialog.width()) / 2,
(availableGeometry.height() - dialog.height()) / 2);
diff --git a/examples/widgets/dialogs/tabdialog/tabdialog.h b/examples/widgets/dialogs/tabdialog/tabdialog.h
index 2db47c9ddd..b7c6c5b8da 100644
--- a/examples/widgets/dialogs/tabdialog/tabdialog.h
+++ b/examples/widgets/dialogs/tabdialog/tabdialog.h
@@ -65,7 +65,7 @@ class GeneralTab : public QWidget
Q_OBJECT
public:
- explicit GeneralTab(const QFileInfo &fileInfo, QWidget *parent = 0);
+ explicit GeneralTab(const QFileInfo &fileInfo, QWidget *parent = nullptr);
};
//! [0]
@@ -76,7 +76,7 @@ class PermissionsTab : public QWidget
Q_OBJECT
public:
- explicit PermissionsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
+ explicit PermissionsTab(const QFileInfo &fileInfo, QWidget *parent = nullptr);
};
//! [1]
@@ -87,7 +87,7 @@ class ApplicationsTab : public QWidget
Q_OBJECT
public:
- explicit ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent = 0);
+ explicit ApplicationsTab(const QFileInfo &fileInfo, QWidget *parent = nullptr);
};
//! [2]
@@ -98,7 +98,7 @@ class TabDialog : public QDialog
Q_OBJECT
public:
- explicit TabDialog(const QString &fileName, QWidget *parent = 0);
+ explicit TabDialog(const QString &fileName, QWidget *parent = nullptr);
private:
QTabWidget *tabWidget;
diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc
index 040aa171b7..6c37fa67bb 100644
--- a/examples/widgets/doc/src/application.qdoc
+++ b/examples/widgets/doc/src/application.qdoc
@@ -327,9 +327,12 @@
\snippet mainwindows/application/mainwindow.cpp 44
\snippet mainwindows/application/mainwindow.cpp 45
- Saving a file is very similar to loading one. Here, the
- QFile::Text flag ensures that on Windows, "\\n" is converted into
- "\\r\\n" to conform to the Windows convension.
+ Saving a file is similar to loading one. We use QSaveFile to ensure
+ all data are safely written and existing files are not damaged
+ should writing fail.
+ We use the QFile::Text flag to make sure that on Windows, "\\n"
+ is converted into "\\r\\n" to conform to the Windows convention.
+
\snippet mainwindows/application/mainwindow.cpp 46
\snippet mainwindows/application/mainwindow.cpp 47
diff --git a/examples/widgets/doc/src/calculator.qdoc b/examples/widgets/doc/src/calculator.qdoc
index e8f8030207..7d34a86c19 100644
--- a/examples/widgets/doc/src/calculator.qdoc
+++ b/examples/widgets/doc/src/calculator.qdoc
@@ -142,6 +142,9 @@
pendingAdditiveOperator and \c pendingMultiplicativeOperator
variables don't need to be initialized explicitly, because the
QString constructor initializes them to empty strings.
+ It is also possible to initialize those variable directly in the
+ header. This is called \c member-initializaton and avoids a long
+ initialization list.
\snippet widgets/calculator/calculator.cpp 1
\snippet widgets/calculator/calculator.cpp 2
diff --git a/examples/widgets/doc/src/collidingmice-example.qdoc b/examples/widgets/doc/src/collidingmice-example.qdoc
index 657c416218..984d3244f9 100644
--- a/examples/widgets/doc/src/collidingmice-example.qdoc
+++ b/examples/widgets/doc/src/collidingmice-example.qdoc
@@ -75,7 +75,8 @@
\section1 Mouse Class Definition
When constructing a mouse item, we first ensure that all the item's
- private variables are properly initialized:
+ private variables which were no yet initialized directly in the class
+ are properly initialized:
\snippet graphicsview/collidingmice/mouse.cpp 0
diff --git a/examples/widgets/doc/src/diagramscene.qdoc b/examples/widgets/doc/src/diagramscene.qdoc
index 860dcc5cb9..1a94d53162 100644
--- a/examples/widgets/doc/src/diagramscene.qdoc
+++ b/examples/widgets/doc/src/diagramscene.qdoc
@@ -643,7 +643,9 @@
This function is called when the item is removed from the scene
and removes all arrows that are connected to this item. The arrow
must be removed from the \c arrows list of both its start and end
- item.
+ item. Since either the start or the end item is the object where
+ this function is currently called, we have to make sure to work on
+ a copy of arrows since removeArrow() is modifying this container.
Here is the \c addArrow() function:
diff --git a/examples/widgets/doc/src/icons.qdoc b/examples/widgets/doc/src/icons.qdoc
index 60cb9062c2..7aae0491d6 100644
--- a/examples/widgets/doc/src/icons.qdoc
+++ b/examples/widgets/doc/src/icons.qdoc
@@ -262,12 +262,7 @@
provides arrays allowing to map from enumeration value to row/column
(by using QVector::indexOf()) and back by using the array index and lists
of the matching strings. Qt's containers can be easily populated by
- using C++ 11 initializer lists. If the compiler does not provide that feature,
- a pattern like
-
- \snippet widgets/icons/iconpreviewarea.cpp 43
-
- can be used.
+ using C++ 11 initializer lists.
We need two public functions to set the current icon and the
icon's size. In addition the class has three private functions: We
diff --git a/examples/widgets/doc/src/stardelegate.qdoc b/examples/widgets/doc/src/stardelegate.qdoc
index 0b91723a51..b33fa3550f 100644
--- a/examples/widgets/doc/src/stardelegate.qdoc
+++ b/examples/widgets/doc/src/stardelegate.qdoc
@@ -269,7 +269,7 @@
\codeline
\snippet itemviews/stardelegate/main.cpp 4
- Notice the call to qVariantFromValue to convert a \c
+ Notice the call to QVariant::fromValue to convert a \c
StarRating to a QVariant.
\section1 Possible Extensions and Suggestions
diff --git a/examples/widgets/doc/src/tooltips.qdoc b/examples/widgets/doc/src/tooltips.qdoc
index a278215503..35e3b1e29f 100644
--- a/examples/widgets/doc/src/tooltips.qdoc
+++ b/examples/widgets/doc/src/tooltips.qdoc
@@ -95,7 +95,7 @@
\snippet widgets/tooltips/sortingbox.h 2
- We keep all the shape items in a QList, and we keep three
+ We keep all the shape items in a QVector, and we keep three
QPainterPath objects holding the shapes of a circle, a square and
a triangle. We also need to have a pointer to an item when it is
moving, and we need to know its previous position.
diff --git a/examples/widgets/effects/blurpicker/blurpicker.h b/examples/widgets/effects/blurpicker/blurpicker.h
index 3f444419a8..dc7fc4dabb 100644
--- a/examples/widgets/effects/blurpicker/blurpicker.h
+++ b/examples/widgets/effects/blurpicker/blurpicker.h
@@ -63,7 +63,7 @@ class BlurPicker: public QGraphicsView
Q_PROPERTY(qreal index READ index WRITE setIndex)
public:
- BlurPicker(QWidget *parent = 0);
+ BlurPicker(QWidget *parent = nullptr);
qreal index() const;
void setIndex(qreal);
diff --git a/examples/widgets/effects/fademessage/fademessage.h b/examples/widgets/effects/fademessage/fademessage.h
index d17a1616ce..4d84c4ed21 100644
--- a/examples/widgets/effects/fademessage/fademessage.h
+++ b/examples/widgets/effects/fademessage/fademessage.h
@@ -62,7 +62,7 @@ class FadeMessage: public QGraphicsView
Q_OBJECT
public:
- FadeMessage(QWidget *parent = 0);
+ FadeMessage(QWidget *parent = nullptr);
private:
void setupScene();
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.cpp b/examples/widgets/gestures/imagegestures/imagewidget.cpp
index 0a6b963559..fb5351f949 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.cpp
+++ b/examples/widgets/gestures/imagegestures/imagewidget.cpp
@@ -50,26 +50,23 @@
#include "imagewidget.h"
-#include <QtWidgets>
+#include <QDir>
+#include <QImageReader>
+#include <QGestureEvent>
+#include <QPainter>
Q_LOGGING_CATEGORY(lcExample, "qt.examples.imagegestures")
//! [constructor]
ImageWidget::ImageWidget(QWidget *parent)
- : QWidget(parent),
- position(0),
- horizontalOffset(0),
- verticalOffset(0),
- rotationAngle(0),
- scaleFactor(1),
- currentStepScaleFactor(1)
-
+ : QWidget(parent), position(0), horizontalOffset(0), verticalOffset(0)
+ , rotationAngle(0), scaleFactor(1), currentStepScaleFactor(1)
{
- setMinimumSize(QSize(100,100));
+ setMinimumSize(QSize(100, 100));
}
//! [constructor]
-void ImageWidget::grabGestures(const QList<Qt::GestureType> &gestures)
+void ImageWidget::grabGestures(const QVector<Qt::GestureType> &gestures)
{
//! [enable gestures]
for (Qt::GestureType gesture : gestures)
@@ -96,11 +93,11 @@ void ImageWidget::paintEvent(QPaintEvent*)
const qreal wh = height();
const qreal ww = width();
- p.translate(ww/2, wh/2);
+ p.translate(ww / 2, wh / 2);
p.translate(horizontalOffset, verticalOffset);
p.rotate(rotationAngle);
p.scale(currentStepScaleFactor * scaleFactor, currentStepScaleFactor * scaleFactor);
- p.translate(-iw/2, -ih/2);
+ p.translate(-iw / 2, -ih / 2);
p.drawImage(0, 0, currentImage);
}
//! [paint method]
@@ -198,8 +195,7 @@ void ImageWidget::openDirectory(const QString &path)
{
this->path = path;
QDir dir(path);
- QStringList nameFilters;
- nameFilters << "*.jpg" << "*.png";
+ const QStringList nameFilters{"*.jpg", "*.png"};
files = dir.entryList(nameFilters, QDir::Files|QDir::Readable, QDir::Name);
position = 0;
@@ -207,7 +203,7 @@ void ImageWidget::openDirectory(const QString &path)
update();
}
-QImage ImageWidget::loadImage(const QString &fileName)
+QImage ImageWidget::loadImage(const QString &fileName) const
{
QImageReader reader(fileName);
reader.setAutoTransform(true);
diff --git a/examples/widgets/gestures/imagegestures/imagewidget.h b/examples/widgets/gestures/imagegestures/imagewidget.h
index 5e92541067..ae5eb7bc2b 100644
--- a/examples/widgets/gestures/imagegestures/imagewidget.h
+++ b/examples/widgets/gestures/imagegestures/imagewidget.h
@@ -51,9 +51,9 @@
#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H
-#include <QWidget>
#include <QImage>
-#include <QtWidgets>
+#include <QLoggingCategory>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QGestureEvent;
@@ -70,9 +70,9 @@ class ImageWidget : public QWidget
Q_OBJECT
public:
- ImageWidget(QWidget *parent = 0);
+ ImageWidget(QWidget *parent = nullptr);
void openDirectory(const QString &path);
- void grabGestures(const QList<Qt::GestureType> &gestures);
+ void grabGestures(const QVector<Qt::GestureType> &gestures);
protected:
bool event(QEvent *event) override;
@@ -87,7 +87,7 @@ private:
void swipeTriggered(QSwipeGesture*);
//! [class definition begin]
- QImage loadImage(const QString &fileName);
+ QImage loadImage(const QString &fileName) const;
void loadImage();
void goNextImage();
void goPrevImage();
diff --git a/examples/widgets/gestures/imagegestures/main.cpp b/examples/widgets/gestures/imagegestures/main.cpp
index ecd7462bd3..4f8d4ec15e 100644
--- a/examples/widgets/gestures/imagegestures/main.cpp
+++ b/examples/widgets/gestures/imagegestures/main.cpp
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
return -1;
}
- QList<Qt::GestureType> gestures;
+ QVector<Qt::GestureType> gestures;
if (!commandLineParser.isSet(disablePanOption))
gestures << Qt::PanGesture;
if (!commandLineParser.isSet(disablePinchOption))
diff --git a/examples/widgets/gestures/imagegestures/mainwidget.cpp b/examples/widgets/gestures/imagegestures/mainwidget.cpp
index c4e63e9e7d..d1c786a93a 100644
--- a/examples/widgets/gestures/imagegestures/mainwidget.cpp
+++ b/examples/widgets/gestures/imagegestures/mainwidget.cpp
@@ -72,7 +72,7 @@ void MainWidget::openDirectory(const QString &path)
imageWidget->openDirectory(path);
}
-void MainWidget::grabGestures(const QList<Qt::GestureType> &gestures)
+void MainWidget::grabGestures(const QVector<Qt::GestureType> &gestures)
{
imageWidget->grabGestures(gestures);
}
diff --git a/examples/widgets/gestures/imagegestures/mainwidget.h b/examples/widgets/gestures/imagegestures/mainwidget.h
index f3763ffffc..1600597251 100644
--- a/examples/widgets/gestures/imagegestures/mainwidget.h
+++ b/examples/widgets/gestures/imagegestures/mainwidget.h
@@ -60,8 +60,8 @@ class MainWidget : public QMainWindow
Q_OBJECT
public:
- MainWidget(QWidget *parent = 0);
- void grabGestures(const QList<Qt::GestureType> &gestures);
+ MainWidget(QWidget *parent = nullptr);
+ void grabGestures(const QVector<Qt::GestureType> &gestures);
public slots:
void openDirectory(const QString &path);
diff --git a/examples/widgets/graphicsview/anchorlayout/main.cpp b/examples/widgets/graphicsview/anchorlayout/main.cpp
index 59ced72018..98dacfb5fb 100644
--- a/examples/widgets/graphicsview/anchorlayout/main.cpp
+++ b/examples/widgets/graphicsview/anchorlayout/main.cpp
@@ -88,7 +88,7 @@ int main(int argc, char **argv)
QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout;
l->setSpacing(0);
- QGraphicsWidget *w = new QGraphicsWidget(0, Qt::Window);
+ QGraphicsWidget *w = new QGraphicsWidget(nullptr, Qt::Window);
w->setPos(20, 20);
w->setLayout(l);
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp
index 804db2f9be..2fbc232b20 100644
--- a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.cpp
@@ -51,33 +51,26 @@
#include "layoutitem.h"
#include <QGradient>
-#include <QGraphicsLinearLayout>
#include <QPainter>
//! [0]
-LayoutItem::LayoutItem(QGraphicsItem *parent/* = 0*/)
- : QGraphicsLayoutItem(), QGraphicsItem(parent)
+LayoutItem::LayoutItem(QGraphicsItem *parent)
+ : QGraphicsLayoutItem(), QGraphicsItem(parent),
+ m_pix(QPixmap(QLatin1String(":/images/block.png")))
{
- m_pix = new QPixmap(QLatin1String(":/images/block.png"));
setGraphicsItem(this);
}
//! [0]
-LayoutItem::~LayoutItem()
-{
- delete m_pix;
-}
-
//! [1]
-void LayoutItem::paint(QPainter *painter,
- const QStyleOptionGraphicsItem *option, QWidget *widget /*= 0*/)
+void LayoutItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
{
Q_UNUSED(widget);
Q_UNUSED(option);
- QRectF frame(QPointF(0,0), geometry().size());
- qreal w = m_pix->width();
- qreal h = m_pix->height();
+ QRectF frame(QPointF(0, 0), geometry().size());
+ const QSize pmSize = m_pix.size();
QGradientStops stops;
//! [1]
@@ -94,8 +87,8 @@ void LayoutItem::paint(QPainter *painter,
painter->drawRoundedRect(frame, 10.0, 10.0);
// paint a rect around the pixmap (with gradient)
- QPointF pixpos = frame.center() - (QPointF(w, h) / 2);
- QRectF innerFrame(pixpos, QSizeF(w, h));
+ QPointF pixpos = frame.center() - (QPointF(pmSize.width(), pmSize.height()) / 2);
+ QRectF innerFrame(pixpos, pmSize);
innerFrame.adjust(-4, -4, 4, 4);
gradient.setStart(innerFrame.topLeft());
gradient.setFinalStop(innerFrame.bottomRight());
@@ -106,14 +99,14 @@ void LayoutItem::paint(QPainter *painter,
gradient.setStops(stops);
painter->setBrush(QBrush(gradient));
painter->drawRoundedRect(innerFrame, 10.0, 10.0);
- painter->drawPixmap(pixpos, *m_pix);
+ painter->drawPixmap(pixpos, m_pix);
}
//! [2]
//! [3]
QRectF LayoutItem::boundingRect() const
{
- return QRectF(QPointF(0,0), geometry().size());
+ return QRectF(QPointF(0, 0), geometry().size());
}
//! [3]
@@ -133,7 +126,7 @@ QSizeF LayoutItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
case Qt::MinimumSize:
case Qt::PreferredSize:
// Do not allow a size smaller than the pixmap with two frames around it.
- return m_pix->size() + QSize(12, 12);
+ return m_pix.size() + QSize(12, 12);
case Qt::MaximumSize:
return QSizeF(1000,1000);
default:
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h
index 3535a26670..3dc431d513 100644
--- a/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/layoutitem.h
@@ -53,23 +53,24 @@
#include <QGraphicsLayoutItem>
#include <QGraphicsItem>
+#include <QPixmap>
//! [0]
class LayoutItem : public QGraphicsLayoutItem, public QGraphicsItem
{
public:
- LayoutItem(QGraphicsItem *parent = 0);
- ~LayoutItem();
+ LayoutItem(QGraphicsItem *parent = nullptr);
+
// Inherited from QGraphicsLayoutItem
void setGeometry(const QRectF &geom) override;
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
// Inherited from QGraphicsItem
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
private:
- QPixmap *m_pix;
+ QPixmap m_pix;
};
//! [0]
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/window.h b/examples/widgets/graphicsview/basicgraphicslayouts/window.h
index dfe04ed196..c46082e552 100644
--- a/examples/widgets/graphicsview/basicgraphicslayouts/window.h
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/window.h
@@ -54,11 +54,11 @@
#include <QGraphicsWidget>
//! [0]
-class Window : public QGraphicsWidget {
+class Window : public QGraphicsWidget
+{
Q_OBJECT
-
public:
- Window(QGraphicsWidget *parent = 0);
+ Window(QGraphicsWidget *parent = nullptr);
};
//! [0]
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.cpp b/examples/widgets/graphicsview/boxes/glbuffers.cpp
index b52b26c4ef..91de336af3 100644
--- a/examples/widgets/graphicsview/boxes/glbuffers.cpp
+++ b/examples/widgets/graphicsview/boxes/glbuffers.cpp
@@ -49,8 +49,6 @@
****************************************************************************/
#include "glbuffers.h"
-#include <QtGui/qmatrix4x4.h>
-#include <QtCore/qmath.h>
void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
{
@@ -65,7 +63,7 @@ void qgluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zF
// GLTexture //
//============================================================================//
-GLTexture::GLTexture() : m_texture(0), m_failed(false)
+GLTexture::GLTexture()
{
glGenTextures(1, &m_texture);
}
@@ -83,7 +81,7 @@ GLTexture2D::GLTexture2D(int width, int height)
{
glBindTexture(GL_TEXTURE_2D, m_texture);
glTexImage2D(GL_TEXTURE_2D, 0, 4, width, height, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, 0);
+ GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
@@ -95,7 +93,7 @@ GLTexture2D::GLTexture2D(int width, int height)
}
-GLTexture2D::GLTexture2D(const QString& fileName, int width, int height)
+GLTexture2D::GLTexture2D(const QString &fileName, int width, int height)
{
// TODO: Add error handling.
QImage image(fileName);
@@ -162,7 +160,7 @@ GLTexture3D::GLTexture3D(int width, int height, int depth)
glBindTexture(GL_TEXTURE_3D, m_texture);
glTexImage3D(GL_TEXTURE_3D, 0, 4, width, height, depth, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, 0);
+ GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_REPEAT);
@@ -206,7 +204,7 @@ GLTextureCube::GLTextureCube(int size)
for (int i = 0; i < 6; ++i)
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 4, size, size, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, 0);
+ GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
@@ -252,7 +250,7 @@ GLTextureCube::GLTextureCube(const QStringList &fileNames, int size)
// Clear remaining faces.
while (index < 6) {
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + index, 0, 4, size, size, 0,
- GL_BGRA, GL_UNSIGNED_BYTE, 0);
+ GL_BGRA, GL_UNSIGNED_BYTE, nullptr);
++index;
}
@@ -291,11 +289,8 @@ void GLTextureCube::unbind()
//============================================================================//
GLFrameBufferObject::GLFrameBufferObject(int width, int height)
- : m_fbo(0)
- , m_depthBuffer(0)
- , m_width(width)
+ : m_width(width)
, m_height(height)
- , m_failed(false)
{
GLBUFFERS_ASSERT_OPENGL("GLFrameBufferObject::GLFrameBufferObject",
glGenFramebuffersEXT && glGenRenderbuffersEXT && glBindRenderbufferEXT && glRenderbufferStorageEXT, return)
@@ -373,7 +368,7 @@ void GLRenderTargetCube::getViewMatrix(QMatrix4x4& mat, int face)
return;
}
- static int perm[6][3] = {
+ static constexpr int perm[6][3] = {
{2, 1, 0},
{2, 1, 0},
{0, 2, 1},
@@ -382,7 +377,7 @@ void GLRenderTargetCube::getViewMatrix(QMatrix4x4& mat, int face)
{0, 1, 2},
};
- static float signs[6][3] = {
+ static constexpr float signs[6][3] = {
{-1.0f, -1.0f, -1.0f},
{+1.0f, -1.0f, +1.0f},
{+1.0f, +1.0f, -1.0f},
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h
index e2363d561e..4318e8ac24 100644
--- a/examples/widgets/graphicsview/boxes/glbuffers.h
+++ b/examples/widgets/graphicsview/boxes/glbuffers.h
@@ -58,7 +58,7 @@
#include <QtOpenGL>
#define BUFFER_OFFSET(i) ((char*)0 + (i))
-#define SIZE_OF_MEMBER(cls, member) sizeof(static_cast<cls *>(0)->member)
+#define SIZE_OF_MEMBER(cls, member) sizeof(static_cast<cls *>(nullptr)->member)
#define GLBUFFERS_ASSERT_OPENGL(prefix, assertion, returnStatement) \
if (m_failed || !(assertion)) { \
@@ -82,8 +82,8 @@ public:
virtual void unbind() = 0;
virtual bool failed() const {return m_failed;}
protected:
- GLuint m_texture;
- bool m_failed;
+ GLuint m_texture = 0;
+ bool m_failed = false;
};
class GLFrameBufferObject
@@ -98,17 +98,17 @@ public:
virtual bool failed() const {return m_failed;}
protected:
void setAsRenderTarget(bool state = true);
- GLuint m_fbo;
- GLuint m_depthBuffer;
+ GLuint m_fbo = 0;
+ GLuint m_depthBuffer = 0;
int m_width, m_height;
- bool m_failed;
+ bool m_failed = false;
};
class GLTexture2D : public GLTexture
{
public:
GLTexture2D(int width, int height);
- explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0);
+ explicit GLTexture2D(const QString &fileName, int width = 0, int height = 0);
void load(int width, int height, QRgb *data);
void bind() override;
void unbind() override;
@@ -197,11 +197,7 @@ template<class T>
class GLVertexBuffer
{
public:
- GLVertexBuffer(int length, const T *data = 0, int mode = GL_STATIC_DRAW)
- : m_length(0)
- , m_mode(mode)
- , m_buffer(0)
- , m_failed(false)
+ GLVertexBuffer(int length, const T *data = nullptr, int mode = GL_STATIC_DRAW)
{
GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::GLVertexBuffer", glGenBuffers && glBindBuffer && glBufferData, return)
@@ -275,12 +271,12 @@ public:
T *lock()
{
- GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::lock", glBindBuffer && glMapBuffer, return 0)
+ GLBUFFERS_ASSERT_OPENGL("GLVertexBuffer::lock", glBindBuffer && glMapBuffer, return nullptr)
glBindBuffer(GL_ARRAY_BUFFER, m_buffer);
//glBufferData(GL_ARRAY_BUFFER, m_length, NULL, m_mode);
GLvoid* buffer = glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);
- m_failed = (buffer == 0);
+ m_failed = (buffer == nullptr);
return reinterpret_cast<T *>(buffer);
}
@@ -298,16 +294,17 @@ public:
}
private:
- int m_length, m_mode;
- GLuint m_buffer;
- bool m_failed;
+ int m_length = 0;
+ int m_mode = 0;
+ GLuint m_buffer = 0;
+ bool m_failed = false;
};
template<class T>
class GLIndexBuffer
{
public:
- GLIndexBuffer(int length, const T *data = 0, int mode = GL_STATIC_DRAW)
+ GLIndexBuffer(int length, const T *data = nullptr, int mode = GL_STATIC_DRAW)
: m_length(0)
, m_mode(mode)
, m_buffer(0)
@@ -345,11 +342,11 @@ public:
T *lock()
{
- GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::lock", glBindBuffer && glMapBuffer, return 0)
+ GLBUFFERS_ASSERT_OPENGL("GLIndexBuffer::lock", glBindBuffer && glMapBuffer, return nullptr)
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_buffer);
GLvoid* buffer = glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_READ_WRITE);
- m_failed = (buffer == 0);
+ m_failed = (buffer == nullptr);
return reinterpret_cast<T *>(buffer);
}
diff --git a/examples/widgets/graphicsview/boxes/gltrianglemesh.h b/examples/widgets/graphicsview/boxes/gltrianglemesh.h
index 716c4de62e..e5c4f51514 100644
--- a/examples/widgets/graphicsview/boxes/gltrianglemesh.h
+++ b/examples/widgets/graphicsview/boxes/gltrianglemesh.h
@@ -51,13 +51,12 @@
#ifndef GLTRIANGLEMESH_H
#define GLTRIANGLEMESH_H
-//#include <GL/glew.h>
+#include "glbuffers.h"
#include "glextensions.h"
#include <QtWidgets>
#include <QtOpenGL>
-#include "glbuffers.h"
template<class TVertex, class TIndex>
class GLTriangleMesh
diff --git a/examples/widgets/graphicsview/boxes/main.cpp b/examples/widgets/graphicsview/boxes/main.cpp
index b7242d529b..2b3e6d3389 100644
--- a/examples/widgets/graphicsview/boxes/main.cpp
+++ b/examples/widgets/graphicsview/boxes/main.cpp
@@ -48,13 +48,11 @@
**
****************************************************************************/
-//#include <GL/glew.h>
#include "glextensions.h"
-
#include "scene.h"
-#include <QtWidgets>
#include <QGLWidget>
+#include <QtWidgets>
class GraphicsView : public QGraphicsView
{
@@ -114,7 +112,7 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
if ((QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_5) == 0) {
- QMessageBox::critical(0, "OpenGL features missing",
+ QMessageBox::critical(nullptr, "OpenGL features missing",
"OpenGL version 1.5 or higher is required to run this demo.\n"
"The program will now exit.");
return -1;
@@ -125,7 +123,7 @@ int main(int argc, char **argv)
widget->makeCurrent();
if (!necessaryExtensionsSupported()) {
- QMessageBox::critical(0, "OpenGL features missing",
+ QMessageBox::critical(nullptr, "OpenGL features missing",
"The OpenGL extensions required to run this demo are missing.\n"
"The program will now exit.");
delete widget;
@@ -134,7 +132,7 @@ int main(int argc, char **argv)
// Check if all the necessary functions are resolved.
if (!getGLExtensionFunctions().resolve(widget->context())) {
- QMessageBox::critical(0, "OpenGL features missing",
+ QMessageBox::critical(nullptr, "OpenGL features missing",
"Failed to resolve OpenGL functions required to run this demo.\n"
"The program will now exit.");
delete widget;
@@ -142,7 +140,7 @@ int main(int argc, char **argv)
}
// TODO: Make conditional for final release
- QMessageBox::information(0, "For your information",
+ QMessageBox::information(nullptr, "For your information",
"This demo can be GPU and CPU intensive and may\n"
"work poorly or not at all on your system.");
diff --git a/examples/widgets/graphicsview/boxes/qtbox.cpp b/examples/widgets/graphicsview/boxes/qtbox.cpp
index 68d5c251f4..8713aac05d 100644
--- a/examples/widgets/graphicsview/boxes/qtbox.cpp
+++ b/examples/widgets/graphicsview/boxes/qtbox.cpp
@@ -50,28 +50,23 @@
#include "qtbox.h"
-const qreal ROTATE_SPEED_X = 30.0 / 1000.0;
-const qreal ROTATE_SPEED_Y = 20.0 / 1000.0;
-const qreal ROTATE_SPEED_Z = 40.0 / 1000.0;
-const int MAX_ITEM_SIZE = 512;
-const int MIN_ITEM_SIZE = 16;
+constexpr qreal ROTATE_SPEED_X = 30.0 / 1000.0;
+constexpr qreal ROTATE_SPEED_Y = 20.0 / 1000.0;
+constexpr qreal ROTATE_SPEED_Z = 40.0 / 1000.0;
+constexpr int MAX_ITEM_SIZE = 512;
+constexpr int MIN_ITEM_SIZE = 16;
//============================================================================//
// ItemBase //
//============================================================================//
-ItemBase::ItemBase(int size, int x, int y) : m_size(size), m_isResizing(false)
+ItemBase::ItemBase(int size, int x, int y) : m_size(size), m_startTime(QTime::currentTime())
{
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsFocusable, true);
setAcceptHoverEvents(true);
setPos(x, y);
- m_startTime = QTime::currentTime();
-}
-
-ItemBase::~ItemBase()
-{
}
QRectF ItemBase::boundingRect() const
@@ -252,10 +247,7 @@ void ItemBase::wheelEvent(QGraphicsSceneWheelEvent *event)
{
prepareGeometryChange();
m_size = int(m_size * qExp(-event->delta() / 600.0));
- if (m_size > MAX_ITEM_SIZE)
- m_size = MAX_ITEM_SIZE;
- else if (m_size < MIN_ITEM_SIZE)
- m_size = MIN_ITEM_SIZE;
+ m_size = qBound(MIN_ITEM_SIZE, m_size, MAX_ITEM_SIZE);
}
int ItemBase::type() const
@@ -273,7 +265,7 @@ bool ItemBase::isInResizeArea(const QPointF &pos)
// QtBox //
//============================================================================//
-QtBox::QtBox(int size, int x, int y) : ItemBase(size, x, y), m_texture(0)
+QtBox::QtBox(int size, int x, int y) : ItemBase(size, x, y)
{
for (int i = 0; i < 8; ++i) {
m_vertices[i].setX(i & 1 ? 0.5f : -0.5f);
@@ -294,8 +286,7 @@ QtBox::QtBox(int size, int x, int y) : ItemBase(size, x, y), m_texture(0)
QtBox::~QtBox()
{
- if (m_texture)
- delete m_texture;
+ delete m_texture;
}
ItemBase *QtBox::createNew(int size, int x, int y)
@@ -337,7 +328,7 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_NORMALIZE);
- if(m_texture == 0)
+ if (m_texture == nullptr)
m_texture = new GLTexture2D(":/res/boxes/qt-logo.jpg", 64, 64);
m_texture->bind();
glEnable(GL_TEXTURE_2D);
@@ -405,9 +396,8 @@ void QtBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWi
//============================================================================//
CircleItem::CircleItem(int size, int x, int y) : ItemBase(size, x, y)
-{
- m_color = QColor::fromHsv(QRandomGenerator::global()->bounded(360), 255, 255);
-}
+ , m_color(QColor::fromHsv(QRandomGenerator::global()->bounded(360), 255, 255))
+{}
void CircleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
@@ -455,9 +445,8 @@ ItemBase *CircleItem::createNew(int size, int x, int y)
//============================================================================//
SquareItem::SquareItem(int size, int x, int y) : ItemBase(size, x, y)
-{
- m_image = QPixmap(":/res/boxes/square.jpg");
-}
+ , m_image(QPixmap(":/res/boxes/square.jpg"))
+{}
void SquareItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
diff --git a/examples/widgets/graphicsview/boxes/qtbox.h b/examples/widgets/graphicsview/boxes/qtbox.h
index f8ee9bdb0a..84c8cb1d93 100644
--- a/examples/widgets/graphicsview/boxes/qtbox.h
+++ b/examples/widgets/graphicsview/boxes/qtbox.h
@@ -51,18 +51,17 @@
#ifndef QTBOX_H
#define QTBOX_H
-#include <QtWidgets>
-
-#include <QtGui/qvector3d.h>
#include "glbuffers.h"
+#include <QtWidgets>
+#include <QVector3D>
+
class ItemBase : public QGraphicsItem
{
public:
enum { Type = UserType + 1 };
ItemBase(int size, int x, int y);
- virtual ~ItemBase();
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
protected:
@@ -84,7 +83,7 @@ protected:
int m_size;
QTime m_startTime;
- bool m_isResizing;
+ bool m_isResizing = false;
};
class QtBox : public ItemBase
@@ -99,7 +98,7 @@ private:
QVector3D m_vertices[8];
QVector3D m_texCoords[4];
QVector3D m_normals[6];
- GLTexture *m_texture;
+ GLTexture *m_texture = nullptr;
};
class CircleItem : public ItemBase
diff --git a/examples/widgets/graphicsview/boxes/roundedbox.h b/examples/widgets/graphicsview/boxes/roundedbox.h
index ebc2dbd36e..a1f15cd631 100644
--- a/examples/widgets/graphicsview/boxes/roundedbox.h
+++ b/examples/widgets/graphicsview/boxes/roundedbox.h
@@ -51,16 +51,12 @@
#ifndef ROUNDEDBOX_H
#define ROUNDEDBOX_H
-//#include <GL/glew.h>
+#include "glbuffers.h"
#include "glextensions.h"
-
-#include <QtWidgets>
-#include <QtOpenGL>
-
#include "gltrianglemesh.h"
-#include <QtGui/qvector3d.h>
-#include <QtGui/qvector2d.h>
-#include "glbuffers.h"
+
+#include <QVector2D>
+#include <QVector3D>
struct P3T2N3Vertex
{
diff --git a/examples/widgets/graphicsview/boxes/scene.cpp b/examples/widgets/graphicsview/boxes/scene.cpp
index 7f62ac894b..b344f65561 100644
--- a/examples/widgets/graphicsview/boxes/scene.cpp
+++ b/examples/widgets/graphicsview/boxes/scene.cpp
@@ -48,45 +48,15 @@
**
****************************************************************************/
-#include <QDebug>
#include "scene.h"
-#include <QtCore/QRandomGenerator>
-#include <QtGui/qmatrix4x4.h>
-#include <QtGui/qvector3d.h>
+
+#include <QMatrix4x4>
+#include <QRandomGenerator>
+#include <QVector3D>
#include <qmath.h>
#include "3rdparty/fbm.h"
-void checkGLErrors(const QString& prefix)
-{
- switch (glGetError()) {
- case GL_NO_ERROR:
- //qDebug() << prefix << tr("No error.");
- break;
- case GL_INVALID_ENUM:
- qDebug() << prefix << QObject::tr("Invalid enum.");
- break;
- case GL_INVALID_VALUE:
- qDebug() << prefix << QObject::tr("Invalid value.");
- break;
- case GL_INVALID_OPERATION:
- qDebug() << prefix << QObject::tr("Invalid operation.");
- break;
- case GL_STACK_OVERFLOW:
- qDebug() << prefix << QObject::tr("Stack overflow.");
- break;
- case GL_STACK_UNDERFLOW:
- qDebug() << prefix << QObject::tr("Stack underflow.");
- break;
- case GL_OUT_OF_MEMORY:
- qDebug() << prefix << QObject::tr("Out of memory.");
- break;
- default:
- qDebug() << prefix << QObject::tr("Unknown error.");
- break;
- }
-}
-
//============================================================================//
// ColorEdit //
//============================================================================//
@@ -126,12 +96,8 @@ void ColorEdit::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
QColor color(m_color);
- QColorDialog dialog(color, 0);
+ QColorDialog dialog(color, nullptr);
dialog.setOption(QColorDialog::ShowAlphaChannel, true);
-// The ifdef block is a workaround for the beta, TODO: remove when bug 238525 is fixed
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- dialog.setOption(QColorDialog::DontUseNativeDialog, true);
-#endif
dialog.move(280, 120);
if (dialog.exec() == QDialog::Rejected)
return;
@@ -183,17 +149,6 @@ void FloatEdit::editDone()
//============================================================================//
// TwoSidedGraphicsWidget //
//============================================================================//
-
-TwoSidedGraphicsWidget::TwoSidedGraphicsWidget(QGraphicsScene *scene)
- : QObject(scene)
- , m_current(0)
- , m_angle(0)
- , m_delta(0)
-{
- for (int i = 0; i < 2; ++i)
- m_proxyWidgets[i] = 0;
-}
-
void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
{
if (index < 0 || index >= 2)
@@ -205,8 +160,7 @@ void TwoSidedGraphicsWidget::setWidget(int index, QWidget *widget)
GraphicsWidget *proxy = new GraphicsWidget;
proxy->setWidget(widget);
- if (m_proxyWidgets[index])
- delete m_proxyWidgets[index];
+ delete m_proxyWidgets[index];
m_proxyWidgets[index] = proxy;
proxy->setCacheMode(QGraphicsItem::ItemCoordinateCache);
@@ -223,7 +177,7 @@ QWidget *TwoSidedGraphicsWidget::widget(int index)
if (index < 0 || index >= 2)
{
qWarning("TwoSidedGraphicsWidget::widget: Index out of bounds, index == %d", index);
- return 0;
+ return nullptr;
}
return m_proxyWidgets[index]->widget();
}
@@ -293,7 +247,7 @@ void GraphicsWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
//============================================================================//
RenderOptionsDialog::RenderOptionsDialog()
- : QDialog(0, Qt::CustomizeWindowHint | Qt::WindowTitleHint)
+ : QDialog(nullptr, Qt::CustomizeWindowHint | Qt::WindowTitleHint)
{
setWindowOpacity(0.75);
setWindowTitle(tr("Options (double click to flip)"));
@@ -427,7 +381,7 @@ void RenderOptionsDialog::mouseDoubleClickEvent(QMouseEvent *event)
//============================================================================//
ItemDialog::ItemDialog()
- : QDialog(0, Qt::CustomizeWindowHint | Qt::WindowTitleHint)
+ : QDialog(nullptr, Qt::CustomizeWindowHint | Qt::WindowTitleHint)
{
setWindowTitle(tr("Items (double click to flip)"));
setWindowOpacity(0.75);
@@ -491,10 +445,10 @@ Scene::Scene(int width, int height, int maxTextureSize)
, m_currentTexture(0)
, m_dynamicCubemap(false)
, m_updateAllCubemaps(true)
- , m_box(0)
- , m_vertexShader(0)
- , m_environmentShader(0)
- , m_environmentProgram(0)
+ , m_box(nullptr)
+ , m_vertexShader(nullptr)
+ , m_environmentShader(nullptr)
+ , m_environmentProgram(nullptr)
{
setSceneRect(0, 0, width, height);
@@ -533,8 +487,6 @@ Scene::Scene(int width, int height, int maxTextureSize)
m_timer->setInterval(20);
connect(m_timer, &QTimer::timeout, this, [this](){ update(); });
m_timer->start();
-
- m_time.start();
}
Scene::~Scene()
@@ -570,9 +522,8 @@ void Scene::initGL()
const int NOISE_SIZE = 128; // for a different size, B and BM in fbm.c must also be changed
m_noise = new GLTexture3D(NOISE_SIZE, NOISE_SIZE, NOISE_SIZE);
- QRgb *data = new QRgb[NOISE_SIZE * NOISE_SIZE * NOISE_SIZE];
- memset(data, 0, NOISE_SIZE * NOISE_SIZE * NOISE_SIZE * sizeof(QRgb));
- QRgb *p = data;
+ QVector<QRgb> data(NOISE_SIZE * NOISE_SIZE * NOISE_SIZE, QRgb(0));
+ QRgb *p = data.data();
float pos[3];
for (int k = 0; k < NOISE_SIZE; ++k) {
pos[2] = k * (0x20 / (float)NOISE_SIZE);
@@ -587,8 +538,7 @@ void Scene::initGL()
}
}
}
- m_noise->load(NOISE_SIZE, NOISE_SIZE, NOISE_SIZE, data);
- delete[] data;
+ m_noise->load(NOISE_SIZE, NOISE_SIZE, NOISE_SIZE, data.data());
m_mainCubemap = new GLRenderTargetCube(512);
@@ -640,7 +590,7 @@ void Scene::initGL()
m_renderOptions->addShader(file.baseName());
program->bind();
- m_cubemaps << ((program->uniformLocation("env") != -1) ? new GLRenderTargetCube(qMin(256, m_maxTextureSize)) : 0);
+ m_cubemaps << ((program->uniformLocation("env") != -1) ? new GLRenderTargetCube(qMin(256, m_maxTextureSize)) : nullptr);
program->release();
}
diff --git a/examples/widgets/graphicsview/boxes/scene.h b/examples/widgets/graphicsview/boxes/scene.h
index ccb6f368cd..5d65dc71e2 100644
--- a/examples/widgets/graphicsview/boxes/scene.h
+++ b/examples/widgets/graphicsview/boxes/scene.h
@@ -51,17 +51,12 @@
#ifndef SCENE_H
#define SCENE_H
-//#include <GL/glew.h>
+#include "glbuffers.h"
#include "glextensions.h"
-
-#include <QtWidgets>
-#include <QtOpenGL>
-
-#include "roundedbox.h"
#include "gltrianglemesh.h"
-#include "trackball.h"
-#include "glbuffers.h"
#include "qtbox.h"
+#include "roundedbox.h"
+#include "trackball.h"
QT_BEGIN_NAMESPACE
class QMatrix4x4;
@@ -116,7 +111,7 @@ private:
class GraphicsWidget : public QGraphicsProxyWidget
{
public:
- GraphicsWidget() : QGraphicsProxyWidget(0, Qt::Window) {}
+ GraphicsWidget() : QGraphicsProxyWidget(nullptr, Qt::Window) {}
protected:
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
void resizeEvent(QGraphicsSceneResizeEvent *event) override;
@@ -127,7 +122,7 @@ class TwoSidedGraphicsWidget : public QObject
{
Q_OBJECT
public:
- TwoSidedGraphicsWidget(QGraphicsScene *scene);
+ using QObject::QObject;
void setWidget(int index, QWidget *widget);
QWidget *widget(int index);
public slots:
@@ -135,10 +130,10 @@ public slots:
protected slots:
void animateFlip();
private:
- GraphicsWidget *m_proxyWidgets[2];
- int m_current;
- int m_angle; // angle in degrees
- int m_delta;
+ GraphicsWidget *m_proxyWidgets[2] = {nullptr, nullptr};
+ int m_current = 0;
+ int m_angle = 0; // angle in degrees
+ int m_delta = 0;
};
class RenderOptionsDialog : public QDialog
@@ -220,7 +215,7 @@ private:
void initGL();
QPointF pixelPosToViewPos(const QPointF& p);
- QTime m_time;
+ QTime m_time; // ### Qt 6: remove (unused)
int m_lastTime;
int m_mouseEventTime;
int m_distExp;
diff --git a/examples/widgets/graphicsview/boxes/trackball.cpp b/examples/widgets/graphicsview/boxes/trackball.cpp
index 794ce7ac37..b9dfc1fc7f 100644
--- a/examples/widgets/graphicsview/boxes/trackball.cpp
+++ b/examples/widgets/graphicsview/boxes/trackball.cpp
@@ -50,34 +50,21 @@
#include "trackball.h"
#include "scene.h"
-#include <qmath.h>
-#include <cmath>
//============================================================================//
// TrackBall //
//============================================================================//
TrackBall::TrackBall(TrackMode mode)
- : m_angularVelocity(0)
- , m_paused(false)
- , m_pressed(false)
- , m_mode(mode)
+ : TrackBall(0, QVector3D(0, 1, 0), mode)
{
- m_axis = QVector3D(0, 1, 0);
- m_rotation = QQuaternion();
- m_lastTime = QTime::currentTime();
}
TrackBall::TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode)
: m_axis(axis)
, m_angularVelocity(angularVelocity)
- , m_paused(false)
- , m_pressed(false)
, m_mode(mode)
-{
- m_rotation = QQuaternion();
- m_lastTime = QTime::currentTime();
-}
+{}
void TrackBall::push(const QPointF& p, const QQuaternion &)
{
diff --git a/examples/widgets/graphicsview/boxes/trackball.h b/examples/widgets/graphicsview/boxes/trackball.h
index e65080e089..af90e4d842 100644
--- a/examples/widgets/graphicsview/boxes/trackball.h
+++ b/examples/widgets/graphicsview/boxes/trackball.h
@@ -51,10 +51,9 @@
#ifndef TRACKBALL_H
#define TRACKBALL_H
-#include <QtWidgets>
-
-#include <QtGui/qvector3d.h>
-#include <QtGui/qquaternion.h>
+#include <QQuaternion>
+#include <QTime>
+#include <QVector3D>
class TrackBall
{
@@ -65,24 +64,24 @@ public:
Sphere,
};
TrackBall(TrackMode mode = Sphere);
- TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode = Sphere);
+ TrackBall(float angularVelocity, const QVector3D &axis, TrackMode mode = Sphere);
// coordinates in [-1,1]x[-1,1]
- void push(const QPointF& p, const QQuaternion &transformation);
- void move(const QPointF& p, const QQuaternion &transformation);
- void release(const QPointF& p, const QQuaternion &transformation);
+ void push(const QPointF &p, const QQuaternion &transformation);
+ void move(const QPointF &p, const QQuaternion &transformation);
+ void release(const QPointF &p, const QQuaternion &transformation);
void start(); // starts clock
void stop(); // stops clock
QQuaternion rotation() const;
private:
QQuaternion m_rotation;
- QVector3D m_axis;
- float m_angularVelocity;
+ QVector3D m_axis = QVector3D(0, 1, 0);
+ float m_angularVelocity = 0;
QPointF m_lastPos;
- QTime m_lastTime;
- bool m_paused;
- bool m_pressed;
+ QTime m_lastTime = QTime::currentTime();
TrackMode m_mode;
+ bool m_paused = false;
+ bool m_pressed = false;
};
#endif
diff --git a/examples/widgets/graphicsview/chip/chip.cpp b/examples/widgets/graphicsview/chip/chip.cpp
index 3d2bbdfcef..25f4ccc2e9 100644
--- a/examples/widgets/graphicsview/chip/chip.cpp
+++ b/examples/widgets/graphicsview/chip/chip.cpp
@@ -50,7 +50,9 @@
#include "chip.h"
-#include <QtWidgets>
+#include <QGraphicsSceneMouseEvent>
+#include <QPainter>
+#include <QStyleOptionGraphicsItem>
Chip::Chip(const QColor &color, int x, int y)
{
diff --git a/examples/widgets/graphicsview/chip/mainwindow.cpp b/examples/widgets/graphicsview/chip/mainwindow.cpp
index b6e1313eb2..f2f89c8722 100644
--- a/examples/widgets/graphicsview/chip/mainwindow.cpp
+++ b/examples/widgets/graphicsview/chip/mainwindow.cpp
@@ -56,13 +56,11 @@
#include <QSplitter>
MainWindow::MainWindow(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), scene(new QGraphicsScene(this))
+ , h1Splitter(new QSplitter(this)), h2Splitter(new QSplitter(this))
{
populateScene();
- h1Splitter = new QSplitter;
- h2Splitter = new QSplitter;
-
QSplitter *vSplitter = new QSplitter;
vSplitter->setOrientation(Qt::Vertical);
vSplitter->addWidget(h1Splitter);
@@ -93,8 +91,6 @@ MainWindow::MainWindow(QWidget *parent)
void MainWindow::populateScene()
{
- scene = new QGraphicsScene(this);
-
QImage image(":/qt4logo.png");
// Populate scene
diff --git a/examples/widgets/graphicsview/chip/mainwindow.h b/examples/widgets/graphicsview/chip/mainwindow.h
index 9417d12d7a..3f91b2efb4 100644
--- a/examples/widgets/graphicsview/chip/mainwindow.h
+++ b/examples/widgets/graphicsview/chip/mainwindow.h
@@ -62,7 +62,7 @@ class MainWindow : public QWidget
{
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
private:
void setupMatrix();
diff --git a/examples/widgets/graphicsview/chip/view.cpp b/examples/widgets/graphicsview/chip/view.cpp
index 9676c13ff7..21998dc2df 100644
--- a/examples/widgets/graphicsview/chip/view.cpp
+++ b/examples/widgets/graphicsview/chip/view.cpp
@@ -62,13 +62,13 @@
#else
#include <QtWidgets>
#endif
-#include <qmath.h>
+#include <QtMath>
#if QT_CONFIG(wheelevent)
void GraphicsView::wheelEvent(QWheelEvent *e)
{
if (e->modifiers() & Qt::ControlModifier) {
- if (e->delta() > 0)
+ if (e->angleDelta().y() > 0)
view->zoomIn(6);
else
view->zoomOut(6);
diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h
index 89b2e813f1..ea7bd414f5 100644
--- a/examples/widgets/graphicsview/chip/view.h
+++ b/examples/widgets/graphicsview/chip/view.h
@@ -81,7 +81,7 @@ class View : public QFrame
{
Q_OBJECT
public:
- explicit View(const QString &name, QWidget *parent = 0);
+ explicit View(const QString &name, QWidget *parent = nullptr);
QGraphicsView *view() const;
diff --git a/examples/widgets/graphicsview/collidingmice/main.cpp b/examples/widgets/graphicsview/collidingmice/main.cpp
index dfb20815b9..ef6d6cca64 100644
--- a/examples/widgets/graphicsview/collidingmice/main.cpp
+++ b/examples/widgets/graphicsview/collidingmice/main.cpp
@@ -48,13 +48,12 @@
**
****************************************************************************/
+#include <QtMath>
#include <QtWidgets>
-#include <math.h>
-
#include "mouse.h"
-static const int MouseCount = 7;
+static constexpr int MouseCount = 7;
//! [0]
int main(int argc, char **argv)
diff --git a/examples/widgets/graphicsview/collidingmice/mouse.cpp b/examples/widgets/graphicsview/collidingmice/mouse.cpp
index a8fcc05d76..8375092c39 100644
--- a/examples/widgets/graphicsview/collidingmice/mouse.cpp
+++ b/examples/widgets/graphicsview/collidingmice/mouse.cpp
@@ -54,10 +54,10 @@
#include <QPainter>
#include <QRandomGenerator>
#include <QStyleOption>
-#include <qmath.h>
+#include <QtMath>
-const qreal Pi = M_PI;
-const qreal TwoPi = 2 * M_PI;
+constexpr qreal Pi = M_PI;
+constexpr qreal TwoPi = 2 * M_PI;
static qreal normalizeAngle(qreal angle)
{
@@ -69,9 +69,9 @@ static qreal normalizeAngle(qreal angle)
}
//! [0]
-Mouse::Mouse()
- : angle(0), speed(0), mouseEyeDirection(0),
- color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256))
+Mouse::Mouse() : color(QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256))
{
setRotation(QRandomGenerator::global()->bounded(360 * 16));
}
diff --git a/examples/widgets/graphicsview/collidingmice/mouse.h b/examples/widgets/graphicsview/collidingmice/mouse.h
index bd9e592242..4b165fced6 100644
--- a/examples/widgets/graphicsview/collidingmice/mouse.h
+++ b/examples/widgets/graphicsview/collidingmice/mouse.h
@@ -68,9 +68,9 @@ protected:
void advance(int step) override;
private:
- qreal angle;
- qreal speed;
- qreal mouseEyeDirection;
+ qreal angle = 0;
+ qreal speed = 0;
+ qreal mouseEyeDirection = 0;
QColor color;
};
//! [0]
diff --git a/examples/widgets/graphicsview/diagramscene/arrow.cpp b/examples/widgets/graphicsview/diagramscene/arrow.cpp
index 88160d9399..9b2472bb33 100644
--- a/examples/widgets/graphicsview/diagramscene/arrow.cpp
+++ b/examples/widgets/graphicsview/diagramscene/arrow.cpp
@@ -50,19 +50,17 @@
#include "arrow.h"
+#include "diagramitem.h"
-#include <qmath.h>
-#include <QPen>
#include <QPainter>
+#include <QPen>
+#include <QtMath>
//! [0]
Arrow::Arrow(DiagramItem *startItem, DiagramItem *endItem, QGraphicsItem *parent)
- : QGraphicsLineItem(parent)
+ : QGraphicsLineItem(parent), myStartItem(startItem), myEndItem(endItem)
{
- myStartItem = startItem;
- myEndItem = endItem;
setFlag(QGraphicsItem::ItemIsSelectable, true);
- myColor = Qt::black;
setPen(QPen(myColor, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
}
//! [0]
@@ -98,7 +96,7 @@ void Arrow::updatePosition()
//! [4]
void Arrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
- QWidget *)
+ QWidget *)
{
if (myStartItem->collidesWithItem(myEndItem))
return;
@@ -113,15 +111,13 @@ void Arrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
QLineF centerLine(myStartItem->pos(), myEndItem->pos());
QPolygonF endPolygon = myEndItem->polygon();
QPointF p1 = endPolygon.first() + myEndItem->pos();
- QPointF p2;
QPointF intersectPoint;
- QLineF polyLine;
for (int i = 1; i < endPolygon.count(); ++i) {
- p2 = endPolygon.at(i) + myEndItem->pos();
- polyLine = QLineF(p1, p2);
- QLineF::IntersectType intersectType =
- polyLine.intersect(centerLine, &intersectPoint);
- if (intersectType == QLineF::BoundedIntersection)
+ QPointF p2 = endPolygon.at(i) + myEndItem->pos();
+ QLineF polyLine = QLineF(p1, p2);
+ QLineF::IntersectionType intersectionType =
+ polyLine.intersects(centerLine, &intersectPoint);
+ if (intersectionType == QLineF::BoundedIntersection)
break;
p1 = p2;
}
diff --git a/examples/widgets/graphicsview/diagramscene/arrow.h b/examples/widgets/graphicsview/diagramscene/arrow.h
index e0fa389d53..13001959bd 100644
--- a/examples/widgets/graphicsview/diagramscene/arrow.h
+++ b/examples/widgets/graphicsview/diagramscene/arrow.h
@@ -53,16 +53,7 @@
#include <QGraphicsLineItem>
-#include "diagramitem.h"
-
-QT_BEGIN_NAMESPACE
-class QGraphicsPolygonItem;
-class QGraphicsLineItem;
-class QGraphicsScene;
-class QRectF;
-class QGraphicsSceneMouseEvent;
-class QPainterPath;
-QT_END_NAMESPACE
+class DiagramItem;
//! [0]
class Arrow : public QGraphicsLineItem
@@ -71,7 +62,7 @@ public:
enum { Type = UserType + 4 };
Arrow(DiagramItem *startItem, DiagramItem *endItem,
- QGraphicsItem *parent = 0);
+ QGraphicsItem *parent = nullptr);
int type() const override { return Type; }
QRectF boundingRect() const override;
@@ -83,13 +74,14 @@ public:
void updatePosition();
protected:
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = nullptr) override;
private:
DiagramItem *myStartItem;
DiagramItem *myEndItem;
- QColor myColor;
QPolygonF arrowHead;
+ QColor myColor = Qt::black;
};
//! [0]
diff --git a/examples/widgets/graphicsview/diagramscene/diagramitem.cpp b/examples/widgets/graphicsview/diagramscene/diagramitem.cpp
index 3aa685635e..8ec577170b 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramitem.cpp
+++ b/examples/widgets/graphicsview/diagramscene/diagramitem.cpp
@@ -58,12 +58,10 @@
//! [0]
DiagramItem::DiagramItem(DiagramType diagramType, QMenu *contextMenu,
- QGraphicsItem *parent)
- : QGraphicsPolygonItem(parent)
+ QGraphicsItem *parent)
+ : QGraphicsPolygonItem(parent), myDiagramType(diagramType)
+ , myContextMenu(contextMenu)
{
- myDiagramType = diagramType;
- myContextMenu = contextMenu;
-
QPainterPath path;
switch (myDiagramType) {
case StartEnd:
@@ -101,17 +99,17 @@ DiagramItem::DiagramItem(DiagramType diagramType, QMenu *contextMenu,
//! [1]
void DiagramItem::removeArrow(Arrow *arrow)
{
- int index = arrows.indexOf(arrow);
-
- if (index != -1)
- arrows.removeAt(index);
+ arrows.removeAll(arrow);
}
//! [1]
//! [2]
void DiagramItem::removeArrows()
{
- for (Arrow *arrow : qAsConst(arrows)) {
+ // need a copy here since removeArrow() will
+ // modify the arrows container
+ const auto arrowsCopy = arrows;
+ for (Arrow *arrow : arrowsCopy) {
arrow->startItem()->removeArrow(arrow);
arrow->endItem()->removeArrow(arrow);
scene()->removeItem(arrow);
diff --git a/examples/widgets/graphicsview/diagramscene/diagramitem.h b/examples/widgets/graphicsview/diagramscene/diagramitem.h
index 3a43ec57fc..ffaea4b7a8 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramitem.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramitem.h
@@ -52,19 +52,12 @@
#define DIAGRAMITEM_H
#include <QGraphicsPixmapItem>
-#include <QList>
+#include <QVector>
QT_BEGIN_NAMESPACE
class QPixmap;
-class QGraphicsItem;
-class QGraphicsScene;
-class QTextEdit;
-class QGraphicsSceneMouseEvent;
-class QMenu;
class QGraphicsSceneContextMenuEvent;
-class QPainter;
-class QStyleOptionGraphicsItem;
-class QWidget;
+class QMenu;
class QPolygonF;
QT_END_NAMESPACE
@@ -77,7 +70,7 @@ public:
enum { Type = UserType + 15 };
enum DiagramType { Step, Conditional, StartEnd, Io };
- DiagramItem(DiagramType diagramType, QMenu *contextMenu, QGraphicsItem *parent = 0);
+ DiagramItem(DiagramType diagramType, QMenu *contextMenu, QGraphicsItem *parent = nullptr);
void removeArrow(Arrow *arrow);
void removeArrows();
@@ -85,7 +78,7 @@ public:
QPolygonF polygon() const { return myPolygon; }
void addArrow(Arrow *arrow);
QPixmap image() const;
- int type() const override { return Type;}
+ int type() const override { return Type; }
protected:
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
@@ -95,7 +88,7 @@ private:
DiagramType myDiagramType;
QPolygonF myPolygon;
QMenu *myContextMenu;
- QList<Arrow *> arrows;
+ QVector<Arrow *> arrows;
};
//! [0]
diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.cpp b/examples/widgets/graphicsview/diagramscene/diagramscene.cpp
index 40272834c3..d0688d8552 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramscene.cpp
+++ b/examples/widgets/graphicsview/diagramscene/diagramscene.cpp
@@ -51,8 +51,8 @@
#include "diagramscene.h"
#include "arrow.h"
-#include <QTextCursor>
#include <QGraphicsSceneMouseEvent>
+#include <QTextCursor>
//! [0]
DiagramScene::DiagramScene(QMenu *itemMenu, QObject *parent)
@@ -61,8 +61,8 @@ DiagramScene::DiagramScene(QMenu *itemMenu, QObject *parent)
myItemMenu = itemMenu;
myMode = MoveItem;
myItemType = DiagramItem::Step;
- line = 0;
- textItem = 0;
+ line = nullptr;
+ textItem = nullptr;
myItemColor = Qt::white;
myTextColor = Qt::black;
myLineColor = Qt::black;
@@ -188,7 +188,7 @@ void DiagramScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
//! [10]
void DiagramScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
{
- if (myMode == InsertLine && line != 0) {
+ if (myMode == InsertLine && line != nullptr) {
QLineF newLine(line->line().p1(), mouseEvent->scenePos());
line->setLine(newLine);
} else if (myMode == MoveItem) {
@@ -200,7 +200,7 @@ void DiagramScene::mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
//! [11]
void DiagramScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
{
- if (line != 0 && myMode == InsertLine) {
+ if (line != nullptr && myMode == InsertLine) {
QList<QGraphicsItem *> startItems = items(line->line().p1());
if (startItems.count() && startItems.first() == line)
startItems.removeFirst();
@@ -228,7 +228,7 @@ void DiagramScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
}
}
//! [12] //! [13]
- line = 0;
+ line = nullptr;
QGraphicsScene::mouseReleaseEvent(mouseEvent);
}
//! [13]
diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.h b/examples/widgets/graphicsview/diagramscene/diagramscene.h
index 15063d58b7..5682468ef6 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramscene.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramscene.h
@@ -74,7 +74,7 @@ class DiagramScene : public QGraphicsScene
public:
enum Mode { InsertItem, InsertLine, InsertText, MoveItem };
- explicit DiagramScene(QMenu *itemMenu, QObject *parent = 0);
+ explicit DiagramScene(QMenu *itemMenu, QObject *parent = nullptr);
QFont font() const { return myFont; }
QColor textColor() const { return myTextColor; }
QColor itemColor() const { return myItemColor; }
diff --git a/examples/widgets/graphicsview/diagramscene/diagramtextitem.h b/examples/widgets/graphicsview/diagramscene/diagramtextitem.h
index f5d3d3b95e..7809609e24 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramtextitem.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramtextitem.h
@@ -52,12 +52,8 @@
#define DIAGRAMTEXTITEM_H
#include <QGraphicsTextItem>
-#include <QPen>
QT_BEGIN_NAMESPACE
-class QFocusEvent;
-class QGraphicsItem;
-class QGraphicsScene;
class QGraphicsSceneMouseEvent;
QT_END_NAMESPACE
@@ -69,7 +65,7 @@ class DiagramTextItem : public QGraphicsTextItem
public:
enum { Type = UserType + 3 };
- DiagramTextItem(QGraphicsItem *parent = 0);
+ DiagramTextItem(QGraphicsItem *parent = nullptr);
int type() const override { return Type; }
diff --git a/examples/widgets/graphicsview/diagramscene/mainwindow.cpp b/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
index 07f92f61c1..3327d4d5df 100644
--- a/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
+++ b/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
@@ -473,7 +473,7 @@ void MainWindow::createToolbars()
fontSizeCombo->addItem(QString().setNum(i));
QIntValidator *validator = new QIntValidator(2, 64, this);
fontSizeCombo->setValidator(validator);
- connect(fontSizeCombo, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
+ connect(fontSizeCombo, &QComboBox::currentTextChanged,
this, &MainWindow::fontSizeChanged);
fontColorToolButton = new QToolButton;
@@ -536,7 +536,7 @@ void MainWindow::createToolbars()
scales << tr("50%") << tr("75%") << tr("100%") << tr("125%") << tr("150%");
sceneScaleCombo->addItems(scales);
sceneScaleCombo->setCurrentIndex(2);
- connect(sceneScaleCombo, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
+ connect(sceneScaleCombo, &QComboBox::currentTextChanged,
this, &MainWindow::sceneScaleChanged);
pointerToolbar = addToolBar(tr("Pointer type"));
diff --git a/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp b/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp
index 262e18a317..23fb5fda50 100644
--- a/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp
+++ b/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp
@@ -48,10 +48,18 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "coloritem.h"
+#include <QApplication>
+#include <QBitmap>
+#include <QCursor>
+#include <QDrag>
+#include <QGraphicsSceneMouseEvent>
+#include <QMimeData>
+#include <QPainter>
+#include <QRandomGenerator>
+#include <QWidget>
+
//! [0]
ColorItem::ColorItem()
: color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256))
@@ -128,7 +136,7 @@ void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPainter painter(&pixmap);
painter.translate(15, 15);
painter.setRenderHint(QPainter::Antialiasing);
- paint(&painter, 0, 0);
+ paint(&painter, nullptr, nullptr);
painter.end();
pixmap.setMask(pixmap.createHeuristicMask());
diff --git a/examples/widgets/graphicsview/dragdroprobot/main.cpp b/examples/widgets/graphicsview/dragdroprobot/main.cpp
index 045e184569..b00e9705d4 100644
--- a/examples/widgets/graphicsview/dragdroprobot/main.cpp
+++ b/examples/widgets/graphicsview/dragdroprobot/main.cpp
@@ -48,19 +48,20 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
+#include <QGraphicsScene>
+#include <QGraphicsView>
#include "coloritem.h"
#include "robot.h"
-#include <math.h>
+#include <cmath>
+
class GraphicsView : public QGraphicsView
{
public:
- GraphicsView(QGraphicsScene *scene) : QGraphicsView(scene)
- {
- }
+ using QGraphicsView::QGraphicsView;
protected:
void resizeEvent(QResizeEvent *) override
@@ -96,7 +97,7 @@ int main(int argc, char **argv)
view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
view.setBackgroundBrush(QColor(230, 200, 167));
view.setWindowTitle("Drag and Drop Robot");
- view.show();
+ view.show();
return app.exec();
}
diff --git a/examples/widgets/graphicsview/dragdroprobot/robot.cpp b/examples/widgets/graphicsview/dragdroprobot/robot.cpp
index cc70366872..7457dabf8a 100644
--- a/examples/widgets/graphicsview/dragdroprobot/robot.cpp
+++ b/examples/widgets/graphicsview/dragdroprobot/robot.cpp
@@ -48,13 +48,17 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "robot.h"
+#include <QGraphicsSceneDragDropEvent>
+#include <QMimeData>
+#include <QPainter>
+#include <QParallelAnimationGroup>
+#include <QPropertyAnimation>
+
//! [0]
RobotPart::RobotPart(QGraphicsItem *parent)
- : QGraphicsObject(parent), color(Qt::lightGray), dragOver(false)
+ : QGraphicsObject(parent), color(Qt::lightGray)
{
setAcceptDrops(true);
}
@@ -157,11 +161,6 @@ void RobotHead::dropEvent(QGraphicsSceneDragDropEvent *event)
}
//! [8]
-RobotTorso::RobotTorso(QGraphicsItem *parent)
- : RobotPart(parent)
-{
-}
-
QRectF RobotTorso::boundingRect() const
{
return QRectF(-30, -20, 60, 60);
diff --git a/examples/widgets/graphicsview/dragdroprobot/robot.h b/examples/widgets/graphicsview/dragdroprobot/robot.h
index e25966c7c4..67f6bb4100 100644
--- a/examples/widgets/graphicsview/dragdroprobot/robot.h
+++ b/examples/widgets/graphicsview/dragdroprobot/robot.h
@@ -62,15 +62,15 @@ QT_END_NAMESPACE
class RobotPart : public QGraphicsObject
{
public:
- RobotPart(QGraphicsItem *parent = 0);
+ RobotPart(QGraphicsItem *parent = nullptr);
protected:
void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
void dropEvent(QGraphicsSceneDragDropEvent *event) override;
- QColor color;
- bool dragOver;
+ QColor color = Qt::lightGray;
+ bool dragOver = false;
};
//! [0]
@@ -78,10 +78,10 @@ protected:
class RobotHead : public RobotPart
{
public:
- RobotHead(QGraphicsItem *parent = 0);
+ RobotHead(QGraphicsItem *parent = nullptr);
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
protected:
void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
@@ -96,10 +96,10 @@ private:
class RobotTorso : public RobotPart
{
public:
- RobotTorso(QGraphicsItem *parent = 0);
+ using RobotPart::RobotPart;
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
};
//! [2]
@@ -107,10 +107,10 @@ public:
class RobotLimb : public RobotPart
{
public:
- RobotLimb(QGraphicsItem *parent = 0);
+ RobotLimb(QGraphicsItem *parent = nullptr);
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
};
//! [3]
@@ -118,10 +118,10 @@ public:
class Robot : public RobotPart
{
public:
- Robot(QGraphicsItem *parent = 0);
+ Robot(QGraphicsItem *parent = nullptr);
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
};
//! [4]
diff --git a/examples/widgets/graphicsview/elasticnodes/edge.cpp b/examples/widgets/graphicsview/elasticnodes/edge.cpp
index aec12b4225..9ca8b37f3d 100644
--- a/examples/widgets/graphicsview/elasticnodes/edge.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/edge.cpp
@@ -51,16 +51,14 @@
#include "edge.h"
#include "node.h"
-#include <qmath.h>
#include <QPainter>
+#include <QtMath>
//! [0]
Edge::Edge(Node *sourceNode, Node *destNode)
- : arrowSize(10)
+ : source(sourceNode), dest(destNode)
{
- setAcceptedMouseButtons(0);
- source = sourceNode;
- dest = destNode;
+ setAcceptedMouseButtons(Qt::NoButton);
source->addEdge(this);
dest->addEdge(this);
adjust();
diff --git a/examples/widgets/graphicsview/elasticnodes/edge.h b/examples/widgets/graphicsview/elasticnodes/edge.h
index 19072b8b33..048d3ffd02 100644
--- a/examples/widgets/graphicsview/elasticnodes/edge.h
+++ b/examples/widgets/graphicsview/elasticnodes/edge.h
@@ -78,7 +78,7 @@ private:
QPointF sourcePoint;
QPointF destPoint;
- qreal arrowSize;
+ qreal arrowSize = 10;
};
//! [0]
diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
index 6b817b2a21..a067f82ad7 100644
--- a/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.cpp
@@ -59,7 +59,7 @@
//! [0]
GraphWidget::GraphWidget(QWidget *parent)
- : QGraphicsView(parent), timerId(0)
+ : QGraphicsView(parent)
{
QGraphicsScene *scene = new QGraphicsScene(this);
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
@@ -163,7 +163,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event);
- QList<Node *> nodes;
+ QVector<Node *> nodes;
const QList<QGraphicsItem *> items = scene()->items();
for (QGraphicsItem *item : items) {
if (Node *node = qgraphicsitem_cast<Node *>(item))
@@ -190,7 +190,7 @@ void GraphWidget::timerEvent(QTimerEvent *event)
//! [5]
void GraphWidget::wheelEvent(QWheelEvent *event)
{
- scaleView(pow((double)2, -event->delta() / 240.0));
+ scaleView(pow(2., -event->angleDelta().y() / 240.0));
}
//! [5]
#endif
diff --git a/examples/widgets/graphicsview/elasticnodes/graphwidget.h b/examples/widgets/graphicsview/elasticnodes/graphwidget.h
index 5ed6aed452..6d241fa9f1 100644
--- a/examples/widgets/graphicsview/elasticnodes/graphwidget.h
+++ b/examples/widgets/graphicsview/elasticnodes/graphwidget.h
@@ -61,7 +61,7 @@ class GraphWidget : public QGraphicsView
Q_OBJECT
public:
- GraphWidget(QWidget *parent = 0);
+ GraphWidget(QWidget *parent = nullptr);
void itemMoved();
@@ -81,7 +81,7 @@ protected:
void scaleView(qreal scaleFactor);
private:
- int timerId;
+ int timerId = 0;
Node *centerNode;
};
//! [0]
diff --git a/examples/widgets/graphicsview/elasticnodes/node.cpp b/examples/widgets/graphicsview/elasticnodes/node.cpp
index 8d44a167fa..a67e21c4b3 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.cpp
+++ b/examples/widgets/graphicsview/elasticnodes/node.cpp
@@ -75,7 +75,7 @@ void Node::addEdge(Edge *edge)
edge->adjust();
}
-QList<Edge *> Node::edges() const
+QVector<Edge *> Node::edges() const
{
return edgeList;
}
diff --git a/examples/widgets/graphicsview/elasticnodes/node.h b/examples/widgets/graphicsview/elasticnodes/node.h
index 43ea1fb24b..b160ff37cc 100644
--- a/examples/widgets/graphicsview/elasticnodes/node.h
+++ b/examples/widgets/graphicsview/elasticnodes/node.h
@@ -52,13 +52,10 @@
#define NODE_H
#include <QGraphicsItem>
-#include <QList>
+#include <QVector>
class Edge;
class GraphWidget;
-QT_BEGIN_NAMESPACE
-class QGraphicsSceneMouseEvent;
-QT_END_NAMESPACE
//! [0]
class Node : public QGraphicsItem
@@ -67,7 +64,7 @@ public:
Node(GraphWidget *graphWidget);
void addEdge(Edge *edge);
- QList<Edge *> edges() const;
+ QVector<Edge *> edges() const;
enum { Type = UserType + 1 };
int type() const override { return Type; }
@@ -86,7 +83,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
- QList<Edge *> edgeList;
+ QVector<Edge *> edgeList;
QPointF newPos;
GraphWidget *graph;
};
diff --git a/examples/widgets/graphicsview/embeddeddialogs/customproxy.cpp b/examples/widgets/graphicsview/embeddeddialogs/customproxy.cpp
index f510ebc07f..6eda94e8ba 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/customproxy.cpp
+++ b/examples/widgets/graphicsview/embeddeddialogs/customproxy.cpp
@@ -50,14 +50,13 @@
#include "customproxy.h"
-#include <QStyleOptionGraphicsItem>
-#include <QPainter>
#include <QGraphicsScene>
+#include <QPainter>
+#include <QStyleOptionGraphicsItem>
CustomProxy::CustomProxy(QGraphicsItem *parent, Qt::WindowFlags wFlags)
- : QGraphicsProxyWidget(parent, wFlags), popupShown(false), currentPopup(nullptr)
+ : QGraphicsProxyWidget(parent, wFlags), timeLine(new QTimeLine(250, this))
{
- timeLine = new QTimeLine(250, this);
connect(timeLine, &QTimeLine::valueChanged,
this, &CustomProxy::updateStep);
connect(timeLine, &QTimeLine::stateChanged,
@@ -99,7 +98,7 @@ void CustomProxy::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
QGraphicsProxyWidget::hoverEnterEvent(event);
scene()->setActiveWindow(this);
- if (timeLine->currentValue() != 1)
+ if (qFuzzyCompare(timeLine->currentValue(), 1))
zoomIn();
}
@@ -107,7 +106,7 @@ void CustomProxy::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
QGraphicsProxyWidget::hoverLeaveEvent(event);
if (!popupShown
- && (timeLine->direction() != QTimeLine::Backward || timeLine->currentValue() != 0)) {
+ && (timeLine->direction() != QTimeLine::Backward || qFuzzyIsNull(timeLine->currentValue()))) {
zoomOut();
}
}
diff --git a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
index 36209b7073..d7df2b7b4b 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
+++ b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
@@ -59,7 +59,7 @@ class CustomProxy : public QGraphicsProxyWidget
Q_OBJECT
public:
- explicit CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+ explicit CustomProxy(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = nullptr);
QRectF boundingRect() const override;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
@@ -79,8 +79,8 @@ private slots:
private:
QTimeLine *timeLine;
- bool popupShown;
- QGraphicsItem *currentPopup;
+ QGraphicsItem *currentPopup = nullptr;
+ bool popupShown = false;
};
#endif // CUSTOMPROXY_H
diff --git a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp
index 0c831360cf..9fa24fcd17 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp
+++ b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp
@@ -73,7 +73,7 @@ EmbeddedDialog::EmbeddedDialog(QWidget *parent)
this, &EmbeddedDialog::spacingChanged);
connect(ui->fontComboBox, &QFontComboBox::currentFontChanged,
this, &EmbeddedDialog::fontChanged);
- connect(ui->style, QOverload<const QString &>::of(&QComboBox::activated),
+ connect(ui->style, &QComboBox::textActivated,
this, &EmbeddedDialog::styleChanged);
}
diff --git a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.h b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.h
index 29daaa58c1..c2d87a5660 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.h
+++ b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.h
@@ -64,7 +64,7 @@ class EmbeddedDialog : public QDialog
Q_OBJECT
public:
- EmbeddedDialog(QWidget *parent = 0);
+ EmbeddedDialog(QWidget *parent = nullptr);
~EmbeddedDialog();
private slots:
diff --git a/examples/widgets/graphicsview/flowlayout/flowlayout.cpp b/examples/widgets/graphicsview/flowlayout/flowlayout.cpp
index ab6bbb7aa4..03cf320568 100644
--- a/examples/widgets/graphicsview/flowlayout/flowlayout.cpp
+++ b/examples/widgets/graphicsview/flowlayout/flowlayout.cpp
@@ -50,14 +50,10 @@
#include "flowlayout.h"
-#include <qmath.h>
+#include <QtMath>
-#include <QWidget>
-
-FlowLayout::FlowLayout()
+FlowLayout::FlowLayout(QGraphicsLayoutItem *parent) : QGraphicsLayout(parent)
{
- m_spacing[0] = 6;
- m_spacing[1] = 6;
QSizePolicy sp = sizePolicy();
sp.setHeightForWidth(true);
setSizePolicy(sp);
@@ -66,7 +62,7 @@ FlowLayout::FlowLayout()
void FlowLayout::insertItem(int index, QGraphicsLayoutItem *item)
{
item->setParentLayoutItem(this);
- if (uint(index) > uint(m_items.count()))
+ if (index > m_items.count() || index < 0)
index = m_items.count();
m_items.insert(index, item);
invalidate();
@@ -117,15 +113,14 @@ qreal FlowLayout::doLayout(const QRectF &geom, bool applyNewGeometry) const
qreal y = 0;
qreal maxRowHeight = 0;
QSizeF pref;
- for (int i = 0; i < m_items.count(); ++i) {
- QGraphicsLayoutItem *item = m_items.at(i);
+ for (QGraphicsLayoutItem *item : m_items) {
pref = item->effectiveSizeHint(Qt::PreferredSize);
maxRowHeight = qMax(maxRowHeight, pref.height());
qreal next_x;
next_x = x + pref.width();
if (next_x > maxw) {
- if (x == 0) {
+ if (qFuzzyIsNull(x)) {
pref.setWidth(maxw);
} else {
x = 0;
@@ -156,7 +151,7 @@ QSizeF FlowLayout::minSize(const QSizeF &constraint) const
} else {
for (const QGraphicsLayoutItem *item : qAsConst(m_items))
size = size.expandedTo(item->effectiveSizeHint(Qt::MinimumSize));
- size += QSize(left + right, top + bottom);
+ size += QSizeF(left + right, top + bottom);
}
return size;
}
@@ -164,7 +159,7 @@ QSizeF FlowLayout::minSize(const QSizeF &constraint) const
QSizeF FlowLayout::prefSize() const
{
qreal left, right;
- getContentsMargins(&left, 0, &right, 0);
+ getContentsMargins(&left, nullptr, &right, nullptr);
qreal maxh = 0;
qreal totalWidth = 0;
diff --git a/examples/widgets/graphicsview/flowlayout/flowlayout.h b/examples/widgets/graphicsview/flowlayout/flowlayout.h
index 808f5d2c77..c6758414d6 100644
--- a/examples/widgets/graphicsview/flowlayout/flowlayout.h
+++ b/examples/widgets/graphicsview/flowlayout/flowlayout.h
@@ -53,7 +53,7 @@
class FlowLayout : public QGraphicsLayout
{
public:
- FlowLayout();
+ FlowLayout(QGraphicsLayoutItem *parent = nullptr);
inline void addItem(QGraphicsLayoutItem *item);
void insertItem(int index, QGraphicsLayoutItem *item);
void setSpacing(Qt::Orientations o, qreal spacing);
@@ -75,8 +75,8 @@ private:
QSizeF prefSize() const;
QSizeF maxSize() const;
- QList<QGraphicsLayoutItem*> m_items;
- qreal m_spacing[2];
+ QVector<QGraphicsLayoutItem*> m_items;
+ qreal m_spacing[2] = {6, 6};
};
diff --git a/examples/widgets/graphicsview/flowlayout/main.cpp b/examples/widgets/graphicsview/flowlayout/main.cpp
index 74c03b9bce..dbfed51bb3 100644
--- a/examples/widgets/graphicsview/flowlayout/main.cpp
+++ b/examples/widgets/graphicsview/flowlayout/main.cpp
@@ -59,12 +59,12 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
QGraphicsScene scene;
- QGraphicsView *view = new QGraphicsView(&scene);
+ QGraphicsView view(&scene);
Window *w = new Window;
scene.addItem(w);
- view->resize(400, 300);
- view->show();
+ view.resize(400, 300);
+ view.show();
return app.exec();
}
diff --git a/examples/widgets/graphicsview/flowlayout/window.cpp b/examples/widgets/graphicsview/flowlayout/window.cpp
index 34d0d71b44..8fe06d0e11 100644
--- a/examples/widgets/graphicsview/flowlayout/window.cpp
+++ b/examples/widgets/graphicsview/flowlayout/window.cpp
@@ -48,23 +48,21 @@
**
****************************************************************************/
-#include "flowlayout.h"
#include "window.h"
+#include "flowlayout.h"
#include <QGraphicsProxyWidget>
#include <QLabel>
-Window::Window()
-: QGraphicsWidget(0, Qt::Window)
+Window::Window(QGraphicsItem *parent) : QGraphicsWidget(parent, Qt::Window)
{
FlowLayout *lay = new FlowLayout;
- QLatin1String wiseWords("I am not bothered by the fact that I am unknown."
- " I am bothered when I do not know others. (Confucius)");
- QString sentence(wiseWords);
- QStringList words = sentence.split(QLatin1Char(' '), QString::SkipEmptyParts);
- for (int i = 0; i < words.count(); ++i) {
+ const QString sentence(QLatin1String("I am not bothered by the fact that I am unknown."
+ " I am bothered when I do not know others. (Confucius)"));
+ const QVector<QStringRef> words = sentence.splitRef(QLatin1Char(' '), QString::SkipEmptyParts);
+ for (const QStringRef &word : words) {
QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
- QLabel *label = new QLabel(words.at(i));
+ QLabel *label = new QLabel(word.toString());
label->setFrameStyle(QFrame::Box | QFrame::Plain);
proxy->setWidget(label);
lay->addItem(proxy);
diff --git a/examples/widgets/graphicsview/flowlayout/window.h b/examples/widgets/graphicsview/flowlayout/window.h
index 7f37c447d1..24a7cf908b 100644
--- a/examples/widgets/graphicsview/flowlayout/window.h
+++ b/examples/widgets/graphicsview/flowlayout/window.h
@@ -53,7 +53,6 @@
class Window : public QGraphicsWidget
{
Q_OBJECT
-
public:
- Window();
+ Window(QGraphicsItem *parent = nullptr);
};
diff --git a/examples/widgets/graphicsview/padnavigator/flippablepad.cpp b/examples/widgets/graphicsview/padnavigator/flippablepad.cpp
index e5de331597..6a9097a736 100644
--- a/examples/widgets/graphicsview/padnavigator/flippablepad.cpp
+++ b/examples/widgets/graphicsview/padnavigator/flippablepad.cpp
@@ -75,8 +75,8 @@ FlippablePad::FlippablePad(const QSize &size, QGraphicsItem *parent)
//! [2]
//! [3]
int numIcons = size.width() * size.height();
- QList<QPixmap> pixmaps;
- QDirIterator it(":/images", QStringList() << "*.png");
+ QVector<QPixmap> pixmaps;
+ QDirIterator it(":/images", {"*.png"});
while (it.hasNext() && pixmaps.size() < numIcons)
pixmaps << it.next();
//! [3]
diff --git a/examples/widgets/graphicsview/padnavigator/flippablepad.h b/examples/widgets/graphicsview/padnavigator/flippablepad.h
index 323ace4372..ef757c47fb 100644
--- a/examples/widgets/graphicsview/padnavigator/flippablepad.h
+++ b/examples/widgets/graphicsview/padnavigator/flippablepad.h
@@ -53,15 +53,13 @@
#include "roundrectitem.h"
-#include <QGraphicsObject>
-#include <QLinearGradient>
#include <QVector>
//! [0]
class FlippablePad : public RoundRectItem
{
public:
- explicit FlippablePad(const QSize &size, QGraphicsItem *parent = 0);
+ explicit FlippablePad(const QSize &size, QGraphicsItem *parent = nullptr);
RoundRectItem *iconAt(int column, int row) const;
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.cpp b/examples/widgets/graphicsview/padnavigator/padnavigator.cpp
index ef0b0b4510..b9ce2a47ca 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.cpp
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.cpp
@@ -52,10 +52,18 @@
#include "padnavigator.h"
#include "splashitem.h"
+#include <QEventTransition>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsRotation>
+#include <QHistoryState>
+#include <QKeyEventTransition>
+#include <QParallelAnimationGroup>
+#include <QPropertyAnimation>
+#include <QSequentialAnimationGroup>
+#include <QStateMachine>
+
#ifndef QT_NO_OPENGL
-#include <QtOpenGL>
-#else
-#include <QtWidgets>
+#include <QOpenGLWidget>
#endif
//! [0]
diff --git a/examples/widgets/graphicsview/padnavigator/padnavigator.h b/examples/widgets/graphicsview/padnavigator/padnavigator.h
index 00cf2c0212..0fe9ad045d 100644
--- a/examples/widgets/graphicsview/padnavigator/padnavigator.h
+++ b/examples/widgets/graphicsview/padnavigator/padnavigator.h
@@ -54,17 +54,12 @@
#include <QGraphicsView>
#include "ui_form.h"
-QT_BEGIN_NAMESPACE
-class QState;
-class QStateMachine;
-QT_END_NAMESPACE
-
//! [0]
class PadNavigator : public QGraphicsView
{
Q_OBJECT
public:
- explicit PadNavigator(const QSize &size, QWidget *parent = 0);
+ explicit PadNavigator(const QSize &size, QWidget *parent = nullptr);
protected:
void resizeEvent(QResizeEvent *event) override;
diff --git a/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp b/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp
index 82205050ec..b4ea489069 100644
--- a/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp
+++ b/examples/widgets/graphicsview/padnavigator/roundrectitem.cpp
@@ -50,7 +50,7 @@
#include "roundrectitem.h"
-#include <QApplication>
+#include <QGuiApplication>
#include <QPainter>
#include <QPalette>
@@ -98,7 +98,7 @@ void RoundRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
//! [3]
//! [4]
if (fillRect)
- painter->setBrush(QApplication::palette().brush(QPalette::Window));
+ painter->setBrush(QGuiApplication::palette().brush(QPalette::Window));
else
painter->setBrush(gradient);
painter->setPen(QPen(Qt::black, 1));
diff --git a/examples/widgets/graphicsview/padnavigator/roundrectitem.h b/examples/widgets/graphicsview/padnavigator/roundrectitem.h
index e76862c08c..91b3e6542e 100644
--- a/examples/widgets/graphicsview/padnavigator/roundrectitem.h
+++ b/examples/widgets/graphicsview/padnavigator/roundrectitem.h
@@ -61,13 +61,13 @@ class RoundRectItem : public QGraphicsObject
Q_PROPERTY(bool fill READ fill WRITE setFill)
public:
RoundRectItem(const QRectF &bounds, const QColor &color,
- QGraphicsItem *parent = 0);
+ QGraphicsItem *parent = nullptr);
QPixmap pixmap() const;
void setPixmap(const QPixmap &pixmap);
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
bool fill() const;
void setFill(bool fill);
diff --git a/examples/widgets/graphicsview/padnavigator/splashitem.h b/examples/widgets/graphicsview/padnavigator/splashitem.h
index 2ad54f82a1..b8e723db81 100644
--- a/examples/widgets/graphicsview/padnavigator/splashitem.h
+++ b/examples/widgets/graphicsview/padnavigator/splashitem.h
@@ -58,10 +58,10 @@ class SplashItem : public QGraphicsObject
{
Q_OBJECT
public:
- explicit SplashItem(QGraphicsItem *parent = 0);
+ explicit SplashItem(QGraphicsItem *parent = nullptr);
QRectF boundingRect() const override;
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0) override;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
private:
QString text;
diff --git a/examples/widgets/graphicsview/simpleanchorlayout/main.cpp b/examples/widgets/graphicsview/simpleanchorlayout/main.cpp
index 299a5ad7bd..a5f450c1f9 100644
--- a/examples/widgets/graphicsview/simpleanchorlayout/main.cpp
+++ b/examples/widgets/graphicsview/simpleanchorlayout/main.cpp
@@ -54,7 +54,7 @@ class Widget : public QGraphicsWidget
{
public:
Widget(const QColor &color, const QColor &textColor, const QString &caption,
- QGraphicsItem *parent = 0)
+ QGraphicsItem *parent = nullptr)
: QGraphicsWidget(parent)
, caption(caption)
, color(color)
@@ -62,7 +62,7 @@ public:
{
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * = 0) override
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override
{
QFont font;
font.setPixelSize(0.75 * qMin(boundingRect().width(), boundingRect().height()));
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
- QGraphicsScene *scene = new QGraphicsScene();
+ QGraphicsScene scene;
Widget *a = new Widget(Qt::blue, Qt::white, "a");
a->setPreferredSize(100, 100);
@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
Widget *c = new Widget(Qt::red, Qt::black, "c");
c->setPreferredSize(100, 100);
- QGraphicsAnchorLayout *layout = new QGraphicsAnchorLayout();
+ QGraphicsAnchorLayout *layout = new QGraphicsAnchorLayout;
/*
//! [adding a corner anchor in two steps]
layout->addAnchor(a, Qt::AnchorTop, layout, Qt::AnchorTop);
@@ -128,20 +128,20 @@ int main(int argc, char *argv[])
// corner of the layout.
layout->addCornerAnchors(c, Qt::BottomRightCorner, layout, Qt::BottomRightCorner);
- QGraphicsWidget *w = new QGraphicsWidget(0, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
+ auto w = new QGraphicsWidget(nullptr, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
w->setPos(20, 20);
w->setMinimumSize(100, 100);
w->setPreferredSize(320, 240);
w->setLayout(layout);
w->setWindowTitle(QApplication::translate("simpleanchorlayout", "QGraphicsAnchorLayout in use"));
- scene->addItem(w);
+ scene.addItem(w);
- QGraphicsView *view = new QGraphicsView();
- view->setScene(scene);
- view->setWindowTitle(QApplication::translate("simpleanchorlayout", "Simple Anchor Layout"));
+ QGraphicsView view;
+ view.setScene(&scene);
+ view.setWindowTitle(QApplication::translate("simpleanchorlayout", "Simple Anchor Layout"));
- view->resize(360, 320);
- view->show();
+ view.resize(360, 320);
+ view.show();
return app.exec();
}
diff --git a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
index 81db2780b4..5c623b1d00 100644
--- a/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
+++ b/examples/widgets/graphicsview/weatheranchorlayout/main.cpp
@@ -50,15 +50,14 @@
#include <QApplication>
#include <QLabel>
-#include <QPainter>
-#include <QPushButton>
-
#include <QGraphicsAnchorLayout>
#include <QGraphicsProxyWidget>
#include <QGraphicsScene>
#include <QGraphicsSceneResizeEvent>
#include <QGraphicsView>
#include <QGraphicsWidget>
+#include <QPainter>
+#include <QPushButton>
class GraphicsView : public QGraphicsView
@@ -79,20 +78,18 @@ public:
class PixmapWidget : public QGraphicsLayoutItem
{
-
public:
PixmapWidget(const QPixmap &pix)
- : QGraphicsLayoutItem()
+ : QGraphicsLayoutItem(), original(new QGraphicsPixmapItem(pix))
+ , r(QRectF(QPointF(0, 0), pix.size()))
{
- original = new QGraphicsPixmapItem(pix);
setGraphicsItem(original);
original->show();
- r = QRectF(QPointF(0, 0), pix.size());
}
~PixmapWidget()
{
- setGraphicsItem(0);
+ setGraphicsItem(nullptr);
delete original;
}
@@ -101,7 +98,7 @@ public:
original->setZValue(z);
}
- void setGeometry (const QRectF &rect) override
+ void setGeometry(const QRectF &rect) override
{
original->setTransform(QTransform::fromScale(rect.width() / r.width(),
rect.height() / r.height()), true);
@@ -150,8 +147,7 @@ public:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
{
- QPointF reflection = QPointF();
- reflection.setY(scaled.height() + 2);
+ const QPointF reflection(0, scaled.height() + 2);
painter->drawPixmap(QPointF(), scaled);
@@ -239,7 +235,7 @@ int main(int argc, char *argv[])
layout->setSpacing(0);
// setup the main widget
- QGraphicsWidget *widget = new QGraphicsWidget(0, Qt::Window);
+ QGraphicsWidget *widget = new QGraphicsWidget(nullptr, Qt::Window);
QPalette p;
p.setColor(QPalette::Window, Qt::black);
widget->setPalette(p);
diff --git a/examples/widgets/itemviews/dirview/main.cpp b/examples/widgets/itemviews/dirview/main.cpp
index eefea657f6..fcdf4c7ba4 100644
--- a/examples/widgets/itemviews/dirview/main.cpp
+++ b/examples/widgets/itemviews/dirview/main.cpp
@@ -49,9 +49,9 @@
****************************************************************************/
#include <QApplication>
-#include <QDesktopWidget>
#include <QFileSystemModel>
#include <QFileIconProvider>
+#include <QScreen>
#include <QTreeView>
#include <QCommandLineParser>
#include <QCommandLineOption>
@@ -65,8 +65,10 @@ int main(int argc, char *argv[])
parser.setApplicationDescription("Qt Dir View Example");
parser.addHelpOption();
parser.addVersionOption();
- QCommandLineOption dontUseCustomDirectoryIconsOption("c", "Set QFileIconProvider::DontUseCustomDirectoryIcons");
+ QCommandLineOption dontUseCustomDirectoryIconsOption("c", "Set QFileSystemModel::DontUseCustomDirectoryIcons");
parser.addOption(dontUseCustomDirectoryIconsOption);
+ QCommandLineOption dontWatchOption("w", "Set QFileSystemModel::DontWatch");
+ parser.addOption(dontWatchOption);
parser.addPositionalArgument("directory", "The directory to start in.");
parser.process(app);
const QString rootPath = parser.positionalArguments().isEmpty()
@@ -75,7 +77,9 @@ int main(int argc, char *argv[])
QFileSystemModel model;
model.setRootPath("");
if (parser.isSet(dontUseCustomDirectoryIconsOption))
- model.iconProvider()->setOptions(QFileIconProvider::DontUseCustomDirectoryIcons);
+ model.setOption(QFileSystemModel::DontUseCustomDirectoryIcons);
+ if (parser.isSet(dontWatchOption))
+ model.setOption(QFileSystemModel::DontWatchForChanges);
QTreeView tree;
tree.setModel(&model);
if (!rootPath.isEmpty()) {
@@ -88,7 +92,7 @@ int main(int argc, char *argv[])
tree.setAnimated(false);
tree.setIndentation(20);
tree.setSortingEnabled(true);
- const QSize availableSize = QApplication::desktop()->availableGeometry(&tree).size();
+ const QSize availableSize = tree.screen()->availableGeometry().size();
tree.resize(availableSize / 2);
tree.setColumnWidth(0, tree.width() / 3);
diff --git a/examples/widgets/itemviews/frozencolumn/main.cpp b/examples/widgets/itemviews/frozencolumn/main.cpp
index 6f2b4a8d71..2965617ba1 100644
--- a/examples/widgets/itemviews/frozencolumn/main.cpp
+++ b/examples/widgets/itemviews/frozencolumn/main.cpp
@@ -71,7 +71,7 @@ int main(int argc, char* argv[])
model->setHorizontalHeaderLabels(list);
int row = 0;
- QStandardItem *newItem = 0;
+ QStandardItem *newItem = nullptr;
while (!stream.atEnd()) {
line = stream.readLine();
if (!line.startsWith('#') && line.contains(',')) {
diff --git a/examples/widgets/itemviews/interview/model.cpp b/examples/widgets/itemviews/interview/model.cpp
index feaf8bb98c..519164999d 100644
--- a/examples/widgets/itemviews/interview/model.cpp
+++ b/examples/widgets/itemviews/interview/model.cpp
@@ -132,7 +132,7 @@ bool Model::hasChildren(const QModelIndex &parent) const
Qt::ItemFlags Model::flags(const QModelIndex &index) const
{
if (!index.isValid())
- return 0;
+ return {};
return Qt::ItemIsDragEnabled|QAbstractItemModel::flags(index);
}
@@ -146,7 +146,7 @@ Model::Node *Model::node(int row, Node *parent) const
Model::Node *Model::parent(Node *child) const
{
- return child ? child->parent : 0;
+ return child ? child->parent : nullptr;
}
int Model::row(Node *node) const
diff --git a/examples/widgets/itemviews/stardelegate/main.cpp b/examples/widgets/itemviews/stardelegate/main.cpp
index 452976bba0..5ca85a6151 100644
--- a/examples/widgets/itemviews/stardelegate/main.cpp
+++ b/examples/widgets/itemviews/stardelegate/main.cpp
@@ -48,7 +48,8 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
+#include <QTableWidget>
#include "stardelegate.h"
#include "stareditor.h"
@@ -57,7 +58,7 @@
//! [0]
void populateTableWidget(QTableWidget *tableWidget)
{
- static const struct {
+ static constexpr struct {
const char *title;
const char *genre;
const char *artist;
@@ -70,12 +71,12 @@ void populateTableWidget(QTableWidget *tableWidget)
{ "Sex Bomb", "Pop", "Tom Jones", 3 },
{ "Barbie Girl", "Pop", "Aqua", 5 },
//! [2]
- { 0, 0, 0, 0 }
+ { nullptr, nullptr, nullptr, 0 }
//! [2] //! [3]
};
//! [3] //! [4]
- for (int row = 0; staticData[row].title != 0; ++row) {
+ for (int row = 0; staticData[row].title != nullptr; ++row) {
QTableWidgetItem *item0 = new QTableWidgetItem(staticData[row].title);
QTableWidgetItem *item1 = new QTableWidgetItem(staticData[row].genre);
QTableWidgetItem *item2 = new QTableWidgetItem(staticData[row].artist);
diff --git a/examples/widgets/mainwindows/application/mainwindow.cpp b/examples/widgets/mainwindows/application/mainwindow.cpp
index 4b639ead18..d0c009427f 100644
--- a/examples/widgets/mainwindows/application/mainwindow.cpp
+++ b/examples/widgets/mainwindows/application/mainwindow.cpp
@@ -281,7 +281,7 @@ void MainWindow::readSettings()
QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
if (geometry.isEmpty()) {
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ const QRect availableGeometry = screen()->availableGeometry();
resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
move((availableGeometry.width() - width()) / 2,
(availableGeometry.height() - height()) / 2);
@@ -353,23 +353,27 @@ void MainWindow::loadFile(const QString &fileName)
bool MainWindow::saveFile(const QString &fileName)
//! [44] //! [45]
{
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("Application"),
- tr("Cannot write file %1:\n%2.")
- .arg(QDir::toNativeSeparators(fileName),
- file.errorString()));
- return false;
- }
+ QString errorMessage;
- QTextStream out(&file);
-#ifndef QT_NO_CURSOR
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
-#endif
- out << textEdit->toPlainText();
-#ifndef QT_NO_CURSOR
+ QSaveFile file(fileName);
+ if (file.open(QFile::WriteOnly | QFile::Text)) {
+ QTextStream out(&file);
+ out << textEdit->toPlainText();
+ if (!file.commit()) {
+ errorMessage = tr("Cannot write file %1:\n%2.")
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
+ }
+ } else {
+ errorMessage = tr("Cannot open file %1 for writing:\n%2.")
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
+ }
QGuiApplication::restoreOverrideCursor();
-#endif
+
+ if (!errorMessage.isEmpty()) {
+ QMessageBox::warning(this, tr("Application"), errorMessage);
+ return false;
+ }
setCurrentFile(fileName);
statusBar()->showMessage(tr("File saved"), 2000);
diff --git a/examples/widgets/mainwindows/mdi/mainwindow.cpp b/examples/widgets/mainwindows/mdi/mainwindow.cpp
index b952d19e2e..ccfa7435d7 100644
--- a/examples/widgets/mainwindows/mdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mdi/mainwindow.cpp
@@ -464,7 +464,7 @@ void MainWindow::readSettings()
QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
if (geometry.isEmpty()) {
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ const QRect availableGeometry = screen()->availableGeometry();
resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
move((availableGeometry.width() - width()) / 2,
(availableGeometry.height() - height()) / 2);
diff --git a/examples/widgets/mainwindows/mdi/mdichild.cpp b/examples/widgets/mainwindows/mdi/mdichild.cpp
index 16f2040de0..727d4f6cfd 100644
--- a/examples/widgets/mainwindows/mdi/mdichild.cpp
+++ b/examples/widgets/mainwindows/mdi/mdichild.cpp
@@ -115,19 +115,28 @@ bool MdiChild::saveAs()
bool MdiChild::saveFile(const QString &fileName)
{
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("MDI"),
- tr("Cannot write file %1:\n%2.")
- .arg(QDir::toNativeSeparators(fileName), file.errorString()));
- return false;
- }
+ QString errorMessage;
- QTextStream out(&file);
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
- out << toPlainText();
+ QSaveFile file(fileName);
+ if (file.open(QFile::WriteOnly | QFile::Text)) {
+ QTextStream out(&file);
+ out << toPlainText();
+ if (!file.commit()) {
+ errorMessage = tr("Cannot write file %1:\n%2.")
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
+ }
+ } else {
+ errorMessage = tr("Cannot open file %1 for writing:\n%2.")
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
+ }
QGuiApplication::restoreOverrideCursor();
+ if (!errorMessage.isEmpty()) {
+ QMessageBox::warning(this, tr("MDI"), errorMessage);
+ return false;
+ }
+
setCurrentFile(fileName);
return true;
}
diff --git a/examples/widgets/mainwindows/sdi/mainwindow.cpp b/examples/widgets/mainwindows/sdi/mainwindow.cpp
index 62a74b26e6..c3cd131923 100644
--- a/examples/widgets/mainwindows/sdi/mainwindow.cpp
+++ b/examples/widgets/mainwindows/sdi/mainwindow.cpp
@@ -167,7 +167,7 @@ void MainWindow::tile(const QMainWindow *previous)
if (!topFrameWidth)
topFrameWidth = 40;
const QPoint pos = previous->pos() + 2 * QPoint(topFrameWidth, topFrameWidth);
- if (QApplication::desktop()->availableGeometry(this).contains(rect().bottomRight() + pos))
+ if (screen()->availableGeometry().contains(rect().bottomRight() + pos))
move(pos);
}
@@ -290,7 +290,7 @@ void MainWindow::readSettings()
QSettings settings(QCoreApplication::organizationName(), QCoreApplication::applicationName());
const QByteArray geometry = settings.value("geometry", QByteArray()).toByteArray();
if (geometry.isEmpty()) {
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ const QRect availableGeometry = screen()->availableGeometry();
resize(availableGeometry.width() / 3, availableGeometry.height() / 2);
move((availableGeometry.width() - width()) / 2,
(availableGeometry.height() - height()) / 2);
@@ -425,19 +425,28 @@ void MainWindow::openRecentFile()
bool MainWindow::saveFile(const QString &fileName)
{
- QFile file(fileName);
- if (!file.open(QFile::WriteOnly | QFile::Text)) {
- QMessageBox::warning(this, tr("SDI"),
- tr("Cannot write file %1:\n%2.")
- .arg(QDir::toNativeSeparators(fileName), file.errorString()));
- return false;
- }
+ QString errorMessage;
- QTextStream out(&file);
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
- out << textEdit->toPlainText();
+ QSaveFile file(fileName);
+ if (file.open(QFile::WriteOnly | QFile::Text)) {
+ QTextStream out(&file);
+ out << textEdit->toPlainText();
+ if (!file.commit()) {
+ errorMessage = tr("Cannot write file %1:\n%2.")
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
+ }
+ } else {
+ errorMessage = tr("Cannot open file %1 for writing:\n%2.")
+ .arg(QDir::toNativeSeparators(fileName), file.errorString());
+ }
QGuiApplication::restoreOverrideCursor();
+ if (!errorMessage.isEmpty()) {
+ QMessageBox::warning(this, tr("SDI"), errorMessage);
+ return false;
+ }
+
setCurrentFile(fileName);
statusBar()->showMessage(tr("File saved"), 2000);
return true;
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp
index dc01acf453..50acf0f814 100644
--- a/examples/widgets/painting/affine/xform.cpp
+++ b/examples/widgets/painting/affine/xform.cpp
@@ -160,10 +160,7 @@ void XFormView::updateCtrlPoints(const QPolygonF &points)
ctrlPoints = points;
QLineF line(ctrlPoints.at(0), ctrlPoints.at(1));
- m_rotation = line.angle(QLineF(0, 0, 1, 0));
- if (line.dy() < 0)
- m_rotation = 360 - m_rotation;
-
+ m_rotation = 360 - QLineF(0, 0, 1, 0).angleTo(line);
if (trans.isNull())
emit rotationChanged(int(m_rotation*10));
}
@@ -263,7 +260,7 @@ void XFormView::timerEvent(QTimerEvent *e)
#if QT_CONFIG(wheelevent)
void XFormView::wheelEvent(QWheelEvent *e)
{
- m_scale += e->delta() / qreal(600);
+ m_scale += e->angleDelta().y() / qreal(600);
m_scale = qMax(qreal(0.1), qMin(qreal(4), m_scale));
emit scaleChanged(int(m_scale*1000));
}
diff --git a/examples/widgets/painting/composition/composition.cpp b/examples/widgets/painting/composition/composition.cpp
index 9bd71735a0..a220fb42fa 100644
--- a/examples/widgets/painting/composition/composition.cpp
+++ b/examples/widgets/painting/composition/composition.cpp
@@ -224,6 +224,10 @@ CompositionWidget::CompositionWidget(QWidget *parent)
setWindowTitle(tr("Composition Modes"));
}
+CompositionWidget::~CompositionWidget()
+{
+}
+
void CompositionWidget::nextMode()
{
@@ -265,6 +269,10 @@ CompositionRenderer::CompositionRenderer(QWidget *parent)
#endif
}
+CompositionRenderer::~CompositionRenderer()
+{
+}
+
QRectF rectangle_around(const QPointF &p, const QSizeF &size = QSize(250, 200))
{
QRectF rect(p, size);
@@ -371,7 +379,7 @@ void CompositionRenderer::paint(QPainter *painter)
if (size() != m_previous_size) {
m_previous_size = size();
- QPainter p(m_fbo.data());
+ QPainter p(m_fbo.get());
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(QRect(QPoint(0, 0), size()), Qt::transparent);
p.setCompositionMode(QPainter::CompositionMode_SourceOver);
@@ -382,7 +390,7 @@ void CompositionRenderer::paint(QPainter *painter)
painter->beginNativePainting();
{
- QPainter p(m_fbo.data());
+ QPainter p(m_fbo.get());
p.beginNativePainting();
m_blitter.bind();
const QRect targetRect(QPoint(0, 0), m_fbo->size());
diff --git a/examples/widgets/painting/composition/composition.h b/examples/widgets/painting/composition/composition.h
index 19150e2024..52ca7919b0 100644
--- a/examples/widgets/painting/composition/composition.h
+++ b/examples/widgets/painting/composition/composition.h
@@ -61,6 +61,8 @@
#include <QPainter>
#include <QEvent>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QPushButton;
class QRadioButton;
@@ -71,7 +73,8 @@ class CompositionWidget : public QWidget
Q_OBJECT
public:
- CompositionWidget(QWidget *parent);
+ explicit CompositionWidget(QWidget *parent = nullptr);
+ ~CompositionWidget();
public slots:
void nextMode();
@@ -117,7 +120,8 @@ class CompositionRenderer : public ArthurFrame
Q_PROPERTY(bool animation READ animationEnabled WRITE setAnimationEnabled)
public:
- CompositionRenderer(QWidget *parent);
+ explicit CompositionRenderer(QWidget *parent = nullptr);
+ ~CompositionRenderer();
void paint(QPainter *) override;
@@ -188,7 +192,7 @@ private:
int m_animationTimer;
#if QT_CONFIG(opengl)
- QScopedPointer<QFboPaintDevice> m_fbo;
+ std::unique_ptr<QFboPaintDevice> m_fbo;
int m_pbuffer_size; // width==height==size of pbuffer
uint m_base_tex;
uint m_compositing_tex;
diff --git a/examples/widgets/painting/composition/main.cpp b/examples/widgets/painting/composition/main.cpp
index 2eaeaba2c5..1ffa29dddc 100644
--- a/examples/widgets/painting/composition/main.cpp
+++ b/examples/widgets/painting/composition/main.cpp
@@ -56,13 +56,13 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ QScopedPointer<QStyle> arthurStyle(new ArthurStyle());
CompositionWidget compWidget(nullptr);
- QStyle *arthurStyle = new ArthurStyle();
- compWidget.setStyle(arthurStyle);
+ compWidget.setStyle(arthurStyle.data());
const QList<QWidget *> widgets = compWidget.findChildren<QWidget *>();
for (QWidget *w : widgets)
- w->setStyle(arthurStyle);
+ w->setStyle(arthurStyle.data());
compWidget.show();
return app.exec();
diff --git a/examples/widgets/painting/deform/pathdeform.cpp b/examples/widgets/painting/deform/pathdeform.cpp
index 64e81f8cab..d5c8746247 100644
--- a/examples/widgets/painting/deform/pathdeform.cpp
+++ b/examples/widgets/painting/deform/pathdeform.cpp
@@ -262,7 +262,7 @@ PathDeformWidget::PathDeformWidget(QWidget *parent, bool smallScreen)
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->addWidget(m_renderer);
- m_controls = new PathDeformControls(0, m_renderer, smallScreen);
+ m_controls = new PathDeformControls(nullptr, m_renderer, smallScreen);
m_controls->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
if (!smallScreen)
diff --git a/examples/widgets/painting/deform/pathdeform.h b/examples/widgets/painting/deform/pathdeform.h
index b7c7386e2a..af869badc9 100644
--- a/examples/widgets/painting/deform/pathdeform.h
+++ b/examples/widgets/painting/deform/pathdeform.h
@@ -54,7 +54,7 @@
#include "arthurwidgets.h"
#include <QBasicTimer>
-#include <QDateTime>
+#include <QElapsedTimer>
#include <QPainterPath>
class PathDeformRenderer : public ArthurFrame
@@ -103,7 +103,7 @@ private:
QBasicTimer m_repaintTimer;
// QBasicTimer m_fpsTimer;
// int m_fpsCounter;
- QTime m_repaintTracker;
+ QElapsedTimer m_repaintTracker;
QVector<QPainterPath> m_paths;
QVector<QPointF> m_advances;
diff --git a/examples/widgets/painting/fontsampler/mainwindow.h b/examples/widgets/painting/fontsampler/mainwindow.h
index ffb2839ffa..34e54440d4 100644
--- a/examples/widgets/painting/fontsampler/mainwindow.h
+++ b/examples/widgets/painting/fontsampler/mainwindow.h
@@ -70,7 +70,7 @@ class MainWindow : public QMainWindow, private Ui::MainWindowBase
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
public slots:
void on_clearAction_triggered();
diff --git a/examples/widgets/painting/gradients/gradients.cpp b/examples/widgets/painting/gradients/gradients.cpp
index 7abaef771b..d62ae93a15 100644
--- a/examples/widgets/painting/gradients/gradients.cpp
+++ b/examples/widgets/painting/gradients/gradients.cpp
@@ -72,7 +72,7 @@ ShadeWidget::ShadeWidget(ShadeType type, QWidget *parent)
setPalette(pal);
} else {
- setAttribute(Qt::WA_NoBackground);
+ setAttribute(Qt::WA_OpaquePaintEvent);
}
QPolygonF points;
@@ -102,9 +102,9 @@ uint ShadeWidget::colorAt(int x)
generateShade();
QPolygonF pts = m_hoverPoints->points();
- for (int i=1; i < pts.size(); ++i) {
- if (pts.at(i-1).x() <= x && pts.at(i).x() >= x) {
- QLineF l(pts.at(i-1), pts.at(i));
+ for (int i = 1; i < pts.size(); ++i) {
+ if (pts.at(i - 1).x() <= x && pts.at(i).x() >= x) {
+ QLineF l(pts.at(i - 1), pts.at(i));
l.setLength(l.length() * ((x - l.x1()) / l.dx()));
return m_shade.pixel(qRound(qMin(l.x2(), (qreal(m_shade.width() - 1)))),
qRound(qMin(l.y2(), qreal(m_shade.height() - 1))));
@@ -118,9 +118,9 @@ void ShadeWidget::setGradientStops(const QGradientStops &stops)
if (m_shade_type == ARGBShade) {
m_alpha_gradient = QLinearGradient(0, 0, width(), 0);
- for (int i=0; i<stops.size(); ++i) {
- QColor c = stops.at(i).second;
- m_alpha_gradient.setColorAt(stops.at(i).first, QColor(c.red(), c.green(), c.blue()));
+ for (const auto &stop : stops) {
+ QColor c = stop.second;
+ m_alpha_gradient.setColorAt(stop.first, QColor(c.red(), c.green(), c.blue()));
}
m_shade = QImage();
@@ -223,13 +223,13 @@ void GradientEditor::pointsUpdated()
std::sort(points.begin(), points.end(), x_less_than);
for (int i = 0; i < points.size(); ++i) {
- qreal x = int(points.at(i).x());
- if (i + 1 < points.size() && x == points.at(i + 1).x())
+ const int x = int(points.at(i).x());
+ if (i + 1 < points.size() && x == int(points.at(i + 1).x()))
continue;
- QColor color((0x00ff0000 & m_red_shade->colorAt(int(x))) >> 16,
- (0x0000ff00 & m_green_shade->colorAt(int(x))) >> 8,
- (0x000000ff & m_blue_shade->colorAt(int(x))),
- (0xff000000 & m_alpha_shade->colorAt(int(x))) >> 24);
+ QColor color((0x00ff0000 & m_red_shade->colorAt(x)) >> 16,
+ (0x0000ff00 & m_green_shade->colorAt(x)) >> 8,
+ (0x000000ff & m_blue_shade->colorAt(x)),
+ (0xff000000 & m_alpha_shade->colorAt(x)) >> 24);
if (x / w > 1)
return;
@@ -564,14 +564,12 @@ void GradientRenderer::paint(QPainter *p)
} else {
QLineF l(pts.at(0), pts.at(1));
- qreal angle = l.angle(QLineF(0, 0, 1, 0));
- if (l.dy() > 0)
- angle = 360 - angle;
+ qreal angle = QLineF(0, 0, 1, 0).angleTo(l);
g = QConicalGradient(pts.at(0), angle);
}
- for (int i = 0; i < m_stops.size(); ++i)
- g.setColorAt(m_stops.at(i).first, m_stops.at(i).second);
+ for (const auto &stop : qAsConst(m_stops))
+ g.setColorAt(stop.first, stop.second);
g.setSpread(m_spread);
diff --git a/examples/widgets/painting/gradients/gradients.h b/examples/widgets/painting/gradients/gradients.h
index c6525d18f8..45ef5d0f93 100644
--- a/examples/widgets/painting/gradients/gradients.h
+++ b/examples/widgets/painting/gradients/gradients.h
@@ -157,7 +157,7 @@ class GradientWidget : public QWidget
Q_OBJECT
public:
- GradientWidget(QWidget *parent);
+ GradientWidget(QWidget *parent = nullptr);
public slots:
void setDefault1() { setDefault(1); }
diff --git a/examples/widgets/painting/gradients/main.cpp b/examples/widgets/painting/gradients/main.cpp
index 539d67e40e..0ddf7a4579 100644
--- a/examples/widgets/painting/gradients/main.cpp
+++ b/examples/widgets/painting/gradients/main.cpp
@@ -58,8 +58,8 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
- GradientWidget gradientWidget(0);
- QStyle *arthurStyle = new ArthurStyle();
+ GradientWidget gradientWidget;
+ QStyle *arthurStyle = new ArthurStyle;
gradientWidget.setStyle(arthurStyle);
const QList<QWidget *> widgets = gradientWidget.findChildren<QWidget *>();
for (QWidget *w : widgets) {
diff --git a/examples/widgets/painting/painterpaths/renderarea.h b/examples/widgets/painting/painterpaths/renderarea.h
index 5f0874b772..4b3ea5a397 100644
--- a/examples/widgets/painting/painterpaths/renderarea.h
+++ b/examples/widgets/painting/painterpaths/renderarea.h
@@ -60,7 +60,7 @@ class RenderArea : public QWidget
Q_OBJECT
public:
- explicit RenderArea(const QPainterPath &path, QWidget *parent = 0);
+ explicit RenderArea(const QPainterPath &path, QWidget *parent = nullptr);
QSize minimumSizeHint() const override;
QSize sizeHint() const override;
diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp
index 03e55bb2a2..a850ce2672 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.cpp
+++ b/examples/widgets/painting/pathstroke/pathstroke.cpp
@@ -48,11 +48,9 @@
**
****************************************************************************/
+#include "pathstroke.h"
#include "arthurstyle.h"
#include "arthurwidgets.h"
-#include "pathstroke.h"
-
-#include <stdio.h>
extern void draw_round_rect(QPainter *p, const QRect &bounds, int radius);
@@ -164,24 +162,39 @@ void PathStrokeControls::createCommonControls(QWidget* parent)
// Connections
- connect(flatCap, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setFlatCap);
- connect(squareCap, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setSquareCap);
- connect(roundCap, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setRoundCap);
-
- connect(bevelJoin, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setBevelJoin);
- connect(miterJoin, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setMiterJoin);
- connect(svgMiterJoin, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setSvgMiterJoin);
- connect(roundJoin, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setRoundJoin);
-
- connect(curveMode, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setCurveMode);
- connect(lineMode, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setLineMode);
-
- connect(solidLine, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setSolidLine);
- connect(dashLine, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setDashLine);
- connect(dotLine, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setDotLine);
- connect(dashDotLine, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setDashDotLine);
- connect(dashDotDotLine, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setDashDotDotLine);
- connect(customDashLine, &QAbstractButton::clicked, m_renderer, &PathStrokeRenderer::setCustomDashLine);
+ connect(flatCap, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setFlatCap);
+ connect(squareCap, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setSquareCap);
+ connect(roundCap, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setRoundCap);
+
+ connect(bevelJoin, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setBevelJoin);
+ connect(miterJoin, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setMiterJoin);
+ connect(svgMiterJoin, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setSvgMiterJoin);
+ connect(roundJoin, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setRoundJoin);
+
+ connect(curveMode, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setCurveMode);
+ connect(lineMode, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setLineMode);
+
+ connect(solidLine, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setSolidLine);
+ connect(dashLine, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setDashLine);
+ connect(dotLine, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setDotLine);
+ connect(dashDotLine, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setDashDotLine);
+ connect(dashDotDotLine, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setDashDotDotLine);
+ connect(customDashLine, &QAbstractButton::clicked,
+ m_renderer, &PathStrokeRenderer::setCustomDashLine);
// Set the defaults:
flatCap->setChecked(true);
@@ -247,15 +260,20 @@ void PathStrokeControls::layoutForDesktop()
// Set up connections
- connect(animated, &QAbstractButton::toggled, m_renderer, &PathStrokeRenderer::setAnimation);
+ connect(animated, &QAbstractButton::toggled,
+ m_renderer, &PathStrokeRenderer::setAnimation);
- connect(penWidth, &QAbstractSlider::valueChanged, m_renderer, &PathStrokeRenderer::setPenWidth);
+ connect(penWidth, &QAbstractSlider::valueChanged,
+ m_renderer, &PathStrokeRenderer::setPenWidth);
- connect(showSourceButton, &QAbstractButton::clicked, m_renderer, &ArthurFrame::showSource);
+ connect(showSourceButton, &QAbstractButton::clicked,
+ m_renderer, &ArthurFrame::showSource);
#if QT_CONFIG(opengl)
- connect(enableOpenGLButton, &QAbstractButton::clicked, m_renderer, &ArthurFrame::enableOpenGL);
+ connect(enableOpenGLButton, &QAbstractButton::clicked,
+ m_renderer, &ArthurFrame::enableOpenGL);
#endif
- connect(whatsThisButton, &QAbstractButton::clicked, m_renderer, &ArthurFrame::setDescriptionEnabled);
+ connect(whatsThisButton, &QAbstractButton::clicked,
+ m_renderer, &ArthurFrame::setDescriptionEnabled);
connect(m_renderer, &ArthurFrame::descriptionEnabledChanged,
whatsThisButton, &QAbstractButton::setChecked);
@@ -296,11 +314,11 @@ void PathStrokeControls::layoutForSmallScreens()
#endif
// Layouts:
- QHBoxLayout *penWidthLayout = new QHBoxLayout(0);
+ QHBoxLayout *penWidthLayout = new QHBoxLayout;
penWidthLayout->addWidget(penWidthLabel, 0, Qt::AlignRight);
penWidthLayout->addWidget(penWidth);
- QVBoxLayout *leftLayout = new QVBoxLayout(0);
+ QVBoxLayout *leftLayout = new QVBoxLayout;
leftLayout->addWidget(m_capGroup);
leftLayout->addWidget(m_joinGroup);
#if QT_CONFIG(opengl)
@@ -308,7 +326,7 @@ void PathStrokeControls::layoutForSmallScreens()
#endif
leftLayout->addLayout(penWidthLayout);
- QVBoxLayout *rightLayout = new QVBoxLayout(0);
+ QVBoxLayout *rightLayout = new QVBoxLayout;
rightLayout->addWidget(m_styleGroup);
rightLayout->addWidget(m_pathModeGroup);
@@ -356,7 +374,7 @@ PathStrokeWidget::PathStrokeWidget(bool smallScreen)
// Widget construction and property setting
m_renderer = new PathStrokeRenderer(this, smallScreen);
- m_controls = new PathStrokeControls(0, m_renderer, smallScreen);
+ m_controls = new PathStrokeControls(nullptr, m_renderer, smallScreen);
// Layouting
QHBoxLayout *viewLayout = new QHBoxLayout(this);
@@ -383,10 +401,10 @@ void PathStrokeWidget::hideControls()
m_controls->hide();
}
-void PathStrokeWidget::setStyle( QStyle * style )
+void PathStrokeWidget::setStyle(QStyle *style)
{
QWidget::setStyle(style);
- if (m_controls != 0)
+ if (m_controls != nullptr)
{
m_controls->setStyle(style);
@@ -516,7 +534,7 @@ void PathStrokeRenderer::updatePoints()
qreal bottom = height() - pad;
Q_ASSERT(m_points.size() == m_vectors.size());
- for (int i=0; i<m_points.size(); ++i) {
+ for (int i = 0; i < m_points.size(); ++i) {
QPointF pos = m_points.at(i);
QPointF vec = m_vectors.at(i);
pos += vec;
@@ -540,7 +558,7 @@ void PathStrokeRenderer::mousePressEvent(QMouseEvent *e)
setDescriptionEnabled(false);
m_activePoint = -1;
qreal distance = -1;
- for (int i=0; i<m_points.size(); ++i) {
+ for (int i = 0; i < m_points.size(); ++i) {
qreal d = QLineF(e->pos(), m_points.at(i)).length();
if ((distance < 0 && d < 8 * m_pointSize) || d < distance) {
distance = d;
@@ -611,7 +629,8 @@ bool PathStrokeRenderer::event(QEvent *e)
case Qt::TouchPointPressed:
{
// find the point, move it
- QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values());
+ const auto mappedPoints = m_fingerPointMapping.values();
+ QSet<int> activePoints = QSet<int>(mappedPoints.begin(), mappedPoints.end());
int activePoint = -1;
qreal distance = -1;
const int pointsCount = m_points.size();
@@ -672,7 +691,6 @@ bool PathStrokeRenderer::event(QEvent *e)
m_fingerPointMapping.clear();
setAnimation(m_wasAnimated);
return true;
- break;
default:
break;
}
diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h
index 7bc7e09003..b559ed2ba0 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.h
+++ b/examples/widgets/painting/pathstroke/pathstroke.h
@@ -169,7 +169,7 @@ class PathStrokeWidget : public QWidget
public:
PathStrokeWidget(bool smallScreen);
- void setStyle ( QStyle * style );
+ void setStyle(QStyle *style);
private:
PathStrokeRenderer *m_renderer;
diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp
index 3fc461bbd2..31be899357 100644
--- a/examples/widgets/painting/shared/arthurstyle.cpp
+++ b/examples/widgets/painting/shared/arthurstyle.cpp
@@ -457,7 +457,7 @@ void ArthurStyle::polish(QWidget *widget)
QPalette pal = widget->palette();
if (widget->isWindow()) {
- pal.setColor(QPalette::Background, QColor(241, 241, 241));
+ pal.setColor(QPalette::Window, QColor(241, 241, 241));
widget->setPalette(pal);
}
@@ -474,7 +474,7 @@ void ArthurStyle::unpolish(QWidget *widget)
void ArthurStyle::polish(QPalette &palette)
{
- palette.setColor(QPalette::Background, QColor(241, 241, 241));
+ palette.setColor(QPalette::Window, QColor(241, 241, 241));
}
QRect ArthurStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
diff --git a/examples/widgets/painting/shared/arthurstyle.h b/examples/widgets/painting/shared/arthurstyle.h
index 8ea8354bab..64c888b636 100644
--- a/examples/widgets/painting/shared/arthurstyle.h
+++ b/examples/widgets/painting/shared/arthurstyle.h
@@ -63,7 +63,7 @@ public:
void drawHoverRect(QPainter *painter, const QRect &rect) const;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget = 0) const override;
+ QPainter *painter, const QWidget *widget = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const override;
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
diff --git a/examples/widgets/painting/shared/arthurwidgets.cpp b/examples/widgets/painting/shared/arthurwidgets.cpp
index bdac5de13c..40d712c9e3 100644
--- a/examples/widgets/painting/shared/arthurwidgets.cpp
+++ b/examples/widgets/painting/shared/arthurwidgets.cpp
@@ -136,7 +136,7 @@ void ArthurFrame::createGlWindow()
void ArthurFrame::paintEvent(QPaintEvent *e)
{
- static QImage *static_image = 0;
+ static QImage *static_image = nullptr;
QPainter painter;
@@ -153,7 +153,7 @@ void ArthurFrame::paintEvent(QPaintEvent *e)
int o = 10;
- QBrush bg = palette().brush(QPalette::Background);
+ QBrush bg = palette().brush(QPalette::Window);
painter.fillRect(0, 0, o, o, bg);
painter.fillRect(width() - o, 0, o, o, bg);
painter.fillRect(0, height() - o, o, o, bg);
@@ -376,7 +376,7 @@ void ArthurFrame::showSource()
const QString html = QStringLiteral("<html><pre>") + contents + QStringLiteral("</pre></html>");
- QTextBrowser *sourceViewer = new QTextBrowser(0);
+ QTextBrowser *sourceViewer = new QTextBrowser;
sourceViewer->setWindowTitle(tr("Source: %1").arg(m_sourceFileName.midRef(5)));
sourceViewer->setParent(this, Qt::Dialog);
sourceViewer->setAttribute(Qt::WA_DeleteOnClose);
diff --git a/examples/widgets/painting/shared/fbopaintdevice.cpp b/examples/widgets/painting/shared/fbopaintdevice.cpp
index 8207090cc8..9368293218 100644
--- a/examples/widgets/painting/shared/fbopaintdevice.cpp
+++ b/examples/widgets/painting/shared/fbopaintdevice.cpp
@@ -53,7 +53,7 @@
#include <QOffscreenSurface>
#include <QOpenGLFunctions>
-QFboPaintDevice::QFboPaintDevice(const QSize& size, bool flipped, bool clearOnInit,
+QFboPaintDevice::QFboPaintDevice(const QSize &size, bool flipped, bool clearOnInit,
QOpenGLFramebufferObject::Attachment attachment)
: QOpenGLPaintDevice(size)
{
@@ -97,8 +97,8 @@ GLuint QFboPaintDevice::takeTexture()
QImage QFboPaintDevice::toImage() const
{
- QOpenGLContext* currentContext = QOpenGLContext::currentContext();
- QSurface* currentSurface = currentContext ? currentContext->surface() : 0;
+ QOpenGLContext *currentContext = QOpenGLContext::currentContext();
+ QSurface *currentSurface = currentContext ? currentContext->surface() : nullptr;
context()->makeCurrent(m_surface);
diff --git a/examples/widgets/painting/shared/fbopaintdevice.h b/examples/widgets/painting/shared/fbopaintdevice.h
index 78451af895..a42bcc756d 100644
--- a/examples/widgets/painting/shared/fbopaintdevice.h
+++ b/examples/widgets/painting/shared/fbopaintdevice.h
@@ -60,7 +60,7 @@
class QFboPaintDevice : public QOpenGLPaintDevice {
public:
- QFboPaintDevice(const QSize&, bool flipped = false, bool clearOnInit = true,
+ QFboPaintDevice(const QSize &size, bool flipped = false, bool clearOnInit = true,
QOpenGLFramebufferObject::Attachment = QOpenGLFramebufferObject::CombinedDepthStencil);
~QFboPaintDevice();
@@ -83,7 +83,7 @@ public:
private:
QOpenGLFramebufferObject *m_framebufferObject;
- QSurface* m_surface;
+ QSurface *m_surface;
};
#endif // QT_NO_OPENGL
diff --git a/examples/widgets/painting/shared/hoverpoints.cpp b/examples/widgets/painting/shared/hoverpoints.cpp
index 74c78088ad..2bf3963e9e 100644
--- a/examples/widgets/painting/shared/hoverpoints.cpp
+++ b/examples/widgets/painting/shared/hoverpoints.cpp
@@ -180,7 +180,8 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event)
case Qt::TouchPointPressed:
{
// find the point, move it
- QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values());
+ const auto mappedPoints = m_fingerPointMapping.values();
+ QSet<int> activePoints = QSet<int>(mappedPoints.begin(), mappedPoints.end());
int activePoint = -1;
qreal distance = -1;
const int pointsCount = m_points.size();
@@ -261,8 +262,8 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event)
case QEvent::Paint:
{
QWidget *that_widget = m_widget;
- m_widget = 0;
- QApplication::sendEvent(object, event);
+ m_widget = nullptr;
+ QCoreApplication::sendEvent(object, event);
m_widget = that_widget;
paintPoints();
return true;
diff --git a/examples/widgets/painting/transformations/renderarea.h b/examples/widgets/painting/transformations/renderarea.h
index 140be27b2b..d4be7cefa4 100644
--- a/examples/widgets/painting/transformations/renderarea.h
+++ b/examples/widgets/painting/transformations/renderarea.h
@@ -70,7 +70,7 @@ class RenderArea : public QWidget
Q_OBJECT
public:
- RenderArea(QWidget *parent = 0);
+ RenderArea(QWidget *parent = nullptr);
void setOperations(const QList<Operation> &operations);
void setShape(const QPainterPath &shape);
diff --git a/examples/widgets/qnx/foreignwindows/collector.cpp b/examples/widgets/qnx/foreignwindows/collector.cpp
new file mode 100644
index 0000000000..4b9e774945
--- /dev/null
+++ b/examples/widgets/qnx/foreignwindows/collector.cpp
@@ -0,0 +1,176 @@
+/***************************************************************************
+**
+** Copyright (C) 2018 QNX Software Systems. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include <QDebug>
+#include <QHBoxLayout>
+#include <QWindow>
+
+#include <algorithm>
+#include <screen/screen.h>
+
+#include "collector.h"
+
+constexpr int MANAGER_EVENT_NAME_SUGGESTION = 9999;
+
+Collector::Collector(QWidget *parent)
+ : QWidget(parent)
+{
+ QApplication::instance()->installNativeEventFilter(this);
+
+ QLayout *layout = new QHBoxLayout(this);
+ setLayout(layout);
+}
+
+Collector::~Collector()
+{
+ QApplication::instance()->removeNativeEventFilter(this);
+}
+
+bool Collector::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
+{
+ Q_UNUSED(result);
+
+ if (eventType == QByteArrayLiteral("screen_event_t"))
+ return filterQnxScreenEvent(static_cast<screen_event_t>(message));
+
+ return false;
+}
+
+bool Collector::filterQnxScreenEvent(screen_event_t event)
+{
+ int objectType = SCREEN_OBJECT_TYPE_CONTEXT;
+ screen_get_event_property_iv(event, SCREEN_PROPERTY_OBJECT_TYPE, &objectType);
+
+ if (objectType == SCREEN_OBJECT_TYPE_WINDOW)
+ return filterQnxScreenWindowEvent(event);
+
+ return false;
+}
+
+bool Collector::filterQnxScreenWindowEvent(screen_event_t event)
+{
+ int eventType = SCREEN_EVENT_NONE;
+ screen_get_event_property_iv(event, SCREEN_PROPERTY_TYPE, &eventType);
+ screen_window_t window = nullptr;
+ screen_get_event_property_pv(event,
+ SCREEN_PROPERTY_WINDOW,
+ reinterpret_cast<void **>(&window));
+
+ if (eventType == SCREEN_EVENT_CREATE)
+ return filterQnxScreenWindowCreateEvent(window, event);
+ else if (eventType == SCREEN_EVENT_CLOSE)
+ return filterQnxScreenWindowCloseEvent(window, event);
+ else if (eventType == SCREEN_EVENT_MANAGER)
+ return filterQnxScreenWindowManagerEvent(window, event);
+
+ return false;
+}
+
+bool Collector::filterQnxScreenWindowCreateEvent(screen_window_t window, screen_event_t event)
+{
+ Q_UNUSED(event);
+ WId winId = reinterpret_cast<WId>(window);
+
+ QByteArray parentGroup(256, 0);
+ screen_get_window_property_cv(window,
+ SCREEN_PROPERTY_PARENT,
+ parentGroup.length(),
+ parentGroup.data());
+ parentGroup.resize(strlen(parentGroup.constData()));
+
+ QByteArray group(256, 0);
+ screen_get_window_property_cv(reinterpret_cast<screen_window_t>(windowHandle()->winId()),
+ SCREEN_PROPERTY_GROUP,
+ group.length(),
+ group.data());
+ group.resize(strlen(group.constData()));
+
+ if (parentGroup != group)
+ return false;
+
+ Collectible collectible;
+ collectible.window = QWindow::fromWinId(winId);
+ collectible.widget = QWidget::createWindowContainer(collectible.window, this);
+ layout()->addWidget(collectible.widget);
+ m_collectibles.append(collectible);
+
+ return false;
+}
+
+bool Collector::filterQnxScreenWindowCloseEvent(screen_window_t window, screen_event_t event)
+{
+ Q_UNUSED(event);
+ WId winId = reinterpret_cast<WId>(window);
+ auto it = std::find_if(m_collectibles.begin(), m_collectibles.end(),
+ [winId] (const Collectible &collectible) {
+ return collectible.window->winId() == winId;
+ });
+ if (it != m_collectibles.end()) {
+ delete it->widget;
+ // it->window is deleted by it->widget.
+ m_collectibles.erase(it);
+ }
+
+ return false;
+}
+
+bool Collector::filterQnxScreenWindowManagerEvent(screen_window_t window, screen_event_t event)
+{
+ int managerEventType = 0;
+ screen_get_event_property_iv(event, SCREEN_PROPERTY_SUBTYPE, &managerEventType);
+
+ if (managerEventType == MANAGER_EVENT_NAME_SUGGESTION)
+ return filterQnxScreenWindowManagerNameEvent(window, event);
+
+ return false;
+}
+
+bool Collector::filterQnxScreenWindowManagerNameEvent(screen_window_t window, screen_event_t event)
+{
+ Q_UNUSED(window);
+ int dataSize = 0;
+ screen_get_event_property_iv(event, SCREEN_PROPERTY_SIZE, &dataSize);
+ if (dataSize > 0) {
+ QByteArray data(dataSize, 0);
+ screen_get_event_property_cv(event, SCREEN_PROPERTY_USER_DATA, data.size(), data.data());
+ }
+
+ return false;
+}
diff --git a/src/plugins/platforms/mirclient/qmirclientscreenobserver.h b/examples/widgets/qnx/foreignwindows/collector.h
index ad927319c1..2b1ed499ff 100644
--- a/src/plugins/platforms/mirclient/qmirclientscreenobserver.h
+++ b/examples/widgets/qnx/foreignwindows/collector.h
@@ -1,6 +1,6 @@
-/****************************************************************************
+/***************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2018 QNX Software Systems. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -37,42 +37,39 @@
**
****************************************************************************/
+#ifndef COLLECTOR_H_
+#define COLLECTOR_H_
-#ifndef QMIRCLIENTSCREENOBSERVER_H
-#define QMIRCLIENTSCREENOBSERVER_H
+#include <QAbstractNativeEventFilter>
+#include <QWidget>
+#include <QVector>
-#include <QObject>
+#include <screen/screen.h>
-#include <mir_toolkit/mir_connection.h>
-
-class QMirClientScreen;
-
-class QMirClientScreenObserver : public QObject
+class Collector : public QWidget, public QAbstractNativeEventFilter
{
- Q_OBJECT
-
public:
- QMirClientScreenObserver(MirConnection *connection);
-
- QList<QMirClientScreen*> screens() const { return mScreenList; }
- QMirClientScreen *findScreenWithId(int id);
+ explicit Collector(QWidget *parent = nullptr);
+ ~Collector() override;
- void handleScreenPropertiesChange(QMirClientScreen *screen, int dpi,
- MirFormFactor formFactor, float scale);
-
-Q_SIGNALS:
- void screenAdded(QMirClientScreen *screen);
- void screenRemoved(QMirClientScreen *screen);
-
-private Q_SLOTS:
- void update();
+ bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
private:
- QMirClientScreen *findScreenWithId(const QList<QMirClientScreen *> &list, int id);
- void removeScreen(QMirClientScreen *screen);
+ struct Collectible
+ {
+ QWindow *window;
+ QWidget *widget;
+ };
+ QVector<Collectible> m_collectibles;
- MirConnection *mMirConnection;
- QList<QMirClientScreen*> mScreenList;
+ bool filterQnxScreenEvent(screen_event_t event);
+ bool filterQnxScreenWindowEvent(screen_event_t event);
+ bool filterQnxScreenWindowCreateEvent(screen_window_t window, screen_event_t event);
+ bool filterQnxScreenWindowCloseEvent(screen_window_t window, screen_event_t event);
+ bool filterQnxScreenWindowManagerEvent(screen_window_t window, screen_event_t event);
+ bool filterQnxScreenWindowManagerNameEvent(screen_window_t window,
+ screen_event_t event);
};
-#endif // QMIRCLIENTSCREENOBSERVER_H
+
+#endif /* COLLECTOR_H_ */
diff --git a/examples/widgets/qnx/foreignwindows/foreignwindows.pro b/examples/widgets/qnx/foreignwindows/foreignwindows.pro
new file mode 100644
index 0000000000..09ff8633eb
--- /dev/null
+++ b/examples/widgets/qnx/foreignwindows/foreignwindows.pro
@@ -0,0 +1,11 @@
+TEMPLATE = app
+
+HEADERS += collector.h
+SOURCES += main.cpp collector.cpp
+LIBS += -lscreen
+
+QT += widgets
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/widgets/qnx/foreignwindows
+INSTALLS += target
diff --git a/src/plugins/platforms/mirclient/qmirclientdesktopwindow.cpp b/examples/widgets/qnx/foreignwindows/main.cpp
index 123f805c25..128e93cf88 100644
--- a/src/plugins/platforms/mirclient/qmirclientdesktopwindow.cpp
+++ b/examples/widgets/qnx/foreignwindows/main.cpp
@@ -1,6 +1,6 @@
-/****************************************************************************
+/***************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2018 QNX Software Systems. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -37,14 +37,17 @@
**
****************************************************************************/
+#include <QApplication>
-#include "qmirclientdesktopwindow.h"
+#include "collector.h"
-// local
-#include "qmirclientlogging.h"
-
-QMirClientDesktopWindow::QMirClientDesktopWindow(QWindow *window)
- : QPlatformWindow(window)
+int main(int argc, char *argv[])
{
- qCDebug(mirclient, "QMirClientDesktopWindow(window=%p)", window);
+ QApplication app(argc, argv);
+
+ Collector collector;
+ collector.resize(640, 480);
+ collector.show();
+
+ return app.exec();
}
diff --git a/examples/widgets/richtext/textedit/example.md b/examples/widgets/richtext/textedit/example.md
new file mode 100644
index 0000000000..a16a9197b4
--- /dev/null
+++ b/examples/widgets/richtext/textedit/example.md
@@ -0,0 +1,102 @@
+# QTextEdit
+
+The QTextEdit widget is an advanced editor that supports formatted rich text.
+It can be used to display HTML and other rich document formats. Internally,
+QTextEdit uses the QTextDocument class to describe both the high-level
+structure of each document and the low-level formatting of paragraphs.
+
+If you are viewing this document in the textedit example, you can edit this
+document to explore Qt's rich text editing features. We have included some
+comments in each of the following sections to encourage you to experiment.
+
+## Font and Paragraph Styles
+
+QTextEdit supports **bold**, *italic*, &amp; ~~strikethrough~~ font styles, and
+can display <span style="font-size:10pt; font-weight:600;
+color:#00007f;">multicolored</span> text. Font families such as <span
+style="font-family:Times New Roman">Times New Roman</span> and `Courier`
+can also be used directly. *If you place the cursor in a region of styled text,
+the controls in the tool bars will change to reflect the current style.*
+
+Paragraphs can be formatted so that the text is left-aligned, right-aligned,
+centered, or fully justified.
+
+*Try changing the alignment of some text and resize the editor to see how the
+text layout changes.*
+
+## Lists
+
+Different kinds of lists can be included in rich text documents. Standard
+bullet lists can be nested, using different symbols for each level of the list:
+
+- Disc symbols are typically used for top-level list items.
+ * Circle symbols can be used to distinguish between items in lower-level
+ lists.
+ + Square symbols provide a reasonable alternative to discs and circles.
+
+Ordered lists can be created that can be used for tables of contents. Different
+characters can be used to enumerate items, and we can use both Roman and Arabic
+numerals in the same list structure:
+
+1. Introduction
+2. Qt Tools
+ 1) Qt Assistant
+ 2) Qt Designer
+ 1. Form Editor
+ 2. Component Architecture
+ 3) Qt Linguist
+
+The list will automatically be renumbered if you add or remove items. *Try
+adding new sections to the above list or removing existing item to see the
+numbers change.*
+
+Task lists can be used to track progress on projects:
+
+- [ ] This is not yet done
+- This is just a bullet point
+- [x] This is done
+
+## Images
+
+Inline images are treated like ordinary ranges of characters in the text
+editor, so they flow with the surrounding text. Images can also be selected in
+the same way as text, making it easy to cut, copy, and paste them.
+
+![logo](images/logo32.png "logo") *Try to select this image by clicking and
+dragging over it with the mouse, or use the text cursor to select it by holding
+down Shift and using the arrow keys. You can then cut or copy it, and paste it
+into different parts of this document.*
+
+## Tables
+
+QTextEdit can arrange and format tables, supporting features such as row and
+column spans, text formatting within cells, and size constraints for columns.
+
+| | Development Tools | Programming Techniques | Graphical User Interfaces |
+| ------------: | ----------------- | ---------------------- | ------------------------- |
+| 9:00 - 11:00 | Introduction to Qt |||
+| 11:00 - 13:00 | Using qmake | Object-oriented Programming | Layouts in Qt |
+| 13:00 - 15:00 | Qt Designer Tutorial | Extreme Programming | Writing Custom Styles |
+| 15:00 - 17:00 | Qt Linguist and Internationalization | &nbsp; | &nbsp; |
+
+*Try adding text to the cells in the table and experiment with the alignment of
+the paragraphs.*
+
+## Hyperlinks
+
+QTextEdit is designed to support hyperlinks between documents, and this feature
+is used extensively in
+[Qt Assistant](http://doc.qt.io/qt-5/qtassistant-index.html). Hyperlinks are
+automatically created when an HTML file is imported into an editor. Since the
+rich text framework supports hyperlinks natively, they can also be created
+programatically.
+
+## Undo and Redo
+
+Full support for undo and redo operations is built into QTextEdit and the
+underlying rich text framework. Operations on a document can be packaged
+together to make editing a more comfortable experience for the user.
+
+*Try making changes to this document and press `Ctrl+Z` to undo them. You can
+always recover the original contents of the document.*
+
diff --git a/examples/widgets/richtext/textedit/images/mac/checkbox-checked.png b/examples/widgets/richtext/textedit/images/mac/checkbox-checked.png
new file mode 100644
index 0000000000..a072d7fb5c
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/mac/checkbox-checked.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/mac/checkbox.png b/examples/widgets/richtext/textedit/images/mac/checkbox.png
new file mode 100644
index 0000000000..4064909712
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/mac/checkbox.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/mac/format-indent-less.png b/examples/widgets/richtext/textedit/images/mac/format-indent-less.png
new file mode 100644
index 0000000000..e38074e78b
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/mac/format-indent-less.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/mac/format-indent-more.png b/examples/widgets/richtext/textedit/images/mac/format-indent-more.png
new file mode 100644
index 0000000000..1bdeabd354
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/mac/format-indent-more.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/win/checkbox-checked.png b/examples/widgets/richtext/textedit/images/win/checkbox-checked.png
new file mode 100644
index 0000000000..a072d7fb5c
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/win/checkbox-checked.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/win/checkbox.png b/examples/widgets/richtext/textedit/images/win/checkbox.png
new file mode 100644
index 0000000000..4064909712
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/win/checkbox.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/win/format-indent-less.png b/examples/widgets/richtext/textedit/images/win/format-indent-less.png
new file mode 100644
index 0000000000..e38074e78b
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/win/format-indent-less.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/images/win/format-indent-more.png b/examples/widgets/richtext/textedit/images/win/format-indent-more.png
new file mode 100644
index 0000000000..1bdeabd354
--- /dev/null
+++ b/examples/widgets/richtext/textedit/images/win/format-indent-more.png
Binary files differ
diff --git a/examples/widgets/richtext/textedit/main.cpp b/examples/widgets/richtext/textedit/main.cpp
index aef186aa77..256d183811 100644
--- a/examples/widgets/richtext/textedit/main.cpp
+++ b/examples/widgets/richtext/textedit/main.cpp
@@ -51,9 +51,9 @@
#include "textedit.h"
#include <QApplication>
-#include <QDesktopWidget>
#include <QCommandLineParser>
#include <QCommandLineOption>
+#include <QScreen>
int main(int argc, char *argv[])
{
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
TextEdit mw;
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mw);
+ const QRect availableGeometry = mw.screen()->availableGeometry();
mw.resize(availableGeometry.width() / 2, (availableGeometry.height() * 2) / 3);
mw.move((availableGeometry.width() - mw.width()) / 2,
(availableGeometry.height() - mw.height()) / 2);
diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp
index 00ea0325dc..85fb83ab89 100644
--- a/examples/widgets/richtext/textedit/textedit.cpp
+++ b/examples/widgets/richtext/textedit/textedit.cpp
@@ -71,6 +71,7 @@
#include <QCloseEvent>
#include <QMessageBox>
#include <QMimeData>
+#include <QMimeDatabase>
#if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printer)
@@ -316,6 +317,14 @@ void TextEdit::setupTextActions()
actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J);
actionAlignJustify->setCheckable(true);
actionAlignJustify->setPriority(QAction::LowPriority);
+ const QIcon indentMoreIcon = QIcon::fromTheme("format-indent-more", QIcon(rsrcPath + "/format-indent-more.png"));
+ actionIndentMore = menu->addAction(indentMoreIcon, tr("&Indent"), this, &TextEdit::indent);
+ actionIndentMore->setShortcut(Qt::CTRL + Qt::Key_BracketRight);
+ actionIndentMore->setPriority(QAction::LowPriority);
+ const QIcon indentLessIcon = QIcon::fromTheme("format-indent-less", QIcon(rsrcPath + "/format-indent-less.png"));
+ actionIndentLess = menu->addAction(indentLessIcon, tr("&Unindent"), this, &TextEdit::unindent);
+ actionIndentLess->setShortcut(Qt::CTRL + Qt::Key_BracketLeft);
+ actionIndentLess->setPriority(QAction::LowPriority);
// Make sure the alignLeft is always left of the alignRight
QActionGroup *alignGroup = new QActionGroup(this);
@@ -334,6 +343,10 @@ void TextEdit::setupTextActions()
tb->addActions(alignGroup->actions());
menu->addActions(alignGroup->actions());
+ tb->addAction(actionIndentMore);
+ tb->addAction(actionIndentLess);
+ menu->addAction(actionIndentMore);
+ menu->addAction(actionIndentLess);
menu->addSeparator();
@@ -342,6 +355,15 @@ void TextEdit::setupTextActions()
actionTextColor = menu->addAction(pix, tr("&Color..."), this, &TextEdit::textColor);
tb->addAction(actionTextColor);
+ menu->addSeparator();
+
+ const QIcon checkboxIcon = QIcon::fromTheme("status-checkbox-checked", QIcon(rsrcPath + "/checkbox-checked.png"));
+ actionToggleCheckState = menu->addAction(checkboxIcon, tr("Chec&ked"), this, &TextEdit::setChecked);
+ actionToggleCheckState->setShortcut(Qt::CTRL + Qt::Key_K);
+ actionToggleCheckState->setCheckable(true);
+ actionToggleCheckState->setPriority(QAction::LowPriority);
+ tb->addAction(actionToggleCheckState);
+
tb = addToolBar(tr("Format Actions"));
tb->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
addToolBarBreak(Qt::TopToolBarArea);
@@ -353,6 +375,8 @@ void TextEdit::setupTextActions()
comboStyle->addItem("Bullet List (Disc)");
comboStyle->addItem("Bullet List (Circle)");
comboStyle->addItem("Bullet List (Square)");
+ comboStyle->addItem("Task List (Unchecked)");
+ comboStyle->addItem("Task List (Checked)");
comboStyle->addItem("Ordered List (Decimal)");
comboStyle->addItem("Ordered List (Alpha lower)");
comboStyle->addItem("Ordered List (Alpha upper)");
@@ -369,7 +393,7 @@ void TextEdit::setupTextActions()
comboFont = new QFontComboBox(tb);
tb->addWidget(comboFont);
- connect(comboFont, QOverload<const QString &>::of(&QComboBox::activated), this, &TextEdit::textFamily);
+ connect(comboFont, &QComboBox::textActivated, this, &TextEdit::textFamily);
comboSize = new QComboBox(tb);
comboSize->setObjectName("comboSize");
@@ -381,7 +405,7 @@ void TextEdit::setupTextActions()
comboSize->addItem(QString::number(size));
comboSize->setCurrentIndex(standardSizes.indexOf(QApplication::font().pointSize()));
- connect(comboSize, QOverload<const QString &>::of(&QComboBox::activated), this, &TextEdit::textSize);
+ connect(comboSize, &QComboBox::textActivated, this, &TextEdit::textSize);
}
bool TextEdit::load(const QString &f)
@@ -395,11 +419,18 @@ bool TextEdit::load(const QString &f)
QByteArray data = file.readAll();
QTextCodec *codec = Qt::codecForHtml(data);
QString str = codec->toUnicode(data);
+ QUrl baseUrl = (f.front() == QLatin1Char(':') ? QUrl(f) : QUrl::fromLocalFile(f)).adjusted(QUrl::RemoveFilename);
+ textEdit->document()->setBaseUrl(baseUrl);
if (Qt::mightBeRichText(str)) {
textEdit->setHtml(str);
} else {
- str = QString::fromLocal8Bit(data);
- textEdit->setPlainText(str);
+#if QT_CONFIG(textmarkdownreader)
+ QMimeDatabase db;
+ if (db.mimeTypeForFileNameAndData(f, data).name() == QLatin1String("text/markdown"))
+ textEdit->setMarkdown(str);
+ else
+#endif
+ textEdit->setPlainText(QString::fromLocal8Bit(data));
}
setCurrentFileName(f);
@@ -451,7 +482,15 @@ void TextEdit::fileOpen()
QFileDialog fileDialog(this, tr("Open File..."));
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
fileDialog.setFileMode(QFileDialog::ExistingFile);
- fileDialog.setMimeTypeFilters(QStringList() << "text/html" << "text/plain");
+ fileDialog.setMimeTypeFilters(QStringList()
+#if QT_CONFIG(texthtmlparser)
+ << "text/html"
+#endif
+#if QT_CONFIG(textmarkdownreader)
+
+ << "text/markdown"
+#endif
+ << "text/plain");
if (fileDialog.exec() != QDialog::Accepted)
return;
const QString fn = fileDialog.selectedFiles().first();
@@ -485,9 +524,18 @@ bool TextEdit::fileSaveAs()
QFileDialog fileDialog(this, tr("Save as..."));
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
QStringList mimeTypes;
- mimeTypes << "application/vnd.oasis.opendocument.text" << "text/html" << "text/plain";
+ mimeTypes << "text/plain"
+#if QT_CONFIG(textodfwriter)
+ << "application/vnd.oasis.opendocument.text"
+#endif
+#if QT_CONFIG(textmarkdownwriter)
+ << "text/markdown"
+#endif
+ << "text/html";
fileDialog.setMimeTypeFilters(mimeTypes);
+#if QT_CONFIG(textodfwriter)
fileDialog.setDefaultSuffix("odt");
+#endif
if (fileDialog.exec() != QDialog::Accepted)
return false;
const QString fn = fileDialog.selectedFiles().first();
@@ -592,6 +640,7 @@ void TextEdit::textStyle(int styleIndex)
{
QTextCursor cursor = textEdit->textCursor();
QTextListFormat::Style style = QTextListFormat::ListStyleUndefined;
+ QTextBlockFormat::MarkerType marker = QTextBlockFormat::MarkerType::NoMarker;
switch (styleIndex) {
case 1:
@@ -604,18 +653,32 @@ void TextEdit::textStyle(int styleIndex)
style = QTextListFormat::ListSquare;
break;
case 4:
- style = QTextListFormat::ListDecimal;
+ if (cursor.currentList())
+ style = cursor.currentList()->format().style();
+ else
+ style = QTextListFormat::ListDisc;
+ marker = QTextBlockFormat::MarkerType::Unchecked;
break;
case 5:
- style = QTextListFormat::ListLowerAlpha;
+ if (cursor.currentList())
+ style = cursor.currentList()->format().style();
+ else
+ style = QTextListFormat::ListDisc;
+ marker = QTextBlockFormat::MarkerType::Checked;
break;
case 6:
- style = QTextListFormat::ListUpperAlpha;
+ style = QTextListFormat::ListDecimal;
break;
case 7:
- style = QTextListFormat::ListLowerRoman;
+ style = QTextListFormat::ListLowerAlpha;
break;
case 8:
+ style = QTextListFormat::ListUpperAlpha;
+ break;
+ case 9:
+ style = QTextListFormat::ListLowerRoman;
+ break;
+ case 10:
style = QTextListFormat::ListUpperRoman;
break;
default:
@@ -628,7 +691,7 @@ void TextEdit::textStyle(int styleIndex)
if (style == QTextListFormat::ListStyleUndefined) {
blockFmt.setObjectIndex(-1);
- int headingLevel = styleIndex >= 9 ? styleIndex - 9 + 1 : 0; // H1 to H6, or Standard
+ int headingLevel = styleIndex >= 11 ? styleIndex - 11 + 1 : 0; // H1 to H6, or Standard
blockFmt.setHeadingLevel(headingLevel);
cursor.setBlockFormat(blockFmt);
@@ -640,6 +703,8 @@ void TextEdit::textStyle(int styleIndex)
cursor.mergeCharFormat(fmt);
textEdit->mergeCurrentCharFormat(fmt);
} else {
+ blockFmt.setMarker(marker);
+ cursor.setBlockFormat(blockFmt);
QTextListFormat listFmt;
if (cursor.currentList()) {
listFmt = cursor.currentList()->format();
@@ -678,6 +743,45 @@ void TextEdit::textAlign(QAction *a)
textEdit->setAlignment(Qt::AlignJustify);
}
+void TextEdit::setChecked(bool checked)
+{
+ textStyle(checked ? 5 : 4);
+}
+
+void TextEdit::indent()
+{
+ modifyIndentation(1);
+}
+
+void TextEdit::unindent()
+{
+ modifyIndentation(-1);
+}
+
+void TextEdit::modifyIndentation(int amount)
+{
+ QTextCursor cursor = textEdit->textCursor();
+ cursor.beginEditBlock();
+ if (cursor.currentList()) {
+ QTextListFormat listFmt = cursor.currentList()->format();
+ // See whether the line above is the list we want to move this item into,
+ // or whether we need a new list.
+ QTextCursor above(cursor);
+ above.movePosition(QTextCursor::Up);
+ if (above.currentList() && listFmt.indent() + amount == above.currentList()->format().indent()) {
+ above.currentList()->add(cursor.block());
+ } else {
+ listFmt.setIndent(listFmt.indent() + amount);
+ cursor.createList(listFmt);
+ }
+ } else {
+ QTextBlockFormat blockFmt = cursor.blockFormat();
+ blockFmt.setIndent(blockFmt.indent() + amount);
+ cursor.setBlockFormat(blockFmt);
+ }
+ cursor.endEditBlock();
+}
+
void TextEdit::currentCharFormatChanged(const QTextCharFormat &format)
{
fontChanged(format.font());
@@ -700,27 +804,40 @@ void TextEdit::cursorPositionChanged()
comboStyle->setCurrentIndex(3);
break;
case QTextListFormat::ListDecimal:
- comboStyle->setCurrentIndex(4);
+ comboStyle->setCurrentIndex(6);
break;
case QTextListFormat::ListLowerAlpha:
- comboStyle->setCurrentIndex(5);
+ comboStyle->setCurrentIndex(7);
break;
case QTextListFormat::ListUpperAlpha:
- comboStyle->setCurrentIndex(6);
+ comboStyle->setCurrentIndex(8);
break;
case QTextListFormat::ListLowerRoman:
- comboStyle->setCurrentIndex(7);
+ comboStyle->setCurrentIndex(9);
break;
case QTextListFormat::ListUpperRoman:
- comboStyle->setCurrentIndex(8);
+ comboStyle->setCurrentIndex(10);
break;
default:
comboStyle->setCurrentIndex(-1);
break;
}
+ switch (textEdit->textCursor().block().blockFormat().marker()) {
+ case QTextBlockFormat::MarkerType::NoMarker:
+ actionToggleCheckState->setChecked(false);
+ break;
+ case QTextBlockFormat::MarkerType::Unchecked:
+ comboStyle->setCurrentIndex(4);
+ actionToggleCheckState->setChecked(false);
+ break;
+ case QTextBlockFormat::MarkerType::Checked:
+ comboStyle->setCurrentIndex(5);
+ actionToggleCheckState->setChecked(true);
+ break;
+ }
} else {
int headingLevel = textEdit->textCursor().blockFormat().headingLevel();
- comboStyle->setCurrentIndex(headingLevel ? headingLevel + 8 : 0);
+ comboStyle->setCurrentIndex(headingLevel ? headingLevel + 10 : 0);
}
}
diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h
index ae0b13a4cc..9e50166c6f 100644
--- a/examples/widgets/richtext/textedit/textedit.h
+++ b/examples/widgets/richtext/textedit/textedit.h
@@ -96,6 +96,9 @@ private slots:
void textStyle(int styleIndex);
void textColor();
void textAlign(QAction *a);
+ void setChecked(bool checked);
+ void indent();
+ void unindent();
void currentCharFormatChanged(const QTextCharFormat &format);
void cursorPositionChanged();
@@ -110,6 +113,7 @@ private:
void setupTextActions();
bool maybeSave();
void setCurrentFileName(const QString &fileName);
+ void modifyIndentation(int amount);
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
void fontChanged(const QFont &f);
@@ -125,6 +129,9 @@ private:
QAction *actionAlignCenter;
QAction *actionAlignRight;
QAction *actionAlignJustify;
+ QAction *actionIndentLess;
+ QAction *actionIndentMore;
+ QAction *actionToggleCheckState;
QAction *actionUndo;
QAction *actionRedo;
#ifndef QT_NO_CLIPBOARD
diff --git a/examples/widgets/richtext/textedit/textedit.qrc b/examples/widgets/richtext/textedit/textedit.qrc
index 7d6efd7d67..1641acc207 100644
--- a/examples/widgets/richtext/textedit/textedit.qrc
+++ b/examples/widgets/richtext/textedit/textedit.qrc
@@ -1,6 +1,8 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">
<file>images/logo32.png</file>
+ <file>images/mac/checkbox.png</file>
+ <file>images/mac/checkbox-checked.png</file>
<file>images/mac/editcopy.png</file>
<file>images/mac/editcut.png</file>
<file>images/mac/editpaste.png</file>
@@ -11,6 +13,8 @@
<file>images/mac/fileopen.png</file>
<file>images/mac/fileprint.png</file>
<file>images/mac/filesave.png</file>
+ <file>images/mac/format-indent-less.png</file>
+ <file>images/mac/format-indent-more.png</file>
<file>images/mac/textbold.png</file>
<file>images/mac/textcenter.png</file>
<file>images/mac/textitalic.png</file>
@@ -20,6 +24,8 @@
<file>images/mac/textunder.png</file>
<file>images/mac/zoomin.png</file>
<file>images/mac/zoomout.png</file>
+ <file>images/win/checkbox.png</file>
+ <file>images/win/checkbox-checked.png</file>
<file>images/win/editcopy.png</file>
<file>images/win/editcut.png</file>
<file>images/win/editpaste.png</file>
@@ -30,6 +36,8 @@
<file>images/win/fileopen.png</file>
<file>images/win/fileprint.png</file>
<file>images/win/filesave.png</file>
+ <file>images/win/format-indent-less.png</file>
+ <file>images/win/format-indent-more.png</file>
<file>images/win/textbold.png</file>
<file>images/win/textcenter.png</file>
<file>images/win/textitalic.png</file>
diff --git a/examples/widgets/scroller/graphicsview/main.cpp b/examples/widgets/scroller/graphicsview/main.cpp
index d6b2956d50..178c431e6c 100644
--- a/examples/widgets/scroller/graphicsview/main.cpp
+++ b/examples/widgets/scroller/graphicsview/main.cpp
@@ -64,7 +64,7 @@ class RectObject : public QGraphicsObject
public:
- RectObject(const QString &text, qreal x, qreal y, qreal width, qreal height, QBrush brush, QGraphicsItem *parent = 0)
+ RectObject(const QString &text, qreal x, qreal y, qreal width, qreal height, QBrush brush, QGraphicsItem *parent = nullptr)
: QGraphicsObject(parent)
, m_text(text)
, m_rect(x, y, width, height)
diff --git a/examples/widgets/statemachine/eventtransitions/main.cpp b/examples/widgets/statemachine/eventtransitions/main.cpp
index 2de8e5daa3..fe9518092f 100644
--- a/examples/widgets/statemachine/eventtransitions/main.cpp
+++ b/examples/widgets/statemachine/eventtransitions/main.cpp
@@ -48,13 +48,18 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
+#include <QEventTransition>
+#include <QPushButton>
+#include <QStateMachine>
+#include <QVBoxLayout>
+#include <QWidget>
//! [0]
class Window : public QWidget
{
public:
- Window(QWidget *parent = 0)
+ Window(QWidget *parent = nullptr)
: QWidget(parent)
{
QPushButton *button = new QPushButton(this);
diff --git a/examples/widgets/statemachine/factorial/main.cpp b/examples/widgets/statemachine/factorial/main.cpp
index 2d25822828..e6cbdcae29 100644
--- a/examples/widgets/statemachine/factorial/main.cpp
+++ b/examples/widgets/statemachine/factorial/main.cpp
@@ -49,7 +49,6 @@
****************************************************************************/
#include <QtCore>
-#include <stdio.h>
//! [0]
class Factorial : public QObject
@@ -58,10 +57,7 @@ class Factorial : public QObject
Q_PROPERTY(int x READ x WRITE setX)
Q_PROPERTY(int fac READ fac WRITE setFac)
public:
- Factorial(QObject *parent = 0)
- : QObject(parent), m_x(-1), m_fac(1)
- {
- }
+ using QObject::QObject;
int x() const
{
@@ -90,8 +86,8 @@ Q_SIGNALS:
void xChanged(int value);
private:
- int m_x;
- int m_fac;
+ int m_x = -1;
+ int m_fac = 1;
};
//! [0]
@@ -143,7 +139,7 @@ public:
void onTransition(QEvent *) override
{
- fprintf(stdout, "%d\n", m_fact->property("fac").toInt());
+ qInfo() << m_fact->property("fac").toInt();
}
private:
diff --git a/examples/widgets/statemachine/trafficlight/main.cpp b/examples/widgets/statemachine/trafficlight/main.cpp
index 1a7050c28d..dd8bddcb37 100644
--- a/examples/widgets/statemachine/trafficlight/main.cpp
+++ b/examples/widgets/statemachine/trafficlight/main.cpp
@@ -48,7 +48,13 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
+#include <QFinalState>
+#include <QPainter>
+#include <QStateMachine>
+#include <QTimer>
+#include <QVBoxLayout>
+#include <QWidget>
//! [0]
class LightWidget : public QWidget
@@ -56,7 +62,7 @@ class LightWidget : public QWidget
Q_OBJECT
Q_PROPERTY(bool on READ isOn WRITE setOn)
public:
- LightWidget(const QColor &color, QWidget *parent = 0)
+ LightWidget(const QColor &color, QWidget *parent = nullptr)
: QWidget(parent), m_color(color), m_on(false) {}
bool isOn() const
@@ -94,7 +100,7 @@ private:
class TrafficLightWidget : public QWidget
{
public:
- TrafficLightWidget(QWidget *parent = 0)
+ TrafficLightWidget(QWidget *parent = nullptr)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout(this);
@@ -105,7 +111,7 @@ public:
m_green = new LightWidget(Qt::green);
vbox->addWidget(m_green);
QPalette pal = palette();
- pal.setColor(QPalette::Background, Qt::black);
+ pal.setColor(QPalette::Window, Qt::black);
setPalette(pal);
setAutoFillBackground(true);
}
@@ -125,7 +131,7 @@ private:
//! [1]
//! [2]
-QState *createLightState(LightWidget *light, int duration, QState *parent = 0)
+QState *createLightState(LightWidget *light, int duration, QState *parent = nullptr)
{
QState *lightState = new QState(parent);
QTimer *timer = new QTimer(lightState);
diff --git a/examples/widgets/tools/codecs/encodingdialog.cpp b/examples/widgets/tools/codecs/encodingdialog.cpp
index ca4b56db9e..aa57d47dc7 100644
--- a/examples/widgets/tools/codecs/encodingdialog.cpp
+++ b/examples/widgets/tools/codecs/encodingdialog.cpp
@@ -248,7 +248,7 @@ static const char *encodingToolTips[]
{
QT_TRANSLATE_NOOP("EncodingDialog", "Unicode points for use with any encoding (C++, Python)"),
QT_TRANSLATE_NOOP("EncodingDialog", "QString::fromUtf8()"),
- QT_TRANSLATE_NOOP("EncodingDialog", "QStringViewLiteral(), wchar_t on Windows"),
+ QT_TRANSLATE_NOOP("EncodingDialog", "wchar_t on Windows, char16_t everywhere"),
QT_TRANSLATE_NOOP("EncodingDialog", "wchar_t on Unix (Ucs4)"),
QT_TRANSLATE_NOOP("EncodingDialog", "QLatin1String")
};
diff --git a/examples/widgets/tools/codecs/mainwindow.cpp b/examples/widgets/tools/codecs/mainwindow.cpp
index 53db9fe61f..dc72fa73b7 100644
--- a/examples/widgets/tools/codecs/mainwindow.cpp
+++ b/examples/widgets/tools/codecs/mainwindow.cpp
@@ -48,12 +48,21 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
#include "encodingdialog.h"
#include "previewform.h"
+#include <QAction>
+#include <QApplication>
+#include <QFileDialog>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QPlainTextEdit>
+#include <QRegularExpression>
+#include <QScreen>
+#include <QTextCodec>
+#include <QTextStream>
+
MainWindow::MainWindow()
{
textEdit = new QPlainTextEdit;
@@ -69,7 +78,7 @@ MainWindow::MainWindow()
setWindowTitle(tr("Codecs"));
- const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ const QRect screenGeometry = screen()->geometry();
resize(screenGeometry.width() / 2, screenGeometry.height() * 2 / 3);
}
@@ -146,14 +155,14 @@ void MainWindow::findCodecs()
QTextCodec *codec = QTextCodec::codecForMib(mib);
QString sortKey = codec->name().toUpper();
- int rank;
+ char rank;
if (sortKey.startsWith(QLatin1String("UTF-8"))) {
rank = 1;
} else if (sortKey.startsWith(QLatin1String("UTF-16"))) {
rank = 2;
} else if ((match = iso8859RegExp.match(sortKey)).hasMatch()) {
- if (match.captured(1).size() == 1)
+ if (match.capturedRef(1).size() == 1)
rank = 3;
else
rank = 4;
@@ -164,7 +173,8 @@ void MainWindow::findCodecs()
codecMap.insert(sortKey, codec);
}
- codecs = codecMap.values();
+ for (const auto &codec : qAsConst(codecMap))
+ codecs += codec;
}
void MainWindow::createMenus()
@@ -206,7 +216,7 @@ void MainWindow::encodingDialog()
{
if (!m_encodingDialog) {
m_encodingDialog = new EncodingDialog(this);
- const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ const QRect screenGeometry = screen()->geometry();
m_encodingDialog->setMinimumWidth(screenGeometry.width() / 4);
}
m_encodingDialog->show();
diff --git a/examples/widgets/tools/codecs/mainwindow.h b/examples/widgets/tools/codecs/mainwindow.h
index 64494d1960..cf18222520 100644
--- a/examples/widgets/tools/codecs/mainwindow.h
+++ b/examples/widgets/tools/codecs/mainwindow.h
@@ -51,7 +51,7 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include <QList>
+#include <QVector>
#include <QMainWindow>
QT_BEGIN_NAMESPACE
@@ -81,10 +81,10 @@ private:
void findCodecs();
void createMenus();
- QList<QAction *> saveAsActs;
+ QVector<QAction *> saveAsActs;
QPlainTextEdit *textEdit;
PreviewForm *previewForm;
- QList<QTextCodec *> codecs;
+ QVector<QTextCodec *> codecs;
EncodingDialog *m_encodingDialog = nullptr;
};
diff --git a/examples/widgets/tools/codecs/previewform.cpp b/examples/widgets/tools/codecs/previewform.cpp
index 206b5757cd..f48651335a 100644
--- a/examples/widgets/tools/codecs/previewform.cpp
+++ b/examples/widgets/tools/codecs/previewform.cpp
@@ -48,10 +48,19 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "previewform.h"
+#include <QApplication>
+#include <QComboBox>
+#include <QDialogButtonBox>
+#include <QGridLayout>
+#include <QLabel>
+#include <QPlainTextEdit>
+#include <QPushButton>
+#include <QScreen>
+#include <QTextCodec>
+#include <QTextStream>
+
// Helpers for creating hex dumps
static void indent(QTextStream &str, int indent)
{
@@ -83,8 +92,7 @@ static void formatHex(QTextStream &str, const QByteArray &data)
static void formatPrintableCharacters(QTextStream &str, const QByteArray &data)
{
- for (int i = 0, size = data.size(); i < size; ++i) {
- const char c = data.at(i);
+ for (const char c : data) {
switch (c) {
case '\0':
str << "\\0";
@@ -175,11 +183,11 @@ PreviewForm::PreviewForm(QWidget *parent)
mainLayout->addWidget(statusLabel, 2, 0, 1, 2);
mainLayout->addWidget(buttonBox, 3, 0, 1, 2);
- const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ const QRect screenGeometry = screen()->geometry();
resize(screenGeometry.width() * 2 / 5, screenGeometry.height() / 2);
}
-void PreviewForm::setCodecList(const QList<QTextCodec *> &list)
+void PreviewForm::setCodecList(const QVector<QTextCodec *> &list)
{
encodingComboBox->clear();
for (const QTextCodec *codec : list) {
@@ -226,10 +234,10 @@ void PreviewForm::updateTextEdit()
statusLabel->setText(message);
statusLabel->setStyleSheet(QStringLiteral("background-color: \"red\";"));
} else if (state.invalidChars) {
- statusLabel->setText(tr("%1: %n invalid characters", 0, state.invalidChars).arg(name));
+ statusLabel->setText(tr("%1: %n invalid characters", nullptr, state.invalidChars).arg(name));
statusLabel->setStyleSheet(QStringLiteral("background-color: \"yellow\";"));
} else {
- statusLabel->setText(tr("%1: %n bytes converted", 0, encodedData.size()).arg(name));
+ statusLabel->setText(tr("%1: %n bytes converted", nullptr, encodedData.size()).arg(name));
statusLabel->setStyleSheet(QString());
}
if (success)
diff --git a/examples/widgets/tools/codecs/previewform.h b/examples/widgets/tools/codecs/previewform.h
index 6335b6539f..02eb3533f3 100644
--- a/examples/widgets/tools/codecs/previewform.h
+++ b/examples/widgets/tools/codecs/previewform.h
@@ -52,7 +52,7 @@
#define PREVIEWFORM_H
#include <QDialog>
-#include <QList>
+#include <QVector>
QT_BEGIN_NAMESPACE
class QComboBox;
@@ -71,7 +71,7 @@ class PreviewForm : public QDialog
public:
explicit PreviewForm(QWidget *parent = nullptr);
- void setCodecList(const QList<QTextCodec *> &list);
+ void setCodecList(const QVector<QTextCodec *> &list);
void setEncodedData(const QByteArray &data);
QString decodedString() const { return decodedStr; }
diff --git a/examples/widgets/tools/completer/fsmodel.h b/examples/widgets/tools/completer/fsmodel.h
index 7b2e7b7dab..587e08b192 100644
--- a/examples/widgets/tools/completer/fsmodel.h
+++ b/examples/widgets/tools/completer/fsmodel.h
@@ -62,7 +62,7 @@
class FileSystemModel : public QFileSystemModel
{
public:
- FileSystemModel(QObject *parent = 0);
+ FileSystemModel(QObject *parent = nullptr);
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
};
//! [0]
diff --git a/examples/widgets/tools/completer/mainwindow.cpp b/examples/widgets/tools/completer/mainwindow.cpp
index 114ff0fd7c..b50e0a5456 100644
--- a/examples/widgets/tools/completer/mainwindow.cpp
+++ b/examples/widgets/tools/completer/mainwindow.cpp
@@ -48,13 +48,28 @@
**
****************************************************************************/
-#include <QtWidgets>
-#include "fsmodel.h"
#include "mainwindow.h"
+#include "fsmodel.h"
+
+#include <QAction>
+#include <QApplication>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QCompleter>
+#include <QGridLayout>
+#include <QHeaderView>
+#include <QLabel>
+#include <QLineEdit>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QSpinBox>
+#include <QStandardItemModel>
+#include <QStringListModel>
+#include <QTreeView>
//! [0]
MainWindow::MainWindow(QWidget *parent)
- : QMainWindow(parent), completer(0), lineEdit(0)
+ : QMainWindow(parent)
{
createMenu();
@@ -64,8 +79,8 @@ MainWindow::MainWindow(QWidget *parent)
modelLabel->setText(tr("Model"));
modelCombo = new QComboBox;
- modelCombo->addItem(tr("QFileSytemModel"));
- modelCombo->addItem(tr("QFileSytemModel that shows full path"));
+ modelCombo->addItem(tr("QFileSystemModel"));
+ modelCombo->addItem(tr("QFileSystemModel that shows full path"));
modelCombo->addItem(tr("Country list"));
modelCombo->addItem(tr("Word list"));
modelCombo->setCurrentIndex(0);
@@ -144,17 +159,17 @@ void MainWindow::createMenu()
connect(aboutAct, &QAction::triggered, this, &MainWindow::about);
connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
- QMenu* fileMenu = menuBar()->addMenu(tr("File"));
+ QMenu *fileMenu = menuBar()->addMenu(tr("File"));
fileMenu->addAction(exitAction);
- QMenu* helpMenu = menuBar()->addMenu(tr("About"));
+ QMenu *helpMenu = menuBar()->addMenu(tr("About"));
helpMenu->addAction(aboutAct);
helpMenu->addAction(aboutQtAct);
}
//! [4]
//! [5]
-QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
+QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
{
QFile file(fileName);
if (!file.open(QFile::ReadOnly))
@@ -170,7 +185,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
while (!file.atEnd()) {
QByteArray line = file.readLine();
if (!line.isEmpty())
- words << line.trimmed();
+ words << QString::fromUtf8(line.trimmed());
}
#ifndef QT_NO_CURSOR
@@ -191,8 +206,8 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
for (int i = 0; i < words.count(); ++i) {
QModelIndex countryIdx = m->index(i, 0);
QModelIndex symbolIdx = m->index(i, 1);
- QString country = words[i].mid(0, words[i].length() - 2).trimmed();
- QString symbol = words[i].right(2);
+ QString country = words.at(i).mid(0, words[i].length() - 2).trimmed();
+ QString symbol = words.at(i).right(2);
m->setData(countryIdx, country);
m->setData(symbolIdx, symbol);
}
@@ -233,7 +248,7 @@ void MainWindow::changeModel()
case 0:
{ // Unsorted QFileSystemModel
QFileSystemModel *fsModel = new QFileSystemModel(completer);
- fsModel->setRootPath("");
+ fsModel->setRootPath(QString());
completer->setModel(fsModel);
contentsLabel->setText(tr("Enter file path"));
}
@@ -243,7 +258,7 @@ void MainWindow::changeModel()
{ // FileSystemModel that shows full paths
FileSystemModel *fsModel = new FileSystemModel(completer);
completer->setModel(fsModel);
- fsModel->setRootPath("");
+ fsModel->setRootPath(QString());
contentsLabel->setText(tr("Enter file path"));
}
break;
diff --git a/examples/widgets/tools/completer/mainwindow.h b/examples/widgets/tools/completer/mainwindow.h
index 2bb351ec47..6e6238bf32 100644
--- a/examples/widgets/tools/completer/mainwindow.h
+++ b/examples/widgets/tools/completer/mainwindow.h
@@ -59,7 +59,6 @@ class QComboBox;
class QCompleter;
class QLabel;
class QLineEdit;
-class QProgressBar;
class QCheckBox;
class QSpinBox;
QT_END_NAMESPACE
@@ -70,7 +69,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
private slots:
void about();
@@ -83,16 +82,16 @@ private slots:
//! [1]
private:
void createMenu();
- QAbstractItemModel *modelFromFile(const QString& fileName);
+ QAbstractItemModel *modelFromFile(const QString &fileName);
- QComboBox *caseCombo;
- QComboBox *modeCombo;
- QComboBox *modelCombo;
- QSpinBox *maxVisibleSpinBox;
- QCheckBox *wrapCheckBox;
- QCompleter *completer;
- QLabel *contentsLabel;
- QLineEdit *lineEdit;
+ QComboBox *caseCombo = nullptr;
+ QComboBox *modeCombo = nullptr;
+ QComboBox *modelCombo = nullptr;
+ QSpinBox *maxVisibleSpinBox = nullptr;
+ QCheckBox *wrapCheckBox = nullptr;
+ QCompleter *completer = nullptr;
+ QLabel *contentsLabel = nullptr;
+ QLineEdit *lineEdit = nullptr;
};
//! [1]
diff --git a/examples/widgets/tools/customcompleter/mainwindow.cpp b/examples/widgets/tools/customcompleter/mainwindow.cpp
index 39f5f39617..b8072b505c 100644
--- a/examples/widgets/tools/customcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/customcompleter/mainwindow.cpp
@@ -48,13 +48,20 @@
**
****************************************************************************/
-#include <QtWidgets>
#include "mainwindow.h"
#include "textedit.h"
+#include <QAction>
+#include <QApplication>
+#include <QCompleter>
+#include <QFile>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QStringListModel>
+
//! [0]
MainWindow::MainWindow(QWidget *parent)
- : QMainWindow(parent), completer(0)
+ : QMainWindow(parent)
{
createMenu();
@@ -83,10 +90,10 @@ void MainWindow::createMenu()
connect(aboutAct, &QAction::triggered, this, &MainWindow::about);
connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
- QMenu* fileMenu = menuBar()->addMenu(tr("File"));
+ QMenu *fileMenu = menuBar()->addMenu(tr("File"));
fileMenu->addAction(exitAction);
- QMenu* helpMenu = menuBar()->addMenu(tr("About"));
+ QMenu *helpMenu = menuBar()->addMenu(tr("About"));
helpMenu->addAction(aboutAct);
helpMenu->addAction(aboutQtAct);
}
@@ -107,7 +114,7 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
while (!file.atEnd()) {
QByteArray line = file.readLine();
if (!line.isEmpty())
- words << line.trimmed();
+ words << QString::fromUtf8(line.trimmed());
}
#ifndef QT_NO_CURSOR
diff --git a/examples/widgets/tools/customcompleter/mainwindow.h b/examples/widgets/tools/customcompleter/mainwindow.h
index 436377cce7..cde553e291 100644
--- a/examples/widgets/tools/customcompleter/mainwindow.h
+++ b/examples/widgets/tools/customcompleter/mainwindow.h
@@ -55,11 +55,7 @@
QT_BEGIN_NAMESPACE
class QAbstractItemModel;
-class QComboBox;
class QCompleter;
-class QLabel;
-class QLineEdit;
-class QProgressBar;
QT_END_NAMESPACE
class TextEdit;
@@ -69,7 +65,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
private slots:
void about();
@@ -78,7 +74,7 @@ private:
void createMenu();
QAbstractItemModel *modelFromFile(const QString& fileName);
- QCompleter *completer;
+ QCompleter *completer = nullptr;
TextEdit *completingTextEdit;
};
//! [0]
diff --git a/examples/widgets/tools/customcompleter/textedit.cpp b/examples/widgets/tools/customcompleter/textedit.cpp
index d42f7b38bb..0d536fea3c 100644
--- a/examples/widgets/tools/customcompleter/textedit.cpp
+++ b/examples/widgets/tools/customcompleter/textedit.cpp
@@ -60,7 +60,7 @@
//! [0]
TextEdit::TextEdit(QWidget *parent)
-: QTextEdit(parent), c(0)
+ : QTextEdit(parent)
{
setPlainText(tr("This TextEdit provides autocompletions for words that have more than"
" 3 characters. You can trigger autocompletion using ") +
@@ -78,7 +78,7 @@ TextEdit::~TextEdit()
void TextEdit::setCompleter(QCompleter *completer)
{
if (c)
- QObject::disconnect(c, 0, this, 0);
+ c->disconnect(this);
c = completer;
@@ -101,7 +101,7 @@ QCompleter *TextEdit::completer() const
//! [3]
//! [4]
-void TextEdit::insertCompletion(const QString& completion)
+void TextEdit::insertCompletion(const QString &completion)
{
if (c->widget() != this)
return;
@@ -150,18 +150,19 @@ void TextEdit::keyPressEvent(QKeyEvent *e)
}
}
- bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_E); // CTRL+E
+ const bool isShortcut = (e->modifiers().testFlag(Qt::ControlModifier) && e->key() == Qt::Key_E); // CTRL+E
if (!c || !isShortcut) // do not process the shortcut when we have a completer
QTextEdit::keyPressEvent(e);
//! [7]
//! [8]
- const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier);
+ const bool ctrlOrShift = e->modifiers().testFlag(Qt::ControlModifier) ||
+ e->modifiers().testFlag(Qt::ShiftModifier);
if (!c || (ctrlOrShift && e->text().isEmpty()))
return;
static QString eow("~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word
- bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift;
+ const bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift;
QString completionPrefix = textUnderCursor();
if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 3
diff --git a/examples/widgets/tools/customcompleter/textedit.h b/examples/widgets/tools/customcompleter/textedit.h
index d0636ab670..788cb74ae1 100644
--- a/examples/widgets/tools/customcompleter/textedit.h
+++ b/examples/widgets/tools/customcompleter/textedit.h
@@ -63,7 +63,7 @@ class TextEdit : public QTextEdit
Q_OBJECT
public:
- TextEdit(QWidget *parent = 0);
+ TextEdit(QWidget *parent = nullptr);
~TextEdit();
void setCompleter(QCompleter *c);
@@ -80,7 +80,7 @@ private:
QString textUnderCursor() const;
private:
- QCompleter *c;
+ QCompleter *c = nullptr;
};
//! [0]
diff --git a/examples/widgets/tools/echoplugin/echowindow/echointerface.h b/examples/widgets/tools/echoplugin/echowindow/echointerface.h
index 1915330e21..fb07f7fb79 100644
--- a/examples/widgets/tools/echoplugin/echowindow/echointerface.h
+++ b/examples/widgets/tools/echoplugin/echowindow/echointerface.h
@@ -51,13 +51,14 @@
#ifndef ECHOINTERFACE_H
#define ECHOINTERFACE_H
+#include <QObject>
#include <QString>
//! [0]
class EchoInterface
{
public:
- virtual ~EchoInterface() {}
+ virtual ~EchoInterface() = default;
virtual QString echo(const QString &message) = 0;
};
diff --git a/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp b/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp
index 6886a4cd88..dce6bdedc3 100644
--- a/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp
+++ b/examples/widgets/tools/echoplugin/echowindow/echowindow.cpp
@@ -48,10 +48,17 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "echowindow.h"
+#include <QCoreApplication>
+#include <QDir>
+#include <QLabel>
+#include <QLayout>
+#include <QLineEdit>
+#include <QMessageBox>
+#include <QPluginLoader>
+#include <QPushButton>
+
//! [0]
EchoWindow::EchoWindow()
{
@@ -101,7 +108,7 @@ void EchoWindow::createGUI()
//! [3]
bool EchoWindow::loadPlugin()
{
- QDir pluginsDir(qApp->applicationDirPath());
+ QDir pluginsDir(QCoreApplication::applicationDirPath());
#if defined(Q_OS_WIN)
if (pluginsDir.dirName().toLower() == "debug" || pluginsDir.dirName().toLower() == "release")
pluginsDir.cdUp();
@@ -121,6 +128,7 @@ bool EchoWindow::loadPlugin()
echoInterface = qobject_cast<EchoInterface *>(plugin);
if (echoInterface)
return true;
+ pluginLoader.unload();
}
}
diff --git a/examples/widgets/tools/echoplugin/echowindow/main.cpp b/examples/widgets/tools/echoplugin/echowindow/main.cpp
index 50e3c2763b..d3cf45fcde 100644
--- a/examples/widgets/tools/echoplugin/echowindow/main.cpp
+++ b/examples/widgets/tools/echoplugin/echowindow/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
#include "echowindow.h"
#include "echointerface.h"
diff --git a/examples/widgets/tools/echoplugin/plugin/echoplugin.cpp b/examples/widgets/tools/echoplugin/plugin/echoplugin.cpp
index de6b6a4462..c9dd93aab8 100644
--- a/examples/widgets/tools/echoplugin/plugin/echoplugin.cpp
+++ b/examples/widgets/tools/echoplugin/plugin/echoplugin.cpp
@@ -48,8 +48,6 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "echoplugin.h"
//! [0]
diff --git a/examples/widgets/tools/i18n/languagechooser.cpp b/examples/widgets/tools/i18n/languagechooser.cpp
index f07d0ddee3..2ce3471873 100644
--- a/examples/widgets/tools/i18n/languagechooser.cpp
+++ b/examples/widgets/tools/i18n/languagechooser.cpp
@@ -48,40 +48,39 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "languagechooser.h"
#include "mainwindow.h"
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-QT_BEGIN_NAMESPACE
-extern void qt_mac_set_menubar_merge(bool merge);
-QT_END_NAMESPACE
-#endif
+#include <QCoreApplication>
+#include <QCheckBox>
+#include <QDialogButtonBox>
+#include <QDir>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QPushButton>
+#include <QTranslator>
-LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent)
+LanguageChooser::LanguageChooser(const QString &defaultLang, QWidget *parent)
: QDialog(parent, Qt::WindowStaysOnTopHint)
{
groupBox = new QGroupBox("Languages");
QGridLayout *groupBoxLayout = new QGridLayout;
- QStringList qmFiles = findQmFiles();
+ const QStringList qmFiles = findQmFiles();
for (int i = 0; i < qmFiles.size(); ++i) {
- QCheckBox *checkBox = new QCheckBox(languageName(qmFiles[i]));
- qmFileForCheckBoxMap.insert(checkBox, qmFiles[i]);
- connect(checkBox,
- QOverload<bool>::of(&QCheckBox::toggled),
- this,
- &LanguageChooser::checkBoxToggled);
- if (languageMatch(defaultLang, qmFiles[i]))
- checkBox->setCheckState(Qt::Checked);
+ const QString &qmlFile = qmFiles.at(i);
+ QCheckBox *checkBox = new QCheckBox(languageName(qmlFile));
+ qmFileForCheckBoxMap.insert(checkBox, qmlFile);
+ connect(checkBox, &QCheckBox::toggled,
+ this, &LanguageChooser::checkBoxToggled);
+ if (languageMatch(defaultLang, qmlFile))
+ checkBox->setCheckState(Qt::Checked);
groupBoxLayout->addWidget(checkBox, i / 2, i % 2);
}
groupBox->setLayout(groupBoxLayout);
buttonBox = new QDialogButtonBox;
-
showAllButton = buttonBox->addButton("Show All",
QDialogButtonBox::ActionRole);
hideAllButton = buttonBox->addButton("Hide All",
@@ -95,14 +94,10 @@ LanguageChooser::LanguageChooser(const QString& defaultLang, QWidget *parent)
mainLayout->addWidget(buttonBox);
setLayout(mainLayout);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- qt_mac_set_menubar_merge(false);
-#endif
-
setWindowTitle("I18N");
}
-bool LanguageChooser::languageMatch(const QString& lang, const QString& qmFile)
+bool LanguageChooser::languageMatch(const QString &lang, const QString &qmFile)
{
//qmFile: i18n_xx.qm
const QString prefix = "i18n_";
@@ -120,21 +115,21 @@ bool LanguageChooser::eventFilter(QObject *object, QEvent *event)
checkBox->setChecked(false);
}
}
- return QWidget::eventFilter(object, event);
+ return QDialog::eventFilter(object, event);
}
void LanguageChooser::closeEvent(QCloseEvent * /* event */)
{
- qApp->quit();
+ QCoreApplication::quit();
}
void LanguageChooser::checkBoxToggled()
{
QCheckBox *checkBox = qobject_cast<QCheckBox *>(sender());
- MainWindow *window = mainWindowForCheckBoxMap[checkBox];
+ MainWindow *window = mainWindowForCheckBoxMap.value(checkBox);
if (!window) {
QTranslator translator;
- translator.load(qmFileForCheckBoxMap[checkBox]);
+ translator.load(qmFileForCheckBoxMap.value(checkBox));
qApp->installTranslator(&translator);
window = new MainWindow;
@@ -163,11 +158,8 @@ QStringList LanguageChooser::findQmFiles()
QDir dir(":/translations");
QStringList fileNames = dir.entryList(QStringList("*.qm"), QDir::Files,
QDir::Name);
- QMutableStringListIterator i(fileNames);
- while (i.hasNext()) {
- i.next();
- i.setValue(dir.filePath(i.value()));
- }
+ for (QString &fileName : fileNames)
+ fileName = dir.filePath(fileName);
return fileNames;
}
diff --git a/examples/widgets/tools/i18n/languagechooser.h b/examples/widgets/tools/i18n/languagechooser.h
index 13363c7111..733cc50fd3 100644
--- a/examples/widgets/tools/i18n/languagechooser.h
+++ b/examples/widgets/tools/i18n/languagechooser.h
@@ -52,7 +52,7 @@
#define LANGUAGECHOOSER_H
#include <QDialog>
-#include <QMap>
+#include <QHash>
#include <QStringList>
QT_BEGIN_NAMESPACE
@@ -68,7 +68,7 @@ class LanguageChooser : public QDialog
Q_OBJECT
public:
- explicit LanguageChooser(const QString& defaultLang = QString(), QWidget *parent = 0);
+ explicit LanguageChooser(const QString &defaultLang = QString(), QWidget *parent = nullptr);
protected:
bool eventFilter(QObject *object, QEvent *event) override;
@@ -80,17 +80,17 @@ private slots:
void hideAll();
private:
- QStringList findQmFiles();
- QString languageName(const QString &qmFile);
- QColor colorForLanguage(const QString &language);
- static bool languageMatch(const QString& lang, const QString& qmFile);
+ static QStringList findQmFiles();
+ static QString languageName(const QString &qmFile);
+ static QColor colorForLanguage(const QString &language);
+ static bool languageMatch(const QString &lang, const QString &qmFile);
QGroupBox *groupBox;
QDialogButtonBox *buttonBox;
QAbstractButton *showAllButton;
QAbstractButton *hideAllButton;
- QMap<QCheckBox *, QString> qmFileForCheckBoxMap;
- QMap<QCheckBox *, MainWindow *> mainWindowForCheckBoxMap;
+ QHash<QCheckBox *, QString> qmFileForCheckBoxMap;
+ QHash<QCheckBox *, MainWindow *> mainWindowForCheckBoxMap;
};
#endif
diff --git a/examples/widgets/tools/i18n/mainwindow.cpp b/examples/widgets/tools/i18n/mainwindow.cpp
index 6ebfddfa98..a107a819ca 100644
--- a/examples/widgets/tools/i18n/mainwindow.cpp
+++ b/examples/widgets/tools/i18n/mainwindow.cpp
@@ -48,18 +48,26 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
+#include <QAction>
+#include <QCoreApplication>
+#include <QGroupBox>
+#include <QListWidget>
+#include <QMenuBar>
+#include <QRadioButton>
+#include <QStatusBar>
+#include <QVBoxLayout>
+
static const char * const listEntries[] = {
QT_TRANSLATE_NOOP("MainWindow", "First"),
QT_TRANSLATE_NOOP("MainWindow", "Second"),
QT_TRANSLATE_NOOP("MainWindow", "Third"),
- 0
+ nullptr
};
-MainWindow::MainWindow()
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
{
centralWidget = new QWidget;
setCentralWidget(centralWidget);
@@ -67,8 +75,8 @@ MainWindow::MainWindow()
createGroupBox();
listWidget = new QListWidget;
- for (int i = 0; listEntries[i]; ++i)
- listWidget->addItem(tr(listEntries[i]));
+ for (const char *entry : listEntries)
+ listWidget->addItem(tr(entry));
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(groupBox);
@@ -76,7 +84,7 @@ MainWindow::MainWindow()
centralWidget->setLayout(mainLayout);
exitAction = new QAction(tr("E&xit"), this);
- connect(exitAction, &QAction::triggered, qApp, QApplication::quit);
+ connect(exitAction, &QAction::triggered, qApp, QCoreApplication::quit);
fileMenu = menuBar()->addMenu(tr("&File"));
fileMenu->setPalette(QPalette(Qt::red));
diff --git a/examples/widgets/tools/i18n/mainwindow.h b/examples/widgets/tools/i18n/mainwindow.h
index e011151894..105472d60c 100644
--- a/examples/widgets/tools/i18n/mainwindow.h
+++ b/examples/widgets/tools/i18n/mainwindow.h
@@ -67,7 +67,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- MainWindow();
+ MainWindow(QWidget *parent = nullptr);
private:
void createGroupBox();
diff --git a/examples/widgets/tools/plugandpaint/app/interfaces.h b/examples/widgets/tools/plugandpaint/app/interfaces.h
index a1e91e13ff..705e578809 100644
--- a/examples/widgets/tools/plugandpaint/app/interfaces.h
+++ b/examples/widgets/tools/plugandpaint/app/interfaces.h
@@ -68,7 +68,7 @@ QT_END_NAMESPACE
class BrushInterface
{
public:
- virtual ~BrushInterface() {}
+ virtual ~BrushInterface() = default;
virtual QStringList brushes() const = 0;
virtual QRect mousePress(const QString &brush, QPainter &painter,
@@ -84,7 +84,7 @@ public:
class ShapeInterface
{
public:
- virtual ~ShapeInterface() {}
+ virtual ~ShapeInterface() = default;
virtual QStringList shapes() const = 0;
virtual QPainterPath generateShape(const QString &shape,
@@ -96,7 +96,7 @@ public:
class FilterInterface
{
public:
- virtual ~FilterInterface() {}
+ virtual ~FilterInterface() = default;
virtual QStringList filters() const = 0;
virtual QImage filterImage(const QString &filter, const QImage &image,
diff --git a/examples/widgets/tools/plugandpaint/app/mainwindow.cpp b/examples/widgets/tools/plugandpaint/app/mainwindow.cpp
index ebe1150eea..ff3b3614af 100644
--- a/examples/widgets/tools/plugandpaint/app/mainwindow.cpp
+++ b/examples/widgets/tools/plugandpaint/app/mainwindow.cpp
@@ -49,8 +49,8 @@
****************************************************************************/
-#include "interfaces.h"
#include "mainwindow.h"
+#include "interfaces.h"
#include "paintarea.h"
#include "plugindialog.h"
@@ -67,9 +67,8 @@
#include <QScrollArea>
#include <QTimer>
-MainWindow::MainWindow() :
- paintArea(new PaintArea),
- scrollArea(new QScrollArea)
+MainWindow::MainWindow() : paintArea(new PaintArea)
+ , scrollArea(new QScrollArea)
{
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(paintArea);
@@ -136,7 +135,11 @@ void MainWindow::brushWidth()
void MainWindow::changeBrush()
{
auto action = qobject_cast<QAction *>(sender());
+ if (!action)
+ return;
auto iBrush = qobject_cast<BrushInterface *>(action->parent());
+ if (!iBrush)
+ return;
const QString brush = action->text();
paintArea->setBrush(iBrush, brush);
@@ -147,7 +150,11 @@ void MainWindow::changeBrush()
void MainWindow::insertShape()
{
auto action = qobject_cast<QAction *>(sender());
+ if (!action)
+ return;
auto iShape = qobject_cast<ShapeInterface *>(action->parent());
+ if (!iShape)
+ return;
const QPainterPath path = iShape->generateShape(action->text(), this);
if (!path.isEmpty())
@@ -159,7 +166,11 @@ void MainWindow::insertShape()
void MainWindow::applyFilter()
{
auto action = qobject_cast<QAction *>(sender());
+ if (!action)
+ return;
auto iFilter = qobject_cast<FilterInterface *>(action->parent());
+ if (!iFilter)
+ return;
const QImage image = iFilter->filterImage(action->text(), paintArea->image(),
this);
@@ -247,7 +258,7 @@ void MainWindow::loadPlugins()
populateMenus(plugin);
//! [4] //! [5]
- pluginsDir = QDir(qApp->applicationDirPath());
+ pluginsDir = QDir(QCoreApplication::applicationDirPath());
#if defined(Q_OS_WIN)
if (pluginsDir.dirName().toLower() == "debug" || pluginsDir.dirName().toLower() == "release")
diff --git a/examples/widgets/tools/plugandpaint/app/paintarea.cpp b/examples/widgets/tools/plugandpaint/app/paintarea.cpp
index 4295e04cc0..92b8ea4777 100644
--- a/examples/widgets/tools/plugandpaint/app/paintarea.cpp
+++ b/examples/widgets/tools/plugandpaint/app/paintarea.cpp
@@ -49,17 +49,16 @@
****************************************************************************/
-#include "interfaces.h"
#include "paintarea.h"
+#include "interfaces.h"
#include <QMouseEvent>
#include <QPainter>
-PaintArea::PaintArea(QWidget *parent) :
- QWidget(parent)
+PaintArea::PaintArea(QWidget *parent) : QWidget(parent)
{
setAttribute(Qt::WA_StaticContents);
- setAttribute(Qt::WA_NoBackground);
+ setAttribute(Qt::WA_OpaquePaintEvent);
theImage.fill(qRgb(255, 255, 255));
}
diff --git a/examples/widgets/tools/plugandpaint/app/plugindialog.cpp b/examples/widgets/tools/plugandpaint/app/plugindialog.cpp
index 84bd364b41..204d6ffec4 100644
--- a/examples/widgets/tools/plugandpaint/app/plugindialog.cpp
+++ b/examples/widgets/tools/plugandpaint/app/plugindialog.cpp
@@ -49,8 +49,8 @@
****************************************************************************/
-#include "interfaces.h"
#include "plugindialog.h"
+#include "interfaces.h"
#include <QDir>
#include <QGridLayout>
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.cpp b/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.cpp
index 3b465565ba..64f9f7a0d9 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.cpp
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.cpp
@@ -50,10 +50,10 @@
#include "basictoolsplugin.h"
+#include <QInputDialog>
+#include <QPainter>
+#include <QRandomGenerator>
#include <QtMath>
-#include <QtWidgets>
-
-#include <stdlib.h>
//! [0]
QStringList BasicToolsPlugin::brushes() const
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h b/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h
index fd9bb9e5f3..1d9d170daa 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/basictoolsplugin.h
@@ -54,12 +54,12 @@
//! [0]
#include <interfaces.h>
-#include <QRect>
+#include <QImage>
#include <QObject>
-#include <QtPlugin>
-#include <QStringList>
#include <QPainterPath>
-#include <QImage>
+#include <QRect>
+#include <QStringList>
+#include <QtPlugin>
//! [1]
class BasicToolsPlugin : public QObject,
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.cpp b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.cpp
index 48717e34f6..30c616a830 100644
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.cpp
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/extrafiltersplugin.cpp
@@ -50,10 +50,7 @@
#include "extrafiltersplugin.h"
-#include <QtWidgets>
-
-#include <math.h>
-#include <stdlib.h>
+#include <QInputDialog>
QStringList ExtraFiltersPlugin::filters() const
{
diff --git a/examples/widgets/tools/regexp/regexpdialog.h b/examples/widgets/tools/regexp/regexpdialog.h
index 4bdc18da15..2f701a7228 100644
--- a/examples/widgets/tools/regexp/regexpdialog.h
+++ b/examples/widgets/tools/regexp/regexpdialog.h
@@ -65,7 +65,7 @@ class RegExpDialog : public QDialog
Q_OBJECT
public:
- RegExpDialog(QWidget *parent = 0);
+ RegExpDialog(QWidget *parent = nullptr);
private slots:
void refresh();
diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.h b/examples/widgets/tools/regularexpression/regularexpressiondialog.h
index ba5b38b5e3..8fe85afe56 100644
--- a/examples/widgets/tools/regularexpression/regularexpressiondialog.h
+++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.h
@@ -70,7 +70,7 @@ class RegularExpressionDialog : public QDialog
Q_OBJECT
public:
- RegularExpressionDialog(QWidget *parent = 0);
+ RegularExpressionDialog(QWidget *parent = nullptr);
private:
void refresh();
diff --git a/examples/widgets/tools/settingseditor/locationdialog.cpp b/examples/widgets/tools/settingseditor/locationdialog.cpp
index 5b6e2652bb..99c9834a63 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.cpp
+++ b/examples/widgets/tools/settingseditor/locationdialog.cpp
@@ -48,10 +48,20 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "locationdialog.h"
+#include <QBoxLayout>
+#include <QComboBox>
+#include <QDialogButtonBox>
+#include <QDir>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QHeaderView>
+#include <QLabel>
+#include <QLineEdit>
+#include <QTableWidget>
+#include <QTableWidgetItem>
+
LocationDialog::LocationDialog(QWidget *parent)
: QDialog(parent)
{
@@ -91,8 +101,7 @@ LocationDialog::LocationDialog(QWidget *parent)
locationsGroupBox = new QGroupBox(tr("Setting Locations"));
- QStringList labels;
- labels << tr("Location") << tr("Access");
+ const QStringList labels{tr("Location"), tr("Access")};
locationsTable = new QTableWidget;
locationsTable->setSelectionMode(QAbstractItemView::SingleSelection);
diff --git a/examples/widgets/tools/settingseditor/locationdialog.h b/examples/widgets/tools/settingseditor/locationdialog.h
index c25b01effd..cd2efecb0b 100644
--- a/examples/widgets/tools/settingseditor/locationdialog.h
+++ b/examples/widgets/tools/settingseditor/locationdialog.h
@@ -68,7 +68,7 @@ class LocationDialog : public QDialog
Q_OBJECT
public:
- LocationDialog(QWidget *parent = 0);
+ LocationDialog(QWidget *parent = nullptr);
QSettings::Format format() const;
QSettings::Scope scope() const;
diff --git a/examples/widgets/tools/settingseditor/mainwindow.cpp b/examples/widgets/tools/settingseditor/mainwindow.cpp
index a7a1e9b415..ccca16ffcd 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.cpp
+++ b/examples/widgets/tools/settingseditor/mainwindow.cpp
@@ -48,15 +48,23 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "locationdialog.h"
#include "mainwindow.h"
#include "settingstree.h"
-MainWindow::MainWindow()
- : settingsTree(new SettingsTree)
- , locationDialog(nullptr)
+#include <QAction>
+#include <QApplication>
+#include <QFileDialog>
+#include <QInputDialog>
+#include <QLineEdit>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QScreen>
+#include <QStandardPaths>
+#include <QStatusBar>
+
+MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
+ , settingsTree(new SettingsTree)
{
setCentralWidget(settingsTree);
@@ -66,7 +74,7 @@ MainWindow::MainWindow()
fallbacksAct->setChecked(true);
setWindowTitle(QCoreApplication::applicationName());
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ const QRect availableGeometry = screen()->availableGeometry();
adjustSize();
move((availableGeometry.width() - width()) / 2, (availableGeometry.height() - height()) / 2);
}
diff --git a/examples/widgets/tools/settingseditor/mainwindow.h b/examples/widgets/tools/settingseditor/mainwindow.h
index 373c982afe..b1115005a9 100644
--- a/examples/widgets/tools/settingseditor/mainwindow.h
+++ b/examples/widgets/tools/settingseditor/mainwindow.h
@@ -68,7 +68,7 @@ class MainWindow : public QMainWindow
public:
typedef QSharedPointer<QSettings> SettingsPtr;
- MainWindow();
+ MainWindow(QWidget *parent = nullptr);
private slots:
void openSettings();
@@ -81,11 +81,11 @@ private:
void createActions();
void setSettingsObject(const SettingsPtr &settings);
- SettingsTree *settingsTree;
- LocationDialog *locationDialog;
- QAction *refreshAct;
- QAction *autoRefreshAct;
- QAction *fallbacksAct;
+ SettingsTree *settingsTree = nullptr;
+ LocationDialog *locationDialog = nullptr;
+ QAction *refreshAct = nullptr;
+ QAction *autoRefreshAct = nullptr;
+ QAction *fallbacksAct = nullptr;
};
#endif
diff --git a/examples/widgets/tools/settingseditor/settingstree.cpp b/examples/widgets/tools/settingseditor/settingstree.cpp
index 8585792787..49d299bf72 100644
--- a/examples/widgets/tools/settingseditor/settingstree.cpp
+++ b/examples/widgets/tools/settingseditor/settingstree.cpp
@@ -48,20 +48,20 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "settingstree.h"
#include "variantdelegate.h"
+#include <QApplication>
+#include <QHeaderView>
+#include <QScreen>
+#include <QSettings>
+
SettingsTree::SettingsTree(QWidget *parent)
: QTreeWidget(parent)
- , autoRefresh(false)
{
setItemDelegate(new VariantDelegate(this));
- QStringList labels;
- labels << tr("Setting") << tr("Type") << tr("Value");
- setHeaderLabels(labels);
+ setHeaderLabels({tr("Setting"), tr("Type"), tr("Value")});
header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
header()->setSectionResizeMode(2, QHeaderView::Stretch);
@@ -77,10 +77,6 @@ SettingsTree::SettingsTree(QWidget *parent)
connect(&refreshTimer, &QTimer::timeout, this, &SettingsTree::maybeRefresh);
}
-SettingsTree::~SettingsTree()
-{
-}
-
void SettingsTree::setSettingsObject(const SettingsPtr &newSettings)
{
settings = newSettings;
@@ -97,7 +93,7 @@ void SettingsTree::setSettingsObject(const SettingsPtr &newSettings)
QSize SettingsTree::sizeHint() const
{
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(this);
+ const QRect availableGeometry = screen()->availableGeometry();
return QSize(availableGeometry.width() * 2 / 3, availableGeometry.height() * 2 / 3);
}
@@ -137,7 +133,7 @@ void SettingsTree::refresh()
this, &SettingsTree::updateSetting);
settings->sync();
- updateChildItems(0);
+ updateChildItems(nullptr);
connect(this, &QTreeWidget::itemChanged,
this, &SettingsTree::updateSetting);
@@ -228,7 +224,7 @@ void SettingsTree::updateChildItems(QTreeWidgetItem *parent)
QTreeWidgetItem *SettingsTree::createItem(const QString &text,
QTreeWidgetItem *parent, int index)
{
- QTreeWidgetItem *after = 0;
+ QTreeWidgetItem *after = nullptr;
if (index != 0)
after = childAt(parent, index - 1);
@@ -243,24 +239,18 @@ QTreeWidgetItem *SettingsTree::createItem(const QString &text,
return item;
}
-QTreeWidgetItem *SettingsTree::childAt(QTreeWidgetItem *parent, int index)
+QTreeWidgetItem *SettingsTree::childAt(QTreeWidgetItem *parent, int index) const
{
- if (parent)
- return parent->child(index);
- else
- return topLevelItem(index);
+ return (parent ? parent->child(index) : topLevelItem(index));
}
-int SettingsTree::childCount(QTreeWidgetItem *parent)
+int SettingsTree::childCount(QTreeWidgetItem *parent) const
{
- if (parent)
- return parent->childCount();
- else
- return topLevelItemCount();
+ return (parent ? parent->childCount() : topLevelItemCount());
}
int SettingsTree::findChild(QTreeWidgetItem *parent, const QString &text,
- int startIndex)
+ int startIndex) const
{
for (int i = startIndex; i < childCount(parent); ++i) {
if (childAt(parent, i)->text(0) == text)
diff --git a/examples/widgets/tools/settingseditor/settingstree.h b/examples/widgets/tools/settingseditor/settingstree.h
index 15efa0e6aa..3e9e9658ce 100644
--- a/examples/widgets/tools/settingseditor/settingstree.h
+++ b/examples/widgets/tools/settingseditor/settingstree.h
@@ -65,10 +65,9 @@ class SettingsTree : public QTreeWidget
Q_OBJECT
public:
- typedef QSharedPointer<QSettings> SettingsPtr;
+ using SettingsPtr = QSharedPointer<QSettings>;
- SettingsTree(QWidget *parent = 0);
- ~SettingsTree();
+ SettingsTree(QWidget *parent = nullptr);
void setSettingsObject(const SettingsPtr &settings);
QSize sizeHint() const override;
@@ -89,16 +88,16 @@ private:
void updateChildItems(QTreeWidgetItem *parent);
QTreeWidgetItem *createItem(const QString &text, QTreeWidgetItem *parent,
int index);
- QTreeWidgetItem *childAt(QTreeWidgetItem *parent, int index);
- int childCount(QTreeWidgetItem *parent);
- int findChild(QTreeWidgetItem *parent, const QString &text, int startIndex);
+ QTreeWidgetItem *childAt(QTreeWidgetItem *parent, int index) const;
+ int childCount(QTreeWidgetItem *parent) const;
+ int findChild(QTreeWidgetItem *parent, const QString &text, int startIndex) const;
void moveItemForward(QTreeWidgetItem *parent, int oldIndex, int newIndex);
SettingsPtr settings;
QTimer refreshTimer;
- bool autoRefresh;
QIcon groupIcon;
QIcon keyIcon;
+ bool autoRefresh = false;
};
#endif
diff --git a/examples/widgets/tools/settingseditor/variantdelegate.cpp b/examples/widgets/tools/settingseditor/variantdelegate.cpp
index 266754ca4d..9772fe8a41 100644
--- a/examples/widgets/tools/settingseditor/variantdelegate.cpp
+++ b/examples/widgets/tools/settingseditor/variantdelegate.cpp
@@ -48,12 +48,14 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "variantdelegate.h"
+#include <QDateTime>
+#include <QLineEdit>
+#include <QRegularExpressionValidator>
+
VariantDelegate::VariantDelegate(QObject *parent)
- : QItemDelegate(parent)
+ : QStyledItemDelegate(parent)
{
boolExp.setPattern("true|false");
boolExp.setPatternOptions(QRegularExpression::CaseInsensitiveOption);
@@ -82,12 +84,12 @@ void VariantDelegate::paint(QPainter *painter,
if (!isSupportedType(value.type())) {
QStyleOptionViewItem myOption = option;
myOption.state &= ~QStyle::State_Enabled;
- QItemDelegate::paint(painter, myOption, index);
+ QStyledItemDelegate::paint(painter, myOption, index);
return;
}
}
- QItemDelegate::paint(painter, option, index);
+ QStyledItemDelegate::paint(painter, option, index);
}
QWidget *VariantDelegate::createEditor(QWidget *parent,
@@ -95,11 +97,11 @@ QWidget *VariantDelegate::createEditor(QWidget *parent,
const QModelIndex &index) const
{
if (index.column() != 2)
- return 0;
+ return nullptr;
QVariant originalValue = index.model()->data(index, Qt::UserRole);
if (!isSupportedType(originalValue.type()))
- return 0;
+ return nullptr;
QLineEdit *lineEdit = new QLineEdit(parent);
lineEdit->setFrame(false);
@@ -149,7 +151,7 @@ QWidget *VariantDelegate::createEditor(QWidget *parent,
regExp = unsignedIntegerExp;
break;
default:
- ;
+ break;
}
if (regExp.isValid()) {
diff --git a/examples/widgets/tools/settingseditor/variantdelegate.h b/examples/widgets/tools/settingseditor/variantdelegate.h
index 7cd9fa9ee8..68f21fa3f6 100644
--- a/examples/widgets/tools/settingseditor/variantdelegate.h
+++ b/examples/widgets/tools/settingseditor/variantdelegate.h
@@ -51,15 +51,15 @@
#ifndef VARIANTDELEGATE_H
#define VARIANTDELEGATE_H
-#include <QItemDelegate>
+#include <QStyledItemDelegate>
#include <QRegularExpression>
-class VariantDelegate : public QItemDelegate
+class VariantDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
- VariantDelegate(QObject *parent = 0);
+ VariantDelegate(QObject *parent = nullptr);
void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyle.cpp b/examples/widgets/tools/styleplugin/plugin/simplestyle.cpp
index 59da6a8672..765c9c2745 100644
--- a/examples/widgets/tools/styleplugin/plugin/simplestyle.cpp
+++ b/examples/widgets/tools/styleplugin/plugin/simplestyle.cpp
@@ -48,8 +48,6 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "simplestyle.h"
void SimpleStyle::polish(QPalette &palette)
diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyle.h b/examples/widgets/tools/styleplugin/plugin/simplestyle.h
index 51d6d5b77e..4f49de8cbc 100644
--- a/examples/widgets/tools/styleplugin/plugin/simplestyle.h
+++ b/examples/widgets/tools/styleplugin/plugin/simplestyle.h
@@ -53,16 +53,12 @@
#include <QProxyStyle>
-QT_BEGIN_NAMESPACE
-class QPalette;
-QT_END_NAMESPACE
-
class SimpleStyle : public QProxyStyle
{
Q_OBJECT
public:
- SimpleStyle() {};
+ SimpleStyle() = default;
void polish(QPalette &palette) override;
};
diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.cpp b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.cpp
index 344e46061c..cbe7c15cc0 100644
--- a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.cpp
+++ b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.cpp
@@ -48,15 +48,13 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "simplestyleplugin.h"
#include "simplestyle.h"
//! [0]
QStringList SimpleStylePlugin::keys() const
{
- return QStringList() << "SimpleStyle";
+ return {"SimpleStyle"};
}
//! [0]
@@ -65,6 +63,6 @@ QStyle *SimpleStylePlugin::create(const QString &key)
{
if (key.toLower() == "simplestyle")
return new SimpleStyle;
- return 0;
+ return nullptr;
}
//! [1]
diff --git a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h
index 88805d4887..3ce37410eb 100644
--- a/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h
+++ b/examples/widgets/tools/styleplugin/plugin/simplestyleplugin.h
@@ -53,11 +53,6 @@
#include <QStylePlugin>
-QT_BEGIN_NAMESPACE
-class QStringList;
-class QStyle;
-QT_END_NAMESPACE
-
//! [0]
class SimpleStylePlugin : public QStylePlugin
{
@@ -65,7 +60,7 @@ class SimpleStylePlugin : public QStylePlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "simplestyle.json")
public:
- SimpleStylePlugin() {}
+ SimpleStylePlugin() = default;
QStringList keys() const;
QStyle *create(const QString &key) override;
diff --git a/examples/widgets/tools/styleplugin/stylewindow/main.cpp b/examples/widgets/tools/styleplugin/stylewindow/main.cpp
index 93816d393d..ff29eb119e 100644
--- a/examples/widgets/tools/styleplugin/stylewindow/main.cpp
+++ b/examples/widgets/tools/styleplugin/stylewindow/main.cpp
@@ -48,7 +48,8 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
+#include <QStyleFactory>
#include "stylewindow.h"
diff --git a/examples/widgets/tools/styleplugin/stylewindow/stylewindow.cpp b/examples/widgets/tools/styleplugin/stylewindow/stylewindow.cpp
index 7a05a3ae92..90413ed12e 100644
--- a/examples/widgets/tools/styleplugin/stylewindow/stylewindow.cpp
+++ b/examples/widgets/tools/styleplugin/stylewindow/stylewindow.cpp
@@ -48,7 +48,9 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QPushButton>
#include "stylewindow.h"
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
index dec3cb0496..302ccc436c 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.cpp
@@ -48,13 +48,28 @@
**
****************************************************************************/
-#include <QtWidgets>
-#include "treemodelcompleter.h"
#include "mainwindow.h"
+#include "treemodelcompleter.h"
+
+#include <QAbstractProxyModel>
+#include <QAction>
+#include <QApplication>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QFile>
+#include <QGridLayout>
+#include <QHeaderView>
+#include <QLabel>
+#include <QLineEdit>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QStandardItemModel>
+#include <QStringListModel>
+#include <QTreeView>
//! [0]
MainWindow::MainWindow(QWidget *parent)
- : QMainWindow(parent), completer(0), lineEdit(0)
+ : QMainWindow(parent)
{
createMenu();
@@ -151,10 +166,10 @@ void MainWindow::createMenu()
connect(aboutAct, &QAction::triggered, this, &MainWindow::about);
connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
- QMenu* fileMenu = menuBar()->addMenu(tr("File"));
+ QMenu *fileMenu = menuBar()->addMenu(tr("File"));
fileMenu->addAction(exitAction);
- QMenu* helpMenu = menuBar()->addMenu(tr("About"));
+ QMenu *helpMenu = menuBar()->addMenu(tr("About"));
helpMenu->addAction(aboutAct);
helpMenu->addAction(aboutQtAct);
}
@@ -175,7 +190,7 @@ void MainWindow::changeMode(int index)
}
//! [5]
-QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
+QAbstractItemModel *MainWindow::modelFromFile(const QString &fileName)
{
QFile file(fileName);
if (!file.open(QFile::ReadOnly))
@@ -184,39 +199,35 @@ QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
#ifndef QT_NO_CURSOR
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
#endif
- QStringList words;
QStandardItemModel *model = new QStandardItemModel(completer);
QVector<QStandardItem *> parents(10);
parents[0] = model->invisibleRootItem();
+ QRegularExpression re("^\\s+");
while (!file.atEnd()) {
- QString line = file.readLine();
- QString trimmedLine = line.trimmed();
- if (line.isEmpty() || trimmedLine.isEmpty())
+ const QString line = QString::fromUtf8(file.readLine()).trimmed();
+ const QString trimmedLine = line.trimmed();
+ if (trimmedLine.isEmpty())
continue;
- QRegularExpression re("^\\s+");
- QRegularExpressionMatch match = re.match(line);
+ const QRegularExpressionMatch match = re.match(line);
int nonws = match.capturedStart();
int level = 0;
if (nonws == -1) {
level = 0;
} else {
- if (line.startsWith("\t")) {
- level = match.capturedLength();
- } else {
- level = match.capturedLength()/4;
- }
+ const int capLen = match.capturedLength();
+ level = line.startsWith(QLatin1Char('\t')) ? capLen / 4 : capLen;
}
- if (level+1 >= parents.size())
- parents.resize(parents.size()*2);
+ if (level + 1 >= parents.size())
+ parents.resize(parents.size() * 2);
QStandardItem *item = new QStandardItem;
item->setText(trimmedLine);
parents[level]->appendRow(item);
- parents[level+1] = item;
+ parents[level + 1] = item;
}
#ifndef QT_NO_CURSOR
@@ -252,7 +263,7 @@ void MainWindow::changeCase(int cs)
}
//! [7]
-void MainWindow::updateContentsLabel(const QString& sep)
+void MainWindow::updateContentsLabel(const QString &sep)
{
contentsLabel->setText(tr("Type path from model above with items at each level separated by a '%1'").arg(sep));
}
diff --git a/examples/widgets/tools/treemodelcompleter/mainwindow.h b/examples/widgets/tools/treemodelcompleter/mainwindow.h
index 2edcd5aab0..87f492c4ac 100644
--- a/examples/widgets/tools/treemodelcompleter/mainwindow.h
+++ b/examples/widgets/tools/treemodelcompleter/mainwindow.h
@@ -60,8 +60,6 @@ class QAbstractItemModel;
class QComboBox;
class QLabel;
class QLineEdit;
-class QProgressBar;
-class QCheckBox;
class QTreeView;
QT_END_NAMESPACE
@@ -71,27 +69,27 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
private slots:
void about();
void changeCase(int);
void changeMode(int);
- void highlight(const QModelIndex&);
- void updateContentsLabel(const QString&);
+ void highlight(const QModelIndex &index);
+ void updateContentsLabel(const QString &sep);
//! [0]
//! [1]
private:
void createMenu();
- QAbstractItemModel *modelFromFile(const QString& fileName);
+ QAbstractItemModel *modelFromFile(const QString &fileName);
- QTreeView *treeView;
- QComboBox *caseCombo;
- QComboBox *modeCombo;
- QLabel *contentsLabel;
- TreeModelCompleter *completer;
- QLineEdit *lineEdit;
+ QTreeView *treeView = nullptr;
+ QComboBox *caseCombo = nullptr;
+ QComboBox *modeCombo = nullptr;
+ QLabel *contentsLabel = nullptr;
+ TreeModelCompleter *completer = nullptr;
+ QLineEdit *lineEdit = nullptr;
};
//! [1]
diff --git a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.cpp b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.cpp
index cab0476e3c..8930c815d5 100644
--- a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.cpp
+++ b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.cpp
@@ -80,26 +80,20 @@ QString TreeModelCompleter::separator() const
//! [3]
QStringList TreeModelCompleter::splitPath(const QString &path) const
{
- if (sep.isNull()) {
- return QCompleter::splitPath(path);
- }
-
- return path.split(sep);
+ return (sep.isNull() ? QCompleter::splitPath(path) : path.split(sep));
}
//! [3]
//! [4]
QString TreeModelCompleter::pathFromIndex(const QModelIndex &index) const
{
- if (sep.isNull()) {
+ if (sep.isNull())
return QCompleter::pathFromIndex(index);
- }
// navigate up and accumulate data
QStringList dataList;
- for (QModelIndex i = index; i.isValid(); i = i.parent()) {
+ for (QModelIndex i = index; i.isValid(); i = i.parent())
dataList.prepend(model()->data(i, completionRole()).toString());
- }
return dataList.join(sep);
}
diff --git a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h
index 1d28fddee0..d7d1852cc7 100644
--- a/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h
+++ b/examples/widgets/tools/treemodelcompleter/treemodelcompleter.h
@@ -60,8 +60,8 @@ class TreeModelCompleter : public QCompleter
Q_PROPERTY(QString separator READ separator WRITE setSeparator)
public:
- explicit TreeModelCompleter(QObject *parent = 0);
- explicit TreeModelCompleter(QAbstractItemModel *model, QObject *parent = 0);
+ explicit TreeModelCompleter(QObject *parent = nullptr);
+ explicit TreeModelCompleter(QAbstractItemModel *model, QObject *parent = nullptr);
QString separator() const;
public slots:
diff --git a/examples/widgets/tools/undo/commands.cpp b/examples/widgets/tools/undo/commands.cpp
index 81561d2421..97204f9d2f 100644
--- a/examples/widgets/tools/undo/commands.cpp
+++ b/examples/widgets/tools/undo/commands.cpp
@@ -50,18 +50,16 @@
#include "commands.h"
-static const int setShapeRectCommandId = 1;
-static const int setShapeColorCommandId = 2;
+static constexpr int setShapeRectCommandId = 1;
+static constexpr int setShapeColorCommandId = 2;
/******************************************************************************
** AddShapeCommand
*/
AddShapeCommand::AddShapeCommand(Document *doc, const Shape &shape, QUndoCommand *parent)
- : QUndoCommand(parent)
+ : QUndoCommand(parent), m_doc(doc), m_shape(shape)
{
- m_doc = doc;
- m_shape = shape;
}
void AddShapeCommand::undo()
@@ -81,13 +79,11 @@ void AddShapeCommand::redo()
*/
RemoveShapeCommand::RemoveShapeCommand(Document *doc, const QString &shapeName,
- QUndoCommand *parent)
- : QUndoCommand(parent)
+ QUndoCommand *parent)
+ : QUndoCommand(parent), m_doc(doc), m_shape(doc->shape(shapeName))
+ , m_shapeName(shapeName)
{
setText(QObject::tr("Remove %1").arg(shapeName));
- m_doc = doc;
- m_shape = doc->shape(shapeName);
- m_shapeName = shapeName;
}
void RemoveShapeCommand::undo()
@@ -105,15 +101,11 @@ void RemoveShapeCommand::redo()
*/
SetShapeColorCommand::SetShapeColorCommand(Document *doc, const QString &shapeName,
- const QColor &color, QUndoCommand *parent)
- : QUndoCommand(parent)
+ const QColor &color, QUndoCommand *parent)
+ : QUndoCommand(parent), m_doc(doc), m_shapeName(shapeName)
+ , m_oldColor(doc->shape(shapeName).color()), m_newColor(color)
{
setText(QObject::tr("Set %1's color").arg(shapeName));
-
- m_doc = doc;
- m_shapeName = shapeName;
- m_oldColor = doc->shape(shapeName).color();
- m_newColor = color;
}
void SetShapeColorCommand::undo()
@@ -149,15 +141,11 @@ int SetShapeColorCommand::id() const
*/
SetShapeRectCommand::SetShapeRectCommand(Document *doc, const QString &shapeName,
- const QRect &rect, QUndoCommand *parent)
- : QUndoCommand(parent)
+ const QRect &rect, QUndoCommand *parent)
+ : QUndoCommand(parent), m_doc(doc), m_shapeName(shapeName)
+ , m_oldRect(doc->shape(shapeName).rect()), m_newRect(rect)
{
setText(QObject::tr("Change %1's geometry").arg(shapeName));
-
- m_doc = doc;
- m_shapeName = shapeName;
- m_oldRect = doc->shape(shapeName).rect();
- m_newRect = rect;
}
void SetShapeRectCommand::undo()
diff --git a/examples/widgets/tools/undo/commands.h b/examples/widgets/tools/undo/commands.h
index de3bebd740..ccb550fdd4 100644
--- a/examples/widgets/tools/undo/commands.h
+++ b/examples/widgets/tools/undo/commands.h
@@ -57,7 +57,8 @@
class AddShapeCommand : public QUndoCommand
{
public:
- AddShapeCommand(Document *doc, const Shape &shape, QUndoCommand *parent = 0);
+ AddShapeCommand(Document *doc, const Shape &shape,
+ QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -70,7 +71,8 @@ private:
class RemoveShapeCommand : public QUndoCommand
{
public:
- RemoveShapeCommand(Document *doc, const QString &shapeName, QUndoCommand *parent = 0);
+ RemoveShapeCommand(Document *doc, const QString &shapeName,
+ QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -83,8 +85,8 @@ private:
class SetShapeColorCommand : public QUndoCommand
{
public:
- SetShapeColorCommand(Document *doc, const QString &shapeName, const QColor &color,
- QUndoCommand *parent = 0);
+ SetShapeColorCommand(Document *doc, const QString &shapeName,
+ const QColor &color, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -102,8 +104,8 @@ private:
class SetShapeRectCommand : public QUndoCommand
{
public:
- SetShapeRectCommand(Document *doc, const QString &shapeName, const QRect &rect,
- QUndoCommand *parent = 0);
+ SetShapeRectCommand(Document *doc, const QString &shapeName,
+ const QRect &rect, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
diff --git a/examples/widgets/tools/undo/document.cpp b/examples/widgets/tools/undo/document.cpp
index 8935f98a7a..2deed83a99 100644
--- a/examples/widgets/tools/undo/document.cpp
+++ b/examples/widgets/tools/undo/document.cpp
@@ -48,14 +48,15 @@
**
****************************************************************************/
-#include <qevent.h>
+#include "document.h"
+#include "commands.h"
+
#include <QPainter>
+#include <QPaintEvent>
#include <QTextStream>
#include <QUndoStack>
-#include "document.h"
-#include "commands.h"
-static const int resizeHandleWidth = 6;
+static constexpr int resizeHandleWidth = 6;
/******************************************************************************
** Shape
@@ -96,26 +97,21 @@ QRect Shape::resizeHandle() const
QString Shape::typeToString(Type type)
{
- QString result;
-
switch (type) {
case Rectangle:
- result = QLatin1String("Rectangle");
- break;
+ return QLatin1String("Rectangle");
case Circle:
- result = QLatin1String("Circle");
- break;
+ return QLatin1String("Circle");
case Triangle:
- result = QLatin1String("Triangle");
- break;
+ return QLatin1String("Triangle");
}
- return result;
+ return QString();
}
Shape::Type Shape::stringToType(const QString &s, bool *ok)
{
- if (ok != 0)
+ if (ok != nullptr)
*ok = true;
if (s == QLatin1String("Rectangle"))
@@ -125,7 +121,7 @@ Shape::Type Shape::stringToType(const QString &s, bool *ok)
if (s == QLatin1String("Triangle"))
return Triangle;
- if (ok != 0)
+ if (ok != nullptr)
*ok = false;
return Rectangle;
}
@@ -135,10 +131,8 @@ Shape::Type Shape::stringToType(const QString &s, bool *ok)
*/
Document::Document(QWidget *parent)
- : QWidget(parent), m_currentIndex(-1), m_mousePressIndex(-1), m_resizeHandlePressed(false)
+ : QWidget(parent), m_undoStack(new QUndoStack(this))
{
- m_undoStack = new QUndoStack(this);
-
setAutoFillBackground(true);
setBackgroundRole(QPalette::Base);
diff --git a/examples/widgets/tools/undo/document.h b/examples/widgets/tools/undo/document.h
index 8076d7185c..01447ef541 100644
--- a/examples/widgets/tools/undo/document.h
+++ b/examples/widgets/tools/undo/document.h
@@ -70,7 +70,7 @@ public:
QColor color() const;
static QString typeToString(Type type);
- static Type stringToType(const QString &s, bool *ok = 0);
+ static Type stringToType(const QString &s, bool *ok = nullptr);
static const QSize minSize;
@@ -88,7 +88,7 @@ class Document : public QWidget
Q_OBJECT
public:
- Document(QWidget *parent = 0);
+ Document(QWidget *parent = nullptr);
QString addShape(const Shape &shape);
void deleteShape(const QString &shapeName);
@@ -121,14 +121,13 @@ private:
int indexAt(const QPoint &pos) const;
QString uniqueName(const QString &name) const;
- QList<Shape> m_shapeList;
- int m_currentIndex;
- int m_mousePressIndex;
+ QVector<Shape> m_shapeList;
QPoint m_mousePressOffset;
- bool m_resizeHandlePressed;
QString m_fileName;
-
- QUndoStack *m_undoStack;
+ QUndoStack *m_undoStack = nullptr;
+ int m_currentIndex = -1;
+ int m_mousePressIndex = -1;
+ bool m_resizeHandlePressed = false;
};
#endif // DOCUMENT_H
diff --git a/examples/widgets/tools/undo/mainwindow.cpp b/examples/widgets/tools/undo/mainwindow.cpp
index 118d604742..9d83e3067a 100644
--- a/examples/widgets/tools/undo/mainwindow.cpp
+++ b/examples/widgets/tools/undo/mainwindow.cpp
@@ -48,6 +48,10 @@
**
****************************************************************************/
+#include "mainwindow.h"
+#include "document.h"
+#include "commands.h"
+
#include <QUndoGroup>
#include <QUndoStack>
#include <QFileDialog>
@@ -55,9 +59,6 @@
#include <QRandomGenerator>
#include <QTextStream>
#include <QToolButton>
-#include "document.h"
-#include "mainwindow.h"
-#include "commands.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
@@ -122,17 +123,17 @@ MainWindow::MainWindow(QWidget *parent)
void MainWindow::updateActions()
{
Document *doc = currentDocument();
- m_undoGroup->setActiveStack(doc == 0 ? 0 : doc->undoStack());
- QString shapeName = doc == 0 ? QString() : doc->currentShapeName();
-
- actionAddRobot->setEnabled(doc != 0);
- actionAddSnowman->setEnabled(doc != 0);
- actionAddCircle->setEnabled(doc != 0);
- actionAddRectangle->setEnabled(doc != 0);
- actionAddTriangle->setEnabled(doc != 0);
- actionClose->setEnabled(doc != 0);
- actionSave->setEnabled(doc != 0 && !doc->undoStack()->isClean());
- undoLimit->setEnabled(doc != 0 && doc->undoStack()->count() == 0);
+ m_undoGroup->setActiveStack(doc == nullptr ? nullptr : doc->undoStack());
+ QString shapeName = doc == nullptr ? QString() : doc->currentShapeName();
+
+ actionAddRobot->setEnabled(doc != nullptr);
+ actionAddSnowman->setEnabled(doc != nullptr);
+ actionAddCircle->setEnabled(doc != nullptr);
+ actionAddRectangle->setEnabled(doc != nullptr);
+ actionAddTriangle->setEnabled(doc != nullptr);
+ actionClose->setEnabled(doc != nullptr);
+ actionSave->setEnabled(doc != nullptr && !doc->undoStack()->isClean());
+ undoLimit->setEnabled(doc != nullptr && doc->undoStack()->count() == 0);
if (shapeName.isEmpty()) {
actionRed->setEnabled(false);
@@ -147,7 +148,7 @@ void MainWindow::updateActions()
actionRemoveShape->setEnabled(true);
}
- if (doc != 0) {
+ if (doc != nullptr) {
int index = documentTabs->indexOf(doc);
Q_ASSERT(index != -1);
static const QIcon unsavedIcon(":/icons/filesave.png");
@@ -264,7 +265,7 @@ void MainWindow::removeDocument(Document *doc)
void MainWindow::saveDocument()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
for (;;) {
@@ -298,7 +299,7 @@ void MainWindow::saveDocument()
void MainWindow::closeDocument()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
if (!doc->undoStack()->isClean()) {
@@ -338,10 +339,10 @@ static QRect randomRect(const QSize &s)
{
QSize min = Shape::minSize;
- int left = (int) ((0.0 + s.width() - min.width())*(QRandomGenerator::global()->bounded(1.0)));
- int top = (int) ((0.0 + s.height() - min.height())*(QRandomGenerator::global()->bounded(1.0)));
- int width = (int) ((0.0 + s.width() - left - min.width())*(QRandomGenerator::global()->bounded(1.0))) + min.width();
- int height = (int) ((0.0 + s.height() - top - min.height())*(QRandomGenerator::global()->bounded(1.0))) + min.height();
+ int left = qRound((s.width() - min.width()) * (QRandomGenerator::global()->bounded(1.0)));
+ int top = qRound((s.height() - min.height()) * (QRandomGenerator::global()->bounded(1.0)));
+ int width = qRound((s.width() - left - min.width()) * (QRandomGenerator::global()->bounded(1.0))) + min.width();
+ int height = qRound((s.height() - top - min.height()) * (QRandomGenerator::global()->bounded(1.0))) + min.height();
return QRect(left, top, width, height);
}
@@ -349,7 +350,7 @@ static QRect randomRect(const QSize &s)
void MainWindow::addShape()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
Shape::Type type;
@@ -369,7 +370,7 @@ void MainWindow::addShape()
void MainWindow::removeShape()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
QString shapeName = doc->currentShapeName();
@@ -382,7 +383,7 @@ void MainWindow::removeShape()
void MainWindow::setShapeColor()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
QString shapeName = doc->currentShapeName();
@@ -409,7 +410,7 @@ void MainWindow::setShapeColor()
void MainWindow::addSnowman()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
// Create a macro command using beginMacro() and endMacro()
@@ -427,7 +428,7 @@ void MainWindow::addSnowman()
void MainWindow::addRobot()
{
Document *doc = currentDocument();
- if (doc == 0)
+ if (doc == nullptr)
return;
// Compose a macro command by explicitly adding children to a parent command
diff --git a/examples/widgets/tools/undo/mainwindow.h b/examples/widgets/tools/undo/mainwindow.h
index 57c1f87ab2..87ee3084fb 100644
--- a/examples/widgets/tools/undo/mainwindow.h
+++ b/examples/widgets/tools/undo/mainwindow.h
@@ -61,7 +61,7 @@ class MainWindow : public QMainWindow, public Ui::MainWindow
Q_OBJECT
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
void addDocument(Document *doc);
void removeDocument(Document *doc);
diff --git a/examples/widgets/tools/undoframework/commands.cpp b/examples/widgets/tools/undoframework/commands.cpp
index c3e7383de1..077d7eccaa 100644
--- a/examples/widgets/tools/undoframework/commands.cpp
+++ b/examples/widgets/tools/undoframework/commands.cpp
@@ -48,19 +48,17 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "commands.h"
#include "diagramitem.h"
+#include <QGraphicsScene>
+
//! [0]
MoveCommand::MoveCommand(DiagramItem *diagramItem, const QPointF &oldPos,
- QUndoCommand *parent)
- : QUndoCommand(parent)
+ QUndoCommand *parent)
+ : QUndoCommand(parent), myDiagramItem(diagramItem)
+ , myOldPos(oldPos), newPos(diagramItem->pos())
{
- myDiagramItem = diagramItem;
- newPos = diagramItem->pos();
- myOldPos = oldPos;
}
//! [0]
@@ -71,7 +69,7 @@ bool MoveCommand::mergeWith(const QUndoCommand *command)
DiagramItem *item = moveCommand->myDiagramItem;
if (myDiagramItem != item)
- return false;
+ return false;
newPos = item->pos();
setText(QObject::tr("Move %1")
@@ -102,9 +100,8 @@ void MoveCommand::redo()
//! [4]
DeleteCommand::DeleteCommand(QGraphicsScene *scene, QUndoCommand *parent)
- : QUndoCommand(parent)
+ : QUndoCommand(parent), myGraphicsScene(scene)
{
- myGraphicsScene = scene;
QList<QGraphicsItem *> list = myGraphicsScene->selectedItems();
list.first()->setSelected(false);
myDiagramItem = static_cast<DiagramItem *>(list.first());
@@ -131,11 +128,10 @@ void DeleteCommand::redo()
//! [7]
AddCommand::AddCommand(DiagramItem::DiagramType addType,
QGraphicsScene *scene, QUndoCommand *parent)
- : QUndoCommand(parent)
+ : QUndoCommand(parent), myGraphicsScene(scene)
{
static int itemCount = 0;
- myGraphicsScene = scene;
myDiagramItem = new DiagramItem(addType);
initialPosition = QPointF((itemCount * 15) % int(scene->width()),
(itemCount * 15) % int(scene->height()));
diff --git a/examples/widgets/tools/undoframework/commands.h b/examples/widgets/tools/undoframework/commands.h
index dc53c14557..185d36d668 100644
--- a/examples/widgets/tools/undoframework/commands.h
+++ b/examples/widgets/tools/undoframework/commands.h
@@ -62,7 +62,7 @@ public:
enum { Id = 1234 };
MoveCommand(DiagramItem *diagramItem, const QPointF &oldPos,
- QUndoCommand *parent = 0);
+ QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -80,7 +80,7 @@ private:
class DeleteCommand : public QUndoCommand
{
public:
- explicit DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0);
+ explicit DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = nullptr);
void undo() override;
void redo() override;
@@ -96,7 +96,7 @@ class AddCommand : public QUndoCommand
{
public:
AddCommand(DiagramItem::DiagramType addType, QGraphicsScene *graphicsScene,
- QUndoCommand *parent = 0);
+ QUndoCommand *parent = nullptr);
~AddCommand();
void undo() override;
diff --git a/examples/widgets/tools/undoframework/diagramitem.cpp b/examples/widgets/tools/undoframework/diagramitem.cpp
index 723645c9b2..91da6538cf 100644
--- a/examples/widgets/tools/undoframework/diagramitem.cpp
+++ b/examples/widgets/tools/undoframework/diagramitem.cpp
@@ -48,10 +48,11 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "diagramitem.h"
+#include <QBrush>
+#include <QRandomGenerator>
+
DiagramItem::DiagramItem(DiagramType diagramType, QGraphicsItem *item)
: QGraphicsPolygonItem(item)
{
@@ -65,7 +66,9 @@ DiagramItem::DiagramItem(DiagramType diagramType, QGraphicsItem *item)
setPolygon(trianglePolygon);
}
- QColor color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256));
+ QColor color(QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256));
QBrush brush(color);
setBrush(brush);
setFlag(QGraphicsItem::ItemIsSelectable);
diff --git a/examples/widgets/tools/undoframework/diagramitem.h b/examples/widgets/tools/undoframework/diagramitem.h
index 1638dcbea8..13ff614427 100644
--- a/examples/widgets/tools/undoframework/diagramitem.h
+++ b/examples/widgets/tools/undoframework/diagramitem.h
@@ -66,9 +66,10 @@ public:
enum { Type = UserType + 1 };
enum DiagramType { Box, Triangle };
- explicit DiagramItem(DiagramType diagramType, QGraphicsItem *item = 0);
+ explicit DiagramItem(DiagramType diagramType, QGraphicsItem *item = nullptr);
- DiagramType diagramType() const {
+ DiagramType diagramType() const
+ {
return polygon() == boxPolygon ? Box : Triangle;
}
int type() const override { return Type; }
diff --git a/examples/widgets/tools/undoframework/diagramscene.cpp b/examples/widgets/tools/undoframework/diagramscene.cpp
index 63aad97cb1..65909ab6cb 100644
--- a/examples/widgets/tools/undoframework/diagramscene.cpp
+++ b/examples/widgets/tools/undoframework/diagramscene.cpp
@@ -48,27 +48,24 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "diagramscene.h"
#include "diagramitem.h"
+#include <QGraphicsSceneMouseEvent>
+
DiagramScene::DiagramScene(QObject *parent)
: QGraphicsScene(parent)
-{
- movingItem = 0;
-}
+{}
void DiagramScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
QPointF mousePos(event->buttonDownScenePos(Qt::LeftButton).x(),
event->buttonDownScenePos(Qt::LeftButton).y());
const QList<QGraphicsItem *> itemList = items(mousePos);
- movingItem = itemList.isEmpty() ? 0 : itemList.first();
+ movingItem = itemList.isEmpty() ? nullptr : itemList.first();
- if (movingItem != 0 && event->button() == Qt::LeftButton) {
+ if (movingItem != nullptr && event->button() == Qt::LeftButton)
oldPos = movingItem->pos();
- }
clearSelection();
QGraphicsScene::mousePressEvent(event);
@@ -76,11 +73,11 @@ void DiagramScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
void DiagramScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
- if (movingItem != 0 && event->button() == Qt::LeftButton) {
+ if (movingItem != nullptr && event->button() == Qt::LeftButton) {
if (oldPos != movingItem->pos())
emit itemMoved(qgraphicsitem_cast<DiagramItem *>(movingItem),
oldPos);
- movingItem = 0;
+ movingItem = nullptr;
}
QGraphicsScene::mouseReleaseEvent(event);
}
diff --git a/examples/widgets/tools/undoframework/diagramscene.h b/examples/widgets/tools/undoframework/diagramscene.h
index b1e2804ba6..205d4162bb 100644
--- a/examples/widgets/tools/undoframework/diagramscene.h
+++ b/examples/widgets/tools/undoframework/diagramscene.h
@@ -66,7 +66,7 @@ class DiagramScene : public QGraphicsScene
Q_OBJECT
public:
- DiagramScene(QObject *parent = 0);
+ DiagramScene(QObject *parent = nullptr);
signals:
void itemMoved(DiagramItem *movedItem, const QPointF &movedFromPosition);
@@ -76,7 +76,7 @@ protected:
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
private:
- QGraphicsItem *movingItem;
+ QGraphicsItem *movingItem = nullptr;
QPointF oldPos;
};
//! [0]
diff --git a/examples/widgets/tools/undoframework/main.cpp b/examples/widgets/tools/undoframework/main.cpp
index 51fb5c53eb..cf090f56eb 100644
--- a/examples/widgets/tools/undoframework/main.cpp
+++ b/examples/widgets/tools/undoframework/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
#include "mainwindow.h"
diff --git a/examples/widgets/tools/undoframework/mainwindow.cpp b/examples/widgets/tools/undoframework/mainwindow.cpp
index e95d50d164..583af11a2b 100644
--- a/examples/widgets/tools/undoframework/mainwindow.cpp
+++ b/examples/widgets/tools/undoframework/mainwindow.cpp
@@ -48,13 +48,18 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
#include "diagramscene.h"
#include "diagramitem.h"
#include "commands.h"
+#include <QAction>
+#include <QGraphicsView>
+#include <QMenu>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QUndoView>
+
//! [0]
MainWindow::MainWindow()
{
diff --git a/examples/widgets/tools/undoframework/mainwindow.h b/examples/widgets/tools/undoframework/mainwindow.h
index def2b7d789..c1a56e0770 100644
--- a/examples/widgets/tools/undoframework/mainwindow.h
+++ b/examples/widgets/tools/undoframework/mainwindow.h
@@ -87,22 +87,22 @@ private:
void createMenus();
void createUndoView();
- QAction *deleteAction;
- QAction *addBoxAction;
- QAction *addTriangleAction;
- QAction *undoAction;
- QAction *redoAction;
- QAction *exitAction;
- QAction *aboutAction;
+ QAction *deleteAction = nullptr;
+ QAction *addBoxAction = nullptr;
+ QAction *addTriangleAction = nullptr;
+ QAction *undoAction = nullptr;
+ QAction *redoAction = nullptr;
+ QAction *exitAction = nullptr;
+ QAction *aboutAction = nullptr;
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *itemMenu;
- QMenu *helpMenu;
+ QMenu *fileMenu = nullptr;
+ QMenu *editMenu = nullptr;
+ QMenu *itemMenu = nullptr;
+ QMenu *helpMenu = nullptr;
- DiagramScene *diagramScene;
- QUndoStack *undoStack;
- QUndoView *undoView;
+ DiagramScene *diagramScene = nullptr;
+ QUndoStack *undoStack = nullptr;
+ QUndoView *undoView = nullptr;
};
//! [0]
diff --git a/examples/widgets/touch/fingerpaint/scribblearea.h b/examples/widgets/touch/fingerpaint/scribblearea.h
index 5138e3a1ab..fcdde53cc4 100644
--- a/examples/widgets/touch/fingerpaint/scribblearea.h
+++ b/examples/widgets/touch/fingerpaint/scribblearea.h
@@ -62,7 +62,7 @@ class ScribbleArea : public QWidget
Q_OBJECT
public:
- ScribbleArea(QWidget *parent = 0);
+ ScribbleArea(QWidget *parent = nullptr);
bool openImage(const QString &fileName);
bool saveImage(const QString &fileName, const char *fileFormat);
diff --git a/examples/widgets/touch/pinchzoom/graphicsview.cpp b/examples/widgets/touch/pinchzoom/graphicsview.cpp
index 54e134aea2..6412f350a7 100644
--- a/examples/widgets/touch/pinchzoom/graphicsview.cpp
+++ b/examples/widgets/touch/pinchzoom/graphicsview.cpp
@@ -54,7 +54,7 @@
#include <QTouchEvent>
GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent)
- : QGraphicsView(scene, parent), totalScaleFactor(1)
+ : QGraphicsView(scene, parent)
{
viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
setDragMode(ScrollHandDrag);
@@ -83,8 +83,8 @@ bool GraphicsView::viewportEvent(QEvent *event)
totalScaleFactor *= currentScaleFactor;
currentScaleFactor = 1;
}
- setTransform(QTransform().scale(totalScaleFactor * currentScaleFactor,
- totalScaleFactor * currentScaleFactor));
+ setTransform(QTransform::fromScale(totalScaleFactor * currentScaleFactor,
+ totalScaleFactor * currentScaleFactor));
}
return true;
}
diff --git a/examples/widgets/touch/pinchzoom/graphicsview.h b/examples/widgets/touch/pinchzoom/graphicsview.h
index d4e2e32d36..c0faeba444 100644
--- a/examples/widgets/touch/pinchzoom/graphicsview.h
+++ b/examples/widgets/touch/pinchzoom/graphicsview.h
@@ -56,10 +56,10 @@ class GraphicsView : public QGraphicsView
Q_OBJECT
public:
- GraphicsView(QGraphicsScene *scene = 0, QWidget *parent = 0);
+ GraphicsView(QGraphicsScene *scene = nullptr, QWidget *parent = nullptr);
bool viewportEvent(QEvent *event) override;
private:
- qreal totalScaleFactor;
+ qreal totalScaleFactor = 1;
};
diff --git a/examples/widgets/touch/pinchzoom/main.cpp b/examples/widgets/touch/pinchzoom/main.cpp
index 938432600f..2c2ba39a26 100644
--- a/examples/widgets/touch/pinchzoom/main.cpp
+++ b/examples/widgets/touch/pinchzoom/main.cpp
@@ -51,11 +51,10 @@
#include "graphicsview.h"
#include "mouse.h"
-#include <QtWidgets>
+#include <QApplication>
+#include <cmath>
-#include <math.h>
-
-static const int MouseCount = 7;
+static constexpr int MouseCount = 7;
//! [0]
int main(int argc, char **argv)
diff --git a/examples/widgets/touch/pinchzoom/mouse.cpp b/examples/widgets/touch/pinchzoom/mouse.cpp
index 1dfd7d749c..8456a0214d 100644
--- a/examples/widgets/touch/pinchzoom/mouse.cpp
+++ b/examples/widgets/touch/pinchzoom/mouse.cpp
@@ -56,8 +56,8 @@
#include <QStyleOption>
#include <qmath.h>
-const qreal Pi = M_PI;
-const qreal TwoPi = 2 * M_PI;
+constexpr qreal Pi = M_PI;
+constexpr qreal TwoPi = 2 * M_PI;
static qreal normalizeAngle(qreal angle)
{
@@ -69,9 +69,9 @@ static qreal normalizeAngle(qreal angle)
}
//! [0]
-Mouse::Mouse()
- : angle(0), speed(0), mouseEyeDirection(0),
- color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256))
+Mouse::Mouse() : color(QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256),
+ QRandomGenerator::global()->bounded(256))
{
setTransform(QTransform().rotate(QRandomGenerator::global()->bounded(360 * 16)), true);
startTimer(1000 / 33);
diff --git a/examples/widgets/touch/pinchzoom/mouse.h b/examples/widgets/touch/pinchzoom/mouse.h
index 870bfcd6c0..8ac110821e 100644
--- a/examples/widgets/touch/pinchzoom/mouse.h
+++ b/examples/widgets/touch/pinchzoom/mouse.h
@@ -70,9 +70,9 @@ protected:
void timerEvent(QTimerEvent *event) override;
private:
- qreal angle;
- qreal speed;
- qreal mouseEyeDirection;
+ qreal angle = 0;
+ qreal speed = 0;
+ qreal mouseEyeDirection = 0;
QColor color;
};
//! [0]
diff --git a/examples/widgets/tutorials/addressbook/part1/addressbook.h b/examples/widgets/tutorials/addressbook/part1/addressbook.h
index 1d575e1260..4c2b456a41 100644
--- a/examples/widgets/tutorials/addressbook/part1/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part1/addressbook.h
@@ -65,7 +65,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
private:
QLineEdit *nameLine;
diff --git a/examples/widgets/tutorials/addressbook/part2/addressbook.h b/examples/widgets/tutorials/addressbook/part2/addressbook.h
index 7b1714b443..e690d14244 100644
--- a/examples/widgets/tutorials/addressbook/part2/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part2/addressbook.h
@@ -66,7 +66,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
//! [slots]
public slots:
diff --git a/examples/widgets/tutorials/addressbook/part3/addressbook.h b/examples/widgets/tutorials/addressbook/part3/addressbook.h
index 746a58a32a..f4a8aaa976 100644
--- a/examples/widgets/tutorials/addressbook/part3/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part3/addressbook.h
@@ -66,7 +66,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
public slots:
void addContact();
diff --git a/examples/widgets/tutorials/addressbook/part4/addressbook.h b/examples/widgets/tutorials/addressbook/part4/addressbook.h
index a8d4d9fe1d..307df1eb15 100644
--- a/examples/widgets/tutorials/addressbook/part4/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part4/addressbook.h
@@ -66,7 +66,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
//! [Mode enum]
enum Mode { NavigationMode, AddingMode, EditingMode };
//! [Mode enum]
diff --git a/examples/widgets/tutorials/addressbook/part5/addressbook.h b/examples/widgets/tutorials/addressbook/part5/addressbook.h
index b60929a50c..9dd7ed1d89 100644
--- a/examples/widgets/tutorials/addressbook/part5/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part5/addressbook.h
@@ -69,7 +69,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
enum Mode { NavigationMode, AddingMode, EditingMode };
public slots:
diff --git a/examples/widgets/tutorials/addressbook/part5/finddialog.h b/examples/widgets/tutorials/addressbook/part5/finddialog.h
index 0fca6be81b..8e63eeee79 100644
--- a/examples/widgets/tutorials/addressbook/part5/finddialog.h
+++ b/examples/widgets/tutorials/addressbook/part5/finddialog.h
@@ -63,7 +63,7 @@ class FindDialog : public QDialog
Q_OBJECT
public:
- FindDialog(QWidget *parent = 0);
+ FindDialog(QWidget *parent = nullptr);
QString getFindText();
public slots:
diff --git a/examples/widgets/tutorials/addressbook/part6/addressbook.h b/examples/widgets/tutorials/addressbook/part6/addressbook.h
index 8d328310f7..fca62c52b7 100644
--- a/examples/widgets/tutorials/addressbook/part6/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part6/addressbook.h
@@ -68,7 +68,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
enum Mode { NavigationMode, AddingMode, EditingMode };
public slots:
diff --git a/examples/widgets/tutorials/addressbook/part6/finddialog.h b/examples/widgets/tutorials/addressbook/part6/finddialog.h
index 527e0254e9..46f8047a56 100644
--- a/examples/widgets/tutorials/addressbook/part6/finddialog.h
+++ b/examples/widgets/tutorials/addressbook/part6/finddialog.h
@@ -63,7 +63,7 @@ class FindDialog : public QDialog
Q_OBJECT
public:
- FindDialog(QWidget *parent = 0);
+ FindDialog(QWidget *parent = nullptr);
QString getFindText();
public slots:
diff --git a/examples/widgets/tutorials/addressbook/part7/addressbook.h b/examples/widgets/tutorials/addressbook/part7/addressbook.h
index 0f109b2ef1..47a0f3c062 100644
--- a/examples/widgets/tutorials/addressbook/part7/addressbook.h
+++ b/examples/widgets/tutorials/addressbook/part7/addressbook.h
@@ -68,7 +68,7 @@ class AddressBook : public QWidget
Q_OBJECT
public:
- AddressBook(QWidget *parent = 0);
+ AddressBook(QWidget *parent = nullptr);
enum Mode { NavigationMode, AddingMode, EditingMode };
public slots:
diff --git a/examples/widgets/tutorials/addressbook/part7/finddialog.h b/examples/widgets/tutorials/addressbook/part7/finddialog.h
index 527e0254e9..46f8047a56 100644
--- a/examples/widgets/tutorials/addressbook/part7/finddialog.h
+++ b/examples/widgets/tutorials/addressbook/part7/finddialog.h
@@ -63,7 +63,7 @@ class FindDialog : public QDialog
Q_OBJECT
public:
- FindDialog(QWidget *parent = 0);
+ FindDialog(QWidget *parent = nullptr);
QString getFindText();
public slots:
diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/main.cpp b/examples/widgets/tutorials/modelview/3_changingmodel/main.cpp
index 2330019f93..90a8c6e894 100644
--- a/examples/widgets/tutorials/modelview/3_changingmodel/main.cpp
+++ b/examples/widgets/tutorials/modelview/3_changingmodel/main.cpp
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTableView tableView;
- MyModel myModel(0);
+ MyModel myModel;
tableView.setModel(&myModel);
tableView.show();
return a.exec();
diff --git a/examples/widgets/tutorials/modelview/7_selections/mainwindow.h b/examples/widgets/tutorials/modelview/7_selections/mainwindow.h
index c9761dd3d9..74906c831d 100644
--- a/examples/widgets/tutorials/modelview/7_selections/mainwindow.h
+++ b/examples/widgets/tutorials/modelview/7_selections/mainwindow.h
@@ -69,7 +69,7 @@ private:
private slots:
void selectionChangedSlot(const QItemSelection &newSelection, const QItemSelection &oldSelection);
public:
- MainWindow(QWidget *parent = 0);
+ MainWindow(QWidget *parent = nullptr);
};
#endif // MAINWINDOW_H
diff --git a/examples/widgets/tutorials/notepad/notepad.h b/examples/widgets/tutorials/notepad/notepad.h
index 9580ab8071..5e44dfeedc 100644
--- a/examples/widgets/tutorials/notepad/notepad.h
+++ b/examples/widgets/tutorials/notepad/notepad.h
@@ -72,7 +72,7 @@ class Notepad : public QMainWindow
//! [4]
public:
- explicit Notepad(QWidget *parent = 0);
+ explicit Notepad(QWidget *parent = nullptr);
//! [4]
//! [5]
~Notepad();
diff --git a/examples/widgets/widgets/analogclock/analogclock.cpp b/examples/widgets/widgets/analogclock/analogclock.cpp
index c7b3f66cca..06e298659d 100644
--- a/examples/widgets/widgets/analogclock/analogclock.cpp
+++ b/examples/widgets/widgets/analogclock/analogclock.cpp
@@ -50,7 +50,9 @@
#include "analogclock.h"
-#include <QtWidgets>
+#include <QPainter>
+#include <QTime>
+#include <QTimer>
//! [0] //! [1]
AnalogClock::AnalogClock(QWidget *parent)
diff --git a/examples/widgets/widgets/calculator/button.cpp b/examples/widgets/widgets/calculator/button.cpp
index a1ce0bf428..cc370a563c 100644
--- a/examples/widgets/widgets/calculator/button.cpp
+++ b/examples/widgets/widgets/calculator/button.cpp
@@ -50,8 +50,6 @@
#include "button.h"
-#include <QtWidgets>
-
//! [0]
Button::Button(const QString &text, QWidget *parent)
: QToolButton(parent)
diff --git a/examples/widgets/widgets/calculator/calculator.cpp b/examples/widgets/widgets/calculator/calculator.cpp
index dd908cf40a..2c3669b7a8 100644
--- a/examples/widgets/widgets/calculator/calculator.cpp
+++ b/examples/widgets/widgets/calculator/calculator.cpp
@@ -48,21 +48,18 @@
**
****************************************************************************/
-#include "button.h"
#include "calculator.h"
+#include "button.h"
-#include <QtWidgets>
-
-#include <cmath>
+#include <QGridLayout>
+#include <QLineEdit>
+#include <QtMath>
//! [0]
Calculator::Calculator(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), sumInMemory(0.0), sumSoFar(0.0)
+ , factorSoFar(0.0), waitingForOperand(true)
{
- sumInMemory = 0.0;
- sumSoFar = 0.0;
- factorSoFar = 0.0;
- waitingForOperand = true;
//! [0]
//! [1]
@@ -78,9 +75,8 @@ Calculator::Calculator(QWidget *parent)
//! [2]
//! [4]
- for (int i = 0; i < NumDigitButtons; ++i) {
+ for (int i = 0; i < NumDigitButtons; ++i)
digitButtons[i] = createButton(QString::number(i), SLOT(digitClicked()));
- }
Button *pointButton = createButton(tr("."), SLOT(pointClicked()));
Button *changeSignButton = createButton(tr("\302\261"), SLOT(changeSignClicked()));
@@ -194,6 +190,8 @@ void Calculator::additiveOperatorClicked()
//! [10] //! [11]
{
Button *clickedButton = qobject_cast<Button *>(sender());
+ if (!clickedButton)
+ return;
QString clickedOperator = clickedButton->text();
double operand = display->text().toDouble();
@@ -233,6 +231,8 @@ void Calculator::additiveOperatorClicked()
void Calculator::multiplicativeOperatorClicked()
{
Button *clickedButton = qobject_cast<Button *>(sender());
+ if (!clickedButton)
+ return;
QString clickedOperator = clickedButton->text();
double operand = display->text().toDouble();
diff --git a/examples/widgets/widgets/calendarwidget/main.cpp b/examples/widgets/widgets/calendarwidget/main.cpp
index 2622669f32..2582e83841 100644
--- a/examples/widgets/widgets/calendarwidget/main.cpp
+++ b/examples/widgets/widgets/calendarwidget/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
#include "window.h"
diff --git a/examples/widgets/widgets/calendarwidget/window.cpp b/examples/widgets/widgets/calendarwidget/window.cpp
index 64047aaac9..b8a3d03552 100644
--- a/examples/widgets/widgets/calendarwidget/window.cpp
+++ b/examples/widgets/widgets/calendarwidget/window.cpp
@@ -48,10 +48,18 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "window.h"
+#include <QCalendarWidget>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QDateEdit>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLocale>
+#include <QTextCharFormat>
+
//! [0]
Window::Window(QWidget *parent)
: QWidget(parent)
@@ -166,13 +174,12 @@ void Window::reformatHeaders()
QString text = headerTextFormatCombo->currentText();
QTextCharFormat format;
- if (text == tr("Bold")) {
+ if (text == tr("Bold"))
format.setFontWeight(QFont::Bold);
- } else if (text == tr("Italic")) {
+ else if (text == tr("Italic"))
format.setFontItalic(true);
- } else if (text == tr("Green")) {
+ else if (text == tr("Green"))
format.setForeground(Qt::green);
- }
calendar->setHeaderTextFormat(format);
}
//! [7]
diff --git a/examples/widgets/widgets/charactermap/characterwidget.cpp b/examples/widgets/widgets/charactermap/characterwidget.cpp
index 061c0164b0..41406b7fb4 100644
--- a/examples/widgets/widgets/charactermap/characterwidget.cpp
+++ b/examples/widgets/widgets/charactermap/characterwidget.cpp
@@ -50,11 +50,14 @@
#include "characterwidget.h"
-#include <QtWidgets>
+#include <QFontDatabase>
+#include <QMouseEvent>
+#include <QPainter>
+#include <QToolTip>
//! [0]
CharacterWidget::CharacterWidget(QWidget *parent)
- : QWidget(parent), columns(16), lastKey(-1)
+ : QWidget(parent)
{
calculateSquareSize();
setMouseTracking(true);
@@ -110,7 +113,7 @@ void CharacterWidget::calculateSquareSize()
//! [3]
QSize CharacterWidget::sizeHint() const
{
- return QSize(columns*squareSize, (65536/columns)*squareSize);
+ return QSize(columns*squareSize, (65536 / columns) * squareSize);
}
//! [3]
@@ -118,7 +121,7 @@ QSize CharacterWidget::sizeHint() const
void CharacterWidget::mouseMoveEvent(QMouseEvent *event)
{
QPoint widgetPosition = mapFromGlobal(event->globalPos());
- uint key = (widgetPosition.y()/squareSize)*columns + widgetPosition.x()/squareSize;
+ uint key = (widgetPosition.y() / squareSize) * columns + widgetPosition.x() / squareSize;
QString text = QString::fromLatin1("<p>Character: <span style=\"font-size: 24pt; font-family: %1\">").arg(displayFont.family())
+ QChar(key)
@@ -132,7 +135,7 @@ void CharacterWidget::mouseMoveEvent(QMouseEvent *event)
void CharacterWidget::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
- lastKey = (event->y()/squareSize)*columns + event->x()/squareSize;
+ lastKey = (event->y() / squareSize) * columns + event->x() / squareSize;
if (QChar(lastKey).category() != QChar::Other_NotAssigned)
emit characterSelected(QString(QChar(lastKey)));
update();
@@ -152,17 +155,17 @@ void CharacterWidget::paintEvent(QPaintEvent *event)
//! [7]
QRect redrawRect = event->rect();
- int beginRow = redrawRect.top()/squareSize;
- int endRow = redrawRect.bottom()/squareSize;
- int beginColumn = redrawRect.left()/squareSize;
- int endColumn = redrawRect.right()/squareSize;
+ int beginRow = redrawRect.top() / squareSize;
+ int endRow = redrawRect.bottom() / squareSize;
+ int beginColumn = redrawRect.left() / squareSize;
+ int endColumn = redrawRect.right() / squareSize;
//! [7]
//! [8]
painter.setPen(QPen(Qt::gray));
for (int row = beginRow; row <= endRow; ++row) {
for (int column = beginColumn; column <= endColumn; ++column) {
- painter.drawRect(column*squareSize, row*squareSize, squareSize, squareSize);
+ painter.drawRect(column * squareSize, row * squareSize, squareSize, squareSize);
}
//! [8] //! [9]
}
@@ -172,17 +175,17 @@ void CharacterWidget::paintEvent(QPaintEvent *event)
QFontMetrics fontMetrics(displayFont);
painter.setPen(QPen(Qt::black));
for (int row = beginRow; row <= endRow; ++row) {
-
for (int column = beginColumn; column <= endColumn; ++column) {
-
- int key = row*columns + column;
- painter.setClipRect(column*squareSize, row*squareSize, squareSize, squareSize);
+ int key = row * columns + column;
+ painter.setClipRect(column * squareSize, row * squareSize, squareSize, squareSize);
if (key == lastKey)
- painter.fillRect(column*squareSize + 1, row*squareSize + 1, squareSize, squareSize, QBrush(Qt::red));
+ painter.fillRect(column * squareSize + 1, row * squareSize + 1,
+ squareSize, squareSize, QBrush(Qt::red));
- painter.drawText(column*squareSize + (squareSize / 2) - fontMetrics.horizontalAdvance(QChar(key))/2,
- row*squareSize + 4 + fontMetrics.ascent(),
+ painter.drawText(column * squareSize + (squareSize / 2) -
+ fontMetrics.horizontalAdvance(QChar(key)) / 2,
+ row * squareSize + 4 + fontMetrics.ascent(),
QString(QChar(key)));
}
}
diff --git a/examples/widgets/widgets/charactermap/characterwidget.h b/examples/widgets/widgets/charactermap/characterwidget.h
index d12a46aa15..67ac8a30bf 100644
--- a/examples/widgets/widgets/charactermap/characterwidget.h
+++ b/examples/widgets/widgets/charactermap/characterwidget.h
@@ -88,9 +88,9 @@ private:
void calculateSquareSize();
QFont displayFont;
- int columns;
- int lastKey;
- int squareSize;
+ int columns = 16;
+ int lastKey = -1;
+ int squareSize = 0;
};
//! [0]
diff --git a/examples/widgets/widgets/charactermap/mainwindow.cpp b/examples/widgets/widgets/charactermap/mainwindow.cpp
index e84ded5afb..b0f9705c21 100644
--- a/examples/widgets/widgets/charactermap/mainwindow.cpp
+++ b/examples/widgets/widgets/charactermap/mainwindow.cpp
@@ -48,13 +48,28 @@
**
****************************************************************************/
-#include <QtWidgets>
-
-#include "characterwidget.h"
#include "mainwindow.h"
+#include "characterwidget.h"
-//! [0]
+#include <QApplication>
+#include <QBoxLayout>
+#include <QCheckBox>
+#include <QClipboard>
+#include <QDesktopWidget>
+#include <QDialog>
+#include <QDialogButtonBox>
+#include <QFontComboBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QMenuBar>
+#include <QPlainTextEdit>
+#include <QPushButton>
+#include <QScreen>
+#include <QScrollArea>
+#include <QStatusBar>
+#include <QTextStream>
+//! [0]
Q_DECLARE_METATYPE(QFontComboBox::FontFilter)
MainWindow::MainWindow(QWidget *parent)
@@ -114,9 +129,9 @@ MainWindow::MainWindow(QWidget *parent)
this, &MainWindow::findSizes);
connect(fontCombo, &QFontComboBox::currentFontChanged,
characterWidget, &CharacterWidget::updateFont);
- connect(sizeCombo, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
+ connect(sizeCombo, &QComboBox::currentTextChanged,
characterWidget, &CharacterWidget::updateSize);
- connect(styleCombo, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
+ connect(styleCombo, &QComboBox::currentTextChanged,
characterWidget, &CharacterWidget::updateStyle);
//! [4] //! [5]
connect(characterWidget, &CharacterWidget::characterSelected,
@@ -288,7 +303,7 @@ QString FontInfoDialog::text() const
void MainWindow::showInfo()
{
- const QRect screenGeometry = QApplication::desktop()->screenGeometry(this);
+ const QRect screenGeometry = screen()->geometry();
FontInfoDialog *dialog = new FontInfoDialog(this);
dialog->setWindowTitle(tr("Fonts"));
dialog->setAttribute(Qt::WA_DeleteOnClose);
diff --git a/examples/widgets/widgets/codeeditor/codeeditor.cpp b/examples/widgets/widgets/codeeditor/codeeditor.cpp
index 8e29860669..e93a0251e5 100644
--- a/examples/widgets/widgets/codeeditor/codeeditor.cpp
+++ b/examples/widgets/widgets/codeeditor/codeeditor.cpp
@@ -48,10 +48,11 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "codeeditor.h"
+#include <QPainter>
+#include <QTextBlock>
+
//![constructor]
CodeEditor::CodeEditor(QWidget *parent) : QPlainTextEdit(parent)
@@ -157,8 +158,8 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
//![extraAreaPaintEvent_1]
QTextBlock block = firstVisibleBlock();
int blockNumber = block.blockNumber();
- int top = (int) blockBoundingGeometry(block).translated(contentOffset()).top();
- int bottom = top + (int) blockBoundingRect(block).height();
+ int top = qRound(blockBoundingGeometry(block).translated(contentOffset()).top());
+ int bottom = top + qRound(blockBoundingRect(block).height());
//![extraAreaPaintEvent_1]
//![extraAreaPaintEvent_2]
@@ -172,7 +173,7 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
block = block.next();
top = bottom;
- bottom = top + (int) blockBoundingRect(block).height();
+ bottom = top + qRound(blockBoundingRect(block).height());
++blockNumber;
}
}
diff --git a/examples/widgets/widgets/codeeditor/codeeditor.h b/examples/widgets/widgets/codeeditor/codeeditor.h
index 5a48abafc4..283a4e0bdf 100644
--- a/examples/widgets/widgets/codeeditor/codeeditor.h
+++ b/examples/widgets/widgets/codeeditor/codeeditor.h
@@ -80,7 +80,7 @@ protected:
private slots:
void updateLineNumberAreaWidth(int newBlockCount);
void highlightCurrentLine();
- void updateLineNumberArea(const QRect &, int);
+ void updateLineNumberArea(const QRect &rect, int dy);
private:
QWidget *lineNumberArea;
@@ -92,16 +92,17 @@ private:
class LineNumberArea : public QWidget
{
public:
- LineNumberArea(CodeEditor *editor) : QWidget(editor) {
- codeEditor = editor;
- }
+ LineNumberArea(CodeEditor *editor) : QWidget(editor), codeEditor(editor)
+ {}
- QSize sizeHint() const override {
+ QSize sizeHint() const override
+ {
return QSize(codeEditor->lineNumberAreaWidth(), 0);
}
protected:
- void paintEvent(QPaintEvent *event) override {
+ void paintEvent(QPaintEvent *event) override
+ {
codeEditor->lineNumberAreaPaintEvent(event);
}
diff --git a/examples/widgets/widgets/codeeditor/main.cpp b/examples/widgets/widgets/codeeditor/main.cpp
index e17acb87cd..72d186553a 100644
--- a/examples/widgets/widgets/codeeditor/main.cpp
+++ b/examples/widgets/widgets/codeeditor/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
#include "codeeditor.h"
diff --git a/examples/widgets/widgets/digitalclock/digitalclock.cpp b/examples/widgets/widgets/digitalclock/digitalclock.cpp
index 000334f33b..2b130ecda6 100644
--- a/examples/widgets/widgets/digitalclock/digitalclock.cpp
+++ b/examples/widgets/widgets/digitalclock/digitalclock.cpp
@@ -50,7 +50,8 @@
#include "digitalclock.h"
-#include <QtWidgets>
+#include <QTime>
+#include <QTimer>
//! [0]
DigitalClock::DigitalClock(QWidget *parent)
diff --git a/examples/widgets/widgets/groupbox/window.cpp b/examples/widgets/widgets/groupbox/window.cpp
index 230d360372..95c4f216fe 100644
--- a/examples/widgets/widgets/groupbox/window.cpp
+++ b/examples/widgets/widgets/groupbox/window.cpp
@@ -48,10 +48,15 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "window.h"
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QMenu>
+#include <QPushButton>
+#include <QRadioButton>
+
//! [0]
Window::Window(QWidget *parent)
: QWidget(parent)
diff --git a/examples/widgets/widgets/icons/iconpreviewarea.cpp b/examples/widgets/widgets/icons/iconpreviewarea.cpp
index 1a2f514ba8..96cb6f008e 100644
--- a/examples/widgets/widgets/icons/iconpreviewarea.cpp
+++ b/examples/widgets/widgets/icons/iconpreviewarea.cpp
@@ -50,7 +50,8 @@
#include "iconpreviewarea.h"
-#include <QtWidgets>
+#include <QGridLayout>
+#include <QLabel>
//! [0]
IconPreviewArea::IconPreviewArea(QWidget *parent)
@@ -79,8 +80,6 @@ IconPreviewArea::IconPreviewArea(QWidget *parent)
}
//! [0]
-#ifdef Q_COMPILER_INITIALIZER_LISTS
-
//! [42]
QVector<QIcon::Mode> IconPreviewArea::iconModes()
{
@@ -107,44 +106,6 @@ QStringList IconPreviewArea::iconStateNames()
}
//! [42]
-#else // Q_COMPILER_INITIALIZER_LISTS
-
-//! [43]
-QVector<QIcon::Mode> IconPreviewArea::iconModes()
-{
- static QVector<QIcon::Mode> result;
- if (result.isEmpty())
- result << QIcon::Normal << QIcon::Active << QIcon::Disabled << QIcon::Selected;
- return result;
-}
-//! [43]
-
-QVector<QIcon::State> IconPreviewArea::iconStates()
-{
- static QVector<QIcon::State> result;
- if (result.isEmpty())
- result << QIcon::Off << QIcon::On;
- return result;
-}
-
-QStringList IconPreviewArea::iconModeNames()
-{
- static QStringList result;
- if (result.isEmpty())
- result << tr("Normal") << tr("Active") << tr("Disabled") << tr("Selected");
- return result;
-}
-
-QStringList IconPreviewArea::iconStateNames()
-{
- static QStringList result;
- if (result.isEmpty())
- result << tr("Off") << tr("On");
- return result;
-}
-
-#endif // !Q_COMPILER_INITIALIZER_LISTS
-
//! [1]
void IconPreviewArea::setIcon(const QIcon &icon)
{
diff --git a/examples/widgets/widgets/icons/iconsizespinbox.cpp b/examples/widgets/widgets/icons/iconsizespinbox.cpp
index e94d943993..8e6c654686 100644
--- a/examples/widgets/widgets/icons/iconsizespinbox.cpp
+++ b/examples/widgets/widgets/icons/iconsizespinbox.cpp
@@ -50,7 +50,7 @@
#include "iconsizespinbox.h"
-#include <QtWidgets>
+#include <QRegularExpression>
//! [0]
IconSizeSpinBox::IconSizeSpinBox(QWidget *parent)
diff --git a/examples/widgets/widgets/icons/imagedelegate.cpp b/examples/widgets/widgets/icons/imagedelegate.cpp
index 786194bae7..39c2e43134 100644
--- a/examples/widgets/widgets/icons/imagedelegate.cpp
+++ b/examples/widgets/widgets/icons/imagedelegate.cpp
@@ -51,7 +51,7 @@
#include "imagedelegate.h"
#include "iconpreviewarea.h"
-#include <QtWidgets>
+#include <QComboBox>
//! [0]
ImageDelegate::ImageDelegate(QObject *parent)
diff --git a/examples/widgets/widgets/icons/main.cpp b/examples/widgets/widgets/icons/main.cpp
index a045ea765a..632795c18c 100644
--- a/examples/widgets/widgets/icons/main.cpp
+++ b/examples/widgets/widgets/icons/main.cpp
@@ -50,7 +50,7 @@
#include <QApplication>
#include <QCommandLineParser>
-#include <QDesktopWidget>
+#include <QScreen>
#include "mainwindow.h"
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
if (!commandLineParser.positionalArguments().isEmpty())
mainWin.loadImages(commandLineParser.positionalArguments());
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(&mainWin);
+ const QRect availableGeometry = mainWin.screen()->availableGeometry();
mainWin.resize(availableGeometry.width() / 2, availableGeometry.height() * 2 / 3);
mainWin.move((availableGeometry.width() - mainWin.width()) / 2, (availableGeometry.height() - mainWin.height()) / 2);
diff --git a/examples/widgets/widgets/icons/mainwindow.cpp b/examples/widgets/widgets/icons/mainwindow.cpp
index 0cf11c978d..f342c18c4c 100644
--- a/examples/widgets/widgets/icons/mainwindow.cpp
+++ b/examples/widgets/widgets/icons/mainwindow.cpp
@@ -48,12 +48,29 @@
**
****************************************************************************/
-#include <QtWidgets>
-
+#include "mainwindow.h"
#include "iconpreviewarea.h"
#include "iconsizespinbox.h"
#include "imagedelegate.h"
-#include "mainwindow.h"
+
+#include <QApplication>
+#include <QButtonGroup>
+#include <QCheckBox>
+#include <QFileDialog>
+#include <QHeaderView>
+#include <QFormLayout>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QImageReader>
+#include <QLabel>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QRadioButton>
+#include <QScreen>
+#include <QStandardPaths>
+#include <QStyleFactory>
+#include <QTableWidget>
+#include <QWindow>
//! [40]
enum { OtherSize = QStyle::PM_CustomBase };
@@ -514,8 +531,8 @@ void MainWindow::checkCurrentStyle()
const QList<QAction *> actions = styleActionGroup->actions();
for (QAction *action : actions) {
const QString styleName = action->data().toString();
- QScopedPointer<QStyle> candidate(QStyleFactory::create(styleName));
- Q_ASSERT(!candidate.isNull());
+ const std::unique_ptr<QStyle> candidate{QStyleFactory::create(styleName)};
+ Q_ASSERT(candidate);
if (candidate->metaObject()->className()
== QApplication::style()->metaObject()->className()) {
action->trigger();
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.cpp b/examples/widgets/widgets/imageviewer/imageviewer.cpp
index fed551dade..83cf8bb7bc 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.cpp
+++ b/examples/widgets/widgets/imageviewer/imageviewer.cpp
@@ -50,7 +50,24 @@
#include "imageviewer.h"
-#include <QtWidgets>
+#include <QApplication>
+#include <QClipboard>
+#include <QColorSpace>
+#include <QDir>
+#include <QFileDialog>
+#include <QImageReader>
+#include <QImageWriter>
+#include <QLabel>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QMimeData>
+#include <QPainter>
+#include <QScreen>
+#include <QScrollArea>
+#include <QScrollBar>
+#include <QStandardPaths>
+#include <QStatusBar>
+
#if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
@@ -60,8 +77,8 @@
//! [0]
ImageViewer::ImageViewer(QWidget *parent)
- : QMainWindow(parent), imageLabel(new QLabel),
- scrollArea(new QScrollArea), scaleFactor(1)
+ : QMainWindow(parent), imageLabel(new QLabel)
+ , scrollArea(new QScrollArea)
{
imageLabel->setBackgroundRole(QPalette::Base);
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
@@ -106,6 +123,8 @@ bool ImageViewer::loadFile(const QString &fileName)
void ImageViewer::setImage(const QImage &newImage)
{
image = newImage;
+ if (image.colorSpace().isValid())
+ image.convertToColorSpace(QColorSpace::SRgb);
imageLabel->setPixmap(QPixmap::fromImage(image));
//! [4]
scaleFactor = 1.0;
diff --git a/examples/widgets/widgets/imageviewer/imageviewer.h b/examples/widgets/widgets/imageviewer/imageviewer.h
index 7e53105b33..49c7ac205b 100644
--- a/examples/widgets/widgets/imageviewer/imageviewer.h
+++ b/examples/widgets/widgets/imageviewer/imageviewer.h
@@ -98,7 +98,7 @@ private:
QImage image;
QLabel *imageLabel;
QScrollArea *scrollArea;
- double scaleFactor;
+ double scaleFactor = 1;
#ifndef QT_NO_PRINTER
QPrinter printer;
diff --git a/examples/widgets/widgets/lineedits/window.cpp b/examples/widgets/widgets/lineedits/window.cpp
index 33f09d544d..bb9396411a 100644
--- a/examples/widgets/widgets/lineedits/window.cpp
+++ b/examples/widgets/widgets/lineedits/window.cpp
@@ -48,10 +48,14 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "window.h"
+#include <QComboBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+
//! [0]
Window::Window(QWidget *parent)
: QWidget(parent)
@@ -197,6 +201,7 @@ void Window::echoChanged(int index)
break;
case 3:
echoLineEdit->setEchoMode(QLineEdit::NoEcho);
+ break;
}
}
//! [9]
@@ -215,6 +220,7 @@ void Window::validatorChanged(int index)
case 2:
validatorLineEdit->setValidator(new QDoubleValidator(-999.0,
999.0, 2, validatorLineEdit));
+ break;
}
validatorLineEdit->clear();
@@ -233,6 +239,7 @@ void Window::alignmentChanged(int index)
break;
case 2:
alignmentLineEdit->setAlignment(Qt::AlignRight);
+ break;
}
}
//! [11]
@@ -254,6 +261,7 @@ void Window::inputMaskChanged(int index)
break;
case 3:
inputMaskLineEdit->setInputMask(">AAAAA-AAAAA-AAAAA-AAAAA-AAAAA;#");
+ break;
}
}
//! [12]
@@ -267,6 +275,7 @@ void Window::accessChanged(int index)
break;
case 1:
accessLineEdit->setReadOnly(true);
+ break;
}
}
//! [13]
diff --git a/examples/widgets/widgets/mousebuttons/buttontester.cpp b/examples/widgets/widgets/mousebuttons/buttontester.cpp
index 6653221698..88dbbeda45 100644
--- a/examples/widgets/widgets/mousebuttons/buttontester.cpp
+++ b/examples/widgets/widgets/mousebuttons/buttontester.cpp
@@ -93,15 +93,16 @@ void ButtonTester::mouseDoubleClickEvent(QMouseEvent *e)
void ButtonTester::wheelEvent (QWheelEvent *e)
{
QString result;
- if (e->delta() > 0) {
-
- if (e->orientation() == Qt::Vertical) {
+ const bool vertical = qAbs(e->angleDelta().y()) >= qAbs(e->angleDelta().x());
+ const int delta = vertical ? e->angleDelta().y() : e->angleDelta().x();
+ if (delta > 0) {
+ if (vertical) {
result = "Mouse Wheel Event: UP";
} else {
result = "Mouse Wheel Event: LEFT";
}
- } else if (e->delta() < 0) {
- if (e->orientation() == Qt::Vertical) {
+ } else if (delta < 0) {
+ if (vertical) {
result = "Mouse Wheel Event: DOWN";
} else {
result = "Mouse Wheel Event: RIGHT";
diff --git a/examples/widgets/widgets/movie/movieplayer.cpp b/examples/widgets/widgets/movie/movieplayer.cpp
index 182b258a82..41cd7923ee 100644
--- a/examples/widgets/widgets/movie/movieplayer.cpp
+++ b/examples/widgets/widgets/movie/movieplayer.cpp
@@ -50,7 +50,15 @@
#include "movieplayer.h"
-#include <QtWidgets>
+#include <QCheckBox>
+#include <QFileDialog>
+#include <QLabel>
+#include <QMovie>
+#include <QSlider>
+#include <QSpinBox>
+#include <QStyle>
+#include <QToolButton>
+#include <QVBoxLayout>
MoviePlayer::MoviePlayer(QWidget *parent)
: QWidget(parent)
diff --git a/examples/widgets/widgets/scribble/mainwindow.cpp b/examples/widgets/widgets/scribble/mainwindow.cpp
index 44afa64b94..c9a34796ac 100644
--- a/examples/widgets/widgets/scribble/mainwindow.cpp
+++ b/examples/widgets/widgets/scribble/mainwindow.cpp
@@ -48,11 +48,18 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
#include "scribblearea.h"
+#include <QApplication>
+#include <QColorDialog>
+#include <QFileDialog>
+#include <QImageWriter>
+#include <QInputDialog>
+#include <QMenuBar>
+#include <QMessageBox>
+#include <QCloseEvent>
+
//! [0]
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), scribbleArea(new ScribbleArea(this))
@@ -71,11 +78,10 @@ MainWindow::MainWindow(QWidget *parent)
void MainWindow::closeEvent(QCloseEvent *event)
//! [1] //! [2]
{
- if (maybeSave()) {
+ if (maybeSave())
event->accept();
- } else {
+ else
event->ignore();
- }
}
//! [2]
@@ -231,11 +237,10 @@ bool MainWindow::maybeSave()
"Do you want to save your changes?"),
QMessageBox::Save | QMessageBox::Discard
| QMessageBox::Cancel);
- if (ret == QMessageBox::Save) {
+ if (ret == QMessageBox::Save)
return saveFile("png");
- } else if (ret == QMessageBox::Cancel) {
+ else if (ret == QMessageBox::Cancel)
return false;
- }
}
return true;
}
@@ -252,10 +257,8 @@ bool MainWindow::saveFile(const QByteArray &fileFormat)
tr("%1 Files (*.%2);;All Files (*)")
.arg(QString::fromLatin1(fileFormat.toUpper()))
.arg(QString::fromLatin1(fileFormat)));
- if (fileName.isEmpty()) {
+ if (fileName.isEmpty())
return false;
- } else {
- return scribbleArea->saveImage(fileName, fileFormat.constData());
- }
+ return scribbleArea->saveImage(fileName, fileFormat.constData());
}
//! [20]
diff --git a/examples/widgets/widgets/scribble/scribblearea.cpp b/examples/widgets/widgets/scribble/scribblearea.cpp
index 13e46f6e1d..75371b523f 100644
--- a/examples/widgets/widgets/scribble/scribblearea.cpp
+++ b/examples/widgets/widgets/scribble/scribblearea.cpp
@@ -50,7 +50,9 @@
#include "scribblearea.h"
-#include <QtWidgets>
+#include <QMouseEvent>
+#include <QPainter>
+
#if defined(QT_PRINTSUPPORT_LIB)
#include <QtPrintSupport/qtprintsupportglobal.h>
#if QT_CONFIG(printdialog)
@@ -64,10 +66,6 @@ ScribbleArea::ScribbleArea(QWidget *parent)
: QWidget(parent)
{
setAttribute(Qt::WA_StaticContents);
- modified = false;
- scribbling = false;
- myPenWidth = 1;
- myPenColor = Qt::blue;
}
//! [0]
@@ -98,9 +96,8 @@ bool ScribbleArea::saveImage(const QString &fileName, const char *fileFormat)
if (visibleImage.save(fileName, fileFormat)) {
modified = false;
return true;
- } else {
- return false;
}
+ return false;
}
//! [4]
diff --git a/examples/widgets/widgets/scribble/scribblearea.h b/examples/widgets/widgets/scribble/scribblearea.h
index 100c45e133..ed3c8a2a15 100644
--- a/examples/widgets/widgets/scribble/scribblearea.h
+++ b/examples/widgets/widgets/scribble/scribblearea.h
@@ -88,10 +88,10 @@ private:
void drawLineTo(const QPoint &endPoint);
void resizeImage(QImage *image, const QSize &newSize);
- bool modified;
- bool scribbling;
- int myPenWidth;
- QColor myPenColor;
+ bool modified = false;
+ bool scribbling = false;
+ int myPenWidth = 1;
+ QColor myPenColor = Qt::blue;
QImage image;
QPoint lastPoint;
};
diff --git a/examples/widgets/widgets/shapedclock/shapedclock.cpp b/examples/widgets/widgets/shapedclock/shapedclock.cpp
index 8e7d831938..3c78f4da89 100644
--- a/examples/widgets/widgets/shapedclock/shapedclock.cpp
+++ b/examples/widgets/widgets/shapedclock/shapedclock.cpp
@@ -48,10 +48,15 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "shapedclock.h"
+#include <QAction>
+#include <QCoreApplication>
+#include <QMouseEvent>
+#include <QPainter>
+#include <QTime>
+#include <QTimer>
+
//! [0]
ShapedClock::ShapedClock(QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint | Qt::WindowSystemMenuHint)
diff --git a/examples/widgets/widgets/sliders/slidersgroup.cpp b/examples/widgets/widgets/sliders/slidersgroup.cpp
index b4eaf9bb3d..912c9798ce 100644
--- a/examples/widgets/widgets/sliders/slidersgroup.cpp
+++ b/examples/widgets/widgets/sliders/slidersgroup.cpp
@@ -50,7 +50,10 @@
#include "slidersgroup.h"
-#include <QtWidgets>
+#include <QBoxLayout>
+#include <QDial>
+#include <QScrollBar>
+#include <QSlider>
//! [0]
SlidersGroup::SlidersGroup(Qt::Orientation orientation, const QString &title,
diff --git a/examples/widgets/widgets/sliders/window.cpp b/examples/widgets/widgets/sliders/window.cpp
index d73fafec10..4a28a61f3d 100644
--- a/examples/widgets/widgets/sliders/window.cpp
+++ b/examples/widgets/widgets/sliders/window.cpp
@@ -48,11 +48,16 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "slidersgroup.h"
#include "window.h"
+#include <QCheckBox>
+#include <QComboBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QSpinBox>
+#include <QStackedWidget>
+
//! [0]
Window::Window(QWidget *parent)
: QWidget(parent)
diff --git a/examples/widgets/widgets/spinboxes/window.cpp b/examples/widgets/widgets/spinboxes/window.cpp
index fd7c5b527e..40c02aba70 100644
--- a/examples/widgets/widgets/spinboxes/window.cpp
+++ b/examples/widgets/widgets/spinboxes/window.cpp
@@ -48,10 +48,16 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "window.h"
+#include <QCheckBox>
+#include <QComboBox>
+#include <QDateTimeEdit>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QSpinBox>
+
//! [0]
Window::Window(QWidget *parent)
: QWidget(parent)
@@ -176,7 +182,7 @@ void Window::createDateTimeEdits()
formatComboBox->addItem("hh:mm ap");
//! [9] //! [10]
- connect(formatComboBox, QOverload<const QString &>::of(&QComboBox::activated),
+ connect(formatComboBox, &QComboBox::textActivated,
this, &Window::setFormatString);
//! [10]
diff --git a/examples/widgets/widgets/styles/norwegianwoodstyle.cpp b/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
index a178769bd8..0f614a2e9a 100644
--- a/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
+++ b/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
@@ -50,7 +50,10 @@
#include "norwegianwoodstyle.h"
-#include <QtWidgets>
+#include <QComboBox>
+#include <QPainter>
+#include <QPushButton>
+#include <QStyleFactory>
NorwegianWoodStyle::NorwegianWoodStyle() :
QProxyStyle(QStyleFactory::create("windows"))
diff --git a/examples/widgets/widgets/styles/widgetgallery.cpp b/examples/widgets/widgets/styles/widgetgallery.cpp
index f0a0336a94..fd8f0ec2d1 100644
--- a/examples/widgets/widgets/styles/widgetgallery.cpp
+++ b/examples/widgets/widgets/styles/widgetgallery.cpp
@@ -51,7 +51,24 @@
#include "widgetgallery.h"
#include "norwegianwoodstyle.h"
-#include <QtWidgets>
+#include <QApplication>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QDateTimeEdit>
+#include <QDial>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QProgressBar>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QScrollBar>
+#include <QSpinBox>
+#include <QStyleFactory>
+#include <QTableWidget>
+#include <QTextEdit>
+#include <QTimer>
//! [0]
WidgetGallery::WidgetGallery(QWidget *parent)
@@ -79,7 +96,7 @@ WidgetGallery::WidgetGallery(QWidget *parent)
//! [0]
//! [1]
- connect(styleComboBox, QOverload<const QString &>::of(&QComboBox::activated),
+ connect(styleComboBox, &QComboBox::textActivated,
//! [1] //! [2]
this, &WidgetGallery::changeStyle);
connect(useStylePaletteCheckBox, &QCheckBox::toggled,
diff --git a/examples/widgets/widgets/stylesheet/main.cpp b/examples/widgets/widgets/stylesheet/main.cpp
index 1874bceb8c..3b1168398a 100644
--- a/examples/widgets/widgets/stylesheet/main.cpp
+++ b/examples/widgets/widgets/stylesheet/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
#include "mainwindow.h"
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.cpp b/examples/widgets/widgets/stylesheet/mainwindow.cpp
index f187c007dd..a8bd20e964 100644
--- a/examples/widgets/widgets/stylesheet/mainwindow.cpp
+++ b/examples/widgets/widgets/stylesheet/mainwindow.cpp
@@ -48,11 +48,11 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
#include "stylesheeteditor.h"
+#include <QMessageBox>
+
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
diff --git a/examples/widgets/widgets/stylesheet/mainwindow.h b/examples/widgets/widgets/stylesheet/mainwindow.h
index 8af4c01da0..ba979a3881 100644
--- a/examples/widgets/widgets/stylesheet/mainwindow.h
+++ b/examples/widgets/widgets/stylesheet/mainwindow.h
@@ -51,7 +51,7 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
-#include <QtWidgets>
+#include <QMainWindow>
#include "ui_mainwindow.h"
diff --git a/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp b/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp
index 0874cc3554..2cc0e969e2 100644
--- a/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp
+++ b/examples/widgets/widgets/stylesheet/stylesheeteditor.cpp
@@ -50,7 +50,9 @@
#include "stylesheeteditor.h"
-#include <QtWidgets>
+#include <QFile>
+#include <QRegularExpression>
+#include <QStyleFactory>
StyleSheetEditor::StyleSheetEditor(QWidget *parent)
: QDialog(parent)
diff --git a/examples/widgets/widgets/tablet/main.cpp b/examples/widgets/widgets/tablet/main.cpp
index 5726e79166..0fec526de0 100644
--- a/examples/widgets/widgets/tablet/main.cpp
+++ b/examples/widgets/widgets/tablet/main.cpp
@@ -48,8 +48,6 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
#include "tabletapplication.h"
#include "tabletcanvas.h"
diff --git a/examples/widgets/widgets/tablet/mainwindow.cpp b/examples/widgets/widgets/tablet/mainwindow.cpp
index a048119533..8bcb9ada63 100644
--- a/examples/widgets/widgets/tablet/mainwindow.cpp
+++ b/examples/widgets/widgets/tablet/mainwindow.cpp
@@ -48,14 +48,19 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "mainwindow.h"
#include "tabletcanvas.h"
+#include <QApplication>
+#include <QColorDialog>
+#include <QDir>
+#include <QFileDialog>
+#include <QMenuBar>
+#include <QMessageBox>
+
//! [0]
MainWindow::MainWindow(TabletCanvas *canvas)
- : m_canvas(canvas), m_colorDialog(nullptr)
+ : m_canvas(canvas)
{
createMenus();
setWindowTitle(tr("Tablet Example"));
diff --git a/examples/widgets/widgets/tablet/mainwindow.h b/examples/widgets/widgets/tablet/mainwindow.h
index 4be28784b5..3ea9af7ccf 100644
--- a/examples/widgets/widgets/tablet/mainwindow.h
+++ b/examples/widgets/widgets/tablet/mainwindow.h
@@ -81,7 +81,7 @@ private:
void createMenus();
TabletCanvas *m_canvas;
- QColorDialog *m_colorDialog;
+ QColorDialog *m_colorDialog = nullptr;
};
//! [0]
diff --git a/examples/widgets/widgets/tablet/tabletapplication.cpp b/examples/widgets/widgets/tablet/tabletapplication.cpp
index 37be018276..a27491a86c 100644
--- a/examples/widgets/widgets/tablet/tabletapplication.cpp
+++ b/examples/widgets/widgets/tablet/tabletapplication.cpp
@@ -50,8 +50,6 @@
#include "tabletapplication.h"
-#include <QtWidgets>
-
//! [0]
bool TabletApplication::event(QEvent *event)
{
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.cpp b/examples/widgets/widgets/tablet/tabletcanvas.cpp
index dc56702142..59ca608cef 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.cpp
+++ b/examples/widgets/widgets/tablet/tabletcanvas.cpp
@@ -48,21 +48,17 @@
**
****************************************************************************/
-#include <QtWidgets>
-#include <math.h>
-
#include "tabletcanvas.h"
+#include <QCoreApplication>
+#include <QPainter>
+#include <QtMath>
+#include <cstdlib>
+
//! [0]
TabletCanvas::TabletCanvas()
- : QWidget(nullptr)
- , m_alphaChannelValuator(TangentialPressureValuator)
- , m_colorSaturationValuator(NoValuator)
- , m_lineWidthValuator(PressureValuator)
- , m_color(Qt::red)
- , m_brush(m_color)
- , m_pen(m_brush, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)
- , m_deviceDown(false)
+ : QWidget(nullptr), m_brush(m_color)
+ , m_pen(m_brush, 1.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)
{
resize(500, 500);
setAutoFillBackground(true);
@@ -138,7 +134,7 @@ void TabletCanvas::tabletEvent(QTabletEvent *event)
void TabletCanvas::initPixmap()
{
qreal dpr = devicePixelRatioF();
- QPixmap newPixmap = QPixmap(width() * dpr, height() * dpr);
+ QPixmap newPixmap = QPixmap(qRound(width() * dpr), qRound(height() * dpr));
newPixmap.setDevicePixelRatio(dpr);
newPixmap.fill(Qt::white);
QPainter painter(&newPixmap);
@@ -208,7 +204,7 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
const QString error(tr("This input device is not supported by the example."));
#if QT_CONFIG(statustip)
QStatusTipEvent status(error);
- QApplication::sendEvent(this, &status);
+ QCoreApplication::sendEvent(this, &status);
#else
qWarning() << error;
#endif
@@ -219,7 +215,7 @@ void TabletCanvas::paintPixmap(QPainter &painter, QTabletEvent *event)
const QString error(tr("Unknown tablet device - treating as stylus"));
#if QT_CONFIG(statustip)
QStatusTipEvent status(error);
- QApplication::sendEvent(this, &status);
+ QCoreApplication::sendEvent(this, &status);
#else
qWarning() << error;
#endif
@@ -261,7 +257,8 @@ void TabletCanvas::updateBrush(const QTabletEvent *event)
m_color.setAlpha(255);
break;
case TiltValuator:
- m_color.setAlpha(maximum(abs(vValue - 127), abs(hValue - 127)));
+ m_color.setAlpha(std::max(std::abs(vValue - 127),
+ std::abs(hValue - 127)));
break;
default:
m_color.setAlpha(255);
@@ -288,7 +285,8 @@ void TabletCanvas::updateBrush(const QTabletEvent *event)
m_pen.setWidthF(pressureToWidth(event->pressure()));
break;
case TiltValuator:
- m_pen.setWidthF(maximum(abs(vValue - 127), abs(hValue - 127)) / 12);
+ m_pen.setWidthF(std::max(std::abs(vValue - 127),
+ std::abs(hValue - 127)) / 12);
break;
default:
m_pen.setWidthF(1);
diff --git a/examples/widgets/widgets/tablet/tabletcanvas.h b/examples/widgets/widgets/tablet/tabletcanvas.h
index c63ef76893..4c10731b0f 100644
--- a/examples/widgets/widgets/tablet/tabletcanvas.h
+++ b/examples/widgets/widgets/tablet/tabletcanvas.h
@@ -51,14 +51,13 @@
#ifndef TABLETCANVAS_H
#define TABLETCANVAS_H
-#include <QWidget>
-#include <QPixmap>
-#include <QPoint>
-#include <QTabletEvent>
-#include <QColor>
#include <QBrush>
+#include <QColor>
#include <QPen>
+#include <QPixmap>
#include <QPoint>
+#include <QTabletEvent>
+#include <QWidget>
QT_BEGIN_NAMESPACE
class QPaintEvent;
@@ -92,8 +91,6 @@ public:
{ return m_color; }
void setTabletDevice(QTabletEvent *event)
{ updateCursor(event); }
- int maximum(int a, int b)
- { return a > b ? a : b; }
protected:
void tabletEvent(QTabletEvent *event) override;
@@ -108,19 +105,19 @@ private:
void updateBrush(const QTabletEvent *event);
void updateCursor(const QTabletEvent *event);
- Valuator m_alphaChannelValuator;
- Valuator m_colorSaturationValuator;
- Valuator m_lineWidthValuator;
- QColor m_color;
+ Valuator m_alphaChannelValuator = TangentialPressureValuator;
+ Valuator m_colorSaturationValuator = NoValuator;
+ Valuator m_lineWidthValuator = PressureValuator;
+ QColor m_color = Qt::red;
QPixmap m_pixmap;
QBrush m_brush;
QPen m_pen;
- bool m_deviceDown;
+ bool m_deviceDown = false;
struct Point {
QPointF pos;
- qreal pressure;
- qreal rotation;
+ qreal pressure = 0;
+ qreal rotation = 0;
} lastPoint;
};
//! [0]
diff --git a/examples/widgets/widgets/tetrix/tetrixboard.cpp b/examples/widgets/widgets/tetrix/tetrixboard.cpp
index ef3ac4fc38..c1192f264d 100644
--- a/examples/widgets/widgets/tetrix/tetrixboard.cpp
+++ b/examples/widgets/widgets/tetrix/tetrixboard.cpp
@@ -50,16 +50,16 @@
#include "tetrixboard.h"
-#include <QtWidgets>
+#include <QKeyEvent>
+#include <QLabel>
+#include <QPainter>
//! [0]
TetrixBoard::TetrixBoard(QWidget *parent)
- : QFrame(parent)
+ : QFrame(parent), isStarted(false), isPaused(false)
{
setFrameStyle(QFrame::Panel | QFrame::Sunken);
setFocusPolicy(Qt::StrongFocus);
- isStarted = false;
- isPaused = false;
clearBoard();
nextPiece.setRandomShape();
@@ -396,7 +396,7 @@ bool TetrixBoard::tryMove(const TetrixPiece &newPiece, int newX, int newY)
//! [36]
void TetrixBoard::drawSquare(QPainter &painter, int x, int y, TetrixShape shape)
{
- static const QRgb colorTable[8] = {
+ static constexpr QRgb colorTable[8] = {
0x000000, 0xCC6666, 0x66CC66, 0x6666CC,
0xCCCC66, 0xCC66CC, 0x66CCCC, 0xDAAA00
};
diff --git a/examples/widgets/widgets/tetrix/tetrixpiece.cpp b/examples/widgets/widgets/tetrix/tetrixpiece.cpp
index b1b3ca9a99..9f6f6e863a 100644
--- a/examples/widgets/widgets/tetrix/tetrixpiece.cpp
+++ b/examples/widgets/widgets/tetrix/tetrixpiece.cpp
@@ -62,7 +62,7 @@ void TetrixPiece::setRandomShape()
//! [1]
void TetrixPiece::setShape(TetrixShape shape)
{
- static const int coordsTable[8][4][2] = {
+ static constexpr int coordsTable[8][4][2] = {
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
{ { 0, -1 }, { 0, 0 }, { -1, 0 }, { -1, 1 } },
{ { 0, -1 }, { 0, 0 }, { 1, 0 }, { 1, 1 } },
diff --git a/examples/widgets/widgets/tetrix/tetrixwindow.cpp b/examples/widgets/widgets/tetrix/tetrixwindow.cpp
index 970a38c1dc..5aa5c3f615 100644
--- a/examples/widgets/widgets/tetrix/tetrixwindow.cpp
+++ b/examples/widgets/widgets/tetrix/tetrixwindow.cpp
@@ -48,23 +48,24 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "tetrixboard.h"
#include "tetrixwindow.h"
+#include <QCoreApplication>
+#include <QGridLayout>
+#include <QLabel>
+#include <QLCDNumber>
+#include <QPushButton>
+
//! [0]
TetrixWindow::TetrixWindow(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), board(new TetrixBoard)
{
- board = new TetrixBoard;
//! [0]
-
nextPieceLabel = new QLabel;
nextPieceLabel->setFrameStyle(QFrame::Box | QFrame::Raised);
nextPieceLabel->setAlignment(Qt::AlignCenter);
board->setNextPieceLabel(nextPieceLabel);
-
//! [1]
scoreLcd = new QLCDNumber(5);
scoreLcd->setSegmentStyle(QLCDNumber::Filled);
@@ -86,7 +87,7 @@ TetrixWindow::TetrixWindow(QWidget *parent)
connect(startButton, &QPushButton::clicked, board, &TetrixBoard::start);
//! [4] //! [5]
- connect(quitButton , &QPushButton::clicked, qApp, &QApplication::quit);
+ connect(quitButton , &QPushButton::clicked, qApp, &QCoreApplication::quit);
connect(pauseButton, &QPushButton::clicked, board, &TetrixBoard::pause);
#if __cplusplus >= 201402L
connect(board, &TetrixBoard::scoreChanged,
diff --git a/examples/widgets/widgets/tooltips/main.cpp b/examples/widgets/widgets/tooltips/main.cpp
index 8276b3dc8d..0890020f77 100644
--- a/examples/widgets/widgets/tooltips/main.cpp
+++ b/examples/widgets/widgets/tooltips/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtWidgets>
+#include <QApplication>
#include "sortingbox.h"
diff --git a/examples/widgets/widgets/tooltips/sortingbox.cpp b/examples/widgets/widgets/tooltips/sortingbox.cpp
index 685eaa7d1d..f99c38b233 100644
--- a/examples/widgets/widgets/tooltips/sortingbox.cpp
+++ b/examples/widgets/widgets/tooltips/sortingbox.cpp
@@ -50,7 +50,13 @@
#include "sortingbox.h"
-#include <QtWidgets>
+#include <QMouseEvent>
+#include <QIcon>
+#include <QPainter>
+#include <QRandomGenerator>
+#include <QStyle>
+#include <QToolButton>
+#include <QToolTip>
//! [0]
SortingBox::SortingBox(QWidget *parent)
@@ -277,12 +283,12 @@ QToolButton *SortingBox::createToolButton(const QString &toolTip,
QPoint SortingBox::initialItemPosition(const QPainterPath &path)
{
int x;
- int y = (height() - (int)path.controlPointRect().height()) / 2;
+ int y = (height() - qRound(path.controlPointRect().height()) / 2);
if (shapeItems.size() == 0)
- x = ((3 * width()) / 2 - (int)path.controlPointRect().width()) / 2;
+ x = ((3 * width()) / 2 - qRound(path.controlPointRect().width())) / 2;
else
x = (width() / shapeItems.size()
- - (int)path.controlPointRect().width()) / 2;
+ - qRound(path.controlPointRect().width())) / 2;
return QPoint(x, y);
}
diff --git a/examples/widgets/widgets/tooltips/sortingbox.h b/examples/widgets/widgets/tooltips/sortingbox.h
index 3d0cecea2b..785154746e 100644
--- a/examples/widgets/widgets/tooltips/sortingbox.h
+++ b/examples/widgets/widgets/tooltips/sortingbox.h
@@ -99,7 +99,7 @@ private:
const char *member);
//! [2]
- QList<ShapeItem> shapeItems;
+ QVector<ShapeItem> shapeItems;
QPainterPath circlePath;
QPainterPath squarePath;
QPainterPath trianglePath;
diff --git a/examples/widgets/widgets/validators/validatorwidget.cpp b/examples/widgets/widgets/validators/validatorwidget.cpp
index fa0a55aa52..9ddd640924 100644
--- a/examples/widgets/widgets/validators/validatorwidget.cpp
+++ b/examples/widgets/widgets/validators/validatorwidget.cpp
@@ -50,7 +50,7 @@
#include "validatorwidget.h"
-#include <QtWidgets>
+#include <QIntValidator>
ValidatorWidget::ValidatorWidget(QWidget *parent)
: QWidget(parent)
diff --git a/examples/widgets/widgets/wiggly/wigglywidget.cpp b/examples/widgets/widgets/wiggly/wigglywidget.cpp
index 0399fe9056..ab549ef07c 100644
--- a/examples/widgets/widgets/wiggly/wigglywidget.cpp
+++ b/examples/widgets/widgets/wiggly/wigglywidget.cpp
@@ -50,11 +50,13 @@
#include "wigglywidget.h"
-#include <QtWidgets>
+#include <QFontMetrics>
+#include <QPainter>
+#include <QTimerEvent>
//! [0]
WigglyWidget::WigglyWidget(QWidget *parent)
- : QWidget(parent)
+ : QWidget(parent), step(0)
{
setBackgroundRole(QPalette::Midlight);
setAutoFillBackground(true);
@@ -63,7 +65,6 @@ WigglyWidget::WigglyWidget(QWidget *parent)
newFont.setPointSize(newFont.pointSize() + 20);
setFont(newFont);
- step = 0;
timer.start(60, this);
}
//! [0]
@@ -72,7 +73,7 @@ WigglyWidget::WigglyWidget(QWidget *parent)
void WigglyWidget::paintEvent(QPaintEvent * /* event */)
//! [1] //! [2]
{
- static const int sineTable[16] = {
+ static constexpr int sineTable[16] = {
0, 38, 71, 92, 100, 92, 71, 38, 0, -38, -71, -92, -100, -92, -71, -38
};
diff --git a/examples/widgets/widgets/windowflags/controllerwindow.cpp b/examples/widgets/widgets/windowflags/controllerwindow.cpp
index e2abad89f4..0e9a916988 100644
--- a/examples/widgets/widgets/windowflags/controllerwindow.cpp
+++ b/examples/widgets/widgets/windowflags/controllerwindow.cpp
@@ -48,10 +48,15 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "controllerwindow.h"
+#include <QCheckBox>
+#include <QCoreApplication>
+#include <QGroupBox>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QRadioButton>
+
//! [0]
ControllerWindow::ControllerWindow(QWidget *parent)
: QWidget(parent)
@@ -63,7 +68,7 @@ ControllerWindow::ControllerWindow(QWidget *parent)
quitButton = new QPushButton(tr("&Quit"));
connect(quitButton, &QPushButton::clicked,
- qApp, &QApplication::quit);
+ qApp, &QCoreApplication::quit);
QHBoxLayout *bottomLayout = new QHBoxLayout;
bottomLayout->addStretch();
@@ -83,26 +88,25 @@ ControllerWindow::ControllerWindow(QWidget *parent)
//! [1]
void ControllerWindow::updatePreview()
{
- Qt::WindowFlags flags = 0;
+ Qt::WindowFlags flags;
- if (windowRadioButton->isChecked()) {
+ if (windowRadioButton->isChecked())
flags = Qt::Window;
- } else if (dialogRadioButton->isChecked()) {
+ else if (dialogRadioButton->isChecked())
flags = Qt::Dialog;
- } else if (sheetRadioButton->isChecked()) {
+ else if (sheetRadioButton->isChecked())
flags = Qt::Sheet;
- } else if (drawerRadioButton->isChecked()) {
+ else if (drawerRadioButton->isChecked())
flags = Qt::Drawer;
- } else if (popupRadioButton->isChecked()) {
+ else if (popupRadioButton->isChecked())
flags = Qt::Popup;
- } else if (toolRadioButton->isChecked()) {
+ else if (toolRadioButton->isChecked())
flags = Qt::Tool;
- } else if (toolTipRadioButton->isChecked()) {
+ else if (toolTipRadioButton->isChecked())
flags = Qt::ToolTip;
- } else if (splashScreenRadioButton->isChecked()) {
+ else if (splashScreenRadioButton->isChecked())
flags = Qt::SplashScreen;
//! [1] //! [2]
- }
//! [2] //! [3]
if (msWindowsFixedSizeDialogCheckBox->isChecked())
diff --git a/examples/widgets/widgets/windowflags/previewwindow.cpp b/examples/widgets/widgets/windowflags/previewwindow.cpp
index 8773dccb05..d7ebed7b3c 100644
--- a/examples/widgets/widgets/windowflags/previewwindow.cpp
+++ b/examples/widgets/widgets/windowflags/previewwindow.cpp
@@ -50,7 +50,9 @@
#include "previewwindow.h"
-#include <QtWidgets>
+#include <QPushButton>
+#include <QTextEdit>
+#include <QVBoxLayout>
//! [0]
PreviewWindow::PreviewWindow(QWidget *parent)
@@ -81,23 +83,22 @@ void PreviewWindow::setWindowFlags(Qt::WindowFlags flags)
QString text;
Qt::WindowFlags type = (flags & Qt::WindowType_Mask);
- if (type == Qt::Window) {
+ if (type == Qt::Window)
text = "Qt::Window";
- } else if (type == Qt::Dialog) {
+ else if (type == Qt::Dialog)
text = "Qt::Dialog";
- } else if (type == Qt::Sheet) {
+ else if (type == Qt::Sheet)
text = "Qt::Sheet";
- } else if (type == Qt::Drawer) {
+ else if (type == Qt::Drawer)
text = "Qt::Drawer";
- } else if (type == Qt::Popup) {
+ else if (type == Qt::Popup)
text = "Qt::Popup";
- } else if (type == Qt::Tool) {
+ else if (type == Qt::Tool)
text = "Qt::Tool";
- } else if (type == Qt::ToolTip) {
+ else if (type == Qt::ToolTip)
text = "Qt::ToolTip";
- } else if (type == Qt::SplashScreen) {
+ else if (type == Qt::SplashScreen)
text = "Qt::SplashScreen";
- }
if (flags & Qt::MSWindowsFixedSizeDialogHint)
text += "\n| Qt::MSWindowsFixedSizeDialogHint";
diff --git a/examples/widgets/windowcontainer/windowcontainer.cpp b/examples/widgets/windowcontainer/windowcontainer.cpp
index 9f2124c4e1..b920c85420 100644
--- a/examples/widgets/windowcontainer/windowcontainer.cpp
+++ b/examples/widgets/windowcontainer/windowcontainer.cpp
@@ -50,16 +50,14 @@
#include "openglwindow.h"
-#include <QPainter>
-#include <QMouseEvent>
-#include <QKeyEvent>
-#include <QFocusEvent>
-
#include <QApplication>
-#include <QWidget>
+#include <QFocusEvent>
#include <QHBoxLayout>
+#include <QKeyEvent>
#include <QLineEdit>
-
+#include <QMouseEvent>
+#include <QPainter>
+#include <QWidget>
// Making use of the class from the opengl example in gui.
@@ -67,13 +65,10 @@ class Window : public OpenGLWindow
{
Q_OBJECT
public:
- Window()
- : m_mouseDown(false)
- , m_focus(false)
- {
- }
+ using OpenGLWindow::OpenGLWindow;
- void render(QPainter *p) override {
+ void render(QPainter *p) override
+ {
QLinearGradient g(0, 0, 0, height());
g.setColorAt(0, QColor("lightsteelblue"));
g.setColorAt(1, Qt::black);
@@ -93,15 +88,15 @@ public:
p->restore();
}
- if (m_focus) {
+ if (m_focus)
p->drawText(20, height() - 20, QLatin1String("Window has focus!"));
- }
p->setRenderHint(QPainter::Antialiasing);
p->drawPolyline(m_polygon);
}
- void mousePressEvent(QMouseEvent *e) override {
+ void mousePressEvent(QMouseEvent *e) override
+ {
if (!m_mouseDown) {
m_mouseDown = true;
m_polygon.clear();
@@ -110,14 +105,16 @@ public:
}
}
- void mouseMoveEvent(QMouseEvent *e) override {
+ void mouseMoveEvent(QMouseEvent *e) override
+ {
if (m_mouseDown) {
m_polygon.append(e->pos());
renderLater();
}
}
- void mouseReleaseEvent(QMouseEvent *e) override {
+ void mouseReleaseEvent(QMouseEvent *e) override
+ {
if (m_mouseDown) {
m_mouseDown = false;
m_polygon.append(e->pos());
@@ -125,33 +122,35 @@ public:
}
}
- void focusInEvent(QFocusEvent *) override {
+ void focusInEvent(QFocusEvent *) override
+ {
m_focus = true;
renderLater();
}
- void focusOutEvent(QFocusEvent *) override {
+ void focusOutEvent(QFocusEvent *) override
+ {
m_focus = false;
m_polygon.clear();
renderLater();
}
- void keyPressEvent(QKeyEvent *e) override {
+ void keyPressEvent(QKeyEvent *e) override
+ {
m_key = e->text();
renderLater();
}
- void keyReleaseEvent(QKeyEvent *) override {
+ void keyReleaseEvent(QKeyEvent *) override
+ {
m_key = QString();
renderLater();
}
private:
QPolygon m_polygon;
- bool m_mouseDown;
-
- bool m_focus;
-
QString m_key;
+ bool m_mouseDown = false;
+ bool m_focus = false;
};
@@ -162,7 +161,7 @@ int main(int argc, char *argv[])
QWidget *widget = new QWidget;
QHBoxLayout *layout = new QHBoxLayout(widget);
- Window *window = new Window();
+ Window *window = new Window;
QWidget *container = QWidget::createWindowContainer(window);
container->setMinimumSize(300, 300);
diff --git a/examples/xml/dombookmarks/mainwindow.cpp b/examples/xml/dombookmarks/mainwindow.cpp
index fade2dfc96..b8f2e12918 100644
--- a/examples/xml/dombookmarks/mainwindow.cpp
+++ b/examples/xml/dombookmarks/mainwindow.cpp
@@ -63,7 +63,7 @@ MainWindow::MainWindow()
statusBar()->showMessage(tr("Ready"));
setWindowTitle(tr("DOM Bookmarks"));
- const QSize availableSize = QApplication::desktop()->availableGeometry(this).size();
+ const QSize availableSize = screen()->availableGeometry().size();
resize(availableSize.width() / 2, availableSize.height() / 3);
}
diff --git a/examples/xml/htmlinfo/main.cpp b/examples/xml/htmlinfo/main.cpp
index 22bf36f33c..bc19ae4a82 100644
--- a/examples/xml/htmlinfo/main.cpp
+++ b/examples/xml/htmlinfo/main.cpp
@@ -54,10 +54,10 @@ void parseHtmlFile(QTextStream &out, const QString &fileName)
{
QFile file(fileName);
- out << "Analysis of HTML file: " << fileName << endl;
+ out << "Analysis of HTML file: " << fileName << Qt::endl;
if (!file.open(QIODevice::ReadOnly)) {
- out << " Couldn't open the file." << endl << endl << endl;
+ out << " Couldn't open the file." << Qt::endl << Qt::endl << Qt::endl;
return;
}
@@ -85,22 +85,22 @@ void parseHtmlFile(QTextStream &out, const QString &fileName)
//! [2]
if (reader.hasError()) {
out << " The HTML file isn't well-formed: " << reader.errorString()
- << endl << endl << endl;
+ << Qt::endl << Qt::endl << Qt::endl;
return;
}
//! [2]
- out << " Title: \"" << title << '"' << endl
- << " Number of paragraphs: " << paragraphCount << endl
- << " Number of links: " << links.size() << endl
- << " Showing first few links:" << endl;
+ out << " Title: \"" << title << '"' << Qt::endl
+ << " Number of paragraphs: " << paragraphCount << Qt::endl
+ << " Number of links: " << links.size() << Qt::endl
+ << " Showing first few links:" << Qt::endl;
while (links.size() > 5)
links.removeLast();
for (const QString &link : qAsConst(links))
- out << " " << link << endl;
- out << endl << endl;
+ out << " " << link << Qt::endl;
+ out << Qt::endl << Qt::endl;
}
int main(int argc, char **argv)
diff --git a/examples/xml/saxbookmarks/mainwindow.cpp b/examples/xml/saxbookmarks/mainwindow.cpp
index 0583cd82cf..8b7733081f 100644
--- a/examples/xml/saxbookmarks/mainwindow.cpp
+++ b/examples/xml/saxbookmarks/mainwindow.cpp
@@ -74,7 +74,7 @@ MainWindow::MainWindow()
statusBar()->showMessage(tr("Ready"));
setWindowTitle(tr("SAX Bookmarks"));
- const QSize availableSize = QApplication::desktop()->availableGeometry(this).size();
+ const QSize availableSize = screen()->availableGeometry().size();
resize(availableSize.width() / 2, availableSize.height() / 3);
}
diff --git a/examples/xml/streambookmarks/mainwindow.cpp b/examples/xml/streambookmarks/mainwindow.cpp
index c9a18fa3c4..d0e7bf30c9 100644
--- a/examples/xml/streambookmarks/mainwindow.cpp
+++ b/examples/xml/streambookmarks/mainwindow.cpp
@@ -75,7 +75,7 @@ MainWindow::MainWindow()
statusBar()->showMessage(tr("Ready"));
setWindowTitle(tr("QXmlStream Bookmarks"));
- const QSize availableSize = QApplication::desktop()->availableGeometry(this).size();
+ const QSize availableSize = screen()->availableGeometry().size();
resize(availableSize.width() / 2, availableSize.height() / 3);
}
//! [0]
diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf
index 05b7979142..31ee5d2637 100644
--- a/mkspecs/android-clang/qmake.conf
+++ b/mkspecs/android-clang/qmake.conf
@@ -8,45 +8,106 @@ CONFIG += android_install unversioned_soname unversioned_libname
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/clang.conf)
-include(../common/android-base-head.conf)
-NDK_LLVM_PATH = $$NDK_ROOT/toolchains/llvm/prebuilt/$$NDK_HOST
-QMAKE_CC = $$NDK_LLVM_PATH/bin/clang
-QMAKE_CXX = $$NDK_LLVM_PATH/bin/clang++
+load(device_config)
-equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
- QMAKE_CFLAGS += -target armv7-none-linux-androideabi
-else: equals(ANDROID_TARGET_ARCH, armeabi): \
- QMAKE_CFLAGS += -target armv5te-none-linux-androideabi
-else: equals(ANDROID_TARGET_ARCH, arm64-v8a): \
- QMAKE_CFLAGS += -target aarch64-none-linux-android
-else: equals(ANDROID_TARGET_ARCH, x86): \
- QMAKE_CFLAGS += -target i686-none-linux-android -mstackrealign
-else: equals(ANDROID_TARGET_ARCH, x86_64): \
- QMAKE_CFLAGS += -target x86_64-none-linux-android
+# In early configure setup; nothing useful to be done here.
+isEmpty(DEFAULT_ANDROID_NDK_ROOT): return()
-QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info
+NDK_ROOT = $$(ANDROID_NDK_ROOT)
+isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
-QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++
-equals(ANDROID_TARGET_ARCH, armeabi-v7a): QMAKE_LINK += -Wl,--exclude-libs,libunwind.a
+!exists($$NDK_ROOT): error("You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.")
-QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \
- -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \
- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \
- -isystem $$NDK_ROOT/sources/android/support/include \
- -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include
+NDK_HOST = $$(ANDROID_NDK_HOST)
+isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST
-ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH
+ANDROID_PLATFORM = $$(ANDROID_NDK_PLATFORM)
+isEmpty(ANDROID_PLATFORM): ANDROID_PLATFORM = $$DEFAULT_ANDROID_PLATFORM
-ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so
+ANDROID_SDK_ROOT = $$(ANDROID_SDK_ROOT)
+isEmpty(ANDROID_SDK_ROOT): ANDROID_SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT
+
+ANDROID_SDK_BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION)
+isEmpty(ANDROID_SDK_BUILD_TOOLS_REVISION) {
+ SDK_BUILD_TOOLS_REVISIONS = $$files($$ANDROID_SDK_ROOT/build-tools/*)
+ for (REVISION, SDK_BUILD_TOOLS_REVISIONS) {
+ BASENAME = $$basename(REVISION)
+ greaterThan(BASENAME, $$ANDROID_SDK_BUILD_TOOLS_REVISION): ANDROID_SDK_BUILD_TOOLS_REVISION = $$BASENAME
+ }
+}
+
+ALL_ANDROID_ABIS = $$(ALL_ANDROID_ABIS)
+isEmpty(ALL_ANDROID_ABIS): ALL_ANDROID_ABIS = $$DEFAULT_ANDROID_ABIS
+isEmpty(ALL_ANDROID_ABIS): ALL_ANDROID_ABIS = arm64-v8a armeabi-v7a x86_64 x86
+
+CONFIG += $$ANDROID_PLATFORM
+
+NDK_LLVM_PATH = $$NDK_ROOT/toolchains/llvm/prebuilt/$$NDK_HOST
+QMAKE_CC = $$NDK_LLVM_PATH/bin/clang
+QMAKE_CXX = $$NDK_LLVM_PATH/bin/clang++
+QMAKE_LINK = $$QMAKE_CXX
+QMAKE_OBJCOPY = $$NDK_LLVM_PATH/bin/llvm-objcopy
+QMAKE_AR = $$NDK_LLVM_PATH/bin/llvm-ar cqs
+QMAKE_OBJCOPY = $$NDK_LLVM_PATH/bin/llvm-objcopy
+QMAKE_NM = $$NDK_LLVM_PATH/bin/llvm-nm -P
+
+QMAKE_CFLAGS_OPTIMIZE = -Oz
+QMAKE_CFLAGS_OPTIMIZE_FULL = -Oz
+
+QMAKE_CFLAGS_WARN_ON = -Wall -W
+QMAKE_CFLAGS_WARN_OFF =
+QMAKE_CFLAGS_SHLIB = -fPIC
+QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
+QMAKE_CFLAGS_THREAD = -D_REENTRANT
+QMAKE_CFLAGS_HIDESYMS = -fvisibility=hidden
+QMAKE_CFLAGS_NEON = -mfpu=neon
+
+QMAKE_LFLAGS_APP = -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared
+QMAKE_LFLAGS_SHLIB = -Wl,--build-id=sha1 -Wl,--no-undefined -Wl,-z,noexecstack -shared
+QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
+QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
+QMAKE_LFLAGS_RPATH = -Wl,-rpath=
+QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link=
+
+equals(QMAKE_HOST.os, Windows) {
+ QMAKE_LINK_OBJECT_MAX = 10
+ QMAKE_LINK_OBJECT_SCRIPT = object_script
+}
+
+QMAKE_LIBS_X11 =
+QMAKE_LIBS_THREAD =
+QMAKE_LIBS_OPENGL =
+QMAKE_INCDIR_POST =
+QMAKE_INCDIR_X11 =
+QMAKE_LIBDIR_X11 =
+QMAKE_INCDIR_OPENGL =
+QMAKE_LIBDIR_OPENGL =
ANDROID_USE_LLVM = true
-exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \
- ANDROID_CXX_STL_LIBS = -lc++
-else: \
- ANDROID_CXX_STL_LIBS = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so.$$replace(ANDROID_PLATFORM, "android-", "")
+armeabi-v7a.sdk = armeabi-v7a
+armeabi-v7a.target = armeabi-v7a
+armeabi-v7a.dir_affix = armeabi-v7a
+armeabi-v7a.CONFIG = armeabi-v7a
+armeabi-v7a.deployment_identifier = armeabi-v7a
+
+arm64-v8a.sdk = arm64-v8a
+arm64-v8a.target = arm64-v8a
+arm64-v8a.dir_affix = arm64-v8a
+arm64-v8a.CONFIG = arm64-v8a
+arm64-v8a.deployment_identifier = arm64-v8a
+
+x86.sdk = x86
+x86.target = x86
+x86.dir_affix = x86
+x86.CONFIG = x86
+x86.deployment_identifier = x86
-QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz
+x86_64.sdk = x86_64
+x86_64.target = x86_64
+x86_64.dir_affix = x86_64
+x86_64.CONFIG = x86_64
+x86_64.deployment_identifier = x86_64
-include(../common/android-base-tail.conf)
+load(qt_config)
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
deleted file mode 100644
index 0cb3558f96..0000000000
--- a/mkspecs/android-g++/qmake.conf
+++ /dev/null
@@ -1,35 +0,0 @@
-# qmake configuration for building with android-g++
-MAKEFILE_GENERATOR = UNIX
-QMAKE_PLATFORM = android
-QMAKE_COMPILER = gcc
-
-CONFIG += android_install unversioned_soname unversioned_libname plugin_with_soname android_deployment_settings
-
-include(../common/linux.conf)
-include(../common/gcc-base-unix.conf)
-include(../common/android-base-head.conf)
-
-QMAKE_CC = $${CROSS_COMPILE}gcc
-QMAKE_CXX = $${CROSS_COMPILE}g++
-QMAKE_LINK = $$QMAKE_CXX
-
-ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ARCH
-ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libgnustl_shared.so
-ANDROID_CXX_STL_LIBS = -lgnustl_shared -lgcc
-ANDROID_USE_LLVM = false
-
-exists($$NDK_ROOT/sysroot/usr/include): \
- QMAKE_CFLAGS += --sysroot=$$NDK_ROOT/sysroot \
- -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX
-else: QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
-
-QMAKE_CFLAGS += -isystem $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/include \
- -isystem $$ANDROID_SOURCES_CXX_STL_LIBDIR/include
-
-equals(ANDROID_TARGET_ARCH, armeabi)|equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
- LIBGCC_PATH_FULL = $$system("$$QMAKE_CXX -mthumb-interwork -print-libgcc-file-name")
-else: \
- LIBGCC_PATH_FULL = $$system("$$QMAKE_CXX -print-libgcc-file-name")
-ANDROID_SOURCES_CXX_STL_LIBDIR += $$dirname(LIBGCC_PATH_FULL)
-
-include(../common/android-base-tail.conf)
diff --git a/mkspecs/android-g++/qplatformdefs.h b/mkspecs/android-g++/qplatformdefs.h
deleted file mode 100644
index 0b92709dd5..0000000000
--- a/mkspecs/android-g++/qplatformdefs.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the qmake spec of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QPLATFORMDEFS_H
-#define QPLATFORMDEFS_H
-
-// Get Qt defines/settings
-
-#include "qglobal.h"
-
-// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
-
-// 1) need to reset default environment if _BSD_SOURCE is defined
-// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0
-// 3) it seems older glibc need this to include the X/Open stuff
-
-#include <unistd.h>
-
-// We are hot - unistd.h should have turned on the specific APIs we requested
-
-#include <features.h>
-#include <pthread.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <grp.h>
-#include <pwd.h>
-#include <signal.h>
-#include <dlfcn.h>
-
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/ipc.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#ifdef QT_LARGEFILE_SUPPORT
-#define QT_STATBUF struct stat64
-#define QT_STATBUF4TSTAT struct stat64
-#define QT_STAT ::stat64
-#define QT_FSTAT ::fstat64
-#define QT_LSTAT ::lstat64
-#define QT_OPEN ::open64
-#define QT_TRUNCATE ::truncate64
-#define QT_FTRUNCATE ::ftruncate64
-#define QT_LSEEK ::lseek64
-#else
-#define QT_STATBUF struct stat
-#define QT_STATBUF4TSTAT struct stat
-#define QT_STAT ::stat
-#define QT_FSTAT ::fstat
-#define QT_LSTAT ::lstat
-#define QT_OPEN ::open
-#define QT_TRUNCATE ::truncate
-#define QT_FTRUNCATE ::ftruncate
-#define QT_LSEEK ::lseek
-#endif
-
-#ifdef QT_LARGEFILE_SUPPORT
-#define QT_FOPEN ::fopen64
-#define QT_FSEEK ::fseeko64
-#define QT_FTELL ::ftello64
-#define QT_FGETPOS ::fgetpos64
-#define QT_FSETPOS ::fsetpos64
-#define QT_MMAP ::mmap64
-#define QT_FPOS_T fpos64_t
-#define QT_OFF_T off64_t
-#else
-#define QT_FOPEN ::fopen
-#define QT_FSEEK ::fseek
-#define QT_FTELL ::ftell
-#define QT_FGETPOS ::fgetpos
-#define QT_FSETPOS ::fsetpos
-#define QT_MMAP ::mmap
-#define QT_FPOS_T fpos_t
-#define QT_OFF_T long
-#endif
-
-#define QT_STAT_REG S_IFREG
-#define QT_STAT_DIR S_IFDIR
-#define QT_STAT_MASK S_IFMT
-#define QT_STAT_LNK S_IFLNK
-#define QT_SOCKET_CONNECT ::connect
-#define QT_SOCKET_BIND ::bind
-#define QT_FILENO fileno
-#define QT_CLOSE ::close
-#define QT_READ ::read
-#define QT_WRITE ::write
-#define QT_ACCESS ::access
-#define QT_GETCWD ::getcwd
-#define QT_CHDIR ::chdir
-#define QT_MKDIR ::mkdir
-#define QT_RMDIR ::rmdir
-#define QT_OPEN_LARGEFILE O_LARGEFILE
-#define QT_OPEN_RDONLY O_RDONLY
-#define QT_OPEN_WRONLY O_WRONLY
-#define QT_OPEN_RDWR O_RDWR
-#define QT_OPEN_CREAT O_CREAT
-#define QT_OPEN_TRUNC O_TRUNC
-#define QT_OPEN_APPEND O_APPEND
-#define QT_OPEN_EXCL O_EXCL
-
-// Directory iteration
-#define QT_DIR DIR
-
-#define QT_OPENDIR ::opendir
-#define QT_CLOSEDIR ::closedir
-
-#if defined(QT_LARGEFILE_SUPPORT) \
- && defined(QT_USE_XOPEN_LFS_EXTENSIONS) \
- && !defined(QT_NO_READDIR64)
-#define QT_DIRENT struct dirent64
-#define QT_READDIR ::readdir64
-#define QT_READDIR_R ::readdir64_r
-#else
-#define QT_DIRENT struct dirent
-#define QT_READDIR ::readdir
-#define QT_READDIR_R ::readdir_r
-#endif
-
-#define QT_SOCKET_CONNECT ::connect
-#define QT_SOCKET_BIND ::bind
-
-
-#define QT_SIGNAL_RETTYPE void
-#define QT_SIGNAL_ARGS int
-#define QT_SIGNAL_IGNORE SIG_IGN
-
-#define QT_SOCKLEN_T socklen_t
-
-#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
-#define QT_SNPRINTF ::snprintf
-#define QT_VSNPRINTF ::vsnprintf
-#endif
-
-#endif // QPLATFORMDEFS_H
diff --git a/mkspecs/common/android-base-head.conf b/mkspecs/common/android-base-head.conf
deleted file mode 100644
index ba90ad5f17..0000000000
--- a/mkspecs/common/android-base-head.conf
+++ /dev/null
@@ -1,72 +0,0 @@
-load(device_config)
-
-# In early configure setup; nothing useful to be done here.
-isEmpty(DEFAULT_ANDROID_NDK_ROOT): return()
-
-NDK_ROOT = $$(ANDROID_NDK_ROOT)
-isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
-
-NDK_HOST = $$(ANDROID_NDK_HOST)
-isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST
-
-ANDROID_PLATFORM = $$(ANDROID_NDK_PLATFORM)
-isEmpty(ANDROID_PLATFORM): ANDROID_PLATFORM = $$DEFAULT_ANDROID_PLATFORM
-
-ANDROID_TARGET_ARCH = $$(ANDROID_TARGET_ARCH)
-isEmpty(ANDROID_TARGET_ARCH): ANDROID_TARGET_ARCH = $$DEFAULT_ANDROID_TARGET_ARCH
-
-NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
-isEmpty(NDK_TOOLCHAIN_PREFIX) {
- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
- else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
- else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
-}
-
-NDK_TOOLS_PREFIX = $$(ANDROID_NDK_TOOLS_PREFIX)
-isEmpty(NDK_TOOLS_PREFIX) {
- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLS_PREFIX = i686-linux-android
- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLS_PREFIX = x86_64-linux-android
- else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLS_PREFIX = aarch64-linux-android
- else: NDK_TOOLS_PREFIX = arm-linux-androideabi
-}
-
-NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION)
-isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION
-
-equals(ANDROID_TARGET_ARCH, x86): ANDROID_ARCHITECTURE = x86
-else: equals(ANDROID_TARGET_ARCH, x86_64): ANDROID_ARCHITECTURE = x86_64
-else: equals(ANDROID_TARGET_ARCH, arm64-v8a): ANDROID_ARCHITECTURE = arm64
-else: ANDROID_ARCHITECTURE = arm
-
-!equals(NDK_TOOLCHAIN_VERSION, 4.4.3): ANDROID_CXXSTL_SUFFIX = -$$NDK_TOOLCHAIN_VERSION
-
-NDK_TOOLCHAIN = $$NDK_TOOLCHAIN_PREFIX-$$NDK_TOOLCHAIN_VERSION
-NDK_TOOLCHAIN_PATH = $$NDK_ROOT/toolchains/$$NDK_TOOLCHAIN/prebuilt/$$NDK_HOST
-
-
-ANDROID_SDK_ROOT = $$(ANDROID_SDK_ROOT)
-isEmpty(ANDROID_SDK_ROOT): ANDROID_SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT
-
-ANDROID_SDK_BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION)
-isEmpty(ANDROID_SDK_BUILD_TOOLS_REVISION) {
- SDK_BUILD_TOOLS_REVISIONS = $$files($$ANDROID_SDK_ROOT/build-tools/*)
- for (REVISION, SDK_BUILD_TOOLS_REVISIONS) {
- BASENAME = $$basename(REVISION)
- greaterThan(BASENAME, $$ANDROID_SDK_BUILD_TOOLS_REVISION): ANDROID_SDK_BUILD_TOOLS_REVISION = $$BASENAME
- }
-}
-
-CONFIG += $$ANDROID_PLATFORM
-QMAKE_CFLAGS = -D__ANDROID_API__=$$replace(ANDROID_PLATFORM, "android-", "")
-
-ANDROID_PLATFORM_ROOT_PATH = $$NDK_ROOT/platforms/$$ANDROID_PLATFORM/arch-$$ANDROID_ARCHITECTURE/
-
-CROSS_COMPILE = $$NDK_TOOLCHAIN_PATH/bin/$$NDK_TOOLS_PREFIX-
-
-QMAKE_PCH_OUTPUT_EXT = .gch
-
-QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
-QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE}
-QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
-QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf
deleted file mode 100644
index edc255d08e..0000000000
--- a/mkspecs/common/android-base-tail.conf
+++ /dev/null
@@ -1,90 +0,0 @@
-# In early configure setup; nothing useful to be done here.
-isEmpty(DEFAULT_ANDROID_NDK_ROOT): return()
-
-# -fstack-protector-strong offers good protection against stack smashing attacks.
-# It is (currently) enabled only on Android because we know for sure that Andoroid compilers supports it
-QMAKE_CFLAGS += -fstack-protector-strong -DANDROID
-
-equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
- QMAKE_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove
-else: equals(ANDROID_TARGET_ARCH, armeabi): \
- QMAKE_CFLAGS += -march=armv5te -mtune=xscale -msoft-float -fno-builtin-memmove
-# -fno-builtin-memmove is used to workaround https://code.google.com/p/android/issues/detail?id=81692
-
-QMAKE_CFLAGS_WARN_ON = -Wall -W
-QMAKE_CFLAGS_WARN_OFF =
-equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) {
- CONFIG += optimize_size
- QMAKE_CFLAGS_DEBUG = -g -marm -O0
- equals(ANDROID_TARGET_ARCH, armeabi):if(equals(NDK_TOOLCHAIN_VERSION, 4.8)|equals(NDK_TOOLCHAIN_VERSION, 4.9)) {
- DEFINES += QT_OS_ANDROID_GCC_48_WORKAROUND
- } else {
- QMAKE_CFLAGS_RELEASE += -mthumb
- QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -mthumb
- }
-}
-
-QMAKE_CFLAGS_SHLIB = -fPIC
-QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
-QMAKE_CFLAGS_THREAD = -D_REENTRANT
-QMAKE_CFLAGS_HIDESYMS = -fvisibility=hidden
-QMAKE_CFLAGS_NEON = -mfpu=neon
-
-QMAKE_CFLAGS_GNUC99 = -std=gnu99
-QMAKE_CFLAGS_GNUC11 = -std=gnu11
-QMAKE_CXXFLAGS_CXX11 = -std=c++11
-QMAKE_CXXFLAGS_CXX14 = -std=c++14
-QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
-QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
-QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++14
-QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
-
-QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
-QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
-QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
-QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
-QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
-QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
-QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
-QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
-QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
-QMAKE_CXXFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden
-
-# modifications to linux.conf
-QMAKE_AR = $${CROSS_COMPILE}ar cqs
-QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy
-QMAKE_NM = $${CROSS_COMPILE}nm -P
-
-QMAKE_STRIP =
-#$${CROSS_COMPILE}strip
-
-QMAKE_RANLIB = $${CROSS_COMPILE}ranlib
-
-QMAKE_INCDIR_POST =
-QMAKE_LIBDIR_POST = $$ANDROID_SOURCES_CXX_STL_LIBDIR
-QMAKE_INCDIR_X11 =
-QMAKE_LIBDIR_X11 =
-QMAKE_INCDIR_OPENGL =
-QMAKE_LIBDIR_OPENGL =
-
-QMAKE_LINK_SHLIB = $$QMAKE_LINK
-QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
-equals(ANDROID_TARGET_ARCH, x86_64) QMAKE_LFLAGS += -L$$ANDROID_PLATFORM_ROOT_PATH/usr/lib64
-QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared
-QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared
-QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
-QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
-QMAKE_LFLAGS_RPATH = -Wl,-rpath=
-QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link=
-
-QMAKE_LIBS_PRIVATE = $$ANDROID_CXX_STL_LIBS -llog -lz -lm -ldl -lc
-QMAKE_LIBS_X11 =
-QMAKE_LIBS_THREAD =
-QMAKE_LIBS_EGL = -lEGL
-QMAKE_LIBS_OPENGL =
-QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
-
-
-!exists($$NDK_ROOT): error("You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.")
-
-load(qt_config)
diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf
index df210fe42d..aead581478 100644
--- a/mkspecs/common/clang.conf
+++ b/mkspecs/common/clang.conf
@@ -16,10 +16,13 @@ QMAKE_LINK_SHLIB = $$QMAKE_CXX
CONFIG += clang_pch_style
QMAKE_PCH_OUTPUT_EXT = .pch
+QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz
+
QMAKE_CFLAGS_ISYSTEM = -isystem
QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
-QMAKE_CFLAGS_LTCG = -flto
+QMAKE_CFLAGS_LTCG = -flto=thin
+QMAKE_CFLAGS_LTCG_FATOBJECTS = -flto
QMAKE_CFLAGS_DISABLE_LTCG = -fno-lto
QMAKE_CFLAGS_GNUC99 = -std=gnu99
QMAKE_CFLAGS_GNUC11 = -std=gnu11
@@ -27,6 +30,7 @@ QMAKE_CFLAGS_GNUC11 = -std=gnu11
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS
QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
QMAKE_CXXFLAGS_CXX11 = -std=c++11
QMAKE_CXXFLAGS_CXX14 = -std=c++1y
diff --git a/mkspecs/common/g++-win32.conf b/mkspecs/common/g++-win32.conf
index c3a1f3a373..6369436863 100644
--- a/mkspecs/common/g++-win32.conf
+++ b/mkspecs/common/g++-win32.conf
@@ -17,7 +17,7 @@ include(g++-base.conf)
MAKEFILE_GENERATOR = MINGW
QMAKE_PLATFORM = win32 mingw
-CONFIG += debug_and_release debug_and_release_target precompile_header
+CONFIG += precompile_header
DEFINES += UNICODE _UNICODE WIN32 MINGW_HAS_SECURE_API=1
QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32
# can't add 'DEFINES += WIN64' and 'QMAKE_COMPILER_DEFINES += _WIN64' defines for
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
index 44b4267207..4d82321cba 100644
--- a/mkspecs/common/gcc-base.conf
+++ b/mkspecs/common/gcc-base.conf
@@ -38,7 +38,7 @@ QMAKE_CFLAGS_OPTIMIZE_SIZE = -Os
!equals(QMAKE_HOST.os, Windows): QMAKE_CFLAGS += -pipe
QMAKE_CFLAGS_DEPS += -M
-QMAKE_CFLAGS_WARN_ON += -Wall -W
+QMAKE_CFLAGS_WARN_ON += -Wall -Wextra
QMAKE_CFLAGS_WARN_OFF += -w
QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
index b77494ec9b..61bea952b2 100644
--- a/mkspecs/common/mac.conf
+++ b/mkspecs/common/mac.conf
@@ -14,7 +14,6 @@ include(unix.conf)
QMAKE_RESOURCE = /Developer/Tools/Rez
QMAKE_EXTENSION_SHLIB = dylib
-QMAKE_EXTENSIONS_AUX_SHLIB = tbd
QMAKE_LIBDIR =
# sdk.prf will prefix the proper SDK sysroot
diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
index 67552dcc6c..d16b77acb8 100644
--- a/mkspecs/common/macx.conf
+++ b/mkspecs/common/macx.conf
@@ -5,9 +5,13 @@
QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
+QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
QMAKE_APPLE_DEVICE_ARCHS = x86_64
-QT_MAC_SDK_VERSION_MIN = 10.13
+
+# Should be 10.15, but as long as the CI builds with
+# older SDKs we have to keep this.
+QT_MAC_SDK_VERSION_MIN = 10.14
+
QT_MAC_SDK_VERSION_MAX = 10.15
device.sdk = macosx
diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf
index 034fd3b305..f5d12f445b 100644
--- a/mkspecs/common/msvc-desktop.conf
+++ b/mkspecs/common/msvc-desktop.conf
@@ -85,7 +85,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
-QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
+QMAKE_LFLAGS_RELEASE = /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
diff --git a/mkspecs/common/rtems-base.conf b/mkspecs/common/rtems-base.conf
new file mode 100644
index 0000000000..0a015c3173
--- /dev/null
+++ b/mkspecs/common/rtems-base.conf
@@ -0,0 +1,73 @@
+#
+# Base qmake configuration for GCC on RTEMS
+#
+#
+#
+MAKEFILE_GENERATOR = UNIX
+
+QMAKE_PLATFORM = rtems
+
+include(unix.conf)
+include(gcc-base-unix.conf)
+include(g++-unix.conf)
+
+rtems_bsp = $$(RTEMS_BSP)
+isEmpty(rtems_bsp) {
+ error("This qmakespec requires $RTEMS_BSP to be set")
+}
+
+rtems_compiler = $$(RTEMS_COMPILER)
+isEmpty(rtems_compiler) {
+ error("This qmakespec requires $RTEMS_COMPILER to be set")
+}
+
+isEmpty(RTEMS_CPU_FLAGS) {
+ error("The qmakespec is expected to set \$\$RTEMS_CPU_FLAGS")
+}
+
+RTEMS_FLAGS = \
+ -B$$rtems_bsp \
+ -specs bsp_specs \
+ -qrtems \
+ $$RTEMS_CPU_FLAGS
+
+QMAKE_CFLAGS_OPTIMIZE_FULL = $$QMAKE_CFLAGS_OPTIMIZE
+QMAKE_CFLAGS_OPTIMIZE_DEBUG = -O0 -g
+
+QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_OPTIMIZE_DEBUG
+QMAKE_CFLAGS_WARN_ON = -Wall
+QMAKE_CFLAGS_PIC =
+QMAKE_CFLAGS_SHLIB =
+QMAKE_CFLAGS_STATIC_LIB =
+QMAKE_CFLAGS_APP =
+QMAKE_CFLAGS += $$RTEMS_FLAGS
+
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_SHLIB =
+QMAKE_CXXFLAGS_STATIC_LIB =
+QMAKE_CXXFLAGS_APP =
+QMAKE_CXXFLAGS += $$RTEMS_FLAGS
+
+QMAKE_CXXFLAGS_CXX11 =
+QMAKE_CXXFLAGS_CXX14 =
+QMAKE_CXXFLAGS_CXX1Z =
+
+QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
+QMAKE_LFLAGS += $$RTEMS_FLAGS $$QMAKE_LFLAGS_GCSECTIONS
+
+QMAKE_CC = $${rtems_compiler}-gcc
+QMAKE_CXX = $${rtems_compiler}-g++
+QMAKE_AR = $${rtems_compiler}-ar cqs
+QMAKE_OBJCOPY = $${rtems_compiler}-objcopy
+QMAKE_NM = $${rtems_compiler}-nm -P
+QMAKE_RANLIB = $${rtems_compiler}-ranlib
+QMAKE_STRIP = $${rtems_compiler}-strip
+
+QMAKE_LINK_C = $$QMAKE_CC
+QMAKE_LINK_C_SHLIB =
+
+QMAKE_LINK = $$QMAKE_CXX
+QMAKE_LINK_SHLIB =
+
+load(qt_config)
diff --git a/src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h b/mkspecs/common/rtems/qplatformdefs.h
index 5abd3262dc..b4ec1de87f 100644
--- a/src/plugins/platforms/mirclient/qmirclientorientationchangeevent_p.h
+++ b/mkspecs/common/rtems/qplatformdefs.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2018 The Qt Company. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,25 +37,36 @@
**
****************************************************************************/
+#ifndef Q_RTEMS_PLATFORMDEFS_H
+#define Q_RTEMS_PLATFORMDEFS_H
-#ifndef QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
-#define QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
+// Get Qt defines/settings
-#include <QEvent>
-#include "qmirclientlogging.h"
+#include "qglobal.h"
-class OrientationChangeEvent : public QEvent {
-public:
- enum Orientation { TopUp, LeftUp, TopDown, RightUp };
+#include <pthread.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/select.h>
- OrientationChangeEvent(QEvent::Type type, Orientation orientation)
- : QEvent(type)
- , mOrientation(orientation)
- {
- }
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
- static const QEvent::Type mType;
- Orientation mOrientation;
-};
+#include <pwd.h>
+#include <grp.h>
-#endif // QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
+#define __LINUX_ERRNO_EXTENSIONS__
+#include <errno.h>
+
+#include "../posix/qplatformdefs.h"
+
+#ifdef __STRICT_ANSI__
+#undef __STRICT_ANSI__
+#endif
+
+#undef QT_OPEN_LARGEFILE
+#define QT_OPEN_LARGEFILE 0
+
+#endif // Q_RTEMS_PLATFORMDEFS_H
diff --git a/mkspecs/devices/linux-imx8-g++/qmake.conf b/mkspecs/devices/linux-imx8-g++/qmake.conf
new file mode 100644
index 0000000000..17e6c884e9
--- /dev/null
+++ b/mkspecs/devices/linux-imx8-g++/qmake.conf
@@ -0,0 +1,41 @@
+#
+# qmake configuration for the NXP i.MX8 based boards (64-bit)
+#
+# The configuration below is set up for running with the fbdev-style
+# Vivante graphics stack. (so eglfs with the eglfs_viv backend, no
+# direct drm use via eglfs_kms)
+
+# Wayland should also be functional. However, when writing Wayland
+# *compositors* with Qt, the eglfs backend will have to be switched to
+# eglfs_viv_wl by setting the QT_QPA_EGLFS_INTEGRATION environment
+# variable.
+#
+# Below is an example configure line that assumes there is an AArch64
+# toolchain and sysroot available in $HOME/imx8. On device Qt is
+# expected to be placed under /usr/local/qt514 whereas on the host
+# 'make install' will copy the host tools and the target libraries to
+# $HOME/imx8/qt5.
+#
+# ./configure -release -opengl es2 -device linux-imx8-g++ \
+# -device-option CROSS_COMPILE=~/imx8/toolchain/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux- \
+# -sysroot ~/imx8/sysroot \
+# -opensource -confirm-license -make libs -prefix /usr/local/qt514 -extprefix ~/imx8/qt5 -v
+
+include(../common/linux_device_pre.conf)
+
+QMAKE_LIBS_EGL += -lEGL
+QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
+QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL
+
+IMX8_CFLAGS = -march=armv8-a -mtune=cortex-a72.cortex-a53 -DLINUX=1 -DEGL_API_FB=1
+QMAKE_CFLAGS += $$IMX8_CFLAGS
+QMAKE_CXXFLAGS += $$IMX8_CFLAGS
+
+DISTRO_OPTS += aarch64
+
+# Preferred eglfs backend
+EGLFS_DEVICE_INTEGRATION = eglfs_viv
+
+include(../common/linux_arm_device_post.conf)
+
+load(qt_config)
diff --git a/src/plugins/platforms/mirclient/qmirclientdesktopwindow.h b/mkspecs/devices/linux-imx8-g++/qplatformdefs.h
index 3ba54db826..6a35ed45d5 100644
--- a/src/plugins/platforms/mirclient/qmirclientdesktopwindow.h
+++ b/mkspecs/devices/linux-imx8-g++/qplatformdefs.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,17 +37,4 @@
**
****************************************************************************/
-
-#ifndef QMIRCLIENTDESKTOPWINDOW_H
-#define QMIRCLIENTDESKTOPWINDOW_H
-
-#include <qpa/qplatformwindow.h>
-
-// TODO Implement it. For now it's just an empty, dummy class.
-class QMirClientDesktopWindow : public QPlatformWindow
-{
-public:
- QMirClientDesktopWindow(QWindow*);
-};
-
-#endif // QMIRCLIENTDESKTOPWINDOW_H
+#include "../../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf
new file mode 100644
index 0000000000..69b0c761a8
--- /dev/null
+++ b/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf
@@ -0,0 +1,40 @@
+# qmake configuration for the Raspberry Pi 4 (32-bit) using the Mesa V3D
+# graphics stack. (not the Broadcom stack)
+#
+# This supports accelerated OpenGL both for X11 and DRM/KMS. Perhaps
+# Wayland too.
+#
+# Tested with a sysroot created from Raspbian Buster and a gcc 7.4
+# toolchain from Linaro.
+#
+# Example configure command line, assuming installation to
+# /usr/local/qt5pi on device and ~/rpi/qt5 on the host:
+#
+# ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=~/rpi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- \
+# -sysroot ~/rpi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/rpi/qt5 -v
+#
+# Check the configure output carefully. EGLFS, EGLFS GBM, and EGL on X11
+# should all be 'yes'. Otherwise something is wrong.
+#
+# If getting linker errors like "undefined reference to `_dl_stack_flags'" check the
+# symlinks in the sysroot, they were probably not adjusted
+# correctly. F.ex. sysroot/usr/lib/arm-linux-gnueabihf/libpthread.so must point to
+# sysroot/lib/arm-linux-gnueabihf/libpthread.so.0. If it is a broken link instead, bad
+# things will happen.
+
+include(../common/linux_device_pre.conf)
+
+QMAKE_LIBS_EGL += -lEGL
+QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL
+
+QMAKE_CFLAGS = -march=armv8-a -mtune=cortex-a72 -mfpu=crypto-neon-fp-armv8
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+
+DISTRO_OPTS += hard-float
+DISTRO_OPTS += deb-multi-arch
+
+EGLFS_DEVICE_INTEGRATION = eglfs_kms
+
+include(../common/linux_arm_device_post.conf)
+
+load(qt_config)
diff --git a/src/plugins/platforms/mirclient/qmirclienttheme.h b/mkspecs/devices/linux-rasp-pi4-v3d-g++/qplatformdefs.h
index 4bab1d0ee0..4435fb2557 100644
--- a/src/plugins/platforms/mirclient/qmirclienttheme.h
+++ b/mkspecs/devices/linux-rasp-pi4-v3d-g++/qplatformdefs.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,21 +37,4 @@
**
****************************************************************************/
-
-#ifndef QMIRCLIENTTHEME_H
-#define QMIRCLIENTTHEME_H
-
-#include <QtThemeSupport/private/qgenericunixthemes_p.h>
-
-class QMirClientTheme : public QGenericUnixTheme
-{
-public:
- static const char* name;
- QMirClientTheme();
- virtual ~QMirClientTheme();
-
- // From QPlatformTheme
- QVariant themeHint(ThemeHint hint) const override;
-};
-
-#endif // QMIRCLIENTTHEME_H
+#include "../../linux-g++/qplatformdefs.h"
diff --git a/mkspecs/features/android/android.prf b/mkspecs/features/android/android.prf
index 1dc8f87313..fc0ff553d0 100644
--- a/mkspecs/features/android/android.prf
+++ b/mkspecs/features/android/android.prf
@@ -1,14 +1,49 @@
-contains(TEMPLATE, ".*app") {
- !android_app {
- !contains(TARGET, ".so"): TARGET = lib$${TARGET}.so
- QMAKE_LFLAGS += -Wl,-soname,$$shell_quote($$TARGET)
-
- android_install {
- target.path=/libs/$$ANDROID_TARGET_ARCH/
- INSTALLS *= target
+APK_PATH = $$shell_path($$OUT_PWD/android-build/$${TARGET}.apk)
+!contains(TEMPLATE, subdirs): {
+ apk_install_target.target = apk_install_target
+ apk_install_target.depends = first
+ apk_install_target.commands = $(MAKE) -f $(MAKEFILE) INSTALL_ROOT=$$OUT_PWD/android-build install
+
+ qtPrepareTool(ANDROIDDEPLOYQT, androiddeployqt)
+ isEmpty(ANDROID_DEPLOYMENT_SETTINGS_FILE): ANDROID_DEPLOYMENT_SETTINGS_FILE = $$OUT_PWD/android-$$TARGET-deployment-settings.json
+ contains(QMAKE_HOST.os, Windows): extension = .exe
+
+ apk.target = apk
+ apk.depends = apk_install_target
+ apk.commands = $$ANDROIDDEPLOYQT --input $$ANDROID_DEPLOYMENT_SETTINGS_FILE --output $$OUT_PWD/android-build --apk $$APK_PATH
+
+ aab.target = aab
+ aab.depends = apk_install_target
+ aab.commands = $$ANDROIDDEPLOYQT --input $$ANDROID_DEPLOYMENT_SETTINGS_FILE --output $$OUT_PWD/android-build --aab --apk $$APK_PATH
+} else {
+ prepareRecursiveTarget(aab)
+ prepareRecursiveTarget(apk)
+ prepareRecursiveTarget(apk_install_target)
+}
+
+build_pass {
+ contains(TEMPLATE, ".*app") {
+ !android_app {
+ !contains(TARGET, ".so") {
+ single_arch:TARGET = lib$${TARGET}.so
+ else:TARGET = lib$${TARGET}_$${QT_ARCH}.so
+ }
+ QMAKE_LFLAGS += -Wl,-soname,$$shell_quote($$TARGET)
+
+ android_install {
+ target.path=/libs/$$ANDROID_TARGET_ARCH/
+ INSTALLS *= target
+ }
}
+ } else: contains(TEMPLATE, "lib"):!static:!QTDIR_build:android_install {
+ target.path = /libs/$$ANDROID_TARGET_ARCH/
+ INSTALLS *= target
}
-} else: contains(TEMPLATE, "lib"):!static:!QTDIR_build:android_install {
- target.path = /libs/$$ANDROID_TARGET_ARCH/
- INSTALLS *= target
+} else {
+ QMAKE_EXTRA_TARGETS *= aab apk apk_install_target
+
+ android-build-distclean.commands = \
+ $$QMAKE_DEL_TREE $$shell_quote($$shell_path($$OUT_PWD/android-build))
+ QMAKE_EXTRA_TARGETS *= android-build-distclean
+ CLEAN_DEPS += android-build-distclean
}
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf
index 48943fa0f4..4d6101e297 100644
--- a/mkspecs/features/android/android_deployment_settings.prf
+++ b/mkspecs/features/android/android_deployment_settings.prf
@@ -17,32 +17,21 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
FILE_CONTENT += " \"ndk\": $$emitString($$NDK_ROOT),"
- equals(ANDROID_USE_LLVM, true) {
- FILE_CONTENT += " \"toolchain-prefix\": \"llvm\","
- FILE_CONTENT += " \"tool-prefix\": \"llvm\","
- } else {
- NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
- isEmpty(NDK_TOOLCHAIN_PREFIX) {
- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
- else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
- else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
- }
- FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX),"
- FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX),"
- }
-
- NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION)
- isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION
- FILE_CONTENT += " \"toolchain-version\": $$emitString($$NDK_TOOLCHAIN_VERSION),"
+ FILE_CONTENT += " \"toolchain-prefix\": \"llvm\","
+ FILE_CONTENT += " \"tool-prefix\": \"llvm\","
NDK_HOST = $$(ANDROID_NDK_HOST)
isEmpty(NDK_HOST): NDK_HOST = $$DEFAULT_ANDROID_NDK_HOST
FILE_CONTENT += " \"ndk-host\": $$emitString($$NDK_HOST),"
- ANDROID_TARGET_ARCH = $$(ANDROID_TARGET_ARCH)
- isEmpty(ANDROID_TARGET_ARCH): ANDROID_TARGET_ARCH = $$DEFAULT_ANDROID_TARGET_ARCH
- FILE_CONTENT += " \"target-architecture\": $$emitString($$ANDROID_TARGET_ARCH),"
+ for (arch, ANDROID_ABIS) {
+ equals(arch, x86): libs_arch = i686-linux-android
+ else: equals(arch, x86_64): libs_arch = x86_64-linux-android
+ else: equals(arch, arm64-v8a): libs_arch = aarch64-linux-android
+ else: libs_arch = arm-linux-androideabi
+ ARCHS += "$$emitString($$arch):$$emitString($$libs_arch)"
+ }
+ FILE_CONTENT += " \"architectures\": {$$join(ARCHS,", ")},"
# Explicitly set qt dependencies of application for deployment
!isEmpty(ANDROID_DEPLOYMENT_DEPENDENCIES): \
@@ -74,13 +63,11 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
QML_ROOT_PATH = $$_PRO_FILE_PWD_
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH),"
- FILE_CONTENT += " \"useLLVM\": $$ANDROID_USE_LLVM,"
-
- FILE_CONTENT += " \"application-binary\": $$emitString($$absolute_path($$DESTDIR, $$OUT_PWD)/$$TARGET)"
+ FILE_CONTENT += ""
+ FILE_CONTENT += " \"application-binary\": $$emitString($$TARGET)"
FILE_CONTENT += "}"
isEmpty(ANDROID_DEPLOYMENT_SETTINGS_FILE): ANDROID_DEPLOYMENT_SETTINGS_FILE = $$OUT_PWD/android-$$TARGET-deployment-settings.json
write_file($$ANDROID_DEPLOYMENT_SETTINGS_FILE, FILE_CONTENT)|error()
}
-
diff --git a/mkspecs/features/android/default_pre.prf b/mkspecs/features/android/default_pre.prf
new file mode 100644
index 0000000000..a73cd4b39c
--- /dev/null
+++ b/mkspecs/features/android/default_pre.prf
@@ -0,0 +1,77 @@
+load(default_pre)
+
+build_pass:armeabi-v7a {
+ QT_ARCH = armeabi-v7a
+} else:build_pass:arm64-v8a {
+ QT_ARCH = arm64-v8a
+} else:build_pass:x86 {
+ QT_ARCH = x86
+} else:build_pass:x86_64 {
+ QT_ARCH = x86_64
+} else {
+ # default architecture
+ QT_ARCH = arm64-v8a
+}
+
+DEFAULT_ANDROID_TARGET_ARCH=$${QT_ARCH}
+
+ANDROID_TARGET_ARCH = $$(ANDROID_TARGET_ARCH)
+isEmpty(ANDROID_TARGET_ARCH): ANDROID_TARGET_ARCH = $$DEFAULT_ANDROID_TARGET_ARCH
+
+# Follow https://android.googlesource.com/platform/ndk/+/ndk-release-r20/docs/BuildSystemMaintainers.md
+
+equals(ANDROID_TARGET_ARCH, armeabi-v7a): \
+ QMAKE_CFLAGS = -target armv7a-linux-androideabi$$replace(ANDROID_PLATFORM, "android-", "")
+else: equals(ANDROID_TARGET_ARCH, arm64-v8a): \
+ QMAKE_CFLAGS = -target aarch64-linux-android$$replace(ANDROID_PLATFORM, "android-", "")
+else: equals(ANDROID_TARGET_ARCH, x86): \
+ QMAKE_CFLAGS = -target i686-linux-android$$replace(ANDROID_PLATFORM, "android-", "") -mstackrealign
+else: equals(ANDROID_TARGET_ARCH, x86_64): \
+ QMAKE_CFLAGS = -target x86_64-linux-android$$replace(ANDROID_PLATFORM, "android-", "")
+
+QMAKE_CFLAGS += -fno-limit-debug-info
+
+QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS
+
+ANDROID_STDCPP_PATH = $$NDK_LLVM_PATH/sysroot/usr/lib/
+
+# -fstack-protector-strong offers good protection against stack smashing attacks.
+# It is (currently) enabled only on Android because we know for sure that Android compilers supports it
+QMAKE_CFLAGS += -fPIC -fstack-protector-strong -DANDROID
+
+
+equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) {
+ CONFIG += optimize_size
+ QMAKE_CFLAGS_DEBUG = -g -marm -O0
+ QMAKE_CFLAGS_RELEASE += -mthumb
+ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -mthumb
+}
+
+QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+
+QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
+QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
+QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
+QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
+QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
+QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
+
+QMAKE_LIBS_EGL = -lEGL
+QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
+
+QMAKE_STRIP =
+#$${CROSS_COMPILE}strip
+
+
+equals(QT_ARCH, x86): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/i686-linux-android-
+else: equals(QT_ARCH, x86_64): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/x86_64-linux-android-
+else: equals(QT_ARCH, arm64-v8a): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/aarch64-linux-android-
+else: CROSS_COMPILE = $$NDK_LLVM_PATH/bin/arm-linux-androideabi-
+
+QMAKE_RANLIB = $${CROSS_COMPILE}ranlib
+QMAKE_LINK_SHLIB = $$QMAKE_LINK
+QMAKE_LFLAGS =
+
+QMAKE_LIBS_PRIVATE = -llog -lz -lm -ldl -lc
diff --git a/mkspecs/features/android/resolve_config.prf b/mkspecs/features/android/resolve_config.prf
new file mode 100644
index 0000000000..0cc4e73cc9
--- /dev/null
+++ b/mkspecs/features/android/resolve_config.prf
@@ -0,0 +1,10 @@
+load(resolve_config)
+
+!equals(TEMPLATE, aux):!host_build:!single_arch:!java:android {
+ isEmpty(ANDROID_ABIS): ANDROID_ABIS = $$ALL_ANDROID_ABIS
+
+ ALL_ABIS = $$join(ANDROID_ABIS, _and_)
+ CONFIG += $$ALL_ABIS build_all
+ addExclusiveBuildsProper($$ALL_ABIS, $$ANDROID_ABIS)
+ unset(ALL_ABIS)
+}
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 314cd5cc67..346fbf2467 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -42,6 +42,9 @@ CMAKE_INCLUDE_NAME = $$eval(QT.$${MODULE}.name)
# (or QtCore_{libinfix_suffix}, Foo_{libinfix_suffix} on macos with -framework).
CMAKE_QT_STEM = $${TARGET}
+# ANDROID_ABI is set by the android toolchain file, see https://developer.android.com/ndk/guides/cmake
+android: CMAKE_QT_STEM = $$replace(CMAKE_QT_STEM, "_$${QT_ARCH}", '_\$\{ANDROID_ABI\}')
+
# On macOS when building just a debug configuration which is not part of debug_and_release,
# $${TARGET} already contains a _debug suffix, as per the following call chain:
# qt_module.prf -> qt5LibraryTarget -> qtLibraryTarget -> qtPlatformTargetSuffix.
@@ -138,8 +141,8 @@ CMAKE_RELEASE_TYPE =
# the debug libraries at build time.
equals(QMAKE_HOST.os, Windows): CMAKE_BIN_SUFFIX = ".exe"
-if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug
-if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release
+if(debug_and_release:build_all)|CONFIG(debug, debug|release): CMAKE_DEBUG_TYPE = debug
+if(debug_and_release:build_all)|CONFIG(release, debug|release): CMAKE_RELEASE_TYPE = release
# CMAKE_DEBUG_AND_RELEASE is used to tell the _populate_$${CMAKE_MODULE_NAME}_target_properties
# functions whether a Configuration specific generator expression needs to be added to the values
@@ -153,67 +156,109 @@ if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release
# <CONFIG> equivalent to the value specified by CMAKE_BUILD_TYPE.
# This means that when Qt was built in a Release configuration, and the application in a Debug
# configuration, IMPORTED_LOCATION_RELEASE will be used for the Qt libraries.
-debug_and_release {
+#
+# Note that we need to check for the "debug_and_release" feature, and not the CONFIG value, because
+# the CONFIG value is always set to true on Windows in msvc-desktop.conf disregarding whether the
+# configure line specified just -debug or just -release.
+# This also means that if a user configures and builds Qt with -release, and then calls nmake debug
+# to build debug libraries of Qt, the generated CMake file won't know about debug libraries,
+# and will always link against the release libraries.
+qtConfig(debug_and_release) {
CMAKE_DEBUG_AND_RELEASE = TRUE
} else {
CMAKE_DEBUG_AND_RELEASE = FALSE
}
contains(CONFIG, plugin) {
- !isEmpty(PLUGIN_EXTENDS):!equals(PLUGIN_EXTENDS, -) {
- count(PLUGIN_EXTENDS, 1, greaterThan): \
- error("Plugin declares to extend multiple modules. We don't handle that ...")
- PLUGIN_MODULE_NAME = $$PLUGIN_EXTENDS
+ equals(PLUGIN_EXTENDS, -) {
+ CMAKE_PLUGIN_EXTENDS = -
} else {
- PLUGIN_MODULE_NAME =
- for (mod, QT_MODULES) {
- contains(QT.$${mod}.plugin_types, $$PLUGIN_TYPE) {
- !isEmpty(PLUGIN_MODULE_NAME): \
- error("Multiple modules claim plugin type '$$PLUGIN_TYPE' ($$mod, in addition to $$PLUGIN_MODULE_NAME)")
- PLUGIN_MODULE_NAME = $$mod
- break()
- }
+ list_plugin_extends =
+ for (p, PLUGIN_EXTENDS) {
+ m = $$cmakeModuleName($$p)
+ list_plugin_extends += Qt5::$$m
+ }
+ CMAKE_PLUGIN_EXTENDS = $$join(list_plugin_extends, ";")
+ }
+
+ PLUGIN_MODULE_NAME =
+ unique_qt_modules = $$unique(QT_MODULES) # In case modules appear in multiple places
+ for (mod, unique_qt_modules) {
+ contains(QT.$${mod}.plugin_types, $$PLUGIN_TYPE) {
+ !isEmpty(PLUGIN_MODULE_NAME): \
+ error("Multiple modules claim plugin type '$$PLUGIN_TYPE' ($$mod, in addition to $$PLUGIN_MODULE_NAME)")
+ PLUGIN_MODULE_NAME = $$mod
}
- isEmpty(PLUGIN_MODULE_NAME): error("No module claims plugin type '$$PLUGIN_TYPE'")
}
+ isEmpty(PLUGIN_MODULE_NAME): error("No module claims plugin type '$$PLUGIN_TYPE'")
+
+ sorted_deps = $$sort_depends(QT_PLUGIN.$${CMAKE_QT_STEM}.DEPENDS, QT.)
+ mod_deps =
+ lib_deps =
+ aux_mod_deps =
+ aux_lib_deps =
+ for (dep, sorted_deps) {
+ cdep = $$cmakeModuleName($$dep)
+ mod_deps += $$cdep
+ lib_deps += Qt5::$$cdep
+ }
+ CMAKE_PLUGIN_MODULE_DEPS = $$join(mod_deps, ";")
+ CMAKE_PLUGIN_QT5_MODULE_DEPS = $$join(lib_deps, ";")
CMAKE_MODULE_NAME = $$cmakeModuleName($$PLUGIN_MODULE_NAME)
CMAKE_PLUGIN_NAME = $$PLUGIN_CLASS_NAME
+ CMAKE_PLUGIN_TYPE = $$PLUGIN_TYPE
+ CMAKE_PLUGIN_TYPE_ESCAPED = $$replace(PLUGIN_TYPE, [-/], _)
win32 {
isEmpty(CMAKE_STATIC_TYPE) {
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.dll
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.dll
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.dll
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.dll
+ CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
+ CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
} else:mingw {
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}.a
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}d.a
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.a
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.a
+ CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
+ CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}d.prl
} else { # MSVC static
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${TARGET}.lib
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${TARGET}d.lib
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.lib
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.lib
+ CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}.prl
+ CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/$${CMAKE_QT_STEM}d.prl
}
} else {
mac {
- isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .dylib
- else: CMAKE_PlUGIN_EXT = .a
+ isEmpty(CMAKE_STATIC_TYPE): CMAKE_PLUGIN_EXT = .dylib
+ else: CMAKE_PLUGIN_EXT = .a
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${CMAKE_PLUGIN_EXT}
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}_debug$${CMAKE_PLUGIN_EXT}
+ CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
+ CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}_debug.prl
} else {
- isEmpty(CMAKE_STATIC_TYPE): CMAKE_PlUGIN_EXT = .so
- else: CMAKE_PlUGIN_EXT = .a
+ isEmpty(CMAKE_STATIC_TYPE): CMAKE_PLUGIN_EXT = .so
+ else: CMAKE_PLUGIN_EXT = .a
- CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
- CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${TARGET}$${CMAKE_PlUGIN_EXT}
+ CMAKE_PLUGIN_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${CMAKE_PLUGIN_EXT}
+ CMAKE_PLUGIN_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}$${CMAKE_PLUGIN_EXT}
+ CMAKE_PRL_FILE_LOCATION_RELEASE = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
+ CMAKE_PRL_FILE_LOCATION_DEBUG = $$PLUGIN_TYPE/lib$${CMAKE_QT_STEM}.prl
}
}
cmake_target_file.input = $$PWD/data/cmake/Qt5PluginTarget.cmake.in
cmake_target_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}.cmake
+ cmake_qt5_plugin_import_file.input = $$PWD/data/cmake/Qt5ImportPlugin.cpp.in
+ cmake_qt5_plugin_import_file.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/Qt5$${CMAKE_MODULE_NAME}_$${PLUGIN_CLASS_NAME}_Import.cpp
- !build_pass:QMAKE_SUBSTITUTES += \
- cmake_target_file
+ !build_pass {
+ QMAKE_SUBSTITUTES += cmake_target_file
+ static|staticlib: QMAKE_SUBSTITUTES += cmake_qt5_plugin_import_file
+ }
cmake_qt5_plugin_file.files = $$cmake_target_file.output
+ static|staticlib: cmake_qt5_plugin_file.files += $$cmake_qt5_plugin_import_file.output
cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
INSTALLS += cmake_qt5_plugin_file
@@ -244,6 +289,7 @@ CMAKE_MODULE_DEPS = $$join(mod_deps, ";")
CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";")
CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";")
CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
+CMAKE_MODULE_PLUGIN_TYPES = $$join(QT.$${MODULE}.plugin_types, ";")
mac {
!isEmpty(CMAKE_STATIC_TYPE) {
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index f4a34d6e48..364c23e750 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -321,6 +321,22 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
!!ENDIF // TEMPLATE != aux
+ # It can happen that the same FooConfig.cmake file is included when calling find_package()
+ # on some Qt component. An example of that is when using a Qt static build with auto inclusion
+ # of plugins:
+ #
+ # Qt5WidgetsConfig.cmake -> Qt5GuiConfig.cmake -> Qt5Gui_QSvgIconPlugin.cmake ->
+ # Qt5SvgConfig.cmake -> Qt5WidgetsConfig.cmake ->
+ # finish processing of second Qt5WidgetsConfig.cmake ->
+ # return to first Qt5WidgetsConfig.cmake ->
+ # add_library cannot create imported target "Qt5::Widgets".
+ #
+ # Make sure to return early in the original Config inclusion, because the target has already
+ # been defined as part of the second inclusion.
+ if(TARGET Qt5::$${CMAKE_MODULE_NAME})
+ return()
+ endif()
+
set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS}\")
!!IF !isEmpty(CMAKE_INTERFACE_QT5_MODULE_DEPS)
@@ -385,6 +401,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_ENABLED_FEATURES $$join(QT.$${MODULE}.enabled_features, ";"))
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_DISABLED_FEATURES $$join(QT.$${MODULE}.disabled_features, ";"))
+ set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY INTERFACE_QT_PLUGIN_TYPES \"$${CMAKE_MODULE_PLUGIN_TYPES}\")
+
set(_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIRS_EXIST TRUE)
foreach (_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR ${Qt5$${CMAKE_MODULE_NAME}_OWN_PRIVATE_INCLUDE_DIRS})
if (NOT EXISTS ${_Qt5$${CMAKE_MODULE_NAME}_PRIVATE_DIR})
@@ -492,7 +510,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
- macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION)
+ macro(_populate_$${CMAKE_MODULE_NAME}_plugin_properties Plugin Configuration PLUGIN_LOCATION
+ IsDebugAndRelease)
set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
@@ -504,6 +523,36 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set_target_properties(Qt5::${Plugin} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
)
+
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
+ set(_static_deps
+ ${_Qt5${Plugin}_STATIC_${Configuration}_LIB_DEPENDENCIES}
+ )
+
+ if(NOT "${IsDebugAndRelease}")
+ set(_genex_condition \"1\")
+ else()
+ if("${Configuration}" STREQUAL "DEBUG")
+ set(_genex_condition \"$<CONFIG:Debug>\")
+ else()
+ set(_genex_condition \"$<NOT:$<CONFIG:Debug>>\")
+ endif()
+ endif()
+ if(_static_deps)
+ set(_static_deps_genex \"$<${_genex_condition}:${_static_deps}>\")
+ set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
+ \"${_static_deps_genex}\"
+ )
+ endif()
+
+ set(_static_link_flags \"${_Qt5${Plugin}_STATIC_${Configuration}_LINK_FLAGS}\")
+ if(NOT CMAKE_VERSION VERSION_LESS \"3.13\" AND _static_link_flags)
+ set(_static_link_flags_genex \"$<${_genex_condition}:${_static_link_flags}>\")
+ set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_OPTIONS
+ \"${_static_link_flags_genex}\"
+ )
+ endif()
+!!ENDIF
endmacro()
if (pluginTargets)
diff --git a/mkspecs/features/data/cmake/Qt5ImportPlugin.cpp.in b/mkspecs/features/data/cmake/Qt5ImportPlugin.cpp.in
new file mode 100644
index 0000000000..6e27f7a260
--- /dev/null
+++ b/mkspecs/features/data/cmake/Qt5ImportPlugin.cpp.in
@@ -0,0 +1,2 @@
+#include <QtPlugin>
+Q_IMPORT_PLUGIN($$CMAKE_PLUGIN_NAME)
diff --git a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
index 5baf0fdb10..7b70cfed09 100644
--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
@@ -1,11 +1,102 @@
add_library(Qt5::$$CMAKE_PLUGIN_NAME MODULE IMPORTED)
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
+set(_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_PLUGIN_MODULE_DEPS}\")
+
+foreach(_module_dep ${_Qt5$${CMAKE_PLUGIN_NAME}_MODULE_DEPENDENCIES})
+ if(NOT Qt5${_module_dep}_FOUND)
+ find_package(Qt5${_module_dep}
+ $$VERSION ${_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT}
+ ${_Qt5$${CMAKE_MODULE_NAME}_DEPENDENCIES_FIND_QUIET}
+ ${_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED}
+ PATHS \"${CMAKE_CURRENT_LIST_DIR}/..\" NO_DEFAULT_PATH
+ )
+ endif()
+endforeach()
+
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\")
+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS
+)
+!!ELSE
+_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
+ \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_RELEASE}\" RELEASE
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LIB_DEPENDENCIES
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_RELEASE_LINK_FLAGS
+)
!!ENDIF
+!!ENDIF
+
!!IF !isEmpty(CMAKE_DEBUG_TYPE)
-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\")
+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
+ \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS
+)
+!!ELSE
+_qt5_$${CMAKE_MODULE_NAME}_process_prl_file(
+ \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PRL_FILE_LOCATION_DEBUG}\" DEBUG
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LIB_DEPENDENCIES
+ _Qt5$${CMAKE_PLUGIN_NAME}_STATIC_DEBUG_LINK_FLAGS
+)
+!!ENDIF
+!!ENDIF
+
+set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
+ \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_$${CMAKE_PLUGIN_NAME}_Import.cpp\"
+)
+!!ENDIF
+
+!!IF !isEmpty(CMAKE_RELEASE_TYPE)
+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
+!!ENDIF
+!!IF !isEmpty(CMAKE_DEBUG_TYPE)
+_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
!!ENDIF
list(APPEND Qt5$${CMAKE_MODULE_NAME}_PLUGINS Qt5::$$CMAKE_PLUGIN_NAME)
+set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY QT_ALL_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED} Qt5::$${CMAKE_PLUGIN_NAME})
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
+# $<GENEX_EVAL:...> wasn\'t added until CMake 3.12, so put a version guard around it
+if(CMAKE_VERSION VERSION_LESS \"3.12\")
+ set(_manual_plugins_genex \"$<TARGET_PROPERTY:QT_PLUGINS>\")
+ set(_plugin_type_genex \"$<TARGET_PROPERTY:QT_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED}>\")
+ set(_no_plugins_genex \"$<TARGET_PROPERTY:QT_NO_PLUGINS>\")
+else()
+ set(_manual_plugins_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS>>\")
+ set(_plugin_type_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS_$${CMAKE_PLUGIN_TYPE_ESCAPED}>>\")
+ set(_no_plugins_genex \"$<GENEX_EVAL:$<TARGET_PROPERTY:QT_NO_PLUGINS>>\")
+endif()
+set(_user_specified_genex
+ \"$<IN_LIST:Qt5::$$CMAKE_PLUGIN_NAME,${_manual_plugins_genex};${_plugin_type_genex}>\"
+)
+string(CONCAT _plugin_genex
+ \"$<$<OR:\"
+ # Add this plugin if it\'s in the list of manual plugins or plugins for the type
+ \"${_user_specified_genex},\"
+ # Add this plugin if the list of plugins for the type is empty, the PLUGIN_EXTENDS
+ # is either empty or equal to the module name, and the user hasn\'t blacklisted it
+ \"$<AND:\"
+ \"$<STREQUAL:${_plugin_type_genex},>,\"
+ \"$<OR:\"
+ \"$<STREQUAL:$<TARGET_PROPERTY:Qt5::$${CMAKE_PLUGIN_NAME},QT_PLUGIN_EXTENDS>,Qt5::$${CMAKE_MODULE_NAME}>,\"
+ \"$<STREQUAL:$<TARGET_PROPERTY:Qt5::$${CMAKE_PLUGIN_NAME},QT_PLUGIN_EXTENDS>,>\"
+ \">,\"
+ \"$<NOT:$<IN_LIST:Qt5::$${CMAKE_PLUGIN_NAME},${_no_plugins_genex}>>\"
+ \">\"
+ \">:Qt5::$$CMAKE_PLUGIN_NAME>\"
+)
+set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
+ ${_plugin_genex}
+)
+set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} APPEND PROPERTY INTERFACE_LINK_LIBRARIES
+ \"$${CMAKE_PLUGIN_QT5_MODULE_DEPS}\"
+)
+!!ENDIF
+set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_TYPE \"$$CMAKE_PLUGIN_TYPE\")
+set_property(TARGET Qt5::$${CMAKE_PLUGIN_NAME} PROPERTY QT_PLUGIN_EXTENDS \"$$CMAKE_PLUGIN_EXTENDS\")
diff --git a/mkspecs/features/data/testserver/Dockerfile b/mkspecs/features/data/testserver/Dockerfile
new file mode 100644
index 0000000000..a20d289d3f
--- /dev/null
+++ b/mkspecs/features/data/testserver/Dockerfile
@@ -0,0 +1,29 @@
+# This Dockerfile is used to provision the shared scripts (e.g. startup.sh) and configurations. It
+# relies on the arguments passed by docker-compose file to build additional images for each service.
+# To lean more how it works, please check the topic "Use multi-stage builds".
+# https://docs.docker.com/develop/develop-images/multistage-build/
+
+ARG provisioningImage
+FROM $provisioningImage as testserver_tier2
+
+# Add and merge the testdata into service folder
+ARG serviceDir
+ARG shareDir=$serviceDir
+COPY $serviceDir $shareDir service/
+
+# create the shared script of testserver
+RUN echo "#!/usr/bin/env bash\n" \
+ "set -ex\n" \
+ "for RUN_CMD; do \$RUN_CMD; done\n" \
+ "service dbus restart\n" \
+ "service avahi-daemon restart\n" \
+ "sleep infinity\n" > startup.sh
+RUN chmod +x startup.sh
+
+# rewrite the default configurations of avahi-daemon
+# Disable IPv6 of avahi-daemon to resolve the unstable connections on Windows
+ARG test_domain
+RUN sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \
+ -e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \
+ -e "s,use-ipv6=yes,use-ipv6=no," \
+ /etc/avahi/avahi-daemon.conf
diff --git a/mkspecs/features/data/testserver/docker-compose-common.yml b/mkspecs/features/data/testserver/docker-compose-common.yml
new file mode 100644
index 0000000000..58282c1273
--- /dev/null
+++ b/mkspecs/features/data/testserver/docker-compose-common.yml
@@ -0,0 +1,38 @@
+version: '2.1'
+
+# This is a template docker-compose file shared with all modules. It is based
+# on 'extending services' feature of compose file version 2.1.
+# See https://docs.docker.com/compose/extends/#extending-services for details.
+#
+# Example: testserver/docker-compose.yml
+# services:
+# foo:
+# extends:
+# file: ${SHARED_DATA}/docker-compose-common.yml
+# service: ${SHARED_SERVICE}
+# container_name: qt-test-server-foo
+# hostname: ${HOST_NAME:-foo}
+# build:
+# context: .
+# args:
+# provisioningImage: qt-test-server-foo:537fe302f61851d1663...
+# serviceDir: ./foo
+# command: service/foo.sh
+
+x-services:
+ &default-service
+ domainname: ${TEST_DOMAIN}
+ build:
+ context: .
+ dockerfile: ${SHARED_DATA}/Dockerfile
+ args:
+ test_domain: ${TEST_DOMAIN}
+ entrypoint: ./startup.sh
+
+services:
+ bridge-network: *default-service
+ host-network:
+ << : *default-service
+ network_mode: "host"
+ extra_hosts:
+ - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf
index 1ff9a04d42..a41c5ab415 100644
--- a/mkspecs/features/exclusive_builds.prf
+++ b/mkspecs/features/exclusive_builds.prf
@@ -37,6 +37,9 @@ defineTest(addExclusiveBuilds) {
addExclusiveBuildsProper($$join(ARGS, _and_), $$ARGS)
}
-# Default directories to process
-QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR QGLTF_DIR DESTDIR TRACEGEN_DIR QMLCACHE_DIR LRELEASE_DIR
-QMAKE_DIR_REPLACE_SANE += QGLTF_DIR TRACEGEN_DIR QMLCACHE_DIR LRELEASE_DIR
+QMAKE_DEFAULT_DIRS_TO_PROCESS = QGLTF_DIR TRACEGEN_DIR QMLCACHE_DIR LRELEASE_DIR LEX_DIR YACC_DIR
+QMAKE_DIR_REPLACE_SANE += $$QMAKE_DEFAULT_DIRS_TO_PROCESS
+QMAKE_DIR_REPLACE = \
+ OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR \
+ $$QMAKE_DEFAULT_DIRS_TO_PROCESS
+unset(QMAKE_DEFAULT_DIRS_TO_PROCESS)
diff --git a/mkspecs/features/exclusive_builds_post.prf b/mkspecs/features/exclusive_builds_post.prf
index 936085af0b..a9c341a2d7 100644
--- a/mkspecs/features/exclusive_builds_post.prf
+++ b/mkspecs/features/exclusive_builds_post.prf
@@ -1,4 +1,6 @@
+load(qt_functions)
+
contains(TEMPLATE, subdirs) {
for(build, QMAKE_EXCLUSIVE_BUILDS) {
prepareRecursiveTarget($$build)
diff --git a/mkspecs/features/lex.prf b/mkspecs/features/lex.prf
index 7d8325bedb..ee06215103 100644
--- a/mkspecs/features/lex.prf
+++ b/mkspecs/features/lex.prf
@@ -2,37 +2,49 @@
# Lex extra-compiler for handling files specified in the LEXSOURCES variable
#
-{
- lex.name = Lex ${QMAKE_FILE_IN}
- lex.input = LEXSOURCES
- lex.dependency_type = TYPE_C
- lex_included {
- lex.CONFIG += no_link
- } else {
- lex.variable_out = GENERATED_SOURCES
- }
+isEmpty(LEX_DIR): LEX_DIR = .
- isEmpty(QMAKE_LEXFLAGS_MANGLE):QMAKE_LEXFLAGS_MANGLE = -P${QMAKE_FILE_BASE}
+defineReplace(lexCommands) {
+ input = $$relative_path($$absolute_path($$1, $$OUT_PWD), $$OUT_PWD/$$LEX_DIR)
+ output = $$basename(2)
+ input_base = $$basename(1)
+ input_base ~= s/\.[^.]*$//
+
+ isEmpty(QMAKE_LEXFLAGS_MANGLE): QMAKE_LEXFLAGS_MANGLE = -P$${input_base}
QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS
- !yacc_no_name_mangle:QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE
+ !yacc_no_name_mangle: QMAKE_LEXEXTRAFLAGS += $$QMAKE_LEXFLAGS_MANGLE
contains(QMAKE_LEX, .*flex) {
# GNU flex, we can use -o outfile
- lex.commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS --nounistd -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+ commands = $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS --nounistd -o $$output $$input
} else {
# stupid POSIX lex, it only generates a file called lex.yy.c
# or lex.prefix.c if the -P<prefix> option is active
intermediate_file = lex.yy.c
QMAKE_LEXEXTRAFLAGS = $$QMAKE_LEXFLAGS $$QMAKE_LEXFLAGS_MANGLE
- lex.commands = \
- -$(DEL_FILE) ${QMAKE_FILE_OUT}$$escape_expand(\\n\\t) \
- $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \
- $(MOVE) $$intermediate_file ${QMAKE_FILE_OUT} $$escape_expand(\\n\\t)
- unset(intermediate_file)
+ commands = \
+ -$(DEL_FILE) $${output}$$escape_expand(\\n\\t) \
+ $$QMAKE_LEX $$QMAKE_LEXEXTRAFLAGS $${input}$$escape_expand(\\n\\t) \
+ $(MOVE) $$intermediate_file $$output $$escape_expand(\\n\\t)
+ }
+ !equals(LEX_DIR, .): \
+ commands = cd $$LEX_DIR && $$commands
+ silent: commands = @echo Lex $$1 && $$commands
+ return($$commands)
+}
+
+{
+ lex.name = Lex ${QMAKE_FILE_IN}
+ lex.input = LEXSOURCES
+ lex.dependency_type = TYPE_C
+ lex_included {
+ lex.CONFIG += no_link
+ } else {
+ lex.variable_out = GENERATED_SOURCES
}
- lex.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_LEX}$${first(QMAKE_EXT_CPP)}
- silent:lex.commands = @echo Lex ${QMAKE_FILE_IN} && $$lex.commands
+ lex.commands = ${QMAKE_FUNC_lexCommands}
+ lex.output = $$LEX_DIR/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_LEX}$${first(QMAKE_EXT_CPP)}
QMAKE_EXTRA_COMPILERS += lex
}
diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf
index 5fa6309016..d81f340edd 100644
--- a/mkspecs/features/ltcg.prf
+++ b/mkspecs/features/ltcg.prf
@@ -10,7 +10,7 @@ static:no-static-ltcg {
# We need fat object files when creating static libraries on some platforms
# so the linker will know to load a particular object from the library
# in the first place. On others, we have special ar and nm to create the symbol
- # tables so the linker will know better. For other compilers, we disable LTCG
+ # tables so the linker will know better. For other compilers, we disable LTCG
# for static libraries.
msvc {
# Nothing to do
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 993f4d56a9..03084c7f07 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -71,7 +71,8 @@ qt {
# Add the same default rpaths as Xcode does for new projects.
# This is especially important for iOS/tvOS/watchOS where no other option is possible.
!no_default_rpath {
- QMAKE_RPATHDIR += @executable_path/../Frameworks
+ uikit: QMAKE_RPATHDIR += @executable_path/Frameworks
+ else: QMAKE_RPATHDIR += @executable_path/../Frameworks
equals(TEMPLATE, lib):!plugin:lib_bundle: QMAKE_RPATHDIR += @loader_path/Frameworks
}
diff --git a/mkspecs/features/mac/no_warn_empty_obj_files.prf b/mkspecs/features/mac/no_warn_empty_obj_files.prf
new file mode 100644
index 0000000000..598938ab12
--- /dev/null
+++ b/mkspecs/features/mac/no_warn_empty_obj_files.prf
@@ -0,0 +1,7 @@
+# Prevent warnings about object files without any symbols. This is a common
+# thing in Qt as we tend to build files unconditionally, and then use ifdefs
+# to compile out parts that are not relevant.
+QMAKE_RANLIB += -no_warning_for_no_symbols
+
+# We have to tell 'ar' to not run ranlib by itself
+QMAKE_AR += -S
diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf
index 64faa4f215..8475e4111a 100644
--- a/mkspecs/features/qmake_use.prf
+++ b/mkspecs/features/qmake_use.prf
@@ -22,7 +22,13 @@ for(ever) {
!defined(QMAKE_LIBS_$$nu, var): \
error("Library '$$lower($$replace(nu, _, -))' is not defined.")
- debug: \
+ QMAKE_LIBDIR += $$eval(QMAKE_LIBDIR_$$nu)
+
+ android {
+ ABI_LIBS = $$eval(QMAKE_LIBS_$${nu}_$${QT_ARCH})
+ isEmpty(ABI_LIBS): ABI_LIBS = $$eval(QMAKE_LIBS_$${nu})
+ LIBS$${suffix} += $$ABI_LIBS
+ } else: debug: \
LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu)
else: \
LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_RELEASE) $$eval(QMAKE_LIBS_$$nu)
diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
index 57cfec78b3..c0b50416c9 100644
--- a/mkspecs/features/qml_module.prf
+++ b/mkspecs/features/qml_module.prf
@@ -52,15 +52,26 @@ builtin_resources {
qmldir.base = $$qmldir_path
qmldir.files = $$qmldir_file
qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
-INSTALLS += qmldir
qmlfiles.base = $$_PRO_FILE_PWD_
qmlfiles.files = $$fq_aux_qml_files
install_qml_files: qmlfiles.files += $$fq_qml_files
qmlfiles.path = $${qmldir.path}
-INSTALLS += qmlfiles
-!debug_and_release|!build_all|CONFIG(release, debug|release) {
+INSTALL_QML_FILES = false
+
+android {
+ build_pass {
+ isEmpty(ANDROID_ABIS): ANDROID_ABIS = $$ALL_ANDROID_ABIS
+ ABI = $$first(ANDROID_ABIS)
+ equals(ABI, $$QT_ARCH): INSTALL_QML_FILES = true
+ }
+} else: !debug_and_release|!build_all|CONFIG(release, debug|release): INSTALL_QML_FILES = true
+
+equals(INSTALL_QML_FILES, true) {
+ INSTALLS += qmldir
+ INSTALLS += qmlfiles
+
!prefix_build {
COPIES += qmldir qmlfiles
} else {
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index 02068ae766..f1c5658b04 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -55,7 +55,7 @@ INSTALLS += target
# Some final setup
-TARGET = $$qt5LibraryTarget($$TARGET)
+TARGET = $$qt5LibraryTarget($$TARGET, "qml/$$TARGETPATH/")
load(qt_targets)
load(qt_common)
diff --git a/mkspecs/features/qmltestcase.prf b/mkspecs/features/qmltestcase.prf
index b4b1224781..ae4ebef513 100644
--- a/mkspecs/features/qmltestcase.prf
+++ b/mkspecs/features/qmltestcase.prf
@@ -1,8 +1,14 @@
!isEmpty(SOURCES) {
QT += qml qmltest
load(testcase)
- contains(TEMPLATE, vc.*): DEFINES += QUICK_TEST_SOURCE_DIR=\"$$_PRO_FILE_PWD_\"
- else: DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"$$_PRO_FILE_PWD_\")
+ !android {
+ contains(TEMPLATE, vc.*): DEFINES += QUICK_TEST_SOURCE_DIR=\"$$_PRO_FILE_PWD_\"
+ else: DEFINES += QUICK_TEST_SOURCE_DIR=$$shell_quote(\"$$_PRO_FILE_PWD_\")
+ } else {
+ !isEmpty(RESOURCES): warning("The RESOURCES qmake variable is empty, the test will probably fail to run")
+ DEFINES += QUICK_TEST_SOURCE_DIR=\":/\"
+ }
+
} else {
# Allow a project to run tests without a CPP stub
TEMPLATE = aux
diff --git a/mkspecs/features/qt_android_deps.prf b/mkspecs/features/qt_android_deps.prf
index c172ca8c4e..e50c24b966 100644
--- a/mkspecs/features/qt_android_deps.prf
+++ b/mkspecs/features/qt_android_deps.prf
@@ -16,7 +16,7 @@
ANDROID_DEPENDS_DIR = $$MODULE_BASE_OUTDIR/lib/
DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
-!build_pass {
+build_pass:!isEmpty(QT_ARCH): {
!isEmpty(MODULE_PLUGIN_TYPES) {
for(PLUGIN_TYPE, MODULE_PLUGIN_TYPES) {
ANDROID_BUNDLED_FILES += "plugins/$$PLUGIN_TYPE"
@@ -46,6 +46,8 @@ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
EXTENDS = $$section(LIB_FILE, ":", 1, 1)
!isEmpty(EXTENDS): EXTENDS = "extends=\"$$EXTENDS\""
LIB_FILE = $$section(LIB_FILE, ":", 0, 0)
+ LIB_FILE = $$replace(LIB_FILE,".so", "_$${QT_ARCH}.so")
+ !isEmpty(EXTENDS): EXTENDS = $$replace(EXTENDS,".so", "_$${QT_ARCH}.so")
FILE_CONTENT += "<lib file=\"$$LIB_FILE\" $$EXTENDS />"
}
}
@@ -54,12 +56,14 @@ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
for(REPLACEMENT, ANDROID_LIB_DEPENDENCY_REPLACEMENTS) {
REPLACEMENT_FILE = $$section(REPLACEMENT, ":", 0, 0)
LIB_FILE = $$section(REPLACEMENT, ":", 1, 1)
+ REPLACEMENT_FILE = $$replace(REPLACEMENT_FILE,".so", "_$${QT_ARCH}.so")
FILE_CONTENT += "<lib file=\"$$LIB_FILE\" replaces=\"$$REPLACEMENT_FILE\" />"
}
}
!isEmpty(ANDROID_BUNDLED_FILES) {
for (BUNDLED_FILE, ANDROID_BUNDLED_FILES) {
+ BUNDLED_FILE = $$replace(BUNDLED_FILE,".so", "_$${QT_ARCH}.so")
FILE_CONTENT += "<bundled file=\"$$BUNDLED_FILE\" />"
}
}
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf
index 8a7c9c28d3..8273ba3fe1 100644
--- a/mkspecs/features/qt_build_config.prf
+++ b/mkspecs/features/qt_build_config.prf
@@ -88,6 +88,9 @@ cross_compile: \
android|uikit|winrt: \
CONFIG += builtin_testdata
+# Prevent warnings about object files without any symbols
+macos: CONFIG += no_warn_empty_obj_files
+
CONFIG += \
utf8_source \
create_prl link_prl \
@@ -108,6 +111,10 @@ macos: CONFIG += testcase_no_bundle
# Override MinGW's definition in _mingw.h
mingw: DEFINES += WINVER=0x0601 _WIN32_WINNT=0x0601
+# By default, the following features should not be used in Qt's own
+# implementation, so declare them invisible to Qt modules.
+DEFINES += QT_NO_LINKED_LIST # QLinkedList
+
defineTest(qtBuildPart) {
bp = $$eval($$upper($$section(_QMAKE_CONF_, /, -2, -2))_BUILD_PARTS)
isEmpty(bp): bp = $$QT_BUILD_PARTS
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index e64dfa98c2..c24f2c6062 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -152,8 +152,8 @@ warnings_are_errors:warning_clean {
android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
}
} else:msvc:!intel_icl {
- # enable for MSVC 2012, MSVC 2013, MSVC 2015
- contains(MSVC_VER, "1[124].0"): QMAKE_CXXFLAGS_WARN_ON += -WX
+ # enable for MSVC 2015, MSVC 2017
+ contains(MSVC_VER, "1[45].0"): QMAKE_CXXFLAGS_WARN_ON += -WX
}
unset(ver)
}
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 27584b99f5..7ed1f7f03a 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -61,6 +61,13 @@ defineTest(qtConfCommandlineSetInput) {
val = $${2}
!isEmpty($${currentConfig}.commandline.options.$${arg}.name): \
arg = $$eval($${currentConfig}.commandline.options.$${arg}.name)
+ !isEmpty(config.input.$$arg) {
+ oldval = $$eval(config.input.$$arg)
+ equals(oldval, $$val): \
+ qtConfAddNote("Option '$$arg' with value '$$val' was specified twice")
+ else: \
+ qtConfAddNote("Overriding option '$$arg' with '$$val' (was: '$$oldval')")
+ }
config.input.$$arg = $$val
export(config.input.$$arg)
@@ -530,98 +537,23 @@ defineReplace(qtGccSysrootifiedPaths) {
return($$sysrootified)
}
-# libs-var, libs, in-paths, out-paths-var
+# libs-var, libs, in-paths
defineTest(qtConfResolveLibs) {
- ret = true
- paths = $$3
- out =
- copy = false
- for (l, 2) {
- $$copy {
- copy = false
- out += $$l
- } else: equals(l, "-s") {
- # em++ flag to link libraries from emscripten-ports; passed on literally.
- copy = true
- out += $$l
- } else: contains(l, "^-L.*") {
- lp = $$replace(l, "^-L", )
- gcc: lp = $$qtGccSysrootifiedPath($$lp)
- !exists($$lp/.) {
- qtLog("Library path $$val_escape(lp) is invalid.")
- ret = false
- } else {
- paths += $$lp
- }
- } else: contains(l, "^-l.*") {
- lib = $$replace(l, "^-l", )
- lcan =
- integrity:contains(lib, "^.*\\.a") {
- # INTEGRITY compiler searches for exact filename
- # if -l argument has .a suffix
- lcan += $${lib}
- } else: contains(lib, "^:.*") {
- # Use exact filename when -l:filename syntax is used.
- lib ~= s/^://
- lcan += $${lib}
- } else: unix {
- # Under UNIX, we look for actual shared libraries, in addition
- # to static ones.
- shexts = $$QMAKE_EXTENSION_SHLIB $$QMAKE_EXTENSIONS_AUX_SHLIB
- for (ext, shexts) {
- lcan += $${QMAKE_PREFIX_SHLIB}$${lib}.$${ext}
- }
- lcan += \
- $${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
- } else {
- # Under Windows, we look only for static libraries, as even for DLLs
- # one actually links against a static import library.
- mingw {
- lcan += \
- # MinGW supports UNIX-style library naming in addition to
- # the MSVC style.
- lib$${lib}.dll.a lib$${lib}.a \
- # Fun fact: prefix-less libraries are also supported.
- $${lib}.dll.a $${lib}.a
- }
- lcan += $${lib}.lib
- }
- l = $$qtConfFindInPathList($$lcan, $$paths $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS)
- isEmpty(l) {
- qtLog("None of [$$val_escape(lcan)] found in [$$val_escape(paths)] and global paths.")
- ret = false
- } else {
- out += $$l
- }
- } else {
- out += $$l
- }
- }
- $$1 = $$out
+ for (path, 3): \
+ pre_lflags += -L$$path
+ $$1 = $$pre_lflags $$2
export($$1)
- !isEmpty(4) {
- $$4 = $$paths
- export($$4)
- }
- return($$ret)
-}
-
-# source-var
-defineTest(qtConfResolveAllLibs) {
- ret = true
- !qtConfResolveLibs($${1}.libs, $$eval($${1}.libs), , $${1}.libdirs): \
- ret = false
- for (b, $${1}.builds._KEYS_): \
- !qtConfResolveLibs($${1}.builds.$${b}, $$eval($${1}.builds.$${b}), $$eval($${1}.libdirs), ): \
- ret = false
- return($$ret)
+ return(true)
}
# libs-var, in-paths, libs
defineTest(qtConfResolvePathLibs) {
ret = true
- gcc: 2 = $$qtGccSysrootifiedPaths($$2)
- for (libdir, 2) {
+ gcc: \
+ local_paths = $$qtGccSysrootifiedPaths($$2)
+ else: \
+ local_paths = $$2
+ for (libdir, local_paths) {
!exists($$libdir/.) {
qtLog("Library path $$val_escape(libdir) is invalid.")
ret = false
@@ -671,8 +603,11 @@ defineReplace(qtConfGetTestIncludes) {
# includes-var, in-paths, test-object-var
defineTest(qtConfResolvePathIncs) {
ret = true
- gcc: 2 = $$qtGccSysrootifiedPaths($$2)
- for (incdir, 2) {
+ gcc: \
+ local_paths = $$qtGccSysrootifiedPaths($$2)
+ else: \
+ local_paths = $$2
+ for (incdir, local_paths) {
!exists($$incdir/.) {
qtLog("Include path $$val_escape(incdir) is invalid.")
ret = false
@@ -766,11 +701,9 @@ defineTest(qtConfLibrary_inline) {
for (ld, libdir): \
libs += -L$$ld
$${1}.libs = $$libs $$eval($${1}.libs)
+ export($${1}.libs)
}
- !qtConfResolveAllLibs($$1): \
- return(false)
-
!qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \
return(false)
@@ -1898,8 +1831,11 @@ defineTest(qtConfCreateReportRecurse) {
entry = $${1}.$$n
subKeys = $$eval($${entry}._KEYS_)
contains(subKeys, condition) {
- condition = $$eval($${entry}.condition)
- r = $$qtConfEvaluate($$condition)
+ r = true
+ for (condition, $$qtConfScalarOrList($${entry}.condition)) {
+ r = $$qtConfEvaluate($$condition)
+ !$$r: break()
+ }
!qtConfIsBoolean($$r): \
error("Evaluation of condition '$$condition' in report entry $${entry} yielded non-boolean value '$$r'.")
!$$r: next()
diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
index 3b74cd4dd5..deb4ac2829 100644
--- a/mkspecs/features/qt_docs.prf
+++ b/mkspecs/features/qt_docs.prf
@@ -27,6 +27,24 @@ QT_TOOL_ENV = qtver qtmver qtvertag qtdocs builddir
qtPrepareTool(QDOC, qdoc)
QT_TOOL_ENV =
+# On Windows, put the includes into a .inc file which QDoc will read, if the project
+# has too many includes. We do this to overcome a command-line limit on Windows.
+WIN_INCLUDETEMP=
+INCLUDE_PATHS=$$INCPATH
+win32:count(INCLUDE_PATHS, 30, >) {
+ WIN_INCLUDETEMP = $$OUT_PWD/qdocincludepaths.inc
+ WIN_INCLUDETEMP_CONTENT =
+ for (inc, INCLUDE_PATHS): \
+ WIN_INCLUDETEMP_CONTENT += -I$$inc
+ write_file($$absolute_path($$WIN_INCLUDETEMP, $$OUT_PWD), WIN_INCLUDETEMP_CONTENT)|error()
+}
+
+isEmpty(WIN_INCLUDETEMP) {
+ QDOC_INCLUDE_PATHS=$(INCPATH)
+} else {
+ QDOC_INCLUDE_PATHS=@$$shell_quote($$WIN_INCLUDETEMP)
+}
+
!build_online_docs: qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
qtPrepareTool(QTATTRIBUTIONSSCANNER, qtattributionsscanner)
@@ -75,12 +93,13 @@ qtattributionsscanner.CONFIG += phony
QMAKE_EXTRA_TARGETS += qtattributionsscanner
doc_command = $$QDOC $$QMAKE_DOCS
+
prepare_docs {
- prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors $(INCPATH)
- generate_docs.commands += $$doc_command -generate $$DOC_INDEXES $(INCPATH)
+ prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors $$QDOC_INCLUDE_PATHS
+ generate_docs.commands += $$doc_command -generate $$DOC_INDEXES $$QDOC_INCLUDE_PATHS
prepare_docs.depends += qtattributionsscanner
} else {
- html_docs.commands += $$doc_command $$DOC_INDEXES $(INCPATH)
+ html_docs.commands += $$doc_command $$DOC_INDEXES $(QDOC_INCLUDE_PATHS)
html_docs.depends += qtattributionsscanner
}
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index 1903e509c8..661b7dd961 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -1,10 +1,11 @@
defineReplace(qtPlatformTargetSuffix) {
suffix =
- CONFIG(debug, debug|release) {
+ android: return($${suffix}_$${QT_ARCH})
+ else: CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
mac: return($${suffix}_debug)
- win32: return($${suffix}d)
+ win32:!gcc: return($${suffix}d)
}
}
return($$suffix)
@@ -20,7 +21,13 @@ defineReplace(qtLibraryTarget) {
}
defineReplace(qt5LibraryTarget) {
- LIBRARY_NAME = $$qtLibraryTarget($$1)
+ android {
+ LIBRARY_NAME_PREFIX = $$2
+ LIBRARY_NAME_PREFIX = $$replace(LIBRARY_NAME_PREFIX, "//", "/")
+ LIBRARY_NAME_PREFIX = $$replace(LIBRARY_NAME_PREFIX, "/", "_")
+ LIBRARY_NAME = $$LIBRARY_NAME_PREFIX$$qtLibraryTarget($$1)
+ unset(LIBRARY_NAME_PREFIX)
+ } else: LIBRARY_NAME = $$qtLibraryTarget($$1)
isEmpty(QMAKE_FRAMEWORK_BUNDLE_NAME) {
# Insert the major version of Qt in the library name
# unless it's a framework build.
@@ -152,8 +159,12 @@ defineTest(qtAddToolEnv) {
!isEmpty(cmd): cmd = "$$cmd "
equals(ds, /) {
batch_name = $${batch_name}.sh
+ equals(QMAKE_HOST.os, Darwin):exists(/bin/bash): \
+ shell = /bin/bash
+ else: \
+ shell = /bin/sh
batch_cont = \
- "$$LITERAL_HASH!/bin/sh" \
+ "$$LITERAL_HASH!$$shell" \
$$batch_sets \
"exec $$cmd\"$@\""
# It would be nicer to use the '.' command (without 'exec' above),
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf
index 2cb54fc547..216c24c7aa 100644
--- a/mkspecs/features/qt_helper_lib.prf
+++ b/mkspecs/features/qt_helper_lib.prf
@@ -29,19 +29,19 @@ DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
THE_TARGET = $$qt5LibraryTarget($$TARGET)
-!build_pass {
- MODULE = $$replace(TARGET, ^qt, )
- MODULE ~= s,-,_,
- MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri
- ucmodule = $$upper($$MODULE)
+MODULE = $$replace(TARGET, ^qt, )
+MODULE ~= s,-,_,
+MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri
+ucmodule = $$upper($$MODULE)
+win32|CONFIG(static, static|shared) {
+ prefix = $$QMAKE_PREFIX_STATICLIB
+ suffix = $$QMAKE_EXTENSION_STATICLIB
+} else {
+ prefix = $$QMAKE_PREFIX_SHLIB
+ suffix = $$QMAKE_EXTENSION_SHLIB
+}
- win32|CONFIG(static, static|shared) {
- prefix = $$QMAKE_PREFIX_STATICLIB
- suffix = $$QMAKE_EXTENSION_STATICLIB
- } else {
- prefix = $$QMAKE_PREFIX_SHLIB
- suffix = $$QMAKE_EXTENSION_SHLIB
- }
+!build_pass {
CC_USES =
LD_USES =
for (use, QMAKE_USE) {
@@ -58,7 +58,9 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
"QMAKE_DEPENDS_$${ucmodule}_LD =$$join(LD_USES, " ", " ")" \
"QMAKE_INCDIR_$${ucmodule} = $$val_escape(MODULE_INCLUDEPATH)" \
"QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)"
- debug_and_release {
+ android {
+ MODULE_PRI_CONT += "QMAKE_LIBS_$${ucmodule} ="
+ } else: debug_and_release {
win32: \
MODULE_DEBUG_LIBS = $$DESTDIR/$$prefix$${TARGET}d.$$suffix
else: darwin: \
@@ -76,6 +78,11 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET)
"QMAKE_LIBS_$${ucmodule} = $$val_escape(MODULE_LIBS)"
}
write_file($$MODULE_PRI, MODULE_PRI_CONT)|error()
+} else: android {
+ ABI_TARGET = $$qt5LibraryTarget($$TARGET)
+ ABI_MODULE_LIBS = $$DESTDIR/$$prefix$${ABI_TARGET}.$$suffix
+ MODULE_PRI_CONT = "QMAKE_LIBS_$${ucmodule}_$${QT_ARCH} = $$val_escape(ABI_MODULE_LIBS)"
+ write_file($$MODULE_PRI, MODULE_PRI_CONT, append)|error()
}
TARGET = $$THE_TARGET
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index 46687f262e..828a9621b9 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -93,7 +93,7 @@ header_module {
DESTDIR = $$MODULE_BASE_OUTDIR/lib
DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin
-CONFIG += qmake_cache target_qt
+CONFIG += target_qt
QMAKE_DOCS_TARGETDIR = qt$${MODULE}
@@ -269,7 +269,7 @@ load(qt_installs)
load(qt_targets)
# this builds on top of qt_common
-!internal_module:if(unix|mingw) {
+!internal_module:if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
CONFIG += create_pc
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
host_build: \
@@ -282,11 +282,13 @@ load(qt_targets)
} else {
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
QMAKE_PKGCONFIG_CFLAGS = -D$$MODULE_DEFINE -I${includedir}/$$MODULE_INCNAME
+ for(inc, MODULE_AUX_INCLUDES): \
+ QMAKE_PKGCONFIG_CFLAGS += -I${includedir}/$$section(inc, /, 1, 1)
}
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
- QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
+ QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)$$qtPlatformTargetSuffix()
for(i, MODULE_DEPENDS): \
- QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))
+ QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix()
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
!isEmpty(lib_replace0.match) {
@@ -334,5 +336,6 @@ win32 {
# On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API
DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050000
}
+DEFINES *= QT_DEPRECATED_WARNINGS_SINCE=0x060000
TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX) # Do this towards the end
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index e892f83432..719caf3d4a 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -51,13 +51,12 @@ defineReplace(qtGetExportsForModule) {
return($$result)
}
-defineReplace(qtExportLibsForModule) {
+defineReplace(qtExportDepsForModule) {
result =
for (lib, QT.$${1}.libraries) {
NAME = $$upper($$lib)
vars = \
QMAKE_DEPENDS_$${NAME}_CC QMAKE_DEPENDS_$${NAME}_LD \
- QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \
QMAKE_DEFINES_$$NAME QMAKE_INCDIR_$$NAME
for (var, vars) {
expvar = $$var
@@ -71,6 +70,24 @@ defineReplace(qtExportLibsForModule) {
return($$result)
}
+defineReplace(qtExportLibsForModule) {
+ result =
+ for (lib, QT.$${1}.libraries) {
+ NAME = $$upper($$lib)
+ vars = \
+ QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE
+ for (var, vars) {
+ expvar = $$var
+ expvar ~= s/^QMAKE_/QMAKE_EXPORT_/
+ defined($$expvar, var):equals($$expvar, -): next()
+ !defined($$expvar, var): expvar = $$var
+ defined($$expvar, var): \
+ result += "$$var$${2} = $$val_escape($$expvar)"
+ }
+ }
+ return($$result)
+}
+
!build_pass {
# Create a module .pri file
@@ -160,6 +177,7 @@ defineReplace(qtExportLibsForModule) {
"QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")" \
$$qtGetFeaturesForModule($${MODULE}_private) \
"" \
+ $$qtExportDepsForModule($${MODULE}_private) \
$$qtExportLibsForModule($${MODULE}_private)
write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error()
}
@@ -220,7 +238,10 @@ defineReplace(qtExportLibsForModule) {
}
cache(QT_MODULES, transient)
-} # !build_pass
+} else:android:!no_private_module:!internal_module {
+ MODULE_PRIVATE_PRI_CONT = $$qtExportLibsForModule($${MODULE}_private, _$${QT_ARCH})
+ write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT, append)|error()
+}
# Schedule the regular .pri file for installation
CONFIG += qt_install_module
diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
index 40528a65e2..573d717eea 100644
--- a/mkspecs/features/qt_plugin.prf
+++ b/mkspecs/features/qt_plugin.prf
@@ -91,7 +91,8 @@ CONFIG(static, static|shared)|prefix_build {
target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
INSTALLS += target
-TARGET = $$qt5LibraryTarget($$TARGET)
+qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX
+TARGET = $$qt5LibraryTarget($$TARGET, "plugins/$$PLUGIN_TYPE/")
CONFIG += create_cmake
diff --git a/mkspecs/features/sanitizer.prf b/mkspecs/features/sanitizer.prf
index 9e7ff0218a..c7d72aec80 100644
--- a/mkspecs/features/sanitizer.prf
+++ b/mkspecs/features/sanitizer.prf
@@ -1,10 +1,33 @@
# Sanitizer flags
-
sanitize_address {
QMAKE_CFLAGS += $$QMAKE_SANITIZE_ADDRESS_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_ADDRESS_CXXFLAGS
QMAKE_LFLAGS += $$QMAKE_SANITIZE_ADDRESS_LFLAGS
+ android {
+ # ARM 32 (armeabi-v7a & arm5) are not supported because Qt must be rebuilt with -marm
+ equals(ANDROID_TARGET_ARCH, arm64-v8a): ANDROID_LIBCLANG_RT_FILE = "libclang_rt.asan-aarch64-android.so"
+ else: equals(ANDROID_TARGET_ARCH, x86): ANDROID_LIBCLANG_RT_FILE = "libclang_rt.asan-i686-android.so"
+ else: equals(ANDROID_TARGET_ARCH, x86_64): ANDROID_LIBCLANG_RT_FILE = "libclang_rt.asan-x86_64-android.so"
+ else: error("ASAN: Unsupported platform $${ANDROID_TARGET_ARCH}")
+
+ ANDROID_LIBCLANG_RT_PATH = $${NDK_LLVM_PATH}/lib64/clang
+ ANDROID_CLANG_RT_VERSIONS = $$files($$ANDROID_LIBCLANG_RT_PATH/*)
+ for (VERSION, ANDROID_CLANG_RT_VERSIONS) {
+ greaterThan(VERSION, $$ANDROID_LIBCLANG_RT_PATH): ANDROID_LIBCLANG_RT_PATH = $$VERSION
+ }
+ ANDROID_LIBCLANG_RT_PATH = "$${ANDROID_LIBCLANG_RT_PATH}/lib/linux/"
+ ANDROID_WRAP_SH_CONTENT = "$$LITERAL_HASH!/system/bin/sh"
+ ANDROID_WRAP_SH_CONTENT += "HERE=\"$(cd \"$(dirname \"$0\")\" && pwd)\""
+ isEmpty(ANDROID_ASAN_OPTIONS): ANDROID_ASAN_OPTIONS = "log_to_syslog=false,allow_user_segv_handler=1"
+ ANDROID_WRAP_SH_CONTENT += "export ASAN_OPTIONS=$${ANDROID_ASAN_OPTIONS}"
+ ANDROID_WRAP_SH_CONTENT += "export LD_PRELOAD=$HERE/$${ANDROID_LIBCLANG_RT_FILE}"
+ ANDROID_WRAP_SH_CONTENT += "exec \"$@\""
+ write_file($$OUT_PWD/android-build/resources/lib/$${ANDROID_TARGET_ARCH}/wrap.sh, ANDROID_WRAP_SH_CONTENT) | error()
+ libclang_rt.path = /libs/$$ANDROID_TARGET_ARCH/
+ libclang_rt.files = "$${ANDROID_LIBCLANG_RT_PATH}/$${ANDROID_LIBCLANG_RT_FILE}"
+ INSTALLS += libclang_rt
+ }
}
sanitize_memory {
diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf
index b8102c26b5..d4f08835f1 100644
--- a/mkspecs/features/testcase.prf
+++ b/mkspecs/features/testcase.prf
@@ -52,14 +52,26 @@ debug_and_release:debug_and_release_target {
}
# Allow for a custom test runner script
-$${type}.commands += $(TESTRUNNER)
+
+android: isEmpty($(TESTRUNNER)) {
+ APK_PATH = $$shell_path($$OUT_PWD/android-build/$${TARGET}.apk)
+ qtPrepareTool(ANDROIDTESTRUNNER, androidtestrunner)
+ qtPrepareTool(ANDROIDDEPLOYQT, androiddeployqt)
+ isEmpty(ANDROID_DEPLOYMENT_SETTINGS_FILE): ANDROID_DEPLOYMENT_SETTINGS_FILE = $$OUT_PWD/android-$$TARGET-deployment-settings.json
+ contains(QMAKE_HOST.os, Windows): extension = .exe
+ $${type}.commands = $$ANDROIDTESTRUNNER --androiddeployqt \"$$ANDROIDDEPLOYQT --input $$ANDROID_DEPLOYMENT_SETTINGS_FILE\"
+ $${type}.commands += --path \"$$OUT_PWD/android-build\"
+ $${type}.commands += --adb \"$$shell_path($${ANDROID_SDK_ROOT}$${QMAKE_DIR_SEP}platform-tools$${QMAKE_DIR_SEP}adb$${extension})\"
+ $${type}.commands += --make \"$(MAKE) -f $(MAKEFILE)\"
+ $${type}.commands += --apk $$APK_PATH
+} else: $${type}.commands += $(TESTRUNNER)
unix {
isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = .
app_bundle: \
$${type}.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET).app/Contents/MacOS/$(QMAKE_TARGET)
- else: \
+ else: !android: \
$${type}.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET)
} else {
# Windows
diff --git a/tests/auto/testserver.pri b/mkspecs/features/unsupported/testserver.prf
index 26e7f6ab8a..bca88ea2d8 100644
--- a/tests/auto/testserver.pri
+++ b/mkspecs/features/unsupported/testserver.prf
@@ -93,28 +93,34 @@ isEmpty(TESTSERVER_VERSION) {
# but it causes a port conflict if the user is running a service that
# binds the same port on the host. An alternative solution is to deploy
# the docker environment into VirtualBox using docker-machine.
- TESTSERVER_COMPOSE_FILE = \
- $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-for-macOS.yml
+ isEmpty(TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \
+ $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-host-network.yml
# The connection configuration for the target machine
MACHINE_CONFIG = $(shell docker-machine config qt-test-server)
# The environment variables passed to the docker-compose file
TEST_ENV = 'MACHINE_IP=$(shell docker-machine ip qt-test-server)'
+ TEST_ENV += 'HOST_NAME=qt-test-server'
TEST_ENV += 'TEST_DOMAIN=$$DNSDOMAIN'
+ TEST_ENV += 'SHARED_DATA=$$PWD/../data/testserver'
+ TEST_ENV += 'SHARED_SERVICE=host-network'
TEST_CMD = env
} else:equals(QMAKE_HOST.os, Windows) {
# There is no docker bridge on Windows. It is impossible to ping a container.
# Use docker-machine to deploy the docker environment into VirtualBox.
- TESTSERVER_COMPOSE_FILE = \
- $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-for-windows.yml
+ isEmpty(TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \
+ $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-host-network.yml
# The connection configuration for the target machine
MACHINE_CONFIG = (docker-machine config qt-test-server)
# The environment variables passed to the docker-compose file
TEST_ENV = '\$\$env:MACHINE_IP = docker-machine ip qt-test-server;'
+ TEST_ENV += '\$\$env:HOST_NAME = $$shell_quote(\"qt-test-server\");'
TEST_ENV += '\$\$env:TEST_DOMAIN = $$shell_quote(\"$$DNSDOMAIN\");'
+ TEST_ENV += '\$\$env:SHARED_DATA = $$shell_quote(\"$$PWD/../data/testserver\");'
+ TEST_ENV += '\$\$env:SHARED_SERVICE = $$shell_quote(\"host-network\");'
# Docker-compose CLI environment variables:
# Enable path conversion from Windows-style to Unix-style in volume definitions.
@@ -123,13 +129,22 @@ isEmpty(TESTSERVER_VERSION) {
TEST_CMD = 'PowerShell -noprofile'
CONFIG += PowerShell
} else {
- TESTSERVER_COMPOSE_FILE = $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml
-
+ isEmpty(TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \
+ $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose-bridge-network.yml
# The environment variables passed to the docker-compose file
TEST_ENV = 'TEST_DOMAIN=$$DNSDOMAIN'
+ TEST_ENV += 'SHARED_DATA=$$PWD/../data/testserver'
+ TEST_ENV += 'SHARED_SERVICE=bridge-network'
TEST_CMD = env
}
+ # If $$TESTSERVER_COMPOSE_FILE defined by platform doesn't exist, the default
+ # docker-compose.yml is used as a fallback.
+ !exists($$TESTSERVER_COMPOSE_FILE): TESTSERVER_COMPOSE_FILE = \
+ $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml
+ !exists($$TESTSERVER_COMPOSE_FILE): error("Invalid TESTSERVER_COMPOSE_FILE specified")
+
+
# The domain name is relevant to https keycert (qnetworkreply/crts/qt-test-net-cacert.pem).
DEFINES += QT_TEST_SERVER QT_TEST_SERVER_DOMAIN=$$shell_quote(\"$${DNSDOMAIN}\")
@@ -198,7 +213,7 @@ isEmpty(TESTSERVER_VERSION) {
# Bring up test servers and make sure the services are ready.
!isEmpty(TEST_CMD): testserver_test.commands = $$TEST_CMD $$TEST_ENV
testserver_test.commands += docker-compose $$MACHINE_CONFIG -f $$TESTSERVER_COMPOSE_FILE up \
- --detach --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} &&
+ --build -d --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} &&
# Check test cases with docker-based test servers.
testserver_test.commands += $(MAKE) -f $(MAKEFILE) check_network &&
diff --git a/mkspecs/features/win32/dumpcpp.prf b/mkspecs/features/win32/dumpcpp.prf
index c8cb0dd24b..d19da3d077 100644
--- a/mkspecs/features/win32/dumpcpp.prf
+++ b/mkspecs/features/win32/dumpcpp.prf
@@ -22,15 +22,15 @@ dumpcpp_impl.depends += ${QMAKE_FILE_BASE}.h
QMAKE_EXTRA_COMPILERS += dumpcpp_impl
-# Create dependencies from every object file to our generated header files.
-if(isEmpty(BUILDS)|build_pass):have_target:!contains(TEMPLATE, vc.*) {
+# Call dumpcpp the first time if the files do not exist to help find dependencies
+!build_pass:have_target:!contains(TEMPLATE, vc.*) {
for(tlb, TYPELIBS) {
+ tlbCopy = $$replace(tlb, \", )
hdr = $$basename(tlb)
- hdr = $$section(hdr, ., 0, -2).h
- TYPELIB_HEADERS += $$hdr
+ hdr = $$section(hdr, ., 0, -2)
+ tmp_command = $$QMAKE_DUMPCPP $$system_quote($$absolute_path($$tlb, $$_PRO_FILE_PWD_)) \
+ -o $$system_quote($$OUT_PWD/$$hdr)
+ qaxcontainer_compat: tmp_command += -compat
+ !exists($$OUT_PWD/$${hdr}.h): system($$tmp_command)
}
-
- objtgt.target = $(OBJECTS)
- objtgt.depends += $$TYPELIB_HEADERS
- QMAKE_EXTRA_TARGETS += objtgt
}
diff --git a/mkspecs/features/yacc.prf b/mkspecs/features/yacc.prf
index 618f0668c2..0c7ff7321e 100644
--- a/mkspecs/features/yacc.prf
+++ b/mkspecs/features/yacc.prf
@@ -2,32 +2,49 @@
# Yacc extra-compiler for handling files specified in the YACCSOURCES variable
#
-{
- yacc_decl.name = Yacc header
- yacc_decl.input = YACCSOURCES
- yacc_decl.variable_out = GENERATED_FILES
+isEmpty(YACC_DIR): YACC_DIR = .
+defineReplace(yaccCommands) {
+ input = $$relative_path($$absolute_path($$1, $$OUT_PWD), $$OUT_PWD/$$YACC_DIR)
+ input_base = $$basename(1)
+ input_base ~= s/\.[^.]*$//
+ hpp_output = $$2
+ cpp_output = $$hpp_output
+ cpp_output ~= s/$$re_escape($$first(QMAKE_EXT_H))$/$$first(QMAKE_EXT_CPP)/
isEmpty(QMAKE_YACCFLAGS_MANGLE) {
- QMAKE_YACCFLAGS_MANGLE = -p ${QMAKE_FILE_BASE} -b ${QMAKE_FILE_BASE}
- QMAKE_YACC_HEADER = ${QMAKE_FILE_BASE}.tab.h
- QMAKE_YACC_SOURCE = ${QMAKE_FILE_BASE}.tab.c
+ QMAKE_YACCFLAGS_MANGLE = -p $${input_base} -b $${input_base}
+ QMAKE_YACC_HEADER = $${input_base}.tab.h
+ QMAKE_YACC_SOURCE = $${input_base}.tab.c
} else {
- QMAKE_YACCFLAGS_MANGLE ~= s/\\$base/${QMAKE_FILE_BASE}/g #backwards compat
- QMAKE_YACC_HEADER ~= s/\\$base/${QMAKE_FILE_BASE}/g
- QMAKE_YACC_SOURCE ~= s/\\$base/${QMAKE_FILE_BASE}/g
+ QMAKE_YACCFLAGS_MANGLE ~= s/\\$base/$${input_base}/g #backwards compat
+ QMAKE_YACC_HEADER ~= s/\\$base/$${input_base}/g
+ QMAKE_YACC_SOURCE ~= s/\\$base/$${input_base}/g
}
QMAKE_YACCDECLFLAGS = $$QMAKE_YACCFLAGS
- !yacc_no_name_mangle:QMAKE_YACCDECLFLAGS += $$QMAKE_YACCFLAGS_MANGLE
+ !yacc_no_name_mangle: QMAKE_YACCDECLFLAGS += $$QMAKE_YACCFLAGS_MANGLE
- yacc_decl.commands = \
- -$(DEL_FILE) $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t) \
- $$QMAKE_YACC $$QMAKE_YACCDECLFLAGS ${QMAKE_FILE_IN}$$escape_expand(\\n\\t) \
- $(MOVE) $${QMAKE_YACC_HEADER} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)}$$escape_expand(\\n\\t) \
- $(MOVE) $${QMAKE_YACC_SOURCE} $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)}$$escape_expand(\\n\\t)
- yacc_decl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)}
+ !equals(YACC_DIR, .): yacc_call = cd $$YACC_DIR &&
+ yacc_call += $$QMAKE_YACC $$QMAKE_YACCDECLFLAGS $${input}
+
+ commands = \
+ -$(DEL_FILE) $${hpp_output} $${cpp_output}$$escape_expand(\\n\\t) \
+ $${yacc_call}$$escape_expand(\\n\\t) \
+ $(MOVE) $${YACC_DIR}/$${QMAKE_YACC_HEADER} $${hpp_output}$$escape_expand(\\n\\t) \
+ $(MOVE) $${YACC_DIR}/$${QMAKE_YACC_SOURCE} $${cpp_output}$$escape_expand(\\n\\t)
+
+ silent: commands = @echo Yacc $$1 && $$commands
+ return($$commands)
+}
- silent:yacc_decl.commands = @echo Yacc ${QMAKE_FILE_IN} && $$yacc_decl.commands
+yacc_output_base = $${YACC_DIR}/$${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}
+
+{
+ yacc_decl.name = Yacc header
+ yacc_decl.input = YACCSOURCES
+ yacc_decl.variable_out = GENERATED_FILES
+ yacc_decl.commands = ${QMAKE_FUNC_yaccCommands}
+ yacc_decl.output = $${yacc_output_base}$$first(QMAKE_EXT_H)
QMAKE_EXTRA_COMPILERS += yacc_decl
}
@@ -37,7 +54,9 @@
yacc_impl.variable_out = GENERATED_SOURCES
yacc_impl.dependency_type = TYPE_C
yacc_impl.commands = $$escape_expand(\\n) # We don't want any commands where, but if command is empty no rules are created
- yacc_impl.depends += $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_H)} # Make sure we depend on the step above
- yacc_impl.output = $${QMAKE_CPP_MOD_MOC}${QMAKE_FILE_BASE}$${QMAKE_MOD_YACC}$${first(QMAKE_EXT_CPP)} # Faked output from this step, output really created in step above
+ yacc_impl.depends += $${yacc_output_base}$$first(QMAKE_EXT_H) # Make sure we depend on the step above
+ yacc_impl.output = $${yacc_output_base}$$first(QMAKE_EXT_CPP) # Faked output from this step, output really created in step above
QMAKE_EXTRA_COMPILERS += yacc_impl
}
+
+unset(yacc_output_base)
diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang/Info.plist.app
index 4d64a77704..fa592af089 100644
--- a/mkspecs/macx-clang/Info.plist.app
+++ b/mkspecs/macx-clang/Info.plist.app
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
diff --git a/mkspecs/macx-clang/Info.plist.lib b/mkspecs/macx-clang/Info.plist.lib
index ce28365500..34752ec40d 100644
--- a/mkspecs/macx-clang/Info.plist.lib
+++ b/mkspecs/macx-clang/Info.plist.lib
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
diff --git a/mkspecs/macx-g++/Info.plist.app b/mkspecs/macx-g++/Info.plist.app
index 4d64a77704..fa592af089 100644
--- a/mkspecs/macx-g++/Info.plist.app
+++ b/mkspecs/macx-g++/Info.plist.app
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
diff --git a/mkspecs/macx-g++/Info.plist.lib b/mkspecs/macx-g++/Info.plist.lib
index ce28365500..34752ec40d 100644
--- a/mkspecs/macx-g++/Info.plist.lib
+++ b/mkspecs/macx-g++/Info.plist.lib
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
diff --git a/mkspecs/macx-icc/Info.plist.app b/mkspecs/macx-icc/Info.plist.app
index 4d64a77704..fa592af089 100644
--- a/mkspecs/macx-icc/Info.plist.app
+++ b/mkspecs/macx-icc/Info.plist.app
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
diff --git a/mkspecs/macx-icc/Info.plist.lib b/mkspecs/macx-icc/Info.plist.lib
index ce28365500..34752ec40d 100644
--- a/mkspecs/macx-icc/Info.plist.lib
+++ b/mkspecs/macx-icc/Info.plist.lib
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
diff --git a/mkspecs/macx-ios-clang/Info.plist.app b/mkspecs/macx-ios-clang/Info.plist.app
index 1acbf9d768..03ba3e82b4 100644
--- a/mkspecs/macx-ios-clang/Info.plist.app
+++ b/mkspecs/macx-ios-clang/Info.plist.app
@@ -6,8 +6,6 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
diff --git a/mkspecs/macx-ios-clang/Info.plist.lib b/mkspecs/macx-ios-clang/Info.plist.lib
index ce28365500..34752ec40d 100644
--- a/mkspecs/macx-ios-clang/Info.plist.lib
+++ b/mkspecs/macx-ios-clang/Info.plist.lib
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
diff --git a/mkspecs/macx-ios-clang/qmake.conf b/mkspecs/macx-ios-clang/qmake.conf
index 88e96ef32e..b164d44d9f 100644
--- a/mkspecs/macx-ios-clang/qmake.conf
+++ b/mkspecs/macx-ios-clang/qmake.conf
@@ -2,7 +2,7 @@
# qmake configuration for macx-ios-clang
#
-QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
+QMAKE_IOS_DEPLOYMENT_TARGET = 12.0
# Universal target (iPhone and iPad)
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2
diff --git a/mkspecs/macx-tvos-clang/Info.plist.app b/mkspecs/macx-tvos-clang/Info.plist.app
index 04aef816c2..b9b67fe41e 100644
--- a/mkspecs/macx-tvos-clang/Info.plist.app
+++ b/mkspecs/macx-tvos-clang/Info.plist.app
@@ -8,8 +8,6 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
diff --git a/mkspecs/macx-tvos-clang/Info.plist.lib b/mkspecs/macx-tvos-clang/Info.plist.lib
index ce28365500..34752ec40d 100644
--- a/mkspecs/macx-tvos-clang/Info.plist.lib
+++ b/mkspecs/macx-tvos-clang/Info.plist.lib
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
diff --git a/mkspecs/macx-tvos-clang/qmake.conf b/mkspecs/macx-tvos-clang/qmake.conf
index 77f6a02f7b..ad53627c4a 100644
--- a/mkspecs/macx-tvos-clang/qmake.conf
+++ b/mkspecs/macx-tvos-clang/qmake.conf
@@ -2,7 +2,7 @@
# qmake configuration for macx-tvos-clang
#
-QMAKE_TVOS_DEPLOYMENT_TARGET = 11.0
+QMAKE_TVOS_DEPLOYMENT_TARGET = 12.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 3
diff --git a/mkspecs/macx-watchos-clang/Info.plist.app b/mkspecs/macx-watchos-clang/Info.plist.app
index 47f5a58d5e..5ac0ef78a0 100644
--- a/mkspecs/macx-watchos-clang/Info.plist.app
+++ b/mkspecs/macx-watchos-clang/Info.plist.app
@@ -8,8 +8,6 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleName</key>
diff --git a/mkspecs/macx-watchos-clang/Info.plist.lib b/mkspecs/macx-watchos-clang/Info.plist.lib
index ce28365500..34752ec40d 100644
--- a/mkspecs/macx-watchos-clang/Info.plist.lib
+++ b/mkspecs/macx-watchos-clang/Info.plist.lib
@@ -4,8 +4,6 @@
<dict>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundlePackageType</key>
diff --git a/mkspecs/macx-watchos-clang/qmake.conf b/mkspecs/macx-watchos-clang/qmake.conf
index 8194261275..6a1fb253c1 100644
--- a/mkspecs/macx-watchos-clang/qmake.conf
+++ b/mkspecs/macx-watchos-clang/qmake.conf
@@ -2,7 +2,7 @@
# qmake configuration for macx-watchos-clang
#
-QMAKE_WATCHOS_DEPLOYMENT_TARGET = 4.0
+QMAKE_WATCHOS_DEPLOYMENT_TARGET = 5.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 4
diff --git a/mkspecs/win32-clang-g++/qmake.conf b/mkspecs/win32-clang-g++/qmake.conf
index 4630ec4602..59d42176f0 100644
--- a/mkspecs/win32-clang-g++/qmake.conf
+++ b/mkspecs/win32-clang-g++/qmake.conf
@@ -24,4 +24,12 @@ QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_LINK = $${CROSS_COMPILE}clang++
QMAKE_LINK_C = $${CROSS_COMPILE}clang
+QMAKE_CFLAGS_LTCG = -flto=thin
+QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_CFLAGS_LTCG_FATOBJECTS = -flto
+QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS
+QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+
+QMAKE_CFLAGS_OPTIMIZE_SIZE = -Oz
+
load(qt_config)
diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf
index b60a4b8c8b..238e401b84 100644
--- a/mkspecs/win32-clang-msvc/qmake.conf
+++ b/mkspecs/win32-clang-msvc/qmake.conf
@@ -44,9 +44,14 @@ QMAKE_CXXFLAGS_CXX14 = -std:c++14
QMAKE_CXXFLAGS_CXX1Z = -std:c++17
QMAKE_CXXFLAGS_CXX2A = -std:c++latest
-QMAKE_CFLAGS_LTCG = -flto
+QMAKE_CFLAGS_LTCG = -flto=thin
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
+QMAKE_CFLAGS_LTCG_FATOBJECTS = -flto
+QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS
# Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters
QMAKE_LFLAGS_LTCG =
+QMAKE_CFLAGS_OPTIMIZE_SIZE = /clang:-Oz
+QMAKE_CFLAGS_OPTIMIZE_FULL = /clang:-O3
+
load(qt_config)
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix
index 0f69b6b487..4d4f05e78a 100644
--- a/qmake/Makefile.unix
+++ b/qmake/Makefile.unix
@@ -27,10 +27,11 @@ QOBJS = \
qjsonarray.o qjson.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o \
qmetatype.o qsystemerror.o qvariant.o \
quuid.o \
- qarraydata.o qbitarray.o qbytearray.o qbytearraymatcher.o \
- qcryptographichash.o qdatetime.o qhash.o qlinkedlist.o qlist.o \
+ qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o \
+ qcalendar.o qgregoriancalendar.o qromancalendar.o \
+ qcryptographichash.o qdatetime.o qhash.o qlist.o \
qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o \
- qstringbuilder.o qstring_compat.o qstring.o qstringlist.o qversionnumber.o \
+ qstringbuilder.o qstring.o qstringlist.o qversionnumber.o \
qvsnprintf.o qxmlstream.o qxmlutils.o \
$(QTOBJS) $(QTOBJS2)
# QTOBJS and QTOBJS2 are populated by Makefile.unix.* as for QTSRC (see below).
@@ -105,26 +106,28 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/serialization/qtextstream.cpp \
$(SOURCE_PATH)/src/corelib/serialization/qxmlstream.cpp \
$(SOURCE_PATH)/src/corelib/serialization/qxmlutils.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qbytearray.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qbytearraylist.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qbytearraymatcher.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qlocale.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qlocale_tools.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qregexp.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qstringbuilder.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qstring.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp \
+ $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qcalendar.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qgregoriancalendar.cpp \
+ $(SOURCE_PATH)/src/corelib/time/qromancalendar.cpp \
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp \
$(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
- $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlist.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \
$(SOURCE_PATH)/src/corelib/tools/qmap.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp \
$(SOURCE_PATH)/src/corelib/tools/qringbuffer.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstringbuilder.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstring_compat.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstring.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qversionnumber.cpp \
- $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp \
$(QTSRCS) $(QTSRCS2)
# QTSRCS and QTSRCS2 come from Makefile.unix.* (concatenated with this
# by configure); QTSRCS2 may include *.mm entries on macOS.
@@ -304,13 +307,16 @@ qglobal.o: $(SOURCE_PATH)/src/corelib/global/qglobal.cpp
qarraydata.o: $(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qbytearray.o: $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp
+qbytearray.o: $(SOURCE_PATH)/src/corelib/text/qbytearray.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qvsnprintf.o: $(SOURCE_PATH)/src/corelib/tools/qvsnprintf.cpp
+qbytearraylist.o: $(SOURCE_PATH)/src/corelib/text/qbytearraylist.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp
+qvsnprintf.o: $(SOURCE_PATH)/src/corelib/text/qvsnprintf.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+qbytearraymatcher.o: $(SOURCE_PATH)/src/corelib/text/qbytearraymatcher.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qmetatype.o: $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp
@@ -340,25 +346,22 @@ qcore_foundation.o: $(SOURCE_PATH)/src/corelib/kernel/qcore_foundation.mm
qutfcodec.o: $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qstring.o: $(SOURCE_PATH)/src/corelib/tools/qstring.cpp
- $(CXX) -c -o $@ $(CXXFLAGS) $<
-
-qstring_compat.o: $(SOURCE_PATH)/src/corelib/tools/qstring_compat.cpp
+qstring.o: $(SOURCE_PATH)/src/corelib/text/qstring.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qstringbuilder.o: $(SOURCE_PATH)/src/corelib/tools/qstringbuilder.cpp
+qstringbuilder.o: $(SOURCE_PATH)/src/corelib/text/qstringbuilder.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale.o: $(SOURCE_PATH)/src/corelib/tools/qlocale.cpp
+qlocale.o: $(SOURCE_PATH)/src/corelib/text/qlocale.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
+qlocale_tools.o: $(SOURCE_PATH)/src/corelib/text/qlocale_tools.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale_unix.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
+qlocale_unix.o: $(SOURCE_PATH)/src/corelib/text/qlocale_unix.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
+qlocale_win.o: $(SOURCE_PATH)/src/corelib/text/qlocale_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qversionnumber.o: $(SOURCE_PATH)/src/corelib/tools/qversionnumber.cpp
@@ -412,7 +415,7 @@ qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
qtemporaryfile.o: $(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qregexp.o: $(SOURCE_PATH)/src/corelib/tools/qregexp.cpp
+qregexp.o: $(SOURCE_PATH)/src/corelib/text/qregexp.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qbitarray.o: $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp
@@ -430,19 +433,25 @@ quuid.o: $(SOURCE_PATH)/src/corelib/plugin/quuid.cpp
qfileinfo.o: $(SOURCE_PATH)/src/corelib/io/qfileinfo.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp
+qdatetime.o: $(SOURCE_PATH)/src/corelib/time/qdatetime.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp
+qcalendar.o: $(SOURCE_PATH)/src/corelib/time/qcalendar.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+qgregoriancalendar.o: $(SOURCE_PATH)/src/corelib/time/qgregoriancalendar.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
+qromancalendar.o: $(SOURCE_PATH)/src/corelib/time/qromancalendar.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
-qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
+qstringlist.o: $(SOURCE_PATH)/src/corelib/text/qstringlist.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
+ $(CXX) -c -o $@ $(CXXFLAGS) $<
+
+qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $<
qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 506e9deb19..7324817af2 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -24,10 +24,8 @@ LINKER = link
CFLAGS_EXTRA = /MP /wd4577 $(CFLAGS_CRT)
!endif # !win32-icc
-!if "$(QMAKESPEC)" != "win32-clang-msvc"
CFLAGS_PCH = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch
PCH_OBJECT = qmake_pch.obj
-!endif
CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-W2 -nologo -O2 \
@@ -71,8 +69,10 @@ QTOBJS= \
qfsfileengine_iterator.obj \
qarraydata.obj \
qbytearray.obj \
+ qbytearraylist.obj \
qvsnprintf.obj \
qbytearraymatcher.obj \
+ qcalendar.obj \
qdatetime.obj \
qdir.obj \
qdiriterator.obj \
@@ -85,12 +85,12 @@ QTOBJS= \
qfileinfo.obj \
qendian.obj \
qglobal.obj \
+ qgregoriancalendar.obj \
qhash.obj \
qiodevice.obj \
qringbuffer.obj \
qdebug.obj \
qlist.obj \
- qlinkedlist.obj \
qlocale.obj \
qlocale_tools.obj \
qlocale_win.obj \
@@ -100,9 +100,9 @@ QTOBJS= \
qoperatingsystemversion.obj \
qoperatingsystemversion_win.obj \
qregexp.obj \
+ qromancalendar.obj \
qutfcodec.obj \
qstring.obj \
- qstring_compat.obj \
qstringlist.obj \
qstringbuilder.obj \
qsystemerror.obj \
@@ -200,13 +200,16 @@ qmake_pch.obj:
{$(SOURCE_PATH)\src\corelib\serialization}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
-{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
+{$(SOURCE_PATH)\src\corelib\text}.cpp{}.obj::
+ $(CXX) $(CXXFLAGS) $<
+
+{$(SOURCE_PATH)\src\corelib\time}.cpp{}.obj::
$(CXX) $(CXXFLAGS) $<
-# Make sure qstring_compat.obj and qlibraryinfo.obj aren't compiled with PCH enabled
-qstring_compat.obj: $(SOURCE_PATH)\src\corelib\tools\qstring_compat.cpp
- $(CXX) -c $(CXXFLAGS_BARE) $(SOURCE_PATH)\src\corelib\tools\qstring_compat.cpp
+{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
+ $(CXX) $(CXXFLAGS) $<
+# Make sure qlibraryinfo.obj isn't compiled with PCH enabled
qlibraryinfo.obj: $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp
$(CXX) $(CXXFLAGS_BARE) -DQT_BUILD_QMAKE_BOOTSTRAP $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 8f3eb738b4..24e69444c9 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -60,11 +60,6 @@ static QString qtSha1(const QByteArray &src)
return QString::fromLatin1(digest.toHex());
}
-ProjectBuilderMakefileGenerator::ProjectBuilderMakefileGenerator() : UnixMakefileGenerator()
-{
-
-}
-
bool
ProjectBuilderMakefileGenerator::writeMakefile(QTextStream &t)
{
@@ -590,7 +585,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf);
writeHeader(mkt);
- mkt << "QMAKE = " << var("QMAKE_QMAKE") << endl;
+ mkt << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS")
<< "@echo 'warning: Xcode project has been regenerated, custom settings have been lost. " \
"Use CONFIG+=no_autoqmake to prevent this behavior in the future, " \
@@ -788,15 +783,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf);
writeHeader(mkt);
- mkt << "MOC = " << var("QMAKE_MOC") << endl;
- mkt << "UIC = " << var("QMAKE_UIC") << endl;
- mkt << "LEX = " << var("QMAKE_LEX") << endl;
- mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl;
- mkt << "YACC = " << var("QMAKE_YACC") << endl;
- mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << endl;
+ mkt << "MOC = " << var("QMAKE_MOC") << Qt::endl;
+ mkt << "UIC = " << var("QMAKE_UIC") << Qt::endl;
+ mkt << "LEX = " << var("QMAKE_LEX") << Qt::endl;
+ mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << Qt::endl;
+ mkt << "YACC = " << var("QMAKE_YACC") << Qt::endl;
+ mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << Qt::endl;
mkt << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
- << varGlue("DEFINES","-D"," -D","") << endl;
+ << varGlue("DEFINES","-D"," -D","") << Qt::endl;
mkt << "INCPATH =";
{
const ProStringList &incs = project->values("INCLUDEPATH");
@@ -805,9 +800,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
mkt << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
- mkt << endl;
- mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl;
+ mkt << Qt::endl;
+ mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
+ mkt << "MOVE = " << var("QMAKE_MOVE") << Qt::endl << Qt::endl;
mkt << "preprocess: compilers\n";
mkt << "clean preprocess_clean: compiler_clean\n\n";
writeExtraTargets(mkt);
@@ -837,7 +832,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
}
- mkt << endl;
+ mkt << Qt::endl;
writeExtraCompilerTargets(mkt);
writingUnixMakefileGenerator = false;
}
@@ -1019,12 +1014,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' ';
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
mkt << "sublibs: $(SUBLIBS)\n\n";
tmp = project->values("SUBLIBS");
for(int i = 0; i < tmp.count(); i++)
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t"
- << var(ProKey("MAKELIB" + tmp[i])) << endl << endl;
+ << var(ProKey("MAKELIB" + tmp[i])) << Qt::endl << Qt::endl;
mkt.flush();
mkf.close();
writingUnixMakefileGenerator = false;
@@ -1261,9 +1256,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t};\n";
- QMapIterator<ProString, ProStringList> it(embedded_plugins);
- while (it.hasNext()) {
- it.next();
+ for (auto it = embedded_plugins.cbegin(), end = embedded_plugins.cend(); it != end; ++it) {
QString suffix = !it.key().isEmpty() ? (" (" + it.key() + ")") : QString();
QString grp3("Embed PlugIns" + suffix), key3 = keyFor(grp3);
project->values("QMAKE_PBX_BUILDPHASES").append(key3);
@@ -1499,7 +1492,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", "Qt Test") << ";\n"
<< "\t\t};\n";
- QLatin1Literal testTargetID("TestTargetID");
+ QLatin1String testTargetID("TestTargetID");
project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey + "_" + testTargetID)).append(keyFor(pbx_dir + "QMAKE_PBX_TARGET"));
project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey)).append(ProKey(testTargetID));
}
diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h
index a7b21a0dab..1b90a3bbeb 100644
--- a/qmake/generators/mac/pbuilder_pbx.h
+++ b/qmake/generators/mac/pbuilder_pbx.h
@@ -63,19 +63,12 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
QString writeSettings(const QString &var, const ProStringList &vals, int flags=0, int indent_level=0);
public:
- ProjectBuilderMakefileGenerator();
- ~ProjectBuilderMakefileGenerator();
-
bool supportsMetaBuild() override { return false; }
bool openOutput(QFile &, const QString &) const override;
protected:
bool doPrecompiledHeaders() const override { return false; }
bool doDepends() const override { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
};
-
-inline ProjectBuilderMakefileGenerator::~ProjectBuilderMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // PBUILDER_PBX_H
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 22ac7bf534..ed7d057a88 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -94,13 +94,6 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
return QDir().mkpath(path);
}
-// ** base makefile generator
-MakefileGenerator::MakefileGenerator() :
- no_io(false), project(nullptr)
-{
-}
-
-
void
MakefileGenerator::verifyCompilers()
{
@@ -174,14 +167,8 @@ MakefileGenerator::initOutPaths()
ProString &pathRef = v[dkey].first();
pathRef = fileFixify(pathRef.toQString(), FileFixifyFromOutdir);
-#ifdef Q_OS_WIN
- // We don't want to add a separator for DLLDESTDIR on Windows (###why?)
- if (dkey != "DLLDESTDIR")
-#endif
- {
- if(!pathRef.endsWith(Option::dir_sep))
- pathRef += Option::dir_sep;
- }
+ if (!pathRef.endsWith(Option::dir_sep))
+ pathRef += Option::dir_sep;
if (noIO() || (project->first("TEMPLATE") == "subdirs"))
continue;
@@ -206,7 +193,6 @@ MakefileGenerator::initOutPaths()
ProStringList &inputs = project->values((*it2).toKey());
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
QString finp = fileFixify((*input).toQString(), FileFixifyFromOutdir);
- *input = ProString(finp);
QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell);
path = Option::normalizePath(path);
int slash = path.lastIndexOf('/');
@@ -778,27 +764,13 @@ MakefileGenerator::init()
ProStringList incDirs = v["DEPENDPATH"] + v["QMAKE_ABSOLUTE_SOURCE_PATH"];
if(project->isActiveConfig("depend_includepath"))
incDirs += v["INCLUDEPATH"];
- QList<QMakeLocalFileName> deplist;
+ QVector<QMakeLocalFileName> deplist;
deplist.reserve(incDirs.size());
for (ProStringList::Iterator it = incDirs.begin(); it != incDirs.end(); ++it)
deplist.append(QMakeLocalFileName((*it).toQString()));
QMakeSourceFileInfo::setDependencyPaths(deplist);
debug_msg(1, "Dependency Directories: %s",
incDirs.join(QString(" :: ")).toLatin1().constData());
- //cache info
- if(project->isActiveConfig("qmake_cache")) {
- QString cache_file;
- if(!project->isEmpty("QMAKE_INTERNAL_CACHE_FILE")) {
- cache_file = QDir::fromNativeSeparators(project->first("QMAKE_INTERNAL_CACHE_FILE").toQString());
- } else {
- cache_file = ".qmake.internal.cache";
- if(project->isActiveConfig("build_pass"))
- cache_file += ".BUILD." + project->first("BUILD_PASS");
- }
- if(cache_file.indexOf('/') == -1)
- cache_file.prepend(Option::output_dir + '/');
- QMakeSourceFileInfo::setCacheFile(cache_file);
- }
//add to dependency engine
for(x = 0; x < compilers.count(); ++x) {
@@ -994,25 +966,25 @@ MakefileGenerator::writePrlFile(QTextStream &t)
QString bdir = Option::output_dir;
if(bdir.isEmpty())
bdir = qmake_getpwd();
- t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << endl;
+ t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << Qt::endl;
- t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << endl;
+ t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << Qt::endl;
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
- t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl;
- t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << endl;
+ t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << Qt::endl;
+ t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_DEFINES"))
- t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << endl;
+ t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_CFLAGS"))
- t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << endl;
+ t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << Qt::endl;
if(!project->isEmpty("PRL_EXPORT_CXXFLAGS"))
- t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << endl;
+ t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << Qt::endl;
if(!project->isEmpty("CONFIG"))
- t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << endl;
+ t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << Qt::endl;
if(!project->isEmpty("TARGET_VERSION_EXT"))
- t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl;
+ t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << Qt::endl;
else if(!project->isEmpty("VERSION"))
- t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << endl;
+ t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << Qt::endl;
if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib")) {
ProStringList libs;
if (!project->isActiveConfig("staticlib"))
@@ -1022,7 +994,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
t << "QMAKE_PRL_LIBS =";
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
t << qv(project->values((*it).toKey()));
- t << endl;
+ t << Qt::endl;
t << "QMAKE_PRL_LIBS_FOR_CMAKE = ";
QString sep;
@@ -1030,7 +1002,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
t << sep << project->values((*it).toKey()).join(';').replace('\\', "\\\\");
sep = ';';
}
- t << endl;
+ t << Qt::endl;
}
}
@@ -1061,17 +1033,17 @@ MakefileGenerator::writeProjectMakefile()
//install
t << "install: ";
- for(it = targets.begin(); it != targets.end(); ++it)
- t << (*it)->target << "-install ";
- t << endl;
+ for (SubTarget *s : qAsConst(targets))
+ t << s->target << '-';
+ t << "install " << Qt::endl;
//uninstall
t << "uninstall: ";
for(it = targets.begin(); it != targets.end(); ++it)
t << (*it)->target << "-uninstall ";
- t << endl;
+ t << Qt::endl;
} else {
- t << "first: " << targets.first()->target << endl
+ t << "first: " << targets.first()->target << Qt::endl
<< "install: " << targets.first()->target << "-install\n"
<< "uninstall: " << targets.first()->target << "-uninstall\n";
}
@@ -1080,7 +1052,7 @@ MakefileGenerator::writeProjectMakefile()
if(!project->isActiveConfig("no_autoqmake")) {
QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName()));
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it)
- t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl;
+ t << escapeDependencyPath((*it)->makefile) << ": " << mkf << Qt::endl;
}
qDeleteAll(targets);
return true;
@@ -1195,7 +1167,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
p.replace(stringObj, escapeFilePath(dstf));
t << "\n\t" << p;
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
}
@@ -1310,9 +1282,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += fi.fileName();
QString cmd;
if (is_target || (!fi.isDir() && fi.isExecutable()))
- cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
+ cmd = QLatin1String("$(QINSTALL_PROGRAM)");
else
- cmd = QLatin1String("-$(QINSTALL)");
+ cmd = QLatin1String("$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -1332,9 +1304,9 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
dst_file += filestr;
QString cmd;
if (installConfigValues.contains("executable"))
- cmd = QLatin1String("-$(QINSTALL_PROGRAM)");
+ cmd = QLatin1String("$(QINSTALL_PROGRAM)");
else
- cmd = QLatin1String("-$(QINSTALL)");
+ cmd = QLatin1String("$(QINSTALL)");
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))));
@@ -1347,7 +1319,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
if (!dst_file.endsWith(Option::dir_sep))
dst_file += Option::dir_sep;
dst_file += fi.fileName();
- QString cmd = QLatin1String("-$(QINSTALL) ") +
+ QString cmd = QLatin1String("$(QINSTALL) ") +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
@@ -1389,14 +1361,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QString tmp_dst = fileFixify((*pit).toQString(), FileFixifyAbsolute, false);
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
}
- t << target << endl << endl;
+ t << target << Qt::endl << Qt::endl;
if(!uninst.isEmpty()) {
t << "uninstall_" << (*it) << ": FORCE";
for (int i = uninst.size(); --i >= 0; )
t << "\n\t" << uninst.at(i);
t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n";
}
- t << endl;
+ t << Qt::endl;
if (installConfigValues.indexOf("no_default_install") == -1) {
all_installs += QString("install_") + (*it) + " ";
@@ -1833,7 +1805,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
t << escapeDependencyPath(targ) << ":" << deps;
if(!cmd.isEmpty())
t << "\n\t" << cmd;
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
}
@@ -1853,7 +1825,7 @@ static QStringList splitDeps(const QString &indeps, bool lineMode)
QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &file)
{
- const QList<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
+ const QVector<QMakeLocalFileName> &depdirs = QMakeSourceFileInfo::dependencyPaths();
for (const auto &depdir : depdirs) {
const QString &local = depdir.local();
QString lf = outDir.absoluteFilePath(local + '/' + file);
@@ -1878,6 +1850,58 @@ QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &
return {};
}
+void MakefileGenerator::callExtraCompilerDependCommand(const ProString &extraCompiler,
+ const QString &dep_cd_cmd,
+ const QString &tmp_dep_cmd,
+ const QString &inpf,
+ const QString &tmp_out,
+ bool dep_lines,
+ QStringList *deps,
+ bool existingDepsOnly)
+{
+ char buff[256];
+ QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
+ dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
+ if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
+ QByteArray depData;
+ while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
+ depData.append(buff, read_in);
+ QT_PCLOSE(proc);
+ const QString indeps = QString::fromLocal8Bit(depData);
+ if (indeps.isEmpty())
+ return;
+ QDir outDir(Option::output_dir);
+ QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
+ for (int i = 0; i < dep_cmd_deps.count(); ++i) {
+ QString &file = dep_cmd_deps[i];
+ const QString absFile = outDir.absoluteFilePath(file);
+ if (absFile == file) {
+ // already absolute; don't do any checks.
+ } else if (exists(absFile)) {
+ file = absFile;
+ } else {
+ const QString localFile = resolveDependency(outDir, file);
+ if (localFile.isEmpty()) {
+ if (exists(file)) {
+ warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
+ " prints paths relative to source directory",
+ extraCompiler.toLatin1().constData());
+ } else if (existingDepsOnly) {
+ file.clear();
+ } else {
+ file = absFile; // fallback for generated resources
+ }
+ } else {
+ file = localFile;
+ }
+ }
+ if (!file.isEmpty())
+ file = fileFixify(file);
+ }
+ deps->append(dep_cmd_deps);
+ }
+}
+
void
MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
{
@@ -1925,7 +1949,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
FileFixifyFromOutdir));
}
}
- t << endl;
+ t << Qt::endl;
if (config.indexOf("no_clean") == -1) {
QStringList raw_clean = project->values(ProKey(*it + ".clean")).toQStringList();
@@ -1990,7 +2014,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
}
}
- t << endl;
+ t << Qt::endl;
}
const bool existingDepsOnly = config.contains("dep_existing_only");
QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
@@ -2008,46 +2032,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
deps += findDependencies(inpf);
inputs += Option::fixPathToTargetOS(inpf, false);
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
- char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
- dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
- if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
- QByteArray depData;
- while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
- depData.append(buff, read_in);
- QT_PCLOSE(proc);
- const QString indeps = QString::fromLocal8Bit(depData);
- if(!indeps.isEmpty()) {
- QDir outDir(Option::output_dir);
- QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
- for(int i = 0; i < dep_cmd_deps.count(); ++i) {
- QString &file = dep_cmd_deps[i];
- QString absFile = outDir.absoluteFilePath(file);
- if (absFile == file) {
- // already absolute; don't do any checks.
- } else if (exists(absFile)) {
- file = absFile;
- } else {
- QString localFile = resolveDependency(outDir, file);
- if (localFile.isEmpty()) {
- if (exists(file))
- warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
- " prints paths relative to source directory",
- (*it).toLatin1().constData());
- else if (existingDepsOnly)
- file.clear();
- else
- file = absFile; // fallback for generated resources
- } else {
- file = localFile;
- }
- }
- if(!file.isEmpty())
- file = fileFixify(file);
- }
- deps += dep_cmd_deps;
- }
- }
+ callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
+ tmp_out, dep_lines, &deps, existingDepsOnly);
}
}
for(int i = 0; i < inputs.size(); ) {
@@ -2074,7 +2060,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(finalizeDependencyPaths(deps));
}
- t << "\n\t" << cmd << endl << endl;
+ t << "\n\t" << cmd << Qt::endl << Qt::endl;
continue;
}
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
@@ -2095,46 +2081,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
- char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
- dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
- if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
- QByteArray depData;
- while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
- depData.append(buff, read_in);
- QT_PCLOSE(proc);
- const QString indeps = QString::fromLocal8Bit(depData);
- if(!indeps.isEmpty()) {
- QDir outDir(Option::output_dir);
- QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
- for(int i = 0; i < dep_cmd_deps.count(); ++i) {
- QString &file = dep_cmd_deps[i];
- QString absFile = outDir.absoluteFilePath(file);
- if (absFile == file) {
- // already absolute; don't do any checks.
- } else if (exists(absFile)) {
- file = absFile;
- } else {
- QString localFile = resolveDependency(outDir, file);
- if (localFile.isEmpty()) {
- if (exists(file))
- warn_msg(WarnDeprecated, ".depend_command for extra compiler %s"
- " prints paths relative to source directory",
- (*it).toLatin1().constData());
- else if (existingDepsOnly)
- file.clear();
- else
- file = absFile; // fallback for generated resources
- } else {
- file = localFile;
- }
- }
- if(!file.isEmpty())
- file = fileFixify(file);
- }
- deps += dep_cmd_deps;
- }
- }
+ callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
+ tmp_out, dep_lines, &deps, existingDepsOnly);
//use the depend system to find includes of these included files
QStringList inc_deps;
for(int i = 0; i < deps.size(); ++i) {
@@ -2185,10 +2133,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
++i;
}
t << escapeDependencyPath(out) << ": " << valList(finalizeDependencyPaths(deps)) << "\n\t"
- << cmd << endl << endl;
+ << cmd << Qt::endl << Qt::endl;
}
}
- t << "compiler_clean: " << clean_targets << endl << endl;
+ t << "compiler_clean: " << clean_targets << Qt::endl << Qt::endl;
}
void
@@ -2204,17 +2152,17 @@ MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
first = false;
}
t << "QMAKE_COMP_" << (*varit) << " = "
- << valList(project->values((*varit).toKey())) << endl;
+ << valList(project->values((*varit).toKey())) << Qt::endl;
}
}
if(!first)
- t << endl;
+ t << Qt::endl;
}
void
MakefileGenerator::writeExtraVariables(QTextStream &t)
{
- t << endl;
+ t << Qt::endl;
ProStringList outlist;
const ProValueMap &vars = project->variables();
@@ -2228,7 +2176,7 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
}
if (!outlist.isEmpty()) {
t << "####### Custom Variables\n";
- t << outlist.join('\n') << endl << endl;
+ t << outlist.join('\n') << Qt::endl << Qt::endl;
}
}
@@ -2244,11 +2192,11 @@ MakefileGenerator::writeExportedVariables(QTextStream &t)
const ProString &name = project->first(ProKey(exp + ".name"));
const ProString &value = project->first(ProKey(exp + ".value"));
if (!value.isEmpty())
- t << name << " = " << value << endl;
+ t << name << " = " << value << Qt::endl;
else
t << name << " =\n";
}
- t << endl;
+ t << Qt::endl;
}
bool
@@ -2256,7 +2204,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
{
if (project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty())
return false;
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
+ t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
t << *it << " ";
@@ -2270,21 +2218,6 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
}
bool
-MakefileGenerator::writeStubMakefile(QTextStream &t)
-{
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
- t << *it << " ";
- //const QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName()));
- t << "first all clean install distclean uninstall: qmake\n"
- << "qmake_all:\n";
- writeMakeQmake(t);
- t << "FORCE:\n\n";
- return true;
-}
-
-bool
MakefileGenerator::writeMakefile(QTextStream &t)
{
t << "####### Compile\n\n";
@@ -2301,22 +2234,22 @@ MakefileGenerator::writeMakefile(QTextStream &t)
void
MakefileGenerator::writeDefaultVariables(QTextStream &t)
{
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
- t << "COPY = " << var("QMAKE_COPY") << endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
- t << "MOVE = " << var("QMAKE_MOVE") << endl;
+ t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
+ t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << Qt::endl;
+ t << "MKDIR = " << var("QMAKE_MKDIR") << Qt::endl;
+ t << "COPY = " << var("QMAKE_COPY") << Qt::endl;
+ t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << Qt::endl;
+ t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << Qt::endl;
+ t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << Qt::endl;
+ t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << Qt::endl;
+ t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << Qt::endl;
+ t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << Qt::endl;
+ t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << Qt::endl;
+ t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
+ t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << Qt::endl;
+ t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << Qt::endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
}
QString MakefileGenerator::buildArgs(bool withExtra)
@@ -2335,9 +2268,9 @@ QString MakefileGenerator::buildArgs(bool withExtra)
//could get stored argv, but then it would have more options than are
//probably necesary this will try to guess the bare minimum..
-QString MakefileGenerator::build_args()
+QString MakefileGenerator::fullBuildArgs()
{
- QString ret = "$(QMAKE)";
+ QString ret;
//output
QString ofile = fileFixify(Option::output.fileName());
@@ -2357,18 +2290,18 @@ void
MakefileGenerator::writeHeader(QTextStream &t)
{
t << "#############################################################################\n";
- t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
+ t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << Qt::endl;
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n";
- t << "# Project: " << fileFixify(project->projectFile()) << endl;
- t << "# Template: " << var("TEMPLATE") << endl;
+ t << "# Project: " << fileFixify(project->projectFile()) << Qt::endl;
+ t << "# Template: " << var("TEMPLATE") << Qt::endl;
if(!project->isActiveConfig("build_pass"))
- t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << endl;
+ t << "# Command: " << var("QMAKE_QMAKE") << fullBuildArgs() << Qt::endl;
t << "#############################################################################\n";
- t << endl;
+ t << Qt::endl;
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
if (ofile.lastIndexOf(Option::dir_sep) != -1)
ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
- t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl;
+ t << "MAKEFILE = " << escapeFilePath(ofile) << Qt::endl << Qt::endl;
t << "EQ = =\n\n";
}
@@ -2507,7 +2440,7 @@ MakefileGenerator::writeSubDirs(QTextStream &t)
void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments)
{
- t << callPrefix << "$(MAKE)" << makeArguments << endl;
+ t << callPrefix << "$(MAKE)" << makeArguments << Qt::endl;
}
void
@@ -2526,20 +2459,30 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t,
writeSubMakeCall(t, out_directory_cdin + pfx, makefilein);
}
+static void chopEndLines(QString *s)
+{
+ while (!s->isEmpty()) {
+ const ushort c = s->at(s->size() - 1).unicode();
+ if (c != '\n' && c != '\r')
+ break;
+ s->chop(1);
+ }
+}
+
void
MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubTarget*> targets, int flags)
{
// blasted includes
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
for (ProStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
- t << "include " << (*qeui_it) << endl;
+ t << "include " << (*qeui_it) << Qt::endl;
if (!(flags & SubTargetSkipDefaultVariables)) {
writeDefaultVariables(t);
t << "SUBTARGETS = "; // subtargets are sub-directory
for(int target = 0; target < targets.size(); ++target)
t << " \\\n\t\t" << targets.at(target)->target;
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
writeExtraVariables(t);
@@ -2551,6 +2494,14 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
<< QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
}
+ struct SequentialInstallData
+ {
+ QString targetPrefix;
+ QString commands;
+ QTextStream commandsStream;
+ SequentialInstallData() : commandsStream(&commands) {}
+ };
+ std::unique_ptr<SequentialInstallData> sequentialInstallData;
bool dont_recurse = project->isActiveConfig("dont_recurse");
// generate target rules
@@ -2595,7 +2546,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if (!dont_recurse)
writeSubMakeCall(t, out_directory_cdin, makefilein + " qmake_all");
else
- t << endl;
+ t << Qt::endl;
}
{ //actually compile
@@ -2619,6 +2570,16 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
else if(s == "make_first")
s = QString();
+ if (project->isActiveConfig("build_all") && s == "install") {
+ if (!sequentialInstallData)
+ sequentialInstallData.reset(new SequentialInstallData);
+ sequentialInstallData->targetPrefix += subtarget->target + '-';
+ writeSubTargetCall(sequentialInstallData->commandsStream, in_directory, in,
+ out_directory, out, out_directory_cdin,
+ makefilein + " " + s);
+ chopEndLines(&sequentialInstallData->commands);
+ }
+
if(flags & SubTargetOrdered) {
t << subtarget->target << "-" << targetSuffixes.at(suffix) << "-ordered:";
if(target)
@@ -2636,7 +2597,12 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
out_directory_cdin, makefilein + " " + s);
}
}
- t << endl;
+ t << Qt::endl;
+
+ if (sequentialInstallData) {
+ t << sequentialInstallData->targetPrefix << "install: FORCE"
+ << sequentialInstallData->commands << Qt::endl << Qt::endl;
+ }
if (!(flags & SubTargetSkipDefaultTargets)) {
writeMakeQmake(t, true);
@@ -2685,7 +2651,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
} else if(suffix == "distclean") {
QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty())
- t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
+ t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n");
}
}
@@ -2698,7 +2664,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
cmd = var(ProKey(*qut_it + ".commands")), deps;
if(targ.isEmpty())
targ = (*qut_it).toQString();
- t << endl;
+ t << Qt::endl;
const ProStringList &deplist = project->values(ProKey(*qut_it + ".depends"));
for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
@@ -2711,7 +2677,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
QSet<QString> recurse;
const ProKey rkey(*qut_it + ".recurse");
if (project->isSet(rkey)) {
- recurse = project->values(rkey).toQStringList().toSet();
+ const QStringList values = project->values(rkey).toQStringList();
+ recurse = QSet<QString>(values.begin(), values.end());
} else {
for(int target = 0; target < targets.size(); ++target)
recurse.insert(targets.at(target)->name);
@@ -2773,7 +2740,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
deps += " FORCE";
t << escapeDependencyPath(Option::fixPathToTargetOS(targ, false)) << ":" << deps << "\n";
if(!cmd.isEmpty())
- t << "\t" << cmd << endl;
+ t << "\t" << cmd << Qt::endl;
}
if(flags & SubTargetInstalls) {
@@ -2791,10 +2758,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files));
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
- << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << endl;
+ << "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << Qt::endl;
}
- QString qmake = build_args();
+ QString qmake = "$(QMAKE)" + fullBuildArgs();
if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) {
t << escapeDependencyPath(ofile) << ": "
<< escapeDependencyPath(fileFixify(project->projectFile())) << " ";
@@ -2810,10 +2777,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
}
const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES"));
t << included.join(QString(" \\\n\t\t")) << "\n\t"
- << qmake << endl;
+ << qmake << Qt::endl;
const ProStringList &extraCommands = project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS");
if (!extraCommands.isEmpty())
- t << "\t" << extraCommands.join(QString("\n\t")) << endl;
+ t << "\t" << extraCommands.join(QString("\n\t")) << Qt::endl;
for(int include = 0; include < included.size(); ++include) {
const ProString &i = included.at(include);
if(!i.isEmpty())
@@ -2821,7 +2788,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
}
}
if(project->first("QMAKE_ORIG_TARGET") != "qmake") {
- t << "qmake: FORCE\n\t@" << qmake << endl << endl;
+ t << "qmake: FORCE\n\t@" << qmake << Qt::endl << Qt::endl;
if (!noDummyQmakeAll)
t << "qmake_all: FORCE\n\n";
}
@@ -3128,7 +3095,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
if(Option::output_dir != qmake_getpwd()
&& QDir::isRelativePath(dep.real())) { //is it from the shadow tree
- QList<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
+ QVector<QMakeLocalFileName> depdirs = QMakeSourceFileInfo::dependencyPaths();
depdirs.prepend(fileInfo(file.real()).absoluteDir().path());
QString pwd = qmake_getpwd();
if(pwd.at(pwd.length()-1) != '/')
@@ -3313,11 +3280,11 @@ MakefileGenerator::writePkgConfigFile()
if(includeDir.isEmpty())
includeDir = prefix + "/include";
- t << "prefix=" << prefix << endl;
+ t << "prefix=" << prefix << Qt::endl;
t << "exec_prefix=${prefix}\n"
<< "libdir=" << pkgConfigFixPath(libDir) << "\n"
- << "includedir=" << pkgConfigFixPath(includeDir) << endl;
- t << endl;
+ << "includedir=" << pkgConfigFixPath(includeDir) << Qt::endl;
+ t << Qt::endl;
//extra PKGCONFIG variables
const ProStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES");
@@ -3338,17 +3305,17 @@ MakefileGenerator::writePkgConfigFile()
}
}
if (!val.isEmpty())
- t << var << "=" << val << endl;
+ t << var << "=" << val << Qt::endl;
}
- t << endl;
+ t << Qt::endl;
QString name = project->first("QMAKE_PKGCONFIG_NAME").toQString();
if(name.isEmpty()) {
name = project->first("QMAKE_ORIG_TARGET").toQString().toLower();
name.replace(0, 1, name[0].toUpper());
}
- t << "Name: " << name << endl;
+ t << "Name: " << name << Qt::endl;
QString desc = project->values("QMAKE_PKGCONFIG_DESCRIPTION").join(' ');
if(desc.isEmpty()) {
if(name.isEmpty()) {
@@ -3366,12 +3333,12 @@ MakefileGenerator::writePkgConfigFile()
desc += " Application";
}
}
- t << "Description: " << desc << endl;
+ t << "Description: " << desc << Qt::endl;
ProString version = project->first("QMAKE_PKGCONFIG_VERSION");
if (version.isEmpty())
version = project->first("VERSION");
if (!version.isEmpty())
- t << "Version: " << version << endl;
+ t << "Version: " << version << Qt::endl;
if (project->first("TEMPLATE") == "lib") {
// libs
@@ -3409,7 +3376,7 @@ MakefileGenerator::writePkgConfigFile()
t << "Libs.private:";
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
t << ' ' << fixLibFlags((*it).toKey()).join(' ');
- t << endl;
+ t << Qt::endl;
}
}
@@ -3428,15 +3395,15 @@ MakefileGenerator::writePkgConfigFile()
&& libDir != QLatin1String("/Library/Frameworks")) {
t << " -F${libdir}";
}
- t << endl;
+ t << Qt::endl;
// requires
const QString requiresString = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');
if (!requiresString.isEmpty()) {
- t << "Requires: " << requiresString << endl;
+ t << "Requires: " << requiresString << Qt::endl;
}
- t << endl;
+ t << Qt::endl;
}
static QString windowsifyPath(const QString &str)
@@ -3451,7 +3418,7 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
QString ret;
if (project->isEmpty(replace_rule)
|| project->isActiveConfig("no_sed_meta_install")) {
- ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
+ ret += "$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
} else {
QString sedargs;
const ProStringList &replace_rules = project->values(replace_rule);
@@ -3466,9 +3433,9 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
}
}
if (sedargs.isEmpty()) {
- ret += "-$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
+ ret += "$(INSTALL_FILE) " + escapeFilePath(src) + ' ' + escapeFilePath(dst);
} else {
- ret += "-$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
+ ret += "$(SED) " + sedargs + ' ' + escapeFilePath(src) + " > " + escapeFilePath(dst);
}
}
return ret;
@@ -3479,4 +3446,37 @@ QString MakefileGenerator::shellQuote(const QString &str)
return isWindowsShell() ? IoUtils::shellQuoteWin(str) : IoUtils::shellQuoteUnix(str);
}
+/*
+ * Returns the name of the variable that contains the fully resolved target
+ * (including DESTDIR) of this generator.
+ */
+ProKey MakefileGenerator::fullTargetVariable() const
+{
+ return "TARGET";
+}
+
+void MakefileGenerator::createResponseFile(const QString &fileName, const ProStringList &objList)
+{
+ QString filePath = Option::output_dir + QDir::separator() + fileName;
+ QFile file(filePath);
+ if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ QTextStream t(&file);
+ for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
+ QString path = (*it).toQString();
+ // In response files, whitespace and special characters are
+ // escaped with a backslash; backslashes themselves can either
+ // be escaped into double backslashes, or, as this is a list of
+ // path names, converted to forward slashes.
+ path.replace(QLatin1Char('\\'), QLatin1String("/"))
+ .replace(QLatin1Char(' '), QLatin1String("\\ "))
+ .replace(QLatin1Char('\t'), QLatin1String("\\\t"))
+ .replace(QLatin1Char('"'), QLatin1String("\\\""))
+ .replace(QLatin1Char('\''), QLatin1String("\\'"));
+ t << path << Qt::endl;
+ }
+ t.flush();
+ file.close();
+ }
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 350ebd377a..47e4c7531c 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -54,11 +54,11 @@ struct ReplaceExtraCompilerCacheKey;
class MakefileGenerator : protected QMakeSourceFileInfo
{
QString spec;
- bool no_io;
+ bool no_io = false;
bool resolveDependenciesInFrameworks = false;
QHash<QString, bool> init_compiler_already;
QString makedir, chkexists;
- QString build_args();
+ QString fullBuildArgs();
//internal caches
mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache;
@@ -84,10 +84,13 @@ protected:
void writeExtraVariables(QTextStream &t);
void writeExtraTargets(QTextStream &t);
QString resolveDependency(const QDir &outDir, const QString &file);
+ void callExtraCompilerDependCommand(const ProString &extraCompiler, const QString &dep_cd_cmd,
+ const QString &tmp_dep_cmd, const QString &inpf,
+ const QString &tmp_out, bool dep_lines, QStringList *deps,
+ bool existingDepsOnly);
void writeExtraCompilerTargets(QTextStream &t);
void writeExtraCompilerVariables(QTextStream &t);
bool writeDummyMakefile(QTextStream &t);
- virtual bool writeStubMakefile(QTextStream &t);
virtual bool writeMakefile(QTextStream &t);
virtual void writeDefaultVariables(QTextStream &t);
@@ -131,7 +134,7 @@ protected:
QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool) override;
QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &) override;
QFileInfo findFileInfo(const QMakeLocalFileName &) override;
- QMakeProject *project;
+ QMakeProject *project = nullptr;
//escape
virtual QString escapeFilePath(const QString &path) const = 0;
@@ -254,10 +257,9 @@ protected:
const QStringRef &fixedBase, int slashOff);
bool processPrlFileCore(QString &origFile, const QStringRef &origName,
const QString &fixedFile);
+ void createResponseFile(const QString &fileName, const ProStringList &objList);
public:
- MakefileGenerator();
- ~MakefileGenerator();
QMakeProject *projectFile() const;
void setProjectFile(QMakeProject *p);
@@ -276,6 +278,7 @@ public:
virtual bool openOutput(QFile &, const QString &build) const;
bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); }
QString shellQuote(const QString &str);
+ virtual ProKey fullTargetVariable() const;
};
Q_DECLARE_TYPEINFO(MakefileGenerator::Compiler, Q_MOVABLE_TYPE);
Q_DECLARE_OPERATORS_FOR_FLAGS(MakefileGenerator::FileFixifyTypes)
@@ -295,9 +298,6 @@ inline QString MakefileGenerator::installRoot() const
inline bool MakefileGenerator::findLibraries(bool, bool)
{ return true; }
-inline MakefileGenerator::~MakefileGenerator()
-{ }
-
struct ReplaceExtraCompilerCacheKey
{
mutable uint hash;
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 1995cf63ba..d68539814e 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -60,8 +60,6 @@ QT_BEGIN_NAMESPACE
inline bool qmake_endOfLine(const char &c) { return (c == '\r' || c == '\n'); }
#endif
-//#define QMAKE_USE_CACHE
-
QMakeLocalFileName::QMakeLocalFileName(const QString &name) : is_null(name.isNull())
{
if(!name.isEmpty()) {
@@ -199,10 +197,10 @@ void QMakeSourceFileInfo::dependTreeWalker(SourceFile *node, SourceDependChildre
}
}
-void QMakeSourceFileInfo::setDependencyPaths(const QList<QMakeLocalFileName> &l)
+void QMakeSourceFileInfo::setDependencyPaths(const QVector<QMakeLocalFileName> &l)
{
// Ensure that depdirs does not contain the same paths several times, to minimize the stats
- QList<QMakeLocalFileName> ll;
+ QVector<QMakeLocalFileName> ll;
for (int i = 0; i < l.count(); ++i) {
if (!ll.contains(l.at(i)))
ll.append(l.at(i));
@@ -265,19 +263,10 @@ QMakeSourceFileInfo::QMakeSourceFileInfo(const QString &cf)
//buffer
spare_buffer = nullptr;
spare_buffer_size = 0;
-
- //cache
- cachefile = cf;
- if(!cachefile.isEmpty())
- loadCache(cachefile);
}
QMakeSourceFileInfo::~QMakeSourceFileInfo()
{
- //cache
- if(!cachefile.isEmpty() /*&& files_changed*/)
- saveCache(cachefile);
-
//buffer
if(spare_buffer) {
free(spare_buffer);
@@ -290,12 +279,6 @@ QMakeSourceFileInfo::~QMakeSourceFileInfo()
delete includes;
}
-void QMakeSourceFileInfo::setCacheFile(const QString &cf)
-{
- cachefile = cf;
- loadCache(cachefile);
-}
-
void QMakeSourceFileInfo::addSourceFiles(const ProStringList &l, uchar seek,
QMakeSourceFileInfo::SourceFileType type)
{
@@ -853,8 +836,8 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
}
}
if(!exists) { //path lookup
- for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
- QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
+ for (const QMakeLocalFileName &depdir : qAsConst(depdirs)) {
+ QMakeLocalFileName f(depdir.real() + Option::dir_sep + lfn.real());
QFileInfo fi(findFileInfo(f));
if(fi.exists() && !fi.isDir()) {
lfn = fixPathForFile(f);
@@ -946,10 +929,12 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
debug_msg(2, "findMocs: %s", file->file.local().toLatin1().constData());
int line_count = 1;
- bool ignore[3] = { false, false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE
+ // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE, [3] for Q_NAMESPACE_EXPORT
+ bool ignore[4] = { false, false, false, false };
/* qmake ignore Q_GADGET */
/* qmake ignore Q_OBJECT */
/* qmake ignore Q_NAMESPACE */
+ /* qmake ignore Q_NAMESPACE_EXPORT */
for(int x = 0; x < buffer_len; x++) {
#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count)
x = SKIP_BSNL(x);
@@ -988,6 +973,12 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
file->file.real().toLatin1().constData(), line_count);
x += 23;
ignore[2] = true;
+ } else if (buffer_len >= (x + 30) &&
+ !strncmp(buffer + x + 1, "make ignore Q_NAMESPACE_EXPORT", 30)) {
+ debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_NAMESPACE_EXPORT\"",
+ file->file.real().toLatin1().constData(), line_count);
+ x += 30;
+ ignore[3] = true;
}
} else if (buffer[x] == '*') {
extralines = 0;
@@ -1015,8 +1006,8 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
int morelines = 0;
int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &morelines);
if (buffer[y] == 'Q') {
- static const char interesting[][12] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE"};
- for (int interest = 0; interest < 3; ++interest) {
+ static const char interesting[][19] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE", "Q_NAMESPACE_EXPORT" };
+ for (int interest = 0; interest < 4; ++interest) {
if (ignore[interest])
continue;
@@ -1046,151 +1037,4 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
return true;
}
-
-void QMakeSourceFileInfo::saveCache(const QString &cf)
-{
-#ifdef QMAKE_USE_CACHE
- if(cf.isEmpty())
- return;
-
- QFile file(QMakeLocalFileName(cf).local());
- if(file.open(QIODevice::WriteOnly)) {
- QTextStream stream(&file);
- stream << QMAKE_VERSION_STR << endl << endl; //version
- { //cache verification
- QMap<QString, QStringList> verify = getCacheVerification();
- stream << verify.count() << endl;
- for(QMap<QString, QStringList>::iterator it = verify.begin();
- it != verify.end(); ++it) {
- stream << it.key() << endl << it.value().join(';') << endl;
- }
- stream << endl;
- }
- if(files->nodes) {
- for(int file = 0; file < files->num_nodes; ++file) {
- for(SourceFiles::SourceFileNode *node = files->nodes[file]; node; node = node->next) {
- stream << node->file->file.local() << endl; //source
- stream << node->file->type << endl; //type
-
- //depends
- stream << ";";
- if(node->file->deps) {
- for(int depend = 0; depend < node->file->deps->used_nodes; ++depend) {
- if(depend)
- stream << ";";
- stream << node->file->deps->children[depend]->file.local();
- }
- }
- stream << endl;
-
- stream << node->file->mocable << endl; //mocable
- stream << endl; //just for human readability
- }
- }
- }
- stream.flush();
- file.close();
- }
-#else
- Q_UNUSED(cf);
-#endif
-}
-
-void QMakeSourceFileInfo::loadCache(const QString &cf)
-{
- if(cf.isEmpty())
- return;
-
-#ifdef QMAKE_USE_CACHE
- QMakeLocalFileName cache_file(cf);
- int fd = open(QMakeLocalFileName(cf).local().toLatin1(), O_RDONLY);
- if(fd == -1)
- return;
- QFileInfo cache_fi = findFileInfo(cache_file);
- if(!cache_fi.exists() || cache_fi.isDir())
- return;
-
- QFile file;
- if (!file.open(fd, QIODevice::ReadOnly))
- return;
- QTextStream stream(&file);
-
- if (stream.readLine() == QMAKE_VERSION_STR) { //version check
- stream.skipWhiteSpace();
-
- bool verified = true;
- { //cache verification
- QMap<QString, QStringList> verify;
- int len = stream.readLine().toInt();
- for(int i = 0; i < len; ++i) {
- QString var = stream.readLine();
- QString val = stream.readLine();
- verify.insert(var, val.split(';', QString::SkipEmptyParts));
- }
- verified = verifyCache(verify);
- }
- if(verified) {
- stream.skipWhiteSpace();
- if(!files)
- files = new SourceFiles;
- while(!stream.atEnd()) {
- QString source = stream.readLine();
- QString type = stream.readLine();
- QString depends = stream.readLine();
- QString mocable = stream.readLine();
- stream.skipWhiteSpace();
-
- QMakeLocalFileName fn(source);
- QFileInfo fi = findFileInfo(fn);
-
- SourceFile *file = files->lookupFile(fn);
- if(!file) {
- file = new SourceFile;
- file->file = fn;
- files->addFile(file);
- file->type = (SourceFileType)type.toInt();
- file->exists = fi.exists();
- }
- if(fi.exists() && fi.lastModified() < cache_fi.lastModified()) {
- if(!file->dep_checked) { //get depends
- if(!file->deps)
- file->deps = new SourceDependChildren;
- file->dep_checked = true;
- QStringList depend_list = depends.split(";", QString::SkipEmptyParts);
- for(int depend = 0; depend < depend_list.size(); ++depend) {
- QMakeLocalFileName dep_fn(depend_list.at(depend));
- QFileInfo dep_fi(findFileInfo(dep_fn));
- SourceFile *dep = files->lookupFile(dep_fn);
- if(!dep) {
- dep = new SourceFile;
- dep->file = dep_fn;
- dep->exists = dep_fi.exists();
- dep->type = QMakeSourceFileInfo::TYPE_UNKNOWN;
- files->addFile(dep);
- }
- dep->included_count++;
- file->deps->addChild(dep);
- }
- }
- if(!file->moc_checked) { //get mocs
- file->moc_checked = true;
- file->mocable = mocable.toInt();
- }
- }
- }
- }
- }
-#endif
-}
-
-QMap<QString, QStringList> QMakeSourceFileInfo::getCacheVerification()
-{
- return QMap<QString, QStringList>();
-}
-
-bool QMakeSourceFileInfo::verifyCache(const QMap<QString, QStringList> &v)
-{
- return v == getCacheVerification();
-}
-
QT_END_NAMESPACE
diff --git a/qmake/generators/makefiledeps.h b/qmake/generators/makefiledeps.h
index 034197fd31..66b87bf470 100644
--- a/qmake/generators/makefiledeps.h
+++ b/qmake/generators/makefiledeps.h
@@ -33,6 +33,7 @@
#include <qstringlist.h>
#include <qfileinfo.h>
+#include <qvector.h>
QT_BEGIN_NAMESPACE
@@ -42,7 +43,8 @@ class SourceFiles;
class QMakeLocalFileName {
bool is_null;
- mutable QString real_name, local_name;
+ QString real_name;
+ mutable QString local_name;
public:
QMakeLocalFileName() : is_null(true) {}
QMakeLocalFileName(const QString &);
@@ -64,7 +66,7 @@ private:
//quick project lookups
SourceFiles *files, *includes;
bool files_changed;
- QList<QMakeLocalFileName> depdirs;
+ QVector<QMakeLocalFileName> depdirs;
QStringList systemIncludes;
//sleezy buffer code
@@ -77,9 +79,6 @@ private:
bool findDeps(SourceFile *);
void dependTreeWalker(SourceFile *, SourceDependChildren *);
- //cache
- QString cachefile;
-
protected:
virtual QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool forOpen=false);
virtual QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &);
@@ -90,8 +89,8 @@ public:
QMakeSourceFileInfo(const QString &cachefile="");
virtual ~QMakeSourceFileInfo();
- QList<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
- void setDependencyPaths(const QList<QMakeLocalFileName> &);
+ QVector<QMakeLocalFileName> dependencyPaths() const { return depdirs; }
+ void setDependencyPaths(const QVector<QMakeLocalFileName> &);
enum DependencyMode { Recursive, NonRecursive };
inline void setDependencyMode(DependencyMode mode) { dep_mode = mode; }
@@ -112,12 +111,6 @@ public:
bool mocable(const QString &file);
- virtual QMap<QString, QStringList> getCacheVerification();
- virtual bool verifyCache(const QMap<QString, QStringList> &);
- void setCacheFile(const QString &cachefile); //auto caching
- void loadCache(const QString &cf);
- void saveCache(const QString &cf);
-
private:
DependencyMode dep_mode;
};
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 8ebd0c61ce..7776d77008 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -27,13 +27,16 @@
****************************************************************************/
#include "metamakefile.h"
-#include "qregexp.h"
#include "qdir.h"
#include "qdebug.h"
#include "makefile.h"
#include "project.h"
#include "cachekeys.h"
+#include <algorithm>
+#include <iterator>
+#include <utility>
+
#define BUILDSMETATYPE 1
#define SUBDIRSMETATYPE 2
@@ -58,6 +61,8 @@ private:
QList<Build *> makefiles;
void clearBuilds();
MakefileGenerator *processBuild(const ProString &);
+ void accumulateVariableFromBuilds(const ProKey &name, Build *build) const;
+ void checkForConflictingTargets() const;
public:
@@ -96,9 +101,6 @@ BuildsMetaMakefileGenerator::init()
if(builds.count() > 1 && Option::output.fileName() == "-") {
use_single_build = true;
warn_msg(WarnLogic, "Cannot direct to stdout when using multiple BUILDS.");
- } else if(0 && !use_single_build && project->first("TEMPLATE") == "subdirs") {
- use_single_build = true;
- warn_msg(WarnLogic, "Cannot specify multiple builds with TEMPLATE subdirs.");
}
if(!use_single_build) {
for(int i = 0; i < builds.count(); i++) {
@@ -139,7 +141,8 @@ bool
BuildsMetaMakefileGenerator::write()
{
Build *glue = nullptr;
- if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) {
+ if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()
+ && Option::qmake_mode != Option::QMAKE_GENERATE_PRL) {
glue = new Build;
glue->name = name;
glue->makefile = createMakefileGenerator(project, true);
@@ -189,6 +192,8 @@ BuildsMetaMakefileGenerator::write()
if(!build->makefile) {
ret = false;
} else if(build == glue) {
+ checkForConflictingTargets();
+ accumulateVariableFromBuilds("QMAKE_INTERNAL_INCLUDED_FILES", build);
ret = build->makefile->writeProjectMakefile();
} else {
ret = build->makefile->write();
@@ -231,6 +236,53 @@ MakefileGenerator
return nullptr;
}
+void BuildsMetaMakefileGenerator::accumulateVariableFromBuilds(const ProKey &name, Build *dst) const
+{
+ ProStringList &values = dst->makefile->projectFile()->values(name);
+ for (auto build : makefiles) {
+ if (build != dst)
+ values += build->makefile->projectFile()->values(name);
+ }
+ values.removeDuplicates();
+}
+
+void BuildsMetaMakefileGenerator::checkForConflictingTargets() const
+{
+ if (makefiles.count() < 3) {
+ // Checking for conflicts only makes sense if we have more than one BUILD,
+ // and the last entry in makefiles is the "glue" Build.
+ return;
+ }
+ if (!project->isActiveConfig("build_all")) {
+ // Only complain if we're about to build all configurations.
+ return;
+ }
+ using TargetInfo = std::pair<Build *, ProString>;
+ QVector<TargetInfo> targets;
+ const int last = makefiles.count() - 1;
+ targets.resize(last);
+ for (int i = 0; i < last; ++i) {
+ Build *b = makefiles.at(i);
+ auto mkf = b->makefile;
+ auto prj = mkf->projectFile();
+ targets[i] = std::make_pair(b, prj->first(mkf->fullTargetVariable()));
+ }
+ std::stable_sort(targets.begin(), targets.end(),
+ [](const TargetInfo &lhs, const TargetInfo &rhs)
+ {
+ return lhs.second < rhs.second;
+ });
+ for (auto prev = targets.begin(), it = std::next(prev); it != targets.end(); ++prev, ++it) {
+ if (prev->second == it->second) {
+ warn_msg(WarnLogic, "Targets of builds '%s' and '%s' conflict: %s.",
+ qPrintable(prev->first->build),
+ qPrintable(it->first->build),
+ qPrintable(prev->second.toQString()));
+ break;
+ }
+ }
+}
+
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
{
protected:
@@ -328,17 +380,13 @@ SubdirsMetaMakefileGenerator::init()
hasError |= tmpError;
}
sub->makefile = MetaMakefileGenerator::createMetaGenerator(sub_proj, sub_name);
- if(0 && sub->makefile->type() == SUBDIRSMETATYPE) {
- subs.append(sub);
- } else {
- const QString output_name = Option::output.fileName();
- Option::output.setFileName(sub->output_file);
- hasError |= !sub->makefile->write();
- delete sub;
- qmakeClearCaches();
- sub = nullptr;
- Option::output.setFileName(output_name);
- }
+ const QString output_name = Option::output.fileName();
+ Option::output.setFileName(sub->output_file);
+ hasError |= !sub->makefile->write();
+ delete sub;
+ qmakeClearCaches();
+ sub = nullptr;
+ Option::output.setFileName(output_name);
Option::output_dir = old_output_dir;
qmake_setpwd(oldpwd);
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index 19acc09e85..613c97fb85 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -50,10 +50,6 @@ static QString project_builtin_regx() //calculate the builtin regular expression
return ret;
}
-ProjectGenerator::ProjectGenerator() : MakefileGenerator()
-{
-}
-
void
ProjectGenerator::init()
{
@@ -219,7 +215,7 @@ ProjectGenerator::init()
}
//setup deplist
- QList<QMakeLocalFileName> deplist;
+ QVector<QMakeLocalFileName> deplist;
{
const ProStringList &d = v["DEPENDPATH"];
for(int i = 0; i < d.size(); ++i)
@@ -324,14 +320,14 @@ ProjectGenerator::init()
bool
ProjectGenerator::writeMakefile(QTextStream &t)
{
- t << "######################################################################" << endl;
- t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << endl;
- t << "######################################################################" << endl << endl;
+ t << "######################################################################" << Qt::endl;
+ t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << Qt::endl;
+ t << "######################################################################" << Qt::endl << Qt::endl;
if (!Option::globals->extra_cmds[QMakeEvalBefore].isEmpty())
- t << Option::globals->extra_cmds[QMakeEvalBefore] << endl;
+ t << Option::globals->extra_cmds[QMakeEvalBefore] << Qt::endl;
t << getWritableVar("TEMPLATE_ASSIGN", false);
if(project->first("TEMPLATE_ASSIGN") == "subdirs") {
- t << endl << "# Directories" << "\n"
+ t << Qt::endl << "# Directories" << "\n"
<< getWritableVar("SUBDIRS");
} else {
//figure out target
@@ -343,7 +339,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
t << getWritableVar("TARGET_ASSIGN")
<< getWritableVar("CONFIG", false)
<< getWritableVar("CONFIG_REMOVE", false)
- << getWritableVar("INCLUDEPATH") << endl;
+ << getWritableVar("INCLUDEPATH") << Qt::endl;
t << "# You can make your code fail to compile if you use deprecated APIs.\n"
"# In order to do so, uncomment the following line.\n"
@@ -362,7 +358,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
<< getWritableVar("TRANSLATIONS");
}
if (!Option::globals->extra_cmds[QMakeEvalAfter].isEmpty())
- t << Option::globals->extra_cmds[QMakeEvalAfter] << endl;
+ t << Option::globals->extra_cmds[QMakeEvalAfter] << Qt::endl;
return true;
}
diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h
index 02a331bd4f..374bad98c7 100644
--- a/qmake/generators/projectgenerator.h
+++ b/qmake/generators/projectgenerator.h
@@ -46,15 +46,10 @@ protected:
QString escapeFilePath(const QString &) const override { Q_ASSERT(false); return QString(); }
public:
- ProjectGenerator();
- ~ProjectGenerator();
bool supportsMetaBuild() override { return false; }
bool openOutput(QFile &, const QString &) const override;
};
-inline ProjectGenerator::~ProjectGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // PROJECTGENERATOR_H
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index d7c9413290..e56e8c41b6 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -28,7 +28,6 @@
#include "unixmake.h"
#include "option.h"
-#include <qregexp.h>
#include <qfile.h>
#include <qhash.h>
#include <qdir.h>
@@ -199,9 +198,8 @@ UnixMakefileGenerator::init()
QString headerSuffix;
if (project->isActiveConfig("clang_pch_style"))
headerSuffix = project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
- else
- pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
+ pchBaseName += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
pchBaseName += Option::dir_sep;
ProString language = project->first(ProKey("QMAKE_LANGUAGE_" + compiler));
@@ -320,8 +318,7 @@ QStringList
if(!project->isEmpty("PRECOMPILED_DIR"))
header_prefix = project->first("PRECOMPILED_DIR").toQString();
header_prefix += project->first("QMAKE_ORIG_TARGET").toQString();
- if (!project->isActiveConfig("clang_pch_style"))
- header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
+ header_prefix += project->first("QMAKE_PCH_OUTPUT_EXT").toQString();
if (project->isActiveConfig("icc_pch_style")) {
// icc style
ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
@@ -393,7 +390,7 @@ UnixMakefileGenerator::fixLibFlag(const ProString &lib)
bool
UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
- QList<QMakeLocalFileName> libdirs, frameworkdirs;
+ QVector<QMakeLocalFileName> libdirs, frameworkdirs;
int libidx = 0, fwidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
libdirs.append(QMakeLocalFileName(dlib.toQString()));
@@ -419,9 +416,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
libdirs.insert(libidx++, f);
} else if(opt.startsWith("-l")) {
QString lib = opt.mid(2);
- for (QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin();
- dep_it != libdirs.end(); ++dep_it) {
- QString libBase = (*dep_it).local() + '/'
+ for (const QMakeLocalFileName &libdir : qAsConst(libdirs)) {
+ QString libBase = libdir.local() + '/'
+ project->first("QMAKE_PREFIX_SHLIB") + lib;
if (linkPrl && processPrlFile(libBase, true))
goto found;
@@ -435,12 +431,9 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
QMakeLocalFileName f(opt.mid(2));
if (!frameworkdirs.contains(f))
frameworkdirs.insert(fwidx++, f);
- } else if (target_mode == TARG_MAC_MODE && opt.startsWith("-framework")) {
+ } else if (target_mode == TARG_MAC_MODE && opt == "-framework") {
if (linkPrl) {
- if (opt.length() == 10)
- opt = (*++it).toQString();
- else
- opt = opt.mid(10).trimmed();
+ opt = (*++it).toQString();
static const QChar suffixMarker = ',';
const int suffixPosition = opt.indexOf(suffixMarker);
const bool hasSuffix = suffixPosition >= 0;
@@ -450,15 +443,21 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
opt.remove(suffixMarker); // Apply suffix by removing marker
}
for (const QMakeLocalFileName &dir : qAsConst(frameworkdirs)) {
+ auto processPrlIfFound = [&](QString directory) {
+ QString suffixedPrl = directory + opt;
+ if (processPrlFile(suffixedPrl, true))
+ return true;
+ if (hasSuffix) {
+ QString unsuffixedPrl = directory + frameworkName;
+ if (processPrlFile(unsuffixedPrl, true))
+ return true;
+ }
+ return false;
+ };
QString frameworkDirectory = dir.local() + "/" + frameworkName + + ".framework/";
- QString suffixedPrl = frameworkDirectory + opt;
- if (processPrlFile(suffixedPrl, true))
+ if (processPrlIfFound(frameworkDirectory + "Resources/")
+ || processPrlIfFound(frameworkDirectory))
break;
- if (hasSuffix) {
- QString unsuffixedPrl = frameworkDirectory + frameworkName;
- if (processPrlFile(unsuffixedPrl, true))
- break;
- }
}
} else {
if (opt.length() == 10)
@@ -604,7 +603,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
dst = escapeFilePath(filePrefixRoot(root, targetdir + src.section('/', -1)));
if(!ret.isEmpty())
ret += "\n\t";
- ret += "-$(QINSTALL) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
+ ret += "$(QINSTALL) " + escapeFilePath(Option::fixPathToTargetOS(src, false)) + ' ' + dst;
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
@@ -640,16 +639,16 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
QString copy_cmd;
if (bundle == SolidBundle) {
- copy_cmd += "-$(QINSTALL) " + src_targ + ' ' + plain_targ;
+ copy_cmd += "$(QINSTALL) " + src_targ + ' ' + plain_targ;
} else if (project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
- copy_cmd += "-$(QINSTALL) " + src_targ + ' ' + dst_targ;
+ copy_cmd += "$(QINSTALL) " + src_targ + ' ' + dst_targ;
} else if (!isAux) {
if (bundle == SlicedBundle) {
if (!ret.isEmpty())
ret += "\n\t";
ret += mkdir_p_asstring("\"`dirname " + dst_targ + "`\"", false);
}
- copy_cmd += "-$(QINSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
+ copy_cmd += "$(QINSTALL_PROGRAM) " + src_targ + ' ' + dst_targ;
}
if(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib")
&& project->values(ProKey(t + ".CONFIG")).indexOf("fix_rpath") != -1) {
@@ -702,7 +701,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
ret += "\n\t";
ret += mkdir_p_asstring("\"`dirname " + dst + "`\"", false) + "\n\t";
ret += "-$(DEL_FILE) " + dst + "\n\t"; // Can't overwrite symlinks to directories
- ret += "-$(QINSTALL) " + escapeFilePath(src) + " " + dst;
+ ret += "$(QINSTALL) " + escapeFilePath(src) + " " + dst;
if (!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) " + dst);
diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h
index 5b0766855b..28302b4f15 100644
--- a/qmake/generators/unix/unixmake.h
+++ b/qmake/generators/unix/unixmake.h
@@ -35,18 +35,13 @@ QT_BEGIN_NAMESPACE
class UnixMakefileGenerator : public MakefileGenerator
{
- bool include_deps;
+ bool include_deps = false;
QString libtoolFileName(bool fixify=true);
void writeLibtoolFile(); // for libtool
void writePrlFile(QTextStream &) override;
-public:
- UnixMakefileGenerator();
- ~UnixMakefileGenerator();
-
protected:
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
- bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
#ifdef Q_OS_WIN // MinGW x-compiling for QNX
QString installRoot() const override;
#endif
@@ -63,15 +58,12 @@ protected:
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override;
void writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &) override;
-
+ std::pair<bool, QString> writeObjectsPart(QTextStream &, bool do_incremental);
private:
void init2();
ProStringList libdirToFlags(const ProKey &key);
};
-inline UnixMakefileGenerator::~UnixMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // UNIXMAKE_H
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 9888b4816a..20f2c88444 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -39,11 +39,6 @@
QT_BEGIN_NAMESPACE
-UnixMakefileGenerator::UnixMakefileGenerator() : MakefileGenerator(), include_deps(false)
-{
-
-}
-
void
UnixMakefileGenerator::writePrlFile(QTextStream &t)
{
@@ -71,8 +66,6 @@ UnixMakefileGenerator::writeMakefile(QTextStream &t)
if (project->first("TEMPLATE") == "app" ||
project->first("TEMPLATE") == "lib" ||
project->first("TEMPLATE") == "aux") {
- if(Option::mkfile::do_stub_makefile && MakefileGenerator::writeStubMakefile(t))
- return true;
writeMakeParts(t);
return MakefileGenerator::writeMakefile(t);
} else if (project->first("TEMPLATE") == "subdirs") {
@@ -86,8 +79,8 @@ void
UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
{
MakefileGenerator::writeDefaultVariables(t);
- t << "TAR = " << var("QMAKE_TAR") << endl;
- t << "COMPRESS = " << var("QMAKE_GZIP") << endl;
+ t << "TAR = " << var("QMAKE_TAR") << Qt::endl;
+ t << "COMPRESS = " << var("QMAKE_GZIP") << Qt::endl;
if (project->isEmpty("QMAKE_DISTNAME")) {
ProString distname = project->first("QMAKE_ORIG_TARGET");
@@ -95,13 +88,13 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
distname += project->first("VERSION");
project->values("QMAKE_DISTNAME") = distname;
}
- t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << endl;
+ t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << Qt::endl;
if (project->isEmpty("QMAKE_DISTDIR"))
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
t << "DISTDIR = " << escapeFilePath(fileFixify(
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
- FileFixifyFromOutdir | FileFixifyAbsolute)) << endl;
+ FileFixifyFromOutdir | FileFixifyAbsolute)) << Qt::endl;
}
void
@@ -109,10 +102,10 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
{
MakefileGenerator::writeSubTargets(t, targets, flags);
- t << "dist: distdir FORCE" << endl;
+ t << "dist: distdir FORCE" << Qt::endl;
t << "\t(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
" && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "distdir:";
for (int target = 0; target < targets.size(); ++target) {
@@ -121,7 +114,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
}
t << " FORCE\n\t"
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
- << "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << endl << endl;
+ << "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << Qt::endl << Qt::endl;
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
for (int target = 0; target < targets.size(); ++target) {
@@ -154,7 +147,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
t << subtarget->target << "-distdir: FORCE";
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
out_directory_cdin, makefilein);
- t << endl;
+ t << Qt::endl;
}
}
@@ -196,11 +189,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
writeExportedVariables(t);
t << "####### Compiler, tools and options\n\n";
- t << "CC = " << var("QMAKE_CC") << endl;
- t << "CXX = " << var("QMAKE_CXX") << endl;
+ t << "CC = " << var("QMAKE_CC") << Qt::endl;
+ t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
- << varGlue("DEFINES","-D"," -D","") << endl;
+ << varGlue("DEFINES","-D"," -D","") << Qt::endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
t << "INCPATH =";
@@ -221,104 +214,74 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
t << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
- t << endl;
+ t << Qt::endl;
writeDefaultVariables(t);
if(!project->isActiveConfig("staticlib")) {
- t << "LINK = " << var("QMAKE_LINK") << endl;
- t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
+ t << "LINK = " << var("QMAKE_LINK") << Qt::endl;
+ t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = $(SUBLIBS) " << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
- << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
+ << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
}
- t << "AR = " << var("QMAKE_AR") << endl;
- t << "RANLIB = " << var("QMAKE_RANLIB") << endl;
- t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
- t << "STRIP = " << var("QMAKE_STRIP") << endl;
+ t << "AR = " << var("QMAKE_AR") << Qt::endl;
+ t << "RANLIB = " << var("QMAKE_RANLIB") << Qt::endl;
+ t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
+ t << "STRIP = " << var("QMAKE_STRIP") << Qt::endl;
- t << endl;
+ t << Qt::endl;
t << "####### Output directory\n\n";
// This is used in commands by some .prf files.
if (! project->values("OBJECTS_DIR").isEmpty())
- t << "OBJECTS_DIR = " << escapeDir(fileVar("OBJECTS_DIR")) << endl;
+ t << "OBJECTS_DIR = " << escapeDir(fileVar("OBJECTS_DIR")) << Qt::endl;
else
t << "OBJECTS_DIR = ./\n";
- t << endl;
+ t << Qt::endl;
/* files */
t << "####### Files\n\n";
// This is used by the dist target.
- t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << endl;
- if(do_incremental) {
- const ProStringList &objs = project->values("OBJECTS");
- const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
- ProStringList incrs_out;
- t << "OBJECTS = ";
- for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
- bool increment = false;
- for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
- if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
- QRegExp::Wildcard)) != -1) {
- increment = true;
- incrs_out.append((*objit));
- break;
- }
- }
- if(!increment)
- t << "\\\n\t\t" << (*objit);
- }
- if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
- t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
- } else if(!incrs_out.count()) {
- t << endl;
- } else {
- src_incremental = true;
- t << endl;
- t << "INCREMENTAL_OBJECTS = "
- << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
- }
- } else {
- // Used all over the place in both deps and commands.
- t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl;
- }
+ t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << Qt::endl;
+ auto objectParts = writeObjectsPart(t, do_incremental);
+ src_incremental = objectParts.first;
if(do_incremental && !src_incremental)
do_incremental = false;
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
- << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
- t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
- t << "DESTDIR = " << escapeDir(fileVar("DESTDIR")) << endl;
- t << "TARGET = " << fileVar("TARGET") << endl;
+ << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
+ t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl;
+ t << "DESTDIR = " << escapeDir(fileVar("DESTDIR")) << Qt::endl;
+ t << "TARGET = " << fileVar("TARGET") << Qt::endl;
if(project->isActiveConfig("plugin")) {
- t << "TARGETD = " << fileVar("TARGET") << endl;
+ t << "TARGETD = " << fileVar("TARGET") << Qt::endl;
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) {
- t << "TARGETA = " << fileVar("TARGETA") << endl;
+ t << "TARGETA = " << fileVar("TARGETA") << Qt::endl;
if(!project->isEmpty("QMAKE_BUNDLE")) {
- t << "TARGETD = " << fileVar("TARGET_x.y") << endl;
- t << "TARGET0 = " << fileVar("TARGET_") << endl;
+ t << "TARGETD = " << fileVar("TARGET_x.y") << Qt::endl;
+ t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
} else if (!project->isActiveConfig("unversioned_libname")) {
- t << "TARGET0 = " << fileVar("TARGET_") << endl;
+ t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
- t << "TARGETD = " << fileVar("TARGET_x.y.z") << endl;
- t << "TARGET1 = " << fileVar("TARGET_x") << endl;
- t << "TARGET2 = " << fileVar("TARGET_x.y") << endl;
+ t << "TARGETD = " << fileVar("TARGET_x.y.z") << Qt::endl;
+ t << "TARGET1 = " << fileVar("TARGET_x") << Qt::endl;
+ t << "TARGET2 = " << fileVar("TARGET_x.y") << Qt::endl;
} else {
- t << "TARGETD = " << fileVar("TARGET_x") << endl;
+ t << "TARGETD = " << fileVar("TARGET_x") << Qt::endl;
}
}
}
writeExtraCompilerVariables(t);
writeExtraVariables(t);
- t << endl;
+ t << Qt::endl;
// blasted includes
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
ProStringList::ConstIterator it;
for(it = qeui.begin(); it != qeui.end(); ++it)
- t << "include " << escapeDependencyPath(*it) << endl;
+ t << "include " << escapeDependencyPath(*it) << Qt::endl;
/* rules */
t << "first:" << (!project->isActiveConfig("no_default_goal_deps") ? " all" : "") << "\n";
@@ -328,7 +291,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
ProStringList objects = project->values("OBJECTS");
for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
- t << "-include " << escapeDependencyPath(d_file) << endl;
+ t << "-include " << escapeDependencyPath(d_file) << Qt::endl;
project->values("QMAKE_DISTCLEAN") << d_file;
}
} else {
@@ -386,8 +349,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
if(!deps.isEmpty())
- t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << endl;
- t << "-include " << d_file_d << endl;
+ t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << Qt::endl;
+ t << "-include " << d_file_d << Qt::endl;
project->values("QMAKE_DISTCLEAN") += d_file;
}
}
@@ -406,7 +369,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ' ';
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
QString target_deps;
if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl"))
@@ -511,7 +474,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else {
t << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) "
<< target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t";
@@ -520,11 +483,12 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << mkdir_p_asstring(destdir) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
- t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
+ t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) "
+ << objectParts.second << " $(OBJCOMP) $(LIBS)";
if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
allDeps = ' ' + depVar("TARGET");
} else if(!project->isActiveConfig("staticlib")) {
@@ -555,7 +519,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
//actual target
const QString link_deps = "$(OBJECTS) ";
t << incr_target_dir_d << ": " << link_deps << "\n\t"
- << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl;
+ << "ld -r -o " << incr_target_dir_f << ' ' << link_deps << Qt::endl;
//communicated below
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick
@@ -613,7 +577,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-$(MOVE) $(TARGET) " << destdir << "$(TARGET)";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
bundledFiles << destdir_r + var("TARGET");
t << "\n\t"
@@ -627,7 +591,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
t << "\n\t";
@@ -661,7 +625,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
} else {
t << "\n\t"
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t"
@@ -675,9 +639,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-$(MOVE) $(TARGET0) " << destdir << "$(TARGET0)\n\t";
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
if (! project->isActiveConfig("plugin")) {
t << "staticlib: " << depVar("TARGETA") << "\n\n";
@@ -695,7 +659,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\t" << var("QMAKE_POST_LINK");
if(!project->isEmpty("QMAKE_RANLIB"))
t << "\n\t$(RANLIB) $(TARGETA)";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
} else {
QString destdir_r = project->first("DESTDIR").toQString();
@@ -715,7 +679,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t" << var("QMAKE_POST_LINK") << "\n";
if (!project->isEmpty("QMAKE_RANLIB"))
t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
writeMakeQmake(t);
@@ -729,7 +693,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!meta_files.isEmpty())
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
- << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << endl;
+ << "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << Qt::endl;
}
if (!project->isEmpty("QMAKE_BUNDLE")) {
@@ -750,7 +714,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "@echo \"APPL"
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4))
- << "\" > " << pkginfo_f << endl;
+ << "\" > " << pkginfo_f << Qt::endl;
}
if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE");
@@ -859,7 +823,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" "
<< "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" "
- << "" << info_plist << " >" << info_plist_out << endl;
+ << "" << info_plist << " >" << info_plist_out << Qt::endl;
//copy the icon
if (!project->isEmpty("ICON")) {
QString dir = bundle_dir + "Contents/Resources/";
@@ -870,7 +834,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t"
<< mkdir_p_asstring(dir) << "\n\t"
<< "@$(DEL_FILE) " << icon_path_f << "\n\t"
- << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl;
+ << "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << Qt::endl;
}
} else {
ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME");
@@ -887,7 +851,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" "
<< "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "
- << "" << info_plist << " >" << info_plist_out << endl;
+ << "" << info_plist << " >" << info_plist_out << Qt::endl;
}
break;
} // project->isActiveConfig("no_plist")
@@ -931,10 +895,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QFileInfo fi(fileInfo(fn));
if(fi.isDir())
t << "@$(DEL_FILE) -r " << dst << "\n\t"
- << "@$(COPY_DIR) " << src << " " << dst << endl;
+ << "@$(COPY_DIR) " << src << " " << dst << Qt::endl;
else
t << "@$(DEL_FILE) " << dst << "\n\t"
- << "@$(COPY_FILE) " << src << " " << dst << endl;
+ << "@$(COPY_FILE) " << src << " " << dst << Qt::endl;
}
}
}
@@ -947,7 +911,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
alldeps << symIt.key();
t << escapeDependencyPath(symIt.key()) << ":\n\t"
<< mkdir_p_asstring(bundle_dir) << "\n\t"
- << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
+ << "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << Qt::endl;
}
if (!project->isActiveConfig("shallow_bundle")) {
@@ -959,24 +923,24 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
<< "@-$(DEL_FILE) " << currentLink_f << "\n\t"
<< "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
- << ' ' << currentLink_f << endl;
+ << ' ' << currentLink_f << Qt::endl;
}
}
}
- t << endl << "all: " << deps
+ t << Qt::endl << "all: " << deps
<< valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "")
- << allDeps << endl << endl;
+ << allDeps << Qt::endl << Qt::endl;
t << "dist: distdir FORCE\n\t";
t << "(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
" && $(MOVE) `dirname $(DISTDIR)`" << Option::dir_sep << "$(DISTNAME).tar.gz ."
" && $(DEL_FILE) -r $(DISTDIR)";
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "distdir: FORCE\n\t"
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
- << "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << endl;
+ << "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << Qt::endl;
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
@@ -986,20 +950,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(val.isEmpty())
continue;
t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ')
- << " $(DISTDIR)" << Option::dir_sep << endl;
+ << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
}
}
}
if(!project->isEmpty("TRANSLATIONS"))
- t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl;
- t << endl << endl;
+ t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
+ t << Qt::endl << Qt::endl;
QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS");
if(do_incremental) {
t << "incrclean:\n";
if(src_incremental)
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n";
- t << endl;
+ t << Qt::endl;
}
t << "clean:" << clean_targets << "\n\t";
@@ -1013,8 +977,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("PRECOMPILED_DIR"))
precomph_out_dir = project->first("PRECOMPILED_DIR");
precomph_out_dir += project->first("QMAKE_ORIG_TARGET");
- if (!project->isActiveConfig("clang_pch_style"))
- precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT");
+ precomph_out_dir += project->first("QMAKE_PCH_OUTPUT_EXT");
if (project->isActiveConfig("icc_pch_style")) {
// icc style
@@ -1067,7 +1030,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
<< "-$(DEL_FILE) *~ core *.core\n"
- << fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
+ << fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << Qt::endl << Qt::endl;
ProString destdir = project->first("DESTDIR");
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
@@ -1075,7 +1038,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n';
if(!project->isEmpty("QMAKE_BUNDLE")) {
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
- t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
+ t << "\t-$(DEL_FILE) -r " << bundlePath << Qt::endl;
} else if (project->isActiveConfig("staticlib") || project->isActiveConfig("plugin")) {
t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n";
} else if (project->values("QMAKE_APP_FLAG").isEmpty()) {
@@ -1094,9 +1057,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
{
QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty())
- t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
+ t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "####### Sub-libraries\n\n";
if (!project->values("SUBLIBS").isEmpty()) {
@@ -1107,7 +1070,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
for (it = l.begin(); it != l.end(); ++it)
t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t"
- << var(ProKey("MAKELIB" + *it)) << endl << endl;
+ << var(ProKey("MAKELIB" + *it)) << Qt::endl << Qt::endl;
}
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
@@ -1133,8 +1096,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->isEmpty("PRECOMPILED_DIR"))
pchOutput = project->first("PRECOMPILED_DIR");
pchOutput += pchBaseName;
- if (!project->isActiveConfig("clang_pch_style"))
- pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
+ pchOutput += project->first("QMAKE_PCH_OUTPUT_EXT");
if (!project->isActiveConfig("icc_pch_style")) {
// gcc style (including clang_pch_style)
@@ -1191,7 +1153,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
compilerExecutable = "$(CXX)";
// compile command
- t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << endl << endl;
+ t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << Qt::endl << Qt::endl;
}
}
}
@@ -1237,8 +1199,9 @@ void UnixMakefileGenerator::init2()
else
ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)");
if (!project->isEmpty("QMAKE_BUNDLE")) {
- project->values("PRL_TARGET").prepend(
- project->first("QMAKE_BUNDLE") + Option::dir_sep + project->first("TARGET"));
+ project->values("PRL_TARGET").prepend(project->first("QMAKE_BUNDLE") +
+ "/Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") +
+ "/Resources/" + project->first("TARGET"));
ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
@@ -1553,4 +1516,56 @@ UnixMakefileGenerator::writeLibtoolFile()
"libdir='" << Option::fixPathToTargetOS(install_dir.toQString(), false) << "'\n";
}
+std::pair<bool, QString> UnixMakefileGenerator::writeObjectsPart(QTextStream &t, bool do_incremental)
+{
+ bool src_incremental = false;
+ QString objectsLinkLine;
+ const ProStringList &objs = project->values("OBJECTS");
+ if (do_incremental) {
+ const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
+ ProStringList incrs_out;
+ t << "OBJECTS = ";
+ for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
+ bool increment = false;
+ for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
+ if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
+ QRegExp::Wildcard)) != -1) {
+ increment = true;
+ incrs_out.append((*objit));
+ break;
+ }
+ }
+ if (!increment)
+ t << "\\\n\t\t" << (*objit);
+ }
+ if (incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
+ t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
+ } else if (!incrs_out.count()) {
+ t << endl;
+ } else {
+ src_incremental = true;
+ t << endl;
+ t << "INCREMENTAL_OBJECTS = "
+ << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
+ }
+ } else {
+ const ProString &objMax = project->first("QMAKE_LINK_OBJECT_MAX");
+ // Used all over the place in both deps and commands.
+ if (objMax.isEmpty() || project->values("OBJECTS").count() < objMax.toInt()) {
+ objectsLinkLine = "$(OBJECTS)";
+ } else {
+ QString ld_response_file = fileVar("OBJECTS_DIR");
+ ld_response_file += var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
+ if (!var("BUILD_NAME").isEmpty())
+ ld_response_file += "." + var("BUILD_NAME");
+ if (!var("MAKEFILE").isEmpty())
+ ld_response_file += "." + var("MAKEFILE");
+ createResponseFile(ld_response_file, objs);
+ objectsLinkLine = "@" + escapeFilePath(ld_response_file);
+ }
+ t << "OBJECTS = " << valList(escapeDependencyPaths(objs)) << endl;
+ }
+ return std::make_pair(src_incremental, objectsLinkLine);
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 2175841264..096b041056 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -38,10 +38,6 @@
QT_BEGIN_NAMESPACE
-MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator()
-{
-}
-
QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const
{
QString ret = path;
@@ -97,18 +93,6 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
project->first("TEMPLATE") == "aux") {
if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib")
writePkgConfigFile();
-
- if(Option::mkfile::do_stub_makefile) {
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
- for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
- t << escapeDependencyPath(*it) << ' ';
- t << "first all clean install distclean uninstall: qmake\n"
- << "qmake_all:\n";
- writeMakeQmake(t);
- t << "FORCE:\n\n";
- return true;
- }
writeMingwParts(t);
return MakefileGenerator::writeMakefile(t);
}
@@ -131,30 +115,6 @@ QString MingwMakefileGenerator::installRoot() const
return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)");
}
-static void createResponseFile(const QString &fileName, const ProStringList &objList)
-{
- QString filePath = Option::output_dir + QDir::separator() + fileName;
- QFile file(filePath);
- if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
- QTextStream t(&file);
- for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
- QString path = (*it).toQString();
- // In response files, whitespace and special characters are
- // escaped with a backslash; backslashes themselves can either
- // be escaped into double backslashes, or, as this is a list of
- // path names, converted to forward slashes.
- path.replace(QLatin1Char('\\'), QLatin1String("/"))
- .replace(QLatin1Char(' '), QLatin1String("\\ "))
- .replace(QLatin1Char('\t'), QLatin1String("\\\t"))
- .replace(QLatin1Char('"'), QLatin1String("\\\""))
- .replace(QLatin1Char('\''), QLatin1String("\\'"));
- t << path << endl;
- }
- t.flush();
- file.close();
- }
-}
-
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);
@@ -166,13 +126,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader)
- << ' ' << escapeFilePath(header) << endl << endl;
+ << ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader)
- << ' ' << escapeFilePath(header) << endl << endl;
+ << ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
}
}
@@ -257,21 +217,21 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
t << "-I";
t << escapeFilePath(inc) << ' ';
}
- t << endl;
+ t << Qt::endl;
}
void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
{
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- t << "LIB = " << var("QMAKE_LIB") << endl;
+ t << "LIB = " << var("QMAKE_LIB") << Qt::endl;
} else {
- t << "LINKER = " << var("QMAKE_LINK") << endl;
- t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
+ t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
+ t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = "
<< fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
- << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
+ << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
}
}
@@ -332,7 +292,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
}
if(!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" <<var("QMAKE_POST_LINK");
- t << endl;
+ t << Qt::endl;
}
void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
@@ -358,7 +318,11 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
if (defines.isEmpty())
defines = ProString(" $(DEFINES)");
- t << escapeDependencyPath(var("RES_FILE")) << ": " << escapeDependencyPath(rc_file) << "\n\t"
+ addSourceFile(rc_file, QMakeSourceFileInfo::SEEK_DEPS);
+ const QStringList rcDeps = QStringList(rc_file) << dependencies(rc_file);
+
+ t << escapeDependencyPath(var("RES_FILE")) << ": "
+ << escapeDependencyPaths(rcDeps).join(' ') << "\n\t"
<< var("QMAKE_RC") << " -i " << escapeFilePath(rc_file) << " -o " << fileVar("RES_FILE")
<< incPathStr << defines << "\n\n";
}
diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h
index 5da5b24088..8cae28a78b 100644
--- a/qmake/generators/win32/mingw_make.h
+++ b/qmake/generators/win32/mingw_make.h
@@ -35,9 +35,6 @@ QT_BEGIN_NAMESPACE
class MingwMakefileGenerator : public Win32MakefileGenerator
{
-public:
- MingwMakefileGenerator();
- ~MingwMakefileGenerator();
protected:
using MakefileGenerator::escapeDependencyPath;
QString escapeDependencyPath(const QString &path) const override;
@@ -65,9 +62,6 @@ private:
QString objectsLinkLine;
};
-inline MingwMakefileGenerator::~MingwMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // MINGW_MAKE_H
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 08a8c2168d..0515c7404f 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -34,6 +34,7 @@
#include <qscopedpointer.h>
#include <qstringlist.h>
#include <qfileinfo.h>
+#include <qregexp.h>
QT_BEGIN_NAMESPACE
@@ -299,14 +300,17 @@ inline XmlOutput::xml_output valueTagT( const triState v)
return valueTag(v == _True ? "true" : "false");
}
-static QString vcxCommandSeparator()
+static QString commandLinesForOutput(QStringList commands)
{
// MSBuild puts the contents of the custom commands into a batch file and calls it.
// As we want every sub-command to be error-checked (as is done by makefile-based
// backends), we insert the checks ourselves, using the undocumented jump target.
- static QString cmdSep =
- QLatin1String("&#x000D;&#x000A;if errorlevel 1 goto VCEnd&#x000D;&#x000A;");
- return cmdSep;
+ static QString errchk = QStringLiteral("if errorlevel 1 goto VCEnd");
+ for (int i = commands.count() - 2; i >= 0; --i) {
+ if (!commands.at(i).startsWith("rem", Qt::CaseInsensitive))
+ commands.insert(i + 1, errchk);
+ }
+ return commands.join('\n');
}
static QString unquote(const QString &value)
@@ -1657,7 +1661,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCustomBuildTool &tool)
{
xml << tag("Command")
<< attrTag("Condition", condition)
- << valueTag(tool.CommandLine.join(vcxCommandSeparator()));
+ << valueTag(commandLinesForOutput(tool.CommandLine));
}
if ( !tool.Description.isEmpty() )
@@ -1711,7 +1715,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCEventTool &tool)
{
xml
<< tag(tool.EventName)
- << tag(_Command) << valueTag(tool.CommandLine.join(vcxCommandSeparator()))
+ << tag(_Command) << valueTag(commandLinesForOutput(tool.CommandLine))
<< tag(_Message) << valueTag(tool.Description)
<< closetag(tool.EventName);
}
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index fd90cfcb2a..2fb24201bd 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -38,11 +38,6 @@
QT_BEGIN_NAMESPACE
-NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false)
-{
-
-}
-
bool
NmakeMakefileGenerator::writeMakefile(QTextStream &t)
{
@@ -53,10 +48,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
if(project->first("TEMPLATE") == "app" ||
project->first("TEMPLATE") == "lib" ||
project->first("TEMPLATE") == "aux") {
-#if 0
- if(Option::mkfile::do_stub_makefile)
- return MakefileGenerator::writeStubMakefile(t);
-#endif
writeNmakeParts(t);
return MakefileGenerator::writeMakefile(t);
}
@@ -143,7 +134,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' '
<< finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP "
- << escapeFilePath(precompH) << endl << endl;
+ << escapeFilePath(precompH) << Qt::endl << Qt::endl;
}
if (usePCHC) {
QString precompRuleC = QString("-c -Yc -Fp%1 -Fo%2")
@@ -151,7 +142,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t)
t << escapeDependencyPath(precompObjC) << ": " << escapeDependencyPath(precompH) << ' '
<< finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t")
<< "\n\t$(CC) " + precompRuleC +" $(CFLAGS) $(INCPATH) -TC "
- << escapeFilePath(precompH) << endl << endl;
+ << escapeFilePath(precompH) << Qt::endl << Qt::endl;
}
}
@@ -310,7 +301,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
t << " " << (*cit);
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
t << " " << (*cppit);
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
bool useInferenceRules = !project->isActiveConfig("no_batch");
QSet<QString> source_directories;
@@ -342,7 +333,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
QHash<QString, QString> fileNames;
bool duplicatesFound = false;
const QStringList sourceFilesFilter = sourceFilesForImplicitRulesFilter();
- QStringList fixifiedSourceDirs = fileFixify(source_directories.toList(), FileFixifyAbsolute);
+ QStringList fixifiedSourceDirs = fileFixify(QList<QString>(source_directories.constBegin(), source_directories.constEnd()), FileFixifyAbsolute);
fixifiedSourceDirs.removeDuplicates();
for (const QString &sourceDir : qAsConst(fixifiedSourceDirs)) {
QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot);
@@ -389,9 +380,9 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
}
} else {
for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit)
- t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl;
+ t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << Qt::endl << Qt::endl;
for(QStringList::Iterator cit = Option::c_ext.begin(); cit != Option::c_ext.end(); ++cit)
- t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl;
+ t << (*cit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << Qt::endl << Qt::endl;
}
}
@@ -494,7 +485,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
if(!project->isEmpty("QMAKE_POST_LINK")) {
t << "\n\t" << var("QMAKE_POST_LINK");
}
- t << endl;
+ t << Qt::endl;
}
void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &extraFlags, const QString &extraInlineFileContent)
diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h
index 5bfdba2bbc..3064f06521 100644
--- a/qmake/generators/win32/msvc_nmake.h
+++ b/qmake/generators/win32/msvc_nmake.h
@@ -54,17 +54,10 @@ protected:
QString var(const ProKey &value) const override;
QString precompH, precompObj, precompPch;
QString precompObjC, precompPchC;
- bool usePCH, usePCHC;
-
-public:
- NmakeMakefileGenerator();
- ~NmakeMakefileGenerator();
-
+ bool usePCH = false;
+ bool usePCHC = false;
};
-inline NmakeMakefileGenerator::~NmakeMakefileGenerator()
-{ }
-
QT_END_NAMESPACE
#endif // MSVC_NMAKE_H
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 5fb6bfb320..5396eba72e 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -34,6 +34,7 @@
#include <qscopedpointer.h>
#include <qfileinfo.h>
+#include <qregexp.h>
using namespace QMakeInternal;
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index b356f1bb73..33eff0d914 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -923,7 +923,7 @@ struct VCFilterFile
inline QDebug operator<<(QDebug dbg, const VCFilterFile &p)
{
dbg.nospace() << "VCFilterFile(file(" << p.file
- << ") excludeFromBuild(" << p.excludeFromBuild << "))" << endl;
+ << ") excludeFromBuild(" << p.excludeFromBuild << "))" << Qt::endl;
return dbg.space();
}
#endif
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 51d8002324..404088aa4a 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -209,7 +209,9 @@ bool VcprojGenerator::writeProjectMakefile()
struct VcsolutionDepend {
QString uuid;
- QString vcprojFile, orig_target, target;
+ QString vcprojFile;
+ QString projectName;
+ QString target;
Target targetType;
QStringList dependencies;
};
@@ -433,7 +435,8 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
Option::qmake_mode = old_mode;
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
- QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION");
+ const ProString projectName = tmp_vcproj.project->first("QMAKE_PROJECT_NAME");
+ const QString vcproj = projectName + project->first("VCPROJ_EXTENSION");
QString vcprojDir = Option::output_dir;
// If file doesn't exsist, then maybe the users configuration
@@ -445,14 +448,14 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
VcsolutionDepend *newDep = new VcsolutionDepend;
newDep->vcprojFile = vcprojDir + Option::dir_sep + vcproj;
- newDep->orig_target = tmp_proj.first("QMAKE_ORIG_TARGET").toQString();
+ newDep->projectName = projectName.toQString();
newDep->target = tmp_proj.first("MSVCPROJ_TARGET").toQString().section(Option::dir_sep, -1);
newDep->targetType = tmp_vcproj.projectTarget;
newDep->uuid = tmp_proj.isEmpty("QMAKE_UUID") ? getProjectUUID(Option::fixPathToLocalOS(vcprojDir + QDir::separator() + vcproj)).toString().toUpper(): tmp_proj.first("QMAKE_UUID").toQString();
// We want to store it as the .lib name.
if (newDep->target.endsWith(".dll"))
newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
- projGuids.insert(newDep->orig_target, newDep->target);
+ projGuids.insert(newDep->projectName, newDep->target);
if (tmpList.size()) {
const ProStringList depends = tmpList;
@@ -591,7 +594,7 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
// ### quoting rules?
t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid
- << "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile
+ << "\"" << (*it)->projectName << "\", \"" << (*it)->vcprojFile
<< "\", \"" << (*it)->uuid << "\"";
debug_msg(1, "Project %s has dependencies: %s", (*it)->target.toLatin1().constData(), (*it)->dependencies.join(" ").toLatin1().constData());
@@ -937,6 +940,15 @@ void VcprojGenerator::initProject()
vcProject.SccProjectName = project->first("SCCPROJECTNAME").toQString();
vcProject.SccLocalPath = project->first("SCCLOCALPATH").toQString();
vcProject.flat_files = project->isActiveConfig("flat");
+
+ // Set up the full target path for target conflict checking.
+ const QChar slash = QLatin1Char('/');
+ QString destdir = QDir::fromNativeSeparators(var("DESTDIR"));
+ if (!destdir.endsWith(slash))
+ destdir.append(slash);
+ project->values("DEST_TARGET") = ProStringList(destdir
+ + project->first("TARGET")
+ + project->first("TARGET_EXT"));
}
void VcprojGenerator::initConfiguration()
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 266bae7e64..86d10c213c 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -38,11 +38,9 @@
#include <qdir.h>
#include <stdlib.h>
-QT_BEGIN_NAMESPACE
+#include <algorithm>
-Win32MakefileGenerator::Win32MakefileGenerator() : MakefileGenerator()
-{
-}
+QT_BEGIN_NAMESPACE
ProString Win32MakefileGenerator::fixLibFlag(const ProString &lib)
{
@@ -77,16 +75,37 @@ Win32MakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg)
return LibFlagFile;
}
+class LibrarySearchPath : public QMakeLocalFileName
+{
+public:
+ LibrarySearchPath() = default;
+
+ LibrarySearchPath(const QString &s)
+ : QMakeLocalFileName(s)
+ {
+ }
+
+ LibrarySearchPath(QString &&s, bool isDefault = false)
+ : QMakeLocalFileName(std::move(s)), _default(isDefault)
+ {
+ }
+
+ bool isDefault() const { return _default; }
+
+private:
+ bool _default = false;
+};
+
bool
Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
{
ProStringList impexts = project->values("QMAKE_LIB_EXTENSIONS");
if (impexts.isEmpty())
impexts = project->values("QMAKE_EXTENSION_STATICLIB");
- QList<QMakeLocalFileName> dirs;
+ QVector<LibrarySearchPath> dirs;
int libidx = 0;
for (const ProString &dlib : project->values("QMAKE_DEFAULT_LIBDIRS"))
- dirs.append(QMakeLocalFileName(dlib.toQString()));
+ dirs.append(LibrarySearchPath(dlib.toQString(), true));
static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE",
"QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr };
for (int i = 0; lflags[i]; i++) {
@@ -96,20 +115,27 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
ProString arg;
LibFlagType type = parseLibFlag(opt, &arg);
if (type == LibFlagPath) {
- QMakeLocalFileName lp(arg.toQString());
- int idx = dirs.indexOf(lp);
+ const QString argqstr = arg.toQString();
+ auto dit = std::find_if(dirs.cbegin(), dirs.cend(),
+ [&argqstr](const LibrarySearchPath &p)
+ {
+ return p.real() == argqstr;
+ });
+ int idx = dit == dirs.cend()
+ ? -1
+ : std::distance(dirs.cbegin(), dit);
if (idx >= 0 && idx < libidx) {
it = l.erase(it);
continue;
}
+ const LibrarySearchPath lp(argqstr);
dirs.insert(libidx++, lp);
(*it) = "-L" + lp.real();
} else if (type == LibFlagLib) {
QString lib = arg.toQString();
ProString verovr =
project->first(ProKey("QMAKE_" + lib.toUpper() + "_VERSION_OVERRIDE"));
- for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
- dir_it != dirs.end(); ++dir_it) {
+ for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
QString cand = (*dir_it).real() + Option::dir_sep + lib;
if (linkPrl && processPrlFile(cand, true)) {
(*it) = cand;
@@ -119,7 +145,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
for (ProStringList::ConstIterator extit = impexts.cbegin();
extit != impexts.cend(); ++extit) {
if (exists(libBase + '.' + *extit)) {
- (*it) = cand + verovr + '.' + *extit;
+ *it = (dir_it->isDefault() ? lib : cand)
+ + verovr + '.' + *extit;
goto found;
}
}
@@ -132,8 +159,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
if (processPrlFile(lib, false))
(*it) = lib;
} else {
- for (QList<QMakeLocalFileName>::Iterator dir_it = dirs.begin();
- dir_it != dirs.end(); ++dir_it) {
+ for (auto dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
QString cand = (*dir_it).real() + Option::dir_sep + lib;
if (processPrlFile(cand, false)) {
(*it) = cand;
@@ -320,11 +346,11 @@ void Win32MakefileGenerator::processRcFileVar()
int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode
ts << "#include <windows.h>\n";
- ts << endl;
+ ts << Qt::endl;
if (!rcIcons.isEmpty()) {
for (int i = 0; i < rcIcons.size(); ++i)
- ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << endl;
- ts << endl;
+ ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << Qt::endl;
+ ts << Qt::endl;
}
if (!manifestFile.isEmpty()) {
QString manifestResourceId;
@@ -335,8 +361,8 @@ void Win32MakefileGenerator::processRcFileVar()
ts << manifestResourceId << " RT_MANIFEST \"" << manifestFile << "\"\n";
}
ts << "VS_VERSION_INFO VERSIONINFO\n";
- ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << endl;
- ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << endl;
+ ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << Qt::endl;
+ ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << Qt::endl;
ts << "\tFILEFLAGSMASK 0x3fL\n";
ts << "#ifdef _DEBUG\n";
ts << "\tFILEFLAGS VS_FF_DEBUG\n";
@@ -369,11 +395,11 @@ void Win32MakefileGenerator::processRcFileVar()
ts << "\t\tBEGIN\n";
ts << "\t\t\tVALUE \"Translation\", "
<< QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0'))
- << ", " << QString("%1").arg(rcCodePage, 4) << endl;
+ << ", " << QString("%1").arg(rcCodePage, 4) << Qt::endl;
ts << "\t\tEND\n";
ts << "\tEND\n";
ts << "/* End of Version info */\n";
- ts << endl;
+ ts << Qt::endl;
ts.flush();
@@ -470,7 +496,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
}
}
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
t << "distclean: clean " << depVar("DISTCLEAN_DEPS");
{
@@ -503,9 +529,9 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t)
{
QString ofile = fileFixify(Option::output.fileName());
if(!ofile.isEmpty())
- t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
+ t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
}
- t << endl;
+ t << Qt::endl;
}
void Win32MakefileGenerator::writeIncPart(QTextStream &t)
@@ -519,7 +545,7 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t)
if(!inc.isEmpty())
t << "-I" << escapeFilePath(inc) << ' ';
}
- t << endl;
+ t << Qt::endl;
}
void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
@@ -527,51 +553,29 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeExportedVariables(t);
t << "####### Compiler, tools and options\n\n";
- t << "CC = " << var("QMAKE_CC") << endl;
- t << "CXX = " << var("QMAKE_CXX") << endl;
+ t << "CC = " << var("QMAKE_CC") << Qt::endl;
+ t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
t << "DEFINES = "
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
- << varGlue("DEFINES","-D"," -D","") << endl;
+ << varGlue("DEFINES","-D"," -D","") << Qt::endl;
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
writeIncPart(t);
writeLibsPart(t);
-
- t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
- t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
- << endl;
- t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
- << endl;
- t << "ZIP = " << var("QMAKE_ZIP") << endl;
- t << "DEF_FILE = " << fileVar("DEF_FILE") << endl;
- t << "RES_FILE = " << fileVar("RES_FILE") << endl; // Not on mingw, can't see why not though...
- t << "COPY = " << var("QMAKE_COPY") << endl;
- t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
- t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
- t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
- t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
- t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
- t << "MOVE = " << var("QMAKE_MOVE") << endl;
- t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
- t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
- t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
- t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
- t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
- t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
- t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
- t << endl;
+ writeDefaultVariables(t);
+ t << Qt::endl;
t << "####### Output directory\n\n";
if(!project->values("OBJECTS_DIR").isEmpty())
- t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << endl;
+ t << "OBJECTS_DIR = " << escapeFilePath(var("OBJECTS_DIR").remove(QRegExp("\\\\$"))) << Qt::endl;
else
t << "OBJECTS_DIR = . \n";
- t << endl;
+ t << Qt::endl;
t << "####### Files\n\n";
t << "SOURCES = " << valList(escapeFilePaths(project->values("SOURCES")))
- << " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << endl;
+ << " " << valList(escapeFilePaths(project->values("GENERATED_SOURCES"))) << Qt::endl;
// do this here so we can set DEST_TARGET to be the complete path to the final target if it is needed.
QString orgDestDir = var("DESTDIR");
@@ -587,14 +591,14 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
writeExtraVariables(t);
t << "DIST = " << fileVarList("DISTFILES") << ' '
- << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
- t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl; // unused
+ << fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
+ t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl; // unused
// The comment is important to maintain variable compatibility with Unix
// Makefiles, while not interpreting a trailing-slash as a linebreak
t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak\n";
- t << "TARGET = " << escapeFilePath(target) << endl;
- t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << endl;
- t << endl;
+ t << "TARGET = " << escapeFilePath(target) << Qt::endl;
+ t << "DESTDIR_TARGET = " << fileVar("DEST_TARGET") << Qt::endl;
+ t << Qt::endl;
writeImplicitRulesPart(t);
@@ -606,10 +610,10 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
const ProStringList &dlldirs = project->values("DLLDESTDIR");
for (ProStringList::ConstIterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir) {
t << "\t-$(COPY_FILE) $(DESTDIR_TARGET) "
- << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << endl;
+ << escapeFilePath(Option::fixPathToTargetOS((*dlldir).toQString(), false)) << Qt::endl;
}
}
- t << endl;
+ t << Qt::endl;
writeRcFilePart(t);
}
@@ -642,33 +646,33 @@ void Win32MakefileGenerator::writeStandardParts(QTextStream &t)
}
}
}
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
writeCleanParts(t);
writeExtraTargets(t);
writeExtraCompilerTargets(t);
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
void Win32MakefileGenerator::writeLibsPart(QTextStream &t)
{
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
- t << "LIBAPP = " << var("QMAKE_LIB") << endl;
- t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << endl;
+ t << "LIBAPP = " << var("QMAKE_LIB") << Qt::endl;
+ t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << Qt::endl;
} else {
- t << "LINKER = " << var("QMAKE_LINK") << endl;
- t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
+ t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
+ t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
t << "LIBS = " << fixLibFlags("LIBS").join(' ') << ' '
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
- << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
+ << fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
}
}
void Win32MakefileGenerator::writeObjectsPart(QTextStream &t)
{
// Used in both deps and commands.
- t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl;
+ t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
}
void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &)
@@ -695,6 +699,9 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
incPathStr += escapeFilePath(path);
}
+ addSourceFile(rc_file, QMakeSourceFileInfo::SEEK_DEPS);
+ const QStringList rcDeps = QStringList(rc_file) << dependencies(rc_file);
+
// The resource tool may use defines. This might be the same defines passed in as the
// compiler, since you may use these defines in the .rc file itself.
// As the escape syntax for the command line defines for RC is different from that for CL,
@@ -706,11 +713,12 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
// Also, we need to add the _DEBUG define manually since the compiler defines this symbol
// by itself, and we use it in the automatically created rc file when VERSION is defined
// in the .pro file.
- t << escapeDependencyPath(res_file) << ": " << escapeDependencyPath(rc_file) << "\n\t"
+ t << escapeDependencyPath(res_file) << ": "
+ << escapeDependencyPaths(rcDeps).join(' ') << "\n\t"
<< var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
<< defines << incPathStr << " -fo " << escapeFilePath(res_file)
<< ' ' << escapeFilePath(rc_file);
- t << endl << endl;
+ t << Qt::endl << Qt::endl;
}
}
@@ -789,6 +797,20 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
return ret;
}
+void Win32MakefileGenerator::writeDefaultVariables(QTextStream &t)
+{
+ MakefileGenerator::writeDefaultVariables(t);
+ t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : var("QMAKE_IDC"))
+ << Qt::endl;
+ t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("midl") : var("QMAKE_IDL"))
+ << Qt::endl;
+ t << "ZIP = " << var("QMAKE_ZIP") << Qt::endl;
+ t << "DEF_FILE = " << fileVar("DEF_FILE") << Qt::endl;
+ t << "RES_FILE = " << fileVar("RES_FILE") << Qt::endl; // Not on mingw, can't see why not though...
+ t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
+ t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
+}
+
QString Win32MakefileGenerator::escapeFilePath(const QString &path) const
{
QString ret = path;
@@ -827,4 +849,9 @@ QString Win32MakefileGenerator::getManifestFileForRcFile() const
return QString();
}
+ProKey Win32MakefileGenerator::fullTargetVariable() const
+{
+ return "DEST_TARGET";
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index 4416951a09..09984fe355 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -35,11 +35,9 @@ QT_BEGIN_NAMESPACE
class Win32MakefileGenerator : public MakefileGenerator
{
-public:
- Win32MakefileGenerator();
- ~Win32MakefileGenerator();
protected:
QString defaultInstall(const QString &) override;
+ void writeDefaultVariables(QTextStream &t) override;
virtual void writeCleanParts(QTextStream &t);
virtual void writeStandardParts(QTextStream &t);
virtual void writeIncPart(QTextStream &t);
@@ -66,10 +64,10 @@ protected:
void processRcFileVar();
static QString cQuoted(const QString &str);
virtual QString getManifestFileForRcFile() const;
-};
-inline Win32MakefileGenerator::~Win32MakefileGenerator()
-{ }
+public:
+ ProKey fullTargetVariable() const override;
+};
QT_END_NAMESPACE
diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp
index 5d96128442..7fc1b081c7 100644
--- a/qmake/generators/xmloutput.cpp
+++ b/qmake/generators/xmloutput.cpp
@@ -241,7 +241,7 @@ void XmlOutput::newTagOpen(const QString &tag)
closeOpen();
if (format == NewLine)
- xmlFile << endl << currentIndent;
+ xmlFile << Qt::endl << currentIndent;
xmlFile << '<' << doConversion(tag);
currentState = Attribute;
tagStack.append(tag);
@@ -275,7 +275,7 @@ void XmlOutput::closeTag()
case Tag:
decreaseIndent(); // <--- Pre-decrease indent
if (format == NewLine)
- xmlFile << endl << currentIndent;
+ xmlFile << Qt::endl << currentIndent;
xmlFile << "</" << doConversion(tagStack.last()) << '>';
tagStack.pop_back();
break;
@@ -347,7 +347,7 @@ void XmlOutput::addAttribute(const QString &attribute, const QString &value)
break;
}
if (format == NewLine)
- xmlFile << endl;
+ xmlFile << Qt::endl;
xmlFile << currentIndent << doConversion(attribute) << "=\"" << doConversion(value) << "\"";
}
diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp
index 3e49a99cd5..d2171274d8 100644
--- a/qmake/library/ioutils.cpp
+++ b/qmake/library/ioutils.cpp
@@ -30,6 +30,7 @@
#include <qdir.h>
#include <qfile.h>
+#include <qregexp.h>
#ifdef Q_OS_WIN
# include <windows.h>
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index 41bed69f00..9330c2b1bf 100644
--- a/qmake/library/proitems.cpp
+++ b/qmake/library/proitems.cpp
@@ -238,7 +238,7 @@ ProString &ProString::append(const ProString &other, bool *pending)
QChar *ptr;
if (pending && !*pending) {
ptr = prepareExtend(1 + other.m_length, 0, m_length);
- *ptr++ = 32;
+ *ptr++ = QLatin1Char(' ');
} else {
ptr = prepareExtend(other.m_length, 0, m_length);
}
@@ -276,7 +276,7 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski
QChar *ptr = prepareExtend(totalLength, 0, m_length);
for (int i = startIdx; i < sz; ++i) {
if (putSpace)
- *ptr++ = 32;
+ *ptr++ = QLatin1Char(' ');
else
putSpace = true;
const ProString &str = other.at(i);
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index 936c729ff8..4569d7c3ff 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -68,6 +68,7 @@ class ProString {
public:
ProString();
ProString(const ProString &other);
+ ProString &operator=(const ProString &) = default;
PROITEM_EXPLICIT ProString(const QString &str);
PROITEM_EXPLICIT ProString(const QStringRef &str);
PROITEM_EXPLICIT ProString(const char *str);
@@ -430,7 +431,7 @@ class ProFunctionDef {
public:
ProFunctionDef(ProFile *pro, int offset) : m_pro(pro), m_offset(offset) { m_pro->ref(); }
ProFunctionDef(const ProFunctionDef &o) : m_pro(o.m_pro), m_offset(o.m_offset) { m_pro->ref(); }
- ProFunctionDef(ProFunctionDef &&other) Q_DECL_NOTHROW
+ ProFunctionDef(ProFunctionDef &&other) noexcept
: m_pro(other.m_pro), m_offset(other.m_offset) { other.m_pro = nullptr; }
~ProFunctionDef() { if (m_pro) m_pro->deref(); }
ProFunctionDef &operator=(const ProFunctionDef &o)
@@ -444,13 +445,13 @@ public:
}
return *this;
}
- ProFunctionDef &operator=(ProFunctionDef &&other) Q_DECL_NOTHROW
+ ProFunctionDef &operator=(ProFunctionDef &&other) noexcept
{
ProFunctionDef moved(std::move(other));
swap(moved);
return *this;
}
- void swap(ProFunctionDef &other) Q_DECL_NOTHROW
+ void swap(ProFunctionDef &other) noexcept
{
qSwap(m_pro, other.m_pro);
qSwap(m_offset, other.m_offset);
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index dd7766c8e0..866915bdfd 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -882,8 +882,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
ret += values(map(args.at(0)));
break;
case E_LIST: {
- QString tmp;
- tmp.sprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++);
+ QString tmp(QString::asprintf(".QMAKE_INTERNAL_TMP_variableName_%d", m_listCount++));
ret = ProStringList(ProString(tmp));
ProStringList lst;
for (const ProString &arg : args)
@@ -1458,15 +1457,15 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
case T_EXPORT: {
const ProKey &var = map(args.at(0));
- for (ProValueMapStack::Iterator vmi = m_valuemapStack.end();
+ for (ProValueMapStack::iterator vmi = m_valuemapStack.end();
--vmi != m_valuemapStack.begin(); ) {
ProValueMap::Iterator it = (*vmi).find(var);
if (it != (*vmi).end()) {
if (it->constBegin() == statics.fakeValue.constBegin()) {
// This is stupid, but qmake doesn't propagate deletions
- m_valuemapStack.first()[var] = ProStringList();
+ m_valuemapStack.front()[var] = ProStringList();
} else {
- m_valuemapStack.first()[var] = *it;
+ m_valuemapStack.front()[var] = *it;
}
(*vmi).erase(it);
while (--vmi != m_valuemapStack.begin())
@@ -1477,7 +1476,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
return ReturnTrue;
}
case T_DISCARD_FROM: {
- if (m_valuemapStack.count() != 1) {
+ if (m_valuemapStack.size() != 1) {
evalError(fL1S("discard_from() cannot be called from functions."));
return ReturnFalse;
}
@@ -1487,7 +1486,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
int pro = m_vfs->idForFileName(fn, flags | QMakeVfs::VfsAccessedOnly);
if (!pro)
return ReturnFalse;
- ProValueMap &vmap = m_valuemapStack.first();
+ ProValueMap &vmap = m_valuemapStack.front();
for (auto vit = vmap.begin(); vit != vmap.end(); ) {
if (!vit->isEmpty()) {
auto isFrom = [pro](const ProString &s) {
@@ -1515,7 +1514,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
else
++fit;
}
- ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
+ ProStringList &iif = m_valuemapStack.front()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
int idx = iif.indexOf(ProString(fn));
if (idx >= 0)
iif.removeAt(idx);
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index ade8e15a39..70897214b2 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -601,14 +601,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProBlock(
case TokBypassNesting:
blockLen = getBlockLen(tokPtr);
if ((m_cumulative || okey != or_op) && blockLen) {
- ProValueMapStack savedValuemapStack = m_valuemapStack;
+ ProValueMapStack savedValuemapStack = std::move(m_valuemapStack);
m_valuemapStack.clear();
- m_valuemapStack.append(savedValuemapStack.takeFirst());
+ m_valuemapStack.splice(m_valuemapStack.end(),
+ savedValuemapStack, savedValuemapStack.begin());
traceMsg("visiting nesting-bypassing block");
ret = visitProBlock(tokPtr);
traceMsg("visited nesting-bypassing block");
- savedValuemapStack.prepend(m_valuemapStack.first());
- m_valuemapStack = savedValuemapStack;
+ savedValuemapStack.splice(savedValuemapStack.begin(),
+ m_valuemapStack, m_valuemapStack.begin());
+ m_valuemapStack = std::move(savedValuemapStack);
} else {
traceMsg("skipped nesting-bypassing block");
ret = ReturnTrue;
@@ -1439,7 +1441,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
for (ProValueMap::ConstIterator it = m_extraVars.constBegin();
it != m_extraVars.constEnd(); ++it)
- m_valuemapStack.first().insert(it.key(), it.value());
+ m_valuemapStack.front().insert(it.key(), it.value());
// In case default_pre needs to make decisions based on the current
// build pass configuration.
@@ -1568,8 +1570,8 @@ void QMakeEvaluator::updateFeaturePaths()
}
for (int i = 0; i < feature_roots.count(); ++i)
- if (!feature_roots.at(i).endsWith((ushort)'/'))
- feature_roots[i].append((ushort)'/');
+ if (!feature_roots.at(i).endsWith(QLatin1Char('/')))
+ feature_roots[i].append(QLatin1Char('/'));
feature_roots.removeDuplicates();
@@ -1707,9 +1709,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFunction(
{
VisitReturn vr;
- if (m_valuemapStack.count() >= 100) {
+ if (m_valuemapStack.size() >= 100) {
evalError(fL1S("Ran into infinite recursion (depth > 100)."));
- vr = ReturnFalse;
+ vr = ReturnError;
} else {
m_valuemapStack.push(ProValueMap());
m_locationStack.push(m_current);
@@ -1859,7 +1861,7 @@ static bool isFunctParam(const ProKey &variableName)
ProValueMap *QMakeEvaluator::findValues(const ProKey &variableName, ProValueMap::Iterator *rit)
{
- ProValueMapStack::Iterator vmi = m_valuemapStack.end();
+ ProValueMapStack::iterator vmi = m_valuemapStack.end();
for (bool first = true; ; first = false) {
--vmi;
ProValueMap::Iterator it = (*vmi).find(variableName);
@@ -1886,7 +1888,7 @@ ProStringList &QMakeEvaluator::valuesRef(const ProKey &variableName)
return *it;
}
if (!isFunctParam(variableName)) {
- ProValueMapStack::Iterator vmi = m_valuemapStack.end();
+ ProValueMapStack::iterator vmi = m_valuemapStack.end();
if (--vmi != m_valuemapStack.begin()) {
do {
--vmi;
@@ -1905,7 +1907,7 @@ ProStringList &QMakeEvaluator::valuesRef(const ProKey &variableName)
ProStringList QMakeEvaluator::values(const ProKey &variableName) const
{
- ProValueMapStack::ConstIterator vmi = m_valuemapStack.constEnd();
+ ProValueMapStack::const_iterator vmi = m_valuemapStack.cend();
for (bool first = true; ; first = false) {
--vmi;
ProValueMap::ConstIterator it = (*vmi).constFind(variableName);
@@ -1914,7 +1916,7 @@ ProStringList QMakeEvaluator::values(const ProKey &variableName) const
break;
return *it;
}
- if (vmi == m_valuemapStack.constBegin())
+ if (vmi == m_valuemapStack.cbegin())
break;
if (first && isFunctParam(variableName))
break;
@@ -1942,7 +1944,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFile(
m_current = m_locationStack.pop();
pro->deref();
if (ok == ReturnTrue && !(flags & LoadHidden)) {
- ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
+ ProStringList &iif = m_valuemapStack.front()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
ProString ifn(fileName);
if (!iif.contains(ifn))
iif << ifn;
@@ -2071,7 +2073,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateFileInto(
return ret;
*values = visitor.m_valuemapStack.top();
ProKey qiif("QMAKE_INTERNAL_INCLUDED_FILES");
- ProStringList &iif = m_valuemapStack.first()[qiif];
+ ProStringList &iif = m_valuemapStack.front()[qiif];
const auto ifns = values->value(qiif);
for (const ProString &ifn : ifns)
if (!iif.contains(ifn))
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index f617681cbb..9f702b9182 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -38,7 +38,6 @@
#include "ioutils.h"
#include <qlist.h>
-#include <qlinkedlist.h>
#include <qmap.h>
#include <qset.h>
#include <qstack.h>
@@ -54,6 +53,8 @@
# include <qmutex.h>
#endif
+#include <list>
+
QT_BEGIN_NAMESPACE
class QMakeGlobals;
@@ -94,15 +95,15 @@ public:
#endif
};
-// We use a QLinkedList based stack instead of a QVector based one (QStack), so that
+// We use a list-based stack instead of a vector-based one, so that
// the addresses of value maps stay constant. The qmake generators rely on that.
-class QMAKE_EXPORT ProValueMapStack : public QLinkedList<ProValueMap>
+class QMAKE_EXPORT ProValueMapStack : public std::list<ProValueMap>
{
public:
- inline void push(const ProValueMap &t) { append(t); }
- inline ProValueMap pop() { return takeLast(); }
- ProValueMap &top() { return last(); }
- const ProValueMap &top() const { return last(); }
+ inline void push(const ProValueMap &t) { push_back(t); }
+ inline ProValueMap pop() { auto r = std::move(back()); pop_back(); return r; }
+ ProValueMap &top() { return back(); }
+ const ProValueMap &top() const { return back(); }
};
namespace QMakeInternal { struct QMakeBuiltin; }
diff --git a/qmake/library/qmakeevaluator_p.h b/qmake/library/qmakeevaluator_p.h
index f888bc5765..da83ff0de2 100644
--- a/qmake/library/qmakeevaluator_p.h
+++ b/qmake/library/qmakeevaluator_p.h
@@ -31,8 +31,6 @@
#include "proitems.h"
-#include <qregexp.h>
-
#define debugMsg if (!m_debugLevel) {} else debugMsgInternal
#define traceMsg if (!m_debugLevel) {} else traceMsgInternal
#ifdef PROEVALUATOR_DEBUG
diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp
index daf4707779..1d76cecc45 100644
--- a/qmake/library/qmakeglobals.cpp
+++ b/qmake/library/qmakeglobals.cpp
@@ -38,7 +38,6 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qlist.h>
-#include <qregexp.h>
#include <qset.h>
#include <qstack.h>
#include <qstring.h>
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 4c8360b459..ffe90ebda7 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -621,7 +621,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar
if (c != term) {
parseError(fL1S("Missing %1 terminator [found %2]")
.arg(QChar(term))
- .arg(c ? QString(c) : QString::fromLatin1("end-of-line")));
+ .arg(c ? QString(QChar(c)) : QString::fromLatin1("end-of-line")));
m_inError = true;
// Just parse on, as if there was a terminator ...
} else {
diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h
index 7b96d4e88f..c8c5c7718e 100644
--- a/qmake/library/qmakeparser.h
+++ b/qmake/library/qmakeparser.h
@@ -111,7 +111,6 @@ private:
struct BlockScope {
BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {}
- BlockScope(const BlockScope &other) { *this = other; }
ushort *start; // Where this block started; store length here
int braceLevel; // Nesting of braces in scope
bool special; // Single-line conditionals inside loops, etc. cannot have else branches
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 626a2cec0d..9ec2fe6411 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -93,7 +93,6 @@ bool Option::mkfile::do_deps = true;
bool Option::mkfile::do_mocs = true;
bool Option::mkfile::do_dep_heuristics = true;
bool Option::mkfile::do_preprocess = false;
-bool Option::mkfile::do_stub_makefile = false;
QStringList Option::mkfile::project_files;
static Option::QMAKE_MODE default_mode(QString progname)
@@ -253,8 +252,6 @@ Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state)
Option::mkfile::do_deps = false;
} else if (arg == "-nomoc") {
Option::mkfile::do_mocs = false;
- } else if (arg == "-createstub") {
- Option::mkfile::do_stub_makefile = true;
} else if (arg == "-nodependheuristics") {
Option::mkfile::do_dep_heuristics = false;
} else if (arg == "-E") {
@@ -661,4 +658,9 @@ QString qmake_libraryInfoFile()
return QString();
}
+QString qmake_abslocation()
+{
+ return Option::globals->qmake_abslocation;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/option.h b/qmake/option.h
index 25b2d64aaa..d7f4e87c70 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -189,7 +189,6 @@ struct Option
static bool do_mocs;
static bool do_dep_heuristics;
static bool do_preprocess;
- static bool do_stub_makefile;
static int cachefile_depth;
static QStringList project_files;
};
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 1bc9b352b5..931a337b71 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -143,15 +143,15 @@ ProString QMakeProject::expand(const QString &expr, const QString &where, int li
bool QMakeProject::isEmpty(const ProKey &v) const
{
- ProValueMap::ConstIterator it = m_valuemapStack.first().constFind(v);
- return it == m_valuemapStack.first().constEnd() || it->isEmpty();
+ ProValueMap::ConstIterator it = m_valuemapStack.front().constFind(v);
+ return it == m_valuemapStack.front().constEnd() || it->isEmpty();
}
void QMakeProject::dump() const
{
QStringList out;
- for (ProValueMap::ConstIterator it = m_valuemapStack.first().begin();
- it != m_valuemapStack.first().end(); ++it) {
+ for (ProValueMap::ConstIterator it = m_valuemapStack.front().begin();
+ it != m_valuemapStack.front().end(); ++it) {
if (!it.key().startsWith('.')) {
QString str = it.key() + " =";
for (const ProString &v : it.value())
diff --git a/qmake/project.h b/qmake/project.h
index d7a5852bed..071b62424f 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -58,12 +58,12 @@ public:
{ m_current.clear(); return evaluateConditional(QStringRef(&v), file, line) == ReturnTrue; }
bool test(const ProKey &func, const QList<ProStringList> &args);
- bool isSet(const ProKey &v) const { return m_valuemapStack.first().contains(v); }
+ bool isSet(const ProKey &v) const { return m_valuemapStack.front().contains(v); }
bool isEmpty(const ProKey &v) const;
ProStringList &values(const ProKey &v) { return valuesRef(v); }
int intValue(const ProKey &v, int defaultValue = 0) const;
- const ProValueMap &variables() const { return m_valuemapStack.first(); }
- ProValueMap &variables() { return m_valuemapStack.first(); }
+ const ProValueMap &variables() const { return m_valuemapStack.front(); }
+ ProValueMap &variables() { return m_valuemapStack.front(); }
bool isActiveConfig(const QString &config, bool regex = false)
{ return QMakeEvaluator::isActiveConfig(QStringRef(&config), regex); }
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index 5399e8c298..a9d8b58da8 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -96,7 +96,7 @@ HEADERS += \
bp = $$shadowed(..)
INCLUDEPATH += \
$$bp/include $$bp/include/QtCore \
- $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore
+ $$bp/include/QtCore/$$QT_VERSION $$bp/include/QtCore/$$QT_VERSION/QtCore \
$$bp/src/corelib/global
VPATH += \
@@ -115,6 +115,7 @@ SOURCES += \
qbuffer.cpp \
qbytearray.cpp \
qbytearraymatcher.cpp \
+ qcalendar.cpp \
qcryptographichash.cpp \
qdatetime.cpp \
qdir.cpp \
@@ -127,6 +128,7 @@ SOURCES += \
qfsfileengine.cpp \
qfsfileengine_iterator.cpp \
qglobal.cpp \
+ qgregoriancalendar.cpp \
qhash.cpp \
qiodevice.cpp \
qjson.cpp \
@@ -136,7 +138,6 @@ SOURCES += \
qjsonparser.cpp \
qjsonvalue.cpp \
qlibraryinfo.cpp \
- qlinkedlist.cpp \
qlist.cpp \
qlocale.cpp \
qlocale_tools.cpp \
@@ -146,9 +147,9 @@ SOURCES += \
qmetatype.cpp \
qnumeric.cpp \
qregexp.cpp \
+ qromancalendar.cpp \
qsettings.cpp \
qstring.cpp \
- qstring_compat.cpp \
qstringlist.cpp \
qsystemerror.cpp \
qtemporaryfile.cpp \
@@ -170,6 +171,9 @@ HEADERS += \
qbuffer.h \
qbytearray.h \
qbytearraymatcher.h \
+ qcalendar.h \
+ qcalendarbackend_p.h \
+ qcalendarmath_p.h \
qchar.h \
qcryptographichash.h \
qdatetime.h \
@@ -180,36 +184,36 @@ HEADERS += \
qfile.h \
qfileinfo.h \
qglobal.h \
+ qgregoriancalendar_p.h \
qhash.h \
qiodevice.h \
- qjson.h \
+ qjson_p.h \
qjsonarray.h \
qjsondocument.h \
qjsonobject.h \
- qjsonparser.h \
+ qjsonparser_p.h \
qjsonvalue.h \
- qjsonwriter.h \
- qlinkedlist.h \
+ qjsonwriter_p.h \
qlist.h \
qlocale.h \
qlocale_tools_p.h \
- qmalloc.h \
qmap.h \
qmetatype.h \
qnumeric.h \
qregexp.h \
+ qromancalendar_p.h \
qstring.h \
qstringlist.h \
qstringmatcher.h \
qsystemerror_p.h \
qtemporaryfile.h \
qtextstream.h \
- qutfcodec.h \
+ qutfcodec_p.h \
quuid.h \
qvector.h \
qversionnumber.h \
qxmlstream.h \
- qxmlutils.h
+ qxmlutils_p.h
unix {
SOURCES += \
diff --git a/src/3rdparty/VulkanMemoryAllocator.pri b/src/3rdparty/VulkanMemoryAllocator.pri
new file mode 100644
index 0000000000..7466200dfc
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator.pri
@@ -0,0 +1 @@
+INCLUDEPATH += $$PWD/VulkanMemoryAllocator
diff --git a/src/3rdparty/VulkanMemoryAllocator/LICENSE.txt b/src/3rdparty/VulkanMemoryAllocator/LICENSE.txt
new file mode 100644
index 0000000000..dbfe253391
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/LICENSE.txt
@@ -0,0 +1,19 @@
+Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch
new file mode 100644
index 0000000000..f459db6c7a
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0001-Avoid-compiler-warnings.patch
@@ -0,0 +1,402 @@
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index a2f7a1b..fbe6f9e 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -3661,7 +3661,7 @@ static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
+ {
+ uint32_t* pDst = (uint32_t*)((char*)pData + offset);
+ const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
+- for(size_t i = 0; i < numberCount; ++i, ++pDst)
++ for(size_t i = 0; i != numberCount; ++i, ++pDst)
+ {
+ *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
+ }
+@@ -3671,7 +3671,7 @@ static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
+ {
+ const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
+ const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
+- for(size_t i = 0; i < numberCount; ++i, ++pSrc)
++ for(size_t i = 0; i != numberCount; ++i, ++pSrc)
+ {
+ if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
+ {
+@@ -3866,7 +3866,7 @@ public:
+ template<typename U> VmaStlAllocator(const VmaStlAllocator<U>& src) : m_pCallbacks(src.m_pCallbacks) { }
+
+ T* allocate(size_t n) { return VmaAllocateArray<T>(m_pCallbacks, n); }
+- void deallocate(T* p, size_t n) { VmaFree(m_pCallbacks, p); }
++ void deallocate(T* p, size_t /*n*/) { VmaFree(m_pCallbacks, p); }
+
+ template<typename U>
+ bool operator==(const VmaStlAllocator<U>& rhs) const
+@@ -5214,7 +5214,7 @@ public:
+ virtual void FreeAtOffset(VkDeviceSize offset) = 0;
+
+ // Tries to resize (grow or shrink) space for given allocation, in place.
+- virtual bool ResizeAllocation(const VmaAllocation alloc, VkDeviceSize newSize) { return false; }
++ virtual bool ResizeAllocation(const VmaAllocation /*alloc*/, VkDeviceSize /*newSize*/) { return false; }
+
+ protected:
+ const VkAllocationCallbacks* GetAllocationCallbacks() const { return m_pAllocationCallbacks; }
+@@ -5574,7 +5574,7 @@ public:
+
+ virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
+
+- virtual VkResult CheckCorruption(const void* pBlockData) { return VK_ERROR_FEATURE_NOT_PRESENT; }
++ virtual VkResult CheckCorruption(const void* /*pBlockData*/) { return VK_ERROR_FEATURE_NOT_PRESENT; }
+
+ virtual void Alloc(
+ const VmaAllocationRequest& request,
+@@ -6133,7 +6133,7 @@ public:
+ bool overlappingMoveSupported);
+ virtual ~VmaDefragmentationAlgorithm_Fast();
+
+- virtual void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) { ++m_AllocationCount; }
++ virtual void AddAllocation(VmaAllocation /*hAlloc*/, VkBool32* /*pChanged*/) { ++m_AllocationCount; }
+ virtual void AddAll() { m_AllAllocations = true; }
+
+ virtual VkResult Defragment(
+@@ -6318,7 +6318,7 @@ private:
+ // Redundant, for convenience not to fetch from m_hCustomPool->m_BlockVector or m_hAllocator->m_pBlockVectors.
+ VmaBlockVector* const m_pBlockVector;
+ const uint32_t m_CurrFrameIndex;
+- const uint32_t m_AlgorithmFlags;
++ /*const uint32_t m_AlgorithmFlags;*/
+ // Owner of this object.
+ VmaDefragmentationAlgorithm* m_pAlgorithm;
+
+@@ -7073,6 +7073,7 @@ void VmaJsonWriter::BeginValue(bool isString)
+ if(currItem.type == COLLECTION_TYPE_OBJECT &&
+ currItem.valueCount % 2 == 0)
+ {
++ (void) isString;
+ VMA_ASSERT(isString);
+ }
+
+@@ -7660,7 +7661,9 @@ bool VmaBlockMetadata_Generic::Validate() const
+ }
+
+ // Margin required between allocations - every free space must be at least that large.
++#if VMA_DEBUG_MARGIN
+ VMA_VALIDATE(subAlloc.size >= VMA_DEBUG_MARGIN);
++#endif
+ }
+ else
+ {
+@@ -7806,6 +7809,7 @@ bool VmaBlockMetadata_Generic::CreateAllocationRequest(
+ {
+ VMA_ASSERT(allocSize > 0);
+ VMA_ASSERT(!upperAddress);
++ (void) upperAddress;
+ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(pAllocationRequest != VMA_NULL);
+ VMA_HEAVY_ASSERT(Validate());
+@@ -8033,6 +8037,7 @@ void VmaBlockMetadata_Generic::Alloc(
+ VmaAllocation hAllocation)
+ {
+ VMA_ASSERT(!upperAddress);
++ (void) upperAddress;
+ VMA_ASSERT(request.item != m_Suballocations.end());
+ VmaSuballocation& suballoc = *request.item;
+ // Given suballocation is a free block.
+@@ -9609,7 +9614,7 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest(
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+- uint32_t strategy,
++ uint32_t /*strategy*/,
+ VmaAllocationRequest* pAllocationRequest)
+ {
+ VMA_ASSERT(allocSize > 0);
+@@ -9651,10 +9656,12 @@ bool VmaBlockMetadata_Linear::CreateAllocationRequest(
+ // Apply VMA_DEBUG_MARGIN at the end.
+ if(VMA_DEBUG_MARGIN > 0)
+ {
++#if VMA_DEBUG_MARGIN
+ if(resultOffset < VMA_DEBUG_MARGIN)
+ {
+ return false;
+ }
++#endif
+ resultOffset -= VMA_DEBUG_MARGIN;
+ }
+
+@@ -10542,18 +10549,19 @@ void VmaBlockMetadata_Buddy::PrintDetailedMap(class VmaJsonWriter& json) const
+ #endif // #if VMA_STATS_STRING_ENABLED
+
+ bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
+- uint32_t currentFrameIndex,
+- uint32_t frameInUseCount,
++ uint32_t /*currentFrameIndex*/,
++ uint32_t /*frameInUseCount*/,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+- bool canMakeOtherLost,
+- uint32_t strategy,
++ bool /*canMakeOtherLost*/,
++ uint32_t /*strategy*/,
+ VmaAllocationRequest* pAllocationRequest)
+ {
+ VMA_ASSERT(!upperAddress && "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
++ (void) upperAddress;
+
+ // Simple way to respect bufferImageGranularity. May be optimized some day.
+ // Whenever it might be an OPTIMAL image...
+@@ -10593,8 +10601,8 @@ bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
+ }
+
+ bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
+- uint32_t currentFrameIndex,
+- uint32_t frameInUseCount,
++ uint32_t /*currentFrameIndex*/,
++ uint32_t /*frameInUseCount*/,
+ VmaAllocationRequest* pAllocationRequest)
+ {
+ /*
+@@ -10604,7 +10612,7 @@ bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
+ return pAllocationRequest->itemsToMakeLostCount == 0;
+ }
+
+-uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
++uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t /*currentFrameIndex*/, uint32_t /*frameInUseCount*/)
+ {
+ /*
+ Lost allocations are not supported in buddy allocator at the moment.
+@@ -10615,9 +10623,9 @@ uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t currentFrameIndex,
+
+ void VmaBlockMetadata_Buddy::Alloc(
+ const VmaAllocationRequest& request,
+- VmaSuballocationType type,
++ VmaSuballocationType /*type*/,
+ VkDeviceSize allocSize,
+- bool upperAddress,
++ bool /*upperAddress*/,
+ VmaAllocation hAllocation)
+ {
+ const uint32_t targetLevel = AllocSizeToLevel(allocSize);
+@@ -10941,7 +10949,7 @@ void VmaBlockMetadata_Buddy::PrintDetailedMapNode(class VmaJsonWriter& json, con
+ ////////////////////////////////////////////////////////////////////////////////
+ // class VmaDeviceMemoryBlock
+
+-VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator hAllocator) :
++VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator /*hAllocator*/) :
+ m_pMetadata(VMA_NULL),
+ m_MemoryTypeIndex(UINT32_MAX),
+ m_Id(0),
+@@ -11691,6 +11699,7 @@ VkResult VmaBlockVector::AllocatePage(
+ if(IsCorruptionDetectionEnabled())
+ {
+ VkResult res = pBestRequestBlock->WriteMagicValueAroundAllocation(m_hAllocator, bestRequest.offset, size);
++ (void) res;
+ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
+ }
+ return VK_SUCCESS;
+@@ -11729,6 +11738,7 @@ void VmaBlockVector::Free(
+ if(IsCorruptionDetectionEnabled())
+ {
+ VkResult res = pBlock->ValidateMagicValueAroundAllocation(m_hAllocator, hAllocation->GetOffset(), hAllocation->GetSize());
++ (void) res;
+ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to validate magic value.");
+ }
+
+@@ -11894,6 +11904,7 @@ VkResult VmaBlockVector::AllocateFromBlock(
+ if(IsCorruptionDetectionEnabled())
+ {
+ VkResult res = pBlock->WriteMagicValueAroundAllocation(m_hAllocator, currRequest.offset, size);
++ (void) res;
+ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
+ }
+ return VK_SUCCESS;
+@@ -11903,7 +11914,8 @@ VkResult VmaBlockVector::AllocateFromBlock(
+
+ VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex)
+ {
+- VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
++ VkMemoryAllocateInfo allocInfo = {};
++ allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
+ allocInfo.memoryTypeIndex = m_MemoryTypeIndex;
+ allocInfo.allocationSize = blockSize;
+ VkDeviceMemory mem = VK_NULL_HANDLE;
+@@ -11991,7 +12003,8 @@ void VmaBlockVector::ApplyDefragmentationMovesCpu(
+ if(pDefragCtx->res == VK_SUCCESS)
+ {
+ const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+- VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
++ VkMappedMemoryRange memRange = {};
++ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
+
+ for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+ {
+@@ -12076,7 +12089,8 @@ void VmaBlockVector::ApplyDefragmentationMovesGpu(
+
+ // Go over all blocks. Create and bind buffer for whole block if necessary.
+ {
+- VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
++ VkBufferCreateInfo bufCreateInfo = {};
++ bufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+@@ -12101,8 +12115,9 @@ void VmaBlockVector::ApplyDefragmentationMovesGpu(
+ // Go over all moves. Post data transfer commands to command buffer.
+ if(pDefragCtx->res == VK_SUCCESS)
+ {
+- const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+- VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
++ /*const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
++ VkMappedMemoryRange memRange = {};
++ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;*/
+
+ for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+ {
+@@ -12435,10 +12450,10 @@ VmaDefragmentationAlgorithm_Generic::VmaDefragmentationAlgorithm_Generic(
+ VmaAllocator hAllocator,
+ VmaBlockVector* pBlockVector,
+ uint32_t currentFrameIndex,
+- bool overlappingMoveSupported) :
++ bool /*overlappingMoveSupported*/) :
+ VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
+- m_AllAllocations(false),
+ m_AllocationCount(0),
++ m_AllAllocations(false),
+ m_BytesMoved(0),
+ m_AllocationsMoved(0),
+ m_Blocks(VmaStlAllocator<BlockInfo*>(hAllocator->GetAllocationCallbacks()))
+@@ -12813,7 +12828,7 @@ VkResult VmaDefragmentationAlgorithm_Fast::Defragment(
+ size_t freeSpaceOrigBlockIndex = m_BlockInfos[freeSpaceInfoIndex].origBlockIndex;
+ VmaDeviceMemoryBlock* pFreeSpaceBlock = m_pBlockVector->GetBlock(freeSpaceOrigBlockIndex);
+ VmaBlockMetadata_Generic* pFreeSpaceMetadata = (VmaBlockMetadata_Generic*)pFreeSpaceBlock->m_pMetadata;
+- VkDeviceSize freeSpaceBlockSize = pFreeSpaceMetadata->GetSize();
++ /*VkDeviceSize freeSpaceBlockSize = pFreeSpaceMetadata->GetSize();*/
+
+ // Same block
+ if(freeSpaceInfoIndex == srcBlockInfoIndex)
+@@ -13098,7 +13113,7 @@ VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
+ VmaPool hCustomPool,
+ VmaBlockVector* pBlockVector,
+ uint32_t currFrameIndex,
+- uint32_t algorithmFlags) :
++ uint32_t /*algorithmFlags*/) :
+ res(VK_SUCCESS),
+ mutexLocked(false),
+ blockContexts(VmaStlAllocator<VmaBlockDefragmentationContext>(hAllocator->GetAllocationCallbacks())),
+@@ -13106,7 +13121,7 @@ VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
+ m_hCustomPool(hCustomPool),
+ m_pBlockVector(pBlockVector),
+ m_CurrFrameIndex(currFrameIndex),
+- m_AlgorithmFlags(algorithmFlags),
++ /*m_AlgorithmFlags(algorithmFlags),*/
+ m_pAlgorithm(VMA_NULL),
+ m_Allocations(VmaStlAllocator<AllocInfo>(hAllocator->GetAllocationCallbacks())),
+ m_AllAllocations(false)
+@@ -14311,19 +14326,21 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory(
+ bool map,
+ bool isUserDataString,
+ void* pUserData,
+- VkBuffer dedicatedBuffer,
+- VkImage dedicatedImage,
++ VkBuffer /*dedicatedBuffer*/,
++ VkImage /*dedicatedImage*/,
+ size_t allocationCount,
+ VmaAllocation* pAllocations)
+ {
+ VMA_ASSERT(allocationCount > 0 && pAllocations);
+
+- VkMemoryAllocateInfo allocInfo = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
++ VkMemoryAllocateInfo allocInfo = {};
++ allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
+ allocInfo.memoryTypeIndex = memTypeIndex;
+ allocInfo.allocationSize = size;
+
+ #if VMA_DEDICATED_ALLOCATION
+- VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR };
++ VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = {};
++ dedicatedAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR;
+ if(m_UseKhrDedicatedAllocation)
+ {
+ if(dedicatedBuffer != VK_NULL_HANDLE)
+@@ -14341,7 +14358,7 @@ VkResult VmaAllocator_T::AllocateDedicatedMemory(
+ #endif // #if VMA_DEDICATED_ALLOCATION
+
+ size_t allocIndex;
+- VkResult res;
++ VkResult res = VK_SUCCESS;
+ for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+ {
+ res = AllocateDedicatedMemoryPage(
+@@ -14460,12 +14477,15 @@ void VmaAllocator_T::GetBufferMemoryRequirements(
+ #if VMA_DEDICATED_ALLOCATION
+ if(m_UseKhrDedicatedAllocation)
+ {
+- VkBufferMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR };
++ VkBufferMemoryRequirementsInfo2KHR memReqInfo = {};
++ memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR;
+ memReqInfo.buffer = hBuffer;
+
+- VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
++ VkMemoryDedicatedRequirementsKHR memDedicatedReq = {};
++ memDedicatedReq.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
+
+- VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
++ VkMemoryRequirements2KHR memReq2 = {};
++ memReq2.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
+ memReq2.pNext = &memDedicatedReq;
+
+ (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+@@ -14492,12 +14512,15 @@ void VmaAllocator_T::GetImageMemoryRequirements(
+ #if VMA_DEDICATED_ALLOCATION
+ if(m_UseKhrDedicatedAllocation)
+ {
+- VkImageMemoryRequirementsInfo2KHR memReqInfo = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR };
++ VkImageMemoryRequirementsInfo2KHR memReqInfo = {};
++ memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR;
+ memReqInfo.image = hImage;
+
+- VkMemoryDedicatedRequirementsKHR memDedicatedReq = { VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR };
++ VkMemoryDedicatedRequirementsKHR memDedicatedReq = {};
++ memDedicatedReq.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
+
+- VkMemoryRequirements2KHR memReq2 = { VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR };
++ VkMemoryRequirements2KHR memReq2 = {};
++ memReq2.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
+ memReq2.pNext = &memDedicatedReq;
+
+ (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+@@ -14734,7 +14757,7 @@ VkResult VmaAllocator_T::ResizeAllocation(
+ }
+ else
+ {
+- return VK_ERROR_OUT_OF_POOL_MEMORY;
++ return VkResult(-1000069000); // VK_ERROR_OUT_OF_POOL_MEMORY
+ }
+ default:
+ VMA_ASSERT(0);
+@@ -15000,6 +15023,7 @@ void VmaAllocator_T::DestroyPool(VmaPool pool)
+ {
+ VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
+ bool success = VmaVectorRemoveSorted<VmaPointerLess>(m_Pools, pool);
++ (void) success;
+ VMA_ASSERT(success && "Pool not found in Allocator.");
+ }
+
+@@ -15248,7 +15272,8 @@ void VmaAllocator_T::FlushOrInvalidateAllocation(
+
+ const VkDeviceSize nonCoherentAtomSize = m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+
+- VkMappedMemoryRange memRange = { VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE };
++ VkMappedMemoryRange memRange = {};
++ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
+ memRange.memory = hAllocation->GetMemory();
+
+ switch(hAllocation->GetType())
+@@ -15321,6 +15346,7 @@ void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation)
+ AllocationVectorType* const pDedicatedAllocations = m_pDedicatedAllocations[memTypeIndex];
+ VMA_ASSERT(pDedicatedAllocations);
+ bool success = VmaVectorRemoveSorted<VmaPointerLess>(*pDedicatedAllocations, allocation);
++ (void) success;
+ VMA_ASSERT(success);
+ }
+
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch
new file mode 100644
index 0000000000..57a2f1a0f1
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0002-Fix-gcc8-warning.patch
@@ -0,0 +1,14 @@
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index fbe6f9e3e8..f043bdc289 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -12074,7 +12074,8 @@ void VmaBlockVector::ApplyDefragmentationMovesGpu(
+ const size_t blockCount = m_Blocks.size();
+
+ pDefragCtx->blockContexts.resize(blockCount);
+- memset(pDefragCtx->blockContexts.data(), 0, blockCount * sizeof(VmaBlockDefragmentationContext));
++ for (size_t i = 0; i < blockCount; ++i)
++ pDefragCtx->blockContexts[i] = VmaBlockDefragmentationContext();
+
+ // Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.
+ const size_t moveCount = moves.size();
diff --git a/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch b/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch
new file mode 100644
index 0000000000..ab7acfe40b
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/patches/0003-Disable-srwlock-for-mingw.patch
@@ -0,0 +1,13 @@
+diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+index f043bdc289..2355de091f 100644
+--- a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
++++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
+@@ -3298,7 +3298,7 @@ void *aligned_alloc(size_t alignment, size_t size)
+ std::shared_mutex m_Mutex;
+ };
+ #define VMA_RW_MUTEX VmaRWMutex
+- #elif defined(_WIN32)
++ #elif defined(_WIN32) && !defined(__MINGW32__)
+ // Use SRWLOCK from WinAPI.
+ class VmaRWMutex
+ {
diff --git a/src/3rdparty/VulkanMemoryAllocator/qt_attribution.json b/src/3rdparty/VulkanMemoryAllocator/qt_attribution.json
new file mode 100644
index 0000000000..2548856ca7
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/qt_attribution.json
@@ -0,0 +1,16 @@
+[
+ {
+ "Id": "VulkanMemoryAllocator",
+ "Name": "Vulkan Memory Allocator",
+ "QDocModule": "qtrhi",
+ "Description": "Vulkan Memory Allocator",
+ "QtUsage": "Memory management for the Vulkan backend of QRhi.",
+
+ "Homepage": "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator",
+ "Version": "2.2.0",
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "LICENSE.txt",
+ "Copyright": "Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved."
+ }
+]
diff --git a/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
new file mode 100644
index 0000000000..2355de091f
--- /dev/null
+++ b/src/3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h
@@ -0,0 +1,16790 @@
+//
+// Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+
+#ifndef AMD_VULKAN_MEMORY_ALLOCATOR_H
+#define AMD_VULKAN_MEMORY_ALLOCATOR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** \mainpage Vulkan Memory Allocator
+
+<b>Version 2.2.0</b> (2018-12-13)
+
+Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. \n
+License: MIT
+
+Documentation of all members: vk_mem_alloc.h
+
+\section main_table_of_contents Table of contents
+
+- <b>User guide</b>
+ - \subpage quick_start
+ - [Project setup](@ref quick_start_project_setup)
+ - [Initialization](@ref quick_start_initialization)
+ - [Resource allocation](@ref quick_start_resource_allocation)
+ - \subpage choosing_memory_type
+ - [Usage](@ref choosing_memory_type_usage)
+ - [Required and preferred flags](@ref choosing_memory_type_required_preferred_flags)
+ - [Explicit memory types](@ref choosing_memory_type_explicit_memory_types)
+ - [Custom memory pools](@ref choosing_memory_type_custom_memory_pools)
+ - \subpage memory_mapping
+ - [Mapping functions](@ref memory_mapping_mapping_functions)
+ - [Persistently mapped memory](@ref memory_mapping_persistently_mapped_memory)
+ - [Cache control](@ref memory_mapping_cache_control)
+ - [Finding out if memory is mappable](@ref memory_mapping_finding_if_memory_mappable)
+ - \subpage custom_memory_pools
+ - [Choosing memory type index](@ref custom_memory_pools_MemTypeIndex)
+ - [Linear allocation algorithm](@ref linear_algorithm)
+ - [Free-at-once](@ref linear_algorithm_free_at_once)
+ - [Stack](@ref linear_algorithm_stack)
+ - [Double stack](@ref linear_algorithm_double_stack)
+ - [Ring buffer](@ref linear_algorithm_ring_buffer)
+ - [Buddy allocation algorithm](@ref buddy_algorithm)
+ - \subpage defragmentation
+ - [Defragmenting CPU memory](@ref defragmentation_cpu)
+ - [Defragmenting GPU memory](@ref defragmentation_gpu)
+ - [Additional notes](@ref defragmentation_additional_notes)
+ - [Writing custom allocation algorithm](@ref defragmentation_custom_algorithm)
+ - \subpage lost_allocations
+ - \subpage statistics
+ - [Numeric statistics](@ref statistics_numeric_statistics)
+ - [JSON dump](@ref statistics_json_dump)
+ - \subpage allocation_annotation
+ - [Allocation user data](@ref allocation_user_data)
+ - [Allocation names](@ref allocation_names)
+ - \subpage debugging_memory_usage
+ - [Memory initialization](@ref debugging_memory_usage_initialization)
+ - [Margins](@ref debugging_memory_usage_margins)
+ - [Corruption detection](@ref debugging_memory_usage_corruption_detection)
+ - \subpage record_and_replay
+- \subpage usage_patterns
+ - [Simple patterns](@ref usage_patterns_simple)
+ - [Advanced patterns](@ref usage_patterns_advanced)
+- \subpage configuration
+ - [Pointers to Vulkan functions](@ref config_Vulkan_functions)
+ - [Custom host memory allocator](@ref custom_memory_allocator)
+ - [Device memory allocation callbacks](@ref allocation_callbacks)
+ - [Device heap memory limit](@ref heap_memory_limit)
+ - \subpage vk_khr_dedicated_allocation
+- \subpage general_considerations
+ - [Thread safety](@ref general_considerations_thread_safety)
+ - [Validation layer warnings](@ref general_considerations_validation_layer_warnings)
+ - [Allocation algorithm](@ref general_considerations_allocation_algorithm)
+ - [Features not supported](@ref general_considerations_features_not_supported)
+
+\section main_see_also See also
+
+- [Product page on GPUOpen](https://gpuopen.com/gaming-product/vulkan-memory-allocator/)
+- [Source repository on GitHub](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator)
+
+
+
+
+\page quick_start Quick start
+
+\section quick_start_project_setup Project setup
+
+Vulkan Memory Allocator comes in form of a single header file.
+You don't need to build it as a separate library project.
+You can add this file directly to your project and submit it to code repository next to your other source files.
+
+"Single header" doesn't mean that everything is contained in C/C++ declarations,
+like it tends to be in case of inline functions or C++ templates.
+It means that implementation is bundled with interface in a single file and needs to be extracted using preprocessor macro.
+If you don't do it properly, you will get linker errors.
+
+To do it properly:
+
+-# Include "vk_mem_alloc.h" file in each CPP file where you want to use the library.
+ This includes declarations of all members of the library.
+-# In exacly one CPP file define following macro before this include.
+ It enables also internal definitions.
+
+\code
+#define VMA_IMPLEMENTATION
+#include "vk_mem_alloc.h"
+\endcode
+
+It may be a good idea to create dedicated CPP file just for this purpose.
+
+Note on language: This library is written in C++, but has C-compatible interface.
+Thus you can include and use vk_mem_alloc.h in C or C++ code, but full
+implementation with `VMA_IMPLEMENTATION` macro must be compiled as C++, NOT as C.
+
+Please note that this library includes header `<vulkan/vulkan.h>`, which in turn
+includes `<windows.h>` on Windows. If you need some specific macros defined
+before including these headers (like `WIN32_LEAN_AND_MEAN` or
+`WINVER` for Windows, `VK_USE_PLATFORM_WIN32_KHR` for Vulkan), you must define
+them before every `#include` of this library.
+
+
+\section quick_start_initialization Initialization
+
+At program startup:
+
+-# Initialize Vulkan to have `VkPhysicalDevice` and `VkDevice` object.
+-# Fill VmaAllocatorCreateInfo structure and create #VmaAllocator object by
+ calling vmaCreateAllocator().
+
+\code
+VmaAllocatorCreateInfo allocatorInfo = {};
+allocatorInfo.physicalDevice = physicalDevice;
+allocatorInfo.device = device;
+
+VmaAllocator allocator;
+vmaCreateAllocator(&allocatorInfo, &allocator);
+\endcode
+
+\section quick_start_resource_allocation Resource allocation
+
+When you want to create a buffer or image:
+
+-# Fill `VkBufferCreateInfo` / `VkImageCreateInfo` structure.
+-# Fill VmaAllocationCreateInfo structure.
+-# Call vmaCreateBuffer() / vmaCreateImage() to get `VkBuffer`/`VkImage` with memory
+ already allocated and bound to it.
+
+\code
+VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufferInfo.size = 65536;
+bufferInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+VmaAllocationCreateInfo allocInfo = {};
+allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+
+VkBuffer buffer;
+VmaAllocation allocation;
+vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
+\endcode
+
+Don't forget to destroy your objects when no longer needed:
+
+\code
+vmaDestroyBuffer(allocator, buffer, allocation);
+vmaDestroyAllocator(allocator);
+\endcode
+
+
+\page choosing_memory_type Choosing memory type
+
+Physical devices in Vulkan support various combinations of memory heaps and
+types. Help with choosing correct and optimal memory type for your specific
+resource is one of the key features of this library. You can use it by filling
+appropriate members of VmaAllocationCreateInfo structure, as described below.
+You can also combine multiple methods.
+
+-# If you just want to find memory type index that meets your requirements, you
+ can use function vmaFindMemoryTypeIndex().
+-# If you want to allocate a region of device memory without association with any
+ specific image or buffer, you can use function vmaAllocateMemory(). Usage of
+ this function is not recommended and usually not needed.
+-# If you already have a buffer or an image created, you want to allocate memory
+ for it and then you will bind it yourself, you can use function
+ vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage().
+ For binding you should use functions: vmaBindBufferMemory(), vmaBindImageMemory().
+-# If you want to create a buffer or an image, allocate memory for it and bind
+ them together, all in one call, you can use function vmaCreateBuffer(),
+ vmaCreateImage(). This is the recommended way to use this library.
+
+When using 3. or 4., the library internally queries Vulkan for memory types
+supported for that buffer or image (function `vkGetBufferMemoryRequirements()`)
+and uses only one of these types.
+
+If no memory type can be found that meets all the requirements, these functions
+return `VK_ERROR_FEATURE_NOT_PRESENT`.
+
+You can leave VmaAllocationCreateInfo structure completely filled with zeros.
+It means no requirements are specified for memory type.
+It is valid, although not very useful.
+
+\section choosing_memory_type_usage Usage
+
+The easiest way to specify memory requirements is to fill member
+VmaAllocationCreateInfo::usage using one of the values of enum #VmaMemoryUsage.
+It defines high level, common usage types.
+For more details, see description of this enum.
+
+For example, if you want to create a uniform buffer that will be filled using
+transfer only once or infrequently and used for rendering every frame, you can
+do it using following code:
+
+\code
+VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufferInfo.size = 65536;
+bufferInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+VmaAllocationCreateInfo allocInfo = {};
+allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+
+VkBuffer buffer;
+VmaAllocation allocation;
+vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
+\endcode
+
+\section choosing_memory_type_required_preferred_flags Required and preferred flags
+
+You can specify more detailed requirements by filling members
+VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags
+with a combination of bits from enum `VkMemoryPropertyFlags`. For example,
+if you want to create a buffer that will be persistently mapped on host (so it
+must be `HOST_VISIBLE`) and preferably will also be `HOST_COHERENT` and `HOST_CACHED`,
+use following code:
+
+\code
+VmaAllocationCreateInfo allocInfo = {};
+allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+allocInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
+allocInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT;
+
+VkBuffer buffer;
+VmaAllocation allocation;
+vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
+\endcode
+
+A memory type is chosen that has all the required flags and as many preferred
+flags set as possible.
+
+If you use VmaAllocationCreateInfo::usage, it is just internally converted to
+a set of required and preferred flags.
+
+\section choosing_memory_type_explicit_memory_types Explicit memory types
+
+If you inspected memory types available on the physical device and you have
+a preference for memory types that you want to use, you can fill member
+VmaAllocationCreateInfo::memoryTypeBits. It is a bit mask, where each bit set
+means that a memory type with that index is allowed to be used for the
+allocation. Special value 0, just like `UINT32_MAX`, means there are no
+restrictions to memory type index.
+
+Please note that this member is NOT just a memory type index.
+Still you can use it to choose just one, specific memory type.
+For example, if you already determined that your buffer should be created in
+memory type 2, use following code:
+
+\code
+uint32_t memoryTypeIndex = 2;
+
+VmaAllocationCreateInfo allocInfo = {};
+allocInfo.memoryTypeBits = 1u << memoryTypeIndex;
+
+VkBuffer buffer;
+VmaAllocation allocation;
+vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
+\endcode
+
+\section choosing_memory_type_custom_memory_pools Custom memory pools
+
+If you allocate from custom memory pool, all the ways of specifying memory
+requirements described above are not applicable and the aforementioned members
+of VmaAllocationCreateInfo structure are ignored. Memory type is selected
+explicitly when creating the pool and then used to make all the allocations from
+that pool. For further details, see \ref custom_memory_pools.
+
+
+\page memory_mapping Memory mapping
+
+To "map memory" in Vulkan means to obtain a CPU pointer to `VkDeviceMemory`,
+to be able to read from it or write to it in CPU code.
+Mapping is possible only of memory allocated from a memory type that has
+`VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag.
+Functions `vkMapMemory()`, `vkUnmapMemory()` are designed for this purpose.
+You can use them directly with memory allocated by this library,
+but it is not recommended because of following issue:
+Mapping the same `VkDeviceMemory` block multiple times is illegal - only one mapping at a time is allowed.
+This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan.
+Because of this, Vulkan Memory Allocator provides following facilities:
+
+\section memory_mapping_mapping_functions Mapping functions
+
+The library provides following functions for mapping of a specific #VmaAllocation: vmaMapMemory(), vmaUnmapMemory().
+They are safer and more convenient to use than standard Vulkan functions.
+You can map an allocation multiple times simultaneously - mapping is reference-counted internally.
+You can also map different allocations simultaneously regardless of whether they use the same `VkDeviceMemory` block.
+The way it's implemented is that the library always maps entire memory block, not just region of the allocation.
+For further details, see description of vmaMapMemory() function.
+Example:
+
+\code
+// Having these objects initialized:
+
+struct ConstantBuffer
+{
+ ...
+};
+ConstantBuffer constantBufferData;
+
+VmaAllocator allocator;
+VkBuffer constantBuffer;
+VmaAllocation constantBufferAllocation;
+
+// You can map and fill your buffer using following code:
+
+void* mappedData;
+vmaMapMemory(allocator, constantBufferAllocation, &mappedData);
+memcpy(mappedData, &constantBufferData, sizeof(constantBufferData));
+vmaUnmapMemory(allocator, constantBufferAllocation);
+\endcode
+
+When mapping, you may see a warning from Vulkan validation layer similar to this one:
+
+<i>Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.</i>
+
+It happens because the library maps entire `VkDeviceMemory` block, where different
+types of images and buffers may end up together, especially on GPUs with unified memory like Intel.
+You can safely ignore it if you are sure you access only memory of the intended
+object that you wanted to map.
+
+
+\section memory_mapping_persistently_mapped_memory Persistently mapped memory
+
+Kepping your memory persistently mapped is generally OK in Vulkan.
+You don't need to unmap it before using its data on the GPU.
+The library provides a special feature designed for that:
+Allocations made with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag set in
+VmaAllocationCreateInfo::flags stay mapped all the time,
+so you can just access CPU pointer to it any time
+without a need to call any "map" or "unmap" function.
+Example:
+
+\code
+VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufCreateInfo.size = sizeof(ConstantBuffer);
+bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.usage = VMA_MEMORY_USAGE_CPU_ONLY;
+allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT;
+
+VkBuffer buf;
+VmaAllocation alloc;
+VmaAllocationInfo allocInfo;
+vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+
+// Buffer is already mapped. You can access its memory.
+memcpy(allocInfo.pMappedData, &constantBufferData, sizeof(constantBufferData));
+\endcode
+
+There are some exceptions though, when you should consider mapping memory only for a short period of time:
+
+- When operating system is Windows 7 or 8.x (Windows 10 is not affected because it uses WDDM2),
+ device is discrete AMD GPU,
+ and memory type is the special 256 MiB pool of `DEVICE_LOCAL + HOST_VISIBLE` memory
+ (selected when you use #VMA_MEMORY_USAGE_CPU_TO_GPU),
+ then whenever a memory block allocated from this memory type stays mapped
+ for the time of any call to `vkQueueSubmit()` or `vkQueuePresentKHR()`, this
+ block is migrated by WDDM to system RAM, which degrades performance. It doesn't
+ matter if that particular memory block is actually used by the command buffer
+ being submitted.
+- On Mac/MoltenVK there is a known bug - [Issue #175](https://github.com/KhronosGroup/MoltenVK/issues/175)
+ which requires unmapping before GPU can see updated texture.
+- Keeping many large memory blocks mapped may impact performance or stability of some debugging tools.
+
+\section memory_mapping_cache_control Cache control
+
+Memory in Vulkan doesn't need to be unmapped before using it on GPU,
+but unless a memory types has `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT` flag set,
+you need to manually invalidate cache before reading of mapped pointer
+and flush cache after writing to mapped pointer.
+Vulkan provides following functions for this purpose `vkFlushMappedMemoryRanges()`,
+`vkInvalidateMappedMemoryRanges()`, but this library provides more convenient
+functions that refer to given allocation object: vmaFlushAllocation(),
+vmaInvalidateAllocation().
+
+Regions of memory specified for flush/invalidate must be aligned to
+`VkPhysicalDeviceLimits::nonCoherentAtomSize`. This is automatically ensured by the library.
+In any memory type that is `HOST_VISIBLE` but not `HOST_COHERENT`, all allocations
+within blocks are aligned to this value, so their offsets are always multiply of
+`nonCoherentAtomSize` and two different allocations never share same "line" of this size.
+
+Please note that memory allocated with #VMA_MEMORY_USAGE_CPU_ONLY is guaranteed to be `HOST_COHERENT`.
+
+Also, Windows drivers from all 3 PC GPU vendors (AMD, Intel, NVIDIA)
+currently provide `HOST_COHERENT` flag on all memory types that are
+`HOST_VISIBLE`, so on this platform you may not need to bother.
+
+\section memory_mapping_finding_if_memory_mappable Finding out if memory is mappable
+
+It may happen that your allocation ends up in memory that is `HOST_VISIBLE` (available for mapping)
+despite it wasn't explicitly requested.
+For example, application may work on integrated graphics with unified memory (like Intel) or
+allocation from video memory might have failed, so the library chose system memory as fallback.
+
+You can detect this case and map such allocation to access its memory on CPU directly,
+instead of launching a transfer operation.
+In order to do that: inspect `allocInfo.memoryType`, call vmaGetMemoryTypeProperties(),
+and look for `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` flag in properties of that memory type.
+
+\code
+VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufCreateInfo.size = sizeof(ConstantBuffer);
+bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+
+VkBuffer buf;
+VmaAllocation alloc;
+VmaAllocationInfo allocInfo;
+vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+
+VkMemoryPropertyFlags memFlags;
+vmaGetMemoryTypeProperties(allocator, allocInfo.memoryType, &memFlags);
+if((memFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+{
+ // Allocation ended up in mappable memory. You can map it and access it directly.
+ void* mappedData;
+ vmaMapMemory(allocator, alloc, &mappedData);
+ memcpy(mappedData, &constantBufferData, sizeof(constantBufferData));
+ vmaUnmapMemory(allocator, alloc);
+}
+else
+{
+ // Allocation ended up in non-mappable memory.
+ // You need to create CPU-side buffer in VMA_MEMORY_USAGE_CPU_ONLY and make a transfer.
+}
+\endcode
+
+You can even use #VMA_ALLOCATION_CREATE_MAPPED_BIT flag while creating allocations
+that are not necessarily `HOST_VISIBLE` (e.g. using #VMA_MEMORY_USAGE_GPU_ONLY).
+If the allocation ends up in memory type that is `HOST_VISIBLE`, it will be persistently mapped and you can use it directly.
+If not, the flag is just ignored.
+Example:
+
+\code
+VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufCreateInfo.size = sizeof(ConstantBuffer);
+bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+allocCreateInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT;
+
+VkBuffer buf;
+VmaAllocation alloc;
+VmaAllocationInfo allocInfo;
+vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+
+if(allocInfo.pUserData != nullptr)
+{
+ // Allocation ended up in mappable memory.
+ // It's persistently mapped. You can access it directly.
+ memcpy(allocInfo.pMappedData, &constantBufferData, sizeof(constantBufferData));
+}
+else
+{
+ // Allocation ended up in non-mappable memory.
+ // You need to create CPU-side buffer in VMA_MEMORY_USAGE_CPU_ONLY and make a transfer.
+}
+\endcode
+
+
+\page custom_memory_pools Custom memory pools
+
+A memory pool contains a number of `VkDeviceMemory` blocks.
+The library automatically creates and manages default pool for each memory type available on the device.
+Default memory pool automatically grows in size.
+Size of allocated blocks is also variable and managed automatically.
+
+You can create custom pool and allocate memory out of it.
+It can be useful if you want to:
+
+- Keep certain kind of allocations separate from others.
+- Enforce particular, fixed size of Vulkan memory blocks.
+- Limit maximum amount of Vulkan memory allocated for that pool.
+- Reserve minimum or fixed amount of Vulkan memory always preallocated for that pool.
+
+To use custom memory pools:
+
+-# Fill VmaPoolCreateInfo structure.
+-# Call vmaCreatePool() to obtain #VmaPool handle.
+-# When making an allocation, set VmaAllocationCreateInfo::pool to this handle.
+ You don't need to specify any other parameters of this structure, like `usage`.
+
+Example:
+
+\code
+// Create a pool that can have at most 2 blocks, 128 MiB each.
+VmaPoolCreateInfo poolCreateInfo = {};
+poolCreateInfo.memoryTypeIndex = ...
+poolCreateInfo.blockSize = 128ull * 1024 * 1024;
+poolCreateInfo.maxBlockCount = 2;
+
+VmaPool pool;
+vmaCreatePool(allocator, &poolCreateInfo, &pool);
+
+// Allocate a buffer out of it.
+VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+bufCreateInfo.size = 1024;
+bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.pool = pool;
+
+VkBuffer buf;
+VmaAllocation alloc;
+VmaAllocationInfo allocInfo;
+vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);
+\endcode
+
+You have to free all allocations made from this pool before destroying it.
+
+\code
+vmaDestroyBuffer(allocator, buf, alloc);
+vmaDestroyPool(allocator, pool);
+\endcode
+
+\section custom_memory_pools_MemTypeIndex Choosing memory type index
+
+When creating a pool, you must explicitly specify memory type index.
+To find the one suitable for your buffers or images, you can use helper functions
+vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo().
+You need to provide structures with example parameters of buffers or images
+that you are going to create in that pool.
+
+\code
+VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+exampleBufCreateInfo.size = 1024; // Whatever.
+exampleBufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; // Change if needed.
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY; // Change if needed.
+
+uint32_t memTypeIndex;
+vmaFindMemoryTypeIndexForBufferInfo(allocator, &exampleBufCreateInfo, &allocCreateInfo, &memTypeIndex);
+
+VmaPoolCreateInfo poolCreateInfo = {};
+poolCreateInfo.memoryTypeIndex = memTypeIndex;
+// ...
+\endcode
+
+When creating buffers/images allocated in that pool, provide following parameters:
+
+- `VkBufferCreateInfo`: Prefer to pass same parameters as above.
+ Otherwise you risk creating resources in a memory type that is not suitable for them, which may result in undefined behavior.
+ Using different `VK_BUFFER_USAGE_` flags may work, but you shouldn't create images in a pool intended for buffers
+ or the other way around.
+- VmaAllocationCreateInfo: You don't need to pass same parameters. Fill only `pool` member.
+ Other members are ignored anyway.
+
+\section linear_algorithm Linear allocation algorithm
+
+Each Vulkan memory block managed by this library has accompanying metadata that
+keeps track of used and unused regions. By default, the metadata structure and
+algorithm tries to find best place for new allocations among free regions to
+optimize memory usage. This way you can allocate and free objects in any order.
+
+![Default allocation algorithm](../gfx/Linear_allocator_1_algo_default.png)
+
+Sometimes there is a need to use simpler, linear allocation algorithm. You can
+create custom pool that uses such algorithm by adding flag
+#VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT to VmaPoolCreateInfo::flags while creating
+#VmaPool object. Then an alternative metadata management is used. It always
+creates new allocations after last one and doesn't reuse free regions after
+allocations freed in the middle. It results in better allocation performance and
+less memory consumed by metadata.
+
+![Linear allocation algorithm](../gfx/Linear_allocator_2_algo_linear.png)
+
+With this one flag, you can create a custom pool that can be used in many ways:
+free-at-once, stack, double stack, and ring buffer. See below for details.
+
+\subsection linear_algorithm_free_at_once Free-at-once
+
+In a pool that uses linear algorithm, you still need to free all the allocations
+individually, e.g. by using vmaFreeMemory() or vmaDestroyBuffer(). You can free
+them in any order. New allocations are always made after last one - free space
+in the middle is not reused. However, when you release all the allocation and
+the pool becomes empty, allocation starts from the beginning again. This way you
+can use linear algorithm to speed up creation of allocations that you are going
+to release all at once.
+
+![Free-at-once](../gfx/Linear_allocator_3_free_at_once.png)
+
+This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount
+value that allows multiple memory blocks.
+
+\subsection linear_algorithm_stack Stack
+
+When you free an allocation that was created last, its space can be reused.
+Thanks to this, if you always release allocations in the order opposite to their
+creation (LIFO - Last In First Out), you can achieve behavior of a stack.
+
+![Stack](../gfx/Linear_allocator_4_stack.png)
+
+This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount
+value that allows multiple memory blocks.
+
+\subsection linear_algorithm_double_stack Double stack
+
+The space reserved by a custom pool with linear algorithm may be used by two
+stacks:
+
+- First, default one, growing up from offset 0.
+- Second, "upper" one, growing down from the end towards lower offsets.
+
+To make allocation from upper stack, add flag #VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT
+to VmaAllocationCreateInfo::flags.
+
+![Double stack](../gfx/Linear_allocator_7_double_stack.png)
+
+Double stack is available only in pools with one memory block -
+VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.
+
+When the two stacks' ends meet so there is not enough space between them for a
+new allocation, such allocation fails with usual
+`VK_ERROR_OUT_OF_DEVICE_MEMORY` error.
+
+\subsection linear_algorithm_ring_buffer Ring buffer
+
+When you free some allocations from the beginning and there is not enough free space
+for a new one at the end of a pool, allocator's "cursor" wraps around to the
+beginning and starts allocation there. Thanks to this, if you always release
+allocations in the same order as you created them (FIFO - First In First Out),
+you can achieve behavior of a ring buffer / queue.
+
+![Ring buffer](../gfx/Linear_allocator_5_ring_buffer.png)
+
+Pools with linear algorithm support [lost allocations](@ref lost_allocations) when used as ring buffer.
+If there is not enough free space for a new allocation, but existing allocations
+from the front of the queue can become lost, they become lost and the allocation
+succeeds.
+
+![Ring buffer with lost allocations](../gfx/Linear_allocator_6_ring_buffer_lost.png)
+
+Ring buffer is available only in pools with one memory block -
+VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.
+
+\section buddy_algorithm Buddy allocation algorithm
+
+There is another allocation algorithm that can be used with custom pools, called
+"buddy". Its internal data structure is based on a tree of blocks, each having
+size that is a power of two and a half of its parent's size. When you want to
+allocate memory of certain size, a free node in the tree is located. If it's too
+large, it is recursively split into two halves (called "buddies"). However, if
+requested allocation size is not a power of two, the size of a tree node is
+aligned up to the nearest power of two and the remaining space is wasted. When
+two buddy nodes become free, they are merged back into one larger node.
+
+![Buddy allocator](../gfx/Buddy_allocator.png)
+
+The advantage of buddy allocation algorithm over default algorithm is faster
+allocation and deallocation, as well as smaller external fragmentation. The
+disadvantage is more wasted space (internal fragmentation).
+
+For more information, please read ["Buddy memory allocation" on Wikipedia](https://en.wikipedia.org/wiki/Buddy_memory_allocation)
+or other sources that describe this concept in general.
+
+To use buddy allocation algorithm with a custom pool, add flag
+#VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT to VmaPoolCreateInfo::flags while creating
+#VmaPool object.
+
+Several limitations apply to pools that use buddy algorithm:
+
+- It is recommended to use VmaPoolCreateInfo::blockSize that is a power of two.
+ Otherwise, only largest power of two smaller than the size is used for
+ allocations. The remaining space always stays unused.
+- [Margins](@ref debugging_memory_usage_margins) and
+ [corruption detection](@ref debugging_memory_usage_corruption_detection)
+ don't work in such pools.
+- [Lost allocations](@ref lost_allocations) don't work in such pools. You can
+ use them, but they never become lost. Support may be added in the future.
+- [Defragmentation](@ref defragmentation) doesn't work with allocations made from
+ such pool.
+
+\page defragmentation Defragmentation
+
+Interleaved allocations and deallocations of many objects of varying size can
+cause fragmentation over time, which can lead to a situation where the library is unable
+to find a continuous range of free memory for a new allocation despite there is
+enough free space, just scattered across many small free ranges between existing
+allocations.
+
+To mitigate this problem, you can use defragmentation feature:
+structure #VmaDefragmentationInfo2, function vmaDefragmentationBegin(), vmaDefragmentationEnd().
+Given set of allocations,
+this function can move them to compact used memory, ensure more continuous free
+space and possibly also free some `VkDeviceMemory` blocks.
+
+What the defragmentation does is:
+
+- Updates #VmaAllocation objects to point to new `VkDeviceMemory` and offset.
+ After allocation has been moved, its VmaAllocationInfo::deviceMemory and/or
+ VmaAllocationInfo::offset changes. You must query them again using
+ vmaGetAllocationInfo() if you need them.
+- Moves actual data in memory.
+
+What it doesn't do, so you need to do it yourself:
+
+- Recreate buffers and images that were bound to allocations that were defragmented and
+ bind them with their new places in memory.
+ You must use `vkDestroyBuffer()`, `vkDestroyImage()`,
+ `vkCreateBuffer()`, `vkCreateImage()` for that purpose and NOT vmaDestroyBuffer(),
+ vmaDestroyImage(), vmaCreateBuffer(), vmaCreateImage(), because you don't need to
+ destroy or create allocation objects!
+- Recreate views and update descriptors that point to these buffers and images.
+
+\section defragmentation_cpu Defragmenting CPU memory
+
+Following example demonstrates how you can run defragmentation on CPU.
+Only allocations created in memory types that are `HOST_VISIBLE` can be defragmented.
+Others are ignored.
+
+The way it works is:
+
+- It temporarily maps entire memory blocks when necessary.
+- It moves data using `memmove()` function.
+
+\code
+// Given following variables already initialized:
+VkDevice device;
+VmaAllocator allocator;
+std::vector<VkBuffer> buffers;
+std::vector<VmaAllocation> allocations;
+
+
+const uint32_t allocCount = (uint32_t)allocations.size();
+std::vector<VkBool32> allocationsChanged(allocCount);
+
+VmaDefragmentationInfo2 defragInfo = {};
+defragInfo.allocationCount = allocCount;
+defragInfo.pAllocations = allocations.data();
+defragInfo.pAllocationsChanged = allocationsChanged.data();
+defragInfo.maxCpuBytesToMove = VK_WHOLE_SIZE; // No limit.
+defragInfo.maxCpuAllocationsToMove = UINT32_MAX; // No limit.
+
+VmaDefragmentationContext defragCtx;
+vmaDefragmentationBegin(allocator, &defragInfo, nullptr, &defragCtx);
+vmaDefragmentationEnd(allocator, defragCtx);
+
+for(uint32_t i = 0; i < allocCount; ++i)
+{
+ if(allocationsChanged[i])
+ {
+ // Destroy buffer that is immutably bound to memory region which is no longer valid.
+ vkDestroyBuffer(device, buffers[i], nullptr);
+
+ // Create new buffer with same parameters.
+ VkBufferCreateInfo bufferInfo = ...;
+ vkCreateBuffer(device, &bufferInfo, nullptr, &buffers[i]);
+
+ // You can make dummy call to vkGetBufferMemoryRequirements here to silence validation layer warning.
+
+ // Bind new buffer to new memory region. Data contained in it is already moved.
+ VmaAllocationInfo allocInfo;
+ vmaGetAllocationInfo(allocator, allocations[i], &allocInfo);
+ vkBindBufferMemory(device, buffers[i], allocInfo.deviceMemory, allocInfo.offset);
+ }
+}
+\endcode
+
+Setting VmaDefragmentationInfo2::pAllocationsChanged is optional.
+This output array tells whether particular allocation in VmaDefragmentationInfo2::pAllocations at the same index
+has been modified during defragmentation.
+You can pass null, but you then need to query every allocation passed to defragmentation
+for new parameters using vmaGetAllocationInfo() if you might need to recreate and rebind a buffer or image associated with it.
+
+If you use [Custom memory pools](@ref choosing_memory_type_custom_memory_pools),
+you can fill VmaDefragmentationInfo2::poolCount and VmaDefragmentationInfo2::pPools
+instead of VmaDefragmentationInfo2::allocationCount and VmaDefragmentationInfo2::pAllocations
+to defragment all allocations in given pools.
+You cannot use VmaDefragmentationInfo2::pAllocationsChanged in that case.
+You can also combine both methods.
+
+\section defragmentation_gpu Defragmenting GPU memory
+
+It is also possible to defragment allocations created in memory types that are not `HOST_VISIBLE`.
+To do that, you need to pass a command buffer that meets requirements as described in
+VmaDefragmentationInfo2::commandBuffer. The way it works is:
+
+- It creates temporary buffers and binds them to entire memory blocks when necessary.
+- It issues `vkCmdCopyBuffer()` to passed command buffer.
+
+Example:
+
+\code
+// Given following variables already initialized:
+VkDevice device;
+VmaAllocator allocator;
+VkCommandBuffer commandBuffer;
+std::vector<VkBuffer> buffers;
+std::vector<VmaAllocation> allocations;
+
+
+const uint32_t allocCount = (uint32_t)allocations.size();
+std::vector<VkBool32> allocationsChanged(allocCount);
+
+VkCommandBufferBeginInfo cmdBufBeginInfo = ...;
+vkBeginCommandBuffer(commandBuffer, &cmdBufBeginInfo);
+
+VmaDefragmentationInfo2 defragInfo = {};
+defragInfo.allocationCount = allocCount;
+defragInfo.pAllocations = allocations.data();
+defragInfo.pAllocationsChanged = allocationsChanged.data();
+defragInfo.maxGpuBytesToMove = VK_WHOLE_SIZE; // Notice it's "GPU" this time.
+defragInfo.maxGpuAllocationsToMove = UINT32_MAX; // Notice it's "GPU" this time.
+defragInfo.commandBuffer = commandBuffer;
+
+VmaDefragmentationContext defragCtx;
+vmaDefragmentationBegin(allocator, &defragInfo, nullptr, &defragCtx);
+
+vkEndCommandBuffer(commandBuffer);
+
+// Submit commandBuffer.
+// Wait for a fence that ensures commandBuffer execution finished.
+
+vmaDefragmentationEnd(allocator, defragCtx);
+
+for(uint32_t i = 0; i < allocCount; ++i)
+{
+ if(allocationsChanged[i])
+ {
+ // Destroy buffer that is immutably bound to memory region which is no longer valid.
+ vkDestroyBuffer(device, buffers[i], nullptr);
+
+ // Create new buffer with same parameters.
+ VkBufferCreateInfo bufferInfo = ...;
+ vkCreateBuffer(device, &bufferInfo, nullptr, &buffers[i]);
+
+ // You can make dummy call to vkGetBufferMemoryRequirements here to silence validation layer warning.
+
+ // Bind new buffer to new memory region. Data contained in it is already moved.
+ VmaAllocationInfo allocInfo;
+ vmaGetAllocationInfo(allocator, allocations[i], &allocInfo);
+ vkBindBufferMemory(device, buffers[i], allocInfo.deviceMemory, allocInfo.offset);
+ }
+}
+\endcode
+
+You can combine these two methods by specifying non-zero `maxGpu*` as well as `maxCpu*` parameters.
+The library automatically chooses best method to defragment each memory pool.
+
+You may try not to block your entire program to wait until defragmentation finishes,
+but do it in the background, as long as you carefully fullfill requirements described
+in function vmaDefragmentationBegin().
+
+\section defragmentation_additional_notes Additional notes
+
+While using defragmentation, you may experience validation layer warnings, which you just need to ignore.
+See [Validation layer warnings](@ref general_considerations_validation_layer_warnings).
+
+If you defragment allocations bound to images, these images should be created with
+`VK_IMAGE_CREATE_ALIAS_BIT` flag, to make sure that new image created with same
+parameters and pointing to data copied to another memory region will interpret
+its contents consistently. Otherwise you may experience corrupted data on some
+implementations, e.g. due to different pixel swizzling used internally by the graphics driver.
+
+If you defragment allocations bound to images, new images to be bound to new
+memory region after defragmentation should be created with `VK_IMAGE_LAYOUT_PREINITIALIZED`
+and then transitioned to their original layout from before defragmentation using
+an image memory barrier.
+
+Please don't expect memory to be fully compacted after defragmentation.
+Algorithms inside are based on some heuristics that try to maximize number of Vulkan
+memory blocks to make totally empty to release them, as well as to maximimze continuous
+empty space inside remaining blocks, while minimizing the number and size of allocations that
+need to be moved. Some fragmentation may still remain - this is normal.
+
+\section defragmentation_custom_algorithm Writing custom defragmentation algorithm
+
+If you want to implement your own, custom defragmentation algorithm,
+there is infrastructure prepared for that,
+but it is not exposed through the library API - you need to hack its source code.
+Here are steps needed to do this:
+
+-# Main thing you need to do is to define your own class derived from base abstract
+ class `VmaDefragmentationAlgorithm` and implement your version of its pure virtual methods.
+ See definition and comments of this class for details.
+-# Your code needs to interact with device memory block metadata.
+ If you need more access to its data than it's provided by its public interface,
+ declare your new class as a friend class e.g. in class `VmaBlockMetadata_Generic`.
+-# If you want to create a flag that would enable your algorithm or pass some additional
+ flags to configure it, add them to `VmaDefragmentationFlagBits` and use them in
+ VmaDefragmentationInfo2::flags.
+-# Modify function `VmaBlockVectorDefragmentationContext::Begin` to create object
+ of your new class whenever needed.
+
+
+\page lost_allocations Lost allocations
+
+If your game oversubscribes video memory, if may work OK in previous-generation
+graphics APIs (DirectX 9, 10, 11, OpenGL) because resources are automatically
+paged to system RAM. In Vulkan you can't do it because when you run out of
+memory, an allocation just fails. If you have more data (e.g. textures) that can
+fit into VRAM and you don't need it all at once, you may want to upload them to
+GPU on demand and "push out" ones that are not used for a long time to make room
+for the new ones, effectively using VRAM (or a cartain memory pool) as a form of
+cache. Vulkan Memory Allocator can help you with that by supporting a concept of
+"lost allocations".
+
+To create an allocation that can become lost, include #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT
+flag in VmaAllocationCreateInfo::flags. Before using a buffer or image bound to
+such allocation in every new frame, you need to query it if it's not lost.
+To check it, call vmaTouchAllocation().
+If the allocation is lost, you should not use it or buffer/image bound to it.
+You mustn't forget to destroy this allocation and this buffer/image.
+vmaGetAllocationInfo() can also be used for checking status of the allocation.
+Allocation is lost when returned VmaAllocationInfo::deviceMemory == `VK_NULL_HANDLE`.
+
+To create an allocation that can make some other allocations lost to make room
+for it, use #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag. You will
+usually use both flags #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT and
+#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT at the same time.
+
+Warning! Current implementation uses quite naive, brute force algorithm,
+which can make allocation calls that use #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT
+flag quite slow. A new, more optimal algorithm and data structure to speed this
+up is planned for the future.
+
+<b>Q: When interleaving creation of new allocations with usage of existing ones,
+how do you make sure that an allocation won't become lost while it's used in the
+current frame?</b>
+
+It is ensured because vmaTouchAllocation() / vmaGetAllocationInfo() not only returns allocation
+status/parameters and checks whether it's not lost, but when it's not, it also
+atomically marks it as used in the current frame, which makes it impossible to
+become lost in that frame. It uses lockless algorithm, so it works fast and
+doesn't involve locking any internal mutex.
+
+<b>Q: What if my allocation may still be in use by the GPU when it's rendering a
+previous frame while I already submit new frame on the CPU?</b>
+
+You can make sure that allocations "touched" by vmaTouchAllocation() / vmaGetAllocationInfo() will not
+become lost for a number of additional frames back from the current one by
+specifying this number as VmaAllocatorCreateInfo::frameInUseCount (for default
+memory pool) and VmaPoolCreateInfo::frameInUseCount (for custom pool).
+
+<b>Q: How do you inform the library when new frame starts?</b>
+
+You need to call function vmaSetCurrentFrameIndex().
+
+Example code:
+
+\code
+struct MyBuffer
+{
+ VkBuffer m_Buf = nullptr;
+ VmaAllocation m_Alloc = nullptr;
+
+ // Called when the buffer is really needed in the current frame.
+ void EnsureBuffer();
+};
+
+void MyBuffer::EnsureBuffer()
+{
+ // Buffer has been created.
+ if(m_Buf != VK_NULL_HANDLE)
+ {
+ // Check if its allocation is not lost + mark it as used in current frame.
+ if(vmaTouchAllocation(allocator, m_Alloc))
+ {
+ // It's all OK - safe to use m_Buf.
+ return;
+ }
+ }
+
+ // Buffer not yet exists or lost - destroy and recreate it.
+
+ vmaDestroyBuffer(allocator, m_Buf, m_Alloc);
+
+ VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+ bufCreateInfo.size = 1024;
+ bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+ VmaAllocationCreateInfo allocCreateInfo = {};
+ allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+ allocCreateInfo.flags = VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT |
+ VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT;
+
+ vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &m_Buf, &m_Alloc, nullptr);
+}
+\endcode
+
+When using lost allocations, you may see some Vulkan validation layer warnings
+about overlapping regions of memory bound to different kinds of buffers and
+images. This is still valid as long as you implement proper handling of lost
+allocations (like in the example above) and don't use them.
+
+You can create an allocation that is already in lost state from the beginning using function
+vmaCreateLostAllocation(). It may be useful if you need a "dummy" allocation that is not null.
+
+You can call function vmaMakePoolAllocationsLost() to set all eligible allocations
+in a specified custom pool to lost state.
+Allocations that have been "touched" in current frame or VmaPoolCreateInfo::frameInUseCount frames back
+cannot become lost.
+
+<b>Q: Can I touch allocation that cannot become lost?</b>
+
+Yes, although it has no visible effect.
+Calls to vmaGetAllocationInfo() and vmaTouchAllocation() update last use frame index
+also for allocations that cannot become lost, but the only way to observe it is to dump
+internal allocator state using vmaBuildStatsString().
+You can use this feature for debugging purposes to explicitly mark allocations that you use
+in current frame and then analyze JSON dump to see for how long each allocation stays unused.
+
+
+\page statistics Statistics
+
+This library contains functions that return information about its internal state,
+especially the amount of memory allocated from Vulkan.
+Please keep in mind that these functions need to traverse all internal data structures
+to gather these information, so they may be quite time-consuming.
+Don't call them too often.
+
+\section statistics_numeric_statistics Numeric statistics
+
+You can query for overall statistics of the allocator using function vmaCalculateStats().
+Information are returned using structure #VmaStats.
+It contains #VmaStatInfo - number of allocated blocks, number of allocations
+(occupied ranges in these blocks), number of unused (free) ranges in these blocks,
+number of bytes used and unused (but still allocated from Vulkan) and other information.
+They are summed across memory heaps, memory types and total for whole allocator.
+
+You can query for statistics of a custom pool using function vmaGetPoolStats().
+Information are returned using structure #VmaPoolStats.
+
+You can query for information about specific allocation using function vmaGetAllocationInfo().
+It fill structure #VmaAllocationInfo.
+
+\section statistics_json_dump JSON dump
+
+You can dump internal state of the allocator to a string in JSON format using function vmaBuildStatsString().
+The result is guaranteed to be correct JSON.
+It uses ANSI encoding.
+Any strings provided by user (see [Allocation names](@ref allocation_names))
+are copied as-is and properly escaped for JSON, so if they use UTF-8, ISO-8859-2 or any other encoding,
+this JSON string can be treated as using this encoding.
+It must be freed using function vmaFreeStatsString().
+
+The format of this JSON string is not part of official documentation of the library,
+but it will not change in backward-incompatible way without increasing library major version number
+and appropriate mention in changelog.
+
+The JSON string contains all the data that can be obtained using vmaCalculateStats().
+It can also contain detailed map of allocated memory blocks and their regions -
+free and occupied by allocations.
+This allows e.g. to visualize the memory or assess fragmentation.
+
+
+\page allocation_annotation Allocation names and user data
+
+\section allocation_user_data Allocation user data
+
+You can annotate allocations with your own information, e.g. for debugging purposes.
+To do that, fill VmaAllocationCreateInfo::pUserData field when creating
+an allocation. It's an opaque `void*` pointer. You can use it e.g. as a pointer,
+some handle, index, key, ordinal number or any other value that would associate
+the allocation with your custom metadata.
+
+\code
+VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
+// Fill bufferInfo...
+
+MyBufferMetadata* pMetadata = CreateBufferMetadata();
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+allocCreateInfo.pUserData = pMetadata;
+
+VkBuffer buffer;
+VmaAllocation allocation;
+vmaCreateBuffer(allocator, &bufferInfo, &allocCreateInfo, &buffer, &allocation, nullptr);
+\endcode
+
+The pointer may be later retrieved as VmaAllocationInfo::pUserData:
+
+\code
+VmaAllocationInfo allocInfo;
+vmaGetAllocationInfo(allocator, allocation, &allocInfo);
+MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData;
+\endcode
+
+It can also be changed using function vmaSetAllocationUserData().
+
+Values of (non-zero) allocations' `pUserData` are printed in JSON report created by
+vmaBuildStatsString(), in hexadecimal form.
+
+\section allocation_names Allocation names
+
+There is alternative mode available where `pUserData` pointer is used to point to
+a null-terminated string, giving a name to the allocation. To use this mode,
+set #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT flag in VmaAllocationCreateInfo::flags.
+Then `pUserData` passed as VmaAllocationCreateInfo::pUserData or argument to
+vmaSetAllocationUserData() must be either null or pointer to a null-terminated string.
+The library creates internal copy of the string, so the pointer you pass doesn't need
+to be valid for whole lifetime of the allocation. You can free it after the call.
+
+\code
+VkImageCreateInfo imageInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
+// Fill imageInfo...
+
+std::string imageName = "Texture: ";
+imageName += fileName;
+
+VmaAllocationCreateInfo allocCreateInfo = {};
+allocCreateInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+allocCreateInfo.flags = VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT;
+allocCreateInfo.pUserData = imageName.c_str();
+
+VkImage image;
+VmaAllocation allocation;
+vmaCreateImage(allocator, &imageInfo, &allocCreateInfo, &image, &allocation, nullptr);
+\endcode
+
+The value of `pUserData` pointer of the allocation will be different than the one
+you passed when setting allocation's name - pointing to a buffer managed
+internally that holds copy of the string.
+
+\code
+VmaAllocationInfo allocInfo;
+vmaGetAllocationInfo(allocator, allocation, &allocInfo);
+const char* imageName = (const char*)allocInfo.pUserData;
+printf("Image name: %s\n", imageName);
+\endcode
+
+That string is also printed in JSON report created by vmaBuildStatsString().
+
+
+\page debugging_memory_usage Debugging incorrect memory usage
+
+If you suspect a bug with memory usage, like usage of uninitialized memory or
+memory being overwritten out of bounds of an allocation,
+you can use debug features of this library to verify this.
+
+\section debugging_memory_usage_initialization Memory initialization
+
+If you experience a bug with incorrect and nondeterministic data in your program and you suspect uninitialized memory to be used,
+you can enable automatic memory initialization to verify this.
+To do it, define macro `VMA_DEBUG_INITIALIZE_ALLOCATIONS` to 1.
+
+\code
+#define VMA_DEBUG_INITIALIZE_ALLOCATIONS 1
+#include "vk_mem_alloc.h"
+\endcode
+
+It makes memory of all new allocations initialized to bit pattern `0xDCDCDCDC`.
+Before an allocation is destroyed, its memory is filled with bit pattern `0xEFEFEFEF`.
+Memory is automatically mapped and unmapped if necessary.
+
+If you find these values while debugging your program, good chances are that you incorrectly
+read Vulkan memory that is allocated but not initialized, or already freed, respectively.
+
+Memory initialization works only with memory types that are `HOST_VISIBLE`.
+It works also with dedicated allocations.
+It doesn't work with allocations created with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag,
+as they cannot be mapped.
+
+\section debugging_memory_usage_margins Margins
+
+By default, allocations are laid out in memory blocks next to each other if possible
+(considering required alignment, `bufferImageGranularity`, and `nonCoherentAtomSize`).
+
+![Allocations without margin](../gfx/Margins_1.png)
+
+Define macro `VMA_DEBUG_MARGIN` to some non-zero value (e.g. 16) to enforce specified
+number of bytes as a margin before and after every allocation.
+
+\code
+#define VMA_DEBUG_MARGIN 16
+#include "vk_mem_alloc.h"
+\endcode
+
+![Allocations with margin](../gfx/Margins_2.png)
+
+If your bug goes away after enabling margins, it means it may be caused by memory
+being overwritten outside of allocation boundaries. It is not 100% certain though.
+Change in application behavior may also be caused by different order and distribution
+of allocations across memory blocks after margins are applied.
+
+The margin is applied also before first and after last allocation in a block.
+It may occur only once between two adjacent allocations.
+
+Margins work with all types of memory.
+
+Margin is applied only to allocations made out of memory blocks and not to dedicated
+allocations, which have their own memory block of specific size.
+It is thus not applied to allocations made using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag
+or those automatically decided to put into dedicated allocations, e.g. due to its
+large size or recommended by VK_KHR_dedicated_allocation extension.
+Margins are also not active in custom pools created with #VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT flag.
+
+Margins appear in [JSON dump](@ref statistics_json_dump) as part of free space.
+
+Note that enabling margins increases memory usage and fragmentation.
+
+\section debugging_memory_usage_corruption_detection Corruption detection
+
+You can additionally define macro `VMA_DEBUG_DETECT_CORRUPTION` to 1 to enable validation
+of contents of the margins.
+
+\code
+#define VMA_DEBUG_MARGIN 16
+#define VMA_DEBUG_DETECT_CORRUPTION 1
+#include "vk_mem_alloc.h"
+\endcode
+
+When this feature is enabled, number of bytes specified as `VMA_DEBUG_MARGIN`
+(it must be multiply of 4) before and after every allocation is filled with a magic number.
+This idea is also know as "canary".
+Memory is automatically mapped and unmapped if necessary.
+
+This number is validated automatically when the allocation is destroyed.
+If it's not equal to the expected value, `VMA_ASSERT()` is executed.
+It clearly means that either CPU or GPU overwritten the memory outside of boundaries of the allocation,
+which indicates a serious bug.
+
+You can also explicitly request checking margins of all allocations in all memory blocks
+that belong to specified memory types by using function vmaCheckCorruption(),
+or in memory blocks that belong to specified custom pool, by using function
+vmaCheckPoolCorruption().
+
+Margin validation (corruption detection) works only for memory types that are
+`HOST_VISIBLE` and `HOST_COHERENT`.
+
+
+\page record_and_replay Record and replay
+
+\section record_and_replay_introduction Introduction
+
+While using the library, sequence of calls to its functions together with their
+parameters can be recorded to a file and later replayed using standalone player
+application. It can be useful to:
+
+- Test correctness - check if same sequence of calls will not cause crash or
+ failures on a target platform.
+- Gather statistics - see number of allocations, peak memory usage, number of
+ calls etc.
+- Benchmark performance - see how much time it takes to replay the whole
+ sequence.
+
+\section record_and_replay_usage Usage
+
+<b>To record sequence of calls to a file:</b> Fill in
+VmaAllocatorCreateInfo::pRecordSettings member while creating #VmaAllocator
+object. File is opened and written during whole lifetime of the allocator.
+
+<b>To replay file:</b> Use VmaReplay - standalone command-line program.
+Precompiled binary can be found in "bin" directory.
+Its source can be found in "src/VmaReplay" directory.
+Its project is generated by Premake.
+Command line syntax is printed when the program is launched without parameters.
+Basic usage:
+
+ VmaReplay.exe MyRecording.csv
+
+<b>Documentation of file format</b> can be found in file: "docs/Recording file format.md".
+It's a human-readable, text file in CSV format (Comma Separated Values).
+
+\section record_and_replay_additional_considerations Additional considerations
+
+- Replaying file that was recorded on a different GPU (with different parameters
+ like `bufferImageGranularity`, `nonCoherentAtomSize`, and especially different
+ set of memory heaps and types) may give different performance and memory usage
+ results, as well as issue some warnings and errors.
+- Current implementation of recording in VMA, as well as VmaReplay application, is
+ coded and tested only on Windows. Inclusion of recording code is driven by
+ `VMA_RECORDING_ENABLED` macro. Support for other platforms should be easy to
+ add. Contributions are welcomed.
+- Currently calls to vmaDefragment() function are not recorded.
+
+
+\page usage_patterns Recommended usage patterns
+
+See also slides from talk:
+[Sawicki, Adam. Advanced Graphics Techniques Tutorial: Memory management in Vulkan and DX12. Game Developers Conference, 2018](https://www.gdcvault.com/play/1025458/Advanced-Graphics-Techniques-Tutorial-New)
+
+
+\section usage_patterns_simple Simple patterns
+
+\subsection usage_patterns_simple_render_targets Render targets
+
+<b>When:</b>
+Any resources that you frequently write and read on GPU,
+e.g. images used as color attachments (aka "render targets"), depth-stencil attachments,
+images/buffers used as storage image/buffer (aka "Unordered Access View (UAV)").
+
+<b>What to do:</b>
+Create them in video memory that is fastest to access from GPU using
+#VMA_MEMORY_USAGE_GPU_ONLY.
+
+Consider using [VK_KHR_dedicated_allocation](@ref vk_khr_dedicated_allocation) extension
+and/or manually creating them as dedicated allocations using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT,
+especially if they are large or if you plan to destroy and recreate them e.g. when
+display resolution changes.
+Prefer to create such resources first and all other GPU resources (like textures and vertex buffers) later.
+
+\subsection usage_patterns_simple_immutable_resources Immutable resources
+
+<b>When:</b>
+Any resources that you fill on CPU only once (aka "immutable") or infrequently
+and then read frequently on GPU,
+e.g. textures, vertex and index buffers, constant buffers that don't change often.
+
+<b>What to do:</b>
+Create them in video memory that is fastest to access from GPU using
+#VMA_MEMORY_USAGE_GPU_ONLY.
+
+To initialize content of such resource, create a CPU-side (aka "staging") copy of it
+in system memory - #VMA_MEMORY_USAGE_CPU_ONLY, map it, fill it,
+and submit a transfer from it to the GPU resource.
+You can keep the staging copy if you need it for another upload transfer in the future.
+If you don't, you can destroy it or reuse this buffer for uploading different resource
+after the transfer finishes.
+
+Prefer to create just buffers in system memory rather than images, even for uploading textures.
+Use `vkCmdCopyBufferToImage()`.
+Dont use images with `VK_IMAGE_TILING_LINEAR`.
+
+\subsection usage_patterns_dynamic_resources Dynamic resources
+
+<b>When:</b>
+Any resources that change frequently (aka "dynamic"), e.g. every frame or every draw call,
+written on CPU, read on GPU.
+
+<b>What to do:</b>
+Create them using #VMA_MEMORY_USAGE_CPU_TO_GPU.
+You can map it and write to it directly on CPU, as well as read from it on GPU.
+
+This is a more complex situation. Different solutions are possible,
+and the best one depends on specific GPU type, but you can use this simple approach for the start.
+Prefer to write to such resource sequentially (e.g. using `memcpy`).
+Don't perform random access or any reads from it on CPU, as it may be very slow.
+
+\subsection usage_patterns_readback Readback
+
+<b>When:</b>
+Resources that contain data written by GPU that you want to read back on CPU,
+e.g. results of some computations.
+
+<b>What to do:</b>
+Create them using #VMA_MEMORY_USAGE_GPU_TO_CPU.
+You can write to them directly on GPU, as well as map and read them on CPU.
+
+\section usage_patterns_advanced Advanced patterns
+
+\subsection usage_patterns_integrated_graphics Detecting integrated graphics
+
+You can support integrated graphics (like Intel HD Graphics, AMD APU) better
+by detecting it in Vulkan.
+To do it, call `vkGetPhysicalDeviceProperties()`, inspect
+`VkPhysicalDeviceProperties::deviceType` and look for `VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU`.
+When you find it, you can assume that memory is unified and all memory types are comparably fast
+to access from GPU, regardless of `VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT`.
+
+You can then sum up sizes of all available memory heaps and treat them as useful for
+your GPU resources, instead of only `DEVICE_LOCAL` ones.
+You can also prefer to create your resources in memory types that are `HOST_VISIBLE` to map them
+directly instead of submitting explicit transfer (see below).
+
+\subsection usage_patterns_direct_vs_transfer Direct access versus transfer
+
+For resources that you frequently write on CPU and read on GPU, many solutions are possible:
+
+-# Create one copy in video memory using #VMA_MEMORY_USAGE_GPU_ONLY,
+ second copy in system memory using #VMA_MEMORY_USAGE_CPU_ONLY and submit explicit tranfer each time.
+-# Create just single copy using #VMA_MEMORY_USAGE_CPU_TO_GPU, map it and fill it on CPU,
+ read it directly on GPU.
+-# Create just single copy using #VMA_MEMORY_USAGE_CPU_ONLY, map it and fill it on CPU,
+ read it directly on GPU.
+
+Which solution is the most efficient depends on your resource and especially on the GPU.
+It is best to measure it and then make the decision.
+Some general recommendations:
+
+- On integrated graphics use (2) or (3) to avoid unnecesary time and memory overhead
+ related to using a second copy and making transfer.
+- For small resources (e.g. constant buffers) use (2).
+ Discrete AMD cards have special 256 MiB pool of video memory that is directly mappable.
+ Even if the resource ends up in system memory, its data may be cached on GPU after first
+ fetch over PCIe bus.
+- For larger resources (e.g. textures), decide between (1) and (2).
+ You may want to differentiate NVIDIA and AMD, e.g. by looking for memory type that is
+ both `DEVICE_LOCAL` and `HOST_VISIBLE`. When you find it, use (2), otherwise use (1).
+
+Similarly, for resources that you frequently write on GPU and read on CPU, multiple
+solutions are possible:
+
+-# Create one copy in video memory using #VMA_MEMORY_USAGE_GPU_ONLY,
+ second copy in system memory using #VMA_MEMORY_USAGE_GPU_TO_CPU and submit explicit tranfer each time.
+-# Create just single copy using #VMA_MEMORY_USAGE_GPU_TO_CPU, write to it directly on GPU,
+ map it and read it on CPU.
+
+You should take some measurements to decide which option is faster in case of your specific
+resource.
+
+If you don't want to specialize your code for specific types of GPUs, you can still make
+an simple optimization for cases when your resource ends up in mappable memory to use it
+directly in this case instead of creating CPU-side staging copy.
+For details see [Finding out if memory is mappable](@ref memory_mapping_finding_if_memory_mappable).
+
+
+\page configuration Configuration
+
+Please check "CONFIGURATION SECTION" in the code to find macros that you can define
+before each include of this file or change directly in this file to provide
+your own implementation of basic facilities like assert, `min()` and `max()` functions,
+mutex, atomic etc.
+The library uses its own implementation of containers by default, but you can switch to using
+STL containers instead.
+
+\section config_Vulkan_functions Pointers to Vulkan functions
+
+The library uses Vulkan functions straight from the `vulkan.h` header by default.
+If you want to provide your own pointers to these functions, e.g. fetched using
+`vkGetInstanceProcAddr()` and `vkGetDeviceProcAddr()`:
+
+-# Define `VMA_STATIC_VULKAN_FUNCTIONS 0`.
+-# Provide valid pointers through VmaAllocatorCreateInfo::pVulkanFunctions.
+
+\section custom_memory_allocator Custom host memory allocator
+
+If you use custom allocator for CPU memory rather than default operator `new`
+and `delete` from C++, you can make this library using your allocator as well
+by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These
+functions will be passed to Vulkan, as well as used by the library itself to
+make any CPU-side allocations.
+
+\section allocation_callbacks Device memory allocation callbacks
+
+The library makes calls to `vkAllocateMemory()` and `vkFreeMemory()` internally.
+You can setup callbacks to be informed about these calls, e.g. for the purpose
+of gathering some statistics. To do it, fill optional member
+VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
+
+\section heap_memory_limit Device heap memory limit
+
+If you want to test how your program behaves with limited amount of Vulkan device
+memory available without switching your graphics card to one that really has
+smaller VRAM, you can use a feature of this library intended for this purpose.
+To do it, fill optional member VmaAllocatorCreateInfo::pHeapSizeLimit.
+
+
+
+\page vk_khr_dedicated_allocation VK_KHR_dedicated_allocation
+
+VK_KHR_dedicated_allocation is a Vulkan extension which can be used to improve
+performance on some GPUs. It augments Vulkan API with possibility to query
+driver whether it prefers particular buffer or image to have its own, dedicated
+allocation (separate `VkDeviceMemory` block) for better efficiency - to be able
+to do some internal optimizations.
+
+The extension is supported by this library. It will be used automatically when
+enabled. To enable it:
+
+1 . When creating Vulkan device, check if following 2 device extensions are
+supported (call `vkEnumerateDeviceExtensionProperties()`).
+If yes, enable them (fill `VkDeviceCreateInfo::ppEnabledExtensionNames`).
+
+- VK_KHR_get_memory_requirements2
+- VK_KHR_dedicated_allocation
+
+If you enabled these extensions:
+
+2 . Use #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag when creating
+your #VmaAllocator`to inform the library that you enabled required extensions
+and you want the library to use them.
+
+\code
+allocatorInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT;
+
+vmaCreateAllocator(&allocatorInfo, &allocator);
+\endcode
+
+That's all. The extension will be automatically used whenever you create a
+buffer using vmaCreateBuffer() or image using vmaCreateImage().
+
+When using the extension together with Vulkan Validation Layer, you will receive
+warnings like this:
+
+ vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer.
+
+It is OK, you should just ignore it. It happens because you use function
+`vkGetBufferMemoryRequirements2KHR()` instead of standard
+`vkGetBufferMemoryRequirements()`, while the validation layer seems to be
+unaware of it.
+
+To learn more about this extension, see:
+
+- [VK_KHR_dedicated_allocation in Vulkan specification](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VK_KHR_dedicated_allocation)
+- [VK_KHR_dedicated_allocation unofficial manual](http://asawicki.info/articles/VK_KHR_dedicated_allocation.php5)
+
+
+
+\page general_considerations General considerations
+
+\section general_considerations_thread_safety Thread safety
+
+- The library has no global state, so separate #VmaAllocator objects can be used
+ independently.
+ There should be no need to create multiple such objects though - one per `VkDevice` is enough.
+- By default, all calls to functions that take #VmaAllocator as first parameter
+ are safe to call from multiple threads simultaneously because they are
+ synchronized internally when needed.
+- When the allocator is created with #VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
+ flag, calls to functions that take such #VmaAllocator object must be
+ synchronized externally.
+- Access to a #VmaAllocation object must be externally synchronized. For example,
+ you must not call vmaGetAllocationInfo() and vmaMapMemory() from different
+ threads at the same time if you pass the same #VmaAllocation object to these
+ functions.
+
+\section general_considerations_validation_layer_warnings Validation layer warnings
+
+When using this library, you can meet following types of warnings issued by
+Vulkan validation layer. They don't necessarily indicate a bug, so you may need
+to just ignore them.
+
+- *vkBindBufferMemory(): Binding memory to buffer 0xeb8e4 but vkGetBufferMemoryRequirements() has not been called on that buffer.*
+ - It happens when VK_KHR_dedicated_allocation extension is enabled.
+ `vkGetBufferMemoryRequirements2KHR` function is used instead, while validation layer seems to be unaware of it.
+- *Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.*
+ - It happens when you map a buffer or image, because the library maps entire
+ `VkDeviceMemory` block, where different types of images and buffers may end
+ up together, especially on GPUs with unified memory like Intel.
+- *Non-linear image 0xebc91 is aliased with linear buffer 0xeb8e4 which may indicate a bug.*
+ - It happens when you use lost allocations, and a new image or buffer is
+ created in place of an existing object that bacame lost.
+ - It may happen also when you use [defragmentation](@ref defragmentation).
+
+\section general_considerations_allocation_algorithm Allocation algorithm
+
+The library uses following algorithm for allocation, in order:
+
+-# Try to find free range of memory in existing blocks.
+-# If failed, try to create a new block of `VkDeviceMemory`, with preferred block size.
+-# If failed, try to create such block with size/2, size/4, size/8.
+-# If failed and #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag was
+ specified, try to find space in existing blocks, possilby making some other
+ allocations lost.
+-# If failed, try to allocate separate `VkDeviceMemory` for this allocation,
+ just like when you use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
+-# If failed, choose other memory type that meets the requirements specified in
+ VmaAllocationCreateInfo and go to point 1.
+-# If failed, return `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
+
+\section general_considerations_features_not_supported Features not supported
+
+Features deliberately excluded from the scope of this library:
+
+- Data transfer. Uploading (straming) and downloading data of buffers and images
+ between CPU and GPU memory and related synchronization is responsibility of the user.
+- Allocations for imported/exported external memory. They tend to require
+ explicit memory type index and dedicated allocation anyway, so they don't
+ interact with main features of this library. Such special purpose allocations
+ should be made manually, using `vkCreateBuffer()` and `vkAllocateMemory()`.
+- Recreation of buffers and images. Although the library has functions for
+ buffer and image creation (vmaCreateBuffer(), vmaCreateImage()), you need to
+ recreate these objects yourself after defragmentation. That's because the big
+ structures `VkBufferCreateInfo`, `VkImageCreateInfo` are not stored in
+ #VmaAllocation object.
+- Handling CPU memory allocation failures. When dynamically creating small C++
+ objects in CPU memory (not Vulkan memory), allocation failures are not checked
+ and handled gracefully, because that would complicate code significantly and
+ is usually not needed in desktop PC applications anyway.
+- Code free of any compiler warnings. Maintaining the library to compile and
+ work correctly on so many different platforms is hard enough. Being free of
+ any warnings, on any version of any compiler, is simply not feasible.
+- This is a C++ library with C interface.
+ Bindings or ports to any other programming languages are welcomed as external projects and
+ are not going to be included into this repository.
+
+*/
+
+/*
+Define this macro to 0/1 to disable/enable support for recording functionality,
+available through VmaAllocatorCreateInfo::pRecordSettings.
+*/
+#ifndef VMA_RECORDING_ENABLED
+ #ifdef _WIN32
+ #define VMA_RECORDING_ENABLED 1
+ #else
+ #define VMA_RECORDING_ENABLED 0
+ #endif
+#endif
+
+#ifndef NOMINMAX
+ #define NOMINMAX // For windows.h
+#endif
+
+#ifndef VULKAN_H_
+ #include <vulkan/vulkan.h>
+#endif
+
+#if VMA_RECORDING_ENABLED
+ #include <windows.h>
+#endif
+
+#if !defined(VMA_DEDICATED_ALLOCATION)
+ #if VK_KHR_get_memory_requirements2 && VK_KHR_dedicated_allocation
+ #define VMA_DEDICATED_ALLOCATION 1
+ #else
+ #define VMA_DEDICATED_ALLOCATION 0
+ #endif
+#endif
+
+/** \struct VmaAllocator
+\brief Represents main object of this library initialized.
+
+Fill structure #VmaAllocatorCreateInfo and call function vmaCreateAllocator() to create it.
+Call function vmaDestroyAllocator() to destroy it.
+
+It is recommended to create just one object of this type per `VkDevice` object,
+right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed.
+*/
+VK_DEFINE_HANDLE(VmaAllocator)
+
+/// Callback function called after successful vkAllocateMemory.
+typedef void (VKAPI_PTR *PFN_vmaAllocateDeviceMemoryFunction)(
+ VmaAllocator allocator,
+ uint32_t memoryType,
+ VkDeviceMemory memory,
+ VkDeviceSize size);
+/// Callback function called before vkFreeMemory.
+typedef void (VKAPI_PTR *PFN_vmaFreeDeviceMemoryFunction)(
+ VmaAllocator allocator,
+ uint32_t memoryType,
+ VkDeviceMemory memory,
+ VkDeviceSize size);
+
+/** \brief Set of callbacks that the library will call for `vkAllocateMemory` and `vkFreeMemory`.
+
+Provided for informative purpose, e.g. to gather statistics about number of
+allocations or total amount of memory allocated in Vulkan.
+
+Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.
+*/
+typedef struct VmaDeviceMemoryCallbacks {
+ /// Optional, can be null.
+ PFN_vmaAllocateDeviceMemoryFunction pfnAllocate;
+ /// Optional, can be null.
+ PFN_vmaFreeDeviceMemoryFunction pfnFree;
+} VmaDeviceMemoryCallbacks;
+
+/// Flags for created #VmaAllocator.
+typedef enum VmaAllocatorCreateFlagBits {
+ /** \brief Allocator and all objects created from it will not be synchronized internally, so you must guarantee they are used from only one thread at a time or synchronized externally by you.
+
+ Using this flag may increase performance because internal mutexes are not used.
+ */
+ VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001,
+ /** \brief Enables usage of VK_KHR_dedicated_allocation extension.
+
+ Using this extenion will automatically allocate dedicated blocks of memory for
+ some buffers and images instead of suballocating place for them out of bigger
+ memory blocks (as if you explicitly used #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
+ flag) when it is recommended by the driver. It may improve performance on some
+ GPUs.
+
+ You may set this flag only if you found out that following device extensions are
+ supported, you enabled them while creating Vulkan device passed as
+ VmaAllocatorCreateInfo::device, and you want them to be used internally by this
+ library:
+
+ - VK_KHR_get_memory_requirements2
+ - VK_KHR_dedicated_allocation
+
+When this flag is set, you can experience following warnings reported by Vulkan
+validation layer. You can ignore them.
+
+> vkBindBufferMemory(): Binding memory to buffer 0x2d but vkGetBufferMemoryRequirements() has not been called on that buffer.
+ */
+ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT = 0x00000002,
+
+ VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaAllocatorCreateFlagBits;
+typedef VkFlags VmaAllocatorCreateFlags;
+
+/** \brief Pointers to some Vulkan functions - a subset used by the library.
+
+Used in VmaAllocatorCreateInfo::pVulkanFunctions.
+*/
+typedef struct VmaVulkanFunctions {
+ PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
+ PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
+ PFN_vkAllocateMemory vkAllocateMemory;
+ PFN_vkFreeMemory vkFreeMemory;
+ PFN_vkMapMemory vkMapMemory;
+ PFN_vkUnmapMemory vkUnmapMemory;
+ PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
+ PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
+ PFN_vkBindBufferMemory vkBindBufferMemory;
+ PFN_vkBindImageMemory vkBindImageMemory;
+ PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
+ PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
+ PFN_vkCreateBuffer vkCreateBuffer;
+ PFN_vkDestroyBuffer vkDestroyBuffer;
+ PFN_vkCreateImage vkCreateImage;
+ PFN_vkDestroyImage vkDestroyImage;
+ PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
+#if VMA_DEDICATED_ALLOCATION
+ PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR;
+ PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR;
+#endif
+} VmaVulkanFunctions;
+
+/// Flags to be used in VmaRecordSettings::flags.
+typedef enum VmaRecordFlagBits {
+ /** \brief Enables flush after recording every function call.
+
+ Enable it if you expect your application to crash, which may leave recording file truncated.
+ It may degrade performance though.
+ */
+ VMA_RECORD_FLUSH_AFTER_CALL_BIT = 0x00000001,
+
+ VMA_RECORD_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaRecordFlagBits;
+typedef VkFlags VmaRecordFlags;
+
+/// Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSettings.
+typedef struct VmaRecordSettings
+{
+ /// Flags for recording. Use #VmaRecordFlagBits enum.
+ VmaRecordFlags flags;
+ /** \brief Path to the file that should be written by the recording.
+
+ Suggested extension: "csv".
+ If the file already exists, it will be overwritten.
+ It will be opened for the whole time #VmaAllocator object is alive.
+ If opening this file fails, creation of the whole allocator object fails.
+ */
+ const char* pFilePath;
+} VmaRecordSettings;
+
+/// Description of a Allocator to be created.
+typedef struct VmaAllocatorCreateInfo
+{
+ /// Flags for created allocator. Use #VmaAllocatorCreateFlagBits enum.
+ VmaAllocatorCreateFlags flags;
+ /// Vulkan physical device.
+ /** It must be valid throughout whole lifetime of created allocator. */
+ VkPhysicalDevice physicalDevice;
+ /// Vulkan device.
+ /** It must be valid throughout whole lifetime of created allocator. */
+ VkDevice device;
+ /// Preferred size of a single `VkDeviceMemory` block to be allocated from large heaps > 1 GiB. Optional.
+ /** Set to 0 to use default, which is currently 256 MiB. */
+ VkDeviceSize preferredLargeHeapBlockSize;
+ /// Custom CPU memory allocation callbacks. Optional.
+ /** Optional, can be null. When specified, will also be used for all CPU-side memory allocations. */
+ const VkAllocationCallbacks* pAllocationCallbacks;
+ /// Informative callbacks for `vkAllocateMemory`, `vkFreeMemory`. Optional.
+ /** Optional, can be null. */
+ const VmaDeviceMemoryCallbacks* pDeviceMemoryCallbacks;
+ /** \brief Maximum number of additional frames that are in use at the same time as current frame.
+
+ This value is used only when you make allocations with
+ VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocation cannot become
+ lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount.
+
+ For example, if you double-buffer your command buffers, so resources used for
+ rendering in previous frame may still be in use by the GPU at the moment you
+ allocate resources needed for the current frame, set this value to 1.
+
+ If you want to allow any allocations other than used in the current frame to
+ become lost, set this value to 0.
+ */
+ uint32_t frameInUseCount;
+ /** \brief Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap.
+
+ If not NULL, it must be a pointer to an array of
+ `VkPhysicalDeviceMemoryProperties::memoryHeapCount` elements, defining limit on
+ maximum number of bytes that can be allocated out of particular Vulkan memory
+ heap.
+
+ Any of the elements may be equal to `VK_WHOLE_SIZE`, which means no limit on that
+ heap. This is also the default in case of `pHeapSizeLimit` = NULL.
+
+ If there is a limit defined for a heap:
+
+ - If user tries to allocate more memory from that heap using this allocator,
+ the allocation fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY`.
+ - If the limit is smaller than heap size reported in `VkMemoryHeap::size`, the
+ value of this limit will be reported instead when using vmaGetMemoryProperties().
+
+ Warning! Using this feature may not be equivalent to installing a GPU with
+ smaller amount of memory, because graphics driver doesn't necessary fail new
+ allocations with `VK_ERROR_OUT_OF_DEVICE_MEMORY` result when memory capacity is
+ exceeded. It may return success and just silently migrate some device memory
+ blocks to system RAM. This driver behavior can also be controlled using
+ VK_AMD_memory_overallocation_behavior extension.
+ */
+ const VkDeviceSize* pHeapSizeLimit;
+ /** \brief Pointers to Vulkan functions. Can be null if you leave define `VMA_STATIC_VULKAN_FUNCTIONS 1`.
+
+ If you leave define `VMA_STATIC_VULKAN_FUNCTIONS 1` in configuration section,
+ you can pass null as this member, because the library will fetch pointers to
+ Vulkan functions internally in a static way, like:
+
+ vulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
+
+ Fill this member if you want to provide your own pointers to Vulkan functions,
+ e.g. fetched using `vkGetInstanceProcAddr()` and `vkGetDeviceProcAddr()`.
+ */
+ const VmaVulkanFunctions* pVulkanFunctions;
+ /** \brief Parameters for recording of VMA calls. Can be null.
+
+ If not null, it enables recording of calls to VMA functions to a file.
+ If support for recording is not enabled using `VMA_RECORDING_ENABLED` macro,
+ creation of the allocator object fails with `VK_ERROR_FEATURE_NOT_PRESENT`.
+ */
+ const VmaRecordSettings* pRecordSettings;
+} VmaAllocatorCreateInfo;
+
+/// Creates Allocator object.
+VkResult vmaCreateAllocator(
+ const VmaAllocatorCreateInfo* pCreateInfo,
+ VmaAllocator* pAllocator);
+
+/// Destroys allocator object.
+void vmaDestroyAllocator(
+ VmaAllocator allocator);
+
+/**
+PhysicalDeviceProperties are fetched from physicalDevice by the allocator.
+You can access it here, without fetching it again on your own.
+*/
+void vmaGetPhysicalDeviceProperties(
+ VmaAllocator allocator,
+ const VkPhysicalDeviceProperties** ppPhysicalDeviceProperties);
+
+/**
+PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.
+You can access it here, without fetching it again on your own.
+*/
+void vmaGetMemoryProperties(
+ VmaAllocator allocator,
+ const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties);
+
+/**
+\brief Given Memory Type Index, returns Property Flags of this memory type.
+
+This is just a convenience function. Same information can be obtained using
+vmaGetMemoryProperties().
+*/
+void vmaGetMemoryTypeProperties(
+ VmaAllocator allocator,
+ uint32_t memoryTypeIndex,
+ VkMemoryPropertyFlags* pFlags);
+
+/** \brief Sets index of the current frame.
+
+This function must be used if you make allocations with
+#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT and
+#VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flags to inform the allocator
+when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot
+become lost in the current frame.
+*/
+void vmaSetCurrentFrameIndex(
+ VmaAllocator allocator,
+ uint32_t frameIndex);
+
+/** \brief Calculated statistics of memory usage in entire allocator.
+*/
+typedef struct VmaStatInfo
+{
+ /// Number of `VkDeviceMemory` Vulkan memory blocks allocated.
+ uint32_t blockCount;
+ /// Number of #VmaAllocation allocation objects allocated.
+ uint32_t allocationCount;
+ /// Number of free ranges of memory between allocations.
+ uint32_t unusedRangeCount;
+ /// Total number of bytes occupied by all allocations.
+ VkDeviceSize usedBytes;
+ /// Total number of bytes occupied by unused ranges.
+ VkDeviceSize unusedBytes;
+ VkDeviceSize allocationSizeMin, allocationSizeAvg, allocationSizeMax;
+ VkDeviceSize unusedRangeSizeMin, unusedRangeSizeAvg, unusedRangeSizeMax;
+} VmaStatInfo;
+
+/// General statistics from current state of Allocator.
+typedef struct VmaStats
+{
+ VmaStatInfo memoryType[VK_MAX_MEMORY_TYPES];
+ VmaStatInfo memoryHeap[VK_MAX_MEMORY_HEAPS];
+ VmaStatInfo total;
+} VmaStats;
+
+/// Retrieves statistics from current state of the Allocator.
+void vmaCalculateStats(
+ VmaAllocator allocator,
+ VmaStats* pStats);
+
+#define VMA_STATS_STRING_ENABLED 1
+
+#if VMA_STATS_STRING_ENABLED
+
+/// Builds and returns statistics as string in JSON format.
+/** @param[out] ppStatsString Must be freed using vmaFreeStatsString() function.
+*/
+void vmaBuildStatsString(
+ VmaAllocator allocator,
+ char** ppStatsString,
+ VkBool32 detailedMap);
+
+void vmaFreeStatsString(
+ VmaAllocator allocator,
+ char* pStatsString);
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+/** \struct VmaPool
+\brief Represents custom memory pool
+
+Fill structure VmaPoolCreateInfo and call function vmaCreatePool() to create it.
+Call function vmaDestroyPool() to destroy it.
+
+For more information see [Custom memory pools](@ref choosing_memory_type_custom_memory_pools).
+*/
+VK_DEFINE_HANDLE(VmaPool)
+
+typedef enum VmaMemoryUsage
+{
+ /** No intended memory usage specified.
+ Use other members of VmaAllocationCreateInfo to specify your requirements.
+ */
+ VMA_MEMORY_USAGE_UNKNOWN = 0,
+ /** Memory will be used on device only, so fast access from the device is preferred.
+ It usually means device-local GPU (video) memory.
+ No need to be mappable on host.
+ It is roughly equivalent of `D3D12_HEAP_TYPE_DEFAULT`.
+
+ Usage:
+
+ - Resources written and read by device, e.g. images used as attachments.
+ - Resources transferred from host once (immutable) or infrequently and read by
+ device multiple times, e.g. textures to be sampled, vertex buffers, uniform
+ (constant) buffers, and majority of other types of resources used on GPU.
+
+ Allocation may still end up in `HOST_VISIBLE` memory on some implementations.
+ In such case, you are free to map it.
+ You can use #VMA_ALLOCATION_CREATE_MAPPED_BIT with this usage type.
+ */
+ VMA_MEMORY_USAGE_GPU_ONLY = 1,
+ /** Memory will be mappable on host.
+ It usually means CPU (system) memory.
+ Guarantees to be `HOST_VISIBLE` and `HOST_COHERENT`.
+ CPU access is typically uncached. Writes may be write-combined.
+ Resources created in this pool may still be accessible to the device, but access to them can be slow.
+ It is roughly equivalent of `D3D12_HEAP_TYPE_UPLOAD`.
+
+ Usage: Staging copy of resources used as transfer source.
+ */
+ VMA_MEMORY_USAGE_CPU_ONLY = 2,
+ /**
+ Memory that is both mappable on host (guarantees to be `HOST_VISIBLE`) and preferably fast to access by GPU.
+ CPU access is typically uncached. Writes may be write-combined.
+
+ Usage: Resources written frequently by host (dynamic), read by device. E.g. textures, vertex buffers, uniform buffers updated every frame or every draw call.
+ */
+ VMA_MEMORY_USAGE_CPU_TO_GPU = 3,
+ /** Memory mappable on host (guarantees to be `HOST_VISIBLE`) and cached.
+ It is roughly equivalent of `D3D12_HEAP_TYPE_READBACK`.
+
+ Usage:
+
+ - Resources written by device, read by host - results of some computations, e.g. screen capture, average scene luminance for HDR tone mapping.
+ - Any resources read or accessed randomly on host, e.g. CPU-side copy of vertex buffer used as source of transfer, but also used for collision detection.
+ */
+ VMA_MEMORY_USAGE_GPU_TO_CPU = 4,
+ VMA_MEMORY_USAGE_MAX_ENUM = 0x7FFFFFFF
+} VmaMemoryUsage;
+
+/// Flags to be passed as VmaAllocationCreateInfo::flags.
+typedef enum VmaAllocationCreateFlagBits {
+ /** \brief Set this flag if the allocation should have its own memory block.
+
+ Use it for special, big resources, like fullscreen images used as attachments.
+
+ This flag must also be used for host visible resources that you want to map
+ simultaneously because otherwise they might end up as regions of the same
+ `VkDeviceMemory`, while mapping same `VkDeviceMemory` multiple times
+ simultaneously is illegal.
+
+ You should not use this flag if VmaAllocationCreateInfo::pool is not null.
+ */
+ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001,
+
+ /** \brief Set this flag to only try to allocate from existing `VkDeviceMemory` blocks and never create new such block.
+
+ If new allocation cannot be placed in any of the existing blocks, allocation
+ fails with `VK_ERROR_OUT_OF_DEVICE_MEMORY` error.
+
+ You should not use #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and
+ #VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense.
+
+ If VmaAllocationCreateInfo::pool is not null, this flag is implied and ignored. */
+ VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002,
+ /** \brief Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
+
+ Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData.
+
+ Is it valid to use this flag for allocation made from memory type that is not
+ `HOST_VISIBLE`. This flag is then ignored and memory is not mapped. This is
+ useful if you need an allocation that is efficient to use on GPU
+ (`DEVICE_LOCAL`) and still want to map it directly if possible on platforms that
+ support it (e.g. Intel GPU).
+
+ You should not use this flag together with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT.
+ */
+ VMA_ALLOCATION_CREATE_MAPPED_BIT = 0x00000004,
+ /** Allocation created with this flag can become lost as a result of another
+ allocation with #VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag, so you
+ must check it before use.
+
+ To check if allocation is not lost, call vmaGetAllocationInfo() and check if
+ VmaAllocationInfo::deviceMemory is not `VK_NULL_HANDLE`.
+
+ For details about supporting lost allocations, see Lost Allocations
+ chapter of User Guide on Main Page.
+
+ You should not use this flag together with #VMA_ALLOCATION_CREATE_MAPPED_BIT.
+ */
+ VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT = 0x00000008,
+ /** While creating allocation using this flag, other allocations that were
+ created with flag #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT can become lost.
+
+ For details about supporting lost allocations, see Lost Allocations
+ chapter of User Guide on Main Page.
+ */
+ VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT = 0x00000010,
+ /** Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a
+ null-terminated string. Instead of copying pointer value, a local copy of the
+ string is made and stored in allocation's `pUserData`. The string is automatically
+ freed together with the allocation. It is also used in vmaBuildStatsString().
+ */
+ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT = 0x00000020,
+ /** Allocation will be created from upper stack in a double stack pool.
+
+ This flag is only allowed for custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT flag.
+ */
+ VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = 0x00000040,
+
+ /** Allocation strategy that chooses smallest possible free range for the
+ allocation.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT = 0x00010000,
+ /** Allocation strategy that chooses biggest possible free range for the
+ allocation.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT = 0x00020000,
+ /** Allocation strategy that chooses first suitable free range for the
+ allocation.
+
+ "First" doesn't necessarily means the one with smallest offset in memory,
+ but rather the one that is easiest and fastest to find.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT = 0x00040000,
+
+ /** Allocation strategy that tries to minimize memory usage.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT,
+ /** Allocation strategy that tries to minimize allocation time.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT = VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
+ /** Allocation strategy that tries to minimize memory fragmentation.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT = VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT,
+
+ /** A bit mask to extract only `STRATEGY` bits from entire set of flags.
+ */
+ VMA_ALLOCATION_CREATE_STRATEGY_MASK =
+ VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT |
+ VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT |
+ VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT,
+
+ VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaAllocationCreateFlagBits;
+typedef VkFlags VmaAllocationCreateFlags;
+
+typedef struct VmaAllocationCreateInfo
+{
+ /// Use #VmaAllocationCreateFlagBits enum.
+ VmaAllocationCreateFlags flags;
+ /** \brief Intended usage of memory.
+
+ You can leave #VMA_MEMORY_USAGE_UNKNOWN if you specify memory requirements in other way. \n
+ If `pool` is not null, this member is ignored.
+ */
+ VmaMemoryUsage usage;
+ /** \brief Flags that must be set in a Memory Type chosen for an allocation.
+
+ Leave 0 if you specify memory requirements in other way. \n
+ If `pool` is not null, this member is ignored.*/
+ VkMemoryPropertyFlags requiredFlags;
+ /** \brief Flags that preferably should be set in a memory type chosen for an allocation.
+
+ Set to 0 if no additional flags are prefered. \n
+ If `pool` is not null, this member is ignored. */
+ VkMemoryPropertyFlags preferredFlags;
+ /** \brief Bitmask containing one bit set for every memory type acceptable for this allocation.
+
+ Value 0 is equivalent to `UINT32_MAX` - it means any memory type is accepted if
+ it meets other requirements specified by this structure, with no further
+ restrictions on memory type index. \n
+ If `pool` is not null, this member is ignored.
+ */
+ uint32_t memoryTypeBits;
+ /** \brief Pool that this allocation should be created in.
+
+ Leave `VK_NULL_HANDLE` to allocate from default pool. If not null, members:
+ `usage`, `requiredFlags`, `preferredFlags`, `memoryTypeBits` are ignored.
+ */
+ VmaPool pool;
+ /** \brief Custom general-purpose pointer that will be stored in #VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().
+
+ If #VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is used, it must be either
+ null or pointer to a null-terminated string. The string will be then copied to
+ internal buffer, so it doesn't need to be valid after allocation call.
+ */
+ void* pUserData;
+} VmaAllocationCreateInfo;
+
+/**
+\brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
+
+This algorithm tries to find a memory type that:
+
+- Is allowed by memoryTypeBits.
+- Contains all the flags from pAllocationCreateInfo->requiredFlags.
+- Matches intended usage.
+- Has as many flags from pAllocationCreateInfo->preferredFlags as possible.
+
+\return Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result
+from this function or any other allocating function probably means that your
+device doesn't support any memory type with requested features for the specific
+type of resource you want to use it for. Please check parameters of your
+resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
+*/
+VkResult vmaFindMemoryTypeIndex(
+ VmaAllocator allocator,
+ uint32_t memoryTypeBits,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ uint32_t* pMemoryTypeIndex);
+
+/**
+\brief Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
+
+It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
+It internally creates a temporary, dummy buffer that never has memory bound.
+It is just a convenience function, equivalent to calling:
+
+- `vkCreateBuffer`
+- `vkGetBufferMemoryRequirements`
+- `vmaFindMemoryTypeIndex`
+- `vkDestroyBuffer`
+*/
+VkResult vmaFindMemoryTypeIndexForBufferInfo(
+ VmaAllocator allocator,
+ const VkBufferCreateInfo* pBufferCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ uint32_t* pMemoryTypeIndex);
+
+/**
+\brief Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
+
+It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex.
+It internally creates a temporary, dummy image that never has memory bound.
+It is just a convenience function, equivalent to calling:
+
+- `vkCreateImage`
+- `vkGetImageMemoryRequirements`
+- `vmaFindMemoryTypeIndex`
+- `vkDestroyImage`
+*/
+VkResult vmaFindMemoryTypeIndexForImageInfo(
+ VmaAllocator allocator,
+ const VkImageCreateInfo* pImageCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ uint32_t* pMemoryTypeIndex);
+
+/// Flags to be passed as VmaPoolCreateInfo::flags.
+typedef enum VmaPoolCreateFlagBits {
+ /** \brief Use this flag if you always allocate only buffers and linear images or only optimal images out of this pool and so Buffer-Image Granularity can be ignored.
+
+ This is an optional optimization flag.
+
+ If you always allocate using vmaCreateBuffer(), vmaCreateImage(),
+ vmaAllocateMemoryForBuffer(), then you don't need to use it because allocator
+ knows exact type of your allocations so it can handle Buffer-Image Granularity
+ in the optimal way.
+
+ If you also allocate using vmaAllocateMemoryForImage() or vmaAllocateMemory(),
+ exact type of such allocations is not known, so allocator must be conservative
+ in handling Buffer-Image Granularity, which can lead to suboptimal allocation
+ (wasted memory). In that case, if you can make sure you always allocate only
+ buffers and linear images or only optimal images out of this pool, use this flag
+ to make allocator disregard Buffer-Image Granularity and so make allocations
+ faster and more optimal.
+ */
+ VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002,
+
+ /** \brief Enables alternative, linear allocation algorithm in this pool.
+
+ Specify this flag to enable linear allocation algorithm, which always creates
+ new allocations after last one and doesn't reuse space from allocations freed in
+ between. It trades memory consumption for simplified algorithm and data
+ structure, which has better performance and uses less memory for metadata.
+
+ By using this flag, you can achieve behavior of free-at-once, stack,
+ ring buffer, and double stack. For details, see documentation chapter
+ \ref linear_algorithm.
+
+ When using this flag, you must specify VmaPoolCreateInfo::maxBlockCount == 1 (or 0 for default).
+
+ For more details, see [Linear allocation algorithm](@ref linear_algorithm).
+ */
+ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004,
+
+ /** \brief Enables alternative, buddy allocation algorithm in this pool.
+
+ It operates on a tree of blocks, each having size that is a power of two and
+ a half of its parent's size. Comparing to default algorithm, this one provides
+ faster allocation and deallocation and decreased external fragmentation,
+ at the expense of more memory wasted (internal fragmentation).
+
+ For more details, see [Buddy allocation algorithm](@ref buddy_algorithm).
+ */
+ VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT = 0x00000008,
+
+ /** Bit mask to extract only `ALGORITHM` bits from entire set of flags.
+ */
+ VMA_POOL_CREATE_ALGORITHM_MASK =
+ VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT |
+ VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT,
+
+ VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaPoolCreateFlagBits;
+typedef VkFlags VmaPoolCreateFlags;
+
+/** \brief Describes parameter of created #VmaPool.
+*/
+typedef struct VmaPoolCreateInfo {
+ /** \brief Vulkan memory type index to allocate this pool from.
+ */
+ uint32_t memoryTypeIndex;
+ /** \brief Use combination of #VmaPoolCreateFlagBits.
+ */
+ VmaPoolCreateFlags flags;
+ /** \brief Size of a single `VkDeviceMemory` block to be allocated as part of this pool, in bytes. Optional.
+
+ Specify nonzero to set explicit, constant size of memory blocks used by this
+ pool.
+
+ Leave 0 to use default and let the library manage block sizes automatically.
+ Sizes of particular blocks may vary.
+ */
+ VkDeviceSize blockSize;
+ /** \brief Minimum number of blocks to be always allocated in this pool, even if they stay empty.
+
+ Set to 0 to have no preallocated blocks and allow the pool be completely empty.
+ */
+ size_t minBlockCount;
+ /** \brief Maximum number of blocks that can be allocated in this pool. Optional.
+
+ Set to 0 to use default, which is `SIZE_MAX`, which means no limit.
+
+ Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated
+ throughout whole lifetime of this pool.
+ */
+ size_t maxBlockCount;
+ /** \brief Maximum number of additional frames that are in use at the same time as current frame.
+
+ This value is used only when you make allocations with
+ #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocation cannot become
+ lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount.
+
+ For example, if you double-buffer your command buffers, so resources used for
+ rendering in previous frame may still be in use by the GPU at the moment you
+ allocate resources needed for the current frame, set this value to 1.
+
+ If you want to allow any allocations other than used in the current frame to
+ become lost, set this value to 0.
+ */
+ uint32_t frameInUseCount;
+} VmaPoolCreateInfo;
+
+/** \brief Describes parameter of existing #VmaPool.
+*/
+typedef struct VmaPoolStats {
+ /** \brief Total amount of `VkDeviceMemory` allocated from Vulkan for this pool, in bytes.
+ */
+ VkDeviceSize size;
+ /** \brief Total number of bytes in the pool not used by any #VmaAllocation.
+ */
+ VkDeviceSize unusedSize;
+ /** \brief Number of #VmaAllocation objects created from this pool that were not destroyed or lost.
+ */
+ size_t allocationCount;
+ /** \brief Number of continuous memory ranges in the pool not used by any #VmaAllocation.
+ */
+ size_t unusedRangeCount;
+ /** \brief Size of the largest continuous free memory region available for new allocation.
+
+ Making a new allocation of that size is not guaranteed to succeed because of
+ possible additional margin required to respect alignment and buffer/image
+ granularity.
+ */
+ VkDeviceSize unusedRangeSizeMax;
+ /** \brief Number of `VkDeviceMemory` blocks allocated for this pool.
+ */
+ size_t blockCount;
+} VmaPoolStats;
+
+/** \brief Allocates Vulkan device memory and creates #VmaPool object.
+
+@param allocator Allocator object.
+@param pCreateInfo Parameters of pool to create.
+@param[out] pPool Handle to created pool.
+*/
+VkResult vmaCreatePool(
+ VmaAllocator allocator,
+ const VmaPoolCreateInfo* pCreateInfo,
+ VmaPool* pPool);
+
+/** \brief Destroys #VmaPool object and frees Vulkan device memory.
+*/
+void vmaDestroyPool(
+ VmaAllocator allocator,
+ VmaPool pool);
+
+/** \brief Retrieves statistics of existing #VmaPool object.
+
+@param allocator Allocator object.
+@param pool Pool object.
+@param[out] pPoolStats Statistics of specified pool.
+*/
+void vmaGetPoolStats(
+ VmaAllocator allocator,
+ VmaPool pool,
+ VmaPoolStats* pPoolStats);
+
+/** \brief Marks all allocations in given pool as lost if they are not used in current frame or VmaPoolCreateInfo::frameInUseCount back from now.
+
+@param allocator Allocator object.
+@param pool Pool.
+@param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information.
+*/
+void vmaMakePoolAllocationsLost(
+ VmaAllocator allocator,
+ VmaPool pool,
+ size_t* pLostAllocationCount);
+
+/** \brief Checks magic number in margins around all allocations in given memory pool in search for corruptions.
+
+Corruption detection is enabled only when `VMA_DEBUG_DETECT_CORRUPTION` macro is defined to nonzero,
+`VMA_DEBUG_MARGIN` is defined to nonzero and the pool is created in memory type that is
+`HOST_VISIBLE` and `HOST_COHERENT`. For more information, see [Corruption detection](@ref debugging_memory_usage_corruption_detection).
+
+Possible return values:
+
+- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for specified pool.
+- `VK_SUCCESS` - corruption detection has been performed and succeeded.
+- `VK_ERROR_VALIDATION_FAILED_EXT` - corruption detection has been performed and found memory corruptions around one of the allocations.
+ `VMA_ASSERT` is also fired in that case.
+- Other value: Error returned by Vulkan, e.g. memory mapping failure.
+*/
+VkResult vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool);
+
+/** \struct VmaAllocation
+\brief Represents single memory allocation.
+
+It may be either dedicated block of `VkDeviceMemory` or a specific region of a bigger block of this type
+plus unique offset.
+
+There are multiple ways to create such object.
+You need to fill structure VmaAllocationCreateInfo.
+For more information see [Choosing memory type](@ref choosing_memory_type).
+
+Although the library provides convenience functions that create Vulkan buffer or image,
+allocate memory for it and bind them together,
+binding of the allocation to a buffer or an image is out of scope of the allocation itself.
+Allocation object can exist without buffer/image bound,
+binding can be done manually by the user, and destruction of it can be done
+independently of destruction of the allocation.
+
+The object also remembers its size and some other information.
+To retrieve this information, use function vmaGetAllocationInfo() and inspect
+returned structure VmaAllocationInfo.
+
+Some kinds allocations can be in lost state.
+For more information, see [Lost allocations](@ref lost_allocations).
+*/
+VK_DEFINE_HANDLE(VmaAllocation)
+
+/** \brief Parameters of #VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().
+*/
+typedef struct VmaAllocationInfo {
+ /** \brief Memory type index that this allocation was allocated from.
+
+ It never changes.
+ */
+ uint32_t memoryType;
+ /** \brief Handle to Vulkan memory object.
+
+ Same memory object can be shared by multiple allocations.
+
+ It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost.
+
+ If the allocation is lost, it is equal to `VK_NULL_HANDLE`.
+ */
+ VkDeviceMemory deviceMemory;
+ /** \brief Offset into deviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
+
+ It can change after call to vmaDefragment() if this allocation is passed to the function, or if allocation is lost.
+ */
+ VkDeviceSize offset;
+ /** \brief Size of this allocation, in bytes.
+
+ It never changes, unless allocation is lost.
+ */
+ VkDeviceSize size;
+ /** \brief Pointer to the beginning of this allocation as mapped data.
+
+ If the allocation hasn't been mapped using vmaMapMemory() and hasn't been
+ created with #VMA_ALLOCATION_CREATE_MAPPED_BIT flag, this value null.
+
+ It can change after call to vmaMapMemory(), vmaUnmapMemory().
+ It can also change after call to vmaDefragment() if this allocation is passed to the function.
+ */
+ void* pMappedData;
+ /** \brief Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().
+
+ It can change after call to vmaSetAllocationUserData() for this allocation.
+ */
+ void* pUserData;
+} VmaAllocationInfo;
+
+/** \brief General purpose memory allocation.
+
+@param[out] pAllocation Handle to allocated memory.
+@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
+
+You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().
+
+It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(),
+vmaCreateBuffer(), vmaCreateImage() instead whenever possible.
+*/
+VkResult vmaAllocateMemory(
+ VmaAllocator allocator,
+ const VkMemoryRequirements* pVkMemoryRequirements,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo);
+
+/** \brief General purpose memory allocation for multiple allocation objects at once.
+
+@param allocator Allocator object.
+@param pVkMemoryRequirements Memory requirements for each allocation.
+@param pCreateInfo Creation parameters for each alloction.
+@param allocationCount Number of allocations to make.
+@param[out] pAllocations Pointer to array that will be filled with handles to created allocations.
+@param[out] pAllocationInfo Optional. Pointer to array that will be filled with parameters of created allocations.
+
+You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().
+
+Word "pages" is just a suggestion to use this function to allocate pieces of memory needed for sparse binding.
+It is just a general purpose allocation function able to make multiple allocations at once.
+It may be internally optimized to be more efficient than calling vmaAllocateMemory() `allocationCount` times.
+
+All allocations are made using same parameters. All of them are created out of the same memory pool and type.
+If any allocation fails, all allocations already made within this function call are also freed, so that when
+returned result is not `VK_SUCCESS`, `pAllocation` array is always entirely filled with `VK_NULL_HANDLE`.
+*/
+VkResult vmaAllocateMemoryPages(
+ VmaAllocator allocator,
+ const VkMemoryRequirements* pVkMemoryRequirements,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ size_t allocationCount,
+ VmaAllocation* pAllocations,
+ VmaAllocationInfo* pAllocationInfo);
+
+/**
+@param[out] pAllocation Handle to allocated memory.
+@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
+
+You should free the memory using vmaFreeMemory().
+*/
+VkResult vmaAllocateMemoryForBuffer(
+ VmaAllocator allocator,
+ VkBuffer buffer,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo);
+
+/// Function similar to vmaAllocateMemoryForBuffer().
+VkResult vmaAllocateMemoryForImage(
+ VmaAllocator allocator,
+ VkImage image,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo);
+
+/** \brief Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
+
+Passing `VK_NULL_HANDLE` as `allocation` is valid. Such function call is just skipped.
+*/
+void vmaFreeMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation);
+
+/** \brief Frees memory and destroys multiple allocations.
+
+Word "pages" is just a suggestion to use this function to free pieces of memory used for sparse binding.
+It is just a general purpose function to free memory and destroy allocations made using e.g. vmaAllocateMemory(),
+vmaAllocateMemoryPages() and other functions.
+It may be internally optimized to be more efficient than calling vmaFreeMemory() `allocationCount` times.
+
+Allocations in `pAllocations` array can come from any memory pools and types.
+Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entries are just skipped.
+*/
+void vmaFreeMemoryPages(
+ VmaAllocator allocator,
+ size_t allocationCount,
+ VmaAllocation* pAllocations);
+
+/** \brief Tries to resize an allocation in place, if there is enough free memory after it.
+
+Tries to change allocation's size without moving or reallocating it.
+You can both shrink and grow allocation size.
+When growing, it succeeds only when the allocation belongs to a memory block with enough
+free space after it.
+
+Returns `VK_SUCCESS` if allocation's size has been successfully changed.
+Returns `VK_ERROR_OUT_OF_POOL_MEMORY` if allocation's size could not be changed.
+
+After successful call to this function, VmaAllocationInfo::size of this allocation changes.
+All other parameters stay the same: memory pool and type, alignment, offset, mapped pointer.
+
+- Calling this function on allocation that is in lost state fails with result `VK_ERROR_VALIDATION_FAILED_EXT`.
+- Calling this function with `newSize` same as current allocation size does nothing and returns `VK_SUCCESS`.
+- Resizing dedicated allocations, as well as allocations created in pools that use linear
+ or buddy algorithm, is not supported.
+ The function returns `VK_ERROR_FEATURE_NOT_PRESENT` in such cases.
+ Support may be added in the future.
+*/
+VkResult vmaResizeAllocation(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VkDeviceSize newSize);
+
+/** \brief Returns current information about specified allocation and atomically marks it as used in current frame.
+
+Current paramters of given allocation are returned in `pAllocationInfo`.
+
+This function also atomically "touches" allocation - marks it as used in current frame,
+just like vmaTouchAllocation().
+If the allocation is in lost state, `pAllocationInfo->deviceMemory == VK_NULL_HANDLE`.
+
+Although this function uses atomics and doesn't lock any mutex, so it should be quite efficient,
+you can avoid calling it too often.
+
+- You can retrieve same VmaAllocationInfo structure while creating your resource, from function
+ vmaCreateBuffer(), vmaCreateImage(). You can remember it if you are sure parameters don't change
+ (e.g. due to defragmentation or allocation becoming lost).
+- If you just want to check if allocation is not lost, vmaTouchAllocation() will work faster.
+*/
+void vmaGetAllocationInfo(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VmaAllocationInfo* pAllocationInfo);
+
+/** \brief Returns `VK_TRUE` if allocation is not lost and atomically marks it as used in current frame.
+
+If the allocation has been created with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag,
+this function returns `VK_TRUE` if it's not in lost state, so it can still be used.
+It then also atomically "touches" the allocation - marks it as used in current frame,
+so that you can be sure it won't become lost in current frame or next `frameInUseCount` frames.
+
+If the allocation is in lost state, the function returns `VK_FALSE`.
+Memory of such allocation, as well as buffer or image bound to it, should not be used.
+Lost allocation and the buffer/image still need to be destroyed.
+
+If the allocation has been created without #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag,
+this function always returns `VK_TRUE`.
+*/
+VkBool32 vmaTouchAllocation(
+ VmaAllocator allocator,
+ VmaAllocation allocation);
+
+/** \brief Sets pUserData in given allocation to new value.
+
+If the allocation was created with VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT,
+pUserData must be either null, or pointer to a null-terminated string. The function
+makes local copy of the string and sets it as allocation's `pUserData`. String
+passed as pUserData doesn't need to be valid for whole lifetime of the allocation -
+you can free it after this call. String previously pointed by allocation's
+pUserData is freed from memory.
+
+If the flag was not used, the value of pointer `pUserData` is just copied to
+allocation's `pUserData`. It is opaque, so you can use it however you want - e.g.
+as a pointer, ordinal number or some handle to you own data.
+*/
+void vmaSetAllocationUserData(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ void* pUserData);
+
+/** \brief Creates new allocation that is in lost state from the beginning.
+
+It can be useful if you need a dummy, non-null allocation.
+
+You still need to destroy created object using vmaFreeMemory().
+
+Returned allocation is not tied to any specific memory pool or memory type and
+not bound to any image or buffer. It has size = 0. It cannot be turned into
+a real, non-empty allocation.
+*/
+void vmaCreateLostAllocation(
+ VmaAllocator allocator,
+ VmaAllocation* pAllocation);
+
+/** \brief Maps memory represented by given allocation and returns pointer to it.
+
+Maps memory represented by given allocation to make it accessible to CPU code.
+When succeeded, `*ppData` contains pointer to first byte of this memory.
+If the allocation is part of bigger `VkDeviceMemory` block, the pointer is
+correctly offseted to the beginning of region assigned to this particular
+allocation.
+
+Mapping is internally reference-counted and synchronized, so despite raw Vulkan
+function `vkMapMemory()` cannot be used to map same block of `VkDeviceMemory`
+multiple times simultaneously, it is safe to call this function on allocations
+assigned to the same memory block. Actual Vulkan memory will be mapped on first
+mapping and unmapped on last unmapping.
+
+If the function succeeded, you must call vmaUnmapMemory() to unmap the
+allocation when mapping is no longer needed or before freeing the allocation, at
+the latest.
+
+It also safe to call this function multiple times on the same allocation. You
+must call vmaUnmapMemory() same number of times as you called vmaMapMemory().
+
+It is also safe to call this function on allocation created with
+#VMA_ALLOCATION_CREATE_MAPPED_BIT flag. Its memory stays mapped all the time.
+You must still call vmaUnmapMemory() same number of times as you called
+vmaMapMemory(). You must not call vmaUnmapMemory() additional time to free the
+"0-th" mapping made automatically due to #VMA_ALLOCATION_CREATE_MAPPED_BIT flag.
+
+This function fails when used on allocation made in memory type that is not
+`HOST_VISIBLE`.
+
+This function always fails when called for allocation that was created with
+#VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocations cannot be
+mapped.
+*/
+VkResult vmaMapMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ void** ppData);
+
+/** \brief Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
+
+For details, see description of vmaMapMemory().
+*/
+void vmaUnmapMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation);
+
+/** \brief Flushes memory of given allocation.
+
+Calls `vkFlushMappedMemoryRanges()` for memory associated with given range of given allocation.
+
+- `offset` must be relative to the beginning of allocation.
+- `size` can be `VK_WHOLE_SIZE`. It means all memory from `offset` the the end of given allocation.
+- `offset` and `size` don't have to be aligned.
+ They are internally rounded down/up to multiply of `nonCoherentAtomSize`.
+- If `size` is 0, this call is ignored.
+- If memory type that the `allocation` belongs to is not `HOST_VISIBLE` or it is `HOST_COHERENT`,
+ this call is ignored.
+*/
+void vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
+
+/** \brief Invalidates memory of given allocation.
+
+Calls `vkInvalidateMappedMemoryRanges()` for memory associated with given range of given allocation.
+
+- `offset` must be relative to the beginning of allocation.
+- `size` can be `VK_WHOLE_SIZE`. It means all memory from `offset` the the end of given allocation.
+- `offset` and `size` don't have to be aligned.
+ They are internally rounded down/up to multiply of `nonCoherentAtomSize`.
+- If `size` is 0, this call is ignored.
+- If memory type that the `allocation` belongs to is not `HOST_VISIBLE` or it is `HOST_COHERENT`,
+ this call is ignored.
+*/
+void vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
+
+/** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
+
+@param memoryTypeBits Bit mask, where each bit set means that a memory type with that index should be checked.
+
+Corruption detection is enabled only when `VMA_DEBUG_DETECT_CORRUPTION` macro is defined to nonzero,
+`VMA_DEBUG_MARGIN` is defined to nonzero and only for memory types that are
+`HOST_VISIBLE` and `HOST_COHERENT`. For more information, see [Corruption detection](@ref debugging_memory_usage_corruption_detection).
+
+Possible return values:
+
+- `VK_ERROR_FEATURE_NOT_PRESENT` - corruption detection is not enabled for any of specified memory types.
+- `VK_SUCCESS` - corruption detection has been performed and succeeded.
+- `VK_ERROR_VALIDATION_FAILED_EXT` - corruption detection has been performed and found memory corruptions around one of the allocations.
+ `VMA_ASSERT` is also fired in that case.
+- Other value: Error returned by Vulkan, e.g. memory mapping failure.
+*/
+VkResult vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits);
+
+/** \struct VmaDefragmentationContext
+\brief Represents Opaque object that represents started defragmentation process.
+
+Fill structure #VmaDefragmentationInfo2 and call function vmaDefragmentationBegin() to create it.
+Call function vmaDefragmentationEnd() to destroy it.
+*/
+VK_DEFINE_HANDLE(VmaDefragmentationContext)
+
+/// Flags to be used in vmaDefragmentationBegin(). None at the moment. Reserved for future use.
+typedef enum VmaDefragmentationFlagBits {
+ VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VmaDefragmentationFlagBits;
+typedef VkFlags VmaDefragmentationFlags;
+
+/** \brief Parameters for defragmentation.
+
+To be used with function vmaDefragmentationBegin().
+*/
+typedef struct VmaDefragmentationInfo2 {
+ /** \brief Reserved for future use. Should be 0.
+ */
+ VmaDefragmentationFlags flags;
+ /** \brief Number of allocations in `pAllocations` array.
+ */
+ uint32_t allocationCount;
+ /** \brief Pointer to array of allocations that can be defragmented.
+
+ The array should have `allocationCount` elements.
+ The array should not contain nulls.
+ Elements in the array should be unique - same allocation cannot occur twice.
+ It is safe to pass allocations that are in the lost state - they are ignored.
+ All allocations not present in this array are considered non-moveable during this defragmentation.
+ */
+ VmaAllocation* pAllocations;
+ /** \brief Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation.
+
+ The array should have `allocationCount` elements.
+ You can pass null if you are not interested in this information.
+ */
+ VkBool32* pAllocationsChanged;
+ /** \brief Numer of pools in `pPools` array.
+ */
+ uint32_t poolCount;
+ /** \brief Either null or pointer to array of pools to be defragmented.
+
+ All the allocations in the specified pools can be moved during defragmentation
+ and there is no way to check if they were really moved as in `pAllocationsChanged`,
+ so you must query all the allocations in all these pools for new `VkDeviceMemory`
+ and offset using vmaGetAllocationInfo() if you might need to recreate buffers
+ and images bound to them.
+
+ The array should have `poolCount` elements.
+ The array should not contain nulls.
+ Elements in the array should be unique - same pool cannot occur twice.
+
+ Using this array is equivalent to specifying all allocations from the pools in `pAllocations`.
+ It might be more efficient.
+ */
+ VmaPool* pPools;
+ /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like `memcpy()`, `memmove()`.
+
+ `VK_WHOLE_SIZE` means no limit.
+ */
+ VkDeviceSize maxCpuBytesToMove;
+ /** \brief Maximum number of allocations that can be moved to a different place using transfers on CPU side, like `memcpy()`, `memmove()`.
+
+ `UINT32_MAX` means no limit.
+ */
+ uint32_t maxCpuAllocationsToMove;
+ /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to `commandBuffer`.
+
+ `VK_WHOLE_SIZE` means no limit.
+ */
+ VkDeviceSize maxGpuBytesToMove;
+ /** \brief Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to `commandBuffer`.
+
+ `UINT32_MAX` means no limit.
+ */
+ uint32_t maxGpuAllocationsToMove;
+ /** \brief Optional. Command buffer where GPU copy commands will be posted.
+
+ If not null, it must be a valid command buffer handle that supports Transfer queue type.
+ It must be in the recording state and outside of a render pass instance.
+ You need to submit it and make sure it finished execution before calling vmaDefragmentationEnd().
+
+ Passing null means that only CPU defragmentation will be performed.
+ */
+ VkCommandBuffer commandBuffer;
+} VmaDefragmentationInfo2;
+
+/** \brief Deprecated. Optional configuration parameters to be passed to function vmaDefragment().
+
+\deprecated This is a part of the old interface. It is recommended to use structure #VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
+*/
+typedef struct VmaDefragmentationInfo {
+ /** \brief Maximum total numbers of bytes that can be copied while moving allocations to different places.
+
+ Default is `VK_WHOLE_SIZE`, which means no limit.
+ */
+ VkDeviceSize maxBytesToMove;
+ /** \brief Maximum number of allocations that can be moved to different place.
+
+ Default is `UINT32_MAX`, which means no limit.
+ */
+ uint32_t maxAllocationsToMove;
+} VmaDefragmentationInfo;
+
+/** \brief Statistics returned by function vmaDefragment(). */
+typedef struct VmaDefragmentationStats {
+ /// Total number of bytes that have been copied while moving allocations to different places.
+ VkDeviceSize bytesMoved;
+ /// Total number of bytes that have been released to the system by freeing empty `VkDeviceMemory` objects.
+ VkDeviceSize bytesFreed;
+ /// Number of allocations that have been moved to different places.
+ uint32_t allocationsMoved;
+ /// Number of empty `VkDeviceMemory` objects that have been released to the system.
+ uint32_t deviceMemoryBlocksFreed;
+} VmaDefragmentationStats;
+
+/** \brief Begins defragmentation process.
+
+@param allocator Allocator object.
+@param pInfo Structure filled with parameters of defragmentation.
+@param[out] pStats Optional. Statistics of defragmentation. You can pass null if you are not interested in this information.
+@param[out] pContext Context object that must be passed to vmaDefragmentationEnd() to finish defragmentation.
+@return `VK_SUCCESS` and `*pContext == null` if defragmentation finished within this function call. `VK_NOT_READY` and `*pContext != null` if defragmentation has been started and you need to call vmaDefragmentationEnd() to finish it. Negative value in case of error.
+
+Use this function instead of old, deprecated vmaDefragment().
+
+Warning! Between the call to vmaDefragmentationBegin() and vmaDefragmentationEnd():
+
+- You should not use any of allocations passed as `pInfo->pAllocations` or
+ any allocations that belong to pools passed as `pInfo->pPools`,
+ including calling vmaGetAllocationInfo(), vmaTouchAllocation(), or access
+ their data.
+- Some mutexes protecting internal data structures may be locked, so trying to
+ make or free any allocations, bind buffers or images, map memory, or launch
+ another simultaneous defragmentation in between may cause stall (when done on
+ another thread) or deadlock (when done on the same thread), unless you are
+ 100% sure that defragmented allocations are in different pools.
+- Information returned via `pStats` and `pInfo->pAllocationsChanged` are undefined.
+ They become valid after call to vmaDefragmentationEnd().
+- If `pInfo->commandBuffer` is not null, you must submit that command buffer
+ and make sure it finished execution before calling vmaDefragmentationEnd().
+*/
+VkResult vmaDefragmentationBegin(
+ VmaAllocator allocator,
+ const VmaDefragmentationInfo2* pInfo,
+ VmaDefragmentationStats* pStats,
+ VmaDefragmentationContext *pContext);
+
+/** \brief Ends defragmentation process.
+
+Use this function to finish defragmentation started by vmaDefragmentationBegin().
+It is safe to pass `context == null`. The function then does nothing.
+*/
+VkResult vmaDefragmentationEnd(
+ VmaAllocator allocator,
+ VmaDefragmentationContext context);
+
+/** \brief Deprecated. Compacts memory by moving allocations.
+
+@param pAllocations Array of allocations that can be moved during this compation.
+@param allocationCount Number of elements in pAllocations and pAllocationsChanged arrays.
+@param[out] pAllocationsChanged Array of boolean values that will indicate whether matching allocation in pAllocations array has been moved. This parameter is optional. Pass null if you don't need this information.
+@param pDefragmentationInfo Configuration parameters. Optional - pass null to use default values.
+@param[out] pDefragmentationStats Statistics returned by the function. Optional - pass null if you don't need this information.
+@return `VK_SUCCESS` if completed, negative error code in case of error.
+
+\deprecated This is a part of the old interface. It is recommended to use structure #VmaDefragmentationInfo2 and function vmaDefragmentationBegin() instead.
+
+This function works by moving allocations to different places (different
+`VkDeviceMemory` objects and/or different offsets) in order to optimize memory
+usage. Only allocations that are in `pAllocations` array can be moved. All other
+allocations are considered nonmovable in this call. Basic rules:
+
+- Only allocations made in memory types that have
+ `VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT` and `VK_MEMORY_PROPERTY_HOST_COHERENT_BIT`
+ flags can be compacted. You may pass other allocations but it makes no sense -
+ these will never be moved.
+- Custom pools created with #VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT or
+ #VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT flag are not defragmented. Allocations
+ passed to this function that come from such pools are ignored.
+- Allocations created with #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT or
+ created as dedicated allocations for any other reason are also ignored.
+- Both allocations made with or without #VMA_ALLOCATION_CREATE_MAPPED_BIT
+ flag can be compacted. If not persistently mapped, memory will be mapped
+ temporarily inside this function if needed.
+- You must not pass same #VmaAllocation object multiple times in `pAllocations` array.
+
+The function also frees empty `VkDeviceMemory` blocks.
+
+Warning: This function may be time-consuming, so you shouldn't call it too often
+(like after every resource creation/destruction).
+You can call it on special occasions (like when reloading a game level or
+when you just destroyed a lot of objects). Calling it every frame may be OK, but
+you should measure that on your platform.
+
+For more information, see [Defragmentation](@ref defragmentation) chapter.
+*/
+VkResult vmaDefragment(
+ VmaAllocator allocator,
+ VmaAllocation* pAllocations,
+ size_t allocationCount,
+ VkBool32* pAllocationsChanged,
+ const VmaDefragmentationInfo *pDefragmentationInfo,
+ VmaDefragmentationStats* pDefragmentationStats);
+
+/** \brief Binds buffer to allocation.
+
+Binds specified buffer to region of memory represented by specified allocation.
+Gets `VkDeviceMemory` handle and offset from the allocation.
+If you want to create a buffer, allocate memory for it and bind them together separately,
+you should use this function for binding instead of standard `vkBindBufferMemory()`,
+because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple
+allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously
+(which is illegal in Vulkan).
+
+It is recommended to use function vmaCreateBuffer() instead of this one.
+*/
+VkResult vmaBindBufferMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VkBuffer buffer);
+
+/** \brief Binds image to allocation.
+
+Binds specified image to region of memory represented by specified allocation.
+Gets `VkDeviceMemory` handle and offset from the allocation.
+If you want to create an image, allocate memory for it and bind them together separately,
+you should use this function for binding instead of standard `vkBindImageMemory()`,
+because it ensures proper synchronization so that when a `VkDeviceMemory` object is used by multiple
+allocations, calls to `vkBind*Memory()` or `vkMapMemory()` won't happen from multiple threads simultaneously
+(which is illegal in Vulkan).
+
+It is recommended to use function vmaCreateImage() instead of this one.
+*/
+VkResult vmaBindImageMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VkImage image);
+
+/**
+@param[out] pBuffer Buffer that was created.
+@param[out] pAllocation Allocation that was created.
+@param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
+
+This function automatically:
+
+-# Creates buffer.
+-# Allocates appropriate memory for it.
+-# Binds the buffer with the memory.
+
+If any of these operations fail, buffer and allocation are not created,
+returned value is negative error code, *pBuffer and *pAllocation are null.
+
+If the function succeeded, you must destroy both buffer and allocation when you
+no longer need them using either convenience function vmaDestroyBuffer() or
+separately, using `vkDestroyBuffer()` and vmaFreeMemory().
+
+If VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used,
+VK_KHR_dedicated_allocation extension is used internally to query driver whether
+it requires or prefers the new buffer to have dedicated allocation. If yes,
+and if dedicated allocation is possible (VmaAllocationCreateInfo::pool is null
+and VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated
+allocation for this buffer, just like when using
+VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
+*/
+VkResult vmaCreateBuffer(
+ VmaAllocator allocator,
+ const VkBufferCreateInfo* pBufferCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ VkBuffer* pBuffer,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo);
+
+/** \brief Destroys Vulkan buffer and frees allocated memory.
+
+This is just a convenience function equivalent to:
+
+\code
+vkDestroyBuffer(device, buffer, allocationCallbacks);
+vmaFreeMemory(allocator, allocation);
+\endcode
+
+It it safe to pass null as buffer and/or allocation.
+*/
+void vmaDestroyBuffer(
+ VmaAllocator allocator,
+ VkBuffer buffer,
+ VmaAllocation allocation);
+
+/// Function similar to vmaCreateBuffer().
+VkResult vmaCreateImage(
+ VmaAllocator allocator,
+ const VkImageCreateInfo* pImageCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ VkImage* pImage,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo);
+
+/** \brief Destroys Vulkan image and frees allocated memory.
+
+This is just a convenience function equivalent to:
+
+\code
+vkDestroyImage(device, image, allocationCallbacks);
+vmaFreeMemory(allocator, allocation);
+\endcode
+
+It it safe to pass null as image and/or allocation.
+*/
+void vmaDestroyImage(
+ VmaAllocator allocator,
+ VkImage image,
+ VmaAllocation allocation);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // AMD_VULKAN_MEMORY_ALLOCATOR_H
+
+// For Visual Studio IntelliSense.
+#if defined(__cplusplus) && defined(__INTELLISENSE__)
+#define VMA_IMPLEMENTATION
+#endif
+
+#ifdef VMA_IMPLEMENTATION
+#undef VMA_IMPLEMENTATION
+
+#include <cstdint>
+#include <cstdlib>
+#include <cstring>
+
+/*******************************************************************************
+CONFIGURATION SECTION
+
+Define some of these macros before each #include of this header or change them
+here if you need other then default behavior depending on your environment.
+*/
+
+/*
+Define this macro to 1 to make the library fetch pointers to Vulkan functions
+internally, like:
+
+ vulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
+
+Define to 0 if you are going to provide you own pointers to Vulkan functions via
+VmaAllocatorCreateInfo::pVulkanFunctions.
+*/
+#if !defined(VMA_STATIC_VULKAN_FUNCTIONS) && !defined(VK_NO_PROTOTYPES)
+#define VMA_STATIC_VULKAN_FUNCTIONS 1
+#endif
+
+// Define this macro to 1 to make the library use STL containers instead of its own implementation.
+//#define VMA_USE_STL_CONTAINERS 1
+
+/* Set this macro to 1 to make the library including and using STL containers:
+std::pair, std::vector, std::list, std::unordered_map.
+
+Set it to 0 or undefined to make the library using its own implementation of
+the containers.
+*/
+#if VMA_USE_STL_CONTAINERS
+ #define VMA_USE_STL_VECTOR 1
+ #define VMA_USE_STL_UNORDERED_MAP 1
+ #define VMA_USE_STL_LIST 1
+#endif
+
+#ifndef VMA_USE_STL_SHARED_MUTEX
+ // Minimum Visual Studio 2015 Update 2
+ #if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918
+ #define VMA_USE_STL_SHARED_MUTEX 1
+ #endif
+#endif
+
+#if VMA_USE_STL_VECTOR
+ #include <vector>
+#endif
+
+#if VMA_USE_STL_UNORDERED_MAP
+ #include <unordered_map>
+#endif
+
+#if VMA_USE_STL_LIST
+ #include <list>
+#endif
+
+/*
+Following headers are used in this CONFIGURATION section only, so feel free to
+remove them if not needed.
+*/
+#include <cassert> // for assert
+#include <algorithm> // for min, max
+#include <mutex>
+#include <atomic> // for std::atomic
+
+#ifndef VMA_NULL
+ // Value used as null pointer. Define it to e.g.: nullptr, NULL, 0, (void*)0.
+ #define VMA_NULL nullptr
+#endif
+
+#if defined(__ANDROID_API__) && (__ANDROID_API__ < 16)
+#include <cstdlib>
+void *aligned_alloc(size_t alignment, size_t size)
+{
+ // alignment must be >= sizeof(void*)
+ if(alignment < sizeof(void*))
+ {
+ alignment = sizeof(void*);
+ }
+
+ return memalign(alignment, size);
+}
+#elif defined(__APPLE__) || defined(__ANDROID__)
+#include <cstdlib>
+void *aligned_alloc(size_t alignment, size_t size)
+{
+ // alignment must be >= sizeof(void*)
+ if(alignment < sizeof(void*))
+ {
+ alignment = sizeof(void*);
+ }
+
+ void *pointer;
+ if(posix_memalign(&pointer, alignment, size) == 0)
+ return pointer;
+ return VMA_NULL;
+}
+#endif
+
+// If your compiler is not compatible with C++11 and definition of
+// aligned_alloc() function is missing, uncommeting following line may help:
+
+//#include <malloc.h>
+
+// Normal assert to check for programmer's errors, especially in Debug configuration.
+#ifndef VMA_ASSERT
+ #ifdef _DEBUG
+ #define VMA_ASSERT(expr) assert(expr)
+ #else
+ #define VMA_ASSERT(expr)
+ #endif
+#endif
+
+// Assert that will be called very often, like inside data structures e.g. operator[].
+// Making it non-empty can make program slow.
+#ifndef VMA_HEAVY_ASSERT
+ #ifdef _DEBUG
+ #define VMA_HEAVY_ASSERT(expr) //VMA_ASSERT(expr)
+ #else
+ #define VMA_HEAVY_ASSERT(expr)
+ #endif
+#endif
+
+#ifndef VMA_ALIGN_OF
+ #define VMA_ALIGN_OF(type) (__alignof(type))
+#endif
+
+#ifndef VMA_SYSTEM_ALIGNED_MALLOC
+ #if defined(_WIN32)
+ #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (_aligned_malloc((size), (alignment)))
+ #else
+ #define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) (aligned_alloc((alignment), (size) ))
+ #endif
+#endif
+
+#ifndef VMA_SYSTEM_FREE
+ #if defined(_WIN32)
+ #define VMA_SYSTEM_FREE(ptr) _aligned_free(ptr)
+ #else
+ #define VMA_SYSTEM_FREE(ptr) free(ptr)
+ #endif
+#endif
+
+#ifndef VMA_MIN
+ #define VMA_MIN(v1, v2) (std::min((v1), (v2)))
+#endif
+
+#ifndef VMA_MAX
+ #define VMA_MAX(v1, v2) (std::max((v1), (v2)))
+#endif
+
+#ifndef VMA_SWAP
+ #define VMA_SWAP(v1, v2) std::swap((v1), (v2))
+#endif
+
+#ifndef VMA_SORT
+ #define VMA_SORT(beg, end, cmp) std::sort(beg, end, cmp)
+#endif
+
+#ifndef VMA_DEBUG_LOG
+ #define VMA_DEBUG_LOG(format, ...)
+ /*
+ #define VMA_DEBUG_LOG(format, ...) do { \
+ printf(format, __VA_ARGS__); \
+ printf("\n"); \
+ } while(false)
+ */
+#endif
+
+// Define this macro to 1 to enable functions: vmaBuildStatsString, vmaFreeStatsString.
+#if VMA_STATS_STRING_ENABLED
+ static inline void VmaUint32ToStr(char* outStr, size_t strLen, uint32_t num)
+ {
+ snprintf(outStr, strLen, "%u", static_cast<unsigned int>(num));
+ }
+ static inline void VmaUint64ToStr(char* outStr, size_t strLen, uint64_t num)
+ {
+ snprintf(outStr, strLen, "%llu", static_cast<unsigned long long>(num));
+ }
+ static inline void VmaPtrToStr(char* outStr, size_t strLen, const void* ptr)
+ {
+ snprintf(outStr, strLen, "%p", ptr);
+ }
+#endif
+
+#ifndef VMA_MUTEX
+ class VmaMutex
+ {
+ public:
+ void Lock() { m_Mutex.lock(); }
+ void Unlock() { m_Mutex.unlock(); }
+ private:
+ std::mutex m_Mutex;
+ };
+ #define VMA_MUTEX VmaMutex
+#endif
+
+// Read-write mutex, where "read" is shared access, "write" is exclusive access.
+#ifndef VMA_RW_MUTEX
+ #if VMA_USE_STL_SHARED_MUTEX
+ // Use std::shared_mutex from C++17.
+ #include <shared_mutex>
+ class VmaRWMutex
+ {
+ public:
+ void LockRead() { m_Mutex.lock_shared(); }
+ void UnlockRead() { m_Mutex.unlock_shared(); }
+ void LockWrite() { m_Mutex.lock(); }
+ void UnlockWrite() { m_Mutex.unlock(); }
+ private:
+ std::shared_mutex m_Mutex;
+ };
+ #define VMA_RW_MUTEX VmaRWMutex
+ #elif defined(_WIN32) && !defined(__MINGW32__)
+ // Use SRWLOCK from WinAPI.
+ class VmaRWMutex
+ {
+ public:
+ VmaRWMutex() { InitializeSRWLock(&m_Lock); }
+ void LockRead() { AcquireSRWLockShared(&m_Lock); }
+ void UnlockRead() { ReleaseSRWLockShared(&m_Lock); }
+ void LockWrite() { AcquireSRWLockExclusive(&m_Lock); }
+ void UnlockWrite() { ReleaseSRWLockExclusive(&m_Lock); }
+ private:
+ SRWLOCK m_Lock;
+ };
+ #define VMA_RW_MUTEX VmaRWMutex
+ #else
+ // Less efficient fallback: Use normal mutex.
+ class VmaRWMutex
+ {
+ public:
+ void LockRead() { m_Mutex.Lock(); }
+ void UnlockRead() { m_Mutex.Unlock(); }
+ void LockWrite() { m_Mutex.Lock(); }
+ void UnlockWrite() { m_Mutex.Unlock(); }
+ private:
+ VMA_MUTEX m_Mutex;
+ };
+ #define VMA_RW_MUTEX VmaRWMutex
+ #endif // #if VMA_USE_STL_SHARED_MUTEX
+#endif // #ifndef VMA_RW_MUTEX
+
+/*
+If providing your own implementation, you need to implement a subset of std::atomic:
+
+- Constructor(uint32_t desired)
+- uint32_t load() const
+- void store(uint32_t desired)
+- bool compare_exchange_weak(uint32_t& expected, uint32_t desired)
+*/
+#ifndef VMA_ATOMIC_UINT32
+ #define VMA_ATOMIC_UINT32 std::atomic<uint32_t>
+#endif
+
+#ifndef VMA_DEBUG_ALWAYS_DEDICATED_MEMORY
+ /**
+ Every allocation will have its own memory block.
+ Define to 1 for debugging purposes only.
+ */
+ #define VMA_DEBUG_ALWAYS_DEDICATED_MEMORY (0)
+#endif
+
+#ifndef VMA_DEBUG_ALIGNMENT
+ /**
+ Minimum alignment of all allocations, in bytes.
+ Set to more than 1 for debugging purposes only. Must be power of two.
+ */
+ #define VMA_DEBUG_ALIGNMENT (1)
+#endif
+
+#ifndef VMA_DEBUG_MARGIN
+ /**
+ Minimum margin before and after every allocation, in bytes.
+ Set nonzero for debugging purposes only.
+ */
+ #define VMA_DEBUG_MARGIN (0)
+#endif
+
+#ifndef VMA_DEBUG_INITIALIZE_ALLOCATIONS
+ /**
+ Define this macro to 1 to automatically fill new allocations and destroyed
+ allocations with some bit pattern.
+ */
+ #define VMA_DEBUG_INITIALIZE_ALLOCATIONS (0)
+#endif
+
+#ifndef VMA_DEBUG_DETECT_CORRUPTION
+ /**
+ Define this macro to 1 together with non-zero value of VMA_DEBUG_MARGIN to
+ enable writing magic value to the margin before and after every allocation and
+ validating it, so that memory corruptions (out-of-bounds writes) are detected.
+ */
+ #define VMA_DEBUG_DETECT_CORRUPTION (0)
+#endif
+
+#ifndef VMA_DEBUG_GLOBAL_MUTEX
+ /**
+ Set this to 1 for debugging purposes only, to enable single mutex protecting all
+ entry calls to the library. Can be useful for debugging multithreading issues.
+ */
+ #define VMA_DEBUG_GLOBAL_MUTEX (0)
+#endif
+
+#ifndef VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY
+ /**
+ Minimum value for VkPhysicalDeviceLimits::bufferImageGranularity.
+ Set to more than 1 for debugging purposes only. Must be power of two.
+ */
+ #define VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY (1)
+#endif
+
+#ifndef VMA_SMALL_HEAP_MAX_SIZE
+ /// Maximum size of a memory heap in Vulkan to consider it "small".
+ #define VMA_SMALL_HEAP_MAX_SIZE (1024ull * 1024 * 1024)
+#endif
+
+#ifndef VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE
+ /// Default size of a block allocated as single VkDeviceMemory from a "large" heap.
+ #define VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE (256ull * 1024 * 1024)
+#endif
+
+#ifndef VMA_CLASS_NO_COPY
+ #define VMA_CLASS_NO_COPY(className) \
+ private: \
+ className(const className&) = delete; \
+ className& operator=(const className&) = delete;
+#endif
+
+static const uint32_t VMA_FRAME_INDEX_LOST = UINT32_MAX;
+
+// Decimal 2139416166, float NaN, little-endian binary 66 E6 84 7F.
+static const uint32_t VMA_CORRUPTION_DETECTION_MAGIC_VALUE = 0x7F84E666;
+
+static const uint8_t VMA_ALLOCATION_FILL_PATTERN_CREATED = 0xDC;
+static const uint8_t VMA_ALLOCATION_FILL_PATTERN_DESTROYED = 0xEF;
+
+/*******************************************************************************
+END OF CONFIGURATION
+*/
+
+static const uint32_t VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET = 0x10000000u;
+
+static VkAllocationCallbacks VmaEmptyAllocationCallbacks = {
+ VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL, VMA_NULL };
+
+// Returns number of bits set to 1 in (v).
+static inline uint32_t VmaCountBitsSet(uint32_t v)
+{
+ uint32_t c = v - ((v >> 1) & 0x55555555);
+ c = ((c >> 2) & 0x33333333) + (c & 0x33333333);
+ c = ((c >> 4) + c) & 0x0F0F0F0F;
+ c = ((c >> 8) + c) & 0x00FF00FF;
+ c = ((c >> 16) + c) & 0x0000FFFF;
+ return c;
+}
+
+// Aligns given value up to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 16.
+// Use types like uint32_t, uint64_t as T.
+template <typename T>
+static inline T VmaAlignUp(T val, T align)
+{
+ return (val + align - 1) / align * align;
+}
+// Aligns given value down to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 8.
+// Use types like uint32_t, uint64_t as T.
+template <typename T>
+static inline T VmaAlignDown(T val, T align)
+{
+ return val / align * align;
+}
+
+// Division with mathematical rounding to nearest number.
+template <typename T>
+static inline T VmaRoundDiv(T x, T y)
+{
+ return (x + (y / (T)2)) / y;
+}
+
+/*
+Returns true if given number is a power of two.
+T must be unsigned integer number or signed integer but always nonnegative.
+For 0 returns true.
+*/
+template <typename T>
+inline bool VmaIsPow2(T x)
+{
+ return (x & (x-1)) == 0;
+}
+
+// Returns smallest power of 2 greater or equal to v.
+static inline uint32_t VmaNextPow2(uint32_t v)
+{
+ v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ v++;
+ return v;
+}
+static inline uint64_t VmaNextPow2(uint64_t v)
+{
+ v--;
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ v |= v >> 32;
+ v++;
+ return v;
+}
+
+// Returns largest power of 2 less or equal to v.
+static inline uint32_t VmaPrevPow2(uint32_t v)
+{
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ v = v ^ (v >> 1);
+ return v;
+}
+static inline uint64_t VmaPrevPow2(uint64_t v)
+{
+ v |= v >> 1;
+ v |= v >> 2;
+ v |= v >> 4;
+ v |= v >> 8;
+ v |= v >> 16;
+ v |= v >> 32;
+ v = v ^ (v >> 1);
+ return v;
+}
+
+static inline bool VmaStrIsEmpty(const char* pStr)
+{
+ return pStr == VMA_NULL || *pStr == '\0';
+}
+
+static const char* VmaAlgorithmToStr(uint32_t algorithm)
+{
+ switch(algorithm)
+ {
+ case VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT:
+ return "Linear";
+ case VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT:
+ return "Buddy";
+ case 0:
+ return "Default";
+ default:
+ VMA_ASSERT(0);
+ return "";
+ }
+}
+
+#ifndef VMA_SORT
+
+template<typename Iterator, typename Compare>
+Iterator VmaQuickSortPartition(Iterator beg, Iterator end, Compare cmp)
+{
+ Iterator centerValue = end; --centerValue;
+ Iterator insertIndex = beg;
+ for(Iterator memTypeIndex = beg; memTypeIndex < centerValue; ++memTypeIndex)
+ {
+ if(cmp(*memTypeIndex, *centerValue))
+ {
+ if(insertIndex != memTypeIndex)
+ {
+ VMA_SWAP(*memTypeIndex, *insertIndex);
+ }
+ ++insertIndex;
+ }
+ }
+ if(insertIndex != centerValue)
+ {
+ VMA_SWAP(*insertIndex, *centerValue);
+ }
+ return insertIndex;
+}
+
+template<typename Iterator, typename Compare>
+void VmaQuickSort(Iterator beg, Iterator end, Compare cmp)
+{
+ if(beg < end)
+ {
+ Iterator it = VmaQuickSortPartition<Iterator, Compare>(beg, end, cmp);
+ VmaQuickSort<Iterator, Compare>(beg, it, cmp);
+ VmaQuickSort<Iterator, Compare>(it + 1, end, cmp);
+ }
+}
+
+#define VMA_SORT(beg, end, cmp) VmaQuickSort(beg, end, cmp)
+
+#endif // #ifndef VMA_SORT
+
+/*
+Returns true if two memory blocks occupy overlapping pages.
+ResourceA must be in less memory offset than ResourceB.
+
+Algorithm is based on "Vulkan 1.0.39 - A Specification (with all registered Vulkan extensions)"
+chapter 11.6 "Resource Memory Association", paragraph "Buffer-Image Granularity".
+*/
+static inline bool VmaBlocksOnSamePage(
+ VkDeviceSize resourceAOffset,
+ VkDeviceSize resourceASize,
+ VkDeviceSize resourceBOffset,
+ VkDeviceSize pageSize)
+{
+ VMA_ASSERT(resourceAOffset + resourceASize <= resourceBOffset && resourceASize > 0 && pageSize > 0);
+ VkDeviceSize resourceAEnd = resourceAOffset + resourceASize - 1;
+ VkDeviceSize resourceAEndPage = resourceAEnd & ~(pageSize - 1);
+ VkDeviceSize resourceBStart = resourceBOffset;
+ VkDeviceSize resourceBStartPage = resourceBStart & ~(pageSize - 1);
+ return resourceAEndPage == resourceBStartPage;
+}
+
+enum VmaSuballocationType
+{
+ VMA_SUBALLOCATION_TYPE_FREE = 0,
+ VMA_SUBALLOCATION_TYPE_UNKNOWN = 1,
+ VMA_SUBALLOCATION_TYPE_BUFFER = 2,
+ VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN = 3,
+ VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR = 4,
+ VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL = 5,
+ VMA_SUBALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
+};
+
+/*
+Returns true if given suballocation types could conflict and must respect
+VkPhysicalDeviceLimits::bufferImageGranularity. They conflict if one is buffer
+or linear image and another one is optimal image. If type is unknown, behave
+conservatively.
+*/
+static inline bool VmaIsBufferImageGranularityConflict(
+ VmaSuballocationType suballocType1,
+ VmaSuballocationType suballocType2)
+{
+ if(suballocType1 > suballocType2)
+ {
+ VMA_SWAP(suballocType1, suballocType2);
+ }
+
+ switch(suballocType1)
+ {
+ case VMA_SUBALLOCATION_TYPE_FREE:
+ return false;
+ case VMA_SUBALLOCATION_TYPE_UNKNOWN:
+ return true;
+ case VMA_SUBALLOCATION_TYPE_BUFFER:
+ return
+ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
+ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
+ case VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN:
+ return
+ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
+ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR ||
+ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
+ case VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR:
+ return
+ suballocType2 == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL;
+ case VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL:
+ return false;
+ default:
+ VMA_ASSERT(0);
+ return true;
+ }
+}
+
+static void VmaWriteMagicValue(void* pData, VkDeviceSize offset)
+{
+ uint32_t* pDst = (uint32_t*)((char*)pData + offset);
+ const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
+ for(size_t i = 0; i != numberCount; ++i, ++pDst)
+ {
+ *pDst = VMA_CORRUPTION_DETECTION_MAGIC_VALUE;
+ }
+}
+
+static bool VmaValidateMagicValue(const void* pData, VkDeviceSize offset)
+{
+ const uint32_t* pSrc = (const uint32_t*)((const char*)pData + offset);
+ const size_t numberCount = VMA_DEBUG_MARGIN / sizeof(uint32_t);
+ for(size_t i = 0; i != numberCount; ++i, ++pSrc)
+ {
+ if(*pSrc != VMA_CORRUPTION_DETECTION_MAGIC_VALUE)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope).
+struct VmaMutexLock
+{
+ VMA_CLASS_NO_COPY(VmaMutexLock)
+public:
+ VmaMutexLock(VMA_MUTEX& mutex, bool useMutex) :
+ m_pMutex(useMutex ? &mutex : VMA_NULL)
+ { if(m_pMutex) { m_pMutex->Lock(); } }
+ ~VmaMutexLock()
+ { if(m_pMutex) { m_pMutex->Unlock(); } }
+private:
+ VMA_MUTEX* m_pMutex;
+};
+
+// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading.
+struct VmaMutexLockRead
+{
+ VMA_CLASS_NO_COPY(VmaMutexLockRead)
+public:
+ VmaMutexLockRead(VMA_RW_MUTEX& mutex, bool useMutex) :
+ m_pMutex(useMutex ? &mutex : VMA_NULL)
+ { if(m_pMutex) { m_pMutex->LockRead(); } }
+ ~VmaMutexLockRead() { if(m_pMutex) { m_pMutex->UnlockRead(); } }
+private:
+ VMA_RW_MUTEX* m_pMutex;
+};
+
+// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing.
+struct VmaMutexLockWrite
+{
+ VMA_CLASS_NO_COPY(VmaMutexLockWrite)
+public:
+ VmaMutexLockWrite(VMA_RW_MUTEX& mutex, bool useMutex) :
+ m_pMutex(useMutex ? &mutex : VMA_NULL)
+ { if(m_pMutex) { m_pMutex->LockWrite(); } }
+ ~VmaMutexLockWrite() { if(m_pMutex) { m_pMutex->UnlockWrite(); } }
+private:
+ VMA_RW_MUTEX* m_pMutex;
+};
+
+#if VMA_DEBUG_GLOBAL_MUTEX
+ static VMA_MUTEX gDebugGlobalMutex;
+ #define VMA_DEBUG_GLOBAL_MUTEX_LOCK VmaMutexLock debugGlobalMutexLock(gDebugGlobalMutex, true);
+#else
+ #define VMA_DEBUG_GLOBAL_MUTEX_LOCK
+#endif
+
+// Minimum size of a free suballocation to register it in the free suballocation collection.
+static const VkDeviceSize VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER = 16;
+
+/*
+Performs binary search and returns iterator to first element that is greater or
+equal to (key), according to comparison (cmp).
+
+Cmp should return true if first argument is less than second argument.
+
+Returned value is the found element, if present in the collection or place where
+new element with value (key) should be inserted.
+*/
+template <typename CmpLess, typename IterT, typename KeyT>
+static IterT VmaBinaryFindFirstNotLess(IterT beg, IterT end, const KeyT &key, CmpLess cmp)
+{
+ size_t down = 0, up = (end - beg);
+ while(down < up)
+ {
+ const size_t mid = (down + up) / 2;
+ if(cmp(*(beg+mid), key))
+ {
+ down = mid + 1;
+ }
+ else
+ {
+ up = mid;
+ }
+ }
+ return beg + down;
+}
+
+/*
+Returns true if all pointers in the array are not-null and unique.
+Warning! O(n^2) complexity. Use only inside VMA_HEAVY_ASSERT.
+T must be pointer type, e.g. VmaAllocation, VmaPool.
+*/
+template<typename T>
+static bool VmaValidatePointerArray(uint32_t count, const T* arr)
+{
+ for(uint32_t i = 0; i < count; ++i)
+ {
+ const T iPtr = arr[i];
+ if(iPtr == VMA_NULL)
+ {
+ return false;
+ }
+ for(uint32_t j = i + 1; j < count; ++j)
+ {
+ if(iPtr == arr[j])
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Memory allocation
+
+static void* VmaMalloc(const VkAllocationCallbacks* pAllocationCallbacks, size_t size, size_t alignment)
+{
+ if((pAllocationCallbacks != VMA_NULL) &&
+ (pAllocationCallbacks->pfnAllocation != VMA_NULL))
+ {
+ return (*pAllocationCallbacks->pfnAllocation)(
+ pAllocationCallbacks->pUserData,
+ size,
+ alignment,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ }
+ else
+ {
+ return VMA_SYSTEM_ALIGNED_MALLOC(size, alignment);
+ }
+}
+
+static void VmaFree(const VkAllocationCallbacks* pAllocationCallbacks, void* ptr)
+{
+ if((pAllocationCallbacks != VMA_NULL) &&
+ (pAllocationCallbacks->pfnFree != VMA_NULL))
+ {
+ (*pAllocationCallbacks->pfnFree)(pAllocationCallbacks->pUserData, ptr);
+ }
+ else
+ {
+ VMA_SYSTEM_FREE(ptr);
+ }
+}
+
+template<typename T>
+static T* VmaAllocate(const VkAllocationCallbacks* pAllocationCallbacks)
+{
+ return (T*)VmaMalloc(pAllocationCallbacks, sizeof(T), VMA_ALIGN_OF(T));
+}
+
+template<typename T>
+static T* VmaAllocateArray(const VkAllocationCallbacks* pAllocationCallbacks, size_t count)
+{
+ return (T*)VmaMalloc(pAllocationCallbacks, sizeof(T) * count, VMA_ALIGN_OF(T));
+}
+
+#define vma_new(allocator, type) new(VmaAllocate<type>(allocator))(type)
+
+#define vma_new_array(allocator, type, count) new(VmaAllocateArray<type>((allocator), (count)))(type)
+
+template<typename T>
+static void vma_delete(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr)
+{
+ ptr->~T();
+ VmaFree(pAllocationCallbacks, ptr);
+}
+
+template<typename T>
+static void vma_delete_array(const VkAllocationCallbacks* pAllocationCallbacks, T* ptr, size_t count)
+{
+ if(ptr != VMA_NULL)
+ {
+ for(size_t i = count; i--; )
+ {
+ ptr[i].~T();
+ }
+ VmaFree(pAllocationCallbacks, ptr);
+ }
+}
+
+// STL-compatible allocator.
+template<typename T>
+class VmaStlAllocator
+{
+public:
+ const VkAllocationCallbacks* const m_pCallbacks;
+ typedef T value_type;
+
+ VmaStlAllocator(const VkAllocationCallbacks* pCallbacks) : m_pCallbacks(pCallbacks) { }
+ template<typename U> VmaStlAllocator(const VmaStlAllocator<U>& src) : m_pCallbacks(src.m_pCallbacks) { }
+
+ T* allocate(size_t n) { return VmaAllocateArray<T>(m_pCallbacks, n); }
+ void deallocate(T* p, size_t /*n*/) { VmaFree(m_pCallbacks, p); }
+
+ template<typename U>
+ bool operator==(const VmaStlAllocator<U>& rhs) const
+ {
+ return m_pCallbacks == rhs.m_pCallbacks;
+ }
+ template<typename U>
+ bool operator!=(const VmaStlAllocator<U>& rhs) const
+ {
+ return m_pCallbacks != rhs.m_pCallbacks;
+ }
+
+ VmaStlAllocator& operator=(const VmaStlAllocator& x) = delete;
+};
+
+#if VMA_USE_STL_VECTOR
+
+#define VmaVector std::vector
+
+template<typename T, typename allocatorT>
+static void VmaVectorInsert(std::vector<T, allocatorT>& vec, size_t index, const T& item)
+{
+ vec.insert(vec.begin() + index, item);
+}
+
+template<typename T, typename allocatorT>
+static void VmaVectorRemove(std::vector<T, allocatorT>& vec, size_t index)
+{
+ vec.erase(vec.begin() + index);
+}
+
+#else // #if VMA_USE_STL_VECTOR
+
+/* Class with interface compatible with subset of std::vector.
+T must be POD because constructors and destructors are not called and memcpy is
+used for these objects. */
+template<typename T, typename AllocatorT>
+class VmaVector
+{
+public:
+ typedef T value_type;
+
+ VmaVector(const AllocatorT& allocator) :
+ m_Allocator(allocator),
+ m_pArray(VMA_NULL),
+ m_Count(0),
+ m_Capacity(0)
+ {
+ }
+
+ VmaVector(size_t count, const AllocatorT& allocator) :
+ m_Allocator(allocator),
+ m_pArray(count ? (T*)VmaAllocateArray<T>(allocator.m_pCallbacks, count) : VMA_NULL),
+ m_Count(count),
+ m_Capacity(count)
+ {
+ }
+
+ VmaVector(const VmaVector<T, AllocatorT>& src) :
+ m_Allocator(src.m_Allocator),
+ m_pArray(src.m_Count ? (T*)VmaAllocateArray<T>(src.m_Allocator.m_pCallbacks, src.m_Count) : VMA_NULL),
+ m_Count(src.m_Count),
+ m_Capacity(src.m_Count)
+ {
+ if(m_Count != 0)
+ {
+ memcpy(m_pArray, src.m_pArray, m_Count * sizeof(T));
+ }
+ }
+
+ ~VmaVector()
+ {
+ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ }
+
+ VmaVector& operator=(const VmaVector<T, AllocatorT>& rhs)
+ {
+ if(&rhs != this)
+ {
+ resize(rhs.m_Count);
+ if(m_Count != 0)
+ {
+ memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T));
+ }
+ }
+ return *this;
+ }
+
+ bool empty() const { return m_Count == 0; }
+ size_t size() const { return m_Count; }
+ T* data() { return m_pArray; }
+ const T* data() const { return m_pArray; }
+
+ T& operator[](size_t index)
+ {
+ VMA_HEAVY_ASSERT(index < m_Count);
+ return m_pArray[index];
+ }
+ const T& operator[](size_t index) const
+ {
+ VMA_HEAVY_ASSERT(index < m_Count);
+ return m_pArray[index];
+ }
+
+ T& front()
+ {
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ return m_pArray[0];
+ }
+ const T& front() const
+ {
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ return m_pArray[0];
+ }
+ T& back()
+ {
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ return m_pArray[m_Count - 1];
+ }
+ const T& back() const
+ {
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ return m_pArray[m_Count - 1];
+ }
+
+ void reserve(size_t newCapacity, bool freeMemory = false)
+ {
+ newCapacity = VMA_MAX(newCapacity, m_Count);
+
+ if((newCapacity < m_Capacity) && !freeMemory)
+ {
+ newCapacity = m_Capacity;
+ }
+
+ if(newCapacity != m_Capacity)
+ {
+ T* const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator, newCapacity) : VMA_NULL;
+ if(m_Count != 0)
+ {
+ memcpy(newArray, m_pArray, m_Count * sizeof(T));
+ }
+ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ m_Capacity = newCapacity;
+ m_pArray = newArray;
+ }
+ }
+
+ void resize(size_t newCount, bool freeMemory = false)
+ {
+ size_t newCapacity = m_Capacity;
+ if(newCount > m_Capacity)
+ {
+ newCapacity = VMA_MAX(newCount, VMA_MAX(m_Capacity * 3 / 2, (size_t)8));
+ }
+ else if(freeMemory)
+ {
+ newCapacity = newCount;
+ }
+
+ if(newCapacity != m_Capacity)
+ {
+ T* const newArray = newCapacity ? VmaAllocateArray<T>(m_Allocator.m_pCallbacks, newCapacity) : VMA_NULL;
+ const size_t elementsToCopy = VMA_MIN(m_Count, newCount);
+ if(elementsToCopy != 0)
+ {
+ memcpy(newArray, m_pArray, elementsToCopy * sizeof(T));
+ }
+ VmaFree(m_Allocator.m_pCallbacks, m_pArray);
+ m_Capacity = newCapacity;
+ m_pArray = newArray;
+ }
+
+ m_Count = newCount;
+ }
+
+ void clear(bool freeMemory = false)
+ {
+ resize(0, freeMemory);
+ }
+
+ void insert(size_t index, const T& src)
+ {
+ VMA_HEAVY_ASSERT(index <= m_Count);
+ const size_t oldCount = size();
+ resize(oldCount + 1);
+ if(index < oldCount)
+ {
+ memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * sizeof(T));
+ }
+ m_pArray[index] = src;
+ }
+
+ void remove(size_t index)
+ {
+ VMA_HEAVY_ASSERT(index < m_Count);
+ const size_t oldCount = size();
+ if(index < oldCount - 1)
+ {
+ memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * sizeof(T));
+ }
+ resize(oldCount - 1);
+ }
+
+ void push_back(const T& src)
+ {
+ const size_t newIndex = size();
+ resize(newIndex + 1);
+ m_pArray[newIndex] = src;
+ }
+
+ void pop_back()
+ {
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ resize(size() - 1);
+ }
+
+ void push_front(const T& src)
+ {
+ insert(0, src);
+ }
+
+ void pop_front()
+ {
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ remove(0);
+ }
+
+ typedef T* iterator;
+
+ iterator begin() { return m_pArray; }
+ iterator end() { return m_pArray + m_Count; }
+
+private:
+ AllocatorT m_Allocator;
+ T* m_pArray;
+ size_t m_Count;
+ size_t m_Capacity;
+};
+
+template<typename T, typename allocatorT>
+static void VmaVectorInsert(VmaVector<T, allocatorT>& vec, size_t index, const T& item)
+{
+ vec.insert(index, item);
+}
+
+template<typename T, typename allocatorT>
+static void VmaVectorRemove(VmaVector<T, allocatorT>& vec, size_t index)
+{
+ vec.remove(index);
+}
+
+#endif // #if VMA_USE_STL_VECTOR
+
+template<typename CmpLess, typename VectorT>
+size_t VmaVectorInsertSorted(VectorT& vector, const typename VectorT::value_type& value)
+{
+ const size_t indexToInsert = VmaBinaryFindFirstNotLess(
+ vector.data(),
+ vector.data() + vector.size(),
+ value,
+ CmpLess()) - vector.data();
+ VmaVectorInsert(vector, indexToInsert, value);
+ return indexToInsert;
+}
+
+template<typename CmpLess, typename VectorT>
+bool VmaVectorRemoveSorted(VectorT& vector, const typename VectorT::value_type& value)
+{
+ CmpLess comparator;
+ typename VectorT::iterator it = VmaBinaryFindFirstNotLess(
+ vector.begin(),
+ vector.end(),
+ value,
+ comparator);
+ if((it != vector.end()) && !comparator(*it, value) && !comparator(value, *it))
+ {
+ size_t indexToRemove = it - vector.begin();
+ VmaVectorRemove(vector, indexToRemove);
+ return true;
+ }
+ return false;
+}
+
+template<typename CmpLess, typename IterT, typename KeyT>
+IterT VmaVectorFindSorted(const IterT& beg, const IterT& end, const KeyT& value)
+{
+ CmpLess comparator;
+ IterT it = VmaBinaryFindFirstNotLess<CmpLess, IterT, KeyT>(
+ beg, end, value, comparator);
+ if(it == end ||
+ (!comparator(*it, value) && !comparator(value, *it)))
+ {
+ return it;
+ }
+ return end;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaPoolAllocator
+
+/*
+Allocator for objects of type T using a list of arrays (pools) to speed up
+allocation. Number of elements that can be allocated is not bounded because
+allocator can create multiple blocks.
+*/
+template<typename T>
+class VmaPoolAllocator
+{
+ VMA_CLASS_NO_COPY(VmaPoolAllocator)
+public:
+ VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, size_t itemsPerBlock);
+ ~VmaPoolAllocator();
+ void Clear();
+ T* Alloc();
+ void Free(T* ptr);
+
+private:
+ union Item
+ {
+ uint32_t NextFreeIndex;
+ T Value;
+ };
+
+ struct ItemBlock
+ {
+ Item* pItems;
+ uint32_t FirstFreeIndex;
+ };
+
+ const VkAllocationCallbacks* m_pAllocationCallbacks;
+ size_t m_ItemsPerBlock;
+ VmaVector< ItemBlock, VmaStlAllocator<ItemBlock> > m_ItemBlocks;
+
+ ItemBlock& CreateNewBlock();
+};
+
+template<typename T>
+VmaPoolAllocator<T>::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, size_t itemsPerBlock) :
+ m_pAllocationCallbacks(pAllocationCallbacks),
+ m_ItemsPerBlock(itemsPerBlock),
+ m_ItemBlocks(VmaStlAllocator<ItemBlock>(pAllocationCallbacks))
+{
+ VMA_ASSERT(itemsPerBlock > 0);
+}
+
+template<typename T>
+VmaPoolAllocator<T>::~VmaPoolAllocator()
+{
+ Clear();
+}
+
+template<typename T>
+void VmaPoolAllocator<T>::Clear()
+{
+ for(size_t i = m_ItemBlocks.size(); i--; )
+ vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemsPerBlock);
+ m_ItemBlocks.clear();
+}
+
+template<typename T>
+T* VmaPoolAllocator<T>::Alloc()
+{
+ for(size_t i = m_ItemBlocks.size(); i--; )
+ {
+ ItemBlock& block = m_ItemBlocks[i];
+ // This block has some free items: Use first one.
+ if(block.FirstFreeIndex != UINT32_MAX)
+ {
+ Item* const pItem = &block.pItems[block.FirstFreeIndex];
+ block.FirstFreeIndex = pItem->NextFreeIndex;
+ return &pItem->Value;
+ }
+ }
+
+ // No block has free item: Create new one and use it.
+ ItemBlock& newBlock = CreateNewBlock();
+ Item* const pItem = &newBlock.pItems[0];
+ newBlock.FirstFreeIndex = pItem->NextFreeIndex;
+ return &pItem->Value;
+}
+
+template<typename T>
+void VmaPoolAllocator<T>::Free(T* ptr)
+{
+ // Search all memory blocks to find ptr.
+ for(size_t i = 0; i < m_ItemBlocks.size(); ++i)
+ {
+ ItemBlock& block = m_ItemBlocks[i];
+
+ // Casting to union.
+ Item* pItemPtr;
+ memcpy(&pItemPtr, &ptr, sizeof(pItemPtr));
+
+ // Check if pItemPtr is in address range of this block.
+ if((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + m_ItemsPerBlock))
+ {
+ const uint32_t index = static_cast<uint32_t>(pItemPtr - block.pItems);
+ pItemPtr->NextFreeIndex = block.FirstFreeIndex;
+ block.FirstFreeIndex = index;
+ return;
+ }
+ }
+ VMA_ASSERT(0 && "Pointer doesn't belong to this memory pool.");
+}
+
+template<typename T>
+typename VmaPoolAllocator<T>::ItemBlock& VmaPoolAllocator<T>::CreateNewBlock()
+{
+ ItemBlock newBlock = {
+ vma_new_array(m_pAllocationCallbacks, Item, m_ItemsPerBlock), 0 };
+
+ m_ItemBlocks.push_back(newBlock);
+
+ // Setup singly-linked list of all free items in this block.
+ for(uint32_t i = 0; i < m_ItemsPerBlock - 1; ++i)
+ newBlock.pItems[i].NextFreeIndex = i + 1;
+ newBlock.pItems[m_ItemsPerBlock - 1].NextFreeIndex = UINT32_MAX;
+ return m_ItemBlocks.back();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaRawList, VmaList
+
+#if VMA_USE_STL_LIST
+
+#define VmaList std::list
+
+#else // #if VMA_USE_STL_LIST
+
+template<typename T>
+struct VmaListItem
+{
+ VmaListItem* pPrev;
+ VmaListItem* pNext;
+ T Value;
+};
+
+// Doubly linked list.
+template<typename T>
+class VmaRawList
+{
+ VMA_CLASS_NO_COPY(VmaRawList)
+public:
+ typedef VmaListItem<T> ItemType;
+
+ VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks);
+ ~VmaRawList();
+ void Clear();
+
+ size_t GetCount() const { return m_Count; }
+ bool IsEmpty() const { return m_Count == 0; }
+
+ ItemType* Front() { return m_pFront; }
+ const ItemType* Front() const { return m_pFront; }
+ ItemType* Back() { return m_pBack; }
+ const ItemType* Back() const { return m_pBack; }
+
+ ItemType* PushBack();
+ ItemType* PushFront();
+ ItemType* PushBack(const T& value);
+ ItemType* PushFront(const T& value);
+ void PopBack();
+ void PopFront();
+
+ // Item can be null - it means PushBack.
+ ItemType* InsertBefore(ItemType* pItem);
+ // Item can be null - it means PushFront.
+ ItemType* InsertAfter(ItemType* pItem);
+
+ ItemType* InsertBefore(ItemType* pItem, const T& value);
+ ItemType* InsertAfter(ItemType* pItem, const T& value);
+
+ void Remove(ItemType* pItem);
+
+private:
+ const VkAllocationCallbacks* const m_pAllocationCallbacks;
+ VmaPoolAllocator<ItemType> m_ItemAllocator;
+ ItemType* m_pFront;
+ ItemType* m_pBack;
+ size_t m_Count;
+};
+
+template<typename T>
+VmaRawList<T>::VmaRawList(const VkAllocationCallbacks* pAllocationCallbacks) :
+ m_pAllocationCallbacks(pAllocationCallbacks),
+ m_ItemAllocator(pAllocationCallbacks, 128),
+ m_pFront(VMA_NULL),
+ m_pBack(VMA_NULL),
+ m_Count(0)
+{
+}
+
+template<typename T>
+VmaRawList<T>::~VmaRawList()
+{
+ // Intentionally not calling Clear, because that would be unnecessary
+ // computations to return all items to m_ItemAllocator as free.
+}
+
+template<typename T>
+void VmaRawList<T>::Clear()
+{
+ if(IsEmpty() == false)
+ {
+ ItemType* pItem = m_pBack;
+ while(pItem != VMA_NULL)
+ {
+ ItemType* const pPrevItem = pItem->pPrev;
+ m_ItemAllocator.Free(pItem);
+ pItem = pPrevItem;
+ }
+ m_pFront = VMA_NULL;
+ m_pBack = VMA_NULL;
+ m_Count = 0;
+ }
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::PushBack()
+{
+ ItemType* const pNewItem = m_ItemAllocator.Alloc();
+ pNewItem->pNext = VMA_NULL;
+ if(IsEmpty())
+ {
+ pNewItem->pPrev = VMA_NULL;
+ m_pFront = pNewItem;
+ m_pBack = pNewItem;
+ m_Count = 1;
+ }
+ else
+ {
+ pNewItem->pPrev = m_pBack;
+ m_pBack->pNext = pNewItem;
+ m_pBack = pNewItem;
+ ++m_Count;
+ }
+ return pNewItem;
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::PushFront()
+{
+ ItemType* const pNewItem = m_ItemAllocator.Alloc();
+ pNewItem->pPrev = VMA_NULL;
+ if(IsEmpty())
+ {
+ pNewItem->pNext = VMA_NULL;
+ m_pFront = pNewItem;
+ m_pBack = pNewItem;
+ m_Count = 1;
+ }
+ else
+ {
+ pNewItem->pNext = m_pFront;
+ m_pFront->pPrev = pNewItem;
+ m_pFront = pNewItem;
+ ++m_Count;
+ }
+ return pNewItem;
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::PushBack(const T& value)
+{
+ ItemType* const pNewItem = PushBack();
+ pNewItem->Value = value;
+ return pNewItem;
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::PushFront(const T& value)
+{
+ ItemType* const pNewItem = PushFront();
+ pNewItem->Value = value;
+ return pNewItem;
+}
+
+template<typename T>
+void VmaRawList<T>::PopBack()
+{
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ ItemType* const pBackItem = m_pBack;
+ ItemType* const pPrevItem = pBackItem->pPrev;
+ if(pPrevItem != VMA_NULL)
+ {
+ pPrevItem->pNext = VMA_NULL;
+ }
+ m_pBack = pPrevItem;
+ m_ItemAllocator.Free(pBackItem);
+ --m_Count;
+}
+
+template<typename T>
+void VmaRawList<T>::PopFront()
+{
+ VMA_HEAVY_ASSERT(m_Count > 0);
+ ItemType* const pFrontItem = m_pFront;
+ ItemType* const pNextItem = pFrontItem->pNext;
+ if(pNextItem != VMA_NULL)
+ {
+ pNextItem->pPrev = VMA_NULL;
+ }
+ m_pFront = pNextItem;
+ m_ItemAllocator.Free(pFrontItem);
+ --m_Count;
+}
+
+template<typename T>
+void VmaRawList<T>::Remove(ItemType* pItem)
+{
+ VMA_HEAVY_ASSERT(pItem != VMA_NULL);
+ VMA_HEAVY_ASSERT(m_Count > 0);
+
+ if(pItem->pPrev != VMA_NULL)
+ {
+ pItem->pPrev->pNext = pItem->pNext;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_pFront == pItem);
+ m_pFront = pItem->pNext;
+ }
+
+ if(pItem->pNext != VMA_NULL)
+ {
+ pItem->pNext->pPrev = pItem->pPrev;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_pBack == pItem);
+ m_pBack = pItem->pPrev;
+ }
+
+ m_ItemAllocator.Free(pItem);
+ --m_Count;
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem)
+{
+ if(pItem != VMA_NULL)
+ {
+ ItemType* const prevItem = pItem->pPrev;
+ ItemType* const newItem = m_ItemAllocator.Alloc();
+ newItem->pPrev = prevItem;
+ newItem->pNext = pItem;
+ pItem->pPrev = newItem;
+ if(prevItem != VMA_NULL)
+ {
+ prevItem->pNext = newItem;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_pFront == pItem);
+ m_pFront = newItem;
+ }
+ ++m_Count;
+ return newItem;
+ }
+ else
+ return PushBack();
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem)
+{
+ if(pItem != VMA_NULL)
+ {
+ ItemType* const nextItem = pItem->pNext;
+ ItemType* const newItem = m_ItemAllocator.Alloc();
+ newItem->pNext = nextItem;
+ newItem->pPrev = pItem;
+ pItem->pNext = newItem;
+ if(nextItem != VMA_NULL)
+ {
+ nextItem->pPrev = newItem;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(m_pBack == pItem);
+ m_pBack = newItem;
+ }
+ ++m_Count;
+ return newItem;
+ }
+ else
+ return PushFront();
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::InsertBefore(ItemType* pItem, const T& value)
+{
+ ItemType* const newItem = InsertBefore(pItem);
+ newItem->Value = value;
+ return newItem;
+}
+
+template<typename T>
+VmaListItem<T>* VmaRawList<T>::InsertAfter(ItemType* pItem, const T& value)
+{
+ ItemType* const newItem = InsertAfter(pItem);
+ newItem->Value = value;
+ return newItem;
+}
+
+template<typename T, typename AllocatorT>
+class VmaList
+{
+ VMA_CLASS_NO_COPY(VmaList)
+public:
+ class iterator
+ {
+ public:
+ iterator() :
+ m_pList(VMA_NULL),
+ m_pItem(VMA_NULL)
+ {
+ }
+
+ T& operator*() const
+ {
+ VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ return m_pItem->Value;
+ }
+ T* operator->() const
+ {
+ VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ return &m_pItem->Value;
+ }
+
+ iterator& operator++()
+ {
+ VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ m_pItem = m_pItem->pNext;
+ return *this;
+ }
+ iterator& operator--()
+ {
+ if(m_pItem != VMA_NULL)
+ {
+ m_pItem = m_pItem->pPrev;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ m_pItem = m_pList->Back();
+ }
+ return *this;
+ }
+
+ iterator operator++(int)
+ {
+ iterator result = *this;
+ ++*this;
+ return result;
+ }
+ iterator operator--(int)
+ {
+ iterator result = *this;
+ --*this;
+ return result;
+ }
+
+ bool operator==(const iterator& rhs) const
+ {
+ VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ return m_pItem == rhs.m_pItem;
+ }
+ bool operator!=(const iterator& rhs) const
+ {
+ VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ return m_pItem != rhs.m_pItem;
+ }
+
+ private:
+ VmaRawList<T>* m_pList;
+ VmaListItem<T>* m_pItem;
+
+ iterator(VmaRawList<T>* pList, VmaListItem<T>* pItem) :
+ m_pList(pList),
+ m_pItem(pItem)
+ {
+ }
+
+ friend class VmaList<T, AllocatorT>;
+ };
+
+ class const_iterator
+ {
+ public:
+ const_iterator() :
+ m_pList(VMA_NULL),
+ m_pItem(VMA_NULL)
+ {
+ }
+
+ const_iterator(const iterator& src) :
+ m_pList(src.m_pList),
+ m_pItem(src.m_pItem)
+ {
+ }
+
+ const T& operator*() const
+ {
+ VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ return m_pItem->Value;
+ }
+ const T* operator->() const
+ {
+ VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ return &m_pItem->Value;
+ }
+
+ const_iterator& operator++()
+ {
+ VMA_HEAVY_ASSERT(m_pItem != VMA_NULL);
+ m_pItem = m_pItem->pNext;
+ return *this;
+ }
+ const_iterator& operator--()
+ {
+ if(m_pItem != VMA_NULL)
+ {
+ m_pItem = m_pItem->pPrev;
+ }
+ else
+ {
+ VMA_HEAVY_ASSERT(!m_pList->IsEmpty());
+ m_pItem = m_pList->Back();
+ }
+ return *this;
+ }
+
+ const_iterator operator++(int)
+ {
+ const_iterator result = *this;
+ ++*this;
+ return result;
+ }
+ const_iterator operator--(int)
+ {
+ const_iterator result = *this;
+ --*this;
+ return result;
+ }
+
+ bool operator==(const const_iterator& rhs) const
+ {
+ VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ return m_pItem == rhs.m_pItem;
+ }
+ bool operator!=(const const_iterator& rhs) const
+ {
+ VMA_HEAVY_ASSERT(m_pList == rhs.m_pList);
+ return m_pItem != rhs.m_pItem;
+ }
+
+ private:
+ const_iterator(const VmaRawList<T>* pList, const VmaListItem<T>* pItem) :
+ m_pList(pList),
+ m_pItem(pItem)
+ {
+ }
+
+ const VmaRawList<T>* m_pList;
+ const VmaListItem<T>* m_pItem;
+
+ friend class VmaList<T, AllocatorT>;
+ };
+
+ VmaList(const AllocatorT& allocator) : m_RawList(allocator.m_pCallbacks) { }
+
+ bool empty() const { return m_RawList.IsEmpty(); }
+ size_t size() const { return m_RawList.GetCount(); }
+
+ iterator begin() { return iterator(&m_RawList, m_RawList.Front()); }
+ iterator end() { return iterator(&m_RawList, VMA_NULL); }
+
+ const_iterator cbegin() const { return const_iterator(&m_RawList, m_RawList.Front()); }
+ const_iterator cend() const { return const_iterator(&m_RawList, VMA_NULL); }
+
+ void clear() { m_RawList.Clear(); }
+ void push_back(const T& value) { m_RawList.PushBack(value); }
+ void erase(iterator it) { m_RawList.Remove(it.m_pItem); }
+ iterator insert(iterator it, const T& value) { return iterator(&m_RawList, m_RawList.InsertBefore(it.m_pItem, value)); }
+
+private:
+ VmaRawList<T> m_RawList;
+};
+
+#endif // #if VMA_USE_STL_LIST
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaMap
+
+// Unused in this version.
+#if 0
+
+#if VMA_USE_STL_UNORDERED_MAP
+
+#define VmaPair std::pair
+
+#define VMA_MAP_TYPE(KeyT, ValueT) \
+ std::unordered_map< KeyT, ValueT, std::hash<KeyT>, std::equal_to<KeyT>, VmaStlAllocator< std::pair<KeyT, ValueT> > >
+
+#else // #if VMA_USE_STL_UNORDERED_MAP
+
+template<typename T1, typename T2>
+struct VmaPair
+{
+ T1 first;
+ T2 second;
+
+ VmaPair() : first(), second() { }
+ VmaPair(const T1& firstSrc, const T2& secondSrc) : first(firstSrc), second(secondSrc) { }
+};
+
+/* Class compatible with subset of interface of std::unordered_map.
+KeyT, ValueT must be POD because they will be stored in VmaVector.
+*/
+template<typename KeyT, typename ValueT>
+class VmaMap
+{
+public:
+ typedef VmaPair<KeyT, ValueT> PairType;
+ typedef PairType* iterator;
+
+ VmaMap(const VmaStlAllocator<PairType>& allocator) : m_Vector(allocator) { }
+
+ iterator begin() { return m_Vector.begin(); }
+ iterator end() { return m_Vector.end(); }
+
+ void insert(const PairType& pair);
+ iterator find(const KeyT& key);
+ void erase(iterator it);
+
+private:
+ VmaVector< PairType, VmaStlAllocator<PairType> > m_Vector;
+};
+
+#define VMA_MAP_TYPE(KeyT, ValueT) VmaMap<KeyT, ValueT>
+
+template<typename FirstT, typename SecondT>
+struct VmaPairFirstLess
+{
+ bool operator()(const VmaPair<FirstT, SecondT>& lhs, const VmaPair<FirstT, SecondT>& rhs) const
+ {
+ return lhs.first < rhs.first;
+ }
+ bool operator()(const VmaPair<FirstT, SecondT>& lhs, const FirstT& rhsFirst) const
+ {
+ return lhs.first < rhsFirst;
+ }
+};
+
+template<typename KeyT, typename ValueT>
+void VmaMap<KeyT, ValueT>::insert(const PairType& pair)
+{
+ const size_t indexToInsert = VmaBinaryFindFirstNotLess(
+ m_Vector.data(),
+ m_Vector.data() + m_Vector.size(),
+ pair,
+ VmaPairFirstLess<KeyT, ValueT>()) - m_Vector.data();
+ VmaVectorInsert(m_Vector, indexToInsert, pair);
+}
+
+template<typename KeyT, typename ValueT>
+VmaPair<KeyT, ValueT>* VmaMap<KeyT, ValueT>::find(const KeyT& key)
+{
+ PairType* it = VmaBinaryFindFirstNotLess(
+ m_Vector.data(),
+ m_Vector.data() + m_Vector.size(),
+ key,
+ VmaPairFirstLess<KeyT, ValueT>());
+ if((it != m_Vector.end()) && (it->first == key))
+ {
+ return it;
+ }
+ else
+ {
+ return m_Vector.end();
+ }
+}
+
+template<typename KeyT, typename ValueT>
+void VmaMap<KeyT, ValueT>::erase(iterator it)
+{
+ VmaVectorRemove(m_Vector, it - m_Vector.begin());
+}
+
+#endif // #if VMA_USE_STL_UNORDERED_MAP
+
+#endif // #if 0
+
+////////////////////////////////////////////////////////////////////////////////
+
+class VmaDeviceMemoryBlock;
+
+enum VMA_CACHE_OPERATION { VMA_CACHE_FLUSH, VMA_CACHE_INVALIDATE };
+
+struct VmaAllocation_T
+{
+ VMA_CLASS_NO_COPY(VmaAllocation_T)
+private:
+ static const uint8_t MAP_COUNT_FLAG_PERSISTENT_MAP = 0x80;
+
+ enum FLAGS
+ {
+ FLAG_USER_DATA_STRING = 0x01,
+ };
+
+public:
+ enum ALLOCATION_TYPE
+ {
+ ALLOCATION_TYPE_NONE,
+ ALLOCATION_TYPE_BLOCK,
+ ALLOCATION_TYPE_DEDICATED,
+ };
+
+ VmaAllocation_T(uint32_t currentFrameIndex, bool userDataString) :
+ m_Alignment(1),
+ m_Size(0),
+ m_pUserData(VMA_NULL),
+ m_LastUseFrameIndex(currentFrameIndex),
+ m_Type((uint8_t)ALLOCATION_TYPE_NONE),
+ m_SuballocationType((uint8_t)VMA_SUBALLOCATION_TYPE_UNKNOWN),
+ m_MapCount(0),
+ m_Flags(userDataString ? (uint8_t)FLAG_USER_DATA_STRING : 0)
+ {
+#if VMA_STATS_STRING_ENABLED
+ m_CreationFrameIndex = currentFrameIndex;
+ m_BufferImageUsage = 0;
+#endif
+ }
+
+ ~VmaAllocation_T()
+ {
+ VMA_ASSERT((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) == 0 && "Allocation was not unmapped before destruction.");
+
+ // Check if owned string was freed.
+ VMA_ASSERT(m_pUserData == VMA_NULL);
+ }
+
+ void InitBlockAllocation(
+ VmaPool hPool,
+ VmaDeviceMemoryBlock* block,
+ VkDeviceSize offset,
+ VkDeviceSize alignment,
+ VkDeviceSize size,
+ VmaSuballocationType suballocationType,
+ bool mapped,
+ bool canBecomeLost)
+ {
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
+ VMA_ASSERT(block != VMA_NULL);
+ m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
+ m_Alignment = alignment;
+ m_Size = size;
+ m_MapCount = mapped ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;
+ m_SuballocationType = (uint8_t)suballocationType;
+ m_BlockAllocation.m_hPool = hPool;
+ m_BlockAllocation.m_Block = block;
+ m_BlockAllocation.m_Offset = offset;
+ m_BlockAllocation.m_CanBecomeLost = canBecomeLost;
+ }
+
+ void InitLost()
+ {
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
+ VMA_ASSERT(m_LastUseFrameIndex.load() == VMA_FRAME_INDEX_LOST);
+ m_Type = (uint8_t)ALLOCATION_TYPE_BLOCK;
+ m_BlockAllocation.m_hPool = VK_NULL_HANDLE;
+ m_BlockAllocation.m_Block = VMA_NULL;
+ m_BlockAllocation.m_Offset = 0;
+ m_BlockAllocation.m_CanBecomeLost = true;
+ }
+
+ void ChangeBlockAllocation(
+ VmaAllocator hAllocator,
+ VmaDeviceMemoryBlock* block,
+ VkDeviceSize offset);
+
+ void ChangeSize(VkDeviceSize newSize);
+ void ChangeOffset(VkDeviceSize newOffset);
+
+ // pMappedData not null means allocation is created with MAPPED flag.
+ void InitDedicatedAllocation(
+ uint32_t memoryTypeIndex,
+ VkDeviceMemory hMemory,
+ VmaSuballocationType suballocationType,
+ void* pMappedData,
+ VkDeviceSize size)
+ {
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_NONE);
+ VMA_ASSERT(hMemory != VK_NULL_HANDLE);
+ m_Type = (uint8_t)ALLOCATION_TYPE_DEDICATED;
+ m_Alignment = 0;
+ m_Size = size;
+ m_SuballocationType = (uint8_t)suballocationType;
+ m_MapCount = (pMappedData != VMA_NULL) ? MAP_COUNT_FLAG_PERSISTENT_MAP : 0;
+ m_DedicatedAllocation.m_MemoryTypeIndex = memoryTypeIndex;
+ m_DedicatedAllocation.m_hMemory = hMemory;
+ m_DedicatedAllocation.m_pMappedData = pMappedData;
+ }
+
+ ALLOCATION_TYPE GetType() const { return (ALLOCATION_TYPE)m_Type; }
+ VkDeviceSize GetAlignment() const { return m_Alignment; }
+ VkDeviceSize GetSize() const { return m_Size; }
+ bool IsUserDataString() const { return (m_Flags & FLAG_USER_DATA_STRING) != 0; }
+ void* GetUserData() const { return m_pUserData; }
+ void SetUserData(VmaAllocator hAllocator, void* pUserData);
+ VmaSuballocationType GetSuballocationType() const { return (VmaSuballocationType)m_SuballocationType; }
+
+ VmaDeviceMemoryBlock* GetBlock() const
+ {
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+ return m_BlockAllocation.m_Block;
+ }
+ VkDeviceSize GetOffset() const;
+ VkDeviceMemory GetMemory() const;
+ uint32_t GetMemoryTypeIndex() const;
+ bool IsPersistentMap() const { return (m_MapCount & MAP_COUNT_FLAG_PERSISTENT_MAP) != 0; }
+ void* GetMappedData() const;
+ bool CanBecomeLost() const;
+ VmaPool GetPool() const;
+
+ uint32_t GetLastUseFrameIndex() const
+ {
+ return m_LastUseFrameIndex.load();
+ }
+ bool CompareExchangeLastUseFrameIndex(uint32_t& expected, uint32_t desired)
+ {
+ return m_LastUseFrameIndex.compare_exchange_weak(expected, desired);
+ }
+ /*
+ - If hAllocation.LastUseFrameIndex + frameInUseCount < allocator.CurrentFrameIndex,
+ makes it lost by setting LastUseFrameIndex = VMA_FRAME_INDEX_LOST and returns true.
+ - Else, returns false.
+
+ If hAllocation is already lost, assert - you should not call it then.
+ If hAllocation was not created with CAN_BECOME_LOST_BIT, assert.
+ */
+ bool MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
+
+ void DedicatedAllocCalcStatsInfo(VmaStatInfo& outInfo)
+ {
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_DEDICATED);
+ outInfo.blockCount = 1;
+ outInfo.allocationCount = 1;
+ outInfo.unusedRangeCount = 0;
+ outInfo.usedBytes = m_Size;
+ outInfo.unusedBytes = 0;
+ outInfo.allocationSizeMin = outInfo.allocationSizeMax = m_Size;
+ outInfo.unusedRangeSizeMin = UINT64_MAX;
+ outInfo.unusedRangeSizeMax = 0;
+ }
+
+ void BlockAllocMap();
+ void BlockAllocUnmap();
+ VkResult DedicatedAllocMap(VmaAllocator hAllocator, void** ppData);
+ void DedicatedAllocUnmap(VmaAllocator hAllocator);
+
+#if VMA_STATS_STRING_ENABLED
+ uint32_t GetCreationFrameIndex() const { return m_CreationFrameIndex; }
+ uint32_t GetBufferImageUsage() const { return m_BufferImageUsage; }
+
+ void InitBufferImageUsage(uint32_t bufferImageUsage)
+ {
+ VMA_ASSERT(m_BufferImageUsage == 0);
+ m_BufferImageUsage = bufferImageUsage;
+ }
+
+ void PrintParameters(class VmaJsonWriter& json) const;
+#endif
+
+private:
+ VkDeviceSize m_Alignment;
+ VkDeviceSize m_Size;
+ void* m_pUserData;
+ VMA_ATOMIC_UINT32 m_LastUseFrameIndex;
+ uint8_t m_Type; // ALLOCATION_TYPE
+ uint8_t m_SuballocationType; // VmaSuballocationType
+ // Bit 0x80 is set when allocation was created with VMA_ALLOCATION_CREATE_MAPPED_BIT.
+ // Bits with mask 0x7F are reference counter for vmaMapMemory()/vmaUnmapMemory().
+ uint8_t m_MapCount;
+ uint8_t m_Flags; // enum FLAGS
+
+ // Allocation out of VmaDeviceMemoryBlock.
+ struct BlockAllocation
+ {
+ VmaPool m_hPool; // Null if belongs to general memory.
+ VmaDeviceMemoryBlock* m_Block;
+ VkDeviceSize m_Offset;
+ bool m_CanBecomeLost;
+ };
+
+ // Allocation for an object that has its own private VkDeviceMemory.
+ struct DedicatedAllocation
+ {
+ uint32_t m_MemoryTypeIndex;
+ VkDeviceMemory m_hMemory;
+ void* m_pMappedData; // Not null means memory is mapped.
+ };
+
+ union
+ {
+ // Allocation out of VmaDeviceMemoryBlock.
+ BlockAllocation m_BlockAllocation;
+ // Allocation for an object that has its own private VkDeviceMemory.
+ DedicatedAllocation m_DedicatedAllocation;
+ };
+
+#if VMA_STATS_STRING_ENABLED
+ uint32_t m_CreationFrameIndex;
+ uint32_t m_BufferImageUsage; // 0 if unknown.
+#endif
+
+ void FreeUserDataString(VmaAllocator hAllocator);
+};
+
+/*
+Represents a region of VmaDeviceMemoryBlock that is either assigned and returned as
+allocated memory block or free.
+*/
+struct VmaSuballocation
+{
+ VkDeviceSize offset;
+ VkDeviceSize size;
+ VmaAllocation hAllocation;
+ VmaSuballocationType type;
+};
+
+// Comparator for offsets.
+struct VmaSuballocationOffsetLess
+{
+ bool operator()(const VmaSuballocation& lhs, const VmaSuballocation& rhs) const
+ {
+ return lhs.offset < rhs.offset;
+ }
+};
+struct VmaSuballocationOffsetGreater
+{
+ bool operator()(const VmaSuballocation& lhs, const VmaSuballocation& rhs) const
+ {
+ return lhs.offset > rhs.offset;
+ }
+};
+
+typedef VmaList< VmaSuballocation, VmaStlAllocator<VmaSuballocation> > VmaSuballocationList;
+
+// Cost of one additional allocation lost, as equivalent in bytes.
+static const VkDeviceSize VMA_LOST_ALLOCATION_COST = 1048576;
+
+/*
+Parameters of planned allocation inside a VmaDeviceMemoryBlock.
+
+If canMakeOtherLost was false:
+- item points to a FREE suballocation.
+- itemsToMakeLostCount is 0.
+
+If canMakeOtherLost was true:
+- item points to first of sequence of suballocations, which are either FREE,
+ or point to VmaAllocations that can become lost.
+- itemsToMakeLostCount is the number of VmaAllocations that need to be made lost for
+ the requested allocation to succeed.
+*/
+struct VmaAllocationRequest
+{
+ VkDeviceSize offset;
+ VkDeviceSize sumFreeSize; // Sum size of free items that overlap with proposed allocation.
+ VkDeviceSize sumItemSize; // Sum size of items to make lost that overlap with proposed allocation.
+ VmaSuballocationList::iterator item;
+ size_t itemsToMakeLostCount;
+ void* customData;
+
+ VkDeviceSize CalcCost() const
+ {
+ return sumItemSize + itemsToMakeLostCount * VMA_LOST_ALLOCATION_COST;
+ }
+};
+
+/*
+Data structure used for bookkeeping of allocations and unused ranges of memory
+in a single VkDeviceMemory block.
+*/
+class VmaBlockMetadata
+{
+public:
+ VmaBlockMetadata(VmaAllocator hAllocator);
+ virtual ~VmaBlockMetadata() { }
+ virtual void Init(VkDeviceSize size) { m_Size = size; }
+
+ // Validates all data structures inside this object. If not valid, returns false.
+ virtual bool Validate() const = 0;
+ VkDeviceSize GetSize() const { return m_Size; }
+ virtual size_t GetAllocationCount() const = 0;
+ virtual VkDeviceSize GetSumFreeSize() const = 0;
+ virtual VkDeviceSize GetUnusedRangeSizeMax() const = 0;
+ // Returns true if this block is empty - contains only single free suballocation.
+ virtual bool IsEmpty() const = 0;
+
+ virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const = 0;
+ // Shouldn't modify blockCount.
+ virtual void AddPoolStats(VmaPoolStats& inoutStats) const = 0;
+
+#if VMA_STATS_STRING_ENABLED
+ virtual void PrintDetailedMap(class VmaJsonWriter& json) const = 0;
+#endif
+
+ // Tries to find a place for suballocation with given parameters inside this block.
+ // If succeeded, fills pAllocationRequest and returns true.
+ // If failed, returns false.
+ virtual bool CreateAllocationRequest(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+ // Always one of VMA_ALLOCATION_CREATE_STRATEGY_* or VMA_ALLOCATION_INTERNAL_STRATEGY_* flags.
+ uint32_t strategy,
+ VmaAllocationRequest* pAllocationRequest) = 0;
+
+ virtual bool MakeRequestedAllocationsLost(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VmaAllocationRequest* pAllocationRequest) = 0;
+
+ virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) = 0;
+
+ virtual VkResult CheckCorruption(const void* pBlockData) = 0;
+
+ // Makes actual allocation based on request. Request must already be checked and valid.
+ virtual void Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType type,
+ VkDeviceSize allocSize,
+ bool upperAddress,
+ VmaAllocation hAllocation) = 0;
+
+ // Frees suballocation assigned to given memory region.
+ virtual void Free(const VmaAllocation allocation) = 0;
+ virtual void FreeAtOffset(VkDeviceSize offset) = 0;
+
+ // Tries to resize (grow or shrink) space for given allocation, in place.
+ virtual bool ResizeAllocation(const VmaAllocation /*alloc*/, VkDeviceSize /*newSize*/) { return false; }
+
+protected:
+ const VkAllocationCallbacks* GetAllocationCallbacks() const { return m_pAllocationCallbacks; }
+
+#if VMA_STATS_STRING_ENABLED
+ void PrintDetailedMap_Begin(class VmaJsonWriter& json,
+ VkDeviceSize unusedBytes,
+ size_t allocationCount,
+ size_t unusedRangeCount) const;
+ void PrintDetailedMap_Allocation(class VmaJsonWriter& json,
+ VkDeviceSize offset,
+ VmaAllocation hAllocation) const;
+ void PrintDetailedMap_UnusedRange(class VmaJsonWriter& json,
+ VkDeviceSize offset,
+ VkDeviceSize size) const;
+ void PrintDetailedMap_End(class VmaJsonWriter& json) const;
+#endif
+
+private:
+ VkDeviceSize m_Size;
+ const VkAllocationCallbacks* m_pAllocationCallbacks;
+};
+
+#define VMA_VALIDATE(cond) do { if(!(cond)) { \
+ VMA_ASSERT(0 && "Validation failed: " #cond); \
+ return false; \
+ } } while(false)
+
+class VmaBlockMetadata_Generic : public VmaBlockMetadata
+{
+ VMA_CLASS_NO_COPY(VmaBlockMetadata_Generic)
+public:
+ VmaBlockMetadata_Generic(VmaAllocator hAllocator);
+ virtual ~VmaBlockMetadata_Generic();
+ virtual void Init(VkDeviceSize size);
+
+ virtual bool Validate() const;
+ virtual size_t GetAllocationCount() const { return m_Suballocations.size() - m_FreeCount; }
+ virtual VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize; }
+ virtual VkDeviceSize GetUnusedRangeSizeMax() const;
+ virtual bool IsEmpty() const;
+
+ virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const;
+ virtual void AddPoolStats(VmaPoolStats& inoutStats) const;
+
+#if VMA_STATS_STRING_ENABLED
+ virtual void PrintDetailedMap(class VmaJsonWriter& json) const;
+#endif
+
+ virtual bool CreateAllocationRequest(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+ uint32_t strategy,
+ VmaAllocationRequest* pAllocationRequest);
+
+ virtual bool MakeRequestedAllocationsLost(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VmaAllocationRequest* pAllocationRequest);
+
+ virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
+
+ virtual VkResult CheckCorruption(const void* pBlockData);
+
+ virtual void Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType type,
+ VkDeviceSize allocSize,
+ bool upperAddress,
+ VmaAllocation hAllocation);
+
+ virtual void Free(const VmaAllocation allocation);
+ virtual void FreeAtOffset(VkDeviceSize offset);
+
+ virtual bool ResizeAllocation(const VmaAllocation alloc, VkDeviceSize newSize);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // For defragmentation
+
+ bool IsBufferImageGranularityConflictPossible(
+ VkDeviceSize bufferImageGranularity,
+ VmaSuballocationType& inOutPrevSuballocType) const;
+
+private:
+ friend class VmaDefragmentationAlgorithm_Generic;
+ friend class VmaDefragmentationAlgorithm_Fast;
+
+ uint32_t m_FreeCount;
+ VkDeviceSize m_SumFreeSize;
+ VmaSuballocationList m_Suballocations;
+ // Suballocations that are free and have size greater than certain threshold.
+ // Sorted by size, ascending.
+ VmaVector< VmaSuballocationList::iterator, VmaStlAllocator< VmaSuballocationList::iterator > > m_FreeSuballocationsBySize;
+
+ bool ValidateFreeSuballocationList() const;
+
+ // Checks if requested suballocation with given parameters can be placed in given pFreeSuballocItem.
+ // If yes, fills pOffset and returns true. If no, returns false.
+ bool CheckAllocation(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ VmaSuballocationType allocType,
+ VmaSuballocationList::const_iterator suballocItem,
+ bool canMakeOtherLost,
+ VkDeviceSize* pOffset,
+ size_t* itemsToMakeLostCount,
+ VkDeviceSize* pSumFreeSize,
+ VkDeviceSize* pSumItemSize) const;
+ // Given free suballocation, it merges it with following one, which must also be free.
+ void MergeFreeWithNext(VmaSuballocationList::iterator item);
+ // Releases given suballocation, making it free.
+ // Merges it with adjacent free suballocations if applicable.
+ // Returns iterator to new free suballocation at this place.
+ VmaSuballocationList::iterator FreeSuballocation(VmaSuballocationList::iterator suballocItem);
+ // Given free suballocation, it inserts it into sorted list of
+ // m_FreeSuballocationsBySize if it's suitable.
+ void RegisterFreeSuballocation(VmaSuballocationList::iterator item);
+ // Given free suballocation, it removes it from sorted list of
+ // m_FreeSuballocationsBySize if it's suitable.
+ void UnregisterFreeSuballocation(VmaSuballocationList::iterator item);
+};
+
+/*
+Allocations and their references in internal data structure look like this:
+
+if(m_2ndVectorMode == SECOND_VECTOR_EMPTY):
+
+ 0 +-------+
+ | |
+ | |
+ | |
+ +-------+
+ | Alloc | 1st[m_1stNullItemsBeginCount]
+ +-------+
+ | Alloc | 1st[m_1stNullItemsBeginCount + 1]
+ +-------+
+ | ... |
+ +-------+
+ | Alloc | 1st[1st.size() - 1]
+ +-------+
+ | |
+ | |
+ | |
+GetSize() +-------+
+
+if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER):
+
+ 0 +-------+
+ | Alloc | 2nd[0]
+ +-------+
+ | Alloc | 2nd[1]
+ +-------+
+ | ... |
+ +-------+
+ | Alloc | 2nd[2nd.size() - 1]
+ +-------+
+ | |
+ | |
+ | |
+ +-------+
+ | Alloc | 1st[m_1stNullItemsBeginCount]
+ +-------+
+ | Alloc | 1st[m_1stNullItemsBeginCount + 1]
+ +-------+
+ | ... |
+ +-------+
+ | Alloc | 1st[1st.size() - 1]
+ +-------+
+ | |
+GetSize() +-------+
+
+if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK):
+
+ 0 +-------+
+ | |
+ | |
+ | |
+ +-------+
+ | Alloc | 1st[m_1stNullItemsBeginCount]
+ +-------+
+ | Alloc | 1st[m_1stNullItemsBeginCount + 1]
+ +-------+
+ | ... |
+ +-------+
+ | Alloc | 1st[1st.size() - 1]
+ +-------+
+ | |
+ | |
+ | |
+ +-------+
+ | Alloc | 2nd[2nd.size() - 1]
+ +-------+
+ | ... |
+ +-------+
+ | Alloc | 2nd[1]
+ +-------+
+ | Alloc | 2nd[0]
+GetSize() +-------+
+
+*/
+class VmaBlockMetadata_Linear : public VmaBlockMetadata
+{
+ VMA_CLASS_NO_COPY(VmaBlockMetadata_Linear)
+public:
+ VmaBlockMetadata_Linear(VmaAllocator hAllocator);
+ virtual ~VmaBlockMetadata_Linear();
+ virtual void Init(VkDeviceSize size);
+
+ virtual bool Validate() const;
+ virtual size_t GetAllocationCount() const;
+ virtual VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize; }
+ virtual VkDeviceSize GetUnusedRangeSizeMax() const;
+ virtual bool IsEmpty() const { return GetAllocationCount() == 0; }
+
+ virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const;
+ virtual void AddPoolStats(VmaPoolStats& inoutStats) const;
+
+#if VMA_STATS_STRING_ENABLED
+ virtual void PrintDetailedMap(class VmaJsonWriter& json) const;
+#endif
+
+ virtual bool CreateAllocationRequest(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+ uint32_t strategy,
+ VmaAllocationRequest* pAllocationRequest);
+
+ virtual bool MakeRequestedAllocationsLost(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VmaAllocationRequest* pAllocationRequest);
+
+ virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
+
+ virtual VkResult CheckCorruption(const void* pBlockData);
+
+ virtual void Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType type,
+ VkDeviceSize allocSize,
+ bool upperAddress,
+ VmaAllocation hAllocation);
+
+ virtual void Free(const VmaAllocation allocation);
+ virtual void FreeAtOffset(VkDeviceSize offset);
+
+private:
+ /*
+ There are two suballocation vectors, used in ping-pong way.
+ The one with index m_1stVectorIndex is called 1st.
+ The one with index (m_1stVectorIndex ^ 1) is called 2nd.
+ 2nd can be non-empty only when 1st is not empty.
+ When 2nd is not empty, m_2ndVectorMode indicates its mode of operation.
+ */
+ typedef VmaVector< VmaSuballocation, VmaStlAllocator<VmaSuballocation> > SuballocationVectorType;
+
+ enum SECOND_VECTOR_MODE
+ {
+ SECOND_VECTOR_EMPTY,
+ /*
+ Suballocations in 2nd vector are created later than the ones in 1st, but they
+ all have smaller offset.
+ */
+ SECOND_VECTOR_RING_BUFFER,
+ /*
+ Suballocations in 2nd vector are upper side of double stack.
+ They all have offsets higher than those in 1st vector.
+ Top of this stack means smaller offsets, but higher indices in this vector.
+ */
+ SECOND_VECTOR_DOUBLE_STACK,
+ };
+
+ VkDeviceSize m_SumFreeSize;
+ SuballocationVectorType m_Suballocations0, m_Suballocations1;
+ uint32_t m_1stVectorIndex;
+ SECOND_VECTOR_MODE m_2ndVectorMode;
+
+ SuballocationVectorType& AccessSuballocations1st() { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
+ SuballocationVectorType& AccessSuballocations2nd() { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
+ const SuballocationVectorType& AccessSuballocations1st() const { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; }
+ const SuballocationVectorType& AccessSuballocations2nd() const { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; }
+
+ // Number of items in 1st vector with hAllocation = null at the beginning.
+ size_t m_1stNullItemsBeginCount;
+ // Number of other items in 1st vector with hAllocation = null somewhere in the middle.
+ size_t m_1stNullItemsMiddleCount;
+ // Number of items in 2nd vector with hAllocation = null.
+ size_t m_2ndNullItemsCount;
+
+ bool ShouldCompact1st() const;
+ void CleanupAfterFree();
+};
+
+/*
+- GetSize() is the original size of allocated memory block.
+- m_UsableSize is this size aligned down to a power of two.
+ All allocations and calculations happen relative to m_UsableSize.
+- GetUnusableSize() is the difference between them.
+ It is repoted as separate, unused range, not available for allocations.
+
+Node at level 0 has size = m_UsableSize.
+Each next level contains nodes with size 2 times smaller than current level.
+m_LevelCount is the maximum number of levels to use in the current object.
+*/
+class VmaBlockMetadata_Buddy : public VmaBlockMetadata
+{
+ VMA_CLASS_NO_COPY(VmaBlockMetadata_Buddy)
+public:
+ VmaBlockMetadata_Buddy(VmaAllocator hAllocator);
+ virtual ~VmaBlockMetadata_Buddy();
+ virtual void Init(VkDeviceSize size);
+
+ virtual bool Validate() const;
+ virtual size_t GetAllocationCount() const { return m_AllocationCount; }
+ virtual VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize + GetUnusableSize(); }
+ virtual VkDeviceSize GetUnusedRangeSizeMax() const;
+ virtual bool IsEmpty() const { return m_Root->type == Node::TYPE_FREE; }
+
+ virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const;
+ virtual void AddPoolStats(VmaPoolStats& inoutStats) const;
+
+#if VMA_STATS_STRING_ENABLED
+ virtual void PrintDetailedMap(class VmaJsonWriter& json) const;
+#endif
+
+ virtual bool CreateAllocationRequest(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+ uint32_t strategy,
+ VmaAllocationRequest* pAllocationRequest);
+
+ virtual bool MakeRequestedAllocationsLost(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VmaAllocationRequest* pAllocationRequest);
+
+ virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
+
+ virtual VkResult CheckCorruption(const void* /*pBlockData*/) { return VK_ERROR_FEATURE_NOT_PRESENT; }
+
+ virtual void Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType type,
+ VkDeviceSize allocSize,
+ bool upperAddress,
+ VmaAllocation hAllocation);
+
+ virtual void Free(const VmaAllocation allocation) { FreeAtOffset(allocation, allocation->GetOffset()); }
+ virtual void FreeAtOffset(VkDeviceSize offset) { FreeAtOffset(VMA_NULL, offset); }
+
+private:
+ static const VkDeviceSize MIN_NODE_SIZE = 32;
+ static const size_t MAX_LEVELS = 30;
+
+ struct ValidationContext
+ {
+ size_t calculatedAllocationCount;
+ size_t calculatedFreeCount;
+ VkDeviceSize calculatedSumFreeSize;
+
+ ValidationContext() :
+ calculatedAllocationCount(0),
+ calculatedFreeCount(0),
+ calculatedSumFreeSize(0) { }
+ };
+
+ struct Node
+ {
+ VkDeviceSize offset;
+ enum TYPE
+ {
+ TYPE_FREE,
+ TYPE_ALLOCATION,
+ TYPE_SPLIT,
+ TYPE_COUNT
+ } type;
+ Node* parent;
+ Node* buddy;
+
+ union
+ {
+ struct
+ {
+ Node* prev;
+ Node* next;
+ } free;
+ struct
+ {
+ VmaAllocation alloc;
+ } allocation;
+ struct
+ {
+ Node* leftChild;
+ } split;
+ };
+ };
+
+ // Size of the memory block aligned down to a power of two.
+ VkDeviceSize m_UsableSize;
+ uint32_t m_LevelCount;
+
+ Node* m_Root;
+ struct {
+ Node* front;
+ Node* back;
+ } m_FreeList[MAX_LEVELS];
+ // Number of nodes in the tree with type == TYPE_ALLOCATION.
+ size_t m_AllocationCount;
+ // Number of nodes in the tree with type == TYPE_FREE.
+ size_t m_FreeCount;
+ // This includes space wasted due to internal fragmentation. Doesn't include unusable size.
+ VkDeviceSize m_SumFreeSize;
+
+ VkDeviceSize GetUnusableSize() const { return GetSize() - m_UsableSize; }
+ void DeleteNode(Node* node);
+ bool ValidateNode(ValidationContext& ctx, const Node* parent, const Node* curr, uint32_t level, VkDeviceSize levelNodeSize) const;
+ uint32_t AllocSizeToLevel(VkDeviceSize allocSize) const;
+ inline VkDeviceSize LevelToNodeSize(uint32_t level) const { return m_UsableSize >> level; }
+ // Alloc passed just for validation. Can be null.
+ void FreeAtOffset(VmaAllocation alloc, VkDeviceSize offset);
+ void CalcAllocationStatInfoNode(VmaStatInfo& outInfo, const Node* node, VkDeviceSize levelNodeSize) const;
+ // Adds node to the front of FreeList at given level.
+ // node->type must be FREE.
+ // node->free.prev, next can be undefined.
+ void AddToFreeListFront(uint32_t level, Node* node);
+ // Removes node from FreeList at given level.
+ // node->type must be FREE.
+ // node->free.prev, next stay untouched.
+ void RemoveFromFreeList(uint32_t level, Node* node);
+
+#if VMA_STATS_STRING_ENABLED
+ void PrintDetailedMapNode(class VmaJsonWriter& json, const Node* node, VkDeviceSize levelNodeSize) const;
+#endif
+};
+
+/*
+Represents a single block of device memory (`VkDeviceMemory`) with all the
+data about its regions (aka suballocations, #VmaAllocation), assigned and free.
+
+Thread-safety: This class must be externally synchronized.
+*/
+class VmaDeviceMemoryBlock
+{
+ VMA_CLASS_NO_COPY(VmaDeviceMemoryBlock)
+public:
+ VmaBlockMetadata* m_pMetadata;
+
+ VmaDeviceMemoryBlock(VmaAllocator hAllocator);
+
+ ~VmaDeviceMemoryBlock()
+ {
+ VMA_ASSERT(m_MapCount == 0 && "VkDeviceMemory block is being destroyed while it is still mapped.");
+ VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
+ }
+
+ // Always call after construction.
+ void Init(
+ VmaAllocator hAllocator,
+ uint32_t newMemoryTypeIndex,
+ VkDeviceMemory newMemory,
+ VkDeviceSize newSize,
+ uint32_t id,
+ uint32_t algorithm);
+ // Always call before destruction.
+ void Destroy(VmaAllocator allocator);
+
+ VkDeviceMemory GetDeviceMemory() const { return m_hMemory; }
+ uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; }
+ uint32_t GetId() const { return m_Id; }
+ void* GetMappedData() const { return m_pMappedData; }
+
+ // Validates all data structures inside this object. If not valid, returns false.
+ bool Validate() const;
+
+ VkResult CheckCorruption(VmaAllocator hAllocator);
+
+ // ppData can be null.
+ VkResult Map(VmaAllocator hAllocator, uint32_t count, void** ppData);
+ void Unmap(VmaAllocator hAllocator, uint32_t count);
+
+ VkResult WriteMagicValueAroundAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
+ VkResult ValidateMagicValueAroundAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize);
+
+ VkResult BindBufferMemory(
+ const VmaAllocator hAllocator,
+ const VmaAllocation hAllocation,
+ VkBuffer hBuffer);
+ VkResult BindImageMemory(
+ const VmaAllocator hAllocator,
+ const VmaAllocation hAllocation,
+ VkImage hImage);
+
+private:
+ uint32_t m_MemoryTypeIndex;
+ uint32_t m_Id;
+ VkDeviceMemory m_hMemory;
+
+ /*
+ Protects access to m_hMemory so it's not used by multiple threads simultaneously, e.g. vkMapMemory, vkBindBufferMemory.
+ Also protects m_MapCount, m_pMappedData.
+ Allocations, deallocations, any change in m_pMetadata is protected by parent's VmaBlockVector::m_Mutex.
+ */
+ VMA_MUTEX m_Mutex;
+ uint32_t m_MapCount;
+ void* m_pMappedData;
+};
+
+struct VmaPointerLess
+{
+ bool operator()(const void* lhs, const void* rhs) const
+ {
+ return lhs < rhs;
+ }
+};
+
+struct VmaDefragmentationMove
+{
+ size_t srcBlockIndex;
+ size_t dstBlockIndex;
+ VkDeviceSize srcOffset;
+ VkDeviceSize dstOffset;
+ VkDeviceSize size;
+};
+
+class VmaDefragmentationAlgorithm;
+
+/*
+Sequence of VmaDeviceMemoryBlock. Represents memory blocks allocated for a specific
+Vulkan memory type.
+
+Synchronized internally with a mutex.
+*/
+struct VmaBlockVector
+{
+ VMA_CLASS_NO_COPY(VmaBlockVector)
+public:
+ VmaBlockVector(
+ VmaAllocator hAllocator,
+ uint32_t memoryTypeIndex,
+ VkDeviceSize preferredBlockSize,
+ size_t minBlockCount,
+ size_t maxBlockCount,
+ VkDeviceSize bufferImageGranularity,
+ uint32_t frameInUseCount,
+ bool isCustomPool,
+ bool explicitBlockSize,
+ uint32_t algorithm);
+ ~VmaBlockVector();
+
+ VkResult CreateMinBlocks();
+
+ uint32_t GetMemoryTypeIndex() const { return m_MemoryTypeIndex; }
+ VkDeviceSize GetPreferredBlockSize() const { return m_PreferredBlockSize; }
+ VkDeviceSize GetBufferImageGranularity() const { return m_BufferImageGranularity; }
+ uint32_t GetFrameInUseCount() const { return m_FrameInUseCount; }
+ uint32_t GetAlgorithm() const { return m_Algorithm; }
+
+ void GetPoolStats(VmaPoolStats* pStats);
+
+ bool IsEmpty() const { return m_Blocks.empty(); }
+ bool IsCorruptionDetectionEnabled() const;
+
+ VkResult Allocate(
+ VmaPool hCurrentPool,
+ uint32_t currentFrameIndex,
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaSuballocationType suballocType,
+ size_t allocationCount,
+ VmaAllocation* pAllocations);
+
+ void Free(
+ VmaAllocation hAllocation);
+
+ // Adds statistics of this BlockVector to pStats.
+ void AddStats(VmaStats* pStats);
+
+#if VMA_STATS_STRING_ENABLED
+ void PrintDetailedMap(class VmaJsonWriter& json);
+#endif
+
+ void MakePoolAllocationsLost(
+ uint32_t currentFrameIndex,
+ size_t* pLostAllocationCount);
+ VkResult CheckCorruption();
+
+ // Saves results in pCtx->res.
+ void Defragment(
+ class VmaBlockVectorDefragmentationContext* pCtx,
+ VmaDefragmentationStats* pStats,
+ VkDeviceSize& maxCpuBytesToMove, uint32_t& maxCpuAllocationsToMove,
+ VkDeviceSize& maxGpuBytesToMove, uint32_t& maxGpuAllocationsToMove,
+ VkCommandBuffer commandBuffer);
+ void DefragmentationEnd(
+ class VmaBlockVectorDefragmentationContext* pCtx,
+ VmaDefragmentationStats* pStats);
+
+ ////////////////////////////////////////////////////////////////////////////////
+ // To be used only while the m_Mutex is locked. Used during defragmentation.
+
+ size_t GetBlockCount() const { return m_Blocks.size(); }
+ VmaDeviceMemoryBlock* GetBlock(size_t index) const { return m_Blocks[index]; }
+ size_t CalcAllocationCount() const;
+ bool IsBufferImageGranularityConflictPossible() const;
+
+private:
+ friend class VmaDefragmentationAlgorithm_Generic;
+
+ const VmaAllocator m_hAllocator;
+ const uint32_t m_MemoryTypeIndex;
+ const VkDeviceSize m_PreferredBlockSize;
+ const size_t m_MinBlockCount;
+ const size_t m_MaxBlockCount;
+ const VkDeviceSize m_BufferImageGranularity;
+ const uint32_t m_FrameInUseCount;
+ const bool m_IsCustomPool;
+ const bool m_ExplicitBlockSize;
+ const uint32_t m_Algorithm;
+ /* There can be at most one allocation that is completely empty - a
+ hysteresis to avoid pessimistic case of alternating creation and destruction
+ of a VkDeviceMemory. */
+ bool m_HasEmptyBlock;
+ VMA_RW_MUTEX m_Mutex;
+ // Incrementally sorted by sumFreeSize, ascending.
+ VmaVector< VmaDeviceMemoryBlock*, VmaStlAllocator<VmaDeviceMemoryBlock*> > m_Blocks;
+ uint32_t m_NextBlockId;
+
+ VkDeviceSize CalcMaxBlockSize() const;
+
+ // Finds and removes given block from vector.
+ void Remove(VmaDeviceMemoryBlock* pBlock);
+
+ // Performs single step in sorting m_Blocks. They may not be fully sorted
+ // after this call.
+ void IncrementallySortBlocks();
+
+ VkResult AllocatePage(
+ VmaPool hCurrentPool,
+ uint32_t currentFrameIndex,
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaSuballocationType suballocType,
+ VmaAllocation* pAllocation);
+
+ // To be used only without CAN_MAKE_OTHER_LOST flag.
+ VkResult AllocateFromBlock(
+ VmaDeviceMemoryBlock* pBlock,
+ VmaPool hCurrentPool,
+ uint32_t currentFrameIndex,
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ VmaAllocationCreateFlags allocFlags,
+ void* pUserData,
+ VmaSuballocationType suballocType,
+ uint32_t strategy,
+ VmaAllocation* pAllocation);
+
+ VkResult CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex);
+
+ // Saves result to pCtx->res.
+ void ApplyDefragmentationMovesCpu(
+ class VmaBlockVectorDefragmentationContext* pDefragCtx,
+ const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves);
+ // Saves result to pCtx->res.
+ void ApplyDefragmentationMovesGpu(
+ class VmaBlockVectorDefragmentationContext* pDefragCtx,
+ const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkCommandBuffer commandBuffer);
+
+ /*
+ Used during defragmentation. pDefragmentationStats is optional. It's in/out
+ - updated with new data.
+ */
+ void FreeEmptyBlocks(VmaDefragmentationStats* pDefragmentationStats);
+};
+
+struct VmaPool_T
+{
+ VMA_CLASS_NO_COPY(VmaPool_T)
+public:
+ VmaBlockVector m_BlockVector;
+
+ VmaPool_T(
+ VmaAllocator hAllocator,
+ const VmaPoolCreateInfo& createInfo,
+ VkDeviceSize preferredBlockSize);
+ ~VmaPool_T();
+
+ uint32_t GetId() const { return m_Id; }
+ void SetId(uint32_t id) { VMA_ASSERT(m_Id == 0); m_Id = id; }
+
+#if VMA_STATS_STRING_ENABLED
+ //void PrintDetailedMap(class VmaStringBuilder& sb);
+#endif
+
+private:
+ uint32_t m_Id;
+};
+
+/*
+Performs defragmentation:
+
+- Updates `pBlockVector->m_pMetadata`.
+- Updates allocations by calling ChangeBlockAllocation() or ChangeOffset().
+- Does not move actual data, only returns requested moves as `moves`.
+*/
+class VmaDefragmentationAlgorithm
+{
+ VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm)
+public:
+ VmaDefragmentationAlgorithm(
+ VmaAllocator hAllocator,
+ VmaBlockVector* pBlockVector,
+ uint32_t currentFrameIndex) :
+ m_hAllocator(hAllocator),
+ m_pBlockVector(pBlockVector),
+ m_CurrentFrameIndex(currentFrameIndex)
+ {
+ }
+ virtual ~VmaDefragmentationAlgorithm()
+ {
+ }
+
+ virtual void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) = 0;
+ virtual void AddAll() = 0;
+
+ virtual VkResult Defragment(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove) = 0;
+
+ virtual VkDeviceSize GetBytesMoved() const = 0;
+ virtual uint32_t GetAllocationsMoved() const = 0;
+
+protected:
+ VmaAllocator const m_hAllocator;
+ VmaBlockVector* const m_pBlockVector;
+ const uint32_t m_CurrentFrameIndex;
+
+ struct AllocationInfo
+ {
+ VmaAllocation m_hAllocation;
+ VkBool32* m_pChanged;
+
+ AllocationInfo() :
+ m_hAllocation(VK_NULL_HANDLE),
+ m_pChanged(VMA_NULL)
+ {
+ }
+ AllocationInfo(VmaAllocation hAlloc, VkBool32* pChanged) :
+ m_hAllocation(hAlloc),
+ m_pChanged(pChanged)
+ {
+ }
+ };
+};
+
+class VmaDefragmentationAlgorithm_Generic : public VmaDefragmentationAlgorithm
+{
+ VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm_Generic)
+public:
+ VmaDefragmentationAlgorithm_Generic(
+ VmaAllocator hAllocator,
+ VmaBlockVector* pBlockVector,
+ uint32_t currentFrameIndex,
+ bool overlappingMoveSupported);
+ virtual ~VmaDefragmentationAlgorithm_Generic();
+
+ virtual void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged);
+ virtual void AddAll() { m_AllAllocations = true; }
+
+ virtual VkResult Defragment(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove);
+
+ virtual VkDeviceSize GetBytesMoved() const { return m_BytesMoved; }
+ virtual uint32_t GetAllocationsMoved() const { return m_AllocationsMoved; }
+
+private:
+ uint32_t m_AllocationCount;
+ bool m_AllAllocations;
+
+ VkDeviceSize m_BytesMoved;
+ uint32_t m_AllocationsMoved;
+
+ struct AllocationInfoSizeGreater
+ {
+ bool operator()(const AllocationInfo& lhs, const AllocationInfo& rhs) const
+ {
+ return lhs.m_hAllocation->GetSize() > rhs.m_hAllocation->GetSize();
+ }
+ };
+
+ struct AllocationInfoOffsetGreater
+ {
+ bool operator()(const AllocationInfo& lhs, const AllocationInfo& rhs) const
+ {
+ return lhs.m_hAllocation->GetOffset() > rhs.m_hAllocation->GetOffset();
+ }
+ };
+
+ struct BlockInfo
+ {
+ size_t m_OriginalBlockIndex;
+ VmaDeviceMemoryBlock* m_pBlock;
+ bool m_HasNonMovableAllocations;
+ VmaVector< AllocationInfo, VmaStlAllocator<AllocationInfo> > m_Allocations;
+
+ BlockInfo(const VkAllocationCallbacks* pAllocationCallbacks) :
+ m_OriginalBlockIndex(SIZE_MAX),
+ m_pBlock(VMA_NULL),
+ m_HasNonMovableAllocations(true),
+ m_Allocations(pAllocationCallbacks)
+ {
+ }
+
+ void CalcHasNonMovableAllocations()
+ {
+ const size_t blockAllocCount = m_pBlock->m_pMetadata->GetAllocationCount();
+ const size_t defragmentAllocCount = m_Allocations.size();
+ m_HasNonMovableAllocations = blockAllocCount != defragmentAllocCount;
+ }
+
+ void SortAllocationsBySizeDescending()
+ {
+ VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoSizeGreater());
+ }
+
+ void SortAllocationsByOffsetDescending()
+ {
+ VMA_SORT(m_Allocations.begin(), m_Allocations.end(), AllocationInfoOffsetGreater());
+ }
+ };
+
+ struct BlockPointerLess
+ {
+ bool operator()(const BlockInfo* pLhsBlockInfo, const VmaDeviceMemoryBlock* pRhsBlock) const
+ {
+ return pLhsBlockInfo->m_pBlock < pRhsBlock;
+ }
+ bool operator()(const BlockInfo* pLhsBlockInfo, const BlockInfo* pRhsBlockInfo) const
+ {
+ return pLhsBlockInfo->m_pBlock < pRhsBlockInfo->m_pBlock;
+ }
+ };
+
+ // 1. Blocks with some non-movable allocations go first.
+ // 2. Blocks with smaller sumFreeSize go first.
+ struct BlockInfoCompareMoveDestination
+ {
+ bool operator()(const BlockInfo* pLhsBlockInfo, const BlockInfo* pRhsBlockInfo) const
+ {
+ if(pLhsBlockInfo->m_HasNonMovableAllocations && !pRhsBlockInfo->m_HasNonMovableAllocations)
+ {
+ return true;
+ }
+ if(!pLhsBlockInfo->m_HasNonMovableAllocations && pRhsBlockInfo->m_HasNonMovableAllocations)
+ {
+ return false;
+ }
+ if(pLhsBlockInfo->m_pBlock->m_pMetadata->GetSumFreeSize() < pRhsBlockInfo->m_pBlock->m_pMetadata->GetSumFreeSize())
+ {
+ return true;
+ }
+ return false;
+ }
+ };
+
+ typedef VmaVector< BlockInfo*, VmaStlAllocator<BlockInfo*> > BlockInfoVector;
+ BlockInfoVector m_Blocks;
+
+ VkResult DefragmentRound(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove);
+
+ size_t CalcBlocksWithNonMovableCount() const;
+
+ static bool MoveMakesSense(
+ size_t dstBlockIndex, VkDeviceSize dstOffset,
+ size_t srcBlockIndex, VkDeviceSize srcOffset);
+};
+
+class VmaDefragmentationAlgorithm_Fast : public VmaDefragmentationAlgorithm
+{
+ VMA_CLASS_NO_COPY(VmaDefragmentationAlgorithm_Fast)
+public:
+ VmaDefragmentationAlgorithm_Fast(
+ VmaAllocator hAllocator,
+ VmaBlockVector* pBlockVector,
+ uint32_t currentFrameIndex,
+ bool overlappingMoveSupported);
+ virtual ~VmaDefragmentationAlgorithm_Fast();
+
+ virtual void AddAllocation(VmaAllocation /*hAlloc*/, VkBool32* /*pChanged*/) { ++m_AllocationCount; }
+ virtual void AddAll() { m_AllAllocations = true; }
+
+ virtual VkResult Defragment(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove);
+
+ virtual VkDeviceSize GetBytesMoved() const { return m_BytesMoved; }
+ virtual uint32_t GetAllocationsMoved() const { return m_AllocationsMoved; }
+
+private:
+ struct BlockInfo
+ {
+ size_t origBlockIndex;
+ };
+
+ class FreeSpaceDatabase
+ {
+ public:
+ FreeSpaceDatabase()
+ {
+ FreeSpace s = {};
+ s.blockInfoIndex = SIZE_MAX;
+ for(size_t i = 0; i < MAX_COUNT; ++i)
+ {
+ m_FreeSpaces[i] = s;
+ }
+ }
+
+ void Register(size_t blockInfoIndex, VkDeviceSize offset, VkDeviceSize size)
+ {
+ if(size < VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ return;
+ }
+
+ // Find first invalid or the smallest structure.
+ size_t bestIndex = SIZE_MAX;
+ for(size_t i = 0; i < MAX_COUNT; ++i)
+ {
+ // Empty structure.
+ if(m_FreeSpaces[i].blockInfoIndex == SIZE_MAX)
+ {
+ bestIndex = i;
+ break;
+ }
+ if(m_FreeSpaces[i].size < size &&
+ (bestIndex == SIZE_MAX || m_FreeSpaces[bestIndex].size > m_FreeSpaces[i].size))
+ {
+ bestIndex = i;
+ }
+ }
+
+ if(bestIndex != SIZE_MAX)
+ {
+ m_FreeSpaces[bestIndex].blockInfoIndex = blockInfoIndex;
+ m_FreeSpaces[bestIndex].offset = offset;
+ m_FreeSpaces[bestIndex].size = size;
+ }
+ }
+
+ bool Fetch(VkDeviceSize alignment, VkDeviceSize size,
+ size_t& outBlockInfoIndex, VkDeviceSize& outDstOffset)
+ {
+ size_t bestIndex = SIZE_MAX;
+ VkDeviceSize bestFreeSpaceAfter = 0;
+ for(size_t i = 0; i < MAX_COUNT; ++i)
+ {
+ // Structure is valid.
+ if(m_FreeSpaces[i].blockInfoIndex != SIZE_MAX)
+ {
+ const VkDeviceSize dstOffset = VmaAlignUp(m_FreeSpaces[i].offset, alignment);
+ // Allocation fits into this structure.
+ if(dstOffset + size <= m_FreeSpaces[i].offset + m_FreeSpaces[i].size)
+ {
+ const VkDeviceSize freeSpaceAfter = (m_FreeSpaces[i].offset + m_FreeSpaces[i].size) -
+ (dstOffset + size);
+ if(bestIndex == SIZE_MAX || freeSpaceAfter > bestFreeSpaceAfter)
+ {
+ bestIndex = i;
+ bestFreeSpaceAfter = freeSpaceAfter;
+ }
+ }
+ }
+ }
+
+ if(bestIndex != SIZE_MAX)
+ {
+ outBlockInfoIndex = m_FreeSpaces[bestIndex].blockInfoIndex;
+ outDstOffset = VmaAlignUp(m_FreeSpaces[bestIndex].offset, alignment);
+
+ if(bestFreeSpaceAfter >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ // Leave this structure for remaining empty space.
+ const VkDeviceSize alignmentPlusSize = (outDstOffset - m_FreeSpaces[bestIndex].offset) + size;
+ m_FreeSpaces[bestIndex].offset += alignmentPlusSize;
+ m_FreeSpaces[bestIndex].size -= alignmentPlusSize;
+ }
+ else
+ {
+ // This structure becomes invalid.
+ m_FreeSpaces[bestIndex].blockInfoIndex = SIZE_MAX;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ private:
+ static const size_t MAX_COUNT = 4;
+
+ struct FreeSpace
+ {
+ size_t blockInfoIndex; // SIZE_MAX means this structure is invalid.
+ VkDeviceSize offset;
+ VkDeviceSize size;
+ } m_FreeSpaces[MAX_COUNT];
+ };
+
+ const bool m_OverlappingMoveSupported;
+
+ uint32_t m_AllocationCount;
+ bool m_AllAllocations;
+
+ VkDeviceSize m_BytesMoved;
+ uint32_t m_AllocationsMoved;
+
+ VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> > m_BlockInfos;
+
+ void PreprocessMetadata();
+ void PostprocessMetadata();
+ void InsertSuballoc(VmaBlockMetadata_Generic* pMetadata, const VmaSuballocation& suballoc);
+};
+
+struct VmaBlockDefragmentationContext
+{
+ enum BLOCK_FLAG
+ {
+ BLOCK_FLAG_USED = 0x00000001,
+ };
+ uint32_t flags;
+ VkBuffer hBuffer;
+
+ VmaBlockDefragmentationContext() :
+ flags(0),
+ hBuffer(VK_NULL_HANDLE)
+ {
+ }
+};
+
+class VmaBlockVectorDefragmentationContext
+{
+ VMA_CLASS_NO_COPY(VmaBlockVectorDefragmentationContext)
+public:
+ VkResult res;
+ bool mutexLocked;
+ VmaVector< VmaBlockDefragmentationContext, VmaStlAllocator<VmaBlockDefragmentationContext> > blockContexts;
+
+ VmaBlockVectorDefragmentationContext(
+ VmaAllocator hAllocator,
+ VmaPool hCustomPool, // Optional.
+ VmaBlockVector* pBlockVector,
+ uint32_t currFrameIndex,
+ uint32_t flags);
+ ~VmaBlockVectorDefragmentationContext();
+
+ VmaPool GetCustomPool() const { return m_hCustomPool; }
+ VmaBlockVector* GetBlockVector() const { return m_pBlockVector; }
+ VmaDefragmentationAlgorithm* GetAlgorithm() const { return m_pAlgorithm; }
+
+ void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged);
+ void AddAll() { m_AllAllocations = true; }
+
+ void Begin(bool overlappingMoveSupported);
+
+private:
+ const VmaAllocator m_hAllocator;
+ // Null if not from custom pool.
+ const VmaPool m_hCustomPool;
+ // Redundant, for convenience not to fetch from m_hCustomPool->m_BlockVector or m_hAllocator->m_pBlockVectors.
+ VmaBlockVector* const m_pBlockVector;
+ const uint32_t m_CurrFrameIndex;
+ /*const uint32_t m_AlgorithmFlags;*/
+ // Owner of this object.
+ VmaDefragmentationAlgorithm* m_pAlgorithm;
+
+ struct AllocInfo
+ {
+ VmaAllocation hAlloc;
+ VkBool32* pChanged;
+ };
+ // Used between constructor and Begin.
+ VmaVector< AllocInfo, VmaStlAllocator<AllocInfo> > m_Allocations;
+ bool m_AllAllocations;
+};
+
+struct VmaDefragmentationContext_T
+{
+private:
+ VMA_CLASS_NO_COPY(VmaDefragmentationContext_T)
+public:
+ VmaDefragmentationContext_T(
+ VmaAllocator hAllocator,
+ uint32_t currFrameIndex,
+ uint32_t flags,
+ VmaDefragmentationStats* pStats);
+ ~VmaDefragmentationContext_T();
+
+ void AddPools(uint32_t poolCount, VmaPool* pPools);
+ void AddAllocations(
+ uint32_t allocationCount,
+ VmaAllocation* pAllocations,
+ VkBool32* pAllocationsChanged);
+
+ /*
+ Returns:
+ - `VK_SUCCESS` if succeeded and object can be destroyed immediately.
+ - `VK_NOT_READY` if succeeded but the object must remain alive until vmaDefragmentationEnd().
+ - Negative value if error occured and object can be destroyed immediately.
+ */
+ VkResult Defragment(
+ VkDeviceSize maxCpuBytesToMove, uint32_t maxCpuAllocationsToMove,
+ VkDeviceSize maxGpuBytesToMove, uint32_t maxGpuAllocationsToMove,
+ VkCommandBuffer commandBuffer, VmaDefragmentationStats* pStats);
+
+private:
+ const VmaAllocator m_hAllocator;
+ const uint32_t m_CurrFrameIndex;
+ const uint32_t m_Flags;
+ VmaDefragmentationStats* const m_pStats;
+ // Owner of these objects.
+ VmaBlockVectorDefragmentationContext* m_DefaultPoolContexts[VK_MAX_MEMORY_TYPES];
+ // Owner of these objects.
+ VmaVector< VmaBlockVectorDefragmentationContext*, VmaStlAllocator<VmaBlockVectorDefragmentationContext*> > m_CustomPoolContexts;
+};
+
+#if VMA_RECORDING_ENABLED
+
+class VmaRecorder
+{
+public:
+ VmaRecorder();
+ VkResult Init(const VmaRecordSettings& settings, bool useMutex);
+ void WriteConfiguration(
+ const VkPhysicalDeviceProperties& devProps,
+ const VkPhysicalDeviceMemoryProperties& memProps,
+ bool dedicatedAllocationExtensionEnabled);
+ ~VmaRecorder();
+
+ void RecordCreateAllocator(uint32_t frameIndex);
+ void RecordDestroyAllocator(uint32_t frameIndex);
+ void RecordCreatePool(uint32_t frameIndex,
+ const VmaPoolCreateInfo& createInfo,
+ VmaPool pool);
+ void RecordDestroyPool(uint32_t frameIndex, VmaPool pool);
+ void RecordAllocateMemory(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaAllocation allocation);
+ void RecordAllocateMemoryPages(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ const VmaAllocationCreateInfo& createInfo,
+ uint64_t allocationCount,
+ const VmaAllocation* pAllocations);
+ void RecordAllocateMemoryForBuffer(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ bool requiresDedicatedAllocation,
+ bool prefersDedicatedAllocation,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaAllocation allocation);
+ void RecordAllocateMemoryForImage(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ bool requiresDedicatedAllocation,
+ bool prefersDedicatedAllocation,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaAllocation allocation);
+ void RecordFreeMemory(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordFreeMemoryPages(uint32_t frameIndex,
+ uint64_t allocationCount,
+ const VmaAllocation* pAllocations);
+ void RecordResizeAllocation(
+ uint32_t frameIndex,
+ VmaAllocation allocation,
+ VkDeviceSize newSize);
+ void RecordSetAllocationUserData(uint32_t frameIndex,
+ VmaAllocation allocation,
+ const void* pUserData);
+ void RecordCreateLostAllocation(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordMapMemory(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordUnmapMemory(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordFlushAllocation(uint32_t frameIndex,
+ VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
+ void RecordInvalidateAllocation(uint32_t frameIndex,
+ VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);
+ void RecordCreateBuffer(uint32_t frameIndex,
+ const VkBufferCreateInfo& bufCreateInfo,
+ const VmaAllocationCreateInfo& allocCreateInfo,
+ VmaAllocation allocation);
+ void RecordCreateImage(uint32_t frameIndex,
+ const VkImageCreateInfo& imageCreateInfo,
+ const VmaAllocationCreateInfo& allocCreateInfo,
+ VmaAllocation allocation);
+ void RecordDestroyBuffer(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordDestroyImage(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordTouchAllocation(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordGetAllocationInfo(uint32_t frameIndex,
+ VmaAllocation allocation);
+ void RecordMakePoolAllocationsLost(uint32_t frameIndex,
+ VmaPool pool);
+ void RecordDefragmentationBegin(uint32_t frameIndex,
+ const VmaDefragmentationInfo2& info,
+ VmaDefragmentationContext ctx);
+ void RecordDefragmentationEnd(uint32_t frameIndex,
+ VmaDefragmentationContext ctx);
+
+private:
+ struct CallParams
+ {
+ uint32_t threadId;
+ double time;
+ };
+
+ class UserDataString
+ {
+ public:
+ UserDataString(VmaAllocationCreateFlags allocFlags, const void* pUserData);
+ const char* GetString() const { return m_Str; }
+
+ private:
+ char m_PtrStr[17];
+ const char* m_Str;
+ };
+
+ bool m_UseMutex;
+ VmaRecordFlags m_Flags;
+ FILE* m_File;
+ VMA_MUTEX m_FileMutex;
+ int64_t m_Freq;
+ int64_t m_StartCounter;
+
+ void GetBasicParams(CallParams& outParams);
+
+ // T must be a pointer type, e.g. VmaAllocation, VmaPool.
+ template<typename T>
+ void PrintPointerList(uint64_t count, const T* pItems)
+ {
+ if(count)
+ {
+ fprintf(m_File, "%p", pItems[0]);
+ for(uint64_t i = 1; i < count; ++i)
+ {
+ fprintf(m_File, " %p", pItems[i]);
+ }
+ }
+ }
+
+ void PrintPointerList(uint64_t count, const VmaAllocation* pItems);
+ void Flush();
+};
+
+#endif // #if VMA_RECORDING_ENABLED
+
+// Main allocator object.
+struct VmaAllocator_T
+{
+ VMA_CLASS_NO_COPY(VmaAllocator_T)
+public:
+ bool m_UseMutex;
+ bool m_UseKhrDedicatedAllocation;
+ VkDevice m_hDevice;
+ bool m_AllocationCallbacksSpecified;
+ VkAllocationCallbacks m_AllocationCallbacks;
+ VmaDeviceMemoryCallbacks m_DeviceMemoryCallbacks;
+
+ // Number of bytes free out of limit, or VK_WHOLE_SIZE if no limit for that heap.
+ VkDeviceSize m_HeapSizeLimit[VK_MAX_MEMORY_HEAPS];
+ VMA_MUTEX m_HeapSizeLimitMutex;
+
+ VkPhysicalDeviceProperties m_PhysicalDeviceProperties;
+ VkPhysicalDeviceMemoryProperties m_MemProps;
+
+ // Default pools.
+ VmaBlockVector* m_pBlockVectors[VK_MAX_MEMORY_TYPES];
+
+ // Each vector is sorted by memory (handle value).
+ typedef VmaVector< VmaAllocation, VmaStlAllocator<VmaAllocation> > AllocationVectorType;
+ AllocationVectorType* m_pDedicatedAllocations[VK_MAX_MEMORY_TYPES];
+ VMA_RW_MUTEX m_DedicatedAllocationsMutex[VK_MAX_MEMORY_TYPES];
+
+ VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo);
+ VkResult Init(const VmaAllocatorCreateInfo* pCreateInfo);
+ ~VmaAllocator_T();
+
+ const VkAllocationCallbacks* GetAllocationCallbacks() const
+ {
+ return m_AllocationCallbacksSpecified ? &m_AllocationCallbacks : 0;
+ }
+ const VmaVulkanFunctions& GetVulkanFunctions() const
+ {
+ return m_VulkanFunctions;
+ }
+
+ VkDeviceSize GetBufferImageGranularity() const
+ {
+ return VMA_MAX(
+ static_cast<VkDeviceSize>(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY),
+ m_PhysicalDeviceProperties.limits.bufferImageGranularity);
+ }
+
+ uint32_t GetMemoryHeapCount() const { return m_MemProps.memoryHeapCount; }
+ uint32_t GetMemoryTypeCount() const { return m_MemProps.memoryTypeCount; }
+
+ uint32_t MemoryTypeIndexToHeapIndex(uint32_t memTypeIndex) const
+ {
+ VMA_ASSERT(memTypeIndex < m_MemProps.memoryTypeCount);
+ return m_MemProps.memoryTypes[memTypeIndex].heapIndex;
+ }
+ // True when specific memory type is HOST_VISIBLE but not HOST_COHERENT.
+ bool IsMemoryTypeNonCoherent(uint32_t memTypeIndex) const
+ {
+ return (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & (VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT)) ==
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ }
+ // Minimum alignment for all allocations in specific memory type.
+ VkDeviceSize GetMemoryTypeMinAlignment(uint32_t memTypeIndex) const
+ {
+ return IsMemoryTypeNonCoherent(memTypeIndex) ?
+ VMA_MAX((VkDeviceSize)VMA_DEBUG_ALIGNMENT, m_PhysicalDeviceProperties.limits.nonCoherentAtomSize) :
+ (VkDeviceSize)VMA_DEBUG_ALIGNMENT;
+ }
+
+ bool IsIntegratedGpu() const
+ {
+ return m_PhysicalDeviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU;
+ }
+
+#if VMA_RECORDING_ENABLED
+ VmaRecorder* GetRecorder() const { return m_pRecorder; }
+#endif
+
+ void GetBufferMemoryRequirements(
+ VkBuffer hBuffer,
+ VkMemoryRequirements& memReq,
+ bool& requiresDedicatedAllocation,
+ bool& prefersDedicatedAllocation) const;
+ void GetImageMemoryRequirements(
+ VkImage hImage,
+ VkMemoryRequirements& memReq,
+ bool& requiresDedicatedAllocation,
+ bool& prefersDedicatedAllocation) const;
+
+ // Main allocation function.
+ VkResult AllocateMemory(
+ const VkMemoryRequirements& vkMemReq,
+ bool requiresDedicatedAllocation,
+ bool prefersDedicatedAllocation,
+ VkBuffer dedicatedBuffer,
+ VkImage dedicatedImage,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaSuballocationType suballocType,
+ size_t allocationCount,
+ VmaAllocation* pAllocations);
+
+ // Main deallocation function.
+ void FreeMemory(
+ size_t allocationCount,
+ const VmaAllocation* pAllocations);
+
+ VkResult ResizeAllocation(
+ const VmaAllocation alloc,
+ VkDeviceSize newSize);
+
+ void CalculateStats(VmaStats* pStats);
+
+#if VMA_STATS_STRING_ENABLED
+ void PrintDetailedMap(class VmaJsonWriter& json);
+#endif
+
+ VkResult DefragmentationBegin(
+ const VmaDefragmentationInfo2& info,
+ VmaDefragmentationStats* pStats,
+ VmaDefragmentationContext* pContext);
+ VkResult DefragmentationEnd(
+ VmaDefragmentationContext context);
+
+ void GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo);
+ bool TouchAllocation(VmaAllocation hAllocation);
+
+ VkResult CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool);
+ void DestroyPool(VmaPool pool);
+ void GetPoolStats(VmaPool pool, VmaPoolStats* pPoolStats);
+
+ void SetCurrentFrameIndex(uint32_t frameIndex);
+ uint32_t GetCurrentFrameIndex() const { return m_CurrentFrameIndex.load(); }
+
+ void MakePoolAllocationsLost(
+ VmaPool hPool,
+ size_t* pLostAllocationCount);
+ VkResult CheckPoolCorruption(VmaPool hPool);
+ VkResult CheckCorruption(uint32_t memoryTypeBits);
+
+ void CreateLostAllocation(VmaAllocation* pAllocation);
+
+ VkResult AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory);
+ void FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory);
+
+ VkResult Map(VmaAllocation hAllocation, void** ppData);
+ void Unmap(VmaAllocation hAllocation);
+
+ VkResult BindBufferMemory(VmaAllocation hAllocation, VkBuffer hBuffer);
+ VkResult BindImageMemory(VmaAllocation hAllocation, VkImage hImage);
+
+ void FlushOrInvalidateAllocation(
+ VmaAllocation hAllocation,
+ VkDeviceSize offset, VkDeviceSize size,
+ VMA_CACHE_OPERATION op);
+
+ void FillAllocation(const VmaAllocation hAllocation, uint8_t pattern);
+
+private:
+ VkDeviceSize m_PreferredLargeHeapBlockSize;
+
+ VkPhysicalDevice m_PhysicalDevice;
+ VMA_ATOMIC_UINT32 m_CurrentFrameIndex;
+
+ VMA_RW_MUTEX m_PoolsMutex;
+ // Protected by m_PoolsMutex. Sorted by pointer value.
+ VmaVector<VmaPool, VmaStlAllocator<VmaPool> > m_Pools;
+ uint32_t m_NextPoolId;
+
+ VmaVulkanFunctions m_VulkanFunctions;
+
+#if VMA_RECORDING_ENABLED
+ VmaRecorder* m_pRecorder;
+#endif
+
+ void ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions);
+
+ VkDeviceSize CalcPreferredBlockSize(uint32_t memTypeIndex);
+
+ VkResult AllocateMemoryOfType(
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ bool dedicatedAllocation,
+ VkBuffer dedicatedBuffer,
+ VkImage dedicatedImage,
+ const VmaAllocationCreateInfo& createInfo,
+ uint32_t memTypeIndex,
+ VmaSuballocationType suballocType,
+ size_t allocationCount,
+ VmaAllocation* pAllocations);
+
+ // Helper function only to be used inside AllocateDedicatedMemory.
+ VkResult AllocateDedicatedMemoryPage(
+ VkDeviceSize size,
+ VmaSuballocationType suballocType,
+ uint32_t memTypeIndex,
+ const VkMemoryAllocateInfo& allocInfo,
+ bool map,
+ bool isUserDataString,
+ void* pUserData,
+ VmaAllocation* pAllocation);
+
+ // Allocates and registers new VkDeviceMemory specifically for dedicated allocations.
+ VkResult AllocateDedicatedMemory(
+ VkDeviceSize size,
+ VmaSuballocationType suballocType,
+ uint32_t memTypeIndex,
+ bool map,
+ bool isUserDataString,
+ void* pUserData,
+ VkBuffer dedicatedBuffer,
+ VkImage dedicatedImage,
+ size_t allocationCount,
+ VmaAllocation* pAllocations);
+
+ // Tries to free pMemory as Dedicated Memory. Returns true if found and freed.
+ void FreeDedicatedMemory(VmaAllocation allocation);
+};
+
+////////////////////////////////////////////////////////////////////////////////
+// Memory allocation #2 after VmaAllocator_T definition
+
+static void* VmaMalloc(VmaAllocator hAllocator, size_t size, size_t alignment)
+{
+ return VmaMalloc(&hAllocator->m_AllocationCallbacks, size, alignment);
+}
+
+static void VmaFree(VmaAllocator hAllocator, void* ptr)
+{
+ VmaFree(&hAllocator->m_AllocationCallbacks, ptr);
+}
+
+template<typename T>
+static T* VmaAllocate(VmaAllocator hAllocator)
+{
+ return (T*)VmaMalloc(hAllocator, sizeof(T), VMA_ALIGN_OF(T));
+}
+
+template<typename T>
+static T* VmaAllocateArray(VmaAllocator hAllocator, size_t count)
+{
+ return (T*)VmaMalloc(hAllocator, sizeof(T) * count, VMA_ALIGN_OF(T));
+}
+
+template<typename T>
+static void vma_delete(VmaAllocator hAllocator, T* ptr)
+{
+ if(ptr != VMA_NULL)
+ {
+ ptr->~T();
+ VmaFree(hAllocator, ptr);
+ }
+}
+
+template<typename T>
+static void vma_delete_array(VmaAllocator hAllocator, T* ptr, size_t count)
+{
+ if(ptr != VMA_NULL)
+ {
+ for(size_t i = count; i--; )
+ ptr[i].~T();
+ VmaFree(hAllocator, ptr);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaStringBuilder
+
+#if VMA_STATS_STRING_ENABLED
+
+class VmaStringBuilder
+{
+public:
+ VmaStringBuilder(VmaAllocator alloc) : m_Data(VmaStlAllocator<char>(alloc->GetAllocationCallbacks())) { }
+ size_t GetLength() const { return m_Data.size(); }
+ const char* GetData() const { return m_Data.data(); }
+
+ void Add(char ch) { m_Data.push_back(ch); }
+ void Add(const char* pStr);
+ void AddNewLine() { Add('\n'); }
+ void AddNumber(uint32_t num);
+ void AddNumber(uint64_t num);
+ void AddPointer(const void* ptr);
+
+private:
+ VmaVector< char, VmaStlAllocator<char> > m_Data;
+};
+
+void VmaStringBuilder::Add(const char* pStr)
+{
+ const size_t strLen = strlen(pStr);
+ if(strLen > 0)
+ {
+ const size_t oldCount = m_Data.size();
+ m_Data.resize(oldCount + strLen);
+ memcpy(m_Data.data() + oldCount, pStr, strLen);
+ }
+}
+
+void VmaStringBuilder::AddNumber(uint32_t num)
+{
+ char buf[11];
+ VmaUint32ToStr(buf, sizeof(buf), num);
+ Add(buf);
+}
+
+void VmaStringBuilder::AddNumber(uint64_t num)
+{
+ char buf[21];
+ VmaUint64ToStr(buf, sizeof(buf), num);
+ Add(buf);
+}
+
+void VmaStringBuilder::AddPointer(const void* ptr)
+{
+ char buf[21];
+ VmaPtrToStr(buf, sizeof(buf), ptr);
+ Add(buf);
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaJsonWriter
+
+#if VMA_STATS_STRING_ENABLED
+
+class VmaJsonWriter
+{
+ VMA_CLASS_NO_COPY(VmaJsonWriter)
+public:
+ VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb);
+ ~VmaJsonWriter();
+
+ void BeginObject(bool singleLine = false);
+ void EndObject();
+
+ void BeginArray(bool singleLine = false);
+ void EndArray();
+
+ void WriteString(const char* pStr);
+ void BeginString(const char* pStr = VMA_NULL);
+ void ContinueString(const char* pStr);
+ void ContinueString(uint32_t n);
+ void ContinueString(uint64_t n);
+ void ContinueString_Pointer(const void* ptr);
+ void EndString(const char* pStr = VMA_NULL);
+
+ void WriteNumber(uint32_t n);
+ void WriteNumber(uint64_t n);
+ void WriteBool(bool b);
+ void WriteNull();
+
+private:
+ static const char* const INDENT;
+
+ enum COLLECTION_TYPE
+ {
+ COLLECTION_TYPE_OBJECT,
+ COLLECTION_TYPE_ARRAY,
+ };
+ struct StackItem
+ {
+ COLLECTION_TYPE type;
+ uint32_t valueCount;
+ bool singleLineMode;
+ };
+
+ VmaStringBuilder& m_SB;
+ VmaVector< StackItem, VmaStlAllocator<StackItem> > m_Stack;
+ bool m_InsideString;
+
+ void BeginValue(bool isString);
+ void WriteIndent(bool oneLess = false);
+};
+
+const char* const VmaJsonWriter::INDENT = " ";
+
+VmaJsonWriter::VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb) :
+ m_SB(sb),
+ m_Stack(VmaStlAllocator<StackItem>(pAllocationCallbacks)),
+ m_InsideString(false)
+{
+}
+
+VmaJsonWriter::~VmaJsonWriter()
+{
+ VMA_ASSERT(!m_InsideString);
+ VMA_ASSERT(m_Stack.empty());
+}
+
+void VmaJsonWriter::BeginObject(bool singleLine)
+{
+ VMA_ASSERT(!m_InsideString);
+
+ BeginValue(false);
+ m_SB.Add('{');
+
+ StackItem item;
+ item.type = COLLECTION_TYPE_OBJECT;
+ item.valueCount = 0;
+ item.singleLineMode = singleLine;
+ m_Stack.push_back(item);
+}
+
+void VmaJsonWriter::EndObject()
+{
+ VMA_ASSERT(!m_InsideString);
+
+ WriteIndent(true);
+ m_SB.Add('}');
+
+ VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_OBJECT);
+ m_Stack.pop_back();
+}
+
+void VmaJsonWriter::BeginArray(bool singleLine)
+{
+ VMA_ASSERT(!m_InsideString);
+
+ BeginValue(false);
+ m_SB.Add('[');
+
+ StackItem item;
+ item.type = COLLECTION_TYPE_ARRAY;
+ item.valueCount = 0;
+ item.singleLineMode = singleLine;
+ m_Stack.push_back(item);
+}
+
+void VmaJsonWriter::EndArray()
+{
+ VMA_ASSERT(!m_InsideString);
+
+ WriteIndent(true);
+ m_SB.Add(']');
+
+ VMA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_ARRAY);
+ m_Stack.pop_back();
+}
+
+void VmaJsonWriter::WriteString(const char* pStr)
+{
+ BeginString(pStr);
+ EndString();
+}
+
+void VmaJsonWriter::BeginString(const char* pStr)
+{
+ VMA_ASSERT(!m_InsideString);
+
+ BeginValue(true);
+ m_SB.Add('"');
+ m_InsideString = true;
+ if(pStr != VMA_NULL && pStr[0] != '\0')
+ {
+ ContinueString(pStr);
+ }
+}
+
+void VmaJsonWriter::ContinueString(const char* pStr)
+{
+ VMA_ASSERT(m_InsideString);
+
+ const size_t strLen = strlen(pStr);
+ for(size_t i = 0; i < strLen; ++i)
+ {
+ char ch = pStr[i];
+ if(ch == '\\')
+ {
+ m_SB.Add("\\\\");
+ }
+ else if(ch == '"')
+ {
+ m_SB.Add("\\\"");
+ }
+ else if(ch >= 32)
+ {
+ m_SB.Add(ch);
+ }
+ else switch(ch)
+ {
+ case '\b':
+ m_SB.Add("\\b");
+ break;
+ case '\f':
+ m_SB.Add("\\f");
+ break;
+ case '\n':
+ m_SB.Add("\\n");
+ break;
+ case '\r':
+ m_SB.Add("\\r");
+ break;
+ case '\t':
+ m_SB.Add("\\t");
+ break;
+ default:
+ VMA_ASSERT(0 && "Character not currently supported.");
+ break;
+ }
+ }
+}
+
+void VmaJsonWriter::ContinueString(uint32_t n)
+{
+ VMA_ASSERT(m_InsideString);
+ m_SB.AddNumber(n);
+}
+
+void VmaJsonWriter::ContinueString(uint64_t n)
+{
+ VMA_ASSERT(m_InsideString);
+ m_SB.AddNumber(n);
+}
+
+void VmaJsonWriter::ContinueString_Pointer(const void* ptr)
+{
+ VMA_ASSERT(m_InsideString);
+ m_SB.AddPointer(ptr);
+}
+
+void VmaJsonWriter::EndString(const char* pStr)
+{
+ VMA_ASSERT(m_InsideString);
+ if(pStr != VMA_NULL && pStr[0] != '\0')
+ {
+ ContinueString(pStr);
+ }
+ m_SB.Add('"');
+ m_InsideString = false;
+}
+
+void VmaJsonWriter::WriteNumber(uint32_t n)
+{
+ VMA_ASSERT(!m_InsideString);
+ BeginValue(false);
+ m_SB.AddNumber(n);
+}
+
+void VmaJsonWriter::WriteNumber(uint64_t n)
+{
+ VMA_ASSERT(!m_InsideString);
+ BeginValue(false);
+ m_SB.AddNumber(n);
+}
+
+void VmaJsonWriter::WriteBool(bool b)
+{
+ VMA_ASSERT(!m_InsideString);
+ BeginValue(false);
+ m_SB.Add(b ? "true" : "false");
+}
+
+void VmaJsonWriter::WriteNull()
+{
+ VMA_ASSERT(!m_InsideString);
+ BeginValue(false);
+ m_SB.Add("null");
+}
+
+void VmaJsonWriter::BeginValue(bool isString)
+{
+ if(!m_Stack.empty())
+ {
+ StackItem& currItem = m_Stack.back();
+ if(currItem.type == COLLECTION_TYPE_OBJECT &&
+ currItem.valueCount % 2 == 0)
+ {
+ (void) isString;
+ VMA_ASSERT(isString);
+ }
+
+ if(currItem.type == COLLECTION_TYPE_OBJECT &&
+ currItem.valueCount % 2 != 0)
+ {
+ m_SB.Add(": ");
+ }
+ else if(currItem.valueCount > 0)
+ {
+ m_SB.Add(", ");
+ WriteIndent();
+ }
+ else
+ {
+ WriteIndent();
+ }
+ ++currItem.valueCount;
+ }
+}
+
+void VmaJsonWriter::WriteIndent(bool oneLess)
+{
+ if(!m_Stack.empty() && !m_Stack.back().singleLineMode)
+ {
+ m_SB.AddNewLine();
+
+ size_t count = m_Stack.size();
+ if(count > 0 && oneLess)
+ {
+ --count;
+ }
+ for(size_t i = 0; i < count; ++i)
+ {
+ m_SB.Add(INDENT);
+ }
+ }
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+////////////////////////////////////////////////////////////////////////////////
+
+void VmaAllocation_T::SetUserData(VmaAllocator hAllocator, void* pUserData)
+{
+ if(IsUserDataString())
+ {
+ VMA_ASSERT(pUserData == VMA_NULL || pUserData != m_pUserData);
+
+ FreeUserDataString(hAllocator);
+
+ if(pUserData != VMA_NULL)
+ {
+ const char* const newStrSrc = (char*)pUserData;
+ const size_t newStrLen = strlen(newStrSrc);
+ char* const newStrDst = vma_new_array(hAllocator, char, newStrLen + 1);
+ memcpy(newStrDst, newStrSrc, newStrLen + 1);
+ m_pUserData = newStrDst;
+ }
+ }
+ else
+ {
+ m_pUserData = pUserData;
+ }
+}
+
+void VmaAllocation_T::ChangeBlockAllocation(
+ VmaAllocator hAllocator,
+ VmaDeviceMemoryBlock* block,
+ VkDeviceSize offset)
+{
+ VMA_ASSERT(block != VMA_NULL);
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+
+ // Move mapping reference counter from old block to new block.
+ if(block != m_BlockAllocation.m_Block)
+ {
+ uint32_t mapRefCount = m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP;
+ if(IsPersistentMap())
+ ++mapRefCount;
+ m_BlockAllocation.m_Block->Unmap(hAllocator, mapRefCount);
+ block->Map(hAllocator, mapRefCount, VMA_NULL);
+ }
+
+ m_BlockAllocation.m_Block = block;
+ m_BlockAllocation.m_Offset = offset;
+}
+
+void VmaAllocation_T::ChangeSize(VkDeviceSize newSize)
+{
+ VMA_ASSERT(newSize > 0);
+ m_Size = newSize;
+}
+
+void VmaAllocation_T::ChangeOffset(VkDeviceSize newOffset)
+{
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+ m_BlockAllocation.m_Offset = newOffset;
+}
+
+VkDeviceSize VmaAllocation_T::GetOffset() const
+{
+ switch(m_Type)
+ {
+ case ALLOCATION_TYPE_BLOCK:
+ return m_BlockAllocation.m_Offset;
+ case ALLOCATION_TYPE_DEDICATED:
+ return 0;
+ default:
+ VMA_ASSERT(0);
+ return 0;
+ }
+}
+
+VkDeviceMemory VmaAllocation_T::GetMemory() const
+{
+ switch(m_Type)
+ {
+ case ALLOCATION_TYPE_BLOCK:
+ return m_BlockAllocation.m_Block->GetDeviceMemory();
+ case ALLOCATION_TYPE_DEDICATED:
+ return m_DedicatedAllocation.m_hMemory;
+ default:
+ VMA_ASSERT(0);
+ return VK_NULL_HANDLE;
+ }
+}
+
+uint32_t VmaAllocation_T::GetMemoryTypeIndex() const
+{
+ switch(m_Type)
+ {
+ case ALLOCATION_TYPE_BLOCK:
+ return m_BlockAllocation.m_Block->GetMemoryTypeIndex();
+ case ALLOCATION_TYPE_DEDICATED:
+ return m_DedicatedAllocation.m_MemoryTypeIndex;
+ default:
+ VMA_ASSERT(0);
+ return UINT32_MAX;
+ }
+}
+
+void* VmaAllocation_T::GetMappedData() const
+{
+ switch(m_Type)
+ {
+ case ALLOCATION_TYPE_BLOCK:
+ if(m_MapCount != 0)
+ {
+ void* pBlockData = m_BlockAllocation.m_Block->GetMappedData();
+ VMA_ASSERT(pBlockData != VMA_NULL);
+ return (char*)pBlockData + m_BlockAllocation.m_Offset;
+ }
+ else
+ {
+ return VMA_NULL;
+ }
+ break;
+ case ALLOCATION_TYPE_DEDICATED:
+ VMA_ASSERT((m_DedicatedAllocation.m_pMappedData != VMA_NULL) == (m_MapCount != 0));
+ return m_DedicatedAllocation.m_pMappedData;
+ default:
+ VMA_ASSERT(0);
+ return VMA_NULL;
+ }
+}
+
+bool VmaAllocation_T::CanBecomeLost() const
+{
+ switch(m_Type)
+ {
+ case ALLOCATION_TYPE_BLOCK:
+ return m_BlockAllocation.m_CanBecomeLost;
+ case ALLOCATION_TYPE_DEDICATED:
+ return false;
+ default:
+ VMA_ASSERT(0);
+ return false;
+ }
+}
+
+VmaPool VmaAllocation_T::GetPool() const
+{
+ VMA_ASSERT(m_Type == ALLOCATION_TYPE_BLOCK);
+ return m_BlockAllocation.m_hPool;
+}
+
+bool VmaAllocation_T::MakeLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
+{
+ VMA_ASSERT(CanBecomeLost());
+
+ /*
+ Warning: This is a carefully designed algorithm.
+ Do not modify unless you really know what you're doing :)
+ */
+ uint32_t localLastUseFrameIndex = GetLastUseFrameIndex();
+ for(;;)
+ {
+ if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
+ {
+ VMA_ASSERT(0);
+ return false;
+ }
+ else if(localLastUseFrameIndex + frameInUseCount >= currentFrameIndex)
+ {
+ return false;
+ }
+ else // Last use time earlier than current time.
+ {
+ if(CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, VMA_FRAME_INDEX_LOST))
+ {
+ // Setting hAllocation.LastUseFrameIndex atomic to VMA_FRAME_INDEX_LOST is enough to mark it as LOST.
+ // Calling code just needs to unregister this allocation in owning VmaDeviceMemoryBlock.
+ return true;
+ }
+ }
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+// Correspond to values of enum VmaSuballocationType.
+static const char* VMA_SUBALLOCATION_TYPE_NAMES[] = {
+ "FREE",
+ "UNKNOWN",
+ "BUFFER",
+ "IMAGE_UNKNOWN",
+ "IMAGE_LINEAR",
+ "IMAGE_OPTIMAL",
+};
+
+void VmaAllocation_T::PrintParameters(class VmaJsonWriter& json) const
+{
+ json.WriteString("Type");
+ json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[m_SuballocationType]);
+
+ json.WriteString("Size");
+ json.WriteNumber(m_Size);
+
+ if(m_pUserData != VMA_NULL)
+ {
+ json.WriteString("UserData");
+ if(IsUserDataString())
+ {
+ json.WriteString((const char*)m_pUserData);
+ }
+ else
+ {
+ json.BeginString();
+ json.ContinueString_Pointer(m_pUserData);
+ json.EndString();
+ }
+ }
+
+ json.WriteString("CreationFrameIndex");
+ json.WriteNumber(m_CreationFrameIndex);
+
+ json.WriteString("LastUseFrameIndex");
+ json.WriteNumber(GetLastUseFrameIndex());
+
+ if(m_BufferImageUsage != 0)
+ {
+ json.WriteString("Usage");
+ json.WriteNumber(m_BufferImageUsage);
+ }
+}
+
+#endif
+
+void VmaAllocation_T::FreeUserDataString(VmaAllocator hAllocator)
+{
+ VMA_ASSERT(IsUserDataString());
+ if(m_pUserData != VMA_NULL)
+ {
+ char* const oldStr = (char*)m_pUserData;
+ const size_t oldStrLen = strlen(oldStr);
+ vma_delete_array(hAllocator, oldStr, oldStrLen + 1);
+ m_pUserData = VMA_NULL;
+ }
+}
+
+void VmaAllocation_T::BlockAllocMap()
+{
+ VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
+
+ if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F)
+ {
+ ++m_MapCount;
+ }
+ else
+ {
+ VMA_ASSERT(0 && "Allocation mapped too many times simultaneously.");
+ }
+}
+
+void VmaAllocation_T::BlockAllocUnmap()
+{
+ VMA_ASSERT(GetType() == ALLOCATION_TYPE_BLOCK);
+
+ if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0)
+ {
+ --m_MapCount;
+ }
+ else
+ {
+ VMA_ASSERT(0 && "Unmapping allocation not previously mapped.");
+ }
+}
+
+VkResult VmaAllocation_T::DedicatedAllocMap(VmaAllocator hAllocator, void** ppData)
+{
+ VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
+
+ if(m_MapCount != 0)
+ {
+ if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) < 0x7F)
+ {
+ VMA_ASSERT(m_DedicatedAllocation.m_pMappedData != VMA_NULL);
+ *ppData = m_DedicatedAllocation.m_pMappedData;
+ ++m_MapCount;
+ return VK_SUCCESS;
+ }
+ else
+ {
+ VMA_ASSERT(0 && "Dedicated allocation mapped too many times simultaneously.");
+ return VK_ERROR_MEMORY_MAP_FAILED;
+ }
+ }
+ else
+ {
+ VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
+ hAllocator->m_hDevice,
+ m_DedicatedAllocation.m_hMemory,
+ 0, // offset
+ VK_WHOLE_SIZE,
+ 0, // flags
+ ppData);
+ if(result == VK_SUCCESS)
+ {
+ m_DedicatedAllocation.m_pMappedData = *ppData;
+ m_MapCount = 1;
+ }
+ return result;
+ }
+}
+
+void VmaAllocation_T::DedicatedAllocUnmap(VmaAllocator hAllocator)
+{
+ VMA_ASSERT(GetType() == ALLOCATION_TYPE_DEDICATED);
+
+ if((m_MapCount & ~MAP_COUNT_FLAG_PERSISTENT_MAP) != 0)
+ {
+ --m_MapCount;
+ if(m_MapCount == 0)
+ {
+ m_DedicatedAllocation.m_pMappedData = VMA_NULL;
+ (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(
+ hAllocator->m_hDevice,
+ m_DedicatedAllocation.m_hMemory);
+ }
+ }
+ else
+ {
+ VMA_ASSERT(0 && "Unmapping dedicated allocation not previously mapped.");
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+static void VmaPrintStatInfo(VmaJsonWriter& json, const VmaStatInfo& stat)
+{
+ json.BeginObject();
+
+ json.WriteString("Blocks");
+ json.WriteNumber(stat.blockCount);
+
+ json.WriteString("Allocations");
+ json.WriteNumber(stat.allocationCount);
+
+ json.WriteString("UnusedRanges");
+ json.WriteNumber(stat.unusedRangeCount);
+
+ json.WriteString("UsedBytes");
+ json.WriteNumber(stat.usedBytes);
+
+ json.WriteString("UnusedBytes");
+ json.WriteNumber(stat.unusedBytes);
+
+ if(stat.allocationCount > 1)
+ {
+ json.WriteString("AllocationSize");
+ json.BeginObject(true);
+ json.WriteString("Min");
+ json.WriteNumber(stat.allocationSizeMin);
+ json.WriteString("Avg");
+ json.WriteNumber(stat.allocationSizeAvg);
+ json.WriteString("Max");
+ json.WriteNumber(stat.allocationSizeMax);
+ json.EndObject();
+ }
+
+ if(stat.unusedRangeCount > 1)
+ {
+ json.WriteString("UnusedRangeSize");
+ json.BeginObject(true);
+ json.WriteString("Min");
+ json.WriteNumber(stat.unusedRangeSizeMin);
+ json.WriteString("Avg");
+ json.WriteNumber(stat.unusedRangeSizeAvg);
+ json.WriteString("Max");
+ json.WriteNumber(stat.unusedRangeSizeMax);
+ json.EndObject();
+ }
+
+ json.EndObject();
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+struct VmaSuballocationItemSizeLess
+{
+ bool operator()(
+ const VmaSuballocationList::iterator lhs,
+ const VmaSuballocationList::iterator rhs) const
+ {
+ return lhs->size < rhs->size;
+ }
+ bool operator()(
+ const VmaSuballocationList::iterator lhs,
+ VkDeviceSize rhsSize) const
+ {
+ return lhs->size < rhsSize;
+ }
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaBlockMetadata
+
+VmaBlockMetadata::VmaBlockMetadata(VmaAllocator hAllocator) :
+ m_Size(0),
+ m_pAllocationCallbacks(hAllocator->GetAllocationCallbacks())
+{
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+void VmaBlockMetadata::PrintDetailedMap_Begin(class VmaJsonWriter& json,
+ VkDeviceSize unusedBytes,
+ size_t allocationCount,
+ size_t unusedRangeCount) const
+{
+ json.BeginObject();
+
+ json.WriteString("TotalBytes");
+ json.WriteNumber(GetSize());
+
+ json.WriteString("UnusedBytes");
+ json.WriteNumber(unusedBytes);
+
+ json.WriteString("Allocations");
+ json.WriteNumber((uint64_t)allocationCount);
+
+ json.WriteString("UnusedRanges");
+ json.WriteNumber((uint64_t)unusedRangeCount);
+
+ json.WriteString("Suballocations");
+ json.BeginArray();
+}
+
+void VmaBlockMetadata::PrintDetailedMap_Allocation(class VmaJsonWriter& json,
+ VkDeviceSize offset,
+ VmaAllocation hAllocation) const
+{
+ json.BeginObject(true);
+
+ json.WriteString("Offset");
+ json.WriteNumber(offset);
+
+ hAllocation->PrintParameters(json);
+
+ json.EndObject();
+}
+
+void VmaBlockMetadata::PrintDetailedMap_UnusedRange(class VmaJsonWriter& json,
+ VkDeviceSize offset,
+ VkDeviceSize size) const
+{
+ json.BeginObject(true);
+
+ json.WriteString("Offset");
+ json.WriteNumber(offset);
+
+ json.WriteString("Type");
+ json.WriteString(VMA_SUBALLOCATION_TYPE_NAMES[VMA_SUBALLOCATION_TYPE_FREE]);
+
+ json.WriteString("Size");
+ json.WriteNumber(size);
+
+ json.EndObject();
+}
+
+void VmaBlockMetadata::PrintDetailedMap_End(class VmaJsonWriter& json) const
+{
+ json.EndArray();
+ json.EndObject();
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaBlockMetadata_Generic
+
+VmaBlockMetadata_Generic::VmaBlockMetadata_Generic(VmaAllocator hAllocator) :
+ VmaBlockMetadata(hAllocator),
+ m_FreeCount(0),
+ m_SumFreeSize(0),
+ m_Suballocations(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
+ m_FreeSuballocationsBySize(VmaStlAllocator<VmaSuballocationList::iterator>(hAllocator->GetAllocationCallbacks()))
+{
+}
+
+VmaBlockMetadata_Generic::~VmaBlockMetadata_Generic()
+{
+}
+
+void VmaBlockMetadata_Generic::Init(VkDeviceSize size)
+{
+ VmaBlockMetadata::Init(size);
+
+ m_FreeCount = 1;
+ m_SumFreeSize = size;
+
+ VmaSuballocation suballoc = {};
+ suballoc.offset = 0;
+ suballoc.size = size;
+ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ suballoc.hAllocation = VK_NULL_HANDLE;
+
+ VMA_ASSERT(size > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER);
+ m_Suballocations.push_back(suballoc);
+ VmaSuballocationList::iterator suballocItem = m_Suballocations.end();
+ --suballocItem;
+ m_FreeSuballocationsBySize.push_back(suballocItem);
+}
+
+bool VmaBlockMetadata_Generic::Validate() const
+{
+ VMA_VALIDATE(!m_Suballocations.empty());
+
+ // Expected offset of new suballocation as calculated from previous ones.
+ VkDeviceSize calculatedOffset = 0;
+ // Expected number of free suballocations as calculated from traversing their list.
+ uint32_t calculatedFreeCount = 0;
+ // Expected sum size of free suballocations as calculated from traversing their list.
+ VkDeviceSize calculatedSumFreeSize = 0;
+ // Expected number of free suballocations that should be registered in
+ // m_FreeSuballocationsBySize calculated from traversing their list.
+ size_t freeSuballocationsToRegister = 0;
+ // True if previous visited suballocation was free.
+ bool prevFree = false;
+
+ for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
+ suballocItem != m_Suballocations.cend();
+ ++suballocItem)
+ {
+ const VmaSuballocation& subAlloc = *suballocItem;
+
+ // Actual offset of this suballocation doesn't match expected one.
+ VMA_VALIDATE(subAlloc.offset == calculatedOffset);
+
+ const bool currFree = (subAlloc.type == VMA_SUBALLOCATION_TYPE_FREE);
+ // Two adjacent free suballocations are invalid. They should be merged.
+ VMA_VALIDATE(!prevFree || !currFree);
+
+ VMA_VALIDATE(currFree == (subAlloc.hAllocation == VK_NULL_HANDLE));
+
+ if(currFree)
+ {
+ calculatedSumFreeSize += subAlloc.size;
+ ++calculatedFreeCount;
+ if(subAlloc.size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ ++freeSuballocationsToRegister;
+ }
+
+ // Margin required between allocations - every free space must be at least that large.
+#if VMA_DEBUG_MARGIN
+ VMA_VALIDATE(subAlloc.size >= VMA_DEBUG_MARGIN);
+#endif
+ }
+ else
+ {
+ VMA_VALIDATE(subAlloc.hAllocation->GetOffset() == subAlloc.offset);
+ VMA_VALIDATE(subAlloc.hAllocation->GetSize() == subAlloc.size);
+
+ // Margin required between allocations - previous allocation must be free.
+ VMA_VALIDATE(VMA_DEBUG_MARGIN == 0 || prevFree);
+ }
+
+ calculatedOffset += subAlloc.size;
+ prevFree = currFree;
+ }
+
+ // Number of free suballocations registered in m_FreeSuballocationsBySize doesn't
+ // match expected one.
+ VMA_VALIDATE(m_FreeSuballocationsBySize.size() == freeSuballocationsToRegister);
+
+ VkDeviceSize lastSize = 0;
+ for(size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i)
+ {
+ VmaSuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i];
+
+ // Only free suballocations can be registered in m_FreeSuballocationsBySize.
+ VMA_VALIDATE(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE);
+ // They must be sorted by size ascending.
+ VMA_VALIDATE(suballocItem->size >= lastSize);
+
+ lastSize = suballocItem->size;
+ }
+
+ // Check if totals match calculacted values.
+ VMA_VALIDATE(ValidateFreeSuballocationList());
+ VMA_VALIDATE(calculatedOffset == GetSize());
+ VMA_VALIDATE(calculatedSumFreeSize == m_SumFreeSize);
+ VMA_VALIDATE(calculatedFreeCount == m_FreeCount);
+
+ return true;
+}
+
+VkDeviceSize VmaBlockMetadata_Generic::GetUnusedRangeSizeMax() const
+{
+ if(!m_FreeSuballocationsBySize.empty())
+ {
+ return m_FreeSuballocationsBySize.back()->size;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+bool VmaBlockMetadata_Generic::IsEmpty() const
+{
+ return (m_Suballocations.size() == 1) && (m_FreeCount == 1);
+}
+
+void VmaBlockMetadata_Generic::CalcAllocationStatInfo(VmaStatInfo& outInfo) const
+{
+ outInfo.blockCount = 1;
+
+ const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
+ outInfo.allocationCount = rangeCount - m_FreeCount;
+ outInfo.unusedRangeCount = m_FreeCount;
+
+ outInfo.unusedBytes = m_SumFreeSize;
+ outInfo.usedBytes = GetSize() - outInfo.unusedBytes;
+
+ outInfo.allocationSizeMin = UINT64_MAX;
+ outInfo.allocationSizeMax = 0;
+ outInfo.unusedRangeSizeMin = UINT64_MAX;
+ outInfo.unusedRangeSizeMax = 0;
+
+ for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
+ suballocItem != m_Suballocations.cend();
+ ++suballocItem)
+ {
+ const VmaSuballocation& suballoc = *suballocItem;
+ if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ outInfo.allocationSizeMin = VMA_MIN(outInfo.allocationSizeMin, suballoc.size);
+ outInfo.allocationSizeMax = VMA_MAX(outInfo.allocationSizeMax, suballoc.size);
+ }
+ else
+ {
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, suballoc.size);
+ outInfo.unusedRangeSizeMax = VMA_MAX(outInfo.unusedRangeSizeMax, suballoc.size);
+ }
+ }
+}
+
+void VmaBlockMetadata_Generic::AddPoolStats(VmaPoolStats& inoutStats) const
+{
+ const uint32_t rangeCount = (uint32_t)m_Suballocations.size();
+
+ inoutStats.size += GetSize();
+ inoutStats.unusedSize += m_SumFreeSize;
+ inoutStats.allocationCount += rangeCount - m_FreeCount;
+ inoutStats.unusedRangeCount += m_FreeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, GetUnusedRangeSizeMax());
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+void VmaBlockMetadata_Generic::PrintDetailedMap(class VmaJsonWriter& json) const
+{
+ PrintDetailedMap_Begin(json,
+ m_SumFreeSize, // unusedBytes
+ m_Suballocations.size() - (size_t)m_FreeCount, // allocationCount
+ m_FreeCount); // unusedRangeCount
+
+ size_t i = 0;
+ for(VmaSuballocationList::const_iterator suballocItem = m_Suballocations.cbegin();
+ suballocItem != m_Suballocations.cend();
+ ++suballocItem, ++i)
+ {
+ if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ PrintDetailedMap_UnusedRange(json, suballocItem->offset, suballocItem->size);
+ }
+ else
+ {
+ PrintDetailedMap_Allocation(json, suballocItem->offset, suballocItem->hAllocation);
+ }
+ }
+
+ PrintDetailedMap_End(json);
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+bool VmaBlockMetadata_Generic::CreateAllocationRequest(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+ uint32_t strategy,
+ VmaAllocationRequest* pAllocationRequest)
+{
+ VMA_ASSERT(allocSize > 0);
+ VMA_ASSERT(!upperAddress);
+ (void) upperAddress;
+ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(pAllocationRequest != VMA_NULL);
+ VMA_HEAVY_ASSERT(Validate());
+
+ // There is not enough total free space in this block to fullfill the request: Early return.
+ if(canMakeOtherLost == false &&
+ m_SumFreeSize < allocSize + 2 * VMA_DEBUG_MARGIN)
+ {
+ return false;
+ }
+
+ // New algorithm, efficiently searching freeSuballocationsBySize.
+ const size_t freeSuballocCount = m_FreeSuballocationsBySize.size();
+ if(freeSuballocCount > 0)
+ {
+ if(strategy == VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT)
+ {
+ // Find first free suballocation with size not less than allocSize + 2 * VMA_DEBUG_MARGIN.
+ VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess(
+ m_FreeSuballocationsBySize.data(),
+ m_FreeSuballocationsBySize.data() + freeSuballocCount,
+ allocSize + 2 * VMA_DEBUG_MARGIN,
+ VmaSuballocationItemSizeLess());
+ size_t index = it - m_FreeSuballocationsBySize.data();
+ for(; index < freeSuballocCount; ++index)
+ {
+ if(CheckAllocation(
+ currentFrameIndex,
+ frameInUseCount,
+ bufferImageGranularity,
+ allocSize,
+ allocAlignment,
+ allocType,
+ m_FreeSuballocationsBySize[index],
+ false, // canMakeOtherLost
+ &pAllocationRequest->offset,
+ &pAllocationRequest->itemsToMakeLostCount,
+ &pAllocationRequest->sumFreeSize,
+ &pAllocationRequest->sumItemSize))
+ {
+ pAllocationRequest->item = m_FreeSuballocationsBySize[index];
+ return true;
+ }
+ }
+ }
+ else if(strategy == VMA_ALLOCATION_INTERNAL_STRATEGY_MIN_OFFSET)
+ {
+ for(VmaSuballocationList::iterator it = m_Suballocations.begin();
+ it != m_Suballocations.end();
+ ++it)
+ {
+ if(it->type == VMA_SUBALLOCATION_TYPE_FREE && CheckAllocation(
+ currentFrameIndex,
+ frameInUseCount,
+ bufferImageGranularity,
+ allocSize,
+ allocAlignment,
+ allocType,
+ it,
+ false, // canMakeOtherLost
+ &pAllocationRequest->offset,
+ &pAllocationRequest->itemsToMakeLostCount,
+ &pAllocationRequest->sumFreeSize,
+ &pAllocationRequest->sumItemSize))
+ {
+ pAllocationRequest->item = it;
+ return true;
+ }
+ }
+ }
+ else // WORST_FIT, FIRST_FIT
+ {
+ // Search staring from biggest suballocations.
+ for(size_t index = freeSuballocCount; index--; )
+ {
+ if(CheckAllocation(
+ currentFrameIndex,
+ frameInUseCount,
+ bufferImageGranularity,
+ allocSize,
+ allocAlignment,
+ allocType,
+ m_FreeSuballocationsBySize[index],
+ false, // canMakeOtherLost
+ &pAllocationRequest->offset,
+ &pAllocationRequest->itemsToMakeLostCount,
+ &pAllocationRequest->sumFreeSize,
+ &pAllocationRequest->sumItemSize))
+ {
+ pAllocationRequest->item = m_FreeSuballocationsBySize[index];
+ return true;
+ }
+ }
+ }
+ }
+
+ if(canMakeOtherLost)
+ {
+ // Brute-force algorithm. TODO: Come up with something better.
+
+ pAllocationRequest->sumFreeSize = VK_WHOLE_SIZE;
+ pAllocationRequest->sumItemSize = VK_WHOLE_SIZE;
+
+ VmaAllocationRequest tmpAllocRequest = {};
+ for(VmaSuballocationList::iterator suballocIt = m_Suballocations.begin();
+ suballocIt != m_Suballocations.end();
+ ++suballocIt)
+ {
+ if(suballocIt->type == VMA_SUBALLOCATION_TYPE_FREE ||
+ suballocIt->hAllocation->CanBecomeLost())
+ {
+ if(CheckAllocation(
+ currentFrameIndex,
+ frameInUseCount,
+ bufferImageGranularity,
+ allocSize,
+ allocAlignment,
+ allocType,
+ suballocIt,
+ canMakeOtherLost,
+ &tmpAllocRequest.offset,
+ &tmpAllocRequest.itemsToMakeLostCount,
+ &tmpAllocRequest.sumFreeSize,
+ &tmpAllocRequest.sumItemSize))
+ {
+ tmpAllocRequest.item = suballocIt;
+
+ if(tmpAllocRequest.CalcCost() < pAllocationRequest->CalcCost() ||
+ strategy == VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT)
+ {
+ *pAllocationRequest = tmpAllocRequest;
+ }
+ }
+ }
+ }
+
+ if(pAllocationRequest->sumItemSize != VK_WHOLE_SIZE)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool VmaBlockMetadata_Generic::MakeRequestedAllocationsLost(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VmaAllocationRequest* pAllocationRequest)
+{
+ while(pAllocationRequest->itemsToMakeLostCount > 0)
+ {
+ if(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ ++pAllocationRequest->item;
+ }
+ VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end());
+ VMA_ASSERT(pAllocationRequest->item->hAllocation != VK_NULL_HANDLE);
+ VMA_ASSERT(pAllocationRequest->item->hAllocation->CanBecomeLost());
+ if(pAllocationRequest->item->hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+ {
+ pAllocationRequest->item = FreeSuballocation(pAllocationRequest->item);
+ --pAllocationRequest->itemsToMakeLostCount;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ VMA_HEAVY_ASSERT(Validate());
+ VMA_ASSERT(pAllocationRequest->item != m_Suballocations.end());
+ VMA_ASSERT(pAllocationRequest->item->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ return true;
+}
+
+uint32_t VmaBlockMetadata_Generic::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
+{
+ uint32_t lostAllocationCount = 0;
+ for(VmaSuballocationList::iterator it = m_Suballocations.begin();
+ it != m_Suballocations.end();
+ ++it)
+ {
+ if(it->type != VMA_SUBALLOCATION_TYPE_FREE &&
+ it->hAllocation->CanBecomeLost() &&
+ it->hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+ {
+ it = FreeSuballocation(it);
+ ++lostAllocationCount;
+ }
+ }
+ return lostAllocationCount;
+}
+
+VkResult VmaBlockMetadata_Generic::CheckCorruption(const void* pBlockData)
+{
+ for(VmaSuballocationList::iterator it = m_Suballocations.begin();
+ it != m_Suballocations.end();
+ ++it)
+ {
+ if(it->type != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ if(!VmaValidateMagicValue(pBlockData, it->offset - VMA_DEBUG_MARGIN))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ if(!VmaValidateMagicValue(pBlockData, it->offset + it->size))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ }
+ }
+
+ return VK_SUCCESS;
+}
+
+void VmaBlockMetadata_Generic::Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType type,
+ VkDeviceSize allocSize,
+ bool upperAddress,
+ VmaAllocation hAllocation)
+{
+ VMA_ASSERT(!upperAddress);
+ (void) upperAddress;
+ VMA_ASSERT(request.item != m_Suballocations.end());
+ VmaSuballocation& suballoc = *request.item;
+ // Given suballocation is a free block.
+ VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+ // Given offset is inside this suballocation.
+ VMA_ASSERT(request.offset >= suballoc.offset);
+ const VkDeviceSize paddingBegin = request.offset - suballoc.offset;
+ VMA_ASSERT(suballoc.size >= paddingBegin + allocSize);
+ const VkDeviceSize paddingEnd = suballoc.size - paddingBegin - allocSize;
+
+ // Unregister this free suballocation from m_FreeSuballocationsBySize and update
+ // it to become used.
+ UnregisterFreeSuballocation(request.item);
+
+ suballoc.offset = request.offset;
+ suballoc.size = allocSize;
+ suballoc.type = type;
+ suballoc.hAllocation = hAllocation;
+
+ // If there are any free bytes remaining at the end, insert new free suballocation after current one.
+ if(paddingEnd)
+ {
+ VmaSuballocation paddingSuballoc = {};
+ paddingSuballoc.offset = request.offset + allocSize;
+ paddingSuballoc.size = paddingEnd;
+ paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ VmaSuballocationList::iterator next = request.item;
+ ++next;
+ const VmaSuballocationList::iterator paddingEndItem =
+ m_Suballocations.insert(next, paddingSuballoc);
+ RegisterFreeSuballocation(paddingEndItem);
+ }
+
+ // If there are any free bytes remaining at the beginning, insert new free suballocation before current one.
+ if(paddingBegin)
+ {
+ VmaSuballocation paddingSuballoc = {};
+ paddingSuballoc.offset = request.offset - paddingBegin;
+ paddingSuballoc.size = paddingBegin;
+ paddingSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ const VmaSuballocationList::iterator paddingBeginItem =
+ m_Suballocations.insert(request.item, paddingSuballoc);
+ RegisterFreeSuballocation(paddingBeginItem);
+ }
+
+ // Update totals.
+ m_FreeCount = m_FreeCount - 1;
+ if(paddingBegin > 0)
+ {
+ ++m_FreeCount;
+ }
+ if(paddingEnd > 0)
+ {
+ ++m_FreeCount;
+ }
+ m_SumFreeSize -= allocSize;
+}
+
+void VmaBlockMetadata_Generic::Free(const VmaAllocation allocation)
+{
+ for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
+ suballocItem != m_Suballocations.end();
+ ++suballocItem)
+ {
+ VmaSuballocation& suballoc = *suballocItem;
+ if(suballoc.hAllocation == allocation)
+ {
+ FreeSuballocation(suballocItem);
+ VMA_HEAVY_ASSERT(Validate());
+ return;
+ }
+ }
+ VMA_ASSERT(0 && "Not found!");
+}
+
+void VmaBlockMetadata_Generic::FreeAtOffset(VkDeviceSize offset)
+{
+ for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
+ suballocItem != m_Suballocations.end();
+ ++suballocItem)
+ {
+ VmaSuballocation& suballoc = *suballocItem;
+ if(suballoc.offset == offset)
+ {
+ FreeSuballocation(suballocItem);
+ return;
+ }
+ }
+ VMA_ASSERT(0 && "Not found!");
+}
+
+bool VmaBlockMetadata_Generic::ResizeAllocation(const VmaAllocation alloc, VkDeviceSize newSize)
+{
+ typedef VmaSuballocationList::iterator iter_type;
+ for(iter_type suballocItem = m_Suballocations.begin();
+ suballocItem != m_Suballocations.end();
+ ++suballocItem)
+ {
+ VmaSuballocation& suballoc = *suballocItem;
+ if(suballoc.hAllocation == alloc)
+ {
+ iter_type nextItem = suballocItem;
+ ++nextItem;
+
+ // Should have been ensured on higher level.
+ VMA_ASSERT(newSize != alloc->GetSize() && newSize > 0);
+
+ // Shrinking.
+ if(newSize < alloc->GetSize())
+ {
+ const VkDeviceSize sizeDiff = suballoc.size - newSize;
+
+ // There is next item.
+ if(nextItem != m_Suballocations.end())
+ {
+ // Next item is free.
+ if(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ // Grow this next item backward.
+ UnregisterFreeSuballocation(nextItem);
+ nextItem->offset -= sizeDiff;
+ nextItem->size += sizeDiff;
+ RegisterFreeSuballocation(nextItem);
+ }
+ // Next item is not free.
+ else
+ {
+ // Create free item after current one.
+ VmaSuballocation newFreeSuballoc;
+ newFreeSuballoc.hAllocation = VK_NULL_HANDLE;
+ newFreeSuballoc.offset = suballoc.offset + newSize;
+ newFreeSuballoc.size = sizeDiff;
+ newFreeSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ iter_type newFreeSuballocIt = m_Suballocations.insert(nextItem, newFreeSuballoc);
+ RegisterFreeSuballocation(newFreeSuballocIt);
+
+ ++m_FreeCount;
+ }
+ }
+ // This is the last item.
+ else
+ {
+ // Create free item at the end.
+ VmaSuballocation newFreeSuballoc;
+ newFreeSuballoc.hAllocation = VK_NULL_HANDLE;
+ newFreeSuballoc.offset = suballoc.offset + newSize;
+ newFreeSuballoc.size = sizeDiff;
+ newFreeSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ m_Suballocations.push_back(newFreeSuballoc);
+
+ iter_type newFreeSuballocIt = m_Suballocations.end();
+ RegisterFreeSuballocation(--newFreeSuballocIt);
+
+ ++m_FreeCount;
+ }
+
+ suballoc.size = newSize;
+ m_SumFreeSize += sizeDiff;
+ }
+ // Growing.
+ else
+ {
+ const VkDeviceSize sizeDiff = newSize - suballoc.size;
+
+ // There is next item.
+ if(nextItem != m_Suballocations.end())
+ {
+ // Next item is free.
+ if(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ // There is not enough free space, including margin.
+ if(nextItem->size < sizeDiff + VMA_DEBUG_MARGIN)
+ {
+ return false;
+ }
+
+ // There is more free space than required.
+ if(nextItem->size > sizeDiff)
+ {
+ // Move and shrink this next item.
+ UnregisterFreeSuballocation(nextItem);
+ nextItem->offset += sizeDiff;
+ nextItem->size -= sizeDiff;
+ RegisterFreeSuballocation(nextItem);
+ }
+ // There is exactly the amount of free space required.
+ else
+ {
+ // Remove this next free item.
+ UnregisterFreeSuballocation(nextItem);
+ m_Suballocations.erase(nextItem);
+ --m_FreeCount;
+ }
+ }
+ // Next item is not free - there is no space to grow.
+ else
+ {
+ return false;
+ }
+ }
+ // This is the last item - there is no space to grow.
+ else
+ {
+ return false;
+ }
+
+ suballoc.size = newSize;
+ m_SumFreeSize -= sizeDiff;
+ }
+
+ // We cannot call Validate() here because alloc object is updated to new size outside of this call.
+ return true;
+ }
+ }
+ VMA_ASSERT(0 && "Not found!");
+ return false;
+}
+
+bool VmaBlockMetadata_Generic::ValidateFreeSuballocationList() const
+{
+ VkDeviceSize lastSize = 0;
+ for(size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i)
+ {
+ const VmaSuballocationList::iterator it = m_FreeSuballocationsBySize[i];
+
+ VMA_VALIDATE(it->type == VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_VALIDATE(it->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER);
+ VMA_VALIDATE(it->size >= lastSize);
+ lastSize = it->size;
+ }
+ return true;
+}
+
+bool VmaBlockMetadata_Generic::CheckAllocation(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ VmaSuballocationType allocType,
+ VmaSuballocationList::const_iterator suballocItem,
+ bool canMakeOtherLost,
+ VkDeviceSize* pOffset,
+ size_t* itemsToMakeLostCount,
+ VkDeviceSize* pSumFreeSize,
+ VkDeviceSize* pSumItemSize) const
+{
+ VMA_ASSERT(allocSize > 0);
+ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(suballocItem != m_Suballocations.cend());
+ VMA_ASSERT(pOffset != VMA_NULL);
+
+ *itemsToMakeLostCount = 0;
+ *pSumFreeSize = 0;
+ *pSumItemSize = 0;
+
+ if(canMakeOtherLost)
+ {
+ if(suballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ *pSumFreeSize = suballocItem->size;
+ }
+ else
+ {
+ if(suballocItem->hAllocation->CanBecomeLost() &&
+ suballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+ {
+ ++*itemsToMakeLostCount;
+ *pSumItemSize = suballocItem->size;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ // Remaining size is too small for this request: Early return.
+ if(GetSize() - suballocItem->offset < allocSize)
+ {
+ return false;
+ }
+
+ // Start from offset equal to beginning of this suballocation.
+ *pOffset = suballocItem->offset;
+
+ // Apply VMA_DEBUG_MARGIN at the beginning.
+ if(VMA_DEBUG_MARGIN > 0)
+ {
+ *pOffset += VMA_DEBUG_MARGIN;
+ }
+
+ // Apply alignment.
+ *pOffset = VmaAlignUp(*pOffset, allocAlignment);
+
+ // Check previous suballocations for BufferImageGranularity conflicts.
+ // Make bigger alignment if necessary.
+ if(bufferImageGranularity > 1)
+ {
+ bool bufferImageGranularityConflict = false;
+ VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
+ while(prevSuballocItem != m_Suballocations.cbegin())
+ {
+ --prevSuballocItem;
+ const VmaSuballocation& prevSuballoc = *prevSuballocItem;
+ if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+ {
+ bufferImageGranularityConflict = true;
+ break;
+ }
+ }
+ else
+ // Already on previous page.
+ break;
+ }
+ if(bufferImageGranularityConflict)
+ {
+ *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity);
+ }
+ }
+
+ // Now that we have final *pOffset, check if we are past suballocItem.
+ // If yes, return false - this function should be called for another suballocItem as starting point.
+ if(*pOffset >= suballocItem->offset + suballocItem->size)
+ {
+ return false;
+ }
+
+ // Calculate padding at the beginning based on current offset.
+ const VkDeviceSize paddingBegin = *pOffset - suballocItem->offset;
+
+ // Calculate required margin at the end.
+ const VkDeviceSize requiredEndMargin = VMA_DEBUG_MARGIN;
+
+ const VkDeviceSize totalSize = paddingBegin + allocSize + requiredEndMargin;
+ // Another early return check.
+ if(suballocItem->offset + totalSize > GetSize())
+ {
+ return false;
+ }
+
+ // Advance lastSuballocItem until desired size is reached.
+ // Update itemsToMakeLostCount.
+ VmaSuballocationList::const_iterator lastSuballocItem = suballocItem;
+ if(totalSize > suballocItem->size)
+ {
+ VkDeviceSize remainingSize = totalSize - suballocItem->size;
+ while(remainingSize > 0)
+ {
+ ++lastSuballocItem;
+ if(lastSuballocItem == m_Suballocations.cend())
+ {
+ return false;
+ }
+ if(lastSuballocItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ *pSumFreeSize += lastSuballocItem->size;
+ }
+ else
+ {
+ VMA_ASSERT(lastSuballocItem->hAllocation != VK_NULL_HANDLE);
+ if(lastSuballocItem->hAllocation->CanBecomeLost() &&
+ lastSuballocItem->hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+ {
+ ++*itemsToMakeLostCount;
+ *pSumItemSize += lastSuballocItem->size;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ remainingSize = (lastSuballocItem->size < remainingSize) ?
+ remainingSize - lastSuballocItem->size : 0;
+ }
+ }
+
+ // Check next suballocations for BufferImageGranularity conflicts.
+ // If conflict exists, we must mark more allocations lost or fail.
+ if(bufferImageGranularity > 1)
+ {
+ VmaSuballocationList::const_iterator nextSuballocItem = lastSuballocItem;
+ ++nextSuballocItem;
+ while(nextSuballocItem != m_Suballocations.cend())
+ {
+ const VmaSuballocation& nextSuballoc = *nextSuballocItem;
+ if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+ {
+ VMA_ASSERT(nextSuballoc.hAllocation != VK_NULL_HANDLE);
+ if(nextSuballoc.hAllocation->CanBecomeLost() &&
+ nextSuballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+ {
+ ++*itemsToMakeLostCount;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ // Already on next page.
+ break;
+ }
+ ++nextSuballocItem;
+ }
+ }
+ }
+ else
+ {
+ const VmaSuballocation& suballoc = *suballocItem;
+ VMA_ASSERT(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ *pSumFreeSize = suballoc.size;
+
+ // Size of this suballocation is too small for this request: Early return.
+ if(suballoc.size < allocSize)
+ {
+ return false;
+ }
+
+ // Start from offset equal to beginning of this suballocation.
+ *pOffset = suballoc.offset;
+
+ // Apply VMA_DEBUG_MARGIN at the beginning.
+ if(VMA_DEBUG_MARGIN > 0)
+ {
+ *pOffset += VMA_DEBUG_MARGIN;
+ }
+
+ // Apply alignment.
+ *pOffset = VmaAlignUp(*pOffset, allocAlignment);
+
+ // Check previous suballocations for BufferImageGranularity conflicts.
+ // Make bigger alignment if necessary.
+ if(bufferImageGranularity > 1)
+ {
+ bool bufferImageGranularityConflict = false;
+ VmaSuballocationList::const_iterator prevSuballocItem = suballocItem;
+ while(prevSuballocItem != m_Suballocations.cbegin())
+ {
+ --prevSuballocItem;
+ const VmaSuballocation& prevSuballoc = *prevSuballocItem;
+ if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, *pOffset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+ {
+ bufferImageGranularityConflict = true;
+ break;
+ }
+ }
+ else
+ // Already on previous page.
+ break;
+ }
+ if(bufferImageGranularityConflict)
+ {
+ *pOffset = VmaAlignUp(*pOffset, bufferImageGranularity);
+ }
+ }
+
+ // Calculate padding at the beginning based on current offset.
+ const VkDeviceSize paddingBegin = *pOffset - suballoc.offset;
+
+ // Calculate required margin at the end.
+ const VkDeviceSize requiredEndMargin = VMA_DEBUG_MARGIN;
+
+ // Fail if requested size plus margin before and after is bigger than size of this suballocation.
+ if(paddingBegin + allocSize + requiredEndMargin > suballoc.size)
+ {
+ return false;
+ }
+
+ // Check next suballocations for BufferImageGranularity conflicts.
+ // If conflict exists, allocation cannot be made here.
+ if(bufferImageGranularity > 1)
+ {
+ VmaSuballocationList::const_iterator nextSuballocItem = suballocItem;
+ ++nextSuballocItem;
+ while(nextSuballocItem != m_Suballocations.cend())
+ {
+ const VmaSuballocation& nextSuballoc = *nextSuballocItem;
+ if(VmaBlocksOnSamePage(*pOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // Already on next page.
+ break;
+ }
+ ++nextSuballocItem;
+ }
+ }
+ }
+
+ // All tests passed: Success. pOffset is already filled.
+ return true;
+}
+
+void VmaBlockMetadata_Generic::MergeFreeWithNext(VmaSuballocationList::iterator item)
+{
+ VMA_ASSERT(item != m_Suballocations.end());
+ VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ VmaSuballocationList::iterator nextItem = item;
+ ++nextItem;
+ VMA_ASSERT(nextItem != m_Suballocations.end());
+ VMA_ASSERT(nextItem->type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ item->size += nextItem->size;
+ --m_FreeCount;
+ m_Suballocations.erase(nextItem);
+}
+
+VmaSuballocationList::iterator VmaBlockMetadata_Generic::FreeSuballocation(VmaSuballocationList::iterator suballocItem)
+{
+ // Change this suballocation to be marked as free.
+ VmaSuballocation& suballoc = *suballocItem;
+ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ suballoc.hAllocation = VK_NULL_HANDLE;
+
+ // Update totals.
+ ++m_FreeCount;
+ m_SumFreeSize += suballoc.size;
+
+ // Merge with previous and/or next suballocation if it's also free.
+ bool mergeWithNext = false;
+ bool mergeWithPrev = false;
+
+ VmaSuballocationList::iterator nextItem = suballocItem;
+ ++nextItem;
+ if((nextItem != m_Suballocations.end()) && (nextItem->type == VMA_SUBALLOCATION_TYPE_FREE))
+ {
+ mergeWithNext = true;
+ }
+
+ VmaSuballocationList::iterator prevItem = suballocItem;
+ if(suballocItem != m_Suballocations.begin())
+ {
+ --prevItem;
+ if(prevItem->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ mergeWithPrev = true;
+ }
+ }
+
+ if(mergeWithNext)
+ {
+ UnregisterFreeSuballocation(nextItem);
+ MergeFreeWithNext(suballocItem);
+ }
+
+ if(mergeWithPrev)
+ {
+ UnregisterFreeSuballocation(prevItem);
+ MergeFreeWithNext(prevItem);
+ RegisterFreeSuballocation(prevItem);
+ return prevItem;
+ }
+ else
+ {
+ RegisterFreeSuballocation(suballocItem);
+ return suballocItem;
+ }
+}
+
+void VmaBlockMetadata_Generic::RegisterFreeSuballocation(VmaSuballocationList::iterator item)
+{
+ VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(item->size > 0);
+
+ // You may want to enable this validation at the beginning or at the end of
+ // this function, depending on what do you want to check.
+ VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+
+ if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ if(m_FreeSuballocationsBySize.empty())
+ {
+ m_FreeSuballocationsBySize.push_back(item);
+ }
+ else
+ {
+ VmaVectorInsertSorted<VmaSuballocationItemSizeLess>(m_FreeSuballocationsBySize, item);
+ }
+ }
+
+ //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+}
+
+
+void VmaBlockMetadata_Generic::UnregisterFreeSuballocation(VmaSuballocationList::iterator item)
+{
+ VMA_ASSERT(item->type == VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(item->size > 0);
+
+ // You may want to enable this validation at the beginning or at the end of
+ // this function, depending on what do you want to check.
+ VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+
+ if(item->size >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ VmaSuballocationList::iterator* const it = VmaBinaryFindFirstNotLess(
+ m_FreeSuballocationsBySize.data(),
+ m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(),
+ item,
+ VmaSuballocationItemSizeLess());
+ for(size_t index = it - m_FreeSuballocationsBySize.data();
+ index < m_FreeSuballocationsBySize.size();
+ ++index)
+ {
+ if(m_FreeSuballocationsBySize[index] == item)
+ {
+ VmaVectorRemove(m_FreeSuballocationsBySize, index);
+ return;
+ }
+ VMA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found.");
+ }
+ VMA_ASSERT(0 && "Not found.");
+ }
+
+ //VMA_HEAVY_ASSERT(ValidateFreeSuballocationList());
+}
+
+bool VmaBlockMetadata_Generic::IsBufferImageGranularityConflictPossible(
+ VkDeviceSize bufferImageGranularity,
+ VmaSuballocationType& inOutPrevSuballocType) const
+{
+ if(bufferImageGranularity == 1 || IsEmpty())
+ {
+ return false;
+ }
+
+ VkDeviceSize minAlignment = VK_WHOLE_SIZE;
+ bool typeConflictFound = false;
+ for(VmaSuballocationList::const_iterator it = m_Suballocations.cbegin();
+ it != m_Suballocations.cend();
+ ++it)
+ {
+ const VmaSuballocationType suballocType = it->type;
+ if(suballocType != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ minAlignment = VMA_MIN(minAlignment, it->hAllocation->GetAlignment());
+ if(VmaIsBufferImageGranularityConflict(inOutPrevSuballocType, suballocType))
+ {
+ typeConflictFound = true;
+ }
+ inOutPrevSuballocType = suballocType;
+ }
+ }
+
+ return typeConflictFound || minAlignment >= bufferImageGranularity;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaBlockMetadata_Linear
+
+VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(VmaAllocator hAllocator) :
+ VmaBlockMetadata(hAllocator),
+ m_SumFreeSize(0),
+ m_Suballocations0(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
+ m_Suballocations1(VmaStlAllocator<VmaSuballocation>(hAllocator->GetAllocationCallbacks())),
+ m_1stVectorIndex(0),
+ m_2ndVectorMode(SECOND_VECTOR_EMPTY),
+ m_1stNullItemsBeginCount(0),
+ m_1stNullItemsMiddleCount(0),
+ m_2ndNullItemsCount(0)
+{
+}
+
+VmaBlockMetadata_Linear::~VmaBlockMetadata_Linear()
+{
+}
+
+void VmaBlockMetadata_Linear::Init(VkDeviceSize size)
+{
+ VmaBlockMetadata::Init(size);
+ m_SumFreeSize = size;
+}
+
+bool VmaBlockMetadata_Linear::Validate() const
+{
+ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+ VMA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY));
+ VMA_VALIDATE(!suballocations1st.empty() ||
+ suballocations2nd.empty() ||
+ m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER);
+
+ if(!suballocations1st.empty())
+ {
+ // Null item at the beginning should be accounted into m_1stNullItemsBeginCount.
+ VMA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].hAllocation != VK_NULL_HANDLE);
+ // Null item at the end should be just pop_back().
+ VMA_VALIDATE(suballocations1st.back().hAllocation != VK_NULL_HANDLE);
+ }
+ if(!suballocations2nd.empty())
+ {
+ // Null item at the end should be just pop_back().
+ VMA_VALIDATE(suballocations2nd.back().hAllocation != VK_NULL_HANDLE);
+ }
+
+ VMA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size());
+ VMA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size());
+
+ VkDeviceSize sumUsedSize = 0;
+ const size_t suballoc1stCount = suballocations1st.size();
+ VkDeviceSize offset = VMA_DEBUG_MARGIN;
+
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ const size_t suballoc2ndCount = suballocations2nd.size();
+ size_t nullItem2ndCount = 0;
+ for(size_t i = 0; i < suballoc2ndCount; ++i)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[i];
+ const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
+ VMA_VALIDATE(suballoc.offset >= offset);
+
+ if(!currFree)
+ {
+ VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
+ VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
+ sumUsedSize += suballoc.size;
+ }
+ else
+ {
+ ++nullItem2ndCount;
+ }
+
+ offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
+ }
+
+ VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
+ }
+
+ for(size_t i = 0; i < m_1stNullItemsBeginCount; ++i)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[i];
+ VMA_VALIDATE(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE &&
+ suballoc.hAllocation == VK_NULL_HANDLE);
+ }
+
+ size_t nullItem1stCount = m_1stNullItemsBeginCount;
+
+ for(size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[i];
+ const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
+ VMA_VALIDATE(suballoc.offset >= offset);
+ VMA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree);
+
+ if(!currFree)
+ {
+ VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
+ VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
+ sumUsedSize += suballoc.size;
+ }
+ else
+ {
+ ++nullItem1stCount;
+ }
+
+ offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
+ }
+ VMA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount);
+
+ if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ const size_t suballoc2ndCount = suballocations2nd.size();
+ size_t nullItem2ndCount = 0;
+ for(size_t i = suballoc2ndCount; i--; )
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[i];
+ const bool currFree = (suballoc.type == VMA_SUBALLOCATION_TYPE_FREE);
+
+ VMA_VALIDATE(currFree == (suballoc.hAllocation == VK_NULL_HANDLE));
+ VMA_VALIDATE(suballoc.offset >= offset);
+
+ if(!currFree)
+ {
+ VMA_VALIDATE(suballoc.hAllocation->GetOffset() == suballoc.offset);
+ VMA_VALIDATE(suballoc.hAllocation->GetSize() == suballoc.size);
+ sumUsedSize += suballoc.size;
+ }
+ else
+ {
+ ++nullItem2ndCount;
+ }
+
+ offset = suballoc.offset + suballoc.size + VMA_DEBUG_MARGIN;
+ }
+
+ VMA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount);
+ }
+
+ VMA_VALIDATE(offset <= GetSize());
+ VMA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize);
+
+ return true;
+}
+
+size_t VmaBlockMetadata_Linear::GetAllocationCount() const
+{
+ return AccessSuballocations1st().size() - (m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount) +
+ AccessSuballocations2nd().size() - m_2ndNullItemsCount;
+}
+
+VkDeviceSize VmaBlockMetadata_Linear::GetUnusedRangeSizeMax() const
+{
+ const VkDeviceSize size = GetSize();
+
+ /*
+ We don't consider gaps inside allocation vectors with freed allocations because
+ they are not suitable for reuse in linear allocator. We consider only space that
+ is available for new allocations.
+ */
+ if(IsEmpty())
+ {
+ return size;
+ }
+
+ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+
+ switch(m_2ndVectorMode)
+ {
+ case SECOND_VECTOR_EMPTY:
+ /*
+ Available space is after end of 1st, as well as before beginning of 1st (which
+ whould make it a ring buffer).
+ */
+ {
+ const size_t suballocations1stCount = suballocations1st.size();
+ VMA_ASSERT(suballocations1stCount > m_1stNullItemsBeginCount);
+ const VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
+ const VmaSuballocation& lastSuballoc = suballocations1st[suballocations1stCount - 1];
+ return VMA_MAX(
+ firstSuballoc.offset,
+ size - (lastSuballoc.offset + lastSuballoc.size));
+ }
+ break;
+
+ case SECOND_VECTOR_RING_BUFFER:
+ /*
+ Available space is only between end of 2nd and beginning of 1st.
+ */
+ {
+ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ const VmaSuballocation& lastSuballoc2nd = suballocations2nd.back();
+ const VmaSuballocation& firstSuballoc1st = suballocations1st[m_1stNullItemsBeginCount];
+ return firstSuballoc1st.offset - (lastSuballoc2nd.offset + lastSuballoc2nd.size);
+ }
+ break;
+
+ case SECOND_VECTOR_DOUBLE_STACK:
+ /*
+ Available space is only between end of 1st and top of 2nd.
+ */
+ {
+ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ const VmaSuballocation& topSuballoc2nd = suballocations2nd.back();
+ const VmaSuballocation& lastSuballoc1st = suballocations1st.back();
+ return topSuballoc2nd.offset - (lastSuballoc1st.offset + lastSuballoc1st.size);
+ }
+ break;
+
+ default:
+ VMA_ASSERT(0);
+ return 0;
+ }
+}
+
+void VmaBlockMetadata_Linear::CalcAllocationStatInfo(VmaStatInfo& outInfo) const
+{
+ const VkDeviceSize size = GetSize();
+ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ const size_t suballoc1stCount = suballocations1st.size();
+ const size_t suballoc2ndCount = suballocations2nd.size();
+
+ outInfo.blockCount = 1;
+ outInfo.allocationCount = (uint32_t)GetAllocationCount();
+ outInfo.unusedRangeCount = 0;
+ outInfo.usedBytes = 0;
+ outInfo.allocationSizeMin = UINT64_MAX;
+ outInfo.allocationSizeMax = 0;
+ outInfo.unusedRangeSizeMin = UINT64_MAX;
+ outInfo.unusedRangeSizeMax = 0;
+
+ VkDeviceSize lastOffset = 0;
+
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+ size_t nextAlloc2ndIndex = 0;
+ while(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // Find next non-null allocation or move nextAllocIndex to the end.
+ while(nextAlloc2ndIndex < suballoc2ndCount &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex < suballoc2ndCount)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ outInfo.unusedRangeSizeMax = VMA_MIN(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ outInfo.usedBytes += suballoc.size;
+ outInfo.allocationSizeMin = VMA_MIN(outInfo.allocationSizeMin, suballoc.size);
+ outInfo.allocationSizeMax = VMA_MIN(outInfo.allocationSizeMax, suballoc.size);
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
+ if(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ outInfo.unusedRangeSizeMax = VMA_MIN(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = freeSpace2ndTo1stEnd;
+ }
+ }
+ }
+
+ size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
+ const VkDeviceSize freeSpace1stTo2ndEnd =
+ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
+ while(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ // Find next non-null allocation or move nextAllocIndex to the end.
+ while(nextAlloc1stIndex < suballoc1stCount &&
+ suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc1stIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc1stIndex < suballoc1stCount)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ outInfo.unusedRangeSizeMax = VMA_MIN(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ outInfo.usedBytes += suballoc.size;
+ outInfo.allocationSizeMin = VMA_MIN(outInfo.allocationSizeMin, suballoc.size);
+ outInfo.allocationSizeMax = VMA_MIN(outInfo.allocationSizeMax, suballoc.size);
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc1stIndex;
+ }
+ // We are at the end.
+ else
+ {
+ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
+ if(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ outInfo.unusedRangeSizeMax = VMA_MIN(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = freeSpace1stTo2ndEnd;
+ }
+ }
+
+ if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+ while(lastOffset < size)
+ {
+ // Find next non-null allocation or move nextAllocIndex to the end.
+ while(nextAlloc2ndIndex != SIZE_MAX &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ --nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex != SIZE_MAX)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ outInfo.unusedRangeSizeMax = VMA_MIN(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ outInfo.usedBytes += suballoc.size;
+ outInfo.allocationSizeMin = VMA_MIN(outInfo.allocationSizeMin, suballoc.size);
+ outInfo.allocationSizeMax = VMA_MIN(outInfo.allocationSizeMax, suballoc.size);
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ --nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ // There is free space from lastOffset to size.
+ if(lastOffset < size)
+ {
+ const VkDeviceSize unusedRangeSize = size - lastOffset;
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ outInfo.unusedRangeSizeMax = VMA_MIN(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = size;
+ }
+ }
+ }
+
+ outInfo.unusedBytes = size - outInfo.usedBytes;
+}
+
+void VmaBlockMetadata_Linear::AddPoolStats(VmaPoolStats& inoutStats) const
+{
+ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ const VkDeviceSize size = GetSize();
+ const size_t suballoc1stCount = suballocations1st.size();
+ const size_t suballoc2ndCount = suballocations2nd.size();
+
+ inoutStats.size += size;
+
+ VkDeviceSize lastOffset = 0;
+
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+ size_t nextAlloc2ndIndex = m_1stNullItemsBeginCount;
+ while(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
+ while(nextAlloc2ndIndex < suballoc2ndCount &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex < suballoc2ndCount)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ inoutStats.unusedSize += unusedRangeSize;
+ ++inoutStats.unusedRangeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ ++inoutStats.allocationCount;
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
+ const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
+ inoutStats.unusedSize += unusedRangeSize;
+ ++inoutStats.unusedRangeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = freeSpace2ndTo1stEnd;
+ }
+ }
+ }
+
+ size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
+ const VkDeviceSize freeSpace1stTo2ndEnd =
+ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
+ while(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ // Find next non-null allocation or move nextAllocIndex to the end.
+ while(nextAlloc1stIndex < suballoc1stCount &&
+ suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc1stIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc1stIndex < suballoc1stCount)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ inoutStats.unusedSize += unusedRangeSize;
+ ++inoutStats.unusedRangeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ ++inoutStats.allocationCount;
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc1stIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
+ const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
+ inoutStats.unusedSize += unusedRangeSize;
+ ++inoutStats.unusedRangeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = freeSpace1stTo2ndEnd;
+ }
+ }
+
+ if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+ while(lastOffset < size)
+ {
+ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
+ while(nextAlloc2ndIndex != SIZE_MAX &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ --nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex != SIZE_MAX)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ inoutStats.unusedSize += unusedRangeSize;
+ ++inoutStats.unusedRangeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ ++inoutStats.allocationCount;
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ --nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < size)
+ {
+ // There is free space from lastOffset to size.
+ const VkDeviceSize unusedRangeSize = size - lastOffset;
+ inoutStats.unusedSize += unusedRangeSize;
+ ++inoutStats.unusedRangeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = size;
+ }
+ }
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+void VmaBlockMetadata_Linear::PrintDetailedMap(class VmaJsonWriter& json) const
+{
+ const VkDeviceSize size = GetSize();
+ const SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ const size_t suballoc1stCount = suballocations1st.size();
+ const size_t suballoc2ndCount = suballocations2nd.size();
+
+ // FIRST PASS
+
+ size_t unusedRangeCount = 0;
+ VkDeviceSize usedBytes = 0;
+
+ VkDeviceSize lastOffset = 0;
+
+ size_t alloc2ndCount = 0;
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+ size_t nextAlloc2ndIndex = 0;
+ while(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
+ while(nextAlloc2ndIndex < suballoc2ndCount &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex < suballoc2ndCount)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ ++unusedRangeCount;
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ ++alloc2ndCount;
+ usedBytes += suballoc.size;
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
+ ++unusedRangeCount;
+ }
+
+ // End of loop.
+ lastOffset = freeSpace2ndTo1stEnd;
+ }
+ }
+ }
+
+ size_t nextAlloc1stIndex = m_1stNullItemsBeginCount;
+ size_t alloc1stCount = 0;
+ const VkDeviceSize freeSpace1stTo2ndEnd =
+ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size;
+ while(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ // Find next non-null allocation or move nextAllocIndex to the end.
+ while(nextAlloc1stIndex < suballoc1stCount &&
+ suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc1stIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc1stIndex < suballoc1stCount)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ ++unusedRangeCount;
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ ++alloc1stCount;
+ usedBytes += suballoc.size;
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc1stIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < size)
+ {
+ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
+ ++unusedRangeCount;
+ }
+
+ // End of loop.
+ lastOffset = freeSpace1stTo2ndEnd;
+ }
+ }
+
+ if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+ while(lastOffset < size)
+ {
+ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
+ while(nextAlloc2ndIndex != SIZE_MAX &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ --nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex != SIZE_MAX)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ ++unusedRangeCount;
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ ++alloc2ndCount;
+ usedBytes += suballoc.size;
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ --nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < size)
+ {
+ // There is free space from lastOffset to size.
+ ++unusedRangeCount;
+ }
+
+ // End of loop.
+ lastOffset = size;
+ }
+ }
+ }
+
+ const VkDeviceSize unusedBytes = size - usedBytes;
+ PrintDetailedMap_Begin(json, unusedBytes, alloc1stCount + alloc2ndCount, unusedRangeCount);
+
+ // SECOND PASS
+ lastOffset = 0;
+
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ const VkDeviceSize freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset;
+ size_t nextAlloc2ndIndex = 0;
+ while(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
+ while(nextAlloc2ndIndex < suballoc2ndCount &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex < suballoc2ndCount)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < freeSpace2ndTo1stEnd)
+ {
+ // There is free space from lastOffset to freeSpace2ndTo1stEnd.
+ const VkDeviceSize unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset;
+ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = freeSpace2ndTo1stEnd;
+ }
+ }
+ }
+
+ nextAlloc1stIndex = m_1stNullItemsBeginCount;
+ while(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ // Find next non-null allocation or move nextAllocIndex to the end.
+ while(nextAlloc1stIndex < suballoc1stCount &&
+ suballocations1st[nextAlloc1stIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++nextAlloc1stIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc1stIndex < suballoc1stCount)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[nextAlloc1stIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ ++nextAlloc1stIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < freeSpace1stTo2ndEnd)
+ {
+ // There is free space from lastOffset to freeSpace1stTo2ndEnd.
+ const VkDeviceSize unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset;
+ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = freeSpace1stTo2ndEnd;
+ }
+ }
+
+ if(m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ size_t nextAlloc2ndIndex = suballocations2nd.size() - 1;
+ while(lastOffset < size)
+ {
+ // Find next non-null allocation or move nextAlloc2ndIndex to the end.
+ while(nextAlloc2ndIndex != SIZE_MAX &&
+ suballocations2nd[nextAlloc2ndIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ --nextAlloc2ndIndex;
+ }
+
+ // Found non-null allocation.
+ if(nextAlloc2ndIndex != SIZE_MAX)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[nextAlloc2ndIndex];
+
+ // 1. Process free space before this allocation.
+ if(lastOffset < suballoc.offset)
+ {
+ // There is free space from lastOffset to suballoc.offset.
+ const VkDeviceSize unusedRangeSize = suballoc.offset - lastOffset;
+ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+ }
+
+ // 2. Process this allocation.
+ // There is allocation with suballoc.offset, suballoc.size.
+ PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.hAllocation);
+
+ // 3. Prepare for next iteration.
+ lastOffset = suballoc.offset + suballoc.size;
+ --nextAlloc2ndIndex;
+ }
+ // We are at the end.
+ else
+ {
+ if(lastOffset < size)
+ {
+ // There is free space from lastOffset to size.
+ const VkDeviceSize unusedRangeSize = size - lastOffset;
+ PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize);
+ }
+
+ // End of loop.
+ lastOffset = size;
+ }
+ }
+ }
+
+ PrintDetailedMap_End(json);
+}
+#endif // #if VMA_STATS_STRING_ENABLED
+
+bool VmaBlockMetadata_Linear::CreateAllocationRequest(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool canMakeOtherLost,
+ uint32_t /*strategy*/,
+ VmaAllocationRequest* pAllocationRequest)
+{
+ VMA_ASSERT(allocSize > 0);
+ VMA_ASSERT(allocType != VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(pAllocationRequest != VMA_NULL);
+ VMA_HEAVY_ASSERT(Validate());
+
+ const VkDeviceSize size = GetSize();
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+ if(upperAddress)
+ {
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ VMA_ASSERT(0 && "Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer.");
+ return false;
+ }
+
+ // Try to allocate before 2nd.back(), or end of block if 2nd.empty().
+ if(allocSize > size)
+ {
+ return false;
+ }
+ VkDeviceSize resultBaseOffset = size - allocSize;
+ if(!suballocations2nd.empty())
+ {
+ const VmaSuballocation& lastSuballoc = suballocations2nd.back();
+ resultBaseOffset = lastSuballoc.offset - allocSize;
+ if(allocSize > lastSuballoc.offset)
+ {
+ return false;
+ }
+ }
+
+ // Start from offset equal to end of free space.
+ VkDeviceSize resultOffset = resultBaseOffset;
+
+ // Apply VMA_DEBUG_MARGIN at the end.
+ if(VMA_DEBUG_MARGIN > 0)
+ {
+#if VMA_DEBUG_MARGIN
+ if(resultOffset < VMA_DEBUG_MARGIN)
+ {
+ return false;
+ }
+#endif
+ resultOffset -= VMA_DEBUG_MARGIN;
+ }
+
+ // Apply alignment.
+ resultOffset = VmaAlignDown(resultOffset, allocAlignment);
+
+ // Check next suballocations from 2nd for BufferImageGranularity conflicts.
+ // Make bigger alignment if necessary.
+ if(bufferImageGranularity > 1 && !suballocations2nd.empty())
+ {
+ bool bufferImageGranularityConflict = false;
+ for(size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
+ {
+ const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
+ if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(nextSuballoc.type, allocType))
+ {
+ bufferImageGranularityConflict = true;
+ break;
+ }
+ }
+ else
+ // Already on previous page.
+ break;
+ }
+ if(bufferImageGranularityConflict)
+ {
+ resultOffset = VmaAlignDown(resultOffset, bufferImageGranularity);
+ }
+ }
+
+ // There is enough free space.
+ const VkDeviceSize endOf1st = !suballocations1st.empty() ?
+ suballocations1st.back().offset + suballocations1st.back().size :
+ 0;
+ if(endOf1st + VMA_DEBUG_MARGIN <= resultOffset)
+ {
+ // Check previous suballocations for BufferImageGranularity conflicts.
+ // If conflict exists, allocation cannot be made here.
+ if(bufferImageGranularity > 1)
+ {
+ for(size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
+ {
+ const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
+ if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(allocType, prevSuballoc.type))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // Already on next page.
+ break;
+ }
+ }
+ }
+
+ // All tests passed: Success.
+ pAllocationRequest->offset = resultOffset;
+ pAllocationRequest->sumFreeSize = resultBaseOffset + allocSize - endOf1st;
+ pAllocationRequest->sumItemSize = 0;
+ // pAllocationRequest->item unused.
+ pAllocationRequest->itemsToMakeLostCount = 0;
+ return true;
+ }
+ }
+ else // !upperAddress
+ {
+ if(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ // Try to allocate at the end of 1st vector.
+
+ VkDeviceSize resultBaseOffset = 0;
+ if(!suballocations1st.empty())
+ {
+ const VmaSuballocation& lastSuballoc = suballocations1st.back();
+ resultBaseOffset = lastSuballoc.offset + lastSuballoc.size;
+ }
+
+ // Start from offset equal to beginning of free space.
+ VkDeviceSize resultOffset = resultBaseOffset;
+
+ // Apply VMA_DEBUG_MARGIN at the beginning.
+ if(VMA_DEBUG_MARGIN > 0)
+ {
+ resultOffset += VMA_DEBUG_MARGIN;
+ }
+
+ // Apply alignment.
+ resultOffset = VmaAlignUp(resultOffset, allocAlignment);
+
+ // Check previous suballocations for BufferImageGranularity conflicts.
+ // Make bigger alignment if necessary.
+ if(bufferImageGranularity > 1 && !suballocations1st.empty())
+ {
+ bool bufferImageGranularityConflict = false;
+ for(size_t prevSuballocIndex = suballocations1st.size(); prevSuballocIndex--; )
+ {
+ const VmaSuballocation& prevSuballoc = suballocations1st[prevSuballocIndex];
+ if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+ {
+ bufferImageGranularityConflict = true;
+ break;
+ }
+ }
+ else
+ // Already on previous page.
+ break;
+ }
+ if(bufferImageGranularityConflict)
+ {
+ resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
+ }
+ }
+
+ const VkDeviceSize freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ?
+ suballocations2nd.back().offset : size;
+
+ // There is enough free space at the end after alignment.
+ if(resultOffset + allocSize + VMA_DEBUG_MARGIN <= freeSpaceEnd)
+ {
+ // Check next suballocations for BufferImageGranularity conflicts.
+ // If conflict exists, allocation cannot be made here.
+ if(bufferImageGranularity > 1 && m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ for(size_t nextSuballocIndex = suballocations2nd.size(); nextSuballocIndex--; )
+ {
+ const VmaSuballocation& nextSuballoc = suballocations2nd[nextSuballocIndex];
+ if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // Already on previous page.
+ break;
+ }
+ }
+ }
+
+ // All tests passed: Success.
+ pAllocationRequest->offset = resultOffset;
+ pAllocationRequest->sumFreeSize = freeSpaceEnd - resultBaseOffset;
+ pAllocationRequest->sumItemSize = 0;
+ // pAllocationRequest->item unused.
+ pAllocationRequest->itemsToMakeLostCount = 0;
+ return true;
+ }
+ }
+
+ // Wrap-around to end of 2nd vector. Try to allocate there, watching for the
+ // beginning of 1st vector as the end of free space.
+ if(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ VMA_ASSERT(!suballocations1st.empty());
+
+ VkDeviceSize resultBaseOffset = 0;
+ if(!suballocations2nd.empty())
+ {
+ const VmaSuballocation& lastSuballoc = suballocations2nd.back();
+ resultBaseOffset = lastSuballoc.offset + lastSuballoc.size;
+ }
+
+ // Start from offset equal to beginning of free space.
+ VkDeviceSize resultOffset = resultBaseOffset;
+
+ // Apply VMA_DEBUG_MARGIN at the beginning.
+ if(VMA_DEBUG_MARGIN > 0)
+ {
+ resultOffset += VMA_DEBUG_MARGIN;
+ }
+
+ // Apply alignment.
+ resultOffset = VmaAlignUp(resultOffset, allocAlignment);
+
+ // Check previous suballocations for BufferImageGranularity conflicts.
+ // Make bigger alignment if necessary.
+ if(bufferImageGranularity > 1 && !suballocations2nd.empty())
+ {
+ bool bufferImageGranularityConflict = false;
+ for(size_t prevSuballocIndex = suballocations2nd.size(); prevSuballocIndex--; )
+ {
+ const VmaSuballocation& prevSuballoc = suballocations2nd[prevSuballocIndex];
+ if(VmaBlocksOnSamePage(prevSuballoc.offset, prevSuballoc.size, resultOffset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(prevSuballoc.type, allocType))
+ {
+ bufferImageGranularityConflict = true;
+ break;
+ }
+ }
+ else
+ // Already on previous page.
+ break;
+ }
+ if(bufferImageGranularityConflict)
+ {
+ resultOffset = VmaAlignUp(resultOffset, bufferImageGranularity);
+ }
+ }
+
+ pAllocationRequest->itemsToMakeLostCount = 0;
+ pAllocationRequest->sumItemSize = 0;
+ size_t index1st = m_1stNullItemsBeginCount;
+
+ if(canMakeOtherLost)
+ {
+ while(index1st < suballocations1st.size() &&
+ resultOffset + allocSize + VMA_DEBUG_MARGIN > suballocations1st[index1st].offset)
+ {
+ // Next colliding allocation at the beginning of 1st vector found. Try to make it lost.
+ const VmaSuballocation& suballoc = suballocations1st[index1st];
+ if(suballoc.type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ // No problem.
+ }
+ else
+ {
+ VMA_ASSERT(suballoc.hAllocation != VK_NULL_HANDLE);
+ if(suballoc.hAllocation->CanBecomeLost() &&
+ suballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+ {
+ ++pAllocationRequest->itemsToMakeLostCount;
+ pAllocationRequest->sumItemSize += suballoc.size;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ ++index1st;
+ }
+
+ // Check next suballocations for BufferImageGranularity conflicts.
+ // If conflict exists, we must mark more allocations lost or fail.
+ if(bufferImageGranularity > 1)
+ {
+ while(index1st < suballocations1st.size())
+ {
+ const VmaSuballocation& suballoc = suballocations1st[index1st];
+ if(VmaBlocksOnSamePage(resultOffset, allocSize, suballoc.offset, bufferImageGranularity))
+ {
+ if(suballoc.hAllocation != VK_NULL_HANDLE)
+ {
+ // Not checking actual VmaIsBufferImageGranularityConflict(allocType, suballoc.type).
+ if(suballoc.hAllocation->CanBecomeLost() &&
+ suballoc.hAllocation->GetLastUseFrameIndex() + frameInUseCount < currentFrameIndex)
+ {
+ ++pAllocationRequest->itemsToMakeLostCount;
+ pAllocationRequest->sumItemSize += suballoc.size;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ // Already on next page.
+ break;
+ }
+ ++index1st;
+ }
+ }
+ }
+
+ // There is enough free space at the end after alignment.
+ if((index1st == suballocations1st.size() && resultOffset + allocSize + VMA_DEBUG_MARGIN < size) ||
+ (index1st < suballocations1st.size() && resultOffset + allocSize + VMA_DEBUG_MARGIN <= suballocations1st[index1st].offset))
+ {
+ // Check next suballocations for BufferImageGranularity conflicts.
+ // If conflict exists, allocation cannot be made here.
+ if(bufferImageGranularity > 1)
+ {
+ for(size_t nextSuballocIndex = index1st;
+ nextSuballocIndex < suballocations1st.size();
+ nextSuballocIndex++)
+ {
+ const VmaSuballocation& nextSuballoc = suballocations1st[nextSuballocIndex];
+ if(VmaBlocksOnSamePage(resultOffset, allocSize, nextSuballoc.offset, bufferImageGranularity))
+ {
+ if(VmaIsBufferImageGranularityConflict(allocType, nextSuballoc.type))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ // Already on next page.
+ break;
+ }
+ }
+ }
+
+ // All tests passed: Success.
+ pAllocationRequest->offset = resultOffset;
+ pAllocationRequest->sumFreeSize =
+ (index1st < suballocations1st.size() ? suballocations1st[index1st].offset : size)
+ - resultBaseOffset
+ - pAllocationRequest->sumItemSize;
+ // pAllocationRequest->item unused.
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool VmaBlockMetadata_Linear::MakeRequestedAllocationsLost(
+ uint32_t currentFrameIndex,
+ uint32_t frameInUseCount,
+ VmaAllocationRequest* pAllocationRequest)
+{
+ if(pAllocationRequest->itemsToMakeLostCount == 0)
+ {
+ return true;
+ }
+
+ VMA_ASSERT(m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER);
+
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ size_t index1st = m_1stNullItemsBeginCount;
+ size_t madeLostCount = 0;
+ while(madeLostCount < pAllocationRequest->itemsToMakeLostCount)
+ {
+ VMA_ASSERT(index1st < suballocations1st.size());
+ VmaSuballocation& suballoc = suballocations1st[index1st];
+ if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ VMA_ASSERT(suballoc.hAllocation != VK_NULL_HANDLE);
+ VMA_ASSERT(suballoc.hAllocation->CanBecomeLost());
+ if(suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+ {
+ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ suballoc.hAllocation = VK_NULL_HANDLE;
+ m_SumFreeSize += suballoc.size;
+ ++m_1stNullItemsMiddleCount;
+ ++madeLostCount;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ ++index1st;
+ }
+
+ CleanupAfterFree();
+ //VMA_HEAVY_ASSERT(Validate()); // Already called by ClanupAfterFree().
+
+ return true;
+}
+
+uint32_t VmaBlockMetadata_Linear::MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount)
+{
+ uint32_t lostAllocationCount = 0;
+
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ for(size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
+ {
+ VmaSuballocation& suballoc = suballocations1st[i];
+ if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE &&
+ suballoc.hAllocation->CanBecomeLost() &&
+ suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+ {
+ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ suballoc.hAllocation = VK_NULL_HANDLE;
+ ++m_1stNullItemsMiddleCount;
+ m_SumFreeSize += suballoc.size;
+ ++lostAllocationCount;
+ }
+ }
+
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ for(size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
+ {
+ VmaSuballocation& suballoc = suballocations2nd[i];
+ if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE &&
+ suballoc.hAllocation->CanBecomeLost() &&
+ suballoc.hAllocation->MakeLost(currentFrameIndex, frameInUseCount))
+ {
+ suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ suballoc.hAllocation = VK_NULL_HANDLE;
+ ++m_2ndNullItemsCount;
+ ++lostAllocationCount;
+ }
+ }
+
+ if(lostAllocationCount)
+ {
+ CleanupAfterFree();
+ }
+
+ return lostAllocationCount;
+}
+
+VkResult VmaBlockMetadata_Linear::CheckCorruption(const void* pBlockData)
+{
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ for(size_t i = m_1stNullItemsBeginCount, count = suballocations1st.size(); i < count; ++i)
+ {
+ const VmaSuballocation& suballoc = suballocations1st[i];
+ if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ if(!VmaValidateMagicValue(pBlockData, suballoc.offset - VMA_DEBUG_MARGIN))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ if(!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ }
+ }
+
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ for(size_t i = 0, count = suballocations2nd.size(); i < count; ++i)
+ {
+ const VmaSuballocation& suballoc = suballocations2nd[i];
+ if(suballoc.type != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ if(!VmaValidateMagicValue(pBlockData, suballoc.offset - VMA_DEBUG_MARGIN))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED BEFORE VALIDATED ALLOCATION!");
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ if(!VmaValidateMagicValue(pBlockData, suballoc.offset + suballoc.size))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER VALIDATED ALLOCATION!");
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ }
+ }
+
+ return VK_SUCCESS;
+}
+
+void VmaBlockMetadata_Linear::Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType type,
+ VkDeviceSize allocSize,
+ bool upperAddress,
+ VmaAllocation hAllocation)
+{
+ const VmaSuballocation newSuballoc = { request.offset, allocSize, hAllocation, type };
+
+ if(upperAddress)
+ {
+ VMA_ASSERT(m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER &&
+ "CRITICAL ERROR: Trying to use linear allocator as double stack while it was already used as ring buffer.");
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+ suballocations2nd.push_back(newSuballoc);
+ m_2ndVectorMode = SECOND_VECTOR_DOUBLE_STACK;
+ }
+ else
+ {
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+
+ // First allocation.
+ if(suballocations1st.empty())
+ {
+ suballocations1st.push_back(newSuballoc);
+ }
+ else
+ {
+ // New allocation at the end of 1st vector.
+ if(request.offset >= suballocations1st.back().offset + suballocations1st.back().size)
+ {
+ // Check if it fits before the end of the block.
+ VMA_ASSERT(request.offset + allocSize <= GetSize());
+ suballocations1st.push_back(newSuballoc);
+ }
+ // New allocation at the end of 2-part ring buffer, so before first allocation from 1st vector.
+ else if(request.offset + allocSize <= suballocations1st[m_1stNullItemsBeginCount].offset)
+ {
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+ switch(m_2ndVectorMode)
+ {
+ case SECOND_VECTOR_EMPTY:
+ // First allocation from second part ring buffer.
+ VMA_ASSERT(suballocations2nd.empty());
+ m_2ndVectorMode = SECOND_VECTOR_RING_BUFFER;
+ break;
+ case SECOND_VECTOR_RING_BUFFER:
+ // 2-part ring buffer is already started.
+ VMA_ASSERT(!suballocations2nd.empty());
+ break;
+ case SECOND_VECTOR_DOUBLE_STACK:
+ VMA_ASSERT(0 && "CRITICAL ERROR: Trying to use linear allocator as ring buffer while it was already used as double stack.");
+ break;
+ default:
+ VMA_ASSERT(0);
+ }
+
+ suballocations2nd.push_back(newSuballoc);
+ }
+ else
+ {
+ VMA_ASSERT(0 && "CRITICAL INTERNAL ERROR.");
+ }
+ }
+ }
+
+ m_SumFreeSize -= newSuballoc.size;
+}
+
+void VmaBlockMetadata_Linear::Free(const VmaAllocation allocation)
+{
+ FreeAtOffset(allocation->GetOffset());
+}
+
+void VmaBlockMetadata_Linear::FreeAtOffset(VkDeviceSize offset)
+{
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+ if(!suballocations1st.empty())
+ {
+ // First allocation: Mark it as next empty at the beginning.
+ VmaSuballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount];
+ if(firstSuballoc.offset == offset)
+ {
+ firstSuballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
+ firstSuballoc.hAllocation = VK_NULL_HANDLE;
+ m_SumFreeSize += firstSuballoc.size;
+ ++m_1stNullItemsBeginCount;
+ CleanupAfterFree();
+ return;
+ }
+ }
+
+ // Last allocation in 2-part ring buffer or top of upper stack (same logic).
+ if(m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ||
+ m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK)
+ {
+ VmaSuballocation& lastSuballoc = suballocations2nd.back();
+ if(lastSuballoc.offset == offset)
+ {
+ m_SumFreeSize += lastSuballoc.size;
+ suballocations2nd.pop_back();
+ CleanupAfterFree();
+ return;
+ }
+ }
+ // Last allocation in 1st vector.
+ else if(m_2ndVectorMode == SECOND_VECTOR_EMPTY)
+ {
+ VmaSuballocation& lastSuballoc = suballocations1st.back();
+ if(lastSuballoc.offset == offset)
+ {
+ m_SumFreeSize += lastSuballoc.size;
+ suballocations1st.pop_back();
+ CleanupAfterFree();
+ return;
+ }
+ }
+
+ // Item from the middle of 1st vector.
+ {
+ VmaSuballocation refSuballoc;
+ refSuballoc.offset = offset;
+ // Rest of members stays uninitialized intentionally for better performance.
+ SuballocationVectorType::iterator it = VmaVectorFindSorted<VmaSuballocationOffsetLess>(
+ suballocations1st.begin() + m_1stNullItemsBeginCount,
+ suballocations1st.end(),
+ refSuballoc);
+ if(it != suballocations1st.end())
+ {
+ it->type = VMA_SUBALLOCATION_TYPE_FREE;
+ it->hAllocation = VK_NULL_HANDLE;
+ ++m_1stNullItemsMiddleCount;
+ m_SumFreeSize += it->size;
+ CleanupAfterFree();
+ return;
+ }
+ }
+
+ if(m_2ndVectorMode != SECOND_VECTOR_EMPTY)
+ {
+ // Item from the middle of 2nd vector.
+ VmaSuballocation refSuballoc;
+ refSuballoc.offset = offset;
+ // Rest of members stays uninitialized intentionally for better performance.
+ SuballocationVectorType::iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ?
+ VmaVectorFindSorted<VmaSuballocationOffsetLess>(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc) :
+ VmaVectorFindSorted<VmaSuballocationOffsetGreater>(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc);
+ if(it != suballocations2nd.end())
+ {
+ it->type = VMA_SUBALLOCATION_TYPE_FREE;
+ it->hAllocation = VK_NULL_HANDLE;
+ ++m_2ndNullItemsCount;
+ m_SumFreeSize += it->size;
+ CleanupAfterFree();
+ return;
+ }
+ }
+
+ VMA_ASSERT(0 && "Allocation to free not found in linear allocator!");
+}
+
+bool VmaBlockMetadata_Linear::ShouldCompact1st() const
+{
+ const size_t nullItemCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
+ const size_t suballocCount = AccessSuballocations1st().size();
+ return suballocCount > 32 && nullItemCount * 2 >= (suballocCount - nullItemCount) * 3;
+}
+
+void VmaBlockMetadata_Linear::CleanupAfterFree()
+{
+ SuballocationVectorType& suballocations1st = AccessSuballocations1st();
+ SuballocationVectorType& suballocations2nd = AccessSuballocations2nd();
+
+ if(IsEmpty())
+ {
+ suballocations1st.clear();
+ suballocations2nd.clear();
+ m_1stNullItemsBeginCount = 0;
+ m_1stNullItemsMiddleCount = 0;
+ m_2ndNullItemsCount = 0;
+ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
+ }
+ else
+ {
+ const size_t suballoc1stCount = suballocations1st.size();
+ const size_t nullItem1stCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount;
+ VMA_ASSERT(nullItem1stCount <= suballoc1stCount);
+
+ // Find more null items at the beginning of 1st vector.
+ while(m_1stNullItemsBeginCount < suballoc1stCount &&
+ suballocations1st[m_1stNullItemsBeginCount].hAllocation == VK_NULL_HANDLE)
+ {
+ ++m_1stNullItemsBeginCount;
+ --m_1stNullItemsMiddleCount;
+ }
+
+ // Find more null items at the end of 1st vector.
+ while(m_1stNullItemsMiddleCount > 0 &&
+ suballocations1st.back().hAllocation == VK_NULL_HANDLE)
+ {
+ --m_1stNullItemsMiddleCount;
+ suballocations1st.pop_back();
+ }
+
+ // Find more null items at the end of 2nd vector.
+ while(m_2ndNullItemsCount > 0 &&
+ suballocations2nd.back().hAllocation == VK_NULL_HANDLE)
+ {
+ --m_2ndNullItemsCount;
+ suballocations2nd.pop_back();
+ }
+
+ if(ShouldCompact1st())
+ {
+ const size_t nonNullItemCount = suballoc1stCount - nullItem1stCount;
+ size_t srcIndex = m_1stNullItemsBeginCount;
+ for(size_t dstIndex = 0; dstIndex < nonNullItemCount; ++dstIndex)
+ {
+ while(suballocations1st[srcIndex].hAllocation == VK_NULL_HANDLE)
+ {
+ ++srcIndex;
+ }
+ if(dstIndex != srcIndex)
+ {
+ suballocations1st[dstIndex] = suballocations1st[srcIndex];
+ }
+ ++srcIndex;
+ }
+ suballocations1st.resize(nonNullItemCount);
+ m_1stNullItemsBeginCount = 0;
+ m_1stNullItemsMiddleCount = 0;
+ }
+
+ // 2nd vector became empty.
+ if(suballocations2nd.empty())
+ {
+ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
+ }
+
+ // 1st vector became empty.
+ if(suballocations1st.size() - m_1stNullItemsBeginCount == 0)
+ {
+ suballocations1st.clear();
+ m_1stNullItemsBeginCount = 0;
+
+ if(!suballocations2nd.empty() && m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER)
+ {
+ // Swap 1st with 2nd. Now 2nd is empty.
+ m_2ndVectorMode = SECOND_VECTOR_EMPTY;
+ m_1stNullItemsMiddleCount = m_2ndNullItemsCount;
+ while(m_1stNullItemsBeginCount < suballocations2nd.size() &&
+ suballocations2nd[m_1stNullItemsBeginCount].hAllocation == VK_NULL_HANDLE)
+ {
+ ++m_1stNullItemsBeginCount;
+ --m_1stNullItemsMiddleCount;
+ }
+ m_2ndNullItemsCount = 0;
+ m_1stVectorIndex ^= 1;
+ }
+ }
+ }
+
+ VMA_HEAVY_ASSERT(Validate());
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaBlockMetadata_Buddy
+
+VmaBlockMetadata_Buddy::VmaBlockMetadata_Buddy(VmaAllocator hAllocator) :
+ VmaBlockMetadata(hAllocator),
+ m_Root(VMA_NULL),
+ m_AllocationCount(0),
+ m_FreeCount(1),
+ m_SumFreeSize(0)
+{
+ memset(m_FreeList, 0, sizeof(m_FreeList));
+}
+
+VmaBlockMetadata_Buddy::~VmaBlockMetadata_Buddy()
+{
+ DeleteNode(m_Root);
+}
+
+void VmaBlockMetadata_Buddy::Init(VkDeviceSize size)
+{
+ VmaBlockMetadata::Init(size);
+
+ m_UsableSize = VmaPrevPow2(size);
+ m_SumFreeSize = m_UsableSize;
+
+ // Calculate m_LevelCount.
+ m_LevelCount = 1;
+ while(m_LevelCount < MAX_LEVELS &&
+ LevelToNodeSize(m_LevelCount) >= MIN_NODE_SIZE)
+ {
+ ++m_LevelCount;
+ }
+
+ Node* rootNode = vma_new(GetAllocationCallbacks(), Node)();
+ rootNode->offset = 0;
+ rootNode->type = Node::TYPE_FREE;
+ rootNode->parent = VMA_NULL;
+ rootNode->buddy = VMA_NULL;
+
+ m_Root = rootNode;
+ AddToFreeListFront(0, rootNode);
+}
+
+bool VmaBlockMetadata_Buddy::Validate() const
+{
+ // Validate tree.
+ ValidationContext ctx;
+ if(!ValidateNode(ctx, VMA_NULL, m_Root, 0, LevelToNodeSize(0)))
+ {
+ VMA_VALIDATE(false && "ValidateNode failed.");
+ }
+ VMA_VALIDATE(m_AllocationCount == ctx.calculatedAllocationCount);
+ VMA_VALIDATE(m_SumFreeSize == ctx.calculatedSumFreeSize);
+
+ // Validate free node lists.
+ for(uint32_t level = 0; level < m_LevelCount; ++level)
+ {
+ VMA_VALIDATE(m_FreeList[level].front == VMA_NULL ||
+ m_FreeList[level].front->free.prev == VMA_NULL);
+
+ for(Node* node = m_FreeList[level].front;
+ node != VMA_NULL;
+ node = node->free.next)
+ {
+ VMA_VALIDATE(node->type == Node::TYPE_FREE);
+
+ if(node->free.next == VMA_NULL)
+ {
+ VMA_VALIDATE(m_FreeList[level].back == node);
+ }
+ else
+ {
+ VMA_VALIDATE(node->free.next->free.prev == node);
+ }
+ }
+ }
+
+ // Validate that free lists ar higher levels are empty.
+ for(uint32_t level = m_LevelCount; level < MAX_LEVELS; ++level)
+ {
+ VMA_VALIDATE(m_FreeList[level].front == VMA_NULL && m_FreeList[level].back == VMA_NULL);
+ }
+
+ return true;
+}
+
+VkDeviceSize VmaBlockMetadata_Buddy::GetUnusedRangeSizeMax() const
+{
+ for(uint32_t level = 0; level < m_LevelCount; ++level)
+ {
+ if(m_FreeList[level].front != VMA_NULL)
+ {
+ return LevelToNodeSize(level);
+ }
+ }
+ return 0;
+}
+
+void VmaBlockMetadata_Buddy::CalcAllocationStatInfo(VmaStatInfo& outInfo) const
+{
+ const VkDeviceSize unusableSize = GetUnusableSize();
+
+ outInfo.blockCount = 1;
+
+ outInfo.allocationCount = outInfo.unusedRangeCount = 0;
+ outInfo.usedBytes = outInfo.unusedBytes = 0;
+
+ outInfo.allocationSizeMax = outInfo.unusedRangeSizeMax = 0;
+ outInfo.allocationSizeMin = outInfo.unusedRangeSizeMin = UINT64_MAX;
+ outInfo.allocationSizeAvg = outInfo.unusedRangeSizeAvg = 0; // Unused.
+
+ CalcAllocationStatInfoNode(outInfo, m_Root, LevelToNodeSize(0));
+
+ if(unusableSize > 0)
+ {
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusableSize;
+ outInfo.unusedRangeSizeMax = VMA_MAX(outInfo.unusedRangeSizeMax, unusableSize);
+ outInfo.unusedRangeSizeMin = VMA_MIN(outInfo.unusedRangeSizeMin, unusableSize);
+ }
+}
+
+void VmaBlockMetadata_Buddy::AddPoolStats(VmaPoolStats& inoutStats) const
+{
+ const VkDeviceSize unusableSize = GetUnusableSize();
+
+ inoutStats.size += GetSize();
+ inoutStats.unusedSize += m_SumFreeSize + unusableSize;
+ inoutStats.allocationCount += m_AllocationCount;
+ inoutStats.unusedRangeCount += m_FreeCount;
+ inoutStats.unusedRangeSizeMax = VMA_MAX(inoutStats.unusedRangeSizeMax, GetUnusedRangeSizeMax());
+
+ if(unusableSize > 0)
+ {
+ ++inoutStats.unusedRangeCount;
+ // Not updating inoutStats.unusedRangeSizeMax with unusableSize because this space is not available for allocations.
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+void VmaBlockMetadata_Buddy::PrintDetailedMap(class VmaJsonWriter& json) const
+{
+ // TODO optimize
+ VmaStatInfo stat;
+ CalcAllocationStatInfo(stat);
+
+ PrintDetailedMap_Begin(
+ json,
+ stat.unusedBytes,
+ stat.allocationCount,
+ stat.unusedRangeCount);
+
+ PrintDetailedMapNode(json, m_Root, LevelToNodeSize(0));
+
+ const VkDeviceSize unusableSize = GetUnusableSize();
+ if(unusableSize > 0)
+ {
+ PrintDetailedMap_UnusedRange(json,
+ m_UsableSize, // offset
+ unusableSize); // size
+ }
+
+ PrintDetailedMap_End(json);
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+bool VmaBlockMetadata_Buddy::CreateAllocationRequest(
+ uint32_t /*currentFrameIndex*/,
+ uint32_t /*frameInUseCount*/,
+ VkDeviceSize bufferImageGranularity,
+ VkDeviceSize allocSize,
+ VkDeviceSize allocAlignment,
+ bool upperAddress,
+ VmaSuballocationType allocType,
+ bool /*canMakeOtherLost*/,
+ uint32_t /*strategy*/,
+ VmaAllocationRequest* pAllocationRequest)
+{
+ VMA_ASSERT(!upperAddress && "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT can be used only with linear algorithm.");
+ (void) upperAddress;
+
+ // Simple way to respect bufferImageGranularity. May be optimized some day.
+ // Whenever it might be an OPTIMAL image...
+ if(allocType == VMA_SUBALLOCATION_TYPE_UNKNOWN ||
+ allocType == VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN ||
+ allocType == VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL)
+ {
+ allocAlignment = VMA_MAX(allocAlignment, bufferImageGranularity);
+ allocSize = VMA_MAX(allocSize, bufferImageGranularity);
+ }
+
+ if(allocSize > m_UsableSize)
+ {
+ return false;
+ }
+
+ const uint32_t targetLevel = AllocSizeToLevel(allocSize);
+ for(uint32_t level = targetLevel + 1; level--; )
+ {
+ for(Node* freeNode = m_FreeList[level].front;
+ freeNode != VMA_NULL;
+ freeNode = freeNode->free.next)
+ {
+ if(freeNode->offset % allocAlignment == 0)
+ {
+ pAllocationRequest->offset = freeNode->offset;
+ pAllocationRequest->sumFreeSize = LevelToNodeSize(level);
+ pAllocationRequest->sumItemSize = 0;
+ pAllocationRequest->itemsToMakeLostCount = 0;
+ pAllocationRequest->customData = (void*)(uintptr_t)level;
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool VmaBlockMetadata_Buddy::MakeRequestedAllocationsLost(
+ uint32_t /*currentFrameIndex*/,
+ uint32_t /*frameInUseCount*/,
+ VmaAllocationRequest* pAllocationRequest)
+{
+ /*
+ Lost allocations are not supported in buddy allocator at the moment.
+ Support might be added in the future.
+ */
+ return pAllocationRequest->itemsToMakeLostCount == 0;
+}
+
+uint32_t VmaBlockMetadata_Buddy::MakeAllocationsLost(uint32_t /*currentFrameIndex*/, uint32_t /*frameInUseCount*/)
+{
+ /*
+ Lost allocations are not supported in buddy allocator at the moment.
+ Support might be added in the future.
+ */
+ return 0;
+}
+
+void VmaBlockMetadata_Buddy::Alloc(
+ const VmaAllocationRequest& request,
+ VmaSuballocationType /*type*/,
+ VkDeviceSize allocSize,
+ bool /*upperAddress*/,
+ VmaAllocation hAllocation)
+{
+ const uint32_t targetLevel = AllocSizeToLevel(allocSize);
+ uint32_t currLevel = (uint32_t)(uintptr_t)request.customData;
+
+ Node* currNode = m_FreeList[currLevel].front;
+ VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
+ while(currNode->offset != request.offset)
+ {
+ currNode = currNode->free.next;
+ VMA_ASSERT(currNode != VMA_NULL && currNode->type == Node::TYPE_FREE);
+ }
+
+ // Go down, splitting free nodes.
+ while(currLevel < targetLevel)
+ {
+ // currNode is already first free node at currLevel.
+ // Remove it from list of free nodes at this currLevel.
+ RemoveFromFreeList(currLevel, currNode);
+
+ const uint32_t childrenLevel = currLevel + 1;
+
+ // Create two free sub-nodes.
+ Node* leftChild = vma_new(GetAllocationCallbacks(), Node)();
+ Node* rightChild = vma_new(GetAllocationCallbacks(), Node)();
+
+ leftChild->offset = currNode->offset;
+ leftChild->type = Node::TYPE_FREE;
+ leftChild->parent = currNode;
+ leftChild->buddy = rightChild;
+
+ rightChild->offset = currNode->offset + LevelToNodeSize(childrenLevel);
+ rightChild->type = Node::TYPE_FREE;
+ rightChild->parent = currNode;
+ rightChild->buddy = leftChild;
+
+ // Convert current currNode to split type.
+ currNode->type = Node::TYPE_SPLIT;
+ currNode->split.leftChild = leftChild;
+
+ // Add child nodes to free list. Order is important!
+ AddToFreeListFront(childrenLevel, rightChild);
+ AddToFreeListFront(childrenLevel, leftChild);
+
+ ++m_FreeCount;
+ //m_SumFreeSize -= LevelToNodeSize(currLevel) % 2; // Useful only when level node sizes can be non power of 2.
+ ++currLevel;
+ currNode = m_FreeList[currLevel].front;
+
+ /*
+ We can be sure that currNode, as left child of node previously split,
+ also fullfills the alignment requirement.
+ */
+ }
+
+ // Remove from free list.
+ VMA_ASSERT(currLevel == targetLevel &&
+ currNode != VMA_NULL &&
+ currNode->type == Node::TYPE_FREE);
+ RemoveFromFreeList(currLevel, currNode);
+
+ // Convert to allocation node.
+ currNode->type = Node::TYPE_ALLOCATION;
+ currNode->allocation.alloc = hAllocation;
+
+ ++m_AllocationCount;
+ --m_FreeCount;
+ m_SumFreeSize -= allocSize;
+}
+
+void VmaBlockMetadata_Buddy::DeleteNode(Node* node)
+{
+ if(node->type == Node::TYPE_SPLIT)
+ {
+ DeleteNode(node->split.leftChild->buddy);
+ DeleteNode(node->split.leftChild);
+ }
+
+ vma_delete(GetAllocationCallbacks(), node);
+}
+
+bool VmaBlockMetadata_Buddy::ValidateNode(ValidationContext& ctx, const Node* parent, const Node* curr, uint32_t level, VkDeviceSize levelNodeSize) const
+{
+ VMA_VALIDATE(level < m_LevelCount);
+ VMA_VALIDATE(curr->parent == parent);
+ VMA_VALIDATE((curr->buddy == VMA_NULL) == (parent == VMA_NULL));
+ VMA_VALIDATE(curr->buddy == VMA_NULL || curr->buddy->buddy == curr);
+ switch(curr->type)
+ {
+ case Node::TYPE_FREE:
+ // curr->free.prev, next are validated separately.
+ ctx.calculatedSumFreeSize += levelNodeSize;
+ ++ctx.calculatedFreeCount;
+ break;
+ case Node::TYPE_ALLOCATION:
+ ++ctx.calculatedAllocationCount;
+ ctx.calculatedSumFreeSize += levelNodeSize - curr->allocation.alloc->GetSize();
+ VMA_VALIDATE(curr->allocation.alloc != VK_NULL_HANDLE);
+ break;
+ case Node::TYPE_SPLIT:
+ {
+ const uint32_t childrenLevel = level + 1;
+ const VkDeviceSize childrenLevelNodeSize = levelNodeSize / 2;
+ const Node* const leftChild = curr->split.leftChild;
+ VMA_VALIDATE(leftChild != VMA_NULL);
+ VMA_VALIDATE(leftChild->offset == curr->offset);
+ if(!ValidateNode(ctx, curr, leftChild, childrenLevel, childrenLevelNodeSize))
+ {
+ VMA_VALIDATE(false && "ValidateNode for left child failed.");
+ }
+ const Node* const rightChild = leftChild->buddy;
+ VMA_VALIDATE(rightChild->offset == curr->offset + childrenLevelNodeSize);
+ if(!ValidateNode(ctx, curr, rightChild, childrenLevel, childrenLevelNodeSize))
+ {
+ VMA_VALIDATE(false && "ValidateNode for right child failed.");
+ }
+ }
+ break;
+ default:
+ return false;
+ }
+
+ return true;
+}
+
+uint32_t VmaBlockMetadata_Buddy::AllocSizeToLevel(VkDeviceSize allocSize) const
+{
+ // I know this could be optimized somehow e.g. by using std::log2p1 from C++20.
+ uint32_t level = 0;
+ VkDeviceSize currLevelNodeSize = m_UsableSize;
+ VkDeviceSize nextLevelNodeSize = currLevelNodeSize >> 1;
+ while(allocSize <= nextLevelNodeSize && level + 1 < m_LevelCount)
+ {
+ ++level;
+ currLevelNodeSize = nextLevelNodeSize;
+ nextLevelNodeSize = currLevelNodeSize >> 1;
+ }
+ return level;
+}
+
+void VmaBlockMetadata_Buddy::FreeAtOffset(VmaAllocation alloc, VkDeviceSize offset)
+{
+ // Find node and level.
+ Node* node = m_Root;
+ VkDeviceSize nodeOffset = 0;
+ uint32_t level = 0;
+ VkDeviceSize levelNodeSize = LevelToNodeSize(0);
+ while(node->type == Node::TYPE_SPLIT)
+ {
+ const VkDeviceSize nextLevelSize = levelNodeSize >> 1;
+ if(offset < nodeOffset + nextLevelSize)
+ {
+ node = node->split.leftChild;
+ }
+ else
+ {
+ node = node->split.leftChild->buddy;
+ nodeOffset += nextLevelSize;
+ }
+ ++level;
+ levelNodeSize = nextLevelSize;
+ }
+
+ VMA_ASSERT(node != VMA_NULL && node->type == Node::TYPE_ALLOCATION);
+ VMA_ASSERT(alloc == VK_NULL_HANDLE || node->allocation.alloc == alloc);
+
+ ++m_FreeCount;
+ --m_AllocationCount;
+ m_SumFreeSize += alloc->GetSize();
+
+ node->type = Node::TYPE_FREE;
+
+ // Join free nodes if possible.
+ while(level > 0 && node->buddy->type == Node::TYPE_FREE)
+ {
+ RemoveFromFreeList(level, node->buddy);
+ Node* const parent = node->parent;
+
+ vma_delete(GetAllocationCallbacks(), node->buddy);
+ vma_delete(GetAllocationCallbacks(), node);
+ parent->type = Node::TYPE_FREE;
+
+ node = parent;
+ --level;
+ //m_SumFreeSize += LevelToNodeSize(level) % 2; // Useful only when level node sizes can be non power of 2.
+ --m_FreeCount;
+ }
+
+ AddToFreeListFront(level, node);
+}
+
+void VmaBlockMetadata_Buddy::CalcAllocationStatInfoNode(VmaStatInfo& outInfo, const Node* node, VkDeviceSize levelNodeSize) const
+{
+ switch(node->type)
+ {
+ case Node::TYPE_FREE:
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += levelNodeSize;
+ outInfo.unusedRangeSizeMax = VMA_MAX(outInfo.unusedRangeSizeMax, levelNodeSize);
+ outInfo.unusedRangeSizeMin = VMA_MAX(outInfo.unusedRangeSizeMin, levelNodeSize);
+ break;
+ case Node::TYPE_ALLOCATION:
+ {
+ const VkDeviceSize allocSize = node->allocation.alloc->GetSize();
+ ++outInfo.allocationCount;
+ outInfo.usedBytes += allocSize;
+ outInfo.allocationSizeMax = VMA_MAX(outInfo.allocationSizeMax, allocSize);
+ outInfo.allocationSizeMin = VMA_MAX(outInfo.allocationSizeMin, allocSize);
+
+ const VkDeviceSize unusedRangeSize = levelNodeSize - allocSize;
+ if(unusedRangeSize > 0)
+ {
+ ++outInfo.unusedRangeCount;
+ outInfo.unusedBytes += unusedRangeSize;
+ outInfo.unusedRangeSizeMax = VMA_MAX(outInfo.unusedRangeSizeMax, unusedRangeSize);
+ outInfo.unusedRangeSizeMin = VMA_MAX(outInfo.unusedRangeSizeMin, unusedRangeSize);
+ }
+ }
+ break;
+ case Node::TYPE_SPLIT:
+ {
+ const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
+ const Node* const leftChild = node->split.leftChild;
+ CalcAllocationStatInfoNode(outInfo, leftChild, childrenNodeSize);
+ const Node* const rightChild = leftChild->buddy;
+ CalcAllocationStatInfoNode(outInfo, rightChild, childrenNodeSize);
+ }
+ break;
+ default:
+ VMA_ASSERT(0);
+ }
+}
+
+void VmaBlockMetadata_Buddy::AddToFreeListFront(uint32_t level, Node* node)
+{
+ VMA_ASSERT(node->type == Node::TYPE_FREE);
+
+ // List is empty.
+ Node* const frontNode = m_FreeList[level].front;
+ if(frontNode == VMA_NULL)
+ {
+ VMA_ASSERT(m_FreeList[level].back == VMA_NULL);
+ node->free.prev = node->free.next = VMA_NULL;
+ m_FreeList[level].front = m_FreeList[level].back = node;
+ }
+ else
+ {
+ VMA_ASSERT(frontNode->free.prev == VMA_NULL);
+ node->free.prev = VMA_NULL;
+ node->free.next = frontNode;
+ frontNode->free.prev = node;
+ m_FreeList[level].front = node;
+ }
+}
+
+void VmaBlockMetadata_Buddy::RemoveFromFreeList(uint32_t level, Node* node)
+{
+ VMA_ASSERT(m_FreeList[level].front != VMA_NULL);
+
+ // It is at the front.
+ if(node->free.prev == VMA_NULL)
+ {
+ VMA_ASSERT(m_FreeList[level].front == node);
+ m_FreeList[level].front = node->free.next;
+ }
+ else
+ {
+ Node* const prevFreeNode = node->free.prev;
+ VMA_ASSERT(prevFreeNode->free.next == node);
+ prevFreeNode->free.next = node->free.next;
+ }
+
+ // It is at the back.
+ if(node->free.next == VMA_NULL)
+ {
+ VMA_ASSERT(m_FreeList[level].back == node);
+ m_FreeList[level].back = node->free.prev;
+ }
+ else
+ {
+ Node* const nextFreeNode = node->free.next;
+ VMA_ASSERT(nextFreeNode->free.prev == node);
+ nextFreeNode->free.prev = node->free.prev;
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+void VmaBlockMetadata_Buddy::PrintDetailedMapNode(class VmaJsonWriter& json, const Node* node, VkDeviceSize levelNodeSize) const
+{
+ switch(node->type)
+ {
+ case Node::TYPE_FREE:
+ PrintDetailedMap_UnusedRange(json, node->offset, levelNodeSize);
+ break;
+ case Node::TYPE_ALLOCATION:
+ {
+ PrintDetailedMap_Allocation(json, node->offset, node->allocation.alloc);
+ const VkDeviceSize allocSize = node->allocation.alloc->GetSize();
+ if(allocSize < levelNodeSize)
+ {
+ PrintDetailedMap_UnusedRange(json, node->offset + allocSize, levelNodeSize - allocSize);
+ }
+ }
+ break;
+ case Node::TYPE_SPLIT:
+ {
+ const VkDeviceSize childrenNodeSize = levelNodeSize / 2;
+ const Node* const leftChild = node->split.leftChild;
+ PrintDetailedMapNode(json, leftChild, childrenNodeSize);
+ const Node* const rightChild = leftChild->buddy;
+ PrintDetailedMapNode(json, rightChild, childrenNodeSize);
+ }
+ break;
+ default:
+ VMA_ASSERT(0);
+ }
+}
+#endif // #if VMA_STATS_STRING_ENABLED
+
+
+////////////////////////////////////////////////////////////////////////////////
+// class VmaDeviceMemoryBlock
+
+VmaDeviceMemoryBlock::VmaDeviceMemoryBlock(VmaAllocator /*hAllocator*/) :
+ m_pMetadata(VMA_NULL),
+ m_MemoryTypeIndex(UINT32_MAX),
+ m_Id(0),
+ m_hMemory(VK_NULL_HANDLE),
+ m_MapCount(0),
+ m_pMappedData(VMA_NULL)
+{
+}
+
+void VmaDeviceMemoryBlock::Init(
+ VmaAllocator hAllocator,
+ uint32_t newMemoryTypeIndex,
+ VkDeviceMemory newMemory,
+ VkDeviceSize newSize,
+ uint32_t id,
+ uint32_t algorithm)
+{
+ VMA_ASSERT(m_hMemory == VK_NULL_HANDLE);
+
+ m_MemoryTypeIndex = newMemoryTypeIndex;
+ m_Id = id;
+ m_hMemory = newMemory;
+
+ switch(algorithm)
+ {
+ case VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT:
+ m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Linear)(hAllocator);
+ break;
+ case VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT:
+ m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Buddy)(hAllocator);
+ break;
+ default:
+ VMA_ASSERT(0);
+ // Fall-through.
+ case 0:
+ m_pMetadata = vma_new(hAllocator, VmaBlockMetadata_Generic)(hAllocator);
+ }
+ m_pMetadata->Init(newSize);
+}
+
+void VmaDeviceMemoryBlock::Destroy(VmaAllocator allocator)
+{
+ // This is the most important assert in the entire library.
+ // Hitting it means you have some memory leak - unreleased VmaAllocation objects.
+ VMA_ASSERT(m_pMetadata->IsEmpty() && "Some allocations were not freed before destruction of this memory block!");
+
+ VMA_ASSERT(m_hMemory != VK_NULL_HANDLE);
+ allocator->FreeVulkanMemory(m_MemoryTypeIndex, m_pMetadata->GetSize(), m_hMemory);
+ m_hMemory = VK_NULL_HANDLE;
+
+ vma_delete(allocator, m_pMetadata);
+ m_pMetadata = VMA_NULL;
+}
+
+bool VmaDeviceMemoryBlock::Validate() const
+{
+ VMA_VALIDATE((m_hMemory != VK_NULL_HANDLE) &&
+ (m_pMetadata->GetSize() != 0));
+
+ return m_pMetadata->Validate();
+}
+
+VkResult VmaDeviceMemoryBlock::CheckCorruption(VmaAllocator hAllocator)
+{
+ void* pData = nullptr;
+ VkResult res = Map(hAllocator, 1, &pData);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+
+ res = m_pMetadata->CheckCorruption(pData);
+
+ Unmap(hAllocator, 1);
+
+ return res;
+}
+
+VkResult VmaDeviceMemoryBlock::Map(VmaAllocator hAllocator, uint32_t count, void** ppData)
+{
+ if(count == 0)
+ {
+ return VK_SUCCESS;
+ }
+
+ VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+ if(m_MapCount != 0)
+ {
+ m_MapCount += count;
+ VMA_ASSERT(m_pMappedData != VMA_NULL);
+ if(ppData != VMA_NULL)
+ {
+ *ppData = m_pMappedData;
+ }
+ return VK_SUCCESS;
+ }
+ else
+ {
+ VkResult result = (*hAllocator->GetVulkanFunctions().vkMapMemory)(
+ hAllocator->m_hDevice,
+ m_hMemory,
+ 0, // offset
+ VK_WHOLE_SIZE,
+ 0, // flags
+ &m_pMappedData);
+ if(result == VK_SUCCESS)
+ {
+ if(ppData != VMA_NULL)
+ {
+ *ppData = m_pMappedData;
+ }
+ m_MapCount = count;
+ }
+ return result;
+ }
+}
+
+void VmaDeviceMemoryBlock::Unmap(VmaAllocator hAllocator, uint32_t count)
+{
+ if(count == 0)
+ {
+ return;
+ }
+
+ VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+ if(m_MapCount >= count)
+ {
+ m_MapCount -= count;
+ if(m_MapCount == 0)
+ {
+ m_pMappedData = VMA_NULL;
+ (*hAllocator->GetVulkanFunctions().vkUnmapMemory)(hAllocator->m_hDevice, m_hMemory);
+ }
+ }
+ else
+ {
+ VMA_ASSERT(0 && "VkDeviceMemory block is being unmapped while it was not previously mapped.");
+ }
+}
+
+VkResult VmaDeviceMemoryBlock::WriteMagicValueAroundAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
+{
+ VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
+ VMA_ASSERT(allocOffset >= VMA_DEBUG_MARGIN);
+
+ void* pData;
+ VkResult res = Map(hAllocator, 1, &pData);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+
+ VmaWriteMagicValue(pData, allocOffset - VMA_DEBUG_MARGIN);
+ VmaWriteMagicValue(pData, allocOffset + allocSize);
+
+ Unmap(hAllocator, 1);
+
+ return VK_SUCCESS;
+}
+
+VkResult VmaDeviceMemoryBlock::ValidateMagicValueAroundAllocation(VmaAllocator hAllocator, VkDeviceSize allocOffset, VkDeviceSize allocSize)
+{
+ VMA_ASSERT(VMA_DEBUG_MARGIN > 0 && VMA_DEBUG_MARGIN % 4 == 0 && VMA_DEBUG_DETECT_CORRUPTION);
+ VMA_ASSERT(allocOffset >= VMA_DEBUG_MARGIN);
+
+ void* pData;
+ VkResult res = Map(hAllocator, 1, &pData);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+
+ if(!VmaValidateMagicValue(pData, allocOffset - VMA_DEBUG_MARGIN))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED BEFORE FREED ALLOCATION!");
+ }
+ else if(!VmaValidateMagicValue(pData, allocOffset + allocSize))
+ {
+ VMA_ASSERT(0 && "MEMORY CORRUPTION DETECTED AFTER FREED ALLOCATION!");
+ }
+
+ Unmap(hAllocator, 1);
+
+ return VK_SUCCESS;
+}
+
+VkResult VmaDeviceMemoryBlock::BindBufferMemory(
+ const VmaAllocator hAllocator,
+ const VmaAllocation hAllocation,
+ VkBuffer hBuffer)
+{
+ VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
+ hAllocation->GetBlock() == this);
+ // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads.
+ VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+ return hAllocator->GetVulkanFunctions().vkBindBufferMemory(
+ hAllocator->m_hDevice,
+ hBuffer,
+ m_hMemory,
+ hAllocation->GetOffset());
+}
+
+VkResult VmaDeviceMemoryBlock::BindImageMemory(
+ const VmaAllocator hAllocator,
+ const VmaAllocation hAllocation,
+ VkImage hImage)
+{
+ VMA_ASSERT(hAllocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK &&
+ hAllocation->GetBlock() == this);
+ // This lock is important so that we don't call vkBind... and/or vkMap... simultaneously on the same VkDeviceMemory from multiple threads.
+ VmaMutexLock lock(m_Mutex, hAllocator->m_UseMutex);
+ return hAllocator->GetVulkanFunctions().vkBindImageMemory(
+ hAllocator->m_hDevice,
+ hImage,
+ m_hMemory,
+ hAllocation->GetOffset());
+}
+
+static void InitStatInfo(VmaStatInfo& outInfo)
+{
+ memset(&outInfo, 0, sizeof(outInfo));
+ outInfo.allocationSizeMin = UINT64_MAX;
+ outInfo.unusedRangeSizeMin = UINT64_MAX;
+}
+
+// Adds statistics srcInfo into inoutInfo, like: inoutInfo += srcInfo.
+static void VmaAddStatInfo(VmaStatInfo& inoutInfo, const VmaStatInfo& srcInfo)
+{
+ inoutInfo.blockCount += srcInfo.blockCount;
+ inoutInfo.allocationCount += srcInfo.allocationCount;
+ inoutInfo.unusedRangeCount += srcInfo.unusedRangeCount;
+ inoutInfo.usedBytes += srcInfo.usedBytes;
+ inoutInfo.unusedBytes += srcInfo.unusedBytes;
+ inoutInfo.allocationSizeMin = VMA_MIN(inoutInfo.allocationSizeMin, srcInfo.allocationSizeMin);
+ inoutInfo.allocationSizeMax = VMA_MAX(inoutInfo.allocationSizeMax, srcInfo.allocationSizeMax);
+ inoutInfo.unusedRangeSizeMin = VMA_MIN(inoutInfo.unusedRangeSizeMin, srcInfo.unusedRangeSizeMin);
+ inoutInfo.unusedRangeSizeMax = VMA_MAX(inoutInfo.unusedRangeSizeMax, srcInfo.unusedRangeSizeMax);
+}
+
+static void VmaPostprocessCalcStatInfo(VmaStatInfo& inoutInfo)
+{
+ inoutInfo.allocationSizeAvg = (inoutInfo.allocationCount > 0) ?
+ VmaRoundDiv<VkDeviceSize>(inoutInfo.usedBytes, inoutInfo.allocationCount) : 0;
+ inoutInfo.unusedRangeSizeAvg = (inoutInfo.unusedRangeCount > 0) ?
+ VmaRoundDiv<VkDeviceSize>(inoutInfo.unusedBytes, inoutInfo.unusedRangeCount) : 0;
+}
+
+VmaPool_T::VmaPool_T(
+ VmaAllocator hAllocator,
+ const VmaPoolCreateInfo& createInfo,
+ VkDeviceSize preferredBlockSize) :
+ m_BlockVector(
+ hAllocator,
+ createInfo.memoryTypeIndex,
+ createInfo.blockSize != 0 ? createInfo.blockSize : preferredBlockSize,
+ createInfo.minBlockCount,
+ createInfo.maxBlockCount,
+ (createInfo.flags & VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT) != 0 ? 1 : hAllocator->GetBufferImageGranularity(),
+ createInfo.frameInUseCount,
+ true, // isCustomPool
+ createInfo.blockSize != 0, // explicitBlockSize
+ createInfo.flags & VMA_POOL_CREATE_ALGORITHM_MASK), // algorithm
+ m_Id(0)
+{
+}
+
+VmaPool_T::~VmaPool_T()
+{
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+VmaBlockVector::VmaBlockVector(
+ VmaAllocator hAllocator,
+ uint32_t memoryTypeIndex,
+ VkDeviceSize preferredBlockSize,
+ size_t minBlockCount,
+ size_t maxBlockCount,
+ VkDeviceSize bufferImageGranularity,
+ uint32_t frameInUseCount,
+ bool isCustomPool,
+ bool explicitBlockSize,
+ uint32_t algorithm) :
+ m_hAllocator(hAllocator),
+ m_MemoryTypeIndex(memoryTypeIndex),
+ m_PreferredBlockSize(preferredBlockSize),
+ m_MinBlockCount(minBlockCount),
+ m_MaxBlockCount(maxBlockCount),
+ m_BufferImageGranularity(bufferImageGranularity),
+ m_FrameInUseCount(frameInUseCount),
+ m_IsCustomPool(isCustomPool),
+ m_ExplicitBlockSize(explicitBlockSize),
+ m_Algorithm(algorithm),
+ m_HasEmptyBlock(false),
+ m_Blocks(VmaStlAllocator<VmaDeviceMemoryBlock*>(hAllocator->GetAllocationCallbacks())),
+ m_NextBlockId(0)
+{
+}
+
+VmaBlockVector::~VmaBlockVector()
+{
+ for(size_t i = m_Blocks.size(); i--; )
+ {
+ m_Blocks[i]->Destroy(m_hAllocator);
+ vma_delete(m_hAllocator, m_Blocks[i]);
+ }
+}
+
+VkResult VmaBlockVector::CreateMinBlocks()
+{
+ for(size_t i = 0; i < m_MinBlockCount; ++i)
+ {
+ VkResult res = CreateBlock(m_PreferredBlockSize, VMA_NULL);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+ }
+ return VK_SUCCESS;
+}
+
+void VmaBlockVector::GetPoolStats(VmaPoolStats* pStats)
+{
+ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+ const size_t blockCount = m_Blocks.size();
+
+ pStats->size = 0;
+ pStats->unusedSize = 0;
+ pStats->allocationCount = 0;
+ pStats->unusedRangeCount = 0;
+ pStats->unusedRangeSizeMax = 0;
+ pStats->blockCount = blockCount;
+
+ for(uint32_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+ {
+ const VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pBlock);
+ VMA_HEAVY_ASSERT(pBlock->Validate());
+ pBlock->m_pMetadata->AddPoolStats(*pStats);
+ }
+}
+
+bool VmaBlockVector::IsCorruptionDetectionEnabled() const
+{
+ const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
+ return (VMA_DEBUG_DETECT_CORRUPTION != 0) &&
+ (VMA_DEBUG_MARGIN > 0) &&
+ (m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & requiredMemFlags) == requiredMemFlags;
+}
+
+static const uint32_t VMA_ALLOCATION_TRY_COUNT = 32;
+
+VkResult VmaBlockVector::Allocate(
+ VmaPool hCurrentPool,
+ uint32_t currentFrameIndex,
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaSuballocationType suballocType,
+ size_t allocationCount,
+ VmaAllocation* pAllocations)
+{
+ size_t allocIndex;
+ VkResult res = VK_SUCCESS;
+
+ {
+ VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+ for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+ {
+ res = AllocatePage(
+ hCurrentPool,
+ currentFrameIndex,
+ size,
+ alignment,
+ createInfo,
+ suballocType,
+ pAllocations + allocIndex);
+ if(res != VK_SUCCESS)
+ {
+ break;
+ }
+ }
+ }
+
+ if(res != VK_SUCCESS)
+ {
+ // Free all already created allocations.
+ while(allocIndex--)
+ {
+ Free(pAllocations[allocIndex]);
+ }
+ memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
+ }
+
+ return res;
+}
+
+VkResult VmaBlockVector::AllocatePage(
+ VmaPool hCurrentPool,
+ uint32_t currentFrameIndex,
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaSuballocationType suballocType,
+ VmaAllocation* pAllocation)
+{
+ const bool isUpperAddress = (createInfo.flags & VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0;
+ bool canMakeOtherLost = (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT) != 0;
+ const bool mapped = (createInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0;
+ const bool isUserDataString = (createInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0;
+ const bool canCreateNewBlock =
+ ((createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0) &&
+ (m_Blocks.size() < m_MaxBlockCount);
+ uint32_t strategy = createInfo.flags & VMA_ALLOCATION_CREATE_STRATEGY_MASK;
+
+ // If linearAlgorithm is used, canMakeOtherLost is available only when used as ring buffer.
+ // Which in turn is available only when maxBlockCount = 1.
+ if(m_Algorithm == VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT && m_MaxBlockCount > 1)
+ {
+ canMakeOtherLost = false;
+ }
+
+ // Upper address can only be used with linear allocator and within single memory block.
+ if(isUpperAddress &&
+ (m_Algorithm != VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT || m_MaxBlockCount > 1))
+ {
+ return VK_ERROR_FEATURE_NOT_PRESENT;
+ }
+
+ // Validate strategy.
+ switch(strategy)
+ {
+ case 0:
+ strategy = VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT;
+ break;
+ case VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT:
+ case VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT:
+ case VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT:
+ break;
+ default:
+ return VK_ERROR_FEATURE_NOT_PRESENT;
+ }
+
+ // Early reject: requested allocation size is larger that maximum block size for this block vector.
+ if(size + 2 * VMA_DEBUG_MARGIN > m_PreferredBlockSize)
+ {
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ /*
+ Under certain condition, this whole section can be skipped for optimization, so
+ we move on directly to trying to allocate with canMakeOtherLost. That's the case
+ e.g. for custom pools with linear algorithm.
+ */
+ if(!canMakeOtherLost || canCreateNewBlock)
+ {
+ // 1. Search existing allocations. Try to allocate without making other allocations lost.
+ VmaAllocationCreateFlags allocFlagsCopy = createInfo.flags;
+ allocFlagsCopy &= ~VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT;
+
+ if(m_Algorithm == VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT)
+ {
+ // Use only last block.
+ if(!m_Blocks.empty())
+ {
+ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks.back();
+ VMA_ASSERT(pCurrBlock);
+ VkResult res = AllocateFromBlock(
+ pCurrBlock,
+ hCurrentPool,
+ currentFrameIndex,
+ size,
+ alignment,
+ allocFlagsCopy,
+ createInfo.pUserData,
+ suballocType,
+ strategy,
+ pAllocation);
+ if(res == VK_SUCCESS)
+ {
+ VMA_DEBUG_LOG(" Returned from last block #%u", (uint32_t)(m_Blocks.size() - 1));
+ return VK_SUCCESS;
+ }
+ }
+ }
+ else
+ {
+ if(strategy == VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT)
+ {
+ // Forward order in m_Blocks - prefer blocks with smallest amount of free space.
+ for(size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex )
+ {
+ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pCurrBlock);
+ VkResult res = AllocateFromBlock(
+ pCurrBlock,
+ hCurrentPool,
+ currentFrameIndex,
+ size,
+ alignment,
+ allocFlagsCopy,
+ createInfo.pUserData,
+ suballocType,
+ strategy,
+ pAllocation);
+ if(res == VK_SUCCESS)
+ {
+ VMA_DEBUG_LOG(" Returned from existing block #%u", (uint32_t)blockIndex);
+ return VK_SUCCESS;
+ }
+ }
+ }
+ else // WORST_FIT, FIRST_FIT
+ {
+ // Backward order in m_Blocks - prefer blocks with largest amount of free space.
+ for(size_t blockIndex = m_Blocks.size(); blockIndex--; )
+ {
+ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pCurrBlock);
+ VkResult res = AllocateFromBlock(
+ pCurrBlock,
+ hCurrentPool,
+ currentFrameIndex,
+ size,
+ alignment,
+ allocFlagsCopy,
+ createInfo.pUserData,
+ suballocType,
+ strategy,
+ pAllocation);
+ if(res == VK_SUCCESS)
+ {
+ VMA_DEBUG_LOG(" Returned from existing block #%u", (uint32_t)blockIndex);
+ return VK_SUCCESS;
+ }
+ }
+ }
+ }
+
+ // 2. Try to create new block.
+ if(canCreateNewBlock)
+ {
+ // Calculate optimal size for new block.
+ VkDeviceSize newBlockSize = m_PreferredBlockSize;
+ uint32_t newBlockSizeShift = 0;
+ const uint32_t NEW_BLOCK_SIZE_SHIFT_MAX = 3;
+
+ if(!m_ExplicitBlockSize)
+ {
+ // Allocate 1/8, 1/4, 1/2 as first blocks.
+ const VkDeviceSize maxExistingBlockSize = CalcMaxBlockSize();
+ for(uint32_t i = 0; i < NEW_BLOCK_SIZE_SHIFT_MAX; ++i)
+ {
+ const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
+ if(smallerNewBlockSize > maxExistingBlockSize && smallerNewBlockSize >= size * 2)
+ {
+ newBlockSize = smallerNewBlockSize;
+ ++newBlockSizeShift;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+
+ size_t newBlockIndex = 0;
+ VkResult res = CreateBlock(newBlockSize, &newBlockIndex);
+ // Allocation of this size failed? Try 1/2, 1/4, 1/8 of m_PreferredBlockSize.
+ if(!m_ExplicitBlockSize)
+ {
+ while(res < 0 && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX)
+ {
+ const VkDeviceSize smallerNewBlockSize = newBlockSize / 2;
+ if(smallerNewBlockSize >= size)
+ {
+ newBlockSize = smallerNewBlockSize;
+ ++newBlockSizeShift;
+ res = CreateBlock(newBlockSize, &newBlockIndex);
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+
+ if(res == VK_SUCCESS)
+ {
+ VmaDeviceMemoryBlock* const pBlock = m_Blocks[newBlockIndex];
+ VMA_ASSERT(pBlock->m_pMetadata->GetSize() >= size);
+
+ res = AllocateFromBlock(
+ pBlock,
+ hCurrentPool,
+ currentFrameIndex,
+ size,
+ alignment,
+ allocFlagsCopy,
+ createInfo.pUserData,
+ suballocType,
+ strategy,
+ pAllocation);
+ if(res == VK_SUCCESS)
+ {
+ VMA_DEBUG_LOG(" Created new block Size=%llu", newBlockSize);
+ return VK_SUCCESS;
+ }
+ else
+ {
+ // Allocation from new block failed, possibly due to VMA_DEBUG_MARGIN or alignment.
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+ }
+ }
+
+ // 3. Try to allocate from existing blocks with making other allocations lost.
+ if(canMakeOtherLost)
+ {
+ uint32_t tryIndex = 0;
+ for(; tryIndex < VMA_ALLOCATION_TRY_COUNT; ++tryIndex)
+ {
+ VmaDeviceMemoryBlock* pBestRequestBlock = VMA_NULL;
+ VmaAllocationRequest bestRequest = {};
+ VkDeviceSize bestRequestCost = VK_WHOLE_SIZE;
+
+ // 1. Search existing allocations.
+ if(strategy == VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT)
+ {
+ // Forward order in m_Blocks - prefer blocks with smallest amount of free space.
+ for(size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex )
+ {
+ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pCurrBlock);
+ VmaAllocationRequest currRequest = {};
+ if(pCurrBlock->m_pMetadata->CreateAllocationRequest(
+ currentFrameIndex,
+ m_FrameInUseCount,
+ m_BufferImageGranularity,
+ size,
+ alignment,
+ (createInfo.flags & VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0,
+ suballocType,
+ canMakeOtherLost,
+ strategy,
+ &currRequest))
+ {
+ const VkDeviceSize currRequestCost = currRequest.CalcCost();
+ if(pBestRequestBlock == VMA_NULL ||
+ currRequestCost < bestRequestCost)
+ {
+ pBestRequestBlock = pCurrBlock;
+ bestRequest = currRequest;
+ bestRequestCost = currRequestCost;
+
+ if(bestRequestCost == 0)
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+ else // WORST_FIT, FIRST_FIT
+ {
+ // Backward order in m_Blocks - prefer blocks with largest amount of free space.
+ for(size_t blockIndex = m_Blocks.size(); blockIndex--; )
+ {
+ VmaDeviceMemoryBlock* const pCurrBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pCurrBlock);
+ VmaAllocationRequest currRequest = {};
+ if(pCurrBlock->m_pMetadata->CreateAllocationRequest(
+ currentFrameIndex,
+ m_FrameInUseCount,
+ m_BufferImageGranularity,
+ size,
+ alignment,
+ (createInfo.flags & VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0,
+ suballocType,
+ canMakeOtherLost,
+ strategy,
+ &currRequest))
+ {
+ const VkDeviceSize currRequestCost = currRequest.CalcCost();
+ if(pBestRequestBlock == VMA_NULL ||
+ currRequestCost < bestRequestCost ||
+ strategy == VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT)
+ {
+ pBestRequestBlock = pCurrBlock;
+ bestRequest = currRequest;
+ bestRequestCost = currRequestCost;
+
+ if(bestRequestCost == 0 ||
+ strategy == VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT)
+ {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if(pBestRequestBlock != VMA_NULL)
+ {
+ if(mapped)
+ {
+ VkResult res = pBestRequestBlock->Map(m_hAllocator, 1, VMA_NULL);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+ }
+
+ if(pBestRequestBlock->m_pMetadata->MakeRequestedAllocationsLost(
+ currentFrameIndex,
+ m_FrameInUseCount,
+ &bestRequest))
+ {
+ // We no longer have an empty Allocation.
+ if(pBestRequestBlock->m_pMetadata->IsEmpty())
+ {
+ m_HasEmptyBlock = false;
+ }
+ // Allocate from this pBlock.
+ *pAllocation = vma_new(m_hAllocator, VmaAllocation_T)(currentFrameIndex, isUserDataString);
+ pBestRequestBlock->m_pMetadata->Alloc(bestRequest, suballocType, size, isUpperAddress, *pAllocation);
+ (*pAllocation)->InitBlockAllocation(
+ hCurrentPool,
+ pBestRequestBlock,
+ bestRequest.offset,
+ alignment,
+ size,
+ suballocType,
+ mapped,
+ (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0);
+ VMA_HEAVY_ASSERT(pBestRequestBlock->Validate());
+ VMA_DEBUG_LOG(" Returned from existing allocation #%u", (uint32_t)blockIndex);
+ (*pAllocation)->SetUserData(m_hAllocator, createInfo.pUserData);
+ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+ {
+ m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
+ }
+ if(IsCorruptionDetectionEnabled())
+ {
+ VkResult res = pBestRequestBlock->WriteMagicValueAroundAllocation(m_hAllocator, bestRequest.offset, size);
+ (void) res;
+ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
+ }
+ return VK_SUCCESS;
+ }
+ // else: Some allocations must have been touched while we are here. Next try.
+ }
+ else
+ {
+ // Could not find place in any of the blocks - break outer loop.
+ break;
+ }
+ }
+ /* Maximum number of tries exceeded - a very unlike event when many other
+ threads are simultaneously touching allocations making it impossible to make
+ lost at the same time as we try to allocate. */
+ if(tryIndex == VMA_ALLOCATION_TRY_COUNT)
+ {
+ return VK_ERROR_TOO_MANY_OBJECTS;
+ }
+ }
+
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+}
+
+void VmaBlockVector::Free(
+ VmaAllocation hAllocation)
+{
+ VmaDeviceMemoryBlock* pBlockToDelete = VMA_NULL;
+
+ // Scope for lock.
+ {
+ VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+ VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
+
+ if(IsCorruptionDetectionEnabled())
+ {
+ VkResult res = pBlock->ValidateMagicValueAroundAllocation(m_hAllocator, hAllocation->GetOffset(), hAllocation->GetSize());
+ (void) res;
+ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to validate magic value.");
+ }
+
+ if(hAllocation->IsPersistentMap())
+ {
+ pBlock->Unmap(m_hAllocator, 1);
+ }
+
+ pBlock->m_pMetadata->Free(hAllocation);
+ VMA_HEAVY_ASSERT(pBlock->Validate());
+
+ VMA_DEBUG_LOG(" Freed from MemoryTypeIndex=%u", memTypeIndex);
+
+ // pBlock became empty after this deallocation.
+ if(pBlock->m_pMetadata->IsEmpty())
+ {
+ // Already has empty Allocation. We don't want to have two, so delete this one.
+ if(m_HasEmptyBlock && m_Blocks.size() > m_MinBlockCount)
+ {
+ pBlockToDelete = pBlock;
+ Remove(pBlock);
+ }
+ // We now have first empty block.
+ else
+ {
+ m_HasEmptyBlock = true;
+ }
+ }
+ // pBlock didn't become empty, but we have another empty block - find and free that one.
+ // (This is optional, heuristics.)
+ else if(m_HasEmptyBlock)
+ {
+ VmaDeviceMemoryBlock* pLastBlock = m_Blocks.back();
+ if(pLastBlock->m_pMetadata->IsEmpty() && m_Blocks.size() > m_MinBlockCount)
+ {
+ pBlockToDelete = pLastBlock;
+ m_Blocks.pop_back();
+ m_HasEmptyBlock = false;
+ }
+ }
+
+ IncrementallySortBlocks();
+ }
+
+ // Destruction of a free Allocation. Deferred until this point, outside of mutex
+ // lock, for performance reason.
+ if(pBlockToDelete != VMA_NULL)
+ {
+ VMA_DEBUG_LOG(" Deleted empty allocation");
+ pBlockToDelete->Destroy(m_hAllocator);
+ vma_delete(m_hAllocator, pBlockToDelete);
+ }
+}
+
+VkDeviceSize VmaBlockVector::CalcMaxBlockSize() const
+{
+ VkDeviceSize result = 0;
+ for(size_t i = m_Blocks.size(); i--; )
+ {
+ result = VMA_MAX(result, m_Blocks[i]->m_pMetadata->GetSize());
+ if(result >= m_PreferredBlockSize)
+ {
+ break;
+ }
+ }
+ return result;
+}
+
+void VmaBlockVector::Remove(VmaDeviceMemoryBlock* pBlock)
+{
+ for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+ {
+ if(m_Blocks[blockIndex] == pBlock)
+ {
+ VmaVectorRemove(m_Blocks, blockIndex);
+ return;
+ }
+ }
+ VMA_ASSERT(0);
+}
+
+void VmaBlockVector::IncrementallySortBlocks()
+{
+ if(m_Algorithm != VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT)
+ {
+ // Bubble sort only until first swap.
+ for(size_t i = 1; i < m_Blocks.size(); ++i)
+ {
+ if(m_Blocks[i - 1]->m_pMetadata->GetSumFreeSize() > m_Blocks[i]->m_pMetadata->GetSumFreeSize())
+ {
+ VMA_SWAP(m_Blocks[i - 1], m_Blocks[i]);
+ return;
+ }
+ }
+ }
+}
+
+VkResult VmaBlockVector::AllocateFromBlock(
+ VmaDeviceMemoryBlock* pBlock,
+ VmaPool hCurrentPool,
+ uint32_t currentFrameIndex,
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ VmaAllocationCreateFlags allocFlags,
+ void* pUserData,
+ VmaSuballocationType suballocType,
+ uint32_t strategy,
+ VmaAllocation* pAllocation)
+{
+ VMA_ASSERT((allocFlags & VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT) == 0);
+ const bool isUpperAddress = (allocFlags & VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT) != 0;
+ const bool mapped = (allocFlags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0;
+ const bool isUserDataString = (allocFlags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0;
+
+ VmaAllocationRequest currRequest = {};
+ if(pBlock->m_pMetadata->CreateAllocationRequest(
+ currentFrameIndex,
+ m_FrameInUseCount,
+ m_BufferImageGranularity,
+ size,
+ alignment,
+ isUpperAddress,
+ suballocType,
+ false, // canMakeOtherLost
+ strategy,
+ &currRequest))
+ {
+ // Allocate from pCurrBlock.
+ VMA_ASSERT(currRequest.itemsToMakeLostCount == 0);
+
+ if(mapped)
+ {
+ VkResult res = pBlock->Map(m_hAllocator, 1, VMA_NULL);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+ }
+
+ // We no longer have an empty Allocation.
+ if(pBlock->m_pMetadata->IsEmpty())
+ {
+ m_HasEmptyBlock = false;
+ }
+
+ *pAllocation = vma_new(m_hAllocator, VmaAllocation_T)(currentFrameIndex, isUserDataString);
+ pBlock->m_pMetadata->Alloc(currRequest, suballocType, size, isUpperAddress, *pAllocation);
+ (*pAllocation)->InitBlockAllocation(
+ hCurrentPool,
+ pBlock,
+ currRequest.offset,
+ alignment,
+ size,
+ suballocType,
+ mapped,
+ (allocFlags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0);
+ VMA_HEAVY_ASSERT(pBlock->Validate());
+ (*pAllocation)->SetUserData(m_hAllocator, pUserData);
+ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+ {
+ m_hAllocator->FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
+ }
+ if(IsCorruptionDetectionEnabled())
+ {
+ VkResult res = pBlock->WriteMagicValueAroundAllocation(m_hAllocator, currRequest.offset, size);
+ (void) res;
+ VMA_ASSERT(res == VK_SUCCESS && "Couldn't map block memory to write magic value.");
+ }
+ return VK_SUCCESS;
+ }
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+}
+
+VkResult VmaBlockVector::CreateBlock(VkDeviceSize blockSize, size_t* pNewBlockIndex)
+{
+ VkMemoryAllocateInfo allocInfo = {};
+ allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
+ allocInfo.memoryTypeIndex = m_MemoryTypeIndex;
+ allocInfo.allocationSize = blockSize;
+ VkDeviceMemory mem = VK_NULL_HANDLE;
+ VkResult res = m_hAllocator->AllocateVulkanMemory(&allocInfo, &mem);
+ if(res < 0)
+ {
+ return res;
+ }
+
+ // New VkDeviceMemory successfully created.
+
+ // Create new Allocation for it.
+ VmaDeviceMemoryBlock* const pBlock = vma_new(m_hAllocator, VmaDeviceMemoryBlock)(m_hAllocator);
+ pBlock->Init(
+ m_hAllocator,
+ m_MemoryTypeIndex,
+ mem,
+ allocInfo.allocationSize,
+ m_NextBlockId++,
+ m_Algorithm);
+
+ m_Blocks.push_back(pBlock);
+ if(pNewBlockIndex != VMA_NULL)
+ {
+ *pNewBlockIndex = m_Blocks.size() - 1;
+ }
+
+ return VK_SUCCESS;
+}
+
+void VmaBlockVector::ApplyDefragmentationMovesCpu(
+ class VmaBlockVectorDefragmentationContext* pDefragCtx,
+ const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves)
+{
+ const size_t blockCount = m_Blocks.size();
+ const bool isNonCoherent = m_hAllocator->IsMemoryTypeNonCoherent(m_MemoryTypeIndex);
+
+ enum BLOCK_FLAG
+ {
+ BLOCK_FLAG_USED = 0x00000001,
+ BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION = 0x00000002,
+ };
+
+ struct BlockInfo
+ {
+ uint32_t flags;
+ void* pMappedData;
+ };
+ VmaVector< BlockInfo, VmaStlAllocator<BlockInfo> >
+ blockInfo(blockCount, VmaStlAllocator<BlockInfo>(m_hAllocator->GetAllocationCallbacks()));
+ memset(blockInfo.data(), 0, blockCount * sizeof(BlockInfo));
+
+ // Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.
+ const size_t moveCount = moves.size();
+ for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+ {
+ const VmaDefragmentationMove& move = moves[moveIndex];
+ blockInfo[move.srcBlockIndex].flags |= BLOCK_FLAG_USED;
+ blockInfo[move.dstBlockIndex].flags |= BLOCK_FLAG_USED;
+ }
+
+ VMA_ASSERT(pDefragCtx->res == VK_SUCCESS);
+
+ // Go over all blocks. Get mapped pointer or map if necessary.
+ for(size_t blockIndex = 0; pDefragCtx->res == VK_SUCCESS && blockIndex < blockCount; ++blockIndex)
+ {
+ BlockInfo& currBlockInfo = blockInfo[blockIndex];
+ VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+ if((currBlockInfo.flags & BLOCK_FLAG_USED) != 0)
+ {
+ currBlockInfo.pMappedData = pBlock->GetMappedData();
+ // It is not originally mapped - map it.
+ if(currBlockInfo.pMappedData == VMA_NULL)
+ {
+ pDefragCtx->res = pBlock->Map(m_hAllocator, 1, &currBlockInfo.pMappedData);
+ if(pDefragCtx->res == VK_SUCCESS)
+ {
+ currBlockInfo.flags |= BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION;
+ }
+ }
+ }
+ }
+
+ // Go over all moves. Do actual data transfer.
+ if(pDefragCtx->res == VK_SUCCESS)
+ {
+ const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+ VkMappedMemoryRange memRange = {};
+ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
+
+ for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+ {
+ const VmaDefragmentationMove& move = moves[moveIndex];
+
+ const BlockInfo& srcBlockInfo = blockInfo[move.srcBlockIndex];
+ const BlockInfo& dstBlockInfo = blockInfo[move.dstBlockIndex];
+
+ VMA_ASSERT(srcBlockInfo.pMappedData && dstBlockInfo.pMappedData);
+
+ // Invalidate source.
+ if(isNonCoherent)
+ {
+ VmaDeviceMemoryBlock* const pSrcBlock = m_Blocks[move.srcBlockIndex];
+ memRange.memory = pSrcBlock->GetDeviceMemory();
+ memRange.offset = VmaAlignDown(move.srcOffset, nonCoherentAtomSize);
+ memRange.size = VMA_MIN(
+ VmaAlignUp(move.size + (move.srcOffset - memRange.offset), nonCoherentAtomSize),
+ pSrcBlock->m_pMetadata->GetSize() - memRange.offset);
+ (*m_hAllocator->GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hAllocator->m_hDevice, 1, &memRange);
+ }
+
+ // THE PLACE WHERE ACTUAL DATA COPY HAPPENS.
+ memmove(
+ reinterpret_cast<char*>(dstBlockInfo.pMappedData) + move.dstOffset,
+ reinterpret_cast<char*>(srcBlockInfo.pMappedData) + move.srcOffset,
+ static_cast<size_t>(move.size));
+
+ if(IsCorruptionDetectionEnabled())
+ {
+ VmaWriteMagicValue(dstBlockInfo.pMappedData, move.dstOffset - VMA_DEBUG_MARGIN);
+ VmaWriteMagicValue(dstBlockInfo.pMappedData, move.dstOffset + move.size);
+ }
+
+ // Flush destination.
+ if(isNonCoherent)
+ {
+ VmaDeviceMemoryBlock* const pDstBlock = m_Blocks[move.dstBlockIndex];
+ memRange.memory = pDstBlock->GetDeviceMemory();
+ memRange.offset = VmaAlignDown(move.dstOffset, nonCoherentAtomSize);
+ memRange.size = VMA_MIN(
+ VmaAlignUp(move.size + (move.dstOffset - memRange.offset), nonCoherentAtomSize),
+ pDstBlock->m_pMetadata->GetSize() - memRange.offset);
+ (*m_hAllocator->GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hAllocator->m_hDevice, 1, &memRange);
+ }
+ }
+ }
+
+ // Go over all blocks in reverse order. Unmap those that were mapped just for defragmentation.
+ // Regardless of pCtx->res == VK_SUCCESS.
+ for(size_t blockIndex = blockCount; blockIndex--; )
+ {
+ const BlockInfo& currBlockInfo = blockInfo[blockIndex];
+ if((currBlockInfo.flags & BLOCK_FLAG_MAPPED_FOR_DEFRAGMENTATION) != 0)
+ {
+ VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+ pBlock->Unmap(m_hAllocator, 1);
+ }
+ }
+}
+
+void VmaBlockVector::ApplyDefragmentationMovesGpu(
+ class VmaBlockVectorDefragmentationContext* pDefragCtx,
+ const VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkCommandBuffer commandBuffer)
+{
+ const size_t blockCount = m_Blocks.size();
+
+ pDefragCtx->blockContexts.resize(blockCount);
+ for (size_t i = 0; i < blockCount; ++i)
+ pDefragCtx->blockContexts[i] = VmaBlockDefragmentationContext();
+
+ // Go over all moves. Mark blocks that are used with BLOCK_FLAG_USED.
+ const size_t moveCount = moves.size();
+ for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+ {
+ const VmaDefragmentationMove& move = moves[moveIndex];
+ pDefragCtx->blockContexts[move.srcBlockIndex].flags |= VmaBlockDefragmentationContext::BLOCK_FLAG_USED;
+ pDefragCtx->blockContexts[move.dstBlockIndex].flags |= VmaBlockDefragmentationContext::BLOCK_FLAG_USED;
+ }
+
+ VMA_ASSERT(pDefragCtx->res == VK_SUCCESS);
+
+ // Go over all blocks. Create and bind buffer for whole block if necessary.
+ {
+ VkBufferCreateInfo bufCreateInfo = {};
+ bufCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT |
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+ for(size_t blockIndex = 0; pDefragCtx->res == VK_SUCCESS && blockIndex < blockCount; ++blockIndex)
+ {
+ VmaBlockDefragmentationContext& currBlockCtx = pDefragCtx->blockContexts[blockIndex];
+ VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+ if((currBlockCtx.flags & VmaBlockDefragmentationContext::BLOCK_FLAG_USED) != 0)
+ {
+ bufCreateInfo.size = pBlock->m_pMetadata->GetSize();
+ pDefragCtx->res = (*m_hAllocator->GetVulkanFunctions().vkCreateBuffer)(
+ m_hAllocator->m_hDevice, &bufCreateInfo, m_hAllocator->GetAllocationCallbacks(), &currBlockCtx.hBuffer);
+ if(pDefragCtx->res == VK_SUCCESS)
+ {
+ pDefragCtx->res = (*m_hAllocator->GetVulkanFunctions().vkBindBufferMemory)(
+ m_hAllocator->m_hDevice, currBlockCtx.hBuffer, pBlock->GetDeviceMemory(), 0);
+ }
+ }
+ }
+ }
+
+ // Go over all moves. Post data transfer commands to command buffer.
+ if(pDefragCtx->res == VK_SUCCESS)
+ {
+ /*const VkDeviceSize nonCoherentAtomSize = m_hAllocator->m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+ VkMappedMemoryRange memRange = {};
+ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;*/
+
+ for(size_t moveIndex = 0; moveIndex < moveCount; ++moveIndex)
+ {
+ const VmaDefragmentationMove& move = moves[moveIndex];
+
+ const VmaBlockDefragmentationContext& srcBlockCtx = pDefragCtx->blockContexts[move.srcBlockIndex];
+ const VmaBlockDefragmentationContext& dstBlockCtx = pDefragCtx->blockContexts[move.dstBlockIndex];
+
+ VMA_ASSERT(srcBlockCtx.hBuffer && dstBlockCtx.hBuffer);
+
+ VkBufferCopy region = {
+ move.srcOffset,
+ move.dstOffset,
+ move.size };
+ (*m_hAllocator->GetVulkanFunctions().vkCmdCopyBuffer)(
+ commandBuffer, srcBlockCtx.hBuffer, dstBlockCtx.hBuffer, 1, &region);
+ }
+ }
+
+ // Save buffers to defrag context for later destruction.
+ if(pDefragCtx->res == VK_SUCCESS && moveCount > 0)
+ {
+ pDefragCtx->res = VK_NOT_READY;
+ }
+}
+
+void VmaBlockVector::FreeEmptyBlocks(VmaDefragmentationStats* pDefragmentationStats)
+{
+ m_HasEmptyBlock = false;
+ for(size_t blockIndex = m_Blocks.size(); blockIndex--; )
+ {
+ VmaDeviceMemoryBlock* pBlock = m_Blocks[blockIndex];
+ if(pBlock->m_pMetadata->IsEmpty())
+ {
+ if(m_Blocks.size() > m_MinBlockCount)
+ {
+ if(pDefragmentationStats != VMA_NULL)
+ {
+ ++pDefragmentationStats->deviceMemoryBlocksFreed;
+ pDefragmentationStats->bytesFreed += pBlock->m_pMetadata->GetSize();
+ }
+
+ VmaVectorRemove(m_Blocks, blockIndex);
+ pBlock->Destroy(m_hAllocator);
+ vma_delete(m_hAllocator, pBlock);
+ }
+ else
+ {
+ m_HasEmptyBlock = true;
+ }
+ }
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+void VmaBlockVector::PrintDetailedMap(class VmaJsonWriter& json)
+{
+ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+ json.BeginObject();
+
+ if(m_IsCustomPool)
+ {
+ json.WriteString("MemoryTypeIndex");
+ json.WriteNumber(m_MemoryTypeIndex);
+
+ json.WriteString("BlockSize");
+ json.WriteNumber(m_PreferredBlockSize);
+
+ json.WriteString("BlockCount");
+ json.BeginObject(true);
+ if(m_MinBlockCount > 0)
+ {
+ json.WriteString("Min");
+ json.WriteNumber((uint64_t)m_MinBlockCount);
+ }
+ if(m_MaxBlockCount < SIZE_MAX)
+ {
+ json.WriteString("Max");
+ json.WriteNumber((uint64_t)m_MaxBlockCount);
+ }
+ json.WriteString("Cur");
+ json.WriteNumber((uint64_t)m_Blocks.size());
+ json.EndObject();
+
+ if(m_FrameInUseCount > 0)
+ {
+ json.WriteString("FrameInUseCount");
+ json.WriteNumber(m_FrameInUseCount);
+ }
+
+ if(m_Algorithm != 0)
+ {
+ json.WriteString("Algorithm");
+ json.WriteString(VmaAlgorithmToStr(m_Algorithm));
+ }
+ }
+ else
+ {
+ json.WriteString("PreferredBlockSize");
+ json.WriteNumber(m_PreferredBlockSize);
+ }
+
+ json.WriteString("Blocks");
+ json.BeginObject();
+ for(size_t i = 0; i < m_Blocks.size(); ++i)
+ {
+ json.BeginString();
+ json.ContinueString(m_Blocks[i]->GetId());
+ json.EndString();
+
+ m_Blocks[i]->m_pMetadata->PrintDetailedMap(json);
+ }
+ json.EndObject();
+
+ json.EndObject();
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+void VmaBlockVector::Defragment(
+ class VmaBlockVectorDefragmentationContext* pCtx,
+ VmaDefragmentationStats* pStats,
+ VkDeviceSize& maxCpuBytesToMove, uint32_t& maxCpuAllocationsToMove,
+ VkDeviceSize& maxGpuBytesToMove, uint32_t& maxGpuAllocationsToMove,
+ VkCommandBuffer commandBuffer)
+{
+ pCtx->res = VK_SUCCESS;
+
+ const VkMemoryPropertyFlags memPropFlags =
+ m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags;
+ const bool isHostVisible = (memPropFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0;
+ const bool isHostCoherent = (memPropFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0;
+
+ const bool canDefragmentOnCpu = maxCpuBytesToMove > 0 && maxCpuAllocationsToMove > 0 &&
+ isHostVisible;
+ const bool canDefragmentOnGpu = maxGpuBytesToMove > 0 && maxGpuAllocationsToMove > 0 &&
+ (VMA_DEBUG_DETECT_CORRUPTION == 0 || !(isHostVisible && isHostCoherent));
+
+ // There are options to defragment this memory type.
+ if(canDefragmentOnCpu || canDefragmentOnGpu)
+ {
+ bool defragmentOnGpu;
+ // There is only one option to defragment this memory type.
+ if(canDefragmentOnGpu != canDefragmentOnCpu)
+ {
+ defragmentOnGpu = canDefragmentOnGpu;
+ }
+ // Both options are available: Heuristics to choose the best one.
+ else
+ {
+ defragmentOnGpu = (memPropFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0 ||
+ m_hAllocator->IsIntegratedGpu();
+ }
+
+ bool overlappingMoveSupported = !defragmentOnGpu;
+
+ if(m_hAllocator->m_UseMutex)
+ {
+ m_Mutex.LockWrite();
+ pCtx->mutexLocked = true;
+ }
+
+ pCtx->Begin(overlappingMoveSupported);
+
+ // Defragment.
+
+ const VkDeviceSize maxBytesToMove = defragmentOnGpu ? maxGpuBytesToMove : maxCpuBytesToMove;
+ const uint32_t maxAllocationsToMove = defragmentOnGpu ? maxGpuAllocationsToMove : maxCpuAllocationsToMove;
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> > moves =
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >(VmaStlAllocator<VmaDefragmentationMove>(m_hAllocator->GetAllocationCallbacks()));
+ pCtx->res = pCtx->GetAlgorithm()->Defragment(moves, maxBytesToMove, maxAllocationsToMove);
+
+ // Accumulate statistics.
+ if(pStats != VMA_NULL)
+ {
+ const VkDeviceSize bytesMoved = pCtx->GetAlgorithm()->GetBytesMoved();
+ const uint32_t allocationsMoved = pCtx->GetAlgorithm()->GetAllocationsMoved();
+ pStats->bytesMoved += bytesMoved;
+ pStats->allocationsMoved += allocationsMoved;
+ VMA_ASSERT(bytesMoved <= maxBytesToMove);
+ VMA_ASSERT(allocationsMoved <= maxAllocationsToMove);
+ if(defragmentOnGpu)
+ {
+ maxGpuBytesToMove -= bytesMoved;
+ maxGpuAllocationsToMove -= allocationsMoved;
+ }
+ else
+ {
+ maxCpuBytesToMove -= bytesMoved;
+ maxCpuAllocationsToMove -= allocationsMoved;
+ }
+ }
+
+ if(pCtx->res >= VK_SUCCESS)
+ {
+ if(defragmentOnGpu)
+ {
+ ApplyDefragmentationMovesGpu(pCtx, moves, commandBuffer);
+ }
+ else
+ {
+ ApplyDefragmentationMovesCpu(pCtx, moves);
+ }
+ }
+ }
+}
+
+void VmaBlockVector::DefragmentationEnd(
+ class VmaBlockVectorDefragmentationContext* pCtx,
+ VmaDefragmentationStats* pStats)
+{
+ // Destroy buffers.
+ for(size_t blockIndex = pCtx->blockContexts.size(); blockIndex--; )
+ {
+ VmaBlockDefragmentationContext& blockCtx = pCtx->blockContexts[blockIndex];
+ if(blockCtx.hBuffer)
+ {
+ (*m_hAllocator->GetVulkanFunctions().vkDestroyBuffer)(
+ m_hAllocator->m_hDevice, blockCtx.hBuffer, m_hAllocator->GetAllocationCallbacks());
+ }
+ }
+
+ if(pCtx->res >= VK_SUCCESS)
+ {
+ FreeEmptyBlocks(pStats);
+ }
+
+ if(pCtx->mutexLocked)
+ {
+ VMA_ASSERT(m_hAllocator->m_UseMutex);
+ m_Mutex.UnlockWrite();
+ }
+}
+
+size_t VmaBlockVector::CalcAllocationCount() const
+{
+ size_t result = 0;
+ for(size_t i = 0; i < m_Blocks.size(); ++i)
+ {
+ result += m_Blocks[i]->m_pMetadata->GetAllocationCount();
+ }
+ return result;
+}
+
+bool VmaBlockVector::IsBufferImageGranularityConflictPossible() const
+{
+ if(m_BufferImageGranularity == 1)
+ {
+ return false;
+ }
+ VmaSuballocationType lastSuballocType = VMA_SUBALLOCATION_TYPE_FREE;
+ for(size_t i = 0, count = m_Blocks.size(); i < count; ++i)
+ {
+ VmaDeviceMemoryBlock* const pBlock = m_Blocks[i];
+ VMA_ASSERT(m_Algorithm == 0);
+ VmaBlockMetadata_Generic* const pMetadata = (VmaBlockMetadata_Generic*)pBlock->m_pMetadata;
+ if(pMetadata->IsBufferImageGranularityConflictPossible(m_BufferImageGranularity, lastSuballocType))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+void VmaBlockVector::MakePoolAllocationsLost(
+ uint32_t currentFrameIndex,
+ size_t* pLostAllocationCount)
+{
+ VmaMutexLockWrite lock(m_Mutex, m_hAllocator->m_UseMutex);
+ size_t lostAllocationCount = 0;
+ for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+ {
+ VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pBlock);
+ lostAllocationCount += pBlock->m_pMetadata->MakeAllocationsLost(currentFrameIndex, m_FrameInUseCount);
+ }
+ if(pLostAllocationCount != VMA_NULL)
+ {
+ *pLostAllocationCount = lostAllocationCount;
+ }
+}
+
+VkResult VmaBlockVector::CheckCorruption()
+{
+ if(!IsCorruptionDetectionEnabled())
+ {
+ return VK_ERROR_FEATURE_NOT_PRESENT;
+ }
+
+ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+ for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+ {
+ VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pBlock);
+ VkResult res = pBlock->CheckCorruption(m_hAllocator);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+ }
+ return VK_SUCCESS;
+}
+
+void VmaBlockVector::AddStats(VmaStats* pStats)
+{
+ const uint32_t memTypeIndex = m_MemoryTypeIndex;
+ const uint32_t memHeapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(memTypeIndex);
+
+ VmaMutexLockRead lock(m_Mutex, m_hAllocator->m_UseMutex);
+
+ for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex)
+ {
+ const VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex];
+ VMA_ASSERT(pBlock);
+ VMA_HEAVY_ASSERT(pBlock->Validate());
+ VmaStatInfo allocationStatInfo;
+ pBlock->m_pMetadata->CalcAllocationStatInfo(allocationStatInfo);
+ VmaAddStatInfo(pStats->total, allocationStatInfo);
+ VmaAddStatInfo(pStats->memoryType[memTypeIndex], allocationStatInfo);
+ VmaAddStatInfo(pStats->memoryHeap[memHeapIndex], allocationStatInfo);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaDefragmentationAlgorithm_Generic members definition
+
+VmaDefragmentationAlgorithm_Generic::VmaDefragmentationAlgorithm_Generic(
+ VmaAllocator hAllocator,
+ VmaBlockVector* pBlockVector,
+ uint32_t currentFrameIndex,
+ bool /*overlappingMoveSupported*/) :
+ VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
+ m_AllocationCount(0),
+ m_AllAllocations(false),
+ m_BytesMoved(0),
+ m_AllocationsMoved(0),
+ m_Blocks(VmaStlAllocator<BlockInfo*>(hAllocator->GetAllocationCallbacks()))
+{
+ // Create block info for each block.
+ const size_t blockCount = m_pBlockVector->m_Blocks.size();
+ for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+ {
+ BlockInfo* pBlockInfo = vma_new(m_hAllocator, BlockInfo)(m_hAllocator->GetAllocationCallbacks());
+ pBlockInfo->m_OriginalBlockIndex = blockIndex;
+ pBlockInfo->m_pBlock = m_pBlockVector->m_Blocks[blockIndex];
+ m_Blocks.push_back(pBlockInfo);
+ }
+
+ // Sort them by m_pBlock pointer value.
+ VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockPointerLess());
+}
+
+VmaDefragmentationAlgorithm_Generic::~VmaDefragmentationAlgorithm_Generic()
+{
+ for(size_t i = m_Blocks.size(); i--; )
+ {
+ vma_delete(m_hAllocator, m_Blocks[i]);
+ }
+}
+
+void VmaDefragmentationAlgorithm_Generic::AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged)
+{
+ // Now as we are inside VmaBlockVector::m_Mutex, we can make final check if this allocation was not lost.
+ if(hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST)
+ {
+ VmaDeviceMemoryBlock* pBlock = hAlloc->GetBlock();
+ BlockInfoVector::iterator it = VmaBinaryFindFirstNotLess(m_Blocks.begin(), m_Blocks.end(), pBlock, BlockPointerLess());
+ if(it != m_Blocks.end() && (*it)->m_pBlock == pBlock)
+ {
+ AllocationInfo allocInfo = AllocationInfo(hAlloc, pChanged);
+ (*it)->m_Allocations.push_back(allocInfo);
+ }
+ else
+ {
+ VMA_ASSERT(0);
+ }
+
+ ++m_AllocationCount;
+ }
+}
+
+VkResult VmaDefragmentationAlgorithm_Generic::DefragmentRound(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove)
+{
+ if(m_Blocks.empty())
+ {
+ return VK_SUCCESS;
+ }
+
+ // This is a choice based on research.
+ // Option 1:
+ uint32_t strategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT;
+ // Option 2:
+ //uint32_t strategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT;
+ // Option 3:
+ //uint32_t strategy = VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT;
+
+ size_t srcBlockMinIndex = 0;
+ // When FAST_ALGORITHM, move allocations from only last out of blocks that contain non-movable allocations.
+ /*
+ if(m_AlgorithmFlags & VMA_DEFRAGMENTATION_FAST_ALGORITHM_BIT)
+ {
+ const size_t blocksWithNonMovableCount = CalcBlocksWithNonMovableCount();
+ if(blocksWithNonMovableCount > 0)
+ {
+ srcBlockMinIndex = blocksWithNonMovableCount - 1;
+ }
+ }
+ */
+
+ size_t srcBlockIndex = m_Blocks.size() - 1;
+ size_t srcAllocIndex = SIZE_MAX;
+ for(;;)
+ {
+ // 1. Find next allocation to move.
+ // 1.1. Start from last to first m_Blocks - they are sorted from most "destination" to most "source".
+ // 1.2. Then start from last to first m_Allocations.
+ while(srcAllocIndex >= m_Blocks[srcBlockIndex]->m_Allocations.size())
+ {
+ if(m_Blocks[srcBlockIndex]->m_Allocations.empty())
+ {
+ // Finished: no more allocations to process.
+ if(srcBlockIndex == srcBlockMinIndex)
+ {
+ return VK_SUCCESS;
+ }
+ else
+ {
+ --srcBlockIndex;
+ srcAllocIndex = SIZE_MAX;
+ }
+ }
+ else
+ {
+ srcAllocIndex = m_Blocks[srcBlockIndex]->m_Allocations.size() - 1;
+ }
+ }
+
+ BlockInfo* pSrcBlockInfo = m_Blocks[srcBlockIndex];
+ AllocationInfo& allocInfo = pSrcBlockInfo->m_Allocations[srcAllocIndex];
+
+ const VkDeviceSize size = allocInfo.m_hAllocation->GetSize();
+ const VkDeviceSize srcOffset = allocInfo.m_hAllocation->GetOffset();
+ const VkDeviceSize alignment = allocInfo.m_hAllocation->GetAlignment();
+ const VmaSuballocationType suballocType = allocInfo.m_hAllocation->GetSuballocationType();
+
+ // 2. Try to find new place for this allocation in preceding or current block.
+ for(size_t dstBlockIndex = 0; dstBlockIndex <= srcBlockIndex; ++dstBlockIndex)
+ {
+ BlockInfo* pDstBlockInfo = m_Blocks[dstBlockIndex];
+ VmaAllocationRequest dstAllocRequest;
+ if(pDstBlockInfo->m_pBlock->m_pMetadata->CreateAllocationRequest(
+ m_CurrentFrameIndex,
+ m_pBlockVector->GetFrameInUseCount(),
+ m_pBlockVector->GetBufferImageGranularity(),
+ size,
+ alignment,
+ false, // upperAddress
+ suballocType,
+ false, // canMakeOtherLost
+ strategy,
+ &dstAllocRequest) &&
+ MoveMakesSense(
+ dstBlockIndex, dstAllocRequest.offset, srcBlockIndex, srcOffset))
+ {
+ VMA_ASSERT(dstAllocRequest.itemsToMakeLostCount == 0);
+
+ // Reached limit on number of allocations or bytes to move.
+ if((m_AllocationsMoved + 1 > maxAllocationsToMove) ||
+ (m_BytesMoved + size > maxBytesToMove))
+ {
+ return VK_SUCCESS;
+ }
+
+ VmaDefragmentationMove move;
+ move.srcBlockIndex = pSrcBlockInfo->m_OriginalBlockIndex;
+ move.dstBlockIndex = pDstBlockInfo->m_OriginalBlockIndex;
+ move.srcOffset = srcOffset;
+ move.dstOffset = dstAllocRequest.offset;
+ move.size = size;
+ moves.push_back(move);
+
+ pDstBlockInfo->m_pBlock->m_pMetadata->Alloc(
+ dstAllocRequest,
+ suballocType,
+ size,
+ false, // upperAddress
+ allocInfo.m_hAllocation);
+ pSrcBlockInfo->m_pBlock->m_pMetadata->FreeAtOffset(srcOffset);
+
+ allocInfo.m_hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlockInfo->m_pBlock, dstAllocRequest.offset);
+
+ if(allocInfo.m_pChanged != VMA_NULL)
+ {
+ *allocInfo.m_pChanged = VK_TRUE;
+ }
+
+ ++m_AllocationsMoved;
+ m_BytesMoved += size;
+
+ VmaVectorRemove(pSrcBlockInfo->m_Allocations, srcAllocIndex);
+
+ break;
+ }
+ }
+
+ // If not processed, this allocInfo remains in pBlockInfo->m_Allocations for next round.
+
+ if(srcAllocIndex > 0)
+ {
+ --srcAllocIndex;
+ }
+ else
+ {
+ if(srcBlockIndex > 0)
+ {
+ --srcBlockIndex;
+ srcAllocIndex = SIZE_MAX;
+ }
+ else
+ {
+ return VK_SUCCESS;
+ }
+ }
+ }
+}
+
+size_t VmaDefragmentationAlgorithm_Generic::CalcBlocksWithNonMovableCount() const
+{
+ size_t result = 0;
+ for(size_t i = 0; i < m_Blocks.size(); ++i)
+ {
+ if(m_Blocks[i]->m_HasNonMovableAllocations)
+ {
+ ++result;
+ }
+ }
+ return result;
+}
+
+VkResult VmaDefragmentationAlgorithm_Generic::Defragment(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove)
+{
+ if(!m_AllAllocations && m_AllocationCount == 0)
+ {
+ return VK_SUCCESS;
+ }
+
+ const size_t blockCount = m_Blocks.size();
+ for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+ {
+ BlockInfo* pBlockInfo = m_Blocks[blockIndex];
+
+ if(m_AllAllocations)
+ {
+ VmaBlockMetadata_Generic* pMetadata = (VmaBlockMetadata_Generic*)pBlockInfo->m_pBlock->m_pMetadata;
+ for(VmaSuballocationList::const_iterator it = pMetadata->m_Suballocations.begin();
+ it != pMetadata->m_Suballocations.end();
+ ++it)
+ {
+ if(it->type != VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ AllocationInfo allocInfo = AllocationInfo(it->hAllocation, VMA_NULL);
+ pBlockInfo->m_Allocations.push_back(allocInfo);
+ }
+ }
+ }
+
+ pBlockInfo->CalcHasNonMovableAllocations();
+
+ // This is a choice based on research.
+ // Option 1:
+ pBlockInfo->SortAllocationsByOffsetDescending();
+ // Option 2:
+ //pBlockInfo->SortAllocationsBySizeDescending();
+ }
+
+ // Sort m_Blocks this time by the main criterium, from most "destination" to most "source" blocks.
+ VMA_SORT(m_Blocks.begin(), m_Blocks.end(), BlockInfoCompareMoveDestination());
+
+ // This is a choice based on research.
+ const uint32_t roundCount = 2;
+
+ // Execute defragmentation rounds (the main part).
+ VkResult result = VK_SUCCESS;
+ for(uint32_t round = 0; (round < roundCount) && (result == VK_SUCCESS); ++round)
+ {
+ result = DefragmentRound(moves, maxBytesToMove, maxAllocationsToMove);
+ }
+
+ return result;
+}
+
+bool VmaDefragmentationAlgorithm_Generic::MoveMakesSense(
+ size_t dstBlockIndex, VkDeviceSize dstOffset,
+ size_t srcBlockIndex, VkDeviceSize srcOffset)
+{
+ if(dstBlockIndex < srcBlockIndex)
+ {
+ return true;
+ }
+ if(dstBlockIndex > srcBlockIndex)
+ {
+ return false;
+ }
+ if(dstOffset < srcOffset)
+ {
+ return true;
+ }
+ return false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaDefragmentationAlgorithm_Fast
+
+VmaDefragmentationAlgorithm_Fast::VmaDefragmentationAlgorithm_Fast(
+ VmaAllocator hAllocator,
+ VmaBlockVector* pBlockVector,
+ uint32_t currentFrameIndex,
+ bool overlappingMoveSupported) :
+ VmaDefragmentationAlgorithm(hAllocator, pBlockVector, currentFrameIndex),
+ m_OverlappingMoveSupported(overlappingMoveSupported),
+ m_AllocationCount(0),
+ m_AllAllocations(false),
+ m_BytesMoved(0),
+ m_AllocationsMoved(0),
+ m_BlockInfos(VmaStlAllocator<BlockInfo>(hAllocator->GetAllocationCallbacks()))
+{
+ VMA_ASSERT(VMA_DEBUG_MARGIN == 0);
+
+}
+
+VmaDefragmentationAlgorithm_Fast::~VmaDefragmentationAlgorithm_Fast()
+{
+}
+
+VkResult VmaDefragmentationAlgorithm_Fast::Defragment(
+ VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
+ VkDeviceSize maxBytesToMove,
+ uint32_t maxAllocationsToMove)
+{
+ VMA_ASSERT(m_AllAllocations || m_pBlockVector->CalcAllocationCount() == m_AllocationCount);
+
+ const size_t blockCount = m_pBlockVector->GetBlockCount();
+ if(blockCount == 0 || maxBytesToMove == 0 || maxAllocationsToMove == 0)
+ {
+ return VK_SUCCESS;
+ }
+
+ PreprocessMetadata();
+
+ // Sort blocks in order from most destination.
+
+ m_BlockInfos.resize(blockCount);
+ for(size_t i = 0; i < blockCount; ++i)
+ {
+ m_BlockInfos[i].origBlockIndex = i;
+ }
+
+ VMA_SORT(m_BlockInfos.begin(), m_BlockInfos.end(), [this](const BlockInfo& lhs, const BlockInfo& rhs) -> bool {
+ return m_pBlockVector->GetBlock(lhs.origBlockIndex)->m_pMetadata->GetSumFreeSize() <
+ m_pBlockVector->GetBlock(rhs.origBlockIndex)->m_pMetadata->GetSumFreeSize();
+ });
+
+ // THE MAIN ALGORITHM
+
+ FreeSpaceDatabase freeSpaceDb;
+
+ size_t dstBlockInfoIndex = 0;
+ size_t dstOrigBlockIndex = m_BlockInfos[dstBlockInfoIndex].origBlockIndex;
+ VmaDeviceMemoryBlock* pDstBlock = m_pBlockVector->GetBlock(dstOrigBlockIndex);
+ VmaBlockMetadata_Generic* pDstMetadata = (VmaBlockMetadata_Generic*)pDstBlock->m_pMetadata;
+ VkDeviceSize dstBlockSize = pDstMetadata->GetSize();
+ VkDeviceSize dstOffset = 0;
+
+ bool end = false;
+ for(size_t srcBlockInfoIndex = 0; !end && srcBlockInfoIndex < blockCount; ++srcBlockInfoIndex)
+ {
+ const size_t srcOrigBlockIndex = m_BlockInfos[srcBlockInfoIndex].origBlockIndex;
+ VmaDeviceMemoryBlock* const pSrcBlock = m_pBlockVector->GetBlock(srcOrigBlockIndex);
+ VmaBlockMetadata_Generic* const pSrcMetadata = (VmaBlockMetadata_Generic*)pSrcBlock->m_pMetadata;
+ for(VmaSuballocationList::iterator srcSuballocIt = pSrcMetadata->m_Suballocations.begin();
+ !end && srcSuballocIt != pSrcMetadata->m_Suballocations.end(); )
+ {
+ VmaAllocation_T* const pAlloc = srcSuballocIt->hAllocation;
+ const VkDeviceSize srcAllocAlignment = pAlloc->GetAlignment();
+ const VkDeviceSize srcAllocSize = srcSuballocIt->size;
+ if(m_AllocationsMoved == maxAllocationsToMove ||
+ m_BytesMoved + srcAllocSize > maxBytesToMove)
+ {
+ end = true;
+ break;
+ }
+ const VkDeviceSize srcAllocOffset = srcSuballocIt->offset;
+
+ // Try to place it in one of free spaces from the database.
+ size_t freeSpaceInfoIndex;
+ VkDeviceSize dstAllocOffset;
+ if(freeSpaceDb.Fetch(srcAllocAlignment, srcAllocSize,
+ freeSpaceInfoIndex, dstAllocOffset))
+ {
+ size_t freeSpaceOrigBlockIndex = m_BlockInfos[freeSpaceInfoIndex].origBlockIndex;
+ VmaDeviceMemoryBlock* pFreeSpaceBlock = m_pBlockVector->GetBlock(freeSpaceOrigBlockIndex);
+ VmaBlockMetadata_Generic* pFreeSpaceMetadata = (VmaBlockMetadata_Generic*)pFreeSpaceBlock->m_pMetadata;
+ /*VkDeviceSize freeSpaceBlockSize = pFreeSpaceMetadata->GetSize();*/
+
+ // Same block
+ if(freeSpaceInfoIndex == srcBlockInfoIndex)
+ {
+ VMA_ASSERT(dstAllocOffset <= srcAllocOffset);
+
+ // MOVE OPTION 1: Move the allocation inside the same block by decreasing offset.
+
+ VmaSuballocation suballoc = *srcSuballocIt;
+ suballoc.offset = dstAllocOffset;
+ suballoc.hAllocation->ChangeOffset(dstAllocOffset);
+ m_BytesMoved += srcAllocSize;
+ ++m_AllocationsMoved;
+
+ VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
+ ++nextSuballocIt;
+ pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
+ srcSuballocIt = nextSuballocIt;
+
+ InsertSuballoc(pFreeSpaceMetadata, suballoc);
+
+ VmaDefragmentationMove move = {
+ srcOrigBlockIndex, freeSpaceOrigBlockIndex,
+ srcAllocOffset, dstAllocOffset,
+ srcAllocSize };
+ moves.push_back(move);
+ }
+ // Different block
+ else
+ {
+ // MOVE OPTION 2: Move the allocation to a different block.
+
+ VMA_ASSERT(freeSpaceInfoIndex < srcBlockInfoIndex);
+
+ VmaSuballocation suballoc = *srcSuballocIt;
+ suballoc.offset = dstAllocOffset;
+ suballoc.hAllocation->ChangeBlockAllocation(m_hAllocator, pFreeSpaceBlock, dstAllocOffset);
+ m_BytesMoved += srcAllocSize;
+ ++m_AllocationsMoved;
+
+ VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
+ ++nextSuballocIt;
+ pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
+ srcSuballocIt = nextSuballocIt;
+
+ InsertSuballoc(pFreeSpaceMetadata, suballoc);
+
+ VmaDefragmentationMove move = {
+ srcOrigBlockIndex, freeSpaceOrigBlockIndex,
+ srcAllocOffset, dstAllocOffset,
+ srcAllocSize };
+ moves.push_back(move);
+ }
+ }
+ else
+ {
+ dstAllocOffset = VmaAlignUp(dstOffset, srcAllocAlignment);
+
+ // If the allocation doesn't fit before the end of dstBlock, forward to next block.
+ while(dstBlockInfoIndex < srcBlockInfoIndex &&
+ dstAllocOffset + srcAllocSize > dstBlockSize)
+ {
+ // But before that, register remaining free space at the end of dst block.
+ freeSpaceDb.Register(dstBlockInfoIndex, dstOffset, dstBlockSize - dstOffset);
+
+ ++dstBlockInfoIndex;
+ dstOrigBlockIndex = m_BlockInfos[dstBlockInfoIndex].origBlockIndex;
+ pDstBlock = m_pBlockVector->GetBlock(dstOrigBlockIndex);
+ pDstMetadata = (VmaBlockMetadata_Generic*)pDstBlock->m_pMetadata;
+ dstBlockSize = pDstMetadata->GetSize();
+ dstOffset = 0;
+ dstAllocOffset = 0;
+ }
+
+ // Same block
+ if(dstBlockInfoIndex == srcBlockInfoIndex)
+ {
+ VMA_ASSERT(dstAllocOffset <= srcAllocOffset);
+
+ const bool overlap = dstAllocOffset + srcAllocSize > srcAllocOffset;
+
+ bool skipOver = overlap;
+ if(overlap && m_OverlappingMoveSupported && dstAllocOffset < srcAllocOffset)
+ {
+ // If destination and source place overlap, skip if it would move it
+ // by only < 1/64 of its size.
+ skipOver = (srcAllocOffset - dstAllocOffset) * 64 < srcAllocSize;
+ }
+
+ if(skipOver)
+ {
+ freeSpaceDb.Register(dstBlockInfoIndex, dstOffset, srcAllocOffset - dstOffset);
+
+ dstOffset = srcAllocOffset + srcAllocSize;
+ ++srcSuballocIt;
+ }
+ // MOVE OPTION 1: Move the allocation inside the same block by decreasing offset.
+ else
+ {
+ srcSuballocIt->offset = dstAllocOffset;
+ srcSuballocIt->hAllocation->ChangeOffset(dstAllocOffset);
+ dstOffset = dstAllocOffset + srcAllocSize;
+ m_BytesMoved += srcAllocSize;
+ ++m_AllocationsMoved;
+ ++srcSuballocIt;
+ VmaDefragmentationMove move = {
+ srcOrigBlockIndex, dstOrigBlockIndex,
+ srcAllocOffset, dstAllocOffset,
+ srcAllocSize };
+ moves.push_back(move);
+ }
+ }
+ // Different block
+ else
+ {
+ // MOVE OPTION 2: Move the allocation to a different block.
+
+ VMA_ASSERT(dstBlockInfoIndex < srcBlockInfoIndex);
+ VMA_ASSERT(dstAllocOffset + srcAllocSize <= dstBlockSize);
+
+ VmaSuballocation suballoc = *srcSuballocIt;
+ suballoc.offset = dstAllocOffset;
+ suballoc.hAllocation->ChangeBlockAllocation(m_hAllocator, pDstBlock, dstAllocOffset);
+ dstOffset = dstAllocOffset + srcAllocSize;
+ m_BytesMoved += srcAllocSize;
+ ++m_AllocationsMoved;
+
+ VmaSuballocationList::iterator nextSuballocIt = srcSuballocIt;
+ ++nextSuballocIt;
+ pSrcMetadata->m_Suballocations.erase(srcSuballocIt);
+ srcSuballocIt = nextSuballocIt;
+
+ pDstMetadata->m_Suballocations.push_back(suballoc);
+
+ VmaDefragmentationMove move = {
+ srcOrigBlockIndex, dstOrigBlockIndex,
+ srcAllocOffset, dstAllocOffset,
+ srcAllocSize };
+ moves.push_back(move);
+ }
+ }
+ }
+ }
+
+ m_BlockInfos.clear();
+
+ PostprocessMetadata();
+
+ return VK_SUCCESS;
+}
+
+void VmaDefragmentationAlgorithm_Fast::PreprocessMetadata()
+{
+ const size_t blockCount = m_pBlockVector->GetBlockCount();
+ for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+ {
+ VmaBlockMetadata_Generic* const pMetadata =
+ (VmaBlockMetadata_Generic*)m_pBlockVector->GetBlock(blockIndex)->m_pMetadata;
+ pMetadata->m_FreeCount = 0;
+ pMetadata->m_SumFreeSize = pMetadata->GetSize();
+ pMetadata->m_FreeSuballocationsBySize.clear();
+ for(VmaSuballocationList::iterator it = pMetadata->m_Suballocations.begin();
+ it != pMetadata->m_Suballocations.end(); )
+ {
+ if(it->type == VMA_SUBALLOCATION_TYPE_FREE)
+ {
+ VmaSuballocationList::iterator nextIt = it;
+ ++nextIt;
+ pMetadata->m_Suballocations.erase(it);
+ it = nextIt;
+ }
+ else
+ {
+ ++it;
+ }
+ }
+ }
+}
+
+void VmaDefragmentationAlgorithm_Fast::PostprocessMetadata()
+{
+ const size_t blockCount = m_pBlockVector->GetBlockCount();
+ for(size_t blockIndex = 0; blockIndex < blockCount; ++blockIndex)
+ {
+ VmaBlockMetadata_Generic* const pMetadata =
+ (VmaBlockMetadata_Generic*)m_pBlockVector->GetBlock(blockIndex)->m_pMetadata;
+ const VkDeviceSize blockSize = pMetadata->GetSize();
+
+ // No allocations in this block - entire area is free.
+ if(pMetadata->m_Suballocations.empty())
+ {
+ pMetadata->m_FreeCount = 1;
+ //pMetadata->m_SumFreeSize is already set to blockSize.
+ VmaSuballocation suballoc = {
+ 0, // offset
+ blockSize, // size
+ VMA_NULL, // hAllocation
+ VMA_SUBALLOCATION_TYPE_FREE };
+ pMetadata->m_Suballocations.push_back(suballoc);
+ pMetadata->RegisterFreeSuballocation(pMetadata->m_Suballocations.begin());
+ }
+ // There are some allocations in this block.
+ else
+ {
+ VkDeviceSize offset = 0;
+ VmaSuballocationList::iterator it;
+ for(it = pMetadata->m_Suballocations.begin();
+ it != pMetadata->m_Suballocations.end();
+ ++it)
+ {
+ VMA_ASSERT(it->type != VMA_SUBALLOCATION_TYPE_FREE);
+ VMA_ASSERT(it->offset >= offset);
+
+ // Need to insert preceding free space.
+ if(it->offset > offset)
+ {
+ ++pMetadata->m_FreeCount;
+ const VkDeviceSize freeSize = it->offset - offset;
+ VmaSuballocation suballoc = {
+ offset, // offset
+ freeSize, // size
+ VMA_NULL, // hAllocation
+ VMA_SUBALLOCATION_TYPE_FREE };
+ VmaSuballocationList::iterator precedingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc);
+ if(freeSize >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ pMetadata->m_FreeSuballocationsBySize.push_back(precedingFreeIt);
+ }
+ }
+
+ pMetadata->m_SumFreeSize -= it->size;
+ offset = it->offset + it->size;
+ }
+
+ // Need to insert trailing free space.
+ if(offset < blockSize)
+ {
+ ++pMetadata->m_FreeCount;
+ const VkDeviceSize freeSize = blockSize - offset;
+ VmaSuballocation suballoc = {
+ offset, // offset
+ freeSize, // size
+ VMA_NULL, // hAllocation
+ VMA_SUBALLOCATION_TYPE_FREE };
+ VMA_ASSERT(it == pMetadata->m_Suballocations.end());
+ VmaSuballocationList::iterator trailingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc);
+ if(freeSize > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER)
+ {
+ pMetadata->m_FreeSuballocationsBySize.push_back(trailingFreeIt);
+ }
+ }
+
+ VMA_SORT(
+ pMetadata->m_FreeSuballocationsBySize.begin(),
+ pMetadata->m_FreeSuballocationsBySize.end(),
+ VmaSuballocationItemSizeLess());
+ }
+
+ VMA_HEAVY_ASSERT(pMetadata->Validate());
+ }
+}
+
+void VmaDefragmentationAlgorithm_Fast::InsertSuballoc(VmaBlockMetadata_Generic* pMetadata, const VmaSuballocation& suballoc)
+{
+ // TODO: Optimize somehow. Remember iterator instead of searching for it linearly.
+ VmaSuballocationList::iterator it = pMetadata->m_Suballocations.begin();
+ while(it != pMetadata->m_Suballocations.end())
+ {
+ if(it->offset < suballoc.offset)
+ {
+ ++it;
+ }
+ }
+ pMetadata->m_Suballocations.insert(it, suballoc);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaBlockVectorDefragmentationContext
+
+VmaBlockVectorDefragmentationContext::VmaBlockVectorDefragmentationContext(
+ VmaAllocator hAllocator,
+ VmaPool hCustomPool,
+ VmaBlockVector* pBlockVector,
+ uint32_t currFrameIndex,
+ uint32_t /*algorithmFlags*/) :
+ res(VK_SUCCESS),
+ mutexLocked(false),
+ blockContexts(VmaStlAllocator<VmaBlockDefragmentationContext>(hAllocator->GetAllocationCallbacks())),
+ m_hAllocator(hAllocator),
+ m_hCustomPool(hCustomPool),
+ m_pBlockVector(pBlockVector),
+ m_CurrFrameIndex(currFrameIndex),
+ /*m_AlgorithmFlags(algorithmFlags),*/
+ m_pAlgorithm(VMA_NULL),
+ m_Allocations(VmaStlAllocator<AllocInfo>(hAllocator->GetAllocationCallbacks())),
+ m_AllAllocations(false)
+{
+}
+
+VmaBlockVectorDefragmentationContext::~VmaBlockVectorDefragmentationContext()
+{
+ vma_delete(m_hAllocator, m_pAlgorithm);
+}
+
+void VmaBlockVectorDefragmentationContext::AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged)
+{
+ AllocInfo info = { hAlloc, pChanged };
+ m_Allocations.push_back(info);
+}
+
+void VmaBlockVectorDefragmentationContext::Begin(bool overlappingMoveSupported)
+{
+ const bool allAllocations = m_AllAllocations ||
+ m_Allocations.size() == m_pBlockVector->CalcAllocationCount();
+
+ /********************************
+ HERE IS THE CHOICE OF DEFRAGMENTATION ALGORITHM.
+ ********************************/
+
+ /*
+ Fast algorithm is supported only when certain criteria are met:
+ - VMA_DEBUG_MARGIN is 0.
+ - All allocations in this block vector are moveable.
+ - There is no possibility of image/buffer granularity conflict.
+ */
+ if(VMA_DEBUG_MARGIN == 0 &&
+ allAllocations &&
+ !m_pBlockVector->IsBufferImageGranularityConflictPossible())
+ {
+ m_pAlgorithm = vma_new(m_hAllocator, VmaDefragmentationAlgorithm_Fast)(
+ m_hAllocator, m_pBlockVector, m_CurrFrameIndex, overlappingMoveSupported);
+ }
+ else
+ {
+ m_pAlgorithm = vma_new(m_hAllocator, VmaDefragmentationAlgorithm_Generic)(
+ m_hAllocator, m_pBlockVector, m_CurrFrameIndex, overlappingMoveSupported);
+ }
+
+ if(allAllocations)
+ {
+ m_pAlgorithm->AddAll();
+ }
+ else
+ {
+ for(size_t i = 0, count = m_Allocations.size(); i < count; ++i)
+ {
+ m_pAlgorithm->AddAllocation(m_Allocations[i].hAlloc, m_Allocations[i].pChanged);
+ }
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaDefragmentationContext
+
+VmaDefragmentationContext_T::VmaDefragmentationContext_T(
+ VmaAllocator hAllocator,
+ uint32_t currFrameIndex,
+ uint32_t flags,
+ VmaDefragmentationStats* pStats) :
+ m_hAllocator(hAllocator),
+ m_CurrFrameIndex(currFrameIndex),
+ m_Flags(flags),
+ m_pStats(pStats),
+ m_CustomPoolContexts(VmaStlAllocator<VmaBlockVectorDefragmentationContext*>(hAllocator->GetAllocationCallbacks()))
+{
+ memset(m_DefaultPoolContexts, 0, sizeof(m_DefaultPoolContexts));
+}
+
+VmaDefragmentationContext_T::~VmaDefragmentationContext_T()
+{
+ for(size_t i = m_CustomPoolContexts.size(); i--; )
+ {
+ VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_CustomPoolContexts[i];
+ pBlockVectorCtx->GetBlockVector()->DefragmentationEnd(pBlockVectorCtx, m_pStats);
+ vma_delete(m_hAllocator, pBlockVectorCtx);
+ }
+ for(size_t i = m_hAllocator->m_MemProps.memoryTypeCount; i--; )
+ {
+ VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_DefaultPoolContexts[i];
+ if(pBlockVectorCtx)
+ {
+ pBlockVectorCtx->GetBlockVector()->DefragmentationEnd(pBlockVectorCtx, m_pStats);
+ vma_delete(m_hAllocator, pBlockVectorCtx);
+ }
+ }
+}
+
+void VmaDefragmentationContext_T::AddPools(uint32_t poolCount, VmaPool* pPools)
+{
+ for(uint32_t poolIndex = 0; poolIndex < poolCount; ++poolIndex)
+ {
+ VmaPool pool = pPools[poolIndex];
+ VMA_ASSERT(pool);
+ // Pools with algorithm other than default are not defragmented.
+ if(pool->m_BlockVector.GetAlgorithm() == 0)
+ {
+ VmaBlockVectorDefragmentationContext* pBlockVectorDefragCtx = VMA_NULL;
+
+ for(size_t i = m_CustomPoolContexts.size(); i--; )
+ {
+ if(m_CustomPoolContexts[i]->GetCustomPool() == pool)
+ {
+ pBlockVectorDefragCtx = m_CustomPoolContexts[i];
+ break;
+ }
+ }
+
+ if(!pBlockVectorDefragCtx)
+ {
+ pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
+ m_hAllocator,
+ pool,
+ &pool->m_BlockVector,
+ m_CurrFrameIndex,
+ m_Flags);
+ m_CustomPoolContexts.push_back(pBlockVectorDefragCtx);
+ }
+
+ pBlockVectorDefragCtx->AddAll();
+ }
+ }
+}
+
+void VmaDefragmentationContext_T::AddAllocations(
+ uint32_t allocationCount,
+ VmaAllocation* pAllocations,
+ VkBool32* pAllocationsChanged)
+{
+ // Dispatch pAllocations among defragmentators. Create them when necessary.
+ for(uint32_t allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+ {
+ const VmaAllocation hAlloc = pAllocations[allocIndex];
+ VMA_ASSERT(hAlloc);
+ // DedicatedAlloc cannot be defragmented.
+ if((hAlloc->GetType() == VmaAllocation_T::ALLOCATION_TYPE_BLOCK) &&
+ // Lost allocation cannot be defragmented.
+ (hAlloc->GetLastUseFrameIndex() != VMA_FRAME_INDEX_LOST))
+ {
+ VmaBlockVectorDefragmentationContext* pBlockVectorDefragCtx = VMA_NULL;
+
+ const VmaPool hAllocPool = hAlloc->GetPool();
+ // This allocation belongs to custom pool.
+ if(hAllocPool != VK_NULL_HANDLE)
+ {
+ // Pools with algorithm other than default are not defragmented.
+ if(hAllocPool->m_BlockVector.GetAlgorithm() == 0)
+ {
+ for(size_t i = m_CustomPoolContexts.size(); i--; )
+ {
+ if(m_CustomPoolContexts[i]->GetCustomPool() == hAllocPool)
+ {
+ pBlockVectorDefragCtx = m_CustomPoolContexts[i];
+ break;
+ }
+ }
+ if(!pBlockVectorDefragCtx)
+ {
+ pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
+ m_hAllocator,
+ hAllocPool,
+ &hAllocPool->m_BlockVector,
+ m_CurrFrameIndex,
+ m_Flags);
+ m_CustomPoolContexts.push_back(pBlockVectorDefragCtx);
+ }
+ }
+ }
+ // This allocation belongs to default pool.
+ else
+ {
+ const uint32_t memTypeIndex = hAlloc->GetMemoryTypeIndex();
+ pBlockVectorDefragCtx = m_DefaultPoolContexts[memTypeIndex];
+ if(!pBlockVectorDefragCtx)
+ {
+ pBlockVectorDefragCtx = vma_new(m_hAllocator, VmaBlockVectorDefragmentationContext)(
+ m_hAllocator,
+ VMA_NULL, // hCustomPool
+ m_hAllocator->m_pBlockVectors[memTypeIndex],
+ m_CurrFrameIndex,
+ m_Flags);
+ m_DefaultPoolContexts[memTypeIndex] = pBlockVectorDefragCtx;
+ }
+ }
+
+ if(pBlockVectorDefragCtx)
+ {
+ VkBool32* const pChanged = (pAllocationsChanged != VMA_NULL) ?
+ &pAllocationsChanged[allocIndex] : VMA_NULL;
+ pBlockVectorDefragCtx->AddAllocation(hAlloc, pChanged);
+ }
+ }
+ }
+}
+
+VkResult VmaDefragmentationContext_T::Defragment(
+ VkDeviceSize maxCpuBytesToMove, uint32_t maxCpuAllocationsToMove,
+ VkDeviceSize maxGpuBytesToMove, uint32_t maxGpuAllocationsToMove,
+ VkCommandBuffer commandBuffer, VmaDefragmentationStats* pStats)
+{
+ if(pStats)
+ {
+ memset(pStats, 0, sizeof(VmaDefragmentationStats));
+ }
+
+ if(commandBuffer == VK_NULL_HANDLE)
+ {
+ maxGpuBytesToMove = 0;
+ maxGpuAllocationsToMove = 0;
+ }
+
+ VkResult res = VK_SUCCESS;
+
+ // Process default pools.
+ for(uint32_t memTypeIndex = 0;
+ memTypeIndex < m_hAllocator->GetMemoryTypeCount() && res >= VK_SUCCESS;
+ ++memTypeIndex)
+ {
+ VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_DefaultPoolContexts[memTypeIndex];
+ if(pBlockVectorCtx)
+ {
+ VMA_ASSERT(pBlockVectorCtx->GetBlockVector());
+ pBlockVectorCtx->GetBlockVector()->Defragment(
+ pBlockVectorCtx,
+ pStats,
+ maxCpuBytesToMove, maxCpuAllocationsToMove,
+ maxGpuBytesToMove, maxGpuAllocationsToMove,
+ commandBuffer);
+ if(pBlockVectorCtx->res != VK_SUCCESS)
+ {
+ res = pBlockVectorCtx->res;
+ }
+ }
+ }
+
+ // Process custom pools.
+ for(size_t customCtxIndex = 0, customCtxCount = m_CustomPoolContexts.size();
+ customCtxIndex < customCtxCount && res >= VK_SUCCESS;
+ ++customCtxIndex)
+ {
+ VmaBlockVectorDefragmentationContext* pBlockVectorCtx = m_CustomPoolContexts[customCtxIndex];
+ VMA_ASSERT(pBlockVectorCtx && pBlockVectorCtx->GetBlockVector());
+ pBlockVectorCtx->GetBlockVector()->Defragment(
+ pBlockVectorCtx,
+ pStats,
+ maxCpuBytesToMove, maxCpuAllocationsToMove,
+ maxGpuBytesToMove, maxGpuAllocationsToMove,
+ commandBuffer);
+ if(pBlockVectorCtx->res != VK_SUCCESS)
+ {
+ res = pBlockVectorCtx->res;
+ }
+ }
+
+ return res;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaRecorder
+
+#if VMA_RECORDING_ENABLED
+
+VmaRecorder::VmaRecorder() :
+ m_UseMutex(true),
+ m_Flags(0),
+ m_File(VMA_NULL),
+ m_Freq(INT64_MAX),
+ m_StartCounter(INT64_MAX)
+{
+}
+
+VkResult VmaRecorder::Init(const VmaRecordSettings& settings, bool useMutex)
+{
+ m_UseMutex = useMutex;
+ m_Flags = settings.flags;
+
+ QueryPerformanceFrequency((LARGE_INTEGER*)&m_Freq);
+ QueryPerformanceCounter((LARGE_INTEGER*)&m_StartCounter);
+
+ // Open file for writing.
+ errno_t err = fopen_s(&m_File, settings.pFilePath, "wb");
+ if(err != 0)
+ {
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ // Write header.
+ fprintf(m_File, "%s\n", "Vulkan Memory Allocator,Calls recording");
+ fprintf(m_File, "%s\n", "1,5");
+
+ return VK_SUCCESS;
+}
+
+VmaRecorder::~VmaRecorder()
+{
+ if(m_File != VMA_NULL)
+ {
+ fclose(m_File);
+ }
+}
+
+void VmaRecorder::RecordCreateAllocator(uint32_t frameIndex)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaCreateAllocator\n", callParams.threadId, callParams.time, frameIndex);
+ Flush();
+}
+
+void VmaRecorder::RecordDestroyAllocator(uint32_t frameIndex)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaDestroyAllocator\n", callParams.threadId, callParams.time, frameIndex);
+ Flush();
+}
+
+void VmaRecorder::RecordCreatePool(uint32_t frameIndex, const VmaPoolCreateInfo& createInfo, VmaPool pool)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaCreatePool,%u,%u,%llu,%llu,%llu,%u,%p\n", callParams.threadId, callParams.time, frameIndex,
+ createInfo.memoryTypeIndex,
+ createInfo.flags,
+ createInfo.blockSize,
+ (uint64_t)createInfo.minBlockCount,
+ (uint64_t)createInfo.maxBlockCount,
+ createInfo.frameInUseCount,
+ pool);
+ Flush();
+}
+
+void VmaRecorder::RecordDestroyPool(uint32_t frameIndex, VmaPool pool)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaDestroyPool,%p\n", callParams.threadId, callParams.time, frameIndex,
+ pool);
+ Flush();
+}
+
+void VmaRecorder::RecordAllocateMemory(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(createInfo.flags, createInfo.pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemory,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+ vkMemReq.size,
+ vkMemReq.alignment,
+ vkMemReq.memoryTypeBits,
+ createInfo.flags,
+ createInfo.usage,
+ createInfo.requiredFlags,
+ createInfo.preferredFlags,
+ createInfo.memoryTypeBits,
+ createInfo.pool,
+ allocation,
+ userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordAllocateMemoryPages(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ const VmaAllocationCreateInfo& createInfo,
+ uint64_t allocationCount,
+ const VmaAllocation* pAllocations)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(createInfo.flags, createInfo.pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemoryPages,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,", callParams.threadId, callParams.time, frameIndex,
+ vkMemReq.size,
+ vkMemReq.alignment,
+ vkMemReq.memoryTypeBits,
+ createInfo.flags,
+ createInfo.usage,
+ createInfo.requiredFlags,
+ createInfo.preferredFlags,
+ createInfo.memoryTypeBits,
+ createInfo.pool);
+ PrintPointerList(allocationCount, pAllocations);
+ fprintf(m_File, ",%s\n", userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordAllocateMemoryForBuffer(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ bool requiresDedicatedAllocation,
+ bool prefersDedicatedAllocation,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(createInfo.flags, createInfo.pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemoryForBuffer,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+ vkMemReq.size,
+ vkMemReq.alignment,
+ vkMemReq.memoryTypeBits,
+ requiresDedicatedAllocation ? 1 : 0,
+ prefersDedicatedAllocation ? 1 : 0,
+ createInfo.flags,
+ createInfo.usage,
+ createInfo.requiredFlags,
+ createInfo.preferredFlags,
+ createInfo.memoryTypeBits,
+ createInfo.pool,
+ allocation,
+ userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordAllocateMemoryForImage(uint32_t frameIndex,
+ const VkMemoryRequirements& vkMemReq,
+ bool requiresDedicatedAllocation,
+ bool prefersDedicatedAllocation,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(createInfo.flags, createInfo.pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemoryForImage,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+ vkMemReq.size,
+ vkMemReq.alignment,
+ vkMemReq.memoryTypeBits,
+ requiresDedicatedAllocation ? 1 : 0,
+ prefersDedicatedAllocation ? 1 : 0,
+ createInfo.flags,
+ createInfo.usage,
+ createInfo.requiredFlags,
+ createInfo.preferredFlags,
+ createInfo.memoryTypeBits,
+ createInfo.pool,
+ allocation,
+ userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordFreeMemory(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaFreeMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordFreeMemoryPages(uint32_t frameIndex,
+ uint64_t allocationCount,
+ const VmaAllocation* pAllocations)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaFreeMemoryPages,", callParams.threadId, callParams.time, frameIndex);
+ PrintPointerList(allocationCount, pAllocations);
+ fprintf(m_File, "\n");
+ Flush();
+}
+
+void VmaRecorder::RecordResizeAllocation(
+ uint32_t frameIndex,
+ VmaAllocation allocation,
+ VkDeviceSize newSize)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaResizeAllocation,%p,%llu\n", callParams.threadId, callParams.time, frameIndex,
+ allocation, newSize);
+ Flush();
+}
+
+void VmaRecorder::RecordSetAllocationUserData(uint32_t frameIndex,
+ VmaAllocation allocation,
+ const void* pUserData)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(
+ allocation->IsUserDataString() ? VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT : 0,
+ pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaSetAllocationUserData,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+ allocation,
+ userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordCreateLostAllocation(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaCreateLostAllocation,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordMapMemory(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaMapMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordUnmapMemory(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaUnmapMemory,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordFlushAllocation(uint32_t frameIndex,
+ VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaFlushAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex,
+ allocation,
+ offset,
+ size);
+ Flush();
+}
+
+void VmaRecorder::RecordInvalidateAllocation(uint32_t frameIndex,
+ VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaInvalidateAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex,
+ allocation,
+ offset,
+ size);
+ Flush();
+}
+
+void VmaRecorder::RecordCreateBuffer(uint32_t frameIndex,
+ const VkBufferCreateInfo& bufCreateInfo,
+ const VmaAllocationCreateInfo& allocCreateInfo,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(allocCreateInfo.flags, allocCreateInfo.pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaCreateBuffer,%u,%llu,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+ bufCreateInfo.flags,
+ bufCreateInfo.size,
+ bufCreateInfo.usage,
+ bufCreateInfo.sharingMode,
+ allocCreateInfo.flags,
+ allocCreateInfo.usage,
+ allocCreateInfo.requiredFlags,
+ allocCreateInfo.preferredFlags,
+ allocCreateInfo.memoryTypeBits,
+ allocCreateInfo.pool,
+ allocation,
+ userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordCreateImage(uint32_t frameIndex,
+ const VkImageCreateInfo& imageCreateInfo,
+ const VmaAllocationCreateInfo& allocCreateInfo,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ UserDataString userDataStr(allocCreateInfo.flags, allocCreateInfo.pUserData);
+ fprintf(m_File, "%u,%.3f,%u,vmaCreateImage,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex,
+ imageCreateInfo.flags,
+ imageCreateInfo.imageType,
+ imageCreateInfo.format,
+ imageCreateInfo.extent.width,
+ imageCreateInfo.extent.height,
+ imageCreateInfo.extent.depth,
+ imageCreateInfo.mipLevels,
+ imageCreateInfo.arrayLayers,
+ imageCreateInfo.samples,
+ imageCreateInfo.tiling,
+ imageCreateInfo.usage,
+ imageCreateInfo.sharingMode,
+ imageCreateInfo.initialLayout,
+ allocCreateInfo.flags,
+ allocCreateInfo.usage,
+ allocCreateInfo.requiredFlags,
+ allocCreateInfo.preferredFlags,
+ allocCreateInfo.memoryTypeBits,
+ allocCreateInfo.pool,
+ allocation,
+ userDataStr.GetString());
+ Flush();
+}
+
+void VmaRecorder::RecordDestroyBuffer(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaDestroyBuffer,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordDestroyImage(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaDestroyImage,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordTouchAllocation(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaTouchAllocation,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordGetAllocationInfo(uint32_t frameIndex,
+ VmaAllocation allocation)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaGetAllocationInfo,%p\n", callParams.threadId, callParams.time, frameIndex,
+ allocation);
+ Flush();
+}
+
+void VmaRecorder::RecordMakePoolAllocationsLost(uint32_t frameIndex,
+ VmaPool pool)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaMakePoolAllocationsLost,%p\n", callParams.threadId, callParams.time, frameIndex,
+ pool);
+ Flush();
+}
+
+void VmaRecorder::RecordDefragmentationBegin(uint32_t frameIndex,
+ const VmaDefragmentationInfo2& info,
+ VmaDefragmentationContext ctx)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaDefragmentationBegin,%u,", callParams.threadId, callParams.time, frameIndex,
+ info.flags);
+ PrintPointerList(info.allocationCount, info.pAllocations);
+ fprintf(m_File, ",");
+ PrintPointerList(info.poolCount, info.pPools);
+ fprintf(m_File, ",%llu,%u,%llu,%u,%p,%p\n",
+ info.maxCpuBytesToMove,
+ info.maxCpuAllocationsToMove,
+ info.maxGpuBytesToMove,
+ info.maxGpuAllocationsToMove,
+ info.commandBuffer,
+ ctx);
+ Flush();
+}
+
+void VmaRecorder::RecordDefragmentationEnd(uint32_t frameIndex,
+ VmaDefragmentationContext ctx)
+{
+ CallParams callParams;
+ GetBasicParams(callParams);
+
+ VmaMutexLock lock(m_FileMutex, m_UseMutex);
+ fprintf(m_File, "%u,%.3f,%u,vmaDefragmentationEnd,%p\n", callParams.threadId, callParams.time, frameIndex,
+ ctx);
+ Flush();
+}
+
+VmaRecorder::UserDataString::UserDataString(VmaAllocationCreateFlags allocFlags, const void* pUserData)
+{
+ if(pUserData != VMA_NULL)
+ {
+ if((allocFlags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0)
+ {
+ m_Str = (const char*)pUserData;
+ }
+ else
+ {
+ sprintf_s(m_PtrStr, "%p", pUserData);
+ m_Str = m_PtrStr;
+ }
+ }
+ else
+ {
+ m_Str = "";
+ }
+}
+
+void VmaRecorder::WriteConfiguration(
+ const VkPhysicalDeviceProperties& devProps,
+ const VkPhysicalDeviceMemoryProperties& memProps,
+ bool dedicatedAllocationExtensionEnabled)
+{
+ fprintf(m_File, "Config,Begin\n");
+
+ fprintf(m_File, "PhysicalDevice,apiVersion,%u\n", devProps.apiVersion);
+ fprintf(m_File, "PhysicalDevice,driverVersion,%u\n", devProps.driverVersion);
+ fprintf(m_File, "PhysicalDevice,vendorID,%u\n", devProps.vendorID);
+ fprintf(m_File, "PhysicalDevice,deviceID,%u\n", devProps.deviceID);
+ fprintf(m_File, "PhysicalDevice,deviceType,%u\n", devProps.deviceType);
+ fprintf(m_File, "PhysicalDevice,deviceName,%s\n", devProps.deviceName);
+
+ fprintf(m_File, "PhysicalDeviceLimits,maxMemoryAllocationCount,%u\n", devProps.limits.maxMemoryAllocationCount);
+ fprintf(m_File, "PhysicalDeviceLimits,bufferImageGranularity,%llu\n", devProps.limits.bufferImageGranularity);
+ fprintf(m_File, "PhysicalDeviceLimits,nonCoherentAtomSize,%llu\n", devProps.limits.nonCoherentAtomSize);
+
+ fprintf(m_File, "PhysicalDeviceMemory,HeapCount,%u\n", memProps.memoryHeapCount);
+ for(uint32_t i = 0; i < memProps.memoryHeapCount; ++i)
+ {
+ fprintf(m_File, "PhysicalDeviceMemory,Heap,%u,size,%llu\n", i, memProps.memoryHeaps[i].size);
+ fprintf(m_File, "PhysicalDeviceMemory,Heap,%u,flags,%u\n", i, memProps.memoryHeaps[i].flags);
+ }
+ fprintf(m_File, "PhysicalDeviceMemory,TypeCount,%u\n", memProps.memoryTypeCount);
+ for(uint32_t i = 0; i < memProps.memoryTypeCount; ++i)
+ {
+ fprintf(m_File, "PhysicalDeviceMemory,Type,%u,heapIndex,%u\n", i, memProps.memoryTypes[i].heapIndex);
+ fprintf(m_File, "PhysicalDeviceMemory,Type,%u,propertyFlags,%u\n", i, memProps.memoryTypes[i].propertyFlags);
+ }
+
+ fprintf(m_File, "Extension,VK_KHR_dedicated_allocation,%u\n", dedicatedAllocationExtensionEnabled ? 1 : 0);
+
+ fprintf(m_File, "Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,%u\n", VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ? 1 : 0);
+ fprintf(m_File, "Macro,VMA_DEBUG_ALIGNMENT,%llu\n", (VkDeviceSize)VMA_DEBUG_ALIGNMENT);
+ fprintf(m_File, "Macro,VMA_DEBUG_MARGIN,%llu\n", (VkDeviceSize)VMA_DEBUG_MARGIN);
+ fprintf(m_File, "Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,%u\n", VMA_DEBUG_INITIALIZE_ALLOCATIONS ? 1 : 0);
+ fprintf(m_File, "Macro,VMA_DEBUG_DETECT_CORRUPTION,%u\n", VMA_DEBUG_DETECT_CORRUPTION ? 1 : 0);
+ fprintf(m_File, "Macro,VMA_DEBUG_GLOBAL_MUTEX,%u\n", VMA_DEBUG_GLOBAL_MUTEX ? 1 : 0);
+ fprintf(m_File, "Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,%llu\n", (VkDeviceSize)VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY);
+ fprintf(m_File, "Macro,VMA_SMALL_HEAP_MAX_SIZE,%llu\n", (VkDeviceSize)VMA_SMALL_HEAP_MAX_SIZE);
+ fprintf(m_File, "Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,%llu\n", (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE);
+
+ fprintf(m_File, "Config,End\n");
+}
+
+void VmaRecorder::GetBasicParams(CallParams& outParams)
+{
+ outParams.threadId = GetCurrentThreadId();
+
+ LARGE_INTEGER counter;
+ QueryPerformanceCounter(&counter);
+ outParams.time = (double)(counter.QuadPart - m_StartCounter) / (double)m_Freq;
+}
+
+void VmaRecorder::PrintPointerList(uint64_t count, const VmaAllocation* pItems)
+{
+ if(count)
+ {
+ fprintf(m_File, "%p", pItems[0]);
+ for(uint64_t i = 1; i < count; ++i)
+ {
+ fprintf(m_File, " %p", pItems[i]);
+ }
+ }
+}
+
+void VmaRecorder::Flush()
+{
+ if((m_Flags & VMA_RECORD_FLUSH_AFTER_CALL_BIT) != 0)
+ {
+ fflush(m_File);
+ }
+}
+
+#endif // #if VMA_RECORDING_ENABLED
+
+////////////////////////////////////////////////////////////////////////////////
+// VmaAllocator_T
+
+VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) :
+ m_UseMutex((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT) == 0),
+ m_UseKhrDedicatedAllocation((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT) != 0),
+ m_hDevice(pCreateInfo->device),
+ m_AllocationCallbacksSpecified(pCreateInfo->pAllocationCallbacks != VMA_NULL),
+ m_AllocationCallbacks(pCreateInfo->pAllocationCallbacks ?
+ *pCreateInfo->pAllocationCallbacks : VmaEmptyAllocationCallbacks),
+ m_PreferredLargeHeapBlockSize(0),
+ m_PhysicalDevice(pCreateInfo->physicalDevice),
+ m_CurrentFrameIndex(0),
+ m_Pools(VmaStlAllocator<VmaPool>(GetAllocationCallbacks())),
+ m_NextPoolId(0)
+#if VMA_RECORDING_ENABLED
+ ,m_pRecorder(VMA_NULL)
+#endif
+{
+ if(VMA_DEBUG_DETECT_CORRUPTION)
+ {
+ // Needs to be multiply of uint32_t size because we are going to write VMA_CORRUPTION_DETECTION_MAGIC_VALUE to it.
+ VMA_ASSERT(VMA_DEBUG_MARGIN % sizeof(uint32_t) == 0);
+ }
+
+ VMA_ASSERT(pCreateInfo->physicalDevice && pCreateInfo->device);
+
+#if !(VMA_DEDICATED_ALLOCATION)
+ if((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT) != 0)
+ {
+ VMA_ASSERT(0 && "VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT set but required extensions are disabled by preprocessor macros.");
+ }
+#endif
+
+ memset(&m_DeviceMemoryCallbacks, 0 ,sizeof(m_DeviceMemoryCallbacks));
+ memset(&m_PhysicalDeviceProperties, 0, sizeof(m_PhysicalDeviceProperties));
+ memset(&m_MemProps, 0, sizeof(m_MemProps));
+
+ memset(&m_pBlockVectors, 0, sizeof(m_pBlockVectors));
+ memset(&m_pDedicatedAllocations, 0, sizeof(m_pDedicatedAllocations));
+
+ for(uint32_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i)
+ {
+ m_HeapSizeLimit[i] = VK_WHOLE_SIZE;
+ }
+
+ if(pCreateInfo->pDeviceMemoryCallbacks != VMA_NULL)
+ {
+ m_DeviceMemoryCallbacks.pfnAllocate = pCreateInfo->pDeviceMemoryCallbacks->pfnAllocate;
+ m_DeviceMemoryCallbacks.pfnFree = pCreateInfo->pDeviceMemoryCallbacks->pfnFree;
+ }
+
+ ImportVulkanFunctions(pCreateInfo->pVulkanFunctions);
+
+ (*m_VulkanFunctions.vkGetPhysicalDeviceProperties)(m_PhysicalDevice, &m_PhysicalDeviceProperties);
+ (*m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties)(m_PhysicalDevice, &m_MemProps);
+
+ VMA_ASSERT(VmaIsPow2(VMA_DEBUG_ALIGNMENT));
+ VMA_ASSERT(VmaIsPow2(VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY));
+ VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.bufferImageGranularity));
+ VMA_ASSERT(VmaIsPow2(m_PhysicalDeviceProperties.limits.nonCoherentAtomSize));
+
+ m_PreferredLargeHeapBlockSize = (pCreateInfo->preferredLargeHeapBlockSize != 0) ?
+ pCreateInfo->preferredLargeHeapBlockSize : static_cast<VkDeviceSize>(VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE);
+
+ if(pCreateInfo->pHeapSizeLimit != VMA_NULL)
+ {
+ for(uint32_t heapIndex = 0; heapIndex < GetMemoryHeapCount(); ++heapIndex)
+ {
+ const VkDeviceSize limit = pCreateInfo->pHeapSizeLimit[heapIndex];
+ if(limit != VK_WHOLE_SIZE)
+ {
+ m_HeapSizeLimit[heapIndex] = limit;
+ if(limit < m_MemProps.memoryHeaps[heapIndex].size)
+ {
+ m_MemProps.memoryHeaps[heapIndex].size = limit;
+ }
+ }
+ }
+ }
+
+ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+ {
+ const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(memTypeIndex);
+
+ m_pBlockVectors[memTypeIndex] = vma_new(this, VmaBlockVector)(
+ this,
+ memTypeIndex,
+ preferredBlockSize,
+ 0,
+ SIZE_MAX,
+ GetBufferImageGranularity(),
+ pCreateInfo->frameInUseCount,
+ false, // isCustomPool
+ false, // explicitBlockSize
+ false); // linearAlgorithm
+ // No need to call m_pBlockVectors[memTypeIndex][blockVectorTypeIndex]->CreateMinBlocks here,
+ // becase minBlockCount is 0.
+ m_pDedicatedAllocations[memTypeIndex] = vma_new(this, AllocationVectorType)(VmaStlAllocator<VmaAllocation>(GetAllocationCallbacks()));
+
+ }
+}
+
+VkResult VmaAllocator_T::Init(const VmaAllocatorCreateInfo* pCreateInfo)
+{
+ VkResult res = VK_SUCCESS;
+
+ if(pCreateInfo->pRecordSettings != VMA_NULL &&
+ !VmaStrIsEmpty(pCreateInfo->pRecordSettings->pFilePath))
+ {
+#if VMA_RECORDING_ENABLED
+ m_pRecorder = vma_new(this, VmaRecorder)();
+ res = m_pRecorder->Init(*pCreateInfo->pRecordSettings, m_UseMutex);
+ if(res != VK_SUCCESS)
+ {
+ return res;
+ }
+ m_pRecorder->WriteConfiguration(
+ m_PhysicalDeviceProperties,
+ m_MemProps,
+ m_UseKhrDedicatedAllocation);
+ m_pRecorder->RecordCreateAllocator(GetCurrentFrameIndex());
+#else
+ VMA_ASSERT(0 && "VmaAllocatorCreateInfo::pRecordSettings used, but not supported due to VMA_RECORDING_ENABLED not defined to 1.");
+ return VK_ERROR_FEATURE_NOT_PRESENT;
+#endif
+ }
+
+ return res;
+}
+
+VmaAllocator_T::~VmaAllocator_T()
+{
+#if VMA_RECORDING_ENABLED
+ if(m_pRecorder != VMA_NULL)
+ {
+ m_pRecorder->RecordDestroyAllocator(GetCurrentFrameIndex());
+ vma_delete(this, m_pRecorder);
+ }
+#endif
+
+ VMA_ASSERT(m_Pools.empty());
+
+ for(size_t i = GetMemoryTypeCount(); i--; )
+ {
+ vma_delete(this, m_pDedicatedAllocations[i]);
+ vma_delete(this, m_pBlockVectors[i]);
+ }
+}
+
+void VmaAllocator_T::ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions)
+{
+#if VMA_STATIC_VULKAN_FUNCTIONS == 1
+ m_VulkanFunctions.vkGetPhysicalDeviceProperties = &vkGetPhysicalDeviceProperties;
+ m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties = &vkGetPhysicalDeviceMemoryProperties;
+ m_VulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
+ m_VulkanFunctions.vkFreeMemory = &vkFreeMemory;
+ m_VulkanFunctions.vkMapMemory = &vkMapMemory;
+ m_VulkanFunctions.vkUnmapMemory = &vkUnmapMemory;
+ m_VulkanFunctions.vkFlushMappedMemoryRanges = &vkFlushMappedMemoryRanges;
+ m_VulkanFunctions.vkInvalidateMappedMemoryRanges = &vkInvalidateMappedMemoryRanges;
+ m_VulkanFunctions.vkBindBufferMemory = &vkBindBufferMemory;
+ m_VulkanFunctions.vkBindImageMemory = &vkBindImageMemory;
+ m_VulkanFunctions.vkGetBufferMemoryRequirements = &vkGetBufferMemoryRequirements;
+ m_VulkanFunctions.vkGetImageMemoryRequirements = &vkGetImageMemoryRequirements;
+ m_VulkanFunctions.vkCreateBuffer = &vkCreateBuffer;
+ m_VulkanFunctions.vkDestroyBuffer = &vkDestroyBuffer;
+ m_VulkanFunctions.vkCreateImage = &vkCreateImage;
+ m_VulkanFunctions.vkDestroyImage = &vkDestroyImage;
+ m_VulkanFunctions.vkCmdCopyBuffer = &vkCmdCopyBuffer;
+#if VMA_DEDICATED_ALLOCATION
+ if(m_UseKhrDedicatedAllocation)
+ {
+ m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR =
+ (PFN_vkGetBufferMemoryRequirements2KHR)vkGetDeviceProcAddr(m_hDevice, "vkGetBufferMemoryRequirements2KHR");
+ m_VulkanFunctions.vkGetImageMemoryRequirements2KHR =
+ (PFN_vkGetImageMemoryRequirements2KHR)vkGetDeviceProcAddr(m_hDevice, "vkGetImageMemoryRequirements2KHR");
+ }
+#endif // #if VMA_DEDICATED_ALLOCATION
+#endif // #if VMA_STATIC_VULKAN_FUNCTIONS == 1
+
+#define VMA_COPY_IF_NOT_NULL(funcName) \
+ if(pVulkanFunctions->funcName != VMA_NULL) m_VulkanFunctions.funcName = pVulkanFunctions->funcName;
+
+ if(pVulkanFunctions != VMA_NULL)
+ {
+ VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceProperties);
+ VMA_COPY_IF_NOT_NULL(vkGetPhysicalDeviceMemoryProperties);
+ VMA_COPY_IF_NOT_NULL(vkAllocateMemory);
+ VMA_COPY_IF_NOT_NULL(vkFreeMemory);
+ VMA_COPY_IF_NOT_NULL(vkMapMemory);
+ VMA_COPY_IF_NOT_NULL(vkUnmapMemory);
+ VMA_COPY_IF_NOT_NULL(vkFlushMappedMemoryRanges);
+ VMA_COPY_IF_NOT_NULL(vkInvalidateMappedMemoryRanges);
+ VMA_COPY_IF_NOT_NULL(vkBindBufferMemory);
+ VMA_COPY_IF_NOT_NULL(vkBindImageMemory);
+ VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements);
+ VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements);
+ VMA_COPY_IF_NOT_NULL(vkCreateBuffer);
+ VMA_COPY_IF_NOT_NULL(vkDestroyBuffer);
+ VMA_COPY_IF_NOT_NULL(vkCreateImage);
+ VMA_COPY_IF_NOT_NULL(vkDestroyImage);
+ VMA_COPY_IF_NOT_NULL(vkCmdCopyBuffer);
+#if VMA_DEDICATED_ALLOCATION
+ VMA_COPY_IF_NOT_NULL(vkGetBufferMemoryRequirements2KHR);
+ VMA_COPY_IF_NOT_NULL(vkGetImageMemoryRequirements2KHR);
+#endif
+ }
+
+#undef VMA_COPY_IF_NOT_NULL
+
+ // If these asserts are hit, you must either #define VMA_STATIC_VULKAN_FUNCTIONS 1
+ // or pass valid pointers as VmaAllocatorCreateInfo::pVulkanFunctions.
+ VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceProperties != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkAllocateMemory != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkFreeMemory != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkMapMemory != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkUnmapMemory != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkFlushMappedMemoryRanges != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkInvalidateMappedMemoryRanges != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkBindBufferMemory != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkBindImageMemory != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkCreateBuffer != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkDestroyBuffer != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkCreateImage != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkDestroyImage != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkCmdCopyBuffer != VMA_NULL);
+#if VMA_DEDICATED_ALLOCATION
+ if(m_UseKhrDedicatedAllocation)
+ {
+ VMA_ASSERT(m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR != VMA_NULL);
+ VMA_ASSERT(m_VulkanFunctions.vkGetImageMemoryRequirements2KHR != VMA_NULL);
+ }
+#endif
+}
+
+VkDeviceSize VmaAllocator_T::CalcPreferredBlockSize(uint32_t memTypeIndex)
+{
+ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
+ const VkDeviceSize heapSize = m_MemProps.memoryHeaps[heapIndex].size;
+ const bool isSmallHeap = heapSize <= VMA_SMALL_HEAP_MAX_SIZE;
+ return isSmallHeap ? (heapSize / 8) : m_PreferredLargeHeapBlockSize;
+}
+
+VkResult VmaAllocator_T::AllocateMemoryOfType(
+ VkDeviceSize size,
+ VkDeviceSize alignment,
+ bool dedicatedAllocation,
+ VkBuffer dedicatedBuffer,
+ VkImage dedicatedImage,
+ const VmaAllocationCreateInfo& createInfo,
+ uint32_t memTypeIndex,
+ VmaSuballocationType suballocType,
+ size_t allocationCount,
+ VmaAllocation* pAllocations)
+{
+ VMA_ASSERT(pAllocations != VMA_NULL);
+ VMA_DEBUG_LOG(" AllocateMemory: MemoryTypeIndex=%u, AllocationCount=%zu, Size=%llu", memTypeIndex, allocationCount, vkMemReq.size);
+
+ VmaAllocationCreateInfo finalCreateInfo = createInfo;
+
+ // If memory type is not HOST_VISIBLE, disable MAPPED.
+ if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0 &&
+ (m_MemProps.memoryTypes[memTypeIndex].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+ {
+ finalCreateInfo.flags &= ~VMA_ALLOCATION_CREATE_MAPPED_BIT;
+ }
+
+ VmaBlockVector* const blockVector = m_pBlockVectors[memTypeIndex];
+ VMA_ASSERT(blockVector);
+
+ const VkDeviceSize preferredBlockSize = blockVector->GetPreferredBlockSize();
+ bool preferDedicatedMemory =
+ VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ||
+ dedicatedAllocation ||
+ // Heuristics: Allocate dedicated memory if requested size if greater than half of preferred block size.
+ size > preferredBlockSize / 2;
+
+ if(preferDedicatedMemory &&
+ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) == 0 &&
+ finalCreateInfo.pool == VK_NULL_HANDLE)
+ {
+ finalCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
+ }
+
+ if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0)
+ {
+ if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0)
+ {
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ else
+ {
+ return AllocateDedicatedMemory(
+ size,
+ suballocType,
+ memTypeIndex,
+ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0,
+ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0,
+ finalCreateInfo.pUserData,
+ dedicatedBuffer,
+ dedicatedImage,
+ allocationCount,
+ pAllocations);
+ }
+ }
+ else
+ {
+ VkResult res = blockVector->Allocate(
+ VK_NULL_HANDLE, // hCurrentPool
+ m_CurrentFrameIndex.load(),
+ size,
+ alignment,
+ finalCreateInfo,
+ suballocType,
+ allocationCount,
+ pAllocations);
+ if(res == VK_SUCCESS)
+ {
+ return res;
+ }
+
+ // 5. Try dedicated memory.
+ if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0)
+ {
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ else
+ {
+ res = AllocateDedicatedMemory(
+ size,
+ suballocType,
+ memTypeIndex,
+ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0,
+ (finalCreateInfo.flags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0,
+ finalCreateInfo.pUserData,
+ dedicatedBuffer,
+ dedicatedImage,
+ allocationCount,
+ pAllocations);
+ if(res == VK_SUCCESS)
+ {
+ // Succeeded: AllocateDedicatedMemory function already filld pMemory, nothing more to do here.
+ VMA_DEBUG_LOG(" Allocated as DedicatedMemory");
+ return VK_SUCCESS;
+ }
+ else
+ {
+ // Everything failed: Return error code.
+ VMA_DEBUG_LOG(" vkAllocateMemory FAILED");
+ return res;
+ }
+ }
+ }
+}
+
+VkResult VmaAllocator_T::AllocateDedicatedMemory(
+ VkDeviceSize size,
+ VmaSuballocationType suballocType,
+ uint32_t memTypeIndex,
+ bool map,
+ bool isUserDataString,
+ void* pUserData,
+ VkBuffer /*dedicatedBuffer*/,
+ VkImage /*dedicatedImage*/,
+ size_t allocationCount,
+ VmaAllocation* pAllocations)
+{
+ VMA_ASSERT(allocationCount > 0 && pAllocations);
+
+ VkMemoryAllocateInfo allocInfo = {};
+ allocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
+ allocInfo.memoryTypeIndex = memTypeIndex;
+ allocInfo.allocationSize = size;
+
+#if VMA_DEDICATED_ALLOCATION
+ VkMemoryDedicatedAllocateInfoKHR dedicatedAllocInfo = {};
+ dedicatedAllocInfo.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR;
+ if(m_UseKhrDedicatedAllocation)
+ {
+ if(dedicatedBuffer != VK_NULL_HANDLE)
+ {
+ VMA_ASSERT(dedicatedImage == VK_NULL_HANDLE);
+ dedicatedAllocInfo.buffer = dedicatedBuffer;
+ allocInfo.pNext = &dedicatedAllocInfo;
+ }
+ else if(dedicatedImage != VK_NULL_HANDLE)
+ {
+ dedicatedAllocInfo.image = dedicatedImage;
+ allocInfo.pNext = &dedicatedAllocInfo;
+ }
+ }
+#endif // #if VMA_DEDICATED_ALLOCATION
+
+ size_t allocIndex;
+ VkResult res = VK_SUCCESS;
+ for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+ {
+ res = AllocateDedicatedMemoryPage(
+ size,
+ suballocType,
+ memTypeIndex,
+ allocInfo,
+ map,
+ isUserDataString,
+ pUserData,
+ pAllocations + allocIndex);
+ if(res != VK_SUCCESS)
+ {
+ break;
+ }
+ }
+
+ if(res == VK_SUCCESS)
+ {
+ // Register them in m_pDedicatedAllocations.
+ {
+ VmaMutexLockWrite lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+ AllocationVectorType* pDedicatedAllocations = m_pDedicatedAllocations[memTypeIndex];
+ VMA_ASSERT(pDedicatedAllocations);
+ for(allocIndex = 0; allocIndex < allocationCount; ++allocIndex)
+ {
+ VmaVectorInsertSorted<VmaPointerLess>(*pDedicatedAllocations, pAllocations[allocIndex]);
+ }
+ }
+
+ VMA_DEBUG_LOG(" Allocated DedicatedMemory Count=%zu, MemoryTypeIndex=#%u", allocationCount, memTypeIndex);
+ }
+ else
+ {
+ // Free all already created allocations.
+ while(allocIndex--)
+ {
+ VmaAllocation currAlloc = pAllocations[allocIndex];
+ VkDeviceMemory hMemory = currAlloc->GetMemory();
+
+ /*
+ There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory
+ before vkFreeMemory.
+
+ if(currAlloc->GetMappedData() != VMA_NULL)
+ {
+ (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory);
+ }
+ */
+
+ FreeVulkanMemory(memTypeIndex, currAlloc->GetSize(), hMemory);
+
+ currAlloc->SetUserData(this, VMA_NULL);
+ vma_delete(this, currAlloc);
+ }
+
+ memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
+ }
+
+ return res;
+}
+
+VkResult VmaAllocator_T::AllocateDedicatedMemoryPage(
+ VkDeviceSize size,
+ VmaSuballocationType suballocType,
+ uint32_t memTypeIndex,
+ const VkMemoryAllocateInfo& allocInfo,
+ bool map,
+ bool isUserDataString,
+ void* pUserData,
+ VmaAllocation* pAllocation)
+{
+ VkDeviceMemory hMemory = VK_NULL_HANDLE;
+ VkResult res = AllocateVulkanMemory(&allocInfo, &hMemory);
+ if(res < 0)
+ {
+ VMA_DEBUG_LOG(" vkAllocateMemory FAILED");
+ return res;
+ }
+
+ void* pMappedData = VMA_NULL;
+ if(map)
+ {
+ res = (*m_VulkanFunctions.vkMapMemory)(
+ m_hDevice,
+ hMemory,
+ 0,
+ VK_WHOLE_SIZE,
+ 0,
+ &pMappedData);
+ if(res < 0)
+ {
+ VMA_DEBUG_LOG(" vkMapMemory FAILED");
+ FreeVulkanMemory(memTypeIndex, size, hMemory);
+ return res;
+ }
+ }
+
+ *pAllocation = vma_new(this, VmaAllocation_T)(m_CurrentFrameIndex.load(), isUserDataString);
+ (*pAllocation)->InitDedicatedAllocation(memTypeIndex, hMemory, suballocType, pMappedData, size);
+ (*pAllocation)->SetUserData(this, pUserData);
+ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+ {
+ FillAllocation(*pAllocation, VMA_ALLOCATION_FILL_PATTERN_CREATED);
+ }
+
+ return VK_SUCCESS;
+}
+
+void VmaAllocator_T::GetBufferMemoryRequirements(
+ VkBuffer hBuffer,
+ VkMemoryRequirements& memReq,
+ bool& requiresDedicatedAllocation,
+ bool& prefersDedicatedAllocation) const
+{
+#if VMA_DEDICATED_ALLOCATION
+ if(m_UseKhrDedicatedAllocation)
+ {
+ VkBufferMemoryRequirementsInfo2KHR memReqInfo = {};
+ memReqInfo.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR;
+ memReqInfo.buffer = hBuffer;
+
+ VkMemoryDedicatedRequirementsKHR memDedicatedReq = {};
+ memDedicatedReq.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
+
+ VkMemoryRequirements2KHR memReq2 = {};
+ memReq2.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
+ memReq2.pNext = &memDedicatedReq;
+
+ (*m_VulkanFunctions.vkGetBufferMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+
+ memReq = memReq2.memoryRequirements;
+ requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
+ prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
+ }
+ else
+#endif // #if VMA_DEDICATED_ALLOCATION
+ {
+ (*m_VulkanFunctions.vkGetBufferMemoryRequirements)(m_hDevice, hBuffer, &memReq);
+ requiresDedicatedAllocation = false;
+ prefersDedicatedAllocation = false;
+ }
+}
+
+void VmaAllocator_T::GetImageMemoryRequirements(
+ VkImage hImage,
+ VkMemoryRequirements& memReq,
+ bool& requiresDedicatedAllocation,
+ bool& prefersDedicatedAllocation) const
+{
+#if VMA_DEDICATED_ALLOCATION
+ if(m_UseKhrDedicatedAllocation)
+ {
+ VkImageMemoryRequirementsInfo2KHR memReqInfo = {};
+ memReqInfo.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR;
+ memReqInfo.image = hImage;
+
+ VkMemoryDedicatedRequirementsKHR memDedicatedReq = {};
+ memDedicatedReq.sType = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR;
+
+ VkMemoryRequirements2KHR memReq2 = {};
+ memReq2.sType = VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2_KHR;
+ memReq2.pNext = &memDedicatedReq;
+
+ (*m_VulkanFunctions.vkGetImageMemoryRequirements2KHR)(m_hDevice, &memReqInfo, &memReq2);
+
+ memReq = memReq2.memoryRequirements;
+ requiresDedicatedAllocation = (memDedicatedReq.requiresDedicatedAllocation != VK_FALSE);
+ prefersDedicatedAllocation = (memDedicatedReq.prefersDedicatedAllocation != VK_FALSE);
+ }
+ else
+#endif // #if VMA_DEDICATED_ALLOCATION
+ {
+ (*m_VulkanFunctions.vkGetImageMemoryRequirements)(m_hDevice, hImage, &memReq);
+ requiresDedicatedAllocation = false;
+ prefersDedicatedAllocation = false;
+ }
+}
+
+VkResult VmaAllocator_T::AllocateMemory(
+ const VkMemoryRequirements& vkMemReq,
+ bool requiresDedicatedAllocation,
+ bool prefersDedicatedAllocation,
+ VkBuffer dedicatedBuffer,
+ VkImage dedicatedImage,
+ const VmaAllocationCreateInfo& createInfo,
+ VmaSuballocationType suballocType,
+ size_t allocationCount,
+ VmaAllocation* pAllocations)
+{
+ memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
+
+ VMA_ASSERT(VmaIsPow2(vkMemReq.alignment));
+
+ if(vkMemReq.size == 0)
+ {
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ if((createInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0 &&
+ (createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0)
+ {
+ VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT together with VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT makes no sense.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ if((createInfo.flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0 &&
+ (createInfo.flags & VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT) != 0)
+ {
+ VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_MAPPED_BIT together with VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT is invalid.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ if(requiresDedicatedAllocation)
+ {
+ if((createInfo.flags & VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT) != 0)
+ {
+ VMA_ASSERT(0 && "VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT specified while dedicated allocation is required.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ if(createInfo.pool != VK_NULL_HANDLE)
+ {
+ VMA_ASSERT(0 && "Pool specified while dedicated allocation is required.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+ if((createInfo.pool != VK_NULL_HANDLE) &&
+ ((createInfo.flags & (VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT)) != 0))
+ {
+ VMA_ASSERT(0 && "Specifying VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT when pool != null is invalid.");
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+
+ if(createInfo.pool != VK_NULL_HANDLE)
+ {
+ const VkDeviceSize alignmentForPool = VMA_MAX(
+ vkMemReq.alignment,
+ GetMemoryTypeMinAlignment(createInfo.pool->m_BlockVector.GetMemoryTypeIndex()));
+ return createInfo.pool->m_BlockVector.Allocate(
+ createInfo.pool,
+ m_CurrentFrameIndex.load(),
+ vkMemReq.size,
+ alignmentForPool,
+ createInfo,
+ suballocType,
+ allocationCount,
+ pAllocations);
+ }
+ else
+ {
+ // Bit mask of memory Vulkan types acceptable for this allocation.
+ uint32_t memoryTypeBits = vkMemReq.memoryTypeBits;
+ uint32_t memTypeIndex = UINT32_MAX;
+ VkResult res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &createInfo, &memTypeIndex);
+ if(res == VK_SUCCESS)
+ {
+ VkDeviceSize alignmentForMemType = VMA_MAX(
+ vkMemReq.alignment,
+ GetMemoryTypeMinAlignment(memTypeIndex));
+
+ res = AllocateMemoryOfType(
+ vkMemReq.size,
+ alignmentForMemType,
+ requiresDedicatedAllocation || prefersDedicatedAllocation,
+ dedicatedBuffer,
+ dedicatedImage,
+ createInfo,
+ memTypeIndex,
+ suballocType,
+ allocationCount,
+ pAllocations);
+ // Succeeded on first try.
+ if(res == VK_SUCCESS)
+ {
+ return res;
+ }
+ // Allocation from this memory type failed. Try other compatible memory types.
+ else
+ {
+ for(;;)
+ {
+ // Remove old memTypeIndex from list of possibilities.
+ memoryTypeBits &= ~(1u << memTypeIndex);
+ // Find alternative memTypeIndex.
+ res = vmaFindMemoryTypeIndex(this, memoryTypeBits, &createInfo, &memTypeIndex);
+ if(res == VK_SUCCESS)
+ {
+ alignmentForMemType = VMA_MAX(
+ vkMemReq.alignment,
+ GetMemoryTypeMinAlignment(memTypeIndex));
+
+ res = AllocateMemoryOfType(
+ vkMemReq.size,
+ alignmentForMemType,
+ requiresDedicatedAllocation || prefersDedicatedAllocation,
+ dedicatedBuffer,
+ dedicatedImage,
+ createInfo,
+ memTypeIndex,
+ suballocType,
+ allocationCount,
+ pAllocations);
+ // Allocation from this alternative memory type succeeded.
+ if(res == VK_SUCCESS)
+ {
+ return res;
+ }
+ // else: Allocation from this memory type failed. Try next one - next loop iteration.
+ }
+ // No other matching memory type index could be found.
+ else
+ {
+ // Not returning res, which is VK_ERROR_FEATURE_NOT_PRESENT, because we already failed to allocate once.
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+ }
+ }
+ // Can't find any single memory type maching requirements. res is VK_ERROR_FEATURE_NOT_PRESENT.
+ else
+ return res;
+ }
+}
+
+void VmaAllocator_T::FreeMemory(
+ size_t allocationCount,
+ const VmaAllocation* pAllocations)
+{
+ VMA_ASSERT(pAllocations);
+
+ for(size_t allocIndex = allocationCount; allocIndex--; )
+ {
+ VmaAllocation allocation = pAllocations[allocIndex];
+
+ if(allocation != VK_NULL_HANDLE)
+ {
+ if(TouchAllocation(allocation))
+ {
+ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS)
+ {
+ FillAllocation(allocation, VMA_ALLOCATION_FILL_PATTERN_DESTROYED);
+ }
+
+ switch(allocation->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ {
+ VmaBlockVector* pBlockVector = VMA_NULL;
+ VmaPool hPool = allocation->GetPool();
+ if(hPool != VK_NULL_HANDLE)
+ {
+ pBlockVector = &hPool->m_BlockVector;
+ }
+ else
+ {
+ const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
+ pBlockVector = m_pBlockVectors[memTypeIndex];
+ }
+ pBlockVector->Free(allocation);
+ }
+ break;
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ FreeDedicatedMemory(allocation);
+ break;
+ default:
+ VMA_ASSERT(0);
+ }
+ }
+
+ allocation->SetUserData(this, VMA_NULL);
+ vma_delete(this, allocation);
+ }
+ }
+}
+
+VkResult VmaAllocator_T::ResizeAllocation(
+ const VmaAllocation alloc,
+ VkDeviceSize newSize)
+{
+ if(newSize == 0 || alloc->GetLastUseFrameIndex() == VMA_FRAME_INDEX_LOST)
+ {
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+ if(newSize == alloc->GetSize())
+ {
+ return VK_SUCCESS;
+ }
+
+ switch(alloc->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ return VK_ERROR_FEATURE_NOT_PRESENT;
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ if(alloc->GetBlock()->m_pMetadata->ResizeAllocation(alloc, newSize))
+ {
+ alloc->ChangeSize(newSize);
+ VMA_HEAVY_ASSERT(alloc->GetBlock()->m_pMetadata->Validate());
+ return VK_SUCCESS;
+ }
+ else
+ {
+ return VkResult(-1000069000); // VK_ERROR_OUT_OF_POOL_MEMORY
+ }
+ default:
+ VMA_ASSERT(0);
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+}
+
+void VmaAllocator_T::CalculateStats(VmaStats* pStats)
+{
+ // Initialize.
+ InitStatInfo(pStats->total);
+ for(size_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i)
+ InitStatInfo(pStats->memoryType[i]);
+ for(size_t i = 0; i < VK_MAX_MEMORY_HEAPS; ++i)
+ InitStatInfo(pStats->memoryHeap[i]);
+
+ // Process default pools.
+ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+ {
+ VmaBlockVector* const pBlockVector = m_pBlockVectors[memTypeIndex];
+ VMA_ASSERT(pBlockVector);
+ pBlockVector->AddStats(pStats);
+ }
+
+ // Process custom pools.
+ {
+ VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
+ for(size_t poolIndex = 0, poolCount = m_Pools.size(); poolIndex < poolCount; ++poolIndex)
+ {
+ m_Pools[poolIndex]->m_BlockVector.AddStats(pStats);
+ }
+ }
+
+ // Process dedicated allocations.
+ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+ {
+ const uint32_t memHeapIndex = MemoryTypeIndexToHeapIndex(memTypeIndex);
+ VmaMutexLockRead dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+ AllocationVectorType* const pDedicatedAllocVector = m_pDedicatedAllocations[memTypeIndex];
+ VMA_ASSERT(pDedicatedAllocVector);
+ for(size_t allocIndex = 0, allocCount = pDedicatedAllocVector->size(); allocIndex < allocCount; ++allocIndex)
+ {
+ VmaStatInfo allocationStatInfo;
+ (*pDedicatedAllocVector)[allocIndex]->DedicatedAllocCalcStatsInfo(allocationStatInfo);
+ VmaAddStatInfo(pStats->total, allocationStatInfo);
+ VmaAddStatInfo(pStats->memoryType[memTypeIndex], allocationStatInfo);
+ VmaAddStatInfo(pStats->memoryHeap[memHeapIndex], allocationStatInfo);
+ }
+ }
+
+ // Postprocess.
+ VmaPostprocessCalcStatInfo(pStats->total);
+ for(size_t i = 0; i < GetMemoryTypeCount(); ++i)
+ VmaPostprocessCalcStatInfo(pStats->memoryType[i]);
+ for(size_t i = 0; i < GetMemoryHeapCount(); ++i)
+ VmaPostprocessCalcStatInfo(pStats->memoryHeap[i]);
+}
+
+static const uint32_t VMA_VENDOR_ID_AMD = 4098;
+
+VkResult VmaAllocator_T::DefragmentationBegin(
+ const VmaDefragmentationInfo2& info,
+ VmaDefragmentationStats* pStats,
+ VmaDefragmentationContext* pContext)
+{
+ if(info.pAllocationsChanged != VMA_NULL)
+ {
+ memset(info.pAllocationsChanged, 0, info.allocationCount * sizeof(VkBool32));
+ }
+
+ *pContext = vma_new(this, VmaDefragmentationContext_T)(
+ this, m_CurrentFrameIndex.load(), info.flags, pStats);
+
+ (*pContext)->AddPools(info.poolCount, info.pPools);
+ (*pContext)->AddAllocations(
+ info.allocationCount, info.pAllocations, info.pAllocationsChanged);
+
+ VkResult res = (*pContext)->Defragment(
+ info.maxCpuBytesToMove, info.maxCpuAllocationsToMove,
+ info.maxGpuBytesToMove, info.maxGpuAllocationsToMove,
+ info.commandBuffer, pStats);
+
+ if(res != VK_NOT_READY)
+ {
+ vma_delete(this, *pContext);
+ *pContext = VMA_NULL;
+ }
+
+ return res;
+}
+
+VkResult VmaAllocator_T::DefragmentationEnd(
+ VmaDefragmentationContext context)
+{
+ vma_delete(this, context);
+ return VK_SUCCESS;
+}
+
+void VmaAllocator_T::GetAllocationInfo(VmaAllocation hAllocation, VmaAllocationInfo* pAllocationInfo)
+{
+ if(hAllocation->CanBecomeLost())
+ {
+ /*
+ Warning: This is a carefully designed algorithm.
+ Do not modify unless you really know what you're doing :)
+ */
+ const uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+ uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+ for(;;)
+ {
+ if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
+ {
+ pAllocationInfo->memoryType = UINT32_MAX;
+ pAllocationInfo->deviceMemory = VK_NULL_HANDLE;
+ pAllocationInfo->offset = 0;
+ pAllocationInfo->size = hAllocation->GetSize();
+ pAllocationInfo->pMappedData = VMA_NULL;
+ pAllocationInfo->pUserData = hAllocation->GetUserData();
+ return;
+ }
+ else if(localLastUseFrameIndex == localCurrFrameIndex)
+ {
+ pAllocationInfo->memoryType = hAllocation->GetMemoryTypeIndex();
+ pAllocationInfo->deviceMemory = hAllocation->GetMemory();
+ pAllocationInfo->offset = hAllocation->GetOffset();
+ pAllocationInfo->size = hAllocation->GetSize();
+ pAllocationInfo->pMappedData = VMA_NULL;
+ pAllocationInfo->pUserData = hAllocation->GetUserData();
+ return;
+ }
+ else // Last use time earlier than current time.
+ {
+ if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+ {
+ localLastUseFrameIndex = localCurrFrameIndex;
+ }
+ }
+ }
+ }
+ else
+ {
+#if VMA_STATS_STRING_ENABLED
+ uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+ uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+ for(;;)
+ {
+ VMA_ASSERT(localLastUseFrameIndex != VMA_FRAME_INDEX_LOST);
+ if(localLastUseFrameIndex == localCurrFrameIndex)
+ {
+ break;
+ }
+ else // Last use time earlier than current time.
+ {
+ if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+ {
+ localLastUseFrameIndex = localCurrFrameIndex;
+ }
+ }
+ }
+#endif
+
+ pAllocationInfo->memoryType = hAllocation->GetMemoryTypeIndex();
+ pAllocationInfo->deviceMemory = hAllocation->GetMemory();
+ pAllocationInfo->offset = hAllocation->GetOffset();
+ pAllocationInfo->size = hAllocation->GetSize();
+ pAllocationInfo->pMappedData = hAllocation->GetMappedData();
+ pAllocationInfo->pUserData = hAllocation->GetUserData();
+ }
+}
+
+bool VmaAllocator_T::TouchAllocation(VmaAllocation hAllocation)
+{
+ // This is a stripped-down version of VmaAllocator_T::GetAllocationInfo.
+ if(hAllocation->CanBecomeLost())
+ {
+ uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+ uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+ for(;;)
+ {
+ if(localLastUseFrameIndex == VMA_FRAME_INDEX_LOST)
+ {
+ return false;
+ }
+ else if(localLastUseFrameIndex == localCurrFrameIndex)
+ {
+ return true;
+ }
+ else // Last use time earlier than current time.
+ {
+ if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+ {
+ localLastUseFrameIndex = localCurrFrameIndex;
+ }
+ }
+ }
+ }
+ else
+ {
+#if VMA_STATS_STRING_ENABLED
+ uint32_t localCurrFrameIndex = m_CurrentFrameIndex.load();
+ uint32_t localLastUseFrameIndex = hAllocation->GetLastUseFrameIndex();
+ for(;;)
+ {
+ VMA_ASSERT(localLastUseFrameIndex != VMA_FRAME_INDEX_LOST);
+ if(localLastUseFrameIndex == localCurrFrameIndex)
+ {
+ break;
+ }
+ else // Last use time earlier than current time.
+ {
+ if(hAllocation->CompareExchangeLastUseFrameIndex(localLastUseFrameIndex, localCurrFrameIndex))
+ {
+ localLastUseFrameIndex = localCurrFrameIndex;
+ }
+ }
+ }
+#endif
+
+ return true;
+ }
+}
+
+VkResult VmaAllocator_T::CreatePool(const VmaPoolCreateInfo* pCreateInfo, VmaPool* pPool)
+{
+ VMA_DEBUG_LOG(" CreatePool: MemoryTypeIndex=%u, flags=%u", pCreateInfo->memoryTypeIndex, pCreateInfo->flags);
+
+ VmaPoolCreateInfo newCreateInfo = *pCreateInfo;
+
+ if(newCreateInfo.maxBlockCount == 0)
+ {
+ newCreateInfo.maxBlockCount = SIZE_MAX;
+ }
+ if(newCreateInfo.minBlockCount > newCreateInfo.maxBlockCount)
+ {
+ return VK_ERROR_INITIALIZATION_FAILED;
+ }
+
+ const VkDeviceSize preferredBlockSize = CalcPreferredBlockSize(newCreateInfo.memoryTypeIndex);
+
+ *pPool = vma_new(this, VmaPool_T)(this, newCreateInfo, preferredBlockSize);
+
+ VkResult res = (*pPool)->m_BlockVector.CreateMinBlocks();
+ if(res != VK_SUCCESS)
+ {
+ vma_delete(this, *pPool);
+ *pPool = VMA_NULL;
+ return res;
+ }
+
+ // Add to m_Pools.
+ {
+ VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
+ (*pPool)->SetId(m_NextPoolId++);
+ VmaVectorInsertSorted<VmaPointerLess>(m_Pools, *pPool);
+ }
+
+ return VK_SUCCESS;
+}
+
+void VmaAllocator_T::DestroyPool(VmaPool pool)
+{
+ // Remove from m_Pools.
+ {
+ VmaMutexLockWrite lock(m_PoolsMutex, m_UseMutex);
+ bool success = VmaVectorRemoveSorted<VmaPointerLess>(m_Pools, pool);
+ (void) success;
+ VMA_ASSERT(success && "Pool not found in Allocator.");
+ }
+
+ vma_delete(this, pool);
+}
+
+void VmaAllocator_T::GetPoolStats(VmaPool pool, VmaPoolStats* pPoolStats)
+{
+ pool->m_BlockVector.GetPoolStats(pPoolStats);
+}
+
+void VmaAllocator_T::SetCurrentFrameIndex(uint32_t frameIndex)
+{
+ m_CurrentFrameIndex.store(frameIndex);
+}
+
+void VmaAllocator_T::MakePoolAllocationsLost(
+ VmaPool hPool,
+ size_t* pLostAllocationCount)
+{
+ hPool->m_BlockVector.MakePoolAllocationsLost(
+ m_CurrentFrameIndex.load(),
+ pLostAllocationCount);
+}
+
+VkResult VmaAllocator_T::CheckPoolCorruption(VmaPool hPool)
+{
+ return hPool->m_BlockVector.CheckCorruption();
+}
+
+VkResult VmaAllocator_T::CheckCorruption(uint32_t memoryTypeBits)
+{
+ VkResult finalRes = VK_ERROR_FEATURE_NOT_PRESENT;
+
+ // Process default pools.
+ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+ {
+ if(((1u << memTypeIndex) & memoryTypeBits) != 0)
+ {
+ VmaBlockVector* const pBlockVector = m_pBlockVectors[memTypeIndex];
+ VMA_ASSERT(pBlockVector);
+ VkResult localRes = pBlockVector->CheckCorruption();
+ switch(localRes)
+ {
+ case VK_ERROR_FEATURE_NOT_PRESENT:
+ break;
+ case VK_SUCCESS:
+ finalRes = VK_SUCCESS;
+ break;
+ default:
+ return localRes;
+ }
+ }
+ }
+
+ // Process custom pools.
+ {
+ VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
+ for(size_t poolIndex = 0, poolCount = m_Pools.size(); poolIndex < poolCount; ++poolIndex)
+ {
+ if(((1u << m_Pools[poolIndex]->m_BlockVector.GetMemoryTypeIndex()) & memoryTypeBits) != 0)
+ {
+ VkResult localRes = m_Pools[poolIndex]->m_BlockVector.CheckCorruption();
+ switch(localRes)
+ {
+ case VK_ERROR_FEATURE_NOT_PRESENT:
+ break;
+ case VK_SUCCESS:
+ finalRes = VK_SUCCESS;
+ break;
+ default:
+ return localRes;
+ }
+ }
+ }
+ }
+
+ return finalRes;
+}
+
+void VmaAllocator_T::CreateLostAllocation(VmaAllocation* pAllocation)
+{
+ *pAllocation = vma_new(this, VmaAllocation_T)(VMA_FRAME_INDEX_LOST, false);
+ (*pAllocation)->InitLost();
+}
+
+VkResult VmaAllocator_T::AllocateVulkanMemory(const VkMemoryAllocateInfo* pAllocateInfo, VkDeviceMemory* pMemory)
+{
+ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(pAllocateInfo->memoryTypeIndex);
+
+ VkResult res;
+ if(m_HeapSizeLimit[heapIndex] != VK_WHOLE_SIZE)
+ {
+ VmaMutexLock lock(m_HeapSizeLimitMutex, m_UseMutex);
+ if(m_HeapSizeLimit[heapIndex] >= pAllocateInfo->allocationSize)
+ {
+ res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory);
+ if(res == VK_SUCCESS)
+ {
+ m_HeapSizeLimit[heapIndex] -= pAllocateInfo->allocationSize;
+ }
+ }
+ else
+ {
+ res = VK_ERROR_OUT_OF_DEVICE_MEMORY;
+ }
+ }
+ else
+ {
+ res = (*m_VulkanFunctions.vkAllocateMemory)(m_hDevice, pAllocateInfo, GetAllocationCallbacks(), pMemory);
+ }
+
+ if(res == VK_SUCCESS && m_DeviceMemoryCallbacks.pfnAllocate != VMA_NULL)
+ {
+ (*m_DeviceMemoryCallbacks.pfnAllocate)(this, pAllocateInfo->memoryTypeIndex, *pMemory, pAllocateInfo->allocationSize);
+ }
+
+ return res;
+}
+
+void VmaAllocator_T::FreeVulkanMemory(uint32_t memoryType, VkDeviceSize size, VkDeviceMemory hMemory)
+{
+ if(m_DeviceMemoryCallbacks.pfnFree != VMA_NULL)
+ {
+ (*m_DeviceMemoryCallbacks.pfnFree)(this, memoryType, hMemory, size);
+ }
+
+ (*m_VulkanFunctions.vkFreeMemory)(m_hDevice, hMemory, GetAllocationCallbacks());
+
+ const uint32_t heapIndex = MemoryTypeIndexToHeapIndex(memoryType);
+ if(m_HeapSizeLimit[heapIndex] != VK_WHOLE_SIZE)
+ {
+ VmaMutexLock lock(m_HeapSizeLimitMutex, m_UseMutex);
+ m_HeapSizeLimit[heapIndex] += size;
+ }
+}
+
+VkResult VmaAllocator_T::Map(VmaAllocation hAllocation, void** ppData)
+{
+ if(hAllocation->CanBecomeLost())
+ {
+ return VK_ERROR_MEMORY_MAP_FAILED;
+ }
+
+ switch(hAllocation->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ {
+ VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock();
+ char *pBytes = VMA_NULL;
+ VkResult res = pBlock->Map(this, 1, (void**)&pBytes);
+ if(res == VK_SUCCESS)
+ {
+ *ppData = pBytes + (ptrdiff_t)hAllocation->GetOffset();
+ hAllocation->BlockAllocMap();
+ }
+ return res;
+ }
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ return hAllocation->DedicatedAllocMap(this, ppData);
+ default:
+ VMA_ASSERT(0);
+ return VK_ERROR_MEMORY_MAP_FAILED;
+ }
+}
+
+void VmaAllocator_T::Unmap(VmaAllocation hAllocation)
+{
+ switch(hAllocation->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ {
+ VmaDeviceMemoryBlock* const pBlock = hAllocation->GetBlock();
+ hAllocation->BlockAllocUnmap();
+ pBlock->Unmap(this, 1);
+ }
+ break;
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ hAllocation->DedicatedAllocUnmap(this);
+ break;
+ default:
+ VMA_ASSERT(0);
+ }
+}
+
+VkResult VmaAllocator_T::BindBufferMemory(VmaAllocation hAllocation, VkBuffer hBuffer)
+{
+ VkResult res = VK_SUCCESS;
+ switch(hAllocation->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ res = GetVulkanFunctions().vkBindBufferMemory(
+ m_hDevice,
+ hBuffer,
+ hAllocation->GetMemory(),
+ 0); //memoryOffset
+ break;
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ {
+ VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
+ VMA_ASSERT(pBlock && "Binding buffer to allocation that doesn't belong to any block. Is the allocation lost?");
+ res = pBlock->BindBufferMemory(this, hAllocation, hBuffer);
+ break;
+ }
+ default:
+ VMA_ASSERT(0);
+ }
+ return res;
+}
+
+VkResult VmaAllocator_T::BindImageMemory(VmaAllocation hAllocation, VkImage hImage)
+{
+ VkResult res = VK_SUCCESS;
+ switch(hAllocation->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ res = GetVulkanFunctions().vkBindImageMemory(
+ m_hDevice,
+ hImage,
+ hAllocation->GetMemory(),
+ 0); //memoryOffset
+ break;
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ {
+ VmaDeviceMemoryBlock* pBlock = hAllocation->GetBlock();
+ VMA_ASSERT(pBlock && "Binding image to allocation that doesn't belong to any block. Is the allocation lost?");
+ res = pBlock->BindImageMemory(this, hAllocation, hImage);
+ break;
+ }
+ default:
+ VMA_ASSERT(0);
+ }
+ return res;
+}
+
+void VmaAllocator_T::FlushOrInvalidateAllocation(
+ VmaAllocation hAllocation,
+ VkDeviceSize offset, VkDeviceSize size,
+ VMA_CACHE_OPERATION op)
+{
+ const uint32_t memTypeIndex = hAllocation->GetMemoryTypeIndex();
+ if(size > 0 && IsMemoryTypeNonCoherent(memTypeIndex))
+ {
+ const VkDeviceSize allocationSize = hAllocation->GetSize();
+ VMA_ASSERT(offset <= allocationSize);
+
+ const VkDeviceSize nonCoherentAtomSize = m_PhysicalDeviceProperties.limits.nonCoherentAtomSize;
+
+ VkMappedMemoryRange memRange = {};
+ memRange.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
+ memRange.memory = hAllocation->GetMemory();
+
+ switch(hAllocation->GetType())
+ {
+ case VmaAllocation_T::ALLOCATION_TYPE_DEDICATED:
+ memRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
+ if(size == VK_WHOLE_SIZE)
+ {
+ memRange.size = allocationSize - memRange.offset;
+ }
+ else
+ {
+ VMA_ASSERT(offset + size <= allocationSize);
+ memRange.size = VMA_MIN(
+ VmaAlignUp(size + (offset - memRange.offset), nonCoherentAtomSize),
+ allocationSize - memRange.offset);
+ }
+ break;
+
+ case VmaAllocation_T::ALLOCATION_TYPE_BLOCK:
+ {
+ // 1. Still within this allocation.
+ memRange.offset = VmaAlignDown(offset, nonCoherentAtomSize);
+ if(size == VK_WHOLE_SIZE)
+ {
+ size = allocationSize - offset;
+ }
+ else
+ {
+ VMA_ASSERT(offset + size <= allocationSize);
+ }
+ memRange.size = VmaAlignUp(size + (offset - memRange.offset), nonCoherentAtomSize);
+
+ // 2. Adjust to whole block.
+ const VkDeviceSize allocationOffset = hAllocation->GetOffset();
+ VMA_ASSERT(allocationOffset % nonCoherentAtomSize == 0);
+ const VkDeviceSize blockSize = hAllocation->GetBlock()->m_pMetadata->GetSize();
+ memRange.offset += allocationOffset;
+ memRange.size = VMA_MIN(memRange.size, blockSize - memRange.offset);
+
+ break;
+ }
+
+ default:
+ VMA_ASSERT(0);
+ }
+
+ switch(op)
+ {
+ case VMA_CACHE_FLUSH:
+ (*GetVulkanFunctions().vkFlushMappedMemoryRanges)(m_hDevice, 1, &memRange);
+ break;
+ case VMA_CACHE_INVALIDATE:
+ (*GetVulkanFunctions().vkInvalidateMappedMemoryRanges)(m_hDevice, 1, &memRange);
+ break;
+ default:
+ VMA_ASSERT(0);
+ }
+ }
+ // else: Just ignore this call.
+}
+
+void VmaAllocator_T::FreeDedicatedMemory(VmaAllocation allocation)
+{
+ VMA_ASSERT(allocation && allocation->GetType() == VmaAllocation_T::ALLOCATION_TYPE_DEDICATED);
+
+ const uint32_t memTypeIndex = allocation->GetMemoryTypeIndex();
+ {
+ VmaMutexLockWrite lock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+ AllocationVectorType* const pDedicatedAllocations = m_pDedicatedAllocations[memTypeIndex];
+ VMA_ASSERT(pDedicatedAllocations);
+ bool success = VmaVectorRemoveSorted<VmaPointerLess>(*pDedicatedAllocations, allocation);
+ (void) success;
+ VMA_ASSERT(success);
+ }
+
+ VkDeviceMemory hMemory = allocation->GetMemory();
+
+ /*
+ There is no need to call this, because Vulkan spec allows to skip vkUnmapMemory
+ before vkFreeMemory.
+
+ if(allocation->GetMappedData() != VMA_NULL)
+ {
+ (*m_VulkanFunctions.vkUnmapMemory)(m_hDevice, hMemory);
+ }
+ */
+
+ FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory);
+
+ VMA_DEBUG_LOG(" Freed DedicatedMemory MemoryTypeIndex=%u", memTypeIndex);
+}
+
+void VmaAllocator_T::FillAllocation(const VmaAllocation hAllocation, uint8_t pattern)
+{
+ if(VMA_DEBUG_INITIALIZE_ALLOCATIONS &&
+ !hAllocation->CanBecomeLost() &&
+ (m_MemProps.memoryTypes[hAllocation->GetMemoryTypeIndex()].propertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
+ {
+ void* pData = VMA_NULL;
+ VkResult res = Map(hAllocation, &pData);
+ if(res == VK_SUCCESS)
+ {
+ memset(pData, (int)pattern, (size_t)hAllocation->GetSize());
+ FlushOrInvalidateAllocation(hAllocation, 0, VK_WHOLE_SIZE, VMA_CACHE_FLUSH);
+ Unmap(hAllocation);
+ }
+ else
+ {
+ VMA_ASSERT(0 && "VMA_DEBUG_INITIALIZE_ALLOCATIONS is enabled, but couldn't map memory to fill allocation.");
+ }
+ }
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json)
+{
+ bool dedicatedAllocationsStarted = false;
+ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+ {
+ VmaMutexLockRead dedicatedAllocationsLock(m_DedicatedAllocationsMutex[memTypeIndex], m_UseMutex);
+ AllocationVectorType* const pDedicatedAllocVector = m_pDedicatedAllocations[memTypeIndex];
+ VMA_ASSERT(pDedicatedAllocVector);
+ if(pDedicatedAllocVector->empty() == false)
+ {
+ if(dedicatedAllocationsStarted == false)
+ {
+ dedicatedAllocationsStarted = true;
+ json.WriteString("DedicatedAllocations");
+ json.BeginObject();
+ }
+
+ json.BeginString("Type ");
+ json.ContinueString(memTypeIndex);
+ json.EndString();
+
+ json.BeginArray();
+
+ for(size_t i = 0; i < pDedicatedAllocVector->size(); ++i)
+ {
+ json.BeginObject(true);
+ const VmaAllocation hAlloc = (*pDedicatedAllocVector)[i];
+ hAlloc->PrintParameters(json);
+ json.EndObject();
+ }
+
+ json.EndArray();
+ }
+ }
+ if(dedicatedAllocationsStarted)
+ {
+ json.EndObject();
+ }
+
+ {
+ bool allocationsStarted = false;
+ for(uint32_t memTypeIndex = 0; memTypeIndex < GetMemoryTypeCount(); ++memTypeIndex)
+ {
+ if(m_pBlockVectors[memTypeIndex]->IsEmpty() == false)
+ {
+ if(allocationsStarted == false)
+ {
+ allocationsStarted = true;
+ json.WriteString("DefaultPools");
+ json.BeginObject();
+ }
+
+ json.BeginString("Type ");
+ json.ContinueString(memTypeIndex);
+ json.EndString();
+
+ m_pBlockVectors[memTypeIndex]->PrintDetailedMap(json);
+ }
+ }
+ if(allocationsStarted)
+ {
+ json.EndObject();
+ }
+ }
+
+ // Custom pools
+ {
+ VmaMutexLockRead lock(m_PoolsMutex, m_UseMutex);
+ const size_t poolCount = m_Pools.size();
+ if(poolCount > 0)
+ {
+ json.WriteString("Pools");
+ json.BeginObject();
+ for(size_t poolIndex = 0; poolIndex < poolCount; ++poolIndex)
+ {
+ json.BeginString();
+ json.ContinueString(m_Pools[poolIndex]->GetId());
+ json.EndString();
+
+ m_Pools[poolIndex]->m_BlockVector.PrintDetailedMap(json);
+ }
+ json.EndObject();
+ }
+ }
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+////////////////////////////////////////////////////////////////////////////////
+// Public interface
+
+VkResult vmaCreateAllocator(
+ const VmaAllocatorCreateInfo* pCreateInfo,
+ VmaAllocator* pAllocator)
+{
+ VMA_ASSERT(pCreateInfo && pAllocator);
+ VMA_DEBUG_LOG("vmaCreateAllocator");
+ *pAllocator = vma_new(pCreateInfo->pAllocationCallbacks, VmaAllocator_T)(pCreateInfo);
+ return (*pAllocator)->Init(pCreateInfo);
+}
+
+void vmaDestroyAllocator(
+ VmaAllocator allocator)
+{
+ if(allocator != VK_NULL_HANDLE)
+ {
+ VMA_DEBUG_LOG("vmaDestroyAllocator");
+ VkAllocationCallbacks allocationCallbacks = allocator->m_AllocationCallbacks;
+ vma_delete(&allocationCallbacks, allocator);
+ }
+}
+
+void vmaGetPhysicalDeviceProperties(
+ VmaAllocator allocator,
+ const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
+{
+ VMA_ASSERT(allocator && ppPhysicalDeviceProperties);
+ *ppPhysicalDeviceProperties = &allocator->m_PhysicalDeviceProperties;
+}
+
+void vmaGetMemoryProperties(
+ VmaAllocator allocator,
+ const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties)
+{
+ VMA_ASSERT(allocator && ppPhysicalDeviceMemoryProperties);
+ *ppPhysicalDeviceMemoryProperties = &allocator->m_MemProps;
+}
+
+void vmaGetMemoryTypeProperties(
+ VmaAllocator allocator,
+ uint32_t memoryTypeIndex,
+ VkMemoryPropertyFlags* pFlags)
+{
+ VMA_ASSERT(allocator && pFlags);
+ VMA_ASSERT(memoryTypeIndex < allocator->GetMemoryTypeCount());
+ *pFlags = allocator->m_MemProps.memoryTypes[memoryTypeIndex].propertyFlags;
+}
+
+void vmaSetCurrentFrameIndex(
+ VmaAllocator allocator,
+ uint32_t frameIndex)
+{
+ VMA_ASSERT(allocator);
+ VMA_ASSERT(frameIndex != VMA_FRAME_INDEX_LOST);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ allocator->SetCurrentFrameIndex(frameIndex);
+}
+
+void vmaCalculateStats(
+ VmaAllocator allocator,
+ VmaStats* pStats)
+{
+ VMA_ASSERT(allocator && pStats);
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+ allocator->CalculateStats(pStats);
+}
+
+#if VMA_STATS_STRING_ENABLED
+
+void vmaBuildStatsString(
+ VmaAllocator allocator,
+ char** ppStatsString,
+ VkBool32 detailedMap)
+{
+ VMA_ASSERT(allocator && ppStatsString);
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VmaStringBuilder sb(allocator);
+ {
+ VmaJsonWriter json(allocator->GetAllocationCallbacks(), sb);
+ json.BeginObject();
+
+ VmaStats stats;
+ allocator->CalculateStats(&stats);
+
+ json.WriteString("Total");
+ VmaPrintStatInfo(json, stats.total);
+
+ for(uint32_t heapIndex = 0; heapIndex < allocator->GetMemoryHeapCount(); ++heapIndex)
+ {
+ json.BeginString("Heap ");
+ json.ContinueString(heapIndex);
+ json.EndString();
+ json.BeginObject();
+
+ json.WriteString("Size");
+ json.WriteNumber(allocator->m_MemProps.memoryHeaps[heapIndex].size);
+
+ json.WriteString("Flags");
+ json.BeginArray(true);
+ if((allocator->m_MemProps.memoryHeaps[heapIndex].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT) != 0)
+ {
+ json.WriteString("DEVICE_LOCAL");
+ }
+ json.EndArray();
+
+ if(stats.memoryHeap[heapIndex].blockCount > 0)
+ {
+ json.WriteString("Stats");
+ VmaPrintStatInfo(json, stats.memoryHeap[heapIndex]);
+ }
+
+ for(uint32_t typeIndex = 0; typeIndex < allocator->GetMemoryTypeCount(); ++typeIndex)
+ {
+ if(allocator->MemoryTypeIndexToHeapIndex(typeIndex) == heapIndex)
+ {
+ json.BeginString("Type ");
+ json.ContinueString(typeIndex);
+ json.EndString();
+
+ json.BeginObject();
+
+ json.WriteString("Flags");
+ json.BeginArray(true);
+ VkMemoryPropertyFlags flags = allocator->m_MemProps.memoryTypes[typeIndex].propertyFlags;
+ if((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0)
+ {
+ json.WriteString("DEVICE_LOCAL");
+ }
+ if((flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0)
+ {
+ json.WriteString("HOST_VISIBLE");
+ }
+ if((flags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT) != 0)
+ {
+ json.WriteString("HOST_COHERENT");
+ }
+ if((flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0)
+ {
+ json.WriteString("HOST_CACHED");
+ }
+ if((flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0)
+ {
+ json.WriteString("LAZILY_ALLOCATED");
+ }
+ json.EndArray();
+
+ if(stats.memoryType[typeIndex].blockCount > 0)
+ {
+ json.WriteString("Stats");
+ VmaPrintStatInfo(json, stats.memoryType[typeIndex]);
+ }
+
+ json.EndObject();
+ }
+ }
+
+ json.EndObject();
+ }
+ if(detailedMap == VK_TRUE)
+ {
+ allocator->PrintDetailedMap(json);
+ }
+
+ json.EndObject();
+ }
+
+ const size_t len = sb.GetLength();
+ char* const pChars = vma_new_array(allocator, char, len + 1);
+ if(len > 0)
+ {
+ memcpy(pChars, sb.GetData(), len);
+ }
+ pChars[len] = '\0';
+ *ppStatsString = pChars;
+}
+
+void vmaFreeStatsString(
+ VmaAllocator allocator,
+ char* pStatsString)
+{
+ if(pStatsString != VMA_NULL)
+ {
+ VMA_ASSERT(allocator);
+ size_t len = strlen(pStatsString);
+ vma_delete_array(allocator, pStatsString, len + 1);
+ }
+}
+
+#endif // #if VMA_STATS_STRING_ENABLED
+
+/*
+This function is not protected by any mutex because it just reads immutable data.
+*/
+VkResult vmaFindMemoryTypeIndex(
+ VmaAllocator allocator,
+ uint32_t memoryTypeBits,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ uint32_t* pMemoryTypeIndex)
+{
+ VMA_ASSERT(allocator != VK_NULL_HANDLE);
+ VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
+ VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+ if(pAllocationCreateInfo->memoryTypeBits != 0)
+ {
+ memoryTypeBits &= pAllocationCreateInfo->memoryTypeBits;
+ }
+
+ uint32_t requiredFlags = pAllocationCreateInfo->requiredFlags;
+ uint32_t preferredFlags = pAllocationCreateInfo->preferredFlags;
+
+ const bool mapped = (pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0;
+ if(mapped)
+ {
+ preferredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ }
+
+ // Convert usage to requiredFlags and preferredFlags.
+ switch(pAllocationCreateInfo->usage)
+ {
+ case VMA_MEMORY_USAGE_UNKNOWN:
+ break;
+ case VMA_MEMORY_USAGE_GPU_ONLY:
+ if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+ {
+ preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+ }
+ break;
+ case VMA_MEMORY_USAGE_CPU_ONLY:
+ requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
+ break;
+ case VMA_MEMORY_USAGE_CPU_TO_GPU:
+ requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ if(!allocator->IsIntegratedGpu() || (preferredFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
+ {
+ preferredFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
+ }
+ break;
+ case VMA_MEMORY_USAGE_GPU_TO_CPU:
+ requiredFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
+ preferredFlags |= VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
+ break;
+ default:
+ break;
+ }
+
+ *pMemoryTypeIndex = UINT32_MAX;
+ uint32_t minCost = UINT32_MAX;
+ for(uint32_t memTypeIndex = 0, memTypeBit = 1;
+ memTypeIndex < allocator->GetMemoryTypeCount();
+ ++memTypeIndex, memTypeBit <<= 1)
+ {
+ // This memory type is acceptable according to memoryTypeBits bitmask.
+ if((memTypeBit & memoryTypeBits) != 0)
+ {
+ const VkMemoryPropertyFlags currFlags =
+ allocator->m_MemProps.memoryTypes[memTypeIndex].propertyFlags;
+ // This memory type contains requiredFlags.
+ if((requiredFlags & ~currFlags) == 0)
+ {
+ // Calculate cost as number of bits from preferredFlags not present in this memory type.
+ uint32_t currCost = VmaCountBitsSet(preferredFlags & ~currFlags);
+ // Remember memory type with lowest cost.
+ if(currCost < minCost)
+ {
+ *pMemoryTypeIndex = memTypeIndex;
+ if(currCost == 0)
+ {
+ return VK_SUCCESS;
+ }
+ minCost = currCost;
+ }
+ }
+ }
+ }
+ return (*pMemoryTypeIndex != UINT32_MAX) ? VK_SUCCESS : VK_ERROR_FEATURE_NOT_PRESENT;
+}
+
+VkResult vmaFindMemoryTypeIndexForBufferInfo(
+ VmaAllocator allocator,
+ const VkBufferCreateInfo* pBufferCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ uint32_t* pMemoryTypeIndex)
+{
+ VMA_ASSERT(allocator != VK_NULL_HANDLE);
+ VMA_ASSERT(pBufferCreateInfo != VMA_NULL);
+ VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
+ VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+ const VkDevice hDev = allocator->m_hDevice;
+ VkBuffer hBuffer = VK_NULL_HANDLE;
+ VkResult res = allocator->GetVulkanFunctions().vkCreateBuffer(
+ hDev, pBufferCreateInfo, allocator->GetAllocationCallbacks(), &hBuffer);
+ if(res == VK_SUCCESS)
+ {
+ VkMemoryRequirements memReq = {};
+ allocator->GetVulkanFunctions().vkGetBufferMemoryRequirements(
+ hDev, hBuffer, &memReq);
+
+ res = vmaFindMemoryTypeIndex(
+ allocator,
+ memReq.memoryTypeBits,
+ pAllocationCreateInfo,
+ pMemoryTypeIndex);
+
+ allocator->GetVulkanFunctions().vkDestroyBuffer(
+ hDev, hBuffer, allocator->GetAllocationCallbacks());
+ }
+ return res;
+}
+
+VkResult vmaFindMemoryTypeIndexForImageInfo(
+ VmaAllocator allocator,
+ const VkImageCreateInfo* pImageCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ uint32_t* pMemoryTypeIndex)
+{
+ VMA_ASSERT(allocator != VK_NULL_HANDLE);
+ VMA_ASSERT(pImageCreateInfo != VMA_NULL);
+ VMA_ASSERT(pAllocationCreateInfo != VMA_NULL);
+ VMA_ASSERT(pMemoryTypeIndex != VMA_NULL);
+
+ const VkDevice hDev = allocator->m_hDevice;
+ VkImage hImage = VK_NULL_HANDLE;
+ VkResult res = allocator->GetVulkanFunctions().vkCreateImage(
+ hDev, pImageCreateInfo, allocator->GetAllocationCallbacks(), &hImage);
+ if(res == VK_SUCCESS)
+ {
+ VkMemoryRequirements memReq = {};
+ allocator->GetVulkanFunctions().vkGetImageMemoryRequirements(
+ hDev, hImage, &memReq);
+
+ res = vmaFindMemoryTypeIndex(
+ allocator,
+ memReq.memoryTypeBits,
+ pAllocationCreateInfo,
+ pMemoryTypeIndex);
+
+ allocator->GetVulkanFunctions().vkDestroyImage(
+ hDev, hImage, allocator->GetAllocationCallbacks());
+ }
+ return res;
+}
+
+VkResult vmaCreatePool(
+ VmaAllocator allocator,
+ const VmaPoolCreateInfo* pCreateInfo,
+ VmaPool* pPool)
+{
+ VMA_ASSERT(allocator && pCreateInfo && pPool);
+
+ VMA_DEBUG_LOG("vmaCreatePool");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkResult res = allocator->CreatePool(pCreateInfo, pPool);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordCreatePool(allocator->GetCurrentFrameIndex(), *pCreateInfo, *pPool);
+ }
+#endif
+
+ return res;
+}
+
+void vmaDestroyPool(
+ VmaAllocator allocator,
+ VmaPool pool)
+{
+ VMA_ASSERT(allocator);
+
+ if(pool == VK_NULL_HANDLE)
+ {
+ return;
+ }
+
+ VMA_DEBUG_LOG("vmaDestroyPool");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordDestroyPool(allocator->GetCurrentFrameIndex(), pool);
+ }
+#endif
+
+ allocator->DestroyPool(pool);
+}
+
+void vmaGetPoolStats(
+ VmaAllocator allocator,
+ VmaPool pool,
+ VmaPoolStats* pPoolStats)
+{
+ VMA_ASSERT(allocator && pool && pPoolStats);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ allocator->GetPoolStats(pool, pPoolStats);
+}
+
+void vmaMakePoolAllocationsLost(
+ VmaAllocator allocator,
+ VmaPool pool,
+ size_t* pLostAllocationCount)
+{
+ VMA_ASSERT(allocator && pool);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordMakePoolAllocationsLost(allocator->GetCurrentFrameIndex(), pool);
+ }
+#endif
+
+ allocator->MakePoolAllocationsLost(pool, pLostAllocationCount);
+}
+
+VkResult vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool)
+{
+ VMA_ASSERT(allocator && pool);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VMA_DEBUG_LOG("vmaCheckPoolCorruption");
+
+ return allocator->CheckPoolCorruption(pool);
+}
+
+VkResult vmaAllocateMemory(
+ VmaAllocator allocator,
+ const VkMemoryRequirements* pVkMemoryRequirements,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation);
+
+ VMA_DEBUG_LOG("vmaAllocateMemory");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkResult result = allocator->AllocateMemory(
+ *pVkMemoryRequirements,
+ false, // requiresDedicatedAllocation
+ false, // prefersDedicatedAllocation
+ VK_NULL_HANDLE, // dedicatedBuffer
+ VK_NULL_HANDLE, // dedicatedImage
+ *pCreateInfo,
+ VMA_SUBALLOCATION_TYPE_UNKNOWN,
+ 1, // allocationCount
+ pAllocation);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordAllocateMemory(
+ allocator->GetCurrentFrameIndex(),
+ *pVkMemoryRequirements,
+ *pCreateInfo,
+ *pAllocation);
+ }
+#endif
+
+ if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
+ {
+ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+ }
+
+ return result;
+}
+
+VkResult vmaAllocateMemoryPages(
+ VmaAllocator allocator,
+ const VkMemoryRequirements* pVkMemoryRequirements,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ size_t allocationCount,
+ VmaAllocation* pAllocations,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ if(allocationCount == 0)
+ {
+ return VK_SUCCESS;
+ }
+
+ VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocations);
+
+ VMA_DEBUG_LOG("vmaAllocateMemoryPages");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkResult result = allocator->AllocateMemory(
+ *pVkMemoryRequirements,
+ false, // requiresDedicatedAllocation
+ false, // prefersDedicatedAllocation
+ VK_NULL_HANDLE, // dedicatedBuffer
+ VK_NULL_HANDLE, // dedicatedImage
+ *pCreateInfo,
+ VMA_SUBALLOCATION_TYPE_UNKNOWN,
+ allocationCount,
+ pAllocations);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordAllocateMemoryPages(
+ allocator->GetCurrentFrameIndex(),
+ *pVkMemoryRequirements,
+ *pCreateInfo,
+ (uint64_t)allocationCount,
+ pAllocations);
+ }
+#endif
+
+ if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS)
+ {
+ for(size_t i = 0; i < allocationCount; ++i)
+ {
+ allocator->GetAllocationInfo(pAllocations[i], pAllocationInfo + i);
+ }
+ }
+
+ return result;
+}
+
+VkResult vmaAllocateMemoryForBuffer(
+ VmaAllocator allocator,
+ VkBuffer buffer,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ VMA_ASSERT(allocator && buffer != VK_NULL_HANDLE && pCreateInfo && pAllocation);
+
+ VMA_DEBUG_LOG("vmaAllocateMemoryForBuffer");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkMemoryRequirements vkMemReq = {};
+ bool requiresDedicatedAllocation = false;
+ bool prefersDedicatedAllocation = false;
+ allocator->GetBufferMemoryRequirements(buffer, vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation);
+
+ VkResult result = allocator->AllocateMemory(
+ vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation,
+ buffer, // dedicatedBuffer
+ VK_NULL_HANDLE, // dedicatedImage
+ *pCreateInfo,
+ VMA_SUBALLOCATION_TYPE_BUFFER,
+ 1, // allocationCount
+ pAllocation);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordAllocateMemoryForBuffer(
+ allocator->GetCurrentFrameIndex(),
+ vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation,
+ *pCreateInfo,
+ *pAllocation);
+ }
+#endif
+
+ if(pAllocationInfo && result == VK_SUCCESS)
+ {
+ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+ }
+
+ return result;
+}
+
+VkResult vmaAllocateMemoryForImage(
+ VmaAllocator allocator,
+ VkImage image,
+ const VmaAllocationCreateInfo* pCreateInfo,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ VMA_ASSERT(allocator && image != VK_NULL_HANDLE && pCreateInfo && pAllocation);
+
+ VMA_DEBUG_LOG("vmaAllocateMemoryForImage");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkMemoryRequirements vkMemReq = {};
+ bool requiresDedicatedAllocation = false;
+ bool prefersDedicatedAllocation = false;
+ allocator->GetImageMemoryRequirements(image, vkMemReq,
+ requiresDedicatedAllocation, prefersDedicatedAllocation);
+
+ VkResult result = allocator->AllocateMemory(
+ vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation,
+ VK_NULL_HANDLE, // dedicatedBuffer
+ image, // dedicatedImage
+ *pCreateInfo,
+ VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN,
+ 1, // allocationCount
+ pAllocation);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordAllocateMemoryForImage(
+ allocator->GetCurrentFrameIndex(),
+ vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation,
+ *pCreateInfo,
+ *pAllocation);
+ }
+#endif
+
+ if(pAllocationInfo && result == VK_SUCCESS)
+ {
+ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+ }
+
+ return result;
+}
+
+void vmaFreeMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation)
+{
+ VMA_ASSERT(allocator);
+
+ if(allocation == VK_NULL_HANDLE)
+ {
+ return;
+ }
+
+ VMA_DEBUG_LOG("vmaFreeMemory");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordFreeMemory(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ allocator->FreeMemory(
+ 1, // allocationCount
+ &allocation);
+}
+
+void vmaFreeMemoryPages(
+ VmaAllocator allocator,
+ size_t allocationCount,
+ VmaAllocation* pAllocations)
+{
+ if(allocationCount == 0)
+ {
+ return;
+ }
+
+ VMA_ASSERT(allocator);
+
+ VMA_DEBUG_LOG("vmaFreeMemoryPages");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordFreeMemoryPages(
+ allocator->GetCurrentFrameIndex(),
+ (uint64_t)allocationCount,
+ pAllocations);
+ }
+#endif
+
+ allocator->FreeMemory(allocationCount, pAllocations);
+}
+
+VkResult vmaResizeAllocation(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VkDeviceSize newSize)
+{
+ VMA_ASSERT(allocator && allocation);
+
+ VMA_DEBUG_LOG("vmaResizeAllocation");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordResizeAllocation(
+ allocator->GetCurrentFrameIndex(),
+ allocation,
+ newSize);
+ }
+#endif
+
+ return allocator->ResizeAllocation(allocation, newSize);
+}
+
+void vmaGetAllocationInfo(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ VMA_ASSERT(allocator && allocation && pAllocationInfo);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordGetAllocationInfo(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ allocator->GetAllocationInfo(allocation, pAllocationInfo);
+}
+
+VkBool32 vmaTouchAllocation(
+ VmaAllocator allocator,
+ VmaAllocation allocation)
+{
+ VMA_ASSERT(allocator && allocation);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordTouchAllocation(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ return allocator->TouchAllocation(allocation);
+}
+
+void vmaSetAllocationUserData(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ void* pUserData)
+{
+ VMA_ASSERT(allocator && allocation);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ allocation->SetUserData(allocator, pUserData);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordSetAllocationUserData(
+ allocator->GetCurrentFrameIndex(),
+ allocation,
+ pUserData);
+ }
+#endif
+}
+
+void vmaCreateLostAllocation(
+ VmaAllocator allocator,
+ VmaAllocation* pAllocation)
+{
+ VMA_ASSERT(allocator && pAllocation);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK;
+
+ allocator->CreateLostAllocation(pAllocation);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordCreateLostAllocation(
+ allocator->GetCurrentFrameIndex(),
+ *pAllocation);
+ }
+#endif
+}
+
+VkResult vmaMapMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ void** ppData)
+{
+ VMA_ASSERT(allocator && allocation && ppData);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkResult res = allocator->Map(allocation, ppData);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordMapMemory(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ return res;
+}
+
+void vmaUnmapMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation)
+{
+ VMA_ASSERT(allocator && allocation);
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordUnmapMemory(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ allocator->Unmap(allocation);
+}
+
+void vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
+{
+ VMA_ASSERT(allocator && allocation);
+
+ VMA_DEBUG_LOG("vmaFlushAllocation");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordFlushAllocation(
+ allocator->GetCurrentFrameIndex(),
+ allocation, offset, size);
+ }
+#endif
+}
+
+void vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
+{
+ VMA_ASSERT(allocator && allocation);
+
+ VMA_DEBUG_LOG("vmaInvalidateAllocation");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordInvalidateAllocation(
+ allocator->GetCurrentFrameIndex(),
+ allocation, offset, size);
+ }
+#endif
+}
+
+VkResult vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits)
+{
+ VMA_ASSERT(allocator);
+
+ VMA_DEBUG_LOG("vmaCheckCorruption");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ return allocator->CheckCorruption(memoryTypeBits);
+}
+
+VkResult vmaDefragment(
+ VmaAllocator allocator,
+ VmaAllocation* pAllocations,
+ size_t allocationCount,
+ VkBool32* pAllocationsChanged,
+ const VmaDefragmentationInfo *pDefragmentationInfo,
+ VmaDefragmentationStats* pDefragmentationStats)
+{
+ // Deprecated interface, reimplemented using new one.
+
+ VmaDefragmentationInfo2 info2 = {};
+ info2.allocationCount = (uint32_t)allocationCount;
+ info2.pAllocations = pAllocations;
+ info2.pAllocationsChanged = pAllocationsChanged;
+ if(pDefragmentationInfo != VMA_NULL)
+ {
+ info2.maxCpuAllocationsToMove = pDefragmentationInfo->maxAllocationsToMove;
+ info2.maxCpuBytesToMove = pDefragmentationInfo->maxBytesToMove;
+ }
+ else
+ {
+ info2.maxCpuAllocationsToMove = UINT32_MAX;
+ info2.maxCpuBytesToMove = VK_WHOLE_SIZE;
+ }
+ // info2.flags, maxGpuAllocationsToMove, maxGpuBytesToMove, commandBuffer deliberately left zero.
+
+ VmaDefragmentationContext ctx;
+ VkResult res = vmaDefragmentationBegin(allocator, &info2, pDefragmentationStats, &ctx);
+ if(res == VK_NOT_READY)
+ {
+ res = vmaDefragmentationEnd( allocator, ctx);
+ }
+ return res;
+}
+
+VkResult vmaDefragmentationBegin(
+ VmaAllocator allocator,
+ const VmaDefragmentationInfo2* pInfo,
+ VmaDefragmentationStats* pStats,
+ VmaDefragmentationContext *pContext)
+{
+ VMA_ASSERT(allocator && pInfo && pContext);
+
+ // Degenerate case: Nothing to defragment.
+ if(pInfo->allocationCount == 0 && pInfo->poolCount == 0)
+ {
+ return VK_SUCCESS;
+ }
+
+ VMA_ASSERT(pInfo->allocationCount == 0 || pInfo->pAllocations != VMA_NULL);
+ VMA_ASSERT(pInfo->poolCount == 0 || pInfo->pPools != VMA_NULL);
+ VMA_HEAVY_ASSERT(VmaValidatePointerArray(pInfo->allocationCount, pInfo->pAllocations));
+ VMA_HEAVY_ASSERT(VmaValidatePointerArray(pInfo->poolCount, pInfo->pPools));
+
+ VMA_DEBUG_LOG("vmaDefragmentationBegin");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ VkResult res = allocator->DefragmentationBegin(*pInfo, pStats, pContext);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordDefragmentationBegin(
+ allocator->GetCurrentFrameIndex(), *pInfo, *pContext);
+ }
+#endif
+
+ return res;
+}
+
+VkResult vmaDefragmentationEnd(
+ VmaAllocator allocator,
+ VmaDefragmentationContext context)
+{
+ VMA_ASSERT(allocator);
+
+ VMA_DEBUG_LOG("vmaDefragmentationEnd");
+
+ if(context != VK_NULL_HANDLE)
+ {
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordDefragmentationEnd(
+ allocator->GetCurrentFrameIndex(), context);
+ }
+#endif
+
+ return allocator->DefragmentationEnd(context);
+ }
+ else
+ {
+ return VK_SUCCESS;
+ }
+}
+
+VkResult vmaBindBufferMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VkBuffer buffer)
+{
+ VMA_ASSERT(allocator && allocation && buffer);
+
+ VMA_DEBUG_LOG("vmaBindBufferMemory");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ return allocator->BindBufferMemory(allocation, buffer);
+}
+
+VkResult vmaBindImageMemory(
+ VmaAllocator allocator,
+ VmaAllocation allocation,
+ VkImage image)
+{
+ VMA_ASSERT(allocator && allocation && image);
+
+ VMA_DEBUG_LOG("vmaBindImageMemory");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ return allocator->BindImageMemory(allocation, image);
+}
+
+VkResult vmaCreateBuffer(
+ VmaAllocator allocator,
+ const VkBufferCreateInfo* pBufferCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ VkBuffer* pBuffer,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation);
+
+ if(pBufferCreateInfo->size == 0)
+ {
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+
+ VMA_DEBUG_LOG("vmaCreateBuffer");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ *pBuffer = VK_NULL_HANDLE;
+ *pAllocation = VK_NULL_HANDLE;
+
+ // 1. Create VkBuffer.
+ VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)(
+ allocator->m_hDevice,
+ pBufferCreateInfo,
+ allocator->GetAllocationCallbacks(),
+ pBuffer);
+ if(res >= 0)
+ {
+ // 2. vkGetBufferMemoryRequirements.
+ VkMemoryRequirements vkMemReq = {};
+ bool requiresDedicatedAllocation = false;
+ bool prefersDedicatedAllocation = false;
+ allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq,
+ requiresDedicatedAllocation, prefersDedicatedAllocation);
+
+ // Make sure alignment requirements for specific buffer usages reported
+ // in Physical Device Properties are included in alignment reported by memory requirements.
+ if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) != 0)
+ {
+ VMA_ASSERT(vkMemReq.alignment %
+ allocator->m_PhysicalDeviceProperties.limits.minTexelBufferOffsetAlignment == 0);
+ }
+ if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) != 0)
+ {
+ VMA_ASSERT(vkMemReq.alignment %
+ allocator->m_PhysicalDeviceProperties.limits.minUniformBufferOffsetAlignment == 0);
+ }
+ if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_STORAGE_BUFFER_BIT) != 0)
+ {
+ VMA_ASSERT(vkMemReq.alignment %
+ allocator->m_PhysicalDeviceProperties.limits.minStorageBufferOffsetAlignment == 0);
+ }
+
+ // 3. Allocate memory using allocator.
+ res = allocator->AllocateMemory(
+ vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation,
+ *pBuffer, // dedicatedBuffer
+ VK_NULL_HANDLE, // dedicatedImage
+ *pAllocationCreateInfo,
+ VMA_SUBALLOCATION_TYPE_BUFFER,
+ 1, // allocationCount
+ pAllocation);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordCreateBuffer(
+ allocator->GetCurrentFrameIndex(),
+ *pBufferCreateInfo,
+ *pAllocationCreateInfo,
+ *pAllocation);
+ }
+#endif
+
+ if(res >= 0)
+ {
+ // 3. Bind buffer with memory.
+ res = allocator->BindBufferMemory(*pAllocation, *pBuffer);
+ if(res >= 0)
+ {
+ // All steps succeeded.
+ #if VMA_STATS_STRING_ENABLED
+ (*pAllocation)->InitBufferImageUsage(pBufferCreateInfo->usage);
+ #endif
+ if(pAllocationInfo != VMA_NULL)
+ {
+ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+ }
+
+ return VK_SUCCESS;
+ }
+ allocator->FreeMemory(
+ 1, // allocationCount
+ pAllocation);
+ *pAllocation = VK_NULL_HANDLE;
+ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
+ *pBuffer = VK_NULL_HANDLE;
+ return res;
+ }
+ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks());
+ *pBuffer = VK_NULL_HANDLE;
+ return res;
+ }
+ return res;
+}
+
+void vmaDestroyBuffer(
+ VmaAllocator allocator,
+ VkBuffer buffer,
+ VmaAllocation allocation)
+{
+ VMA_ASSERT(allocator);
+
+ if(buffer == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
+ {
+ return;
+ }
+
+ VMA_DEBUG_LOG("vmaDestroyBuffer");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordDestroyBuffer(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ if(buffer != VK_NULL_HANDLE)
+ {
+ (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks());
+ }
+
+ if(allocation != VK_NULL_HANDLE)
+ {
+ allocator->FreeMemory(
+ 1, // allocationCount
+ &allocation);
+ }
+}
+
+VkResult vmaCreateImage(
+ VmaAllocator allocator,
+ const VkImageCreateInfo* pImageCreateInfo,
+ const VmaAllocationCreateInfo* pAllocationCreateInfo,
+ VkImage* pImage,
+ VmaAllocation* pAllocation,
+ VmaAllocationInfo* pAllocationInfo)
+{
+ VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation);
+
+ if(pImageCreateInfo->extent.width == 0 ||
+ pImageCreateInfo->extent.height == 0 ||
+ pImageCreateInfo->extent.depth == 0 ||
+ pImageCreateInfo->mipLevels == 0 ||
+ pImageCreateInfo->arrayLayers == 0)
+ {
+ return VK_ERROR_VALIDATION_FAILED_EXT;
+ }
+
+ VMA_DEBUG_LOG("vmaCreateImage");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+ *pImage = VK_NULL_HANDLE;
+ *pAllocation = VK_NULL_HANDLE;
+
+ // 1. Create VkImage.
+ VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)(
+ allocator->m_hDevice,
+ pImageCreateInfo,
+ allocator->GetAllocationCallbacks(),
+ pImage);
+ if(res >= 0)
+ {
+ VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ?
+ VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL :
+ VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR;
+
+ // 2. Allocate memory using allocator.
+ VkMemoryRequirements vkMemReq = {};
+ bool requiresDedicatedAllocation = false;
+ bool prefersDedicatedAllocation = false;
+ allocator->GetImageMemoryRequirements(*pImage, vkMemReq,
+ requiresDedicatedAllocation, prefersDedicatedAllocation);
+
+ res = allocator->AllocateMemory(
+ vkMemReq,
+ requiresDedicatedAllocation,
+ prefersDedicatedAllocation,
+ VK_NULL_HANDLE, // dedicatedBuffer
+ *pImage, // dedicatedImage
+ *pAllocationCreateInfo,
+ suballocType,
+ 1, // allocationCount
+ pAllocation);
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordCreateImage(
+ allocator->GetCurrentFrameIndex(),
+ *pImageCreateInfo,
+ *pAllocationCreateInfo,
+ *pAllocation);
+ }
+#endif
+
+ if(res >= 0)
+ {
+ // 3. Bind image with memory.
+ res = allocator->BindImageMemory(*pAllocation, *pImage);
+ if(res >= 0)
+ {
+ // All steps succeeded.
+ #if VMA_STATS_STRING_ENABLED
+ (*pAllocation)->InitBufferImageUsage(pImageCreateInfo->usage);
+ #endif
+ if(pAllocationInfo != VMA_NULL)
+ {
+ allocator->GetAllocationInfo(*pAllocation, pAllocationInfo);
+ }
+
+ return VK_SUCCESS;
+ }
+ allocator->FreeMemory(
+ 1, // allocationCount
+ pAllocation);
+ *pAllocation = VK_NULL_HANDLE;
+ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
+ *pImage = VK_NULL_HANDLE;
+ return res;
+ }
+ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks());
+ *pImage = VK_NULL_HANDLE;
+ return res;
+ }
+ return res;
+}
+
+void vmaDestroyImage(
+ VmaAllocator allocator,
+ VkImage image,
+ VmaAllocation allocation)
+{
+ VMA_ASSERT(allocator);
+
+ if(image == VK_NULL_HANDLE && allocation == VK_NULL_HANDLE)
+ {
+ return;
+ }
+
+ VMA_DEBUG_LOG("vmaDestroyImage");
+
+ VMA_DEBUG_GLOBAL_MUTEX_LOCK
+
+#if VMA_RECORDING_ENABLED
+ if(allocator->GetRecorder() != VMA_NULL)
+ {
+ allocator->GetRecorder()->RecordDestroyImage(
+ allocator->GetCurrentFrameIndex(),
+ allocation);
+ }
+#endif
+
+ if(image != VK_NULL_HANDLE)
+ {
+ (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks());
+ }
+ if(allocation != VK_NULL_HANDLE)
+ {
+ allocator->FreeMemory(
+ 1, // allocationCount
+ &allocation);
+ }
+}
+
+#endif // #ifdef VMA_IMPLEMENTATION
diff --git a/src/3rdparty/double-conversion/README b/src/3rdparty/double-conversion/README
deleted file mode 100644
index 75d08df5fe..0000000000
--- a/src/3rdparty/double-conversion/README
+++ /dev/null
@@ -1,8 +0,0 @@
-This is a copy of the library for binary-decimal and decimal-binary
-conversion routines for IEEE doubles, available from
-
- https://github.com/google/double-conversion
-
-commit 2fb03de56faa32bbba5e02222528e7b760f71d77
-
-See the LICENSE file for license information.
diff --git a/src/3rdparty/double-conversion/double-conversion.cc b/src/3rdparty/double-conversion/double-conversion.cc
index ecd1a5ef3f..8c52755cfb 100644
--- a/src/3rdparty/double-conversion/double-conversion.cc
+++ b/src/3rdparty/double-conversion/double-conversion.cc
@@ -38,6 +38,11 @@
#include <double-conversion/strtod.h>
#include <double-conversion/utils.h>
+// Fix warning C4244: 'argument': conversion from 'const uc16' to 'char', possible loss of data
+#ifdef _MSC_VER
+ __pragma(warning(disable: 4244))
+#endif
+
namespace double_conversion {
const DoubleToStringConverter& DoubleToStringConverter::EcmaScriptConverter() {
@@ -250,6 +255,12 @@ bool DoubleToStringConverter::ToExponential(
const int kDecimalRepCapacity = kMaxExponentialDigits + 2;
ASSERT(kDecimalRepCapacity > kBase10MaximalLength);
char decimal_rep[kDecimalRepCapacity];
+#ifndef NDEBUG
+ // Problem: there is an assert in StringBuilder::AddSubstring() that
+ // will pass this buffer to strlen(), and this buffer is not generally
+ // null-terminated.
+ memset(decimal_rep, 0, sizeof(decimal_rep));
+#endif
int decimal_rep_length;
if (requested_digits == -1) {
@@ -529,7 +540,7 @@ static double SignedZero(bool sign) {
// because it constant-propagated the radix and concluded that the last
// condition was always true. By moving it into a separate function the
// compiler wouldn't warn anymore.
-#if _MSC_VER
+#ifdef _MSC_VER
#pragma optimize("",off)
static bool IsDecimalDigitForRadix(int c, int radix) {
return '0' <= c && c <= '9' && (c - '0') < radix;
@@ -553,7 +564,7 @@ static bool IsCharacterDigitForRadix(int c, int radix, char a_character) {
// Returns true, when the iterator is equal to end.
template<class Iterator>
-static bool Advance (Iterator* it, char separator, int base, Iterator& end) {
+static bool Advance (Iterator* it, uc16 separator, int base, Iterator& end) {
if (separator == StringToDoubleConverter::kNoSeparator) {
++(*it);
return *it == end;
@@ -581,7 +592,7 @@ static bool Advance (Iterator* it, char separator, int base, Iterator& end) {
template<class Iterator>
static bool IsHexFloatString(Iterator start,
Iterator end,
- char separator,
+ uc16 separator,
bool allow_trailing_junk) {
ASSERT(start != end);
@@ -598,8 +609,8 @@ static bool IsHexFloatString(Iterator start,
saw_digit = true;
if (Advance(&current, separator, 16, end)) return false;
}
- if (!saw_digit) return false; // Only the '.', but no digits.
}
+ if (!saw_digit) return false;
if (*current != 'p' && *current != 'P') return false;
if (Advance(&current, separator, 16, end)) return false;
if (*current == '+' || *current == '-') {
@@ -622,7 +633,7 @@ template <int radix_log_2, class Iterator>
static double RadixStringToIeee(Iterator* current,
Iterator end,
bool sign,
- char separator,
+ uc16 separator,
bool parse_as_hex_float,
bool allow_trailing_junk,
double junk_string_value,
@@ -757,7 +768,11 @@ static double RadixStringToIeee(Iterator* current,
}
int written_exponent = 0;
while (IsDecimalDigitForRadix(**current, 10)) {
- written_exponent = 10 * written_exponent + **current - '0';
+ // No need to read exponents if they are too big. That could potentially overflow
+ // the `written_exponent` variable.
+ if (abs(written_exponent) <= 100 * Double::kMaxExponent) {
+ written_exponent = 10 * written_exponent + **current - '0';
+ }
if (Advance(current, separator, radix, end)) break;
}
if (is_negative) written_exponent = -written_exponent;
@@ -893,10 +908,11 @@ double StringToDoubleConverter::StringToIeee(
(*current == 'x' || *current == 'X')) {
++current;
+ if (current == end) return junk_string_value_; // "0x"
+
bool parse_as_hex_float = (flags_ & ALLOW_HEX_FLOATS) &&
IsHexFloatString(current, end, separator_, allow_trailing_junk);
- if (current == end) return junk_string_value_; // "0x"
if (!parse_as_hex_float && !isDigit(*current, 16)) {
return junk_string_value_;
}
diff --git a/src/3rdparty/double-conversion/double-conversion.pri b/src/3rdparty/double-conversion/double-conversion.pri
index 6564f960d4..395c4682f9 100644
--- a/src/3rdparty/double-conversion/double-conversion.pri
+++ b/src/3rdparty/double-conversion/double-conversion.pri
@@ -1,4 +1,4 @@
-INCLUDEPATH += $$PWD/.. $$PWD/include $$PWD/include/double-conversion
+INCLUDEPATH += $$PWD/.. $$PWD/include
SOURCES += \
$$PWD/bignum.cc \
$$PWD/bignum-dtoa.cc \
@@ -20,5 +20,3 @@ HEADERS += \
$$PWD/ieee.h \
$$PWD/strtod.h \
$$PWD/include/double-conversion/utils.h
-
-OTHER_FILES += README
diff --git a/src/3rdparty/double-conversion/ieee.h b/src/3rdparty/double-conversion/ieee.h
index baaeced31c..6d23cc71cf 100644
--- a/src/3rdparty/double-conversion/ieee.h
+++ b/src/3rdparty/double-conversion/ieee.h
@@ -47,6 +47,8 @@ class Double {
static const uint64_t kHiddenBit = UINT64_2PART_C(0x00100000, 00000000);
static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit.
static const int kSignificandSize = 53;
+ static const int kExponentBias = 0x3FF + kPhysicalSignificandSize;
+ static const int kMaxExponent = 0x7FF - kExponentBias;
Double() : d64_(0) {}
explicit Double(double d) : d64_(double_to_uint64(d)) {}
@@ -222,9 +224,7 @@ class Double {
}
private:
- static const int kExponentBias = 0x3FF + kPhysicalSignificandSize;
static const int kDenormalExponent = -kExponentBias + 1;
- static const int kMaxExponent = 0x7FF - kExponentBias;
static const uint64_t kInfinity = UINT64_2PART_C(0x7FF00000, 00000000);
static const uint64_t kNaN = UINT64_2PART_C(0x7FF80000, 00000000);
diff --git a/src/3rdparty/double-conversion/include/double-conversion/utils.h b/src/3rdparty/double-conversion/include/double-conversion/utils.h
index 7622fe6162..70e697ca00 100644
--- a/src/3rdparty/double-conversion/include/double-conversion/utils.h
+++ b/src/3rdparty/double-conversion/include/double-conversion/utils.h
@@ -56,6 +56,13 @@ inline void abort_noreturn() { abort(); }
#endif
#endif
+#ifndef DOUBLE_CONVERSION_UNUSED
+#ifdef __GNUC__
+#define DOUBLE_CONVERSION_UNUSED __attribute__((unused))
+#else
+#define DOUBLE_CONVERSION_UNUSED
+#endif
+#endif
// Double operations detection based on target architecture.
// Linux uses a 80bit wide floating point stack on x86. This induces double
@@ -91,10 +98,11 @@ int main(int argc, char** argv) {
defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
defined(__SH4__) || defined(__alpha__) || \
- defined(_MIPS_ARCH_MIPS32R2) || \
+ defined(_MIPS_ARCH_MIPS32R2) || defined(__ARMEB__) ||\
defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \
- defined(__riscv) || defined(__EMSCRIPTEN__) || \
- defined(__or1k__)
+ defined(__riscv) || \
+ defined(__or1k__) || defined(__arc__) || \
+ defined(__EMSCRIPTEN__)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(__mc68000__) || \
defined(__pnacl__) || defined(__native_client__)
@@ -343,6 +351,7 @@ inline Dest BitCast(const Source& source) {
static_assert(sizeof(Dest) == sizeof(Source),
"source and destination size mismatch");
#else
+ DOUBLE_CONVERSION_UNUSED
typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
#endif
diff --git a/src/3rdparty/double-conversion/qt_attribution.json b/src/3rdparty/double-conversion/qt_attribution.json
index 1d244a69b4..86193e3b50 100644
--- a/src/3rdparty/double-conversion/qt_attribution.json
+++ b/src/3rdparty/double-conversion/qt_attribution.json
@@ -5,8 +5,8 @@
"QtUsage": "Used in Qt Core. Configure with -system-doubleconversion or -no-doubleconversion to avoid.",
"Homepage": "https://github.com/google/double-conversion",
- "Version": "3.1.1",
- "DownloadLocation": "https://github.com/google/double-conversion/commit/4199ef3d456ed0549e5665cf4186f0ee6210db3b",
+ "Version": "3.1.5",
+ "DownloadLocation": "https://github.com/google/double-conversion/commit/5fa81e88ef24e735b4283b8f7454dc59693ac1fc",
"License": "BSD 3-clause \"New\" or \"Revised\" License",
"LicenseId": "BSD-3-Clause",
"LicenseFile": "LICENSE",
diff --git a/src/3rdparty/forkfd/forkfd.c b/src/3rdparty/forkfd/forkfd.c
index bef109e401..e4f3bd85de 100644
--- a/src/3rdparty/forkfd/forkfd.c
+++ b/src/3rdparty/forkfd/forkfd.c
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2019 Intel Corporation.
** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -59,9 +59,6 @@
# define HAVE_PIPE2 1
# endif
#endif
-#if defined(__FreeBSD__) && __FreeBSD__ >= 9
-# include <sys/procdesc.h>
-#endif
#if _POSIX_VERSION-0 >= 200809L || _XOPEN_VERSION-0 >= 500
# define HAVE_WAITID 1
@@ -93,9 +90,11 @@
# endif
#endif
-#ifndef FFD_ATOMIC_RELAXED
-# include "forkfd_gcc.h"
-#endif
+#include "forkfd_atomic.h"
+
+static int system_has_forkfd(void);
+static int system_forkfd(int flags, pid_t *ppid, int *system);
+static int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage);
#define CHILDREN_IN_SMALL_ARRAY 16
#define CHILDREN_IN_BIG_ARRAY 256
@@ -267,7 +266,7 @@ static int tryReaping(pid_t pid, struct pipe_payload *payload)
static void freeInfo(Header *header, ProcessInfo *entry)
{
entry->deathPipe = -1;
- entry->pid = 0;
+ ffd_atomic_store(&entry->pid, 0, FFD_ATOMIC_RELEASE);
(void)ffd_atomic_add_fetch(&header->busyCount, -1, FFD_ATOMIC_RELEASE);
assert(header->busyCount >= 0);
@@ -448,6 +447,37 @@ static void ignore_sigpipe()
#endif
}
+#if defined(__GNUC__) && (!defined(__FreeBSD__) || __FreeBSD__ < 10)
+__attribute((destructor, unused)) static void cleanup();
+#endif
+
+static void cleanup()
+{
+ BigArray *array;
+ /* This function is not thread-safe!
+ * It must only be called when the process is shutting down.
+ * At shutdown, we expect no one to be calling forkfd(), so we don't
+ * need to be thread-safe with what is done there.
+ *
+ * But SIGCHLD might be delivered to any thread, including this one.
+ * There's no way to prevent that. The correct solution would be to
+ * cooperatively delete. We don't do that.
+ */
+ if (ffd_atomic_load(&forkfd_status, FFD_ATOMIC_RELAXED) == 0)
+ return;
+
+ /* notify the handler that we're no longer in operation */
+ ffd_atomic_store(&forkfd_status, 0, FFD_ATOMIC_RELAXED);
+
+ /* free any arrays we might have */
+ array = ffd_atomic_load(&children.header.nextArray, FFD_ATOMIC_ACQUIRE);
+ while (array != NULL) {
+ BigArray *next = ffd_atomic_load(&array->header.nextArray, FFD_ATOMIC_ACQUIRE);
+ free(array);
+ array = next;
+ }
+}
+
static void forkfd_initialize()
{
#if defined(HAVE_BROKEN_WAITID)
@@ -489,44 +519,15 @@ static void forkfd_initialize()
ignore_sigpipe();
#endif
-#ifndef __GNUC__
+#ifdef __GNUC__
+ (void) cleanup; /* suppress unused static function warning */
+#else
atexit(cleanup);
#endif
ffd_atomic_store(&forkfd_status, 1, FFD_ATOMIC_RELAXED);
}
-#ifdef __GNUC__
-__attribute((destructor, unused)) static void cleanup();
-#endif
-
-static void cleanup()
-{
- BigArray *array;
- /* This function is not thread-safe!
- * It must only be called when the process is shutting down.
- * At shutdown, we expect no one to be calling forkfd(), so we don't
- * need to be thread-safe with what is done there.
- *
- * But SIGCHLD might be delivered to any thread, including this one.
- * There's no way to prevent that. The correct solution would be to
- * cooperatively delete. We don't do that.
- */
- if (ffd_atomic_load(&forkfd_status, FFD_ATOMIC_RELAXED) == 0)
- return;
-
- /* notify the handler that we're no longer in operation */
- ffd_atomic_store(&forkfd_status, 0, FFD_ATOMIC_RELAXED);
-
- /* free any arrays we might have */
- array = children.header.nextArray;
- while (array != NULL) {
- BigArray *next = array->header.nextArray;
- free(array);
- array = next;
- }
-}
-
static int create_pipe(int filedes[], int flags)
{
int ret = -1;
@@ -565,55 +566,6 @@ static int create_pipe(int filedes[], int flags)
return ret;
}
-#if defined(FORKFD_NO_SPAWNFD) && defined(__FreeBSD__) && __FreeBSD__ >= 9
-# if __FreeBSD__ == 9
-/* PROCDESC is an optional feature in the kernel and wasn't enabled
- * by default on FreeBSD 9. So we need to check for it at runtime. */
-static ffd_atomic_int system_has_forkfd = FFD_ATOMIC_INIT(1);
-# else
-/* On FreeBSD 10, PROCDESC was enabled by default. On v11, it's not an option
- * anymore and can't be disabled. */
-static const int system_has_forkfd = 1;
-# endif
-
-static int system_forkfd(int flags, pid_t *ppid)
-{
- int ret;
- pid_t pid;
- pid = pdfork(&ret, PD_DAEMON);
- if (__builtin_expect(pid == -1, 0)) {
-# if __FreeBSD__ == 9
- if (errno == ENOSYS) {
- /* PROCDESC wasn't compiled into the kernel: don't try it again. */
- ffd_atomic_store(&system_has_forkfd, 0, FFD_ATOMIC_RELAXED);
- }
-# endif
- return -1;
- }
- if (pid == 0) {
- /* child process */
- return FFD_CHILD_PROCESS;
- }
-
- /* parent process */
- if (flags & FFD_CLOEXEC)
- fcntl(ret, F_SETFD, FD_CLOEXEC);
- if (flags & FFD_NONBLOCK)
- fcntl(ret, F_SETFL, fcntl(ret, F_GETFL) | O_NONBLOCK);
- if (ppid)
- *ppid = pid;
- return ret;
-}
-#else
-static const int system_has_forkfd = 0;
-static int system_forkfd(int flags, pid_t *ppid)
-{
- (void)flags;
- (void)ppid;
- return -1;
-}
-#endif
-
#ifndef FORKFD_NO_FORKFD
/**
* @brief forkfd returns a file descriptor representing a child process
@@ -661,11 +613,9 @@ int forkfd(int flags, pid_t *ppid)
int efd;
#endif
- if (system_has_forkfd) {
- ret = system_forkfd(flags, ppid);
- if (system_has_forkfd)
- return ret;
- }
+ fd = system_forkfd(flags, ppid, &ret);
+ if (ret)
+ return fd;
(void) pthread_once(&forkfd_initialization, forkfd_initialize);
@@ -790,7 +740,7 @@ int spawnfd(int flags, pid_t *ppid, const char *path, const posix_spawn_file_act
/* we can only do work if we have a way to start the child in stopped mode;
* otherwise, we have a major race condition. */
- assert(!system_has_forkfd);
+ assert(!system_has_forkfd());
(void) pthread_once(&forkfd_initialization, forkfd_initialize);
@@ -843,30 +793,13 @@ out:
#endif // _POSIX_SPAWN && !FORKFD_NO_SPAWNFD
-int forkfd_wait(int ffd, forkfd_info *info, struct rusage *rusage)
+int forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
{
struct pipe_payload payload;
int ret;
- if (system_has_forkfd) {
-#if defined(__FreeBSD__) && __FreeBSD__ >= 9
- pid_t pid;
- int status;
- int options = WEXITED;
-
- ret = pdgetpid(ffd, &pid);
- if (ret == -1)
- return ret;
- ret = fcntl(ffd, F_GETFL);
- if (ret == -1)
- return ret;
- options |= (ret & O_NONBLOCK) ? WNOHANG : 0;
- ret = wait4(pid, &status, options, rusage);
- if (ret != -1 && info)
- convertStatusToForkfdInfo(status, info);
- return ret == -1 ? -1 : 0;
-#endif
- }
+ if (system_has_forkfd())
+ return system_forkfd_wait(ffd, info, rusage);
ret = read(ffd, &payload, sizeof(payload));
if (ret == -1)
@@ -886,3 +819,28 @@ int forkfd_close(int ffd)
{
return close(ffd);
}
+
+#if defined(__FreeBSD__) && __FreeBSD__ >= 9
+# include "forkfd_freebsd.c"
+#else
+int system_has_forkfd()
+{
+ return 0;
+}
+
+int system_forkfd(int flags, pid_t *ppid, int *system)
+{
+ (void)flags;
+ (void)ppid;
+ *system = 0;
+ return -1;
+}
+
+int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
+{
+ (void)ffd;
+ (void)info;
+ (void)rusage;
+ return -1;
+}
+#endif
diff --git a/src/3rdparty/forkfd/forkfd.h b/src/3rdparty/forkfd/forkfd.h
index 958321c299..eb121de593 100644
--- a/src/3rdparty/forkfd/forkfd.h
+++ b/src/3rdparty/forkfd/forkfd.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2019 Intel Corporation.
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,7 @@
#include <fcntl.h>
#include <stdint.h>
+#include <sys/wait.h>
#include <unistd.h> // to get the POSIX flags
#if _POSIX_SPAWN > 0
@@ -48,7 +49,7 @@ struct forkfd_info {
};
int forkfd(int flags, pid_t *ppid);
-int forkfd_wait(int ffd, forkfd_info *info, struct rusage *rusage);
+int forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage);
int forkfd_close(int ffd);
#if _POSIX_SPAWN > 0
diff --git a/src/3rdparty/forkfd/forkfd_atomic.h b/src/3rdparty/forkfd/forkfd_atomic.h
new file mode 100644
index 0000000000..394e30d26c
--- /dev/null
+++ b/src/3rdparty/forkfd/forkfd_atomic.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Intel Corporation.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a copy
+** of this software and associated documentation files (the "Software"), to deal
+** in the Software without restriction, including without limitation the rights
+** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+** copies of the Software, and to permit persons to whom the Software is
+** furnished to do so, subject to the following conditions:
+**
+** The above copyright notice and this permission notice shall be included in
+** all copies or substantial portions of the Software.
+**
+** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+** THE SOFTWARE.
+**
+****************************************************************************/
+
+#if !defined(FFD_ATOMIC_H) & !defined(FFD_ATOMIC_RELAXED)
+#define FFD_ATOMIC_H
+
+#if defined(__cplusplus) && __cplusplus >= 201103L
+# include "forkfd_c11.h"
+#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
+# include "forkfd_c11.h"
+#elif defined(__GNUC__)
+# include "forkfd_gcc.h"
+#endif
+
+#endif /* FFD_ATOMIC_h && FFD_ATOMIC_RELAXED */
+#ifndef FFD_ATOMIC_RELAXED
+# error "Could not determine atomics for this platform"
+#endif
diff --git a/src/3rdparty/forkfd/forkfd_c11.h b/src/3rdparty/forkfd/forkfd_c11.h
new file mode 100644
index 0000000000..f3dc2b5357
--- /dev/null
+++ b/src/3rdparty/forkfd/forkfd_c11.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Intel Corporation.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a copy
+** of this software and associated documentation files (the "Software"), to deal
+** in the Software without restriction, including without limitation the rights
+** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+** copies of the Software, and to permit persons to whom the Software is
+** furnished to do so, subject to the following conditions:
+**
+** The above copyright notice and this permission notice shall be included in
+** all copies or substantial portions of the Software.
+**
+** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+** THE SOFTWARE.
+**
+****************************************************************************/
+
+#ifndef FFD_ATOMIC_C11_H
+#define FFD_ATOMIC_C11_H
+
+/* atomics */
+/* Using the C11 <stdatomic.h> header or C++11's <atomic>
+ */
+
+#if defined(__cplusplus)
+# include <atomic>
+# define ffd_atomic_pointer(type) std::atomic<type*>
+# define FFD_ATOMIC_RELAXED std::memory_order_relaxed
+# define FFD_ATOMIC_ACQUIRE std::memory_order_acquire
+# define FFD_ATOMIC_RELEASE std::memory_order_release
+// acq_rel & cst not necessary
+typedef std::atomic_int ffd_atomic_int;
+#else
+# include <stdatomic.h>
+# define ffd_atomic_pointer(type) _Atomic(type*)
+# define FFD_ATOMIC_RELAXED memory_order_relaxed
+# define FFD_ATOMIC_ACQUIRE memory_order_acquire
+# define FFD_ATOMIC_RELEASE memory_order_release
+// acq_rel & cst not necessary
+
+typedef atomic_int ffd_atomic_int;
+#endif
+
+#define FFD_ATOMIC_INIT(val) ATOMIC_VAR_INIT(val)
+
+#define ffd_atomic_load(ptr, order) \
+ atomic_load_explicit(ptr, order)
+#define ffd_atomic_store(ptr, val, order) \
+ atomic_store_explicit(ptr, val, order)
+#define ffd_atomic_exchange(ptr,val,order) \
+ atomic_exchange_explicit(ptr, val, order)
+#define ffd_atomic_compare_exchange(ptr, expected, desired, order1, order2) \
+ atomic_compare_exchange_strong_explicit(ptr, expected, desired, order1, order2)
+#define ffd_atomic_add_fetch(ptr, val, order) \
+ (atomic_fetch_add_explicit(ptr, val, order) + (val))
+
+#endif
diff --git a/src/3rdparty/forkfd/forkfd_freebsd.c b/src/3rdparty/forkfd/forkfd_freebsd.c
new file mode 100644
index 0000000000..77ce3fcfad
--- /dev/null
+++ b/src/3rdparty/forkfd/forkfd_freebsd.c
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Intel Corporation.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a copy
+** of this software and associated documentation files (the "Software"), to deal
+** in the Software without restriction, including without limitation the rights
+** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+** copies of the Software, and to permit persons to whom the Software is
+** furnished to do so, subject to the following conditions:
+**
+** The above copyright notice and this permission notice shall be included in
+** all copies or substantial portions of the Software.
+**
+** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+** THE SOFTWARE.
+**
+****************************************************************************/
+
+#include "forkfd.h"
+
+#include <sys/types.h>
+#include <sys/procdesc.h>
+
+#include "forkfd_atomic.h"
+
+#if __FreeBSD__ >= 10
+/* On FreeBSD 10, PROCDESC was enabled by default. On v11, it's not an option
+ * anymore and can't be disabled. */
+static ffd_atomic_int system_forkfd_state = FFD_ATOMIC_INIT(1);
+#else
+static ffd_atomic_int system_forkfd_state = FFD_ATOMIC_INIT(0);
+#endif
+
+int system_has_forkfd()
+{
+ return ffd_atomic_load(&system_forkfd_state, FFD_ATOMIC_RELAXED) > 0;
+}
+
+int system_forkfd(int flags, pid_t *ppid, int *system)
+{
+ int ret;
+ pid_t pid;
+
+ int state = ffd_atomic_load(&system_forkfd_state, FFD_ATOMIC_RELAXED);
+ *system = 0;
+ if (state < 0)
+ return -1;
+
+ pid = pdfork(&ret, PD_DAEMON);
+# if __FreeBSD__ == 9
+ if (state == 0 && pid != 0) {
+ /* Parent process: remember whether PROCDESC was compiled into the kernel */
+ state = (pid == -1 && errno == ENOSYS) ? -1 : 1;
+ ffd_atomic_store(&system_forkfd_state, state, FFD_ATOMIC_RELAXED);
+ }
+ if (state < 0)
+ return -1;
+# endif
+ *system = 1;
+ if (__builtin_expect(pid == -1, 0))
+ return -1;
+
+ if (pid == 0) {
+ /* child process */
+ return FFD_CHILD_PROCESS;
+ }
+
+ /* parent process */
+ if (flags & FFD_CLOEXEC)
+ fcntl(ret, F_SETFD, FD_CLOEXEC);
+ if (flags & FFD_NONBLOCK)
+ fcntl(ret, F_SETFL, fcntl(ret, F_GETFL) | O_NONBLOCK);
+ if (ppid)
+ *ppid = pid;
+ return ret;
+}
+
+int system_forkfd_wait(int ffd, struct forkfd_info *info, struct rusage *rusage)
+{
+ pid_t pid;
+ int status;
+ int options = WEXITED;
+
+ int ret = pdgetpid(ffd, &pid);
+ if (ret == -1)
+ return ret;
+ ret = fcntl(ffd, F_GETFL);
+ if (ret == -1)
+ return ret;
+ options |= (ret & O_NONBLOCK) ? WNOHANG : 0;
+ ret = wait4(pid, &status, options, rusage);
+ if (ret != -1 && info)
+ convertStatusToForkfdInfo(status, info);
+ return ret == -1 ? -1 : 0;
+}
diff --git a/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties b/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties
index bf3de21830..4b7e1f3d38 100644
--- a/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties
+++ b/src/3rdparty/gradle/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
index 704ea9774a..de3bcb2bbf 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
@@ -1471,7 +1471,7 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv
while (finalOrder[toMove].form && fixed < len-1) {
IDEBUG(" fixed = %d, toMove=%d, moving form %d with pos %d", fixed, toMove, finalOrder[toMove].form, finalOrder[toMove].position);
for (i = fixed; i < len; i++) {
-// IDEBUG() << " i=" << i << "uc=" << hex << uc[i] << "form=" << form(uc[i])
+// IDEBUG() << " i=" << i << "uc=" << Qt::hex << uc[i] << "form=" << form(uc[i])
// << "position=" << position[i];
if (form(uc[i]) == finalOrder[toMove].form &&
position[i] == finalOrder[toMove].position) {
diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
index 10818c565c..16f469029b 100644
--- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp
+++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
@@ -370,7 +370,7 @@ void tst_QScriptEngine::greek()
QString str;
str.append(uc);
if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
- //qDebug() << "skipping" << hex << uc;
+ //qDebug() << "skipping" << Qt::hex << uc;
continue;
}
if (uc == 0x1fc1 || uc == 0x1fed)
@@ -389,7 +389,7 @@ void tst_QScriptEngine::greek()
QString str;
str.append(uc);
if (str.normalized(QString::NormalizationForm_D).normalized(QString::NormalizationForm_C) != str) {
- //qDebug() << "skipping" << hex << uc;
+ //qDebug() << "skipping" << Qt::hex << uc;
continue;
}
if (uc == 0x1fc1 || uc == 0x1fed)
diff --git a/src/3rdparty/libjpeg/jconfig.h b/src/3rdparty/libjpeg/jconfig.h
index 3f6a7f6b3c..fb1e88ae29 100644
--- a/src/3rdparty/libjpeg/jconfig.h
+++ b/src/3rdparty/libjpeg/jconfig.h
@@ -2,7 +2,7 @@
#define JPEG_LIB_VERSION 80
-#define LIBJPEG_TURBO_VERSION 2.0.2
+#define LIBJPEG_TURBO_VERSION 2.0.3
#define LIBJPEG_TURBO_VERSION_NUMBER 2000002
diff --git a/src/3rdparty/libjpeg/jconfigint.h b/src/3rdparty/libjpeg/jconfigint.h
index c3549bfd25..6616918509 100644
--- a/src/3rdparty/libjpeg/jconfigint.h
+++ b/src/3rdparty/libjpeg/jconfigint.h
@@ -8,7 +8,7 @@
#define PACKAGE_NAME "libjpeg-turbo"
-#define VERSION "2.0.0"
+#define VERSION "2.0.3"
#if SIZE_MAX == 0xffffffff
#define SIZEOF_SIZE_T 4
diff --git a/src/3rdparty/libjpeg/qt_attribution.json b/src/3rdparty/libjpeg/qt_attribution.json
index d1497bc20f..fa81529968 100644
--- a/src/3rdparty/libjpeg/qt_attribution.json
+++ b/src/3rdparty/libjpeg/qt_attribution.json
@@ -6,7 +6,7 @@
"Description": "The Independent JPEG Group's JPEG software",
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
- "Version": "2.0.2",
+ "Version": "2.0.3",
"License": "Independent JPEG Group License",
"LicenseId": "IJG",
"LicenseFile": "LICENSE",
diff --git a/src/3rdparty/libjpeg/src/ChangeLog.md b/src/3rdparty/libjpeg/src/ChangeLog.md
index 7cf92c30fd..3667d120b1 100644
--- a/src/3rdparty/libjpeg/src/ChangeLog.md
+++ b/src/3rdparty/libjpeg/src/ChangeLog.md
@@ -1,3 +1,41 @@
+2.0.3
+=====
+
+### Significant changes relative to 2.0.2:
+
+1. Fixed "using JNI after critical get" errors that occurred on Android
+platforms when passing invalid arguments to certain methods in the TurboJPEG
+Java API.
+
+2. Fixed a regression in the SIMD feature detection code, introduced by
+the AVX2 SIMD extensions (2.0 beta1[1]), that was known to cause an illegal
+instruction exception, in rare cases, on CPUs that lack support for CPUID leaf
+07H (or on which the maximum CPUID leaf has been limited by way of a BIOS
+setting.)
+
+3. The 4:4:0 (h1v2) fancy (smooth) chroma upsampling algorithm in the
+decompressor now uses a similar bias pattern to that of the 4:2:2 (h2v1) fancy
+chroma upsampling algorithm, rounding up or down the upsampled result for
+alternate pixels rather than always rounding down. This ensures that,
+regardless of whether a 4:2:2 JPEG image is rotated or transposed prior to
+decompression (in the frequency domain) or after decompression (in the spatial
+domain), the final image will be similar.
+
+4. Fixed an integer overflow and subsequent segfault that occurred when
+attempting to compress or decompress images with more than 1 billion pixels
+using the TurboJPEG API.
+
+5. Fixed a regression introduced by 2.0 beta1[15] whereby attempting to
+generate a progressive JPEG image on an SSE2-capable CPU using a scan script
+containing one or more scans with lengths divisible by 16 would result in an
+error ("Missing Huffman code table entry") and an invalid JPEG image.
+
+6. Fixed an issue whereby `tjDecodeYUV()` and `tjDecodeYUVPlanes()` would throw
+an error ("Invalid progressive parameters") or a warning ("Inconsistent
+progression sequence") if passed a TurboJPEG instance that was previously used
+to decompress a progressive JPEG image.
+
+
2.0.2
=====
diff --git a/src/3rdparty/libjpeg/src/README.md b/src/3rdparty/libjpeg/src/README.md
index a769259891..c61b855644 100644
--- a/src/3rdparty/libjpeg/src/README.md
+++ b/src/3rdparty/libjpeg/src/README.md
@@ -135,12 +135,11 @@ without recompiling. libjpeg-turbo does not claim to support all of the
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
cases (see below.)
-By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
-an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
-version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
-programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
-The following section describes which libjpeg v7+ features are supported and
-which aren't.
+By passing an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you
+can build a version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so
+that programs that are built against libjpeg v7 or v8 can be run with
+libjpeg-turbo. The following section describes which libjpeg v7+ features are
+supported and which aren't.
### Support for libjpeg v7 and v8 Features
@@ -247,9 +246,8 @@ don't, and it allows those functions to be provided in the "official"
libjpeg-turbo binaries.
Those who are concerned about maintaining strict conformance with the libjpeg
-v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
-an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
-libjpeg-turbo. This will restore the pre-1.3 behavior, in which
+v6b or v7 API can pass an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to
+building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
libjpeg v8 API/ABI.
@@ -344,3 +342,15 @@ quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
function in those cases. This causes performance to drop by as much as 40%.
It is therefore strongly advised that you use the slow integer forward DCT
whenever encoding images with a JPEG quality of 98 or higher.
+
+
+Memory Debugger Pitfalls
+========================
+
+Valgrind and Memory Sanitizer (MSan) can generate false positives
+(specifically, incorrect reports of uninitialized memory accesses) when used
+with libjpeg-turbo's SIMD extensions. It is generally recommended that the
+SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
+to `cmake` when configuring the build or by setting the environment variable
+`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
+MSan, or other memory debuggers.
diff --git a/src/3rdparty/libjpeg/src/jchuff.c b/src/3rdparty/libjpeg/src/jchuff.c
index 939b3e76a1..526203e3db 100644
--- a/src/3rdparty/libjpeg/src/jchuff.c
+++ b/src/3rdparty/libjpeg/src/jchuff.c
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
- * Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
+ * Copyright (C) 2009-2011, 2014-2016, 2018-2019, D. R. Commander.
* Copyright (C) 2015, Matthieu Darbois.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
@@ -356,6 +356,8 @@ dump_buffer(working_state *state)
put_buffer = (put_buffer << size) | code; \
}
+#if SIZEOF_SIZE_T != 8 && !defined(_WIN64)
+
#define CHECKBUF15() { \
if (put_bits > 15) { \
EMIT_BYTE() \
@@ -363,6 +365,8 @@ dump_buffer(working_state *state)
} \
}
+#endif
+
#define CHECKBUF31() { \
if (put_bits > 31) { \
EMIT_BYTE() \
diff --git a/src/3rdparty/libjpeg/src/jcmaster.c b/src/3rdparty/libjpeg/src/jcmaster.c
index 93b3de6826..998dc40a5c 100644
--- a/src/3rdparty/libjpeg/src/jcmaster.c
+++ b/src/3rdparty/libjpeg/src/jcmaster.c
@@ -492,8 +492,8 @@ prepare_for_pass(j_compress_ptr cinfo)
*/
master->pass_type = output_pass;
master->pass_number++;
- /*FALLTHROUGH*/
#endif
+ /*FALLTHROUGH*/
case output_pass:
/* Do a data-output pass. */
/* We need not repeat per-scan setup if prior optimization pass did it. */
diff --git a/src/3rdparty/libjpeg/src/jdhuff.c b/src/3rdparty/libjpeg/src/jdhuff.c
index 95f38e547e..a1128178b0 100644
--- a/src/3rdparty/libjpeg/src/jdhuff.c
+++ b/src/3rdparty/libjpeg/src/jdhuff.c
@@ -4,7 +4,7 @@
* This file was part of the Independent JPEG Group's software:
* Copyright (C) 1991-1997, Thomas G. Lane.
* libjpeg-turbo Modifications:
- * Copyright (C) 2009-2011, 2016, 2018, D. R. Commander.
+ * Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -589,7 +589,11 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
/* Convert DC difference to actual value, update last_dc_val */
int ci = cinfo->MCU_membership[blkn];
- s += state.last_dc_val[ci];
+ /* This is really just
+ * s += state.last_dc_val[ci];
+ * It is written this way in order to shut up UBSan.
+ */
+ s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
state.last_dc_val[ci] = s;
if (block) {
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
@@ -684,7 +688,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
if (entropy->dc_needed[blkn]) {
int ci = cinfo->MCU_membership[blkn];
- s += state.last_dc_val[ci];
+ s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
state.last_dc_val[ci] = s;
if (block)
(*block)[0] = (JCOEF)s;
diff --git a/src/3rdparty/libjpeg/src/jdmerge.c b/src/3rdparty/libjpeg/src/jdmerge.c
index b3fec04f71..dff5a35087 100644
--- a/src/3rdparty/libjpeg/src/jdmerge.c
+++ b/src/3rdparty/libjpeg/src/jdmerge.c
@@ -429,8 +429,6 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
-#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
-
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
((INT16 *)(addr))[0] = (INT16)(pixels); \
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
diff --git a/src/3rdparty/libjpeg/src/jdsample.c b/src/3rdparty/libjpeg/src/jdsample.c
index 52ee9af49b..50a68b3013 100644
--- a/src/3rdparty/libjpeg/src/jdsample.c
+++ b/src/3rdparty/libjpeg/src/jdsample.c
@@ -8,6 +8,7 @@
* Copyright (C) 2010, 2015-2016, D. R. Commander.
* Copyright (C) 2014, MIPS Technologies, Inc., California.
* Copyright (C) 2015, Google, Inc.
+ * Copyright (C) 2019, Arm Limited.
* For conditions of distribution and use, see the accompanying README.ijg
* file.
*
@@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
JSAMPARRAY output_data = *output_data_ptr;
JSAMPROW inptr0, inptr1, outptr;
#if BITS_IN_JSAMPLE == 8
- int thiscolsum;
+ int thiscolsum, bias;
#else
- JLONG thiscolsum;
+ JLONG thiscolsum, bias;
#endif
JDIMENSION colctr;
int inrow, outrow, v;
@@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
for (v = 0; v < 2; v++) {
/* inptr0 points to nearest input row, inptr1 points to next nearest */
inptr0 = input_data[inrow];
- if (v == 0) /* next nearest is row above */
+ if (v == 0) { /* next nearest is row above */
inptr1 = input_data[inrow - 1];
- else /* next nearest is row below */
+ bias = 1;
+ } else { /* next nearest is row below */
inptr1 = input_data[inrow + 1];
+ bias = 2;
+ }
outptr = output_data[outrow++];
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
- *outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2);
+ *outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
}
}
inrow++;
diff --git a/src/3rdparty/md4c.pri b/src/3rdparty/md4c.pri
new file mode 100644
index 0000000000..e0150dc6ed
--- /dev/null
+++ b/src/3rdparty/md4c.pri
@@ -0,0 +1,3 @@
+INCLUDEPATH += $$PWD/md4c
+HEADERS += $$PWD/md4c/md4c.h
+SOURCES += $$PWD/md4c/md4c.c
diff --git a/src/3rdparty/md4c/LICENSE.md b/src/3rdparty/md4c/LICENSE.md
new file mode 100644
index 0000000000..d58ef9341d
--- /dev/null
+++ b/src/3rdparty/md4c/LICENSE.md
@@ -0,0 +1,22 @@
+
+# The MIT License (MIT)
+
+Copyright © 2016-2019 Martin Mitáš
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the “Software”),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/src/3rdparty/md4c/md4c.c b/src/3rdparty/md4c/md4c.c
new file mode 100644
index 0000000000..3745cf3e46
--- /dev/null
+++ b/src/3rdparty/md4c/md4c.c
@@ -0,0 +1,6173 @@
+/*
+ * MD4C: Markdown parser for C
+ * (http://github.com/mity/md4c)
+ *
+ * Copyright (c) 2016-2019 Martin Mitas
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "md4c.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/*****************************
+ *** Miscellaneous Stuff ***
+ *****************************/
+
+#ifdef _MSC_VER
+ /* MSVC does not understand "inline" when building as pure C (not C++).
+ * However it understands "__inline" */
+ #ifndef __cplusplus
+ #define inline __inline
+ #endif
+#endif
+
+#ifdef _T
+ #undef _T
+#endif
+#if defined MD4C_USE_UTF16
+ #define _T(x) L##x
+#else
+ #define _T(x) x
+#endif
+
+/* Misc. macros. */
+#define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0]))
+
+#define STRINGIZE_(x) #x
+#define STRINGIZE(x) STRINGIZE_(x)
+
+#ifndef TRUE
+ #define TRUE 1
+ #define FALSE 0
+#endif
+
+
+/************************
+ *** Internal Types ***
+ ************************/
+
+/* These are omnipresent so lets save some typing. */
+#define CHAR MD_CHAR
+#define SZ MD_SIZE
+#define OFF MD_OFFSET
+
+typedef struct MD_MARK_tag MD_MARK;
+typedef struct MD_BLOCK_tag MD_BLOCK;
+typedef struct MD_CONTAINER_tag MD_CONTAINER;
+typedef struct MD_REF_DEF_tag MD_REF_DEF;
+
+
+/* During analyzes of inline marks, we need to manage some "mark chains",
+ * of (yet unresolved) openers. This structure holds start/end of the chain.
+ * The chain internals are then realized through MD_MARK::prev and ::next.
+ */
+typedef struct MD_MARKCHAIN_tag MD_MARKCHAIN;
+struct MD_MARKCHAIN_tag {
+ int head; /* Index of first mark in the chain, or -1 if empty. */
+ int tail; /* Index of last mark in the chain, or -1 if empty. */
+};
+
+/* Context propagated through all the parsing. */
+typedef struct MD_CTX_tag MD_CTX;
+struct MD_CTX_tag {
+ /* Immutable stuff (parameters of md_parse()). */
+ const CHAR* text;
+ SZ size;
+ MD_PARSER parser;
+ void* userdata;
+
+ /* When this is true, it allows some optimizations. */
+ int doc_ends_with_newline;
+
+ /* Helper temporary growing buffer. */
+ CHAR* buffer;
+ unsigned alloc_buffer;
+
+ /* Reference definitions. */
+ MD_REF_DEF* ref_defs;
+ int n_ref_defs;
+ int alloc_ref_defs;
+ void** ref_def_hashtable;
+ int ref_def_hashtable_size;
+
+ /* Stack of inline/span markers.
+ * This is only used for parsing a single block contents but by storing it
+ * here we may reuse the stack for subsequent blocks; i.e. we have fewer
+ * (re)allocations. */
+ MD_MARK* marks;
+ int n_marks;
+ int alloc_marks;
+
+#if defined MD4C_USE_UTF16
+ char mark_char_map[128];
+#else
+ char mark_char_map[256];
+#endif
+
+ /* For resolving of inline spans. */
+ MD_MARKCHAIN mark_chains[12];
+#define PTR_CHAIN ctx->mark_chains[0]
+#define TABLECELLBOUNDARIES ctx->mark_chains[1]
+#define ASTERISK_OPENERS_extraword_mod3_0 ctx->mark_chains[2]
+#define ASTERISK_OPENERS_extraword_mod3_1 ctx->mark_chains[3]
+#define ASTERISK_OPENERS_extraword_mod3_2 ctx->mark_chains[4]
+#define ASTERISK_OPENERS_intraword_mod3_0 ctx->mark_chains[5]
+#define ASTERISK_OPENERS_intraword_mod3_1 ctx->mark_chains[6]
+#define ASTERISK_OPENERS_intraword_mod3_2 ctx->mark_chains[7]
+#define UNDERSCORE_OPENERS ctx->mark_chains[8]
+#define TILDE_OPENERS ctx->mark_chains[9]
+#define BRACKET_OPENERS ctx->mark_chains[10]
+#define DOLLAR_OPENERS ctx->mark_chains[11]
+#define OPENERS_CHAIN_FIRST 2
+#define OPENERS_CHAIN_LAST 11
+
+ int n_table_cell_boundaries;
+
+ /* For resolving links. */
+ int unresolved_link_head;
+ int unresolved_link_tail;
+
+ /* For resolving raw HTML. */
+ OFF html_comment_horizon;
+ OFF html_proc_instr_horizon;
+ OFF html_decl_horizon;
+ OFF html_cdata_horizon;
+
+ /* For block analysis.
+ * Notes:
+ * -- It holds MD_BLOCK as well as MD_LINE structures. After each
+ * MD_BLOCK, its (multiple) MD_LINE(s) follow.
+ * -- For MD_BLOCK_HTML and MD_BLOCK_CODE, MD_VERBATIMLINE(s) are used
+ * instead of MD_LINE(s).
+ */
+ void* block_bytes;
+ MD_BLOCK* current_block;
+ int n_block_bytes;
+ int alloc_block_bytes;
+
+ /* For container block analysis. */
+ MD_CONTAINER* containers;
+ int n_containers;
+ int alloc_containers;
+
+ /* Minimal indentation to call the block "indented code block". */
+ unsigned code_indent_offset;
+
+ /* Contextual info for line analysis. */
+ SZ code_fence_length; /* For checking closing fence length. */
+ int html_block_type; /* For checking closing raw HTML condition. */
+ int last_line_has_list_loosening_effect;
+ int last_list_item_starts_with_two_blank_lines;
+};
+
+enum MD_LINETYPE_tag {
+ MD_LINE_BLANK,
+ MD_LINE_HR,
+ MD_LINE_ATXHEADER,
+ MD_LINE_SETEXTHEADER,
+ MD_LINE_SETEXTUNDERLINE,
+ MD_LINE_INDENTEDCODE,
+ MD_LINE_FENCEDCODE,
+ MD_LINE_HTML,
+ MD_LINE_TEXT,
+ MD_LINE_TABLE,
+ MD_LINE_TABLEUNDERLINE
+};
+typedef enum MD_LINETYPE_tag MD_LINETYPE;
+
+typedef struct MD_LINE_ANALYSIS_tag MD_LINE_ANALYSIS;
+struct MD_LINE_ANALYSIS_tag {
+ MD_LINETYPE type : 16;
+ unsigned data : 16;
+ OFF beg;
+ OFF end;
+ unsigned indent; /* Indentation level. */
+};
+
+typedef struct MD_LINE_tag MD_LINE;
+struct MD_LINE_tag {
+ OFF beg;
+ OFF end;
+};
+
+typedef struct MD_VERBATIMLINE_tag MD_VERBATIMLINE;
+struct MD_VERBATIMLINE_tag {
+ OFF beg;
+ OFF end;
+ OFF indent;
+};
+
+
+/*******************
+ *** Debugging ***
+ *******************/
+
+#define MD_LOG(msg) \
+ do { \
+ if(ctx->parser.debug_log != NULL) \
+ ctx->parser.debug_log((msg), ctx->userdata); \
+ } while(0)
+
+#ifdef DEBUG
+ #define MD_ASSERT(cond) \
+ do { \
+ if(!(cond)) { \
+ MD_LOG(__FILE__ ":" STRINGIZE(__LINE__) ": " \
+ "Assertion '" STRINGIZE(cond) "' failed."); \
+ exit(1); \
+ } \
+ } while(0)
+
+ #define MD_UNREACHABLE() MD_ASSERT(1 == 0)
+#else
+ #ifdef __GNUC__
+ #define MD_ASSERT(cond) do { if(!(cond)) __builtin_unreachable(); } while(0)
+ #define MD_UNREACHABLE() do { __builtin_unreachable(); } while(0)
+ #elif defined _MSC_VER && _MSC_VER > 120
+ #define MD_ASSERT(cond) do { __assume(cond); } while(0)
+ #define MD_UNREACHABLE() do { __assume(0); } while(0)
+ #else
+ #define MD_ASSERT(cond) do {} while(0)
+ #define MD_UNREACHABLE() do {} while(0)
+ #endif
+#endif
+
+
+/*****************
+ *** Helpers ***
+ *****************/
+
+/* Character accessors. */
+#define CH(off) (ctx->text[(off)])
+#define STR(off) (ctx->text + (off))
+
+/* Character classification.
+ * Note we assume ASCII compatibility of code points < 128 here. */
+#define ISIN_(ch, ch_min, ch_max) ((ch_min) <= (unsigned)(ch) && (unsigned)(ch) <= (ch_max))
+#define ISANYOF_(ch, palette) (md_strchr((palette), (ch)) != NULL)
+#define ISANYOF2_(ch, ch1, ch2) ((ch) == (ch1) || (ch) == (ch2))
+#define ISANYOF3_(ch, ch1, ch2, ch3) ((ch) == (ch1) || (ch) == (ch2) || (ch) == (ch3))
+#define ISASCII_(ch) ((unsigned)(ch) <= 127)
+#define ISBLANK_(ch) (ISANYOF2_((ch), _T(' '), _T('\t')))
+#define ISNEWLINE_(ch) (ISANYOF2_((ch), _T('\r'), _T('\n')))
+#define ISWHITESPACE_(ch) (ISBLANK_(ch) || ISANYOF2_((ch), _T('\v'), _T('\f')))
+#define ISCNTRL_(ch) ((unsigned)(ch) <= 31 || (unsigned)(ch) == 127)
+#define ISPUNCT_(ch) (ISIN_(ch, 33, 47) || ISIN_(ch, 58, 64) || ISIN_(ch, 91, 96) || ISIN_(ch, 123, 126))
+#define ISUPPER_(ch) (ISIN_(ch, _T('A'), _T('Z')))
+#define ISLOWER_(ch) (ISIN_(ch, _T('a'), _T('z')))
+#define ISALPHA_(ch) (ISUPPER_(ch) || ISLOWER_(ch))
+#define ISDIGIT_(ch) (ISIN_(ch, _T('0'), _T('9')))
+#define ISXDIGIT_(ch) (ISDIGIT_(ch) || ISIN_(ch, _T('A'), _T('F')) || ISIN_(ch, _T('a'), _T('f')))
+#define ISALNUM_(ch) (ISALPHA_(ch) || ISDIGIT_(ch))
+
+#define ISANYOF(off, palette) ISANYOF_(CH(off), (palette))
+#define ISANYOF2(off, ch1, ch2) ISANYOF2_(CH(off), (ch1), (ch2))
+#define ISANYOF3(off, ch1, ch2, ch3) ISANYOF3_(CH(off), (ch1), (ch2), (ch3))
+#define ISASCII(off) ISASCII_(CH(off))
+#define ISBLANK(off) ISBLANK_(CH(off))
+#define ISNEWLINE(off) ISNEWLINE_(CH(off))
+#define ISWHITESPACE(off) ISWHITESPACE_(CH(off))
+#define ISCNTRL(off) ISCNTRL_(CH(off))
+#define ISPUNCT(off) ISPUNCT_(CH(off))
+#define ISUPPER(off) ISUPPER_(CH(off))
+#define ISLOWER(off) ISLOWER_(CH(off))
+#define ISALPHA(off) ISALPHA_(CH(off))
+#define ISDIGIT(off) ISDIGIT_(CH(off))
+#define ISXDIGIT(off) ISXDIGIT_(CH(off))
+#define ISALNUM(off) ISALNUM_(CH(off))
+static inline const CHAR*
+md_strchr(const CHAR* str, CHAR ch)
+{
+ OFF i;
+ for(i = 0; str[i] != _T('\0'); i++) {
+ if(ch == str[i])
+ return (str + i);
+ }
+ return NULL;
+}
+
+/* Case insensitive check of string equality. */
+static inline int
+md_ascii_case_eq(const CHAR* s1, const CHAR* s2, SZ n)
+{
+ OFF i;
+ for(i = 0; i < n; i++) {
+ CHAR ch1 = s1[i];
+ CHAR ch2 = s2[i];
+
+ if(ISLOWER_(ch1))
+ ch1 += ('A'-'a');
+ if(ISLOWER_(ch2))
+ ch2 += ('A'-'a');
+ if(ch1 != ch2)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static inline int
+md_ascii_eq(const CHAR* s1, const CHAR* s2, SZ n)
+{
+ return memcmp(s1, s2, n * sizeof(CHAR)) == 0;
+}
+
+static int
+md_text_with_null_replacement(MD_CTX* ctx, MD_TEXTTYPE type, const CHAR* str, SZ size)
+{
+ OFF off = 0;
+ int ret = 0;
+
+ while(1) {
+ while(off < size && str[off] != _T('\0'))
+ off++;
+
+ if(off > 0) {
+ ret = ctx->parser.text(type, str, off, ctx->userdata);
+ if(ret != 0)
+ return ret;
+
+ str += off;
+ size -= off;
+ off = 0;
+ }
+
+ if(off >= size)
+ return 0;
+
+ ret = ctx->parser.text(MD_TEXT_NULLCHAR, _T(""), 1, ctx->userdata);
+ if(ret != 0)
+ return ret;
+ off++;
+ }
+}
+
+
+#define MD_CHECK(func) \
+ do { \
+ ret = (func); \
+ if(ret < 0) \
+ goto abort; \
+ } while(0)
+
+
+#define MD_TEMP_BUFFER(sz) \
+ do { \
+ if(sz > ctx->alloc_buffer) { \
+ CHAR* new_buffer; \
+ SZ new_size = ((sz) + (sz) / 2 + 128) & ~127; \
+ \
+ new_buffer = realloc(ctx->buffer, new_size); \
+ if(new_buffer == NULL) { \
+ MD_LOG("realloc() failed."); \
+ ret = -1; \
+ goto abort; \
+ } \
+ \
+ ctx->buffer = new_buffer; \
+ ctx->alloc_buffer = new_size; \
+ } \
+ } while(0)
+
+
+#define MD_ENTER_BLOCK(type, arg) \
+ do { \
+ ret = ctx->parser.enter_block((type), (arg), ctx->userdata); \
+ if(ret != 0) { \
+ MD_LOG("Aborted from enter_block() callback."); \
+ goto abort; \
+ } \
+ } while(0)
+
+#define MD_LEAVE_BLOCK(type, arg) \
+ do { \
+ ret = ctx->parser.leave_block((type), (arg), ctx->userdata); \
+ if(ret != 0) { \
+ MD_LOG("Aborted from leave_block() callback."); \
+ goto abort; \
+ } \
+ } while(0)
+
+#define MD_ENTER_SPAN(type, arg) \
+ do { \
+ ret = ctx->parser.enter_span((type), (arg), ctx->userdata); \
+ if(ret != 0) { \
+ MD_LOG("Aborted from enter_span() callback."); \
+ goto abort; \
+ } \
+ } while(0)
+
+#define MD_LEAVE_SPAN(type, arg) \
+ do { \
+ ret = ctx->parser.leave_span((type), (arg), ctx->userdata); \
+ if(ret != 0) { \
+ MD_LOG("Aborted from leave_span() callback."); \
+ goto abort; \
+ } \
+ } while(0)
+
+#define MD_TEXT(type, str, size) \
+ do { \
+ if(size > 0) { \
+ ret = ctx->parser.text((type), (str), (size), ctx->userdata); \
+ if(ret != 0) { \
+ MD_LOG("Aborted from text() callback."); \
+ goto abort; \
+ } \
+ } \
+ } while(0)
+
+#define MD_TEXT_INSECURE(type, str, size) \
+ do { \
+ if(size > 0) { \
+ ret = md_text_with_null_replacement(ctx, type, str, size); \
+ if(ret != 0) { \
+ MD_LOG("Aborted from text() callback."); \
+ goto abort; \
+ } \
+ } \
+ } while(0)
+
+
+
+/*************************
+ *** Unicode Support ***
+ *************************/
+
+typedef struct MD_UNICODE_FOLD_INFO_tag MD_UNICODE_FOLD_INFO;
+struct MD_UNICODE_FOLD_INFO_tag {
+ unsigned codepoints[3];
+ int n_codepoints;
+};
+
+
+#if defined MD4C_USE_UTF16 || defined MD4C_USE_UTF8
+ /* Binary search over sorted "map" of codepoints. Consecutive sequences
+ * of codepoints may be encoded in the map by just using the
+ * (MIN_CODEPOINT | 0x40000000) and (MAX_CODEPOINT | 0x80000000).
+ *
+ * Returns index of the found record in the map (in the case of ranges,
+ * the minimal value is used); or -1 on failure. */
+ static int
+ md_unicode_bsearch__(unsigned codepoint, const unsigned* map, size_t map_size)
+ {
+ int beg, end;
+ int pivot_beg, pivot_end;
+
+ beg = 0;
+ end = (int) map_size-1;
+ while(beg <= end) {
+ /* Pivot may be a range, not just a single value. */
+ pivot_beg = pivot_end = (beg + end) / 2;
+ if(map[pivot_end] & 0x40000000)
+ pivot_end++;
+ if(map[pivot_beg] & 0x80000000)
+ pivot_beg--;
+
+ if(codepoint < (map[pivot_beg] & 0x00ffffff))
+ end = pivot_beg - 1;
+ else if(codepoint > (map[pivot_end] & 0x00ffffff))
+ beg = pivot_end + 1;
+ else
+ return pivot_beg;
+ }
+
+ return -1;
+ }
+
+ static int
+ md_is_unicode_whitespace__(unsigned codepoint)
+ {
+#define R(cp_min, cp_max) ((cp_min) | 0x40000000), ((cp_max) | 0x80000000)
+#define S(cp) (cp)
+ /* Unicode "Zs" category.
+ * (generated by scripts/build_whitespace_map.py) */
+ static const unsigned WHITESPACE_MAP[] = {
+ S(0x0020), S(0x00a0), S(0x1680), R(0x2000,0x200a), S(0x202f), S(0x205f), S(0x3000)
+ };
+#undef R
+#undef S
+
+ /* The ASCII ones are the most frequently used ones, also CommonMark
+ * specification requests few more in this range. */
+ if(codepoint <= 0x7f)
+ return ISWHITESPACE_(codepoint);
+
+ return (md_unicode_bsearch__(codepoint, WHITESPACE_MAP, SIZEOF_ARRAY(WHITESPACE_MAP)) >= 0);
+ }
+
+ static int
+ md_is_unicode_punct__(unsigned codepoint)
+ {
+#define R(cp_min, cp_max) ((cp_min) | 0x40000000), ((cp_max) | 0x80000000)
+#define S(cp) (cp)
+ /* Unicode "Pc", "Pd", "Pe", "Pf", "Pi", "Po", "Ps" categories.
+ * (generated by scripts/build_punct_map.py) */
+ static const unsigned PUNCT_MAP[] = {
+ R(0x0021,0x0023), R(0x0025,0x002a), R(0x002c,0x002f), R(0x003a,0x003b), R(0x003f,0x0040),
+ R(0x005b,0x005d), S(0x005f), S(0x007b), S(0x007d), S(0x00a1), S(0x00a7), S(0x00ab), R(0x00b6,0x00b7),
+ S(0x00bb), S(0x00bf), S(0x037e), S(0x0387), R(0x055a,0x055f), R(0x0589,0x058a), S(0x05be), S(0x05c0),
+ S(0x05c3), S(0x05c6), R(0x05f3,0x05f4), R(0x0609,0x060a), R(0x060c,0x060d), S(0x061b), R(0x061e,0x061f),
+ R(0x066a,0x066d), S(0x06d4), R(0x0700,0x070d), R(0x07f7,0x07f9), R(0x0830,0x083e), S(0x085e),
+ R(0x0964,0x0965), S(0x0970), S(0x09fd), S(0x0a76), S(0x0af0), S(0x0c77), S(0x0c84), S(0x0df4), S(0x0e4f),
+ R(0x0e5a,0x0e5b), R(0x0f04,0x0f12), S(0x0f14), R(0x0f3a,0x0f3d), S(0x0f85), R(0x0fd0,0x0fd4),
+ R(0x0fd9,0x0fda), R(0x104a,0x104f), S(0x10fb), R(0x1360,0x1368), S(0x1400), S(0x166e), R(0x169b,0x169c),
+ R(0x16eb,0x16ed), R(0x1735,0x1736), R(0x17d4,0x17d6), R(0x17d8,0x17da), R(0x1800,0x180a),
+ R(0x1944,0x1945), R(0x1a1e,0x1a1f), R(0x1aa0,0x1aa6), R(0x1aa8,0x1aad), R(0x1b5a,0x1b60),
+ R(0x1bfc,0x1bff), R(0x1c3b,0x1c3f), R(0x1c7e,0x1c7f), R(0x1cc0,0x1cc7), S(0x1cd3), R(0x2010,0x2027),
+ R(0x2030,0x2043), R(0x2045,0x2051), R(0x2053,0x205e), R(0x207d,0x207e), R(0x208d,0x208e),
+ R(0x2308,0x230b), R(0x2329,0x232a), R(0x2768,0x2775), R(0x27c5,0x27c6), R(0x27e6,0x27ef),
+ R(0x2983,0x2998), R(0x29d8,0x29db), R(0x29fc,0x29fd), R(0x2cf9,0x2cfc), R(0x2cfe,0x2cff), S(0x2d70),
+ R(0x2e00,0x2e2e), R(0x2e30,0x2e4f), R(0x3001,0x3003), R(0x3008,0x3011), R(0x3014,0x301f), S(0x3030),
+ S(0x303d), S(0x30a0), S(0x30fb), R(0xa4fe,0xa4ff), R(0xa60d,0xa60f), S(0xa673), S(0xa67e),
+ R(0xa6f2,0xa6f7), R(0xa874,0xa877), R(0xa8ce,0xa8cf), R(0xa8f8,0xa8fa), S(0xa8fc), R(0xa92e,0xa92f),
+ S(0xa95f), R(0xa9c1,0xa9cd), R(0xa9de,0xa9df), R(0xaa5c,0xaa5f), R(0xaade,0xaadf), R(0xaaf0,0xaaf1),
+ S(0xabeb), R(0xfd3e,0xfd3f), R(0xfe10,0xfe19), R(0xfe30,0xfe52), R(0xfe54,0xfe61), S(0xfe63), S(0xfe68),
+ R(0xfe6a,0xfe6b), R(0xff01,0xff03), R(0xff05,0xff0a), R(0xff0c,0xff0f), R(0xff1a,0xff1b),
+ R(0xff1f,0xff20), R(0xff3b,0xff3d), S(0xff3f), S(0xff5b), S(0xff5d), R(0xff5f,0xff65), R(0x10100,0x10102),
+ S(0x1039f), S(0x103d0), S(0x1056f), S(0x10857), S(0x1091f), S(0x1093f), R(0x10a50,0x10a58), S(0x10a7f),
+ R(0x10af0,0x10af6), R(0x10b39,0x10b3f), R(0x10b99,0x10b9c), R(0x10f55,0x10f59), R(0x11047,0x1104d),
+ R(0x110bb,0x110bc), R(0x110be,0x110c1), R(0x11140,0x11143), R(0x11174,0x11175), R(0x111c5,0x111c8),
+ S(0x111cd), S(0x111db), R(0x111dd,0x111df), R(0x11238,0x1123d), S(0x112a9), R(0x1144b,0x1144f),
+ S(0x1145b), S(0x1145d), S(0x114c6), R(0x115c1,0x115d7), R(0x11641,0x11643), R(0x11660,0x1166c),
+ R(0x1173c,0x1173e), S(0x1183b), S(0x119e2), R(0x11a3f,0x11a46), R(0x11a9a,0x11a9c), R(0x11a9e,0x11aa2),
+ R(0x11c41,0x11c45), R(0x11c70,0x11c71), R(0x11ef7,0x11ef8), S(0x11fff), R(0x12470,0x12474),
+ R(0x16a6e,0x16a6f), S(0x16af5), R(0x16b37,0x16b3b), S(0x16b44), R(0x16e97,0x16e9a), S(0x16fe2),
+ S(0x1bc9f), R(0x1da87,0x1da8b), R(0x1e95e,0x1e95f)
+ };
+#undef R
+#undef S
+
+ /* The ASCII ones are the most frequently used ones, also CommonMark
+ * specification requests few more in this range. */
+ if(codepoint <= 0x7f)
+ return ISPUNCT_(codepoint);
+
+ return (md_unicode_bsearch__(codepoint, PUNCT_MAP, SIZEOF_ARRAY(PUNCT_MAP)) >= 0);
+ }
+
+ static void
+ md_get_unicode_fold_info(unsigned codepoint, MD_UNICODE_FOLD_INFO* info)
+ {
+#define R(cp_min, cp_max) ((cp_min) | 0x40000000), ((cp_max) | 0x80000000)
+#define S(cp) (cp)
+ /* Unicode "Pc", "Pd", "Pe", "Pf", "Pi", "Po", "Ps" categories.
+ * (generated by scripts/build_punct_map.py) */
+ static const unsigned FOLD_MAP_1[] = {
+ R(0x0041,0x005a), S(0x00b5), R(0x00c0,0x00d6), R(0x00d8,0x00de), R(0x0100,0x012e), R(0x0132,0x0136),
+ R(0x0139,0x0147), R(0x014a,0x0176), S(0x0178), R(0x0179,0x017d), S(0x017f), S(0x0181), S(0x0182),
+ S(0x0186), S(0x0187), S(0x0189), S(0x018b), S(0x018e), S(0x018f), S(0x0190), S(0x0191), S(0x0193),
+ S(0x0194), S(0x0196), S(0x0197), S(0x0198), S(0x019c), S(0x019d), S(0x019f), R(0x01a0,0x01a4), S(0x01a6),
+ S(0x01a7), S(0x01a9), S(0x01ac), S(0x01ae), S(0x01af), S(0x01b1), S(0x01b3), S(0x01b7), S(0x01b8),
+ S(0x01bc), S(0x01c4), S(0x01c5), S(0x01c7), S(0x01c8), S(0x01ca), R(0x01cb,0x01db), R(0x01de,0x01ee),
+ S(0x01f1), S(0x01f2), S(0x01f6), S(0x01f7), R(0x01f8,0x021e), S(0x0220), R(0x0222,0x0232), S(0x023a),
+ S(0x023b), S(0x023d), S(0x023e), S(0x0241), S(0x0243), S(0x0244), S(0x0245), R(0x0246,0x024e), S(0x0345),
+ S(0x0370), S(0x0376), S(0x037f), S(0x0386), R(0x0388,0x038a), S(0x038c), S(0x038e), R(0x0391,0x03a1),
+ R(0x03a3,0x03ab), S(0x03c2), S(0x03cf), S(0x03d0), S(0x03d1), S(0x03d5), S(0x03d6), R(0x03d8,0x03ee),
+ S(0x03f0), S(0x03f1), S(0x03f4), S(0x03f5), S(0x03f7), S(0x03f9), S(0x03fa), R(0x03fd,0x03ff),
+ R(0x0400,0x040f), R(0x0410,0x042f), R(0x0460,0x0480), R(0x048a,0x04be), S(0x04c0), R(0x04c1,0x04cd),
+ R(0x04d0,0x052e), R(0x0531,0x0556), R(0x10a0,0x10c5), S(0x10c7), S(0x10cd), R(0x13f8,0x13fd), S(0x1c80),
+ S(0x1c81), S(0x1c82), S(0x1c83), S(0x1c85), S(0x1c86), S(0x1c87), S(0x1c88), R(0x1c90,0x1cba),
+ R(0x1cbd,0x1cbf), R(0x1e00,0x1e94), S(0x1e9b), R(0x1ea0,0x1efe), R(0x1f08,0x1f0f), R(0x1f18,0x1f1d),
+ R(0x1f28,0x1f2f), R(0x1f38,0x1f3f), R(0x1f48,0x1f4d), S(0x1f59), S(0x1f5b), S(0x1f5d), S(0x1f5f),
+ R(0x1f68,0x1f6f), S(0x1fb8), S(0x1fba), S(0x1fbe), R(0x1fc8,0x1fcb), S(0x1fd8), S(0x1fda), S(0x1fe8),
+ S(0x1fea), S(0x1fec), S(0x1ff8), S(0x1ffa), S(0x2126), S(0x212a), S(0x212b), S(0x2132), R(0x2160,0x216f),
+ S(0x2183), R(0x24b6,0x24cf), R(0x2c00,0x2c2e), S(0x2c60), S(0x2c62), S(0x2c63), S(0x2c64),
+ R(0x2c67,0x2c6b), S(0x2c6d), S(0x2c6e), S(0x2c6f), S(0x2c70), S(0x2c72), S(0x2c75), S(0x2c7e),
+ R(0x2c80,0x2ce2), S(0x2ceb), S(0x2cf2), R(0xa640,0xa66c), R(0xa680,0xa69a), R(0xa722,0xa72e),
+ R(0xa732,0xa76e), S(0xa779), S(0xa77d), R(0xa77e,0xa786), S(0xa78b), S(0xa78d), S(0xa790),
+ R(0xa796,0xa7a8), S(0xa7aa), S(0xa7ab), S(0xa7ac), S(0xa7ad), S(0xa7ae), S(0xa7b0), S(0xa7b1), S(0xa7b2),
+ S(0xa7b3), R(0xa7b4,0xa7be), S(0xa7c2), S(0xa7c4), S(0xa7c5), S(0xa7c6), R(0xab70,0xabbf),
+ R(0xff21,0xff3a), R(0x10400,0x10427), R(0x104b0,0x104d3), R(0x10c80,0x10cb2), R(0x118a0,0x118bf),
+ R(0x16e40,0x16e5f), R(0x1e900,0x1e921)
+ };
+ static const unsigned FOLD_MAP_1_DATA[] = {
+ 0x0061, 0x007a, 0x03bc, 0x00e0, 0x00f6, 0x00f8, 0x00fe, 0x0101, 0x012f, 0x0133, 0x0137, 0x013a, 0x0148,
+ 0x014b, 0x0177, 0x00ff, 0x017a, 0x017e, 0x0073, 0x0253, 0x0183, 0x0254, 0x0188, 0x0256, 0x018c, 0x01dd,
+ 0x0259, 0x025b, 0x0192, 0x0260, 0x0263, 0x0269, 0x0268, 0x0199, 0x026f, 0x0272, 0x0275, 0x01a1, 0x01a5,
+ 0x0280, 0x01a8, 0x0283, 0x01ad, 0x0288, 0x01b0, 0x028a, 0x01b4, 0x0292, 0x01b9, 0x01bd, 0x01c6, 0x01c6,
+ 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01dc, 0x01df, 0x01ef, 0x01f3, 0x01f3, 0x0195, 0x01bf, 0x01f9, 0x021f,
+ 0x019e, 0x0223, 0x0233, 0x2c65, 0x023c, 0x019a, 0x2c66, 0x0242, 0x0180, 0x0289, 0x028c, 0x0247, 0x024f,
+ 0x03b9, 0x0371, 0x0377, 0x03f3, 0x03ac, 0x03ad, 0x03af, 0x03cc, 0x03cd, 0x03b1, 0x03c1, 0x03c3, 0x03cb,
+ 0x03c3, 0x03d7, 0x03b2, 0x03b8, 0x03c6, 0x03c0, 0x03d9, 0x03ef, 0x03ba, 0x03c1, 0x03b8, 0x03b5, 0x03f8,
+ 0x03f2, 0x03fb, 0x037b, 0x037d, 0x0450, 0x045f, 0x0430, 0x044f, 0x0461, 0x0481, 0x048b, 0x04bf, 0x04cf,
+ 0x04c2, 0x04ce, 0x04d1, 0x052f, 0x0561, 0x0586, 0x2d00, 0x2d25, 0x2d27, 0x2d2d, 0x13f0, 0x13f5, 0x0432,
+ 0x0434, 0x043e, 0x0441, 0x0442, 0x044a, 0x0463, 0xa64b, 0x10d0, 0x10fa, 0x10fd, 0x10ff, 0x1e01, 0x1e95,
+ 0x1e61, 0x1ea1, 0x1eff, 0x1f00, 0x1f07, 0x1f10, 0x1f15, 0x1f20, 0x1f27, 0x1f30, 0x1f37, 0x1f40, 0x1f45,
+ 0x1f51, 0x1f53, 0x1f55, 0x1f57, 0x1f60, 0x1f67, 0x1fb0, 0x1f70, 0x03b9, 0x1f72, 0x1f75, 0x1fd0, 0x1f76,
+ 0x1fe0, 0x1f7a, 0x1fe5, 0x1f78, 0x1f7c, 0x03c9, 0x006b, 0x00e5, 0x214e, 0x2170, 0x217f, 0x2184, 0x24d0,
+ 0x24e9, 0x2c30, 0x2c5e, 0x2c61, 0x026b, 0x1d7d, 0x027d, 0x2c68, 0x2c6c, 0x0251, 0x0271, 0x0250, 0x0252,
+ 0x2c73, 0x2c76, 0x023f, 0x2c81, 0x2ce3, 0x2cec, 0x2cf3, 0xa641, 0xa66d, 0xa681, 0xa69b, 0xa723, 0xa72f,
+ 0xa733, 0xa76f, 0xa77a, 0x1d79, 0xa77f, 0xa787, 0xa78c, 0x0265, 0xa791, 0xa797, 0xa7a9, 0x0266, 0x025c,
+ 0x0261, 0x026c, 0x026a, 0x029e, 0x0287, 0x029d, 0xab53, 0xa7b5, 0xa7bf, 0xa7c3, 0xa794, 0x0282, 0x1d8e,
+ 0x13a0, 0x13ef, 0xff41, 0xff5a, 0x10428, 0x1044f, 0x104d8, 0x104fb, 0x10cc0, 0x10cf2, 0x118c0, 0x118df,
+ 0x16e60, 0x16e7f, 0x1e922, 0x1e943
+ };
+ static const unsigned FOLD_MAP_2[] = {
+ S(0x00df), S(0x0130), S(0x0149), S(0x01f0), S(0x0587), S(0x1e96), S(0x1e97), S(0x1e98), S(0x1e99),
+ S(0x1e9a), S(0x1e9e), S(0x1f50), R(0x1f80,0x1f87), R(0x1f88,0x1f8f), R(0x1f90,0x1f97), R(0x1f98,0x1f9f),
+ R(0x1fa0,0x1fa7), R(0x1fa8,0x1faf), S(0x1fb2), S(0x1fb3), S(0x1fb4), S(0x1fb6), S(0x1fbc), S(0x1fc2),
+ S(0x1fc3), S(0x1fc4), S(0x1fc6), S(0x1fcc), S(0x1fd6), S(0x1fe4), S(0x1fe6), S(0x1ff2), S(0x1ff3),
+ S(0x1ff4), S(0x1ff6), S(0x1ffc), S(0xfb00), S(0xfb01), S(0xfb02), S(0xfb05), S(0xfb06), S(0xfb13),
+ S(0xfb14), S(0xfb15), S(0xfb16), S(0xfb17)
+ };
+ static const unsigned FOLD_MAP_2_DATA[] = {
+ 0x0073,0x0073, 0x0069,0x0307, 0x02bc,0x006e, 0x006a,0x030c, 0x0565,0x0582, 0x0068,0x0331, 0x0074,0x0308,
+ 0x0077,0x030a, 0x0079,0x030a, 0x0061,0x02be, 0x0073,0x0073, 0x03c5,0x0313, 0x1f00,0x03b9, 0x1f07,0x03b9,
+ 0x1f00,0x03b9, 0x1f07,0x03b9, 0x1f20,0x03b9, 0x1f27,0x03b9, 0x1f20,0x03b9, 0x1f27,0x03b9, 0x1f60,0x03b9,
+ 0x1f67,0x03b9, 0x1f60,0x03b9, 0x1f67,0x03b9, 0x1f70,0x03b9, 0x03b1,0x03b9, 0x03ac,0x03b9, 0x03b1,0x0342,
+ 0x03b1,0x03b9, 0x1f74,0x03b9, 0x03b7,0x03b9, 0x03ae,0x03b9, 0x03b7,0x0342, 0x03b7,0x03b9, 0x03b9,0x0342,
+ 0x03c1,0x0313, 0x03c5,0x0342, 0x1f7c,0x03b9, 0x03c9,0x03b9, 0x03ce,0x03b9, 0x03c9,0x0342, 0x03c9,0x03b9,
+ 0x0066,0x0066, 0x0066,0x0069, 0x0066,0x006c, 0x0073,0x0074, 0x0073,0x0074, 0x0574,0x0576, 0x0574,0x0565,
+ 0x0574,0x056b, 0x057e,0x0576, 0x0574,0x056d
+ };
+ static const unsigned FOLD_MAP_3[] = {
+ S(0x0390), S(0x03b0), S(0x1f52), S(0x1f54), S(0x1f56), S(0x1fb7), S(0x1fc7), S(0x1fd2), S(0x1fd3),
+ S(0x1fd7), S(0x1fe2), S(0x1fe3), S(0x1fe7), S(0x1ff7), S(0xfb03), S(0xfb04)
+ };
+ static const unsigned FOLD_MAP_3_DATA[] = {
+ 0x03b9,0x0308,0x0301, 0x03c5,0x0308,0x0301, 0x03c5,0x0313,0x0300, 0x03c5,0x0313,0x0301,
+ 0x03c5,0x0313,0x0342, 0x03b1,0x0342,0x03b9, 0x03b7,0x0342,0x03b9, 0x03b9,0x0308,0x0300,
+ 0x03b9,0x0308,0x0301, 0x03b9,0x0308,0x0342, 0x03c5,0x0308,0x0300, 0x03c5,0x0308,0x0301,
+ 0x03c5,0x0308,0x0342, 0x03c9,0x0342,0x03b9, 0x0066,0x0066,0x0069, 0x0066,0x0066,0x006c
+ };
+#undef R
+#undef S
+ static const struct {
+ const unsigned* map;
+ const unsigned* data;
+ size_t map_size;
+ int n_codepoints;
+ } FOLD_MAP_LIST[] = {
+ { FOLD_MAP_1, FOLD_MAP_1_DATA, SIZEOF_ARRAY(FOLD_MAP_1), 1 },
+ { FOLD_MAP_2, FOLD_MAP_2_DATA, SIZEOF_ARRAY(FOLD_MAP_2), 2 },
+ { FOLD_MAP_3, FOLD_MAP_3_DATA, SIZEOF_ARRAY(FOLD_MAP_3), 3 }
+ };
+
+ int i;
+
+ /* Fast path for ASCII characters. */
+ if(codepoint <= 0x7f) {
+ info->codepoints[0] = codepoint;
+ if(ISUPPER_(codepoint))
+ info->codepoints[0] += 'a' - 'A';
+ info->n_codepoints = 1;
+ return;
+ }
+
+ /* Try to locate the codepoint in any of the maps. */
+ for(i = 0; i < (int) SIZEOF_ARRAY(FOLD_MAP_LIST); i++) {
+ int index;
+
+ index = md_unicode_bsearch__(codepoint, FOLD_MAP_LIST[i].map, FOLD_MAP_LIST[i].map_size);
+ if(index >= 0) {
+ /* Found the mapping. */
+ int n_codepoints = FOLD_MAP_LIST[i].n_codepoints;
+ const unsigned* map = FOLD_MAP_LIST[i].map;
+ const unsigned* codepoints = FOLD_MAP_LIST[i].data + (index * n_codepoints);
+
+ memcpy(info->codepoints, codepoints, sizeof(unsigned) * n_codepoints);
+ info->n_codepoints = n_codepoints;
+
+ if(FOLD_MAP_LIST[i].map[index] != codepoint) {
+ /* The found mapping maps whole range of codepoints,
+ * i.e. we have to offset info->codepoints[0] accordingly. */
+ if((map[index] & 0x00ffffff)+1 == codepoints[0]) {
+ /* Alternating type of the range. */
+ info->codepoints[0] = codepoint + ((codepoint & 0x1) == (map[index] & 0x1) ? 1 : 0);
+ } else {
+ /* Range to range kind of mapping. */
+ info->codepoints[0] += (codepoint - (map[index] & 0x00ffffff));
+ }
+ }
+
+ return;
+ }
+ }
+
+ /* No mapping found. Map the codepoint to itself. */
+ info->codepoints[0] = codepoint;
+ info->n_codepoints = 1;
+ }
+#endif
+
+
+#if defined MD4C_USE_UTF16
+ #define IS_UTF16_SURROGATE_HI(word) (((WORD)(word) & 0xfc00) == 0xd800)
+ #define IS_UTF16_SURROGATE_LO(word) (((WORD)(word) & 0xfc00) == 0xdc00)
+ #define UTF16_DECODE_SURROGATE(hi, lo) (0x10000 + ((((unsigned)(hi) & 0x3ff) << 10) | (((unsigned)(lo) & 0x3ff) << 0)))
+
+ static unsigned
+ md_decode_utf16le__(const CHAR* str, SZ str_size, SZ* p_size)
+ {
+ if(IS_UTF16_SURROGATE_HI(str[0])) {
+ if(1 < str_size && IS_UTF16_SURROGATE_LO(str[1])) {
+ if(p_size != NULL)
+ *p_size = 2;
+ return UTF16_DECODE_SURROGATE(str[0], str[1]);
+ }
+ }
+
+ if(p_size != NULL)
+ *p_size = 1;
+ return str[0];
+ }
+
+ static unsigned
+ md_decode_utf16le_before__(MD_CTX* ctx, OFF off)
+ {
+ if(off > 2 && IS_UTF16_SURROGATE_HI(CH(off-2)) && IS_UTF16_SURROGATE_LO(CH(off-1)))
+ return UTF16_DECODE_SURROGATE(CH(off-2), CH(off-1));
+
+ return CH(off);
+ }
+
+ /* No whitespace uses surrogates, so no decoding needed here. */
+ #define ISUNICODEWHITESPACE_(codepoint) md_is_unicode_whitespace__(codepoint)
+ #define ISUNICODEWHITESPACE(off) md_is_unicode_whitespace__(CH(off))
+ #define ISUNICODEWHITESPACEBEFORE(off) md_is_unicode_whitespace__(CH((off)-1))
+
+ #define ISUNICODEPUNCT(off) md_is_unicode_punct__(md_decode_utf16le__(STR(off), ctx->size - (off), NULL))
+ #define ISUNICODEPUNCTBEFORE(off) md_is_unicode_punct__(md_decode_utf16le_before__(ctx, off))
+
+ static inline int
+ md_decode_unicode(const CHAR* str, OFF off, SZ str_size, SZ* p_char_size)
+ {
+ return md_decode_utf16le__(str+off, str_size-off, p_char_size);
+ }
+#elif defined MD4C_USE_UTF8
+ #define IS_UTF8_LEAD1(byte) ((unsigned char)(byte) <= 0x7f)
+ #define IS_UTF8_LEAD2(byte) (((unsigned char)(byte) & 0xe0) == 0xc0)
+ #define IS_UTF8_LEAD3(byte) (((unsigned char)(byte) & 0xf0) == 0xe0)
+ #define IS_UTF8_LEAD4(byte) (((unsigned char)(byte) & 0xf8) == 0xf0)
+ #define IS_UTF8_TAIL(byte) (((unsigned char)(byte) & 0xc0) == 0x80)
+
+ static unsigned
+ md_decode_utf8__(const CHAR* str, SZ str_size, SZ* p_size)
+ {
+ if(!IS_UTF8_LEAD1(str[0])) {
+ if(IS_UTF8_LEAD2(str[0])) {
+ if(1 < str_size && IS_UTF8_TAIL(str[1])) {
+ if(p_size != NULL)
+ *p_size = 2;
+
+ return (((unsigned int)str[0] & 0x1f) << 6) |
+ (((unsigned int)str[1] & 0x3f) << 0);
+ }
+ } else if(IS_UTF8_LEAD3(str[0])) {
+ if(2 < str_size && IS_UTF8_TAIL(str[1]) && IS_UTF8_TAIL(str[2])) {
+ if(p_size != NULL)
+ *p_size = 3;
+
+ return (((unsigned int)str[0] & 0x0f) << 12) |
+ (((unsigned int)str[1] & 0x3f) << 6) |
+ (((unsigned int)str[2] & 0x3f) << 0);
+ }
+ } else if(IS_UTF8_LEAD4(str[0])) {
+ if(3 < str_size && IS_UTF8_TAIL(str[1]) && IS_UTF8_TAIL(str[2]) && IS_UTF8_TAIL(str[3])) {
+ if(p_size != NULL)
+ *p_size = 4;
+
+ return (((unsigned int)str[0] & 0x07) << 18) |
+ (((unsigned int)str[1] & 0x3f) << 12) |
+ (((unsigned int)str[2] & 0x3f) << 6) |
+ (((unsigned int)str[3] & 0x3f) << 0);
+ }
+ }
+ }
+
+ if(p_size != NULL)
+ *p_size = 1;
+ return (unsigned) str[0];
+ }
+
+ static unsigned
+ md_decode_utf8_before__(MD_CTX* ctx, OFF off)
+ {
+ if(!IS_UTF8_LEAD1(CH(off-1))) {
+ if(off > 1 && IS_UTF8_LEAD2(CH(off-2)) && IS_UTF8_TAIL(CH(off-1)))
+ return (((unsigned int)CH(off-2) & 0x1f) << 6) |
+ (((unsigned int)CH(off-1) & 0x3f) << 0);
+
+ if(off > 2 && IS_UTF8_LEAD3(CH(off-3)) && IS_UTF8_TAIL(CH(off-2)) && IS_UTF8_TAIL(CH(off-1)))
+ return (((unsigned int)CH(off-3) & 0x0f) << 12) |
+ (((unsigned int)CH(off-2) & 0x3f) << 6) |
+ (((unsigned int)CH(off-1) & 0x3f) << 0);
+
+ if(off > 3 && IS_UTF8_LEAD4(CH(off-4)) && IS_UTF8_TAIL(CH(off-3)) && IS_UTF8_TAIL(CH(off-2)) && IS_UTF8_TAIL(CH(off-1)))
+ return (((unsigned int)CH(off-4) & 0x07) << 18) |
+ (((unsigned int)CH(off-3) & 0x3f) << 12) |
+ (((unsigned int)CH(off-2) & 0x3f) << 6) |
+ (((unsigned int)CH(off-1) & 0x3f) << 0);
+ }
+
+ return (unsigned) CH(off-1);
+ }
+
+ #define ISUNICODEWHITESPACE_(codepoint) md_is_unicode_whitespace__(codepoint)
+ #define ISUNICODEWHITESPACE(off) md_is_unicode_whitespace__(md_decode_utf8__(STR(off), ctx->size - (off), NULL))
+ #define ISUNICODEWHITESPACEBEFORE(off) md_is_unicode_whitespace__(md_decode_utf8_before__(ctx, off))
+
+ #define ISUNICODEPUNCT(off) md_is_unicode_punct__(md_decode_utf8__(STR(off), ctx->size - (off), NULL))
+ #define ISUNICODEPUNCTBEFORE(off) md_is_unicode_punct__(md_decode_utf8_before__(ctx, off))
+
+ static inline unsigned
+ md_decode_unicode(const CHAR* str, OFF off, SZ str_size, SZ* p_char_size)
+ {
+ return md_decode_utf8__(str+off, str_size-off, p_char_size);
+ }
+#else
+ #define ISUNICODEWHITESPACE_(codepoint) ISWHITESPACE_(codepoint)
+ #define ISUNICODEWHITESPACE(off) ISWHITESPACE(off)
+ #define ISUNICODEWHITESPACEBEFORE(off) ISWHITESPACE((off)-1)
+
+ #define ISUNICODEPUNCT(off) ISPUNCT(off)
+ #define ISUNICODEPUNCTBEFORE(off) ISPUNCT((off)-1)
+
+ static inline void
+ md_get_unicode_fold_info(unsigned codepoint, MD_UNICODE_FOLD_INFO* info)
+ {
+ info->codepoints[0] = codepoint;
+ if(ISUPPER_(codepoint))
+ info->codepoints[0] += 'a' - 'A';
+ info->n_codepoints = 1;
+ }
+
+ static inline unsigned
+ md_decode_unicode(const CHAR* str, OFF off, SZ str_size, SZ* p_size)
+ {
+ *p_size = 1;
+ return (unsigned) str[off];
+ }
+#endif
+
+
+/*************************************
+ *** Helper string manipulations ***
+ *************************************/
+
+/* Fill buffer with copy of the string between 'beg' and 'end' but replace any
+ * line breaks with given replacement character.
+ *
+ * NOTE: Caller is responsible to make sure the buffer is large enough.
+ * (Given the output is always shorter then input, (end - beg) is good idea
+ * what the caller should allocate.)
+ */
+static void
+md_merge_lines(MD_CTX* ctx, OFF beg, OFF end, const MD_LINE* lines, int n_lines,
+ CHAR line_break_replacement_char, CHAR* buffer, SZ* p_size)
+{
+ CHAR* ptr = buffer;
+ int line_index = 0;
+ OFF off = beg;
+
+ while(1) {
+ const MD_LINE* line = &lines[line_index];
+ OFF line_end = line->end;
+ if(end < line_end)
+ line_end = end;
+
+ while(off < line_end) {
+ *ptr = CH(off);
+ ptr++;
+ off++;
+ }
+
+ if(off >= end) {
+ *p_size = ptr - buffer;
+ return;
+ }
+
+ *ptr = line_break_replacement_char;
+ ptr++;
+
+ line_index++;
+ off = lines[line_index].beg;
+ }
+}
+
+/* Wrapper of md_merge_lines() which allocates new buffer for the output string.
+ */
+static int
+md_merge_lines_alloc(MD_CTX* ctx, OFF beg, OFF end, const MD_LINE* lines, int n_lines,
+ CHAR line_break_replacement_char, CHAR** p_str, SZ* p_size)
+{
+ CHAR* buffer;
+
+ buffer = (CHAR*) malloc(sizeof(CHAR) * (end - beg));
+ if(buffer == NULL) {
+ MD_LOG("malloc() failed.");
+ return -1;
+ }
+
+ md_merge_lines(ctx, beg, end, lines, n_lines,
+ line_break_replacement_char, buffer, p_size);
+
+ *p_str = buffer;
+ return 0;
+}
+
+static OFF
+md_skip_unicode_whitespace(const CHAR* label, OFF off, SZ size)
+{
+ SZ char_size;
+ unsigned codepoint;
+
+ while(off < size) {
+ codepoint = md_decode_unicode(label, off, size, &char_size);
+ if(!ISUNICODEWHITESPACE_(codepoint) && !ISNEWLINE_(label[off]))
+ break;
+ off += char_size;
+ }
+
+ return off;
+}
+
+
+/******************************
+ *** Recognizing raw HTML ***
+ ******************************/
+
+/* md_is_html_tag() may be called when processing inlines (inline raw HTML)
+ * or when breaking document to blocks (checking for start of HTML block type 7).
+ *
+ * When breaking document to blocks, we do not yet know line boundaries, but
+ * in that case the whole tag has to live on a single line. We distinguish this
+ * by n_lines == 0.
+ */
+static int
+md_is_html_tag(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, OFF max_end, OFF* p_end)
+{
+ int attr_state;
+ OFF off = beg;
+ OFF line_end = (n_lines > 0) ? lines[0].end : ctx->size;
+ int i = 0;
+
+ MD_ASSERT(CH(beg) == _T('<'));
+
+ if(off + 1 >= line_end)
+ return FALSE;
+ off++;
+
+ /* For parsing attributes, we need a little state automaton below.
+ * State -1: no attributes are allowed.
+ * State 0: attribute could follow after some whitespace.
+ * State 1: after a whitespace (attribute name may follow).
+ * State 2: after attribute name ('=' MAY follow).
+ * State 3: after '=' (value specification MUST follow).
+ * State 41: in middle of unquoted attribute value.
+ * State 42: in middle of single-quoted attribute value.
+ * State 43: in middle of double-quoted attribute value.
+ */
+ attr_state = 0;
+
+ if(CH(off) == _T('/')) {
+ /* Closer tag "</ ... >". No attributes may be present. */
+ attr_state = -1;
+ off++;
+ }
+
+ /* Tag name */
+ if(off >= line_end || !ISALPHA(off))
+ return FALSE;
+ off++;
+ while(off < line_end && (ISALNUM(off) || CH(off) == _T('-')))
+ off++;
+
+ /* (Optional) attributes (if not closer), (optional) '/' (if not closer)
+ * and final '>'. */
+ while(1) {
+ while(off < line_end && !ISNEWLINE(off)) {
+ if(attr_state > 40) {
+ if(attr_state == 41 && (ISBLANK(off) || ISANYOF(off, _T("\"'=<>`")))) {
+ attr_state = 0;
+ off--; /* Put the char back for re-inspection in the new state. */
+ } else if(attr_state == 42 && CH(off) == _T('\'')) {
+ attr_state = 0;
+ } else if(attr_state == 43 && CH(off) == _T('"')) {
+ attr_state = 0;
+ }
+ off++;
+ } else if(ISWHITESPACE(off)) {
+ if(attr_state == 0)
+ attr_state = 1;
+ off++;
+ } else if(attr_state <= 2 && CH(off) == _T('>')) {
+ /* End. */
+ goto done;
+ } else if(attr_state <= 2 && CH(off) == _T('/') && off+1 < line_end && CH(off+1) == _T('>')) {
+ /* End with digraph '/>' */
+ off++;
+ goto done;
+ } else if((attr_state == 1 || attr_state == 2) && (ISALPHA(off) || CH(off) == _T('_') || CH(off) == _T(':'))) {
+ off++;
+ /* Attribute name */
+ while(off < line_end && (ISALNUM(off) || ISANYOF(off, _T("_.:-"))))
+ off++;
+ attr_state = 2;
+ } else if(attr_state == 2 && CH(off) == _T('=')) {
+ /* Attribute assignment sign */
+ off++;
+ attr_state = 3;
+ } else if(attr_state == 3) {
+ /* Expecting start of attribute value. */
+ if(CH(off) == _T('"'))
+ attr_state = 43;
+ else if(CH(off) == _T('\''))
+ attr_state = 42;
+ else if(!ISANYOF(off, _T("\"'=<>`")) && !ISNEWLINE(off))
+ attr_state = 41;
+ else
+ return FALSE;
+ off++;
+ } else {
+ /* Anything unexpected. */
+ return FALSE;
+ }
+ }
+
+ /* We have to be on a single line. See definition of start condition
+ * of HTML block, type 7. */
+ if(n_lines == 0)
+ return FALSE;
+
+ i++;
+ if(i >= n_lines)
+ return FALSE;
+
+ off = lines[i].beg;
+ line_end = lines[i].end;
+
+ if(attr_state == 0 || attr_state == 41)
+ attr_state = 1;
+
+ if(off >= max_end)
+ return FALSE;
+ }
+
+done:
+ if(off >= max_end)
+ return FALSE;
+
+ *p_end = off+1;
+ return TRUE;
+}
+
+static int
+md_scan_for_html_closer(MD_CTX* ctx, const MD_CHAR* str, MD_SIZE len,
+ const MD_LINE* lines, int n_lines,
+ OFF beg, OFF max_end, OFF* p_end,
+ OFF* p_scan_horizon)
+{
+ OFF off = beg;
+ int i = 0;
+
+ if(off < *p_scan_horizon && *p_scan_horizon >= max_end - len) {
+ /* We have already scanned the range up to the max_end so we know
+ * there is nothing to see. */
+ return FALSE;
+ }
+
+ while(TRUE) {
+ while(off + len <= lines[i].end && off + len <= max_end) {
+ if(md_ascii_eq(STR(off), str, len)) {
+ /* Success. */
+ *p_end = off + len;
+ return TRUE;
+ }
+ off++;
+ }
+
+ i++;
+ if(off >= max_end || i >= n_lines) {
+ /* Failure. */
+ *p_scan_horizon = off;
+ return FALSE;
+ }
+
+ off = lines[i].beg;
+ }
+}
+
+static int
+md_is_html_comment(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg;
+
+ MD_ASSERT(CH(beg) == _T('<'));
+
+ if(off + 4 >= lines[0].end)
+ return FALSE;
+ if(CH(off+1) != _T('!') || CH(off+2) != _T('-') || CH(off+3) != _T('-'))
+ return FALSE;
+ off += 4;
+
+ /* ">" and "->" must not follow the opening. */
+ if(off < lines[0].end && CH(off) == _T('>'))
+ return FALSE;
+ if(off+1 < lines[0].end && CH(off) == _T('-') && CH(off+1) == _T('>'))
+ return FALSE;
+
+ /* HTML comment must not contain "--", so we scan just for "--" instead
+ * of "-->" and verify manually that '>' follows. */
+ if(md_scan_for_html_closer(ctx, _T("--"), 2,
+ lines, n_lines, off, max_end, p_end, &ctx->html_comment_horizon))
+ {
+ if(*p_end < max_end && CH(*p_end) == _T('>')) {
+ *p_end = *p_end + 1;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static int
+md_is_html_processing_instruction(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg;
+
+ if(off + 2 >= lines[0].end)
+ return FALSE;
+ if(CH(off+1) != _T('?'))
+ return FALSE;
+ off += 2;
+
+ return md_scan_for_html_closer(ctx, _T("?>"), 2,
+ lines, n_lines, off, max_end, p_end, &ctx->html_proc_instr_horizon);
+}
+
+static int
+md_is_html_declaration(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg;
+
+ if(off + 2 >= lines[0].end)
+ return FALSE;
+ if(CH(off+1) != _T('!'))
+ return FALSE;
+ off += 2;
+
+ /* Declaration name. */
+ if(off >= lines[0].end || !ISALPHA(off))
+ return FALSE;
+ off++;
+ while(off < lines[0].end && ISALPHA(off))
+ off++;
+ if(off < lines[0].end && !ISWHITESPACE(off))
+ return FALSE;
+
+ return md_scan_for_html_closer(ctx, _T(">"), 1,
+ lines, n_lines, off, max_end, p_end, &ctx->html_decl_horizon);
+}
+
+static int
+md_is_html_cdata(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, OFF max_end, OFF* p_end)
+{
+ static const CHAR open_str[] = _T("<![CDATA[");
+ static const SZ open_size = SIZEOF_ARRAY(open_str) - 1;
+
+ OFF off = beg;
+
+ if(off + open_size >= lines[0].end)
+ return FALSE;
+ if(memcmp(STR(off), open_str, open_size) != 0)
+ return FALSE;
+ off += open_size;
+
+ if(lines[n_lines-1].end < max_end)
+ max_end = lines[n_lines-1].end - 2;
+
+ return md_scan_for_html_closer(ctx, _T("]]>"), 3,
+ lines, n_lines, off, max_end, p_end, &ctx->html_cdata_horizon);
+}
+
+static int
+md_is_html_any(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg, OFF max_end, OFF* p_end)
+{
+ MD_ASSERT(CH(beg) == _T('<'));
+ return (md_is_html_tag(ctx, lines, n_lines, beg, max_end, p_end) ||
+ md_is_html_comment(ctx, lines, n_lines, beg, max_end, p_end) ||
+ md_is_html_processing_instruction(ctx, lines, n_lines, beg, max_end, p_end) ||
+ md_is_html_declaration(ctx, lines, n_lines, beg, max_end, p_end) ||
+ md_is_html_cdata(ctx, lines, n_lines, beg, max_end, p_end));
+}
+
+
+/****************************
+ *** Recognizing Entity ***
+ ****************************/
+
+static int
+md_is_hex_entity_contents(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg;
+
+ while(off < max_end && ISXDIGIT_(text[off]) && off - beg <= 8)
+ off++;
+
+ if(1 <= off - beg && off - beg <= 6) {
+ *p_end = off;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static int
+md_is_dec_entity_contents(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg;
+
+ while(off < max_end && ISDIGIT_(text[off]) && off - beg <= 8)
+ off++;
+
+ if(1 <= off - beg && off - beg <= 7) {
+ *p_end = off;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static int
+md_is_named_entity_contents(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg;
+
+ if(off < max_end && ISALPHA_(text[off]))
+ off++;
+ else
+ return FALSE;
+
+ while(off < max_end && ISALNUM_(text[off]) && off - beg <= 48)
+ off++;
+
+ if(2 <= off - beg && off - beg <= 48) {
+ *p_end = off;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static int
+md_is_entity_str(MD_CTX* ctx, const CHAR* text, OFF beg, OFF max_end, OFF* p_end)
+{
+ int is_contents;
+ OFF off = beg;
+
+ MD_ASSERT(text[off] == _T('&'));
+ off++;
+
+ if(off+2 < max_end && text[off] == _T('#') && (text[off+1] == _T('x') || text[off+1] == _T('X')))
+ is_contents = md_is_hex_entity_contents(ctx, text, off+2, max_end, &off);
+ else if(off+1 < max_end && text[off] == _T('#'))
+ is_contents = md_is_dec_entity_contents(ctx, text, off+1, max_end, &off);
+ else
+ is_contents = md_is_named_entity_contents(ctx, text, off, max_end, &off);
+
+ if(is_contents && off < max_end && text[off] == _T(';')) {
+ *p_end = off+1;
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static inline int
+md_is_entity(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end)
+{
+ return md_is_entity_str(ctx, ctx->text, beg, max_end, p_end);
+}
+
+
+/******************************
+ *** Attribute Management ***
+ ******************************/
+
+typedef struct MD_ATTRIBUTE_BUILD_tag MD_ATTRIBUTE_BUILD;
+struct MD_ATTRIBUTE_BUILD_tag {
+ CHAR* text;
+ MD_TEXTTYPE* substr_types;
+ OFF* substr_offsets;
+ int substr_count;
+ int substr_alloc;
+ MD_TEXTTYPE trivial_types[1];
+ OFF trivial_offsets[2];
+};
+
+
+#define MD_BUILD_ATTR_NO_ESCAPES 0x0001
+
+static int
+md_build_attr_append_substr(MD_CTX* ctx, MD_ATTRIBUTE_BUILD* build,
+ MD_TEXTTYPE type, OFF off)
+{
+ if(build->substr_count >= build->substr_alloc) {
+ MD_TEXTTYPE* new_substr_types;
+ OFF* new_substr_offsets;
+
+ build->substr_alloc = (build->substr_alloc == 0 ? 8 : build->substr_alloc * 2);
+
+ new_substr_types = (MD_TEXTTYPE*) realloc(build->substr_types,
+ build->substr_alloc * sizeof(MD_TEXTTYPE));
+ if(new_substr_types == NULL) {
+ MD_LOG("realloc() failed.");
+ return -1;
+ }
+ /* Note +1 to reserve space for final offset (== raw_size). */
+ new_substr_offsets = (OFF*) realloc(build->substr_offsets,
+ (build->substr_alloc+1) * sizeof(OFF));
+ if(new_substr_offsets == NULL) {
+ MD_LOG("realloc() failed.");
+ free(new_substr_types);
+ return -1;
+ }
+
+ build->substr_types = new_substr_types;
+ build->substr_offsets = new_substr_offsets;
+ }
+
+ build->substr_types[build->substr_count] = type;
+ build->substr_offsets[build->substr_count] = off;
+ build->substr_count++;
+ return 0;
+}
+
+static void
+md_free_attribute(MD_CTX* ctx, MD_ATTRIBUTE_BUILD* build)
+{
+ if(build->substr_alloc > 0) {
+ free(build->text);
+ free(build->substr_types);
+ free(build->substr_offsets);
+ }
+}
+
+static int
+md_build_attribute(MD_CTX* ctx, const CHAR* raw_text, SZ raw_size,
+ unsigned flags, MD_ATTRIBUTE* attr, MD_ATTRIBUTE_BUILD* build)
+{
+ OFF raw_off, off;
+ int is_trivial;
+ int ret = 0;
+
+ memset(build, 0, sizeof(MD_ATTRIBUTE_BUILD));
+
+ /* If there is no backslash and no ampersand, build trivial attribute
+ * without any malloc(). */
+ is_trivial = TRUE;
+ for(raw_off = 0; raw_off < raw_size; raw_off++) {
+ if(ISANYOF3_(raw_text[raw_off], _T('\\'), _T('&'), _T('\0'))) {
+ is_trivial = FALSE;
+ break;
+ }
+ }
+
+ if(is_trivial) {
+ build->text = (CHAR*) (raw_size ? raw_text : NULL);
+ build->substr_types = build->trivial_types;
+ build->substr_offsets = build->trivial_offsets;
+ build->substr_count = 1;
+ build->substr_alloc = 0;
+ build->trivial_types[0] = MD_TEXT_NORMAL;
+ build->trivial_offsets[0] = 0;
+ build->trivial_offsets[1] = raw_size;
+ off = raw_size;
+ } else {
+ build->text = (CHAR*) malloc(raw_size * sizeof(CHAR));
+ if(build->text == NULL) {
+ MD_LOG("malloc() failed.");
+ goto abort;
+ }
+
+ raw_off = 0;
+ off = 0;
+
+ while(raw_off < raw_size) {
+ if(raw_text[raw_off] == _T('\0')) {
+ MD_CHECK(md_build_attr_append_substr(ctx, build, MD_TEXT_NULLCHAR, off));
+ memcpy(build->text + off, raw_text + raw_off, 1);
+ off++;
+ raw_off++;
+ continue;
+ }
+
+ if(raw_text[raw_off] == _T('&')) {
+ OFF ent_end;
+
+ if(md_is_entity_str(ctx, raw_text, raw_off, raw_size, &ent_end)) {
+ MD_CHECK(md_build_attr_append_substr(ctx, build, MD_TEXT_ENTITY, off));
+ memcpy(build->text + off, raw_text + raw_off, ent_end - raw_off);
+ off += ent_end - raw_off;
+ raw_off = ent_end;
+ continue;
+ }
+ }
+
+ if(build->substr_count == 0 || build->substr_types[build->substr_count-1] != MD_TEXT_NORMAL)
+ MD_CHECK(md_build_attr_append_substr(ctx, build, MD_TEXT_NORMAL, off));
+
+ if(!(flags & MD_BUILD_ATTR_NO_ESCAPES) &&
+ raw_text[raw_off] == _T('\\') && raw_off+1 < raw_size &&
+ (ISPUNCT_(raw_text[raw_off+1]) || ISNEWLINE_(raw_text[raw_off+1])))
+ raw_off++;
+
+ build->text[off++] = raw_text[raw_off++];
+ }
+ build->substr_offsets[build->substr_count] = off;
+ }
+
+ attr->text = build->text;
+ attr->size = off;
+ attr->substr_offsets = build->substr_offsets;
+ attr->substr_types = build->substr_types;
+ return 0;
+
+abort:
+ md_free_attribute(ctx, build);
+ return -1;
+}
+
+
+/*********************************************
+ *** Dictionary of Reference Definitions ***
+ *********************************************/
+
+#define MD_FNV1A_BASE 2166136261
+#define MD_FNV1A_PRIME 16777619
+
+static inline unsigned
+md_fnv1a(unsigned base, const void* data, size_t n)
+{
+ const unsigned char* buf = (const unsigned char*) data;
+ unsigned hash = base;
+ size_t i;
+
+ for(i = 0; i < n; i++) {
+ hash ^= buf[i];
+ hash *= MD_FNV1A_PRIME;
+ }
+
+ return hash;
+}
+
+
+struct MD_REF_DEF_tag {
+ CHAR* label;
+ CHAR* title;
+ unsigned hash;
+ SZ label_size : 24;
+ unsigned label_needs_free : 1;
+ unsigned title_needs_free : 1;
+ SZ title_size;
+ OFF dest_beg;
+ OFF dest_end;
+};
+
+/* Label equivalence is quite complicated with regards to whitespace and case
+ * folding. This complicates computing a hash of it as well as direct comparison
+ * of two labels. */
+
+static unsigned
+md_link_label_hash(const CHAR* label, SZ size)
+{
+ unsigned hash = MD_FNV1A_BASE;
+ OFF off;
+ unsigned codepoint;
+ int is_whitespace = FALSE;
+
+ off = md_skip_unicode_whitespace(label, 0, size);
+ while(off < size) {
+ SZ char_size;
+
+ codepoint = md_decode_unicode(label, off, size, &char_size);
+ is_whitespace = ISUNICODEWHITESPACE_(codepoint) || ISNEWLINE_(label[off]);
+
+ if(is_whitespace) {
+ codepoint = ' ';
+ hash = md_fnv1a(hash, &codepoint, sizeof(unsigned));
+ off = md_skip_unicode_whitespace(label, off, size);
+ } else {
+ MD_UNICODE_FOLD_INFO fold_info;
+
+ md_get_unicode_fold_info(codepoint, &fold_info);
+ hash = md_fnv1a(hash, fold_info.codepoints, fold_info.n_codepoints * sizeof(unsigned));
+ off += char_size;
+ }
+ }
+
+ return hash;
+}
+
+static OFF
+md_link_label_cmp_load_fold_info(const CHAR* label, OFF off, SZ size,
+ MD_UNICODE_FOLD_INFO* fold_info)
+{
+ unsigned codepoint;
+ SZ char_size;
+
+ if(off >= size) {
+ /* Treat end of link label as a whitespace. */
+ goto whitespace;
+ }
+
+ if(ISNEWLINE_(label[off])) {
+ /* Treat new lines as a whitespace. */
+ off++;
+ goto whitespace;
+ }
+
+ codepoint = md_decode_unicode(label, off, size, &char_size);
+ off += char_size;
+ if(ISUNICODEWHITESPACE_(codepoint)) {
+ /* Treat all whitespace as equivalent */
+ goto whitespace;
+ }
+
+ /* Get real folding info. */
+ md_get_unicode_fold_info(codepoint, fold_info);
+ return off;
+
+whitespace:
+ fold_info->codepoints[0] = _T(' ');
+ fold_info->n_codepoints = 1;
+ return off;
+}
+
+static int
+md_link_label_cmp(const CHAR* a_label, SZ a_size, const CHAR* b_label, SZ b_size)
+{
+ OFF a_off;
+ OFF b_off;
+ int a_reached_end = FALSE;
+ int b_reached_end = FALSE;
+ MD_UNICODE_FOLD_INFO a_fi = { 0 };
+ MD_UNICODE_FOLD_INFO b_fi = { 0 };
+ OFF a_fi_off = 0;
+ OFF b_fi_off = 0;
+ int cmp;
+
+ a_off = md_skip_unicode_whitespace(a_label, 0, a_size);
+ b_off = md_skip_unicode_whitespace(b_label, 0, b_size);
+ while(!a_reached_end && !b_reached_end) {
+ /* If needed, load fold info for next char. */
+ if(a_fi_off >= a_fi.n_codepoints) {
+ a_fi_off = 0;
+ a_off = md_link_label_cmp_load_fold_info(a_label, a_off, a_size, &a_fi);
+ a_reached_end = (a_off >= a_size);
+ }
+ if(b_fi_off >= b_fi.n_codepoints) {
+ b_fi_off = 0;
+ b_off = md_link_label_cmp_load_fold_info(b_label, b_off, b_size, &b_fi);
+ b_reached_end = (b_off >= b_size);
+ }
+
+ cmp = b_fi.codepoints[b_fi_off] - a_fi.codepoints[a_fi_off];
+ if(cmp != 0)
+ return cmp;
+
+ a_fi_off++;
+ b_fi_off++;
+ }
+
+ return 0;
+}
+
+typedef struct MD_REF_DEF_LIST_tag MD_REF_DEF_LIST;
+struct MD_REF_DEF_LIST_tag {
+ int n_ref_defs;
+ int alloc_ref_defs;
+ MD_REF_DEF* ref_defs[]; /* Valid items always point into ctx->ref_defs[] */
+};
+
+static int
+md_ref_def_cmp(const void* a, const void* b)
+{
+ const MD_REF_DEF* a_ref = *(const MD_REF_DEF**)a;
+ const MD_REF_DEF* b_ref = *(const MD_REF_DEF**)b;
+
+ if(a_ref->hash < b_ref->hash)
+ return -1;
+ else if(a_ref->hash > b_ref->hash)
+ return +1;
+ else
+ return md_link_label_cmp(a_ref->label, a_ref->label_size, b_ref->label, b_ref->label_size);
+}
+
+static int
+md_ref_def_cmp_stable(const void* a, const void* b)
+{
+ int cmp;
+
+ cmp = md_ref_def_cmp(a, b);
+
+ /* Ensure stability of the sorting. */
+ if(cmp == 0) {
+ const MD_REF_DEF* a_ref = *(const MD_REF_DEF**)a;
+ const MD_REF_DEF* b_ref = *(const MD_REF_DEF**)b;
+
+ if(a_ref < b_ref)
+ cmp = -1;
+ else if(a_ref > b_ref)
+ cmp = +1;
+ else
+ cmp = 0;
+ }
+
+ return cmp;
+}
+
+static int
+md_build_ref_def_hashtable(MD_CTX* ctx)
+{
+ int i, j;
+
+ if(ctx->n_ref_defs == 0)
+ return 0;
+
+ ctx->ref_def_hashtable_size = (ctx->n_ref_defs * 5) / 4;
+ ctx->ref_def_hashtable = malloc(ctx->ref_def_hashtable_size * sizeof(void*));
+ if(ctx->ref_def_hashtable == NULL) {
+ MD_LOG("malloc() failed.");
+ goto abort;
+ }
+ memset(ctx->ref_def_hashtable, 0, ctx->ref_def_hashtable_size * sizeof(void*));
+
+ /* Each member of ctx->ref_def_hashtable[] can be:
+ * -- NULL,
+ * -- pointer to the MD_REF_DEF in ctx->ref_defs[], or
+ * -- pointer to a MD_REF_DEF_LIST, which holds multiple pointers to
+ * such MD_REF_DEFs.
+ */
+ for(i = 0; i < ctx->n_ref_defs; i++) {
+ MD_REF_DEF* def = &ctx->ref_defs[i];
+ void* bucket;
+ MD_REF_DEF_LIST* list;
+
+ def->hash = md_link_label_hash(def->label, def->label_size);
+ bucket = ctx->ref_def_hashtable[def->hash % ctx->ref_def_hashtable_size];
+
+ if(bucket == NULL) {
+ ctx->ref_def_hashtable[def->hash % ctx->ref_def_hashtable_size] = def;
+ continue;
+ }
+
+ if(ctx->ref_defs <= (MD_REF_DEF*) bucket && (MD_REF_DEF*) bucket < ctx->ref_defs + ctx->n_ref_defs) {
+ /* The bucket already contains one ref. def. Lets see whether it
+ * is the same label (ref. def. duplicate) or different one
+ * (hash conflict). */
+ MD_REF_DEF* old_def = (MD_REF_DEF*) bucket;
+
+ if(md_link_label_cmp(def->label, def->label_size, old_def->label, old_def->label_size) == 0) {
+ /* Ignore this ref. def. */
+ continue;
+ }
+
+ /* Make the bucket capable of holding more ref. defs. */
+ list = (MD_REF_DEF_LIST*) malloc(sizeof(MD_REF_DEF_LIST) + 4 * sizeof(MD_REF_DEF*));
+ if(list == NULL) {
+ MD_LOG("malloc() failed.");
+ goto abort;
+ }
+ list->ref_defs[0] = old_def;
+ list->ref_defs[1] = def;
+ list->n_ref_defs = 2;
+ list->alloc_ref_defs = 4;
+ ctx->ref_def_hashtable[def->hash % ctx->ref_def_hashtable_size] = list;
+ continue;
+ }
+
+ /* Append the def to the bucket list. */
+ list = (MD_REF_DEF_LIST*) bucket;
+ if(list->n_ref_defs >= list->alloc_ref_defs) {
+ MD_REF_DEF_LIST* list_tmp = (MD_REF_DEF_LIST*) realloc(list,
+ sizeof(MD_REF_DEF_LIST) + 2 * list->alloc_ref_defs * sizeof(MD_REF_DEF*));
+ if(list_tmp == NULL) {
+ MD_LOG("realloc() failed.");
+ goto abort;
+ }
+ list = list_tmp;
+ list->alloc_ref_defs *= 2;
+ ctx->ref_def_hashtable[def->hash % ctx->ref_def_hashtable_size] = list;
+ }
+
+ list->ref_defs[list->n_ref_defs] = def;
+ list->n_ref_defs++;
+ }
+
+ /* Sort the complex buckets so we can use bsearch() with them. */
+ for(i = 0; i < ctx->ref_def_hashtable_size; i++) {
+ void* bucket = ctx->ref_def_hashtable[i];
+ MD_REF_DEF_LIST* list;
+
+ if(bucket == NULL)
+ continue;
+ if(ctx->ref_defs <= (MD_REF_DEF*) bucket && (MD_REF_DEF*) bucket < ctx->ref_defs + ctx->n_ref_defs)
+ continue;
+
+ list = (MD_REF_DEF_LIST*) bucket;
+ qsort(list->ref_defs, list->n_ref_defs, sizeof(MD_REF_DEF*), md_ref_def_cmp_stable);
+
+ /* Disable duplicates. */
+ for(j = 1; j < list->n_ref_defs; j++) {
+ if(md_ref_def_cmp(&list->ref_defs[j-1], &list->ref_defs[j]) == 0)
+ list->ref_defs[j] = list->ref_defs[j-1];
+ }
+ }
+
+ return 0;
+
+abort:
+ return -1;
+}
+
+static void
+md_free_ref_def_hashtable(MD_CTX* ctx)
+{
+ if(ctx->ref_def_hashtable != NULL) {
+ int i;
+
+ for(i = 0; i < ctx->ref_def_hashtable_size; i++) {
+ void* bucket = ctx->ref_def_hashtable[i];
+ if(bucket == NULL)
+ continue;
+ if(ctx->ref_defs <= (MD_REF_DEF*) bucket && (MD_REF_DEF*) bucket < ctx->ref_defs + ctx->n_ref_defs)
+ continue;
+ free(bucket);
+ }
+
+ free(ctx->ref_def_hashtable);
+ }
+}
+
+static const MD_REF_DEF*
+md_lookup_ref_def(MD_CTX* ctx, const CHAR* label, SZ label_size)
+{
+ unsigned hash;
+ void* bucket;
+
+ if(ctx->ref_def_hashtable_size == 0)
+ return NULL;
+
+ hash = md_link_label_hash(label, label_size);
+ bucket = ctx->ref_def_hashtable[hash % ctx->ref_def_hashtable_size];
+
+ if(bucket == NULL) {
+ return NULL;
+ } else if(ctx->ref_defs <= (MD_REF_DEF*) bucket && (MD_REF_DEF*) bucket < ctx->ref_defs + ctx->n_ref_defs) {
+ const MD_REF_DEF* def = (MD_REF_DEF*) bucket;
+
+ if(md_link_label_cmp(def->label, def->label_size, label, label_size) == 0)
+ return def;
+ else
+ return NULL;
+ } else {
+ MD_REF_DEF_LIST* list = (MD_REF_DEF_LIST*) bucket;
+ MD_REF_DEF key_buf;
+ const MD_REF_DEF* key = &key_buf;
+ const MD_REF_DEF** ret;
+
+ key_buf.label = (CHAR*) label;
+ key_buf.label_size = label_size;
+ key_buf.hash = md_link_label_hash(key_buf.label, key_buf.label_size);
+
+ ret = (const MD_REF_DEF**) bsearch(&key, list->ref_defs,
+ list->n_ref_defs, sizeof(MD_REF_DEF*), md_ref_def_cmp);
+ if(ret != NULL)
+ return *ret;
+ else
+ return NULL;
+ }
+}
+
+
+/***************************
+ *** Recognizing Links ***
+ ***************************/
+
+/* Note this code is partially shared between processing inlines and blocks
+ * as reference definitions and links share some helper parser functions.
+ */
+
+typedef struct MD_LINK_ATTR_tag MD_LINK_ATTR;
+struct MD_LINK_ATTR_tag {
+ OFF dest_beg;
+ OFF dest_end;
+
+ CHAR* title;
+ SZ title_size;
+ int title_needs_free;
+};
+
+
+static int
+md_is_link_label(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg,
+ OFF* p_end, int* p_beg_line_index, int* p_end_line_index,
+ OFF* p_contents_beg, OFF* p_contents_end)
+{
+ OFF off = beg;
+ OFF contents_beg = 0;
+ OFF contents_end = 0;
+ int line_index = 0;
+ int len = 0;
+
+ if(CH(off) != _T('['))
+ return FALSE;
+ off++;
+
+ while(1) {
+ OFF line_end = lines[line_index].end;
+
+ while(off < line_end) {
+ if(CH(off) == _T('\\') && off+1 < ctx->size && (ISPUNCT(off+1) || ISNEWLINE(off+1))) {
+ if(contents_end == 0) {
+ contents_beg = off;
+ *p_beg_line_index = line_index;
+ }
+ contents_end = off + 2;
+ off += 2;
+ } else if(CH(off) == _T('[')) {
+ return FALSE;
+ } else if(CH(off) == _T(']')) {
+ if(contents_beg < contents_end) {
+ /* Success. */
+ *p_contents_beg = contents_beg;
+ *p_contents_end = contents_end;
+ *p_end = off+1;
+ *p_end_line_index = line_index;
+ return TRUE;
+ } else {
+ /* Link label must have some non-whitespace contents. */
+ return FALSE;
+ }
+ } else {
+ unsigned codepoint;
+ SZ char_size;
+
+ codepoint = md_decode_unicode(ctx->text, off, ctx->size, &char_size);
+ if(!ISUNICODEWHITESPACE_(codepoint)) {
+ if(contents_end == 0) {
+ contents_beg = off;
+ *p_beg_line_index = line_index;
+ }
+ contents_end = off + char_size;
+ }
+
+ off += char_size;
+ }
+
+ len++;
+ if(len > 999)
+ return FALSE;
+ }
+
+ line_index++;
+ len++;
+ if(line_index < n_lines)
+ off = lines[line_index].beg;
+ else
+ break;
+ }
+
+ return FALSE;
+}
+
+static int
+md_is_link_destination_A(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end,
+ OFF* p_contents_beg, OFF* p_contents_end)
+{
+ OFF off = beg;
+
+ if(off >= max_end || CH(off) != _T('<'))
+ return FALSE;
+ off++;
+
+ while(off < max_end) {
+ if(CH(off) == _T('\\') && off+1 < max_end && ISPUNCT(off+1)) {
+ off += 2;
+ continue;
+ }
+
+ if(ISNEWLINE(off) || CH(off) == _T('<'))
+ return FALSE;
+
+ if(CH(off) == _T('>')) {
+ /* Success. */
+ *p_contents_beg = beg+1;
+ *p_contents_end = off;
+ *p_end = off+1;
+ return TRUE;
+ }
+
+ off++;
+ }
+
+ return FALSE;
+}
+
+static int
+md_is_link_destination_B(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end,
+ OFF* p_contents_beg, OFF* p_contents_end)
+{
+ OFF off = beg;
+ int parenthesis_level = 0;
+
+ while(off < max_end) {
+ if(CH(off) == _T('\\') && off+1 < max_end && ISPUNCT(off+1)) {
+ off += 2;
+ continue;
+ }
+
+ if(ISWHITESPACE(off) || ISCNTRL(off))
+ break;
+
+ /* Link destination may include balanced pairs of unescaped '(' ')'.
+ * Note we limit the maximal nesting level by 32 to protect us from
+ * https://github.com/jgm/cmark/issues/214 */
+ if(CH(off) == _T('(')) {
+ parenthesis_level++;
+ if(parenthesis_level > 32)
+ return FALSE;
+ } else if(CH(off) == _T(')')) {
+ if(parenthesis_level == 0)
+ break;
+ parenthesis_level--;
+ }
+
+ off++;
+ }
+
+ if(parenthesis_level != 0 || off == beg)
+ return FALSE;
+
+ /* Success. */
+ *p_contents_beg = beg;
+ *p_contents_end = off;
+ *p_end = off;
+ return TRUE;
+}
+
+static inline int
+md_is_link_destination(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end,
+ OFF* p_contents_beg, OFF* p_contents_end)
+{
+ if(CH(beg) == _T('<'))
+ return md_is_link_destination_A(ctx, beg, max_end, p_end, p_contents_beg, p_contents_end);
+ else
+ return md_is_link_destination_B(ctx, beg, max_end, p_end, p_contents_beg, p_contents_end);
+}
+
+static int
+md_is_link_title(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg,
+ OFF* p_end, int* p_beg_line_index, int* p_end_line_index,
+ OFF* p_contents_beg, OFF* p_contents_end)
+{
+ OFF off = beg;
+ CHAR closer_char;
+ int line_index = 0;
+
+ /* White space with up to one line break. */
+ while(off < lines[line_index].end && ISWHITESPACE(off))
+ off++;
+ if(off >= lines[line_index].end) {
+ line_index++;
+ if(line_index >= n_lines)
+ return FALSE;
+ off = lines[line_index].beg;
+ }
+ if(off == beg)
+ return FALSE;
+
+ *p_beg_line_index = line_index;
+
+ /* First char determines how to detect end of it. */
+ switch(CH(off)) {
+ case _T('"'): closer_char = _T('"'); break;
+ case _T('\''): closer_char = _T('\''); break;
+ case _T('('): closer_char = _T(')'); break;
+ default: return FALSE;
+ }
+ off++;
+
+ *p_contents_beg = off;
+
+ while(line_index < n_lines) {
+ OFF line_end = lines[line_index].end;
+
+ while(off < line_end) {
+ if(CH(off) == _T('\\') && off+1 < ctx->size && (ISPUNCT(off+1) || ISNEWLINE(off+1))) {
+ off++;
+ } else if(CH(off) == closer_char) {
+ /* Success. */
+ *p_contents_end = off;
+ *p_end = off+1;
+ *p_end_line_index = line_index;
+ return TRUE;
+ } else if(closer_char == _T(')') && CH(off) == _T('(')) {
+ /* ()-style title cannot contain (unescaped '(')) */
+ return FALSE;
+ }
+
+ off++;
+ }
+
+ line_index++;
+ }
+
+ return FALSE;
+}
+
+/* Returns 0 if it is not a reference definition.
+ *
+ * Returns N > 0 if it is a reference definition. N then corresponds to the
+ * number of lines forming it). In this case the definition is stored for
+ * resolving any links referring to it.
+ *
+ * Returns -1 in case of an error (out of memory).
+ */
+static int
+md_is_link_reference_definition(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
+{
+ OFF label_contents_beg;
+ OFF label_contents_end;
+ int label_contents_line_index = -1;
+ int label_is_multiline;
+ CHAR* label;
+ SZ label_size;
+ int label_needs_free = FALSE;
+ OFF dest_contents_beg;
+ OFF dest_contents_end;
+ OFF title_contents_beg;
+ OFF title_contents_end;
+ int title_contents_line_index;
+ int title_is_multiline;
+ OFF off;
+ int line_index = 0;
+ int tmp_line_index;
+ MD_REF_DEF* def;
+ int ret;
+
+ /* Link label. */
+ if(!md_is_link_label(ctx, lines, n_lines, lines[0].beg,
+ &off, &label_contents_line_index, &line_index,
+ &label_contents_beg, &label_contents_end))
+ return FALSE;
+ label_is_multiline = (label_contents_line_index != line_index);
+
+ /* Colon. */
+ if(off >= lines[line_index].end || CH(off) != _T(':'))
+ return FALSE;
+ off++;
+
+ /* Optional white space with up to one line break. */
+ while(off < lines[line_index].end && ISWHITESPACE(off))
+ off++;
+ if(off >= lines[line_index].end) {
+ line_index++;
+ if(line_index >= n_lines)
+ return FALSE;
+ off = lines[line_index].beg;
+ }
+
+ /* Link destination. */
+ if(!md_is_link_destination(ctx, off, lines[line_index].end,
+ &off, &dest_contents_beg, &dest_contents_end))
+ return FALSE;
+
+ /* (Optional) title. Note we interpret it as an title only if nothing
+ * more follows on its last line. */
+ if(md_is_link_title(ctx, lines + line_index, n_lines - line_index, off,
+ &off, &title_contents_line_index, &tmp_line_index,
+ &title_contents_beg, &title_contents_end)
+ && off >= lines[line_index + tmp_line_index].end)
+ {
+ title_is_multiline = (tmp_line_index != title_contents_line_index);
+ title_contents_line_index += line_index;
+ line_index += tmp_line_index;
+ } else {
+ /* Not a title. */
+ title_is_multiline = FALSE;
+ title_contents_beg = off;
+ title_contents_end = off;
+ title_contents_line_index = 0;
+ }
+
+ /* Nothing more can follow on the last line. */
+ if(off < lines[line_index].end)
+ return FALSE;
+
+ /* Construct label. */
+ if(!label_is_multiline) {
+ label = (CHAR*) STR(label_contents_beg);
+ label_size = label_contents_end - label_contents_beg;
+ label_needs_free = FALSE;
+ } else {
+ MD_CHECK(md_merge_lines_alloc(ctx, label_contents_beg, label_contents_end,
+ lines + label_contents_line_index, n_lines - label_contents_line_index,
+ _T(' '), &label, &label_size));
+ label_needs_free = TRUE;
+ }
+
+ /* Store the reference definition. */
+ if(ctx->n_ref_defs >= ctx->alloc_ref_defs) {
+ MD_REF_DEF* new_defs;
+
+ ctx->alloc_ref_defs = (ctx->alloc_ref_defs > 0 ? ctx->alloc_ref_defs * 2 : 16);
+ new_defs = (MD_REF_DEF*) realloc(ctx->ref_defs, ctx->alloc_ref_defs * sizeof(MD_REF_DEF));
+ if(new_defs == NULL) {
+ MD_LOG("realloc() failed.");
+ ret = -1;
+ goto abort;
+ }
+
+ ctx->ref_defs = new_defs;
+ }
+
+ def = &ctx->ref_defs[ctx->n_ref_defs];
+ memset(def, 0, sizeof(MD_REF_DEF));
+
+ def->label = label;
+ def->label_size = label_size;
+ def->label_needs_free = label_needs_free;
+
+ def->dest_beg = dest_contents_beg;
+ def->dest_end = dest_contents_end;
+
+ if(title_contents_beg >= title_contents_end) {
+ def->title = NULL;
+ def->title_size = 0;
+ } else if(!title_is_multiline) {
+ def->title = (CHAR*) STR(title_contents_beg);
+ def->title_size = title_contents_end - title_contents_beg;
+ } else {
+ MD_CHECK(md_merge_lines_alloc(ctx, title_contents_beg, title_contents_end,
+ lines + title_contents_line_index, n_lines - title_contents_line_index,
+ _T('\n'), &def->title, &def->title_size));
+ def->title_needs_free = TRUE;
+ }
+
+ /* Success. */
+ ctx->n_ref_defs++;
+ return line_index + 1;
+
+abort:
+ /* Failure. */
+ if(label_needs_free)
+ free(label);
+ return -1;
+}
+
+static int
+md_is_link_reference(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
+ OFF beg, OFF end, MD_LINK_ATTR* attr)
+{
+ const MD_REF_DEF* def;
+ const MD_LINE* beg_line;
+ const MD_LINE* end_line;
+ CHAR* label;
+ SZ label_size;
+ int ret;
+
+ MD_ASSERT(CH(beg) == _T('[') || CH(beg) == _T('!'));
+ MD_ASSERT(CH(end-1) == _T(']'));
+
+ beg += (CH(beg) == _T('!') ? 2 : 1);
+ end--;
+
+ /* Find lines corresponding to the beg and end positions. */
+ MD_ASSERT(lines[0].beg <= beg);
+ beg_line = lines;
+ while(beg >= beg_line->end)
+ beg_line++;
+
+ MD_ASSERT(end <= lines[n_lines-1].end);
+ end_line = beg_line;
+ while(end >= end_line->end)
+ end_line++;
+
+ if(beg_line != end_line) {
+ MD_CHECK(md_merge_lines_alloc(ctx, beg, end, beg_line,
+ n_lines - (beg_line - lines), _T(' '), &label, &label_size));
+ } else {
+ label = (CHAR*) STR(beg);
+ label_size = end - beg;
+ }
+
+ def = md_lookup_ref_def(ctx, label, label_size);
+ if(def != NULL) {
+ attr->dest_beg = def->dest_beg;
+ attr->dest_end = def->dest_end;
+ attr->title = def->title;
+ attr->title_size = def->title_size;
+ attr->title_needs_free = FALSE;
+ }
+
+ if(beg_line != end_line)
+ free(label);
+
+ ret = (def != NULL);
+
+abort:
+ return ret;
+}
+
+static int
+md_is_inline_link_spec(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
+ OFF beg, OFF* p_end, MD_LINK_ATTR* attr)
+{
+ int line_index = 0;
+ int tmp_line_index;
+ OFF title_contents_beg;
+ OFF title_contents_end;
+ int title_contents_line_index;
+ int title_is_multiline;
+ OFF off = beg;
+ int ret = FALSE;
+
+ while(off >= lines[line_index].end)
+ line_index++;
+
+ MD_ASSERT(CH(off) == _T('('));
+ off++;
+
+ /* Optional white space with up to one line break. */
+ while(off < lines[line_index].end && ISWHITESPACE(off))
+ off++;
+ if(off >= lines[line_index].end && ISNEWLINE(off)) {
+ line_index++;
+ if(line_index >= n_lines)
+ return FALSE;
+ off = lines[line_index].beg;
+ }
+
+ /* Link destination may be omitted, but only when not also having a title. */
+ if(off < ctx->size && CH(off) == _T(')')) {
+ attr->dest_beg = off;
+ attr->dest_end = off;
+ attr->title = NULL;
+ attr->title_size = 0;
+ attr->title_needs_free = FALSE;
+ off++;
+ *p_end = off;
+ return TRUE;
+ }
+
+ /* Link destination. */
+ if(!md_is_link_destination(ctx, off, lines[line_index].end,
+ &off, &attr->dest_beg, &attr->dest_end))
+ return FALSE;
+
+ /* (Optional) title. */
+ if(md_is_link_title(ctx, lines + line_index, n_lines - line_index, off,
+ &off, &title_contents_line_index, &tmp_line_index,
+ &title_contents_beg, &title_contents_end))
+ {
+ title_is_multiline = (tmp_line_index != title_contents_line_index);
+ title_contents_line_index += line_index;
+ line_index += tmp_line_index;
+ } else {
+ /* Not a title. */
+ title_is_multiline = FALSE;
+ title_contents_beg = off;
+ title_contents_end = off;
+ title_contents_line_index = 0;
+ }
+
+ /* Optional whitespace followed with final ')'. */
+ while(off < lines[line_index].end && ISWHITESPACE(off))
+ off++;
+ if(off >= lines[line_index].end && ISNEWLINE(off)) {
+ line_index++;
+ if(line_index >= n_lines)
+ return FALSE;
+ off = lines[line_index].beg;
+ }
+ if(CH(off) != _T(')'))
+ goto abort;
+ off++;
+
+ if(title_contents_beg >= title_contents_end) {
+ attr->title = NULL;
+ attr->title_size = 0;
+ attr->title_needs_free = FALSE;
+ } else if(!title_is_multiline) {
+ attr->title = (CHAR*) STR(title_contents_beg);
+ attr->title_size = title_contents_end - title_contents_beg;
+ attr->title_needs_free = FALSE;
+ } else {
+ MD_CHECK(md_merge_lines_alloc(ctx, title_contents_beg, title_contents_end,
+ lines + title_contents_line_index, n_lines - title_contents_line_index,
+ _T('\n'), &attr->title, &attr->title_size));
+ attr->title_needs_free = TRUE;
+ }
+
+ *p_end = off;
+ ret = TRUE;
+
+abort:
+ return ret;
+}
+
+static void
+md_free_ref_defs(MD_CTX* ctx)
+{
+ int i;
+
+ for(i = 0; i < ctx->n_ref_defs; i++) {
+ MD_REF_DEF* def = &ctx->ref_defs[i];
+
+ if(def->label_needs_free)
+ free(def->label);
+ if(def->title_needs_free)
+ free(def->title);
+ }
+
+ free(ctx->ref_defs);
+}
+
+
+/******************************************
+ *** Processing Inlines (a.k.a Spans) ***
+ ******************************************/
+
+/* We process inlines in few phases:
+ *
+ * (1) We go through the block text and collect all significant characters
+ * which may start/end a span or some other significant position into
+ * ctx->marks[]. Core of this is what md_collect_marks() does.
+ *
+ * We also do some very brief preliminary context-less analysis, whether
+ * it might be opener or closer (e.g. of an emphasis span).
+ *
+ * This speeds the other steps as we do not need to re-iterate over all
+ * characters anymore.
+ *
+ * (2) We analyze each potential mark types, in order by their precedence.
+ *
+ * In each md_analyze_XXX() function, we re-iterate list of the marks,
+ * skipping already resolved regions (in preceding precedences) and try to
+ * resolve them.
+ *
+ * (2.1) For trivial marks, which are single (e.g. HTML entity), we just mark
+ * them as resolved.
+ *
+ * (2.2) For range-type marks, we analyze whether the mark could be closer
+ * and, if yes, whether there is some preceding opener it could satisfy.
+ *
+ * If not we check whether it could be really an opener and if yes, we
+ * remember it so subsequent closers may resolve it.
+ *
+ * (3) Finally, when all marks were analyzed, we render the block contents
+ * by calling MD_RENDERER::text() callback, interrupting by ::enter_span()
+ * or ::close_span() whenever we reach a resolved mark.
+ */
+
+
+/* The mark structure.
+ *
+ * '\\': Maybe escape sequence.
+ * '\0': NULL char.
+ * '*': Maybe (strong) emphasis start/end.
+ * '_': Maybe (strong) emphasis start/end.
+ * '~': Maybe strikethrough start/end (needs MD_FLAG_STRIKETHROUGH).
+ * '`': Maybe code span start/end.
+ * '&': Maybe start of entity.
+ * ';': Maybe end of entity.
+ * '<': Maybe start of raw HTML or autolink.
+ * '>': Maybe end of raw HTML or autolink.
+ * '[': Maybe start of link label or link text.
+ * '!': Equivalent of '[' for image.
+ * ']': Maybe end of link label or link text.
+ * '@': Maybe permissive e-mail auto-link (needs MD_FLAG_PERMISSIVEEMAILAUTOLINKS).
+ * ':': Maybe permissive URL auto-link (needs MD_FLAG_PERMISSIVEURLAUTOLINKS).
+ * '.': Maybe permissive WWW auto-link (needs MD_FLAG_PERMISSIVEWWWAUTOLINKS).
+ * 'D': Dummy mark, it reserves a space for splitting a previous mark
+ * (e.g. emphasis) or to make more space for storing some special data
+ * related to the preceding mark (e.g. link).
+ *
+ * Note that not all instances of these chars in the text imply creation of the
+ * structure. Only those which have (or may have, after we see more context)
+ * the special meaning.
+ *
+ * (Keep this struct as small as possible to fit as much of them into CPU
+ * cache line.)
+ */
+struct MD_MARK_tag {
+ OFF beg;
+ OFF end;
+
+ /* For unresolved openers, 'prev' and 'next' form the chain of open openers
+ * of given type 'ch'.
+ *
+ * During resolving, we disconnect from the chain and point to the
+ * corresponding counterpart so opener points to its closer and vice versa.
+ */
+ int prev;
+ int next;
+ CHAR ch;
+ unsigned char flags;
+};
+
+/* Mark flags (these apply to ALL mark types). */
+#define MD_MARK_POTENTIAL_OPENER 0x01 /* Maybe opener. */
+#define MD_MARK_POTENTIAL_CLOSER 0x02 /* Maybe closer. */
+#define MD_MARK_OPENER 0x04 /* Definitely opener. */
+#define MD_MARK_CLOSER 0x08 /* Definitely closer. */
+#define MD_MARK_RESOLVED 0x10 /* Resolved in any definite way. */
+
+/* Mark flags specific for various mark types (so they can share bits). */
+#define MD_MARK_EMPH_INTRAWORD 0x20 /* Helper for the "rule of 3". */
+#define MD_MARK_EMPH_MOD3_0 0x40
+#define MD_MARK_EMPH_MOD3_1 0x80
+#define MD_MARK_EMPH_MOD3_2 (0x40 | 0x80)
+#define MD_MARK_EMPH_MOD3_MASK (0x40 | 0x80)
+#define MD_MARK_AUTOLINK 0x20 /* Distinguisher for '<', '>'. */
+#define MD_MARK_VALIDPERMISSIVEAUTOLINK 0x20 /* For permissive autolinks. */
+
+static MD_MARKCHAIN*
+md_asterisk_chain(MD_CTX* ctx, unsigned flags)
+{
+ switch(flags & (MD_MARK_EMPH_INTRAWORD | MD_MARK_EMPH_MOD3_MASK)) {
+ case MD_MARK_EMPH_INTRAWORD | MD_MARK_EMPH_MOD3_0: return &ASTERISK_OPENERS_intraword_mod3_0;
+ case MD_MARK_EMPH_INTRAWORD | MD_MARK_EMPH_MOD3_1: return &ASTERISK_OPENERS_intraword_mod3_1;
+ case MD_MARK_EMPH_INTRAWORD | MD_MARK_EMPH_MOD3_2: return &ASTERISK_OPENERS_intraword_mod3_2;
+ case MD_MARK_EMPH_MOD3_0: return &ASTERISK_OPENERS_extraword_mod3_0;
+ case MD_MARK_EMPH_MOD3_1: return &ASTERISK_OPENERS_extraword_mod3_1;
+ case MD_MARK_EMPH_MOD3_2: return &ASTERISK_OPENERS_extraword_mod3_2;
+ default: MD_UNREACHABLE();
+ }
+ return NULL;
+}
+
+static MD_MARKCHAIN*
+md_mark_chain(MD_CTX* ctx, int mark_index)
+{
+ MD_MARK* mark = &ctx->marks[mark_index];
+
+ switch(mark->ch) {
+ case _T('*'): return md_asterisk_chain(ctx, mark->flags);
+ case _T('_'): return &UNDERSCORE_OPENERS;
+ case _T('~'): return &TILDE_OPENERS;
+ case _T('['): return &BRACKET_OPENERS;
+ case _T('|'): return &TABLECELLBOUNDARIES;
+ default: return NULL;
+ }
+}
+
+static MD_MARK*
+md_push_mark(MD_CTX* ctx)
+{
+ if(ctx->n_marks >= ctx->alloc_marks) {
+ MD_MARK* new_marks;
+
+ ctx->alloc_marks = (ctx->alloc_marks > 0 ? ctx->alloc_marks * 2 : 64);
+ new_marks = realloc(ctx->marks, ctx->alloc_marks * sizeof(MD_MARK));
+ if(new_marks == NULL) {
+ MD_LOG("realloc() failed.");
+ return NULL;
+ }
+
+ ctx->marks = new_marks;
+ }
+
+ return &ctx->marks[ctx->n_marks++];
+}
+
+#define PUSH_MARK_() \
+ do { \
+ mark = md_push_mark(ctx); \
+ if(mark == NULL) { \
+ ret = -1; \
+ goto abort; \
+ } \
+ } while(0)
+
+#define PUSH_MARK(ch_, beg_, end_, flags_) \
+ do { \
+ PUSH_MARK_(); \
+ mark->beg = (beg_); \
+ mark->end = (end_); \
+ mark->prev = -1; \
+ mark->next = -1; \
+ mark->ch = (char)(ch_); \
+ mark->flags = (flags_); \
+ } while(0)
+
+
+static void
+md_mark_chain_append(MD_CTX* ctx, MD_MARKCHAIN* chain, int mark_index)
+{
+ if(chain->tail >= 0)
+ ctx->marks[chain->tail].next = mark_index;
+ else
+ chain->head = mark_index;
+
+ ctx->marks[mark_index].prev = chain->tail;
+ chain->tail = mark_index;
+}
+
+/* Sometimes, we need to store a pointer into the mark. It is quite rare
+ * so we do not bother to make MD_MARK use union, and it can only happen
+ * for dummy marks. */
+static inline void
+md_mark_store_ptr(MD_CTX* ctx, int mark_index, void* ptr)
+{
+ MD_MARK* mark = &ctx->marks[mark_index];
+ MD_ASSERT(mark->ch == 'D');
+
+ /* Check only members beg and end are misused for this. */
+ MD_ASSERT(sizeof(void*) <= 2 * sizeof(OFF));
+ memcpy(mark, &ptr, sizeof(void*));
+}
+
+static inline void*
+md_mark_get_ptr(MD_CTX* ctx, int mark_index)
+{
+ void* ptr;
+ MD_MARK* mark = &ctx->marks[mark_index];
+ MD_ASSERT(mark->ch == 'D');
+ memcpy(&ptr, mark, sizeof(void*));
+ return ptr;
+}
+
+static void
+md_resolve_range(MD_CTX* ctx, MD_MARKCHAIN* chain, int opener_index, int closer_index)
+{
+ MD_MARK* opener = &ctx->marks[opener_index];
+ MD_MARK* closer = &ctx->marks[closer_index];
+
+ /* Remove opener from the list of openers. */
+ if(chain != NULL) {
+ if(opener->prev >= 0)
+ ctx->marks[opener->prev].next = opener->next;
+ else
+ chain->head = opener->next;
+
+ if(opener->next >= 0)
+ ctx->marks[opener->next].prev = opener->prev;
+ else
+ chain->tail = opener->prev;
+ }
+
+ /* Interconnect opener and closer and mark both as resolved. */
+ opener->next = closer_index;
+ opener->flags |= MD_MARK_OPENER | MD_MARK_RESOLVED;
+ closer->prev = opener_index;
+ closer->flags |= MD_MARK_CLOSER | MD_MARK_RESOLVED;
+}
+
+
+#define MD_ROLLBACK_ALL 0
+#define MD_ROLLBACK_CROSSING 1
+
+/* In the range ctx->marks[opener_index] ... [closer_index], undo some or all
+ * resolvings accordingly to these rules:
+ *
+ * (1) All openers BEFORE the range corresponding to any closer inside the
+ * range are un-resolved and they are re-added to their respective chains
+ * of unresolved openers. This ensures we can reuse the opener for closers
+ * AFTER the range.
+ *
+ * (2) If 'how' is MD_ROLLBACK_ALL, then ALL resolved marks inside the range
+ * are discarded.
+ *
+ * (3) If 'how' is MD_ROLLBACK_CROSSING, only closers with openers handled
+ * in (1) are discarded. I.e. pairs of openers and closers which are both
+ * inside the range are retained as well as any unpaired marks.
+ */
+static void
+md_rollback(MD_CTX* ctx, int opener_index, int closer_index, int how)
+{
+ int i;
+ int mark_index;
+
+ /* Cut all unresolved openers at the mark index. */
+ for(i = OPENERS_CHAIN_FIRST; i < OPENERS_CHAIN_LAST+1; i++) {
+ MD_MARKCHAIN* chain = &ctx->mark_chains[i];
+
+ while(chain->tail >= opener_index)
+ chain->tail = ctx->marks[chain->tail].prev;
+
+ if(chain->tail >= 0)
+ ctx->marks[chain->tail].next = -1;
+ else
+ chain->head = -1;
+ }
+
+ /* Go backwards so that un-resolved openers are re-added into their
+ * respective chains, in the right order. */
+ mark_index = closer_index - 1;
+ while(mark_index > opener_index) {
+ MD_MARK* mark = &ctx->marks[mark_index];
+ int mark_flags = mark->flags;
+ int discard_flag = (how == MD_ROLLBACK_ALL);
+
+ if(mark->flags & MD_MARK_CLOSER) {
+ int mark_opener_index = mark->prev;
+
+ /* Undo opener BEFORE the range. */
+ if(mark_opener_index < opener_index) {
+ MD_MARK* mark_opener = &ctx->marks[mark_opener_index];
+ MD_MARKCHAIN* chain;
+
+ mark_opener->flags &= ~(MD_MARK_OPENER | MD_MARK_CLOSER | MD_MARK_RESOLVED);
+ chain = md_mark_chain(ctx, opener_index);
+ if(chain != NULL) {
+ md_mark_chain_append(ctx, chain, mark_opener_index);
+ discard_flag = 1;
+ }
+ }
+ }
+
+ /* And reset our flags. */
+ if(discard_flag)
+ mark->flags &= ~(MD_MARK_OPENER | MD_MARK_CLOSER | MD_MARK_RESOLVED);
+
+ /* Jump as far as we can over unresolved or non-interesting marks. */
+ switch(how) {
+ case MD_ROLLBACK_CROSSING:
+ if((mark_flags & MD_MARK_CLOSER) && mark->prev > opener_index) {
+ /* If we are closer with opener INSIDE the range, there may
+ * not be any other crosser inside the subrange. */
+ mark_index = mark->prev;
+ break;
+ }
+ /* Pass through. */
+ default:
+ mark_index--;
+ break;
+ }
+ }
+}
+
+static void
+md_build_mark_char_map(MD_CTX* ctx)
+{
+ memset(ctx->mark_char_map, 0, sizeof(ctx->mark_char_map));
+
+ ctx->mark_char_map['\\'] = 1;
+ ctx->mark_char_map['*'] = 1;
+ ctx->mark_char_map['_'] = 1;
+ ctx->mark_char_map['`'] = 1;
+ ctx->mark_char_map['&'] = 1;
+ ctx->mark_char_map[';'] = 1;
+ ctx->mark_char_map['<'] = 1;
+ ctx->mark_char_map['>'] = 1;
+ ctx->mark_char_map['['] = 1;
+ ctx->mark_char_map['!'] = 1;
+ ctx->mark_char_map[']'] = 1;
+ ctx->mark_char_map['\0'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_STRIKETHROUGH)
+ ctx->mark_char_map['~'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_LATEXMATHSPANS)
+ ctx->mark_char_map['$'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_PERMISSIVEEMAILAUTOLINKS)
+ ctx->mark_char_map['@'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_PERMISSIVEURLAUTOLINKS)
+ ctx->mark_char_map[':'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_PERMISSIVEWWWAUTOLINKS)
+ ctx->mark_char_map['.'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_TABLES)
+ ctx->mark_char_map['|'] = 1;
+
+ if(ctx->parser.flags & MD_FLAG_COLLAPSEWHITESPACE) {
+ int i;
+
+ for(i = 0; i < (int) sizeof(ctx->mark_char_map); i++) {
+ if(ISWHITESPACE_(i))
+ ctx->mark_char_map[i] = 1;
+ }
+ }
+}
+
+/* We limit code span marks to lower then 32 backticks. This solves the
+ * pathologic case of too many openers, each of different length: Their
+ * resolving would be then O(n^2). */
+#define CODESPAN_MARK_MAXLEN 32
+
+static int
+md_is_code_span(MD_CTX* ctx, const MD_LINE* lines, int n_lines, OFF beg,
+ OFF* p_opener_beg, OFF* p_opener_end,
+ OFF* p_closer_beg, OFF* p_closer_end,
+ OFF last_potential_closers[CODESPAN_MARK_MAXLEN],
+ int* p_reached_paragraph_end)
+{
+ OFF opener_beg = beg;
+ OFF opener_end;
+ OFF closer_beg;
+ OFF closer_end;
+ SZ mark_len;
+ OFF line_end;
+ int has_space_after_opener = FALSE;
+ int has_eol_after_opener = FALSE;
+ int has_space_before_closer = FALSE;
+ int has_eol_before_closer = FALSE;
+ int has_only_space = TRUE;
+ int line_index = 0;
+
+ line_end = lines[0].end;
+ opener_end = opener_beg;
+ while(opener_end < line_end && CH(opener_end) == _T('`'))
+ opener_end++;
+ has_space_after_opener = (opener_end < line_end && CH(opener_end) == _T(' '));
+ has_eol_after_opener = (opener_end == line_end);
+
+ /* The caller needs to know end of the opening mark even if we fail. */
+ *p_opener_end = opener_end;
+
+ mark_len = opener_end - opener_beg;
+ if(mark_len > CODESPAN_MARK_MAXLEN)
+ return FALSE;
+
+ /* Check whether we already know there is no closer of this length.
+ * If so, re-scan does no sense. This fixes issue #59. */
+ if(last_potential_closers[mark_len-1] >= lines[n_lines-1].end ||
+ (*p_reached_paragraph_end && last_potential_closers[mark_len-1] < opener_end))
+ return FALSE;
+
+ closer_beg = opener_end;
+ closer_end = opener_end;
+
+ /* Find closer mark. */
+ while(TRUE) {
+ while(closer_beg < line_end && CH(closer_beg) != _T('`')) {
+ if(CH(closer_beg) != _T(' '))
+ has_only_space = FALSE;
+ closer_beg++;
+ }
+ closer_end = closer_beg;
+ while(closer_end < line_end && CH(closer_end) == _T('`'))
+ closer_end++;
+
+ if(closer_end - closer_beg == mark_len) {
+ /* Success. */
+ has_space_before_closer = (closer_beg > lines[line_index].beg && CH(closer_beg-1) == _T(' '));
+ has_eol_before_closer = (closer_beg == lines[line_index].beg);
+ break;
+ }
+
+ if(closer_end - closer_beg > 0) {
+ /* We have found a back-tick which is not part of the closer. */
+ has_only_space = FALSE;
+
+ /* But if we eventually fail, remember it as a potential closer
+ * of its own length for future attempts. This mitigates needs for
+ * rescans. */
+ if(closer_end - closer_beg < CODESPAN_MARK_MAXLEN) {
+ if(closer_beg > last_potential_closers[closer_end - closer_beg - 1])
+ last_potential_closers[closer_end - closer_beg - 1] = closer_beg;
+ }
+ }
+
+ if(closer_end >= line_end) {
+ line_index++;
+ if(line_index >= n_lines) {
+ /* Reached end of the paragraph and still nothing. */
+ *p_reached_paragraph_end = TRUE;
+ return FALSE;
+ }
+ /* Try on the next line. */
+ line_end = lines[line_index].end;
+ closer_beg = lines[line_index].beg;
+ } else {
+ closer_beg = closer_end;
+ }
+ }
+
+ /* If there is a space or a new line both after and before the opener
+ * (and if the code span is not made of spaces only), consume one initial
+ * and one trailing space as part of the marks. */
+ if(!has_only_space &&
+ (has_space_after_opener || has_eol_after_opener) &&
+ (has_space_before_closer || has_eol_before_closer))
+ {
+ if(has_space_after_opener)
+ opener_end++;
+ else
+ opener_end = lines[1].beg;
+
+ if(has_space_before_closer)
+ closer_beg--;
+ else {
+ closer_beg = lines[line_index-1].end;
+ /* We need to eat the preceding "\r\n" but not any line trailing
+ * spaces. */
+ while(closer_beg < ctx->size && ISBLANK(closer_beg))
+ closer_beg++;
+ }
+ }
+
+ *p_opener_beg = opener_beg;
+ *p_opener_end = opener_end;
+ *p_closer_beg = closer_beg;
+ *p_closer_end = closer_end;
+ return TRUE;
+}
+
+static int
+md_is_autolink_uri(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg+1;
+
+ MD_ASSERT(CH(beg) == _T('<'));
+
+ /* Check for scheme. */
+ if(off >= max_end || !ISASCII(off))
+ return FALSE;
+ off++;
+ while(1) {
+ if(off >= max_end)
+ return FALSE;
+ if(off - beg > 32)
+ return FALSE;
+ if(CH(off) == _T(':') && off - beg >= 3)
+ break;
+ if(!ISALNUM(off) && CH(off) != _T('+') && CH(off) != _T('-') && CH(off) != _T('.'))
+ return FALSE;
+ off++;
+ }
+
+ /* Check the path after the scheme. */
+ while(off < max_end && CH(off) != _T('>')) {
+ if(ISWHITESPACE(off) || ISCNTRL(off) || CH(off) == _T('<'))
+ return FALSE;
+ off++;
+ }
+
+ if(off >= max_end)
+ return FALSE;
+
+ MD_ASSERT(CH(off) == _T('>'));
+ *p_end = off+1;
+ return TRUE;
+}
+
+static int
+md_is_autolink_email(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end)
+{
+ OFF off = beg + 1;
+ int label_len;
+
+ MD_ASSERT(CH(beg) == _T('<'));
+
+ /* The code should correspond to this regexp:
+ /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+
+ @[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?
+ (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
+ */
+
+ /* Username (before '@'). */
+ while(off < max_end && (ISALNUM(off) || ISANYOF(off, _T(".!#$%&'*+/=?^_`{|}~-"))))
+ off++;
+ if(off <= beg+1)
+ return FALSE;
+
+ /* '@' */
+ if(off >= max_end || CH(off) != _T('@'))
+ return FALSE;
+ off++;
+
+ /* Labels delimited with '.'; each label is sequence of 1 - 62 alnum
+ * characters or '-', but '-' is not allowed as first or last char. */
+ label_len = 0;
+ while(off < max_end) {
+ if(ISALNUM(off))
+ label_len++;
+ else if(CH(off) == _T('-') && label_len > 0)
+ label_len++;
+ else if(CH(off) == _T('.') && label_len > 0 && CH(off-1) != _T('-'))
+ label_len = 0;
+ else
+ break;
+
+ if(label_len > 62)
+ return FALSE;
+
+ off++;
+ }
+
+ if(label_len <= 0 || off >= max_end || CH(off) != _T('>') || CH(off-1) == _T('-'))
+ return FALSE;
+
+ *p_end = off+1;
+ return TRUE;
+}
+
+static int
+md_is_autolink(MD_CTX* ctx, OFF beg, OFF max_end, OFF* p_end, int* p_missing_mailto)
+{
+ if(md_is_autolink_uri(ctx, beg, max_end, p_end)) {
+ *p_missing_mailto = FALSE;
+ return TRUE;
+ }
+
+ if(md_is_autolink_email(ctx, beg, max_end, p_end)) {
+ *p_missing_mailto = TRUE;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static int
+md_collect_marks(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mode)
+{
+ int i;
+ int ret = 0;
+ MD_MARK* mark;
+ OFF codespan_last_potential_closers[CODESPAN_MARK_MAXLEN] = { 0 };
+ int codespan_scanned_till_paragraph_end = FALSE;
+
+ for(i = 0; i < n_lines; i++) {
+ const MD_LINE* line = &lines[i];
+ OFF off = line->beg;
+ OFF line_end = line->end;
+
+ while(TRUE) {
+ CHAR ch;
+
+#ifdef MD4C_USE_UTF16
+ /* For UTF-16, mark_char_map[] covers only ASCII. */
+ #define IS_MARK_CHAR(off) ((CH(off) < SIZEOF_ARRAY(ctx->mark_char_map)) && \
+ (ctx->mark_char_map[(unsigned char) CH(off)]))
+#else
+ /* For 8-bit encodings, mark_char_map[] covers all 256 elements. */
+ #define IS_MARK_CHAR(off) (ctx->mark_char_map[(unsigned char) CH(off)])
+#endif
+
+ /* Optimization: Use some loop unrolling. */
+ while(off + 3 < line_end && !IS_MARK_CHAR(off+0) && !IS_MARK_CHAR(off+1)
+ && !IS_MARK_CHAR(off+2) && !IS_MARK_CHAR(off+3))
+ off += 4;
+ while(off < line_end && !IS_MARK_CHAR(off+0))
+ off++;
+
+ if(off >= line_end)
+ break;
+
+ ch = CH(off);
+
+ /* A backslash escape.
+ * It can go beyond line->end as it may involve escaped new
+ * line to form a hard break. */
+ if(ch == _T('\\') && off+1 < ctx->size && (ISPUNCT(off+1) || ISNEWLINE(off+1))) {
+ /* Hard-break cannot be on the last line of the block. */
+ if(!ISNEWLINE(off+1) || i+1 < n_lines)
+ PUSH_MARK(ch, off, off+2, MD_MARK_RESOLVED);
+ off += 2;
+ continue;
+ }
+
+ /* A potential (string) emphasis start/end. */
+ if(ch == _T('*') || ch == _T('_')) {
+ OFF tmp = off+1;
+ int left_level; /* What precedes: 0 = whitespace; 1 = punctuation; 2 = other char. */
+ int right_level; /* What follows: 0 = whitespace; 1 = punctuation; 2 = other char. */
+
+ while(tmp < line_end && CH(tmp) == ch)
+ tmp++;
+
+ if(off == line->beg || ISUNICODEWHITESPACEBEFORE(off))
+ left_level = 0;
+ else if(ISUNICODEPUNCTBEFORE(off))
+ left_level = 1;
+ else
+ left_level = 2;
+
+ if(tmp == line_end || ISUNICODEWHITESPACE(tmp))
+ right_level = 0;
+ else if(ISUNICODEPUNCT(tmp))
+ right_level = 1;
+ else
+ right_level = 2;
+
+ /* Intra-word underscore doesn't have special meaning. */
+ if(ch == _T('_') && left_level == 2 && right_level == 2) {
+ left_level = 0;
+ right_level = 0;
+ }
+
+ if(left_level != 0 || right_level != 0) {
+ unsigned flags = 0;
+
+ if(left_level > 0 && left_level >= right_level)
+ flags |= MD_MARK_POTENTIAL_CLOSER;
+ if(right_level > 0 && right_level >= left_level)
+ flags |= MD_MARK_POTENTIAL_OPENER;
+ if(left_level == 2 && right_level == 2)
+ flags |= MD_MARK_EMPH_INTRAWORD;
+
+ /* For "the rule of three" we need to remember the original
+ * size of the mark (modulo three), before we potentially
+ * split the mark when being later resolved partially by some
+ * shorter closer. */
+ switch((tmp - off) % 3) {
+ case 0: flags |= MD_MARK_EMPH_MOD3_0; break;
+ case 1: flags |= MD_MARK_EMPH_MOD3_1; break;
+ case 2: flags |= MD_MARK_EMPH_MOD3_2; break;
+ }
+
+ PUSH_MARK(ch, off, tmp, flags);
+
+ /* During resolving, multiple asterisks may have to be
+ * split into independent span start/ends. Consider e.g.
+ * "**foo* bar*". Therefore we push also some empty dummy
+ * marks to have enough space for that. */
+ off++;
+ while(off < tmp) {
+ PUSH_MARK('D', off, off, 0);
+ off++;
+ }
+ continue;
+ }
+
+ off = tmp;
+ continue;
+ }
+
+ /* A potential code span start/end. */
+ if(ch == _T('`')) {
+ OFF opener_beg, opener_end;
+ OFF closer_beg, closer_end;
+ int is_code_span;
+
+ is_code_span = md_is_code_span(ctx, lines + i, n_lines - i, off,
+ &opener_beg, &opener_end, &closer_beg, &closer_end,
+ codespan_last_potential_closers,
+ &codespan_scanned_till_paragraph_end);
+ if(is_code_span) {
+ PUSH_MARK(_T('`'), opener_beg, opener_end, MD_MARK_OPENER | MD_MARK_RESOLVED);
+ PUSH_MARK(_T('`'), closer_beg, closer_end, MD_MARK_CLOSER | MD_MARK_RESOLVED);
+ ctx->marks[ctx->n_marks-2].next = ctx->n_marks-1;
+ ctx->marks[ctx->n_marks-1].prev = ctx->n_marks-2;
+
+ off = closer_end;
+
+ /* Advance the current line accordingly. */
+ while(off > line_end) {
+ i++;
+ line++;
+ line_end = line->end;
+ }
+ continue;
+ }
+
+ off = opener_end;
+ continue;
+ }
+
+ /* A potential entity start. */
+ if(ch == _T('&')) {
+ PUSH_MARK(ch, off, off+1, MD_MARK_POTENTIAL_OPENER);
+ off++;
+ continue;
+ }
+
+ /* A potential entity end. */
+ if(ch == _T(';')) {
+ /* We surely cannot be entity unless the previous mark is '&'. */
+ if(ctx->n_marks > 0 && ctx->marks[ctx->n_marks-1].ch == _T('&'))
+ PUSH_MARK(ch, off, off+1, MD_MARK_POTENTIAL_CLOSER);
+
+ off++;
+ continue;
+ }
+
+ /* A potential autolink or raw HTML start/end. */
+ if(ch == _T('<')) {
+ int is_autolink;
+ OFF autolink_end;
+ int missing_mailto;
+
+ if(!(ctx->parser.flags & MD_FLAG_NOHTMLSPANS)) {
+ int is_html;
+ OFF html_end;
+
+ /* Given the nature of the raw HTML, we have to recognize
+ * it here. Doing so later in md_analyze_lt_gt() could
+ * open can of worms of quadratic complexity. */
+ is_html = md_is_html_any(ctx, lines + i, n_lines - i, off,
+ lines[n_lines-1].end, &html_end);
+ if(is_html) {
+ PUSH_MARK(_T('<'), off, off, MD_MARK_OPENER | MD_MARK_RESOLVED);
+ PUSH_MARK(_T('>'), html_end, html_end, MD_MARK_CLOSER | MD_MARK_RESOLVED);
+ ctx->marks[ctx->n_marks-2].next = ctx->n_marks-1;
+ ctx->marks[ctx->n_marks-1].prev = ctx->n_marks-2;
+ off = html_end;
+
+ /* Advance the current line accordingly. */
+ while(off > line_end) {
+ i++;
+ line++;
+ line_end = line->end;
+ }
+ continue;
+ }
+ }
+
+ is_autolink = md_is_autolink(ctx, off, lines[n_lines-1].end,
+ &autolink_end, &missing_mailto);
+ if(is_autolink) {
+ PUSH_MARK((missing_mailto ? _T('@') : _T('<')), off, off+1,
+ MD_MARK_OPENER | MD_MARK_RESOLVED | MD_MARK_AUTOLINK);
+ PUSH_MARK(_T('>'), autolink_end-1, autolink_end,
+ MD_MARK_CLOSER | MD_MARK_RESOLVED | MD_MARK_AUTOLINK);
+ ctx->marks[ctx->n_marks-2].next = ctx->n_marks-1;
+ ctx->marks[ctx->n_marks-1].prev = ctx->n_marks-2;
+ off = autolink_end;
+ continue;
+ }
+
+ off++;
+ continue;
+ }
+
+ /* A potential link or its part. */
+ if(ch == _T('[') || (ch == _T('!') && off+1 < line_end && CH(off+1) == _T('['))) {
+ OFF tmp = (ch == _T('[') ? off+1 : off+2);
+ PUSH_MARK(ch, off, tmp, MD_MARK_POTENTIAL_OPENER);
+ off = tmp;
+ /* Two dummies to make enough place for data we need if it is
+ * a link. */
+ PUSH_MARK('D', off, off, 0);
+ PUSH_MARK('D', off, off, 0);
+ continue;
+ }
+ if(ch == _T(']')) {
+ PUSH_MARK(ch, off, off+1, MD_MARK_POTENTIAL_CLOSER);
+ off++;
+ continue;
+ }
+
+ /* A potential permissive e-mail autolink. */
+ if(ch == _T('@')) {
+ if(line->beg + 1 <= off && ISALNUM(off-1) &&
+ off + 3 < line->end && ISALNUM(off+1))
+ {
+ PUSH_MARK(ch, off, off+1, MD_MARK_POTENTIAL_OPENER);
+ /* Push a dummy as a reserve for a closer. */
+ PUSH_MARK('D', off, off, 0);
+ }
+
+ off++;
+ continue;
+ }
+
+ /* A potential permissive URL autolink. */
+ if(ch == _T(':')) {
+ static struct {
+ const CHAR* scheme;
+ SZ scheme_size;
+ const CHAR* suffix;
+ SZ suffix_size;
+ } scheme_map[] = {
+ /* In the order from the most frequently used, arguably. */
+ { _T("http"), 4, _T("//"), 2 },
+ { _T("https"), 5, _T("//"), 2 },
+ { _T("ftp"), 3, _T("//"), 2 }
+ };
+ int scheme_index;
+
+ for(scheme_index = 0; scheme_index < (int) SIZEOF_ARRAY(scheme_map); scheme_index++) {
+ const CHAR* scheme = scheme_map[scheme_index].scheme;
+ const SZ scheme_size = scheme_map[scheme_index].scheme_size;
+ const CHAR* suffix = scheme_map[scheme_index].suffix;
+ const SZ suffix_size = scheme_map[scheme_index].suffix_size;
+
+ if(line->beg + scheme_size <= off && md_ascii_eq(STR(off-scheme_size), scheme, scheme_size) &&
+ (line->beg + scheme_size == off || ISWHITESPACE(off-scheme_size-1) || ISANYOF(off-scheme_size-1, _T("*_~(["))) &&
+ off + 1 + suffix_size < line->end && md_ascii_eq(STR(off+1), suffix, suffix_size))
+ {
+ PUSH_MARK(ch, off-scheme_size, off+1+suffix_size, MD_MARK_POTENTIAL_OPENER);
+ /* Push a dummy as a reserve for a closer. */
+ PUSH_MARK('D', off, off, 0);
+ off += 1 + suffix_size;
+ continue;
+ }
+ }
+
+ off++;
+ continue;
+ }
+
+ /* A potential permissive WWW autolink. */
+ if(ch == _T('.')) {
+ if(line->beg + 3 <= off && md_ascii_eq(STR(off-3), _T("www"), 3) &&
+ (line->beg + 3 == off || ISWHITESPACE(off-4) || ISANYOF(off-4, _T("*_~(["))) &&
+ off + 1 < line_end)
+ {
+ PUSH_MARK(ch, off-3, off+1, MD_MARK_POTENTIAL_OPENER);
+ /* Push a dummy as a reserve for a closer. */
+ PUSH_MARK('D', off, off, 0);
+ off++;
+ continue;
+ }
+
+ off++;
+ continue;
+ }
+
+ /* A potential table cell boundary. */
+ if(table_mode && ch == _T('|')) {
+ PUSH_MARK(ch, off, off+1, 0);
+ off++;
+ continue;
+ }
+
+ /* A potential strikethrough start/end. */
+ if(ch == _T('~')) {
+ OFF tmp = off+1;
+
+ while(tmp < line_end && CH(tmp) == _T('~'))
+ tmp++;
+
+ PUSH_MARK(ch, off, tmp, MD_MARK_POTENTIAL_OPENER | MD_MARK_POTENTIAL_CLOSER);
+ off = tmp;
+ continue;
+ }
+
+ /* A potential equation start/end */
+ if(ch == _T('$')) {
+ /* We can have at most two consecutive $ signs,
+ * where two dollar signs signify a display equation. */
+ OFF tmp = off+1;
+
+ while(tmp < line_end && CH(tmp) == _T('$'))
+ tmp++;
+
+ if (tmp - off <= 2)
+ PUSH_MARK(ch, off, tmp, MD_MARK_POTENTIAL_OPENER | MD_MARK_POTENTIAL_CLOSER);
+ off = tmp;
+ continue;
+ }
+
+ /* Turn non-trivial whitespace into single space. */
+ if(ISWHITESPACE_(ch)) {
+ OFF tmp = off+1;
+
+ while(tmp < line_end && ISWHITESPACE(tmp))
+ tmp++;
+
+ if(tmp - off > 1 || ch != _T(' '))
+ PUSH_MARK(ch, off, tmp, MD_MARK_RESOLVED);
+
+ off = tmp;
+ continue;
+ }
+
+ /* NULL character. */
+ if(ch == _T('\0')) {
+ PUSH_MARK(ch, off, off+1, MD_MARK_RESOLVED);
+ off++;
+ continue;
+ }
+
+ off++;
+ }
+ }
+
+ /* Add a dummy mark at the end of the mark vector to simplify
+ * process_inlines(). */
+ PUSH_MARK(127, ctx->size, ctx->size, MD_MARK_RESOLVED);
+
+abort:
+ return ret;
+}
+
+static void
+md_analyze_bracket(MD_CTX* ctx, int mark_index)
+{
+ /* We cannot really resolve links here as for that we would need
+ * more context. E.g. a following pair of brackets (reference link),
+ * or enclosing pair of brackets (if the inner is the link, the outer
+ * one cannot be.)
+ *
+ * Therefore we here only construct a list of resolved '[' ']' pairs
+ * ordered by position of the closer. This allows ur to analyze what is
+ * or is not link in the right order, from inside to outside in case
+ * of nested brackets.
+ *
+ * The resolving itself is deferred into md_resolve_links().
+ */
+
+ MD_MARK* mark = &ctx->marks[mark_index];
+
+ if(mark->flags & MD_MARK_POTENTIAL_OPENER) {
+ md_mark_chain_append(ctx, &BRACKET_OPENERS, mark_index);
+ return;
+ }
+
+ if(BRACKET_OPENERS.tail >= 0) {
+ /* Pop the opener from the chain. */
+ int opener_index = BRACKET_OPENERS.tail;
+ MD_MARK* opener = &ctx->marks[opener_index];
+ if(opener->prev >= 0)
+ ctx->marks[opener->prev].next = -1;
+ else
+ BRACKET_OPENERS.head = -1;
+ BRACKET_OPENERS.tail = opener->prev;
+
+ /* Interconnect the opener and closer. */
+ opener->next = mark_index;
+ mark->prev = opener_index;
+
+ /* Add the pair into chain of potential links for md_resolve_links().
+ * Note we misuse opener->prev for this as opener->next points to its
+ * closer. */
+ if(ctx->unresolved_link_tail >= 0)
+ ctx->marks[ctx->unresolved_link_tail].prev = opener_index;
+ else
+ ctx->unresolved_link_head = opener_index;
+ ctx->unresolved_link_tail = opener_index;
+ opener->prev = -1;
+ }
+}
+
+/* Forward declaration. */
+static void md_analyze_link_contents(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
+ int mark_beg, int mark_end);
+
+static int
+md_resolve_links(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
+{
+ int opener_index = ctx->unresolved_link_head;
+ OFF last_link_beg = 0;
+ OFF last_link_end = 0;
+ OFF last_img_beg = 0;
+ OFF last_img_end = 0;
+
+ while(opener_index >= 0) {
+ MD_MARK* opener = &ctx->marks[opener_index];
+ int closer_index = opener->next;
+ MD_MARK* closer = &ctx->marks[closer_index];
+ int next_index = opener->prev;
+ MD_MARK* next_opener;
+ MD_MARK* next_closer;
+ MD_LINK_ATTR attr;
+ int is_link = FALSE;
+
+ if(next_index >= 0) {
+ next_opener = &ctx->marks[next_index];
+ next_closer = &ctx->marks[next_opener->next];
+ } else {
+ next_opener = NULL;
+ next_closer = NULL;
+ }
+
+ /* If nested ("[ [ ] ]"), we need to make sure that:
+ * - The outer does not end inside of (...) belonging to the inner.
+ * - The outer cannot be link if the inner is link (i.e. not image).
+ *
+ * (Note we here analyze from inner to outer as the marks are ordered
+ * by closer->beg.)
+ */
+ if((opener->beg < last_link_beg && closer->end < last_link_end) ||
+ (opener->beg < last_img_beg && closer->end < last_img_end) ||
+ (opener->beg < last_link_end && opener->ch == '['))
+ {
+ opener_index = next_index;
+ continue;
+ }
+
+ if(next_opener != NULL && next_opener->beg == closer->end) {
+ if(next_closer->beg > closer->end + 1) {
+ /* Might be full reference link. */
+ is_link = md_is_link_reference(ctx, lines, n_lines, next_opener->beg, next_closer->end, &attr);
+ } else {
+ /* Might be shortcut reference link. */
+ is_link = md_is_link_reference(ctx, lines, n_lines, opener->beg, closer->end, &attr);
+ }
+
+ if(is_link < 0)
+ return -1;
+
+ if(is_link) {
+ /* Eat the 2nd "[...]". */
+ closer->end = next_closer->end;
+ }
+ } else {
+ if(closer->end < ctx->size && CH(closer->end) == _T('(')) {
+ /* Might be inline link. */
+ OFF inline_link_end = UINT_MAX;
+
+ is_link = md_is_inline_link_spec(ctx, lines, n_lines, closer->end, &inline_link_end, &attr);
+ if(is_link < 0)
+ return -1;
+
+ /* Check the closing ')' is not inside an already resolved range
+ * (i.e. a range with a higher priority), e.g. a code span. */
+ if(is_link) {
+ int i = closer_index + 1;
+
+ while(i < ctx->n_marks) {
+ MD_MARK* mark = &ctx->marks[i];
+
+ if(mark->beg >= inline_link_end)
+ break;
+ if((mark->flags & (MD_MARK_OPENER | MD_MARK_RESOLVED)) == (MD_MARK_OPENER | MD_MARK_RESOLVED)) {
+ if(ctx->marks[mark->next].beg >= inline_link_end) {
+ /* Cancel the link status. */
+ if(attr.title_needs_free)
+ free(attr.title);
+ is_link = FALSE;
+ break;
+ }
+
+ i = mark->next + 1;
+ } else {
+ i++;
+ }
+ }
+ }
+
+ if(is_link) {
+ /* Eat the "(...)" */
+ closer->end = inline_link_end;
+ }
+ }
+
+ if(!is_link) {
+ /* Might be collapsed reference link. */
+ is_link = md_is_link_reference(ctx, lines, n_lines, opener->beg, closer->end, &attr);
+ if(is_link < 0)
+ return -1;
+ }
+ }
+
+ if(is_link) {
+ /* Resolve the brackets as a link. */
+ opener->flags |= MD_MARK_OPENER | MD_MARK_RESOLVED;
+ closer->flags |= MD_MARK_CLOSER | MD_MARK_RESOLVED;
+
+ /* If it is a link, we store the destination and title in the two
+ * dummy marks after the opener. */
+ MD_ASSERT(ctx->marks[opener_index+1].ch == 'D');
+ ctx->marks[opener_index+1].beg = attr.dest_beg;
+ ctx->marks[opener_index+1].end = attr.dest_end;
+
+ MD_ASSERT(ctx->marks[opener_index+2].ch == 'D');
+ md_mark_store_ptr(ctx, opener_index+2, attr.title);
+ if(attr.title_needs_free)
+ md_mark_chain_append(ctx, &PTR_CHAIN, opener_index+2);
+ ctx->marks[opener_index+2].prev = attr.title_size;
+
+ if(opener->ch == '[') {
+ last_link_beg = opener->beg;
+ last_link_end = closer->end;
+ } else {
+ last_img_beg = opener->beg;
+ last_img_end = closer->end;
+ }
+
+ md_analyze_link_contents(ctx, lines, n_lines, opener_index+1, closer_index);
+ }
+
+ opener_index = next_index;
+ }
+
+ return 0;
+}
+
+/* Analyze whether the mark '&' starts a HTML entity.
+ * If so, update its flags as well as flags of corresponding closer ';'. */
+static void
+md_analyze_entity(MD_CTX* ctx, int mark_index)
+{
+ MD_MARK* opener = &ctx->marks[mark_index];
+ MD_MARK* closer;
+ OFF off;
+
+ /* Cannot be entity if there is no closer as the next mark.
+ * (Any other mark between would mean strange character which cannot be
+ * part of the entity.
+ *
+ * So we can do all the work on '&' and do not call this later for the
+ * closing mark ';'.
+ */
+ if(mark_index + 1 >= ctx->n_marks)
+ return;
+ closer = &ctx->marks[mark_index+1];
+ if(closer->ch != ';')
+ return;
+
+ if(md_is_entity(ctx, opener->beg, closer->end, &off)) {
+ MD_ASSERT(off == closer->end);
+
+ md_resolve_range(ctx, NULL, mark_index, mark_index+1);
+ opener->end = closer->end;
+ }
+}
+
+static void
+md_analyze_table_cell_boundary(MD_CTX* ctx, int mark_index)
+{
+ MD_MARK* mark = &ctx->marks[mark_index];
+ mark->flags |= MD_MARK_RESOLVED;
+
+ md_mark_chain_append(ctx, &TABLECELLBOUNDARIES, mark_index);
+ ctx->n_table_cell_boundaries++;
+}
+
+/* Split a longer mark into two. The new mark takes the given count of
+ * characters. May only be called if an adequate number of dummy 'D' marks
+ * follows.
+ */
+static int
+md_split_emph_mark(MD_CTX* ctx, int mark_index, SZ n)
+{
+ MD_MARK* mark = &ctx->marks[mark_index];
+ int new_mark_index = mark_index + (mark->end - mark->beg - n);
+ MD_MARK* dummy = &ctx->marks[new_mark_index];
+
+ MD_ASSERT(mark->end - mark->beg > n);
+ MD_ASSERT(dummy->ch == 'D');
+
+ memcpy(dummy, mark, sizeof(MD_MARK));
+ mark->end -= n;
+ dummy->beg = mark->end;
+
+ return new_mark_index;
+}
+
+static void
+md_analyze_emph(MD_CTX* ctx, int mark_index)
+{
+ MD_MARK* mark = &ctx->marks[mark_index];
+ MD_MARKCHAIN* chain = md_mark_chain(ctx, mark_index);
+
+ /* If we can be a closer, try to resolve with the preceding opener. */
+ if(mark->flags & MD_MARK_POTENTIAL_CLOSER) {
+ MD_MARK* opener = NULL;
+ int opener_index;
+
+ if(mark->ch == _T('*')) {
+ MD_MARKCHAIN* opener_chains[6];
+ int i, n_opener_chains;
+ unsigned flags = mark->flags;
+
+ /* Apply "rule of three". (This is why we break asterisk opener
+ * marks into multiple chains.) */
+ n_opener_chains = 0;
+ opener_chains[n_opener_chains++] = &ASTERISK_OPENERS_intraword_mod3_0;
+ if((flags & MD_MARK_EMPH_MOD3_MASK) != MD_MARK_EMPH_MOD3_2)
+ opener_chains[n_opener_chains++] = &ASTERISK_OPENERS_intraword_mod3_1;
+ if((flags & MD_MARK_EMPH_MOD3_MASK) != MD_MARK_EMPH_MOD3_1)
+ opener_chains[n_opener_chains++] = &ASTERISK_OPENERS_intraword_mod3_2;
+ opener_chains[n_opener_chains++] = &ASTERISK_OPENERS_extraword_mod3_0;
+ if(!(flags & MD_MARK_EMPH_INTRAWORD) || (flags & MD_MARK_EMPH_MOD3_MASK) != MD_MARK_EMPH_MOD3_2)
+ opener_chains[n_opener_chains++] = &ASTERISK_OPENERS_extraword_mod3_1;
+ if(!(flags & MD_MARK_EMPH_INTRAWORD) || (flags & MD_MARK_EMPH_MOD3_MASK) != MD_MARK_EMPH_MOD3_1)
+ opener_chains[n_opener_chains++] = &ASTERISK_OPENERS_extraword_mod3_2;
+
+ /* Opener is the most recent mark from the allowed chains. */
+ for(i = 0; i < n_opener_chains; i++) {
+ if(opener_chains[i]->tail >= 0) {
+ int tmp_index = opener_chains[i]->tail;
+ MD_MARK* tmp_mark = &ctx->marks[tmp_index];
+ if(opener == NULL || tmp_mark->end > opener->end) {
+ opener_index = tmp_index;
+ opener = tmp_mark;
+ }
+ }
+ }
+ } else {
+ /* Simple emph. mark */
+ if(chain->tail >= 0) {
+ opener_index = chain->tail;
+ opener = &ctx->marks[opener_index];
+ }
+ }
+
+ /* Resolve, if we have found matching opener. */
+ if(opener != NULL) {
+ SZ opener_size = opener->end - opener->beg;
+ SZ closer_size = mark->end - mark->beg;
+
+ if(opener_size > closer_size) {
+ opener_index = md_split_emph_mark(ctx, opener_index, closer_size);
+ md_mark_chain_append(ctx, md_mark_chain(ctx, opener_index), opener_index);
+ } else if(opener_size < closer_size) {
+ md_split_emph_mark(ctx, mark_index, closer_size - opener_size);
+ }
+
+ md_rollback(ctx, opener_index, mark_index, MD_ROLLBACK_CROSSING);
+ md_resolve_range(ctx, chain, opener_index, mark_index);
+ return;
+ }
+ }
+
+ /* If we could not resolve as closer, we may be yet be an opener. */
+ if(mark->flags & MD_MARK_POTENTIAL_OPENER)
+ md_mark_chain_append(ctx, chain, mark_index);
+}
+
+static void
+md_analyze_tilde(MD_CTX* ctx, int mark_index)
+{
+ /* We attempt to be Github Flavored Markdown compatible here. GFM says
+ * that length of the tilde sequence is not important at all. Note that
+ * implies the TILDE_OPENERS chain can have at most one item. */
+
+ if(TILDE_OPENERS.head >= 0) {
+ /* The chain already contains an opener, so we may resolve the span. */
+ int opener_index = TILDE_OPENERS.head;
+
+ md_rollback(ctx, opener_index, mark_index, MD_ROLLBACK_CROSSING);
+ md_resolve_range(ctx, &TILDE_OPENERS, opener_index, mark_index);
+ } else {
+ /* We can only be opener. */
+ md_mark_chain_append(ctx, &TILDE_OPENERS, mark_index);
+ }
+}
+
+static void
+md_analyze_dollar(MD_CTX* ctx, int mark_index)
+{
+ /* This should mimic the way inline equations work in LaTeX, so there
+ * can only ever be one item in the chain (i.e. the dollars can't be
+ * nested). This is basically the same as the md_analyze_tilde function,
+ * except that we require matching openers and closers to be of the same
+ * length.
+ *
+ * E.g.: $abc$$def$$ => abc (display equation) def (end equation) */
+ if(DOLLAR_OPENERS.head >= 0) {
+ /* If the potential closer has a non-matching number of $, discard */
+ MD_MARK* open = &ctx->marks[DOLLAR_OPENERS.head];
+ MD_MARK* close = &ctx->marks[mark_index];
+
+ int opener_index = DOLLAR_OPENERS.head;
+ md_rollback(ctx, opener_index, mark_index, MD_ROLLBACK_ALL);
+ if (open->end - open->beg == close->end - close->beg) {
+ /* We are the matching closer */
+ md_resolve_range(ctx, &DOLLAR_OPENERS, opener_index, mark_index);
+ } else {
+ /* We don't match the opener, so discard old opener and insert as opener */
+ md_mark_chain_append(ctx, &DOLLAR_OPENERS, mark_index);
+ }
+ } else {
+ /* No unmatched openers, so we are opener */
+ md_mark_chain_append(ctx, &DOLLAR_OPENERS, mark_index);
+ }
+}
+
+static void
+md_analyze_permissive_url_autolink(MD_CTX* ctx, int mark_index)
+{
+ MD_MARK* opener = &ctx->marks[mark_index];
+ int closer_index = mark_index + 1;
+ MD_MARK* closer = &ctx->marks[closer_index];
+ MD_MARK* next_resolved_mark;
+ OFF off = opener->end;
+ int n_dots = FALSE;
+ int has_underscore_in_last_seg = FALSE;
+ int has_underscore_in_next_to_last_seg = FALSE;
+ int n_opened_parenthesis = 0;
+
+ /* Check for domain. */
+ while(off < ctx->size) {
+ if(ISALNUM(off) || CH(off) == _T('-')) {
+ off++;
+ } else if(CH(off) == _T('.')) {
+ /* We must see at least one period. */
+ n_dots++;
+ has_underscore_in_next_to_last_seg = has_underscore_in_last_seg;
+ has_underscore_in_last_seg = FALSE;
+ off++;
+ } else if(CH(off) == _T('_')) {
+ /* No underscore may be present in the last two domain segments. */
+ has_underscore_in_last_seg = TRUE;
+ off++;
+ } else {
+ break;
+ }
+ }
+ if(off > opener->end && CH(off-1) == _T('.')) {
+ off--;
+ n_dots--;
+ }
+ if(off <= opener->end || n_dots == 0 || has_underscore_in_next_to_last_seg || has_underscore_in_last_seg)
+ return;
+
+ /* Check for path. */
+ next_resolved_mark = closer + 1;
+ while(next_resolved_mark->ch == 'D' || !(next_resolved_mark->flags & MD_MARK_RESOLVED))
+ next_resolved_mark++;
+ while(off < next_resolved_mark->beg && CH(off) != _T('<') && !ISWHITESPACE(off) && !ISNEWLINE(off)) {
+ /* Parenthesis must be balanced. */
+ if(CH(off) == _T('(')) {
+ n_opened_parenthesis++;
+ } else if(CH(off) == _T(')')) {
+ if(n_opened_parenthesis > 0)
+ n_opened_parenthesis--;
+ else
+ break;
+ }
+
+ off++;
+ }
+ /* These cannot be last char In such case they are more likely normal
+ * punctuation. */
+ if(ISANYOF(off-1, _T("?!.,:*_~")))
+ off--;
+
+ /* Ok. Lets call it auto-link. Adapt opener and create closer to zero
+ * length so all the contents becomes the link text. */
+ MD_ASSERT(closer->ch == 'D');
+ opener->end = opener->beg;
+ closer->ch = opener->ch;
+ closer->beg = off;
+ closer->end = off;
+ md_resolve_range(ctx, NULL, mark_index, closer_index);
+}
+
+/* The permissive autolinks do not have to be enclosed in '<' '>' but we
+ * instead impose stricter rules what is understood as an e-mail address
+ * here. Actually any non-alphanumeric characters with exception of '.'
+ * are prohibited both in username and after '@'. */
+static void
+md_analyze_permissive_email_autolink(MD_CTX* ctx, int mark_index)
+{
+ MD_MARK* opener = &ctx->marks[mark_index];
+ int closer_index;
+ MD_MARK* closer;
+ OFF beg = opener->beg;
+ OFF end = opener->end;
+ int dot_count = 0;
+
+ MD_ASSERT(CH(beg) == _T('@'));
+
+ /* Scan for name before '@'. */
+ while(beg > 0 && (ISALNUM(beg-1) || ISANYOF(beg-1, _T(".-_+"))))
+ beg--;
+
+ /* Scan for domain after '@'. */
+ while(end < ctx->size && (ISALNUM(end) || ISANYOF(end, _T(".-_")))) {
+ if(CH(end) == _T('.'))
+ dot_count++;
+ end++;
+ }
+ if(CH(end-1) == _T('.')) { /* Final '.' not part of it. */
+ dot_count--;
+ end--;
+ }
+ else if(ISANYOF2(end-1, _T('-'), _T('_'))) /* These are forbidden at the end. */
+ return;
+ if(CH(end-1) == _T('@') || dot_count == 0)
+ return;
+
+ /* Ok. Lets call it auto-link. Adapt opener and create closer to zero
+ * length so all the contents becomes the link text. */
+ closer_index = mark_index + 1;
+ closer = &ctx->marks[closer_index];
+ MD_ASSERT(closer->ch == 'D');
+
+ opener->beg = beg;
+ opener->end = beg;
+ closer->ch = opener->ch;
+ closer->beg = end;
+ closer->end = end;
+ md_resolve_range(ctx, NULL, mark_index, closer_index);
+}
+
+static inline void
+md_analyze_marks(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
+ int mark_beg, int mark_end, const CHAR* mark_chars)
+{
+ int i = mark_beg;
+
+ while(i < mark_end) {
+ MD_MARK* mark = &ctx->marks[i];
+
+ /* Skip resolved spans. */
+ if(mark->flags & MD_MARK_RESOLVED) {
+ if(mark->flags & MD_MARK_OPENER) {
+ MD_ASSERT(i < mark->next);
+ i = mark->next + 1;
+ } else {
+ i++;
+ }
+ continue;
+ }
+
+ /* Skip marks we do not want to deal with. */
+ if(!ISANYOF_(mark->ch, mark_chars)) {
+ i++;
+ continue;
+ }
+
+ /* Analyze the mark. */
+ switch(mark->ch) {
+ case '[': /* Pass through. */
+ case '!': /* Pass through. */
+ case ']': md_analyze_bracket(ctx, i); break;
+ case '&': md_analyze_entity(ctx, i); break;
+ case '|': md_analyze_table_cell_boundary(ctx, i); break;
+ case '_': /* Pass through. */
+ case '*': md_analyze_emph(ctx, i); break;
+ case '~': md_analyze_tilde(ctx, i); break;
+ case '$': md_analyze_dollar(ctx, i); break;
+ case '.': /* Pass through. */
+ case ':': md_analyze_permissive_url_autolink(ctx, i); break;
+ case '@': md_analyze_permissive_email_autolink(ctx, i); break;
+ }
+
+ i++;
+ }
+}
+
+/* Analyze marks (build ctx->marks). */
+static int
+md_analyze_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mode)
+{
+ int ret;
+
+ /* Reset the previously collected stack of marks. */
+ ctx->n_marks = 0;
+
+ /* Collect all marks. */
+ MD_CHECK(md_collect_marks(ctx, lines, n_lines, table_mode));
+
+ /* We analyze marks in few groups to handle their precedence. */
+ /* (1) Entities; code spans; autolinks; raw HTML. */
+ md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("&"));
+
+ if(table_mode) {
+ /* (2) Analyze table cell boundaries.
+ * Note we reset TABLECELLBOUNDARIES chain prior to the call md_analyze_marks(),
+ * not after, because caller may need it. */
+ MD_ASSERT(n_lines == 1);
+ TABLECELLBOUNDARIES.head = -1;
+ TABLECELLBOUNDARIES.tail = -1;
+ ctx->n_table_cell_boundaries = 0;
+ md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("|"));
+ return ret;
+ }
+
+ /* (3) Links. */
+ md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("[]!"));
+ MD_CHECK(md_resolve_links(ctx, lines, n_lines));
+ BRACKET_OPENERS.head = -1;
+ BRACKET_OPENERS.tail = -1;
+ ctx->unresolved_link_head = -1;
+ ctx->unresolved_link_tail = -1;
+
+ /* (4) Emphasis and strong emphasis; permissive autolinks. */
+ md_analyze_link_contents(ctx, lines, n_lines, 0, ctx->n_marks);
+
+abort:
+ return ret;
+}
+
+static void
+md_analyze_link_contents(MD_CTX* ctx, const MD_LINE* lines, int n_lines,
+ int mark_beg, int mark_end)
+{
+ md_analyze_marks(ctx, lines, n_lines, mark_beg, mark_end, _T("*_~$@:."));
+ ASTERISK_OPENERS_extraword_mod3_0.head = -1;
+ ASTERISK_OPENERS_extraword_mod3_0.tail = -1;
+ ASTERISK_OPENERS_extraword_mod3_1.head = -1;
+ ASTERISK_OPENERS_extraword_mod3_1.tail = -1;
+ ASTERISK_OPENERS_extraword_mod3_2.head = -1;
+ ASTERISK_OPENERS_extraword_mod3_2.tail = -1;
+ ASTERISK_OPENERS_intraword_mod3_0.head = -1;
+ ASTERISK_OPENERS_intraword_mod3_0.tail = -1;
+ ASTERISK_OPENERS_intraword_mod3_1.head = -1;
+ ASTERISK_OPENERS_intraword_mod3_1.tail = -1;
+ ASTERISK_OPENERS_intraword_mod3_2.head = -1;
+ ASTERISK_OPENERS_intraword_mod3_2.tail = -1;
+ UNDERSCORE_OPENERS.head = -1;
+ UNDERSCORE_OPENERS.tail = -1;
+ TILDE_OPENERS.head = -1;
+ TILDE_OPENERS.tail = -1;
+ DOLLAR_OPENERS.head = -1;
+ DOLLAR_OPENERS.tail = -1;
+}
+
+static int
+md_enter_leave_span_a(MD_CTX* ctx, int enter, MD_SPANTYPE type,
+ const CHAR* dest, SZ dest_size, int prohibit_escapes_in_dest,
+ const CHAR* title, SZ title_size)
+{
+ MD_ATTRIBUTE_BUILD href_build = { 0 };
+ MD_ATTRIBUTE_BUILD title_build = { 0 };
+ MD_SPAN_A_DETAIL det;
+ int ret = 0;
+
+ /* Note we here rely on fact that MD_SPAN_A_DETAIL and
+ * MD_SPAN_IMG_DETAIL are binary-compatible. */
+ memset(&det, 0, sizeof(MD_SPAN_A_DETAIL));
+ MD_CHECK(md_build_attribute(ctx, dest, dest_size,
+ (prohibit_escapes_in_dest ? MD_BUILD_ATTR_NO_ESCAPES : 0),
+ &det.href, &href_build));
+ MD_CHECK(md_build_attribute(ctx, title, title_size, 0, &det.title, &title_build));
+
+ if(enter)
+ MD_ENTER_SPAN(type, &det);
+ else
+ MD_LEAVE_SPAN(type, &det);
+
+abort:
+ md_free_attribute(ctx, &href_build);
+ md_free_attribute(ctx, &title_build);
+ return ret;
+}
+
+/* Render the output, accordingly to the analyzed ctx->marks. */
+static int
+md_process_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
+{
+ MD_TEXTTYPE text_type;
+ const MD_LINE* line = lines;
+ MD_MARK* prev_mark = NULL;
+ MD_MARK* mark;
+ OFF off = lines[0].beg;
+ OFF end = lines[n_lines-1].end;
+ int enforce_hardbreak = 0;
+ int ret = 0;
+
+ /* Find first resolved mark. Note there is always at least one resolved
+ * mark, the dummy last one after the end of the latest line we actually
+ * never really reach. This saves us of a lot of special checks and cases
+ * in this function. */
+ mark = ctx->marks;
+ while(!(mark->flags & MD_MARK_RESOLVED))
+ mark++;
+
+ text_type = MD_TEXT_NORMAL;
+
+ while(1) {
+ /* Process the text up to the next mark or end-of-line. */
+ OFF tmp = (line->end < mark->beg ? line->end : mark->beg);
+ if(tmp > off) {
+ MD_TEXT(text_type, STR(off), tmp - off);
+ off = tmp;
+ }
+
+ /* If reached the mark, process it and move to next one. */
+ if(off >= mark->beg) {
+ switch(mark->ch) {
+ case '\\': /* Backslash escape. */
+ if(ISNEWLINE(mark->beg+1))
+ enforce_hardbreak = 1;
+ else
+ MD_TEXT(text_type, STR(mark->beg+1), 1);
+ break;
+
+ case ' ': /* Non-trivial space. */
+ MD_TEXT(text_type, _T(" "), 1);
+ break;
+
+ case '`': /* Code span. */
+ if(mark->flags & MD_MARK_OPENER) {
+ MD_ENTER_SPAN(MD_SPAN_CODE, NULL);
+ text_type = MD_TEXT_CODE;
+ } else {
+ MD_LEAVE_SPAN(MD_SPAN_CODE, NULL);
+ text_type = MD_TEXT_NORMAL;
+ }
+ break;
+
+ case '_':
+ case '*': /* Emphasis, strong emphasis. */
+ if(mark->flags & MD_MARK_OPENER) {
+ if((mark->end - off) % 2) {
+ MD_ENTER_SPAN(MD_SPAN_EM, NULL);
+ off++;
+ }
+ while(off + 1 < mark->end) {
+ MD_ENTER_SPAN(MD_SPAN_STRONG, NULL);
+ off += 2;
+ }
+ } else {
+ while(off + 1 < mark->end) {
+ MD_LEAVE_SPAN(MD_SPAN_STRONG, NULL);
+ off += 2;
+ }
+ if((mark->end - off) % 2) {
+ MD_LEAVE_SPAN(MD_SPAN_EM, NULL);
+ off++;
+ }
+ }
+ break;
+
+ case '~':
+ if(mark->flags & MD_MARK_OPENER)
+ MD_ENTER_SPAN(MD_SPAN_DEL, NULL);
+ else
+ MD_LEAVE_SPAN(MD_SPAN_DEL, NULL);
+ break;
+
+ case '$':
+ if(mark->flags & MD_MARK_OPENER) {
+ MD_ENTER_SPAN((mark->end - off) % 2 ? MD_SPAN_LATEXMATH : MD_SPAN_LATEXMATH_DISPLAY, NULL);
+ text_type = MD_TEXT_LATEXMATH;
+ } else {
+ MD_LEAVE_SPAN((mark->end - off) % 2 ? MD_SPAN_LATEXMATH : MD_SPAN_LATEXMATH_DISPLAY, NULL);
+ text_type = MD_TEXT_NORMAL;
+ }
+ break;
+
+ case '[': /* Link, image. */
+ case '!':
+ case ']':
+ {
+ const MD_MARK* opener = (mark->ch != ']' ? mark : &ctx->marks[mark->prev]);
+ const MD_MARK* dest_mark = opener+1;
+ const MD_MARK* title_mark = opener+2;
+
+ MD_ASSERT(dest_mark->ch == 'D');
+ MD_ASSERT(title_mark->ch == 'D');
+
+ MD_CHECK(md_enter_leave_span_a(ctx, (mark->ch != ']'),
+ (opener->ch == '!' ? MD_SPAN_IMG : MD_SPAN_A),
+ STR(dest_mark->beg), dest_mark->end - dest_mark->beg, FALSE,
+ md_mark_get_ptr(ctx, title_mark - ctx->marks), title_mark->prev));
+
+ /* link/image closer may span multiple lines. */
+ if(mark->ch == ']') {
+ while(mark->end > line->end)
+ line++;
+ }
+
+ break;
+ }
+
+ case '<':
+ case '>': /* Autolink or raw HTML. */
+ if(!(mark->flags & MD_MARK_AUTOLINK)) {
+ /* Raw HTML. */
+ if(mark->flags & MD_MARK_OPENER)
+ text_type = MD_TEXT_HTML;
+ else
+ text_type = MD_TEXT_NORMAL;
+ break;
+ }
+ /* Pass through, if auto-link. */
+
+ case '@': /* Permissive e-mail autolink. */
+ case ':': /* Permissive URL autolink. */
+ case '.': /* Permissive WWW autolink. */
+ {
+ MD_MARK* opener = ((mark->flags & MD_MARK_OPENER) ? mark : &ctx->marks[mark->prev]);
+ MD_MARK* closer = &ctx->marks[opener->next];
+ const CHAR* dest = STR(opener->end);
+ SZ dest_size = closer->beg - opener->end;
+
+ /* For permissive auto-links we do not know closer mark
+ * position at the time of md_collect_marks(), therefore
+ * it can be out-of-order in ctx->marks[].
+ *
+ * With this flag, we make sure that we output the closer
+ * only if we processed the opener. */
+ if(mark->flags & MD_MARK_OPENER)
+ closer->flags |= MD_MARK_VALIDPERMISSIVEAUTOLINK;
+
+ if(opener->ch == '@' || opener->ch == '.') {
+ dest_size += 7;
+ MD_TEMP_BUFFER(dest_size * sizeof(CHAR));
+ memcpy(ctx->buffer,
+ (opener->ch == '@' ? _T("mailto:") : _T("http://")),
+ 7 * sizeof(CHAR));
+ memcpy(ctx->buffer + 7, dest, (dest_size-7) * sizeof(CHAR));
+ dest = ctx->buffer;
+ }
+
+ if(closer->flags & MD_MARK_VALIDPERMISSIVEAUTOLINK)
+ MD_CHECK(md_enter_leave_span_a(ctx, (mark->flags & MD_MARK_OPENER),
+ MD_SPAN_A, dest, dest_size, TRUE, NULL, 0));
+ break;
+ }
+
+ case '&': /* Entity. */
+ MD_TEXT(MD_TEXT_ENTITY, STR(mark->beg), mark->end - mark->beg);
+ break;
+
+ case '\0':
+ MD_TEXT(MD_TEXT_NULLCHAR, _T(""), 1);
+ break;
+
+ case 127:
+ goto abort;
+ }
+
+ off = mark->end;
+
+ /* Move to next resolved mark. */
+ prev_mark = mark;
+ mark++;
+ while(!(mark->flags & MD_MARK_RESOLVED) || mark->beg < off)
+ mark++;
+ }
+
+ /* If reached end of line, move to next one. */
+ if(off >= line->end) {
+ /* If it is the last line, we are done. */
+ if(off >= end)
+ break;
+
+ if(text_type == MD_TEXT_CODE || text_type == MD_TEXT_LATEXMATH) {
+ OFF tmp;
+
+ MD_ASSERT(prev_mark != NULL);
+ MD_ASSERT(ISANYOF2_(prev_mark->ch, '`', '$') && (prev_mark->flags & MD_MARK_OPENER));
+ MD_ASSERT(ISANYOF2_(mark->ch, '`', '$') && (mark->flags & MD_MARK_CLOSER));
+
+ /* Inside a code span, trailing line whitespace has to be
+ * outputted. */
+ tmp = off;
+ while(off < ctx->size && ISBLANK(off))
+ off++;
+ if(off > tmp)
+ MD_TEXT(text_type, STR(tmp), off-tmp);
+
+ /* and new lines are transformed into single spaces. */
+ if(prev_mark->end < off && off < mark->beg)
+ MD_TEXT(text_type, _T(" "), 1);
+ } else if(text_type == MD_TEXT_HTML) {
+ /* Inside raw HTML, we output the new line verbatim, including
+ * any trailing spaces. */
+ OFF tmp = off;
+
+ while(tmp < end && ISBLANK(tmp))
+ tmp++;
+ if(tmp > off)
+ MD_TEXT(MD_TEXT_HTML, STR(off), tmp - off);
+ MD_TEXT(MD_TEXT_HTML, _T("\n"), 1);
+ } else {
+ /* Output soft or hard line break. */
+ MD_TEXTTYPE break_type = MD_TEXT_SOFTBR;
+
+ if(text_type == MD_TEXT_NORMAL) {
+ if(enforce_hardbreak)
+ break_type = MD_TEXT_BR;
+ else if((CH(line->end) == _T(' ') && CH(line->end+1) == _T(' ')))
+ break_type = MD_TEXT_BR;
+ }
+
+ MD_TEXT(break_type, _T("\n"), 1);
+ }
+
+ /* Move to the next line. */
+ line++;
+ off = line->beg;
+
+ enforce_hardbreak = 0;
+ }
+ }
+
+abort:
+ return ret;
+}
+
+
+/***************************
+ *** Processing Tables ***
+ ***************************/
+
+static void
+md_analyze_table_alignment(MD_CTX* ctx, OFF beg, OFF end, MD_ALIGN* align, int n_align)
+{
+ static const MD_ALIGN align_map[] = { MD_ALIGN_DEFAULT, MD_ALIGN_LEFT, MD_ALIGN_RIGHT, MD_ALIGN_CENTER };
+ OFF off = beg;
+
+ while(n_align > 0) {
+ int index = 0; /* index into align_map[] */
+
+ while(CH(off) != _T('-'))
+ off++;
+ if(off > beg && CH(off-1) == _T(':'))
+ index |= 1;
+ while(off < end && CH(off) == _T('-'))
+ off++;
+ if(off < end && CH(off) == _T(':'))
+ index |= 2;
+
+ *align = align_map[index];
+ align++;
+ n_align--;
+ }
+
+}
+
+/* Forward declaration. */
+static int md_process_normal_block_contents(MD_CTX* ctx, const MD_LINE* lines, int n_lines);
+
+static int
+md_process_table_cell(MD_CTX* ctx, MD_BLOCKTYPE cell_type, MD_ALIGN align, OFF beg, OFF end)
+{
+ MD_LINE line;
+ MD_BLOCK_TD_DETAIL det;
+ int ret = 0;
+
+ while(beg < end && ISWHITESPACE(beg))
+ beg++;
+ while(end > beg && ISWHITESPACE(end-1))
+ end--;
+
+ det.align = align;
+ line.beg = beg;
+ line.end = end;
+
+ MD_ENTER_BLOCK(cell_type, &det);
+ MD_CHECK(md_process_normal_block_contents(ctx, &line, 1));
+ MD_LEAVE_BLOCK(cell_type, &det);
+
+abort:
+ return ret;
+}
+
+static int
+md_process_table_row(MD_CTX* ctx, MD_BLOCKTYPE cell_type, OFF beg, OFF end,
+ const MD_ALIGN* align, int col_count)
+{
+ MD_LINE line;
+ OFF* pipe_offs = NULL;
+ int i, j, n;
+ int ret = 0;
+
+ line.beg = beg;
+ line.end = end;
+
+ /* Break the line into table cells by identifying pipe characters who
+ * form the cell boundary. */
+ MD_CHECK(md_analyze_inlines(ctx, &line, 1, TRUE));
+
+ /* We have to remember the cell boundaries in local buffer because
+ * ctx->marks[] shall be reused during cell contents processing. */
+ n = ctx->n_table_cell_boundaries;
+ pipe_offs = (OFF*) malloc(n * sizeof(OFF));
+ if(pipe_offs == NULL) {
+ MD_LOG("malloc() failed.");
+ ret = -1;
+ goto abort;
+ }
+ for(i = TABLECELLBOUNDARIES.head, j = 0; i >= 0; i = ctx->marks[i].next) {
+ MD_MARK* mark = &ctx->marks[i];
+ pipe_offs[j++] = mark->beg;
+ }
+
+ /* Process cells. */
+ MD_ENTER_BLOCK(MD_BLOCK_TR, NULL);
+ j = 0;
+ if(beg < pipe_offs[0] && j < col_count)
+ MD_CHECK(md_process_table_cell(ctx, cell_type, align[j++], beg, pipe_offs[0]));
+ for(i = 0; i < n-1 && j < col_count; i++)
+ MD_CHECK(md_process_table_cell(ctx, cell_type, align[j++], pipe_offs[i]+1, pipe_offs[i+1]));
+ if(pipe_offs[n-1] < end-1 && j < col_count)
+ MD_CHECK(md_process_table_cell(ctx, cell_type, align[j++], pipe_offs[n-1]+1, end));
+ /* Make sure we call enough table cells even if the current table contains
+ * too few of them. */
+ while(j < col_count)
+ MD_CHECK(md_process_table_cell(ctx, cell_type, align[j++], 0, 0));
+
+ MD_LEAVE_BLOCK(MD_BLOCK_TR, NULL);
+
+abort:
+ free(pipe_offs);
+
+ /* Free any temporary memory blocks stored within some dummy marks. */
+ for(i = PTR_CHAIN.head; i >= 0; i = ctx->marks[i].next)
+ free(md_mark_get_ptr(ctx, i));
+ PTR_CHAIN.head = -1;
+ PTR_CHAIN.tail = -1;
+
+ return ret;
+}
+
+static int
+md_process_table_block_contents(MD_CTX* ctx, int col_count, const MD_LINE* lines, int n_lines)
+{
+ MD_ALIGN* align;
+ int i;
+ int ret = 0;
+
+ /* At least two lines have to be present: The column headers and the line
+ * with the underlines. */
+ MD_ASSERT(n_lines >= 2);
+
+ align = malloc(col_count * sizeof(MD_ALIGN));
+ if(align == NULL) {
+ MD_LOG("malloc() failed.");
+ ret = -1;
+ goto abort;
+ }
+
+ md_analyze_table_alignment(ctx, lines[1].beg, lines[1].end, align, col_count);
+
+ MD_ENTER_BLOCK(MD_BLOCK_THEAD, NULL);
+ MD_CHECK(md_process_table_row(ctx, MD_BLOCK_TH,
+ lines[0].beg, lines[0].end, align, col_count));
+ MD_LEAVE_BLOCK(MD_BLOCK_THEAD, NULL);
+
+ MD_ENTER_BLOCK(MD_BLOCK_TBODY, NULL);
+ for(i = 2; i < n_lines; i++) {
+ MD_CHECK(md_process_table_row(ctx, MD_BLOCK_TD,
+ lines[i].beg, lines[i].end, align, col_count));
+ }
+ MD_LEAVE_BLOCK(MD_BLOCK_TBODY, NULL);
+
+abort:
+ free(align);
+ return ret;
+}
+
+static int
+md_is_table_row(MD_CTX* ctx, OFF beg, OFF* p_end)
+{
+ MD_LINE line;
+ int i;
+ int ret = FALSE;
+
+ line.beg = beg;
+ line.end = beg;
+
+ /* Find end of line. */
+ while(line.end < ctx->size && !ISNEWLINE(line.end))
+ line.end++;
+
+ MD_CHECK(md_analyze_inlines(ctx, &line, 1, TRUE));
+
+ if(TABLECELLBOUNDARIES.head >= 0) {
+ if(p_end != NULL)
+ *p_end = line.end;
+ ret = TRUE;
+ }
+
+abort:
+ /* Free any temporary memory blocks stored within some dummy marks. */
+ for(i = PTR_CHAIN.head; i >= 0; i = ctx->marks[i].next)
+ free(md_mark_get_ptr(ctx, i));
+ PTR_CHAIN.head = -1;
+ PTR_CHAIN.tail = -1;
+
+ return ret;
+}
+
+
+/**************************
+ *** Processing Block ***
+ **************************/
+
+#define MD_BLOCK_CONTAINER_OPENER 0x01
+#define MD_BLOCK_CONTAINER_CLOSER 0x02
+#define MD_BLOCK_CONTAINER (MD_BLOCK_CONTAINER_OPENER | MD_BLOCK_CONTAINER_CLOSER)
+#define MD_BLOCK_LOOSE_LIST 0x04
+#define MD_BLOCK_SETEXT_HEADER 0x08
+
+struct MD_BLOCK_tag {
+ MD_BLOCKTYPE type : 8;
+ unsigned flags : 8;
+
+ /* MD_BLOCK_H: Header level (1 - 6)
+ * MD_BLOCK_CODE: Non-zero if fenced, zero if indented.
+ * MD_BLOCK_LI: Task mark character (0 if not task list item, 'x', 'X' or ' ').
+ * MD_BLOCK_TABLE: Column count (as determined by the table underline).
+ */
+ unsigned data : 16;
+
+ /* Leaf blocks: Count of lines (MD_LINE or MD_VERBATIMLINE) on the block.
+ * MD_BLOCK_LI: Task mark offset in the input doc.
+ * MD_BLOCK_OL: Start item number.
+ */
+ unsigned n_lines;
+};
+
+struct MD_CONTAINER_tag {
+ CHAR ch;
+ unsigned is_loose : 8;
+ unsigned is_task : 8;
+ unsigned start;
+ unsigned mark_indent;
+ unsigned contents_indent;
+ OFF block_byte_off;
+ OFF task_mark_off;
+};
+
+
+static int
+md_process_normal_block_contents(MD_CTX* ctx, const MD_LINE* lines, int n_lines)
+{
+ int i;
+ int ret;
+
+ MD_CHECK(md_analyze_inlines(ctx, lines, n_lines, FALSE));
+ MD_CHECK(md_process_inlines(ctx, lines, n_lines));
+
+abort:
+ /* Free any temporary memory blocks stored within some dummy marks. */
+ for(i = PTR_CHAIN.head; i >= 0; i = ctx->marks[i].next)
+ free(md_mark_get_ptr(ctx, i));
+ PTR_CHAIN.head = -1;
+ PTR_CHAIN.tail = -1;
+
+ return ret;
+}
+
+static int
+md_process_verbatim_block_contents(MD_CTX* ctx, MD_TEXTTYPE text_type, const MD_VERBATIMLINE* lines, int n_lines)
+{
+ static const CHAR indent_chunk_str[] = _T(" ");
+ static const SZ indent_chunk_size = SIZEOF_ARRAY(indent_chunk_str) - 1;
+
+ int i;
+ int ret = 0;
+
+ for(i = 0; i < n_lines; i++) {
+ const MD_VERBATIMLINE* line = &lines[i];
+ int indent = line->indent;
+
+ MD_ASSERT(indent >= 0);
+
+ /* Output code indentation. */
+ while(indent > (int) SIZEOF_ARRAY(indent_chunk_str)) {
+ MD_TEXT(text_type, indent_chunk_str, indent_chunk_size);
+ indent -= SIZEOF_ARRAY(indent_chunk_str);
+ }
+ if(indent > 0)
+ MD_TEXT(text_type, indent_chunk_str, indent);
+
+ /* Output the code line itself. */
+ MD_TEXT_INSECURE(text_type, STR(line->beg), line->end - line->beg);
+
+ /* Enforce end-of-line. */
+ MD_TEXT(text_type, _T("\n"), 1);
+ }
+
+abort:
+ return ret;
+}
+
+static int
+md_process_code_block_contents(MD_CTX* ctx, int is_fenced, const MD_VERBATIMLINE* lines, int n_lines)
+{
+ if(is_fenced) {
+ /* Skip the first line in case of fenced code: It is the fence.
+ * (Only the starting fence is present due to logic in md_analyze_line().) */
+ lines++;
+ n_lines--;
+ } else {
+ /* Ignore blank lines at start/end of indented code block. */
+ while(n_lines > 0 && lines[0].beg == lines[0].end) {
+ lines++;
+ n_lines--;
+ }
+ while(n_lines > 0 && lines[n_lines-1].beg == lines[n_lines-1].end) {
+ n_lines--;
+ }
+ }
+
+ if(n_lines == 0)
+ return 0;
+
+ return md_process_verbatim_block_contents(ctx, MD_TEXT_CODE, lines, n_lines);
+}
+
+static int
+md_setup_fenced_code_detail(MD_CTX* ctx, const MD_BLOCK* block, MD_BLOCK_CODE_DETAIL* det,
+ MD_ATTRIBUTE_BUILD* info_build, MD_ATTRIBUTE_BUILD* lang_build)
+{
+ const MD_VERBATIMLINE* fence_line = (const MD_VERBATIMLINE*)(block + 1);
+ OFF beg = fence_line->beg;
+ OFF end = fence_line->end;
+ OFF lang_end;
+ CHAR fence_ch = CH(fence_line->beg);
+ int ret = 0;
+
+ /* Skip the fence itself. */
+ while(beg < ctx->size && CH(beg) == fence_ch)
+ beg++;
+ /* Trim initial spaces. */
+ while(beg < ctx->size && CH(beg) == _T(' '))
+ beg++;
+
+ /* Trim trailing spaces. */
+ while(end > beg && CH(end-1) == _T(' '))
+ end--;
+
+ /* Build info string attribute. */
+ MD_CHECK(md_build_attribute(ctx, STR(beg), end - beg, 0, &det->info, info_build));
+
+ /* Build info string attribute. */
+ lang_end = beg;
+ while(lang_end < end && !ISWHITESPACE(lang_end))
+ lang_end++;
+ MD_CHECK(md_build_attribute(ctx, STR(beg), lang_end - beg, 0, &det->lang, lang_build));
+
+ det->fence_char = fence_ch;
+
+abort:
+ return ret;
+}
+
+static int
+md_process_leaf_block(MD_CTX* ctx, const MD_BLOCK* block)
+{
+ union {
+ MD_BLOCK_H_DETAIL header;
+ MD_BLOCK_CODE_DETAIL code;
+ } det;
+ MD_ATTRIBUTE_BUILD info_build;
+ MD_ATTRIBUTE_BUILD lang_build;
+ int is_in_tight_list;
+ int clean_fence_code_detail = FALSE;
+ int ret = 0;
+
+ memset(&det, 0, sizeof(det));
+
+ if(ctx->n_containers == 0)
+ is_in_tight_list = FALSE;
+ else
+ is_in_tight_list = !ctx->containers[ctx->n_containers-1].is_loose;
+
+ switch(block->type) {
+ case MD_BLOCK_H:
+ det.header.level = block->data;
+ break;
+
+ case MD_BLOCK_CODE:
+ /* For fenced code block, we may need to set the info string. */
+ if(block->data != 0) {
+ memset(&det.code, 0, sizeof(MD_BLOCK_CODE_DETAIL));
+ clean_fence_code_detail = TRUE;
+ MD_CHECK(md_setup_fenced_code_detail(ctx, block, &det.code, &info_build, &lang_build));
+ }
+ break;
+
+ default:
+ /* Noop. */
+ break;
+ }
+
+ if(!is_in_tight_list || block->type != MD_BLOCK_P)
+ MD_ENTER_BLOCK(block->type, (void*) &det);
+
+ /* Process the block contents accordingly to is type. */
+ switch(block->type) {
+ case MD_BLOCK_HR:
+ /* noop */
+ break;
+
+ case MD_BLOCK_CODE:
+ MD_CHECK(md_process_code_block_contents(ctx, (block->data != 0),
+ (const MD_VERBATIMLINE*)(block + 1), block->n_lines));
+ break;
+
+ case MD_BLOCK_HTML:
+ MD_CHECK(md_process_verbatim_block_contents(ctx, MD_TEXT_HTML,
+ (const MD_VERBATIMLINE*)(block + 1), block->n_lines));
+ break;
+
+ case MD_BLOCK_TABLE:
+ MD_CHECK(md_process_table_block_contents(ctx, block->data,
+ (const MD_LINE*)(block + 1), block->n_lines));
+ break;
+
+ default:
+ MD_CHECK(md_process_normal_block_contents(ctx,
+ (const MD_LINE*)(block + 1), block->n_lines));
+ break;
+ }
+
+ if(!is_in_tight_list || block->type != MD_BLOCK_P)
+ MD_LEAVE_BLOCK(block->type, (void*) &det);
+
+abort:
+ if(clean_fence_code_detail) {
+ md_free_attribute(ctx, &info_build);
+ md_free_attribute(ctx, &lang_build);
+ }
+ return ret;
+}
+
+static int
+md_process_all_blocks(MD_CTX* ctx)
+{
+ int byte_off = 0;
+ int ret = 0;
+
+ /* ctx->containers now is not needed for detection of lists and list items
+ * so we reuse it for tracking what lists are loose or tight. We rely
+ * on the fact the vector is large enough to hold the deepest nesting
+ * level of lists. */
+ ctx->n_containers = 0;
+
+ while(byte_off < ctx->n_block_bytes) {
+ MD_BLOCK* block = (MD_BLOCK*)((char*)ctx->block_bytes + byte_off);
+ union {
+ MD_BLOCK_UL_DETAIL ul;
+ MD_BLOCK_OL_DETAIL ol;
+ MD_BLOCK_LI_DETAIL li;
+ } det;
+
+ switch(block->type) {
+ case MD_BLOCK_UL:
+ det.ul.is_tight = (block->flags & MD_BLOCK_LOOSE_LIST) ? FALSE : TRUE;
+ det.ul.mark = (CHAR) block->data;
+ break;
+
+ case MD_BLOCK_OL:
+ det.ol.start = block->n_lines;
+ det.ol.is_tight = (block->flags & MD_BLOCK_LOOSE_LIST) ? FALSE : TRUE;
+ det.ol.mark_delimiter = (CHAR) block->data;
+ break;
+
+ case MD_BLOCK_LI:
+ det.li.is_task = (block->data != 0);
+ det.li.task_mark = (CHAR) block->data;
+ det.li.task_mark_offset = (OFF) block->n_lines;
+ break;
+
+ default:
+ /* noop */
+ break;
+ }
+
+ if(block->flags & MD_BLOCK_CONTAINER) {
+ if(block->flags & MD_BLOCK_CONTAINER_CLOSER) {
+ MD_LEAVE_BLOCK(block->type, &det);
+
+ if(block->type == MD_BLOCK_UL || block->type == MD_BLOCK_OL || block->type == MD_BLOCK_QUOTE)
+ ctx->n_containers--;
+ }
+
+ if(block->flags & MD_BLOCK_CONTAINER_OPENER) {
+ MD_ENTER_BLOCK(block->type, &det);
+
+ if(block->type == MD_BLOCK_UL || block->type == MD_BLOCK_OL) {
+ ctx->containers[ctx->n_containers].is_loose = (block->flags & MD_BLOCK_LOOSE_LIST);
+ ctx->n_containers++;
+ } else if(block->type == MD_BLOCK_QUOTE) {
+ /* This causes that any text in a block quote, even if
+ * nested inside a tight list item, is wrapped with
+ * <p>...</p>. */
+ ctx->containers[ctx->n_containers].is_loose = TRUE;
+ ctx->n_containers++;
+ }
+ }
+ } else {
+ MD_CHECK(md_process_leaf_block(ctx, block));
+
+ if(block->type == MD_BLOCK_CODE || block->type == MD_BLOCK_HTML)
+ byte_off += block->n_lines * sizeof(MD_VERBATIMLINE);
+ else
+ byte_off += block->n_lines * sizeof(MD_LINE);
+ }
+
+ byte_off += sizeof(MD_BLOCK);
+ }
+
+ ctx->n_block_bytes = 0;
+
+abort:
+ return ret;
+}
+
+
+/************************************
+ *** Grouping Lines into Blocks ***
+ ************************************/
+
+static void*
+md_push_block_bytes(MD_CTX* ctx, int n_bytes)
+{
+ void* ptr;
+
+ if(ctx->n_block_bytes + n_bytes > ctx->alloc_block_bytes) {
+ void* new_block_bytes;
+
+ ctx->alloc_block_bytes = (ctx->alloc_block_bytes > 0 ? ctx->alloc_block_bytes * 2 : 512);
+ new_block_bytes = realloc(ctx->block_bytes, ctx->alloc_block_bytes);
+ if(new_block_bytes == NULL) {
+ MD_LOG("realloc() failed.");
+ return NULL;
+ }
+
+ /* Fix the ->current_block after the reallocation. */
+ if(ctx->current_block != NULL) {
+ OFF off_current_block = (char*) ctx->current_block - (char*) ctx->block_bytes;
+ ctx->current_block = (MD_BLOCK*) ((char*) new_block_bytes + off_current_block);
+ }
+
+ ctx->block_bytes = new_block_bytes;
+ }
+
+ ptr = (char*)ctx->block_bytes + ctx->n_block_bytes;
+ ctx->n_block_bytes += n_bytes;
+ return ptr;
+}
+
+static int
+md_start_new_block(MD_CTX* ctx, const MD_LINE_ANALYSIS* line)
+{
+ MD_BLOCK* block;
+
+ MD_ASSERT(ctx->current_block == NULL);
+
+ block = (MD_BLOCK*) md_push_block_bytes(ctx, sizeof(MD_BLOCK));
+ if(block == NULL)
+ return -1;
+
+ switch(line->type) {
+ case MD_LINE_HR:
+ block->type = MD_BLOCK_HR;
+ break;
+
+ case MD_LINE_ATXHEADER:
+ case MD_LINE_SETEXTHEADER:
+ block->type = MD_BLOCK_H;
+ break;
+
+ case MD_LINE_FENCEDCODE:
+ case MD_LINE_INDENTEDCODE:
+ block->type = MD_BLOCK_CODE;
+ break;
+
+ case MD_LINE_TEXT:
+ block->type = MD_BLOCK_P;
+ break;
+
+ case MD_LINE_HTML:
+ block->type = MD_BLOCK_HTML;
+ break;
+
+ case MD_LINE_BLANK:
+ case MD_LINE_SETEXTUNDERLINE:
+ case MD_LINE_TABLEUNDERLINE:
+ default:
+ MD_UNREACHABLE();
+ break;
+ }
+
+ block->flags = 0;
+ block->data = line->data;
+ block->n_lines = 0;
+
+ ctx->current_block = block;
+ return 0;
+}
+
+/* Eat from start of current (textual) block any reference definitions and
+ * remember them so we can resolve any links referring to them.
+ *
+ * (Reference definitions can only be at start of it as they cannot break
+ * a paragraph.)
+ */
+static int
+md_consume_link_reference_definitions(MD_CTX* ctx)
+{
+ MD_LINE* lines = (MD_LINE*) (ctx->current_block + 1);
+ int n_lines = ctx->current_block->n_lines;
+ int n = 0;
+
+ /* Compute how many lines at the start of the block form one or more
+ * reference definitions. */
+ while(n < n_lines) {
+ int n_link_ref_lines;
+
+ n_link_ref_lines = md_is_link_reference_definition(ctx,
+ lines + n, n_lines - n);
+ /* Not a reference definition? */
+ if(n_link_ref_lines == 0)
+ break;
+
+ /* We fail if it is the ref. def. but it could not be stored due
+ * a memory allocation error. */
+ if(n_link_ref_lines < 0)
+ return -1;
+
+ n += n_link_ref_lines;
+ }
+
+ /* If there was at least one reference definition, we need to remove
+ * its lines from the block, or perhaps even the whole block. */
+ if(n > 0) {
+ if(n == n_lines) {
+ /* Remove complete block. */
+ ctx->n_block_bytes -= n * sizeof(MD_LINE);
+ ctx->n_block_bytes -= sizeof(MD_BLOCK);
+ ctx->current_block = NULL;
+ } else {
+ /* Remove just some initial lines from the block. */
+ memmove(lines, lines + n, (n_lines - n) * sizeof(MD_LINE));
+ ctx->current_block->n_lines -= n;
+ ctx->n_block_bytes -= n * sizeof(MD_LINE);
+ }
+ }
+
+ return 0;
+}
+
+static int
+md_end_current_block(MD_CTX* ctx)
+{
+ int ret = 0;
+
+ if(ctx->current_block == NULL)
+ return ret;
+
+ /* Check whether there is a reference definition. (We do this here instead
+ * of in md_analyze_line() because reference definition can take multiple
+ * lines.) */
+ if(ctx->current_block->type == MD_BLOCK_P ||
+ (ctx->current_block->type == MD_BLOCK_H && (ctx->current_block->flags & MD_BLOCK_SETEXT_HEADER)))
+ {
+ MD_LINE* lines = (MD_LINE*) (ctx->current_block + 1);
+ if(CH(lines[0].beg) == _T('[')) {
+ MD_CHECK(md_consume_link_reference_definitions(ctx));
+ if(ctx->current_block == NULL)
+ return ret;
+ }
+ }
+
+ if(ctx->current_block->type == MD_BLOCK_H && (ctx->current_block->flags & MD_BLOCK_SETEXT_HEADER)) {
+ int n_lines = ctx->current_block->n_lines;
+
+ if(n_lines > 1) {
+ /* Get rid of the underline. */
+ ctx->current_block->n_lines--;
+ ctx->n_block_bytes -= sizeof(MD_LINE);
+ } else {
+ /* Only the underline has left after eating the ref. defs.
+ * Keep the line as beginning of a new ordinary paragraph. */
+ ctx->current_block->type = MD_BLOCK_P;
+ return 0;
+ }
+ }
+
+ /* Mark we are not building any block anymore. */
+ ctx->current_block = NULL;
+
+abort:
+ return ret;
+}
+
+static int
+md_add_line_into_current_block(MD_CTX* ctx, const MD_LINE_ANALYSIS* analysis)
+{
+ MD_ASSERT(ctx->current_block != NULL);
+
+ if(ctx->current_block->type == MD_BLOCK_CODE || ctx->current_block->type == MD_BLOCK_HTML) {
+ MD_VERBATIMLINE* line;
+
+ line = (MD_VERBATIMLINE*) md_push_block_bytes(ctx, sizeof(MD_VERBATIMLINE));
+ if(line == NULL)
+ return -1;
+
+ line->indent = analysis->indent;
+ line->beg = analysis->beg;
+ line->end = analysis->end;
+ } else {
+ MD_LINE* line;
+
+ line = (MD_LINE*) md_push_block_bytes(ctx, sizeof(MD_LINE));
+ if(line == NULL)
+ return -1;
+
+ line->beg = analysis->beg;
+ line->end = analysis->end;
+ }
+ ctx->current_block->n_lines++;
+
+ return 0;
+}
+
+static int
+md_push_container_bytes(MD_CTX* ctx, MD_BLOCKTYPE type, unsigned start,
+ unsigned data, unsigned flags)
+{
+ MD_BLOCK* block;
+ int ret = 0;
+
+ MD_CHECK(md_end_current_block(ctx));
+
+ block = (MD_BLOCK*) md_push_block_bytes(ctx, sizeof(MD_BLOCK));
+ if(block == NULL)
+ return -1;
+
+ block->type = type;
+ block->flags = flags;
+ block->data = data;
+ block->n_lines = start;
+
+abort:
+ return ret;
+}
+
+
+
+/***********************
+ *** Line Analysis ***
+ ***********************/
+
+static int
+md_is_hr_line(MD_CTX* ctx, OFF beg, OFF* p_end, OFF* p_killer)
+{
+ OFF off = beg + 1;
+ int n = 1;
+
+ while(off < ctx->size && (CH(off) == CH(beg) || CH(off) == _T(' ') || CH(off) == _T('\t'))) {
+ if(CH(off) == CH(beg))
+ n++;
+ off++;
+ }
+
+ if(n < 3) {
+ *p_killer = off;
+ return FALSE;
+ }
+
+ /* Nothing else can be present on the line. */
+ if(off < ctx->size && !ISNEWLINE(off)) {
+ *p_killer = off;
+ return FALSE;
+ }
+
+ *p_end = off;
+ return TRUE;
+}
+
+static int
+md_is_atxheader_line(MD_CTX* ctx, OFF beg, OFF* p_beg, OFF* p_end, unsigned* p_level)
+{
+ int n;
+ OFF off = beg + 1;
+
+ while(off < ctx->size && CH(off) == _T('#') && off - beg < 7)
+ off++;
+ n = off - beg;
+
+ if(n > 6)
+ return FALSE;
+ *p_level = n;
+
+ if(!(ctx->parser.flags & MD_FLAG_PERMISSIVEATXHEADERS) && off < ctx->size &&
+ CH(off) != _T(' ') && CH(off) != _T('\t') && !ISNEWLINE(off))
+ return FALSE;
+
+ while(off < ctx->size && CH(off) == _T(' '))
+ off++;
+ *p_beg = off;
+ *p_end = off;
+ return TRUE;
+}
+
+static int
+md_is_setext_underline(MD_CTX* ctx, OFF beg, OFF* p_end, unsigned* p_level)
+{
+ OFF off = beg + 1;
+
+ while(off < ctx->size && CH(off) == CH(beg))
+ off++;
+
+ /* Optionally, space(s) can follow. */
+ while(off < ctx->size && CH(off) == _T(' '))
+ off++;
+
+ /* But nothing more is allowed on the line. */
+ if(off < ctx->size && !ISNEWLINE(off))
+ return FALSE;
+
+ *p_level = (CH(beg) == _T('=') ? 1 : 2);
+ *p_end = off;
+ return TRUE;
+}
+
+static int
+md_is_table_underline(MD_CTX* ctx, OFF beg, OFF* p_end, unsigned* p_col_count)
+{
+ OFF off = beg;
+ int found_pipe = FALSE;
+ unsigned col_count = 0;
+
+ if(off < ctx->size && CH(off) == _T('|')) {
+ found_pipe = TRUE;
+ off++;
+ while(off < ctx->size && ISWHITESPACE(off))
+ off++;
+ }
+
+ while(1) {
+ OFF cell_beg;
+ int delimited = FALSE;
+
+ /* Cell underline ("-----", ":----", "----:" or ":----:") */
+ cell_beg = off;
+ if(off < ctx->size && CH(off) == _T(':'))
+ off++;
+ while(off < ctx->size && CH(off) == _T('-'))
+ off++;
+ if(off < ctx->size && CH(off) == _T(':'))
+ off++;
+ if(off - cell_beg < 3)
+ return FALSE;
+
+ col_count++;
+
+ /* Pipe delimiter (optional at the end of line). */
+ while(off < ctx->size && ISWHITESPACE(off))
+ off++;
+ if(off < ctx->size && CH(off) == _T('|')) {
+ delimited = TRUE;
+ found_pipe = TRUE;
+ off++;
+ while(off < ctx->size && ISWHITESPACE(off))
+ off++;
+ }
+
+ /* Success, if we reach end of line. */
+ if(off >= ctx->size || ISNEWLINE(off))
+ break;
+
+ if(!delimited)
+ return FALSE;
+ }
+
+ if(!found_pipe)
+ return FALSE;
+
+ *p_end = off;
+ *p_col_count = col_count;
+ return TRUE;
+}
+
+static int
+md_is_opening_code_fence(MD_CTX* ctx, OFF beg, OFF* p_end)
+{
+ OFF off = beg;
+
+ while(off < ctx->size && CH(off) == CH(beg))
+ off++;
+
+ /* Fence must have at least three characters. */
+ if(off - beg < 3)
+ return FALSE;
+
+ ctx->code_fence_length = off - beg;
+
+ /* Optionally, space(s) can follow. */
+ while(off < ctx->size && CH(off) == _T(' '))
+ off++;
+
+ /* Optionally, an info string can follow. */
+ while(off < ctx->size && !ISNEWLINE(off)) {
+ /* Backtick-based fence must not contain '`' in the info string. */
+ if(CH(beg) == _T('`') && CH(off) == _T('`'))
+ return FALSE;
+ off++;
+ }
+
+ *p_end = off;
+ return TRUE;
+}
+
+static int
+md_is_closing_code_fence(MD_CTX* ctx, CHAR ch, OFF beg, OFF* p_end)
+{
+ OFF off = beg;
+ int ret = FALSE;
+
+ /* Closing fence must have at least the same length and use same char as
+ * opening one. */
+ while(off < ctx->size && CH(off) == ch)
+ off++;
+ if(off - beg < ctx->code_fence_length)
+ goto out;
+
+ /* Optionally, space(s) can follow */
+ while(off < ctx->size && CH(off) == _T(' '))
+ off++;
+
+ /* But nothing more is allowed on the line. */
+ if(off < ctx->size && !ISNEWLINE(off))
+ goto out;
+
+ ret = TRUE;
+
+out:
+ /* Note we set *p_end even on failure: If we are not closing fence, caller
+ * would eat the line anyway without any parsing. */
+ *p_end = off;
+ return ret;
+}
+
+/* Returns type of the raw HTML block, or FALSE if it is not HTML block.
+ * (Refer to CommonMark specification for details about the types.)
+ */
+static int
+md_is_html_block_start_condition(MD_CTX* ctx, OFF beg)
+{
+ typedef struct TAG_tag TAG;
+ struct TAG_tag {
+ const CHAR* name;
+ unsigned len : 8;
+ };
+
+ /* Type 6 is started by a long list of allowed tags. We use two-level
+ * tree to speed-up the search. */
+#ifdef X
+ #undef X
+#endif
+#define X(name) { _T(name), sizeof(name)-1 }
+#define Xend { NULL, 0 }
+ static const TAG t1[] = { X("script"), X("pre"), X("style"), Xend };
+
+ static const TAG a6[] = { X("address"), X("article"), X("aside"), Xend };
+ static const TAG b6[] = { X("base"), X("basefont"), X("blockquote"), X("body"), Xend };
+ static const TAG c6[] = { X("caption"), X("center"), X("col"), X("colgroup"), Xend };
+ static const TAG d6[] = { X("dd"), X("details"), X("dialog"), X("dir"),
+ X("div"), X("dl"), X("dt"), Xend };
+ static const TAG f6[] = { X("fieldset"), X("figcaption"), X("figure"), X("footer"),
+ X("form"), X("frame"), X("frameset"), Xend };
+ static const TAG h6[] = { X("h1"), X("head"), X("header"), X("hr"), X("html"), Xend };
+ static const TAG i6[] = { X("iframe"), Xend };
+ static const TAG l6[] = { X("legend"), X("li"), X("link"), Xend };
+ static const TAG m6[] = { X("main"), X("menu"), X("menuitem"), Xend };
+ static const TAG n6[] = { X("nav"), X("noframes"), Xend };
+ static const TAG o6[] = { X("ol"), X("optgroup"), X("option"), Xend };
+ static const TAG p6[] = { X("p"), X("param"), Xend };
+ static const TAG s6[] = { X("section"), X("source"), X("summary"), Xend };
+ static const TAG t6[] = { X("table"), X("tbody"), X("td"), X("tfoot"), X("th"),
+ X("thead"), X("title"), X("tr"), X("track"), Xend };
+ static const TAG u6[] = { X("ul"), Xend };
+ static const TAG xx[] = { Xend };
+#undef X
+
+ static const TAG* map6[26] = {
+ a6, b6, c6, d6, xx, f6, xx, h6, i6, xx, xx, l6, m6,
+ n6, o6, p6, xx, xx, s6, t6, u6, xx, xx, xx, xx, xx
+ };
+ OFF off = beg + 1;
+ int i;
+
+ /* Check for type 1: <script, <pre, or <style */
+ for(i = 0; t1[i].name != NULL; i++) {
+ if(off + t1[i].len <= ctx->size) {
+ if(md_ascii_case_eq(STR(off), t1[i].name, t1[i].len))
+ return 1;
+ }
+ }
+
+ /* Check for type 2: <!-- */
+ if(off + 3 < ctx->size && CH(off) == _T('!') && CH(off+1) == _T('-') && CH(off+2) == _T('-'))
+ return 2;
+
+ /* Check for type 3: <? */
+ if(off < ctx->size && CH(off) == _T('?'))
+ return 3;
+
+ /* Check for type 4 or 5: <! */
+ if(off < ctx->size && CH(off) == _T('!')) {
+ /* Check for type 4: <! followed by uppercase letter. */
+ if(off + 1 < ctx->size && ISUPPER(off+1))
+ return 4;
+
+ /* Check for type 5: <![CDATA[ */
+ if(off + 8 < ctx->size) {
+ if(md_ascii_eq(STR(off), _T("![CDATA["), 8 * sizeof(CHAR)))
+ return 5;
+ }
+ }
+
+ /* Check for type 6: Many possible starting tags listed above. */
+ if(off + 1 < ctx->size && (ISALPHA(off) || (CH(off) == _T('/') && ISALPHA(off+1)))) {
+ int slot;
+ const TAG* tags;
+
+ if(CH(off) == _T('/'))
+ off++;
+
+ slot = (ISUPPER(off) ? CH(off) - 'A' : CH(off) - 'a');
+ tags = map6[slot];
+
+ for(i = 0; tags[i].name != NULL; i++) {
+ if(off + tags[i].len <= ctx->size) {
+ if(md_ascii_case_eq(STR(off), tags[i].name, tags[i].len)) {
+ OFF tmp = off + tags[i].len;
+ if(tmp >= ctx->size)
+ return 6;
+ if(ISBLANK(tmp) || ISNEWLINE(tmp) || CH(tmp) == _T('>'))
+ return 6;
+ if(tmp+1 < ctx->size && CH(tmp) == _T('/') && CH(tmp+1) == _T('>'))
+ return 6;
+ break;
+ }
+ }
+ }
+ }
+
+ /* Check for type 7: any COMPLETE other opening or closing tag. */
+ if(off + 1 < ctx->size) {
+ OFF end;
+
+ if(md_is_html_tag(ctx, NULL, 0, beg, ctx->size, &end)) {
+ /* Only optional whitespace and new line may follow. */
+ while(end < ctx->size && ISWHITESPACE(end))
+ end++;
+ if(end >= ctx->size || ISNEWLINE(end))
+ return 7;
+ }
+ }
+
+ return FALSE;
+}
+
+/* Case sensitive check whether there is a substring 'what' between 'beg'
+ * and end of line. */
+static int
+md_line_contains(MD_CTX* ctx, OFF beg, const CHAR* what, SZ what_len, OFF* p_end)
+{
+ OFF i;
+ for(i = beg; i + what_len < ctx->size; i++) {
+ if(ISNEWLINE(i))
+ break;
+ if(memcmp(STR(i), what, what_len * sizeof(CHAR)) == 0) {
+ *p_end = i + what_len;
+ return TRUE;
+ }
+ }
+
+ *p_end = i;
+ return FALSE;
+}
+
+/* Returns type of HTML block end condition or FALSE if not an end condition.
+ *
+ * Note it fills p_end even when it is not end condition as the caller
+ * does not need to analyze contents of a raw HTML block.
+ */
+static int
+md_is_html_block_end_condition(MD_CTX* ctx, OFF beg, OFF* p_end)
+{
+ switch(ctx->html_block_type) {
+ case 1:
+ {
+ OFF off = beg;
+
+ while(off < ctx->size && !ISNEWLINE(off)) {
+ if(CH(off) == _T('<')) {
+ if(md_ascii_case_eq(STR(off), _T("</script>"), 9)) {
+ *p_end = off + 9;
+ return TRUE;
+ }
+
+ if(md_ascii_case_eq(STR(off), _T("</style>"), 8)) {
+ *p_end = off + 8;
+ return TRUE;
+ }
+
+ if(md_ascii_case_eq(STR(off), _T("</pre>"), 6)) {
+ *p_end = off + 6;
+ return TRUE;
+ }
+ }
+
+ off++;
+ }
+ *p_end = off;
+ return FALSE;
+ }
+
+ case 2:
+ return (md_line_contains(ctx, beg, _T("-->"), 3, p_end) ? 2 : FALSE);
+
+ case 3:
+ return (md_line_contains(ctx, beg, _T("?>"), 2, p_end) ? 3 : FALSE);
+
+ case 4:
+ return (md_line_contains(ctx, beg, _T(">"), 1, p_end) ? 4 : FALSE);
+
+ case 5:
+ return (md_line_contains(ctx, beg, _T("]]>"), 3, p_end) ? 5 : FALSE);
+
+ case 6: /* Pass through */
+ case 7:
+ *p_end = beg;
+ return (ISNEWLINE(beg) ? ctx->html_block_type : FALSE);
+
+ default:
+ MD_UNREACHABLE();
+ }
+ return FALSE;
+}
+
+
+static int
+md_is_container_compatible(const MD_CONTAINER* pivot, const MD_CONTAINER* container)
+{
+ /* Block quote has no "items" like lists. */
+ if(container->ch == _T('>'))
+ return FALSE;
+
+ if(container->ch != pivot->ch)
+ return FALSE;
+ if(container->mark_indent > pivot->contents_indent)
+ return FALSE;
+
+ return TRUE;
+}
+
+static int
+md_push_container(MD_CTX* ctx, const MD_CONTAINER* container)
+{
+ if(ctx->n_containers >= ctx->alloc_containers) {
+ MD_CONTAINER* new_containers;
+
+ ctx->alloc_containers = (ctx->alloc_containers > 0 ? ctx->alloc_containers * 2 : 16);
+ new_containers = realloc(ctx->containers, ctx->alloc_containers * sizeof(MD_CONTAINER));
+ if(new_containers == NULL) {
+ MD_LOG("realloc() failed.");
+ return -1;
+ }
+
+ ctx->containers = new_containers;
+ }
+
+ memcpy(&ctx->containers[ctx->n_containers++], container, sizeof(MD_CONTAINER));
+ return 0;
+}
+
+static int
+md_enter_child_containers(MD_CTX* ctx, int n_children, unsigned data)
+{
+ int i;
+ int ret = 0;
+
+ for(i = ctx->n_containers - n_children; i < ctx->n_containers; i++) {
+ MD_CONTAINER* c = &ctx->containers[i];
+ int is_ordered_list = FALSE;
+
+ switch(c->ch) {
+ case _T(')'):
+ case _T('.'):
+ is_ordered_list = TRUE;
+ /* Pass through */
+
+ case _T('-'):
+ case _T('+'):
+ case _T('*'):
+ /* Remember offset in ctx->block_bytes so we can revisit the
+ * block if we detect it is a loose list. */
+ md_end_current_block(ctx);
+ c->block_byte_off = ctx->n_block_bytes;
+
+ MD_CHECK(md_push_container_bytes(ctx,
+ (is_ordered_list ? MD_BLOCK_OL : MD_BLOCK_UL),
+ c->start, data, MD_BLOCK_CONTAINER_OPENER));
+ MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
+ c->task_mark_off,
+ (c->is_task ? CH(c->task_mark_off) : 0),
+ MD_BLOCK_CONTAINER_OPENER));
+ break;
+
+ case _T('>'):
+ MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_QUOTE, 0, 0, MD_BLOCK_CONTAINER_OPENER));
+ break;
+
+ default:
+ MD_UNREACHABLE();
+ break;
+ }
+ }
+
+abort:
+ return ret;
+}
+
+static int
+md_leave_child_containers(MD_CTX* ctx, int n_keep)
+{
+ int ret = 0;
+
+ while(ctx->n_containers > n_keep) {
+ MD_CONTAINER* c = &ctx->containers[ctx->n_containers-1];
+ int is_ordered_list = FALSE;
+
+ switch(c->ch) {
+ case _T(')'):
+ case _T('.'):
+ is_ordered_list = TRUE;
+ /* Pass through */
+
+ case _T('-'):
+ case _T('+'):
+ case _T('*'):
+ MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
+ c->task_mark_off, (c->is_task ? CH(c->task_mark_off) : 0),
+ MD_BLOCK_CONTAINER_CLOSER));
+ MD_CHECK(md_push_container_bytes(ctx,
+ (is_ordered_list ? MD_BLOCK_OL : MD_BLOCK_UL), 0,
+ c->ch, MD_BLOCK_CONTAINER_CLOSER));
+ break;
+
+ case _T('>'):
+ MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_QUOTE, 0,
+ 0, MD_BLOCK_CONTAINER_CLOSER));
+ break;
+
+ default:
+ MD_UNREACHABLE();
+ break;
+ }
+
+ ctx->n_containers--;
+ }
+
+abort:
+ return ret;
+}
+
+static int
+md_is_container_mark(MD_CTX* ctx, unsigned indent, OFF beg, OFF* p_end, MD_CONTAINER* p_container)
+{
+ OFF off = beg;
+ OFF max_end;
+
+ if(indent >= ctx->code_indent_offset)
+ return FALSE;
+
+ /* Check for block quote mark. */
+ if(off < ctx->size && CH(off) == _T('>')) {
+ off++;
+ p_container->ch = _T('>');
+ p_container->is_loose = FALSE;
+ p_container->is_task = FALSE;
+ p_container->mark_indent = indent;
+ p_container->contents_indent = indent + 1;
+ *p_end = off;
+ return TRUE;
+ }
+
+ /* Check for list item bullet mark. */
+ if(off+1 < ctx->size && ISANYOF(off, _T("-+*")) && (ISBLANK(off+1) || ISNEWLINE(off+1))) {
+ p_container->ch = CH(off);
+ p_container->is_loose = FALSE;
+ p_container->is_task = FALSE;
+ p_container->mark_indent = indent;
+ p_container->contents_indent = indent + 1;
+ *p_end = off + 1;
+ return TRUE;
+ }
+
+ /* Check for ordered list item marks. */
+ max_end = off + 9;
+ if(max_end > ctx->size)
+ max_end = ctx->size;
+ p_container->start = 0;
+ while(off < max_end && ISDIGIT(off)) {
+ p_container->start = p_container->start * 10 + CH(off) - _T('0');
+ off++;
+ }
+ if(off > beg && off+1 < ctx->size &&
+ (CH(off) == _T('.') || CH(off) == _T(')')) &&
+ (ISBLANK(off+1) || ISNEWLINE(off+1)))
+ {
+ p_container->ch = CH(off);
+ p_container->is_loose = FALSE;
+ p_container->is_task = FALSE;
+ p_container->mark_indent = indent;
+ p_container->contents_indent = indent + off - beg + 1;
+ *p_end = off + 1;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static unsigned
+md_line_indentation(MD_CTX* ctx, unsigned total_indent, OFF beg, OFF* p_end)
+{
+ OFF off = beg;
+ unsigned indent = total_indent;
+
+ while(off < ctx->size && ISBLANK(off)) {
+ if(CH(off) == _T('\t'))
+ indent = (indent + 4) & ~3;
+ else
+ indent++;
+ off++;
+ }
+
+ *p_end = off;
+ return indent - total_indent;
+}
+
+static const MD_LINE_ANALYSIS md_dummy_blank_line = { MD_LINE_BLANK, 0 };
+
+/* Analyze type of the line and find some its properties. This serves as a
+ * main input for determining type and boundaries of a block. */
+static int
+md_analyze_line(MD_CTX* ctx, OFF beg, OFF* p_end,
+ const MD_LINE_ANALYSIS* pivot_line, MD_LINE_ANALYSIS* line)
+{
+ unsigned total_indent = 0;
+ int n_parents = 0;
+ int n_brothers = 0;
+ int n_children = 0;
+ MD_CONTAINER container = { 0 };
+ int prev_line_has_list_loosening_effect = ctx->last_line_has_list_loosening_effect;
+ OFF off = beg;
+ OFF hr_killer = 0;
+ int ret = 0;
+
+ line->indent = md_line_indentation(ctx, total_indent, off, &off);
+ total_indent += line->indent;
+ line->beg = off;
+
+ /* Given the indentation and block quote marks '>', determine how many of
+ * the current containers are our parents. */
+ while(n_parents < ctx->n_containers) {
+ MD_CONTAINER* c = &ctx->containers[n_parents];
+
+ if(c->ch == _T('>') && line->indent < ctx->code_indent_offset &&
+ off < ctx->size && CH(off) == _T('>'))
+ {
+ /* Block quote mark. */
+ off++;
+ total_indent++;
+ line->indent = md_line_indentation(ctx, total_indent, off, &off);
+ total_indent += line->indent;
+
+ /* The optional 1st space after '>' is part of the block quote mark. */
+ if(line->indent > 0)
+ line->indent--;
+
+ line->beg = off;
+ } else if(c->ch != _T('>') && line->indent >= c->contents_indent) {
+ /* List. */
+ line->indent -= c->contents_indent;
+ } else {
+ break;
+ }
+
+ n_parents++;
+ }
+
+ if(off >= ctx->size || ISNEWLINE(off)) {
+ /* Blank line does not need any real indentation to be nested inside
+ * a list. */
+ if(n_brothers + n_children == 0) {
+ while(n_parents < ctx->n_containers && ctx->containers[n_parents].ch != _T('>'))
+ n_parents++;
+ }
+ }
+
+ while(TRUE) {
+ /* Check whether we are fenced code continuation. */
+ if(pivot_line->type == MD_LINE_FENCEDCODE) {
+ line->beg = off;
+
+ /* We are another MD_LINE_FENCEDCODE unless we are closing fence
+ * which we transform into MD_LINE_BLANK. */
+ if(line->indent < ctx->code_indent_offset) {
+ if(md_is_closing_code_fence(ctx, CH(pivot_line->beg), off, &off)) {
+ line->type = MD_LINE_BLANK;
+ ctx->last_line_has_list_loosening_effect = FALSE;
+ break;
+ }
+ }
+
+ /* Change indentation accordingly to the initial code fence. */
+ if(n_parents == ctx->n_containers) {
+ if(line->indent > pivot_line->indent)
+ line->indent -= pivot_line->indent;
+ else
+ line->indent = 0;
+
+ line->type = MD_LINE_FENCEDCODE;
+ break;
+ }
+ }
+
+ /* Check whether we are HTML block continuation. */
+ if(pivot_line->type == MD_LINE_HTML && ctx->html_block_type > 0) {
+ int html_block_type;
+
+ html_block_type = md_is_html_block_end_condition(ctx, off, &off);
+ if(html_block_type > 0) {
+ MD_ASSERT(html_block_type == ctx->html_block_type);
+
+ /* Make sure this is the last line of the block. */
+ ctx->html_block_type = 0;
+
+ /* Some end conditions serve as blank lines at the same time. */
+ if(html_block_type == 6 || html_block_type == 7) {
+ line->type = MD_LINE_BLANK;
+ line->indent = 0;
+ break;
+ }
+ }
+
+ if(n_parents == ctx->n_containers) {
+ line->type = MD_LINE_HTML;
+ break;
+ }
+ }
+
+ /* Check for blank line. */
+ if(off >= ctx->size || ISNEWLINE(off)) {
+ if(pivot_line->type == MD_LINE_INDENTEDCODE && n_parents == ctx->n_containers) {
+ line->type = MD_LINE_INDENTEDCODE;
+ if(line->indent > ctx->code_indent_offset)
+ line->indent -= ctx->code_indent_offset;
+ else
+ line->indent = 0;
+ ctx->last_line_has_list_loosening_effect = FALSE;
+ } else {
+ line->type = MD_LINE_BLANK;
+ ctx->last_line_has_list_loosening_effect = (n_parents > 0 &&
+ n_brothers + n_children == 0 &&
+ ctx->containers[n_parents-1].ch != _T('>'));
+
+ #if 1
+ /* See https://github.com/mity/md4c/issues/6
+ *
+ * This ugly checking tests we are in (yet empty) list item but not
+ * its very first line (with the list item mark).
+ *
+ * If we are such blank line, then any following non-blank line
+ * which would be part of this list item actually ends the list
+ * because "a list item can begin with at most one blank line."
+ */
+ if(n_parents > 0 && ctx->containers[n_parents-1].ch != _T('>') &&
+ n_brothers + n_children == 0 && ctx->current_block == NULL &&
+ ctx->n_block_bytes > (int) sizeof(MD_BLOCK))
+ {
+ MD_BLOCK* top_block = (MD_BLOCK*) ((char*)ctx->block_bytes + ctx->n_block_bytes - sizeof(MD_BLOCK));
+ if(top_block->type == MD_BLOCK_LI)
+ ctx->last_list_item_starts_with_two_blank_lines = TRUE;
+ }
+ #endif
+ }
+ break;
+ } else {
+ #if 1
+ /* This is 2nd half of the hack. If the flag is set (that is there
+ * were 2nd blank line at the start of the list item) and we would also
+ * belonging to such list item, then interrupt the list. */
+ ctx->last_line_has_list_loosening_effect = FALSE;
+ if(ctx->last_list_item_starts_with_two_blank_lines) {
+ if(n_parents > 0 && ctx->containers[n_parents-1].ch != _T('>') &&
+ n_brothers + n_children == 0 && ctx->current_block == NULL &&
+ ctx->n_block_bytes > (int) sizeof(MD_BLOCK))
+ {
+ MD_BLOCK* top_block = (MD_BLOCK*) ((char*)ctx->block_bytes + ctx->n_block_bytes - sizeof(MD_BLOCK));
+ if(top_block->type == MD_BLOCK_LI)
+ n_parents--;
+ }
+
+ ctx->last_list_item_starts_with_two_blank_lines = FALSE;
+ }
+ #endif
+ }
+
+ /* Check whether we are Setext underline. */
+ if(line->indent < ctx->code_indent_offset && pivot_line->type == MD_LINE_TEXT
+ && (CH(off) == _T('=') || CH(off) == _T('-'))
+ && (n_parents == ctx->n_containers))
+ {
+ unsigned level;
+
+ if(md_is_setext_underline(ctx, off, &off, &level)) {
+ line->type = MD_LINE_SETEXTUNDERLINE;
+ line->data = level;
+ break;
+ }
+ }
+
+ /* Check for thematic break line. */
+ if(line->indent < ctx->code_indent_offset && ISANYOF(off, _T("-_*")) && off >= hr_killer) {
+ if(md_is_hr_line(ctx, off, &off, &hr_killer)) {
+ line->type = MD_LINE_HR;
+ break;
+ }
+ }
+
+ /* Check for "brother" container. I.e. whether we are another list item
+ * in already started list. */
+ if(n_parents < ctx->n_containers && n_brothers + n_children == 0) {
+ OFF tmp;
+
+ if(md_is_container_mark(ctx, line->indent, off, &tmp, &container) &&
+ md_is_container_compatible(&ctx->containers[n_parents], &container))
+ {
+ pivot_line = &md_dummy_blank_line;
+
+ off = tmp;
+
+ total_indent += container.contents_indent - container.mark_indent;
+ line->indent = md_line_indentation(ctx, total_indent, off, &off);
+ total_indent += line->indent;
+ line->beg = off;
+
+ /* Some of the following whitespace actually still belongs to the mark. */
+ if(off >= ctx->size || ISNEWLINE(off)) {
+ container.contents_indent++;
+ } else if(line->indent <= ctx->code_indent_offset) {
+ container.contents_indent += line->indent;
+ line->indent = 0;
+ } else {
+ container.contents_indent += 1;
+ line->indent--;
+ }
+
+ ctx->containers[n_parents].mark_indent = container.mark_indent;
+ ctx->containers[n_parents].contents_indent = container.contents_indent;
+
+ n_brothers++;
+ continue;
+ }
+ }
+
+ /* Check for indented code.
+ * Note indented code block cannot interrupt a paragraph. */
+ if(line->indent >= ctx->code_indent_offset &&
+ (pivot_line->type == MD_LINE_BLANK || pivot_line->type == MD_LINE_INDENTEDCODE))
+ {
+ line->type = MD_LINE_INDENTEDCODE;
+ MD_ASSERT(line->indent >= ctx->code_indent_offset);
+ line->indent -= ctx->code_indent_offset;
+ line->data = 0;
+ break;
+ }
+
+ /* Check for start of a new container block. */
+ if(line->indent < ctx->code_indent_offset &&
+ md_is_container_mark(ctx, line->indent, off, &off, &container))
+ {
+ if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers &&
+ (off >= ctx->size || ISNEWLINE(off)) && container.ch != _T('>'))
+ {
+ /* Noop. List mark followed by a blank line cannot interrupt a paragraph. */
+ } else if(pivot_line->type == MD_LINE_TEXT && n_parents == ctx->n_containers &&
+ (container.ch == _T('.') || container.ch == _T(')')) && container.start != 1)
+ {
+ /* Noop. Ordered list cannot interrupt a paragraph unless the start index is 1. */
+ } else {
+ total_indent += container.contents_indent - container.mark_indent;
+ line->indent = md_line_indentation(ctx, total_indent, off, &off);
+ total_indent += line->indent;
+
+ line->beg = off;
+ line->data = container.ch;
+
+ /* Some of the following whitespace actually still belongs to the mark. */
+ if(off >= ctx->size || ISNEWLINE(off)) {
+ container.contents_indent++;
+ } else if(line->indent <= ctx->code_indent_offset) {
+ container.contents_indent += line->indent;
+ line->indent = 0;
+ } else {
+ container.contents_indent += 1;
+ line->indent--;
+ }
+
+ if(n_brothers + n_children == 0)
+ pivot_line = &md_dummy_blank_line;
+
+ if(n_children == 0)
+ MD_CHECK(md_leave_child_containers(ctx, n_parents + n_brothers));
+
+ n_children++;
+ MD_CHECK(md_push_container(ctx, &container));
+ continue;
+ }
+ }
+
+ /* Check whether we are table continuation. */
+ if(pivot_line->type == MD_LINE_TABLE && md_is_table_row(ctx, off, &off) &&
+ n_parents == ctx->n_containers)
+ {
+ line->type = MD_LINE_TABLE;
+ break;
+ }
+
+ /* Check for ATX header. */
+ if(line->indent < ctx->code_indent_offset && CH(off) == _T('#')) {
+ unsigned level;
+
+ if(md_is_atxheader_line(ctx, off, &line->beg, &off, &level)) {
+ line->type = MD_LINE_ATXHEADER;
+ line->data = level;
+ break;
+ }
+ }
+
+ /* Check whether we are starting code fence. */
+ if(CH(off) == _T('`') || CH(off) == _T('~')) {
+ if(md_is_opening_code_fence(ctx, off, &off)) {
+ line->type = MD_LINE_FENCEDCODE;
+ line->data = 1;
+ break;
+ }
+ }
+
+ /* Check for start of raw HTML block. */
+ if(CH(off) == _T('<') && !(ctx->parser.flags & MD_FLAG_NOHTMLBLOCKS))
+ {
+ ctx->html_block_type = md_is_html_block_start_condition(ctx, off);
+
+ /* HTML block type 7 cannot interrupt paragraph. */
+ if(ctx->html_block_type == 7 && pivot_line->type == MD_LINE_TEXT)
+ ctx->html_block_type = 0;
+
+ if(ctx->html_block_type > 0) {
+ /* The line itself also may immediately close the block. */
+ if(md_is_html_block_end_condition(ctx, off, &off) == ctx->html_block_type) {
+ /* Make sure this is the last line of the block. */
+ ctx->html_block_type = 0;
+ }
+
+ line->type = MD_LINE_HTML;
+ break;
+ }
+ }
+
+ /* Check for table underline. */
+ if((ctx->parser.flags & MD_FLAG_TABLES) && pivot_line->type == MD_LINE_TEXT &&
+ (CH(off) == _T('|') || CH(off) == _T('-') || CH(off) == _T(':')) &&
+ n_parents == ctx->n_containers)
+ {
+ unsigned col_count;
+
+ if(ctx->current_block != NULL && ctx->current_block->n_lines == 1 &&
+ md_is_table_underline(ctx, off, &off, &col_count) &&
+ md_is_table_row(ctx, pivot_line->beg, NULL))
+ {
+ line->data = col_count;
+ line->type = MD_LINE_TABLEUNDERLINE;
+ break;
+ }
+ }
+
+ /* By default, we are normal text line. */
+ line->type = MD_LINE_TEXT;
+ if(pivot_line->type == MD_LINE_TEXT && n_brothers + n_children == 0) {
+ /* Lazy continuation. */
+ n_parents = ctx->n_containers;
+ }
+
+ /* Check for task mark. */
+ if((ctx->parser.flags & MD_FLAG_TASKLISTS) && n_brothers + n_children > 0 &&
+ ISANYOF_(ctx->containers[ctx->n_containers-1].ch, _T("-+*.)")))
+ {
+ OFF tmp = off;
+
+ while(tmp < ctx->size && tmp < off + 3 && ISBLANK(tmp))
+ tmp++;
+ if(tmp + 2 < ctx->size && CH(tmp) == _T('[') &&
+ ISANYOF(tmp+1, _T("xX ")) && CH(tmp+2) == _T(']') &&
+ (tmp + 3 == ctx->size || ISBLANK(tmp+3) || ISNEWLINE(tmp+3)))
+ {
+ MD_CONTAINER* task_container = (n_children > 0 ? &ctx->containers[ctx->n_containers-1] : &container);
+ task_container->is_task = TRUE;
+ task_container->task_mark_off = tmp + 1;
+ off = tmp + 3;
+ while(ISWHITESPACE(off))
+ off++;
+ line->beg = off;
+ }
+ }
+
+ break;
+ }
+
+ /* Scan for end of the line.
+ *
+ * Note this is quite a bottleneck of the parsing as we here iterate almost
+ * over compete document.
+ */
+#if defined __linux__ && !defined MD4C_USE_UTF16
+ /* Recent glibc versions have superbly optimized strcspn(), even using
+ * vectorization if available. */
+ if(ctx->doc_ends_with_newline && off < ctx->size) {
+ while(TRUE) {
+ off += (OFF) strcspn(STR(off), "\r\n");
+
+ /* strcspn() can stop on zero terminator; but that can appear
+ * anywhere in the Markfown input... */
+ if(CH(off) == _T('\0'))
+ off++;
+ else
+ break;
+ }
+ } else
+#endif
+ {
+ /* Optimization: Use some loop unrolling. */
+ while(off + 3 < ctx->size && !ISNEWLINE(off+0) && !ISNEWLINE(off+1)
+ && !ISNEWLINE(off+2) && !ISNEWLINE(off+3))
+ off += 4;
+ while(off < ctx->size && !ISNEWLINE(off))
+ off++;
+ }
+
+ /* Set end of the line. */
+ line->end = off;
+
+ /* But for ATX header, we should exclude the optional trailing mark. */
+ if(line->type == MD_LINE_ATXHEADER) {
+ OFF tmp = line->end;
+ while(tmp > line->beg && CH(tmp-1) == _T(' '))
+ tmp--;
+ while(tmp > line->beg && CH(tmp-1) == _T('#'))
+ tmp--;
+ if(tmp == line->beg || CH(tmp-1) == _T(' ') || (ctx->parser.flags & MD_FLAG_PERMISSIVEATXHEADERS))
+ line->end = tmp;
+ }
+
+ /* Trim trailing spaces. */
+ if(line->type != MD_LINE_INDENTEDCODE && line->type != MD_LINE_FENCEDCODE) {
+ while(line->end > line->beg && CH(line->end-1) == _T(' '))
+ line->end--;
+ }
+
+ /* Eat also the new line. */
+ if(off < ctx->size && CH(off) == _T('\r'))
+ off++;
+ if(off < ctx->size && CH(off) == _T('\n'))
+ off++;
+
+ *p_end = off;
+
+ /* If we belong to a list after seeing a blank line, the list is loose. */
+ if(prev_line_has_list_loosening_effect && line->type != MD_LINE_BLANK && n_parents + n_brothers > 0) {
+ MD_CONTAINER* c = &ctx->containers[n_parents + n_brothers - 1];
+ if(c->ch != _T('>')) {
+ MD_BLOCK* block = (MD_BLOCK*) (((char*)ctx->block_bytes) + c->block_byte_off);
+ block->flags |= MD_BLOCK_LOOSE_LIST;
+ }
+ }
+
+ /* Leave any containers we are not part of anymore. */
+ if(n_children == 0 && n_parents + n_brothers < ctx->n_containers)
+ MD_CHECK(md_leave_child_containers(ctx, n_parents + n_brothers));
+
+ /* Enter any container we found a mark for. */
+ if(n_brothers > 0) {
+ MD_ASSERT(n_brothers == 1);
+ MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
+ ctx->containers[n_parents].task_mark_off,
+ (ctx->containers[n_parents].is_task ? CH(ctx->containers[n_parents].task_mark_off) : 0),
+ MD_BLOCK_CONTAINER_CLOSER));
+ MD_CHECK(md_push_container_bytes(ctx, MD_BLOCK_LI,
+ container.task_mark_off,
+ (container.is_task ? CH(container.task_mark_off) : 0),
+ MD_BLOCK_CONTAINER_OPENER));
+ ctx->containers[n_parents].is_task = container.is_task;
+ ctx->containers[n_parents].task_mark_off = container.task_mark_off;
+ }
+
+ if(n_children > 0)
+ MD_CHECK(md_enter_child_containers(ctx, n_children, line->data));
+
+abort:
+ return ret;
+}
+
+static int
+md_process_line(MD_CTX* ctx, const MD_LINE_ANALYSIS** p_pivot_line, MD_LINE_ANALYSIS* line)
+{
+ const MD_LINE_ANALYSIS* pivot_line = *p_pivot_line;
+ int ret = 0;
+
+ /* Blank line ends current leaf block. */
+ if(line->type == MD_LINE_BLANK) {
+ MD_CHECK(md_end_current_block(ctx));
+ *p_pivot_line = &md_dummy_blank_line;
+ return 0;
+ }
+
+ /* Some line types form block on their own. */
+ if(line->type == MD_LINE_HR || line->type == MD_LINE_ATXHEADER) {
+ MD_CHECK(md_end_current_block(ctx));
+
+ /* Add our single-line block. */
+ MD_CHECK(md_start_new_block(ctx, line));
+ MD_CHECK(md_add_line_into_current_block(ctx, line));
+ MD_CHECK(md_end_current_block(ctx));
+ *p_pivot_line = &md_dummy_blank_line;
+ return 0;
+ }
+
+ /* MD_LINE_SETEXTUNDERLINE changes meaning of the current block and ends it. */
+ if(line->type == MD_LINE_SETEXTUNDERLINE) {
+ MD_ASSERT(ctx->current_block != NULL);
+ ctx->current_block->type = MD_BLOCK_H;
+ ctx->current_block->data = line->data;
+ ctx->current_block->flags |= MD_BLOCK_SETEXT_HEADER;
+ MD_CHECK(md_add_line_into_current_block(ctx, line));
+ MD_CHECK(md_end_current_block(ctx));
+ if(ctx->current_block == NULL) {
+ *p_pivot_line = &md_dummy_blank_line;
+ } else {
+ /* This happens if we have consumed all the body as link ref. defs.
+ * and downgraded the underline into start of a new paragraph block. */
+ line->type = MD_LINE_TEXT;
+ *p_pivot_line = line;
+ }
+ return 0;
+ }
+
+ /* MD_LINE_TABLEUNDERLINE changes meaning of the current block. */
+ if(line->type == MD_LINE_TABLEUNDERLINE) {
+ MD_ASSERT(ctx->current_block != NULL);
+ MD_ASSERT(ctx->current_block->n_lines == 1);
+ ctx->current_block->type = MD_BLOCK_TABLE;
+ ctx->current_block->data = line->data;
+ MD_ASSERT(pivot_line != &md_dummy_blank_line);
+ ((MD_LINE_ANALYSIS*)pivot_line)->type = MD_LINE_TABLE;
+ MD_CHECK(md_add_line_into_current_block(ctx, line));
+ return 0;
+ }
+
+ /* The current block also ends if the line has different type. */
+ if(line->type != pivot_line->type)
+ MD_CHECK(md_end_current_block(ctx));
+
+ /* The current line may start a new block. */
+ if(ctx->current_block == NULL) {
+ MD_CHECK(md_start_new_block(ctx, line));
+ *p_pivot_line = line;
+ }
+
+ /* In all other cases the line is just a continuation of the current block. */
+ MD_CHECK(md_add_line_into_current_block(ctx, line));
+
+abort:
+ return ret;
+}
+
+static int
+md_process_doc(MD_CTX *ctx)
+{
+ const MD_LINE_ANALYSIS* pivot_line = &md_dummy_blank_line;
+ MD_LINE_ANALYSIS line_buf[2];
+ MD_LINE_ANALYSIS* line = &line_buf[0];
+ OFF off = 0;
+ int ret = 0;
+
+ MD_ENTER_BLOCK(MD_BLOCK_DOC, NULL);
+
+ while(off < ctx->size) {
+ if(line == pivot_line)
+ line = (line == &line_buf[0] ? &line_buf[1] : &line_buf[0]);
+
+ MD_CHECK(md_analyze_line(ctx, off, &off, pivot_line, line));
+ MD_CHECK(md_process_line(ctx, &pivot_line, line));
+ }
+
+ md_end_current_block(ctx);
+
+ MD_CHECK(md_build_ref_def_hashtable(ctx));
+
+ /* Process all blocks. */
+ MD_CHECK(md_leave_child_containers(ctx, 0));
+ MD_CHECK(md_process_all_blocks(ctx));
+
+ MD_LEAVE_BLOCK(MD_BLOCK_DOC, NULL);
+
+abort:
+
+#if 0
+ /* Output some memory consumption statistics. */
+ {
+ char buffer[256];
+ sprintf(buffer, "Alloced %u bytes for block buffer.",
+ (unsigned)(ctx->alloc_block_bytes));
+ MD_LOG(buffer);
+
+ sprintf(buffer, "Alloced %u bytes for containers buffer.",
+ (unsigned)(ctx->alloc_containers * sizeof(MD_CONTAINER)));
+ MD_LOG(buffer);
+
+ sprintf(buffer, "Alloced %u bytes for marks buffer.",
+ (unsigned)(ctx->alloc_marks * sizeof(MD_MARK)));
+ MD_LOG(buffer);
+
+ sprintf(buffer, "Alloced %u bytes for aux. buffer.",
+ (unsigned)(ctx->alloc_buffer * sizeof(MD_CHAR)));
+ MD_LOG(buffer);
+ }
+#endif
+
+ return ret;
+}
+
+
+/********************
+ *** Public API ***
+ ********************/
+
+int
+md_parse(const MD_CHAR* text, MD_SIZE size, const MD_PARSER* parser, void* userdata)
+{
+ MD_CTX ctx;
+ int i;
+ int ret;
+
+ if(parser->abi_version != 0) {
+ if(parser->debug_log != NULL)
+ parser->debug_log("Unsupported abi_version.", userdata);
+ return -1;
+ }
+
+ /* Setup context structure. */
+ memset(&ctx, 0, sizeof(MD_CTX));
+ ctx.text = text;
+ ctx.size = size;
+ memcpy(&ctx.parser, parser, sizeof(MD_PARSER));
+ ctx.userdata = userdata;
+ ctx.code_indent_offset = (ctx.parser.flags & MD_FLAG_NOINDENTEDCODEBLOCKS) ? (OFF)(-1) : 4;
+ md_build_mark_char_map(&ctx);
+ ctx.doc_ends_with_newline = (size > 0 && ISNEWLINE_(text[size-1]));
+
+ /* Reset all unresolved opener mark chains. */
+ for(i = 0; i < (int) SIZEOF_ARRAY(ctx.mark_chains); i++) {
+ ctx.mark_chains[i].head = -1;
+ ctx.mark_chains[i].tail = -1;
+ }
+ ctx.unresolved_link_head = -1;
+ ctx.unresolved_link_tail = -1;
+
+ /* All the work. */
+ ret = md_process_doc(&ctx);
+
+ /* Clean-up. */
+ md_free_ref_defs(&ctx);
+ md_free_ref_def_hashtable(&ctx);
+ free(ctx.buffer);
+ free(ctx.marks);
+ free(ctx.block_bytes);
+ free(ctx.containers);
+
+ return ret;
+}
diff --git a/src/3rdparty/md4c/md4c.h b/src/3rdparty/md4c/md4c.h
new file mode 100644
index 0000000000..6d9fce5180
--- /dev/null
+++ b/src/3rdparty/md4c/md4c.h
@@ -0,0 +1,373 @@
+/*
+ * MD4C: Markdown parser for C
+ * (http://github.com/mity/md4c)
+ *
+ * Copyright (c) 2016-2019 Martin Mitas
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef MD4C_MARKDOWN_H
+#define MD4C_MARKDOWN_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#if defined MD4C_USE_UTF16
+ /* Magic to support UTF-16. Not that in order to use it, you have to define
+ * the macro MD4C_USE_UTF16 both when building MD4C as well as when
+ * including this header in your code. */
+ #ifdef _WIN32
+ #include <windows.h>
+ typedef WCHAR MD_CHAR;
+ #else
+ #error MD4C_USE_UTF16 is only supported on Windows.
+ #endif
+#else
+ typedef char MD_CHAR;
+#endif
+
+typedef unsigned MD_SIZE;
+typedef unsigned MD_OFFSET;
+
+
+/* Block represents a part of document hierarchy structure like a paragraph
+ * or list item.
+ */
+typedef enum MD_BLOCKTYPE {
+ /* <body>...</body> */
+ MD_BLOCK_DOC = 0,
+
+ /* <blockquote>...</blockquote> */
+ MD_BLOCK_QUOTE,
+
+ /* <ul>...</ul>
+ * Detail: Structure MD_BLOCK_UL_DETAIL. */
+ MD_BLOCK_UL,
+
+ /* <ol>...</ol>
+ * Detail: Structure MD_BLOCK_OL_DETAIL. */
+ MD_BLOCK_OL,
+
+ /* <li>...</li>
+ * Detail: Structure MD_BLOCK_LI_DETAIL. */
+ MD_BLOCK_LI,
+
+ /* <hr> */
+ MD_BLOCK_HR,
+
+ /* <h1>...</h1> (for levels up to 6)
+ * Detail: Structure MD_BLOCK_H_DETAIL. */
+ MD_BLOCK_H,
+
+ /* <pre><code>...</code></pre>
+ * Note the text lines within code blocks are terminated with '\n'
+ * instead of explicit MD_TEXT_BR. */
+ MD_BLOCK_CODE,
+
+ /* Raw HTML block. This itself does not correspond to any particular HTML
+ * tag. The contents of it _is_ raw HTML source intended to be put
+ * in verbatim form to the HTML output. */
+ MD_BLOCK_HTML,
+
+ /* <p>...</p> */
+ MD_BLOCK_P,
+
+ /* <table>...</table> and its contents.
+ * Detail: Structure MD_BLOCK_TD_DETAIL (used with MD_BLOCK_TH and MD_BLOCK_TD)
+ * Note all of these are used only if extension MD_FLAG_TABLES is enabled. */
+ MD_BLOCK_TABLE,
+ MD_BLOCK_THEAD,
+ MD_BLOCK_TBODY,
+ MD_BLOCK_TR,
+ MD_BLOCK_TH,
+ MD_BLOCK_TD
+} MD_BLOCKTYPE;
+
+/* Span represents an in-line piece of a document which should be rendered with
+ * the same font, color and other attributes. A sequence of spans forms a block
+ * like paragraph or list item. */
+typedef enum MD_SPANTYPE {
+ /* <em>...</em> */
+ MD_SPAN_EM,
+
+ /* <strong>...</strong> */
+ MD_SPAN_STRONG,
+
+ /* <a href="xxx">...</a>
+ * Detail: Structure MD_SPAN_A_DETAIL. */
+ MD_SPAN_A,
+
+ /* <img src="xxx">...</a>
+ * Detail: Structure MD_SPAN_IMG_DETAIL.
+ * Note: Image text can contain nested spans and even nested images.
+ * If rendered into ALT attribute of HTML <IMG> tag, it's responsibility
+ * of the renderer to deal with it.
+ */
+ MD_SPAN_IMG,
+
+ /* <code>...</code> */
+ MD_SPAN_CODE,
+
+ /* <del>...</del>
+ * Note: Recognized only when MD_FLAG_STRIKETHROUGH is enabled.
+ */
+ MD_SPAN_DEL,
+
+ /* For recognizing inline ($) and display ($$) equations
+ * Note: Recognized only when MD_FLAG_LATEXMATHSPANS is enabled.
+ */
+ MD_SPAN_LATEXMATH,
+ MD_SPAN_LATEXMATH_DISPLAY
+} MD_SPANTYPE;
+
+/* Text is the actual textual contents of span. */
+typedef enum MD_TEXTTYPE {
+ /* Normal text. */
+ MD_TEXT_NORMAL = 0,
+
+ /* NULL character. CommonMark requires replacing NULL character with
+ * the replacement char U+FFFD, so this allows caller to do that easily. */
+ MD_TEXT_NULLCHAR,
+
+ /* Line breaks.
+ * Note these are not sent from blocks with verbatim output (MD_BLOCK_CODE
+ * or MD_BLOCK_HTML). In such cases, '\n' is part of the text itself. */
+ MD_TEXT_BR, /* <br> (hard break) */
+ MD_TEXT_SOFTBR, /* '\n' in source text where it is not semantically meaningful (soft break) */
+
+ /* Entity.
+ * (a) Named entity, e.g. &nbsp;
+ * (Note MD4C does not have a list of known entities.
+ * Anything matching the regexp /&[A-Za-z][A-Za-z0-9]{1,47};/ is
+ * treated as a named entity.)
+ * (b) Numerical entity, e.g. &#1234;
+ * (c) Hexadecimal entity, e.g. &#x12AB;
+ *
+ * As MD4C is mostly encoding agnostic, application gets the verbatim
+ * entity text into the MD_RENDERER::text_callback(). */
+ MD_TEXT_ENTITY,
+
+ /* Text in a code block (inside MD_BLOCK_CODE) or inlined code (`code`).
+ * If it is inside MD_BLOCK_CODE, it includes spaces for indentation and
+ * '\n' for new lines. MD_TEXT_BR and MD_TEXT_SOFTBR are not sent for this
+ * kind of text. */
+ MD_TEXT_CODE,
+
+ /* Text is a raw HTML. If it is contents of a raw HTML block (i.e. not
+ * an inline raw HTML), then MD_TEXT_BR and MD_TEXT_SOFTBR are not used.
+ * The text contains verbatim '\n' for the new lines. */
+ MD_TEXT_HTML,
+
+ /* Text is inside an equation. This is processed the same way as inlined code
+ * spans (`code`). */
+ MD_TEXT_LATEXMATH
+} MD_TEXTTYPE;
+
+
+/* Alignment enumeration. */
+typedef enum MD_ALIGN {
+ MD_ALIGN_DEFAULT = 0, /* When unspecified. */
+ MD_ALIGN_LEFT,
+ MD_ALIGN_CENTER,
+ MD_ALIGN_RIGHT
+} MD_ALIGN;
+
+
+/* String attribute.
+ *
+ * This wraps strings which are outside of a normal text flow and which are
+ * propagated within various detailed structures, but which still may contain
+ * string portions of different types like e.g. entities.
+ *
+ * So, for example, lets consider an image has a title attribute string
+ * set to "foo &quot; bar". (Note the string size is 14.)
+ *
+ * Then the attribute MD_SPAN_IMG_DETAIL::title shall provide the following:
+ * -- [0]: "foo " (substr_types[0] == MD_TEXT_NORMAL; substr_offsets[0] == 0)
+ * -- [1]: "&quot;" (substr_types[1] == MD_TEXT_ENTITY; substr_offsets[1] == 4)
+ * -- [2]: " bar" (substr_types[2] == MD_TEXT_NORMAL; substr_offsets[2] == 10)
+ * -- [3]: (n/a) (n/a ; substr_offsets[3] == 14)
+ *
+ * Note that these conditions are guaranteed:
+ * -- substr_offsets[0] == 0
+ * -- substr_offsets[LAST+1] == size
+ * -- Only MD_TEXT_NORMAL, MD_TEXT_ENTITY, MD_TEXT_NULLCHAR substrings can appear.
+ */
+typedef struct MD_ATTRIBUTE {
+ const MD_CHAR* text;
+ MD_SIZE size;
+ const MD_TEXTTYPE* substr_types;
+ const MD_OFFSET* substr_offsets;
+} MD_ATTRIBUTE;
+
+
+/* Detailed info for MD_BLOCK_UL. */
+typedef struct MD_BLOCK_UL_DETAIL {
+ int is_tight; /* Non-zero if tight list, zero if loose. */
+ MD_CHAR mark; /* Item bullet character in MarkDown source of the list, e.g. '-', '+', '*'. */
+} MD_BLOCK_UL_DETAIL;
+
+/* Detailed info for MD_BLOCK_OL. */
+typedef struct MD_BLOCK_OL_DETAIL {
+ unsigned start; /* Start index of the ordered list. */
+ int is_tight; /* Non-zero if tight list, zero if loose. */
+ MD_CHAR mark_delimiter; /* Character delimiting the item marks in MarkDown source, e.g. '.' or ')' */
+} MD_BLOCK_OL_DETAIL;
+
+/* Detailed info for MD_BLOCK_LI. */
+typedef struct MD_BLOCK_LI_DETAIL {
+ int is_task; /* Can be non-zero only with MD_FLAG_TASKLISTS */
+ MD_CHAR task_mark; /* If is_task, then one of 'x', 'X' or ' '. Undefined otherwise. */
+ MD_OFFSET task_mark_offset; /* If is_task, then offset in the input of the char between '[' and ']'. */
+} MD_BLOCK_LI_DETAIL;
+
+/* Detailed info for MD_BLOCK_H. */
+typedef struct MD_BLOCK_H_DETAIL {
+ unsigned level; /* Header level (1 - 6) */
+} MD_BLOCK_H_DETAIL;
+
+/* Detailed info for MD_BLOCK_CODE. */
+typedef struct MD_BLOCK_CODE_DETAIL {
+ MD_ATTRIBUTE info;
+ MD_ATTRIBUTE lang;
+ MD_CHAR fence_char; /* The character used for fenced code block; or zero for indented code block. */
+} MD_BLOCK_CODE_DETAIL;
+
+/* Detailed info for MD_BLOCK_TH and MD_BLOCK_TD. */
+typedef struct MD_BLOCK_TD_DETAIL {
+ MD_ALIGN align;
+} MD_BLOCK_TD_DETAIL;
+
+/* Detailed info for MD_SPAN_A. */
+typedef struct MD_SPAN_A_DETAIL {
+ MD_ATTRIBUTE href;
+ MD_ATTRIBUTE title;
+} MD_SPAN_A_DETAIL;
+
+/* Detailed info for MD_SPAN_IMG. */
+typedef struct MD_SPAN_IMG_DETAIL {
+ MD_ATTRIBUTE src;
+ MD_ATTRIBUTE title;
+} MD_SPAN_IMG_DETAIL;
+
+
+/* Flags specifying extensions/deviations from CommonMark specification.
+ *
+ * By default (when MD_RENDERER::flags == 0), we follow CommonMark specification.
+ * The following flags may allow some extensions or deviations from it.
+ */
+#define MD_FLAG_COLLAPSEWHITESPACE 0x0001 /* In MD_TEXT_NORMAL, collapse non-trivial whitespace into single ' ' */
+#define MD_FLAG_PERMISSIVEATXHEADERS 0x0002 /* Do not require space in ATX headers ( ###header ) */
+#define MD_FLAG_PERMISSIVEURLAUTOLINKS 0x0004 /* Recognize URLs as autolinks even without '<', '>' */
+#define MD_FLAG_PERMISSIVEEMAILAUTOLINKS 0x0008 /* Recognize e-mails as autolinks even without '<', '>' and 'mailto:' */
+#define MD_FLAG_NOINDENTEDCODEBLOCKS 0x0010 /* Disable indented code blocks. (Only fenced code works.) */
+#define MD_FLAG_NOHTMLBLOCKS 0x0020 /* Disable raw HTML blocks. */
+#define MD_FLAG_NOHTMLSPANS 0x0040 /* Disable raw HTML (inline). */
+#define MD_FLAG_TABLES 0x0100 /* Enable tables extension. */
+#define MD_FLAG_STRIKETHROUGH 0x0200 /* Enable strikethrough extension. */
+#define MD_FLAG_PERMISSIVEWWWAUTOLINKS 0x0400 /* Enable WWW autolinks (even without any scheme prefix, if they begin with 'www.') */
+#define MD_FLAG_TASKLISTS 0x0800 /* Enable task list extension. */
+#define MD_FLAG_LATEXMATHSPANS 0x1000 /* Enable $ and $$ containing LaTeX equations. */
+
+#define MD_FLAG_PERMISSIVEAUTOLINKS (MD_FLAG_PERMISSIVEEMAILAUTOLINKS | MD_FLAG_PERMISSIVEURLAUTOLINKS | MD_FLAG_PERMISSIVEWWWAUTOLINKS)
+#define MD_FLAG_NOHTML (MD_FLAG_NOHTMLBLOCKS | MD_FLAG_NOHTMLSPANS)
+
+/* Convenient sets of flags corresponding to well-known Markdown dialects.
+ *
+ * Note we may only support subset of features of the referred dialect.
+ * The constant just enables those extensions which bring us as close as
+ * possible given what features we implement.
+ *
+ * ABI compatibility note: Meaning of these can change in time as new
+ * extensions, bringing the dialect closer to the original, are implemented.
+ */
+#define MD_DIALECT_COMMONMARK 0
+#define MD_DIALECT_GITHUB (MD_FLAG_PERMISSIVEAUTOLINKS | MD_FLAG_TABLES | MD_FLAG_STRIKETHROUGH | MD_FLAG_TASKLISTS)
+
+/* Renderer structure.
+ */
+typedef struct MD_PARSER {
+ /* Reserved. Set to zero.
+ */
+ unsigned abi_version;
+
+ /* Dialect options. Bitmask of MD_FLAG_xxxx values.
+ */
+ unsigned flags;
+
+ /* Caller-provided rendering callbacks.
+ *
+ * For some block/span types, more detailed information is provided in a
+ * type-specific structure pointed by the argument 'detail'.
+ *
+ * The last argument of all callbacks, 'userdata', is just propagated from
+ * md_parse() and is available for any use by the application.
+ *
+ * Note any strings provided to the callbacks as their arguments or as
+ * members of any detail structure are generally not zero-terminated.
+ * Application has take the respective size information into account.
+ *
+ * Callbacks may abort further parsing of the document by returning non-zero.
+ */
+ int (*enter_block)(MD_BLOCKTYPE /*type*/, void* /*detail*/, void* /*userdata*/);
+ int (*leave_block)(MD_BLOCKTYPE /*type*/, void* /*detail*/, void* /*userdata*/);
+
+ int (*enter_span)(MD_SPANTYPE /*type*/, void* /*detail*/, void* /*userdata*/);
+ int (*leave_span)(MD_SPANTYPE /*type*/, void* /*detail*/, void* /*userdata*/);
+
+ int (*text)(MD_TEXTTYPE /*type*/, const MD_CHAR* /*text*/, MD_SIZE /*size*/, void* /*userdata*/);
+
+ /* Debug callback. Optional (may be NULL).
+ *
+ * If provided and something goes wrong, this function gets called.
+ * This is intended for debugging and problem diagnosis for developers;
+ * it is not intended to provide any errors suitable for displaying to an
+ * end user.
+ */
+ void (*debug_log)(const char* /*msg*/, void* /*userdata*/);
+
+ /* Reserved. Set to NULL.
+ */
+ void (*syntax)(void);
+} MD_PARSER;
+
+
+/* For backward compatibility. Do not use in new code. */
+typedef MD_PARSER MD_RENDERER;
+
+
+/* Parse the Markdown document stored in the string 'text' of size 'size'.
+ * The renderer provides callbacks to be called during the parsing so the
+ * caller can render the document on the screen or convert the Markdown
+ * to another format.
+ *
+ * Zero is returned on success. If a runtime error occurs (e.g. a memory
+ * fails), -1 is returned. If the processing is aborted due any callback
+ * returning non-zero, md_parse() the return value of the callback is returned.
+ */
+int md_parse(const MD_CHAR* text, MD_SIZE size, const MD_PARSER* parser, void* userdata);
+
+
+#ifdef __cplusplus
+ } /* extern "C" { */
+#endif
+
+#endif /* MD4C_MARKDOWN_H */
diff --git a/src/3rdparty/md4c/qt_attribution.json b/src/3rdparty/md4c/qt_attribution.json
new file mode 100644
index 0000000000..5fd77269e9
--- /dev/null
+++ b/src/3rdparty/md4c/qt_attribution.json
@@ -0,0 +1,15 @@
+{
+ "Id": "md4c",
+ "Name": "MD4C",
+ "QDocModule": "qtgui",
+ "QtUsage": "Optionally used in QTextDocument if configured with textmarkdownreader.",
+
+ "Description": "A CommonMark-compliant Markdown parser.",
+ "Homepage": "https://github.com/mity/md4c",
+ "License": "MIT License",
+ "LicenseId": "MIT",
+ "LicenseFile": "LICENSE.md",
+ "Version": "0.3.4",
+ "DownloadLocation": "https://github.com/mity/md4c/releases/tag/release-0.3.4",
+ "Copyright": "Copyright © 2016-2019 Martin Mitáš"
+}
diff --git a/src/3rdparty/pcre2/patches/0001-fix-rtems-build-undefine-madvise.patch b/src/3rdparty/pcre2/patches/0001-fix-rtems-build-undefine-madvise.patch
new file mode 100644
index 0000000000..074b39df85
--- /dev/null
+++ b/src/3rdparty/pcre2/patches/0001-fix-rtems-build-undefine-madvise.patch
@@ -0,0 +1,28 @@
+From ac10063196685fe6124055feb1275e13a78f562e Mon Sep 17 00:00:00 2001
+From: Mikhail Svetkin <mikhail.svetkin@qt.io>
+Date: Tue, 20 Mar 2018 14:03:54 +0100
+Subject: [PATCH] rtems: Fix pcre2 build (madvise undefined)
+
+RTEMS does not have madvise. We can use only posix_madvise
+
+Change-Id: Ia18b7cd2d7f9db84331f7e2350d060b9e85b30c8
+---
+ src/3rdparty/pcre2/src/sljit/sljitUtils.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/pcre2/src/sljit/sljitUtils.c b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
+index 5c2a838932..2ead044b1b 100644
+--- a/src/3rdparty/pcre2/src/sljit/sljitUtils.c
++++ b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
+@@ -315,7 +315,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_st
+ aligned_new_start = (sljit_uw)new_start & ~sljit_page_align;
+ aligned_old_start = ((sljit_uw)stack->start) & ~sljit_page_align;
+ /* If madvise is available, we release the unnecessary space. */
+-#if defined(MADV_DONTNEED)
++#if defined(MADV_DONTNEED) && !defined(__rtems__)
+ if (aligned_new_start > aligned_old_start)
+ madvise((void*)aligned_old_start, aligned_new_start - aligned_old_start, MADV_DONTNEED);
+ #elif defined(POSIX_MADV_DONTNEED)
+--
+2.21.0
+
diff --git a/src/3rdparty/pcre2/src/sljit/sljitUtils.c b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
index 5c2a838932..2ead044b1b 100644
--- a/src/3rdparty/pcre2/src/sljit/sljitUtils.c
+++ b/src/3rdparty/pcre2/src/sljit/sljitUtils.c
@@ -315,7 +315,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_st
aligned_new_start = (sljit_uw)new_start & ~sljit_page_align;
aligned_old_start = ((sljit_uw)stack->start) & ~sljit_page_align;
/* If madvise is available, we release the unnecessary space. */
-#if defined(MADV_DONTNEED)
+#if defined(MADV_DONTNEED) && !defined(__rtems__)
if (aligned_new_start > aligned_old_start)
madvise((void*)aligned_old_start, aligned_new_start - aligned_old_start, MADV_DONTNEED);
#elif defined(POSIX_MADV_DONTNEED)
diff --git a/src/3rdparty/sha3/brg_endian.h b/src/3rdparty/sha3/brg_endian.h
index 09d2a8b6a9..9bb306e678 100644
--- a/src/3rdparty/sha3/brg_endian.h
+++ b/src/3rdparty/sha3/brg_endian.h
@@ -42,7 +42,7 @@ Changes for ARM 9/9/2010 [Downstream relative to Gladman's GitHub, upstream to Q
#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
# if !defined( __MINGW32__ ) && !defined( _AIX ) && !defined(Q_OS_QNX)
# include <endian.h>
-# if !defined( __BEOS__ )
+# if !defined( __BEOS__ ) && !defined(Q_OS_RTEMS)
# include <byteswap.h>
# endif
# endif
diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri
index 068764c726..cc8c12a6da 100644
--- a/src/3rdparty/sqlite.pri
+++ b/src/3rdparty/sqlite.pri
@@ -1,5 +1,6 @@
CONFIG(release, debug|release):DEFINES *= NDEBUG
-DEFINES += SQLITE_ENABLE_COLUMN_METADATA SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_FTS5 SQLITE_ENABLE_RTREE SQLITE_ENABLE_JSON1
+QT_FOR_CONFIG += core-private
+DEFINES += SQLITE_ENABLE_COLUMN_METADATA SQLITE_OMIT_COMPLETE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_FTS5 SQLITE_ENABLE_RTREE SQLITE_ENABLE_JSON1
!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS
qtConfig(posix_fallocate): DEFINES += HAVE_POSIX_FALLOCATE=1
winrt {
@@ -8,6 +9,11 @@ winrt {
}
qnx: DEFINES += _QNX_SOURCE
!win32:!winrt:!winphone: DEFINES += HAVE_USLEEP=1
+qtConfig(dlopen) {
+ QMAKE_USE += libdl
+} else {
+ DEFINES += SQLITE_OMIT_LOAD_EXTENSION
+}
integrity: QMAKE_CFLAGS += -include qplatformdefs.h
INCLUDEPATH += $$PWD/sqlite
SOURCES += $$PWD/sqlite/sqlite3.c
diff --git a/src/3rdparty/sqlite/patches/0001-Fix-CVE-2019-16168-in-SQLite.patch b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2019-16168-in-SQLite.patch
deleted file mode 100644
index e56a6a2411..0000000000
--- a/src/3rdparty/sqlite/patches/0001-Fix-CVE-2019-16168-in-SQLite.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 3442a3ce9c2bd366eb0bd1c18d37a6ce732a888d Mon Sep 17 00:00:00 2001
-From: Andy Shaw <andy.shaw@qt.io>
-Date: Wed, 25 Sep 2019 09:17:01 +0200
-Subject: [PATCH] Fix CVE-2019-16168 in SQLite
-
-v3.29.0 is the latest and there is no indication as to when the next
-release is so we will apply this separately for now and it can be
-reverted once it is in a release that we ship with.
-
-This patch is taken from https://www.sqlite.org/src/info/98357d8c1263920b
-
-Change-Id: I82d398b093b67842a4369e3220c01e7eea30763a
----
- src/3rdparty/sqlite/sqlite3.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
-index 61bfdeb766..b3e6ae27b6 100644
---- a/src/3rdparty/sqlite/sqlite3.c
-+++ b/src/3rdparty/sqlite/sqlite3.c
-@@ -105933,7 +105933,9 @@ static void decodeIntArray(
- if( sqlite3_strglob("unordered*", z)==0 ){
- pIndex->bUnordered = 1;
- }else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){
-- pIndex->szIdxRow = sqlite3LogEst(sqlite3Atoi(z+3));
-+ int sz = sqlite3Atoi(z+3);
-+ if( sz<2 ) sz = 2;
-+ pIndex->szIdxRow = sqlite3LogEst(sz);
- }else if( sqlite3_strglob("noskipscan*", z)==0 ){
- pIndex->noSkipScan = 1;
- }
-@@ -143260,6 +143262,7 @@ static int whereLoopAddBtreeIndex(
- ** it to pNew->rRun, which is currently set to the cost of the index
- ** seek only. Then, if this is a non-covering index, add the cost of
- ** visiting the rows in the main table. */
-+ assert( pSrc->pTab->szTabRow>0 );
- rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow;
- pNew->rRun = sqlite3LogEstAdd(rLogSize, rCostIdx);
- if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
---
-2.20.1 (Apple Git-117)
-
diff --git a/src/3rdparty/sqlite/qt_attribution.json b/src/3rdparty/sqlite/qt_attribution.json
index 2ad20f8637..4d0851e9b9 100644
--- a/src/3rdparty/sqlite/qt_attribution.json
+++ b/src/3rdparty/sqlite/qt_attribution.json
@@ -6,8 +6,8 @@
"Description": "SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.",
"Homepage": "https://www.sqlite.org/",
- "Version": "3.29.0",
- "DownloadLocation": "https://www.sqlite.org/2019/sqlite-amalgamation-3290000.zip",
+ "Version": "3.30.1",
+ "DownloadLocation": "https://www.sqlite.org/2019/sqlite-amalgamation-3300100.zip",
"License": "Public Domain",
"Copyright": "The authors disclaim copyright to the source code. However, a license can be obtained if needed."
}
diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c
index b3e6ae27b6..8fd740b300 100644
--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.29.0. By combining all the individual C code files into this
+** version 3.30.1. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
@@ -331,8 +331,6 @@ static const char * const sqlite3azCompileOpt[] = {
#endif
#if defined(SQLITE_ENABLE_STAT4)
"ENABLE_STAT4",
-#elif defined(SQLITE_ENABLE_STAT3)
- "ENABLE_STAT3",
#endif
#if SQLITE_ENABLE_STMTVTAB
"ENABLE_STMTVTAB",
@@ -1167,9 +1165,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.29.0"
-#define SQLITE_VERSION_NUMBER 3029000
-#define SQLITE_SOURCE_ID "2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6"
+#define SQLITE_VERSION "3.30.1"
+#define SQLITE_VERSION_NUMBER 3030001
+#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -3137,6 +3135,17 @@ struct sqlite3_mem_methods {
** following this call. The second parameter may be a NULL pointer, in
** which case the trigger setting is not reported back. </dd>
**
+** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
+** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
+** <dd> ^This option is used to enable or disable [CREATE VIEW | views].
+** There should be two additional arguments.
+** The first argument is an integer which is 0 to disable views,
+** positive to enable views or negative to leave the setting unchanged.
+** The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether views are disabled or enabled
+** following this call. The second parameter may be a NULL pointer, in
+** which case the view setting is not reported back. </dd>
+**
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
** <dd> ^This option is used to enable or disable the
@@ -3309,7 +3318,8 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */
#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */
#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */
-#define SQLITE_DBCONFIG_MAX 1014 /* Largest DBCONFIG */
+#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */
+#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -4858,7 +4868,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** ^The specific value of WHERE-clause [parameter] might influence the
** choice of query plan if the parameter is the left-hand side of a [LIKE]
** or [GLOB] operator or if the parameter is compared to an indexed column
-** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
+** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled.
** </li>
** </ol>
**
@@ -5893,6 +5903,12 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
** perform additional optimizations on deterministic functions, so use
** of the [SQLITE_DETERMINISTIC] flag is recommended where possible.
**
+** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY]
+** flag, which if present prevents the function from being invoked from
+** within VIEWs or TRIGGERs. For security reasons, the [SQLITE_DIRECTONLY]
+** flag is recommended for any application-defined SQL function that has
+** side-effects.
+**
** ^(The fifth parameter is an arbitrary pointer. The implementation of the
** function can gain access to this pointer using [sqlite3_user_data()].)^
**
@@ -6009,8 +6025,30 @@ SQLITE_API int sqlite3_create_window_function(
** [SQLITE_UTF8 | preferred text encoding] as the fourth argument
** to [sqlite3_create_function()], [sqlite3_create_function16()], or
** [sqlite3_create_function_v2()].
+**
+** The SQLITE_DETERMINISTIC flag means that the new function will always
+** maps the same inputs into the same output. The abs() function is
+** deterministic, for example, but randomblob() is not.
+**
+** The SQLITE_DIRECTONLY flag means that the function may only be invoked
+** from top-level SQL, and cannot be used in VIEWs or TRIGGERs. This is
+** a security feature which is recommended for all
+** [application-defined SQL functions] that have side-effects. This flag
+** prevents an attacker from adding triggers and views to a schema then
+** tricking a high-privilege application into causing unintended side-effects
+** while performing ordinary queries.
+**
+** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call
+** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
+** Specifying this flag makes no difference for scalar or aggregate user
+** functions. However, if it is not specified for a user-defined window
+** function, then any sub-types belonging to arguments passed to the window
+** function may be discarded before the window function is called (i.e.
+** sqlite3_value_subtype() will always return 0).
*/
-#define SQLITE_DETERMINISTIC 0x800
+#define SQLITE_DETERMINISTIC 0x000000800
+#define SQLITE_DIRECTONLY 0x000080000
+#define SQLITE_SUBTYPE 0x000100000
/*
** CAPI3REF: Deprecated Functions
@@ -7656,6 +7694,12 @@ struct sqlite3_index_info {
** ^The sqlite3_create_module()
** interface is equivalent to sqlite3_create_module_v2() with a NULL
** destructor.
+**
+** ^If the third parameter (the pointer to the sqlite3_module object) is
+** NULL then no new module is create and any existing modules with the
+** same name are dropped.
+**
+** See also: [sqlite3_drop_modules()]
*/
SQLITE_API int sqlite3_create_module(
sqlite3 *db, /* SQLite connection to register module with */
@@ -7672,6 +7716,23 @@ SQLITE_API int sqlite3_create_module_v2(
);
/*
+** CAPI3REF: Remove Unnecessary Virtual Table Implementations
+** METHOD: sqlite3
+**
+** ^The sqlite3_drop_modules(D,L) interface removes all virtual
+** table modules from database connection D except those named on list L.
+** The L parameter must be either NULL or a pointer to an array of pointers
+** to strings where the array is terminated by a single NULL pointer.
+** ^If the L parameter is NULL, then all virtual table modules are removed.
+**
+** See also: [sqlite3_create_module()]
+*/
+SQLITE_API int sqlite3_drop_modules(
+ sqlite3 *db, /* Remove modules from this connection */
+ const char **azKeep /* Except, do not remove the ones named here */
+);
+
+/*
** CAPI3REF: Virtual Table Instance Object
** KEYWORDS: sqlite3_vtab
**
@@ -8379,7 +8440,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_FIRST 5
#define SQLITE_TESTCTRL_PRNG_SAVE 5
#define SQLITE_TESTCTRL_PRNG_RESTORE 6
-#define SQLITE_TESTCTRL_PRNG_RESET 7
+#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
#define SQLITE_TESTCTRL_BITVEC_TEST 8
#define SQLITE_TESTCTRL_FAULT_INSTALL 9
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
@@ -8402,7 +8463,9 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_IMPOSTER 25
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
-#define SQLITE_TESTCTRL_LAST 27 /* Largest TESTCTRL */
+#define SQLITE_TESTCTRL_PRNG_SEED 28
+#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
+#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
/*
** CAPI3REF: SQL Keyword Checking
@@ -13099,15 +13162,15 @@ struct fts5_api {
** So we have to define the macros in different ways depending on the
** compiler.
*/
-#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC */
+#if defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */
+# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X))
+# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X))
+#elif defined(__PTRDIFF_TYPE__) /* This case should work for GCC */
# define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X))
# define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X))
#elif !defined(__GNUC__) /* Works for compilers other than LLVM */
# define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X])
# define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0))
-#elif defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */
-# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X))
-# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X))
#else /* Generates a warning - but it always works */
# define SQLITE_INT_TO_PTR(X) ((void*)(X))
# define SQLITE_PTR_TO_INT(X) ((int)(X))
@@ -13597,100 +13660,103 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*);
#define TK_VIEW 79
#define TK_VIRTUAL 80
#define TK_WITH 81
-#define TK_CURRENT 82
-#define TK_FOLLOWING 83
-#define TK_PARTITION 84
-#define TK_PRECEDING 85
-#define TK_RANGE 86
-#define TK_UNBOUNDED 87
-#define TK_EXCLUDE 88
-#define TK_GROUPS 89
-#define TK_OTHERS 90
-#define TK_TIES 91
-#define TK_REINDEX 92
-#define TK_RENAME 93
-#define TK_CTIME_KW 94
-#define TK_ANY 95
-#define TK_BITAND 96
-#define TK_BITOR 97
-#define TK_LSHIFT 98
-#define TK_RSHIFT 99
-#define TK_PLUS 100
-#define TK_MINUS 101
-#define TK_STAR 102
-#define TK_SLASH 103
-#define TK_REM 104
-#define TK_CONCAT 105
-#define TK_COLLATE 106
-#define TK_BITNOT 107
-#define TK_ON 108
-#define TK_INDEXED 109
-#define TK_STRING 110
-#define TK_JOIN_KW 111
-#define TK_CONSTRAINT 112
-#define TK_DEFAULT 113
-#define TK_NULL 114
-#define TK_PRIMARY 115
-#define TK_UNIQUE 116
-#define TK_CHECK 117
-#define TK_REFERENCES 118
-#define TK_AUTOINCR 119
-#define TK_INSERT 120
-#define TK_DELETE 121
-#define TK_UPDATE 122
-#define TK_SET 123
-#define TK_DEFERRABLE 124
-#define TK_FOREIGN 125
-#define TK_DROP 126
-#define TK_UNION 127
-#define TK_ALL 128
-#define TK_EXCEPT 129
-#define TK_INTERSECT 130
-#define TK_SELECT 131
-#define TK_VALUES 132
-#define TK_DISTINCT 133
-#define TK_DOT 134
-#define TK_FROM 135
-#define TK_JOIN 136
-#define TK_USING 137
-#define TK_ORDER 138
-#define TK_GROUP 139
-#define TK_HAVING 140
-#define TK_LIMIT 141
-#define TK_WHERE 142
-#define TK_INTO 143
-#define TK_NOTHING 144
-#define TK_FLOAT 145
-#define TK_BLOB 146
-#define TK_INTEGER 147
-#define TK_VARIABLE 148
-#define TK_CASE 149
-#define TK_WHEN 150
-#define TK_THEN 151
-#define TK_ELSE 152
-#define TK_INDEX 153
-#define TK_ALTER 154
-#define TK_ADD 155
-#define TK_WINDOW 156
-#define TK_OVER 157
-#define TK_FILTER 158
-#define TK_TRUEFALSE 159
-#define TK_ISNOT 160
-#define TK_FUNCTION 161
+#define TK_NULLS 82
+#define TK_FIRST 83
+#define TK_LAST 84
+#define TK_CURRENT 85
+#define TK_FOLLOWING 86
+#define TK_PARTITION 87
+#define TK_PRECEDING 88
+#define TK_RANGE 89
+#define TK_UNBOUNDED 90
+#define TK_EXCLUDE 91
+#define TK_GROUPS 92
+#define TK_OTHERS 93
+#define TK_TIES 94
+#define TK_REINDEX 95
+#define TK_RENAME 96
+#define TK_CTIME_KW 97
+#define TK_ANY 98
+#define TK_BITAND 99
+#define TK_BITOR 100
+#define TK_LSHIFT 101
+#define TK_RSHIFT 102
+#define TK_PLUS 103
+#define TK_MINUS 104
+#define TK_STAR 105
+#define TK_SLASH 106
+#define TK_REM 107
+#define TK_CONCAT 108
+#define TK_COLLATE 109
+#define TK_BITNOT 110
+#define TK_ON 111
+#define TK_INDEXED 112
+#define TK_STRING 113
+#define TK_JOIN_KW 114
+#define TK_CONSTRAINT 115
+#define TK_DEFAULT 116
+#define TK_NULL 117
+#define TK_PRIMARY 118
+#define TK_UNIQUE 119
+#define TK_CHECK 120
+#define TK_REFERENCES 121
+#define TK_AUTOINCR 122
+#define TK_INSERT 123
+#define TK_DELETE 124
+#define TK_UPDATE 125
+#define TK_SET 126
+#define TK_DEFERRABLE 127
+#define TK_FOREIGN 128
+#define TK_DROP 129
+#define TK_UNION 130
+#define TK_ALL 131
+#define TK_EXCEPT 132
+#define TK_INTERSECT 133
+#define TK_SELECT 134
+#define TK_VALUES 135
+#define TK_DISTINCT 136
+#define TK_DOT 137
+#define TK_FROM 138
+#define TK_JOIN 139
+#define TK_USING 140
+#define TK_ORDER 141
+#define TK_GROUP 142
+#define TK_HAVING 143
+#define TK_LIMIT 144
+#define TK_WHERE 145
+#define TK_INTO 146
+#define TK_NOTHING 147
+#define TK_FLOAT 148
+#define TK_BLOB 149
+#define TK_INTEGER 150
+#define TK_VARIABLE 151
+#define TK_CASE 152
+#define TK_WHEN 153
+#define TK_THEN 154
+#define TK_ELSE 155
+#define TK_INDEX 156
+#define TK_ALTER 157
+#define TK_ADD 158
+#define TK_WINDOW 159
+#define TK_OVER 160
+#define TK_FILTER 161
#define TK_COLUMN 162
#define TK_AGG_FUNCTION 163
#define TK_AGG_COLUMN 164
-#define TK_UMINUS 165
-#define TK_UPLUS 166
-#define TK_TRUTH 167
-#define TK_REGISTER 168
-#define TK_VECTOR 169
-#define TK_SELECT_COLUMN 170
-#define TK_IF_NULL_ROW 171
-#define TK_ASTERISK 172
-#define TK_SPAN 173
-#define TK_SPACE 174
-#define TK_ILLEGAL 175
+#define TK_TRUEFALSE 165
+#define TK_ISNOT 166
+#define TK_FUNCTION 167
+#define TK_UMINUS 168
+#define TK_UPLUS 169
+#define TK_TRUTH 170
+#define TK_REGISTER 171
+#define TK_VECTOR 172
+#define TK_SELECT_COLUMN 173
+#define TK_IF_NULL_ROW 174
+#define TK_ASTERISK 175
+#define TK_SPAN 176
+#define TK_SPACE 177
+#define TK_ILLEGAL 178
/************** End of parse.h ***********************************************/
/************** Continuing where we left off in sqliteInt.h ******************/
@@ -14102,20 +14168,6 @@ typedef INT16_TYPE LogEst;
#endif
/*
-** Only one of SQLITE_ENABLE_STAT3 or SQLITE_ENABLE_STAT4 can be defined.
-** Priority is given to SQLITE_ENABLE_STAT4. If either are defined, also
-** define SQLITE_ENABLE_STAT3_OR_STAT4
-*/
-#ifdef SQLITE_ENABLE_STAT4
-# undef SQLITE_ENABLE_STAT3
-# define SQLITE_ENABLE_STAT3_OR_STAT4 1
-#elif SQLITE_ENABLE_STAT3
-# define SQLITE_ENABLE_STAT3_OR_STAT4 1
-#elif SQLITE_ENABLE_STAT3_OR_STAT4
-# undef SQLITE_ENABLE_STAT3_OR_STAT4
-#endif
-
-/*
** SELECTTRACE_ENABLED will be either 1 or 0 depending on whether or not
** the Select query generator tracing logic is turned on.
*/
@@ -14984,24 +15036,24 @@ typedef struct VdbeOpList VdbeOpList;
#define OP_Count 93 /* synopsis: r[P2]=count() */
#define OP_ReadCookie 94
#define OP_SetCookie 95
-#define OP_BitAnd 96 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
-#define OP_BitOr 97 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
-#define OP_ShiftLeft 98 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
-#define OP_ShiftRight 99 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
-#define OP_Add 100 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
-#define OP_Subtract 101 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
-#define OP_Multiply 102 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
-#define OP_Divide 103 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
-#define OP_Remainder 104 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
-#define OP_Concat 105 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
-#define OP_ReopenIdx 106 /* synopsis: root=P2 iDb=P3 */
-#define OP_BitNot 107 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
-#define OP_OpenRead 108 /* synopsis: root=P2 iDb=P3 */
-#define OP_OpenWrite 109 /* synopsis: root=P2 iDb=P3 */
-#define OP_String8 110 /* same as TK_STRING, synopsis: r[P2]='P4' */
-#define OP_OpenDup 111
-#define OP_OpenAutoindex 112 /* synopsis: nColumn=P2 */
-#define OP_OpenEphemeral 113 /* synopsis: nColumn=P2 */
+#define OP_ReopenIdx 96 /* synopsis: root=P2 iDb=P3 */
+#define OP_OpenRead 97 /* synopsis: root=P2 iDb=P3 */
+#define OP_OpenWrite 98 /* synopsis: root=P2 iDb=P3 */
+#define OP_BitAnd 99 /* same as TK_BITAND, synopsis: r[P3]=r[P1]&r[P2] */
+#define OP_BitOr 100 /* same as TK_BITOR, synopsis: r[P3]=r[P1]|r[P2] */
+#define OP_ShiftLeft 101 /* same as TK_LSHIFT, synopsis: r[P3]=r[P2]<<r[P1] */
+#define OP_ShiftRight 102 /* same as TK_RSHIFT, synopsis: r[P3]=r[P2]>>r[P1] */
+#define OP_Add 103 /* same as TK_PLUS, synopsis: r[P3]=r[P1]+r[P2] */
+#define OP_Subtract 104 /* same as TK_MINUS, synopsis: r[P3]=r[P2]-r[P1] */
+#define OP_Multiply 105 /* same as TK_STAR, synopsis: r[P3]=r[P1]*r[P2] */
+#define OP_Divide 106 /* same as TK_SLASH, synopsis: r[P3]=r[P2]/r[P1] */
+#define OP_Remainder 107 /* same as TK_REM, synopsis: r[P3]=r[P2]%r[P1] */
+#define OP_Concat 108 /* same as TK_CONCAT, synopsis: r[P3]=r[P2]+r[P1] */
+#define OP_OpenDup 109
+#define OP_BitNot 110 /* same as TK_BITNOT, synopsis: r[P2]= ~r[P1] */
+#define OP_OpenAutoindex 111 /* synopsis: nColumn=P2 */
+#define OP_OpenEphemeral 112 /* synopsis: nColumn=P2 */
+#define OP_String8 113 /* same as TK_STRING, synopsis: r[P2]='P4' */
#define OP_SorterOpen 114
#define OP_SequenceTest 115 /* synopsis: if( cursor[P1].ctr++ ) pc = P2 */
#define OP_OpenPseudo 116 /* synopsis: P3 columns in r[P2] */
@@ -15033,10 +15085,10 @@ typedef struct VdbeOpList VdbeOpList;
#define OP_LoadAnalysis 142
#define OP_DropTable 143
#define OP_DropIndex 144
-#define OP_Real 145 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
-#define OP_DropTrigger 146
-#define OP_IntegrityCk 147
-#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */
+#define OP_DropTrigger 145
+#define OP_IntegrityCk 146
+#define OP_RowSetAdd 147 /* synopsis: rowset(P1)=r[P2] */
+#define OP_Real 148 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
#define OP_Param 149
#define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */
#define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */
@@ -15085,13 +15137,13 @@ typedef struct VdbeOpList VdbeOpList;
/* 72 */ 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10,\
/* 80 */ 0x10, 0x00, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00,\
/* 88 */ 0x12, 0x20, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00,\
-/* 96 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26, 0x26,\
-/* 104 */ 0x26, 0x26, 0x00, 0x12, 0x00, 0x00, 0x10, 0x00,\
-/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+/* 96 */ 0x00, 0x00, 0x00, 0x26, 0x26, 0x26, 0x26, 0x26,\
+/* 104 */ 0x26, 0x26, 0x26, 0x26, 0x26, 0x00, 0x12, 0x00,\
+/* 112 */ 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,\
-/* 144 */ 0x00, 0x10, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\
+/* 144 */ 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x04,\
/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,}
@@ -15161,10 +15213,10 @@ SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char*,const char*);
# define sqlite3ExplainBreakpoint(A,B) /*no-op*/
#endif
SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
-SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe*, u32 addr, u8);
-SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1);
-SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2);
-SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3);
+SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe*, int addr, u8);
+SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
+SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
+SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe*, int addr, int P3);
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe*, u16 P5);
SQLITE_PRIVATE void sqlite3VdbeJumpHere(Vdbe*, int addr);
SQLITE_PRIVATE int sqlite3VdbeChangeToNoop(Vdbe*, int addr);
@@ -16121,6 +16173,7 @@ SQLITE_PRIVATE void sqlite3OsCloseFree(sqlite3_file *);
#define MUTEX_LOGIC(X)
#else
#define MUTEX_LOGIC(X) X
+SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
#endif /* defined(SQLITE_MUTEX_OMIT) */
/************** End of mutex.h ***********************************************/
@@ -16379,6 +16432,7 @@ struct sqlite3 {
unsigned orphanTrigger : 1; /* Last statement is orphaned TEMP trigger */
unsigned imposterTable : 1; /* Building an imposter table */
unsigned reopenMemdb : 1; /* ATTACH is really a reopen using MemDB */
+ char **azInit; /* "type", "name", and "tbl_name" columns */
} init;
int nVdbeActive; /* Number of VDBEs currently running */
int nVdbeRead; /* Number of active VDBEs that read or write */
@@ -16517,16 +16571,17 @@ struct sqlite3 {
#define SQLITE_Defensive 0x10000000 /* Input SQL is likely hostile */
#define SQLITE_DqsDDL 0x20000000 /* dbl-quoted strings allowed in DDL*/
#define SQLITE_DqsDML 0x40000000 /* dbl-quoted strings allowed in DML*/
+#define SQLITE_EnableView 0x80000000 /* Enable the use of views */
/* Flags used only if debugging */
#define HI(X) ((u64)(X)<<32)
#ifdef SQLITE_DEBUG
-#define SQLITE_SqlTrace HI(0x0001) /* Debug print SQL as it executes */
-#define SQLITE_VdbeListing HI(0x0002) /* Debug listings of VDBE progs */
-#define SQLITE_VdbeTrace HI(0x0004) /* True to trace VDBE execution */
-#define SQLITE_VdbeAddopTrace HI(0x0008) /* Trace sqlite3VdbeAddOp() calls */
-#define SQLITE_VdbeEQP HI(0x0010) /* Debug EXPLAIN QUERY PLAN */
-#define SQLITE_ParserTrace HI(0x0020) /* PRAGMA parser_trace=ON */
+#define SQLITE_SqlTrace HI(0x0100000) /* Debug print SQL as it executes */
+#define SQLITE_VdbeListing HI(0x0200000) /* Debug listings of VDBE progs */
+#define SQLITE_VdbeTrace HI(0x0400000) /* True to trace VDBE execution */
+#define SQLITE_VdbeAddopTrace HI(0x0800000) /* Trace sqlite3VdbeAddOp() calls */
+#define SQLITE_VdbeEQP HI(0x1000000) /* Debug EXPLAIN QUERY PLAN */
+#define SQLITE_ParserTrace HI(0x2000000) /* PRAGMA parser_trace=ON */
#endif
/*
@@ -16554,8 +16609,8 @@ struct sqlite3 {
#define SQLITE_OmitNoopJoin 0x0100 /* Omit unused tables in joins */
#define SQLITE_CountOfView 0x0200 /* The count-of-view optimization */
#define SQLITE_CursorHints 0x0400 /* Add OP_CursorHint opcodes */
-#define SQLITE_Stat34 0x0800 /* Use STAT3 or STAT4 data */
- /* TH3 expects the Stat34 ^^^^^^ value to be 0x0800. Don't change it */
+#define SQLITE_Stat4 0x0800 /* Use STAT4 data */
+ /* TH3 expects the Stat4 ^^^^^^ value to be 0x0800. Don't change it */
#define SQLITE_PushDown 0x1000 /* The push-down optimization */
#define SQLITE_SimplifyJoin 0x2000 /* Convert LEFT JOIN to JOIN */
#define SQLITE_SkipScan 0x4000 /* Skip-scans */
@@ -16643,6 +16698,7 @@ struct FuncDestructor {
** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG
** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG
** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API
+** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API
** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API
*/
#define SQLITE_FUNC_ENCMASK 0x0003 /* SQLITE_UTF8, SQLITE_UTF16BE or UTF16LE */
@@ -16663,6 +16719,8 @@ struct FuncDestructor {
#define SQLITE_FUNC_OFFSET 0x8000 /* Built-in sqlite_offset() function */
#define SQLITE_FUNC_WINDOW 0x00010000 /* Built-in window-only function */
#define SQLITE_FUNC_INTERNAL 0x00040000 /* For use by NestedParse() only */
+#define SQLITE_FUNC_DIRECT 0x00080000 /* Not for use in TRIGGERs or VIEWs */
+#define SQLITE_FUNC_SUBTYPE 0x00100000 /* Result likely to have sub-type */
/*
** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are
@@ -16776,6 +16834,7 @@ struct Savepoint {
struct Module {
const sqlite3_module *pModule; /* Callback pointers */
const char *zName; /* Name passed to create_module() */
+ int nRefModule; /* Number of pointers to this object */
void *pAux; /* pAux passed to create_module() */
void (*xDestroy)(void *); /* Module destructor function */
Table *pEpoTab; /* Eponymous table for this module */
@@ -16841,11 +16900,12 @@ struct CollSeq {
** Note also that the numeric types are grouped together so that testing
** for a numeric type is a single comparison. And the BLOB type is first.
*/
-#define SQLITE_AFF_BLOB 'A'
-#define SQLITE_AFF_TEXT 'B'
-#define SQLITE_AFF_NUMERIC 'C'
-#define SQLITE_AFF_INTEGER 'D'
-#define SQLITE_AFF_REAL 'E'
+#define SQLITE_AFF_NONE 0x40 /* '@' */
+#define SQLITE_AFF_BLOB 0x41 /* 'A' */
+#define SQLITE_AFF_TEXT 0x42 /* 'B' */
+#define SQLITE_AFF_NUMERIC 0x43 /* 'C' */
+#define SQLITE_AFF_INTEGER 0x44 /* 'D' */
+#define SQLITE_AFF_REAL 0x45 /* 'E' */
#define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC)
@@ -17113,11 +17173,17 @@ struct KeyInfo {
u16 nKeyField; /* Number of key columns in the index */
u16 nAllField; /* Total columns, including key plus others */
sqlite3 *db; /* The database connection */
- u8 *aSortOrder; /* Sort order for each column. */
+ u8 *aSortFlags; /* Sort order for each column. */
CollSeq *aColl[1]; /* Collating sequence for each term of the key */
};
/*
+** Allowed bit values for entries in the KeyInfo.aSortFlags[] array.
+*/
+#define KEYINFO_ORDER_DESC 0x01 /* DESC sort order */
+#define KEYINFO_ORDER_BIGNULL 0x02 /* NULL is larger than any other value */
+
+/*
** This object holds a record which has been parsed out into individual
** fields, for the purposes of doing a comparison.
**
@@ -17224,7 +17290,7 @@ struct Index {
unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */
unsigned bNoQuery:1; /* Do not use this index to optimize queries */
unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
int nSample; /* Number of elements in aSample[] */
int nSampleCol; /* Size of IndexSample.anEq[] and so on */
tRowcnt *aAvgEq; /* Average nEq values for keys not in aSample */
@@ -17256,7 +17322,7 @@ struct Index {
#define XN_EXPR (-2) /* Indexed column is an expression */
/*
-** Each sample stored in the sqlite_stat3 table is represented in memory
+** Each sample stored in the sqlite_stat4 table is represented in memory
** using a structure of this type. See documentation at the top of the
** analyze.c source file for additional information.
*/
@@ -17414,7 +17480,7 @@ typedef int ynVar;
*/
struct Expr {
u8 op; /* Operation performed by this node */
- char affinity; /* The affinity of the column or 0 if not a column */
+ char affExpr; /* affinity, or RAISE type */
u32 flags; /* Various flags. EP_* See below */
union {
char *zToken; /* Token value. Zero terminated and dequoted */
@@ -17445,6 +17511,8 @@ struct Expr {
** TK_REGISTER: register number
** TK_TRIGGER: 1 -> new, 0 -> old
** EP_Unlikely: 134217728 times likelihood
+ ** TK_IN: ephemerial table holding RHS
+ ** TK_SELECT_COLUMN: Number of columns on the LHS
** TK_SELECT: 1st register of result vector */
ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid.
** TK_VARIABLE: variable number (always >= 1).
@@ -17458,7 +17526,7 @@ struct Expr {
union {
Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
** for a column of an index on an expression */
- Window *pWin; /* TK_FUNCTION: Window definition for the func */
+ Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */
struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
int iAddr; /* Subroutine entry address */
int regReturn; /* Register used to hold return address */
@@ -17473,36 +17541,37 @@ struct Expr {
** EP_Agg == NC_HasAgg == SF_HasAgg
** EP_Win == NC_HasWin
*/
-#define EP_FromJoin 0x000001 /* Originates in ON/USING clause of outer join */
-#define EP_Distinct 0x000002 /* Aggregate function with DISTINCT keyword */
-#define EP_HasFunc 0x000004 /* Contains one or more functions of any kind */
-#define EP_FixedCol 0x000008 /* TK_Column with a known fixed value */
-#define EP_Agg 0x000010 /* Contains one or more aggregate functions */
-#define EP_VarSelect 0x000020 /* pSelect is correlated, not constant */
-#define EP_DblQuoted 0x000040 /* token.z was originally in "..." */
-#define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */
-#define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */
-#define EP_Generic 0x000200 /* Ignore COLLATE or affinity on this tree */
-#define EP_IntValue 0x000400 /* Integer value contained in u.iValue */
-#define EP_xIsSelect 0x000800 /* x.pSelect is valid (otherwise x.pList is) */
-#define EP_Skip 0x001000 /* Operator does not contribute to affinity */
-#define EP_Reduced 0x002000 /* Expr struct EXPR_REDUCEDSIZE bytes only */
-#define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */
-#define EP_Win 0x008000 /* Contains window functions */
-#define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */
-#define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */
-#define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */
-#define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
-#define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
-#define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
-#define EP_Alias 0x400000 /* Is an alias for a result set column */
-#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
-#define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */
-#define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
-#define EP_Quoted 0x4000000 /* TK_ID was originally quoted */
-#define EP_Static 0x8000000 /* Held in memory not obtained from malloc() */
-#define EP_IsTrue 0x10000000 /* Always has boolean value of TRUE */
-#define EP_IsFalse 0x20000000 /* Always has boolean value of FALSE */
+#define EP_FromJoin 0x000001 /* Originates in ON/USING clause of outer join */
+#define EP_Distinct 0x000002 /* Aggregate function with DISTINCT keyword */
+#define EP_HasFunc 0x000004 /* Contains one or more functions of any kind */
+#define EP_FixedCol 0x000008 /* TK_Column with a known fixed value */
+#define EP_Agg 0x000010 /* Contains one or more aggregate functions */
+#define EP_VarSelect 0x000020 /* pSelect is correlated, not constant */
+#define EP_DblQuoted 0x000040 /* token.z was originally in "..." */
+#define EP_InfixFunc 0x000080 /* True for an infix function: LIKE, GLOB, etc */
+#define EP_Collate 0x000100 /* Tree contains a TK_COLLATE operator */
+ /* 0x000200 Available for reuse */
+#define EP_IntValue 0x000400 /* Integer value contained in u.iValue */
+#define EP_xIsSelect 0x000800 /* x.pSelect is valid (otherwise x.pList is) */
+#define EP_Skip 0x001000 /* Operator does not contribute to affinity */
+#define EP_Reduced 0x002000 /* Expr struct EXPR_REDUCEDSIZE bytes only */
+#define EP_TokenOnly 0x004000 /* Expr struct EXPR_TOKENONLYSIZE bytes only */
+#define EP_Win 0x008000 /* Contains window functions */
+#define EP_MemToken 0x010000 /* Need to sqlite3DbFree() Expr.zToken */
+#define EP_NoReduce 0x020000 /* Cannot EXPRDUP_REDUCE this Expr */
+#define EP_Unlikely 0x040000 /* unlikely() or likelihood() function */
+#define EP_ConstFunc 0x080000 /* A SQLITE_FUNC_CONSTANT or _SLOCHNG function */
+#define EP_CanBeNull 0x100000 /* Can be null despite NOT NULL constraint */
+#define EP_Subquery 0x200000 /* Tree contains a TK_SELECT operator */
+#define EP_Alias 0x400000 /* Is an alias for a result set column */
+#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
+#define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */
+#define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
+#define EP_Quoted 0x4000000 /* TK_ID was originally quoted */
+#define EP_Static 0x8000000 /* Held in memory not obtained from malloc() */
+#define EP_IsTrue 0x10000000 /* Always has boolean value of TRUE */
+#define EP_IsFalse 0x20000000 /* Always has boolean value of FALSE */
+#define EP_Indirect 0x40000000 /* Contained within a TRIGGER or a VIEW */
/*
** The EP_Propagate mask is a set of properties that automatically propagate
@@ -17547,6 +17616,18 @@ struct Expr {
#define EXPRDUP_REDUCE 0x0001 /* Used reduced-size Expr nodes */
/*
+** True if the expression passed as an argument was a function with
+** an OVER() clause (a window function).
+*/
+#ifdef SQLITE_OMIT_WINDOWFUNC
+# define IsWindowFunc(p) 0
+#else
+# define IsWindowFunc(p) ( \
+ ExprHasProperty((p), EP_WinFunc) && p->y.pWin->eFrmType!=TK_FILTER \
+ )
+#endif
+
+/*
** A list of expressions. Each expression may optionally have a
** name. An expr/name combination can be used in several ways, such
** as the list of "expr AS ID" fields following a "SELECT" or in the
@@ -17568,11 +17649,12 @@ struct ExprList {
Expr *pExpr; /* The parse tree for this expression */
char *zName; /* Token associated with this expression */
char *zSpan; /* Original text of the expression */
- u8 sortOrder; /* 1 for DESC or 0 for ASC */
+ u8 sortFlags; /* Mask of KEYINFO_ORDER_* flags */
unsigned done :1; /* A flag to indicate when processing is finished */
unsigned bSpanIsTab :1; /* zSpan holds DB.TABLE.COLUMN */
unsigned reusable :1; /* Constant expression is reusable */
unsigned bSorterRef :1; /* Defer evaluation until after sorting */
+ unsigned bNulls: 1; /* True if explicit "NULLS FIRST/LAST" */
union {
struct {
u16 iOrderByCol; /* For ORDER BY, column number in result set */
@@ -17863,6 +17945,7 @@ struct Select {
#define SF_Converted 0x10000 /* By convertCompoundSelectToSubquery() */
#define SF_IncludeHidden 0x20000 /* Include hidden columns in output */
#define SF_ComplexResult 0x40000 /* Result contains subquery or function */
+#define SF_WhereBegin 0x80000 /* Really a WhereBegin() call. Debug Only */
/*
** The results of a SELECT can be distributed in several ways, as defined
@@ -18367,11 +18450,12 @@ typedef struct {
*/
struct Sqlite3Config {
int bMemstat; /* True to enable memory status */
- int bCoreMutex; /* True to enable core mutexing */
- int bFullMutex; /* True to enable full mutexing */
- int bOpenUri; /* True to interpret filenames as URIs */
- int bUseCis; /* Use covering indices for full-scans */
- int bSmallMalloc; /* Avoid large memory allocations if true */
+ u8 bCoreMutex; /* True to enable core mutexing */
+ u8 bFullMutex; /* True to enable full mutexing */
+ u8 bOpenUri; /* True to interpret filenames as URIs */
+ u8 bUseCis; /* Use covering indices for full-scans */
+ u8 bSmallMalloc; /* Avoid large memory allocations if true */
+ u8 bExtraSchemaChecks; /* Verify type,name,tbl_name in schema */
int mxStrlen; /* Maximum string length */
int neverCorrupt; /* Database is always well-formed */
int szLookaside; /* Default lookaside buffer size */
@@ -18423,6 +18507,7 @@ struct Sqlite3Config {
int bInternalFunctions; /* Internal SQL functions are visible */
int iOnceResetThreshold; /* When to reset OP_Once counters */
u32 szSorterRef; /* Min size in bytes to use sorter-refs */
+ unsigned int iPrngSeed; /* Alternative fixed seed for the PRNG */
};
/*
@@ -18519,10 +18604,11 @@ struct TreeView {
#endif /* SQLITE_DEBUG */
/*
-** This object is used in various ways, all related to window functions
+** This object is used in various ways, most (but not all) related to window
+** functions.
**
** (1) A single instance of this structure is attached to the
-** the Expr.pWin field for each window function in an expression tree.
+** the Expr.y.pWin field for each window function in an expression tree.
** This object holds the information contained in the OVER clause,
** plus additional fields used during code generation.
**
@@ -18533,6 +18619,10 @@ struct TreeView {
** (3) The terms of the WINDOW clause of a SELECT are instances of this
** object on a linked list attached to Select.pWinDefn.
**
+** (4) For an aggregate function with a FILTER clause, an instance
+** of this object is stored in Expr.y.pWin with eFrmType set to
+** TK_FILTER. In this case the only field used is Window.pFilter.
+**
** The uses (1) and (2) are really the same Window object that just happens
** to be accessible in two different ways. Use case (3) are separate objects.
*/
@@ -18548,12 +18638,13 @@ struct Window {
u8 eExclude; /* TK_NO, TK_CURRENT, TK_TIES, TK_GROUP, or 0 */
Expr *pStart; /* Expression for "<expr> PRECEDING" */
Expr *pEnd; /* Expression for "<expr> FOLLOWING" */
+ Window **ppThis; /* Pointer to this object in Select.pWin list */
Window *pNextWin; /* Next window function belonging to this SELECT */
Expr *pFilter; /* The FILTER expression */
FuncDef *pFunc; /* The function */
int iEphCsr; /* Partition buffer or Peer buffer */
- int regAccum;
- int regResult;
+ int regAccum; /* Accumulator */
+ int regResult; /* Interim result */
int csrApp; /* Function cursor (used by min/max) */
int regApp; /* Function register (also used by min/max) */
int regPart; /* Array of registers for PARTITION BY values */
@@ -18563,14 +18654,18 @@ struct Window {
int regOne; /* Register containing constant value 1 */
int regStartRowid;
int regEndRowid;
+ u8 bExprArgs; /* Defer evaluation of window function arguments
+ ** due to the SQLITE_SUBTYPE flag */
};
#ifndef SQLITE_OMIT_WINDOWFUNC
SQLITE_PRIVATE void sqlite3WindowDelete(sqlite3*, Window*);
+SQLITE_PRIVATE void sqlite3WindowUnlinkFromSelect(Window*);
SQLITE_PRIVATE void sqlite3WindowListDelete(sqlite3 *db, Window *p);
SQLITE_PRIVATE Window *sqlite3WindowAlloc(Parse*, int, int, Expr*, int , Expr*, u8);
SQLITE_PRIVATE void sqlite3WindowAttach(Parse*, Expr*, Window*);
-SQLITE_PRIVATE int sqlite3WindowCompare(Parse*, Window*, Window*);
+SQLITE_PRIVATE void sqlite3WindowLink(Select *pSel, Window *pWin);
+SQLITE_PRIVATE int sqlite3WindowCompare(Parse*, Window*, Window*, int);
SQLITE_PRIVATE void sqlite3WindowCodeInit(Parse*, Window*);
SQLITE_PRIVATE void sqlite3WindowCodeStep(Parse*, Select*, WhereInfo*, int, int);
SQLITE_PRIVATE int sqlite3WindowRewrite(Parse*, Select*);
@@ -18842,7 +18937,7 @@ SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3*, Expr*);
SQLITE_PRIVATE void sqlite3ExprUnmapAndDelete(Parse*, Expr*);
SQLITE_PRIVATE ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
-SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int);
+SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList*,int,int);
SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3*, ExprList*);
@@ -18861,8 +18956,8 @@ SQLITE_PRIVATE void sqlite3CollapseDatabaseArray(sqlite3*);
SQLITE_PRIVATE void sqlite3CommitInternalChanges(sqlite3*);
SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3*,Table*);
SQLITE_PRIVATE int sqlite3ColumnsFromExprList(Parse*,ExprList*,i16*,Column**);
-SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(Parse*,Table*,Select*);
-SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,Select*);
+SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(Parse*,Table*,Select*,char);
+SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
SQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *, int);
SQLITE_PRIVATE Index *sqlite3PrimaryKeyIndex(Table*);
SQLITE_PRIVATE i16 sqlite3ColumnOfIndex(Index*, i16);
@@ -19163,7 +19258,7 @@ SQLITE_PRIVATE LogEst sqlite3LogEstAdd(LogEst,LogEst);
SQLITE_PRIVATE LogEst sqlite3LogEstFromDouble(double);
#endif
#if defined(SQLITE_ENABLE_STMT_SCANSTATUS) || \
- defined(SQLITE_ENABLE_STAT3_OR_STAT4) || \
+ defined(SQLITE_ENABLE_STAT4) || \
defined(SQLITE_EXPLAIN_ESTIMATED_ROWS)
SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst);
#endif
@@ -19229,9 +19324,10 @@ SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse*,Expr*,Expr*);
SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(Parse *pParse, Expr*, const Token*, int);
SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(Parse*,Expr*,const char*);
SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr*);
+SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr*);
SQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *, CollSeq *);
SQLITE_PRIVATE int sqlite3WritableSchema(sqlite3*);
-SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *, const char *);
+SQLITE_PRIVATE int sqlite3CheckObjectName(Parse*, const char*,const char*,const char*);
SQLITE_PRIVATE void sqlite3VdbeSetChanges(sqlite3 *, int);
SQLITE_PRIVATE int sqlite3AddInt64(i64*,i64);
SQLITE_PRIVATE int sqlite3SubInt64(i64*,i64);
@@ -19264,7 +19360,6 @@ SQLITE_PRIVATE const unsigned char sqlite3OpcodeProperty[];
SQLITE_PRIVATE const char sqlite3StrBINARY[];
SQLITE_PRIVATE const unsigned char sqlite3UpperToLower[];
SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[];
-SQLITE_PRIVATE const Token sqlite3IntTokens[];
SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config;
SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
#ifndef SQLITE_OMIT_WSD
@@ -19318,6 +19413,7 @@ SQLITE_PRIVATE void sqlite3KeyInfoUnref(KeyInfo*);
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoRef(KeyInfo*);
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoOfIndex(Parse*, Index*);
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoFromExprList(Parse*, ExprList*, int, int);
+SQLITE_PRIVATE int sqlite3HasExplicitNulls(Parse*, ExprList*);
#ifdef SQLITE_DEBUG
SQLITE_PRIVATE int sqlite3KeyInfoIsWriteable(KeyInfo*);
@@ -19350,8 +19446,7 @@ SQLITE_PRIVATE int sqlite3ExprCheckIN(Parse*, Expr*);
# define sqlite3ExprCheckIN(x,y) SQLITE_OK
#endif
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
-SQLITE_PRIVATE void sqlite3AnalyzeFunctions(void);
+#ifdef SQLITE_ENABLE_STAT4
SQLITE_PRIVATE int sqlite3Stat4ProbeSetValue(
Parse*,Index*,UnpackedRecord**,Expr*,int,int,int*);
SQLITE_PRIVATE int sqlite3Stat4ValueFromExpr(Parse*, Expr*, u8, sqlite3_value**);
@@ -19398,6 +19493,7 @@ SQLITE_PRIVATE int sqlite3Utf8To8(unsigned char*);
# define sqlite3VtabInSync(db) 0
# define sqlite3VtabLock(X)
# define sqlite3VtabUnlock(X)
+# define sqlite3VtabModuleUnref(D,X)
# define sqlite3VtabUnlockList(X)
# define sqlite3VtabSavepoint(X, Y, Z) SQLITE_OK
# define sqlite3GetVTable(X,Y) ((VTable*)0)
@@ -19409,6 +19505,7 @@ SQLITE_PRIVATE int sqlite3VtabRollback(sqlite3 *db);
SQLITE_PRIVATE int sqlite3VtabCommit(sqlite3 *db);
SQLITE_PRIVATE void sqlite3VtabLock(VTable *);
SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *);
+SQLITE_PRIVATE void sqlite3VtabModuleUnref(sqlite3*,Module*);
SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3*);
SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int);
SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe*, sqlite3_vtab*);
@@ -19876,6 +19973,7 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = {
SQLITE_USE_URI, /* bOpenUri */
SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */
0, /* bSmallMalloc */
+ 1, /* bExtraSchemaChecks */
0x7ffffffe, /* mxStrlen */
0, /* neverCorrupt */
SQLITE_DEFAULT_LOOKASIDE, /* szLookaside, nLookaside */
@@ -19922,6 +20020,7 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = {
0, /* bInternalFunctions */
0x7ffffffe, /* iOnceResetThreshold */
SQLITE_DEFAULT_SORTERREF_SIZE, /* szSorterRef */
+ 0, /* iPrngSeed */
};
/*
@@ -19931,14 +20030,6 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = {
*/
SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions;
-/*
-** Constant tokens for values 0 and 1.
-*/
-SQLITE_PRIVATE const Token sqlite3IntTokens[] = {
- { "0", 1 },
- { "1", 1 }
-};
-
#ifdef VDBE_PROFILE
/*
** The following performance counter can be used in place of
@@ -20491,7 +20582,6 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor**, int*);
SQLITE_PRIVATE int sqlite3VdbeCursorRestore(VdbeCursor*);
SQLITE_PRIVATE u32 sqlite3VdbeSerialTypeLen(u32);
SQLITE_PRIVATE u8 sqlite3VdbeOneByteSerialTypeLen(u8);
-SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem*, int, u32*);
SQLITE_PRIVATE u32 sqlite3VdbeSerialPut(unsigned char*, Mem*, u32);
SQLITE_PRIVATE u32 sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(sqlite3*, AuxData**, int, int);
@@ -22497,7 +22587,15 @@ SQLITE_PRIVATE void sqlite3OsDlClose(sqlite3_vfs *pVfs, void *pHandle){
}
#endif /* SQLITE_OMIT_LOAD_EXTENSION */
SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){
- return pVfs->xRandomness(pVfs, nByte, zBufOut);
+ if( sqlite3Config.iPrngSeed ){
+ memset(zBufOut, 0, nByte);
+ if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int);
+ memcpy(zBufOut, &sqlite3Config.iPrngSeed, nByte);
+ return SQLITE_OK;
+ }else{
+ return pVfs->xRandomness(pVfs, nByte, zBufOut);
+ }
+
}
SQLITE_PRIVATE int sqlite3OsSleep(sqlite3_vfs *pVfs, int nMicro){
return pVfs->xSleep(pVfs, nMicro);
@@ -28778,13 +28876,17 @@ SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView *pView, const Select *p, u8 m
sqlite3TreeViewPush(pView, 1);
}
do{
- sqlite3TreeViewLine(pView,
- "SELECT%s%s (%u/%p) selFlags=0x%x nSelectRow=%d",
- ((p->selFlags & SF_Distinct) ? " DISTINCT" : ""),
- ((p->selFlags & SF_Aggregate) ? " agg_flag" : ""),
- p->selId, p, p->selFlags,
- (int)p->nSelectRow
- );
+ if( p->selFlags & SF_WhereBegin ){
+ sqlite3TreeViewLine(pView, "sqlite3WhereBegin()");
+ }else{
+ sqlite3TreeViewLine(pView,
+ "SELECT%s%s (%u/%p) selFlags=0x%x nSelectRow=%d",
+ ((p->selFlags & SF_Distinct) ? " DISTINCT" : ""),
+ ((p->selFlags & SF_Aggregate) ? " agg_flag" : ""),
+ p->selId, p, p->selFlags,
+ (int)p->nSelectRow
+ );
+ }
if( cnt++ ) sqlite3TreeViewPop(pView);
if( p->pPrior ){
n = 1000;
@@ -28801,7 +28903,10 @@ SQLITE_PRIVATE void sqlite3TreeViewSelect(TreeView *pView, const Select *p, u8 m
if( p->pWinDefn ) n++;
#endif
}
- sqlite3TreeViewExprList(pView, p->pEList, (n--)>0, "result-set");
+ if( p->pEList ){
+ sqlite3TreeViewExprList(pView, p->pEList, n>0, "result-set");
+ }
+ n--;
#ifndef SQLITE_OMIT_WINDOWFUNC
if( p->pWin ){
Window *pX;
@@ -28997,12 +29102,14 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m
sqlite3TreeViewPop(pView);
return;
}
- if( pExpr->flags ){
+ if( pExpr->flags || pExpr->affExpr ){
if( ExprHasProperty(pExpr, EP_FromJoin) ){
- sqlite3_snprintf(sizeof(zFlgs),zFlgs," flags=0x%x iRJT=%d",
- pExpr->flags, pExpr->iRightJoinTable);
+ sqlite3_snprintf(sizeof(zFlgs),zFlgs," fg.af=%x.%c iRJT=%d",
+ pExpr->flags, pExpr->affExpr ? pExpr->affExpr : 'n',
+ pExpr->iRightJoinTable);
}else{
- sqlite3_snprintf(sizeof(zFlgs),zFlgs," flags=0x%x",pExpr->flags);
+ sqlite3_snprintf(sizeof(zFlgs),zFlgs," fg.af=%x.%c",
+ pExpr->flags, pExpr->affExpr ? pExpr->affExpr : 'n');
}
}else{
zFlgs[0] = 0;
@@ -29129,7 +29236,14 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m
}
case TK_COLLATE: {
- sqlite3TreeViewLine(pView, "COLLATE %Q", pExpr->u.zToken);
+ /* COLLATE operators without the EP_Collate flag are intended to
+ ** emulate collation associated with a table column. These show
+ ** up in the treeview output as "SOFT-COLLATE". Explicit COLLATE
+ ** operators that appear in the original SQL always have the
+ ** EP_Collate bit set and appear in treeview output as just "COLLATE" */
+ sqlite3TreeViewLine(pView, "%sCOLLATE %Q%s",
+ !ExprHasProperty(pExpr, EP_Collate) ? "SOFT-" : "",
+ pExpr->u.zToken, zFlgs);
sqlite3TreeViewExpr(pView, pExpr->pLeft, 0);
break;
}
@@ -29150,10 +29264,10 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m
#endif
}
if( pExpr->op==TK_AGG_FUNCTION ){
- sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q",
- pExpr->op2, pExpr->u.zToken);
+ sqlite3TreeViewLine(pView, "AGG_FUNCTION%d %Q%s",
+ pExpr->op2, pExpr->u.zToken, zFlgs);
}else{
- sqlite3TreeViewLine(pView, "FUNCTION %Q", pExpr->u.zToken);
+ sqlite3TreeViewLine(pView, "FUNCTION %Q%s", pExpr->u.zToken, zFlgs);
}
if( pFarg ){
sqlite3TreeViewExprList(pView, pFarg, pWin!=0, 0);
@@ -29230,7 +29344,7 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m
#ifndef SQLITE_OMIT_TRIGGER
case TK_RAISE: {
const char *zType = "unk";
- switch( pExpr->affinity ){
+ switch( pExpr->affExpr ){
case OE_Rollback: zType = "rollback"; break;
case OE_Abort: zType = "abort"; break;
case OE_Fail: zType = "fail"; break;
@@ -29271,7 +29385,7 @@ SQLITE_PRIVATE void sqlite3TreeViewExpr(TreeView *pView, const Expr *pExpr, u8 m
sqlite3TreeViewExpr(pView, pExpr->pRight, 0);
}else if( zUniOp ){
sqlite3TreeViewLine(pView, "%s%s", zUniOp, zFlgs);
- sqlite3TreeViewExpr(pView, pExpr->pLeft, 0);
+ sqlite3TreeViewExpr(pView, pExpr->pLeft, 0);
}
sqlite3TreeViewPop(pView);
}
@@ -31779,7 +31893,7 @@ SQLITE_PRIVATE LogEst sqlite3LogEstFromDouble(double x){
#endif /* SQLITE_OMIT_VIRTUALTABLE */
#if defined(SQLITE_ENABLE_STMT_SCANSTATUS) || \
- defined(SQLITE_ENABLE_STAT3_OR_STAT4) || \
+ defined(SQLITE_ENABLE_STAT4) || \
defined(SQLITE_EXPLAIN_ESTIMATED_ROWS)
/*
** Convert a LogEst into an integer.
@@ -31797,7 +31911,7 @@ SQLITE_PRIVATE u64 sqlite3LogEstToInt(LogEst x){
defined(SQLITE_EXPLAIN_ESTIMATED_ROWS)
if( x>60 ) return (u64)LARGEST_INT64;
#else
- /* If only SQLITE_ENABLE_STAT3_OR_STAT4 is on, then the largest input
+ /* If only SQLITE_ENABLE_STAT4 is on, then the largest input
** possible to this routine is 310, resulting in a maximum x of 31 */
assert( x<=60 );
#endif
@@ -32290,24 +32404,24 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
/* 93 */ "Count" OpHelp("r[P2]=count()"),
/* 94 */ "ReadCookie" OpHelp(""),
/* 95 */ "SetCookie" OpHelp(""),
- /* 96 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
- /* 97 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
- /* 98 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
- /* 99 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
- /* 100 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
- /* 101 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
- /* 102 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
- /* 103 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
- /* 104 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
- /* 105 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
- /* 106 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"),
- /* 107 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
- /* 108 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
- /* 109 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
- /* 110 */ "String8" OpHelp("r[P2]='P4'"),
- /* 111 */ "OpenDup" OpHelp(""),
- /* 112 */ "OpenAutoindex" OpHelp("nColumn=P2"),
- /* 113 */ "OpenEphemeral" OpHelp("nColumn=P2"),
+ /* 96 */ "ReopenIdx" OpHelp("root=P2 iDb=P3"),
+ /* 97 */ "OpenRead" OpHelp("root=P2 iDb=P3"),
+ /* 98 */ "OpenWrite" OpHelp("root=P2 iDb=P3"),
+ /* 99 */ "BitAnd" OpHelp("r[P3]=r[P1]&r[P2]"),
+ /* 100 */ "BitOr" OpHelp("r[P3]=r[P1]|r[P2]"),
+ /* 101 */ "ShiftLeft" OpHelp("r[P3]=r[P2]<<r[P1]"),
+ /* 102 */ "ShiftRight" OpHelp("r[P3]=r[P2]>>r[P1]"),
+ /* 103 */ "Add" OpHelp("r[P3]=r[P1]+r[P2]"),
+ /* 104 */ "Subtract" OpHelp("r[P3]=r[P2]-r[P1]"),
+ /* 105 */ "Multiply" OpHelp("r[P3]=r[P1]*r[P2]"),
+ /* 106 */ "Divide" OpHelp("r[P3]=r[P2]/r[P1]"),
+ /* 107 */ "Remainder" OpHelp("r[P3]=r[P2]%r[P1]"),
+ /* 108 */ "Concat" OpHelp("r[P3]=r[P2]+r[P1]"),
+ /* 109 */ "OpenDup" OpHelp(""),
+ /* 110 */ "BitNot" OpHelp("r[P2]= ~r[P1]"),
+ /* 111 */ "OpenAutoindex" OpHelp("nColumn=P2"),
+ /* 112 */ "OpenEphemeral" OpHelp("nColumn=P2"),
+ /* 113 */ "String8" OpHelp("r[P2]='P4'"),
/* 114 */ "SorterOpen" OpHelp(""),
/* 115 */ "SequenceTest" OpHelp("if( cursor[P1].ctr++ ) pc = P2"),
/* 116 */ "OpenPseudo" OpHelp("P3 columns in r[P2]"),
@@ -32339,10 +32453,10 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
/* 142 */ "LoadAnalysis" OpHelp(""),
/* 143 */ "DropTable" OpHelp(""),
/* 144 */ "DropIndex" OpHelp(""),
- /* 145 */ "Real" OpHelp("r[P2]=P4"),
- /* 146 */ "DropTrigger" OpHelp(""),
- /* 147 */ "IntegrityCk" OpHelp(""),
- /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
+ /* 145 */ "DropTrigger" OpHelp(""),
+ /* 146 */ "IntegrityCk" OpHelp(""),
+ /* 147 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
+ /* 148 */ "Real" OpHelp("r[P2]=P4"),
/* 149 */ "Param" OpHelp(""),
/* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
/* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
@@ -32481,13 +32595,29 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
# include <sys/param.h>
#endif /* SQLITE_ENABLE_LOCKING_STYLE */
-#if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \
- (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000))
-# if (!defined(TARGET_OS_EMBEDDED) || (TARGET_OS_EMBEDDED==0)) \
- && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0))
-# define HAVE_GETHOSTUUID 1
-# else
-# warning "gethostuuid() is disabled."
+/*
+** Try to determine if gethostuuid() is available based on standard
+** macros. This might sometimes compute the wrong value for some
+** obscure platforms. For those cases, simply compile with one of
+** the following:
+**
+** -DHAVE_GETHOSTUUID=0
+** -DHAVE_GETHOSTUUID=1
+**
+** None if this matters except when building on Apple products with
+** -DSQLITE_ENABLE_LOCKING_STYLE.
+*/
+#ifndef HAVE_GETHOSTUUID
+# define HAVE_GETHOSTUUID 0
+# if defined(__APPLE__) && ((__MAC_OS_X_VERSION_MIN_REQUIRED > 1050) || \
+ (__IPHONE_OS_VERSION_MIN_REQUIRED > 2000))
+# if (!defined(TARGET_OS_EMBEDDED) || (TARGET_OS_EMBEDDED==0)) \
+ && (!defined(TARGET_IPHONE_SIMULATOR) || (TARGET_IPHONE_SIMULATOR==0))
+# undef HAVE_GETHOSTUUID
+# define HAVE_GETHOSTUUID 1
+# else
+# warning "gethostuuid() is disabled."
+# endif
# endif
#endif
@@ -33095,13 +33225,14 @@ static struct unix_syscall {
#if defined(__linux__) && defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
# ifdef __ANDROID__
{ "ioctl", (sqlite3_syscall_ptr)(int(*)(int, int, ...))ioctl, 0 },
+#define osIoctl ((int(*)(int,int,...))aSyscall[28].pCurrent)
# else
{ "ioctl", (sqlite3_syscall_ptr)ioctl, 0 },
+#define osIoctl ((int(*)(int,unsigned long,...))aSyscall[28].pCurrent)
# endif
#else
{ "ioctl", (sqlite3_syscall_ptr)0, 0 },
#endif
-#define osIoctl ((int(*)(int,int,...))aSyscall[28].pCurrent)
}; /* End of the overrideable system calls */
@@ -38343,6 +38474,7 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
UnixUnusedFd **pp;
assert( sqlite3_mutex_notheld(pInode->pLockMutex) );
sqlite3_mutex_enter(pInode->pLockMutex);
+ flags &= (SQLITE_OPEN_READONLY|SQLITE_OPEN_READWRITE);
for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext));
pUnused = *pp;
if( pUnused ){
@@ -38396,7 +38528,7 @@ static int getFileMode(
** If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the
** original filename is unavailable. But 8_3_NAMES is only used for
** FAT filesystems and permissions do not matter there, so just use
-** the default permissions.
+** the default permissions. In 8_3_NAMES mode, leave *pMode set to zero.
*/
static int findCreateFileMode(
const char *zPath, /* Path of file (possibly) being created */
@@ -38631,11 +38763,19 @@ static int unixOpen(
goto open_finished;
}
- /* If this process is running as root and if creating a new rollback
- ** journal or WAL file, set the ownership of the journal or WAL to be
- ** the same as the original database.
+ /* The owner of the rollback journal or WAL file should always be the
+ ** same as the owner of the database file. Try to ensure that this is
+ ** the case. The chown() system call will be a no-op if the current
+ ** process lacks root privileges, be we should at least try. Without
+ ** this step, if a root process opens a database file, it can leave
+ ** behinds a journal/WAL that is owned by root and hence make the
+ ** database inaccessible to unprivileged processes.
+ **
+ ** If openMode==0, then that means uid and gid are not set correctly
+ ** (probably because SQLite is configured to use 8+3 filename mode) and
+ ** in that case we do not want to attempt the chown().
*/
- if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){
+ if( openMode && (flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL))!=0 ){
robustFchown(fd, uid, gid);
}
}
@@ -38646,7 +38786,8 @@ static int unixOpen(
if( p->pPreallocatedUnused ){
p->pPreallocatedUnused->fd = fd;
- p->pPreallocatedUnused->flags = flags;
+ p->pPreallocatedUnused->flags =
+ flags & (SQLITE_OPEN_READONLY|SQLITE_OPEN_READWRITE);
}
if( isDelete ){
@@ -39492,7 +39633,7 @@ SQLITE_API int sqlite3_hostid_num = 0;
#define PROXY_HOSTIDLEN 16 /* conch file host id length */
-#ifdef HAVE_GETHOSTUUID
+#if HAVE_GETHOSTUUID
/* Not always defined in the headers as it ought to be */
extern int gethostuuid(uuid_t id, const struct timespec *wait);
#endif
@@ -39503,7 +39644,7 @@ extern int gethostuuid(uuid_t id, const struct timespec *wait);
static int proxyGetHostID(unsigned char *pHostID, int *pError){
assert(PROXY_HOSTIDLEN == sizeof(uuid_t));
memset(pHostID, 0, PROXY_HOSTIDLEN);
-#ifdef HAVE_GETHOSTUUID
+#if HAVE_GETHOSTUUID
{
struct timespec timeout = {1, 0}; /* 1 sec timeout */
if( gethostuuid(pHostID, &timeout) ){
@@ -40177,7 +40318,7 @@ static int proxyFileControl(sqlite3_file *id, int op, void *pArg){
assert( 0 ); /* The call assures that only valid opcodes are sent */
}
}
- /*NOTREACHED*/
+ /*NOTREACHED*/ assert(0);
return SQLITE_ERROR;
}
@@ -44862,6 +45003,7 @@ static int winShmMap(
rc = winOpenSharedMemory(pDbFd);
if( rc!=SQLITE_OK ) return rc;
pShm = pDbFd->pShm;
+ assert( pShm!=0 );
}
pShmNode = pShm->pShmNode;
@@ -45164,6 +45306,7 @@ static int winFetch(sqlite3_file *fd, i64 iOff, int nAmt, void **pp){
}
}
if( pFd->mmapSize >= iOff+nAmt ){
+ assert( pFd->pMapRegion!=0 );
*pp = &((u8 *)pFd->pMapRegion)[iOff];
pFd->nFetchOut++;
}
@@ -48085,6 +48228,7 @@ SQLITE_PRIVATE int sqlite3PcacheInitialize(void){
** built-in default page cache is used instead of the application defined
** page cache. */
sqlite3PCacheSetDefault();
+ assert( sqlite3GlobalConfig.pcache2.xInit!=0 );
}
return sqlite3GlobalConfig.pcache2.xInit(sqlite3GlobalConfig.pcache2.pArg);
}
@@ -49131,6 +49275,7 @@ static PgHdr1 *pcache1AllocPage(PCache1 *pCache, int benignMalloc){
assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){
+ assert( pCache->pFree!=0 );
p = pCache->pFree;
pCache->pFree = p->pNext;
p->pNext = 0;
@@ -61857,6 +62002,7 @@ SQLITE_PRIVATE int sqlite3WalFrames(
if( rc ) return rc;
iOffset += szFrame;
nExtra++;
+ assert( pLast!=0 );
}
}
if( bSync ){
@@ -61889,6 +62035,7 @@ SQLITE_PRIVATE int sqlite3WalFrames(
iFrame++;
rc = walIndexAppend(pWal, iFrame, p->pgno);
}
+ assert( pLast!=0 || nExtra==0 );
while( rc==SQLITE_OK && nExtra>0 ){
iFrame++;
nExtra--;
@@ -64900,9 +65047,12 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
u8 *pSpace = pageFindSlot(pPage, nByte, &rc);
if( pSpace ){
- assert( pSpace>=data && (pSpace - data)<65536 );
- *pIdx = (int)(pSpace - data);
- return SQLITE_OK;
+ assert( pSpace+nByte<=data+pPage->pBt->usableSize );
+ if( (*pIdx = (int)(pSpace-data))<=gap ){
+ return SQLITE_CORRUPT_PAGE(pPage);
+ }else{
+ return SQLITE_OK;
+ }
}else if( rc ){
return rc;
}
@@ -68129,6 +68279,7 @@ static int accessPayload(
assert( aWrite>=pBufStart ); /* due to (6) */
memcpy(aSave, aWrite, 4);
rc = sqlite3OsRead(fd, aWrite, a+4, (i64)pBt->pageSize*(nextPage-1));
+ if( rc && nextPage>pBt->nPage ) rc = SQLITE_CORRUPT_BKPT;
nextPage = get4byte(aWrite);
memcpy(aWrite, aSave, 4);
}else
@@ -69917,12 +70068,7 @@ static void insertCell(
assert( pPage->nOverflow<=ArraySize(pPage->apOvfl) );
assert( ArraySize(pPage->apOvfl)==ArraySize(pPage->aiOvfl) );
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
- /* The cell should normally be sized correctly. However, when moving a
- ** malformed cell from a leaf page to an interior page, if the cell size
- ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size
- ** might be less than 8 (leaf-size + pointer) on the interior node. Hence
- ** the term after the || in the following assert(). */
- assert( sz==pPage->xCellSize(pPage, pCell) || (sz==8 && iChild>0) );
+ assert( sz==pPage->xCellSize(pPage, pCell) || CORRUPT_DB );
assert( pPage->nFree>=0 );
if( pPage->nOverflow || sz+2>pPage->nFree ){
if( pTemp ){
@@ -70154,7 +70300,7 @@ static int rebuildPage(
assert( i<iEnd );
j = get2byte(&aData[hdr+5]);
- if( NEVER(j>(u32)usableSize) ){ j = 0; }
+ if( j>(u32)usableSize ){ j = 0; }
memcpy(&pTmp[j], &aData[j], usableSize - j);
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
@@ -70246,7 +70392,8 @@ static int pageInsertArray(
while( 1 /*Exit by break*/ ){
int sz, rc;
u8 *pSlot;
- sz = cachedCellSize(pCArray, i);
+ assert( pCArray->szCell[i]!=0 );
+ sz = pCArray->szCell[i];
if( (aData[1]==0 && aData[2]==0) || (pSlot = pageFindSlot(pPg,sz,&rc))==0 ){
if( (pData - pBegin)<sz ) return 1;
pData -= sz;
@@ -70407,6 +70554,7 @@ static int editPage(
memmove(&pCellptr[2], pCellptr, (nCell - iCell) * 2);
}
nCell++;
+ cachedCellSize(pCArray, iCell+iNew);
if( pageInsertArray(
pPg, pBegin, &pData, pCellptr,
iCell+iNew, 1, pCArray
@@ -70929,7 +71077,7 @@ static int balance_nonroot(
*/
memset(&b.szCell[b.nCell], 0, sizeof(b.szCell[0])*(limit+pOld->nOverflow));
if( pOld->nOverflow>0 ){
- if( limit<pOld->aiOvfl[0] ){
+ if( NEVER(limit<pOld->aiOvfl[0]) ){
rc = SQLITE_CORRUPT_BKPT;
goto balance_cleanup;
}
@@ -71215,6 +71363,8 @@ static int balance_nonroot(
));
assert( sqlite3PagerIswriteable(pParent->pDbPage) );
+ assert( nNew>=1 && nNew<=ArraySize(apNew) );
+ assert( apNew[nNew-1]!=0 );
put4byte(pRight, apNew[nNew-1]->pgno);
/* If the sibling pages are not leaves, ensure that the right-child pointer
@@ -71560,11 +71710,13 @@ static int balance(BtCursor *pCur){
VVA_ONLY( int balance_deeper_called = 0 );
do {
- int iPage = pCur->iPage;
+ int iPage;
MemPage *pPage = pCur->pPage;
if( NEVER(pPage->nFree<0) && btreeComputeFreeSpace(pPage) ) break;
- if( iPage==0 ){
+ if( pPage->nOverflow==0 && pPage->nFree<=nMin ){
+ break;
+ }else if( (iPage = pCur->iPage)==0 ){
if( pPage->nOverflow ){
/* The root page of the b-tree is overfull. In this case call the
** balance_deeper() function to create a new child for the root-page
@@ -71585,8 +71737,6 @@ static int balance(BtCursor *pCur){
}else{
break;
}
- }else if( pPage->nOverflow==0 && pPage->nFree<=nMin ){
- break;
}else{
MemPage * const pParent = pCur->apPage[iPage-1];
int const iIdx = pCur->aiIdx[iPage-1];
@@ -71728,7 +71878,9 @@ static int btreeOverwriteCell(BtCursor *pCur, const BtreePayload *pX){
Pgno ovflPgno; /* Next overflow page to write */
u32 ovflPageSize; /* Size to write on overflow page */
- if( pCur->info.pPayload + pCur->info.nLocal > pPage->aDataEnd ){
+ if( pCur->info.pPayload + pCur->info.nLocal > pPage->aDataEnd
+ || pCur->info.pPayload < pPage->aData + pPage->cellOffset
+ ){
return SQLITE_CORRUPT_BKPT;
}
/* Overwrite the local portion first */
@@ -71969,6 +72121,8 @@ SQLITE_PRIVATE int sqlite3BtreeInsert(
memcpy(newCell, oldCell, 4);
}
rc = clearCell(pPage, oldCell, &info);
+ testcase( pCur->curFlags & BTCF_ValidOvfl );
+ invalidateOverflowCache(pCur);
if( info.nSize==szNew && info.nLocal==info.nPayload
&& (!ISAUTOVACUUM || szNew<pPage->minLocal)
){
@@ -71982,7 +72136,12 @@ SQLITE_PRIVATE int sqlite3BtreeInsert(
** new entry uses overflow pages, as the insertCell() call below is
** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */
assert( rc==SQLITE_OK ); /* clearCell never fails when nLocal==nPayload */
- if( oldCell+szNew > pPage->aDataEnd ) return SQLITE_CORRUPT_BKPT;
+ if( oldCell < pPage->aData+pPage->hdrOffset+10 ){
+ return SQLITE_CORRUPT_BKPT;
+ }
+ if( oldCell+szNew > pPage->aDataEnd ){
+ return SQLITE_CORRUPT_BKPT;
+ }
memcpy(oldCell, newCell, szNew);
return SQLITE_OK;
}
@@ -74319,8 +74478,10 @@ SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
}
if( p->isAttached ){
pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
+ assert( pp!=0 );
while( *pp!=p ){
pp = &(*pp)->pNext;
+ assert( pp!=0 );
}
*pp = p->pNext;
}
@@ -74735,7 +74896,13 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPre
assert( pMem->szMalloc==0
|| pMem->szMalloc==sqlite3DbMallocSize(pMem->db, pMem->zMalloc) );
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){
- pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
+ if( pMem->db ){
+ pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
+ }else{
+ pMem->zMalloc = sqlite3Realloc(pMem->z, n);
+ if( pMem->zMalloc==0 ) sqlite3_free(pMem->z);
+ pMem->z = pMem->zMalloc;
+ }
bPreserve = 0;
}else{
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc);
@@ -75806,7 +75973,7 @@ struct ValueNewStat4Ctx {
** an sqlite3_value within the UnpackedRecord.a[] array.
*/
static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( p ){
UnpackedRecord *pRec = p->ppRec[0];
@@ -75842,7 +76009,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){
}
#else
UNUSED_PARAMETER(p);
-#endif /* defined(SQLITE_ENABLE_STAT3_OR_STAT4) */
+#endif /* defined(SQLITE_ENABLE_STAT4) */
return sqlite3ValueNew(db);
}
@@ -75866,7 +76033,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){
** and sets (*ppVal) to NULL. Or, if an error occurs, (*ppVal) is set to
** NULL and an SQLite error code returned.
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
static int valueFromFunction(
sqlite3 *db, /* The database connection */
Expr *p, /* The expression to evaluate */
@@ -75949,7 +76116,7 @@ static int valueFromFunction(
}
#else
# define valueFromFunction(a,b,c,d,e,f) SQLITE_OK
-#endif /* defined(SQLITE_ENABLE_STAT3_OR_STAT4) */
+#endif /* defined(SQLITE_ENABLE_STAT4) */
/*
** Extract a value from the supplied expression in the manner described
@@ -75978,7 +76145,7 @@ static int valueFromExpr(
assert( pExpr!=0 );
while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft;
-#if defined(SQLITE_ENABLE_STAT3_OR_STAT4)
+#if defined(SQLITE_ENABLE_STAT4)
if( op==TK_REGISTER ) op = pExpr->op2;
#else
if( NEVER(op==TK_REGISTER) ) op = pExpr->op2;
@@ -76071,7 +76238,7 @@ static int valueFromExpr(
0, SQLITE_DYNAMIC);
}
#endif
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
else if( op==TK_FUNCTION && pCtx!=0 ){
rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
}
@@ -76088,13 +76255,13 @@ static int valueFromExpr(
return rc;
no_mem:
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( pCtx==0 || pCtx->pParse->nErr==0 )
#endif
sqlite3OomFault(db);
sqlite3DbFree(db, zVal);
assert( *ppVal==0 );
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( pCtx==0 ) sqlite3ValueFree(pVal);
#else
assert( pCtx==0 ); sqlite3ValueFree(pVal);
@@ -76122,56 +76289,7 @@ SQLITE_PRIVATE int sqlite3ValueFromExpr(
return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
-/*
-** The implementation of the sqlite_record() function. This function accepts
-** a single argument of any type. The return value is a formatted database
-** record (a blob) containing the argument value.
-**
-** This is used to convert the value stored in the 'sample' column of the
-** sqlite_stat3 table to the record format SQLite uses internally.
-*/
-static void recordFunc(
- sqlite3_context *context,
- int argc,
- sqlite3_value **argv
-){
- const int file_format = 1;
- u32 iSerial; /* Serial type */
- int nSerial; /* Bytes of space for iSerial as varint */
- u32 nVal; /* Bytes of space required for argv[0] */
- int nRet;
- sqlite3 *db;
- u8 *aRet;
-
- UNUSED_PARAMETER( argc );
- iSerial = sqlite3VdbeSerialType(argv[0], file_format, &nVal);
- nSerial = sqlite3VarintLen(iSerial);
- db = sqlite3_context_db_handle(context);
-
- nRet = 1 + nSerial + nVal;
- aRet = sqlite3DbMallocRawNN(db, nRet);
- if( aRet==0 ){
- sqlite3_result_error_nomem(context);
- }else{
- aRet[0] = nSerial+1;
- putVarint32(&aRet[1], iSerial);
- sqlite3VdbeSerialPut(&aRet[1+nSerial], argv[0], iSerial);
- sqlite3_result_blob(context, aRet, nRet, SQLITE_TRANSIENT);
- sqlite3DbFreeNN(db, aRet);
- }
-}
-
-/*
-** Register built-in functions used to help read ANALYZE data.
-*/
-SQLITE_PRIVATE void sqlite3AnalyzeFunctions(void){
- static FuncDef aAnalyzeTableFuncs[] = {
- FUNCTION(sqlite_record, 1, 0, 0, recordFunc),
- };
- sqlite3InsertBuiltinFuncs(aAnalyzeTableFuncs, ArraySize(aAnalyzeTableFuncs));
-}
-
+#ifdef SQLITE_ENABLE_STAT4
/*
** Attempt to extract a value from pExpr and use it to construct *ppVal.
**
@@ -77078,7 +77196,7 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
int opcode = pOp->opcode;
if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
|| opcode==OP_VDestroy
- || (opcode==OP_Function0 && pOp->p4.pFunc->funcFlags&SQLITE_FUNC_INTERNAL)
+ || (opcode==OP_ParseSchema && pOp->p4.z==0)
|| ((opcode==OP_Halt || opcode==OP_HaltIfNull)
&& ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
){
@@ -77415,16 +77533,16 @@ SQLITE_PRIVATE void sqlite3VdbeScanStatus(
** Change the value of the opcode, or P1, P2, P3, or P5 operands
** for a specific instruction.
*/
-SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe *p, u32 addr, u8 iNewOpcode){
+SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe *p, int addr, u8 iNewOpcode){
sqlite3VdbeGetOp(p,addr)->opcode = iNewOpcode;
}
-SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, u32 addr, int val){
+SQLITE_PRIVATE void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
sqlite3VdbeGetOp(p,addr)->p1 = val;
}
-SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, u32 addr, int val){
+SQLITE_PRIVATE void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
sqlite3VdbeGetOp(p,addr)->p2 = val;
}
-SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, u32 addr, int val){
+SQLITE_PRIVATE void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
sqlite3VdbeGetOp(p,addr)->p3 = val;
}
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u16 p5){
@@ -77931,14 +78049,16 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){
case P4_KEYINFO: {
int j;
KeyInfo *pKeyInfo = pOp->p4.pKeyInfo;
- assert( pKeyInfo->aSortOrder!=0 );
+ assert( pKeyInfo->aSortFlags!=0 );
sqlite3_str_appendf(&x, "k(%d", pKeyInfo->nKeyField);
for(j=0; j<pKeyInfo->nKeyField; j++){
CollSeq *pColl = pKeyInfo->aColl[j];
const char *zColl = pColl ? pColl->zName : "";
if( strcmp(zColl, "BINARY")==0 ) zColl = "B";
- sqlite3_str_appendf(&x, ",%s%s",
- pKeyInfo->aSortOrder[j] ? "-" : "", zColl);
+ sqlite3_str_appendf(&x, ",%s%s%s",
+ (pKeyInfo->aSortFlags[j] & KEYINFO_ORDER_DESC) ? "-" : "",
+ (pKeyInfo->aSortFlags[j] & KEYINFO_ORDER_BIGNULL)? "N." : "",
+ zColl);
}
sqlite3_str_append(&x, ")", 1);
break;
@@ -78345,8 +78465,11 @@ SQLITE_PRIVATE int sqlite3VdbeList(
** pick up the appropriate opcode. */
int j;
i -= p->nOp;
+ assert( apSub!=0 );
+ assert( nSub>0 );
for(j=0; i>=apSub[j]->nOp; j++){
i -= apSub[j]->nOp;
+ assert( i<apSub[j]->nOp || j+1<nSub );
}
pOp = &apSub[j]->aOp[i];
}
@@ -79868,10 +79991,17 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor **pp, int *piCol){
** of SQLite will not understand those serial types.
*/
+#if 0 /* Inlined into the OP_MakeRecord opcode */
/*
** Return the serial-type for the value stored in pMem.
**
** This routine might convert a large MEM_IntReal value into MEM_Real.
+**
+** 2019-07-11: The primary user of this subroutine was the OP_MakeRecord
+** opcode in the byte-code engine. But by moving this routine in-line, we
+** can omit some redundant tests and make that opcode a lot faster. So
+** this routine is now only used by the STAT3 logic and STAT3 support has
+** ended. The code is kept here for historical reference only.
*/
SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){
int flags = pMem->flags;
@@ -79932,6 +80062,7 @@ SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){
*pLen = n;
return ((n*2) + 12 + ((flags&MEM_Str)!=0));
}
+#endif /* inlined into OP_MakeRecord */
/*
** The sizes for serial types less than 128
@@ -80240,7 +80371,7 @@ SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(
p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
if( !p ) return 0;
p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
- assert( pKeyInfo->aSortOrder!=0 );
+ assert( pKeyInfo->aSortFlags!=0 );
p->pKeyInfo = pKeyInfo;
p->nField = pKeyInfo->nKeyField + 1;
return p;
@@ -80339,7 +80470,7 @@ static int vdbeRecordCompareDebug(
if( szHdr1>98307 ) return SQLITE_CORRUPT;
d1 = szHdr1;
assert( pKeyInfo->nAllField>=pPKey2->nField || CORRUPT_DB );
- assert( pKeyInfo->aSortOrder!=0 );
+ assert( pKeyInfo->aSortFlags!=0 );
assert( pKeyInfo->nKeyField>0 );
assert( idx1<=szHdr1 || CORRUPT_DB );
do{
@@ -80370,7 +80501,12 @@ static int vdbeRecordCompareDebug(
pKeyInfo->nAllField>i ? pKeyInfo->aColl[i] : 0);
if( rc!=0 ){
assert( mem1.szMalloc==0 ); /* See comment below */
- if( pKeyInfo->aSortOrder[i] ){
+ if( (pKeyInfo->aSortFlags[i] & KEYINFO_ORDER_BIGNULL)
+ && ((mem1.flags & MEM_Null) || (pPKey2->aMem[i].flags & MEM_Null))
+ ){
+ rc = -rc;
+ }
+ if( pKeyInfo->aSortFlags[i] & KEYINFO_ORDER_DESC ){
rc = -rc; /* Invert the result for DESC sort order. */
}
goto debugCompareEnd;
@@ -80746,7 +80882,7 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip(
VVA_ONLY( mem1.szMalloc = 0; ) /* Only needed by assert() statements */
assert( pPKey2->pKeyInfo->nAllField>=pPKey2->nField
|| CORRUPT_DB );
- assert( pPKey2->pKeyInfo->aSortOrder!=0 );
+ assert( pPKey2->pKeyInfo->aSortFlags!=0 );
assert( pPKey2->pKeyInfo->nKeyField>0 );
assert( idx1<=szHdr1 || CORRUPT_DB );
do{
@@ -80869,8 +81005,14 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip(
}
if( rc!=0 ){
- if( pPKey2->pKeyInfo->aSortOrder[i] ){
- rc = -rc;
+ int sortFlags = pPKey2->pKeyInfo->aSortFlags[i];
+ if( sortFlags ){
+ if( (sortFlags & KEYINFO_ORDER_BIGNULL)==0
+ || ((sortFlags & KEYINFO_ORDER_DESC)
+ !=(serial_type==0 || (pRhs->flags&MEM_Null)))
+ ){
+ rc = -rc;
+ }
}
assert( vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, rc) );
assert( mem1.szMalloc==0 ); /* See comment below */
@@ -81038,7 +81180,11 @@ static int vdbeRecordCompareString(
nCmp = MIN( pPKey2->aMem[0].n, nStr );
res = memcmp(&aKey1[szHdr], pPKey2->aMem[0].z, nCmp);
- if( res==0 ){
+ if( res>0 ){
+ res = pPKey2->r2;
+ }else if( res<0 ){
+ res = pPKey2->r1;
+ }else{
res = nStr - pPKey2->aMem[0].n;
if( res==0 ){
if( pPKey2->nField>1 ){
@@ -81052,10 +81198,6 @@ static int vdbeRecordCompareString(
}else{
res = pPKey2->r1;
}
- }else if( res>0 ){
- res = pPKey2->r2;
- }else{
- res = pPKey2->r1;
}
}
@@ -81087,7 +81229,10 @@ SQLITE_PRIVATE RecordCompare sqlite3VdbeFindCompare(UnpackedRecord *p){
** header size is (12*5 + 1 + 1) bytes. */
if( p->pKeyInfo->nAllField<=13 ){
int flags = p->aMem[0].flags;
- if( p->pKeyInfo->aSortOrder[0] ){
+ if( p->pKeyInfo->aSortFlags[0] ){
+ if( p->pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL ){
+ return sqlite3VdbeRecordCompare;
+ }
p->r1 = 1;
p->r2 = -1;
}else{
@@ -81336,7 +81481,7 @@ SQLITE_PRIVATE void sqlite3VdbeSetVarmask(Vdbe *v, int iVar){
** features such as 'now'.
*/
SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context *pCtx){
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( pCtx->pVdbe==0 ) return 1;
#endif
if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
@@ -81433,7 +81578,7 @@ SQLITE_PRIVATE void sqlite3VdbePreUpdateHook(
preupdate.keyinfo.db = db;
preupdate.keyinfo.enc = ENC(db);
preupdate.keyinfo.nKeyField = pTab->nCol;
- preupdate.keyinfo.aSortOrder = (u8*)&fakeSortOrder;
+ preupdate.keyinfo.aSortFlags = (u8*)&fakeSortOrder;
preupdate.iKey1 = iKey1;
preupdate.iKey2 = iKey2;
preupdate.pTab = pTab;
@@ -82302,7 +82447,7 @@ SQLITE_API int sqlite3_vtab_nochange(sqlite3_context *p){
*/
SQLITE_PRIVATE sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p){
int rc;
-#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifndef SQLITE_ENABLE_STAT4
sqlite3_int64 *piTime = &p->pVdbe->iCurrentTime;
assert( p->pVdbe!=0 );
#else
@@ -82367,7 +82512,7 @@ SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
AuxData *pAuxData;
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
-#if SQLITE_ENABLE_STAT3_OR_STAT4
+#if SQLITE_ENABLE_STAT4
if( pCtx->pVdbe==0 ) return 0;
#else
assert( pCtx->pVdbe!=0 );
@@ -82401,7 +82546,7 @@ SQLITE_API void sqlite3_set_auxdata(
Vdbe *pVdbe = pCtx->pVdbe;
assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( pVdbe==0 ) goto failed;
#else
assert( pVdbe!=0 );
@@ -84053,6 +84198,7 @@ static void applyNumericAffinity(Mem *pRec, int bTryForInt){
** Convert pRec to a text representation.
**
** SQLITE_AFF_BLOB:
+** SQLITE_AFF_NONE:
** No-op. pRec is unchanged.
*/
static void applyAffinity(
@@ -84192,13 +84338,15 @@ SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
c = 's';
}
*(zCsr++) = c;
+ *(zCsr++) = 'x';
sqlite3_snprintf(100, zCsr, "%d[", pMem->n);
zCsr += sqlite3Strlen30(zCsr);
- for(i=0; i<16 && i<pMem->n; i++){
+ for(i=0; i<25 && i<pMem->n; i++){
sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF));
zCsr += sqlite3Strlen30(zCsr);
}
- for(i=0; i<16 && i<pMem->n; i++){
+ *zCsr++ = '|';
+ for(i=0; i<25 && i<pMem->n; i++){
char z = pMem->z[i];
if( z<32 || z>126 ) *zCsr++ = '.';
else *zCsr++ = z;
@@ -84228,7 +84376,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){
sqlite3_snprintf(100, &zBuf[k], "%d", pMem->n);
k += sqlite3Strlen30(&zBuf[k]);
zBuf[k++] = '[';
- for(j=0; j<15 && j<pMem->n; j++){
+ for(j=0; j<25 && j<pMem->n; j++){
u8 c = pMem->z[j];
if( c>=0x20 && c<0x7f ){
zBuf[k++] = c;
@@ -84261,7 +84409,7 @@ static void memTracePrint(Mem *p){
printf(" i:%lld", p->u.i);
#ifndef SQLITE_OMIT_FLOATING_POINT
}else if( p->flags & MEM_Real ){
- printf(" r:%g", p->u.r);
+ printf(" r:%.17g", p->u.r);
#endif
}else if( sqlite3VdbeMemIsRowSet(p) ){
printf(" (rowset)");
@@ -84939,7 +85087,6 @@ case OP_Real: { /* same as TK_FLOAT, out2 */
case OP_String8: { /* same as TK_STRING, out2 */
assert( pOp->p4.z!=0 );
pOut = out2Prerelease(p, pOp);
- pOp->opcode = OP_String;
pOp->p1 = sqlite3Strlen30(pOp->p4.z);
#ifndef SQLITE_OMIT_UTF16
@@ -84963,6 +85110,7 @@ case OP_String8: { /* same as TK_STRING, out2 */
if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
goto too_big;
}
+ pOp->opcode = OP_String;
assert( rc==SQLITE_OK );
/* Fall through to the next case, OP_String */
}
@@ -85630,6 +85778,7 @@ case OP_RealAffinity: { /* in1 */
testcase( pIn1->flags & MEM_Int );
testcase( pIn1->flags & MEM_IntReal );
sqlite3VdbeMemRealify(pIn1);
+ REGISTER_TRACE(pOp->p1, pIn1);
}
break;
}
@@ -86025,9 +86174,14 @@ case OP_Compare: {
REGISTER_TRACE(p2+idx, &aMem[p2+idx]);
assert( i<pKeyInfo->nKeyField );
pColl = pKeyInfo->aColl[i];
- bRev = pKeyInfo->aSortOrder[i];
+ bRev = (pKeyInfo->aSortFlags[i] & KEYINFO_ORDER_DESC);
iCompare = sqlite3MemCompare(&aMem[p1+idx], &aMem[p2+idx], pColl);
if( iCompare ){
+ if( (pKeyInfo->aSortFlags[i] & KEYINFO_ORDER_BIGNULL)
+ && ((aMem[p1+idx].flags & MEM_Null) || (aMem[p2+idx].flags & MEM_Null))
+ ){
+ iCompare = -iCompare;
+ }
if( bRev ) iCompare = -iCompare;
break;
}
@@ -86318,11 +86472,6 @@ case OP_Offset: { /* out3 */
** if the P4 argument is a P4_MEM use the value of the P4 argument as
** the result.
**
-** If the OPFLAG_CLEARCACHE bit is set on P5 and P1 is a pseudo-table cursor,
-** then the cache of the cursor is reset prior to extracting the column.
-** The first OP_Column against a pseudo-table after the value of the content
-** register has changed should have this bit set.
-**
** If the OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG bits are set on P5 then
** the result is guaranteed to only be used as the argument of a length()
** or typeof() function, respectively. The loading of large blobs can be
@@ -86611,15 +86760,27 @@ case OP_Affinity: {
assert( pOp->p2>0 );
assert( zAffinity[pOp->p2]==0 );
pIn1 = &aMem[pOp->p1];
- while( 1 /*edit-by-break*/ ){
+ while( 1 /*exit-by-break*/ ){
assert( pIn1 <= &p->aMem[(p->nMem+1 - p->nCursor)] );
assert( memIsValid(pIn1) );
applyAffinity(pIn1, zAffinity[0], encoding);
if( zAffinity[0]==SQLITE_AFF_REAL && (pIn1->flags & MEM_Int)!=0 ){
- /* When applying REAL affinity, if the result is still MEM_Int,
- ** indicate that REAL is actually desired */
- pIn1->flags |= MEM_IntReal;
- pIn1->flags &= ~MEM_Int;
+ /* When applying REAL affinity, if the result is still an MEM_Int
+ ** that will fit in 6 bytes, then change the type to MEM_IntReal
+ ** so that we keep the high-resolution integer value but know that
+ ** the type really wants to be REAL. */
+ testcase( pIn1->u.i==140737488355328LL );
+ testcase( pIn1->u.i==140737488355327LL );
+ testcase( pIn1->u.i==-140737488355328LL );
+ testcase( pIn1->u.i==-140737488355329LL );
+ if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL ){
+ pIn1->flags |= MEM_IntReal;
+ pIn1->flags &= ~MEM_Int;
+ }else{
+ pIn1->u.r = (double)pIn1->u.i;
+ pIn1->flags |= MEM_Real;
+ pIn1->flags &= ~MEM_Int;
+ }
}
REGISTER_TRACE((int)(pIn1-aMem), pIn1);
zAffinity++;
@@ -86726,14 +86887,36 @@ case OP_MakeRecord: {
#endif
/* Loop through the elements that will make up the record to figure
- ** out how much space is required for the new record.
+ ** out how much space is required for the new record. After this loop,
+ ** the Mem.uTemp field of each term should hold the serial-type that will
+ ** be used for that term in the generated record:
+ **
+ ** Mem.uTemp value type
+ ** --------------- ---------------
+ ** 0 NULL
+ ** 1 1-byte signed integer
+ ** 2 2-byte signed integer
+ ** 3 3-byte signed integer
+ ** 4 4-byte signed integer
+ ** 5 6-byte signed integer
+ ** 6 8-byte signed integer
+ ** 7 IEEE float
+ ** 8 Integer constant 0
+ ** 9 Integer constant 1
+ ** 10,11 reserved for expansion
+ ** N>=12 and even BLOB
+ ** N>=13 and odd text
+ **
+ ** The following additional values are computed:
+ ** nHdr Number of bytes needed for the record header
+ ** nData Number of bytes of data space needed for the record
+ ** nZero Zero bytes at the end of the record
*/
pRec = pLast;
do{
assert( memIsValid(pRec) );
- serial_type = sqlite3VdbeSerialType(pRec, file_format, &len);
- if( pRec->flags & MEM_Zero ){
- if( serial_type==0 ){
+ if( pRec->flags & MEM_Null ){
+ if( pRec->flags & MEM_Zero ){
/* Values with MEM_Null and MEM_Zero are created by xColumn virtual
** table methods that never invoke sqlite3_result_xxxxx() while
** computing an unchanging column value in an UPDATE statement.
@@ -86741,19 +86924,83 @@ case OP_MakeRecord: {
** so that they can be passed through to xUpdate and have
** a true sqlite3_value_nochange(). */
assert( pOp->p5==OPFLAG_NOCHNG_MAGIC || CORRUPT_DB );
- serial_type = 10;
- }else if( nData ){
- if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
+ pRec->uTemp = 10;
+ }else{
+ pRec->uTemp = 0;
+ }
+ nHdr++;
+ }else if( pRec->flags & (MEM_Int|MEM_IntReal) ){
+ /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */
+ i64 i = pRec->u.i;
+ u64 uu;
+ testcase( pRec->flags & MEM_Int );
+ testcase( pRec->flags & MEM_IntReal );
+ if( i<0 ){
+ uu = ~i;
}else{
- nZero += pRec->u.nZero;
- len -= pRec->u.nZero;
+ uu = i;
+ }
+ nHdr++;
+ testcase( uu==127 ); testcase( uu==128 );
+ testcase( uu==32767 ); testcase( uu==32768 );
+ testcase( uu==8388607 ); testcase( uu==8388608 );
+ testcase( uu==2147483647 ); testcase( uu==2147483648 );
+ testcase( uu==140737488355327LL ); testcase( uu==140737488355328LL );
+ if( uu<=127 ){
+ if( (i&1)==i && file_format>=4 ){
+ pRec->uTemp = 8+(u32)uu;
+ }else{
+ nData++;
+ pRec->uTemp = 1;
+ }
+ }else if( uu<=32767 ){
+ nData += 2;
+ pRec->uTemp = 2;
+ }else if( uu<=8388607 ){
+ nData += 3;
+ pRec->uTemp = 3;
+ }else if( uu<=2147483647 ){
+ nData += 4;
+ pRec->uTemp = 4;
+ }else if( uu<=140737488355327LL ){
+ nData += 6;
+ pRec->uTemp = 5;
+ }else{
+ nData += 8;
+ if( pRec->flags & MEM_IntReal ){
+ /* If the value is IntReal and is going to take up 8 bytes to store
+ ** as an integer, then we might as well make it an 8-byte floating
+ ** point value */
+ pRec->u.r = (double)pRec->u.i;
+ pRec->flags &= ~MEM_IntReal;
+ pRec->flags |= MEM_Real;
+ pRec->uTemp = 7;
+ }else{
+ pRec->uTemp = 6;
+ }
+ }
+ }else if( pRec->flags & MEM_Real ){
+ nHdr++;
+ nData += 8;
+ pRec->uTemp = 7;
+ }else{
+ assert( db->mallocFailed || pRec->flags&(MEM_Str|MEM_Blob) );
+ assert( pRec->n>=0 );
+ len = (u32)pRec->n;
+ serial_type = (len*2) + 12 + ((pRec->flags & MEM_Str)!=0);
+ if( pRec->flags & MEM_Zero ){
+ serial_type += pRec->u.nZero*2;
+ if( nData ){
+ if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
+ len += pRec->u.nZero;
+ }else{
+ nZero += pRec->u.nZero;
+ }
}
+ nData += len;
+ nHdr += sqlite3VarintLen(serial_type);
+ pRec->uTemp = serial_type;
}
- nData += len;
- testcase( serial_type==127 );
- testcase( serial_type==128 );
- nHdr += serial_type<=127 ? 1 : sqlite3VarintLen(serial_type);
- pRec->uTemp = serial_type;
if( pRec==pData0 ) break;
pRec--;
}while(1);
@@ -87089,7 +87336,7 @@ case OP_AutoCommit: {
rc = SQLITE_ERROR;
goto abort_due_to_error;
}
- break;
+ /*NOTREACHED*/ assert(0);
}
/* Opcode: Transaction P1 P2 P3 P4 P5
@@ -87827,6 +88074,7 @@ case OP_SeekGT: { /* jump, in3, group */
pC->deferredMoveto = 0;
pC->cacheStatus = CACHE_STALE;
if( pC->isTable ){
+ u16 flags3, newType;
/* The BTREE_SEEK_EQ flag is only set on index cursors */
assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0
|| CORRUPT_DB );
@@ -87835,18 +88083,21 @@ case OP_SeekGT: { /* jump, in3, group */
** blob, or NULL. But it needs to be an integer before we can do
** the seek, so convert it. */
pIn3 = &aMem[pOp->p3];
- if( (pIn3->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Str))==MEM_Str ){
+ flags3 = pIn3->flags;
+ if( (flags3 & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Str))==MEM_Str ){
applyNumericAffinity(pIn3, 0);
}
- iKey = sqlite3VdbeIntValue(pIn3);
+ iKey = sqlite3VdbeIntValue(pIn3); /* Get the integer key value */
+ newType = pIn3->flags; /* Record the type after applying numeric affinity */
+ pIn3->flags = flags3; /* But convert the type back to its original */
/* If the P3 value could not be converted into an integer without
** loss of information, then special processing is required... */
- if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){
- if( (pIn3->flags & MEM_Real)==0 ){
- if( (pIn3->flags & MEM_Null) || oc>=OP_SeekGE ){
- VdbeBranchTaken(1,2); goto jump_to_p2;
- break;
+ if( (newType & (MEM_Int|MEM_IntReal))==0 ){
+ if( (newType & MEM_Real)==0 ){
+ if( (newType & MEM_Null) || oc>=OP_SeekGE ){
+ VdbeBranchTaken(1,2);
+ goto jump_to_p2;
}else{
rc = sqlite3BtreeLast(pC->uc.pCursor, &res);
if( rc!=SQLITE_OK ) goto abort_due_to_error;
@@ -88231,23 +88482,27 @@ case OP_SeekRowid: { /* jump, in3 */
pIn3 = &aMem[pOp->p3];
testcase( pIn3->flags & MEM_Int );
testcase( pIn3->flags & MEM_IntReal );
+ testcase( pIn3->flags & MEM_Real );
+ testcase( (pIn3->flags & (MEM_Str|MEM_Int))==MEM_Str );
if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){
- /* Make sure pIn3->u.i contains a valid integer representation of
- ** the key value, but do not change the datatype of the register, as
- ** other parts of the perpared statement might be depending on the
- ** current datatype. */
- u16 origFlags = pIn3->flags;
- int isNotInt;
- applyAffinity(pIn3, SQLITE_AFF_NUMERIC, encoding);
- isNotInt = (pIn3->flags & MEM_Int)==0;
- pIn3->flags = origFlags;
- if( isNotInt ) goto jump_to_p2;
+ /* If pIn3->u.i does not contain an integer, compute iKey as the
+ ** integer value of pIn3. Jump to P2 if pIn3 cannot be converted
+ ** into an integer without loss of information. Take care to avoid
+ ** changing the datatype of pIn3, however, as it is used by other
+ ** parts of the prepared statement. */
+ Mem x = pIn3[0];
+ applyAffinity(&x, SQLITE_AFF_NUMERIC, encoding);
+ if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
+ iKey = x.u.i;
+ goto notExistsWithKey;
}
/* Fall through into OP_NotExists */
case OP_NotExists: /* jump, in3 */
pIn3 = &aMem[pOp->p3];
assert( (pIn3->flags & MEM_Int)!=0 || pOp->opcode==OP_SeekRowid );
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
+ iKey = pIn3->u.i;
+notExistsWithKey:
pC = p->apCsr[pOp->p1];
assert( pC!=0 );
#ifdef SQLITE_DEBUG
@@ -88258,7 +88513,6 @@ case OP_NotExists: /* jump, in3 */
pCrsr = pC->uc.pCursor;
assert( pCrsr!=0 );
res = 0;
- iKey = pIn3->u.i;
rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0, &res);
assert( rc==SQLITE_OK || res==0 );
pC->movetoTarget = iKey; /* Used by OP_Delete */
@@ -89140,11 +89394,12 @@ case OP_Next: /* jump */
** The Prev opcode is only used after SeekLT, SeekLE, and Last. */
assert( pOp->opcode!=OP_Next
|| pC->seekOp==OP_SeekGT || pC->seekOp==OP_SeekGE
- || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found
- || pC->seekOp==OP_NullRow|| pC->seekOp==OP_SeekRowid);
+ || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found
+ || pC->seekOp==OP_NullRow|| pC->seekOp==OP_SeekRowid
+ || pC->seekOp==OP_IfNoHope);
assert( pOp->opcode!=OP_Prev
|| pC->seekOp==OP_SeekLT || pC->seekOp==OP_SeekLE
- || pC->seekOp==OP_Last
+ || pC->seekOp==OP_Last || pC->seekOp==OP_IfNoHope
|| pC->seekOp==OP_NullRow);
rc = pOp->p4.xAdvance(pC->uc.pCursor, pOp->p3);
@@ -89663,7 +89918,7 @@ case OP_ParseSchema: {
initData.pzErrMsg = &p->zErrMsg;
initData.mInitFlags = 0;
zSql = sqlite3MPrintf(db,
- "SELECT name, rootpage, sql FROM '%q'.%s WHERE %s ORDER BY rowid",
+ "SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid",
db->aDb[iDb].zDbSName, zMaster, pOp->p4.z);
if( zSql==0 ){
rc = SQLITE_NOMEM_BKPT;
@@ -91870,11 +92125,12 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){
sqlite3 *db;
if( p ){
+ sqlite3_stmt *pStmt = p->pStmt;
db = p->db;
sqlite3_mutex_enter(db->mutex);
- rc = sqlite3_finalize(p->pStmt);
sqlite3DbFree(db, p);
sqlite3_mutex_leave(db->mutex);
+ rc = sqlite3_finalize(pStmt);
}else{
rc = SQLITE_OK;
}
@@ -92854,7 +93110,8 @@ static int vdbeSorterCompareText(
);
}
}else{
- if( pTask->pSorter->pKeyInfo->aSortOrder[0] ){
+ assert( !(pTask->pSorter->pKeyInfo->aSortFlags[0]&KEYINFO_ORDER_BIGNULL) );
+ if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){
res = res * -1;
}
}
@@ -92922,7 +93179,8 @@ static int vdbeSorterCompareInt(
pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2
);
}
- }else if( pTask->pSorter->pKeyInfo->aSortOrder[0] ){
+ }else if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){
+ assert( !(pTask->pSorter->pKeyInfo->aSortFlags[0]&KEYINFO_ORDER_BIGNULL) );
res = res * -1;
}
@@ -93037,6 +93295,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterInit(
if( pKeyInfo->nAllField<13
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl)
+ && (pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL)==0
){
pSorter->typeMask = SORTER_TYPE_INTEGER | SORTER_TYPE_TEXT;
}
@@ -93753,13 +94012,16 @@ static int vdbeSorterFlushPMA(VdbeSorter *pSorter){
rc = vdbeSorterListToPMA(&pSorter->aTask[nWorker], &pSorter->list);
}else{
/* Launch a background thread for this operation */
- u8 *aMem = pTask->list.aMemory;
- void *pCtx = (void*)pTask;
+ u8 *aMem;
+ void *pCtx;
+ assert( pTask!=0 );
assert( pTask->pThread==0 && pTask->bDone==0 );
assert( pTask->list.pList==0 );
assert( pTask->list.aMemory==0 || pSorter->list.aMemory!=0 );
+ aMem = pTask->list.aMemory;
+ pCtx = (void*)pTask;
pSorter->iPrev = (u8)(pTask - pSorter->aTask);
pTask->list = pSorter->list;
pSorter->list.pList = 0;
@@ -94883,14 +95145,9 @@ static int memjrnlRead(
int iChunkOffset;
FileChunk *pChunk;
-#if defined(SQLITE_ENABLE_ATOMIC_WRITE) \
- || defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
if( (iAmt+iOfst)>p->endpoint.iOffset ){
return SQLITE_IOERR_SHORT_READ;
}
-#endif
-
- assert( (iAmt+iOfst)<=p->endpoint.iOffset );
assert( p->readpoint.iOffset==0 || p->readpoint.pChunk!=0 );
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
sqlite3_int64 iOff = 0;
@@ -95249,9 +95506,22 @@ SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){
static int walkWindowList(Walker *pWalker, Window *pList){
Window *pWin;
for(pWin=pList; pWin; pWin=pWin->pNextWin){
- if( sqlite3WalkExprList(pWalker, pWin->pOrderBy) ) return WRC_Abort;
- if( sqlite3WalkExprList(pWalker, pWin->pPartition) ) return WRC_Abort;
- if( sqlite3WalkExpr(pWalker, pWin->pFilter) ) return WRC_Abort;
+ int rc;
+ rc = sqlite3WalkExprList(pWalker, pWin->pOrderBy);
+ if( rc ) return WRC_Abort;
+ rc = sqlite3WalkExprList(pWalker, pWin->pPartition);
+ if( rc ) return WRC_Abort;
+ rc = sqlite3WalkExpr(pWalker, pWin->pFilter);
+ if( rc ) return WRC_Abort;
+
+ /* The next two are purely for calls to sqlite3RenameExprUnmap()
+ ** within sqlite3WindowOffsetExpr(). Because of constraints imposed
+ ** by sqlite3WindowOffsetExpr(), they can never fail. The results do
+ ** not matter anyhow. */
+ rc = sqlite3WalkExpr(pWalker, pWin->pStart);
+ if( NEVER(rc) ) return WRC_Abort;
+ rc = sqlite3WalkExpr(pWalker, pWin->pEnd);
+ if( NEVER(rc) ) return WRC_Abort;
}
return WRC_Continue;
}
@@ -95287,18 +95557,22 @@ static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
assert( pExpr->x.pList==0 || pExpr->pRight==0 );
if( pExpr->pRight ){
+ assert( !ExprHasProperty(pExpr, EP_WinFunc) );
pExpr = pExpr->pRight;
continue;
}else if( ExprHasProperty(pExpr, EP_xIsSelect) ){
+ assert( !ExprHasProperty(pExpr, EP_WinFunc) );
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
- }else if( pExpr->x.pList ){
- if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
- }
+ }else{
+ if( pExpr->x.pList ){
+ if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
+ }
#ifndef SQLITE_OMIT_WINDOWFUNC
- if( ExprHasProperty(pExpr, EP_WinFunc) ){
- if( walkWindowList(pWalker, pExpr->y.pWin) ) return WRC_Abort;
- }
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ if( walkWindowList(pWalker, pExpr->y.pWin) ) return WRC_Abort;
+ }
#endif
+ }
}
break;
}
@@ -95340,8 +95614,9 @@ SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker *pWalker, Select *p){
{
Parse *pParse = pWalker->pParse;
if( pParse && IN_RENAME_OBJECT ){
+ /* The following may return WRC_Abort if there are unresolvable
+ ** symbols (e.g. a table that does not exist) in a window definition. */
int rc = walkWindowList(pWalker, p->pWinDefn);
- assert( rc==WRC_Continue );
return rc;
}
}
@@ -95513,6 +95788,13 @@ static void resolveAlias(
pExpr->u.zToken = sqlite3DbStrDup(db, pExpr->u.zToken);
pExpr->flags |= EP_MemToken;
}
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ if( pExpr->y.pWin!=0 ){
+ pExpr->y.pWin->pOwner = pExpr;
+ }else{
+ assert( db->mallocFailed );
+ }
+ }
sqlite3DbFree(db, pDup);
}
ExprSetProperty(pExpr, EP_Alias);
@@ -95798,7 +96080,7 @@ static int lookupName(
{
#ifndef SQLITE_OMIT_TRIGGER
if( iCol<0 ){
- pExpr->affinity = SQLITE_AFF_INTEGER;
+ pExpr->affExpr = SQLITE_AFF_INTEGER;
}else if( pExpr->iTable==0 ){
testcase( iCol==31 );
testcase( iCol==32 );
@@ -95830,7 +96112,7 @@ static int lookupName(
){
cnt = 1;
pExpr->iColumn = -1;
- pExpr->affinity = SQLITE_AFF_INTEGER;
+ pExpr->affExpr = SQLITE_AFF_INTEGER;
}
/*
@@ -96106,7 +96388,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
pExpr->y.pTab = pItem->pTab;
pExpr->iTable = pItem->iCursor;
pExpr->iColumn = -1;
- pExpr->affinity = SQLITE_AFF_INTEGER;
+ pExpr->affExpr = SQLITE_AFF_INTEGER;
break;
}
#endif /* defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT)
@@ -96166,7 +96448,9 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
FuncDef *pDef; /* Information about the function */
u8 enc = ENC(pParse->db); /* The database encoding */
int savedAllowFlags = (pNC->ncFlags & (NC_AllowAgg | NC_AllowWin));
-
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ Window *pWin = (IsWindowFunc(pExpr) ? pExpr->y.pWin : 0);
+#endif
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
zId = pExpr->u.zToken;
nId = sqlite3Strlen30(zId);
@@ -96238,6 +96522,15 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
** SQL is being compiled using sqlite3NestedParse() */
no_such_func = 1;
pDef = 0;
+ }else
+ if( (pDef->funcFlags & SQLITE_FUNC_DIRECT)!=0
+ && ExprHasProperty(pExpr, EP_Indirect)
+ && !IN_RENAME_OBJECT
+ ){
+ /* Functions tagged with SQLITE_DIRECTONLY may not be used
+ ** inside of triggers and views */
+ sqlite3ErrorMsg(pParse, "%s() prohibited in triggers and views",
+ pDef->zName);
}
}
@@ -96247,18 +96540,18 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|| (pDef->xValue==0 && pDef->xInverse==0)
|| (pDef->xValue && pDef->xInverse && pDef->xSFunc && pDef->xFinalize)
);
- if( pDef && pDef->xValue==0 && ExprHasProperty(pExpr, EP_WinFunc) ){
+ if( pDef && pDef->xValue==0 && pWin ){
sqlite3ErrorMsg(pParse,
"%.*s() may not be used as a window function", nId, zId
);
pNC->nErr++;
}else if(
(is_agg && (pNC->ncFlags & NC_AllowAgg)==0)
- || (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pExpr->y.pWin)
- || (is_agg && pExpr->y.pWin && (pNC->ncFlags & NC_AllowWin)==0)
+ || (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pWin)
+ || (is_agg && pWin && (pNC->ncFlags & NC_AllowWin)==0)
){
const char *zType;
- if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pExpr->y.pWin ){
+ if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pWin ){
zType = "window";
}else{
zType = "aggregate";
@@ -96286,34 +96579,44 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
nId, zId);
pNC->nErr++;
}
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ else if( is_agg==0 && ExprHasProperty(pExpr, EP_WinFunc) ){
+ sqlite3ErrorMsg(pParse,
+ "FILTER may not be used with non-aggregate %.*s()",
+ nId, zId
+ );
+ pNC->nErr++;
+ }
+#endif
if( is_agg ){
/* Window functions may not be arguments of aggregate functions.
** Or arguments of other window functions. But aggregate functions
** may be arguments for window functions. */
#ifndef SQLITE_OMIT_WINDOWFUNC
- pNC->ncFlags &= ~(NC_AllowWin | (!pExpr->y.pWin ? NC_AllowAgg : 0));
+ pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0));
#else
pNC->ncFlags &= ~NC_AllowAgg;
#endif
}
}
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ else if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ is_agg = 1;
+ }
+#endif
sqlite3WalkExprList(pWalker, pList);
if( is_agg ){
#ifndef SQLITE_OMIT_WINDOWFUNC
- if( pExpr->y.pWin ){
+ if( pWin ){
Select *pSel = pNC->pWinSelect;
+ assert( pWin==pExpr->y.pWin );
if( IN_RENAME_OBJECT==0 ){
- sqlite3WindowUpdate(pParse, pSel->pWinDefn, pExpr->y.pWin, pDef);
- }
- sqlite3WalkExprList(pWalker, pExpr->y.pWin->pPartition);
- sqlite3WalkExprList(pWalker, pExpr->y.pWin->pOrderBy);
- sqlite3WalkExpr(pWalker, pExpr->y.pWin->pFilter);
- if( 0==pSel->pWin
- || 0==sqlite3WindowCompare(pParse, pSel->pWin, pExpr->y.pWin)
- ){
- pExpr->y.pWin->pNextWin = pSel->pWin;
- pSel->pWin = pExpr->y.pWin;
+ sqlite3WindowUpdate(pParse, pSel->pWinDefn, pWin, pDef);
}
+ sqlite3WalkExprList(pWalker, pWin->pPartition);
+ sqlite3WalkExprList(pWalker, pWin->pOrderBy);
+ sqlite3WalkExpr(pWalker, pWin->pFilter);
+ sqlite3WindowLink(pSel, pWin);
pNC->ncFlags |= NC_HasWin;
}else
#endif /* SQLITE_OMIT_WINDOWFUNC */
@@ -96321,12 +96624,17 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
NameContext *pNC2 = pNC;
pExpr->op = TK_AGG_FUNCTION;
pExpr->op2 = 0;
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ sqlite3WalkExpr(pWalker, pExpr->y.pWin->pFilter);
+ }
+#endif
while( pNC2 && !sqlite3FunctionUsesThisSrc(pExpr, pNC2->pSrcList) ){
pExpr->op2++;
pNC2 = pNC2->pNext;
}
- assert( pDef!=0 );
- if( pNC2 ){
+ assert( pDef!=0 || IN_RENAME_OBJECT );
+ if( pNC2 && pDef ){
assert( SQLITE_FUNC_MINMAX==NC_MinMaxAgg );
testcase( (pDef->funcFlags & SQLITE_FUNC_MINMAX)!=0 );
pNC2->ncFlags |= NC_HasAgg | (pDef->funcFlags & SQLITE_FUNC_MINMAX);
@@ -96364,7 +96672,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
}
case TK_IS:
case TK_ISNOT: {
- Expr *pRight = sqlite3ExprSkipCollate(pExpr->pRight);
+ Expr *pRight = sqlite3ExprSkipCollateAndLikely(pExpr->pRight);
assert( !ExprHasProperty(pExpr, EP_Reduced) );
/* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
** and "x IS NOT FALSE". */
@@ -96575,7 +96883,7 @@ static int resolveCompoundOrderBy(
int iCol = -1;
Expr *pE, *pDup;
if( pItem->done ) continue;
- pE = sqlite3ExprSkipCollate(pItem->pExpr);
+ pE = sqlite3ExprSkipCollateAndLikely(pItem->pExpr);
if( sqlite3ExprIsInteger(pE, &iCol) ){
if( iCol<=0 || iCol>pEList->nExpr ){
resolveOutOfRangeError(pParse, "ORDER", i+1, pEList->nExpr);
@@ -96669,7 +96977,7 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(
ExprList *pEList;
struct ExprList_item *pItem;
- if( pOrderBy==0 || pParse->db->mallocFailed ) return 0;
+ if( pOrderBy==0 || pParse->db->mallocFailed || IN_RENAME_OBJECT ) return 0;
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){
sqlite3ErrorMsg(pParse, "too many terms in %s BY clause", zType);
return 1;
@@ -96691,17 +96999,13 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(
#ifndef SQLITE_OMIT_WINDOWFUNC
/*
-** Walker callback for resolveRemoveWindows().
+** Walker callback for windowRemoveExprFromSelect().
*/
static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
+ UNUSED_PARAMETER(pWalker);
if( ExprHasProperty(pExpr, EP_WinFunc) ){
- Window **pp;
- for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
- if( *pp==pExpr->y.pWin ){
- *pp = (*pp)->pNextWin;
- break;
- }
- }
+ Window *pWin = pExpr->y.pWin;
+ sqlite3WindowUnlinkFromSelect(pWin);
}
return WRC_Continue;
}
@@ -96710,16 +97014,18 @@ static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
** Remove any Window objects owned by the expression pExpr from the
** Select.pWin list of Select object pSelect.
*/
-static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){
- Walker sWalker;
- memset(&sWalker, 0, sizeof(Walker));
- sWalker.xExprCallback = resolveRemoveWindowsCb;
- sWalker.u.pSelect = pSelect;
- sqlite3WalkExpr(&sWalker, pExpr);
+static void windowRemoveExprFromSelect(Select *pSelect, Expr *pExpr){
+ if( pSelect->pWin ){
+ Walker sWalker;
+ memset(&sWalker, 0, sizeof(Walker));
+ sWalker.xExprCallback = resolveRemoveWindowsCb;
+ sWalker.u.pSelect = pSelect;
+ sqlite3WalkExpr(&sWalker, pExpr);
+ }
}
#else
-# define resolveRemoveWindows(x,y)
-#endif
+# define windowRemoveExprFromSelect(a, b)
+#endif /* SQLITE_OMIT_WINDOWFUNC */
/*
** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
@@ -96756,7 +97062,7 @@ static int resolveOrderGroupBy(
pParse = pNC->pParse;
for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
Expr *pE = pItem->pExpr;
- Expr *pE2 = sqlite3ExprSkipCollate(pE);
+ Expr *pE2 = sqlite3ExprSkipCollateAndLikely(pE);
if( zType[0]!='G' ){
iCol = resolveAsName(pParse, pSelect->pEList, pE2);
if( iCol>0 ){
@@ -96790,7 +97096,7 @@ static int resolveOrderGroupBy(
/* Since this expresion is being changed into a reference
** to an identical expression in the result set, remove all Window
** objects belonging to the expression from the Select.pWin list. */
- resolveRemoveWindows(pSelect, pE);
+ windowRemoveExprFromSelect(pSelect, pE);
pItem->u.x.iOrderByCol = j+1;
}
}
@@ -97258,7 +97564,6 @@ SQLITE_PRIVATE char sqlite3TableColumnAffinity(Table *pTab, int iCol){
*/
SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
int op;
- if( pExpr->flags & EP_Generic ) return 0;
while( ExprHasProperty(pExpr, EP_Skip) ){
assert( pExpr->op==TK_COLLATE );
pExpr = pExpr->pLeft;
@@ -97285,7 +97590,7 @@ SQLITE_PRIVATE char sqlite3ExprAffinity(Expr *pExpr){
pExpr->pLeft->x.pSelect->pEList->a[pExpr->iColumn].pExpr
);
}
- return pExpr->affinity;
+ return pExpr->affExpr;
}
/*
@@ -97320,10 +97625,22 @@ SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(Parse *pParse, Expr *pExpr, con
}
/*
-** Skip over any TK_COLLATE operators and any unlikely()
-** or likelihood() function at the root of an expression.
+** Skip over any TK_COLLATE operators.
*/
SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
+ while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
+ assert( pExpr->op==TK_COLLATE );
+ pExpr = pExpr->pLeft;
+ }
+ return pExpr;
+}
+
+/*
+** Skip over any TK_COLLATE operators and/or any unlikely()
+** or likelihood() or likely() functions at the root of an
+** expression.
+*/
+SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr *pExpr){
while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){
if( ExprHasProperty(pExpr, EP_Unlikely) ){
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
@@ -97358,7 +97675,6 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
Expr *p = pExpr;
while( p ){
int op = p->op;
- if( p->flags & EP_Generic ) break;
if( op==TK_REGISTER ) op = p->op2;
if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_TRIGGER)
&& p->y.pTab!=0
@@ -97444,7 +97760,7 @@ SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse *pParse, Expr *pE1, Expr *pE2){
*/
SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){
char aff1 = sqlite3ExprAffinity(pExpr);
- if( aff1 && aff2 ){
+ if( aff1>SQLITE_AFF_NONE && aff2>SQLITE_AFF_NONE ){
/* Both sides of the comparison are columns. If one has numeric
** affinity, use that. Otherwise use no affinity.
*/
@@ -97453,15 +97769,10 @@ SQLITE_PRIVATE char sqlite3CompareAffinity(Expr *pExpr, char aff2){
}else{
return SQLITE_AFF_BLOB;
}
- }else if( !aff1 && !aff2 ){
- /* Neither side of the comparison is a column. Compare the
- ** results directly.
- */
- return SQLITE_AFF_BLOB;
}else{
/* One side is a column, the other is not. Use the columns affinity. */
- assert( aff1==0 || aff2==0 );
- return (aff1 + aff2);
+ assert( aff1<=SQLITE_AFF_NONE || aff2<=SQLITE_AFF_NONE );
+ return (aff1<=SQLITE_AFF_NONE ? aff2 : aff1) | SQLITE_AFF_NONE;
}
}
@@ -97494,14 +97805,13 @@ static char comparisonAffinity(Expr *pExpr){
*/
SQLITE_PRIVATE int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){
char aff = comparisonAffinity(pExpr);
- switch( aff ){
- case SQLITE_AFF_BLOB:
- return 1;
- case SQLITE_AFF_TEXT:
- return idx_affinity==SQLITE_AFF_TEXT;
- default:
- return sqlite3IsNumericAffinity(idx_affinity);
+ if( aff<SQLITE_AFF_TEXT ){
+ return 1;
+ }
+ if( aff==SQLITE_AFF_TEXT ){
+ return idx_affinity==SQLITE_AFF_TEXT;
}
+ return sqlite3IsNumericAffinity(idx_affinity);
}
/*
@@ -98115,7 +98425,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){
}else if( ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight) ){
sqlite3ExprUnmapAndDelete(pParse, pLeft);
sqlite3ExprUnmapAndDelete(pParse, pRight);
- return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0);
+ return sqlite3Expr(db, TK_INTEGER, "0");
}else{
return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
}
@@ -98254,15 +98564,18 @@ static SQLITE_NOINLINE void sqlite3ExprDeleteNN(sqlite3 *db, Expr *p){
assert( p->x.pList==0 || p->pRight==0 );
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
if( p->pRight ){
+ assert( !ExprHasProperty(p, EP_WinFunc) );
sqlite3ExprDeleteNN(db, p->pRight);
}else if( ExprHasProperty(p, EP_xIsSelect) ){
+ assert( !ExprHasProperty(p, EP_WinFunc) );
sqlite3SelectDelete(db, p->x.pSelect);
}else{
sqlite3ExprListDelete(db, p->x.pList);
- }
- if( ExprHasProperty(p, EP_WinFunc) ){
- assert( p->op==TK_FUNCTION );
- sqlite3WindowDelete(db, p->y.pWin);
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ if( ExprHasProperty(p, EP_WinFunc) ){
+ sqlite3WindowDelete(db, p->y.pWin);
+ }
+#endif
}
}
if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
@@ -98298,16 +98611,6 @@ static int exprStructSize(Expr *p){
}
/*
-** Copy the complete content of an Expr node, taking care not to read
-** past the end of the structure for a reduced-size version of the source
-** Expr.
-*/
-static void exprNodeCopy(Expr *pDest, Expr *pSrc){
- memset(pDest, 0, sizeof(Expr));
- memcpy(pDest, pSrc, exprStructSize(pSrc));
-}
-
-/*
** The dupedExpr*Size() routines each return the number of bytes required
** to store a copy of an expression or expression tree. They differ in
** how much of the tree is measured.
@@ -98546,10 +98849,13 @@ static With *withDup(sqlite3 *db, With *p){
** objects found there, assembling them onto the linked list at Select->pWin.
*/
static int gatherSelectWindowsCallback(Walker *pWalker, Expr *pExpr){
- if( pExpr->op==TK_FUNCTION && pExpr->y.pWin!=0 ){
- assert( ExprHasProperty(pExpr, EP_WinFunc) );
- pExpr->y.pWin->pNextWin = pWalker->u.pSelect->pWin;
- pWalker->u.pSelect->pWin = pExpr->y.pWin;
+ if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_WinFunc) ){
+ Select *pSelect = pWalker->u.pSelect;
+ Window *pWin = pExpr->y.pWin;
+ assert( pWin );
+ assert( IsWindowFunc(pExpr) );
+ assert( pWin->ppThis==0 );
+ sqlite3WindowLink(pSelect, pWin);
}
return WRC_Continue;
}
@@ -98623,8 +98929,9 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags)
}
pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
pItem->zSpan = sqlite3DbStrDup(db, pOldItem->zSpan);
- pItem->sortOrder = pOldItem->sortOrder;
+ pItem->sortFlags = pOldItem->sortFlags;
pItem->done = 0;
+ pItem->bNulls = pOldItem->bNulls;
pItem->bSpanIsTab = pOldItem->bSpanIsTab;
pItem->bSorterRef = pOldItem->bSorterRef;
pItem->u = pOldItem->u;
@@ -98735,7 +99042,7 @@ SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *pDup, int flags){
#ifndef SQLITE_OMIT_WINDOWFUNC
pNew->pWin = 0;
pNew->pWinDefn = sqlite3WindowListDup(db, p->pWinDefn);
- if( p->pWin ) gatherSelectWindows(pNew);
+ if( p->pWin && db->mallocFailed==0 ) gatherSelectWindows(pNew);
#endif
pNew->selId = p->selId;
*pp = pNew;
@@ -98844,6 +99151,10 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(
for(i=0; i<pColumns->nId; i++){
Expr *pSubExpr = sqlite3ExprForVectorField(pParse, pExpr, i);
+ assert( pSubExpr!=0 || db->mallocFailed );
+ assert( pSubExpr==0 || pSubExpr->iTable==0 );
+ if( pSubExpr==0 ) continue;
+ pSubExpr->iTable = pColumns->nId;
pList = sqlite3ExprListAppend(pParse, pList, pSubExpr);
if( pList ){
assert( pList->nExpr==iFirst+i+1 );
@@ -98876,15 +99187,34 @@ vector_append_error:
/*
** Set the sort order for the last element on the given ExprList.
*/
-SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList *p, int iSortOrder){
+SQLITE_PRIVATE void sqlite3ExprListSetSortOrder(ExprList *p, int iSortOrder, int eNulls){
+ struct ExprList_item *pItem;
if( p==0 ) return;
- assert( SQLITE_SO_UNDEFINED<0 && SQLITE_SO_ASC>=0 && SQLITE_SO_DESC>0 );
assert( p->nExpr>0 );
- if( iSortOrder<0 ){
- assert( p->a[p->nExpr-1].sortOrder==SQLITE_SO_ASC );
- return;
+
+ assert( SQLITE_SO_UNDEFINED<0 && SQLITE_SO_ASC==0 && SQLITE_SO_DESC>0 );
+ assert( iSortOrder==SQLITE_SO_UNDEFINED
+ || iSortOrder==SQLITE_SO_ASC
+ || iSortOrder==SQLITE_SO_DESC
+ );
+ assert( eNulls==SQLITE_SO_UNDEFINED
+ || eNulls==SQLITE_SO_ASC
+ || eNulls==SQLITE_SO_DESC
+ );
+
+ pItem = &p->a[p->nExpr-1];
+ assert( pItem->bNulls==0 );
+ if( iSortOrder==SQLITE_SO_UNDEFINED ){
+ iSortOrder = SQLITE_SO_ASC;
+ }
+ pItem->sortFlags = (u8)iSortOrder;
+
+ if( eNulls!=SQLITE_SO_UNDEFINED ){
+ pItem->bNulls = 1;
+ if( iSortOrder!=eNulls ){
+ pItem->sortFlags |= KEYINFO_ORDER_BIGNULL;
+ }
}
- p->a[p->nExpr-1].sortOrder = (u8)iSortOrder;
}
/*
@@ -99383,27 +99713,30 @@ SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr *p){
*/
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr *p, char aff){
u8 op;
+ int unaryMinus = 0;
if( aff==SQLITE_AFF_BLOB ) return 1;
- while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; }
+ while( p->op==TK_UPLUS || p->op==TK_UMINUS ){
+ if( p->op==TK_UMINUS ) unaryMinus = 1;
+ p = p->pLeft;
+ }
op = p->op;
if( op==TK_REGISTER ) op = p->op2;
switch( op ){
case TK_INTEGER: {
- return aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC;
+ return aff>=SQLITE_AFF_NUMERIC;
}
case TK_FLOAT: {
- return aff==SQLITE_AFF_REAL || aff==SQLITE_AFF_NUMERIC;
+ return aff>=SQLITE_AFF_NUMERIC;
}
case TK_STRING: {
- return aff==SQLITE_AFF_TEXT;
+ return !unaryMinus && aff==SQLITE_AFF_TEXT;
}
case TK_BLOB: {
- return 1;
+ return !unaryMinus;
}
case TK_COLUMN: {
assert( p->iTable>=0 ); /* p cannot be part of a CHECK constraint */
- return p->iColumn<0
- && (aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC);
+ return aff>=SQLITE_AFF_NUMERIC && p->iColumn<0;
}
default: {
return 0;
@@ -99586,7 +99919,7 @@ static int sqlite3InRhsIsConstant(Expr *pIn){
#ifndef SQLITE_OMIT_SUBQUERY
SQLITE_PRIVATE int sqlite3FindInIndex(
Parse *pParse, /* Parsing context */
- Expr *pX, /* The right-hand side (RHS) of the IN operator */
+ Expr *pX, /* The IN expression */
u32 inFlags, /* IN_INDEX_LOOP, _MEMBERSHIP, and/or _NOOP_OK */
int *prRhsHasNull, /* Register holding NULL status. See notes */
int *aiMap, /* Mapping from Index fields to RHS fields */
@@ -100011,9 +100344,9 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
int i;
ExprList *pList = pExpr->x.pList;
struct ExprList_item *pItem;
- int r1, r2, r3;
+ int r1, r2;
affinity = sqlite3ExprAffinity(pLeft);
- if( !affinity ){
+ if( affinity<=SQLITE_AFF_NONE ){
affinity = SQLITE_AFF_BLOB;
}
if( pKeyInfo ){
@@ -100039,9 +100372,9 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
}
/* Evaluate the expression and insert it into the temp table */
- r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
- sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
- sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
+ sqlite3ExprCode(pParse, pE2, r1);
+ sqlite3VdbeAddOp4(v, OP_MakeRecord, r1, 1, r2, &affinity, 1);
+ sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r1, 1);
}
sqlite3ReleaseTempReg(pParse, r1);
sqlite3ReleaseTempReg(pParse, r2);
@@ -100054,6 +100387,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
/* Subroutine return */
sqlite3VdbeAddOp1(v, OP_Return, pExpr->y.sub.regReturn);
sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1);
+ sqlite3ClearTempRegCache(pParse);
}
}
#endif /* SQLITE_OMIT_SUBQUERY */
@@ -100067,7 +100401,7 @@ SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
**
** The pExpr parameter is the SELECT or EXISTS operator to be coded.
**
-** The register that holds the result. For a multi-column SELECT,
+** Return the register that holds the result. For a multi-column SELECT,
** the result is stored in a contiguous array of registers and the
** return value is the register of the left-most result column.
** Return 0 if an error occurs.
@@ -100145,11 +100479,21 @@ SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
VdbeComment((v, "Init EXISTS result"));
}
- pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[1], 0);
if( pSel->pLimit ){
- sqlite3ExprDelete(pParse->db, pSel->pLimit->pLeft);
+ /* The subquery already has a limit. If the pre-existing limit is X
+ ** then make the new limit X<>0 so that the new limit is either 1 or 0 */
+ sqlite3 *db = pParse->db;
+ pLimit = sqlite3Expr(db, TK_INTEGER, "0");
+ if( pLimit ){
+ pLimit->affExpr = SQLITE_AFF_NUMERIC;
+ pLimit = sqlite3PExpr(pParse, TK_NE,
+ sqlite3ExprDup(db, pSel->pLimit->pLeft, 0), pLimit);
+ }
+ sqlite3ExprDelete(db, pSel->pLimit->pLeft);
pSel->pLimit->pLeft = pLimit;
}else{
+ /* If there is no pre-existing limit add a limit of 1 */
+ pLimit = sqlite3Expr(pParse->db, TK_INTEGER, "1");
pSel->pLimit = sqlite3PExpr(pParse, TK_LIMIT, pLimit, 0);
}
pSel->iLimit = 0;
@@ -100164,6 +100508,7 @@ SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
/* Subroutine return */
sqlite3VdbeAddOp1(v, OP_Return, pExpr->y.sub.regReturn);
sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1);
+ sqlite3ClearTempRegCache(pParse);
}
return rReg;
@@ -100311,13 +100656,21 @@ static void sqlite3ExprCodeIN(
int r2, regToFree;
int regCkNull = 0;
int ii;
+ int bLhsReal; /* True if the LHS of the IN has REAL affinity */
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
if( destIfNull!=destIfFalse ){
regCkNull = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp3(v, OP_BitAnd, rLhs, rLhs, regCkNull);
}
+ bLhsReal = sqlite3ExprAffinity(pExpr->pLeft)==SQLITE_AFF_REAL;
for(ii=0; ii<pList->nExpr; ii++){
- r2 = sqlite3ExprCodeTemp(pParse, pList->a[ii].pExpr, &regToFree);
+ if( bLhsReal ){
+ r2 = regToFree = sqlite3GetTempReg(pParse);
+ sqlite3ExprCode(pParse, pList->a[ii].pExpr, r2);
+ sqlite3VdbeAddOp4(v, OP_Affinity, r2, 1, 0, "E", P4_STATIC);
+ }else{
+ r2 = sqlite3ExprCodeTemp(pParse, pList->a[ii].pExpr, &regToFree);
+ }
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){
sqlite3VdbeAddOp3(v, OP_BitAnd, regCkNull, r2, regCkNull);
}
@@ -100602,7 +100955,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iTo, int n
** the correct value for the expression.
*/
static void exprToRegister(Expr *pExpr, int iReg){
- Expr *p = sqlite3ExprSkipCollate(pExpr);
+ Expr *p = sqlite3ExprSkipCollateAndLikely(pExpr);
p->op2 = p->op;
p->op = TK_REGISTER;
p->iTable = iReg;
@@ -100703,7 +101056,7 @@ expr_code_doover:
*/
int iReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft,target);
int aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn);
- if( aff!=SQLITE_AFF_BLOB ){
+ if( aff>SQLITE_AFF_BLOB ){
static const char zAff[] = "B\000C\000D\000E";
assert( SQLITE_AFF_BLOB=='A' );
assert( SQLITE_AFF_TEXT=='B' );
@@ -100719,7 +101072,19 @@ expr_code_doover:
if( iTab<0 ){
if( pParse->iSelfTab<0 ){
/* Generating CHECK constraints or inserting into partial index */
- return pExpr->iColumn - pParse->iSelfTab;
+ assert( pExpr->y.pTab!=0 );
+ assert( pExpr->iColumn>=XN_ROWID );
+ assert( pExpr->iColumn<pExpr->y.pTab->nCol );
+ if( pExpr->iColumn>=0
+ && pExpr->y.pTab->aCol[pExpr->iColumn].affinity==SQLITE_AFF_REAL
+ ){
+ sqlite3VdbeAddOp2(v, OP_SCopy, pExpr->iColumn - pParse->iSelfTab,
+ target);
+ sqlite3VdbeAddOp1(v, OP_RealAffinity, target);
+ return target;
+ }else{
+ return pExpr->iColumn - pParse->iSelfTab;
+ }
}else{
/* Coding an expression that is part of an index where column names
** in the index refer to the table to which the index belongs */
@@ -101006,7 +101371,7 @@ expr_code_doover:
assert( nFarg==1 );
aff = sqlite3ExprAffinity(pFarg->a[0].pExpr);
sqlite3VdbeLoadString(v, target,
- aff ? azAff[aff-SQLITE_AFF_BLOB] : "none");
+ (aff<=SQLITE_AFF_NONE) ? "none" : azAff[aff-SQLITE_AFF_BLOB]);
return target;
}
#endif
@@ -101114,8 +101479,8 @@ expr_code_doover:
pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft);
}
assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT );
- if( pExpr->iTable
- && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft))
+ if( pExpr->iTable!=0
+ && pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft))
){
sqlite3ErrorMsg(pParse, "%d columns assigned %d values",
pExpr->iTable, n);
@@ -101218,10 +101583,23 @@ expr_code_doover:
break;
}
+ /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions
+ ** that derive from the right-hand table of a LEFT JOIN. The
+ ** Expr.iTable value is the table number for the right-hand table.
+ ** The expression is only evaluated if that table is not currently
+ ** on a LEFT JOIN NULL row.
+ */
case TK_IF_NULL_ROW: {
int addrINR;
+ u8 okConstFactor = pParse->okConstFactor;
addrINR = sqlite3VdbeAddOp1(v, OP_IfNullRow, pExpr->iTable);
+ /* Temporarily disable factoring of constant expressions, since
+ ** even though expressions may appear to be constant, they are not
+ ** really constant because they originate from the right-hand side
+ ** of a LEFT JOIN. */
+ pParse->okConstFactor = 0;
inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target);
+ pParse->okConstFactor = okConstFactor;
sqlite3VdbeJumpHere(v, addrINR);
sqlite3VdbeChangeP3(v, addrINR, inReg);
break;
@@ -101258,6 +101636,8 @@ expr_code_doover:
Expr opCompare; /* The X==Ei expression */
Expr *pX; /* The X expression */
Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */
+ Expr *pDel = 0;
+ sqlite3 *db = pParse->db;
assert( !ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList );
assert(pExpr->x.pList->nExpr > 0);
@@ -101266,13 +101646,17 @@ expr_code_doover:
nExpr = pEList->nExpr;
endLabel = sqlite3VdbeMakeLabel(pParse);
if( (pX = pExpr->pLeft)!=0 ){
- exprNodeCopy(&tempX, pX);
+ pDel = sqlite3ExprDup(db, pX, 0);
+ if( db->mallocFailed ){
+ sqlite3ExprDelete(db, pDel);
+ break;
+ }
testcase( pX->op==TK_COLUMN );
- exprToRegister(&tempX, exprCodeVector(pParse, &tempX, &regFree1));
+ exprToRegister(pDel, exprCodeVector(pParse, pDel, &regFree1));
testcase( regFree1==0 );
memset(&opCompare, 0, sizeof(opCompare));
opCompare.op = TK_EQ;
- opCompare.pLeft = &tempX;
+ opCompare.pLeft = pDel;
pTest = &opCompare;
/* Ticket b351d95f9cd5ef17e9d9dbae18f5ca8611190001:
** The value in regFree1 might get SCopy-ed into the file result.
@@ -101300,32 +101684,33 @@ expr_code_doover:
}else{
sqlite3VdbeAddOp2(v, OP_Null, 0, target);
}
+ sqlite3ExprDelete(db, pDel);
sqlite3VdbeResolveLabel(v, endLabel);
break;
}
#ifndef SQLITE_OMIT_TRIGGER
case TK_RAISE: {
- assert( pExpr->affinity==OE_Rollback
- || pExpr->affinity==OE_Abort
- || pExpr->affinity==OE_Fail
- || pExpr->affinity==OE_Ignore
+ assert( pExpr->affExpr==OE_Rollback
+ || pExpr->affExpr==OE_Abort
+ || pExpr->affExpr==OE_Fail
+ || pExpr->affExpr==OE_Ignore
);
if( !pParse->pTriggerTab ){
sqlite3ErrorMsg(pParse,
"RAISE() may only be used within a trigger-program");
return 0;
}
- if( pExpr->affinity==OE_Abort ){
+ if( pExpr->affExpr==OE_Abort ){
sqlite3MayAbort(pParse);
}
assert( !ExprHasProperty(pExpr, EP_IntValue) );
- if( pExpr->affinity==OE_Ignore ){
+ if( pExpr->affExpr==OE_Ignore ){
sqlite3VdbeAddOp4(
v, OP_Halt, SQLITE_OK, OE_Ignore, 0, pExpr->u.zToken,0);
VdbeCoverage(v);
}else{
sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_TRIGGER,
- pExpr->affinity, pExpr->u.zToken, 0, 0);
+ pExpr->affExpr, pExpr->u.zToken, 0, 0);
}
break;
@@ -101390,7 +101775,7 @@ SQLITE_PRIVATE int sqlite3ExprCodeAtInit(
*/
SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *pReg){
int r2;
- pExpr = sqlite3ExprSkipCollate(pExpr);
+ pExpr = sqlite3ExprSkipCollateAndLikely(pExpr);
if( ConstFactorOk(pParse)
&& pExpr->op!=TK_REGISTER
&& sqlite3ExprIsConstantNotJoin(pExpr)
@@ -101581,40 +101966,44 @@ static void exprCodeBetween(
void (*xJump)(Parse*,Expr*,int,int), /* Action to take */
int jumpIfNull /* Take the jump if the BETWEEN is NULL */
){
- Expr exprAnd; /* The AND operator in x>=y AND x<=z */
+ Expr exprAnd; /* The AND operator in x>=y AND x<=z */
Expr compLeft; /* The x>=y term */
Expr compRight; /* The x<=z term */
- Expr exprX; /* The x subexpression */
int regFree1 = 0; /* Temporary use register */
+ Expr *pDel = 0;
+ sqlite3 *db = pParse->db;
memset(&compLeft, 0, sizeof(Expr));
memset(&compRight, 0, sizeof(Expr));
memset(&exprAnd, 0, sizeof(Expr));
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
- exprNodeCopy(&exprX, pExpr->pLeft);
- exprAnd.op = TK_AND;
- exprAnd.pLeft = &compLeft;
- exprAnd.pRight = &compRight;
- compLeft.op = TK_GE;
- compLeft.pLeft = &exprX;
- compLeft.pRight = pExpr->x.pList->a[0].pExpr;
- compRight.op = TK_LE;
- compRight.pLeft = &exprX;
- compRight.pRight = pExpr->x.pList->a[1].pExpr;
- exprToRegister(&exprX, exprCodeVector(pParse, &exprX, &regFree1));
- if( xJump ){
- xJump(pParse, &exprAnd, dest, jumpIfNull);
- }else{
- /* Mark the expression is being from the ON or USING clause of a join
- ** so that the sqlite3ExprCodeTarget() routine will not attempt to move
- ** it into the Parse.pConstExpr list. We should use a new bit for this,
- ** for clarity, but we are out of bits in the Expr.flags field so we
- ** have to reuse the EP_FromJoin bit. Bummer. */
- exprX.flags |= EP_FromJoin;
- sqlite3ExprCodeTarget(pParse, &exprAnd, dest);
+ pDel = sqlite3ExprDup(db, pExpr->pLeft, 0);
+ if( db->mallocFailed==0 ){
+ exprAnd.op = TK_AND;
+ exprAnd.pLeft = &compLeft;
+ exprAnd.pRight = &compRight;
+ compLeft.op = TK_GE;
+ compLeft.pLeft = pDel;
+ compLeft.pRight = pExpr->x.pList->a[0].pExpr;
+ compRight.op = TK_LE;
+ compRight.pLeft = pDel;
+ compRight.pRight = pExpr->x.pList->a[1].pExpr;
+ exprToRegister(pDel, exprCodeVector(pParse, pDel, &regFree1));
+ if( xJump ){
+ xJump(pParse, &exprAnd, dest, jumpIfNull);
+ }else{
+ /* Mark the expression is being from the ON or USING clause of a join
+ ** so that the sqlite3ExprCodeTarget() routine will not attempt to move
+ ** it into the Parse.pConstExpr list. We should use a new bit for this,
+ ** for clarity, but we are out of bits in the Expr.flags field so we
+ ** have to reuse the EP_FromJoin bit. Bummer. */
+ pDel->flags |= EP_FromJoin;
+ sqlite3ExprCodeTarget(pParse, &exprAnd, dest);
+ }
+ sqlite3ReleaseTempReg(pParse, regFree1);
}
- sqlite3ReleaseTempReg(pParse, regFree1);
+ sqlite3ExprDelete(db, pDel);
/* Ensure adequate test coverage */
testcase( xJump==sqlite3ExprIfTrue && jumpIfNull==0 && regFree1==0 );
@@ -102053,20 +102442,17 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTa
return 2;
}
if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){
- if( pA->op==TK_FUNCTION ){
+ if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
#ifndef SQLITE_OMIT_WINDOWFUNC
- /* Justification for the assert():
- ** window functions have p->op==TK_FUNCTION but aggregate functions
- ** have p->op==TK_AGG_FUNCTION. So any comparison between an aggregate
- ** function and a window function should have failed before reaching
- ** this point. And, it is not possible to have a window function and
- ** a scalar function with the same name and number of arguments. So
- ** if we reach this point, either A and B both window functions or
- ** neither are a window functions. */
- assert( ExprHasProperty(pA,EP_WinFunc)==ExprHasProperty(pB,EP_WinFunc) );
+ assert( pA->op==pB->op );
+ if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){
+ return 2;
+ }
if( ExprHasProperty(pA,EP_WinFunc) ){
- if( sqlite3WindowCompare(pParse,pA->y.pWin,pB->y.pWin)!=0 ) return 2;
+ if( sqlite3WindowCompare(pParse, pA->y.pWin, pB->y.pWin, 1)!=0 ){
+ return 2;
+ }
}
#endif
}else if( pA->op==TK_NULL ){
@@ -102090,7 +102476,8 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTa
){
if( pA->iColumn!=pB->iColumn ) return 2;
if( pA->op2!=pB->op2 ) return 2;
- if( pA->iTable!=pB->iTable
+ if( pA->op!=TK_IN
+ && pA->iTable!=pB->iTable
&& (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2;
}
}
@@ -102120,7 +102507,7 @@ SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList *pA, ExprList *pB, int iTab){
for(i=0; i<pA->nExpr; i++){
Expr *pExprA = pA->a[i].pExpr;
Expr *pExprB = pB->a[i].pExpr;
- if( pA->a[i].sortOrder!=pB->a[i].sortOrder ) return 1;
+ if( pA->a[i].sortFlags!=pB->a[i].sortFlags ) return 1;
if( sqlite3ExprCompare(0, pExprA, pExprB, iTab) ) return 1;
}
return 0;
@@ -102132,42 +102519,47 @@ SQLITE_PRIVATE int sqlite3ExprListCompare(ExprList *pA, ExprList *pB, int iTab){
*/
SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr *pA, Expr *pB, int iTab){
return sqlite3ExprCompare(0,
- sqlite3ExprSkipCollate(pA),
- sqlite3ExprSkipCollate(pB),
+ sqlite3ExprSkipCollateAndLikely(pA),
+ sqlite3ExprSkipCollateAndLikely(pB),
iTab);
}
/*
** Return non-zero if Expr p can only be true if pNN is not NULL.
+**
+** Or if seenNot is true, return non-zero if Expr p can only be
+** non-NULL if pNN is not NULL
*/
static int exprImpliesNotNull(
Parse *pParse, /* Parsing context */
Expr *p, /* The expression to be checked */
Expr *pNN, /* The expression that is NOT NULL */
int iTab, /* Table being evaluated */
- int seenNot /* True if p is an operand of NOT */
+ int seenNot /* Return true only if p can be any non-NULL value */
){
assert( p );
assert( pNN );
- if( sqlite3ExprCompare(pParse, p, pNN, iTab)==0 ) return 1;
+ if( sqlite3ExprCompare(pParse, p, pNN, iTab)==0 ){
+ return pNN->op!=TK_NULL;
+ }
switch( p->op ){
case TK_IN: {
if( seenNot && ExprHasProperty(p, EP_xIsSelect) ) return 0;
assert( ExprHasProperty(p,EP_xIsSelect)
|| (p->x.pList!=0 && p->x.pList->nExpr>0) );
- return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, seenNot);
+ return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, 1);
}
case TK_BETWEEN: {
ExprList *pList = p->x.pList;
assert( pList!=0 );
assert( pList->nExpr==2 );
if( seenNot ) return 0;
- if( exprImpliesNotNull(pParse, pList->a[0].pExpr, pNN, iTab, seenNot)
- || exprImpliesNotNull(pParse, pList->a[1].pExpr, pNN, iTab, seenNot)
+ if( exprImpliesNotNull(pParse, pList->a[0].pExpr, pNN, iTab, 1)
+ || exprImpliesNotNull(pParse, pList->a[1].pExpr, pNN, iTab, 1)
){
return 1;
}
- return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, seenNot);
+ return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, 1);
}
case TK_EQ:
case TK_NE:
@@ -102177,20 +102569,21 @@ static int exprImpliesNotNull(
case TK_GE:
case TK_PLUS:
case TK_MINUS:
- case TK_STAR:
- case TK_REM:
- case TK_BITAND:
case TK_BITOR:
- case TK_SLASH:
case TK_LSHIFT:
case TK_RSHIFT:
- case TK_CONCAT: {
+ case TK_CONCAT:
+ seenNot = 1;
+ /* Fall thru */
+ case TK_STAR:
+ case TK_REM:
+ case TK_BITAND:
+ case TK_SLASH: {
if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1;
/* Fall thru into the next case */
}
case TK_SPAN:
case TK_COLLATE:
- case TK_BITNOT:
case TK_UPLUS:
case TK_UMINUS: {
return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, seenNot);
@@ -102198,8 +102591,9 @@ static int exprImpliesNotNull(
case TK_TRUTH: {
if( seenNot ) return 0;
if( p->op2!=TK_IS ) return 0;
- return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, seenNot);
+ return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, 1);
}
+ case TK_BITNOT:
case TK_NOT: {
return exprImpliesNotNull(pParse, p->pLeft, pNN, iTab, 1);
}
@@ -102265,7 +102659,6 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
switch( pExpr->op ){
case TK_ISNOT:
- case TK_NOT:
case TK_ISNULL:
case TK_NOTNULL:
case TK_IS:
@@ -102273,8 +102666,8 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_CASE:
case TK_IN:
case TK_FUNCTION:
+ case TK_TRUTH:
testcase( pExpr->op==TK_ISNOT );
- testcase( pExpr->op==TK_NOT );
testcase( pExpr->op==TK_ISNULL );
testcase( pExpr->op==TK_NOTNULL );
testcase( pExpr->op==TK_IS );
@@ -102282,6 +102675,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
testcase( pExpr->op==TK_CASE );
testcase( pExpr->op==TK_IN );
testcase( pExpr->op==TK_FUNCTION );
+ testcase( pExpr->op==TK_TRUTH );
return WRC_Prune;
case TK_COLUMN:
if( pWalker->u.iCur==pExpr->iTable ){
@@ -102290,6 +102684,18 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
}
return WRC_Prune;
+ case TK_AND:
+ if( sqlite3ExprImpliesNonNullRow(pExpr->pLeft, pWalker->u.iCur)
+ && sqlite3ExprImpliesNonNullRow(pExpr->pRight, pWalker->u.iCur)
+ ){
+ pWalker->eCode = 1;
+ }
+ return WRC_Prune;
+
+ case TK_BETWEEN:
+ sqlite3WalkExpr(pWalker, pExpr->pLeft);
+ return WRC_Prune;
+
/* Virtual tables are allowed to use constraints like x=NULL. So
** a term of the form x=y does not prove that y is not null if x
** is the column of a virtual table */
@@ -102310,6 +102716,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
){
return WRC_Prune;
}
+
default:
return WRC_Continue;
}
@@ -102339,7 +102746,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
*/
SQLITE_PRIVATE int sqlite3ExprImpliesNonNullRow(Expr *p, int iTab){
Walker w;
- p = sqlite3ExprSkipCollate(p);
+ p = sqlite3ExprSkipCollateAndLikely(p);
while( p ){
if( p->op==TK_NOTNULL ){
p = p->pLeft;
@@ -102445,7 +102852,10 @@ static int exprSrcCount(Walker *pWalker, Expr *pExpr){
}
if( i<nSrc ){
p->nThis++;
- }else{
+ }else if( nSrc==0 || pExpr->iTable<pSrc->a[0].iCursor ){
+ /* In a well-formed parse tree (no name resolution errors),
+ ** TK_COLUMN nodes with smaller Expr.iTable values are in an
+ ** outer context. Those are the only ones to count as "other" */
p->nOther++;
}
}
@@ -102462,8 +102872,9 @@ SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr *pExpr, SrcList *pSrcList){
Walker w;
struct SrcCount cnt;
assert( pExpr->op==TK_AGG_FUNCTION );
+ memset(&w, 0, sizeof(w));
w.xExprCallback = exprSrcCount;
- w.xSelectCallback = 0;
+ w.xSelectCallback = sqlite3SelectWalkNoop;
w.u.pSrcCount = &cnt;
cnt.pSrc = pSrcList;
cnt.nThis = 0;
@@ -102732,6 +103143,11 @@ SQLITE_PRIVATE void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){
/*
** Mark all temporary registers as being unavailable for reuse.
+**
+** Always invoke this procedure after coding a subroutine or co-routine
+** that might be invoked from other parts of the code, to ensure that
+** the sub/co-routine does not use registers in common with the code that
+** invokes the sub/co-routine.
*/
SQLITE_PRIVATE void sqlite3ClearTempRegCache(Parse *pParse){
pParse->nTempReg = 0;
@@ -102901,8 +103317,8 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable(
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){
goto exit_rename_table;
}
- if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto
- exit_rename_table;
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse,zName,"table",zName) ){
+ goto exit_rename_table;
}
#ifndef SQLITE_OMIT_VIEW
@@ -103200,6 +103616,7 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
goto exit_begin_add_column;
}
+ sqlite3MayAbort(pParse);
assert( pTab->addColOffset>0 );
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
@@ -104463,13 +104880,13 @@ SQLITE_PRIVATE void sqlite3AlterFunctions(void){
** is between 3.6.18 and 3.7.8, inclusive, and unless SQLite is compiled
** with SQLITE_ENABLE_STAT2. The sqlite_stat2 table is deprecated.
** The sqlite_stat2 table is superseded by sqlite_stat3, which is only
-** created and used by SQLite versions 3.7.9 and later and with
+** created and used by SQLite versions 3.7.9 through 3.29.0 when
** SQLITE_ENABLE_STAT3 defined. The functionality of sqlite_stat3
-** is a superset of sqlite_stat2. The sqlite_stat4 is an enhanced
-** version of sqlite_stat3 and is only available when compiled with
-** SQLITE_ENABLE_STAT4 and in SQLite versions 3.8.1 and later. It is
-** not possible to enable both STAT3 and STAT4 at the same time. If they
-** are both enabled, then STAT4 takes precedence.
+** is a superset of sqlite_stat2 and is also now deprecated. The
+** sqlite_stat4 is an enhanced version of sqlite_stat3 and is only
+** available when compiled with SQLITE_ENABLE_STAT4 and in SQLite
+** versions 3.8.1 and later. STAT4 is the only variant that is still
+** supported.
**
** For most applications, sqlite_stat1 provides all the statistics required
** for the query planner to make good choices.
@@ -104580,17 +104997,11 @@ SQLITE_PRIVATE void sqlite3AlterFunctions(void){
#if defined(SQLITE_ENABLE_STAT4)
# define IsStat4 1
-# define IsStat3 0
-#elif defined(SQLITE_ENABLE_STAT3)
-# define IsStat4 0
-# define IsStat3 1
#else
# define IsStat4 0
-# define IsStat3 0
# undef SQLITE_STAT4_SAMPLES
# define SQLITE_STAT4_SAMPLES 1
#endif
-#define IsStat34 (IsStat3+IsStat4) /* 1 for STAT3 or STAT4. 0 otherwise */
/*
** This routine generates code that opens the sqlite_statN tables.
@@ -104619,14 +105030,10 @@ static void openStatTable(
{ "sqlite_stat1", "tbl,idx,stat" },
#if defined(SQLITE_ENABLE_STAT4)
{ "sqlite_stat4", "tbl,idx,neq,nlt,ndlt,sample" },
- { "sqlite_stat3", 0 },
-#elif defined(SQLITE_ENABLE_STAT3)
- { "sqlite_stat3", "tbl,idx,neq,nlt,ndlt,sample" },
- { "sqlite_stat4", 0 },
#else
- { "sqlite_stat3", 0 },
{ "sqlite_stat4", 0 },
#endif
+ { "sqlite_stat3", 0 },
};
int i;
sqlite3 *db = pParse->db;
@@ -104707,7 +105114,7 @@ typedef struct Stat4Sample Stat4Sample;
struct Stat4Sample {
tRowcnt *anEq; /* sqlite_stat4.nEq */
tRowcnt *anDLt; /* sqlite_stat4.nDLt */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
tRowcnt *anLt; /* sqlite_stat4.nLt */
union {
i64 iRowid; /* Rowid in main table of the key */
@@ -104738,7 +105145,7 @@ struct Stat4Accum {
/* Reclaim memory used by a Stat4Sample
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
static void sampleClear(sqlite3 *db, Stat4Sample *p){
assert( db!=0 );
if( p->nRowid ){
@@ -104750,7 +105157,7 @@ static void sampleClear(sqlite3 *db, Stat4Sample *p){
/* Initialize the BLOB value of a ROWID
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
static void sampleSetRowid(sqlite3 *db, Stat4Sample *p, int n, const u8 *pData){
assert( db!=0 );
if( p->nRowid ) sqlite3DbFree(db, p->u.aRowid);
@@ -104766,7 +105173,7 @@ static void sampleSetRowid(sqlite3 *db, Stat4Sample *p, int n, const u8 *pData){
/* Initialize the INTEGER value of a ROWID.
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
static void sampleSetRowidInt64(sqlite3 *db, Stat4Sample *p, i64 iRowid){
assert( db!=0 );
if( p->nRowid ) sqlite3DbFree(db, p->u.aRowid);
@@ -104779,7 +105186,7 @@ static void sampleSetRowidInt64(sqlite3 *db, Stat4Sample *p, i64 iRowid){
/*
** Copy the contents of object (*pFrom) into (*pTo).
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
static void sampleCopy(Stat4Accum *p, Stat4Sample *pTo, Stat4Sample *pFrom){
pTo->isPSample = pFrom->isPSample;
pTo->iCol = pFrom->iCol;
@@ -104800,7 +105207,7 @@ static void sampleCopy(Stat4Accum *p, Stat4Sample *pTo, Stat4Sample *pFrom){
*/
static void stat4Destructor(void *pOld){
Stat4Accum *p = (Stat4Accum*)pOld;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
int i;
for(i=0; i<p->nCol; i++) sampleClear(p->db, p->aBest+i);
for(i=0; i<p->mxSample; i++) sampleClear(p->db, p->a+i);
@@ -104820,7 +105227,7 @@ static void stat4Destructor(void *pOld){
** WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
** total number of columns in the table.
**
-** Note 2: C is only used for STAT3 and STAT4.
+** Note 2: C is only used for STAT4.
**
** For indexes on ordinary rowid tables, N==K+1. But for indexes on
** WITHOUT ROWID tables, N=K+P where P is the number of columns in the
@@ -104843,7 +105250,7 @@ static void statInit(
int nColUp; /* nCol rounded up for alignment */
int n; /* Bytes of space to allocate */
sqlite3 *db; /* Database connection */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
int mxSample = SQLITE_STAT4_SAMPLES;
#endif
@@ -104860,7 +105267,7 @@ static void statInit(
n = sizeof(*p)
+ sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */
+ sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
+ sizeof(tRowcnt)*nColUp /* Stat4Accum.anLt */
+ sizeof(Stat4Sample)*(nCol+mxSample) /* Stat4Accum.aBest[], a[] */
+ sizeof(tRowcnt)*3*nColUp*(nCol+mxSample)
@@ -104880,7 +105287,7 @@ static void statInit(
p->current.anDLt = (tRowcnt*)&p[1];
p->current.anEq = &p->current.anDLt[nColUp];
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
{
u8 *pSpace; /* Allocated space not yet assigned */
int i; /* Used to iterate through p->aSample[] */
@@ -104915,7 +105322,7 @@ static void statInit(
sqlite3_result_blob(context, p, sizeof(*p), stat4Destructor);
}
static const FuncDef statInitFuncdef = {
- 2+IsStat34, /* nArg */
+ 2+IsStat4, /* nArg */
SQLITE_UTF8, /* funcFlags */
0, /* pUserData */
0, /* pNext */
@@ -104955,7 +105362,7 @@ static int sampleIsBetterPost(
}
#endif
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** Return true if pNew is to be preferred over pOld.
**
@@ -104974,15 +105381,11 @@ static int sampleIsBetter(
assert( IsStat4 || (pNew->iCol==0 && pOld->iCol==0) );
if( (nEqNew>nEqOld) ) return 1;
-#ifdef SQLITE_ENABLE_STAT4
if( nEqNew==nEqOld ){
if( pNew->iCol<pOld->iCol ) return 1;
return (pNew->iCol==pOld->iCol && sampleIsBetterPost(pAccum, pNew, pOld));
}
return 0;
-#else
- return (nEqNew==nEqOld && pNew->iHash>pOld->iHash);
-#endif
}
/*
@@ -104995,7 +105398,6 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
assert( IsStat4 || nEqZero==0 );
-#ifdef SQLITE_ENABLE_STAT4
/* Stat4Accum.nMaxEqZero is set to the maximum number of leading 0
** values in the anEq[] array of any sample in Stat4Accum.a[]. In
** other words, if nMaxEqZero is n, then it is guaranteed that there
@@ -105029,7 +105431,6 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
goto find_new_min;
}
}
-#endif
/* If necessary, remove sample iMin to make room for the new sample. */
if( p->nSample>=p->mxSample ){
@@ -105050,10 +105451,8 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
/* The "rows less-than" for the rowid column must be greater than that
** for the last sample in the p->a[] array. Otherwise, the samples would
** be out of order. */
-#ifdef SQLITE_ENABLE_STAT4
assert( p->nSample==0
|| pNew->anLt[p->nCol-1] > p->a[p->nSample-1].anLt[p->nCol-1] );
-#endif
/* Insert the new sample */
pSample = &p->a[p->nSample];
@@ -105063,9 +105462,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
/* Zero the first nEqZero entries in the anEq[] array. */
memset(pSample->anEq, 0, sizeof(tRowcnt)*nEqZero);
-#ifdef SQLITE_ENABLE_STAT4
- find_new_min:
-#endif
+find_new_min:
if( p->nSample>=p->mxSample ){
int iMin = -1;
for(i=0; i<p->mxSample; i++){
@@ -105078,7 +105475,7 @@ static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
p->iMin = iMin;
}
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
/*
** Field iChng of the index being scanned has changed. So at this point
@@ -105119,28 +105516,7 @@ static void samplePushPrevious(Stat4Accum *p, int iChng){
}
#endif
-#if defined(SQLITE_ENABLE_STAT3) && !defined(SQLITE_ENABLE_STAT4)
- if( iChng==0 ){
- tRowcnt nLt = p->current.anLt[0];
- tRowcnt nEq = p->current.anEq[0];
-
- /* Check if this is to be a periodic sample. If so, add it. */
- if( (nLt/p->nPSample)!=(nLt+nEq)/p->nPSample ){
- p->current.isPSample = 1;
- sampleInsert(p, &p->current, 0);
- p->current.isPSample = 0;
- }else
-
- /* Or if it is a non-periodic sample. Add it in this case too. */
- if( p->nSample<p->mxSample
- || sampleIsBetter(p, &p->current, &p->a[p->iMin])
- ){
- sampleInsert(p, &p->current, 0);
- }
- }
-#endif
-
-#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifndef SQLITE_ENABLE_STAT4
UNUSED_PARAMETER( p );
UNUSED_PARAMETER( iChng );
#endif
@@ -105160,7 +105536,7 @@ static void samplePushPrevious(Stat4Accum *p, int iChng){
** index being analyzed. The stat_get() SQL function will later be used to
** extract relevant information for constructing the sqlite_statN tables.
**
-** The R parameter is only used for STAT3 and STAT4
+** The R parameter is only used for STAT4
*/
static void statPush(
sqlite3_context *context,
@@ -105192,14 +105568,14 @@ static void statPush(
}
for(i=iChng; i<p->nCol; i++){
p->current.anDLt[i]++;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
p->current.anLt[i] += p->current.anEq[i];
#endif
p->current.anEq[i] = 1;
}
}
p->nRow++;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( sqlite3_value_type(argv[2])==SQLITE_INTEGER ){
sampleSetRowidInt64(p->db, &p->current, sqlite3_value_int64(argv[2]));
}else{
@@ -105232,7 +105608,7 @@ static void statPush(
#endif
}
static const FuncDef statPushFuncdef = {
- 2+IsStat34, /* nArg */
+ 2+IsStat4, /* nArg */
SQLITE_UTF8, /* funcFlags */
0, /* pUserData */
0, /* pNext */
@@ -105263,7 +105639,7 @@ static const FuncDef statPushFuncdef = {
** parameter will always be a poiner to a Stat4Accum object, never a
** NULL.
**
-** If neither STAT3 nor STAT4 are enabled, then J is always
+** If STAT4 is not enabled, then J is always
** STAT_GET_STAT1 and is hence omitted and this routine becomes
** a one-parameter function, stat_get(P), that always returns the
** stat1 table entry information.
@@ -105274,8 +105650,8 @@ static void statGet(
sqlite3_value **argv
){
Stat4Accum *p = (Stat4Accum*)sqlite3_value_blob(argv[0]);
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
- /* STAT3 and STAT4 have a parameter on this routine. */
+#ifdef SQLITE_ENABLE_STAT4
+ /* STAT4 has a parameter on this routine. */
int eCall = sqlite3_value_int(argv[1]);
assert( argc==2 );
assert( eCall==STAT_GET_STAT1 || eCall==STAT_GET_NEQ
@@ -105330,7 +105706,7 @@ static void statGet(
sqlite3_result_text(context, zRet, -1, sqlite3_free);
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
else if( eCall==STAT_GET_ROWID ){
if( p->iGet<0 ){
samplePushPrevious(p, 0);
@@ -105359,9 +105735,7 @@ static void statGet(
}
}
- if( IsStat3 ){
- sqlite3_result_int64(context, (i64)aCnt[0]);
- }else{
+ {
char *zRet = sqlite3MallocZero(p->nCol * 25);
if( zRet==0 ){
sqlite3_result_error_nomem(context);
@@ -105378,13 +105752,13 @@ static void statGet(
}
}
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
#ifndef SQLITE_DEBUG
UNUSED_PARAMETER( argc );
#endif
}
static const FuncDef statGetFuncdef = {
- 1+IsStat34, /* nArg */
+ 1+IsStat4, /* nArg */
SQLITE_UTF8, /* funcFlags */
0, /* pUserData */
0, /* pNext */
@@ -105397,7 +105771,7 @@ static const FuncDef statGetFuncdef = {
static void callStatGet(Vdbe *v, int regStat4, int iParam, int regOut){
assert( regOut!=regStat4 && regOut!=regStat4+1 );
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
sqlite3VdbeAddOp2(v, OP_Integer, iParam, regStat4+1);
#elif SQLITE_DEBUG
assert( iParam==STAT_GET_STAT1 );
@@ -105406,7 +105780,7 @@ static void callStatGet(Vdbe *v, int regStat4, int iParam, int regOut){
#endif
sqlite3VdbeAddOp4(v, OP_Function0, 0, regStat4, regOut,
(char*)&statGetFuncdef, P4_FUNCDEF);
- sqlite3VdbeChangeP5(v, 1 + IsStat34);
+ sqlite3VdbeChangeP5(v, 1 + IsStat4);
}
/*
@@ -105433,7 +105807,7 @@ static void analyzeOneTable(
int regNewRowid = iMem++; /* Rowid for the inserted record */
int regStat4 = iMem++; /* Register to hold Stat4Accum object */
int regChng = iMem++; /* Index of changed index field */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
int regRowid = iMem++; /* Rowid argument passed to stat_push() */
#endif
int regTemp = iMem++; /* Temporary use register */
@@ -105567,16 +105941,16 @@ static void analyzeOneTable(
** (3) the number of rows in the index,
**
**
- ** The third argument is only used for STAT3 and STAT4
+ ** The third argument is only used for STAT4
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+3);
#endif
sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat4+1);
sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regStat4+2);
sqlite3VdbeAddOp4(v, OP_Function0, 0, regStat4+1, regStat4,
(char*)&statInitFuncdef, P4_FUNCDEF);
- sqlite3VdbeChangeP5(v, 2+IsStat34);
+ sqlite3VdbeChangeP5(v, 2+IsStat4);
/* Implementation of the following:
**
@@ -105647,12 +106021,12 @@ static void analyzeOneTable(
/*
** chng_addr_N:
- ** regRowid = idx(rowid) // STAT34 only
- ** stat_push(P, regChng, regRowid) // 3rd parameter STAT34 only
+ ** regRowid = idx(rowid) // STAT4 only
+ ** stat_push(P, regChng, regRowid) // 3rd parameter STAT4 only
** Next csr
** if !eof(csr) goto next_row;
*/
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
assert( regRowid==(regStat4+2) );
if( HasRowid(pTab) ){
sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid);
@@ -105673,7 +106047,7 @@ static void analyzeOneTable(
assert( regChng==(regStat4+1) );
sqlite3VdbeAddOp4(v, OP_Function0, 1, regStat4, regTemp,
(char*)&statPushFuncdef, P4_FUNCDEF);
- sqlite3VdbeChangeP5(v, 2+IsStat34);
+ sqlite3VdbeChangeP5(v, 2+IsStat4);
sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
/* Add the entry to the stat1 table. */
@@ -105687,8 +106061,8 @@ static void analyzeOneTable(
#endif
sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
- /* Add the entries to the stat3 or stat4 table. */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+ /* Add the entries to the stat4 table. */
+#ifdef SQLITE_ENABLE_STAT4
{
int regEq = regStat1;
int regLt = regStat1+1;
@@ -105711,21 +106085,17 @@ static void analyzeOneTable(
callStatGet(v, regStat4, STAT_GET_NDLT, regDLt);
sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
VdbeCoverage(v);
-#ifdef SQLITE_ENABLE_STAT3
- sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, 0, regSample);
-#else
for(i=0; i<nCol; i++){
sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, i, regCol+i);
}
sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol, regSample);
-#endif
sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp);
sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);
sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid);
sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */
sqlite3VdbeJumpHere(v, addrIsNull);
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
/* End of analysis */
sqlite3VdbeJumpHere(v, addrRewind);
@@ -105900,7 +106270,7 @@ static void decodeIntArray(
int i;
tRowcnt v;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( z==0 ) z = "";
#else
assert( z!=0 );
@@ -105911,7 +106281,7 @@ static void decodeIntArray(
v = v*10 + c - '0';
z++;
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( aOut ) aOut[i] = v;
if( aLog ) aLog[i] = sqlite3LogEst(v);
#else
@@ -105922,7 +106292,7 @@ static void decodeIntArray(
#endif
if( *z==' ' ) z++;
}
-#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifndef SQLITE_ENABLE_STAT4
assert( pIndex!=0 ); {
#else
if( pIndex ){
@@ -105989,7 +106359,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
if( pIndex ){
tRowcnt *aiRowEst = 0;
int nCol = pIndex->nKeyCol+1;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/* Index.aiRowEst may already be set here if there are duplicate
** sqlite_stat1 entries for this index. In that case just clobber
** the old data with the new instead of allocating a new array. */
@@ -106025,7 +106395,7 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
** and its contents.
*/
SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( pIdx->aSample ){
int j;
for(j=0; j<pIdx->nSample; j++){
@@ -106041,10 +106411,10 @@ SQLITE_PRIVATE void sqlite3DeleteIndexSamples(sqlite3 *db, Index *pIdx){
#else
UNUSED_PARAMETER(db);
UNUSED_PARAMETER(pIdx);
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** Populate the pIdx->aAvgEq[] array based on the samples currently
** stored in pIdx->aSample[].
@@ -106122,12 +106492,11 @@ static Index *findIndexOrPrimaryKey(
}
/*
-** Load the content from either the sqlite_stat4 or sqlite_stat3 table
+** Load the content from either the sqlite_stat4
** into the relevant Index.aSample[] arrays.
**
** Arguments zSql1 and zSql2 must point to SQL statements that return
-** data equivalent to the following (statements are different for stat3,
-** see the caller of this function for details):
+** data equivalent to the following:
**
** zSql1: SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx
** zSql2: SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4
@@ -106136,7 +106505,6 @@ static Index *findIndexOrPrimaryKey(
*/
static int loadStatTbl(
sqlite3 *db, /* Database handle */
- int bStat3, /* Assume single column records only */
const char *zSql1, /* SQL statement 1 (see above) */
const char *zSql2, /* SQL statement 2 (see above) */
const char *zDb /* Database name (e.g. "main") */
@@ -106170,17 +106538,13 @@ static int loadStatTbl(
if( zIndex==0 ) continue;
nSample = sqlite3_column_int(pStmt, 1);
pIdx = findIndexOrPrimaryKey(db, zIndex, zDb);
- assert( pIdx==0 || bStat3 || pIdx->nSample==0 );
- /* Index.nSample is non-zero at this point if data has already been
- ** loaded from the stat4 table. In this case ignore stat3 data. */
- if( pIdx==0 || pIdx->nSample ) continue;
- if( bStat3==0 ){
- assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
- if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
- nIdxCol = pIdx->nKeyCol;
- }else{
- nIdxCol = pIdx->nColumn;
- }
+ assert( pIdx==0 || pIdx->nSample==0 );
+ if( pIdx==0 ) continue;
+ assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
+ if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
+ nIdxCol = pIdx->nKeyCol;
+ }else{
+ nIdxCol = pIdx->nColumn;
}
pIdx->nSampleCol = nIdxCol;
nByte = sizeof(IndexSample) * nSample;
@@ -106222,9 +106586,8 @@ static int loadStatTbl(
pIdx = findIndexOrPrimaryKey(db, zIndex, zDb);
if( pIdx==0 ) continue;
/* This next condition is true if data has already been loaded from
- ** the sqlite_stat4 table. In this case ignore stat3 data. */
+ ** the sqlite_stat4 table. */
nCol = pIdx->nSampleCol;
- if( bStat3 && nCol>1 ) continue;
if( pIdx!=pPrevIdx ){
initAvgEq(pPrevIdx);
pPrevIdx = pIdx;
@@ -106257,7 +106620,7 @@ static int loadStatTbl(
}
/*
-** Load content from the sqlite_stat4 and sqlite_stat3 tables into
+** Load content from the sqlite_stat4 table into
** the Index.aSample[] arrays of all indices.
*/
static int loadStat4(sqlite3 *db, const char *zDb){
@@ -106265,37 +106628,28 @@ static int loadStat4(sqlite3 *db, const char *zDb){
assert( db->lookaside.bDisable );
if( sqlite3FindTable(db, "sqlite_stat4", zDb) ){
- rc = loadStatTbl(db, 0,
+ rc = loadStatTbl(db,
"SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx",
"SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4",
zDb
);
}
-
- if( rc==SQLITE_OK && sqlite3FindTable(db, "sqlite_stat3", zDb) ){
- rc = loadStatTbl(db, 1,
- "SELECT idx,count(*) FROM %Q.sqlite_stat3 GROUP BY idx",
- "SELECT idx,neq,nlt,ndlt,sqlite_record(sample) FROM %Q.sqlite_stat3",
- zDb
- );
- }
-
return rc;
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
/*
-** Load the content of the sqlite_stat1 and sqlite_stat3/4 tables. The
+** Load the content of the sqlite_stat1 and sqlite_stat4 tables. The
** contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
-** arrays. The contents of sqlite_stat3/4 are used to populate the
+** arrays. The contents of sqlite_stat4 are used to populate the
** Index.aSample[] arrays.
**
** If the sqlite_stat1 table is not present in the database, SQLITE_ERROR
-** is returned. In this case, even if SQLITE_ENABLE_STAT3/4 was defined
-** during compilation and the sqlite_stat3/4 table is present, no data is
+** is returned. In this case, even if SQLITE_ENABLE_STAT4 was defined
+** during compilation and the sqlite_stat4 table is present, no data is
** read from it.
**
-** If SQLITE_ENABLE_STAT3/4 was defined during compilation and the
+** If SQLITE_ENABLE_STAT4 was defined during compilation and the
** sqlite_stat4 table is not present in the database, SQLITE_ERROR is
** returned. However, in this case, data is read from the sqlite_stat1
** table (if it is present) before returning.
@@ -106323,7 +106677,7 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
Index *pIdx = sqliteHashData(i);
pIdx->hasStat1 = 0;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
sqlite3DeleteIndexSamples(db, pIdx);
pIdx->aSample = 0;
#endif
@@ -106351,7 +106705,7 @@ SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
}
/* Load the statistics from the sqlite_stat4 table. */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
if( rc==SQLITE_OK ){
db->lookaside.bDisable++;
rc = loadStat4(db, sInfo.zDatabase);
@@ -106676,6 +107030,7 @@ static void detachFunc(
sqlite3 *db = sqlite3_context_db_handle(context);
int i;
Db *pDb = 0;
+ HashElem *pEntry;
char zErr[128];
UNUSED_PARAMETER(NotUsed);
@@ -106700,6 +107055,18 @@ static void detachFunc(
goto detach_error;
}
+ /* If any TEMP triggers reference the schema being detached, move those
+ ** triggers to reference the TEMP schema itself. */
+ assert( db->aDb[1].pSchema );
+ pEntry = sqliteHashFirst(&db->aDb[1].pSchema->trigHash);
+ while( pEntry ){
+ Trigger *pTrig = (Trigger*)sqliteHashData(pEntry);
+ if( pTrig->pTabSchema==pDb->pSchema ){
+ pTrig->pTabSchema = pTrig->pSchema;
+ }
+ pEntry = sqliteHashNext(pEntry);
+ }
+
sqlite3BtreeClose(pDb->pBt);
pDb->pBt = 0;
pDb->pSchema = 0;
@@ -106937,6 +107304,7 @@ SQLITE_PRIVATE int sqlite3FixExpr(
Expr *pExpr /* The expression to be fixed to one database */
){
while( pExpr ){
+ ExprSetProperty(pExpr, EP_Indirect);
if( pExpr->op==TK_VARIABLE ){
if( pFix->pParse->db->init.busy ){
pExpr->op = TK_NULL;
@@ -107089,7 +107457,7 @@ SQLITE_API int sqlite3_set_authorizer(
sqlite3_mutex_enter(db->mutex);
db->xAuth = (sqlite3_xauth)xAuth;
db->pAuthArg = pArg;
- sqlite3ExpirePreparedStatements(db, 0);
+ if( db->xAuth ) sqlite3ExpirePreparedStatements(db, 1);
sqlite3_mutex_leave(db->mutex);
return SQLITE_OK;
}
@@ -107743,7 +108111,7 @@ SQLITE_PRIVATE void sqlite3FreeIndex(sqlite3 *db, Index *p){
sqlite3ExprListDelete(db, p->aColExpr);
sqlite3DbFree(db, p->zColAff);
if( p->isResized ) sqlite3DbFree(db, (void *)p->azColl);
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
sqlite3_free(p->aiRowEst);
#endif
sqlite3DbFree(db, p);
@@ -108116,13 +108484,40 @@ SQLITE_PRIVATE int sqlite3WritableSchema(sqlite3 *db){
** trigger). All names are legal except those that begin with the string
** "sqlite_" (in upper, lower or mixed case). This portion of the namespace
** is reserved for internal use.
+**
+** When parsing the sqlite_master table, this routine also checks to
+** make sure the "type", "name", and "tbl_name" columns are consistent
+** with the SQL.
*/
-SQLITE_PRIVATE int sqlite3CheckObjectName(Parse *pParse, const char *zName){
- if( !pParse->db->init.busy && pParse->nested==0
- && sqlite3WritableSchema(pParse->db)==0
- && 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){
- sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s", zName);
- return SQLITE_ERROR;
+SQLITE_PRIVATE int sqlite3CheckObjectName(
+ Parse *pParse, /* Parsing context */
+ const char *zName, /* Name of the object to check */
+ const char *zType, /* Type of this object */
+ const char *zTblName /* Parent table name for triggers and indexes */
+){
+ sqlite3 *db = pParse->db;
+ if( sqlite3WritableSchema(db) || db->init.imposterTable ){
+ /* Skip these error checks for writable_schema=ON */
+ return SQLITE_OK;
+ }
+ if( db->init.busy ){
+ if( sqlite3_stricmp(zType, db->init.azInit[0])
+ || sqlite3_stricmp(zName, db->init.azInit[1])
+ || sqlite3_stricmp(zTblName, db->init.azInit[2])
+ ){
+ if( sqlite3Config.bExtraSchemaChecks ){
+ sqlite3ErrorMsg(pParse, ""); /* corruptSchema() will supply the error */
+ return SQLITE_ERROR;
+ }
+ }
+ }else{
+ if( pParse->nested==0
+ && 0==sqlite3StrNICmp(zName, "sqlite_", 7)
+ ){
+ sqlite3ErrorMsg(pParse, "object name reserved for internal use: %s",
+ zName);
+ return SQLITE_ERROR;
+ }
}
return SQLITE_OK;
}
@@ -108203,7 +108598,7 @@ SQLITE_PRIVATE void sqlite3StartTable(
}
pParse->sNameToken = *pName;
if( zName==0 ) return;
- if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( sqlite3CheckObjectName(pParse, zName, isView?"view":"table", zName) ){
goto begin_table_error;
}
if( db->init.iDb==1 ) isTemp = 1;
@@ -108703,7 +109098,7 @@ SQLITE_PRIVATE void sqlite3AddPrimaryKey(
pTab->keyConf = (u8)onError;
assert( autoInc==0 || autoInc==1 );
pTab->tabFlags |= autoInc*TF_Autoincrement;
- if( pList ) pParse->iPkSortOrder = pList->a[0].sortOrder;
+ if( pList ) pParse->iPkSortOrder = pList->a[0].sortFlags;
}else if( autoInc ){
#ifndef SQLITE_OMIT_AUTOINCREMENT
sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an "
@@ -109118,6 +109513,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
Index *pIdx;
Index *pPk;
int nPk;
+ int nExtra;
int i, j;
sqlite3 *db = pParse->db;
Vdbe *v = pParse->pVdbe;
@@ -109153,13 +109549,14 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
if( IN_RENAME_OBJECT ){
sqlite3RenameTokenRemap(pParse, pList->a[0].pExpr, &pTab->iPKey);
}
- pList->a[0].sortOrder = pParse->iPkSortOrder;
+ pList->a[0].sortFlags = pParse->iPkSortOrder;
assert( pParse->pNewTable==pTab );
pTab->iPKey = -1;
sqlite3CreateIndex(pParse, 0, 0, 0, pList, pTab->keyConf, 0, 0, 0, 0,
SQLITE_IDXTYPE_PRIMARYKEY);
if( db->mallocFailed || pParse->nErr ) return;
pPk = sqlite3PrimaryKeyIndex(pTab);
+ assert( pPk->nKeyCol==1 );
}else{
pPk = sqlite3PrimaryKeyIndex(pTab);
assert( pPk!=0 );
@@ -109174,6 +109571,8 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
pPk->nColumn--;
}else{
testcase( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) );
+ pPk->azColl[j] = pPk->azColl[i];
+ pPk->aSortOrder[j] = pPk->aSortOrder[i];
pPk->aiColumn[j++] = pPk->aiColumn[i];
}
}
@@ -109182,7 +109581,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
assert( pPk!=0 );
pPk->isCovering = 1;
if( !db->init.imposterTable ) pPk->uniqNotNull = 1;
- nPk = pPk->nKeyCol;
+ nPk = pPk->nColumn = pPk->nKeyCol;
/* Bypass the creation of the PRIMARY KEY btree and the sqlite_master
** table entry. This is only required if currently generating VDBE
@@ -109232,21 +109631,21 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
/* Add all table columns to the PRIMARY KEY index
*/
- if( nPk<pTab->nCol ){
- if( resizeIndexObject(db, pPk, pTab->nCol) ) return;
- for(i=0, j=nPk; i<pTab->nCol; i++){
- if( !hasColumn(pPk->aiColumn, j, i) ){
- assert( j<pPk->nColumn );
- pPk->aiColumn[j] = i;
- pPk->azColl[j] = sqlite3StrBINARY;
- j++;
- }
+ nExtra = 0;
+ for(i=0; i<pTab->nCol; i++){
+ if( !hasColumn(pPk->aiColumn, nPk, i) ) nExtra++;
+ }
+ if( resizeIndexObject(db, pPk, nPk+nExtra) ) return;
+ for(i=0, j=nPk; i<pTab->nCol; i++){
+ if( !hasColumn(pPk->aiColumn, j, i) ){
+ assert( j<pPk->nColumn );
+ pPk->aiColumn[j] = i;
+ pPk->azColl[j] = sqlite3StrBINARY;
+ j++;
}
- assert( pPk->nColumn==j );
- assert( pTab->nCol==j );
- }else{
- pPk->nColumn = pTab->nCol;
}
+ assert( pPk->nColumn==j );
+ assert( pTab->nCol<=j );
recomputeColumnsNotIndexed(pPk);
}
@@ -109443,7 +109842,7 @@ SQLITE_PRIVATE void sqlite3EndTable(
addrTop = sqlite3VdbeCurrentAddr(v) + 1;
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, addrTop);
if( pParse->nErr ) return;
- pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect);
+ pSelTab = sqlite3ResultSetOfSelect(pParse, pSelect, SQLITE_AFF_BLOB);
if( pSelTab==0 ) return;
assert( p->aCol==0 );
p->nCol = pSelTab->nCol;
@@ -109707,10 +110106,10 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
#ifndef SQLITE_OMIT_AUTHORIZATION
xAuth = db->xAuth;
db->xAuth = 0;
- pSelTab = sqlite3ResultSetOfSelect(pParse, pSel);
+ pSelTab = sqlite3ResultSetOfSelect(pParse, pSel, SQLITE_AFF_NONE);
db->xAuth = xAuth;
#else
- pSelTab = sqlite3ResultSetOfSelect(pParse, pSel);
+ pSelTab = sqlite3ResultSetOfSelect(pParse, pSel, SQLITE_AFF_NONE);
#endif
pParse->nTab = n;
if( pTable->pCheck ){
@@ -109726,7 +110125,8 @@ SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
&& pParse->nErr==0
&& pTable->nCol==pSel->pEList->nExpr
){
- sqlite3SelectAddColumnTypeAndCollation(pParse, pTable, pSel);
+ sqlite3SelectAddColumnTypeAndCollation(pParse, pTable, pSel,
+ SQLITE_AFF_NONE);
}
}else if( pSelTab ){
/* CREATE VIEW name AS... without an argument list. Construct
@@ -110071,7 +110471,8 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
}
#endif
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
- && sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){
+ && sqlite3StrNICmp(pTab->zName+7, "stat", 4)!=0
+ && sqlite3StrNICmp(pTab->zName+7, "parameters", 10)!=0 ){
sqlite3ErrorMsg(pParse, "table %s may not be dropped", pTab->zName);
goto exit_drop_table;
}
@@ -110409,6 +110810,27 @@ SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(
}
/*
+** If expression list pList contains an expression that was parsed with
+** an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in
+** pParse and return non-zero. Otherwise, return zero.
+*/
+SQLITE_PRIVATE int sqlite3HasExplicitNulls(Parse *pParse, ExprList *pList){
+ if( pList ){
+ int i;
+ for(i=0; i<pList->nExpr; i++){
+ if( pList->a[i].bNulls ){
+ u8 sf = pList->a[i].sortFlags;
+ sqlite3ErrorMsg(pParse, "unsupported use of NULLS %s",
+ (sf==0 || sf==3) ? "FIRST" : "LAST"
+ );
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+/*
** Create a new index for an SQL table. pName1.pName2 is the name of the index
** and pTblList is the name of the table that is to be indexed. Both will
** be NULL for a primary key or an index that is created to satisfy a
@@ -110459,6 +110881,9 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
goto exit_create_index;
}
+ if( sqlite3HasExplicitNulls(pParse, pList) ){
+ goto exit_create_index;
+ }
/*
** Find the table that is to be indexed. Return early if not found.
@@ -110557,7 +110982,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
zName = sqlite3NameFromToken(db, pName);
if( zName==0 ) goto exit_create_index;
assert( pName->z!=0 );
- if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName,"index",pTab->zName) ){
goto exit_create_index;
}
if( !IN_RENAME_OBJECT ){
@@ -110623,7 +111048,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
sqlite3ExprAlloc(db, TK_ID, &prevCol, 0));
if( pList==0 ) goto exit_create_index;
assert( pList->nExpr==1 );
- sqlite3ExprListSetSortOrder(pList, sortOrder);
+ sqlite3ExprListSetSortOrder(pList, sortOrder, SQLITE_SO_UNDEFINED);
}else{
sqlite3ExprListCheckLength(pParse, pList, "index");
if( pParse->nErr ) goto exit_create_index;
@@ -110741,7 +111166,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
goto exit_create_index;
}
pIndex->azColl[i] = zColl;
- requestedSortOrder = pListItem->sortOrder & sortOrderMask;
+ requestedSortOrder = pListItem->sortFlags & sortOrderMask;
pIndex->aSortOrder[i] = (u8)requestedSortOrder;
}
@@ -110916,6 +111341,7 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
/* Gather the complete text of the CREATE INDEX statement into
** the zStmt variable
*/
+ assert( pName!=0 || pStart==0 );
if( pStart ){
int n = (int)(pParse->sLastToken.z - pName->z) + pParse->sLastToken.n;
if( pName->z[n-1]==';' ) n--;
@@ -111958,7 +112384,8 @@ SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoOfIndex(Parse *pParse, Index *pIdx){
const char *zColl = pIdx->azColl[i];
pKey->aColl[i] = zColl==sqlite3StrBINARY ? 0 :
sqlite3LocateCollSeq(pParse, zColl);
- pKey->aSortOrder[i] = pIdx->aSortOrder[i];
+ pKey->aSortFlags[i] = pIdx->aSortOrder[i];
+ assert( 0==(pKey->aSortFlags[i] & KEYINFO_ORDER_BIGNULL) );
}
if( pParse->nErr ){
assert( pParse->rc==SQLITE_ERROR_MISSING_COLLSEQ );
@@ -113714,6 +114141,8 @@ static void instrFunc(
int N = 1;
int isText;
unsigned char firstChar;
+ sqlite3_value *pC1 = 0;
+ sqlite3_value *pC2 = 0;
UNUSED_PARAMETER(argc);
typeHaystack = sqlite3_value_type(argv[0]);
@@ -113726,12 +114155,22 @@ static void instrFunc(
zHaystack = sqlite3_value_blob(argv[0]);
zNeedle = sqlite3_value_blob(argv[1]);
isText = 0;
- }else{
+ }else if( typeHaystack!=SQLITE_BLOB && typeNeedle!=SQLITE_BLOB ){
zHaystack = sqlite3_value_text(argv[0]);
zNeedle = sqlite3_value_text(argv[1]);
isText = 1;
+ }else{
+ pC1 = sqlite3_value_dup(argv[0]);
+ zHaystack = sqlite3_value_text(pC1);
+ if( zHaystack==0 ) goto endInstrOOM;
+ nHaystack = sqlite3_value_bytes(pC1);
+ pC2 = sqlite3_value_dup(argv[1]);
+ zNeedle = sqlite3_value_text(pC2);
+ if( zNeedle==0 ) goto endInstrOOM;
+ nNeedle = sqlite3_value_bytes(pC2);
+ isText = 1;
}
- if( zNeedle==0 || (nHaystack && zHaystack==0) ) return;
+ if( zNeedle==0 || (nHaystack && zHaystack==0) ) goto endInstrOOM;
firstChar = zNeedle[0];
while( nNeedle<=nHaystack
&& (zHaystack[0]!=firstChar || memcmp(zHaystack, zNeedle, nNeedle)!=0)
@@ -113745,6 +114184,13 @@ static void instrFunc(
if( nNeedle>nHaystack ) N = 0;
}
sqlite3_result_int(context, N);
+endInstr:
+ sqlite3_value_free(pC1);
+ sqlite3_value_free(pC2);
+ return;
+endInstrOOM:
+ sqlite3_result_error_nomem(context);
+ goto endInstr;
}
/*
@@ -115497,9 +115943,6 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){
sqlite3AlterFunctions();
#endif
sqlite3WindowFunctions();
-#if defined(SQLITE_ENABLE_STAT3) || defined(SQLITE_ENABLE_STAT4)
- sqlite3AnalyzeFunctions();
-#endif
sqlite3RegisterDateTimeFunctions();
sqlite3InsertBuiltinFuncs(aBuiltinFunc, ArraySize(aBuiltinFunc));
@@ -116002,13 +116445,13 @@ static Expr *exprTableRegister(
if( iCol>=0 && iCol!=pTab->iPKey ){
pCol = &pTab->aCol[iCol];
pExpr->iTable = regBase + iCol + 1;
- pExpr->affinity = pCol->affinity;
+ pExpr->affExpr = pCol->affinity;
zColl = pCol->zColl;
if( zColl==0 ) zColl = db->pDfltColl->zName;
pExpr = sqlite3ExprAddCollateString(pParse, pExpr, zColl);
}else{
pExpr->iTable = regBase;
- pExpr->affinity = SQLITE_AFF_INTEGER;
+ pExpr->affExpr = SQLITE_AFF_INTEGER;
}
}
return pExpr;
@@ -116811,7 +117254,7 @@ static Trigger *fkActionTrigger(
tFrom.n = nFrom;
pRaise = sqlite3Expr(db, TK_RAISE, "FOREIGN KEY constraint failed");
if( pRaise ){
- pRaise->affinity = OE_Abort;
+ pRaise->affExpr = OE_Abort;
}
pSelect = sqlite3SelectNew(pParse,
sqlite3ExprListAppend(pParse, 0, pRaise),
@@ -116856,6 +117299,7 @@ static Trigger *fkActionTrigger(
return 0;
}
assert( pStep!=0 );
+ assert( pTrigger!=0 );
switch( action ){
case OE_Restrict:
@@ -117046,18 +117490,19 @@ SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){
}
for(n=0; n<pIdx->nColumn; n++){
i16 x = pIdx->aiColumn[n];
+ char aff;
if( x>=0 ){
- pIdx->zColAff[n] = pTab->aCol[x].affinity;
+ aff = pTab->aCol[x].affinity;
}else if( x==XN_ROWID ){
- pIdx->zColAff[n] = SQLITE_AFF_INTEGER;
+ aff = SQLITE_AFF_INTEGER;
}else{
- char aff;
assert( x==XN_EXPR );
assert( pIdx->aColExpr!=0 );
aff = sqlite3ExprAffinity(pIdx->aColExpr->a[n].pExpr);
- if( aff==0 ) aff = SQLITE_AFF_BLOB;
- pIdx->zColAff[n] = aff;
}
+ if( aff<SQLITE_AFF_BLOB ) aff = SQLITE_AFF_BLOB;
+ if( aff>SQLITE_AFF_NUMERIC) aff = SQLITE_AFF_NUMERIC;
+ pIdx->zColAff[n] = aff;
}
pIdx->zColAff[n] = 0;
}
@@ -117097,11 +117542,12 @@ SQLITE_PRIVATE void sqlite3TableAffinity(Vdbe *v, Table *pTab, int iReg){
}
for(i=0; i<pTab->nCol; i++){
+ assert( pTab->aCol[i].affinity!=0 );
zColAff[i] = pTab->aCol[i].affinity;
}
do{
zColAff[i--] = 0;
- }while( i>=0 && zColAff[i]==SQLITE_AFF_BLOB );
+ }while( i>=0 && zColAff[i]<=SQLITE_AFF_BLOB );
pTab->zColAff = zColAff;
}
assert( zColAff!=0 );
@@ -117790,6 +118236,9 @@ SQLITE_PRIVATE void sqlite3Insert(
pTab->zName);
goto insert_cleanup;
}
+ if( sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget) ){
+ goto insert_cleanup;
+ }
pTabList->a[0].iCursor = iDataCur;
pUpsert->pUpsertSrc = pTabList;
pUpsert->regData = regData;
@@ -119903,6 +120352,8 @@ struct sqlite3_api_routines {
/* Version 3.28.0 and later */
int (*stmt_isexplain)(sqlite3_stmt*);
int (*value_frombind)(sqlite3_value*);
+ /* Version 3.30.0 and later */
+ int (*drop_modules)(sqlite3*,const char**);
};
/*
@@ -120195,6 +120646,8 @@ typedef int (*sqlite3_loadext_entry)(
/* Version 3.28.0 and later */
#define sqlite3_stmt_isexplain sqlite3_api->isexplain
#define sqlite3_value_frombind sqlite3_api->frombind
+/* Version 3.30.0 and later */
+#define sqlite3_drop_modules sqlite3_api->drop_modules
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
@@ -120660,7 +121113,13 @@ static const sqlite3_api_routines sqlite3Apis = {
#endif
/* Version 3.28.0 and later */
sqlite3_stmt_isexplain,
- sqlite3_value_frombind
+ sqlite3_value_frombind,
+ /* Version 3.30.0 and later */
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ sqlite3_drop_modules,
+#else
+ 0,
+#endif
};
/*
@@ -121373,7 +121832,7 @@ static const PragmaName aPragmaName[] = {
/* iArg: */ SQLITE_FullFSync },
#endif
#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
-#if defined(SQLITE_INTROSPECTION_PRAGMAS)
+#if !defined(SQLITE_OMIT_INTROSPECTION_PRAGMAS)
{/* zName: */ "function_list",
/* ePragTyp: */ PragTyp_FUNCTION_LIST,
/* ePragFlg: */ PragFlg_Result0,
@@ -121497,7 +121956,7 @@ static const PragmaName aPragmaName[] = {
#endif
#if !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
#if !defined(SQLITE_OMIT_VIRTUALTABLE)
-#if defined(SQLITE_INTROSPECTION_PRAGMAS)
+#if !defined(SQLITE_OMIT_INTROSPECTION_PRAGMAS)
{/* zName: */ "module_list",
/* ePragTyp: */ PragTyp_MODULE_LIST,
/* ePragFlg: */ PragFlg_Result0,
@@ -121532,7 +121991,7 @@ static const PragmaName aPragmaName[] = {
/* iArg: */ SQLITE_ParserTrace },
#endif
#endif
-#if defined(SQLITE_INTROSPECTION_PRAGMAS)
+#if !defined(SQLITE_OMIT_INTROSPECTION_PRAGMAS)
{/* zName: */ "pragma_list",
/* ePragTyp: */ PragTyp_PRAGMA_LIST,
/* ePragFlg: */ PragFlg_Result0,
@@ -121730,7 +122189,7 @@ static const PragmaName aPragmaName[] = {
/* iArg: */ SQLITE_WriteSchema|SQLITE_NoSchemaError },
#endif
};
-/* Number of pragmas: 62 on by default, 81 total. */
+/* Number of pragmas: 65 on by default, 81 total. */
/************** End of pragma.h **********************************************/
/************** Continuing where we left off in pragma.c *********************/
@@ -122862,6 +123321,15 @@ SQLITE_PRIVATE void sqlite3Pragma(
Index *pIdx;
Table *pTab;
pIdx = sqlite3FindIndex(db, zRight, zDb);
+ if( pIdx==0 ){
+ /* If there is no index named zRight, check to see if there is a
+ ** WITHOUT ROWID table named zRight, and if there is, show the
+ ** structure of the PRIMARY KEY index for that table. */
+ pTab = sqlite3LocateTable(pParse, LOCATE_NOERR, zRight, zDb);
+ if( pTab && !HasRowid(pTab) ){
+ pIdx = sqlite3PrimaryKeyIndex(pTab);
+ }
+ }
if( pIdx ){
int iIdxDb = sqlite3SchemaToIndex(db, pIdx->pSchema);
int i;
@@ -122941,7 +123409,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
}
break;
-#ifdef SQLITE_INTROSPECTION_PRAGMAS
+#ifndef SQLITE_OMIT_INTROSPECTION_PRAGMAS
case PragTyp_FUNCTION_LIST: {
int i;
HashElem *j;
@@ -124276,9 +124744,11 @@ SQLITE_PRIVATE int sqlite3IndexHasDuplicateRootPage(Index *pIndex){
**
** Each callback contains the following information:
**
-** argv[0] = name of thing being created
-** argv[1] = root page number for table or index. 0 for trigger or view.
-** argv[2] = SQL text for the CREATE statement.
+** argv[0] = type of object: "table", "index", "trigger", or "view".
+** argv[1] = name of thing being created
+** argv[2] = associated table if an index or trigger
+** argv[3] = root page number for table or index. 0 for trigger or view.
+** argv[4] = SQL text for the CREATE statement.
**
*/
SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
@@ -124286,21 +124756,21 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
sqlite3 *db = pData->db;
int iDb = pData->iDb;
- assert( argc==3 );
+ assert( argc==5 );
UNUSED_PARAMETER2(NotUsed, argc);
assert( sqlite3_mutex_held(db->mutex) );
DbClearProperty(db, iDb, DB_Empty);
pData->nInitRow++;
if( db->mallocFailed ){
- corruptSchema(pData, argv[0], 0);
+ corruptSchema(pData, argv[1], 0);
return 1;
}
assert( iDb>=0 && iDb<db->nDb );
if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */
- if( argv[1]==0 ){
- corruptSchema(pData, argv[0], 0);
- }else if( sqlite3_strnicmp(argv[2],"create ",7)==0 ){
+ if( argv[3]==0 ){
+ corruptSchema(pData, argv[1], 0);
+ }else if( sqlite3_strnicmp(argv[4],"create ",7)==0 ){
/* Call the parser to process a CREATE TABLE, INDEX or VIEW.
** But because db->init.busy is set to 1, no VDBE code is generated
** or executed. All the parser does is build the internal data
@@ -124313,9 +124783,10 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
assert( db->init.busy );
db->init.iDb = iDb;
- db->init.newTnum = sqlite3Atoi(argv[1]);
+ db->init.newTnum = sqlite3Atoi(argv[3]);
db->init.orphanTrigger = 0;
- TESTONLY(rcp = ) sqlite3_prepare(db, argv[2], -1, &pStmt, 0);
+ db->init.azInit = argv;
+ TESTONLY(rcp = ) sqlite3_prepare(db, argv[4], -1, &pStmt, 0);
rc = db->errCode;
assert( (rc&0xFF)==(rcp&0xFF) );
db->init.iDb = saved_iDb;
@@ -124324,17 +124795,17 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
if( db->init.orphanTrigger ){
assert( iDb==1 );
}else{
- pData->rc = rc;
+ if( rc > pData->rc ) pData->rc = rc;
if( rc==SQLITE_NOMEM ){
sqlite3OomFault(db);
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){
- corruptSchema(pData, argv[0], sqlite3_errmsg(db));
+ corruptSchema(pData, argv[1], sqlite3_errmsg(db));
}
}
}
sqlite3_finalize(pStmt);
- }else if( argv[0]==0 || (argv[2]!=0 && argv[2][0]!=0) ){
- corruptSchema(pData, argv[0], 0);
+ }else if( argv[1]==0 || (argv[4]!=0 && argv[4][0]!=0) ){
+ corruptSchema(pData, argv[1], 0);
}else{
/* If the SQL column is blank it means this is an index that
** was created to be the PRIMARY KEY or to fulfill a UNIQUE
@@ -124343,13 +124814,13 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
** to do here is record the root page number for that index.
*/
Index *pIndex;
- pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zDbSName);
+ pIndex = sqlite3FindIndex(db, argv[1], db->aDb[iDb].zDbSName);
if( pIndex==0
- || sqlite3GetInt32(argv[1],&pIndex->tnum)==0
+ || sqlite3GetInt32(argv[3],&pIndex->tnum)==0
|| pIndex->tnum<2
|| sqlite3IndexHasDuplicateRootPage(pIndex)
){
- corruptSchema(pData, argv[0], pIndex?"invalid rootpage":"orphan index");
+ corruptSchema(pData, argv[1], pIndex?"invalid rootpage":"orphan index");
}
}
return 0;
@@ -124370,7 +124841,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
int size;
#endif
Db *pDb;
- char const *azArg[4];
+ char const *azArg[6];
int meta[5];
InitData initData;
const char *zMasterName;
@@ -124389,18 +124860,20 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
** table name will be inserted automatically by the parser so we can just
** use the abbreviation "x" here. The parser will also automatically tag
** the schema table as read-only. */
- azArg[0] = zMasterName = SCHEMA_TABLE(iDb);
- azArg[1] = "1";
- azArg[2] = "CREATE TABLE x(type text,name text,tbl_name text,"
+ azArg[0] = "table";
+ azArg[1] = zMasterName = SCHEMA_TABLE(iDb);
+ azArg[2] = azArg[1];
+ azArg[3] = "1";
+ azArg[4] = "CREATE TABLE x(type text,name text,tbl_name text,"
"rootpage int,sql text)";
- azArg[3] = 0;
+ azArg[5] = 0;
initData.db = db;
initData.iDb = iDb;
initData.rc = SQLITE_OK;
initData.pzErrMsg = pzErrMsg;
initData.mInitFlags = mFlags;
initData.nInitRow = 0;
- sqlite3InitCallback(&initData, 3, (char **)azArg, 0);
+ sqlite3InitCallback(&initData, 5, (char **)azArg, 0);
if( initData.rc ){
rc = initData.rc;
goto error_out;
@@ -124526,7 +124999,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
{
char *zSql;
zSql = sqlite3MPrintf(db,
- "SELECT name, rootpage, sql FROM \"%w\".%s ORDER BY rowid",
+ "SELECT*FROM\"%w\".%s ORDER BY rowid",
db->aDb[iDb].zDbSName, zMasterName);
#ifndef SQLITE_OMIT_AUTHORIZATION
{
@@ -124847,7 +125320,10 @@ static int sqlite3Prepare(
rc = sParse.rc;
#ifndef SQLITE_OMIT_EXPLAIN
- if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){
+ /* Justification for the ALWAYS(): The only way for rc to be SQLITE_OK and
+ ** sParse.pVdbe to be NULL is if the input SQL is an empty string, but in
+ ** that case, sParse.explain will be false. */
+ if( sParse.explain && rc==SQLITE_OK && ALWAYS(sParse.pVdbe) ){
static const char * const azColName[] = {
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment",
"id", "parent", "notused", "detail"
@@ -124872,8 +125348,8 @@ static int sqlite3Prepare(
if( db->init.busy==0 ){
sqlite3VdbeSetSql(sParse.pVdbe, zSql, (int)(sParse.zTail-zSql), prepFlags);
}
- if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
- sqlite3VdbeFinalize(sParse.pVdbe);
+ if( rc!=SQLITE_OK || db->mallocFailed ){
+ if( sParse.pVdbe ) sqlite3VdbeFinalize(sParse.pVdbe);
assert(!(*ppStmt));
}else{
*ppStmt = (sqlite3_stmt*)sParse.pVdbe;
@@ -125244,6 +125720,7 @@ static void clearSelect(sqlite3 *db, Select *p, int bFree){
if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){
sqlite3WindowListDelete(db, p->pWinDefn);
}
+ assert( p->pWin==0 );
#endif
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith);
if( bFree ) sqlite3DbFreeNN(db, p);
@@ -125807,7 +126284,7 @@ static void pushOntoSorter(
if( pParse->db->mallocFailed ) return;
pOp->p2 = nKey + nData;
pKI = pOp->p4.pKeyInfo;
- memset(pKI->aSortOrder, 0, pKI->nKeyField); /* Makes OP_Jump testable */
+ memset(pKI->aSortFlags, 0, pKI->nKeyField); /* Makes OP_Jump testable */
sqlite3VdbeChangeP4(v, -1, (char*)pKI, P4_KEYINFO);
testcase( pKI->nAllField > pKI->nKeyField+2 );
pOp->p4.pKeyInfo = sqlite3KeyInfoFromExprList(pParse,pSort->pOrderBy,nOBSat,
@@ -126418,7 +126895,7 @@ SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
int nExtra = (N+X)*(sizeof(CollSeq*)+1) - sizeof(CollSeq*);
KeyInfo *p = sqlite3DbMallocRawNN(db, sizeof(KeyInfo) + nExtra);
if( p ){
- p->aSortOrder = (u8*)&p->aColl[N+X];
+ p->aSortFlags = (u8*)&p->aColl[N+X];
p->nKeyField = (u16)N;
p->nAllField = (u16)(N+X);
p->enc = ENC(db);
@@ -126495,7 +126972,7 @@ SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoFromExprList(
assert( sqlite3KeyInfoIsWriteable(pInfo) );
for(i=iStart, pItem=pList->a+iStart; i<nExpr; i++, pItem++){
pInfo->aColl[i-iStart] = sqlite3ExprNNCollSeq(pParse, pItem->pExpr);
- pInfo->aSortOrder[i-iStart] = pItem->sortOrder;
+ pInfo->aSortFlags[i-iStart] = pItem->sortFlags;
}
}
return pInfo;
@@ -126787,8 +127264,6 @@ static const char *columnTypeImpl(
assert( pExpr!=0 );
assert( pNC->pSrcList!=0 );
- assert( pExpr->op!=TK_AGG_COLUMN ); /* This routine runes before aggregates
- ** are processed */
switch( pExpr->op ){
case TK_COLUMN: {
/* The expression is a column. Locate the table the column is being
@@ -127105,12 +127580,11 @@ SQLITE_PRIVATE int sqlite3ColumnsFromExprList(
if( (zName = pEList->a[i].zName)!=0 ){
/* If the column contains an "AS <name>" phrase, use <name> as the name */
}else{
- Expr *pColExpr = sqlite3ExprSkipCollate(pEList->a[i].pExpr);
+ Expr *pColExpr = sqlite3ExprSkipCollateAndLikely(pEList->a[i].pExpr);
while( pColExpr->op==TK_DOT ){
pColExpr = pColExpr->pRight;
assert( pColExpr!=0 );
}
- assert( pColExpr->op!=TK_AGG_COLUMN );
if( pColExpr->op==TK_COLUMN ){
/* For columns use the column name name */
int iCol = pColExpr->iColumn;
@@ -127178,7 +127652,8 @@ SQLITE_PRIVATE int sqlite3ColumnsFromExprList(
SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(
Parse *pParse, /* Parsing contexts */
Table *pTab, /* Add column type information to this table */
- Select *pSelect /* SELECT used to determine types and collations */
+ Select *pSelect, /* SELECT used to determine types and collations */
+ char aff /* Default affinity for columns */
){
sqlite3 *db = pParse->db;
NameContext sNC;
@@ -127211,7 +127686,7 @@ SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(
pCol->colFlags |= COLFLAG_HASTYPE;
}
}
- if( pCol->affinity==0 ) pCol->affinity = SQLITE_AFF_BLOB;
+ if( pCol->affinity<=SQLITE_AFF_NONE ) pCol->affinity = aff;
pColl = sqlite3ExprCollSeq(pParse, p);
if( pColl && pCol->zColl==0 ){
pCol->zColl = sqlite3DbStrDup(db, pColl->zName);
@@ -127224,7 +127699,7 @@ SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(
** Given a SELECT statement, generate a Table structure that describes
** the result set of that SELECT.
*/
-SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
+SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect, char aff){
Table *pTab;
sqlite3 *db = pParse->db;
u64 savedFlags;
@@ -127244,7 +127719,7 @@ SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
pTab->zName = 0;
pTab->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
sqlite3ColumnsFromExprList(pParse, pSelect->pEList, &pTab->nCol, &pTab->aCol);
- sqlite3SelectAddColumnTypeAndCollation(pParse, pTab, pSelect);
+ sqlite3SelectAddColumnTypeAndCollation(pParse, pTab, pSelect, aff);
pTab->iPKey = -1;
if( db->mallocFailed ){
sqlite3DeleteTable(db, pTab);
@@ -127398,7 +127873,7 @@ static KeyInfo *multiSelectOrderByKeyInfo(Parse *pParse, Select *p, int nExtra){
}
assert( sqlite3KeyInfoIsWriteable(pRet) );
pRet->aColl[i] = pColl;
- pRet->aSortOrder[i] = pOrderBy->a[i].sortOrder;
+ pRet->aSortFlags[i] = pOrderBy->a[i].sortFlags;
}
}
@@ -128109,11 +128584,14 @@ static int generateOutputSubroutine(
/* If this is a scalar select that is part of an expression, then
** store the results in the appropriate memory cell and break out
- ** of the scan loop.
+ ** of the scan loop. Note that the select might return multiple columns
+ ** if it is the RHS of a row-value IN operator.
*/
case SRT_Mem: {
- assert( pIn->nSdst==1 || pParse->nErr>0 ); testcase( pIn->nSdst!=1 );
- sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, 1);
+ if( pParse->nErr==0 ){
+ testcase( pIn->nSdst>1 );
+ sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, pIn->nSdst);
+ }
/* The LIMIT clause will jump out of the loop for us */
break;
}
@@ -128370,7 +128848,7 @@ static int multiSelectOrderBy(
assert( sqlite3KeyInfoIsWriteable(pKeyDup) );
for(i=0; i<nExpr; i++){
pKeyDup->aColl[i] = multiSelectCollSeq(pParse, p, i);
- pKeyDup->aSortOrder[i] = 0;
+ pKeyDup->aSortFlags[i] = 0;
}
}
}
@@ -128620,6 +129098,18 @@ static Expr *substExpr(
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;
+
+ /* Ensure that the expression now has an implicit collation sequence,
+ ** just as it did when it was a column of a view or sub-query. */
+ if( pExpr ){
+ if( pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE ){
+ CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse, pExpr);
+ pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr,
+ (pColl ? pColl->zName : "BINARY")
+ );
+ }
+ ExprClearProperty(pExpr, EP_Collate);
+ }
}
}
}else{
@@ -128633,6 +129123,14 @@ static Expr *substExpr(
}else{
substExprList(pSubst, pExpr->x.pList);
}
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ Window *pWin = pExpr->y.pWin;
+ pWin->pFilter = substExpr(pSubst, pWin->pFilter);
+ substExprList(pSubst, pWin->pPartition);
+ substExprList(pSubst, pWin->pOrderBy);
+ }
+#endif
}
return pExpr;
}
@@ -129093,6 +129591,7 @@ static int flattenSubquery(
for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){
int nSubSrc;
u8 jointype = 0;
+ assert( pSub!=0 );
pSubSrc = pSub->pSrc; /* FROM clause of subquery */
nSubSrc = pSubSrc->nSrc; /* Number of terms in subquery FROM clause */
pSrc = pParent->pSrc; /* FROM clause of the outer query */
@@ -129543,24 +130042,27 @@ static u8 minMaxQuery(sqlite3 *db, Expr *pFunc, ExprList **ppMinMax){
ExprList *pEList = pFunc->x.pList; /* Arguments to agg function */
const char *zFunc; /* Name of aggregate function pFunc */
ExprList *pOrderBy;
- u8 sortOrder;
+ u8 sortFlags;
assert( *ppMinMax==0 );
assert( pFunc->op==TK_AGG_FUNCTION );
- if( pEList==0 || pEList->nExpr!=1 ) return eRet;
+ assert( !IsWindowFunc(pFunc) );
+ if( pEList==0 || pEList->nExpr!=1 || ExprHasProperty(pFunc, EP_WinFunc) ){
+ return eRet;
+ }
zFunc = pFunc->u.zToken;
if( sqlite3StrICmp(zFunc, "min")==0 ){
eRet = WHERE_ORDERBY_MIN;
- sortOrder = SQLITE_SO_ASC;
+ sortFlags = KEYINFO_ORDER_BIGNULL;
}else if( sqlite3StrICmp(zFunc, "max")==0 ){
eRet = WHERE_ORDERBY_MAX;
- sortOrder = SQLITE_SO_DESC;
+ sortFlags = KEYINFO_ORDER_DESC;
}else{
return eRet;
}
*ppMinMax = pOrderBy = sqlite3ExprListDup(db, pEList, 0);
assert( pOrderBy!=0 || db->mallocFailed );
- if( pOrderBy ) pOrderBy->a[0].sortOrder = sortOrder;
+ if( pOrderBy ) pOrderBy->a[0].sortFlags = sortFlags;
return eRet;
}
@@ -129594,7 +130096,7 @@ static Table *isSimpleCount(Select *p, AggInfo *pAggInfo){
if( pExpr->op!=TK_AGG_FUNCTION ) return 0;
if( NEVER(pAggInfo->nFunc==0) ) return 0;
if( (pAggInfo->aFunc[0].pFunc->funcFlags&SQLITE_FUNC_COUNT)==0 ) return 0;
- if( pExpr->flags&EP_Distinct ) return 0;
+ if( ExprHasProperty(pExpr, EP_Distinct|EP_WinFunc) ) return 0;
return pTab;
}
@@ -130041,6 +130543,10 @@ static int selectExpander(Walker *pWalker, Select *p){
u8 eCodeOrig = pWalker->eCode;
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
assert( pFrom->pSelect==0 );
+ if( pTab->pSelect && (db->flags & SQLITE_EnableView)==0 ){
+ sqlite3ErrorMsg(pParse, "access to view \"%s\" prohibited",
+ pTab->zName);
+ }
pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
nCol = pTab->nCol;
pTab->nCol = -1;
@@ -130334,7 +130840,8 @@ static void selectAddSubqueryTypeInfo(Walker *pWalker, Select *p){
Select *pSel = pFrom->pSelect;
if( pSel ){
while( pSel->pPrior ) pSel = pSel->pPrior;
- sqlite3SelectAddColumnTypeAndCollation(pParse, pTab, pSel);
+ sqlite3SelectAddColumnTypeAndCollation(pParse, pTab, pSel,
+ SQLITE_AFF_NONE);
}
}
}
@@ -130474,6 +130981,25 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
int regAgg;
ExprList *pList = pF->pExpr->x.pList;
assert( !ExprHasProperty(pF->pExpr, EP_xIsSelect) );
+ assert( !IsWindowFunc(pF->pExpr) );
+ if( ExprHasProperty(pF->pExpr, EP_WinFunc) ){
+ Expr *pFilter = pF->pExpr->y.pWin->pFilter;
+ if( pAggInfo->nAccumulator
+ && (pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL)
+ ){
+ if( regHit==0 ) regHit = ++pParse->nMem;
+ /* If this is the first row of the group (regAcc==0), clear the
+ ** "magnet" register regHit so that the accumulator registers
+ ** are populated if the FILTER clause jumps over the the
+ ** invocation of min() or max() altogether. Or, if this is not
+ ** the first row (regAcc==1), set the magnet register so that the
+ ** accumulators are not populated unless the min()/max() is invoked and
+ ** indicates that they should be. */
+ sqlite3VdbeAddOp2(v, OP_Copy, regAcc, regHit);
+ }
+ addrNext = sqlite3VdbeMakeLabel(pParse);
+ sqlite3ExprIfFalse(pParse, pFilter, addrNext, SQLITE_JUMPIFNULL);
+ }
if( pList ){
nArg = pList->nExpr;
regAgg = sqlite3GetTempRange(pParse, nArg);
@@ -130483,7 +131009,9 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
regAgg = 0;
}
if( pF->iDistinct>=0 ){
- addrNext = sqlite3VdbeMakeLabel(pParse);
+ if( addrNext==0 ){
+ addrNext = sqlite3VdbeMakeLabel(pParse);
+ }
testcase( nArg==0 ); /* Error condition */
testcase( nArg>1 ); /* Also an error */
codeDistinct(pParse, pF->iDistinct, addrNext, 1, regAgg);
@@ -130519,6 +131047,7 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){
sqlite3ExprCode(pParse, pC->pExpr, pC->iMem);
}
+
pAggInfo->directMode = 0;
if( addrHitTest ){
sqlite3VdbeJumpHere(v, addrHitTest);
@@ -130564,7 +131093,7 @@ static int havingToWhereExprCb(Walker *pWalker, Expr *pExpr){
Select *pS = pWalker->u.pSelect;
if( sqlite3ExprIsConstantOrGroupBy(pWalker->pParse, pExpr, pS->pGroupBy) ){
sqlite3 *db = pWalker->pParse->db;
- Expr *pNew = sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[1], 0);
+ Expr *pNew = sqlite3Expr(db, TK_INTEGER, "1");
if( pNew ){
Expr *pWhere = pS->pWhere;
SWAP(Expr, *pNew, *pExpr);
@@ -130986,7 +131515,7 @@ SQLITE_PRIVATE int sqlite3Select(
** assume the column name is non-NULL and segfault. The use of an empty
** string for the fake column name seems safer.
*/
- if( pItem->colUsed==0 ){
+ if( pItem->colUsed==0 && pItem->zName!=0 ){
sqlite3AuthCheck(pParse, SQLITE_READ, pItem->zName, "", pItem->zDatabase);
}
@@ -131000,8 +131529,15 @@ SQLITE_PRIVATE int sqlite3Select(
** technically harmless for it to be generated multiple times. The
** following assert() will detect if something changes to cause
** the same subquery to be coded multiple times, as a signal to the
- ** developers to try to optimize the situation. */
- assert( pItem->addrFillSub==0 );
+ ** developers to try to optimize the situation.
+ **
+ ** Update 2019-07-24:
+ ** See ticket https://sqlite.org/src/tktview/c52b09c7f38903b1311cec40.
+ ** The dbsqlfuzz fuzzer found a case where the same subquery gets
+ ** coded twice. So this assert() now becomes a testcase(). It should
+ ** be very rare, though.
+ */
+ testcase( pItem->addrFillSub!=0 );
/* Increment Parse.nHeight by the height of the largest expression
** tree referred to by this, the parent select. The child select
@@ -131075,7 +131611,7 @@ SQLITE_PRIVATE int sqlite3Select(
int retAddr;
struct SrcList_item *pPrior;
- assert( pItem->addrFillSub==0 );
+ testcase( pItem->addrFillSub==0 ); /* Ticket c52b09c7f38903b1311 */
pItem->regReturn = ++pParse->nMem;
topAddr = sqlite3VdbeAddOp2(v, OP_Integer, 0, pItem->regReturn);
pItem->addrFillSub = topAddr+1;
@@ -131315,23 +131851,35 @@ SQLITE_PRIVATE int sqlite3Select(
}
assert( 66==sqlite3LogEst(100) );
if( p->nSelectRow>66 ) p->nSelectRow = 66;
+
+ /* If there is both a GROUP BY and an ORDER BY clause and they are
+ ** identical, then it may be possible to disable the ORDER BY clause
+ ** on the grounds that the GROUP BY will cause elements to come out
+ ** in the correct order. It also may not - the GROUP BY might use a
+ ** database index that causes rows to be grouped together as required
+ ** but not actually sorted. Either way, record the fact that the
+ ** ORDER BY and GROUP BY clauses are the same by setting the orderByGrp
+ ** variable. */
+ if( sSort.pOrderBy && pGroupBy->nExpr==sSort.pOrderBy->nExpr ){
+ int ii;
+ /* The GROUP BY processing doesn't care whether rows are delivered in
+ ** ASC or DESC order - only that each group is returned contiguously.
+ ** So set the ASC/DESC flags in the GROUP BY to match those in the
+ ** ORDER BY to maximize the chances of rows being delivered in an
+ ** order that makes the ORDER BY redundant. */
+ for(ii=0; ii<pGroupBy->nExpr; ii++){
+ u8 sortFlags = sSort.pOrderBy->a[ii].sortFlags & KEYINFO_ORDER_DESC;
+ pGroupBy->a[ii].sortFlags = sortFlags;
+ }
+ if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){
+ orderByGrp = 1;
+ }
+ }
}else{
assert( 0==sqlite3LogEst(1) );
p->nSelectRow = 0;
}
- /* If there is both a GROUP BY and an ORDER BY clause and they are
- ** identical, then it may be possible to disable the ORDER BY clause
- ** on the grounds that the GROUP BY will cause elements to come out
- ** in the correct order. It also may not - the GROUP BY might use a
- ** database index that causes rows to be grouped together as required
- ** but not actually sorted. Either way, record the fact that the
- ** ORDER BY and GROUP BY clauses are the same by setting the orderByGrp
- ** variable. */
- if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){
- orderByGrp = 1;
- }
-
/* Create a label to jump to when we want to abort the query */
addrEnd = sqlite3VdbeMakeLabel(pParse);
@@ -131366,9 +131914,16 @@ SQLITE_PRIVATE int sqlite3Select(
minMaxFlag = WHERE_ORDERBY_NORMAL;
}
for(i=0; i<sAggInfo.nFunc; i++){
- assert( !ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect) );
+ Expr *pExpr = sAggInfo.aFunc[i].pExpr;
+ assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
sNC.ncFlags |= NC_InAggFunc;
- sqlite3ExprAnalyzeAggList(&sNC, sAggInfo.aFunc[i].pExpr->x.pList);
+ sqlite3ExprAnalyzeAggList(&sNC, pExpr->x.pList);
+#ifndef SQLITE_OMIT_WINDOWFUNC
+ assert( !IsWindowFunc(pExpr) );
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ sqlite3ExprAnalyzeAggregates(&sNC, pExpr->y.pWin->pFilter);
+ }
+#endif
sNC.ncFlags &= ~NC_InAggFunc;
}
sAggInfo.mxReg = pParse->nMem;
@@ -131680,13 +132235,18 @@ SQLITE_PRIVATE int sqlite3Select(
{
int regAcc = 0; /* "populate accumulators" flag */
- /* If there are accumulator registers but no min() or max() functions,
- ** allocate register regAcc. Register regAcc will contain 0 the first
- ** time the inner loop runs, and 1 thereafter. The code generated
- ** by updateAccumulator() only updates the accumulator registers if
- ** regAcc contains 0. */
+ /* If there are accumulator registers but no min() or max() functions
+ ** without FILTER clauses, allocate register regAcc. Register regAcc
+ ** will contain 0 the first time the inner loop runs, and 1 thereafter.
+ ** The code generated by updateAccumulator() uses this to ensure
+ ** that the accumulator registers are (a) updated only once if
+ ** there are no min() or max functions or (b) always updated for the
+ ** first row visited by the aggregate, so that they are updated at
+ ** least once even if the FILTER clause means the min() or max()
+ ** function visits zero rows. */
if( sAggInfo.nAccumulator ){
for(i=0; i<sAggInfo.nFunc; i++){
+ if( ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_WinFunc) ) continue;
if( sAggInfo.aFunc[i].pFunc->funcFlags&SQLITE_FUNC_NEEDCOLL ) break;
}
if( i==sAggInfo.nFunc ){
@@ -132157,7 +132717,11 @@ SQLITE_PRIVATE void sqlite3BeginTrigger(
/* Check that the trigger name is not reserved and that no trigger of the
** specified name exists */
zName = sqlite3NameFromToken(db, pName);
- if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
+ if( zName==0 ){
+ assert( db->mallocFailed );
+ goto trigger_cleanup;
+ }
+ if( sqlite3CheckObjectName(pParse, zName, "trigger", pTab->zName) ){
goto trigger_cleanup;
}
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
@@ -132320,6 +132884,7 @@ SQLITE_PRIVATE void sqlite3FinishTrigger(
Trigger *pLink = pTrig;
Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
+ assert( pLink!=0 );
pTrig = sqlite3HashInsert(pHash, zName, pTrig);
if( pTrig ){
sqlite3OomFault(db);
@@ -132438,6 +133003,9 @@ SQLITE_PRIVATE TriggerStep *sqlite3TriggerInsertStep(
pTriggerStep->pIdList = pColumn;
pTriggerStep->pUpsert = pUpsert;
pTriggerStep->orconf = orconf;
+ if( pUpsert ){
+ sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget);
+ }
}else{
testcase( pColumn );
sqlite3IdListDelete(db, pColumn);
@@ -132593,10 +133161,9 @@ SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
assert( iDb>=0 && iDb<db->nDb );
pTable = tableOfTrigger(pTrigger);
- assert( pTable );
- assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
+ assert( (pTable && pTable->pSchema==pTrigger->pSchema) || iDb==1 );
#ifndef SQLITE_OMIT_AUTHORIZATION
- {
+ if( pTable ){
int code = SQLITE_DROP_TRIGGER;
const char *zDb = db->aDb[iDb].zDbSName;
const char *zTab = SCHEMA_TABLE(iDb);
@@ -132610,7 +133177,6 @@ SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
/* Generate code to destroy the database record of the trigger.
*/
- assert( pTable!=0 );
if( (v = sqlite3GetVdbe(pParse))!=0 ){
sqlite3NestedParse(pParse,
"DELETE FROM %Q.%s WHERE name=%Q AND type='trigger'",
@@ -132634,9 +133200,11 @@ SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const ch
if( ALWAYS(pTrigger) ){
if( pTrigger->pSchema==pTrigger->pTabSchema ){
Table *pTab = tableOfTrigger(pTrigger);
- Trigger **pp;
- for(pp=&pTab->pTrigger; *pp!=pTrigger; pp=&((*pp)->pNext));
- *pp = (*pp)->pNext;
+ if( pTab ){
+ Trigger **pp;
+ for(pp=&pTab->pTrigger; *pp!=pTrigger; pp=&((*pp)->pNext));
+ *pp = (*pp)->pNext;
+ }
}
sqlite3DeleteTrigger(db, pTrigger);
db->mDbFlags |= DBFLAG_SchemaChange;
@@ -133884,28 +134452,30 @@ SQLITE_PRIVATE void sqlite3Update(
}
if( !isView ){
- int addr1 = 0; /* Address of jump instruction */
-
/* Do constraint checks. */
assert( regOldRowid>0 );
sqlite3GenerateConstraintChecks(pParse, pTab, aRegIdx, iDataCur, iIdxCur,
regNewRowid, regOldRowid, chngKey, onError, labelContinue, &bReplace,
aXRef, 0);
- /* Do FK constraint checks. */
- if( hasFK ){
- sqlite3FkCheck(pParse, pTab, regOldRowid, 0, aXRef, chngKey);
- }
-
- /* Delete the index entries associated with the current record. */
+ /* If REPLACE conflict handling may have been used, or if the PK of the
+ ** row is changing, then the GenerateConstraintChecks() above may have
+ ** moved cursor iDataCur. Reseek it. */
if( bReplace || chngKey ){
if( pPk ){
- addr1 = sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, 0, regKey, nKey);
+ sqlite3VdbeAddOp4Int(v, OP_NotFound,iDataCur,labelContinue,regKey,nKey);
}else{
- addr1 = sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, 0, regOldRowid);
+ sqlite3VdbeAddOp3(v, OP_NotExists, iDataCur, labelContinue,regOldRowid);
}
VdbeCoverageNeverTaken(v);
}
+
+ /* Do FK constraint checks. */
+ if( hasFK ){
+ sqlite3FkCheck(pParse, pTab, regOldRowid, 0, aXRef, chngKey);
+ }
+
+ /* Delete the index entries associated with the current record. */
sqlite3GenerateRowIndexDelete(pParse, pTab, iDataCur, iIdxCur, aRegIdx, -1);
/* If changing the rowid value, or if there are foreign key constraints
@@ -133935,9 +134505,6 @@ SQLITE_PRIVATE void sqlite3Update(
sqlite3VdbeAddOp2(v, OP_Delete, iDataCur, 0);
}
#endif
- if( bReplace || chngKey ){
- sqlite3VdbeJumpHere(v, addr1);
- }
if( hasFK ){
sqlite3FkCheck(pParse, pTab, 0, regNewRowid, aXRef, chngKey);
@@ -134376,6 +134943,7 @@ SQLITE_PRIVATE void sqlite3UpsertDoUpdate(
sqlite3 *db = pParse->db;
SrcList *pSrc; /* FROM clause for the UPDATE */
int iDataCur;
+ int i;
assert( v!=0 );
assert( pUpsert!=0 );
@@ -134392,7 +134960,6 @@ SQLITE_PRIVATE void sqlite3UpsertDoUpdate(
Index *pPk = sqlite3PrimaryKeyIndex(pTab);
int nPk = pPk->nKeyCol;
int iPk = pParse->nMem+1;
- int i;
pParse->nMem += nPk;
for(i=0; i<nPk; i++){
int k;
@@ -134413,6 +134980,12 @@ SQLITE_PRIVATE void sqlite3UpsertDoUpdate(
/* pUpsert does not own pUpsertSrc - the outer INSERT statement does. So
** we have to make a copy before passing it down into sqlite3Update() */
pSrc = sqlite3SrcListDup(db, pUpsert->pUpsertSrc, 0);
+ /* excluded.* columns of type REAL need to be converted to a hard real */
+ for(i=0; i<pTab->nCol; i++){
+ if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
+ sqlite3VdbeAddOp1(v, OP_RealAffinity, pUpsert->regData+i);
+ }
+ }
sqlite3Update(pParse, pSrc, pUpsert->pUpsertSet,
pUpsert->pUpsertWhere, OE_Abort, 0, 0, pUpsert);
pUpsert->pUpsertSet = 0; /* Will have been deleted by sqlite3Update() */
@@ -134876,6 +135449,9 @@ struct VtabCtx {
** Construct and install a Module object for a virtual table. When this
** routine is called, it is guaranteed that all appropriate locks are held
** and the module is not already part of the connection.
+**
+** If there already exists a module with zName, replace it with the new one.
+** If pModule==0, then delete the module zName if it exists.
*/
SQLITE_PRIVATE Module *sqlite3VtabCreateModule(
sqlite3 *db, /* Database in which module is registered */
@@ -134885,25 +135461,36 @@ SQLITE_PRIVATE Module *sqlite3VtabCreateModule(
void (*xDestroy)(void *) /* Module destructor function */
){
Module *pMod;
- int nName = sqlite3Strlen30(zName);
- pMod = (Module *)sqlite3Malloc(sizeof(Module) + nName + 1);
- if( pMod==0 ){
- sqlite3OomFault(db);
+ Module *pDel;
+ char *zCopy;
+ if( pModule==0 ){
+ zCopy = (char*)zName;
+ pMod = 0;
}else{
- Module *pDel;
- char *zCopy = (char *)(&pMod[1]);
+ int nName = sqlite3Strlen30(zName);
+ pMod = (Module *)sqlite3Malloc(sizeof(Module) + nName + 1);
+ if( pMod==0 ){
+ sqlite3OomFault(db);
+ return 0;
+ }
+ zCopy = (char *)(&pMod[1]);
memcpy(zCopy, zName, nName+1);
pMod->zName = zCopy;
pMod->pModule = pModule;
pMod->pAux = pAux;
pMod->xDestroy = xDestroy;
pMod->pEpoTab = 0;
- pDel = (Module *)sqlite3HashInsert(&db->aModule,zCopy,(void*)pMod);
- assert( pDel==0 || pDel==pMod );
- if( pDel ){
+ pMod->nRefModule = 1;
+ }
+ pDel = (Module *)sqlite3HashInsert(&db->aModule,zCopy,(void*)pMod);
+ if( pDel ){
+ if( pDel==pMod ){
sqlite3OomFault(db);
sqlite3DbFree(db, pDel);
pMod = 0;
+ }else{
+ sqlite3VtabEponymousTableClear(db, pDel);
+ sqlite3VtabModuleUnref(db, pDel);
}
}
return pMod;
@@ -134924,11 +135511,7 @@ static int createModule(
int rc = SQLITE_OK;
sqlite3_mutex_enter(db->mutex);
- if( sqlite3HashFind(&db->aModule, zName) ){
- rc = SQLITE_MISUSE_BKPT;
- }else{
- (void)sqlite3VtabCreateModule(db, zName, pModule, pAux, xDestroy);
- }
+ (void)sqlite3VtabCreateModule(db, zName, pModule, pAux, xDestroy);
rc = sqlite3ApiExit(db, rc);
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux);
sqlite3_mutex_leave(db->mutex);
@@ -134968,6 +135551,44 @@ SQLITE_API int sqlite3_create_module_v2(
}
/*
+** External API to drop all virtual-table modules, except those named
+** on the azNames list.
+*/
+SQLITE_API int sqlite3_drop_modules(sqlite3 *db, const char** azNames){
+ HashElem *pThis, *pNext;
+#ifdef SQLITE_ENABLE_API_ARMOR
+ if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
+#endif
+ for(pThis=sqliteHashFirst(&db->aModule); pThis; pThis=pNext){
+ Module *pMod = (Module*)sqliteHashData(pThis);
+ pNext = sqliteHashNext(pThis);
+ if( azNames ){
+ int ii;
+ for(ii=0; azNames[ii]!=0 && strcmp(azNames[ii],pMod->zName)!=0; ii++){}
+ if( azNames[ii]!=0 ) continue;
+ }
+ createModule(db, pMod->zName, 0, 0, 0);
+ }
+ return SQLITE_OK;
+}
+
+/*
+** Decrement the reference count on a Module object. Destroy the
+** module when the reference count reaches zero.
+*/
+SQLITE_PRIVATE void sqlite3VtabModuleUnref(sqlite3 *db, Module *pMod){
+ assert( pMod->nRefModule>0 );
+ pMod->nRefModule--;
+ if( pMod->nRefModule==0 ){
+ if( pMod->xDestroy ){
+ pMod->xDestroy(pMod->pAux);
+ }
+ assert( pMod->pEpoTab==0 );
+ sqlite3DbFree(db, pMod);
+ }
+}
+
+/*
** Lock the virtual table so that it cannot be disconnected.
** Locks nest. Every lock should have a corresponding unlock.
** If an unlock is omitted, resources leaks will occur.
@@ -135006,6 +135627,7 @@ SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){
pVTab->nRef--;
if( pVTab->nRef==0 ){
sqlite3_vtab *p = pVTab->pVtab;
+ sqlite3VtabModuleUnref(pVTab->db, pVTab->pMod);
if( p ){
p->pModule->xDisconnect(p);
}
@@ -135410,6 +136032,7 @@ static int vtabCallConstructor(
** the sqlite3_vtab object if successful. */
memset(pVTable->pVtab, 0, sizeof(pVTable->pVtab[0]));
pVTable->pVtab->pModule = pMod->pModule;
+ pMod->nRefModule++;
pVTable->nRef = 1;
if( sCtx.bDeclared==0 ){
const char *zFormat = "vtable constructor did not declare schema: %s";
@@ -136194,13 +136817,15 @@ struct WhereLevel {
int addrCont; /* Jump here to continue with the next loop cycle */
int addrFirst; /* First instruction of interior of the loop */
int addrBody; /* Beginning of the body of this loop */
+ int regBignull; /* big-null flag reg. True if a NULL-scan is needed */
+ int addrBignull; /* Jump here for next part of big-null scan */
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
u32 iLikeRepCntr; /* LIKE range processing counter register (times 2) */
int addrLikeRep; /* LIKE range processing address */
#endif
u8 iFrom; /* Which entry in the FROM clause */
u8 op, p3, p5; /* Opcode, P3 & P5 of the opcode that ends the loop */
- int p1, p2; /* Operands of the opcode used to ends the loop */
+ int p1, p2; /* Operands of the opcode used to end the loop */
union { /* Information that depends on pWLoop->wsFlags */
struct {
int nIn; /* Number of entries in aInLoop[] */
@@ -136251,7 +136876,7 @@ struct WhereLoop {
u16 nEq; /* Number of equality constraints */
u16 nBtm; /* Size of BTM vector */
u16 nTop; /* Size of TOP vector */
- u16 nIdxCol; /* Index column used for ORDER BY */
+ u16 nDistinctCol; /* Index columns used to sort for DISTINCT */
Index *pIndex; /* Index used, or NULL */
} btree;
struct { /* Information for virtual tables */
@@ -136402,16 +137027,17 @@ struct WhereTerm {
#define TERM_ORINFO 0x10 /* Need to free the WhereTerm.u.pOrInfo object */
#define TERM_ANDINFO 0x20 /* Need to free the WhereTerm.u.pAndInfo obj */
#define TERM_OR_OK 0x40 /* Used during OR-clause processing */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
# define TERM_VNULL 0x80 /* Manufactured x>NULL or x<=NULL term */
#else
-# define TERM_VNULL 0x00 /* Disabled if not using stat3 */
+# define TERM_VNULL 0x00 /* Disabled if not using stat4 */
#endif
#define TERM_LIKEOPT 0x100 /* Virtual terms from the LIKE optimization */
#define TERM_LIKECOND 0x200 /* Conditionally this LIKE operator term */
#define TERM_LIKE 0x400 /* The original LIKE operator */
#define TERM_IS 0x800 /* Term.pExpr is an IS operator */
#define TERM_VARSELECT 0x1000 /* Term.pExpr contains a correlated sub-query */
+#define TERM_NOPARTIDX 0x2000 /* Not for use to enable a partial index */
/*
** An instance of the WhereScan object is used as an iterator for locating
@@ -136522,7 +137148,7 @@ struct WhereLoopBuilder {
ExprList *pOrderBy; /* ORDER BY clause */
WhereLoop *pNew; /* Template WhereLoop */
WhereOrSet *pOrSet; /* Record best loops here, if not NULL */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
UnpackedRecord *pRec; /* Probe for stat4 (if required) */
int nRecValid; /* Number of valid fields currently in pRec */
#endif
@@ -136709,6 +137335,7 @@ SQLITE_PRIVATE void sqlite3WhereTabFuncArgs(Parse*, struct SrcList_item*, WhereC
#define WHERE_UNQ_WANTED 0x00010000 /* WHERE_ONEROW would have been helpful*/
#define WHERE_PARTIALIDX 0x00020000 /* The automatic index is partial */
#define WHERE_IN_EARLYOUT 0x00040000 /* Perhaps quit IN loops early */
+#define WHERE_BIGNULL_SORT 0x00080000 /* Column nEq of index is BIGNULL */
#endif /* !defined(SQLITE_WHEREINT_H) */
@@ -137013,9 +137640,9 @@ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){
** Code an OP_Affinity opcode to apply the column affinity string zAff
** to the n registers starting at base.
**
-** As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the
-** beginning and end of zAff are ignored. If all entries in zAff are
-** SQLITE_AFF_BLOB, then no code gets generated.
+** As an optimization, SQLITE_AFF_BLOB and SQLITE_AFF_NONE entries (which
+** are no-ops) at the beginning and end of zAff are ignored. If all entries
+** in zAff are SQLITE_AFF_BLOB or SQLITE_AFF_NONE, then no code gets generated.
**
** This routine makes its own copy of zAff so that the caller is free
** to modify zAff after this routine returns.
@@ -137028,15 +137655,16 @@ static void codeApplyAffinity(Parse *pParse, int base, int n, char *zAff){
}
assert( v!=0 );
- /* Adjust base and n to skip over SQLITE_AFF_BLOB entries at the beginning
- ** and end of the affinity string.
+ /* Adjust base and n to skip over SQLITE_AFF_BLOB and SQLITE_AFF_NONE
+ ** entries at the beginning and end of the affinity string.
*/
- while( n>0 && zAff[0]==SQLITE_AFF_BLOB ){
+ assert( SQLITE_AFF_NONE<SQLITE_AFF_BLOB );
+ while( n>0 && zAff[0]<=SQLITE_AFF_BLOB ){
n--;
base++;
zAff++;
}
- while( n>1 && zAff[n-1]==SQLITE_AFF_BLOB ){
+ while( n>1 && zAff[n-1]<=SQLITE_AFF_BLOB ){
n--;
}
@@ -137811,6 +138439,7 @@ typedef struct IdxExprTrans {
static int whereIndexExprTransNode(Walker *p, Expr *pExpr){
IdxExprTrans *pX = p->u.pIdxTrans;
if( sqlite3ExprCompare(0, pExpr, pX->pIdxExpr, pX->iTabCur)==0 ){
+ pExpr->affExpr = sqlite3ExprAffinity(pExpr);
pExpr->op = TK_COLUMN;
pExpr->iTable = pX->iIdxCur;
pExpr->iColumn = pX->iIdxCol;
@@ -138243,32 +138872,12 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
u8 bSeekPastNull = 0; /* True to seek past initial nulls */
u8 bStopAtNull = 0; /* Add condition to terminate at NULLs */
int omitTable; /* True if we use the index only */
-
+ int regBignull = 0; /* big-null flag register */
pIdx = pLoop->u.btree.pIndex;
iIdxCur = pLevel->iIdxCur;
assert( nEq>=pLoop->nSkip );
- /* If this loop satisfies a sort order (pOrderBy) request that
- ** was passed to this function to implement a "SELECT min(x) ..."
- ** query, then the caller will only allow the loop to run for
- ** a single iteration. This means that the first row returned
- ** should not have a NULL value stored in 'x'. If column 'x' is
- ** the first one after the nEq equality constraints in the index,
- ** this requires some special handling.
- */
- assert( pWInfo->pOrderBy==0
- || pWInfo->pOrderBy->nExpr==1
- || (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0 );
- if( (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)!=0
- && pWInfo->nOBSat>0
- && (pIdx->nKeyCol>nEq)
- ){
- assert( pLoop->nSkip==0 );
- bSeekPastNull = 1;
- nExtraReg = 1;
- }
-
/* Find any inequality constraint terms for the start and end
** of the range.
*/
@@ -138309,6 +138918,25 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
}
assert( pRangeEnd==0 || (pRangeEnd->wtFlags & TERM_VNULL)==0 );
+ /* If the WHERE_BIGNULL_SORT flag is set, then index column nEq uses
+ ** a non-default "big-null" sort (either ASC NULLS LAST or DESC NULLS
+ ** FIRST). In both cases separate ordered scans are made of those
+ ** index entries for which the column is null and for those for which
+ ** it is not. For an ASC sort, the non-NULL entries are scanned first.
+ ** For DESC, NULL entries are scanned first.
+ */
+ if( (pLoop->wsFlags & (WHERE_TOP_LIMIT|WHERE_BTM_LIMIT))==0
+ && (pLoop->wsFlags & WHERE_BIGNULL_SORT)!=0
+ ){
+ assert( bSeekPastNull==0 && nExtraReg==0 && nBtm==0 && nTop==0 );
+ assert( pRangeEnd==0 && pRangeStart==0 );
+ assert( pLoop->nSkip==0 );
+ nExtraReg = 1;
+ bSeekPastNull = 1;
+ pLevel->regBignull = regBignull = ++pParse->nMem;
+ pLevel->addrBignull = sqlite3VdbeMakeLabel(pParse);
+ }
+
/* If we are doing a reverse order scan on an ascending index, or
** a forward order scan on a descending index, interchange the
** start and end terms (pRangeStart and pRangeEnd).
@@ -138331,7 +138959,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
if( zStartAff && nTop ){
zEndAff = sqlite3DbStrDup(db, &zStartAff[nEq]);
}
- addrNxt = pLevel->addrNxt;
+ addrNxt = (regBignull ? pLevel->addrBignull : pLevel->addrNxt);
testcase( pRangeStart && (pRangeStart->eOperator & WO_LE)!=0 );
testcase( pRangeStart && (pRangeStart->eOperator & WO_GE)!=0 );
@@ -138365,10 +138993,14 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
}
bSeekPastNull = 0;
}else if( bSeekPastNull ){
+ startEq = 0;
sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
+ start_constraints = 1;
nConstraint++;
- startEq = 0;
+ }else if( regBignull ){
+ sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
start_constraints = 1;
+ nConstraint++;
}
codeApplyAffinity(pParse, regBase, nConstraint - bSeekPastNull, zStartAff);
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){
@@ -138379,6 +139011,11 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
if( pLoop->wsFlags & WHERE_IN_EARLYOUT ){
sqlite3VdbeAddOp1(v, OP_SeekHit, iIdxCur);
}
+ if( regBignull ){
+ sqlite3VdbeAddOp2(v, OP_Integer, 1, regBignull);
+ VdbeComment((v, "NULL-scan pass ctr"));
+ }
+
op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev];
assert( op!=0 );
sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
@@ -138389,6 +139026,23 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
VdbeCoverageIf(v, op==OP_SeekGE); testcase( op==OP_SeekGE );
VdbeCoverageIf(v, op==OP_SeekLE); testcase( op==OP_SeekLE );
VdbeCoverageIf(v, op==OP_SeekLT); testcase( op==OP_SeekLT );
+
+ assert( bSeekPastNull==0 || bStopAtNull==0 );
+ if( regBignull ){
+ assert( bSeekPastNull==1 || bStopAtNull==1 );
+ assert( bSeekPastNull==!bStopAtNull );
+ assert( bStopAtNull==startEq );
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+2);
+ op = aStartOp[(nConstraint>1)*4 + 2 + bRev];
+ sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase,
+ nConstraint-startEq);
+ VdbeCoverage(v);
+ VdbeCoverageIf(v, op==OP_Rewind); testcase( op==OP_Rewind );
+ VdbeCoverageIf(v, op==OP_Last); testcase( op==OP_Last );
+ VdbeCoverageIf(v, op==OP_SeekGE); testcase( op==OP_SeekGE );
+ VdbeCoverageIf(v, op==OP_SeekLE); testcase( op==OP_SeekLE );
+ assert( op==OP_Rewind || op==OP_Last || op==OP_SeekGE || op==OP_SeekLE);
+ }
}
/* Load the value for the inequality constraint at the end of the
@@ -138420,8 +139074,10 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
endEq = 1;
}
}else if( bStopAtNull ){
- sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
- endEq = 0;
+ if( regBignull==0 ){
+ sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq);
+ endEq = 0;
+ }
nConstraint++;
}
sqlite3DbFree(db, zStartAff);
@@ -138432,6 +139088,12 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
/* Check if the index cursor is past the end of the range. */
if( nConstraint ){
+ if( regBignull ){
+ /* Except, skip the end-of-range check while doing the NULL-scan */
+ sqlite3VdbeAddOp2(v, OP_IfNot, regBignull, sqlite3VdbeCurrentAddr(v)+3);
+ VdbeComment((v, "If NULL-scan 2nd pass"));
+ VdbeCoverage(v);
+ }
op = aEndOp[bRev*2 + endEq];
sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase, nConstraint);
testcase( op==OP_IdxGT ); VdbeCoverageIf(v, op==OP_IdxGT );
@@ -138439,6 +139101,23 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
testcase( op==OP_IdxLT ); VdbeCoverageIf(v, op==OP_IdxLT );
testcase( op==OP_IdxLE ); VdbeCoverageIf(v, op==OP_IdxLE );
}
+ if( regBignull ){
+ /* During a NULL-scan, check to see if we have reached the end of
+ ** the NULLs */
+ assert( bSeekPastNull==!bStopAtNull );
+ assert( bSeekPastNull+bStopAtNull==1 );
+ assert( nConstraint+bSeekPastNull>0 );
+ sqlite3VdbeAddOp2(v, OP_If, regBignull, sqlite3VdbeCurrentAddr(v)+2);
+ VdbeComment((v, "If NULL-scan 1st pass"));
+ VdbeCoverage(v);
+ op = aEndOp[bRev*2 + bSeekPastNull];
+ sqlite3VdbeAddOp4Int(v, op, iIdxCur, addrNxt, regBase,
+ nConstraint+bSeekPastNull);
+ testcase( op==OP_IdxGT ); VdbeCoverageIf(v, op==OP_IdxGT );
+ testcase( op==OP_IdxGE ); VdbeCoverageIf(v, op==OP_IdxGE );
+ testcase( op==OP_IdxLT ); VdbeCoverageIf(v, op==OP_IdxLT );
+ testcase( op==OP_IdxLE ); VdbeCoverageIf(v, op==OP_IdxLE );
+ }
if( pLoop->wsFlags & WHERE_IN_EARLYOUT ){
sqlite3VdbeAddOp2(v, OP_SeekHit, iIdxCur, 1);
@@ -139065,7 +139744,7 @@ static int whereClauseInsert(WhereClause *pWC, Expr *p, u16 wtFlags){
}else{
pTerm->truthProb = 1;
}
- pTerm->pExpr = sqlite3ExprSkipCollate(p);
+ pTerm->pExpr = sqlite3ExprSkipCollateAndLikely(p);
pTerm->wtFlags = wtFlags;
pTerm->pWC = pWC;
pTerm->iParent = -1;
@@ -139098,10 +139777,16 @@ static int allowedOp(int op){
** the left hand side of a comparison overrides any collation sequence
** attached to the right. For the same reason the EP_Collate flag
** is not commuted.
+**
+** The return value is extra flags that are added to the WhereTerm object
+** after it is commuted. The only extra flag ever added is TERM_NOPARTIDX
+** which prevents the term from being used to enable a partial index if
+** COLLATE changes have been made.
*/
-static void exprCommute(Parse *pParse, Expr *pExpr){
+static u16 exprCommute(Parse *pParse, Expr *pExpr){
u16 expRight = (pExpr->pRight->flags & EP_Collate);
u16 expLeft = (pExpr->pLeft->flags & EP_Collate);
+ u16 wtFlags = 0;
assert( allowedOp(pExpr->op) && pExpr->op!=TK_IN );
if( expRight==expLeft ){
/* Either X and Y both have COLLATE operator or neither do */
@@ -139109,11 +139794,13 @@ static void exprCommute(Parse *pParse, Expr *pExpr){
/* Both X and Y have COLLATE operators. Make sure X is always
** used by clearing the EP_Collate flag from Y. */
pExpr->pRight->flags &= ~EP_Collate;
+ wtFlags |= TERM_NOPARTIDX;
}else if( sqlite3ExprCollSeq(pParse, pExpr->pLeft)!=0 ){
/* Neither X nor Y have COLLATE operators, but X has a non-default
** collating sequence. So add the EP_Collate marker on X to cause
** it to be searched first. */
pExpr->pLeft->flags |= EP_Collate;
+ wtFlags |= TERM_NOPARTIDX;
}
}
SWAP(Expr*,pExpr->pRight,pExpr->pLeft);
@@ -139125,6 +139812,7 @@ static void exprCommute(Parse *pParse, Expr *pExpr){
assert( pExpr->op>=TK_GT && pExpr->op<=TK_GE );
pExpr->op = ((pExpr->op-TK_GT)^2)+TK_GT;
}
+ return wtFlags;
}
/*
@@ -139256,6 +139944,7 @@ static int isLikeOrGlob(
** 2019-05-02 https://sqlite.org/src/info/b043a54c3de54b28
** 2019-06-10 https://sqlite.org/src/info/fd76310a5e843e07
** 2019-06-14 https://sqlite.org/src/info/ce8717f0885af975
+ ** 2019-09-03 https://sqlite.org/src/info/0f0428096f17252a
*/
if( pLeft->op!=TK_COLUMN
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
@@ -139265,9 +139954,13 @@ static int isLikeOrGlob(
double rDummy;
isNum = sqlite3AtoF(zNew, &rDummy, iTo, SQLITE_UTF8);
if( isNum<=0 ){
- zNew[iTo-1]++;
- isNum = sqlite3AtoF(zNew, &rDummy, iTo, SQLITE_UTF8);
- zNew[iTo-1]--;
+ if( iTo==1 && zNew[0]=='-' ){
+ isNum = +1;
+ }else{
+ zNew[iTo-1]++;
+ isNum = sqlite3AtoF(zNew, &rDummy, iTo, SQLITE_UTF8);
+ zNew[iTo-1]--;
+ }
}
if( isNum>0 ){
sqlite3ExprDelete(db, pPrefix);
@@ -140121,7 +140814,7 @@ static void exprAnalyze(
pDup = pExpr;
pNew = pTerm;
}
- exprCommute(pParse, pDup);
+ pNew->wtFlags |= exprCommute(pParse, pDup);
pNew->leftCursor = aiCurCol[0];
pNew->u.leftColumn = aiCurCol[1];
testcase( (prereqLeft | extraRight) != prereqLeft );
@@ -140362,8 +141055,8 @@ static void exprAnalyze(
}
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
- /* When sqlite_stat3 histogram data is available an operator of the
+#ifdef SQLITE_ENABLE_STAT4
+ /* When sqlite_stat4 histogram data is available an operator of the
** form "x IS NOT NULL" can sometimes be evaluated more efficiently
** as "x>NULL" if x is not an INTEGER PRIMARY KEY. So construct a
** virtual term of that form.
@@ -140374,7 +141067,7 @@ static void exprAnalyze(
&& pExpr->pLeft->op==TK_COLUMN
&& pExpr->pLeft->iColumn>=0
&& !ExprHasProperty(pExpr, EP_FromJoin)
- && OptimizationEnabled(db, SQLITE_Stat34)
+ && OptimizationEnabled(db, SQLITE_Stat4)
){
Expr *pNewExpr;
Expr *pLeft = pExpr->pLeft;
@@ -140399,7 +141092,7 @@ static void exprAnalyze(
pNewTerm->prereqAll = pTerm->prereqAll;
}
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
/* Prevent ON clause terms of a LEFT JOIN from being used to drive
** an index for tables to the left of the join.
@@ -140432,7 +141125,7 @@ static void exprAnalyze(
** all terms of the WHERE clause.
*/
SQLITE_PRIVATE void sqlite3WhereSplit(WhereClause *pWC, Expr *pExpr, u8 op){
- Expr *pE2 = sqlite3ExprSkipCollate(pExpr);
+ Expr *pE2 = sqlite3ExprSkipCollateAndLikely(pExpr);
pWC->op = op;
if( pE2==0 ) return;
if( pE2->op!=op ){
@@ -140847,7 +141540,8 @@ static WhereTerm *whereScanNext(WhereScan *pScan){
){
if( (pTerm->eOperator & WO_EQUIV)!=0
&& pScan->nEquiv<ArraySize(pScan->aiCur)
- && (pX = sqlite3ExprSkipCollate(pTerm->pExpr->pRight))->op==TK_COLUMN
+ && (pX = sqlite3ExprSkipCollateAndLikely(pTerm->pExpr->pRight))->op
+ ==TK_COLUMN
){
int j;
for(j=0; j<pScan->nEquiv; j++){
@@ -141043,7 +141737,7 @@ static int findIndexCol(
const char *zColl = pIdx->azColl[iCol];
for(i=0; i<pList->nExpr; i++){
- Expr *p = sqlite3ExprSkipCollate(pList->a[i].pExpr);
+ Expr *p = sqlite3ExprSkipCollateAndLikely(pList->a[i].pExpr);
if( p->op==TK_COLUMN
&& p->iColumn==pIdx->aiColumn[iCol]
&& p->iTable==iBase
@@ -141107,7 +141801,7 @@ static int isDistinctRedundant(
** current SELECT is a correlated sub-query.
*/
for(i=0; i<pDistinct->nExpr; i++){
- Expr *p = sqlite3ExprSkipCollate(pDistinct->a[i].pExpr);
+ Expr *p = sqlite3ExprSkipCollateAndLikely(pDistinct->a[i].pExpr);
if( p->op==TK_COLUMN && p->iTable==iBase && p->iColumn<0 ) return 1;
}
@@ -141527,6 +142221,7 @@ static sqlite3_index_info *allocateIndexInfo(
for(i=0; i<n; i++){
Expr *pExpr = pOrderBy->a[i].pExpr;
if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break;
+ if( pOrderBy->a[i].sortFlags & KEYINFO_ORDER_BIGNULL ) break;
}
if( i==n){
nOrderBy = n;
@@ -141625,7 +142320,7 @@ static sqlite3_index_info *allocateIndexInfo(
for(i=0; i<nOrderBy; i++){
Expr *pExpr = pOrderBy->a[i].pExpr;
pIdxOrderBy[i].iColumn = pExpr->iColumn;
- pIdxOrderBy[i].desc = pOrderBy->a[i].sortOrder;
+ pIdxOrderBy[i].desc = pOrderBy->a[i].sortFlags & KEYINFO_ORDER_DESC;
}
*pmNoOmit = mNoOmit;
@@ -141671,7 +142366,7 @@ static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){
}
#endif /* !defined(SQLITE_OMIT_VIRTUALTABLE) */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** Estimate the location of a particular key among all keys in an
** index. Store the results in aStat as follows:
@@ -141864,7 +142559,7 @@ static int whereKeyStats(
pRec->nField = nField;
return i;
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
/*
** If it is not NULL, pTerm is a term that provides an upper or lower
@@ -141890,7 +142585,7 @@ static LogEst whereRangeAdjust(WhereTerm *pTerm, LogEst nNew){
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** Return the affinity for a single column of an index.
*/
@@ -141899,12 +142594,13 @@ SQLITE_PRIVATE char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCo
if( !pIdx->zColAff ){
if( sqlite3IndexAffinityStr(db, pIdx)==0 ) return SQLITE_AFF_BLOB;
}
+ assert( pIdx->zColAff[iCol]!=0 );
return pIdx->zColAff[iCol];
}
#endif
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** This function is called to estimate the number of rows visited by a
** range-scan on a skip-scan index. For example:
@@ -142010,7 +142706,7 @@ static int whereRangeSkipScanEst(
return rc;
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
/*
** This function is used to estimate the number of rows that will be visited
@@ -142063,12 +142759,12 @@ static int whereRangeScanEst(
int nOut = pLoop->nOut;
LogEst nNew;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
Index *p = pLoop->u.btree.pIndex;
int nEq = pLoop->u.btree.nEq;
- if( p->nSample>0 && nEq<p->nSampleCol
- && OptimizationEnabled(pParse->db, SQLITE_Stat34)
+ if( p->nSample>0 && ALWAYS(nEq<p->nSampleCol)
+ && OptimizationEnabled(pParse->db, SQLITE_Stat4)
){
if( nEq==pBuilder->nRecValid ){
UnpackedRecord *pRec = pBuilder->pRec;
@@ -142166,7 +142862,7 @@ static int whereRangeScanEst(
/* TUNING: If both iUpper and iLower are derived from the same
** sample, then assume they are 4x more selective. This brings
** the estimated selectivity more in line with what it would be
- ** if estimated without the use of STAT3/4 tables. */
+ ** if estimated without the use of STAT4 tables. */
if( iLwrIdx==iUprIdx ) nNew -= 20; assert( 20==sqlite3LogEst(4) );
}else{
nNew = 10; assert( 10==sqlite3LogEst(2) );
@@ -142215,12 +142911,12 @@ static int whereRangeScanEst(
return rc;
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** Estimate the number of rows that will be returned based on
** an equality constraint x=VALUE and where that VALUE occurs in
** the histogram data. This only works when x is the left-most
-** column of an index and sqlite_stat3 histogram data is available
+** column of an index and sqlite_stat4 histogram data is available
** for that index. When pExpr==NULL that means the constraint is
** "x IS NULL" instead of "x=VALUE".
**
@@ -142278,9 +142974,9 @@ static int whereEqualScanEst(
return rc;
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
/*
** Estimate the number of rows that will be returned based on
** an IN constraint where the right-hand side of the IN operator
@@ -142327,7 +143023,7 @@ static int whereInScanEst(
assert( pBuilder->nRecValid==nRecValid );
return rc;
}
-#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */
+#endif /* SQLITE_ENABLE_STAT4 */
#ifdef WHERETRACE_ENABLED
@@ -142859,11 +143555,12 @@ static void whereLoopOutputAdjust(
){
WhereTerm *pTerm, *pX;
Bitmask notAllowed = ~(pLoop->prereq|pLoop->maskSelf);
- int i, j, k;
+ int i, j;
LogEst iReduce = 0; /* pLoop->nOut should not exceed nRow-iReduce */
assert( (pLoop->wsFlags & WHERE_AUTO_INDEX)==0 );
for(i=pWC->nTerm, pTerm=pWC->a; i>0; i--, pTerm++){
+ assert( pTerm!=0 );
if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) break;
if( (pTerm->prereqAll & pLoop->maskSelf)==0 ) continue;
if( (pTerm->prereqAll & notAllowed)!=0 ) continue;
@@ -142884,6 +143581,7 @@ static void whereLoopOutputAdjust(
pLoop->nOut--;
if( pTerm->eOperator&(WO_EQ|WO_IS) ){
Expr *pRight = pTerm->pExpr->pRight;
+ int k = 0;
testcase( pTerm->pExpr->op==TK_IS );
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){
k = 10;
@@ -143047,7 +143745,7 @@ static int whereLoopAddBtreeIndex(
LogEst rCostIdx;
LogEst nOutUnadjusted; /* nOut before IN() and WHERE adjustments */
int nIn = 0;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
int nRecValid = pBuilder->nRecValid;
#endif
if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0)
@@ -143108,8 +143806,6 @@ static int whereLoopAddBtreeIndex(
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){
/* "x IN (value, value, ...)" */
nIn = sqlite3LogEst(pExpr->x.pList->nExpr);
- assert( nIn>0 ); /* RHS always has 2 or more terms... The parser
- ** changes "x IN (?)" into "x=?". */
}
if( pProbe->hasStat1 ){
LogEst M, logK, safetyMargin;
@@ -143205,7 +143901,7 @@ static int whereLoopAddBtreeIndex(
** the value of pNew->nOut to account for pTerm (but not nIn/nInMul). */
assert( pNew->nOut==saved_nOut );
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
- /* Adjust nOut using stat3/stat4 data. Or, if there is no stat3/stat4
+ /* Adjust nOut using stat4 data. Or, if there is no stat4
** data, using some other estimate. */
whereRangeScanEst(pParse, pBuilder, pBtm, pTop, pNew);
}else{
@@ -143219,13 +143915,13 @@ static int whereLoopAddBtreeIndex(
pNew->nOut += pTerm->truthProb;
pNew->nOut -= nIn;
}else{
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
tRowcnt nOut = 0;
if( nInMul==0
&& pProbe->nSample
&& pNew->u.btree.nEq<=pProbe->nSampleCol
&& ((eOp & WO_IN)==0 || !ExprHasProperty(pTerm->pExpr, EP_xIsSelect))
- && OptimizationEnabled(db, SQLITE_Stat34)
+ && OptimizationEnabled(db, SQLITE_Stat4)
){
Expr *pExpr = pTerm->pExpr;
if( (eOp & (WO_EQ|WO_ISNULL|WO_IS))!=0 ){
@@ -143288,7 +143984,7 @@ static int whereLoopAddBtreeIndex(
whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nInMul+nIn);
}
pNew->nOut = saved_nOut;
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
pBuilder->nRecValid = nRecValid;
#endif
}
@@ -143361,7 +144057,7 @@ static int indexMightHelpWithOrderBy(
if( pIndex->bUnordered ) return 0;
if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0;
for(ii=0; ii<pOB->nExpr; ii++){
- Expr *pExpr = sqlite3ExprSkipCollate(pOB->a[ii].pExpr);
+ Expr *pExpr = sqlite3ExprSkipCollateAndLikely(pOB->a[ii].pExpr);
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){
if( pExpr->iColumn<0 ) return 1;
for(jj=0; jj<pIndex->nKeyCol; jj++){
@@ -143392,7 +144088,9 @@ static int whereUsablePartialIndex(int iTab, WhereClause *pWC, Expr *pWhere){
}
if( pParse->db->flags & SQLITE_EnableQPSG ) pParse = 0;
for(i=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
- Expr *pExpr = pTerm->pExpr;
+ Expr *pExpr;
+ if( pTerm->wtFlags & TERM_NOPARTIDX ) continue;
+ pExpr = pTerm->pExpr;
if( (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable==iTab)
&& sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab)
){
@@ -143661,7 +144359,7 @@ static int whereLoopAddBtree(
** plan */
pTab->tabFlags |= TF_StatsUsed;
}
-#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
+#ifdef SQLITE_ENABLE_STAT4
sqlite3Stat4ProbeFree(pBuilder->pRec);
pBuilder->nRecValid = 0;
pBuilder->pRec = 0;
@@ -144289,8 +144987,8 @@ static i8 wherePathSatisfiesOrderBy(
if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
if( pLoop->u.vtab.isOrdered ) obSat = obDone;
break;
- }else{
- pLoop->u.btree.nIdxCol = 0;
+ }else if( wctrlFlags & WHERE_DISTINCTBY ){
+ pLoop->u.btree.nDistinctCol = 0;
}
iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;
@@ -144301,7 +144999,7 @@ static i8 wherePathSatisfiesOrderBy(
*/
for(i=0; i<nOrderBy; i++){
if( MASKBIT(i) & obSat ) continue;
- pOBExpr = sqlite3ExprSkipCollate(pOrderBy->a[i].pExpr);
+ pOBExpr = sqlite3ExprSkipCollateAndLikely(pOrderBy->a[i].pExpr);
if( pOBExpr->op!=TK_COLUMN ) continue;
if( pOBExpr->iTable!=iCur ) continue;
pTerm = sqlite3WhereFindTerm(&pWInfo->sWC, iCur, pOBExpr->iColumn,
@@ -144338,7 +145036,8 @@ static i8 wherePathSatisfiesOrderBy(
assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
assert( pIndex->aiColumn[nColumn-1]==XN_ROWID
|| !HasRowid(pIndex->pTable));
- isOrderDistinct = IsUniqueIndex(pIndex);
+ isOrderDistinct = IsUniqueIndex(pIndex)
+ && (pLoop->wsFlags & WHERE_SKIPSCAN)==0;
}
/* Loop through all columns of the index and deal with the ones
@@ -144356,15 +145055,21 @@ static i8 wherePathSatisfiesOrderBy(
u16 eOp = pLoop->aLTerm[j]->eOperator;
/* Skip over == and IS and ISNULL terms. (Also skip IN terms when
- ** doing WHERE_ORDERBY_LIMIT processing).
+ ** doing WHERE_ORDERBY_LIMIT processing). Except, IS and ISNULL
+ ** terms imply that the index is not UNIQUE NOT NULL in which case
+ ** the loop need to be marked as not order-distinct because it can
+ ** have repeated NULL rows.
**
** If the current term is a column of an ((?,?) IN (SELECT...))
** expression for which the SELECT returns more than one column,
** check that it is the only column used by this loop. Otherwise,
** if it is one of two or more, none of the columns can be
- ** considered to match an ORDER BY term. */
+ ** considered to match an ORDER BY term.
+ */
if( (eOp & eqOpMask)!=0 ){
- if( eOp & WO_ISNULL ){
+ if( eOp & (WO_ISNULL|WO_IS) ){
+ testcase( eOp & WO_ISNULL );
+ testcase( eOp & WO_IS );
testcase( isOrderDistinct );
isOrderDistinct = 0;
}
@@ -144390,7 +145095,7 @@ static i8 wherePathSatisfiesOrderBy(
*/
if( pIndex ){
iColumn = pIndex->aiColumn[j];
- revIdx = pIndex->aSortOrder[j];
+ revIdx = pIndex->aSortOrder[j] & KEYINFO_ORDER_DESC;
if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID;
}else{
iColumn = XN_ROWID;
@@ -144414,7 +145119,7 @@ static i8 wherePathSatisfiesOrderBy(
isMatch = 0;
for(i=0; bOnce && i<nOrderBy; i++){
if( MASKBIT(i) & obSat ) continue;
- pOBExpr = sqlite3ExprSkipCollate(pOrderBy->a[i].pExpr);
+ pOBExpr = sqlite3ExprSkipCollateAndLikely(pOrderBy->a[i].pExpr);
testcase( wctrlFlags & WHERE_GROUPBY );
testcase( wctrlFlags & WHERE_DISTINCTBY );
if( (wctrlFlags & (WHERE_GROUPBY|WHERE_DISTINCTBY))==0 ) bOnce = 0;
@@ -144432,7 +145137,9 @@ static i8 wherePathSatisfiesOrderBy(
pColl = sqlite3ExprNNCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr);
if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue;
}
- pLoop->u.btree.nIdxCol = j+1;
+ if( wctrlFlags & WHERE_DISTINCTBY ){
+ pLoop->u.btree.nDistinctCol = j+1;
+ }
isMatch = 1;
break;
}
@@ -144440,13 +145147,22 @@ static i8 wherePathSatisfiesOrderBy(
/* Make sure the sort order is compatible in an ORDER BY clause.
** Sort order is irrelevant for a GROUP BY clause. */
if( revSet ){
- if( (rev ^ revIdx)!=pOrderBy->a[i].sortOrder ) isMatch = 0;
+ if( (rev ^ revIdx)!=(pOrderBy->a[i].sortFlags&KEYINFO_ORDER_DESC) ){
+ isMatch = 0;
+ }
}else{
- rev = revIdx ^ pOrderBy->a[i].sortOrder;
+ rev = revIdx ^ (pOrderBy->a[i].sortFlags & KEYINFO_ORDER_DESC);
if( rev ) *pRevMask |= MASKBIT(iLoop);
revSet = 1;
}
}
+ if( isMatch && (pOrderBy->a[i].sortFlags & KEYINFO_ORDER_BIGNULL) ){
+ if( j==pLoop->u.btree.nEq ){
+ pLoop->wsFlags |= WHERE_BIGNULL_SORT;
+ }else{
+ isMatch = 0;
+ }
+ }
if( isMatch ){
if( iColumn==XN_ROWID ){
testcase( distinctColumns==0 );
@@ -145360,6 +146076,16 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
sqlite3DebugPrintf(", limit: %d", iAuxArg);
}
sqlite3DebugPrintf(")\n");
+ if( sqlite3WhereTrace & 0x100 ){
+ Select sSelect;
+ memset(&sSelect, 0, sizeof(sSelect));
+ sSelect.selFlags = SF_WhereBegin;
+ sSelect.pSrc = pTabList;
+ sSelect.pWhere = pWhere;
+ sSelect.pOrderBy = pOrderBy;
+ sSelect.pEList = pResultSet;
+ sqlite3TreeViewSelect(0, &sSelect, 0);
+ }
}
if( sqlite3WhereTrace & 0x100 ){ /* Display all terms of the WHERE clause */
sqlite3WhereClausePrint(sWLB.pWC);
@@ -145636,6 +146362,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
sqlite3VdbeSetP4KeyInfo(pParse, pIx);
if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0
&& (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0
+ && (pLoop->wsFlags & WHERE_BIGNULL_SORT)==0
&& (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0
&& pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED
){
@@ -145753,7 +146480,7 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
&& i==pWInfo->nLevel-1 /* Ticket [ef9318757b152e3] 2017-10-21 */
&& (pLoop->wsFlags & WHERE_INDEXED)!=0
&& (pIdx = pLoop->u.btree.pIndex)->hasStat1
- && (n = pLoop->u.btree.nIdxCol)>0
+ && (n = pLoop->u.btree.nDistinctCol)>0
&& pIdx->aiRowLogEst[n]>=36
){
int r1 = pParse->nMem+1;
@@ -145777,6 +146504,11 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
VdbeCoverageIf(v, pLevel->op==OP_Next);
VdbeCoverageIf(v, pLevel->op==OP_Prev);
VdbeCoverageIf(v, pLevel->op==OP_VNext);
+ if( pLevel->regBignull ){
+ sqlite3VdbeResolveLabel(v, pLevel->addrBignull);
+ sqlite3VdbeAddOp2(v, OP_DecrJumpZero, pLevel->regBignull, pLevel->p2-1);
+ VdbeCoverage(v);
+ }
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);
#endif
@@ -146716,6 +147448,8 @@ struct WindowRewrite {
static int selectWindowRewriteExprCb(Walker *pWalker, Expr *pExpr){
struct WindowRewrite *p = pWalker->u.pRewrite;
Parse *pParse = pWalker->pParse;
+ assert( p!=0 );
+ assert( p->pWin!=0 );
/* If this function is being called from within a scalar sub-select
** that used by the SELECT statement being processed, only process
@@ -146815,6 +147549,7 @@ static void selectWindowRewriteEList(
Walker sWalker;
WindowRewrite sRewrite;
+ assert( pWin!=0 );
memset(&sWalker, 0, sizeof(Walker));
memset(&sRewrite, 0, sizeof(WindowRewrite));
@@ -146853,7 +147588,7 @@ static ExprList *exprListAppendList(
pDup->flags &= ~(EP_IntValue|EP_IsTrue|EP_IsFalse);
}
pList = sqlite3ExprListAppend(pParse, pList, pDup);
- if( pList ) pList->a[nInit+i].sortOrder = pAppend->a[i].sortOrder;
+ if( pList ) pList->a[nInit+i].sortFlags = pAppend->a[i].sortFlags;
}
}
return pList;
@@ -146899,11 +147634,14 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
** redundant, remove the ORDER BY from the parent SELECT. */
pSort = sqlite3ExprListDup(db, pMWin->pPartition, 0);
pSort = exprListAppendList(pParse, pSort, pMWin->pOrderBy, 1);
- if( pSort && p->pOrderBy ){
+ if( pSort && p->pOrderBy && p->pOrderBy->nExpr<=pSort->nExpr ){
+ int nSave = pSort->nExpr;
+ pSort->nExpr = p->pOrderBy->nExpr;
if( sqlite3ExprListCompare(pSort, p->pOrderBy, -1)==0 ){
sqlite3ExprListDelete(db, p->pOrderBy);
p->pOrderBy = 0;
}
+ pSort->nExpr = nSave;
}
/* Assign a cursor number for the ephemeral table used to buffer rows.
@@ -146927,8 +147665,15 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
** window function - one for the accumulator, another for interim
** results. */
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
- pWin->iArgCol = (pSublist ? pSublist->nExpr : 0);
- pSublist = exprListAppendList(pParse, pSublist, pWin->pOwner->x.pList, 0);
+ ExprList *pArgs = pWin->pOwner->x.pList;
+ if( pWin->pFunc->funcFlags & SQLITE_FUNC_SUBTYPE ){
+ selectWindowRewriteEList(pParse, pMWin, pSrc, pArgs, pTab, &pSublist);
+ pWin->iArgCol = (pSublist ? pSublist->nExpr : 0);
+ pWin->bExprArgs = 1;
+ }else{
+ pWin->iArgCol = (pSublist ? pSublist->nExpr : 0);
+ pSublist = exprListAppendList(pParse, pSublist, pArgs, 0);
+ }
if( pWin->pFilter ){
Expr *pFilter = sqlite3ExprDup(db, pWin->pFilter, 0);
pSublist = sqlite3ExprListAppend(pParse, pSublist, pFilter);
@@ -146946,7 +147691,7 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
*/
if( pSublist==0 ){
pSublist = sqlite3ExprListAppend(pParse, 0,
- sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0)
+ sqlite3Expr(db, TK_INTEGER, "0")
);
}
@@ -146959,7 +147704,7 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
p->pSrc->a[0].pSelect = pSub;
sqlite3SrcListAssignCursors(pParse, p->pSrc);
pSub->selFlags |= SF_Expanded;
- pTab2 = sqlite3ResultSetOfSelect(pParse, pSub);
+ pTab2 = sqlite3ResultSetOfSelect(pParse, pSub, SQLITE_AFF_NONE);
if( pTab2==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -146983,10 +147728,23 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
}
/*
+** Unlink the Window object from the Select to which it is attached,
+** if it is attached.
+*/
+SQLITE_PRIVATE void sqlite3WindowUnlinkFromSelect(Window *p){
+ if( p->ppThis ){
+ *p->ppThis = p->pNextWin;
+ if( p->pNextWin ) p->pNextWin->ppThis = p->ppThis;
+ p->ppThis = 0;
+ }
+}
+
+/*
** Free the Window object passed as the second argument.
*/
SQLITE_PRIVATE void sqlite3WindowDelete(sqlite3 *db, Window *p){
if( p ){
+ sqlite3WindowUnlinkFromSelect(p);
sqlite3ExprDelete(db, p->pFilter);
sqlite3ExprListDelete(db, p->pPartition);
sqlite3ExprListDelete(db, p->pOrderBy);
@@ -147164,17 +147922,14 @@ SQLITE_PRIVATE void sqlite3WindowChain(Parse *pParse, Window *pWin, Window *pLis
SQLITE_PRIVATE void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){
if( p ){
assert( p->op==TK_FUNCTION );
- /* This routine is only called for the parser. If pWin was not
- ** allocated due to an OOM, then the parser would fail before ever
- ** invoking this routine */
- if( ALWAYS(pWin) ){
- p->y.pWin = pWin;
- ExprSetProperty(p, EP_WinFunc);
- pWin->pOwner = p;
- if( p->flags & EP_Distinct ){
- sqlite3ErrorMsg(pParse,
- "DISTINCT is not supported for window functions");
- }
+ assert( pWin );
+ p->y.pWin = pWin;
+ ExprSetProperty(p, EP_WinFunc);
+ pWin->pOwner = p;
+ if( (p->flags & EP_Distinct) && pWin->eFrmType!=TK_FILTER ){
+ sqlite3ErrorMsg(pParse,
+ "DISTINCT is not supported for window functions"
+ );
}
}else{
sqlite3WindowDelete(pParse->db, pWin);
@@ -147182,10 +147937,29 @@ SQLITE_PRIVATE void sqlite3WindowAttach(Parse *pParse, Expr *p, Window *pWin){
}
/*
+** Possibly link window pWin into the list at pSel->pWin (window functions
+** to be processed as part of SELECT statement pSel). The window is linked
+** in if either (a) there are no other windows already linked to this
+** SELECT, or (b) the windows already linked use a compatible window frame.
+*/
+SQLITE_PRIVATE void sqlite3WindowLink(Select *pSel, Window *pWin){
+ if( 0==pSel->pWin
+ || 0==sqlite3WindowCompare(0, pSel->pWin, pWin, 0)
+ ){
+ pWin->pNextWin = pSel->pWin;
+ if( pSel->pWin ){
+ pSel->pWin->ppThis = &pWin->pNextWin;
+ }
+ pSel->pWin = pWin;
+ pWin->ppThis = &pSel->pWin;
+ }
+}
+
+/*
** Return 0 if the two window objects are identical, or non-zero otherwise.
** Identical window objects can be processed in a single scan.
*/
-SQLITE_PRIVATE int sqlite3WindowCompare(Parse *pParse, Window *p1, Window *p2){
+SQLITE_PRIVATE int sqlite3WindowCompare(Parse *pParse, Window *p1, Window *p2, int bFilter){
if( p1->eFrmType!=p2->eFrmType ) return 1;
if( p1->eStart!=p2->eStart ) return 1;
if( p1->eEnd!=p2->eEnd ) return 1;
@@ -147194,6 +147968,9 @@ SQLITE_PRIVATE int sqlite3WindowCompare(Parse *pParse, Window *p1, Window *p2){
if( sqlite3ExprCompare(pParse, p1->pEnd, p2->pEnd, -1) ) return 1;
if( sqlite3ExprListCompare(p1->pPartition, p2->pPartition, -1) ) return 1;
if( sqlite3ExprListCompare(p1->pOrderBy, p2->pOrderBy, -1) ) return 1;
+ if( bFilter ){
+ if( sqlite3ExprCompare(pParse, p1->pFilter, p2->pFilter, -1) ) return 1;
+ }
return 0;
}
@@ -147245,8 +148022,8 @@ SQLITE_PRIVATE void sqlite3WindowCodeInit(Parse *pParse, Window *pMWin){
pWin->regApp = pParse->nMem+1;
pParse->nMem += 3;
if( pKeyInfo && pWin->pFunc->zName[1]=='i' ){
- assert( pKeyInfo->aSortOrder[0]==0 );
- pKeyInfo->aSortOrder[0] = 1;
+ assert( pKeyInfo->aSortFlags[0]==0 );
+ pKeyInfo->aSortFlags[0] = KEYINFO_ORDER_DESC;
}
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pWin->csrApp, 2);
sqlite3VdbeAppendP4(v, pKeyInfo, P4_KEYINFO);
@@ -147331,6 +148108,108 @@ static int windowArgCount(Window *pWin){
return (pList ? pList->nExpr : 0);
}
+typedef struct WindowCodeArg WindowCodeArg;
+typedef struct WindowCsrAndReg WindowCsrAndReg;
+
+/*
+** See comments above struct WindowCodeArg.
+*/
+struct WindowCsrAndReg {
+ int csr; /* Cursor number */
+ int reg; /* First in array of peer values */
+};
+
+/*
+** A single instance of this structure is allocated on the stack by
+** sqlite3WindowCodeStep() and a pointer to it passed to the various helper
+** routines. This is to reduce the number of arguments required by each
+** helper function.
+**
+** regArg:
+** Each window function requires an accumulator register (just as an
+** ordinary aggregate function does). This variable is set to the first
+** in an array of accumulator registers - one for each window function
+** in the WindowCodeArg.pMWin list.
+**
+** eDelete:
+** The window functions implementation sometimes caches the input rows
+** that it processes in a temporary table. If it is not zero, this
+** variable indicates when rows may be removed from the temp table (in
+** order to reduce memory requirements - it would always be safe just
+** to leave them there). Possible values for eDelete are:
+**
+** WINDOW_RETURN_ROW:
+** An input row can be discarded after it is returned to the caller.
+**
+** WINDOW_AGGINVERSE:
+** An input row can be discarded after the window functions xInverse()
+** callbacks have been invoked in it.
+**
+** WINDOW_AGGSTEP:
+** An input row can be discarded after the window functions xStep()
+** callbacks have been invoked in it.
+**
+** start,current,end
+** Consider a window-frame similar to the following:
+**
+** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING)
+**
+** The windows functions implmentation caches the input rows in a temp
+** table, sorted by "a, b" (it actually populates the cache lazily, and
+** aggressively removes rows once they are no longer required, but that's
+** a mere detail). It keeps three cursors open on the temp table. One
+** (current) that points to the next row to return to the query engine
+** once its window function values have been calculated. Another (end)
+** points to the next row to call the xStep() method of each window function
+** on (so that it is 2 groups ahead of current). And a third (start) that
+** points to the next row to call the xInverse() method of each window
+** function on.
+**
+** Each cursor (start, current and end) consists of a VDBE cursor
+** (WindowCsrAndReg.csr) and an array of registers (starting at
+** WindowCodeArg.reg) that always contains a copy of the peer values
+** read from the corresponding cursor.
+**
+** Depending on the window-frame in question, all three cursors may not
+** be required. In this case both WindowCodeArg.csr and reg are set to
+** 0.
+*/
+struct WindowCodeArg {
+ Parse *pParse; /* Parse context */
+ Window *pMWin; /* First in list of functions being processed */
+ Vdbe *pVdbe; /* VDBE object */
+ int addrGosub; /* OP_Gosub to this address to return one row */
+ int regGosub; /* Register used with OP_Gosub(addrGosub) */
+ int regArg; /* First in array of accumulator registers */
+ int eDelete; /* See above */
+
+ WindowCsrAndReg start;
+ WindowCsrAndReg current;
+ WindowCsrAndReg end;
+};
+
+/*
+** Generate VM code to read the window frames peer values from cursor csr into
+** an array of registers starting at reg.
+*/
+static void windowReadPeerValues(
+ WindowCodeArg *p,
+ int csr,
+ int reg
+){
+ Window *pMWin = p->pMWin;
+ ExprList *pOrderBy = pMWin->pOrderBy;
+ if( pOrderBy ){
+ Vdbe *v = sqlite3GetVdbe(p->pParse);
+ ExprList *pPart = pMWin->pPartition;
+ int iColOff = pMWin->nBufferCol + (pPart ? pPart->nExpr : 0);
+ int i;
+ for(i=0; i<pOrderBy->nExpr; i++){
+ sqlite3VdbeAddOp3(v, OP_Column, csr, iColOff+i, reg+i);
+ }
+ }
+}
+
/*
** Generate VM code to invoke either xStep() (if bInverse is 0) or
** xInverse (if bInverse is non-zero) for each window function in the
@@ -147351,20 +148230,27 @@ static int windowArgCount(Window *pWin){
** number of rows in the current partition.
*/
static void windowAggStep(
- Parse *pParse,
+ WindowCodeArg *p,
Window *pMWin, /* Linked list of window functions */
int csr, /* Read arguments from this cursor */
int bInverse, /* True to invoke xInverse instead of xStep */
int reg /* Array of registers */
){
+ Parse *pParse = p->pParse;
Vdbe *v = sqlite3GetVdbe(pParse);
Window *pWin;
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
FuncDef *pFunc = pWin->pFunc;
int regArg;
- int nArg = windowArgCount(pWin);
+ int nArg = pWin->bExprArgs ? 0 : windowArgCount(pWin);
int i;
+ assert( bInverse==0 || pWin->eStart!=TK_UNBOUNDED );
+
+ /* All OVER clauses in the same window function aggregate step must
+ ** be the same. */
+ assert( pWin==pMWin || sqlite3WindowCompare(pParse,pWin,pMWin,0)==0 );
+
for(i=0; i<nArg; i++){
if( i!=1 || pFunc->zName!=nth_valueName ){
sqlite3VdbeAddOp3(v, OP_Column, csr, pWin->iArgCol+i, reg+i);
@@ -147402,14 +148288,30 @@ static void windowAggStep(
int addrIf = 0;
if( pWin->pFilter ){
int regTmp;
- assert( nArg==0 || nArg==pWin->pOwner->x.pList->nExpr );
- assert( nArg || pWin->pOwner->x.pList==0 );
+ assert( pWin->bExprArgs || !nArg ||nArg==pWin->pOwner->x.pList->nExpr );
+ assert( pWin->bExprArgs || nArg ||pWin->pOwner->x.pList==0 );
regTmp = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp3(v, OP_Column, csr, pWin->iArgCol+nArg,regTmp);
addrIf = sqlite3VdbeAddOp3(v, OP_IfNot, regTmp, 0, 1);
VdbeCoverage(v);
sqlite3ReleaseTempReg(pParse, regTmp);
}
+
+ if( pWin->bExprArgs ){
+ int iStart = sqlite3VdbeCurrentAddr(v);
+ VdbeOp *pOp, *pEnd;
+
+ nArg = pWin->pOwner->x.pList->nExpr;
+ regArg = sqlite3GetTempRange(pParse, nArg);
+ sqlite3ExprCodeExprList(pParse, pWin->pOwner->x.pList, regArg, 0, 0);
+
+ pEnd = sqlite3VdbeGetOp(v, -1);
+ for(pOp=sqlite3VdbeGetOp(v, iStart); pOp<=pEnd; pOp++){
+ if( pOp->opcode==OP_Column && pOp->p1==pWin->iEphCsr ){
+ pOp->p1 = csr;
+ }
+ }
+ }
if( pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){
CollSeq *pColl;
assert( nArg>0 );
@@ -147420,32 +148322,14 @@ static void windowAggStep(
bInverse, regArg, pWin->regAccum);
sqlite3VdbeAppendP4(v, pFunc, P4_FUNCDEF);
sqlite3VdbeChangeP5(v, (u8)nArg);
+ if( pWin->bExprArgs ){
+ sqlite3ReleaseTempRange(pParse, regArg, nArg);
+ }
if( addrIf ) sqlite3VdbeJumpHere(v, addrIf);
}
}
}
-typedef struct WindowCodeArg WindowCodeArg;
-typedef struct WindowCsrAndReg WindowCsrAndReg;
-struct WindowCsrAndReg {
- int csr;
- int reg;
-};
-
-struct WindowCodeArg {
- Parse *pParse;
- Window *pMWin;
- Vdbe *pVdbe;
- int regGosub;
- int addrGosub;
- int regArg;
- int eDelete;
-
- WindowCsrAndReg start;
- WindowCsrAndReg current;
- WindowCsrAndReg end;
-};
-
/*
** Values that may be passed as the second argument to windowCodeOp().
*/
@@ -147454,28 +148338,6 @@ struct WindowCodeArg {
#define WINDOW_AGGSTEP 3
/*
-** Generate VM code to read the window frames peer values from cursor csr into
-** an array of registers starting at reg.
-*/
-static void windowReadPeerValues(
- WindowCodeArg *p,
- int csr,
- int reg
-){
- Window *pMWin = p->pMWin;
- ExprList *pOrderBy = pMWin->pOrderBy;
- if( pOrderBy ){
- Vdbe *v = sqlite3GetVdbe(p->pParse);
- ExprList *pPart = pMWin->pPartition;
- int iColOff = pMWin->nBufferCol + (pPart ? pPart->nExpr : 0);
- int i;
- for(i=0; i<pOrderBy->nExpr; i++){
- sqlite3VdbeAddOp3(v, OP_Column, csr, iColOff+i, reg+i);
- }
- }
-}
-
-/*
** Generate VM code to invoke either xValue() (bFin==0) or xFinalize()
** (bFin==1) for each window function in the linked list starting at
** pMWin. Or, for built-in window-functions that do not use the standard
@@ -147535,8 +148397,12 @@ static void windowFullScan(WindowCodeArg *p){
int lblNext;
int lblBrk;
int addrNext;
- int csr = pMWin->csrApp;
+ int csr;
+
+ VdbeModuleComment((v, "windowFullScan begin"));
+ assert( pMWin!=0 );
+ csr = pMWin->csrApp;
nPeer = (pMWin->pOrderBy ? pMWin->pOrderBy->nExpr : 0);
lblNext = sqlite3VdbeMakeLabel(pParse);
@@ -147591,7 +148457,7 @@ static void windowFullScan(WindowCodeArg *p){
if( addrEq ) sqlite3VdbeJumpHere(v, addrEq);
}
- windowAggStep(pParse, pMWin, csr, 0, p->regArg);
+ windowAggStep(p, pMWin, csr, 0, p->regArg);
sqlite3VdbeResolveLabel(v, lblNext);
sqlite3VdbeAddOp2(v, OP_Next, csr, addrNext);
@@ -147606,6 +148472,7 @@ static void windowFullScan(WindowCodeArg *p){
}
windowAggFinal(p, 1);
+ VdbeModuleComment((v, "windowFullScan end"));
}
/*
@@ -147780,34 +148647,46 @@ static void windowIfNewPeer(
/*
** This function is called as part of generating VM programs for RANGE
** offset PRECEDING/FOLLOWING frame boundaries. Assuming "ASC" order for
-** the ORDER BY term in the window, it generates code equivalent to:
+** the ORDER BY term in the window, and that argument op is OP_Ge, it generates
+** code equivalent to:
**
** if( csr1.peerVal + regVal >= csr2.peerVal ) goto lbl;
**
-** A special type of arithmetic is used such that if csr.peerVal is not
-** a numeric type (real or integer), then the result of the addition is
-** a copy of csr1.peerVal.
+** The value of parameter op may also be OP_Gt or OP_Le. In these cases the
+** operator in the above pseudo-code is replaced with ">" or "<=", respectively.
+**
+** If the sort-order for the ORDER BY term in the window is DESC, then the
+** comparison is reversed. Instead of adding regVal to csr1.peerVal, it is
+** subtracted. And the comparison operator is inverted to - ">=" becomes "<=",
+** ">" becomes "<", and so on. So, with DESC sort order, if the argument op
+** is OP_Ge, the generated code is equivalent to:
+**
+** if( csr1.peerVal - regVal <= csr2.peerVal ) goto lbl;
+**
+** A special type of arithmetic is used such that if csr1.peerVal is not
+** a numeric type (real or integer), then the result of the addition addition
+** or subtraction is a a copy of csr1.peerVal.
*/
static void windowCodeRangeTest(
WindowCodeArg *p,
- int op, /* OP_Ge or OP_Gt */
- int csr1,
- int regVal,
- int csr2,
- int lbl
+ int op, /* OP_Ge, OP_Gt, or OP_Le */
+ int csr1, /* Cursor number for cursor 1 */
+ int regVal, /* Register containing non-negative number */
+ int csr2, /* Cursor number for cursor 2 */
+ int lbl /* Jump destination if condition is true */
){
Parse *pParse = p->pParse;
Vdbe *v = sqlite3GetVdbe(pParse);
- int reg1 = sqlite3GetTempReg(pParse);
- int reg2 = sqlite3GetTempReg(pParse);
- int arith = OP_Add;
- int addrGe;
-
- int regString = ++pParse->nMem;
+ ExprList *pOrderBy = p->pMWin->pOrderBy; /* ORDER BY clause for window */
+ int reg1 = sqlite3GetTempReg(pParse); /* Reg. for csr1.peerVal+regVal */
+ int reg2 = sqlite3GetTempReg(pParse); /* Reg. for csr2.peerVal */
+ int regString = ++pParse->nMem; /* Reg. for constant value '' */
+ int arith = OP_Add; /* OP_Add or OP_Subtract */
+ int addrGe; /* Jump destination */
assert( op==OP_Ge || op==OP_Gt || op==OP_Le );
- assert( p->pMWin->pOrderBy && p->pMWin->pOrderBy->nExpr==1 );
- if( p->pMWin->pOrderBy->a[0].sortOrder ){
+ assert( pOrderBy && pOrderBy->nExpr==1 );
+ if( pOrderBy->a[0].sortFlags & KEYINFO_ORDER_DESC ){
switch( op ){
case OP_Ge: op = OP_Le; break;
case OP_Gt: op = OP_Lt; break;
@@ -147816,27 +148695,95 @@ static void windowCodeRangeTest(
arith = OP_Subtract;
}
+ /* Read the peer-value from each cursor into a register */
windowReadPeerValues(p, csr1, reg1);
windowReadPeerValues(p, csr2, reg2);
- /* Check if the peer value for csr1 value is a text or blob by comparing
- ** it to the smallest possible string - ''. If it is, jump over the
- ** OP_Add or OP_Subtract operation and proceed directly to the comparison. */
+ VdbeModuleComment((v, "CodeRangeTest: if( R%d %s R%d %s R%d ) goto lbl",
+ reg1, (arith==OP_Add ? "+" : "-"), regVal,
+ ((op==OP_Ge) ? ">=" : (op==OP_Le) ? "<=" : (op==OP_Gt) ? ">" : "<"), reg2
+ ));
+
+ /* Register reg1 currently contains csr1.peerVal (the peer-value from csr1).
+ ** This block adds (or subtracts for DESC) the numeric value in regVal
+ ** from it. Or, if reg1 is not numeric (it is a NULL, a text value or a blob),
+ ** then leave reg1 as it is. In pseudo-code, this is implemented as:
+ **
+ ** if( reg1>='' ) goto addrGe;
+ ** reg1 = reg1 +/- regVal
+ ** addrGe:
+ **
+ ** Since all strings and blobs are greater-than-or-equal-to an empty string,
+ ** the add/subtract is skipped for these, as required. If reg1 is a NULL,
+ ** then the arithmetic is performed, but since adding or subtracting from
+ ** NULL is always NULL anyway, this case is handled as required too. */
sqlite3VdbeAddOp4(v, OP_String8, 0, regString, 0, "", P4_STATIC);
addrGe = sqlite3VdbeAddOp3(v, OP_Ge, regString, 0, reg1);
VdbeCoverage(v);
sqlite3VdbeAddOp3(v, arith, regVal, reg1, reg1);
sqlite3VdbeJumpHere(v, addrGe);
+
+ /* If the BIGNULL flag is set for the ORDER BY, then it is required to
+ ** consider NULL values to be larger than all other values, instead of
+ ** the usual smaller. The VDBE opcodes OP_Ge and so on do not handle this
+ ** (and adding that capability causes a performance regression), so
+ ** instead if the BIGNULL flag is set then cases where either reg1 or
+ ** reg2 are NULL are handled separately in the following block. The code
+ ** generated is equivalent to:
+ **
+ ** if( reg1 IS NULL ){
+ ** if( op==OP_Ge ) goto lbl;
+ ** if( op==OP_Gt && reg2 IS NOT NULL ) goto lbl;
+ ** if( op==OP_Le && reg2 IS NULL ) goto lbl;
+ ** }else if( reg2 IS NULL ){
+ ** if( op==OP_Le ) goto lbl;
+ ** }
+ **
+ ** Additionally, if either reg1 or reg2 are NULL but the jump to lbl is
+ ** not taken, control jumps over the comparison operator coded below this
+ ** block. */
+ if( pOrderBy->a[0].sortFlags & KEYINFO_ORDER_BIGNULL ){
+ /* This block runs if reg1 contains a NULL. */
+ int addr = sqlite3VdbeAddOp1(v, OP_NotNull, reg1); VdbeCoverage(v);
+ switch( op ){
+ case OP_Ge:
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, lbl);
+ break;
+ case OP_Gt:
+ sqlite3VdbeAddOp2(v, OP_NotNull, reg2, lbl);
+ VdbeCoverage(v);
+ break;
+ case OP_Le:
+ sqlite3VdbeAddOp2(v, OP_IsNull, reg2, lbl);
+ VdbeCoverage(v);
+ break;
+ default: assert( op==OP_Lt ); /* no-op */ break;
+ }
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+3);
+
+ /* This block runs if reg1 is not NULL, but reg2 is. */
+ sqlite3VdbeJumpHere(v, addr);
+ sqlite3VdbeAddOp2(v, OP_IsNull, reg2, lbl); VdbeCoverage(v);
+ if( op==OP_Gt || op==OP_Ge ){
+ sqlite3VdbeChangeP2(v, -1, sqlite3VdbeCurrentAddr(v)+1);
+ }
+ }
+
+ /* Compare registers reg2 and reg1, taking the jump if required. Note that
+ ** control skips over this test if the BIGNULL flag is set and either
+ ** reg1 or reg2 contain a NULL value. */
sqlite3VdbeAddOp3(v, op, reg2, lbl, reg1); VdbeCoverage(v);
sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
+
assert( op==OP_Ge || op==OP_Gt || op==OP_Lt || op==OP_Le );
testcase(op==OP_Ge); VdbeCoverageIf(v, op==OP_Ge);
testcase(op==OP_Lt); VdbeCoverageIf(v, op==OP_Lt);
testcase(op==OP_Le); VdbeCoverageIf(v, op==OP_Le);
testcase(op==OP_Gt); VdbeCoverageIf(v, op==OP_Gt);
-
sqlite3ReleaseTempReg(pParse, reg1);
sqlite3ReleaseTempReg(pParse, reg2);
+
+ VdbeModuleComment((v, "CodeRangeTest: end"));
}
/*
@@ -147856,9 +148803,7 @@ static int windowCodeOp(
Window *pMWin = p->pMWin;
int ret = 0;
Vdbe *v = p->pVdbe;
- int addrIf = 0;
int addrContinue = 0;
- int addrGoto = 0;
int bPeer = (pMWin->eFrmType!=TK_ROWS);
int lblDone = sqlite3VdbeMakeLabel(pParse);
@@ -147891,7 +148836,7 @@ static int windowCodeOp(
);
}
}else{
- addrIf = sqlite3VdbeAddOp3(v, OP_IfPos, regCountdown, 0, 1);
+ sqlite3VdbeAddOp3(v, OP_IfPos, regCountdown, lblDone, 1);
VdbeCoverage(v);
}
}
@@ -147900,6 +148845,25 @@ static int windowCodeOp(
windowAggFinal(p, 0);
}
addrContinue = sqlite3VdbeCurrentAddr(v);
+
+ /* If this is a (RANGE BETWEEN a FOLLOWING AND b FOLLOWING) or
+ ** (RANGE BETWEEN b PRECEDING AND a PRECEDING) frame, ensure the
+ ** start cursor does not advance past the end cursor within the
+ ** temporary table. It otherwise might, if (a>b). */
+ if( pMWin->eStart==pMWin->eEnd && regCountdown
+ && pMWin->eFrmType==TK_RANGE && op==WINDOW_AGGINVERSE
+ ){
+ int regRowid1 = sqlite3GetTempReg(pParse);
+ int regRowid2 = sqlite3GetTempReg(pParse);
+ sqlite3VdbeAddOp2(v, OP_Rowid, p->start.csr, regRowid1);
+ sqlite3VdbeAddOp2(v, OP_Rowid, p->end.csr, regRowid2);
+ sqlite3VdbeAddOp3(v, OP_Ge, regRowid2, lblDone, regRowid1);
+ VdbeCoverage(v);
+ sqlite3ReleaseTempReg(pParse, regRowid1);
+ sqlite3ReleaseTempReg(pParse, regRowid2);
+ assert( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_FOLLOWING );
+ }
+
switch( op ){
case WINDOW_RETURN_ROW:
csr = p->current.csr;
@@ -147914,7 +148878,7 @@ static int windowCodeOp(
assert( pMWin->regEndRowid );
sqlite3VdbeAddOp2(v, OP_AddImm, pMWin->regStartRowid, 1);
}else{
- windowAggStep(pParse, pMWin, csr, 1, p->regArg);
+ windowAggStep(p, pMWin, csr, 1, p->regArg);
}
break;
@@ -147926,7 +148890,7 @@ static int windowCodeOp(
assert( pMWin->regEndRowid );
sqlite3VdbeAddOp2(v, OP_AddImm, pMWin->regEndRowid, 1);
}else{
- windowAggStep(pParse, pMWin, csr, 0, p->regArg);
+ windowAggStep(p, pMWin, csr, 0, p->regArg);
}
break;
}
@@ -147944,7 +148908,7 @@ static int windowCodeOp(
sqlite3VdbeAddOp2(v, OP_Next, csr, sqlite3VdbeCurrentAddr(v)+1+bPeer);
VdbeCoverage(v);
if( bPeer ){
- addrGoto = sqlite3VdbeAddOp0(v, OP_Goto);
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, lblDone);
}
}
@@ -147960,8 +148924,6 @@ static int windowCodeOp(
sqlite3VdbeAddOp2(v, OP_Goto, 0, addrNextRange);
}
sqlite3VdbeResolveLabel(v, lblDone);
- if( addrGoto ) sqlite3VdbeJumpHere(v, addrGoto);
- if( addrIf ) sqlite3VdbeJumpHere(v, addrIf);
return ret;
}
@@ -147977,6 +148939,7 @@ SQLITE_PRIVATE Window *sqlite3WindowDup(sqlite3 *db, Expr *pOwner, Window *p){
pNew = sqlite3DbMallocZero(db, sizeof(Window));
if( pNew ){
pNew->zName = sqlite3DbStrDup(db, p->zName);
+ pNew->zBase = sqlite3DbStrDup(db, p->zBase);
pNew->pFilter = sqlite3ExprDup(db, p->pFilter, 0);
pNew->pFunc = p->pFunc;
pNew->pPartition = sqlite3ExprListDup(db, p->pPartition, 0);
@@ -147985,9 +148948,11 @@ SQLITE_PRIVATE Window *sqlite3WindowDup(sqlite3 *db, Expr *pOwner, Window *p){
pNew->eEnd = p->eEnd;
pNew->eStart = p->eStart;
pNew->eExclude = p->eExclude;
+ pNew->regResult = p->regResult;
pNew->pStart = sqlite3ExprDup(db, p->pStart, 0);
pNew->pEnd = sqlite3ExprDup(db, p->pEnd, 0);
pNew->pOwner = pOwner;
+ pNew->bImplicitFrame = p->bImplicitFrame;
}
}
return pNew;
@@ -148311,7 +149276,7 @@ static int windowExprGtZero(Parse *pParse, Expr *pExpr){
** regEnd = <expr2>
** regStart = <expr1>
** }else{
-** if( (csrEnd.key + regEnd) <= csrCurrent.key ){
+** while( (csrEnd.key + regEnd) <= csrCurrent.key ){
** AGGSTEP
** }
** while( (csrStart.key + regStart) < csrCurrent.key ){
@@ -148384,8 +149349,6 @@ SQLITE_PRIVATE void sqlite3WindowCodeStep(
int addrGosubFlush = 0; /* Address of OP_Gosub to flush: */
int addrInteger = 0; /* Address of OP_Integer */
int addrEmpty; /* Address of OP_Rewind in flush: */
- int regStart = 0; /* Value of <expr> PRECEDING */
- int regEnd = 0; /* Value of <expr> FOLLOWING */
int regNew; /* Array of registers holding new input row */
int regRecord; /* regNew array in record form */
int regRowid; /* Rowid for regRecord in eph table */
@@ -148394,6 +149357,8 @@ SQLITE_PRIVATE void sqlite3WindowCodeStep(
int regFlushPart = 0; /* Register for "Gosub flush_partition" */
WindowCodeArg s; /* Context object for sub-routines */
int lblWhereEnd; /* Label just before sqlite3WhereEnd() code */
+ int regStart = 0; /* Value of <expr> PRECEDING */
+ int regEnd = 0; /* Value of <expr> FOLLOWING */
assert( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_CURRENT
|| pMWin->eStart==TK_FOLLOWING || pMWin->eStart==TK_UNBOUNDED
@@ -148524,14 +149489,14 @@ SQLITE_PRIVATE void sqlite3WindowCodeStep(
if( regStart ){
sqlite3ExprCode(pParse, pMWin->pStart, regStart);
- windowCheckValue(pParse, regStart, 0 + (pMWin->eFrmType==TK_RANGE ? 3 : 0));
+ windowCheckValue(pParse, regStart, 0 + (pMWin->eFrmType==TK_RANGE?3:0));
}
if( regEnd ){
sqlite3ExprCode(pParse, pMWin->pEnd, regEnd);
- windowCheckValue(pParse, regEnd, 1 + (pMWin->eFrmType==TK_RANGE ? 3 : 0));
+ windowCheckValue(pParse, regEnd, 1 + (pMWin->eFrmType==TK_RANGE?3:0));
}
- if( pMWin->eStart==pMWin->eEnd && regStart ){
+ if( pMWin->eFrmType!=TK_RANGE && pMWin->eStart==pMWin->eEnd && regStart ){
int op = ((pMWin->eStart==TK_FOLLOWING) ? OP_Ge : OP_Le);
int addrGe = sqlite3VdbeAddOp3(v, op, regStart, 0, regEnd);
VdbeCoverageNeverNullIf(v, op==OP_Ge); /* NeverNull because bound <expr> */
@@ -148791,6 +149756,7 @@ static void disableLookaside(Parse *pParse){
** SQLITE_LIMIT_COMPOUND_SELECT.
*/
static void parserDoubleLinkSelect(Parse *pParse, Select *p){
+ assert( p!=0 );
if( p->pPrior ){
Select *pNext = 0, *pLoop;
int mxSelect, cnt = 0;
@@ -148817,7 +149783,7 @@ static void disableLookaside(Parse *pParse){
if( p ){
/* memset(p, 0, sizeof(Expr)); */
p->op = (u8)op;
- p->affinity = 0;
+ p->affExpr = 0;
p->flags = EP_Leaf;
p->iAgg = -1;
p->pLeft = p->pRight = 0;
@@ -148944,28 +149910,28 @@ static void disableLookaside(Parse *pParse){
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
-#define YYNOCODE 302
+#define YYNOCODE 307
#define YYACTIONTYPE unsigned short int
-#define YYWILDCARD 95
+#define YYWILDCARD 98
#define sqlite3ParserTOKENTYPE Token
typedef union {
int yyinit;
sqlite3ParserTOKENTYPE yy0;
- TriggerStep* yy11;
- IdList* yy76;
- ExprList* yy94;
- Upsert* yy95;
- int yy100;
- Expr* yy102;
- struct {int value; int mask;} yy199;
- u8 yy218;
- With* yy243;
- struct TrigEvent yy298;
- Window* yy379;
- struct FrameBound yy389;
- Select* yy391;
- SrcList* yy407;
- const char* yy528;
+ const char* yy8;
+ Select* yy25;
+ int yy32;
+ Expr* yy46;
+ struct FrameBound yy57;
+ u8 yy118;
+ ExprList* yy138;
+ Upsert* yy288;
+ With* yy297;
+ IdList* yy406;
+ Window* yy455;
+ struct {int value; int mask;} yy495;
+ TriggerStep* yy527;
+ struct TrigEvent yy572;
+ SrcList* yy609;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -148981,17 +149947,17 @@ typedef union {
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
#define YYFALLBACK 1
-#define YYNSTATE 540
-#define YYNRULE 376
-#define YYNTOKEN 176
-#define YY_MAX_SHIFT 539
-#define YY_MIN_SHIFTREDUCE 783
-#define YY_MAX_SHIFTREDUCE 1158
-#define YY_ERROR_ACTION 1159
-#define YY_ACCEPT_ACTION 1160
-#define YY_NO_ACTION 1161
-#define YY_MIN_REDUCE 1162
-#define YY_MAX_REDUCE 1537
+#define YYNSTATE 543
+#define YYNRULE 381
+#define YYNTOKEN 179
+#define YY_MAX_SHIFT 542
+#define YY_MIN_SHIFTREDUCE 790
+#define YY_MAX_SHIFTREDUCE 1170
+#define YY_ERROR_ACTION 1171
+#define YY_ACCEPT_ACTION 1172
+#define YY_NO_ACTION 1173
+#define YY_MIN_REDUCE 1174
+#define YY_MAX_REDUCE 1554
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -149058,601 +150024,573 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
-#define YY_ACTTAB_COUNT (2142)
+#define YY_ACTTAB_COUNT (1913)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 112, 109, 209, 112, 109, 209, 1160, 1, 1, 539,
- /* 10 */ 2, 1164, 490, 1193, 1293, 534, 289, 1196, 134, 383,
- /* 20 */ 1485, 1428, 1164, 1229, 1208, 1242, 1195, 289, 491, 134,
- /* 30 */ 373, 915, 1229, 443, 16, 16, 1242, 70, 70, 916,
- /* 40 */ 242, 1292, 296, 119, 120, 110, 1136, 1136, 981, 984,
- /* 50 */ 974, 974, 117, 117, 118, 118, 118, 118, 264, 264,
- /* 60 */ 190, 264, 264, 264, 264, 112, 109, 209, 362, 264,
- /* 70 */ 264, 531, 376, 497, 531, 1134, 531, 1501, 239, 206,
- /* 80 */ 338, 9, 531, 242, 219, 1203, 118, 118, 118, 118,
- /* 90 */ 111, 439, 112, 109, 209, 219, 116, 116, 116, 116,
- /* 100 */ 115, 115, 114, 114, 114, 113, 414, 115, 115, 114,
- /* 110 */ 114, 114, 113, 414, 418, 12, 383, 400, 1134, 114,
- /* 120 */ 114, 114, 113, 414, 1115, 418, 1134, 1392, 116, 116,
- /* 130 */ 116, 116, 115, 115, 114, 114, 114, 113, 414, 961,
- /* 140 */ 119, 120, 110, 1136, 1136, 981, 984, 974, 974, 117,
- /* 150 */ 117, 118, 118, 118, 118, 952, 534, 414, 941, 951,
- /* 160 */ 1481, 539, 2, 1164, 1505, 534, 160, 175, 289, 1134,
- /* 170 */ 134, 434, 312, 297, 1115, 1116, 1117, 1242, 70, 70,
- /* 180 */ 1089, 338, 1089, 118, 118, 118, 118, 42, 42, 448,
- /* 190 */ 951, 951, 953, 116, 116, 116, 116, 115, 115, 114,
- /* 200 */ 114, 114, 113, 414, 1115, 311, 264, 264, 82, 441,
- /* 210 */ 264, 264, 190, 383, 284, 12, 288, 525, 407, 531,
- /* 220 */ 96, 159, 458, 531, 371, 116, 116, 116, 116, 115,
- /* 230 */ 115, 114, 114, 114, 113, 414, 219, 119, 120, 110,
- /* 240 */ 1136, 1136, 981, 984, 974, 974, 117, 117, 118, 118,
- /* 250 */ 118, 118, 511, 1477, 1115, 1116, 1117, 113, 414, 534,
- /* 260 */ 528, 528, 528, 121, 534, 1427, 418, 116, 116, 116,
- /* 270 */ 116, 115, 115, 114, 114, 114, 113, 414, 1464, 351,
- /* 280 */ 270, 42, 42, 383, 187, 1115, 70, 70, 533, 433,
- /* 290 */ 116, 116, 116, 116, 115, 115, 114, 114, 114, 113,
- /* 300 */ 414, 534, 1339, 405, 159, 411, 410, 119, 120, 110,
- /* 310 */ 1136, 1136, 981, 984, 974, 974, 117, 117, 118, 118,
- /* 320 */ 118, 118, 285, 42, 42, 349, 411, 410, 514, 479,
- /* 330 */ 1458, 79, 1084, 6, 1140, 1115, 1116, 1117, 480, 1142,
- /* 340 */ 501, 1115, 1084, 123, 238, 1084, 136, 1141, 1234, 1234,
- /* 350 */ 1143, 383, 1143, 1115, 167, 426, 80, 447, 512, 1451,
- /* 360 */ 116, 116, 116, 116, 115, 115, 114, 114, 114, 113,
- /* 370 */ 414, 1143, 1466, 1143, 350, 119, 120, 110, 1136, 1136,
- /* 380 */ 981, 984, 974, 974, 117, 117, 118, 118, 118, 118,
- /* 390 */ 402, 1115, 1116, 1117, 500, 534, 250, 267, 336, 474,
- /* 400 */ 331, 473, 236, 1115, 1116, 1117, 231, 1115, 329, 471,
- /* 410 */ 468, 467, 509, 1458, 1464, 505, 6, 70, 70, 466,
- /* 420 */ 181, 380, 379, 534, 971, 971, 982, 985, 116, 116,
- /* 430 */ 116, 116, 115, 115, 114, 114, 114, 113, 414, 1115,
- /* 440 */ 412, 412, 412, 496, 1115, 69, 69, 235, 383, 288,
- /* 450 */ 525, 273, 326, 516, 337, 458, 1084, 1115, 1116, 1117,
- /* 460 */ 1232, 1232, 492, 160, 508, 441, 1084, 1067, 1531, 1084,
- /* 470 */ 207, 1531, 119, 120, 110, 1136, 1136, 981, 984, 974,
- /* 480 */ 974, 117, 117, 118, 118, 118, 118, 881, 534, 1115,
- /* 490 */ 1116, 1117, 975, 534, 1115, 1116, 1117, 534, 421, 534,
- /* 500 */ 141, 534, 176, 356, 517, 1119, 32, 511, 482, 388,
- /* 510 */ 70, 70, 818, 288, 525, 70, 70, 441, 499, 50,
- /* 520 */ 50, 70, 70, 70, 70, 116, 116, 116, 116, 115,
- /* 530 */ 115, 114, 114, 114, 113, 414, 274, 264, 264, 1115,
- /* 540 */ 1065, 264, 264, 1115, 355, 383, 409, 961, 1439, 822,
- /* 550 */ 531, 516, 190, 419, 531, 483, 1119, 516, 337, 516,
- /* 560 */ 518, 1115, 818, 952, 382, 458, 515, 951, 481, 119,
- /* 570 */ 120, 110, 1136, 1136, 981, 984, 974, 974, 117, 117,
- /* 580 */ 118, 118, 118, 118, 1338, 278, 1045, 278, 275, 1115,
- /* 590 */ 1116, 1117, 259, 1115, 1116, 1117, 534, 5, 951, 951,
- /* 600 */ 953, 1046, 231, 3, 143, 471, 468, 467, 1391, 463,
- /* 610 */ 1115, 1115, 1116, 1117, 1452, 466, 1047, 836, 70, 70,
- /* 620 */ 480, 534, 116, 116, 116, 116, 115, 115, 114, 114,
- /* 630 */ 114, 113, 414, 95, 1115, 287, 235, 856, 902, 420,
- /* 640 */ 1115, 534, 383, 13, 13, 381, 815, 857, 472, 112,
- /* 650 */ 109, 209, 1115, 337, 413, 309, 837, 394, 1436, 534,
- /* 660 */ 1115, 1116, 1117, 54, 54, 291, 119, 120, 110, 1136,
- /* 670 */ 1136, 981, 984, 974, 974, 117, 117, 118, 118, 118,
- /* 680 */ 118, 13, 13, 1084, 1115, 1116, 1117, 901, 264, 264,
- /* 690 */ 1115, 1116, 1117, 1084, 292, 399, 1084, 800, 388, 140,
- /* 700 */ 295, 531, 1115, 1116, 1117, 403, 447, 532, 534, 870,
- /* 710 */ 870, 534, 1240, 534, 329, 534, 1185, 389, 534, 116,
- /* 720 */ 116, 116, 116, 115, 115, 114, 114, 114, 113, 414,
- /* 730 */ 13, 13, 1024, 13, 13, 13, 13, 13, 13, 383,
- /* 740 */ 13, 13, 424, 1100, 401, 264, 264, 277, 160, 184,
- /* 750 */ 1182, 185, 1533, 369, 513, 484, 432, 487, 531, 424,
- /* 760 */ 423, 1397, 941, 119, 120, 110, 1136, 1136, 981, 984,
- /* 770 */ 974, 974, 117, 117, 118, 118, 118, 118, 1397, 1399,
- /* 780 */ 425, 519, 392, 264, 264, 1029, 1029, 455, 264, 264,
- /* 790 */ 264, 264, 1004, 304, 261, 1278, 531, 900, 288, 525,
- /* 800 */ 310, 531, 493, 531, 1067, 1532, 458, 387, 1532, 311,
- /* 810 */ 429, 299, 534, 107, 264, 264, 116, 116, 116, 116,
- /* 820 */ 115, 115, 114, 114, 114, 113, 414, 531, 424, 1384,
- /* 830 */ 507, 258, 258, 1246, 55, 55, 383, 1277, 265, 265,
- /* 840 */ 962, 324, 434, 312, 531, 531, 506, 1397, 1026, 1241,
- /* 850 */ 298, 531, 1026, 445, 301, 1095, 303, 534, 368, 1156,
- /* 860 */ 119, 120, 110, 1136, 1136, 981, 984, 974, 974, 117,
- /* 870 */ 117, 118, 118, 118, 118, 1045, 534, 1065, 534, 15,
- /* 880 */ 15, 1084, 208, 1324, 453, 452, 534, 1324, 534, 449,
- /* 890 */ 1046, 1084, 494, 458, 1084, 234, 233, 232, 44, 44,
- /* 900 */ 56, 56, 319, 1095, 322, 1047, 534, 900, 57, 57,
- /* 910 */ 58, 58, 534, 116, 116, 116, 116, 115, 115, 114,
- /* 920 */ 114, 114, 113, 414, 534, 514, 522, 534, 59, 59,
- /* 930 */ 302, 1157, 534, 383, 60, 60, 1237, 946, 788, 789,
- /* 940 */ 790, 1459, 1456, 446, 6, 6, 61, 61, 1212, 45,
- /* 950 */ 45, 534, 396, 383, 46, 46, 397, 119, 120, 110,
- /* 960 */ 1136, 1136, 981, 984, 974, 974, 117, 117, 118, 118,
- /* 970 */ 118, 118, 428, 48, 48, 534, 392, 119, 120, 110,
- /* 980 */ 1136, 1136, 981, 984, 974, 974, 117, 117, 118, 118,
- /* 990 */ 118, 118, 1324, 368, 1066, 447, 825, 49, 49, 534,
- /* 1000 */ 458, 357, 534, 353, 534, 138, 534, 337, 1478, 478,
- /* 1010 */ 116, 116, 116, 116, 115, 115, 114, 114, 114, 113,
- /* 1020 */ 414, 62, 62, 392, 63, 63, 64, 64, 14, 14,
- /* 1030 */ 116, 116, 116, 116, 115, 115, 114, 114, 114, 113,
- /* 1040 */ 414, 534, 810, 317, 271, 534, 1457, 825, 534, 6,
- /* 1050 */ 534, 1324, 534, 142, 534, 1442, 534, 212, 534, 1324,
- /* 1060 */ 534, 398, 305, 65, 65, 534, 1157, 125, 125, 476,
- /* 1070 */ 66, 66, 51, 51, 67, 67, 68, 68, 52, 52,
- /* 1080 */ 147, 147, 148, 148, 534, 98, 534, 75, 75, 276,
- /* 1090 */ 534, 272, 534, 810, 534, 876, 534, 527, 389, 534,
- /* 1100 */ 875, 534, 1151, 202, 534, 383, 53, 53, 71, 71,
- /* 1110 */ 288, 525, 126, 126, 72, 72, 127, 127, 128, 128,
- /* 1120 */ 454, 124, 124, 146, 146, 383, 145, 145, 408, 119,
- /* 1130 */ 120, 110, 1136, 1136, 981, 984, 974, 974, 117, 117,
- /* 1140 */ 118, 118, 118, 118, 534, 900, 534, 95, 534, 119,
- /* 1150 */ 120, 110, 1136, 1136, 981, 984, 974, 974, 117, 117,
- /* 1160 */ 118, 118, 118, 118, 390, 161, 132, 132, 131, 131,
- /* 1170 */ 129, 129, 534, 915, 534, 1455, 534, 1454, 6, 1416,
- /* 1180 */ 6, 916, 116, 116, 116, 116, 115, 115, 114, 114,
- /* 1190 */ 114, 113, 414, 1415, 130, 130, 74, 74, 76, 76,
- /* 1200 */ 534, 30, 116, 116, 116, 116, 115, 115, 114, 114,
- /* 1210 */ 114, 113, 414, 534, 263, 206, 534, 1133, 1504, 93,
- /* 1220 */ 876, 845, 73, 73, 102, 875, 100, 139, 17, 38,
- /* 1230 */ 208, 1062, 31, 450, 370, 43, 43, 101, 47, 47,
- /* 1240 */ 827, 216, 436, 308, 943, 440, 95, 241, 241, 442,
- /* 1250 */ 313, 464, 241, 95, 237, 900, 327, 383, 266, 95,
- /* 1260 */ 835, 834, 193, 335, 938, 314, 1011, 435, 842, 843,
- /* 1270 */ 955, 1007, 909, 334, 237, 241, 873, 383, 1023, 107,
- /* 1280 */ 1023, 119, 120, 110, 1136, 1136, 981, 984, 974, 974,
- /* 1290 */ 117, 117, 118, 118, 118, 118, 1022, 808, 1022, 1274,
- /* 1300 */ 137, 119, 108, 110, 1136, 1136, 981, 984, 974, 974,
- /* 1310 */ 117, 117, 118, 118, 118, 118, 874, 1011, 318, 107,
- /* 1320 */ 321, 955, 323, 325, 1225, 1211, 197, 1210, 1209, 330,
- /* 1330 */ 339, 1265, 340, 283, 116, 116, 116, 116, 115, 115,
- /* 1340 */ 114, 114, 114, 113, 414, 1286, 1323, 1261, 1471, 1272,
- /* 1350 */ 520, 218, 521, 1329, 116, 116, 116, 116, 115, 115,
- /* 1360 */ 114, 114, 114, 113, 414, 1192, 1184, 1173, 1172, 1174,
- /* 1370 */ 1494, 1488, 459, 256, 383, 1258, 342, 199, 367, 344,
- /* 1380 */ 211, 195, 307, 444, 11, 346, 469, 333, 1308, 1316,
- /* 1390 */ 375, 427, 203, 360, 383, 1388, 188, 1387, 189, 120,
- /* 1400 */ 110, 1136, 1136, 981, 984, 974, 974, 117, 117, 118,
- /* 1410 */ 118, 118, 118, 1208, 1151, 300, 348, 1491, 245, 1148,
- /* 1420 */ 110, 1136, 1136, 981, 984, 974, 974, 117, 117, 118,
- /* 1430 */ 118, 118, 118, 198, 1435, 1433, 524, 78, 391, 163,
- /* 1440 */ 82, 1393, 438, 173, 81, 105, 526, 1313, 4, 35,
- /* 1450 */ 157, 116, 116, 116, 116, 115, 115, 114, 114, 114,
- /* 1460 */ 113, 414, 529, 165, 93, 430, 1305, 168, 169, 431,
- /* 1470 */ 462, 116, 116, 116, 116, 115, 115, 114, 114, 114,
- /* 1480 */ 113, 414, 170, 171, 221, 415, 372, 437, 1319, 177,
- /* 1490 */ 374, 36, 451, 225, 1382, 87, 457, 523, 257, 1404,
- /* 1500 */ 316, 105, 526, 227, 4, 182, 460, 160, 320, 228,
- /* 1510 */ 377, 1175, 475, 229, 1228, 404, 1227, 1226, 529, 827,
- /* 1520 */ 961, 1219, 378, 1200, 1199, 406, 103, 103, 1218, 332,
- /* 1530 */ 8, 281, 1198, 104, 1503, 415, 536, 535, 486, 282,
- /* 1540 */ 951, 415, 489, 495, 92, 244, 1269, 341, 243, 122,
- /* 1550 */ 1270, 343, 514, 523, 1268, 1462, 10, 288, 525, 345,
- /* 1560 */ 1461, 354, 99, 352, 503, 94, 1267, 347, 1251, 502,
- /* 1570 */ 498, 951, 951, 953, 954, 27, 961, 1250, 194, 358,
- /* 1580 */ 251, 359, 103, 103, 1181, 34, 537, 1110, 252, 104,
- /* 1590 */ 254, 415, 536, 535, 255, 1368, 951, 1420, 286, 538,
- /* 1600 */ 1170, 1165, 1421, 135, 1419, 1418, 149, 150, 279, 784,
- /* 1610 */ 416, 196, 151, 290, 210, 200, 77, 385, 269, 386,
- /* 1620 */ 133, 162, 935, 1021, 201, 1019, 153, 951, 951, 953,
- /* 1630 */ 954, 27, 1480, 1104, 417, 164, 217, 268, 859, 166,
- /* 1640 */ 306, 1035, 366, 366, 365, 253, 363, 220, 172, 797,
- /* 1650 */ 939, 155, 105, 526, 393, 4, 395, 174, 156, 83,
- /* 1660 */ 1038, 84, 213, 85, 294, 222, 86, 223, 1034, 529,
- /* 1670 */ 144, 18, 293, 224, 315, 456, 241, 1027, 1145, 178,
- /* 1680 */ 226, 179, 37, 799, 334, 461, 230, 465, 470, 838,
- /* 1690 */ 180, 88, 415, 19, 280, 328, 20, 89, 90, 158,
- /* 1700 */ 191, 477, 215, 1097, 523, 204, 192, 987, 91, 1070,
- /* 1710 */ 152, 39, 485, 154, 1071, 503, 40, 488, 205, 260,
- /* 1720 */ 504, 262, 105, 526, 214, 4, 908, 961, 183, 240,
- /* 1730 */ 903, 107, 1086, 103, 103, 21, 22, 1088, 23, 529,
- /* 1740 */ 104, 24, 415, 536, 535, 1090, 1093, 951, 1094, 25,
- /* 1750 */ 1074, 33, 7, 26, 510, 1002, 247, 186, 384, 95,
- /* 1760 */ 988, 986, 415, 288, 525, 990, 1044, 246, 1043, 991,
- /* 1770 */ 28, 41, 530, 956, 523, 809, 106, 29, 951, 951,
- /* 1780 */ 953, 954, 27, 869, 361, 503, 422, 248, 364, 1105,
- /* 1790 */ 502, 249, 1161, 1496, 1495, 1161, 1161, 961, 1161, 1161,
- /* 1800 */ 1161, 1161, 1161, 103, 103, 1161, 1161, 1161, 1161, 1161,
- /* 1810 */ 104, 1161, 415, 536, 535, 1104, 417, 951, 1161, 268,
- /* 1820 */ 1161, 1161, 1161, 1161, 366, 366, 365, 253, 363, 1161,
- /* 1830 */ 1161, 797, 1161, 1161, 1161, 1161, 105, 526, 1161, 4,
- /* 1840 */ 1161, 1161, 1161, 1161, 213, 1161, 294, 1161, 951, 951,
- /* 1850 */ 953, 954, 27, 529, 293, 1161, 1161, 1161, 1161, 1161,
- /* 1860 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
- /* 1870 */ 1161, 1161, 1161, 1161, 1161, 1161, 415, 1161, 1161, 1161,
- /* 1880 */ 1161, 1161, 1161, 1161, 215, 1161, 1161, 1161, 523, 1161,
- /* 1890 */ 1161, 1161, 152, 1161, 1161, 154, 105, 526, 1161, 4,
- /* 1900 */ 1161, 1161, 1161, 1161, 1161, 1161, 214, 1161, 1161, 1161,
- /* 1910 */ 1161, 961, 1161, 529, 1161, 1161, 1161, 103, 103, 880,
- /* 1920 */ 1161, 1161, 1161, 1161, 104, 1161, 415, 536, 535, 1161,
- /* 1930 */ 1161, 951, 1161, 1161, 1161, 1161, 415, 1161, 1161, 1161,
- /* 1940 */ 384, 1161, 1161, 1161, 1161, 288, 525, 1161, 523, 1161,
- /* 1950 */ 1161, 1161, 1161, 1161, 1161, 1161, 97, 526, 1161, 4,
- /* 1960 */ 1161, 1161, 951, 951, 953, 954, 27, 1161, 422, 1161,
- /* 1970 */ 1161, 961, 1161, 529, 1161, 1161, 1161, 103, 103, 1161,
- /* 1980 */ 1161, 1161, 1161, 1161, 104, 1161, 415, 536, 535, 1161,
- /* 1990 */ 1161, 951, 268, 1161, 1161, 1161, 415, 366, 366, 365,
- /* 2000 */ 253, 363, 1161, 1161, 797, 1161, 1161, 1161, 523, 1161,
- /* 2010 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 213, 1161, 294,
- /* 2020 */ 1161, 1161, 951, 951, 953, 954, 27, 293, 1161, 1161,
- /* 2030 */ 1161, 961, 1161, 1161, 1161, 1161, 1161, 103, 103, 1161,
- /* 2040 */ 1161, 1161, 1161, 1161, 104, 1161, 415, 536, 535, 1161,
- /* 2050 */ 1161, 951, 1161, 1161, 1161, 1161, 1161, 215, 1161, 1161,
- /* 2060 */ 1161, 1161, 1161, 1161, 1161, 152, 1161, 1161, 154, 1161,
- /* 2070 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 214,
- /* 2080 */ 1161, 1161, 951, 951, 953, 954, 27, 1161, 1161, 1161,
- /* 2090 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
- /* 2100 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
- /* 2110 */ 1161, 1161, 1161, 384, 1161, 1161, 1161, 1161, 288, 525,
- /* 2120 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
- /* 2130 */ 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161, 1161,
- /* 2140 */ 1161, 422,
+ /* 0 */ 537, 339, 537, 1241, 1220, 537, 12, 537, 112, 109,
+ /* 10 */ 209, 537, 1241, 537, 1205, 462, 112, 109, 209, 386,
+ /* 20 */ 338, 462, 42, 42, 42, 42, 445, 42, 42, 70,
+ /* 30 */ 70, 922, 1208, 70, 70, 70, 70, 1443, 403, 923,
+ /* 40 */ 531, 531, 531, 119, 120, 110, 1148, 1148, 991, 994,
+ /* 50 */ 984, 984, 117, 117, 118, 118, 118, 118, 425, 386,
+ /* 60 */ 1498, 542, 2, 1176, 1442, 519, 141, 1518, 289, 519,
+ /* 70 */ 134, 519, 95, 259, 495, 1215, 189, 1254, 518, 494,
+ /* 80 */ 484, 437, 296, 119, 120, 110, 1148, 1148, 991, 994,
+ /* 90 */ 984, 984, 117, 117, 118, 118, 118, 118, 270, 116,
+ /* 100 */ 116, 116, 116, 115, 115, 114, 114, 114, 113, 418,
+ /* 110 */ 264, 264, 264, 264, 423, 1479, 352, 1481, 123, 351,
+ /* 120 */ 1479, 508, 1094, 534, 1034, 534, 1099, 386, 1099, 239,
+ /* 130 */ 206, 112, 109, 209, 96, 1094, 376, 219, 1094, 116,
+ /* 140 */ 116, 116, 116, 115, 115, 114, 114, 114, 113, 418,
+ /* 150 */ 480, 119, 120, 110, 1148, 1148, 991, 994, 984, 984,
+ /* 160 */ 117, 117, 118, 118, 118, 118, 353, 422, 1407, 264,
+ /* 170 */ 264, 114, 114, 114, 113, 418, 883, 121, 416, 416,
+ /* 180 */ 416, 882, 534, 116, 116, 116, 116, 115, 115, 114,
+ /* 190 */ 114, 114, 113, 418, 212, 415, 414, 386, 443, 383,
+ /* 200 */ 382, 118, 118, 118, 118, 111, 177, 116, 116, 116,
+ /* 210 */ 116, 115, 115, 114, 114, 114, 113, 418, 112, 109,
+ /* 220 */ 209, 119, 120, 110, 1148, 1148, 991, 994, 984, 984,
+ /* 230 */ 117, 117, 118, 118, 118, 118, 386, 438, 312, 1163,
+ /* 240 */ 1155, 80, 1155, 1127, 514, 79, 116, 116, 116, 116,
+ /* 250 */ 115, 115, 114, 114, 114, 113, 418, 514, 428, 418,
+ /* 260 */ 119, 120, 110, 1148, 1148, 991, 994, 984, 984, 117,
+ /* 270 */ 117, 118, 118, 118, 118, 428, 427, 116, 116, 116,
+ /* 280 */ 116, 115, 115, 114, 114, 114, 113, 418, 115, 115,
+ /* 290 */ 114, 114, 114, 113, 418, 1127, 1127, 1128, 1129, 1094,
+ /* 300 */ 258, 258, 192, 386, 408, 371, 1168, 326, 118, 118,
+ /* 310 */ 118, 118, 1094, 534, 374, 1094, 116, 116, 116, 116,
+ /* 320 */ 115, 115, 114, 114, 114, 113, 418, 119, 120, 110,
+ /* 330 */ 1148, 1148, 991, 994, 984, 984, 117, 117, 118, 118,
+ /* 340 */ 118, 118, 386, 354, 445, 428, 829, 238, 1127, 1128,
+ /* 350 */ 1129, 515, 1466, 116, 116, 116, 116, 115, 115, 114,
+ /* 360 */ 114, 114, 113, 418, 1127, 1467, 119, 120, 110, 1148,
+ /* 370 */ 1148, 991, 994, 984, 984, 117, 117, 118, 118, 118,
+ /* 380 */ 118, 1169, 82, 116, 116, 116, 116, 115, 115, 114,
+ /* 390 */ 114, 114, 113, 418, 405, 112, 109, 209, 161, 445,
+ /* 400 */ 250, 267, 336, 478, 331, 477, 236, 951, 1127, 386,
+ /* 410 */ 888, 1521, 329, 822, 852, 162, 274, 1127, 1128, 1129,
+ /* 420 */ 338, 169, 116, 116, 116, 116, 115, 115, 114, 114,
+ /* 430 */ 114, 113, 418, 119, 120, 110, 1148, 1148, 991, 994,
+ /* 440 */ 984, 984, 117, 117, 118, 118, 118, 118, 386, 438,
+ /* 450 */ 312, 1502, 1112, 1176, 161, 288, 528, 311, 289, 883,
+ /* 460 */ 134, 1127, 1128, 1129, 882, 537, 143, 1254, 288, 528,
+ /* 470 */ 297, 275, 119, 120, 110, 1148, 1148, 991, 994, 984,
+ /* 480 */ 984, 117, 117, 118, 118, 118, 118, 70, 70, 116,
+ /* 490 */ 116, 116, 116, 115, 115, 114, 114, 114, 113, 418,
+ /* 500 */ 264, 264, 12, 264, 264, 395, 1127, 483, 1473, 1094,
+ /* 510 */ 204, 482, 6, 534, 1258, 386, 534, 1474, 825, 972,
+ /* 520 */ 504, 6, 1094, 500, 95, 1094, 534, 219, 116, 116,
+ /* 530 */ 116, 116, 115, 115, 114, 114, 114, 113, 418, 119,
+ /* 540 */ 120, 110, 1148, 1148, 991, 994, 984, 984, 117, 117,
+ /* 550 */ 118, 118, 118, 118, 386, 1339, 971, 422, 956, 1127,
+ /* 560 */ 1128, 1129, 231, 512, 1473, 475, 472, 471, 6, 113,
+ /* 570 */ 418, 825, 962, 298, 503, 470, 961, 452, 119, 120,
+ /* 580 */ 110, 1148, 1148, 991, 994, 984, 984, 117, 117, 118,
+ /* 590 */ 118, 118, 118, 395, 537, 116, 116, 116, 116, 115,
+ /* 600 */ 115, 114, 114, 114, 113, 418, 202, 961, 961, 963,
+ /* 610 */ 231, 971, 1127, 475, 472, 471, 13, 13, 951, 1127,
+ /* 620 */ 834, 386, 1207, 470, 399, 183, 447, 962, 462, 162,
+ /* 630 */ 397, 961, 1246, 1246, 116, 116, 116, 116, 115, 115,
+ /* 640 */ 114, 114, 114, 113, 418, 119, 120, 110, 1148, 1148,
+ /* 650 */ 991, 994, 984, 984, 117, 117, 118, 118, 118, 118,
+ /* 660 */ 386, 271, 961, 961, 963, 1127, 1128, 1129, 311, 433,
+ /* 670 */ 299, 1406, 1127, 1128, 1129, 178, 1471, 138, 162, 32,
+ /* 680 */ 6, 1127, 288, 528, 119, 120, 110, 1148, 1148, 991,
+ /* 690 */ 994, 984, 984, 117, 117, 118, 118, 118, 118, 909,
+ /* 700 */ 390, 116, 116, 116, 116, 115, 115, 114, 114, 114,
+ /* 710 */ 113, 418, 1127, 429, 817, 537, 1127, 265, 265, 981,
+ /* 720 */ 981, 992, 995, 324, 1055, 93, 520, 5, 338, 537,
+ /* 730 */ 534, 288, 528, 1522, 1127, 1128, 1129, 70, 70, 1056,
+ /* 740 */ 116, 116, 116, 116, 115, 115, 114, 114, 114, 113,
+ /* 750 */ 418, 70, 70, 1495, 1057, 537, 98, 1244, 1244, 264,
+ /* 760 */ 264, 908, 371, 1076, 1127, 1127, 1128, 1129, 817, 1127,
+ /* 770 */ 1128, 1129, 534, 519, 140, 863, 386, 13, 13, 456,
+ /* 780 */ 192, 193, 521, 453, 319, 864, 322, 284, 365, 430,
+ /* 790 */ 985, 402, 379, 1077, 1548, 101, 386, 1548, 3, 395,
+ /* 800 */ 119, 120, 110, 1148, 1148, 991, 994, 984, 984, 117,
+ /* 810 */ 117, 118, 118, 118, 118, 386, 451, 1127, 1128, 1129,
+ /* 820 */ 119, 120, 110, 1148, 1148, 991, 994, 984, 984, 117,
+ /* 830 */ 117, 118, 118, 118, 118, 1127, 1354, 1412, 1169, 119,
+ /* 840 */ 108, 110, 1148, 1148, 991, 994, 984, 984, 117, 117,
+ /* 850 */ 118, 118, 118, 118, 1412, 1414, 116, 116, 116, 116,
+ /* 860 */ 115, 115, 114, 114, 114, 113, 418, 272, 535, 1075,
+ /* 870 */ 877, 877, 337, 1492, 309, 462, 116, 116, 116, 116,
+ /* 880 */ 115, 115, 114, 114, 114, 113, 418, 537, 1127, 1128,
+ /* 890 */ 1129, 537, 360, 537, 356, 116, 116, 116, 116, 115,
+ /* 900 */ 115, 114, 114, 114, 113, 418, 386, 264, 264, 13,
+ /* 910 */ 13, 273, 1127, 13, 13, 13, 13, 304, 1253, 386,
+ /* 920 */ 534, 1077, 1549, 404, 1412, 1549, 496, 277, 451, 186,
+ /* 930 */ 1252, 120, 110, 1148, 1148, 991, 994, 984, 984, 117,
+ /* 940 */ 117, 118, 118, 118, 118, 110, 1148, 1148, 991, 994,
+ /* 950 */ 984, 984, 117, 117, 118, 118, 118, 118, 105, 529,
+ /* 960 */ 537, 4, 1339, 264, 264, 1127, 1128, 1129, 1039, 1039,
+ /* 970 */ 459, 795, 796, 797, 536, 532, 534, 242, 301, 807,
+ /* 980 */ 303, 462, 69, 69, 451, 1353, 116, 116, 116, 116,
+ /* 990 */ 115, 115, 114, 114, 114, 113, 418, 1075, 419, 116,
+ /* 1000 */ 116, 116, 116, 115, 115, 114, 114, 114, 113, 418,
+ /* 1010 */ 526, 537, 1146, 192, 350, 105, 529, 537, 4, 497,
+ /* 1020 */ 162, 337, 1492, 310, 1249, 385, 1550, 372, 9, 462,
+ /* 1030 */ 242, 400, 532, 13, 13, 499, 971, 843, 436, 70,
+ /* 1040 */ 70, 359, 103, 103, 8, 339, 278, 187, 278, 104,
+ /* 1050 */ 1127, 419, 539, 538, 1339, 419, 961, 302, 1339, 1172,
+ /* 1060 */ 1, 1, 542, 2, 1176, 1146, 1146, 526, 476, 289,
+ /* 1070 */ 30, 134, 317, 288, 528, 285, 844, 1014, 1254, 276,
+ /* 1080 */ 1472, 506, 410, 1194, 6, 207, 505, 961, 961, 963,
+ /* 1090 */ 964, 27, 449, 971, 415, 414, 234, 233, 232, 103,
+ /* 1100 */ 103, 31, 1152, 1127, 1128, 1129, 104, 1154, 419, 539,
+ /* 1110 */ 538, 264, 264, 961, 1399, 1153, 264, 264, 1470, 1146,
+ /* 1120 */ 537, 216, 6, 401, 534, 1197, 392, 458, 406, 534,
+ /* 1130 */ 537, 485, 358, 537, 261, 537, 1339, 907, 219, 1155,
+ /* 1140 */ 467, 1155, 50, 50, 961, 961, 963, 964, 27, 1497,
+ /* 1150 */ 1116, 421, 70, 70, 268, 70, 70, 13, 13, 369,
+ /* 1160 */ 369, 368, 253, 366, 264, 264, 804, 235, 422, 105,
+ /* 1170 */ 529, 516, 4, 287, 487, 510, 493, 534, 486, 213,
+ /* 1180 */ 1055, 294, 490, 384, 1127, 450, 532, 338, 413, 293,
+ /* 1190 */ 522, 417, 335, 1036, 509, 1056, 107, 1036, 16, 16,
+ /* 1200 */ 1469, 1094, 334, 1105, 6, 411, 1145, 264, 264, 419,
+ /* 1210 */ 1057, 102, 511, 100, 1094, 264, 264, 1094, 922, 215,
+ /* 1220 */ 534, 526, 907, 264, 264, 208, 923, 154, 534, 457,
+ /* 1230 */ 156, 525, 391, 142, 218, 506, 534, 1127, 1128, 1129,
+ /* 1240 */ 507, 139, 1131, 38, 214, 530, 392, 971, 329, 1454,
+ /* 1250 */ 907, 1105, 537, 103, 103, 105, 529, 537, 4, 537,
+ /* 1260 */ 104, 424, 419, 539, 538, 537, 502, 961, 517, 537,
+ /* 1270 */ 1072, 537, 532, 373, 54, 54, 288, 528, 387, 55,
+ /* 1280 */ 55, 15, 15, 288, 528, 17, 136, 44, 44, 1451,
+ /* 1290 */ 537, 56, 56, 57, 57, 419, 1131, 291, 961, 961,
+ /* 1300 */ 963, 964, 27, 393, 163, 537, 426, 526, 263, 206,
+ /* 1310 */ 208, 517, 58, 58, 235, 440, 842, 841, 197, 105,
+ /* 1320 */ 529, 506, 4, 1033, 439, 1033, 505, 59, 59, 308,
+ /* 1330 */ 849, 850, 95, 971, 537, 907, 532, 948, 832, 103,
+ /* 1340 */ 103, 105, 529, 537, 4, 1021, 104, 537, 419, 539,
+ /* 1350 */ 538, 1116, 421, 961, 537, 268, 60, 60, 532, 419,
+ /* 1360 */ 369, 369, 368, 253, 366, 61, 61, 804, 965, 45,
+ /* 1370 */ 45, 526, 537, 1032, 1277, 1032, 46, 46, 537, 391,
+ /* 1380 */ 213, 419, 294, 266, 961, 961, 963, 964, 27, 292,
+ /* 1390 */ 293, 295, 832, 526, 48, 48, 1290, 971, 1289, 1021,
+ /* 1400 */ 49, 49, 432, 103, 103, 887, 953, 537, 1457, 241,
+ /* 1410 */ 104, 305, 419, 539, 538, 925, 926, 961, 444, 971,
+ /* 1420 */ 215, 241, 965, 1224, 537, 103, 103, 1431, 154, 62,
+ /* 1430 */ 62, 156, 104, 1430, 419, 539, 538, 97, 529, 961,
+ /* 1440 */ 4, 537, 454, 537, 314, 214, 63, 63, 961, 961,
+ /* 1450 */ 963, 964, 27, 537, 532, 446, 1286, 318, 241, 537,
+ /* 1460 */ 321, 323, 325, 64, 64, 14, 14, 1237, 537, 1223,
+ /* 1470 */ 961, 961, 963, 964, 27, 65, 65, 419, 537, 387,
+ /* 1480 */ 537, 125, 125, 537, 288, 528, 537, 1486, 537, 526,
+ /* 1490 */ 66, 66, 313, 524, 537, 95, 468, 1221, 1511, 237,
+ /* 1500 */ 51, 51, 67, 67, 330, 68, 68, 426, 52, 52,
+ /* 1510 */ 149, 149, 1222, 340, 341, 971, 150, 150, 1298, 463,
+ /* 1520 */ 327, 103, 103, 95, 537, 1338, 1273, 537, 104, 537,
+ /* 1530 */ 419, 539, 538, 1284, 537, 961, 268, 283, 523, 1344,
+ /* 1540 */ 1204, 369, 369, 368, 253, 366, 75, 75, 804, 53,
+ /* 1550 */ 53, 71, 71, 537, 1196, 537, 126, 126, 537, 1017,
+ /* 1560 */ 537, 213, 237, 294, 537, 1185, 961, 961, 963, 964,
+ /* 1570 */ 27, 293, 537, 1184, 537, 72, 72, 127, 127, 1186,
+ /* 1580 */ 128, 128, 124, 124, 1505, 537, 148, 148, 537, 256,
+ /* 1590 */ 195, 537, 1270, 537, 147, 147, 132, 132, 537, 11,
+ /* 1600 */ 537, 215, 537, 199, 343, 345, 347, 131, 131, 154,
+ /* 1610 */ 129, 129, 156, 130, 130, 74, 74, 537, 370, 1323,
+ /* 1620 */ 76, 76, 73, 73, 43, 43, 214, 431, 211, 1331,
+ /* 1630 */ 300, 916, 880, 815, 241, 107, 137, 307, 881, 47,
+ /* 1640 */ 47, 107, 473, 378, 203, 448, 333, 1403, 1220, 1402,
+ /* 1650 */ 349, 190, 527, 191, 363, 198, 1508, 1163, 245, 165,
+ /* 1660 */ 387, 1450, 1448, 1160, 78, 288, 528, 1408, 81, 394,
+ /* 1670 */ 82, 442, 175, 159, 167, 93, 1328, 35, 1320, 434,
+ /* 1680 */ 170, 171, 172, 173, 435, 466, 221, 375, 426, 377,
+ /* 1690 */ 1334, 179, 455, 441, 1397, 225, 87, 36, 461, 1419,
+ /* 1700 */ 316, 257, 227, 184, 320, 464, 228, 479, 1187, 229,
+ /* 1710 */ 380, 1240, 1239, 407, 1238, 1212, 834, 332, 1231, 381,
+ /* 1720 */ 409, 1211, 204, 1210, 1491, 498, 1520, 1281, 92, 281,
+ /* 1730 */ 1230, 489, 282, 492, 342, 243, 1282, 344, 244, 1280,
+ /* 1740 */ 346, 412, 1279, 1477, 348, 122, 1476, 517, 10, 357,
+ /* 1750 */ 286, 1305, 1304, 99, 1383, 94, 501, 251, 1193, 34,
+ /* 1760 */ 1263, 355, 540, 194, 1262, 361, 362, 1122, 252, 254,
+ /* 1770 */ 255, 388, 541, 1182, 1177, 151, 1435, 389, 1436, 1434,
+ /* 1780 */ 1433, 791, 152, 135, 279, 200, 201, 420, 196, 77,
+ /* 1790 */ 153, 290, 269, 210, 1031, 133, 1029, 945, 166, 155,
+ /* 1800 */ 217, 168, 866, 306, 220, 1045, 174, 949, 157, 396,
+ /* 1810 */ 83, 398, 176, 84, 85, 164, 86, 158, 1048, 222,
+ /* 1820 */ 223, 1044, 144, 18, 224, 315, 1037, 180, 241, 460,
+ /* 1830 */ 1157, 226, 181, 37, 806, 465, 334, 230, 328, 469,
+ /* 1840 */ 182, 88, 474, 19, 20, 160, 89, 280, 145, 90,
+ /* 1850 */ 481, 845, 1110, 146, 997, 205, 1080, 39, 91, 40,
+ /* 1860 */ 488, 1081, 915, 491, 260, 262, 185, 910, 240, 107,
+ /* 1870 */ 1100, 1096, 1098, 1104, 21, 1084, 33, 513, 247, 22,
+ /* 1880 */ 23, 24, 1103, 25, 188, 95, 1012, 998, 996, 26,
+ /* 1890 */ 1000, 1054, 7, 1053, 1001, 246, 28, 41, 533, 966,
+ /* 1900 */ 816, 106, 29, 367, 248, 249, 1513, 1512, 364, 1117,
+ /* 1910 */ 1173, 1173, 876,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 260, 261, 262, 260, 261, 262, 176, 177, 178, 179,
- /* 10 */ 180, 181, 184, 206, 209, 184, 186, 206, 188, 19,
- /* 20 */ 179, 281, 181, 213, 214, 195, 206, 186, 195, 188,
- /* 30 */ 195, 31, 222, 184, 206, 207, 195, 206, 207, 39,
- /* 40 */ 24, 209, 184, 43, 44, 45, 46, 47, 48, 49,
- /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 228, 229,
- /* 60 */ 184, 228, 229, 228, 229, 260, 261, 262, 192, 228,
- /* 70 */ 229, 241, 196, 242, 241, 59, 241, 205, 245, 246,
- /* 80 */ 184, 22, 241, 24, 254, 213, 54, 55, 56, 57,
- /* 90 */ 58, 256, 260, 261, 262, 254, 96, 97, 98, 99,
- /* 100 */ 100, 101, 102, 103, 104, 105, 106, 100, 101, 102,
- /* 110 */ 103, 104, 105, 106, 284, 203, 19, 221, 59, 102,
- /* 120 */ 103, 104, 105, 106, 59, 284, 110, 269, 96, 97,
- /* 130 */ 98, 99, 100, 101, 102, 103, 104, 105, 106, 94,
- /* 140 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- /* 150 */ 53, 54, 55, 56, 57, 110, 184, 106, 73, 114,
- /* 160 */ 178, 179, 180, 181, 219, 184, 81, 22, 186, 110,
- /* 170 */ 188, 121, 122, 195, 109, 110, 111, 195, 206, 207,
- /* 180 */ 83, 184, 85, 54, 55, 56, 57, 206, 207, 277,
- /* 190 */ 145, 146, 147, 96, 97, 98, 99, 100, 101, 102,
- /* 200 */ 103, 104, 105, 106, 59, 120, 228, 229, 143, 184,
- /* 210 */ 228, 229, 184, 19, 242, 203, 131, 132, 221, 241,
- /* 220 */ 26, 184, 184, 241, 196, 96, 97, 98, 99, 100,
- /* 230 */ 101, 102, 103, 104, 105, 106, 254, 43, 44, 45,
- /* 240 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- /* 250 */ 56, 57, 184, 184, 109, 110, 111, 105, 106, 184,
- /* 260 */ 200, 201, 202, 69, 184, 227, 284, 96, 97, 98,
- /* 270 */ 99, 100, 101, 102, 103, 104, 105, 106, 297, 298,
- /* 280 */ 255, 206, 207, 19, 272, 59, 206, 207, 184, 277,
- /* 290 */ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- /* 300 */ 106, 184, 259, 19, 184, 100, 101, 43, 44, 45,
- /* 310 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- /* 320 */ 56, 57, 242, 206, 207, 184, 100, 101, 138, 292,
- /* 330 */ 293, 67, 76, 296, 108, 109, 110, 111, 295, 113,
- /* 340 */ 84, 59, 86, 22, 26, 89, 156, 121, 224, 225,
- /* 350 */ 145, 19, 147, 59, 72, 256, 24, 184, 290, 291,
- /* 360 */ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- /* 370 */ 106, 145, 297, 147, 299, 43, 44, 45, 46, 47,
- /* 380 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- /* 390 */ 106, 109, 110, 111, 138, 184, 112, 113, 114, 115,
- /* 400 */ 116, 117, 118, 109, 110, 111, 112, 59, 124, 115,
- /* 410 */ 116, 117, 292, 293, 297, 298, 296, 206, 207, 125,
- /* 420 */ 72, 100, 101, 184, 46, 47, 48, 49, 96, 97,
- /* 430 */ 98, 99, 100, 101, 102, 103, 104, 105, 106, 59,
- /* 440 */ 200, 201, 202, 184, 59, 206, 207, 46, 19, 131,
- /* 450 */ 132, 278, 23, 242, 184, 184, 76, 109, 110, 111,
- /* 460 */ 224, 225, 251, 81, 84, 184, 86, 22, 23, 89,
- /* 470 */ 184, 26, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 480 */ 51, 52, 53, 54, 55, 56, 57, 102, 184, 109,
- /* 490 */ 110, 111, 114, 184, 109, 110, 111, 184, 227, 184,
- /* 500 */ 230, 184, 22, 264, 195, 59, 22, 184, 195, 108,
- /* 510 */ 206, 207, 59, 131, 132, 206, 207, 184, 138, 206,
- /* 520 */ 207, 206, 207, 206, 207, 96, 97, 98, 99, 100,
- /* 530 */ 101, 102, 103, 104, 105, 106, 255, 228, 229, 59,
- /* 540 */ 95, 228, 229, 59, 184, 19, 242, 94, 184, 23,
- /* 550 */ 241, 242, 184, 282, 241, 242, 110, 242, 184, 242,
- /* 560 */ 251, 59, 109, 110, 196, 184, 251, 114, 251, 43,
- /* 570 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- /* 580 */ 54, 55, 56, 57, 259, 217, 12, 219, 255, 109,
- /* 590 */ 110, 111, 203, 109, 110, 111, 184, 22, 145, 146,
- /* 600 */ 147, 27, 112, 22, 230, 115, 116, 117, 227, 19,
- /* 610 */ 59, 109, 110, 111, 291, 125, 42, 35, 206, 207,
- /* 620 */ 295, 184, 96, 97, 98, 99, 100, 101, 102, 103,
- /* 630 */ 104, 105, 106, 26, 59, 233, 46, 63, 136, 184,
- /* 640 */ 59, 184, 19, 206, 207, 243, 23, 73, 66, 260,
- /* 650 */ 261, 262, 59, 184, 242, 195, 74, 220, 184, 184,
- /* 660 */ 109, 110, 111, 206, 207, 184, 43, 44, 45, 46,
- /* 670 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- /* 680 */ 57, 206, 207, 76, 109, 110, 111, 136, 228, 229,
- /* 690 */ 109, 110, 111, 86, 184, 220, 89, 21, 108, 230,
- /* 700 */ 184, 241, 109, 110, 111, 123, 184, 127, 184, 129,
- /* 710 */ 130, 184, 195, 184, 124, 184, 198, 199, 184, 96,
- /* 720 */ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
- /* 730 */ 206, 207, 11, 206, 207, 206, 207, 206, 207, 19,
- /* 740 */ 206, 207, 184, 23, 220, 228, 229, 220, 81, 220,
- /* 750 */ 195, 220, 287, 288, 220, 195, 80, 195, 241, 201,
- /* 760 */ 202, 184, 73, 43, 44, 45, 46, 47, 48, 49,
- /* 770 */ 50, 51, 52, 53, 54, 55, 56, 57, 201, 202,
- /* 780 */ 113, 195, 184, 228, 229, 120, 121, 122, 228, 229,
- /* 790 */ 228, 229, 116, 16, 23, 184, 241, 26, 131, 132,
- /* 800 */ 278, 241, 19, 241, 22, 23, 184, 189, 26, 120,
- /* 810 */ 121, 122, 184, 26, 228, 229, 96, 97, 98, 99,
- /* 820 */ 100, 101, 102, 103, 104, 105, 106, 241, 270, 153,
- /* 830 */ 66, 228, 229, 229, 206, 207, 19, 184, 228, 229,
- /* 840 */ 23, 16, 121, 122, 241, 241, 82, 270, 29, 227,
- /* 850 */ 252, 241, 33, 19, 77, 91, 79, 184, 22, 23,
- /* 860 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- /* 870 */ 53, 54, 55, 56, 57, 12, 184, 95, 184, 206,
- /* 880 */ 207, 76, 111, 184, 65, 267, 184, 184, 184, 271,
- /* 890 */ 27, 86, 109, 184, 89, 120, 121, 122, 206, 207,
- /* 900 */ 206, 207, 77, 139, 79, 42, 184, 136, 206, 207,
- /* 910 */ 206, 207, 184, 96, 97, 98, 99, 100, 101, 102,
- /* 920 */ 103, 104, 105, 106, 184, 138, 63, 184, 206, 207,
- /* 930 */ 153, 95, 184, 19, 206, 207, 227, 23, 7, 8,
- /* 940 */ 9, 293, 293, 109, 296, 296, 206, 207, 215, 206,
- /* 950 */ 207, 184, 253, 19, 206, 207, 253, 43, 44, 45,
- /* 960 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- /* 970 */ 56, 57, 184, 206, 207, 184, 184, 43, 44, 45,
- /* 980 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- /* 990 */ 56, 57, 184, 22, 23, 184, 59, 206, 207, 184,
- /* 1000 */ 184, 238, 184, 240, 184, 22, 184, 184, 157, 158,
- /* 1010 */ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- /* 1020 */ 106, 206, 207, 184, 206, 207, 206, 207, 206, 207,
- /* 1030 */ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
- /* 1040 */ 106, 184, 59, 227, 252, 184, 293, 110, 184, 296,
- /* 1050 */ 184, 184, 184, 230, 184, 184, 184, 15, 184, 184,
- /* 1060 */ 184, 253, 184, 206, 207, 184, 95, 206, 207, 102,
- /* 1070 */ 206, 207, 206, 207, 206, 207, 206, 207, 206, 207,
- /* 1080 */ 206, 207, 206, 207, 184, 151, 184, 206, 207, 278,
- /* 1090 */ 184, 252, 184, 110, 184, 128, 184, 198, 199, 184,
- /* 1100 */ 133, 184, 60, 26, 184, 19, 206, 207, 206, 207,
- /* 1110 */ 131, 132, 206, 207, 206, 207, 206, 207, 206, 207,
- /* 1120 */ 253, 206, 207, 206, 207, 19, 206, 207, 253, 43,
- /* 1130 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- /* 1140 */ 54, 55, 56, 57, 184, 26, 184, 26, 184, 43,
- /* 1150 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- /* 1160 */ 54, 55, 56, 57, 285, 286, 206, 207, 206, 207,
- /* 1170 */ 206, 207, 184, 31, 184, 293, 184, 293, 296, 184,
- /* 1180 */ 296, 39, 96, 97, 98, 99, 100, 101, 102, 103,
- /* 1190 */ 104, 105, 106, 184, 206, 207, 206, 207, 206, 207,
- /* 1200 */ 184, 22, 96, 97, 98, 99, 100, 101, 102, 103,
- /* 1210 */ 104, 105, 106, 184, 245, 246, 184, 26, 23, 142,
- /* 1220 */ 128, 26, 206, 207, 150, 133, 152, 22, 22, 24,
- /* 1230 */ 111, 23, 53, 184, 26, 206, 207, 151, 206, 207,
- /* 1240 */ 119, 24, 122, 23, 23, 23, 26, 26, 26, 23,
- /* 1250 */ 23, 23, 26, 26, 26, 136, 23, 19, 22, 26,
- /* 1260 */ 113, 114, 24, 114, 144, 184, 59, 61, 7, 8,
- /* 1270 */ 59, 23, 23, 124, 26, 26, 23, 19, 145, 26,
- /* 1280 */ 147, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- /* 1290 */ 52, 53, 54, 55, 56, 57, 145, 23, 147, 184,
- /* 1300 */ 26, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- /* 1310 */ 52, 53, 54, 55, 56, 57, 23, 110, 184, 26,
- /* 1320 */ 184, 110, 184, 184, 184, 215, 135, 215, 184, 184,
- /* 1330 */ 184, 247, 184, 244, 96, 97, 98, 99, 100, 101,
- /* 1340 */ 102, 103, 104, 105, 106, 184, 184, 184, 301, 184,
- /* 1350 */ 184, 134, 225, 184, 96, 97, 98, 99, 100, 101,
- /* 1360 */ 102, 103, 104, 105, 106, 184, 184, 184, 184, 184,
- /* 1370 */ 134, 184, 274, 273, 19, 244, 244, 204, 182, 244,
- /* 1380 */ 283, 231, 279, 279, 232, 244, 210, 209, 235, 235,
- /* 1390 */ 235, 248, 218, 234, 19, 209, 238, 209, 238, 44,
- /* 1400 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- /* 1410 */ 55, 56, 57, 214, 60, 248, 248, 187, 134, 38,
- /* 1420 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- /* 1430 */ 55, 56, 57, 232, 191, 191, 266, 280, 191, 283,
- /* 1440 */ 143, 269, 108, 22, 280, 19, 20, 258, 22, 257,
- /* 1450 */ 43, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- /* 1460 */ 105, 106, 36, 223, 142, 18, 235, 226, 226, 191,
- /* 1470 */ 18, 96, 97, 98, 99, 100, 101, 102, 103, 104,
- /* 1480 */ 105, 106, 226, 226, 190, 59, 235, 235, 223, 223,
- /* 1490 */ 258, 257, 191, 190, 235, 150, 62, 71, 191, 276,
- /* 1500 */ 275, 19, 20, 190, 22, 22, 211, 81, 191, 190,
- /* 1510 */ 211, 191, 108, 190, 208, 64, 208, 208, 36, 119,
- /* 1520 */ 94, 216, 211, 208, 210, 106, 100, 101, 216, 208,
- /* 1530 */ 48, 268, 208, 107, 208, 109, 110, 111, 211, 268,
- /* 1540 */ 114, 59, 211, 137, 108, 88, 250, 249, 191, 141,
- /* 1550 */ 250, 249, 138, 71, 250, 300, 22, 131, 132, 249,
- /* 1560 */ 300, 191, 150, 238, 82, 140, 250, 249, 239, 87,
- /* 1570 */ 139, 145, 146, 147, 148, 149, 94, 239, 237, 236,
- /* 1580 */ 25, 235, 100, 101, 194, 26, 193, 13, 185, 107,
- /* 1590 */ 185, 109, 110, 111, 6, 263, 114, 203, 265, 183,
- /* 1600 */ 183, 183, 203, 212, 203, 203, 197, 197, 212, 4,
- /* 1610 */ 3, 22, 197, 155, 15, 204, 203, 289, 93, 289,
- /* 1620 */ 16, 286, 132, 23, 204, 23, 123, 145, 146, 147,
- /* 1630 */ 148, 149, 0, 1, 2, 143, 24, 5, 20, 135,
- /* 1640 */ 16, 1, 10, 11, 12, 13, 14, 137, 135, 17,
- /* 1650 */ 144, 123, 19, 20, 61, 22, 37, 143, 123, 53,
- /* 1660 */ 109, 53, 30, 53, 32, 34, 53, 134, 1, 36,
- /* 1670 */ 5, 22, 40, 108, 153, 41, 26, 68, 75, 68,
- /* 1680 */ 134, 108, 24, 20, 124, 19, 118, 67, 67, 28,
- /* 1690 */ 22, 22, 59, 22, 67, 23, 22, 22, 142, 37,
- /* 1700 */ 23, 22, 70, 23, 71, 157, 23, 23, 26, 23,
- /* 1710 */ 78, 22, 24, 81, 23, 82, 22, 24, 134, 23,
- /* 1720 */ 87, 23, 19, 20, 92, 22, 109, 94, 22, 34,
- /* 1730 */ 136, 26, 85, 100, 101, 34, 34, 83, 34, 36,
- /* 1740 */ 107, 34, 109, 110, 111, 75, 90, 114, 75, 34,
- /* 1750 */ 23, 22, 44, 34, 24, 23, 22, 26, 126, 26,
- /* 1760 */ 23, 23, 59, 131, 132, 23, 23, 26, 23, 11,
- /* 1770 */ 22, 22, 26, 23, 71, 23, 22, 22, 145, 146,
- /* 1780 */ 147, 148, 149, 128, 23, 82, 154, 134, 15, 1,
- /* 1790 */ 87, 134, 302, 134, 134, 302, 302, 94, 302, 302,
- /* 1800 */ 302, 302, 302, 100, 101, 302, 302, 302, 302, 302,
- /* 1810 */ 107, 302, 109, 110, 111, 1, 2, 114, 302, 5,
- /* 1820 */ 302, 302, 302, 302, 10, 11, 12, 13, 14, 302,
- /* 1830 */ 302, 17, 302, 302, 302, 302, 19, 20, 302, 22,
- /* 1840 */ 302, 302, 302, 302, 30, 302, 32, 302, 145, 146,
- /* 1850 */ 147, 148, 149, 36, 40, 302, 302, 302, 302, 302,
- /* 1860 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 1870 */ 302, 302, 302, 302, 302, 302, 59, 302, 302, 302,
- /* 1880 */ 302, 302, 302, 302, 70, 302, 302, 302, 71, 302,
- /* 1890 */ 302, 302, 78, 302, 302, 81, 19, 20, 302, 22,
- /* 1900 */ 302, 302, 302, 302, 302, 302, 92, 302, 302, 302,
- /* 1910 */ 302, 94, 302, 36, 302, 302, 302, 100, 101, 102,
- /* 1920 */ 302, 302, 302, 302, 107, 302, 109, 110, 111, 302,
- /* 1930 */ 302, 114, 302, 302, 302, 302, 59, 302, 302, 302,
- /* 1940 */ 126, 302, 302, 302, 302, 131, 132, 302, 71, 302,
- /* 1950 */ 302, 302, 302, 302, 302, 302, 19, 20, 302, 22,
- /* 1960 */ 302, 302, 145, 146, 147, 148, 149, 302, 154, 302,
- /* 1970 */ 302, 94, 302, 36, 302, 302, 302, 100, 101, 302,
- /* 1980 */ 302, 302, 302, 302, 107, 302, 109, 110, 111, 302,
- /* 1990 */ 302, 114, 5, 302, 302, 302, 59, 10, 11, 12,
- /* 2000 */ 13, 14, 302, 302, 17, 302, 302, 302, 71, 302,
- /* 2010 */ 302, 302, 302, 302, 302, 302, 302, 30, 302, 32,
- /* 2020 */ 302, 302, 145, 146, 147, 148, 149, 40, 302, 302,
- /* 2030 */ 302, 94, 302, 302, 302, 302, 302, 100, 101, 302,
- /* 2040 */ 302, 302, 302, 302, 107, 302, 109, 110, 111, 302,
- /* 2050 */ 302, 114, 302, 302, 302, 302, 302, 70, 302, 302,
- /* 2060 */ 302, 302, 302, 302, 302, 78, 302, 302, 81, 302,
- /* 2070 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 92,
- /* 2080 */ 302, 302, 145, 146, 147, 148, 149, 302, 302, 302,
- /* 2090 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 2100 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 2110 */ 302, 302, 302, 126, 302, 302, 302, 302, 131, 132,
- /* 2120 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 2130 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 2140 */ 302, 154, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 2150 */ 302, 302, 302, 302, 302, 302, 302, 302, 302, 302,
- /* 2160 */ 302, 302, 302, 302, 302, 302, 302, 302, 302,
+ /* 0 */ 187, 187, 187, 216, 217, 187, 206, 187, 264, 265,
+ /* 10 */ 266, 187, 225, 187, 209, 187, 264, 265, 266, 19,
+ /* 20 */ 187, 187, 209, 210, 209, 210, 187, 209, 210, 209,
+ /* 30 */ 210, 31, 209, 209, 210, 209, 210, 285, 224, 39,
+ /* 40 */ 203, 204, 205, 43, 44, 45, 46, 47, 48, 49,
+ /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 230, 19,
+ /* 60 */ 181, 182, 183, 184, 230, 245, 233, 208, 189, 245,
+ /* 70 */ 191, 245, 26, 206, 254, 216, 276, 198, 254, 198,
+ /* 80 */ 254, 281, 187, 43, 44, 45, 46, 47, 48, 49,
+ /* 90 */ 50, 51, 52, 53, 54, 55, 56, 57, 259, 99,
+ /* 100 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ /* 110 */ 231, 232, 231, 232, 286, 302, 303, 302, 22, 304,
+ /* 120 */ 302, 303, 76, 244, 11, 244, 86, 19, 88, 248,
+ /* 130 */ 249, 264, 265, 266, 26, 89, 198, 258, 92, 99,
+ /* 140 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ /* 150 */ 105, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ /* 160 */ 52, 53, 54, 55, 56, 57, 212, 288, 273, 231,
+ /* 170 */ 232, 105, 106, 107, 108, 109, 131, 69, 203, 204,
+ /* 180 */ 205, 136, 244, 99, 100, 101, 102, 103, 104, 105,
+ /* 190 */ 106, 107, 108, 109, 15, 103, 104, 19, 260, 103,
+ /* 200 */ 104, 54, 55, 56, 57, 58, 22, 99, 100, 101,
+ /* 210 */ 102, 103, 104, 105, 106, 107, 108, 109, 264, 265,
+ /* 220 */ 266, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ /* 230 */ 52, 53, 54, 55, 56, 57, 19, 124, 125, 60,
+ /* 240 */ 148, 24, 150, 59, 187, 67, 99, 100, 101, 102,
+ /* 250 */ 103, 104, 105, 106, 107, 108, 109, 187, 187, 109,
+ /* 260 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ /* 270 */ 53, 54, 55, 56, 57, 204, 205, 99, 100, 101,
+ /* 280 */ 102, 103, 104, 105, 106, 107, 108, 109, 103, 104,
+ /* 290 */ 105, 106, 107, 108, 109, 59, 112, 113, 114, 76,
+ /* 300 */ 231, 232, 187, 19, 19, 22, 23, 23, 54, 55,
+ /* 310 */ 56, 57, 89, 244, 199, 92, 99, 100, 101, 102,
+ /* 320 */ 103, 104, 105, 106, 107, 108, 109, 43, 44, 45,
+ /* 330 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ /* 340 */ 56, 57, 19, 212, 187, 274, 23, 26, 112, 113,
+ /* 350 */ 114, 294, 295, 99, 100, 101, 102, 103, 104, 105,
+ /* 360 */ 106, 107, 108, 109, 59, 295, 43, 44, 45, 46,
+ /* 370 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ /* 380 */ 57, 98, 146, 99, 100, 101, 102, 103, 104, 105,
+ /* 390 */ 106, 107, 108, 109, 109, 264, 265, 266, 187, 187,
+ /* 400 */ 115, 116, 117, 118, 119, 120, 121, 73, 59, 19,
+ /* 410 */ 105, 23, 127, 23, 26, 81, 259, 112, 113, 114,
+ /* 420 */ 187, 72, 99, 100, 101, 102, 103, 104, 105, 106,
+ /* 430 */ 107, 108, 109, 43, 44, 45, 46, 47, 48, 49,
+ /* 440 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 124,
+ /* 450 */ 125, 182, 23, 184, 187, 134, 135, 123, 189, 131,
+ /* 460 */ 191, 112, 113, 114, 136, 187, 233, 198, 134, 135,
+ /* 470 */ 198, 259, 43, 44, 45, 46, 47, 48, 49, 50,
+ /* 480 */ 51, 52, 53, 54, 55, 56, 57, 209, 210, 99,
+ /* 490 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ /* 500 */ 231, 232, 206, 231, 232, 187, 59, 296, 297, 76,
+ /* 510 */ 160, 161, 301, 244, 232, 19, 244, 297, 59, 23,
+ /* 520 */ 87, 301, 89, 245, 26, 92, 244, 258, 99, 100,
+ /* 530 */ 101, 102, 103, 104, 105, 106, 107, 108, 109, 43,
+ /* 540 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ /* 550 */ 54, 55, 56, 57, 19, 187, 97, 288, 23, 112,
+ /* 560 */ 113, 114, 115, 296, 297, 118, 119, 120, 301, 108,
+ /* 570 */ 109, 112, 113, 255, 141, 128, 117, 281, 43, 44,
+ /* 580 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ /* 590 */ 55, 56, 57, 187, 187, 99, 100, 101, 102, 103,
+ /* 600 */ 104, 105, 106, 107, 108, 109, 26, 148, 149, 150,
+ /* 610 */ 115, 97, 59, 118, 119, 120, 209, 210, 73, 59,
+ /* 620 */ 122, 19, 209, 128, 256, 72, 187, 113, 187, 81,
+ /* 630 */ 223, 117, 227, 228, 99, 100, 101, 102, 103, 104,
+ /* 640 */ 105, 106, 107, 108, 109, 43, 44, 45, 46, 47,
+ /* 650 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ /* 660 */ 19, 255, 148, 149, 150, 112, 113, 114, 123, 124,
+ /* 670 */ 125, 230, 112, 113, 114, 22, 297, 22, 81, 22,
+ /* 680 */ 301, 59, 134, 135, 43, 44, 45, 46, 47, 48,
+ /* 690 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 139,
+ /* 700 */ 192, 99, 100, 101, 102, 103, 104, 105, 106, 107,
+ /* 710 */ 108, 109, 59, 116, 59, 187, 59, 231, 232, 46,
+ /* 720 */ 47, 48, 49, 16, 12, 145, 198, 22, 187, 187,
+ /* 730 */ 244, 134, 135, 222, 112, 113, 114, 209, 210, 27,
+ /* 740 */ 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+ /* 750 */ 109, 209, 210, 187, 42, 187, 154, 227, 228, 231,
+ /* 760 */ 232, 139, 22, 23, 59, 112, 113, 114, 113, 112,
+ /* 770 */ 113, 114, 244, 245, 233, 63, 19, 209, 210, 271,
+ /* 780 */ 187, 24, 254, 275, 77, 73, 79, 245, 195, 260,
+ /* 790 */ 117, 223, 199, 22, 23, 154, 19, 26, 22, 187,
+ /* 800 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ /* 810 */ 53, 54, 55, 56, 57, 19, 187, 112, 113, 114,
+ /* 820 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ /* 830 */ 53, 54, 55, 56, 57, 59, 263, 187, 98, 43,
+ /* 840 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ /* 850 */ 54, 55, 56, 57, 204, 205, 99, 100, 101, 102,
+ /* 860 */ 103, 104, 105, 106, 107, 108, 109, 255, 130, 98,
+ /* 870 */ 132, 133, 299, 300, 198, 187, 99, 100, 101, 102,
+ /* 880 */ 103, 104, 105, 106, 107, 108, 109, 187, 112, 113,
+ /* 890 */ 114, 187, 241, 187, 243, 99, 100, 101, 102, 103,
+ /* 900 */ 104, 105, 106, 107, 108, 109, 19, 231, 232, 209,
+ /* 910 */ 210, 282, 59, 209, 210, 209, 210, 16, 230, 19,
+ /* 920 */ 244, 22, 23, 223, 274, 26, 19, 223, 187, 223,
+ /* 930 */ 198, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ /* 940 */ 53, 54, 55, 56, 57, 45, 46, 47, 48, 49,
+ /* 950 */ 50, 51, 52, 53, 54, 55, 56, 57, 19, 20,
+ /* 960 */ 187, 22, 187, 231, 232, 112, 113, 114, 123, 124,
+ /* 970 */ 125, 7, 8, 9, 187, 36, 244, 24, 77, 21,
+ /* 980 */ 79, 187, 209, 210, 187, 263, 99, 100, 101, 102,
+ /* 990 */ 103, 104, 105, 106, 107, 108, 109, 98, 59, 99,
+ /* 1000 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ /* 1010 */ 71, 187, 59, 187, 187, 19, 20, 187, 22, 112,
+ /* 1020 */ 81, 299, 300, 282, 230, 199, 291, 292, 22, 187,
+ /* 1030 */ 24, 256, 36, 209, 210, 187, 97, 35, 80, 209,
+ /* 1040 */ 210, 268, 103, 104, 48, 187, 220, 223, 222, 110,
+ /* 1050 */ 59, 112, 113, 114, 187, 59, 117, 156, 187, 179,
+ /* 1060 */ 180, 181, 182, 183, 184, 59, 113, 71, 66, 189,
+ /* 1070 */ 22, 191, 230, 134, 135, 245, 74, 119, 198, 282,
+ /* 1080 */ 297, 85, 224, 198, 301, 187, 90, 148, 149, 150,
+ /* 1090 */ 151, 152, 19, 97, 103, 104, 123, 124, 125, 103,
+ /* 1100 */ 104, 53, 111, 112, 113, 114, 110, 116, 112, 113,
+ /* 1110 */ 114, 231, 232, 117, 156, 124, 231, 232, 297, 113,
+ /* 1120 */ 187, 24, 301, 256, 244, 201, 202, 256, 126, 244,
+ /* 1130 */ 187, 198, 187, 187, 23, 187, 187, 26, 258, 148,
+ /* 1140 */ 19, 150, 209, 210, 148, 149, 150, 151, 152, 0,
+ /* 1150 */ 1, 2, 209, 210, 5, 209, 210, 209, 210, 10,
+ /* 1160 */ 11, 12, 13, 14, 231, 232, 17, 46, 288, 19,
+ /* 1170 */ 20, 223, 22, 236, 198, 66, 187, 244, 245, 30,
+ /* 1180 */ 12, 32, 198, 246, 59, 112, 36, 187, 245, 40,
+ /* 1190 */ 198, 245, 117, 29, 85, 27, 26, 33, 209, 210,
+ /* 1200 */ 297, 76, 127, 94, 301, 256, 26, 231, 232, 59,
+ /* 1210 */ 42, 153, 87, 155, 89, 231, 232, 92, 31, 70,
+ /* 1220 */ 244, 71, 26, 231, 232, 114, 39, 78, 244, 65,
+ /* 1230 */ 81, 63, 111, 233, 137, 85, 244, 112, 113, 114,
+ /* 1240 */ 90, 22, 59, 24, 95, 201, 202, 97, 127, 187,
+ /* 1250 */ 139, 142, 187, 103, 104, 19, 20, 187, 22, 187,
+ /* 1260 */ 110, 187, 112, 113, 114, 187, 141, 117, 141, 187,
+ /* 1270 */ 23, 187, 36, 26, 209, 210, 134, 135, 129, 209,
+ /* 1280 */ 210, 209, 210, 134, 135, 22, 159, 209, 210, 187,
+ /* 1290 */ 187, 209, 210, 209, 210, 59, 113, 187, 148, 149,
+ /* 1300 */ 150, 151, 152, 289, 290, 187, 157, 71, 248, 249,
+ /* 1310 */ 114, 141, 209, 210, 46, 125, 116, 117, 138, 19,
+ /* 1320 */ 20, 85, 22, 148, 61, 150, 90, 209, 210, 23,
+ /* 1330 */ 7, 8, 26, 97, 187, 139, 36, 147, 59, 103,
+ /* 1340 */ 104, 19, 20, 187, 22, 59, 110, 187, 112, 113,
+ /* 1350 */ 114, 1, 2, 117, 187, 5, 209, 210, 36, 59,
+ /* 1360 */ 10, 11, 12, 13, 14, 209, 210, 17, 59, 209,
+ /* 1370 */ 210, 71, 187, 148, 250, 150, 209, 210, 187, 111,
+ /* 1380 */ 30, 59, 32, 22, 148, 149, 150, 151, 152, 187,
+ /* 1390 */ 40, 187, 113, 71, 209, 210, 187, 97, 187, 113,
+ /* 1400 */ 209, 210, 187, 103, 104, 105, 23, 187, 187, 26,
+ /* 1410 */ 110, 187, 112, 113, 114, 83, 84, 117, 23, 97,
+ /* 1420 */ 70, 26, 113, 218, 187, 103, 104, 187, 78, 209,
+ /* 1430 */ 210, 81, 110, 187, 112, 113, 114, 19, 20, 117,
+ /* 1440 */ 22, 187, 187, 187, 187, 95, 209, 210, 148, 149,
+ /* 1450 */ 150, 151, 152, 187, 36, 23, 187, 187, 26, 187,
+ /* 1460 */ 187, 187, 187, 209, 210, 209, 210, 187, 187, 218,
+ /* 1470 */ 148, 149, 150, 151, 152, 209, 210, 59, 187, 129,
+ /* 1480 */ 187, 209, 210, 187, 134, 135, 187, 306, 187, 71,
+ /* 1490 */ 209, 210, 23, 228, 187, 26, 23, 187, 137, 26,
+ /* 1500 */ 209, 210, 209, 210, 187, 209, 210, 157, 209, 210,
+ /* 1510 */ 209, 210, 218, 187, 187, 97, 209, 210, 187, 278,
+ /* 1520 */ 23, 103, 104, 26, 187, 187, 187, 187, 110, 187,
+ /* 1530 */ 112, 113, 114, 187, 187, 117, 5, 247, 187, 187,
+ /* 1540 */ 187, 10, 11, 12, 13, 14, 209, 210, 17, 209,
+ /* 1550 */ 210, 209, 210, 187, 187, 187, 209, 210, 187, 23,
+ /* 1560 */ 187, 30, 26, 32, 187, 187, 148, 149, 150, 151,
+ /* 1570 */ 152, 40, 187, 187, 187, 209, 210, 209, 210, 187,
+ /* 1580 */ 209, 210, 209, 210, 187, 187, 209, 210, 187, 277,
+ /* 1590 */ 234, 187, 247, 187, 209, 210, 209, 210, 187, 235,
+ /* 1600 */ 187, 70, 187, 207, 247, 247, 247, 209, 210, 78,
+ /* 1610 */ 209, 210, 81, 209, 210, 209, 210, 187, 185, 238,
+ /* 1620 */ 209, 210, 209, 210, 209, 210, 95, 251, 287, 238,
+ /* 1630 */ 251, 23, 23, 23, 26, 26, 26, 283, 23, 209,
+ /* 1640 */ 210, 26, 213, 238, 221, 283, 212, 212, 217, 212,
+ /* 1650 */ 251, 241, 270, 241, 237, 235, 190, 60, 137, 287,
+ /* 1660 */ 129, 194, 194, 38, 284, 134, 135, 273, 284, 194,
+ /* 1670 */ 146, 111, 22, 43, 226, 145, 262, 261, 238, 18,
+ /* 1680 */ 229, 229, 229, 229, 194, 18, 193, 238, 157, 262,
+ /* 1690 */ 226, 226, 194, 238, 238, 193, 153, 261, 62, 280,
+ /* 1700 */ 279, 194, 193, 22, 194, 214, 193, 111, 194, 193,
+ /* 1710 */ 214, 211, 211, 64, 211, 211, 122, 211, 219, 214,
+ /* 1720 */ 109, 213, 160, 211, 300, 140, 211, 253, 111, 272,
+ /* 1730 */ 219, 214, 272, 214, 252, 194, 253, 252, 91, 253,
+ /* 1740 */ 252, 82, 253, 305, 252, 144, 305, 141, 22, 194,
+ /* 1750 */ 269, 257, 257, 153, 267, 143, 142, 25, 197, 26,
+ /* 1760 */ 242, 241, 196, 240, 242, 239, 238, 13, 188, 188,
+ /* 1770 */ 6, 293, 186, 186, 186, 200, 206, 293, 206, 206,
+ /* 1780 */ 206, 4, 200, 215, 215, 207, 207, 3, 22, 206,
+ /* 1790 */ 200, 158, 96, 15, 23, 16, 23, 135, 146, 126,
+ /* 1800 */ 24, 138, 20, 16, 140, 1, 138, 147, 126, 61,
+ /* 1810 */ 53, 37, 146, 53, 53, 290, 53, 126, 112, 34,
+ /* 1820 */ 137, 1, 5, 22, 111, 156, 68, 68, 26, 41,
+ /* 1830 */ 75, 137, 111, 24, 20, 19, 127, 121, 23, 67,
+ /* 1840 */ 22, 22, 67, 22, 22, 37, 22, 67, 23, 145,
+ /* 1850 */ 22, 28, 23, 23, 23, 137, 23, 22, 26, 22,
+ /* 1860 */ 24, 23, 112, 24, 23, 23, 22, 139, 34, 26,
+ /* 1870 */ 75, 88, 86, 75, 34, 23, 22, 24, 22, 34,
+ /* 1880 */ 34, 34, 93, 34, 26, 26, 23, 23, 23, 34,
+ /* 1890 */ 23, 23, 44, 23, 11, 26, 22, 22, 26, 23,
+ /* 1900 */ 23, 22, 22, 15, 137, 137, 137, 137, 23, 1,
+ /* 1910 */ 307, 307, 131, 307, 307, 307, 307, 307, 307, 307,
+ /* 1920 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1930 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1940 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1950 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1960 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1970 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1980 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 1990 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2000 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2010 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2020 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2030 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2040 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2050 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2060 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2070 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2080 */ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307,
+ /* 2090 */ 307, 307,
};
-#define YY_SHIFT_COUNT (539)
+#define YY_SHIFT_COUNT (542)
#define YY_SHIFT_MIN (0)
-#define YY_SHIFT_MAX (1987)
+#define YY_SHIFT_MAX (1908)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 1814, 1632, 1987, 1426, 1426, 382, 1482, 1633, 1703, 1877,
- /* 10 */ 1877, 1877, 85, 0, 0, 264, 1106, 1877, 1877, 1877,
- /* 20 */ 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- /* 30 */ 226, 226, 380, 380, 294, 667, 382, 382, 382, 382,
- /* 40 */ 382, 382, 97, 194, 332, 429, 526, 623, 720, 817,
- /* 50 */ 914, 934, 1086, 1238, 1106, 1106, 1106, 1106, 1106, 1106,
- /* 60 */ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
- /* 70 */ 1106, 1106, 1258, 1106, 1355, 1375, 1375, 1817, 1877, 1877,
- /* 80 */ 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- /* 90 */ 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- /* 100 */ 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- /* 110 */ 1937, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877, 1877,
- /* 120 */ 1877, 1877, 1877, 1877, 32, 129, 129, 129, 129, 129,
- /* 130 */ 171, 7, 17, 593, 676, 590, 593, 205, 205, 593,
- /* 140 */ 318, 318, 318, 318, 50, 152, 51, 2142, 2142, 284,
- /* 150 */ 284, 284, 65, 145, 282, 145, 145, 574, 574, 256,
- /* 160 */ 348, 445, 782, 593, 593, 593, 593, 593, 593, 593,
- /* 170 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 593,
- /* 180 */ 593, 593, 593, 593, 607, 607, 593, 721, 805, 805,
- /* 190 */ 446, 851, 851, 446, 190, 979, 2142, 2142, 2142, 453,
- /* 200 */ 45, 45, 480, 490, 484, 385, 575, 502, 551, 581,
- /* 210 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 689,
- /* 220 */ 593, 593, 593, 593, 593, 593, 593, 593, 593, 593,
- /* 230 */ 593, 593, 582, 582, 582, 593, 593, 593, 593, 771,
- /* 240 */ 593, 593, 593, 59, 764, 593, 593, 863, 593, 593,
- /* 250 */ 593, 593, 593, 593, 593, 593, 665, 819, 580, 16,
- /* 260 */ 16, 16, 16, 1119, 580, 580, 967, 321, 931, 1042,
- /* 270 */ 1077, 783, 783, 834, 1077, 1077, 834, 1121, 1195, 401,
- /* 280 */ 1142, 1142, 1142, 783, 787, 787, 1074, 1191, 1092, 1205,
- /* 290 */ 1354, 1284, 1284, 1381, 1381, 1284, 1297, 1334, 1421, 1407,
- /* 300 */ 1322, 1447, 1447, 1447, 1447, 1284, 1452, 1322, 1322, 1334,
- /* 310 */ 1421, 1407, 1407, 1322, 1284, 1452, 1345, 1434, 1284, 1452,
- /* 320 */ 1483, 1284, 1452, 1284, 1452, 1483, 1404, 1404, 1404, 1451,
- /* 330 */ 1483, 1404, 1400, 1404, 1451, 1404, 1404, 1483, 1419, 1419,
- /* 340 */ 1483, 1406, 1436, 1406, 1436, 1406, 1436, 1406, 1436, 1284,
- /* 350 */ 1457, 1457, 1408, 1414, 1534, 1284, 1412, 1408, 1425, 1431,
- /* 360 */ 1322, 1555, 1559, 1574, 1574, 1588, 1588, 1588, 2142, 2142,
- /* 370 */ 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142, 2142,
- /* 380 */ 2142, 2142, 2142, 378, 777, 836, 971, 825, 775, 983,
- /* 390 */ 1208, 1179, 1217, 1120, 1220, 1206, 1221, 1222, 1226, 1227,
- /* 400 */ 1228, 1233, 937, 1147, 1261, 1149, 1207, 1248, 1249, 1253,
- /* 410 */ 1133, 1151, 1274, 1293, 1211, 1236, 1605, 1607, 1589, 1458,
- /* 420 */ 1599, 1525, 1604, 1600, 1602, 1490, 1492, 1503, 1612, 1504,
- /* 430 */ 1618, 1510, 1624, 1640, 1513, 1506, 1528, 1593, 1619, 1514,
- /* 440 */ 1606, 1608, 1610, 1613, 1535, 1551, 1631, 1533, 1667, 1665,
- /* 450 */ 1649, 1565, 1521, 1609, 1650, 1611, 1603, 1634, 1546, 1573,
- /* 460 */ 1658, 1663, 1666, 1560, 1568, 1668, 1620, 1669, 1671, 1672,
- /* 470 */ 1674, 1621, 1661, 1675, 1627, 1662, 1677, 1556, 1679, 1680,
- /* 480 */ 1548, 1683, 1684, 1682, 1686, 1689, 1688, 1691, 1694, 1693,
- /* 490 */ 1584, 1696, 1698, 1617, 1695, 1706, 1594, 1705, 1701, 1702,
- /* 500 */ 1704, 1707, 1647, 1670, 1654, 1708, 1673, 1656, 1715, 1727,
- /* 510 */ 1729, 1730, 1731, 1733, 1719, 1732, 1705, 1737, 1738, 1742,
- /* 520 */ 1743, 1741, 1745, 1734, 1758, 1748, 1749, 1750, 1752, 1754,
- /* 530 */ 1755, 1746, 1655, 1653, 1657, 1659, 1660, 1761, 1773, 1788,
+ /* 0 */ 1350, 1149, 1531, 939, 939, 548, 996, 1150, 1236, 1322,
+ /* 10 */ 1322, 1322, 334, 0, 0, 178, 777, 1322, 1322, 1322,
+ /* 20 */ 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
+ /* 30 */ 991, 991, 1125, 1125, 447, 597, 548, 548, 548, 548,
+ /* 40 */ 548, 548, 40, 108, 217, 284, 323, 390, 429, 496,
+ /* 50 */ 535, 602, 641, 757, 777, 777, 777, 777, 777, 777,
+ /* 60 */ 777, 777, 777, 777, 777, 777, 777, 777, 777, 777,
+ /* 70 */ 777, 777, 796, 777, 887, 900, 900, 1300, 1322, 1322,
+ /* 80 */ 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
+ /* 90 */ 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
+ /* 100 */ 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
+ /* 110 */ 1418, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322, 1322,
+ /* 120 */ 1322, 1322, 1322, 1322, 147, 254, 254, 254, 254, 254,
+ /* 130 */ 84, 185, 66, 853, 958, 1121, 853, 92, 92, 853,
+ /* 140 */ 321, 321, 321, 321, 325, 350, 350, 461, 150, 1913,
+ /* 150 */ 1913, 285, 285, 285, 236, 184, 349, 184, 184, 712,
+ /* 160 */ 712, 433, 553, 771, 899, 853, 853, 853, 853, 853,
+ /* 170 */ 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
+ /* 180 */ 853, 853, 853, 853, 853, 853, 46, 46, 853, 113,
+ /* 190 */ 223, 223, 1183, 1183, 1127, 1142, 1913, 1913, 1913, 459,
+ /* 200 */ 514, 514, 653, 495, 657, 305, 705, 560, 622, 776,
+ /* 210 */ 853, 853, 853, 853, 853, 853, 853, 853, 853, 545,
+ /* 220 */ 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
+ /* 230 */ 853, 853, 1002, 1002, 1002, 853, 853, 853, 853, 1111,
+ /* 240 */ 853, 853, 853, 1006, 1109, 853, 853, 1168, 853, 853,
+ /* 250 */ 853, 853, 853, 853, 853, 853, 845, 1164, 738, 953,
+ /* 260 */ 953, 953, 953, 1196, 738, 738, 45, 96, 964, 179,
+ /* 270 */ 580, 907, 907, 1073, 580, 580, 1073, 498, 388, 1268,
+ /* 280 */ 1187, 1187, 1187, 907, 1170, 1170, 1058, 1180, 328, 1219,
+ /* 290 */ 1597, 1521, 1521, 1625, 1625, 1521, 1524, 1560, 1650, 1630,
+ /* 300 */ 1530, 1661, 1661, 1661, 1661, 1521, 1667, 1530, 1530, 1560,
+ /* 310 */ 1650, 1630, 1630, 1530, 1521, 1667, 1543, 1636, 1521, 1667,
+ /* 320 */ 1681, 1521, 1667, 1521, 1667, 1681, 1596, 1596, 1596, 1649,
+ /* 330 */ 1681, 1596, 1594, 1596, 1649, 1596, 1596, 1562, 1681, 1611,
+ /* 340 */ 1611, 1681, 1585, 1617, 1585, 1617, 1585, 1617, 1585, 1617,
+ /* 350 */ 1521, 1647, 1647, 1659, 1659, 1601, 1606, 1726, 1521, 1600,
+ /* 360 */ 1601, 1612, 1614, 1530, 1732, 1733, 1754, 1754, 1764, 1764,
+ /* 370 */ 1764, 1913, 1913, 1913, 1913, 1913, 1913, 1913, 1913, 1913,
+ /* 380 */ 1913, 1913, 1913, 1913, 1913, 1913, 673, 901, 283, 740,
+ /* 390 */ 707, 973, 655, 1247, 1048, 1097, 1190, 1306, 1263, 1383,
+ /* 400 */ 1395, 1432, 1469, 1473, 1497, 1279, 1200, 1323, 1075, 1286,
+ /* 410 */ 1536, 1608, 1332, 1609, 1175, 1225, 1610, 1615, 1309, 1361,
+ /* 420 */ 1777, 1784, 1766, 1633, 1778, 1696, 1779, 1771, 1773, 1662,
+ /* 430 */ 1652, 1673, 1776, 1663, 1782, 1664, 1787, 1804, 1668, 1660,
+ /* 440 */ 1682, 1748, 1774, 1666, 1757, 1760, 1761, 1763, 1691, 1706,
+ /* 450 */ 1785, 1683, 1820, 1817, 1801, 1713, 1669, 1758, 1802, 1759,
+ /* 460 */ 1755, 1788, 1694, 1721, 1809, 1814, 1816, 1709, 1716, 1818,
+ /* 470 */ 1772, 1819, 1821, 1815, 1822, 1775, 1823, 1824, 1780, 1808,
+ /* 480 */ 1825, 1704, 1828, 1829, 1830, 1831, 1832, 1833, 1835, 1836,
+ /* 490 */ 1838, 1837, 1839, 1718, 1841, 1842, 1750, 1834, 1844, 1728,
+ /* 500 */ 1843, 1840, 1845, 1846, 1847, 1783, 1795, 1786, 1848, 1798,
+ /* 510 */ 1789, 1849, 1852, 1854, 1853, 1858, 1859, 1855, 1863, 1843,
+ /* 520 */ 1864, 1865, 1867, 1868, 1869, 1870, 1856, 1883, 1874, 1875,
+ /* 530 */ 1876, 1877, 1879, 1880, 1872, 1781, 1767, 1768, 1769, 1770,
+ /* 540 */ 1885, 1888, 1908,
};
-#define YY_REDUCE_COUNT (382)
-#define YY_REDUCE_MIN (-260)
-#define YY_REDUCE_MAX (1420)
+#define YY_REDUCE_COUNT (385)
+#define YY_REDUCE_MIN (-256)
+#define YY_REDUCE_MAX (1590)
static const short yy_reduce_ofst[] = {
- /* 0 */ -170, -18, -159, 309, 313, -167, -19, 75, 117, 211,
- /* 10 */ 315, 317, -165, -195, -168, -260, 389, 437, 475, 524,
- /* 20 */ 527, -169, 529, 531, -28, 80, 534, 239, 304, 412,
- /* 30 */ 558, 577, 37, 120, 368, -22, 460, 517, 555, 560,
- /* 40 */ 562, 586, -257, -257, -257, -257, -257, -257, -257, -257,
- /* 50 */ -257, -257, -257, -257, -257, -257, -257, -257, -257, -257,
- /* 60 */ -257, -257, -257, -257, -257, -257, -257, -257, -257, -257,
- /* 70 */ -257, -257, -257, -257, -257, -257, -257, -172, 457, 628,
- /* 80 */ 673, 692, 694, 702, 704, 722, 728, 740, 743, 748,
- /* 90 */ 767, 791, 815, 818, 820, 822, 857, 861, 864, 866,
- /* 100 */ 868, 870, 872, 874, 876, 881, 900, 902, 906, 908,
- /* 110 */ 910, 912, 915, 917, 920, 960, 962, 964, 988, 990,
- /* 120 */ 992, 1016, 1029, 1032, -257, -257, -257, -257, -257, -257,
- /* 130 */ -257, -257, -257, 271, 618, -190, 68, 60, 240, -124,
- /* 140 */ 603, 610, 603, 610, 12, -257, -257, -257, -257, -128,
- /* 150 */ -128, -128, -142, 25, 270, 281, 333, 124, 236, 648,
- /* 160 */ 374, 465, 465, 28, 598, 792, 839, 469, 38, 381,
- /* 170 */ 622, 709, 173, 699, 522, 703, 808, 811, 867, 816,
- /* 180 */ -104, 823, -3, 875, 649, 753, 323, -88, 882, 884,
- /* 190 */ 518, 43, 325, 899, 763, 604, 879, 969, 402, -193,
- /* 200 */ -189, -180, -151, -55, 69, 104, 141, 259, 286, 360,
- /* 210 */ 364, 455, 474, 481, 510, 516, 611, 653, 788, 99,
- /* 220 */ 871, 878, 995, 1009, 1049, 1081, 1115, 1134, 1136, 1138,
- /* 230 */ 1139, 1140, 733, 1110, 1112, 1144, 1145, 1146, 1148, 1084,
- /* 240 */ 1161, 1162, 1163, 1089, 1047, 1165, 1166, 1127, 1169, 104,
- /* 250 */ 1181, 1182, 1183, 1184, 1185, 1187, 1098, 1100, 1150, 1131,
- /* 260 */ 1132, 1135, 1141, 1084, 1150, 1150, 1152, 1173, 1196, 1097,
- /* 270 */ 1153, 1143, 1167, 1103, 1154, 1155, 1104, 1176, 1174, 1199,
- /* 280 */ 1178, 1186, 1188, 1168, 1158, 1160, 1170, 1159, 1201, 1230,
- /* 290 */ 1156, 1243, 1244, 1157, 1164, 1247, 1172, 1189, 1192, 1240,
- /* 300 */ 1231, 1241, 1242, 1256, 1257, 1278, 1294, 1251, 1252, 1232,
- /* 310 */ 1234, 1265, 1266, 1259, 1301, 1303, 1223, 1225, 1307, 1313,
- /* 320 */ 1295, 1317, 1319, 1320, 1323, 1299, 1306, 1308, 1309, 1305,
- /* 330 */ 1311, 1315, 1314, 1321, 1312, 1324, 1326, 1327, 1263, 1271,
- /* 340 */ 1331, 1296, 1298, 1300, 1302, 1304, 1310, 1316, 1318, 1357,
- /* 350 */ 1255, 1260, 1329, 1325, 1332, 1370, 1333, 1338, 1341, 1343,
- /* 360 */ 1346, 1390, 1393, 1403, 1405, 1416, 1417, 1418, 1328, 1330,
- /* 370 */ 1335, 1409, 1394, 1399, 1401, 1402, 1410, 1391, 1396, 1411,
- /* 380 */ 1420, 1413, 1415,
+ /* 0 */ 880, -121, 269, 528, 933, -119, -187, -185, -182, -180,
+ /* 10 */ -176, -174, -62, -46, 131, -248, -133, 407, 568, 700,
+ /* 20 */ 704, 278, 706, 824, 542, 830, 948, 773, 943, 946,
+ /* 30 */ 71, 650, 211, 267, 826, 272, 676, 732, 885, 976,
+ /* 40 */ 984, 992, -256, -256, -256, -256, -256, -256, -256, -256,
+ /* 50 */ -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
+ /* 60 */ -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
+ /* 70 */ -256, -256, -256, -256, -256, -256, -256, 989, 1065, 1070,
+ /* 80 */ 1072, 1078, 1082, 1084, 1103, 1118, 1147, 1156, 1160, 1167,
+ /* 90 */ 1185, 1191, 1220, 1237, 1254, 1256, 1266, 1272, 1281, 1291,
+ /* 100 */ 1293, 1296, 1299, 1301, 1307, 1337, 1340, 1342, 1347, 1366,
+ /* 110 */ 1368, 1371, 1373, 1377, 1385, 1387, 1398, 1401, 1404, 1406,
+ /* 120 */ 1411, 1413, 1415, 1430, -256, -256, -256, -256, -256, -256,
+ /* 130 */ -256, -256, -256, -172, 508, -213, 57, -163, -25, 593,
+ /* 140 */ 69, 486, 69, 486, -200, 573, 722, -256, -256, -256,
+ /* 150 */ -256, -141, -141, -141, -105, -161, -167, 157, 212, 405,
+ /* 160 */ 530, 220, 233, 735, 735, 115, 318, 406, 612, 541,
+ /* 170 */ -166, 441, 688, 794, 629, 368, 741, 775, 867, 797,
+ /* 180 */ 871, 842, -186, 1000, 858, 949, 379, 783, 70, 296,
+ /* 190 */ 821, 903, 924, 1044, 651, 282, 1014, 1060, 937, -195,
+ /* 200 */ -177, 413, 439, 511, 566, 787, 827, 848, 898, 945,
+ /* 210 */ 1062, 1074, 1102, 1110, 1202, 1204, 1209, 1211, 1215, 529,
+ /* 220 */ 1221, 1224, 1240, 1246, 1255, 1257, 1269, 1270, 1273, 1274,
+ /* 230 */ 1275, 1280, 1205, 1251, 1294, 1310, 1317, 1326, 1327, 1124,
+ /* 240 */ 1331, 1338, 1339, 1290, 1181, 1346, 1351, 1265, 1352, 787,
+ /* 250 */ 1353, 1367, 1378, 1386, 1392, 1397, 1241, 1312, 1356, 1345,
+ /* 260 */ 1357, 1358, 1359, 1124, 1356, 1356, 1364, 1396, 1433, 1341,
+ /* 270 */ 1381, 1376, 1379, 1354, 1391, 1405, 1362, 1429, 1423, 1431,
+ /* 280 */ 1434, 1435, 1437, 1399, 1410, 1412, 1382, 1417, 1420, 1466,
+ /* 290 */ 1372, 1467, 1468, 1380, 1384, 1475, 1394, 1414, 1416, 1448,
+ /* 300 */ 1440, 1451, 1452, 1453, 1454, 1490, 1493, 1449, 1455, 1427,
+ /* 310 */ 1436, 1464, 1465, 1456, 1498, 1502, 1419, 1421, 1507, 1509,
+ /* 320 */ 1491, 1510, 1513, 1514, 1516, 1496, 1500, 1501, 1503, 1499,
+ /* 330 */ 1505, 1504, 1508, 1506, 1511, 1512, 1515, 1424, 1517, 1457,
+ /* 340 */ 1460, 1519, 1474, 1482, 1483, 1485, 1486, 1488, 1489, 1492,
+ /* 350 */ 1541, 1438, 1441, 1494, 1495, 1518, 1520, 1487, 1555, 1481,
+ /* 360 */ 1522, 1523, 1526, 1528, 1561, 1566, 1580, 1581, 1586, 1587,
+ /* 370 */ 1588, 1478, 1484, 1525, 1575, 1570, 1572, 1573, 1574, 1582,
+ /* 380 */ 1568, 1569, 1578, 1579, 1583, 1590,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1537, 1537, 1537, 1377, 1159, 1266, 1159, 1159, 1159, 1377,
- /* 10 */ 1377, 1377, 1159, 1296, 1296, 1430, 1190, 1159, 1159, 1159,
- /* 20 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1376, 1159, 1159,
- /* 30 */ 1159, 1159, 1460, 1460, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 40 */ 1159, 1159, 1159, 1302, 1159, 1159, 1159, 1159, 1159, 1378,
- /* 50 */ 1379, 1159, 1159, 1159, 1429, 1431, 1394, 1312, 1311, 1310,
- /* 60 */ 1309, 1412, 1283, 1307, 1300, 1304, 1372, 1373, 1371, 1375,
- /* 70 */ 1379, 1378, 1159, 1303, 1343, 1357, 1342, 1159, 1159, 1159,
- /* 80 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 90 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 100 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 110 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 120 */ 1159, 1159, 1159, 1159, 1351, 1356, 1362, 1355, 1352, 1345,
- /* 130 */ 1344, 1346, 1347, 1159, 1180, 1230, 1159, 1159, 1159, 1159,
- /* 140 */ 1448, 1447, 1159, 1159, 1190, 1348, 1349, 1359, 1358, 1437,
- /* 150 */ 1493, 1492, 1395, 1159, 1159, 1159, 1159, 1159, 1159, 1460,
- /* 160 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 170 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 180 */ 1159, 1159, 1159, 1159, 1460, 1460, 1159, 1190, 1460, 1460,
- /* 190 */ 1186, 1337, 1336, 1186, 1290, 1159, 1443, 1266, 1257, 1159,
- /* 200 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 210 */ 1159, 1159, 1159, 1434, 1432, 1159, 1159, 1159, 1159, 1159,
- /* 220 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 230 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 240 */ 1159, 1159, 1159, 1262, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 250 */ 1159, 1159, 1159, 1159, 1159, 1487, 1159, 1407, 1244, 1262,
- /* 260 */ 1262, 1262, 1262, 1264, 1245, 1243, 1256, 1191, 1166, 1529,
- /* 270 */ 1306, 1285, 1285, 1526, 1306, 1306, 1526, 1205, 1507, 1202,
- /* 280 */ 1296, 1296, 1296, 1285, 1290, 1290, 1374, 1263, 1256, 1159,
- /* 290 */ 1529, 1271, 1271, 1528, 1528, 1271, 1395, 1315, 1321, 1233,
- /* 300 */ 1306, 1239, 1239, 1239, 1239, 1271, 1177, 1306, 1306, 1315,
- /* 310 */ 1321, 1233, 1233, 1306, 1271, 1177, 1411, 1523, 1271, 1177,
- /* 320 */ 1385, 1271, 1177, 1271, 1177, 1385, 1231, 1231, 1231, 1220,
- /* 330 */ 1385, 1231, 1205, 1231, 1220, 1231, 1231, 1385, 1389, 1389,
- /* 340 */ 1385, 1289, 1284, 1289, 1284, 1289, 1284, 1289, 1284, 1271,
- /* 350 */ 1470, 1470, 1301, 1290, 1380, 1271, 1159, 1301, 1299, 1297,
- /* 360 */ 1306, 1183, 1223, 1490, 1490, 1486, 1486, 1486, 1534, 1534,
- /* 370 */ 1443, 1502, 1190, 1190, 1190, 1190, 1502, 1207, 1207, 1191,
- /* 380 */ 1191, 1190, 1502, 1159, 1159, 1159, 1159, 1159, 1159, 1497,
- /* 390 */ 1159, 1396, 1275, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 400 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 410 */ 1159, 1159, 1159, 1159, 1159, 1326, 1159, 1162, 1440, 1159,
- /* 420 */ 1159, 1438, 1159, 1159, 1159, 1159, 1159, 1159, 1276, 1159,
- /* 430 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 440 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1525, 1159, 1159,
- /* 450 */ 1159, 1159, 1159, 1159, 1410, 1409, 1159, 1159, 1273, 1159,
- /* 460 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 470 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 480 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 490 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1298, 1159, 1159,
- /* 500 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 510 */ 1159, 1159, 1475, 1291, 1159, 1159, 1516, 1159, 1159, 1159,
- /* 520 */ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
- /* 530 */ 1159, 1511, 1247, 1328, 1159, 1327, 1331, 1159, 1171, 1159,
+ /* 0 */ 1554, 1554, 1554, 1392, 1171, 1278, 1171, 1171, 1171, 1392,
+ /* 10 */ 1392, 1392, 1171, 1308, 1308, 1445, 1202, 1171, 1171, 1171,
+ /* 20 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1391, 1171, 1171,
+ /* 30 */ 1171, 1171, 1475, 1475, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 40 */ 1171, 1171, 1171, 1317, 1171, 1171, 1171, 1171, 1171, 1393,
+ /* 50 */ 1394, 1171, 1171, 1171, 1444, 1446, 1409, 1327, 1326, 1325,
+ /* 60 */ 1324, 1427, 1295, 1322, 1315, 1319, 1387, 1388, 1386, 1390,
+ /* 70 */ 1394, 1393, 1171, 1318, 1358, 1372, 1357, 1171, 1171, 1171,
+ /* 80 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 90 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 100 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 110 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 120 */ 1171, 1171, 1171, 1171, 1366, 1371, 1377, 1370, 1367, 1360,
+ /* 130 */ 1359, 1361, 1362, 1171, 1192, 1242, 1171, 1171, 1171, 1171,
+ /* 140 */ 1463, 1462, 1171, 1171, 1202, 1352, 1351, 1363, 1364, 1374,
+ /* 150 */ 1373, 1452, 1510, 1509, 1410, 1171, 1171, 1171, 1171, 1171,
+ /* 160 */ 1171, 1475, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 170 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 180 */ 1171, 1171, 1171, 1171, 1171, 1171, 1475, 1475, 1171, 1202,
+ /* 190 */ 1475, 1475, 1198, 1198, 1302, 1171, 1458, 1278, 1269, 1171,
+ /* 200 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 210 */ 1171, 1171, 1171, 1449, 1447, 1171, 1171, 1171, 1171, 1171,
+ /* 220 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 230 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 240 */ 1171, 1171, 1171, 1274, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 250 */ 1171, 1171, 1171, 1171, 1171, 1504, 1171, 1422, 1256, 1274,
+ /* 260 */ 1274, 1274, 1274, 1276, 1257, 1255, 1268, 1203, 1178, 1546,
+ /* 270 */ 1321, 1297, 1297, 1543, 1321, 1321, 1543, 1217, 1524, 1214,
+ /* 280 */ 1308, 1308, 1308, 1297, 1302, 1302, 1389, 1275, 1268, 1171,
+ /* 290 */ 1546, 1283, 1283, 1545, 1545, 1283, 1410, 1330, 1336, 1245,
+ /* 300 */ 1321, 1251, 1251, 1251, 1251, 1283, 1189, 1321, 1321, 1330,
+ /* 310 */ 1336, 1245, 1245, 1321, 1283, 1189, 1426, 1540, 1283, 1189,
+ /* 320 */ 1400, 1283, 1189, 1283, 1189, 1400, 1243, 1243, 1243, 1232,
+ /* 330 */ 1400, 1243, 1217, 1243, 1232, 1243, 1243, 1493, 1400, 1404,
+ /* 340 */ 1404, 1400, 1301, 1296, 1301, 1296, 1301, 1296, 1301, 1296,
+ /* 350 */ 1283, 1485, 1485, 1311, 1311, 1316, 1302, 1395, 1283, 1171,
+ /* 360 */ 1316, 1314, 1312, 1321, 1195, 1235, 1507, 1507, 1503, 1503,
+ /* 370 */ 1503, 1551, 1551, 1458, 1519, 1202, 1202, 1202, 1202, 1519,
+ /* 380 */ 1219, 1219, 1203, 1203, 1202, 1519, 1171, 1171, 1171, 1171,
+ /* 390 */ 1171, 1171, 1514, 1171, 1411, 1287, 1171, 1171, 1171, 1171,
+ /* 400 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 410 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1341,
+ /* 420 */ 1171, 1174, 1455, 1171, 1171, 1453, 1171, 1171, 1171, 1171,
+ /* 430 */ 1171, 1171, 1288, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 440 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 450 */ 1171, 1542, 1171, 1171, 1171, 1171, 1171, 1171, 1425, 1424,
+ /* 460 */ 1171, 1171, 1285, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 470 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 480 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 490 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 500 */ 1313, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 510 */ 1171, 1171, 1171, 1171, 1171, 1490, 1303, 1171, 1171, 1533,
+ /* 520 */ 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171,
+ /* 530 */ 1171, 1171, 1171, 1171, 1528, 1259, 1343, 1171, 1342, 1346,
+ /* 540 */ 1171, 1183, 1171,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -149754,6 +150692,9 @@ static const YYCODETYPE yyFallback[] = {
59, /* VIEW => ID */
59, /* VIRTUAL => ID */
59, /* WITH => ID */
+ 59, /* NULLS => ID */
+ 59, /* FIRST => ID */
+ 59, /* LAST => ID */
59, /* CURRENT => ID */
59, /* FOLLOWING => ID */
59, /* PARTITION => ID */
@@ -149767,6 +150708,87 @@ static const YYCODETYPE yyFallback[] = {
59, /* REINDEX => ID */
59, /* RENAME => ID */
59, /* CTIME_KW => ID */
+ 0, /* ANY => nothing */
+ 0, /* BITAND => nothing */
+ 0, /* BITOR => nothing */
+ 0, /* LSHIFT => nothing */
+ 0, /* RSHIFT => nothing */
+ 0, /* PLUS => nothing */
+ 0, /* MINUS => nothing */
+ 0, /* STAR => nothing */
+ 0, /* SLASH => nothing */
+ 0, /* REM => nothing */
+ 0, /* CONCAT => nothing */
+ 0, /* COLLATE => nothing */
+ 0, /* BITNOT => nothing */
+ 0, /* ON => nothing */
+ 0, /* INDEXED => nothing */
+ 0, /* STRING => nothing */
+ 0, /* JOIN_KW => nothing */
+ 0, /* CONSTRAINT => nothing */
+ 0, /* DEFAULT => nothing */
+ 0, /* NULL => nothing */
+ 0, /* PRIMARY => nothing */
+ 0, /* UNIQUE => nothing */
+ 0, /* CHECK => nothing */
+ 0, /* REFERENCES => nothing */
+ 0, /* AUTOINCR => nothing */
+ 0, /* INSERT => nothing */
+ 0, /* DELETE => nothing */
+ 0, /* UPDATE => nothing */
+ 0, /* SET => nothing */
+ 0, /* DEFERRABLE => nothing */
+ 0, /* FOREIGN => nothing */
+ 0, /* DROP => nothing */
+ 0, /* UNION => nothing */
+ 0, /* ALL => nothing */
+ 0, /* EXCEPT => nothing */
+ 0, /* INTERSECT => nothing */
+ 0, /* SELECT => nothing */
+ 0, /* VALUES => nothing */
+ 0, /* DISTINCT => nothing */
+ 0, /* DOT => nothing */
+ 0, /* FROM => nothing */
+ 0, /* JOIN => nothing */
+ 0, /* USING => nothing */
+ 0, /* ORDER => nothing */
+ 0, /* GROUP => nothing */
+ 0, /* HAVING => nothing */
+ 0, /* LIMIT => nothing */
+ 0, /* WHERE => nothing */
+ 0, /* INTO => nothing */
+ 0, /* NOTHING => nothing */
+ 0, /* FLOAT => nothing */
+ 0, /* BLOB => nothing */
+ 0, /* INTEGER => nothing */
+ 0, /* VARIABLE => nothing */
+ 0, /* CASE => nothing */
+ 0, /* WHEN => nothing */
+ 0, /* THEN => nothing */
+ 0, /* ELSE => nothing */
+ 0, /* INDEX => nothing */
+ 0, /* ALTER => nothing */
+ 0, /* ADD => nothing */
+ 0, /* WINDOW => nothing */
+ 0, /* OVER => nothing */
+ 0, /* FILTER => nothing */
+ 0, /* COLUMN => nothing */
+ 0, /* AGG_FUNCTION => nothing */
+ 0, /* AGG_COLUMN => nothing */
+ 0, /* TRUEFALSE => nothing */
+ 0, /* ISNOT => nothing */
+ 0, /* FUNCTION => nothing */
+ 0, /* UMINUS => nothing */
+ 0, /* UPLUS => nothing */
+ 0, /* TRUTH => nothing */
+ 0, /* REGISTER => nothing */
+ 0, /* VECTOR => nothing */
+ 0, /* SELECT_COLUMN => nothing */
+ 0, /* IF_NULL_ROW => nothing */
+ 0, /* ASTERISK => nothing */
+ 0, /* SPAN => nothing */
+ 0, /* SPACE => nothing */
+ 0, /* ILLEGAL => nothing */
};
#endif /* YYFALLBACK */
@@ -149936,226 +150958,231 @@ static const char *const yyTokenName[] = {
/* 79 */ "VIEW",
/* 80 */ "VIRTUAL",
/* 81 */ "WITH",
- /* 82 */ "CURRENT",
- /* 83 */ "FOLLOWING",
- /* 84 */ "PARTITION",
- /* 85 */ "PRECEDING",
- /* 86 */ "RANGE",
- /* 87 */ "UNBOUNDED",
- /* 88 */ "EXCLUDE",
- /* 89 */ "GROUPS",
- /* 90 */ "OTHERS",
- /* 91 */ "TIES",
- /* 92 */ "REINDEX",
- /* 93 */ "RENAME",
- /* 94 */ "CTIME_KW",
- /* 95 */ "ANY",
- /* 96 */ "BITAND",
- /* 97 */ "BITOR",
- /* 98 */ "LSHIFT",
- /* 99 */ "RSHIFT",
- /* 100 */ "PLUS",
- /* 101 */ "MINUS",
- /* 102 */ "STAR",
- /* 103 */ "SLASH",
- /* 104 */ "REM",
- /* 105 */ "CONCAT",
- /* 106 */ "COLLATE",
- /* 107 */ "BITNOT",
- /* 108 */ "ON",
- /* 109 */ "INDEXED",
- /* 110 */ "STRING",
- /* 111 */ "JOIN_KW",
- /* 112 */ "CONSTRAINT",
- /* 113 */ "DEFAULT",
- /* 114 */ "NULL",
- /* 115 */ "PRIMARY",
- /* 116 */ "UNIQUE",
- /* 117 */ "CHECK",
- /* 118 */ "REFERENCES",
- /* 119 */ "AUTOINCR",
- /* 120 */ "INSERT",
- /* 121 */ "DELETE",
- /* 122 */ "UPDATE",
- /* 123 */ "SET",
- /* 124 */ "DEFERRABLE",
- /* 125 */ "FOREIGN",
- /* 126 */ "DROP",
- /* 127 */ "UNION",
- /* 128 */ "ALL",
- /* 129 */ "EXCEPT",
- /* 130 */ "INTERSECT",
- /* 131 */ "SELECT",
- /* 132 */ "VALUES",
- /* 133 */ "DISTINCT",
- /* 134 */ "DOT",
- /* 135 */ "FROM",
- /* 136 */ "JOIN",
- /* 137 */ "USING",
- /* 138 */ "ORDER",
- /* 139 */ "GROUP",
- /* 140 */ "HAVING",
- /* 141 */ "LIMIT",
- /* 142 */ "WHERE",
- /* 143 */ "INTO",
- /* 144 */ "NOTHING",
- /* 145 */ "FLOAT",
- /* 146 */ "BLOB",
- /* 147 */ "INTEGER",
- /* 148 */ "VARIABLE",
- /* 149 */ "CASE",
- /* 150 */ "WHEN",
- /* 151 */ "THEN",
- /* 152 */ "ELSE",
- /* 153 */ "INDEX",
- /* 154 */ "ALTER",
- /* 155 */ "ADD",
- /* 156 */ "WINDOW",
- /* 157 */ "OVER",
- /* 158 */ "FILTER",
- /* 159 */ "TRUEFALSE",
- /* 160 */ "ISNOT",
- /* 161 */ "FUNCTION",
+ /* 82 */ "NULLS",
+ /* 83 */ "FIRST",
+ /* 84 */ "LAST",
+ /* 85 */ "CURRENT",
+ /* 86 */ "FOLLOWING",
+ /* 87 */ "PARTITION",
+ /* 88 */ "PRECEDING",
+ /* 89 */ "RANGE",
+ /* 90 */ "UNBOUNDED",
+ /* 91 */ "EXCLUDE",
+ /* 92 */ "GROUPS",
+ /* 93 */ "OTHERS",
+ /* 94 */ "TIES",
+ /* 95 */ "REINDEX",
+ /* 96 */ "RENAME",
+ /* 97 */ "CTIME_KW",
+ /* 98 */ "ANY",
+ /* 99 */ "BITAND",
+ /* 100 */ "BITOR",
+ /* 101 */ "LSHIFT",
+ /* 102 */ "RSHIFT",
+ /* 103 */ "PLUS",
+ /* 104 */ "MINUS",
+ /* 105 */ "STAR",
+ /* 106 */ "SLASH",
+ /* 107 */ "REM",
+ /* 108 */ "CONCAT",
+ /* 109 */ "COLLATE",
+ /* 110 */ "BITNOT",
+ /* 111 */ "ON",
+ /* 112 */ "INDEXED",
+ /* 113 */ "STRING",
+ /* 114 */ "JOIN_KW",
+ /* 115 */ "CONSTRAINT",
+ /* 116 */ "DEFAULT",
+ /* 117 */ "NULL",
+ /* 118 */ "PRIMARY",
+ /* 119 */ "UNIQUE",
+ /* 120 */ "CHECK",
+ /* 121 */ "REFERENCES",
+ /* 122 */ "AUTOINCR",
+ /* 123 */ "INSERT",
+ /* 124 */ "DELETE",
+ /* 125 */ "UPDATE",
+ /* 126 */ "SET",
+ /* 127 */ "DEFERRABLE",
+ /* 128 */ "FOREIGN",
+ /* 129 */ "DROP",
+ /* 130 */ "UNION",
+ /* 131 */ "ALL",
+ /* 132 */ "EXCEPT",
+ /* 133 */ "INTERSECT",
+ /* 134 */ "SELECT",
+ /* 135 */ "VALUES",
+ /* 136 */ "DISTINCT",
+ /* 137 */ "DOT",
+ /* 138 */ "FROM",
+ /* 139 */ "JOIN",
+ /* 140 */ "USING",
+ /* 141 */ "ORDER",
+ /* 142 */ "GROUP",
+ /* 143 */ "HAVING",
+ /* 144 */ "LIMIT",
+ /* 145 */ "WHERE",
+ /* 146 */ "INTO",
+ /* 147 */ "NOTHING",
+ /* 148 */ "FLOAT",
+ /* 149 */ "BLOB",
+ /* 150 */ "INTEGER",
+ /* 151 */ "VARIABLE",
+ /* 152 */ "CASE",
+ /* 153 */ "WHEN",
+ /* 154 */ "THEN",
+ /* 155 */ "ELSE",
+ /* 156 */ "INDEX",
+ /* 157 */ "ALTER",
+ /* 158 */ "ADD",
+ /* 159 */ "WINDOW",
+ /* 160 */ "OVER",
+ /* 161 */ "FILTER",
/* 162 */ "COLUMN",
/* 163 */ "AGG_FUNCTION",
/* 164 */ "AGG_COLUMN",
- /* 165 */ "UMINUS",
- /* 166 */ "UPLUS",
- /* 167 */ "TRUTH",
- /* 168 */ "REGISTER",
- /* 169 */ "VECTOR",
- /* 170 */ "SELECT_COLUMN",
- /* 171 */ "IF_NULL_ROW",
- /* 172 */ "ASTERISK",
- /* 173 */ "SPAN",
- /* 174 */ "SPACE",
- /* 175 */ "ILLEGAL",
- /* 176 */ "input",
- /* 177 */ "cmdlist",
- /* 178 */ "ecmd",
- /* 179 */ "cmdx",
- /* 180 */ "explain",
- /* 181 */ "cmd",
- /* 182 */ "transtype",
- /* 183 */ "trans_opt",
- /* 184 */ "nm",
- /* 185 */ "savepoint_opt",
- /* 186 */ "create_table",
- /* 187 */ "create_table_args",
- /* 188 */ "createkw",
- /* 189 */ "temp",
- /* 190 */ "ifnotexists",
- /* 191 */ "dbnm",
- /* 192 */ "columnlist",
- /* 193 */ "conslist_opt",
- /* 194 */ "table_options",
- /* 195 */ "select",
- /* 196 */ "columnname",
- /* 197 */ "carglist",
- /* 198 */ "typetoken",
- /* 199 */ "typename",
- /* 200 */ "signed",
- /* 201 */ "plus_num",
- /* 202 */ "minus_num",
- /* 203 */ "scanpt",
- /* 204 */ "scantok",
- /* 205 */ "ccons",
- /* 206 */ "term",
- /* 207 */ "expr",
- /* 208 */ "onconf",
- /* 209 */ "sortorder",
- /* 210 */ "autoinc",
- /* 211 */ "eidlist_opt",
- /* 212 */ "refargs",
- /* 213 */ "defer_subclause",
- /* 214 */ "refarg",
- /* 215 */ "refact",
- /* 216 */ "init_deferred_pred_opt",
- /* 217 */ "conslist",
- /* 218 */ "tconscomma",
- /* 219 */ "tcons",
- /* 220 */ "sortlist",
- /* 221 */ "eidlist",
- /* 222 */ "defer_subclause_opt",
- /* 223 */ "orconf",
- /* 224 */ "resolvetype",
- /* 225 */ "raisetype",
- /* 226 */ "ifexists",
- /* 227 */ "fullname",
- /* 228 */ "selectnowith",
- /* 229 */ "oneselect",
- /* 230 */ "wqlist",
- /* 231 */ "multiselect_op",
- /* 232 */ "distinct",
- /* 233 */ "selcollist",
- /* 234 */ "from",
- /* 235 */ "where_opt",
- /* 236 */ "groupby_opt",
- /* 237 */ "having_opt",
- /* 238 */ "orderby_opt",
- /* 239 */ "limit_opt",
- /* 240 */ "window_clause",
- /* 241 */ "values",
- /* 242 */ "nexprlist",
- /* 243 */ "sclp",
- /* 244 */ "as",
- /* 245 */ "seltablist",
- /* 246 */ "stl_prefix",
- /* 247 */ "joinop",
- /* 248 */ "indexed_opt",
- /* 249 */ "on_opt",
- /* 250 */ "using_opt",
- /* 251 */ "exprlist",
- /* 252 */ "xfullname",
- /* 253 */ "idlist",
- /* 254 */ "with",
- /* 255 */ "setlist",
- /* 256 */ "insert_cmd",
- /* 257 */ "idlist_opt",
- /* 258 */ "upsert",
- /* 259 */ "over_clause",
- /* 260 */ "likeop",
- /* 261 */ "between_op",
- /* 262 */ "in_op",
- /* 263 */ "paren_exprlist",
- /* 264 */ "case_operand",
- /* 265 */ "case_exprlist",
- /* 266 */ "case_else",
- /* 267 */ "uniqueflag",
- /* 268 */ "collate",
- /* 269 */ "vinto",
- /* 270 */ "nmnum",
- /* 271 */ "trigger_decl",
- /* 272 */ "trigger_cmd_list",
- /* 273 */ "trigger_time",
- /* 274 */ "trigger_event",
- /* 275 */ "foreach_clause",
- /* 276 */ "when_clause",
- /* 277 */ "trigger_cmd",
- /* 278 */ "trnm",
- /* 279 */ "tridxby",
- /* 280 */ "database_kw_opt",
- /* 281 */ "key_opt",
- /* 282 */ "add_column_fullname",
- /* 283 */ "kwcolumn_opt",
- /* 284 */ "create_vtab",
- /* 285 */ "vtabarglist",
- /* 286 */ "vtabarg",
- /* 287 */ "vtabargtoken",
- /* 288 */ "lp",
- /* 289 */ "anylist",
- /* 290 */ "windowdefn_list",
- /* 291 */ "windowdefn",
- /* 292 */ "window",
- /* 293 */ "frame_opt",
- /* 294 */ "part_opt",
- /* 295 */ "filter_opt",
- /* 296 */ "range_or_rows",
- /* 297 */ "frame_bound",
- /* 298 */ "frame_bound_s",
- /* 299 */ "frame_bound_e",
- /* 300 */ "frame_exclude_opt",
- /* 301 */ "frame_exclude",
+ /* 165 */ "TRUEFALSE",
+ /* 166 */ "ISNOT",
+ /* 167 */ "FUNCTION",
+ /* 168 */ "UMINUS",
+ /* 169 */ "UPLUS",
+ /* 170 */ "TRUTH",
+ /* 171 */ "REGISTER",
+ /* 172 */ "VECTOR",
+ /* 173 */ "SELECT_COLUMN",
+ /* 174 */ "IF_NULL_ROW",
+ /* 175 */ "ASTERISK",
+ /* 176 */ "SPAN",
+ /* 177 */ "SPACE",
+ /* 178 */ "ILLEGAL",
+ /* 179 */ "input",
+ /* 180 */ "cmdlist",
+ /* 181 */ "ecmd",
+ /* 182 */ "cmdx",
+ /* 183 */ "explain",
+ /* 184 */ "cmd",
+ /* 185 */ "transtype",
+ /* 186 */ "trans_opt",
+ /* 187 */ "nm",
+ /* 188 */ "savepoint_opt",
+ /* 189 */ "create_table",
+ /* 190 */ "create_table_args",
+ /* 191 */ "createkw",
+ /* 192 */ "temp",
+ /* 193 */ "ifnotexists",
+ /* 194 */ "dbnm",
+ /* 195 */ "columnlist",
+ /* 196 */ "conslist_opt",
+ /* 197 */ "table_options",
+ /* 198 */ "select",
+ /* 199 */ "columnname",
+ /* 200 */ "carglist",
+ /* 201 */ "typetoken",
+ /* 202 */ "typename",
+ /* 203 */ "signed",
+ /* 204 */ "plus_num",
+ /* 205 */ "minus_num",
+ /* 206 */ "scanpt",
+ /* 207 */ "scantok",
+ /* 208 */ "ccons",
+ /* 209 */ "term",
+ /* 210 */ "expr",
+ /* 211 */ "onconf",
+ /* 212 */ "sortorder",
+ /* 213 */ "autoinc",
+ /* 214 */ "eidlist_opt",
+ /* 215 */ "refargs",
+ /* 216 */ "defer_subclause",
+ /* 217 */ "refarg",
+ /* 218 */ "refact",
+ /* 219 */ "init_deferred_pred_opt",
+ /* 220 */ "conslist",
+ /* 221 */ "tconscomma",
+ /* 222 */ "tcons",
+ /* 223 */ "sortlist",
+ /* 224 */ "eidlist",
+ /* 225 */ "defer_subclause_opt",
+ /* 226 */ "orconf",
+ /* 227 */ "resolvetype",
+ /* 228 */ "raisetype",
+ /* 229 */ "ifexists",
+ /* 230 */ "fullname",
+ /* 231 */ "selectnowith",
+ /* 232 */ "oneselect",
+ /* 233 */ "wqlist",
+ /* 234 */ "multiselect_op",
+ /* 235 */ "distinct",
+ /* 236 */ "selcollist",
+ /* 237 */ "from",
+ /* 238 */ "where_opt",
+ /* 239 */ "groupby_opt",
+ /* 240 */ "having_opt",
+ /* 241 */ "orderby_opt",
+ /* 242 */ "limit_opt",
+ /* 243 */ "window_clause",
+ /* 244 */ "values",
+ /* 245 */ "nexprlist",
+ /* 246 */ "sclp",
+ /* 247 */ "as",
+ /* 248 */ "seltablist",
+ /* 249 */ "stl_prefix",
+ /* 250 */ "joinop",
+ /* 251 */ "indexed_opt",
+ /* 252 */ "on_opt",
+ /* 253 */ "using_opt",
+ /* 254 */ "exprlist",
+ /* 255 */ "xfullname",
+ /* 256 */ "idlist",
+ /* 257 */ "nulls",
+ /* 258 */ "with",
+ /* 259 */ "setlist",
+ /* 260 */ "insert_cmd",
+ /* 261 */ "idlist_opt",
+ /* 262 */ "upsert",
+ /* 263 */ "filter_over",
+ /* 264 */ "likeop",
+ /* 265 */ "between_op",
+ /* 266 */ "in_op",
+ /* 267 */ "paren_exprlist",
+ /* 268 */ "case_operand",
+ /* 269 */ "case_exprlist",
+ /* 270 */ "case_else",
+ /* 271 */ "uniqueflag",
+ /* 272 */ "collate",
+ /* 273 */ "vinto",
+ /* 274 */ "nmnum",
+ /* 275 */ "trigger_decl",
+ /* 276 */ "trigger_cmd_list",
+ /* 277 */ "trigger_time",
+ /* 278 */ "trigger_event",
+ /* 279 */ "foreach_clause",
+ /* 280 */ "when_clause",
+ /* 281 */ "trigger_cmd",
+ /* 282 */ "trnm",
+ /* 283 */ "tridxby",
+ /* 284 */ "database_kw_opt",
+ /* 285 */ "key_opt",
+ /* 286 */ "add_column_fullname",
+ /* 287 */ "kwcolumn_opt",
+ /* 288 */ "create_vtab",
+ /* 289 */ "vtabarglist",
+ /* 290 */ "vtabarg",
+ /* 291 */ "vtabargtoken",
+ /* 292 */ "lp",
+ /* 293 */ "anylist",
+ /* 294 */ "windowdefn_list",
+ /* 295 */ "windowdefn",
+ /* 296 */ "window",
+ /* 297 */ "frame_opt",
+ /* 298 */ "part_opt",
+ /* 299 */ "filter_clause",
+ /* 300 */ "over_clause",
+ /* 301 */ "range_or_rows",
+ /* 302 */ "frame_bound",
+ /* 303 */ "frame_bound_s",
+ /* 304 */ "frame_bound_e",
+ /* 305 */ "frame_exclude_opt",
+ /* 306 */ "frame_exclude",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -150293,252 +151320,257 @@ static const char *const yyRuleName[] = {
/* 127 */ "using_opt ::=",
/* 128 */ "orderby_opt ::=",
/* 129 */ "orderby_opt ::= ORDER BY sortlist",
- /* 130 */ "sortlist ::= sortlist COMMA expr sortorder",
- /* 131 */ "sortlist ::= expr sortorder",
+ /* 130 */ "sortlist ::= sortlist COMMA expr sortorder nulls",
+ /* 131 */ "sortlist ::= expr sortorder nulls",
/* 132 */ "sortorder ::= ASC",
/* 133 */ "sortorder ::= DESC",
/* 134 */ "sortorder ::=",
- /* 135 */ "groupby_opt ::=",
- /* 136 */ "groupby_opt ::= GROUP BY nexprlist",
- /* 137 */ "having_opt ::=",
- /* 138 */ "having_opt ::= HAVING expr",
- /* 139 */ "limit_opt ::=",
- /* 140 */ "limit_opt ::= LIMIT expr",
- /* 141 */ "limit_opt ::= LIMIT expr OFFSET expr",
- /* 142 */ "limit_opt ::= LIMIT expr COMMA expr",
- /* 143 */ "cmd ::= with DELETE FROM xfullname indexed_opt where_opt",
- /* 144 */ "where_opt ::=",
- /* 145 */ "where_opt ::= WHERE expr",
- /* 146 */ "cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt",
- /* 147 */ "setlist ::= setlist COMMA nm EQ expr",
- /* 148 */ "setlist ::= setlist COMMA LP idlist RP EQ expr",
- /* 149 */ "setlist ::= nm EQ expr",
- /* 150 */ "setlist ::= LP idlist RP EQ expr",
- /* 151 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert",
- /* 152 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES",
- /* 153 */ "upsert ::=",
- /* 154 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt",
- /* 155 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING",
- /* 156 */ "upsert ::= ON CONFLICT DO NOTHING",
- /* 157 */ "insert_cmd ::= INSERT orconf",
- /* 158 */ "insert_cmd ::= REPLACE",
- /* 159 */ "idlist_opt ::=",
- /* 160 */ "idlist_opt ::= LP idlist RP",
- /* 161 */ "idlist ::= idlist COMMA nm",
- /* 162 */ "idlist ::= nm",
- /* 163 */ "expr ::= LP expr RP",
- /* 164 */ "expr ::= ID|INDEXED",
- /* 165 */ "expr ::= JOIN_KW",
- /* 166 */ "expr ::= nm DOT nm",
- /* 167 */ "expr ::= nm DOT nm DOT nm",
- /* 168 */ "term ::= NULL|FLOAT|BLOB",
- /* 169 */ "term ::= STRING",
- /* 170 */ "term ::= INTEGER",
- /* 171 */ "expr ::= VARIABLE",
- /* 172 */ "expr ::= expr COLLATE ID|STRING",
- /* 173 */ "expr ::= CAST LP expr AS typetoken RP",
- /* 174 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
- /* 175 */ "expr ::= ID|INDEXED LP STAR RP",
- /* 176 */ "expr ::= ID|INDEXED LP distinct exprlist RP over_clause",
- /* 177 */ "expr ::= ID|INDEXED LP STAR RP over_clause",
- /* 178 */ "term ::= CTIME_KW",
- /* 179 */ "expr ::= LP nexprlist COMMA expr RP",
- /* 180 */ "expr ::= expr AND expr",
- /* 181 */ "expr ::= expr OR expr",
- /* 182 */ "expr ::= expr LT|GT|GE|LE expr",
- /* 183 */ "expr ::= expr EQ|NE expr",
- /* 184 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
- /* 185 */ "expr ::= expr PLUS|MINUS expr",
- /* 186 */ "expr ::= expr STAR|SLASH|REM expr",
- /* 187 */ "expr ::= expr CONCAT expr",
- /* 188 */ "likeop ::= NOT LIKE_KW|MATCH",
- /* 189 */ "expr ::= expr likeop expr",
- /* 190 */ "expr ::= expr likeop expr ESCAPE expr",
- /* 191 */ "expr ::= expr ISNULL|NOTNULL",
- /* 192 */ "expr ::= expr NOT NULL",
- /* 193 */ "expr ::= expr IS expr",
- /* 194 */ "expr ::= expr IS NOT expr",
- /* 195 */ "expr ::= NOT expr",
- /* 196 */ "expr ::= BITNOT expr",
- /* 197 */ "expr ::= PLUS|MINUS expr",
- /* 198 */ "between_op ::= BETWEEN",
- /* 199 */ "between_op ::= NOT BETWEEN",
- /* 200 */ "expr ::= expr between_op expr AND expr",
- /* 201 */ "in_op ::= IN",
- /* 202 */ "in_op ::= NOT IN",
- /* 203 */ "expr ::= expr in_op LP exprlist RP",
- /* 204 */ "expr ::= LP select RP",
- /* 205 */ "expr ::= expr in_op LP select RP",
- /* 206 */ "expr ::= expr in_op nm dbnm paren_exprlist",
- /* 207 */ "expr ::= EXISTS LP select RP",
- /* 208 */ "expr ::= CASE case_operand case_exprlist case_else END",
- /* 209 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
- /* 210 */ "case_exprlist ::= WHEN expr THEN expr",
- /* 211 */ "case_else ::= ELSE expr",
- /* 212 */ "case_else ::=",
- /* 213 */ "case_operand ::= expr",
- /* 214 */ "case_operand ::=",
- /* 215 */ "exprlist ::=",
- /* 216 */ "nexprlist ::= nexprlist COMMA expr",
- /* 217 */ "nexprlist ::= expr",
- /* 218 */ "paren_exprlist ::=",
- /* 219 */ "paren_exprlist ::= LP exprlist RP",
- /* 220 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
- /* 221 */ "uniqueflag ::= UNIQUE",
- /* 222 */ "uniqueflag ::=",
- /* 223 */ "eidlist_opt ::=",
- /* 224 */ "eidlist_opt ::= LP eidlist RP",
- /* 225 */ "eidlist ::= eidlist COMMA nm collate sortorder",
- /* 226 */ "eidlist ::= nm collate sortorder",
- /* 227 */ "collate ::=",
- /* 228 */ "collate ::= COLLATE ID|STRING",
- /* 229 */ "cmd ::= DROP INDEX ifexists fullname",
- /* 230 */ "cmd ::= VACUUM vinto",
- /* 231 */ "cmd ::= VACUUM nm vinto",
- /* 232 */ "vinto ::= INTO expr",
- /* 233 */ "vinto ::=",
- /* 234 */ "cmd ::= PRAGMA nm dbnm",
- /* 235 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
- /* 236 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
- /* 237 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
- /* 238 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
- /* 239 */ "plus_num ::= PLUS INTEGER|FLOAT",
- /* 240 */ "minus_num ::= MINUS INTEGER|FLOAT",
- /* 241 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
- /* 242 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
- /* 243 */ "trigger_time ::= BEFORE|AFTER",
- /* 244 */ "trigger_time ::= INSTEAD OF",
- /* 245 */ "trigger_time ::=",
- /* 246 */ "trigger_event ::= DELETE|INSERT",
- /* 247 */ "trigger_event ::= UPDATE",
- /* 248 */ "trigger_event ::= UPDATE OF idlist",
- /* 249 */ "when_clause ::=",
- /* 250 */ "when_clause ::= WHEN expr",
- /* 251 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
- /* 252 */ "trigger_cmd_list ::= trigger_cmd SEMI",
- /* 253 */ "trnm ::= nm DOT nm",
- /* 254 */ "tridxby ::= INDEXED BY nm",
- /* 255 */ "tridxby ::= NOT INDEXED",
- /* 256 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
- /* 257 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
- /* 258 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
- /* 259 */ "trigger_cmd ::= scanpt select scanpt",
- /* 260 */ "expr ::= RAISE LP IGNORE RP",
- /* 261 */ "expr ::= RAISE LP raisetype COMMA nm RP",
- /* 262 */ "raisetype ::= ROLLBACK",
- /* 263 */ "raisetype ::= ABORT",
- /* 264 */ "raisetype ::= FAIL",
- /* 265 */ "cmd ::= DROP TRIGGER ifexists fullname",
- /* 266 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
- /* 267 */ "cmd ::= DETACH database_kw_opt expr",
- /* 268 */ "key_opt ::=",
- /* 269 */ "key_opt ::= KEY expr",
- /* 270 */ "cmd ::= REINDEX",
- /* 271 */ "cmd ::= REINDEX nm dbnm",
- /* 272 */ "cmd ::= ANALYZE",
- /* 273 */ "cmd ::= ANALYZE nm dbnm",
- /* 274 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
- /* 275 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
- /* 276 */ "add_column_fullname ::= fullname",
- /* 277 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
- /* 278 */ "cmd ::= create_vtab",
- /* 279 */ "cmd ::= create_vtab LP vtabarglist RP",
- /* 280 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
- /* 281 */ "vtabarg ::=",
- /* 282 */ "vtabargtoken ::= ANY",
- /* 283 */ "vtabargtoken ::= lp anylist RP",
- /* 284 */ "lp ::= LP",
- /* 285 */ "with ::= WITH wqlist",
- /* 286 */ "with ::= WITH RECURSIVE wqlist",
- /* 287 */ "wqlist ::= nm eidlist_opt AS LP select RP",
- /* 288 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
- /* 289 */ "windowdefn_list ::= windowdefn",
- /* 290 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
- /* 291 */ "windowdefn ::= nm AS LP window RP",
- /* 292 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
- /* 293 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
- /* 294 */ "window ::= ORDER BY sortlist frame_opt",
- /* 295 */ "window ::= nm ORDER BY sortlist frame_opt",
- /* 296 */ "window ::= frame_opt",
- /* 297 */ "window ::= nm frame_opt",
- /* 298 */ "frame_opt ::=",
- /* 299 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
- /* 300 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
- /* 301 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
- /* 302 */ "frame_bound_s ::= frame_bound",
- /* 303 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
- /* 304 */ "frame_bound_e ::= frame_bound",
- /* 305 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
- /* 306 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
- /* 307 */ "frame_bound ::= CURRENT ROW",
- /* 308 */ "frame_exclude_opt ::=",
- /* 309 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
- /* 310 */ "frame_exclude ::= NO OTHERS",
- /* 311 */ "frame_exclude ::= CURRENT ROW",
- /* 312 */ "frame_exclude ::= GROUP|TIES",
- /* 313 */ "window_clause ::= WINDOW windowdefn_list",
- /* 314 */ "over_clause ::= filter_opt OVER LP window RP",
- /* 315 */ "over_clause ::= filter_opt OVER nm",
- /* 316 */ "filter_opt ::=",
- /* 317 */ "filter_opt ::= FILTER LP WHERE expr RP",
- /* 318 */ "input ::= cmdlist",
- /* 319 */ "cmdlist ::= cmdlist ecmd",
- /* 320 */ "cmdlist ::= ecmd",
- /* 321 */ "ecmd ::= SEMI",
- /* 322 */ "ecmd ::= cmdx SEMI",
- /* 323 */ "ecmd ::= explain cmdx",
- /* 324 */ "trans_opt ::=",
- /* 325 */ "trans_opt ::= TRANSACTION",
- /* 326 */ "trans_opt ::= TRANSACTION nm",
- /* 327 */ "savepoint_opt ::= SAVEPOINT",
- /* 328 */ "savepoint_opt ::=",
- /* 329 */ "cmd ::= create_table create_table_args",
- /* 330 */ "columnlist ::= columnlist COMMA columnname carglist",
- /* 331 */ "columnlist ::= columnname carglist",
- /* 332 */ "nm ::= ID|INDEXED",
- /* 333 */ "nm ::= STRING",
- /* 334 */ "nm ::= JOIN_KW",
- /* 335 */ "typetoken ::= typename",
- /* 336 */ "typename ::= ID|STRING",
- /* 337 */ "signed ::= plus_num",
- /* 338 */ "signed ::= minus_num",
- /* 339 */ "carglist ::= carglist ccons",
- /* 340 */ "carglist ::=",
- /* 341 */ "ccons ::= NULL onconf",
- /* 342 */ "conslist_opt ::= COMMA conslist",
- /* 343 */ "conslist ::= conslist tconscomma tcons",
- /* 344 */ "conslist ::= tcons",
- /* 345 */ "tconscomma ::=",
- /* 346 */ "defer_subclause_opt ::= defer_subclause",
- /* 347 */ "resolvetype ::= raisetype",
- /* 348 */ "selectnowith ::= oneselect",
- /* 349 */ "oneselect ::= values",
- /* 350 */ "sclp ::= selcollist COMMA",
- /* 351 */ "as ::= ID|STRING",
- /* 352 */ "expr ::= term",
- /* 353 */ "likeop ::= LIKE_KW|MATCH",
- /* 354 */ "exprlist ::= nexprlist",
- /* 355 */ "nmnum ::= plus_num",
- /* 356 */ "nmnum ::= nm",
- /* 357 */ "nmnum ::= ON",
- /* 358 */ "nmnum ::= DELETE",
- /* 359 */ "nmnum ::= DEFAULT",
- /* 360 */ "plus_num ::= INTEGER|FLOAT",
- /* 361 */ "foreach_clause ::=",
- /* 362 */ "foreach_clause ::= FOR EACH ROW",
- /* 363 */ "trnm ::= nm",
- /* 364 */ "tridxby ::=",
- /* 365 */ "database_kw_opt ::= DATABASE",
- /* 366 */ "database_kw_opt ::=",
- /* 367 */ "kwcolumn_opt ::=",
- /* 368 */ "kwcolumn_opt ::= COLUMNKW",
- /* 369 */ "vtabarglist ::= vtabarg",
- /* 370 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
- /* 371 */ "vtabarg ::= vtabarg vtabargtoken",
- /* 372 */ "anylist ::=",
- /* 373 */ "anylist ::= anylist LP anylist RP",
- /* 374 */ "anylist ::= anylist ANY",
- /* 375 */ "with ::=",
+ /* 135 */ "nulls ::= NULLS FIRST",
+ /* 136 */ "nulls ::= NULLS LAST",
+ /* 137 */ "nulls ::=",
+ /* 138 */ "groupby_opt ::=",
+ /* 139 */ "groupby_opt ::= GROUP BY nexprlist",
+ /* 140 */ "having_opt ::=",
+ /* 141 */ "having_opt ::= HAVING expr",
+ /* 142 */ "limit_opt ::=",
+ /* 143 */ "limit_opt ::= LIMIT expr",
+ /* 144 */ "limit_opt ::= LIMIT expr OFFSET expr",
+ /* 145 */ "limit_opt ::= LIMIT expr COMMA expr",
+ /* 146 */ "cmd ::= with DELETE FROM xfullname indexed_opt where_opt",
+ /* 147 */ "where_opt ::=",
+ /* 148 */ "where_opt ::= WHERE expr",
+ /* 149 */ "cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt",
+ /* 150 */ "setlist ::= setlist COMMA nm EQ expr",
+ /* 151 */ "setlist ::= setlist COMMA LP idlist RP EQ expr",
+ /* 152 */ "setlist ::= nm EQ expr",
+ /* 153 */ "setlist ::= LP idlist RP EQ expr",
+ /* 154 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert",
+ /* 155 */ "cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES",
+ /* 156 */ "upsert ::=",
+ /* 157 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt",
+ /* 158 */ "upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING",
+ /* 159 */ "upsert ::= ON CONFLICT DO NOTHING",
+ /* 160 */ "insert_cmd ::= INSERT orconf",
+ /* 161 */ "insert_cmd ::= REPLACE",
+ /* 162 */ "idlist_opt ::=",
+ /* 163 */ "idlist_opt ::= LP idlist RP",
+ /* 164 */ "idlist ::= idlist COMMA nm",
+ /* 165 */ "idlist ::= nm",
+ /* 166 */ "expr ::= LP expr RP",
+ /* 167 */ "expr ::= ID|INDEXED",
+ /* 168 */ "expr ::= JOIN_KW",
+ /* 169 */ "expr ::= nm DOT nm",
+ /* 170 */ "expr ::= nm DOT nm DOT nm",
+ /* 171 */ "term ::= NULL|FLOAT|BLOB",
+ /* 172 */ "term ::= STRING",
+ /* 173 */ "term ::= INTEGER",
+ /* 174 */ "expr ::= VARIABLE",
+ /* 175 */ "expr ::= expr COLLATE ID|STRING",
+ /* 176 */ "expr ::= CAST LP expr AS typetoken RP",
+ /* 177 */ "expr ::= ID|INDEXED LP distinct exprlist RP",
+ /* 178 */ "expr ::= ID|INDEXED LP STAR RP",
+ /* 179 */ "expr ::= ID|INDEXED LP distinct exprlist RP filter_over",
+ /* 180 */ "expr ::= ID|INDEXED LP STAR RP filter_over",
+ /* 181 */ "term ::= CTIME_KW",
+ /* 182 */ "expr ::= LP nexprlist COMMA expr RP",
+ /* 183 */ "expr ::= expr AND expr",
+ /* 184 */ "expr ::= expr OR expr",
+ /* 185 */ "expr ::= expr LT|GT|GE|LE expr",
+ /* 186 */ "expr ::= expr EQ|NE expr",
+ /* 187 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr",
+ /* 188 */ "expr ::= expr PLUS|MINUS expr",
+ /* 189 */ "expr ::= expr STAR|SLASH|REM expr",
+ /* 190 */ "expr ::= expr CONCAT expr",
+ /* 191 */ "likeop ::= NOT LIKE_KW|MATCH",
+ /* 192 */ "expr ::= expr likeop expr",
+ /* 193 */ "expr ::= expr likeop expr ESCAPE expr",
+ /* 194 */ "expr ::= expr ISNULL|NOTNULL",
+ /* 195 */ "expr ::= expr NOT NULL",
+ /* 196 */ "expr ::= expr IS expr",
+ /* 197 */ "expr ::= expr IS NOT expr",
+ /* 198 */ "expr ::= NOT expr",
+ /* 199 */ "expr ::= BITNOT expr",
+ /* 200 */ "expr ::= PLUS|MINUS expr",
+ /* 201 */ "between_op ::= BETWEEN",
+ /* 202 */ "between_op ::= NOT BETWEEN",
+ /* 203 */ "expr ::= expr between_op expr AND expr",
+ /* 204 */ "in_op ::= IN",
+ /* 205 */ "in_op ::= NOT IN",
+ /* 206 */ "expr ::= expr in_op LP exprlist RP",
+ /* 207 */ "expr ::= LP select RP",
+ /* 208 */ "expr ::= expr in_op LP select RP",
+ /* 209 */ "expr ::= expr in_op nm dbnm paren_exprlist",
+ /* 210 */ "expr ::= EXISTS LP select RP",
+ /* 211 */ "expr ::= CASE case_operand case_exprlist case_else END",
+ /* 212 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr",
+ /* 213 */ "case_exprlist ::= WHEN expr THEN expr",
+ /* 214 */ "case_else ::= ELSE expr",
+ /* 215 */ "case_else ::=",
+ /* 216 */ "case_operand ::= expr",
+ /* 217 */ "case_operand ::=",
+ /* 218 */ "exprlist ::=",
+ /* 219 */ "nexprlist ::= nexprlist COMMA expr",
+ /* 220 */ "nexprlist ::= expr",
+ /* 221 */ "paren_exprlist ::=",
+ /* 222 */ "paren_exprlist ::= LP exprlist RP",
+ /* 223 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt",
+ /* 224 */ "uniqueflag ::= UNIQUE",
+ /* 225 */ "uniqueflag ::=",
+ /* 226 */ "eidlist_opt ::=",
+ /* 227 */ "eidlist_opt ::= LP eidlist RP",
+ /* 228 */ "eidlist ::= eidlist COMMA nm collate sortorder",
+ /* 229 */ "eidlist ::= nm collate sortorder",
+ /* 230 */ "collate ::=",
+ /* 231 */ "collate ::= COLLATE ID|STRING",
+ /* 232 */ "cmd ::= DROP INDEX ifexists fullname",
+ /* 233 */ "cmd ::= VACUUM vinto",
+ /* 234 */ "cmd ::= VACUUM nm vinto",
+ /* 235 */ "vinto ::= INTO expr",
+ /* 236 */ "vinto ::=",
+ /* 237 */ "cmd ::= PRAGMA nm dbnm",
+ /* 238 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
+ /* 239 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
+ /* 240 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
+ /* 241 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
+ /* 242 */ "plus_num ::= PLUS INTEGER|FLOAT",
+ /* 243 */ "minus_num ::= MINUS INTEGER|FLOAT",
+ /* 244 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
+ /* 245 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
+ /* 246 */ "trigger_time ::= BEFORE|AFTER",
+ /* 247 */ "trigger_time ::= INSTEAD OF",
+ /* 248 */ "trigger_time ::=",
+ /* 249 */ "trigger_event ::= DELETE|INSERT",
+ /* 250 */ "trigger_event ::= UPDATE",
+ /* 251 */ "trigger_event ::= UPDATE OF idlist",
+ /* 252 */ "when_clause ::=",
+ /* 253 */ "when_clause ::= WHEN expr",
+ /* 254 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
+ /* 255 */ "trigger_cmd_list ::= trigger_cmd SEMI",
+ /* 256 */ "trnm ::= nm DOT nm",
+ /* 257 */ "tridxby ::= INDEXED BY nm",
+ /* 258 */ "tridxby ::= NOT INDEXED",
+ /* 259 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
+ /* 260 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
+ /* 261 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
+ /* 262 */ "trigger_cmd ::= scanpt select scanpt",
+ /* 263 */ "expr ::= RAISE LP IGNORE RP",
+ /* 264 */ "expr ::= RAISE LP raisetype COMMA nm RP",
+ /* 265 */ "raisetype ::= ROLLBACK",
+ /* 266 */ "raisetype ::= ABORT",
+ /* 267 */ "raisetype ::= FAIL",
+ /* 268 */ "cmd ::= DROP TRIGGER ifexists fullname",
+ /* 269 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
+ /* 270 */ "cmd ::= DETACH database_kw_opt expr",
+ /* 271 */ "key_opt ::=",
+ /* 272 */ "key_opt ::= KEY expr",
+ /* 273 */ "cmd ::= REINDEX",
+ /* 274 */ "cmd ::= REINDEX nm dbnm",
+ /* 275 */ "cmd ::= ANALYZE",
+ /* 276 */ "cmd ::= ANALYZE nm dbnm",
+ /* 277 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
+ /* 278 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
+ /* 279 */ "add_column_fullname ::= fullname",
+ /* 280 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
+ /* 281 */ "cmd ::= create_vtab",
+ /* 282 */ "cmd ::= create_vtab LP vtabarglist RP",
+ /* 283 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
+ /* 284 */ "vtabarg ::=",
+ /* 285 */ "vtabargtoken ::= ANY",
+ /* 286 */ "vtabargtoken ::= lp anylist RP",
+ /* 287 */ "lp ::= LP",
+ /* 288 */ "with ::= WITH wqlist",
+ /* 289 */ "with ::= WITH RECURSIVE wqlist",
+ /* 290 */ "wqlist ::= nm eidlist_opt AS LP select RP",
+ /* 291 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
+ /* 292 */ "windowdefn_list ::= windowdefn",
+ /* 293 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
+ /* 294 */ "windowdefn ::= nm AS LP window RP",
+ /* 295 */ "window ::= PARTITION BY nexprlist orderby_opt frame_opt",
+ /* 296 */ "window ::= nm PARTITION BY nexprlist orderby_opt frame_opt",
+ /* 297 */ "window ::= ORDER BY sortlist frame_opt",
+ /* 298 */ "window ::= nm ORDER BY sortlist frame_opt",
+ /* 299 */ "window ::= frame_opt",
+ /* 300 */ "window ::= nm frame_opt",
+ /* 301 */ "frame_opt ::=",
+ /* 302 */ "frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt",
+ /* 303 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt",
+ /* 304 */ "range_or_rows ::= RANGE|ROWS|GROUPS",
+ /* 305 */ "frame_bound_s ::= frame_bound",
+ /* 306 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
+ /* 307 */ "frame_bound_e ::= frame_bound",
+ /* 308 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
+ /* 309 */ "frame_bound ::= expr PRECEDING|FOLLOWING",
+ /* 310 */ "frame_bound ::= CURRENT ROW",
+ /* 311 */ "frame_exclude_opt ::=",
+ /* 312 */ "frame_exclude_opt ::= EXCLUDE frame_exclude",
+ /* 313 */ "frame_exclude ::= NO OTHERS",
+ /* 314 */ "frame_exclude ::= CURRENT ROW",
+ /* 315 */ "frame_exclude ::= GROUP|TIES",
+ /* 316 */ "window_clause ::= WINDOW windowdefn_list",
+ /* 317 */ "filter_over ::= filter_clause over_clause",
+ /* 318 */ "filter_over ::= over_clause",
+ /* 319 */ "filter_over ::= filter_clause",
+ /* 320 */ "over_clause ::= OVER LP window RP",
+ /* 321 */ "over_clause ::= OVER nm",
+ /* 322 */ "filter_clause ::= FILTER LP WHERE expr RP",
+ /* 323 */ "input ::= cmdlist",
+ /* 324 */ "cmdlist ::= cmdlist ecmd",
+ /* 325 */ "cmdlist ::= ecmd",
+ /* 326 */ "ecmd ::= SEMI",
+ /* 327 */ "ecmd ::= cmdx SEMI",
+ /* 328 */ "ecmd ::= explain cmdx",
+ /* 329 */ "trans_opt ::=",
+ /* 330 */ "trans_opt ::= TRANSACTION",
+ /* 331 */ "trans_opt ::= TRANSACTION nm",
+ /* 332 */ "savepoint_opt ::= SAVEPOINT",
+ /* 333 */ "savepoint_opt ::=",
+ /* 334 */ "cmd ::= create_table create_table_args",
+ /* 335 */ "columnlist ::= columnlist COMMA columnname carglist",
+ /* 336 */ "columnlist ::= columnname carglist",
+ /* 337 */ "nm ::= ID|INDEXED",
+ /* 338 */ "nm ::= STRING",
+ /* 339 */ "nm ::= JOIN_KW",
+ /* 340 */ "typetoken ::= typename",
+ /* 341 */ "typename ::= ID|STRING",
+ /* 342 */ "signed ::= plus_num",
+ /* 343 */ "signed ::= minus_num",
+ /* 344 */ "carglist ::= carglist ccons",
+ /* 345 */ "carglist ::=",
+ /* 346 */ "ccons ::= NULL onconf",
+ /* 347 */ "conslist_opt ::= COMMA conslist",
+ /* 348 */ "conslist ::= conslist tconscomma tcons",
+ /* 349 */ "conslist ::= tcons",
+ /* 350 */ "tconscomma ::=",
+ /* 351 */ "defer_subclause_opt ::= defer_subclause",
+ /* 352 */ "resolvetype ::= raisetype",
+ /* 353 */ "selectnowith ::= oneselect",
+ /* 354 */ "oneselect ::= values",
+ /* 355 */ "sclp ::= selcollist COMMA",
+ /* 356 */ "as ::= ID|STRING",
+ /* 357 */ "expr ::= term",
+ /* 358 */ "likeop ::= LIKE_KW|MATCH",
+ /* 359 */ "exprlist ::= nexprlist",
+ /* 360 */ "nmnum ::= plus_num",
+ /* 361 */ "nmnum ::= nm",
+ /* 362 */ "nmnum ::= ON",
+ /* 363 */ "nmnum ::= DELETE",
+ /* 364 */ "nmnum ::= DEFAULT",
+ /* 365 */ "plus_num ::= INTEGER|FLOAT",
+ /* 366 */ "foreach_clause ::=",
+ /* 367 */ "foreach_clause ::= FOR EACH ROW",
+ /* 368 */ "trnm ::= nm",
+ /* 369 */ "tridxby ::=",
+ /* 370 */ "database_kw_opt ::= DATABASE",
+ /* 371 */ "database_kw_opt ::=",
+ /* 372 */ "kwcolumn_opt ::=",
+ /* 373 */ "kwcolumn_opt ::= COLUMNKW",
+ /* 374 */ "vtabarglist ::= vtabarg",
+ /* 375 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
+ /* 376 */ "vtabarg ::= vtabarg vtabargtoken",
+ /* 377 */ "anylist ::=",
+ /* 378 */ "anylist ::= anylist LP anylist RP",
+ /* 379 */ "anylist ::= anylist ANY",
+ /* 380 */ "with ::=",
};
#endif /* NDEBUG */
@@ -150664,97 +151696,98 @@ static void yy_destructor(
** inside the C code.
*/
/********* Begin destructor definitions ***************************************/
- case 195: /* select */
- case 228: /* selectnowith */
- case 229: /* oneselect */
- case 241: /* values */
+ case 198: /* select */
+ case 231: /* selectnowith */
+ case 232: /* oneselect */
+ case 244: /* values */
{
-sqlite3SelectDelete(pParse->db, (yypminor->yy391));
+sqlite3SelectDelete(pParse->db, (yypminor->yy25));
}
break;
- case 206: /* term */
- case 207: /* expr */
- case 235: /* where_opt */
- case 237: /* having_opt */
- case 249: /* on_opt */
- case 264: /* case_operand */
- case 266: /* case_else */
- case 269: /* vinto */
- case 276: /* when_clause */
- case 281: /* key_opt */
- case 295: /* filter_opt */
+ case 209: /* term */
+ case 210: /* expr */
+ case 238: /* where_opt */
+ case 240: /* having_opt */
+ case 252: /* on_opt */
+ case 268: /* case_operand */
+ case 270: /* case_else */
+ case 273: /* vinto */
+ case 280: /* when_clause */
+ case 285: /* key_opt */
+ case 299: /* filter_clause */
{
-sqlite3ExprDelete(pParse->db, (yypminor->yy102));
+sqlite3ExprDelete(pParse->db, (yypminor->yy46));
}
break;
- case 211: /* eidlist_opt */
- case 220: /* sortlist */
- case 221: /* eidlist */
- case 233: /* selcollist */
- case 236: /* groupby_opt */
- case 238: /* orderby_opt */
- case 242: /* nexprlist */
- case 243: /* sclp */
- case 251: /* exprlist */
- case 255: /* setlist */
- case 263: /* paren_exprlist */
- case 265: /* case_exprlist */
- case 294: /* part_opt */
+ case 214: /* eidlist_opt */
+ case 223: /* sortlist */
+ case 224: /* eidlist */
+ case 236: /* selcollist */
+ case 239: /* groupby_opt */
+ case 241: /* orderby_opt */
+ case 245: /* nexprlist */
+ case 246: /* sclp */
+ case 254: /* exprlist */
+ case 259: /* setlist */
+ case 267: /* paren_exprlist */
+ case 269: /* case_exprlist */
+ case 298: /* part_opt */
{
-sqlite3ExprListDelete(pParse->db, (yypminor->yy94));
+sqlite3ExprListDelete(pParse->db, (yypminor->yy138));
}
break;
- case 227: /* fullname */
- case 234: /* from */
- case 245: /* seltablist */
- case 246: /* stl_prefix */
- case 252: /* xfullname */
+ case 230: /* fullname */
+ case 237: /* from */
+ case 248: /* seltablist */
+ case 249: /* stl_prefix */
+ case 255: /* xfullname */
{
-sqlite3SrcListDelete(pParse->db, (yypminor->yy407));
+sqlite3SrcListDelete(pParse->db, (yypminor->yy609));
}
break;
- case 230: /* wqlist */
+ case 233: /* wqlist */
{
-sqlite3WithDelete(pParse->db, (yypminor->yy243));
+sqlite3WithDelete(pParse->db, (yypminor->yy297));
}
break;
- case 240: /* window_clause */
- case 290: /* windowdefn_list */
+ case 243: /* window_clause */
+ case 294: /* windowdefn_list */
{
-sqlite3WindowListDelete(pParse->db, (yypminor->yy379));
+sqlite3WindowListDelete(pParse->db, (yypminor->yy455));
}
break;
- case 250: /* using_opt */
- case 253: /* idlist */
- case 257: /* idlist_opt */
+ case 253: /* using_opt */
+ case 256: /* idlist */
+ case 261: /* idlist_opt */
{
-sqlite3IdListDelete(pParse->db, (yypminor->yy76));
+sqlite3IdListDelete(pParse->db, (yypminor->yy406));
}
break;
- case 259: /* over_clause */
- case 291: /* windowdefn */
- case 292: /* window */
- case 293: /* frame_opt */
+ case 263: /* filter_over */
+ case 295: /* windowdefn */
+ case 296: /* window */
+ case 297: /* frame_opt */
+ case 300: /* over_clause */
{
-sqlite3WindowDelete(pParse->db, (yypminor->yy379));
+sqlite3WindowDelete(pParse->db, (yypminor->yy455));
}
break;
- case 272: /* trigger_cmd_list */
- case 277: /* trigger_cmd */
+ case 276: /* trigger_cmd_list */
+ case 281: /* trigger_cmd */
{
-sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy11));
+sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy527));
}
break;
- case 274: /* trigger_event */
+ case 278: /* trigger_event */
{
-sqlite3IdListDelete(pParse->db, (yypminor->yy298).b);
+sqlite3IdListDelete(pParse->db, (yypminor->yy572).b);
}
break;
- case 297: /* frame_bound */
- case 298: /* frame_bound_s */
- case 299: /* frame_bound_e */
+ case 302: /* frame_bound */
+ case 303: /* frame_bound_s */
+ case 304: /* frame_bound_e */
{
-sqlite3ExprDelete(pParse->db, (yypminor->yy389).pExpr);
+sqlite3ExprDelete(pParse->db, (yypminor->yy57).pExpr);
}
break;
/********* End destructor definitions *****************************************/
@@ -150880,15 +151913,18 @@ static YYACTIONTYPE yy_find_shift_action(
do{
i = yy_shift_ofst[stateno];
assert( i>=0 );
- /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
+ assert( i<=YY_ACTTAB_COUNT );
+ assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead;
- if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
+ assert( i<(int)YY_NLOOKAHEAD );
+ if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
- if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
- && (iFallback = yyFallback[iLookAhead])!=0 ){
+ assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
+ iFallback = yyFallback[iLookAhead];
+ if( iFallback!=0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
@@ -150903,16 +151939,8 @@ static YYACTIONTYPE yy_find_shift_action(
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
- if(
-#if YY_SHIFT_MIN+YYWILDCARD<0
- j>=0 &&
-#endif
-#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
- j<YY_ACTTAB_COUNT &&
-#endif
- j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) &&
- yy_lookahead[j]==YYWILDCARD && iLookAhead>0
- ){
+ assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
+ if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
@@ -150926,6 +151954,7 @@ static YYACTIONTYPE yy_find_shift_action(
#endif /* YYWILDCARD */
return yy_default[stateno];
}else{
+ assert( i>=0 && i<sizeof(yy_action)/sizeof(yy_action[0]) );
return yy_action[i];
}
}while(1);
@@ -151049,382 +152078,387 @@ static void yy_shift(
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** of that rule */
static const YYCODETYPE yyRuleInfoLhs[] = {
- 180, /* (0) explain ::= EXPLAIN */
- 180, /* (1) explain ::= EXPLAIN QUERY PLAN */
- 179, /* (2) cmdx ::= cmd */
- 181, /* (3) cmd ::= BEGIN transtype trans_opt */
- 182, /* (4) transtype ::= */
- 182, /* (5) transtype ::= DEFERRED */
- 182, /* (6) transtype ::= IMMEDIATE */
- 182, /* (7) transtype ::= EXCLUSIVE */
- 181, /* (8) cmd ::= COMMIT|END trans_opt */
- 181, /* (9) cmd ::= ROLLBACK trans_opt */
- 181, /* (10) cmd ::= SAVEPOINT nm */
- 181, /* (11) cmd ::= RELEASE savepoint_opt nm */
- 181, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
- 186, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
- 188, /* (14) createkw ::= CREATE */
- 190, /* (15) ifnotexists ::= */
- 190, /* (16) ifnotexists ::= IF NOT EXISTS */
- 189, /* (17) temp ::= TEMP */
- 189, /* (18) temp ::= */
- 187, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
- 187, /* (20) create_table_args ::= AS select */
- 194, /* (21) table_options ::= */
- 194, /* (22) table_options ::= WITHOUT nm */
- 196, /* (23) columnname ::= nm typetoken */
- 198, /* (24) typetoken ::= */
- 198, /* (25) typetoken ::= typename LP signed RP */
- 198, /* (26) typetoken ::= typename LP signed COMMA signed RP */
- 199, /* (27) typename ::= typename ID|STRING */
- 203, /* (28) scanpt ::= */
- 204, /* (29) scantok ::= */
- 205, /* (30) ccons ::= CONSTRAINT nm */
- 205, /* (31) ccons ::= DEFAULT scantok term */
- 205, /* (32) ccons ::= DEFAULT LP expr RP */
- 205, /* (33) ccons ::= DEFAULT PLUS scantok term */
- 205, /* (34) ccons ::= DEFAULT MINUS scantok term */
- 205, /* (35) ccons ::= DEFAULT scantok ID|INDEXED */
- 205, /* (36) ccons ::= NOT NULL onconf */
- 205, /* (37) ccons ::= PRIMARY KEY sortorder onconf autoinc */
- 205, /* (38) ccons ::= UNIQUE onconf */
- 205, /* (39) ccons ::= CHECK LP expr RP */
- 205, /* (40) ccons ::= REFERENCES nm eidlist_opt refargs */
- 205, /* (41) ccons ::= defer_subclause */
- 205, /* (42) ccons ::= COLLATE ID|STRING */
- 210, /* (43) autoinc ::= */
- 210, /* (44) autoinc ::= AUTOINCR */
- 212, /* (45) refargs ::= */
- 212, /* (46) refargs ::= refargs refarg */
- 214, /* (47) refarg ::= MATCH nm */
- 214, /* (48) refarg ::= ON INSERT refact */
- 214, /* (49) refarg ::= ON DELETE refact */
- 214, /* (50) refarg ::= ON UPDATE refact */
- 215, /* (51) refact ::= SET NULL */
- 215, /* (52) refact ::= SET DEFAULT */
- 215, /* (53) refact ::= CASCADE */
- 215, /* (54) refact ::= RESTRICT */
- 215, /* (55) refact ::= NO ACTION */
- 213, /* (56) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
- 213, /* (57) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
- 216, /* (58) init_deferred_pred_opt ::= */
- 216, /* (59) init_deferred_pred_opt ::= INITIALLY DEFERRED */
- 216, /* (60) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
- 193, /* (61) conslist_opt ::= */
- 218, /* (62) tconscomma ::= COMMA */
- 219, /* (63) tcons ::= CONSTRAINT nm */
- 219, /* (64) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
- 219, /* (65) tcons ::= UNIQUE LP sortlist RP onconf */
- 219, /* (66) tcons ::= CHECK LP expr RP onconf */
- 219, /* (67) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
- 222, /* (68) defer_subclause_opt ::= */
- 208, /* (69) onconf ::= */
- 208, /* (70) onconf ::= ON CONFLICT resolvetype */
- 223, /* (71) orconf ::= */
- 223, /* (72) orconf ::= OR resolvetype */
- 224, /* (73) resolvetype ::= IGNORE */
- 224, /* (74) resolvetype ::= REPLACE */
- 181, /* (75) cmd ::= DROP TABLE ifexists fullname */
- 226, /* (76) ifexists ::= IF EXISTS */
- 226, /* (77) ifexists ::= */
- 181, /* (78) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
- 181, /* (79) cmd ::= DROP VIEW ifexists fullname */
- 181, /* (80) cmd ::= select */
- 195, /* (81) select ::= WITH wqlist selectnowith */
- 195, /* (82) select ::= WITH RECURSIVE wqlist selectnowith */
- 195, /* (83) select ::= selectnowith */
- 228, /* (84) selectnowith ::= selectnowith multiselect_op oneselect */
- 231, /* (85) multiselect_op ::= UNION */
- 231, /* (86) multiselect_op ::= UNION ALL */
- 231, /* (87) multiselect_op ::= EXCEPT|INTERSECT */
- 229, /* (88) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
- 229, /* (89) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
- 241, /* (90) values ::= VALUES LP nexprlist RP */
- 241, /* (91) values ::= values COMMA LP nexprlist RP */
- 232, /* (92) distinct ::= DISTINCT */
- 232, /* (93) distinct ::= ALL */
- 232, /* (94) distinct ::= */
- 243, /* (95) sclp ::= */
- 233, /* (96) selcollist ::= sclp scanpt expr scanpt as */
- 233, /* (97) selcollist ::= sclp scanpt STAR */
- 233, /* (98) selcollist ::= sclp scanpt nm DOT STAR */
- 244, /* (99) as ::= AS nm */
- 244, /* (100) as ::= */
- 234, /* (101) from ::= */
- 234, /* (102) from ::= FROM seltablist */
- 246, /* (103) stl_prefix ::= seltablist joinop */
- 246, /* (104) stl_prefix ::= */
- 245, /* (105) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
- 245, /* (106) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
- 245, /* (107) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
- 245, /* (108) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
- 191, /* (109) dbnm ::= */
- 191, /* (110) dbnm ::= DOT nm */
- 227, /* (111) fullname ::= nm */
- 227, /* (112) fullname ::= nm DOT nm */
- 252, /* (113) xfullname ::= nm */
- 252, /* (114) xfullname ::= nm DOT nm */
- 252, /* (115) xfullname ::= nm DOT nm AS nm */
- 252, /* (116) xfullname ::= nm AS nm */
- 247, /* (117) joinop ::= COMMA|JOIN */
- 247, /* (118) joinop ::= JOIN_KW JOIN */
- 247, /* (119) joinop ::= JOIN_KW nm JOIN */
- 247, /* (120) joinop ::= JOIN_KW nm nm JOIN */
- 249, /* (121) on_opt ::= ON expr */
- 249, /* (122) on_opt ::= */
- 248, /* (123) indexed_opt ::= */
- 248, /* (124) indexed_opt ::= INDEXED BY nm */
- 248, /* (125) indexed_opt ::= NOT INDEXED */
- 250, /* (126) using_opt ::= USING LP idlist RP */
- 250, /* (127) using_opt ::= */
- 238, /* (128) orderby_opt ::= */
- 238, /* (129) orderby_opt ::= ORDER BY sortlist */
- 220, /* (130) sortlist ::= sortlist COMMA expr sortorder */
- 220, /* (131) sortlist ::= expr sortorder */
- 209, /* (132) sortorder ::= ASC */
- 209, /* (133) sortorder ::= DESC */
- 209, /* (134) sortorder ::= */
- 236, /* (135) groupby_opt ::= */
- 236, /* (136) groupby_opt ::= GROUP BY nexprlist */
- 237, /* (137) having_opt ::= */
- 237, /* (138) having_opt ::= HAVING expr */
- 239, /* (139) limit_opt ::= */
- 239, /* (140) limit_opt ::= LIMIT expr */
- 239, /* (141) limit_opt ::= LIMIT expr OFFSET expr */
- 239, /* (142) limit_opt ::= LIMIT expr COMMA expr */
- 181, /* (143) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
- 235, /* (144) where_opt ::= */
- 235, /* (145) where_opt ::= WHERE expr */
- 181, /* (146) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
- 255, /* (147) setlist ::= setlist COMMA nm EQ expr */
- 255, /* (148) setlist ::= setlist COMMA LP idlist RP EQ expr */
- 255, /* (149) setlist ::= nm EQ expr */
- 255, /* (150) setlist ::= LP idlist RP EQ expr */
- 181, /* (151) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
- 181, /* (152) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
- 258, /* (153) upsert ::= */
- 258, /* (154) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
- 258, /* (155) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
- 258, /* (156) upsert ::= ON CONFLICT DO NOTHING */
- 256, /* (157) insert_cmd ::= INSERT orconf */
- 256, /* (158) insert_cmd ::= REPLACE */
- 257, /* (159) idlist_opt ::= */
- 257, /* (160) idlist_opt ::= LP idlist RP */
- 253, /* (161) idlist ::= idlist COMMA nm */
- 253, /* (162) idlist ::= nm */
- 207, /* (163) expr ::= LP expr RP */
- 207, /* (164) expr ::= ID|INDEXED */
- 207, /* (165) expr ::= JOIN_KW */
- 207, /* (166) expr ::= nm DOT nm */
- 207, /* (167) expr ::= nm DOT nm DOT nm */
- 206, /* (168) term ::= NULL|FLOAT|BLOB */
- 206, /* (169) term ::= STRING */
- 206, /* (170) term ::= INTEGER */
- 207, /* (171) expr ::= VARIABLE */
- 207, /* (172) expr ::= expr COLLATE ID|STRING */
- 207, /* (173) expr ::= CAST LP expr AS typetoken RP */
- 207, /* (174) expr ::= ID|INDEXED LP distinct exprlist RP */
- 207, /* (175) expr ::= ID|INDEXED LP STAR RP */
- 207, /* (176) expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
- 207, /* (177) expr ::= ID|INDEXED LP STAR RP over_clause */
- 206, /* (178) term ::= CTIME_KW */
- 207, /* (179) expr ::= LP nexprlist COMMA expr RP */
- 207, /* (180) expr ::= expr AND expr */
- 207, /* (181) expr ::= expr OR expr */
- 207, /* (182) expr ::= expr LT|GT|GE|LE expr */
- 207, /* (183) expr ::= expr EQ|NE expr */
- 207, /* (184) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
- 207, /* (185) expr ::= expr PLUS|MINUS expr */
- 207, /* (186) expr ::= expr STAR|SLASH|REM expr */
- 207, /* (187) expr ::= expr CONCAT expr */
- 260, /* (188) likeop ::= NOT LIKE_KW|MATCH */
- 207, /* (189) expr ::= expr likeop expr */
- 207, /* (190) expr ::= expr likeop expr ESCAPE expr */
- 207, /* (191) expr ::= expr ISNULL|NOTNULL */
- 207, /* (192) expr ::= expr NOT NULL */
- 207, /* (193) expr ::= expr IS expr */
- 207, /* (194) expr ::= expr IS NOT expr */
- 207, /* (195) expr ::= NOT expr */
- 207, /* (196) expr ::= BITNOT expr */
- 207, /* (197) expr ::= PLUS|MINUS expr */
- 261, /* (198) between_op ::= BETWEEN */
- 261, /* (199) between_op ::= NOT BETWEEN */
- 207, /* (200) expr ::= expr between_op expr AND expr */
- 262, /* (201) in_op ::= IN */
- 262, /* (202) in_op ::= NOT IN */
- 207, /* (203) expr ::= expr in_op LP exprlist RP */
- 207, /* (204) expr ::= LP select RP */
- 207, /* (205) expr ::= expr in_op LP select RP */
- 207, /* (206) expr ::= expr in_op nm dbnm paren_exprlist */
- 207, /* (207) expr ::= EXISTS LP select RP */
- 207, /* (208) expr ::= CASE case_operand case_exprlist case_else END */
- 265, /* (209) case_exprlist ::= case_exprlist WHEN expr THEN expr */
- 265, /* (210) case_exprlist ::= WHEN expr THEN expr */
- 266, /* (211) case_else ::= ELSE expr */
- 266, /* (212) case_else ::= */
- 264, /* (213) case_operand ::= expr */
- 264, /* (214) case_operand ::= */
- 251, /* (215) exprlist ::= */
- 242, /* (216) nexprlist ::= nexprlist COMMA expr */
- 242, /* (217) nexprlist ::= expr */
- 263, /* (218) paren_exprlist ::= */
- 263, /* (219) paren_exprlist ::= LP exprlist RP */
- 181, /* (220) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
- 267, /* (221) uniqueflag ::= UNIQUE */
- 267, /* (222) uniqueflag ::= */
- 211, /* (223) eidlist_opt ::= */
- 211, /* (224) eidlist_opt ::= LP eidlist RP */
- 221, /* (225) eidlist ::= eidlist COMMA nm collate sortorder */
- 221, /* (226) eidlist ::= nm collate sortorder */
- 268, /* (227) collate ::= */
- 268, /* (228) collate ::= COLLATE ID|STRING */
- 181, /* (229) cmd ::= DROP INDEX ifexists fullname */
- 181, /* (230) cmd ::= VACUUM vinto */
- 181, /* (231) cmd ::= VACUUM nm vinto */
- 269, /* (232) vinto ::= INTO expr */
- 269, /* (233) vinto ::= */
- 181, /* (234) cmd ::= PRAGMA nm dbnm */
- 181, /* (235) cmd ::= PRAGMA nm dbnm EQ nmnum */
- 181, /* (236) cmd ::= PRAGMA nm dbnm LP nmnum RP */
- 181, /* (237) cmd ::= PRAGMA nm dbnm EQ minus_num */
- 181, /* (238) cmd ::= PRAGMA nm dbnm LP minus_num RP */
- 201, /* (239) plus_num ::= PLUS INTEGER|FLOAT */
- 202, /* (240) minus_num ::= MINUS INTEGER|FLOAT */
- 181, /* (241) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
- 271, /* (242) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
- 273, /* (243) trigger_time ::= BEFORE|AFTER */
- 273, /* (244) trigger_time ::= INSTEAD OF */
- 273, /* (245) trigger_time ::= */
- 274, /* (246) trigger_event ::= DELETE|INSERT */
- 274, /* (247) trigger_event ::= UPDATE */
- 274, /* (248) trigger_event ::= UPDATE OF idlist */
- 276, /* (249) when_clause ::= */
- 276, /* (250) when_clause ::= WHEN expr */
- 272, /* (251) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
- 272, /* (252) trigger_cmd_list ::= trigger_cmd SEMI */
- 278, /* (253) trnm ::= nm DOT nm */
- 279, /* (254) tridxby ::= INDEXED BY nm */
- 279, /* (255) tridxby ::= NOT INDEXED */
- 277, /* (256) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
- 277, /* (257) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
- 277, /* (258) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
- 277, /* (259) trigger_cmd ::= scanpt select scanpt */
- 207, /* (260) expr ::= RAISE LP IGNORE RP */
- 207, /* (261) expr ::= RAISE LP raisetype COMMA nm RP */
- 225, /* (262) raisetype ::= ROLLBACK */
- 225, /* (263) raisetype ::= ABORT */
- 225, /* (264) raisetype ::= FAIL */
- 181, /* (265) cmd ::= DROP TRIGGER ifexists fullname */
- 181, /* (266) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
- 181, /* (267) cmd ::= DETACH database_kw_opt expr */
- 281, /* (268) key_opt ::= */
- 281, /* (269) key_opt ::= KEY expr */
- 181, /* (270) cmd ::= REINDEX */
- 181, /* (271) cmd ::= REINDEX nm dbnm */
- 181, /* (272) cmd ::= ANALYZE */
- 181, /* (273) cmd ::= ANALYZE nm dbnm */
- 181, /* (274) cmd ::= ALTER TABLE fullname RENAME TO nm */
- 181, /* (275) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
- 282, /* (276) add_column_fullname ::= fullname */
- 181, /* (277) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
- 181, /* (278) cmd ::= create_vtab */
- 181, /* (279) cmd ::= create_vtab LP vtabarglist RP */
- 284, /* (280) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
- 286, /* (281) vtabarg ::= */
- 287, /* (282) vtabargtoken ::= ANY */
- 287, /* (283) vtabargtoken ::= lp anylist RP */
- 288, /* (284) lp ::= LP */
- 254, /* (285) with ::= WITH wqlist */
- 254, /* (286) with ::= WITH RECURSIVE wqlist */
- 230, /* (287) wqlist ::= nm eidlist_opt AS LP select RP */
- 230, /* (288) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
- 290, /* (289) windowdefn_list ::= windowdefn */
- 290, /* (290) windowdefn_list ::= windowdefn_list COMMA windowdefn */
- 291, /* (291) windowdefn ::= nm AS LP window RP */
- 292, /* (292) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
- 292, /* (293) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
- 292, /* (294) window ::= ORDER BY sortlist frame_opt */
- 292, /* (295) window ::= nm ORDER BY sortlist frame_opt */
- 292, /* (296) window ::= frame_opt */
- 292, /* (297) window ::= nm frame_opt */
- 293, /* (298) frame_opt ::= */
- 293, /* (299) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
- 293, /* (300) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
- 296, /* (301) range_or_rows ::= RANGE|ROWS|GROUPS */
- 298, /* (302) frame_bound_s ::= frame_bound */
- 298, /* (303) frame_bound_s ::= UNBOUNDED PRECEDING */
- 299, /* (304) frame_bound_e ::= frame_bound */
- 299, /* (305) frame_bound_e ::= UNBOUNDED FOLLOWING */
- 297, /* (306) frame_bound ::= expr PRECEDING|FOLLOWING */
- 297, /* (307) frame_bound ::= CURRENT ROW */
- 300, /* (308) frame_exclude_opt ::= */
- 300, /* (309) frame_exclude_opt ::= EXCLUDE frame_exclude */
- 301, /* (310) frame_exclude ::= NO OTHERS */
- 301, /* (311) frame_exclude ::= CURRENT ROW */
- 301, /* (312) frame_exclude ::= GROUP|TIES */
- 240, /* (313) window_clause ::= WINDOW windowdefn_list */
- 259, /* (314) over_clause ::= filter_opt OVER LP window RP */
- 259, /* (315) over_clause ::= filter_opt OVER nm */
- 295, /* (316) filter_opt ::= */
- 295, /* (317) filter_opt ::= FILTER LP WHERE expr RP */
- 176, /* (318) input ::= cmdlist */
- 177, /* (319) cmdlist ::= cmdlist ecmd */
- 177, /* (320) cmdlist ::= ecmd */
- 178, /* (321) ecmd ::= SEMI */
- 178, /* (322) ecmd ::= cmdx SEMI */
- 178, /* (323) ecmd ::= explain cmdx */
- 183, /* (324) trans_opt ::= */
- 183, /* (325) trans_opt ::= TRANSACTION */
- 183, /* (326) trans_opt ::= TRANSACTION nm */
- 185, /* (327) savepoint_opt ::= SAVEPOINT */
- 185, /* (328) savepoint_opt ::= */
- 181, /* (329) cmd ::= create_table create_table_args */
- 192, /* (330) columnlist ::= columnlist COMMA columnname carglist */
- 192, /* (331) columnlist ::= columnname carglist */
- 184, /* (332) nm ::= ID|INDEXED */
- 184, /* (333) nm ::= STRING */
- 184, /* (334) nm ::= JOIN_KW */
- 198, /* (335) typetoken ::= typename */
- 199, /* (336) typename ::= ID|STRING */
- 200, /* (337) signed ::= plus_num */
- 200, /* (338) signed ::= minus_num */
- 197, /* (339) carglist ::= carglist ccons */
- 197, /* (340) carglist ::= */
- 205, /* (341) ccons ::= NULL onconf */
- 193, /* (342) conslist_opt ::= COMMA conslist */
- 217, /* (343) conslist ::= conslist tconscomma tcons */
- 217, /* (344) conslist ::= tcons */
- 218, /* (345) tconscomma ::= */
- 222, /* (346) defer_subclause_opt ::= defer_subclause */
- 224, /* (347) resolvetype ::= raisetype */
- 228, /* (348) selectnowith ::= oneselect */
- 229, /* (349) oneselect ::= values */
- 243, /* (350) sclp ::= selcollist COMMA */
- 244, /* (351) as ::= ID|STRING */
- 207, /* (352) expr ::= term */
- 260, /* (353) likeop ::= LIKE_KW|MATCH */
- 251, /* (354) exprlist ::= nexprlist */
- 270, /* (355) nmnum ::= plus_num */
- 270, /* (356) nmnum ::= nm */
- 270, /* (357) nmnum ::= ON */
- 270, /* (358) nmnum ::= DELETE */
- 270, /* (359) nmnum ::= DEFAULT */
- 201, /* (360) plus_num ::= INTEGER|FLOAT */
- 275, /* (361) foreach_clause ::= */
- 275, /* (362) foreach_clause ::= FOR EACH ROW */
- 278, /* (363) trnm ::= nm */
- 279, /* (364) tridxby ::= */
- 280, /* (365) database_kw_opt ::= DATABASE */
- 280, /* (366) database_kw_opt ::= */
- 283, /* (367) kwcolumn_opt ::= */
- 283, /* (368) kwcolumn_opt ::= COLUMNKW */
- 285, /* (369) vtabarglist ::= vtabarg */
- 285, /* (370) vtabarglist ::= vtabarglist COMMA vtabarg */
- 286, /* (371) vtabarg ::= vtabarg vtabargtoken */
- 289, /* (372) anylist ::= */
- 289, /* (373) anylist ::= anylist LP anylist RP */
- 289, /* (374) anylist ::= anylist ANY */
- 254, /* (375) with ::= */
+ 183, /* (0) explain ::= EXPLAIN */
+ 183, /* (1) explain ::= EXPLAIN QUERY PLAN */
+ 182, /* (2) cmdx ::= cmd */
+ 184, /* (3) cmd ::= BEGIN transtype trans_opt */
+ 185, /* (4) transtype ::= */
+ 185, /* (5) transtype ::= DEFERRED */
+ 185, /* (6) transtype ::= IMMEDIATE */
+ 185, /* (7) transtype ::= EXCLUSIVE */
+ 184, /* (8) cmd ::= COMMIT|END trans_opt */
+ 184, /* (9) cmd ::= ROLLBACK trans_opt */
+ 184, /* (10) cmd ::= SAVEPOINT nm */
+ 184, /* (11) cmd ::= RELEASE savepoint_opt nm */
+ 184, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
+ 189, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
+ 191, /* (14) createkw ::= CREATE */
+ 193, /* (15) ifnotexists ::= */
+ 193, /* (16) ifnotexists ::= IF NOT EXISTS */
+ 192, /* (17) temp ::= TEMP */
+ 192, /* (18) temp ::= */
+ 190, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
+ 190, /* (20) create_table_args ::= AS select */
+ 197, /* (21) table_options ::= */
+ 197, /* (22) table_options ::= WITHOUT nm */
+ 199, /* (23) columnname ::= nm typetoken */
+ 201, /* (24) typetoken ::= */
+ 201, /* (25) typetoken ::= typename LP signed RP */
+ 201, /* (26) typetoken ::= typename LP signed COMMA signed RP */
+ 202, /* (27) typename ::= typename ID|STRING */
+ 206, /* (28) scanpt ::= */
+ 207, /* (29) scantok ::= */
+ 208, /* (30) ccons ::= CONSTRAINT nm */
+ 208, /* (31) ccons ::= DEFAULT scantok term */
+ 208, /* (32) ccons ::= DEFAULT LP expr RP */
+ 208, /* (33) ccons ::= DEFAULT PLUS scantok term */
+ 208, /* (34) ccons ::= DEFAULT MINUS scantok term */
+ 208, /* (35) ccons ::= DEFAULT scantok ID|INDEXED */
+ 208, /* (36) ccons ::= NOT NULL onconf */
+ 208, /* (37) ccons ::= PRIMARY KEY sortorder onconf autoinc */
+ 208, /* (38) ccons ::= UNIQUE onconf */
+ 208, /* (39) ccons ::= CHECK LP expr RP */
+ 208, /* (40) ccons ::= REFERENCES nm eidlist_opt refargs */
+ 208, /* (41) ccons ::= defer_subclause */
+ 208, /* (42) ccons ::= COLLATE ID|STRING */
+ 213, /* (43) autoinc ::= */
+ 213, /* (44) autoinc ::= AUTOINCR */
+ 215, /* (45) refargs ::= */
+ 215, /* (46) refargs ::= refargs refarg */
+ 217, /* (47) refarg ::= MATCH nm */
+ 217, /* (48) refarg ::= ON INSERT refact */
+ 217, /* (49) refarg ::= ON DELETE refact */
+ 217, /* (50) refarg ::= ON UPDATE refact */
+ 218, /* (51) refact ::= SET NULL */
+ 218, /* (52) refact ::= SET DEFAULT */
+ 218, /* (53) refact ::= CASCADE */
+ 218, /* (54) refact ::= RESTRICT */
+ 218, /* (55) refact ::= NO ACTION */
+ 216, /* (56) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
+ 216, /* (57) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
+ 219, /* (58) init_deferred_pred_opt ::= */
+ 219, /* (59) init_deferred_pred_opt ::= INITIALLY DEFERRED */
+ 219, /* (60) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
+ 196, /* (61) conslist_opt ::= */
+ 221, /* (62) tconscomma ::= COMMA */
+ 222, /* (63) tcons ::= CONSTRAINT nm */
+ 222, /* (64) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
+ 222, /* (65) tcons ::= UNIQUE LP sortlist RP onconf */
+ 222, /* (66) tcons ::= CHECK LP expr RP onconf */
+ 222, /* (67) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
+ 225, /* (68) defer_subclause_opt ::= */
+ 211, /* (69) onconf ::= */
+ 211, /* (70) onconf ::= ON CONFLICT resolvetype */
+ 226, /* (71) orconf ::= */
+ 226, /* (72) orconf ::= OR resolvetype */
+ 227, /* (73) resolvetype ::= IGNORE */
+ 227, /* (74) resolvetype ::= REPLACE */
+ 184, /* (75) cmd ::= DROP TABLE ifexists fullname */
+ 229, /* (76) ifexists ::= IF EXISTS */
+ 229, /* (77) ifexists ::= */
+ 184, /* (78) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
+ 184, /* (79) cmd ::= DROP VIEW ifexists fullname */
+ 184, /* (80) cmd ::= select */
+ 198, /* (81) select ::= WITH wqlist selectnowith */
+ 198, /* (82) select ::= WITH RECURSIVE wqlist selectnowith */
+ 198, /* (83) select ::= selectnowith */
+ 231, /* (84) selectnowith ::= selectnowith multiselect_op oneselect */
+ 234, /* (85) multiselect_op ::= UNION */
+ 234, /* (86) multiselect_op ::= UNION ALL */
+ 234, /* (87) multiselect_op ::= EXCEPT|INTERSECT */
+ 232, /* (88) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
+ 232, /* (89) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
+ 244, /* (90) values ::= VALUES LP nexprlist RP */
+ 244, /* (91) values ::= values COMMA LP nexprlist RP */
+ 235, /* (92) distinct ::= DISTINCT */
+ 235, /* (93) distinct ::= ALL */
+ 235, /* (94) distinct ::= */
+ 246, /* (95) sclp ::= */
+ 236, /* (96) selcollist ::= sclp scanpt expr scanpt as */
+ 236, /* (97) selcollist ::= sclp scanpt STAR */
+ 236, /* (98) selcollist ::= sclp scanpt nm DOT STAR */
+ 247, /* (99) as ::= AS nm */
+ 247, /* (100) as ::= */
+ 237, /* (101) from ::= */
+ 237, /* (102) from ::= FROM seltablist */
+ 249, /* (103) stl_prefix ::= seltablist joinop */
+ 249, /* (104) stl_prefix ::= */
+ 248, /* (105) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
+ 248, /* (106) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
+ 248, /* (107) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
+ 248, /* (108) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
+ 194, /* (109) dbnm ::= */
+ 194, /* (110) dbnm ::= DOT nm */
+ 230, /* (111) fullname ::= nm */
+ 230, /* (112) fullname ::= nm DOT nm */
+ 255, /* (113) xfullname ::= nm */
+ 255, /* (114) xfullname ::= nm DOT nm */
+ 255, /* (115) xfullname ::= nm DOT nm AS nm */
+ 255, /* (116) xfullname ::= nm AS nm */
+ 250, /* (117) joinop ::= COMMA|JOIN */
+ 250, /* (118) joinop ::= JOIN_KW JOIN */
+ 250, /* (119) joinop ::= JOIN_KW nm JOIN */
+ 250, /* (120) joinop ::= JOIN_KW nm nm JOIN */
+ 252, /* (121) on_opt ::= ON expr */
+ 252, /* (122) on_opt ::= */
+ 251, /* (123) indexed_opt ::= */
+ 251, /* (124) indexed_opt ::= INDEXED BY nm */
+ 251, /* (125) indexed_opt ::= NOT INDEXED */
+ 253, /* (126) using_opt ::= USING LP idlist RP */
+ 253, /* (127) using_opt ::= */
+ 241, /* (128) orderby_opt ::= */
+ 241, /* (129) orderby_opt ::= ORDER BY sortlist */
+ 223, /* (130) sortlist ::= sortlist COMMA expr sortorder nulls */
+ 223, /* (131) sortlist ::= expr sortorder nulls */
+ 212, /* (132) sortorder ::= ASC */
+ 212, /* (133) sortorder ::= DESC */
+ 212, /* (134) sortorder ::= */
+ 257, /* (135) nulls ::= NULLS FIRST */
+ 257, /* (136) nulls ::= NULLS LAST */
+ 257, /* (137) nulls ::= */
+ 239, /* (138) groupby_opt ::= */
+ 239, /* (139) groupby_opt ::= GROUP BY nexprlist */
+ 240, /* (140) having_opt ::= */
+ 240, /* (141) having_opt ::= HAVING expr */
+ 242, /* (142) limit_opt ::= */
+ 242, /* (143) limit_opt ::= LIMIT expr */
+ 242, /* (144) limit_opt ::= LIMIT expr OFFSET expr */
+ 242, /* (145) limit_opt ::= LIMIT expr COMMA expr */
+ 184, /* (146) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
+ 238, /* (147) where_opt ::= */
+ 238, /* (148) where_opt ::= WHERE expr */
+ 184, /* (149) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
+ 259, /* (150) setlist ::= setlist COMMA nm EQ expr */
+ 259, /* (151) setlist ::= setlist COMMA LP idlist RP EQ expr */
+ 259, /* (152) setlist ::= nm EQ expr */
+ 259, /* (153) setlist ::= LP idlist RP EQ expr */
+ 184, /* (154) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
+ 184, /* (155) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
+ 262, /* (156) upsert ::= */
+ 262, /* (157) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
+ 262, /* (158) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
+ 262, /* (159) upsert ::= ON CONFLICT DO NOTHING */
+ 260, /* (160) insert_cmd ::= INSERT orconf */
+ 260, /* (161) insert_cmd ::= REPLACE */
+ 261, /* (162) idlist_opt ::= */
+ 261, /* (163) idlist_opt ::= LP idlist RP */
+ 256, /* (164) idlist ::= idlist COMMA nm */
+ 256, /* (165) idlist ::= nm */
+ 210, /* (166) expr ::= LP expr RP */
+ 210, /* (167) expr ::= ID|INDEXED */
+ 210, /* (168) expr ::= JOIN_KW */
+ 210, /* (169) expr ::= nm DOT nm */
+ 210, /* (170) expr ::= nm DOT nm DOT nm */
+ 209, /* (171) term ::= NULL|FLOAT|BLOB */
+ 209, /* (172) term ::= STRING */
+ 209, /* (173) term ::= INTEGER */
+ 210, /* (174) expr ::= VARIABLE */
+ 210, /* (175) expr ::= expr COLLATE ID|STRING */
+ 210, /* (176) expr ::= CAST LP expr AS typetoken RP */
+ 210, /* (177) expr ::= ID|INDEXED LP distinct exprlist RP */
+ 210, /* (178) expr ::= ID|INDEXED LP STAR RP */
+ 210, /* (179) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
+ 210, /* (180) expr ::= ID|INDEXED LP STAR RP filter_over */
+ 209, /* (181) term ::= CTIME_KW */
+ 210, /* (182) expr ::= LP nexprlist COMMA expr RP */
+ 210, /* (183) expr ::= expr AND expr */
+ 210, /* (184) expr ::= expr OR expr */
+ 210, /* (185) expr ::= expr LT|GT|GE|LE expr */
+ 210, /* (186) expr ::= expr EQ|NE expr */
+ 210, /* (187) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
+ 210, /* (188) expr ::= expr PLUS|MINUS expr */
+ 210, /* (189) expr ::= expr STAR|SLASH|REM expr */
+ 210, /* (190) expr ::= expr CONCAT expr */
+ 264, /* (191) likeop ::= NOT LIKE_KW|MATCH */
+ 210, /* (192) expr ::= expr likeop expr */
+ 210, /* (193) expr ::= expr likeop expr ESCAPE expr */
+ 210, /* (194) expr ::= expr ISNULL|NOTNULL */
+ 210, /* (195) expr ::= expr NOT NULL */
+ 210, /* (196) expr ::= expr IS expr */
+ 210, /* (197) expr ::= expr IS NOT expr */
+ 210, /* (198) expr ::= NOT expr */
+ 210, /* (199) expr ::= BITNOT expr */
+ 210, /* (200) expr ::= PLUS|MINUS expr */
+ 265, /* (201) between_op ::= BETWEEN */
+ 265, /* (202) between_op ::= NOT BETWEEN */
+ 210, /* (203) expr ::= expr between_op expr AND expr */
+ 266, /* (204) in_op ::= IN */
+ 266, /* (205) in_op ::= NOT IN */
+ 210, /* (206) expr ::= expr in_op LP exprlist RP */
+ 210, /* (207) expr ::= LP select RP */
+ 210, /* (208) expr ::= expr in_op LP select RP */
+ 210, /* (209) expr ::= expr in_op nm dbnm paren_exprlist */
+ 210, /* (210) expr ::= EXISTS LP select RP */
+ 210, /* (211) expr ::= CASE case_operand case_exprlist case_else END */
+ 269, /* (212) case_exprlist ::= case_exprlist WHEN expr THEN expr */
+ 269, /* (213) case_exprlist ::= WHEN expr THEN expr */
+ 270, /* (214) case_else ::= ELSE expr */
+ 270, /* (215) case_else ::= */
+ 268, /* (216) case_operand ::= expr */
+ 268, /* (217) case_operand ::= */
+ 254, /* (218) exprlist ::= */
+ 245, /* (219) nexprlist ::= nexprlist COMMA expr */
+ 245, /* (220) nexprlist ::= expr */
+ 267, /* (221) paren_exprlist ::= */
+ 267, /* (222) paren_exprlist ::= LP exprlist RP */
+ 184, /* (223) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
+ 271, /* (224) uniqueflag ::= UNIQUE */
+ 271, /* (225) uniqueflag ::= */
+ 214, /* (226) eidlist_opt ::= */
+ 214, /* (227) eidlist_opt ::= LP eidlist RP */
+ 224, /* (228) eidlist ::= eidlist COMMA nm collate sortorder */
+ 224, /* (229) eidlist ::= nm collate sortorder */
+ 272, /* (230) collate ::= */
+ 272, /* (231) collate ::= COLLATE ID|STRING */
+ 184, /* (232) cmd ::= DROP INDEX ifexists fullname */
+ 184, /* (233) cmd ::= VACUUM vinto */
+ 184, /* (234) cmd ::= VACUUM nm vinto */
+ 273, /* (235) vinto ::= INTO expr */
+ 273, /* (236) vinto ::= */
+ 184, /* (237) cmd ::= PRAGMA nm dbnm */
+ 184, /* (238) cmd ::= PRAGMA nm dbnm EQ nmnum */
+ 184, /* (239) cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ 184, /* (240) cmd ::= PRAGMA nm dbnm EQ minus_num */
+ 184, /* (241) cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ 204, /* (242) plus_num ::= PLUS INTEGER|FLOAT */
+ 205, /* (243) minus_num ::= MINUS INTEGER|FLOAT */
+ 184, /* (244) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ 275, /* (245) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ 277, /* (246) trigger_time ::= BEFORE|AFTER */
+ 277, /* (247) trigger_time ::= INSTEAD OF */
+ 277, /* (248) trigger_time ::= */
+ 278, /* (249) trigger_event ::= DELETE|INSERT */
+ 278, /* (250) trigger_event ::= UPDATE */
+ 278, /* (251) trigger_event ::= UPDATE OF idlist */
+ 280, /* (252) when_clause ::= */
+ 280, /* (253) when_clause ::= WHEN expr */
+ 276, /* (254) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ 276, /* (255) trigger_cmd_list ::= trigger_cmd SEMI */
+ 282, /* (256) trnm ::= nm DOT nm */
+ 283, /* (257) tridxby ::= INDEXED BY nm */
+ 283, /* (258) tridxby ::= NOT INDEXED */
+ 281, /* (259) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+ 281, /* (260) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ 281, /* (261) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+ 281, /* (262) trigger_cmd ::= scanpt select scanpt */
+ 210, /* (263) expr ::= RAISE LP IGNORE RP */
+ 210, /* (264) expr ::= RAISE LP raisetype COMMA nm RP */
+ 228, /* (265) raisetype ::= ROLLBACK */
+ 228, /* (266) raisetype ::= ABORT */
+ 228, /* (267) raisetype ::= FAIL */
+ 184, /* (268) cmd ::= DROP TRIGGER ifexists fullname */
+ 184, /* (269) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ 184, /* (270) cmd ::= DETACH database_kw_opt expr */
+ 285, /* (271) key_opt ::= */
+ 285, /* (272) key_opt ::= KEY expr */
+ 184, /* (273) cmd ::= REINDEX */
+ 184, /* (274) cmd ::= REINDEX nm dbnm */
+ 184, /* (275) cmd ::= ANALYZE */
+ 184, /* (276) cmd ::= ANALYZE nm dbnm */
+ 184, /* (277) cmd ::= ALTER TABLE fullname RENAME TO nm */
+ 184, /* (278) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ 286, /* (279) add_column_fullname ::= fullname */
+ 184, /* (280) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ 184, /* (281) cmd ::= create_vtab */
+ 184, /* (282) cmd ::= create_vtab LP vtabarglist RP */
+ 288, /* (283) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ 290, /* (284) vtabarg ::= */
+ 291, /* (285) vtabargtoken ::= ANY */
+ 291, /* (286) vtabargtoken ::= lp anylist RP */
+ 292, /* (287) lp ::= LP */
+ 258, /* (288) with ::= WITH wqlist */
+ 258, /* (289) with ::= WITH RECURSIVE wqlist */
+ 233, /* (290) wqlist ::= nm eidlist_opt AS LP select RP */
+ 233, /* (291) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
+ 294, /* (292) windowdefn_list ::= windowdefn */
+ 294, /* (293) windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ 295, /* (294) windowdefn ::= nm AS LP window RP */
+ 296, /* (295) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
+ 296, /* (296) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
+ 296, /* (297) window ::= ORDER BY sortlist frame_opt */
+ 296, /* (298) window ::= nm ORDER BY sortlist frame_opt */
+ 296, /* (299) window ::= frame_opt */
+ 296, /* (300) window ::= nm frame_opt */
+ 297, /* (301) frame_opt ::= */
+ 297, /* (302) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
+ 297, /* (303) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
+ 301, /* (304) range_or_rows ::= RANGE|ROWS|GROUPS */
+ 303, /* (305) frame_bound_s ::= frame_bound */
+ 303, /* (306) frame_bound_s ::= UNBOUNDED PRECEDING */
+ 304, /* (307) frame_bound_e ::= frame_bound */
+ 304, /* (308) frame_bound_e ::= UNBOUNDED FOLLOWING */
+ 302, /* (309) frame_bound ::= expr PRECEDING|FOLLOWING */
+ 302, /* (310) frame_bound ::= CURRENT ROW */
+ 305, /* (311) frame_exclude_opt ::= */
+ 305, /* (312) frame_exclude_opt ::= EXCLUDE frame_exclude */
+ 306, /* (313) frame_exclude ::= NO OTHERS */
+ 306, /* (314) frame_exclude ::= CURRENT ROW */
+ 306, /* (315) frame_exclude ::= GROUP|TIES */
+ 243, /* (316) window_clause ::= WINDOW windowdefn_list */
+ 263, /* (317) filter_over ::= filter_clause over_clause */
+ 263, /* (318) filter_over ::= over_clause */
+ 263, /* (319) filter_over ::= filter_clause */
+ 300, /* (320) over_clause ::= OVER LP window RP */
+ 300, /* (321) over_clause ::= OVER nm */
+ 299, /* (322) filter_clause ::= FILTER LP WHERE expr RP */
+ 179, /* (323) input ::= cmdlist */
+ 180, /* (324) cmdlist ::= cmdlist ecmd */
+ 180, /* (325) cmdlist ::= ecmd */
+ 181, /* (326) ecmd ::= SEMI */
+ 181, /* (327) ecmd ::= cmdx SEMI */
+ 181, /* (328) ecmd ::= explain cmdx */
+ 186, /* (329) trans_opt ::= */
+ 186, /* (330) trans_opt ::= TRANSACTION */
+ 186, /* (331) trans_opt ::= TRANSACTION nm */
+ 188, /* (332) savepoint_opt ::= SAVEPOINT */
+ 188, /* (333) savepoint_opt ::= */
+ 184, /* (334) cmd ::= create_table create_table_args */
+ 195, /* (335) columnlist ::= columnlist COMMA columnname carglist */
+ 195, /* (336) columnlist ::= columnname carglist */
+ 187, /* (337) nm ::= ID|INDEXED */
+ 187, /* (338) nm ::= STRING */
+ 187, /* (339) nm ::= JOIN_KW */
+ 201, /* (340) typetoken ::= typename */
+ 202, /* (341) typename ::= ID|STRING */
+ 203, /* (342) signed ::= plus_num */
+ 203, /* (343) signed ::= minus_num */
+ 200, /* (344) carglist ::= carglist ccons */
+ 200, /* (345) carglist ::= */
+ 208, /* (346) ccons ::= NULL onconf */
+ 196, /* (347) conslist_opt ::= COMMA conslist */
+ 220, /* (348) conslist ::= conslist tconscomma tcons */
+ 220, /* (349) conslist ::= tcons */
+ 221, /* (350) tconscomma ::= */
+ 225, /* (351) defer_subclause_opt ::= defer_subclause */
+ 227, /* (352) resolvetype ::= raisetype */
+ 231, /* (353) selectnowith ::= oneselect */
+ 232, /* (354) oneselect ::= values */
+ 246, /* (355) sclp ::= selcollist COMMA */
+ 247, /* (356) as ::= ID|STRING */
+ 210, /* (357) expr ::= term */
+ 264, /* (358) likeop ::= LIKE_KW|MATCH */
+ 254, /* (359) exprlist ::= nexprlist */
+ 274, /* (360) nmnum ::= plus_num */
+ 274, /* (361) nmnum ::= nm */
+ 274, /* (362) nmnum ::= ON */
+ 274, /* (363) nmnum ::= DELETE */
+ 274, /* (364) nmnum ::= DEFAULT */
+ 204, /* (365) plus_num ::= INTEGER|FLOAT */
+ 279, /* (366) foreach_clause ::= */
+ 279, /* (367) foreach_clause ::= FOR EACH ROW */
+ 282, /* (368) trnm ::= nm */
+ 283, /* (369) tridxby ::= */
+ 284, /* (370) database_kw_opt ::= DATABASE */
+ 284, /* (371) database_kw_opt ::= */
+ 287, /* (372) kwcolumn_opt ::= */
+ 287, /* (373) kwcolumn_opt ::= COLUMNKW */
+ 289, /* (374) vtabarglist ::= vtabarg */
+ 289, /* (375) vtabarglist ::= vtabarglist COMMA vtabarg */
+ 290, /* (376) vtabarg ::= vtabarg vtabargtoken */
+ 293, /* (377) anylist ::= */
+ 293, /* (378) anylist ::= anylist LP anylist RP */
+ 293, /* (379) anylist ::= anylist ANY */
+ 258, /* (380) with ::= */
};
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
@@ -151560,252 +152594,257 @@ static const signed char yyRuleInfoNRhs[] = {
0, /* (127) using_opt ::= */
0, /* (128) orderby_opt ::= */
-3, /* (129) orderby_opt ::= ORDER BY sortlist */
- -4, /* (130) sortlist ::= sortlist COMMA expr sortorder */
- -2, /* (131) sortlist ::= expr sortorder */
+ -5, /* (130) sortlist ::= sortlist COMMA expr sortorder nulls */
+ -3, /* (131) sortlist ::= expr sortorder nulls */
-1, /* (132) sortorder ::= ASC */
-1, /* (133) sortorder ::= DESC */
0, /* (134) sortorder ::= */
- 0, /* (135) groupby_opt ::= */
- -3, /* (136) groupby_opt ::= GROUP BY nexprlist */
- 0, /* (137) having_opt ::= */
- -2, /* (138) having_opt ::= HAVING expr */
- 0, /* (139) limit_opt ::= */
- -2, /* (140) limit_opt ::= LIMIT expr */
- -4, /* (141) limit_opt ::= LIMIT expr OFFSET expr */
- -4, /* (142) limit_opt ::= LIMIT expr COMMA expr */
- -6, /* (143) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
- 0, /* (144) where_opt ::= */
- -2, /* (145) where_opt ::= WHERE expr */
- -8, /* (146) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
- -5, /* (147) setlist ::= setlist COMMA nm EQ expr */
- -7, /* (148) setlist ::= setlist COMMA LP idlist RP EQ expr */
- -3, /* (149) setlist ::= nm EQ expr */
- -5, /* (150) setlist ::= LP idlist RP EQ expr */
- -7, /* (151) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
- -7, /* (152) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
- 0, /* (153) upsert ::= */
- -11, /* (154) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
- -8, /* (155) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
- -4, /* (156) upsert ::= ON CONFLICT DO NOTHING */
- -2, /* (157) insert_cmd ::= INSERT orconf */
- -1, /* (158) insert_cmd ::= REPLACE */
- 0, /* (159) idlist_opt ::= */
- -3, /* (160) idlist_opt ::= LP idlist RP */
- -3, /* (161) idlist ::= idlist COMMA nm */
- -1, /* (162) idlist ::= nm */
- -3, /* (163) expr ::= LP expr RP */
- -1, /* (164) expr ::= ID|INDEXED */
- -1, /* (165) expr ::= JOIN_KW */
- -3, /* (166) expr ::= nm DOT nm */
- -5, /* (167) expr ::= nm DOT nm DOT nm */
- -1, /* (168) term ::= NULL|FLOAT|BLOB */
- -1, /* (169) term ::= STRING */
- -1, /* (170) term ::= INTEGER */
- -1, /* (171) expr ::= VARIABLE */
- -3, /* (172) expr ::= expr COLLATE ID|STRING */
- -6, /* (173) expr ::= CAST LP expr AS typetoken RP */
- -5, /* (174) expr ::= ID|INDEXED LP distinct exprlist RP */
- -4, /* (175) expr ::= ID|INDEXED LP STAR RP */
- -6, /* (176) expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
- -5, /* (177) expr ::= ID|INDEXED LP STAR RP over_clause */
- -1, /* (178) term ::= CTIME_KW */
- -5, /* (179) expr ::= LP nexprlist COMMA expr RP */
- -3, /* (180) expr ::= expr AND expr */
- -3, /* (181) expr ::= expr OR expr */
- -3, /* (182) expr ::= expr LT|GT|GE|LE expr */
- -3, /* (183) expr ::= expr EQ|NE expr */
- -3, /* (184) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
- -3, /* (185) expr ::= expr PLUS|MINUS expr */
- -3, /* (186) expr ::= expr STAR|SLASH|REM expr */
- -3, /* (187) expr ::= expr CONCAT expr */
- -2, /* (188) likeop ::= NOT LIKE_KW|MATCH */
- -3, /* (189) expr ::= expr likeop expr */
- -5, /* (190) expr ::= expr likeop expr ESCAPE expr */
- -2, /* (191) expr ::= expr ISNULL|NOTNULL */
- -3, /* (192) expr ::= expr NOT NULL */
- -3, /* (193) expr ::= expr IS expr */
- -4, /* (194) expr ::= expr IS NOT expr */
- -2, /* (195) expr ::= NOT expr */
- -2, /* (196) expr ::= BITNOT expr */
- -2, /* (197) expr ::= PLUS|MINUS expr */
- -1, /* (198) between_op ::= BETWEEN */
- -2, /* (199) between_op ::= NOT BETWEEN */
- -5, /* (200) expr ::= expr between_op expr AND expr */
- -1, /* (201) in_op ::= IN */
- -2, /* (202) in_op ::= NOT IN */
- -5, /* (203) expr ::= expr in_op LP exprlist RP */
- -3, /* (204) expr ::= LP select RP */
- -5, /* (205) expr ::= expr in_op LP select RP */
- -5, /* (206) expr ::= expr in_op nm dbnm paren_exprlist */
- -4, /* (207) expr ::= EXISTS LP select RP */
- -5, /* (208) expr ::= CASE case_operand case_exprlist case_else END */
- -5, /* (209) case_exprlist ::= case_exprlist WHEN expr THEN expr */
- -4, /* (210) case_exprlist ::= WHEN expr THEN expr */
- -2, /* (211) case_else ::= ELSE expr */
- 0, /* (212) case_else ::= */
- -1, /* (213) case_operand ::= expr */
- 0, /* (214) case_operand ::= */
- 0, /* (215) exprlist ::= */
- -3, /* (216) nexprlist ::= nexprlist COMMA expr */
- -1, /* (217) nexprlist ::= expr */
- 0, /* (218) paren_exprlist ::= */
- -3, /* (219) paren_exprlist ::= LP exprlist RP */
- -12, /* (220) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
- -1, /* (221) uniqueflag ::= UNIQUE */
- 0, /* (222) uniqueflag ::= */
- 0, /* (223) eidlist_opt ::= */
- -3, /* (224) eidlist_opt ::= LP eidlist RP */
- -5, /* (225) eidlist ::= eidlist COMMA nm collate sortorder */
- -3, /* (226) eidlist ::= nm collate sortorder */
- 0, /* (227) collate ::= */
- -2, /* (228) collate ::= COLLATE ID|STRING */
- -4, /* (229) cmd ::= DROP INDEX ifexists fullname */
- -2, /* (230) cmd ::= VACUUM vinto */
- -3, /* (231) cmd ::= VACUUM nm vinto */
- -2, /* (232) vinto ::= INTO expr */
- 0, /* (233) vinto ::= */
- -3, /* (234) cmd ::= PRAGMA nm dbnm */
- -5, /* (235) cmd ::= PRAGMA nm dbnm EQ nmnum */
- -6, /* (236) cmd ::= PRAGMA nm dbnm LP nmnum RP */
- -5, /* (237) cmd ::= PRAGMA nm dbnm EQ minus_num */
- -6, /* (238) cmd ::= PRAGMA nm dbnm LP minus_num RP */
- -2, /* (239) plus_num ::= PLUS INTEGER|FLOAT */
- -2, /* (240) minus_num ::= MINUS INTEGER|FLOAT */
- -5, /* (241) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
- -11, /* (242) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
- -1, /* (243) trigger_time ::= BEFORE|AFTER */
- -2, /* (244) trigger_time ::= INSTEAD OF */
- 0, /* (245) trigger_time ::= */
- -1, /* (246) trigger_event ::= DELETE|INSERT */
- -1, /* (247) trigger_event ::= UPDATE */
- -3, /* (248) trigger_event ::= UPDATE OF idlist */
- 0, /* (249) when_clause ::= */
- -2, /* (250) when_clause ::= WHEN expr */
- -3, /* (251) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
- -2, /* (252) trigger_cmd_list ::= trigger_cmd SEMI */
- -3, /* (253) trnm ::= nm DOT nm */
- -3, /* (254) tridxby ::= INDEXED BY nm */
- -2, /* (255) tridxby ::= NOT INDEXED */
- -8, /* (256) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
- -8, /* (257) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
- -6, /* (258) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
- -3, /* (259) trigger_cmd ::= scanpt select scanpt */
- -4, /* (260) expr ::= RAISE LP IGNORE RP */
- -6, /* (261) expr ::= RAISE LP raisetype COMMA nm RP */
- -1, /* (262) raisetype ::= ROLLBACK */
- -1, /* (263) raisetype ::= ABORT */
- -1, /* (264) raisetype ::= FAIL */
- -4, /* (265) cmd ::= DROP TRIGGER ifexists fullname */
- -6, /* (266) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
- -3, /* (267) cmd ::= DETACH database_kw_opt expr */
- 0, /* (268) key_opt ::= */
- -2, /* (269) key_opt ::= KEY expr */
- -1, /* (270) cmd ::= REINDEX */
- -3, /* (271) cmd ::= REINDEX nm dbnm */
- -1, /* (272) cmd ::= ANALYZE */
- -3, /* (273) cmd ::= ANALYZE nm dbnm */
- -6, /* (274) cmd ::= ALTER TABLE fullname RENAME TO nm */
- -7, /* (275) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
- -1, /* (276) add_column_fullname ::= fullname */
- -8, /* (277) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
- -1, /* (278) cmd ::= create_vtab */
- -4, /* (279) cmd ::= create_vtab LP vtabarglist RP */
- -8, /* (280) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
- 0, /* (281) vtabarg ::= */
- -1, /* (282) vtabargtoken ::= ANY */
- -3, /* (283) vtabargtoken ::= lp anylist RP */
- -1, /* (284) lp ::= LP */
- -2, /* (285) with ::= WITH wqlist */
- -3, /* (286) with ::= WITH RECURSIVE wqlist */
- -6, /* (287) wqlist ::= nm eidlist_opt AS LP select RP */
- -8, /* (288) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
- -1, /* (289) windowdefn_list ::= windowdefn */
- -3, /* (290) windowdefn_list ::= windowdefn_list COMMA windowdefn */
- -5, /* (291) windowdefn ::= nm AS LP window RP */
- -5, /* (292) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
- -6, /* (293) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
- -4, /* (294) window ::= ORDER BY sortlist frame_opt */
- -5, /* (295) window ::= nm ORDER BY sortlist frame_opt */
- -1, /* (296) window ::= frame_opt */
- -2, /* (297) window ::= nm frame_opt */
- 0, /* (298) frame_opt ::= */
- -3, /* (299) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
- -6, /* (300) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
- -1, /* (301) range_or_rows ::= RANGE|ROWS|GROUPS */
- -1, /* (302) frame_bound_s ::= frame_bound */
- -2, /* (303) frame_bound_s ::= UNBOUNDED PRECEDING */
- -1, /* (304) frame_bound_e ::= frame_bound */
- -2, /* (305) frame_bound_e ::= UNBOUNDED FOLLOWING */
- -2, /* (306) frame_bound ::= expr PRECEDING|FOLLOWING */
- -2, /* (307) frame_bound ::= CURRENT ROW */
- 0, /* (308) frame_exclude_opt ::= */
- -2, /* (309) frame_exclude_opt ::= EXCLUDE frame_exclude */
- -2, /* (310) frame_exclude ::= NO OTHERS */
- -2, /* (311) frame_exclude ::= CURRENT ROW */
- -1, /* (312) frame_exclude ::= GROUP|TIES */
- -2, /* (313) window_clause ::= WINDOW windowdefn_list */
- -5, /* (314) over_clause ::= filter_opt OVER LP window RP */
- -3, /* (315) over_clause ::= filter_opt OVER nm */
- 0, /* (316) filter_opt ::= */
- -5, /* (317) filter_opt ::= FILTER LP WHERE expr RP */
- -1, /* (318) input ::= cmdlist */
- -2, /* (319) cmdlist ::= cmdlist ecmd */
- -1, /* (320) cmdlist ::= ecmd */
- -1, /* (321) ecmd ::= SEMI */
- -2, /* (322) ecmd ::= cmdx SEMI */
- -2, /* (323) ecmd ::= explain cmdx */
- 0, /* (324) trans_opt ::= */
- -1, /* (325) trans_opt ::= TRANSACTION */
- -2, /* (326) trans_opt ::= TRANSACTION nm */
- -1, /* (327) savepoint_opt ::= SAVEPOINT */
- 0, /* (328) savepoint_opt ::= */
- -2, /* (329) cmd ::= create_table create_table_args */
- -4, /* (330) columnlist ::= columnlist COMMA columnname carglist */
- -2, /* (331) columnlist ::= columnname carglist */
- -1, /* (332) nm ::= ID|INDEXED */
- -1, /* (333) nm ::= STRING */
- -1, /* (334) nm ::= JOIN_KW */
- -1, /* (335) typetoken ::= typename */
- -1, /* (336) typename ::= ID|STRING */
- -1, /* (337) signed ::= plus_num */
- -1, /* (338) signed ::= minus_num */
- -2, /* (339) carglist ::= carglist ccons */
- 0, /* (340) carglist ::= */
- -2, /* (341) ccons ::= NULL onconf */
- -2, /* (342) conslist_opt ::= COMMA conslist */
- -3, /* (343) conslist ::= conslist tconscomma tcons */
- -1, /* (344) conslist ::= tcons */
- 0, /* (345) tconscomma ::= */
- -1, /* (346) defer_subclause_opt ::= defer_subclause */
- -1, /* (347) resolvetype ::= raisetype */
- -1, /* (348) selectnowith ::= oneselect */
- -1, /* (349) oneselect ::= values */
- -2, /* (350) sclp ::= selcollist COMMA */
- -1, /* (351) as ::= ID|STRING */
- -1, /* (352) expr ::= term */
- -1, /* (353) likeop ::= LIKE_KW|MATCH */
- -1, /* (354) exprlist ::= nexprlist */
- -1, /* (355) nmnum ::= plus_num */
- -1, /* (356) nmnum ::= nm */
- -1, /* (357) nmnum ::= ON */
- -1, /* (358) nmnum ::= DELETE */
- -1, /* (359) nmnum ::= DEFAULT */
- -1, /* (360) plus_num ::= INTEGER|FLOAT */
- 0, /* (361) foreach_clause ::= */
- -3, /* (362) foreach_clause ::= FOR EACH ROW */
- -1, /* (363) trnm ::= nm */
- 0, /* (364) tridxby ::= */
- -1, /* (365) database_kw_opt ::= DATABASE */
- 0, /* (366) database_kw_opt ::= */
- 0, /* (367) kwcolumn_opt ::= */
- -1, /* (368) kwcolumn_opt ::= COLUMNKW */
- -1, /* (369) vtabarglist ::= vtabarg */
- -3, /* (370) vtabarglist ::= vtabarglist COMMA vtabarg */
- -2, /* (371) vtabarg ::= vtabarg vtabargtoken */
- 0, /* (372) anylist ::= */
- -4, /* (373) anylist ::= anylist LP anylist RP */
- -2, /* (374) anylist ::= anylist ANY */
- 0, /* (375) with ::= */
+ -2, /* (135) nulls ::= NULLS FIRST */
+ -2, /* (136) nulls ::= NULLS LAST */
+ 0, /* (137) nulls ::= */
+ 0, /* (138) groupby_opt ::= */
+ -3, /* (139) groupby_opt ::= GROUP BY nexprlist */
+ 0, /* (140) having_opt ::= */
+ -2, /* (141) having_opt ::= HAVING expr */
+ 0, /* (142) limit_opt ::= */
+ -2, /* (143) limit_opt ::= LIMIT expr */
+ -4, /* (144) limit_opt ::= LIMIT expr OFFSET expr */
+ -4, /* (145) limit_opt ::= LIMIT expr COMMA expr */
+ -6, /* (146) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
+ 0, /* (147) where_opt ::= */
+ -2, /* (148) where_opt ::= WHERE expr */
+ -8, /* (149) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
+ -5, /* (150) setlist ::= setlist COMMA nm EQ expr */
+ -7, /* (151) setlist ::= setlist COMMA LP idlist RP EQ expr */
+ -3, /* (152) setlist ::= nm EQ expr */
+ -5, /* (153) setlist ::= LP idlist RP EQ expr */
+ -7, /* (154) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
+ -7, /* (155) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
+ 0, /* (156) upsert ::= */
+ -11, /* (157) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
+ -8, /* (158) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
+ -4, /* (159) upsert ::= ON CONFLICT DO NOTHING */
+ -2, /* (160) insert_cmd ::= INSERT orconf */
+ -1, /* (161) insert_cmd ::= REPLACE */
+ 0, /* (162) idlist_opt ::= */
+ -3, /* (163) idlist_opt ::= LP idlist RP */
+ -3, /* (164) idlist ::= idlist COMMA nm */
+ -1, /* (165) idlist ::= nm */
+ -3, /* (166) expr ::= LP expr RP */
+ -1, /* (167) expr ::= ID|INDEXED */
+ -1, /* (168) expr ::= JOIN_KW */
+ -3, /* (169) expr ::= nm DOT nm */
+ -5, /* (170) expr ::= nm DOT nm DOT nm */
+ -1, /* (171) term ::= NULL|FLOAT|BLOB */
+ -1, /* (172) term ::= STRING */
+ -1, /* (173) term ::= INTEGER */
+ -1, /* (174) expr ::= VARIABLE */
+ -3, /* (175) expr ::= expr COLLATE ID|STRING */
+ -6, /* (176) expr ::= CAST LP expr AS typetoken RP */
+ -5, /* (177) expr ::= ID|INDEXED LP distinct exprlist RP */
+ -4, /* (178) expr ::= ID|INDEXED LP STAR RP */
+ -6, /* (179) expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
+ -5, /* (180) expr ::= ID|INDEXED LP STAR RP filter_over */
+ -1, /* (181) term ::= CTIME_KW */
+ -5, /* (182) expr ::= LP nexprlist COMMA expr RP */
+ -3, /* (183) expr ::= expr AND expr */
+ -3, /* (184) expr ::= expr OR expr */
+ -3, /* (185) expr ::= expr LT|GT|GE|LE expr */
+ -3, /* (186) expr ::= expr EQ|NE expr */
+ -3, /* (187) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
+ -3, /* (188) expr ::= expr PLUS|MINUS expr */
+ -3, /* (189) expr ::= expr STAR|SLASH|REM expr */
+ -3, /* (190) expr ::= expr CONCAT expr */
+ -2, /* (191) likeop ::= NOT LIKE_KW|MATCH */
+ -3, /* (192) expr ::= expr likeop expr */
+ -5, /* (193) expr ::= expr likeop expr ESCAPE expr */
+ -2, /* (194) expr ::= expr ISNULL|NOTNULL */
+ -3, /* (195) expr ::= expr NOT NULL */
+ -3, /* (196) expr ::= expr IS expr */
+ -4, /* (197) expr ::= expr IS NOT expr */
+ -2, /* (198) expr ::= NOT expr */
+ -2, /* (199) expr ::= BITNOT expr */
+ -2, /* (200) expr ::= PLUS|MINUS expr */
+ -1, /* (201) between_op ::= BETWEEN */
+ -2, /* (202) between_op ::= NOT BETWEEN */
+ -5, /* (203) expr ::= expr between_op expr AND expr */
+ -1, /* (204) in_op ::= IN */
+ -2, /* (205) in_op ::= NOT IN */
+ -5, /* (206) expr ::= expr in_op LP exprlist RP */
+ -3, /* (207) expr ::= LP select RP */
+ -5, /* (208) expr ::= expr in_op LP select RP */
+ -5, /* (209) expr ::= expr in_op nm dbnm paren_exprlist */
+ -4, /* (210) expr ::= EXISTS LP select RP */
+ -5, /* (211) expr ::= CASE case_operand case_exprlist case_else END */
+ -5, /* (212) case_exprlist ::= case_exprlist WHEN expr THEN expr */
+ -4, /* (213) case_exprlist ::= WHEN expr THEN expr */
+ -2, /* (214) case_else ::= ELSE expr */
+ 0, /* (215) case_else ::= */
+ -1, /* (216) case_operand ::= expr */
+ 0, /* (217) case_operand ::= */
+ 0, /* (218) exprlist ::= */
+ -3, /* (219) nexprlist ::= nexprlist COMMA expr */
+ -1, /* (220) nexprlist ::= expr */
+ 0, /* (221) paren_exprlist ::= */
+ -3, /* (222) paren_exprlist ::= LP exprlist RP */
+ -12, /* (223) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
+ -1, /* (224) uniqueflag ::= UNIQUE */
+ 0, /* (225) uniqueflag ::= */
+ 0, /* (226) eidlist_opt ::= */
+ -3, /* (227) eidlist_opt ::= LP eidlist RP */
+ -5, /* (228) eidlist ::= eidlist COMMA nm collate sortorder */
+ -3, /* (229) eidlist ::= nm collate sortorder */
+ 0, /* (230) collate ::= */
+ -2, /* (231) collate ::= COLLATE ID|STRING */
+ -4, /* (232) cmd ::= DROP INDEX ifexists fullname */
+ -2, /* (233) cmd ::= VACUUM vinto */
+ -3, /* (234) cmd ::= VACUUM nm vinto */
+ -2, /* (235) vinto ::= INTO expr */
+ 0, /* (236) vinto ::= */
+ -3, /* (237) cmd ::= PRAGMA nm dbnm */
+ -5, /* (238) cmd ::= PRAGMA nm dbnm EQ nmnum */
+ -6, /* (239) cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ -5, /* (240) cmd ::= PRAGMA nm dbnm EQ minus_num */
+ -6, /* (241) cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ -2, /* (242) plus_num ::= PLUS INTEGER|FLOAT */
+ -2, /* (243) minus_num ::= MINUS INTEGER|FLOAT */
+ -5, /* (244) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ -11, /* (245) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ -1, /* (246) trigger_time ::= BEFORE|AFTER */
+ -2, /* (247) trigger_time ::= INSTEAD OF */
+ 0, /* (248) trigger_time ::= */
+ -1, /* (249) trigger_event ::= DELETE|INSERT */
+ -1, /* (250) trigger_event ::= UPDATE */
+ -3, /* (251) trigger_event ::= UPDATE OF idlist */
+ 0, /* (252) when_clause ::= */
+ -2, /* (253) when_clause ::= WHEN expr */
+ -3, /* (254) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ -2, /* (255) trigger_cmd_list ::= trigger_cmd SEMI */
+ -3, /* (256) trnm ::= nm DOT nm */
+ -3, /* (257) tridxby ::= INDEXED BY nm */
+ -2, /* (258) tridxby ::= NOT INDEXED */
+ -8, /* (259) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+ -8, /* (260) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ -6, /* (261) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+ -3, /* (262) trigger_cmd ::= scanpt select scanpt */
+ -4, /* (263) expr ::= RAISE LP IGNORE RP */
+ -6, /* (264) expr ::= RAISE LP raisetype COMMA nm RP */
+ -1, /* (265) raisetype ::= ROLLBACK */
+ -1, /* (266) raisetype ::= ABORT */
+ -1, /* (267) raisetype ::= FAIL */
+ -4, /* (268) cmd ::= DROP TRIGGER ifexists fullname */
+ -6, /* (269) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ -3, /* (270) cmd ::= DETACH database_kw_opt expr */
+ 0, /* (271) key_opt ::= */
+ -2, /* (272) key_opt ::= KEY expr */
+ -1, /* (273) cmd ::= REINDEX */
+ -3, /* (274) cmd ::= REINDEX nm dbnm */
+ -1, /* (275) cmd ::= ANALYZE */
+ -3, /* (276) cmd ::= ANALYZE nm dbnm */
+ -6, /* (277) cmd ::= ALTER TABLE fullname RENAME TO nm */
+ -7, /* (278) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ -1, /* (279) add_column_fullname ::= fullname */
+ -8, /* (280) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ -1, /* (281) cmd ::= create_vtab */
+ -4, /* (282) cmd ::= create_vtab LP vtabarglist RP */
+ -8, /* (283) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ 0, /* (284) vtabarg ::= */
+ -1, /* (285) vtabargtoken ::= ANY */
+ -3, /* (286) vtabargtoken ::= lp anylist RP */
+ -1, /* (287) lp ::= LP */
+ -2, /* (288) with ::= WITH wqlist */
+ -3, /* (289) with ::= WITH RECURSIVE wqlist */
+ -6, /* (290) wqlist ::= nm eidlist_opt AS LP select RP */
+ -8, /* (291) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
+ -1, /* (292) windowdefn_list ::= windowdefn */
+ -3, /* (293) windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ -5, /* (294) windowdefn ::= nm AS LP window RP */
+ -5, /* (295) window ::= PARTITION BY nexprlist orderby_opt frame_opt */
+ -6, /* (296) window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
+ -4, /* (297) window ::= ORDER BY sortlist frame_opt */
+ -5, /* (298) window ::= nm ORDER BY sortlist frame_opt */
+ -1, /* (299) window ::= frame_opt */
+ -2, /* (300) window ::= nm frame_opt */
+ 0, /* (301) frame_opt ::= */
+ -3, /* (302) frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
+ -6, /* (303) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
+ -1, /* (304) range_or_rows ::= RANGE|ROWS|GROUPS */
+ -1, /* (305) frame_bound_s ::= frame_bound */
+ -2, /* (306) frame_bound_s ::= UNBOUNDED PRECEDING */
+ -1, /* (307) frame_bound_e ::= frame_bound */
+ -2, /* (308) frame_bound_e ::= UNBOUNDED FOLLOWING */
+ -2, /* (309) frame_bound ::= expr PRECEDING|FOLLOWING */
+ -2, /* (310) frame_bound ::= CURRENT ROW */
+ 0, /* (311) frame_exclude_opt ::= */
+ -2, /* (312) frame_exclude_opt ::= EXCLUDE frame_exclude */
+ -2, /* (313) frame_exclude ::= NO OTHERS */
+ -2, /* (314) frame_exclude ::= CURRENT ROW */
+ -1, /* (315) frame_exclude ::= GROUP|TIES */
+ -2, /* (316) window_clause ::= WINDOW windowdefn_list */
+ -2, /* (317) filter_over ::= filter_clause over_clause */
+ -1, /* (318) filter_over ::= over_clause */
+ -1, /* (319) filter_over ::= filter_clause */
+ -4, /* (320) over_clause ::= OVER LP window RP */
+ -2, /* (321) over_clause ::= OVER nm */
+ -5, /* (322) filter_clause ::= FILTER LP WHERE expr RP */
+ -1, /* (323) input ::= cmdlist */
+ -2, /* (324) cmdlist ::= cmdlist ecmd */
+ -1, /* (325) cmdlist ::= ecmd */
+ -1, /* (326) ecmd ::= SEMI */
+ -2, /* (327) ecmd ::= cmdx SEMI */
+ -2, /* (328) ecmd ::= explain cmdx */
+ 0, /* (329) trans_opt ::= */
+ -1, /* (330) trans_opt ::= TRANSACTION */
+ -2, /* (331) trans_opt ::= TRANSACTION nm */
+ -1, /* (332) savepoint_opt ::= SAVEPOINT */
+ 0, /* (333) savepoint_opt ::= */
+ -2, /* (334) cmd ::= create_table create_table_args */
+ -4, /* (335) columnlist ::= columnlist COMMA columnname carglist */
+ -2, /* (336) columnlist ::= columnname carglist */
+ -1, /* (337) nm ::= ID|INDEXED */
+ -1, /* (338) nm ::= STRING */
+ -1, /* (339) nm ::= JOIN_KW */
+ -1, /* (340) typetoken ::= typename */
+ -1, /* (341) typename ::= ID|STRING */
+ -1, /* (342) signed ::= plus_num */
+ -1, /* (343) signed ::= minus_num */
+ -2, /* (344) carglist ::= carglist ccons */
+ 0, /* (345) carglist ::= */
+ -2, /* (346) ccons ::= NULL onconf */
+ -2, /* (347) conslist_opt ::= COMMA conslist */
+ -3, /* (348) conslist ::= conslist tconscomma tcons */
+ -1, /* (349) conslist ::= tcons */
+ 0, /* (350) tconscomma ::= */
+ -1, /* (351) defer_subclause_opt ::= defer_subclause */
+ -1, /* (352) resolvetype ::= raisetype */
+ -1, /* (353) selectnowith ::= oneselect */
+ -1, /* (354) oneselect ::= values */
+ -2, /* (355) sclp ::= selcollist COMMA */
+ -1, /* (356) as ::= ID|STRING */
+ -1, /* (357) expr ::= term */
+ -1, /* (358) likeop ::= LIKE_KW|MATCH */
+ -1, /* (359) exprlist ::= nexprlist */
+ -1, /* (360) nmnum ::= plus_num */
+ -1, /* (361) nmnum ::= nm */
+ -1, /* (362) nmnum ::= ON */
+ -1, /* (363) nmnum ::= DELETE */
+ -1, /* (364) nmnum ::= DEFAULT */
+ -1, /* (365) plus_num ::= INTEGER|FLOAT */
+ 0, /* (366) foreach_clause ::= */
+ -3, /* (367) foreach_clause ::= FOR EACH ROW */
+ -1, /* (368) trnm ::= nm */
+ 0, /* (369) tridxby ::= */
+ -1, /* (370) database_kw_opt ::= DATABASE */
+ 0, /* (371) database_kw_opt ::= */
+ 0, /* (372) kwcolumn_opt ::= */
+ -1, /* (373) kwcolumn_opt ::= COLUMNKW */
+ -1, /* (374) vtabarglist ::= vtabarg */
+ -3, /* (375) vtabarglist ::= vtabarglist COMMA vtabarg */
+ -2, /* (376) vtabarg ::= vtabarg vtabargtoken */
+ 0, /* (377) anylist ::= */
+ -4, /* (378) anylist ::= anylist LP anylist RP */
+ -2, /* (379) anylist ::= anylist ANY */
+ 0, /* (380) with ::= */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -151902,16 +152941,16 @@ static YYACTIONTYPE yy_reduce(
{ sqlite3FinishCoding(pParse); }
break;
case 3: /* cmd ::= BEGIN transtype trans_opt */
-{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy100);}
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy32);}
break;
case 4: /* transtype ::= */
-{yymsp[1].minor.yy100 = TK_DEFERRED;}
+{yymsp[1].minor.yy32 = TK_DEFERRED;}
break;
case 5: /* transtype ::= DEFERRED */
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
- case 301: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==301);
-{yymsp[0].minor.yy100 = yymsp[0].major; /*A-overwrites-X*/}
+ case 304: /* range_or_rows ::= RANGE|ROWS|GROUPS */ yytestcase(yyruleno==304);
+{yymsp[0].minor.yy32 = yymsp[0].major; /*A-overwrites-X*/}
break;
case 8: /* cmd ::= COMMIT|END trans_opt */
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
@@ -151934,7 +152973,7 @@ static YYACTIONTYPE yy_reduce(
break;
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
- sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy100,0,0,yymsp[-2].minor.yy100);
+ sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy32,0,0,yymsp[-2].minor.yy32);
}
break;
case 14: /* createkw ::= CREATE */
@@ -151948,33 +152987,33 @@ static YYACTIONTYPE yy_reduce(
case 68: /* defer_subclause_opt ::= */ yytestcase(yyruleno==68);
case 77: /* ifexists ::= */ yytestcase(yyruleno==77);
case 94: /* distinct ::= */ yytestcase(yyruleno==94);
- case 227: /* collate ::= */ yytestcase(yyruleno==227);
-{yymsp[1].minor.yy100 = 0;}
+ case 230: /* collate ::= */ yytestcase(yyruleno==230);
+{yymsp[1].minor.yy32 = 0;}
break;
case 16: /* ifnotexists ::= IF NOT EXISTS */
-{yymsp[-2].minor.yy100 = 1;}
+{yymsp[-2].minor.yy32 = 1;}
break;
case 17: /* temp ::= TEMP */
case 44: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==44);
-{yymsp[0].minor.yy100 = 1;}
+{yymsp[0].minor.yy32 = 1;}
break;
case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
{
- sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy100,0);
+ sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy32,0);
}
break;
case 20: /* create_table_args ::= AS select */
{
- sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy391);
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy391);
+ sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy25);
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy25);
}
break;
case 22: /* table_options ::= WITHOUT nm */
{
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
- yymsp[-1].minor.yy100 = TF_WithoutRowid | TF_NoVisibleRowid;
+ yymsp[-1].minor.yy32 = TF_WithoutRowid | TF_NoVisibleRowid;
}else{
- yymsp[-1].minor.yy100 = 0;
+ yymsp[-1].minor.yy32 = 0;
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
}
}
@@ -152003,7 +153042,7 @@ static YYACTIONTYPE yy_reduce(
case 28: /* scanpt ::= */
{
assert( yyLookahead!=YYNOCODE );
- yymsp[1].minor.yy528 = yyLookaheadToken.z;
+ yymsp[1].minor.yy8 = yyLookaheadToken.z;
}
break;
case 29: /* scantok ::= */
@@ -152017,17 +153056,17 @@ static YYACTIONTYPE yy_reduce(
{pParse->constraintName = yymsp[0].minor.yy0;}
break;
case 31: /* ccons ::= DEFAULT scantok term */
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy102,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy46,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
break;
case 32: /* ccons ::= DEFAULT LP expr RP */
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy102,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy46,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
break;
case 33: /* ccons ::= DEFAULT PLUS scantok term */
-{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy102,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
+{sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy46,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);}
break;
case 34: /* ccons ::= DEFAULT MINUS scantok term */
{
- Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy102, 0);
+ Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy46, 0);
sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);
}
break;
@@ -152042,170 +153081,170 @@ static YYACTIONTYPE yy_reduce(
}
break;
case 36: /* ccons ::= NOT NULL onconf */
-{sqlite3AddNotNull(pParse, yymsp[0].minor.yy100);}
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy32);}
break;
case 37: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
-{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy100,yymsp[0].minor.yy100,yymsp[-2].minor.yy100);}
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy32,yymsp[0].minor.yy32,yymsp[-2].minor.yy32);}
break;
case 38: /* ccons ::= UNIQUE onconf */
-{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy100,0,0,0,0,
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy32,0,0,0,0,
SQLITE_IDXTYPE_UNIQUE);}
break;
case 39: /* ccons ::= CHECK LP expr RP */
-{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy102);}
+{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy46);}
break;
case 40: /* ccons ::= REFERENCES nm eidlist_opt refargs */
-{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy94,yymsp[0].minor.yy100);}
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy138,yymsp[0].minor.yy32);}
break;
case 41: /* ccons ::= defer_subclause */
-{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy100);}
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy32);}
break;
case 42: /* ccons ::= COLLATE ID|STRING */
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
break;
case 45: /* refargs ::= */
-{ yymsp[1].minor.yy100 = OE_None*0x0101; /* EV: R-19803-45884 */}
+{ yymsp[1].minor.yy32 = OE_None*0x0101; /* EV: R-19803-45884 */}
break;
case 46: /* refargs ::= refargs refarg */
-{ yymsp[-1].minor.yy100 = (yymsp[-1].minor.yy100 & ~yymsp[0].minor.yy199.mask) | yymsp[0].minor.yy199.value; }
+{ yymsp[-1].minor.yy32 = (yymsp[-1].minor.yy32 & ~yymsp[0].minor.yy495.mask) | yymsp[0].minor.yy495.value; }
break;
case 47: /* refarg ::= MATCH nm */
-{ yymsp[-1].minor.yy199.value = 0; yymsp[-1].minor.yy199.mask = 0x000000; }
+{ yymsp[-1].minor.yy495.value = 0; yymsp[-1].minor.yy495.mask = 0x000000; }
break;
case 48: /* refarg ::= ON INSERT refact */
-{ yymsp[-2].minor.yy199.value = 0; yymsp[-2].minor.yy199.mask = 0x000000; }
+{ yymsp[-2].minor.yy495.value = 0; yymsp[-2].minor.yy495.mask = 0x000000; }
break;
case 49: /* refarg ::= ON DELETE refact */
-{ yymsp[-2].minor.yy199.value = yymsp[0].minor.yy100; yymsp[-2].minor.yy199.mask = 0x0000ff; }
+{ yymsp[-2].minor.yy495.value = yymsp[0].minor.yy32; yymsp[-2].minor.yy495.mask = 0x0000ff; }
break;
case 50: /* refarg ::= ON UPDATE refact */
-{ yymsp[-2].minor.yy199.value = yymsp[0].minor.yy100<<8; yymsp[-2].minor.yy199.mask = 0x00ff00; }
+{ yymsp[-2].minor.yy495.value = yymsp[0].minor.yy32<<8; yymsp[-2].minor.yy495.mask = 0x00ff00; }
break;
case 51: /* refact ::= SET NULL */
-{ yymsp[-1].minor.yy100 = OE_SetNull; /* EV: R-33326-45252 */}
+{ yymsp[-1].minor.yy32 = OE_SetNull; /* EV: R-33326-45252 */}
break;
case 52: /* refact ::= SET DEFAULT */
-{ yymsp[-1].minor.yy100 = OE_SetDflt; /* EV: R-33326-45252 */}
+{ yymsp[-1].minor.yy32 = OE_SetDflt; /* EV: R-33326-45252 */}
break;
case 53: /* refact ::= CASCADE */
-{ yymsp[0].minor.yy100 = OE_Cascade; /* EV: R-33326-45252 */}
+{ yymsp[0].minor.yy32 = OE_Cascade; /* EV: R-33326-45252 */}
break;
case 54: /* refact ::= RESTRICT */
-{ yymsp[0].minor.yy100 = OE_Restrict; /* EV: R-33326-45252 */}
+{ yymsp[0].minor.yy32 = OE_Restrict; /* EV: R-33326-45252 */}
break;
case 55: /* refact ::= NO ACTION */
-{ yymsp[-1].minor.yy100 = OE_None; /* EV: R-33326-45252 */}
+{ yymsp[-1].minor.yy32 = OE_None; /* EV: R-33326-45252 */}
break;
case 56: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
-{yymsp[-2].minor.yy100 = 0;}
+{yymsp[-2].minor.yy32 = 0;}
break;
case 57: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
case 72: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==72);
- case 157: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==157);
-{yymsp[-1].minor.yy100 = yymsp[0].minor.yy100;}
+ case 160: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==160);
+{yymsp[-1].minor.yy32 = yymsp[0].minor.yy32;}
break;
case 59: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
case 76: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==76);
- case 199: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==199);
- case 202: /* in_op ::= NOT IN */ yytestcase(yyruleno==202);
- case 228: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==228);
-{yymsp[-1].minor.yy100 = 1;}
+ case 202: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==202);
+ case 205: /* in_op ::= NOT IN */ yytestcase(yyruleno==205);
+ case 231: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==231);
+{yymsp[-1].minor.yy32 = 1;}
break;
case 60: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
-{yymsp[-1].minor.yy100 = 0;}
+{yymsp[-1].minor.yy32 = 0;}
break;
case 62: /* tconscomma ::= COMMA */
{pParse->constraintName.n = 0;}
break;
case 64: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
-{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy94,yymsp[0].minor.yy100,yymsp[-2].minor.yy100,0);}
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy138,yymsp[0].minor.yy32,yymsp[-2].minor.yy32,0);}
break;
case 65: /* tcons ::= UNIQUE LP sortlist RP onconf */
-{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy94,yymsp[0].minor.yy100,0,0,0,0,
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy138,yymsp[0].minor.yy32,0,0,0,0,
SQLITE_IDXTYPE_UNIQUE);}
break;
case 66: /* tcons ::= CHECK LP expr RP onconf */
-{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy102);}
+{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy46);}
break;
case 67: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
{
- sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy94, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy94, yymsp[-1].minor.yy100);
- sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy100);
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy138, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy138, yymsp[-1].minor.yy32);
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy32);
}
break;
case 69: /* onconf ::= */
case 71: /* orconf ::= */ yytestcase(yyruleno==71);
-{yymsp[1].minor.yy100 = OE_Default;}
+{yymsp[1].minor.yy32 = OE_Default;}
break;
case 70: /* onconf ::= ON CONFLICT resolvetype */
-{yymsp[-2].minor.yy100 = yymsp[0].minor.yy100;}
+{yymsp[-2].minor.yy32 = yymsp[0].minor.yy32;}
break;
case 73: /* resolvetype ::= IGNORE */
-{yymsp[0].minor.yy100 = OE_Ignore;}
+{yymsp[0].minor.yy32 = OE_Ignore;}
break;
case 74: /* resolvetype ::= REPLACE */
- case 158: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==158);
-{yymsp[0].minor.yy100 = OE_Replace;}
+ case 161: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==161);
+{yymsp[0].minor.yy32 = OE_Replace;}
break;
case 75: /* cmd ::= DROP TABLE ifexists fullname */
{
- sqlite3DropTable(pParse, yymsp[0].minor.yy407, 0, yymsp[-1].minor.yy100);
+ sqlite3DropTable(pParse, yymsp[0].minor.yy609, 0, yymsp[-1].minor.yy32);
}
break;
case 78: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
{
- sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy94, yymsp[0].minor.yy391, yymsp[-7].minor.yy100, yymsp[-5].minor.yy100);
+ sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy138, yymsp[0].minor.yy25, yymsp[-7].minor.yy32, yymsp[-5].minor.yy32);
}
break;
case 79: /* cmd ::= DROP VIEW ifexists fullname */
{
- sqlite3DropTable(pParse, yymsp[0].minor.yy407, 1, yymsp[-1].minor.yy100);
+ sqlite3DropTable(pParse, yymsp[0].minor.yy609, 1, yymsp[-1].minor.yy32);
}
break;
case 80: /* cmd ::= select */
{
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0};
- sqlite3Select(pParse, yymsp[0].minor.yy391, &dest);
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy391);
+ sqlite3Select(pParse, yymsp[0].minor.yy25, &dest);
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy25);
}
break;
case 81: /* select ::= WITH wqlist selectnowith */
{
- Select *p = yymsp[0].minor.yy391;
+ Select *p = yymsp[0].minor.yy25;
if( p ){
- p->pWith = yymsp[-1].minor.yy243;
+ p->pWith = yymsp[-1].minor.yy297;
parserDoubleLinkSelect(pParse, p);
}else{
- sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy243);
+ sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy297);
}
- yymsp[-2].minor.yy391 = p;
+ yymsp[-2].minor.yy25 = p;
}
break;
case 82: /* select ::= WITH RECURSIVE wqlist selectnowith */
{
- Select *p = yymsp[0].minor.yy391;
+ Select *p = yymsp[0].minor.yy25;
if( p ){
- p->pWith = yymsp[-1].minor.yy243;
+ p->pWith = yymsp[-1].minor.yy297;
parserDoubleLinkSelect(pParse, p);
}else{
- sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy243);
+ sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy297);
}
- yymsp[-3].minor.yy391 = p;
+ yymsp[-3].minor.yy25 = p;
}
break;
case 83: /* select ::= selectnowith */
{
- Select *p = yymsp[0].minor.yy391;
+ Select *p = yymsp[0].minor.yy25;
if( p ){
parserDoubleLinkSelect(pParse, p);
}
- yymsp[0].minor.yy391 = p; /*A-overwrites-X*/
+ yymsp[0].minor.yy25 = p; /*A-overwrites-X*/
}
break;
case 84: /* selectnowith ::= selectnowith multiselect_op oneselect */
{
- Select *pRhs = yymsp[0].minor.yy391;
- Select *pLhs = yymsp[-2].minor.yy391;
+ Select *pRhs = yymsp[0].minor.yy25;
+ Select *pLhs = yymsp[-2].minor.yy25;
if( pRhs && pRhs->pPrior ){
SrcList *pFrom;
Token x;
@@ -152215,83 +153254,83 @@ static YYACTIONTYPE yy_reduce(
pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
}
if( pRhs ){
- pRhs->op = (u8)yymsp[-1].minor.yy100;
+ pRhs->op = (u8)yymsp[-1].minor.yy32;
pRhs->pPrior = pLhs;
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
pRhs->selFlags &= ~SF_MultiValue;
- if( yymsp[-1].minor.yy100!=TK_ALL ) pParse->hasCompound = 1;
+ if( yymsp[-1].minor.yy32!=TK_ALL ) pParse->hasCompound = 1;
}else{
sqlite3SelectDelete(pParse->db, pLhs);
}
- yymsp[-2].minor.yy391 = pRhs;
+ yymsp[-2].minor.yy25 = pRhs;
}
break;
case 85: /* multiselect_op ::= UNION */
case 87: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==87);
-{yymsp[0].minor.yy100 = yymsp[0].major; /*A-overwrites-OP*/}
+{yymsp[0].minor.yy32 = yymsp[0].major; /*A-overwrites-OP*/}
break;
case 86: /* multiselect_op ::= UNION ALL */
-{yymsp[-1].minor.yy100 = TK_ALL;}
+{yymsp[-1].minor.yy32 = TK_ALL;}
break;
case 88: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{
- yymsp[-8].minor.yy391 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy94,yymsp[-5].minor.yy407,yymsp[-4].minor.yy102,yymsp[-3].minor.yy94,yymsp[-2].minor.yy102,yymsp[-1].minor.yy94,yymsp[-7].minor.yy100,yymsp[0].minor.yy102);
+ yymsp[-8].minor.yy25 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy138,yymsp[-5].minor.yy609,yymsp[-4].minor.yy46,yymsp[-3].minor.yy138,yymsp[-2].minor.yy46,yymsp[-1].minor.yy138,yymsp[-7].minor.yy32,yymsp[0].minor.yy46);
}
break;
case 89: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
{
- yymsp[-9].minor.yy391 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy94,yymsp[-6].minor.yy407,yymsp[-5].minor.yy102,yymsp[-4].minor.yy94,yymsp[-3].minor.yy102,yymsp[-1].minor.yy94,yymsp[-8].minor.yy100,yymsp[0].minor.yy102);
- if( yymsp[-9].minor.yy391 ){
- yymsp[-9].minor.yy391->pWinDefn = yymsp[-2].minor.yy379;
+ yymsp[-9].minor.yy25 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy138,yymsp[-6].minor.yy609,yymsp[-5].minor.yy46,yymsp[-4].minor.yy138,yymsp[-3].minor.yy46,yymsp[-1].minor.yy138,yymsp[-8].minor.yy32,yymsp[0].minor.yy46);
+ if( yymsp[-9].minor.yy25 ){
+ yymsp[-9].minor.yy25->pWinDefn = yymsp[-2].minor.yy455;
}else{
- sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy379);
+ sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy455);
}
}
break;
case 90: /* values ::= VALUES LP nexprlist RP */
{
- yymsp[-3].minor.yy391 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy94,0,0,0,0,0,SF_Values,0);
+ yymsp[-3].minor.yy25 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy138,0,0,0,0,0,SF_Values,0);
}
break;
case 91: /* values ::= values COMMA LP nexprlist RP */
{
- Select *pRight, *pLeft = yymsp[-4].minor.yy391;
- pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy94,0,0,0,0,0,SF_Values|SF_MultiValue,0);
+ Select *pRight, *pLeft = yymsp[-4].minor.yy25;
+ pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy138,0,0,0,0,0,SF_Values|SF_MultiValue,0);
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
if( pRight ){
pRight->op = TK_ALL;
pRight->pPrior = pLeft;
- yymsp[-4].minor.yy391 = pRight;
+ yymsp[-4].minor.yy25 = pRight;
}else{
- yymsp[-4].minor.yy391 = pLeft;
+ yymsp[-4].minor.yy25 = pLeft;
}
}
break;
case 92: /* distinct ::= DISTINCT */
-{yymsp[0].minor.yy100 = SF_Distinct;}
+{yymsp[0].minor.yy32 = SF_Distinct;}
break;
case 93: /* distinct ::= ALL */
-{yymsp[0].minor.yy100 = SF_All;}
+{yymsp[0].minor.yy32 = SF_All;}
break;
case 95: /* sclp ::= */
case 128: /* orderby_opt ::= */ yytestcase(yyruleno==128);
- case 135: /* groupby_opt ::= */ yytestcase(yyruleno==135);
- case 215: /* exprlist ::= */ yytestcase(yyruleno==215);
- case 218: /* paren_exprlist ::= */ yytestcase(yyruleno==218);
- case 223: /* eidlist_opt ::= */ yytestcase(yyruleno==223);
-{yymsp[1].minor.yy94 = 0;}
+ case 138: /* groupby_opt ::= */ yytestcase(yyruleno==138);
+ case 218: /* exprlist ::= */ yytestcase(yyruleno==218);
+ case 221: /* paren_exprlist ::= */ yytestcase(yyruleno==221);
+ case 226: /* eidlist_opt ::= */ yytestcase(yyruleno==226);
+{yymsp[1].minor.yy138 = 0;}
break;
case 96: /* selcollist ::= sclp scanpt expr scanpt as */
{
- yymsp[-4].minor.yy94 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy94, yymsp[-2].minor.yy102);
- if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy94, &yymsp[0].minor.yy0, 1);
- sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy94,yymsp[-3].minor.yy528,yymsp[-1].minor.yy528);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy138, yymsp[-2].minor.yy46);
+ if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy138, &yymsp[0].minor.yy0, 1);
+ sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy138,yymsp[-3].minor.yy8,yymsp[-1].minor.yy8);
}
break;
case 97: /* selcollist ::= sclp scanpt STAR */
{
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
- yymsp[-2].minor.yy94 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy94, p);
+ yymsp[-2].minor.yy138 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy138, p);
}
break;
case 98: /* selcollist ::= sclp scanpt nm DOT STAR */
@@ -152299,58 +153338,58 @@ static YYACTIONTYPE yy_reduce(
Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
- yymsp[-4].minor.yy94 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy94, pDot);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy138, pDot);
}
break;
case 99: /* as ::= AS nm */
case 110: /* dbnm ::= DOT nm */ yytestcase(yyruleno==110);
- case 239: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==239);
- case 240: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==240);
+ case 242: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==242);
+ case 243: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==243);
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
break;
case 101: /* from ::= */
-{yymsp[1].minor.yy407 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy407));}
+{yymsp[1].minor.yy609 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy609));}
break;
case 102: /* from ::= FROM seltablist */
{
- yymsp[-1].minor.yy407 = yymsp[0].minor.yy407;
- sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy407);
+ yymsp[-1].minor.yy609 = yymsp[0].minor.yy609;
+ sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy609);
}
break;
case 103: /* stl_prefix ::= seltablist joinop */
{
- if( ALWAYS(yymsp[-1].minor.yy407 && yymsp[-1].minor.yy407->nSrc>0) ) yymsp[-1].minor.yy407->a[yymsp[-1].minor.yy407->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy100;
+ if( ALWAYS(yymsp[-1].minor.yy609 && yymsp[-1].minor.yy609->nSrc>0) ) yymsp[-1].minor.yy609->a[yymsp[-1].minor.yy609->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy32;
}
break;
case 104: /* stl_prefix ::= */
-{yymsp[1].minor.yy407 = 0;}
+{yymsp[1].minor.yy609 = 0;}
break;
case 105: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
- yymsp[-6].minor.yy407 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy407,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy102,yymsp[0].minor.yy76);
- sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy407, &yymsp[-2].minor.yy0);
+ yymsp[-6].minor.yy609 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy609,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy406);
+ sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy609, &yymsp[-2].minor.yy0);
}
break;
case 106: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
{
- yymsp[-8].minor.yy407 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy407,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy102,yymsp[0].minor.yy76);
- sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy407, yymsp[-4].minor.yy94);
+ yymsp[-8].minor.yy609 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy609,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy406);
+ sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy609, yymsp[-4].minor.yy138);
}
break;
case 107: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
- yymsp[-6].minor.yy407 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy407,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy391,yymsp[-1].minor.yy102,yymsp[0].minor.yy76);
+ yymsp[-6].minor.yy609 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy609,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy25,yymsp[-1].minor.yy46,yymsp[0].minor.yy406);
}
break;
case 108: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
{
- if( yymsp[-6].minor.yy407==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy102==0 && yymsp[0].minor.yy76==0 ){
- yymsp[-6].minor.yy407 = yymsp[-4].minor.yy407;
- }else if( yymsp[-4].minor.yy407->nSrc==1 ){
- yymsp[-6].minor.yy407 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy407,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy102,yymsp[0].minor.yy76);
- if( yymsp[-6].minor.yy407 ){
- struct SrcList_item *pNew = &yymsp[-6].minor.yy407->a[yymsp[-6].minor.yy407->nSrc-1];
- struct SrcList_item *pOld = yymsp[-4].minor.yy407->a;
+ if( yymsp[-6].minor.yy609==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy46==0 && yymsp[0].minor.yy406==0 ){
+ yymsp[-6].minor.yy609 = yymsp[-4].minor.yy609;
+ }else if( yymsp[-4].minor.yy609->nSrc==1 ){
+ yymsp[-6].minor.yy609 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy609,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy46,yymsp[0].minor.yy406);
+ if( yymsp[-6].minor.yy609 ){
+ struct SrcList_item *pNew = &yymsp[-6].minor.yy609->a[yymsp[-6].minor.yy609->nSrc-1];
+ struct SrcList_item *pOld = yymsp[-4].minor.yy609->a;
pNew->zName = pOld->zName;
pNew->zDatabase = pOld->zDatabase;
pNew->pSelect = pOld->pSelect;
@@ -152363,12 +153402,12 @@ static YYACTIONTYPE yy_reduce(
pOld->zName = pOld->zDatabase = 0;
pOld->pSelect = 0;
}
- sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy407);
+ sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy609);
}else{
Select *pSubquery;
- sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy407);
- pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy407,0,0,0,0,SF_NestedFrom,0);
- yymsp[-6].minor.yy407 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy407,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy102,yymsp[0].minor.yy76);
+ sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy609);
+ pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy609,0,0,0,0,SF_NestedFrom,0);
+ yymsp[-6].minor.yy609 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy609,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy46,yymsp[0].minor.yy406);
}
}
break;
@@ -152378,63 +153417,63 @@ static YYACTIONTYPE yy_reduce(
break;
case 111: /* fullname ::= nm */
{
- yylhsminor.yy407 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
- if( IN_RENAME_OBJECT && yylhsminor.yy407 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy407->a[0].zName, &yymsp[0].minor.yy0);
+ yylhsminor.yy609 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
+ if( IN_RENAME_OBJECT && yylhsminor.yy609 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy609->a[0].zName, &yymsp[0].minor.yy0);
}
- yymsp[0].minor.yy407 = yylhsminor.yy407;
+ yymsp[0].minor.yy609 = yylhsminor.yy609;
break;
case 112: /* fullname ::= nm DOT nm */
{
- yylhsminor.yy407 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
- if( IN_RENAME_OBJECT && yylhsminor.yy407 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy407->a[0].zName, &yymsp[0].minor.yy0);
+ yylhsminor.yy609 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
+ if( IN_RENAME_OBJECT && yylhsminor.yy609 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy609->a[0].zName, &yymsp[0].minor.yy0);
}
- yymsp[-2].minor.yy407 = yylhsminor.yy407;
+ yymsp[-2].minor.yy609 = yylhsminor.yy609;
break;
case 113: /* xfullname ::= nm */
-{yymsp[0].minor.yy407 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
+{yymsp[0].minor.yy609 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
break;
case 114: /* xfullname ::= nm DOT nm */
-{yymsp[-2].minor.yy407 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
+{yymsp[-2].minor.yy609 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 115: /* xfullname ::= nm DOT nm AS nm */
{
- yymsp[-4].minor.yy407 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
- if( yymsp[-4].minor.yy407 ) yymsp[-4].minor.yy407->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
+ yymsp[-4].minor.yy609 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
+ if( yymsp[-4].minor.yy609 ) yymsp[-4].minor.yy609->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
}
break;
case 116: /* xfullname ::= nm AS nm */
{
- yymsp[-2].minor.yy407 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
- if( yymsp[-2].minor.yy407 ) yymsp[-2].minor.yy407->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
+ yymsp[-2].minor.yy609 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
+ if( yymsp[-2].minor.yy609 ) yymsp[-2].minor.yy609->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
}
break;
case 117: /* joinop ::= COMMA|JOIN */
-{ yymsp[0].minor.yy100 = JT_INNER; }
+{ yymsp[0].minor.yy32 = JT_INNER; }
break;
case 118: /* joinop ::= JOIN_KW JOIN */
-{yymsp[-1].minor.yy100 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
+{yymsp[-1].minor.yy32 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
break;
case 119: /* joinop ::= JOIN_KW nm JOIN */
-{yymsp[-2].minor.yy100 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
+{yymsp[-2].minor.yy32 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
break;
case 120: /* joinop ::= JOIN_KW nm nm JOIN */
-{yymsp[-3].minor.yy100 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
+{yymsp[-3].minor.yy32 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
break;
case 121: /* on_opt ::= ON expr */
- case 138: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==138);
- case 145: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==145);
- case 211: /* case_else ::= ELSE expr */ yytestcase(yyruleno==211);
- case 232: /* vinto ::= INTO expr */ yytestcase(yyruleno==232);
-{yymsp[-1].minor.yy102 = yymsp[0].minor.yy102;}
+ case 141: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==141);
+ case 148: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==148);
+ case 214: /* case_else ::= ELSE expr */ yytestcase(yyruleno==214);
+ case 235: /* vinto ::= INTO expr */ yytestcase(yyruleno==235);
+{yymsp[-1].minor.yy46 = yymsp[0].minor.yy46;}
break;
case 122: /* on_opt ::= */
- case 137: /* having_opt ::= */ yytestcase(yyruleno==137);
- case 139: /* limit_opt ::= */ yytestcase(yyruleno==139);
- case 144: /* where_opt ::= */ yytestcase(yyruleno==144);
- case 212: /* case_else ::= */ yytestcase(yyruleno==212);
- case 214: /* case_operand ::= */ yytestcase(yyruleno==214);
- case 233: /* vinto ::= */ yytestcase(yyruleno==233);
-{yymsp[1].minor.yy102 = 0;}
+ case 140: /* having_opt ::= */ yytestcase(yyruleno==140);
+ case 142: /* limit_opt ::= */ yytestcase(yyruleno==142);
+ case 147: /* where_opt ::= */ yytestcase(yyruleno==147);
+ case 215: /* case_else ::= */ yytestcase(yyruleno==215);
+ case 217: /* case_operand ::= */ yytestcase(yyruleno==217);
+ case 236: /* vinto ::= */ yytestcase(yyruleno==236);
+{yymsp[1].minor.yy46 = 0;}
break;
case 124: /* indexed_opt ::= INDEXED BY nm */
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
@@ -152443,121 +153482,128 @@ static YYACTIONTYPE yy_reduce(
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
break;
case 126: /* using_opt ::= USING LP idlist RP */
-{yymsp[-3].minor.yy76 = yymsp[-1].minor.yy76;}
+{yymsp[-3].minor.yy406 = yymsp[-1].minor.yy406;}
break;
case 127: /* using_opt ::= */
- case 159: /* idlist_opt ::= */ yytestcase(yyruleno==159);
-{yymsp[1].minor.yy76 = 0;}
+ case 162: /* idlist_opt ::= */ yytestcase(yyruleno==162);
+{yymsp[1].minor.yy406 = 0;}
break;
case 129: /* orderby_opt ::= ORDER BY sortlist */
- case 136: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==136);
-{yymsp[-2].minor.yy94 = yymsp[0].minor.yy94;}
+ case 139: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==139);
+{yymsp[-2].minor.yy138 = yymsp[0].minor.yy138;}
break;
- case 130: /* sortlist ::= sortlist COMMA expr sortorder */
+ case 130: /* sortlist ::= sortlist COMMA expr sortorder nulls */
{
- yymsp[-3].minor.yy94 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy94,yymsp[-1].minor.yy102);
- sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy94,yymsp[0].minor.yy100);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy138,yymsp[-2].minor.yy46);
+ sqlite3ExprListSetSortOrder(yymsp[-4].minor.yy138,yymsp[-1].minor.yy32,yymsp[0].minor.yy32);
}
break;
- case 131: /* sortlist ::= expr sortorder */
+ case 131: /* sortlist ::= expr sortorder nulls */
{
- yymsp[-1].minor.yy94 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy102); /*A-overwrites-Y*/
- sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy94,yymsp[0].minor.yy100);
+ yymsp[-2].minor.yy138 = sqlite3ExprListAppend(pParse,0,yymsp[-2].minor.yy46); /*A-overwrites-Y*/
+ sqlite3ExprListSetSortOrder(yymsp[-2].minor.yy138,yymsp[-1].minor.yy32,yymsp[0].minor.yy32);
}
break;
case 132: /* sortorder ::= ASC */
-{yymsp[0].minor.yy100 = SQLITE_SO_ASC;}
+{yymsp[0].minor.yy32 = SQLITE_SO_ASC;}
break;
case 133: /* sortorder ::= DESC */
-{yymsp[0].minor.yy100 = SQLITE_SO_DESC;}
+{yymsp[0].minor.yy32 = SQLITE_SO_DESC;}
break;
case 134: /* sortorder ::= */
-{yymsp[1].minor.yy100 = SQLITE_SO_UNDEFINED;}
+ case 137: /* nulls ::= */ yytestcase(yyruleno==137);
+{yymsp[1].minor.yy32 = SQLITE_SO_UNDEFINED;}
+ break;
+ case 135: /* nulls ::= NULLS FIRST */
+{yymsp[-1].minor.yy32 = SQLITE_SO_ASC;}
break;
- case 140: /* limit_opt ::= LIMIT expr */
-{yymsp[-1].minor.yy102 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy102,0);}
+ case 136: /* nulls ::= NULLS LAST */
+{yymsp[-1].minor.yy32 = SQLITE_SO_DESC;}
break;
- case 141: /* limit_opt ::= LIMIT expr OFFSET expr */
-{yymsp[-3].minor.yy102 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy102,yymsp[0].minor.yy102);}
+ case 143: /* limit_opt ::= LIMIT expr */
+{yymsp[-1].minor.yy46 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy46,0);}
break;
- case 142: /* limit_opt ::= LIMIT expr COMMA expr */
-{yymsp[-3].minor.yy102 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy102,yymsp[-2].minor.yy102);}
+ case 144: /* limit_opt ::= LIMIT expr OFFSET expr */
+{yymsp[-3].minor.yy46 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy46,yymsp[0].minor.yy46);}
break;
- case 143: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
+ case 145: /* limit_opt ::= LIMIT expr COMMA expr */
+{yymsp[-3].minor.yy46 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy46,yymsp[-2].minor.yy46);}
+ break;
+ case 146: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
{
- sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy407, &yymsp[-1].minor.yy0);
- sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy407,yymsp[0].minor.yy102,0,0);
+ sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy609, &yymsp[-1].minor.yy0);
+ sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy609,yymsp[0].minor.yy46,0,0);
}
break;
- case 146: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
+ case 149: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
{
- sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy407, &yymsp[-3].minor.yy0);
- sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy94,"set list");
- sqlite3Update(pParse,yymsp[-4].minor.yy407,yymsp[-1].minor.yy94,yymsp[0].minor.yy102,yymsp[-5].minor.yy100,0,0,0);
+ sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy609, &yymsp[-3].minor.yy0);
+ sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy138,"set list");
+ sqlite3Update(pParse,yymsp[-4].minor.yy609,yymsp[-1].minor.yy138,yymsp[0].minor.yy46,yymsp[-5].minor.yy32,0,0,0);
}
break;
- case 147: /* setlist ::= setlist COMMA nm EQ expr */
+ case 150: /* setlist ::= setlist COMMA nm EQ expr */
{
- yymsp[-4].minor.yy94 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy94, yymsp[0].minor.yy102);
- sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy94, &yymsp[-2].minor.yy0, 1);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy138, yymsp[0].minor.yy46);
+ sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy138, &yymsp[-2].minor.yy0, 1);
}
break;
- case 148: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
+ case 151: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
{
- yymsp[-6].minor.yy94 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy94, yymsp[-3].minor.yy76, yymsp[0].minor.yy102);
+ yymsp[-6].minor.yy138 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy138, yymsp[-3].minor.yy406, yymsp[0].minor.yy46);
}
break;
- case 149: /* setlist ::= nm EQ expr */
+ case 152: /* setlist ::= nm EQ expr */
{
- yylhsminor.yy94 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy102);
- sqlite3ExprListSetName(pParse, yylhsminor.yy94, &yymsp[-2].minor.yy0, 1);
+ yylhsminor.yy138 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy46);
+ sqlite3ExprListSetName(pParse, yylhsminor.yy138, &yymsp[-2].minor.yy0, 1);
}
- yymsp[-2].minor.yy94 = yylhsminor.yy94;
+ yymsp[-2].minor.yy138 = yylhsminor.yy138;
break;
- case 150: /* setlist ::= LP idlist RP EQ expr */
+ case 153: /* setlist ::= LP idlist RP EQ expr */
{
- yymsp[-4].minor.yy94 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy76, yymsp[0].minor.yy102);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy406, yymsp[0].minor.yy46);
}
break;
- case 151: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
+ case 154: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
{
- sqlite3Insert(pParse, yymsp[-3].minor.yy407, yymsp[-1].minor.yy391, yymsp[-2].minor.yy76, yymsp[-5].minor.yy100, yymsp[0].minor.yy95);
+ sqlite3Insert(pParse, yymsp[-3].minor.yy609, yymsp[-1].minor.yy25, yymsp[-2].minor.yy406, yymsp[-5].minor.yy32, yymsp[0].minor.yy288);
}
break;
- case 152: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
+ case 155: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
{
- sqlite3Insert(pParse, yymsp[-3].minor.yy407, 0, yymsp[-2].minor.yy76, yymsp[-5].minor.yy100, 0);
+ sqlite3Insert(pParse, yymsp[-3].minor.yy609, 0, yymsp[-2].minor.yy406, yymsp[-5].minor.yy32, 0);
}
break;
- case 153: /* upsert ::= */
-{ yymsp[1].minor.yy95 = 0; }
+ case 156: /* upsert ::= */
+{ yymsp[1].minor.yy288 = 0; }
break;
- case 154: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
-{ yymsp[-10].minor.yy95 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy94,yymsp[-5].minor.yy102,yymsp[-1].minor.yy94,yymsp[0].minor.yy102);}
+ case 157: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
+{ yymsp[-10].minor.yy288 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy138,yymsp[-5].minor.yy46,yymsp[-1].minor.yy138,yymsp[0].minor.yy46);}
break;
- case 155: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
-{ yymsp[-7].minor.yy95 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy94,yymsp[-2].minor.yy102,0,0); }
+ case 158: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
+{ yymsp[-7].minor.yy288 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy138,yymsp[-2].minor.yy46,0,0); }
break;
- case 156: /* upsert ::= ON CONFLICT DO NOTHING */
-{ yymsp[-3].minor.yy95 = sqlite3UpsertNew(pParse->db,0,0,0,0); }
+ case 159: /* upsert ::= ON CONFLICT DO NOTHING */
+{ yymsp[-3].minor.yy288 = sqlite3UpsertNew(pParse->db,0,0,0,0); }
break;
- case 160: /* idlist_opt ::= LP idlist RP */
-{yymsp[-2].minor.yy76 = yymsp[-1].minor.yy76;}
+ case 163: /* idlist_opt ::= LP idlist RP */
+{yymsp[-2].minor.yy406 = yymsp[-1].minor.yy406;}
break;
- case 161: /* idlist ::= idlist COMMA nm */
-{yymsp[-2].minor.yy76 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy76,&yymsp[0].minor.yy0);}
+ case 164: /* idlist ::= idlist COMMA nm */
+{yymsp[-2].minor.yy406 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy406,&yymsp[0].minor.yy0);}
break;
- case 162: /* idlist ::= nm */
-{yymsp[0].minor.yy76 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
+ case 165: /* idlist ::= nm */
+{yymsp[0].minor.yy406 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
break;
- case 163: /* expr ::= LP expr RP */
-{yymsp[-2].minor.yy102 = yymsp[-1].minor.yy102;}
+ case 166: /* expr ::= LP expr RP */
+{yymsp[-2].minor.yy46 = yymsp[-1].minor.yy46;}
break;
- case 164: /* expr ::= ID|INDEXED */
- case 165: /* expr ::= JOIN_KW */ yytestcase(yyruleno==165);
-{yymsp[0].minor.yy102=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
+ case 167: /* expr ::= ID|INDEXED */
+ case 168: /* expr ::= JOIN_KW */ yytestcase(yyruleno==168);
+{yymsp[0].minor.yy46=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
- case 166: /* expr ::= nm DOT nm */
+ case 169: /* expr ::= nm DOT nm */
{
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[0].minor.yy0, 1);
@@ -152565,11 +153611,11 @@ static YYACTIONTYPE yy_reduce(
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
sqlite3RenameTokenMap(pParse, (void*)temp1, &yymsp[-2].minor.yy0);
}
- yylhsminor.yy102 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
+ yylhsminor.yy46 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
}
- yymsp[-2].minor.yy102 = yylhsminor.yy102;
+ yymsp[-2].minor.yy46 = yylhsminor.yy46;
break;
- case 167: /* expr ::= nm DOT nm DOT nm */
+ case 170: /* expr ::= nm DOT nm DOT nm */
{
Expr *temp1 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-4].minor.yy0, 1);
Expr *temp2 = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
@@ -152579,26 +153625,26 @@ static YYACTIONTYPE yy_reduce(
sqlite3RenameTokenMap(pParse, (void*)temp3, &yymsp[0].minor.yy0);
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[-2].minor.yy0);
}
- yylhsminor.yy102 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
+ yylhsminor.yy46 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
}
- yymsp[-4].minor.yy102 = yylhsminor.yy102;
+ yymsp[-4].minor.yy46 = yylhsminor.yy46;
break;
- case 168: /* term ::= NULL|FLOAT|BLOB */
- case 169: /* term ::= STRING */ yytestcase(yyruleno==169);
-{yymsp[0].minor.yy102=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
+ case 171: /* term ::= NULL|FLOAT|BLOB */
+ case 172: /* term ::= STRING */ yytestcase(yyruleno==172);
+{yymsp[0].minor.yy46=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
- case 170: /* term ::= INTEGER */
+ case 173: /* term ::= INTEGER */
{
- yylhsminor.yy102 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
+ yylhsminor.yy46 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
}
- yymsp[0].minor.yy102 = yylhsminor.yy102;
+ yymsp[0].minor.yy46 = yylhsminor.yy46;
break;
- case 171: /* expr ::= VARIABLE */
+ case 174: /* expr ::= VARIABLE */
{
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
u32 n = yymsp[0].minor.yy0.n;
- yymsp[0].minor.yy102 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
- sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy102, n);
+ yymsp[0].minor.yy46 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
+ sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy46, n);
}else{
/* When doing a nested parse, one can include terms in an expression
** that look like this: #1 #2 ... These terms refer to registers
@@ -152607,156 +153653,156 @@ static YYACTIONTYPE yy_reduce(
assert( t.n>=2 );
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
- yymsp[0].minor.yy102 = 0;
+ yymsp[0].minor.yy46 = 0;
}else{
- yymsp[0].minor.yy102 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
- if( yymsp[0].minor.yy102 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy102->iTable);
+ yymsp[0].minor.yy46 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
+ if( yymsp[0].minor.yy46 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy46->iTable);
}
}
}
break;
- case 172: /* expr ::= expr COLLATE ID|STRING */
+ case 175: /* expr ::= expr COLLATE ID|STRING */
{
- yymsp[-2].minor.yy102 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy102, &yymsp[0].minor.yy0, 1);
+ yymsp[-2].minor.yy46 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy46, &yymsp[0].minor.yy0, 1);
}
break;
- case 173: /* expr ::= CAST LP expr AS typetoken RP */
+ case 176: /* expr ::= CAST LP expr AS typetoken RP */
{
- yymsp[-5].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
- sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy102, yymsp[-3].minor.yy102, 0);
+ yymsp[-5].minor.yy46 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
+ sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy46, yymsp[-3].minor.yy46, 0);
}
break;
- case 174: /* expr ::= ID|INDEXED LP distinct exprlist RP */
+ case 177: /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
- yylhsminor.yy102 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy94, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy100);
+ yylhsminor.yy46 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy138, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy32);
}
- yymsp[-4].minor.yy102 = yylhsminor.yy102;
+ yymsp[-4].minor.yy46 = yylhsminor.yy46;
break;
- case 175: /* expr ::= ID|INDEXED LP STAR RP */
+ case 178: /* expr ::= ID|INDEXED LP STAR RP */
{
- yylhsminor.yy102 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
+ yylhsminor.yy46 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
}
- yymsp[-3].minor.yy102 = yylhsminor.yy102;
+ yymsp[-3].minor.yy46 = yylhsminor.yy46;
break;
- case 176: /* expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
+ case 179: /* expr ::= ID|INDEXED LP distinct exprlist RP filter_over */
{
- yylhsminor.yy102 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy94, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy100);
- sqlite3WindowAttach(pParse, yylhsminor.yy102, yymsp[0].minor.yy379);
+ yylhsminor.yy46 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy138, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy32);
+ sqlite3WindowAttach(pParse, yylhsminor.yy46, yymsp[0].minor.yy455);
}
- yymsp[-5].minor.yy102 = yylhsminor.yy102;
+ yymsp[-5].minor.yy46 = yylhsminor.yy46;
break;
- case 177: /* expr ::= ID|INDEXED LP STAR RP over_clause */
+ case 180: /* expr ::= ID|INDEXED LP STAR RP filter_over */
{
- yylhsminor.yy102 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
- sqlite3WindowAttach(pParse, yylhsminor.yy102, yymsp[0].minor.yy379);
+ yylhsminor.yy46 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
+ sqlite3WindowAttach(pParse, yylhsminor.yy46, yymsp[0].minor.yy455);
}
- yymsp[-4].minor.yy102 = yylhsminor.yy102;
+ yymsp[-4].minor.yy46 = yylhsminor.yy46;
break;
- case 178: /* term ::= CTIME_KW */
+ case 181: /* term ::= CTIME_KW */
{
- yylhsminor.yy102 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
+ yylhsminor.yy46 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
}
- yymsp[0].minor.yy102 = yylhsminor.yy102;
+ yymsp[0].minor.yy46 = yylhsminor.yy46;
break;
- case 179: /* expr ::= LP nexprlist COMMA expr RP */
+ case 182: /* expr ::= LP nexprlist COMMA expr RP */
{
- ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy94, yymsp[-1].minor.yy102);
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
- if( yymsp[-4].minor.yy102 ){
- yymsp[-4].minor.yy102->x.pList = pList;
+ ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy138, yymsp[-1].minor.yy46);
+ yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
+ if( yymsp[-4].minor.yy46 ){
+ yymsp[-4].minor.yy46->x.pList = pList;
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
}
break;
- case 180: /* expr ::= expr AND expr */
-{yymsp[-2].minor.yy102=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy102,yymsp[0].minor.yy102);}
+ case 183: /* expr ::= expr AND expr */
+{yymsp[-2].minor.yy46=sqlite3ExprAnd(pParse,yymsp[-2].minor.yy46,yymsp[0].minor.yy46);}
break;
- case 181: /* expr ::= expr OR expr */
- case 182: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==182);
- case 183: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==183);
- case 184: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==184);
- case 185: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==185);
- case 186: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==186);
- case 187: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==187);
-{yymsp[-2].minor.yy102=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy102,yymsp[0].minor.yy102);}
+ case 184: /* expr ::= expr OR expr */
+ case 185: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==185);
+ case 186: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==186);
+ case 187: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==187);
+ case 188: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==188);
+ case 189: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==189);
+ case 190: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==190);
+{yymsp[-2].minor.yy46=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy46,yymsp[0].minor.yy46);}
break;
- case 188: /* likeop ::= NOT LIKE_KW|MATCH */
+ case 191: /* likeop ::= NOT LIKE_KW|MATCH */
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
break;
- case 189: /* expr ::= expr likeop expr */
+ case 192: /* expr ::= expr likeop expr */
{
ExprList *pList;
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
yymsp[-1].minor.yy0.n &= 0x7fffffff;
- pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy102);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy102);
- yymsp[-2].minor.yy102 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
- if( bNot ) yymsp[-2].minor.yy102 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy102, 0);
- if( yymsp[-2].minor.yy102 ) yymsp[-2].minor.yy102->flags |= EP_InfixFunc;
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy46);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy46);
+ yymsp[-2].minor.yy46 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
+ if( bNot ) yymsp[-2].minor.yy46 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy46, 0);
+ if( yymsp[-2].minor.yy46 ) yymsp[-2].minor.yy46->flags |= EP_InfixFunc;
}
break;
- case 190: /* expr ::= expr likeop expr ESCAPE expr */
+ case 193: /* expr ::= expr likeop expr ESCAPE expr */
{
ExprList *pList;
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
yymsp[-3].minor.yy0.n &= 0x7fffffff;
- pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy102);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy102);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy102);
- yymsp[-4].minor.yy102 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
- if( bNot ) yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy102, 0);
- if( yymsp[-4].minor.yy102 ) yymsp[-4].minor.yy102->flags |= EP_InfixFunc;
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy46);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy46);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy46);
+ yymsp[-4].minor.yy46 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
+ if( bNot ) yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy46, 0);
+ if( yymsp[-4].minor.yy46 ) yymsp[-4].minor.yy46->flags |= EP_InfixFunc;
}
break;
- case 191: /* expr ::= expr ISNULL|NOTNULL */
-{yymsp[-1].minor.yy102 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy102,0);}
+ case 194: /* expr ::= expr ISNULL|NOTNULL */
+{yymsp[-1].minor.yy46 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy46,0);}
break;
- case 192: /* expr ::= expr NOT NULL */
-{yymsp[-2].minor.yy102 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy102,0);}
+ case 195: /* expr ::= expr NOT NULL */
+{yymsp[-2].minor.yy46 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy46,0);}
break;
- case 193: /* expr ::= expr IS expr */
+ case 196: /* expr ::= expr IS expr */
{
- yymsp[-2].minor.yy102 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy102,yymsp[0].minor.yy102);
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy102, yymsp[-2].minor.yy102, TK_ISNULL);
+ yymsp[-2].minor.yy46 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy46,yymsp[0].minor.yy46);
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy46, yymsp[-2].minor.yy46, TK_ISNULL);
}
break;
- case 194: /* expr ::= expr IS NOT expr */
+ case 197: /* expr ::= expr IS NOT expr */
{
- yymsp[-3].minor.yy102 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy102,yymsp[0].minor.yy102);
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy102, yymsp[-3].minor.yy102, TK_NOTNULL);
+ yymsp[-3].minor.yy46 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy46,yymsp[0].minor.yy46);
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy46, yymsp[-3].minor.yy46, TK_NOTNULL);
}
break;
- case 195: /* expr ::= NOT expr */
- case 196: /* expr ::= BITNOT expr */ yytestcase(yyruleno==196);
-{yymsp[-1].minor.yy102 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy102, 0);/*A-overwrites-B*/}
+ case 198: /* expr ::= NOT expr */
+ case 199: /* expr ::= BITNOT expr */ yytestcase(yyruleno==199);
+{yymsp[-1].minor.yy46 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy46, 0);/*A-overwrites-B*/}
break;
- case 197: /* expr ::= PLUS|MINUS expr */
+ case 200: /* expr ::= PLUS|MINUS expr */
{
- yymsp[-1].minor.yy102 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy102, 0);
+ yymsp[-1].minor.yy46 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy46, 0);
/*A-overwrites-B*/
}
break;
- case 198: /* between_op ::= BETWEEN */
- case 201: /* in_op ::= IN */ yytestcase(yyruleno==201);
-{yymsp[0].minor.yy100 = 0;}
+ case 201: /* between_op ::= BETWEEN */
+ case 204: /* in_op ::= IN */ yytestcase(yyruleno==204);
+{yymsp[0].minor.yy32 = 0;}
break;
- case 200: /* expr ::= expr between_op expr AND expr */
+ case 203: /* expr ::= expr between_op expr AND expr */
{
- ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy102);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy102);
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy102, 0);
- if( yymsp[-4].minor.yy102 ){
- yymsp[-4].minor.yy102->x.pList = pList;
+ ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy46);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy46);
+ yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy46, 0);
+ if( yymsp[-4].minor.yy46 ){
+ yymsp[-4].minor.yy46->x.pList = pList;
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
- if( yymsp[-3].minor.yy100 ) yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy102, 0);
+ if( yymsp[-3].minor.yy32 ) yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy46, 0);
}
break;
- case 203: /* expr ::= expr in_op LP exprlist RP */
+ case 206: /* expr ::= expr in_op LP exprlist RP */
{
- if( yymsp[-1].minor.yy94==0 ){
+ if( yymsp[-1].minor.yy138==0 ){
/* Expressions of the form
**
** expr1 IN ()
@@ -152765,218 +153811,190 @@ static YYACTIONTYPE yy_reduce(
** simplify to constants 0 (false) and 1 (true), respectively,
** regardless of the value of expr1.
*/
- sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy102);
- yymsp[-4].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy100],1);
- }else if( yymsp[-1].minor.yy94->nExpr==1 ){
- /* Expressions of the form:
- **
- ** expr1 IN (?1)
- ** expr1 NOT IN (?2)
- **
- ** with exactly one value on the RHS can be simplified to something
- ** like this:
- **
- ** expr1 == ?1
- ** expr1 <> ?2
- **
- ** But, the RHS of the == or <> is marked with the EP_Generic flag
- ** so that it may not contribute to the computation of comparison
- ** affinity or the collating sequence to use for comparison. Otherwise,
- ** the semantics would be subtly different from IN or NOT IN.
- */
- Expr *pRHS = yymsp[-1].minor.yy94->a[0].pExpr;
- yymsp[-1].minor.yy94->a[0].pExpr = 0;
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy94);
- /* pRHS cannot be NULL because a malloc error would have been detected
- ** before now and control would have never reached this point */
- if( ALWAYS(pRHS) ){
- pRHS->flags &= ~EP_Collate;
- pRHS->flags |= EP_Generic;
- }
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, yymsp[-3].minor.yy100 ? TK_NE : TK_EQ, yymsp[-4].minor.yy102, pRHS);
- }else{
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy102, 0);
- if( yymsp[-4].minor.yy102 ){
- yymsp[-4].minor.yy102->x.pList = yymsp[-1].minor.yy94;
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy102);
+ sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy46);
+ yymsp[-4].minor.yy46 = sqlite3Expr(pParse->db, TK_INTEGER, yymsp[-3].minor.yy32 ? "1" : "0");
+ }else{
+ yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy46, 0);
+ if( yymsp[-4].minor.yy46 ){
+ yymsp[-4].minor.yy46->x.pList = yymsp[-1].minor.yy138;
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy46);
}else{
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy94);
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy138);
}
- if( yymsp[-3].minor.yy100 ) yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy102, 0);
+ if( yymsp[-3].minor.yy32 ) yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy46, 0);
}
}
break;
- case 204: /* expr ::= LP select RP */
+ case 207: /* expr ::= LP select RP */
{
- yymsp[-2].minor.yy102 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
- sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy102, yymsp[-1].minor.yy391);
+ yymsp[-2].minor.yy46 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
+ sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy46, yymsp[-1].minor.yy25);
}
break;
- case 205: /* expr ::= expr in_op LP select RP */
+ case 208: /* expr ::= expr in_op LP select RP */
{
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy102, 0);
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy102, yymsp[-1].minor.yy391);
- if( yymsp[-3].minor.yy100 ) yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy102, 0);
+ yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy46, 0);
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy46, yymsp[-1].minor.yy25);
+ if( yymsp[-3].minor.yy32 ) yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy46, 0);
}
break;
- case 206: /* expr ::= expr in_op nm dbnm paren_exprlist */
+ case 209: /* expr ::= expr in_op nm dbnm paren_exprlist */
{
SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
- if( yymsp[0].minor.yy94 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy94);
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy102, 0);
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy102, pSelect);
- if( yymsp[-3].minor.yy100 ) yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy102, 0);
+ if( yymsp[0].minor.yy138 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy138);
+ yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy46, 0);
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy46, pSelect);
+ if( yymsp[-3].minor.yy32 ) yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy46, 0);
}
break;
- case 207: /* expr ::= EXISTS LP select RP */
+ case 210: /* expr ::= EXISTS LP select RP */
{
Expr *p;
- p = yymsp[-3].minor.yy102 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
- sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy391);
+ p = yymsp[-3].minor.yy46 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
+ sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy25);
}
break;
- case 208: /* expr ::= CASE case_operand case_exprlist case_else END */
+ case 211: /* expr ::= CASE case_operand case_exprlist case_else END */
{
- yymsp[-4].minor.yy102 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy102, 0);
- if( yymsp[-4].minor.yy102 ){
- yymsp[-4].minor.yy102->x.pList = yymsp[-1].minor.yy102 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy94,yymsp[-1].minor.yy102) : yymsp[-2].minor.yy94;
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy102);
+ yymsp[-4].minor.yy46 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy46, 0);
+ if( yymsp[-4].minor.yy46 ){
+ yymsp[-4].minor.yy46->x.pList = yymsp[-1].minor.yy46 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy138,yymsp[-1].minor.yy46) : yymsp[-2].minor.yy138;
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy46);
}else{
- sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy94);
- sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy102);
+ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy138);
+ sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy46);
}
}
break;
- case 209: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
+ case 212: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
- yymsp[-4].minor.yy94 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy94, yymsp[-2].minor.yy102);
- yymsp[-4].minor.yy94 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy94, yymsp[0].minor.yy102);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy138, yymsp[-2].minor.yy46);
+ yymsp[-4].minor.yy138 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy138, yymsp[0].minor.yy46);
}
break;
- case 210: /* case_exprlist ::= WHEN expr THEN expr */
+ case 213: /* case_exprlist ::= WHEN expr THEN expr */
{
- yymsp[-3].minor.yy94 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy102);
- yymsp[-3].minor.yy94 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy94, yymsp[0].minor.yy102);
+ yymsp[-3].minor.yy138 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy46);
+ yymsp[-3].minor.yy138 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy138, yymsp[0].minor.yy46);
}
break;
- case 213: /* case_operand ::= expr */
-{yymsp[0].minor.yy102 = yymsp[0].minor.yy102; /*A-overwrites-X*/}
+ case 216: /* case_operand ::= expr */
+{yymsp[0].minor.yy46 = yymsp[0].minor.yy46; /*A-overwrites-X*/}
break;
- case 216: /* nexprlist ::= nexprlist COMMA expr */
-{yymsp[-2].minor.yy94 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy94,yymsp[0].minor.yy102);}
+ case 219: /* nexprlist ::= nexprlist COMMA expr */
+{yymsp[-2].minor.yy138 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy138,yymsp[0].minor.yy46);}
break;
- case 217: /* nexprlist ::= expr */
-{yymsp[0].minor.yy94 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy102); /*A-overwrites-Y*/}
+ case 220: /* nexprlist ::= expr */
+{yymsp[0].minor.yy138 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy46); /*A-overwrites-Y*/}
break;
- case 219: /* paren_exprlist ::= LP exprlist RP */
- case 224: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==224);
-{yymsp[-2].minor.yy94 = yymsp[-1].minor.yy94;}
+ case 222: /* paren_exprlist ::= LP exprlist RP */
+ case 227: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==227);
+{yymsp[-2].minor.yy138 = yymsp[-1].minor.yy138;}
break;
- case 220: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
+ case 223: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
{
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
- sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy94, yymsp[-10].minor.yy100,
- &yymsp[-11].minor.yy0, yymsp[0].minor.yy102, SQLITE_SO_ASC, yymsp[-8].minor.yy100, SQLITE_IDXTYPE_APPDEF);
+ sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy138, yymsp[-10].minor.yy32,
+ &yymsp[-11].minor.yy0, yymsp[0].minor.yy46, SQLITE_SO_ASC, yymsp[-8].minor.yy32, SQLITE_IDXTYPE_APPDEF);
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
}
}
break;
- case 221: /* uniqueflag ::= UNIQUE */
- case 263: /* raisetype ::= ABORT */ yytestcase(yyruleno==263);
-{yymsp[0].minor.yy100 = OE_Abort;}
+ case 224: /* uniqueflag ::= UNIQUE */
+ case 266: /* raisetype ::= ABORT */ yytestcase(yyruleno==266);
+{yymsp[0].minor.yy32 = OE_Abort;}
break;
- case 222: /* uniqueflag ::= */
-{yymsp[1].minor.yy100 = OE_None;}
+ case 225: /* uniqueflag ::= */
+{yymsp[1].minor.yy32 = OE_None;}
break;
- case 225: /* eidlist ::= eidlist COMMA nm collate sortorder */
+ case 228: /* eidlist ::= eidlist COMMA nm collate sortorder */
{
- yymsp[-4].minor.yy94 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy94, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy100, yymsp[0].minor.yy100);
+ yymsp[-4].minor.yy138 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy138, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy32, yymsp[0].minor.yy32);
}
break;
- case 226: /* eidlist ::= nm collate sortorder */
+ case 229: /* eidlist ::= nm collate sortorder */
{
- yymsp[-2].minor.yy94 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy100, yymsp[0].minor.yy100); /*A-overwrites-Y*/
+ yymsp[-2].minor.yy138 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy32, yymsp[0].minor.yy32); /*A-overwrites-Y*/
}
break;
- case 229: /* cmd ::= DROP INDEX ifexists fullname */
-{sqlite3DropIndex(pParse, yymsp[0].minor.yy407, yymsp[-1].minor.yy100);}
+ case 232: /* cmd ::= DROP INDEX ifexists fullname */
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy609, yymsp[-1].minor.yy32);}
break;
- case 230: /* cmd ::= VACUUM vinto */
-{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy102);}
+ case 233: /* cmd ::= VACUUM vinto */
+{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy46);}
break;
- case 231: /* cmd ::= VACUUM nm vinto */
-{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy102);}
+ case 234: /* cmd ::= VACUUM nm vinto */
+{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy46);}
break;
- case 234: /* cmd ::= PRAGMA nm dbnm */
+ case 237: /* cmd ::= PRAGMA nm dbnm */
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
break;
- case 235: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
+ case 238: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
break;
- case 236: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ case 239: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
break;
- case 237: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
+ case 240: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
break;
- case 238: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ case 241: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
break;
- case 241: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ case 244: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
Token all;
all.z = yymsp[-3].minor.yy0.z;
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
- sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy11, &all);
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy527, &all);
}
break;
- case 242: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ case 245: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
- sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy100, yymsp[-4].minor.yy298.a, yymsp[-4].minor.yy298.b, yymsp[-2].minor.yy407, yymsp[0].minor.yy102, yymsp[-10].minor.yy100, yymsp[-8].minor.yy100);
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy32, yymsp[-4].minor.yy572.a, yymsp[-4].minor.yy572.b, yymsp[-2].minor.yy609, yymsp[0].minor.yy46, yymsp[-10].minor.yy32, yymsp[-8].minor.yy32);
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
}
break;
- case 243: /* trigger_time ::= BEFORE|AFTER */
-{ yymsp[0].minor.yy100 = yymsp[0].major; /*A-overwrites-X*/ }
+ case 246: /* trigger_time ::= BEFORE|AFTER */
+{ yymsp[0].minor.yy32 = yymsp[0].major; /*A-overwrites-X*/ }
break;
- case 244: /* trigger_time ::= INSTEAD OF */
-{ yymsp[-1].minor.yy100 = TK_INSTEAD;}
+ case 247: /* trigger_time ::= INSTEAD OF */
+{ yymsp[-1].minor.yy32 = TK_INSTEAD;}
break;
- case 245: /* trigger_time ::= */
-{ yymsp[1].minor.yy100 = TK_BEFORE; }
+ case 248: /* trigger_time ::= */
+{ yymsp[1].minor.yy32 = TK_BEFORE; }
break;
- case 246: /* trigger_event ::= DELETE|INSERT */
- case 247: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==247);
-{yymsp[0].minor.yy298.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy298.b = 0;}
+ case 249: /* trigger_event ::= DELETE|INSERT */
+ case 250: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==250);
+{yymsp[0].minor.yy572.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy572.b = 0;}
break;
- case 248: /* trigger_event ::= UPDATE OF idlist */
-{yymsp[-2].minor.yy298.a = TK_UPDATE; yymsp[-2].minor.yy298.b = yymsp[0].minor.yy76;}
+ case 251: /* trigger_event ::= UPDATE OF idlist */
+{yymsp[-2].minor.yy572.a = TK_UPDATE; yymsp[-2].minor.yy572.b = yymsp[0].minor.yy406;}
break;
- case 249: /* when_clause ::= */
- case 268: /* key_opt ::= */ yytestcase(yyruleno==268);
- case 316: /* filter_opt ::= */ yytestcase(yyruleno==316);
-{ yymsp[1].minor.yy102 = 0; }
+ case 252: /* when_clause ::= */
+ case 271: /* key_opt ::= */ yytestcase(yyruleno==271);
+{ yymsp[1].minor.yy46 = 0; }
break;
- case 250: /* when_clause ::= WHEN expr */
- case 269: /* key_opt ::= KEY expr */ yytestcase(yyruleno==269);
-{ yymsp[-1].minor.yy102 = yymsp[0].minor.yy102; }
+ case 253: /* when_clause ::= WHEN expr */
+ case 272: /* key_opt ::= KEY expr */ yytestcase(yyruleno==272);
+{ yymsp[-1].minor.yy46 = yymsp[0].minor.yy46; }
break;
- case 251: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ case 254: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
- assert( yymsp[-2].minor.yy11!=0 );
- yymsp[-2].minor.yy11->pLast->pNext = yymsp[-1].minor.yy11;
- yymsp[-2].minor.yy11->pLast = yymsp[-1].minor.yy11;
+ assert( yymsp[-2].minor.yy527!=0 );
+ yymsp[-2].minor.yy527->pLast->pNext = yymsp[-1].minor.yy527;
+ yymsp[-2].minor.yy527->pLast = yymsp[-1].minor.yy527;
}
break;
- case 252: /* trigger_cmd_list ::= trigger_cmd SEMI */
+ case 255: /* trigger_cmd_list ::= trigger_cmd SEMI */
{
- assert( yymsp[-1].minor.yy11!=0 );
- yymsp[-1].minor.yy11->pLast = yymsp[-1].minor.yy11;
+ assert( yymsp[-1].minor.yy527!=0 );
+ yymsp[-1].minor.yy527->pLast = yymsp[-1].minor.yy527;
}
break;
- case 253: /* trnm ::= nm DOT nm */
+ case 256: /* trnm ::= nm DOT nm */
{
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
sqlite3ErrorMsg(pParse,
@@ -152984,328 +154002,342 @@ static YYACTIONTYPE yy_reduce(
"statements within triggers");
}
break;
- case 254: /* tridxby ::= INDEXED BY nm */
+ case 257: /* tridxby ::= INDEXED BY nm */
{
sqlite3ErrorMsg(pParse,
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
- case 255: /* tridxby ::= NOT INDEXED */
+ case 258: /* tridxby ::= NOT INDEXED */
{
sqlite3ErrorMsg(pParse,
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
- case 256: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
-{yylhsminor.yy11 = sqlite3TriggerUpdateStep(pParse, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy94, yymsp[-1].minor.yy102, yymsp[-6].minor.yy100, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy528);}
- yymsp[-7].minor.yy11 = yylhsminor.yy11;
+ case 259: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+{yylhsminor.yy527 = sqlite3TriggerUpdateStep(pParse, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy138, yymsp[-1].minor.yy46, yymsp[-6].minor.yy32, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy8);}
+ yymsp[-7].minor.yy527 = yylhsminor.yy527;
break;
- case 257: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ case 260: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
{
- yylhsminor.yy11 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy76,yymsp[-2].minor.yy391,yymsp[-6].minor.yy100,yymsp[-1].minor.yy95,yymsp[-7].minor.yy528,yymsp[0].minor.yy528);/*yylhsminor.yy11-overwrites-yymsp[-6].minor.yy100*/
+ yylhsminor.yy527 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy406,yymsp[-2].minor.yy25,yymsp[-6].minor.yy32,yymsp[-1].minor.yy288,yymsp[-7].minor.yy8,yymsp[0].minor.yy8);/*yylhsminor.yy527-overwrites-yymsp[-6].minor.yy32*/
}
- yymsp[-7].minor.yy11 = yylhsminor.yy11;
+ yymsp[-7].minor.yy527 = yylhsminor.yy527;
break;
- case 258: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
-{yylhsminor.yy11 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy102, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy528);}
- yymsp[-5].minor.yy11 = yylhsminor.yy11;
+ case 261: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+{yylhsminor.yy527 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy46, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy8);}
+ yymsp[-5].minor.yy527 = yylhsminor.yy527;
break;
- case 259: /* trigger_cmd ::= scanpt select scanpt */
-{yylhsminor.yy11 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy391, yymsp[-2].minor.yy528, yymsp[0].minor.yy528); /*yylhsminor.yy11-overwrites-yymsp[-1].minor.yy391*/}
- yymsp[-2].minor.yy11 = yylhsminor.yy11;
+ case 262: /* trigger_cmd ::= scanpt select scanpt */
+{yylhsminor.yy527 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy25, yymsp[-2].minor.yy8, yymsp[0].minor.yy8); /*yylhsminor.yy527-overwrites-yymsp[-1].minor.yy25*/}
+ yymsp[-2].minor.yy527 = yylhsminor.yy527;
break;
- case 260: /* expr ::= RAISE LP IGNORE RP */
+ case 263: /* expr ::= RAISE LP IGNORE RP */
{
- yymsp[-3].minor.yy102 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
- if( yymsp[-3].minor.yy102 ){
- yymsp[-3].minor.yy102->affinity = OE_Ignore;
+ yymsp[-3].minor.yy46 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
+ if( yymsp[-3].minor.yy46 ){
+ yymsp[-3].minor.yy46->affExpr = OE_Ignore;
}
}
break;
- case 261: /* expr ::= RAISE LP raisetype COMMA nm RP */
+ case 264: /* expr ::= RAISE LP raisetype COMMA nm RP */
{
- yymsp[-5].minor.yy102 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
- if( yymsp[-5].minor.yy102 ) {
- yymsp[-5].minor.yy102->affinity = (char)yymsp[-3].minor.yy100;
+ yymsp[-5].minor.yy46 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
+ if( yymsp[-5].minor.yy46 ) {
+ yymsp[-5].minor.yy46->affExpr = (char)yymsp[-3].minor.yy32;
}
}
break;
- case 262: /* raisetype ::= ROLLBACK */
-{yymsp[0].minor.yy100 = OE_Rollback;}
+ case 265: /* raisetype ::= ROLLBACK */
+{yymsp[0].minor.yy32 = OE_Rollback;}
break;
- case 264: /* raisetype ::= FAIL */
-{yymsp[0].minor.yy100 = OE_Fail;}
+ case 267: /* raisetype ::= FAIL */
+{yymsp[0].minor.yy32 = OE_Fail;}
break;
- case 265: /* cmd ::= DROP TRIGGER ifexists fullname */
+ case 268: /* cmd ::= DROP TRIGGER ifexists fullname */
{
- sqlite3DropTrigger(pParse,yymsp[0].minor.yy407,yymsp[-1].minor.yy100);
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy609,yymsp[-1].minor.yy32);
}
break;
- case 266: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ case 269: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
- sqlite3Attach(pParse, yymsp[-3].minor.yy102, yymsp[-1].minor.yy102, yymsp[0].minor.yy102);
+ sqlite3Attach(pParse, yymsp[-3].minor.yy46, yymsp[-1].minor.yy46, yymsp[0].minor.yy46);
}
break;
- case 267: /* cmd ::= DETACH database_kw_opt expr */
+ case 270: /* cmd ::= DETACH database_kw_opt expr */
{
- sqlite3Detach(pParse, yymsp[0].minor.yy102);
+ sqlite3Detach(pParse, yymsp[0].minor.yy46);
}
break;
- case 270: /* cmd ::= REINDEX */
+ case 273: /* cmd ::= REINDEX */
{sqlite3Reindex(pParse, 0, 0);}
break;
- case 271: /* cmd ::= REINDEX nm dbnm */
+ case 274: /* cmd ::= REINDEX nm dbnm */
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
- case 272: /* cmd ::= ANALYZE */
+ case 275: /* cmd ::= ANALYZE */
{sqlite3Analyze(pParse, 0, 0);}
break;
- case 273: /* cmd ::= ANALYZE nm dbnm */
+ case 276: /* cmd ::= ANALYZE nm dbnm */
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
- case 274: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
+ case 277: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
- sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy407,&yymsp[0].minor.yy0);
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy609,&yymsp[0].minor.yy0);
}
break;
- case 275: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ case 278: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
{
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
}
break;
- case 276: /* add_column_fullname ::= fullname */
+ case 279: /* add_column_fullname ::= fullname */
{
disableLookaside(pParse);
- sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy407);
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy609);
}
break;
- case 277: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ case 280: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
{
- sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy407, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
+ sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy609, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
break;
- case 278: /* cmd ::= create_vtab */
+ case 281: /* cmd ::= create_vtab */
{sqlite3VtabFinishParse(pParse,0);}
break;
- case 279: /* cmd ::= create_vtab LP vtabarglist RP */
+ case 282: /* cmd ::= create_vtab LP vtabarglist RP */
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
break;
- case 280: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ case 283: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
- sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy100);
+ sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy32);
}
break;
- case 281: /* vtabarg ::= */
+ case 284: /* vtabarg ::= */
{sqlite3VtabArgInit(pParse);}
break;
- case 282: /* vtabargtoken ::= ANY */
- case 283: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==283);
- case 284: /* lp ::= LP */ yytestcase(yyruleno==284);
+ case 285: /* vtabargtoken ::= ANY */
+ case 286: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==286);
+ case 287: /* lp ::= LP */ yytestcase(yyruleno==287);
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
break;
- case 285: /* with ::= WITH wqlist */
- case 286: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==286);
-{ sqlite3WithPush(pParse, yymsp[0].minor.yy243, 1); }
+ case 288: /* with ::= WITH wqlist */
+ case 289: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==289);
+{ sqlite3WithPush(pParse, yymsp[0].minor.yy297, 1); }
break;
- case 287: /* wqlist ::= nm eidlist_opt AS LP select RP */
+ case 290: /* wqlist ::= nm eidlist_opt AS LP select RP */
{
- yymsp[-5].minor.yy243 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy94, yymsp[-1].minor.yy391); /*A-overwrites-X*/
+ yymsp[-5].minor.yy297 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy138, yymsp[-1].minor.yy25); /*A-overwrites-X*/
}
break;
- case 288: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
+ case 291: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
{
- yymsp[-7].minor.yy243 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy243, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy94, yymsp[-1].minor.yy391);
+ yymsp[-7].minor.yy297 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy297, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy138, yymsp[-1].minor.yy25);
}
break;
- case 289: /* windowdefn_list ::= windowdefn */
-{ yylhsminor.yy379 = yymsp[0].minor.yy379; }
- yymsp[0].minor.yy379 = yylhsminor.yy379;
+ case 292: /* windowdefn_list ::= windowdefn */
+{ yylhsminor.yy455 = yymsp[0].minor.yy455; }
+ yymsp[0].minor.yy455 = yylhsminor.yy455;
break;
- case 290: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ case 293: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
{
- assert( yymsp[0].minor.yy379!=0 );
- sqlite3WindowChain(pParse, yymsp[0].minor.yy379, yymsp[-2].minor.yy379);
- yymsp[0].minor.yy379->pNextWin = yymsp[-2].minor.yy379;
- yylhsminor.yy379 = yymsp[0].minor.yy379;
+ assert( yymsp[0].minor.yy455!=0 );
+ sqlite3WindowChain(pParse, yymsp[0].minor.yy455, yymsp[-2].minor.yy455);
+ yymsp[0].minor.yy455->pNextWin = yymsp[-2].minor.yy455;
+ yylhsminor.yy455 = yymsp[0].minor.yy455;
}
- yymsp[-2].minor.yy379 = yylhsminor.yy379;
+ yymsp[-2].minor.yy455 = yylhsminor.yy455;
break;
- case 291: /* windowdefn ::= nm AS LP window RP */
+ case 294: /* windowdefn ::= nm AS LP window RP */
{
- if( ALWAYS(yymsp[-1].minor.yy379) ){
- yymsp[-1].minor.yy379->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
+ if( ALWAYS(yymsp[-1].minor.yy455) ){
+ yymsp[-1].minor.yy455->zName = sqlite3DbStrNDup(pParse->db, yymsp[-4].minor.yy0.z, yymsp[-4].minor.yy0.n);
}
- yylhsminor.yy379 = yymsp[-1].minor.yy379;
+ yylhsminor.yy455 = yymsp[-1].minor.yy455;
}
- yymsp[-4].minor.yy379 = yylhsminor.yy379;
+ yymsp[-4].minor.yy455 = yylhsminor.yy455;
break;
- case 292: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
+ case 295: /* window ::= PARTITION BY nexprlist orderby_opt frame_opt */
{
- yymsp[-4].minor.yy379 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy379, yymsp[-2].minor.yy94, yymsp[-1].minor.yy94, 0);
+ yymsp[-4].minor.yy455 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy455, yymsp[-2].minor.yy138, yymsp[-1].minor.yy138, 0);
}
break;
- case 293: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
+ case 296: /* window ::= nm PARTITION BY nexprlist orderby_opt frame_opt */
{
- yylhsminor.yy379 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy379, yymsp[-2].minor.yy94, yymsp[-1].minor.yy94, &yymsp[-5].minor.yy0);
+ yylhsminor.yy455 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy455, yymsp[-2].minor.yy138, yymsp[-1].minor.yy138, &yymsp[-5].minor.yy0);
}
- yymsp[-5].minor.yy379 = yylhsminor.yy379;
+ yymsp[-5].minor.yy455 = yylhsminor.yy455;
break;
- case 294: /* window ::= ORDER BY sortlist frame_opt */
+ case 297: /* window ::= ORDER BY sortlist frame_opt */
{
- yymsp[-3].minor.yy379 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy379, 0, yymsp[-1].minor.yy94, 0);
+ yymsp[-3].minor.yy455 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy455, 0, yymsp[-1].minor.yy138, 0);
}
break;
- case 295: /* window ::= nm ORDER BY sortlist frame_opt */
+ case 298: /* window ::= nm ORDER BY sortlist frame_opt */
{
- yylhsminor.yy379 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy379, 0, yymsp[-1].minor.yy94, &yymsp[-4].minor.yy0);
+ yylhsminor.yy455 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy455, 0, yymsp[-1].minor.yy138, &yymsp[-4].minor.yy0);
}
- yymsp[-4].minor.yy379 = yylhsminor.yy379;
+ yymsp[-4].minor.yy455 = yylhsminor.yy455;
break;
- case 296: /* window ::= frame_opt */
+ case 299: /* window ::= frame_opt */
+ case 318: /* filter_over ::= over_clause */ yytestcase(yyruleno==318);
{
- yylhsminor.yy379 = yymsp[0].minor.yy379;
+ yylhsminor.yy455 = yymsp[0].minor.yy455;
}
- yymsp[0].minor.yy379 = yylhsminor.yy379;
+ yymsp[0].minor.yy455 = yylhsminor.yy455;
break;
- case 297: /* window ::= nm frame_opt */
+ case 300: /* window ::= nm frame_opt */
{
- yylhsminor.yy379 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy379, 0, 0, &yymsp[-1].minor.yy0);
+ yylhsminor.yy455 = sqlite3WindowAssemble(pParse, yymsp[0].minor.yy455, 0, 0, &yymsp[-1].minor.yy0);
}
- yymsp[-1].minor.yy379 = yylhsminor.yy379;
+ yymsp[-1].minor.yy455 = yylhsminor.yy455;
break;
- case 298: /* frame_opt ::= */
+ case 301: /* frame_opt ::= */
{
- yymsp[1].minor.yy379 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
+ yymsp[1].minor.yy455 = sqlite3WindowAlloc(pParse, 0, TK_UNBOUNDED, 0, TK_CURRENT, 0, 0);
}
break;
- case 299: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
+ case 302: /* frame_opt ::= range_or_rows frame_bound_s frame_exclude_opt */
{
- yylhsminor.yy379 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy100, yymsp[-1].minor.yy389.eType, yymsp[-1].minor.yy389.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy218);
+ yylhsminor.yy455 = sqlite3WindowAlloc(pParse, yymsp[-2].minor.yy32, yymsp[-1].minor.yy57.eType, yymsp[-1].minor.yy57.pExpr, TK_CURRENT, 0, yymsp[0].minor.yy118);
}
- yymsp[-2].minor.yy379 = yylhsminor.yy379;
+ yymsp[-2].minor.yy455 = yylhsminor.yy455;
break;
- case 300: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
+ case 303: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e frame_exclude_opt */
{
- yylhsminor.yy379 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy100, yymsp[-3].minor.yy389.eType, yymsp[-3].minor.yy389.pExpr, yymsp[-1].minor.yy389.eType, yymsp[-1].minor.yy389.pExpr, yymsp[0].minor.yy218);
+ yylhsminor.yy455 = sqlite3WindowAlloc(pParse, yymsp[-5].minor.yy32, yymsp[-3].minor.yy57.eType, yymsp[-3].minor.yy57.pExpr, yymsp[-1].minor.yy57.eType, yymsp[-1].minor.yy57.pExpr, yymsp[0].minor.yy118);
}
- yymsp[-5].minor.yy379 = yylhsminor.yy379;
+ yymsp[-5].minor.yy455 = yylhsminor.yy455;
break;
- case 302: /* frame_bound_s ::= frame_bound */
- case 304: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==304);
-{yylhsminor.yy389 = yymsp[0].minor.yy389;}
- yymsp[0].minor.yy389 = yylhsminor.yy389;
+ case 305: /* frame_bound_s ::= frame_bound */
+ case 307: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==307);
+{yylhsminor.yy57 = yymsp[0].minor.yy57;}
+ yymsp[0].minor.yy57 = yylhsminor.yy57;
break;
- case 303: /* frame_bound_s ::= UNBOUNDED PRECEDING */
- case 305: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==305);
- case 307: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==307);
-{yylhsminor.yy389.eType = yymsp[-1].major; yylhsminor.yy389.pExpr = 0;}
- yymsp[-1].minor.yy389 = yylhsminor.yy389;
+ case 306: /* frame_bound_s ::= UNBOUNDED PRECEDING */
+ case 308: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==308);
+ case 310: /* frame_bound ::= CURRENT ROW */ yytestcase(yyruleno==310);
+{yylhsminor.yy57.eType = yymsp[-1].major; yylhsminor.yy57.pExpr = 0;}
+ yymsp[-1].minor.yy57 = yylhsminor.yy57;
break;
- case 306: /* frame_bound ::= expr PRECEDING|FOLLOWING */
-{yylhsminor.yy389.eType = yymsp[0].major; yylhsminor.yy389.pExpr = yymsp[-1].minor.yy102;}
- yymsp[-1].minor.yy389 = yylhsminor.yy389;
+ case 309: /* frame_bound ::= expr PRECEDING|FOLLOWING */
+{yylhsminor.yy57.eType = yymsp[0].major; yylhsminor.yy57.pExpr = yymsp[-1].minor.yy46;}
+ yymsp[-1].minor.yy57 = yylhsminor.yy57;
break;
- case 308: /* frame_exclude_opt ::= */
-{yymsp[1].minor.yy218 = 0;}
+ case 311: /* frame_exclude_opt ::= */
+{yymsp[1].minor.yy118 = 0;}
break;
- case 309: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
-{yymsp[-1].minor.yy218 = yymsp[0].minor.yy218;}
+ case 312: /* frame_exclude_opt ::= EXCLUDE frame_exclude */
+{yymsp[-1].minor.yy118 = yymsp[0].minor.yy118;}
break;
- case 310: /* frame_exclude ::= NO OTHERS */
- case 311: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==311);
-{yymsp[-1].minor.yy218 = yymsp[-1].major; /*A-overwrites-X*/}
+ case 313: /* frame_exclude ::= NO OTHERS */
+ case 314: /* frame_exclude ::= CURRENT ROW */ yytestcase(yyruleno==314);
+{yymsp[-1].minor.yy118 = yymsp[-1].major; /*A-overwrites-X*/}
break;
- case 312: /* frame_exclude ::= GROUP|TIES */
-{yymsp[0].minor.yy218 = yymsp[0].major; /*A-overwrites-X*/}
+ case 315: /* frame_exclude ::= GROUP|TIES */
+{yymsp[0].minor.yy118 = yymsp[0].major; /*A-overwrites-X*/}
break;
- case 313: /* window_clause ::= WINDOW windowdefn_list */
-{ yymsp[-1].minor.yy379 = yymsp[0].minor.yy379; }
+ case 316: /* window_clause ::= WINDOW windowdefn_list */
+{ yymsp[-1].minor.yy455 = yymsp[0].minor.yy455; }
break;
- case 314: /* over_clause ::= filter_opt OVER LP window RP */
+ case 317: /* filter_over ::= filter_clause over_clause */
{
- yylhsminor.yy379 = yymsp[-1].minor.yy379;
- assert( yylhsminor.yy379!=0 );
- yylhsminor.yy379->pFilter = yymsp[-4].minor.yy102;
+ yymsp[0].minor.yy455->pFilter = yymsp[-1].minor.yy46;
+ yylhsminor.yy455 = yymsp[0].minor.yy455;
}
- yymsp[-4].minor.yy379 = yylhsminor.yy379;
+ yymsp[-1].minor.yy455 = yylhsminor.yy455;
break;
- case 315: /* over_clause ::= filter_opt OVER nm */
+ case 319: /* filter_over ::= filter_clause */
{
- yylhsminor.yy379 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
- if( yylhsminor.yy379 ){
- yylhsminor.yy379->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
- yylhsminor.yy379->pFilter = yymsp[-2].minor.yy102;
+ yylhsminor.yy455 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
+ if( yylhsminor.yy455 ){
+ yylhsminor.yy455->eFrmType = TK_FILTER;
+ yylhsminor.yy455->pFilter = yymsp[0].minor.yy46;
}else{
- sqlite3ExprDelete(pParse->db, yymsp[-2].minor.yy102);
+ sqlite3ExprDelete(pParse->db, yymsp[0].minor.yy46);
}
}
- yymsp[-2].minor.yy379 = yylhsminor.yy379;
+ yymsp[0].minor.yy455 = yylhsminor.yy455;
break;
- case 317: /* filter_opt ::= FILTER LP WHERE expr RP */
-{ yymsp[-4].minor.yy102 = yymsp[-1].minor.yy102; }
+ case 320: /* over_clause ::= OVER LP window RP */
+{
+ yymsp[-3].minor.yy455 = yymsp[-1].minor.yy455;
+ assert( yymsp[-3].minor.yy455!=0 );
+}
+ break;
+ case 321: /* over_clause ::= OVER nm */
+{
+ yymsp[-1].minor.yy455 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
+ if( yymsp[-1].minor.yy455 ){
+ yymsp[-1].minor.yy455->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
+ }
+}
+ break;
+ case 322: /* filter_clause ::= FILTER LP WHERE expr RP */
+{ yymsp[-4].minor.yy46 = yymsp[-1].minor.yy46; }
break;
default:
- /* (318) input ::= cmdlist */ yytestcase(yyruleno==318);
- /* (319) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==319);
- /* (320) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=320);
- /* (321) ecmd ::= SEMI */ yytestcase(yyruleno==321);
- /* (322) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==322);
- /* (323) ecmd ::= explain cmdx */ yytestcase(yyruleno==323);
- /* (324) trans_opt ::= */ yytestcase(yyruleno==324);
- /* (325) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==325);
- /* (326) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==326);
- /* (327) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==327);
- /* (328) savepoint_opt ::= */ yytestcase(yyruleno==328);
- /* (329) cmd ::= create_table create_table_args */ yytestcase(yyruleno==329);
- /* (330) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==330);
- /* (331) columnlist ::= columnname carglist */ yytestcase(yyruleno==331);
- /* (332) nm ::= ID|INDEXED */ yytestcase(yyruleno==332);
- /* (333) nm ::= STRING */ yytestcase(yyruleno==333);
- /* (334) nm ::= JOIN_KW */ yytestcase(yyruleno==334);
- /* (335) typetoken ::= typename */ yytestcase(yyruleno==335);
- /* (336) typename ::= ID|STRING */ yytestcase(yyruleno==336);
- /* (337) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=337);
- /* (338) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=338);
- /* (339) carglist ::= carglist ccons */ yytestcase(yyruleno==339);
- /* (340) carglist ::= */ yytestcase(yyruleno==340);
- /* (341) ccons ::= NULL onconf */ yytestcase(yyruleno==341);
- /* (342) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==342);
- /* (343) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==343);
- /* (344) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=344);
- /* (345) tconscomma ::= */ yytestcase(yyruleno==345);
- /* (346) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=346);
- /* (347) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=347);
- /* (348) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=348);
- /* (349) oneselect ::= values */ yytestcase(yyruleno==349);
- /* (350) sclp ::= selcollist COMMA */ yytestcase(yyruleno==350);
- /* (351) as ::= ID|STRING */ yytestcase(yyruleno==351);
- /* (352) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=352);
- /* (353) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==353);
- /* (354) exprlist ::= nexprlist */ yytestcase(yyruleno==354);
- /* (355) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=355);
- /* (356) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=356);
- /* (357) nmnum ::= ON */ yytestcase(yyruleno==357);
- /* (358) nmnum ::= DELETE */ yytestcase(yyruleno==358);
- /* (359) nmnum ::= DEFAULT */ yytestcase(yyruleno==359);
- /* (360) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==360);
- /* (361) foreach_clause ::= */ yytestcase(yyruleno==361);
- /* (362) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==362);
- /* (363) trnm ::= nm */ yytestcase(yyruleno==363);
- /* (364) tridxby ::= */ yytestcase(yyruleno==364);
- /* (365) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==365);
- /* (366) database_kw_opt ::= */ yytestcase(yyruleno==366);
- /* (367) kwcolumn_opt ::= */ yytestcase(yyruleno==367);
- /* (368) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==368);
- /* (369) vtabarglist ::= vtabarg */ yytestcase(yyruleno==369);
- /* (370) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==370);
- /* (371) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==371);
- /* (372) anylist ::= */ yytestcase(yyruleno==372);
- /* (373) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==373);
- /* (374) anylist ::= anylist ANY */ yytestcase(yyruleno==374);
- /* (375) with ::= */ yytestcase(yyruleno==375);
+ /* (323) input ::= cmdlist */ yytestcase(yyruleno==323);
+ /* (324) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==324);
+ /* (325) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=325);
+ /* (326) ecmd ::= SEMI */ yytestcase(yyruleno==326);
+ /* (327) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==327);
+ /* (328) ecmd ::= explain cmdx */ yytestcase(yyruleno==328);
+ /* (329) trans_opt ::= */ yytestcase(yyruleno==329);
+ /* (330) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==330);
+ /* (331) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==331);
+ /* (332) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==332);
+ /* (333) savepoint_opt ::= */ yytestcase(yyruleno==333);
+ /* (334) cmd ::= create_table create_table_args */ yytestcase(yyruleno==334);
+ /* (335) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==335);
+ /* (336) columnlist ::= columnname carglist */ yytestcase(yyruleno==336);
+ /* (337) nm ::= ID|INDEXED */ yytestcase(yyruleno==337);
+ /* (338) nm ::= STRING */ yytestcase(yyruleno==338);
+ /* (339) nm ::= JOIN_KW */ yytestcase(yyruleno==339);
+ /* (340) typetoken ::= typename */ yytestcase(yyruleno==340);
+ /* (341) typename ::= ID|STRING */ yytestcase(yyruleno==341);
+ /* (342) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=342);
+ /* (343) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=343);
+ /* (344) carglist ::= carglist ccons */ yytestcase(yyruleno==344);
+ /* (345) carglist ::= */ yytestcase(yyruleno==345);
+ /* (346) ccons ::= NULL onconf */ yytestcase(yyruleno==346);
+ /* (347) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==347);
+ /* (348) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==348);
+ /* (349) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=349);
+ /* (350) tconscomma ::= */ yytestcase(yyruleno==350);
+ /* (351) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=351);
+ /* (352) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=352);
+ /* (353) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=353);
+ /* (354) oneselect ::= values */ yytestcase(yyruleno==354);
+ /* (355) sclp ::= selcollist COMMA */ yytestcase(yyruleno==355);
+ /* (356) as ::= ID|STRING */ yytestcase(yyruleno==356);
+ /* (357) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=357);
+ /* (358) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==358);
+ /* (359) exprlist ::= nexprlist */ yytestcase(yyruleno==359);
+ /* (360) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=360);
+ /* (361) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=361);
+ /* (362) nmnum ::= ON */ yytestcase(yyruleno==362);
+ /* (363) nmnum ::= DELETE */ yytestcase(yyruleno==363);
+ /* (364) nmnum ::= DEFAULT */ yytestcase(yyruleno==364);
+ /* (365) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==365);
+ /* (366) foreach_clause ::= */ yytestcase(yyruleno==366);
+ /* (367) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==367);
+ /* (368) trnm ::= nm */ yytestcase(yyruleno==368);
+ /* (369) tridxby ::= */ yytestcase(yyruleno==369);
+ /* (370) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==370);
+ /* (371) database_kw_opt ::= */ yytestcase(yyruleno==371);
+ /* (372) kwcolumn_opt ::= */ yytestcase(yyruleno==372);
+ /* (373) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==373);
+ /* (374) vtabarglist ::= vtabarg */ yytestcase(yyruleno==374);
+ /* (375) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==375);
+ /* (376) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==376);
+ /* (377) anylist ::= */ yytestcase(yyruleno==377);
+ /* (378) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==378);
+ /* (379) anylist ::= anylist ANY */ yytestcase(yyruleno==379);
+ /* (380) with ::= */ yytestcase(yyruleno==380);
break;
/********** End reduce actions ************************************************/
};
@@ -153597,9 +154629,8 @@ SQLITE_PRIVATE void sqlite3Parser(
*/
SQLITE_PRIVATE int sqlite3ParserFallback(int iToken){
#ifdef YYFALLBACK
- if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
- return yyFallback[iToken];
- }
+ assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
+ return yyFallback[iToken];
#else
(void)iToken;
#endif
@@ -153768,144 +154799,146 @@ const unsigned char ebcdicToAscii[] = {
** is substantially reduced. This is important for embedded applications
** on platforms with limited memory.
*/
-/* Hash score: 214 */
-/* zKWText[] encodes 950 bytes of keyword text in 629 bytes */
+/* Hash score: 221 */
+/* zKWText[] encodes 967 bytes of keyword text in 638 bytes */
/* REINDEXEDESCAPEACHECKEYBEFOREIGNOREGEXPLAINSTEADDATABASELECT */
-/* ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYCONSTRAINTERSECTIES */
-/* AVEPOINTOFFSETRANSACTIONATURALTERAISEXCEPTRIGGEREFERENCES */
-/* UNIQUERYWITHOUTERELEASEXCLUSIVEXISTSATTACHAVINGLOBEGINNERANGE */
-/* BETWEENOTHINGROUPSCASCADETACHCASECOLLATECREATECURRENT_DATE */
-/* IMMEDIATEJOINSERTLIKEMATCHPLANALYZEPRAGMABORTUPDATEVALUES */
-/* VIRTUALIMITWHENOTNULLWHERECURSIVEAFTERENAMEANDEFAULT */
+/* ABLEFTHENDEFERRABLELSEXCLUDELETEMPORARYISNULLSAVEPOINTERSECT */
+/* IESNOTNULLIKEXCEPTRANSACTIONATURALTERAISEXCLUSIVEXISTS */
+/* CONSTRAINTOFFSETRIGGEREFERENCESUNIQUERYWITHOUTERELEASEATTACH */
+/* AVINGLOBEGINNERANGEBETWEENOTHINGROUPSCASCADETACHCASECOLLATE */
+/* CREATECURRENT_DATEIMMEDIATEJOINSERTMATCHPLANALYZEPRAGMABORT */
+/* UPDATEVALUESVIRTUALASTWHENWHERECURSIVEAFTERENAMEANDEFAULT */
/* AUTOINCREMENTCASTCOLUMNCOMMITCONFLICTCROSSCURRENT_TIMESTAMP */
-/* ARTITIONDEFERREDISTINCTDROPRECEDINGFAILFILTEREPLACEFOLLOWING */
-/* FROMFULLIFISNULLORDERESTRICTOTHERSOVERIGHTROLLBACKROWS */
+/* ARTITIONDEFERREDISTINCTDROPRECEDINGFAILIMITFILTEREPLACEFIRST */
+/* FOLLOWINGFROMFULLIFORDERESTRICTOTHERSOVERIGHTROLLBACKROWS */
/* UNBOUNDEDUNIONUSINGVACUUMVIEWINDOWBYINITIALLYPRIMARY */
-static const char zKWText[628] = {
+static const char zKWText[637] = {
'R','E','I','N','D','E','X','E','D','E','S','C','A','P','E','A','C','H',
'E','C','K','E','Y','B','E','F','O','R','E','I','G','N','O','R','E','G',
'E','X','P','L','A','I','N','S','T','E','A','D','D','A','T','A','B','A',
'S','E','L','E','C','T','A','B','L','E','F','T','H','E','N','D','E','F',
'E','R','R','A','B','L','E','L','S','E','X','C','L','U','D','E','L','E',
- 'T','E','M','P','O','R','A','R','Y','C','O','N','S','T','R','A','I','N',
- 'T','E','R','S','E','C','T','I','E','S','A','V','E','P','O','I','N','T',
- 'O','F','F','S','E','T','R','A','N','S','A','C','T','I','O','N','A','T',
- 'U','R','A','L','T','E','R','A','I','S','E','X','C','E','P','T','R','I',
- 'G','G','E','R','E','F','E','R','E','N','C','E','S','U','N','I','Q','U',
- 'E','R','Y','W','I','T','H','O','U','T','E','R','E','L','E','A','S','E',
- 'X','C','L','U','S','I','V','E','X','I','S','T','S','A','T','T','A','C',
- 'H','A','V','I','N','G','L','O','B','E','G','I','N','N','E','R','A','N',
- 'G','E','B','E','T','W','E','E','N','O','T','H','I','N','G','R','O','U',
- 'P','S','C','A','S','C','A','D','E','T','A','C','H','C','A','S','E','C',
- 'O','L','L','A','T','E','C','R','E','A','T','E','C','U','R','R','E','N',
- 'T','_','D','A','T','E','I','M','M','E','D','I','A','T','E','J','O','I',
- 'N','S','E','R','T','L','I','K','E','M','A','T','C','H','P','L','A','N',
- 'A','L','Y','Z','E','P','R','A','G','M','A','B','O','R','T','U','P','D',
- 'A','T','E','V','A','L','U','E','S','V','I','R','T','U','A','L','I','M',
- 'I','T','W','H','E','N','O','T','N','U','L','L','W','H','E','R','E','C',
- 'U','R','S','I','V','E','A','F','T','E','R','E','N','A','M','E','A','N',
- 'D','E','F','A','U','L','T','A','U','T','O','I','N','C','R','E','M','E',
- 'N','T','C','A','S','T','C','O','L','U','M','N','C','O','M','M','I','T',
- 'C','O','N','F','L','I','C','T','C','R','O','S','S','C','U','R','R','E',
- 'N','T','_','T','I','M','E','S','T','A','M','P','A','R','T','I','T','I',
- 'O','N','D','E','F','E','R','R','E','D','I','S','T','I','N','C','T','D',
- 'R','O','P','R','E','C','E','D','I','N','G','F','A','I','L','F','I','L',
- 'T','E','R','E','P','L','A','C','E','F','O','L','L','O','W','I','N','G',
- 'F','R','O','M','F','U','L','L','I','F','I','S','N','U','L','L','O','R',
- 'D','E','R','E','S','T','R','I','C','T','O','T','H','E','R','S','O','V',
- 'E','R','I','G','H','T','R','O','L','L','B','A','C','K','R','O','W','S',
- 'U','N','B','O','U','N','D','E','D','U','N','I','O','N','U','S','I','N',
- 'G','V','A','C','U','U','M','V','I','E','W','I','N','D','O','W','B','Y',
- 'I','N','I','T','I','A','L','L','Y','P','R','I','M','A','R','Y',
+ 'T','E','M','P','O','R','A','R','Y','I','S','N','U','L','L','S','A','V',
+ 'E','P','O','I','N','T','E','R','S','E','C','T','I','E','S','N','O','T',
+ 'N','U','L','L','I','K','E','X','C','E','P','T','R','A','N','S','A','C',
+ 'T','I','O','N','A','T','U','R','A','L','T','E','R','A','I','S','E','X',
+ 'C','L','U','S','I','V','E','X','I','S','T','S','C','O','N','S','T','R',
+ 'A','I','N','T','O','F','F','S','E','T','R','I','G','G','E','R','E','F',
+ 'E','R','E','N','C','E','S','U','N','I','Q','U','E','R','Y','W','I','T',
+ 'H','O','U','T','E','R','E','L','E','A','S','E','A','T','T','A','C','H',
+ 'A','V','I','N','G','L','O','B','E','G','I','N','N','E','R','A','N','G',
+ 'E','B','E','T','W','E','E','N','O','T','H','I','N','G','R','O','U','P',
+ 'S','C','A','S','C','A','D','E','T','A','C','H','C','A','S','E','C','O',
+ 'L','L','A','T','E','C','R','E','A','T','E','C','U','R','R','E','N','T',
+ '_','D','A','T','E','I','M','M','E','D','I','A','T','E','J','O','I','N',
+ 'S','E','R','T','M','A','T','C','H','P','L','A','N','A','L','Y','Z','E',
+ 'P','R','A','G','M','A','B','O','R','T','U','P','D','A','T','E','V','A',
+ 'L','U','E','S','V','I','R','T','U','A','L','A','S','T','W','H','E','N',
+ 'W','H','E','R','E','C','U','R','S','I','V','E','A','F','T','E','R','E',
+ 'N','A','M','E','A','N','D','E','F','A','U','L','T','A','U','T','O','I',
+ 'N','C','R','E','M','E','N','T','C','A','S','T','C','O','L','U','M','N',
+ 'C','O','M','M','I','T','C','O','N','F','L','I','C','T','C','R','O','S',
+ 'S','C','U','R','R','E','N','T','_','T','I','M','E','S','T','A','M','P',
+ 'A','R','T','I','T','I','O','N','D','E','F','E','R','R','E','D','I','S',
+ 'T','I','N','C','T','D','R','O','P','R','E','C','E','D','I','N','G','F',
+ 'A','I','L','I','M','I','T','F','I','L','T','E','R','E','P','L','A','C',
+ 'E','F','I','R','S','T','F','O','L','L','O','W','I','N','G','F','R','O',
+ 'M','F','U','L','L','I','F','O','R','D','E','R','E','S','T','R','I','C',
+ 'T','O','T','H','E','R','S','O','V','E','R','I','G','H','T','R','O','L',
+ 'L','B','A','C','K','R','O','W','S','U','N','B','O','U','N','D','E','D',
+ 'U','N','I','O','N','U','S','I','N','G','V','A','C','U','U','M','V','I',
+ 'E','W','I','N','D','O','W','B','Y','I','N','I','T','I','A','L','L','Y',
+ 'P','R','I','M','A','R','Y',
};
/* aKWHash[i] is the hash value for the i-th keyword */
static const unsigned char aKWHash[127] = {
- 75, 111, 127, 73, 108, 29, 0, 0, 83, 0, 77, 63, 0,
- 37, 33, 78, 15, 0, 126, 86, 57, 120, 128, 19, 0, 0,
- 133, 0, 131, 123, 0, 22, 98, 0, 9, 0, 0, 117, 71,
- 0, 69, 6, 0, 49, 95, 140, 0, 129, 106, 0, 0, 54,
- 0, 109, 24, 0, 17, 0, 134, 56, 23, 26, 5, 58, 135,
- 101, 0, 0, 139, 112, 62, 138, 59, 115, 65, 0, 96, 0,
- 105, 45, 0, 104, 0, 0, 0, 100, 97, 102, 107, 119, 14,
- 31, 118, 0, 81, 0, 136, 116, 137, 61, 124, 132, 80, 121,
- 88, 30, 85, 0, 0, 99, 35, 125, 122, 0, 130, 0, 0,
- 41, 0, 91, 89, 90, 0, 20, 87, 113, 82,
+ 82, 113, 130, 80, 110, 29, 0, 0, 89, 0, 83, 70, 0,
+ 53, 35, 84, 15, 0, 129, 92, 64, 124, 131, 19, 0, 0,
+ 136, 0, 134, 126, 0, 22, 100, 0, 9, 0, 0, 121, 78,
+ 0, 76, 6, 0, 58, 97, 143, 0, 132, 108, 0, 0, 48,
+ 0, 111, 24, 0, 17, 0, 137, 63, 23, 26, 5, 65, 138,
+ 103, 120, 0, 142, 114, 69, 141, 66, 118, 72, 0, 98, 0,
+ 107, 41, 0, 106, 0, 0, 0, 102, 99, 104, 109, 123, 14,
+ 50, 122, 0, 87, 0, 139, 119, 140, 68, 127, 135, 86, 81,
+ 37, 91, 117, 0, 0, 101, 51, 128, 125, 0, 133, 0, 0,
+ 44, 0, 93, 67, 39, 0, 20, 45, 115, 88,
};
/* aKWNext[] forms the hash collision chain. If aKWHash[i]==0
** then the i-th keyword has no more hash collisions. Otherwise,
** the next keyword with the same hash is aKWHash[i]-1. */
-static const unsigned char aKWNext[140] = {
+static const unsigned char aKWNext[143] = {
0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
- 0, 0, 0, 21, 0, 0, 12, 0, 0, 0, 0, 0, 0,
- 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 51, 28, 0, 0, 38, 0, 0, 0, 44, 0, 0, 0, 3,
- 0, 0, 67, 1, 66, 0, 0, 0, 36, 0, 47, 0, 0,
- 0, 0, 0, 48, 50, 76, 0, 0, 42, 0, 60, 0, 0,
- 0, 43, 0, 16, 55, 10, 0, 0, 0, 0, 0, 0, 0,
- 11, 72, 93, 0, 0, 8, 0, 110, 0, 103, 40, 53, 70,
- 0, 114, 0, 74, 52, 0, 0, 92, 39, 46, 0, 68, 32,
- 84, 0, 34, 27, 25, 18, 94, 0, 64, 79,
+ 0, 0, 0, 21, 0, 0, 0, 0, 12, 0, 0, 0, 0,
+ 0, 0, 0, 7, 0, 36, 0, 0, 28, 0, 0, 0, 31,
+ 0, 0, 0, 40, 0, 0, 0, 0, 0, 60, 0, 54, 0,
+ 0, 38, 47, 0, 0, 0, 3, 0, 0, 74, 1, 73, 0,
+ 0, 0, 52, 0, 0, 0, 0, 0, 0, 57, 59, 56, 30,
+ 0, 0, 0, 46, 0, 16, 49, 10, 0, 0, 0, 0, 0,
+ 0, 0, 11, 79, 95, 0, 0, 8, 0, 112, 0, 105, 0,
+ 43, 62, 0, 77, 0, 116, 0, 61, 0, 0, 94, 42, 55,
+ 0, 75, 34, 90, 32, 33, 27, 25, 18, 96, 0, 71, 85,
};
/* aKWLen[i] is the length (in bytes) of the i-th keyword */
-static const unsigned char aKWLen[140] = {
+static const unsigned char aKWLen[143] = {
7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6,
7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 7,
- 6, 9, 4, 2, 10, 9, 4, 9, 4, 6, 2, 3, 11,
- 6, 2, 7, 5, 5, 6, 7, 10, 6, 5, 7, 4, 5,
- 7, 9, 6, 6, 6, 4, 5, 5, 5, 7, 7, 6, 5,
- 7, 3, 6, 4, 7, 6, 12, 9, 4, 6, 4, 5, 4,
- 7, 6, 5, 6, 6, 7, 5, 4, 7, 3, 2, 4, 5,
- 9, 5, 6, 3, 7, 13, 2, 2, 4, 6, 6, 8, 5,
- 17, 12, 7, 9, 8, 8, 2, 4, 9, 4, 6, 7, 9,
- 4, 4, 2, 6, 5, 8, 6, 4, 5, 8, 4, 3, 9,
- 5, 5, 6, 4, 6, 2, 2, 9, 3, 7,
+ 6, 9, 4, 2, 6, 5, 9, 9, 4, 7, 3, 2, 4,
+ 4, 6, 11, 6, 2, 7, 5, 5, 9, 6, 10, 4, 6,
+ 2, 3, 7, 10, 6, 5, 7, 4, 5, 7, 6, 6, 4,
+ 5, 5, 5, 7, 7, 6, 5, 7, 3, 6, 4, 7, 6,
+ 12, 9, 4, 6, 5, 4, 7, 6, 5, 6, 6, 7, 4,
+ 4, 5, 9, 5, 6, 3, 7, 13, 2, 2, 4, 6, 6,
+ 8, 5, 17, 12, 7, 9, 8, 8, 2, 4, 9, 4, 5,
+ 6, 7, 5, 9, 4, 4, 2, 5, 8, 6, 4, 5, 8,
+ 4, 3, 9, 5, 5, 6, 4, 6, 2, 2, 9, 3, 7,
};
/* aKWOffset[i] is the index into zKWText[] of the start of
** the text for the i-th keyword. */
-static const unsigned short int aKWOffset[140] = {
+static const unsigned short int aKWOffset[143] = {
0, 2, 2, 8, 9, 14, 16, 20, 23, 25, 25, 29, 33,
36, 41, 46, 48, 53, 54, 59, 62, 65, 67, 69, 78, 81,
- 86, 90, 90, 94, 99, 106, 114, 117, 123, 126, 126, 129, 131,
- 136, 140, 141, 146, 150, 154, 159, 165, 175, 178, 183, 183, 187,
- 191, 197, 205, 211, 216, 221, 224, 227, 231, 236, 242, 248, 248,
- 254, 255, 259, 265, 269, 276, 282, 294, 303, 305, 311, 315, 320,
- 322, 329, 334, 339, 345, 351, 357, 362, 365, 365, 365, 368, 372,
- 375, 384, 388, 394, 396, 403, 405, 407, 416, 420, 426, 432, 440,
- 445, 445, 445, 461, 470, 477, 478, 485, 488, 497, 501, 506, 513,
- 522, 526, 530, 532, 538, 542, 550, 556, 559, 564, 572, 572, 576,
- 585, 590, 595, 601, 604, 607, 610, 612, 617, 621,
+ 86, 90, 90, 94, 99, 101, 105, 111, 119, 123, 123, 123, 126,
+ 129, 132, 137, 142, 146, 147, 152, 156, 160, 168, 174, 181, 184,
+ 184, 187, 189, 195, 205, 208, 213, 213, 217, 221, 228, 233, 238,
+ 241, 244, 248, 253, 259, 265, 265, 271, 272, 276, 282, 286, 293,
+ 299, 311, 320, 322, 328, 333, 335, 342, 347, 352, 358, 364, 370,
+ 374, 378, 381, 390, 394, 400, 402, 409, 411, 413, 422, 426, 432,
+ 438, 446, 451, 451, 451, 467, 476, 483, 484, 491, 494, 503, 506,
+ 511, 516, 523, 528, 537, 541, 545, 547, 551, 559, 565, 568, 573,
+ 581, 581, 585, 594, 599, 604, 610, 613, 616, 619, 621, 626, 630,
};
/* aKWCode[i] is the parser symbol code for the i-th keyword */
-static const unsigned char aKWCode[140] = {
+static const unsigned char aKWCode[143] = {
TK_REINDEX, TK_INDEXED, TK_INDEX, TK_DESC, TK_ESCAPE,
TK_EACH, TK_CHECK, TK_KEY, TK_BEFORE, TK_FOREIGN,
TK_FOR, TK_IGNORE, TK_LIKE_KW, TK_EXPLAIN, TK_INSTEAD,
TK_ADD, TK_DATABASE, TK_AS, TK_SELECT, TK_TABLE,
TK_JOIN_KW, TK_THEN, TK_END, TK_DEFERRABLE, TK_ELSE,
TK_EXCLUDE, TK_DELETE, TK_TEMP, TK_TEMP, TK_OR,
- TK_CONSTRAINT, TK_INTERSECT, TK_TIES, TK_SAVEPOINT, TK_INTO,
- TK_OFFSET, TK_OF, TK_SET, TK_TRANSACTION,TK_ACTION,
- TK_ON, TK_JOIN_KW, TK_ALTER, TK_RAISE, TK_EXCEPT,
- TK_TRIGGER, TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_WITHOUT,
- TK_WITH, TK_JOIN_KW, TK_RELEASE, TK_EXCLUSIVE, TK_EXISTS,
- TK_ATTACH, TK_HAVING, TK_LIKE_KW, TK_BEGIN, TK_JOIN_KW,
- TK_RANGE, TK_BETWEEN, TK_NOTHING, TK_GROUPS, TK_GROUP,
- TK_CASCADE, TK_ASC, TK_DETACH, TK_CASE, TK_COLLATE,
- TK_CREATE, TK_CTIME_KW, TK_IMMEDIATE, TK_JOIN, TK_INSERT,
- TK_LIKE_KW, TK_MATCH, TK_PLAN, TK_ANALYZE, TK_PRAGMA,
- TK_ABORT, TK_UPDATE, TK_VALUES, TK_VIRTUAL, TK_LIMIT,
- TK_WHEN, TK_NOTNULL, TK_NOT, TK_NO, TK_NULL,
- TK_WHERE, TK_RECURSIVE, TK_AFTER, TK_RENAME, TK_AND,
- TK_DEFAULT, TK_AUTOINCR, TK_TO, TK_IN, TK_CAST,
- TK_COLUMNKW, TK_COMMIT, TK_CONFLICT, TK_JOIN_KW, TK_CTIME_KW,
- TK_CTIME_KW, TK_CURRENT, TK_PARTITION, TK_DEFERRED, TK_DISTINCT,
- TK_IS, TK_DROP, TK_PRECEDING, TK_FAIL, TK_FILTER,
- TK_REPLACE, TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_IF,
- TK_ISNULL, TK_ORDER, TK_RESTRICT, TK_OTHERS, TK_OVER,
- TK_JOIN_KW, TK_ROLLBACK, TK_ROWS, TK_ROW, TK_UNBOUNDED,
- TK_UNION, TK_USING, TK_VACUUM, TK_VIEW, TK_WINDOW,
- TK_DO, TK_BY, TK_INITIALLY, TK_ALL, TK_PRIMARY,
+ TK_ISNULL, TK_NULLS, TK_SAVEPOINT, TK_INTERSECT, TK_TIES,
+ TK_NOTNULL, TK_NOT, TK_NO, TK_NULL, TK_LIKE_KW,
+ TK_EXCEPT, TK_TRANSACTION,TK_ACTION, TK_ON, TK_JOIN_KW,
+ TK_ALTER, TK_RAISE, TK_EXCLUSIVE, TK_EXISTS, TK_CONSTRAINT,
+ TK_INTO, TK_OFFSET, TK_OF, TK_SET, TK_TRIGGER,
+ TK_REFERENCES, TK_UNIQUE, TK_QUERY, TK_WITHOUT, TK_WITH,
+ TK_JOIN_KW, TK_RELEASE, TK_ATTACH, TK_HAVING, TK_LIKE_KW,
+ TK_BEGIN, TK_JOIN_KW, TK_RANGE, TK_BETWEEN, TK_NOTHING,
+ TK_GROUPS, TK_GROUP, TK_CASCADE, TK_ASC, TK_DETACH,
+ TK_CASE, TK_COLLATE, TK_CREATE, TK_CTIME_KW, TK_IMMEDIATE,
+ TK_JOIN, TK_INSERT, TK_MATCH, TK_PLAN, TK_ANALYZE,
+ TK_PRAGMA, TK_ABORT, TK_UPDATE, TK_VALUES, TK_VIRTUAL,
+ TK_LAST, TK_WHEN, TK_WHERE, TK_RECURSIVE, TK_AFTER,
+ TK_RENAME, TK_AND, TK_DEFAULT, TK_AUTOINCR, TK_TO,
+ TK_IN, TK_CAST, TK_COLUMNKW, TK_COMMIT, TK_CONFLICT,
+ TK_JOIN_KW, TK_CTIME_KW, TK_CTIME_KW, TK_CURRENT, TK_PARTITION,
+ TK_DEFERRED, TK_DISTINCT, TK_IS, TK_DROP, TK_PRECEDING,
+ TK_FAIL, TK_LIMIT, TK_FILTER, TK_REPLACE, TK_FIRST,
+ TK_FOLLOWING, TK_FROM, TK_JOIN_KW, TK_IF, TK_ORDER,
+ TK_RESTRICT, TK_OTHERS, TK_OVER, TK_JOIN_KW, TK_ROLLBACK,
+ TK_ROWS, TK_ROW, TK_UNBOUNDED, TK_UNION, TK_USING,
+ TK_VACUUM, TK_VIEW, TK_WINDOW, TK_DO, TK_BY,
+ TK_INITIALLY, TK_ALL, TK_PRIMARY,
};
/* Check to see if z[0..n-1] is a keyword. If it is, write the
** parser symbol code for that keyword into *pType. Always
@@ -153956,116 +154989,119 @@ static int keywordCode(const char *z, int n, int *pType){
testcase( i==27 ); /* TEMPORARY */
testcase( i==28 ); /* TEMP */
testcase( i==29 ); /* OR */
- testcase( i==30 ); /* CONSTRAINT */
- testcase( i==31 ); /* INTERSECT */
- testcase( i==32 ); /* TIES */
- testcase( i==33 ); /* SAVEPOINT */
- testcase( i==34 ); /* INTO */
- testcase( i==35 ); /* OFFSET */
- testcase( i==36 ); /* OF */
- testcase( i==37 ); /* SET */
- testcase( i==38 ); /* TRANSACTION */
- testcase( i==39 ); /* ACTION */
- testcase( i==40 ); /* ON */
- testcase( i==41 ); /* NATURAL */
- testcase( i==42 ); /* ALTER */
- testcase( i==43 ); /* RAISE */
- testcase( i==44 ); /* EXCEPT */
- testcase( i==45 ); /* TRIGGER */
- testcase( i==46 ); /* REFERENCES */
- testcase( i==47 ); /* UNIQUE */
- testcase( i==48 ); /* QUERY */
- testcase( i==49 ); /* WITHOUT */
- testcase( i==50 ); /* WITH */
- testcase( i==51 ); /* OUTER */
- testcase( i==52 ); /* RELEASE */
- testcase( i==53 ); /* EXCLUSIVE */
- testcase( i==54 ); /* EXISTS */
- testcase( i==55 ); /* ATTACH */
- testcase( i==56 ); /* HAVING */
- testcase( i==57 ); /* GLOB */
- testcase( i==58 ); /* BEGIN */
- testcase( i==59 ); /* INNER */
- testcase( i==60 ); /* RANGE */
- testcase( i==61 ); /* BETWEEN */
- testcase( i==62 ); /* NOTHING */
- testcase( i==63 ); /* GROUPS */
- testcase( i==64 ); /* GROUP */
- testcase( i==65 ); /* CASCADE */
- testcase( i==66 ); /* ASC */
- testcase( i==67 ); /* DETACH */
- testcase( i==68 ); /* CASE */
- testcase( i==69 ); /* COLLATE */
- testcase( i==70 ); /* CREATE */
- testcase( i==71 ); /* CURRENT_DATE */
- testcase( i==72 ); /* IMMEDIATE */
- testcase( i==73 ); /* JOIN */
- testcase( i==74 ); /* INSERT */
- testcase( i==75 ); /* LIKE */
- testcase( i==76 ); /* MATCH */
- testcase( i==77 ); /* PLAN */
- testcase( i==78 ); /* ANALYZE */
- testcase( i==79 ); /* PRAGMA */
- testcase( i==80 ); /* ABORT */
- testcase( i==81 ); /* UPDATE */
- testcase( i==82 ); /* VALUES */
- testcase( i==83 ); /* VIRTUAL */
- testcase( i==84 ); /* LIMIT */
- testcase( i==85 ); /* WHEN */
- testcase( i==86 ); /* NOTNULL */
- testcase( i==87 ); /* NOT */
- testcase( i==88 ); /* NO */
- testcase( i==89 ); /* NULL */
- testcase( i==90 ); /* WHERE */
- testcase( i==91 ); /* RECURSIVE */
- testcase( i==92 ); /* AFTER */
- testcase( i==93 ); /* RENAME */
- testcase( i==94 ); /* AND */
- testcase( i==95 ); /* DEFAULT */
- testcase( i==96 ); /* AUTOINCREMENT */
- testcase( i==97 ); /* TO */
- testcase( i==98 ); /* IN */
- testcase( i==99 ); /* CAST */
- testcase( i==100 ); /* COLUMN */
- testcase( i==101 ); /* COMMIT */
- testcase( i==102 ); /* CONFLICT */
- testcase( i==103 ); /* CROSS */
- testcase( i==104 ); /* CURRENT_TIMESTAMP */
- testcase( i==105 ); /* CURRENT_TIME */
- testcase( i==106 ); /* CURRENT */
- testcase( i==107 ); /* PARTITION */
- testcase( i==108 ); /* DEFERRED */
- testcase( i==109 ); /* DISTINCT */
- testcase( i==110 ); /* IS */
- testcase( i==111 ); /* DROP */
- testcase( i==112 ); /* PRECEDING */
- testcase( i==113 ); /* FAIL */
- testcase( i==114 ); /* FILTER */
- testcase( i==115 ); /* REPLACE */
- testcase( i==116 ); /* FOLLOWING */
- testcase( i==117 ); /* FROM */
- testcase( i==118 ); /* FULL */
- testcase( i==119 ); /* IF */
- testcase( i==120 ); /* ISNULL */
- testcase( i==121 ); /* ORDER */
- testcase( i==122 ); /* RESTRICT */
- testcase( i==123 ); /* OTHERS */
- testcase( i==124 ); /* OVER */
- testcase( i==125 ); /* RIGHT */
- testcase( i==126 ); /* ROLLBACK */
- testcase( i==127 ); /* ROWS */
- testcase( i==128 ); /* ROW */
- testcase( i==129 ); /* UNBOUNDED */
- testcase( i==130 ); /* UNION */
- testcase( i==131 ); /* USING */
- testcase( i==132 ); /* VACUUM */
- testcase( i==133 ); /* VIEW */
- testcase( i==134 ); /* WINDOW */
- testcase( i==135 ); /* DO */
- testcase( i==136 ); /* BY */
- testcase( i==137 ); /* INITIALLY */
- testcase( i==138 ); /* ALL */
- testcase( i==139 ); /* PRIMARY */
+ testcase( i==30 ); /* ISNULL */
+ testcase( i==31 ); /* NULLS */
+ testcase( i==32 ); /* SAVEPOINT */
+ testcase( i==33 ); /* INTERSECT */
+ testcase( i==34 ); /* TIES */
+ testcase( i==35 ); /* NOTNULL */
+ testcase( i==36 ); /* NOT */
+ testcase( i==37 ); /* NO */
+ testcase( i==38 ); /* NULL */
+ testcase( i==39 ); /* LIKE */
+ testcase( i==40 ); /* EXCEPT */
+ testcase( i==41 ); /* TRANSACTION */
+ testcase( i==42 ); /* ACTION */
+ testcase( i==43 ); /* ON */
+ testcase( i==44 ); /* NATURAL */
+ testcase( i==45 ); /* ALTER */
+ testcase( i==46 ); /* RAISE */
+ testcase( i==47 ); /* EXCLUSIVE */
+ testcase( i==48 ); /* EXISTS */
+ testcase( i==49 ); /* CONSTRAINT */
+ testcase( i==50 ); /* INTO */
+ testcase( i==51 ); /* OFFSET */
+ testcase( i==52 ); /* OF */
+ testcase( i==53 ); /* SET */
+ testcase( i==54 ); /* TRIGGER */
+ testcase( i==55 ); /* REFERENCES */
+ testcase( i==56 ); /* UNIQUE */
+ testcase( i==57 ); /* QUERY */
+ testcase( i==58 ); /* WITHOUT */
+ testcase( i==59 ); /* WITH */
+ testcase( i==60 ); /* OUTER */
+ testcase( i==61 ); /* RELEASE */
+ testcase( i==62 ); /* ATTACH */
+ testcase( i==63 ); /* HAVING */
+ testcase( i==64 ); /* GLOB */
+ testcase( i==65 ); /* BEGIN */
+ testcase( i==66 ); /* INNER */
+ testcase( i==67 ); /* RANGE */
+ testcase( i==68 ); /* BETWEEN */
+ testcase( i==69 ); /* NOTHING */
+ testcase( i==70 ); /* GROUPS */
+ testcase( i==71 ); /* GROUP */
+ testcase( i==72 ); /* CASCADE */
+ testcase( i==73 ); /* ASC */
+ testcase( i==74 ); /* DETACH */
+ testcase( i==75 ); /* CASE */
+ testcase( i==76 ); /* COLLATE */
+ testcase( i==77 ); /* CREATE */
+ testcase( i==78 ); /* CURRENT_DATE */
+ testcase( i==79 ); /* IMMEDIATE */
+ testcase( i==80 ); /* JOIN */
+ testcase( i==81 ); /* INSERT */
+ testcase( i==82 ); /* MATCH */
+ testcase( i==83 ); /* PLAN */
+ testcase( i==84 ); /* ANALYZE */
+ testcase( i==85 ); /* PRAGMA */
+ testcase( i==86 ); /* ABORT */
+ testcase( i==87 ); /* UPDATE */
+ testcase( i==88 ); /* VALUES */
+ testcase( i==89 ); /* VIRTUAL */
+ testcase( i==90 ); /* LAST */
+ testcase( i==91 ); /* WHEN */
+ testcase( i==92 ); /* WHERE */
+ testcase( i==93 ); /* RECURSIVE */
+ testcase( i==94 ); /* AFTER */
+ testcase( i==95 ); /* RENAME */
+ testcase( i==96 ); /* AND */
+ testcase( i==97 ); /* DEFAULT */
+ testcase( i==98 ); /* AUTOINCREMENT */
+ testcase( i==99 ); /* TO */
+ testcase( i==100 ); /* IN */
+ testcase( i==101 ); /* CAST */
+ testcase( i==102 ); /* COLUMN */
+ testcase( i==103 ); /* COMMIT */
+ testcase( i==104 ); /* CONFLICT */
+ testcase( i==105 ); /* CROSS */
+ testcase( i==106 ); /* CURRENT_TIMESTAMP */
+ testcase( i==107 ); /* CURRENT_TIME */
+ testcase( i==108 ); /* CURRENT */
+ testcase( i==109 ); /* PARTITION */
+ testcase( i==110 ); /* DEFERRED */
+ testcase( i==111 ); /* DISTINCT */
+ testcase( i==112 ); /* IS */
+ testcase( i==113 ); /* DROP */
+ testcase( i==114 ); /* PRECEDING */
+ testcase( i==115 ); /* FAIL */
+ testcase( i==116 ); /* LIMIT */
+ testcase( i==117 ); /* FILTER */
+ testcase( i==118 ); /* REPLACE */
+ testcase( i==119 ); /* FIRST */
+ testcase( i==120 ); /* FOLLOWING */
+ testcase( i==121 ); /* FROM */
+ testcase( i==122 ); /* FULL */
+ testcase( i==123 ); /* IF */
+ testcase( i==124 ); /* ORDER */
+ testcase( i==125 ); /* RESTRICT */
+ testcase( i==126 ); /* OTHERS */
+ testcase( i==127 ); /* OVER */
+ testcase( i==128 ); /* RIGHT */
+ testcase( i==129 ); /* ROLLBACK */
+ testcase( i==130 ); /* ROWS */
+ testcase( i==131 ); /* ROW */
+ testcase( i==132 ); /* UNBOUNDED */
+ testcase( i==133 ); /* UNION */
+ testcase( i==134 ); /* USING */
+ testcase( i==135 ); /* VACUUM */
+ testcase( i==136 ); /* VIEW */
+ testcase( i==137 ); /* WINDOW */
+ testcase( i==138 ); /* DO */
+ testcase( i==139 ); /* BY */
+ testcase( i==140 ); /* INITIALLY */
+ testcase( i==141 ); /* ALL */
+ testcase( i==142 ); /* PRIMARY */
*pType = aKWCode[i];
break;
}
@@ -154077,7 +155113,7 @@ SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char *z, int n){
keywordCode((char*)z, n, &id);
return id;
}
-#define SQLITE_N_KEYWORD 140
+#define SQLITE_N_KEYWORD 143
SQLITE_API int sqlite3_keyword_name(int i,const char **pzName,int *pnName){
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR;
*pzName = zKWText + aKWOffset[i];
@@ -156038,6 +157074,7 @@ SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
} aFlagOp[] = {
{ SQLITE_DBCONFIG_ENABLE_FKEY, SQLITE_ForeignKeys },
{ SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_EnableTrigger },
+ { SQLITE_DBCONFIG_ENABLE_VIEW, SQLITE_EnableView },
{ SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, SQLITE_Fts3Tokenizer },
{ SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, SQLITE_LoadExtension },
{ SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, SQLITE_NoCkptOnClose },
@@ -156437,11 +157474,8 @@ SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
#ifndef SQLITE_OMIT_VIRTUALTABLE
for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){
Module *pMod = (Module *)sqliteHashData(i);
- if( pMod->xDestroy ){
- pMod->xDestroy(pMod->pAux);
- }
sqlite3VtabEponymousTableClear(db, pMod);
- sqlite3DbFree(db, pMod);
+ sqlite3VtabModuleUnref(db, pMod);
}
sqlite3HashClear(&db->aModule);
#endif
@@ -156922,7 +157956,8 @@ SQLITE_PRIVATE int sqlite3CreateFunc(
}
assert( SQLITE_FUNC_CONSTANT==SQLITE_DETERMINISTIC );
- extraFlags = enc & SQLITE_DETERMINISTIC;
+ assert( SQLITE_FUNC_DIRECT==SQLITE_DIRECTONLY );
+ extraFlags = enc & (SQLITE_DETERMINISTIC|SQLITE_DIRECTONLY|SQLITE_SUBTYPE);
enc &= (SQLITE_FUNC_ENCMASK|SQLITE_ANY);
#ifndef SQLITE_OMIT_UTF16
@@ -156985,6 +158020,7 @@ SQLITE_PRIVATE int sqlite3CreateFunc(
p->u.pDestructor = pDestructor;
p->funcFlags = (p->funcFlags & SQLITE_FUNC_ENCMASK) | extraFlags;
testcase( p->funcFlags & SQLITE_DETERMINISTIC );
+ testcase( p->funcFlags & SQLITE_DIRECTONLY );
p->xSFunc = xSFunc ? xSFunc : xStep;
p->xFinalize = xFinal;
p->xValue = xValue;
@@ -158277,6 +159313,7 @@ static int openDatabase(
db->nMaxSorterMmap = 0x7FFFFFFF;
db->flags |= SQLITE_ShortColNames
| SQLITE_EnableTrigger
+ | SQLITE_EnableView
| SQLITE_CacheSpill
/* The SQLITE_DQS compile-time option determines the default settings
@@ -159026,12 +160063,33 @@ SQLITE_API int sqlite3_test_control(int op, ...){
break;
}
- /*
- ** Reset the PRNG back to its uninitialized state. The next call
- ** to sqlite3_randomness() will reseed the PRNG using a single call
- ** to the xRandomness method of the default VFS.
+ /* sqlite3_test_control(SQLITE_TESTCTRL_PRNG_SEED, int x, sqlite3 *db);
+ **
+ ** Control the seed for the pseudo-random number generator (PRNG) that
+ ** is built into SQLite. Cases:
+ **
+ ** x!=0 && db!=0 Seed the PRNG to the current value of the
+ ** schema cookie in the main database for db, or
+ ** x if the schema cookie is zero. This case
+ ** is convenient to use with database fuzzers
+ ** as it allows the fuzzer some control over the
+ ** the PRNG seed.
+ **
+ ** x!=0 && db==0 Seed the PRNG to the value of x.
+ **
+ ** x==0 && db==0 Revert to default behavior of using the
+ ** xRandomness method on the primary VFS.
+ **
+ ** This test-control also resets the PRNG so that the new seed will
+ ** be used for the next call to sqlite3_randomness().
*/
- case SQLITE_TESTCTRL_PRNG_RESET: {
+ case SQLITE_TESTCTRL_PRNG_SEED: {
+ int x = va_arg(ap, int);
+ int y;
+ sqlite3 *db = va_arg(ap, sqlite3*);
+ assert( db==0 || db->aDb[0].pSchema!=0 );
+ if( db && (y = db->aDb[0].pSchema->schema_cookie)!=0 ){ x = y; }
+ sqlite3Config.iPrngSeed = x;
sqlite3_randomness(0,0);
break;
}
@@ -159244,6 +160302,17 @@ SQLITE_API int sqlite3_test_control(int op, ...){
break;
}
+ /* sqlite3_test_control(SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS, int);
+ **
+ ** Set or clear a flag that causes SQLite to verify that type, name,
+ ** and tbl_name fields of the sqlite_master table. This is normally
+ ** on, but it is sometimes useful to turn it off for testing.
+ */
+ case SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS: {
+ sqlite3GlobalConfig.bExtraSchemaChecks = va_arg(ap, int);
+ break;
+ }
+
/* Set the threshold at which OP_Once counters reset back to zero.
** By default this is 0x7ffffffe (over 2 billion), but that value is
** too big to test in a reasonable amount of time, so this control is
@@ -161190,6 +162259,18 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsdiacritic(int);
SQLITE_EXTENSION_INIT1
#endif
+/*
+** The following are copied from sqliteInt.h.
+**
+** Constants for the largest and smallest possible 64-bit signed integers.
+** These macros are designed to work correctly on both 32-bit and 64-bit
+** compilers.
+*/
+#ifndef SQLITE_AMALGAMATION
+# define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
+# define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64)
+#endif
+
static int fts3EvalNext(Fts3Cursor *pCsr);
static int fts3EvalStart(Fts3Cursor *pCsr);
static int fts3TermSegReaderCursor(
@@ -162968,10 +164049,11 @@ static void fts3ColumnlistCopy(char **pp, char **ppPoslist){
}
/*
-** Value used to signify the end of an position-list. This is safe because
-** it is not possible to have a document with 2^31 terms.
+** Value used to signify the end of an position-list. This must be
+** as large or larger than any value that might appear on the
+** position-list, even a position list that has been corrupted.
*/
-#define POSITION_LIST_END 0x7fffffff
+#define POSITION_LIST_END LARGEST_INT64
/*
** This function is used to help parse position-lists. When this function is
@@ -163047,14 +164129,14 @@ static int fts3PoslistMerge(
fts3GetVarint32(&p1[1], &iCol1);
if( iCol1==0 ) return FTS_CORRUPT_VTAB;
}
- else if( *p1==POS_END ) iCol1 = POSITION_LIST_END;
+ else if( *p1==POS_END ) iCol1 = 0x7fffffff;
else iCol1 = 0;
if( *p2==POS_COLUMN ){
fts3GetVarint32(&p2[1], &iCol2);
if( iCol2==0 ) return FTS_CORRUPT_VTAB;
}
- else if( *p2==POS_END ) iCol2 = POSITION_LIST_END;
+ else if( *p2==POS_END ) iCol2 = 0x7fffffff;
else iCol2 = 0;
if( iCol1==iCol2 ){
@@ -163356,7 +164438,8 @@ static void fts3PutDeltaVarint3(
iWrite = *piPrev - iVal;
}
assert( *pbFirst || *piPrev==0 );
- assert( *pbFirst==0 || iWrite>0 );
+ assert_fts3_nc( *pbFirst==0 || iWrite>0 );
+ assert( *pbFirst==0 || iWrite>=0 );
*pp += sqlite3Fts3PutVarint(*pp, iWrite);
*piPrev = iVal;
*pbFirst = 1;
@@ -163462,6 +164545,8 @@ static int fts3DoclistOrMerge(
fts3PoslistCopy(&p, &p2);
fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2);
}
+
+ assert( (p-aOut)<=((p1?(p1-a1):n1)+(p2?(p2-a2):n2)+FTS3_VARINT_MAX-1) );
}
if( rc!=SQLITE_OK ){
@@ -164062,18 +165147,6 @@ static int fts3NextMethod(sqlite3_vtab_cursor *pCursor){
}
/*
-** The following are copied from sqliteInt.h.
-**
-** Constants for the largest and smallest possible 64-bit signed integers.
-** These macros are designed to work correctly on both 32-bit and 64-bit
-** compilers.
-*/
-#ifndef SQLITE_AMALGAMATION
-# define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
-# define SMALLEST_INT64 (((sqlite3_int64)-1) - LARGEST_INT64)
-#endif
-
-/*
** If the numeric type of argument pVal is "integer", then return it
** converted to a 64-bit signed integer. Otherwise, return a copy of
** the second parameter, iDefault.
@@ -174802,14 +175875,14 @@ static int nodeReaderInit(NodeReader *p, const char *aNode, int nNode){
p->nNode = nNode;
/* Figure out if this is a leaf or an internal node. */
- if( p->aNode[0] ){
+ if( aNode && aNode[0] ){
/* An internal node. */
p->iOff = 1 + sqlite3Fts3GetVarint(&p->aNode[1], &p->iChild);
}else{
p->iOff = 1;
}
- return nodeReaderNext(p);
+ return aNode ? nodeReaderNext(p) : SQLITE_OK;
}
/*
@@ -174946,6 +176019,7 @@ static int fts3AppendToNode(
nPrefix = fts3PrefixCompress(pPrev->a, pPrev->n, zTerm, nTerm);
nSuffix = nTerm - nPrefix;
+ if( nSuffix<=0 ) return FTS_CORRUPT_VTAB;
memcpy(pPrev->a, zTerm, nTerm);
pPrev->n = nTerm;
@@ -175300,8 +176374,8 @@ static int fts3IncrmergeLoad(
NodeReader reader;
pNode = &pWriter->aNodeWriter[i];
- rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
- if( reader.aNode ){
+ if( pNode->block.a){
+ rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
blobGrowBuffer(&pNode->key, reader.term.n, &rc);
if( rc==SQLITE_OK ){
@@ -177166,10 +178240,10 @@ static void fts3SnippetDetails(
while( iCsr<(iStart+pIter->nSnippet) && iCsr>=iStart ){
int j;
- u64 mPhrase = (u64)1 << i;
+ u64 mPhrase = (u64)1 << (i%64);
u64 mPos = (u64)1 << (iCsr - iStart);
assert( iCsr>=iStart && (iCsr - iStart)<=64 );
- assert( i>=0 && i<=64 );
+ assert( i>=0 );
if( (mCover|mCovered)&mPhrase ){
iScore++;
}else{
@@ -180330,6 +181404,7 @@ static JsonNode *jsonLookupStep(
const char *zKey;
JsonNode *pRoot = &pParse->aNode[iRoot];
if( zPath[0]==0 ) return pRoot;
+ if( pRoot->jnFlags & JNODE_REPLACE ) return 0;
if( zPath[0]=='.' ){
if( pRoot->eType!=JSON_OBJECT ) return 0;
zPath++;
@@ -181066,7 +182141,7 @@ static void jsonArrayStep(
if( pStr->zBuf==0 ){
jsonInit(pStr, ctx);
jsonAppendChar(pStr, '[');
- }else{
+ }else if( pStr->nUsed>1 ){
jsonAppendChar(pStr, ',');
pStr->pCtx = ctx;
}
@@ -181114,9 +182189,11 @@ static void jsonGroupInverse(
int argc,
sqlite3_value **argv
){
- int i;
+ unsigned int i;
int inStr = 0;
+ int nNest = 0;
char *z;
+ char c;
JsonString *pStr;
UNUSED_PARAM(argc);
UNUSED_PARAM(argv);
@@ -181127,12 +182204,18 @@ static void jsonGroupInverse(
if( NEVER(!pStr) ) return;
#endif
z = pStr->zBuf;
- for(i=1; z[i]!=',' || inStr; i++){
- assert( i<pStr->nUsed );
- if( z[i]=='"' ){
+ for(i=1; (c = z[i])!=',' || inStr || nNest; i++){
+ if( i>=pStr->nUsed ){
+ pStr->nUsed = 1;
+ return;
+ }
+ if( c=='"' ){
inStr = !inStr;
- }else if( z[i]=='\\' ){
+ }else if( c=='\\' ){
i++;
+ }else if( !inStr ){
+ if( c=='{' || c=='[' ) nNest++;
+ if( c=='}' || c==']' ) nNest--;
}
}
pStr->nUsed -= i;
@@ -181162,7 +182245,7 @@ static void jsonObjectStep(
if( pStr->zBuf==0 ){
jsonInit(pStr, ctx);
jsonAppendChar(pStr, '{');
- }else{
+ }else if( pStr->nUsed>1 ){
jsonAppendChar(pStr, ',');
pStr->pCtx = ctx;
}
@@ -181750,14 +182833,14 @@ SQLITE_PRIVATE int sqlite3Json1Init(sqlite3 *db){
#endif
for(i=0; i<sizeof(aFunc)/sizeof(aFunc[0]) && rc==SQLITE_OK; i++){
rc = sqlite3_create_function(db, aFunc[i].zName, aFunc[i].nArg,
- SQLITE_UTF8 | SQLITE_DETERMINISTIC,
+ SQLITE_UTF8 | SQLITE_DETERMINISTIC,
(void*)&aFunc[i].flag,
aFunc[i].xFunc, 0, 0);
}
#ifndef SQLITE_OMIT_WINDOWFUNC
for(i=0; i<sizeof(aAgg)/sizeof(aAgg[0]) && rc==SQLITE_OK; i++){
rc = sqlite3_create_window_function(db, aAgg[i].zName, aAgg[i].nArg,
- SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
+ SQLITE_SUBTYPE | SQLITE_UTF8 | SQLITE_DETERMINISTIC, 0,
aAgg[i].xStep, aAgg[i].xFinal,
aAgg[i].xValue, jsonGroupInverse, 0);
}
@@ -182460,7 +183543,6 @@ static int nodeAcquire(
** increase its reference count and return it.
*/
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){
- assert( !pParent || !pNode->pParent || pNode->pParent==pParent );
if( pParent && !pNode->pParent ){
if( nodeInParentChain(pNode, pParent) ){
RTREE_IS_CORRUPT(pRtree);
@@ -182468,6 +183550,9 @@ static int nodeAcquire(
}
pParent->nRef++;
pNode->pParent = pParent;
+ }else if( pParent && pNode->pParent && pParent!=pNode->pParent ){
+ RTREE_IS_CORRUPT(pRtree);
+ return SQLITE_CORRUPT_VTAB;
}
pNode->nRef++;
*ppNode = pNode;
@@ -183355,13 +184440,14 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){
eInt = pRtree->eCoordType==RTREE_COORD_INT32;
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){
+ u8 *pCellData;
pNode = rtreeNodeOfFirstSearchPoint(pCur, &rc);
if( rc ) return rc;
nCell = NCELL(pNode);
assert( nCell<200 );
+ pCellData = pNode->zData + (4+pRtree->nBytesPerCell*p->iCell);
while( p->iCell<nCell ){
sqlite3_rtree_dbl rScore = (sqlite3_rtree_dbl)-1;
- u8 *pCellData = pNode->zData + (4+pRtree->nBytesPerCell*p->iCell);
eWithin = FULLY_WITHIN;
for(ii=0; ii<nConstraint; ii++){
RtreeConstraint *pConstraint = pCur->aConstraint + ii;
@@ -183374,13 +184460,23 @@ static int rtreeStepToLeaf(RtreeCursor *pCur){
}else{
rtreeNonleafConstraint(pConstraint, eInt, pCellData, &eWithin);
}
- if( eWithin==NOT_WITHIN ) break;
+ if( eWithin==NOT_WITHIN ){
+ p->iCell++;
+ pCellData += pRtree->nBytesPerCell;
+ break;
+ }
}
- p->iCell++;
if( eWithin==NOT_WITHIN ) continue;
+ p->iCell++;
x.iLevel = p->iLevel - 1;
if( x.iLevel ){
x.id = readInt64(pCellData);
+ for(ii=0; ii<pCur->nPoint; ii++){
+ if( pCur->aPoint[ii].id==x.id ){
+ RTREE_IS_CORRUPT(pRtree);
+ return SQLITE_CORRUPT_VTAB;
+ }
+ }
x.iCell = 0;
}else{
x.id = p->id;
@@ -189688,6 +190784,7 @@ SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName);
typedef struct RbuFrame RbuFrame;
typedef struct RbuObjIter RbuObjIter;
typedef struct RbuState RbuState;
+typedef struct RbuSpan RbuSpan;
typedef struct rbu_vfs rbu_vfs;
typedef struct rbu_file rbu_file;
typedef struct RbuUpdateStmt RbuUpdateStmt;
@@ -189732,6 +190829,11 @@ struct RbuUpdateStmt {
RbuUpdateStmt *pNext;
};
+struct RbuSpan {
+ const char *zSpan;
+ int nSpan;
+};
+
/*
** An iterator of this type is used to iterate through all objects in
** the target database that require updating. For each such table, the
@@ -189781,6 +190883,9 @@ struct RbuObjIter {
sqlite3_stmt *pInsert; /* Statement for INSERT operations */
sqlite3_stmt *pDelete; /* Statement for DELETE ops */
sqlite3_stmt *pTmpInsert; /* Insert into rbu_tmp_$zDataTbl */
+ int nIdxCol;
+ RbuSpan *aIdxCol;
+ char *zIdxSql;
/* Last UPDATE used (for PK b-tree updates only), or NULL. */
RbuUpdateStmt *pRbuUpdate;
@@ -190315,6 +191420,8 @@ static void rbuObjIterClearStatements(RbuObjIter *pIter){
sqlite3_free(pUp);
pUp = pTmp;
}
+ sqlite3_free(pIter->aIdxCol);
+ sqlite3_free(pIter->zIdxSql);
pIter->pSelect = 0;
pIter->pInsert = 0;
@@ -190322,6 +191429,9 @@ static void rbuObjIterClearStatements(RbuObjIter *pIter){
pIter->pRbuUpdate = 0;
pIter->pTmpInsert = 0;
pIter->nCol = 0;
+ pIter->nIdxCol = 0;
+ pIter->aIdxCol = 0;
+ pIter->zIdxSql = 0;
}
/*
@@ -190436,8 +191546,8 @@ static void rbuTargetNameFunc(
zIn = (const char*)sqlite3_value_text(argv[0]);
if( zIn ){
if( rbuIsVacuum(p) ){
- assert( argc==2 );
- if( 0==sqlite3_value_int(argv[1]) ){
+ assert( argc==2 || argc==1 );
+ if( argc==1 || 0==sqlite3_value_int(argv[1]) ){
sqlite3_result_text(pCtx, zIn, -1, SQLITE_STATIC);
}
}else{
@@ -190595,14 +191705,15 @@ static void rbuAllocateIterArrays(sqlite3rbu *p, RbuObjIter *pIter, int nCol){
static char *rbuStrndup(const char *zStr, int *pRc){
char *zRet = 0;
- assert( *pRc==SQLITE_OK );
- if( zStr ){
- size_t nCopy = strlen(zStr) + 1;
- zRet = (char*)sqlite3_malloc64(nCopy);
- if( zRet ){
- memcpy(zRet, zStr, nCopy);
- }else{
- *pRc = SQLITE_NOMEM;
+ if( *pRc==SQLITE_OK ){
+ if( zStr ){
+ size_t nCopy = strlen(zStr) + 1;
+ zRet = (char*)sqlite3_malloc64(nCopy);
+ if( zRet ){
+ memcpy(zRet, zStr, nCopy);
+ }else{
+ *pRc = SQLITE_NOMEM;
+ }
}
}
@@ -190774,6 +191885,9 @@ static void rbuObjIterCacheIndexedCols(sqlite3rbu *p, RbuObjIter *pIter){
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pXInfo) ){
int iCid = sqlite3_column_int(pXInfo, 1);
if( iCid>=0 ) pIter->abIndexed[iCid] = 1;
+ if( iCid==-2 ){
+ memset(pIter->abIndexed, 0x01, sizeof(u8)*pIter->nTblCol);
+ }
}
rbuFinalize(p, pXInfo);
bIndex = 1;
@@ -191185,29 +192299,37 @@ static char *rbuObjIterGetIndexCols(
int iCid = sqlite3_column_int(pXInfo, 1);
int bDesc = sqlite3_column_int(pXInfo, 3);
const char *zCollate = (const char*)sqlite3_column_text(pXInfo, 4);
- const char *zCol;
+ const char *zCol = 0;
const char *zType;
- if( iCid<0 ){
- /* An integer primary key. If the table has an explicit IPK, use
- ** its name. Otherwise, use "rbu_rowid". */
- if( pIter->eType==RBU_PK_IPK ){
- int i;
- for(i=0; pIter->abTblPk[i]==0; i++);
- assert( i<pIter->nTblCol );
- zCol = pIter->azTblCol[i];
- }else if( rbuIsVacuum(p) ){
- zCol = "_rowid_";
+ if( iCid==-2 ){
+ int iSeq = sqlite3_column_int(pXInfo, 0);
+ zRet = sqlite3_mprintf("%z%s(%.*s) COLLATE %Q", zRet, zCom,
+ pIter->aIdxCol[iSeq].nSpan, pIter->aIdxCol[iSeq].zSpan, zCollate
+ );
+ zType = "";
+ }else {
+ if( iCid<0 ){
+ /* An integer primary key. If the table has an explicit IPK, use
+ ** its name. Otherwise, use "rbu_rowid". */
+ if( pIter->eType==RBU_PK_IPK ){
+ int i;
+ for(i=0; pIter->abTblPk[i]==0; i++);
+ assert( i<pIter->nTblCol );
+ zCol = pIter->azTblCol[i];
+ }else if( rbuIsVacuum(p) ){
+ zCol = "_rowid_";
+ }else{
+ zCol = "rbu_rowid";
+ }
+ zType = "INTEGER";
}else{
- zCol = "rbu_rowid";
+ zCol = pIter->azTblCol[iCid];
+ zType = pIter->azTblType[iCid];
}
- zType = "INTEGER";
- }else{
- zCol = pIter->azTblCol[iCid];
- zType = pIter->azTblType[iCid];
+ zRet = sqlite3_mprintf("%z%s\"%w\" COLLATE %Q", zRet, zCom,zCol,zCollate);
}
- zRet = sqlite3_mprintf("%z%s\"%w\" COLLATE %Q", zRet, zCom, zCol, zCollate);
if( pIter->bUnique==0 || sqlite3_column_int(pXInfo, 5) ){
const char *zOrder = (bDesc ? " DESC" : "");
zImpPK = sqlite3_mprintf("%z%s\"rbu_imp_%d%w\"%s",
@@ -191687,6 +192809,8 @@ static char *rbuObjIterGetIndexWhere(sqlite3rbu *p, RbuObjIter *pIter){
int rc = p->rc;
char *zRet = 0;
+ assert( pIter->zIdxSql==0 && pIter->nIdxCol==0 && pIter->aIdxCol==0 );
+
if( rc==SQLITE_OK ){
rc = prepareAndCollectError(p->dbMain, &pStmt, &p->zErrmsg,
"SELECT trim(sql) FROM sqlite_master WHERE type='index' AND name=?"
@@ -191696,21 +192820,50 @@ static char *rbuObjIterGetIndexWhere(sqlite3rbu *p, RbuObjIter *pIter){
int rc2;
rc = sqlite3_bind_text(pStmt, 1, pIter->zIdx, -1, SQLITE_STATIC);
if( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
- const char *zSql = (const char*)sqlite3_column_text(pStmt, 0);
+ char *zSql = (char*)sqlite3_column_text(pStmt, 0);
+ if( zSql ){
+ pIter->zIdxSql = zSql = rbuStrndup(zSql, &rc);
+ }
if( zSql ){
int nParen = 0; /* Number of open parenthesis */
int i;
+ int iIdxCol = 0;
+ int nIdxAlloc = 0;
for(i=0; zSql[i]; i++){
char c = zSql[i];
+
+ /* If necessary, grow the pIter->aIdxCol[] array */
+ if( iIdxCol==nIdxAlloc ){
+ RbuSpan *aIdxCol = (RbuSpan*)sqlite3_realloc(
+ pIter->aIdxCol, (nIdxAlloc+16)*sizeof(RbuSpan)
+ );
+ if( aIdxCol==0 ){
+ rc = SQLITE_NOMEM;
+ break;
+ }
+ pIter->aIdxCol = aIdxCol;
+ nIdxAlloc += 16;
+ }
+
if( c=='(' ){
+ if( nParen==0 ){
+ assert( iIdxCol==0 );
+ pIter->aIdxCol[0].zSpan = &zSql[i+1];
+ }
nParen++;
}
else if( c==')' ){
nParen--;
if( nParen==0 ){
+ int nSpan = &zSql[i] - pIter->aIdxCol[iIdxCol].zSpan;
+ pIter->aIdxCol[iIdxCol++].nSpan = nSpan;
i++;
break;
}
+ }else if( c==',' && nParen==1 ){
+ int nSpan = &zSql[i] - pIter->aIdxCol[iIdxCol].zSpan;
+ pIter->aIdxCol[iIdxCol++].nSpan = nSpan;
+ pIter->aIdxCol[iIdxCol].zSpan = &zSql[i+1];
}else if( c=='"' || c=='\'' || c=='`' ){
for(i++; 1; i++){
if( zSql[i]==c ){
@@ -191722,11 +192875,19 @@ static char *rbuObjIterGetIndexWhere(sqlite3rbu *p, RbuObjIter *pIter){
for(i++; 1; i++){
if( zSql[i]==']' ) break;
}
+ }else if( c=='-' && zSql[i+1]=='-' ){
+ for(i=i+2; zSql[i] && zSql[i]!='\n'; i++);
+ if( zSql[i]=='\0' ) break;
+ }else if( c=='/' && zSql[i+1]=='*' ){
+ for(i=i+2; zSql[i] && (zSql[i]!='*' || zSql[i+1]!='/'); i++);
+ if( zSql[i]=='\0' ) break;
+ i++;
}
}
if( zSql[i] ){
zRet = rbuStrndup(&zSql[i], &rc);
}
+ pIter->nIdxCol = iIdxCol;
}
}
@@ -191771,11 +192932,11 @@ static int rbuObjIterPrepareAll(
int nBind = 0;
assert( pIter->eType!=RBU_PK_VTAB );
+ zPart = rbuObjIterGetIndexWhere(p, pIter);
zCollist = rbuObjIterGetIndexCols(
p, pIter, &zImposterCols, &zImposterPK, &zWhere, &nBind
);
zBind = rbuObjIterGetBindlist(p, nBind);
- zPart = rbuObjIterGetIndexWhere(p, pIter);
/* Create the imposter table used to write to this index. */
sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, p->dbMain, "main", 0, 1);
@@ -193301,10 +194462,11 @@ static void rbuIndexCntFunc(
sqlite3_stmt *pStmt = 0;
char *zErrmsg = 0;
int rc;
+ sqlite3 *db = (rbuIsVacuum(p) ? p->dbRbu : p->dbMain);
assert( nVal==1 );
- rc = prepareFreeAndCollectError(p->dbMain, &pStmt, &zErrmsg,
+ rc = prepareFreeAndCollectError(db, &pStmt, &zErrmsg,
sqlite3_mprintf("SELECT count(*) FROM sqlite_master "
"WHERE type='index' AND tbl_name = %Q", sqlite3_value_text(apVal[0]))
);
@@ -193319,7 +194481,7 @@ static void rbuIndexCntFunc(
if( rc==SQLITE_OK ){
sqlite3_result_int(pCtx, nIndex);
}else{
- sqlite3_result_error(pCtx, sqlite3_errmsg(p->dbMain), -1);
+ sqlite3_result_error(pCtx, sqlite3_errmsg(db), -1);
}
}
@@ -197762,7 +198924,7 @@ static int sessionBufferGrow(SessionBuffer *p, size_t nByte, int *pRc){
i64 nNew = p->nAlloc ? p->nAlloc : 128;
do {
nNew = nNew*2;
- }while( (nNew-p->nBuf)<nByte );
+ }while( (size_t)(nNew-p->nBuf)<nByte );
aNew = (u8 *)sqlite3_realloc64(p->aBuf, nNew);
if( 0==aNew ){
@@ -202163,6 +203325,7 @@ struct Fts5Config {
char *zContentExprlist;
Fts5Tokenizer *pTok;
fts5_tokenizer *pTokApi;
+ int bLock; /* True when table is preparing statement */
/* Values loaded from the %_config table */
int iCookie; /* Incremented when %_config is modified */
@@ -202679,6 +203842,7 @@ static int sqlite3Fts5ExprEof(Fts5Expr*);
static i64 sqlite3Fts5ExprRowid(Fts5Expr*);
static void sqlite3Fts5ExprFree(Fts5Expr*);
+static int sqlite3Fts5ExprAnd(Fts5Expr **pp1, Fts5Expr *p2);
/* Called during startup to register a UDF with SQLite */
static int sqlite3Fts5ExprInit(Fts5Global*, sqlite3*);
@@ -203530,15 +204694,18 @@ static fts5YYACTIONTYPE fts5yy_find_shift_action(
do{
i = fts5yy_shift_ofst[stateno];
assert( i>=0 );
- /* assert( i+fts5YYNFTS5TOKEN<=(int)fts5YY_NLOOKAHEAD ); */
+ assert( i<=fts5YY_ACTTAB_COUNT );
+ assert( i+fts5YYNFTS5TOKEN<=(int)fts5YY_NLOOKAHEAD );
assert( iLookAhead!=fts5YYNOCODE );
assert( iLookAhead < fts5YYNFTS5TOKEN );
i += iLookAhead;
- if( i>=fts5YY_NLOOKAHEAD || fts5yy_lookahead[i]!=iLookAhead ){
+ assert( i<(int)fts5YY_NLOOKAHEAD );
+ if( fts5yy_lookahead[i]!=iLookAhead ){
#ifdef fts5YYFALLBACK
fts5YYCODETYPE iFallback; /* Fallback token */
- if( iLookAhead<sizeof(fts5yyFallback)/sizeof(fts5yyFallback[0])
- && (iFallback = fts5yyFallback[iLookAhead])!=0 ){
+ assert( iLookAhead<sizeof(fts5yyFallback)/sizeof(fts5yyFallback[0]) );
+ iFallback = fts5yyFallback[iLookAhead];
+ if( iFallback!=0 ){
#ifndef NDEBUG
if( fts5yyTraceFILE ){
fprintf(fts5yyTraceFILE, "%sFALLBACK %s => %s\n",
@@ -203553,16 +204720,8 @@ static fts5YYACTIONTYPE fts5yy_find_shift_action(
#ifdef fts5YYWILDCARD
{
int j = i - iLookAhead + fts5YYWILDCARD;
- if(
-#if fts5YY_SHIFT_MIN+fts5YYWILDCARD<0
- j>=0 &&
-#endif
-#if fts5YY_SHIFT_MAX+fts5YYWILDCARD>=fts5YY_ACTTAB_COUNT
- j<fts5YY_ACTTAB_COUNT &&
-#endif
- j<(int)(sizeof(fts5yy_lookahead)/sizeof(fts5yy_lookahead[0])) &&
- fts5yy_lookahead[j]==fts5YYWILDCARD && iLookAhead>0
- ){
+ assert( j<(int)(sizeof(fts5yy_lookahead)/sizeof(fts5yy_lookahead[0])) );
+ if( fts5yy_lookahead[j]==fts5YYWILDCARD && iLookAhead>0 ){
#ifndef NDEBUG
if( fts5yyTraceFILE ){
fprintf(fts5yyTraceFILE, "%sWILDCARD %s => %s\n",
@@ -203576,6 +204735,7 @@ static fts5YYACTIONTYPE fts5yy_find_shift_action(
#endif /* fts5YYWILDCARD */
return fts5yy_default[stateno];
}else{
+ assert( i>=0 && i<sizeof(fts5yy_action)/sizeof(fts5yy_action[0]) );
return fts5yy_action[i];
}
}while(1);
@@ -204276,9 +205436,8 @@ static void sqlite3Fts5Parser(
*/
static int sqlite3Fts5ParserFallback(int iToken){
#ifdef fts5YYFALLBACK
- if( iToken<(int)(sizeof(fts5yyFallback)/sizeof(fts5yyFallback[0])) ){
- return fts5yyFallback[iToken];
- }
+ assert( iToken<(int)(sizeof(fts5yyFallback)/sizeof(fts5yyFallback[0])) );
+ return fts5yyFallback[iToken];
#else
(void)iToken;
#endif
@@ -206091,7 +207250,7 @@ static int sqlite3Fts5ConfigDeclareVtab(Fts5Config *pConfig){
rc = sqlite3_declare_vtab(pConfig->db, zSql);
sqlite3_free(zSql);
}
-
+
return rc;
}
@@ -206679,6 +207838,42 @@ static void sqlite3Fts5ExprFree(Fts5Expr *p){
}
}
+static int sqlite3Fts5ExprAnd(Fts5Expr **pp1, Fts5Expr *p2){
+ Fts5Parse sParse;
+ memset(&sParse, 0, sizeof(sParse));
+
+ if( *pp1 ){
+ Fts5Expr *p1 = *pp1;
+ int nPhrase = p1->nPhrase + p2->nPhrase;
+
+ p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
+ p2->pRoot = 0;
+
+ if( sParse.rc==SQLITE_OK ){
+ Fts5ExprPhrase **ap = (Fts5ExprPhrase**)sqlite3_realloc(
+ p1->apExprPhrase, nPhrase * sizeof(Fts5ExprPhrase*)
+ );
+ if( ap==0 ){
+ sParse.rc = SQLITE_NOMEM;
+ }else{
+ int i;
+ memmove(&ap[p2->nPhrase], ap, p1->nPhrase*sizeof(Fts5ExprPhrase*));
+ for(i=0; i<p2->nPhrase; i++){
+ ap[i] = p2->apExprPhrase[i];
+ }
+ p1->nPhrase = nPhrase;
+ p1->apExprPhrase = ap;
+ }
+ }
+ sqlite3_free(p2->apExprPhrase);
+ sqlite3_free(p2);
+ }else{
+ *pp1 = p2;
+ }
+
+ return sParse.rc;
+}
+
/*
** Argument pTerm must be a synonym iterator. Return the current rowid
** that it points to.
@@ -210475,6 +211670,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
}else{
/* TODO1: Fix this */
pRet->p[nByte] = 0x00;
+ pRet->p[nByte+1] = 0x00;
pRet->szLeaf = fts5GetU16(&pRet->p[2]);
}
}
@@ -210497,7 +211693,7 @@ static void fts5DataRelease(Fts5Data *pData){
static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){
Fts5Data *pRet = fts5DataRead(p, iRowid);
if( pRet ){
- if( pRet->szLeaf>pRet->nn ){
+ if( pRet->nn<4 || pRet->szLeaf>pRet->nn ){
p->rc = FTS5_CORRUPT;
fts5DataRelease(pRet);
pRet = 0;
@@ -214781,9 +215977,12 @@ static void fts5MergePrefixLists(
Fts5PoslistWriter writer;
memset(&writer, 0, sizeof(writer));
+ /* See the earlier comment in this function for an explanation of why
+ ** corrupt input position lists might cause the output to consume
+ ** at most 20 bytes of unexpected space. */
fts5MergeAppendDocid(&out, iLastRowid, i2.iRowid);
fts5BufferZero(&tmp);
- sqlite3Fts5BufferSize(&p->rc, &tmp, i1.nPoslist + i2.nPoslist);
+ sqlite3Fts5BufferSize(&p->rc, &tmp, i1.nPoslist + i2.nPoslist + 10 + 10);
if( p->rc ) break;
sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
@@ -214831,6 +216030,12 @@ static void fts5MergePrefixLists(
}
/* WRITEPOSLISTSIZE */
+ assert_nc( tmp.n<=i1.nPoslist+i2.nPoslist );
+ assert( tmp.n<=i1.nPoslist+i2.nPoslist+10+10 );
+ if( tmp.n>i1.nPoslist+i2.nPoslist ){
+ if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
+ break;
+ }
fts5BufferSafeAppendVarint(&out, tmp.n * 2);
fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n);
fts5DoclistIterNext(&i1);
@@ -216832,17 +218037,39 @@ static void fts5SetUniqueFlag(sqlite3_index_info *pIdxInfo){
** Implementation of the xBestIndex method for FTS5 tables. Within the
** WHERE constraint, it searches for the following:
**
-** 1. A MATCH constraint against the special column.
+** 1. A MATCH constraint against the table column.
** 2. A MATCH constraint against the "rank" column.
-** 3. An == constraint against the rowid column.
-** 4. A < or <= constraint against the rowid column.
-** 5. A > or >= constraint against the rowid column.
+** 3. A MATCH constraint against some other column.
+** 4. An == constraint against the rowid column.
+** 5. A < or <= constraint against the rowid column.
+** 6. A > or >= constraint against the rowid column.
**
-** Within the ORDER BY, either:
+** Within the ORDER BY, the following are supported:
**
** 5. ORDER BY rank [ASC|DESC]
** 6. ORDER BY rowid [ASC|DESC]
**
+** Information for the xFilter call is passed via both the idxNum and
+** idxStr variables. Specifically, idxNum is a bitmask of the following
+** flags used to encode the ORDER BY clause:
+**
+** FTS5_BI_ORDER_RANK
+** FTS5_BI_ORDER_ROWID
+** FTS5_BI_ORDER_DESC
+**
+** idxStr is used to encode data from the WHERE clause. For each argument
+** passed to the xFilter method, the following is appended to idxStr:
+**
+** Match against table column: "m"
+** Match against rank column: "r"
+** Match against other column: "<column-number>"
+** Equality constraint against the rowid: "="
+** A < or <= against the rowid: "<"
+** A > or >= against the rowid: ">"
+**
+** This function ensures that there is at most one "r" or "=". And that if
+** there exists an "=" then there is no "<" or ">".
+**
** Costs are assigned as follows:
**
** a) If an unusable MATCH operator is present in the WHERE clause, the
@@ -216870,32 +218097,18 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
Fts5Config *pConfig = pTab->pConfig;
const int nCol = pConfig->nCol;
int idxFlags = 0; /* Parameter passed through to xFilter() */
- int bHasMatch;
- int iNext;
int i;
- struct Constraint {
- int op; /* Mask against sqlite3_index_constraint.op */
- int fts5op; /* FTS5 mask for idxFlags */
- int iCol; /* 0==rowid, 1==tbl, 2==rank */
- int omit; /* True to omit this if found */
- int iConsIndex; /* Index in pInfo->aConstraint[] */
- } aConstraint[] = {
- {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ,
- FTS5_BI_MATCH, 1, 1, -1},
- {SQLITE_INDEX_CONSTRAINT_MATCH|SQLITE_INDEX_CONSTRAINT_EQ,
- FTS5_BI_RANK, 2, 1, -1},
- {SQLITE_INDEX_CONSTRAINT_EQ, FTS5_BI_ROWID_EQ, 0, 0, -1},
- {SQLITE_INDEX_CONSTRAINT_LT|SQLITE_INDEX_CONSTRAINT_LE,
- FTS5_BI_ROWID_LE, 0, 0, -1},
- {SQLITE_INDEX_CONSTRAINT_GT|SQLITE_INDEX_CONSTRAINT_GE,
- FTS5_BI_ROWID_GE, 0, 0, -1},
- };
+ char *idxStr;
+ int iIdxStr = 0;
+ int iCons = 0;
+
+ int bSeenEq = 0;
+ int bSeenGt = 0;
+ int bSeenLt = 0;
+ int bSeenMatch = 0;
+ int bSeenRank = 0;
- int aColMap[3];
- aColMap[0] = -1;
- aColMap[1] = nCol;
- aColMap[2] = nCol+1;
assert( SQLITE_INDEX_CONSTRAINT_EQ<SQLITE_INDEX_CONSTRAINT_MATCH );
assert( SQLITE_INDEX_CONSTRAINT_GT<SQLITE_INDEX_CONSTRAINT_MATCH );
@@ -216903,40 +218116,85 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
assert( SQLITE_INDEX_CONSTRAINT_GE<SQLITE_INDEX_CONSTRAINT_MATCH );
assert( SQLITE_INDEX_CONSTRAINT_LE<SQLITE_INDEX_CONSTRAINT_MATCH );
- /* Set idxFlags flags for all WHERE clause terms that will be used. */
+ if( pConfig->bLock ){
+ pTab->base.zErrMsg = sqlite3_mprintf(
+ "recursively defined fts5 content table"
+ );
+ return SQLITE_ERROR;
+ }
+
+ idxStr = (char*)sqlite3_malloc(pInfo->nConstraint * 6 + 1);
+ if( idxStr==0 ) return SQLITE_NOMEM;
+ pInfo->idxStr = idxStr;
+ pInfo->needToFreeIdxStr = 1;
+
for(i=0; i<pInfo->nConstraint; i++){
struct sqlite3_index_constraint *p = &pInfo->aConstraint[i];
int iCol = p->iColumn;
-
- if( (p->op==SQLITE_INDEX_CONSTRAINT_MATCH && iCol>=0 && iCol<=nCol)
- || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol==nCol)
+ if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH
+ || (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol)
){
/* A MATCH operator or equivalent */
- if( p->usable ){
- idxFlags = (idxFlags & 0xFFFF) | FTS5_BI_MATCH | (iCol << 16);
- aConstraint[0].iConsIndex = i;
- }else{
+ if( p->usable==0 || iCol<0 ){
/* As there exists an unusable MATCH constraint this is an
** unusable plan. Set a prohibitively high cost. */
pInfo->estimatedCost = 1e50;
+ assert( iIdxStr < pInfo->nConstraint*6 + 1 );
+ idxStr[iIdxStr] = 0;
return SQLITE_OK;
+ }else{
+ if( iCol==nCol+1 ){
+ if( bSeenRank ) continue;
+ idxStr[iIdxStr++] = 'r';
+ bSeenRank = 1;
+ }else{
+ bSeenMatch = 1;
+ idxStr[iIdxStr++] = 'm';
+ if( iCol<nCol ){
+ sqlite3_snprintf(6, &idxStr[iIdxStr], "%d", iCol);
+ idxStr += strlen(&idxStr[iIdxStr]);
+ assert( idxStr[iIdxStr]=='\0' );
+ }
+ }
+ pInfo->aConstraintUsage[i].argvIndex = ++iCons;
+ pInfo->aConstraintUsage[i].omit = 1;
}
- }else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){
- int j;
- for(j=1; j<ArraySize(aConstraint); j++){
- struct Constraint *pC = &aConstraint[j];
- if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){
- pC->iConsIndex = i;
- idxFlags |= pC->fts5op;
+ }
+ else if( p->usable && bSeenEq==0
+ && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0
+ ){
+ idxStr[iIdxStr++] = '=';
+ bSeenEq = 1;
+ pInfo->aConstraintUsage[i].argvIndex = ++iCons;
+ }
+ }
+
+ if( bSeenEq==0 ){
+ for(i=0; i<pInfo->nConstraint; i++){
+ struct sqlite3_index_constraint *p = &pInfo->aConstraint[i];
+ if( p->iColumn<0 && p->usable ){
+ int op = p->op;
+ if( op==SQLITE_INDEX_CONSTRAINT_LT || op==SQLITE_INDEX_CONSTRAINT_LE ){
+ if( bSeenLt ) continue;
+ idxStr[iIdxStr++] = '<';
+ pInfo->aConstraintUsage[i].argvIndex = ++iCons;
+ bSeenLt = 1;
+ }else
+ if( op==SQLITE_INDEX_CONSTRAINT_GT || op==SQLITE_INDEX_CONSTRAINT_GE ){
+ if( bSeenGt ) continue;
+ idxStr[iIdxStr++] = '>';
+ pInfo->aConstraintUsage[i].argvIndex = ++iCons;
+ bSeenGt = 1;
}
}
}
}
+ idxStr[iIdxStr] = '\0';
/* Set idxFlags flags for the ORDER BY clause */
if( pInfo->nOrderBy==1 ){
int iSort = pInfo->aOrderBy[0].iColumn;
- if( iSort==(pConfig->nCol+1) && BitFlagTest(idxFlags, FTS5_BI_MATCH) ){
+ if( iSort==(pConfig->nCol+1) && bSeenMatch ){
idxFlags |= FTS5_BI_ORDER_RANK;
}else if( iSort==-1 ){
idxFlags |= FTS5_BI_ORDER_ROWID;
@@ -216950,26 +218208,15 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
}
/* Calculate the estimated cost based on the flags set in idxFlags. */
- bHasMatch = BitFlagTest(idxFlags, FTS5_BI_MATCH);
- if( BitFlagTest(idxFlags, FTS5_BI_ROWID_EQ) ){
- pInfo->estimatedCost = bHasMatch ? 100.0 : 10.0;
- if( bHasMatch==0 ) fts5SetUniqueFlag(pInfo);
- }else if( BitFlagAllTest(idxFlags, FTS5_BI_ROWID_LE|FTS5_BI_ROWID_GE) ){
- pInfo->estimatedCost = bHasMatch ? 500.0 : 250000.0;
- }else if( BitFlagTest(idxFlags, FTS5_BI_ROWID_LE|FTS5_BI_ROWID_GE) ){
- pInfo->estimatedCost = bHasMatch ? 750.0 : 750000.0;
+ if( bSeenEq ){
+ pInfo->estimatedCost = bSeenMatch ? 100.0 : 10.0;
+ if( bSeenMatch==0 ) fts5SetUniqueFlag(pInfo);
+ }else if( bSeenLt && bSeenGt ){
+ pInfo->estimatedCost = bSeenMatch ? 500.0 : 250000.0;
+ }else if( bSeenLt || bSeenGt ){
+ pInfo->estimatedCost = bSeenMatch ? 750.0 : 750000.0;
}else{
- pInfo->estimatedCost = bHasMatch ? 1000.0 : 1000000.0;
- }
-
- /* Assign argvIndex values to each constraint in use. */
- iNext = 1;
- for(i=0; i<ArraySize(aConstraint); i++){
- struct Constraint *pC = &aConstraint[i];
- if( pC->iConsIndex>=0 ){
- pInfo->aConstraintUsage[pC->iConsIndex].argvIndex = iNext++;
- pInfo->aConstraintUsage[pC->iConsIndex].omit = (unsigned char)pC->omit;
- }
+ pInfo->estimatedCost = bSeenMatch ? 1000.0 : 1000000.0;
}
pInfo->idxNum = idxFlags;
@@ -217292,7 +218539,7 @@ static int fts5CursorFirstSorted(
**
** If SQLite a built-in statement cache, this wouldn't be a problem. */
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig,
- "SELECT rowid, rank FROM %Q.%Q ORDER BY %s(%s%s%s) %s",
+ "SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s",
pConfig->zDb, pConfig->zName, zRank, pConfig->zName,
(zRankArgs ? ", " : ""),
(zRankArgs ? zRankArgs : ""),
@@ -217348,10 +218595,10 @@ static int fts5SpecialMatch(
assert( pTab->p.base.zErrMsg==0 );
pCsr->ePlan = FTS5_PLAN_SPECIAL;
- if( 0==sqlite3_strnicmp("reads", z, n) ){
+ if( n==5 && 0==sqlite3_strnicmp("reads", z, n) ){
pCsr->iSpecial = sqlite3Fts5IndexReads(pTab->p.pIndex);
}
- else if( 0==sqlite3_strnicmp("id", z, n) ){
+ else if( n==2 && 0==sqlite3_strnicmp("id", z, n) ){
pCsr->iSpecial = pCsr->iCsrId;
}
else{
@@ -217492,7 +218739,7 @@ static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
static int fts5FilterMethod(
sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */
int idxNum, /* Strategy index */
- const char *zUnused, /* Unused */
+ const char *idxStr, /* Unused */
int nVal, /* Number of elements in apVal */
sqlite3_value **apVal /* Arguments for the indexing scheme */
){
@@ -217500,19 +218747,17 @@ static int fts5FilterMethod(
Fts5Config *pConfig = pTab->p.pConfig;
Fts5Cursor *pCsr = (Fts5Cursor*)pCursor;
int rc = SQLITE_OK; /* Error code */
- int iVal = 0; /* Counter for apVal[] */
int bDesc; /* True if ORDER BY [rank|rowid] DESC */
int bOrderByRank; /* True if ORDER BY rank */
- sqlite3_value *pMatch = 0; /* <tbl> MATCH ? expression (or NULL) */
sqlite3_value *pRank = 0; /* rank MATCH ? expression (or NULL) */
sqlite3_value *pRowidEq = 0; /* rowid = ? expression (or NULL) */
sqlite3_value *pRowidLe = 0; /* rowid <= ? expression (or NULL) */
sqlite3_value *pRowidGe = 0; /* rowid >= ? expression (or NULL) */
int iCol; /* Column on LHS of MATCH operator */
char **pzErrmsg = pConfig->pzErrmsg;
-
- UNUSED_PARAM(zUnused);
- UNUSED_PARAM(nVal);
+ int i;
+ int iIdxStr = 0;
+ Fts5Expr *pExpr = 0;
if( pCsr->ePlan ){
fts5FreeCursorComponents(pCsr);
@@ -217525,23 +218770,60 @@ static int fts5FilterMethod(
assert( pCsr->pRank==0 );
assert( pCsr->zRank==0 );
assert( pCsr->zRankArgs==0 );
+ assert( pTab->pSortCsr==0 || nVal==0 );
assert( pzErrmsg==0 || pzErrmsg==&pTab->p.base.zErrMsg );
pConfig->pzErrmsg = &pTab->p.base.zErrMsg;
- /* Decode the arguments passed through to this function.
- **
- ** Note: The following set of if(...) statements must be in the same
- ** order as the corresponding entries in the struct at the top of
- ** fts5BestIndexMethod(). */
- if( BitFlagTest(idxNum, FTS5_BI_MATCH) ) pMatch = apVal[iVal++];
- if( BitFlagTest(idxNum, FTS5_BI_RANK) ) pRank = apVal[iVal++];
- if( BitFlagTest(idxNum, FTS5_BI_ROWID_EQ) ) pRowidEq = apVal[iVal++];
- if( BitFlagTest(idxNum, FTS5_BI_ROWID_LE) ) pRowidLe = apVal[iVal++];
- if( BitFlagTest(idxNum, FTS5_BI_ROWID_GE) ) pRowidGe = apVal[iVal++];
- iCol = (idxNum>>16);
- assert( iCol>=0 && iCol<=pConfig->nCol );
- assert( iVal==nVal );
+ /* Decode the arguments passed through to this function. */
+ for(i=0; i<nVal; i++){
+ switch( idxStr[iIdxStr++] ){
+ case 'r':
+ pRank = apVal[i];
+ break;
+ case 'm': {
+ const char *zText = (const char*)sqlite3_value_text(apVal[i]);
+ if( zText==0 ) zText = "";
+
+ if( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' ){
+ iCol = 0;
+ do{
+ iCol = iCol*10 + (idxStr[iIdxStr]-'0');
+ iIdxStr++;
+ }while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' );
+ }else{
+ iCol = pConfig->nCol;
+ }
+
+ if( zText[0]=='*' ){
+ /* The user has issued a query of the form "MATCH '*...'". This
+ ** indicates that the MATCH expression is not a full text query,
+ ** but a request for an internal parameter. */
+ rc = fts5SpecialMatch(pTab, pCsr, &zText[1]);
+ goto filter_out;
+ }else{
+ char **pzErr = &pTab->p.base.zErrMsg;
+ rc = sqlite3Fts5ExprNew(pConfig, iCol, zText, &pExpr, pzErr);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3Fts5ExprAnd(&pCsr->pExpr, pExpr);
+ pExpr = 0;
+ }
+ if( rc!=SQLITE_OK ) goto filter_out;
+ }
+
+ break;
+ }
+ case '=':
+ pRowidEq = apVal[i];
+ break;
+ case '<':
+ pRowidLe = apVal[i];
+ break;
+ default: assert( idxStr[iIdxStr-1]=='>' );
+ pRowidGe = apVal[i];
+ break;
+ }
+ }
bOrderByRank = ((idxNum & FTS5_BI_ORDER_RANK) ? 1 : 0);
pCsr->bDesc = bDesc = ((idxNum & FTS5_BI_ORDER_DESC) ? 1 : 0);
@@ -217568,7 +218850,7 @@ static int fts5FilterMethod(
** (pCursor) is used to execute the query issued by function
** fts5CursorFirstSorted() above. */
assert( pRowidEq==0 && pRowidLe==0 && pRowidGe==0 && pRank==0 );
- assert( nVal==0 && pMatch==0 && bOrderByRank==0 && bDesc==0 );
+ assert( nVal==0 && bOrderByRank==0 && bDesc==0 );
assert( pCsr->iLastRowid==LARGEST_INT64 );
assert( pCsr->iFirstRowid==SMALLEST_INT64 );
if( pTab->pSortCsr->bDesc ){
@@ -217581,29 +218863,15 @@ static int fts5FilterMethod(
pCsr->ePlan = FTS5_PLAN_SOURCE;
pCsr->pExpr = pTab->pSortCsr->pExpr;
rc = fts5CursorFirst(pTab, pCsr, bDesc);
- }else if( pMatch ){
- const char *zExpr = (const char*)sqlite3_value_text(apVal[0]);
- if( zExpr==0 ) zExpr = "";
-
+ }else if( pCsr->pExpr ){
rc = fts5CursorParseRank(pConfig, pCsr, pRank);
if( rc==SQLITE_OK ){
- if( zExpr[0]=='*' ){
- /* The user has issued a query of the form "MATCH '*...'". This
- ** indicates that the MATCH expression is not a full text query,
- ** but a request for an internal parameter. */
- rc = fts5SpecialMatch(pTab, pCsr, &zExpr[1]);
+ if( bOrderByRank ){
+ pCsr->ePlan = FTS5_PLAN_SORTED_MATCH;
+ rc = fts5CursorFirstSorted(pTab, pCsr, bDesc);
}else{
- char **pzErr = &pTab->p.base.zErrMsg;
- rc = sqlite3Fts5ExprNew(pConfig, iCol, zExpr, &pCsr->pExpr, pzErr);
- if( rc==SQLITE_OK ){
- if( bOrderByRank ){
- pCsr->ePlan = FTS5_PLAN_SORTED_MATCH;
- rc = fts5CursorFirstSorted(pTab, pCsr, bDesc);
- }else{
- pCsr->ePlan = FTS5_PLAN_MATCH;
- rc = fts5CursorFirst(pTab, pCsr, bDesc);
- }
- }
+ pCsr->ePlan = FTS5_PLAN_MATCH;
+ rc = fts5CursorFirst(pTab, pCsr, bDesc);
}
}
}else if( pConfig->zContent==0 ){
@@ -217620,7 +218888,7 @@ static int fts5FilterMethod(
);
if( rc==SQLITE_OK ){
if( pCsr->ePlan==FTS5_PLAN_ROWID ){
- sqlite3_bind_value(pCsr->pStmt, 1, apVal[0]);
+ sqlite3_bind_value(pCsr->pStmt, 1, pRowidEq);
}else{
sqlite3_bind_int64(pCsr->pStmt, 1, pCsr->iFirstRowid);
sqlite3_bind_int64(pCsr->pStmt, 2, pCsr->iLastRowid);
@@ -217629,6 +218897,8 @@ static int fts5FilterMethod(
}
}
+ filter_out:
+ sqlite3Fts5ExprFree(pExpr);
pConfig->pzErrmsg = pzErrmsg;
return rc;
}
@@ -218599,7 +219869,7 @@ static void fts5ApiCallback(
iCsrId = sqlite3_value_int64(argv[0]);
pCsr = fts5CursorFromCsrid(pAux->pGlobal, iCsrId);
- if( pCsr==0 ){
+ if( pCsr==0 || pCsr->ePlan==0 ){
char *zErr = sqlite3_mprintf("no such cursor: %lld", iCsrId);
sqlite3_result_error(context, zErr, -1);
sqlite3_free(zErr);
@@ -219015,7 +220285,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
- sqlite3_result_text(pCtx, "fts5: 2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6", -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(pCtx, "fts5: 2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b", -1, SQLITE_TRANSIENT);
}
/*
@@ -219287,7 +220557,9 @@ static int fts5StorageGetStmt(
}else{
int f = SQLITE_PREPARE_PERSISTENT;
if( eStmt>FTS5_STMT_LOOKUP ) f |= SQLITE_PREPARE_NO_VTAB;
+ p->pConfig->bLock++;
rc = sqlite3_prepare_v3(pC->db, zSql, -1, f, &p->aStmt[eStmt], 0);
+ p->pConfig->bLock--;
sqlite3_free(zSql);
if( rc!=SQLITE_OK && pzErrMsg ){
*pzErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pC->db));
@@ -223781,9 +225053,9 @@ SQLITE_API int sqlite3_stmt_init(
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
/************** End of stmt.c ************************************************/
-#if __LINE__!=223781
+#if __LINE__!=225056
#undef SQLITE_SOURCE_ID
-#define SQLITE_SOURCE_ID "2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88alt2"
+#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3dfalt2"
#endif
/* Return the source-id for this library */
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
diff --git a/src/3rdparty/sqlite/sqlite3.h b/src/3rdparty/sqlite/sqlite3.h
index a4bab0ad6b..37bfac5289 100644
--- a/src/3rdparty/sqlite/sqlite3.h
+++ b/src/3rdparty/sqlite/sqlite3.h
@@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.29.0"
-#define SQLITE_VERSION_NUMBER 3029000
-#define SQLITE_SOURCE_ID "2019-07-10 17:32:03 fc82b73eaac8b36950e527f12c4b5dc1e147e6f4ad2217ae43ad82882a88bfa6"
+#define SQLITE_VERSION "3.30.1"
+#define SQLITE_VERSION_NUMBER 3030001
+#define SQLITE_SOURCE_ID "2019-10-10 20:19:45 18db032d058f1436ce3dea84081f4ee5a0f2259ad97301d43c426bc7f3df1b0b"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -2093,6 +2093,17 @@ struct sqlite3_mem_methods {
** following this call. The second parameter may be a NULL pointer, in
** which case the trigger setting is not reported back. </dd>
**
+** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
+** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
+** <dd> ^This option is used to enable or disable [CREATE VIEW | views].
+** There should be two additional arguments.
+** The first argument is an integer which is 0 to disable views,
+** positive to enable views or negative to leave the setting unchanged.
+** The second parameter is a pointer to an integer into which
+** is written 0 or 1 to indicate whether views are disabled or enabled
+** following this call. The second parameter may be a NULL pointer, in
+** which case the view setting is not reported back. </dd>
+**
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
** <dd> ^This option is used to enable or disable the
@@ -2265,7 +2276,8 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE 1012 /* int int* */
#define SQLITE_DBCONFIG_DQS_DML 1013 /* int int* */
#define SQLITE_DBCONFIG_DQS_DDL 1014 /* int int* */
-#define SQLITE_DBCONFIG_MAX 1014 /* Largest DBCONFIG */
+#define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */
+#define SQLITE_DBCONFIG_MAX 1015 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -3814,7 +3826,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** ^The specific value of WHERE-clause [parameter] might influence the
** choice of query plan if the parameter is the left-hand side of a [LIKE]
** or [GLOB] operator or if the parameter is compared to an indexed column
-** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled.
+** and the [SQLITE_ENABLE_STAT4] compile-time option is enabled.
** </li>
** </ol>
**
@@ -4849,6 +4861,12 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
** perform additional optimizations on deterministic functions, so use
** of the [SQLITE_DETERMINISTIC] flag is recommended where possible.
**
+** ^The fourth parameter may also optionally include the [SQLITE_DIRECTONLY]
+** flag, which if present prevents the function from being invoked from
+** within VIEWs or TRIGGERs. For security reasons, the [SQLITE_DIRECTONLY]
+** flag is recommended for any application-defined SQL function that has
+** side-effects.
+**
** ^(The fifth parameter is an arbitrary pointer. The implementation of the
** function can gain access to this pointer using [sqlite3_user_data()].)^
**
@@ -4965,8 +4983,30 @@ SQLITE_API int sqlite3_create_window_function(
** [SQLITE_UTF8 | preferred text encoding] as the fourth argument
** to [sqlite3_create_function()], [sqlite3_create_function16()], or
** [sqlite3_create_function_v2()].
+**
+** The SQLITE_DETERMINISTIC flag means that the new function will always
+** maps the same inputs into the same output. The abs() function is
+** deterministic, for example, but randomblob() is not.
+**
+** The SQLITE_DIRECTONLY flag means that the function may only be invoked
+** from top-level SQL, and cannot be used in VIEWs or TRIGGERs. This is
+** a security feature which is recommended for all
+** [application-defined SQL functions] that have side-effects. This flag
+** prevents an attacker from adding triggers and views to a schema then
+** tricking a high-privilege application into causing unintended side-effects
+** while performing ordinary queries.
+**
+** The SQLITE_SUBTYPE flag indicates to SQLite that a function may call
+** [sqlite3_value_subtype()] to inspect the sub-types of its arguments.
+** Specifying this flag makes no difference for scalar or aggregate user
+** functions. However, if it is not specified for a user-defined window
+** function, then any sub-types belonging to arguments passed to the window
+** function may be discarded before the window function is called (i.e.
+** sqlite3_value_subtype() will always return 0).
*/
-#define SQLITE_DETERMINISTIC 0x800
+#define SQLITE_DETERMINISTIC 0x000000800
+#define SQLITE_DIRECTONLY 0x000080000
+#define SQLITE_SUBTYPE 0x000100000
/*
** CAPI3REF: Deprecated Functions
@@ -6612,6 +6652,12 @@ struct sqlite3_index_info {
** ^The sqlite3_create_module()
** interface is equivalent to sqlite3_create_module_v2() with a NULL
** destructor.
+**
+** ^If the third parameter (the pointer to the sqlite3_module object) is
+** NULL then no new module is create and any existing modules with the
+** same name are dropped.
+**
+** See also: [sqlite3_drop_modules()]
*/
SQLITE_API int sqlite3_create_module(
sqlite3 *db, /* SQLite connection to register module with */
@@ -6628,6 +6674,23 @@ SQLITE_API int sqlite3_create_module_v2(
);
/*
+** CAPI3REF: Remove Unnecessary Virtual Table Implementations
+** METHOD: sqlite3
+**
+** ^The sqlite3_drop_modules(D,L) interface removes all virtual
+** table modules from database connection D except those named on list L.
+** The L parameter must be either NULL or a pointer to an array of pointers
+** to strings where the array is terminated by a single NULL pointer.
+** ^If the L parameter is NULL, then all virtual table modules are removed.
+**
+** See also: [sqlite3_create_module()]
+*/
+SQLITE_API int sqlite3_drop_modules(
+ sqlite3 *db, /* Remove modules from this connection */
+ const char **azKeep /* Except, do not remove the ones named here */
+);
+
+/*
** CAPI3REF: Virtual Table Instance Object
** KEYWORDS: sqlite3_vtab
**
@@ -7335,7 +7398,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_FIRST 5
#define SQLITE_TESTCTRL_PRNG_SAVE 5
#define SQLITE_TESTCTRL_PRNG_RESTORE 6
-#define SQLITE_TESTCTRL_PRNG_RESET 7
+#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
#define SQLITE_TESTCTRL_BITVEC_TEST 8
#define SQLITE_TESTCTRL_FAULT_INSTALL 9
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
@@ -7358,7 +7421,9 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_IMPOSTER 25
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
-#define SQLITE_TESTCTRL_LAST 27 /* Largest TESTCTRL */
+#define SQLITE_TESTCTRL_PRNG_SEED 28
+#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
+#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
/*
** CAPI3REF: SQL Keyword Checking
diff --git a/src/android/jar/jar.pro b/src/android/jar/jar.pro
index ac6fc79968..24a83d56a1 100644
--- a/src/android/jar/jar.pro
+++ b/src/android/jar/jar.pro
@@ -1,6 +1,7 @@
TARGET = QtAndroid
CONFIG += java
+
DESTDIR = $$[QT_INSTALL_PREFIX/get]/jar
PATHPREFIX = $$PWD/src/org/qtproject/qt5/android/
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index c33d5016ce..7db16002ff 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -1013,6 +1013,25 @@ public class QtNative
});
}
+ private static String[] listAssetContent(android.content.res.AssetManager asset, String path) {
+ String [] list;
+ ArrayList<String> res = new ArrayList<String>();
+ try {
+ list = asset.list(path);
+ if (list.length > 0) {
+ for (String file : list) {
+ try {
+ String[] isDir = asset.list(path.length() > 0 ? path + "/" + file : file);
+ if (isDir != null && isDir.length > 0)
+ file += "/";
+ res.add(file);
+ } catch (Exception e) {}
+ }
+ }
+ } catch (Exception e) {}
+ return res.toArray(new String[res.size()]);
+ }
+
// screen methods
public static native void setDisplayMetrics(int screenWidthPixels,
int screenHeightPixels,
diff --git a/src/android/java/java.pro b/src/android/java/java.pro
index 9d37eb1026..7f0dfa8a1b 100644
--- a/src/android/java/java.pro
+++ b/src/android/java/java.pro
@@ -1,3 +1,5 @@
+CONFIG += single_arch
+
CONFIG -= qt android_install
javaresources.files = \
diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
index 9d5578ed6d..1e72aa3841 100644
--- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
+++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2016, BogDan Vatra <bogdan@kde.org>
+ Copyright (c) 2019, BogDan Vatra <bogdan@kde.org>
Contact: http://www.qt.io/licensing/
Commercial License Usage
@@ -44,8 +44,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ComponentInfo;
-import android.content.pm.PackageInfo;
-import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
@@ -55,17 +53,13 @@ import android.util.Log;
import org.kde.necessitas.ministro.IMinistro;
import org.kde.necessitas.ministro.IMinistroCallback;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
import dalvik.system.DexClassLoader;
@@ -85,9 +79,6 @@ public abstract class QtLoader {
public static final String ENVIRONMENT_VARIABLES_KEY = "environment.variables";
public static final String APPLICATION_PARAMETERS_KEY = "application.parameters";
public static final String BUNDLED_LIBRARIES_KEY = "bundled.libraries";
- public static final String QT_LIBS_RESOURCE_ID_KEY = "android.app.qt_libs_resource_id";
- public static final String BUNDLED_IN_LIB_RESOURCE_ID_KEY = "android.app.bundled_in_lib_resource_id";
- public static final String BUNDLED_IN_ASSETS_RESOURCE_ID_KEY = "android.app.bundled_in_assets_resource_id";
public static final String MAIN_LIBRARY_KEY = "main.library";
public static final String STATIC_INIT_CLASSES_KEY = "static.init.classes";
public static final String NECESSITAS_API_LEVEL_KEY = "necessitas.api.level";
@@ -139,7 +130,6 @@ public abstract class QtLoader {
public String QT_ANDROID_DEFAULT_THEME = null; // sets the default theme.
public static final int INCOMPATIBLE_MINISTRO_VERSION = 1; // Incompatible Ministro version. Ministro needs to be upgraded.
- public static final int BUFFER_SIZE = 1024;
public String[] m_sources = {"https://download.qt-project.org/ministro/android/qt5/qt-5.7"}; // Make sure you are using ONLY secure locations
public String m_repository = "default"; // Overwrites the default Ministro repository
@@ -153,12 +143,15 @@ public abstract class QtLoader {
// this repository is used to push a new release, and should be used to test your application.
// * unstable - unstable repository, DO NOT use this repository in production,
// this repository is used to push Qt snapshots.
- public String[] m_qtLibs = null; // required qt libs
+ public ArrayList<String> m_qtLibs = null; // required qt libs
public int m_displayDensity = -1;
private ContextWrapper m_context;
protected ComponentInfo m_contextInfo;
private Class<?> m_delegateClass;
+ private static ArrayList<FileOutputStream> m_fileOutputStreams = new ArrayList<FileOutputStream>();
+ // List of open file streams associated with files copied during installation.
+
QtLoader(ContextWrapper context, Class<?> clazz) {
m_context = context;
m_delegateClass = clazz;
@@ -188,6 +181,36 @@ public abstract class QtLoader {
}
// Implement in subclass
+ private final List<String> supportedAbis = Arrays.asList(Build.SUPPORTED_ABIS);
+ private String preferredAbi = null;
+
+ private ArrayList<String> prefferedAbiLibs(String []libs)
+ {
+ HashMap<String, ArrayList<String>> abisLibs = new HashMap<>();
+ for (String lib : libs) {
+ String[] archLib = lib.split(";", 2);
+ if (preferredAbi != null && !archLib[0].equals(preferredAbi))
+ continue;
+ if (!abisLibs.containsKey(archLib[0]))
+ abisLibs.put(archLib[0], new ArrayList<String>());
+ abisLibs.get(archLib[0]).add(archLib[1]);
+ }
+
+ if (preferredAbi != null) {
+ if (abisLibs.containsKey(preferredAbi)) {
+ return abisLibs.get(preferredAbi);
+ }
+ return new ArrayList<String>();
+ }
+
+ for (String abi: supportedAbis) {
+ if (abisLibs.containsKey(abi)) {
+ preferredAbi = abi;
+ return abisLibs.get(abi);
+ }
+ }
+ return new ArrayList<String>();
+ }
// this function is used to load and start the loader
private void loadApplication(Bundle loaderParams)
@@ -215,12 +238,14 @@ public abstract class QtLoader {
// add all bundled Qt libs to loader params
ArrayList<String> libs = new ArrayList<String>();
- if (m_contextInfo.metaData.containsKey("android.app.bundled_libs_resource_id"))
- libs.addAll(Arrays.asList(m_context.getResources().getStringArray(m_contextInfo.metaData.getInt("android.app.bundled_libs_resource_id"))));
+ if (m_contextInfo.metaData.containsKey("android.app.bundled_libs_resource_id")) {
+ int resourceId = m_contextInfo.metaData.getInt("android.app.bundled_libs_resource_id");
+ libs.addAll(prefferedAbiLibs(m_context.getResources().getStringArray(resourceId)));
+ }
String libName = null;
if (m_contextInfo.metaData.containsKey("android.app.lib_name")) {
- libName = m_contextInfo.metaData.getString("android.app.lib_name");
+ libName = m_contextInfo.metaData.getString("android.app.lib_name") + "_" + preferredAbi;
loaderParams.putString(MAIN_LIBRARY_KEY, libName); //main library contains main() function
}
@@ -275,7 +300,7 @@ public abstract class QtLoader {
try {
if (m_service != null) {
Bundle parameters = new Bundle();
- parameters.putStringArray(REQUIRED_MODULES_KEY, m_qtLibs);
+ parameters.putStringArray(REQUIRED_MODULES_KEY, (String[]) m_qtLibs.toArray());
parameters.putString(APPLICATION_TITLE_KEY, getTitle());
parameters.putInt(MINIMUM_MINISTRO_API_KEY, MINISTRO_API_LEVEL);
parameters.putInt(MINIMUM_QT_VERSION_KEY, QT_VERSION);
@@ -331,215 +356,6 @@ public abstract class QtLoader {
errorDialog.show();
}
- static private void copyFile(InputStream inputStream, OutputStream outputStream)
- throws IOException
- {
- byte[] buffer = new byte[BUFFER_SIZE];
-
- int count;
- while ((count = inputStream.read(buffer)) > 0)
- outputStream.write(buffer, 0, count);
- }
-
- private void copyAsset(String source, String destination)
- throws IOException
- {
- // Already exists, we don't have to do anything
- File destinationFile = new File(destination);
- if (destinationFile.exists())
- return;
-
- File parentDirectory = destinationFile.getParentFile();
- if (!parentDirectory.exists())
- parentDirectory.mkdirs();
-
- destinationFile.createNewFile();
-
- AssetManager assetsManager = m_context.getAssets();
- InputStream inputStream = null;
- OutputStream outputStream = null;
- try {
- inputStream = assetsManager.open(source);
- outputStream = new FileOutputStream(destinationFile);
- copyFile(inputStream, outputStream);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (inputStream != null)
- inputStream.close();
-
- if (outputStream != null)
- outputStream.close();
- }
- }
-
- private static void createBundledBinary(String source, String destination)
- throws IOException
- {
- // Already exists, we don't have to do anything
- File destinationFile = new File(destination);
- if (destinationFile.exists())
- return;
-
- File parentDirectory = destinationFile.getParentFile();
- if (!parentDirectory.exists())
- parentDirectory.mkdirs();
-
- destinationFile.createNewFile();
-
- InputStream inputStream = null;
- OutputStream outputStream = null;
- try {
- inputStream = new FileInputStream(source);
- outputStream = new FileOutputStream(destinationFile);
- copyFile(inputStream, outputStream);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (inputStream != null)
- inputStream.close();
-
- if (outputStream != null)
- outputStream.close();
- }
- }
-
- private boolean cleanCacheIfNecessary(String pluginsPrefix, long packageVersion)
- {
- File versionFile = new File(pluginsPrefix + "cache.version");
-
- long cacheVersion = 0;
- if (versionFile.exists() && versionFile.canRead()) {
- DataInputStream inputStream = null;
- try {
- inputStream = new DataInputStream(new FileInputStream(versionFile));
- cacheVersion = inputStream.readLong();
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (inputStream != null) {
- try {
- inputStream.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- if (cacheVersion != packageVersion) {
- deleteRecursively(new File(pluginsPrefix));
- return true;
- } else {
- return false;
- }
- }
-
- private void extractBundledPluginsAndImports(String pluginsPrefix, String libsDir)
- throws IOException
- {
- long packageVersion = -1;
- try {
- PackageInfo packageInfo = m_context.getPackageManager().getPackageInfo(m_context.getPackageName(), 0);
- packageVersion = packageInfo.lastUpdateTime;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- if (!cleanCacheIfNecessary(pluginsPrefix, packageVersion))
- return;
-
- {
- File versionFile = new File(pluginsPrefix + "cache.version");
-
- File parentDirectory = versionFile.getParentFile();
- if (!parentDirectory.exists())
- parentDirectory.mkdirs();
-
- versionFile.createNewFile();
-
- DataOutputStream outputStream = null;
- try {
- outputStream = new DataOutputStream(new FileOutputStream(versionFile));
- outputStream.writeLong(packageVersion);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- if (outputStream != null)
- outputStream.close();
- }
- }
-
- {
- // why can't we load the plugins directly from libs ?!?!
- String key = BUNDLED_IN_LIB_RESOURCE_ID_KEY;
- if (m_contextInfo.metaData.containsKey(key)) {
- String[] list = m_context.getResources().getStringArray(m_contextInfo.metaData.getInt(key));
-
- for (String bundledImportBinary : list) {
- String[] split = bundledImportBinary.split(":");
- String sourceFileName = libsDir + split[0];
- String destinationFileName = pluginsPrefix + split[1];
- createBundledBinary(sourceFileName, destinationFileName);
- }
- }
- }
-
- {
- String key = BUNDLED_IN_ASSETS_RESOURCE_ID_KEY;
- if (m_contextInfo.metaData.containsKey(key)) {
- String[] list = m_context.getResources().getStringArray(m_contextInfo.metaData.getInt(key));
-
- for (String fileName : list) {
- String[] split = fileName.split(":");
- String sourceFileName = split[0];
- String destinationFileName = pluginsPrefix + split[1];
- copyAsset(sourceFileName, destinationFileName);
- }
- }
-
- }
- }
-
- private void deleteRecursively(File directory)
- {
- File[] files = directory.listFiles();
- if (files != null) {
- for (File file : files) {
- if (file.isDirectory())
- deleteRecursively(file);
- else
- file.delete();
- }
-
- directory.delete();
- }
- }
-
- private void cleanOldCacheIfNecessary(String oldLocalPrefix, String localPrefix)
- {
- File newCache = new File(localPrefix);
- if (!newCache.exists()) {
- {
- File oldPluginsCache = new File(oldLocalPrefix + "plugins/");
- if (oldPluginsCache.exists() && oldPluginsCache.isDirectory())
- deleteRecursively(oldPluginsCache);
- }
-
- {
- File oldImportsCache = new File(oldLocalPrefix + "imports/");
- if (oldImportsCache.exists() && oldImportsCache.isDirectory())
- deleteRecursively(oldImportsCache);
- }
-
- {
- File oldQmlCache = new File(oldLocalPrefix + "qml/");
- if (oldQmlCache.exists() && oldQmlCache.isDirectory())
- deleteRecursively(oldQmlCache);
- }
- }
- }
-
public void startApp(final boolean firstStart)
{
try {
@@ -553,7 +369,7 @@ public abstract class QtLoader {
if (m_contextInfo.metaData.containsKey("android.app.qt_libs_resource_id")) {
int resourceId = m_contextInfo.metaData.getInt("android.app.qt_libs_resource_id");
- m_qtLibs = m_context.getResources().getStringArray(resourceId);
+ m_qtLibs = prefferedAbiLibs(m_context.getResources().getStringArray(resourceId));
}
if (m_contextInfo.metaData.containsKey("android.app.use_local_qt_libs")
@@ -567,6 +383,7 @@ public abstract class QtLoader {
apkDeployFromSystem = true;
String libsDir = null;
+ String bundledLibsDir = null;
if (apkDeployFromSystem) {
String systemLibsPrefix = SYSTEM_LIB_PATH;
if (m_contextInfo.metaData.containsKey("android.app.system_libs_prefix")) {
@@ -583,8 +400,11 @@ public abstract class QtLoader {
} else {
String nativeLibraryPrefix = m_context.getApplicationInfo().nativeLibraryDir + "/";
File nativeLibraryDir = new File(nativeLibraryPrefix);
- if (nativeLibraryDir.exists() && nativeLibraryDir.isDirectory() && nativeLibraryDir.list().length > 0)
+ if (nativeLibraryDir.exists() && nativeLibraryDir.isDirectory() && nativeLibraryDir.list().length > 0) {
libsDir = nativeLibraryPrefix;
+ bundledLibsDir = nativeLibraryPrefix;
+ }
+
}
if (apkDeployFromSystem && libsDir == null)
@@ -593,33 +413,21 @@ public abstract class QtLoader {
if (m_qtLibs != null) {
String libPrefix = libsDir + "lib";
- for (int i = 0; i < m_qtLibs.length; i++)
- libraryList.add(libPrefix + m_qtLibs[i] + ".so");
+ for (String lib : m_qtLibs)
+ libraryList.add(libPrefix + lib + ".so");
}
if (m_contextInfo.metaData.containsKey("android.app.bundle_local_qt_libs")
&& m_contextInfo.metaData.getInt("android.app.bundle_local_qt_libs") == 1) {
- File dataDir = new File(m_context.getApplicationInfo().dataDir);
- String dataPath = dataDir.getCanonicalPath() + "/";
- String pluginsPrefix = dataPath + "qt-reserved-files/";
-
- if (libsDir == null)
- throw new Exception("");
-
- cleanOldCacheIfNecessary(dataPath, pluginsPrefix);
- extractBundledPluginsAndImports(pluginsPrefix, libsDir);
-
- if (m_contextInfo.metaData.containsKey(BUNDLED_IN_LIB_RESOURCE_ID_KEY)) {
- String[] extraLibs = m_contextInfo.metaData.getString("android.app.load_local_libs").split(":");
- for (String lib : extraLibs) {
+ int resourceId = m_contextInfo.metaData.getInt("android.app.load_local_libs_resource_id");
+ for (String libs : prefferedAbiLibs(m_context.getResources().getStringArray(resourceId))) {
+ for (String lib : libs.split(":")) {
if (!lib.isEmpty())
- libraryList.add(pluginsPrefix + lib);
+ libraryList.add(libsDir + lib);
}
}
-
- ENVIRONMENT_VARIABLES += "\tQML2_IMPORT_PATH=" + pluginsPrefix + "/qml"
- + "\tQML_IMPORT_PATH=" + pluginsPrefix + "/imports"
- + "\tQT_PLUGIN_PATH=" + pluginsPrefix + "/plugins";
+ if (bundledLibsDir != null)
+ ENVIRONMENT_VARIABLES += "\tQT_BUNDLED_LIBS_PATH=" + bundledLibsDir;
}
Bundle loaderParams = new Bundle();
diff --git a/src/android/templates/AndroidManifest.xml b/src/android/templates/AndroidManifest.xml
index aed8a3c888..6d0f4e0d45 100644
--- a/src/android/templates/AndroidManifest.xml
+++ b/src/android/templates/AndroidManifest.xml
@@ -12,7 +12,7 @@
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
- <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --">
+ <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="-- %%INSERT_APP_NAME%% --"
@@ -34,12 +34,11 @@
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
- <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
- <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
+
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
- <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
+ <meta-data android:name="android.app.load_local_libs_resource_id" android:resource="@array/load_local_libs"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Used to specify custom system library path to run with local system libs -->
diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle
index ed704c4957..3087d08c83 100644
--- a/src/android/templates/build.gradle
+++ b/src/android/templates/build.gradle
@@ -5,7 +5,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.0'
+ classpath 'com.android.tools.build:gradle:3.5.0'
}
}
@@ -44,7 +44,7 @@ android {
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
res.srcDirs = [qt5AndroidDir + '/res', 'res']
- resources.srcDirs = ['src']
+ resources.srcDirs = ['resources']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
@@ -54,4 +54,9 @@ android {
lintOptions {
abortOnError false
}
+
+ // Do not compress Qt binary resources file
+ aaptOptions {
+ noCompress 'rcc'
+ }
}
diff --git a/src/android/templates/res/values/libs.xml b/src/android/templates/res/values/libs.xml
index 4009a7785a..6b1a4a2a02 100644
--- a/src/android/templates/res/values/libs.xml
+++ b/src/android/templates/res/values/libs.xml
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<resources>
<array name="qt_sources">
- <item>https://download.qt.io/ministro/android/qt5/qt-5.9</item>
+ <item>https://download.qt.io/ministro/android/qt5/qt-5.14</item>
</array>
<!-- The following is handled automatically by the deployment tool. It should
@@ -11,15 +11,12 @@
<!-- %%INSERT_EXTRA_LIBS%% -->
</array>
- <array name="qt_libs">
- <!-- %%INSERT_QT_LIBS%% -->
- </array>
-
- <array name="bundled_in_lib">
- <!-- %%INSERT_BUNDLED_IN_LIB%% -->
+ <array name="qt_libs">
+ <!-- %%INSERT_QT_LIBS%% -->
</array>
- <array name="bundled_in_assets">
- <!-- %%INSERT_BUNDLED_IN_ASSETS%% -->
+
+ <array name="load_local_libs">
+ <!-- %%INSERT_LOCAL_LIBS%% -->
</array>
</resources>
diff --git a/src/android/templates/templates.pro b/src/android/templates/templates.pro
index 55387f3af7..9a64251ee3 100644
--- a/src/android/templates/templates.pro
+++ b/src/android/templates/templates.pro
@@ -1,3 +1,5 @@
+CONFIG += single_arch
+
CONFIG -= qt android_install
templates.files = \
diff --git a/src/angle/src/config.pri b/src/angle/src/config.pri
index cafae0e742..af53d4c621 100644
--- a/src/angle/src/config.pri
+++ b/src/angle/src/config.pri
@@ -53,6 +53,7 @@ CONFIG(debug, debug|release) {
}
!isEmpty(BUILD_PASS): BUILDSUBDIR = $$lower($$BUILD_PASS)/
+else: BUILDSUBDIR = $$PWD/
# c++11 is needed by MinGW to get support for unordered_map.
CONFIG += stl exceptions c++11 c++14
diff --git a/src/concurrent/qtconcurrentcompilertest.h b/src/concurrent/qtconcurrentcompilertest.h
index cddfd06ca1..72cf1670a0 100644
--- a/src/concurrent/qtconcurrentcompilertest.h
+++ b/src/concurrent/qtconcurrentcompilertest.h
@@ -52,7 +52,7 @@ template<class T>
class HasResultType {
typedef char Yes;
typedef void *No;
- template<typename U> static Yes test(int, const typename U::result_type * = 0);
+ template<typename U> static Yes test(int, const typename U::result_type * = nullptr);
template<typename U> static No test(double);
public:
enum { Value = (sizeof(test<T>(0)) == sizeof(Yes)) };
diff --git a/src/concurrent/qtconcurrentfilterkernel.h b/src/concurrent/qtconcurrentfilterkernel.h
index 9cbea2e671..e921a3d51a 100644
--- a/src/concurrent/qtconcurrentfilterkernel.h
+++ b/src/concurrent/qtconcurrentfilterkernel.h
@@ -266,7 +266,7 @@ public:
if (keep(*it))
this->reportResult(&(*it), index);
else
- this->reportResult(0, index);
+ this->reportResult(nullptr, index);
return false;
}
diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h
index 734bb29df1..7ba6720e03 100644
--- a/src/concurrent/qtconcurrentfunctionwrappers.h
+++ b/src/concurrent/qtconcurrentfunctionwrappers.h
@@ -225,13 +225,11 @@ struct PushBackWrapper
return c.push_back(u);
}
-#ifdef Q_COMPILER_RVALUE_REFS
template <class C, class U>
inline void operator()(C &c, U &&u) const
{
return c.push_back(u);
}
-#endif
};
template <typename Functor, bool foo = HasResultType<Functor>::Value>
diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h
index 89fd3d2592..3095c9ff52 100644
--- a/src/concurrent/qtconcurrentiteratekernel.h
+++ b/src/concurrent/qtconcurrentiteratekernel.h
@@ -206,9 +206,9 @@ public:
bool shouldStartThread() override
{
if (forIteration)
- return (currentIndex.load() < iterationCount) && !this->shouldThrottleThread();
+ return (currentIndex.loadRelaxed() < iterationCount) && !this->shouldThrottleThread();
else // whileIteration
- return (iteratorThreads.load() == 0);
+ return (iteratorThreads.loadRelaxed() == 0);
}
ThreadFunctionResult threadFunction() override
@@ -230,7 +230,7 @@ public:
const int currentBlockSize = blockSizeManager.blockSize();
- if (currentIndex.load() >= iterationCount)
+ if (currentIndex.loadRelaxed() >= iterationCount)
break;
// Atomically reserve a block of iterationCount for this thread.
@@ -261,7 +261,7 @@ public:
// Report progress if progress reporting enabled.
if (progressReportingEnabled) {
completed.fetchAndAddAcquire(finalBlockSize);
- this->setProgressValue(this->completed.load());
+ this->setProgressValue(this->completed.loadRelaxed());
}
if (this->shouldThrottleThread())
diff --git a/src/concurrent/qtconcurrentmapkernel.h b/src/concurrent/qtconcurrentmapkernel.h
index 3424124118..7c9538a015 100644
--- a/src/concurrent/qtconcurrentmapkernel.h
+++ b/src/concurrent/qtconcurrentmapkernel.h
@@ -74,7 +74,7 @@ public:
Iterator it = sequenceBeginIterator;
std::advance(it, beginIndex);
for (int i = beginIndex; i < endIndex; ++i) {
- runIteration(it, i, 0);
+ runIteration(it, i, nullptr);
std::advance(it, 1);
}
@@ -118,16 +118,16 @@ public:
return false;
}
- bool runIterations(Iterator sequenceBeginIterator, int begin, int end, ReducedResultType *) override
+ bool runIterations(Iterator sequenceBeginIterator, int beginIndex, int endIndex, ReducedResultType *) override
{
IntermediateResults<typename MapFunctor::result_type> results;
- results.begin = begin;
- results.end = end;
- results.vector.reserve(end - begin);
+ results.begin = beginIndex;
+ results.end = endIndex;
+ results.vector.reserve(endIndex - beginIndex);
Iterator it = sequenceBeginIterator;
- std::advance(it, begin);
- for (int i = begin; i < end; ++i) {
+ std::advance(it, beginIndex);
+ for (int i = beginIndex; i < endIndex; ++i) {
results.vector.append(map(*(it)));
std::advance(it, 1);
}
@@ -176,13 +176,13 @@ public:
return true;
}
- bool runIterations(Iterator sequenceBeginIterator, int begin, int end, T *results) override
+ bool runIterations(Iterator sequenceBeginIterator, int beginIndex, int endIndex, T *results) override
{
Iterator it = sequenceBeginIterator;
- std::advance(it, begin);
- for (int i = begin; i < end; ++i) {
- runIteration(it, i, results + (i - begin));
+ std::advance(it, beginIndex);
+ for (int i = beginIndex; i < endIndex; ++i) {
+ runIteration(it, i, results + (i - beginIndex));
std::advance(it, 1);
}
diff --git a/src/concurrent/qtconcurrentreducekernel.h b/src/concurrent/qtconcurrentreducekernel.h
index 0fbc40e02e..8f9a938952 100644
--- a/src/concurrent/qtconcurrentreducekernel.h
+++ b/src/concurrent/qtconcurrentreducekernel.h
@@ -52,6 +52,8 @@
#include <QtCore/qthreadpool.h>
#include <QtCore/qvector.h>
+#include <mutex>
+
QT_BEGIN_NAMESPACE
@@ -147,7 +149,7 @@ public:
ReduceResultType &r,
const IntermediateResults<T> &result)
{
- QMutexLocker locker(&mutex);
+ std::unique_lock<QMutex> locker(mutex);
if (!canReduce(result.begin)) {
++resultsMapSize;
resultsMap.insert(result.begin, result);
@@ -161,7 +163,7 @@ public:
// reduce this result
locker.unlock();
reduceResult(reduce, r, result);
- locker.relock();
+ locker.lock();
// reduce all stored results as well
while (!resultsMap.isEmpty()) {
@@ -170,7 +172,7 @@ public:
locker.unlock();
reduceResults(reduce, r, resultsMapCopy);
- locker.relock();
+ locker.lock();
resultsMapSize -= resultsMapCopy.size();
}
@@ -180,7 +182,7 @@ public:
// reduce this result
locker.unlock();
reduceResult(reduce, r, result);
- locker.relock();
+ locker.lock();
// OrderedReduce
progress += result.end - result.begin;
@@ -193,7 +195,7 @@ public:
locker.unlock();
reduceResult(reduce, r, it.value());
- locker.relock();
+ locker.lock();
--resultsMapSize;
progress += it.value().end - it.value().begin;
diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h
index 6001010a78..22dae70460 100644
--- a/src/concurrent/qtconcurrentrun.h
+++ b/src/concurrent/qtconcurrentrun.h
@@ -99,8 +99,6 @@ QFuture<T> run(T (*functionPointer)(Param1, Param2, Param3, Param4, Param5), con
return (new StoredFunctorCall5<T, T (*)(Param1, Param2, Param3, Param4, Param5), Arg1, Arg2, Arg3, Arg4, Arg5>(functionPointer, arg1, arg2, arg3, arg4, arg5))->start();
}
-#if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_AUTO_FUNCTION)
-
template <typename Functor>
auto run(Functor functor) -> typename std::enable_if<!QtPrivate::HasResultType<Functor>::Value, QFuture<decltype(functor())>>::type
{
@@ -148,8 +146,6 @@ auto run(Functor functor, const Arg1 &arg1, const Arg2 &arg2, const Arg3 &arg3,
return (new StoredFunctorCall5<result_type, Functor, Arg1, Arg2, Arg3, Arg4, Arg5>(functor, arg1, arg2, arg3, arg4, arg5))->start();
}
-#endif
-
template <typename FunctionObject>
QFuture<typename FunctionObject::result_type> run(FunctionObject functionObject)
{
@@ -370,8 +366,6 @@ QFuture<T> run(QThreadPool *pool, T (*functionPointer)(Param1, Param2, Param3, P
return (new StoredFunctorCall5<T, T (*)(Param1, Param2, Param3, Param4, Param5), Arg1, Arg2, Arg3, Arg4, Arg5>(functionPointer, arg1, arg2, arg3, arg4, arg5))->start(pool);
}
-#if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_AUTO_FUNCTION)
-
template <typename Functor>
auto run(QThreadPool *pool, Functor functor) -> typename std::enable_if<!QtPrivate::HasResultType<Functor>::Value, QFuture<decltype(functor())>>::type
{
@@ -419,8 +413,6 @@ auto run(QThreadPool *pool, Functor functor, const Arg1 &arg1, const Arg2 &arg2,
return (new StoredFunctorCall5<result_type, Functor, Arg1, Arg2, Arg3, Arg4, Arg5>(functor, arg1, arg2, arg3, arg4, arg5))->start(pool);
}
-#endif
-
template <typename FunctionObject>
QFuture<typename FunctionObject::result_type> run(QThreadPool *pool, FunctionObject functionObject)
{
diff --git a/src/concurrent/qtconcurrentthreadengine.cpp b/src/concurrent/qtconcurrentthreadengine.cpp
index 968720cbbe..7f91a2ba68 100644
--- a/src/concurrent/qtconcurrentthreadengine.cpp
+++ b/src/concurrent/qtconcurrentthreadengine.cpp
@@ -91,7 +91,7 @@ ThreadEngineBarrier::ThreadEngineBarrier()
void ThreadEngineBarrier::acquire()
{
forever {
- int localCount = count.load();
+ int localCount = count.loadRelaxed();
if (localCount < 0) {
if (count.testAndSetOrdered(localCount, localCount -1))
return;
@@ -105,7 +105,7 @@ void ThreadEngineBarrier::acquire()
int ThreadEngineBarrier::release()
{
forever {
- int localCount = count.load();
+ int localCount = count.loadRelaxed();
if (localCount == -1) {
if (count.testAndSetOrdered(-1, 0)) {
semaphore.release();
@@ -125,7 +125,7 @@ int ThreadEngineBarrier::release()
void ThreadEngineBarrier::wait()
{
forever {
- int localCount = count.load();
+ int localCount = count.loadRelaxed();
if (localCount == 0)
return;
@@ -139,7 +139,7 @@ void ThreadEngineBarrier::wait()
int ThreadEngineBarrier::currentCount()
{
- return count.load();
+ return count.loadRelaxed();
}
// releases a thread, unless this is the last thread.
@@ -147,7 +147,7 @@ int ThreadEngineBarrier::currentCount()
bool ThreadEngineBarrier::releaseUnlessLast()
{
forever {
- int localCount = count.load();
+ int localCount = count.loadRelaxed();
if (qAbs(localCount) == 1) {
return false;
} else if (localCount < 0) {
diff --git a/src/corelib/Qt5AndroidSupport.cmake b/src/corelib/Qt5AndroidSupport.cmake
new file mode 100644
index 0000000000..5f24fb0e8c
--- /dev/null
+++ b/src/corelib/Qt5AndroidSupport.cmake
@@ -0,0 +1,197 @@
+if (NOT ${PROJECT_NAME}-MultiAbiBuild)
+
+ set(ANDROID_ABIS armeabi-v7a arm64-v8a x86 x86_64)
+
+ # Match Android's sysroots
+ set(ANDROID_SYSROOT_armeabi-v7a arm-linux-androideabi)
+ set(ANDROID_SYSROOT_arm64-v8a aarch64-linux-android)
+ set(ANDROID_SYSROOT_x86 i686-linux-android)
+ set(ANDROID_SYSROOT_x86_64 x86_64-linux-android)
+
+ foreach(abi IN LISTS ANDROID_ABIS)
+ set(abi_initial_value OFF)
+ if (abi STREQUAL ${ANDROID_ABI})
+ set(abi_initial_value ON)
+ endif()
+ find_library(Qt5Core_${abi}_Probe Qt5Core_${abi})
+ if (Qt5Core_${abi}_Probe)
+ option(ANDROID_BUILD_ABI_${abi} "Enable the build for Android ${abi}" ${abi_initial_value})
+ endif()
+ endforeach()
+
+ # Make sure to delete the "android-build" directory, which contains all the
+ # build artefacts, and also the androiddeployqt/gradle artefacts
+ set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${CMAKE_BINARY_DIR}/android-build)
+
+ if (CMAKE_VERSION VERSION_LESS 3.15)
+ message(STATUS "-----------------------------------------------------------------------------------------------------------")
+ message(STATUS "CMake version 3.15 is required to clean the <build_dir>/android-build when issuing the \"clean\" target.\n\n"
+ "For this CMake version please use the \"clean-android-build\" support target additionally to the \"clean\" target.")
+ message(STATUS "-----------------------------------------------------------------------------------------------------------")
+
+ add_custom_target(clean-android-build
+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/android-build
+ VERBATIM)
+ endif()
+
+ # Write the android_<project_name>_deployment_settings.json file
+ file(WRITE ${CMAKE_BINARY_DIR}/android_deployment_settings.json.in
+[=[{
+ "_description": "This file is created by CMake to be read by androiddeployqt and should not be modified by hand.",
+ "application-binary": "@QT_ANDROID_APPLICATION_BINARY@",
+ "architectures": {
+@QT_ANDROID_ARCHITECTURES@
+ },
+ @QT_ANDROID_DEPLOYMENT_DEPENDENCIES@
+ @QT_ANDROID_EXTRA_PLUGINS@
+ @QT_ANDROID_PACKAGE_SOURCE_DIR@
+ @QT_ANDROID_VERSION_CODE@
+ @QT_ANDROID_VERSION_NAME@
+ @QT_ANDROID_EXTRA_LIBS@
+ @QT_QML_IMPORT_PATH@
+ "ndk": "@ANDROID_NDK@",
+ "ndk-host": "@ANDROID_HOST_TAG@",
+ "qml-root-path": "@CMAKE_CURRENT_SOURCE_DIR@",
+ "qt": "@QT_DIR@",
+ "sdk": "@ANDROID_SDK@",
+ "stdcpp-path": "@ANDROID_TOOLCHAIN_ROOT@/sysroot/usr/lib/",
+ "tool-prefix": "llvm",
+ "toolchain-prefix": "llvm",
+ "useLLVM": true
+}]=])
+
+ if (NOT QT_ANDROID_APPLICATION_BINARY)
+ set(QT_ANDROID_APPLICATION_BINARY ${PROJECT_NAME})
+ endif()
+
+ if(NOT ANDROID_SDK)
+ get_filename_component(ANDROID_SDK ${ANDROID_NDK}/../ ABSOLUTE)
+ endif()
+
+ find_program(ANDROID_DEPLOY_QT androiddeployqt)
+ get_filename_component(QT_DIR ${ANDROID_DEPLOY_QT}/../../ ABSOLUTE)
+
+ unset(QT_ANDROID_ARCHITECTURES)
+ foreach(abi IN LISTS ANDROID_ABIS)
+ if (ANDROID_BUILD_ABI_${abi})
+ list(APPEND QT_ANDROID_ARCHITECTURES " \"${abi}\" : \"${ANDROID_SYSROOT_${abi}}\"")
+ endif()
+ endforeach()
+ string(REPLACE ";" ",\n" QT_ANDROID_ARCHITECTURES "${QT_ANDROID_ARCHITECTURES}")
+
+ macro(generate_json_variable_list var_list json_key)
+ if (${var_list})
+ set(QT_${var_list} "\"${json_key}\": \"")
+ string(REPLACE ";" "," joined_var_list "${${var_list}}")
+ string(APPEND QT_${var_list} "${joined_var_list}\",")
+ endif()
+ endmacro()
+
+ macro(generate_json_variable var json_key)
+ if (${var})
+ set(QT_${var} "\"${json_key}\": \"${${var}}\",")
+ endif()
+ endmacro()
+
+ generate_json_variable_list(ANDROID_DEPLOYMENT_DEPENDENCIES "deployment-dependencies")
+ generate_json_variable_list(ANDROID_EXTRA_PLUGINS "android-extra-plugins")
+ generate_json_variable(ANDROID_PACKAGE_SOURCE_DIR "android-package-source-directory")
+ generate_json_variable(ANDROID_VERSION_CODE "android-version-code")
+ generate_json_variable(ANDROID_VERSION_NAME "android-version-name")
+ generate_json_variable_list(ANDROID_EXTRA_LIBS "android-extra-libs")
+ generate_json_variable_list(QML_IMPORT_PATH "qml-import-paths")
+
+ configure_file(
+ "${CMAKE_BINARY_DIR}/android_deployment_settings.json.in"
+ "${CMAKE_BINARY_DIR}/android_deployment_settings.json" @ONLY)
+
+ # Create "apk" and "aab" targets
+ if (DEFINED ENV{JAVA_HOME})
+ set(JAVA_HOME $ENV{JAVA_HOME} CACHE INTERNAL "Saved JAVA_HOME variable")
+ endif()
+ if (JAVA_HOME)
+ set(android_deploy_qt_jdk "--jdk ${JAVA_HOME}")
+ endif()
+
+ if (ANDROID_SDK_PLATFORM)
+ set(android_deploy_qt_platform "--android-platform ${ANDROID_SDK_PLATFORM}")
+ endif()
+
+ add_custom_target(apk
+ COMMAND ${CMAKE_COMMAND} -E env JAVA_HOME=${JAVA_HOME} ${ANDROID_DEPLOY_QT}
+ --input "${CMAKE_BINARY_DIR}/android_deployment_settings.json"
+ --output "${CMAKE_BINARY_DIR}/android-build"
+ --apk "${CMAKE_BINARY_DIR}/android-build/${PROJECT_NAME}.apk"
+ ${android_deploy_qt_platform}
+ ${android_deploy_qt_jdk}
+ VERBATIM)
+
+ add_custom_target(aab
+ COMMAND ${CMAKE_COMMAND} -E env JAVA_HOME=${JAVA_HOME} ${ANDROID_DEPLOY_QT}
+ --input "${CMAKE_BINARY_DIR}/android_deployment_settings.json"
+ --output "${CMAKE_BINARY_DIR}/android-build"
+ --apk "${CMAKE_BINARY_DIR}/android-build/${PROJECT_NAME}.apk"
+ --aab
+ ${android_deploy_qt_platform}
+ ${android_deploy_qt_jdk}
+ VERBATIM)
+
+ include(ExternalProject)
+ macro (setup_library library_name android_abi)
+ # Use Qt Creator's 4.12 settings file if present
+ unset(QTC_SETTINGS_PARAMETER)
+ if (EXISTS ${CMAKE_BINARY_DIR}/qtcsettings.cmake)
+ set(QTC_SETTINGS_PARAMETER -C ${CMAKE_BINARY_DIR}/qtcsettings.cmake)
+ endif()
+
+ # Build all the given ABI as an external project
+ ExternalProject_Add(${library_name}-builder
+ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
+ PREFIX MultiAbi
+ BUILD_ALWAYS YES
+ DOWNLOAD_COMMAND ""
+ INSTALL_COMMAND ""
+ UPDATE_COMMAND ""
+ PATCH_COMMAND ""
+ CMAKE_ARGS
+ ${QTC_SETTINGS_PARAMETER}
+ -D ANDROID_ABI=${android_abi}
+ -D CMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}
+ -D CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
+ -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+ -D ANDROID_PLATFORM=${ANDROID_PLATFORM}
+ -D ANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL}
+ -D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+ -D CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=${CMAKE_FIND_ROOT_PATH_MODE_PROGRAM}
+ -D CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=${CMAKE_FIND_ROOT_PATH_MODE_LIBRARY}
+ -D CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=${CMAKE_FIND_ROOT_PATH_MODE_INCLUDE}
+ -D CMAKE_FIND_ROOT_PATH_MODE_PACKAGE=${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}
+ -D CMAKE_SHARED_LIBRARY_SUFFIX_CXX=_${android_abi}.so
+ -D CMAKE_SHARED_MODULE_SUFFIX_CXX=_${android_abi}.so
+ -D CMAKE_SHARED_LIBRARY_SUFFIX_C=_${android_abi}.so
+ -D CMAKE_SHARED_MODULE_SUFFIX_C=_${android_abi}.so
+ -D CMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/android-build/libs/${android_abi}
+ -D ${PROJECT_NAME}-MultiAbiBuild=ON
+ )
+ endmacro()
+
+ foreach(abi IN LISTS ANDROID_ABIS)
+ if (NOT abi STREQUAL ${ANDROID_ABI})
+ if (ANDROID_BUILD_ABI_${abi})
+ setup_library(${PROJECT_NAME}-${abi} ${abi} ${CMAKE_PREFIX_PATH})
+ endif()
+ else()
+ # For the default abi just use the regular cmake run, to have
+ # nice IDE integration and so on
+ set(CMAKE_SHARED_MODULE_SUFFIX_CXX "_${ANDROID_ABI}.so")
+ set(CMAKE_SHARED_LIBRARY_SUFFIX_CXX "_${ANDROID_ABI}.so")
+ set(CMAKE_SHARED_MODULE_SUFFIX_C "_${ANDROID_ABI}.so")
+ set(CMAKE_SHARED_LIBRARY_SUFFIX_C "_${ANDROID_ABI}.so")
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/android-build/libs/${ANDROID_ABI})
+ endif()
+ endforeach()
+else()
+ # unset the variable, just not to issue an unused variable warning
+ unset(${PROJECT_NAME}-MultiAbiBuild)
+endif()
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index e0652fdcf9..9b672327ef 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -46,6 +46,8 @@ if (NOT TARGET Qt5::rcc)
)
endif()
+set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")
+
set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake)
set(Qt5Core_MOC_EXECUTABLE Qt5::moc)
set(Qt5Core_RCC_EXECUTABLE Qt5::rcc)
@@ -170,4 +172,8 @@ get_filename_component(_Qt5CoreConfigDir ${CMAKE_CURRENT_LIST_FILE} PATH)
set(_Qt5CTestMacros \"${_Qt5CoreConfigDir}/Qt5CTestMacros.cmake\")
+if (ANDROID_PLATFORM)
+ include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5AndroidSupport.cmake\")
+endif()
+
_qt5_Core_check_file_exists(${_Qt5CTestMacros})
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 0f006fe1e3..17cc19fc4e 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -393,3 +393,35 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9)
endforeach()
endmacro()
endif()
+
+function(QT5_IMPORT_PLUGINS TARGET_NAME)
+ set(_doing "")
+ foreach(_arg ${ARGN})
+ if(_arg STREQUAL "INCLUDE")
+ set(_doing "INCLUDE")
+ elseif(_arg STREQUAL "EXCLUDE")
+ set(_doing "EXCLUDE")
+ elseif(_arg STREQUAL "INCLUDE_BY_TYPE")
+ set(_doing "INCLUDE_BY_TYPE")
+ elseif(_arg STREQUAL "EXCLUDE_BY_TYPE")
+ set(_doing "EXCLUDE_BY_TYPE")
+ else()
+ if(_doing STREQUAL "INCLUDE")
+ set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_PLUGINS "${_arg}")
+ elseif(_doing STREQUAL "EXCLUDE")
+ set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_NO_PLUGINS "${_arg}")
+ elseif(_doing STREQUAL "INCLUDE_BY_TYPE")
+ string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}")
+ set(_doing "INCLUDE_BY_TYPE_PLUGINS")
+ elseif(_doing STREQUAL "INCLUDE_BY_TYPE_PLUGINS")
+ set_property(TARGET ${TARGET_NAME} APPEND PROPERTY "QT_PLUGINS_${_plugin_type}" "${_arg}")
+ elseif(_doing STREQUAL "EXCLUDE_BY_TYPE")
+ string(REGEX REPLACE "[-/]" "_" _plugin_type "${_arg}")
+ set_property(TARGET ${TARGET_NAME} PROPERTY "QT_PLUGINS_${_plugin_type}" -)
+ set(_doing "")
+ else()
+ message(FATAL_ERROR "Unexpected extra argument: \"${_arg}\"")
+ endif()
+ endif()
+ endforeach()
+endfunction()
diff --git a/src/corelib/Qt5ModuleLocation.cmake.in b/src/corelib/Qt5ModuleLocation.cmake.in
index 5065ada56e..cf70f6bc0e 100644
--- a/src/corelib/Qt5ModuleLocation.cmake.in
+++ b/src/corelib/Qt5ModuleLocation.cmake.in
@@ -4,7 +4,7 @@ get_filename_component(_qt5_root_dir \"${CMAKE_CURRENT_LIST_DIR}/../../../..\" A
file(GLOB qtmodules ${_qt5_root_dir} "${_qt5_root_dir}/*")
foreach(qtmodule ${qtmodules})
if(IS_DIRECTORY ${qtmodule})
- list(APPEND _qt5_module_paths ${qtmodule})
+ list(APPEND _qt5_module_paths "${qtmodule}" "${qtmodule}/lib/cmake")
endif()
endforeach()
!!ELSE
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 5da8419fe8..46b01449d4 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -152,6 +152,7 @@
#include <QtCore/qthreadstorage.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qpointer.h>
+#include <QtCore/qscopedvaluerollback.h>
#define DEFAULT_TIMER_INTERVAL 16
#define PAUSE_TIMER_COARSE_THRESHOLD 2000
@@ -315,14 +316,13 @@ void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
//* it might happen in some cases that the delta is negative because the animation driver
// advances faster than time.elapsed()
if (delta > 0) {
- insideTick = true;
+ QScopedValueRollback<bool> guard(insideTick, true);
if (profilerCallback)
profilerCallback(delta);
for (currentAnimationIdx = 0; currentAnimationIdx < animationTimers.count(); ++currentAnimationIdx) {
QAbstractAnimationTimer *animation = animationTimers.at(currentAnimationIdx);
animation->updateAnimationsTime(delta);
}
- insideTick = false;
currentAnimationIdx = 0;
}
}
@@ -361,10 +361,11 @@ void QUnifiedTimer::localRestart()
void QUnifiedTimer::restart()
{
- insideRestart = true;
- for (int i = 0; i < animationTimers.count(); ++i)
- animationTimers.at(i)->restartAnimationTimer();
- insideRestart = false;
+ {
+ QScopedValueRollback<bool> guard(insideRestart, true);
+ for (int i = 0; i < animationTimers.count(); ++i)
+ animationTimers.at(i)->restartAnimationTimer();
+ }
localRestart();
}
@@ -599,14 +600,13 @@ void QAnimationTimer::updateAnimationsTime(qint64 delta)
//it might happen in some cases that the time doesn't change because events are delayed
//when the CPU load is high
if (delta) {
- insideTick = true;
+ QScopedValueRollback<bool> guard(insideTick, true);
for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
QAbstractAnimation *animation = animations.at(currentAnimationIdx);
int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
+ (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
animation->setCurrentTime(elapsed);
}
- insideTick = false;
currentAnimationIdx = 0;
}
}
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 3b6e8d6cc4..037d3be74f 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -78,7 +78,7 @@ public:
hasRegisteredTimer(false),
isPause(false),
isGroup(false),
- group(0)
+ group(nullptr)
{
}
diff --git a/src/corelib/animation/qanimationgroup_p.h b/src/corelib/animation/qanimationgroup_p.h
index d0b2e9f9bb..4d1d690e69 100644
--- a/src/corelib/animation/qanimationgroup_p.h
+++ b/src/corelib/animation/qanimationgroup_p.h
@@ -78,7 +78,7 @@ public:
void disconnectUncontrolledAnimation(QAbstractAnimation *anim)
{
//0 for the signal here because we might be called from the animation destructor
- QObject::disconnect(anim, 0, q_func(), SLOT(_q_uncontrolledAnimationFinished()));
+ QObject::disconnect(anim, nullptr, q_func(), SLOT(_q_uncontrolledAnimationFinished()));
}
void connectUncontrolledAnimation(QAbstractAnimation *anim)
diff --git a/src/corelib/animation/qpropertyanimation.cpp b/src/corelib/animation/qpropertyanimation.cpp
index 271be248ec..2a3572d441 100644
--- a/src/corelib/animation/qpropertyanimation.cpp
+++ b/src/corelib/animation/qpropertyanimation.cpp
@@ -85,6 +85,7 @@
#include "qpropertyanimation_p.h"
#include <QtCore/QMutex>
+#include <QtCore/private/qlocking_p.h>
QT_BEGIN_NAMESPACE
@@ -261,7 +262,7 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
QPropertyAnimation *animToStop = 0;
{
static QBasicMutex mutex;
- QMutexLocker locker(&mutex);
+ auto locker = qt_unique_lock(mutex);
typedef QPair<QObject *, QByteArray> QPropertyAnimationPair;
typedef QHash<QPropertyAnimationPair, QPropertyAnimation*> QPropertyAnimationHash;
static QPropertyAnimationHash hash;
@@ -277,15 +278,20 @@ void QPropertyAnimation::updateState(QAbstractAnimation::State newState,
if (oldState == Stopped) {
d->setDefaultStartEndValue(d->targetValue->property(d->propertyName.constData()));
//let's check if we have a start value and an end value
+ const char *what = nullptr;
if (!startValue().isValid() && (d->direction == Backward || !d->defaultStartEndValue.isValid())) {
- qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without start value",
- d->propertyName.constData(), d->target.data()->metaObject()->className(),
- qPrintable(d->target.data()->objectName()));
+ what = "start";
}
if (!endValue().isValid() && (d->direction == Forward || !d->defaultStartEndValue.isValid())) {
- qWarning("QPropertyAnimation::updateState (%s, %s, %s): starting an animation without end value",
+ if (what)
+ what = "start and end";
+ else
+ what = "end";
+ }
+ if (Q_UNLIKELY(what)) {
+ qWarning("QPropertyAnimation::updateState (%s, %s, %ls): starting an animation without %s value",
d->propertyName.constData(), d->target.data()->metaObject()->className(),
- qPrintable(d->target.data()->objectName()));
+ qUtf16Printable(d->target.data()->objectName()), what);
}
}
} else if (hash.value(key) == this) {
diff --git a/src/corelib/animation/qpropertyanimation_p.h b/src/corelib/animation/qpropertyanimation_p.h
index 479762f573..cbd3ce287d 100644
--- a/src/corelib/animation/qpropertyanimation_p.h
+++ b/src/corelib/animation/qpropertyanimation_p.h
@@ -64,7 +64,7 @@ class QPropertyAnimationPrivate : public QVariantAnimationPrivate
Q_DECLARE_PUBLIC(QPropertyAnimation)
public:
QPropertyAnimationPrivate()
- : targetValue(0), propertyType(0), propertyIndex(-1)
+ : targetValue(nullptr), propertyType(0), propertyIndex(-1)
{
}
diff --git a/src/corelib/animation/qsequentialanimationgroup_p.h b/src/corelib/animation/qsequentialanimationgroup_p.h
index 88dac4f566..c082d6b524 100644
--- a/src/corelib/animation/qsequentialanimationgroup_p.h
+++ b/src/corelib/animation/qsequentialanimationgroup_p.h
@@ -63,7 +63,7 @@ class QSequentialAnimationGroupPrivate : public QAnimationGroupPrivate
Q_DECLARE_PUBLIC(QSequentialAnimationGroup)
public:
QSequentialAnimationGroupPrivate()
- : currentAnimation(0), currentAnimationIndex(-1), lastLoop(0)
+ : currentAnimation(nullptr), currentAnimationIndex(-1), lastLoop(0)
{ }
diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp
index ac81f89ed4..216c015732 100644
--- a/src/corelib/animation/qvariantanimation.cpp
+++ b/src/corelib/animation/qvariantanimation.cpp
@@ -43,6 +43,7 @@
#include <QtCore/qrect.h>
#include <QtCore/qline.h>
#include <QtCore/qmutex.h>
+#include <QtCore/private/qlocking_p.h>
#include <algorithm>
@@ -283,11 +284,11 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress)
qSwap(currentValue, ret);
q->updateCurrentValue(currentValue);
static QBasicAtomicInt changedSignalIndex = Q_BASIC_ATOMIC_INITIALIZER(0);
- if (!changedSignalIndex.load()) {
+ if (!changedSignalIndex.loadRelaxed()) {
//we keep the mask so that we emit valueChanged only when needed (for performance reasons)
changedSignalIndex.testAndSetRelaxed(0, signalIndex("valueChanged(QVariant)"));
}
- if (isSignalConnected(changedSignalIndex.load()) && currentValue != ret) {
+ if (isSignalConnected(changedSignalIndex.loadRelaxed()) && currentValue != ret) {
//the value has changed
emit q->valueChanged(currentValue);
}
@@ -426,7 +427,7 @@ void QVariantAnimation::registerInterpolator(QVariantAnimation::Interpolator fun
// in such an order that we get here with interpolators == NULL,
// to continue causes the app to crash on exit with a SEGV
if (interpolators) {
- QMutexLocker locker(&registeredInterpolatorsMutex);
+ const auto locker = qt_scoped_lock(registeredInterpolatorsMutex);
if (int(interpolationType) >= interpolators->count())
interpolators->resize(int(interpolationType) + 1);
interpolators->replace(interpolationType, func);
@@ -443,7 +444,7 @@ QVariantAnimation::Interpolator QVariantAnimationPrivate::getInterpolator(int in
{
{
QInterpolatorVector *interpolators = registeredInterpolators();
- QMutexLocker locker(&registeredInterpolatorsMutex);
+ const auto locker = qt_scoped_lock(registeredInterpolatorsMutex);
QVariantAnimation::Interpolator ret = 0;
if (interpolationType < interpolators->count()) {
ret = interpolators->at(interpolationType);
diff --git a/src/corelib/codecs/qlatincodec.cpp b/src/corelib/codecs/qlatincodec.cpp
index 1b53d26ef4..55e6f0ba4d 100644
--- a/src/corelib/codecs/qlatincodec.cpp
+++ b/src/corelib/codecs/qlatincodec.cpp
@@ -48,7 +48,7 @@ QLatin1Codec::~QLatin1Codec()
QString QLatin1Codec::convertToUnicode(const char *chars, int len, ConverterState *) const
{
- if (chars == 0)
+ if (chars == nullptr)
return QString();
return QString::fromLatin1(chars, len);
@@ -62,7 +62,7 @@ QByteArray QLatin1Codec::convertFromUnicode(const QChar *ch, int len, ConverterS
char *d = r.data();
int invalid = 0;
for (int i = 0; i < len; ++i) {
- if (ch[i] > 0xff) {
+ if (ch[i] > QChar(0xff)) {
d[i] = replacement;
++invalid;
} else {
@@ -104,7 +104,7 @@ QLatin15Codec::~QLatin15Codec()
QString QLatin15Codec::convertToUnicode(const char* chars, int len, ConverterState *) const
{
- if (chars == 0)
+ if (chars == nullptr)
return QString();
QString str = QString::fromLatin1(chars, len);
@@ -112,28 +112,28 @@ QString QLatin15Codec::convertToUnicode(const char* chars, int len, ConverterSta
while(len--) {
switch(uc->unicode()) {
case 0xa4:
- *uc = 0x20ac;
+ *uc = QChar(0x20ac);
break;
case 0xa6:
- *uc = 0x0160;
+ *uc = QChar(0x0160);
break;
case 0xa8:
- *uc = 0x0161;
+ *uc = QChar(0x0161);
break;
case 0xb4:
- *uc = 0x017d;
+ *uc = QChar(0x017d);
break;
case 0xb8:
- *uc = 0x017e;
+ *uc = QChar(0x017e);
break;
case 0xbc:
- *uc = 0x0152;
+ *uc = QChar(0x0152);
break;
case 0xbd:
- *uc = 0x0153;
+ *uc = QChar(0x0153);
break;
case 0xbe:
- *uc = 0x0178;
+ *uc = QChar(0x0178);
break;
default:
break;
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index b7bb3196af..06fd88da90 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -47,6 +47,7 @@
#include "qendian.h"
#include "qfile.h"
#include "qlist.h"
+#include <private/qlocking_p.h>
#include "qstringlist.h"
#include "qvarlengtharray.h"
#if !defined(QT_BOOTSTRAPPED)
@@ -86,7 +87,7 @@
#endif // icu
#endif // QT_BOOTSTRAPPED
-#include "qmutex.h"
+#include <mutex>
#include <stdlib.h>
#include <ctype.h>
@@ -100,8 +101,16 @@ QT_BEGIN_NAMESPACE
typedef QList<QTextCodec*>::ConstIterator TextCodecListConstIt;
typedef QList<QByteArray>::ConstIterator ByteArrayListConstIt;
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, textCodecsMutex, (QMutex::Recursive));
-QMutex *qTextCodecsMutex() { return textCodecsMutex(); }
+Q_GLOBAL_STATIC(QRecursiveMutex, textCodecsMutex);
+
+class TextCodecsMutexLocker
+{
+ using Lock = decltype(qt_unique_lock(std::declval<QRecursiveMutex&>()));
+ // ### FIXME: this is used when textCodecsMutex already == nullptr
+ const Lock lock = qt_unique_lock(textCodecsMutex());
+public:
+ TextCodecsMutexLocker() {} // required d/t an ICC 19 bug
+};
#if !QT_CONFIG(icu)
static char qtolower(char c)
@@ -159,10 +168,10 @@ static QTextCodec *setupLocaleMapper()
{
QCoreGlobalData *globalData = QCoreGlobalData::instance();
- QTextCodec *locale = 0;
+ QTextCodec *locale = nullptr;
{
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
if (globalData->allCodecs.isEmpty())
setup();
}
@@ -208,7 +217,7 @@ static QTextCodec *setupLocaleMapper()
// First part is getting that locale name. First try setlocale() which
// definitely knows it, but since we cannot fully trust it, get ready
// to fall back to environment variables.
- const QByteArray ctype = setlocale(LC_CTYPE, 0);
+ const QByteArray ctype = setlocale(LC_CTYPE, nullptr);
// Get the first nonempty value from $LC_ALL, $LC_CTYPE, and $LANG
// environment variables.
@@ -477,7 +486,7 @@ QTextCodec::ConverterState::~ConverterState()
*/
QTextCodec::QTextCodec()
{
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
QCoreGlobalData *globalInstance = QCoreGlobalData::instance();
if (globalInstance->allCodecs.isEmpty())
@@ -501,7 +510,7 @@ QTextCodec::~QTextCodec()
globalData->codecForLocale.testAndSetRelaxed(this, nullptr);
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
globalData->allCodecs.removeOne(this);
@@ -532,23 +541,21 @@ QTextCodec::~QTextCodec()
QTextCodec *QTextCodec::codecForName(const QByteArray &name)
{
if (name.isEmpty())
- return 0;
+ return nullptr;
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (!globalData)
- return 0;
+ return nullptr;
setup();
#if !QT_CONFIG(icu)
QTextCodecCache *cache = &globalData->codecCache;
QTextCodec *codec;
- if (cache) {
- codec = cache->value(name);
- if (codec)
- return codec;
- }
+ codec = cache->value(name);
+ if (codec)
+ return codec;
for (TextCodecListConstIt it = globalData->allCodecs.constBegin(), cend = globalData->allCodecs.constEnd(); it != cend; ++it) {
QTextCodec *cursor = *it;
@@ -560,14 +567,13 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name)
QList<QByteArray> aliases = cursor->aliases();
for (ByteArrayListConstIt ait = aliases.constBegin(), acend = aliases.constEnd(); ait != acend; ++ait) {
if (qTextCodecNameMatch(*ait, name)) {
- if (cache)
- cache->insert(name, cursor);
+ cache->insert(name, cursor);
return cursor;
}
}
}
- return 0;
+ return nullptr;
#else
return QIcuCodec::codecForNameUnlocked(name);
#endif
@@ -581,11 +587,11 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name)
*/
QTextCodec* QTextCodec::codecForMib(int mib)
{
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (!globalData)
- return 0;
+ return nullptr;
if (globalData->allCodecs.isEmpty())
setup();
@@ -611,7 +617,7 @@ QTextCodec* QTextCodec::codecForMib(int mib)
#if QT_CONFIG(icu)
return QIcuCodec::codecForMibUnlocked(mib);
#else
- return 0;
+ return nullptr;
#endif
}
@@ -627,7 +633,7 @@ QTextCodec* QTextCodec::codecForMib(int mib)
*/
QList<QByteArray> QTextCodec::availableCodecs()
{
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (globalData->allCodecs.isEmpty())
@@ -659,7 +665,7 @@ QList<int> QTextCodec::availableMibs()
#if QT_CONFIG(icu)
return QIcuCodec::availableMibs();
#else
- QMutexLocker locker(textCodecsMutex());
+ const TextCodecsMutexLocker locker;
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (globalData->allCodecs.isEmpty())
@@ -704,14 +710,13 @@ QTextCodec* QTextCodec::codecForLocale()
{
QCoreGlobalData *globalData = QCoreGlobalData::instance();
if (!globalData)
- return 0;
+ return nullptr;
QTextCodec *codec = globalData->codecForLocale.loadAcquire();
if (!codec) {
#if QT_CONFIG(icu)
- textCodecsMutex()->lock();
+ const TextCodecsMutexLocker locker;
codec = QIcuCodec::defaultCodecUnlocked();
- textCodecsMutex()->unlock();
#else
// setupLocaleMapper locks as necessary
codec = setupLocaleMapper();
@@ -830,7 +835,7 @@ QTextEncoder* QTextCodec::makeEncoder(QTextCodec::ConversionFlags flags) const
*/
QByteArray QTextCodec::fromUnicode(const QString& str) const
{
- return convertFromUnicode(str.constData(), str.length(), 0);
+ return convertFromUnicode(str.constData(), str.length(), nullptr);
}
#endif
@@ -863,7 +868,7 @@ QByteArray QTextCodec::fromUnicode(QStringView str) const
*/
QString QTextCodec::toUnicode(const QByteArray& a) const
{
- return convertToUnicode(a.constData(), a.length(), 0);
+ return convertToUnicode(a.constData(), a.length(), nullptr);
}
/*!
@@ -915,7 +920,7 @@ bool QTextCodec::canEncode(QStringView s) const
QString QTextCodec::toUnicode(const char *chars) const
{
int len = qstrlen(chars);
- return convertToUnicode(chars, len, 0);
+ return convertToUnicode(chars, len, nullptr);
}
@@ -1061,7 +1066,7 @@ QString QTextDecoder::toUnicode(const char *chars, int len)
}
// in qstring.cpp:
-void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW;
+void qt_from_latin1(ushort *dst, const char *str, size_t size) noexcept;
/*! \overload
@@ -1110,7 +1115,7 @@ QString QTextDecoder::toUnicode(const QByteArray &ba)
QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec)
{
// determine charset
- QTextCodec *c = QTextCodec::codecForUtfText(ba, 0);
+ QTextCodec *c = QTextCodec::codecForUtfText(ba, nullptr);
if (!c) {
static Q_RELAXED_CONSTEXPR auto matcher = qMakeStaticByteArrayMatcher("meta ");
QByteArray header = ba.left(1024).toLower();
diff --git a/src/corelib/codecs/qtextcodec_p.h b/src/corelib/codecs/qtextcodec_p.h
index 0e449d994c..7fcf6df984 100644
--- a/src/corelib/codecs/qtextcodec_p.h
+++ b/src/corelib/codecs/qtextcodec_p.h
@@ -98,7 +98,7 @@ public:
struct ConverterState {
ConverterState(ConversionFlags f = DefaultConversion)
- : flags(f), remainingChars(0), invalidChars(0), d(0) { state_data[0] = state_data[1] = state_data[2] = 0; }
+ : flags(f), remainingChars(0), invalidChars(0), d(nullptr) { state_data[0] = state_data[1] = state_data[2] = 0; }
~ConverterState() { }
ConversionFlags flags;
int remainingChars;
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 643c8ee475..af36bd7e2f 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -54,7 +54,7 @@ static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
#if (defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)) \
|| (defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64))
-static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) Q_DECL_NOTHROW
+static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) noexcept
{
uint result = qCountLeadingZeroBits(v);
// Now Invert the result: clz will count *down* from the msb to the lsb, so the msb index is 31
@@ -504,7 +504,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len)
This function never throws.
*/
-QChar *QUtf8::convertToUnicode(QChar *buffer, const char *chars, int len) Q_DECL_NOTHROW
+QChar *QUtf8::convertToUnicode(QChar *buffer, const char *chars, int len) noexcept
{
ushort *dst = reinterpret_cast<ushort *>(buffer);
const uchar *src = reinterpret_cast<const uchar *>(chars);
@@ -951,10 +951,10 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert
}
uint code = (endian == BigEndianness) ? qFromBigEndian<quint32>(tuple) : qFromLittleEndian<quint32>(tuple);
if (QChar::requiresSurrogates(code)) {
- *qch++ = QChar::highSurrogate(code);
- *qch++ = QChar::lowSurrogate(code);
+ *qch++ = QChar(QChar::highSurrogate(code));
+ *qch++ = QChar(QChar::lowSurrogate(code));
} else {
- *qch++ = code;
+ *qch++ = QChar(code);
}
num = 0;
}
diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h
index b24283ac5e..083e16317a 100644
--- a/src/corelib/codecs/qutfcodec_p.h
+++ b/src/corelib/codecs/qutfcodec_p.h
@@ -291,7 +291,7 @@ enum DataEndianness
struct QUtf8
{
- static QChar *convertToUnicode(QChar *, const char *, int) Q_DECL_NOTHROW;
+ static QChar *convertToUnicode(QChar *, const char *, int) noexcept;
static QString convertToUnicode(const char *, int);
static QString convertToUnicode(const char *, int, QTextCodec::ConverterState *);
static QByteArray convertFromUnicode(const QChar *, int);
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index 1b01b2b817..ae360239c6 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -12,7 +12,7 @@
"inotify": "boolean",
"journald": "boolean",
"mimetype-database": "boolean",
- "pcre": { "type": "enum", "values": [ "qt", "system" ] },
+ "pcre": { "type": "enum", "values": [ "no", "qt", "system" ] },
"posix-ipc": { "type": "boolean", "name": "ipc_posix" },
"pps": { "type": "boolean", "name": "qqnx_pps" },
"slog2": "boolean",
@@ -158,21 +158,6 @@
"-latomic"
]
},
- "libdl": {
- "label": "dlopen()",
- "test": {
- "main": [
- "dlclose(dlopen(0, 0));",
- "dlsym(RTLD_DEFAULT, 0);",
- "dlerror();"
- ]
- },
- "headers": "dlfcn.h",
- "sources": [
- "",
- "-ldl"
- ]
- },
"librt": {
"label": "clock_gettime()",
"test": {
@@ -235,6 +220,66 @@
"sources": [
"-lslog2"
]
+ },
+ "advapi32": {
+ "label": "advapi32",
+ "sources": [
+ "-ladvapi32"
+ ]
+ },
+ "gdi32": {
+ "label": "gdi32",
+ "sources": [
+ "-lgdi32"
+ ]
+ },
+ "kernel32": {
+ "label": "kernel32",
+ "sources": [
+ "-lkernel32"
+ ]
+ },
+ "netapi32": {
+ "label": "netapi32",
+ "sources": [
+ "-lnetapi32"
+ ]
+ },
+ "ole32": {
+ "label": "ole32",
+ "sources": [
+ "-lole32"
+ ]
+ },
+ "shell32": {
+ "label": "shell32",
+ "sources": [
+ "-lshell32"
+ ]
+ },
+ "uuid": {
+ "label": "uuid",
+ "sources": [
+ "-luuid"
+ ]
+ },
+ "user32": {
+ "label": "user32",
+ "sources": [
+ "-luser32"
+ ]
+ },
+ "winmm": {
+ "label": "winmm",
+ "sources": [
+ "-lwinmm"
+ ]
+ },
+ "ws2_32": {
+ "label": "ws2_32",
+ "sources": [
+ "-lws2_32"
+ ]
}
},
@@ -536,7 +581,7 @@
"qDoubleSnprintf(argv[0], 1, invalidLocale, \"invalid format\", a);",
"qDoubleSscanf(argv[0], invalidLocale, \"invalid format\", &a, &argc);"
],
- "qmake": "DEFINES += QDSP_P_H=$$shell_quote(\\\"@PWD@/tools/qdoublescanprint_p.h\\\")"
+ "qmake": "DEFINES += QDSP_P_H=$$shell_quote(\\\"@PWD@/text/qdoublescanprint_p.h\\\")"
}
}
},
@@ -552,11 +597,6 @@
"condition": "features.clock-gettime && tests.clock-monotonic",
"output": [ "feature" ]
},
- "dlopen": {
- "label": "dlopen()",
- "condition": "config.unix && libs.libdl",
- "output": [ "privateFeature" ]
- },
"doubleconversion": {
"label": "DoubleConversion",
"output": [ "privateFeature", "feature" ]
@@ -684,15 +724,18 @@
"condition": "features.mimetype",
"output": [ "privateFeature" ]
},
+ "pcre2": {
+ "label": "PCRE2",
+ "disable": "input.pcre == 'no' || input.pcre == 'system'",
+ "enable": "input.pcre == 'qt'",
+ "output": [ "privateConfig" ]
+ },
"system-pcre2": {
- "label": "Using system PCRE2",
- "disable": "input.pcre == 'qt'",
+ "label": " Using system PCRE2",
+ "disable": "input.pcre == 'no' || input.pcre == 'qt'",
"enable": "input.pcre == 'system'",
"condition": "libs.pcre2",
- "output": [
- "privateFeature",
- { "type": "privateConfig", "negative": true, "name": "pcre2" }
- ]
+ "output": [ "privateFeature" ]
},
"poll_ppoll": {
"label": "Native ppoll()",
@@ -771,6 +814,7 @@
"label": "QRegularExpression",
"purpose": "Provides an API to Perl-compatible regular expressions.",
"section": "Kernel",
+ "condition": "features.system-pcre2 || features.pcre2",
"output": [ "publicFeature", "feature" ]
},
"sharedmemory": {
@@ -787,7 +831,7 @@
"purpose": "Provides a general counting system semaphore.",
"section": "Kernel",
"condition": [
- "!config.integrity && !config.vxworks",
+ "!config.integrity && !config.vxworks && !config.rtems",
"config.android || config.win32 || tests.ipc_sysv || tests.ipc_posix"
],
"output": [ "publicFeature", "feature" ]
@@ -829,14 +873,14 @@
"label": "QProcess",
"purpose": "Supports external process invocation.",
"section": "File I/O",
- "condition": "features.processenvironment && !config.winrt && !config.uikit && !config.integrity && !config.vxworks",
+ "condition": "features.processenvironment && !config.winrt && !config.uikit && !config.integrity && !config.vxworks && !config.rtems",
"output": [ "publicFeature", "feature" ]
},
"processenvironment": {
"label": "QProcessEnvironment",
"purpose": "Provides a higher-level abstraction of environment variables.",
"section": "File I/O",
- "condition": "!config.winrt && !config.integrity",
+ "condition": "!config.winrt && !config.integrity && !config.rtems",
"output": [ "publicFeature" ]
},
"temporaryfile": {
@@ -945,11 +989,17 @@
"condition": "features.textcodec",
"output": [ "publicFeature", "feature" ]
},
+ "easingcurve": {
+ "label": "Easing curve",
+ "purpose": "Provides easing curve.",
+ "section": "Utilities",
+ "output": [ "publicFeature" ]
+ },
"animation": {
"label": "Animation",
"purpose": "Provides a framework for animations.",
"section": "Utilities",
- "condition": "features.properties",
+ "condition": "features.properties && features.easingcurve",
"output": [ "publicFeature", "feature" ]
},
"statemachine": {
@@ -971,6 +1021,25 @@
"section": "Utilities",
"output": [ "privateFeature" ]
},
+ "jalalicalendar": {
+ "label": "QJalaliCalendar",
+ "purpose": "Support the Jalali (Persian) calendar",
+ "section": "Utilities",
+ "output": [ "publicFeature" ]
+ },
+ "hijricalendar": {
+ "label": "QHijriCalendar",
+ "purpose": "Generic basis for Islamic calendars, providing shared locale data",
+ "section": "Utilities",
+ "output": [ "privateFeature" ]
+ },
+ "islamiccivilcalendar": {
+ "label": "QIslamicCivilCalendar",
+ "purpose": "Support the Islamic Civil calendar",
+ "section": "Utilities",
+ "condition": "features.hijricalendar",
+ "output": [ "publicFeature" ]
+ },
"timezone": {
"label": "QTimeZone",
"purpose": "Provides support for time-zone handling.",
@@ -1013,6 +1082,10 @@ If enabled, a binary dump of the Public Suffix List (http://www.publicsuffix.org
Mozilla License) is included. The data is then also used in QNetworkCookieJar::validateCookie.",
"section": "Utilities",
"output": [ "publicFeature" ]
+ },
+ "win32_system_libs": {
+ "label": "Windows System Libraries",
+ "condition": "config.win32 && libs.advapi32 && libs.gdi32 && libs.kernel32 && libs.netapi32 && libs.ole32 && libs.shell32 && libs.uuid && libs.user32 && libs.winmm && libs.ws2_32"
}
},
@@ -1042,6 +1115,17 @@ You need to use libdouble-conversion for double/string conversion."
"message": "detected a std::atomic implementation that fails for function pointers.
Please apply the patch corresponding to your Standard Library vendor, found in
qtbase/config.tests/atomicfptr"
+ },
+ {
+ "type": "error",
+ "condition": [
+ "config.unix || config.integrity",
+ "!features.poll_ppoll",
+ "!features.poll_pollts",
+ "!features.poll_poll",
+ "!features.poll_select"
+ ],
+ "message": "Qt requires poll(), ppoll(), poll_ts() or select() on this platform"
}
],
@@ -1071,6 +1155,7 @@ Please apply the patch corresponding to your Standard Library vendor, found in
"args": "qqnx_pps",
"condition": "config.qnx"
},
+ "pcre2",
"system-pcre2"
]
}
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 4b758532e6..6c101e21ca 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -12,6 +12,7 @@ CONFIG += qt_tracepoints
CONFIG += $$MODULE_CONFIG
DEFINES += $$MODULE_DEFINES
+android: DEFINES += LIBS_SUFFIX='\\"_$${QT_ARCH}.so\\"'
DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH
msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x67000000
@@ -20,7 +21,7 @@ CONFIG += simd optimize_full
QMAKE_DOCS = $$PWD/doc/qtcore.qdocconf
ANDROID_LIB_DEPENDENCIES = \
- plugins/platforms/android/libqtforandroid.so
+ plugins/platforms/libplugins_platforms_qtforandroid.so
ANDROID_BUNDLED_JAR_DEPENDENCIES = \
jar/QtAndroid.jar
ANDROID_PERMISSIONS = \
@@ -36,6 +37,8 @@ qtConfig(animation): include(animation/animation.pri)
include(global/global.pri)
include(thread/thread.pri)
include(tools/tools.pri)
+include(text/text.pri)
+include(time/time.pri)
include(io/io.pri)
include(itemmodels/itemmodels.pri)
include(plugin/plugin.pri)
@@ -47,10 +50,8 @@ include(mimetypes/mimetypes.pri)
include(platform/platform.pri)
win32 {
- LIBS_PRIVATE += -lws2_32
- !winrt {
- LIBS_PRIVATE += -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lwinmm
- }
+ QMAKE_USE_PRIVATE += ws2_32
+ !winrt: QMAKE_USE_PRIVATE += advapi32 kernel32 ole32 shell32 uuid user32 winmm
}
darwin {
@@ -68,8 +69,6 @@ integrity {
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtCore.dynlist
-contains(DEFINES,QT_EVAL):include(eval.pri)
-
HOST_BINS = $$[QT_HOST_BINS]
host_bins.name = host_bins
host_bins.variable = HOST_BINS
@@ -100,6 +99,12 @@ cmake_umbrella_config_module_location_for_install.output = $$DESTDIR/cmake/insta
cmake_umbrella_config_version_file.input = $$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in
cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake
+android {
+ cmake_android_support.input = $$PWD/Qt5AndroidSupport.cmake
+ cmake_android_support.output = $$DESTDIR/cmake/Qt5Core/Qt5AndroidSupport.cmake
+ cmake_android_support.CONFIG = verbatim
+}
+
load(cmake_functions)
defineTest(pathIsAbsolute) {
@@ -145,6 +150,11 @@ QMAKE_SUBSTITUTES += \
cmake_extras_mkspec_dir \
cmake_extras_mkspec_dir_for_install
+android {
+ QMAKE_SUBSTITUTES += cmake_android_support
+ ctest_qt5_module_files.files += $$cmake_android_support.output
+}
+
ctest_qt5_module_files.files += $$ctest_macros_file.output $$cmake_extras_mkspec_dir_for_install.output
ctest_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5Core
diff --git a/src/corelib/doc/snippets/cmake-macros/examples.cmake b/src/corelib/doc/snippets/cmake-macros/examples.cmake
index bba082586f..ea7da56ec7 100644
--- a/src/corelib/doc/snippets/cmake-macros/examples.cmake
+++ b/src/corelib/doc/snippets/cmake-macros/examples.cmake
@@ -24,3 +24,14 @@ add_dependencies(myapp resources)
#! [qt5_generate_moc]
qt5_generate_moc(main.cpp main.moc TARGET myapp)
#! [qt5_generate_moc]
+
+#! [qt5_import_plugins]
+add_executable(myapp main.cpp)
+target_link_libraries(myapp Qt5::Gui Qt5::Sql)
+qt5_import_plugins(myapp
+ INCLUDE Qt5::QCocoaIntegrationPlugin
+ EXCLUDE Qt5::QMinimalIntegrationPlugin
+ INCLUDE_BY_TYPE imageformats Qt5::QGifPlugin Qt5::QJpegPlugin
+ EXCLUDE_BY_TYPE sqldrivers
+)
+#! [qt5_import_plugins]
diff --git a/src/corelib/doc/snippets/code/doc_src_containers.cpp b/src/corelib/doc/snippets/code/doc_src_containers.cpp
index 443f6b688c..84935580c9 100644
--- a/src/corelib/doc/snippets/code/doc_src_containers.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_containers.cpp
@@ -312,3 +312,11 @@ int j = *i; // Undefined behavior!
but with QVector this is likely to crash.
*/
//! [24]
+
+//! [25]
+QVector<int> vector{1, 2, 3, 4, 4, 5};
+QSet<int> set(vector.begin(), vector.end());
+/*
+ Will generate a QSet containing 1, 2, 4, 5.
+*/
+//! [25]
diff --git a/src/corelib/doc/snippets/code/doc_src_qset.cpp b/src/corelib/doc/snippets/code/doc_src_qset.cpp
index 4cd84d7330..96ef07738b 100644
--- a/src/corelib/doc/snippets/code/doc_src_qset.cpp
+++ b/src/corelib/doc/snippets/code/doc_src_qset.cpp
@@ -131,7 +131,8 @@ while (i != set.end()) {
//! [10]
QSet<QString> set;
...
-QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette");
+const auto predicate = [](const QString &s) { return s.compare("Jeanette", Qt::CaseInsensitive) == 0; };
+QSet<QString>::iterator it = std::find_if(set.begin(), set.end(), predicate);
if (it != set.end())
cout << "Found Jeanette" << endl;
//! [10]
@@ -150,7 +151,8 @@ for (i = set.begin(); i != set.end(); ++i)
//! [12]
QSet<QString> set;
...
-QSet<QString>::iterator it = qFind(set.begin(), set.end(), "Jeanette");
+const auto predicate = [](const QString &s) { return s.compare("Jeanette", Qt::CaseInsensitive) == 0; };
+QSet<QString>::const_iterator it = std::find_if(set.cbegin(), set.cend(), predicate);
if (it != set.constEnd())
cout << "Found Jeanette" << endl;
//! [12]
@@ -161,7 +163,7 @@ QSet<QString> set;
set << "red" << "green" << "blue" << ... << "black";
QList<QString> list = set.toList();
-qSort(list);
+std::sort(list.begin(), list.end());
//! [13]
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp
index 625c1cf9bc..c30f13df5a 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp
@@ -124,12 +124,12 @@ in >> ch1 >> ch2 >> ch3;
//! [8]
QTextStream out(stdout);
-out << "Qt rocks!" << endl;
+out << "Qt rocks!" << Qt::endl;
//! [8]
//! [9]
-stream << '\n' << flush;
+stream << '\n' << Qt::flush;
//! [9]
diff --git a/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp
index 382b08fdb7..dfa9b670e7 100644
--- a/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_thread_qfuture.cpp
@@ -53,7 +53,7 @@ QFuture<QString> future = ...;
QFuture<QString>::const_iterator i;
for (i = future.constBegin(); i != future.constEnd(); ++i)
- cout << *i << endl;
+ cout << *i << Qt::endl;
//! [0]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
index 32fccbefbf..11ab50687d 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp
@@ -71,7 +71,7 @@ ba[4] = 0xca;
//! [2]
for (int i = 0; i < ba.size(); ++i) {
if (ba.at(i) >= 'a' && ba.at(i) <= 'f')
- cout << "Found character in range [a-f]" << endl;
+ cout << "Found character in range [a-f]" << Qt::endl;
}
//! [2]
@@ -88,7 +88,7 @@ x.replace(5, 3, "&"); // x == "rock & roll"
QByteArray ba("We must be <b>bold</b>, very <b>bold</b>");
int j = 0;
while ((j = ba.indexOf("<b>", j)) != -1) {
- cout << "Found <b> tag at index position " << j << endl;
+ cout << "Found <b> tag at index position " << j << Qt::endl;
++j;
}
//! [4]
@@ -126,17 +126,17 @@ QByteArray("abc").isEmpty(); // returns false
QByteArray ba("Hello world");
char *data = ba.data();
while (*data) {
- cout << "[" << *data << "]" << endl;
+ cout << "[" << *data << "]" << Qt::endl;
++data;
}
//! [8]
//! [9]
-QByteArray ba;
-for (int i = 0; i < 10; ++i)
- ba[i] = 'A' + i;
-// ba == "ABCDEFGHIJ"
+QByteArray ba("Hello, world");
+cout << ba[0]; // prints H
+ba[7] = 'W';
+// ba == "Hello, World"
//! [9]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp
index 3ecb67a48f..a477e91548 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp
@@ -128,7 +128,7 @@ qDebug("Time elapsed: %d ms", t.elapsed());
//! [11]
QDateTime now = QDateTime::currentDateTime();
-QDateTime xmas(QDate(now.date().year(), 12, 25), QTime(0, 0));
+QDateTime xmas(QDate(now.date().year(), 12, 25).startOfDay());
qDebug("There are %d seconds to Christmas", now.secsTo(xmas));
//! [11]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp
index a3d2dd7f9e..9813cc98d5 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp
@@ -89,7 +89,7 @@ QHash<int, QWidget *> hash;
...
for (int i = 0; i < 1000; ++i) {
if (hash[i] == okButton)
- cout << "Found button at index " << i << endl;
+ cout << "Found button at index " << i << Qt::endl;
}
//! [6]
@@ -98,7 +98,7 @@ for (int i = 0; i < 1000; ++i) {
QHashIterator<QString, int> i(hash);
while (i.hasNext()) {
i.next();
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
}
//! [7]
@@ -106,7 +106,7 @@ while (i.hasNext()) {
//! [8]
QHash<QString, int>::const_iterator i = hash.constBegin();
while (i != hash.constEnd()) {
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
++i;
}
//! [8]
@@ -122,14 +122,14 @@ hash.insert("plenty", 2000);
//! [10]
QList<int> values = hash.values("plenty");
for (int i = 0; i < values.size(); ++i)
- cout << values.at(i) << endl;
+ cout << values.at(i) << Qt::endl;
//! [10]
//! [11]
QHash<QString, int>::iterator i = hash.find("plenty");
while (i != hash.end() && i.key() == "plenty") {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [11]
@@ -139,7 +139,7 @@ while (i != hash.end() && i.key() == "plenty") {
QHash<QString, int> hash;
...
foreach (int value, hash)
- cout << value << endl;
+ cout << value << Qt::endl;
//! [12]
@@ -201,7 +201,7 @@ QHash<QString, int> hash;
...
QHash<QString, int>::const_iterator i = hash.find("HDR");
while (i != hash.end() && i.key() == "HDR") {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [16]
@@ -216,7 +216,7 @@ hash.insert("December", 12);
QHash<QString, int>::iterator i;
for (i = hash.begin(); i != hash.end(); ++i)
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
//! [17]
@@ -274,7 +274,7 @@ hash.insert("December", 12);
QHash<QString, int>::const_iterator i;
for (i = hash.constBegin(); i != hash.constEnd(); ++i)
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
//! [23]
@@ -296,23 +296,23 @@ hash3 = hash1 + hash2;
//! [25]
QList<int> values = hash.values("plenty");
for (int i = 0; i < values.size(); ++i)
- cout << values.at(i) << endl;
+ cout << values.at(i) << Qt::endl;
//! [25]
//! [26]
QMultiHash<QString, int>::iterator i = hash.find("plenty");
while (i != hash.end() && i.key() == "plenty") {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [26]
//! [27]
for (QHash<int, QString>::const_iterator it = hash.cbegin(), end = hash.cend(); it != end; ++it) {
- cout << "The key: " << it.key() << endl
- cout << "The value: " << it.value() << endl;
- cout << "Also the value: " << (*it) << endl;
+ cout << "The key: " << it.key() << Qt::endl
+ cout << "The value: " << it.value() << Qt::endl;
+ cout << "Also the value: " << (*it) << Qt::endl;
}
//! [27]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp
index 7f743bbd25..e8754a5f34 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp
@@ -112,17 +112,17 @@ list.append("December");
QLinkedList<QString>::iterator i;
for (i = list.begin(); i != list.end(); ++i)
- cout << *i << endl;
+ cout << *i << Qt::endl;
//! [7]
//! [8]
QLinkedList<QString> list;
...
-QLinkedList<QString>::iterator it = qFind(list.begin(),
- list.end(), "Joel");
+QLinkedList<QString>::iterator it = std::find(list.begin(),
+ list.end(), "Joel");
if (it != list.end())
- cout << "Found Joel" << endl;
+ cout << "Found Joel" << Qt::endl;
//! [8]
@@ -182,17 +182,17 @@ list.append("December");
QLinkedList<QString>::const_iterator i;
for (i = list.constBegin(); i != list.constEnd(); ++i)
- cout << *i << endl;
+ cout << *i << Qt::endl;
//! [14]
//! [15]
QLinkedList<QString> list;
...
-QLinkedList<QString>::iterator it = qFind(list.constBegin(),
- list.constEnd(), "Joel");
+QLinkedList<QString>::const_iterator it = std::find(list.constBegin(),
+ list.constEnd(), "Joel");
if (it != list.constEnd())
- cout << "Found Joel" << endl;
+ cout << "Found Joel" << Qt::endl;
//! [15]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp
index 0e746cd6e6..38fa526ef4 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp
@@ -73,7 +73,7 @@ if (list[0] == "Bob")
//! [3]
for (int i = 0; i < list.size(); ++i) {
if (list.at(i) == "Jane")
- cout << "Found Jane at position " << i << endl;
+ cout << "Found Jane at position " << i << Qt::endl;
}
//! [3]
@@ -89,7 +89,7 @@ while (!list.isEmpty())
//! [5]
int i = list.indexOf("Jane");
if (i != -1)
- cout << "First occurrence of Jane is at position " << i << endl;
+ cout << "First occurrence of Jane is at position " << i << Qt::endl;
//! [5]
@@ -180,7 +180,7 @@ list.append("December");
QList<QString>::iterator i;
for (i = list.begin(); i != list.end(); ++i)
- cout << *i << endl;
+ cout << *i << Qt::endl;
//! [15]
@@ -213,7 +213,7 @@ list.append("December");
QList<QString>::const_iterator i;
for (i = list.constBegin(); i != list.constEnd(); ++i)
- cout << *i << endl;
+ cout << *i << Qt::endl;
//! [19]
@@ -247,7 +247,7 @@ QSet<int> set;
set << 20 << 30 << 40 << ... << 70;
QList<int> list = QList<int>::fromSet(set);
-qSort(list);
+std::sort(list.begin(), list.end());
//! [23]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp
index bd59758f71..506022f082 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp
@@ -89,7 +89,7 @@ QMap<int, QWidget *> map;
...
for (int i = 0; i < 1000; ++i) {
if (map[i] == okButton)
- cout << "Found button at index " << i << endl;
+ cout << "Found button at index " << i << Qt::endl;
}
//! [6]
@@ -98,7 +98,7 @@ for (int i = 0; i < 1000; ++i) {
QMapIterator<QString, int> i(map);
while (i.hasNext()) {
i.next();
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
}
//! [7]
@@ -106,7 +106,7 @@ while (i.hasNext()) {
//! [8]
QMap<QString, int>::const_iterator i = map.constBegin();
while (i != map.constEnd()) {
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
++i;
}
//! [8]
@@ -122,14 +122,14 @@ map.insert("plenty", 2000);
//! [10]
QList<int> values = map.values("plenty");
for (int i = 0; i < values.size(); ++i)
- cout << values.at(i) << endl;
+ cout << values.at(i) << Qt::endl;
//! [10]
//! [11]
QMap<QString, int>::iterator i = map.find("plenty");
while (i != map.end() && i.key() == "plenty") {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [11]
@@ -139,7 +139,7 @@ while (i != map.end() && i.key() == "plenty") {
QMap<QString, int> map;
...
foreach (int value, map)
- cout << value << endl;
+ cout << value << Qt::endl;
//! [12]
@@ -175,7 +175,7 @@ QMap<QString, int> map;
...
QMap<QString, int>::const_iterator i = map.find("HDR");
while (i != map.end() && i.key() == "HDR") {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [14]
@@ -201,7 +201,7 @@ QMap<QString, int> map;
QMap<QString, int>::const_iterator i = map.lowerBound("HDR");
QMap<QString, int>::const_iterator upperBound = map.upperBound("HDR");
while (i != upperBound) {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [16]
@@ -230,7 +230,7 @@ map.insert("December", 12);
QMap<QString, int>::iterator i;
for (i = map.begin(); i != map.end(); ++i)
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
//! [18]
@@ -288,7 +288,7 @@ map.insert("December", 12);
QMap<QString, int>::const_iterator i;
for (i = map.constBegin(); i != map.constEnd(); ++i)
- cout << i.key() << ": " << i.value() << endl;
+ cout << i.key() << ": " << i.value() << Qt::endl;
//! [24]
@@ -310,23 +310,23 @@ map3 = map1 + map2;
//! [26]
QList<int> values = map.values("plenty");
for (int i = 0; i < values.size(); ++i)
- cout << values.at(i) << endl;
+ cout << values.at(i) << Qt::endl;
//! [26]
//! [27]
QMultiMap<QString, int>::iterator i = map.find("plenty");
while (i != map.end() && i.key() == "plenty") {
- cout << i.value() << endl;
+ cout << i.value() << Qt::endl;
++i;
}
//! [27]
//! [keyiterator1]
for (QMap<int, QString>::const_iterator it = map.cbegin(), end = map.cend(); it != end; ++it) {
- cout << "The key: " << it.key() << endl
- cout << "The value: " << it.value() << endl;
- cout << "Also the value: " << (*it) << endl;
+ cout << "The key: " << it.key() << Qt::endl
+ cout << "The value: " << it.value() << Qt::endl;
+ cout << "Also the value: " << (*it) << Qt::endl;
}
//! [keyiterator1]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp
index b74ac31933..6046c73b0f 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp
@@ -54,5 +54,5 @@ queue.enqueue(1);
queue.enqueue(2);
queue.enqueue(3);
while (!queue.isEmpty())
- cout << queue.dequeue() << endl;
+ cout << queue.dequeue() << Qt::endl;
//! [0]
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp
index afdd9c3d25..99cd4ea7a2 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp
@@ -286,15 +286,11 @@ if (!invalidRe.isValid()) {
{
//! [24]
-QRegularExpression re("^this pattern must match exactly$");
-//! [24]
-}
-
-{
-//! [25]
QString p("a .*|pattern");
-QRegularExpression re("\\A(?:" + p + ")\\z"); // re matches exactly the pattern string p
-//! [25]
+
+// re matches exactly the pattern string p
+QRegularExpression re(QRegularExpression::anchoredPattern(p));
+//! [24]
}
{
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp
index 7a2b4812ef..eb09fb99e2 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qstringiterator.cpp
@@ -72,9 +72,9 @@ while (i.hasNext())
{
//! [2]
QStringIterator i(u"𝄞 is the G clef");
-qDebug() << hex << i.next(); // will print 1d11e (U+1D11E, MUSICAL SYMBOL G CLEF)
-qDebug() << hex << i.next(); // will print 20 (U+0020, SPACE)
-qDebug() << hex << i.next(); // will print 69 (U+0069, LATIN SMALL LETTER I)
+qDebug() << Qt::hex << i.next(); // will print 1d11e (U+1D11E, MUSICAL SYMBOL G CLEF)
+qDebug() << Qt::hex << i.next(); // will print 20 (U+0020, SPACE)
+qDebug() << Qt::hex << i.next(); // will print 69 (U+0069, LATIN SMALL LETTER I)
//! [2]
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp
index 1f2af4a408..a05233049f 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp
@@ -73,7 +73,7 @@ if (vector[0] == "Liz")
//! [4]
for (int i = 0; i < vector.size(); ++i) {
if (vector.at(i) == "Alfonso")
- cout << "Found Alfonso at position " << i << endl;
+ cout << "Found Alfonso at position " << i << Qt::endl;
}
//! [4]
@@ -81,7 +81,7 @@ for (int i = 0; i < vector.size(); ++i) {
//! [5]
int i = vector.indexOf("Harumi");
if (i != -1)
- cout << "First occurrence of Harumi is at position " << i << endl;
+ cout << "First occurrence of Harumi is at position " << i << Qt::endl;
//! [5]
diff --git a/src/corelib/doc/snippets/hellotrmain.cpp b/src/corelib/doc/snippets/hellotrmain.cpp
index 2fab919a47..721a83240b 100644
--- a/src/corelib/doc/snippets/hellotrmain.cpp
+++ b/src/corelib/doc/snippets/hellotrmain.cpp
@@ -56,13 +56,13 @@ int main(int argc, char *argv[])
QTranslator translator;
// look up e.g. :/translations/myapp_de.qm
if (translator.load(QLocale(), QLatin1String("myapp"), QLatin1String("_"), QLatin1String(":/translations")))
- app.installTranslator(&translator);
+ QCoreApplication::installTranslator(&translator);
QPushButton hello(QCoreApplication::translate("main", "Hello world!"));
hello.resize(100, 30);
hello.show();
- return app.exec();
+ return QCoreApplication::exec();
}
//! [0]
diff --git a/src/corelib/doc/snippets/qstack/main.cpp b/src/corelib/doc/snippets/qstack/main.cpp
index af6b960e57..66823bcb59 100644
--- a/src/corelib/doc/snippets/qstack/main.cpp
+++ b/src/corelib/doc/snippets/qstack/main.cpp
@@ -60,6 +60,6 @@ int main(int argc, char *argv[])
stack.push(2);
stack.push(3);
while (!stack.isEmpty())
- cout << stack.pop() << endl;
+ cout << stack.pop() << Qt::endl;
//! [0]
}
diff --git a/src/corelib/doc/snippets/qstringlist/main.cpp b/src/corelib/doc/snippets/qstringlist/main.cpp
index 55c60650fe..80788ccd76 100644
--- a/src/corelib/doc/snippets/qstringlist/main.cpp
+++ b/src/corelib/doc/snippets/qstringlist/main.cpp
@@ -71,20 +71,20 @@ Widget::Widget(QWidget *parent)
//! [1]
for (int i = 0; i < fonts.size(); ++i)
- cout << fonts.at(i).toLocal8Bit().constData() << endl;
+ cout << fonts.at(i).toLocal8Bit().constData() << Qt::endl;
//! [1]
//! [2]
QStringListIterator javaStyleIterator(fonts);
while (javaStyleIterator.hasNext())
- cout << javaStyleIterator.next().toLocal8Bit().constData() << endl;
+ cout << javaStyleIterator.next().toLocal8Bit().constData() << Qt::endl;
//! [2]
//! [3]
QStringList::const_iterator constIterator;
for (constIterator = fonts.constBegin(); constIterator != fonts.constEnd();
++constIterator)
- cout << (*constIterator).toLocal8Bit().constData() << endl;
+ cout << (*constIterator).toLocal8Bit().constData() << Qt::endl;
//! [3]
//! [4]
diff --git a/src/corelib/doc/src/cmake-macros.qdoc b/src/corelib/doc/src/cmake-macros.qdoc
index 7fb133020f..7c0443fba7 100644
--- a/src/corelib/doc/src/cmake-macros.qdoc
+++ b/src/corelib/doc/src/cmake-macros.qdoc
@@ -212,3 +212,72 @@ when scanning the source files with \c{moc}.
\snippet cmake-macros/examples.cmake qt5_generate_moc
*/
+
+
+/*!
+\page qtcore-cmake-qt5-import-plugins.html
+\ingroup cmake-macros-qtcore
+
+\title qt5_import_plugins
+
+\brief Specifies a custom set of plugins to import for a static Qt build
+
+\section1 Synopsis
+
+\badcode
+qt5_import_plugins(target
+ [INCLUDE plugin ...]
+ [EXCLUDE plugin ...]
+ [INCLUDE_BY_TYPE plugin_type plugin ...]
+ [EXCLUDE_BY_TYPE plugin_type])
+\endcode
+
+\section1 Description
+
+Specifies a custom set of plugins to import. The optional arguments:
+\c INCLUDE, \c EXCLUDE, \c INCLUDE_BY_TYPE, and \c EXCLUDE_BY_TYPE,
+can be used more than once.
+
+This CMake command was introduced in Qt 5.14.
+
+\list
+\li \c INCLUDE -- can be used to specify a list of plugins to import.
+\li \c EXCLUDE -- can be used to specify a list of plugins to exclude.
+\li \c INCLUDE_BY_TYPE -- can be used to override the list of plugins to
+ import for a certain plugin type.
+\li \c EXCLUDE_BY_TYPE -- can be used to specify a plugin type to exclude;
+ then no plugins of that type are imported.
+\endlist
+
+Qt provides plugin types such as \c imageformats, \c platforms,
+and \c sqldrivers.
+
+If \c qt5_import_plugins() isn't called, the target automatically links against
+a sane set of default plugins, for each Qt module that the target is linked
+against. For more information, see
+\l{CMake target_link_libraries Documentation}{target_link_libraries}.
+
+Each plugin comes with a C++ stub file that automatically
+initializes the plugin. Consequently, any target that links against a plugin
+has this C++ file added to its \c SOURCES.
+
+\note This macro imports plugins from static Qt builds only.
+On shared builds, it does nothing.
+
+\section1 Example
+
+\snippet cmake-macros/examples.cmake qt5_import_plugins
+
+In the snippet above, the following occurs with the executable \c myapp:
+
+\list
+\li The \c Qt5::QCocoaIntegrationPlugin is imported into myapp.
+\li The \c Qt5::QMinimalIntegrationPlugin plugin is
+ excluded from being automatically imported into myapp.
+\li The default list of plugins for \c imageformats is
+ overridden to only include Qt5::QGifPlugin and Qt5::QJpegPlugin.
+\li All \c sqldrivers plugins are excluded from automatic importing.
+\endlist
+
+*/
+
diff --git a/src/corelib/doc/src/containers.qdoc b/src/corelib/doc/src/containers.qdoc
index e6c95129db..d0bb251e81 100644
--- a/src/corelib/doc/src/containers.qdoc
+++ b/src/corelib/doc/src/containers.qdoc
@@ -66,6 +66,12 @@
Qt also offers a \l{foreach} keyword that make it very
easy to iterate over all the items stored in a container.
+ \note Since Qt 5.14, range constructors are available for most of the
+ container classes. QMultiMap is a notable exception. Their use is
+ encouraged in place of the various from/to methods. For example:
+
+ \snippet code/doc_src_containers.cpp 25
+
\section1 The Container Classes
Qt provides the following sequential containers: QList,
@@ -666,7 +672,7 @@
\li \b{Logarithmic time:} O(log \e n). A function that runs in
logarithmic time is a function whose running time is
proportional to the logarithm of the number of items in the
- container. One example is qBinaryFind().
+ container. One example is the binary search algorithm.
\li \b{Linear time:} O(\e n). A function that runs in linear time
will execute in a time directly proportional to the number of
diff --git a/src/corelib/doc/src/includes/containers-range-constructor.qdocinc b/src/corelib/doc/src/includes/containers-range-constructor.qdocinc
new file mode 100644
index 0000000000..afb7e46b86
--- /dev/null
+++ b/src/corelib/doc/src/includes/containers-range-constructor.qdocinc
@@ -0,0 +1,2 @@
+ \note Since Qt 5.14, range constructors are available for Qt's generic
+ \l{container classes} and should be used in place of this method.
diff --git a/src/corelib/eval.pri b/src/corelib/eval.pri
deleted file mode 100644
index efda56b16a..0000000000
--- a/src/corelib/eval.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-SOURCES += \
- $$QT_SOURCE_TREE/src/corelib/kernel/qtcore_eval.cpp
-INCLUDEPATH += \
- $$QT_BUILD_TREE/src/corelib/global
diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp
index 66a5e074f6..1d00b7f5a5 100644
--- a/src/corelib/global/archdetect.cpp
+++ b/src/corelib/global/archdetect.cpp
@@ -67,6 +67,10 @@
# define ARCH_PROCESSOR "power"
#elif defined(Q_PROCESSOR_POWER_64)
# define ARCH_PROCESSOR "power64"
+#elif defined(Q_PROCESSOR_RISCV_32)
+# define ARCH_PROCESSOR "riscv32"
+#elif defined(Q_PROCESSOR_RISCV_64)
+# define ARCH_PROCESSOR "riscv64"
#elif defined(Q_PROCESSOR_S390_X)
# define ARCH_PROCESSOR "s390x"
#elif defined(Q_PROCESSOR_S390)
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index 029357ff43..1da69aba9b 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -7,12 +7,12 @@ HEADERS += \
global/qsystemdetection.h \
global/qcompilerdetection.h \
global/qprocessordetection.h \
+ global/qmemory_p.h \
global/qnamespace.h \
global/qendian.h \
global/qendian_p.h \
global/qnumeric_p.h \
global/qnumeric.h \
- global/qfloat16_p.h \
global/qfloat16.h \
global/qglobalstatic.h \
global/qlibraryinfo.h \
@@ -40,6 +40,10 @@ SOURCES += \
global/qrandom.cpp \
global/qhooks.cpp
+# To get listed in IDEs
+false: SOURCES += \
+ global/qfloat16tables.cpp
+
# Only add global/qfloat16_f16c.c if qfloat16.cpp can't #include it.
# Any compiler: if it is already generating F16C code, let qfloat16.cpp do it
# Clang: ICE if not generating F16C code, so use qfloat16_f16c.c
@@ -124,14 +128,3 @@ gcc:ltcg {
} else {
SOURCES += $$VERSIONTAGGING_SOURCES
}
-
-QMAKE_QFLOAT16_TABLES_GENERATE = global/qfloat16.h
-
-qtPrepareTool(QMAKE_QFLOAT16_TABLES, qfloat16-tables)
-
-qfloat16_tables.commands = $$QMAKE_QFLOAT16_TABLES ${QMAKE_FILE_OUT}
-qfloat16_tables.output = global/qfloat16tables.cpp
-qfloat16_tables.depends = $$QMAKE_QFLOAT16_TABLES_EXE
-qfloat16_tables.input = QMAKE_QFLOAT16_TABLES_GENERATE
-qfloat16_tables.variable_out = SOURCES
-QMAKE_EXTRA_COMPILERS += qfloat16_tables
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 345ab9e8ad..e47f284a42 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -110,12 +110,6 @@
# define Q_CC_INTEL __INTEL_COMPILER
# endif
-/* only defined for MSVC since that's the only compiler that actually optimizes for this */
-/* might get overridden further down when Q_COMPILER_NOEXCEPT is detected */
-# ifdef __cplusplus
-# define Q_DECL_NOTHROW throw()
-# endif
-
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define Q_CC_BOR
# define Q_INLINE_TEMPLATE
@@ -1128,16 +1122,11 @@
#ifdef Q_COMPILER_NOEXCEPT
# define Q_DECL_NOEXCEPT noexcept
# define Q_DECL_NOEXCEPT_EXPR(x) noexcept(x)
-# ifdef Q_DECL_NOTHROW
-# undef Q_DECL_NOTHROW /* override with C++11 noexcept if available */
-# endif
#else
# define Q_DECL_NOEXCEPT
# define Q_DECL_NOEXCEPT_EXPR(x)
#endif
-#ifndef Q_DECL_NOTHROW
-# define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
-#endif
+#define Q_DECL_NOTHROW Q_DECL_NOEXCEPT
#if defined(Q_COMPILER_ALIGNOF)
# undef Q_ALIGNOF
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 10458e41d7..e6ad80525a 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -79,12 +79,16 @@
#define QT_NO_DATASTREAM
#define QT_FEATURE_datestring 1
#define QT_FEATURE_datetimeparser -1
+#define QT_FEATURE_easingcurve -1
#define QT_FEATURE_etw -1
#define QT_FEATURE_getauxval (QT_HAS_INCLUDE(<sys/auxv.h>) ? 1 : -1)
#define QT_FEATURE_getentropy -1
#define QT_NO_GEOM_VARIANT
+#define QT_FEATURE_hijricalendar -1
#define QT_FEATURE_iconv -1
#define QT_FEATURE_icu -1
+#define QT_FEATURE_islamiccivilcalendar -1
+#define QT_FEATURE_jalalicalendar -1
#define QT_FEATURE_journald -1
#define QT_FEATURE_futimens -1
#define QT_FEATURE_futimes -1
@@ -105,6 +109,7 @@
# define QT_FEATURE_renameat2 -1
#endif
#define QT_FEATURE_sharedmemory -1
+#define QT_FEATURE_signaling_nan -1
#define QT_FEATURE_slog2 -1
#ifdef __GLIBC_PREREQ
# define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index e9fee5f23e..bd3c219968 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -42,9 +42,7 @@
#ifndef QFLAGS_H
#define QFLAGS_H
-#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
-#endif
QT_BEGIN_NAMESPACE
@@ -54,21 +52,21 @@ class QFlag
{
int i;
public:
- Q_DECL_CONSTEXPR inline QFlag(int value) Q_DECL_NOTHROW : i(value) {}
- Q_DECL_CONSTEXPR inline operator int() const Q_DECL_NOTHROW { return i; }
+ Q_DECL_CONSTEXPR inline QFlag(int value) noexcept : i(value) {}
+ Q_DECL_CONSTEXPR inline operator int() const noexcept { return i; }
#if !defined(Q_CC_MSVC)
// Microsoft Visual Studio has buggy behavior when it comes to
// unsigned enums: even if the enum is unsigned, the enum tags are
// always signed
# if !defined(__LP64__) && !defined(Q_CLANG_QDOC)
- Q_DECL_CONSTEXPR inline QFlag(long value) Q_DECL_NOTHROW : i(int(value)) {}
- Q_DECL_CONSTEXPR inline QFlag(ulong value) Q_DECL_NOTHROW : i(int(long(value))) {}
+ Q_DECL_CONSTEXPR inline QFlag(long value) noexcept : i(int(value)) {}
+ Q_DECL_CONSTEXPR inline QFlag(ulong value) noexcept : i(int(long(value))) {}
# endif
- Q_DECL_CONSTEXPR inline QFlag(uint value) Q_DECL_NOTHROW : i(int(value)) {}
- Q_DECL_CONSTEXPR inline QFlag(short value) Q_DECL_NOTHROW : i(int(value)) {}
- Q_DECL_CONSTEXPR inline QFlag(ushort value) Q_DECL_NOTHROW : i(int(uint(value))) {}
- Q_DECL_CONSTEXPR inline operator uint() const Q_DECL_NOTHROW { return uint(i); }
+ Q_DECL_CONSTEXPR inline QFlag(uint value) noexcept : i(int(value)) {}
+ Q_DECL_CONSTEXPR inline QFlag(short value) noexcept : i(int(value)) {}
+ Q_DECL_CONSTEXPR inline QFlag(ushort value) noexcept : i(int(uint(value))) {}
+ Q_DECL_CONSTEXPR inline operator uint() const noexcept { return uint(i); }
#endif
};
Q_DECLARE_TYPEINFO(QFlag, Q_PRIMITIVE_TYPE);
@@ -77,12 +75,12 @@ class QIncompatibleFlag
{
int i;
public:
- Q_DECL_CONSTEXPR inline explicit QIncompatibleFlag(int i) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline operator int() const Q_DECL_NOTHROW { return i; }
+ Q_DECL_CONSTEXPR inline explicit QIncompatibleFlag(int i) noexcept;
+ Q_DECL_CONSTEXPR inline operator int() const noexcept { return i; }
};
Q_DECLARE_TYPEINFO(QIncompatibleFlag, Q_PRIMITIVE_TYPE);
-Q_DECL_CONSTEXPR inline QIncompatibleFlag::QIncompatibleFlag(int value) Q_DECL_NOTHROW : i(value) {}
+Q_DECL_CONSTEXPR inline QIncompatibleFlag::QIncompatibleFlag(int value) noexcept : i(value) {}
#ifndef Q_NO_TYPESAFE_FLAGS
@@ -117,51 +115,47 @@ public:
Q_DECL_CONSTEXPR inline QFlags(const QFlags &other);
Q_DECL_CONSTEXPR inline QFlags &operator=(const QFlags &other);
#endif
- Q_DECL_CONSTEXPR inline QFlags(Enum flags) Q_DECL_NOTHROW : i(Int(flags)) {}
- Q_DECL_CONSTEXPR inline QFlags(Zero = Q_NULLPTR) Q_DECL_NOTHROW : i(0) {}
- Q_DECL_CONSTEXPR inline QFlags(QFlag flag) Q_DECL_NOTHROW : i(flag) {}
+ Q_DECL_CONSTEXPR inline QFlags(Enum flags) noexcept : i(Int(flags)) {}
+ Q_DECL_CONSTEXPR inline QFlags(Zero = nullptr) noexcept : i(0) {}
+ Q_DECL_CONSTEXPR inline QFlags(QFlag flag) noexcept : i(flag) {}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
- Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline QFlags(std::initializer_list<Enum> flags) noexcept
: i(initializer_list_helper(flags.begin(), flags.end())) {}
-#endif
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(int mask) Q_DECL_NOTHROW { i &= mask; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(uint mask) Q_DECL_NOTHROW { i &= mask; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(Enum mask) Q_DECL_NOTHROW { i &= Int(mask); return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(QFlags other) Q_DECL_NOTHROW { i |= other.i; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(Enum other) Q_DECL_NOTHROW { i |= Int(other); return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(QFlags other) Q_DECL_NOTHROW { i ^= other.i; return *this; }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(Enum other) Q_DECL_NOTHROW { i ^= Int(other); return *this; }
-
- Q_DECL_CONSTEXPR inline operator Int() const Q_DECL_NOTHROW { return i; }
-
- Q_DECL_CONSTEXPR inline QFlags operator|(QFlags other) const Q_DECL_NOTHROW { return QFlags(QFlag(i | other.i)); }
- Q_DECL_CONSTEXPR inline QFlags operator|(Enum other) const Q_DECL_NOTHROW { return QFlags(QFlag(i | Int(other))); }
- Q_DECL_CONSTEXPR inline QFlags operator^(QFlags other) const Q_DECL_NOTHROW { return QFlags(QFlag(i ^ other.i)); }
- Q_DECL_CONSTEXPR inline QFlags operator^(Enum other) const Q_DECL_NOTHROW { return QFlags(QFlag(i ^ Int(other))); }
- Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const Q_DECL_NOTHROW { return QFlags(QFlag(i & mask)); }
- Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const Q_DECL_NOTHROW { return QFlags(QFlag(i & mask)); }
- Q_DECL_CONSTEXPR inline QFlags operator&(Enum other) const Q_DECL_NOTHROW { return QFlags(QFlag(i & Int(other))); }
- Q_DECL_CONSTEXPR inline QFlags operator~() const Q_DECL_NOTHROW { return QFlags(QFlag(~i)); }
-
- Q_DECL_CONSTEXPR inline bool operator!() const Q_DECL_NOTHROW { return !i; }
-
- Q_DECL_CONSTEXPR inline bool testFlag(Enum flag) const Q_DECL_NOTHROW { return (i & Int(flag)) == Int(flag) && (Int(flag) != 0 || i == Int(flag) ); }
- Q_DECL_RELAXED_CONSTEXPR inline QFlags &setFlag(Enum flag, bool on = true) Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(int mask) noexcept { i &= mask; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(uint mask) noexcept { i &= mask; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator&=(Enum mask) noexcept { i &= Int(mask); return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(QFlags other) noexcept { i |= other.i; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator|=(Enum other) noexcept { i |= Int(other); return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(QFlags other) noexcept { i ^= other.i; return *this; }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &operator^=(Enum other) noexcept { i ^= Int(other); return *this; }
+
+ Q_DECL_CONSTEXPR inline operator Int() const noexcept { return i; }
+
+ Q_DECL_CONSTEXPR inline QFlags operator|(QFlags other) const noexcept { return QFlags(QFlag(i | other.i)); }
+ Q_DECL_CONSTEXPR inline QFlags operator|(Enum other) const noexcept { return QFlags(QFlag(i | Int(other))); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(QFlags other) const noexcept { return QFlags(QFlag(i ^ other.i)); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(Enum other) const noexcept { return QFlags(QFlag(i ^ Int(other))); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const noexcept { return QFlags(QFlag(i & mask)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const noexcept { return QFlags(QFlag(i & mask)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(Enum other) const noexcept { return QFlags(QFlag(i & Int(other))); }
+ Q_DECL_CONSTEXPR inline QFlags operator~() const noexcept { return QFlags(QFlag(~i)); }
+
+ Q_DECL_CONSTEXPR inline bool operator!() const noexcept { return !i; }
+
+ Q_DECL_CONSTEXPR inline bool testFlag(Enum flag) const noexcept { return (i & Int(flag)) == Int(flag) && (Int(flag) != 0 || i == Int(flag) ); }
+ Q_DECL_RELAXED_CONSTEXPR inline QFlags &setFlag(Enum flag, bool on = true) noexcept
{
return on ? (*this |= flag) : (*this &= ~Int(flag));
}
private:
-#ifdef Q_COMPILER_INITIALIZER_LISTS
Q_DECL_CONSTEXPR static inline Int initializer_list_helper(typename std::initializer_list<Enum>::const_iterator it,
typename std::initializer_list<Enum>::const_iterator end)
- Q_DECL_NOTHROW
+ noexcept
{
return (it == end ? Int(0) : (Int(*it) | initializer_list_helper(it + 1, end)));
}
-#endif
Int i;
};
@@ -172,13 +166,13 @@ typedef QFlags<Enum> Flags;
#endif
#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \
-Q_DECL_CONSTEXPR inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) Q_DECL_NOTHROW \
+Q_DECL_CONSTEXPR inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) noexcept \
{ return QIncompatibleFlag(int(f1) | f2); }
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
-Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) Q_DECL_NOTHROW \
+Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) noexcept \
{ return QFlags<Flags::enum_type>(f1) | f2; } \
-Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) Q_DECL_NOTHROW \
+Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp
index 87ff796368..6c21b7de5a 100644
--- a/src/corelib/global/qfloat16.cpp
+++ b/src/corelib/global/qfloat16.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 by Southwest Research Institute (R)
** Contact: http://www.qt-project.org/legal
**
@@ -37,8 +38,9 @@
**
****************************************************************************/
-#include "qfloat16_p.h"
+#include "qfloat16.h"
#include "private/qsimd_p.h"
+#include <cmath> // for fpclassify()'s return values
QT_BEGIN_NAMESPACE
@@ -78,28 +80,83 @@ QT_BEGIN_NAMESPACE
*/
/*!
- Returns true if the \c qfloat16 \a {f} is equivalent to infinity.
+ \fn bool qIsInf(qfloat16 f)
\relates <QFloat16>
+ Returns true if the \c qfloat16 \a {f} is equivalent to infinity.
+
\sa qIsInf
*/
-Q_REQUIRED_RESULT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW { return qt_is_inf(f); }
/*!
- Returns true if the \c qfloat16 \a {f} is not a number (NaN).
+ \fn bool qIsNaN(qfloat16 f)
\relates <QFloat16>
+ Returns true if the \c qfloat16 \a {f} is not a number (NaN).
+
\sa qIsNaN
*/
-Q_REQUIRED_RESULT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW { return qt_is_nan(f); }
/*!
- Returns true if the \c qfloat16 \a {f} is a finite number.
+ \fn bool qIsFinite(qfloat16 f)
\relates <QFloat16>
+ Returns true if the \c qfloat16 \a {f} is a finite number.
+
\sa qIsFinite
*/
-Q_REQUIRED_RESULT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW { return qt_is_finite(f); }
+
+/*!
+ \internal
+ \since 5.14
+ bool qfloat16::isInf() const noexcept
+
+ Tests whether this \c qfloat16 value is an infinity.
+
+ \sa qIsInf()
+*/
+
+/*!
+ \internal
+ \since 5.14
+ bool qfloat16::isNaN() const noexcept
+
+ Tests whether this \c qfloat16 value is "not a number".
+
+ \sa qIsNaN()
+*/
+
+/*!
+ \since 5.14
+ bool qfloat16::isNormal() const noexcept
+
+ Tests whether this \c qfloat16 value is finite and in normal form.
+
+ \sa qFpClassify()
+*/
+
+/*!
+ \internal
+ \since 5.14
+ bool qfloat16::isFinite() const noexcept
+
+ Tests whether this \c qfloat16 value is finite.
+
+ \sa qIsFinite()
+*/
+
+/*!
+ \internal
+ \since 5.14
+ Implements qFpClassify() for qfloat16.
+
+ \sa qFpClassify()
+*/
+int qfloat16::fpClassify() const noexcept
+{
+ return isInf() ? FP_INFINITE : isNaN() ? FP_NAN
+ : !(b16 & 0x7fff) ? FP_ZERO : isNormal() ? FP_NORMAL : FP_SUBNORMAL;
+}
/*! \fn int qRound(qfloat16 value)
\relates <QFloat16>
@@ -142,8 +199,8 @@ extern "C" {
# define f16cextern extern
#endif
-f16cextern void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW;
-f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOTHROW;
+f16cextern void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) noexcept;
+f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) noexcept;
#undef f16cextern
}
@@ -154,7 +211,7 @@ static inline bool hasFastF16()
return true;
}
-static void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW
+static void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) noexcept
{
__fp16 *out_f16 = reinterpret_cast<__fp16 *>(out);
qsizetype i = 0;
@@ -164,7 +221,7 @@ static void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q
out_f16[i] = __fp16(in[i]);
}
-static void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOTHROW
+static void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) noexcept
{
const __fp16 *in_f16 = reinterpret_cast<const __fp16 *>(in);
qsizetype i = 0;
@@ -179,12 +236,12 @@ static inline bool hasFastF16()
return false;
}
-static void qFloatToFloat16_fast(quint16 *, const float *, qsizetype) Q_DECL_NOTHROW
+static void qFloatToFloat16_fast(quint16 *, const float *, qsizetype) noexcept
{
Q_UNREACHABLE();
}
-static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) Q_DECL_NOTHROW
+static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) noexcept
{
Q_UNREACHABLE();
}
@@ -196,7 +253,7 @@ static void qFloatFromFloat16_fast(float *, const quint16 *, qsizetype) Q_DECL_N
Converts \a len floats from \a in to qfloat16 and stores them in \a out.
Both \a in and \a out must have \a len allocated entries.
*/
-Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW
+Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len) noexcept
{
if (hasFastF16())
return qFloatToFloat16_fast(reinterpret_cast<quint16 *>(out), in, len);
@@ -212,7 +269,7 @@ Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *out, const float *in, qsizetype len
Converts \a len qfloat16 from \a in to floats and stores them in \a out.
Both \a in and \a out must have \a len allocated entries.
*/
-Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype len) Q_DECL_NOTHROW
+Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype len) noexcept
{
if (hasFastF16())
return qFloatFromFloat16_fast(out, reinterpret_cast<const quint16 *>(in), len);
@@ -223,6 +280,7 @@ Q_CORE_EXPORT void qFloatFromFloat16(float *out, const qfloat16 *in, qsizetype l
QT_END_NAMESPACE
+#include "qfloat16tables.cpp"
#ifdef QFLOAT16_INCLUDE_FAST
# include "qfloat16_f16c.c"
#endif
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index fc006db3f2..9a4f1800a4 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 by Southwest Research Institute (R)
** Contact: http://www.qt-project.org/legal
**
@@ -66,13 +67,37 @@ QT_BEGIN_NAMESPACE
class qfloat16
{
+ struct Wrap
+ {
+ // To let our private constructor work, without other code seeing
+ // ambiguity when constructing from int, double &c.
+ quint16 b16;
+ constexpr inline explicit Wrap(int value) : b16(value) {}
+ };
public:
- Q_DECL_CONSTEXPR inline qfloat16() Q_DECL_NOTHROW : b16(0) { }
- inline qfloat16(float f) Q_DECL_NOTHROW;
- inline operator float() const Q_DECL_NOTHROW;
-
+ constexpr inline qfloat16() noexcept : b16(0) {}
+ inline qfloat16(float f) noexcept;
+ inline operator float() const noexcept;
+
+ // Support for qIs{Inf,NaN,Finite}:
+ bool isInf() const noexcept { return ((b16 >> 8) & 0x7e) == 0x7c; }
+ bool isNaN() const noexcept { return ((b16 >> 8) & 0x7e) == 0x7e; }
+ bool isFinite() const noexcept { return ((b16 >> 8) & 0x7c) != 0x7c; }
+ Q_CORE_EXPORT int fpClassify() const noexcept;
+ // Support for std::numeric_limits<qfloat16>
+ static constexpr qfloat16 _limit_epsilon() noexcept { return qfloat16(Wrap(0x1400)); }
+ static constexpr qfloat16 _limit_min() noexcept { return qfloat16(Wrap(0x400)); }
+ static constexpr qfloat16 _limit_denorm_min() noexcept { return qfloat16(Wrap(1)); }
+ static constexpr qfloat16 _limit_max() noexcept { return qfloat16(Wrap(0x7bff)); }
+ static constexpr qfloat16 _limit_lowest() noexcept { return qfloat16(Wrap(0xfbff)); }
+ static constexpr qfloat16 _limit_infinity() noexcept { return qfloat16(Wrap(0x7c00)); }
+ static constexpr qfloat16 _limit_quiet_NaN() noexcept { return qfloat16(Wrap(0x7e00)); }
+ // Signalling NaN is 0x7f00
+ inline constexpr bool isNormal() const noexcept
+ { return (b16 & 0x7fff) == 0 || ((b16 & 0x7c00) && (b16 & 0x7c00) != 0x7c00); }
private:
quint16 b16;
+ constexpr inline explicit qfloat16(Wrap nibble) noexcept : b16(nibble.b16) {}
Q_CORE_EXPORT static const quint32 mantissatable[];
Q_CORE_EXPORT static const quint32 exponenttable[];
@@ -80,29 +105,32 @@ private:
Q_CORE_EXPORT static const quint32 basetable[];
Q_CORE_EXPORT static const quint32 shifttable[];
- friend bool qIsNull(qfloat16 f) Q_DECL_NOTHROW;
+ friend bool qIsNull(qfloat16 f) noexcept;
#if !defined(QT_NO_FLOAT16_OPERATORS)
- friend qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW;
+ friend qfloat16 operator-(qfloat16 a) noexcept;
#endif
};
Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE);
-Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *, const float *, qsizetype length) Q_DECL_NOTHROW;
-Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qsizetype length) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *, const float *, qsizetype length) noexcept;
+Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qsizetype length) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h
+// Complement qnumeric.h:
+Q_REQUIRED_RESULT inline bool qIsInf(qfloat16 f) noexcept { return f.isInf(); }
+Q_REQUIRED_RESULT inline bool qIsNaN(qfloat16 f) noexcept { return f.isNaN(); }
+Q_REQUIRED_RESULT inline bool qIsFinite(qfloat16 f) noexcept { return f.isFinite(); }
+Q_REQUIRED_RESULT inline int qFpClassify(qfloat16 f) noexcept { return f.fpClassify(); }
+// Q_REQUIRED_RESULT quint32 qFloatDistance(qfloat16 a, qfloat16 b);
// The remainder of these utility functions complement qglobal.h
-Q_REQUIRED_RESULT inline int qRound(qfloat16 d) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline int qRound(qfloat16 d) noexcept
{ return qRound(static_cast<float>(d)); }
-Q_REQUIRED_RESULT inline qint64 qRound64(qfloat16 d) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline qint64 qRound64(qfloat16 d) noexcept
{ return qRound64(static_cast<float>(d)); }
-Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
{
float f1 = static_cast<float>(p1);
float f2 = static_cast<float>(p2);
@@ -115,19 +143,19 @@ Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOT
return (qAbs(f1 - f2) * 102.5f <= qMin(qAbs(f1), qAbs(f2)));
}
-Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) noexcept
{
return (f.b16 & static_cast<quint16>(0x7fff)) == 0;
}
-inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW
+inline int qIntCast(qfloat16 f) noexcept
{ return int(static_cast<float>(f)); }
#ifndef Q_QDOC
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wc99-extensions")
QT_WARNING_DISABLE_GCC("-Wold-style-cast")
-inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
+inline qfloat16::qfloat16(float f) noexcept
{
#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
__m128 packsingle = _mm_set_ss(f);
@@ -145,7 +173,7 @@ inline qfloat16::qfloat16(float f) Q_DECL_NOTHROW
}
QT_WARNING_POP
-inline qfloat16::operator float() const Q_DECL_NOTHROW
+inline qfloat16::operator float() const noexcept
{
#if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__F16C__)
__m128i packhalf = _mm_cvtsi32_si128(b16);
@@ -166,23 +194,23 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
#endif
#if !defined(QT_NO_FLOAT16_OPERATORS)
-inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW
+inline qfloat16 operator-(qfloat16 a) noexcept
{
qfloat16 f;
f.b16 = a.b16 ^ quint16(0x8000);
return f;
}
-inline qfloat16 operator+(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) + static_cast<float>(b)); }
-inline qfloat16 operator-(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) - static_cast<float>(b)); }
-inline qfloat16 operator*(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) * static_cast<float>(b)); }
-inline qfloat16 operator/(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return qfloat16(static_cast<float>(a) / static_cast<float>(b)); }
+inline qfloat16 operator+(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) + static_cast<float>(b)); }
+inline qfloat16 operator-(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) - static_cast<float>(b)); }
+inline qfloat16 operator*(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) * static_cast<float>(b)); }
+inline qfloat16 operator/(qfloat16 a, qfloat16 b) noexcept { return qfloat16(static_cast<float>(a) / static_cast<float>(b)); }
#define QF16_MAKE_ARITH_OP_FP(FP, OP) \
- inline FP operator OP(qfloat16 lhs, FP rhs) Q_DECL_NOTHROW { return static_cast<FP>(lhs) OP rhs; } \
- inline FP operator OP(FP lhs, qfloat16 rhs) Q_DECL_NOTHROW { return lhs OP static_cast<FP>(rhs); }
+ inline FP operator OP(qfloat16 lhs, FP rhs) noexcept { return static_cast<FP>(lhs) OP rhs; } \
+ inline FP operator OP(FP lhs, qfloat16 rhs) noexcept { return lhs OP static_cast<FP>(rhs); }
#define QF16_MAKE_ARITH_OP_EQ_FP(FP, OP_EQ, OP) \
- inline qfloat16& operator OP_EQ(qfloat16& lhs, FP rhs) Q_DECL_NOTHROW \
+ inline qfloat16& operator OP_EQ(qfloat16& lhs, FP rhs) noexcept \
{ lhs = qfloat16(float(static_cast<FP>(lhs) OP rhs)); return lhs; }
#define QF16_MAKE_ARITH_OP(FP) \
QF16_MAKE_ARITH_OP_FP(FP, +) \
@@ -200,8 +228,8 @@ QF16_MAKE_ARITH_OP(float)
#undef QF16_MAKE_ARITH_OP_FP
#define QF16_MAKE_ARITH_OP_INT(OP) \
- inline double operator OP(qfloat16 lhs, int rhs) Q_DECL_NOTHROW { return static_cast<double>(lhs) OP rhs; } \
- inline double operator OP(int lhs, qfloat16 rhs) Q_DECL_NOTHROW { return lhs OP static_cast<double>(rhs); }
+ inline double operator OP(qfloat16 lhs, int rhs) noexcept { return static_cast<double>(lhs) OP rhs; } \
+ inline double operator OP(int lhs, qfloat16 rhs) noexcept { return lhs OP static_cast<double>(rhs); }
QF16_MAKE_ARITH_OP_INT(+)
QF16_MAKE_ARITH_OP_INT(-)
QF16_MAKE_ARITH_OP_INT(*)
@@ -212,16 +240,16 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
-inline bool operator>(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) > static_cast<float>(b); }
-inline bool operator<(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) < static_cast<float>(b); }
-inline bool operator>=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) >= static_cast<float>(b); }
-inline bool operator<=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) <= static_cast<float>(b); }
-inline bool operator==(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) == static_cast<float>(b); }
-inline bool operator!=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast<float>(a) != static_cast<float>(b); }
+inline bool operator>(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) > static_cast<float>(b); }
+inline bool operator<(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) < static_cast<float>(b); }
+inline bool operator>=(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) >= static_cast<float>(b); }
+inline bool operator<=(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) <= static_cast<float>(b); }
+inline bool operator==(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) == static_cast<float>(b); }
+inline bool operator!=(qfloat16 a, qfloat16 b) noexcept { return static_cast<float>(a) != static_cast<float>(b); }
#define QF16_MAKE_BOOL_OP_FP(FP, OP) \
- inline bool operator OP(qfloat16 lhs, FP rhs) Q_DECL_NOTHROW { return static_cast<FP>(lhs) OP rhs; } \
- inline bool operator OP(FP lhs, qfloat16 rhs) Q_DECL_NOTHROW { return lhs OP static_cast<FP>(rhs); }
+ inline bool operator OP(qfloat16 lhs, FP rhs) noexcept { return static_cast<FP>(lhs) OP rhs; } \
+ inline bool operator OP(FP lhs, qfloat16 rhs) noexcept { return lhs OP static_cast<FP>(rhs); }
#define QF16_MAKE_BOOL_OP(FP) \
QF16_MAKE_BOOL_OP_FP(FP, <) \
QF16_MAKE_BOOL_OP_FP(FP, >) \
@@ -236,8 +264,8 @@ QF16_MAKE_BOOL_OP(float)
#undef QF16_MAKE_BOOL_OP_FP
#define QF16_MAKE_BOOL_OP_INT(OP) \
- inline bool operator OP(qfloat16 a, int b) Q_DECL_NOTHROW { return static_cast<float>(a) OP b; } \
- inline bool operator OP(int a, qfloat16 b) Q_DECL_NOTHROW { return a OP static_cast<float>(b); }
+ inline bool operator OP(qfloat16 a, int b) noexcept { return static_cast<float>(a) OP b; } \
+ inline bool operator OP(int a, qfloat16 b) noexcept { return a OP static_cast<float>(b); }
QF16_MAKE_BOOL_OP_INT(>)
QF16_MAKE_BOOL_OP_INT(<)
QF16_MAKE_BOOL_OP_INT(>=)
@@ -252,7 +280,7 @@ QT_WARNING_POP
/*!
\internal
*/
-Q_REQUIRED_RESULT inline bool qFuzzyIsNull(qfloat16 f) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool qFuzzyIsNull(qfloat16 f) noexcept
{
return qAbs(static_cast<float>(f)) <= 0.001f;
}
@@ -261,4 +289,55 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(qfloat16)
+namespace std {
+template<>
+class numeric_limits<QT_PREPEND_NAMESPACE(qfloat16)> : public numeric_limits<float>
+{
+public:
+ /*
+ Treat quint16 b16 as if it were:
+ uint S: 1; // b16 >> 15 (sign); can be set for zero
+ uint E: 5; // (b16 >> 10) & 0x1f (offset exponent)
+ uint M: 10; // b16 & 0x3ff (adjusted mantissa)
+
+ for E == 0: magnitude is M / 2.^{24}
+ for 0 < E < 31: magnitude is (1. + M / 2.^{10}) * 2.^{E - 15)
+ for E == 31: not finite
+ */
+ static constexpr int digits = 11;
+ static constexpr int min_exponent = -13;
+ static constexpr int max_exponent = 16;
+
+ static constexpr int digits10 = 3;
+ static constexpr int max_digits10 = 5;
+ static constexpr int min_exponent10 = -4;
+ static constexpr int max_exponent10 = 4;
+
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) epsilon()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_epsilon(); }
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) (min)()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_min(); }
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) denorm_min()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_denorm_min(); }
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) (max)()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_max(); }
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) lowest()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_lowest(); }
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) infinity()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_infinity(); }
+ static constexpr QT_PREPEND_NAMESPACE(qfloat16) quiet_NaN()
+ { return QT_PREPEND_NAMESPACE(qfloat16)::_limit_quiet_NaN(); }
+};
+
+template<> class numeric_limits<const QT_PREPEND_NAMESPACE(qfloat16)>
+ : public numeric_limits<QT_PREPEND_NAMESPACE(qfloat16)> {};
+template<> class numeric_limits<volatile QT_PREPEND_NAMESPACE(qfloat16)>
+ : public numeric_limits<QT_PREPEND_NAMESPACE(qfloat16)> {};
+template<> class numeric_limits<const volatile QT_PREPEND_NAMESPACE(qfloat16)>
+ : public numeric_limits<QT_PREPEND_NAMESPACE(qfloat16)> {};
+
+// Adding overloads to std isn't allowed, so we can't extend this to support
+// for fpclassify(), isnormal() &c. (which, furthermore, are macros on MinGW).
+} // namespace std
+
#endif // QFLOAT16_H
diff --git a/src/corelib/global/qfloat16_f16c.c b/src/corelib/global/qfloat16_f16c.c
index a7eadc71b7..ba1e16f481 100644
--- a/src/corelib/global/qfloat16_f16c.c
+++ b/src/corelib/global/qfloat16_f16c.c
@@ -54,7 +54,7 @@ extern "C" {
#endif
QT_FUNCTION_TARGET(F16C)
-void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOTHROW
+void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_NOEXCEPT
{
qsizetype i = 0;
int epilog_i;
@@ -70,7 +70,7 @@ void qFloatToFloat16_fast(quint16 *out, const float *in, qsizetype len) Q_DECL_N
}
QT_FUNCTION_TARGET(F16C)
-void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOTHROW
+void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype len) Q_DECL_NOEXCEPT
{
qsizetype i = 0;
int epilog_i;
diff --git a/src/corelib/global/qfloat16tables.cpp b/src/corelib/global/qfloat16tables.cpp
new file mode 100644
index 0000000000..3d764937d7
--- /dev/null
+++ b/src/corelib/global/qfloat16tables.cpp
@@ -0,0 +1,3266 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 by Southwest Research Institute (R)
+** Copyright (C) 2019 Intel Corporation.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/* This file was generated by gen_qfloat16_tables.cpp */
+
+#include <QtCore/qfloat16.h>
+
+QT_BEGIN_NAMESPACE
+
+#if !defined(__F16C__) && !defined(__ARM_FP16_FORMAT_IEEE)
+
+const quint32 qfloat16::mantissatable[2048] = {
+0,
+0x33800000U,
+0x34000000U,
+0x34400000U,
+0x34800000U,
+0x34A00000U,
+0x34C00000U,
+0x34E00000U,
+0x35000000U,
+0x35100000U,
+0x35200000U,
+0x35300000U,
+0x35400000U,
+0x35500000U,
+0x35600000U,
+0x35700000U,
+0x35800000U,
+0x35880000U,
+0x35900000U,
+0x35980000U,
+0x35A00000U,
+0x35A80000U,
+0x35B00000U,
+0x35B80000U,
+0x35C00000U,
+0x35C80000U,
+0x35D00000U,
+0x35D80000U,
+0x35E00000U,
+0x35E80000U,
+0x35F00000U,
+0x35F80000U,
+0x36000000U,
+0x36040000U,
+0x36080000U,
+0x360C0000U,
+0x36100000U,
+0x36140000U,
+0x36180000U,
+0x361C0000U,
+0x36200000U,
+0x36240000U,
+0x36280000U,
+0x362C0000U,
+0x36300000U,
+0x36340000U,
+0x36380000U,
+0x363C0000U,
+0x36400000U,
+0x36440000U,
+0x36480000U,
+0x364C0000U,
+0x36500000U,
+0x36540000U,
+0x36580000U,
+0x365C0000U,
+0x36600000U,
+0x36640000U,
+0x36680000U,
+0x366C0000U,
+0x36700000U,
+0x36740000U,
+0x36780000U,
+0x367C0000U,
+0x36800000U,
+0x36820000U,
+0x36840000U,
+0x36860000U,
+0x36880000U,
+0x368A0000U,
+0x368C0000U,
+0x368E0000U,
+0x36900000U,
+0x36920000U,
+0x36940000U,
+0x36960000U,
+0x36980000U,
+0x369A0000U,
+0x369C0000U,
+0x369E0000U,
+0x36A00000U,
+0x36A20000U,
+0x36A40000U,
+0x36A60000U,
+0x36A80000U,
+0x36AA0000U,
+0x36AC0000U,
+0x36AE0000U,
+0x36B00000U,
+0x36B20000U,
+0x36B40000U,
+0x36B60000U,
+0x36B80000U,
+0x36BA0000U,
+0x36BC0000U,
+0x36BE0000U,
+0x36C00000U,
+0x36C20000U,
+0x36C40000U,
+0x36C60000U,
+0x36C80000U,
+0x36CA0000U,
+0x36CC0000U,
+0x36CE0000U,
+0x36D00000U,
+0x36D20000U,
+0x36D40000U,
+0x36D60000U,
+0x36D80000U,
+0x36DA0000U,
+0x36DC0000U,
+0x36DE0000U,
+0x36E00000U,
+0x36E20000U,
+0x36E40000U,
+0x36E60000U,
+0x36E80000U,
+0x36EA0000U,
+0x36EC0000U,
+0x36EE0000U,
+0x36F00000U,
+0x36F20000U,
+0x36F40000U,
+0x36F60000U,
+0x36F80000U,
+0x36FA0000U,
+0x36FC0000U,
+0x36FE0000U,
+0x37000000U,
+0x37010000U,
+0x37020000U,
+0x37030000U,
+0x37040000U,
+0x37050000U,
+0x37060000U,
+0x37070000U,
+0x37080000U,
+0x37090000U,
+0x370A0000U,
+0x370B0000U,
+0x370C0000U,
+0x370D0000U,
+0x370E0000U,
+0x370F0000U,
+0x37100000U,
+0x37110000U,
+0x37120000U,
+0x37130000U,
+0x37140000U,
+0x37150000U,
+0x37160000U,
+0x37170000U,
+0x37180000U,
+0x37190000U,
+0x371A0000U,
+0x371B0000U,
+0x371C0000U,
+0x371D0000U,
+0x371E0000U,
+0x371F0000U,
+0x37200000U,
+0x37210000U,
+0x37220000U,
+0x37230000U,
+0x37240000U,
+0x37250000U,
+0x37260000U,
+0x37270000U,
+0x37280000U,
+0x37290000U,
+0x372A0000U,
+0x372B0000U,
+0x372C0000U,
+0x372D0000U,
+0x372E0000U,
+0x372F0000U,
+0x37300000U,
+0x37310000U,
+0x37320000U,
+0x37330000U,
+0x37340000U,
+0x37350000U,
+0x37360000U,
+0x37370000U,
+0x37380000U,
+0x37390000U,
+0x373A0000U,
+0x373B0000U,
+0x373C0000U,
+0x373D0000U,
+0x373E0000U,
+0x373F0000U,
+0x37400000U,
+0x37410000U,
+0x37420000U,
+0x37430000U,
+0x37440000U,
+0x37450000U,
+0x37460000U,
+0x37470000U,
+0x37480000U,
+0x37490000U,
+0x374A0000U,
+0x374B0000U,
+0x374C0000U,
+0x374D0000U,
+0x374E0000U,
+0x374F0000U,
+0x37500000U,
+0x37510000U,
+0x37520000U,
+0x37530000U,
+0x37540000U,
+0x37550000U,
+0x37560000U,
+0x37570000U,
+0x37580000U,
+0x37590000U,
+0x375A0000U,
+0x375B0000U,
+0x375C0000U,
+0x375D0000U,
+0x375E0000U,
+0x375F0000U,
+0x37600000U,
+0x37610000U,
+0x37620000U,
+0x37630000U,
+0x37640000U,
+0x37650000U,
+0x37660000U,
+0x37670000U,
+0x37680000U,
+0x37690000U,
+0x376A0000U,
+0x376B0000U,
+0x376C0000U,
+0x376D0000U,
+0x376E0000U,
+0x376F0000U,
+0x37700000U,
+0x37710000U,
+0x37720000U,
+0x37730000U,
+0x37740000U,
+0x37750000U,
+0x37760000U,
+0x37770000U,
+0x37780000U,
+0x37790000U,
+0x377A0000U,
+0x377B0000U,
+0x377C0000U,
+0x377D0000U,
+0x377E0000U,
+0x377F0000U,
+0x37800000U,
+0x37808000U,
+0x37810000U,
+0x37818000U,
+0x37820000U,
+0x37828000U,
+0x37830000U,
+0x37838000U,
+0x37840000U,
+0x37848000U,
+0x37850000U,
+0x37858000U,
+0x37860000U,
+0x37868000U,
+0x37870000U,
+0x37878000U,
+0x37880000U,
+0x37888000U,
+0x37890000U,
+0x37898000U,
+0x378A0000U,
+0x378A8000U,
+0x378B0000U,
+0x378B8000U,
+0x378C0000U,
+0x378C8000U,
+0x378D0000U,
+0x378D8000U,
+0x378E0000U,
+0x378E8000U,
+0x378F0000U,
+0x378F8000U,
+0x37900000U,
+0x37908000U,
+0x37910000U,
+0x37918000U,
+0x37920000U,
+0x37928000U,
+0x37930000U,
+0x37938000U,
+0x37940000U,
+0x37948000U,
+0x37950000U,
+0x37958000U,
+0x37960000U,
+0x37968000U,
+0x37970000U,
+0x37978000U,
+0x37980000U,
+0x37988000U,
+0x37990000U,
+0x37998000U,
+0x379A0000U,
+0x379A8000U,
+0x379B0000U,
+0x379B8000U,
+0x379C0000U,
+0x379C8000U,
+0x379D0000U,
+0x379D8000U,
+0x379E0000U,
+0x379E8000U,
+0x379F0000U,
+0x379F8000U,
+0x37A00000U,
+0x37A08000U,
+0x37A10000U,
+0x37A18000U,
+0x37A20000U,
+0x37A28000U,
+0x37A30000U,
+0x37A38000U,
+0x37A40000U,
+0x37A48000U,
+0x37A50000U,
+0x37A58000U,
+0x37A60000U,
+0x37A68000U,
+0x37A70000U,
+0x37A78000U,
+0x37A80000U,
+0x37A88000U,
+0x37A90000U,
+0x37A98000U,
+0x37AA0000U,
+0x37AA8000U,
+0x37AB0000U,
+0x37AB8000U,
+0x37AC0000U,
+0x37AC8000U,
+0x37AD0000U,
+0x37AD8000U,
+0x37AE0000U,
+0x37AE8000U,
+0x37AF0000U,
+0x37AF8000U,
+0x37B00000U,
+0x37B08000U,
+0x37B10000U,
+0x37B18000U,
+0x37B20000U,
+0x37B28000U,
+0x37B30000U,
+0x37B38000U,
+0x37B40000U,
+0x37B48000U,
+0x37B50000U,
+0x37B58000U,
+0x37B60000U,
+0x37B68000U,
+0x37B70000U,
+0x37B78000U,
+0x37B80000U,
+0x37B88000U,
+0x37B90000U,
+0x37B98000U,
+0x37BA0000U,
+0x37BA8000U,
+0x37BB0000U,
+0x37BB8000U,
+0x37BC0000U,
+0x37BC8000U,
+0x37BD0000U,
+0x37BD8000U,
+0x37BE0000U,
+0x37BE8000U,
+0x37BF0000U,
+0x37BF8000U,
+0x37C00000U,
+0x37C08000U,
+0x37C10000U,
+0x37C18000U,
+0x37C20000U,
+0x37C28000U,
+0x37C30000U,
+0x37C38000U,
+0x37C40000U,
+0x37C48000U,
+0x37C50000U,
+0x37C58000U,
+0x37C60000U,
+0x37C68000U,
+0x37C70000U,
+0x37C78000U,
+0x37C80000U,
+0x37C88000U,
+0x37C90000U,
+0x37C98000U,
+0x37CA0000U,
+0x37CA8000U,
+0x37CB0000U,
+0x37CB8000U,
+0x37CC0000U,
+0x37CC8000U,
+0x37CD0000U,
+0x37CD8000U,
+0x37CE0000U,
+0x37CE8000U,
+0x37CF0000U,
+0x37CF8000U,
+0x37D00000U,
+0x37D08000U,
+0x37D10000U,
+0x37D18000U,
+0x37D20000U,
+0x37D28000U,
+0x37D30000U,
+0x37D38000U,
+0x37D40000U,
+0x37D48000U,
+0x37D50000U,
+0x37D58000U,
+0x37D60000U,
+0x37D68000U,
+0x37D70000U,
+0x37D78000U,
+0x37D80000U,
+0x37D88000U,
+0x37D90000U,
+0x37D98000U,
+0x37DA0000U,
+0x37DA8000U,
+0x37DB0000U,
+0x37DB8000U,
+0x37DC0000U,
+0x37DC8000U,
+0x37DD0000U,
+0x37DD8000U,
+0x37DE0000U,
+0x37DE8000U,
+0x37DF0000U,
+0x37DF8000U,
+0x37E00000U,
+0x37E08000U,
+0x37E10000U,
+0x37E18000U,
+0x37E20000U,
+0x37E28000U,
+0x37E30000U,
+0x37E38000U,
+0x37E40000U,
+0x37E48000U,
+0x37E50000U,
+0x37E58000U,
+0x37E60000U,
+0x37E68000U,
+0x37E70000U,
+0x37E78000U,
+0x37E80000U,
+0x37E88000U,
+0x37E90000U,
+0x37E98000U,
+0x37EA0000U,
+0x37EA8000U,
+0x37EB0000U,
+0x37EB8000U,
+0x37EC0000U,
+0x37EC8000U,
+0x37ED0000U,
+0x37ED8000U,
+0x37EE0000U,
+0x37EE8000U,
+0x37EF0000U,
+0x37EF8000U,
+0x37F00000U,
+0x37F08000U,
+0x37F10000U,
+0x37F18000U,
+0x37F20000U,
+0x37F28000U,
+0x37F30000U,
+0x37F38000U,
+0x37F40000U,
+0x37F48000U,
+0x37F50000U,
+0x37F58000U,
+0x37F60000U,
+0x37F68000U,
+0x37F70000U,
+0x37F78000U,
+0x37F80000U,
+0x37F88000U,
+0x37F90000U,
+0x37F98000U,
+0x37FA0000U,
+0x37FA8000U,
+0x37FB0000U,
+0x37FB8000U,
+0x37FC0000U,
+0x37FC8000U,
+0x37FD0000U,
+0x37FD8000U,
+0x37FE0000U,
+0x37FE8000U,
+0x37FF0000U,
+0x37FF8000U,
+0x38000000U,
+0x38004000U,
+0x38008000U,
+0x3800C000U,
+0x38010000U,
+0x38014000U,
+0x38018000U,
+0x3801C000U,
+0x38020000U,
+0x38024000U,
+0x38028000U,
+0x3802C000U,
+0x38030000U,
+0x38034000U,
+0x38038000U,
+0x3803C000U,
+0x38040000U,
+0x38044000U,
+0x38048000U,
+0x3804C000U,
+0x38050000U,
+0x38054000U,
+0x38058000U,
+0x3805C000U,
+0x38060000U,
+0x38064000U,
+0x38068000U,
+0x3806C000U,
+0x38070000U,
+0x38074000U,
+0x38078000U,
+0x3807C000U,
+0x38080000U,
+0x38084000U,
+0x38088000U,
+0x3808C000U,
+0x38090000U,
+0x38094000U,
+0x38098000U,
+0x3809C000U,
+0x380A0000U,
+0x380A4000U,
+0x380A8000U,
+0x380AC000U,
+0x380B0000U,
+0x380B4000U,
+0x380B8000U,
+0x380BC000U,
+0x380C0000U,
+0x380C4000U,
+0x380C8000U,
+0x380CC000U,
+0x380D0000U,
+0x380D4000U,
+0x380D8000U,
+0x380DC000U,
+0x380E0000U,
+0x380E4000U,
+0x380E8000U,
+0x380EC000U,
+0x380F0000U,
+0x380F4000U,
+0x380F8000U,
+0x380FC000U,
+0x38100000U,
+0x38104000U,
+0x38108000U,
+0x3810C000U,
+0x38110000U,
+0x38114000U,
+0x38118000U,
+0x3811C000U,
+0x38120000U,
+0x38124000U,
+0x38128000U,
+0x3812C000U,
+0x38130000U,
+0x38134000U,
+0x38138000U,
+0x3813C000U,
+0x38140000U,
+0x38144000U,
+0x38148000U,
+0x3814C000U,
+0x38150000U,
+0x38154000U,
+0x38158000U,
+0x3815C000U,
+0x38160000U,
+0x38164000U,
+0x38168000U,
+0x3816C000U,
+0x38170000U,
+0x38174000U,
+0x38178000U,
+0x3817C000U,
+0x38180000U,
+0x38184000U,
+0x38188000U,
+0x3818C000U,
+0x38190000U,
+0x38194000U,
+0x38198000U,
+0x3819C000U,
+0x381A0000U,
+0x381A4000U,
+0x381A8000U,
+0x381AC000U,
+0x381B0000U,
+0x381B4000U,
+0x381B8000U,
+0x381BC000U,
+0x381C0000U,
+0x381C4000U,
+0x381C8000U,
+0x381CC000U,
+0x381D0000U,
+0x381D4000U,
+0x381D8000U,
+0x381DC000U,
+0x381E0000U,
+0x381E4000U,
+0x381E8000U,
+0x381EC000U,
+0x381F0000U,
+0x381F4000U,
+0x381F8000U,
+0x381FC000U,
+0x38200000U,
+0x38204000U,
+0x38208000U,
+0x3820C000U,
+0x38210000U,
+0x38214000U,
+0x38218000U,
+0x3821C000U,
+0x38220000U,
+0x38224000U,
+0x38228000U,
+0x3822C000U,
+0x38230000U,
+0x38234000U,
+0x38238000U,
+0x3823C000U,
+0x38240000U,
+0x38244000U,
+0x38248000U,
+0x3824C000U,
+0x38250000U,
+0x38254000U,
+0x38258000U,
+0x3825C000U,
+0x38260000U,
+0x38264000U,
+0x38268000U,
+0x3826C000U,
+0x38270000U,
+0x38274000U,
+0x38278000U,
+0x3827C000U,
+0x38280000U,
+0x38284000U,
+0x38288000U,
+0x3828C000U,
+0x38290000U,
+0x38294000U,
+0x38298000U,
+0x3829C000U,
+0x382A0000U,
+0x382A4000U,
+0x382A8000U,
+0x382AC000U,
+0x382B0000U,
+0x382B4000U,
+0x382B8000U,
+0x382BC000U,
+0x382C0000U,
+0x382C4000U,
+0x382C8000U,
+0x382CC000U,
+0x382D0000U,
+0x382D4000U,
+0x382D8000U,
+0x382DC000U,
+0x382E0000U,
+0x382E4000U,
+0x382E8000U,
+0x382EC000U,
+0x382F0000U,
+0x382F4000U,
+0x382F8000U,
+0x382FC000U,
+0x38300000U,
+0x38304000U,
+0x38308000U,
+0x3830C000U,
+0x38310000U,
+0x38314000U,
+0x38318000U,
+0x3831C000U,
+0x38320000U,
+0x38324000U,
+0x38328000U,
+0x3832C000U,
+0x38330000U,
+0x38334000U,
+0x38338000U,
+0x3833C000U,
+0x38340000U,
+0x38344000U,
+0x38348000U,
+0x3834C000U,
+0x38350000U,
+0x38354000U,
+0x38358000U,
+0x3835C000U,
+0x38360000U,
+0x38364000U,
+0x38368000U,
+0x3836C000U,
+0x38370000U,
+0x38374000U,
+0x38378000U,
+0x3837C000U,
+0x38380000U,
+0x38384000U,
+0x38388000U,
+0x3838C000U,
+0x38390000U,
+0x38394000U,
+0x38398000U,
+0x3839C000U,
+0x383A0000U,
+0x383A4000U,
+0x383A8000U,
+0x383AC000U,
+0x383B0000U,
+0x383B4000U,
+0x383B8000U,
+0x383BC000U,
+0x383C0000U,
+0x383C4000U,
+0x383C8000U,
+0x383CC000U,
+0x383D0000U,
+0x383D4000U,
+0x383D8000U,
+0x383DC000U,
+0x383E0000U,
+0x383E4000U,
+0x383E8000U,
+0x383EC000U,
+0x383F0000U,
+0x383F4000U,
+0x383F8000U,
+0x383FC000U,
+0x38400000U,
+0x38404000U,
+0x38408000U,
+0x3840C000U,
+0x38410000U,
+0x38414000U,
+0x38418000U,
+0x3841C000U,
+0x38420000U,
+0x38424000U,
+0x38428000U,
+0x3842C000U,
+0x38430000U,
+0x38434000U,
+0x38438000U,
+0x3843C000U,
+0x38440000U,
+0x38444000U,
+0x38448000U,
+0x3844C000U,
+0x38450000U,
+0x38454000U,
+0x38458000U,
+0x3845C000U,
+0x38460000U,
+0x38464000U,
+0x38468000U,
+0x3846C000U,
+0x38470000U,
+0x38474000U,
+0x38478000U,
+0x3847C000U,
+0x38480000U,
+0x38484000U,
+0x38488000U,
+0x3848C000U,
+0x38490000U,
+0x38494000U,
+0x38498000U,
+0x3849C000U,
+0x384A0000U,
+0x384A4000U,
+0x384A8000U,
+0x384AC000U,
+0x384B0000U,
+0x384B4000U,
+0x384B8000U,
+0x384BC000U,
+0x384C0000U,
+0x384C4000U,
+0x384C8000U,
+0x384CC000U,
+0x384D0000U,
+0x384D4000U,
+0x384D8000U,
+0x384DC000U,
+0x384E0000U,
+0x384E4000U,
+0x384E8000U,
+0x384EC000U,
+0x384F0000U,
+0x384F4000U,
+0x384F8000U,
+0x384FC000U,
+0x38500000U,
+0x38504000U,
+0x38508000U,
+0x3850C000U,
+0x38510000U,
+0x38514000U,
+0x38518000U,
+0x3851C000U,
+0x38520000U,
+0x38524000U,
+0x38528000U,
+0x3852C000U,
+0x38530000U,
+0x38534000U,
+0x38538000U,
+0x3853C000U,
+0x38540000U,
+0x38544000U,
+0x38548000U,
+0x3854C000U,
+0x38550000U,
+0x38554000U,
+0x38558000U,
+0x3855C000U,
+0x38560000U,
+0x38564000U,
+0x38568000U,
+0x3856C000U,
+0x38570000U,
+0x38574000U,
+0x38578000U,
+0x3857C000U,
+0x38580000U,
+0x38584000U,
+0x38588000U,
+0x3858C000U,
+0x38590000U,
+0x38594000U,
+0x38598000U,
+0x3859C000U,
+0x385A0000U,
+0x385A4000U,
+0x385A8000U,
+0x385AC000U,
+0x385B0000U,
+0x385B4000U,
+0x385B8000U,
+0x385BC000U,
+0x385C0000U,
+0x385C4000U,
+0x385C8000U,
+0x385CC000U,
+0x385D0000U,
+0x385D4000U,
+0x385D8000U,
+0x385DC000U,
+0x385E0000U,
+0x385E4000U,
+0x385E8000U,
+0x385EC000U,
+0x385F0000U,
+0x385F4000U,
+0x385F8000U,
+0x385FC000U,
+0x38600000U,
+0x38604000U,
+0x38608000U,
+0x3860C000U,
+0x38610000U,
+0x38614000U,
+0x38618000U,
+0x3861C000U,
+0x38620000U,
+0x38624000U,
+0x38628000U,
+0x3862C000U,
+0x38630000U,
+0x38634000U,
+0x38638000U,
+0x3863C000U,
+0x38640000U,
+0x38644000U,
+0x38648000U,
+0x3864C000U,
+0x38650000U,
+0x38654000U,
+0x38658000U,
+0x3865C000U,
+0x38660000U,
+0x38664000U,
+0x38668000U,
+0x3866C000U,
+0x38670000U,
+0x38674000U,
+0x38678000U,
+0x3867C000U,
+0x38680000U,
+0x38684000U,
+0x38688000U,
+0x3868C000U,
+0x38690000U,
+0x38694000U,
+0x38698000U,
+0x3869C000U,
+0x386A0000U,
+0x386A4000U,
+0x386A8000U,
+0x386AC000U,
+0x386B0000U,
+0x386B4000U,
+0x386B8000U,
+0x386BC000U,
+0x386C0000U,
+0x386C4000U,
+0x386C8000U,
+0x386CC000U,
+0x386D0000U,
+0x386D4000U,
+0x386D8000U,
+0x386DC000U,
+0x386E0000U,
+0x386E4000U,
+0x386E8000U,
+0x386EC000U,
+0x386F0000U,
+0x386F4000U,
+0x386F8000U,
+0x386FC000U,
+0x38700000U,
+0x38704000U,
+0x38708000U,
+0x3870C000U,
+0x38710000U,
+0x38714000U,
+0x38718000U,
+0x3871C000U,
+0x38720000U,
+0x38724000U,
+0x38728000U,
+0x3872C000U,
+0x38730000U,
+0x38734000U,
+0x38738000U,
+0x3873C000U,
+0x38740000U,
+0x38744000U,
+0x38748000U,
+0x3874C000U,
+0x38750000U,
+0x38754000U,
+0x38758000U,
+0x3875C000U,
+0x38760000U,
+0x38764000U,
+0x38768000U,
+0x3876C000U,
+0x38770000U,
+0x38774000U,
+0x38778000U,
+0x3877C000U,
+0x38780000U,
+0x38784000U,
+0x38788000U,
+0x3878C000U,
+0x38790000U,
+0x38794000U,
+0x38798000U,
+0x3879C000U,
+0x387A0000U,
+0x387A4000U,
+0x387A8000U,
+0x387AC000U,
+0x387B0000U,
+0x387B4000U,
+0x387B8000U,
+0x387BC000U,
+0x387C0000U,
+0x387C4000U,
+0x387C8000U,
+0x387CC000U,
+0x387D0000U,
+0x387D4000U,
+0x387D8000U,
+0x387DC000U,
+0x387E0000U,
+0x387E4000U,
+0x387E8000U,
+0x387EC000U,
+0x387F0000U,
+0x387F4000U,
+0x387F8000U,
+0x387FC000U,
+0x38000000U,
+0x38002000U,
+0x38004000U,
+0x38006000U,
+0x38008000U,
+0x3800A000U,
+0x3800C000U,
+0x3800E000U,
+0x38010000U,
+0x38012000U,
+0x38014000U,
+0x38016000U,
+0x38018000U,
+0x3801A000U,
+0x3801C000U,
+0x3801E000U,
+0x38020000U,
+0x38022000U,
+0x38024000U,
+0x38026000U,
+0x38028000U,
+0x3802A000U,
+0x3802C000U,
+0x3802E000U,
+0x38030000U,
+0x38032000U,
+0x38034000U,
+0x38036000U,
+0x38038000U,
+0x3803A000U,
+0x3803C000U,
+0x3803E000U,
+0x38040000U,
+0x38042000U,
+0x38044000U,
+0x38046000U,
+0x38048000U,
+0x3804A000U,
+0x3804C000U,
+0x3804E000U,
+0x38050000U,
+0x38052000U,
+0x38054000U,
+0x38056000U,
+0x38058000U,
+0x3805A000U,
+0x3805C000U,
+0x3805E000U,
+0x38060000U,
+0x38062000U,
+0x38064000U,
+0x38066000U,
+0x38068000U,
+0x3806A000U,
+0x3806C000U,
+0x3806E000U,
+0x38070000U,
+0x38072000U,
+0x38074000U,
+0x38076000U,
+0x38078000U,
+0x3807A000U,
+0x3807C000U,
+0x3807E000U,
+0x38080000U,
+0x38082000U,
+0x38084000U,
+0x38086000U,
+0x38088000U,
+0x3808A000U,
+0x3808C000U,
+0x3808E000U,
+0x38090000U,
+0x38092000U,
+0x38094000U,
+0x38096000U,
+0x38098000U,
+0x3809A000U,
+0x3809C000U,
+0x3809E000U,
+0x380A0000U,
+0x380A2000U,
+0x380A4000U,
+0x380A6000U,
+0x380A8000U,
+0x380AA000U,
+0x380AC000U,
+0x380AE000U,
+0x380B0000U,
+0x380B2000U,
+0x380B4000U,
+0x380B6000U,
+0x380B8000U,
+0x380BA000U,
+0x380BC000U,
+0x380BE000U,
+0x380C0000U,
+0x380C2000U,
+0x380C4000U,
+0x380C6000U,
+0x380C8000U,
+0x380CA000U,
+0x380CC000U,
+0x380CE000U,
+0x380D0000U,
+0x380D2000U,
+0x380D4000U,
+0x380D6000U,
+0x380D8000U,
+0x380DA000U,
+0x380DC000U,
+0x380DE000U,
+0x380E0000U,
+0x380E2000U,
+0x380E4000U,
+0x380E6000U,
+0x380E8000U,
+0x380EA000U,
+0x380EC000U,
+0x380EE000U,
+0x380F0000U,
+0x380F2000U,
+0x380F4000U,
+0x380F6000U,
+0x380F8000U,
+0x380FA000U,
+0x380FC000U,
+0x380FE000U,
+0x38100000U,
+0x38102000U,
+0x38104000U,
+0x38106000U,
+0x38108000U,
+0x3810A000U,
+0x3810C000U,
+0x3810E000U,
+0x38110000U,
+0x38112000U,
+0x38114000U,
+0x38116000U,
+0x38118000U,
+0x3811A000U,
+0x3811C000U,
+0x3811E000U,
+0x38120000U,
+0x38122000U,
+0x38124000U,
+0x38126000U,
+0x38128000U,
+0x3812A000U,
+0x3812C000U,
+0x3812E000U,
+0x38130000U,
+0x38132000U,
+0x38134000U,
+0x38136000U,
+0x38138000U,
+0x3813A000U,
+0x3813C000U,
+0x3813E000U,
+0x38140000U,
+0x38142000U,
+0x38144000U,
+0x38146000U,
+0x38148000U,
+0x3814A000U,
+0x3814C000U,
+0x3814E000U,
+0x38150000U,
+0x38152000U,
+0x38154000U,
+0x38156000U,
+0x38158000U,
+0x3815A000U,
+0x3815C000U,
+0x3815E000U,
+0x38160000U,
+0x38162000U,
+0x38164000U,
+0x38166000U,
+0x38168000U,
+0x3816A000U,
+0x3816C000U,
+0x3816E000U,
+0x38170000U,
+0x38172000U,
+0x38174000U,
+0x38176000U,
+0x38178000U,
+0x3817A000U,
+0x3817C000U,
+0x3817E000U,
+0x38180000U,
+0x38182000U,
+0x38184000U,
+0x38186000U,
+0x38188000U,
+0x3818A000U,
+0x3818C000U,
+0x3818E000U,
+0x38190000U,
+0x38192000U,
+0x38194000U,
+0x38196000U,
+0x38198000U,
+0x3819A000U,
+0x3819C000U,
+0x3819E000U,
+0x381A0000U,
+0x381A2000U,
+0x381A4000U,
+0x381A6000U,
+0x381A8000U,
+0x381AA000U,
+0x381AC000U,
+0x381AE000U,
+0x381B0000U,
+0x381B2000U,
+0x381B4000U,
+0x381B6000U,
+0x381B8000U,
+0x381BA000U,
+0x381BC000U,
+0x381BE000U,
+0x381C0000U,
+0x381C2000U,
+0x381C4000U,
+0x381C6000U,
+0x381C8000U,
+0x381CA000U,
+0x381CC000U,
+0x381CE000U,
+0x381D0000U,
+0x381D2000U,
+0x381D4000U,
+0x381D6000U,
+0x381D8000U,
+0x381DA000U,
+0x381DC000U,
+0x381DE000U,
+0x381E0000U,
+0x381E2000U,
+0x381E4000U,
+0x381E6000U,
+0x381E8000U,
+0x381EA000U,
+0x381EC000U,
+0x381EE000U,
+0x381F0000U,
+0x381F2000U,
+0x381F4000U,
+0x381F6000U,
+0x381F8000U,
+0x381FA000U,
+0x381FC000U,
+0x381FE000U,
+0x38200000U,
+0x38202000U,
+0x38204000U,
+0x38206000U,
+0x38208000U,
+0x3820A000U,
+0x3820C000U,
+0x3820E000U,
+0x38210000U,
+0x38212000U,
+0x38214000U,
+0x38216000U,
+0x38218000U,
+0x3821A000U,
+0x3821C000U,
+0x3821E000U,
+0x38220000U,
+0x38222000U,
+0x38224000U,
+0x38226000U,
+0x38228000U,
+0x3822A000U,
+0x3822C000U,
+0x3822E000U,
+0x38230000U,
+0x38232000U,
+0x38234000U,
+0x38236000U,
+0x38238000U,
+0x3823A000U,
+0x3823C000U,
+0x3823E000U,
+0x38240000U,
+0x38242000U,
+0x38244000U,
+0x38246000U,
+0x38248000U,
+0x3824A000U,
+0x3824C000U,
+0x3824E000U,
+0x38250000U,
+0x38252000U,
+0x38254000U,
+0x38256000U,
+0x38258000U,
+0x3825A000U,
+0x3825C000U,
+0x3825E000U,
+0x38260000U,
+0x38262000U,
+0x38264000U,
+0x38266000U,
+0x38268000U,
+0x3826A000U,
+0x3826C000U,
+0x3826E000U,
+0x38270000U,
+0x38272000U,
+0x38274000U,
+0x38276000U,
+0x38278000U,
+0x3827A000U,
+0x3827C000U,
+0x3827E000U,
+0x38280000U,
+0x38282000U,
+0x38284000U,
+0x38286000U,
+0x38288000U,
+0x3828A000U,
+0x3828C000U,
+0x3828E000U,
+0x38290000U,
+0x38292000U,
+0x38294000U,
+0x38296000U,
+0x38298000U,
+0x3829A000U,
+0x3829C000U,
+0x3829E000U,
+0x382A0000U,
+0x382A2000U,
+0x382A4000U,
+0x382A6000U,
+0x382A8000U,
+0x382AA000U,
+0x382AC000U,
+0x382AE000U,
+0x382B0000U,
+0x382B2000U,
+0x382B4000U,
+0x382B6000U,
+0x382B8000U,
+0x382BA000U,
+0x382BC000U,
+0x382BE000U,
+0x382C0000U,
+0x382C2000U,
+0x382C4000U,
+0x382C6000U,
+0x382C8000U,
+0x382CA000U,
+0x382CC000U,
+0x382CE000U,
+0x382D0000U,
+0x382D2000U,
+0x382D4000U,
+0x382D6000U,
+0x382D8000U,
+0x382DA000U,
+0x382DC000U,
+0x382DE000U,
+0x382E0000U,
+0x382E2000U,
+0x382E4000U,
+0x382E6000U,
+0x382E8000U,
+0x382EA000U,
+0x382EC000U,
+0x382EE000U,
+0x382F0000U,
+0x382F2000U,
+0x382F4000U,
+0x382F6000U,
+0x382F8000U,
+0x382FA000U,
+0x382FC000U,
+0x382FE000U,
+0x38300000U,
+0x38302000U,
+0x38304000U,
+0x38306000U,
+0x38308000U,
+0x3830A000U,
+0x3830C000U,
+0x3830E000U,
+0x38310000U,
+0x38312000U,
+0x38314000U,
+0x38316000U,
+0x38318000U,
+0x3831A000U,
+0x3831C000U,
+0x3831E000U,
+0x38320000U,
+0x38322000U,
+0x38324000U,
+0x38326000U,
+0x38328000U,
+0x3832A000U,
+0x3832C000U,
+0x3832E000U,
+0x38330000U,
+0x38332000U,
+0x38334000U,
+0x38336000U,
+0x38338000U,
+0x3833A000U,
+0x3833C000U,
+0x3833E000U,
+0x38340000U,
+0x38342000U,
+0x38344000U,
+0x38346000U,
+0x38348000U,
+0x3834A000U,
+0x3834C000U,
+0x3834E000U,
+0x38350000U,
+0x38352000U,
+0x38354000U,
+0x38356000U,
+0x38358000U,
+0x3835A000U,
+0x3835C000U,
+0x3835E000U,
+0x38360000U,
+0x38362000U,
+0x38364000U,
+0x38366000U,
+0x38368000U,
+0x3836A000U,
+0x3836C000U,
+0x3836E000U,
+0x38370000U,
+0x38372000U,
+0x38374000U,
+0x38376000U,
+0x38378000U,
+0x3837A000U,
+0x3837C000U,
+0x3837E000U,
+0x38380000U,
+0x38382000U,
+0x38384000U,
+0x38386000U,
+0x38388000U,
+0x3838A000U,
+0x3838C000U,
+0x3838E000U,
+0x38390000U,
+0x38392000U,
+0x38394000U,
+0x38396000U,
+0x38398000U,
+0x3839A000U,
+0x3839C000U,
+0x3839E000U,
+0x383A0000U,
+0x383A2000U,
+0x383A4000U,
+0x383A6000U,
+0x383A8000U,
+0x383AA000U,
+0x383AC000U,
+0x383AE000U,
+0x383B0000U,
+0x383B2000U,
+0x383B4000U,
+0x383B6000U,
+0x383B8000U,
+0x383BA000U,
+0x383BC000U,
+0x383BE000U,
+0x383C0000U,
+0x383C2000U,
+0x383C4000U,
+0x383C6000U,
+0x383C8000U,
+0x383CA000U,
+0x383CC000U,
+0x383CE000U,
+0x383D0000U,
+0x383D2000U,
+0x383D4000U,
+0x383D6000U,
+0x383D8000U,
+0x383DA000U,
+0x383DC000U,
+0x383DE000U,
+0x383E0000U,
+0x383E2000U,
+0x383E4000U,
+0x383E6000U,
+0x383E8000U,
+0x383EA000U,
+0x383EC000U,
+0x383EE000U,
+0x383F0000U,
+0x383F2000U,
+0x383F4000U,
+0x383F6000U,
+0x383F8000U,
+0x383FA000U,
+0x383FC000U,
+0x383FE000U,
+0x38400000U,
+0x38402000U,
+0x38404000U,
+0x38406000U,
+0x38408000U,
+0x3840A000U,
+0x3840C000U,
+0x3840E000U,
+0x38410000U,
+0x38412000U,
+0x38414000U,
+0x38416000U,
+0x38418000U,
+0x3841A000U,
+0x3841C000U,
+0x3841E000U,
+0x38420000U,
+0x38422000U,
+0x38424000U,
+0x38426000U,
+0x38428000U,
+0x3842A000U,
+0x3842C000U,
+0x3842E000U,
+0x38430000U,
+0x38432000U,
+0x38434000U,
+0x38436000U,
+0x38438000U,
+0x3843A000U,
+0x3843C000U,
+0x3843E000U,
+0x38440000U,
+0x38442000U,
+0x38444000U,
+0x38446000U,
+0x38448000U,
+0x3844A000U,
+0x3844C000U,
+0x3844E000U,
+0x38450000U,
+0x38452000U,
+0x38454000U,
+0x38456000U,
+0x38458000U,
+0x3845A000U,
+0x3845C000U,
+0x3845E000U,
+0x38460000U,
+0x38462000U,
+0x38464000U,
+0x38466000U,
+0x38468000U,
+0x3846A000U,
+0x3846C000U,
+0x3846E000U,
+0x38470000U,
+0x38472000U,
+0x38474000U,
+0x38476000U,
+0x38478000U,
+0x3847A000U,
+0x3847C000U,
+0x3847E000U,
+0x38480000U,
+0x38482000U,
+0x38484000U,
+0x38486000U,
+0x38488000U,
+0x3848A000U,
+0x3848C000U,
+0x3848E000U,
+0x38490000U,
+0x38492000U,
+0x38494000U,
+0x38496000U,
+0x38498000U,
+0x3849A000U,
+0x3849C000U,
+0x3849E000U,
+0x384A0000U,
+0x384A2000U,
+0x384A4000U,
+0x384A6000U,
+0x384A8000U,
+0x384AA000U,
+0x384AC000U,
+0x384AE000U,
+0x384B0000U,
+0x384B2000U,
+0x384B4000U,
+0x384B6000U,
+0x384B8000U,
+0x384BA000U,
+0x384BC000U,
+0x384BE000U,
+0x384C0000U,
+0x384C2000U,
+0x384C4000U,
+0x384C6000U,
+0x384C8000U,
+0x384CA000U,
+0x384CC000U,
+0x384CE000U,
+0x384D0000U,
+0x384D2000U,
+0x384D4000U,
+0x384D6000U,
+0x384D8000U,
+0x384DA000U,
+0x384DC000U,
+0x384DE000U,
+0x384E0000U,
+0x384E2000U,
+0x384E4000U,
+0x384E6000U,
+0x384E8000U,
+0x384EA000U,
+0x384EC000U,
+0x384EE000U,
+0x384F0000U,
+0x384F2000U,
+0x384F4000U,
+0x384F6000U,
+0x384F8000U,
+0x384FA000U,
+0x384FC000U,
+0x384FE000U,
+0x38500000U,
+0x38502000U,
+0x38504000U,
+0x38506000U,
+0x38508000U,
+0x3850A000U,
+0x3850C000U,
+0x3850E000U,
+0x38510000U,
+0x38512000U,
+0x38514000U,
+0x38516000U,
+0x38518000U,
+0x3851A000U,
+0x3851C000U,
+0x3851E000U,
+0x38520000U,
+0x38522000U,
+0x38524000U,
+0x38526000U,
+0x38528000U,
+0x3852A000U,
+0x3852C000U,
+0x3852E000U,
+0x38530000U,
+0x38532000U,
+0x38534000U,
+0x38536000U,
+0x38538000U,
+0x3853A000U,
+0x3853C000U,
+0x3853E000U,
+0x38540000U,
+0x38542000U,
+0x38544000U,
+0x38546000U,
+0x38548000U,
+0x3854A000U,
+0x3854C000U,
+0x3854E000U,
+0x38550000U,
+0x38552000U,
+0x38554000U,
+0x38556000U,
+0x38558000U,
+0x3855A000U,
+0x3855C000U,
+0x3855E000U,
+0x38560000U,
+0x38562000U,
+0x38564000U,
+0x38566000U,
+0x38568000U,
+0x3856A000U,
+0x3856C000U,
+0x3856E000U,
+0x38570000U,
+0x38572000U,
+0x38574000U,
+0x38576000U,
+0x38578000U,
+0x3857A000U,
+0x3857C000U,
+0x3857E000U,
+0x38580000U,
+0x38582000U,
+0x38584000U,
+0x38586000U,
+0x38588000U,
+0x3858A000U,
+0x3858C000U,
+0x3858E000U,
+0x38590000U,
+0x38592000U,
+0x38594000U,
+0x38596000U,
+0x38598000U,
+0x3859A000U,
+0x3859C000U,
+0x3859E000U,
+0x385A0000U,
+0x385A2000U,
+0x385A4000U,
+0x385A6000U,
+0x385A8000U,
+0x385AA000U,
+0x385AC000U,
+0x385AE000U,
+0x385B0000U,
+0x385B2000U,
+0x385B4000U,
+0x385B6000U,
+0x385B8000U,
+0x385BA000U,
+0x385BC000U,
+0x385BE000U,
+0x385C0000U,
+0x385C2000U,
+0x385C4000U,
+0x385C6000U,
+0x385C8000U,
+0x385CA000U,
+0x385CC000U,
+0x385CE000U,
+0x385D0000U,
+0x385D2000U,
+0x385D4000U,
+0x385D6000U,
+0x385D8000U,
+0x385DA000U,
+0x385DC000U,
+0x385DE000U,
+0x385E0000U,
+0x385E2000U,
+0x385E4000U,
+0x385E6000U,
+0x385E8000U,
+0x385EA000U,
+0x385EC000U,
+0x385EE000U,
+0x385F0000U,
+0x385F2000U,
+0x385F4000U,
+0x385F6000U,
+0x385F8000U,
+0x385FA000U,
+0x385FC000U,
+0x385FE000U,
+0x38600000U,
+0x38602000U,
+0x38604000U,
+0x38606000U,
+0x38608000U,
+0x3860A000U,
+0x3860C000U,
+0x3860E000U,
+0x38610000U,
+0x38612000U,
+0x38614000U,
+0x38616000U,
+0x38618000U,
+0x3861A000U,
+0x3861C000U,
+0x3861E000U,
+0x38620000U,
+0x38622000U,
+0x38624000U,
+0x38626000U,
+0x38628000U,
+0x3862A000U,
+0x3862C000U,
+0x3862E000U,
+0x38630000U,
+0x38632000U,
+0x38634000U,
+0x38636000U,
+0x38638000U,
+0x3863A000U,
+0x3863C000U,
+0x3863E000U,
+0x38640000U,
+0x38642000U,
+0x38644000U,
+0x38646000U,
+0x38648000U,
+0x3864A000U,
+0x3864C000U,
+0x3864E000U,
+0x38650000U,
+0x38652000U,
+0x38654000U,
+0x38656000U,
+0x38658000U,
+0x3865A000U,
+0x3865C000U,
+0x3865E000U,
+0x38660000U,
+0x38662000U,
+0x38664000U,
+0x38666000U,
+0x38668000U,
+0x3866A000U,
+0x3866C000U,
+0x3866E000U,
+0x38670000U,
+0x38672000U,
+0x38674000U,
+0x38676000U,
+0x38678000U,
+0x3867A000U,
+0x3867C000U,
+0x3867E000U,
+0x38680000U,
+0x38682000U,
+0x38684000U,
+0x38686000U,
+0x38688000U,
+0x3868A000U,
+0x3868C000U,
+0x3868E000U,
+0x38690000U,
+0x38692000U,
+0x38694000U,
+0x38696000U,
+0x38698000U,
+0x3869A000U,
+0x3869C000U,
+0x3869E000U,
+0x386A0000U,
+0x386A2000U,
+0x386A4000U,
+0x386A6000U,
+0x386A8000U,
+0x386AA000U,
+0x386AC000U,
+0x386AE000U,
+0x386B0000U,
+0x386B2000U,
+0x386B4000U,
+0x386B6000U,
+0x386B8000U,
+0x386BA000U,
+0x386BC000U,
+0x386BE000U,
+0x386C0000U,
+0x386C2000U,
+0x386C4000U,
+0x386C6000U,
+0x386C8000U,
+0x386CA000U,
+0x386CC000U,
+0x386CE000U,
+0x386D0000U,
+0x386D2000U,
+0x386D4000U,
+0x386D6000U,
+0x386D8000U,
+0x386DA000U,
+0x386DC000U,
+0x386DE000U,
+0x386E0000U,
+0x386E2000U,
+0x386E4000U,
+0x386E6000U,
+0x386E8000U,
+0x386EA000U,
+0x386EC000U,
+0x386EE000U,
+0x386F0000U,
+0x386F2000U,
+0x386F4000U,
+0x386F6000U,
+0x386F8000U,
+0x386FA000U,
+0x386FC000U,
+0x386FE000U,
+0x38700000U,
+0x38702000U,
+0x38704000U,
+0x38706000U,
+0x38708000U,
+0x3870A000U,
+0x3870C000U,
+0x3870E000U,
+0x38710000U,
+0x38712000U,
+0x38714000U,
+0x38716000U,
+0x38718000U,
+0x3871A000U,
+0x3871C000U,
+0x3871E000U,
+0x38720000U,
+0x38722000U,
+0x38724000U,
+0x38726000U,
+0x38728000U,
+0x3872A000U,
+0x3872C000U,
+0x3872E000U,
+0x38730000U,
+0x38732000U,
+0x38734000U,
+0x38736000U,
+0x38738000U,
+0x3873A000U,
+0x3873C000U,
+0x3873E000U,
+0x38740000U,
+0x38742000U,
+0x38744000U,
+0x38746000U,
+0x38748000U,
+0x3874A000U,
+0x3874C000U,
+0x3874E000U,
+0x38750000U,
+0x38752000U,
+0x38754000U,
+0x38756000U,
+0x38758000U,
+0x3875A000U,
+0x3875C000U,
+0x3875E000U,
+0x38760000U,
+0x38762000U,
+0x38764000U,
+0x38766000U,
+0x38768000U,
+0x3876A000U,
+0x3876C000U,
+0x3876E000U,
+0x38770000U,
+0x38772000U,
+0x38774000U,
+0x38776000U,
+0x38778000U,
+0x3877A000U,
+0x3877C000U,
+0x3877E000U,
+0x38780000U,
+0x38782000U,
+0x38784000U,
+0x38786000U,
+0x38788000U,
+0x3878A000U,
+0x3878C000U,
+0x3878E000U,
+0x38790000U,
+0x38792000U,
+0x38794000U,
+0x38796000U,
+0x38798000U,
+0x3879A000U,
+0x3879C000U,
+0x3879E000U,
+0x387A0000U,
+0x387A2000U,
+0x387A4000U,
+0x387A6000U,
+0x387A8000U,
+0x387AA000U,
+0x387AC000U,
+0x387AE000U,
+0x387B0000U,
+0x387B2000U,
+0x387B4000U,
+0x387B6000U,
+0x387B8000U,
+0x387BA000U,
+0x387BC000U,
+0x387BE000U,
+0x387C0000U,
+0x387C2000U,
+0x387C4000U,
+0x387C6000U,
+0x387C8000U,
+0x387CA000U,
+0x387CC000U,
+0x387CE000U,
+0x387D0000U,
+0x387D2000U,
+0x387D4000U,
+0x387D6000U,
+0x387D8000U,
+0x387DA000U,
+0x387DC000U,
+0x387DE000U,
+0x387E0000U,
+0x387E2000U,
+0x387E4000U,
+0x387E6000U,
+0x387E8000U,
+0x387EA000U,
+0x387EC000U,
+0x387EE000U,
+0x387F0000U,
+0x387F2000U,
+0x387F4000U,
+0x387F6000U,
+0x387F8000U,
+0x387FA000U,
+0x387FC000U,
+0x387FE000U,
+};
+
+const quint32 qfloat16::exponenttable[64] = {
+0,
+0x800000U,
+0x1000000U,
+0x1800000U,
+0x2000000U,
+0x2800000U,
+0x3000000U,
+0x3800000U,
+0x4000000U,
+0x4800000U,
+0x5000000U,
+0x5800000U,
+0x6000000U,
+0x6800000U,
+0x7000000U,
+0x7800000U,
+0x8000000U,
+0x8800000U,
+0x9000000U,
+0x9800000U,
+0xA000000U,
+0xA800000U,
+0xB000000U,
+0xB800000U,
+0xC000000U,
+0xC800000U,
+0xD000000U,
+0xD800000U,
+0xE000000U,
+0xE800000U,
+0xF000000U,
+0x47800000U,
+0x80000000U,
+0x80800000U,
+0x81000000U,
+0x81800000U,
+0x82000000U,
+0x82800000U,
+0x83000000U,
+0x83800000U,
+0x84000000U,
+0x84800000U,
+0x85000000U,
+0x85800000U,
+0x86000000U,
+0x86800000U,
+0x87000000U,
+0x87800000U,
+0x88000000U,
+0x88800000U,
+0x89000000U,
+0x89800000U,
+0x8A000000U,
+0x8A800000U,
+0x8B000000U,
+0x8B800000U,
+0x8C000000U,
+0x8C800000U,
+0x8D000000U,
+0x8D800000U,
+0x8E000000U,
+0x8E800000U,
+0x8F000000U,
+0xC7800000U,
+};
+
+const quint32 qfloat16::offsettable[64] = {
+0,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+0,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+1024U,
+};
+
+const quint32 qfloat16::basetable[512] = {
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x0U,
+0x1U,
+0x2U,
+0x4U,
+0x8U,
+0x10U,
+0x20U,
+0x40U,
+0x80U,
+0x100U,
+0x200U,
+0x400U,
+0x800U,
+0xC00U,
+0x1000U,
+0x1400U,
+0x1800U,
+0x1C00U,
+0x2000U,
+0x2400U,
+0x2800U,
+0x2C00U,
+0x3000U,
+0x3400U,
+0x3800U,
+0x3C00U,
+0x4000U,
+0x4400U,
+0x4800U,
+0x4C00U,
+0x5000U,
+0x5400U,
+0x5800U,
+0x5C00U,
+0x6000U,
+0x6400U,
+0x6800U,
+0x6C00U,
+0x7000U,
+0x7400U,
+0x7800U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x7C00U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8000U,
+0x8001U,
+0x8002U,
+0x8004U,
+0x8008U,
+0x8010U,
+0x8020U,
+0x8040U,
+0x8080U,
+0x8100U,
+0x8200U,
+0x8400U,
+0x8800U,
+0x8C00U,
+0x9000U,
+0x9400U,
+0x9800U,
+0x9C00U,
+0xA000U,
+0xA400U,
+0xA800U,
+0xAC00U,
+0xB000U,
+0xB400U,
+0xB800U,
+0xBC00U,
+0xC000U,
+0xC400U,
+0xC800U,
+0xCC00U,
+0xD000U,
+0xD400U,
+0xD800U,
+0xDC00U,
+0xE000U,
+0xE400U,
+0xE800U,
+0xEC00U,
+0xF000U,
+0xF400U,
+0xF800U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+0xFC00U,
+};
+
+const quint32 qfloat16::shifttable[512] = {
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x17U,
+0x16U,
+0x15U,
+0x14U,
+0x13U,
+0x12U,
+0x11U,
+0x10U,
+0xFU,
+0xEU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0xDU,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x17U,
+0x16U,
+0x15U,
+0x14U,
+0x13U,
+0x12U,
+0x11U,
+0x10U,
+0xFU,
+0xEU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0xDU,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0x18U,
+0xDU,
+};
+
+#endif // !__F16C__ && !__ARM_FP16_FORMAT_IEEE
+
+QT_END_NAMESPACE
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 78ad2a5421..4ab5bd2edb 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -47,11 +47,15 @@
#include "qoperatingsystemversion.h"
#include "qoperatingsystemversion_p.h"
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINRT)
-#include "qoperatingsystemversion_win_p.h"
-#endif
+# include "qoperatingsystemversion_win_p.h"
+# ifndef Q_OS_WINRT
+# include "private/qwinregistry_p.h"
+# endif
+#endif // Q_OS_WIN || Q_OS_CYGWIN
#include <private/qlocale_tools_p.h>
#include <qmutex.h>
+#include <QtCore/private/qlocking_p.h>
#include <stdlib.h>
#include <limits.h>
@@ -1152,12 +1156,12 @@ Q_STATIC_ASSERT((std::is_same<qsizetype, qptrdiff>::value));
\sa QT_VERSION_STR, QLibraryInfo::version()
*/
-const char *qVersion() Q_DECL_NOTHROW
+const char *qVersion() noexcept
{
return QT_VERSION_STR;
}
-bool qSharedBuild() Q_DECL_NOTHROW
+bool qSharedBuild() noexcept
{
#ifdef QT_SHARED
return true;
@@ -1903,6 +1907,42 @@ bool qSharedBuild() Q_DECL_NOTHROW
*/
/*!
+ \macro Q_PROCESSOR_RISCV
+ \relates <QtGlobal>
+ \since 5.13
+
+ Defined if the application is compiled for RISC-V processors. Qt currently
+ supports two RISC-V variants: \l Q_PROCESSOR_RISCV_32 and \l
+ Q_PROCESSOR_RISCV_64.
+
+ \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
+ \macro Q_PROCESSOR_RISCV_32
+ \relates <QtGlobal>
+ \since 5.13
+
+ Defined if the application is compiled for 32-bit RISC-V processors. The \l
+ Q_PROCESSOR_RISCV macro is also defined when Q_PROCESSOR_RISCV_32 is
+ defined.
+
+ \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
+ \macro Q_PROCESSOR_RISCV_64
+ \relates <QtGlobal>
+ \since 5.13
+
+ Defined if the application is compiled for 64-bit RISC-V processors. The \l
+ Q_PROCESSOR_RISCV macro is also defined when Q_PROCESSOR_RISCV_64 is
+ defined.
+
+ \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
\macro Q_PROCESSOR_S390
\relates <QtGlobal>
@@ -2149,12 +2189,33 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
QT_WARNING_POP
#endif
+static QString readVersionRegistryString(const wchar_t *subKey)
+{
+#if !defined(QT_BUILD_QMAKE) && !defined(Q_OS_WINRT)
+ return QWinRegistryKey(HKEY_LOCAL_MACHINE, LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion)")
+ .stringValue(subKey);
+#else
+ Q_UNUSED(subKey);
+ return QString();
+#endif
+}
+
+static inline QString windows10ReleaseId()
+{
+ return readVersionRegistryString(L"ReleaseId");
+}
+
+static inline QString windows7Build()
+{
+ return readVersionRegistryString(L"CurrentBuild");
+}
+
static QString winSp_helper()
{
const auto osv = qWindowsVersionInfo();
const qint16 major = osv.wServicePackMajor;
if (major) {
- QString sp = QStringLiteral(" SP ") + QString::number(major);
+ QString sp = QStringLiteral("SP ") + QString::number(major);
const qint16 minor = osv.wServicePackMinor;
if (minor)
sp += QLatin1Char('.') + QString::number(minor);
@@ -2867,19 +2928,34 @@ QString QSysInfo::prettyProductName()
{
#if (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) || defined(Q_OS_DARWIN) || defined(Q_OS_WIN)
const auto version = QOperatingSystemVersion::current();
+ const int majorVersion = version.majorVersion();
+ const QString versionString = QString::number(majorVersion) + QLatin1Char('.')
+ + QString::number(version.minorVersion());
+ QString result = version.name() + QLatin1Char(' ');
const char *name = osVer_helper(version);
- if (name)
- return version.name() + QLatin1Char(' ') + QLatin1String(name)
-# if defined(Q_OS_WIN)
- + winSp_helper()
-# endif
- + QLatin1String(" (") + QString::number(version.majorVersion())
- + QLatin1Char('.') + QString::number(version.minorVersion())
- + QLatin1Char(')');
- else
- return version.name() + QLatin1Char(' ')
- + QString::number(version.majorVersion()) + QLatin1Char('.')
- + QString::number(version.minorVersion());
+ if (!name)
+ return result + versionString;
+ result += QLatin1String(name);
+# if !defined(Q_OS_WIN) || defined(Q_OS_WINRT)
+ return result + QLatin1String(" (") + versionString + QLatin1Char(')');
+# else
+ // (resembling winver.exe): Windows 10 "Windows 10 Version 1809"
+ if (majorVersion >= 10) {
+ const auto releaseId = windows10ReleaseId();
+ if (!releaseId.isEmpty())
+ result += QLatin1String(" Version ") + releaseId;
+ return result;
+ }
+ // Windows 7: "Windows 7 Version 6.1 (Build 7601: Service Pack 1)"
+ result += QLatin1String(" Version ") + versionString + QLatin1String(" (");
+ const auto build = windows7Build();
+ if (!build.isEmpty())
+ result += QLatin1String("Build ") + build;
+ const auto servicePack = winSp_helper();
+ if (!servicePack.isEmpty())
+ result += QLatin1String(": ") + servicePack;
+ return result + QLatin1Char(')');
+# endif // Windows
#elif defined(Q_OS_HAIKU)
return QLatin1String("Haiku ") + productVersion();
#elif defined(Q_OS_UNIX)
@@ -2921,6 +2997,7 @@ QString QSysInfo::machineHostName()
struct utsname u;
if (uname(&u) == 0)
return QString::fromLocal8Bit(u.nodename);
+ return QString();
#else
# ifdef Q_OS_WIN
// Important: QtNetwork depends on machineHostName() initializing ws2_32.dll
@@ -2933,7 +3010,6 @@ QString QSysInfo::machineHostName()
hostName[sizeof(hostName) - 1] = '\0';
return QString::fromLocal8Bit(hostName);
#endif
- return QString();
}
#endif // QT_BOOTSTRAPPED
@@ -2998,6 +3074,7 @@ QByteArray QSysInfo::machineUniqueId()
}
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
// Let's poke at the registry
+ // ### Qt 6: Use new helpers from qwinregistry.cpp (once bootstrap builds are obsolete)
HKEY key = NULL;
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ | KEY_WOW64_64KEY, &key)
== ERROR_SUCCESS) {
@@ -3224,7 +3301,7 @@ QByteArray QSysInfo::bootUniqueId()
The Q_CHECK_PTR macro calls this function if an allocation check
fails.
*/
-void qt_check_pointer(const char *n, int l) Q_DECL_NOTHROW
+void qt_check_pointer(const char *n, int l) noexcept
{
// make separate printing calls so that the first one may flush;
// the second one could want to allocate memory (fputs prints a
@@ -3251,7 +3328,7 @@ void qBadAlloc()
Allows you to call std::terminate() without including <exception>.
Called internally from QT_TERMINATE_ON_EXCEPTION
*/
-Q_NORETURN void qTerminate() Q_DECL_NOTHROW
+Q_NORETURN void qTerminate() noexcept
{
std::terminate();
}
@@ -3260,7 +3337,7 @@ Q_NORETURN void qTerminate() Q_DECL_NOTHROW
/*
The Q_ASSERT macro calls this function when the test fails.
*/
-void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW
+void qt_assert(const char *assertion, const char *file, int line) noexcept
{
QMessageLogger(file, line, nullptr).fatal("ASSERT: \"%s\" in file %s, line %d", assertion, file, line);
}
@@ -3268,7 +3345,7 @@ void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW
/*
The Q_ASSERT_X macro calls this function when the test fails.
*/
-void qt_assert_x(const char *where, const char *what, const char *file, int line) Q_DECL_NOTHROW
+void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept
{
QMessageLogger(file, line, nullptr).fatal("ASSERT failure in %s: \"%s\", file %s, line %d", where, what, file, line);
}
@@ -3315,7 +3392,7 @@ static QBasicMutex environmentMutex;
*/
void qTzSet()
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#if defined(Q_OS_WIN)
_tzset();
#else
@@ -3329,7 +3406,7 @@ void qTzSet()
*/
time_t qMkTime(struct tm *when)
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
return mktime(when);
}
@@ -3361,7 +3438,7 @@ time_t qMkTime(struct tm *when)
*/
QByteArray qgetenv(const char *varName)
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#ifdef Q_CC_MSVC
size_t requiredSize = 0;
QByteArray buffer;
@@ -3429,7 +3506,7 @@ QByteArray qgetenv(const char *varName)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
{
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
QVarLengthArray<wchar_t, 32> wname(int(strlen(varName)) + 1);
for (int i = 0; i < wname.size(); ++i) // wname.size() is correct: will copy terminating null
wname[i] = uchar(varName[i]);
@@ -3475,9 +3552,9 @@ QString qEnvironmentVariable(const char *varName)
\sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet()
*/
-bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
+bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#ifdef Q_CC_MSVC
// we provide a buffer that can only hold the empty string, so
// when the env.var isn't empty, we'll get an ERANGE error (buffer
@@ -3510,13 +3587,13 @@ bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT
\sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsSet()
*/
-int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
+int qEnvironmentVariableIntValue(const char *varName, bool *ok) noexcept
{
static const int NumBinaryDigitsPerOctalDigit = 3;
static const int MaxDigitsForOctalInt =
(std::numeric_limits<uint>::digits + NumBinaryDigitsPerOctalDigit - 1) / NumBinaryDigitsPerOctalDigit;
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#ifdef Q_CC_MSVC
// we provide a buffer that can hold any int value:
char buffer[MaxDigitsForOctalInt + 2]; // +1 for NUL +1 for optional '-'
@@ -3579,15 +3656,15 @@ int qEnvironmentVariableIntValue(const char *varName, bool *ok) Q_DECL_NOEXCEPT
\sa qgetenv(), qEnvironmentVariable(), qEnvironmentVariableIsEmpty()
*/
-bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
+bool qEnvironmentVariableIsSet(const char *varName) noexcept
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#ifdef Q_CC_MSVC
size_t requiredSize = 0;
(void)getenv_s(&requiredSize, 0, 0, varName);
return requiredSize != 0;
#else
- return ::getenv(varName) != 0;
+ return ::getenv(varName) != nullptr;
#endif
}
@@ -3611,7 +3688,7 @@ bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT
*/
bool qputenv(const char *varName, const QByteArray& value)
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#if defined(Q_CC_MSVC)
return _putenv_s(varName, value.constData()) == 0;
#elif (defined(_POSIX_VERSION) && (_POSIX_VERSION-0) >= 200112L) || defined(Q_OS_HAIKU)
@@ -3642,7 +3719,7 @@ bool qputenv(const char *varName, const QByteArray& value)
*/
bool qunsetenv(const char *varName)
{
- QMutexLocker locker(&environmentMutex);
+ const auto locker = qt_scoped_lock(environmentMutex);
#if defined(Q_CC_MSVC)
return _putenv_s(varName, "") == 0;
#elif (defined(_POSIX_VERSION) && (_POSIX_VERSION-0) >= 200112L) || defined(Q_OS_BSD4) || defined(Q_OS_HAIKU)
@@ -3781,6 +3858,56 @@ bool qunsetenv(const char *varName)
*/
/*!
+ \fn template <typename T, typename U = T> T qExchange(T &obj, U &&newValue)
+ \relates <QtGlobal>
+ \since 5.14
+
+ Replaces the value of \a obj with \a newValue and returns the old value of \a obj.
+
+ This is Qt's implementation of std::exchange(). It differs from std::exchange()
+ only in that it is \c constexpr already in C++14, and available on all supported
+ compilers.
+
+ Here is how to use qExchange() to implement move constructors:
+ \code
+ MyClass(MyClass &&other)
+ : m_pointer{qExchange(other.m_pointer, nullptr)},
+ m_int{qExchange(other.m_int, 0)},
+ m_vector{std::move(other.m_vector)},
+ ...
+ \endcode
+
+ For members of class type, we can use std::move(), as their move-constructor will
+ do the right thing. But for scalar types such as raw pointers or integer type, move
+ is the same as copy, which, particularly for pointers, is not what we expect. So, we
+ cannot use std::move() for such types, but we can use std::exchange()/qExchange() to
+ make sure the source object's member is already reset by the time we get to the
+ initialization of our next data member, which might come in handy if the constructor
+ exits with an exception.
+
+ Here is how to use qExchange() to write a loop that consumes the collection it
+ iterates over:
+ \code
+ for (auto &e : qExchange(collection, {})
+ doSomethingWith(e);
+ \endcode
+
+ Which is equivalent to the following, much more verbose code:
+ \code
+ {
+ auto tmp = std::move(collection);
+ collection = {}; // or collection.clear()
+ for (auto &e : tmp)
+ doSomethingWith(e);
+ } // destroys 'tmp'
+ \endcode
+
+ This is perfectly safe, as the for-loop keeps the result of qExchange() alive for as
+ long as the loop runs, saving the declaration of a temporary variable. Be aware, though,
+ that qExchange() returns a non-const object, so Qt containers may detach.
+*/
+
+/*!
\macro QT_TR_NOOP(sourceText)
\relates <QtGlobal>
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 223ebbcabe..1e26e9453a 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -307,6 +307,14 @@ typedef double qreal;
# define QT_DEPRECATED_CONSTRUCTOR
#endif
+#ifndef QT_DEPRECATED_WARNINGS_SINCE
+# ifdef QT_DISABLE_DEPRECATED_BEFORE
+# define QT_DEPRECATED_WARNINGS_SINCE QT_DISABLE_DEPRECATED_BEFORE
+# else
+# define QT_DEPRECATED_WARNINGS_SINCE QT_VERSION
+# endif
+#endif
+
#ifndef QT_DISABLE_DEPRECATED_BEFORE
#define QT_DISABLE_DEPRECATED_BEFORE QT_VERSION_CHECK(5, 0, 0)
#endif
@@ -330,6 +338,59 @@ typedef double qreal;
#endif
/*
+ QT_DEPRECATED_VERSION(major, minor) and QT_DEPRECATED_VERSION_X(major, minor, text)
+ outputs a deprecation warning if QT_DEPRECATED_WARNINGS_SINCE is equal or greater
+ than the version specified as major, minor. This makes it possible to deprecate a
+ function without annoying a user who needs to stick at a specified minimum version
+ and therefore can't use the new function.
+*/
+#if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 12, 0)
+# define QT_DEPRECATED_VERSION_X_5_12(text) QT_DEPRECATED_X(text)
+# define QT_DEPRECATED_VERSION_5_12 QT_DEPRECATED
+#else
+# define QT_DEPRECATED_VERSION_X_5_12(text)
+# define QT_DEPRECATED_VERSION_5_12
+#endif
+
+#if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 13, 0)
+# define QT_DEPRECATED_VERSION_X_5_13(text) QT_DEPRECATED_X(text)
+# define QT_DEPRECATED_VERSION_5_13 QT_DEPRECATED
+#else
+# define QT_DEPRECATED_VERSION_X_5_13(text)
+# define QT_DEPRECATED_VERSION_5_13
+#endif
+
+#if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 14, 0)
+# define QT_DEPRECATED_VERSION_X_5_14(text) QT_DEPRECATED_X(text)
+# define QT_DEPRECATED_VERSION_5_14 QT_DEPRECATED
+#else
+# define QT_DEPRECATED_VERSION_X_5_14(text)
+# define QT_DEPRECATED_VERSION_5_14
+#endif
+
+#if QT_DEPRECATED_WARNINGS_SINCE >= QT_VERSION_CHECK(5, 15, 0)
+# define QT_DEPRECATED_VERSION_X_5_15(text) QT_DEPRECATED_X(text)
+# define QT_DEPRECATED_VERSION_5_15 QT_DEPRECATED
+#else
+# define QT_DEPRECATED_VERSION_X_5_15(text)
+# define QT_DEPRECATED_VERSION_5_15
+#endif
+
+#define QT_DEPRECATED_VERSION_X_5(minor, text) QT_DEPRECATED_VERSION_X_5_##minor(text)
+#define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major(minor, text)
+
+#define QT_DEPRECATED_VERSION_5(minor) QT_DEPRECATED_VERSION_5_##minor
+#define QT_DEPRECATED_VERSION(major, minor) QT_DEPRECATED_VERSION_##major(minor)
+
+#ifdef __cplusplus
+// A tag to help mark stuff deprecated (cf. QStringViewLiteral)
+namespace QtPrivate {
+enum class Deprecated_t {};
+constexpr Q_DECL_UNUSED Deprecated_t Deprecated = {};
+}
+#endif
+
+/*
The Qt modules' export macros.
The options are:
- defined(QT_STATIC): Qt was built or is being built in static mode
@@ -369,8 +430,8 @@ typedef double qreal;
operator to disable copying (the compiler gives an error message).
*/
#define Q_DISABLE_COPY(Class) \
- Class(const Class &) Q_DECL_EQ_DELETE;\
- Class &operator=(const Class &) Q_DECL_EQ_DELETE;
+ Class(const Class &) = delete;\
+ Class &operator=(const Class &) = delete;
#define Q_DISABLE_MOVE(Class) \
Class(Class &&) = delete; \
@@ -411,7 +472,7 @@ typedef double qreal;
#if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC)
extern "C"
#endif
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT;
#if defined(__cplusplus)
@@ -456,11 +517,8 @@ namespace QtPrivate {
template <class T> struct AlignOf : AlignOf_Default<T> { };
template <class T> struct AlignOf<T &> : AlignOf<T> {};
- template <size_t N, class T> struct AlignOf<T[N]> : AlignOf<T> {};
-
-#ifdef Q_COMPILER_RVALUE_REFS
template <class T> struct AlignOf<T &&> : AlignOf<T> {};
-#endif
+ template <size_t N, class T> struct AlignOf<T[N]> : AlignOf<T> {};
#if defined(Q_PROCESSOR_X86_32) && !defined(Q_OS_WIN)
template <class T> struct AlignOf_WorkaroundForI386Abi { enum { Value = sizeof(T) }; };
@@ -562,7 +620,8 @@ using qsizetype = QIntegerForSizeof<std::size_t>::Signed;
# define Q_ALWAYS_INLINE inline
#endif
-#if defined(Q_CC_GNU) && defined(Q_OS_WIN)
+#if defined(Q_CC_GNU) && defined(Q_OS_WIN) && !defined(QT_NO_DATA_RELOCATION)
+// ### Qt6: you can remove me
# define QT_INIT_METAOBJECT __attribute__((init_priority(101)))
#else
# define QT_INIT_METAOBJECT
@@ -730,7 +789,7 @@ inline void qt_noop(void) {}
# define QT_CATCH(A) catch (A)
# define QT_THROW(A) throw A
# define QT_RETHROW throw
-Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW;
+Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() noexcept;
# ifdef Q_COMPILER_NOEXCEPT
# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false)
# else
@@ -738,7 +797,7 @@ Q_NORETURN Q_DECL_COLD_FUNCTION Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW;
# endif
#endif
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qSharedBuild() noexcept;
#ifndef Q_OUTOFLINE_TEMPLATE
# define Q_OUTOFLINE_TEMPLATE
@@ -781,7 +840,7 @@ Q_CORE_EXPORT QString qt_error_string(int errorCode = -1);
Q_NORETURN
#endif
Q_DECL_COLD_FUNCTION
-Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line) noexcept;
#if !defined(Q_ASSERT)
# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
@@ -791,15 +850,11 @@ Q_CORE_EXPORT void qt_assert(const char *assertion, const char *file, int line)
# endif
#endif
-#if defined(QT_NO_DEBUG) && !defined(QT_PAINT_DEBUG)
-#define QT_NO_PAINT_DEBUG
-#endif
-
#ifndef Q_CC_MSVC
Q_NORETURN
#endif
Q_DECL_COLD_FUNCTION
-Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line) Q_DECL_NOTHROW;
+Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *file, int line) noexcept;
#if !defined(Q_ASSERT_X)
# if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
@@ -809,7 +864,7 @@ Q_CORE_EXPORT void qt_assert_x(const char *where, const char *what, const char *
# endif
#endif
-Q_NORETURN Q_CORE_EXPORT void qt_check_pointer(const char *, int) Q_DECL_NOTHROW;
+Q_NORETURN Q_CORE_EXPORT void qt_check_pointer(const char *, int) noexcept;
Q_DECL_COLD_FUNCTION
Q_CORE_EXPORT void qBadAlloc();
@@ -852,38 +907,23 @@ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyIsNul
return qAbs(f) <= 0.00001f;
}
-/*
- This function tests a double for a null value. It doesn't
- check whether the actual value is 0 or close to 0, but whether
- it is binary 0, disregarding sign.
-*/
-Q_REQUIRED_RESULT static inline Q_DECL_UNUSED bool qIsNull(double d)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
+QT_WARNING_DISABLE_GCC("-Wfloat-equal")
+QT_WARNING_DISABLE_INTEL(1572)
+
+Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qIsNull(double d) noexcept
{
- union U {
- double d;
- quint64 u;
- };
- U val;
- val.d = d;
- return (val.u & Q_UINT64_C(0x7fffffffffffffff)) == 0;
+ return d == 0.0;
}
-/*
- This function tests a float for a null value. It doesn't
- check whether the actual value is 0 or close to 0, but whether
- it is binary 0, disregarding sign.
-*/
-Q_REQUIRED_RESULT static inline Q_DECL_UNUSED bool qIsNull(float f)
+Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qIsNull(float f) noexcept
{
- union U {
- float f;
- quint32 u;
- };
- U val;
- val.f = f;
- return (val.u & 0x7fffffff) == 0;
+ return f == 0.0f;
}
+QT_WARNING_POP
+
/*
Compilers which follow outdated template instantiation rules
require a class to have a comparison operator to exist when
@@ -910,14 +950,14 @@ namespace SwapExceptionTester { // insulate users from the "using std::swap" bel
using std::swap; // import std::swap
template <typename T>
void checkSwap(T &t)
- Q_DECL_NOEXCEPT_EXPR(noexcept(swap(t, t)));
+ noexcept(noexcept(swap(t, t)));
// declared, but not implemented (only to be used in unevaluated contexts (noexcept operator))
}
} // namespace QtPrivate
template <typename T>
inline void qSwap(T &value1, T &value2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1)))
+ noexcept(noexcept(QtPrivate::SwapExceptionTester::checkSwap(value1)))
{
using std::swap;
swap(value1, value2);
@@ -966,12 +1006,44 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
# endif
#endif
+// Work around MSVC warning about use of 3-arg algorithms
+// until we can depend on the C++14 4-arg ones.
+//
+// These algortithms do NOT check for equal length.
+// They need to be treated as if they called the 3-arg version (which they do)!
+#ifdef Q_CC_MSVC
+# define QT_3ARG_ALG(alg, f1, l1, f2, l2) \
+ std::alg(f1, l1, f2, l2)
+#else
+# define QT_3ARG_ALG(alg, f1, l1, f2, l2) \
+ [&f1, &l1, &f2, &l2]() { \
+ Q_UNUSED(l2); \
+ return std::alg(f1, l1, f2); \
+ }()
+#endif
+template <typename ForwardIterator1, typename ForwardIterator2>
+inline bool qt_is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2)
+{
+ return QT_3ARG_ALG(is_permutation, first1, last1, first2, last2);
+}
+#undef QT_3ARG_ALG
+
// this adds const to non-const objects (like std::as_const)
template <typename T>
-Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) noexcept { return t; }
// prevent rvalue arguments:
template <typename T>
-void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+void qAsConst(const T &&) = delete;
+
+// like std::exchange
+template <typename T, typename U = T>
+Q_DECL_RELAXED_CONSTEXPR T qExchange(T &t, U &&newValue)
+{
+ T old = std::move(t);
+ t = std::forward<U>(newValue);
+ return old;
+}
#ifndef QT_NO_FOREACH
@@ -1052,7 +1124,7 @@ for (auto _container_ = QtPrivate::qMakeForeachContainer(container); \
#endif
template <typename T> inline T *qGetPtrHelper(T *ptr) { return ptr; }
-template <typename Ptr> inline auto qGetPtrHelper(const Ptr &ptr) -> decltype(ptr.operator->()) { return ptr.operator->(); }
+template <typename Ptr> inline auto qGetPtrHelper(Ptr &ptr) -> decltype(ptr.operator->()) { return ptr.operator->(); }
// The body must be a statement:
#define Q_CAST_IGNORE_ALIGN(body) QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wcast-align") body QT_WARNING_POP
@@ -1130,11 +1202,11 @@ template <typename... Args>
struct QNonConstOverload
{
template <typename R, typename T>
- Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
+ Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...)) const noexcept -> decltype(ptr)
{ return ptr; }
template <typename R, typename T>
- static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
+ static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...)) noexcept -> decltype(ptr)
{ return ptr; }
};
@@ -1142,11 +1214,11 @@ template <typename... Args>
struct QConstOverload
{
template <typename R, typename T>
- Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const Q_DECL_NOTHROW -> decltype(ptr)
+ Q_DECL_CONSTEXPR auto operator()(R (T::*ptr)(Args...) const) const noexcept -> decltype(ptr)
{ return ptr; }
template <typename R, typename T>
- static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) Q_DECL_NOTHROW -> decltype(ptr)
+ static Q_DECL_CONSTEXPR auto of(R (T::*ptr)(Args...) const) noexcept -> decltype(ptr)
{ return ptr; }
};
@@ -1159,11 +1231,11 @@ struct QOverload : QConstOverload<Args...>, QNonConstOverload<Args...>
using QNonConstOverload<Args...>::operator();
template <typename R>
- Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const Q_DECL_NOTHROW -> decltype(ptr)
+ Q_DECL_CONSTEXPR auto operator()(R (*ptr)(Args...)) const noexcept -> decltype(ptr)
{ return ptr; }
template <typename R>
- static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) Q_DECL_NOTHROW -> decltype(ptr)
+ static Q_DECL_CONSTEXPR auto of(R (*ptr)(Args...)) noexcept -> decltype(ptr)
{ return ptr; }
};
@@ -1184,9 +1256,9 @@ Q_CORE_EXPORT QString qEnvironmentVariable(const char *varName, const QString &d
Q_CORE_EXPORT bool qputenv(const char *varName, const QByteArray& value);
Q_CORE_EXPORT bool qunsetenv(const char *varName);
-Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) Q_DECL_NOEXCEPT;
-Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) Q_DECL_NOEXCEPT;
-Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) Q_DECL_NOEXCEPT;
+Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept;
+Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept;
+Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept;
inline int qIntCast(double f) { return int(f); }
inline int qIntCast(float f) { return int(f); }
diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h
index 555bdf04c1..e56fe1dbcb 100644
--- a/src/corelib/global/qglobalstatic.h
+++ b/src/corelib/global/qglobalstatic.h
@@ -79,16 +79,16 @@ enum GuardValues {
Q_GLOBAL_STATIC_INTERNAL_DECORATION Type *innerFunction() \
{ \
struct HolderBase { \
- ~HolderBase() Q_DECL_NOTHROW \
- { if (guard.load() == QtGlobalStatic::Initialized) \
- guard.store(QtGlobalStatic::Destroyed); } \
+ ~HolderBase() noexcept \
+ { if (guard.loadRelaxed() == QtGlobalStatic::Initialized) \
+ guard.storeRelaxed(QtGlobalStatic::Destroyed); } \
}; \
static struct Holder : public HolderBase { \
Type value; \
Holder() \
- Q_DECL_NOEXCEPT_EXPR(noexcept(Type ARGS)) \
+ noexcept(noexcept(Type ARGS)) \
: value ARGS \
- { guard.store(QtGlobalStatic::Initialized); } \
+ { guard.storeRelaxed(QtGlobalStatic::Initialized); } \
} holder; \
return &holder.value; \
}
@@ -98,6 +98,7 @@ enum GuardValues {
QT_END_NAMESPACE
#include <QtCore/qmutex.h>
+#include <mutex>
QT_BEGIN_NAMESPACE
#define Q_GLOBAL_STATIC_INTERNAL(ARGS) \
@@ -107,13 +108,13 @@ QT_BEGIN_NAMESPACE
static QBasicMutex mutex; \
int x = guard.loadAcquire(); \
if (Q_UNLIKELY(x >= QtGlobalStatic::Uninitialized)) { \
- QMutexLocker locker(&mutex); \
- if (guard.load() == QtGlobalStatic::Uninitialized) { \
+ const std::lock_guard<QBasicMutex> locker(mutex); \
+ if (guard.loadRelaxed() == QtGlobalStatic::Uninitialized) { \
d = new Type ARGS; \
static struct Cleanup { \
~Cleanup() { \
delete d; \
- guard.store(QtGlobalStatic::Destroyed); \
+ guard.storeRelaxed(QtGlobalStatic::Destroyed); \
} \
} cleanup; \
guard.storeRelease(QtGlobalStatic::Initialized); \
@@ -129,10 +130,10 @@ struct QGlobalStatic
{
typedef T Type;
- bool isDestroyed() const { return guard.load() <= QtGlobalStatic::Destroyed; }
- bool exists() const { return guard.load() == QtGlobalStatic::Initialized; }
- operator Type *() { if (isDestroyed()) return 0; return innerFunction(); }
- Type *operator()() { if (isDestroyed()) return 0; return innerFunction(); }
+ bool isDestroyed() const { return guard.loadRelaxed() <= QtGlobalStatic::Destroyed; }
+ bool exists() const { return guard.loadRelaxed() == QtGlobalStatic::Initialized; }
+ operator Type *() { if (isDestroyed()) return nullptr; return innerFunction(); }
+ Type *operator()() { if (isDestroyed()) return nullptr; return innerFunction(); }
Type *operator->()
{
Q_ASSERT_X(!isDestroyed(), "Q_GLOBAL_STATIC", "The global static was used after being destroyed");
diff --git a/src/corelib/global/qhooks.cpp b/src/corelib/global/qhooks.cpp
index bbddb1cbf1..79f9b7d6c2 100644
--- a/src/corelib/global/qhooks.cpp
+++ b/src/corelib/global/qhooks.cpp
@@ -67,7 +67,7 @@ quintptr Q_CORE_EXPORT qtHookData[] = {
// The required sizes and offsets are tested in tests/auto/other/toolsupport.
// When this fails and the change was intentional, adjust the test and
// adjust this value here.
- 16
+ 18
};
Q_STATIC_ASSERT(QHooks::LastHookIndex == sizeof(qtHookData) / sizeof(qtHookData[0]));
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index f2ada4ab30..8bcf67e73d 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -55,15 +55,24 @@ QT_END_NAMESPACE
# include "qcoreapplication.h"
#endif
+#ifndef QT_BUILD_QMAKE_BOOTSTRAP
+# include "private/qglobal_p.h"
+# include "qconfig.cpp"
+#endif
+
#ifdef Q_OS_DARWIN
# include "private/qcore_mac_p.h"
-#endif
+#endif // Q_OS_DARWIN
-#ifndef QT_BUILD_QMAKE_BOOTSTRAP
-# include "qconfig.cpp"
+#include "archdetect.cpp"
+
+#if !defined(QT_BUILD_QMAKE) && QT_CONFIG(relocatable) && QT_CONFIG(dlopen) && !QT_CONFIG(framework)
+# include <dlfcn.h>
#endif
-#include "archdetect.cpp"
+#if !defined(QT_BUILD_QMAKE) && QT_CONFIG(relocatable) && defined(Q_OS_WIN)
+# include <qt_windows.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -352,7 +361,7 @@ QLibraryInfo::buildDate()
\since 5.3
*/
-const char *QLibraryInfo::build() Q_DECL_NOTHROW
+const char *QLibraryInfo::build() noexcept
{
return QT_BUILD_STR;
}
@@ -379,7 +388,7 @@ QLibraryInfo::isDebugBuild()
\sa qVersion()
*/
-QVersionNumber QLibraryInfo::version() Q_DECL_NOTHROW
+QVersionNumber QLibraryInfo::version() noexcept
{
return QVersionNumber(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH);
}
@@ -453,6 +462,180 @@ void QLibraryInfo::sysrootify(QString *path)
}
#endif // QT_BUILD_QMAKE
+#ifndef QT_BUILD_QMAKE
+static QString prefixFromAppDirHelper()
+{
+ QString appDir;
+
+ if (QCoreApplication::instance()) {
+#ifdef Q_OS_DARWIN
+ CFBundleRef bundleRef = CFBundleGetMainBundle();
+ if (bundleRef) {
+ QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
+ if (urlRef) {
+ QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
+#ifdef Q_OS_MACOS
+ QString bundleContentsDir = QString(path) + QLatin1String("/Contents/");
+ if (QDir(bundleContentsDir).exists())
+ return QDir::cleanPath(bundleContentsDir);
+#else
+ return QDir::cleanPath(QString(path)); // iOS
+#endif // Q_OS_MACOS
+ }
+ }
+#endif // Q_OS_DARWIN
+ // We make the prefix path absolute to the executable's directory.
+ appDir = QCoreApplication::applicationDirPath();
+ } else {
+ appDir = QDir::currentPath();
+ }
+
+ return appDir;
+}
+#endif
+
+#if !defined(QT_BUILD_QMAKE) && QT_CONFIG(relocatable)
+#if !defined(QT_STATIC) && !(defined(Q_OS_DARWIN) && QT_CONFIG(framework)) \
+ && (QT_CONFIG(dlopen) || defined(Q_OS_WIN))
+static QString prefixFromQtCoreLibraryHelper(const QString &qtCoreLibraryPath)
+{
+ const QString qtCoreLibrary = QDir::fromNativeSeparators(qtCoreLibraryPath);
+ const QString libDir = QFileInfo(qtCoreLibrary).absolutePath();
+ const QString prefixDir = libDir + QLatin1Char('/')
+ + QLatin1String(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH);
+ return QDir::cleanPath(prefixDir);
+}
+#endif
+
+#if defined(Q_OS_WIN)
+#if defined(Q_OS_WINRT)
+EXTERN_C IMAGE_DOS_HEADER __ImageBase;
+static HMODULE getWindowsModuleHandle()
+{
+ return reinterpret_cast<HMODULE>(&__ImageBase);
+}
+#else // Q_OS_WINRT
+static HMODULE getWindowsModuleHandle()
+{
+ HMODULE hModule = NULL;
+ GetModuleHandleEx(
+ GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
+ (LPCTSTR)&QLibraryInfo::isDebugBuild, &hModule);
+ return hModule;
+}
+#endif // !Q_OS_WINRT
+#endif // Q_OS_WIN
+
+static QString getRelocatablePrefix()
+{
+ QString prefixPath;
+
+ // For static builds, the prefix will be the app directory.
+ // For regular builds, the prefix will be relative to the location of the QtCore shared library.
+#if defined(QT_STATIC)
+ prefixPath = prefixFromAppDirHelper();
+#elif defined(Q_OS_DARWIN) && QT_CONFIG(framework)
+ CFBundleRef qtCoreBundle = CFBundleGetBundleWithIdentifier(
+ CFSTR("org.qt-project.QtCore"));
+ Q_ASSERT(qtCoreBundle);
+
+ QCFType<CFURLRef> qtCorePath = CFBundleCopyBundleURL(qtCoreBundle);
+ Q_ASSERT(qtCorePath);
+
+ QCFType<CFURLRef> qtCorePathAbsolute = CFURLCopyAbsoluteURL(qtCorePath);
+ Q_ASSERT(qtCorePathAbsolute);
+
+ QCFType<CFURLRef> libDirCFPath = CFURLCreateCopyDeletingLastPathComponent(NULL, qtCorePathAbsolute);
+
+ const QCFString libDirCFString = CFURLCopyFileSystemPath(libDirCFPath, kCFURLPOSIXPathStyle);
+
+ const QString prefixDir = QString(libDirCFString) + QLatin1Char('/')
+ + QLatin1String(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH);
+
+ prefixPath = QDir::cleanPath(prefixDir);
+#elif QT_CONFIG(dlopen)
+ Dl_info info;
+ int result = dladdr(reinterpret_cast<void *>(&QLibraryInfo::isDebugBuild), &info);
+ if (result > 0 && info.dli_fname)
+ prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLatin1(info.dli_fname));
+#elif defined(Q_OS_WIN)
+ HMODULE hModule = getWindowsModuleHandle();
+ const int kBufferSize = 4096;
+ wchar_t buffer[kBufferSize];
+ const int pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
+ if (pathSize > 0)
+ prefixPath = prefixFromQtCoreLibraryHelper(QString::fromWCharArray(buffer, pathSize));
+#else
+#error "The chosen platform / config does not support querying for a dynamic prefix."
+#endif
+
+#if defined(Q_OS_LINUX) && !defined(QT_STATIC) && defined(__GLIBC__)
+ // QTBUG-78948: libQt5Core.so may be located in subdirectories below libdir.
+ // See "Hardware capabilities" in the ld.so documentation and the Qt 5.3.0
+ // changelog regarding SSE2 support.
+ const QString libdir = QString::fromLatin1(
+ qt_configure_strs + qt_configure_str_offsets[QLibraryInfo::LibrariesPath - 1]);
+ QDir prefixDir(prefixPath);
+ while (!prefixDir.exists(libdir)) {
+ prefixDir.cdUp();
+ prefixPath = prefixDir.absolutePath();
+ if (prefixDir.isRoot()) {
+ prefixPath.clear();
+ break;
+ }
+ }
+#endif
+
+ Q_ASSERT_X(!prefixPath.isEmpty(), "getRelocatablePrefix",
+ "Failed to find the Qt prefix path.");
+ return prefixPath;
+}
+#endif
+
+#if defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_QMAKE_BOOTSTRAP)
+QString qmake_abslocation();
+
+static QString getPrefixFromHostBinDir(const char *hostBinDirToPrefixPath)
+{
+ const QFileInfo qmfi = QFileInfo(qmake_abslocation()).canonicalFilePath();
+ return QDir::cleanPath(qmfi.absolutePath() + QLatin1Char('/')
+ + QLatin1String(hostBinDirToPrefixPath));
+}
+
+static QString getExtPrefixFromHostBinDir()
+{
+ return getPrefixFromHostBinDir(QT_CONFIGURE_HOSTBINDIR_TO_EXTPREFIX_PATH);
+}
+
+static QString getHostPrefixFromHostBinDir()
+{
+ return getPrefixFromHostBinDir(QT_CONFIGURE_HOSTBINDIR_TO_HOSTPREFIX_PATH);
+}
+#endif
+
+#ifndef QT_BUILD_QMAKE_BOOTSTRAP
+static const char *getPrefix(
+#ifdef QT_BUILD_QMAKE
+ QLibraryInfo::PathGroup group
+#endif
+ )
+{
+#if defined(QT_BUILD_QMAKE)
+# if QT_CONFIGURE_CROSSBUILD
+ if (group == QLibraryInfo::DevicePaths)
+ return QT_CONFIGURE_PREFIX_PATH;
+# endif
+ static QByteArray extPrefixPath = getExtPrefixFromHostBinDir().toLatin1();
+ return extPrefixPath.constData();
+#elif QT_CONFIG(relocatable)
+ static QByteArray prefixPath = getRelocatablePrefix().toLatin1();
+ return prefixPath.constData();
+#else
+ return QT_CONFIGURE_PREFIX_PATH;
+#endif
+}
+#endif // QT_BUILD_QMAKE_BOOTSTRAP
+
/*!
Returns the location specified by \a loc.
*/
@@ -564,12 +747,11 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
if (!fromConf) {
const char * volatile path = 0;
if (loc == PrefixPath) {
- path =
-# ifdef QT_BUILD_QMAKE
- (group != DevicePaths) ?
- QT_CONFIGURE_EXT_PREFIX_PATH :
-# endif
- QT_CONFIGURE_PREFIX_PATH;
+ path = getPrefix(
+#ifdef QT_BUILD_QMAKE
+ group
+#endif
+ );
} else if (unsigned(loc) <= sizeof(qt_configure_str_offsets)/sizeof(qt_configure_str_offsets[0])) {
path = qt_configure_strs + qt_configure_str_offsets[loc - 1];
#ifndef Q_OS_WIN // On Windows we use the registry
@@ -578,7 +760,8 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
#endif
# ifdef QT_BUILD_QMAKE
} else if (loc == HostPrefixPath) {
- path = QT_CONFIGURE_HOST_PREFIX_PATH;
+ static const QByteArray hostPrefixPath = getHostPrefixFromHostBinDir().toLatin1();
+ path = hostPrefixPath.constData();
# endif
}
@@ -612,28 +795,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
}
#else
if (loc == PrefixPath) {
- if (QCoreApplication::instance()) {
-#ifdef Q_OS_DARWIN
- CFBundleRef bundleRef = CFBundleGetMainBundle();
- if (bundleRef) {
- QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
- if (urlRef) {
- QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
-#ifdef Q_OS_OSX
- QString bundleContentsDir = QString(path) + QLatin1String("/Contents/");
- if (QDir(bundleContentsDir).exists())
- return QDir::cleanPath(bundleContentsDir + ret);
-#else
- return QDir::cleanPath(QString(path) + QLatin1Char('/') + ret); // iOS
-#endif // Q_OS_OSX
- }
- }
-#endif // Q_OS_DARWIN
- // We make the prefix path absolute to the executable's directory.
- baseDir = QCoreApplication::applicationDirPath();
- } else {
- baseDir = QDir::currentPath();
- }
+ baseDir = prefixFromAppDirHelper();
} else {
// we make any other path absolute to the prefix directory
baseDir = location(PrefixPath);
@@ -732,11 +894,6 @@ void qt_core_boilerplate()
QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();
-#ifdef QT_EVAL
- extern void qt_core_eval_init(QCoreApplicationPrivate::Type);
- qt_core_eval_init(QCoreApplicationPrivate::Tty);
-#endif
-
exit(0);
}
diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h
index 9414af9b7d..ed60b170a5 100644
--- a/src/corelib/global/qlibraryinfo.h
+++ b/src/corelib/global/qlibraryinfo.h
@@ -62,12 +62,12 @@ public:
#endif // QT_DEPRECATED_SINCE(5, 5)
#endif // datestring
- static const char * build() Q_DECL_NOTHROW;
+ static const char * build() noexcept;
static bool isDebugBuild();
#ifndef QT_BOOTSTRAPPED
- static QVersionNumber version() Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION;
#endif
enum LibraryLocation
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 0a2c1961cb..17f2246082 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -44,10 +44,12 @@
#include "qlogging_p.h"
#include "qlist.h"
#include "qbytearray.h"
+#include "qscopeguard.h"
#include "qstring.h"
#include "qvarlengtharray.h"
#include "qdebug.h"
#include "qmutex.h"
+#include <QtCore/private/qlocking_p.h>
#include "qloggingcategory.h"
#ifndef QT_BOOTSTRAPPED
#include "qelapsedtimer.h"
@@ -158,6 +160,9 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid()
#endif // !QT_BOOTSTRAPPED
#include <cstdlib>
+#include <algorithm>
+#include <memory>
+#include <vector>
#include <stdio.h>
@@ -194,7 +199,7 @@ static bool isFatal(QtMsgType msgType)
// it's fatal if the current value is exactly 1,
// otherwise decrement if it's non-zero
- return fatalCriticals.load() && fatalCriticals.fetchAndAddRelaxed(-1) == 1;
+ return fatalCriticals.loadRelaxed() && fatalCriticals.fetchAndAddRelaxed(-1) == 1;
}
if (msgType == QtWarningMsg || msgType == QtCriticalMsg) {
@@ -202,7 +207,7 @@ static bool isFatal(QtMsgType msgType)
// it's fatal if the current value is exactly 1,
// otherwise decrement if it's non-zero
- return fatalWarnings.load() && fatalWarnings.fetchAndAddRelaxed(-1) == 1;
+ return fatalWarnings.loadRelaxed() && fatalWarnings.fetchAndAddRelaxed(-1) == 1;
}
return false;
@@ -347,7 +352,7 @@ using namespace QtPrivate;
*/
#if defined(Q_CC_MSVC) && defined(QT_DEBUG) && defined(_DEBUG) && defined(_CRT_ERROR)
-static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) Q_DECL_NOEXCEPT
+static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const char *s) noexcept
{
size_t len = qstrlen(s);
if (len + 1 > space) {
@@ -439,7 +444,7 @@ void QMessageLogger::debug(const QLoggingCategory &cat, const char *msg, ...) co
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -466,7 +471,7 @@ void QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc,
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -489,7 +494,7 @@ QDebug QMessageLogger::debug() const
{
QDebug dbg = QDebug(QtDebugMsg);
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
return dbg;
}
@@ -506,7 +511,7 @@ QDebug QMessageLogger::debug(const QLoggingCategory &cat) const
dbg.stream->message_output = false;
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
return dbg;
@@ -530,7 +535,7 @@ QDebug QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc) const
\sa QNoDebug, qDebug()
*/
-QNoDebug QMessageLogger::noDebug() const Q_DECL_NOTHROW
+QNoDebug QMessageLogger::noDebug() const noexcept
{
return QNoDebug();
}
@@ -550,7 +555,7 @@ void QMessageLogger::info(const QLoggingCategory &cat, const char *msg, ...) con
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -577,7 +582,7 @@ void QMessageLogger::info(QMessageLogger::CategoryFunction catFunc,
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -601,7 +606,7 @@ QDebug QMessageLogger::info() const
{
QDebug dbg = QDebug(QtInfoMsg);
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
return dbg;
}
@@ -618,7 +623,7 @@ QDebug QMessageLogger::info(const QLoggingCategory &cat) const
dbg.stream->message_output = false;
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
return dbg;
@@ -668,7 +673,7 @@ void QMessageLogger::warning(const QLoggingCategory &cat, const char *msg, ...)
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -695,7 +700,7 @@ void QMessageLogger::warning(QMessageLogger::CategoryFunction catFunc,
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -717,7 +722,7 @@ QDebug QMessageLogger::warning() const
{
QDebug dbg = QDebug(QtWarningMsg);
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
return dbg;
}
@@ -733,7 +738,7 @@ QDebug QMessageLogger::warning(const QLoggingCategory &cat) const
dbg.stream->message_output = false;
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
return dbg;
@@ -784,7 +789,7 @@ void QMessageLogger::critical(const QLoggingCategory &cat, const char *msg, ...)
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -811,7 +816,7 @@ void QMessageLogger::critical(QMessageLogger::CategoryFunction catFunc,
return;
QMessageLogContext ctxt;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
va_list ap;
@@ -833,7 +838,7 @@ QDebug QMessageLogger::critical() const
{
QDebug dbg = QDebug(QtCriticalMsg);
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
return dbg;
}
@@ -850,7 +855,7 @@ QDebug QMessageLogger::critical(const QLoggingCategory &cat) const
dbg.stream->message_output = false;
QMessageLogContext &ctxt = dbg.stream->context;
- ctxt.copy(context);
+ ctxt.copyContextFrom(context);
ctxt.category = cat.categoryName();
return dbg;
@@ -876,7 +881,7 @@ QDebug QMessageLogger::critical(QMessageLogger::CategoryFunction catFunc) const
\sa qFatal()
*/
-void QMessageLogger::fatal(const char *msg, ...) const Q_DECL_NOTHROW
+void QMessageLogger::fatal(const char *msg, ...) const noexcept
{
QString message;
@@ -1076,8 +1081,8 @@ struct QMessagePattern {
void setPattern(const QString &pattern);
// 0 terminated arrays of literal tokens / literal or placeholder tokens
- const char **literals;
- const char **tokens;
+ std::unique_ptr<std::unique_ptr<const char[]>[]> literals;
+ std::unique_ptr<const char*[]> tokens;
QList<QString> timeArgs; // timeFormats in sequence of %{time
#ifndef QT_BOOTSTRAPPED
QElapsedTimer timer;
@@ -1100,9 +1105,6 @@ Q_DECLARE_TYPEINFO(QMessagePattern::BacktraceParams, Q_MOVABLE_TYPE);
QBasicMutex QMessagePattern::mutex;
QMessagePattern::QMessagePattern()
- : literals(0)
- , tokens(0)
- , fromEnvironment(false)
{
#ifndef QT_BOOTSTRAPPED
timer.start();
@@ -1110,6 +1112,7 @@ QMessagePattern::QMessagePattern()
const QString envPattern = QString::fromLocal8Bit(qgetenv("QT_MESSAGE_PATTERN"));
if (envPattern.isEmpty()) {
setPattern(QLatin1String(defaultPattern));
+ fromEnvironment = false;
} else {
setPattern(envPattern);
fromEnvironment = true;
@@ -1117,23 +1120,10 @@ QMessagePattern::QMessagePattern()
}
QMessagePattern::~QMessagePattern()
-{
- for (int i = 0; literals[i]; ++i)
- delete [] literals[i];
- delete [] literals;
- literals = 0;
- delete [] tokens;
- tokens = 0;
-}
+ = default;
void QMessagePattern::setPattern(const QString &pattern)
{
- if (literals) {
- for (int i = 0; literals[i]; ++i)
- delete [] literals[i];
- delete [] literals;
- }
- delete [] tokens;
timeArgs.clear();
#ifdef QLOGGING_HAVE_BACKTRACE
backtraceArgs.clear();
@@ -1171,9 +1161,9 @@ void QMessagePattern::setPattern(const QString &pattern)
lexemes.append(lexeme);
// tokenizer
- QVarLengthArray<const char*> literalsVar;
- tokens = new const char*[lexemes.size() + 1];
- tokens[lexemes.size()] = 0;
+ std::vector<std::unique_ptr<const char[]>> literalsVar;
+ tokens.reset(new const char*[lexemes.size() + 1]);
+ tokens[lexemes.size()] = nullptr;
bool nestedIfError = false;
bool inIf = false;
@@ -1267,7 +1257,7 @@ void QMessagePattern::setPattern(const QString &pattern)
char *literal = new char[lexeme.size() + 1];
strncpy(literal, lexeme.toLatin1().constData(), lexeme.size());
literal[lexeme.size()] = '\0';
- literalsVar.append(literal);
+ literalsVar.emplace_back(literal);
tokens[i] = literal;
}
}
@@ -1279,9 +1269,8 @@ void QMessagePattern::setPattern(const QString &pattern)
if (!error.isEmpty())
qt_message_print(error);
- literals = new const char*[literalsVar.size() + 1];
- literals[literalsVar.size()] = 0;
- memcpy(literals, literalsVar.constData(), literalsVar.size() * sizeof(const char*));
+ literals.reset(new std::unique_ptr<const char[]>[literalsVar.size() + 1]);
+ std::move(literalsVar.begin(), literalsVar.end(), &literals[0]);
}
#if defined(QLOGGING_HAVE_BACKTRACE) && !defined(QT_BOOTSTRAPPED)
@@ -1387,7 +1376,7 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
{
QString message;
- QMutexLocker lock(&QMessagePattern::mutex);
+ const auto locker = qt_scoped_lock(QMessagePattern::mutex);
QMessagePattern *pattern = qMessagePattern();
if (!pattern) {
@@ -1406,7 +1395,7 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
#endif
// we do not convert file, function, line literals to local encoding due to overhead
- for (int i = 0; pattern->tokens[i] != 0; ++i) {
+ for (int i = 0; pattern->tokens[i]; ++i) {
const char *token = pattern->tokens[i];
if (token == endifTokenC) {
skip = false;
@@ -1826,9 +1815,7 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex
// prevent recursion in case the message handler generates messages
// itself, e.g. by using Qt API
if (grabMessageHandler()) {
- struct Ungrabber {
- ~Ungrabber() { ungrabMessageHandler(); }
- } ungrabber;
+ const auto ungrab = qScopeGuard([]{ ungrabMessageHandler(); });
auto oldStyle = msgHandler.loadAcquire();
auto newStye = messageHandler.loadAcquire();
// prefer new message handler over the old one
@@ -2107,7 +2094,7 @@ QtMsgHandler qInstallMsgHandler(QtMsgHandler h)
void qSetMessagePattern(const QString &pattern)
{
- QMutexLocker lock(&QMessagePattern::mutex);
+ const auto locker = qt_scoped_lock(QMessagePattern::mutex);
if (!qMessagePattern()->fromEnvironment)
qMessagePattern()->setPattern(pattern);
@@ -2115,15 +2102,20 @@ void qSetMessagePattern(const QString &pattern)
/*!
- Copies context information from \a logContext into this QMessageLogContext
+ Copies context information from \a logContext into this QMessageLogContext.
+ Returns a reference to this object.
+
+ Note that the version is \b not copied, only the context information.
+
\internal
*/
-void QMessageLogContext::copy(const QMessageLogContext &logContext)
+QMessageLogContext &QMessageLogContext::copyContextFrom(const QMessageLogContext &logContext) noexcept
{
this->category = logContext.category;
this->file = logContext.file;
this->line = logContext.line;
this->function = logContext.function;
+ return *this;
}
/*!
diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h
index dded09999b..4a528a2973 100644
--- a/src/corelib/global/qlogging.h
+++ b/src/corelib/global/qlogging.h
@@ -63,20 +63,19 @@ class QMessageLogContext
{
Q_DISABLE_COPY(QMessageLogContext)
public:
- Q_DECL_CONSTEXPR QMessageLogContext()
- : version(2), line(0), file(nullptr), function(nullptr), category(nullptr) {}
- Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName)
- : version(2), line(lineNumber), file(fileName), function(functionName), category(categoryName) {}
+ Q_DECL_CONSTEXPR QMessageLogContext() noexcept = default;
+ Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) noexcept
+ : line(lineNumber), file(fileName), function(functionName), category(categoryName) {}
- void copy(const QMessageLogContext &logContext);
-
- int version;
- int line;
- const char *file;
- const char *function;
- const char *category;
+ int version = 2;
+ int line = 0;
+ const char *file = nullptr;
+ const char *function = nullptr;
+ const char *category = nullptr;
private:
+ QMessageLogContext &copyContextFrom(const QMessageLogContext &logContext) noexcept;
+
friend class QMessageLogger;
friend class QDebug;
};
@@ -121,7 +120,7 @@ public:
Q_NORETURN
#endif
Q_DECL_COLD_FUNCTION
- void fatal(const char *msg, ...) const Q_DECL_NOTHROW Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
+ void fatal(const char *msg, ...) const noexcept Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
#ifndef QT_NO_DEBUG_STREAM
QDebug debug() const;
@@ -137,7 +136,7 @@ public:
QDebug critical(const QLoggingCategory &cat) const;
QDebug critical(CategoryFunction catFunc) const;
- QNoDebug noDebug() const Q_DECL_NOTHROW;
+ QNoDebug noDebug() const noexcept;
#endif // QT_NO_DEBUG_STREAM
private:
diff --git a/src/corelib/global/qmalloc.cpp b/src/corelib/global/qmalloc.cpp
index 05676a0da2..b071c1df62 100644
--- a/src/corelib/global/qmalloc.cpp
+++ b/src/corelib/global/qmalloc.cpp
@@ -74,18 +74,18 @@ void *qRealloc(void *ptr, size_t size)
void *qMallocAligned(size_t size, size_t alignment)
{
- return qReallocAligned(0, size, 0, alignment);
+ return qReallocAligned(nullptr, size, 0, alignment);
}
void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t alignment)
{
// fake an aligned allocation
- void *actualptr = oldptr ? static_cast<void **>(oldptr)[-1] : 0;
+ void *actualptr = oldptr ? static_cast<void **>(oldptr)[-1] : nullptr;
if (alignment <= sizeof(void*)) {
// special, fast case
void **newptr = static_cast<void **>(realloc(actualptr, newsize + sizeof(void*)));
if (!newptr)
- return 0;
+ return nullptr;
if (newptr == actualptr) {
// realloc succeeded without reallocating
return oldptr;
@@ -105,7 +105,7 @@ void *qReallocAligned(void *oldptr, size_t newsize, size_t oldsize, size_t align
void *real = realloc(actualptr, newsize + alignment);
if (!real)
- return 0;
+ return nullptr;
quintptr faked = reinterpret_cast<quintptr>(real) + alignment;
faked &= ~(alignment - 1);
diff --git a/src/corelib/global/qfloat16_p.h b/src/corelib/global/qmemory_p.h
index f3fc96e119..ac791385bd 100644
--- a/src/corelib/global/qfloat16_p.h
+++ b/src/corelib/global/qmemory_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 by Southwest Research Institute (R)
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
@@ -36,9 +36,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-
-#ifndef QFLOAT16_P_H
-#define QFLOAT16_P_H
+#ifndef QMEMORY_P_H
+#define QMEMORY_P_H
//
// W A R N I N G
@@ -51,45 +50,22 @@
// We mean it.
//
-#include <QtCore/qfloat16.h>
-#include <QtCore/qsysinfo.h>
-
-QT_BEGIN_NAMESPACE
+#include <QtCore/qglobal.h>
-static inline bool qt_is_inf(qfloat16 d) Q_DECL_NOTHROW
-{
- bool is_inf;
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- is_inf = (ch[0] & 0x7c) == 0x7c && (ch[0] & 0x02) == 0;
- else
- is_inf = (ch[1] & 0x7c) == 0x7c && (ch[1] & 0x02) == 0;
- return is_inf;
-}
+#include <memory>
+#include <type_traits>
+#include <utility>
-static inline bool qt_is_nan(qfloat16 d) Q_DECL_NOTHROW
-{
- bool is_nan;
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- is_nan = (ch[0] & 0x7c) == 0x7c && (ch[0] & 0x02) != 0;
- else
- is_nan = (ch[1] & 0x7c) == 0x7c && (ch[1] & 0x02) != 0;
- return is_nan;
-}
+QT_BEGIN_NAMESPACE
-static inline bool qt_is_finite(qfloat16 d) Q_DECL_NOTHROW
+// Like std::make_unique, but less ambitious, so keep as private API, for use in Qt itself:
+template <typename T, typename... Args>
+typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
+qt_make_unique(Args &&...args)
{
- bool is_finite;
- uchar *ch = (uchar *)&d;
- if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
- is_finite = (ch[0] & 0x7c) != 0x7c;
- else
- is_finite = (ch[1] & 0x7c) != 0x7c;
- return is_finite;
+ return std::unique_ptr<T>{new T(std::forward<Args>(args)...)};
}
-
QT_END_NAMESPACE
-#endif // QFLOAT16_P_H
+#endif /* QMEMORY_P_H */
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 6488426e64..810c55709c 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -50,10 +50,10 @@ QT_BEGIN_NAMESPACE
#if !defined(Q_QDOC) && !defined(Q_MOC_RUN)
struct QMetaObject;
-const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT; // defined in qobject.h (which can't be included here)
+const QMetaObject *qt_getQtMetaObject() noexcept; // defined in qobject.h (which can't be included here)
#define QT_Q_ENUM(ENUM) \
- inline const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return qt_getQtMetaObject(); } \
- inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+ inline const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return qt_getQtMetaObject(); } \
+ inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
#define QT_Q_FLAG(ENUM) QT_Q_ENUM(ENUM)
#else
#define QT_Q_ENUM Q_ENUM
@@ -194,6 +194,13 @@ public:
DescendingOrder
};
+ enum SplitBehaviorFlags {
+ KeepEmptyParts = 0,
+ SkipEmptyParts = 0x1,
+ };
+ Q_DECLARE_FLAGS(SplitBehavior, SplitBehaviorFlags)
+ Q_DECLARE_OPERATORS_FOR_FLAGS(SplitBehavior)
+
enum TileRule {
StretchTile,
RepeatTile,
@@ -351,14 +358,18 @@ public:
WA_MouseTracking = 2,
WA_ContentsPropagated = 3, // ## deprecated
WA_OpaquePaintEvent = 4,
- WA_NoBackground = WA_OpaquePaintEvent, // ## deprecated
+#if QT_DEPRECATED_SINCE(5, 14)
+ WA_NoBackground Q_DECL_ENUMERATOR_DEPRECATED = WA_OpaquePaintEvent,
+#endif
WA_StaticContents = 5,
WA_LaidOut = 7,
WA_PaintOnScreen = 8,
WA_NoSystemBackground = 9,
WA_UpdatesDisabled = 10,
WA_Mapped = 11,
- WA_MacNoClickThrough = 12, // Mac only
+#if QT_DEPRECATED_SINCE(5, 14)
+ WA_MacNoClickThrough Q_DECL_ENUMERATOR_DEPRECATED = 12,
+#endif
WA_InputMethodEnabled = 14,
WA_WState_Visible = 15,
WA_WState_Hidden = 16,
@@ -376,8 +387,10 @@ public:
WA_Moved = 43,
WA_PendingUpdate = 44,
WA_InvalidSize = 45,
- WA_MacBrushedMetal = 46, // Mac only
- WA_MacMetalStyle = WA_MacBrushedMetal, // obsolete
+#if QT_DEPRECATED_SINCE(5, 14)
+ WA_MacBrushedMetal Q_DECL_ENUMERATOR_DEPRECATED = 46,
+ WA_MacMetalStyle Q_DECL_ENUMERATOR_DEPRECATED = 46,
+#endif
WA_CustomWhatsThis = 47,
WA_LayoutOnEntireRect = 48,
WA_OutsideWSRange = 49,
@@ -434,7 +447,9 @@ public:
WA_LayoutUsesWidgetRect = 92,
WA_StyledBackground = 93, // internal
- WA_MSWindowsUseDirect3D = 94, // Win only
+#if QT_DEPRECATED_SINCE(5, 14)
+ WA_MSWindowsUseDirect3D Q_DECL_ENUMERATOR_DEPRECATED = 94,
+#endif
WA_CanHostQMdiSubWindowTitleBar = 95, // Internal
WA_MacAlwaysShowToolWindow = 96, // Mac only
@@ -466,9 +481,9 @@ public:
WA_X11NetWmWindowTypeNotification = 114,
WA_X11NetWmWindowTypeCombo = 115,
WA_X11NetWmWindowTypeDND = 116,
-
- WA_MacFrameworkScaled = 117,
-
+#if QT_DEPRECATED_SINCE(5, 14)
+ WA_MacFrameworkScaled Q_DECL_ENUMERATOR_DEPRECATED = 117,
+#endif
WA_SetWindowModality = 118,
WA_WState_WindowOpacitySet = 119, // internal
WA_TranslucentBackground = 120,
@@ -495,7 +510,9 @@ public:
enum ApplicationAttribute
{
AA_ImmediateWidgetCreation = 0,
- AA_MSWindowsUseDirect3DByDefault = 1, // Win only
+#if QT_DEPRECATED_SINCE(5, 14)
+ AA_MSWindowsUseDirect3DByDefault Q_DECL_ENUMERATOR_DEPRECATED = 1,
+#endif
AA_DontShowIconsInMenus = 2,
AA_NativeWindows = 3,
AA_DontCreateNativeWidgetSiblings = 4,
@@ -506,7 +523,9 @@ public:
AA_DontUseNativeMenuBar = 6,
AA_MacDontSwapCtrlAndMeta = 7,
AA_Use96Dpi = 8,
- AA_X11InitThreads = 10,
+#if QT_DEPRECATED_SINCE(5, 14)
+ AA_X11InitThreads Q_DECL_ENUMERATOR_DEPRECATED = 10,
+#endif
AA_SynthesizeTouchForUnhandledMouseEvents = 11,
AA_SynthesizeMouseForUnhandledTouchEvents = 12,
AA_UseHighDpiPixmaps = 13,
@@ -527,6 +546,7 @@ public:
AA_DontShowShortcutsInContextMenus = 28,
AA_CompressTabletEvents = 29,
AA_DisableWindowContextHelpButton = 30, // ### Qt 6: remove me
+ AA_DisableSessionManager = 31,
// Add new attributes before this line
AA_AttributeCount
@@ -1198,7 +1218,8 @@ public:
enum TextFormat {
PlainText,
RichText,
- AutoText
+ AutoText,
+ MarkdownText
};
enum AspectRatioMode {
@@ -1379,7 +1400,9 @@ public:
enum InputMethodQuery {
ImEnabled = 0x1,
ImCursorRectangle = 0x2,
- ImMicroFocus = 0x2, // deprecated
+#if QT_DEPRECATED_SINCE(5, 14)
+ ImMicroFocus Q_DECL_ENUMERATOR_DEPRECATED = 0x2,
+#endif
ImFont = 0x4,
ImCursorPosition = 0x8,
ImSurroundingText = 0x10,
@@ -1614,7 +1637,7 @@ public:
TitleBarArea // For move
};
-#if defined(Q_COMPILER_CLASS_ENUM) && defined(Q_COMPILER_CONSTEXPR)
+#if defined(Q_COMPILER_CONSTEXPR)
enum class Initialization {
Uninitialized
};
@@ -1731,6 +1754,15 @@ public:
ChecksumItuV41
};
+ enum class HighDpiScaleFactorRoundingPolicy {
+ Unset,
+ Round,
+ Ceil,
+ Floor,
+ RoundPreferFloor,
+ PassThrough
+ };
+
#ifndef Q_QDOC
// NOTE: Generally, do not add QT_Q_ENUM if a corresponding Q_Q_FLAG exists.
QT_Q_ENUM(ScrollBarPolicy)
@@ -1757,6 +1789,7 @@ public:
QT_Q_FLAG(Alignment)
QT_Q_ENUM(TextFlag)
QT_Q_FLAG(Orientations)
+ QT_Q_FLAG(SplitBehavior)
QT_Q_FLAG(DropActions)
QT_Q_FLAG(Edges)
QT_Q_FLAG(DockWidgetAreas)
@@ -1816,6 +1849,7 @@ public:
QT_Q_ENUM(MouseEventSource)
QT_Q_FLAG(MouseEventFlag)
QT_Q_ENUM(ChecksumType)
+ QT_Q_ENUM(HighDpiScaleFactorRoundingPolicy)
QT_Q_ENUM(TabFocusBehavior)
#endif // Q_DOC
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 5bba8c5fe5..cce88782e9 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -286,6 +286,13 @@
This value was added in Qt 5.10. In Qt 6, WindowContextHelpButtonHint
will not be set by default.
+ \value AA_DisableSessionManager Disables the QSessionManager.
+ By default Qt will connect to a running session manager for a GUI
+ application on supported platforms, use of a session manager may be
+ redundant for system services.
+ This attribute must be set before QGuiApplication is constructed.
+ This value was added in 5.13
+
The following values are deprecated or obsolete:
\value AA_ImmediateWidgetCreation This attribute is no longer fully
@@ -2362,6 +2369,19 @@
*/
/*!
+ \enum Qt::SplitBehaviorFlags
+ \since 5.14
+
+ This enum specifies how the split() functions should behave with
+ respect to empty strings.
+
+ \value KeepEmptyParts If a field is empty, keep it in the result.
+ \value SkipEmptyParts If a field is empty, don't include it in the result.
+
+ \sa QString::split()
+*/
+
+/*!
\enum Qt::ClipOperation
\value NoClip This operation turns clipping off.
@@ -2464,6 +2484,9 @@
\value AutoText The text string is interpreted as for
Qt::RichText if Qt::mightBeRichText() returns \c true, otherwise
as Qt::PlainText.
+
+ \value MarkdownText The text string is interpreted as Markdown-formatted text.
+ This enum value was added in Qt 5.14.
*/
/*!
@@ -3252,3 +3275,25 @@
\value ChecksumItuV41 Checksum calculation based on ITU-V.41.
*/
+
+/*!
+ \enum Qt::HighDpiScaleFactorRoundingPolicy
+ \since 5.14
+
+ This enum describes the possible High-DPI scale factor rounding policies, which
+ decide how non-integer scale factors (such as Windows 150%) are handled.
+
+ The active policy is set by calling QGuiApplication::setHighDdpiScaleFactorRoundingPolicy() before
+ the application object is created, or by setting the QT_SCALE_FACTOR_ROUNDING_POLICY
+ environment variable.
+
+ \sa QGuiApplication::setHighDpiScaleFactorRoundingPolicy()
+ \sa AA_EnableHighDpiScaling.
+
+ \omitvalue Unset
+ \value Round Round up for .5 and above.
+ \value Ceil Always round up.
+ \value Floor Always round down.
+ \value RoundPreferFloor Round up for .75 and above.
+ \value PassThrough Don't round.
+*/
diff --git a/src/corelib/global/qnumeric.cpp b/src/corelib/global/qnumeric.cpp
index fc2b052edf..9cb9c1283a 100644
--- a/src/corelib/global/qnumeric.cpp
+++ b/src/corelib/global/qnumeric.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -46,6 +46,7 @@ QT_BEGIN_NAMESPACE
/*!
Returns \c true if the double \a {d} is equivalent to infinity.
\relates <QtGlobal>
+ \sa qInf()
*/
Q_CORE_EXPORT bool qIsInf(double d) { return qt_is_inf(d); }
@@ -64,6 +65,7 @@ Q_CORE_EXPORT bool qIsFinite(double d) { return qt_is_finite(d); }
/*!
Returns \c true if the float \a {f} is equivalent to infinity.
\relates <QtGlobal>
+ \sa qInf()
*/
Q_CORE_EXPORT bool qIsInf(float f) { return qt_is_inf(f); }
@@ -79,24 +81,48 @@ Q_CORE_EXPORT bool qIsNaN(float f) { return qt_is_nan(f); }
*/
Q_CORE_EXPORT bool qIsFinite(float f) { return qt_is_finite(f); }
+#if QT_CONFIG(signaling_nan)
/*!
Returns the bit pattern of a signalling NaN as a double.
\relates <QtGlobal>
*/
Q_CORE_EXPORT double qSNaN() { return qt_snan(); }
+#endif
/*!
Returns the bit pattern of a quiet NaN as a double.
\relates <QtGlobal>
+ \sa qIsNaN()
*/
Q_CORE_EXPORT double qQNaN() { return qt_qnan(); }
/*!
Returns the bit pattern for an infinite number as a double.
\relates <QtGlobal>
+ \sa qIsInf()
*/
Q_CORE_EXPORT double qInf() { return qt_inf(); }
+/*!
+ \relates <QtGlobal>
+ Classifies a floating-point value.
+
+ The return values are defined in \c{<cmath>}: returns one of the following,
+ determined by the floating-point class of \a val:
+ \list
+ \li FP_NAN not a number
+ \li FP_INFINITE infinities (positive or negative)
+ \li FP_ZERO zero (positive or negative)
+ \li FP_NORMAL finite with a full mantissa
+ \li FP_SUBNORMAL finite with a reduced mantissa
+ \endlist
+*/
+Q_CORE_EXPORT int qFpClassify(double val) { return qt_fpclassify(val); }
+
+/*!
+ \overload
+*/
+Q_CORE_EXPORT int qFpClassify(float val) { return qt_fpclassify(val); }
/*!
diff --git a/src/corelib/global/qnumeric.h b/src/corelib/global/qnumeric.h
index 535a96aaec..2771eea64f 100644
--- a/src/corelib/global/qnumeric.h
+++ b/src/corelib/global/qnumeric.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -44,14 +44,17 @@
QT_BEGIN_NAMESPACE
-
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsInf(double d);
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsNaN(double d);
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsFinite(double d);
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int qFpClassify(double val);
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsInf(float f);
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsNaN(float f);
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION bool qIsFinite(float f);
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION int qFpClassify(float val);
+#if QT_CONFIG(signaling_nan)
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qSNaN();
+#endif
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qQNaN();
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION double qInf();
@@ -59,7 +62,9 @@ Q_CORE_EXPORT quint32 qFloatDistance(float a, float b);
Q_CORE_EXPORT quint64 qFloatDistance(double a, double b);
#define Q_INFINITY (QT_PREPEND_NAMESPACE(qInf)())
-#define Q_SNAN (QT_PREPEND_NAMESPACE(qSNaN)())
+#if QT_CONFIG(signaling_nan)
+# define Q_SNAN (QT_PREPEND_NAMESPACE(qSNaN)())
+#endif
#define Q_QNAN (QT_PREPEND_NAMESPACE(qQNaN)())
QT_END_NAMESPACE
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 4a225b2599..86e7997680 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -85,9 +85,11 @@ namespace qnumeric_std_wrapper {
Q_DECL_CONST_FUNCTION static inline bool math_h_isnan(double d) { using namespace std; return isnan(d); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isinf(double d) { using namespace std; return isinf(d); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isfinite(double d) { using namespace std; return isfinite(d); }
+Q_DECL_CONST_FUNCTION static inline int math_h_fpclassify(double d) { using namespace std; return fpclassify(d); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isnan(float f) { using namespace std; return isnan(f); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isinf(float f) { using namespace std; return isinf(f); }
Q_DECL_CONST_FUNCTION static inline bool math_h_isfinite(float f) { using namespace std; return isfinite(f); }
+Q_DECL_CONST_FUNCTION static inline int math_h_fpclassify(float f) { using namespace std; return fpclassify(f); }
}
QT_END_NAMESPACE
// These macros from math.h conflict with the real functions in the std namespace.
@@ -95,6 +97,7 @@ QT_END_NAMESPACE
# undef isnan
# undef isinf
# undef isfinite
+# undef fpclassify
# endif // defined(isnan)
#endif
@@ -106,36 +109,41 @@ namespace qnumeric_std_wrapper {
Q_DECL_CONST_FUNCTION static inline bool isnan(double d) { return math_h_isnan(d); }
Q_DECL_CONST_FUNCTION static inline bool isinf(double d) { return math_h_isinf(d); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(double d) { return math_h_isfinite(d); }
+Q_DECL_CONST_FUNCTION static inline int fpclassify(double d) { return math_h_fpclassify(d); }
Q_DECL_CONST_FUNCTION static inline bool isnan(float f) { return math_h_isnan(f); }
Q_DECL_CONST_FUNCTION static inline bool isinf(float f) { return math_h_isinf(f); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(float f) { return math_h_isfinite(f); }
+Q_DECL_CONST_FUNCTION static inline int fpclassify(float f) { return math_h_fpclassify(f); }
#else
Q_DECL_CONST_FUNCTION static inline bool isnan(double d) { return std::isnan(d); }
Q_DECL_CONST_FUNCTION static inline bool isinf(double d) { return std::isinf(d); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(double d) { return std::isfinite(d); }
+Q_DECL_CONST_FUNCTION static inline int fpclassify(double d) { return std::fpclassify(d); }
Q_DECL_CONST_FUNCTION static inline bool isnan(float f) { return std::isnan(f); }
Q_DECL_CONST_FUNCTION static inline bool isinf(float f) { return std::isinf(f); }
Q_DECL_CONST_FUNCTION static inline bool isfinite(float f) { return std::isfinite(f); }
+Q_DECL_CONST_FUNCTION static inline int fpclassify(float f) { return std::fpclassify(f); }
#endif
}
-Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_inf() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_inf() noexcept
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_infinity,
"platform has no definition for infinity for type double");
return std::numeric_limits<double>::infinity();
}
-// Signaling NaN
-Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_snan() Q_DECL_NOEXCEPT
+#if QT_CONFIG(signaling_nan)
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_snan() noexcept
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_signaling_NaN,
"platform has no definition for signaling NaN for type double");
return std::numeric_limits<double>::signaling_NaN();
}
+#endif
// Quiet NaN
-Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_qnan() Q_DECL_NOEXCEPT
+Q_DECL_CONSTEXPR Q_DECL_CONST_FUNCTION static inline double qt_qnan() noexcept
{
Q_STATIC_ASSERT_X(std::numeric_limits<double>::has_quiet_NaN,
"platform has no definition for quiet NaN for type double");
@@ -157,6 +165,11 @@ Q_DECL_CONST_FUNCTION static inline bool qt_is_finite(double d)
return qnumeric_std_wrapper::isfinite(d);
}
+Q_DECL_CONST_FUNCTION static inline int qt_fpclassify(double d)
+{
+ return qnumeric_std_wrapper::fpclassify(d);
+}
+
Q_DECL_CONST_FUNCTION static inline bool qt_is_inf(float f)
{
return qnumeric_std_wrapper::isinf(f);
@@ -172,6 +185,11 @@ Q_DECL_CONST_FUNCTION static inline bool qt_is_finite(float f)
return qnumeric_std_wrapper::isfinite(f);
}
+Q_DECL_CONST_FUNCTION static inline int qt_fpclassify(float f)
+{
+ return qnumeric_std_wrapper::fpclassify(f);
+}
+
#ifndef Q_CLANG_QDOC
namespace {
/*!
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index bc6adb54dc..33793ca168 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -340,7 +340,6 @@ QString QOperatingSystemVersion::name() const
}
}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
/*!
\fn bool QOperatingSystemVersion::isAnyOfType(std::initializer_list<OSType> types) const
@@ -355,7 +354,6 @@ bool QOperatingSystemVersion::isAnyOfType(std::initializer_list<OSType> types) c
}
return false;
}
-#endif
/*!
\variable QOperatingSystemVersion::Windows7
diff --git a/src/corelib/global/qoperatingsystemversion.h b/src/corelib/global/qoperatingsystemversion.h
index 89c60c4960..f22878de89 100644
--- a/src/corelib/global/qoperatingsystemversion.h
+++ b/src/corelib/global/qoperatingsystemversion.h
@@ -120,9 +120,7 @@ public:
Q_DECL_CONSTEXPR int segmentCount() const
{ return m_micro >= 0 ? 3 : m_minor >= 0 ? 2 : m_major >= 0 ? 1 : 0; }
-#ifdef Q_COMPILER_INITIALIZER_LISTS
bool isAnyOfType(std::initializer_list<OSType> types) const;
-#endif
Q_DECL_CONSTEXPR OSType type() const { return m_os; }
QString name() const;
diff --git a/src/corelib/global/qoperatingsystemversion_win.cpp b/src/corelib/global/qoperatingsystemversion_win.cpp
index 2da190da48..798d985a76 100644
--- a/src/corelib/global/qoperatingsystemversion_win.cpp
+++ b/src/corelib/global/qoperatingsystemversion_win.cpp
@@ -84,7 +84,6 @@ static inline OSVERSIONINFOEX determineWinOsVersion()
#define pGetModuleHandle GetModuleHandleW
#endif
-#ifndef Q_OS_WINCE
HMODULE ntdll = pGetModuleHandle(L"ntdll.dll");
if (Q_UNLIKELY(!ntdll))
return result;
@@ -104,9 +103,6 @@ static inline OSVERSIONINFOEX determineWinOsVersion()
// GetVersionEx() has been deprecated in Windows 8.1 and will return
// only Windows 8 from that version on, so use the kernel API function.
pRtlGetVersion(reinterpret_cast<LPOSVERSIONINFO>(&result)); // always returns STATUS_SUCCESS
-#else // !Q_OS_WINCE
- GetVersionEx(&result);
-#endif
return result;
}
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index 1f327c352e..8d65720850 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -282,6 +282,20 @@
// Q_BYTE_ORDER not defined, use endianness auto-detection
/*
+ RISC-V family, known variants: 32- and 64-bit
+
+ RISC-V is little-endian.
+*/
+#elif defined(__riscv)
+# define Q_PROCESSOR_RISCV
+# if __riscv_xlen == 64
+# define Q_PROCESSOR_RISCV_64
+# else
+# define Q_PROCESSOR_RISCV_32
+# endif
+# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+
+/*
S390 family, known variant: S390X (64-bit)
S390 is big-endian.
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index b150a29b88..3cbd40b772 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -98,7 +98,7 @@ enum {
struct QRandomGenerator::SystemGenerator
{
#if QT_CONFIG(getentropy)
- static qsizetype fillBuffer(void *buffer, qsizetype count) Q_DECL_NOTHROW
+ static qsizetype fillBuffer(void *buffer, qsizetype count) noexcept
{
// getentropy can read at most 256 bytes, so break the reading
qsizetype read = 0;
@@ -150,7 +150,7 @@ struct QRandomGenerator::SystemGenerator
#endif
static void closeDevice()
{
- int fd = self().fdp1.load() - 1;
+ int fd = self().fdp1.loadRelaxed() - 1;
if (fd >= 0)
qt_safe_close(fd);
}
@@ -168,13 +168,13 @@ struct QRandomGenerator::SystemGenerator
}
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- qsizetype fillBuffer(void *buffer, qsizetype count) Q_DECL_NOTHROW
+ qsizetype fillBuffer(void *buffer, qsizetype count) noexcept
{
auto RtlGenRandom = SystemFunction036;
return RtlGenRandom(buffer, ULONG(count)) ? count: 0;
}
#elif defined(Q_OS_WINRT)
- qsizetype fillBuffer(void *, qsizetype) Q_DECL_NOTHROW
+ qsizetype fillBuffer(void *, qsizetype) noexcept
{
// always use the fallback
return 0;
@@ -183,7 +183,7 @@ struct QRandomGenerator::SystemGenerator
static SystemGenerator &self();
typedef quint32 result_type;
- void generate(quint32 *begin, quint32 *end) Q_DECL_NOEXCEPT_EXPR(FillBufferNoexcept);
+ void generate(quint32 *begin, quint32 *end) noexcept(FillBufferNoexcept);
// For std::mersenne_twister_engine implementations that use something
// other than quint32 (unsigned int) to fill their buffers.
@@ -206,7 +206,7 @@ struct QRandomGenerator::SystemGenerator
#if defined(Q_OS_WIN)
static void fallback_update_seed(unsigned) {}
-static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
{
// on Windows, rand_s is a high-quality random number generator
// and it requires no seeding
@@ -218,14 +218,14 @@ static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
}
#elif QT_CONFIG(getentropy)
static void fallback_update_seed(unsigned) {}
-static void fallback_fill(quint32 *, qsizetype) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *, qsizetype) noexcept
{
// no fallback necessary, getentropy cannot fail under normal circumstances
Q_UNREACHABLE();
}
#elif defined(Q_OS_BSD4) && !defined(__GLIBC__)
static void fallback_update_seed(unsigned) {}
-static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
{
// BSDs have arc4random(4) and these work even in chroot(2)
arc4random_buf(ptr, left * sizeof(*ptr));
@@ -244,7 +244,7 @@ Q_NEVER_INLINE
#ifdef Q_CC_GNU
__attribute__((cold)) // this function is pretty big, so optimize for size
#endif
-static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
+static void fallback_fill(quint32 *ptr, qsizetype left) noexcept
{
quint32 scratch[12]; // see element count below
quint32 *end = scratch;
@@ -274,7 +274,7 @@ static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
*end++ = quint32(nsecs); // 5
#endif
- if (quint32 v = seed.load())
+ if (quint32 v = seed.loadRelaxed())
*end++ = v; // 6
#if QT_CONFIG(getauxval)
@@ -318,22 +318,22 @@ static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
#endif
Q_NEVER_INLINE void QRandomGenerator::SystemGenerator::generate(quint32 *begin, quint32 *end)
- Q_DECL_NOEXCEPT_EXPR(FillBufferNoexcept)
+ noexcept(FillBufferNoexcept)
{
quint32 *buffer = begin;
qsizetype count = end - begin;
- if (Q_UNLIKELY(uint(qt_randomdevice_control) & SetRandomData)) {
- uint value = uint(qt_randomdevice_control) & RandomDataMask;
+ if (Q_UNLIKELY(uint(qt_randomdevice_control.loadAcquire()) & SetRandomData)) {
+ uint value = uint(qt_randomdevice_control.loadAcquire()) & RandomDataMask;
std::fill_n(buffer, count, value);
return;
}
qsizetype filled = 0;
- if (qHasHwrng() && (uint(qt_randomdevice_control) & SkipHWRNG) == 0)
+ if (qHasHwrng() && (uint(qt_randomdevice_control.loadAcquire()) & SkipHWRNG) == 0)
filled += qRandomCpu(buffer, count);
- if (filled != count && (uint(qt_randomdevice_control) & SkipSystemRNG) == 0) {
+ if (filled != count && (uint(qt_randomdevice_control.loadAcquire()) & SkipSystemRNG) == 0) {
qsizetype bytesFilled =
fillBuffer(buffer + filled, (count - filled) * qsizetype(sizeof(*buffer)));
filled += bytesFilled / qsizetype(sizeof(*buffer));
@@ -1139,7 +1139,7 @@ QRandomGenerator &QRandomGenerator::operator=(const QRandomGenerator &other)
return *this;
}
-QRandomGenerator::QRandomGenerator(std::seed_seq &sseq) Q_DECL_NOTHROW
+QRandomGenerator::QRandomGenerator(std::seed_seq &sseq) noexcept
: type(MersenneTwister)
{
Q_ASSERT(this != system());
@@ -1194,7 +1194,7 @@ void QRandomGenerator::_fillRange(void *buffer, void *bufferEnd)
quint32 *begin = static_cast<quint32 *>(buffer);
quint32 *end = static_cast<quint32 *>(bufferEnd);
- if (type == SystemRNG || Q_UNLIKELY(uint(qt_randomdevice_control) & (UseSystemRNG|SetRandomData)))
+ if (type == SystemRNG || Q_UNLIKELY(uint(qt_randomdevice_control.loadAcquire()) & (UseSystemRNG|SetRandomData)))
return SystemGenerator::self().generate(begin, end);
SystemAndGlobalGenerators::PRNGLocker lock(this);
diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h
index 260fc1501a..445b520c76 100644
--- a/src/corelib/global/qrandom.h
+++ b/src/corelib/global/qrandom.h
@@ -68,7 +68,7 @@ public:
QRandomGenerator(const quint32 *seedBuffer, qsizetype len)
: QRandomGenerator(seedBuffer, seedBuffer + len)
{}
- Q_CORE_EXPORT QRandomGenerator(std::seed_seq &sseq) Q_DECL_NOTHROW;
+ Q_CORE_EXPORT QRandomGenerator(std::seed_seq &sseq) noexcept;
Q_CORE_EXPORT QRandomGenerator(const quint32 *begin, const quint32 *end);
// copy constructor & assignment operator (move unnecessary)
@@ -167,7 +167,7 @@ public:
typedef quint32 result_type;
result_type operator()() { return generate(); }
void seed(quint32 s = 1) { *this = { s }; }
- void seed(std::seed_seq &sseq) Q_DECL_NOTHROW { *this = { sseq }; }
+ void seed(std::seed_seq &sseq) noexcept { *this = { sseq }; }
Q_CORE_EXPORT void discard(unsigned long long z);
static Q_DECL_CONSTEXPR result_type min() { return std::numeric_limits<result_type>::min(); }
static Q_DECL_CONSTEXPR result_type max() { return std::numeric_limits<result_type>::max(); }
@@ -230,7 +230,7 @@ public:
QRandomGenerator64(const quint32 *seedBuffer, qsizetype len)
: QRandomGenerator(seedBuffer, len)
{}
- QRandomGenerator64(std::seed_seq &sseq) Q_DECL_NOTHROW
+ QRandomGenerator64(std::seed_seq &sseq) noexcept
: QRandomGenerator(sseq)
{}
QRandomGenerator64(const quint32 *begin, const quint32 *end)
diff --git a/src/corelib/global/qrandom_p.h b/src/corelib/global/qrandom_p.h
index 4a0adff51c..934a9282b8 100644
--- a/src/corelib/global/qrandom_p.h
+++ b/src/corelib/global/qrandom_p.h
@@ -76,7 +76,9 @@ Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control = Q_BASIC_ATOMIC
#elif defined(QT_BUILD_INTERNAL)
extern Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control;
#else
-enum { qt_randomdevice_control = 0 };
+static const struct {
+ uint loadAcquire() const { return 0; }
+} qt_randomdevice_control;
#endif
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 3e38e6790b..a020788b11 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -166,6 +167,8 @@
# define Q_OS_QNX
#elif defined(__INTEGRITY)
# define Q_OS_INTEGRITY
+#elif defined(__rtems__)
+# define Q_OS_RTEMS
#elif defined(VXWORKS) /* there is no "real" VxWorks define - this has to be set in the mkspec! */
# define Q_OS_VXWORKS
#elif defined(__HAIKU__)
@@ -178,6 +181,12 @@
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64) || defined(Q_OS_WINRT)
# define Q_OS_WINDOWS
# define Q_OS_WIN
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+// On Windows, pointers to dllimport'ed variables are not constant expressions,
+// so to keep to certain initializations (like QMetaObject) constexpr, we need
+// to use functions instead.
+# define QT_NO_DATA_RELOCATION
+# endif
#endif
#if defined(Q_OS_WIN)
diff --git a/src/corelib/global/qtrace_p.h b/src/corelib/global/qtrace_p.h
index 4cef126bb6..d9011c6066 100644
--- a/src/corelib/global/qtrace_p.h
+++ b/src/corelib/global/qtrace_p.h
@@ -122,6 +122,7 @@
QT_BEGIN_NAMESPACE
#if defined(Q_TRACEPOINT) && !defined(QT_BOOTSTRAPPED)
+# define Q_HAS_TRACEPOINTS 1
# define Q_TRACE(x, ...) QtPrivate::trace_ ## x(__VA_ARGS__)
# define Q_TRACE_EXIT(x, ...) \
const auto qTraceExit_ ## x ## __COUNTER__ = qScopeGuard([&]() { Q_TRACE(x, __VA_ARGS__); });
@@ -131,6 +132,7 @@ QT_BEGIN_NAMESPACE
# define Q_UNCONDITIONAL_TRACE(x, ...) QtPrivate::do_trace_ ## x(__VA_ARGS__)
# define Q_TRACE_ENABLED(x) QtPrivate::trace_ ## x ## _enabled()
#else
+# define Q_HAS_TRACEPOINTS 0
# define Q_TRACE(x, ...)
# define Q_TRACE_EXIT(x, ...)
# define Q_TRACE_SCOPE(x, ...)
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index 567ff5c08e..30be47296e 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -213,7 +213,6 @@ Q_DECLARE_MOVABLE_CONTAINER(QList);
Q_DECLARE_MOVABLE_CONTAINER(QVector);
Q_DECLARE_MOVABLE_CONTAINER(QQueue);
Q_DECLARE_MOVABLE_CONTAINER(QStack);
-Q_DECLARE_MOVABLE_CONTAINER(QLinkedList);
Q_DECLARE_MOVABLE_CONTAINER(QSet);
#undef Q_DECLARE_MOVABLE_CONTAINER
@@ -308,7 +307,7 @@ Q_DECLARE_TYPEINFO_BODY(QFlags<T>, Q_PRIMITIVE_TYPE);
#define Q_DECLARE_SHARED_IMPL(TYPE, FLAGS) \
Q_DECLARE_TYPEINFO(TYPE, FLAGS); \
inline void swap(TYPE &value1, TYPE &value2) \
- Q_DECL_NOEXCEPT_EXPR(noexcept(value1.swap(value2))) \
+ noexcept(noexcept(value1.swap(value2))) \
{ value1.swap(value2); }
#define Q_DECLARE_SHARED(TYPE) Q_DECLARE_SHARED_IMPL(TYPE, Q_MOVABLE_TYPE)
#define Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(TYPE) \
diff --git a/src/corelib/io/forkfd_qt.cpp b/src/corelib/io/forkfd_qt.cpp
index dce0ebb4da..cf44874153 100644
--- a/src/corelib/io/forkfd_qt.cpp
+++ b/src/corelib/io/forkfd_qt.cpp
@@ -37,39 +37,12 @@
**
****************************************************************************/
-// these might be defined via precompiled headers
-#include <QtCore/qatomic.h>
+#include <QtCore/qglobal.h>
#define FORKFD_NO_SPAWNFD
-
#if defined(QT_NO_DEBUG) && !defined(NDEBUG)
# define NDEBUG
#endif
-typedef QT_PREPEND_NAMESPACE(QBasicAtomicInt) ffd_atomic_int;
-#define ffd_atomic_pointer(type) QT_PREPEND_NAMESPACE(QBasicAtomicPointer<type>)
-
-QT_BEGIN_NAMESPACE
-
-#define FFD_ATOMIC_INIT(val) Q_BASIC_ATOMIC_INITIALIZER(val)
-
-#define FFD_ATOMIC_RELAXED Relaxed
-#define FFD_ATOMIC_ACQUIRE Acquire
-#define FFD_ATOMIC_RELEASE Release
-#define loadRelaxed load
-#define storeRelaxed store
-
-#define FFD_CONCAT(x, y) x ## y
-
-#define ffd_atomic_load(ptr,order) (ptr)->FFD_CONCAT(load, order)()
-#define ffd_atomic_store(ptr,val,order) (ptr)->FFD_CONCAT(store, order)(val)
-#define ffd_atomic_exchange(ptr,val,order) (ptr)->FFD_CONCAT(fetchAndStore, order)(val)
-#define ffd_atomic_compare_exchange(ptr,expected,desired,order1,order2) \
- (ptr)->FFD_CONCAT(testAndSet, order1)(*expected, desired, *expected)
-#define ffd_atomic_add_fetch(ptr,val,order) ((ptr)->FFD_CONCAT(fetchAndAdd, order)(val) + val)
-
-QT_END_NAMESPACE
-
-extern "C" {
+#include <forkfd.h>
#include "../../3rdparty/forkfd/forkfd.c"
-}
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 9b6044752f..fe81689932 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -158,7 +158,8 @@ win32 {
io/qwindowspipereader.cpp \
io/qwindowspipewriter.cpp
- LIBS += -lmpr -lnetapi32 -luserenv
+ LIBS += -lmpr -luserenv
+ QMAKE_USE_PRIVATE += netapi32
} else {
SOURCES += \
io/qstandardpaths_winrt.cpp \
@@ -171,7 +172,7 @@ win32 {
io/qlockfile_unix.cpp \
io/qfilesystemiterator_unix.cpp
- !integrity:!uikit {
+ !integrity:!uikit:!rtems {
SOURCES += io/forkfd_qt.cpp
HEADERS += \
../3rdparty/forkfd/forkfd.h
diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp
index f2a895bbb8..8a1679c5af 100644
--- a/src/corelib/io/qabstractfileengine.cpp
+++ b/src/corelib/io/qabstractfileengine.cpp
@@ -159,7 +159,7 @@ QAbstractFileEngineHandler::~QAbstractFileEngineHandler()
*/
QAbstractFileEngine *qt_custom_file_engine_handler_create(const QString &path)
{
- QAbstractFileEngine *engine = 0;
+ QAbstractFileEngine *engine = nullptr;
if (qt_file_engine_handlers_in_use) {
QReadLocker locker(fileEngineHandlerMutex());
@@ -658,7 +658,7 @@ QStringList QAbstractFileEngine::entryList(QDir::Filters filters, const QStringL
QAbstractFileEngine::FileFlags QAbstractFileEngine::fileFlags(FileFlags type) const
{
Q_UNUSED(type);
- return 0;
+ return nullptr;
}
/*!
@@ -838,7 +838,7 @@ uchar *QAbstractFileEngine::map(qint64 offset, qint64 size, QFile::MemoryMapFlag
option.flags = flags;
MapExtensionReturn r;
if (!extension(MapExtension, &option, &r))
- return 0;
+ return nullptr;
return r.address;
}
@@ -1118,7 +1118,7 @@ QAbstractFileEngine::Iterator *QAbstractFileEngine::beginEntryList(QDir::Filters
{
Q_UNUSED(filters);
Q_UNUSED(filterNames);
- return 0;
+ return nullptr;
}
/*!
@@ -1126,7 +1126,7 @@ QAbstractFileEngine::Iterator *QAbstractFileEngine::beginEntryList(QDir::Filters
*/
QAbstractFileEngine::Iterator *QAbstractFileEngine::endEntryList()
{
- return 0;
+ return nullptr;
}
/*!
diff --git a/src/corelib/io/qabstractfileengine_p.h b/src/corelib/io/qabstractfileengine_p.h
index 4a7fe7bff5..c88b66c7ce 100644
--- a/src/corelib/io/qabstractfileengine_p.h
+++ b/src/corelib/io/qabstractfileengine_p.h
@@ -193,7 +193,7 @@ public:
uchar *address;
};
- virtual bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0);
+ virtual bool extension(Extension extension, const ExtensionOption *option = nullptr, ExtensionReturn *output = nullptr);
virtual bool supportsExtension(Extension extension) const;
// Factory
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index 7b3fa2ccad..8e980733de 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -50,7 +50,7 @@ class QBufferPrivate : public QIODevicePrivate
public:
QBufferPrivate()
- : buf(0)
+ : buf(nullptr)
#ifndef QT_NO_QOBJECT
, writtenSinceLastEmit(0), signalConnectionCount(0), signalsEmitted(false)
#endif
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 15c5e0ce96..d13e94e096 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -147,7 +147,7 @@ using QtMiscUtils::fromHex;
// Has been defined in the header / inlined before Qt 5.4
QDebug::~QDebug()
{
- if (!--stream->ref) {
+ if (stream && !--stream->ref) {
if (stream->space && stream->buffer.endsWith(QLatin1Char(' ')))
stream->buffer.chop(1);
if (stream->message_output) {
@@ -166,7 +166,7 @@ void QDebug::putUcs4(uint ucs4)
{
maybeQuote('\'');
if (ucs4 < 0x20) {
- stream->ts << "\\x" << hex << ucs4 << reset;
+ stream->ts << "\\x" << Qt::hex << ucs4 << Qt::reset;
} else if (ucs4 < 0x80) {
stream->ts << char(ucs4);
} else {
@@ -174,7 +174,7 @@ void QDebug::putUcs4(uint ucs4)
stream->ts << "\\u" << qSetFieldWidth(4);
else
stream->ts << "\\U" << qSetFieldWidth(8);
- stream->ts << hex << qSetPadChar(QLatin1Char('0')) << ucs4 << reset;
+ stream->ts << Qt::hex << qSetPadChar(QLatin1Char('0')) << ucs4 << Qt::reset;
}
maybeQuote('\'');
}
@@ -834,7 +834,7 @@ QDebug &QDebug::resetFormat()
that QDebugStateSaver stores for the duration of the current block.
The settings of the internal QTextStream are also saved and restored,
- so that using << hex in a QDebug operator doesn't affect other QDebug
+ so that using << Qt::hex in a QDebug operator doesn't affect other QDebug
operators.
\since 5.1
@@ -843,36 +843,34 @@ QDebug &QDebug::resetFormat()
class QDebugStateSaverPrivate
{
public:
- QDebugStateSaverPrivate(QDebug &dbg)
- : m_dbg(dbg),
- m_spaces(dbg.autoInsertSpaces()),
- m_flags(0),
- m_streamParams(dbg.stream->ts.d_ptr->params)
+ QDebugStateSaverPrivate(QDebug::Stream *stream)
+ : m_stream(stream),
+ m_spaces(stream->space),
+ m_flags(stream->context.version > 1 ? stream->flags : 0),
+ m_streamParams(stream->ts.d_ptr->params)
{
- if (m_dbg.stream->context.version > 1)
- m_flags = m_dbg.stream->flags;
}
void restoreState()
{
- const bool currentSpaces = m_dbg.autoInsertSpaces();
+ const bool currentSpaces = m_stream->space;
if (currentSpaces && !m_spaces)
- if (m_dbg.stream->buffer.endsWith(QLatin1Char(' ')))
- m_dbg.stream->buffer.chop(1);
+ if (m_stream->buffer.endsWith(QLatin1Char(' ')))
+ m_stream->buffer.chop(1);
- m_dbg.setAutoInsertSpaces(m_spaces);
- m_dbg.stream->ts.d_ptr->params = m_streamParams;
- if (m_dbg.stream->context.version > 1)
- m_dbg.stream->flags = m_flags;
+ m_stream->space = m_spaces;
+ m_stream->ts.d_ptr->params = m_streamParams;
+ if (m_stream->context.version > 1)
+ m_stream->flags = m_flags;
if (!currentSpaces && m_spaces)
- m_dbg.stream->ts << ' ';
+ m_stream->ts << ' ';
}
- QDebug &m_dbg;
+ QDebug::Stream *m_stream;
// QDebug state
const bool m_spaces;
- int m_flags;
+ const int m_flags;
// QTextStream state
const QTextStreamPrivate::Params m_streamParams;
@@ -886,7 +884,7 @@ public:
\sa QDebug::setAutoInsertSpaces(), QDebug::autoInsertSpaces()
*/
QDebugStateSaver::QDebugStateSaver(QDebug &dbg)
- : d(new QDebugStateSaverPrivate(dbg))
+ : d(new QDebugStateSaverPrivate(dbg.stream))
{
}
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 91fde75fa5..421c5d933b 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QDebug
{
friend class QMessageLogger;
+ friend class QDebugStateSaver;
friend class QDebugStateSaverPrivate;
struct Stream {
enum { VerbosityShift = 29, VerbosityMask = 0x7 };
@@ -114,9 +115,12 @@ public:
inline QDebug(QString *string) : stream(new Stream(string)) {}
inline QDebug(QtMsgType t) : stream(new Stream(t)) {}
inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
+ QDebug(QDebug &&other) noexcept : stream{qExchange(other.stream, nullptr)} {}
inline QDebug &operator=(const QDebug &other);
+ QDebug &operator=(QDebug &&other) noexcept
+ { QDebug{std::move(other)}.swap(*this); return *this; }
~QDebug();
- inline void swap(QDebug &other) Q_DECL_NOTHROW { qSwap(stream, other.stream); }
+ inline void swap(QDebug &other) noexcept { qSwap(stream, other.stream); }
QDebug &resetFormat();
@@ -161,9 +165,7 @@ public:
inline QDebug &operator<<(QLatin1String t) { putByteArray(t.latin1(), t.size(), ContainsLatin1); return maybeSpace(); }
inline QDebug &operator<<(const QByteArray & t) { putByteArray(t.constData(), t.size(), ContainsBinary); return maybeSpace(); }
inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
-#ifdef Q_COMPILER_NULLPTR
inline QDebug &operator<<(std::nullptr_t) { stream->ts << "(nullptr)"; return maybeSpace(); }
-#endif
inline QDebug &operator<<(QTextStreamFunction f) {
stream->ts << f;
return *this;
@@ -205,10 +207,7 @@ public:
inline QDebug &QDebug::operator=(const QDebug &other)
{
- if (this != &other) {
- QDebug copy(other);
- qSwap(stream, copy.stream);
- }
+ QDebug{other}.swap(*this);
return *this;
}
@@ -352,7 +351,7 @@ void qt_QMetaEnum_flagDebugOperator(QDebug &debug, size_t sizeofT, Int value)
{
const QDebugStateSaver saver(debug);
debug.resetFormat();
- debug.nospace() << "QFlags(" << hex << showbase;
+ debug.nospace() << "QFlags(" << Qt::hex << Qt::showbase;
bool needSeparator = false;
for (uint i = 0; i < sizeofT * 8; ++i) {
if (value & (Int(1) << i)) {
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 671913e92f..526702d151 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -153,7 +153,7 @@ QDirPrivate::QDirPrivate(const QDirPrivate &copy)
bool QDirPrivate::exists() const
{
- if (fileEngine.isNull()) {
+ if (!fileEngine) {
QFileSystemEngine::fillMetaData(dirEntry, metaData,
QFileSystemMetaData::ExistsAttribute | QFileSystemMetaData::DirectoryType); // always stat
return metaData.exists() && metaData.isDirectory();
@@ -226,7 +226,7 @@ inline void QDirPrivate::resolveAbsoluteEntry() const
return;
QString absoluteName;
- if (fileEngine.isNull()) {
+ if (!fileEngine) {
if (!dirEntry.isRelative() && dirEntry.isClean()) {
absoluteDirEntry = dirEntry;
return;
@@ -693,7 +693,7 @@ QString QDir::absolutePath() const
QString QDir::canonicalPath() const
{
const QDirPrivate* d = d_ptr.constData();
- if (d->fileEngine.isNull()) {
+ if (!d->fileEngine) {
QFileSystemEntry answer = QFileSystemEngine::canonicalName(d->dirEntry, d->metaData);
return answer.filePath();
}
@@ -947,6 +947,12 @@ QString QDir::fromNativeSeparators(const QString &pathName)
int i = pathName.indexOf(QLatin1Char('\\'));
if (i != -1) {
QString n(pathName);
+ if (n.startsWith(QLatin1String("\\\\?\\"))) {
+ n.remove(0, 4);
+ i = n.indexOf(QLatin1Char('\\'));
+ if (i == -1)
+ return n;
+ }
QChar * const data = n.data();
data[i++] = QLatin1Char('/');
@@ -1431,7 +1437,7 @@ QStringList QDir::entryList(const QStringList &nameFilters, Filters filters,
l.append(it.fileInfo());
}
QStringList ret;
- d->sortFileList(sort, l, &ret, 0);
+ d->sortFileList(sort, l, &ret, nullptr);
return ret;
}
@@ -1473,7 +1479,7 @@ QFileInfoList QDir::entryInfoList(const QStringList &nameFilters, Filters filter
l.append(it.fileInfo());
}
QFileInfoList ret;
- d->sortFileList(sort, l, 0, &ret);
+ d->sortFileList(sort, l, nullptr, &ret);
return ret;
}
@@ -1496,7 +1502,7 @@ bool QDir::mkdir(const QString &dirName) const
}
QString fn = filePath(dirName);
- if (d->fileEngine.isNull())
+ if (!d->fileEngine)
return QFileSystemEngine::createDirectory(QFileSystemEntry(fn), false);
return d->fileEngine->mkdir(fn, false);
}
@@ -1520,7 +1526,7 @@ bool QDir::rmdir(const QString &dirName) const
}
QString fn = filePath(dirName);
- if (d->fileEngine.isNull())
+ if (!d->fileEngine)
return QFileSystemEngine::removeDirectory(QFileSystemEntry(fn), false);
return d->fileEngine->rmdir(fn, false);
@@ -1548,7 +1554,7 @@ bool QDir::mkpath(const QString &dirPath) const
}
QString fn = filePath(dirPath);
- if (d->fileEngine.isNull())
+ if (!d->fileEngine)
return QFileSystemEngine::createDirectory(QFileSystemEntry(fn), true);
return d->fileEngine->mkdir(fn, true);
}
@@ -1574,7 +1580,7 @@ bool QDir::rmpath(const QString &dirPath) const
}
QString fn = filePath(dirPath);
- if (d->fileEngine.isNull())
+ if (!d->fileEngine)
return QFileSystemEngine::removeDirectory(QFileSystemEntry(fn), true);
return d->fileEngine->rmdir(fn, true);
}
@@ -1647,7 +1653,7 @@ bool QDir::isReadable() const
{
const QDirPrivate* d = d_ptr.constData();
- if (d->fileEngine.isNull()) {
+ if (!d->fileEngine) {
if (!d->metaData.hasFlags(QFileSystemMetaData::UserReadPermission))
QFileSystemEngine::fillMetaData(d->dirEntry, d->metaData, QFileSystemMetaData::UserReadPermission);
@@ -1692,7 +1698,7 @@ bool QDir::exists() const
*/
bool QDir::isRoot() const
{
- if (d_ptr->fileEngine.isNull())
+ if (!d_ptr->fileEngine)
return d_ptr->dirEntry.isRoot();
return d_ptr->fileEngine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::RootFlag;
}
@@ -1724,7 +1730,7 @@ bool QDir::isRoot() const
*/
bool QDir::isRelative() const
{
- if (d_ptr->fileEngine.isNull())
+ if (!d_ptr->fileEngine)
return d_ptr->dirEntry.isRelative();
return d_ptr->fileEngine->isRelativePath();
}
@@ -1741,7 +1747,7 @@ bool QDir::makeAbsolute()
{
const QDirPrivate *d = d_ptr.constData();
QScopedPointer<QDirPrivate> dir;
- if (!d->fileEngine.isNull()) {
+ if (!!d->fileEngine) {
QString absolutePath = d->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
if (QDir::isRelativePath(absolutePath))
return false;
@@ -1774,8 +1780,8 @@ bool QDir::operator==(const QDir &dir) const
if (d == other)
return true;
Qt::CaseSensitivity sensitive;
- if (d->fileEngine.isNull() || other->fileEngine.isNull()) {
- if (d->fileEngine.data() != other->fileEngine.data()) // one is native, the other is a custom file-engine
+ if (!d->fileEngine || !other->fileEngine) {
+ if (d->fileEngine.get() != other->fileEngine.get()) // one is native, the other is a custom file-engine
return false;
sensitive = QFileSystemEngine::isCaseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive;
@@ -2339,6 +2345,11 @@ static QString qt_cleanPath(const QString &path, bool *ok)
if (path.isEmpty())
return path;
QString name = path;
+#if defined (Q_OS_WIN)
+ if (name.startsWith(QLatin1String("\\\\?\\")))
+ name.remove(0, 4);
+#endif
+
QChar dir_separator = QDir::separator();
if (dir_separator != QLatin1Char('/'))
name.replace(dir_separator, QLatin1Char('/'));
@@ -2361,8 +2372,9 @@ static QString qt_cleanPath(const QString &path, bool *ok)
}
/*!
- Returns \a path with directory separators normalized (converted to "/") and
- redundant ones removed, and "."s and ".."s resolved (as far as possible).
+ Returns \a path with directory separators normalized (that is, platform-native
+ separators converted to "/") and redundant ones removed, and "."s and ".."s
+ resolved (as far as possible).
Symbolic links are kept. This function does not return the
canonical path, but rather the simplest version of the input.
diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h
index 9abb833ab1..45a40995f8 100644
--- a/src/corelib/io/qdir.h
+++ b/src/corelib/io/qdir.h
@@ -109,11 +109,9 @@ public:
QT_DEPRECATED_X("Use QDir::setPath() instead")
QDir &operator=(const QString &path);
#endif
-#ifdef Q_COMPILER_RVALUE_REFS
- QDir &operator=(QDir &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDir &operator=(QDir &&other) noexcept { swap(other); return *this; }
- void swap(QDir &other) Q_DECL_NOTHROW
+ void swap(QDir &other) noexcept
{ qSwap(d_ptr, other.d_ptr); }
void setPath(const QString &path);
@@ -190,7 +188,7 @@ public:
static QFileInfoList drives();
- Q_DECL_CONSTEXPR static inline QChar listSeparator() Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR static inline QChar listSeparator() noexcept
{
#if defined(Q_OS_WIN)
return QLatin1Char(';');
diff --git a/src/corelib/io/qdir_p.h b/src/corelib/io/qdir_p.h
index 0f3ab7f899..af105de8db 100644
--- a/src/corelib/io/qdir_p.h
+++ b/src/corelib/io/qdir_p.h
@@ -54,6 +54,8 @@
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QDirPrivate : public QSharedData
@@ -82,7 +84,7 @@ public:
static inline QChar getFilterSepChar(const QString &nameFilter);
- static inline QStringList splitFilters(const QString &nameFilter, QChar sep = 0);
+ static inline QStringList splitFilters(const QString &nameFilter, QChar sep = {});
void setPath(const QString &path);
@@ -98,7 +100,7 @@ public:
QDir::SortFlags sort;
QDir::Filters filters;
- QScopedPointer<QAbstractFileEngine> fileEngine;
+ std::unique_ptr<QAbstractFileEngine> fileEngine;
QFileSystemEntry dirEntry;
mutable QFileSystemEntry absoluteDirEntry;
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index ccde9745bf..ce436b06e3 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -93,9 +93,13 @@
#include "qdir_p.h"
#include "qabstractfileengine_p.h"
+#include <QtCore/qregexp.h>
#include <QtCore/qset.h>
#include <QtCore/qstack.h>
#include <QtCore/qvariant.h>
+#if QT_CONFIG(regularexpression)
+#include <QtCore/qregularexpression.h>
+#endif
#include <QtCore/private/qfilesystemiterator_p.h>
#include <QtCore/private/qfilesystementry_p.h>
@@ -103,6 +107,8 @@
#include <QtCore/private/qfilesystemengine_p.h>
#include <QtCore/private/qfileinfo_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
template <class Iterator>
@@ -128,15 +134,18 @@ public:
void checkAndPushDirectory(const QFileInfo &);
bool matchesFilters(const QString &fileName, const QFileInfo &fi) const;
- QScopedPointer<QAbstractFileEngine> engine;
+ std::unique_ptr<QAbstractFileEngine> engine;
QFileSystemEntry dirEntry;
const QStringList nameFilters;
const QDir::Filters filters;
const QDirIterator::IteratorFlags iteratorFlags;
-#ifndef QT_NO_REGEXP
+#if defined(QT_BOOTSTRAPPED)
+ // ### Qt6: Get rid of this once we don't bootstrap qmake anymore
QVector<QRegExp> nameRegExps;
+#elif QT_CONFIG(regularexpression)
+ QVector<QRegularExpression> nameRegExps;
#endif
QDirIteratorPrivateIteratorStack<QAbstractFileEngineIterator> fileEngineIterators;
@@ -161,13 +170,21 @@ QDirIteratorPrivate::QDirIteratorPrivate(const QFileSystemEntry &entry, const QS
, filters(QDir::NoFilter == filters ? QDir::AllEntries : filters)
, iteratorFlags(flags)
{
-#ifndef QT_NO_REGEXP
+#if defined(QT_BOOTSTRAPPED)
nameRegExps.reserve(nameFilters.size());
- for (int i = 0; i < nameFilters.size(); ++i)
+ for (const auto &filter : nameFilters) {
nameRegExps.append(
- QRegExp(nameFilters.at(i),
+ QRegExp(filter,
(filters & QDir::CaseSensitive) ? Qt::CaseSensitive : Qt::CaseInsensitive,
QRegExp::Wildcard));
+ }
+#elif QT_CONFIG(regularexpression)
+ nameRegExps.reserve(nameFilters.size());
+ for (const auto &filter : nameFilters) {
+ QString re = QRegularExpression::anchoredPattern(QRegularExpression::wildcardToRegularExpression(filter));
+ nameRegExps.append(
+ QRegularExpression(re, (filters & QDir::CaseSensitive) ? QRegularExpression::NoPatternOption : QRegularExpression::CaseInsensitiveOption));
+ }
#endif
QFileSystemMetaData metaData;
if (resolveEngine)
@@ -334,19 +351,23 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf
return false;
// name filter
-#ifndef QT_NO_REGEXP
+#if QT_CONFIG(regularexpression) || defined(QT_BOOTSTRAPPED)
// Pass all entries through name filters, except dirs if the AllDirs
if (!nameFilters.isEmpty() && !((filters & QDir::AllDirs) && fi.isDir())) {
bool matched = false;
- for (QVector<QRegExp>::const_iterator iter = nameRegExps.constBegin(),
- end = nameRegExps.constEnd();
- iter != end; ++iter) {
-
- QRegExp copy = *iter;
+ for (const auto &re : nameRegExps) {
+#if defined(QT_BOOTSTRAPPED)
+ QRegExp copy = re;
if (copy.exactMatch(fileName)) {
matched = true;
break;
}
+#else
+ if (re.match(fileName).hasMatch()) {
+ matched = true;
+ break;
+ }
+#endif
}
if (!matched)
return false;
@@ -416,7 +437,7 @@ bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInf
QDirIterator::QDirIterator(const QDir &dir, IteratorFlags flags)
{
const QDirPrivate *other = dir.d_ptr.constData();
- d.reset(new QDirIteratorPrivate(other->dirEntry, other->nameFilters, other->filters, flags, !other->fileEngine.isNull()));
+ d.reset(new QDirIteratorPrivate(other->dirEntry, other->nameFilters, other->filters, flags, bool(other->fileEngine)));
}
/*!
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 37de4450cc..95f03ef816 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -55,12 +55,21 @@
# include "qcoreapplication.h"
#endif
+#include <private/qmemory_p.h>
+
#ifdef QT_NO_QOBJECT
#define tr(X) QString::fromLatin1(X)
#endif
QT_BEGIN_NAMESPACE
+Q_DECL_COLD_FUNCTION
+static bool file_already_open(QFile &file, const char *where = nullptr)
+{
+ qWarning("QFile::%s: File (%ls) already open", where ? where : "open", qUtf16Printable(file.fileName()));
+ return false;
+}
+
//************* QFilePrivate
QFilePrivate::QFilePrivate()
{
@@ -78,10 +87,9 @@ QFilePrivate::openExternalFile(int flags, int fd, QFile::FileHandleFlags handleF
Q_UNUSED(fd);
return false;
#else
- delete fileEngine;
- fileEngine = 0;
- QFSFileEngine *fe = new QFSFileEngine;
- fileEngine = fe;
+ auto fs = qt_make_unique<QFSFileEngine>();
+ auto fe = fs.get();
+ fileEngine = std::move(fs);
return fe->open(QIODevice::OpenMode(flags), fd, handleFlags);
#endif
}
@@ -94,10 +102,9 @@ QFilePrivate::openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handl
Q_UNUSED(fh);
return false;
#else
- delete fileEngine;
- fileEngine = 0;
- QFSFileEngine *fe = new QFSFileEngine;
- fileEngine = fe;
+ auto fs = qt_make_unique<QFSFileEngine>();
+ auto fe = fs.get();
+ fileEngine = std::move(fs);
return fe->open(QIODevice::OpenMode(flags), fh, handleFlags);
#endif
}
@@ -105,8 +112,8 @@ QFilePrivate::openExternalFile(int flags, FILE *fh, QFile::FileHandleFlags handl
QAbstractFileEngine *QFilePrivate::engine() const
{
if (!fileEngine)
- fileEngine = QAbstractFileEngine::create(fileName);
- return fileEngine;
+ fileEngine.reset(QAbstractFileEngine::create(fileName));
+ return fileEngine.get();
}
//************* QFile
@@ -324,14 +331,10 @@ QFile::setFileName(const QString &name)
{
Q_D(QFile);
if (isOpen()) {
- qWarning("QFile::setFileName: File (%s) is already opened",
- qPrintable(fileName()));
+ file_already_open(*this, "setFileName");
close();
}
- if(d->fileEngine) { //get a new file engine later
- delete d->fileEngine;
- d->fileEngine = 0;
- }
+ d->fileEngine.reset(); //get a new file engine later
d->fileName = name;
}
@@ -804,7 +807,7 @@ QFile::copy(const QString &newName)
error = true;
d->setError(QFile::CopyError, tr("Cannot open %1 for input").arg(d->fileName));
} else {
- QString fileTemplate = QLatin1String("%1/qt_temp.XXXXXX");
+ const auto fileTemplate = QLatin1String("%1/qt_temp.XXXXXX");
#ifdef QT_NO_TEMPORARYFILE
QFile out(fileTemplate.arg(QFileInfo(newName).path()));
if (!out.open(QIODevice::ReadWrite))
@@ -910,10 +913,8 @@ QFile::copy(const QString &fileName, const QString &newName)
bool QFile::open(OpenMode mode)
{
Q_D(QFile);
- if (isOpen()) {
- qWarning("QFile::open: File (%s) already open", qPrintable(fileName()));
- return false;
- }
+ if (isOpen())
+ return file_already_open(*this);
// Either Append or NewOnly implies WriteOnly
if (mode & (Append | NewOnly))
mode |= WriteOnly;
@@ -982,10 +983,8 @@ bool QFile::open(OpenMode mode)
bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
{
Q_D(QFile);
- if (isOpen()) {
- qWarning("QFile::open: File (%s) already open", qPrintable(fileName()));
- return false;
- }
+ if (isOpen())
+ return file_already_open(*this);
// Either Append or NewOnly implies WriteOnly
if (mode & (Append | NewOnly))
mode |= WriteOnly;
@@ -1041,10 +1040,8 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags)
{
Q_D(QFile);
- if (isOpen()) {
- qWarning("QFile::open: File (%s) already open", qPrintable(fileName()));
- return false;
- }
+ if (isOpen())
+ return file_already_open(*this);
// Either Append or NewOnly implies WriteOnly
if (mode & (Append | NewOnly))
mode |= WriteOnly;
diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h
index cf1465ec70..2099b2852f 100644
--- a/src/corelib/io/qfile.h
+++ b/src/corelib/io/qfile.h
@@ -84,6 +84,10 @@ public:
// note: duplicated in qglobal.cpp (qEnvironmentVariable)
return QString::fromUtf8(localFileName).normalized(QString::NormalizationForm_C);
}
+ static inline QString decodeName(const char *localFileName)
+ {
+ return QString::fromUtf8(localFileName).normalized(QString::NormalizationForm_C);
+ }
#else
static inline QByteArray encodeName(const QString &fileName)
{
@@ -93,9 +97,11 @@ public:
{
return QString::fromLocal8Bit(localFileName);
}
+ static inline QString decodeName(const char *localFileName)
+ {
+ return QString::fromLocal8Bit(localFileName);
+ }
#endif
- inline static QString decodeName(const char *localFileName)
- { return decodeName(QByteArray(localFileName)); }
#if QT_DEPRECATED_SINCE(5,0)
typedef QByteArray (*EncoderFn)(const QString &fileName);
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index 0689118f3e..ee619d99cc 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -42,6 +42,8 @@
#include "qfiledevice_p.h"
#include "qfsfileengine_p.h"
+#include <private/qmemory_p.h>
+
#ifdef QT_NO_QOBJECT
#define tr(X) QString::fromLatin1(X)
#endif
@@ -53,24 +55,20 @@ QT_BEGIN_NAMESPACE
#endif
QFileDevicePrivate::QFileDevicePrivate()
- : fileEngine(0),
- cachedSize(0),
+ : cachedSize(0),
error(QFile::NoError), lastWasWrite(false)
{
writeBufferChunkSize = QFILE_WRITEBUFFER_SIZE;
}
QFileDevicePrivate::~QFileDevicePrivate()
-{
- delete fileEngine;
- fileEngine = 0;
-}
+ = default;
QAbstractFileEngine * QFileDevicePrivate::engine() const
{
if (!fileEngine)
- fileEngine = new QFSFileEngine;
- return fileEngine;
+ fileEngine = qt_make_unique<QFSFileEngine>();
+ return fileEngine.get();
}
void QFileDevicePrivate::setError(QFileDevice::FileError err)
diff --git a/src/corelib/io/qfiledevice_p.h b/src/corelib/io/qfiledevice_p.h
index 47053d01b7..aef3fca811 100644
--- a/src/corelib/io/qfiledevice_p.h
+++ b/src/corelib/io/qfiledevice_p.h
@@ -53,6 +53,8 @@
#include "private/qiodevice_p.h"
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QAbstractFileEngine;
@@ -75,7 +77,7 @@ protected:
void setError(QFileDevice::FileError err, const QString &errorString);
void setError(QFileDevice::FileError err, int errNum);
- mutable QAbstractFileEngine *fileEngine;
+ mutable std::unique_ptr<QAbstractFileEngine> fileEngine;
mutable qint64 cachedSize;
QFileDevice::FileHandleFlags handleFlags;
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 82d848eba0..89834de29f 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -52,7 +52,7 @@ QString QFileInfoPrivate::getFileName(QAbstractFileEngine::FileName name) const
return fileNames[(int)name];
QString ret;
- if (fileEngine == 0) { // local file; use the QFileSystemEngine directly
+ if (fileEngine == nullptr) { // local file; use the QFileSystemEngine directly
switch (name) {
case QAbstractFileEngine::CanonicalName:
case QAbstractFileEngine::CanonicalPathName: {
@@ -103,7 +103,7 @@ QString QFileInfoPrivate::getFileOwner(QAbstractFileEngine::FileOwner own) const
if (cache_enabled && !fileOwners[(int)own].isNull())
return fileOwners[(int)own];
QString ret;
- if (fileEngine == 0) {
+ if (fileEngine == nullptr) {
switch (own) {
case QAbstractFileEngine::OwnerUser:
ret = QFileSystemEngine::resolveUserName(fileEntry, metaData);
@@ -134,7 +134,7 @@ uint QFileInfoPrivate::getFileFlags(QAbstractFileEngine::FileFlags request) cons
// extra syscall. Bundle detecton on Mac can be slow, expecially on network
// paths, so we separate out that as well.
- QAbstractFileEngine::FileFlags req = 0;
+ QAbstractFileEngine::FileFlags req = nullptr;
uint cachedFlags = 0;
if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) {
@@ -256,11 +256,11 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
\snippet code/src_corelib_io_qfileinfo.cpp 0
- On Windows, symlinks (shortcuts) are \c .lnk files. Similarly to Unix
- systems, the property getters return the size of the targeted file, not
- the \c .lnk file itself. Please note this behavior is deprecated and will
- likely be removed in a future version of Qt, after which \c .lnk files will
- be treated as regular files.
+ On Windows, shortcuts (\c .lnk files) are currently treated as symlinks. As
+ on Unix systems, the property getters return the size of the targeted file,
+ not the \c .lnk file itself. This behavior is deprecated and will likely be
+ removed in a future version of Qt, after which \c .lnk files will be treated
+ as regular files.
\snippet code/src_corelib_io_qfileinfo.cpp 1
@@ -435,7 +435,7 @@ bool QFileInfo::operator==(const QFileInfo &fileinfo) const
return true;
Qt::CaseSensitivity sensitive;
- if (d->fileEngine == 0 || fileinfo.d_ptr->fileEngine == 0) {
+ if (d->fileEngine == nullptr || fileinfo.d_ptr->fileEngine == nullptr) {
if (d->fileEngine != fileinfo.d_ptr->fileEngine) // one is native, the other is a custom file-engine
return false;
@@ -650,7 +650,7 @@ bool QFileInfo::isRelative() const
Q_D(const QFileInfo);
if (d->isDefaultConstructed)
return true;
- if (d->fileEngine == 0)
+ if (d->fileEngine == nullptr)
return d->fileEntry.isRelative();
return d->fileEngine->isRelativePath();
}
@@ -683,7 +683,7 @@ bool QFileInfo::exists() const
Q_D(const QFileInfo);
if (d->isDefaultConstructed)
return false;
- if (d->fileEngine == 0) {
+ if (d->fileEngine == nullptr) {
if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ExistsAttribute);
return d->metaData.exists();
@@ -708,11 +708,11 @@ bool QFileInfo::exists(const QString &file)
return false;
QFileSystemEntry entry(file);
QFileSystemMetaData data;
- QAbstractFileEngine *engine =
- QFileSystemEngine::resolveEntryAndCreateLegacyEngine(entry, data);
+ std::unique_ptr<QAbstractFileEngine> engine
+ {QFileSystemEngine::resolveEntryAndCreateLegacyEngine(entry, data)};
// Expensive fallback to non-QFileSystemEngine implementation
if (engine)
- return QFileInfo(new QFileInfoPrivate(entry, data, engine)).exists();
+ return QFileInfo(new QFileInfoPrivate(entry, data, std::move(engine))).exists();
QFileSystemEngine::fillMetaData(entry, data, QFileSystemMetaData::ExistsAttribute);
return data.exists();
@@ -997,7 +997,7 @@ bool QFileInfo::isNativePath() const
Q_D(const QFileInfo);
if (d->isDefaultConstructed)
return false;
- if (d->fileEngine == 0)
+ if (d->fileEngine == nullptr)
return true;
return d->getFileFlags(QAbstractFileEngine::LocalDiskFlag);
}
@@ -1060,7 +1060,7 @@ bool QFileInfo::isBundle() const
}
/*!
- Returns \c true if this object points to a symbolic link;
+ Returns \c true if this object points to a symbolic link or shortcut;
otherwise returns \c false.
Symbolic links exist on Unix (including \macos and iOS) and Windows
@@ -1091,6 +1091,61 @@ bool QFileInfo::isSymLink() const
}
/*!
+ Returns \c true if this object points to a symbolic link;
+ otherwise returns \c false.
+
+ Symbolic links exist on Unix (including \macos and iOS) and Windows
+ (NTFS-symlink) and are typically created by the \c{ln -s} or \c{mklink}
+ commands, respectively.
+
+ Unix handles symlinks transparently. Opening a symbolic link effectively
+ opens the \l{symLinkTarget()}{link's target}.
+
+ In contrast to isSymLink(), false will be returned for shortcuts
+ (\c *.lnk files) on Windows. Use QFileInfo::isShortcut() instead.
+
+ \note If the symlink points to a non existing file, exists() returns
+ false.
+
+ \sa isFile(), isDir(), isShortcut(), symLinkTarget()
+*/
+
+bool QFileInfo::isSymbolicLink() const
+{
+ Q_D(const QFileInfo);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::LegacyLinkType,
+ [d]() { return d->metaData.isLink(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
+}
+
+/*!
+ Returns \c true if this object points to a shortcut;
+ otherwise returns \c false.
+
+ Shortcuts only exist on Windows and are typically \c .lnk files.
+ For instance, true will be returned for shortcuts (\c *.lnk files) on
+ Windows, but false will be returned on Unix (including \macos and iOS).
+
+ The shortcut (.lnk) files are treated as regular files. Opening those will
+ open the \c .lnk file itself. In order to open the file a shortcut
+ references to, it must uses symLinkTarget() on a shortcut.
+
+ \note Even if a shortcut (broken shortcut) points to a non existing file,
+ isShortcut() returns true.
+
+ \sa isFile(), isDir(), isSymbolicLink(), symLinkTarget()
+*/
+bool QFileInfo::isShortcut() const
+{
+ Q_D(const QFileInfo);
+ return d->checkAttribute<bool>(
+ QFileSystemMetaData::LegacyLinkType,
+ [d]() { return d->metaData.isLnkFile(); },
+ [d]() { return d->getFileFlags(QAbstractFileEngine::LinkType); });
+}
+
+/*!
Returns \c true if the object points to a directory or to a symbolic
link to a directory, and that directory is the root directory; otherwise
returns \c false.
@@ -1100,7 +1155,7 @@ bool QFileInfo::isRoot() const
Q_D(const QFileInfo);
if (d->isDefaultConstructed)
return false;
- if (d->fileEngine == 0) {
+ if (d->fileEngine == nullptr) {
if (d->fileEntry.isRoot()) {
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
//the path is a drive root, but the drive may not exist
diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h
index baea18fab1..3ac028085a 100644
--- a/src/corelib/io/qfileinfo.h
+++ b/src/corelib/io/qfileinfo.h
@@ -67,11 +67,9 @@ public:
~QFileInfo();
QFileInfo &operator=(const QFileInfo &fileinfo);
-#ifdef Q_COMPILER_RVALUE_REFS
- QFileInfo &operator=(QFileInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QFileInfo &operator=(QFileInfo &&other) noexcept { swap(other); return *this; }
- void swap(QFileInfo &other) Q_DECL_NOTHROW
+ void swap(QFileInfo &other) noexcept
{ qSwap(d_ptr, other.d_ptr); }
bool operator==(const QFileInfo &fileinfo) const;
@@ -113,6 +111,8 @@ public:
bool isFile() const;
bool isDir() const;
bool isSymLink() const;
+ bool isSymbolicLink() const;
+ bool isShortcut() const;
bool isRoot() const;
bool isBundle() const;
diff --git a/src/corelib/io/qfileinfo_p.h b/src/corelib/io/qfileinfo_p.h
index e4b28f4519..333ea70adc 100644
--- a/src/corelib/io/qfileinfo_p.h
+++ b/src/corelib/io/qfileinfo_p.h
@@ -61,6 +61,8 @@
#include <QtCore/private/qfilesystementry_p.h>
#include <QtCore/private/qfilesystemmetadata_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QFileInfoPrivate : public QSharedData
@@ -80,7 +82,7 @@ public:
};
inline QFileInfoPrivate()
- : QSharedData(), fileEngine(0),
+ : QSharedData(), fileEngine(nullptr),
cachedFlags(0),
isDefaultConstructed(true),
cache_enabled(true), fileFlags(0), fileSize(0)
@@ -126,10 +128,10 @@ public:
metaData = QFileSystemMetaData();
}
- inline QFileInfoPrivate(const QFileSystemEntry &file, const QFileSystemMetaData &data, QAbstractFileEngine *engine)
+ inline QFileInfoPrivate(const QFileSystemEntry &file, const QFileSystemMetaData &data, std::unique_ptr<QAbstractFileEngine> engine)
: fileEntry(file),
metaData(data),
- fileEngine(engine),
+ fileEngine{std::move(engine)},
cachedFlags(0),
#ifndef QT_NO_FSFILEENGINE
isDefaultConstructed(false),
@@ -163,7 +165,7 @@ public:
QFileSystemEntry fileEntry;
mutable QFileSystemMetaData metaData;
- QScopedPointer<QAbstractFileEngine> const fileEngine;
+ std::unique_ptr<QAbstractFileEngine> const fileEngine;
mutable QString fileNames[QAbstractFileEngine::NFileNames];
mutable QString fileOwners[2]; // QAbstractFileEngine::FileOwner: OwnerUser and OwnerGroup
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 500b475d1d..31c490de66 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -44,7 +44,7 @@
#include <QtCore/QFile>
#include <QtCore/QDir>
#include <QtCore/QMutex>
-#include <QtCore/QMutexLocker>
+#include <QtCore/private/qlocking_p.h>
#include <QtCore/QUrl>
#include <QtCore/QFileInfo>
#include <QtCore/QLocale>
@@ -312,7 +312,7 @@ void QFileSelector::setExtraSelectors(const QStringList &list)
QStringList QFileSelector::allSelectors() const
{
Q_D(const QFileSelector);
- QMutexLocker locker(&sharedDataMutex);
+ const auto locker = qt_scoped_lock(sharedDataMutex);
QFileSelectorPrivate::updateSelectors();
return d->extras + sharedData->staticSelectors;
}
@@ -371,7 +371,7 @@ QStringList QFileSelectorPrivate::platformSelectors()
void QFileSelectorPrivate::addStatics(const QStringList &statics)
{
- QMutexLocker locker(&sharedDataMutex);
+ const auto locker = qt_scoped_lock(sharedDataMutex);
sharedData->preloadedStatics << statics;
sharedData->staticSelectors.clear();
}
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index 7abdf90bf5..21847c2a7c 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -124,7 +124,7 @@ static inline bool _q_checkEntry(QAbstractFileEngine *&engine, bool resolvingEnt
if (resolvingEntry) {
if (!(engine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::ExistsFlag)) {
delete engine;
- engine = 0;
+ engine = nullptr;
return false;
}
}
@@ -191,7 +191,7 @@ static bool _q_resolveEntryAndCreateLegacyEngine_recursive(QFileSystemEntry &ent
QAbstractFileEngine *QFileSystemEngine::resolveEntryAndCreateLegacyEngine(
QFileSystemEntry &entry, QFileSystemMetaData &data) {
QFileSystemEntry copy = entry;
- QAbstractFileEngine *engine = 0;
+ QAbstractFileEngine *engine = nullptr;
if (_q_resolveEntryAndCreateLegacyEngine_recursive(copy, data, engine))
// Reset entry to resolved copy.
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h
index 09ec2d6a10..ecfdc03743 100644
--- a/src/corelib/io/qfilesystemengine_p.h
+++ b/src/corelib/io/qfilesystemengine_p.h
@@ -58,6 +58,36 @@
QT_BEGIN_NAMESPACE
+#define Q_RETURN_ON_INVALID_FILENAME(message, result) \
+ { \
+ QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).warning(message); \
+ errno = EINVAL; \
+ return (result); \
+ }
+
+inline bool qIsFilenameBroken(const QByteArray &name)
+{
+ return name.contains('\0');
+}
+
+inline bool qIsFilenameBroken(const QString &name)
+{
+ return name.contains(QLatin1Char('\0'));
+}
+
+inline bool qIsFilenameBroken(const QFileSystemEntry &entry)
+{
+ return qIsFilenameBroken(entry.nativeFilePath());
+}
+
+#define Q_CHECK_FILE_NAME(name, result) \
+ do { \
+ if (Q_UNLIKELY((name).isEmpty())) \
+ Q_RETURN_ON_INVALID_FILENAME("Empty filename passed to function", (result)); \
+ if (Q_UNLIKELY(qIsFilenameBroken(name))) \
+ Q_RETURN_ON_INVALID_FILENAME("Broken filename passed to function", (result)); \
+ } while (false)
+
class QFileSystemEngine
{
public:
@@ -130,7 +160,7 @@ public:
static bool removeFile(const QFileSystemEntry &entry, QSystemError &error);
static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error,
- QFileSystemMetaData *data = 0);
+ QFileSystemMetaData *data = nullptr);
// unused, therefore not implemented
static bool setFileTime(const QFileSystemEntry &entry, const QDateTime &newDate,
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index b78e037865..c3abec8989 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -118,13 +118,6 @@ enum {
#endif
};
-#define emptyFileEntryWarning() emptyFileEntryWarning_(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC)
-static void emptyFileEntryWarning_(const char *file, int line, const char *function)
-{
- QMessageLogger(file, line, function).warning("Empty filename passed to function");
- errno = EINVAL;
-}
-
#if defined(Q_OS_DARWIN)
static inline bool hasResourcePropertyFlag(const QFileSystemMetaData &data,
const QFileSystemEntry &entry,
@@ -625,8 +618,7 @@ void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
//static
QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, QFileSystemMetaData &data)
{
- if (Q_UNLIKELY(link.isEmpty()))
- return emptyFileEntryWarning(), link;
+ Q_CHECK_FILE_NAME(link, link);
QByteArray s = qt_readlink(link.nativeFilePath().constData());
if (s.length() > 0) {
@@ -685,10 +677,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
//static
QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), entry;
- if (entry.isRoot())
- return entry;
+ Q_CHECK_FILE_NAME(entry, entry);
#if !defined(Q_OS_MAC) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && _POSIX_VERSION < 200809L
// realpath(X,0) is not supported
@@ -738,8 +727,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
//static
QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), entry;
+ Q_CHECK_FILE_NAME(entry, entry);
+
if (entry.isAbsolute() && entry.isClean())
return entry;
@@ -773,8 +762,7 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
//static
QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), QByteArray();
+ Q_CHECK_FILE_NAME(entry, QByteArray());
QT_STATBUF statResult;
if (QT_STAT(entry.nativeFilePath().constData(), &statResult)) {
@@ -813,7 +801,7 @@ QString QFileSystemEngine::resolveUserName(uint userId)
#endif
#if !defined(Q_OS_INTEGRITY) && !defined(Q_OS_WASM)
- struct passwd *pw = 0;
+ struct passwd *pw = nullptr;
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS)
struct passwd entry;
getpwuid_r(userId, &entry, buf.data(), buf.size(), &pw);
@@ -822,6 +810,8 @@ QString QFileSystemEngine::resolveUserName(uint userId)
#endif
if (pw)
return QFile::decodeName(QByteArray(pw->pw_name));
+#else // Integrity || WASM
+ Q_UNUSED(userId);
#endif
return QString();
}
@@ -837,7 +827,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
#endif
#if !defined(Q_OS_INTEGRITY) && !defined(Q_OS_WASM)
- struct group *gr = 0;
+ struct group *gr = nullptr;
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_OPENBSD) && !defined(Q_OS_VXWORKS) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID) && (__ANDROID_API__ >= 24))
size_max = sysconf(_SC_GETGR_R_SIZE_MAX);
if (size_max == -1)
@@ -859,6 +849,8 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
#endif
if (gr)
return QFile::decodeName(QByteArray(gr->gr_name));
+#else // Integrity || WASM
+ Q_UNUSED(groupId);
#endif
return QString();
}
@@ -883,8 +875,7 @@ QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(entry, false);
#if defined(Q_OS_DARWIN)
if (what & QFileSystemMetaData::BundleType) {
@@ -1153,8 +1144,7 @@ static bool createDirectoryWithParents(const QByteArray &nativeName, bool should
bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool createParents)
{
QString dirName = entry.filePath();
- if (Q_UNLIKELY(dirName.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(dirName, false);
// Darwin doesn't support trailing /'s, so remove for everyone
while (dirName.size() > 1 && dirName.endsWith(QLatin1Char('/')))
@@ -1173,8 +1163,7 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
//static
bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(entry, false);
if (removeEmptyParents) {
QString dirName = QDir::cleanPath(entry.filePath());
@@ -1199,8 +1188,9 @@ bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool remo
//static
bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
- if (Q_UNLIKELY(source.isEmpty() || target.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(source, false);
+ Q_CHECK_FILE_NAME(target, false);
+
if (::symlink(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)
return true;
error = QSystemError(errno, QSystemError::StandardLibraryError);
@@ -1229,8 +1219,9 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
{
QFileSystemEntry::NativePath srcPath = source.nativeFilePath();
QFileSystemEntry::NativePath tgtPath = target.nativeFilePath();
- if (Q_UNLIKELY(srcPath.isEmpty() || tgtPath.isEmpty()))
- return emptyFileEntryWarning(), false;
+
+ Q_CHECK_FILE_NAME(srcPath, false);
+ Q_CHECK_FILE_NAME(tgtPath, false);
#if defined(RENAME_NOREPLACE) && QT_CONFIG(renameat2)
if (renameat2(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_NOREPLACE) == 0)
@@ -1298,8 +1289,9 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
//static
bool QFileSystemEngine::renameOverwriteFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
- if (Q_UNLIKELY(source.isEmpty() || target.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(source, false);
+ Q_CHECK_FILE_NAME(target, false);
+
if (::rename(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)
return true;
error = QSystemError(errno, QSystemError::StandardLibraryError);
@@ -1309,8 +1301,7 @@ bool QFileSystemEngine::renameOverwriteFile(const QFileSystemEntry &source, cons
//static
bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &error)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(entry, false);
if (unlink(entry.nativeFilePath().constData()) == 0)
return true;
error = QSystemError(errno, QSystemError::StandardLibraryError);
@@ -1345,8 +1336,7 @@ static mode_t toMode_t(QFile::Permissions permissions)
//static
bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error, QFileSystemMetaData *data)
{
- if (Q_UNLIKELY(entry.isEmpty()))
- return emptyFileEntryWarning(), false;
+ Q_CHECK_FILE_NAME(entry, false);
mode_t mode = toMode_t(permissions);
bool success = ::chmod(entry.nativeFilePath().constData(), mode) == 0;
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 279918b812..ae29190848 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -461,7 +461,9 @@ void QFileSystemEngine::clearWinStatData(QFileSystemMetaData &data)
QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
QFileSystemMetaData &data)
{
- if (data.missingFlags(QFileSystemMetaData::LinkType))
+ Q_CHECK_FILE_NAME(link, link);
+
+ if (data.missingFlags(QFileSystemMetaData::LinkType))
QFileSystemEngine::fillMetaData(link, data, QFileSystemMetaData::LinkType);
QString target;
@@ -480,6 +482,8 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
//static
QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, QFileSystemMetaData &data)
{
+ Q_CHECK_FILE_NAME(entry, entry);
+
if (data.missingFlags(QFileSystemMetaData::ExistsAttribute))
QFileSystemEngine::fillMetaData(entry, data, QFileSystemMetaData::ExistsAttribute);
@@ -492,6 +496,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
//static
QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
{
+ Q_CHECK_FILE_NAME(path, QString());
+
// can be //server or //server/share
QString absPath;
QVarLengthArray<wchar_t, MAX_PATH> buf(qMax(MAX_PATH, path.size() + 1));
@@ -527,6 +533,8 @@ QString QFileSystemEngine::nativeAbsoluteFilePath(const QString &path)
//static
QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry)
{
+ Q_CHECK_FILE_NAME(entry, entry);
+
QString ret;
if (!entry.isRelative()) {
@@ -609,6 +617,8 @@ QByteArray fileIdWin8(HANDLE handle)
//static
QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry)
{
+ Q_CHECK_FILE_NAME(entry, QByteArray());
+
QByteArray result;
#ifndef Q_OS_WINRT
@@ -999,6 +1009,7 @@ static bool isDirPath(const QString &dirPath, bool *existed);
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what)
{
+ Q_CHECK_FILE_NAME(entry, false);
what |= QFileSystemMetaData::WinLnkType | QFileSystemMetaData::WinStatFlags;
data.entryFlags &= ~what;
@@ -1116,6 +1127,8 @@ static bool isDirPath(const QString &dirPath, bool *existed)
bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool createParents)
{
QString dirName = entry.filePath();
+ Q_CHECK_FILE_NAME(dirName, false);
+
if (createParents) {
dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
// We spefically search for / so \ would break it..
@@ -1177,6 +1190,8 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
bool QFileSystemEngine::removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents)
{
QString dirName = entry.filePath();
+ Q_CHECK_FILE_NAME(dirName, false);
+
if (removeEmptyParents) {
dirName = QDir::toNativeSeparators(QDir::cleanPath(dirName));
for (int oldslash = 0, slash=dirName.length(); slash > 0; oldslash = slash) {
@@ -1381,6 +1396,9 @@ bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSyst
//static
bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
+ Q_CHECK_FILE_NAME(source, false);
+ Q_CHECK_FILE_NAME(target, false);
+
#ifndef Q_OS_WINRT
bool ret = ::MoveFile((wchar_t*)source.nativeFilePath().utf16(),
(wchar_t*)target.nativeFilePath().utf16()) != 0;
@@ -1396,6 +1414,9 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy
//static
bool QFileSystemEngine::renameOverwriteFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
{
+ Q_CHECK_FILE_NAME(source, false);
+ Q_CHECK_FILE_NAME(target, false);
+
bool ret = ::MoveFileEx(reinterpret_cast<const wchar_t *>(source.nativeFilePath().utf16()),
reinterpret_cast<const wchar_t *>(target.nativeFilePath().utf16()),
MOVEFILE_REPLACE_EXISTING) != 0;
@@ -1407,6 +1428,8 @@ bool QFileSystemEngine::renameOverwriteFile(const QFileSystemEntry &source, cons
//static
bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &error)
{
+ Q_CHECK_FILE_NAME(entry, false);
+
bool ret = ::DeleteFile((wchar_t*)entry.nativeFilePath().utf16()) != 0;
if(!ret)
error = QSystemError(::GetLastError(), QSystemError::NativeError);
@@ -1417,6 +1440,8 @@ bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &
bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error,
QFileSystemMetaData *data)
{
+ Q_CHECK_FILE_NAME(entry, false);
+
Q_UNUSED(data);
int mode = 0;
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index 0d178d062a..74b7e820d9 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -93,15 +93,15 @@ static bool checkNameDecodable(const char *d_name, qsizetype len)
QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Filters filters,
const QStringList &nameFilters, QDirIterator::IteratorFlags flags)
: nativePath(entry.nativeFilePath())
- , dir(0)
- , dirEntry(0)
+ , dir(nullptr)
+ , dirEntry(nullptr)
, lastError(0)
{
Q_UNUSED(filters)
Q_UNUSED(nameFilters)
Q_UNUSED(flags)
- if ((dir = QT_OPENDIR(nativePath.constData())) == 0) {
+ if ((dir = QT_OPENDIR(nativePath.constData())) == nullptr) {
lastError = errno;
} else {
if (!nativePath.endsWith('/'))
diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h
index 4d2a5acb9b..81f4b3ba13 100644
--- a/src/corelib/io/qfilesystemmetadata_p.h
+++ b/src/corelib/io/qfilesystemmetadata_p.h
@@ -76,7 +76,7 @@ class Q_AUTOTEST_EXPORT QFileSystemMetaData
{
public:
QFileSystemMetaData()
- : knownFlagsMask(0),
+ : knownFlagsMask(nullptr),
size_(-1)
{
}
@@ -184,7 +184,7 @@ public:
void clear()
{
- knownFlagsMask = 0;
+ knownFlagsMask = nullptr;
}
void clearFlags(MetaDataFlags flags = AllMetaDataFlags)
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index f40e166d9f..54460aff77 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -41,13 +41,13 @@
#include "qfilesystemwatcher_p.h"
#include <qdatetime.h>
-#include <qdebug.h>
#include <qdir.h>
#include <qfileinfo.h>
+#include <qloggingcategory.h>
#include <qset.h>
#include <qtimer.h>
-#if defined(Q_OS_LINUX) || (defined(Q_OS_QNX) && !defined(QT_NO_INOTIFY))
+#if (defined(Q_OS_LINUX) || defined(Q_OS_QNX)) && QT_CONFIG(inotify)
#define USE_INOTIFY
#endif
@@ -67,6 +67,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcWatcher, "qt.core.filesystemwatcher")
+
QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject *parent)
{
#if defined(Q_OS_WIN)
@@ -137,6 +139,7 @@ void QFileSystemWatcherPrivate::initPollerEngine()
void QFileSystemWatcherPrivate::_q_fileChanged(const QString &path, bool removed)
{
Q_Q(QFileSystemWatcher);
+ qCDebug(lcWatcher) << "file changed" << path << "removed?" << removed << "watching?" << files.contains(path);
if (!files.contains(path)) {
// the path was removed after a change was detected, but before we delivered the signal
return;
@@ -149,6 +152,7 @@ void QFileSystemWatcherPrivate::_q_fileChanged(const QString &path, bool removed
void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool removed)
{
Q_Q(QFileSystemWatcher);
+ qCDebug(lcWatcher) << "directory changed" << path << "removed?" << removed << "watching?" << directories.contains(path);
if (!directories.contains(path)) {
// perhaps the path was removed after a change was detected, but before we delivered the signal
return;
@@ -311,6 +315,17 @@ bool QFileSystemWatcher::addPath(const QString &path)
return paths.isEmpty();
}
+static QStringList empty_paths_pruned(const QStringList &paths)
+{
+ QStringList p;
+ p.reserve(paths.size());
+ const auto isEmpty = [](const QString &s) { return s.isEmpty(); };
+ std::remove_copy_if(paths.begin(), paths.end(),
+ std::back_inserter(p),
+ isEmpty);
+ return p;
+}
+
/*!
Adds each path in \a paths to the file system watcher. Paths are
not added if they not exist, or if they are already being
@@ -338,47 +353,41 @@ QStringList QFileSystemWatcher::addPaths(const QStringList &paths)
{
Q_D(QFileSystemWatcher);
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
-
- while (it.hasNext()) {
- const QString &path = it.next();
- if (path.isEmpty())
- it.remove();
- }
+ QStringList p = empty_paths_pruned(paths);
if (p.isEmpty()) {
qWarning("QFileSystemWatcher::addPaths: list is empty");
- return QStringList();
+ return p;
}
-
- QFileSystemWatcherEngine *engine = 0;
-
- const QString on = objectName();
-
- if (!on.startsWith(QLatin1String("_qt_autotest_force_engine_"))) {
+ qCDebug(lcWatcher) << "adding" << paths;
+ const auto selectEngine = [this, d]() -> QFileSystemWatcherEngine* {
+#ifdef QT_BUILD_INTERNAL
+ const QString on = objectName();
+
+ if (Q_UNLIKELY(on.startsWith(QLatin1String("_qt_autotest_force_engine_")))) {
+ // Autotest override case - use the explicitly selected engine only
+ const QStringRef forceName = on.midRef(26);
+ if (forceName == QLatin1String("poller")) {
+ qCDebug(lcWatcher, "QFileSystemWatcher: skipping native engine, using only polling engine");
+ d_func()->initPollerEngine();
+ return d->poller;
+ } else if (forceName == QLatin1String("native")) {
+ qCDebug(lcWatcher, "QFileSystemWatcher: skipping polling engine, using only native engine");
+ return d->native;
+ }
+ return nullptr;
+ }
+#endif
// Normal runtime case - search intelligently for best engine
if(d->native) {
- engine = d->native;
+ return d->native;
} else {
d_func()->initPollerEngine();
- engine = d->poller;
+ return d->poller;
}
+ };
- } else {
- // Autotest override case - use the explicitly selected engine only
- const QStringRef forceName = on.midRef(26);
- if(forceName == QLatin1String("poller")) {
- qDebug("QFileSystemWatcher: skipping native engine, using only polling engine");
- d_func()->initPollerEngine();
- engine = d->poller;
- } else if(forceName == QLatin1String("native")) {
- qDebug("QFileSystemWatcher: skipping polling engine, using only native engine");
- engine = d->native;
- }
- }
-
- if(engine)
+ if (auto engine = selectEngine())
p = engine->addPaths(p, &d->files, &d->directories);
return p;
@@ -420,19 +429,13 @@ QStringList QFileSystemWatcher::removePaths(const QStringList &paths)
{
Q_D(QFileSystemWatcher);
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
-
- while (it.hasNext()) {
- const QString &path = it.next();
- if (path.isEmpty())
- it.remove();
- }
+ QStringList p = empty_paths_pruned(paths);
if (p.isEmpty()) {
qWarning("QFileSystemWatcher::removePaths: list is empty");
- return QStringList();
+ return p;
}
+ qCDebug(lcWatcher) << "removing" << paths;
if (d->native)
p = d->native->removePaths(p, &d->files, &d->directories);
@@ -448,6 +451,12 @@ QStringList QFileSystemWatcher::removePaths(const QStringList &paths)
This signal is emitted when the file at the specified \a path is
modified, renamed or removed from disk.
+ \note As a safety measure, many applications save an open file by
+ writing a new file and then deleting the old one. In your slot
+ function, you can check \c watcher.files().contains(path).
+ If it returns \c false, check whether the file still exists
+ and then call \c addPath() to continue watching it.
+
\sa directoryChanged()
*/
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm
index f594fad803..6194bf7c71 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.mm
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm
@@ -50,6 +50,7 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qvarlengtharray.h>
+#include <qscopeguard.h>
#undef FSEVENT_DEBUG
#ifdef FSEVENT_DEBUG
@@ -338,10 +339,10 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
bool needsRestart = false;
WatchingState oldState = watchingState;
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString origPath = it.next().normalized(QString::NormalizationForm_C);
+ QStringList unhandled;
+ for (const QString &path : paths) {
+ auto sg = qScopeGuard([&]{ unhandled.push_back(path); });
+ QString origPath = path.normalized(QString::NormalizationForm_C);
QString realPath = origPath;
if (realPath.endsWith(QDir::separator()))
realPath = realPath.mid(0, realPath.size() - 1);
@@ -362,17 +363,17 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
continue;
directories->append(origPath);
watchedPath = realPath;
- it.remove();
} else {
if (files->contains(origPath))
continue;
files->append(origPath);
- it.remove();
watchedPath = fi.path();
parentPath = watchedPath;
}
+ sg.dismiss();
+
for (PathRefCounts::const_iterator i = watchingState.watchedPaths.begin(),
ei = watchingState.watchedPaths.end(); i != ei; ++i) {
if (watchedPath.startsWith(i.key() % QDir::separator())) {
@@ -407,16 +408,16 @@ QStringList QFseventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
stopStream();
if (!startStream()) {
// ok, something went wrong, let's try to restore the previous state
- watchingState = qMove(oldState);
+ watchingState = std::move(oldState);
// and because we don't know which path caused the issue (if any), fail on all of them
- p = paths;
+ unhandled = paths;
if (wasRunning)
startStream();
}
}
- return p;
+ return unhandled;
}
QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &paths,
@@ -430,10 +431,9 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
bool needsRestart = false;
WatchingState oldState = watchingState;
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString origPath = it.next();
+ QStringList unhandled;
+ for (const QString &origPath : paths) {
+ auto sg = qScopeGuard([&]{ unhandled.push_back(origPath); });
QString realPath = origPath;
if (realPath.endsWith(QDir::separator()))
realPath = realPath.mid(0, realPath.size() - 1);
@@ -447,7 +447,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
needsRestart |= derefPath(dirIt->dirInfo.watchedPath);
watchingState.watchedDirectories.erase(dirIt);
directories->removeAll(origPath);
- it.remove();
+ sg.dismiss();
DEBUG("Removed directory '%s'", qPrintable(realPath));
}
} else {
@@ -463,7 +463,7 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
if (filesInDir.isEmpty())
watchingState.watchedFiles.erase(pIt);
files->removeAll(origPath);
- it.remove();
+ sg.dismiss();
DEBUG("Removed file '%s'", qPrintable(realPath));
}
}
@@ -474,12 +474,12 @@ QStringList QFseventsFileSystemWatcherEngine::removePaths(const QStringList &pat
if (needsRestart) {
if (!restartStream()) {
- watchingState = qMove(oldState);
+ watchingState = std::move(oldState);
startStream();
}
}
- return p;
+ return unhandled;
}
// Returns false if FSEventStream* calls failed for some mysterious reason, true if things got a
diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp
index a5e629b646..ca1f6cc359 100644
--- a/src/corelib/io/qfilesystemwatcher_inotify.cpp
+++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp
@@ -46,6 +46,7 @@
#include <qdebug.h>
#include <qfile.h>
#include <qfileinfo.h>
+#include <qscopeguard.h>
#include <qsocketnotifier.h>
#include <qvarlengtharray.h>
@@ -268,12 +269,11 @@ QStringList QInotifyFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
QFileInfo fi(path);
bool isDir = fi.isDir();
+ auto sg = qScopeGuard([&]{ unhandled.push_back(path); });
if (isDir) {
if (directories->contains(path))
continue;
@@ -305,7 +305,7 @@ QStringList QInotifyFileSystemWatcherEngine::addPaths(const QStringList &paths,
continue;
}
- it.remove();
+ sg.dismiss();
int id = isDir ? -wd : wd;
if (id < 0) {
@@ -318,19 +318,19 @@ QStringList QInotifyFileSystemWatcherEngine::addPaths(const QStringList &paths,
idToPath.insert(id, path);
}
- return p;
+ return unhandled;
}
QStringList QInotifyFileSystemWatcherEngine::removePaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
int id = pathToID.take(path);
+ auto sg = qScopeGuard([&]{ unhandled.push_back(path); });
+
// Multiple paths could be associated to the same watch descriptor
// when a file is moved and added with the new name.
// So we should find and delete the correct one by using
@@ -349,7 +349,8 @@ QStringList QInotifyFileSystemWatcherEngine::removePaths(const QStringList &path
inotify_rm_watch(inotifyFd, wd);
}
- it.remove();
+ sg.dismiss();
+
if (id < 0) {
directories->removeAll(path);
} else {
@@ -357,7 +358,7 @@ QStringList QInotifyFileSystemWatcherEngine::removePaths(const QStringList &path
}
}
- return p;
+ return unhandled;
}
void QInotifyFileSystemWatcherEngine::readFromInotify()
@@ -388,7 +389,7 @@ void QInotifyFileSystemWatcherEngine::readFromInotify()
const inotify_event &event = **it;
++it;
- // qDebug() << "inotify event, wd" << event.wd << "mask" << hex << event.mask;
+ // qDebug() << "inotify event, wd" << event.wd << "mask" << Qt::hex << event.mask;
int id = event.wd;
QString path = getPathFromID(id);
@@ -421,16 +422,27 @@ void QInotifyFileSystemWatcherEngine::readFromInotify()
}
}
-QString QInotifyFileSystemWatcherEngine::getPathFromID(int id) const
+template <typename Hash, typename Key>
+typename Hash::const_iterator
+find_last_in_equal_range(const Hash &c, const Key &key)
{
- QHash<int, QString>::const_iterator i = idToPath.find(id);
- while (i != idToPath.constEnd() && i.key() == id) {
- if ((i + 1) == idToPath.constEnd() || (i + 1).key() != id) {
- return i.value();
- }
+ // find c.equal_range(key).second - 1 without backwards iteration:
+ auto i = c.find(key);
+ const auto end = c.cend();
+ if (i == end)
+ return end;
+ decltype(i) prev;
+ do {
+ prev = i;
++i;
- }
- return QString();
+ } while (i != end && i.key() == key);
+ return prev;
+}
+
+QString QInotifyFileSystemWatcherEngine::getPathFromID(int id) const
+{
+ auto i = find_last_in_equal_range(idToPath, id);
+ return i == idToPath.cend() ? QString() : i.value() ;
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index 423b88cb7f..c2028e3641 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -45,6 +45,7 @@
#include <qdebug.h>
#include <qfile.h>
+#include <qscopeguard.h>
#include <qsocketnotifier.h>
#include <qvarlengtharray.h>
@@ -94,10 +95,9 @@ QStringList QKqueueFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
+ auto sg = qScopeGuard([&]{unhandled.push_back(path);});
int fd;
#if defined(O_EVTONLY)
fd = qt_safe_open(QFile::encodeName(path), O_EVTONLY);
@@ -149,7 +149,8 @@ QStringList QKqueueFileSystemWatcherEngine::addPaths(const QStringList &paths,
continue;
}
- it.remove();
+ sg.dismiss();
+
if (id < 0) {
DEBUG() << "QKqueueFileSystemWatcherEngine: added directory path" << path;
directories->append(path);
@@ -162,20 +163,19 @@ QStringList QKqueueFileSystemWatcherEngine::addPaths(const QStringList &paths,
idToPath.insert(id, path);
}
- return p;
+ return unhandled;
}
QStringList QKqueueFileSystemWatcherEngine::removePaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- QStringList p = paths;
if (pathToID.isEmpty())
- return p;
+ return paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
+ auto sg = qScopeGuard([&]{unhandled.push_back(path);});
int id = pathToID.take(path);
QString x = idToPath.take(id);
if (x.isEmpty() || x != path)
@@ -183,14 +183,15 @@ QStringList QKqueueFileSystemWatcherEngine::removePaths(const QStringList &paths
::close(id < 0 ? -id : id);
- it.remove();
+ sg.dismiss();
+
if (id < 0)
directories->removeAll(path);
else
files->removeAll(path);
}
- return p;
+ return unhandled;
}
void QKqueueFileSystemWatcherEngine::readFromKqueue()
diff --git a/src/corelib/io/qfilesystemwatcher_polling.cpp b/src/corelib/io/qfilesystemwatcher_polling.cpp
index 903c15f4a9..e07b02f7c2 100644
--- a/src/corelib/io/qfilesystemwatcher_polling.cpp
+++ b/src/corelib/io/qfilesystemwatcher_polling.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qfilesystemwatcher_polling_p.h"
+#include <QtCore/qscopeguard.h>
#include <QtCore/qtimer.h>
QT_BEGIN_NAMESPACE
@@ -53,10 +54,9 @@ QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
+ auto sg = qScopeGuard([&]{ unhandled.push_back(path); });
QFileInfo fi(path);
if (!fi.exists())
continue;
@@ -73,7 +73,7 @@ QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,
files->append(path);
this->files.insert(path, fi);
}
- it.remove();
+ sg.dismiss();
}
if ((!this->files.isEmpty() ||
@@ -82,23 +82,21 @@ QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,
timer.start(PollingInterval);
}
- return p;
+ return unhandled;
}
QStringList QPollingFileSystemWatcherEngine::removePaths(const QStringList &paths,
QStringList *files,
QStringList *directories)
{
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
if (this->directories.remove(path)) {
directories->removeAll(path);
- it.remove();
} else if (this->files.remove(path)) {
files->removeAll(path);
- it.remove();
+ } else {
+ unhandled.push_back(path);
}
}
@@ -107,38 +105,37 @@ QStringList QPollingFileSystemWatcherEngine::removePaths(const QStringList &path
timer.stop();
}
- return p;
+ return unhandled;
}
void QPollingFileSystemWatcherEngine::timeout()
{
- QMutableHashIterator<QString, FileInfo> fit(files);
- while (fit.hasNext()) {
- QHash<QString, FileInfo>::iterator x = fit.next();
+ for (auto it = files.begin(), end = files.end(); it != end; /*erasing*/) {
+ auto x = it++;
QString path = x.key();
QFileInfo fi(path);
if (!fi.exists()) {
- fit.remove();
+ files.erase(x);
emit fileChanged(path, true);
} else if (x.value() != fi) {
x.value() = fi;
emit fileChanged(path, false);
}
}
- QMutableHashIterator<QString, FileInfo> dit(directories);
- while (dit.hasNext()) {
- QHash<QString, FileInfo>::iterator x = dit.next();
+
+ for (auto it = directories.begin(), end = directories.end(); it != end; /*erasing*/) {
+ auto x = it++;
QString path = x.key();
QFileInfo fi(path);
if (!path.endsWith(QLatin1Char('/')))
fi = QFileInfo(path + QLatin1Char('/'));
if (!fi.exists()) {
- dit.remove();
+ directories.erase(x);
emit directoryChanged(path, true);
} else if (x.value() != fi) {
fi.refresh();
if (!fi.exists()) {
- dit.remove();
+ directories.erase(x);
emit directoryChanged(path, true);
} else {
x.value() = fi;
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index 66985f8982..5f91ce5e3d 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -44,9 +44,11 @@
#include <qfileinfo.h>
#include <qstringlist.h>
#include <qset.h>
+#include <qscopeguard.h>
#include <qdatetime.h>
#include <qdir.h>
#include <qtextstream.h>
+#include <private/qlocking_p.h>
#include <qt_windows.h>
@@ -79,7 +81,7 @@ static Qt::HANDLE createChangeNotification(const QString &path, uint flags)
nativePath.append(QLatin1Char('\\'));
const HANDLE result = FindFirstChangeNotification(reinterpret_cast<const wchar_t *>(nativePath.utf16()),
FALSE, flags);
- DEBUG() << __FUNCTION__ << nativePath << hex <<showbase << flags << "returns" << result;
+ DEBUG() << __FUNCTION__ << nativePath << Qt::hex <<showbase << flags << "returns" << result;
return result;
}
@@ -108,7 +110,11 @@ public:
// Call from QFileSystemWatcher::addPaths() to set up notifications on drives
void addPath(const QString &path);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEventFilter(const QByteArray &, void *messageIn, qintptr *) override;
+#else
bool nativeEventFilter(const QByteArray &, void *messageIn, long *) override;
+#endif
signals:
void driveAdded();
@@ -255,7 +261,11 @@ inline void QWindowsRemovableDriveListener::handleDbtDriveArrivalRemoval(const M
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QWindowsRemovableDriveListener::nativeEventFilter(const QByteArray &, void *messageIn, qintptr *)
+#else
bool QWindowsRemovableDriveListener::nativeEventFilter(const QByteArray &, void *messageIn, long *)
+#endif
{
const MSG *msg = reinterpret_cast<const MSG *>(messageIn);
if (msg->message == WM_DEVICECHANGE) {
@@ -297,8 +307,7 @@ void QWindowsRemovableDriveListener::addPath(const QString &p)
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, // Volume requires BACKUP_SEMANTICS
0);
if (volumeHandle == INVALID_HANDLE_VALUE) {
- qErrnoWarning("CreateFile %s failed.",
- qPrintable(QString::fromWCharArray(devicePath)));
+ qErrnoWarning("CreateFile %ls failed.", devicePath);
return;
}
@@ -315,8 +324,7 @@ void QWindowsRemovableDriveListener::addPath(const QString &p)
// closed. Do it here to avoid having to close/reopen in lock message handling.
CloseHandle(volumeHandle);
if (!re.devNotify) {
- qErrnoWarning("RegisterDeviceNotification %s failed.",
- qPrintable(QString::fromWCharArray(devicePath)));
+ qErrnoWarning("RegisterDeviceNotification %ls failed.", devicePath);
return;
}
@@ -369,10 +377,9 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
QStringList *directories)
{
DEBUG() << "Adding" << paths.count() << "to existing" << (files->count() + directories->count()) << "watchers";
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
+ auto sg = qScopeGuard([&] { unhandled.push_back(path); });
QString normalPath = path;
if ((normalPath.endsWith(QLatin1Char('/')) && !normalPath.endsWith(QLatin1String(":/")))
|| (normalPath.endsWith(QLatin1Char('\\')) && !normalPath.endsWith(QLatin1String(":\\")))) {
@@ -417,14 +424,14 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
end = threads.constEnd();
for(jt = threads.constBegin(); jt != end; ++jt) {
thread = *jt;
- QMutexLocker locker(&(thread->mutex));
+ const auto locker = qt_scoped_lock(thread->mutex);
const auto hit = thread->handleForDir.find(QFileSystemWatcherPathKey(absolutePath));
if (hit != thread->handleForDir.end() && hit.value().flags < flags) {
// Requesting to add a file whose directory has been added previously.
// Recreate the notification handle to add the missing notification attributes
// for files (FILE_NOTIFY_CHANGE_ATTRIBUTES...)
- DEBUG() << "recreating" << absolutePath << hex << showbase << hit.value().flags
+ DEBUG() << "recreating" << absolutePath << Qt::hex << Qt::showbase << hit.value().flags
<< "->" << flags;
const Qt::HANDLE fileHandle = createChangeNotification(absolutePath, flags);
if (fileHandle != INVALID_HANDLE_VALUE) {
@@ -455,7 +462,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
else
files->append(path);
}
- it.remove();
+ sg.dismiss();
thread->wakeup();
break;
}
@@ -472,7 +479,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
// now look for a thread to insert
bool found = false;
for (QWindowsFileSystemWatcherEngineThread *thread : qAsConst(threads)) {
- QMutexLocker locker(&(thread->mutex));
+ const auto locker = qt_scoped_lock(thread->mutex);
if (thread->handles.count() < MAXIMUM_WAIT_OBJECTS) {
DEBUG() << "Added handle" << handle.handle << "for" << absolutePath << "to watch" << fileInfo.absoluteFilePath()
<< "to existing thread " << thread;
@@ -485,7 +492,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
else
files->append(path);
- it.remove();
+ sg.dismiss();
found = true;
thread->wakeup();
break;
@@ -511,7 +518,7 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
thread->msg = '@';
thread->start();
threads.append(thread);
- it.remove();
+ sg.dismiss();
}
}
}
@@ -519,12 +526,12 @@ QStringList QWindowsFileSystemWatcherEngine::addPaths(const QStringList &paths,
#ifndef Q_OS_WINRT
if (Q_LIKELY(m_driveListener)) {
for (const QString &path : paths) {
- if (!p.contains(path))
+ if (!unhandled.contains(path))
m_driveListener->addPath(path);
}
}
#endif // !Q_OS_WINRT
- return p;
+ return unhandled;
}
QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &paths,
@@ -532,10 +539,9 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
QStringList *directories)
{
DEBUG() << "removePaths" << paths;
- QStringList p = paths;
- QMutableListIterator<QString> it(p);
- while (it.hasNext()) {
- QString path = it.next();
+ QStringList unhandled;
+ for (const QString &path : paths) {
+ auto sg = qScopeGuard([&] { unhandled.push_back(path); });
QString normalPath = path;
if (normalPath.endsWith(QLatin1Char('/')) || normalPath.endsWith(QLatin1Char('\\')))
normalPath.chop(1);
@@ -549,7 +555,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
if (*jt == 0)
continue;
- QMutexLocker locker(&(thread->mutex));
+ auto locker = qt_unique_lock(thread->mutex);
QWindowsFileSystemWatcherEngine::Handle handle = thread->handleForDir.value(QFileSystemWatcherPathKey(absolutePath));
if (handle.handle == INVALID_HANDLE_VALUE) {
@@ -564,7 +570,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
// ###
files->removeAll(path);
directories->removeAll(path);
- it.remove();
+ sg.dismiss();
if (h.isEmpty()) {
DEBUG() << "Closing handle" << handle.handle;
@@ -582,7 +588,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
locker.unlock();
thread->stop();
thread->wait();
- locker.relock();
+ locker.lock();
// We can't delete the thread until the mutex locker is
// out of scope
}
@@ -605,7 +611,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
}
threads.removeAll(0);
- return p;
+ return unhandled;
}
///////////
@@ -634,26 +640,26 @@ QWindowsFileSystemWatcherEngineThread::~QWindowsFileSystemWatcherEngineThread()
}
}
-static inline QString msgFindNextFailed(const QWindowsFileSystemWatcherEngineThread::PathInfoHash &pathInfos)
+Q_DECL_COLD_FUNCTION
+static QString msgFindNextFailed(const QWindowsFileSystemWatcherEngineThread::PathInfoHash &pathInfos)
{
- QString result;
- QTextStream str(&result);
- str << "QFileSystemWatcher: FindNextChangeNotification failed for";
+ QString str;
+ str += QLatin1String("QFileSystemWatcher: FindNextChangeNotification failed for");
for (const QWindowsFileSystemWatcherEngine::PathInfo &pathInfo : pathInfos)
- str << " \"" << QDir::toNativeSeparators(pathInfo.absolutePath) << '"';
- str << ' ';
- return result;
+ str += QLatin1String(" \"") + QDir::toNativeSeparators(pathInfo.absolutePath) + QLatin1Char('"');
+ str += QLatin1Char(' ');
+ return str;
}
void QWindowsFileSystemWatcherEngineThread::run()
{
- QMutexLocker locker(&mutex);
+ auto locker = qt_unique_lock(mutex);
forever {
QVector<HANDLE> handlesCopy = handles;
locker.unlock();
DEBUG() << "QWindowsFileSystemWatcherThread" << this << "waiting on" << handlesCopy.count() << "handles";
DWORD r = WaitForMultipleObjects(handlesCopy.count(), handlesCopy.constData(), false, INFINITE);
- locker.relock();
+ locker.lock();
do {
if (r == WAIT_OBJECT_0) {
int m = msg;
@@ -688,11 +694,10 @@ void QWindowsFileSystemWatcherEngineThread::run()
fakeRemove = true;
}
- qErrnoWarning(error, "%s", qPrintable(msgFindNextFailed(h)));
+ qErrnoWarning(error, "%ls", qUtf16Printable(msgFindNextFailed(h)));
}
- QMutableHashIterator<QFileSystemWatcherPathKey, QWindowsFileSystemWatcherEngine::PathInfo> it(h);
- while (it.hasNext()) {
- QWindowsFileSystemWatcherEngineThread::PathInfoHash::iterator x = it.next();
+ for (auto it = h.begin(), end = h.end(); it != end; /*erasing*/ ) {
+ auto x = it++;
QString absolutePath = x.value().absolutePath;
QFileInfo fileInfo(x.value().path);
DEBUG() << "checking" << x.key();
@@ -718,6 +723,7 @@ void QWindowsFileSystemWatcherEngineThread::run()
handleForDir.remove(QFileSystemWatcherPathKey(absolutePath));
// h is now invalid
+ break;
}
} else if (x.value().isDir) {
DEBUG() << x.key() << "directory changed!";
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 5d3bef9e70..0d73839f8d 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -127,7 +127,7 @@ void QFSFileEnginePrivate::init()
is_link = 0;
openMode = QIODevice::NotOpen;
fd = -1;
- fh = 0;
+ fh = nullptr;
lastIOCommand = IOFlushCommand;
lastFlushFailed = false;
closeFileHandle = false;
@@ -247,7 +247,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode)
d->openMode = res.openMode;
d->lastFlushFailed = false;
d->tried_stat = 0;
- d->fh = 0;
+ d->fh = nullptr;
d->fd = -1;
return d->nativeOpen(d->openMode);
@@ -309,7 +309,7 @@ bool QFSFileEnginePrivate::openFh(QIODevice::OpenMode openMode, FILE *fh)
QSystemError::stdString());
this->openMode = QIODevice::NotOpen;
- this->fh = 0;
+ this->fh = nullptr;
return false;
}
@@ -341,7 +341,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode, int fd, QFile::FileHandle
d->lastFlushFailed = false;
d->closeFileHandle = (handleFlags & QFile::AutoCloseHandle);
d->fileEntry.clear();
- d->fh = 0;
+ d->fh = nullptr;
d->fd = -1;
d->tried_stat = 0;
@@ -357,7 +357,7 @@ bool QFSFileEnginePrivate::openFd(QIODevice::OpenMode openMode, int fd)
{
Q_Q(QFSFileEngine);
this->fd = fd;
- fh = 0;
+ fh = nullptr;
// Seek to the end when in Append mode.
if (openMode & QFile::Append) {
@@ -418,7 +418,7 @@ bool QFSFileEnginePrivate::closeFdFh()
// We must reset these guys regardless; calling close again after a
// failed close causes crashes on some systems.
- fh = 0;
+ fh = nullptr;
fd = -1;
closed = (ret == 0);
}
@@ -835,7 +835,7 @@ QAbstractFileEngine::Iterator *QFSFileEngine::beginEntryList(QDir::Filters filte
*/
QAbstractFileEngine::Iterator *QFSFileEngine::endEntryList()
{
- return 0;
+ return nullptr;
}
#endif // QT_NO_FILESYSTEMITERATOR
@@ -883,7 +883,7 @@ bool QFSFileEngine::extension(Extension extension, const ExtensionOption *option
const MapExtensionOption *options = (const MapExtensionOption*)(option);
MapExtensionReturn *returnValue = static_cast<MapExtensionReturn*>(output);
returnValue->address = d->map(options->offset, options->size, options->flags);
- return (returnValue->address != 0);
+ return (returnValue->address != nullptr);
}
if (extension == UnMapExtension) {
const UnMapExtensionOption *options = (const UnMapExtensionOption*)option;
diff --git a/src/corelib/io/qfsfileengine_p.h b/src/corelib/io/qfsfileengine_p.h
index 22109ac5bc..639c01571a 100644
--- a/src/corelib/io/qfsfileengine_p.h
+++ b/src/corelib/io/qfsfileengine_p.h
@@ -122,7 +122,7 @@ public:
virtual bool isUnnamedFile() const
{ return false; }
- bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) override;
+ bool extension(Extension extension, const ExtensionOption *option = nullptr, ExtensionReturn *output = nullptr) override;
bool supportsExtension(Extension extension) const override;
//FS only!!
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 90ad0126d6..d4983c72af 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -153,7 +153,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
}
}
- fh = 0;
+ fh = nullptr;
}
closeFileHandle = true;
@@ -451,14 +451,14 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
if (type & Refresh)
d->metaData.clear();
- QAbstractFileEngine::FileFlags ret = 0;
+ QAbstractFileEngine::FileFlags ret = { };
if (type & FlagsMask)
ret |= LocalDiskFlag;
bool exists;
{
- QFileSystemMetaData::MetaDataFlags queryFlags = 0;
+ QFileSystemMetaData::MetaDataFlags queryFlags = { };
queryFlags |= QFileSystemMetaData::MetaDataFlags(uint(type))
& QFileSystemMetaData::Permissions;
@@ -590,9 +590,9 @@ bool QFSFileEngine::setPermissions(uint perms)
QSystemError error;
bool ok;
if (d->fd != -1)
- ok = QFileSystemEngine::setPermissions(d->fd, QFile::Permissions(perms), error, 0);
+ ok = QFileSystemEngine::setPermissions(d->fd, QFile::Permissions(perms), error);
else
- ok = QFileSystemEngine::setPermissions(d->fileEntry, QFile::Permissions(perms), error, 0);
+ ok = QFileSystemEngine::setPermissions(d->fileEntry, QFile::Permissions(perms), error);
if (!ok) {
setError(QFile::PermissionsError, error.toString());
return false;
@@ -651,13 +651,13 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
Q_Q(QFSFileEngine);
if (openMode == QIODevice::NotOpen) {
q->setError(QFile::PermissionsError, qt_error_string(int(EACCES)));
- return 0;
+ return nullptr;
}
if (offset < 0 || offset > maxFileOffset
|| size < 0 || quint64(size) > quint64(size_t(-1))) {
q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL)));
- return 0;
+ return nullptr;
}
// If we know the mapping will extend beyond EOF, fail early to avoid
@@ -685,14 +685,14 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
if (quint64(size + extra) > quint64((size_t)-1)) {
q->setError(QFile::UnspecifiedError, qt_error_string(int(EINVAL)));
- return 0;
+ return nullptr;
}
size_t realSize = (size_t)size + extra;
QT_OFF_T realOffset = QT_OFF_T(offset);
realOffset &= ~(QT_OFF_T(pageSize - 1));
- void *mapAddress = QT_MMAP((void*)0, realSize,
+ void *mapAddress = QT_MMAP((void*)nullptr, realSize,
access, sharemode, nativeHandle(), realOffset);
if (MAP_FAILED != mapAddress) {
uchar *address = extra + static_cast<uchar*>(mapAddress);
@@ -714,7 +714,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
q->setError(QFile::UnspecifiedError, qt_error_string(int(errno)));
break;
}
- return 0;
+ return nullptr;
}
bool QFSFileEnginePrivate::unmap(uchar *ptr)
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 74df0f71ef..e26508e631 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -169,7 +169,7 @@ QIODevicePrivate::QIODevicePrivate()
, baseReadLineDataCalled(false)
, accessMode(Unset)
#ifdef QT_NO_QOBJECT
- , q_ptr(0)
+ , q_ptr(nullptr)
#endif
{
}
diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp
index 039e291b43..ddc5b6607f 100644
--- a/src/corelib/io/qipaddress.cpp
+++ b/src/corelib/io/qipaddress.cpp
@@ -67,7 +67,7 @@ static const QChar *checkedToAscii(Buffer &buffer, const QChar *begin, const QCh
*dst++ = *src++;
}
*dst = '\0';
- return 0;
+ return nullptr;
}
static bool parseIp4Internal(IPv4Address &address, const char *ptr, bool acceptLeadingZero);
@@ -175,7 +175,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end
memset(address, 0, sizeof address);
if (colonCount == 2 && end - begin == 2) // "::"
- return 0;
+ return nullptr;
// if there's a double colon ("::"), this is how many zeroes it means
int zeroWordsToFill;
@@ -236,7 +236,7 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end
address[13] = ip4 >> 16;
address[14] = ip4 >> 8;
address[15] = ip4;
- return 0;
+ return nullptr;
}
address[pos++] = x >> 8;
@@ -248,15 +248,15 @@ const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end
return begin + (endptr - buffer.data());
ptr = endptr + 1;
}
- return pos == 16 ? 0 : end;
+ return pos == 16 ? nullptr : end;
}
static inline QChar toHex(uchar c)
{
- return QtMiscUtils::toHexLower(c);
+ return QChar::fromLatin1(QtMiscUtils::toHexLower(c));
}
-void toString(QString &appendTo, IPv6Address address)
+void toString(QString &appendTo, const IPv6Address address)
{
// the longest IPv6 address possible is:
// "1111:2222:3333:4444:5555:6666:255.255.255.255"
@@ -312,7 +312,7 @@ void toString(QString &appendTo, IPv6Address address)
}
}
- const QChar colon = ushort(':');
+ const QChar colon = u':';
if (zeroRunLength < 4)
zeroRunOffset = -1;
else if (zeroRunOffset == 0)
diff --git a/src/corelib/io/qipaddress_p.h b/src/corelib/io/qipaddress_p.h
index d95cccb3bd..ea31e5883d 100644
--- a/src/corelib/io/qipaddress_p.h
+++ b/src/corelib/io/qipaddress_p.h
@@ -64,7 +64,7 @@ typedef quint8 IPv6Address[16];
Q_CORE_EXPORT bool parseIp4(IPv4Address &address, const QChar *begin, const QChar *end);
Q_CORE_EXPORT const QChar *parseIp6(IPv6Address &address, const QChar *begin, const QChar *end);
Q_CORE_EXPORT void toString(QString &appendTo, IPv4Address address);
-Q_CORE_EXPORT void toString(QString &appendTo, IPv6Address address);
+Q_CORE_EXPORT void toString(QString &appendTo, const IPv6Address address);
} // namespace
diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
index 418b7d22ba..b2bf77c0da 100644
--- a/src/corelib/io/qlockfile_unix.cpp
+++ b/src/corelib/io/qlockfile_unix.cpp
@@ -58,6 +58,11 @@
#include <sys/file.h> // flock
#endif
+#if defined(Q_OS_RTEMS)
+# undef LOCK_EX
+# undef LOCK_NB
+#endif
+
#include <sys/types.h> // kill
#include <signal.h> // kill
#include <unistd.h> // gethostname
@@ -169,7 +174,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys()
if (qt_write_loop(fd, fileData.constData(), fileData.size()) < fileData.size()) {
qt_safe_close(fd);
if (!QFile::remove(fileName))
- qWarning("QLockFile: Could not remove our own lock file %s.", qPrintable(fileName));
+ qWarning("QLockFile: Could not remove our own lock file %ls.", qUtf16Printable(fileName));
return QLockFile::UnknownError; // partition full
}
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index 4a83780234..5de8be116c 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -205,8 +205,8 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift)
\note \a category must be kept valid during the lifetime of this object.
*/
QLoggingCategory::QLoggingCategory(const char *category)
- : d(0),
- name(0)
+ : d(nullptr),
+ name(nullptr)
{
init(category, QtDebugMsg);
}
@@ -222,15 +222,15 @@ QLoggingCategory::QLoggingCategory(const char *category)
\since 5.4
*/
QLoggingCategory::QLoggingCategory(const char *category, QtMsgType enableForLevel)
- : d(0),
- name(0)
+ : d(nullptr),
+ name(nullptr)
{
init(category, enableForLevel);
}
void QLoggingCategory::init(const char *category, QtMsgType severityLevel)
{
- enabled.store(0x01010101); // enabledDebug = enabledWarning = enabledCritical = true;
+ enabled.storeRelaxed(0x01010101); // enabledDebug = enabledWarning = enabledCritical = true;
if (category)
name = category;
@@ -333,10 +333,10 @@ void QLoggingCategory::setEnabled(QtMsgType type, bool enable)
{
switch (type) {
#ifdef Q_ATOMIC_INT8_IS_SUPPORTED
- case QtDebugMsg: bools.enabledDebug.store(enable); break;
- case QtInfoMsg: bools.enabledInfo.store(enable); break;
- case QtWarningMsg: bools.enabledWarning.store(enable); break;
- case QtCriticalMsg: bools.enabledCritical.store(enable); break;
+ case QtDebugMsg: bools.enabledDebug.storeRelaxed(enable); break;
+ case QtInfoMsg: bools.enabledInfo.storeRelaxed(enable); break;
+ case QtWarningMsg: bools.enabledWarning.storeRelaxed(enable); break;
+ case QtCriticalMsg: bools.enabledCritical.storeRelaxed(enable); break;
#else
case QtDebugMsg: setBoolLane(&enabled, enable, DebugShift); break;
case QtInfoMsg: setBoolLane(&enabled, enable, InfoShift); break;
diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h
index 91e3144300..1c3e10b493 100644
--- a/src/corelib/io/qloggingcategory.h
+++ b/src/corelib/io/qloggingcategory.h
@@ -58,15 +58,15 @@ public:
void setEnabled(QtMsgType type, bool enable);
#ifdef Q_ATOMIC_INT8_IS_SUPPORTED
- bool isDebugEnabled() const { return bools.enabledDebug.load(); }
- bool isInfoEnabled() const { return bools.enabledInfo.load(); }
- bool isWarningEnabled() const { return bools.enabledWarning.load(); }
- bool isCriticalEnabled() const { return bools.enabledCritical.load(); }
+ bool isDebugEnabled() const { return bools.enabledDebug.loadRelaxed(); }
+ bool isInfoEnabled() const { return bools.enabledInfo.loadRelaxed(); }
+ bool isWarningEnabled() const { return bools.enabledWarning.loadRelaxed(); }
+ bool isCriticalEnabled() const { return bools.enabledCritical.loadRelaxed(); }
#else
- bool isDebugEnabled() const { return enabled.load() >> DebugShift & 1; }
- bool isInfoEnabled() const { return enabled.load() >> InfoShift & 1; }
- bool isWarningEnabled() const { return enabled.load() >> WarningShift & 1; }
- bool isCriticalEnabled() const { return enabled.load() >> CriticalShift & 1; }
+ bool isDebugEnabled() const { return enabled.loadRelaxed() >> DebugShift & 1; }
+ bool isInfoEnabled() const { return enabled.loadRelaxed() >> InfoShift & 1; }
+ bool isWarningEnabled() const { return enabled.loadRelaxed() >> WarningShift & 1; }
+ bool isCriticalEnabled() const { return enabled.loadRelaxed() >> CriticalShift & 1; }
#endif
const char *categoryName() const { return name; }
@@ -111,8 +111,6 @@ private:
#define Q_DECLARE_LOGGING_CATEGORY(name) \
extern const QLoggingCategory &name();
-#if defined(Q_COMPILER_VARIADIC_MACROS) || defined(Q_MOC_RUN)
-
#define Q_LOGGING_CATEGORY(name, ...) \
const QLoggingCategory &name() \
{ \
@@ -148,39 +146,6 @@ private:
for (bool qt_category_enabled = category().isCriticalEnabled(); qt_category_enabled; qt_category_enabled = false) \
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).critical(__VA_ARGS__)
-#else // defined(Q_COMPILER_VARIADIC_MACROS) || defined(Q_MOC_RUN)
-
-// Optional msgType argument not supported
-#define Q_LOGGING_CATEGORY(name, string) \
- const QLoggingCategory &name() \
- { \
- static const QLoggingCategory category(string); \
- return category; \
- }
-
-// check for enabled category inside QMessageLogger.
-#if !defined(QT_NO_DEBUG_OUTPUT)
-# define qCDebug qDebug
-#else
-# define qCDebug(category) QT_NO_QDEBUG_MACRO()
-#endif
-
-#if !defined(QT_NO_INFO_OUTPUT)
-# define qCInfo qInfo
-#else
-# define qCInfo(category) QT_NO_QDEBUG_MACRO()
-#endif
-
-#if !defined(QT_NO_WARNING_OUTPUT)
-# define qCWarning qWarning
-#else
-# define qCWarning(category) QT_NO_QDEBUG_MACRO()
-#endif
-
-#define qCCritical qCritical
-
-#endif // Q_COMPILER_VARIADIC_MACROS || defined(Q_MOC_RUN)
-
QT_END_NAMESPACE
#endif // QLOGGINGCATEGORY_H
diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp
index 9792d956cc..e8eb18b4c1 100644
--- a/src/corelib/io/qloggingregistry.cpp
+++ b/src/corelib/io/qloggingregistry.cpp
@@ -41,6 +41,7 @@
#include <QtCore/qfile.h>
#include <QtCore/qlibraryinfo.h>
+#include <QtCore/private/qlocking_p.h>
#include <QtCore/qstandardpaths.h>
#include <QtCore/qtextstream.h>
#include <QtCore/qdir.h>
@@ -165,7 +166,7 @@ void QLoggingRule::parse(const QStringRef &pattern)
p = QStringRef(p.string(), p.position() + 1, p.length() - 1);
}
if (p.contains(QLatin1Char('*'))) // '*' only supported at start/end
- flags = 0;
+ flags = PatternFlags();
}
category = p.toString();
@@ -356,7 +357,7 @@ void QLoggingRegistry::initializeRules()
*/
void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableForLevel)
{
- QMutexLocker locker(&registryMutex);
+ const auto locker = qt_scoped_lock(registryMutex);
if (!categories.contains(cat)) {
categories.insert(cat, enableForLevel);
@@ -370,7 +371,7 @@ void QLoggingRegistry::registerCategory(QLoggingCategory *cat, QtMsgType enableF
*/
void QLoggingRegistry::unregisterCategory(QLoggingCategory *cat)
{
- QMutexLocker locker(&registryMutex);
+ const auto locker = qt_scoped_lock(registryMutex);
categories.remove(cat);
}
@@ -413,9 +414,9 @@ void QLoggingRegistry::updateRules()
QLoggingCategory::CategoryFilter
QLoggingRegistry::installFilter(QLoggingCategory::CategoryFilter filter)
{
- QMutexLocker locker(&registryMutex);
+ const auto locker = qt_scoped_lock(registryMutex);
- if (filter == 0)
+ if (!filter)
filter = defaultCategoryFilter;
QLoggingCategory::CategoryFilter old = categoryFilter;
diff --git a/src/corelib/io/qnoncontiguousbytedevice.cpp b/src/corelib/io/qnoncontiguousbytedevice.cpp
index beca6ccbf7..d1806aa12b 100644
--- a/src/corelib/io/qnoncontiguousbytedevice.cpp
+++ b/src/corelib/io/qnoncontiguousbytedevice.cpp
@@ -534,7 +534,7 @@ QNonContiguousByteDevice* QNonContiguousByteDeviceFactory::create(QSharedPointer
*/
QSharedPointer<QNonContiguousByteDevice> QNonContiguousByteDeviceFactory::createShared(QSharedPointer<QRingBuffer> ringBuffer)
{
- return QSharedPointer<QNonContiguousByteDeviceRingBufferImpl>::create(qMove(ringBuffer));
+ return QSharedPointer<QNonContiguousByteDeviceRingBufferImpl>::create(std::move(ringBuffer));
}
/*!
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 9557a1d24b..35ca2542f7 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -42,6 +42,7 @@
#include <qdebug.h>
#include <qdir.h>
+#include <qscopedvaluerollback.h>
#if defined(Q_OS_WIN)
#include <qtimer.h>
#endif
@@ -201,6 +202,7 @@ void QProcessEnvironmentPrivate::insert(const QProcessEnvironmentPrivate &other)
vars.insert(it.key(), it.value());
#ifdef Q_OS_UNIX
+ const OrderedNameMapMutexLocker locker(this, &other);
auto nit = other.nameMap.constBegin();
const auto nend = other.nameMap.constEnd();
for ( ; nit != nend; ++nit)
@@ -274,7 +276,6 @@ bool QProcessEnvironment::operator==(const QProcessEnvironment &other) const
return true;
if (d) {
if (other.d) {
- QProcessEnvironmentPrivate::OrderedMutexLocker locker(d, other.d);
return d->vars == other.d->vars;
} else {
return isEmpty();
@@ -321,7 +322,6 @@ bool QProcessEnvironment::contains(const QString &name) const
{
if (!d)
return false;
- QProcessEnvironmentPrivate::MutexLocker locker(d);
return d->vars.contains(d->prepareName(name));
}
@@ -372,7 +372,6 @@ QString QProcessEnvironment::value(const QString &name, const QString &defaultVa
if (!d)
return defaultValue;
- QProcessEnvironmentPrivate::MutexLocker locker(d);
const auto it = d->vars.constFind(d->prepareName(name));
if (it == d->vars.constEnd())
return defaultValue;
@@ -397,7 +396,6 @@ QStringList QProcessEnvironment::toStringList() const
{
if (!d)
return QStringList();
- QProcessEnvironmentPrivate::MutexLocker locker(d);
return d->toList();
}
@@ -411,7 +409,6 @@ QStringList QProcessEnvironment::keys() const
{
if (!d)
return QStringList();
- QProcessEnvironmentPrivate::MutexLocker locker(d);
return d->keys();
}
@@ -428,7 +425,6 @@ void QProcessEnvironment::insert(const QProcessEnvironment &e)
return;
// our re-impl of detach() detaches from null
- QProcessEnvironmentPrivate::MutexLocker locker(e.d);
d->insert(*e.d);
}
@@ -1068,9 +1064,8 @@ bool QProcessPrivate::tryReadFromChannel(Channel *channel)
if (currentReadChannel == channelIdx) {
didRead = true;
if (!emittedReadyRead) {
- emittedReadyRead = true;
+ QScopedValueRollback<bool> guard(emittedReadyRead, true);
emit q->readyRead();
- emittedReadyRead = false;
}
}
emit q->channelReadyRead(int(channelIdx));
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index a2e3c01f7c..585508adf1 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -72,12 +72,10 @@ public:
QProcessEnvironment();
QProcessEnvironment(const QProcessEnvironment &other);
~QProcessEnvironment();
-#ifdef Q_COMPILER_RVALUE_REFS
- QProcessEnvironment &operator=(QProcessEnvironment && other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QProcessEnvironment &operator=(QProcessEnvironment && other) noexcept { swap(other); return *this; }
QProcessEnvironment &operator=(const QProcessEnvironment &other);
- void swap(QProcessEnvironment &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QProcessEnvironment &other) noexcept { qSwap(d, other.d); }
bool operator==(const QProcessEnvironment &other) const;
inline bool operator!=(const QProcessEnvironment &other) const
@@ -280,7 +278,8 @@ Q_SIGNALS:
void finished(int exitCode); // ### Qt 6: merge the two signals with a default value
#endif
void finished(int exitCode, QProcess::ExitStatus exitStatus);
-#if QT_DEPRECATED_SINCE(5,6)
+#if QT_DEPRECATED_SINCE(5, 6)
+ QT_DEPRECATED_X("Use QProcess::errorOccurred(QProcess::ProcessError) instead")
void error(QProcess::ProcessError error);
#endif
void errorOccurred(QProcess::ProcessError error);
diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
index eb2d1ed048..2587530c09 100644
--- a/src/corelib/io/qprocess_p.h
+++ b/src/corelib/io/qprocess_p.h
@@ -146,16 +146,22 @@ public:
inline QString nameToString(const Key &name) const { return name; }
inline Value prepareValue(const QString &value) const { return value; }
inline QString valueToString(const Value &value) const { return value; }
- struct MutexLocker {
- MutexLocker(const QProcessEnvironmentPrivate *) {}
+#else
+ struct NameMapMutexLocker : public QMutexLocker
+ {
+ NameMapMutexLocker(const QProcessEnvironmentPrivate *d) : QMutexLocker(&d->nameMapMutex) {}
};
- struct OrderedMutexLocker {
- OrderedMutexLocker(const QProcessEnvironmentPrivate *,
- const QProcessEnvironmentPrivate *) {}
+ struct OrderedNameMapMutexLocker : public QOrderedMutexLocker
+ {
+ OrderedNameMapMutexLocker(const QProcessEnvironmentPrivate *d1,
+ const QProcessEnvironmentPrivate *d2)
+ : QOrderedMutexLocker(&d1->nameMapMutex, &d2->nameMapMutex)
+ {}
};
-#else
+
inline Key prepareName(const QString &name) const
{
+ const NameMapMutexLocker locker(this);
Key &ent = nameMap[name];
if (ent.isEmpty())
ent = name.toLocal8Bit();
@@ -164,40 +170,27 @@ public:
inline QString nameToString(const Key &name) const
{
const QString sname = QString::fromLocal8Bit(name);
- nameMap[sname] = name;
+ {
+ const NameMapMutexLocker locker(this);
+ nameMap[sname] = name;
+ }
return sname;
}
inline Value prepareValue(const QString &value) const { return Value(value); }
inline QString valueToString(const Value &value) const { return value.string(); }
- struct MutexLocker : public QMutexLocker
- {
- MutexLocker(const QProcessEnvironmentPrivate *d) : QMutexLocker(&d->mutex) {}
- };
- struct OrderedMutexLocker : public QOrderedMutexLocker
- {
- OrderedMutexLocker(const QProcessEnvironmentPrivate *d1,
- const QProcessEnvironmentPrivate *d2) :
- QOrderedMutexLocker(&d1->mutex, &d2->mutex)
- {}
- };
-
QProcessEnvironmentPrivate() : QSharedData() {}
QProcessEnvironmentPrivate(const QProcessEnvironmentPrivate &other) :
- QSharedData()
+ QSharedData(), vars(other.vars)
{
- // This being locked ensures that the functions that only assign
- // d pointers don't need explicit locking.
// We don't need to lock our own mutex, as this object is new and
// consequently not shared. For the same reason, non-const methods
// do not need a lock, as they detach objects (however, we need to
// ensure that they really detach before using prepareName()).
- MutexLocker locker(&other);
- vars = other.vars;
+ NameMapMutexLocker locker(&other);
nameMap = other.nameMap;
- // We need to detach our members, so that our mutex can protect them.
- // As we are being detached, they likely would be detached a moment later anyway.
- vars.detach();
+ // We need to detach our nameMap, so that our mutex can protect it.
+ // As we are being detached, it likely would be detached a moment later anyway.
nameMap.detach();
}
#endif
@@ -208,8 +201,7 @@ public:
#ifdef Q_OS_UNIX
typedef QHash<QString, Key> NameHash;
mutable NameHash nameMap;
-
- mutable QMutex mutex;
+ mutable QMutex nameMapMutex;
#endif
static QProcessEnvironment fromList(const QStringList &list);
@@ -220,7 +212,7 @@ public:
template<> Q_INLINE_TEMPLATE void QSharedDataPointer<QProcessEnvironmentPrivate>::detach()
{
- if (d && d->ref.load() == 1)
+ if (d && d->ref.loadRelaxed() == 1)
return;
QProcessEnvironmentPrivate *x = (d ? new QProcessEnvironmentPrivate(*d)
: new QProcessEnvironmentPrivate);
@@ -246,7 +238,7 @@ public:
// if you add "= 4" here, increase the number of bits below
};
- Channel() : process(0), notifier(0), type(Normal), closed(false), append(false)
+ Channel() : process(nullptr), notifier(nullptr), type(Normal), closed(false), append(false)
{
pipe[0] = INVALID_Q_PIPE;
pipe[1] = INVALID_Q_PIPE;
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 7a2daa2a57..0c80daa024 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -89,6 +89,7 @@ QT_END_NAMESPACE
#include "qprocess_p.h"
#include "qstandardpaths.h"
#include "private/qcore_unix_p.h"
+#include "private/qlocking_p.h"
#ifdef Q_OS_MAC
#include <private/qcore_mac_p.h>
@@ -202,8 +203,7 @@ static int qt_create_pipe(int *pipe)
qt_safe_close(pipe[1]);
int pipe_ret = qt_safe_pipe(pipe);
if (pipe_ret != 0) {
- qWarning("QProcessPrivate::createPipe: Cannot create pipe %p: %s",
- pipe, qPrintable(qt_error_string(errno)));
+ qErrnoWarning("QProcessPrivate::createPipe: Cannot create pipe %p", pipe);
}
return pipe_ret;
}
@@ -405,7 +405,7 @@ void QProcessPrivate::startProcess()
// CFBundle is not reentrant, since CFBundleCreate might return a reference
// to a cached bundle object. Protect the bundle calls with a mutex lock.
static QBasicMutex cfbundleMutex;
- QMutexLocker lock(&cfbundleMutex);
+ const auto locker = qt_scoped_lock(cfbundleMutex);
QCFType<CFBundleRef> bundle = CFBundleCreate(0, url);
// 'executableURL' can be either relative or absolute ...
QCFType<CFURLRef> executableURL = CFBundleCopyExecutableURL(bundle);
@@ -439,7 +439,6 @@ void QProcessPrivate::startProcess()
int envc = 0;
char **envp = 0;
if (environment.d.constData()) {
- QProcessEnvironmentPrivate::MutexLocker locker(environment.d);
envp = _q_dupEnvironment(environment.d.constData()->vars, &envc);
}
@@ -473,7 +472,7 @@ void QProcessPrivate::startProcess()
if (forkfd == -1) {
// Cleanup, report error and return
#if defined (QPROCESS_DEBUG)
- qDebug("fork failed: %s", qPrintable(qt_error_string(lastForkErrno)));
+ qDebug("fork failed: %ls", qUtf16Printable(qt_error_string(lastForkErrno)));
#endif
q->setProcessState(QProcess::NotRunning);
setErrorAndEmit(QProcess::FailedToStart,
@@ -518,7 +517,7 @@ void QProcessPrivate::startProcess()
if (stderrChannel.pipe[0] != -1)
::fcntl(stderrChannel.pipe[0], F_SETFL, ::fcntl(stderrChannel.pipe[0], F_GETFL) | O_NONBLOCK);
- if (threadData->eventDispatcher) {
+ if (threadData->eventDispatcher.loadAcquire()) {
deathNotifier = new QSocketNotifier(forkfd, QSocketNotifier::Read, q);
QObject::connect(deathNotifier, SIGNAL(activated(int)),
q, SLOT(_q_processDied()));
@@ -652,7 +651,7 @@ bool QProcessPrivate::writeToStdin()
qDebug("QProcessPrivate::writeToStdin(), write(%p \"%s\", %lld) == %lld",
data, qt_prettyDebug(data, bytesToWrite, 16).constData(), bytesToWrite, written);
if (written == -1)
- qDebug("QProcessPrivate::writeToStdin(), failed to write (%s)", qPrintable(qt_error_string(errno)));
+ qDebug("QProcessPrivate::writeToStdin(), failed to write (%ls)", qUtf16Printable(qt_error_string(errno)));
#endif
if (written == -1) {
// If the O_NONBLOCK flag is set and If some data can be written without blocking
@@ -971,7 +970,6 @@ bool QProcessPrivate::startDetached(qint64 *pid)
int envc = 0;
char **envp = nullptr;
if (environment.d.constData()) {
- QProcessEnvironmentPrivate::MutexLocker locker(environment.d);
envp = _q_dupEnvironment(environment.d.constData()->vars, &envc);
}
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index b3533397d4..22c22ce711 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
-** Copyright (C) 2018 Intel Corporation.
+** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -42,7 +42,7 @@
#include "qresource_p.h"
#include "qresource_iterator_p.h"
#include "qset.h"
-#include "qmutex.h"
+#include <private/qlocking_p.h>
#include "qdebug.h"
#include "qlocale.h"
#include "qglobal.h"
@@ -147,7 +147,7 @@ private:
public:
mutable QAtomicInt ref;
- inline QResourceRoot(): tree(0), names(0), payloads(0), version(0) {}
+ inline QResourceRoot(): tree(nullptr), names(nullptr), payloads(nullptr), version(0) {}
inline QResourceRoot(int version, const uchar *t, const uchar *n, const uchar *d) { setSource(version, t, n, d); }
virtual ~QResourceRoot() { }
int findNode(const QString &path, const QLocale &locale=QLocale()) const;
@@ -165,7 +165,7 @@ public:
quint64 lastModified(int node) const;
QStringList children(int node) const;
virtual QString mappingRoot() const { return QString(); }
- bool mappingRootSubdir(const QString &path, QString *match=0) const;
+ bool mappingRootSubdir(const QString &path, QString *match = nullptr) const;
inline bool operator==(const QResourceRoot &other) const
{ return tree == other.tree && names == other.names && payloads == other.payloads && version == other.version; }
inline bool operator!=(const QResourceRoot &other) const
@@ -197,14 +197,14 @@ Q_DECLARE_TYPEINFO(QResourceRoot, Q_MOVABLE_TYPE);
typedef QList<QResourceRoot*> ResourceList;
struct QResourceGlobalData
{
- QMutex resourceMutex{QMutex::Recursive};
+ QRecursiveMutex resourceMutex;
ResourceList resourceList;
QStringList resourceSearchPaths;
};
Q_GLOBAL_STATIC(QResourceGlobalData, resourceGlobalData)
-static inline QMutex *resourceMutex()
-{ return &resourceGlobalData->resourceMutex; }
+static inline QRecursiveMutex &resourceMutex()
+{ return resourceGlobalData->resourceMutex; }
static inline ResourceList *resourceList()
{ return &resourceGlobalData->resourceList; }
@@ -279,14 +279,14 @@ static inline QStringList *resourceSearchPaths()
This enum is used by compressionAlgorithm() to indicate which algorithm the
RCC tool used to compress the payload.
- \value NoCompression Contents are not compressed (isCompressed() is false).
+ \value NoCompression Contents are not compressed
\value ZlibCompression Contents are compressed using \l{zlib}{https://zlib.net} and can
be decompressed using the qUncompress() function.
\value ZstdCompression Contents are compressed using \l{zstd}{https://zstd.net}. To
decompress, use the \c{ZSTD_decompress} function from the zstd
library.
- \sa compressionAlgorithm(), isCompressed()
+ \sa compressionAlgorithm()
*/
class QResourcePrivate {
@@ -320,7 +320,7 @@ QResourcePrivate::clear()
{
absoluteFilePath.clear();
compressionAlgo = QResource::NoCompression;
- data = 0;
+ data = nullptr;
size = 0;
children.clear();
lastModified = 0;
@@ -337,7 +337,7 @@ bool
QResourcePrivate::load(const QString &file)
{
related.clear();
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
const ResourceList *list = resourceList();
QString cleaned = cleanPath(file);
for(int i = 0; i < list->size(); ++i) {
@@ -392,7 +392,7 @@ QResourcePrivate::ensureInitialized() const
if(path.startsWith(QLatin1Char('/'))) {
that->load(path.toString());
} else {
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
QStringList searchPaths = *resourceSearchPaths();
searchPaths << QLatin1String("");
for(int i = 0; i < searchPaths.size(); ++i) {
@@ -551,13 +551,20 @@ bool QResource::isValid() const
\sa isDir()
*/
-
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
+ \obsolete
+
Returns \c true if the resource represents a file and the data backing it
is in a compressed format, false otherwise. If the data is compressed,
check compressionAlgorithm() to verify what algorithm to use to decompress
the data.
+ \note This function is deprecated and can be replaced with
+ \code
+ compressionAlgorithm() != NoCompression
+ \endcode
+
\sa data(), compressionAlgorithm(), isFile()
*/
@@ -565,6 +572,7 @@ bool QResource::isCompressed() const
{
return compressionAlgorithm() != NoCompression;
}
+#endif
/*!
\since 5.13
@@ -582,7 +590,7 @@ bool QResource::isCompressed() const
See \l{http://facebook.github.io/zstd/zstd_manual.html}{Zstandard manual}.
- \sa isCompressed(), data(), isFile()
+ \sa data(), isFile()
*/
QResource::Compression QResource::compressionAlgorithm() const
{
@@ -606,11 +614,11 @@ qint64 QResource::size() const
/*!
Returns direct access to a read only segment of data that this resource
- represents. If the resource is compressed the data returns is
- compressed and qUncompress() must be used to access the data. If the
- resource is a directory \nullptr is returned.
+ represents. If the resource is compressed the data returned is compressed
+ and the appropriate library functions must be used to access the data. If
+ the resource is a directory \nullptr is returned.
- \sa size(), isCompressed(), isFile()
+ \sa size(), compressionAlgorithm(), isFile()
*/
const uchar *QResource::data() const
@@ -680,7 +688,7 @@ QResource::addSearchPath(const QString &path)
path.toLocal8Bit().data());
return;
}
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
resourceSearchPaths()->prepend(path);
}
@@ -698,7 +706,7 @@ QResource::addSearchPath(const QString &path)
QStringList
QResource::searchPaths()
{
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
return *resourceSearchPaths();
}
#endif
@@ -864,7 +872,7 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
{
if(node == -1) {
*size = 0;
- return 0;
+ return nullptr;
}
int offset = findOffset(node) + 4; //jump past name
@@ -881,7 +889,7 @@ const uchar *QResourceRoot::data(int node, qint64 *size) const
return ret;
}
*size = 0;
- return 0;
+ return nullptr;
}
quint64 QResourceRoot::lastModified(int node) const
@@ -942,12 +950,13 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
{
if (resourceGlobalData.isDestroyed())
return false;
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
+ ResourceList *list = resourceList();
if (version >= 0x01 && version <= 0x3) {
bool found = false;
QResourceRoot res(version, tree, name, data);
- for(int i = 0; i < resourceList()->size(); ++i) {
- if(*resourceList()->at(i) == res) {
+ for (int i = 0; i < list->size(); ++i) {
+ if (*list->at(i) == res) {
found = true;
break;
}
@@ -955,7 +964,7 @@ Q_CORE_EXPORT bool qRegisterResourceData(int version, const unsigned char *tree,
if(!found) {
QResourceRoot *root = new QResourceRoot(version, tree, name, data);
root->ref.ref();
- resourceList()->append(root);
+ list->append(root);
}
return true;
}
@@ -968,12 +977,13 @@ Q_CORE_EXPORT bool qUnregisterResourceData(int version, const unsigned char *tre
if (resourceGlobalData.isDestroyed())
return false;
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
if (version >= 0x01 && version <= 0x3) {
QResourceRoot res(version, tree, name, data);
- for(int i = 0; i < resourceList()->size(); ) {
- if(*resourceList()->at(i) == res) {
- QResourceRoot *root = resourceList()->takeAt(i);
+ ResourceList *list = resourceList();
+ for (int i = 0; i < list->size(); ) {
+ if (*list->at(i) == res) {
+ QResourceRoot *root = list->takeAt(i);
if(!root->ref.deref())
delete root;
} else {
@@ -993,7 +1003,7 @@ class QDynamicBufferResourceRoot: public QResourceRoot
const uchar *buffer;
public:
- inline QDynamicBufferResourceRoot(const QString &_root) : root(_root), buffer(0) { }
+ inline QDynamicBufferResourceRoot(const QString &_root) : root(_root), buffer(nullptr) { }
inline ~QDynamicBufferResourceRoot() { }
inline const uchar *mappingBuffer() const { return buffer; }
QString mappingRoot() const override { return root; }
@@ -1065,12 +1075,14 @@ class QDynamicFileResourceRoot: public QDynamicBufferResourceRoot
qsizetype unmapLength;
public:
- inline QDynamicFileResourceRoot(const QString &_root) : QDynamicBufferResourceRoot(_root), unmapPointer(0), unmapLength(0) { }
+ QDynamicFileResourceRoot(const QString &_root)
+ : QDynamicBufferResourceRoot(_root), unmapPointer(nullptr), unmapLength(0)
+ { }
~QDynamicFileResourceRoot() {
#if defined(QT_USE_MMAP)
if (unmapPointer) {
munmap((char*)unmapPointer, unmapLength);
- unmapPointer = 0;
+ unmapPointer = nullptr;
unmapLength = 0;
} else
#endif
@@ -1186,7 +1198,7 @@ QResource::registerResource(const QString &rccFilename, const QString &resourceR
QDynamicFileResourceRoot *root = new QDynamicFileResourceRoot(r);
if(root->registerSelf(rccFilename)) {
root->ref.ref();
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
resourceList()->append(root);
return true;
}
@@ -1210,14 +1222,14 @@ QResource::unregisterResource(const QString &rccFilename, const QString &resourc
{
QString r = qt_resource_fixResourceRoot(resourceRoot);
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
ResourceList *list = resourceList();
for(int i = 0; i < list->size(); ++i) {
QResourceRoot *res = list->at(i);
if(res->type() == QResourceRoot::Resource_File) {
QDynamicFileResourceRoot *root = reinterpret_cast<QDynamicFileResourceRoot*>(res);
if (root->mappingFile() == rccFilename && root->mappingRoot() == r) {
- resourceList()->removeAt(i);
+ list->removeAt(i);
if(!root->ref.deref()) {
delete root;
return true;
@@ -1257,7 +1269,7 @@ QResource::registerResource(const uchar *rccData, const QString &resourceRoot)
QDynamicBufferResourceRoot *root = new QDynamicBufferResourceRoot(r);
if (root->registerSelf(rccData, -1)) {
root->ref.ref();
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
resourceList()->append(root);
return true;
}
@@ -1281,14 +1293,14 @@ QResource::unregisterResource(const uchar *rccData, const QString &resourceRoot)
{
QString r = qt_resource_fixResourceRoot(resourceRoot);
- QMutexLocker lock(resourceMutex());
+ const auto locker = qt_scoped_lock(resourceMutex());
ResourceList *list = resourceList();
for(int i = 0; i < list->size(); ++i) {
QResourceRoot *res = list->at(i);
if(res->type() == QResourceRoot::Resource_Buffer) {
QDynamicBufferResourceRoot *root = reinterpret_cast<QDynamicBufferResourceRoot*>(res);
if (root->mappingBuffer() == rccData && root->mappingRoot() == r) {
- resourceList()->removeAt(i);
+ list->removeAt(i);
if(!root->ref.deref()) {
delete root;
return true;
@@ -1366,9 +1378,15 @@ bool QResourceFileEngine::open(QIODevice::OpenMode flags)
qWarning("QResourceFileEngine::open: Missing file name");
return false;
}
- if(flags & QIODevice::WriteOnly)
+ if (flags & QIODevice::WriteOnly)
return false;
- d->uncompress();
+ if (d->resource.compressionAlgorithm() != QResource::NoCompression) {
+ d->uncompress();
+ if (d->uncompressed.isNull()) {
+ d->errorString = QSystemError::stdString(EIO);
+ return false;
+ }
+ }
if (!d->resource.isValid()) {
d->errorString = QSystemError::stdString(ENOENT);
return false;
@@ -1395,7 +1413,7 @@ qint64 QResourceFileEngine::read(char *data, qint64 len)
len = size()-d->offset;
if(len <= 0)
return 0;
- if(d->resource.isCompressed())
+ if (!d->uncompressed.isNull())
memcpy(data, d->uncompressed.constData()+d->offset, len);
else
memcpy(data, d->resource.data()+d->offset, len);
@@ -1431,9 +1449,9 @@ bool QResourceFileEngine::link(const QString &)
qint64 QResourceFileEngine::size() const
{
Q_D(const QResourceFileEngine);
- if(!d->resource.isValid())
+ if (!d->resource.isValid())
return 0;
- if (d->resource.isCompressed()) {
+ if (d->resource.compressionAlgorithm() != QResource::NoCompression) {
d->uncompress();
return d->uncompressed.size();
}
@@ -1596,7 +1614,7 @@ uchar *QResourceFileEnginePrivate::map(qint64 offset, qint64 size, QFile::Memory
Q_UNUSED(flags);
qint64 max = resource.size();
- if (resource.isCompressed()) {
+ if (resource.compressionAlgorithm() != QResource::NoCompression) {
uncompress();
max = uncompressed.size();
}
@@ -1609,7 +1627,7 @@ uchar *QResourceFileEnginePrivate::map(qint64 offset, qint64 size, QFile::Memory
}
const uchar *address = resource.data();
- if (resource.isCompressed())
+ if (resource.compressionAlgorithm() != QResource::NoCompression)
address = reinterpret_cast<const uchar *>(uncompressed.constData());
return const_cast<uchar *>(address) + offset;
diff --git a/src/corelib/io/qresource.h b/src/corelib/io/qresource.h
index 5e798de436..5ee8d5d266 100644
--- a/src/corelib/io/qresource.h
+++ b/src/corelib/io/qresource.h
@@ -72,7 +72,6 @@ public:
bool isValid() const;
- bool isCompressed() const;
Compression compressionAlgorithm() const;
qint64 size() const;
const uchar *data() const;
@@ -84,6 +83,10 @@ public:
QT_DEPRECATED_X("Use QDir::searchPaths() instead")
static QStringList searchPaths();
#endif
+#if QT_DEPRECATED_SINCE(5, 15)
+ QT_DEPRECATED_VERSION_X_5_15("Use QResource::compressionAlgorithm() instead")
+ bool isCompressed() const;
+#endif
static bool registerResource(const QString &rccFilename, const QString &resourceRoot=QString());
static bool unregisterResource(const QString &rccFilename, const QString &resourceRoot=QString());
diff --git a/src/corelib/io/qresource_p.h b/src/corelib/io/qresource_p.h
index 7451de8809..fedf95bb33 100644
--- a/src/corelib/io/qresource_p.h
+++ b/src/corelib/io/qresource_p.h
@@ -108,7 +108,7 @@ public:
Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override;
Iterator *endEntryList() override;
- bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0) override;
+ bool extension(Extension extension, const ExtensionOption *option = nullptr, ExtensionReturn *output = nullptr) override;
bool supportsExtension(Extension extension) const override;
};
diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp
index 7ee9142e14..0a884a7df9 100644
--- a/src/corelib/io/qsavefile.cpp
+++ b/src/corelib/io/qsavefile.cpp
@@ -150,8 +150,7 @@ QSaveFile::~QSaveFile()
QFileDevice::close();
if (d->fileEngine) {
d->fileEngine->remove();
- delete d->fileEngine;
- d->fileEngine = 0;
+ d->fileEngine.reset();
}
}
@@ -193,7 +192,7 @@ bool QSaveFile::open(OpenMode mode)
{
Q_D(QSaveFile);
if (isOpen()) {
- qWarning("QSaveFile::open: File (%s) already open", qPrintable(fileName()));
+ qWarning("QSaveFile::open: File (%ls) already open", qUtf16Printable(fileName()));
return false;
}
unsetError();
@@ -235,7 +234,7 @@ bool QSaveFile::open(OpenMode mode)
}
auto openDirectly = [&]() {
- d->fileEngine = QAbstractFileEngine::create(d->finalFileName);
+ d->fileEngine.reset(QAbstractFileEngine::create(d->finalFileName));
if (d->fileEngine->open(mode | QIODevice::Unbuffered)) {
d->useTemporaryFile = false;
QFileDevice::open(mode);
@@ -258,8 +257,7 @@ bool QSaveFile::open(OpenMode mode)
if (openDirectly())
return true;
d->setError(d->fileEngine->error(), d->fileEngine->errorString());
- delete d->fileEngine;
- d->fileEngine = 0;
+ d->fileEngine.reset();
} else {
QString msg =
QSaveFile::tr("QSaveFile cannot open '%1' without direct write fallback enabled.")
@@ -269,18 +267,17 @@ bool QSaveFile::open(OpenMode mode)
return false;
}
- d->fileEngine = new QTemporaryFileEngine(&d->finalFileName, QTemporaryFileEngine::Win32NonShared);
+ d->fileEngine.reset(new QTemporaryFileEngine(&d->finalFileName, QTemporaryFileEngine::Win32NonShared));
// if the target file exists, we'll copy its permissions below,
// but until then, let's ensure the temporary file is not accessible
// to a third party
int perm = (existingFile.exists() ? 0600 : 0666);
- static_cast<QTemporaryFileEngine *>(d->fileEngine)->initialize(d->finalFileName, perm);
+ static_cast<QTemporaryFileEngine *>(d->fileEngine.get())->initialize(d->finalFileName, perm);
// Same as in QFile: QIODevice provides the buffering, so there's no need to request it from the file engine.
if (!d->fileEngine->open(mode | QIODevice::Unbuffered)) {
QFileDevice::FileError err = d->fileEngine->error();
#ifdef Q_OS_UNIX
if (d->directWriteFallback && err == QFileDevice::OpenError && errno == EACCES) {
- delete d->fileEngine;
if (openDirectly())
return true;
err = d->fileEngine->error();
@@ -289,8 +286,7 @@ bool QSaveFile::open(OpenMode mode)
if (err == QFileDevice::UnspecifiedError)
err = QFileDevice::OpenError;
d->setError(err, d->fileEngine->errorString());
- delete d->fileEngine;
- d->fileEngine = 0;
+ d->fileEngine.reset();
return false;
}
@@ -331,35 +327,31 @@ bool QSaveFile::commit()
return false;
if (!isOpen()) {
- qWarning("QSaveFile::commit: File (%s) is not open", qPrintable(fileName()));
+ qWarning("QSaveFile::commit: File (%ls) is not open", qUtf16Printable(fileName()));
return false;
}
QFileDevice::close(); // calls flush()
+ const auto fe = std::move(d->fileEngine);
+
// Sync to disk if possible. Ignore errors (e.g. not supported).
- d->fileEngine->syncToDisk();
+ fe->syncToDisk();
if (d->useTemporaryFile) {
if (d->writeError != QFileDevice::NoError) {
- d->fileEngine->remove();
+ fe->remove();
d->writeError = QFileDevice::NoError;
- delete d->fileEngine;
- d->fileEngine = 0;
return false;
}
// atomically replace old file with new file
// Can't use QFile::rename for that, must use the file engine directly
- Q_ASSERT(d->fileEngine);
- if (!d->fileEngine->renameOverwrite(d->finalFileName)) {
- d->setError(d->fileEngine->error(), d->fileEngine->errorString());
- d->fileEngine->remove();
- delete d->fileEngine;
- d->fileEngine = 0;
+ Q_ASSERT(fe);
+ if (!fe->renameOverwrite(d->finalFileName)) {
+ d->setError(fe->error(), fe->errorString());
+ fe->remove();
return false;
}
}
- delete d->fileEngine;
- d->fileEngine = 0;
return true;
}
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 9234a23f3a..fc7122d904 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -47,6 +47,7 @@
#include "qdir.h"
#include "qfileinfo.h"
#include "qmutex.h"
+#include "private/qlocking_p.h"
#include "qlibraryinfo.h"
#include "qtemporaryfile.h"
#include "qstandardpaths.h"
@@ -210,7 +211,7 @@ QConfFile *QConfFile::fromName(const QString &fileName, bool _userPerms)
ConfFileCache *unusedCache = unusedCacheFunc();
QConfFile *confFile = 0;
- QMutexLocker locker(&settingsGlobalMutex);
+ const auto locker = qt_scoped_lock(settingsGlobalMutex);
if (!(confFile = usedHash->value(absPath))) {
if ((confFile = unusedCache->take(absPath)))
@@ -225,7 +226,7 @@ QConfFile *QConfFile::fromName(const QString &fileName, bool _userPerms)
void QConfFile::clearCache()
{
- QMutexLocker locker(&settingsGlobalMutex);
+ const auto locker = qt_scoped_lock(settingsGlobalMutex);
unusedCacheFunc()->clear();
}
@@ -745,7 +746,6 @@ bool QSettingsPrivate::iniUnescapedStringList(const QByteArray &str, int from, i
{ '\'', '\'' },
{ '\\', '\\' }
};
- static const int numEscapeCodes = sizeof(escapeCodes) / sizeof(escapeCodes[0]);
bool isStringList = false;
bool inQuotedString = false;
@@ -769,9 +769,9 @@ StNormal:
goto end;
ch = str.at(i++);
- for (int j = 0; j < numEscapeCodes; ++j) {
- if (ch == escapeCodes[j][0]) {
- stringResult += QLatin1Char(escapeCodes[j][1]);
+ for (const auto &escapeCode : escapeCodes) {
+ if (ch == escapeCode[0]) {
+ stringResult += QLatin1Char(escapeCode[1]);
goto StNormal;
}
}
@@ -937,7 +937,7 @@ void QConfFileSettingsPrivate::initFormat()
#endif
if (format > QSettings::IniFormat) {
- QMutexLocker locker(&settingsGlobalMutex);
+ const auto locker = qt_scoped_lock(settingsGlobalMutex);
const CustomFormatVector *customFormatVector = customFormatVectorFunc();
int i = (int)format - (int)QSettings::CustomFormat1;
@@ -1052,11 +1052,11 @@ static QString make_user_path()
}
#endif // !Q_OS_WIN
-static void initDefaultPaths(QMutexLocker *locker)
+static std::unique_lock<QBasicMutex> initDefaultPaths(std::unique_lock<QBasicMutex> locker)
{
PathHash *pathHash = pathHashFunc();
- locker->unlock();
+ locker.unlock();
/*
QLibraryInfo::location() uses QSettings, so in order to
@@ -1065,7 +1065,7 @@ static void initDefaultPaths(QMutexLocker *locker)
*/
QString systemPath = QLibraryInfo::location(QLibraryInfo::SettingsPath) + QLatin1Char('/');
- locker->relock();
+ locker.lock();
if (pathHash->isEmpty()) {
/*
Lazy initialization of pathHash. We initialize the
@@ -1096,6 +1096,8 @@ static void initDefaultPaths(QMutexLocker *locker)
#endif
#endif // Q_OS_WIN
}
+
+ return locker;
}
static Path getPath(QSettings::Format format, QSettings::Scope scope)
@@ -1103,10 +1105,10 @@ static Path getPath(QSettings::Format format, QSettings::Scope scope)
Q_ASSERT((int)QSettings::NativeFormat == 0);
Q_ASSERT((int)QSettings::IniFormat == 1);
- QMutexLocker locker(&settingsGlobalMutex);
+ auto locker = qt_unique_lock(settingsGlobalMutex);
PathHash *pathHash = pathHashFunc();
if (pathHash->isEmpty())
- initDefaultPaths(&locker);
+ locker = initDefaultPaths(std::move(locker));
Path result = pathHash->value(pathHashKey(format, scope));
if (!result.path.isEmpty())
@@ -1120,7 +1122,7 @@ static Path getPath(QSettings::Format format, QSettings::Scope scope)
// Note: Suitable only for autotests.
void Q_AUTOTEST_EXPORT clearDefaultPaths()
{
- QMutexLocker locker(&settingsGlobalMutex);
+ const auto locker = qt_scoped_lock(settingsGlobalMutex);
pathHashFunc()->clear();
}
#endif // QT_BUILD_INTERNAL && Q_XDG_PLATFORM && !QT_NO_STANDARDPATHS
@@ -1200,7 +1202,7 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(const QString &fileName,
QConfFileSettingsPrivate::~QConfFileSettingsPrivate()
{
- QMutexLocker locker(&settingsGlobalMutex);
+ const auto locker = qt_scoped_lock(settingsGlobalMutex);
ConfFileHash *usedHash = usedHashFunc();
ConfFileCache *unusedCache = unusedCacheFunc();
@@ -1239,7 +1241,7 @@ void QConfFileSettingsPrivate::remove(const QString &key)
QSettingsKey theKey(key, caseSensitivity);
QSettingsKey prefix(key + QLatin1Char('/'), caseSensitivity);
- QMutexLocker locker(&confFile->mutex);
+ const auto locker = qt_scoped_lock(confFile->mutex);
ensureSectionParsed(confFile, theKey);
ensureSectionParsed(confFile, prefix);
@@ -1267,7 +1269,7 @@ void QConfFileSettingsPrivate::set(const QString &key, const QVariant &value)
QConfFile *confFile = confFiles.at(0);
QSettingsKey theKey(key, caseSensitivity, nextPosition++);
- QMutexLocker locker(&confFile->mutex);
+ const auto locker = qt_scoped_lock(confFile->mutex);
confFile->removedKeys.remove(theKey);
confFile->addedKeys.insert(theKey, value);
}
@@ -1279,7 +1281,7 @@ bool QConfFileSettingsPrivate::get(const QString &key, QVariant *value) const
bool found = false;
for (auto confFile : qAsConst(confFiles)) {
- QMutexLocker locker(&confFile->mutex);
+ const auto locker = qt_scoped_lock(confFile->mutex);
if (!confFile->addedKeys.isEmpty()) {
j = confFile->addedKeys.constFind(theKey);
@@ -1312,7 +1314,7 @@ QStringList QConfFileSettingsPrivate::children(const QString &prefix, ChildSpec
int startPos = prefix.size();
for (auto confFile : qAsConst(confFiles)) {
- QMutexLocker locker(&confFile->mutex);
+ const auto locker = qt_scoped_lock(confFile->mutex);
if (thePrefix.isEmpty())
ensureAllSectionsParsed(confFile);
@@ -1351,7 +1353,7 @@ void QConfFileSettingsPrivate::clear()
// Note: First config file is always the most specific.
QConfFile *confFile = confFiles.at(0);
- QMutexLocker locker(&confFile->mutex);
+ const auto locker = qt_scoped_lock(confFile->mutex);
ensureAllSectionsParsed(confFile);
confFile->addedKeys.clear();
confFile->removedKeys = confFile->originalKeys;
@@ -1363,7 +1365,7 @@ void QConfFileSettingsPrivate::sync()
// error we just try to go on and make the best of it
for (auto confFile : qAsConst(confFiles)) {
- QMutexLocker locker(&confFile->mutex);
+ const auto locker = qt_scoped_lock(confFile->mutex);
syncConfFile(confFile);
}
}
@@ -2048,8 +2050,8 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
QPixmap, which are part of Qt GUI. In other words, there is no
\c toColor(), \c toImage(), or \c toPixmap() functions in QVariant.
- Instead, you can use the QVariant::value() or the qVariantValue()
- template function. For example:
+ Instead, you can use the QVariant::value() template function.
+ For example:
\snippet code/src_corelib_io_qsettings.cpp 0
@@ -3521,10 +3523,10 @@ void QSettings::setUserIniPath(const QString &dir)
*/
void QSettings::setPath(Format format, Scope scope, const QString &path)
{
- QMutexLocker locker(&settingsGlobalMutex);
+ auto locker = qt_unique_lock(settingsGlobalMutex);
PathHash *pathHash = pathHashFunc();
if (pathHash->isEmpty())
- initDefaultPaths(&locker);
+ locker = initDefaultPaths(std::move(locker));
pathHash->insert(pathHashKey(format, scope), Path(path + QDir::separator(), true));
}
@@ -3604,7 +3606,7 @@ QSettings::Format QSettings::registerFormat(const QString &extension, ReadFunc r
Q_ASSERT(caseSensitivity == Qt::CaseSensitive);
#endif
- QMutexLocker locker(&settingsGlobalMutex);
+ const auto locker = qt_scoped_lock(settingsGlobalMutex);
CustomFormatVector *customFormatVector = customFormatVectorFunc();
int index = customFormatVector->size();
if (index == 16) // the QSettings::Format enum has room for 16 custom formats
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index dd3468e1f8..6eb318006e 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -136,6 +136,8 @@ static void mergeKeySets(NameSet *dest, const QStringList &src)
** Wrappers for the insane windows registry API
*/
+// ### Qt 6: Use new helpers from qwinregistry.cpp (once bootstrap builds are obsolete)
+
// Open a key with the specified "perms".
// "access" is to explicitly use the 32- or 64-bit branch.
static HKEY openKey(HKEY parentHandle, REGSAM perms, const QString &rSubKey, REGSAM access = 0)
@@ -166,8 +168,8 @@ static HKEY createOrOpenKey(HKEY parentHandle, REGSAM perms, const QString &rSub
if (res == ERROR_SUCCESS)
return resultHandle;
- //qWarning("QSettings: Failed to create subkey \"%s\": %s",
- // qPrintable(rSubKey), qPrintable(qt_error_string(int(res))));
+ //qErrnoWarning(int(res), "QSettings: Failed to create subkey \"%ls\"",
+ // qUtf16Printable(rSubKey));
return 0;
}
@@ -207,7 +209,7 @@ static QStringList childKeysOrGroups(HKEY parentHandle, QSettingsPrivate::ChildS
&numKeys, &maxKeySize, 0, 0, 0);
if (res != ERROR_SUCCESS) {
- qWarning("QSettings: RegQueryInfoKey() failed: %s", qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: RegQueryInfoKey() failed");
return result;
}
@@ -241,7 +243,7 @@ static QStringList childKeysOrGroups(HKEY parentHandle, QSettingsPrivate::ChildS
item = QString::fromWCharArray((const wchar_t *)buff.constData(), l);
if (res != ERROR_SUCCESS) {
- qWarning("QSettings: RegEnumValue failed: %s", qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: RegEnumValue failed");
continue;
}
if (item.isEmpty())
@@ -295,8 +297,8 @@ static void deleteChildGroups(HKEY parentHandle, REGSAM access = 0)
// delete group itself
LONG res = RegDeleteKey(parentHandle, reinterpret_cast<const wchar_t *>(group.utf16()));
if (res != ERROR_SUCCESS) {
- qWarning("QSettings: RegDeleteKey failed on subkey \"%s\": %s",
- qPrintable(group), qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: RegDeleteKey failed on subkey \"%ls\"",
+ qUtf16Printable(group));
return;
}
}
@@ -596,8 +598,8 @@ QWinSettingsPrivate::~QWinSettingsPrivate()
QString emptyKey;
DWORD res = RegDeleteKey(writeHandle(), reinterpret_cast<const wchar_t *>(emptyKey.utf16()));
if (res != ERROR_SUCCESS) {
- qWarning("QSettings: Failed to delete key \"%s\": %s",
- qPrintable(regList.at(0).key()), qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: Failed to delete key \"%ls\"",
+ qUtf16Printable(regList.constFirst().key()));
}
}
@@ -633,16 +635,16 @@ void QWinSettingsPrivate::remove(const QString &uKey)
for (const QString &group : childKeys) {
LONG res = RegDeleteValue(handle, reinterpret_cast<const wchar_t *>(group.utf16()));
if (res != ERROR_SUCCESS) {
- qWarning("QSettings: RegDeleteValue failed on subkey \"%s\": %s",
- qPrintable(group), qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: RegDeleteValue failed on subkey \"%ls\"",
+ qUtf16Printable(group));
}
}
} else {
res = RegDeleteKey(writeHandle(), reinterpret_cast<const wchar_t *>(rKey.utf16()));
if (res != ERROR_SUCCESS) {
- qWarning("QSettings: RegDeleteKey failed on key \"%s\": %s",
- qPrintable(rKey), qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: RegDeleteKey failed on key \"%ls\"",
+ qUtf16Printable(rKey));
}
}
RegCloseKey(handle);
@@ -739,8 +741,8 @@ void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
if (res == ERROR_SUCCESS) {
deleteWriteHandleOnExit = false;
} else {
- qWarning("QSettings: failed to set subkey \"%s\": %s",
- qPrintable(rKey), qPrintable(qt_error_string(int(res))));
+ qErrnoWarning(int(res), "QSettings: failed to set subkey \"%ls\"",
+ qUtf16Printable(rKey));
setStatus(QSettings::AccessError);
}
diff --git a/src/corelib/io/qstandardpaths_android.cpp b/src/corelib/io/qstandardpaths_android.cpp
index 83108e4387..1f4e0de1e7 100644
--- a/src/corelib/io/qstandardpaths_android.cpp
+++ b/src/corelib/io/qstandardpaths_android.cpp
@@ -136,7 +136,7 @@ static QString getExternalStoragePublicDirectory(const char *directoryField)
*/
static QString getExternalFilesDir(const char *directoryField = 0)
{
- QString &path = (*androidDirCache)[QString(QLatin1String("APPNAME_%1")).arg(QLatin1String(directoryField))];
+ QString &path = (*androidDirCache)[QLatin1String("APPNAME_%1").arg(QLatin1String(directoryField))];
if (!path.isEmpty())
return path;
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index cc656954d9..5f4955c53f 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -71,6 +71,28 @@ static void appendOrganizationAndApp(QString &path)
#endif
}
+#if QT_CONFIG(regularexpression)
+static QLatin1String xdg_key_name(QStandardPaths::StandardLocation type)
+{
+ switch (type) {
+ case QStandardPaths::DesktopLocation:
+ return QLatin1String("DESKTOP");
+ case QStandardPaths::DocumentsLocation:
+ return QLatin1String("DOCUMENTS");
+ case QStandardPaths::PicturesLocation:
+ return QLatin1String("PICTURES");
+ case QStandardPaths::MusicLocation:
+ return QLatin1String("MUSIC");
+ case QStandardPaths::MoviesLocation:
+ return QLatin1String("VIDEOS");
+ case QStandardPaths::DownloadLocation:
+ return QLatin1String("DOWNLOAD");
+ default:
+ return QLatin1String();
+ }
+}
+#endif
+
QString QStandardPaths::writableLocation(StandardLocation type)
{
switch (type) {
@@ -132,44 +154,45 @@ QString QStandardPaths::writableLocation(StandardLocation type)
xdgRuntimeDir = QDir::tempPath() + QLatin1String("/runtime-") + userName;
fileInfo.setFile(xdgRuntimeDir);
#ifndef Q_OS_WASM
- qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));
+ qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%ls'", qUtf16Printable(xdgRuntimeDir));
#endif
} else {
fileInfo.setFile(xdgRuntimeDir);
}
if (fileInfo.exists()) {
if (!fileInfo.isDir()) {
- qWarning("QStandardPaths: XDG_RUNTIME_DIR points to '%s' which is not a directory",
- qPrintable(xdgRuntimeDir));
+ qWarning("QStandardPaths: XDG_RUNTIME_DIR points to '%ls' which is not a directory",
+ qUtf16Printable(xdgRuntimeDir));
return QString();
}
} else {
QFileSystemEntry entry(xdgRuntimeDir);
if (!QFileSystemEngine::createDirectory(entry, false)) {
if (errno != EEXIST) {
- qWarning("QStandardPaths: error creating runtime directory %s: %s",
- qPrintable(xdgRuntimeDir), qPrintable(qt_error_string(errno)));
+ qErrnoWarning("QStandardPaths: error creating runtime directory %ls",
+ qUtf16Printable(xdgRuntimeDir));
return QString();
}
} else {
QSystemError error;
if (!QFileSystemEngine::setPermissions(entry, wantedPerms, error)) {
- qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",
- qPrintable(xdgRuntimeDir), qPrintable(error.toString()));
+ qWarning("QStandardPaths: could not set correct permissions on runtime directory %ls: %ls",
+ qUtf16Printable(xdgRuntimeDir), qUtf16Printable(error.toString()));
return QString();
}
}
}
// "The directory MUST be owned by the user"
if (fileInfo.ownerId() != myUid) {
- qWarning("QStandardPaths: wrong ownership on runtime directory %s, %d instead of %d",
- qPrintable(xdgRuntimeDir), fileInfo.ownerId(), myUid);
+ qWarning("QStandardPaths: wrong ownership on runtime directory %ls, %d instead of %d",
+ qUtf16Printable(xdgRuntimeDir),
+ fileInfo.ownerId(), myUid);
return QString();
}
// "and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700."
if (fileInfo.permissions() != wantedPerms) {
- qWarning("QStandardPaths: wrong permissions on runtime directory %s, %x instead of %x",
- qPrintable(xdgRuntimeDir), uint(fileInfo.permissions()), uint(wantedPerms));
+ qWarning("QStandardPaths: wrong permissions on runtime directory %ls, %x instead of %x",
+ qUtf16Printable(xdgRuntimeDir), uint(fileInfo.permissions()), uint(wantedPerms));
return QString();
}
@@ -185,61 +208,32 @@ QString QStandardPaths::writableLocation(StandardLocation type)
if (xdgConfigHome.isEmpty())
xdgConfigHome = QDir::homePath() + QLatin1String("/.config");
QFile file(xdgConfigHome + QLatin1String("/user-dirs.dirs"));
- if (!isTestModeEnabled() && file.open(QIODevice::ReadOnly)) {
- QHash<QString, QString> lines;
+ const QLatin1String key = xdg_key_name(type);
+ if (!key.isEmpty() && !isTestModeEnabled() && file.open(QIODevice::ReadOnly)) {
QTextStream stream(&file);
// Only look for lines like: XDG_DESKTOP_DIR="$HOME/Desktop"
QRegularExpression exp(QLatin1String("^XDG_(.*)_DIR=(.*)$"));
+ QString result;
while (!stream.atEnd()) {
const QString &line = stream.readLine();
QRegularExpressionMatch match = exp.match(line);
- if (match.hasMatch()) {
- const QStringList lst = match.capturedTexts();
- const QString key = lst.at(1);
- QString value = lst.at(2);
+ if (match.hasMatch() && match.capturedView(1) == key) {
+ QStringView value = match.capturedView(2);
if (value.length() > 2
&& value.startsWith(QLatin1Char('\"'))
&& value.endsWith(QLatin1Char('\"')))
value = value.mid(1, value.length() - 2);
- // Store the key and value: "DESKTOP", "$HOME/Desktop"
- lines[key] = value;
- }
- }
-
- QString key;
- switch (type) {
- case DesktopLocation:
- key = QLatin1String("DESKTOP");
- break;
- case DocumentsLocation:
- key = QLatin1String("DOCUMENTS");
- break;
- case PicturesLocation:
- key = QLatin1String("PICTURES");
- break;
- case MusicLocation:
- key = QLatin1String("MUSIC");
- break;
- case MoviesLocation:
- key = QLatin1String("VIDEOS");
- break;
- case DownloadLocation:
- key = QLatin1String("DOWNLOAD");
- break;
- default:
- break;
- }
- if (!key.isEmpty()) {
- QString value = lines.value(key);
- if (!value.isEmpty()) {
// value can start with $HOME
if (value.startsWith(QLatin1String("$HOME")))
- value = QDir::homePath() + value.midRef(5);
- if (value.length() > 1 && value.endsWith(QLatin1Char('/')))
- value.chop(1);
- return value;
+ result = QDir::homePath() + value.mid(5);
+ else
+ result = value.toString();
+ if (result.length() > 1 && result.endsWith(QLatin1Char('/')))
+ result.chop(1);
}
}
+ if (!result.isNull())
+ return result;
}
#endif // QT_CONFIG(regularexpression)
@@ -289,16 +283,12 @@ static QStringList xdgDataDirs()
dirs.append(QString::fromLatin1("/usr/local/share"));
dirs.append(QString::fromLatin1("/usr/share"));
} else {
- dirs = xdgDataDirsEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);
+ const auto parts = xdgDataDirsEnv.splitRef(QLatin1Char(':'), QString::SkipEmptyParts);
// Normalize paths, skip relative paths
- QMutableListIterator<QString> it(dirs);
- while (it.hasNext()) {
- const QString dir = it.next();
- if (!dir.startsWith(QLatin1Char('/')))
- it.remove();
- else
- it.setValue(QDir::cleanPath(dir));
+ for (const QStringRef &dir : parts) {
+ if (dir.startsWith(QLatin1Char('/')))
+ dirs.push_back(QDir::cleanPath(dir.toString()));
}
// Remove duplicates from the list, there's no use for duplicated
diff --git a/src/corelib/io/qstorageinfo.h b/src/corelib/io/qstorageinfo.h
index 4ab7a353ef..237e68d2a1 100644
--- a/src/corelib/io/qstorageinfo.h
+++ b/src/corelib/io/qstorageinfo.h
@@ -62,11 +62,9 @@ public:
~QStorageInfo();
QStorageInfo &operator=(const QStorageInfo &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QStorageInfo &operator=(QStorageInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QStorageInfo &operator=(QStorageInfo &&other) noexcept { swap(other); return *this; }
- inline void swap(QStorageInfo &other) Q_DECL_NOTHROW
+ inline void swap(QStorageInfo &other) noexcept
{ qSwap(d, other.d); }
void setPath(const QString &path);
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 07c80dda7c..1e72241e68 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -822,7 +822,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
valid = true;
ready = true;
-#if defined(Q_OS_INTEGRITY) || (defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD))
+#if defined(Q_OS_INTEGRITY) || (defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD)) || defined(Q_OS_RTEMS)
bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize;
bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize;
@@ -832,7 +832,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
#endif
blockSize = statfs_buf.f_bsize;
-#if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY)
+#if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY) || defined(Q_OS_RTEMS)
#if defined(_STATFS_F_FLAGS)
readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0;
#endif
diff --git a/src/corelib/io/qt_attribution.json b/src/corelib/io/qt_attribution.json
index 9b7dcc6b54..fe31e1474b 100644
--- a/src/corelib/io/qt_attribution.json
+++ b/src/corelib/io/qt_attribution.json
@@ -20,7 +20,7 @@ supported by Qt (by the QNetworkCookieJar class).",
"Homepage": "Consult https://github.com/publicsuffix/list for the sha1 but download from ...",
"Homepage": "http://publicsuffix.org/",
- "Version": "d6331e2b65fffbe9fe299dae1689db8de8fd6190, fetched on 2019-02-20",
+ "Version": "3bd641472776a5df4a8c6407da4a4846282cba94, fetched on 2019-10-23",
"License": "Mozilla Public License 2.0",
"LicenseFile": "PSL-LICENSE.txt",
"LicenseId": "MPL-2.0",
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index ced08a9a87..acd31f4d84 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -327,7 +327,7 @@ bool QTemporaryFileEngine::isReallyOpen() const
{
Q_D(const QFSFileEngine);
- if (!((0 == d->fh) && (-1 == d->fd)
+ if (!((nullptr == d->fh) && (-1 == d->fd)
#if defined Q_OS_WIN
&& (INVALID_HANDLE_VALUE == d->fileHandle)
#endif
@@ -544,10 +544,10 @@ QTemporaryFilePrivate::~QTemporaryFilePrivate()
QAbstractFileEngine *QTemporaryFilePrivate::engine() const
{
if (!fileEngine) {
- fileEngine = new QTemporaryFileEngine(&templateName);
+ fileEngine.reset(new QTemporaryFileEngine(&templateName));
resetFileEngine();
}
- return fileEngine;
+ return fileEngine.get();
}
void QTemporaryFilePrivate::resetFileEngine() const
@@ -555,7 +555,7 @@ void QTemporaryFilePrivate::resetFileEngine() const
if (!fileEngine)
return;
- QTemporaryFileEngine *tef = static_cast<QTemporaryFileEngine *>(fileEngine);
+ QTemporaryFileEngine *tef = static_cast<QTemporaryFileEngine *>(fileEngine.get());
if (fileName.isEmpty())
tef->initialize(templateName, 0600);
else
@@ -568,7 +568,7 @@ void QTemporaryFilePrivate::materializeUnnamedFile()
if (!fileName.isEmpty() || !fileEngine)
return;
- auto *tef = static_cast<QTemporaryFileEngine *>(fileEngine);
+ auto *tef = static_cast<QTemporaryFileEngine *>(fileEngine.get());
fileName = tef->fileName(QAbstractFileEngine::DefaultName);
#endif
}
@@ -792,7 +792,7 @@ void QTemporaryFile::setAutoRemove(bool b)
QString QTemporaryFile::fileName() const
{
Q_D(const QTemporaryFile);
- auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine.get());
if (tef && tef->isReallyOpen())
const_cast<QTemporaryFilePrivate *>(d)->materializeUnnamedFile();
@@ -841,7 +841,7 @@ void QTemporaryFile::setFileTemplate(const QString &name)
bool QTemporaryFile::rename(const QString &newName)
{
Q_D(QTemporaryFile);
- auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine.get());
if (!tef || !tef->isReallyOpen() || !tef->filePathWasTemplate)
return QFile::rename(newName);
@@ -902,7 +902,7 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
{
if (QAbstractFileEngine *engine = file.d_func()->engine()) {
if(engine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::LocalDiskFlag)
- return 0; //native already
+ return nullptr; // native already
//cache
bool wasOpen = file.isOpen();
qint64 old_off = 0;
@@ -934,7 +934,7 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
//done
return ret;
}
- return 0;
+ return nullptr;
}
/*!
@@ -947,7 +947,7 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
bool QTemporaryFile::open(OpenMode flags)
{
Q_D(QTemporaryFile);
- auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ auto tef = static_cast<QTemporaryFileEngine *>(d->fileEngine.get());
if (tef && tef->isReallyOpen()) {
setOpenMode(flags);
return true;
@@ -961,7 +961,7 @@ bool QTemporaryFile::open(OpenMode flags)
d->resetFileEngine();
if (QFile::open(flags)) {
- tef = static_cast<QTemporaryFileEngine *>(d->fileEngine);
+ tef = static_cast<QTemporaryFileEngine *>(d->fileEngine.get());
if (tef->isUnnamedFile())
d->fileName.clear();
else
diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h
index 0fec88d3cd..6bcff936b4 100644
--- a/src/corelib/io/qtemporaryfile_p.h
+++ b/src/corelib/io/qtemporaryfile_p.h
@@ -145,10 +145,10 @@ public:
bool isUnnamedFile() const override final;
const QString &templateName;
- quint32 fileMode;
+ quint32 fileMode = 0;
int flags = 0;
- bool filePathIsTemplate;
- bool filePathWasTemplate;
+ bool filePathIsTemplate = true;
+ bool filePathWasTemplate = true;
bool unnamedFile = false;
};
diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp
index a934d19fa2..fc3e16b241 100644
--- a/src/corelib/io/qtldurl.cpp
+++ b/src/corelib/io/qtldurl.cpp
@@ -59,9 +59,9 @@ enum TLDMatchType {
static bool containsTLDEntry(QStringView entry, TLDMatchType match)
{
const QStringView matchSymbols[] = {
- QStringViewLiteral(""),
- QStringViewLiteral("*"),
- QStringViewLiteral("!"),
+ u"",
+ u"*",
+ u"!",
};
const auto symbol = matchSymbols[match];
int index = qt_hash(entry, qt_hash(symbol)) % tldCount;
@@ -125,10 +125,10 @@ Q_CORE_EXPORT bool qIsEffectiveTLD(const QStringRef &domain)
return true;
const int dot = domain.indexOf(QLatin1Char('.'));
- if (dot >= 0) {
- if (containsTLDEntry(domain.mid(dot), SuffixMatch)) // 2
- return !containsTLDEntry(domain, ExceptionMatch); // 3
- }
+ if (dot < 0) // Actual TLD: may be effective if the subject of a wildcard rule:
+ return containsTLDEntry(QString(QLatin1Char('.') + domain), SuffixMatch);
+ if (containsTLDEntry(domain.mid(dot), SuffixMatch)) // 2
+ return !containsTLDEntry(domain, ExceptionMatch); // 3
return false;
}
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 6d82981fd6..878e007fb0 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -421,6 +421,7 @@
#include "private/qipaddress_p.h"
#include "qurlquery.h"
#include "private/qdir_p.h"
+#include <private/qmemory_p.h>
QT_BEGIN_NAMESPACE
@@ -520,10 +521,10 @@ public:
bool isEmpty() const
{ return sectionIsPresent == 0 && port == -1 && path.isEmpty(); }
- Error *cloneError() const;
+ std::unique_ptr<Error> cloneError() const;
void clearError();
void setError(ErrorCode errorCode, const QString &source, int supplement = -1);
- ErrorCode validityError(QString *source = 0, int *position = 0) const;
+ ErrorCode validityError(QString *source = nullptr, int *position = nullptr) const;
bool validateComponent(Section section, const QString &input, int begin, int end);
bool validateComponent(Section section, const QString &input)
{ return validateComponent(section, input, 0, uint(input.length())); }
@@ -576,7 +577,7 @@ public:
QString query;
QString fragment;
- Error *error;
+ std::unique_ptr<Error> error;
// not used for:
// - Port (port == -1 means absence)
@@ -591,7 +592,6 @@ public:
inline QUrlPrivate::QUrlPrivate()
: ref(1), port(-1),
- error(0),
sectionIsPresent(0),
flags(0)
{
@@ -613,19 +613,16 @@ inline QUrlPrivate::QUrlPrivate(const QUrlPrivate &copy)
}
inline QUrlPrivate::~QUrlPrivate()
-{
- delete error;
-}
+ = default;
-inline QUrlPrivate::Error *QUrlPrivate::cloneError() const
+std::unique_ptr<QUrlPrivate::Error> QUrlPrivate::cloneError() const
{
- return error ? new Error(*error) : 0;
+ return error ? qt_make_unique<Error>(*error) : nullptr;
}
inline void QUrlPrivate::clearError()
{
- delete error;
- error = 0;
+ error.reset();
}
inline void QUrlPrivate::setError(ErrorCode errorCode, const QString &source, int supplement)
@@ -634,7 +631,7 @@ inline void QUrlPrivate::setError(ErrorCode errorCode, const QString &source, in
// don't overwrite an error set in a previous section during parsing
return;
}
- error = new Error;
+ error = qt_make_unique<Error>();
error->code = errorCode;
error->source = source;
error->position = supplement;
@@ -826,7 +823,7 @@ recodeFromUser(const QString &input, const ushort *actions, int from, int to)
QString output;
const QChar *begin = input.constData() + from;
const QChar *end = input.constData() + to;
- if (qt_urlRecode(output, begin, end, 0, actions))
+ if (qt_urlRecode(output, begin, end, nullptr, actions))
return output;
return input.mid(from, to - from);
@@ -954,7 +951,7 @@ inline void QUrlPrivate::appendFragment(QString &appendTo, QUrl::FormattingOptio
{
appendToUser(appendTo, fragment, options,
options & QUrl::EncodeDelimiters ? fragmentInUrl :
- appendingTo == FullUrl ? 0 : fragmentInIsolation);
+ appendingTo == FullUrl ? nullptr : fragmentInIsolation);
}
inline void QUrlPrivate::appendQuery(QString &appendTo, QUrl::FormattingOptions options, Section appendingTo) const
@@ -1013,7 +1010,7 @@ inline bool QUrlPrivate::setScheme(const QString &value, int len, bool doSetErro
for (int i = needsLowercasing; i >= 0; --i) {
ushort c = schemeData[i].unicode();
if (c >= 'A' && c <= 'Z')
- schemeData[i] = c + 0x20;
+ schemeData[i] = QChar(c + 0x20);
}
}
@@ -1179,7 +1176,7 @@ inline void QUrlPrivate::appendHost(QString &appendTo, QUrl::FormattingOptions o
if (host.at(0).unicode() == '[') {
// IPv6 addresses might contain a zone-id which needs to be recoded
if (options != 0)
- if (qt_urlRecode(appendTo, host.constBegin(), host.constEnd(), options, 0))
+ if (qt_urlRecode(appendTo, host.constBegin(), host.constEnd(), options, nullptr))
return;
appendTo += host;
} else {
@@ -1221,7 +1218,7 @@ static const QChar *parseIpFuture(QString &host, const QChar *begin, const QChar
--end;
QString decoded;
- if (mode == QUrl::TolerantMode && qt_urlRecode(decoded, begin, end, QUrl::FullyDecoded, 0)) {
+ if (mode == QUrl::TolerantMode && qt_urlRecode(decoded, begin, end, QUrl::FullyDecoded, nullptr)) {
begin = decoded.constBegin();
end = decoded.constEnd();
}
@@ -1233,13 +1230,13 @@ static const QChar *parseIpFuture(QString &host, const QChar *begin, const QChar
host += *begin;
else if (begin->unicode() >= '0' && begin->unicode() <= '9')
host += *begin;
- else if (begin->unicode() < 0x80 && strchr(acceptable, begin->unicode()) != 0)
+ else if (begin->unicode() < 0x80 && strchr(acceptable, begin->unicode()) != nullptr)
host += *begin;
else
return decoded.isEmpty() ? begin : &origBegin[2];
}
host += QLatin1Char(']');
- return 0;
+ return nullptr;
}
return &origBegin[2];
}
@@ -1286,7 +1283,7 @@ static const QChar *parseIp6(QString &host, const QChar *begin, const QChar *end
host += zoneId;
}
host += QLatin1Char(']');
- return 0;
+ return nullptr;
}
inline bool QUrlPrivate::setHost(const QString &value, int from, int iend, QUrl::ParsingMode mode)
@@ -1352,7 +1349,7 @@ inline bool QUrlPrivate::setHost(const QString &value, int from, int iend, QUrl:
// check for percent-encoding first
QString s;
- if (mode == QUrl::TolerantMode && qt_urlRecode(s, begin, end, 0, 0)) {
+ if (mode == QUrl::TolerantMode && qt_urlRecode(s, begin, end, { }, nullptr)) {
// something was decoded
// anything encoded left?
int pos = s.indexOf(QChar(0x25)); // '%'
@@ -1837,7 +1834,7 @@ inline void QUrlPrivate::validate() const
\sa setUrl(), fromEncoded(), TolerantMode
*/
-QUrl::QUrl(const QString &url, ParsingMode parsingMode) : d(0)
+QUrl::QUrl(const QString &url, ParsingMode parsingMode) : d(nullptr)
{
setUrl(url, parsingMode);
}
@@ -1845,7 +1842,7 @@ QUrl::QUrl(const QString &url, ParsingMode parsingMode) : d(0)
/*!
Constructs an empty QUrl object.
*/
-QUrl::QUrl() : d(0)
+QUrl::QUrl() : d(nullptr)
{
}
@@ -1879,7 +1876,7 @@ QUrl::~QUrl()
bool QUrl::isValid() const
{
if (isEmpty()) {
- // also catches d == 0
+ // also catches d == nullptr
return false;
}
return d->validityError() == QUrlPrivate::NoError;
@@ -1907,7 +1904,7 @@ void QUrl::clear()
{
if (d && !d->ref.deref())
delete d;
- d = 0;
+ d = nullptr;
}
/*!
@@ -3266,10 +3263,10 @@ QUrl QUrl::resolved(const QUrl &relative) const
removeDotsFromPath(&t.d->path);
#if defined(QURL_DEBUG)
- qDebug("QUrl(\"%s\").resolved(\"%s\") = \"%s\"",
- qPrintable(url()),
- qPrintable(relative.url()),
- qPrintable(t.url()));
+ qDebug("QUrl(\"%ls\").resolved(\"%ls\") = \"%ls\"",
+ qUtf16Printable(url()),
+ qUtf16Printable(relative.url()),
+ qUtf16Printable(t.url()));
#endif
return t;
}
@@ -3805,7 +3802,7 @@ void QUrl::detach()
*/
bool QUrl::isDetached() const
{
- return !d || d->ref.load() == 1;
+ return !d || d->ref.loadRelaxed() == 1;
}
@@ -3994,21 +3991,21 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
return QString();
case QUrlPrivate::InvalidSchemeError: {
- QString msg = QStringLiteral("Invalid scheme (character '%1' not permitted)");
+ auto msg = QLatin1String("Invalid scheme (character '%1' not permitted)");
return msg.arg(c);
}
case QUrlPrivate::InvalidUserNameError:
- return QString(QStringLiteral("Invalid user name (character '%1' not permitted)"))
+ return QLatin1String("Invalid user name (character '%1' not permitted)")
.arg(c);
case QUrlPrivate::InvalidPasswordError:
- return QString(QStringLiteral("Invalid password (character '%1' not permitted)"))
+ return QLatin1String("Invalid password (character '%1' not permitted)")
.arg(c);
case QUrlPrivate::InvalidRegNameError:
if (errorPosition != -1)
- return QString(QStringLiteral("Invalid hostname (character '%1' not permitted)"))
+ return QLatin1String("Invalid hostname (character '%1' not permitted)")
.arg(c);
else
return QStringLiteral("Invalid hostname (contains invalid characters)");
@@ -4017,9 +4014,9 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
case QUrlPrivate::InvalidIPv6AddressError:
return QStringLiteral("Invalid IPv6 address");
case QUrlPrivate::InvalidCharacterInIPv6Error:
- return QStringLiteral("Invalid IPv6 address (character '%1' not permitted)").arg(c);
+ return QLatin1String("Invalid IPv6 address (character '%1' not permitted)").arg(c);
case QUrlPrivate::InvalidIPvFutureError:
- return QStringLiteral("Invalid IPvFuture address (character '%1' not permitted)").arg(c);
+ return QLatin1String("Invalid IPvFuture address (character '%1' not permitted)").arg(c);
case QUrlPrivate::HostMissingEndBracket:
return QStringLiteral("Expected ']' to match '[' in hostname");
@@ -4029,15 +4026,15 @@ static QString errorMessage(QUrlPrivate::ErrorCode errorCode, const QString &err
return QStringLiteral("Port field was empty");
case QUrlPrivate::InvalidPathError:
- return QString(QStringLiteral("Invalid path (character '%1' not permitted)"))
+ return QLatin1String("Invalid path (character '%1' not permitted)")
.arg(c);
case QUrlPrivate::InvalidQueryError:
- return QString(QStringLiteral("Invalid query (character '%1' not permitted)"))
+ return QLatin1String("Invalid query (character '%1' not permitted)")
.arg(c);
case QUrlPrivate::InvalidFragmentError:
- return QString(QStringLiteral("Invalid fragment (character '%1' not permitted)"))
+ return QLatin1String("Invalid fragment (character '%1' not permitted)")
.arg(c);
case QUrlPrivate::AuthorityPresentAndPathIsRelative:
@@ -4159,7 +4156,7 @@ QList<QUrl> QUrl::fromStringList(const QStringList &urls, ParsingMode mode)
\relates QHash
\since 5.0
*/
-uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW
+uint qHash(const QUrl &url, uint seed) noexcept
{
if (!url.d)
return qHash(-1, seed); // the hash of an unset port (-1)
@@ -4187,7 +4184,7 @@ static QUrl adjustFtpPath(QUrl url)
static bool isIp6(const QString &text)
{
QIPAddressUtils::IPv6Address address;
- return !text.isEmpty() && QIPAddressUtils::parseIp6(address, text.begin(), text.end()) == 0;
+ return !text.isEmpty() && QIPAddressUtils::parseIp6(address, text.begin(), text.end()) == nullptr;
}
/*!
diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h
index 5062ef7905..94269e4369 100644
--- a/src/corelib/io/qurl.h
+++ b/src/corelib/io/qurl.h
@@ -119,7 +119,7 @@ class QTypeInfo<QUrlTwoFlags<E1, E2> > : public QTypeInfoMerger<QUrlTwoFlags<E1,
class QUrl;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed = 0) noexcept;
class Q_CORE_EXPORT QUrl
{
@@ -182,15 +182,13 @@ public:
QUrl(const QString &url, ParsingMode mode = TolerantMode);
QUrl &operator=(const QString &url);
#endif
-#ifdef Q_COMPILER_RVALUE_REFS
- QUrl(QUrl &&other) Q_DECL_NOTHROW : d(other.d)
+ QUrl(QUrl &&other) noexcept : d(other.d)
{ other.d = nullptr; }
- inline QUrl &operator=(QUrl &&other) Q_DECL_NOTHROW
+ inline QUrl &operator=(QUrl &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
~QUrl();
- inline void swap(QUrl &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QUrl &other) noexcept { qSwap(d, other.d); }
void setUrl(const QString &url, ParsingMode mode = TolerantMode);
QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const;
@@ -361,7 +359,7 @@ public:
static QList<QUrl> fromStringList(const QStringList &uris, ParsingMode mode = TolerantMode);
static void setIdnWhitelist(const QStringList &);
- friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) noexcept;
private:
QUrlPrivate *d;
diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h
index 1b9237e58a..e75de32e03 100644
--- a/src/corelib/io/qurl_p.h
+++ b/src/corelib/io/qurl_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
// in qurlrecode.cpp
extern Q_AUTOTEST_EXPORT int qt_urlRecode(QString &appendTo, const QChar *begin, const QChar *end,
- QUrl::ComponentFormattingOptions encoding, const ushort *tableModifications = 0);
+ QUrl::ComponentFormattingOptions encoding, const ushort *tableModifications = nullptr);
// in qurlidna.cpp
enum AceLeadingDot { AllowLeadingDot, ForbidLeadingDot };
diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp
index 2305e66407..a2f0caa606 100644
--- a/src/corelib/io/qurlidna.cpp
+++ b/src/corelib/io/qurlidna.cpp
@@ -1444,7 +1444,7 @@ static void mapToLowerCase(QString *str, int from)
{
int N = sizeof(NameprepCaseFolding) / sizeof(NameprepCaseFolding[0]);
- ushort *d = 0;
+ ushort *d = nullptr;
for (int i = from; i < str->size(); ++i) {
uint uc = str->at(i).unicode();
if (uc < 0x80) {
@@ -1474,7 +1474,7 @@ static void mapToLowerCase(QString *str, int from)
else
str->replace(--i, 2, reinterpret_cast<const QChar *>(&entry->mapping[0]), l);
i += l - 1;
- d = 0;
+ d = nullptr;
} else {
if (!d)
d = reinterpret_cast<ushort *>(str->data());
@@ -2220,9 +2220,8 @@ Q_AUTOTEST_EXPORT void qt_punycodeEncoder(const QChar *s, int ucLength, QString
bool skipped = false;
// copy all basic code points verbatim to output.
for (uint j = 0; j < (uint) ucLength; ++j) {
- ushort js = s[j].unicode();
- if (js < 0x80)
- *d++ = js;
+ if (s[j].unicode() < 0x80)
+ *d++ = s[j];
else
skipped = true;
}
@@ -2404,7 +2403,7 @@ static const char * const idn_whitelist[] = {
};
static const size_t idn_whitelist_size = sizeof idn_whitelist / sizeof *idn_whitelist;
-static QStringList *user_idn_whitelist = 0;
+static QStringList *user_idn_whitelist = nullptr;
static bool lessThan(const QChar *a, int l, const char *c)
{
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp
index 73a94cd5d5..8d80a2d8bd 100644
--- a/src/corelib/io/qurlquery.cpp
+++ b/src/corelib/io/qurlquery.cpp
@@ -189,7 +189,7 @@ public:
template<> void QSharedDataPointer<QUrlQueryPrivate>::detach()
{
- if (d && d->ref.load() == 1)
+ if (d && d->ref.loadRelaxed() == 1)
return;
QUrlQueryPrivate *x = (d ? new QUrlQueryPrivate(*d)
: new QUrlQueryPrivate);
@@ -262,7 +262,7 @@ inline QString QUrlQueryPrivate::recodeToUser(const QString &input, QUrl::Compon
if (!(encoding & QUrl::EncodeDelimiters)) {
QString output;
if (qt_urlRecode(output, input.constData(), input.constData() + input.length(),
- encoding, 0))
+ encoding, nullptr))
return output;
return input;
}
@@ -290,12 +290,12 @@ void QUrlQueryPrivate::setQuery(const QString &query)
const QChar *const end = pos + query.size();
while (pos != end) {
const QChar *begin = pos;
- const QChar *delimiter = 0;
+ const QChar *delimiter = nullptr;
while (pos != end) {
// scan for the component parts of this pair
- if (!delimiter && pos->unicode() == valueDelimiter)
+ if (!delimiter && *pos == valueDelimiter)
delimiter = pos;
- if (pos->unicode() == pairDelimiter)
+ if (*pos == pairDelimiter)
break;
++pos;
}
@@ -345,7 +345,7 @@ QSharedDataPointer<QUrlQueryPrivate>::clone()
\sa setQuery(), addQueryItem()
*/
QUrlQuery::QUrlQuery()
- : d(0)
+ : d(nullptr)
{
}
@@ -356,7 +356,7 @@ QUrlQuery::QUrlQuery()
set the query with setQuery().
*/
QUrlQuery::QUrlQuery(const QString &queryString)
- : d(queryString.isEmpty() ? 0 : new QUrlQueryPrivate(queryString))
+ : d(queryString.isEmpty() ? nullptr : new QUrlQueryPrivate(queryString))
{
}
@@ -369,7 +369,7 @@ QUrlQuery::QUrlQuery(const QString &queryString)
\sa QUrl::query()
*/
QUrlQuery::QUrlQuery(const QUrl &url)
- : d(0)
+ : d(nullptr)
{
// use internals to avoid unnecessary recoding
// ### FIXME: actually do it
@@ -434,7 +434,7 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const
Returns the hash value for \a key,
using \a seed to seed the calculation.
*/
-uint qHash(const QUrlQuery &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QUrlQuery &key, uint seed) noexcept
{
if (const QUrlQueryPrivate *d = key.d) {
QtPrivate::QHashCombine hash;
@@ -462,7 +462,7 @@ bool QUrlQuery::isEmpty() const
*/
bool QUrlQuery::isDetached() const
{
- return d && d->ref.load() == 1;
+ return d && d->ref.loadRelaxed() == 1;
}
/*!
@@ -584,8 +584,8 @@ QString QUrlQuery::query(QUrl::ComponentFormattingOptions encoding) const
*/
void QUrlQuery::setQueryDelimiters(QChar valueDelimiter, QChar pairDelimiter)
{
- d->valueDelimiter = valueDelimiter.unicode();
- d->pairDelimiter = pairDelimiter.unicode();
+ d->valueDelimiter = valueDelimiter;
+ d->pairDelimiter = pairDelimiter;
}
/*!
diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h
index e3688aae2c..89d0f88059 100644
--- a/src/corelib/io/qurlquery.h
+++ b/src/corelib/io/qurlquery.h
@@ -52,7 +52,7 @@
QT_BEGIN_NAMESPACE
-Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed = 0) noexcept;
class QUrlQueryPrivate;
class Q_CORE_EXPORT QUrlQuery
@@ -70,16 +70,14 @@ public:
QUrlQuery(const QUrlQuery &other);
QUrlQuery &operator=(const QUrlQuery &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QUrlQuery &operator=(QUrlQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QUrlQuery &operator=(QUrlQuery &&other) noexcept { swap(other); return *this; }
~QUrlQuery();
bool operator==(const QUrlQuery &other) const;
bool operator!=(const QUrlQuery &other) const
{ return !(*this == other); }
- void swap(QUrlQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QUrlQuery &other) noexcept { qSwap(d, other.d); }
bool isEmpty() const;
bool isDetached() const;
@@ -111,7 +109,7 @@ public:
private:
friend class QUrl;
- friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) noexcept;
QSharedDataPointer<QUrlQueryPrivate> d;
public:
typedef QSharedDataPointer<QUrlQueryPrivate> DataPtr;
diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp
index 443ae18b21..35ede8d078 100644
--- a/src/corelib/io/qurlrecode.cpp
+++ b/src/corelib/io/qurlrecode.cpp
@@ -377,7 +377,7 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl:
{
const int origSize = result.size();
const ushort *input = begin;
- ushort *output = 0;
+ ushort *output = nullptr;
EncodingAction action = EncodeCharacter;
for ( ; input != end; ++input) {
@@ -692,7 +692,7 @@ qt_urlRecode(QString &appendTo, const QChar *begin, const QChar *end,
}
// qstring.cpp
-bool qt_is_ascii(const char *&ptr, const char *end) Q_DECL_NOTHROW;
+bool qt_is_ascii(const char *&ptr, const char *end) noexcept;
/*!
\internal
diff --git a/src/corelib/io/qurltlds_p.h b/src/corelib/io/qurltlds_p.h
index 043e84e5ab..9ff688decb 100644
--- a/src/corelib/io/qurltlds_p.h
+++ b/src/corelib/io/qurltlds_p.h
@@ -61,14137 +61,14302 @@ QT_BEGIN_NAMESPACE
// for instructions see the program at
// util/corelib/qurl-generateTLDs/
-static const quint16 tldCount = 8666;
+static const quint16 tldCount = 8799;
static const quint32 tldIndices[] = {
0,
-7,
-24,
-31,
-58,
-65,
-79,
-103,
-137,
-137,
-158,
-194,
-220,
-255,
-255,
-298,
-298,
-298,
-298,
-298,
-311,
-311,
-311,
-311,
-323,
-359,
-383,
-383,
-400,
-400,
-421,
-421,
-441,
-441,
-448,
-490,
-490,
-497,
-502,
-520,
-542,
-549,
-597,
-611,
-611,
-635,
-642,
-649,
-668,
-683,
-683,
-683,
-700,
-705,
+29,
+29,
+36,
+36,
+69,
+83,
+97,
+116,
+123,
+133,
+140,
+171,
+186,
+193,
+200,
+200,
+200,
+200,
+225,
+263,
+272,
+305,
+332,
+332,
+378,
+388,
+395,
+425,
+444,
+449,
+449,
+459,
+459,
+459,
+459,
+484,
+513,
+538,
+538,
+538,
+563,
+563,
+580,
+599,
+618,
+618,
+660,
+670,
+670,
+670,
+670,
+682,
712,
-724,
-724,
-740,
-765,
-765,
-776,
-787,
-802,
-810,
-820,
-841,
-848,
-848,
-858,
-858,
-864,
-871,
-871,
-871,
-881,
-898,
-930,
-958,
-972,
-985,
-999,
-1006,
-1013,
+718,
+750,
+790,
+790,
+812,
+834,
+851,
+869,
+912,
+937,
+977,
+977,
+977,
+977,
+977,
+987,
+987,
+1002,
+1015,
+1024,
1030,
-1056,
-1063,
-1086,
-1086,
-1086,
-1093,
-1100,
-1107,
-1117,
-1117,
-1117,
-1117,
-1128,
-1153,
-1153,
-1180,
-1186,
-1186,
-1193,
-1221,
-1239,
-1239,
-1252,
-1279,
-1286,
-1286,
-1293,
-1307,
-1325,
-1348,
-1348,
-1348,
-1355,
-1355,
-1355,
-1355,
-1373,
-1395,
-1395,
+1051,
+1051,
+1061,
+1070,
+1076,
+1076,
+1076,
+1094,
+1129,
+1158,
+1195,
+1195,
+1195,
+1215,
+1234,
+1234,
+1245,
+1245,
+1245,
+1245,
+1245,
+1268,
+1276,
+1291,
+1297,
+1304,
+1316,
+1337,
+1379,
+1397,
+1408,
1413,
-1440,
-1440,
-1440,
-1440,
-1447,
-1457,
-1464,
-1498,
-1498,
-1498,
-1572,
-1606,
-1613,
-1613,
-1613,
-1620,
-1625,
-1632,
-1651,
-1658,
-1672,
-1688,
-1704,
+1429,
+1429,
+1429,
+1429,
+1444,
+1467,
+1476,
+1476,
+1505,
+1505,
+1505,
+1523,
+1523,
+1547,
+1547,
+1566,
+1590,
+1590,
+1600,
+1612,
+1612,
+1612,
+1612,
+1631,
+1674,
1712,
1712,
-1729,
+1722,
+1730,
1751,
-1757,
-1771,
-1787,
-1831,
-1831,
-1831,
-1831,
-1848,
-1919,
-1926,
-1926,
-1926,
-1949,
-1961,
-1961,
-1981,
-2001,
-2001,
-2001,
-2009,
-2028,
-2028,
-2035,
-2054,
-2054,
-2077,
-2107,
+1751,
+1769,
+1769,
+1769,
+1784,
+1784,
+1817,
+1817,
+1817,
+1817,
+1817,
+1817,
+1837,
+1837,
+1850,
+1850,
+1850,
+1850,
+1871,
+1914,
+1914,
+1932,
+1960,
+1960,
+1967,
+1977,
+1977,
+1977,
+1977,
+2015,
+2038,
+2071,
+2090,
+2090,
+2105,
2121,
-2137,
+2136,
+2157,
2157,
-2196,
-2196,
-2217,
-2235,
-2235,
-2243,
-2243,
-2259,
-2259,
-2283,
-2290,
-2290,
-2316,
-2329,
-2356,
-2356,
-2356,
-2356,
-2356,
-2393,
-2414,
-2428,
-2428,
-2440,
-2481,
-2487,
-2487,
-2487,
-2507,
-2507,
-2507,
-2546,
-2562,
-2562,
-2580,
-2607,
-2614,
-2626,
-2649,
-2649,
-2665,
-2675,
-2682,
-2721,
-2731,
-2737,
-2765,
-2770,
-2770,
-2803,
-2803,
-2813,
-2833,
-2855,
-2855,
-2855,
-2863,
-2863,
-2863,
-2880,
-2888,
-2896,
-2896,
-2903,
-2903,
-2910,
-2910,
+2209,
+2216,
+2231,
+2231,
+2231,
+2231,
+2231,
+2238,
+2238,
+2247,
+2271,
+2318,
+2331,
+2346,
+2359,
+2368,
+2368,
+2368,
+2377,
+2377,
+2377,
+2377,
+2386,
+2391,
+2391,
+2391,
+2398,
+2398,
+2405,
+2461,
+2485,
+2513,
+2513,
+2543,
+2550,
+2550,
+2579,
+2579,
+2579,
+2579,
+2590,
+2630,
+2630,
+2673,
+2673,
+2673,
+2673,
+2673,
+2700,
+2700,
+2700,
+2706,
+2706,
+2767,
+2786,
+2794,
+2818,
+2818,
+2824,
+2835,
+2850,
+2850,
+2868,
+2868,
+2868,
+2875,
+2875,
+2894,
+2912,
+2928,
2928,
2928,
-2935,
-2999,
-2999,
-3031,
-3031,
-3050,
-3100,
-3141,
-3141,
-3141,
-3147,
-3185,
-3185,
-3197,
-3197,
-3234,
-3241,
-3248,
-3257,
-3272,
-3272,
-3272,
-3309,
-3328,
-3328,
-3346,
-3356,
-3356,
-3356,
-3356,
-3364,
-3392,
-3392,
-3413,
-3441,
-3465,
-3465,
-3465,
-3465,
-3482,
-3482,
-3487,
-3487,
-3487,
-3487,
-3487,
-3497,
-3497,
-3510,
-3510,
-3519,
-3519,
-3519,
-3519,
-3519,
-3519,
-3530,
-3530,
-3541,
-3568,
-3568,
-3568,
-3586,
-3586,
-3606,
-3627,
-3637,
-3637,
-3645,
-3667,
-3667,
-3708,
-3721,
-3740,
-3762,
-3762,
-3762,
-3762,
-3762,
-3762,
-3775,
-3775,
-3790,
-3812,
-3812,
-3818,
-3818,
-3834,
-3845,
-3881,
-3904,
-3904,
+2946,
+2946,
+2956,
+2956,
+2956,
+2956,
+2956,
+2956,
+2974,
+2974,
+2995,
+2995,
+2995,
+3008,
+3014,
+3022,
+3060,
+3060,
+3073,
+3120,
+3127,
+3135,
+3145,
+3200,
+3210,
+3210,
+3210,
+3210,
+3210,
+3210,
+3210,
+3227,
+3244,
+3255,
+3276,
+3285,
+3285,
+3293,
+3293,
+3293,
+3293,
+3332,
+3377,
+3377,
+3384,
+3402,
+3416,
+3416,
+3442,
+3442,
+3442,
+3442,
+3461,
+3461,
+3461,
+3474,
+3474,
+3499,
+3529,
+3540,
+3591,
+3602,
+3602,
+3602,
+3602,
+3624,
+3661,
+3661,
+3668,
+3668,
+3700,
+3733,
+3737,
+3753,
+3799,
+3817,
+3839,
+3839,
+3839,
+3863,
+3894,
3910,
-3937,
-3937,
-3937,
-3943,
-3950,
-3950,
-3969,
-3999,
-4017,
-4017,
-4017,
-4017,
-4033,
-4033,
-4033,
-4033,
-4098,
-4135,
-4159,
-4159,
-4159,
-4159,
-4159,
-4169,
-4189,
-4205,
-4239,
-4261,
-4261,
-4261,
-4261,
-4261,
-4261,
-4278,
-4278,
-4293,
-4308,
-4317,
-4336,
-4343,
-4371,
-4371,
-4376,
-4376,
-4376,
-4399,
-4409,
-4424,
-4451,
-4473,
-4473,
-4473,
-4489,
-4489,
-4526,
-4532,
-4532,
-4538,
-4570,
-4570,
-4570,
-4613,
-4632,
-4643,
-4688,
-4688,
-4726,
-4771,
-4783,
-4799,
-4799,
-4865,
-4865,
-4865,
-4885,
-4909,
-4909,
-4926,
-4926,
-4956,
-4994,
-5010,
-5010,
-5020,
-5041,
-5056,
-5075,
-5092,
-5122,
-5122,
-5122,
-5122,
-5130,
-5157,
-5164,
+3920,
+3920,
+3936,
+3936,
+3947,
+3981,
+3993,
+3993,
+4019,
+4019,
+4023,
+4030,
+4038,
+4038,
+4038,
+4038,
+4038,
+4038,
+4038,
+4038,
+4038,
+4054,
+4054,
+4069,
+4082,
+4088,
+4116,
+4116,
+4120,
+4146,
+4160,
+4177,
+4177,
+4195,
+4204,
+4204,
+4204,
+4214,
+4214,
+4214,
+4229,
+4229,
+4229,
+4229,
+4244,
+4257,
+4265,
+4265,
+4279,
+4290,
+4329,
+4385,
+4385,
+4385,
+4385,
+4396,
+4400,
+4447,
+4465,
+4465,
+4471,
+4492,
+4507,
+4513,
+4513,
+4525,
+4531,
+4531,
+4558,
+4575,
+4591,
+4617,
+4653,
+4658,
+4658,
+4666,
+4712,
+4712,
+4718,
+4718,
+4735,
+4745,
+4745,
+4751,
+4751,
+4772,
+4812,
+4835,
+4835,
+4842,
+4864,
+4864,
+4881,
+4881,
+4897,
+4908,
+4917,
+4933,
+4948,
+4968,
+4968,
+4968,
+4968,
+4974,
+4998,
+5031,
+5038,
+5053,
+5067,
+5083,
+5116,
+5126,
+5133,
+5155,
+5155,
+5155,
+5155,
+5155,
+5155,
+5155,
+5168,
+5173,
+5173,
5177,
-5194,
-5200,
-5200,
-5211,
-5224,
-5241,
-5241,
-5273,
-5273,
-5273,
-5294,
-5294,
-5294,
-5343,
-5343,
-5350,
-5386,
+5188,
+5226,
+5226,
+5271,
+5271,
+5282,
+5282,
+5296,
+5313,
+5313,
+5313,
+5333,
+5333,
+5333,
+5342,
+5358,
+5358,
+5370,
+5374,
+5396,
+5396,
5396,
-5403,
+5413,
+5413,
+5413,
+5413,
+5413,
+5413,
+5413,
5417,
-5449,
-5463,
-5463,
-5480,
-5490,
-5541,
-5591,
-5597,
-5604,
-5604,
-5625,
-5639,
-5649,
-5649,
-5649,
-5666,
-5685,
-5705,
-5705,
-5705,
-5723,
-5772,
-5783,
-5790,
-5804,
-5837,
-5878,
-5915,
-5915,
-5915,
-5937,
-5984,
-5989,
-5989,
-5989,
-6006,
-6051,
-6051,
-6073,
-6080,
-6080,
-6089,
-6100,
-6149,
-6164,
-6169,
-6207,
-6214,
-6242,
-6278,
-6284,
-6290,
-6303,
-6326,
-6383,
-6399,
-6416,
-6416,
-6437,
-6444,
-6457,
-6463,
-6463,
-6477,
-6520,
-6535,
-6555,
-6555,
-6555,
-6555,
-6603,
-6652,
-6652,
-6670,
-6691,
-6698,
-6698,
-6712,
-6712,
-6719,
-6719,
-6726,
-6739,
-6778,
-6778,
-6797,
-6797,
-6807,
-6807,
-6830,
-6830,
-6842,
-6865,
-6865,
-6865,
-6869,
-6875,
-6888,
-6888,
-6888,
-6910,
-6926,
+5417,
+5467,
+5473,
+5473,
+5524,
+5539,
+5578,
+5585,
+5585,
+5585,
+5600,
+5600,
+5600,
+5600,
+5631,
+5642,
+5642,
+5642,
+5642,
+5669,
+5676,
+5683,
+5690,
+5708,
+5721,
+5721,
+5734,
+5743,
+5758,
+5799,
+5817,
+5835,
+5835,
+5835,
+5841,
+5841,
+5872,
+5872,
+5888,
+5904,
+5917,
+5952,
+5952,
+5997,
+6010,
+6044,
+6054,
+6078,
+6078,
+6116,
+6128,
+6128,
+6128,
+6137,
+6137,
+6143,
+6143,
+6143,
+6155,
+6160,
+6160,
+6160,
+6160,
+6160,
+6173,
+6173,
+6173,
+6189,
+6189,
+6189,
+6205,
+6237,
+6237,
+6252,
+6252,
+6263,
+6263,
+6296,
+6321,
+6321,
+6321,
+6328,
+6343,
+6343,
+6373,
+6391,
+6391,
+6426,
+6426,
+6436,
+6475,
+6489,
+6507,
+6511,
+6511,
+6515,
+6530,
+6530,
+6548,
+6548,
+6552,
+6552,
+6572,
+6572,
+6622,
+6651,
+6651,
+6668,
+6668,
+6693,
+6731,
+6731,
+6746,
+6775,
+6787,
+6787,
+6787,
+6787,
+6787,
+6787,
+6787,
+6787,
+6787,
+6802,
+6806,
+6810,
+6823,
+6823,
+6834,
+6870,
+6874,
6933,
-6944,
-6964,
-6980,
-6980,
-7024,
-7024,
-7024,
-7024,
-7036,
-7058,
-7068,
-7068,
-7083,
-7087,
-7109,
-7117,
-7124,
-7143,
-7159,
-7194,
-7194,
-7194,
-7201,
-7208,
+6954,
+6966,
+6966,
+6966,
+6966,
+6982,
+6982,
+6982,
+6988,
+6998,
+7028,
+7037,
+7037,
+7070,
+7070,
+7098,
+7098,
+7098,
+7127,
+7153,
+7153,
+7164,
+7164,
+7174,
+7174,
+7174,
+7205,
+7205,
+7224,
7224,
-7231,
-7262,
-7309,
-7323,
-7352,
-7352,
-7359,
-7366,
-7366,
-7381,
-7381,
-7412,
-7412,
-7449,
-7459,
-7459,
-7487,
-7487,
-7487,
-7487,
-7527,
-7545,
-7559,
-7559,
-7559,
-7559,
-7559,
-7564,
-7564,
-7595,
-7602,
-7626,
-7643,
-7655,
-7655,
-7682,
-7701,
-7725,
-7736,
-7751,
-7765,
-7832,
-7852,
-7906,
-7965,
-7965,
-7976,
-7976,
-8024,
-8041,
-8058,
-8071,
-8084,
-8105,
-8105,
-8115,
-8144,
-8160,
-8182,
-8210,
+7240,
+7240,
+7284,
+7284,
+7284,
+7284,
+7284,
+7284,
+7301,
+7318,
+7364,
+7364,
+7374,
+7401,
+7424,
+7424,
+7443,
+7448,
+7448,
+7448,
+7448,
+7448,
+7462,
+7462,
+7462,
+7462,
+7462,
+7462,
+7462,
+7466,
+7466,
+7488,
+7488,
+7498,
+7502,
+7520,
+7530,
+7530,
+7530,
+7534,
+7540,
+7540,
+7540,
+7547,
+7547,
+7547,
+7561,
+7571,
+7571,
+7571,
+7582,
+7582,
+7603,
+7603,
+7617,
+7628,
+7647,
+7666,
+7666,
+7666,
+7694,
+7707,
+7738,
+7750,
+7768,
+7825,
+7864,
+7880,
+7880,
+7880,
+7880,
+7880,
+7893,
+7893,
+7893,
+7898,
+7911,
+7917,
+7944,
+7944,
+7989,
+7989,
+7989,
+7989,
+7989,
+7989,
+8006,
+8037,
+8037,
+8037,
+8063,
+8074,
+8091,
+8113,
+8135,
+8148,
+8148,
+8162,
+8162,
+8169,
+8169,
+8176,
+8197,
+8197,
+8197,
+8216,
8216,
-8229,
-8229,
-8234,
-8282,
-8282,
-8282,
-8289,
-8305,
-8312,
-8312,
-8312,
-8312,
-8319,
+8216,
+8230,
+8230,
+8240,
+8240,
+8246,
+8257,
+8262,
+8279,
+8279,
+8286,
+8286,
+8296,
+8313,
+8313,
+8334,
+8339,
+8339,
+8353,
+8353,
+8363,
8363,
-8401,
-8408,
-8415,
-8415,
-8425,
-8454,
-8464,
-8464,
-8482,
-8505,
-8542,
-8542,
-8557,
-8603,
-8629,
-8629,
-8643,
-8643,
-8667,
-8690,
-8690,
-8714,
-8721,
-8721,
-8726,
-8746,
+8370,
+8370,
+8384,
+8384,
+8430,
+8458,
+8458,
+8492,
+8511,
+8511,
+8518,
+8565,
+8565,
+8565,
+8565,
+8565,
+8637,
+8665,
+8675,
+8701,
+8708,
+8708,
+8744,
+8754,
+8754,
8766,
-8783,
-8790,
-8804,
-8833,
-8840,
-8863,
-8870,
-8884,
-8934,
-8956,
-8956,
-8956,
-8956,
-8965,
-8991,
-8991,
-8997,
-9007,
-9007,
-9013,
-9031,
-9031,
-9038,
-9059,
-9066,
-9073,
-9090,
-9105,
-9109,
-9116,
-9120,
-9120,
-9178,
-9233,
-9241,
-9259,
-9275,
-9275,
-9275,
-9292,
-9299,
-9299,
-9318,
-9332,
-9351,
-9358,
-9400,
-9422,
-9497,
-9513,
-9517,
-9517,
-9530,
-9537,
-9552,
-9592,
-9592,
-9608,
-9627,
-9643,
-9643,
-9643,
-9653,
-9653,
-9683,
-9691,
-9723,
-9733,
-9758,
-9762,
-9762,
-9762,
-9842,
-9842,
-9871,
-9871,
-9890,
-9904,
-9911,
-9918,
-9932,
-9949,
-9969,
-10000,
-10024,
-10024,
-10055,
-10055,
-10082,
-10098,
-10098,
-10126,
-10126,
-10138,
-10138,
-10147,
-10174,
-10174,
-10174,
+8814,
+8826,
+8838,
+8865,
+8865,
+8882,
+8892,
+8892,
+8899,
+8899,
+8905,
+8918,
+8928,
+8935,
+8962,
+8975,
+8975,
+8986,
+9019,
+9019,
+9063,
+9071,
+9077,
+9089,
+9111,
+9118,
+9118,
+9118,
+9118,
+9139,
+9165,
+9202,
+9212,
+9225,
+9237,
+9267,
+9291,
+9291,
+9291,
+9322,
+9322,
+9330,
+9330,
+9330,
+9338,
+9355,
+9423,
+9423,
+9429,
+9447,
+9468,
+9480,
+9480,
+9480,
+9545,
+9600,
+9606,
+9615,
+9615,
+9640,
+9671,
+9671,
+9671,
+9744,
+9744,
+9783,
+9783,
+9783,
+9796,
+9814,
+9833,
+9838,
+9857,
+9857,
+9864,
+9902,
+9922,
+9944,
+9944,
+9976,
+9976,
+10001,
+10006,
+10023,
+10023,
+10029,
+10037,
+10054,
+10054,
+10054,
+10072,
+10072,
+10072,
+10094,
+10112,
+10144,
+10158,
10174,
10196,
-10203,
-10210,
-10210,
-10210,
-10233,
-10245,
-10252,
-10252,
-10282,
-10289,
-10300,
-10346,
-10369,
-10375,
-10402,
-10402,
-10402,
-10402,
-10423,
-10444,
-10453,
-10473,
-10497,
-10503,
-10513,
-10531,
-10579,
-10595,
-10602,
-10602,
-10602,
-10627,
-10648,
-10659,
-10659,
-10674,
-10674,
-10681,
-10706,
-10706,
-10722,
-10760,
-10760,
-10772,
-10785,
-10785,
-10785,
-10796,
-10815,
-10836,
-10836,
-10844,
-10875,
-10875,
-10875,
-10875,
-10885,
-10885,
-10892,
-10892,
-10892,
-10892,
-10920,
-10920,
-10963,
-10963,
-10963,
-10970,
-10977,
-11007,
-11007,
-11007,
-11007,
-11007,
-11031,
-11041,
-11051,
-11070,
-11078,
-11078,
-11078,
-11091,
-11101,
-11101,
-11123,
-11129,
-11139,
-11155,
-11191,
-11233,
-11233,
-11233,
-11244,
-11244,
-11256,
-11262,
-11262,
-11262,
-11262,
-11278,
-11285,
-11285,
-11314,
-11335,
-11341,
-11359,
-11359,
-11387,
+10213,
+10213,
+10235,
+10254,
+10279,
+10291,
+10311,
+10326,
+10366,
+10383,
+10393,
+10399,
+10399,
+10399,
+10431,
+10431,
+10431,
+10431,
+10431,
+10440,
+10459,
+10472,
+10472,
+10495,
+10507,
+10537,
+10582,
+10598,
+10612,
+10626,
+10666,
+10684,
+10690,
+10710,
+10725,
+10765,
+10783,
+10783,
+10802,
+10825,
+10825,
+10843,
+10853,
+10865,
+10902,
+10902,
+10953,
+10953,
+10984,
+10990,
+10990,
+10990,
+10990,
+11027,
+11036,
+11036,
+11036,
+11036,
+11057,
+11073,
+11073,
+11073,
+11082,
+11082,
+11082,
+11137,
+11142,
+11152,
+11168,
+11181,
+11181,
+11181,
+11181,
+11199,
+11199,
+11212,
+11226,
+11253,
+11271,
+11287,
+11311,
+11322,
+11340,
+11356,
+11380,
+11380,
11401,
-11408,
-11442,
-11442,
-11463,
-11463,
-11470,
-11492,
-11492,
-11492,
-11492,
-11503,
-11537,
+11407,
+11420,
+11475,
+11514,
+11523,
+11529,
+11529,
11547,
11572,
11572,
-11591,
-11610,
-11610,
-11618,
-11636,
-11652,
-11652,
-11652,
-11675,
-11675,
-11675,
-11675,
+11588,
+11588,
+11588,
+11602,
+11602,
+11602,
+11608,
+11625,
+11641,
+11676,
+11683,
+11683,
+11683,
11699,
-11710,
-11710,
-11738,
-11748,
-11748,
-11748,
-11768,
-11768,
-11768,
-11768,
-11768,
-11778,
-11778,
-11788,
-11812,
-11820,
-11820,
-11835,
+11706,
+11706,
+11706,
+11723,
+11729,
+11729,
+11761,
+11767,
+11767,
+11767,
+11799,
+11810,
+11810,
+11810,
+11810,
+11810,
+11810,
+11810,
+11810,
+11810,
+11810,
+11810,
+11823,
+11838,
+11838,
+11846,
11852,
-11872,
-11872,
-11929,
-11929,
-11933,
-11952,
-11962,
-11962,
-11979,
-11979,
-11979,
-11992,
-11999,
-12014,
-12014,
-12023,
-12023,
-12023,
-12023,
-12023,
-12023,
-12041,
-12041,
+11871,
+11887,
+11905,
+11920,
+11936,
+11968,
+11968,
+11981,
+11981,
+11987,
+12004,
+12004,
+12030,
+12043,
+12059,
12066,
12066,
-12076,
-12076,
-12076,
-12076,
-12087,
-12099,
-12114,
-12137,
-12137,
-12146,
-12166,
-12175,
-12185,
-12201,
-12220,
-12239,
+12066,
+12096,
+12096,
+12096,
+12105,
+12136,
+12159,
+12159,
+12159,
+12174,
+12196,
+12232,
+12237,
+12237,
12253,
-12291,
-12304,
-12304,
-12315,
+12269,
+12269,
+12269,
+12282,
+12289,
+12289,
+12306,
12323,
-12342,
-12342,
-12351,
-12357,
-12361,
-12381,
-12381,
-12397,
-12424,
-12452,
-12475,
-12481,
-12481,
-12481,
-12485,
-12502,
-12535,
-12535,
-12552,
-12566,
-12570,
-12601,
+12333,
+12333,
+12349,
+12349,
+12384,
+12422,
+12440,
+12455,
+12472,
+12472,
+12472,
+12472,
+12491,
+12505,
+12511,
+12546,
+12569,
+12569,
+12573,
+12573,
+12595,
+12595,
12605,
12605,
-12611,
-12623,
-12633,
-12633,
-12642,
-12642,
-12642,
-12642,
-12646,
-12656,
-12656,
-12656,
-12656,
-12677,
-12677,
-12714,
-12720,
-12734,
-12734,
-12734,
-12751,
-12774,
-12794,
-12806,
-12806,
-12819,
-12819,
-12819,
-12819,
-12836,
-12836,
-12877,
-12877,
-12877,
-12893,
-12909,
-12936,
-12936,
-12936,
-12936,
-12950,
-12950,
-12950,
-12950,
-12969,
-12974,
-13000,
-13000,
-13028,
-13034,
-13051,
-13051,
-13051,
-13051,
-13051,
-13067,
-13067,
-13071,
-13071,
-13087,
-13113,
-13164,
-13204,
+12605,
+12612,
+12636,
+12654,
+12691,
+12691,
+12713,
+12728,
+12744,
+12754,
+12772,
+12784,
+12810,
+12849,
+12849,
+12873,
+12887,
+12887,
+12887,
+12887,
+12887,
+12910,
+12930,
+12973,
+13002,
+13015,
+13058,
+13058,
+13069,
+13080,
+13080,
+13080,
+13080,
+13086,
+13086,
+13096,
+13114,
+13138,
+13160,
+13160,
+13160,
+13160,
+13160,
+13160,
+13160,
+13178,
+13188,
13204,
-13211,
-13226,
-13226,
-13230,
-13230,
+13224,
+13224,
+13224,
+13224,
+13234,
+13243,
+13260,
+13260,
+13260,
13260,
-13276,
-13301,
-13332,
+13266,
+13281,
+13315,
+13315,
13340,
-13357,
-13357,
-13357,
-13374,
-13397,
-13410,
-13433,
-13445,
-13481,
-13503,
-13532,
-13532,
-13584,
-13602,
-13622,
-13650,
-13675,
-13682,
-13682,
-13701,
-13710,
-13721,
-13721,
-13735,
-13735,
-13771,
-13777,
-13797,
-13817,
-13817,
-13817,
-13837,
-13837,
-13842,
-13861,
-13892,
-13892,
-13937,
-13955,
-13994,
-13994,
-13994,
+13347,
+13347,
+13347,
+13378,
+13378,
+13378,
+13378,
+13404,
+13414,
+13430,
+13450,
+13471,
+13475,
+13479,
+13479,
+13494,
+13494,
+13494,
+13494,
+13494,
+13494,
+13494,
+13494,
+13513,
+13513,
+13513,
+13542,
+13551,
+13551,
+13551,
+13551,
+13551,
+13551,
+13560,
+13569,
+13569,
+13569,
+13569,
+13599,
+13599,
+13610,
+13623,
+13668,
+13676,
+13676,
+13683,
+13702,
+13702,
+13716,
+13716,
+13733,
+13733,
+13744,
+13766,
+13775,
+13775,
+13775,
+13790,
+13815,
+13822,
+13827,
+13827,
+13844,
+13844,
+13859,
+13875,
+13875,
+13919,
+13951,
+13972,
+14006,
+14006,
+14006,
+14015,
14023,
-14035,
-14042,
-14052,
-14052,
-14052,
-14074,
-14074,
-14074,
-14074,
-14074,
-14082,
-14116,
-14123,
-14160,
-14174,
-14191,
-14197,
-14197,
-14205,
-14205,
-14205,
-14205,
-14205,
-14243,
-14256,
-14256,
-14256,
-14256,
-14256,
-14291,
-14291,
-14291,
-14302,
-14302,
-14316,
-14330,
-14330,
+14039,
+14051,
+14079,
+14079,
+14092,
+14128,
+14143,
+14153,
+14153,
+14153,
+14153,
+14173,
+14188,
+14198,
+14198,
+14213,
+14246,
+14281,
+14287,
+14304,
+14304,
+14311,
+14321,
+14328,
+14338,
+14338,
14370,
-14370,
-14370,
-14370,
-14387,
-14399,
-14433,
-14441,
-14458,
-14458,
-14458,
-14458,
-14458,
-14458,
-14476,
-14514,
-14527,
-14527,
-14537,
-14560,
+14404,
+14448,
+14448,
+14473,
+14495,
+14502,
+14502,
+14539,
+14552,
+14559,
+14559,
+14576,
+14576,
+14576,
14590,
14590,
14590,
14590,
-14622,
-14622,
-14648,
-14648,
+14590,
+14590,
+14590,
+14590,
+14623,
+14641,
14648,
-14656,
-14667,
-14687,
-14705,
-14705,
-14705,
-14705,
-14718,
-14733,
+14655,
+14704,
+14742,
+14742,
+14742,
14759,
-14766,
-14795,
-14795,
-14795,
-14795,
-14801,
-14801,
-14824,
-14832,
-14832,
-14832,
-14832,
-14832,
-14848,
-14860,
+14780,
+14780,
+14780,
+14798,
+14798,
+14803,
+14821,
+14821,
+14861,
+14861,
14870,
-14888,
+14880,
+14880,
+14915,
14934,
-14952,
-14959,
-14977,
-14977,
-14994,
-14994,
-15007,
-15007,
-15007,
-15007,
-15017,
-15045,
-15052,
-15062,
-15072,
-15094,
-15101,
-15101,
-15125,
-15125,
-15133,
-15140,
-15164,
+14951,
+14976,
+14976,
+14976,
+14976,
+15005,
+15042,
+15057,
+15057,
+15057,
+15105,
+15131,
+15138,
+15149,
+15149,
+15173,
+15173,
15183,
-15201,
-15201,
-15207,
-15211,
-15228,
-15228,
-15242,
-15251,
-15260,
-15260,
-15266,
-15266,
-15266,
-15290,
-15290,
-15290,
-15290,
-15303,
-15317,
-15317,
-15317,
-15323,
-15323,
-15330,
-15343,
-15383,
-15390,
-15390,
-15397,
-15397,
-15397,
-15412,
-15420,
-15427,
-15451,
-15467,
-15467,
-15503,
-15509,
-15528,
-15528,
-15537,
-15537,
-15537,
-15542,
-15542,
-15542,
-15558,
-15558,
-15558,
-15580,
-15580,
-15580,
-15603,
-15615,
-15615,
-15615,
-15657,
-15690,
-15712,
+15225,
+15241,
+15272,
+15278,
+15278,
+15312,
+15333,
+15354,
+15354,
+15354,
+15354,
+15354,
+15354,
+15354,
+15365,
+15365,
+15365,
+15391,
+15391,
+15391,
+15391,
+15391,
+15391,
+15406,
+15414,
+15414,
+15414,
+15414,
+15430,
+15450,
+15501,
+15501,
+15501,
+15501,
+15501,
+15515,
+15520,
+15520,
+15520,
+15520,
+15546,
+15546,
+15546,
+15546,
+15546,
+15576,
+15608,
+15630,
+15650,
+15650,
+15675,
+15675,
+15695,
+15706,
+15716,
+15716,
+15716,
+15716,
+15733,
15741,
-15741,
-15757,
-15757,
-15792,
-15792,
-15819,
-15819,
-15839,
-15860,
+15752,
+15752,
+15752,
+15752,
+15764,
+15764,
+15778,
+15778,
+15786,
+15817,
+15817,
+15833,
+15833,
+15852,
+15852,
15867,
-15874,
-15888,
-15888,
-15900,
-15913,
-15927,
-15938,
-15938,
-15956,
-15971,
-15993,
-15993,
-15993,
-15993,
-15997,
-16020,
-16020,
-16033,
-16033,
-16033,
-16069,
-16069,
-16097,
-16109,
-16109,
-16109,
-16145,
-16145,
-16145,
-16186,
+15885,
+15935,
+15941,
+15961,
+15961,
+15977,
+15981,
+15988,
+15994,
+16015,
+16015,
+16054,
+16054,
+16054,
+16087,
+16113,
+16122,
+16122,
+16157,
+16188,
+16188,
+16212,
+16212,
+16212,
+16212,
+16230,
16230,
-16250,
-16269,
+16246,
16276,
-16283,
-16295,
-16329,
-16359,
-16391,
-16404,
-16404,
-16453,
-16470,
-16480,
-16480,
-16480,
-16499,
-16512,
-16530,
+16287,
+16300,
+16316,
+16334,
+16353,
+16378,
+16401,
+16401,
+16421,
+16421,
+16421,
+16425,
+16450,
+16450,
+16450,
+16456,
+16465,
+16475,
+16491,
+16509,
+16509,
+16518,
16530,
-16541,
-16541,
-16563,
-16579,
-16586,
-16596,
-16618,
-16633,
-16665,
-16665,
-16690,
-16721,
-16733,
-16733,
-16740,
-16762,
-16762,
-16762,
-16762,
-16762,
-16762,
-16762,
-16762,
-16777,
-16777,
-16784,
-16812,
-16830,
-16851,
-16870,
-16870,
-16901,
-16908,
-16908,
-16908,
-16929,
-16953,
-16953,
+16562,
+16562,
+16562,
+16571,
+16571,
+16571,
+16595,
+16595,
+16595,
+16610,
+16610,
+16610,
+16634,
+16661,
+16678,
+16684,
+16684,
+16691,
+16691,
+16706,
+16763,
+16792,
+16807,
+16827,
+16847,
+16847,
+16847,
+16859,
+16859,
+16859,
+16880,
+16902,
+16902,
+16922,
+16922,
+16922,
+16942,
+16949,
16959,
-16959,
-16986,
-16986,
-16986,
-16996,
-16996,
-16996,
-16996,
-17010,
-17030,
-17050,
-17057,
-17057,
-17057,
-17057,
-17066,
-17076,
-17093,
-17093,
-17122,
-17122,
-17138,
-17138,
-17157,
-17164,
-17179,
-17179,
-17198,
-17198,
-17218,
-17236,
-17236,
-17266,
-17283,
-17294,
-17294,
-17294,
-17311,
-17321,
-17336,
-17336,
-17336,
-17336,
-17336,
-17347,
-17353,
+16974,
+16974,
+16980,
+16980,
+16993,
+17024,
+17037,
+17037,
+17044,
+17097,
+17097,
+17112,
+17112,
+17135,
+17150,
+17150,
+17155,
+17162,
+17190,
+17190,
+17210,
+17219,
+17219,
+17232,
+17232,
+17241,
+17254,
+17269,
+17292,
+17302,
+17302,
+17314,
+17314,
+17314,
+17314,
17353,
-17353,
-17353,
-17361,
-17361,
-17361,
-17361,
-17374,
-17374,
-17374,
-17388,
-17388,
-17388,
-17395,
-17411,
-17411,
-17411,
-17428,
-17440,
-17457,
-17471,
-17492,
-17492,
-17529,
-17533,
-17546,
-17546,
-17558,
-17566,
-17566,
-17566,
-17578,
-17604,
-17620,
-17650,
-17650,
-17669,
-17695,
-17695,
-17741,
-17741,
-17741,
-17769,
-17774,
-17774,
-17779,
-17785,
+17371,
+17400,
+17418,
+17418,
+17444,
+17444,
+17466,
+17466,
+17466,
+17466,
+17466,
+17466,
+17466,
+17466,
+17466,
+17488,
+17488,
+17498,
+17498,
+17506,
+17506,
+17527,
+17552,
+17552,
+17562,
+17569,
+17587,
+17603,
+17603,
+17619,
+17628,
+17667,
+17674,
+17698,
+17706,
+17742,
17795,
-17795,
-17803,
-17819,
-17859,
-17859,
-17916,
-17916,
-17955,
-17963,
-17977,
-17977,
-18009,
-18009,
-18021,
-18044,
-18044,
-18044,
-18044,
-18044,
-18044,
-18064,
-18079,
-18079,
-18096,
+17813,
+17813,
+17834,
+17844,
+17844,
+17844,
+17844,
+17866,
+17886,
+17917,
+17953,
+17953,
+17953,
+17984,
+17984,
+17984,
+17984,
+17984,
+18024,
+18024,
+18045,
+18077,
18096,
-18132,
-18138,
-18138,
-18171,
-18171,
-18171,
-18171,
-18177,
-18200,
-18220,
-18220,
-18220,
-18234,
-18234,
-18234,
-18270,
-18286,
-18332,
-18343,
-18343,
-18348,
-18367,
-18409,
-18464,
-18486,
-18493,
-18544,
-18544,
-18544,
-18550,
-18575,
-18580,
-18634,
+18102,
+18114,
+18114,
+18114,
+18136,
+18146,
+18170,
+18170,
+18170,
+18193,
+18193,
+18193,
+18211,
+18246,
+18253,
+18303,
+18303,
+18303,
+18324,
+18324,
+18344,
+18344,
+18344,
+18350,
+18373,
+18393,
+18401,
+18401,
+18421,
+18435,
+18469,
+18491,
+18491,
+18523,
+18546,
+18566,
+18566,
+18589,
+18610,
+18622,
18646,
-18672,
-18695,
-18695,
-18695,
-18713,
-18744,
-18762,
-18762,
-18770,
-18770,
-18777,
-18781,
-18785,
-18785,
-18785,
-18785,
-18791,
-18839,
-18850,
-18864,
-18864,
+18674,
+18689,
+18697,
+18721,
+18730,
+18730,
+18751,
+18765,
+18789,
+18805,
+18826,
+18842,
+18842,
+18846,
+18846,
+18856,
+18863,
18881,
-18881,
-18897,
-18912,
-18919,
-18926,
-18944,
-18944,
-18944,
-18951,
-18951,
-18958,
-18969,
-18994,
-19010,
-19054,
-19054,
-19086,
-19097,
-19115,
-19129,
-19129,
-19152,
-19183,
-19189,
-19226,
-19226,
-19226,
-19226,
+18903,
+18928,
+18947,
+18950,
+18964,
+18967,
+18979,
+18987,
+19007,
+19026,
+19026,
+19029,
+19029,
+19044,
+19077,
+19107,
+19110,
+19131,
+19134,
+19140,
+19156,
+19179,
+19204,
+19222,
+19222,
19236,
-19260,
-19266,
-19273,
-19291,
-19298,
-19298,
-19298,
-19335,
-19352,
-19352,
-19363,
-19383,
-19383,
-19399,
-19409,
-19430,
-19430,
-19447,
+19239,
+19251,
+19284,
+19299,
+19302,
+19318,
+19328,
+19332,
+19360,
+19389,
+19392,
+19419,
+19432,
+19442,
+19451,
+19463,
+19466,
19469,
-19485,
-19485,
-19493,
-19499,
-19499,
-19506,
-19506,
-19516,
-19537,
-19549,
-19588,
-19588,
-19633,
-19655,
-19676,
-19676,
-19720,
-19723,
-19739,
-19742,
-19745,
-19768,
-19768,
-19771,
-19788,
-19795,
-19823,
-19843,
-19850,
-19869,
-19893,
-19919,
+19480,
+19507,
+19510,
+19543,
+19543,
+19554,
+19557,
+19578,
+19581,
+19584,
+19608,
+19611,
+19623,
+19644,
+19654,
+19673,
+19682,
+19682,
+19682,
+19685,
+19707,
+19710,
+19710,
+19727,
+19727,
+19733,
+19736,
+19736,
+19736,
+19736,
+19749,
+19749,
+19754,
+19777,
+19808,
+19811,
+19814,
+19817,
+19835,
+19860,
+19860,
+19863,
+19863,
+19863,
+19863,
+19872,
+19872,
+19906,
+19906,
+19916,
+19922,
19936,
19939,
19942,
-19963,
-19966,
-19982,
-19995,
-20004,
-20010,
-20010,
-20045,
-20048,
-20062,
-20071,
-20071,
-20074,
-20084,
+19958,
+19968,
+19978,
+20000,
+20019,
+20019,
+20049,
+20065,
+20090,
20090,
-20108,
-20108,
-20114,
-20120,
-20147,
-20153,
-20156,
-20166,
-20169,
-20184,
-20187,
-20195,
-20210,
-20221,
-20246,
-20246,
-20246,
-20273,
-20293,
-20296,
-20313,
+20113,
+20148,
+20158,
+20196,
+20239,
+20255,
+20278,
+20310,
+20322,
20331,
-20337,
-20346,
-20362,
-20395,
-20395,
-20423,
-20423,
-20429,
-20429,
-20432,
-20443,
-20465,
-20465,
-20468,
-20479,
-20479,
-20497,
-20537,
-20546,
-20558,
-20614,
+20366,
+20369,
+20376,
+20389,
+20392,
+20392,
+20412,
+20438,
+20451,
+20451,
+20511,
+20517,
+20552,
+20570,
+20586,
+20593,
+20593,
+20605,
+20608,
20621,
-20639,
-20639,
-20658,
-20661,
-20671,
-20674,
-20674,
-20674,
-20674,
-20677,
-20677,
-20677,
-20696,
-20699,
-20699,
-20702,
-20702,
+20624,
+20627,
+20663,
+20666,
20705,
-20711,
-20724,
-20727,
-20730,
-20753,
-20763,
-20766,
-20783,
-20783,
-20783,
-20806,
+20720,
+20759,
+20762,
+20762,
+20762,
+20802,
20809,
-20819,
-20819,
-20822,
-20911,
-20944,
-20961,
-20992,
-21004,
-21014,
-21017,
-21033,
-21036,
-21036,
-21067,
-21074,
-21094,
+20825,
+20830,
+20830,
+20830,
+20830,
+20854,
+20857,
+20857,
+20864,
+20917,
+20927,
+20930,
+20964,
+20967,
+20974,
+21013,
+21057,
+21057,
+21091,
21119,
-21162,
-21179,
-21204,
-21230,
-21239,
-21250,
-21256,
+21122,
+21141,
+21156,
+21176,
+21193,
+21196,
+21196,
+21196,
+21229,
+21245,
+21245,
+21251,
+21265,
+21290,
+21290,
+21290,
21290,
-21297,
-21297,
-21297,
-21333,
-21333,
-21349,
-21352,
-21378,
-21393,
-21411,
-21414,
-21424,
-21435,
-21438,
-21461,
-21461,
-21489,
-21504,
-21511,
-21511,
-21511,
-21511,
-21516,
-21516,
-21526,
-21529,
-21538,
-21538,
-21551,
-21606,
-21609,
-21609,
-21612,
-21634,
-21662,
-21737,
-21737,
-21756,
-21759,
-21787,
-21808,
-21811,
-21814,
-21820,
-21841,
-21860,
-21860,
-21867,
-21875,
-21894,
-21900,
-21921,
-21936,
-21936,
-21945,
-21945,
-21945,
-21986,
-22001,
-22021,
-22027,
-22033,
-22059,
+21314,
+21314,
+21317,
+21320,
+21326,
+21365,
+21371,
+21384,
+21387,
+21406,
+21409,
+21409,
+21417,
+21425,
+21440,
+21448,
+21451,
+21454,
+21467,
+21482,
+21492,
+21524,
+21530,
+21536,
+21546,
+21560,
+21615,
+21639,
+21639,
+21642,
+21660,
+21669,
+21672,
+21672,
+21689,
+21698,
+21705,
+21752,
+21769,
+21793,
+21793,
+21803,
+21803,
+21824,
+21831,
+21854,
+21857,
+21864,
+21897,
+21918,
+21939,
+21939,
+21939,
+21963,
+21973,
+21976,
+21976,
+22031,
+22031,
+22031,
+22046,
+22070,
22080,
-22105,
-22127,
-22130,
-22146,
-22171,
-22174,
-22202,
-22222,
-22244,
-22253,
-22285,
-22325,
-22347,
-22359,
-22371,
-22395,
+22110,
+22139,
+22163,
+22166,
+22198,
+22213,
+22232,
+22240,
+22280,
+22315,
+22315,
+22332,
+22357,
+22357,
+22357,
+22357,
+22357,
22401,
-22404,
-22433,
-22465,
-22465,
-22468,
-22468,
-22507,
-22522,
+22412,
+22424,
+22455,
+22466,
+22466,
+22469,
+22477,
+22485,
+22508,
+22530,
+22537,
22546,
-22546,
-22580,
-22580,
-22612,
-22615,
-22622,
-22622,
-22622,
-22634,
-22655,
-22655,
-22687,
+22551,
+22562,
+22571,
+22574,
+22599,
+22627,
+22630,
+22643,
+22663,
+22699,
22699,
-22711,
-22711,
-22731,
-22734,
-22740,
-22767,
-22795,
-22798,
-22801,
-22822,
-22845,
-22883,
-22883,
+22705,
+22708,
+22721,
+22724,
+22738,
+22768,
+22771,
+22774,
+22789,
+22807,
+22819,
+22870,
22886,
-22916,
-22919,
-22938,
-22947,
-22947,
-22962,
-22994,
-22997,
-23000,
-23013,
-23026,
-23029,
+22892,
+22903,
+22932,
+22944,
+22973,
+22976,
+22992,
+22995,
+23006,
23029,
-23032,
23042,
-23042,
-23069,
-23076,
-23087,
-23094,
-23107,
-23124,
-23142,
-23149,
-23149,
-23152,
-23159,
-23159,
-23181,
-23181,
-23212,
-23219,
-23233,
-23233,
-23255,
-23265,
-23265,
-23279,
-23307,
-23339,
-23349,
-23376,
-23401,
-23451,
-23514,
-23524,
-23552,
-23555,
-23575,
+23058,
+23101,
+23121,
+23138,
+23138,
+23141,
+23161,
+23164,
+23188,
+23188,
+23188,
+23201,
+23231,
+23231,
+23231,
+23231,
+23241,
+23241,
+23244,
+23262,
+23320,
+23320,
+23356,
+23402,
+23405,
+23405,
+23440,
+23443,
+23452,
+23462,
+23471,
+23474,
+23474,
+23474,
+23485,
+23485,
+23500,
+23522,
+23546,
+23584,
+23591,
23591,
-23601,
-23604,
-23620,
-23627,
-23630,
-23640,
-23659,
-23674,
-23714,
-23747,
-23776,
-23786,
-23802,
-23809,
-23812,
-23827,
-23863,
-23882,
-23882,
-23892,
-23917,
-23949,
-23974,
-23974,
-24009,
-24039,
-24039,
-24052,
-24060,
-24081,
-24100,
-24131,
-24131,
-24138,
-24138,
-24148,
-24169,
-24175,
-24233,
-24262,
-24262,
-24265,
-24272,
-24278,
-24300,
-24321,
-24332,
-24339,
-24349,
-24349,
-24349,
-24353,
-24370,
-24370,
-24370,
-24373,
-24376,
-24405,
-24405,
-24414,
-24454,
-24461,
-24461,
-24461,
-24461,
-24484,
-24504,
-24511,
+23591,
+23639,
+23639,
+23644,
+23644,
+23683,
+23683,
+23694,
+23712,
+23712,
+23740,
+23752,
+23775,
+23791,
+23791,
+23821,
+23844,
+23849,
+23872,
+23872,
+23879,
+23879,
+23939,
+23945,
+23959,
+23959,
+23959,
+24004,
+24010,
+24026,
+24042,
+24050,
+24067,
+24067,
+24098,
+24108,
+24108,
+24108,
+24108,
+24125,
+24144,
+24144,
+24160,
+24163,
+24163,
+24173,
+24177,
+24177,
+24188,
+24203,
+24203,
+24203,
+24206,
+24224,
+24253,
+24253,
+24253,
+24294,
+24294,
+24326,
+24341,
+24341,
+24354,
+24382,
+24401,
+24401,
+24419,
+24431,
+24442,
+24442,
+24457,
+24473,
+24473,
+24481,
+24512,
+24532,
+24532,
24543,
-24558,
-24558,
-24558,
-24571,
-24584,
-24591,
-24619,
-24626,
-24626,
-24678,
-24703,
-24714,
-24729,
-24757,
-24765,
+24550,
+24568,
+24607,
+24607,
+24628,
+24628,
+24634,
+24641,
+24662,
+24697,
+24712,
+24735,
+24745,
+24755,
+24769,
24769,
-24794,
-24794,
-24827,
-24827,
-24827,
-24834,
-24834,
-24834,
-24834,
-24834,
-24834,
-24852,
-24894,
-24912,
-24919,
-24919,
-24919,
-24922,
-24932,
-24966,
-24982,
-25019,
-25044,
-25059,
-25081,
-25096,
-25145,
-25145,
-25162,
-25168,
-25188,
-25188,
-25188,
-25200,
-25200,
-25218,
-25226,
-25226,
-25233,
-25250,
-25250,
-25250,
-25250,
-25264,
-25264,
-25293,
-25300,
-25311,
-25333,
-25347,
-25347,
-25347,
-25364,
-25403,
-25414,
-25443,
-25460,
-25477,
-25494,
-25511,
-25511,
-25522,
-25555,
-25576,
-25583,
-25623,
-25630,
-25630,
-25630,
-25630,
-25630,
-25645,
-25652,
-25659,
-25666,
-25693,
-25723,
-25763,
-25780,
-25788,
-25801,
-25801,
-25821,
-25828,
-25828,
-25835,
-25852,
-25852,
-25859,
-25859,
-25878,
-25896,
-25920,
-25937,
-25969,
-25998,
-26012,
-26049,
-26070,
-26076,
-26088,
-26088,
-26088,
-26088,
-26088,
-26101,
-26128,
-26149,
-26158,
-26177,
-26183,
-26219,
-26236,
-26243,
-26253,
-26261,
-26268,
-26278,
-26278,
-26296,
-26307,
-26307,
-26307,
-26315,
-26378,
-26385,
+24786,
+24786,
+24786,
+24801,
+24809,
+24821,
+24835,
+24835,
+24835,
+24853,
+24872,
+24872,
+24872,
+24883,
+24901,
+24901,
+24905,
+24918,
+24918,
+24949,
+24949,
+24970,
+24970,
+24970,
+24981,
+24981,
+24981,
+24993,
+24993,
+24993,
+25005,
+25043,
+25050,
+25070,
+25099,
+25099,
+25110,
+25110,
+25110,
+25110,
+25115,
+25134,
+25134,
+25134,
+25141,
+25160,
+25167,
+25167,
+25179,
+25179,
+25179,
+25192,
+25238,
+25238,
+25282,
+25306,
+25316,
+25327,
+25339,
+25374,
+25374,
+25384,
+25384,
+25384,
+25384,
+25388,
+25388,
+25388,
+25388,
+25416,
+25453,
+25463,
+25463,
+25480,
+25536,
+25536,
+25536,
+25536,
+25536,
+25551,
+25567,
+25571,
+25591,
+25618,
+25631,
+25631,
+25650,
+25650,
+25650,
+25690,
+25707,
+25718,
+25743,
+25753,
+25753,
+25765,
+25765,
+25778,
+25802,
+25823,
+25823,
+25823,
+25840,
+25840,
+25840,
+25840,
+25870,
+25876,
+25897,
+25897,
+25897,
+25907,
+25907,
+25907,
+25907,
+25928,
+25928,
+25928,
+25961,
+25961,
+25961,
+25965,
+25965,
+25965,
+25975,
+26006,
+26006,
+26006,
+26006,
+26020,
+26020,
+26028,
+26028,
+26043,
+26075,
+26115,
+26124,
+26145,
+26145,
+26145,
+26145,
+26145,
+26145,
+26161,
+26161,
+26215,
+26234,
+26234,
+26234,
+26234,
+26254,
+26254,
+26259,
+26285,
+26299,
+26299,
+26316,
+26328,
+26381,
+26381,
+26381,
+26381,
26402,
-26409,
-26439,
-26459,
-26466,
-26485,
-26485,
-26492,
-26499,
-26499,
-26511,
+26420,
+26438,
+26469,
+26469,
+26469,
+26481,
+26494,
+26502,
+26502,
+26502,
+26502,
+26502,
+26522,
+26522,
+26522,
+26535,
+26535,
26556,
-26572,
-26596,
-26621,
-26621,
-26621,
-26621,
-26659,
-26659,
+26563,
+26563,
+26582,
+26604,
+26604,
+26614,
+26614,
+26619,
+26619,
+26619,
+26619,
+26644,
+26644,
+26644,
+26651,
+26667,
+26667,
+26667,
+26675,
26675,
-26700,
-26716,
-26741,
-26755,
-26755,
-26755,
-26785,
-26785,
-26785,
-26825,
-26825,
-26846,
-26864,
-26891,
-26898,
-26936,
-26936,
-26951,
-26951,
-26971,
-26978,
+26682,
+26682,
+26682,
+26693,
+26693,
+26693,
+26693,
+26699,
+26699,
+26715,
+26763,
+26772,
+26793,
+26793,
+26804,
+26804,
+26813,
+26813,
+26813,
+26840,
+26855,
+26865,
+26865,
+26882,
+26928,
+26938,
+26938,
+26938,
+26979,
+26979,
+27008,
+27008,
27008,
-27054,
-27068,
-27075,
-27089,
-27089,
-27120,
-27127,
-27127,
-27127,
-27144,
-27151,
+27008,
+27021,
+27037,
+27049,
+27060,
+27064,
+27085,
+27121,
+27121,
+27169,
27169,
-27176,
-27183,
-27208,
-27225,
-27272,
-27272,
-27279,
-27308,
-27354,
-27358,
-27358,
-27374,
-27388,
-27388,
-27388,
+27221,
+27253,
+27276,
+27294,
+27294,
+27342,
+27353,
+27353,
+27353,
+27371,
+27371,
+27375,
+27390,
+27390,
+27390,
27395,
27419,
27426,
-27430,
-27465,
-27472,
-27508,
-27515,
+27451,
+27471,
+27493,
+27493,
+27510,
+27510,
+27517,
27529,
-27558,
-27580,
-27590,
-27590,
-27590,
-27605,
-27605,
-27615,
-27615,
-27625,
-27625,
-27625,
-27631,
-27681,
-27681,
-27688,
-27688,
-27707,
-27711,
+27529,
+27542,
+27548,
+27548,
+27548,
+27576,
+27581,
+27597,
+27639,
+27653,
+27699,
+27716,
+27716,
27742,
-27749,
-27749,
-27765,
-27793,
-27839,
-27839,
-27839,
-27849,
-27849,
-27864,
-27864,
-27871,
-27871,
-27871,
-27871,
-27871,
-27871,
-27884,
-27903,
-27928,
-27949,
-27949,
-27963,
-27963,
-27975,
-27982,
-27982,
-27982,
-27982,
-27982,
-28019,
-28019,
-28040,
-28040,
-28040,
-28040,
-28108,
-28134,
-28134,
-28134,
-28174,
-28183,
-28197,
-28197,
-28197,
-28220,
-28230,
-28241,
-28241,
-28257,
-28257,
-28263,
-28290,
-28290,
-28361,
-28368,
-28368,
-28368,
-28373,
-28397,
-28421,
-28433,
-28440,
-28440,
-28450,
-28450,
-28466,
-28481,
-28481,
-28490,
-28532,
-28532,
-28539,
-28548,
-28555,
-28573,
-28573,
-28603,
-28627,
-28645,
-28645,
-28658,
-28684,
-28684,
-28722,
-28749,
-28767,
-28774,
-28774,
+27766,
+27785,
+27794,
+27794,
+27812,
+27812,
+27812,
+27812,
+27832,
+27832,
+27832,
+27832,
+27861,
+27861,
+27861,
+27867,
+27922,
+27922,
+27922,
+27922,
+27960,
+27960,
+27985,
+28026,
+28063,
+28063,
+28083,
+28090,
+28090,
+28104,
+28131,
+28177,
+28192,
+28196,
+28196,
+28196,
+28196,
+28228,
+28240,
+28271,
+28305,
+28305,
+28305,
+28322,
+28328,
+28341,
+28349,
+28388,
+28388,
+28388,
+28407,
+28411,
+28411,
+28411,
+28417,
+28427,
+28449,
+28463,
+28475,
+28516,
+28516,
+28525,
+28553,
+28553,
+28553,
+28578,
+28585,
+28626,
+28626,
+28663,
+28663,
+28669,
+28669,
+28690,
+28713,
+28713,
+28728,
+28728,
+28728,
+28734,
+28734,
+28751,
+28761,
+28775,
28788,
-28801,
-28844,
-28844,
-28844,
-28850,
-28870,
-28870,
-28877,
-28883,
-28893,
-28893,
-28893,
-28918,
-28918,
-28931,
-28931,
-28931,
-28959,
-28973,
-28973,
-28991,
-29010,
-29029,
-29038,
-29048,
-29099,
-29099,
-29109,
-29109,
-29109,
-29109,
-29109,
-29109,
-29128,
-29139,
-29162,
-29162,
-29176,
-29176,
-29194,
-29194,
-29194,
-29205,
-29205,
-29227,
-29227,
-29227,
-29227,
-29248,
-29254,
+28794,
+28794,
+28812,
+28812,
+28823,
+28823,
+28834,
+28875,
+28928,
+28928,
+28928,
+28953,
+28983,
+28995,
+29012,
+29012,
+29012,
+29025,
+29056,
+29056,
+29080,
+29080,
+29092,
+29092,
+29092,
+29104,
+29104,
+29104,
+29104,
+29121,
+29121,
+29121,
+29121,
+29157,
+29157,
+29167,
+29186,
+29186,
+29186,
+29186,
+29186,
+29186,
+29195,
+29226,
+29241,
+29241,
+29257,
+29257,
29270,
29270,
-29302,
-29309,
-29326,
-29343,
-29359,
-29369,
-29369,
-29386,
-29411,
-29411,
-29411,
+29270,
+29276,
+29276,
+29276,
+29276,
+29276,
+29282,
+29327,
+29327,
+29337,
+29349,
+29381,
+29381,
+29388,
+29388,
+29401,
+29401,
+29401,
29411,
-29452,
-29463,
-29463,
-29468,
-29468,
-29492,
-29492,
-29523,
-29535,
-29535,
-29539,
-29539,
-29546,
-29557,
-29557,
-29564,
-29570,
-29579,
-29595,
-29601,
-29608,
-29608,
-29608,
-29664,
-29683,
-29698,
-29698,
-29698,
-29698,
-29706,
-29706,
-29721,
-29746,
-29775,
-29793,
-29813,
-29831,
-29831,
-29852,
-29852,
+29444,
+29483,
+29483,
+29529,
+29536,
+29549,
+29549,
+29549,
+29549,
+29549,
+29605,
+29605,
+29622,
+29622,
+29661,
+29661,
+29682,
+29691,
+29691,
+29691,
+29743,
+29743,
+29764,
+29764,
+29764,
+29764,
+29781,
+29796,
+29808,
+29819,
+29850,
+29863,
+29863,
+29876,
+29876,
+29876,
+29876,
+29885,
+29885,
29897,
-29916,
-29955,
-29971,
-29971,
-30000,
-30040,
-30040,
+29897,
+29934,
+29942,
+29942,
+29962,
+29976,
+29976,
+29976,
+29994,
+29994,
+29994,
+29994,
+29994,
+30010,
+30010,
+30025,
+30025,
+30025,
+30025,
+30035,
+30035,
+30042,
+30042,
+30055,
30055,
-30064,
-30071,
-30071,
-30071,
-30071,
-30071,
-30088,
-30088,
-30118,
-30118,
-30130,
-30130,
-30141,
-30164,
-30171,
-30178,
-30194,
-30194,
-30204,
-30223,
-30231,
-30269,
-30308,
-30308,
-30308,
-30352,
-30374,
-30394,
-30394,
-30406,
-30406,
-30406,
-30414,
+30055,
+30065,
+30082,
+30092,
+30101,
+30101,
+30123,
+30123,
+30134,
+30147,
+30147,
+30157,
+30176,
+30176,
+30193,
+30209,
+30217,
+30217,
+30259,
+30271,
+30277,
+30293,
+30328,
+30345,
+30378,
+30399,
+30425,
30431,
30431,
-30437,
-30443,
-30461,
-30483,
-30483,
-30483,
-30514,
-30519,
-30553,
-30553,
-30558,
-30563,
-30563,
-30604,
-30604,
-30610,
-30610,
-30610,
-30631,
-30642,
-30646,
-30646,
-30646,
-30650,
-30650,
-30681,
-30681,
-30681,
-30698,
-30714,
-30714,
-30714,
+30442,
+30453,
+30463,
+30469,
+30479,
+30493,
+30508,
+30518,
+30518,
+30533,
+30546,
+30546,
+30570,
+30589,
+30627,
+30648,
+30648,
+30673,
+30696,
+30708,
+30708,
+30708,
+30708,
+30708,
30714,
30714,
-30721,
-30732,
-30732,
-30732,
-30745,
-30745,
-30751,
-30765,
-30782,
-30805,
-30805,
-30821,
-30821,
-30842,
+30726,
+30736,
+30736,
+30754,
+30788,
+30788,
+30788,
+30814,
+30814,
+30814,
+30814,
+30814,
+30814,
+30814,
+30814,
+30820,
+30836,
+30836,
+30836,
+30836,
+30836,
+30836,
+30836,
+30836,
+30836,
30855,
-30881,
-30881,
-30903,
-30903,
-30912,
-30965,
-30965,
-30980,
-30980,
-30980,
-30987,
-30998,
-31002,
-31064,
-31075,
-31087,
-31103,
-31109,
-31109,
-31109,
-31122,
-31122,
-31122,
-31135,
-31150,
-31150,
-31165,
-31165,
-31175,
-31175,
-31175,
-31189,
-31220,
-31220,
-31230,
-31240,
-31274,
-31281,
-31307,
-31307,
-31313,
-31342,
-31349,
-31372,
-31413,
-31413,
-31429,
-31435,
-31435,
-31435,
-31447,
-31454,
-31454,
-31454,
-31461,
-31461,
-31488,
-31488,
-31488,
-31488,
-31488,
-31507,
-31537,
-31546,
-31546,
-31546,
-31566,
-31590,
-31602,
-31602,
-31602,
-31622,
-31622,
-31648,
-31677,
-31692,
-31701,
-31717,
-31728,
-31728,
-31744,
-31744,
+30873,
+30886,
+30911,
+30921,
+30932,
+30932,
+30951,
+30957,
+31001,
+31007,
+31007,
+31022,
+31048,
+31055,
+31062,
+31079,
+31079,
+31118,
+31128,
+31128,
+31128,
+31146,
+31146,
+31146,
+31146,
+31162,
+31162,
+31177,
+31177,
+31195,
+31211,
+31282,
+31282,
+31290,
+31300,
+31363,
+31389,
+31406,
+31419,
+31439,
+31439,
+31439,
+31439,
+31443,
+31473,
+31481,
+31481,
+31508,
+31523,
+31569,
+31599,
+31621,
+31671,
+31680,
+31700,
+31741,
31754,
-31783,
+31775,
+31804,
+31804,
31816,
-31827,
-31827,
-31834,
-31834,
-31863,
-31884,
-31884,
-31898,
-31954,
-32001,
-32023,
-32023,
-32041,
-32054,
-32076,
-32086,
-32121,
-32128,
-32135,
-32135,
-32158,
-32188,
-32203,
-32203,
-32255,
-32255,
-32255,
-32279,
-32308,
-32346,
-32374,
-32394,
-32394,
-32394,
-32394,
-32414,
+31825,
+31825,
+31850,
+31850,
+31850,
+31850,
+31866,
+31876,
+31876,
+31901,
+31911,
+31940,
+31950,
+31950,
+31957,
+31957,
+31957,
+31957,
+31976,
+31989,
+31996,
+31996,
+32010,
+32040,
+32061,
+32061,
+32080,
+32080,
+32080,
+32080,
+32093,
+32093,
+32093,
+32093,
+32115,
+32119,
+32119,
+32152,
+32152,
+32152,
+32164,
+32164,
+32174,
+32174,
+32174,
+32174,
+32237,
+32251,
+32287,
+32287,
+32295,
+32295,
+32310,
+32333,
+32342,
+32360,
+32360,
+32387,
+32409,
32431,
32431,
-32447,
-32447,
-32447,
-32462,
-32462,
-32462,
-32462,
-32505,
-32522,
-32522,
-32522,
-32539,
-32544,
-32569,
-32569,
-32569,
-32598,
-32614,
-32633,
-32633,
-32633,
-32648,
-32648,
-32659,
-32680,
-32680,
-32720,
-32720,
-32726,
-32726,
-32726,
-32726,
-32769,
-32803,
-32803,
-32803,
-32803,
-32803,
-32819,
+32431,
+32448,
+32473,
+32523,
+32523,
+32541,
+32541,
+32563,
+32563,
+32575,
+32581,
+32581,
+32581,
+32581,
+32602,
+32622,
+32622,
+32676,
+32676,
+32676,
+32676,
+32676,
+32692,
+32711,
+32711,
+32711,
+32711,
+32752,
+32767,
+32797,
32819,
-32836,
-32836,
-32836,
-32856,
-32856,
-32871,
-32871,
-32889,
-32913,
-32919,
-32919,
-32919,
-32919,
-32942,
-32942,
-32942,
-32942,
-32942,
-32963,
-32984,
-33012,
-33018,
-33018,
-33018,
-33018,
-33034,
-33060,
-33060,
-33077,
+32846,
+32864,
+32864,
+32870,
+32887,
+32887,
+32898,
+32898,
+32898,
+32898,
+32898,
+32933,
+32997,
+32997,
+33007,
+33007,
+33007,
+33007,
+33024,
+33035,
+33035,
+33066,
+33090,
+33090,
+33090,
33110,
33110,
-33120,
-33120,
-33144,
-33181,
-33195,
-33195,
-33195,
-33212,
-33225,
-33238,
-33248,
-33248,
-33248,
-33248,
-33259,
-33259,
-33259,
-33273,
-33273,
-33273,
-33273,
-33273,
-33273,
-33273,
-33273,
-33273,
-33273,
-33293,
-33303,
-33303,
-33313,
-33325,
-33325,
-33325,
-33336,
-33342,
-33347,
-33347,
-33357,
-33370,
+33130,
+33150,
+33169,
+33169,
+33169,
+33207,
+33207,
+33207,
+33227,
+33251,
+33258,
+33258,
+33275,
+33285,
+33285,
+33285,
+33294,
+33310,
+33310,
+33323,
+33323,
+33323,
+33354,
+33361,
+33361,
+33361,
+33361,
+33368,
+33380,
+33403,
33403,
-33442,
-33467,
-33477,
-33477,
-33491,
-33491,
-33508,
-33508,
-33560,
-33569,
-33569,
-33569,
-33589,
-33628,
-33654,
-33665,
-33681,
-33700,
-33719,
-33719,
+33419,
+33428,
+33428,
+33428,
+33444,
+33451,
+33451,
+33451,
+33476,
+33476,
+33483,
+33496,
+33496,
+33523,
+33558,
+33567,
+33567,
+33579,
+33592,
+33607,
+33615,
+33615,
+33615,
+33650,
+33650,
+33650,
+33650,
+33650,
+33720,
33742,
-33760,
-33760,
-33760,
-33760,
-33760,
-33788,
-33788,
-33804,
-33804,
-33804,
-33830,
-33854,
-33854,
-33854,
-33860,
-33860,
-33878,
-33898,
-33898,
-33898,
-33898,
-33898,
-33941,
-33941,
-33955,
-33982,
-33982,
-34002,
-34002,
-34017,
-34030,
-34090,
-34104,
-34104,
-34140,
-34180,
-34195,
-34214,
-34214,
-34214,
-34244,
-34244,
-34263,
-34263,
-34263,
-34263,
-34263,
-34263,
-34263,
-34263,
-34279,
-34312,
-34341,
-34345,
-34351,
-34374,
-34386,
-34407,
-34407,
-34407,
-34417,
-34437,
-34437,
-34449,
+33742,
+33750,
+33758,
+33758,
+33769,
+33769,
+33779,
+33809,
+33809,
+33823,
+33823,
+33849,
+33857,
+33857,
+33857,
+33857,
+33857,
+33874,
+33874,
+33899,
+33910,
+33916,
+33916,
+33950,
+33957,
+33964,
+33970,
+33970,
+33970,
+33970,
+33993,
+34050,
+34050,
+34050,
+34071,
+34071,
+34108,
+34162,
+34162,
+34162,
+34162,
+34173,
+34173,
+34208,
+34225,
+34233,
+34264,
+34283,
+34291,
+34291,
+34291,
+34298,
+34307,
+34314,
+34338,
+34338,
+34378,
+34384,
+34402,
+34414,
+34414,
+34414,
+34423,
+34459,
34459,
-34465,
-34484,
-34484,
+34478,
34494,
-34534,
-34556,
-34556,
-34556,
+34516,
+34528,
+34544,
+34544,
+34554,
34566,
-34576,
-34576,
-34582,
-34607,
-34607,
-34628,
-34634,
-34646,
-34646,
-34655,
-34673,
-34673,
-34686,
-34686,
-34697,
-34697,
-34714,
-34714,
-34714,
-34714,
-34714,
-34731,
-34731,
-34731,
-34731,
-34731,
-34741,
-34767,
-34767,
-34767,
-34783,
-34783,
-34792,
-34792,
-34847,
-34862,
-34876,
-34876,
-34891,
-34891,
-34902,
-34919,
-34919,
-34939,
+34566,
+34583,
+34632,
+34640,
+34640,
+34654,
+34668,
+34668,
+34674,
+34674,
+34685,
+34685,
+34685,
+34701,
+34711,
+34711,
+34723,
+34734,
+34734,
+34751,
+34751,
+34751,
+34764,
+34786,
+34795,
+34795,
+34795,
+34795,
+34795,
+34826,
+34826,
+34826,
+34826,
+34826,
+34826,
+34826,
+34839,
+34839,
+34884,
+34884,
+34897,
+34897,
+34897,
+34930,
34939,
34939,
-34954,
-34954,
-34954,
-34954,
-34971,
-34971,
-34988,
-34988,
-34998,
-35006,
-35006,
-35006,
-35017,
-35023,
-35023,
-35028,
-35028,
-35047,
-35066,
-35066,
-35076,
-35128,
-35137,
-35158,
-35174,
-35174,
-35181,
-35181,
-35223,
-35233,
-35248,
-35258,
-35277,
-35277,
-35282,
+34946,
+34989,
+35026,
+35038,
+35038,
+35038,
+35049,
+35049,
+35103,
+35103,
+35103,
+35103,
+35103,
+35103,
+35103,
+35103,
+35118,
+35118,
+35118,
+35135,
+35135,
+35163,
+35163,
+35163,
+35163,
+35191,
+35191,
+35213,
+35228,
+35234,
+35274,
+35284,
+35284,
+35284,
+35284,
+35290,
+35290,
35300,
-35316,
-35335,
-35335,
-35344,
-35378,
-35400,
-35419,
-35433,
-35433,
+35322,
+35353,
+35353,
+35353,
+35374,
+35387,
+35387,
+35393,
+35393,
35448,
-35461,
-35477,
-35498,
-35522,
-35533,
-35554,
-35569,
-35569,
-35586,
-35595,
-35608,
-35608,
-35608,
-35618,
-35623,
-35635,
-35645,
-35645,
-35645,
-35682,
-35682,
-35682,
-35682,
-35687,
-35701,
-35705,
-35705,
-35705,
-35715,
-35715,
-35715,
+35448,
+35460,
+35479,
+35479,
+35479,
+35501,
+35501,
+35531,
+35587,
+35593,
+35615,
+35615,
+35615,
+35615,
+35642,
+35653,
+35661,
+35680,
+35680,
+35680,
+35680,
+35680,
+35680,
+35688,
+35712,
+35712,
+35712,
+35718,
+35718,
+35724,
+35724,
+35724,
+35747,
+35747,
+35747,
35753,
-35766,
-35808,
-35821,
-35825,
-35835,
-35857,
-35877,
-35877,
-35877,
-35888,
-35888,
-35905,
-35967,
-35967,
-35974,
-35974,
-36001,
-36027,
-36027,
-36038,
-36038,
-36054,
-36064,
-36064,
-36064,
-36083,
-36111,
-36133,
-36133,
-36156,
-36178,
-36198,
-36198,
-36198,
-36202,
-36255,
-36276,
-36282,
-36290,
-36290,
-36313,
-36334,
-36334,
-36334,
-36345,
-36411,
-36424,
-36450,
-36472,
-36472,
-36472,
-36479,
-36495,
-36511,
-36575,
-36575,
-36593,
-36593,
-36593,
-36593,
-36602,
-36616,
-36628,
-36628,
-36656,
-36672,
-36719,
-36719,
-36719,
-36719,
-36719,
-36737,
-36737,
-36737,
-36750,
-36750,
-36750,
-36758,
-36770,
-36770,
-36778,
-36778,
-36778,
-36778,
-36826,
-36835,
-36835,
-36835,
-36850,
-36850,
-36855,
-36872,
-36872,
-36903,
-36919,
-36934,
-36939,
-36939,
-36954,
-36954,
-36986,
-37016,
-37043,
-37051,
-37062,
-37062,
-37062,
-37069,
-37069,
-37069,
-37069,
-37069,
-37069,
-37069,
-37069,
-37096,
-37096,
-37115,
-37115,
-37149,
-37177,
+35764,
+35764,
+35782,
+35802,
+35812,
+35832,
+35846,
+35867,
+35909,
+35909,
+35925,
+35935,
+35935,
+35935,
+35935,
+35935,
+35935,
+35976,
+35997,
+36014,
+36048,
+36048,
+36073,
+36106,
+36106,
+36112,
+36124,
+36124,
+36124,
+36148,
+36158,
+36158,
+36170,
+36170,
+36190,
+36190,
+36190,
+36194,
+36203,
+36221,
+36244,
+36269,
+36269,
+36285,
+36297,
+36321,
+36328,
+36328,
+36350,
+36378,
+36395,
+36405,
+36405,
+36412,
+36412,
+36425,
+36425,
+36425,
+36425,
+36444,
+36444,
+36444,
+36470,
+36492,
+36524,
+36541,
+36558,
+36558,
+36576,
+36614,
+36614,
+36638,
+36638,
+36660,
+36660,
+36664,
+36670,
+36717,
+36722,
+36741,
+36765,
+36765,
+36783,
+36783,
+36783,
+36783,
+36801,
+36811,
+36811,
+36825,
+36825,
+36856,
+36856,
+36868,
+36868,
+36868,
+36868,
+36868,
+36920,
+36920,
+36920,
+36932,
+36953,
+36953,
+36972,
+36988,
+36995,
+37007,
+37027,
+37033,
+37072,
+37089,
+37089,
+37089,
+37107,
+37137,
+37154,
+37154,
+37161,
+37167,
+37187,
+37187,
+37187,
+37187,
37193,
-37214,
-37228,
-37228,
-37228,
-37228,
-37228,
+37199,
+37207,
+37231,
+37231,
+37231,
+37241,
37241,
-37245,
-37245,
-37245,
-37250,
-37250,
-37268,
-37294,
+37258,
+37280,
37299,
-37314,
-37328,
-37335,
-37335,
-37372,
-37380,
-37396,
-37410,
-37416,
-37428,
-37468,
-37490,
-37511,
+37299,
+37324,
+37338,
+37351,
+37351,
+37365,
+37371,
+37414,
+37420,
+37432,
+37451,
+37451,
+37457,
+37457,
+37488,
37516,
37516,
-37528,
-37528,
-37528,
-37528,
-37534,
-37534,
-37562,
-37589,
-37589,
-37589,
-37611,
-37611,
-37611,
-37625,
-37631,
-37654,
-37654,
-37654,
-37658,
-37685,
-37685,
-37706,
-37717,
-37717,
-37717,
-37732,
-37732,
-37732,
-37758,
-37783,
-37803,
-37822,
-37840,
-37840,
-37840,
-37840,
-37863,
-37881,
+37529,
+37538,
+37558,
+37580,
+37580,
+37614,
+37636,
+37650,
+37650,
+37662,
+37678,
+37710,
+37755,
+37762,
+37762,
+37771,
+37782,
+37816,
+37816,
+37838,
+37851,
+37889,
+37894,
37894,
-37926,
-37949,
-37949,
-37949,
-37970,
-37970,
-37991,
-37991,
-37991,
-37991,
-38025,
-38025,
-38025,
-38025,
+37905,
+37914,
+37921,
+37921,
+37930,
+37957,
+37984,
+38029,
38045,
-38058,
-38058,
-38080,
-38080,
-38095,
-38095,
-38142,
-38179,
+38061,
+38061,
+38061,
+38074,
+38082,
+38101,
+38108,
+38108,
+38115,
+38122,
+38122,
38187,
-38211,
-38218,
-38225,
-38232,
-38277,
-38298,
-38298,
-38328,
-38352,
-38352,
-38371,
-38371,
-38378,
-38407,
-38428,
-38448,
-38448,
-38458,
-38458,
-38458,
-38489,
-38489,
-38489,
-38489,
-38499,
-38515,
-38532,
-38532,
-38578,
-38578,
-38586,
-38606,
-38606,
-38624,
-38624,
-38624,
-38642,
-38647,
-38647,
-38658,
-38665,
-38682,
-38723,
-38767,
-38767,
-38795,
-38795,
-38801,
-38801,
-38801,
-38837,
-38837,
-38856,
-38856,
-38894,
-38915,
-38941,
-38965,
-38965,
-38965,
-38965,
-38992,
-39015,
-39039,
-39045,
-39045,
-39053,
-39058,
-39058,
-39088,
-39088,
-39118,
-39118,
-39129,
-39129,
-39129,
-39147,
-39155,
-39155,
-39178,
-39182,
-39222,
-39222,
-39230,
-39230,
-39230,
-39230,
-39238,
-39238,
-39260,
-39260,
-39260,
-39281,
-39295,
-39310,
-39328,
-39335,
-39342,
-39358,
-39371,
-39386,
-39386,
-39415,
-39415,
-39422,
-39454,
-39471,
-39471,
+38187,
+38187,
+38210,
+38210,
+38214,
+38214,
+38241,
+38252,
+38274,
+38274,
+38274,
+38274,
+38284,
+38291,
+38291,
+38302,
+38313,
+38333,
+38333,
+38354,
+38354,
+38429,
+38429,
+38429,
+38429,
+38429,
+38464,
+38473,
+38503,
+38516,
+38555,
+38569,
+38569,
+38583,
+38603,
+38610,
+38619,
+38628,
+38638,
+38651,
+38656,
+38656,
+38662,
+38674,
+38704,
+38704,
+38739,
+38739,
+38739,
+38757,
+38757,
+38799,
+38833,
+38833,
+38855,
+38859,
+38893,
+38931,
+38931,
+38959,
+38977,
+38977,
+39000,
+39011,
+39011,
+39025,
+39060,
+39060,
+39070,
+39083,
+39089,
+39089,
+39093,
+39093,
+39100,
+39100,
+39123,
+39123,
+39123,
+39123,
+39123,
+39123,
+39150,
+39150,
+39168,
+39168,
+39168,
+39168,
+39198,
+39198,
+39198,
+39223,
+39246,
+39270,
+39280,
+39292,
+39292,
+39308,
+39308,
+39326,
+39326,
+39341,
+39341,
+39341,
+39341,
+39352,
+39365,
+39365,
+39372,
+39385,
+39405,
+39419,
+39436,
+39436,
+39436,
39471,
-39478,
-39520,
-39520,
-39534,
-39541,
-39541,
-39548,
-39548,
-39548,
-39568,
-39581,
+39489,
+39496,
+39523,
+39530,
+39530,
+39530,
+39544,
+39557,
+39564,
+39564,
39605,
-39613,
-39627,
-39634,
-39672,
+39612,
+39629,
+39650,
+39679,
+39679,
+39679,
+39689,
39699,
-39705,
-39712,
-39728,
-39741,
-39748,
-39755,
-39762,
-39799,
-39843,
-39884,
-39891,
-39905,
-39922,
-39922,
-39929,
-39936,
-39943,
-39970,
-39970,
-39970,
-39988,
-40002,
-40022,
-40026,
-40026,
-40043,
-40073,
-40097,
-40107,
-40107,
-40166,
-40178,
-40184,
-40211,
-40234,
-40260,
-40260,
-40285,
-40310,
-40310,
-40331,
-40348,
-40348,
-40362,
-40380,
-40380,
-40394,
-40414,
-40414,
-40421,
-40421,
-40460,
-40472,
-40483,
-40490,
-40497,
-40512,
-40527,
-40546,
-40587,
-40587,
-40587,
-40587,
-40607,
-40614,
-40614,
-40614,
-40614,
-40614,
-40635,
-40635,
-40635,
-40653,
-40673,
-40673,
-40673,
-40673,
-40673,
-40680,
+39699,
+39706,
+39715,
+39734,
+39734,
+39734,
+39754,
+39789,
+39789,
+39806,
+39820,
+39879,
+39893,
+39904,
+39945,
+39945,
+39945,
+39945,
+39945,
+39945,
+39957,
+40010,
+40034,
+40074,
+40104,
+40104,
+40104,
+40104,
+40104,
+40111,
+40118,
+40138,
+40152,
+40182,
+40198,
+40198,
+40198,
+40198,
+40232,
+40236,
+40251,
+40251,
+40272,
+40279,
+40296,
+40327,
+40336,
+40336,
+40398,
+40405,
+40423,
+40474,
+40484,
+40501,
+40519,
+40519,
+40580,
+40631,
40680,
-40694,
-40708,
-40731,
-40731,
-40738,
-40757,
-40757,
-40764,
-40803,
-40812,
+40720,
+40727,
+40727,
+40727,
+40734,
+40734,
+40734,
+40741,
+40761,
+40805,
40825,
-40825,
-40832,
-40838,
-40869,
-40922,
-40936,
-40955,
-40990,
-40997,
-41010,
-41053,
-41071,
-41101,
-41107,
-41119,
-41194,
-41208,
-41208,
-41208,
-41215,
-41233,
-41265,
-41285,
-41295,
-41318,
-41318,
-41336,
-41356,
-41356,
-41363,
-41379,
-41407,
-41439,
-41469,
-41500,
-41500,
-41524,
-41524,
-41524,
-41524,
-41529,
-41578,
-41616,
-41616,
-41631,
-41672,
-41677,
-41711,
-41726,
-41787,
-41787,
-41787,
-41818,
-41845,
-41845,
-41845,
-41900,
-41930,
-41937,
-41937,
-41937,
-41937,
-41986,
-42025,
-42037,
-42059,
-42073,
-42080,
-42148,
-42148,
-42163,
-42179,
-42186,
-42197,
-42219,
-42226,
-42240,
-42240,
-42240,
-42259,
-42264,
-42280,
-42290,
-42313,
-42313,
-42328,
-42346,
-42373,
-42380,
-42399,
-42406,
-42406,
-42413,
-42427,
-42476,
-42494,
-42533,
-42533,
-42540,
-42540,
-42556,
-42567,
-42587,
-42601,
-42615,
-42622,
-42643,
-42664,
-42664,
-42664,
-42702,
-42718,
-42718,
+40846,
+40864,
+40894,
+40906,
+40906,
+40906,
+40944,
+40951,
+40971,
+40980,
+40999,
+40999,
+41015,
+41029,
+41042,
+41042,
+41059,
+41093,
+41105,
+41125,
+41163,
+41163,
+41172,
+41183,
+41183,
+41183,
+41183,
+41183,
+41192,
+41207,
+41222,
+41222,
+41222,
+41228,
+41235,
+41241,
+41241,
+41260,
+41267,
+41267,
+41287,
+41294,
+41314,
+41319,
+41319,
+41326,
+41332,
+41346,
+41346,
+41346,
+41354,
+41361,
+41361,
+41368,
+41368,
+41387,
+41416,
+41426,
+41433,
+41462,
+41496,
+41496,
+41528,
+41528,
+41553,
+41558,
+41558,
+41565,
+41586,
+41586,
+41586,
+41603,
+41610,
+41610,
+41636,
+41656,
+41656,
+41675,
+41675,
+41728,
+41752,
+41752,
+41760,
+41760,
+41791,
+41791,
+41805,
+41840,
+41852,
+41869,
+41894,
+41894,
+41894,
+41907,
+41917,
+41917,
+41917,
+41926,
+41933,
+41933,
+41946,
+41946,
+41951,
+41951,
+41980,
+41996,
+41996,
+42017,
+42036,
+42052,
+42089,
+42114,
+42114,
+42121,
+42121,
+42145,
+42145,
+42157,
+42157,
+42157,
+42165,
+42183,
+42183,
+42214,
+42235,
+42262,
+42262,
+42276,
+42276,
+42276,
+42296,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42327,
+42362,
+42362,
+42369,
+42404,
+42411,
+42435,
+42463,
+42487,
+42513,
+42526,
+42555,
+42583,
+42583,
+42596,
+42612,
+42623,
+42634,
+42639,
+42670,
+42704,
+42704,
+42704,
+42727,
+42727,
42734,
-42746,
-42761,
-42781,
-42793,
-42810,
-42815,
-42841,
-42890,
-42897,
-42905,
-42917,
-42924,
-42931,
-42936,
-42941,
-42951,
-42967,
-42988,
-42988,
+42748,
+42772,
+42804,
+42804,
+42808,
+42821,
+42843,
+42892,
+42899,
+42909,
+42916,
+42956,
+42978,
+42987,
+42987,
43012,
-43028,
-43054,
-43070,
+43030,
+43037,
+43059,
+43075,
+43075,
+43089,
+43096,
43123,
-43127,
-43144,
-43175,
-43199,
-43199,
-43236,
-43244,
-43244,
-43273,
-43280,
-43287,
-43302,
-43318,
+43154,
+43168,
+43168,
+43168,
+43181,
+43205,
+43205,
+43212,
+43218,
+43250,
+43250,
+43257,
+43257,
+43264,
+43264,
+43271,
+43284,
+43304,
+43304,
43318,
-43318,
-43331,
-43353,
-43373,
+43348,
+43355,
43373,
-43390,
-43390,
-43390,
-43390,
-43425,
-43437,
-43437,
-43447,
-43464,
-43504,
-43504,
-43504,
-43504,
-43504,
-43504,
-43512,
-43587,
-43587,
-43613,
-43620,
-43620,
-43669,
-43684,
-43698,
-43711,
-43732,
-43752,
-43766,
-43773,
-43796,
-43811,
-43820,
-43840,
-43840,
-43856,
-43876,
-43891,
-43922,
-43922,
-43945,
-43970,
-43984,
-44011,
-44024,
-44024,
-44048,
-44055,
-44055,
-44060,
-44067,
-44074,
-44094,
-44094,
-44106,
-44126,
-44136,
-44149,
-44149,
-44149,
-44190,
-44232,
-44232,
-44250,
-44264,
-44264,
-44264,
-44280,
-44280,
-44280,
-44303,
-44335,
+43394,
+43394,
+43419,
+43426,
+43430,
+43430,
+43443,
+43461,
+43478,
+43490,
+43490,
+43490,
+43537,
+43556,
+43556,
+43578,
+43604,
+43640,
+43640,
+43640,
+43645,
+43679,
+43705,
+43747,
+43769,
+43769,
+43769,
+43775,
+43803,
+43803,
+43810,
+43810,
+43844,
+43865,
+43872,
+43880,
+43886,
+43921,
+43921,
+43928,
+43928,
+43935,
+43985,
+43992,
+43992,
+44009,
+44022,
+44022,
+44038,
+44042,
+44049,
+44049,
+44056,
+44100,
+44100,
+44107,
+44121,
+44121,
+44121,
+44137,
+44197,
+44204,
+44236,
+44254,
+44286,
+44286,
+44307,
+44319,
+44329,
+44336,
+44343,
+44361,
44361,
44361,
-44398,
-44406,
-44425,
-44425,
-44452,
-44459,
-44459,
-44459,
-44459,
-44466,
-44481,
-44516,
-44550,
-44556,
-44576,
-44576,
-44583,
-44583,
-44599,
-44621,
+44377,
+44396,
+44423,
+44423,
+44449,
+44471,
+44471,
+44480,
+44480,
+44500,
+44514,
+44537,
+44560,
+44573,
+44606,
+44619,
44642,
-44651,
-44661,
-44661,
-44661,
-44679,
-44679,
-44710,
-44728,
-44740,
-44747,
-44761,
-44772,
-44795,
-44804,
-44804,
-44804,
-44804,
-44804,
-44808,
-44814,
-44814,
-44814,
-44832,
-44832,
-44832,
-44844,
-44872,
-44899,
+44705,
+44705,
+44705,
+44711,
+44746,
+44753,
+44753,
+44765,
+44765,
+44765,
+44787,
+44794,
+44801,
+44851,
+44865,
+44884,
+44891,
+44915,
+44924,
+44924,
44924,
-44931,
-44931,
-44939,
-44983,
-44988,
-44988,
-44998,
-45008,
-45015,
-45015,
-45028,
-45028,
-45045,
-45045,
-45074,
-45091,
-45091,
-45091,
-45091,
-45095,
-45141,
-45141,
-45155,
-45155,
-45155,
-45173,
-45196,
-45209,
-45226,
-45238,
-45266,
-45266,
-45266,
-45266,
-45302,
-45308,
-45312,
-45312,
-45333,
-45365,
-45377,
-45386,
-45409,
-45409,
-45409,
-45409,
-45445,
-45455,
-45478,
-45478,
-45494,
-45511,
-45511,
-45511,
-45523,
-45523,
-45538,
-45538,
-45553,
-45553,
-45589,
-45589,
-45600,
-45610,
-45629,
-45657,
-45720,
-45725,
-45725,
-45755,
-45777,
-45777,
-45791,
-45814,
-45840,
-45890,
-45890,
-45890,
-45927,
-45927,
-45934,
-45934,
-45954,
-45954,
-45976,
-45976,
-45976,
-45998,
-46007,
+44960,
+44960,
+44967,
+45006,
+45013,
+45029,
+45036,
+45042,
+45042,
+45053,
+45060,
+45076,
+45108,
+45108,
+45131,
+45138,
+45161,
+45184,
+45261,
+45275,
+45288,
+45305,
+45352,
+45359,
+45403,
+45429,
+45457,
+45484,
+45497,
+45543,
+45574,
+45598,
+45625,
+45665,
+45679,
+45686,
+45691,
+45691,
+45717,
+45722,
+45737,
+45744,
+45744,
+45770,
+45770,
+45774,
+45774,
+45781,
+45815,
+45832,
+45839,
+45856,
+45863,
+45863,
+45896,
+45915,
+45950,
+45950,
+45967,
+45967,
46016,
46016,
-46034,
-46034,
-46066,
-46081,
-46102,
+46023,
+46038,
+46038,
+46063,
+46063,
+46074,
+46087,
46117,
-46146,
-46146,
-46162,
-46162,
-46169,
-46174,
-46215,
-46215,
-46234,
-46239,
-46286,
-46286,
-46300,
-46313,
-46370,
-46370,
-46370,
-46374,
-46379,
-46393,
-46401,
-46416,
-46416,
-46446,
-46467,
-46482,
-46482,
-46496,
+46117,
+46153,
+46153,
+46163,
+46195,
+46202,
+46275,
+46302,
+46320,
+46327,
+46343,
+46343,
+46360,
+46402,
+46402,
+46430,
+46441,
+46445,
+46445,
+46445,
+46461,
+46461,
+46461,
+46478,
+46478,
46538,
46538,
-46581,
-46581,
-46629,
-46629,
-46629,
-46640,
-46644,
-46649,
+46538,
+46552,
+46569,
+46569,
+46577,
+46585,
+46585,
+46602,
+46610,
46649,
-46659,
-46659,
-46673,
-46700,
-46731,
-46731,
-46731,
-46741,
-46766,
-46766,
-46771,
-46771,
-46782,
-46794,
-46794,
-46812,
-46812,
+46656,
+46670,
+46715,
+46734,
+46734,
+46760,
+46767,
+46767,
+46781,
+46781,
+46795,
+46813,
46828,
-46851,
-46851,
-46851,
-46851,
-46851,
-46855,
-46868,
-46875,
-46875,
-46886,
-46890,
-46925,
-46925,
-46925,
-46936,
-46954,
-46972,
-46972,
-46972,
+46835,
+46858,
+46858,
+46858,
+46884,
+46918,
+46930,
+46973,
+46984,
46998,
-47068,
-47068,
-47068,
-47098,
-47107,
-47122,
-47128,
-47151,
-47156,
+47009,
+47032,
+47038,
+47038,
+47064,
+47113,
+47133,
+47149,
47156,
-47170,
-47177,
-47182,
-47193,
-47200,
-47226,
-47226,
-47253,
-47273,
-47283,
-47283,
-47290,
-47303,
-47303,
-47303,
-47320,
-47327,
-47327,
-47335,
-47335,
-47344,
-47344,
-47356,
-47356,
-47360,
-47360,
-47369,
-47394,
-47425,
-47425,
-47425,
-47443,
-47466,
-47466,
-47481,
-47495,
-47513,
-47513,
+47163,
+47178,
+47215,
+47224,
+47236,
+47263,
+47263,
+47287,
+47295,
+47333,
+47333,
+47343,
+47343,
+47365,
+47404,
+47433,
+47441,
+47448,
+47469,
+47508,
+47526,
47532,
-47532,
-47543,
-47590,
-47603,
-47613,
-47618,
-47618,
-47635,
-47641,
-47641,
-47679,
-47727,
-47740,
-47753,
-47769,
-47779,
-47801,
-47809,
-47829,
-47859,
-47859,
-47878,
-47885,
-47906,
-47906,
+47545,
+47584,
+47610,
+47610,
+47627,
+47627,
+47644,
+47644,
+47644,
+47649,
+47680,
+47699,
+47699,
+47721,
+47721,
+47721,
+47721,
+47749,
+47749,
+47785,
+47785,
+47785,
+47785,
+47785,
+47785,
+47824,
+47824,
+47839,
+47861,
47906,
-47940,
-47950,
-47950,
-47950,
-47950,
-47984,
-47991,
-47991,
+47924,
+47924,
+47942,
+47946,
+47946,
+47980,
47991,
-47991,
-48029,
-48029,
-48029,
-48038,
-48038,
-48038,
-48055,
-48055,
-48065,
-48065,
-48065,
+48009,
+48014,
+48035,
48065,
-48105,
-48105,
-48123,
-48138,
-48164,
-48179,
-48179,
-48179,
-48205,
-48211,
-48250,
-48310,
-48343,
-48368,
-48368,
-48374,
-48381,
-48397,
-48397,
-48397,
-48406,
-48426,
-48426,
-48439,
+48075,
+48101,
+48112,
+48126,
+48148,
+48148,
+48148,
+48156,
+48239,
+48239,
+48244,
+48244,
+48281,
+48281,
+48291,
+48291,
+48306,
+48324,
+48340,
+48353,
+48366,
+48366,
+48366,
+48378,
+48378,
+48396,
+48396,
+48414,
+48421,
+48435,
+48435,
48458,
-48458,
-48485,
-48485,
-48494,
-48520,
-48532,
-48578,
-48595,
-48608,
-48608,
-48608,
-48623,
-48636,
-48636,
-48636,
-48636,
-48648,
-48687,
-48703,
-48711,
-48727,
+48522,
+48522,
+48534,
+48534,
+48548,
+48556,
+48571,
+48585,
+48593,
+48593,
+48611,
+48611,
+48616,
+48616,
+48629,
+48629,
+48629,
+48642,
+48654,
+48692,
+48700,
+48700,
+48700,
+48700,
+48700,
+48713,
+48713,
+48713,
+48730,
+48741,
48741,
-48746,
-48746,
-48746,
-48746,
-48746,
-48746,
-48771,
-48771,
-48771,
-48806,
-48847,
-48847,
-48847,
-48847,
-48847,
-48886,
-48886,
-48886,
-48886,
-48886,
-48886,
-48899,
-48933,
-48933,
-48933,
-48975,
-48979,
-48986,
-48986,
-49019,
-49019,
-49019,
-49040,
-49040,
-49040,
-49059,
-49076,
-49103,
-49103,
-49132,
-49132,
-49132,
-49132,
-49132,
-49132,
-49154,
-49171,
+48760,
+48760,
+48765,
+48765,
+48765,
+48777,
+48777,
+48777,
+48788,
+48809,
+48827,
+48827,
+48827,
+48827,
+48854,
+48888,
+48905,
+48919,
+48935,
+48935,
+48947,
+48960,
+48960,
+48982,
+49004,
+49020,
+49020,
+49043,
+49060,
+49060,
+49060,
+49074,
+49090,
+49096,
+49125,
+49146,
+49166,
+49191,
+49191,
+49191,
49191,
-49216,
-49226,
-49264,
-49264,
-49278,
-49278,
-49301,
-49340,
-49340,
-49360,
-49370,
-49370,
-49374,
-49381,
-49381,
-49399,
-49406,
-49419,
-49428,
-49428,
-49464,
-49464,
-49497,
-49497,
-49497,
-49497,
-49501,
-49501,
-49501,
-49518,
-49548,
-49548,
-49579,
-49594,
-49619,
-49619,
-49639,
-49665,
-49665,
-49665,
-49665,
-49671,
-49671,
-49671,
-49686,
-49686,
-49686,
-49701,
-49701,
-49701,
-49724,
-49738,
-49755,
-49755,
-49765,
-49785,
-49795,
-49807,
-49807,
-49842,
-49862,
-49862,
-49876,
-49899,
-49899,
-49899,
-49929,
-49929,
-49929,
-49959,
-49959,
-49959,
-49990,
-49994,
-50012,
-50028,
-50071,
-50071,
-50081,
-50081,
-50081,
-50091,
-50099,
-50139,
-50139,
-50139,
-50139,
-50156,
-50184,
-50209,
-50209,
-50209,
-50216,
-50216,
-50223,
-50231,
-50231,
-50231,
-50231,
-50251,
-50265,
-50273,
-50295,
-50311,
-50311,
-50330,
-50330,
-50339,
-50348,
-50373,
-50373,
-50406,
-50406,
-50406,
-50422,
-50422,
-50433,
-50494,
-50526,
-50542,
-50542,
-50542,
-50542,
-50542,
-50552,
-50552,
-50586,
-50586,
-50586,
-50612,
-50619,
-50619,
-50644,
-50659,
-50659,
-50676,
-50676,
-50676,
-50676,
-50676,
-50723,
-50736,
-50736,
-50736,
-50736,
-50755,
-50778,
-50778,
-50778,
-50785,
-50785,
-50793,
-50815,
-50856,
-50856,
-50874,
-50886,
-50909,
-50918,
-50973,
-50998,
-51014,
-51030,
-51030,
-51030,
-51036,
-51036,
-51046,
-51072,
-51072,
-51078,
-51118,
-51118,
-51118,
-51118,
-51134,
-51182,
-51203,
-51219,
-51219,
-51230,
-51240,
-51240,
-51260,
-51260,
-51260,
-51260,
-51260,
-51260,
-51260,
-51275,
-51275,
-51301,
-51358,
-51374,
-51386,
-51393,
-51402,
-51402,
-51402,
-51441,
-51471,
-51507,
-51507,
-51531,
-51547,
-51547,
-51571,
-51571,
-51571,
-51571,
-51571,
-51571,
-51587,
-51612,
-51626,
-51642,
-51665,
-51681,
-51681,
-51681,
-51681,
-51700,
-51713,
-51734,
-51742,
-51746,
-51746,
-51746,
-51759,
-51759,
-51799,
-51799,
-51811,
-51811,
-51816,
-51816,
-51851,
-51851,
-51867,
-51879,
-51879,
-51885,
-51902,
-51918,
-51940,
-51940,
-51946,
-51966,
+49191,
+49203,
+49213,
+49219,
+49245,
+49280,
+49288,
+49300,
+49307,
+49322,
+49329,
+49342,
+49367,
+49384,
+49391,
+49391,
+49414,
+49426,
+49446,
+49460,
+49460,
+49460,
+49489,
+49503,
+49503,
+49532,
+49539,
+49539,
+49539,
+49546,
+49546,
+49567,
+49567,
+49582,
+49589,
+49596,
+49603,
+49609,
+49609,
+49653,
+49660,
+49667,
+49692,
+49710,
+49736,
+49752,
+49777,
+49802,
+49808,
+49819,
+49826,
+49845,
+49861,
+49905,
+49905,
+49916,
+49916,
+49916,
+49938,
+49938,
+49962,
+49962,
+49969,
+49976,
+50026,
+50026,
+50088,
+50088,
+50110,
+50157,
+50191,
+50234,
+50261,
+50261,
+50278,
+50278,
+50285,
+50285,
+50289,
+50314,
+50324,
+50324,
+50324,
+50324,
+50324,
+50337,
+50337,
+50337,
+50351,
+50358,
+50358,
+50358,
+50358,
+50375,
+50375,
+50375,
+50383,
+50383,
+50383,
+50396,
+50432,
+50432,
+50432,
+50432,
+50432,
+50432,
+50439,
+50439,
+50446,
+50519,
+50533,
+50537,
+50548,
+50555,
+50581,
+50588,
+50599,
+50620,
+50647,
+50654,
+50665,
+50672,
+50688,
+50688,
+50699,
+50719,
+50742,
+50742,
+50749,
+50804,
+50810,
+50827,
+50849,
+50849,
+50849,
+50849,
+50887,
+50901,
+50910,
+50910,
+50933,
+50950,
+50950,
+50962,
+50962,
+51006,
+51013,
+51028,
+51028,
+51028,
+51035,
+51068,
+51075,
+51075,
+51082,
+51089,
+51089,
+51109,
+51125,
+51153,
+51160,
+51160,
+51179,
+51204,
+51211,
+51211,
+51228,
+51228,
+51241,
+51241,
+51241,
+51241,
+51248,
+51248,
+51276,
+51288,
+51302,
+51334,
+51342,
+51349,
+51349,
+51364,
+51394,
+51401,
+51426,
+51426,
+51426,
+51446,
+51453,
+51453,
+51479,
+51494,
+51526,
+51526,
+51536,
+51558,
+51567,
+51589,
+51639,
+51646,
+51661,
+51661,
+51678,
+51685,
+51685,
+51693,
+51715,
+51715,
+51722,
+51729,
+51739,
+51747,
+51754,
+51754,
+51777,
+51777,
+51784,
+51791,
+51826,
+51847,
+51868,
+51892,
+51912,
+51937,
+51968,
+51989,
+51989,
+51989,
+51989,
+51989,
51997,
-52007,
-52018,
-52018,
-52049,
-52049,
-52049,
-52064,
-52064,
-52084,
-52104,
-52130,
-52168,
-52204,
-52236,
-52249,
-52249,
-52276,
-52276,
-52309,
-52328,
-52328,
-52338,
-52364,
-52364,
-52377,
-52395,
-52402,
-52418,
-52441,
-52441,
-52485,
-52524,
-52524,
-52567,
-52567,
-52567,
-52567,
-52614,
-52628,
-52628,
-52642,
-52654,
-52680,
-52699,
-52760,
-52765,
-52765,
-52765,
-52785,
-52785,
-52785,
-52785,
-52806,
-52832,
-52832,
-52871,
-52871,
-52885,
-52885,
-52892,
+52004,
+52020,
+52031,
+52031,
+52031,
+52047,
+52058,
+52066,
+52073,
+52093,
+52093,
+52113,
+52113,
+52113,
+52113,
+52134,
+52153,
+52163,
+52163,
+52178,
+52195,
+52208,
+52215,
+52215,
+52215,
+52227,
+52270,
+52285,
+52302,
+52311,
+52311,
+52362,
+52378,
+52416,
+52433,
+52458,
+52468,
+52468,
+52468,
+52491,
+52491,
+52504,
+52504,
+52513,
+52518,
+52518,
+52518,
+52534,
+52534,
+52542,
+52542,
+52559,
+52581,
+52610,
+52644,
+52657,
+52662,
+52685,
+52685,
+52690,
+52690,
+52708,
+52728,
+52747,
+52774,
+52788,
+52830,
+52837,
+52837,
+52876,
+52883,
+52911,
52911,
-52935,
-52958,
-52976,
-52996,
-53005,
-53005,
-53022,
-53022,
-53022,
-53066,
-53081,
-53088,
-53102,
-53109,
-53109,
-53120,
-53124,
-53158,
-53174,
-53174,
-53185,
-53185,
-53221,
-53249,
-53256,
-53256,
-53285,
-53290,
-53309,
-53309,
-53309,
+52921,
+52943,
+52943,
+52943,
+52967,
+52967,
+52981,
+53000,
+53014,
+53050,
+53050,
+53061,
+53061,
+53075,
+53082,
+53129,
+53129,
+53129,
+53145,
+53152,
+53159,
+53159,
+53179,
+53186,
+53192,
+53199,
+53199,
+53199,
+53234,
+53257,
+53262,
+53279,
+53298,
53317,
-53322,
-53322,
-53322,
-53360,
-53369,
-53369,
-53369,
-53386,
-53405,
-53405,
-53405,
-53412,
-53432,
+53341,
+53361,
+53361,
+53361,
+53372,
+53372,
+53411,
+53433,
53444,
-53464,
-53472,
-53494,
-53494,
-53494,
+53455,
+53476,
+53490,
+53504,
53531,
-53547,
-53547,
-53547,
-53547,
-53556,
-53556,
-53556,
-53556,
-53556,
-53564,
-53587,
-53606,
-53610,
-53628,
-53651,
-53651,
-53667,
+53531,
+53531,
+53545,
+53552,
+53568,
+53568,
+53568,
+53580,
+53580,
+53613,
+53635,
53667,
-53674,
-53674,
-53681,
-53697,
-53701,
-53701,
-53722,
-53722,
-53729,
-53741,
-53749,
-53749,
-53749,
-53749,
-53765,
+53677,
+53706,
+53706,
+53706,
+53726,
+53767,
53774,
-53785,
-53799,
-53799,
-53821,
-53831,
-53847,
-53902,
-53902,
-53902,
-53902,
-53941,
-53962,
-53972,
-53972,
-53998,
-54016,
-54033,
-54049,
-54066,
-54066,
-54079,
-54089,
-54089,
-54089,
-54096,
-54118,
-54139,
-54163,
-54179,
-54184,
-54210,
-54232,
-54254,
-54278,
-54278,
-54292,
-54325,
-54337,
-54371,
-54396,
-54421,
-54434,
-54455,
-54462,
+53792,
+53805,
+53816,
+53824,
+53851,
+53869,
+53869,
+53869,
+53869,
+53869,
+53879,
+53893,
+53893,
+53903,
+53903,
+53912,
+53912,
+53912,
+53912,
+53912,
+53912,
+53924,
+53924,
+53931,
+53931,
+53950,
+53960,
+53960,
+53965,
+53986,
+53986,
+54018,
+54028,
+54036,
+54054,
+54061,
+54061,
+54080,
+54090,
+54098,
+54102,
+54106,
+54106,
+54122,
+54143,
+54143,
+54158,
+54165,
+54165,
+54175,
+54175,
+54175,
+54192,
+54204,
+54220,
+54265,
+54265,
+54265,
+54271,
+54271,
+54271,
+54271,
+54276,
+54276,
+54300,
+54306,
+54306,
+54315,
+54324,
+54329,
+54343,
+54365,
+54381,
+54381,
+54381,
+54381,
+54381,
+54381,
+54403,
+54403,
+54403,
+54429,
+54445,
+54445,
+54445,
+54458,
+54458,
+54471,
+54495,
54495,
54507,
-54507,
-54523,
-54542,
-54552,
-54552,
-54552,
-54552,
-54552,
-54559,
-54559,
-54569,
-54620,
-54692,
-54710,
-54721,
-54721,
-54759,
-54773,
-54787,
-54787,
-54803,
-54808,
-54834,
-54834,
-54848,
-54848,
-54848,
-54855,
-54855,
-54879,
-54891,
-54891,
-54891,
-54891,
-54900,
-54910,
-54949,
-54962,
-54978,
-54978,
-54985,
-55005,
-55018,
-55037,
-55037,
-55044,
-55049,
-55049,
-55056,
-55066,
-55073,
-55081,
-55143,
-55151,
-55161,
+54514,
+54519,
+54526,
+54554,
+54571,
+54600,
+54607,
+54622,
+54622,
+54638,
+54656,
+54656,
+54665,
+54682,
+54682,
+54682,
+54703,
+54709,
+54709,
+54725,
+54749,
+54780,
+54780,
+54794,
+54799,
+54799,
+54799,
+54799,
+54804,
+54817,
+54840,
+54858,
+54858,
+54858,
+54858,
+54878,
+54890,
+54896,
+54904,
+54904,
+54911,
+54911,
+54924,
+54924,
+54924,
+54924,
+54924,
+54924,
+54924,
+54938,
+54946,
+54966,
+54984,
+54984,
+54984,
+54984,
+54984,
+54995,
+55002,
+55017,
+55017,
+55026,
+55051,
+55083,
+55083,
+55083,
+55083,
+55083,
+55100,
+55100,
+55100,
+55108,
+55116,
+55126,
+55126,
+55126,
+55126,
+55133,
+55137,
+55137,
+55137,
+55168,
+55168,
55168,
-55190,
-55196,
-55213,
-55213,
-55230,
-55237,
-55247,
-55267,
-55272,
-55279,
-55279,
-55286,
-55306,
-55334,
-55341,
-55348,
-55354,
-55363,
-55363,
-55378,
-55386,
-55395,
-55432,
-55432,
-55437,
-55446,
-55458,
-55479,
-55502,
-55512,
-55512,
-55532,
+55168,
+55173,
+55173,
+55177,
+55177,
+55177,
+55205,
+55217,
+55241,
+55255,
+55287,
+55291,
+55324,
+55328,
+55336,
+55343,
+55361,
+55376,
+55376,
+55381,
+55409,
+55409,
+55409,
+55409,
+55409,
+55424,
+55424,
+55441,
+55441,
+55452,
+55470,
+55470,
+55515,
+55515,
+55533,
+55543,
+55543,
+55543,
55543,
-55565,
-55573,
-55580,
-55580,
-55618,
-55638,
+55543,
+55543,
+55577,
+55577,
+55588,
+55603,
+55634,
+55634,
+55634,
55645,
-55657,
-55657,
-55657,
-55691,
-55708,
-55708,
-55708,
-55708,
-55729,
-55735,
-55758,
-55758,
-55767,
+55665,
+55665,
+55676,
+55693,
+55693,
+55701,
+55716,
+55734,
+55762,
55772,
+55791,
+55791,
+55795,
+55795,
+55812,
+55812,
+55816,
55820,
-55830,
-55830,
-55854,
-55854,
-55866,
-55886,
-55886,
-55886,
-55886,
-55910,
-55910,
-55914,
-55929,
-55939,
-55965,
-56006,
-56025,
-56037,
-56037,
-56037,
-56064,
-56115,
-56115,
-56128,
-56133,
-56133,
-56133,
-56133,
-56133,
-56140,
-56140,
-56140,
-56151,
+55837,
+55837,
+55837,
+55837,
+55837,
+55850,
+55850,
+55850,
+55850,
+55878,
+55878,
+55883,
+55887,
+55887,
+55887,
+55908,
+55908,
+55932,
+55932,
+55945,
+55945,
+55958,
+55958,
+55969,
+56008,
+56029,
+56029,
+56045,
+56056,
+56086,
+56086,
+56120,
+56120,
+56149,
56177,
-56205,
-56205,
-56219,
-56219,
-56219,
-56236,
-56250,
-56250,
-56250,
-56260,
-56264,
-56271,
-56271,
-56283,
-56292,
-56312,
-56329,
-56338,
+56177,
+56188,
+56188,
+56194,
+56194,
+56202,
+56202,
+56222,
+56222,
+56254,
+56254,
+56293,
+56313,
56338,
56338,
-56364,
-56371,
-56382,
-56382,
-56389,
-56389,
-56389,
-56417,
-56417,
-56417,
-56417,
-56417,
-56437,
-56437,
+56353,
+56378,
+56393,
+56393,
+56410,
+56410,
+56410,
+56410,
+56444,
56444,
-56460,
-56460,
-56474,
-56503,
+56490,
+56490,
+56490,
56511,
-56524,
-56594,
-56599,
-56659,
-56685,
-56700,
-56707,
-56707,
-56738,
-56761,
-56774,
-56785,
-56792,
-56805,
-56829,
-56829,
-56840,
-56868,
-56868,
-56868,
-56868,
-56874,
-56874,
-56874,
-56874,
-56881,
-56881,
+56511,
+56525,
+56525,
+56537,
+56558,
+56578,
+56588,
+56588,
+56596,
+56604,
+56604,
+56604,
+56604,
+56604,
+56604,
+56604,
+56608,
+56634,
+56644,
+56644,
+56644,
+56663,
+56663,
+56671,
+56671,
+56671,
+56671,
+56697,
+56718,
+56718,
+56718,
+56748,
+56752,
+56752,
+56768,
+56810,
+56810,
+56810,
+56836,
+56882,
+56882,
+56882,
+56893,
56893,
-56922,
-56934,
-56934,
-56944,
-56944,
-56944,
-56944,
-56965,
-56973,
-57005,
-57081,
-57126,
-57138,
-57159,
-57175,
-57199,
-57216,
-57216,
-57222,
-57222,
-57222,
-57237,
-57259,
-57282,
-57282,
-57296,
-57312,
-57312,
-57341,
+56917,
+56917,
+56937,
+56967,
+56976,
+56996,
+56996,
+57031,
+57049,
+57071,
+57103,
+57103,
+57103,
+57121,
+57133,
+57151,
+57151,
+57165,
+57165,
+57165,
+57170,
+57185,
+57185,
+57185,
+57204,
+57214,
+57241,
+57286,
+57336,
+57336,
+57377,
57397,
-57405,
-57442,
-57442,
-57442,
-57456,
-57466,
-57482,
-57500,
-57512,
-57537,
-57537,
-57575,
-57575,
+57409,
+57439,
+57451,
+57451,
+57472,
+57486,
+57532,
+57556,
+57556,
+57562,
57575,
-57582,
-57609,
-57633,
-57651,
-57688,
-57714,
-57767,
-57775,
-57783,
-57783,
-57810,
-57849,
-57856,
-57869,
-57889,
-57916,
+57590,
+57621,
+57654,
+57675,
+57675,
+57675,
+57689,
+57689,
+57695,
+57699,
+57716,
+57739,
+57748,
+57788,
+57806,
+57822,
+57828,
+57828,
+57838,
+57861,
+57894,
+57924,
+57924,
+57930,
+57930,
+57930,
57941,
57941,
-57941,
-57948,
-57956,
-57974,
-57996,
-58017,
-58048,
-58048,
-58048,
-58048,
-58070,
+57966,
+57997,
+58022,
+58030,
+58050,
58070,
-58094,
-58151,
-58192,
-58224,
-58224,
-58224,
-58224,
-58263,
-58263,
-58273,
-58283,
-58314,
-58356,
-58356,
-58363,
-58363,
-58363,
-58380,
-58396,
-58396,
-58417,
-58417,
-58417,
-58423,
-58423,
-58450,
-58461,
-58461,
-58470,
-58470,
-58514,
-58514,
-58537,
-58544,
-58557,
-58557,
-58557,
-58557,
-58557,
-58591,
-58615,
-58636,
-58636,
-58658,
-58679,
-58686,
-58686,
-58686,
-58700,
+58107,
+58115,
+58158,
+58185,
+58217,
+58235,
+58266,
+58272,
+58298,
+58309,
+58349,
+58381,
+58381,
+58418,
+58432,
+58456,
+58468,
+58468,
+58489,
+58517,
+58517,
+58535,
+58561,
+58581,
+58618,
+58655,
+58655,
+58674,
+58680,
+58696,
+58701,
+58701,
+58701,
58717,
-58732,
-58739,
+58717,
+58727,
58739,
-58745,
-58752,
+58753,
+58762,
58762,
-58784,
-58811,
-58825,
+58762,
+58797,
+58809,
58832,
-58839,
-58863,
-58899,
-58905,
-58912,
+58847,
+58868,
+58868,
+58868,
+58880,
+58880,
+58880,
+58885,
+58885,
+58885,
+58885,
+58885,
+58885,
+58885,
58912,
-58912,
-58939,
-58939,
-58939,
-58960,
-58973,
-58973,
-58973,
-58973,
-58973,
-58980,
-58980,
-58987,
-58994,
-59012,
-59012,
-59019,
-59055,
-59110,
-59110,
-59110,
-59110,
-59135,
+58931,
+58931,
+58931,
+58951,
+58963,
+58985,
+58985,
+59003,
+59008,
+59017,
+59017,
+59027,
+59052,
+59058,
+59058,
+59058,
+59096,
+59130,
+59153,
59153,
59153,
-59180,
-59186,
-59196,
-59210,
-59236,
-59244,
-59244,
-59244,
-59276,
-59282,
-59300,
-59300,
-59342,
-59351,
-59372,
-59390,
-59402,
-59418,
-59444,
-59444,
-59444,
-59444,
-59482,
+59153,
+59153,
+59153,
+59153,
+59153,
+59162,
+59162,
+59162,
+59162,
+59179,
+59225,
+59242,
+59248,
+59270,
+59318,
+59323,
+59340,
+59346,
+59360,
+59366,
+59382,
+59416,
+59445,
+59471,
59495,
59495,
-59525,
-59545,
-59568,
-59578,
-59584,
-59584,
-59596,
-59596,
-59596,
-59596,
-59615,
-59625,
-59663,
-59663,
-59670,
-59711,
-59731,
-59731,
-59761,
-59782,
-59837,
-59837,
-59862,
-59904,
-59931,
-59931,
-59931,
-59931,
-59946,
-59958,
-59958,
-59958,
-59958,
-59958,
-59981,
-60003,
-60003,
-60003,
-60012,
-60012,
-60012,
-60039,
-60047,
-60088,
-60116,
-60161,
-60195,
-60195,
-60227,
-60238,
-60256,
-60283,
-60292,
-60296,
-60301,
-60325,
-60325,
-60325,
-60335,
-60335,
-60368,
-60368,
-60368,
-60399,
-60440,
-60449,
-60470,
-60485,
-60499,
-60535,
-60535,
-60542,
-60550,
-60550,
-60562,
-60562,
-60569,
-60614,
-60614,
-60614,
-60634,
-60634,
-60648,
-60648,
-60648,
-60669,
-60669,
-60690,
-60698,
-60698,
-60723,
-60752,
-60772,
-60772,
-60772,
-60788,
-60788,
-60810,
-60821,
-60846,
-60869,
-60899,
-60916,
-60916,
-60916,
-60916,
-60925,
-60931,
-60931,
-60931,
-60931,
-60938,
-60972,
-60972,
-60972,
-60985,
-60985,
-61003,
-61003,
-61003,
-61003,
-61003,
-61003,
-61003,
-61003,
-61003,
-61031,
-61031,
-61044,
-61056,
-61072,
-61108,
-61146,
-61146,
-61146,
-61146,
-61207,
-61231,
-61231,
-61250,
-61257,
-61257,
-61288,
-61288,
-61322,
-61322,
-61338,
-61338,
-61343,
-61352,
-61352,
-61373,
+59513,
+59513,
+59541,
+59547,
+59553,
+59559,
+59583,
+59595,
+59607,
+59631,
+59631,
+59643,
+59649,
+59661,
+59714,
+59737,
+59737,
+59758,
+59758,
+59775,
+59784,
+59796,
+59815,
+59821,
+59821,
+59849,
+59856,
+59868,
+59881,
+59900,
+59907,
+59928,
+59940,
+59940,
+59955,
+59955,
+60014,
+60014,
+60045,
+60057,
+60057,
+60063,
+60075,
+60075,
+60079,
+60079,
+60096,
+60111,
+60111,
+60111,
+60156,
+60171,
+60183,
+60197,
+60223,
+60223,
+60229,
+60253,
+60259,
+60259,
+60274,
+60315,
+60342,
+60342,
+60386,
+60396,
+60406,
+60406,
+60433,
+60433,
+60433,
+60457,
+60474,
+60474,
+60492,
+60502,
+60508,
+60508,
+60514,
+60527,
+60545,
+60551,
+60588,
+60621,
+60645,
+60645,
+60663,
+60685,
+60711,
+60758,
+60758,
+60769,
+60781,
+60823,
+60842,
+60842,
+60842,
+60848,
+60848,
+60860,
+60866,
+60880,
+60880,
+60880,
+60898,
+60949,
+60975,
+60975,
+60997,
+60997,
+61059,
+61083,
+61083,
+61107,
+61107,
+61113,
+61117,
+61123,
+61140,
+61152,
+61174,
+61183,
+61183,
+61183,
+61235,
+61262,
+61268,
+61268,
+61268,
+61276,
+61289,
+61297,
+61297,
+61312,
+61327,
+61336,
+61350,
+61375,
61383,
-61389,
-61436,
-61443,
-61449,
-61503,
-61520,
-61520,
-61520,
-61520,
-61532,
-61544,
-61557,
-61557,
-61557,
-61557,
-61563,
-61563,
-61591,
-61610,
-61631,
-61631,
-61631,
-61651,
-61659,
-61691,
-61726,
-61744,
-61744,
-61748,
-61758,
-61794,
-61829,
-61836,
-61856,
-61856,
-61864,
-61897,
-61924,
-61924,
-61924,
-61924,
-61924,
+61409,
+61422,
+61422,
+61457,
+61497,
+61497,
+61554,
+61594,
+61606,
+61606,
+61624,
+61624,
+61624,
+61633,
+61633,
+61658,
+61674,
+61682,
+61682,
+61696,
+61696,
+61696,
+61696,
+61706,
+61747,
+61768,
+61768,
+61768,
+61777,
+61777,
+61777,
+61781,
+61787,
+61800,
+61815,
+61820,
+61826,
+61834,
+61865,
+61871,
+61876,
+61889,
+61912,
+61912,
+61912,
+61918,
+61918,
61946,
-61946,
-61962,
-61977,
-62005,
+61985,
+61985,
+61985,
+62004,
62015,
62015,
-62033,
-62033,
-62033,
-62065,
-62075,
-62075,
+62029,
+62044,
+62050,
+62064,
+62064,
62087,
-62104,
-62104,
-62104,
-62104,
-62138,
-62138,
-62165,
-62165,
-62193,
-62220,
-62235,
-62235,
-62255,
-62262,
-62269,
-62269,
-62269,
-62269,
-62269,
-62282,
-62282,
-62291,
-62307,
-62307,
-62307,
-62316,
-62316,
-62333,
-62333,
-62344,
-62370,
-62392,
-62392,
-62392,
-62396,
-62411,
-62411,
-62411,
-62418,
-62422,
-62463,
-62463,
-62486,
-62500,
-62504,
-62512,
-62512,
-62522,
-62539,
-62544,
-62557,
-62567,
-62567,
-62567,
-62571,
-62571,
-62571,
-62575,
-62575,
-62575,
-62575,
-62591,
-62591,
-62632,
-62638,
-62638,
-62638,
-62648,
-62675,
-62675,
-62675,
-62675,
-62696,
-62696,
-62715,
-62715,
-62732,
-62745,
-62801,
-62828,
+62099,
+62099,
+62110,
+62116,
+62129,
+62142,
+62167,
+62179,
+62191,
+62212,
+62218,
+62218,
+62256,
+62256,
+62283,
+62304,
+62304,
+62329,
+62329,
+62351,
+62351,
+62351,
+62351,
+62368,
+62368,
+62386,
+62404,
+62442,
+62449,
+62449,
+62449,
+62469,
+62473,
+62488,
+62488,
+62502,
+62530,
+62549,
+62569,
+62569,
+62569,
+62600,
+62600,
+62609,
+62622,
+62639,
+62639,
+62639,
+62657,
+62657,
+62681,
+62681,
+62681,
+62688,
+62716,
+62716,
+62724,
+62724,
+62735,
+62743,
+62757,
+62769,
+62789,
+62809,
+62809,
+62815,
+62836,
62853,
62853,
62863,
62863,
-62879,
-62884,
-62884,
-62893,
-62929,
-62949,
-62949,
-62961,
-62980,
-62998,
-63007,
-63017,
-63027,
-63034,
-63034,
-63050,
-63050,
-63050,
-63050,
-63088,
-63111,
-63111,
-63111,
-63111,
-63111,
-63111,
-63111,
+62863,
+62863,
+62863,
+62872,
+62885,
+62885,
+62914,
+62914,
+62914,
+62952,
+62952,
+62964,
+63000,
+63000,
+63000,
+63010,
+63016,
+63016,
+63016,
+63032,
+63039,
+63049,
+63063,
+63063,
+63099,
63111,
-63142,
-63155,
-63155,
-63165,
-63165,
-63165,
-63172,
-63172,
-63172,
-63172,
-63172,
-63172,
-63172,
-63191,
-63191,
-63201,
-63221,
-63230,
-63230,
-63230,
-63230,
-63249,
-63254,
-63254,
-63266,
-63266,
-63287,
-63287,
-63313,
-63327,
-63327,
-63327,
-63327,
-63346,
-63377,
-63377,
-63377,
-63392,
-63392,
-63392,
-63392,
-63392,
-63412,
-63412,
-63431,
-63437,
-63437,
-63464,
-63473,
-63479,
-63494,
-63509,
-63509,
-63520,
-63520,
-63520,
-63520,
-63520,
-63547,
-63547,
-63547,
+63119,
+63125,
+63145,
+63176,
+63188,
+63225,
+63231,
+63244,
+63244,
+63255,
+63255,
+63273,
+63273,
+63285,
+63285,
+63338,
+63352,
+63399,
+63399,
+63423,
+63423,
+63435,
+63449,
+63449,
+63457,
+63491,
+63491,
+63518,
+63518,
63547,
-63547,
-63582,
-63614,
-63632,
-63632,
-63640,
-63640,
-63664,
-63664,
-63664,
+63565,
+63576,
+63594,
+63594,
+63594,
+63594,
+63600,
+63600,
+63616,
+63616,
+63642,
+63671,
+63671,
+63671,
+63677,
63677,
-63690,
-63690,
-63713,
-63738,
-63738,
-63771,
-63788,
-63788,
-63811,
-63811,
-63818,
-63818,
-63818,
-63818,
-63830,
-63852,
-63863,
-63863,
-63883,
-63883,
-63887,
-63887,
-63920,
-63931,
-63956,
-63956,
-63956,
-63975,
-64026,
-64030,
-64067,
-64067,
-64067,
-64080,
-64080,
-64097,
-64124,
-64124,
-64139,
-64139,
-64139,
-64139,
-64148,
-64148,
-64148,
-64148,
-64173,
-64193,
-64200,
-64217,
-64231,
-64235,
-64241,
-64241,
-64279,
-64313,
-64332,
-64345,
-64368,
-64424,
-64430,
-64448,
-64479,
+63691,
+63706,
+63720,
+63733,
+63755,
+63762,
+63779,
+63779,
+63795,
+63795,
+63795,
+63847,
+63879,
+63905,
+63921,
+63927,
+63965,
+63986,
+63986,
+64007,
+64007,
+64052,
+64052,
+64066,
+64079,
+64079,
+64134,
+64134,
+64140,
+64150,
+64150,
+64167,
+64192,
+64192,
+64192,
+64208,
+64224,
+64232,
+64243,
+64243,
+64278,
+64295,
+64314,
+64314,
+64314,
+64314,
+64314,
+64314,
+64314,
+64331,
+64360,
+64377,
+64395,
+64395,
+64395,
+64420,
+64463,
+64470,
+64486,
64496,
-64514,
-64574,
-64574,
-64595,
-64599,
-64618,
-64643,
-64657,
-64672,
-64691,
-64691,
-64691,
-64691,
-64728,
-64742,
-64760,
-64760,
-64787,
-64819,
-64819,
-64837,
-64844,
-64860,
-64874,
-64885,
-64885,
-64891,
-64901,
-64953,
-64953,
-64953,
-64967,
-64997,
-64997,
-64997,
-65020,
-65027,
-65044,
-65051,
-65062,
-65078,
-65099,
-65099,
-65099,
-65126,
-65133,
-65162,
+64509,
+64509,
+64519,
+64531,
+64548,
+64570,
+64597,
+64631,
+64631,
+64661,
+64671,
+64710,
+64710,
+64710,
+64751,
+64751,
+64761,
+64772,
+64772,
+64772,
+64772,
+64772,
+64792,
+64834,
+64846,
+64846,
+64862,
+64881,
+64893,
+64893,
+64911,
+64920,
+64937,
+64937,
+64954,
+64954,
+64954,
+64970,
+64970,
+64980,
+64980,
+64980,
+65004,
+65013,
+65013,
+65022,
+65022,
+65022,
+65047,
+65047,
+65054,
+65054,
+65061,
+65061,
+65061,
+65069,
+65081,
+65127,
+65136,
+65158,
+65158,
+65158,
+65188,
+65188,
+65188,
65209,
-65217,
-65234,
-65265,
-65265,
-65265,
-65285,
-65285,
-65291,
-65291,
-65291,
-65308,
-65328,
-65335,
-65341,
-65353,
-65366,
+65227,
+65227,
+65227,
+65242,
+65246,
+65263,
+65289,
+65297,
+65314,
+65314,
+65347,
+65347,
+65347,
+65390,
65390,
-65408,
-65418,
-65429,
-65440,
-65440,
-65457,
-65466,
-65496,
-65502,
-65508,
-65508,
+65405,
+65412,
+65432,
+65432,
+65445,
+65445,
+65460,
+65460,
+65497,
+65497,
+65497,
+65497,
65517,
-65535,
-65554,
-65558,
-65564,
-65564,
-65570,
-65581,
-65607,
-65627,
-65635,
-65635,
-65635,
-65635,
+65526,
+65526,
+65547,
+65547,
+65553,
+65553,
+65569,
+65576,
+65576,
+65576,
+65586,
+65586,
+65586,
+65586,
+65603,
+65628,
+65628,
65647,
-65685,
-65693,
-65712,
-65729,
-65729,
-65734,
-65734,
-65734,
-65755,
-65776,
-65776,
-65793,
-65808,
-65828,
-65842,
-65878,
-65891,
-65891,
-65891,
-65982,
-65989,
-66003,
-66003,
-66003,
-66023,
-66057,
-66088,
-66101,
-66132,
-66139,
-66146,
-66146,
-66159,
-66159,
-66182,
-66182,
-66182,
-66189,
-66217,
-66259,
-66271,
-66271,
-66285,
-66297,
-66332,
-66349,
-66349,
-66364,
-66364,
-66421,
-66449,
-66463,
-66503,
-66535,
-66548,
-66555,
-66555,
-66570,
-66570,
-66580,
-66580,
-66587,
-66587,
-66587,
-66603,
-66631,
-66631,
-66650,
-66650,
-66675,
-66695,
-66702,
-66702,
-66702,
-66702,
-66709,
-66709,
-66739,
-66755,
-66762,
-66762,
-66775,
-66805,
-66823,
-66835,
-66841,
-66841,
-66841,
-66841,
-66841,
-66841,
+65647,
+65667,
+65677,
+65695,
+65704,
+65715,
+65715,
+65743,
+65743,
+65782,
+65802,
+65809,
+65818,
+65837,
+65837,
+65852,
+65856,
+65871,
+65875,
+65918,
+65918,
+65918,
+65944,
+65944,
+65951,
+65958,
+65980,
+65980,
+66007,
+66007,
+66007,
+66036,
+66059,
+66059,
+66059,
+66082,
+66082,
+66082,
+66082,
+66121,
+66121,
+66128,
+66128,
+66168,
+66168,
+66188,
+66203,
+66218,
+66251,
+66251,
+66270,
+66270,
+66270,
+66270,
+66296,
+66301,
+66328,
+66361,
+66387,
+66387,
+66416,
+66434,
+66448,
+66448,
+66448,
+66467,
+66467,
+66476,
+66476,
+66476,
+66493,
+66505,
+66505,
+66505,
+66513,
+66513,
+66513,
+66513,
+66528,
+66549,
+66549,
+66549,
+66566,
+66571,
+66593,
+66623,
+66623,
+66623,
+66623,
+66623,
+66623,
+66623,
+66623,
+66623,
+66646,
+66657,
+66681,
+66697,
+66727,
+66747,
+66754,
+66773,
+66795,
+66821,
+66833,
+66840,
+66861,
66861,
-66907,
-66907,
-66907,
-66907,
-66907,
-66922,
-66940,
-66940,
-66940,
-66940,
-66975,
-66975,
-66975,
-67002,
-67016,
-67032,
-67032,
-67039,
-67069,
-67075,
-67086,
-67119,
-67146,
-67146,
-67151,
-67167,
-67197,
-67197,
-67214,
-67214,
+66861,
+66861,
+66861,
+66874,
+66874,
+66874,
+66880,
+66880,
+66880,
+66890,
+66903,
+66903,
+66918,
+66946,
+67028,
+67028,
+67035,
+67050,
+67050,
+67062,
+67077,
+67077,
+67091,
+67091,
+67108,
+67108,
+67136,
+67136,
+67136,
+67152,
+67173,
+67202,
67221,
-67236,
-67236,
-67249,
-67265,
-67279,
-67306,
-67313,
-67336,
+67245,
+67245,
+67251,
+67260,
+67277,
+67277,
+67277,
+67277,
+67284,
+67311,
+67311,
+67311,
+67332,
+67332,
+67332,
67353,
-67404,
-67420,
-67420,
-67420,
-67420,
-67420,
-67420,
-67429,
-67429,
-67446,
+67395,
+67421,
+67421,
67446,
-67462,
-67462,
-67473,
-67480,
-67490,
-67511,
-67511,
-67568,
-67605,
-67639,
-67646,
-67682,
-67689,
-67696,
-67702,
-67720,
-67744,
-67763,
-67763,
+67497,
+67519,
+67524,
+67549,
+67549,
+67565,
+67575,
+67593,
+67607,
+67612,
+67612,
+67612,
+67625,
+67675,
+67685,
+67694,
+67705,
+67705,
+67705,
+67725,
+67725,
+67772,
67782,
-67806,
-67806,
-67806,
-67810,
-67817,
-67817,
+67782,
+67782,
+67782,
+67782,
+67811,
+67827,
67827,
-67840,
-67840,
-67840,
-67840,
-67840,
-67847,
-67867,
-67874,
-67874,
-67886,
-67886,
-67920,
-67927,
-67932,
-67960,
-67967,
-67974,
-67992,
-67992,
-68004,
-68004,
-68031,
-68031,
-68063,
-68088,
-68095,
-68112,
-68112,
-68112,
-68127,
-68135,
-68146,
-68176,
-68193,
-68200,
-68221,
-68228,
-68245,
-68245,
-68280,
-68280,
-68320,
-68345,
-68352,
-68383,
-68425,
-68445,
-68445,
-68452,
-68479,
-68503,
-68510,
-68517,
-68576,
-68583,
-68628,
-68642,
-68646,
-68662,
-68701,
-68717,
-68724,
-68724,
-68733,
-68740,
-68756,
-68777,
-68777,
-68777,
-68777,
-68791,
-68803,
-68803,
-68825,
-68843,
-68857,
-68879,
-68907,
-68907,
-68907,
-68919,
-68959,
-68994,
-69006,
-69023,
-69023,
-69040,
-69055,
-69055,
-69076,
-69102,
-69102,
-69140,
-69149,
-69165,
-69183,
-69221,
-69228,
-69235,
-69256,
-69256,
-69256,
-69268,
-69292,
-69326,
-69363,
-69380,
-69380,
-69380,
-69380,
-69405,
-69417,
-69445,
-69445,
-69464,
-69464,
-69464,
-69464,
-69464,
-69480,
-69508,
-69544,
-69544,
-69557,
-69557,
-69557,
+67827,
+67835,
+67852,
+67857,
+67900,
+67900,
+67900,
+67904,
+67904,
+67904,
+67904,
+67921,
+67941,
+67952,
+67952,
+67969,
+67969,
+67969,
+67983,
+67983,
+68008,
+68008,
+68016,
+68035,
+68035,
+68035,
+68035,
+68035,
+68056,
+68076,
+68083,
+68104,
+68104,
+68104,
+68104,
+68122,
+68143,
+68167,
+68185,
+68185,
+68185,
+68202,
+68229,
+68238,
+68251,
+68274,
+68295,
+68300,
+68300,
+68338,
+68370,
+68392,
+68416,
+68416,
+68416,
+68416,
+68436,
+68458,
+68485,
+68508,
+68542,
+68542,
+68549,
+68549,
+68549,
+68549,
+68555,
+68555,
+68563,
+68575,
+68587,
+68606,
+68606,
+68606,
+68606,
+68606,
+68611,
+68611,
+68611,
+68630,
+68636,
+68673,
+68673,
+68686,
+68686,
+68686,
+68697,
+68706,
+68716,
+68728,
+68749,
+68754,
+68779,
+68784,
+68784,
+68784,
+68784,
+68794,
+68794,
+68799,
+68813,
+68813,
+68840,
+68840,
+68858,
+68858,
+68858,
+68880,
+68880,
+68902,
+68908,
+68908,
+68908,
+68908,
+68908,
+68934,
+68934,
+68941,
+68968,
+68968,
+68984,
+68984,
+69000,
+69000,
+69000,
+69000,
+69000,
+69000,
+69000,
+69018,
+69045,
+69083,
+69083,
+69083,
+69083,
+69100,
+69104,
+69104,
+69104,
+69167,
+69167,
+69181,
+69192,
+69192,
+69192,
+69203,
+69203,
+69203,
+69203,
+69203,
+69203,
+69203,
+69203,
+69203,
+69208,
+69230,
+69242,
+69242,
+69249,
+69249,
+69249,
+69249,
+69259,
+69266,
+69266,
+69266,
+69331,
+69331,
+69331,
+69358,
+69369,
+69408,
+69414,
+69433,
+69433,
+69441,
+69456,
+69482,
+69482,
+69492,
+69527,
+69536,
+69549,
+69549,
+69566,
+69566,
+69570,
+69570,
69587,
-69607,
-69628,
-69655,
-69725,
-69749,
-69760,
-69796,
-69803,
-69847,
-69872,
-69872,
-69893,
-69893,
-69893,
-69893,
-69893,
-69902,
-69926,
-69941,
-69948,
+69592,
+69592,
+69635,
+69642,
+69642,
+69654,
+69654,
+69654,
+69670,
+69677,
+69689,
+69689,
+69689,
+69705,
+69724,
+69724,
+69744,
+69750,
+69762,
+69779,
+69798,
+69806,
+69806,
+69814,
+69814,
+69844,
+69858,
+69868,
+69877,
+69911,
+69925,
+69925,
69948,
-69965,
-69979,
-69986,
-69993,
-70000,
-70005,
+69955,
+69964,
+69987,
+70016,
70030,
-70050,
+70030,
+70047,
+70052,
+70052,
+70052,
+70052,
70057,
-70064,
-70091,
-70117,
-70163,
-70163,
+70070,
+70070,
+70070,
+70070,
+70083,
+70089,
+70089,
+70099,
+70111,
+70125,
+70140,
+70140,
+70144,
+70144,
+70144,
70170,
-70180,
-70211,
-70218,
-70264,
-70264,
-70278,
-70285,
-70285,
-70332,
-70332,
-70337,
-70337,
-70337,
-70361,
-70368,
-70385,
-70392,
-70410,
-70429,
-70435,
+70176,
+70188,
+70200,
+70200,
+70215,
+70233,
+70233,
+70238,
+70270,
+70292,
+70302,
+70302,
+70320,
+70320,
+70328,
+70362,
+70362,
+70379,
70435,
-70435,
-70435,
-70442,
-70442,
-70456,
-70485,
-70503,
-70512,
-70521,
+70445,
+70476,
+70483,
+70483,
+70483,
+70494,
70521,
-70525,
-70525,
-70563,
-70575,
-70586,
-70586,
-70586,
-70603,
-70609,
-70640,
-70656,
-70664,
-70664,
-70670,
-70685,
-70692,
-70710,
-70731,
-70750,
-70767,
-70785,
+70533,
+70533,
+70533,
+70533,
+70544,
+70544,
+70582,
+70598,
+70615,
+70615,
+70636,
+70684,
+70684,
+70704,
+70704,
+70704,
+70716,
+70744,
+70772,
+70772,
70816,
-70823,
-70839,
-70839,
-70853,
-70853,
-70853,
-70871,
-70889,
-70889,
-70889,
+70831,
+70831,
+70865,
+70865,
+70876,
+70892,
70907,
-70916,
-70955,
-70955,
-70970,
-70970,
-70990,
-70998,
-70998,
-70998,
-71024,
-71045,
-71051,
-71058,
-71058,
-71058,
-71058,
-71058,
-71058,
-71058,
-71074,
-71096,
-71096,
-71105,
-71105,
-71112,
-71112,
-71119,
-71135,
-71135,
-71152,
-71152,
-71152,
-71152,
-71170,
-71177,
-71199,
-71199,
-71199,
-71210,
-71210,
-71238,
-71238,
-71238,
-71238,
-71243,
-71243,
-71243,
-71261,
-71288,
-71302,
-71318,
-71361,
-71361,
-71361,
-71389,
-71389,
-71389,
-71410,
-71422,
-71439,
-71439,
-71439,
-71439,
-71439,
-71449,
-71449,
-71449,
-71469,
-71483,
-71490,
-71490,
-71494,
-71506,
-71544,
-71544,
-71571,
-71580,
-71580,
-71580,
-71580,
-71593,
-71611,
-71626,
-71626,
-71640,
-71653,
-71653,
-71653,
-71665,
-71684,
+70925,
+70925,
+70925,
+70934,
+70934,
+70934,
+70973,
+71002,
+71044,
+71044,
+71044,
+71044,
+71056,
+71073,
+71073,
+71097,
+71097,
+71108,
+71108,
+71113,
+71113,
+71132,
+71146,
+71146,
+71153,
+71160,
+71160,
+71179,
+71198,
+71212,
+71223,
+71230,
+71230,
+71244,
+71274,
+71286,
+71286,
+71304,
+71304,
+71304,
+71320,
+71320,
+71325,
+71325,
+71325,
+71359,
+71388,
+71388,
+71411,
+71416,
+71416,
+71438,
+71464,
+71464,
+71464,
+71471,
+71485,
+71505,
+71519,
+71526,
+71541,
+71563,
+71563,
+71583,
+71605,
+71612,
+71631,
+71663,
+71682,
+71682,
71700,
-71729,
-71729,
-71729,
-71729,
-71741,
-71741,
-71748,
-71809,
-71818,
-71818,
-71836,
-71876,
-71926,
-71946,
-71946,
-71946,
-71946,
-71946,
-71971,
-71984,
-71984,
-71994,
-72010,
-72010,
-72010,
-72010,
-72010,
-72010,
-72035,
-72079,
-72079,
-72102,
-72129,
-72138,
-72151,
-72151,
-72151,
-72151,
-72162,
-72162,
-72166,
-72166,
-72166,
-72175,
-72175,
-72175,
-72191,
-72191,
-72191,
-72191,
-72191,
-72191,
-72242,
-72242,
-72242,
-72248,
-72264,
-72282,
-72290,
-72308,
-72324,
-72345,
-72345,
-72345,
-72345,
-72351,
-72370,
-72370,
-72401,
-72401,
-72407,
-72407,
-72407,
-72407,
-72435,
-72453,
-72453,
-72453,
-72468,
-72486,
-72506,
-72512,
-72512,
-72537,
-72537,
-72556,
-72567,
-72579,
-72601,
-72613,
-72619,
-72625,
-72625,
-72631,
-72637,
-72667,
-72680,
-72692,
-72692,
-72692,
-72710,
-72720,
-72720,
-72733,
-72733,
-72741,
-72741,
-72752,
-72765,
-72771,
-72771,
-72771,
-72771,
-72785,
-72785,
-72807,
-72807,
-72827,
-72834,
-72843,
-72878,
-72878,
-72892,
-72901,
-72901,
+71714,
+71721,
+71721,
+71749,
+71774,
+71783,
+71790,
+71797,
+71804,
+71830,
+71830,
+71863,
+71882,
+71882,
+71882,
+71917,
+71924,
+71944,
+71985,
+71985,
+71985,
+71985,
+72004,
+72023,
+72037,
+72037,
+72049,
+72090,
+72119,
+72152,
+72152,
+72152,
+72152,
+72177,
+72194,
+72229,
+72229,
+72229,
+72246,
+72253,
+72279,
+72286,
+72291,
+72319,
+72332,
+72339,
+72339,
+72372,
+72379,
+72417,
+72417,
+72442,
+72442,
+72457,
+72466,
+72498,
+72505,
+72529,
+72538,
+72538,
+72555,
+72584,
+72584,
+72603,
+72603,
+72603,
+72635,
+72635,
+72635,
+72635,
+72635,
+72635,
+72652,
+72652,
+72652,
+72652,
+72682,
+72689,
+72696,
+72696,
+72725,
+72732,
+72732,
+72781,
+72781,
+72813,
+72820,
+72847,
+72854,
+72867,
+72867,
+72894,
72901,
-72906,
-72916,
-72916,
-72916,
-72927,
-72927,
-72927,
-72927,
-72963,
-72963,
-72963,
-72963,
-72963,
-72963,
-72985,
-73029,
-73044,
-73064,
-73064,
-73064,
-73064,
-73064,
-73064,
-73073,
-73073,
-73093,
-73120,
-73126,
-73144,
-73144,
-73159,
-73159,
-73165,
-73165,
-73203,
-73213,
-73238,
-73258,
-73273,
-73273,
-73273,
-73273,
-73273,
-73287,
-73303,
-73335,
-73359,
-73365,
-73387,
-73402,
-73402,
-73402,
-73413,
-73413,
-73413,
-73423,
-73442,
-73468,
-73485,
-73485,
-73503,
-73537,
-73575,
-73575,
-73610,
-73629,
-73635,
-73635,
-73635,
-73635,
-73658,
-73658,
-73681,
-73687,
-73687,
-73712,
-73736,
-73753,
-73780,
-73797,
-73816,
-73838,
-73850,
-73850,
-73863,
-73909,
-73918,
-73930,
-73946,
-73976,
-73986,
-73986,
-73986,
-73986,
-73990,
-74017,
-74017,
-74017,
-74025,
-74025,
-74025,
-74025,
-74055,
-74073,
-74073,
-74073,
-74084,
+72918,
+72953,
+72953,
+72995,
+73002,
+73002,
+73014,
+73014,
+73014,
+73048,
+73103,
+73135,
+73142,
+73149,
+73160,
+73160,
+73169,
+73169,
+73169,
+73200,
+73208,
+73262,
+73285,
+73296,
+73309,
+73317,
+73331,
+73331,
+73338,
+73354,
+73354,
+73379,
+73401,
+73421,
+73428,
+73435,
+73469,
+73487,
+73494,
+73494,
+73494,
+73494,
+73522,
+73522,
+73529,
+73545,
+73545,
+73551,
+73604,
+73612,
+73612,
+73619,
+73644,
+73655,
+73655,
+73655,
+73662,
+73684,
+73730,
+73745,
+73769,
+73769,
+73791,
+73798,
+73798,
+73805,
+73823,
+73830,
+73844,
+73844,
+73885,
+73902,
+73937,
+73961,
+73968,
+74012,
+74038,
+74038,
+74038,
+74054,
+74080,
74095,
-74095,
-74095,
-74123,
+74124,
74150,
-74150,
-74155,
-74155,
-74155,
-74155,
-74161,
-74170,
-74176,
-74193,
-74216,
-74224,
-74266,
-74266,
-74277,
-74277,
-74289,
-74289,
-74295,
-74330,
-74330,
-74342,
-74348,
-74383,
-74420,
-74420,
-74426,
-74426,
+74174,
+74181,
+74195,
+74202,
+74241,
+74241,
+74264,
+74284,
+74291,
+74298,
+74329,
+74349,
+74387,
+74408,
+74415,
+74422,
+74429,
+74429,
74451,
-74469,
-74483,
-74500,
-74500,
-74515,
-74520,
-74520,
-74537,
-74547,
+74458,
+74490,
+74490,
+74497,
+74504,
+74504,
+74511,
74547,
-74547,
-74558,
-74558,
-74571,
-74578,
-74590,
-74590,
-74603,
-74619,
-74628,
-74628,
-74634,
+74566,
+74566,
+74586,
+74586,
+74610,
74634,
74634,
-74655,
+74663,
74667,
74691,
-74702,
-74725,
-74725,
-74725,
-74725,
-74730,
-74730,
-74730,
-74730,
-74736,
-74758,
-74764,
-74764,
-74764,
-74764,
-74784,
-74803,
-74803,
-74832,
-74832,
+74691,
+74691,
+74706,
+74738,
+74738,
+74745,
+74745,
+74791,
+74791,
+74804,
+74823,
+74830,
+74856,
74856,
-74867,
-74867,
-74885,
-74890,
-74890,
-74910,
-74925,
-74925,
-74939,
-74939,
-74954,
-74963,
-74989,
-74996,
-74996,
-75013,
-75013,
-75013,
-75042,
-75059,
+74875,
+74882,
+74893,
+74902,
+74909,
+74916,
+74976,
+74976,
+74983,
+75010,
+75017,
+75029,
+75036,
+75043,
+75060,
75067,
-75108,
-75128,
-75136,
-75155,
-75160,
-75160,
-75173,
-75173,
-75173,
-75173,
-75179,
-75179,
-75190,
-75213,
-75217,
-75236,
-75236,
-75265,
-75265,
-75283,
-75294,
-75311,
-75311,
-75317,
-75317,
-75325,
-75345,
-75370,
-75370,
-75382,
-75382,
-75382,
-75411,
-75417,
-75434,
-75443,
-75449,
-75455,
-75478,
-75484,
-75517,
-75542,
-75548,
-75561,
-75561,
-75567,
-75573,
+75067,
+75067,
+75106,
+75113,
+75129,
+75129,
+75129,
+75129,
+75129,
+75149,
+75163,
+75195,
+75222,
+75259,
+75259,
+75259,
+75280,
+75280,
+75280,
+75301,
+75319,
+75360,
+75360,
+75367,
+75379,
+75379,
+75397,
+75428,
+75466,
+75486,
+75510,
+75536,
+75552,
75573,
-75579,
-75579,
-75593,
-75593,
-75593,
-75593,
-75599,
-75615,
-75651,
-75685,
-75692,
-75713,
-75719,
-75725,
-75737,
-75746,
-75750,
-75750,
-75761,
-75783,
-75789,
-75804,
-75814,
-75814,
-75814,
-75833,
-75833,
-75867,
-75867,
-75867,
-75867,
-75904,
-75909,
-75928,
-75928,
-75928,
-75928,
-75928,
-75945,
-75959,
-75973,
-75973,
-75995,
-76066,
-76066,
-76066,
-76082,
-76082,
-76082,
-76098,
-76109,
-76120,
-76120,
-76120,
-76129,
-76149,
-76170,
-76170,
-76170,
-76170,
-76170,
-76186,
-76199,
-76199,
-76199,
-76218,
-76235,
-76249,
-76261,
-76300,
-76305,
-76328,
-76342,
-76366,
-76366,
+75603,
+75620,
+75643,
+75659,
+75694,
+75694,
+75711,
+75718,
+75718,
+75718,
+75734,
+75741,
+75763,
+75805,
+75805,
+75823,
+75837,
+75844,
+75851,
+75858,
+75899,
+75906,
+75931,
+75958,
+75958,
+76002,
+76009,
+76009,
+76016,
+76023,
+76065,
+76092,
+76140,
+76140,
+76147,
+76177,
+76187,
+76187,
+76224,
+76224,
+76230,
+76265,
+76265,
+76291,
+76291,
+76316,
+76354,
+76361,
+76361,
+76375,
+76382,
+76399,
+76399,
76399,
-76413,
-76413,
-76413,
-76431,
-76437,
-76459,
-76459,
-76475,
-76475,
-76475,
-76475,
-76475,
-76475,
-76482,
-76493,
-76493,
-76501,
-76501,
-76515,
-76532,
-76532,
-76544,
-76544,
-76578,
-76603,
-76603,
-76612,
-76628,
-76644,
-76657,
+76425,
+76425,
+76425,
+76425,
+76435,
+76451,
+76451,
+76490,
+76490,
+76490,
+76506,
+76506,
+76506,
+76516,
+76516,
+76516,
+76540,
+76579,
+76579,
+76586,
+76599,
+76606,
+76606,
+76606,
+76641,
+76641,
76666,
-76705,
-76705,
-76730,
-76730,
-76740,
-76740,
-76757,
-76804,
-76816,
-76832,
-76832,
-76832,
-76832,
-76847,
-76864,
-76871,
-76881,
-76881,
-76917,
-76929,
-76929,
-76938,
-76938,
-76938,
-76938,
-76960,
-76979,
-77000,
-77041,
-77058,
-77058,
-77066,
-77084,
-77084,
-77084,
-77106,
-77122,
-77122,
-77122,
-77122,
-77143,
-77152,
-77152,
-77152,
-77158,
-77158,
-77158,
-77158,
-77158,
-77158,
-77171,
-77183,
-77183,
-77188,
-77188,
-77188,
-77188,
-77188,
-77204,
-77204,
+76676,
+76676,
+76676,
+76683,
+76683,
+76700,
+76700,
+76700,
+76700,
+76717,
+76717,
+76737,
+76737,
+76737,
+76737,
+76737,
+76737,
+76737,
+76737,
+76771,
+76771,
+76782,
+76789,
+76799,
+76828,
+76845,
+76845,
+76893,
+76893,
+76908,
+76930,
+76930,
+76973,
+76980,
+76980,
+76980,
+77005,
+77005,
+77020,
+77032,
+77051,
+77060,
+77086,
+77086,
+77086,
+77086,
+77150,
+77150,
+77167,
+77172,
+77172,
+77176,
+77176,
+77191,
+77191,
+77218,
+77218,
+77218,
+77218,
77227,
-77251,
-77251,
-77251,
-77270,
-77290,
-77290,
-77290,
-77290,
-77311,
-77327,
-77327,
-77341,
-77341,
-77358,
-77358,
-77358,
-77393,
-77393,
-77400,
-77407,
-77407,
-77436,
-77450,
-77464,
-77464,
-77492,
-77492,
-77508,
-77508,
-77533,
+77237,
+77253,
+77273,
+77294,
+77321,
+77337,
+77352,
+77380,
+77380,
+77404,
+77422,
+77422,
+77428,
+77428,
+77444,
+77485,
+77485,
+77499,
+77499,
+77520,
77545,
-77545,
-77556,
-77578,
-77593,
-77610,
-77620,
-77657,
-77657,
-77693,
-77693,
-77693,
-77693,
-77705,
-77705,
-77705,
-77718,
-77718,
-77734,
-77742,
-77742,
-77781,
-77789,
-77819,
-77830,
-77830,
-77830,
-77830,
-77830,
+77550,
+77560,
+77567,
+77596,
+77615,
+77615,
+77615,
+77653,
+77653,
+77653,
+77674,
+77674,
+77674,
+77686,
+77686,
+77706,
+77719,
+77719,
+77727,
+77736,
+77767,
+77773,
+77802,
+77821,
+77837,
77847,
77870,
-77870,
-77904,
-77904,
-77916,
-77916,
-77942,
-77958,
-77958,
-77958,
-77972,
-77972,
-77972,
-77988,
-77988,
-77994,
+77877,
+77877,
+77877,
+77877,
+77888,
+77903,
+77926,
+77946,
+77957,
+77961,
+77967,
+77967,
+77967,
+77983,
78017,
-78031,
-78044,
-78089,
+78035,
+78035,
+78035,
+78040,
+78040,
+78040,
+78050,
+78063,
78099,
-78129,
-78129,
-78129,
-78129,
-78135,
-78140,
-78155,
-78176,
-78214,
-78235,
-78243,
-78277,
-78277,
-78277,
-78285,
-78312,
-78312,
-78328,
-78339,
-78357,
-78373,
-78389,
-78389,
-78414,
-78432,
-78439,
-78455,
-78484,
-78492,
-78500,
+78104,
+78110,
+78110,
+78110,
+78138,
+78198,
+78218,
+78231,
+78295,
+78306,
+78335,
+78335,
+78364,
+78364,
+78364,
+78377,
+78417,
+78427,
+78427,
+78459,
+78459,
+78466,
+78466,
+78473,
+78499,
+78499,
+78509,
+78509,
78536,
-78556,
-78582,
-78582,
-78615,
-78624,
-78664,
-78664,
-78675,
-78675,
-78694,
-78694,
-78709,
-78715,
-78715,
-78724,
-78724,
-78733,
-78733,
-78766,
-78766,
-78780,
-78791,
-78812,
-78812,
-78812,
-78821,
-78865,
-78865,
-78865,
-78865,
-78890,
-78890,
-78890,
-78890,
-78911,
-78911,
-78911,
-78933,
-78943,
-78943,
-78943,
-78943,
-78943,
-78978,
-78986,
-78986,
+78587,
+78609,
+78609,
+78616,
+78616,
+78640,
+78653,
+78653,
+78653,
+78653,
+78660,
+78679,
+78689,
+78703,
+78703,
+78728,
+78741,
+78756,
+78765,
+78783,
+78814,
+78839,
+78839,
+78839,
+78839,
+78849,
+78854,
+78864,
+78894,
+78894,
+78914,
+78914,
+78914,
+78932,
+78932,
+78971,
+78989,
+78989,
+78989,
78997,
-79027,
-79047,
-79047,
-79078,
-79078,
-79093,
-79093,
-79093,
-79093,
+78997,
+78997,
+78997,
+78997,
+78997,
+78997,
+78997,
+79009,
+79009,
+79033,
+79033,
+79049,
+79049,
+79049,
+79049,
+79061,
+79066,
+79081,
+79086,
79093,
-79131,
-79131,
-79152,
-79152,
-79152,
-79180,
-79180,
-79180,
-79180,
-79202,
-79202,
-79202,
-79221,
-79221,
-79227,
-79233,
-79241,
-79260,
-79260,
-79260,
-79266,
-79274,
+79098,
+79098,
+79098,
+79124,
+79124,
+79124,
+79134,
+79150,
+79163,
+79163,
+79163,
+79193,
+79209,
+79218,
+79224,
+79235,
+79235,
+79247,
+79247,
+79247,
+79247,
+79247,
+79253,
79274,
-79288,
-79303,
-79319,
-79351,
-79374,
-79374,
-79380,
-79390,
-79390,
-79390,
-79396,
-79416,
-79416,
-79426,
-79426,
-79426,
-79443,
-79453,
-79453,
-79472,
-79503,
-79503,
-79508,
-79514,
-79530,
-79540,
-79540,
-79548,
-79563,
-79584,
-79636,
-79645,
-79675,
-79682,
-79682,
-79715,
-79725,
-79754,
-79754,
-79774,
-79793,
-79793,
-79816,
-79816,
-79816,
-79831,
-79831,
-79850,
-79867,
-79867,
-79867,
-79867,
-79875,
-79896,
-79896,
-79896,
-79896,
-79922,
-79922,
-79922,
-79934,
-79934,
-79947,
-79964,
-79964,
-80000,
-80014,
-80014,
-80025,
-80025,
-80037,
-80071,
-80105,
-80105,
-80111,
-80161,
-80171,
-80181,
-80197,
-80217,
-80227,
-80227,
-80227,
-80252,
-80264,
-80276,
-80293,
-80293,
-80293,
-80293,
-80293,
-80333,
+79289,
+79289,
+79320,
+79320,
+79320,
+79337,
+79337,
+79354,
+79360,
+79388,
+79400,
+79400,
+79436,
+79436,
+79444,
+79460,
+79483,
+79483,
+79517,
+79517,
+79535,
+79543,
+79543,
+79543,
+79543,
+79562,
+79562,
+79562,
+79591,
+79591,
+79607,
+79617,
+79617,
+79626,
+79641,
+79641,
+79662,
+79662,
+79678,
+79678,
+79704,
+79717,
+79738,
+79738,
+79756,
+79756,
+79763,
+79770,
+79791,
+79791,
+79798,
+79798,
+79798,
+79815,
+79815,
+79876,
+79876,
+79876,
+79894,
+79919,
+79924,
+79943,
+79943,
+79958,
+79958,
+79979,
+79979,
+79996,
+79996,
+79996,
+79996,
+79996,
+79996,
+80004,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80023,
+80049,
+80060,
+80060,
+80060,
+80091,
+80091,
+80091,
+80098,
+80123,
+80123,
+80123,
+80163,
+80163,
+80199,
+80199,
+80199,
+80199,
+80199,
+80225,
+80225,
+80240,
+80240,
+80240,
+80268,
+80287,
+80287,
+80298,
+80298,
80339,
-80353,
-80380,
-80421,
-80484,
-80484,
-80484,
-80498,
-80543,
-80543,
-80569,
-80569,
-80578,
-80578,
-80595,
-80616,
-80616,
-80623,
-80631,
-80631,
-80631,
-80649,
-80649,
-80649,
-80649,
-80659,
-80686,
-80703,
-80710,
-80726,
-80741,
-80741,
-80764,
-80764,
-80764,
-80783,
-80799,
-80799,
-80799,
-80833,
-80833,
-80872,
-80872,
-80872,
-80899,
-80916,
-80916,
-80937,
-80937,
-80937,
-80937,
-80937,
-80947,
-80947,
-80965,
-80965,
-80977,
-80977,
-80986,
-80986,
-80986,
-81006,
-81013,
-81013,
-81023,
-81048,
-81066,
-81066,
-81097,
-81107,
+80387,
+80402,
+80411,
+80422,
+80422,
+80434,
+80458,
+80466,
+80471,
+80481,
+80527,
+80565,
+80571,
+80606,
+80606,
+80618,
+80618,
+80655,
+80669,
+80677,
+80677,
+80723,
+80735,
+80735,
+80757,
+80757,
+80770,
+80800,
+80810,
+80810,
+80810,
+80820,
+80843,
+80843,
+80843,
+80879,
+80879,
+80879,
+80919,
+80919,
+80928,
+80956,
+80973,
+80973,
+80990,
+80990,
+80990,
+80990,
+81000,
+81000,
+81010,
+81028,
+81028,
+81028,
+81028,
+81034,
+81034,
+81034,
+81034,
+81034,
+81034,
+81034,
+81050,
+81070,
+81070,
81118,
-81118,
-81118,
-81140,
-81175,
-81187,
-81187,
-81187,
-81192,
-81192,
-81192,
-81212,
-81240,
-81240,
-81298,
-81298,
-81298,
-81298,
-81310,
-81316,
-81316,
+81135,
+81135,
+81145,
+81158,
+81158,
+81195,
+81222,
+81233,
+81271,
+81284,
+81319,
81327,
-81335,
-81335,
-81342,
-81359,
-81359,
-81359,
-81359,
-81370,
-81370,
-81370,
-81381,
-81395,
-81405,
-81413,
-81447,
-81447,
-81460,
-81460,
+81327,
+81345,
+81345,
+81345,
+81358,
+81392,
+81392,
+81422,
+81437,
+81471,
81471,
81471,
-81476,
-81495,
-81510,
-81510,
-81526,
-81526,
-81553,
-81571,
-81587,
-81587,
-81592,
-81611,
-81638,
-81638,
-81664,
-81690,
-81696,
-81696,
-81696,
-81721,
-81721,
-81739,
-81739,
-81739,
-81749,
-81766,
-81773,
-81773,
-81773,
-81791,
-81791,
+81471,
+81471,
+81471,
+81494,
+81494,
+81494,
+81494,
+81494,
+81494,
+81521,
+81536,
+81564,
+81564,
+81591,
+81591,
+81612,
+81623,
+81654,
+81654,
+81654,
+81673,
+81673,
+81673,
+81673,
+81716,
+81716,
+81728,
+81757,
+81757,
+81757,
+81757,
+81757,
+81767,
+81784,
+81784,
+81784,
+81803,
81815,
-81839,
-81846,
-81855,
-81855,
-81855,
-81879,
-81903,
-81915,
-81939,
-81939,
-81965,
-81985,
-82004,
-82004,
-82021,
-82037,
-82082,
-82082,
-82115,
-82154,
-82161,
-82169,
-82169,
-82207,
-82223,
-82233,
-82233,
-82233,
-82233,
-82249,
-82249,
-82249,
-82264,
-82270,
-82283,
-82309,
-82340,
-82353,
-82380,
-82380,
-82400,
-82425,
-82456,
-82462,
-82462,
-82481,
-82481,
-82499,
-82499,
-82499,
-82499,
-82499,
-82499,
-82499,
-82512,
-82547,
-82564,
-82607,
-82607,
-82607,
-82620,
-82629,
-82629,
-82629,
-82640,
-82640,
-82664,
-82664,
-82664,
-82664,
-82664,
-82674,
-82689,
-82689,
-82689,
-82689,
-82703,
+81836,
+81836,
+81865,
+81920,
+81929,
+81945,
+81945,
+81945,
+81945,
+81966,
+81966,
+81987,
+81992,
+82010,
+82019,
+82019,
+82088,
+82088,
+82088,
+82123,
+82123,
+82123,
+82134,
+82144,
+82144,
+82164,
+82179,
+82197,
+82248,
+82266,
+82266,
+82266,
+82301,
+82318,
+82352,
+82378,
+82378,
+82384,
+82384,
+82384,
+82402,
+82410,
+82410,
+82426,
+82426,
+82426,
+82426,
+82426,
+82437,
+82471,
+82489,
+82489,
+82515,
+82523,
+82544,
+82544,
+82544,
+82544,
+82544,
+82559,
+82559,
+82576,
+82591,
+82624,
+82634,
+82650,
+82650,
+82668,
+82668,
+82675,
82703,
82703,
82719,
-82724,
-82741,
-82750,
-82750,
-82757,
-82809,
-82821,
-82821,
-82821,
-82821,
-82833,
+82730,
+82755,
+82755,
+82755,
+82755,
+82755,
+82755,
+82755,
+82765,
+82765,
+82776,
+82791,
+82807,
82833,
-82863,
-82863,
-82879,
-82898,
-82906,
-82906,
-82923,
-82923,
-82942,
-82942,
-82966,
-83020,
-83020,
-83044,
-83044,
-83067,
-83067,
-83105,
-83105,
-83122,
-83143,
-83161,
-83178,
-83194,
-83210,
-83210,
-83210,
-83210,
-83210,
-83232,
-83292,
-83309,
-83323,
-83357,
-83357,
-83406,
-83406,
-83406,
-83406,
-83453,
-83468,
-83487,
-83513,
-83513,
-83513,
-83519,
-83567,
-83580,
-83591,
-83606,
-83616,
-83653,
-83653,
-83670,
-83684,
-83684,
-83684,
-83684,
-83684,
-83695,
-83714,
-83714,
-83714,
-83759,
-83759,
-83759,
-83759,
-83759,
-83759,
-83791,
-83791,
-83791,
-83791,
-83791,
-83791,
-83791,
-83799,
-83799,
-83812,
-83812,
-83822,
-83822,
-83837,
-83837,
-83837,
-83837,
-83843,
-83843,
-83861,
-83861,
-83861,
-83874,
-83888,
-83936,
-83936,
-83950,
-83950,
-83950,
-83963,
-83963,
-83970,
-83995,
-83995,
-84018,
-84040,
-84040,
-84040,
-84040,
-84053,
-84053,
-84074,
-84105,
-84115,
-84154,
-84177,
-84194,
-84211,
-84211,
-84211,
-84211,
-84229,
-84229,
-84245,
-84266,
-84278,
-84285,
-84285,
-84285,
-84285,
-84285,
-84285,
-84285,
-84323,
-84348,
-84368,
-84368,
-84368,
-84368,
-84388,
-84388,
-84388,
-84388,
-84388,
-84388,
-84408,
-84421,
-84426,
-84433,
-84433,
-84433,
-84433,
-84433,
-84449,
-84472,
-84472,
-84472,
-84472,
-84492,
-84492,
-84499,
-84499,
+82848,
+82848,
+82869,
+82869,
+82884,
+82884,
+82884,
+82927,
+82927,
+82946,
+82964,
+82975,
+82975,
+82975,
+82983,
+83005,
+83045,
+83045,
+83045,
+83045,
+83045,
+83065,
+83065,
+83065,
+83065,
+83089,
+83120,
+83120,
+83120,
+83158,
+83158,
+83187,
+83208,
+83230,
+83243,
+83243,
+83243,
+83243,
+83265,
+83265,
+83265,
+83265,
+83265,
+83284,
+83307,
+83307,
+83307,
+83312,
+83331,
+83331,
+83331,
+83331,
+83354,
+83393,
+83400,
+83400,
+83400,
+83438,
+83448,
+83448,
+83485,
+83485,
+83485,
+83485,
+83485,
+83485,
+83485,
+83485,
+83508,
+83524,
+83536,
+83536,
+83572,
+83572,
+83572,
+83581,
+83581,
+83648,
+83648,
+83663,
+83676,
+83711,
+83722,
+83731,
+83731,
+83731,
+83753,
+83772,
+83772,
+83785,
+83785,
+83795,
+83810,
+83818,
+83845,
+83870,
+83870,
+83870,
+83880,
+83880,
+83904,
+83904,
+83904,
+83916,
+83916,
+83945,
+83996,
+83996,
+84020,
+84020,
+84030,
+84030,
+84030,
+84030,
+84063,
+84063,
+84094,
+84107,
+84130,
+84130,
+84149,
+84149,
+84155,
+84180,
+84215,
+84235,
+84273,
+84273,
+84291,
+84297,
+84307,
+84313,
+84334,
+84350,
+84350,
+84350,
+84392,
+84392,
+84403,
+84403,
+84436,
+84448,
+84470,
+84470,
+84470,
+84470,
+84470,
84506,
-84506,
-84524,
-84567,
-84585,
-84585,
-84585,
-84585,
-84585,
-84585,
-84608,
-84608,
-84618,
-84618,
-84618,
-84650,
-84670,
-84670,
+84534,
+84587,
+84599,
+84617,
+84617,
+84630,
+84646,
+84646,
+84682,
84682,
84682,
-84689,
-84699,
-84699,
-84709,
-84709,
-84709,
-84709,
-84709,
-84709,
-84709,
-84724,
-84733,
-84733,
-84741,
-84741,
-84776,
-84776,
-84776,
-84795,
-84825,
-84834,
-84834,
-84841,
-84851,
-84861,
-84871,
-84871,
-84882,
-84882,
-84892,
-84927,
-84932,
-84966,
-84984,
-84984,
-85015,
-85039,
-85051,
-85088,
-85088,
-85088,
-85088,
-85108,
-85134,
-85163,
-85163,
-85163,
-85174,
-85180,
-85198,
-85198,
-85198,
-85198,
-85230,
-85257,
-85257,
-85278,
-85278,
-85278,
-85278,
+84691,
+84714,
+84731,
+84763,
+84763,
+84773,
+84809,
+84818,
+84818,
+84829,
+84874,
+84874,
+84908,
+84928,
+84928,
+84942,
+84959,
+84959,
+84968,
+84968,
+84977,
+85020,
+85040,
+85040,
+85053,
+85085,
+85085,
+85095,
+85100,
+85111,
+85111,
+85119,
+85119,
+85151,
+85173,
+85173,
+85173,
+85186,
+85186,
+85191,
+85219,
+85219,
+85226,
+85245,
+85245,
+85262,
+85269,
+85285,
+85298,
+85298,
+85311,
85324,
-85365,
-85377,
-85414,
-85420,
-85436,
-85465,
-85490,
-85490,
-85501,
-85501,
-85529,
-85553,
-85553,
-85560,
-85560,
-85571,
-85571,
-85571,
-85571,
-85571,
-85571,
-85598,
-85598,
-85598,
-85620,
-85649,
-85649,
-85664,
-85664,
-85675,
-85687,
-85687,
-85687,
-85687,
-85687,
-85687,
-85705,
-85705,
-85717,
-85755,
-85755,
-85765,
-85765,
-85784,
-85784,
-85784,
-85818,
-85848,
-85873,
-85904,
-85954,
-85954,
-85967,
-85974,
-85983,
-86022,
-86030,
-86050,
-86050,
-86050,
-86050,
-86087,
-86087,
-86087,
-86099,
-86099,
-86109,
-86127,
-86150,
-86161,
-86187,
-86187,
-86205,
-86217,
-86236,
-86243,
-86254,
-86254,
-86254,
-86270,
-86270,
-86282,
-86295,
-86304,
-86332,
-86332,
-86332,
-86332,
-86343,
-86343,
-86343,
-86343,
-86343,
-86354,
-86354,
-86354,
-86354,
-86354,
-86354,
+85341,
+85341,
+85356,
+85356,
+85363,
+85405,
+85452,
+85476,
+85483,
+85483,
+85506,
+85546,
+85562,
+85618,
+85618,
+85618,
+85641,
+85648,
+85668,
+85711,
+85711,
+85731,
+85738,
+85745,
+85776,
+85776,
+85776,
+85781,
+85795,
+85802,
+85802,
+85830,
+85864,
+85911,
+85925,
+85925,
+85925,
+85947,
+85996,
+86032,
+86071,
+86081,
+86088,
+86107,
+86121,
+86121,
+86141,
+86141,
+86163,
+86192,
+86199,
+86199,
+86199,
+86199,
+86224,
+86256,
+86292,
+86292,
+86312,
+86312,
+86341,
+86362,
+86372,
+86372,
86372,
-86377,
-86398,
-86398,
-86421,
-86427,
-86427,
-86427,
-86427,
-86432,
-86454,
-86468,
-86468,
-86482,
-86482,
+86372,
+86381,
+86399,
+86409,
+86428,
+86442,
+86449,
86487,
-86498,
-86512,
-86512,
-86535,
-86544,
-86577,
-86615,
-86651,
-86672,
-86672,
-86672,
-86698,
-86698,
-86721,
-86721,
-86757,
-86757,
-86757,
-86778,
-86789,
-86789,
-86789,
-86809,
-86833,
-86833,
-86845,
-86867,
-86867,
-86867,
-86895,
-86920,
-86920,
-86920,
-86920,
-86982,
-86982,
-87000,
-87006,
-87067,
-87067,
-87067,
-87067,
-87077,
-87077,
-87085,
-87090,
-87106,
-87106,
-87112,
-87112,
-87112,
-87118,
-87127,
-87127,
-87127,
-87143,
-87143,
-87143,
-87143,
-87155,
-87155,
-87168,
-87168,
-87182,
-87182,
-87188,
-87188,
-87188,
-87188,
-87188,
-87204,
-87215,
-87236,
-87236,
+86487,
+86503,
+86515,
+86515,
+86515,
+86515,
+86515,
+86526,
+86545,
+86545,
+86545,
+86545,
+86571,
+86571,
+86571,
+86618,
+86626,
+86673,
+86704,
+86730,
+86748,
+86760,
+86767,
+86767,
+86784,
+86784,
+86807,
+86825,
+86832,
+86856,
+86885,
+86917,
+86936,
+86936,
+86964,
+86971,
+86971,
+87009,
+87031,
+87031,
+87066,
+87096,
+87096,
+87096,
+87116,
+87116,
+87123,
+87150,
+87165,
+87192,
+87198,
+87198,
+87198,
+87224,
87236,
-87248,
-87257,
-87274,
-87282,
-87297,
+87263,
+87263,
+87270,
+87285,
87297,
-87297,
-87297,
-87302,
-87321,
-87341,
-87341,
-87367,
-87367,
-87373,
-87379,
-87387,
-87406,
-87406,
-87406,
-87412,
-87426,
-87441,
-87441,
-87441,
-87449,
-87458,
-87458,
-87458,
-87467,
-87476,
-87541,
-87541,
-87541,
-87541,
-87577,
-87583,
-87583,
-87612,
-87612,
-87620,
-87626,
-87639,
-87639,
-87639,
-87661,
-87671,
-87686,
-87707,
-87707,
-87707,
-87738,
-87738,
-87759,
-87770,
-87780,
-87797,
-87797,
-87810,
-87810,
-87819,
+87335,
+87395,
+87395,
+87395,
+87414,
+87423,
+87433,
+87433,
+87443,
+87455,
+87474,
+87490,
+87505,
+87512,
+87523,
+87539,
+87539,
+87539,
+87556,
+87556,
+87613,
+87669,
+87669,
+87676,
+87689,
+87709,
+87709,
+87716,
+87734,
+87771,
+87796,
+87803,
+87826,
+87833,
87833,
-87841,
-87869,
-87869,
-87869,
-87869,
-87885,
-87885,
-87899,
-87912,
+87861,
+87871,
+87895,
87929,
-87941,
-87955,
-87970,
-87984,
-87984,
-88000,
-88026,
-88026,
-88026,
-88026,
-88036,
-88051,
-88061,
-88104,
-88114,
-88114,
-88125,
-88125,
-88125,
-88132,
-88161,
-88166,
-88178,
-88178,
-88178,
-88178,
-88208,
-88213,
-88213,
-88220,
-88227,
-88227,
-88244,
-88260,
-88260,
-88266,
-88291,
-88297,
-88297,
-88297,
-88334,
-88334,
-88366,
-88398,
-88415,
+87936,
+87943,
+87980,
+87989,
+88003,
+88003,
+88013,
+88013,
+88020,
+88050,
+88066,
+88066,
+88088,
+88095,
+88152,
+88162,
+88169,
+88169,
+88197,
+88214,
+88237,
+88254,
+88267,
+88267,
+88274,
+88293,
+88326,
+88333,
+88358,
+88379,
+88393,
+88400,
+88414,
88432,
-88442,
-88456,
-88478,
-88520,
-88520,
-88520,
-88569,
-88617,
-88626,
-88632,
-88632,
-88649,
-88661,
-88661,
-88693,
-88705,
-88705,
+88450,
+88489,
+88497,
+88515,
+88521,
+88521,
+88521,
+88560,
+88560,
+88566,
+88574,
+88574,
+88595,
+88595,
+88595,
+88700,
+88700,
88705,
-88705,
-88705,
-88712,
-88734,
-88779,
-88779,
-88779,
-88785,
-88785,
-88800,
-88817,
-88817,
-88824,
-88824,
-88868,
-88868,
-88868,
-88868,
-88868,
-88913,
-88936,
-88977,
-88990,
-89019,
-89025,
-89044,
-89068,
-89068,
-89085,
-89085,
-89085,
-89085,
-89131,
-89143,
+88718,
+88718,
+88732,
+88732,
+88745,
+88745,
+88758,
+88773,
+88780,
+88793,
+88822,
+88846,
+88846,
+88846,
+88860,
+88873,
+88873,
+88908,
+88908,
+88918,
+88925,
+88960,
+88998,
+89005,
+89005,
+89014,
+89014,
+89014,
+89038,
+89045,
+89066,
+89080,
+89080,
+89080,
+89080,
+89096,
+89096,
+89107,
+89107,
+89126,
89143,
-89158,
-89168,
-89197,
-89202,
-89202,
-89207,
-89278,
-89290,
-89309,
-89319,
-89324,
-89324,
-89344,
-89354,
-89354,
-89386,
-89393,
-89405,
-89430,
-89430,
-89430,
-89438,
-89438,
-89489,
-89496,
-89511,
-89529,
-89545,
-89563,
-89569,
-89569,
-89569,
-89592,
-89598,
-89598,
-89598,
-89653,
-89659,
-89659,
-89669,
-89669,
-89690,
-89714,
-89722,
-89732,
-89776,
-89776,
-89776,
-89782,
-89795,
-89795,
-89795,
-89795,
-89813,
-89824,
-89824,
-89841,
-89848,
-89848,
-89848,
-89858,
-89858,
-89891,
-89891,
-89918,
-89928,
-89928,
-89947,
-89977,
-89977,
-89977,
-89977,
-89998,
-90025,
-90025,
-90065,
-90071,
-90086,
-90086,
-90086,
-90104,
-90104,
-90136,
-90163,
-90163,
-90163,
-90163,
-90169,
-90194,
-90194,
-90194,
-90194,
-90207,
-90224,
-90247,
-90256,
-90256,
-90262,
-90275,
-90275,
-90293,
-90303,
-90303,
-90303,
-90361,
-90376,
-90417,
-90428,
-90452,
-90491,
-90502,
-90509,
-90515,
-90538,
-90564,
-90594,
-90638,
-90638,
-90638,
-90638,
-90659,
-90668,
-90683,
-90691,
-90698,
-90706,
-90724,
-90735,
-90770,
-90770,
-90778,
-90778,
-90795,
-90795,
-90795,
-90795,
-90831,
-90831,
+89159,
+89181,
+89192,
+89231,
+89231,
+89248,
+89268,
+89297,
+89331,
+89338,
+89356,
+89363,
+89380,
+89387,
+89394,
+89408,
+89408,
+89426,
+89433,
+89433,
+89433,
+89453,
+89471,
+89477,
+89510,
+89517,
+89517,
+89517,
+89547,
+89573,
+89605,
+89639,
+89676,
+89676,
+89676,
+89683,
+89727,
+89781,
+89799,
+89806,
+89820,
+89853,
+89860,
+89873,
+89896,
+89901,
+89908,
+89908,
+89931,
+89976,
+90001,
+90034,
+90034,
+90056,
+90056,
+90080,
+90109,
+90109,
+90121,
+90131,
+90143,
+90178,
+90197,
+90204,
+90204,
+90214,
+90222,
+90236,
+90291,
+90304,
+90304,
+90321,
+90328,
+90328,
+90328,
+90343,
+90343,
+90358,
+90358,
+90365,
+90383,
+90383,
+90383,
+90389,
+90402,
+90402,
+90402,
+90418,
+90436,
+90436,
+90450,
+90462,
+90462,
+90469,
+90479,
+90488,
+90505,
+90518,
+90525,
+90525,
+90525,
+90543,
+90543,
+90550,
+90550,
+90550,
+90558,
+90570,
+90570,
+90570,
+90605,
+90631,
+90663,
+90680,
+90699,
+90705,
+90718,
+90727,
+90727,
+90727,
+90742,
+90761,
+90768,
+90789,
+90817,
+90837,
+90847,
+90847,
+90862,
+90862,
90869,
-90883,
-90901,
-90907,
-90913,
-90929,
-90929,
-90959,
-90977,
-90987,
-91007,
-91019,
-91033,
-91039,
-91104,
-91104,
-91110,
-91110,
-91110,
-91124,
-91130,
-91136,
-91157,
-91163,
-91163,
-91169,
-91209,
-91209,
-91225,
-91225,
-91225,
-91225,
-91241,
-91241,
-91253,
-91273,
-91273,
-91283,
-91304,
-91310,
-91337,
-91354,
-91354,
-91354,
-91354,
-91368,
-91381,
-91381,
-91416,
-91435,
-91441,
-91441,
-91441,
-91441,
-91441,
-91463,
-91489,
-91504,
-91504,
-91520,
-91520,
-91520,
-91566,
-91566,
-91576,
-91576,
-91594,
-91599,
-91599,
-91610,
-91610,
-91619,
-91635,
-91641,
-91675,
-91683,
-91683,
-91683,
-91683,
-91683,
-91683,
-91683,
-91683,
-91749,
-91749,
-91749,
-91749,
-91760,
-91809,
-91814,
-91814,
-91814,
-91824,
-91824,
-91835,
-91847,
-91865,
-91879,
-91891,
-91935,
-91935,
-91955,
-91986,
-91996,
-91996,
-91996,
-92023,
-92057,
-92057,
-92062,
-92103,
-92111,
-92117,
-92117,
-92117,
-92117,
-92117,
-92117,
-92117,
-92136,
-92157,
-92192,
-92203,
-92203,
-92223,
-92223,
-92241,
-92241,
-92241,
-92241,
+90869,
+90869,
+90869,
+90875,
+90882,
+90905,
+90945,
+90973,
+90973,
+90973,
+90986,
+90986,
+90991,
+91006,
+91060,
+91060,
+91060,
+91060,
+91060,
+91060,
+91090,
+91107,
+91107,
+91107,
+91107,
+91107,
+91127,
+91160,
+91170,
+91186,
+91186,
+91234,
+91234,
+91245,
+91245,
+91245,
+91289,
+91302,
+91302,
+91302,
+91340,
+91347,
+91347,
+91359,
+91376,
+91384,
+91384,
+91398,
+91412,
+91412,
+91431,
+91431,
+91431,
+91431,
+91431,
+91431,
+91451,
+91464,
+91472,
+91472,
+91490,
+91490,
+91502,
+91517,
+91534,
+91560,
+91569,
+91587,
+91603,
+91623,
+91663,
+91663,
+91681,
+91698,
+91698,
+91708,
+91720,
+91751,
+91751,
+91763,
+91779,
+91786,
+91786,
+91786,
+91786,
+91812,
+91812,
+91834,
+91859,
+91877,
+91886,
+91886,
+91908,
+91922,
+91951,
+91963,
+92005,
+92010,
+92059,
+92069,
+92100,
+92113,
+92132,
+92153,
+92176,
+92176,
+92193,
+92193,
+92211,
+92211,
+92220,
+92220,
+92220,
+92220,
+92220,
+92220,
+92220,
+92220,
+92220,
92241,
-92281,
-92319,
+92283,
+92309,
+92316,
92329,
92329,
-92351,
-92358,
-92358,
-92358,
-92371,
-92390,
-92404,
-92410,
-92410,
-92423,
+92334,
+92350,
+92350,
+92372,
+92379,
+92379,
+92379,
+92398,
+92398,
+92398,
+92398,
+92406,
92423,
-92449,
-92491,
-92532,
-92532,
-92540,
-92546,
-92552,
-92572,
-92572,
-92572,
-92592,
-92603,
-92603,
-92603,
-92626,
-92658,
-92666,
-92666,
-92666,
-92672,
-92714,
-92714,
-92724,
-92744,
-92776,
-92776,
-92797,
-92797,
+92436,
+92450,
+92499,
+92508,
+92544,
+92559,
+92571,
+92571,
+92571,
+92571,
+92571,
+92579,
+92579,
+92585,
+92585,
+92602,
+92613,
+92613,
+92637,
+92651,
+92651,
+92657,
+92657,
+92657,
+92657,
+92680,
+92680,
+92680,
+92680,
+92719,
+92734,
+92750,
+92750,
+92786,
+92786,
+92818,
+92828,
92828,
92828,
-92847,
-92847,
-92874,
-92874,
-92874,
-92892,
-92900,
-92900,
-92900,
-92930,
-92930,
-92936,
-92936,
-92944,
-92962,
-92977,
-92977,
-92983,
+92838,
+92838,
+92838,
+92838,
+92838,
+92845,
+92854,
+92854,
+92866,
+92875,
+92875,
+92898,
+92924,
+92924,
+92942,
+92942,
+92951,
+92951,
+92970,
+93007,
93027,
-93033,
-93033,
-93050,
-93082,
-93107,
-93125,
+93027,
+93043,
+93080,
+93080,
+93093,
+93093,
+93093,
+93093,
93125,
93125,
-93143,
-93143,
-93157,
-93157,
-93157,
-93157,
-93187,
-93187,
-93194,
-93194,
-93206,
-93206,
-93212,
-93229,
-93258,
-93285,
-93297,
-93297,
-93297,
-93297,
-93343,
-93343,
-93343,
-93370,
-93387,
-93387,
-93387,
-93387,
-93387,
-93412,
-93417,
-93430,
-93430,
-93430,
-93430,
-93430,
-93430,
-93430,
-93436,
-93455,
-93464,
-93483,
-93496,
-93496,
-93513,
-93513,
-93513,
-93554,
-93584,
-93584,
-93584,
-93584,
-93592,
-93602,
-93607,
-93631,
-93657,
-93664,
-93672,
-93744,
-93753,
-93753,
-93761,
-93776,
-93776,
-93776,
-93776,
-93776,
-93776,
-93810,
-93822,
-93822,
-93852,
-93871,
-93884,
-93897,
-93914,
+93142,
+93158,
+93180,
+93199,
+93199,
+93216,
+93216,
+93231,
+93241,
+93241,
+93241,
+93250,
+93250,
+93250,
+93278,
+93278,
+93278,
+93302,
+93314,
+93314,
+93314,
+93334,
+93334,
+93334,
+93352,
+93366,
+93389,
+93429,
+93448,
+93448,
+93457,
+93457,
+93457,
+93469,
+93469,
+93469,
+93493,
+93493,
+93570,
+93570,
+93570,
+93570,
+93578,
+93578,
+93606,
+93630,
+93642,
+93649,
+93649,
+93682,
+93710,
+93710,
+93710,
+93717,
+93732,
+93738,
+93738,
+93754,
+93754,
+93771,
+93771,
+93771,
+93787,
+93793,
+93793,
+93801,
+93812,
+93812,
+93812,
+93829,
+93829,
+93829,
+93870,
+93890,
+93890,
+93890,
+93917,
93926,
-93939,
-93939,
-93954,
-93954,
-93954,
-93954,
-93969,
-93977,
-93977,
-93977,
-93990,
-93990,
-94031,
-94062,
-94068,
-94068,
-94068,
-94099,
-94123,
-94141,
-94191,
-94209,
-94209,
-94209,
-94228,
-94263,
-94263,
-94298,
-94307,
-94321,
-94321,
-94327,
-94327,
-94358,
-94358,
-94358,
-94370,
-94370,
-94370,
-94370,
+93926,
+93942,
+93960,
+93967,
+93974,
+93998,
+93998,
+94015,
+94021,
+94021,
+94021,
+94027,
+94027,
+94027,
+94027,
+94042,
+94061,
+94061,
+94061,
+94081,
+94081,
+94104,
+94118,
+94135,
+94153,
+94153,
+94171,
+94192,
+94202,
+94218,
+94218,
+94218,
+94218,
+94218,
+94251,
+94257,
+94257,
+94276,
+94276,
+94276,
+94282,
+94300,
+94300,
+94318,
+94318,
+94335,
+94349,
+94349,
+94349,
+94349,
+94361,
+94377,
94377,
-94410,
-94464,
+94377,
+94397,
+94432,
+94432,
+94432,
+94452,
+94460,
+94460,
+94471,
+94471,
+94479,
+94496,
94496,
-94513,
-94542,
-94548,
-94548,
-94563,
-94569,
-94575,
-94593,
-94593,
-94593,
-94593,
-94613,
-94613,
-94618,
-94618,
-94618,
-94625,
-94637,
-94644,
-94650,
-94663,
+94496,
+94550,
+94612,
+94622,
+94640,
+94670,
+94670,
+94670,
+94682,
+94682,
94682,
-94695,
-94728,
-94728,
-94734,
-94734,
-94759,
-94789,
-94814,
-94826,
-94826,
-94826,
-94840,
-94840,
-94840,
-94871,
-94877,
-94877,
-94885,
-94885,
-94885,
+94700,
+94720,
+94720,
+94735,
+94735,
+94735,
+94746,
+94757,
+94773,
+94773,
+94773,
+94773,
+94773,
+94785,
+94792,
+94792,
+94792,
+94808,
+94859,
+94859,
+94867,
+94883,
94892,
94892,
-94904,
-94904,
-94904,
-94904,
-94904,
-94904,
-94904,
-94920,
-94920,
-94941,
-94959,
-94959,
-94959,
-94959,
-94959,
-94971,
-95005,
-95034,
-95034,
-95068,
-95073,
-95098,
-95098,
-95098,
-95115,
-95144,
-95153,
-95170,
-95170,
-95207,
-95227,
-95227,
-95250,
-95264,
-95264,
-95264,
-95280,
-95303,
-95303,
-95303,
-95319,
-95319,
-95319,
-95342,
+94928,
+94938,
+94938,
+94938,
+94944,
+94969,
+94975,
+95013,
+95069,
+95069,
+95069,
+95084,
+95118,
+95131,
+95157,
+95169,
+95183,
+95252,
+95268,
+95294,
+95301,
+95317,
+95323,
+95340,
+95340,
+95358,
+95358,
95364,
-95407,
-95420,
-95420,
-95435,
-95435,
-95452,
-95452,
-95452,
-95470,
-95476,
-95505,
-95536,
-95536,
-95536,
-95536,
-95536,
-95536,
-95568,
-95568,
-95587,
-95629,
-95629,
-95640,
-95647,
-95660,
-95705,
-95742,
-95754,
-95825,
-95831,
-95848,
-95848,
-95848,
-95868,
-95888,
-95911,
-95936,
-95936,
-95979,
-96003,
-96016,
-96047,
-96047,
-96059,
-96082,
-96107,
-96107,
-96119,
-96133,
-96157,
-96169,
-96169,
-96169,
-96177,
-96177,
-96203,
-96234,
-96234,
-96234,
-96247,
-96268,
-96274,
-96274,
-96315,
-96354,
-96372,
-96372,
-96372,
-96392,
-96407,
-96444,
-96444,
-96470,
-96510,
-96527,
-96562,
-96583,
-96583,
-96599,
-96599,
-96599,
-96642,
-96657,
-96657,
-96657,
-96698,
-96720,
-96735,
-96735,
-96761,
-96802,
-96802,
-96814,
-96826,
-96826,
-96843,
-96855,
-96866,
-96884,
-96896,
-96896,
-96905,
-96905,
-96905,
-96905,
-96905,
-96933,
-96933,
-96933,
-96933,
-96950,
-96950,
-96950,
-96950,
-96965,
-96974,
-96992,
-96992,
-97012,
-97041,
-97047,
-97091,
-97091,
-97091,
-97098,
-97098,
-97120,
-97138,
-97138,
-97196,
-97227,
-97227,
-97255,
-97267,
-97267,
-97292,
-97331,
-97355,
-97365,
-97373,
-97457,
-97457,
-97457,
-97519,
-97519,
-97534,
-97548,
-97548,
-97570,
-97593,
-97613,
-97631,
-97661,
-97667,
-97689,
-97717,
-97717,
-97717,
-97735,
-97735,
-97735,
-97745,
-97771,
-97786,
-97798,
-97798,
-97839,
-97839,
-97839,
-97848,
-97848,
-97867,
-97918,
-97918,
-97918,
-97927,
-97942,
-97942,
-97942,
-97942,
-97942,
-97967,
-97979,
-98012,
-98012,
-98054,
-98054,
-98078,
-98078,
-98106,
-98106,
-98115,
-98130,
-98130,
+95396,
+95396,
+95413,
+95423,
+95449,
+95449,
+95504,
+95550,
+95550,
+95566,
+95588,
+95588,
+95615,
+95654,
+95667,
+95667,
+95667,
+95667,
+95667,
+95694,
+95707,
+95721,
+95721,
+95764,
+95770,
+95770,
+95775,
+95789,
+95789,
+95789,
+95800,
+95800,
+95800,
+95800,
+95805,
+95811,
+95811,
+95811,
+95833,
+95833,
+95857,
+95889,
+95889,
+95889,
+95889,
+95889,
+95889,
+95895,
+95895,
+95926,
+95946,
+95957,
+95957,
+95974,
+95986,
+96002,
+96002,
+96034,
+96048,
+96066,
+96111,
+96111,
+96135,
+96149,
+96149,
+96149,
+96149,
+96156,
+96179,
+96179,
+96197,
+96197,
+96210,
+96226,
+96231,
+96264,
+96264,
+96281,
+96288,
+96288,
+96288,
+96322,
+96353,
+96368,
+96385,
+96404,
+96404,
+96415,
+96415,
+96415,
+96415,
+96415,
+96424,
+96472,
+96472,
+96472,
+96492,
+96511,
+96518,
+96524,
+96534,
+96549,
+96549,
+96571,
+96571,
+96571,
+96571,
+96571,
+96571,
+96590,
+96605,
+96605,
+96624,
+96624,
+96639,
+96639,
+96639,
+96654,
+96683,
+96683,
+96683,
+96683,
+96692,
+96692,
+96701,
+96701,
+96701,
+96701,
+96701,
+96701,
+96701,
+96711,
+96725,
+96732,
+96785,
+96795,
+96795,
+96832,
+96853,
+96853,
+96853,
+96853,
+96859,
+96888,
+96888,
+96888,
+96888,
+96894,
+96924,
+96931,
+96931,
+96945,
+97025,
+97049,
+97070,
+97070,
+97095,
+97095,
+97095,
+97095,
+97132,
+97132,
+97167,
+97178,
+97178,
+97178,
+97195,
+97195,
+97201,
+97201,
+97212,
+97212,
+97245,
+97254,
+97254,
+97264,
+97308,
+97322,
+97322,
+97322,
+97336,
+97371,
+97371,
+97371,
+97387,
+97399,
+97419,
+97435,
+97435,
+97459,
+97459,
+97459,
+97482,
+97523,
+97523,
+97533,
+97540,
+97540,
+97540,
+97559,
+97597,
+97606,
+97621,
+97627,
+97627,
+97674,
+97674,
+97674,
+97694,
+97694,
+97713,
+97730,
+97730,
+97730,
+97730,
+97737,
+97737,
+97737,
+97737,
+97753,
+97782,
+97782,
+97802,
+97842,
+97861,
+97861,
+97868,
+97878,
+97945,
+97945,
+97961,
+97971,
+97971,
+97971,
+97999,
+97999,
+97999,
+98016,
+98016,
+98029,
+98029,
+98029,
+98044,
+98059,
+98059,
+98077,
+98077,
+98077,
+98077,
+98077,
+98077,
+98077,
+98107,
+98117,
+98122,
98130,
-98130,
-98137,
-98137,
-98137,
-98144,
-98168,
-98188,
-98188,
-98202,
-98202,
-98220,
-98234,
-98266,
-98273,
-98292,
-98317,
-98328,
-98328,
-98346,
-98346,
-98346,
-98357,
-98357,
-98357,
-98365,
-98400,
-98412,
-98431,
-98438,
-98477,
-98488,
-98504,
-98504,
-98511,
-98540,
-98559,
-98566,
-98595,
-98601,
-98607,
-98615,
-98638,
-98651,
-98651,
-98651,
-98667,
-98667,
+98138,
+98138,
+98156,
+98156,
+98165,
+98185,
+98209,
+98249,
+98262,
+98281,
+98281,
+98296,
+98296,
+98309,
+98323,
+98323,
+98323,
+98323,
+98336,
+98336,
+98356,
+98356,
+98356,
+98356,
+98377,
+98389,
+98398,
+98398,
+98404,
+98422,
+98422,
+98422,
+98422,
+98427,
+98433,
+98433,
+98450,
+98450,
+98487,
+98500,
+98558,
+98577,
+98591,
+98603,
+98624,
+98624,
+98624,
+98624,
+98624,
+98641,
+98659,
+98659,
+98669,
+98669,
+98669,
+98669,
98686,
-98703,
-98703,
-98716,
-98728,
-98762,
-98762,
-98762,
-98779,
-98804,
-98827,
-98833,
-98847,
-98865,
-98865,
-98865,
-98865,
-98876,
-98876,
-98876,
-98895,
-98905,
-98905,
-98946,
-98946,
-98946,
-98946,
-98977,
-99002,
-99019,
+98707,
+98707,
+98729,
+98729,
+98745,
+98752,
+98752,
+98786,
+98786,
+98793,
+98793,
+98793,
+98793,
+98793,
+98793,
+98793,
+98803,
+98803,
+98809,
+98816,
+98816,
+98816,
+98816,
+98822,
+98822,
+98828,
+98850,
+98869,
+98869,
+98885,
+98906,
+98913,
+98925,
+98925,
+98935,
+98956,
+98956,
+98973,
+98982,
+98982,
+99001,
+99001,
+99013,
+99013,
99026,
99026,
-99038,
-99051,
-99078,
-99106,
-99113,
-99126,
-99144,
-99164,
-99164,
-99189,
-99238,
-99245,
-99257,
-99288,
-99306,
-99306,
-99334,
+99045,
+99061,
+99070,
+99092,
+99099,
+99123,
+99134,
+99161,
+99161,
+99161,
+99161,
+99211,
+99242,
+99283,
+99283,
+99302,
+99315,
+99321,
+99328,
99355,
-99383,
-99437,
-99437,
-99458,
-99485,
-99505,
-99517,
-99528,
-99553,
-99560,
-99573,
-99590,
-99602,
-99624,
-99624,
-99631,
+99367,
+99390,
+99450,
+99460,
+99460,
+99467,
+99492,
+99509,
+99509,
+99532,
+99548,
+99555,
+99575,
+99591,
+99599,
+99606,
+99613,
+99620,
+99620,
+99620,
+99620,
99638,
-99657,
-99688,
-99701,
-99708,
-99747,
-99759,
-99781,
-99781,
-99804,
-99822,
-99841,
-99841,
-99859,
-99859,
-99859,
-99877,
-99890,
-99913,
-99930,
-99944,
-99976,
-100005,
-100005,
-100018,
-100025,
-100025,
-100032,
-100032,
-100048,
-100059,
-100059,
-100086,
+99645,
+99652,
+99689,
+99689,
+99689,
+99706,
+99713,
+99730,
+99776,
+99796,
+99796,
+99796,
+99803,
+99819,
+99826,
+99826,
+99838,
+99855,
+99884,
+99908,
+99928,
+99947,
+99973,
+99979,
+99988,
+99988,
+100017,
+100017,
+100024,
+100024,
+100031,
+100031,
+100031,
+100072,
+100079,
+100079,
+100079,
+100079,
+100095,
100095,
-100111,
+100095,
+100100,
+100107,
+100127,
+100127,
+100138,
100138,
-100153,
-100169,
-100214,
-100222,
-100230,
-100267,
-100274,
-100284,
-100293,
-100293,
-100329,
-100347,
-100357,
-100377,
-100387,
-100387,
-100397,
-100397,
+100138,
+100148,
+100154,
+100154,
+100154,
+100154,
+100154,
+100154,
+100159,
+100172,
+100211,
+100243,
+100255,
+100281,
+100281,
+100309,
+100316,
+100343,
+100369,
+100374,
+100381,
100409,
-100425,
-100425,
-100425,
-100441,
-100455,
-100472,
-100472,
-100479,
-100508,
-100508,
-100517,
-100549,
-100549,
-100568,
-100578,
-100603,
-100603,
-100610,
-100610,
-100641,
-100682,
-100690,
-100705,
-100723,
-100743,
-100743,
-100750,
-100763,
-100763,
-100822,
-100844,
-100865,
-100877,
-100877,
-100877,
-100884,
-100891,
-100903,
-100926,
-100950,
-100950,
-100968,
-100968,
-100987,
-101007,
-101027,
-101027,
-101027,
-101034,
-101034,
+100424,
+100424,
+100444,
+100444,
+100465,
+100498,
+100545,
+100552,
+100552,
+100552,
+100552,
+100559,
+100559,
+100574,
+100606,
+100611,
+100618,
+100618,
+100618,
+100633,
+100633,
+100652,
+100670,
+100691,
+100731,
+100731,
+100731,
+100744,
+100765,
+100765,
+100800,
+100828,
+100835,
+100835,
+100835,
+100842,
+100842,
+100854,
+100881,
+100898,
+100911,
+100911,
+100911,
+100911,
+100932,
+100948,
+100948,
+100948,
+100948,
+100977,
+100977,
+100977,
+100983,
+100992,
+100992,
+101016,
101041,
-101048,
-101055,
-101105,
-101126,
-101142,
-101149,
-101156,
-101163,
-101163,
-101205,
-101205,
-101228,
-101228,
-101228,
-101228,
-101228,
-101228,
-101250,
-101275,
-101282,
-101282,
-101310,
-101316,
-101316,
-101316,
-101323,
-101344,
-101366,
-101392,
-101399,
-101424,
-101441,
-101441,
-101441,
-101441,
-101464,
-101500,
-101520,
-101537,
-101544,
-101552,
-101552,
-101580,
-101580,
-101610,
-101620,
-101627,
-101634,
-101649,
-101656,
-101663,
-101670,
-101670,
-101686,
-101686,
-101693,
-101720,
-101720,
-101748,
-101765,
-101786,
-101802,
-101809,
-101828};
+101063,
+101071,
+101088,
+101088,
+101088,
+101088,
+101113,
+101133,
+101133,
+101148,
+101170,
+101177,
+101206,
+101206,
+101214,
+101251,
+101273,
+101303,
+101345,
+101352,
+101359,
+101359,
+101359,
+101376,
+101387,
+101387,
+101405,
+101412,
+101419,
+101419,
+101426,
+101449,
+101456,
+101456,
+101463,
+101463,
+101470,
+101489,
+101497,
+101504,
+101511,
+101511,
+101516,
+101516,
+101523,
+101543,
+101543,
+101557,
+101586,
+101593,
+101607,
+101625,
+101635,
+101669,
+101689,
+101716,
+101728,
+101739,
+101746,
+101772,
+101772,
+101847,
+101847,
+101847,
+101853,
+101861,
+101888,
+101888,
+101940,
+101980,
+101987,
+102010,
+102021,
+102032,
+102055,
+102062,
+102062,
+102072,
+102079,
+102097,
+102111,
+102118,
+102118,
+102118,
+102146,
+102153,
+102171,
+102178,
+102178,
+102225,
+102244,
+102290,
+102313,
+102320,
+102331,
+102331,
+102331,
+102331,
+102362,
+102367,
+102382,
+102397,
+102438,
+102473,
+102473,
+102499,
+102508,
+102520,
+102538,
+102557,
+102571,
+102602,
+102629,
+102629,
+102629,
+102649,
+102649,
+102649,
+102661,
+102678,
+102717,
+102734,
+102753,
+102778,
+102792,
+102825,
+102832,
+102868,
+102888,
+102899,
+102930,
+102930,
+102930,
+102954,
+102954,
+102988,
+102995,
+102995,
+102995,
+103003,
+103010,
+103017,
+103025,
+103050,
+103050,
+103050,
+103057,
+103072,
+103082,
+103082,
+103095,
+103106,
+103138,
+103171,
+103198,
+103217,
+103265,
+103315,
+103339,
+103345,
+103352,
+103379,
+103379,
+103395
+};
static const char *tldData[] = {
-"edu.mt\0"
-"off.ai\0k12.dc.us\0"
-"edu.mv\0"
-"edu.mw\0edu.ng\0berlev\xc3\xa5g.no\0"
-"edu.mx\0"
-"edu.my\0edu.ni\0"
-"edu.mz\0fastpanel.direct\0"
-"suzuki\0s3-eu-west-1.amazonaws.com\0"
-"livinghistory.museum\0"
-"trentinoalto-adige.it\0dontexist.net\0"
-"hamburg.museum\0muos\xc3\xa1t.no\0"
-"cn-northwest-1.eb.amazonaws.com.cn\0"
-"edu.nr\0\xe0\xb8\x98\xe0\xb8\xb8\xe0\xb8\xa3\xe0\xb8\x81\xe0\xb8\xb4\xe0\xb8\x88.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0direct\0"
-"fl.us\0agency\0"
-"from-ok.com\0"
-"nishiizu.shizuoka.jp\0komae.tokyo.jp\0"
-"edu.om\0team\0doomdns.com\0"
-"vestre-slidre.no\0"
-"sweden.museum\0edu.pa\0"
-"newhampshire.museum\0"
-"edu.pe\0"
-"pro.az\0ar.it\0nishihara.kumamoto.jp\0edu.pf\0"
-"edu.ph\0"
-"page\0"
-"hikimi.shimane.jp\0"
-"santafe.museum\0edu.pk\0"
-"edu.pl\0"
-"s3-ap-southeast-1.amazonaws.com\0home.dyndns.org\0"
-"pro.br\0edu.pn\0"
-"kasai.hyogo.jp\0clan.rip\0"
-"edu.qa\0"
-"edu.pr\0"
-"edu.ps\0mordovia.ru\0"
-"nysa.pl\0edu.pt\0"
-"\xe7\xbd\x91\xe7\xbb\x9c.hk\0ing.pa\0"
-"tech\0"
-"edu.py\0"
-"ugim.gov.pl\0"
-"kameyama.mie.jp\0"
-"madrid.museum\0gjesdal.no\0"
-"elverum.no\0"
-"saotome.st\0"
-"sveio.no\0iveco\0"
-"gifu.jp\0"
-"k12.me.us\0"
-"samsclub\0now-dns.top\0"
-"pro.cy\0"
-"solund.no\0"
-"store\0"
-"nym.gr\0"
-"gjovik.no\0"
-"miyoshi.aichi.jp\0"
-"pro.ec\0convent.museum\0hopto.org\0"
-"ichikawamisato.yamanashi.jp\0"
-"edu.sa\0nym.gy\0"
-"edu.sb\0lamer\0"
-"edu.rs\0edu.sc\0"
-"edu.sd\0"
-"edu.ru\0"
-"map.fastlylb.net\0"
-"langevag.no\0edu.rw\0edu.sg\0"
-"bmd.br\0"
-"brasil.museum\0cc.ar.us\0"
-"edu.sl\0"
-"nym.ie\0"
-"edu.sn\0"
-"muosat.no\0"
-"usa.museum\0"
-"oguni.kumamoto.jp\0edu.st\0"
-"friuli-ve-giulia.it\0edu.sv\0"
-"lg.ua\0"
-"edu.sy\0"
-"shiwa.iwate.jp\0edu.tj\0cheap\0"
-"tysfjord.no\0miami\0"
-"edu.tm\0apple\0"
-"kunimi.fukushima.jp\0iwi.nz\0"
-"edu.to\0"
-"edu.ua\0"
-"cim.br\0edu.tr\0"
-"bindal.no\0arts.ve\0"
-"ikaruga.nara.jp\0edu.tt\0"
-"edu.tw\0"
-"eu-4.evennode.com\0"
-"shirahama.wakayama.jp\0"
-"yoshioka.gunma.jp\0"
-"stuttgart.museum\0sn\xc3\xa5sa.no\0"
+"samegawa.fukushima.jp\0dupont\0"
+"alstom\0"
+"mashiki.kumamoto.jp\0neues.museum\0"
+"herokussl.com\0"
+"karate.museum\0"
+"vall\xc3\xa9""e-d-aoste.it\0"
"edu.vc\0"
-"sicily.it\0"
+"nz.eu.org\0"
"edu.ve\0"
-"sakahogi.gifu.jp\0daigo.ibaraki.jp\0"
-"indianapolis.museum\0edu.uy\0s3.dualstack.eu-central-1.amazonaws.com\0nym.la\0"
-"iwamizawa.hokkaido.jp\0buzz\0piaget\0"
-"nym.lc\0"
-"edu.vn\0"
-"o.bg\0"
-"pro.ht\0"
-"skanland.no\0nym.li\0"
-"nym.kz\0"
-"riik.ee\0audio\0"
-"adachi.tokyo.jp\0"
-"edu.vu\0exnet.su\0"
-"iselect\0"
-"sanjo.niigata.jp\0"
-"jamison.museum\0abbvie\0"
-"za.bz\0"
-"sor-aurdal.no\0"
-"adult.ht\0nym.lt\0"
-"miners.museum\0is-an-actor.com\0nym.lu\0nym.me\0"
-"*.cns.joyent.com\0"
-"sv.it\0mukawa.hokkaido.jp\0oshu.iwate.jp\0kawanehon.shizuoka.jp\0krakow.pl\0"
-"edu.ws\0"
-"asahi.toyama.jp\0nym.mn\0"
-"from-ak.com\0"
-"preservation.museum\0"
-"rec.br\0oga.akita.jp\0"
-"okinawa\0"
-"chikuho.fukuoka.jp\0"
-"nym.mx\0"
-"levanger.no\0living\0"
-"8.bg\0space-to-rent.com\0"
-"tokushima.jp\0wanouchi.gifu.jp\0"
-"lifeinsurance\0"
-"\xe7\xa6\x8f\xe5\xb3\xb6.jp\0jetzt\0"
-"rec.co\0bible.museum\0"
-"ibaraki.jp\0usui.fukuoka.jp\0chungbuk.kr\0"
-"takamori.kumamoto.jp\0"
-"eu-3.evennode.com\0"
-"arts.ro\0"
-"is-a-lawyer.com\0"
-"edu.za\0is-a-student.com\0"
-"nym.nz\0"
-"nishikatsura.yamanashi.jp\0"
-"app.lmpm.com\0"
-"po.it\0nishigo.fukushima.jp\0"
-"s3.dualstack.us-east-2.amazonaws.com\0"
-"fj.cn\0tome.miyagi.jp\0"
-"edu.zm\0nym.pe\0"
-"v-info.info\0"
-"tomakomai.hokkaido.jp\0hosting-cluster.nl\0"
-"click\0"
-"miharu.fukushima.jp\0"
-"r\xc3\xb8st.no\0s3.eu-central-1.amazonaws.com\0"
-"midori.chiba.jp\0"
-"moriyama.shiga.jp\0"
-"natuurwetenschappen.museum\0"
-"nym.pt\0"
-"pro.na\0moto\0"
-"aero.tt\0map.fastly.net\0"
-"hidaka.kochi.jp\0"
-"crew.aero\0"
-"pro.mv\0"
-"histoire.museum\0krokstadelva.no\0giving\0"
-"microsoft\0"
-"ar.us\0"
-"sc.cn\0higashiosaka.osaka.jp\0"
-"pars\0"
-"philadelphia.museum\0lima-city.de\0"
-"lib.nv.us\0"
-"nakagawa.fukuoka.jp\0"
-"\xe4\xb8\xaa\xe4\xba\xba.hk\0nordkapp.no\0"
-"aero.mv\0"
-"baltimore.museum\0"
-"arts.nf\0"
-"shiksha\0"
-"nym.ro\0"
-"pro.om\0"
-"eu-2.evennode.com\0"
-"google\0"
-"nisshin.aichi.jp\0oyamazaki.kyoto.jp\0higashimatsuyama.saitama.jp\0"
-"vallee-d-aoste.it\0serveblog.net\0"
-"agro.pl\0agrinet.tn\0"
-"\xe3\x82\xb0\xe3\x83\xbc\xe3\x82\xb0\xe3\x83\xab\0verm\xc3\xb6gensberatung\0loginto.me\0nym.sk\0"
-"kiyokawa.kanagawa.jp\0kagamino.okayama.jp\0"
-"zt.ua\0"
-"barletta-trani-andria.it\0lima-city.at\0"
-"aeroport.fr\0"
-"kikonai.hokkaido.jp\0shell\0boomla.net\0"
-"nym.su\0"
-"pro.pr\0"
-"yokohama\0"
-"jobs.tt\0nym.sx\0"
-"club.aero\0journalism.museum\0symantec\0"
-"takamori.nagano.jp\0"
-"kamigori.hyogo.jp\0"
-"github.io\0"
-"reviews\0"
-"ariake.saga.jp\0lima-city.ch\0"
-"trentinos\xc3\xbc""dtirol.it\0"
-"mysecuritycamera.org\0nym.tw\0"
-"inzai.chiba.jp\0verisign\0"
-"nakagyo.kyoto.jp\0"
-"surf\0"
-"k12.tn.us\0"
-"apps.lair.io\0"
-"risor.no\0"
-"finn\xc3\xb8y.no\0"
-"kafjord.no\0"
-"ujitawara.kyoto.jp\0""64-b.it\0"
-"eu-1.evennode.com\0"
-"hamburg\0dvrcam.info\0"
-"minamiaiki.nagano.jp\0"
-"mt.eu.org\0"
-"abogado\0"
-"shimokawa.hokkaido.jp\0"
-"ninomiya.kanagawa.jp\0hatogaya.saitama.jp\0"
-"batsfjord.no\0"
-"kamikoani.akita.jp\0"
-"\xd9\x85\xd9\x84\xd9\x8a\xd8\xb3\xd9\x8a\xd8\xa7\0lenug.su\0"
-"samnanger.no\0"
-"gs.ol.no\0glade\0"
-"pro.tt\0\xd9\xbe\xd8\xa7\xd9\x83\xd8\xb3\xd8\xaa\xd8\xa7\xd9\x86\0"
-"hn.cn\0"
-"mihama.chiba.jp\0"
-"stavern.no\0"
-"bs.it\0kuji.iwate.jp\0kisosaki.mie.jp\0"
-"tydal.no\0\xe5\x85\xac\xe5\x8f\xb8.\xe9\xa6\x99\xe6\xb8\xaf\0"
-"cv.ua\0"
-"sakado.saitama.jp\0hospital\0"
-"sc.ke\0"
-"rec.nf\0"
-"takatsuki.shiga.jp\0"
-"\xe7\xb5\x84\xe7\xb9\x94.\xe9\xa6\x99\xe6\xb8\xaf\0teva\0square7.de\0"
-"yuasa.wakayama.jp\0"
-"choshi.chiba.jp\0"
-"shiroishi.miyagi.jp\0tottori.tottori.jp\0sc.kr\0pro.vn\0thruhere.net\0"
-"balashov.su\0cust.disrec.thingdust.io\0"
-"tw.cn\0yawara.ibaraki.jp\0"
-"lib.pr.us\0"
-"kitamoto.saitama.jp\0"
-"hurdal.no\0sling\0"
-"chonan.chiba.jp\0endofinternet.net\0"
-"githubusercontent.com\0"
-"sc.ls\0sogndal.no\0"
-"judaica.museum\0"
-"heguri.nara.jp\0"
-"cc.sc.us\0"
-"wajima.ishikawa.jp\0"
-"sec.ps\0"
-"masaki.ehime.jp\0augustow.pl\0"
-"imdb\0"
-"\xd1\x83\xd0\xbf\xd1\x80.\xd1\x81\xd1\x80\xd0\xb1\0hdfcbank\0"
-"landrover\0"
-"costume.museum\0"
-"*.compute.amazonaws.com.cn\0"
-"history.museum\0alsace\0"
-"karatsu.saga.jp\0"
-"fukushima.fukushima.jp\0nabari.mie.jp\0"
-"skype\0"
-"cc.na\0"
-"le.it\0rifu.miyagi.jp\0square7.ch\0"
-"fla.no\0watches\0backplaneapp.io\0definima.io\0"
-"mikasa.hokkaido.jp\0"
-"nyc.museum\0"
-"seranishi.hiroshima.jp\0nakatane.kagoshima.jp\0"
-"aya.miyazaki.jp\0custom.metacentrum.cz\0"
-"its.me\0harvestcelebration.museum\0abo.pa\0o.se\0"
-"limanowa.pl\0"
-"corvette.museum\0"
-"artsandcrafts.museum\0watchandclock.museum\0pors\xc3\xa1\xc5\x8bgu.no\0vard\xc3\xb8.no\0"
-"naruto.tokushima.jp\0"
-"devices.resinstaging.io\0"
-"rec.ro\0accenture\0"
-"boston.museum\0sciences.museum\0"
-"takayama.gifu.jp\0abashiri.hokkaido.jp\0"
-"dyndns-wiki.com\0"
-"solutions\0"
-"minamata.kumamoto.jp\0"
-"s\xc3\xb8r-aurdal.no\0"
-"ibaraki.ibaraki.jp\0"
-"fantasyleague.cc\0"
-"vet.br\0\xe5\xb2\xa9\xe6\x89\x8b.jp\0inabe.mie.jp\0"
-"pila.pl\0"
-"balestrand.no\0hornindal.no\0"
-"virgin\0"
-"hepforge.org\0"
-"ukiha.fukuoka.jp\0"
-"ol.no\0"
-"ufcfan.org\0"
-"ino.kochi.jp\0"
-"farmstead.museum\0"
-"community.museum\0land-4-sale.us\0"
-"kaneyama.yamagata.jp\0"
-"topology.museum\0\xc3\xa1laheadju.no\0aurskog-h\xc3\xb8land.no\0"
-"tec.ve\0"
-"kumakogen.ehime.jp\0ujiie.tochigi.jp\0"
-"idrett.no\0"
-"esp.br\0"
-"is-a-guru.com\0"
-"ikawa.akita.jp\0kamitsue.oita.jp\0"
-"\xe7\xb6\xb2\xe7\xb5\xa1.\xe9\xa6\x99\xe6\xb8\xaf\0"
-"alt.za\0xnbay.com\0"
-"ragusa.it\0"
-"scienceandindustry.museum\0holmestrand.no\0lib.wi.us\0"
-"minokamo.gifu.jp\0chikusei.ibaraki.jp\0definima.net\0"
-"uz.ua\0"
-"cal.it\0"
-"trento.it\0twmail.net\0"
-"aero\0halsa.no\0"
-"\xe5\xae\xae\xe5\xb4\x8e.jp\0"
-"rec.ve\0nohost.me\0"
-"mifune.kumamoto.jp\0"
-"skj\xc3\xa5k.no\0my.eu.org\0"
-"kuzumaki.iwate.jp\0"
-"net.ac\0academia.bo\0s3-ca-central-1.amazonaws.com\0"
-"dnsking.ch\0"
-"net.ae\0"
-"net.af\0umb.it\0"
-"net.ag\0alaheadju.no\0hobol.no\0aaa\0"
-"ojiya.niigata.jp\0yamanakako.yamanashi.jp\0"
-"net.ai\0communication.museum\0grong.no\0"
-"net.al\0imb.br\0cartier\0"
-"juif.museum\0bardu.no\0surnadal.no\0accesscam.org\0"
-"read\0"
-"net.ba\0kaluga.su\0"
-"net.ar\0net.bb\0aquila.it\0kuriyama.hokkaido.jp\0"
-"inazawa.aichi.jp\0chat\0"
-"net.au\0"
-"hemne.no\0"
-"net.bh\0abb\0"
-"windmill.museum\0spydeberg.no\0abc\0ditchyourip.com\0"
-"net.az\0citadel\0"
-"pccw\0"
-"okagaki.fukuoka.jp\0ginowan.okinawa.jp\0"
-"net.bm\0"
-"net.bn\0takazaki.miyazaki.jp\0"
-"net.bo\0askim.no\0l\xc3\xb8renskog.no\0sc.ug\0"
-"ap.it\0"
-"deals\0"
-"net.br\0sc.tz\0"
-"net.bs\0k12.al.us\0cc.ua\0"
-"net.bt\0tainai.niigata.jp\0kakinoki.shimane.jp\0pcloud.host\0"
-"stuff-4-sale.us\0"
-"gobo.wakayama.jp\0"
-"takikawa.hokkaido.jp\0"
-"net.ci\0"
-"net.bz\0my.id\0"
-"sc.us\0"
-"net.cm\0energy\0"
-"net.cn\0konan.aichi.jp\0biratori.hokkaido.jp\0"
-"net.co\0coupons\0"
-"ownip.net\0gotdns.ch\0"
-"gonohe.aomori.jp\0inawashiro.fukushima.jp\0jp.net\0"
-"net.cu\0coloradoplateau.museum\0giessen.museum\0aco\0"
-"act.edu.au\0net.cw\0"
-"shimodate.ibaraki.jp\0"
-"net.cy\0"
-"hjelmeland.no\0"
-"net.dm\0"
-"net.do\0"
-"joinville.br\0"
-"unj\xc3\xa1rga.no\0immo\0\xe5\xa4\xa7\xe6\x8b\xbf\0dyndns-web.com\0"
-"net.ec\0rennesoy.no\0"
-"komvux.se\0"
-"net.eg\0memorial.museum\0"
-"ads\0science\0"
-"net.dz\0minato.tokyo.jp\0"
-"aeg\0"
-"quest\0"
-"cymru.museum\0"
-"trentin-s\xc3\xbc""d-tirol.it\0"
-"muenchen.museum\0"
-"net.et\0"
-"h\xc3\xa1""bmer.no\0"
-"yonabaru.okinawa.jp\0"
-"loyalist.museum\0"
-"galsa.no\0s3-website-sa-east-1.amazonaws.com\0"
-"from-nv.com\0"
-"trentino-s\xc3\xbc""dtirol.it\0"
-"nl.eu.org\0"
-"england.museum\0"
-"afl\0"
+"hirokawa.fukuoka.jp\0midsund.no\0"
+"bronnoysund.no\0"
+"gon.pk\0"
+"edu.uy\0"
+"ayabe.kyoto.jp\0\xe9\xa3\x9e\xe5\x88\xa9\xe6\xb5\xa6\0"
+"massacarrara.it\0edu.vn\0virtualuser.de\0"
+"bardu.no\0"
+"stateofdelaware.museum\0richardli\0"
+"k12.va.us\0is-a-blogger.com\0"
+"kitakami.iwate.jp\0botany.museum\0l\xc3\xb8renskog.no\0"
+"v\xc3\xa5g\xc3\xa5.no\0"
+"edu.vu\0"
+"chiropractic.museum\0powiat.pl\0"
+"kawazu.shizuoka.jp\0"
+"gbiz\0"
+"cyon.link\0"
+"tjmaxx\0a.prod.fastly.net\0"
+"mihama.fukui.jp\0myeffect.net\0"
+"yasu.shiga.jp\0tran\xc3\xb8y.no\0"
+"cc.ms.us\0cc.nc.us\0edu.ws\0"
+"australia.museum\0"
+"balsan-sudtirol.it\0"
+"shinonsen.hyogo.jp\0"
+"furukawa.miyagi.jp\0uscountryestate.museum\0"
+"k12.co.us\0"
+"unj\xc3\xa1rga.no\0"
+"seto.aichi.jp\0is-a-hunter.com\0"
+"sv.it\0"
+"kushiro.hokkaido.jp\0naustdal.no\0"
+"egersund.no\0boleslawiec.pl\0h\xc3\xa4kkinen.fi\0"
"comunica\xc3\xa7\xc3\xb5""es.museum\0"
-"theater\0"
-"net.ge\0"
-"yamaga.kumamoto.jp\0"
-"urn.arpa\0net.gg\0"
-"bozen-suedtirol.it\0honjyo.akita.jp\0"
-"vik.no\0"
-"net.gl\0"
-"rindal.no\0glass\0"
-"net.gn\0"
-"tvedestrand.no\0internet-dns.de\0"
-"net.gp\0kozaki.chiba.jp\0rzgw.gov.pl\0ravendb.run\0"
-"dontexist.org\0"
-"net.gr\0nishimera.miyazaki.jp\0"
-"net.gt\0"
-"net.gu\0"
-"alabama.museum\0"
-"net.gy\0asso.eu.org\0freeddns.us\0"
-"net.hk\0gs.st.no\0fairwinds\0africa.com\0"
-"morena.br\0"
-"net.hn\0minamimaki.nagano.jp\0"
-"tagami.niigata.jp\0nakagawa.tokushima.jp\0"
-"name\0my-router.de\0"
-"net.ht\0net.id\0"
-"m.bg\0"
-"eu-west-1.elasticbeanstalk.com\0"
-"net.il\0"
-"net.im\0stathelle.no\0aig\0"
-"net.in\0modena.it\0"
-"from-wv.com\0"
-"net.iq\0\xc3\xa5lg\xc3\xa5rd.no\0hoteles\0"
-"net.ir\0williamhill\0"
-"net.is\0newspaper.museum\0"
-"niteroi.br\0"
-"net.je\0jewelry\0"
-"chuo.osaka.jp\0"
-"ap-southeast-1.elasticbeanstalk.com\0us-west-1.elasticbeanstalk.com\0"
-"hirono.fukushima.jp\0"
-"uri.arpa\0guernsey.museum\0lancashire.museum\0sn\xc3\xa5""ase.no\0"
-"soma.fukushima.jp\0onomichi.hiroshima.jp\0urausu.hokkaido.jp\0"
-"barreau.bj\0"
-"fujioka.gunma.jp\0komatsushima.tokushima.jp\0reit\0"
-"net.jo\0police.uk\0"
-"niiza.saitama.jp\0"
-"isa-geek.org\0"
-"la-spezia.it\0"
-"sm\xc3\xb8la.no\0barsy.info\0"
-"travelers\0"
-"ct.it\0kitagata.gifu.jp\0crown\0"
-"net.kg\0valle.no\0"
-"samegawa.fukushima.jp\0"
-"net.ki\0is-an-accountant.com\0"
-"nowtv\0"
-"in-addr.arpa\0"
-"6.bg\0"
-"oamishirasato.chiba.jp\0tarama.okinawa.jp\0net.kn\0"
-"net.la\0"
-"lucca.it\0net.lb\0"
-"net.lc\0"
-"net.kw\0"
-"midori.gunma.jp\0sayama.saitama.jp\0mincom.tn\0"
-"net.ky\0encyclopedic.museum\0*.0emm.com\0"
-"net.kz\0"
-"net.lk\0"
-"dgca.aero\0"
-"shirataka.yamagata.jp\0kinder\0"
-"ng.eu.org\0"
-"net.ma\0air.museum\0"
-"ogawa.nagano.jp\0net.lr\0"
-"net.ls\0is-a-socialist.com\0co.network\0"
-"net.me\0courses\0"
-"ichinomiya.chiba.jp\0kishiwada.osaka.jp\0net.lv\0"
-"sa.au\0fortmissoula.museum\0"
-"emb.kw\0net.ly\0"
-"net.mk\0lib.as.us\0luxury\0"
-"osaki.miyagi.jp\0net.ml\0"
-"hamura.tokyo.jp\0capital\0"
-"net.mo\0"
-"info\0"
-"oishida.yamagata.jp\0"
-"net.ms\0eigersund.no\0"
-"biella.it\0net.mt\0"
-"net.mu\0"
-"net.mv\0net.nf\0"
-"virtual.museum\0net.mw\0net.ng\0"
-"net.mx\0"
-"net.my\0net.ni\0cc.ct.us\0"
-"net.mz\0"
-"torino.museum\0"
-"uruma.okinawa.jp\0stalowa-wola.pl\0azure-mobile.net\0"
-"aarborte.no\0dnsfor.me\0"
-"odesa.ua\0"
-"nanbu.yamanashi.jp\0net.nr\0"
-"sa.cr\0"
+"user.party.eus\0za.net\0"
+"vibo-valentia.it\0"
+"abr.it\0dvrdns.org\0"
+"kasuga.fukuoka.jp\0namegawa.saitama.jp\0spot\0"
+"wpdevcloud.com\0jambyl.su\0"
+"\xe7\xbb\x84\xe7\xbb\x87.hk\0mb.it\0kamikoani.akita.jp\0mini\0"
+"police.uk\0"
+"edu.za\0domains\0"
+"\xd8\xa7\xd9\x84\xd9\x85\xd8\xba\xd8\xb1\xd8\xa8\0"
+"software\0"
+"en.it\0"
+"wa.au\0\xe9\x9d\x99\xe5\xb2\xa1.jp\0mint\0"
+"recht.pro\0"
+"opole.pl\0"
+"at.it\0"
+"mima.tokushima.jp\0"
+"takahagi.ibaraki.jp\0bokn.no\0edu.zm\0"
+"hiraya.nagano.jp\0eaton.mi.us\0"
+"mibu.tochigi.jp\0newspaper.museum\0aaa\0"
+"field.museum\0jp.net\0"
+"f.bg\0loginline.dev\0"
+"pup.gov.pl\0"
+"youth.museum\0voagat.no\0"
+"mobi.gp\0"
+"baghdad.museum\0"
+"cc.ua\0"
+"abc.br\0"
+"honefoss.no\0"
+"arboretum.museum\0abb\0"
+"nabari.mie.jp\0abc\0diamonds\0simple-url.com\0"
+"us-4.evennode.com\0"
+"act.edu.au\0"
+"ieee\0"
+"kyonan.chiba.jp\0"
+"mus.br\0asso.re\0"
+"yamatsuri.fukushima.jp\0"
+"czest.pl\0"
+"friuli-vegiulia.it\0lib.ut.us\0"
+"katsuura.chiba.jp\0"
+"hi.cn\0manchester.museum\0"
+"tenei.fukushima.jp\0"
+"\xe3\x82\xb0\xe3\x83\xbc\xe3\x82\xb0\xe3\x83\xab\0selfip.biz\0"
"lib.oh.us\0"
-"st.no\0"
-"taiji.wakayama.jp\0"
-"net.nz\0"
-"couchpotatofries.org\0"
-"search\0"
-"net.om\0"
-"pinb.gov.pl\0rent\0"
-"game-server.cc\0"
-"anz\0"
-"net.pa\0"
+"politica.bo\0"
+"iwaki.fukushima.jp\0"
+"akita.jp\0asahikawa.hokkaido.jp\0aco\0fashion\0"
+"s3-website.eu-central-1.amazonaws.com\0"
+"\xe3\x82\xb9\xe3\x83\x88\xe3\x82\xa2\0"
+"kiwi.nz\0"
+"takanabe.miyazaki.jp\0"
+"melbourne\0schwarz\0"
+"aoki.nagano.jp\0"
+"indian.museum\0travelersinsurance\0"
+"kunimi.fukushima.jp\0"
+"ads\0\xd9\x85\xd9\x88\xd9\x82\xd8\xb9\0"
+"yura.wakayama.jp\0aeg\0"
+"nsw.edu.au\0ciencia.bo\0nishihara.okinawa.jp\0"
+"sande.vestfold.no\0"
+"misugi.mie.jp\0\xe7\xb6\xb2\xe7\xb5\xa1.\xe9\xa6\x99\xe6\xb8\xaf\0"
+"jaguar\0"
+"lublin.pl\0"
+"nishiazai.shiga.jp\0\xe7\xbd\x91\xe5\xba\x97\0from-ks.com\0"
+"hizen.saga.jp\0risor.no\0"
+"vossevangen.no\0us-3.evennode.com\0"
+"siracusa.it\0fhs.no\0"
+"bergbau.museum\0"
+"sandnessjoen.no\0"
+"sld.do\0asso.nc\0"
+"takikawa.hokkaido.jp\0"
+"sodegaura.chiba.jp\0\xe0\xb8\x98\xe0\xb8\xb8\xe0\xb8\xa3\xe0\xb8\x81\xe0\xb8\xb4\xe0\xb8\x88.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0afl\0"
+"dental\0"
+"is-a-llama.com\0"
+"gda.pl\0"
+"deloitte\0"
+"inawashiro.fukushima.jp\0"
+"savannahga.museum\0kerryproperties\0\xe5\xa4\xa7\xe4\xbc\x97\xe6\xb1\xbd\xe8\xbd\xa6\0"
+"embaixada.st\0"
+"readthedocs.io\0"
+"sk\xc3\xa5nland.no\0"
+"frana.no\0"
+"cc.md.us\0"
+"selbu.no\0"
+"ollo\0"
+"biz.bb\0"
+"biz.at\0"
+"kinko.kagoshima.jp\0kushima.miyazaki.jp\0southwest.museum\0"
+"shiojiri.nagano.jp\0u.se\0"
+"ono.fukushima.jp\0ostroda.pl\0"
+"ce.gov.br\0orland.no\0snoasa.no\0"
+"biz.az\0"
+"charter.aero\0bunkyo.tokyo.jp\0"
+"shimane.jp\0"
+"maceio.br\0lc.it\0umaji.kochi.jp\0budapest\0"
+"higashi.okinawa.jp\0shimoda.shizuoka.jp\0aig\0"
+"higashi.fukushima.jp\0bd.se\0"
+"email\0"
+"shibata.niigata.jp\0kusatsu.shiga.jp\0columbia.museum\0vanguard\0"
+"trentinsudtirol.it\0"
+"and.mom\0"
+"pl.ua\0us-2.evennode.com\0"
+"nexus\0"
+"rennebu.no\0"
+"webspace.rocks\0"
+"maniwa.okayama.jp\0"
+"biz.cy\0"
+"taki.mie.jp\0biz.dk\0"
+"fujisawa.iwate.jp\0"
+"yosemite.museum\0"
+"datsun\0cloud66.ws\0"
+"half.host\0"
+"eniwa.hokkaido.jp\0"
+"circle\0worse-than.tv\0"
+"talk\0for.men\0"
+"cards\0"
+"asso.km\0"
+"izumi.kagoshima.jp\0kotoura.tottori.jp\0"
+"scholarships\0"
+"fujimino.saitama.jp\0jeonbuk.kr\0brussels.museum\0"
+"biz.et\0"
+"compare\0"
+"raholt.no\0"
+"usa.museum\0ap-southeast-1.elasticbeanstalk.com\0ng.city\0"
+"melhus.no\0"
+"coupons\0dynu.net\0"
+"kashiwa.chiba.jp\0"
+"bnpparibas\0"
+"moseushi.hokkaido.jp\0"
+"padua.it\0"
+"asso.mc\0"
+"bulsan-suedtirol.it\0rivne.ua\0my-wan.de\0"
+"historicalsociety.museum\0is-a-linux-user.org\0"
+"biz.gl\0"
+"hasuda.saitama.jp\0"
+"is-a-chef.org\0"
+"courses\0us-1.evennode.com\0"
+"shinjo.yamagata.jp\0"
+"stadt.museum\0"
+"trani-barletta-andria.it\0"
+"trader.aero\0cloudapps.digital\0"
+"mywire.org\0"
+"mashike.hokkaido.jp\0yamagata.ibaraki.jp\0unjarga.no\0"
+"sicilia.it\0"
+"morimachi.shizuoka.jp\0"
+"s3.dualstack.eu-west-2.amazonaws.com\0"
+"biz.id\0"
+"imageandsound.museum\0anz\0credit\0"
+"historical.museum\0jewelry.museum\0"
"aol\0"
-"friuli-veneziagiulia.it\0oiso.kanagawa.jp\0muika.niigata.jp\0"
-"artgallery.museum\0handson.museum\0net.pe\0on-aptible.com\0"
-"enna.it\0"
-"honefoss.no\0press\0"
-"net.ph\0etisalat\0"
-"s\xc3\xb8rum.no\0net.pk\0"
-"net.pl\0"
-"wios.gov.pl\0net.pn\0"
-"servepics.com\0"
-"marugame.kagawa.jp\0"
-"net.qa\0"
-"joso.ibaraki.jp\0tsubame.niigata.jp\0net.pr\0"
-"net.ps\0myfirewall.org\0"
-"bergamo.it\0rishirifuji.hokkaido.jp\0ina.nagano.jp\0kokubunji.tokyo.jp\0net.pt\0"
-"sweetpepper.org\0"
+"manno.kagawa.jp\0"
+"newyork.museum\0pubol.museum\0h\xc3\xa1mm\xc3\xa1rfeasta.no\0"
+"seihi.nagasaki.jp\0"
+"and.museum\0sdn.gov.pl\0"
+"bievat.no\0karasjohka.no\0"
+"us-east-2.elasticbeanstalk.com\0"
+"home.dyndns.org\0"
+"mt.eu.org\0"
+"government.aero\0"
+"selfip.com\0"
+"mitoyo.kagawa.jp\0kameoka.kyoto.jp\0"
+"vercelli.it\0"
+"geekgalaxy.com\0ptplus.fit\0"
"app\0"
-"benevento.it\0"
-"net.py\0"
-"akita.akita.jp\0"
-"s3-website-ap-northeast-1.amazonaws.com\0"
-"forgot.her.name\0"
-"shinshiro.aichi.jp\0"
-"scotland.museum\0"
-"\xe5\x85\xb5\xe5\xba\xab.jp\0"
-"sassari.it\0okuma.fukushima.jp\0"
-"mypi.co\0"
-"numazu.shizuoka.jp\0\xe7\xbb\x84\xe7\xbb\x87\xe6\x9c\xba\xe6\x9e\x84\0"
-"ris\xc3\xb8r.no\0"
-"fuefuki.yamanashi.jp\0bar\0"
-"bbc\0"
-"toscana.it\0atsugi.kanagawa.jp\0settsu.osaka.jp\0kusatsu.shiga.jp\0yamada.toyama.jp\0"
-"\xe0\xb8\xa3\xe0\xb8\xb1\xe0\xb8\x90\xe0\xb8\x9a\xe0\xb8\xb2\xe0\xb8\xa5.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
-"omitama.ibaraki.jp\0"
-"net.sa\0kindle\0"
-"net.sb\0"
-"net.sc\0"
-"net.sd\0dunlop\0"
-"net.ru\0myftp.org\0"
-"sekikawa.niigata.jp\0"
-"hemsedal.no\0net.rw\0net.sg\0navy\0"
-"niimi.okayama.jp\0net.sh\0"
-"kamifurano.hokkaido.jp\0art\0bbt\0"
-"kumejima.okinawa.jp\0net.sl\0"
-"broker.aero\0bcg\0"
-"fet.no\0net.so\0nsupdate.info\0"
-"dagestan.ru\0"
-"property\0"
-"iki.nagasaki.jp\0net.st\0bcn\0"
-"prof.pr\0net.th\0walter\0"
-"net.sy\0"
-"net.tj\0"
-"sor-varanger.no\0net.tm\0"
-"net.tn\0rest\0"
-"net.to\0"
-"unjarga.no\0net.ua\0dagestan.su\0"
-"net.tr\0"
-"cargo.aero\0"
-"aizubange.fukushima.jp\0kamo.niigata.jp\0net.tt\0"
-"society.museum\0ebiz.tw\0"
-"sa.it\0"
-"net.tw\0localhost.daplie.me\0"
-"net.uk\0cards\0organic\0"
-"hl.cn\0\xd0\xba\xd0\xbe\xd0\xbc\0""32-b.it\0"
-"diamonds\0"
-"naganohara.gunma.jp\0"
-"vennesla.no\0blogdns.org\0"
-"ca.it\0"
-"lib.co.us\0"
-"kyotango.kyoto.jp\0"
-"safety.aero\0net.vc\0\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4\xe0\xa4\xae\xe0\xa5\x8d\0cyon.link\0"
-"sandvikcoromant\0"
-"net.ve\0"
-"koge.tottori.jp\0guardian\0"
-"hof.no\0net.uy\0net.vi\0"
-"net.uz\0bet\0"
-"sakae.chiba.jp\0"
-"net.vn\0"
-"ekloges.cy\0bryne.no\0kpmg\0"
-"dyndns-home.com\0"
-"\xe5\xa4\xa7\xe5\x88\x86.jp\0higashimatsushima.miyagi.jp\0"
-"gmbh\0\xe7\xa7\xbb\xe5\x8a\xa8\0"
-"ct.us\0net.vu\0"
-"wsa.gov.pl\0"
-"gemological.museum\0"
-"pistoia.it\0travel.pl\0"
-"realtor\0"
-"vindafjord.no\0k12.mn.us\0viajes\0"
-"tysnes.no\0"
-"net.ws\0"
-"axa\0place\0visa\0isa-geek.com\0"
-"civilisation.museum\0aws\0u2-local.xnbay.com\0"
-"ppg.br\0"
-"\xe5\x95\x86\xe5\xba\x97\0"
-"kami.kochi.jp\0sado.niigata.jp\0"
-"cc.ca.us\0kerrylogistics\0"
-"puglia.it\0"
-"siljan.no\0"
-"toyohashi.aichi.jp\0"
-"xfinity\0"
-"lomza.pl\0bid\0"
-"evenes.no\0"
-"monmouth.museum\0ca.na\0"
-"lc.it\0"
-"lib.nm.us\0"
-"cloudaccess.net\0"
-"gs.hl.no\0lv.ua\0net.za\0""1337.pictures\0"
-"iwafune.tochigi.jp\0tokushima.tokushima.jp\0"
-"bio\0inc.hk\0"
-"m.se\0online\0"
-"seven\0"
-"sukumo.kochi.jp\0"
-"net.zm\0"
-"rochester.museum\0dynserv.org\0"
-"biz\0watari.miyagi.jp\0"
-"tokyo\0"
-"yasuoka.nagano.jp\0"
-"koshigaya.saitama.jp\0tjmaxx\0"
-"democracia.bo\0"
-"tur.ar\0"
-"stavanger.no\0theatre\0viva\0myds.me\0"
-"bilbao.museum\0webcam\0"
-"tienda\0"
-"hashimoto.wakayama.jp\0"
-"cosenza.it\0"
-"louvre.museum\0askoy.no\0boxfuse.io\0"
-"travel.tt\0"
-"\xd0\xb1\xd0\xb3\0is-a-celticsfan.org\0"
-"vivo\0cleverapps.io\0"
-"riopreto.br\0tur.br\0"
-"walmart\0"
-"manchester.museum\0"
-"asahi.nagano.jp\0"
-"valer.hedmark.no\0fh.se\0"
-"wiki.bo\0cc.ks.us\0\xe8\xb4\xad\xe7\x89\xa9\0"
-"homeip.net\0"
-"wiki.br\0imakane.hokkaido.jp\0"
-"snoasa.no\0"
-"kumagaya.saitama.jp\0"
-"tromsa.no\0"
-"hob\xc3\xb8l.no\0"
-"ecn.br\0koza.wakayama.jp\0"
-"krym.ua\0"
-"filegear-de.me\0"
-"toyama.toyama.jp\0"
-"rygge.no\0istmein.de\0"
-"jewish.museum\0usgarden.museum\0raisa.no\0endofinternet.org\0"
-"bms\0"
-"ryokami.saitama.jp\0"
-"\xe0\xb8\x84\xe0\xb8\xad\xe0\xb8\xa1\0"
-"haugesund.no\0bmw\0"
-"homeunix.net\0"
-"asn.au\0"
-"messina.it\0bnl\0"
-"lazio.it\0"
-"*.in.futurecms.at\0"
-"val-d-aosta.it\0pa.leg.br\0"
-"\xe9\xa3\x9e\xe5\x88\xa9\xe6\xb5\xa6\0"
-"gorlice.pl\0"
-"assn.lk\0bom\0"
-"kanna.gunma.jp\0"
-"timekeeping.museum\0boo\0"
-"ardal.no\0"
-"monza.it\0fukuoka.jp\0"
-"tksat.bo\0"
-"an.it\0bot\0"
-"sandnessjoen.no\0"
-"calvinklein\0report\0"
-"hl.no\0\xe9\x9b\xbb\xe8\xa8\x8a\xe7\x9b\x88\xe7\xa7\x91\0"
-"genova.it\0box\0"
-"epilepsy.museum\0geology.museum\0casino\0"
-"pordenone.it\0"
-"ostroda.pl\0"
-"tana.no\0"
-"tochigi.tochigi.jp\0"
-"opole.pl\0"
-"sucks\0"
-"cab\0"
-"artanddesign.museum\0"
-"webredirect.org\0"
-"kashiwa.chiba.jp\0pb.leg.br\0"
-"tele.amune.org\0dnsalias.com\0"
-"kiwi.nz\0\xd0\xb5\xd1\x8e\0honeywell\0"
-"ca.us\0"
+"design\0"
+"tickets\0"
+"rodoy.no\0sld.pa\0"
+"biz.ki\0company\0"
+"kunst.museum\0"
+"vb.it\0"
+"higashimatsuyama.saitama.jp\0"
+"bar\0"
+"bizen.okayama.jp\0f.se\0bbc\0"
+"kirovograd.ua\0"
+"kaizuka.osaka.jp\0"
+"*.bzz.dapps.earth\0"
+"askoy.no\0"
+"rollag.no\0"
+"hara.nagano.jp\0"
+"aostavalley.it\0"
+"vinnytsia.ua\0"
+"art\0bbt\0"
+"j\xc3\xb8rpeland.no\0"
+"biz.ls\0bcg\0"
+"joinville.br\0dabur\0phone\0is-a-chef.com\0"
+"yahaba.iwate.jp\0isahaya.nagasaki.jp\0kitamoto.saitama.jp\0"
+"001www.com\0"
+"bcn\0"
+"tsukuba.ibaraki.jp\0akrehamn.no\0\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa5\x8b\xe0\xa4\xa4\0"
+"yasugi.shimane.jp\0"
+"ks.ua\0"
+"ninomiya.kanagawa.jp\0"
+"ulsan.kr\0salon\0"
+"wa.us\0"
+"from-de.com\0"
+"audio\0"
+"yoshinogari.saga.jp\0biz.mv\0"
+"bulsan.it\0biz.mw\0"
+"freiburg.museum\0"
+"yusui.kagoshima.jp\0biz.ni\0"
+"s3-website.ap-south-1.amazonaws.com\0"
+"bofa\0"
+"2038.io\0"
+"boavista.br\0batsfjord.no\0from-ri.com\0ddns.net\0"
+"ks.us\0"
+"biz.nr\0marshalls\0"
+"crew.aero\0"
+"hi.us\0"
+"services.aero\0\xe8\xb4\xad\xe7\x89\xa9\0"
+"mo.cn\0yamato.kanagawa.jp\0masoy.no\0watch\0"
+"financial\0arvo.network\0"
+"agency\0"
+"myactivedirectory.com\0"
+"iide.yamagata.jp\0"
+"bet\0netlify.com\0"
+"tourism.tn\0"
+"cnpy.gdn\0"
+"pharmacy.museum\0"
+"nedre-eiker.no\0"
+"yugawa.fukushima.jp\0"
+"coach\0"
+"ujiie.tochigi.jp\0\xe4\xbc\x81\xe4\xb8\x9a\0"
+"nishinoomote.kagoshima.jp\0biz.pk\0"
+"biz.pl\0"
+"mobi.tt\0reisen\0"
+"tamaki.mie.jp\0"
+"okaya.nagano.jp\0"
+"okoppe.hokkaido.jp\0arita.saga.jp\0"
+"\xe5\xa4\xa7\xe9\x98\xaa.jp\0"
+"biz.pr\0"
+"living.museum\0mobi.tz\0"
+"dattoweb.com\0"
+"taxi\0"
+"axa\0"
+"dscloud.me\0"
+"owani.aomori.jp\0setagaya.tokyo.jp\0aws\0"
+"kaita.hiroshima.jp\0village.museum\0fuossko.no\0"
+"jfk.museum\0"
+"toei.aichi.jp\0"
+"maintenance.aero\0"
+"hatoyama.saitama.jp\0"
+"donna.no\0"
+"michigan.museum\0"
+"hjartdal.no\0"
+"bid\0"
+"gildeskal.no\0gulen.no\0"
+"tonami.toyama.jp\0"
+"bio\0"
+"sagamihara.kanagawa.jp\0tainai.niigata.jp\0cc.ut.us\0"
+"photo\0"
+"tokyo.jp\0marugame.kagawa.jp\0servecounterstrike.com\0"
+"bitballoon.com\0"
+"nishihara.kumamoto.jp\0voting\0my.eu.org\0"
+"biz.ss\0"
+"biz\0hasura.app\0"
+"ullensvang.no\0vard\xc3\xb8.no\0biz.tj\0"
+"okinawa.jp\0"
+"shimosuwa.nagano.jp\0madrid\0"
+"ven.it\0"
+"biz.ua\0"
+"biz.tr\0"
+"shiroishi.saga.jp\0"
+"ts.it\0biz.tt\0"
+"ricoh\0za.org\0"
+"trana.no\0"
+"on-aptible.com\0"
+"kakegawa.shizuoka.jp\0is-a-landscaper.com\0"
+"mobi.na\0lardal.no\0"
+"masuda.shimane.jp\0"
+"mo.it\0"
+"mobi.ng\0hammerfest.no\0stord.no\0"
+"database.museum\0"
+"aosta-valley.it\0"
+"is-a-cpa.com\0"
+"sakai.ibaraki.jp\0nakamura.kochi.jp\0"
+"tadotsu.kagawa.jp\0ethnology.museum\0ng.school\0"
+"aparecida.br\0"
+"go.gov.br\0emiliaromagna.it\0plc.ly\0"
+"bergen.no\0"
+"dyroy.no\0\xc3\xb8vre-eiker.no\0"
+"ca.it\0indianapolis.museum\0eidfjord.no\0"
+"biz.vn\0bond\0"
+"training\0"
+"oz.au\0"
+"mazowsze.pl\0"
+"s.bg\0"
+"9.bg\0for.mom\0"
+"bms\0scrysec.com\0"
+"misconfused.org\0"
+"asahi.toyama.jp\0bmw\0from-ga.com\0"
+"e164.arpa\0book\0"
+"\xc3\xb8ksnes.no\0"
+"volkenkunde.museum\0dynathome.net\0"
+"bergamo.it\0meeres.museum\0"
+"ngo.lk\0"
+"medical.museum\0"
+"mer\xc3\xa5ker.no\0\xc3\xb8rland.no\0\xe6\x9c\xba\xe6\x9e\x84\0"
+"lib.wi.us\0run.app\0"
+"tatebayashi.gunma.jp\0hjelmeland.no\0"
+"b\xc3\xb8mlo.no\0"
+"yabu.hyogo.jp\0gs.fm.no\0lib.sc.us\0trade\0"
+"mining.museum\0"
+"toride.ibaraki.jp\0"
+"bom\0"
+"boo\0"
+"birdart.museum\0"
+"of.work\0zapto.xyz\0"
+"bot\0"
+"nl.eu.org\0ybo.faith\0"
+"notogawa.shiga.jp\0denmark.museum\0bydgoszcz.pl\0box\0"
+"otofuke.hokkaido.jp\0dovre.no\0"
+"hemne.no\0abogado\0"
+"motobu.okinawa.jp\0gol.no\0"
+"toki.gifu.jp\0chattanooga.museum\0ca.na\0"
+"loseyourip.com\0"
+"iwamizawa.hokkaido.jp\0biz.zm\0"
+"mobi.ke\0cab\0"
+"fineart.museum\0"
"cal\0"
-"space.museum\0cam\0"
-"rankoshi.hokkaido.jp\0rawa-maz.pl\0"
-"zama.kanagawa.jp\0"
-"k12.mi.us\0cba\0"
+"cam\0"
+"samnanger.no\0"
+"commune.am\0"
+"lombardia.it\0cba\0*.quipelements.com\0"
"car\0"
-"journalist.aero\0synology-ds.de\0"
-"cat\0"
-"rehab\0"
-"r\xc3\xb8mskog.no\0"
-"dynv6.net\0"
-"tychy.pl\0"
-"cbn\0"
-"\xe3\x82\xbb\xe3\x83\xbc\xe3\x83\xab\0"
-"cbs\0stuff-4-sale.org\0"
-"shell.museum\0cloud.fedoraproject.org\0"
-"sport\0"
-"rsc.cdn77.org\0"
-"omachi.nagano.jp\0"
-"biev\xc3\xa1t.no\0tennis\0tiaa\0"
-"ichinoseki.iwate.jp\0"
-"time.museum\0"
-"trading.aero\0"
-"citi\0from-ma.com\0"
-"ks.ua\0twmail.org\0synology-diskstation.de\0"
-"anani.br\0dupont\0"
-"\xd0\xb8\xd0\xba\xd0\xbe\xd0\xbc.museum\0"
-"jpmorgan\0router.management\0"
-"lincoln\0lixil\0"
-"valle-aosta.it\0ceb\0"
-"city\0"
-"nuoro.it\0iheya.okinawa.jp\0"
-"saitama.jp\0kamimine.saga.jp\0"
-"ks.us\0"
-"nakano.nagano.jp\0"
-"patria.bo\0md.ci\0"
+"kitaaiki.nagano.jp\0nebraska.museum\0tourism.pl\0aetna\0co.com\0"
+"cat\0kitahata.saga.jp\0"
+"from-nj.com\0"
+"kyuragi.saga.jp\0"
+"apple\0"
+"ancona.it\0"
+"glas.museum\0ngo.ph\0cbn\0qc.com\0"
+"discount\0"
+"trentinos\xc3\xbc""d-tirol.it\0h\xc3\xa1pmir.no\0"
+"kokonoe.oita.jp\0amli.no\0cbs\0"
+"wada.nagano.jp\0dontexist.net\0"
+"versailles.museum\0latrobe\0"
+"kafjord.no\0"
+"\xe5\xb2\xa1\xe5\xb1\xb1.jp\0"
+"horonobe.hokkaido.jp\0lerdal.no\0"
+"kumakogen.ehime.jp\0"
+"r\xc3\xa5holt.no\0\xd0\xb1\xd0\xb3\0"
+"eq.edu.au\0contagem.br\0shimotsuke.tochigi.jp\0"
+"takagi.nagano.jp\0"
+"k12.de.us\0ar.com\0"
+"kitakata.miyazaki.jp\0telekommunikation.museum\0"
+"allfinanz\0"
+"sekikawa.niigata.jp\0plc.uk\0"
+"la-spezia.it\0k12.ak.us\0"
+"ceb\0mckinsey\0sling\0"
+"qpon\0"
+"hazu.aichi.jp\0"
"ceo\0"
-"cfa\0from-pa.com\0"
-"tono.iwate.jp\0r.cdn77.net\0"
-"artdeco.museum\0civilization.museum\0bodo.no\0kiev.ua\0"
-"fujisato.akita.jp\0obama.nagasaki.jp\0cfd\0"
-"int.ar\0"
-"klabu.no\0radio\0"
+"kawanishi.nara.jp\0cfa\0"
+"tromsa.no\0"
+"cfd\0"
+"kyowa.hokkaido.jp\0"
+"ng.eu.org\0"
"buy\0"
-"ddnsgeek.com\0servesarcasm.com\0"
-"olbia-tempio.it\0"
-"k.bg\0\xc3\xb8rsta.no\0skodje.no\0"
-"int.az\0otsuki.kochi.jp\0""16-b.it\0"
-"mine.nu\0"
-"naie.hokkaido.jp\0"
-"int.bo\0algard.no\0"
-"trentino-s\xc3\xbc""d-tirol.it\0"
-"khakassia.su\0"
-"kure.hiroshima.jp\0land\0"
-"s\xc3\xb8rfold.no\0"
-"kaisei.kanagawa.jp\0ohira.tochigi.jp\0"
-"grane.no\0codespot.com\0"
-"shikabe.hokkaido.jp\0targi.pl\0"
-"takayama.nagano.jp\0itoigawa.niigata.jp\0zachpomor.pl\0"
-"empresa.bo\0int.ci\0"
-"mochizuki.nagano.jp\0"
-"is-very-good.org\0webhop.org\0"
-"fortal.br\0sr.it\0\xda\x80\xd8\xa7\xd8\xb1\xd8\xaa\0"
-"per.la\0"
-"int.co\0gjerdrum.no\0"
-"vanguard\0"
-"saltdal.no\0"
-"magazine.aero\0"
-"sciencesnaturelles.museum\0\xc3\xa5snes.no\0"
-"cr.it\0"
-"bievat.no\0lib.fl.us\0"
-"obihiro.hokkaido.jp\0"
-"ringebu.no\0cc.wi.us\0"
-"4.bg\0"
-"higashi.fukuoka.jp\0"
-"l\xc3\xb8""dingen.no\0est-le-patron.com\0"
-"mod.gi\0naturalhistorymuseum.museum\0hemnes.no\0"
-"tadotsu.kagawa.jp\0"
-"missoula.museum\0supply\0cable-modem.org\0"
-"schmidt\0dynu.net\0nerdpol.ovh\0"
-"getmyip.com\0"
-"asn.lv\0"
-"zapto.org\0"
-"kyowa.akita.jp\0now.sh\0"
-"lancome\0"
-"odo.br\0shunan.yamaguchi.jp\0per.nf\0"
-"nsn.us\0"
-"salvador.br\0omaezaki.shizuoka.jp\0bzh\0"
-"circus.museum\0"
-"unnan.shimane.jp\0"
-"gripe\0"
-"shriram\0"
-"cnt.br\0nikaho.akita.jp\0meiwa.gunma.jp\0"
-"omega\0otsuka\0"
-"toyoake.aichi.jp\0omura.nagasaki.jp\0"
-"extraspace\0"
-"game-host.org\0"
-"udine.it\0\xd1\x80\xd1\x84\0"
-"bulsan-suedtirol.it\0iglesiascarbonia.it\0"
-"niki.hokkaido.jp\0"
-"from-va.com\0"
-"noshiro.akita.jp\0agano.niigata.jp\0"
-"vega.no\0"
-"lt.it\0suwalki.pl\0"
-"yahiko.niigata.jp\0"
-"usarts.museum\0hoyanger.no\0from-wa.com\0"
-"oita.oita.jp\0"
-"\xe3\x81\xbf\xe3\x82\x93\xe3\x81\xaa\0"
-"childrensgarden.museum\0"
-"tarnobrzeg.pl\0\xe0\xa6\xac\xe0\xa6\xbe\xe0\xa6\x82\xe0\xa6\xb2\xe0\xa6\xbe\0"
-"tajiri.osaka.jp\0toyono.osaka.jp\0"
-"auto.pl\0cloudycluster.net\0"
-"compare\0"
-"barsy.club\0"
-"r\xc3\xb8yrvik.no\0kids.us\0"
-"trentinoaadige.it\0"
-"saga.saga.jp\0"
-"gs.vf.no\0zp.ua\0"
-"tokyo.jp\0stargard.pl\0kred\0"
-"int.is\0"
-"nx.cn\0molise.it\0isa-geek.net\0"
-"im.it\0"
-"hyogo.jp\0toei.aichi.jp\0"
-"vaga.no\0"
-"jelenia-gora.pl\0"
-"kvalsund.no\0"
-"pi.leg.br\0"
-"pilot.aero\0per.sg\0"
-"trieste.it\0shimizu.hokkaido.jp\0seika.kyoto.jp\0"
-"television.museum\0"
-"coupon\0"
-"bykle.no\0cc.md.us\0"
-"com\0dscloud.mobi\0"
-"dattoweb.com\0"
-"tr.eu.org\0"
-"tamba.hyogo.jp\0dynalias.net\0"
-"int.la\0"
-"teramo.it\0"
-"lyngen.no\0"
-"shimotsuke.tochigi.jp\0"
-"secure\0"
-"americanantiques.museum\0"
-"cooking\0"
-"\xd0\xbc\xd0\xba\xd0\xb4\0"
-"int.lk\0ambulance.museum\0"
-"takashima.shiga.jp\0"
-"unusualperson.com\0"
-"tushu\0"
-"dad\0"
-"2000.hu\0luroy.no\0"
-"iamallama.com\0"
-"radio.br\0"
-"romsa.no\0"
-"wi.us\0"
-"noheji.aomori.jp\0nowruz\0"
-"ozu.ehime.jp\0"
-"arna.no\0ro.im\0"
-"xj.cn\0"
-"ato.br\0"
-"vagan.no\0day\0"
-"ro.it\0int.mv\0construction\0freebox-os.fr\0"
-"int.mw\0"
-"int.ni\0"
-"gz.cn\0capetown\0"
-"company\0"
-"qsl.br\0"
-"alfaromeo\0crs\0csc\0video\0"
-"sp.gov.br\0bo.it\0"
-"anamizu.ishikawa.jp\0sakae.nagano.jp\0"
-"cr.ua\0"
-"cloudfunctions.net\0"
-"siena.it\0"
-"tips\0"
-"ashiya.hyogo.jp\0"
-"myactivedirectory.com\0"
-"kaminoyama.yamagata.jp\0"
-"from-ca.com\0"
-"tobe.ehime.jp\0nikko.tochigi.jp\0sko.gov.pl\0"
-"otago.museum\0washingtondc.museum\0"
-"shiranuka.hokkaido.jp\0"
-"oceanographic.museum\0rana.no\0"
-"divtasvuodna.no\0"
-"vf.no\0meloy.no\0k12.mt.us\0insurance\0"
-"koebenhavn.museum\0aigo\0dds\0"
-"oyer.no\0netlify.com\0"
-"shakotan.hokkaido.jp\0"
-"\xd0\xbc\xd0\xbe\xd0\xbd\0"
-"int.pt\0"
-"\xe6\x95\x99\xe8\x82\xb2.\xe9\xa6\x99\xe6\xb8\xaf\0"
-"from-ia.com\0"
-"hita.oita.jp\0"
-"\xd0\xbe\xd0\xb1\xd1\x80.\xd1\x81\xd1\x80\xd0\xb1\0"
-"\xd8\xa7\xdb\x8c\xd8\xb1\xd8\xa7\xd9\x86\0"
-"seihi.nagasaki.jp\0"
-"geekgalaxy.com\0"
-"taketa.oita.jp\0mutual\0"
-"dev\0"
-"research.aero\0mytis.ru\0"
-"gratangen.no\0"
-"mihara.kochi.jp\0gyokuto.kumamoto.jp\0"
-"takaishi.osaka.jp\0so.gov.pl\0"
-"from-ga.com\0"
-"furubira.hokkaido.jp\0ayabe.kyoto.jp\0"
-"lt.ua\0s3-website.eu-west-3.amazonaws.com\0"
-"tateyama.chiba.jp\0ohira.miyagi.jp\0pe.leg.br\0"
-"larvik.no\0verdal.no\0"
-"geometre-expert.fr\0"
-"int.ru\0"
-"biz.bb\0"
-"int.rw\0k.se\0"
-"hakata.fukuoka.jp\0czest.pl\0biz.at\0"
-"wildlife.museum\0spreadbetting\0"
-"otaki.chiba.jp\0suzu.ishikawa.jp\0"
-"mydobiss.com\0"
-"stpetersburg.museum\0cc.oh.us\0zone\0diskstation.me\0"
-"biz.az\0miasta.pl\0"
-"ask\xc3\xb8y.no\0"
-"yoshimi.saitama.jp\0"
-"md.us\0physio\0"
-"maebashi.gunma.jp\0"
-"ferrara.it\0"
-"dhl\0scrapper-site.net\0"
-"ann-arbor.mi.us\0"
-"int.tj\0"
-"lifestyle\0"
-"ishikawa.fukushima.jp\0"
-"diskstation.eu\0"
-"toyooka.hyogo.jp\0oi.kanagawa.jp\0"
-"maringa.br\0\xd8\xa7\xdb\x8c\xd8\xb1\xd8\xa7\xd9\x86.ir\0"
-"kragero.no\0vinnica.ua\0co.place\0"
-"blogdns.net\0"
-"int.tt\0"
-"baidar.no\0\xd0\xbe\xd0\xb4.\xd1\x81\xd1\x80\xd0\xb1\0"
-"biz.cy\0law.pro\0"
-"biz.dk\0"
-"fuchu.tokyo.jp\0for-some.biz\0"
-"*.sch.uk\0cc.la.us\0"
-"shintoku.hokkaido.jp\0"
-"airport.aero\0study\0"
-"int.ve\0diy\0grocery\0certmgr.org\0"
-"hiphop\0"
-"booking\0homeunix.org\0"
-"matsushige.tokushima.jp\0"
-"ts.it\0"
-"wajiki.tokushima.jp\0int.vn\0"
-"ltd.co.im\0"
-"hawaii.museum\0"
-"chikuzen.fukuoka.jp\0"
-"est-a-la-masion.com\0"
-"biz.et\0"
-"marriott\0"
+"ar.it\0"
+"mol.it\0"
+"leclerc\0skype\0"
+"sp.leg.br\0"
+"ac.ae\0d.bg\0"
+"*.bd\0kanzaki.saga.jp\0"
+"software.aero\0"
+"kartuzy.pl\0"
+"app.banzaicloud.io\0"
+"toyotsu.fukuoka.jp\0"
+"miyazaki.jp\0lima-city.rocks\0"
+"music.museum\0"
+"s3-us-gov-west-1.amazonaws.com\0"
+"mo.us\0vegas\0"
+"router.management\0"
+"ac.at\0ikeda.gifu.jp\0shobara.hiroshima.jp\0yamazoe.nara.jp\0"
+"ac.be\0naturalsciences.museum\0fairwinds\0"
+"ozu.kumamoto.jp\0"
+"baths.museum\0"
+"*.ck\0"
+"\xe0\xac\xad\xe0\xac\xbe\xe0\xac\xb0\xe0\xac\xa4\0"
+"cymru\0"
+"fukagawa.hokkaido.jp\0ca.us\0"
+"communications.museum\0berlevag.no\0int.eu.org\0"
+"ac.ci\0bolzano.it\0"
+"yakage.okayama.jp\0sarpsborg.no\0"
+"trentins\xc3\xbc""dtirol.it\0st.no\0"
+"ac.cn\0\xd0\xb5\xd1\x8e\0"
+"biella.it\0latino\0"
+"monster\0is-a-chef.net\0"
+"m\xc3\xa1latvuopmi.no\0ubank\0"
+"srv.br\0ac.cr\0"
+"tama.tokyo.jp\0"
+"aramco\0"
+"\xe5\xae\xb6\xe9\x9b\xbb\0"
+"ac.cy\0g\xc3\xa1ls\xc3\xa1.no\0bzh\0"
+"komagane.nagano.jp\0"
+"freeboxos.com\0"
+"\xe5\x95\x86\xe6\xa5\xad.tw\0"
+"sucks\0"
+"ybo.review\0"
+"*.er\0"
+"fujioka.gunma.jp\0"
+"leg.br\0"
+"algard.no\0"
+"suzu.ishikawa.jp\0"
+"*.fj\0sado.niigata.jp\0"
+"*.fk\0"
+"loginline.app\0"
+"napoli.it\0"
+"norton\0"
+"luzern.museum\0"
+"kitadaito.okinawa.jp\0ngo.za\0dyndns-office.com\0"
+"automotive.museum\0uw.gov.pl\0"
+"minowa.nagano.jp\0valer.hedmark.no\0"
+"takatsuki.shiga.jp\0"
+"casino\0"
+"kagoshima.kagoshima.jp\0vindafjord.no\0ntdll.top\0"
+"gs.oslo.no\0tvedestrand.no\0ap-south-1.elasticbeanstalk.com\0mein-vigor.de\0"
+"\xe5\xb1\xb1\xe5\xbd\xa2.jp\0uonuma.niigata.jp\0"
+"k12.mn.us\0"
+"oum.gov.pl\0kerrylogistics\0"
+"abarth\0"
+"education.tas.edu.au\0asahi.chiba.jp\0"
"apigee.io\0"
-"yuu.yamaguchi.jp\0"
-"natal.br\0hachinohe.aomori.jp\0"
-"sayama.osaka.jp\0"
-"9guacu.br\0budapest\0"
-"camera\0"
-"showa.gunma.jp\0"
-"eating-organic.net\0"
-"hirata.fukushima.jp\0"
-"wales\0dnsdojo.org\0"
-"snasa.no\0stream\0dontexist.com\0"
-"kuokgroup\0\xd8\xb9\xd8\xb1\xd8\xa8\0"
-"m\xc3\xa5s\xc3\xb8y.no\0"
-"nishi.fukuoka.jp\0"
-"ddnss.org\0"
-"ritto.shiga.jp\0"
-"n\xc3\xa6r\xc3\xb8y.no\0"
-"al.it\0"
-"isla.pr\0"
-"ide.kyoto.jp\0"
-"tecnologia.bo\0"
-"biz.id\0"
-"zaporizhzhia.ua\0"
-"kppsp.gov.pl\0dnp\0"
-"birkenes.no\0"
-"omuta.fukuoka.jp\0"
-"\xe6\x94\xbf\xe5\xba\x9c.\xe9\xa6\x99\xe6\xb8\xaf\0"
-"carbonia-iglesias.it\0"
-"arai.shizuoka.jp\0hokuto.yamanashi.jp\0"
-"dog\0"
-"nara.nara.jp\0"
-"swidnica.pl\0"
-"storage\0"
+"uzhgorod.ua\0"
+"ac.gn\0enterprises\0sandvik\0health-carereform.com\0"
+"dsmynas.com\0"
"from-ny.net\0"
-"brussel.museum\0stordal.no\0"
-"mitane.akita.jp\0"
-"botanicgarden.museum\0asker.no\0"
-"judygarland.museum\0"
-"ne.jp\0yono.saitama.jp\0dot\0"
-"hiji.oita.jp\0oshima.tokyo.jp\0futurehosting.at\0"
-"pri.ee\0ne.ke\0atlanta.museum\0"
-"gold\0"
-"golf\0"
-"oh.us\0"
-"sr.gov.pl\0"
+"ehime.jp\0tokoname.aichi.jp\0"
+"seiro.niigata.jp\0"
+"oksnes.no\0"
+"\xe3\x82\xb3\xe3\x83\xa0\0"
+"tools\0"
+"isa.us\0cloud\0"
+"s.se\0raid\0"
+"fam.pk\0"
+"lanbib.se\0kiwi\0*.dweb.link\0"
+"ako.hyogo.jp\0"
+"gwangju.kr\0"
+"aomori.aomori.jp\0wallonie.museum\0"
+"andria-barletta-trani.it\0ass.km\0sorreisa.no\0"
+"arna.no\0"
+"ac.id\0"
+"dagestan.ru\0"
+"futtsu.chiba.jp\0shell\0"
+"gr.com\0"
+"shikokuchuo.ehime.jp\0"
+"ac.il\0aibetsu.hokkaido.jp\0"
+"ac.im\0eu-west-2.elasticbeanstalk.com\0"
+"com\0ac.in\0"
+"money.museum\0"
+"art.br\0*.jm\0"
+"virtuel.museum\0vipsinaapp.com\0"
+"ac.ir\0\xd8\xa7\xdb\x8c\xd8\xb1\xd8\xa7\xd9\x86.ir\0cpa\0"
+"izumisano.osaka.jp\0dagestan.su\0"
"como.it\0"
-"biz.ki\0cc.al.us\0"
-"sarufutsu.hokkaido.jp\0arida.wakayama.jp\0"
-"mashiko.tochigi.jp\0chizu.tottori.jp\0bosch\0global\0beep.pl\0"
-"izumizaki.fukushima.jp\0ne.kr\0pr.leg.br\0"
-"samsung\0"
-"realestate.pl\0"
-"daito.osaka.jp\0asaka.saitama.jp\0"
-"kiho.mie.jp\0"
-"gloppen.no\0porsangu.no\0"
-"snaase.no\0uk.eu.org\0"
-"bologna.it\0eat\0"
-"yaita.tochigi.jp\0"
-"kawagoe.mie.jp\0kalisz.pl\0tourism.tn\0"
-"al.no\0"
-"biz.ls\0cc.ne.us\0is-a-liberal.com\0"
-"mb.ca\0"
-"higashikurume.tokyo.jp\0"
-"kv\xc3\xa6nangen.no\0la.us\0"
-"ginan.gifu.jp\0"
-"*.hosting.myjino.ru\0lima-city.rocks\0"
-"!city.nagoya.jp\0"
-"k12.vi.us\0ap-northeast-2.elasticbeanstalk.com\0"
-"legnica.pl\0"
-"rich\0"
-"goog\0*.transurl.be\0"
-"oketo.hokkaido.jp\0biz.mv\0starostwo.gov.pl\0"
-"biz.mw\0vegarshei.no\0eco\0is-very-sweet.org\0blogsyte.com\0"
-"fujikawa.yamanashi.jp\0"
-"biz.ni\0"
-"lig.it\0napoli.it\0aioi.hyogo.jp\0okuizumo.shimane.jp\0"
-"gallo\0"
-"tohma.hokkaido.jp\0rep.kp\0"
-"i.bg\0"
-"taishin.fukushima.jp\0sumita.iwate.jp\0hamatama.saga.jp\0"
-"yk.ca\0reise\0"
-"iwaki.fukushima.jp\0biz.nr\0"
-"andebu.no\0karaganda.su\0"
-"hamada.shimane.jp\0"
-"finland.museum\0helsinki.museum\0"
-"onagawa.miyagi.jp\0"
-"zone.id\0"
-"gob.ar\0"
+"pisa.it\0"
+"*.kh\0from-fl.com\0"
+"trentino-suedtirol.it\0bauern.museum\0leitungsen.de\0*.ex.futurecms.at\0"
+"if.ua\0"
+"hiranai.aomori.jp\0"
+"ac.jp\0omachi.saga.jp\0"
+"holtalen.no\0"
+"xz.cn\0friuli-vgiulia.it\0mamurogawa.yamagata.jp\0artgallery.museum\0"
+"minamiuonuma.niigata.jp\0meguro.tokyo.jp\0ac.ke\0dad\0fund\0"
+"nl.ca\0"
+"etisalat\0"
+"namegata.ibaraki.jp\0star\0"
+"ikeda.osaka.jp\0is-an-actor.com\0"
+"art.do\0missoula.museum\0larvik.no\0us-east-1.amazonaws.com\0stuff-4-sale.us\0"
+"news.hu\0monza-brianza.it\0studio\0eu.com\0"
+"udi.br\0ac.kr\0"
+"taiji.wakayama.jp\0"
+"shimane.shimane.jp\0"
+"gent\0"
+"marumori.miyagi.jp\0"
+"art.dz\0"
+"toyoake.aichi.jp\0yokosuka.kanagawa.jp\0"
+"ar.us\0aquarelle\0day\0"
+"ac.lk\0fundacio.museum\0"
+"indiana.museum\0fr\xc3\xb8ya.no\0hiphop\0"
+"h\xc3\xa6gebostad.no\0warmia.pl\0"
+"*.mm\0"
+"trieste.it\0ac.ma\0"
+"ac.ls\0"
+"crs\0csc\0"
+"firenze.it\0ac.me\0"
+"misaki.okayama.jp\0"
+"\xe5\xb1\xb1\xe5\x8f\xa3.jp\0murmansk.su\0"
+"ikeda.hokkaido.jp\0"
+"ogawara.miyagi.jp\0koryo.nara.jp\0"
+"cloudeity.net\0"
+"olbia-tempio.it\0"
+"air-surveillance.aero\0"
+"koya.wakayama.jp\0"
+"kurotaki.nara.jp\0*.np\0"
+"\xd1\x80\xd1\x84\0xen.prgmr.com\0"
+"macapa.br\0ac.mu\0tjome.no\0"
+"now-dns.top\0"
+"ac.mw\0spjelkavik.no\0"
+"sologne.museum\0"
+"tokorozawa.saitama.jp\0ac.ni\0from-ne.com\0"
+"ac.mz\0meraker.no\0"
+"vagsoy.no\0"
+"loans\0"
+"yoshioka.gunma.jp\0prochowice.pl\0"
+"cafe\0dds\0"
+"schoenbrunn.museum\0"
+"kongsberg.no\0"
+"matsumoto.kagoshima.jp\0"
+"gets-it.net\0"
+"hioki.kagoshima.jp\0ac.nz\0*.pg\0"
+"padova.it\0kawasaki.miyagi.jp\0ohira.miyagi.jp\0"
+"mozilla-iot.org\0"
+"kita.osaka.jp\0"
+"cal.it\0lancia\0"
+"s3-website-ap-southeast-2.amazonaws.com\0"
+"tohma.hokkaido.jp\0"
+"ac.pa\0"
+"art.ht\0cyber.museum\0"
+"himi.toyama.jp\0"
+"s3.dualstack.ca-central-1.amazonaws.com\0"
+"unazuki.toyama.jp\0"
+"chita.aichi.jp\0dev\0"
+"omasvuotna.no\0cc.wa.us\0"
+"yuzawa.niigata.jp\0"
+"utsira.no\0"
+"definima.io\0"
+"iwanai.hokkaido.jp\0iwaizumi.iwate.jp\0"
+"fujikawa.yamanashi.jp\0koshu.yamanashi.jp\0k12.me.us\0"
+"kuokgroup\0from-nv.com\0navoi.su\0"
+"ac.pr\0"
+"eastcoast.museum\0is-a-republican.com\0"
+"cc.ks.us\0"
+"kitagawa.miyazaki.jp\0"
+"cc.hi.us\0reg.dk\0"
+"bozen.it\0"
+"hatogaya.saitama.jp\0us-gov-west-1.elasticbeanstalk.com\0"
+"d.se\0"
+"\xe6\x96\xb0\xe6\xbd\x9f.jp\0"
+"helsinki.museum\0"
+"saga.saga.jp\0"
+"club.tw\0accenture\0"
+"crafting.xyz\0"
+"\xe7\x86\x8a\xe6\x9c\xac.jp\0dhl\0"
+"aeroport.fr\0asago.hyogo.jp\0"
+"hofu.yamaguchi.jp\0"
+"monmouth.museum\0"
+"isernia.it\0glass.museum\0"
+"ski.museum\0"
+"kids.museum\0ac.rs\0"
+"toho.fukuoka.jp\0"
+"ac.ru\0ac.se\0certmgr.org\0"
+"ac.rw\0afamilycompany\0"
+"cn.it\0"
+"plaza.museum\0"
+"murakami.niigata.jp\0inami.toyama.jp\0fr\xc3\xa6na.no\0yokohama\0"
+"mishima.fukushima.jp\0abira.hokkaido.jp\0"
+"bod\xc3\xb8.no\0"
+"macys\0"
+"ichikawa.chiba.jp\0"
+"valleaosta.it\0salerno.it\0"
+"taishi.hyogo.jp\0"
+"iveco\0zuerich\0"
+"ac.th\0"
+"omigawa.chiba.jp\0"
+"ac.sz\0ac.tj\0diy\0"
+"tsuwano.shimane.jp\0\xc4\x8d\xc3\xa1hcesuolo.no\0"
+"warman\0"
+"palmas.br\0ok.us\0"
+"gub.uy\0"
+"linkitools.space\0"
+"la.us\0"
+"s3-ap-northeast-2.amazonaws.com\0"
+"ac.ug\0"
+"uji.kyoto.jp\0ando.nara.jp\0ac.tz\0"
+"ac.uk\0call\0"
+"bialystok.pl\0"
+"test.tj\0google\0"
+"for.one\0"
+"fi.cr\0"
+"shimamoto.osaka.jp\0"
+"barsycenter.com\0"
+"hyuga.miyazaki.jp\0"
+"video.hu\0ac.vn\0"
+"floripa.br\0camp\0"
+"hirono.iwate.jp\0internet-dns.de\0"
+"ino.kochi.jp\0"
+"nl.no\0"
+"lib.fl.us\0fin.ci\0"
+"ohira.tochigi.jp\0tokke.no\0"
+"porsanger.no\0"
+"kashiba.nara.jp\0"
+"art.pl\0"
+"leasing.aero\0veneto.it\0olayan\0"
+"giske.no\0"
+"seljord.no\0dev-myqnapcloud.com\0"
+"sport\0azure-mobile.net\0"
+"weatherchannel\0"
+"\xe6\x95\x99\xe8\x82\xb2.\xe9\xa6\x99\xe6\xb8\xaf\0booking\0"
+"nango.fukushima.jp\0sandnessj\xc3\xb8""en.no\0"
+"*.ye\0"
+"cadaques.museum\0"
+"idv.hk\0pharmacy\0"
+"gehirn.ne.jp\0"
+"fin.ec\0"
+"sykkylven.no\0dnp\0"
+"fermo.it\0test.ru\0"
+"myftp.org\0"
+"valle-daosta.it\0"
+"harima.hyogo.jp\0miyoshi.saitama.jp\0"
+"recreation.aero\0reggiocalabria.it\0dog\0"
+"katsuragi.nara.jp\0"
+"judaica.museum\0"
+"yuu.yamaguchi.jp\0"
+"kunitachi.tokyo.jp\0"
+"myravendb.com\0"
+"ac.za\0"
+"yorkshire.museum\0mel\xc3\xb8y.no\0qa2.com\0"
+"hornindal.no\0k12.or.us\0"
+"dot\0"
+"aviation.museum\0bosch\0"
+"um.gov.pl\0"
+"art.sn\0"
+"tagami.niigata.jp\0ac.zm\0"
+"oketo.hokkaido.jp\0"
+"yokoshibahikari.chiba.jp\0syncloud.it\0"
+"is-a-photographer.com\0"
+"filegear-au.me\0"
+"bolivia.bo\0open\0"
+"care\0team\0"
+"eastafrica.museum\0"
+"vennesla.no\0"
+"k12.az.us\0ac.zw\0analytics\0"
+"arts.co\0game-server.cc\0dyndns.ddnss.de\0"
+"jetzt\0swidnik.pl\0hk.com\0"
+"ueno.gunma.jp\0"
+"shari.hokkaido.jp\0casa\0"
+"localhistory.museum\0"
+"trentino-altoadige.it\0miyazu.kyoto.jp\0cars\0"
+"control.aero\0shoo.okayama.jp\0"
+"sola.no\0case\0"
+"shintoku.hokkaido.jp\0zoological.museum\0eat\0"
+"is.it\0cash\0"
+"fetsund.no\0"
+"fi.it\0"
+"rimini.it\0"
+"tech\0dyn.ddnss.de\0"
+"minamitane.kagoshima.jp\0"
+"bo.it\0is-a-soxfan.org\0"
+"investments\0lexus\0"
+"fuel.aero\0"
+"\xe0\xa6\xac\xe0\xa6\xbe\xe0\xa6\x82\xe0\xa6\xb2\xe0\xa6\xbe\0"
+"q.bg\0valledaosta.it\0"
+"vacations\0"
+"7.bg\0eco\0"
+"id.au\0barsy.menu\0"
+"cn.ua\0"
+"kawaue.gifu.jp\0"
+"aland.fi\0app.os.fedoraproject.org\0"
+"r\xc3\xb8st.no\0us.gov.pl\0study\0"
+"mie.jp\0"
+"student.aero\0journalism.museum\0"
+"\xe5\xb3\xb6\xe6\xa0\xb9.jp\0ohda.shimane.jp\0"
+"to.leg.br\0"
+"undersea.museum\0"
+"takarazuka.hyogo.jp\0"
+"ln.cn\0betainabox.com\0"
"edu\0"
"dtv\0"
-"sp.it\0"
-"lib.tn.us\0s3-eu-west-3.amazonaws.com\0""001www.com\0"
-"immobilien\0"
-"gwiddle.co.uk\0"
-"parachuting.aero\0"
-"ip6.arpa\0gob.bo\0"
-"chita.aichi.jp\0"
-"biz.pk\0"
-"biz.pl\0"
-"lindas.no\0avianca\0"
-"cri.br\0"
-"biz.pr\0"
-"2.bg\0ne.pw\0"
-"musashimurayama.tokyo.jp\0"
-"is-a-doctor.com\0"
-"gob.cl\0bari.it\0tsuwano.shimane.jp\0ug.gov.pl\0"
-"annaka.gunma.jp\0in-the-band.net\0"
-"ski.museum\0"
-"joyo.kyoto.jp\0dvr\0"
-"indian.museum\0"
-"servecounterstrike.com\0"
-"date.hokkaido.jp\0zao.miyagi.jp\0"
-"trade\0"
-"bozen-s\xc3\xbc""dtirol.it\0warabi.saitama.jp\0"
-"\xe4\xbd\x90\xe8\xb3\x80.jp\0"
-"nesset.no\0*.transurl.eu\0"
-"pi.it\0"
-"no.com\0"
-"yusuhara.kochi.jp\0"
-"gob.do\0"
-"yoshinogari.saga.jp\0johana.toyama.jp\0"
-"gob.ec\0grozny.su\0"
-"mad.museum\0"
-"online.th\0a.run.app\0"
-"nanto.toyama.jp\0"
-"d\xc3\xb8nna.no\0"
-"nhlfan.net\0myftp.biz\0"
-"aguni.okinawa.jp\0"
-"bergbau.museum\0rogers\0"
-"oyabe.toyama.jp\0"
-"univ.sn\0"
-"prime\0"
-"gob.es\0"
-"gamvik.no\0"
-"\xe7\xa6\x8f\xe4\xba\x95.jp\0memset.net\0"
-"indigena.bo\0"
-"okegawa.saitama.jp\0shimizu.shizuoka.jp\0"
-"vix.br\0kyowa.hokkaido.jp\0nagaokakyo.kyoto.jp\0"
-"al.us\0no-ip.org\0oy.lc\0"
-"kunitomi.miyazaki.jp\0"
-"balsan-suedtirol.it\0wakuya.miyagi.jp\0gb.net\0"
-"ac\0"
-"ad\0mb.it\0biz.tj\0"
-"ae\0"
-"af\0"
-"ag\0yahoo\0dnsupdater.de\0"
+"\xd8\xa7\xd9\x84\xd8\xac\xd8\xb2\xd8\xa7\xd8\xa6\xd8\xb1\0"
+"planetarium.museum\0"
+"medio-campidano.it\0lib.ky.us\0"
+"forde.no\0"
+"partners\0"
+"cipriani\0"
+"saka.hiroshima.jp\0olayangroup\0"
+"donetsk.ua\0"
+"dvr\0nodum.co\0"
+"furniture.museum\0s3-ap-south-1.amazonaws.com\0"
+"time.no\0"
+"voyage\0"
+"bozen-suedtirol.it\0"
+"dontexist.org\0"
+"matta-varjjat.no\0"
+"volkswagen\0"
+"hayakawa.yamanashi.jp\0"
+"turen.tn\0"
+"arkhangelsk.su\0"
+"matsudo.chiba.jp\0kids.us\0"
+"kep.tr\0"
+"ggee\0"
+"toyooka.hyogo.jp\0"
+"insurance.aero\0"
+"susaki.kochi.jp\0"
+"accident-investigation.aero\0dev.static.land\0"
+"daegu.kr\0faith\0is-into-cars.com\0"
+"kakamigahara.gifu.jp\0"
+"steiermark.museum\0fet.no\0airforce\0"
+"nodum.io\0"
+"hs.zone\0"
+"bounty-full.com\0"
+"sortland.no\0"
+"suzaka.nagano.jp\0bajddar.no\0"
+"codes\0garden\0"
+"himeshima.oita.jp\0resistance.museum\0"
+"withgoogle.com\0"
+"k12.ny.us\0"
+"minamiboso.chiba.jp\0"
+"malatvuopmi.no\0"
+"wa.gov.au\0"
+"cc.mo.us\0actor\0"
+"mincom.tn\0chernivtsi.ua\0bradesco\0"
+"fukuchi.fukuoka.jp\0muenster.museum\0"
+"ua.rs\0"
+"cim.br\0ic.gov.pl\0"
+"\xe6\x97\xb6\xe5\xb0\x9a\0"
+"k12.dc.us\0"
+"mobile\0"
+"lur\xc3\xb8y.no\0"
+"chizu.tottori.jp\0buyshouses.net\0"
+"omuta.fukuoka.jp\0toyama.toyama.jp\0"
+"barlettatraniandria.it\0sr.it\0alabama.museum\0"
+"kuki.saitama.jp\0cc.ca.us\0"
+"sarufutsu.hokkaido.jp\0"
+"inf.br\0"
+"mizuho.tokyo.jp\0exeter.museum\0idv.tw\0"
+"rennes\xc3\xb8y.no\0"
+"unicom\0"
+"bando.ibaraki.jp\0"
+"id.ir\0arts.ve\0"
+"s\xc3\xb8r-varanger.no\0barsyonline.com\0"
+"miyama.fukuoka.jp\0"
+"inf.cu\0"
+"nsw.au\0"
+"profesional.bo\0ap.it\0imakane.hokkaido.jp\0windows\0"
+"wroclaw.pl\0duck\0solutions\0ybo.science\0"
+"minamiise.mie.jp\0"
+"ogliastra.it\0sula.no\0"
+"tonosho.kagawa.jp\0"
+"b.bg\0"
+"koebenhavn.museum\0"
+"kamakura.kanagawa.jp\0kuroiso.tochigi.jp\0"
+"zgora.pl\0"
+"daplie.me\0"
+"narita.chiba.jp\0otake.hiroshima.jp\0"
+"katashina.gunma.jp\0"
+"hachijo.tokyo.jp\0"
+"b.br\0gs.st.no\0harstad.no\0"
+"oster\xc3\xb8y.no\0fedorapeople.org\0"
+"sc.cn\0friuli-v-giulia.it\0from-sc.com\0"
+"gs.svalbard.no\0"
+"circus.museum\0dallas.museum\0ballangen.no\0author\0"
+"ichikai.tochigi.jp\0realty\0"
+"fin.tn\0"
+"nesseby.no\0"
+"prof.pr\0backplaneapp.io\0"
+"\xe5\x8d\x83\xe8\x91\x89.jp\0"
+"kaneyama.yamagata.jp\0mysecuritycamera.com\0"
+"settlers.museum\0"
+"id.lv\0\xd0\xbe\xd0\xbd\xd0\xbb\xd0\xb0\xd0\xb9\xd0\xbd\0balashov.su\0"
+"he.cn\0"
+"laz.it\0yonezawa.yamagata.jp\0id.ly\0"
+"sondre-land.no\0movie\0"
+"takaharu.miyazaki.jp\0"
+"mragowo.pl\0"
+"towada.aomori.jp\0uni5.net\0"
+"dyn.cosidns.de\0"
+"arts.ro\0"
+"bellevue.museum\0"
+"trentino-a-adige.it\0"
+"kumenan.okayama.jp\0coldwar.museum\0ushistory.museum\0"
+"ostrowwlkp.pl\0"
+"cbre\0"
+"forsand.no\0dattolocal.com\0"
+"zachpomor.pl\0cherkasy.ua\0surf\0"
+"svizzera.museum\0knowsitall.info\0"
+"ooshika.nagano.jp\0fan\0"
+"uchihara.ibaraki.jp\0"
+"tksat.bo\0forli-cesena.it\0"
+"chikuhoku.nagano.jp\0"
+"consulting\0"
+"tr.eu.org\0"
+"page\0asso.eu.org\0"
+"noip.us\0"
+"finn\xc3\xb8y.no\0"
+"flesberg.no\0"
+"tarui.gifu.jp\0"
+"fujitsu\0"
+"matsuura.nagasaki.jp\0k12.mt.us\0"
+"selje.no\0hs.run\0"
+"eating-organic.net\0"
+"itami.hyogo.jp\0"
+"kumatori.osaka.jp\0"
+"kameyama.mie.jp\0mobi\0slattum.no\0eu-4.evennode.com\0"
+"toray\0"
+"arts.nf\0from-ma.com\0"
+"masaki.ehime.jp\0"
+"esq\0"
+"\xe6\xb8\xb8\xe6\x88\x8f\0"
+"drive\0"
+"atlanta.museum\0ox.rs\0"
+"trentino-s-tirol.it\0mitou.yamaguchi.jp\0"
+"ecologia.bo\0firewall-gateway.net\0"
+"hokkaido.jp\0fuso.aichi.jp\0"
+"cc.ar.us\0"
+"es.gov.br\0tsuiki.fukuoka.jp\0\xd5\xb0\xd5\xa1\xd5\xb5\0"
+"us-west-1.elasticbeanstalk.com\0"
+"management\0freeboxos.fr\0"
+"moda\0ddnslive.com\0"
+"cesena-forli.it\0"
+"teva\0altervista.org\0spdns.org\0"
+"mitsubishi\0"
+"express.aero\0"
+"sc.ke\0twmail.cc\0"
+"dyndns-remote.com\0"
+"dyndns-at-work.com\0"
+"inf.mk\0losangeles.museum\0"
+"higashinaruse.akita.jp\0"
+"bandai.fukushima.jp\0"
+"eus\0"
+"chirurgiens-dentistes.fr\0"
+"sc.kr\0"
+"hotel.tz\0"
+"*.lcl.dev\0"
+"sayama.osaka.jp\0"
+"takayama.gunma.jp\0"
+"*.nom.br\0"
+"is-leet.com\0"
+"azumino.nagano.jp\0torino.museum\0"
+"radio.br\0"
+"kamiamakusa.kumamoto.jp\0"
+"sc.ls\0pictures\0"
+"nationalheritage.museum\0"
+"\xc3\xb8yer.no\0eu-3.evennode.com\0"
+"flynnhosting.net\0"
+"id.us\0"
+"webcam\0"
+"ina.saitama.jp\0"
+"tomakomai.hokkaido.jp\0finland.museum\0museumcenter.museum\0"
+"murata.miyagi.jp\0jevnaker.no\0"
+"groks-the.info\0"
+"owariasahi.aichi.jp\0"
+"tobetsu.hokkaido.jp\0"
+"skierv\xc3\xa1.no\0"
+"etne.no\0cloudapp.net\0"
+"linz.museum\0averoy.no\0"
+"lib.nm.us\0df.leg.br\0"
+"contemporary.museum\0"
+"teo.br\0"
+"\xe7\x9f\xb3\xe5\xb7\x9d.jp\0"
+"iida.nagano.jp\0"
+"poker\0"
+"oppeg\xc3\xa5rd.no\0"
+"b\xc3\xa1id\xc3\xa1r.no\0dyndns-at-home.com\0"
+"kusu.oita.jp\0"
+"tienda\0"
+"yazu.tottori.jp\0scienceandindustry.museum\0v\xc3\xa6r\xc3\xb8y.no\0"
+"kanna.gunma.jp\0"
+"emb.kw\0khmelnitskiy.ua\0"
+"nyc.museum\0fit\0"
+"dvag\0"
+"airtel\0"
+"chuo.yamanashi.jp\0evenes.no\0"
+"leksvik.no\0\xd8\xb4\xd8\xa8\xd9\x83\xd8\xa9\0"
+"lecco.it\0"
+"aa.no\0\xe9\x80\x9a\xe8\xb2\xa9\0"
+"balat.no\0"
+"servep2p.com\0"
+"filegear-sg.me\0"
+"turystyka.pl\0cyon.site\0"
+"flor\xc3\xb8.no\0"
+"chungnam.kr\0"
+"ashiya.fukuoka.jp\0fujikawa.shizuoka.jp\0"
+"naka.hiroshima.jp\0"
+"locus\0statefarm\0thruhere.net\0"
+"eu-2.evennode.com\0"
+"adachi.tokyo.jp\0k12.wy.us\0"
+"rieti.it\0godo.gifu.jp\0"
+"shimabara.nagasaki.jp\0"
+"\xe3\x82\xbb\xe3\x83\xbc\xe3\x83\xab\0"
+"juniper\0"
+"omotego.fukushima.jp\0"
+"asmatart.museum\0cc.ok.us\0"
+"k12.ia.us\0"
+"inf.ua\0"
+"kosai.shizuoka.jp\0"
+"cc.la.us\0viking\0"
+"\xd0\xb8\xd0\xba\xd0\xbe\xd0\xbc.museum\0"
+"fjell.no\0"
+"hotel.lk\0topology.museum\0tr\xc3\xa6na.no\0fly\0"
+"psc.br\0"
+"mihama.mie.jp\0aseral.no\0"
+"noip.me\0"
+"ap-northeast-2.elasticbeanstalk.com\0"
+"experts-comptables.fr\0minamiizu.shizuoka.jp\0loten.no\0"
+"minakami.gunma.jp\0"
+"airguard.museum\0b.se\0"
+"fauske.no\0"
+"taiwa.miyagi.jp\0seven\0"
+"pars\0\xd8\xa7\xd9\x84\xd8\xb9\xd9\x84\xd9\x8a\xd8\xa7\xd9\x86\0"
+"inzai.chiba.jp\0mulhouse.museum\0"
+"oyamazaki.kyoto.jp\0futurehosting.at\0"
+"pordenone.it\0gj\xc3\xb8vik.no\0\xe5\x81\xa5\xe5\xba\xb7\0"
+"reggio-emilia.it\0childrensgarden.museum\0"
+"niteroi.br\0pulawy.pl\0"
+"zama.kanagawa.jp\0jamison.museum\0"
+"kawakami.nagano.jp\0"
+"cl.it\0"
+"uk0.bigv.io\0"
+"sciencecenters.museum\0"
+"glogow.pl\0"
+"sc.ug\0eu-1.evennode.com\0"
+"sc.tz\0\xd8\xa7\xd9\x85\xd8\xa7\xd8\xb1\xd8\xa7\xd8\xaa\0foo\0"
+"grong.no\0modum.no\0"
+"morotsuka.miyazaki.jp\0for-more.biz\0"
+"nym.by\0"
+"shinto.gunma.jp\0s3-eu-west-2.amazonaws.com\0nym.bz\0"
+"gjesdal.no\0sc.us\0fox\0"
+"\xe5\x85\xac\xe5\x8f\xb8.cn\0\xe6\xb2\x96\xe7\xb8\x84.jp\0"
+"ny.us\0"
+"\xe0\xb9\x80\xe0\xb8\x99\xe0\xb9\x87\xe0\xb8\x95.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+"shimizu.hokkaido.jp\0"
+"de.cool\0"
+"sasaguri.fukuoka.jp\0"
+"hawaii.museum\0"
+"shiriuchi.hokkaido.jp\0c.cdn77.org\0"
+"soni.nara.jp\0gs.nl.no\0"
+"\xe5\x85\xac\xe5\x8f\xb8.hk\0toyota.aichi.jp\0gu.us\0"
+"trentino-sued-tirol.it\0"
+"bungotakada.oita.jp\0"
+"england.museum\0x443.pw\0"
+"camera\0gal\0iserv.dev\0"
+"york.museum\0"
+"rochester.museum\0nym.ec\0"
+"ashiya.hyogo.jp\0sinaapp.com\0"
+"gangwon.kr\0gap\0"
+"bestbuy\0"
+"americanantiques.museum\0"
+"hotel.hu\0"
+"uchinada.ishikawa.jp\0"
+"dyndns-ip.com\0"
+"makurazaki.kagoshima.jp\0"
+"scotland.museum\0"
+"ogori.fukuoka.jp\0gay\0"
+"yoshino.nara.jp\0"
+"frl\0"
+"lib.id.us\0"
+"oracle\0"
+"ac\0\xe7\xa7\xbb\xe5\x8a\xa8\0to.work\0"
+"ad\0serveminecraft.net\0"
+"ae\0hamamatsu.shizuoka.jp\0"
+"af\0cesenaforl\xc3\xac.it\0"
+"ag\0"
+"rsc.cdn77.org\0"
"ai\0"
-"tonami.toyama.jp\0"
-"biz.ua\0"
-"al\0kanuma.tochigi.jp\0biz.tr\0"
-"am\0seljord.no\0ne.ug\0"
-"biz.tt\0"
-"ao\0creation.museum\0"
-"otaru.hokkaido.jp\0ne.tz\0"
-"aq\0ba\0stj\xc3\xb8rdalshalsen.no\0"
-"ar\0bb\0schaeffler\0"
-"as\0"
+"williamhill\0"
+"berg.no\0"
+"al\0racing\0logoip.de\0"
+"am\0himeji.hyogo.jp\0"
+"ao\0"
+"aq\0ba\0romsa.no\0"
+"ar\0bb\0satsumasendai.kagoshima.jp\0"
+"passenger-association.aero\0as\0"
"at\0"
-"au\0be\0jewelry.museum\0"
+"au\0be\0phoenix.museum\0"
"bf\0"
-"aw\0bg\0grozny.ru\0"
-"ax\0bh\0gob.gt\0"
-"bi\0ne.us\0"
-"az\0bj\0"
-"*.yokohama.jp\0matsumae.hokkaido.jp\0"
-"bm\0"
-"bn\0webhop.net\0"
-"bo\0of.by\0"
-"ca\0"
-"br\0gob.hn\0"
-"bs\0cc\0"
-"bt\0cd\0szczytno.pl\0"
-"bv\0cf\0"
-"bw\0cg\0"
-"ch\0vall\xc3\xa9""e-aoste.it\0biz.vn\0"
-"by\0ci\0"
-"bz\0"
-"k12.gu.us\0"
-"cl\0"
-"cm\0c.cdn77.org\0"
+"aw\0bg\0"
+"ax\0bh\0uk.eu.org\0"
+"bi\0cloudcontrolled.com\0"
+"az\0bj\0chikujo.fukuoka.jp\0"
+"moriya.ibaraki.jp\0"
+"bm\0medecin.km\0"
+"bn\0"
+"bo\0tunk.org\0"
+"computer.museum\0microsoft\0nym.gr\0"
+"ca\0aero.tt\0gdn\0"
+"br\0"
+"bs\0cc\0onred.one\0"
+"bt\0cd\0gea\0"
+"ftr\0"
+"bv\0cf\0casadelamoneda.museum\0"
+"bw\0cg\0yokawa.hyogo.jp\0nym.gy\0"
+"ch\0"
+"by\0ci\0panama.museum\0nym.hk\0"
+"bz\0k12.vt.us\0"
+"dnsfor.me\0"
+"cl\0delta\0"
+"cm\0valle.no\0"
"cn\0"
-"co\0java\0"
-"tempioolbia.it\0"
-"alesund.no\0"
-"cr\0fukuyama.hiroshima.jp\0"
-"cu\0de\0farmequipment.museum\0"
-"cv\0iruma.saitama.jp\0"
-"cw\0"
-"cx\0seto.aichi.jp\0"
-"cy\0ushuaia.museum\0"
-"cz\0dj\0"
-"dk\0games\0"
-"mobara.chiba.jp\0"
-"dm\0gjerstad.no\0naamesjevuemie.no\0"
-"do\0lur\xc3\xb8y.no\0is-a-green.com\0"
-"tools\0"
+"co\0"
+"properties\0"
+"rakkestad.no\0fun\0enonic.io\0"
+"cr\0"
+"workinggroup.aero\0aero.mv\0nym.ie\0"
+"cu\0de\0moto\0"
+"cv\0"
+"cw\0sherbrooke.museum\0"
+"cx\0"
+"cy\0"
+"cz\0dj\0hachioji.tokyo.jp\0"
+"dk\0"
+"bas.it\0read\0"
+"dm\0hemsedal.no\0bingo\0"
+"k12.il.us\0"
+"do\0chosei.chiba.jp\0"
+"bykle.no\0"
"ec\0"
-"okinawa.jp\0"
-"ee\0vefsn.no\0k12.tx.us\0"
-"eg\0"
-"tourism.pl\0"
-"dz\0kin.okinawa.jp\0"
-"museumcenter.museum\0valley.museum\0bingo\0"
-"baseball\0"
-"noticias.bo\0"
-"inagawa.hyogo.jp\0abu.yamaguchi.jp\0global.ssl.fastly.net\0"
-"co.com\0"
-"takahama.aichi.jp\0"
-"kayabe.hokkaido.jp\0"
+"hitachiota.ibaraki.jp\0"
+"ee\0"
+"eg\0go.dyndns.org\0"
+"to.it\0"
+"dz\0"
+"pu.it\0uwu.ai\0"
+"aarp\0"
+"lucania.it\0from-wi.com\0"
+"!www.ck\0oceanographique.museum\0"
"es\0"
-"et\0school\0"
+"et\0"
"eu\0"
+"usr.cloud.muni.cz\0"
+"iraq.museum\0nordreisa.no\0"
"fi\0"
-"aikawa.kanagawa.jp\0"
-"fm\0"
-"fo\0"
-"ga\0"
+"fm\0fg.it\0"
+"fo\0tomi.nagano.jp\0ventures\0nym.la\0"
+"ga\0nym.lc\0"
"fr\0gb\0"
-"dep.no\0media\0"
+"jdevcloud.com\0"
"gd\0"
"ge\0"
-"gf\0rm.it\0*.transurl.nl\0"
-"gg\0biz.zm\0"
-"gh\0"
-"gi\0i.ng\0gs.of.no\0"
-"gx.cn\0gl\0ouchi.saga.jp\0"
-"gm\0"
-"adm.br\0gn\0"
-"gp\0"
-"recreation.aero\0gq\0lib.dc.us\0fitness\0s3.dualstack.ap-northeast-1.amazonaws.com\0mypets.ws\0"
-"gr\0saga.jp\0matsubushi.saitama.jp\0"
-"gs\0\xe5\x80\x8b\xe4\xba\xba.\xe9\xa6\x99\xe6\xb8\xaf\0"
-"gt\0trentino-aadige.it\0lukow.pl\0"
-"gu\0cc.ut.us\0"
-"to.gov.br\0"
-"gw\0"
-"miyazu.kyoto.jp\0"
-"gy\0"
-"hk\0elvendrell.museum\0mel\xc3\xb8y.no\0"
-"gob.mx\0"
-"hm\0gob.ni\0hadsel.no\0"
-"hn\0aridagawa.wakayama.jp\0"
-"ubank\0s3.dualstack.eu-west-3.amazonaws.com\0"
-"kep.tr\0coach\0fan\0"
-"wpdevcloud.com\0cyon.site\0"
-"hr\0saarland\0dynathome.net\0"
-"andoy.no\0"
-"ht\0id\0akdn\0"
+"gf\0hyllestad.no\0"
+"gg\0nym.li\0"
+"gh\0nym.kz\0"
+"gi\0narashino.chiba.jp\0"
+"kitami.hokkaido.jp\0"
+"o.bg\0gl\0molde.no\0r\xc3\xa5""de.no\0fyi\0"
+"gm\0tjeldsund.no\0"
+"gn\0tondabayashi.osaka.jp\0"
+"gp\0tateshina.nagano.jp\0"
+"5.bg\0gq\0embetsu.hokkaido.jp\0imamat\0"
+"gr\0nym.lt\0"
+"gs\0kudoyama.wakayama.jp\0nym.lu\0nym.me\0"
+"gt\0showa.fukushima.jp\0botanicgarden.museum\0"
+"gu\0amber.museum\0"
+"wa.edu.au\0ringerike.no\0"
+"gw\0sex.hu\0sakaki.nagano.jp\0gift\0"
+"coal.museum\0"
+"gy\0nj.us\0"
+"misato.wakayama.jp\0muenchen.museum\0"
+"hk\0"
+"nym.mn\0"
+"hm\0marker.no\0"
+"hn\0"
+"naganohara.gunma.jp\0"
+"tamano.okayama.jp\0ivgu.no\0"
+"hr\0mosvik.no\0"
+"ht\0id\0otoineppu.hokkaido.jp\0nordkapp.no\0slupsk.pl\0rj.leg.br\0"
"hu\0ie\0"
-"oarai.ibaraki.jp\0futuremailing.at\0"
-"bnr.la\0"
-"higashi.okinawa.jp\0i.ph\0winb.gov.pl\0"
-"il\0for-more.biz\0"
-"im\0"
-"in\0matsumoto.kagoshima.jp\0"
-"io\0from-al.com\0"
-"naka.hiroshima.jp\0"
+"prd.fr\0mombetsu.hokkaido.jp\0nym.mx\0"
+"sannohe.aomori.jp\0"
+"*.kitakyushu.jp\0"
+"iki.fi\0"
+"ogi.saga.jp\0"
+"il\0"
+"im\0\xe6\x84\x9b\xe7\x9f\xa5.jp\0"
+"in\0"
+"io\0"
+"aip.ee\0ranzan.saitama.jp\0karm\xc3\xb8y.no\0"
"iq\0"
-"ir\0cri.nz\0"
-"is\0oldnavy\0"
-"it\0"
-"je\0gob.pa\0togliatti.su\0"
-"varoy.no\0is-a-bruinsfan.org\0"
-"watarai.mie.jp\0"
-"gob.pe\0"
-"news\0"
-"jo\0gob.pk\0"
+"ir\0jaworzno.pl\0marketing\0mayfirst.info\0"
+"is\0kvafjord.no\0"
+"it\0kuriyama.hokkaido.jp\0wafflecell.com\0"
+"je\0"
+"\xe5\xb1\xb1\xe6\xa2\xa8.jp\0shimofusa.chiba.jp\0gle\0nym.nz\0"
+"alipay\0"
+"lib.gu.us\0black\0"
+"visa\0"
+"jo\0lib.co.us\0tatamotors\0"
"jp\0"
-"floro.no\0"
-"radoy.no\0esq\0"
-"treviso.it\0katori.chiba.jp\0toga.toyama.jp\0freeboxos.fr\0"
+"select\0"
+"ama.shimane.jp\0katsushika.tokyo.jp\0saltdal.no\0nym.pe\0"
+"namsos.no\0"
"ke\0"
+"swiss\0googlecode.com\0temp-dns.com\0"
"kg\0"
-"furudono.fukushima.jp\0"
-"ki\0tree.museum\0dynalias.org\0"
-"mobi.gp\0trentinoa-adige.it\0toba.mie.jp\0ooshika.nagano.jp\0nagai.yamagata.jp\0"
-"koshu.yamanashi.jp\0"
-"km\0"
-"kn\0club\0next\0blogspot.co.at\0"
-"folldal.no\0lib.ma.us\0"
-"kp\0"
-"la\0"
-"kr\0lb\0"
-"lc\0naturbruksgymn.se\0"
-"shonai.yamagata.jp\0"
-"\xe6\xbe\xb3\xe9\x96\x80\0"
-"kw\0i.se\0"
-"haboro.hokkaido.jp\0"
+"coffee\0"
+"hitachiomiya.ibaraki.jp\0ki\0r\xc3\xb8yrvik.no\0"
+"\xe5\xbe\xb3\xe5\xb3\xb6.jp\0tonaki.okinawa.jp\0corvette.museum\0"
+"bozen-s\xc3\xbc""dtirol.it\0*.uberspace.de\0"
+"km\0naturhistorisches.museum\0"
+"kn\0"
+"sassari.it\0bentley\0"
+"kp\0from-az.net\0"
+"iheya.okinawa.jp\0la\0"
+"kr\0lb\0gmo\0nym.pt\0"
+"lc\0"
+"shiksha\0ciscofreak.com\0mypsx.net\0"
+"kw\0is-found.org\0"
"ky\0li\0"
-"chikuma.nagano.jp\0kz\0"
-"lk\0motorcycles\0"
-"cc.nv.us\0"
-"kawamata.fukushima.jp\0nagasu.kumamoto.jp\0"
-"ma\0protonet.io\0"
-"friulivgiulia.it\0lr\0"
+"bologna.it\0kz\0"
+"kamisu.ibaraki.jp\0lk\0gmx\0"
+"minamioguni.kumamoto.jp\0"
+"ma\0"
+"lr\0"
"ls\0mc\0"
-"lt\0md\0"
-"lu\0me\0\xc4\x8d\xc3\xa1hcesuolo.no\0eus\0"
-"hachioji.tokyo.jp\0lv\0"
-"mg\0alpha-myqnapcloud.com\0"
-"takasu.hokkaido.jp\0mh\0"
+"anpachi.gifu.jp\0lt\0md\0ambulance.museum\0"
+"lu\0me\0"
+"lv\0beardu.no\0"
+"mg\0"
+"kosaka.akita.jp\0mh\0"
"ly\0"
-"soccer\0stcgroup\0"
-"mk\0flakstad.no\0k12.vt.us\0"
-"ml\0"
-"ssl.origin.cdn77-secure.org\0"
-"cesena-forl\xc3\xac.it\0mn\0"
-"mo\0eidfjord.no\0\xd0\xbe\xd1\x80\xd0\xb3\0"
-"mp\0dabur\0"
-"mq\0na\0edu.eu.org\0tselinograd.su\0"
-"anpachi.gifu.jp\0kamakura.kanagawa.jp\0mr\0"
-"ms\0nc\0myqnapcloud.com\0"
-"fermo.it\0mt\0"
-"mu\0ne\0of.no\0"
-"ranzan.saitama.jp\0mv\0nf\0"
-"mw\0ng\0"
-"mx\0"
-"z.bg\0my\0ni\0is-into-anime.com\0"
-"asahikawa.hokkaido.jp\0mz\0gob.sv\0"
+"mk\0viva\0"
+"ml\0reit\0"
+"mail.pl\0nym.ro\0"
+"mn\0pccw\0"
+"mo\0"
+"mp\0"
+"prd.km\0mq\0na\0"
+"bolt.hu\0mr\0goo\0"
+"ms\0nc\0gop\0"
+"hakuba.nagano.jp\0mt\0from-oh.com\0"
+"mu\0ne\0"
+"mv\0nf\0"
+"mw\0ng\0got\0"
+"barreau.bj\0mx\0"
+"gov\0trentinoalto-adige.it\0my\0ni\0folldal.no\0vivo\0nym.sk\0"
+"fujishiro.ibaraki.jp\0mz\0"
"nl\0"
-"miyama.fukuoka.jp\0yanaizu.fukushima.jp\0"
-"no\0from-il.com\0"
-"nagano.nagano.jp\0makeup\0"
-"aizumi.tokushima.jp\0nr\0nextdirect\0"
-"yokawa.hyogo.jp\0yoshino.nara.jp\0"
-"nu\0"
-"tos.it\0"
-"from-fl.com\0"
-"nz\0trafficplex.cloud\0"
-"sardegna.it\0oshima.yamaguchi.jp\0"
-"masoy.no\0om\0"
-"dnsdojo.net\0"
-"takahagi.ibaraki.jp\0"
-"pa\0"
-"jl.cn\0"
-"national.museum\0bygland.no\0"
-"shimoichi.nara.jp\0lebork.pl\0"
-"pe\0"
+"technology.museum\0"
+"kyoto.jp\0"
+"no\0"
+"jefferson.museum\0"
+"sp.it\0nr\0"
+"nym.su\0"
+"naturbruksgymn.se\0app.os.stg.fedoraproject.org\0"
+"skaun.no\0nu\0able\0"
+"ind.br\0latina.it\0nym.sx\0"
+"olecko.pl\0"
+"aurskog-holand.no\0nz\0"
+"prd.mg\0"
+"sakaiminato.tottori.jp\0"
+"om\0"
+"sex.pl\0"
+"kunstunddesign.museum\0gotdns.org\0"
+"shizuoka.shizuoka.jp\0"
+"motegi.tochigi.jp\0pa\0"
+"nationalfirearms.museum\0"
+"pe\0nym.tw\0"
"pf\0"
-"fosnes.no\0syno-ds.de\0"
-"chitose.hokkaido.jp\0ph\0"
-"quebec.museum\0aurland.no\0gob.ve\0money\0"
-"pk\0"
-"koya.wakayama.jp\0pl\0financial\0"
-"pm\0"
-"shoo.okayama.jp\0pn\0"
-"sogne.no\0"
-"qa\0ut.us\0we.bs\0"
-"taiki.mie.jp\0taiwa.miyagi.jp\0pr\0"
-"ps\0"
-"pt\0"
-"basel.museum\0"
-"ulsan.kr\0fit\0"
-"pw\0"
-"py\0"
-"\xe6\x9d\xb1\xe4\xba\xac.jp\0"
-"shinto.gunma.jp\0gwangju.kr\0"
-"org.ac\0"
-"wif.gov.pl\0"
-"org.ae\0"
-"org.af\0pz.it\0"
-"org.ag\0lib.sd.us\0"
-"yaizu.shizuoka.jp\0"
-"org.ai\0"
+"kariya.aichi.jp\0sasebo.nagasaki.jp\0ph\0fastpanel.direct\0"
+"og.ao\0an.it\0pk\0"
+"sa.au\0kawai.iwate.jp\0pl\0"
+"pm\0report\0"
+"iwade.wakayama.jp\0pn\0\xd1\x81\xd0\xb0\xd0\xb9\xd1\x82\0"
+"onion\0direct.quickconnect.to\0"
+"urasoe.okinawa.jp\0mk.ua\0"
+"qa\0"
+"kuzumaki.iwate.jp\0pr\0hbo\0rogers\0"
+"ps\0wy.us\0total\0"
+"chiryu.aichi.jp\0pt\0"
+"bugatti\0"
+"nakatombetsu.hokkaido.jp\0toga.toyama.jp\0"
+"ishikari.hokkaido.jp\0mup.gov.pl\0pw\0"
+"jewish.museum\0py\0"
+"piw.gov.pl\0onthewifi.com\0"
+"catering.aero\0lorenskog.no\0is-certified.com\0"
+"lavagis.no\0"
+"cloudns.biz\0"
+"preservation.museum\0sunndal.no\0"
+"r\xc3\xb8""d\xc3\xb8y.no\0"
"re\0"
-"org.al\0"
-"kaminokawa.tochigi.jp\0"
-"kyotamba.kyoto.jp\0fastlylb.net\0"
-"org.ba\0"
-"org.ar\0org.bb\0"
-"\xe6\xbe\xb3\xe9\x97\xa8\0blogspot.co.id\0"
-"org.au\0ro\0"
-"tysv\xc3\xa6r.no\0sa\0"
-"org.bh\0ashiya.fukuoka.jp\0sb\0"
-"org.bi\0kopervik.no\0rs\0sc\0beauty\0"
-"org.az\0sd\0"
-"ru\0se\0fastly-terrarium.com\0"
-"balsan.it\0blogspot.co.il\0"
-"org.bm\0archaeological.museum\0trustee.museum\0rw\0sg\0"
-"org.bn\0toki.gifu.jp\0kahoku.ishikawa.jp\0yoshikawa.saitama.jp\0sh\0"
-"org.bo\0si\0"
-"kaszuby.pl\0sj\0on-the-web.tv\0"
-"sk\0"
-"org.br\0mielno.pl\0sl\0"
-"org.bs\0sm\0black\0"
-"org.bt\0sn\0"
-"so\0"
-"df.gov.br\0sn.cn\0"
-"org.bw\0"
-"sr\0"
-"org.ci\0tc\0"
-"org.bz\0ms.it\0st\0td\0"
-"b\xc3\xa1jddar.no\0su\0"
-"\xd8\xa7\xd9\x8a\xd8\xb1\xd8\xa7\xd9\x86.ir\0asakuchi.okayama.jp\0sv\0tf\0"
-"karmoy.no\0lier.no\0tg\0redumbrella\0"
-"org.cn\0forl\xc3\xac""cesena.it\0sx\0th\0"
-"org.co\0sy\0"
-"slupsk.pl\0sz\0tj\0"
-"tk\0fly\0"
-"tl\0"
-"tm\0brasilia.me\0"
-"ven.it\0shinagawa.tokyo.jp\0atm.pl\0tn\0"
-"org.cu\0to\0boutique\0"
-"org.cw\0ua\0"
-"shiga.jp\0gose.nara.jp\0tr\0"
-"org.cy\0is-a-personaltrainer.com\0"
-"tt\0olayan\0for-better.biz\0"
-"hakodate.hokkaido.jp\0jeonbuk.kr\0tv\0"
-"org.dm\0tw\0ug\0fedorapeople.org\0"
-"org.do\0nv.us\0"
-"tz\0hair\0"
-"losangeles.museum\0uk\0"
-"shimoji.okinawa.jp\0"
-"org.ec\0berg.no\0b\xc3\xb8.nordland.no\0"
-"org.ee\0"
-"org.eg\0va\0"
-"oto.fukuoka.jp\0ms.kr\0"
-"us\0vc\0"
-"org.dz\0sardinia.it\0trentins\xc3\xbc""dtirol.it\0kyotanabe.kyoto.jp\0"
-"ve\0whoswho\0home-webserver.de\0"
+"shop.ht\0"
+"shop.hu\0"
+"minamiminowa.nagano.jp\0"
+"sa.cr\0virginia.museum\0"
+"sic.it\0"
+"lubin.pl\0"
+"rent\0"
+"mad.museum\0"
+"jpmorgan\0"
+"ro\0"
+"logistics.aero\0kalisz.pl\0"
+"kamisunagawa.hokkaido.jp\0sa\0"
+"sb\0"
+"tmp.br\0rs\0sc\0"
+"gs.cn\0stavern.no\0sd\0"
+"catanzaro.it\0gotsu.shimane.jp\0ru\0se\0"
+"rw\0sg\0"
+"sh\0"
+"si\0lib.mn.us\0"
+"sj\0"
+"goiania.br\0sk\0"
+"nakano.nagano.jp\0sm\xc3\xb8la.no\0sl\0"
+"sm\0"
+"sn\0"
+"so\0from-mn.com\0"
+"midtre-gauldal.no\0"
+"kumamoto.jp\0"
+"wiki.bo\0sr\0s3-website-ap-northeast-1.amazonaws.com\0"
+"ss\0tc\0\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+"st\0td\0"
+"wiki.br\0su\0"
+"nishiaizu.fukushima.jp\0sv\0tf\0"
+"tg\0builders\0"
+"ind.gt\0iki.nagasaki.jp\0sx\0th\0"
+"sy\0"
+"school.na\0sz\0tj\0"
+"tk\0"
+"tl\0surgery\0"
+"shimada.shizuoka.jp\0tm\0"
+"\xe4\xb8\x89\xe9\x87\x8d.jp\0tn\0"
+"to\0soc.srcf.net\0"
+"sweden.museum\0leirfjord.no\0doesntexist.com\0"
+"newjersey.museum\0ua\0"
+"oxford.museum\0tr\0"
+"tt\0"
+"kitaura.miyazaki.jp\0"
+"tv\0"
+"humanities.museum\0tw\0ug\0"
+"stokke.no\0tz\0"
+"stockholm.museum\0uk\0\xe3\x81\xbf\xe3\x82\x93\xe3\x81\xaa\0"
+"\xe9\xa6\x99\xe5\xb7\x9d.jp\0"
+"va\0"
+"medecin.fr\0ind.in\0"
+"yugawara.kanagawa.jp\0kamiizumi.saitama.jp\0school.nz\0us\0vc\0"
+"sakyo.kyoto.jp\0kanuma.tochigi.jp\0ve\0"
+"suwa.nagano.jp\0ogimi.okinawa.jp\0kvam.no\0gifts\0"
"vg\0"
-"sos.pl\0"
-"uy\0vi\0"
-"uz\0freetls.fastly.net\0"
-"mysecuritycamera.com\0"
-"ptplus.fit\0"
-"org.es\0"
-"org.et\0vn\0"
-"foo\0"
-"kasugai.aichi.jp\0"
-"vu\0"
-"wf\0"
-"cc.ms.us\0cc.nc.us\0mypep.link\0"
-"smola.no\0"
-"minamiawaji.hyogo.jp\0kami.miyagi.jp\0fox\0"
-"fie.ee\0"
-"org.ge\0mymailer.com.tw\0"
-"niyodogawa.kochi.jp\0"
-"org.gg\0"
-"org.gh\0anan.nagano.jp\0ac.leg.br\0"
-"org.gi\0ws\0lego\0"
-"org.gl\0cloud\0"
+"trentin-s\xc3\xbc""d-tirol.it\0uy\0vi\0gb.net\0"
+"uz\0"
+"iwate.jp\0"
+"k12.tn.us\0"
+"business\0"
+"vn\0"
+"pomorze.pl\0"
+"\xd0\xba\xd0\xb0\xd1\x82\xd0\xbe\xd0\xbb\xd0\xb8\xd0\xba\0"
+"arezzo.it\0narviika.no\0"
+"kunitomi.miyazaki.jp\0vu\0"
+"toyotomi.hokkaido.jp\0ochi.kochi.jp\0wf\0"
+"toyota\0"
+"\xe4\xb8\xad\xe6\x96\x87\xe7\xbd\x91\0is-with-theband.com\0azurewebsites.net\0"
+"rest\0"
+"shichikashuku.miyagi.jp\0redirectme.net\0"
+"ibestad.no\0"
+"home-webserver.de\0"
+"cc.id.us\0ws\0*.vps.myjino.ru\0"
+"from-vt.com\0"
+"citadel\0filegear-de.me\0"
+"honjyo.akita.jp\0"
+"nomi.ishikawa.jp\0haugesund.no\0"
+"kitaakita.akita.jp\0hiv\0"
+"o.se\0"
+"sa.it\0\xe5\xa4\xa7\xe5\x88\x86.jp\0ind.kw\0"
+"expert\0"
+"tomisato.chiba.jp\0kariwa.niigata.jp\0\xd9\x85\xd9\x84\xd9\x8a\xd8\xb3\xd9\x8a\xd8\xa7\0logoip.com\0"
+"og.it\0"
+"chuo.osaka.jp\0"
+"yamashina.kyoto.jp\0histoire.museum\0rr.leg.br\0"
+"zt.ua\0"
+"\xc3\xb8stre-toten.no\0"
+"midori.chiba.jp\0"
+"16-b.it\0"
+"*.ex.ortsinfo.at\0"
+"otama.fukushima.jp\0\xd0\xb0\xd0\xba.\xd1\x81\xd1\x80\xd0\xb1\0"
+"plc.co.im\0"
+"ibaraki.osaka.jp\0"
+"museet.museum\0zone\0"
+"sumida.tokyo.jp\0"
+"yt\0"
+"\xe0\xa4\x95\xe0\xa5\x89\xe0\xa4\xae\0"
+"hkt\0"
+"boxfuse.io\0"
+"tele.amune.org\0"
+"zm\0"
+"tatsuno.nagano.jp\0"
+"agr.br\0coastaldefence.museum\0"
+"ozora.hokkaido.jp\0salat.no\0dontexist.com\0"
+"progressive\0rs.leg.br\0sc.leg.br\0"
+"ostre-toten.no\0"
+"zw\0myftp.biz\0"
+"takaishi.osaka.jp\0hareid.no\0"
+"hasami.nagasaki.jp\0"
+"dyndns-server.com\0"
+"badaddja.no\0"
+"group.aero\0"
+"station.museum\0"
+"onga.fukuoka.jp\0"
+"auction\0"
+"economia.bo\0tachikawa.tokyo.jp\0"
+"stpetersburg.museum\0"
+"gloppen.no\0"
+"hol.no\0"
+"iizuka.fukuoka.jp\0"
+"geometre-expert.fr\0chijiwa.nagasaki.jp\0"
+"name\0\xe0\xa4\xb8\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xa0\xe0\xa4\xa8\0"
+"gd.cn\0"
+"tas.au\0"
+"iwakuni.yamaguchi.jp\0"
+"s3-website-us-east-1.amazonaws.com\0"
+"point2this.com\0"
+"cinema.museum\0gs.aa.no\0"
+"ba.leg.br\0"
+"lenvik.no\0"
+"isteingeek.de\0"
+"gobo.wakayama.jp\0"
+"flekkefjord.no\0"
+"country\0"
+"agents.aero\0"
+"center.museum\0"
+"nanao.ishikawa.jp\0"
+"is-a-therapist.com\0"
+"nationwide\0"
+"barsyonline.co.uk\0"
+"hot\0"
+"shiftedit.io\0"
+"desa.id\0kizu.kyoto.jp\0how\0tiaa\0"
+"yamagata.yamagata.jp\0"
+"mantova.it\0"
+"fyresdal.no\0"
+"tysfjord.no\0"
+"guernsey.museum\0mandal.no\0imdb\0cbg.ru\0"
+"direct\0"
+"tabuse.yamaguchi.jp\0"
+"jewishart.museum\0zhytomyr.ua\0"
+"poltava.ua\0"
+"cern\0"
+"lodi.it\0uklugs.org\0"
+"rec.br\0"
+"molise.it\0zarow.pl\0"
+"br.com\0"
+"from-ok.com\0"
+"kv\xc3\xa6""fjord.no\0"
+"chihayaakasaka.osaka.jp\0alpha-myqnapcloud.com\0"
+"shikabe.hokkaido.jp\0mitsue.nara.jp\0cc.sc.us\0"
+"higashikagawa.kagawa.jp\0"
+"k12.mi.us\0"
+"rec.co\0ibm\0"
+"indigena.bo\0"
+"ind.tn\0cc.ny.us\0is-a-candidate.org\0"
+"rn.leg.br\0"
+"ice\0"
+"bihoro.hokkaido.jp\0cc.gu.us\0"
+"s3.dualstack.us-east-2.amazonaws.com\0"
+"k12.as.us\0"
+"is-a-painter.com\0"
+"cremona.it\0kuchinotsu.nagasaki.jp\0h\xc3\xb8ylandet.no\0neustar\0"
+"est.pr\0noho.st\0"
+"aquarium.museum\0"
+"icu\0"
+"balsan-s\xc3\xbc""dtirol.it\0"
+"nanbu.yamanashi.jp\0limited\0"
+"wloclawek.pl\0"
+"trentinos-tirol.it\0"
+"nachikatsuura.wakayama.jp\0gwiddle.co.uk\0"
+"is-a-caterer.com\0"
+"loginto.me\0"
+"kadoma.osaka.jp\0agric.za\0"
+"ro.leg.br\0"
+"mydatto.com\0"
+"bz.it\0\xe5\x95\x86\xe5\x9f\x8e\0"
+"kr\xc3\xa5""anghke.no\0dynv6.net\0"
+"kiyokawa.kanagawa.jp\0"
+"pagefrontapp.com\0"
+"alfaromeo\0cloudcontrolapp.com\0"
+"km.ua\0"
+"adac\0pantheonsite.io\0"
+"homedepot\0"
+"qc.ca\0trolley.museum\0"
+"tsushima.nagasaki.jp\0satx.museum\0"
+"ifm\0"
+"am.leg.br\0"
+"izena.okinawa.jp\0pilots.museum\0"
+"komono.mie.jp\0"
+"shop.th\0"
+"society.museum\0"
+"tm.cy\0miki.hyogo.jp\0glug.org.uk\0"
+"kembuchi.hokkaido.jp\0nakagawa.nagano.jp\0"
+"goodyear\0"
+"is-a-hard-worker.com\0"
+"mx.na\0lib.or.us\0"
+"minamiyamashiro.kyoto.jp\0aguni.okinawa.jp\0iron.museum\0"
+"gokase.miyazaki.jp\0"
+"kibichuo.okayama.jp\0"
+"navy\0"
+"higashikagura.hokkaido.jp\0"
+"dyn-berlin.de\0"
+"yasaka.nagano.jp\0"
+"from-ar.com\0"
+"s3-website.ap-northeast-2.amazonaws.com\0ddnsfree.com\0"
+"slz.br\0hellas.museum\0"
+"aure.no\0lib.az.us\0"
+"tsuno.miyazaki.jp\0"
+"niikappu.hokkaido.jp\0m\xc4\x81ori.nz\0"
+"from-wv.com\0"
+"jorpeland.no\0"
+"shop.ro\0"
+"tm.fr\0wzmiuw.gov.pl\0"
+"git-repos.de\0"
+"andoy.no\0buzz\0\xe5\x9c\xa8\xe7\xba\xbf\0"
+"ecn.br\0"
+"mimata.miyazaki.jp\0"
+"githubusercontent.com\0"
+"ma.gov.br\0"
+"immo\0"
+"vestnes.no\0style\0ddns.me\0"
+"\xe5\xb9\xbf\xe4\xb8\x9c\0"
+"dyndns-home.com\0"
+"shop.pl\0"
+"def.br\0"
+"air.museum\0"
+"quest\0"
+"tm.hu\0\xe7\xa6\x8f\xe5\xb3\xb6.jp\0"
+"g12.br\0achi.nagano.jp\0r\xc3\xa1isa.no\0myqnapcloud.com\0"
+"cc.nj.us\0"
+"louvre.museum\0\xe5\xa8\xb1\xe4\xb9\x90\0"
+"newholland\0"
+"sauda.no\0"
+"shiki.saitama.jp\0ap.leg.br\0"
+"cancerresearch\0"
+"\xe5\xae\xae\xe5\xb4\x8e.jp\0"
+"marche.it\0rec.nf\0"
+"oshu.iwate.jp\0hannan.osaka.jp\0bearalv\xc3\xa1hki.no\0"
+"\xe6\xbb\x8b\xe8\xb3\x80.jp\0"
+"\xe9\xb9\xbf\xe5\x85\x90\xe5\xb3\xb6.jp\0kuroishi.aomori.jp\0maori.nz\0"
+"aogashima.tokyo.jp\0orkdal.no\0"
+"mi.it\0luxury\0"
+"misaki.osaka.jp\0"
+"from-il.com\0"
+"sand\xc3\xb8y.no\0"
+"inc\0"
+"ee.eu.org\0mypep.link\0"
+"rotorcraft.aero\0north-kazakhstan.su\0"
+"ing\0eu-west-3.elasticbeanstalk.com\0*.advisor.ws\0"
+"fe.it\0bushey.museum\0blogsite.xyz\0enterprisecloud.nu\0"
+"sites.static.land\0user.srcf.net\0"
+"ink\0is-a-nascarfan.com\0"
+"is-very-sweet.org\0"
+"ohtawara.tochigi.jp\0tm.km\0\xd7\x99\xd7\xa8\xd7\x95\xd7\xa9\xd7\x9c\xd7\x99\xd7\x9d.museum\0"
+"homeip.net\0"
+"maebashi.gunma.jp\0"
+"int\0"
+"ritto.shiga.jp\0"
+"m.bg\0"
+"lebesby.no\0randaberg.no\0"
+"ntr.br\0"
+"nakasatsunai.hokkaido.jp\0"
+"taketomi.okinawa.jp\0"
+"3.bg\0gosen.niigata.jp\0"
+"nankoku.kochi.jp\0"
+"grp.lk\0"
+"wakayama.jp\0"
+"tm.mc\0hughes\0"
+"nh.us\0"
+"sn.cn\0yatomi.aichi.jp\0tm.mg\0"
+"tips\0"
+"zaporizhzhia.ua\0"
+"copenhagen.museum\0palace.museum\0lpages.co\0"
+"vaporcloud.io\0"
+"qld.edu.au\0chiyoda.gunma.jp\0erimo.hokkaido.jp\0"
+"santacruz.museum\0"
+"\xe8\x8c\xa8\xe5\x9f\x8e.jp\0toda.saitama.jp\0"
+"cloudera.site\0se.leg.br\0"
+"reggio-calabria.it\0"
+"feedback\0"
+"eu.int\0barsy.mobi\0"
+"inashiki.ibaraki.jp\0"
+"exchange.aero\0rec.ro\0philips\0"
+"tm.no\0"
+"kagawa.jp\0hino.tottori.jp\0\xe0\xb8\xad\xe0\xb8\x87\xe0\xb8\x84\xe0\xb9\x8c\xe0\xb8\x81\xe0\xb8\xa3.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+"entertainment.aero\0ujitawara.kyoto.jp\0"
+"gyeongnam.kr\0orkanger.no\0"
+"shijonawate.osaka.jp\0applicationcloud.io\0"
+"takashima.shiga.jp\0verm\xc3\xb6gensberater\0"
+"franziskaner.museum\0"
+"us.org\0"
+"nsupdate.info\0"
+"capital\0fuettertdasnetz.de\0"
+"sanuki.kagawa.jp\0niigata.niigata.jp\0lib.ak.us\0"
+"filegear-jp.me\0"
+"jcb\0"
+"steam.museum\0kaufen\0chimkent.su\0"
+"moskenes.no\0"
+"numazu.shizuoka.jp\0engineering\0"
+"odate.akita.jp\0kazimierz-dolny.pl\0"
+"kimitsu.chiba.jp\0"
+"tm.pl\0"
+"vevelstad.no\0"
+"recipes\0"
+"info\0funagata.yamagata.jp\0asnes.no\0jcp\0"
+"judygarland.museum\0"
+"ist\0"
+"tours\0"
+"loabat.no\0"
+"uwajima.ehime.jp\0kpmg\0"
+"usuki.oita.jp\0"
+"flakstad.no\0"
+"futaba.fukushima.jp\0beeldengeluid.museum\0"
+"*.sch.uk\0"
+"shirakawa.gifu.jp\0k12.vi.us\0"
+"cc.wy.us\0forgot.her.name\0"
+"rec.ve\0"
+"monzaedellabrianza.it\0mifune.kumamoto.jp\0"
+"vibovalentia.it\0soeda.fukuoka.jp\0itv\0"
+"nokia\0"
+"est-mon-blogueur.com\0"
+"nakamichi.yamanashi.jp\0"
+"uozu.toyama.jp\0"
+"tm.ro\0"
+"is-a-teacher.com\0"
+"k12.ga.us\0"
+"kota.aichi.jp\0"
+"ome.tokyo.jp\0"
+"tm.se\0"
+"kanonji.kagawa.jp\0"
+"messina.it\0"
+"media.aero\0"
+"s3-us-east-2.amazonaws.com\0mein-iserv.de\0"
+"beppu.oita.jp\0ito.shizuoka.jp\0portal.museum\0vardo.no\0"
+"barrel-of-knowledge.info\0"
+"kashiwara.osaka.jp\0royrvik.no\0"
+"ot.it\0pd.it\0"
+"honjo.saitama.jp\0"
+"asahi.mie.jp\0"
+"tanabe.wakayama.jp\0rhcloud.com\0"
+"\xe5\x85\xb5\xe5\xba\xab.jp\0spreadbetting\0"
+"ribeirao.br\0"
+"of.football\0"
+"m\xc3\xa5s\xc3\xb8y.no\0mi.th\0"
+"al.it\0ragusa.it\0nanporo.hokkaido.jp\0"
+"\xc3\xb8rsta.no\0"
+"numata.hokkaido.jp\0"
+"jampa.br\0"
+"matsuda.kanagawa.jp\0sandnes.no\0"
+"santafe.museum\0"
+"toyone.aichi.jp\0"
+"mytuleap.com\0"
+"nu.ca\0"
+"mi.us\0"
+"higashiyoshino.nara.jp\0jio\0linkyard-cloud.ch\0"
+"\xe5\x80\x8b\xe4\xba\xba.hk\0"
+"katowice.pl\0"
+"hiratsuka.kanagawa.jp\0royken.no\0"
+"\xe5\x8f\xb0\xe6\xb9\xbe\0"
+"tara.saga.jp\0"
+"termez.su\0"
+"writesthisblog.com\0barsy.support\0"
+"kasai.hyogo.jp\0*.compute.amazonaws.com\0"
+"shichinohe.aomori.jp\0sande.more-og-romsdal.no\0"
+"insure\0"
+"ha.cn\0vgs.no\0"
+"varese.it\0incheon.kr\0archaeological.museum\0kinghost.net\0"
+"yokkaichi.mie.jp\0"
+"nakagyo.kyoto.jp\0skjervoy.no\0fhapp.xyz\0"
+"holt\xc3\xa5len.no\0krym.ua\0"
+"woodside\0"
+"mutsu.aomori.jp\0academy.museum\0farmequipment.museum\0"
+"piedmont.it\0movistar\0"
+"\xe5\x98\x89\xe9\x87\x8c\0ro.eu.org\0"
+"ikata.ehime.jp\0"
+"creditunion\0"
+"realestate\0"
+"lajolla.museum\0ann-arbor.mi.us\0"
+"kppsp.gov.pl\0"
+"chiba.jp\0jll\0"
+"rauma.no\0"
+"al.no\0tm.za\0"
+"shimodate.ibaraki.jp\0\xe0\xb4\xad\xe0\xb4\xbe\xe0\xb4\xb0\xe0\xb4\xa4\xe0\xb4\x82\0"
+"enna.it\0"
+"ichinomiya.aichi.jp\0"
+"sango.nara.jp\0"
+"iwanuma.miyagi.jp\0"
+"jmp\0hashbang.sh\0"
+"swinoujscie.pl\0"
+"siljan.no\0"
+"office\0"
+"\xd8\xb9\xd9\x85\xd8\xa7\xd9\x86\0jnj\0"
+"suldal.no\0"
+"starnberg.museum\0"
+"s\xc3\xb8rum.no\0"
+"engineer\0"
+"sorocaba.br\0k12.nh.us\0"
+"skedsmo.no\0"
+"\xe9\x9b\xbb\xe8\xa8\x8a\xe7\x9b\x88\xe7\xa7\x91\0"
+"k12.in.us\0"
+"arakawa.saitama.jp\0"
+"nagano.nagano.jp\0"
+"divtasvuodna.no\0"
+"mex.com\0"
+"ginowan.okinawa.jp\0tarnobrzeg.pl\0sochi.su\0"
+"piacenza.it\0"
+"ro.im\0"
+"cologne\0shriram\0"
+"vi.it\0sabae.fukui.jp\0g\xc3\xa1ivuotna.no\0"
+"childrens.museum\0"
+"fujiidera.osaka.jp\0jot\0cn.eu.org\0"
+"kharkov.ua\0si.eu.org\0"
+"taishin.fukushima.jp\0m.se\0"
+"ro.it\0"
+"\xd0\xb1\xd0\xb5\xd0\xbb\0joy\0"
+"gorizia.it\0"
+"9guacu.br\0"
+"nu.it\0"
+"goldpoint\0"
+"crafts.museum\0"
+"lillehammer.no\0"
+"verran.no\0"
+"manaus.br\0chat\0"
+"industria.bo\0"
+"gratangen.no\0lug.org.uk\0"
+"her\xc3\xb8y.nordland.no\0"
+"hembygdsforbund.museum\0ushuaia.museum\0"
+"omaezaki.shizuoka.jp\0"
+"epilepsy.museum\0asker.no\0"
+"\xe5\x92\x8c\xe6\xad\x8c\xe5\xb1\xb1.jp\0poznan.pl\0"
+"blockbuster\0"
+"osaka\0"
+"dnsdojo.com\0"
+"kl\xc3\xa6""bu.no\0"
+"kyotamba.kyoto.jp\0"
+"school.za\0homelinux.com\0kozow.com\0"
+"midori.gunma.jp\0presse.km\0"
+"nf.ca\0"
+"is-uberleet.com\0"
+"okegawa.saitama.jp\0"
+"ichikawa.hyogo.jp\0"
+"co.financial\0"
+"laquila.it\0russia.museum\0"
+"odessa.ua\0"
+"jolster.no\0"
+"yamato.kumamoto.jp\0"
+"jl.cn\0"
+"interactive.museum\0newport.museum\0sk.eu.org\0"
+"al.us\0"
+"kanan.osaka.jp\0"
+"kazo.saitama.jp\0presse.ml\0"
+"co.krd\0"
+"ru.com\0"
+"a.ssl.fastly.net\0"
+"cesenaforli.it\0lib.ma.us\0myasustor.com\0"
+"andebu.no\0"
+"hemnes.no\0rade.no\0"
+"siellak.no\0land\0"
+"gmbh\0lancaster\0"
+"thingdustdata.com\0"
+"instantcloud.cn\0"
+"county.museum\0aurskog-h\xc3\xb8land.no\0s3.dualstack.ap-south-1.amazonaws.com\0"
+"hamburg\0"
+"\xe7\xae\x87\xe4\xba\xba.hk\0"
+"otaki.nagano.jp\0praxi\0*.cryptonomic.net\0boldlygoingnowhere.org\0"
+"nagato.yamaguchi.jp\0ha.no\0"
+"miyota.nagano.jp\0"
+"hoylandet.no\0"
+"savona.it\0cy.eu.org\0"
+"kfh\0"
+"kochi.jp\0miyoshi.hiroshima.jp\0"
+"conf.au\0"
+"kitagata.gifu.jp\0trysil.no\0"
+"honai.ehime.jp\0"
+"mg.gov.br\0vallee-d-aoste.it\0*.in.futurecms.at\0"
+"s3.eu-central-1.amazonaws.com\0"
+"nishimera.miyazaki.jp\0"
+"hanawa.fukushima.jp\0s3-ca-central-1.amazonaws.com\0"
+"kepno.pl\0"
+"hisayama.fukuoka.jp\0"
+"minamata.kumamoto.jp\0rep.kp\0neat-url.com\0"
"\xe9\xa6\x99\xe6\xa0\xbc\xe9\x87\x8c\xe6\x8b\x89\0"
+"trentinsued-tirol.it\0"
+"trentinsuedtirol.it\0volda.no\0"
+"film.museum\0"
+"vikna.no\0"
+"aero\0friuli-ve-giulia.it\0"
+"soka.saitama.jp\0"
+"furniture\0"
+"prato.it\0akashi.hyogo.jp\0"
+"cz.eu.org\0"
+"baseball\0ru.eu.org\0se.eu.org\0"
+"k12.pa.us\0"
+"cri.br\0"
+"yachiyo.ibaraki.jp\0"
+"rich\0myds.me\0"
+"eid.no\0"
+"pro.az\0sci.eg\0"
+"frogn.no\0contact\0kia\0ddnss.de\0"
+"norfolk.museum\0rehab\0"
+"kounosu.saitama.jp\0"
+"pro.br\0dubai\0"
+"kawanehon.shizuoka.jp\0"
+"kim\0"
+"s\xc3\xbc""dtirol.it\0mj\xc3\xb8ndalen.no\0smart\0"
+"macerata.it\0"
+"dk.eu.org\0"
+"chikushino.fukuoka.jp\0inatsuki.fukuoka.jp\0oceanographic.museum\0"
+"servepics.com\0"
+"certification.aero\0tsuruga.fukui.jp\0"
+"d.gv.vc\0"
+"map.fastly.net\0"
+"pro.cy\0fr.it\0\xc3\xa1lt\xc3\xa1.no\0"
+"sampa.br\0"
+"dnepropetrovsk.ua\0"
+"s3.eu-west-3.amazonaws.com\0"
+"ch.it\0nesna.no\0gratis\0"
+"nativeamerican.museum\0"
+"clothing\0digital\0"
+"pro.ec\0eidskog.no\0\xe1\x83\x92\xe1\x83\x94\0"
+"nagara.chiba.jp\0ostrowiec.pl\0co.network\0ownip.net\0"
+"ternopil.ua\0baidu\0"
+"z.bg\0*.cns.joyent.com\0"
+"kvalsund.no\0"
+"vi.us\0"
+"kawaguchi.saitama.jp\0"
+"tomika.gifu.jp\0kred\0"
+"trentino-sudtirol.it\0nantan.kyoto.jp\0b\xc3\xa1hccavuotna.no\0"
+"toyono.osaka.jp\0"
+"kotohira.kagawa.jp\0"
+"carboniaiglesias.it\0fastly-terrarium.com\0"
+"kanie.aichi.jp\0"
+"entomology.museum\0rendalen.no\0"
+"reggioemilia.it\0xerox\0"
+"takamori.nagano.jp\0eng.pro\0"
+"nanae.hokkaido.jp\0"
+"lupin\0"
+"isa.kagoshima.jp\0"
+"boomla.net\0"
+"itoman.okinawa.jp\0broadcast.museum\0"
+"tranibarlettaandria.it\0berlin\0ca-central-1.elasticbeanstalk.com\0"
+"de.eu.org\0"
+"watari.miyagi.jp\0"
+"uber.space\0"
+"genova.it\0redumbrella\0\xd0\xb4\xd0\xb5\xd1\x82\xd0\xb8\0"
+"ninohe.iwate.jp\0govt.nz\0"
+"yanagawa.fukuoka.jp\0"
+"localhost.daplie.me\0"
+"civilization.museum\0"
+"campidano-medio.it\0"
+"americana.museum\0scjohnson\0technology\0"
+"chikuzen.fukuoka.jp\0"
+"pro.ht\0frankfurt.museum\0"
+"\xe5\x85\xab\xe5\x8d\xa6\0"
+"kusatsu.gunma.jp\0"
+"mypets.ws\0"
+"softbank\0"
+"osaki.miyagi.jp\0"
+"kani.gifu.jp\0"
+"oshino.yamanashi.jp\0varggat.no\0"
+"gsm.pl\0"
+"gos.pk\0"
+"chungbuk.kr\0"
+"matsuyama.ehime.jp\0kpn\0"
+"salzburg.museum\0"
+"froya.no\0"
+"eun.eg\0exnet.su\0"
+"bir.ru\0"
+"r\xc3\xb8mskog.no\0pomorskie.pl\0"
+"\xeb\x8b\xb7\xec\xbb\xb4\0"
+"fastlylb.net\0"
+"championship.aero\0klepp.no\0"
+"ina.ibaraki.jp\0takamatsu.kagawa.jp\0"
+"wlocl.pl\0"
+"v\xc3\xa5gs\xc3\xb8y.no\0"
+"chambagri.fr\0"
+"pharmaciens.km\0"
+"krd\0lat\0"
+"shinichi.hiroshima.jp\0cc.nh.us\0law\0"
+"wanouchi.gifu.jp\0hanamaki.iwate.jp\0s3-website-us-west-2.amazonaws.com\0"
+"feira.br\0siteleaf.net\0"
+"moss.no\0"
+"hotmail\0"
+"gleeze.com\0"
+"ooguy.com\0"
+"bsb.br\0hita.oita.jp\0in-vpn.de\0"
+"toyo.kochi.jp\0"
+"sk\xc3\xa1nit.no\0apps.fbsbx.com\0"
+"gallery\0"
+"toya.hokkaido.jp\0"
+"traeumtgerade.de\0tuva.su\0"
+"drammen.no\0"
+"im.it\0"
+"omihachiman.shiga.jp\0for-some.biz\0"
+"uk.com\0"
+"pro.na\0"
+"fc.it\0"
+"nasu.tochigi.jp\0pro.mv\0"
+"pb.ao\0bi.it\0wodzislaw.pl\0loginline.services\0ddnsking.com\0"
+"vald-aosta.it\0cri.nz\0"
+"or.at\0toon.ehime.jp\0futuremailing.at\0"
+"vall\xc3\xa9""eaoste.it\0arao.kumamoto.jp\0lds\0map.fastlylb.net\0"
+"k.bg\0or.bi\0"
+"kasahara.gifu.jp\0cartoonart.museum\0"
+"eisenbahn.museum\0"
+"bodo.no\0"
+"ed.ao\0""1.bg\0trentinosudtirol.it\0"
+"hosting-cluster.nl\0"
+"organic\0"
+"yandex\0"
+"gs.tm.no\0"
+"pro.om\0"
+"kobierzyce.pl\0ca.eu.org\0"
+"shunan.yamaguchi.jp\0es.kr\0hasura-app.io\0"
+"or.ci\0"
+"kasama.ibaraki.jp\0"
+"getmyip.com\0"
+"plumbing\0"
+"hidaka.kochi.jp\0br\xc3\xb8nn\xc3\xb8y.no\0\xec\x82\xbc\xec\x84\xb1\0"
+"amagasaki.hyogo.jp\0"
+"or.cr\0ce.leg.br\0"
+"lib.va.us\0mydrobo.com\0"
+"skanland.no\0"
+"misato.akita.jp\0"
+"nombre.bo\0"
+"ed.ci\0hn.cn\0"
+"halden.no\0pro.pr\0"
+"sardegna.it\0oshima.yamaguchi.jp\0myshopblocks.com\0"
+"conf.se\0"
+"sor-aurdal.no\0"
+"tosa.kochi.jp\0"
+"ed.cr\0"
+"dr\xc3\xb8""bak.no\0"
+"\xe5\x98\x89\xe9\x87\x8c\xe5\xa4\xa7\xe9\x85\x92\xe5\xba\x97\0"
+"lib.hi.us\0"
+"webhop.info\0"
+"barsy.info\0"
+"lib.dc.us\0\xe5\x8f\xb0\xe7\x81\xa3\0"
+"andasuolo.no\0"
+"vega.no\0homelinux.net\0"
+"lomza.pl\0"
+"nakama.fukuoka.jp\0langev\xc3\xa5g.no\0"
+"trainer.aero\0"
+"trentinos\xc3\xbc""dtirol.it\0\xe5\x85\xac\xe5\x8f\xb8\0wpcomstaging.com\0"
+"bible.museum\0"
+"environmentalconservation.museum\0"
+"bargains\0"
+"\xe6\xbe\xb3\xe9\x96\x80\0"
+"presse.ci\0fukuyama.hiroshima.jp\0muos\xc3\xa1t.no\0"
+"higashimurayama.tokyo.jp\0hokksund.no\0"
+"j\xc3\xb8lster.no\0"
+"cloudns.eu\0"
+"seaport.museum\0\xc3\xa5krehamn.no\0*.compute-1.amazonaws.com\0"
+"western.museum\0"
+"jor.br\0k12.ok.us\0"
+"sunagawa.hokkaido.jp\0pro.tt\0"
+"mod.gi\0rankoshi.hokkaido.jp\0"
+"cc.mi.us\0familyds.com\0"
+"hobby-site.com\0"
+"or.id\0"
+"obihiro.hokkaido.jp\0minato.osaka.jp\0llc\0"
+"cd.eu.org\0"
+"vv.it\0"
+"\xe7\xbe\xa4\xe9\xa6\xac.jp\0"
+"obanazawa.yamagata.jp\0"
+"z.se\0filegear-gb.me\0in-dsl.org\0"
+"namerikawa.toyama.jp\0"
+"llp\0verisign\0"
+"or.it\0"
+"gushikami.okinawa.jp\0her\xc3\xb8y.m\xc3\xb8re-og-romsdal.no\0pro.vn\0"
+"grimstad.no\0"
+"educational.museum\0"
+"kaneyama.fukushima.jp\0"
+"chikuho.fukuoka.jp\0lolipop.io\0"
+"yoshimi.saitama.jp\0sakata.yamagata.jp\0radio\0from-tn.com\0"
+"or.jp\0"
+"urn.arpa\0house.museum\0"
+"takazaki.miyazaki.jp\0or.ke\0"
+"cloudns.in\0"
+"cruises\0"
+"trentinoa-adige.it\0"
+"bpl.biz\0"
+"ed.jp\0minano.saitama.jp\0"
+"or.kr\0"
+"za.bz\0"
+"\xe0\xb8\x97\xe0\xb8\xab\xe0\xb8\xb2\xe0\xb8\xa3.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+"ns.ca\0"
+"cloudns.cc\0"
+"fukaya.saitama.jp\0"
+"sakurai.nara.jp\0lol\0"
+"\xe7\xb6\xb2\xe8\xb7\xaf.tw\0"
+"nagaokakyo.kyoto.jp\0"
+"lifeinsurance\0"
+"nishiizu.shizuoka.jp\0"
+"s3.dualstack.ap-northeast-1.amazonaws.com\0"
+"nakano.tokyo.jp\0"
+"\xc3\xa5rdal.no\0"
+"go.ci\0kamo.kyoto.jp\0lib.tn.us\0basketball\0"
+"americanfamily\0dance\0"
+"lpl\0dnsalias.net\0"
+"kashima.ibaraki.jp\0\xe6\xbe\xb3\xe9\x97\xa8\0avianca\0"
+"namie.fukushima.jp\0or.na\0"
+"kwpsp.gov.pl\0\xe5\x85\xac\xe7\x9b\x8a\0\xd0\xbc\xd0\xbe\xd1\x81\xd0\xba\xd0\xb2\xd0\xb0\0"
+"green\0"
+"go.cr\0or.mu\0"
+"higashikawa.hokkaido.jp\0"
+"habmer.no\0"
+"psse.gov.pl\0"
+"conf.lv\0lavangen.no\0"
+"man\0"
+"press.cy\0"
+"quebec.museum\0map\0"
+"esp.br\0roma.museum\0mba\0"
+"ikeda.nagano.jp\0stryn.no\0"
+"military.museum\0"
+"levanger.no\0"
+"\xe7\xb5\x84\xe7\xb9\x94.tw\0accesscam.org\0"
+"yachts\0"
+"historichouses.museum\0"
+"plurinacional.bo\0beskidy.pl\0"
+"valer.ostfold.no\0"
+"dnsup.net\0"
+"pfizer\0"
+"meiwa.mie.jp\0"
+"association.museum\0"
+"kunneppu.hokkaido.jp\0citi\0"
+"nakaniikawa.toyama.jp\0"
+"skanit.no\0boehringer\0georgia.su\0"
+"nisshin.aichi.jp\0"
+"is-a-patsfan.org\0"
+"asahi.yamagata.jp\0"
+"aizubange.fukushima.jp\0project.museum\0"
+"columbus.museum\0tana.no\0"
+"mallorca.museum\0amfam\0"
+"ltd\0"
+"or.pw\0"
+"yashiro.hyogo.jp\0zoology.museum\0kongsvinger.no\0"
+"city\0"
+"is.gov.pl\0democrat\0"
+"misato.miyagi.jp\0market\0"
+"yonago.tottori.jp\0"
+"trentinostirol.it\0"
+"gitlab.io\0"
+"\xed\x95\x9c\xea\xb5\xad\0hermes\0"
+"ed.pw\0med\0issmarterthanyou.com\0"
+"salvador.br\0"
+"miyashiro.saitama.jp\0hokuto.yamanashi.jp\0gliwice.pl\0"
+"nysa.pl\0men\0"
+"kanazawa.ishikawa.jp\0"
+"tsukiyono.gunma.jp\0"
+"utazu.kagawa.jp\0"
+"sos.pl\0"
+"bahn.museum\0"
+"go.id\0k.se\0hospital\0"
+"rm.it\0"
+"assabu.hokkaido.jp\0kakinoki.shimane.jp\0"
+"cc.al.us\0audible\0"
+"rebun.hokkaido.jp\0"
+"modern.museum\0research.museum\0"
+"nic.in\0crimea.ua\0"
+"virgin\0"
+"zp.ua\0"
+"seki.gifu.jp\0nowruz\0"
+"go.it\0"
+"or.th\0"
+"netbank\0"
+"aizumisato.fukushima.jp\0"
+"sigdal.no\0"
+"hanno.saitama.jp\0"
+"t\xc3\xb8nsberg.no\0everbank\0"
+"nishiwaki.hyogo.jp\0"
+"go.jp\0sko.gov.pl\0fishing\0"
+"act.au\0suzuki\0"
+"labor.museum\0"
+"or.ug\0markets\0"
+"go.ke\0"
+"andria-trani-barletta.it\0hirakata.osaka.jp\0"
+"or.tz\0"
+"bern.museum\0"
+"photography.museum\0"
+"shoes\0"
+"kiwa.mie.jp\0ryokami.saitama.jp\0"
+"mil.ac\0trento.it\0moareke.no\0"
+"mil.ae\0or.us\0"
+"vefsn.no\0"
+"go.kr\0*.telebit.xyz\0"
+"tires\0diskstation.org\0"
+"lom.it\0tomigusuku.okinawa.jp\0news\0"
+"nirasaki.yamanashi.jp\0"
+"mil.al\0\xd2\x9b\xd0\xb0\xd0\xb7\0"
+"wuoz.gov.pl\0"
+"taira.toyama.jp\0"
+"mil\0s3-external-1.amazonaws.com\0"
+"mil.ba\0s3-website.ca-central-1.amazonaws.com\0"
+"mil.ar\0"
+"hdfcbank\0"
+"modalen.no\0"
+"noheji.aomori.jp\0isleofman.museum\0"
+"stange.no\0exposed\0mit\0"
+"dolls.museum\0"
+"mil.az\0lombardy.it\0mutsuzawa.chiba.jp\0"
+"next\0"
+"cloudns.us\0"
+"hyogo.jp\0"
+"mil.bo\0"
+"loppa.no\0"
+"mil.br\0ichinomiya.chiba.jp\0"
+"hamura.tokyo.jp\0malbork.pl\0"
+"frei.no\0krasnodar.su\0mangyshlak.su\0go.leg.br\0"
+"usui.fukuoka.jp\0"
+"baseball.museum\0"
+"mil.by\0reise\0"
+"grocery\0"
+"toyako.hokkaido.jp\0"
+"mil.cl\0"
+"mil.cn\0"
+"mil.co\0"
+"trentinosued-tirol.it\0ainan.ehime.jp\0iizuna.nagano.jp\0wsa.gov.pl\0"
+"jeju.kr\0georgia.museum\0"
+"mlb\0"
+"cultural.museum\0karacol.su\0"
+"dnsking.ch\0"
+"higashitsuno.kochi.jp\0"
+"tj\xc3\xb8me.no\0"
+"mil.do\0"
+"viterbo.it\0"
+"obninsk.su\0"
+"mil.ec\0drayddns.com\0"
+"mma\0s3.amazonaws.com\0"
+"mil.eg\0kikuchi.kumamoto.jp\0mihama.wakayama.jp\0skole.museum\0kirkenes.no\0mls\0"
+"kristiansand.no\0\xe5\xa4\xa7\xe6\x8b\xbf\0from-nh.com\0"
+"\xc3\xa5mot.no\0"
+"warszawa.pl\0servehalflife.com\0"
+"sosnowiec.pl\0"
+"obuse.nagano.jp\0vote\0cloudycluster.net\0"
+"kvinnherad.no\0"
+"keymachine.de\0"
+"naruto.tokushima.jp\0"
+"lom.no\0"
+"graphics\0"
+"cc.vi.us\0"
+"barcelona\0"
+"cloudns.club\0"
+"voto\0"
+"go.pw\0"
+"brasilia.me\0"
+"kakogawa.hyogo.jp\0podzone.net\0"
+"takaoka.toyama.jp\0skjak.no\0lacaixa\0"
+"opencraft.hosting\0"
+"mil.ge\0sue.fukuoka.jp\0wellbeingzone.co.uk\0"
+"trentino.it\0jessheim.no\0leczna.pl\0"
+"mil.gh\0matera.it\0gold\0"
+"moe\0"
+"dlugoleka.pl\0golf\0doesntexist.org\0"
+"iz.hr\0toyosato.shiga.jp\0lutsk.ua\0pics\0"
+"contractors\0moi\0ravendb.run\0"
+"is-a-democrat.com\0"
+"nord-fron.no\0\xe6\x96\xb0\xe5\x8a\xa0\xe5\x9d\xa1\0"
+"mom\0now.sh\0"
+"servegame.com\0"
+"mil.gt\0matsue.shimane.jp\0rybnik.pl\0"
+"byen.site\0"
+"\xc3\xb8ygarden.no\0"
+"mt.it\0"
+"mov\0"
+"col.ng\0"
+"mil.hn\0nerima.tokyo.jp\0"
+"mil.id\0shiraoi.hokkaido.jp\0"
+"nab\0kicks-ass.net\0"
+"higashihiroshima.hiroshima.jp\0"
+"go.th\0nic.tj\0mydatto.net\0"
+"mil.in\0heritage.museum\0"
+"gob.ar\0go.tj\0dyndns1.de\0"
+"dynns.com\0"
+"x.bg\0mil.iq\0"
+"starachowice.pl\0"
+"nba\0game-host.org\0"
+"resindevice.io\0"
+"goog\0weber\0"
+"gob.bo\0go.ug\0"
+"nhs.uk\0"
+"mil.jo\0go.tz\0"
+"gotemba.shizuoka.jp\0"
+"rost.no\0tirol\0"
+"abu.yamaguchi.jp\0"
+"!city.yokohama.jp\0komoro.nagano.jp\0"
+"stathelle.no\0java\0"
+"mil.kg\0"
+"shinjo.nara.jp\0express\0msd\0"
+"gob.cl\0"
+"santamaria.br\0"
+"mil.km\0de.us\0"
+"fst.br\0"
+"wassamu.hokkaido.jp\0kamikitayama.nara.jp\0"
+"\xe8\xb0\xb7\xe6\xad\x8c\0"
+"mil.kr\0on-web.fr\0"
+"foz.br\0cahcesuolo.no\0"
+"fujikawaguchiko.yamanashi.jp\0"
+"dd-dns.de\0"
+"ch.eu.org\0"
+"mil.kz\0"
+"greta.fr\0"
+"gob.do\0oygarden.no\0"
+"ulm.museum\0press.se\0"
+"gob.ec\0yorii.saitama.jp\0square7.de\0"
+"s\xc3\xb8r-odal.no\0mtn\0"
+"viking.museum\0"
+"friulivenezia-giulia.it\0taka.hyogo.jp\0browsersafetymark.io\0"
+"homelinux.org\0"
+"mil.lv\0mtr\0"
+"far.br\0mil.mg\0state.museum\0jondal.no\0nec\0"
+"nerdpol.ovh\0"
+"\xe7\xb5\x84\xe7\xb9\x94.hk\0hitachi.ibaraki.jp\0finearts.museum\0nctu.me\0"
+"bibai.hokkaido.jp\0irish\0"
+"gob.es\0shirahama.wakayama.jp\0biev\xc3\xa1t.no\0"
+"atsuma.hokkaido.jp\0cloudns.pw\0"
+"mil.mv\0"
+"mil.ng\0"
+"aya.miyazaki.jp\0net\0"
+"mil.my\0mil.ni\0"
+"coloradoplateau.museum\0mil.mz\0"
+"new\0does-it.net\0"
+"hachinohe.aomori.jp\0mil.no\0church\0"
+"nfl\0"
+"scientist.aero\0"
+"countryestate.museum\0"
+"nic.za\0"
+"biei.hokkaido.jp\0"
+"cn-north-1.eb.amazonaws.com.cn\0"
+"floro.no\0"
+"oizumi.gunma.jp\0yamanouchi.nagano.jp\0health.museum\0net.eu.org\0"
+"mil.nz\0"
+"sera.hiroshima.jp\0"
+"a\xc3\xa9roport.ci\0shiroishi.miyagi.jp\0mango\0from-ut.com\0"
+"vads\xc3\xb8.no\0"
+"urayasu.chiba.jp\0"
+"isen.kagoshima.jp\0"
+"gob.gt\0fuchu.toyama.jp\0\xe0\xb8\x84\xe0\xb8\xad\xe0\xb8\xa1\0s3.ap-south-1.amazonaws.com\0"
+"barueri.br\0murayama.yamagata.jp\0dynamisches-dns.de\0"
+"intelligence.museum\0ngo\0square7.ch\0nh-serv.co.uk\0"
+"hirado.nagasaki.jp\0kikugawa.shizuoka.jp\0"
+"mil.pe\0"
+"mil.ph\0"
+"gob.hn\0"
+"skjerv\xc3\xb8y.no\0mil.pl\0"
+"alto-adige.it\0shiogama.miyagi.jp\0in-dsl.net\0"
+"aizumi.tokushima.jp\0"
+"nhk\0is-very-good.org\0"
+"halsa.no\0yombo.me\0"
+"campobasso.it\0mil.qa\0lenug.su\0"
+"zakopane.pl\0"
+"yurihonjo.akita.jp\0tsukui.kanagawa.jp\0"
+"ryukyu\0"
+"oishida.yamagata.jp\0"
+"skien.no\0"
+"mil.py\0from-ia.com\0"
+"numata.gunma.jp\0"
+"po.it\0grue.no\0"
+"vegarshei.no\0"
+"ping\0potager.org\0"
+"onagawa.miyagi.jp\0sweetpepper.org\0"
+"lu.it\0me.it\0"
+"knightpoint.systems\0"
+"haebaru.okinawa.jp\0pink\0*.webhare.dev\0"
+"carrd.co\0"
+"\xd8\xa7\xd9\x84\xd9\x8a\xd9\x85\xd9\x86\0"
+"press.ma\0"
+"knx-server.net\0"
+"chtr.k12.ma.us\0"
+"bg.it\0"
+"js.org\0"
+"me.ke\0"
+"tateyama.toyama.jp\0"
+"mil.ru\0"
+"frosinone.it\0mil.rw\0"
+"mil.sh\0"
+"trentin-sudtirol.it\0"
+"i.bg\0"
+"doctor\0"
+"tx.us\0"
+"namsskogan.no\0"
+"systems\0"
+"ath.cx\0"
+"mil.st\0"
+"chikugo.fukuoka.jp\0"
+"mt.us\0nd.us\0cloudaccess.host\0"
+"at.eu.org\0"
+"mil.sy\0"
+"tempioolbia.it\0mil.tj\0\xd8\xb9\xd8\xb1\xd8\xa8\0"
+"kaas.gg\0cust.testing.thingdust.io\0"
+"basel.museum\0lodingen.no\0mil.tm\0"
+"brindisi.it\0ws.na\0mil.to\0"
+"aigo\0"
+"mil.tr\0"
+"townnews-staging.com\0"
+"kitagata.saga.jp\0"
+"mil.tw\0"
+"hl.cn\0rishiri.hokkaido.jp\0"
+"aki.kochi.jp\0mil.tz\0"
+"*.on-rancher.cloud\0"
+"noto.ishikawa.jp\0asahi.nagano.jp\0kumagaya.saitama.jp\0"
+"uki.kumamoto.jp\0lund.no\0"
+"muni.il\0"
+"ah.cn\0ris\xc3\xb8r.no\0mil.vc\0frogans\0"
+"gob.mx\0mil.ve\0"
+"nishitosa.kochi.jp\0gob.ni\0brand.se\0"
+"oji.nara.jp\0"
+"uryu.hokkaido.jp\0"
+"coop.ht\0r\xc3\xb8ros.no\0mil.uy\0"
+"stj\xc3\xb8rdal.no\0"
+"lib.de.us\0"
+"galsa.no\0"
+"slg.br\0"
+"\xe0\xa6\xad\xe0\xa6\xbe\xe0\xa6\xb0\xe0\xa6\xa4\0"
+"lego\0"
+"sayo.hyogo.jp\0for-better.biz\0"
+"katori.chiba.jp\0"
+"trentin-s\xc3\xbc""dtirol.it\0"
+"skierva.no\0hosting\0"
+"stalowa-wola.pl\0"
+"lel.br\0settsu.osaka.jp\0anthro.museum\0"
+"tsushima.aichi.jp\0gob.pa\0"
+"ltd.cy\0"
+"r\xc3\xa1hkker\xc3\xa1vju.no\0gob.pe\0"
+"stargard.pl\0"
+"coop.br\0"
+"gob.pk\0\xd8\xa7\xd9\x8a\xd8\xb1\xd8\xa7\xd9\x86\0"
+"kumamoto.kumamoto.jp\0edunet.tn\0"
+"satte.saitama.jp\0now\0"
+"ip6.arpa\0takahama.fukui.jp\0"
+"os.hedmark.no\0"
+"historisches.museum\0"
+"kanra.gunma.jp\0ownprovider.com\0"
+"zhitomir.ua\0press\0fantasyleague.cc\0"
+"rocher\0"
+"schweiz.museum\0mil.za\0togliatti.su\0"
+"org.ac\0"
+"nodebalancer.linode.com\0"
+"org.ae\0nishinomiya.hyogo.jp\0"
+"org.af\0nra\0cloudns.info\0"
+"org.ag\0\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4\xe0\xa4\xae\xe0\xa5\x8d\0"
+"gujo.gifu.jp\0"
+"org.ai\0teshikaga.hokkaido.jp\0"
+"hamar.no\0sells-for-less.com\0"
+"org.al\0vt.it\0"
+"org.am\0barefoot\0"
+"mil.zm\0obi\0"
+"brescia.it\0"
+"x.se\0"
+"org.ba\0ltd.gi\0geelvinck.museum\0"
+"org.ar\0org.bb\0name.hr\0bale.museum\0"
+"org.au\0togane.chiba.jp\0"
+"london\0"
+"org.bh\0mil.zw\0"
+"org.bi\0matsusaka.mie.jp\0"
+"org.az\0snasa.no\0vestre-toten.no\0"
+"nrw\0"
+"org.bm\0me.so\0"
+"org.bn\0mitake.gifu.jp\0"
+"org.bo\0seiyo.ehime.jp\0minamiashigara.kanagawa.jp\0"
+"msk.ru\0"
+"shangrila\0"
+"org.br\0"
+"org.bs\0tadaoka.osaka.jp\0lighting\0ltd.hk\0"
+"org.bt\0name.et\0gob.sv\0"
+"catholic\0"
+"org.bw\0yakumo.shimane.jp\0"
+"yusuhara.kochi.jp\0"
+"org.ci\0"
+"org.bz\0culture.museum\0"
+"chonan.chiba.jp\0"
+"ouchi.saga.jp\0"
+"org.cn\0"
+"org.co\0mihara.hiroshima.jp\0"
+"philadelphiaarea.museum\0msk.su\0"
+"fhv.se\0shouji\0"
+"dnsalias.org\0"
+"org.cu\0divttasvuotna.no\0"
+"org.cw\0"
+"me.tz\0"
+"org.cy\0even\xc3\xa1\xc5\xa1\xc5\xa1i.no\0me.uk\0ntt\0"
+"alsace\0"
+"org.dm\0"
+"org.do\0"
+"ostroleka.pl\0"
+"otsu.shiga.jp\0me.us\0"
+"org.ec\0gob.ve\0"
+"ozu.ehime.jp\0maison\0ybo.party\0"
+"org.ee\0"
+"california.museum\0"
+"org.eg\0tuxfamily.org\0"
+"name.cy\0publishproxy.com\0"
+"org.dz\0"
+"off\0"
+"zgorzelec.pl\0"
+"kashihara.nara.jp\0"
+"starostwo.gov.pl\0"
+"svalbard.no\0"
+"org.es\0s3-us-west-2.amazonaws.com\0leadpages.co\0"
+"org.et\0grosseto.it\0"
+"cosenza.it\0\xd9\x87\xd9\x85\xd8\xb1\xd8\xa7\xd9\x87\0"
+"name.eg\0ushiku.ibaraki.jp\0"
+"kozaki.chiba.jp\0lib.mt.us\0lib.nd.us\0"
+"i.ng\0"
+"biratori.hokkaido.jp\0kolobrzeg.pl\0"
+"egyptian.museum\0lib.in.us\0"
+"s3.dualstack.ap-southeast-2.amazonaws.com\0"
+"onomichi.hiroshima.jp\0"
+"dr.na\0"
+"tahara.aichi.jp\0ltd.lk\0wang\0"
+"org.ge\0"
+"org.gg\0williamsburg.museum\0piaget\0"
+"org.gh\0is-a-guru.com\0"
+"org.gi\0"
+"name.az\0"
+"hl.no\0"
+"org.gl\0berkeley.museum\0homeftp.org\0"
"org.gn\0"
-"bjerkreim.no\0filegear-au.me\0"
"org.gp\0"
-"org.gr\0ge.it\0shikaoi.hokkaido.jp\0mitsuke.niigata.jp\0"
-"l\xc3\xb8ten.no\0readthedocs.io\0"
-"org.gt\0gal\0"
-"org.gu\0bar.pro\0"
-"mie.jp\0kunneppu.hokkaido.jp\0"
-"holiday\0"
-"gap\0"
-"g.bg\0org.gy\0priv.hu\0pics\0"
-"org.hk\0computer.museum\0crimea.ua\0"
+"trentinsud-tirol.it\0minobu.yamanashi.jp\0equipment\0"
+"org.gr\0"
+"org.gt\0szkola.pl\0"
+"org.gu\0ah.no\0"
+"takino.hyogo.jp\0"
+"nyc\0"
+"org.gy\0"
+"org.hk\0"
+"takahashi.okayama.jp\0i.ph\0*.platformsh.site\0"
"org.hn\0"
-"org.ht\0frl\0uk.net\0"
-"org.hu\0arboretum.museum\0is-a-rockstar.com\0"
-"sites.static.land\0"
-"eun.eg\0"
-"yt\0"
-"\xe5\xa4\xa9\xe4\xb8\xbb\xe6\x95\x99\0"
-"org.il\0tateshina.nagano.jp\0intuit\0"
-"org.im\0naroy.no\0"
-"org.in\0yawatahama.ehime.jp\0ms.leg.br\0"
-"aeroclub.aero\0qld.gov.au\0"
-"umi.fukuoka.jp\0"
-"org.iq\0nordre-land.no\0"
-"org.ir\0support\0"
-"org.is\0kunst.museum\0zm\0cust.testing.thingdust.io\0"
-"org.je\0ee.eu.org\0"
-"cn.it\0"
-"l\xc3\xa4ns.museum\0\xe4\xbd\x9b\xe5\xb1\xb1\0"
-"ribeirao.br\0"
-"miyako.fukuoka.jp\0"
-"0.bg\0zw\0"
-"org.jo\0"
-"shibuya.tokyo.jp\0"
-"saiki.oita.jp\0"
-"monza-e-della-brianza.it\0gdn\0"
+"fla.no\0ltd.ng\0"
+"valleedaoste.it\0"
+"mizumaki.fukuoka.jp\0ogaki.gifu.jp\0\xc3\xa5lesund.no\0*.dapps.earth\0"
+"org.ht\0"
+"org.hu\0tagajo.miyagi.jp\0science\0"
+"hakui.ishikawa.jp\0"
+"yaese.okinawa.jp\0lincoln.museum\0"
+"tochigi.jp\0ask\xc3\xb8y.no\0"
+"sandcats.io\0"
+"k12.tx.us\0"
+"org.il\0"
+"org.im\0"
+"org.in\0pointto.us\0"
+"org.iq\0busan.kr\0"
+"org.ir\0podzone.org\0"
+"pa.gov.br\0org.is\0barsy.net\0"
+"org.je\0\xd9\x85\xd9\x88\xd8\xb1\xd9\x8a\xd8\xaa\xd8\xa7\xd9\x86\xd9\x8a\xd8\xa7\0"
+"kawamata.fukushima.jp\0"
+"cc.or.us\0"
+"n\xc3\xa5\xc3\xa5mesjevuemie.no\0"
+"kita.tokyo.jp\0"
+"higashikurume.tokyo.jp\0"
+"space.museum\0bloomberg\0"
+"flynnhub.com\0"
+"org.jo\0exhibition.museum\0fusa.no\0"
+"ftpaccess.cc\0"
+"botanicalgarden.museum\0"
+"shingu.hyogo.jp\0eu-central-1.elasticbeanstalk.com\0app.lmpm.com\0"
+"ve.it\0"
+"doshi.yamanashi.jp\0antiques.museum\0"
"org.kg\0"
-"ketrzyn.pl\0"
-"org.ki\0skedsmo.no\0gea\0"
-"\xe9\xab\x98\xe7\x9f\xa5.jp\0ftr\0"
-"org.km\0amsterdam\0"
-"alessandria.it\0org.kn\0church\0mt.leg.br\0"
-"cuisinella\0"
-"pg.it\0hannan.osaka.jp\0org.kp\0"
-"org.la\0lib.ri.us\0"
-"org.lb\0no-ip.net\0"
-"org.lc\0k12.ny.us\0"
-"nomi.ishikawa.jp\0"
-"waw.pl\0fun\0"
-"org.kw\0anthro.museum\0from-mo.com\0"
-"omihachiman.shiga.jp\0"
+"org.ki\0i.se\0"
+"kimobetsu.hokkaido.jp\0"
+"org.km\0"
+"org.kn\0"
+"ohkura.yamagata.jp\0us-west-2.elasticbeanstalk.com\0"
+"org.kp\0target\0"
+"org.la\0notteroy.no\0"
+"org.lb\0"
+"pb.gov.br\0org.lc\0sakura\0"
+"commbank\0"
+"kisofukushima.nagano.jp\0org.kw\0hair\0"
"org.ky\0"
-"nahari.kochi.jp\0nagiso.nagano.jp\0org.kz\0"
+"hamada.shimane.jp\0org.kz\0kicks-ass.org\0"
"org.lk\0"
-"chofu.tokyo.jp\0"
+"tv.bb\0gdansk.pl\0"
+"sec.ps\0"
+"cs.it\0"
+"sn\xc3\xa5""ase.no\0"
"org.ma\0"
-"org.lr\0"
-"org.ls\0"
-"gen.in\0nobeoka.miyazaki.jp\0"
-"org.me\0naumburg.museum\0gos.pk\0"
-"belluno.it\0ashibetsu.hokkaido.jp\0org.lv\0"
-"org.mg\0\xe5\x95\x86\xe6\xa5\xad.tw\0"
-"priv.at\0"
-"org.ly\0gives\0"
-"org.mk\0field.museum\0"
-"org.ml\0"
+"org.lr\0brussels\0"
+"org.ls\0westfalen.museum\0sund.no\0"
+"org.me\0dyndns-pics.com\0"
+"org.lv\0"
+"tone.ibaraki.jp\0org.mg\0"
+"agano.niigata.jp\0kv.ua\0"
+"tv.bo\0nishi.osaka.jp\0moroyama.saitama.jp\0org.ly\0odesa.ua\0au.eu.org\0be.eu.org\0"
+"one\0\xe5\xa4\xa9\xe4\xb8\xbb\xe6\x95\x99\0"
+"org.mk\0vt.us\0"
+"tv.br\0org.ml\0ong\0"
+"\xe4\xba\xac\xe9\x83\xbd.jp\0castle.museum\0computerhistory.museum\0"
"org.mn\0"
-"org.mo\0lenvik.no\0"
-"org.na\0"
-"org.ms\0arts.museum\0"
-"caserta.it\0org.mt\0"
-"org.mu\0museum\0lib.mn.us\0"
-"\xe8\x8c\xa8\xe5\x9f\x8e.jp\0org.mv\0"
-"humanities.museum\0org.mw\0org.ng\0"
-"takko.aomori.jp\0org.mx\0nc.tr\0"
+"org.mo\0bielawa.pl\0boutique\0servesarcasm.com\0"
+"kumano.mie.jp\0shacknet.nu\0"
+"matsuno.ehime.jp\0org.na\0onl\0"
+"tsubetsu.hokkaido.jp\0kg.kr\0"
+"org.ms\0dr.tr\0"
+"yukuhashi.fukuoka.jp\0org.mt\0settlement.museum\0"
+"nb.ca\0org.mu\0is-an-actress.com\0"
+"goto.nagasaki.jp\0org.mv\0"
+"kagoshima.jp\0org.mw\0org.ng\0"
+"org.mx\0heroy.nordland.no\0lancome\0soccer\0"
"org.my\0org.ni\0"
-"mihama.wakayama.jp\0org.mz\0gniezno.pl\0"
-"nt.au\0blogspot.co.uk\0"
-"earth\0"
-"z.se\0iki.fi\0"
-"org.nr\0epost\0"
-"s3.eu-west-3.amazonaws.com\0"
-"trentins\xc3\xbc""d-tirol.it\0"
-"frana.no\0"
-"takatsuki.osaka.jp\0"
-"nt.ca\0"
-"kashihara.nara.jp\0verm\xc3\xb6gensberater\0"
-"ms.us\0nc.us\0itau\0"
-"org.nz\0"
-"hareid.no\0"
-"from.hr\0"
-"org.om\0"
-"miyagi.jp\0"
-"saito.miyazaki.jp\0"
-"org.pa\0fyi\0"
-"mobi.tt\0"
-"civilwar.museum\0rissa.no\0org.pe\0security\0\xd9\x85\xd9\x88\xd9\x82\xd8\xb9\0remotewd.com\0"
-"org.pf\0"
-"filatelia.museum\0"
-"org.ph\0"
-"dolls.museum\0rodoy.no\0tinn.no\0"
-"mobi.tz\0creditunion\0"
-"org.pk\0"
-"org.pl\0vapor.cloud\0"
-"org.pn\0"
-"ski.no\0"
-"org.qa\0haus\0"
-"kumenan.okayama.jp\0yatsuka.shimane.jp\0org.pr\0"
-"gulen.no\0org.ps\0"
-"misawa.aomori.jp\0org.pt\0"
-"ally\0bugatti\0filegear.me\0"
-"usculture.museum\0org.py\0keymachine.de\0"
-"military.museum\0"
-"koto.shiga.jp\0restaurant\0"
-"nt.edu.au\0volvo\0"
-"sannan.hyogo.jp\0other.nf\0"
-"swiss\0youtube\0"
-"vb.it\0aizumisato.fukushima.jp\0"
-"s3-website.ap-northeast-2.amazonaws.com\0"
-"sch.ae\0panama.museum\0"
-"hyuga.miyazaki.jp\0"
-"s3-us-west-1.amazonaws.com\0"
-"agr.br\0"
-"s3-website.ca-central-1.amazonaws.com\0"
-"gv.ao\0gle\0ping\0"
-"org.ro\0pimienta.org\0"
-"gen.nz\0"
-"org.sa\0lexus\0pink\0nfshost.com\0"
-"gv.at\0hiroshima.jp\0kawajima.saitama.jp\0org.sb\0"
+"org.mz\0"
+"itau\0"
+"valleeaoste.it\0iveland.no\0"
+"rmit\0"
+"chicago.museum\0"
+"pvt.ge\0"
+"hongo.hiroshima.jp\0org.nr\0"
+"ooo\0"
+"hof.no\0"
+"okuma.fukushima.jp\0farmers.museum\0"
+"stuttgart.museum\0"
+"ltd.ua\0"
+"org.nz\0pramerica\0"
+"rel.ht\0"
+"org.om\0coop.rw\0virtueeldomein.nl\0"
+"academia.bo\0\xc3\xa5l.no\0"
+"kamogawa.chiba.jp\0b.ssl.fastly.net\0"
+"org.pa\0lib.me.us\0"
+"shikatsu.aichi.jp\0nordre-land.no\0ltd.uk\0uconnect\0"
+"org.pe\0"
+"bari.it\0org.pf\0"
+"fujimi.saitama.jp\0org.ph\0"
+"q-a.eu.org\0"
+"org.pk\0glade\0"
+"minamiechizen.fukui.jp\0org.pl\0"
+"tabayama.yamanashi.jp\0org.pn\0xihuan\0"
+"lib.as.us\0"
+"theater.museum\0narvik.no\0org.qa\0"
+"org.pr\0"
+"kurobe.toyama.jp\0juedisches.museum\0gamvik.no\0org.ps\0\xe5\x95\x86\xe5\xba\x97\0cdn77-ssl.net\0"
+"kagamino.okayama.jp\0org.pt\0"
+"anan.tokushima.jp\0"
+"alt.za\0"
+"yawata.kyoto.jp\0"
+"org.py\0bg.eu.org\0"
+"maringa.br\0coop.tt\0apartments\0vapor.cloud\0"
+"aoste.it\0science.museum\0org\0"
+"bukhara.su\0"
+"pay\0"
+"taishi.osaka.jp\0"
+"wielun.pl\0health\0"
+"basilicata.it\0higashiizumo.shimane.jp\0narusawa.yamanashi.jp\0"
+"lebtimnetz.de\0"
+"naie.hokkaido.jp\0"
+"coop.mv\0"
+"coop.mw\0"
+"org.ro\0k12.wa.us\0"
+"oslo.no\0"
+"medicina.bo\0tysv\xc3\xa6r.no\0org.sa\0frontier\0"
+"org.sb\0"
"org.rs\0org.sc\0"
-"org.sd\0"
-"org.se\0org.ru\0"
-"omaha.museum\0org.sg\0nflfan.org\0"
+"itayanagi.aomori.jp\0wakasa.tottori.jp\0org.sd\0"
+"org.se\0club\0org.ru\0"
+"org.rw\0org.sg\0bloxcms.com\0"
"org.sh\0"
-"sandnessj\xc3\xb8""en.no\0"
-"org.sl\0"
-"sande.vestfold.no\0"
-"org.sn\0"
+"\xe6\x94\xbf\xe5\xba\x9c.\xe9\xa6\x99\xe6\xb8\xaf\0"
+"org.sl\0tkmaxx\0"
+"eu.org\0barsy.club\0"
+"org.sn\0name.vn\0"
"org.so\0"
-"nakatombetsu.hokkaido.jp\0"
-"nesna.no\0country\0"
-"ancona.it\0kiryu.gunma.jp\0hitachiota.ibaraki.jp\0"
-"org.st\0"
-"karasjohka.no\0blogspot.co.ke\0"
-"kitagawa.miyazaki.jp\0hasuda.saitama.jp\0org.sv\0"
-"gmo\0"
-"gs.nt.no\0org.sy\0"
-"org.sz\0org.tj\0"
-"org.tm\0"
-"yorii.saitama.jp\0org.tn\0"
-"org.to\0"
-"gmx\0"
-"mobi.na\0and\xc3\xb8y.no\0org.ua\0lib.de.us\0"
+"altoadige.it\0dyr\xc3\xb8y.no\0"
+"corporation.museum\0org.ss\0"
+"oyabe.toyama.jp\0org.st\0dnshome.de\0"
+"shizuoka.jp\0"
+"takinoue.hokkaido.jp\0org.sv\0googleapis.com\0"
+"tv.im\0nico\0"
+"on-the-web.tv\0"
+"org.sy\0ott\0"
+"org.sz\0org.tj\0stcgroup\0"
+"amica\0"
+"naoshima.kagawa.jp\0org.tm\0"
+"tv.it\0org.tn\0ap-northeast-1.elasticbeanstalk.com\0"
+"gaivuotna.no\0org.to\0"
+"poa.br\0cc.de.us\0"
+"org.ua\0"
"org.tr\0"
-"entomology.museum\0moskenes.no\0cn.ua\0"
-"org.tt\0"
-"modern.museum\0"
-"\xe6\x96\xb0\xe6\xbd\x9f.jp\0hioki.kagoshima.jp\0"
-"mobi.ng\0org.tw\0org.ug\0"
-"olkusz.pl\0"
-"org.uk\0tickets\0"
-"1kapp.com\0"
-"lardal.no\0"
-"fedex\0"
-"moareke.no\0org.vc\0ap-south-1.elasticbeanstalk.com\0"
-"org.ve\0"
-"goo\0hobby-site.com\0"
-"gop\0"
-"minnesota.museum\0org.uy\0org.vi\0"
-"org.uz\0"
-"got\0wedeploy.sh\0"
-"plantation.museum\0k12.nh.us\0"
-"gov\0fukui.fukui.jp\0matsuda.kanagawa.jp\0org.vn\0"
-"rad\xc3\xb8y.no\0"
-"readmyblog.org\0"
-"org.vu\0"
-"vic.au\0edeka\0"
-"sekigahara.gifu.jp\0"
-"telekommunikation.museum\0"
-"kembuchi.hokkaido.jp\0"
-"agakhan\0irish\0"
-"piedmont.it\0"
-"org.ws\0"
-"shima.mie.jp\0ogose.saitama.jp\0gen.tr\0"
-"qh.cn\0blogspot.co.nz\0"
-"yokosuka.kanagawa.jp\0minamisanriku.miyagi.jp\0katano.osaka.jp\0swatch\0"
-"overhalla.no\0baidu\0\xe9\x80\x9a\xe8\xb2\xa9\0"
-"kamikitayama.nara.jp\0kimino.wakayama.jp\0"
-"donna.no\0"
-"ah.cn\0kitchen\0"
-"berlin.museum\0g.se\0hbo\0"
-"al.leg.br\0"
-"int.eu.org\0"
-"american.museum\0"
-"toray\0"
-"haibara.shizuoka.jp\0""2ix.at\0"
-"aosta-valley.it\0oki.fukuoka.jp\0kitashiobara.fukushima.jp\0misugi.mie.jp\0"
-"org.za\0"
-"amex\0"
-"mobi.ke\0herad.no\0aramco\0"
-"sch.id\0bando.ibaraki.jp\0"
-"glug.org.uk\0"
-"madrid\0"
-"szkola.pl\0"
-"imizu.toyama.jp\0"
-"osen.no\0org.zm\0"
-"\xd8\xb4\xd8\xa8\xd9\x83\xd8\xa9\0"
-"trentin-sudtirol.it\0uenohara.yamanashi.jp\0"
-"2ix.ch\0"
-"fidelity\0"
-"sch.ir\0"
-"frog.museum\0nt.no\0"
-"org.zw\0cbg.ru\0stufftoread.com\0"
-"urasoe.okinawa.jp\0mopar\0"
-"council.aero\0x.bg\0"
-"soundcast.me\0"
-"savona.it\0kyuragi.saga.jp\0"
-"miyakonojo.miyazaki.jp\0cookingchannel\0"
-"is-an-anarchist.com\0""2ix.de\0"
-"kurate.fukuoka.jp\0"
-"sch.jo\0"
-"theworkpc.com\0"
-"lplfinancial\0"
-"karate.museum\0kommunalforbund.se\0cn.eu.org\0"
-"zj.cn\0"
-"hoylandet.no\0law.za\0"
-"family\0"
-"to.it\0"
-"lib.va.us\0"
-"shinshinotsu.hokkaido.jp\0"
-"ando.nara.jp\0"
-"cranbrook.museum\0r\xc3\xa5holt.no\0"
-"vald-aosta.it\0"
-"erimo.hokkaido.jp\0"
-"gs.ah.no\0k12.ca.us\0"
-"hitachi.ibaraki.jp\0"
-"cc.wv.us\0"
-"rj.gov.br\0"
-"sch.lk\0s3-website.eu-west-2.amazonaws.com\0hopto.me\0"
-"lerdal.no\0"
-"customer.enonic.io\0"
-"trapani.it\0"
-"vic.gov.au\0investments\0"
-"gc.ca\0domains\0"
-"sch.ly\0cloud66.ws\0"
-"volkswagen\0"
-"assedic.fr\0psp.gov.pl\0"
-"fujishiro.ibaraki.jp\0"
-"nt.ro\0"
-"toyone.aichi.jp\0"
-"nemuro.hokkaido.jp\0broke-it.net\0"
-"sch.ng\0"
-"okawa.fukuoka.jp\0"
-"guovdageaidnu.no\0"
-"kaho.fukuoka.jp\0"
-"fage\0vote\0"
-"wellbeingzone.eu\0"
-"valle-d-aosta.it\0priv.pl\0"
-"asaminami.hiroshima.jp\0notogawa.shiga.jp\0"
-"karm\xc3\xb8y.no\0"
-"voto\0"
-"kerryhotels\0wedeploy.me\0"
-"baghdad.museum\0amfam\0ro.eu.org\0"
-"wakayama.jp\0"
-"hiv\0"
-"lel.br\0"
-"forsand.no\0"
-"\xd1\x80\xd1\x83\xd1\x81\0"
-"na.it\0"
-"bradesco\0"
-"ureshino.mie.jp\0"
-"od.ua\0"
-"sic.it\0"
-"interactive.museum\0norfolk.museum\0\xd7\x99\xd7\xa8\xd7\x95\xd7\xa9\xd7\x9c\xd7\x99\xd7\x9d.museum\0"
-"reggio-calabria.it\0"
-"gs.svalbard.no\0"
-"alibaba\0"
-"priv.no\0sch.qa\0"
-"sobetsu.hokkaido.jp\0fail\0"
-"dominic.ua\0cy.eu.org\0goip.de\0"
-"iz.hr\0square7.net\0"
-"pe.ca\0masfjorden.no\0"
-"tamayu.shimane.jp\0"
-"padua.it\0static.land\0"
-"marumori.miyagi.jp\0kamitonda.wakayama.jp\0hkt\0"
-"aure.no\0onyourside\0"
-"*.kobe.jp\0chihayaakasaka.osaka.jp\0lgbt\0"
-"misconfused.org\0"
-"canada.museum\0blogspot.co.za\0"
-"itoman.okinawa.jp\0nakaniikawa.toyama.jp\0"
-"avocat.fr\0jeep\0"
-"trana.no\0"
-"rel.ht\0"
-"meraker.no\0km.ua\0"
-"academy.museum\0miniserver.com\0"
-"jevnaker.no\0"
-"harstad.no\0"
-"abruzzo.it\0hashbang.sh\0"
-"sch.sa\0"
-"nic.in\0"
-"ah.no\0cz.eu.org\0"
-"tranby.no\0"
-"kunitachi.tokyo.jp\0"
-"priv.me\0"
-"kibichuo.okayama.jp\0mugi.tokushima.jp\0"
-"si.eu.org\0app.os.stg.fedoraproject.org\0"
-"minamiechizen.fukui.jp\0tsubetsu.hokkaido.jp\0"
-"ostre-toten.no\0orange\0"
-"nakatsugawa.gifu.jp\0"
-"vs.it\0smart\0"
-"cologne\0"
-"tsuruga.fukui.jp\0"
-"ln.cn\0"
-"loans\0"
-"fukusaki.hyogo.jp\0"
-"lavagis.no\0cloudns.eu\0"
-"itami.hyogo.jp\0wroclaw.pl\0cool\0"
-"nico\0"
-"udi.br\0tsuno.kochi.jp\0nowaruda.pl\0"
-"coop\0"
-"e.bg\0"
-"eu-west-2.elasticbeanstalk.com\0dk.eu.org\0"
-"wv.us\0"
-"namerikawa.toyama.jp\0"
-"lyngdal.no\0"
-"hot\0"
-"how\0"
-"us-west-2.elasticbeanstalk.com\0"
-"oyama.tochigi.jp\0"
-"bellevue.museum\0"
-"nyc.mn\0"
-"fans\0style\0"
-"\xd9\x81\xd9\x84\xd8\xb3\xd8\xb7\xd9\x8a\xd9\x86\0"
-"cl.it\0"
-"sevastopol.ua\0"
-"okutama.tokyo.jp\0"
-"stateofdelaware.museum\0"
-"dyndns-work.com\0"
-"sel.no\0co.technology\0"
-"kwpsp.gov.pl\0"
-"engine.aero\0design.museum\0"
-"sorreisa.no\0sk.eu.org\0"
-"vardo.no\0"
-"karumai.iwate.jp\0akishima.tokyo.jp\0itabashi.tokyo.jp\0"
-"sue.fukuoka.jp\0"
-"\xe6\x94\xbf\xe5\x8a\xa1\0"
-"cloudns.in\0"
-"ibm\0"
-"ba.gov.br\0cesena-forli.it\0hekinan.aichi.jp\0moriyoshi.akita.jp\0"
-"inderoy.no\0"
-"brindisi.it\0"
-"dyndns.ddnss.de\0"
-"pe.it\0"
-"dyroy.no\0ice\0"
-"\xe0\xa6\xad\xe0\xa6\xbe\xe0\xa6\xb0\xe0\xa6\xa4\0"
-"filegear-ie.me\0"
-"simple-url.com\0"
-"de.eu.org\0"
-"hazu.aichi.jp\0"
-"riodejaneiro.museum\0cloudns.cc\0"
-"beardu.no\0"
-"bulsan.it\0"
-"arendal.no\0icu\0dynamisches-dns.de\0"
-"rel.pl\0"
-"sa.gov.au\0barsycenter.com\0"
-"codes\0"
-"takayama.gunma.jp\0olsztyn.pl\0"
-"za.com\0"
-"mamurogawa.yamagata.jp\0"
-"intelligence.museum\0\xc3\xb8stre-toten.no\0farm\0"
-"\xc3\xa1k\xc5\x8boluokta.no\0"
-"pe.kr\0"
-"mer\xc3\xa5ker.no\0"
-"dental\0"
-"sch.zm\0"
-"yosemite.museum\0dyndns.org\0"
-"katsuyama.fukui.jp\0"
-"x.se\0afamilycompany\0vacations\0"
-"rieti.it\0"
-"ru.eu.org\0se.eu.org\0"
-"kounosu.saitama.jp\0fast\0"
-"bill.museum\0"
-"akabira.hokkaido.jp\0"
-"matsuno.ehime.jp\0fbxos.fr\0"
-"\xe6\x95\x8e\xe8\x82\xb2.hk\0\xd1\x81\xd1\x80\xd0\xb1\0wedeploy.io\0"
-"achi.nagano.jp\0"
-"ifm\0nike\0"
-"happou.akita.jp\0"
-"gleeze.com\0"
-"airforce\0hk.org\0"
-"k12.wy.us\0"
-"rr.gov.br\0tawaramoto.nara.jp\0"
-"mansion.museum\0ulvik.no\0tunk.org\0"
-"venezia.it\0"
-"tel.tr\0"
-"iwata.shizuoka.jp\0incheon.kr\0"
-"castle.museum\0bostik\0"
-"fhs.no\0h\xc3\xa5.no\0"
-"nishiawakura.okayama.jp\0tabuse.yamaguchi.jp\0wskr.gov.pl\0"
-"\xe0\xb6\xbd\xe0\xb6\x82\xe0\xb6\x9a\xe0\xb7\x8f\0*.compute.amazonaws.com\0webhop.me\0"
-"karasuyama.tochigi.jp\0"
-"zushi.kanagawa.jp\0"
-"homeunix.com\0"
-"trentino-sud-tirol.it\0"
-"christmas\0"
-"val-daosta.it\0iwakuni.yamaguchi.jp\0"
-"joburg\0"
-"nic.tj\0"
-"jab.br\0*.kitakyushu.jp\0"
-"donostia.museum\0kvinnherad.no\0"
-"\xd0\xba\xd0\xb0\xd1\x82\xd0\xbe\xd0\xbb\xd0\xb8\xd0\xba\0"
-"eti.br\0aizuwakamatsu.fukushima.jp\0kitakami.iwate.jp\0"
-"belau.pw\0philips\0sa.com\0"
-"cuiaba.br\0kamiichi.toyama.jp\0"
-"her\xc3\xb8y.m\xc3\xb8re-og-romsdal.no\0vaksdal.no\0"
-"rs.gov.br\0sc.gov.br\0asti.it\0"
-"historisches.museum\0"
-"nhs.uk\0flynnhub.com\0"
-"soo.kagoshima.jp\0"
-"pesarourbino.it\0"
-"flekkefjord.no\0"
-"americana.museum\0leangaviika.no\0torsken.no\0"
-"zp.gov.pl\0center\0"
-"myhome-server.de\0"
-"rmit\0"
-"hdfc\0\xe4\xb8\xad\xe4\xbf\xa1\0familyds.com\0"
-"srv.br\0milan.it\0tosu.saga.jp\0"
-"forgot.his.name\0"
-"am.gov.br\0turen.tn\0"
-"groks-the.info\0"
-"h\xc3\xa1pmir.no\0"
-"fujikawa.shizuoka.jp\0"
-"tsukuba.ibaraki.jp\0kitadaito.okinawa.jp\0"
-"ri.it\0"
-"*.nom.br\0okazaki.aichi.jp\0izumo.shimane.jp\0"
-"airline.aero\0ca.eu.org\0logoip.com\0"
-"bi.it\0museum.tt\0"
-"natori.miyagi.jp\0"
-"namsskogan.no\0macys\0"
-"sondre-land.no\0"
-"historisch.museum\0"
-"imari.saga.jp\0homedepot\0"
-"shoes\0"
-"kharkov.ua\0from-nj.com\0"
-"kawakita.ishikawa.jp\0"
-"fedorainfracloud.org\0"
-"osasco.br\0friuli-vgiulia.it\0"
-"cymru\0"
-"washtenaw.mi.us\0"
-"tsuyama.okayama.jp\0boston\0"
-"tokai.ibaraki.jp\0"
-"sherbrooke.museum\0virtuel.museum\0"
-"tm.cy\0inc\0"
-"scholarships\0bryansk.su\0"
-"komoro.nagano.jp\0kunigami.okinawa.jp\0"
-"lib.al.us\0ing\0"
-"uryu.hokkaido.jp\0"
-"cc.ri.us\0ink\0"
-"turystyka.pl\0"
-"directory\0"
-"cloudns.us\0"
-"rn.gov.br\0int\0"
-"kutchan.hokkaido.jp\0"
-"verran.no\0"
-"lib.me.us\0"
+"emergency.aero\0"
+"morena.br\0funahashi.toyama.jp\0org.tt\0"
+"\xd8\xaa\xd9\x88\xd9\x86\xd8\xb3\0"
"oristano.it\0"
-"bolivia.bo\0"
-"group\0"
+"eigersund.no\0org.tw\0org.ug\0"
+"aichi.jp\0cuisinella\0pet\0"
+"name.tj\0"
+"shonai.fukuoka.jp\0org.uk\0blogsite.org\0"
+"lease\0ovh\0"
+"gangaviika.no\0coop.py\0"
+"foundation.museum\0tromso.no\0telebit.io\0"
+"semboku.akita.jp\0tree.museum\0"
+"name.tr\0"
+"org.vc\0"
+"name.tt\0ddnsgeek.com\0"
+"hachirogata.akita.jp\0tcm.museum\0org.ve\0"
+"kamaishi.iwate.jp\0"
+"bt.it\0"
+"karaganda.su\0"
+"shikaoi.hokkaido.jp\0org.uy\0org.vi\0town\0"
+"okayama.okayama.jp\0org.uz\0"
+"iruma.saitama.jp\0"
+"org.vn\0barsy.pro\0"
+"v.bg\0"
+"codespot.com\0git-pages.rit.edu\0"
+"gjerstad.no\0rel.pl\0"
+"kiyama.saga.jp\0org.vu\0"
+"chuo.chiba.jp\0phd\0hr.eu.org\0"
+"asuke.aichi.jp\0communication.museum\0"
+"nagi.okayama.jp\0athleta\0dnsiskinky.com\0"
+"coop.km\0org.ws\0"
+"podlasie.pl\0of.london\0"
+"club.aero\0uto.kumamoto.jp\0yoshida.saitama.jp\0"
+"otobe.hokkaido.jp\0"
+"shima.mie.jp\0haus\0"
+"pid\0"
+"ichihara.chiba.jp\0tv.na\0lib.vt.us\0"
+"leirvik.no\0"
+"notodden.no\0dc.us\0"
+"toys\0"
+"kouyama.kagoshima.jp\0"
+"vik.no\0akdn\0is-a-designer.com\0"
+"barsy.pub\0"
+"kitashiobara.fukushima.jp\0"
+"pin\0search\0"
+"aeroclub.aero\0"
+"horokanai.hokkaido.jp\0"
+"port.fr\0"
+"miyawaka.fukuoka.jp\0yatsushiro.kumamoto.jp\0yamatokoriyama.nara.jp\0koganei.tokyo.jp\0"
+"lgbt\0"
+"sakuragawa.ibaraki.jp\0usercontent.jp\0"
+"lib.il.us\0"
+"name.qa\0org.za\0"
+"luster.no\0name.pr\0"
+"pi.gov.br\0mr.no\0"
+"chernigov.ua\0"
+"sells-it.net\0"
+"from-in.com\0"
+"fujisato.akita.jp\0"
+"ichinohe.iwate.jp\0"
+"org.zm\0"
+"davvesiida.no\0"
+"horten.no\0kviteseid.no\0"
+"broker.aero\0saitama.jp\0kitanakagusuku.okinawa.jp\0name.na\0\xeb\x8b\xb7\xeb\x84\xb7\0"
+"troandin.no\0"
+"bialowieza.pl\0"
+"name.mv\0"
+"name.ng\0org.zw\0"
+"koka.shiga.jp\0"
+"name.my\0"
+"tagawa.fukuoka.jp\0"
+"nike\0"
+"yamanashi.jp\0"
+"serveftp.net\0"
+"riopreto.br\0"
+"tochigi.tochigi.jp\0oregontrail.museum\0"
+"intl.tn\0"
+"walbrzych.pl\0"
+"noshiro.akita.jp\0"
+"prvcy.page\0"
+"reklam.hu\0cc.tx.us\0"
"play\0"
-"e.se\0erni\0"
-"ome.tokyo.jp\0"
-"chicago.museum\0steiermark.museum\0"
-"tm.fr\0yachimata.chiba.jp\0beppu.oita.jp\0"
-"camdvr.org\0hb.cldmail.ru\0"
-"ap.gov.br\0"
-"omi.nagano.jp\0"
-"eiheiji.fukui.jp\0"
-"ro.gov.br\0seirou.niigata.jp\0nishinoshima.shimane.jp\0"
-"somna.no\0"
-"setouchi.okayama.jp\0"
-"iris.arpa\0ravendb.community\0uklugs.org\0"
-"fuji.shizuoka.jp\0gmina.pl\0"
-"dvrdns.org\0"
-"joboji.iwate.jp\0"
-"gs.tm.no\0cd.eu.org\0"
-"kawazu.shizuoka.jp\0"
-"mo.cn\0chiyoda.tokyo.jp\0"
-"dh.bytemark.co.uk\0"
-"asahi.ibaraki.jp\0tsu.mie.jp\0"
-"ap.gov.pl\0total\0"
-"v.bg\0bus.museum\0namsos.no\0"
-"nanmoku.gunma.jp\0bel.tr\0"
-"tm.hu\0"
-"drobak.no\0mex.com\0"
-"hikone.shiga.jp\0jcb\0"
-"malvik.no\0agric.za\0wang\0fastvps-server.com\0"
-"is-a-chef.org\0"
-"prato.it\0*.cryptonomic.net\0"
-"!city.kitakyushu.jp\0"
-"\xd9\x85\xd9\x88\xd8\xa8\xd8\xa7\xd9\x8a\xd9\x84\xd9\x8a\0"
-"mayfirst.org\0"
-"shirosato.ibaraki.jp\0izumisano.osaka.jp\0kiyose.tokyo.jp\0jcp\0"
-"omasvuotna.no\0"
-"schokoladen.museum\0official.academy\0"
-"togane.chiba.jp\0yotsukaido.chiba.jp\0ist\0"
-"wa.au\0clothing\0"
-"hongo.hiroshima.jp\0"
-"services.aero\0tas.au\0rivne.ua\0"
-"her\xc3\xb8y.nordland.no\0"
-"conference.aero\0"
-"andriatranibarletta.it\0museum.mv\0"
-"museum.mw\0is-a-therapist.com\0"
-"itv\0"
-"tm.km\0"
-"pomorskie.pl\0dyndns.tv\0"
-"bonn.museum\0"
-"kiyosato.hokkaido.jp\0"
-"museum.no\0"
-"nagato.yamaguchi.jp\0"
-"casacam.net\0"
-"bamble.no\0"
-"pv.it\0"
-"is-a-candidate.org\0"
-"k12.or.us\0"
-"shibetsu.hokkaido.jp\0shiojiri.nagano.jp\0"
-"surrey.museum\0forsale\0"
-"\xe5\xa4\xa7\xe9\x98\xaa.jp\0"
-"museum.om\0"
-"tm.mc\0"
-"tajimi.gifu.jp\0edunet.tn\0"
-"izumozaki.niigata.jp\0"
-"tm.mg\0"
-"hokkaido.jp\0"
-"bozen.it\0"
-"dyndns-remote.com\0"
-"ri.us\0hotels\0"
-"agdenes.no\0"
-"\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xd9\x8a\xd9\x87\0"
-"itakura.gunma.jp\0"
-"dyndns.ws\0"
-"mo.it\0toyoura.hokkaido.jp\0"
-"tm.no\0k12.la.us\0"
-"woodside\0"
-"delaware.museum\0h\xc3\xa1mm\xc3\xa1rfeasta.no\0lamborghini\0reliance\0"
-"cancerresearch\0"
-"is-a-chef.com\0"
-"arkhangelsk.su\0"
-"s\xc3\xa1l\xc3\xa1t.no\0"
-"hiraya.nagano.jp\0"
-"yamato.fukushima.jp\0"
-"webspace.rocks\0"
-"\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xd9\x8a\xd8\xa9\0"
-"jio\0u2.xnbay.com\0"
-"gen.mi.us\0"
-"brother\0"
-"cloudns.pw\0"
-"tm.pl\0"
-"town\0"
-"kawanishi.hyogo.jp\0"
-"charter.aero\0vegas\0"
-"k12.id.us\0"
-"sanuki.kagawa.jp\0agematsu.nagano.jp\0haga.tochigi.jp\0"
-"holdings\0"
-"higashi.fukushima.jp\0"
+"\xd0\xbf\xd1\x80.\xd1\x81\xd1\x80\xd0\xb1\0"
+"abbott\0pnc\0"
+"nishigo.fukushima.jp\0"
+"cc.mt.us\0cc.nd.us\0"
+"tosashimizu.kochi.jp\0tv.sd\0"
+"saigawa.fukuoka.jp\0detroit.museum\0"
+"workisboring.com\0"
+"anjo.aichi.jp\0"
+"\xe0\xb0\xad\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\xa4\xe0\xb1\x8d\0"
+"sauherad.no\0"
+"lindesnes.no\0"
+"dynalias.com\0""4lima.de\0"
+"shimamaki.hokkaido.jp\0"
+"ibigawa.gifu.jp\0"
+"aisho.shiga.jp\0name.mk\0"
+"botanical.museum\0"
+"garden.museum\0"
"nes.akershus.no\0"
-"\xe6\x9b\xb8\xe7\xb1\x8d\0"
-"profesional.bo\0lviv.ua\0homesecuritypc.com\0"
-"dnsup.net\0"
-"vossevangen.no\0"
-"m\xc4\x81ori.nz\0"
-"cc.mo.us\0pgfog.com\0"
-"guge\0"
-"kanonji.kagawa.jp\0"
-"nebraska.museum\0"
-"kawagoe.saitama.jp\0"
-"download\0"
-"southcarolina.museum\0bremanger.no\0"
-"grosseto.it\0\xe0\xa4\x95\xe0\xa5\x89\xe0\xa4\xae\0"
-"evje-og-hornnes.no\0"
-"oyodo.nara.jp\0"
-"hasama.oita.jp\0"
-"chernigov.ua\0"
-"sumoto.hyogo.jp\0"
-"insurance.aero\0tm.ro\0"
-"makurazaki.kagoshima.jp\0"
-"\xd9\x87\xd9\x85\xd8\xb1\xd8\xa7\xd9\x87\0"
-"aomori.aomori.jp\0jll\0"
-"homegoods\0toys\0"
-"tm.se\0cupcake.is\0"
-"seoul.kr\0"
-"neues.museum\0"
-"se.gov.br\0"
-"c.bg\0"
-"upow.gov.pl\0"
-"\xe6\xb7\xa1\xe9\xa9\xac\xe9\x94\xa1\0"
-"tsuruoka.yamagata.jp\0goodyear\0pictet\0"
-"lidl\0"
-"jdevcloud.com\0"
-"jmp\0"
-"s\xc3\xa1lat.no\0"
-"tahara.aichi.jp\0nakagusuku.okinawa.jp\0"
-"steinkjer.no\0"
-"yokoshibahikari.chiba.jp\0nanjo.okinawa.jp\0"
-"press.museum\0"
-"jnj\0"
-"lpages.co\0"
-"higashine.yamagata.jp\0"
-"illustration.museum\0"
-"mragowo.pl\0"
-"bz.it\0mmafan.biz\0"
-"amusement.aero\0s3.dualstack.ca-central-1.amazonaws.com\0cya.gg\0"
-"villas\0"
-"hyllestad.no\0cc.wa.us\0life\0"
-"tatsuno.hyogo.jp\0maori.nz\0"
-"kwp.gov.pl\0"
-"uto.kumamoto.jp\0"
-"dyr\xc3\xb8y.no\0"
-"atsuma.hokkaido.jp\0"
-"nsw.au\0inder\xc3\xb8y.no\0cc.ga.us\0"
-"sabae.fukui.jp\0design\0"
-"sasebo.nagasaki.jp\0jot\0"
-"gucci\0*.alces.network\0"
+"mc.it\0"
+"homebuilt.aero\0freesite.host\0"
+"yamatotakada.nara.jp\0"
+"nagatoro.saitama.jp\0"
+"workshop.museum\0radoy.no\0"
+"time.museum\0"
+"\xe7\xbb\x84\xe7\xb9\x94.hk\0"
+"tv.tr\0"
+"verbania.it\0servegame.org\0"
+"yoita.niigata.jp\0tamayu.shimane.jp\0"
+"name.jo\0"
+"dynserv.org\0"
+"net.ac\0"
+"hamburg.museum\0"
+"net.ae\0"
+"net.af\0tv.tz\0"
+"net.ag\0campidanomedio.it\0"
+"free.hr\0""4lima.at\0"
+"net.ai\0"
+"sakahogi.gifu.jp\0glass\0"
+"net.al\0g.bg\0"
+"net.am\0salem.museum\0"
+"malopolska.pl\0"
+"net.ba\0is-a-conservative.com\0"
+"net.ar\0net.bb\0"
+"on.ca\0kashiwazaki.niigata.jp\0"
+"net.au\0"
+"net.bh\0"
+"net.az\0sydney.museum\0"
+"sh.cn\0""4lima.ch\0"
+"net.bm\0"
+"net.bn\0"
+"net.bo\0"
+"place\0"
+"net.br\0toyonaka.osaka.jp\0members.linode.com\0"
+"net.bs\0"
+"net.bt\0"
+"pe.gov.br\0otaki.chiba.jp\0"
+"pro\0likes-pie.com\0"
+"hichiso.gifu.jp\0es.leg.br\0"
+"industries\0jeep\0"
+"net.ci\0toyokawa.aichi.jp\0"
+"net.bz\0hidaka.saitama.jp\0"
+"gz.cn\0"
+"events\0pru\0"
+"net.cm\0"
+"net.cn\0dray-dns.de\0"
+"net.co\0osaka.jp\0"
+"chesapeakebay.museum\0consulado.st\0lib.ny.us\0"
+"wolomin.pl\0"
+"net.cu\0daito.osaka.jp\0"
+"net.cw\0tsuga.tochigi.jp\0"
+"net.cy\0"
+"hk.org\0"
+"hinode.tokyo.jp\0kawanishi.yamagata.jp\0homeftp.net\0"
+"net.dm\0s3-website.us-east-2.amazonaws.com\0*.hosting.myjino.ru\0"
+"net.do\0service.gov.uk\0"
+"nichinan.tottori.jp\0naamesjevuemie.no\0samsclub\0"
+"kaminoyama.yamagata.jp\0on.fashion\0"
+"minami-alps.yamanashi.jp\0sellsyourhome.org\0"
+"net.ec\0outsystemscloud.com\0"
+"akiruno.tokyo.jp\0"
+"net.eg\0"
+"pub\0"
+"net.dz\0trycloudflare.com\0"
+"ladbrokes\0"
+"pixolino.com\0"
+"austin.museum\0"
+"net.et\0"
+"daigo.ibaraki.jp\0"
+"64-b.it\0"
+"mydobiss.com\0"
+"hashima.gifu.jp\0homesecuritymac.com\0"
+"net.ge\0"
+"net.gg\0"
+"shinyoshitomi.fukuoka.jp\0k12.ri.us\0dst.mi.us\0locker\0bryansk.su\0barsy.org\0"
+"miyama.mie.jp\0"
+"pwc\0"
+"norddal.no\0"
+"net.gl\0"
+"k12.mo.us\0lcube-server.de\0"
+"net.gn\0"
+"qld.gov.au\0"
+"net.gp\0gildesk\xc3\xa5l.no\0"
+"council.aero\0mo-siemens.io\0"
+"net.gr\0"
+"extraspace\0"
+"net.gt\0"
+"net.gu\0cc.me.us\0"
+"budejju.no\0"
"kannami.shizuoka.jp\0"
-"joy\0"
-"nanao.ishikawa.jp\0akagi.shimane.jp\0*.bzz.dapps.earth\0"
-"iraq.museum\0esurance\0"
-"pc.it\0"
-"guam.gu\0"
-"cust.prod.thingdust.io\0"
-"horonobe.hokkaido.jp\0"
-"ibestad.no\0"
-"abc.br\0novara.it\0nichinan.tottori.jp\0fujikawaguchiko.yamanashi.jp\0"
-"wales.museum\0"
-"shikokuchuo.ehime.jp\0help\0"
-"textile.museum\0c66.me\0"
-"\xd1\x83\xd0\xba\xd1\x80\0"
-"dyndns-free.com\0"
-"uki.kumamoto.jp\0"
-"anthropology.museum\0botanicalgarden.museum\0raholt.no\0gjemnes.no\0"
-"us-4.evennode.com\0"
-"deloitte\0"
-"mydissent.net\0"
-"kustanai.ru\0"
-"veg\xc3\xa5rshei.no\0leitungsen.de\0"
-"valleedaoste.it\0"
-"settlers.museum\0sa-east-1.elasticbeanstalk.com\0"
-"sa.gov.pl\0clubmed\0"
-"paleo.museum\0"
-"rnrt.tn\0"
-"kustanai.su\0"
+"net.gy\0ascolipiceno.it\0"
+"net.hk\0"
+"shingu.fukuoka.jp\0k12.ca.us\0*.compute.amazonaws.com.cn\0"
+"vr.it\0"
+"osasco.br\0net.hn\0"
+"pa.gov.pl\0blackfriday\0"
+"forum.hu\0hiji.oita.jp\0presidio.museum\0"
+"net.ht\0net.id\0"
+"\xda\x80\xd8\xa7\xd8\xb1\xd8\xaa\0"
+"kasumigaura.ibaraki.jp\0"
+"ookuwa.nagano.jp\0"
+"synology.me\0"
+"net.il\0mobara.chiba.jp\0koshigaya.saitama.jp\0"
+"net.im\0"
+"net.in\0""12hp.de\0"
+"net.iq\0"
+"net.ir\0delaware.museum\0myvnc.com\0"
+"net.is\0"
+"net.je\0"
+"career\0"
+"asakuchi.okayama.jp\0"
+"miho.ibaraki.jp\0"
+"ogawa.ibaraki.jp\0storj.farm\0"
+"vix.br\0"
+"ashoro.hokkaido.jp\0"
+"shingo.aomori.jp\0fitness\0"
+"net.jo\0"
+"unnan.shimane.jp\0"
+"hida.gifu.jp\0"
+"net.kg\0"
+"trentinosuedtirol.it\0net.ki\0"
+"upow.gov.pl\0"
+"taifun-dns.de\0"
+"yamakita.kanagawa.jp\0pubtls.org\0"
+"12hp.at\0"
+"net.kn\0"
+"media.hu\0gripe\0"
+"shinanomachi.nagano.jp\0net.la\0"
+"net.lb\0"
+"tra.kp\0net.lc\0grajewo.pl\0"
+"amakusa.kumamoto.jp\0"
+"net.kw\0"
+"satosho.okayama.jp\0net.ky\0"
+"net.kz\0metlife\0"
+"net.lk\0il.eu.org\0basicserver.io\0"
+"bedzin.pl\0"
+"firm.ht\0valley.museum\0"
+"gs.hl.no\0"
+"aridagawa.wakayama.jp\0"
+"hiroo.hokkaido.jp\0karumai.iwate.jp\0net.ma\0""12hp.ch\0"
+"net.lr\0"
+"net.ls\0reviews\0"
+"pr.gov.br\0net.me\0"
+"net.lv\0"
+"firm.in\0"
+"cq.cn\0net.ly\0gs.ah.no\0"
+"net.mk\0"
+"net.ml\0"
+"lahppi.no\0"
+"agro.bo\0"
+"net.mo\0"
+"miyakonojo.miyazaki.jp\0"
+"net.ms\0"
+"net.mt\0"
+"kozagawa.wakayama.jp\0net.mu\0clinic\0"
+"net.mv\0net.nf\0orange\0"
+"net.mw\0net.ng\0www.ro\0"
+"morioka.iwate.jp\0net.mx\0"
+"net.my\0net.ni\0nikon\0"
+"net.mz\0office-on-the.net\0"
+"r\xc3\xb8yken.no\0hu.eu.org\0ie.eu.org\0"
+"coupon\0moonscale.net\0"
"kyiv.ua\0"
-"control.aero\0tm.za\0data\0lundbeck\0dattolocal.com\0"
-"chiba.jp\0"
-"rollag.no\0date\0"
+"net.nr\0"
+"!city.sendai.jp\0"
+"lyngdal.no\0"
+"nes.buskerud.no\0"
+"tsu.mie.jp\0"
+"firm.co\0"
+"net.nz\0"
+"kanoya.kagoshima.jp\0"
+"naval.museum\0net.om\0"
+"togo.aichi.jp\0net.pa\0"
+"civilaviation.aero\0"
+"utazas.hu\0"
+"net.pe\0firm.dk\0"
+"dielddanuorri.no\0"
+"blogspot.com\0"
+"net.ph\0"
+"net.pk\0fage\0"
+"jus.br\0net.pl\0africa\0dyn.home-webserver.de\0"
+"likescandy.com\0"
+"net.pn\0dyndns.tv\0"
+"cc.vt.us\0"
+"haboro.hokkaido.jp\0saintlouis.museum\0net.qa\0bostik\0"
+"uri.arpa\0net.pr\0"
+"kawanishi.hyogo.jp\0szczecin.pl\0net.ps\0"
+"hvaler.no\0net.pt\0"
+"bo.nordland.no\0gov.nc.tr\0"
+"k12.nj.us\0"
+"joso.ibaraki.jp\0net.py\0"
+"gorge.museum\0"
+"lesja.no\0"
"plus\0"
-"maibara.shiga.jp\0"
-"trani-andria-barletta.it\0epson\0"
-"ruovat.no\0mo.us\0"
-"ueda.nagano.jp\0"
-"like\0"
-"birdart.museum\0"
-"gateway.museum\0pagefrontapp.com\0"
-"higashihiroshima.hiroshima.jp\0"
-"fribourg.museum\0etnedal.no\0"
-"port.fr\0"
-"union.aero\0"
-"aju.br\0"
-"higashichichibu.saitama.jp\0"
+"children.museum\0"
+"caravan\0"
+"yamada.toyama.jp\0"
+"vc.it\0lea\xc5\x8bgaviika.no\0"
+"ebina.kanagawa.jp\0bus.museum\0"
+"itakura.gunma.jp\0mesaverde.museum\0"
+"suedtirol.it\0"
+"g.se\0"
+"ri.it\0education.museum\0"
+"ally\0"
+"emilia-romagna.it\0"
+"no.it\0babia-gora.pl\0"
+"net.sa\0static.land\0"
+"fudai.iwate.jp\0net.sb\0fail\0"
+"net.sc\0secure\0"
+"net.sd\0s3-website-sa-east-1.amazonaws.com\0"
+"net.ru\0"
+"komaki.aichi.jp\0media.pl\0net.rw\0net.sg\0"
+"net.sh\0"
+"gen.in\0kunstsammlung.museum\0"
+"dyndns.ws\0"
+"fussa.tokyo.jp\0net.sl\0"
+"yaita.tochigi.jp\0net.so\0"
+"chernovtsy.ua\0"
+"tawaramoto.nara.jp\0"
+"net.ss\0taipei\0"
+"net.st\0serveblog.net\0api.stdlib.com\0"
+"crotone.it\0"
+"net.th\0physio\0"
+"net.sy\0"
+"trentinoaltoadige.it\0eidsvoll.no\0net.tj\0monash\0"
+"sorum.no\0net.tm\0"
+"net.tn\0"
+"net.to\0"
+"net.ua\0chernihiv.ua\0"
+"net.tr\0"
+"dp.ua\0"
+"net.tt\0"
+"mp.br\0bomlo.no\0net.tw\0my-router.de\0"
+"\xc3\xa5""fjord.no\0duckdns.org\0"
+"room\0"
+"machida.tokyo.jp\0"
+"net.uk\0red\0theater\0"
"furano.hokkaido.jp\0"
-"yamanouchi.nagano.jp\0\xe0\xaa\xad\xe0\xaa\xbe\xe0\xaa\xb0\xe0\xaa\xa4\0"
-"stange.no\0us-3.evennode.com\0"
-"toda.saitama.jp\0"
-"newport.museum\0locus\0"
+"design.aero\0silk.museum\0"
+"hikari.yamaguchi.jp\0"
+"healthcare\0"
+"us.na\0lib.wy.us\0net.vc\0dyndns-wiki.com\0"
+"szczytno.pl\0krakow.pl\0"
+"net.ve\0ren\0"
+"erotika.hu\0"
+"shintomi.miyazaki.jp\0"
+"chuo.tokyo.jp\0"
+"net.uy\0net.vi\0"
+"kagami.kochi.jp\0net.uz\0qvc\0"
+"pyatigorsk.ru\0"
+"net.vn\0"
+"wildlife.museum\0"
+"augustow.pl\0"
+"tozawa.yamagata.jp\0boston\0sa.com\0"
+"net.vu\0linkyard.cloud\0"
+"watarai.mie.jp\0teaches-yoga.com\0"
+"lib.ia.us\0"
+"farm.museum\0newmexico.museum\0"
+"odawara.kanagawa.jp\0"
+"takasu.hokkaido.jp\0nakatane.kagoshima.jp\0"
+"mat.br\0"
+"lpusercontent.com\0"
+"stavanger.no\0"
+"bjarkoy.no\0"
+"saga.jp\0"
+"toyota.yamaguchi.jp\0gen.ng\0"
+"wif.gov.pl\0net.ws\0"
+"gen.mi.us\0"
+"belau.pw\0fans\0"
+"gr.eu.org\0"
+"lecce.it\0"
+"from-nm.com\0"
+"gen.nz\0"
+"shimoji.okinawa.jp\0"
+"passagens\0"
+"hdfc\0"
+"matsumae.hokkaido.jp\0"
+"\xe3\x83\x9d\xe3\x82\xa4\xe3\x83\xb3\xe3\x83\x88\0here-for-more.info\0"
+"miasta.pl\0"
+"firm.ve\0"
+"fukusaki.hyogo.jp\0"
+"net.za\0"
+"ontario.museum\0ril\0"
+"avocat.fr\0"
+"szex.hu\0"
+"rio\0"
+"rip\0"
+"sandiego.museum\0"
+"assassination.museum\0"
+"b\xc3\xa5""d\xc3\xa5""ddj\xc3\xa5.no\0"
+"net.zm\0"
+"k12.la.us\0"
+"in-brb.de\0n4t.co\0"
+"autos\0prime\0"
+"cuiaba.br\0works\0"
+"ebetsu.hokkaido.jp\0minami.tokushima.jp\0world\0"
+"tt.im\0"
+"amex\0"
+"tsurugashima.saitama.jp\0"
+"ud.it\0"
+"cc.dc.us\0"
+"store.nf\0"
+"farm\0"
+"pz.it\0winners\0"
+"iwama.ibaraki.jp\0lidl\0"
+"azimuth.network\0"
+"\xd8\xa8\xd8\xa7\xd8\xb1\xd8\xaa\0khakassia.su\0"
+"hammarfeasta.no\0po.gov.pl\0"
+"kouhoku.saga.jp\0"
+"u2.xnbay.com\0"
+"\xe0\xaa\xad\xe0\xaa\xbe\xe0\xaa\xb0\xe0\xaa\xa4\0"
+"nishio.aichi.jp\0kitchen\0"
+"br.it\0cb.it\0"
+"tos.it\0"
+"fast\0"
+"ng.ink\0"
+"akagi.shimane.jp\0edugit.org\0"
+"urbino-pesaro.it\0"
+"fukuoka.jp\0life\0homelink.one\0"
+"pri.ee\0"
+"dyndns-web.com\0"
+"t.bg\0empresa.bo\0"
+"isa-hockeynut.com\0"
+"monza.it\0"
+"friulivgiulia.it\0"
+"repbody.aero\0firm.ro\0"
+"ri.us\0"
+"bahccavuotna.no\0"
+"soo.kagoshima.jp\0gen.tr\0"
+"namdalseid.no\0durban\0kurgan.su\0"
+"is-a-geek.com\0"
+"cool\0"
+"coop\0"
+"\xe0\xa6\xad\xe0\xa6\xbe\xe0\xa7\xb0\xe0\xa6\xa4\0"
+"gs.mr.no\0aktyubinsk.su\0"
+"zushi.kanagawa.jp\0"
+"okuizumo.shimane.jp\0"
+"karasjok.no\0"
+"bc.ca\0"
+"jpn.com\0"
+"emerck\0"
+"\xe0\xb6\xbd\xe0\xb6\x82\xe0\xb6\x9a\xe0\xb7\x8f\0"
"nose.osaka.jp\0"
-"north.museum\0"
-"kfh\0"
-"here\0"
-"bukhara.su\0ras.ru\0"
-"nishinoomote.kagoshima.jp\0"
-"c.la\0"
-"oe.yamagata.jp\0"
-"limo\0*.s5y.io\0"
-"rocher\0"
-"godo.gifu.jp\0shikama.miyagi.jp\0pc.pl\0"
+"roan.no\0"
+"hashikami.aomori.jp\0"
+"homeoffice.gov.uk\0"
+"ketrzyn.pl\0"
+"walter\0"
+"olbiatempio.it\0"
+"\xd8\xa8\xd9\x8a\xd8\xaa\xd9\x83\0"
+"usa.oita.jp\0serveftp.org\0"
+"caxias.br\0taxi.br\0imari.saga.jp\0"
+"paragliding.aero\0"
+"firm.nf\0"
+"firm.ng\0"
+"firestone\0"
+"\xe6\x94\xbf\xe5\x8a\xa1\0"
+"sap\0"
+"yamagata.gifu.jp\0skj\xc3\xa5k.no\0sas\0"
+"like\0"
+"sbi\0"
+"nakanoto.ishikawa.jp\0viajes\0"
+"gyeonggi.kr\0"
+"amot.no\0solar\0co.events\0"
+"theworkpc.com\0"
+"higashisumiyoshi.osaka.jp\0smile\0"
+"sca\0"
+"shimogo.fukushima.jp\0cpa.pro\0scb\0"
+"sbs\0"
+"agro.pl\0"
+"qsl.br\0"
+"kurogi.fukuoka.jp\0"
+"shopitsite.com\0"
+"weir\0"
+"environment.museum\0store.ve\0"
+"servequake.com\0"
+"fortworth.museum\0"
+"alesund.no\0"
+"trading\0pony.club\0"
+"miyoshi.tokushima.jp\0principe.st\0from-me.org\0"
+"is-a-musician.com\0"
+"alvdal.no\0"
+"\xe7\xbd\x91\xe7\xb5\xa1.hk\0matsushige.tokushima.jp\0"
+"te.it\0limo\0"
+"cooperativa.bo\0"
+"kochi.kochi.jp\0b\xc3\xb8.telemark.no\0"
+"ravendb.me\0"
+"paleo.museum\0mutual\0"
+"kommune.no\0"
+"johana.toyama.jp\0"
"jur.pro\0"
-"miasa.nagano.jp\0"
-"n\xc3\xb8tter\xc3\xb8y.no\0"
-"en.it\0"
-"design.aero\0"
-"takinoue.hokkaido.jp\0shinjo.yamagata.jp\0"
-"barcelona.museum\0guru\0"
-"bas.it\0kita.kyoto.jp\0"
-"link\0"
-"nyny.museum\0"
-"wa.us\0"
-"show.aero\0usantiques.museum\0"
-"asago.hyogo.jp\0wiih.gov.pl\0"
-"heimatunduhren.museum\0"
-"ikoma.nara.jp\0"
-"ga.us\0"
-"gyeongbuk.kr\0ybo.faith\0"
-"kia\0"
-"rg.it\0shizukuishi.iwate.jp\0"
-"shobara.hiroshima.jp\0"
-"uber.space\0"
-"hb.cn\0store.nf\0"
-"bushey.museum\0ashgabad.su\0"
-"bg.it\0mimata.miyazaki.jp\0"
-"kim\0promo\0ch.eu.org\0"
-"matsubara.osaka.jp\0"
-"us-2.evennode.com\0"
-"logistics.aero\0windows\0"
-"minano.saitama.jp\0"
-"salem.museum\0"
-"cremona.it\0higashiyama.kyoto.jp\0"
-"watch-and-clock.museum\0"
-"shibecha.hokkaido.jp\0"
-"funagata.yamagata.jp\0"
-"motosu.gifu.jp\0kuroiso.tochigi.jp\0"
-"yoshida.shizuoka.jp\0"
-"paris.eu.org\0"
-"davvenj\xc3\xa1rga.no\0amica\0"
-"western.museum\0"
-"environmentalconservation.museum\0schule\0own.pm\0"
-"noto.ishikawa.jp\0iwatsuki.saitama.jp\0"
+"novara.it\0link\0"
+"run\0""1337.pictures\0"
+"forl\xc3\xac-cesena.it\0sokndal.no\0"
+"fujixerox\0"
+"toyohashi.aichi.jp\0"
+"ses\0"
+"takayama.gifu.jp\0"
+"sew\0"
+"sex\0"
+"okutama.tokyo.jp\0"
+"omaha.museum\0"
+"kodaira.tokyo.jp\0kinder\0sfr\0"
+"e.bg\0"
+"rwe\0"
+"kasuga.hyogo.jp\0erni\0"
+"zj.cn\0cheltenham.museum\0"
+"gyeongbuk.kr\0"
+"polkowice.pl\0"
+"dyndns.biz\0"
+"mill.museum\0ivano-frankivsk.ua\0network\0"
+"kawatana.nagasaki.jp\0"
+"store.ro\0nyc.mn\0"
+"kvitsoy.no\0"
+"omachi.nagano.jp\0isa-geek.org\0"
+"makinohara.shizuoka.jp\0hamaroy.no\0"
+"tecnologia.bo\0giessen.museum\0"
+"izunokuni.shizuoka.jp\0fl.us\0"
+"pilot.aero\0"
+"stada\0"
+"hyundai\0"
+"gx.cn\0is-a-geek.org\0"
+"shiranuka.hokkaido.jp\0vestby.no\0"
+"mito.ibaraki.jp\0theatre\0app.render.com\0"
+"aquila.it\0lib.ok.us\0"
+"store.st\0ens.tn\0spdns.eu\0"
+"missile.museum\0"
+"barletta-trani-andria.it\0"
+"jobs.tt\0\xe6\x9b\xb8\xe7\xb1\x8d\0"
+"misawa.aomori.jp\0"
+"ibaraki.ibaraki.jp\0oi.kanagawa.jp\0"
+"eti.br\0oirase.aomori.jp\0paroch.k12.ma.us\0guge\0"
+"shirosato.ibaraki.jp\0"
+"pharmacien.fr\0"
+"blogspot.vn\0"
+"furubira.hokkaido.jp\0"
+"santabarbara.museum\0"
+"mielec.pl\0"
+"aaa.pro\0"
+"jewelry\0"
+"ski\0"
+"\xe6\x9d\xb1\xe4\xba\xac.jp\0avocat.pro\0safe\0"
+"travelers\0"
+"kamiichi.toyama.jp\0"
"info.gu\0"
-"nom.ad\0yuza.yamagata.jp\0"
-"nom.ae\0"
-"nom.af\0"
-"nom.ag\0"
-"isumi.chiba.jp\0shirakawa.gifu.jp\0witd.gov.pl\0"
-"square.museum\0nom.ai\0"
-"astronomy.museum\0vinnytsia.ua\0"
-"kasahara.gifu.jp\0nom.al\0"
-"funabashi.chiba.jp\0"
-"\xe4\xb8\x96\xe7\x95\x8c\0"
-"nature.museum\0bo.nordland.no\0"
-"info.ht\0ono.fukui.jp\0"
-"info.hu\0tank.museum\0"
-"bloomberg\0"
-"kofu.yamanashi.jp\0co.education\0"
-"sp.leg.br\0"
-"freiburg.museum\0"
-"machida.tokyo.jp\0"
-"obu.aichi.jp\0gifu.gifu.jp\0ashikaga.tochigi.jp\0"
-"info.et\0"
-"arte.bo\0homeftp.org\0"
-"us-1.evennode.com\0"
-"shika.ishikawa.jp\0"
+"kitahiroshima.hokkaido.jp\0"
+"hakodate.hokkaido.jp\0"
+"mw.gov.pl\0nadex\0dnsupdater.de\0"
+"sky\0"
+"kiyose.tokyo.jp\0"
+"seranishi.hiroshima.jp\0freemasonry.museum\0"
+"info.ht\0university.museum\0"
+"info.hu\0griw.gov.pl\0\xe0\xb8\xa8\xe0\xb8\xb6\xe0\xb8\x81\xe0\xb8\xa9\xe0\xb8\xb2.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+"works.aero\0"
+"lib.ee\0k12.ne.us\0kindle\0"
+"stor-elvdal.no\0live\0"
+"konyvelo.hu\0drobak.no\0beep.pl\0"
+"istanbul\0"
+"sanfrancisco.museum\0"
+"kuji.iwate.jp\0hayashima.okayama.jp\0"
+"miura.kanagawa.jp\0"
+"suzuka.mie.jp\0mine.nu\0"
+"info.et\0koga.fukuoka.jp\0singles\0"
+"mattel\0vistaprint\0"
+"blogspot.re\0"
+"mizusawa.iwate.jp\0"
+"vda.it\0bnr.la\0"
+"t.se\0"
+"alessandria.it\0"
+"hotels\0blogspot.ro\0"
+"ms.gov.br\0"
+"gamo.shiga.jp\0onrender.com\0"
+"minamiawaji.hyogo.jp\0*.triton.zone\0pgfog.com\0"
+"sor-varanger.no\0is-an-entertainer.com\0blogspot.rs\0"
+"maizuru.kyoto.jp\0blogspot.ru\0blogspot.se\0"
+"kr.it\0ovre-eiker.no\0"
+"blogspot.sg\0"
+"trentino-sud-tirol.it\0netflix\0"
+"blogspot.si\0"
+"blogspot.sk\0spdns.de\0"
+"*.transurl.be\0"
+"\xe5\xa5\x88\xe8\x89\xaf.jp\0yaotsu.gifu.jp\0flatanger.no\0schmidt\0"
+"skiptvet.no\0blogspot.sn\0"
+"te.ua\0"
+"shell.museum\0"
+"help\0kaluga.su\0"
+"palermo.it\0portland.museum\0spa\0"
+"hirogawa.wakayama.jp\0blogspot.td\0"
+"hiroshima.jp\0info.cx\0"
+"yk.ca\0web.app\0"
+"co.ae\0"
+"soy\0"
+"co.ag\0aver\xc3\xb8y.no\0"
+"higashiizu.shizuoka.jp\0"
+"download\0"
+"urawa.saitama.jp\0doomdns.org\0krasnik.pl\0"
+"mt.gov.br\0info.ec\0"
+"\xe7\xb6\xb2\xe7\xb5\xa1.cn\0ad.jp\0"
+"co.am\0"
+"co.ao\0tab\0"
+"adm.br\0freedesktop.org\0"
+"chigasaki.kanagawa.jp\0cieszyn.pl\0"
+"co.bb\0blogspot.tw\0blogspot.ug\0"
+"co.at\0"
+"ma.us\0sale\0"
+"co.bi\0sekigahara.gifu.jp\0"
+"info.bb\0fukushima.fukushima.jp\0"
+"higashiyodogawa.osaka.jp\0"
+"info.at\0"
+"info.au\0blogspot.mr\0"
+"joyo.kyoto.jp\0co.bn\0"
+"nm.cn\0os.hordaland.no\0alwaysdata.net\0"
+"temasek\0"
+"nrw.museum\0sande.m\xc3\xb8re-og-romsdal.no\0co.ca\0"
+"info.az\0moriyoshi.akita.jp\0"
+"togitsu.nagasaki.jp\0blogspot.mx\0"
+"js.cn\0blogspot.my\0"
+"nagoya\0tax\0is-a-celticsfan.org\0"
+"as.us\0"
+"info.bo\0co.bw\0blogspot.nl\0"
+"webhop.biz\0"
+"co.ci\0belluno.it\0shiiba.miyazaki.jp\0srl\0"
+"kawajima.saitama.jp\0blogspot.no\0"
+"co.cl\0agrar.hu\0naturalhistory.museum\0"
+"co.cm\0assn.lk\0"
+"lib.nh.us\0\xd0\xbe\xd1\x80\xd0\xb3.\xd1\x81\xd1\x80\xd0\xb1\0"
+"from-mo.com\0"
+"vall\xc3\xa9""edaoste.it\0srt\0"
+"co.cr\0sf.no\0b\xc3\xa1hcavuotna.no\0"
+"scrapper-site.net\0"
+"kihoku.ehime.jp\0s\xc3\xb8gne.no\0"
+"tajiri.osaka.jp\0tci\0"
+"info.co\0ol.no\0marriott\0*.transurl.eu\0"
+"yuki.ibaraki.jp\0endoftheinternet.org\0"
+"drangedal.no\0co.cz\0"
+"co.dk\0"
+"wakasa.fukui.jp\0"
+"pohl\0"
+"stc\0blogspot.pe\0"
+"us.eu.org\0"
+"barclaycard\0"
+"herokuapp.com\0"
+"hitra.no\0"
+"carrier.museum\0tdk\0dyndns-free.com\0"
+"axis.museum\0"
+"ac.gov.br\0pimienta.org\0"
+"kawagoe.mie.jp\0"
+"clinique\0blogspot.qa\0"
+"blogspot.pt\0"
+"here\0"
+"\xe7\xb6\xb2\xe7\xb5\xa1.hk\0tel\0isa-geek.com\0"
+"cam.it\0workers.dev\0"
+"groundhandling.aero\0"
+"blogspot.is\0"
+"wnext.app\0blogspot.it\0"
+"marylhurst.museum\0"
+"guru\0"
+"bjugn.no\0"
+"pueblo.bo\0"
+"gallery.museum\0k12.pr.us\0"
+"co.gg\0"
+"yokote.akita.jp\0soundandvision.museum\0"
+"blogspot.jp\0cust.dev.thingdust.io\0"
+"co.gl\0farmstead.museum\0"
+"store.bb\0"
+"is-a-student.com\0"
+"co.gy\0toyama.jp\0n\xc3\xa1vuotna.no\0nore-og-uvdal.no\0"
+"hadsel.no\0supply\0"
+"va.it\0"
+"culturalcenter.museum\0"
+"hatsukaichi.hiroshima.jp\0restaurant\0blogspot.kr\0"
+"sarl\0"
+"e.se\0from-mi.com\0"
+"rg.it\0"
+"thd\0fr.eu.org\0"
+"ninja\0"
+"kristiansund.no\0"
+"co.id\0blogspot.li\0development.run\0"
+"co.hu\0pagespeedmobilizer.com\0"
+"bmd.br\0b\xc3\xa6rum.no\0maserati\0"
+"off.ai\0cranbrook.museum\0"
+"date.fukushima.jp\0"
+"bhz.br\0nishikata.tochigi.jp\0"
+"co.il\0"
+"co.im\0"
+"co.in\0"
+"blogspot.lt\0blogspot.md\0"
+"blogspot.lu\0"
+"bridgestone\0"
+"co.ir\0nakanojo.gunma.jp\0"
+"co.it\0rv.ua\0"
+"co.je\0"
+"blogspot.mk\0"
+"shinshinotsu.hokkaido.jp\0travel\0\xd0\xba\xd0\xbe\xd0\xbc\0cleverapps.io\0"
+"kamifurano.hokkaido.jp\0"
+"kamikawa.hokkaido.jp\0"
+"pesaro-urbino.it\0"
+"store.dk\0"
+"it.ao\0kr.ua\0"
+"hole.no\0czeladz.pl\0"
+"co.jp\0"
+"laspezia.it\0sakae.nagano.jp\0"
+"tennis\0"
+"blogspot.fi\0"
+"pol.dz\0co.ke\0"
+"shinshiro.aichi.jp\0"
+"gru.br\0"
+"artdeco.museum\0dn.ua\0"
+"oppegard.no\0"
+"\xd9\x83\xd8\xa7\xd8\xab\xd9\x88\xd9\x84\xd9\x8a\xd9\x83\0"
+"kurume.fukuoka.jp\0creation.museum\0homeunix.net\0blogspot.fr\0"
+"!city.nagoya.jp\0mansion.museum\0"
+"uppo.gov.pl\0"
+"co.kr\0"
+"qh.cn\0co.lc\0"
+"tjx\0"
+"rzgw.gov.pl\0save\0"
+"suita.osaka.jp\0"
+"kudamatsu.yamaguchi.jp\0global.ssl.fastly.net\0"
+"vestv\xc3\xa5g\xc3\xb8y.no\0"
+"blogspot.gr\0"
+"*.transurl.nl\0"
+"sanjo.niigata.jp\0guardian\0"
+"co.ma\0"
+"fj.cn\0endofinternet.net\0"
+"co.ls\0"
+"co.me\0barsy.me\0"
+"watch-and-clock.museum\0va.no\0blogspot.hk\0"
+"co.mg\0granvin.no\0lib.mi.us\0"
+"union.aero\0hakone.kanagawa.jp\0co.technology\0"
+"rovigo.it\0"
+"hasvik.no\0"
+"taito.tokyo.jp\0blogspot.hr\0"
+"blogspot.hu\0blogspot.ie\0"
+"vic.gov.au\0co.na\0"
+"omura.nagasaki.jp\0"
+"elblag.pl\0"
+"co.mu\0"
+"co.mw\0"
+"lima-city.de\0"
+"co.ni\0blogspot.in\0"
+"co.mz\0"
+"yamanakako.yamanashi.jp\0in-berlin.de\0"
+"saku.nagano.jp\0co.nl\0blogspot.ba\0"
+"hattfjelldal.no\0info.ve\0"
+"pol.ht\0porn\0co.no\0"
+"insurance\0blogspot.be\0"
+"research.aero\0saxo\0swatch\0"
+"aosta.it\0rifu.miyagi.jp\0\xd8\xa8\xda\xbe\xd8\xa7\xd8\xb1\xd8\xaa\0blogspot.bg\0"
+"okayama.jp\0"
+"blogspot.bj\0"
+"transporte.bo\0info.vn\0*.magentosite.cloud\0"
+"kawagoe.saitama.jp\0"
+"co.nz\0"
+"blogspot.ca\0"
+"co.om\0"
+"vantaa.museum\0"
+"weibo\0blogspot.cf\0"
+"fujiyoshida.yamanashi.jp\0nishikatsura.yamanashi.jp\0"
+"kuwana.mie.jp\0blogspot.ch\0"
+"monzaebrianza.it\0post\0"
+"rishirifuji.hokkaido.jp\0yufu.oita.jp\0blogspot.cl\0lima-city.at\0"
+"monzabrianza.it\0repl.co\0"
+"avellino.it\0b\xc3\xa1jddar.no\0"
+"co.pl\0"
+"top\0"
+"co.pn\0"
+"shirako.chiba.jp\0"
+"blogspot.de\0"
+"panasonic\0blogspot.cv\0"
+"cc.ri.us\0"
+"wakkanai.hokkaido.jp\0omitama.ibaraki.jp\0blogspot.cz\0"
+"cng.br\0info.tn\0blogspot.dk\0"
+"co.pw\0"
+"info.tr\0"
+"lima-city.ch\0"
+"info.tt\0"
+"shiga.jp\0dodge\0"
+"konan.aichi.jp\0"
+"symantec\0"
+"elburg.museum\0"
+"nanmoku.gunma.jp\0info.tz\0"
+"i234.me\0"
+"tr.it\0!city.kitakyushu.jp\0"
+"kraanghke.no\0"
+"nasushiobara.tochigi.jp\0university\0"
+"jinsekikogen.hiroshima.jp\0broadway\0tube\0"
+"takatori.nara.jp\0yahiko.niigata.jp\0okinoshima.shimane.jp\0"
+"fujisawa.kanagawa.jp\0cloudfunctions.net\0"
+"curitiba.br\0"
+"mn.it\0filegear.me\0"
+"chrysler\0"
+"yomitan.okinawa.jp\0co.rs\0"
+"sells-for-u.com\0"
+"vang.no\0"
+"info.ro\0co.rw\0"
+"fresenius\0"
+"filatelia.museum\0olsztyn.pl\0info.sd\0data\0"
+"snaase.no\0nhlfan.net\0"
+"date\0ubs\0"
+"trv\0"
+"co.st\0"
+"barsy.online\0"
+"inagi.tokyo.jp\0"
+"r.bg\0"
+"co.th\0"
+"dentist\0"
+"co.sz\0co.tj\0va.us\0cloud66.zone\0"
+"tc.br\0"
+"8.bg\0"
+"iwi.nz\0co.tm\0"
+"mansions.museum\0lefrak\0"
+"co.ua\0"
+"hobol.no\0info.pk\0\xd8\xa8\xd8\xa7\xd8\xb2\xd8\xa7\xd8\xb1\0"
+"mar.it\0info.pl\0co.tt\0nm.us\0pcloud.host\0"
+"balsfjord.no\0co.ug\0"
+"abruzzo.it\0"
+"info.pr\0co.tz\0"
+"co.uk\0barsy.uk\0"
+"legal\0"
+"is-a-geek.net\0"
+"maritimo.museum\0living\0"
+"blogspot.ae\0"
+"protection\0"
+"co.us\0"
+"\xe7\xa5\x9e\xe5\xa5\x88\xe5\xb7\x9d.jp\0"
+"cci.fr\0co.ve\0"
+"yamanobe.yamagata.jp\0tui\0"
+"blogspot.al\0"
+"blogspot.am\0"
+"fot.br\0info.na\0co.vi\0"
+"co.uz\0"
+"is-a-anarchist.com\0fastvps-server.com\0"
+"ddr.museum\0info.mv\0info.nf\0"
+"aerodrome.aero\0tr.no\0"
+"info.ni\0is-very-nice.org\0"
+"\xe6\x95\x99\xe8\x82\xb2.hk\0ralingen.no\0"
+"ogano.saitama.jp\0"
+"dh.bytemark.co.uk\0"
+"al.gov.br\0info.nr\0"
+"omiya.saitama.jp\0yoshikawa.saitama.jp\0"
+"zlg.br\0"
+"chichibu.saitama.jp\0"
+"tvs\0"
+"ae.org\0goip.de\0"
+"veg\xc3\xa5rshei.no\0"
+"artsandcrafts.museum\0bayern\0"
+"vagan.no\0education\0"
+"is-a-bookkeeper.com\0"
+"friuliveneziagiulia.it\0info.la\0"
+"other.nf\0"
+"folkebibl.no\0"
+"niimi.okayama.jp\0"
+"ayase.kanagawa.jp\0"
+"minamisanriku.miyagi.jp\0"
+"gok.pk\0"
+"daejeon.kr\0is-very-evil.org\0"
+"xfinity\0"
+"gorlice.pl\0"
+"info.ls\0"
+"mydissent.net\0"
+"myphotos.cc\0"
+"nakatsugawa.gifu.jp\0"
+"\xe7\x8f\xa0\xe5\xae\x9d\0is-slick.com\0"
+"co.za\0"
+"bolzano-altoadige.it\0"
+"gonohe.aomori.jp\0"
+"d\xc3\xb8nna.no\0"
+"lakas.hu\0"
+"ui.nabu.casa\0"
+"arte.bo\0gifu.jp\0pol.tr\0co.zm\0"
+"kui.hiroshima.jp\0travelchannel\0hu.com\0"
+"from-md.com\0"
+"yasuda.kochi.jp\0kvanangen.no\0global\0"
+"cog.mi.us\0"
+"co.zw\0"
+"cc.fl.us\0social\0"
+"uy.com\0"
+"k12.al.us\0"
+"ss.it\0info.ke\0"
+"furudono.fukushima.jp\0se.net\0ru.net\0"
+"rennesoy.no\0"
+"info.ki\0"
+"pi.it\0"
+"yoshida.shizuoka.jp\0"
+"boston.museum\0tynset.no\0gallup\0"
+"calabria.it\0"
+"tokushima.tokushima.jp\0niepce.museum\0"
+"lo.it\0"
+"clock.museum\0"
+"l\xc3\xa6rdal.no\0"
+"misato.shimane.jp\0"
+"frog.museum\0"
+"sakura.tochigi.jp\0\xe0\xae\x87\xe0\xae\xa8\xe0\xaf\x8d\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xaf\xe0\xae\xbe\0isa-geek.net\0"
+"kita.kyoto.jp\0"
+"togakushi.nagano.jp\0hamatama.saga.jp\0tranoy.no\0"
+"kagamiishi.fukushima.jp\0"
+"aq.it\0ba.it\0"
+"brunel.museum\0"
+"whoswho\0"
+"skodje.no\0ipifony.net\0my-vigor.de\0"
+"saijo.ehime.jp\0dali.museum\0"
+"collection.museum\0gotdns.com\0"
+"minami.fukuoka.jp\0"
+"gv.ao\0c.bg\0"
+"campinas.br\0oy.lc\0"
+"gv.at\0"
+"tsk.tr\0capetown\0"
+"shisui.chiba.jp\0\xe6\xb7\xa1\xe9\xa9\xac\xe9\x94\xa1\0"
+"privatizehealthinsurance.net\0"
+"mn.us\0"
+"usarts.museum\0"
+"sd.cn\0*.s5y.io\0"
+"servehttp.com\0"
+"trading.aero\0"
+"l\xc3\xb8ten.no\0*.on-rio.io\0"
+"emr.it\0"
+"baltimore.museum\0"
+"mitaka.tokyo.jp\0"
+"asaminami.hiroshima.jp\0lib.vi.us\0u2-local.xnbay.com\0"
+"b\xc3\xa5tsfjord.no\0vm.bytemark.co.uk\0"
+"ab.ca\0sumita.iwate.jp\0uno\0"
+"olkusz.pl\0archi\0"
+"yahoo\0"
+"sar.it\0haga.tochigi.jp\0castres.museum\0"
+"is-into-cartoons.com\0"
+"trentins\xc3\xbc""d-tirol.it\0"
+"belem.br\0otoyo.kochi.jp\0salangen.no\0hopto.me\0"
+"yoka.hyogo.jp\0"
+"l\xc3\xb8""dingen.no\0"
+"kawahara.tottori.jp\0embroidery.museum\0marnardal.no\0uol\0"
+"omega\0"
+"lierne.no\0"
+"lib.ga.us\0tec.ve\0"
+"friuli-venezia-giulia.it\0"
+"karatsu.saga.jp\0"
+"pesarourbino.it\0"
+"isla.pr\0"
+"b\xc3\xa1l\xc3\xa1t.no\0"
+"otaki.saitama.jp\0elvendrell.museum\0"
+"tokai.ibaraki.jp\0"
+"wajima.ishikawa.jp\0"
+"ups\0co.education\0"
+"shimokitayama.nara.jp\0abo.pa\0"
+"transport.museum\0"
+"est-le-patron.com\0"
+"family.museum\0eurovision\0"
+"giehtavuoatna.no\0bci.dnstrace.pro\0barsy.bg\0"
+"cn.com\0"
+"jelenia-gora.pl\0"
+"sirdal.no\0"
+"ringsaker.no\0"
+"\xe5\xae\xae\xe5\x9f\x8e.jp\0"
+"abkhazia.su\0"
+"ascoli-piceno.it\0"
+"rio.br\0\xd9\xbe\xd8\xa7\xda\xa9\xd8\xb3\xd8\xaa\xd8\xa7\xd9\x86\0"
+"pmn.it\0jeonnam.kr\0barsy.ca\0"
+"educator.aero\0higashiomi.shiga.jp\0"
+"asahi.ibaraki.jp\0ota.tokyo.jp\0"
+"\xe5\xaf\x8c\xe5\xb1\xb1.jp\0"
+"tempio-olbia.it\0security\0meteorapp.com\0"
+"hagi.yamaguchi.jp\0debian.net\0dnsdojo.org\0"
+"s\xc3\xa1lat.no\0"
+"lezajsk.pl\0"
+"k12.ms.us\0k12.nc.us\0"
+"higashichichibu.saitama.jp\0bahcavuotna.no\0"
+"poivron.org\0"
+"sel.no\0barsy.de\0"
+"verona.it\0vadso.no\0"
+"from-al.com\0"
+"roros.no\0cc.ma.us\0"
+"herad.no\0"
+"parachuting.aero\0"
+"semine.miyagi.jp\0"
+"tsukumi.oita.jp\0"
+"mc.eu.org\0"
+"jab.br\0r.se\0blogdns.org\0"
+"lukow.pl\0"
+"cc.as.us\0"
+"yamagata.nagano.jp\0lilly\0"
+"web.bo\0"
+"\xd0\xbc\xd0\xba\xd0\xb4\0"
+"publ.pt\0"
+"kiho.mie.jp\0"
+"andriabarlettatrani.it\0livorno.it\0scor\0\xe9\xa3\x9f\xe5\x93\x81\0"
+"barsy.eu\0"
+"scot\0official.academy\0"
+"philadelphia.museum\0strand.no\0"
+"ong.br\0parliament.nz\0"
+"web.co\0askvoll.no\0"
+"convent.museum\0"
+"vet\0"
+"\xe4\xbd\x9b\xe5\xb1\xb1\0lt.eu.org\0"
+"serveftp.com\0xs4all.space\0"
+"gran.no\0"
+"yuza.yamagata.jp\0"
+"telefonica\0square7.net\0lima.zone\0"
+"association.aero\0tachiarai.fukuoka.jp\0c.la\0"
+"tajimi.gifu.jp\0"
+"web.do\0"
+"*.landing.myjino.ru\0"
+"homeunix.org\0"
+"adult\0observer\0"
+"ukiha.fukuoka.jp\0gs.sf.no\0enebakk.no\0"
+"yamato.fukushima.jp\0"
+"gs.ol.no\0",
+
+"is-a-libertarian.com\0"
+"boats\0"
+"guam.gu\0charity\0"
+"ing.pa\0"
+"baby\0hgtv\0"
+"suifu.ibaraki.jp\0"
+"journal.aero\0wiih.gov.pl\0"
+"fjaler.no\0tolga.no\0"
+"anamizu.ishikawa.jp\0"
+"lib.nj.us\0"
+"fidelity\0barsy.in\0"
+"barsy.io\0"
+"froland.no\0"
+"juif.museum\0mymailer.com.tw\0"
+"nikaho.akita.jp\0kayabe.hokkaido.jp\0vig\0"
+"yonabaru.okinawa.jp\0"
+"waw.pl\0"
+"barclays\0"
+"cagliari.it\0\xd0\xbc\xd0\xbe\xd0\xbd\0"
+"*.futurecms.at\0"
+"vin\0"
+"tselinograd.su\0"
+"vip\0"
+"tanabe.kyoto.jp\0naumburg.museum\0loab\xc3\xa1t.no\0"
+"es.eu.org\0servehumour.com\0"
+"web.gu\0"
+"pub.sa\0"
+"santoandre.br\0info.zm\0"
+"kanegasaki.iwate.jp\0claims\0"
+"takanezawa.tochigi.jp\0uk.net\0"
+"sowa.ibaraki.jp\0aid.pl\0"
+"higashiyamato.tokyo.jp\0"
+"web.id\0fortmissoula.museum\0manx.museum\0"
+"sanofi\0"
+"saobernardo.br\0casino.hu\0foggia.it\0dclk\0"
+"indianmarket.museum\0"
+"rahkkeravju.no\0"
+"shiwa.iwate.jp\0"
+"mochizuki.nagano.jp\0servebbs.net\0"
+"nagaoka.niigata.jp\0"
+"songdalen.no\0storfjord.no\0"
+"rsvp\0"
+"s3.us-east-2.amazonaws.com\0"
+"decorativearts.museum\0ufcfan.org\0"
+"samsung\0is-into-games.com\0"
+"astronomy.museum\0dyn-ip24.de\0"
+"iwata.shizuoka.jp\0"
+"koto.shiga.jp\0"
+"cnt.br\0vanylven.no\0"
+"slask.pl\0"
+"tuscany.it\0build\0"
+"sor-odal.no\0"
+"ebiz.tw\0"
+"handson.museum\0"
+"meiwa.gunma.jp\0homes\0"
+"ogawa.saitama.jp\0"
"c.se\0"
-"erotica.hu\0"
-"nom.cl\0"
-"is-very-nice.org\0"
-"tagawa.fukuoka.jp\0shishikui.tokushima.jp\0"
-"air-traffic-control.aero\0nom.co\0from-ne.com\0"
-"colonialwilliamsburg.museum\0"
-"homes\0"
-"bifuka.hokkaido.jp\0ogawa.saitama.jp\0"
-"yamashina.kyoto.jp\0"
-"matsushima.miyagi.jp\0kodaira.tokyo.jp\0"
-"imageandsound.museum\0"
-"tado.mie.jp\0is-a-chef.net\0"
-"live\0\xe5\x95\x86\xe6\xa0\x87\0murmansk.su\0"
-"fr\xc3\xa6na.no\0nore-og-uvdal.no\0"
-"kasumigaura.ibaraki.jp\0"
-"niepce.museum\0s\xc3\xb8gne.no\0"
-"gr.it\0"
-"info.cx\0"
-"room\0"
-"nexus\0us-east-1.amazonaws.com\0"
-"t.bg\0is-found.org\0forumz.info\0"
-"ivanovo.su\0"
-"campinas.br\0gr.jp\0"
-"info.ec\0"
-"nom.es\0ulm.museum\0baby\0"
-"kpn\0"
-"barsy.me\0serveexchange.com\0homelink.one\0"
-"game.tw\0"
-"voss.no\0"
-"store.ve\0applinzi.com\0"
-"info.bb\0frosinone.it\0"
+"re.it\0nogi.tochigi.jp\0"
+"honbetsu.hokkaido.jp\0mortgage\0"
+"kamo.niigata.jp\0web.lk\0"
+"elverum.no\0"
+"synology-diskstation.de\0"
+"mihara.kochi.jp\0"
+"tsubata.ishikawa.jp\0ma.leg.br\0"
+"stjohn.museum\0vn.ua\0"
+"cruise\0"
+"stjordalshalsen.no\0"
+"tokuyama.yamaguchi.jp\0"
+"nakayama.yamagata.jp\0wien\0"
+"nfshost.com\0"
+"museum\0"
+"sakegawa.yamagata.jp\0"
+"valdaosta.it\0"
+"re.kr\0"
+"sytes.net\0"
+"nara.nara.jp\0"
+"miniserver.com\0"
+"trentin-suedtirol.it\0web.nf\0"
+"trentino-s\xc3\xbc""d-tirol.it\0public.museum\0gausdal.no\0sd.us\0endofinternet.org\0github.io\0"
+"web.ni\0"
+"xj.cn\0gs.va.no\0"
+"nowaruda.pl\0"
+"pacific.museum\0"
+"\xc3\xa1laheadju.no\0"
+"mizunami.gifu.jp\0"
+"fortal.br\0sugito.saitama.jp\0"
+"mazury.pl\0gv.vc\0"
+"aukra.no\0from-pa.com\0"
+"zao.miyagi.jp\0fuchu.tokyo.jp\0"
+"funabashi.chiba.jp\0"
+"revista.bo\0lillesand.no\0"
+"nowtv\0"
+"ngrok.io\0"
+"jerusalem.museum\0"
+"safety\0"
+"and\xc3\xb8y.no\0lib.pa.us\0abbvie\0"
+"yamaxun\0familyds.net\0"
+"tokamachi.niigata.jp\0"
+"chuo.fukuoka.jp\0anan.nagano.jp\0agrinet.tn\0"
+"safety.aero\0web.pk\0plo.ps\0"
+"shimonoseki.yamaguchi.jp\0"
+"motoyama.kochi.jp\0blackbaudcdn.net\0is-a-techie.com\0"
+"alaheadju.no\0ipiranga\0"
+"band\0"
+"konskowola.pl\0vpnplus.to\0"
+"figueres.museum\0"
+"nesset.no\0"
+"lancashire.museum\0"
+"mymediapc.net\0"
+"bank\0"
+"vestvagoy.no\0"
+"sjc.br\0chintai\0in-dsl.de\0dvrcam.info\0rackmaze.com\0"
+"mus.mi.us\0"
+"sanok.pl\0"
+"defense.tn\0"
+"ishikawa.okinawa.jp\0"
+"*.kobe.jp\0otsuchi.iwate.jp\0ishigaki.okinawa.jp\0"
+"mk.eu.org\0"
+"bieszczady.pl\0hobby-site.org\0"
+"kunohe.iwate.jp\0"
+"tcp4.me\0"
+"dynamic-dns.info\0"
+"wiki\0"
+"s\xc3\xb8rfold.no\0ugim.gov.pl\0balena-devices.com\0"
+"wed\0"
+"niki.hokkaido.jp\0"
+"fitjar.no\0gotdns.ch\0"
+"lelux.site\0"
+"kakuda.miyagi.jp\0"
+"cc.va.us\0arab\0"
+"landes.museum\0associates\0"
+"ferrari\0"
+"lucca.it\0fi.eu.org\0"
+"florence.it\0cc.nm.us\0"
+"int.ar\0trust.museum\0"
+"web.tj\0"
+"iglesias-carbonia.it\0"
+"birthplace.museum\0"
+"southcarolina.museum\0"
+"hanggliding.aero\0int.az\0"
+"web.tr\0nflfan.org\0"
+"tp.it\0psp.gov.pl\0"
+"int.bo\0yabuki.fukushima.jp\0"
+"cc.co.us\0"
+"riik.ee\0seat\0"
+"uslivinghistory.museum\0"
+"pv.it\0ericsson\0gallo\0"
+"wine\0"
+"nagahama.shiga.jp\0austrheim.no\0bbs.tr\0"
+"shimoichi.nara.jp\0realestate.pl\0"
+"higashine.yamagata.jp\0"
+"int.ci\0oarai.ibaraki.jp\0"
+"lu.eu.org\0me.eu.org\0"
+"web.ve\0blogspot.co.at\0"
+"int.co\0lasalle\0ashgabad.su\0"
+"shirakawa.fukushima.jp\0"
+"kahoku.ishikawa.jp\0synology-ds.de\0"
+"ato.br\0"
+"bn.it\0"
+"vaga.no\0"
+"swidnica.pl\0"
+"gives\0vodka\0"
+"uchinomi.kagawa.jp\0"
+"p.bg\0"
+"verm\xc3\xb6gensberatung\0"
+"lotte\0"
+"6.bg\0saitama.saitama.jp\0abudhabi\0win\0"
+"l\xc3\xa4ns.museum\0"
+"deporte.bo\0"
+"gs.tr.no\0"
+"lv.eu.org\0"
+"evenassi.no\0"
+"minoh.osaka.jp\0lotto\0"
+"prod\0"
+"london.cloudapps.digital\0"
+"prof\0"
+"idrett.no\0"
+"seek\0"
+"ggf.br\0juegos\0"
+"s3.eu-west-2.amazonaws.com\0"
+"tochio.niigata.jp\0"
+"lib.sd.us\0*.stolos.io\0"
+"journalist.aero\0linde\0"
+"honda\0"
+"kamioka.akita.jp\0co.place\0"
+"web.za\0"
+"s3-eu-west-1.amazonaws.com\0"
+"fribourg.museum\0"
+"ballooning.aero\0"
+"yaizu.shizuoka.jp\0"
+"natuurwetenschappen.museum\0"
+"ishikawa.fukushima.jp\0hikone.shiga.jp\0"
+"emp.br\0\xe6\x95\x8e\xe8\x82\xb2.hk\0"
+"wme\0"
+"rokunohe.aomori.jp\0north.museum\0*.statics.cloud\0loginline.site\0"
+"muncie.museum\0"
+"potenza.it\0"
+"inderoy.no\0"
+"ruhr\0"
+"parti.se\0\xe5\xb7\xa5\xe8\xa1\x8c\0dy.fi\0"
+"dnsdojo.net\0"
+"int.is\0"
+"hapmir.no\0"
+"qld.au\0"
+"idf.il\0inami.wakayama.jp\0colonialwilliamsburg.museum\0graz.museum\0"
+"wios.gov.pl\0blogspot.co.id\0"
+"skoczow.pl\0"
+"riobranco.br\0barrell-of-knowledge.info\0"
+"trust\0"
+"yakumo.hokkaido.jp\0"
+"storage\0"
+"taketa.oita.jp\0"
+"swiftcover\0blogspot.co.il\0"
+"\xe7\xa7\x8b\xe7\x94\xb0.jp\0"
+"sondrio.it\0isshiki.aichi.jp\0kosher\0"
+"cc.mn.us\0"
+"overhalla.no\0"
+"ham-radio-op.net\0"
+"wow\0"
+"int.la\0k12.ct.us\0"
+"deal\0"
+"zaporizhzhe.ua\0giize.com\0flt.cloud.muni.cz\0"
+"airbus\0"
+"ta.it\0games\0"
+"maritime.museum\0"
+"int.lk\0"
+"pg.it\0group\0"
+"is-a-knight.org\0"
+"midatlantic.museum\0"
+"kutchan.hokkaido.jp\0"
+"fh.se\0"
+"barsy.co.uk\0"
+"nishi.fukuoka.jp\0"
+"dazaifu.fukuoka.jp\0"
+"from.hr\0"
+"lapy.pl\0"
+"mosjoen.no\0tysnes.no\0lundbeck\0"
+"my-gateway.de\0"
+"kr.eu.org\0"
+"sport.hu\0"
+"takatsuki.osaka.jp\0bananarepublic\0"
+"ao.it\0oldnavy\0"
+"andriatranibarletta.it\0"
+"\xe9\xa4\x90\xe5\x8e\x85\0"
+"ustka.pl\0"
+"*.elb.amazonaws.com.cn\0"
+"parliament.cy\0asti.it\0int.mv\0"
+"int.mw\0\xd9\x82\xd8\xb7\xd8\xb1\0"
+"naples.it\0int.ni\0"
+"a.bg\0"
+"army\0"
+"h\xc3\xb8yanger.no\0"
+"tokushima.jp\0"
+"hs.kr\0"
+"chieti.it\0"
+"from-co.net\0"
+"fylkesbibl.no\0"
+"saarland\0space\0"
+"wtc\0"
+"koriyama.fukushima.jp\0wtf\0"
+"nx.cn\0"
+"now-dns.net\0"
+"dyndns.info\0"
+"amusement.aero\0"
+"pittsburgh.museum\0"
+"arpa\0"
+"karuizawa.nagano.jp\0porsangu.no\0"
+"matsuzaki.shizuoka.jp\0"
+"recife.br\0"
+"azurecontainer.io\0"
+"walmart\0"
+"navigation.aero\0lib.mo.us\0politie\0"
+"shibuya.tokyo.jp\0"
+"nagareyama.chiba.jp\0higashishirakawa.gifu.jp\0kwp.gov.pl\0"
+"gaular.no\0"
+"\xd8\xa7\xd9\x8a\xd8\xb1\xd8\xa7\xd9\x86.ir\0annefrank.museum\0"
+"int.pt\0"
+"svelvik.no\0"
+"aizuwakamatsu.fukushima.jp\0"
+"forumz.info\0"
+"cargo.aero\0"
+"wake.okayama.jp\0railway.museum\0rnu.tn\0"
+"minato.tokyo.jp\0"
+"wakuya.miyagi.jp\0"
+"watchandclock.museum\0"
+"kami.miyagi.jp\0f\xc3\xb8rde.no\0karlsoy.no\0merseine.nu\0"
+"fukuroi.shizuoka.jp\0"
+"tingvoll.no\0"
+"oharu.aichi.jp\0mo-i-rana.no\0"
+"m\xc3\xa1tta-v\xc3\xa1rjjat.no\0demon.nl\0"
+"yono.saitama.jp\0online.museum\0\xe5\x85\xac\xe5\x8f\xb8.\xe9\xa6\x99\xe6\xb8\xaf\0"
+"bearalvahki.no\0"
+"movimiento.bo\0kumejima.okinawa.jp\0"
+"vaksdal.no\0"
+"dyndns-work.com\0"
+"komae.tokyo.jp\0"
+"int.ru\0camdvr.org\0"
+"dedyn.io\0"
+"tokigawa.saitama.jp\0nyny.museum\0quebec\0"
+"imperia.it\0kujukuri.chiba.jp\0"
+"noda.iwate.jp\0blogdns.net\0webredirect.org\0"
+"accountants\0"
+"!city.sapporo.jp\0"
+"kamishihoro.hokkaido.jp\0"
+"asda\0gucci\0"
+"loan\0"
+"int.tj\0arte\0flickr\0"
"moscow.museum\0"
-"nom.fr\0info.at\0"
-"info.au\0at.eu.org\0"
-"nom.gd\0"
+"beauty\0"
+"online\0"
+"takayama.nagano.jp\0"
+"kasaoka.okayama.jp\0"
+"oyodo.nara.jp\0"
+"treviso.it\0"
+"int.tt\0"
+"\xe7\xa6\x8f\xe5\xb2\xa1.jp\0xin\0"
+"noticias.bo\0ilovecollege.info\0"
+"kustanai.ru\0"
+"taiki.hokkaido.jp\0"
+"ppg.br\0clan.rip\0"
+"p.se\0"
+"umi.fukuoka.jp\0*.sensiosite.cloud\0"
+"tendo.yamagata.jp\0in-vpn.org\0"
+"soja.okayama.jp\0int.ve\0"
+"bbva\0"
+"kustanai.su\0mg.leg.br\0"
+"kyotanabe.kyoto.jp\0\xd0\xbe\xd1\x80\xd0\xb3\0"
+"nom.ad\0"
+"gov.ac\0nom.ae\0"
+"int.vn\0promo\0nom.af\0"
+"gov.ae\0nom.ag\0"
+"gov.af\0"
+"android\0nom.ai\0"
+"usculture.museum\0dell\0"
+"fvg.it\0cz.it\0nom.al\0"
+"arq.br\0blogspot.co.uk\0"
+"gov.al\0"
+"okagaki.fukuoka.jp\0"
+"airport.aero\0lewismiller.museum\0"
+"yatsuka.shimane.jp\0"
+"gov.ba\0trapani.it\0"
+"gov.ar\0gov.bb\0"
+"gov.as\0"
+"gov.au\0nakadomari.aomori.jp\0"
+"gov.bf\0television.museum\0"
+"games.hu\0"
+"gov.bh\0"
+"\xe6\x96\xb0\xe9\x97\xbb\0"
+"gov.az\0"
+"koga.ibaraki.jp\0aejrie.no\0"
+"gov.bm\0haibara.shizuoka.jp\0tatar\0"
+"gov.bn\0from-ct.com\0"
+"nesoddtangen.no\0is-a-socialist.com\0"
+"gov.br\0"
+"airline.aero\0gov.bs\0"
+"gov.bt\0gov.cd\0bungoono.oita.jp\0a.run.app\0"
+"kommunalforbund.se\0"
+"gov.by\0sardinia.it\0"
+"gov.bz\0nom.cl\0"
+"asia\0gov.cl\0"
+"gov.cm\0nom.co\0valled-aosta.it\0sogndal.no\0"
+"gov.cn\0sciencehistory.museum\0"
+"author.aero\0gov.co\0saiki.oita.jp\0"
+"lib.tx.us\0is-a-green.com\0"
+"lans.museum\0loft\0"
+"gov.cu\0onjuku.chiba.jp\0\xc3\xa5lg\xc3\xa5rd.no\0"
+"gov.cx\0lib.pr.us\0"
+"gov.cy\0"
+"saikai.nagasaki.jp\0\xc3\xa5s.no\0"
+"fnd.br\0"
+"sexy\0"
+"gov.dm\0miners.museum\0za.com\0"
+"in-butter.de\0"
+"gov.do\0"
+"res.in\0paderborn.museum\0scapp.io\0"
+"c66.me\0"
+"gov.ec\0aga.niigata.jp\0naha.okinawa.jp\0"
+"gov.ee\0hakata.fukuoka.jp\0"
+"gov.eg\0med.pro\0"
+"klabu.no\0"
+"!city.kobe.jp\0dominic.ua\0fed.us\0"
+"gov.dz\0"
+"noboribetsu.hokkaido.jp\0"
+"catering\0"
+"\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xd9\x8a\xd9\x87\0"
+"federation.aero\0servebbs.org\0"
+"nom.es\0from-wy.com\0"
+"gov.et\0cincinnati.museum\0\xe9\xa6\x99\xe6\xb8\xaf\0"
+"oystre-slidre.no\0"
+"s3-eu-central-1.amazonaws.com\0"
+"villas\0"
+"nom.fr\0"
+"shirataka.yamagata.jp\0nom.gd\0"
"nom.ge\0"
-"!city.sendai.jp\0"
-"nannestad.no\0"
-"info.az\0social\0"
-"tsuchiura.ibaraki.jp\0krd\0lat\0"
+"gov.ge\0lviv.ua\0blogspot.co.ke\0homesecuritypc.com\0"
+"plants.museum\0vlaanderen.museum\0"
+"gov.gh\0"
+"gov.gi\0securitytactics.com\0"
"nom.gl\0"
-"info.bo\0law\0applicationcloud.io\0"
-"nankoku.kochi.jp\0"
+"remotewd.com\0"
+"brussel.museum\0moma.museum\0"
+"gov.gn\0"
+"bruxelles.museum\0"
+"vicenza.it\0\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xd9\x8a\xd8\xa9\0degree\0"
+"gov.gr\0naklo.pl\0customer.enonic.io\0nom.gt\0"
+"sydney\0"
+"gov.gu\0desi\0"
+"badajoz.museum\0cc.sd.us\0no-ip.org\0"
+"gov.gy\0oseto.nagasaki.jp\0uruma.okinawa.jp\0nord-odal.no\0"
+"k12.md.us\0stackhero-network.com\0"
+"gov.hk\0"
+"nom.hn\0"
+"arendal.no\0"
+"services\0"
+"huissier-justice.fr\0bronnoy.no\0"
+"banamex\0"
+"my.id\0akabira.hokkaido.jp\0showa.yamanashi.jp\0merckmsd\0"
+"gov.ie\0cloudaccess.net\0"
+"kherson.ua\0"
+"oita.oita.jp\0"
+"auspost\0"
+"snillfjord.no\0"
+"nom.im\0"
+"gov.il\0pavia.it\0"
+"gov.in\0a.se\0scrapping.cc\0"
+"rc.it\0choshi.chiba.jp\0"
+"fukumitsu.toyama.jp\0"
+"gov.iq\0"
+"gov.ir\0"
+"gov.is\0sagae.yamagata.jp\0\xd8\xb9\xd8\xb1\xd8\xa7\xd9\x82\0"
+"gov.it\0edu.eu.org\0"
+"\xe9\x9b\x86\xe5\x9b\xa2\0"
+"higashiyama.kyoto.jp\0mormon\0"
+"vic.au\0"
+"is-a-doctor.com\0"
+"ge.it\0"
+"gov.jo\0niihama.ehime.jp\0\xe0\xb8\xa3\xe0\xb8\xb1\xe0\xb8\x90\xe0\xb8\x9a\xe0\xb8\xb2\xe0\xb8\xa5.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
+"academy\0"
+"\xe4\xb8\xad\xe4\xbf\xa1\0"
+"ingatlan.hu\0sb.ua\0nom.ke\0"
+"saotome.st\0"
+"gov.kg\0"
+"honjo.akita.jp\0stream\0"
+"koto.tokyo.jp\0musashimurayama.tokyo.jp\0gov.ki\0"
+"blogspot.co.nz\0"
+"asaka.saitama.jp\0nom.km\0"
+"gov.km\0british.museum\0"
+"gov.kn\0"
+"gov.kp\0"
+"gov.la\0vaapste.no\0"
+"gov.lb\0"
+"gov.lc\0broker\0"
+"kamijima.ehime.jp\0sibenik.museum\0agakhan\0"
+"tatsuno.hyogo.jp\0"
+"gov.kw\0hagebostad.no\0nat.tn\0nom.li\0"
+"capitalone\0familyds.org\0"
+"gov.ky\0"
+"gyokuto.kumamoto.jp\0gov.kz\0oh.us\0syno-ds.de\0"
+"gov.lk\0freetls.fastly.net\0"
+"konsulat.gov.pl\0"
+"harvestcelebration.museum\0"
+"sanda.hyogo.jp\0"
+"gov.ma\0alpha.bounty-full.com\0"
+"itano.tokushima.jp\0gov.lr\0"
+"gov.ls\0br\xc3\xb8nn\xc3\xb8ysund.no\0"
+"gov.lt\0"
+"gov.me\0nom.mg\0"
+"gov.lv\0"
+"mishima.shizuoka.jp\0gov.mg\0aarborte.no\0"
+"gov.ly\0turek.pl\0nom.mk\0"
+"urakawa.hokkaido.jp\0"
+"gov.mk\0"
+"gov.ml\0"
+"gifu.gifu.jp\0shioya.tochigi.jp\0"
+"gov.mn\0spydeberg.no\0"
+"ono.hyogo.jp\0saito.miyazaki.jp\0gov.mo\0"
+"museum.tt\0ivanovo.su\0"
+"nom.nc\0"
+"gov.mr\0"
+"gov.ms\0"
+"tome.miyagi.jp\0gov.mu\0"
+"gov.mv\0"
+"gov.mw\0gov.ng\0nom.ni\0nalchik.ru\0"
+"gov.my\0"
+"gov.mz\0"
+"\xe5\x95\x86\xe6\xa0\x87\0"
+"otaru.hokkaido.jp\0tomobe.ibaraki.jp\0"
+"udine.it\0ybo.trade\0"
+"iglesiascarbonia.it\0"
+"okawa.fukuoka.jp\0gov.nr\0"
+"ube.yamaguchi.jp\0nom.nu\0"
+"tarama.okinawa.jp\0draydns.de\0"
+"xxx\0"
+"nalchik.su\0applinzi.com\0"
+"pisz.pl\0dating\0"
+"trentinosud-tirol.it\0utwente.io\0"
+"gov.om\0"
+"skydiving.aero\0berlin.museum\0s\xc3\xb8mna.no\0nom.pa\0"
+"rackmaze.net\0"
+"fuchu.hiroshima.jp\0"
+"nom.pe\0"
+"yamamoto.miyagi.jp\0\xe6\x89\x8b\xe8\xa1\xa8\0"
+"musashino.tokyo.jp\0"
+"eco.br\0"
+"gov.ph\0xyz\0"
+"milan.it\0"
+"nom.pl\0"
+"gov.pk\0"
+"rome.it\0nishiokoppe.hokkaido.jp\0matsushima.miyagi.jp\0gov.pl\0"
+"gov.pn\0"
+"isehara.kanagawa.jp\0nom.qa\0"
+"dni.us\0"
+"gov.qa\0fiat\0"
+"gov.pr\0"
+"gov.ps\0"
+"gov.pt\0k12.wi.us\0"
+"nom.pw\0"
+"sukagawa.fukushima.jp\0niiza.saitama.jp\0"
+"gov.py\0"
+"memorial.museum\0"
+"stj\xc3\xb8rdalshalsen.no\0"
+"magazine.aero\0"
+"brasil.museum\0luxembourg.museum\0"
+"livinghistory.museum\0kyoto\0"
+"newhampshire.museum\0nom.re\0k12.ks.us\0"
+"fedorainfracloud.org\0"
+"asakawa.fukushima.jp\0"
+"zamami.okinawa.jp\0"
+"ine.kyoto.jp\0higashimatsushima.miyagi.jp\0"
+"nom.ro\0"
+"pinb.gov.pl\0"
+"sayama.saitama.jp\0"
+"fukui.jp\0oyer.no\0gov.sa\0nom.rs\0"
+"\xe7\xa6\x8f\xe4\xba\x95.jp\0kinokawa.wakayama.jp\0gov.sb\0"
+"tn.it\0gov.rs\0gov.sc\0"
+"vao.it\0torino.it\0gov.sd\0"
+"ullensaker.no\0gov.ru\0love\0"
+"kanmaki.nara.jp\0"
+"gov.rw\0gov.sg\0nom.si\0"
+"pt.it\0chocolate.museum\0gov.sh\0"
+"miyoshi.aichi.jp\0"
+"rikuzentakata.iwate.jp\0"
+"american.museum\0"
+"yoro.gifu.jp\0gov.sl\0fido\0institute\0"
+"eiheiji.fukui.jp\0"
+"gov.so\0"
+"meloy.no\0nom.st\0"
+"gov.ss\0"
+"gov.st\0readmyblog.org\0"
+"nagasaki.nagasaki.jp\0cloud.metacentrum.cz\0"
+"\xc3\xb8ystre-slidre.no\0"
+"gov.sx\0nom.tj\0"
+"gov.sy\0"
+"gov.tj\0"
+"nom.tm\0"
+"ambulance.aero\0bl.it\0mino.gifu.jp\0gov.tl\0"
+"gov.tm\0"
+"atami.shizuoka.jp\0gov.tn\0"
+"hirata.fukushima.jp\0gov.to\0"
+"schools.nsw.edu.au\0katagami.akita.jp\0gov.ua\0"
+"gov.tr\0"
+"gov.tt\0"
+"nom.ug\0"
+"n.bg\0s3.dualstack.us-east-1.amazonaws.com\0"
+"kamisato.saitama.jp\0gov.tw\0"
+"hakusan.ishikawa.jp\0naturalhistorymuseum.museum\0"
+"tur.ar\0"
+"4.bg\0wiw.gov.pl\0gov.uk\0cya.gg\0"
+"orskog.no\0"
+"pe.ca\0versicherung\0trafficplex.cloud\0"
+"ck.ua\0"
+"cloudns.asia\0blogspot.co.za\0nom.vc\0"
+"kyowa.akita.jp\0gov.vc\0you\0"
+"gov.ve\0webhop.org\0nom.vg\0"
+"ishinomaki.miyagi.jp\0myhome-server.de\0"
+"nom.uy\0"
+"*.yokohama.jp\0"
+"tur.br\0"
+"hekinan.aichi.jp\0"
+"shibukawa.gunma.jp\0gov.vn\0"
+"museum.mv\0"
+"am.br\0museum.mw\0"
+"nyuzen.toyama.jp\0estate\0freebox-os.com\0"
+"catholic.edu.au\0"
+"museum.no\0"
+"misato.saitama.jp\0rugby\0"
+"kamitonda.wakayama.jp\0community.museum\0"
+"pictet\0"
+"serveirc.com\0"
+"gov.ws\0"
+"minami.kyoto.jp\0timekeeping.museum\0"
+"carrara-massa.it\0florist\0"
+"museum.om\0"
+"intuit\0"
+"maibara.shiga.jp\0"
+"\xe5\xb2\x90\xe9\x98\x9c.jp\0red.sv\0"
+"kumano.hiroshima.jp\0"
+"paris.museum\0sciencecenter.museum\0"
+"can.museum\0"
+"nom.za\0"
+"\xe4\xb8\xaa\xe4\xba\xba.hk\0"
+"gjovik.no\0gov.za\0from-ca.com\0"
+"tomiya.miyagi.jp\0"
+"hokuto.hokkaido.jp\0sukumo.kochi.jp\0\xd8\xa7\xd8\xa8\xd9\x88\xd8\xb8\xd8\xa8\xd9\x8a\0"
+"kiryu.gunma.jp\0"
+"custom.metacentrum.cz\0"
+"nago.okinawa.jp\0shinjuku.tokyo.jp\0sopot.pl\0"
+"dealer\0"
+"k12.ut.us\0gov.zm\0drud.io\0"
+"collegefan.org\0"
+"tonsberg.no\0"
+"navuotna.no\0\xd9\x83\xd9\x88\xd9\x85\0"
+"reliance\0"
+"capebreton.museum\0alibaba\0"
+"hamatonbetsu.hokkaido.jp\0osoyro.no\0k12.oh.us\0gov.zw\0from-ky.com\0"
+"nanjo.okinawa.jp\0"
+"film\0"
+"yun\0"
+"trustee.museum\0"
+"nt.edu.au\0muika.niigata.jp\0"
+"memorial\0"
+"homesense\0"
+"shiroi.chiba.jp\0"
+"yamagata.jp\0brother\0"
+"wakayama.wakayama.jp\0"
+"ltd.co.im\0myoko.niigata.jp\0"
+"dinosaur.museum\0"
+"izumi.osaka.jp\0"
+"so.it\0nakagawa.tokushima.jp\0"
+"kr\xc3\xb8""dsherad.no\0ulvik.no\0"
+"vic.edu.au\0bel.tr\0"
+"pe.it\0"
+"nanto.toyama.jp\0"
+"asn.au\0miyako.fukuoka.jp\0sennan.osaka.jp\0"
+"tenri.nara.jp\0"
+"shibetsu.hokkaido.jp\0"
+"volyn.ua\0is-a-player.com\0"
+"shaw\0"
+"gdynia.pl\0"
+"giving\0"
+"shitara.aichi.jp\0sor-fron.no\0"
+"\xe3\x83\x95\xe3\x82\xa1\xe3\x83\x83\xe3\x82\xb7\xe3\x83\xa7\xe3\x83\xb3\0"
+"yamaga.kumamoto.jp\0evje-og-hornnes.no\0"
+"samukawa.kanagawa.jp\0"
+"is-lost.org\0"
+"edu.krd\0now-dns.org\0"
+"\xe0\xb2\xad\xe0\xb2\xbe\xe0\xb2\xb0\xe0\xb2\xa4\0"
+"okinawa\0"
+"luroy.no\0"
+"nobeoka.miyazaki.jp\0armenia.su\0"
+"pe.kr\0"
+"washtenaw.mi.us\0lplfinancial\0"
+"matsubara.osaka.jp\0"
+"tn.us\0homegoods\0"
+"christmas\0"
+"audi\0\xe6\x8b\x9b\xe8\x81\x98\0mmafan.biz\0"
+"adv.br\0"
+"ferrara.it\0"
+"fedje.no\0today\0"
+"contemporaryart.museum\0"
+"kira.aichi.jp\0tmall\0"
+"africa.com\0"
+"zip\0"
+"of.by\0"
+"aogaki.hyogo.jp\0"
+"kumiyama.kyoto.jp\0ureshino.mie.jp\0"
+"friuliv-giulia.it\0"
+"yoga\0"
+"\xe9\x9d\x92\xe6\xa3\xae.jp\0"
+"poniatowa.pl\0"
+"ap-southeast-2.elasticbeanstalk.com\0"
+"beer\0"
+"hb.cn\0"
+"\xe9\x95\xb7\xe5\xb4\x8e.jp\0hikimi.shimane.jp\0"
+"akishima.tokyo.jp\0fire\0s3.dualstack.eu-west-3.amazonaws.com\0"
+"krodsherad.no\0miami\0"
+"porsgrunn.no\0"
+"posts-and-telecommunications.museum\0salvadordali.museum\0genting\0"
+"h\xc3\xa1""bmer.no\0"
+"pasadena.museum\0loginline.io\0"
+"mukawa.hokkaido.jp\0solund.no\0"
+"h\xc3\xa5.no\0lipsy\0"
+"konan.shiga.jp\0force.museum\0wskr.gov.pl\0"
+"\xc3\xa5snes.no\0"
+"etc.br\0inagawa.hyogo.jp\0sumy.ua\0"
+"atm.pl\0"
+"rns.tn\0"
+"nonoichi.ishikawa.jp\0fish\0"
+"bamble.no\0"
+"bulsan-s\xc3\xbc""dtirol.it\0inc.hk\0"
+"erotica.hu\0trentino-aadige.it\0kadogawa.miyazaki.jp\0"
+"kushimoto.wakayama.jp\0"
+"de.com\0"
+"from-mt.com\0from-nd.com\0"
+"kvinesdal.no\0"
+"school\0"
+"\xe6\x89\x8b\xe6\x9c\xba\0myfritz.net\0"
+"hopto.org\0"
+"design.museum\0"
+"monza-e-della-brianza.it\0"
+"ohi.fukui.jp\0"
+"dattolocal.net\0"
+"redstone\0"
+"futsu.nagasaki.jp\0"
+"shimizu.shizuoka.jp\0twmail.net\0"
+"scienceandhistory.museum\0"
+"jp.eu.org\0"
+"shia\0"
+"no-ip.net\0"
+"nayoro.hokkaido.jp\0in-vpn.net\0"
+"jogasz.hu\0afjord.no\0"
+"sp.gov.br\0rnrt.tn\0"
+"tsuchiura.ibaraki.jp\0agdenes.no\0\xd1\x80\xd1\x83\xd1\x81\0"
+"spy.museum\0\xe4\xb8\x96\xe7\x95\x8c\0"
+"alta.no\0"
+"ena.gifu.jp\0"
+"gouv.fr\0forl\xc3\xac""cesena.it\0"
+"kisosaki.mie.jp\0"
+"lamborghini\0"
+"jobs\0"
+"\xd8\xa7\xd8\xaa\xd8\xb5\xd8\xa7\xd9\x84\xd8\xa7\xd8\xaa\0"
+"n.se\0"
+"tattoo\0"
+"maif\0"
+"taranto.it\0abeno.osaka.jp\0"
+"finnoy.no\0"
+"siena.it\0\xd9\x85\xd8\xb5\xd8\xb1\0"
+"ota.gunma.jp\0"
+"utsunomiya.tochigi.jp\0drud.us\0"
+"imizu.toyama.jp\0"
+"askim.no\0"
+"gr.it\0"
+"rzeszow.pl\0"
+"v-info.info\0"
+"koeln\0"
+"gouv.ht\0mjondalen.no\0"
+"s\xc3\xb8r-aurdal.no\0"
+"gr.jp\0naka.ibaraki.jp\0fbxos.fr\0"
+"date.hokkaido.jp\0"
+"asn.lv\0so.gov.pl\0"
+"wi.us\0"
+"cable-modem.org\0spacekit.io\0"
+"kvits\xc3\xb8y.no\0"
+"koori.fukushima.jp\0edogawa.tokyo.jp\0"
+"farmers\0"
+"sakura.chiba.jp\0"
+"sanagochi.tokushima.jp\0"
+"handa.aichi.jp\0esashi.hokkaido.jp\0"
+"torahime.shiga.jp\0"
+"gouv.bj\0"
+"kimino.wakayama.jp\0"
+"gc.ca\0imabari.ehime.jp\0ia.us\0"
+"vallee-aoste.it\0"
+"health.nz\0"
+"delivery\0"
+"damnserver.com\0"
+"gouv.ci\0ide.kyoto.jp\0"
+"daisen.akita.jp\0"
+"aerobatic.aero\0adygeya.su\0"
+"homeunix.com\0"
+"takamori.kumamoto.jp\0"
+"plantation.museum\0"
+"4u.com\0"
+"adv.mz\0"
+"kv\xc3\xa6nangen.no\0\xe6\x85\x88\xe5\x96\x84\0"
+"kr.com\0"
+"flight.aero\0shop\0"
+"civilisation.museum\0of.no\0s3-website-eu-west-1.amazonaws.com\0"
+"usantiques.museum\0"
+"uvic.museum\0apps.lair.io\0"
+"show\0"
+"hadano.kanagawa.jp\0"
+"tinn.no\0\xe8\x87\xba\xe7\x81\xa3\0"
+"fukuchiyama.kyoto.jp\0"
+"kunisaki.oita.jp\0"
+"ferrero\0"
+"aikawa.kanagawa.jp\0"
+"tado.mie.jp\0london.museum\0"
+"adygeya.ru\0"
+"s3.cn-north-1.amazonaws.com.cn\0"
+"natura\0"
+"\xe6\xa0\x83\xe6\x9c\xa8.jp\0oki.fukuoka.jp\0"
+"s3.dualstack.eu-central-1.amazonaws.com\0"
+"joetsu.niigata.jp\0hinohara.tokyo.jp\0"
+"patria.bo\0my-firewall.org\0"
+"lucerne.museum\0"
+"adult.ht\0cc.oh.us\0yodobashi\0"
+"sogne.no\0in.london\0"
+"best\0cisco\0"
+"akune.kagoshima.jp\0gmina.pl\0\xd8\xa7\xd9\x84\xd8\xa7\xd8\xb1\xd8\xaf\xd9\x86\0"
+"conference.aero\0nozawaonsen.nagano.jp\0\xe0\xa4\xa8\xe0\xa5\x87\xe0\xa4\x9f\0"
+"dyn-o-saur.com\0"
+"hurum.no\0"
+"pescara.it\0"
+"from-wa.com\0"
+"surrey.museum\0statebank\0"
+"watches\0"
+"auto\0"
+"tec.mi.us\0"
+"utashinai.hokkaido.jp\0ariake.saga.jp\0is-by.us\0"
+"ryugasaki.ibaraki.jp\0fukudomi.saga.jp\0"
+"ra.it\0"
+"campinagrande.br\0portlligat.museum\0"
+"cechire.com\0"
+"tanagura.fukushima.jp\0hasama.oita.jp\0"
+"madrid.museum\0"
+"wroc.pl\0"
+"mihama.aichi.jp\0miyake.nara.jp\0clinton.museum\0"
+"m\xc3\xa5lselv.no\0"
+"muko.kyoto.jp\0hitachi\0"
+"feste-ip.net\0"
+"uz.ua\0\xd1\x81\xd1\x80\xd0\xb1\0law.za\0landrover\0"
+"zp.gov.pl\0"
+"health.vn\0"
+"ci.it\0echizen.fukui.jp\0"
+"air-traffic-control.aero\0toscana.it\0"
+"venezia.it\0hidaka.hokkaido.jp\0community\0"
+"salud.bo\0"
+"civilwar.museum\0trogstad.no\0"
+"tomioka.gunma.jp\0"
+"philately.museum\0"
+"tranby.no\0"
+"travel.pl\0"
+"sr.gov.pl\0bauhaus\0"
+"nv.us\0"
+"maryland.museum\0"
+"yokaichiba.chiba.jp\0"
+"carraramassa.it\0s3-ap-southeast-2.amazonaws.com\0"
+"kamimine.saga.jp\0"
+"lib.wa.us\0"
+"inabe.mie.jp\0"
+"komatsu.ishikawa.jp\0discovery.museum\0"
+"webhosting.be\0blogsyte.com\0"
+"schaeffler\0"
+"ekloges.cy\0buzen.fukuoka.jp\0zapto.org\0"
+"bremanger.no\0"
+"press.aero\0museumvereniging.museum\0"
+"staples\0"
+"static-access.net\0"
+"bjerkreim.no\0"
+"bj.cn\0sobetsu.hokkaido.jp\0ismaili\0"
+"sumoto.kumamoto.jp\0stordal.no\0"
+"fredrikstad.no\0"
+"ami.ibaraki.jp\0shingu.wakayama.jp\0"
+"oamishirasato.chiba.jp\0"
+"kikonai.hokkaido.jp\0repair\0"
+"nord-aurdal.no\0"
+"okazaki.aichi.jp\0grondar.za\0"
+"s3-sa-east-1.amazonaws.com\0"
+"couchpotatofries.org\0"
+"no-ip.info\0"
+"vestre-slidre.no\0\xe5\x80\x8b\xe4\xba\xba.\xe9\xa6\x99\xe6\xb8\xaf\0"
+"kishiwada.osaka.jp\0"
+"airtraffic.aero\0nagano.jp\0inuyama.aichi.jp\0"
+"dsmynas.org\0"
+"amsterdam.museum\0hoyanger.no\0"
+"travel.tt\0"
+"ogose.saitama.jp\0"
+"higashi.fukuoka.jp\0"
+"for-the.biz\0"
+"surnadal.no\0bytom.pl\0"
+"winb.gov.pl\0wellbeingzone.eu\0"
+"zentsuji.kagawa.jp\0minamidaito.okinawa.jp\0trondheim.no\0"
+"res.aero\0"
+"urbinopesaro.it\0"
+"etajima.hiroshima.jp\0"
+"gjemnes.no\0glitch.me\0"
+"silk\0"
+"kisarazu.chiba.jp\0"
+"esurance\0"
+"austevoll.no\0k12.ky.us\0sa-east-1.elasticbeanstalk.com\0better-than.tv\0"
+"higashiagatsuma.gunma.jp\0ug.gov.pl\0"
+"fuoisku.no\0"
+"fbx-os.fr\0"
+"fujieda.shizuoka.jp\0"
+"openair.museum\0"
+"suginami.tokyo.jp\0"
+"kawaba.gunma.jp\0takasaki.gunma.jp\0stage.nodeart.io\0"
+"warabi.saitama.jp\0"
+"chirurgiens-dentistes-en-france.fr\0"
+"virtualserver.io\0"
+"sakae.chiba.jp\0kawai.nara.jp\0sina\0"
+"oguni.yamagata.jp\0voss.no\0"
+"pr.it\0"
+"kitagawa.kochi.jp\0"
+"odda.no\0"
+"site.builder.nu\0"
+"webhop.net\0"
+"moka.tochigi.jp\0lincoln\0is.eu.org\0"
+"pippu.hokkaido.jp\0"
+"sciencesnaturelles.museum\0"
+"gouv.sn\0"
+"shibecha.hokkaido.jp\0"
+"college\0url.tw\0"
+"massa-carrara.it\0"
+"diet\0*.otap.co\0"
+"yashio.saitama.jp\0chofu.tokyo.jp\0"
+"\xe8\xaf\xba\xe5\x9f\xba\xe4\xba\x9a\0"
+"miasa.nagano.jp\0"
+"l.bg\0servebbs.com\0"
+"family\0"
+"ichikawamisato.yamanashi.jp\0"
+"2.bg\0\xd8\xb3\xd9\x88\xd8\xaf\xd8\xa7\xd9\x86\0"
+"komforb.se\0"
+"customer.speedpartner.de\0"
+"it.eu.org\0"
+"caserta.it\0"
+"tamba.hyogo.jp\0"
+"miyako.iwate.jp\0"
+"\xe7\xbd\x91\xe5\x9d\x80\0bmoattachments.org\0"
+"kosei.shiga.jp\0"
+"shakotan.hokkaido.jp\0"
+"larsson.museum\0"
+"tel.tr\0cherkassy.ua\0is-a-cubicle-slave.com\0"
+"zappos\0lubartow.pl\0"
+"oguni.kumamoto.jp\0"
+"os\xc3\xb8yro.no\0"
+"support\0"
+"koshimizu.hokkaido.jp\0"
+"film.hu\0assisi.museum\0hockey\0cistron.nl\0"
+"nature.museum\0in.na\0"
+"ardal.no\0cookingchannel\0"
+"consulting.aero\0burghof.museum\0"
+"shiraoka.saitama.jp\0in.ni\0vladimir.su\0"
+"toba.mie.jp\0minnesota.museum\0"
+"tsuruoka.yamagata.jp\0"
+"caa.aero\0freight.aero\0"
+"freeddns.org\0"
+"oga.akita.jp\0no-ip.ca\0"
+"umig.gov.pl\0nissan\0"
+"\xc3\xb8rskog.no\0bplaced.com\0"
+"site\0"
+"tottori.tottori.jp\0"
+"muroto.kochi.jp\0review\0"
+"kamikawa.hyogo.jp\0karmoy.no\0go-vip.net\0"
+"nissay\0"
+"yawara.ibaraki.jp\0riodejaneiro.museum\0"
+"in.eu.org\0"
+"uchiko.ehime.jp\0yao.osaka.jp\0auto.pl\0"
+"horse\0is-a-liberal.com\0"
+"voorloper.cloud\0"
+"freeddns.us\0"
+"nishinoshima.shimane.jp\0limanowa.pl\0"
+"cc.tn.us\0"
+"minokamo.gifu.jp\0estate.museum\0k12.nv.us\0\xd1\x83\xd0\xbf\xd1\x80.\xd1\x81\xd1\x80\xd0\xb1\0vladimir.ru\0"
+"bristol.museum\0"
+"steinkjer.no\0"
+"heimatunduhren.museum\0koeln.museum\0"
+"golffan.us\0"
+"targi.pl\0"
+"fukushima.hokkaido.jp\0"
+"fosnes.no\0showtime\0"
+"essex.museum\0"
+"hicam.net\0"
+"ikawa.akita.jp\0"
+"gouv.km\0"
+"medizinhistorisches.museum\0"
+"happou.akita.jp\0ilawa.pl\0"
+"to.gov.br\0"
+"chippubetsu.hokkaido.jp\0"
+"pc.it\0in.rs\0"
+"dell-ogliastra.it\0suwalki.pl\0"
+"itoigawa.niigata.jp\0toshima.tokyo.jp\0wolterskluwer\0"
+"li.it\0namikata.ehime.jp\0"
+"ddnss.org\0"
+"fukushima.jp\0muroran.hokkaido.jp\0"
+"eu-west-1.elasticbeanstalk.com\0"
+"ama.aichi.jp\0"
+"geek.nz\0quicksytes.com\0"
+"agriculture.museum\0"
+"citic\0"
+"chase\0wales\0dscloud.mobi\0"
+"fuefuki.yamanashi.jp\0gouv.ml\0in.th\0"
+"iwatsuki.saitama.jp\0"
+"chiyoda.tokyo.jp\0is-not-certified.com\0"
+"seirou.niigata.jp\0"
+"nt.au\0"
+"meldal.no\0"
+"wv.us\0"
+"shizukuishi.iwate.jp\0"
+"in.ua\0pa.leg.br\0"
+"texas.museum\0univ.sn\0cyou\0virtual-user.de\0"
+"vlaanderen\0"
+"law.pro\0cust.disrec.thingdust.io\0"
+"nt.ca\0pr.us\0"
+"nakagusuku.okinawa.jp\0"
+"togura.nagano.jp\0okinawa.okinawa.jp\0"
+"\xc3\xa1k\xc5\x8boluokta.no\0k\xc3\xa5""fjord.no\0"
+"tottori.jp\0ikeda.fukui.jp\0onna.okinawa.jp\0republican\0"
+"rightathome\0"
+"town.museum\0in.us\0"
+"city.hu\0jprs\0"
+"flanders.museum\0"
+"ditchyourip.com\0firewall-gateway.de\0"
+"olawa.pl\0"
+"veterinaire.km\0youtube\0"
+"sorfold.no\0az.us\0"
+"sakai.fukui.jp\0arai.shizuoka.jp\0"
+"lib.ri.us\0"
+"is-a-financialadvisor.com\0pb.leg.br\0"
+"dyn53.io\0"
+"troitsk.su\0"
+"friulivegiulia.it\0lib.ms.us\0lib.nc.us\0futbol\0"
+"\xe9\xab\x98\xe7\x9f\xa5.jp\0frosta.no\0servebeer.com\0"
+"suli.hu\0from-pr.com\0"
+"ina.nagano.jp\0"
+"nosegawa.nara.jp\0"
+"genoa.it\0"
+"shopping\0"
+"parma.it\0misasa.tottori.jp\0firebaseapp.com\0"
+"nakagawa.fukuoka.jp\0"
+"in-addr.arpa\0"
+"lib.ca.us\0twmail.org\0memset.net\0"
+"komvux.se\0"
+"dish\0"
+"legnica.pl\0"
+"oita.jp\0"
+"perugia.it\0kamoenai.hokkaido.jp\0"
+"kobayashi.miyazaki.jp\0"
+"wales.museum\0"
+"flir\0"
+"joboji.iwate.jp\0foodnetwork\0"
"com.ac\0"
-"ebetsu.hokkaido.jp\0*.elb.amazonaws.com.cn\0"
-"com.af\0nom.gt\0"
+"teramo.it\0terni.it\0"
+"com.af\0\xe6\x84\x9b\xe5\xaa\x9b.jp\0"
"com.ag\0"
-"com.ai\0"
-"com.al\0aparecida.br\0"
-"ddnslive.com\0"
-"chippubetsu.hokkaido.jp\0"
-"info.co\0"
-"monash\0nom.hn\0"
+"bato.tochigi.jp\0"
+"com.ai\0pc.pl\0"
+"paris.eu.org\0"
+"com.al\0intel\0"
+"com.am\0hurdal.no\0"
+"veterinaire.fr\0"
"com.ba\0"
-"com.ar\0com.bb\0art.br\0pesaro-urbino.it\0"
-"r\xc3\xa1hkker\xc3\xa1vju.no\0hisamitsu\0"
-"pt.it\0"
+"com.ar\0com.bb\0genkai.saga.jp\0myddns.rocks\0"
+"fujinomiya.shizuoka.jp\0lyngen.no\0n\xc3\xb8tter\xc3\xb8y.no\0"
+"loyalist.museum\0wedding\0"
"com.au\0"
-"kashima.saga.jp\0"
-"com.aw\0tours\0"
-"com.bh\0"
-"com.bi\0"
-"com.az\0"
-"s3.dualstack.eu-west-1.amazonaws.com\0"
-"fukushima.hokkaido.jp\0tokorozawa.saitama.jp\0"
-"com.bm\0oregontrail.museum\0read-books.org\0"
+"com.aw\0forgot.his.name\0"
+"com.bh\0piemonte.it\0tokashiki.okinawa.jp\0"
+"com.bi\0cc.wi.us\0"
+"com.az\0ueda.nagano.jp\0kofu.yamanashi.jp\0building.museum\0"
+"com.bm\0\xe5\x9f\xbc\xe7\x8e\x89.jp\0fedex\0"
"com.bn\0"
-"com.bo\0nom.im\0"
-"ogano.saitama.jp\0"
-"com.br\0"
+"com.bo\0taku.saga.jp\0"
+"carbonia-iglesias.it\0k12.nm.us\0is-gone.com\0"
+"com.br\0soundcast.me\0"
"com.bs\0"
"com.bt\0"
-"software.aero\0pubol.museum\0"
-"abira.hokkaido.jp\0"
+"friulive-giulia.it\0notaires.km\0"
+"zara\0"
"com.by\0com.ci\0"
-"com.bz\0ad.jp\0flickr\0"
-"lds\0"
-"com.cm\0plc.co.im\0"
-"com.cn\0traniandriabarletta.it\0"
-"pueblo.bo\0com.co\0art.do\0"
-"\xe5\x85\xac\xe5\x8f\xb8.cn\0"
-"tohnosho.chiba.jp\0kawanabe.kagoshima.jp\0nakagawa.nagano.jp\0"
-"politica.bo\0"
-"sh.cn\0"
-"com.cu\0tr\xc3\xb8gstad.no\0com.de\0"
-"sanagochi.tokushima.jp\0"
-"com.cw\0karasjok.no\0nom.ke\0"
-"com.cy\0tolga.no\0store.ro\0"
-"art.dz\0lom.it\0mantova.it\0"
-"nakadomari.aomori.jp\0"
-"com.dm\0\xe5\x85\xac\xe5\x8f\xb8.hk\0"
-"com.do\0nom.km\0"
-"\xe6\xbb\x8b\xe8\xb3\x80.jp\0weather\0"
-"koka.shiga.jp\0"
-"com.ec\0bashkiria.ru\0"
-"com.ee\0"
-"com.eg\0settlement.museum\0herokussl.com\0"
-"gets-it.net\0"
-"works.aero\0"
-"com.dz\0"
-"nom.li\0"
-"omachi.saga.jp\0"
-"bearalvahki.no\0"
-"\xe7\xa7\x8b\xe7\x94\xb0.jp\0store.st\0"
-"mandal.no\0north-kazakhstan.su\0obninsk.su\0"
-"com.es\0bashkiria.su\0"
+"com.bz\0"
+"oguchi.aichi.jp\0wmflabs.org\0"
+"com.cm\0cc.ia.us\0\xd1\x83\xd0\xba\xd1\x80\0prudential\0"
+"production.aero\0com.cn\0showa.gunma.jp\0iobb.net\0"
+"jdf.br\0com.co\0"
+"takehara.hiroshima.jp\0"
+"tsukigata.hokkaido.jp\0s3-eu-west-3.amazonaws.com\0"
+"ishikawa.jp\0urausu.hokkaido.jp\0l.se\0"
+"com.cu\0rn.it\0americanart.museum\0com.de\0"
+"hisamitsu\0"
+"com.cw\0"
+"\xce\xb5\xce\xbb\0hb.cldmail.ru\0"
+"imb.br\0com.cy\0"
+"washingtondc.museum\0"
+"com.dm\0mycd.eu\0nid.io\0"
+"encyclopedic.museum\0penza.su\0"
+"com.do\0"
+"com.ec\0hirara.okinawa.jp\0"
+"*.sendai.jp\0kosuge.yamanashi.jp\0"
+"com.ee\0mikawa.yamagata.jp\0stockholm\0"
+"com.eg\0tosu.saga.jp\0"
+"izumizaki.fukushima.jp\0sm.ua\0"
+"com.dz\0balestrand.no\0"
+"avoues.fr\0"
+"infiniti\0"
+"hikawa.shimane.jp\0"
+"aomori.jp\0"
+"saroma.hokkaido.jp\0"
+"vet.br\0com.es\0"
"com.et\0"
-"nom.mg\0mein-iserv.de\0"
-"choyo.kumamoto.jp\0"
-"music.museum\0nom.mk\0"
-"com.fr\0"
-"anjo.aichi.jp\0"
-"com.ge\0nom.nc\0"
-"palmas.br\0\xd8\xa7\xd8\xb1\xd8\xa7\xd9\x85\xd9\x83\xd9\x88\0"
-"com.gh\0"
-"economia.bo\0com.gi\0"
-"nom.ni\0"
-"com.gl\0kawara.fukuoka.jp\0tenri.nara.jp\0"
-"barsy.uk\0"
-"com.gn\0email\0"
-"com.gp\0"
-"delta\0"
-"com.gr\0nagara.chiba.jp\0florist\0"
-"dovre.no\0porsanger.no\0s3-us-gov-west-1.amazonaws.com\0"
-"com.gt\0art.ht\0"
-"com.gu\0from-de.com\0"
-"towada.aomori.jp\0takata.fukuoka.jp\0"
-"nom.nu\0"
-"chambagri.fr\0"
-"com.gy\0ap-northeast-1.elasticbeanstalk.com\0"
-"iwanuma.miyagi.jp\0"
-"catering.aero\0com.hk\0roros.no\0"
-"watch\0"
-"vladimir.su\0"
-"com.hn\0semboku.akita.jp\0hanamigawa.chiba.jp\0chiyoda.gunma.jp\0kuwana.mie.jp\0"
-"cinema.museum\0"
-"com.hr\0"
-"nom.pa\0lug.org.uk\0"
-"com.ht\0higashishirakawa.gifu.jp\0"
-"lom.no\0vestvagoy.no\0"
-"ce.gov.br\0"
-"a.bg\0romskog.no\0nom.pe\0"
-"is-into-games.com\0"
-"inatsuki.fukuoka.jp\0"
-"tra.kp\0"
-"com.im\0abudhabi\0"
-"kudoyama.wakayama.jp\0nom.pl\0"
-"com.io\0aejrie.no\0davvenjarga.no\0"
-"nango.fukushima.jp\0band\0forex\0"
-"com.iq\0nationalfirearms.museum\0"
-"com.is\0bergen.no\0nom.qa\0"
-"bank\0"
-"kurashiki.okayama.jp\0musashino.tokyo.jp\0hotel.tz\0"
-"botany.museum\0newmexico.museum\0nom.pw\0"
-"llc\0university\0"
-"higashinaruse.akita.jp\0fujimi.saitama.jp\0"
-"dclk\0"
-"bunkyo.tokyo.jp\0office-on-the.net\0"
-"com.jo\0mycd.eu\0"
-"kawatana.nagasaki.jp\0satosho.okayama.jp\0kawaguchi.saitama.jp\0"
-"honda\0barrel-of-knowledge.info\0"
-"ch.it\0kanazawa.ishikawa.jp\0"
-"com.kg\0matta-varjjat.no\0nom.re\0mckinsey\0ciscofreak.com\0"
-"*.bd\0higashiagatsuma.gunma.jp\0"
-"com.ki\0"
-"com.km\0schoenbrunn.museum\0vladimir.ru\0ybo.review\0"
-"ichinomiya.aichi.jp\0numata.hokkaido.jp\0"
-"lans.museum\0"
-"mitake.gifu.jp\0com.kp\0"
-"com.la\0nom.ro\0"
-"com.lb\0"
-"veterinaire.km\0com.lc\0uzhgorod.ua\0is-a-musician.com\0freedesktop.org\0"
-"info.ve\0nom.rs\0"
-"tanabe.kyoto.jp\0"
-"com.kw\0"
+"hokuryu.hokkaido.jp\0staging.onred.one\0"
+"nahari.kochi.jp\0"
+"londrina.br\0"
"pgafan.net\0"
-"com.ky\0missile.museum\0"
+"is-a-bruinsfan.org\0"
+"com.fr\0tobishima.aichi.jp\0"
+"com.ge\0otago.museum\0rygge.no\0ky.us\0co.business\0"
+"cooking\0"
+"sasayama.hyogo.jp\0skedsmokorset.no\0no-ip.co.uk\0"
+"com.gh\0valle-aosta.it\0gs.of.no\0"
+"com.gi\0tomari.hokkaido.jp\0"
+"v\xc3\xa5ler.hedmark.no\0"
+"mordovia.su\0"
+"com.gl\0"
+"com.gn\0lindas.no\0"
+"com.gp\0dyndns-blog.com\0"
+"trentinoaadige.it\0"
+"com.gr\0"
+"goshiki.hyogo.jp\0\xe7\xbd\x91\xe7\xab\x99\0"
+"com.gt\0ak.us\0americanexpress\0"
+"com.gu\0taiki.mie.jp\0productions\0"
+"forsale\0*.0emm.com\0"
+"ssl.origin.cdn77-secure.org\0"
+"com.gy\0"
+"com.hk\0agrigento.it\0kamigori.hyogo.jp\0"
+"sch.ae\0oe.yamagata.jp\0"
+"com.hn\0bjark\xc3\xb8y.no\0dyndns-mail.com\0"
+"pistoia.it\0holdings\0*.stg.dev\0"
+"com.hr\0nome.pt\0ltda\0"
+"com.ht\0"
+"nt.no\0\xd0\xbe\xd0\xb1\xd1\x80.\xd1\x81\xd1\x80\xd0\xb1\0comsec\0"
+"kiso.nagano.jp\0"
+"\xe7\xb5\x84\xe7\xb9\x94.\xe9\xa6\x99\xe6\xb8\xaf\0dynalias.net\0"
+"tunes\0"
+"r\xc3\xa6lingen.no\0hepforge.org\0"
+"tank.museum\0"
+"com.im\0wajiki.tokushima.jp\0"
+"com.io\0"
+"iwate.iwate.jp\0"
+"com.iq\0work\0"
+"catania.it\0shibata.miyagi.jp\0seoul.kr\0"
+"com.is\0kasuya.fukuoka.jp\0gemological.museum\0groks-this.info\0"
+"press.museum\0rocks\0"
+"orsta.no\0"
+"iris.arpa\0"
+"malvik.no\0"
+"mordovia.ru\0"
+"tsuyama.okayama.jp\0"
+"s\xc3\xb8ndre-land.no\0"
+"schokokeks.net\0"
+"com.jo\0"
+"lugansk.ua\0"
+"kazuno.akita.jp\0"
+"eu.meteorapp.com\0"
+"ibara.okayama.jp\0sklep.pl\0nis.za\0cloud.fedoraproject.org\0"
+"com.kg\0\xd7\xa7\xd7\x95\xd7\x9d\0s3.dualstack.ap-southeast-1.amazonaws.com\0"
+"com.ki\0"
+"jan-mayen.no\0"
+"kunigami.okinawa.jp\0"
+"com.km\0"
+"tsumagoi.gunma.jp\0"
+"usdecorativearts.museum\0leikanger.no\0"
+"obira.hokkaido.jp\0com.kp\0"
+"com.la\0"
+"com.lb\0*.alces.network\0"
+"com.lc\0"
+"artanddesign.museum\0osen.no\0"
+"sn\xc3\xa5sa.no\0"
+"com.kw\0dreamhosters.com\0"
+"tamakawa.fukushima.jp\0mykolaiv.ua\0"
+"com.ky\0"
"com.kz\0"
-"com.lk\0nom.si\0"
-"pa.it\0info.vn\0arab\0"
-"*.ck\0"
-"miyako.iwate.jp\0"
-"k12.ok.us\0"
-"com.lr\0wlocl.pl\0\xe5\xb7\xa5\xe8\xa1\x8c\0"
-"\xd9\xbe\xd8\xa7\xda\xa9\xd8\xb3\xd8\xaa\xd8\xa7\xd9\x86\0"
-"isa-hockeynut.com\0"
-"com.lv\0ostrowiec.pl\0nom.st\0"
-"com.mg\0"
-"kawasaki.miyagi.jp\0"
+"com.lk\0freebox-os.fr\0withyoutube.com\0"
+"cc.nv.us\0"
+"aknoluokta.no\0"
+"pi.leg.br\0"
+"pvh.br\0"
+"tsunan.niigata.jp\0com.lr\0skin\0"
+"k12.fl.us\0pizza\0"
+"kashima.saga.jp\0nt.ro\0"
+"com.lv\0"
+"cuneo.it\0kainan.tokushima.jp\0com.mg\0*.kunden.ortsinfo.at\0"
+"k12.ar.us\0"
"com.ly\0"
-"com.mk\0"
-"com.ml\0nom.tj\0"
-"historyofscience.museum\0midtre-gauldal.no\0bir.ru\0"
-"minami.fukuoka.jp\0"
-"com.mo\0southwest.museum\0nom.tm\0drud.io\0"
+"com.mk\0discover\0from-id.com\0"
+"com.ml\0tysvar.no\0"
+"n\xc3\xa6r\xc3\xb8y.no\0bplaced.net\0"
+"kai.yamanashi.jp\0"
+"com.mo\0globo\0"
"com.na\0"
-"com.ms\0showtime\0"
-"com.mt\0lol\0"
-"com.mu\0plaza.museum\0"
-"com.mv\0com.nf\0"
+"bifuka.hokkaido.jp\0"
+"com.ms\0lunner.no\0qualifioapp.com\0"
+"com.mt\0"
+"obama.nagasaki.jp\0com.mu\0"
+"com.mv\0com.nf\0vuelos\0"
"com.mw\0com.ng\0"
"com.mx\0"
-"com.my\0com.ni\0nom.ug\0"
-"yonezawa.yamagata.jp\0"
-"production.aero\0sciencecenters.museum\0"
-"lodi.it\0info.tn\0"
-"chiryu.aichi.jp\0"
-"blogdns.com\0"
-"com.nr\0info.tr\0"
-"lib.mt.us\0lib.nd.us\0"
-"info.tt\0lpl\0"
-"ooguy.com\0nom.vc\0"
-"*.er\0"
-"sande.m\xc3\xb8re-og-romsdal.no\0"
-"veterinaire.fr\0rikuzentakata.iwate.jp\0jeonnam.kr\0"
-"nom.vg\0"
-"info.tz\0"
-"t.se\0nom.uy\0"
-"art.pl\0"
-"com.om\0"
-"*.fj\0"
-"*.fk\0"
-"\xe4\xb8\x89\xe9\x87\x8d.jp\0"
-"com.pa\0cc.pa.us\0"
-"nishinomiya.hyogo.jp\0"
-"tsurugashima.saitama.jp\0"
-"aukra.no\0com.pe\0"
-"hara.nagano.jp\0com.pf\0man\0"
-"pharmacy.museum\0"
-"piemonte.it\0trentinosudtirol.it\0com.ph\0map\0zapto.xyz\0"
-"mba\0"
-"izena.okinawa.jp\0"
-"museumvereniging.museum\0com.pk\0"
-"tomioka.gunma.jp\0com.pl\0"
-"takasaki.gunma.jp\0hiraizumi.iwate.jp\0"
-"info.ro\0"
-"historichouses.museum\0com.qa\0"
-"com.pr\0"
-"com.ps\0"
-"com.pt\0info.sd\0"
-"g\xc3\xa1\xc5\x8bgaviika.no\0"
-"hida.gifu.jp\0"
-"hotel.lk\0com.py\0paris\0"
-"\xe5\xb1\xb1\xe5\x8f\xa3.jp\0fujixerox\0"
-"yachiyo.chiba.jp\0"
-"trentinosued-tirol.it\0\xe0\xa6\xad\xe0\xa6\xbe\xe0\xa7\xb0\xe0\xa6\xa4\0"
-"holtalen.no\0"
-"\xe7\xb5\x84\xe7\xb9\x94.tw\0"
-"soeda.fukuoka.jp\0"
-"gorge.museum\0com.re\0au.eu.org\0be.eu.org\0"
-"info.pk\0"
-"trentinosuedtirol.it\0tokamachi.niigata.jp\0gushikami.okinawa.jp\0info.pl\0ltd\0"
-"miyoshi.saitama.jp\0art.sn\0"
+"com.my\0com.ni\0"
+"kamagaya.chiba.jp\0"
+"df.gov.br\0komatsu\0"
+"channelsdvr.net\0global.prod.fastly.net\0"
+"nara.jp\0"
+"mo\xc3\xa5reke.no\0bible\0"
+"ne.jp\0"
+"uenohara.yamanashi.jp\0bindal.no\0com.nr\0"
+"ne.ke\0"
+"tula.su\0"
+"costume.museum\0od.ua\0"
+"bulsan-sudtirol.it\0soma.fukushima.jp\0osakikamijima.hiroshima.jp\0nishikawa.yamagata.jp\0user.aseinet.ne.jp\0"
+"y.bg\0"
+"pp.az\0com.om\0"
+"bilbao.museum\0"
+"ne.kr\0com.pa\0"
+"definima.net\0"
+"cloudfront.net\0"
+"com.pe\0"
+"com.pf\0cv.ua\0"
+"kitayama.wakayama.jp\0lier.no\0"
+"com.ph\0at-band-camp.net\0"
+"sch.id\0com.pk\0"
+"tj.cn\0com.pl\0"
+"shimotsuma.ibaraki.jp\0\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4\0"
+"ruovat.no\0"
+"com.qa\0"
+"kamitsue.oita.jp\0com.pr\0mlbfan.org\0"
+"\xe4\xbd\x90\xe8\xb3\x80.jp\0bill.museum\0com.ps\0exchange\0"
+"com.pt\0"
+"jgora.pl\0"
+"sch.ir\0com.py\0go-vip.co\0"
+"center\0"
+"elasticbeanstalk.com\0"
+"pvt.k12.ma.us\0"
+"otsuki.kochi.jp\0"
+"nextdirect\0"
+"the.br\0dsmynas.net\0"
+"com.re\0lib.la.us\0"
+"natal.br\0sch.jo\0"
+"karasuyama.tochigi.jp\0"
+"ravenna.it\0"
+"matsubushi.saitama.jp\0deals\0vpndns.net\0"
+"med.br\0meland.no\0"
+"perso.ht\0ringebu.no\0"
+"ikoma.nara.jp\0sakai.osaka.jp\0"
+"anthropology.museum\0durham.museum\0"
"com.ro\0"
-"denmark.museum\0uhren.museum\0com.sa\0servegame.com\0"
-"info.pr\0com.sb\0"
-"com.sc\0nom.za\0"
-"hs.kr\0com.sd\0"
-"\xc3\xa5l.no\0com.se\0com.ru\0"
-"mashiki.kumamoto.jp\0"
-"com.rw\0com.sg\0"
+"weather\0myjino.ru\0"
+"com.sa\0"
+"dgca.aero\0com.sb\0"
+"com.sc\0"
+"com.sd\0"
+"com.se\0com.ru\0"
+"ibaraki.jp\0com.sg\0"
"com.sh\0"
-"rade.no\0americanfamily\0"
-"valledaosta.it\0"
-"froya.no\0"
-"store.bb\0com.sl\0med\0"
-"com.sn\0ericsson\0"
-"com.so\0git-repos.de\0"
-"ryuoh.shiga.jp\0"
-"*.jm\0info.na\0is-a-democrat.com\0"
-"britishcolumbia.museum\0"
-"motobu.okinawa.jp\0com.st\0"
-"myravendb.com\0"
-"info.mv\0info.nf\0com.sv\0men\0"
-"trainer.aero\0"
-"info.ni\0com.sy\0barsy.bg\0"
-"com.tj\0"
-"*.kh\0"
+"matsumoto.nagano.jp\0"
+"niigata.jp\0com.sl\0"
+"video\0"
+"art.museum\0virtual.museum\0com.sn\0"
+"com.so\0"
+"itako.ibaraki.jp\0sch.lk\0rodeo\0"
+"com.ss\0northwesternmutual\0"
+"ogata.akita.jp\0com.st\0pt.eu.org\0"
+"opoczno.pl\0podhale.pl\0lugs.org.uk\0"
+"arteducation.museum\0com.sv\0xnbay.com\0"
+"com.sy\0"
+"correios-e-telecomunica\xc3\xa7\xc3\xb5""es.museum\0com.tj\0"
+"milano.it\0roma.it\0s3-fips-us-gov-west-1.amazonaws.com\0"
+"med.ec\0*.awdev.ca\0"
"com.tm\0"
-"com.tn\0"
-"depot.museum\0com.to\0"
-"com.ua\0safe\0"
-"info.nr\0com.tr\0pohl\0"
-"tysvar.no\0"
-"re.it\0com.tt\0"
-"muncie.museum\0com.tw\0cherkassy.ua\0com.ug\0"
-"geisei.kochi.jp\0izumi.osaka.jp\0swidnik.pl\0"
-"tomobe.ibaraki.jp\0"
-"exeter.museum\0"
-"monzabrianza.it\0"
-"info.la\0bitballoon.com\0"
-"\xe0\xb8\x97\xe0\xb8\xab\xe0\xb8\xb2\xe0\xb8\xa3.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0istanbul\0"
-"hotel.hu\0com.vc\0barcelona\0"
-"com.ve\0realestate\0store.dk\0bg.eu.org\0"
-"flog.br\0"
-"\xe7\xbb\x84\xe7\xb9\x94.hk\0barsy.de\0"
-"com.uy\0com.vi\0ddnsking.com\0"
-"com.uz\0"
+"med.ee\0com.tn\0"
+"com.to\0pe.leg.br\0yandexcloud.net\0"
+"sch.ly\0"
+"com.ua\0paris\0"
+"com.tr\0discourse.group\0"
+"host\0"
+"com.tt\0"
+"francaise.museum\0ne.pw\0"
+"com.tw\0com.ug\0us-east-1.elasticbeanstalk.com\0"
+"modelling.aero\0k12.sc.us\0"
+"katsuragi.wakayama.jp\0klodzko.pl\0"
+"rad\xc3\xb8y.no\0from-la.net\0"
+"nishiawakura.okayama.jp\0"
+"sch.ng\0online.th\0from-ak.com\0"
+"utah.museum\0"
+"v\xc3\xa5gan.no\0"
+"nagasaki.jp\0"
+"ogasawara.tokyo.jp\0varoy.no\0com.vc\0"
+"v\xc3\xa5ler.\xc3\xb8stfold.no\0"
+"com.ve\0"
+"k12.gu.us\0"
+"priv.hu\0"
+"com.uy\0com.vi\0"
+"trani-andria-barletta.it\0kawaminami.miyazaki.jp\0com.uz\0"
+"tr\xc3\xb8gstad.no\0"
+"iijima.nagano.jp\0"
"com.vn\0"
-"bronnoysund.no\0"
-"toya.hokkaido.jp\0ebina.kanagawa.jp\0"
-"*.mm\0zoological.museum\0lind\xc3\xa5s.no\0"
-"re.kr\0"
-"info.ls\0no-ip.co.uk\0"
+"isumi.chiba.jp\0"
+"*.moonscale.io\0"
"com.vu\0"
-"finearts.museum\0"
-"hiratsuka.kanagawa.jp\0"
-"media.hu\0iron.museum\0"
-"jampa.br\0"
-"k12.nj.us\0"
-"tamano.okayama.jp\0"
-"misaki.okayama.jp\0cloudns.club\0"
-"heroy.nordland.no\0"
-"homeftp.net\0"
+"tohnosho.chiba.jp\0"
+"guide\0"
+"yolasite.com\0"
+"is-a-lawyer.com\0"
+"mugi.tokushima.jp\0"
+"democracia.bo\0"
+"*.nagoya.jp\0"
"com.ws\0"
-"mil\0*.np\0hgtv\0"
-"varggat.no\0"
-"vlog.br\0oharu.aichi.jp\0"
-"barsy.eu\0"
-"mit\0"
-"pa.us\0"
-"friulivegiulia.it\0"
-"town.museum\0"
-"\xe5\xb1\xb1\xe5\xbd\xa2.jp\0hidaka.saitama.jp\0"
-"ab.ca\0info.ke\0forum\0us.com\0"
-"chuo.fukuoka.jp\0sklep.pl\0"
-"qld.au\0"
-"info.ki\0"
-"jinsekikogen.hiroshima.jp\0yashio.saitama.jp\0"
-"*.pg\0"
-"lib.mi.us\0"
-"to.leg.br\0"
-"comsec\0"
-"jan-mayen.no\0"
-"loten.no\0drud.us\0"
-"a.se\0army\0east-kazakhstan.su\0"
-"tomiya.miyagi.jp\0"
-"mlb\0"
-"s3-website.ap-south-1.amazonaws.com\0kurgan.su\0"
-"sld.do\0com.zm\0"
-"campidanomedio.it\0"
-"luxembourg.museum\0sale\0"
+"lifestyle\0"
+"helsinki\0"
+"miyada.nagano.jp\0"
+"\xd8\xa7\xd8\xb1\xd8\xa7\xd9\x85\xd9\x83\xd9\x88\0"
+"sch.qa\0"
+"akaiwa.okayama.jp\0"
+"med.ht\0"
+"flog.br\0"
+"from-tx.com\0"
+"s3-website.eu-west-3.amazonaws.com\0"
+"j.bg\0okawa.kochi.jp\0we.bs\0"
+"brumunddal.no\0pruszkow.pl\0ne.ug\0"
+"odo.br\0ponpes.id\0"
+"sk.ca\0*.sapporo.jp\0"
+"ne.tz\0"
+"0.bg\0corsica\0"
+"grane.no\0"
+"motosu.gifu.jp\0"
+"\xe0\xae\x87\xe0\xae\xb2\xe0\xae\x99\xe0\xaf\x8d\xe0\xae\x95\xe0\xaf\x88\0"
+"taa.it\0"
+"minamiaiki.nagano.jp\0"
+"lowicz.pl\0ne.us\0cloudns.pro\0"
+"surgeonshall.museum\0"
+"sandoy.no\0"
+"textile.museum\0"
+"sch.sa\0"
+"ga.us\0"
+"com.zm\0"
+"trd.br\0ogawa.nagano.jp\0"
+"trentino-stirol.it\0wegrow.pl\0selfip.net\0"
+"vlog.br\0est-a-la-masion.com\0"
+"obu.aichi.jp\0"
+"meet\0"
+"fhsk.se\0sch.so\0"
+"kasugai.aichi.jp\0stuff-4-sale.org\0kalmykia.su\0priv.at\0"
+"architecture.museum\0\xe6\x88\x91\xe7\x88\xb1\xe4\xbd\xa0\0"
+"nagiso.nagano.jp\0"
+"balsan-suedtirol.it\0"
+"romskog.no\0grozny.su\0telebit.app\0"
+"beiarn.no\0"
+"koge.tottori.jp\0"
+"takata.fukuoka.jp\0iwafune.tochigi.jp\0aremark.no\0"
+"of.fashion\0"
+"iiyama.nagano.jp\0cambridge.museum\0lib.al.us\0"
"ouda.nara.jp\0"
-"dynamic-dns.info\0"
-"griw.gov.pl\0"
-"s3-external-1.amazonaws.com\0"
-"karikatur.museum\0project.museum\0mma\0"
-"kg.kr\0"
-"mls\0"
-"arpa\0michigan.museum\0"
-"nanporo.hokkaido.jp\0uppo.gov.pl\0"
-"flesberg.no\0"
-"barsy.in\0"
-"it.ao\0time.no\0barsy.io\0"
-"freemasonry.museum\0africa\0hr.eu.org\0"
-"ntdll.top\0"
-"r.bg\0skierva.no\0qc.com\0"
-"r\xc3\xa1isa.no\0parts\0"
-"omiya.saitama.jp\0"
-"roma.museum\0"
-"res.aero\0party\0"
-"rockart.museum\0"
-"mj\xc3\xb8ndalen.no\0contractors\0passagens\0"
-"hamaroy.no\0"
-"go.gov.br\0"
-"educational.museum\0"
-"amagasaki.hyogo.jp\0frontier\0"
-"\xe7\xae\x87\xe4\xba\xba.hk\0ddr.museum\0s3.dualstack.ap-southeast-2.amazonaws.com\0"
-"weir\0"
-"feira.br\0asakawa.fukushima.jp\0"
-"fl\xc3\xa5.no\0k12.sc.us\0moe\0"
-"oregon.museum\0"
-"vercelli.it\0basketball\0"
-"aip.ee\0nedre-eiker.no\0moi\0"
-"togakushi.nagano.jp\0final\0barsy.support\0no-ip.biz\0"
-"consulting\0mom\0tires\0lcube-server.de\0"
-"voting\0"
-"is-a-landscaper.com\0"
-"conf.au\0suisse.museum\0"
-"kamikawa.hyogo.jp\0mov\0"
-"frogn.no\0"
-"media.pl\0"
-"bsb.br\0swiftcover\0"
-"koori.fukushima.jp\0porn\0noho.st\0"
-"b\xc3\xa5""d\xc3\xa5""ddj\xc3\xa5.no\0"
-"honbetsu.hokkaido.jp\0"
-"pacific.museum\0"
-"fm.br\0makinohara.shizuoka.jp\0"
-"nab\0myfritz.net\0"
-"co.krd\0"
-"asda\0"
-"pr.it\0kakamigahara.gifu.jp\0\xd8\xb9\xd9\x85\xd8\xa7\xd9\x86\0deal\0"
-"aogashima.tokyo.jp\0"
-"arte\0"
-"reggioemilia.it\0ehime.jp\0teshikaga.hokkaido.jp\0"
-"santamaria.br\0"
-"cyber.museum\0"
-"nakagawa.hokkaido.jp\0yamato.kanagawa.jp\0ogimi.okinawa.jp\0"
-"nba\0"
-"post\0"
-"cahcesuolo.no\0"
-"android\0"
-"\xd9\x83\xd8\xa7\xd8\xab\xd9\x88\xd9\x84\xd9\x8a\xd9\x83\0"
-"s3-eu-central-1.amazonaws.com\0"
-"kawai.nara.jp\0\xe8\xb0\xb7\xe6\xad\x8c\0"
-"withgoogle.com\0"
-"nh-serv.co.uk\0"
-"iizuka.fukuoka.jp\0meiwa.mie.jp\0lezajsk.pl\0"
-"minamiboso.chiba.jp\0hashima.gifu.jp\0imamat\0"
-"manaus.br\0urbino-pesaro.it\0kariya.aichi.jp\0sarl\0"
-"vpnplus.to\0"
-"msd\0"
-"bbva\0"
-"meldal.no\0"
-"*.triton.zone\0"
-"crotone.it\0toho.fukuoka.jp\0"
-"portal.museum\0tr\xc3\xa6na.no\0\xd9\x82\xd8\xb7\xd8\xb1\0"
-"allfinanz\0"
-"heroy.more-og-romsdal.no\0"
-"*.ye\0"
-"nrw.museum\0"
-"does-it.net\0"
-"ginoza.okinawa.jp\0"
-"yahaba.iwate.jp\0"
-"cc.pr.us\0azerbaijan.su\0"
-"mtn\0"
-"cloudns.info\0"
-"abarth\0"
-"\xe1\x83\x92\xe1\x83\x94\0mtr\0"
-"nec\0"
-"yokote.akita.jp\0sodegaura.chiba.jp\0"
-"l\xc3\xa1hppi.no\0"
-"kitagawa.kochi.jp\0"
-"workinggroup.aero\0"
-"padova.it\0onga.fukuoka.jp\0"
-"stjordal.no\0us-east-1.elasticbeanstalk.com\0s3-sa-east-1.amazonaws.com\0"
-"\xe5\xbe\xb3\xe5\xb3\xb6.jp\0komatsu.ishikawa.jp\0"
-"gs.fm.no\0"
-"saobernardo.br\0"
-"globo\0"
-"okinawa.okinawa.jp\0net\0"
-"asia\0"
-"melhus.no\0new\0"
-"vao.it\0"
-"save\0"
-"defense.tn\0"
-"lefrak\0"
-"kawanishi.yamagata.jp\0nfl\0"
-"katsushika.tokyo.jp\0lawyer\0"
-"\xe7\xb5\x84\xe7\xb9\x94.hk\0pramerica\0"
-"df.leg.br\0"
-"airtel\0"
-"rakkestad.no\0"
-"tsuga.tochigi.jp\0"
-"sld.pa\0"
-"med.pro\0"
-"gs.sf.no\0"
-"ecologia.bo\0"
-"ngo\0"
-"everbank\0"
-"fm.it\0nishiazai.shiga.jp\0"
-"v\xc3\xa5gan.no\0is-into-cartoons.com\0"
-"def.br\0\xd8\xb3\xd9\x88\xd8\xaf\xd8\xa7\xd9\x86\0"
-"public.museum\0software\0"
-"seaport.museum\0"
-"hino.tokyo.jp\0"
-"austin.museum\0nhk\0"
-"writesthisblog.com\0"
-"mlbfan.org\0"
-"\xe7\xb6\xb2\xe7\xb5\xa1.cn\0abr.it\0varese.it\0hirokawa.fukuoka.jp\0"
-"kvanangen.no\0"
-"maceio.br\0"
-"saxo\0"
-"furniture.museum\0"
-"tirol\0"
-"saka.hiroshima.jp\0*.magentosite.cloud\0"
-"brunel.museum\0tingvoll.no\0eaton.mi.us\0daplie.me\0"
-"s\xc3\xbc""dtirol.it\0"
-"stadt.museum\0"
-"yamada.iwate.jp\0"
-"lib.tx.us\0"
-"ravenna.it\0cistron.nl\0"
-"bestbuy\0"
-"kamisato.saitama.jp\0"
-"\xc3\xa5seral.no\0drive\0drayddns.com\0"
-"corporation.museum\0"
-"adv.br\0"
-"jorpeland.no\0info.zm\0"
-"abeno.osaka.jp\0showa.yamanashi.jp\0"
-"k12.ar.us\0"
-"idv.hk\0medizinhistorisches.museum\0"
-"locker\0"
-"sampa.br\0tsumagoi.gunma.jp\0wiw.gov.pl\0"
-"allstate\0"
-"miyota.nagano.jp\0"
-"\xe9\x9d\x99\xe5\xb2\xa1.jp\0"
-"mihama.fukui.jp\0nishiokoppe.hokkaido.jp\0"
-"tsuiki.fukuoka.jp\0"
-"even\xc3\xa1\xc5\xa1\xc5\xa1i.no\0"
-"higashisumiyoshi.osaka.jp\0"
-"acct.pro\0movie\0"
-"nichinan.miyazaki.jp\0dell\0"
-"pizza\0"
-"trentinsud-tirol.it\0\xe0\xae\x87\xe0\xae\xb2\xe0\xae\x99\xe0\xaf\x8d\xe0\xae\x95\xe0\xaf\x88\0"
-"r\xc3\xb8""d\xc3\xb8y.no\0vikna.no\0s3-website-ap-southeast-1.amazonaws.com\0"
-"tone.ibaraki.jp\0cloudaccess.host\0"
-"touch.museum\0nesodden.no\0"
-"fm.no\0"
-"\xe3\x82\xb3\xe3\x83\xa0\0"
-"khmelnytskyi.ua\0"
-"jgora.pl\0"
-"is-with-theband.com\0"
-"gok.pk\0pr.us\0"
-"kotoura.tottori.jp\0"
-"minamiashigara.kanagawa.jp\0"
-"kyoto.jp\0"
-"satx.museum\0brumunddal.no\0"
-"curitiba.br\0"
-"bc.ca\0\xe7\xb6\xb2\xe7\xb5\xa1.hk\0uscountryestate.museum\0hockey\0"
-"kawakami.nara.jp\0"
-"ringsaker.no\0"
-"suwa.nagano.jp\0"
-"t\xc3\xb8nsberg.no\0"
-"sf.no\0mk.ua\0"
-"komagane.nagano.jp\0murakami.niigata.jp\0"
-"fjell.no\0events\0"
-"pioneer\0"
-"dyndns-mail.com\0"
-"hizen.saga.jp\0"
-"r.se\0"
-"health.museum\0no-ip.info\0"
-"elblag.pl\0eurovision\0international\0"
-"nl.ca\0user.party.eus\0is-a-bookkeeper.com\0"
-"\xe9\xb3\xa5\xe5\x8f\x96.jp\0ogasawara.tokyo.jp\0\xe8\xaf\xba\xe5\x9f\xba\xe4\xba\x9a\0"
-"\xd8\xa7\xd8\xa8\xd9\x88\xd8\xb8\xd8\xa8\xd9\x8a\0"
-"capebreton.museum\0s\xc3\xb8ndre-land.no\0"
-"niigata.jp\0!city.kawasaki.jp\0\xd8\xa7\xd9\x84\xd8\xa7\xd8\xb1\xd8\xaf\xd9\x86\0"
-"now\0"
-"london\0"
-"ishikawa.jp\0samukawa.kanagawa.jp\0"
-"kunstsammlung.museum\0"
-"yamato.kumamoto.jp\0"
-"australia.museum\0"
-"rome.it\0tsuru.yamanashi.jp\0"
-"wake.okayama.jp\0wloclawek.pl\0"
-"chigasaki.kanagawa.jp\0"
-"ngrok.io\0noip.us\0"
-"etc.br\0seki.gifu.jp\0"
-"lincoln.museum\0il.eu.org\0"
-"\xe5\xba\x83\xe5\xb3\xb6.jp\0"
-"eastcoast.museum\0sor-fron.no\0ipiranga\0"
-"nra\0twmail.cc\0"
-"\xc3\xa5krehamn.no\0lib.vt.us\0"
-"anan.tokushima.jp\0yamanobe.yamagata.jp\0"
-"ichiba.tokushima.jp\0"
-"f\xc3\xb8rde.no\0"
-"obi\0"
-"garden\0"
-"inami.wakayama.jp\0"
-"photos\0"
-"crafting.xyz\0"
-"parti.se\0"
-"svizzera.museum\0firewall-gateway.de\0"
-"pharmaciens.km\0chernihiv.ua\0desi\0"
-"nrw\0"
-"shiki.saitama.jp\0"
-"caa.aero\0sor-odal.no\0cc.ia.us\0"
-"norddal.no\0hu.eu.org\0ie.eu.org\0"
-"sakai.fukui.jp\0"
-"balsfjord.no\0bloxcms.com\0"
-"\xe7\x8f\xa0\xe5\xae\x9d\0shiftedit.io\0"
-"kitanakagusuku.okinawa.jp\0"
-"rc.it\0"
-"gs.nl.no\0rv.ua\0"
-"kanie.aichi.jp\0"
-"dnipropetrovsk.ua\0tube\0"
-"fuso.aichi.jp\0"
-"loppa.no\0tiffany\0"
-"reklam.hu\0"
-"numata.gunma.jp\0ntt\0"
-"sa.edu.au\0"
-"verbania.it\0"
-"shimabara.nagasaki.jp\0dnsalias.net\0"
-"nesseby.no\0plumbing\0"
-"servehttp.com\0"
-"onjuku.chiba.jp\0adv.mz\0"
-"kids.museum\0motorcycle.museum\0"
-"kamioka.akita.jp\0ine.kyoto.jp\0"
-"nationalheritage.museum\0gratis\0"
-"off\0"
-"gausdal.no\0condos\0"
-"daisen.akita.jp\0"
-"openair.museum\0gaular.no\0\xc3\xb8ystre-slidre.no\0"
-"lib.or.us\0"
-"uw.gov.pl\0"
-"ismaili\0"
-"furukawa.miyagi.jp\0kitakata.miyazaki.jp\0"
+"trentin-sud-tirol.it\0kawakami.nara.jp\0"
+"med.ly\0"
+"wedeploy.sh\0"
+"kijo.miyazaki.jp\0"
+"fl\xc3\xa5.no\0"
+"tono.iwate.jp\0"
+"masfjorden.no\0"
+"yoichi.hokkaido.jp\0"
+"gateway.museum\0bike\0"
+"h\xc3\xb8nefoss.no\0"
+"rexroth\0"
+"kure.hiroshima.jp\0"
+"kalmykia.ru\0"
+"tsuno.kochi.jp\0"
"nagawa.nagano.jp\0"
-"s\xc3\xb8mna.no\0lpusercontent.com\0"
-"pp.az\0yomitan.okinawa.jp\0"
-"idv.tw\0"
-"estate\0"
-"caravan\0"
-"yamagata.ibaraki.jp\0"
-"b\xc3\xa5tsfjord.no\0"
-"nara.jp\0"
-"gliding.aero\0cc.as.us\0"
-"yamazoe.nara.jp\0"
-"\xe7\x9f\xb3\xe5\xb7\x9d.jp\0democrat\0"
-"iwate.jp\0"
-"skien.no\0"
-"taxi.br\0takagi.nagano.jp\0"
-"embetsu.hokkaido.jp\0kuju.oita.jp\0"
-"servehumour.com\0"
-"dr\xc3\xb8""bak.no\0"
-"minamiminowa.nagano.jp\0yamatotakada.nara.jp\0toshima.tokyo.jp\0"
-"fineart.museum\0storfjord.no\0nyc\0"
-"vall\xc3\xa9""eaoste.it\0"
-"statebank\0"
-"is-a-nascarfan.com\0""3utilities.com\0"
-"nachikatsuura.wakayama.jp\0"
-"fin.ec\0"
-"dali.museum\0songdalen.no\0"
-"obama.fukui.jp\0"
-"imabari.ehime.jp\0"
-"trysil.no\0s3.dualstack.us-east-1.amazonaws.com\0"
-"\xe0\xb2\xad\xe0\xb2\xbe\xe0\xb2\xb0\xe0\xb2\xa4\0"
-"ashoro.hokkaido.jp\0"
-"hembygdsforbund.museum\0"
-"\xe6\x89\x8b\xe8\xa1\xa8\0"
-"conf.lv\0"
-"nl.no\0feedback\0shouji\0"
-"iglesias-carbonia.it\0hashikami.aomori.jp\0"
-"sakura.tochigi.jp\0"
-"p.bg\0emerck\0"
-"sakaiminato.tottori.jp\0"
-"cleaning\0"
-"shijonawate.osaka.jp\0hino.tottori.jp\0nanyo.yamagata.jp\0"
-"\xe6\x95\x99\xe8\x82\xb2.hk\0indiana.museum\0"
+"engineer.aero\0notaires.fr\0"
+"flora.no\0"
+"moriyama.shiga.jp\0"
"izu.shizuoka.jp\0"
-"is-a-techie.com\0"
-"adult\0"
-"equipment\0"
-"discovery.museum\0pharmacy\0"
-"ia.us\0"
-"nishihara.okinawa.jp\0izumiotsu.osaka.jp\0"
-"nasu.tochigi.jp\0"
-"lib.vi.us\0servegame.org\0noip.me\0pantheonsite.io\0"
-"sakegawa.yamagata.jp\0"
-"ass.km\0skaun.no\0"
-"armenia.su\0"
-"half.host\0"
-"tsubata.ishikawa.jp\0"
-"servequake.com\0"
-"9.bg\0v\xc3\xa6r\xc3\xb8y.no\0gr.eu.org\0"
-"yachiyo.ibaraki.jp\0fujisawa.kanagawa.jp\0urawa.saitama.jp\0"
-"maryland.museum\0"
-"taki.mie.jp\0"
-"\xe6\x96\xb0\xe9\x97\xbb\0"
-"ilawa.pl\0"
-"fundacio.museum\0one\0travelersinsurance\0"
-"wada.nagano.jp\0\xd8\xa7\xd9\x84\xd8\xb9\xd9\x84\xd9\x8a\xd8\xa7\xd9\x86\0"
-"ong\0*.elb.amazonaws.com\0from-ks.com\0"
-"nord-aurdal.no\0\xd8\xaa\xd9\x88\xd9\x86\xd8\xb3\0"
-"ninohe.iwate.jp\0"
-"otsuki.yamanashi.jp\0onl\0"
-"meguro.tokyo.jp\0"
-"trust.museum\0zhytomyr.ua\0"
-"tarui.gifu.jp\0"
-"ballooning.aero\0"
-"miyazaki.jp\0vpndns.net\0"
-"railroad.museum\0"
-"blog.bo\0capitalone\0"
-"aki.kochi.jp\0"
-"chintai\0rackmaze.com\0"
-"blog.br\0"
-"ooo\0"
-"bialystok.pl\0"
-"manno.kagawa.jp\0shichikashuku.miyagi.jp\0"
-"med.br\0scor\0"
-"scot\0"
-"fvg.it\0toyako.hokkaido.jp\0discover\0"
-"miho.ibaraki.jp\0"
-"oppegard.no\0"
-"as.us\0"
-"sd.cn\0malbork.pl\0"
-"virginia.museum\0"
-"higashitsuno.kochi.jp\0"
-"mi.it\0"
-"oksnes.no\0shangrila\0"
-"gyeongnam.kr\0limited\0rj.leg.br\0"
-"k12.ks.us\0"
-"brescia.it\0"
-"jeju.kr\0management\0podzone.net\0"
-"vads\xc3\xb8.no\0audi\0"
-"outsystemscloud.com\0"
-"funahashi.toyama.jp\0"
-"autos\0wellbeingzone.co.uk\0"
-"forlicesena.it\0olawa.pl\0ostrowwlkp.pl\0"
-"vanylven.no\0from-ms.com\0from-nc.com\0"
-"asuke.aichi.jp\0flynnhosting.net\0"
-"r\xc3\xa6lingen.no\0"
-"med.ec\0org\0delivery\0n4t.co\0"
-"vic.edu.au\0med.ee\0pay\0golffan.us\0"
-"kinko.kagoshima.jp\0"
-"marche.it\0"
-"*.compute-1.amazonaws.com\0"
-"porsgrunn.no\0"
-"tochio.niigata.jp\0"
-"unicom\0"
-"konsulat.gov.pl\0"
-"lakas.hu\0dyndns-ip.com\0"
-"heritage.museum\0starnberg.museum\0dscloud.me\0"
-"yamatsuri.fukushima.jp\0beer\0barsy.shop\0"
-"\xe5\xb1\xb1\xe6\xa2\xa8.jp\0komaki.aichi.jp\0myoko.niigata.jp\0"
-"veneto.it\0tobetsu.hokkaido.jp\0semine.miyagi.jp\0"
-"movimiento.bo\0"
-"hammerfest.no\0"
-"zakopane.pl\0"
-"quebec\0fuettertdasnetz.de\0"
-"nishiwaki.hyogo.jp\0"
-"brandywinevalley.museum\0s3.dualstack.eu-west-2.amazonaws.com\0"
-"fiat\0"
-"granvin.no\0cc.mi.us\0"
-"grp.lk\0pvt.k12.ma.us\0"
-"name.hr\0sugito.saitama.jp\0"
-"mishima.fukushima.jp\0joetsu.niigata.jp\0"
-"suzuka.mie.jp\0"
-"\xe6\x85\x88\xe5\x96\x84\0"
-"is-an-engineer.com\0"
-"minami.tokushima.jp\0ott\0"
-"nationwide\0from-sc.com\0"
-"potenza.it\0career\0"
-"\xe6\x94\xbf\xe5\xba\x9c.hk\0panasonic\0"
-"\xd1\x81\xd0\xb0\xd0\xb9\xd1\x82\0"
-"goshiki.hyogo.jp\0"
-"delmenhorst.museum\0zoology.museum\0lib.gu.us\0"
-"name.et\0\xe6\x89\x8b\xe6\x9c\xba\0"
-"\xd9\x83\xd9\x88\xd9\x85\0"
-"*.platform.sh\0"
-"yachts\0"
-"svelvik.no\0"
-"pet\0"
-"naturalsciences.museum\0jolster.no\0"
-"massacarrara.it\0"
-"med.ht\0ovh\0"
-"trentinsuedtirol.it\0wazuka.kyoto.jp\0"
-"county.museum\0oxford.museum\0"
-"inf.br\0"
-"ushiku.ibaraki.jp\0accountant\0"
-"fido\0"
-"kuroishi.aomori.jp\0"
-"metlife\0"
-"rsvp\0"
-"narvik.no\0mytuleap.com\0freebox-os.com\0"
-"barefoot\0"
-"bronnoy.no\0smile\0"
-"trentino-stirol.it\0"
-"inf.cu\0"
-"bt.it\0tamaki.mie.jp\0"
-"pp.se\0pp.ru\0"
-"takarazuka.hyogo.jp\0"
-"name.cy\0"
-"misasa.tottori.jp\0phd\0"
-"correios-e-telecomunica\xc3\xa7\xc3\xb5""es.museum\0"
-"kazuno.akita.jp\0"
-"pavia.it\0"
-"name.eg\0"
-"kawaminami.miyazaki.jp\0"
-"photography.museum\0"
-"pid\0"
-"california.museum\0"
-"kudamatsu.yamaguchi.jp\0"
-"sakurai.nara.jp\0"
-"fin.tn\0"
-"travel\0"
-"k12.mo.us\0pp.ua\0"
-"pin\0"
-"szczecin.pl\0zagan.pl\0"
-"\xe6\x8b\x9b\xe8\x81\x98\0"
-"is-lost.org\0"
-"name.az\0"
-"yazu.tottori.jp\0"
-"cc.sd.us\0"
-"catania.it\0"
-"aknoluokta.no\0"
-"med.ly\0fredrikstad.no\0"
-"um.gov.pl\0"
-"montreal.museum\0"
-"sosa.chiba.jp\0matsumoto.nagano.jp\0loan\0instantcloud.cn\0"
-"hokuto.hokkaido.jp\0odawara.kanagawa.jp\0"
-"is-a-hard-worker.com\0"
-"\xe5\xb2\xa1\xe5\xb1\xb1.jp\0"
-"chikuhoku.nagano.jp\0mi.th\0"
-"cartoonart.museum\0"
-"nieruchomosci.pl\0"
-"hammarfeasta.no\0"
-"seiro.niigata.jp\0"
-"ohi.fukui.jp\0"
-"lib.nh.us\0"
-"expert\0"
-"ddnsfree.com\0yombo.me\0"
-"trentin-suedtirol.it\0"
-"newjersey.museum\0\xe4\xb8\xad\xe5\x9b\xbd\0"
-"nerima.tokyo.jp\0"
-"p.se\0"
-"vda.it\0aoste.it\0ic.gov.pl\0"
-"koeln.museum\0r\xc3\xa5""de.no\0"
-"muko.kyoto.jp\0govt.nz\0"
-"tcm.museum\0austrheim.no\0"
-"vaporcloud.io\0"
-"toon.ehime.jp\0moriguchi.osaka.jp\0"
-"rightathome\0"
-"torahime.shiga.jp\0gmail\0ba.leg.br\0"
-"med.om\0institute\0systems\0"
-"moroyama.saitama.jp\0prod\0"
-"mi.us\0\xe4\xb8\xad\xe5\x9c\x8b\0"
-"hinode.tokyo.jp\0prof\0"
+"kouzushima.tokyo.jp\0"
+"cc.wv.us\0azure\0is-a-nurse.com\0pr.leg.br\0"
+"gamagori.aichi.jp\0"
+"fuji.shizuoka.jp\0"
+"grozny.ru\0"
+"engerdal.no\0"
+"yame.fukuoka.jp\0med.om\0liaison\0"
+"tashkent.su\0"
+"cc.pr.us\0\xe6\x94\xbf\xe5\xba\x9c\0"
"med.pa\0"
-"yasuda.kochi.jp\0hakuba.nagano.jp\0"
-"from-dc.com\0"
-"vestre-toten.no\0"
-"shinonsen.hyogo.jp\0"
-"k12.wa.us\0"
-"med.pl\0"
-"barsy.net\0"
-"usdecorativearts.museum\0osteroy.no\0pnc\0dray-dns.de\0"
-"tsushima.aichi.jp\0yukuhashi.fukuoka.jp\0kiso.nagano.jp\0fukaya.saitama.jp\0"
-"club.tw\0k12.ga.us\0"
-"taranto.it\0"
-"calabria.it\0uchinomi.kagawa.jp\0red.sv\0"
-"kr\xc3\xa5""anghke.no\0"
-"miki.hyogo.jp\0"
-"oguchi.aichi.jp\0"
-"film\0"
-"narita.chiba.jp\0us.gov.pl\0"
-"wolterskluwer\0"
-"mil.ac\0"
-"mil.ae\0association.aero\0"
-"pruszkow.pl\0"
-"\xd0\xb4\xd0\xb5\xd1\x82\xd0\xb8\0"
-"\xe7\xb6\xb2\xe8\xb7\xaf.tw\0"
-"mil.al\0higashiizumo.shimane.jp\0run.app\0"
-"trondheim.no\0"
-"scjohnson\0solar\0"
-"cam.it\0"
-"mil.ba\0kviteseid.no\0"
-"mil.ar\0js.cn\0"
-"americanart.museum\0"
+"s\xc3\xb8rreisa.no\0bashkiria.ru\0"
+"shimokawa.hokkaido.jp\0"
+"archaeology.museum\0parts\0"
+"sveio.no\0cityeats\0"
+"cc.in.us\0"
+"florida.museum\0med.pl\0"
+"canada.museum\0"
+"party\0homedns.org\0dyn-vpn.de\0"
+"pp.se\0pp.ru\0"
+"shimonita.gunma.jp\0kawachinagano.osaka.jp\0"
+"y.se\0"
+"tsugaru.aomori.jp\0nesodden.no\0is-an-engineer.com\0"
+"rj.gov.br\0"
+"usgarden.museum\0cc.az.us\0click\0"
+"bashkiria.su\0"
+"agematsu.nagano.jp\0"
+"pa.it\0obama.fukui.jp\0"
+"umb.it\0railroad.museum\0"
+"nikolaev.ua\0bing\0"
+"yokoze.saitama.jp\0"
+"repl.run\0"
+"firewall-gateway.com\0"
+"lg.jp\0holmestrand.no\0bar.pro\0broke-it.net\0"
+"kasamatsu.gifu.jp\0channel\0"
+"taobao\0"
+"sch.zm\0pp.ua\0"
+"meme\0"
+"b\xc3\xb8.nordland.no\0"
+"sumoto.hyogo.jp\0lv.ua\0"
"med.sa\0"
-"loft\0"
-"med.sd\0"
-"k12.ct.us\0"
-"mil.az\0"
-"sund.no\0"
-"emiliaromagna.it\0yashiro.hyogo.jp\0kaizuka.osaka.jp\0skoczow.pl\0"
-"alta.no\0"
-"\xe5\xa5\x88\xe8\x89\xaf.jp\0"
-"mil.bo\0"
-"foz.br\0tomi.nagano.jp\0"
-"guide\0"
-"mil.br\0arezzo.it\0"
-"minowa.nagano.jp\0"
-"inf.mk\0"
-"rr.leg.br\0"
-"mosvik.no\0termez.su\0"
-"best\0"
-"mil.by\0"
-"\xd9\x85\xd8\xb5\xd8\xb1\0"
-"mil.cl\0\xd0\xbc\xd0\xbe\xd1\x81\xd0\xba\xd0\xb2\xd0\xb0\0"
-"collection.museum\0fitjar.no\0"
-"mil.cn\0"
-"mil.co\0"
-"ra.it\0"
-"scapp.io\0"
-"auto\0lima.zone\0"
-"asso.fr\0"
-"catering\0"
-"mitsue.nara.jp\0kushimoto.wakayama.jp\0"
-"seat\0"
-"barclays\0"
-"aq.it\0ba.it\0"
-"egersund.no\0tokke.no\0"
-"\xe0\xb9\x80\xe0\xb8\x99\xe0\xb9\x87\xe0\xb8\x95.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
-"k12.ak.us\0"
-"mil.do\0pro\0cc.tx.us\0"
-"bss.design\0"
-"christiansburg.museum\0"
-"asso.gp\0"
-"mil.ec\0"
-"sd.us\0pru\0s3-ap-south-1.amazonaws.com\0"
-"rs.leg.br\0sc.leg.br\0"
-"mil.eg\0"
-"ena.gifu.jp\0"
-"passenger-association.aero\0racing\0"
-"shirako.chiba.jp\0"
-"miyoshi.tokushima.jp\0"
-"dance\0"
-"sakyo.kyoto.jp\0nome.pt\0"
-"\xd8\xa8\xd8\xa7\xd8\xb1\xd8\xaa\0"
-"fire\0"
-"asso.ht\0yoshida.saitama.jp\0hotmail\0servebbs.net\0"
-"wa.gov.au\0"
-"nuremberg.museum\0fam.pk\0"
-"ingatlan.hu\0"
-"aibetsu.hokkaido.jp\0"
-"kumano.mie.jp\0am.leg.br\0"
-"pub\0"
-"cooperativa.bo\0"
-"verona.it\0"
-"mil.ge\0association.museum\0"
-"niikappu.hokkaido.jp\0kawahara.tottori.jp\0"
-"bmoattachments.org\0"
-"mil.gh\0fish\0"
-"s3-eu-west-2.amazonaws.com\0"
-"asso.bj\0nagano.jp\0shinyoshitomi.fukuoka.jp\0starhub\0"
-"kagoshima.jp\0"
-"seek\0"
-"mil.gt\0"
-"vaapste.no\0"
-"yakage.okayama.jp\0name.vn\0"
-"eastafrica.museum\0averoy.no\0"
-"asso.ci\0kv.ua\0"
-"es.gov.br\0mil.hn\0"
-"freeboxos.com\0"
-"venice.it\0"
-"pwc\0"
-"mil.id\0"
-"uda.nara.jp\0"
-"cc.nj.us\0"
-"kouzushima.tokyo.jp\0"
-"web.bo\0meland.no\0"
+"langevag.no\0med.sd\0"
+"careers\0"
+"onojo.fukuoka.jp\0"
+"crown\0moscow\0"
+"alaska.museum\0"
+"anani.br\0susono.shizuoka.jp\0mysecuritycamera.net\0"
"radom.pl\0"
-"planetarium.museum\0fed.us\0"
-"mil.in\0"
-"steigen.no\0"
-"mil.iq\0"
-"yokaichiba.chiba.jp\0name.tj\0"
-"web.co\0yolasite.com\0"
-"inf.ua\0"
-"asso.dz\0name.tr\0"
-"name.tt\0faith\0"
-"mil.jo\0nativeamerican.museum\0"
-"wroc.pl\0"
-"gildeskal.no\0"
-"shichinohe.aomori.jp\0kanoya.kagoshima.jp\0privatizehealthinsurance.net\0"
-"n.bg\0"
-"kanegasaki.iwate.jp\0ogawara.miyagi.jp\0\xe0\xae\x87\xe0\xae\xa8\xe0\xaf\x8d\xe0\xae\xa4\xe0\xae\xbf\xe0\xae\xaf\xe0\xae\xbe\0"
-"website\0dedyn.io\0ddnss.de\0"
-"ruhr\0rn.leg.br\0"
-"mil.kg\0"
-"web.do\0hellas.museum\0fr\xc3\xb8ya.no\0"
-"nakamichi.yamanashi.jp\0"
-"dnsalias.org\0"
-"kartuzy.pl\0"
-"mil.km\0"
-"kmpsp.gov.pl\0"
-"pixolino.com\0telebit.io\0"
-"barsy.site\0"
-"matsuura.nagasaki.jp\0mil.kr\0"
-"te.it\0"
-"mil.kz\0"
-"oirm.gov.pl\0"
-"deporte.bo\0temasek\0barsy.pro\0"
-"target\0wien\0"
-"ap.leg.br\0"
-"yamagata.yamagata.jp\0"
-"moss.no\0"
-"ama.shimane.jp\0mil.lv\0ro.leg.br\0"
-"7.bg\0mil.mg\0jondal.no\0s3.dualstack.sa-east-1.amazonaws.com\0is-a-patsfan.org\0"
-"turin.it\0dazaifu.fukuoka.jp\0miyada.nagano.jp\0"
-"ternopil.ua\0"
-"miyoshi.hiroshima.jp\0"
-"tx.us\0marshalls\0"
-"higashikawa.hokkaido.jp\0"
-"eisenbahn.museum\0"
-"horse\0"
-"cloudfront.net\0"
-"culturalcenter.museum\0"
-"kawachinagano.osaka.jp\0"
-"mil.mv\0gda.pl\0"
-"mil.ng\0forde.no\0"
-"mil.my\0mil.ni\0lillehammer.no\0"
-"pn.it\0yamakita.kanagawa.jp\0nozawaonsen.nagano.jp\0mil.mz\0"
-"name.qa\0"
-"ntr.br\0tomigusuku.okinawa.jp\0name.pr\0"
-"web.gu\0mil.no\0"
-"barsy.pub\0"
-"undersea.museum\0"
-"fujisawa.iwate.jp\0"
-"\xd0\xb0\xd0\xba.\xd1\x81\xd1\x80\xd0\xb1\0"
-"fi.cr\0susono.shizuoka.jp\0"
-"murata.miyagi.jp\0cloud.metacentrum.cz\0"
-"voyage\0"
-"bulsan-s\xc3\xbc""dtirol.it\0mil.nz\0"
-"name.na\0nes.buskerud.no\0"
-"shinjo.okayama.jp\0"
-"whaling.museum\0podzone.org\0fr.eu.org\0"
-"web.id\0aichi.jp\0health.nz\0"
-"sunndal.no\0lancia\0s3-website-us-west-1.amazonaws.com\0"
-"name.mv\0"
-"name.ng\0"
-"name.my\0vestby.no\0cc.de.us\0"
-"azumino.nagano.jp\0nagasaki.nagasaki.jp\0"
-"mil.pe\0"
-"ostroleka.pl\0"
-"*.landing.myjino.ru\0"
-"munakata.fukuoka.jp\0mil.ph\0"
-"revista.bo\0mining.museum\0"
-"mil.pl\0"
-"latrobe\0"
-"katsuura.chiba.jp\0"
-"engerdal.no\0lib.ny.us\0"
-"wakayama.wakayama.jp\0"
-"sandefjord.no\0mil.qa\0k12.ky.us\0"
-"\xe5\x80\x8b\xe4\xba\xba.hk\0from-mn.com\0"
-"entertainment.aero\0love\0"
-"balsan-s\xc3\xbc""dtirol.it\0ina.ibaraki.jp\0okinoshima.shimane.jp\0"
-"westfalen.museum\0stryn.no\0mil.py\0hosting\0"
-"shisui.chiba.jp\0sowa.ibaraki.jp\0"
-"tanagura.fukushima.jp\0nanbu.tottori.jp\0"
-"gov.nc.tr\0"
-"stockholm\0"
-"kitami.hokkaido.jp\0lubartow.pl\0"
-"r\xc3\xb8ros.no\0nj.us\0industries\0hobby-site.org\0"
-"ru.com\0"
-"ono.fukushima.jp\0"
-"wiki\0georgia.su\0"
-"bauern.museum\0taipei\0"
-"lupin\0"
-"gojome.akita.jp\0boehringer\0"
-"pointto.us\0"
-"\xd8\xa8\xd9\x8a\xd8\xaa\xd9\x83\0"
-"web.lk\0name.mk\0mil.ru\0k12.il.us\0spacekit.io\0"
-"mil.rw\0dyndns-blog.com\0"
-"mil.sh\0"
-"nordreisa.no\0"
-"hichiso.gifu.jp\0shinjuku.tokyo.jp\0"
-"bahn.museum\0ybo.science\0"
-"trentinoaltoadige.it\0"
-"minamiizu.shizuoka.jp\0"
-"properties\0us.eu.org\0"
-"mil.st\0"
-"elburg.museum\0"
-"at-band-camp.net\0"
-"name.jo\0mil.sy\0"
-"mil.tj\0"
-"vi.it\0"
-"mil.tm\0"
-"on-web.fr\0"
-"mil.to\0is-a-nurse.com\0"
-"yonaguni.okinawa.jp\0web.nf\0"
-"spjelkavik.no\0"
-"mil.tr\0"
-"web.ni\0"
-"mitoyo.kagawa.jp\0yandex\0"
-"j\xc3\xb8rpeland.no\0wine\0is-a-painter.com\0"
-"fi.it\0"
-"mil.tw\0"
-"futaba.fukushima.jp\0mil.tz\0"
-"saves-the-whales.com\0"
-"yufu.oita.jp\0"
-"mil.vc\0"
-"mil.ve\0"
-"ind.br\0"
-"barsyonline.co.uk\0"
-"mil.uy\0"
-"\xe5\x8d\x83\xe8\x91\x89.jp\0kitahiroshima.hokkaido.jp\0"
-"can.museum\0yorkshire.museum\0bjugn.no\0vm.bytemark.co.uk\0"
-"sande.more-og-romsdal.no\0"
-"akaiwa.okayama.jp\0"
-"sejny.pl\0health.vn\0contact\0"
-"te.ua\0"
-"tv.bb\0red\0"
-"web.pk\0\xd7\xa7\xd7\x95\xd7\x9d\0"
-"\xe0\xb8\xa8\xe0\xb8\xb6\xe0\xb8\x81\xe0\xb8\xa9\xe0\xb8\xb2.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
-"asso.re\0"
-"br.it\0cb.it\0shimoda.shizuoka.jp\0"
-"archi\0"
-"tanohata.iwate.jp\0"
-"kamishihoro.hokkaido.jp\0diet\0ren\0cnpy.gdn\0"
-"cc.vi.us\0"
-"omotego.fukushima.jp\0"
-"tv.bo\0sandcats.io\0"
-"blockbuster\0"
-"qvc\0from-tn.com\0"
-"fnd.br\0tv.br\0rackmaze.net\0"
-"mihara.hiroshima.jp\0azurewebsites.net\0"
-"stada\0hu.com\0"
-"mulhouse.museum\0school.museum\0"
-"shimada.shizuoka.jp\0"
-"pagespeedmobilizer.com\0"
-"bedzin.pl\0"
-"de.us\0"
-"manx.museum\0"
-"lease\0serveirc.com\0"
-"se.leg.br\0"
-"copenhagen.museum\0lanbib.se\0k12.ne.us\0"
-"studio\0"
-"friuliveneziagiulia.it\0ikeda.hokkaido.jp\0"
-"notaires.km\0leka.no\0"
-"\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xdb\x8c\xd8\xa9\0*.advisor.ws\0"
-"fukagawa.hokkaido.jp\0"
-"hanggliding.aero\0s3.dualstack.ap-south-1.amazonaws.com\0"
-"resistance.museum\0mil.za\0"
-"yamagata.jp\0kamikawa.saitama.jp\0wielun.pl\0"
-"beiarn.no\0is-into-cars.com\0"
-"film.hu\0eu.com\0"
-"for-the.biz\0"
-"mil.zm\0*.vps.myjino.ru\0"
-"morimachi.shizuoka.jp\0"
-"maserati\0"
-"nagareyama.chiba.jp\0web.tj\0"
-"asso.nc\0"
-"takehara.hiroshima.jp\0yamagata.nagano.jp\0"
-"oppdal.no\0\xd8\xb3\xd9\x88\xd8\xb1\xd9\x8a\xd8\xa7\0mil.zw\0"
-"ind.gt\0!city.yokohama.jp\0fujimino.saitama.jp\0"
-"lib.nj.us\0\xd8\xb3\xd9\x88\xd8\xb1\xd9\x8a\xd8\xa9\0xs4all.space\0"
-"gs.hm.no\0netbank\0wanggou\0de.com\0"
-"web.tr\0ril\0"
-"leasing.aero\0sexy\0"
-"hirono.iwate.jp\0debian.net\0"
-"jobs\0rio\0"
-"rip\0"
-"n.se\0"
-"ggf.br\0urayasu.chiba.jp\0"
-"barsy.org\0"
-"cc.ok.us\0is-leet.com\0dsmynas.org\0"
-"ochi.kochi.jp\0satte.saitama.jp\0"
-"m\xc3\xa5lselv.no\0is-a-teacher.com\0synology.me\0"
-"zarow.pl\0"
-"firewall-gateway.com\0"
-"okawa.kochi.jp\0"
-"web.ve\0latino\0"
-"kusatsu.gunma.jp\0saikai.nagasaki.jp\0"
-"ind.in\0"
-"corsica\0"
-"oster\xc3\xb8y.no\0"
-"pub.sa\0"
-"\xe9\x95\xb7\xe9\x87\x8e.jp\0niigata.niigata.jp\0nago.okinawa.jp\0"
-"est-a-la-maison.com\0"
-"namdalseid.no\0"
-"nishikata.tochigi.jp\0"
-"kumamoto.jp\0ustka.pl\0"
-"tuva.su\0"
-"accident-prevention.aero\0"
-"roma.it\0mombetsu.hokkaido.jp\0"
-"odda.no\0barsy.co.uk\0"
-"\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa5\x8b\xe0\xa4\xa4\0"
-"oita.jp\0moonscale.net\0"
-"gotdns.org\0"
-"higashimurayama.tokyo.jp\0"
-"tv.im\0publishproxy.com\0"
-"shimogo.fukushima.jp\0sanok.pl\0"
-"!www.ck\0sport.hu\0"
-"catholic\0"
-"tv.it\0"
-"eco.br\0"
-"ind.kw\0transport.museum\0homesense\0"
-"soni.nara.jp\0"
-"hinohara.tokyo.jp\0"
-"nombre.bo\0versailles.museum\0"
-"vi.us\0web.za\0"
-"now-dns.net\0"
-"is-very-bad.org\0"
-"otoineppu.hokkaido.jp\0freesite.host\0"
-"asso.km\0gallery.museum\0rahkkeravju.no\0"
-"posts-and-telecommunications.museum\0station.museum\0community\0"
-"minamiuonuma.niigata.jp\0"
-"hirosaki.aomori.jp\0"
-"dating\0"
-"horten.no\0endoftheinternet.org\0"
-"ethnology.museum\0giske.no\0charity\0"
-"sb.ua\0k12.pa.us\0"
-"cyou\0"
-"lubin.pl\0"
-"tachiarai.fukuoka.jp\0"
-"tj\xc3\xb8me.no\0"
-"ao.it\0"
-"asso.mc\0ontario.museum\0chernovtsy.ua\0lib.ca.us\0"
-"mus.br\0"
-"hm.no\0"
-"dellogliastra.it\0yoita.niigata.jp\0kainan.tokushima.jp\0"
-"myshopblocks.com\0"
-"from-in.com\0"
-"dscloud.biz\0"
-"mo-i-rana.no\0"
-"tv.na\0"
-"author.aero\0nesoddtangen.no\0"
-"showa.fukushima.jp\0"
-"folkebibl.no\0athleta\0"
-"nagatoro.saitama.jp\0"
-"bokn.no\0"
-"moka.tochigi.jp\0nogi.tochigi.jp\0"
-"mesaverde.museum\0technology.museum\0"
-"kamisu.ibaraki.jp\0"
-"sap\0"
-"k12.md.us\0"
-"hikari.yamaguchi.jp\0\xe0\xa4\xb8\xe0\xa4\x82\xe0\xa4\x97\xe0\xa4\xa0\xe0\xa4\xa8\0"
-"casadelamoneda.museum\0sas\0shopping\0"
-"jus.br\0"
-"groundhandling.aero\0"
-"wedding\0"
-"urbinopesaro.it\0podlasie.pl\0maif\0"
-"konyvelo.hu\0sbi\0adygeya.su\0"
-"morotsuka.miyazaki.jp\0"
-"naha.okinawa.jp\0"
-"aver\xc3\xb8y.no\0sca\0"
-"rokunohe.aomori.jp\0dish\0scb\0"
-"ok.us\0sbs\0"
-"\xc3\xa5mot.no\0flora.no\0"
-"sondrio.it\0takahata.yamagata.jp\0"
-"royken.no\0"
-"salangen.no\0"
-"oirase.aomori.jp\0"
-"pescara.it\0kuchinotsu.nagasaki.jp\0"
-"shiraoi.hokkaido.jp\0vision\0"
-"tottori.jp\0onojo.fukuoka.jp\0"
-"maritimo.museum\0\xc3\xb8ksnes.no\0"
-"iida.nagano.jp\0"
-"yabuki.fukushima.jp\0"
-"gub.uy\0"
-"res.in\0"
-"h\xc3\xb8nefoss.no\0"
-"cc.nh.us\0"
-"susaki.kochi.jp\0"
-"haram.no\0"
-"\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xdb\x8c\xdb\x83\0"
-"adygeya.ru\0"
-"bhz.br\0iwanai.hokkaido.jp\0"
-"mx.na\0gs.jan-mayen.no\0"
-"run\0"
-"culture.museum\0"
-"ind.tn\0"
-"ses\0"
-"bandai.fukushima.jp\0etajima.hiroshima.jp\0"
-"campinagrande.br\0tv.sd\0"
-"lib.id.us\0sew\0"
-"sex\0"
-"fhsk.se\0"
-"tranoy.no\0"
-"kakuda.miyagi.jp\0"
-"l.bg\0"
-"walbrzych.pl\0"
-"\xe7\xb6\xb2\xe7\xbb\x9c.hk\0"
-"sfr\0"
-"rwe\0"
-"salzburg.museum\0"
-"press.aero\0railway.museum\0net-freaks.com\0"
-"yn.cn\0"
-"dynns.com\0"
-"ss.it\0hachirogata.akita.jp\0"
-"tv.tr\0redirectme.net\0"
-"shingu.wakayama.jp\0"
-"bungoono.oita.jp\0"
-"servebbs.org\0"
-"cs.it\0mediocampidano.it\0esashi.hokkaido.jp\0cloudapp.net\0"
-"s3.eu-west-2.amazonaws.com\0"
-"kahoku.yamagata.jp\0tv.tz\0"
-"fhapp.xyz\0"
-"kihoku.ehime.jp\0"
-"5.bg\0"
-"press.cy\0"
-"koga.ibaraki.jp\0hakusan.ishikawa.jp\0"
-"saskatchewan.museum\0"
-"trogstad.no\0"
-"hakone.kanagawa.jp\0"
-"xenapponazure.com\0"
-"bytom.pl\0"
-"analytics\0"
-"toyama.jp\0"
-"\xe4\xbf\xa1\xe6\x81\xaf\0"
-"kristiansund.no\0"
-"aquarelle\0mango\0is-a-photographer.com\0"
-"minamidaito.okinawa.jp\0"
-"\xe7\xa5\x9e\xe5\xa5\x88\xe5\xb7\x9d.jp\0chuo.yamanashi.jp\0"
-"leikanger.no\0"
-"lib.ar.us\0"
-"za.net\0"
-"ambulance.aero\0ski\0"
-"voagat.no\0"
-"namegawa.saitama.jp\0"
-"cc.dc.us\0"
-"*.quipelements.com\0"
-"flir\0"
-"nagasaki.jp\0"
-"wakkanai.hokkaido.jp\0"
-"lu.it\0me.it\0*.telebit.xyz\0"
-"lib.ok.us\0sky\0"
-"v\xc3\xa5ler.\xc3\xb8stfold.no\0"
-"himeji.hyogo.jp\0alwaysdata.net\0"
-"science.museum\0"
-"higashiura.aichi.jp\0"
-"hadano.kanagawa.jp\0"
-"me.ke\0"
-"dyndns.info\0dnsiskinky.com\0"
-"gunma.jp\0"
-"nh.us\0"
-"ikeda.fukui.jp\0"
-"googleapis.com\0"
-"farsund.no\0"
-"okoppe.hokkaido.jp\0publ.pt\0"
-"paderborn.museum\0dyndns-server.com\0"
-"*.sapporo.jp\0shibata.niigata.jp\0"
-"halloffame.museum\0"
-"farmers\0"
-"eidsberg.no\0doomdns.org\0"
-"asahi.mie.jp\0"
-"neat-url.com\0"
-"oceanographique.museum\0"
-"shinkamigoto.nagasaki.jp\0"
-"friuliv-giulia.it\0kanra.gunma.jp\0"
-"cc.me.us\0""2038.io\0"
-"lillesand.no\0es.eu.org\0"
-"url.tw\0"
-"evenassi.no\0"
-"utashinai.hokkaido.jp\0"
-"ravendb.me\0"
-"tromso.no\0lib.wy.us\0"
-"soy\0"
-"beauxarts.museum\0bounty-full.com\0"
-"uzs.gov.pl\0"
-"kvam.no\0giehtavuoatna.no\0"
-"fg.it\0familyds.net\0"
-"alaska.museum\0lib.hi.us\0s3.us-east-2.amazonaws.com\0"
-"tab\0"
-"naturhistorisches.museum\0hjartdal.no\0"
-"ora.gunma.jp\0"
-"oumu.hokkaido.jp\0"
-"paragliding.aero\0halden.no\0"
-"badajoz.museum\0"
-"cc.in.us\0"
-"modelling.aero\0mc.eu.org\0"
-"ishikawa.okinawa.jp\0"
-"www.ro\0"
-"niihama.ehime.jp\0"
-"kautokeino.no\0"
-"tax\0"
-"in.na\0"
-"shaw\0est-mon-blogueur.com\0from-ky.com\0"
-"daiwa.hiroshima.jp\0rzeszow.pl\0srl\0"
-"eidsvoll.no\0ryukyu\0"
-"taku.saga.jp\0"
-"family.museum\0bargains\0"
-"hk.cn\0notaires.fr\0bolzano-altoadige.it\0isesaki.gunma.jp\0"
-"in.ni\0"
-"kurume.fukuoka.jp\0"
-"chattanooga.museum\0lodingen.no\0"
-"przeworsk.pl\0srt\0"
-"ed.ao\0from-mi.com\0"
-"greta.fr\0amami.kagoshima.jp\0chuo.tokyo.jp\0yonago.tottori.jp\0"
-"rnu.tn\0cdn77-ssl.net\0"
-"tci\0"
-"kitaaiki.nagano.jp\0"
-"app.os.fedoraproject.org\0"
-"miyama.mie.jp\0"
-"theater.museum\0"
-"katashina.gunma.jp\0"
-"tsuno.miyazaki.jp\0fujiidera.osaka.jp\0"
-"stc\0lt.eu.org\0"
-"takasago.hyogo.jp\0"
-"ponpes.id\0ham-radio-op.net\0"
-"sells-for-u.com\0ownprovider.com\0"
-"dc.us\0duckdns.org\0"
-"mormon\0"
-"nikolaev.ua\0tdk\0"
-"usuki.oita.jp\0"
-"apartments\0"
-"ed.ci\0"
-"ce.leg.br\0"
-"oystre-slidre.no\0pl.ua\0k12.ms.us\0k12.nc.us\0softbank\0"
-"ikeda.gifu.jp\0"
-"flight.aero\0k12.ec\0\xc3\xb8rskog.no\0"
-"ed.cr\0fujimi.nagano.jp\0"
-"nagoya\0"
-"kui.hiroshima.jp\0"
-"pvt.ge\0"
-"g12.br\0tel\0"
-"khmelnitskiy.ua\0"
-"kamiizumi.saitama.jp\0"
-"s3-us-east-2.amazonaws.com\0"
-"futbol\0"
-"v\xc3\xa5gs\xc3\xb8y.no\0valer.ostfold.no\0"
-"osaka.jp\0hidaka.wakayama.jp\0mail.pl\0podhale.pl\0"
-"ddns.me\0"
-"goto.nagasaki.jp\0"
-"cincinnati.museum\0myddns.rocks\0"
-"minobu.yamanashi.jp\0"
-"am.br\0"
-"amsterdam.museum\0"
-"trentino-s-tirol.it\0"
-"4u.com\0"
-"kr.it\0"
-"graz.museum\0"
-"yoro.gifu.jp\0"
-"cruise\0teaches-yoga.com\0"
-"minakami.gunma.jp\0"
-"orkdal.no\0"
-"imperia.it\0"
-"*.awdev.ca\0"
-"in.rs\0l.se\0dubai\0"
-"aosta.it\0"
-"alstom\0is-a-cubicle-slave.com\0"
-"me.tz\0"
-"me.uk\0"
-"cc.ny.us\0"
-,
-
-"ichikawa.hyogo.jp\0"
-"\xe3\x83\x95\xe3\x82\xa1\xe3\x83\x83\xe3\x82\xb7\xe3\x83\xa7\xe3\x83\xb3\0"
-"thd\0"
-"nf.ca\0"
-"me.us\0"
-"pup.gov.pl\0"
-"klepp.no\0bike\0mydatto.com\0"
-"trentino-a-adige.it\0"
-"sandvik\0"
-"from-ri.com\0"
-"*.kawasaki.jp\0nakama.fukuoka.jp\0in.th\0"
-"i234.me\0"
-"toyotsu.fukuoka.jp\0"
-"broadcast.museum\0"
-"shia\0"
-"kouyama.kagoshima.jp\0"
-"coldwar.museum\0in.ua\0"
-"gov.ac\0v\xc3\xa5g\xc3\xa5.no\0"
-"aga.niigata.jp\0"
-"gov.ae\0kvinesdal.no\0"
-"gov.af\0k12.il\0"
-"jprs\0eu-west-3.elasticbeanstalk.com\0"
-"sells-it.net\0"
-"hitra.no\0s3-website-ap-southeast-2.amazonaws.com\0*.otap.co\0from-wy.com\0net.eu.org\0""4lima.de\0"
-"gov.al\0"
-"landes.museum\0"
-"chijiwa.nagasaki.jp\0"
-"gov.ba\0tt.im\0beeldengeluid.museum\0"
-"gov.ar\0gov.bb\0edogawa.tokyo.jp\0"
-"gov.as\0in.us\0"
-"s3.cn-north-1.amazonaws.com.cn\0"
-"gov.au\0"
-"gov.bf\0"
-"gov.bh\0ud.it\0"
-"gov.az\0kiyosu.aichi.jp\0"
-"gov.bm\0"
-"gov.bn\0miyashiro.saitama.jp\0"
-"jerusalem.museum\0sydney\0servehalflife.com\0"
-"tjx\0yamaxun\0"
-"gov.br\0emr.it\0"
-"gov.bs\0bing\0"
-"gov.bt\0gov.cd\0fukuchiyama.kyoto.jp\0"
-"cn.com\0fi.eu.org\0"
-"press.se\0house\0"
-"gov.by\0cpa.pro\0s3.ca-central-1.amazonaws.com\0from-wi.com\0"
-"gov.bz\0florence.it\0""4lima.at\0"
-"viking.museum\0"
-"gov.cl\0forl\xc3\xac-cesena.it\0kagami.kochi.jp\0"
-"gov.cm\0isleofman.museum\0rentals\0"
-"gov.cn\0ed.jp\0"
-"gov.co\0"
-"chtr.k12.ma.us\0"
-"\xe6\x96\xb0\xe5\x8a\xa0\xe5\x9d\xa1\0"
-"gov.cu\0"
-"gov.cx\0perso.ht\0"
-"gov.cy\0pilots.museum\0hughes\0"
-"dyndns-at-work.com\0"
-"gov.dm\0lib.sc.us\0flowers\0"
-"bielawa.pl\0""4lima.ch\0"
-"gov.do\0"
-"gov.ec\0"
-"gov.ee\0bern.museum\0sk\xc3\xa1nit.no\0"
-"kyonan.chiba.jp\0"
-"gov.eg\0"
-"h\xc3\xb8yanger.no\0"
-"gov.dz\0tamatsukuri.ibaraki.jp\0"
-"asnes.no\0molde.no\0"
-"dsmynas.net\0"
-"phone\0"
-"salvadordali.museum\0"
-"gov.et\0sakuragawa.ibaraki.jp\0fukudomi.saga.jp\0"
-"kr\xc3\xb8""dsherad.no\0"
-"pippu.hokkaido.jp\0"
-"mima.tokushima.jp\0ube.yamaguchi.jp\0"
-"firebaseapp.com\0barsy.menu\0"
-"basilicata.it\0"
-"government.aero\0"
-"gov.ge\0"
-"cq.cn\0naples.it\0toyo.kochi.jp\0"
-"oz.au\0"
-"gov.gh\0top\0"
-"express.aero\0gov.gi\0force.museum\0"
-"aostavalley.it\0gyeonggi.kr\0"
-"shop\0"
-"fujitsu\0recipes\0"
-"gov.gn\0kashiwazaki.niigata.jp\0"
-"buzen.fukuoka.jp\0"
-"gov.gr\0"
-"fresenius\0show\0"
-"gov.gu\0ny.us\0"
-"*.statics.cloud\0"
-"isteingeek.de\0"
-"caxias.br\0suzaka.nagano.jp\0"
-"gov.gy\0"
-"shirakawa.fukushima.jp\0"
-"gov.hk\0habmer.no\0"
-"otama.fukushima.jp\0koryo.nara.jp\0kumatori.osaka.jp\0"
-"\xe0\xb0\xad\xe0\xb0\xbe\xe0\xb0\xb0\xe0\xb0\xa4\xe0\xb1\x8d\0"
-"press.ma\0"
-"gov.ie\0lib.la.us\0"
-"kr.ua\0k12.ia.us\0"
-"eidskog.no\0"
-"\xe4\xbc\x81\xe4\xb8\x9a\0"
-"mk.eu.org\0"
-"gov.il\0kizu.kyoto.jp\0"
-"gov.in\0mito.ibaraki.jp\0kita.osaka.jp\0\xe6\x94\xbf\xe5\xba\x9c\0blogsite.xyz\0"
-"m\xc3\xa1latvuopmi.no\0beta.bounty-full.com\0"
-"kamagaya.chiba.jp\0aso.kumamoto.jp\0"
-"gov.iq\0"
-"the.br\0gov.ir\0kaneyama.fukushima.jp\0"
-"gov.is\0"
-"gov.it\0"
-"ed.pw\0"
-"kasuya.fukuoka.jp\0"
-"lugs.org.uk\0now-dns.org\0"
-"matsuyama.ehime.jp\0"
-"doshi.yamanashi.jp\0"
-"tran\xc3\xb8y.no\0ubs\0navoi.su\0"
-"trv\0"
-"gov.jo\0"
-"k12.ut.us\0"
-"feste-ip.net\0"
-"gov.kg\0"
-"vicenza.it\0uconnect\0"
-"gov.ki\0"
-"from-hi.com\0"
-"tas.edu.au\0gov.km\0aquarium.museum\0"
-"gov.kn\0"
-"j.bg\0"
-"hayashima.okayama.jp\0gov.kp\0"
-"gov.la\0"
-"gov.lb\0"
-"gov.lc\0g\xc3\xa1ls\xc3\xa1.no\0"
-"cloudns.pro\0"
-"gov.kw\0center.museum\0photo\0"
-"gov.ky\0stokke.no\0vladikavkaz.ru\0"
-"iwade.wakayama.jp\0gov.kz\0"
-"gov.lk\0"
-"ma.gov.br\0k12.tr\0"
-"volyn.ua\0rugby\0"
-"schwarz\0"
-"gov.ma\0tui\0"
-"ta.it\0yamagata.gifu.jp\0gov.lr\0"
-"gov.ls\0\xc3\xa5rdal.no\0"
-"gov.lt\0"
-"gov.me\0palace.museum\0"
-"gov.lv\0"
-"gov.mg\0orskog.no\0"
-"gov.ly\0for-our.info\0vladikavkaz.su\0"
-"gov.mk\0lu.eu.org\0me.eu.org\0servemp3.com\0"
-"hiranai.aomori.jp\0gov.ml\0"
-"plo.ps\0"
-"kisofukushima.nagano.jp\0gov.mn\0"
-"gov.mo\0us-gov-west-1.elasticbeanstalk.com\0"
-"uchihara.ibaraki.jp\0"
-"gov.mr\0"
-"3.bg\0gov.ms\0lund.no\0k12.vi\0"
-"friulivenezia-giulia.it\0"
-"gov.mu\0"
-"gov.mv\0"
-"chiropractic.museum\0gov.mw\0gov.ng\0j\xc3\xb8lster.no\0is-slick.com\0"
-"gsm.pl\0"
-"midatlantic.museum\0gov.my\0is-a-bulls-fan.com\0"
-"gov.mz\0durban\0"
-"tvs\0"
-"valled-aosta.it\0"
-"santabarbara.museum\0naustdal.no\0za.org\0"
-"mizuho.tokyo.jp\0"
-"nov.ru\0"
-"brand.se\0"
-"gov.nr\0"
-"columbia.museum\0"
-"kamoenai.hokkaido.jp\0"
-"konskowola.pl\0"
-"progressive\0"
-"hokksund.no\0lv.eu.org\0"
-"nakamura.kochi.jp\0"
-"soc.lk\0gov.om\0"
-"tondabayashi.osaka.jp\0"
-"nov.su\0*.spectrum.myjino.ru\0"
-"laz.it\0host\0"
-"b\xc3\xa1hccavuotna.no\0helsinki\0homelinux.com\0"
-"tmp.br\0siracusa.it\0vibovalentia.it\0"
-"skjervoy.no\0"
-"togura.nagano.jp\0"
-"gov.ph\0go.leg.br\0"
-"\xc3\xb8vre-eiker.no\0"
-"ullensaker.no\0gov.pk\0"
-"otake.hiroshima.jp\0gov.pl\0"
-"bolzano.it\0fukuroi.shizuoka.jp\0gov.pn\0"
-"exchange\0"
-"futtsu.chiba.jp\0"
-"gs.oslo.no\0gov.qa\0"
-"kimobetsu.hokkaido.jp\0gov.pr\0merckmsd\0"
-"gov.ps\0"
-"gov.pt\0"
-"sauda.no\0cherkasy.ua\0"
-"from-la.net\0"
-"bruxelles.museum\0gov.py\0"
-"mc.it\0iwate.iwate.jp\0ota.tokyo.jp\0"
-"og.ao\0bajddar.no\0e12.ve\0leadpages.co\0"
-"tagajo.miyagi.jp\0"
-"aoki.nagano.jp\0leczna.pl\0"
-"webhop.info\0"
-"latina.it\0virtueeldomein.nl\0"
-"tobishima.aichi.jp\0"
-"pasadena.museum\0"
-"contagem.br\0chosei.chiba.jp\0"
-"homesecuritymac.com\0diskstation.org\0"
-"naval.museum\0"
-"fujinomiya.shizuoka.jp\0tkmaxx\0"
-"holt\xc3\xa5len.no\0gov.sa\0"
-"gov.sb\0kicks-ass.net\0"
-"paris.museum\0gov.rs\0gov.sc\0"
-"trentino-suedtirol.it\0itano.tokushima.jp\0obanazawa.yamagata.jp\0gov.sd\0"
-"frankfurt.museum\0gov.ru\0"
-"\xd8\xa7\xd9\x84\xd9\x8a\xd9\x85\xd9\x86\0"
-"gov.rw\0gov.sg\0health-carereform.com\0"
-"gov.sh\0"
-"assisi.museum\0cadaques.museum\0herokuapp.com\0"
-"kamisunagawa.hokkaido.jp\0"
-"kota.aichi.jp\0gov.sl\0"
-"supplies\0"
-"noboribetsu.hokkaido.jp\0"
-"*.uberspace.de\0"
-"gov.st\0"
-"!city.sapporo.jp\0"
-"yalta.ua\0silk\0"
-"gov.sx\0"
-"gov.sy\0"
-"gov.tj\0"
-"ltda\0"
-"ichinohe.iwate.jp\0gov.tl\0"
-"oppeg\xc3\xa5rd.no\0gov.tm\0"
-"gov.tn\0"
-"gov.to\0"
-"kamo.kyoto.jp\0wodzislaw.pl\0"
-"volkenkunde.museum\0gov.ua\0"
-"honjo.akita.jp\0kamiamakusa.kumamoto.jp\0gov.tr\0"
-"gov.tt\0"
-"skanit.no\0"
-"kisarazu.chiba.jp\0ono.hyogo.jp\0"
-"gov.tw\0"
-"ve.it\0kosaka.akita.jp\0matsusaka.mie.jp\0pfizer\0"
-"swiebodzin.pl\0"
-"gov.uk\0"
-"art.museum\0vestv\xc3\xa5g\xc3\xb8y.no\0sina\0virtual-user.de\0"
-"yoga\0"
-"fe.it\0miura.kanagawa.jp\0"
-"gov.vc\0"
-"yasaka.nagano.jp\0"
-"gov.ve\0"
-"uonuma.niigata.jp\0"
-"florida.museum\0uno\0"
-"intel\0"
-"market\0"
-"gov.vn\0maison\0"
-"kristiansand.no\0blogspot.com\0"
-"misato.saitama.jp\0"
-"cc.il.us\0"
-"perso.sn\0"
-"uol\0"
-"chanel\0cn-north-1.eb.amazonaws.com.cn\0"
-"cody.museum\0"
-"czeladz.pl\0"
-"sakura\0kr.eu.org\0"
-"rn.it\0"
-"maritime.museum\0vipsinaapp.com\0"
-"harima.hyogo.jp\0"
-"staples\0"
-"boats\0"
-"hi.cn\0perso.tn\0"
-"gov.ws\0"
-"dell-ogliastra.it\0"
-"browsersafetymark.io\0"
-"bn.it\0dlugoleka.pl\0"
-"annefrank.museum\0"
-"hagi.yamaguchi.jp\0"
-"k12.az.us\0space\0loseyourip.com\0"
-"rns.tn\0"
-"mill.museum\0ups\0"
-"go.dyndns.org\0"
-"bozen-sudtirol.it\0"
-"dyndns-office.com\0"
-"hofu.yamaguchi.jp\0"
-"no-ip.ca\0"
-"togitsu.nagasaki.jp\0misato.wakayama.jp\0"
-"better-than.tv\0"
-"emp.br\0kani.gifu.jp\0"
-"oslo.no\0"
-"foggia.it\0mibu.tochigi.jp\0"
-"orsta.no\0is-gone.com\0"
-"og.it\0"
-"gov.za\0"
-"tenkawa.nara.jp\0"
-"communications.museum\0"
-"builders\0"
-"gov.zm\0"
-"juegos\0"
-"minami.kyoto.jp\0"
-"blackbaudcdn.net\0"
-"auction\0mypsx.net\0"
-"gov.zw\0"
-"monzaedellabrianza.it\0"
-"q-a.eu.org\0"
-"federation.aero\0cloudns.org\0"
-"site\0"
-"zamami.okinawa.jp\0"
-"emergency.aero\0from-md.com\0"
-"not.br\0repair\0"
-"airtraffic.aero\0"
-"satsumasendai.kagoshima.jp\0\xe0\xb4\xad\xe0\xb4\xbe\xe0\xb4\xb0\xe0\xb4\xa4\xe0\xb4\x82\0"
-"lajolla.museum\0familyds.org\0"
-"trentino-sudtirol.it\0"
-"mosj\xc3\xb8""en.no\0"
-"takatori.nara.jp\0"
-"recht.pro\0"
-"inashiki.ibaraki.jp\0"
-"durham.museum\0"
-"\xe5\xbe\xae\xe5\x8d\x9a\0"
-"vet\0"
-"co.business\0"
-"andria-barletta-trani.it\0suedtirol.it\0"
-"konin.pl\0linkyard-cloud.ch\0"
-"gs.tr.no\0"
-"labor.museum\0"
+"takko.aomori.jp\0matsukawa.nagano.jp\0"
+"dattorelay.com\0"
+"calvinklein\0"
+"aca.pro\0"
+"il.us\0"
+"oyama.tochigi.jp\0"
+"bplaced.de\0"
+"lig.it\0condos\0dynvpn.de\0"
+"tydal.no\0menu\0"
+"jx.cn\0"
+"tokai.aichi.jp\0stat.no\0"
+"toyoura.hokkaido.jp\0shinagawa.tokyo.jp\0"
+"geology.museum\0"
+"lib.ne.us\0forex\0"
+"kitakata.fukushima.jp\0labour.museum\0"
+"oregon.museum\0perso.sn\0supplies\0"
+"oppdal.no\0"
+"mielno.pl\0"
+"photos\0"
+"lazio.it\0"
+"inder\xc3\xb8y.no\0"
+"naroy.no\0"
+"nikko.tochigi.jp\0hm.no\0"
+"dellogliastra.it\0perso.tn\0"
"ayagawa.kagawa.jp\0"
-"zaporizhzhe.ua\0"
-"ovre-eiker.no\0"
-"yao.osaka.jp\0"
-"my-vigor.de\0"
-"northwesternmutual\0"
-"stalbans.museum\0"
-"hokuryu.hokkaido.jp\0football\0"
-"*.nagoya.jp\0"
-"teo.br\0"
-"presidio.museum\0b\xc3\xb8mlo.no\0kharkiv.ua\0from-mt.com\0from-nd.com\0"
-"lecco.it\0"
-"asahi.yamagata.jp\0"
-"salud.bo\0contemporaryart.museum\0aca.pro\0"
-"soja.okayama.jp\0tokigawa.saitama.jp\0prochowice.pl\0"
-"il.us\0is-a-geek.com\0"
-"tr.it\0gokase.miyazaki.jp\0"
-"dyn.ddnss.de\0"
-"ladbrokes\0"
-"uchiko.ehime.jp\0"
-"toyosato.shiga.jp\0ens.tn\0"
-"berkeley.museum\0s3.ap-south-1.amazonaws.com\0"
-"media.aero\0aaa.pro\0vig\0"
-"rimini.it\0itako.ibaraki.jp\0"
-"cc.wy.us\0"
-"gujo.gifu.jp\0"
-"fot.br\0vin\0"
-"vip\0"
-"cc.hi.us\0"
-"taishi.hyogo.jp\0"
-"neyagawa.osaka.jp\0genkai.saga.jp\0wakasa.tottori.jp\0"
-"co.ae\0"
-"development.run\0"
-"co.ag\0from-sd.com\0"
-"neustar\0"
-"birthplace.museum\0"
-"cesenaforl\xc3\xac.it\0"
-"amot.no\0skjerv\xc3\xb8y.no\0"
-"co.ao\0"
-"arakawa.saitama.jp\0"
-"co.bb\0trani-barletta-andria.it\0"
-"co.at\0"
-"suifu.ibaraki.jp\0oum.gov.pl\0"
-"co.bi\0kvafjord.no\0"
-"odate.akita.jp\0"
-"embroidery.museum\0"
-"takamatsu.kagawa.jp\0"
-"nokia\0"
-"civilaviation.aero\0co.ca\0"
-"sells-for-less.com\0"
-"creditcard\0"
-"from-ut.com\0"
-"rikubetsu.hokkaido.jp\0"
-"co.bw\0dr.na\0"
-"mt.it\0"
-"co.ci\0"
-"tr.no\0"
-"co.cl\0"
-"co.cm\0philadelphiaarea.museum\0"
-"bounceme.net\0"
-"from-vt.com\0"
-"co.cr\0playstation\0"
-"hvaler.no\0"
-"servebbs.com\0"
-"guitars\0"
-"storj.farm\0"
-"poa.br\0co.cz\0"
-"co.dk\0"
-"dallas.museum\0"
-"leirfjord.no\0cc.ak.us\0"
-"localhistory.museum\0"
-"\xeb\x8b\xb7\xec\xbb\xb4\0"
-"attorney\0"
-"awaji.hyogo.jp\0higashiomi.shiga.jp\0"
-"homelinux.net\0"
-"business\0"
-"meet\0"
-"lib.ks.us\0"
-"krasnik.pl\0"
-"isshiki.aichi.jp\0okayama.okayama.jp\0"
-"koriyama.fukushima.jp\0"
-"horology.museum\0cc.mt.us\0cc.nd.us\0ybo.trade\0"
-"valleeaoste.it\0"
-"williamsburg.museum\0"
-"\xc3\xa5mli.no\0"
-"is-a-linux-user.org\0"
-"vv.it\0kozagawa.wakayama.jp\0"
-"co.gg\0"
-"tokoname.aichi.jp\0"
-"mg.gov.br\0food\0"
-"co.gl\0"
-"wassamu.hokkaido.jp\0hakui.ishikawa.jp\0"
-"orland.no\0"
-"friuli-venezia-giulia.it\0"
-"sanfrancisco.museum\0"
-"omi.niigata.jp\0"
-"h.bg\0infiniti\0"
-"kokonoe.oita.jp\0"
-"co.gy\0meeres.museum\0merseine.nu\0"
-"ebino.miyazaki.jp\0tatar\0"
-"wy.us\0"
-"trentino-altoadige.it\0"
-"malatvuopmi.no\0"
-"\xd8\xa7\xd9\x8a\xd8\xb1\xd8\xa7\xd9\x86\0"
-"melbourne\0"
-"co.id\0valdaosta.it\0"
-"co.hu\0hi.us\0is-a-geek.org\0"
-"xz.cn\0prudential\0"
-"yasugi.shimane.jp\0"
-"games.hu\0from-ct.com\0scrapping.cc\0"
-"so.it\0iwakura.aichi.jp\0saijo.ehime.jp\0"
-"co.il\0friulive-giulia.it\0mielec.pl\0"
-"co.im\0ikano\0msk.ru\0"
-"co.in\0"
-"co.ir\0kurotaki.nara.jp\0"
-"co.it\0ogawa.ibaraki.jp\0"
-"co.je\0"
-"foundation.museum\0clinic\0"
-"kamogawa.chiba.jp\0dr.tr\0"
-"santacruz.museum\0"
-"tsukigata.hokkaido.jp\0ford\0"
-"1.bg\0kalmykia.su\0"
-"shimofusa.chiba.jp\0"
-"bananarepublic\0msk.su\0"
-"umig.gov.pl\0"
-"co.jp\0warman\0"
-"luzern.museum\0s3-ap-northeast-1.amazonaws.com\0"
-"cuneo.it\0"
-"tananger.no\0"
-"vallee-aoste.it\0"
-"co.ke\0lindesnes.no\0cloud.goog\0"
-"milano.it\0"
-"wed\0"
-"wa.edu.au\0is-a-caterer.com\0"
-"edu.krd\0"
-"\xe5\xb2\x90\xe9\x98\x9c.jp\0co.kr\0legal\0rexroth\0"
-"co.lc\0*.stolos.io\0"
-"selfip.net\0"
-"slattum.no\0"
-"kawakami.nagano.jp\0computer\0"
-"stor-elvdal.no\0from-id.com\0"
-"meme\0"
-"co.ma\0"
-"akita.jp\0"
-"co.ls\0"
-"sakai.ibaraki.jp\0"
-"co.me\0royrvik.no\0rocks\0"
-"geek.nz\0"
-"co.mg\0school.na\0cc.co.us\0s3.amazonaws.com\0"
-"kommune.no\0"
-"kalmykia.ru\0"
-"ak.us\0"
-"aogaki.hyogo.jp\0kashima.ibaraki.jp\0"
-"shizuoka.jp\0"
-"co.na\0"
-"tako.chiba.jp\0kamikawa.hokkaido.jp\0"
-"media.museum\0lib.mo.us\0kicks-ass.org\0"
-"co.mu\0"
-"certification.aero\0co.mw\0"
-"nakanojo.gunma.jp\0"
-"suli.hu\0co.ni\0"
-"sicilia.it\0co.mz\0"
-"movistar\0co.nl\0"
-"menu\0"
-"co.no\0utwente.io\0"
-"school.nz\0"
-"vologda.su\0"
-"nu.ca\0george\0"
-"xihuan\0"
-"mt.us\0nd.us\0"
-"drangedal.no\0"
-"\xe5\xaf\x8c\xe5\xb1\xb1.jp\0co.nz\0"
-"rauma.no\0"
-"co.om\0"
-"nakanoto.ishikawa.jp\0"
-"poivron.org\0"
-"cesenaforli.it\0discount\0"
-"loab\xc3\xa1t.no\0"
-"nakijin.okinawa.jp\0win\0"
-"skin\0"
-"co.pl\0"
-"soundandvision.museum\0"
-"co.pn\0"
-"kasukabe.saitama.jp\0"
-"vgs.no\0notodden.no\0"
-"surgeonshall.museum\0cc.ma.us\0"
-"university.museum\0co.pw\0"
-"klodzko.pl\0"
-"static-access.net\0"
-"kddi\0"
-"volda.no\0troitsk.su\0"
-"kawai.iwate.jp\0"
-"coop.ht\0vc.it\0"
-"ikata.ehime.jp\0"
-"gs.rl.no\0"
-"catanzaro.it\0ogliastra.it\0"
-"\xc3\xa5s.no\0"
-"dreamhosters.com\0"
-"fc.it\0sagamihara.kanagawa.jp\0"
-"skedsmokorset.no\0"
-"lapy.pl\0"
-"figueres.museum\0midsund.no\0tuxfamily.org\0"
-"kushiro.hokkaido.jp\0"
-"x443.pw\0"
-"yamamoto.miyagi.jp\0"
-"blog\0"
-"co.rs\0active\0"
-"co.rw\0"
-"sorfold.no\0"
-"trentino-sued-tirol.it\0"
-"wme\0"
-"shimonita.gunma.jp\0"
-"coop.br\0kadogawa.miyazaki.jp\0"
-"shari.hokkaido.jp\0"
-"avocat.pro\0"
-"massa-carrara.it\0"
-"co.st\0"
-"shop.ht\0"
-"shop.hu\0productions\0"
-"yamaguchi.jp\0es.kr\0co.th\0"
-"co.sz\0co.tj\0"
-"francaise.museum\0co.tm\0ox.rs\0"
-"bl.it\0"
-"e164.arpa\0fhv.se\0"
-"genoa.it\0"
-"co.ua\0"
-"build\0"
-"langev\xc3\xa5g.no\0loabat.no\0"
-"co.tt\0"
-"skydiving.aero\0is-a-designer.com\0"
-"psi.br\0oseto.nagasaki.jp\0"
-"co.ug\0"
-"uji.kyoto.jp\0"
-"co.tz\0"
-"co.uk\0"
-"us.na\0"
-"transporte.bo\0"
-"co.us\0"
-"ito.shizuoka.jp\0"
-"osoyro.no\0co.ve\0knightpoint.systems\0"
-"pmn.it\0arita.saga.jp\0sosnowiec.pl\0"
-"sci.eg\0"
-"nu.it\0swinoujscie.pl\0"
-"co.vi\0"
-"co.uz\0"
-"nissedal.no\0"
-"grainger\0"
-"wow\0"
-"associates\0"
-"narusawa.yamanashi.jp\0"
-"rodeo\0"
-"kiyama.saga.jp\0"
-"lib.ak.us\0"
-"medio-campidano.it\0"
-"chikushino.fukuoka.jp\0mazowsze.pl\0"
-"ogori.fukuoka.jp\0kitaura.miyazaki.jp\0"
-"luxe\0"
-"assabu.hokkaido.jp\0"
-"geelvinck.museum\0"
-"malopolska.pl\0"
-"living.museum\0"
-"farmers.museum\0coffee\0"
-"fukushima.jp\0shingo.aomori.jp\0sasaguri.fukuoka.jp\0toyotomi.hokkaido.jp\0"
-"b\xc3\xa1hcavuotna.no\0"
-"tempio-olbia.it\0"
-"rl.no\0blue\0"
-"perugia.it\0"
-"commbank\0"
-"chichibu.saitama.jp\0"
-"hattfjelldal.no\0h.se\0"
-"inami.toyama.jp\0"
-"ftpaccess.cc\0"
-"yurihonjo.akita.jp\0"
-"nb.ca\0draydns.de\0"
-"mymediapc.net\0"
-"ma.us\0co.za\0"
-"kitaakita.akita.jp\0kosuge.yamanashi.jp\0"
-"docs\0"
-"tranibarlettaandria.it\0"
-"sydney.museum\0"
-"tamamura.gunma.jp\0onion\0"
-"taketomi.okinawa.jp\0myeffect.net\0"
-"k12.wi.us\0wtc\0"
-"noda.iwate.jp\0wtf\0"
-"co.zm\0"
-"horokanai.hokkaido.jp\0"
-"ikeda.nagano.jp\0"
-"jor.br\0"
-"y.bg\0co.zw\0"
-"news.hu\0"
-"xen.prgmr.com\0"
-"otaki.saitama.jp\0"
-"ipifony.net\0"
-"minamitane.kagoshima.jp\0olecko.pl\0"
-"jpn.com\0workisboring.com\0"
-"tjome.no\0"
-"forli-cesena.it\0"
-"os.hordaland.no\0"
-"ako.hyogo.jp\0"
-"video.hu\0"
-"huissier-justice.fr\0kotohira.kagawa.jp\0"
-"tp.it\0ichikai.tochigi.jp\0"
-"gdansk.pl\0"
-"maizuru.kyoto.jp\0"
-"hsbc\0icbc\0lanxess\0singles\0elasticbeanstalk.com\0"
-"katowice.pl\0"
-"consulting.aero\0"
-"detroit.museum\0"
-"yaese.okinawa.jp\0"
-"office\0"
-"umbria.it\0"
-"toyota.aichi.jp\0gotemba.shizuoka.jp\0"
-"selfip.info\0"
-"vadso.no\0"
-"mo\xc3\xa5reke.no\0doha\0work\0"
-"ohkura.yamagata.jp\0"
-"pictures\0myphotos.cc\0"
-"eu.int\0shonai.fukuoka.jp\0sennan.osaka.jp\0"
-"philately.museum\0"
-"gallery\0"
-"misato.shimane.jp\0"
-"aerobatic.aero\0review\0"
-"yatomi.aichi.jp\0"
-"tosashimizu.kochi.jp\0"
-"gs.mr.no\0"
-"gd.cn\0"
-"polkowice.pl\0"
-"bale.museum\0"
-"zara\0"
-"mutsu.aomori.jp\0"
-"jaworzno.pl\0doctor\0xin\0"
-"chimkent.su\0sinaapp.com\0"
-"nishiarita.saga.jp\0"
-"cloudcontrolled.com\0"
-"chrome\0aktyubinsk.su\0"
-"muroto.kochi.jp\0"
-"tama.tokyo.jp\0"
-"hanyu.saitama.jp\0"
-"s3-website.us-east-2.amazonaws.com\0"
-"\xe8\x87\xba\xe7\x81\xa3\0"
-"\xe7\xbd\x91\xe5\x9d\x80\0"
-"\xe0\xb8\xad\xe0\xb8\x87\xe0\xb8\x84\xe0\xb9\x8c\xe0\xb8\x81\xe0\xb8\xa3.\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
-"homelinux.org\0"
-"noda.chiba.jp\0"
-"ama.aichi.jp\0ami.ibaraki.jp\0"
-"misato.akita.jp\0"
-"cci.fr\0kawanishi.nara.jp\0"
-"cechire.com\0"
-"\xd8\xa8\xd8\xa7\xd8\xb2\xd8\xa7\xd8\xb1\0"
-"newholland\0vistaprint\0"
-"lucerne.museum\0"
-"vibo-valentia.it\0"
-"jp.eu.org\0"
-"haebaru.okinawa.jp\0suginami.tokyo.jp\0"
-"otofuke.hokkaido.jp\0kasuga.hyogo.jp\0"
-"mydatto.net\0"
-"marnardal.no\0"
+"barum.no\0"
+"nagasu.kumamoto.jp\0"
+"nakai.kanagawa.jp\0ikano\0l-o-g-i-n.de\0"
+"setouchi.okayama.jp\0"
+"tenkawa.nara.jp\0"
+"is-a-personaltrainer.com\0wedeploy.me\0"
+"uhren.museum\0"
+"hitachinaka.ibaraki.jp\0rissa.no\0"
+"nieruchomosci.pl\0"
+"gs.jan-mayen.no\0"
+"trentin-sued-tirol.it\0"
+"tsuru.yamanashi.jp\0"
+"ofunato.iwate.jp\0"
+"oto.fukuoka.jp\0"
+"b-data.io\0"
+"cleaning\0"
+"birkenes.no\0laakesvuemie.no\0"
+"war.museum\0appchizi.com\0"
+"eidsberg.no\0"
+"sevastopol.ua\0house\0"
+"tateyama.chiba.jp\0"
+"swiebodzin.pl\0"
+"shishikui.tokushima.jp\0"
+"kanagawa.jp\0palmsprings.museum\0yalta.ua\0"
+"mashiko.tochigi.jp\0"
+"cc.ky.us\0"
+"cloudns.org\0"
+"historyofscience.museum\0"
+"yanaizu.fukushima.jp\0akkeshi.hokkaido.jp\0ap-northeast-3.elasticbeanstalk.com\0"
+"hangout\0"
+"izumo.shimane.jp\0farsund.no\0"
+"per.la\0cc.ak.us\0flights\0"
+"stjordal.no\0"
+"its.me\0"
+"mitsuke.niigata.jp\0hino.tokyo.jp\0"
+"horology.museum\0pokrovsk.su\0"
+"vision\0"
+"bio.br\0pioneer\0"
+"cheap\0"
+"annaka.gunma.jp\0"
+"vall\xc3\xa9""e-aoste.it\0"
+"sandvikcoromant\0"
+"ct.it\0"
+"website\0"
+"uzs.gov.pl\0"
+"*.compute.estate\0"
+"tsurugi.ishikawa.jp\0minamimaki.nagano.jp\0"
+"square.museum\0lg.ua\0"
+"abiko.chiba.jp\0kerryhotels\0"
+"tychy.pl\0"
+"sannan.hyogo.jp\0"
+"kurate.fukuoka.jp\0"
+"spb.ru\0"
+"per.nf\0"
+"uda.nara.jp\0arts.museum\0"
+"oiso.kanagawa.jp\0"
+"pa.us\0"
+"tw.cn\0"
+"directory\0luxe\0"
+"gs.nt.no\0amsterdam\0"
+"dynalias.org\0spb.su\0"
+"dyndns.org\0from-sd.com\0"
+"*.kawasaki.jp\0"
+"ojiya.niigata.jp\0"
+"sa.gov.au\0priv.pl\0"
+"mediocampidano.it\0"
+"kawakita.ishikawa.jp\0"
+"tozsde.hu\0"
+"consultant.aero\0"
+"choyo.kumamoto.jp\0lanxess\0hu.net\0"
+"vf.no\0"
+"kokubunji.tokyo.jp\0"
+"rl.no\0"
+"halloffame.museum\0"
+"ginoza.okinawa.jp\0"
+"valle-d-aosta.it\0"
+"suisse.museum\0"
+"soc.lk\0kddi\0"
+"national.museum\0"
+"*.elb.amazonaws.com\0"
+"hirono.fukushima.jp\0""3utilities.com\0"
+"yonaguni.okinawa.jp\0"
+"priv.no\0"
+"vinnica.ua\0"
+"clubmed\0"
+"creditcard\0money\0"
+"deatnu.no\0\xd9\xbe\xd8\xa7\xd9\x83\xd8\xb3\xd8\xaa\xd8\xa7\xd9\x86\0is-into-anime.com\0cloud.goog\0"
+"s3-us-west-1.amazonaws.com\0s3-website-us-west-1.amazonaws.com\0"
+"rr.gov.br\0"
+"tamamura.gunma.jp\0"
+"s3.ca-central-1.amazonaws.com\0"
+"bonn.museum\0"
+"keisen.fukuoka.jp\0"
+"est-a-la-maison.com\0"
+"bo.telemark.no\0"
+"ise.mie.jp\0"
+"accountant\0"
+"\xc3\xa5mli.no\0per.sg\0"
+"campania.it\0"
+"ski.no\0"
"blogspot.com.cy\0"
-"monster\0"
-"shimane.jp\0chikugo.fukuoka.jp\0zgora.pl\0"
-"komatsu\0"
-"trentino.it\0yakumo.shimane.jp\0"
-"tatamotors\0"
-"morioka.iwate.jp\0"
-"\xe9\xa3\x9f\xe5\x93\x81\0blogspot.com.ee\0"
-"kherson.ua\0blogspot.com.eg\0nid.io\0"
-"rendalen.no\0"
-"is-a-financialadvisor.com\0"
-"kouhoku.saga.jp\0"
-"myasustor.com\0"
+"tanohata.iwate.jp\0ashikaga.tochigi.jp\0bounceme.net\0"
+"priv.me\0"
+"mitane.akita.jp\0"
+"sejny.pl\0"
+"rs.gov.br\0sc.gov.br\0wazuka.kyoto.jp\0"
+"k12.id.us\0"
+"volvo\0"
+"turin.it\0blogspot.com.ee\0"
+"lamer\0"
+"tarumizu.kagoshima.jp\0blogspot.com.eg\0"
+"s3.dualstack.eu-west-1.amazonaws.com\0east-kazakhstan.su\0"
+"awaji.hyogo.jp\0"
+"umbria.it\0fujimi.nagano.jp\0nov.ru\0"
+"s\xc3\xb8r-fron.no\0"
+"ebino.miyazaki.jp\0orx.biz\0"
+"wedeploy.io\0"
+"school.museum\0"
+"onyourside\0s3-website-ap-southeast-1.amazonaws.com\0xenapponazure.com\0"
"blogspot.com.ar\0"
-"vt.it\0"
-"alipay\0blogspot.com.au\0"
-"is-a-geek.net\0"
-"youth.museum\0"
-"kasuga.fukuoka.jp\0arao.kumamoto.jp\0is.gov.pl\0"
-"kozow.com\0"
-"daegu.kr\0*.kunden.ortsinfo.at\0"
-"weber\0"
-"game\0"
-"umaji.kochi.jp\0"
-"mr.no\0service.gov.uk\0"
-"hamamatsu.shizuoka.jp\0blogspot.com.br\0"
-"russia.museum\0spb.ru\0"
-"coop.tt\0"
-"f.bg\0is-uberleet.com\0krasnodar.su\0"
-"liaison\0"
-"karlsoy.no\0blogspot.com.by\0"
-"sandiego.museum\0"
-"republican\0"
-"v\xc3\xa5ler.hedmark.no\0"
-"obuse.nagano.jp\0"
-"blogspot.com.co\0"
-"historicalsociety.museum\0"
-"masuda.shimane.jp\0"
-"spb.su\0"
-"oizumi.gunma.jp\0"
-"wallonie.museum\0versicherung\0"
-"coop.mv\0"
-"coop.mw\0"
-"naka.ibaraki.jp\0isahaya.nagasaki.jp\0"
-"lierne.no\0utsira.no\0"
-"onna.okinawa.jp\0es.leg.br\0"
-"bydgoszcz.pl\0\xe0\xa4\xad\xe0\xa4\xbe\xe0\xa4\xb0\xe0\xa4\xa4\0jaguar\0"
-"sochi.su\0"
-"biei.hokkaido.jp\0konan.shiga.jp\0shop.th\0"
-"gliwice.pl\0"
-"trentinos-tirol.it\0"
-"uozu.toyama.jp\0"
-"dp.ua\0"
-"cc.vt.us\0"
-"bomlo.no\0"
-"grondar.za\0dyn.home-webserver.de\0"
-"gangaviika.no\0"
-"okayama.jp\0"
-"townnews-staging.com\0"
-"parma.it\0"
-"agents.aero\0doesntexist.com\0blogspot.com.es\0"
-"student.aero\0engineering\0"
-"college\0cloudns.asia\0"
-"tgory.pl\0embaixada.st\0"
-"mus.mi.us\0"
-"katsuragi.wakayama.jp\0kolobrzeg.pl\0"
-"shop.ro\0"
-"tas.gov.au\0"
-"pharmacien.fr\0sakura.chiba.jp\0"
-"coop.py\0zhitomir.ua\0"
-"jefferson.museum\0mangyshlak.su\0"
-"georgia.museum\0"
-"reggiocalabria.it\0muroran.hokkaido.jp\0"
-"pomorze.pl\0lancaster\0"
-"dinosaur.museum\0fyresdal.no\0"
-"kvitsoy.no\0dyndns1.de\0"
-"tsukiyono.gunma.jp\0"
-"lo.it\0"
-"zippo\0"
-"shop.pl\0"
-"genting\0mitsubishi\0"
-"bj.cn\0"
-"frei.no\0"
-"hurum.no\0y.se\0"
-"linkyard.cloud\0"
-"antiques.museum\0"
-"kimitsu.chiba.jp\0aisho.shiga.jp\0"
-"coop.km\0dattorelay.com\0"
-"lilly\0"
-"wegrow.pl\0"
-"ns.ca\0"
-"fujieda.shizuoka.jp\0"
-"\xe4\xba\xac\xe9\x83\xbd.jp\0"
-"dielddanuorri.no\0"
-"\xe9\xa6\x99\xe5\xb7\x9d.jp\0"
-"kasaoka.okayama.jp\0"
-"gs.va.no\0alpha.bounty-full.com\0"
-"free\0"
-"hyatt\0"
-"mansions.museum\0"
-"\xe6\xb2\x96\xe7\xb8\x84.jp\0"
-"hangout\0"
-"larsson.museum\0"
+"chikuma.nagano.jp\0toshiba\0"
+"us.com\0"
+"blogspot.com.au\0"
+"ms.it\0"
+"elk.pl\0nohost.me\0"
+"sakado.saitama.jp\0"
+"forum\0"
+"shinkamigoto.nagasaki.jp\0nov.su\0"
+"guovdageaidnu.no\0"
+"ba.gov.br\0"
+"\xd8\xb3\xd9\x88\xd8\xb1\xd9\x8a\xd8\xa7\0firmdale\0gmail\0"
+"\xd0\xbe\xd0\xb4.\xd1\x81\xd1\x80\xd0\xb1\0\xd8\xb3\xd9\x88\xd8\xb1\xd9\x8a\xd8\xa9\0is-very-bad.org\0blogspot.com.br\0"
+"kadena.okinawa.jp\0\xe4\xb8\xad\xe5\x9b\xbd\0*.spectrum.myjino.ru\0"
+"ce.it\0rindal.no\0"
+"noda.chiba.jp\0hoteles\0"
+"kopervik.no\0myfirewall.org\0"
+"traniandriabarletta.it\0blogspot.com.by\0"
+"cymru.museum\0"
+"w.bg\0kh.ua\0blogspot.com.co\0"
+"alstahaug.no\0"
+"\xe4\xb8\xad\xe5\x9c\x8b\0gb.com\0"
+"komatsushima.tokushima.jp\0arakawa.tokyo.jp\0"
+"ms.kr\0"
+"food\0"
+"sandefjord.no\0"
+"stranda.no\0"
+"sncf\0"
+"sx.cn\0"
+"kawanabe.kagoshima.jp\0"
+"md.ci\0serveexchange.com\0"
+"s3.ap-northeast-2.amazonaws.com\0"
+"ct.us\0"
+"whaling.museum\0rana.no\0game.tw\0"
+"yotsukaido.chiba.jp\0"
+"osteroy.no\0"
+"caltanissetta.it\0"
+"schule\0xbox\0"
+"blogspot.com.es\0"
+"higashiura.aichi.jp\0casacam.net\0"
+"iamallama.com\0"
+"nagai.yamagata.jp\0"
+"kaisei.kanagawa.jp\0lib.ks.us\0stufftoread.com\0"
+"website.yandexcloud.net\0"
+"aioi.hyogo.jp\0"
+"ras.ru\0"
+"rn.gov.br\0udono.mie.jp\0"
+"\xe7\xb5\x84\xe7\xbb\x87.hk\0origins\0"
+"kuju.oita.jp\0"
+"football\0lawyer\0"
+"ford\0"
+"ikaruga.nara.jp\0nanbu.tottori.jp\0"
+"modena.it\0\xe8\x81\x94\xe9\x80\x9a\0"
+"eng.br\0"
+"\xe0\xae\x9a\xe0\xae\xbf\xe0\xae\x99\xe0\xaf\x8d\xe0\xae\x95\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xaf\x82\xe0\xae\xb0\xe0\xaf\x8d\0"
+"otari.nagano.jp\0kin.okinawa.jp\0"
+"shiso.hyogo.jp\0"
+"bu.no\0cupcake.is\0"
+"hirosaki.aomori.jp\0"
+"\xd8\xa7\xdb\x8c\xd8\xb1\xd8\xa7\xd9\x86\0"
+"computer\0"
+"\xe6\x94\xbf\xe5\xba\x9c.hk\0liguria.it\0hanamigawa.chiba.jp\0chrome\0"
+"is-an-anarchist.com\0"
+"tananger.no\0gop.pk\0"
+"fie.ee\0"
+"canon\0"
+"ro.gov.br\0"
+"diskstation.me\0"
+"aircraft.aero\0realtor\0"
+"kahoku.yamagata.jp\0"
+"ryuoh.shiga.jp\0"
+"gunma.jp\0lebork.pl\0"
+"aisai.aichi.jp\0"
+"diskstation.eu\0"
+"motorcycle.museum\0karpacz.pl\0"
+"attorney\0"
+"cc.ne.us\0"
+"am.gov.br\0"
+"international\0"
+"2ix.at\0"
+"britishcolumbia.museum\0sebastopol.ua\0cc.ga.us\0\xe7\x82\xb9\xe7\x9c\x8b\0"
+"frontdoor\0"
+"s3.dualstack.sa-east-1.amazonaws.com\0"
"osakasayama.osaka.jp\0"
-"fortworth.museum\0googlecode.com\0securitytactics.com\0"
-"kochi.jp\0"
-"nuernberg.museum\0br\xc3\xb8nn\xc3\xb8y.no\0"
-"elk.pl\0"
-"caltanissetta.it\0owani.aomori.jp\0"
-"\xe7\xbb\x84\xe7\xbb\x87.hk\0"
-"tateyama.toyama.jp\0fbx-os.fr\0"
-"hanawa.fukushima.jp\0"
-"berlevag.no\0eid.no\0"
-"audnedaln.no\0gitlab.io\0"
-"kosei.shiga.jp\0"
-"namie.fukushima.jp\0"
-"firestone\0insure\0"
-"stat.no\0"
-"va.it\0fudai.iwate.jp\0"
-"nishikawa.yamagata.jp\0xxx\0"
-"uvic.museum\0"
-"dynalias.com\0"
-"yokkaichi.mie.jp\0"
-"mutsuzawa.chiba.jp\0uwajima.ehime.jp\0"
-"kirovograd.ua\0"
+"pn.it\0"
+"yawatahama.ehime.jp\0somna.no\0"
+"lt.it\0"
+"nanyo.yamagata.jp\0nissedal.no\0"
+"dep.no\0"
+"*.platform.sh\0"
+"forlicesena.it\0donostia.museum\0s3.dualstack.ap-northeast-2.amazonaws.com\0no.com\0"
+"\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xdb\x8c\xd8\xa9\0""2ix.ch\0"
+"kurashiki.okayama.jp\0"
+"rentals\0is-an-artist.com\0"
+"minamifurano.hokkaido.jp\0motorcycles\0"
+"puglia.it\0av.it\0delmenhorst.museum\0"
+"kragero.no\0"
+"venice.it\0""2ix.de\0"
+"nc.tr\0"
"selfip.org\0"
-"nittedal.no\0"
-"lucania.it\0higashiizu.shizuoka.jp\0"
-"asmatart.museum\0exhibition.museum\0"
-"vt.us\0"
-"riobranco.br\0xyz\0*.ex.ortsinfo.at\0blogspot.com.mt\0"
-"aseral.no\0"
-"warmia.pl\0"
+"h.bg\0from-dc.com\0in-the-band.net\0"
+"haram.no\0"
+"khplay.nl\0"
+"selfip.info\0karelia.su\0mysecuritycamera.org\0"
+"test-iserv.de\0"
+"pors\xc3\xa1\xc5\x8bgu.no\0"
+"takasago.hyogo.jp\0artcenter.museum\0"
+"blogspot.com.mt\0"
+"ms.us\0nc.us\0"
+"chitose.hokkaido.jp\0"
"blogspot.com.ng\0"
-"mizumaki.fukuoka.jp\0"
-"sandoy.no\0"
-"hatsukaichi.hiroshima.jp\0"
-"pokrovsk.su\0"
-"laspezia.it\0"
-"is-certified.com\0"
-"motegi.tochigi.jp\0hayakawa.yamanashi.jp\0"
-"sm.ua\0"
-"babia-gora.pl\0"
-"bo.telemark.no\0narviika.no\0"
-"he.cn\0esan.hokkaido.jp\0unzen.nagasaki.jp\0"
-"vevelstad.no\0s3-fips-us-gov-west-1.amazonaws.com\0test-iserv.de\0"
-"valleaosta.it\0"
-"ciencia.bo\0fuossko.no\0s\xc3\xb8rreisa.no\0lib.ct.us\0"
-"dyn-ip24.de\0hasura-app.io\0"
-"cc.va.us\0"
-"k\xc3\xa1r\xc3\xa1\xc5\xa1johka.no\0"
-"nagi.okayama.jp\0gbiz\0"
-"aid.pl\0"
-"hole.no\0"
-"nakai.kanagawa.jp\0"
-"chieti.it\0"
-"flatanger.no\0krodsherad.no\0"
-"reggio-emilia.it\0"
-"us.org\0"
+"val-d-aosta.it\0raisa.no\0"
+"tamatsukuri.ibaraki.jp\0"
+"friuli-veneziagiulia.it\0yachiyo.chiba.jp\0"
+"musica.ar\0"
+"in.net\0"
+"nuoro.it\0ms.leg.br\0"
+"kuromatsunai.hokkaido.jp\0przeworsk.pl\0"
+"smola.no\0"
+"equipment.aero\0"
+"hk.cn\0"
+"itabashi.tokyo.jp\0stalbans.museum\0nannestad.no\0"
+"musica.bo\0lib.nv.us\0"
+"schokoladen.museum\0"
+"esan.hokkaido.jp\0"
+"own.pm\0"
+"k12.ec\0realm.cz\0"
+"chino.nagano.jp\0mayfirst.org\0"
+"ichiba.tokushima.jp\0"
+"bryne.no\0lib.ct.us\0is-an-accountant.com\0"
+"iyo.ehime.jp\0sener\0"
+"george\0"
+"ap.gov.br\0"
+"nishiarita.saga.jp\0takahata.yamagata.jp\0krokstadelva.no\0barsy.shop\0"
"blogspot.com.tr\0"
-"is-a-llama.com\0"
-"enebakk.no\0scrysec.com\0"
-"*.sensiosite.cloud\0"
-"va.no\0k12.nm.us\0"
-"kurogi.fukuoka.jp\0shingu.hyogo.jp\0"
-"carrara-massa.it\0tamakawa.fukushima.jp\0"
-"s3-us-west-2.amazonaws.com\0"
-"kurobe.toyama.jp\0"
-"shizuoka.shizuoka.jp\0"
-"go-vip.co\0"
-"saintlouis.museum\0"
-"appspot.com\0"
-"cc.az.us\0"
-"hisayama.fukuoka.jp\0"
-"claims\0"
-"cog.mi.us\0"
-"sorocaba.br\0siteleaf.net\0"
-"historical.museum\0"
-"us-east-2.elasticbeanstalk.com\0"
-"torino.it\0"
-"iveland.no\0"
-"tokuyama.yamaguchi.jp\0"
-"clinton.museum\0you\0groks-this.info\0"
-"kiwa.mie.jp\0"
-"f.se\0"
-"mishima.shizuoka.jp\0"
-"lutsk.ua\0here-for-more.info\0"
-"s3.dualstack.ap-northeast-2.amazonaws.com\0barsyonline.com\0"
-"kirkenes.no\0"
-"mp.br\0"
-"mup.gov.pl\0"
-"flights\0"
-"\xe7\x82\xb9\xe7\x9c\x8b\0"
-"kunisaki.oita.jp\0"
-"sdn.gov.pl\0"
-"siellak.no\0"
-"otsu.shiga.jp\0"
-"is.eu.org\0"
-"netflix\0"
-"bahcavuotna.no\0\xe5\x81\xa5\xe5\xba\xb7\0potager.org\0"
-"kongsberg.no\0"
-"telefonica\0"
-"w.bg\0"
-"hasami.nagasaki.jp\0"
-"homebuilt.aero\0"
-"blogspot.com.uy\0"
-"school.za\0stage.nodeart.io\0"
-"bibai.hokkaido.jp\0"
-"city.hu\0lacaixa\0"
-"bofa\0"
-"izumi.kagoshima.jp\0"
-"monticello.museum\0cityeats\0"
-"essex.museum\0tjeldsund.no\0"
-"kakegawa.shizuoka.jp\0sncf\0"
-"gifts\0"
-"tn.it\0saitama.saitama.jp\0"
-"katagami.akita.jp\0"
-"it.eu.org\0"
-"monza-brianza.it\0"
-"js.org\0"
-"yamada.fukuoka.jp\0"
-"kagamiishi.fukushima.jp\0"
-"bjark\xc3\xb8y.no\0bplaced.com\0"
-"trd.br\0"
-"aland.fi\0"
-"ogi.saga.jp\0chungnam.kr\0"
-"deatnu.no\0likes-pie.com\0"
-"avellino.it\0"
-"va.us\0moscow\0barsy.mobi\0"
-"gildesk\xc3\xa5l.no\0mydrobo.com\0"
-"akkeshi.hokkaido.jp\0"
-"alvdal.no\0cc.gu.us\0"
-"is-an-artist.com\0"
-"shiroi.chiba.jp\0"
-"h\xc3\xa6gebostad.no\0firmdale\0uy.com\0webhosting.be\0"
-"americanexpress\0traeumtgerade.de\0"
-"nishitosa.kochi.jp\0sakawa.kochi.jp\0yun\0"
-"\xec\x82\xbc\xec\x84\xb1\0"
-"pisz.pl\0"
-"monzaebrianza.it\0yugawara.kanagawa.jp\0"
-"gotpantheon.com\0"
-"goldpoint\0"
-"koga.fukuoka.jp\0"
-"likescandy.com\0"
-"ag.it\0"
-"\xc3\xb8ygarden.no\0"
-"ogata.akita.jp\0gangwon.kr\0"
-"workshop.museum\0filegear-jp.me\0"
-"consulado.st\0"
-"l\xc3\xa6rdal.no\0cc.tn.us\0\xe7\xbd\x91\xe7\xab\x99\0"
-"\xe7\xb5\x84\xe7\xbb\x87.hk\0marketing\0"
-"fujiyoshida.yamanashi.jp\0"
-"repbody.aero\0sk.ca\0ralingen.no\0"
-"trust\0"
-"bulsan-sudtirol.it\0"
-"sasayama.hyogo.jp\0"
-"lib.ee\0az.us\0"
-"ofunato.iwate.jp\0shibata.miyagi.jp\0"
-"\xe5\xae\xb6\xe9\x9b\xbb\0in.eu.org\0"
-"andria-trani-barletta.it\0katsuragi.nara.jp\0"
-"freeddns.org\0"
-"belem.br\0"
-"lebesby.no\0"
-"consultant.aero\0amli.no\0"
-"\xe5\x9f\xbc\xe7\x8e\x89.jp\0"
-"ivgu.no\0viking\0"
-"sebastopol.ua\0"
-"author\0ddns.net\0"
-"ieee\0"
-"mat.br\0\xe5\xae\xae\xe5\x9f\x8e.jp\0"
-"services\0"
-"\xd0\xb1\xd0\xb5\xd0\xbb\0"
-"sayo.hyogo.jp\0shiiba.miyazaki.jp\0zip\0buyshouses.net\0"
-"wmflabs.org\0"
-"from-or.com\0"
-"moma.museum\0homeoffice.gov.uk\0"
-"children.museum\0"
-"balsan-sudtirol.it\0"
-"winners\0"
-"is-very-evil.org\0"
-"\xe9\xa4\x90\xe5\x8e\x85\0from-pr.com\0"
-"gj\xc3\xb8vik.no\0appchizi.com\0"
-"miyazaki.miyazaki.jp\0shiroishi.saga.jp\0anquan\0channel\0"
-"prd.fr\0koganei.tokyo.jp\0"
-"boleslawiec.pl\0exposed\0"
-"nishi.osaka.jp\0sagae.yamagata.jp\0bond\0"
-"iwama.ibaraki.jp\0"
-"surgery\0servep2p.com\0"
-"ayase.kanagawa.jp\0"
-"maintenance.aero\0"
-"yawata.kyoto.jp\0"
-"skjak.no\0vuelos\0"
-"vr.it\0kunohe.iwate.jp\0"
-"brussels.museum\0os.hedmark.no\0sk\xc3\xa5nland.no\0eu.meteorapp.com\0"
-"minamiise.mie.jp\0"
-"hagebostad.no\0"
-"rishiri.hokkaido.jp\0wzmiuw.gov.pl\0"
-"floripa.br\0namegata.ibaraki.jp\0xerox\0from-co.net\0"
-"fr.it\0higashikagura.hokkaido.jp\0saku.nagano.jp\0"
-"lib.il.us\0book\0"
-"saigawa.fukuoka.jp\0"
-"sirdal.no\0linde\0myjino.ru\0"
-"poker\0"
-"d.bg\0is-an-entertainer.com\0is-not-certified.com\0"
-"serveftp.net\0"
-"medecin.km\0"
-"yaotsu.gifu.jp\0"
-"vagsoy.no\0"
-"campidano-medio.it\0kamijima.ehime.jp\0"
-"gotsu.shimane.jp\0"
-"onthewifi.com\0"
-"\xd8\xa8\xda\xbe\xd8\xa7\xd8\xb1\xd8\xaa\0"
-"gu.us\0\xd0\xbe\xd0\xbd\xd0\xbb\xd0\xb0\xd0\xb9\xd0\xbd\0"
-"trentinosud-tirol.it\0firenze.it\0\xe3\x83\x9d\xe3\x82\xa4\xe3\x83\xb3\xe3\x83\x88\0"
-"yamanashi.yamanashi.jp\0realm.cz\0"
-"cruises\0"
-"dn.ua\0bharti\0"
-"tynset.no\0"
-"\xd8\xa7\xd9\x84\xd8\xac\xd8\xb2\xd8\xa7\xd8\xa6\xd8\xb1\0"
-"tn.us\0"
-"prd.km\0r\xc3\xb8yken.no\0"
+"mt.leg.br\0"
+"hsbc\0icbc\0unusualperson.com\0"
+"natori.miyagi.jp\0"
+"gose.nara.jp\0"
+"bharti\0flowers\0"
+"pug.it\0pila.pl\0"
+"kyotango.kyoto.jp\0"
+"iitate.fukushima.jp\0pl.eu.org\0"
+"ap.gov.pl\0"
+"zero\0"
+"cartier\0"
+"cricket\0"
+"baidar.no\0tiffany\0"
+"konin.pl\0"
+"illustration.museum\0"
+"brandywinevalley.museum\0"
+"munakata.fukuoka.jp\0leka.no\0from-va.com\0"
+"touch.museum\0"
+"is-a-bulls-fan.com\0"
+"leangaviika.no\0"
"t3l3p0rt.net\0"
-"plants.museum\0"
-"vall\xc3\xa9""e-d-aoste.it\0nagaoka.niigata.jp\0rybnik.pl\0"
-"yasu.shiga.jp\0"
-"randaberg.no\0"
-"\xeb\x8b\xb7\xeb\x84\xb7\0"
-"ot.it\0pd.it\0\xe5\x92\x8c\xe6\xad\x8c\xe5\xb1\xb1.jp\0"
-"hitachinaka.ibaraki.jp\0"
-"b\xc3\xa1id\xc3\xa1r.no\0k12.oh.us\0"
-"alstahaug.no\0"
-"\xd5\xb0\xd5\xa1\xd5\xb5\0\xd0\xbe\xd1\x80\xd0\xb3.\xd1\x81\xd1\x80\xd0\xb1\0"
-"yamatokoriyama.nara.jp\0dentist\0"
-"lib.az.us\0"
-"taiki.hokkaido.jp\0kitayama.wakayama.jp\0"
-"prd.mg\0bahccavuotna.no\0"
-"a.ssl.fastly.net\0"
-"ushistory.museum\0"
-"is-an-actress.com\0"
-"fedje.no\0gop.pk\0"
-"kikugawa.shizuoka.jp\0"
-"kvits\xc3\xb8y.no\0"
-"slz.br\0"
-"castres.museum\0training\0lebtimnetz.de\0"
-"shimonoseki.yamaguchi.jp\0"
-"architecture.museum\0"
-"lib.ms.us\0lib.nc.us\0"
-"dev-myqnapcloud.com\0"
-"\xe0\xa8\xad\xe0\xa8\xbe\xe0\xa8\xb0\xe0\xa8\xa4\0"
+"tobe.ehime.jp\0"
+"berlev\xc3\xa5g.no\0"
+"godaddy\0blogdns.com\0"
+"miyazaki.miyazaki.jp\0"
+"krager\xc3\xb8.no\0"
+"cc.il.us\0"
+"earth\0"
+"vs.it\0playstation\0"
"w.se\0"
-"broker\0"
-"database.museum\0"
-"soka.saitama.jp\0norton\0"
-"kushima.miyazaki.jp\0"
-"\xe9\x9b\x86\xe5\x9b\xa2\0"
-"sjc.br\0"
-"emilia-romagna.it\0"
-"spy.museum\0s3-ap-northeast-2.amazonaws.com\0"
-"kasamatsu.gifu.jp\0"
-"kagoshima.kagoshima.jp\0"
-"pa.gov.br\0"
-"s3-ap-southeast-2.amazonaws.com\0"
-"xbox\0*.futurecms.at\0"
-"*.sendai.jp\0"
-"abbott\0"
-"fjaler.no\0"
-"b\xc3\xa6rum.no\0"
-"minoh.osaka.jp\0"
-"agrar.hu\0"
-"markets\0"
-"computerhistory.museum\0notteroy.no\0"
-"kaita.hiroshima.jp\0"
-"indianmarket.museum\0lib.wa.us\0"
-"naklo.pl\0"
-"taa.it\0"
-"luster.no\0"
-"pb.gov.br\0"
-"ybo.party\0"
-"sand\xc3\xb8y.no\0"
-"lib.ga.us\0"
-"vall\xc3\xa9""edaoste.it\0ichikawa.chiba.jp\0"
-"mini\0"
-"yusui.kagoshima.jp\0schokokeks.net\0"
-"automotive.museum\0"
-"kunstunddesign.museum\0barum.no\0"
-"nasushiobara.tochigi.jp\0"
-"from-ar.com\0"
-"amakusa.kumamoto.jp\0kai.yamanashi.jp\0"
-"miyake.nara.jp\0mint\0"
-"aviation.museum\0fauske.no\0"
-"zlg.br\0shiriuchi.hokkaido.jp\0"
-"askvoll.no\0"
-"tmall\0"
-"ngo.lk\0poltava.ua\0"
-"s3.ap-northeast-2.amazonaws.com\0"
-"tenei.fukushima.jp\0spiegel\0"
-"kinokawa.wakayama.jp\0"
-"gs.cn\0experts-comptables.fr\0toride.ibaraki.jp\0"
-"jewishart.museum\0ivano-frankivsk.ua\0sohu\0"
-"wuoz.gov.pl\0"
-"palmsprings.museum\0dnepropetrovsk.ua\0"
-"koeln\0"
-"mallorca.museum\0"
-"nirasaki.yamanashi.jp\0bayern\0"
-"m\xc3\xa1tta-v\xc3\xa1rjjat.no\0ck.ua\0"
-"fetsund.no\0"
-"medical.museum\0blogsite.org\0"
-"komono.mie.jp\0powiat.pl\0"
-"ath.cx\0"
-"piw.gov.pl\0"
-"\xe5\xb3\xb6\xe6\xa0\xb9.jp\0glogow.pl\0nat.tn\0"
-"natural.bo\0mosjoen.no\0"
-"akiruno.tokyo.jp\0bplaced.net\0"
-"taito.tokyo.jp\0"
-"beskidy.pl\0"
-"film.museum\0"
-"sellsyourhome.org\0"
-"foodnetwork\0"
-"boavista.br\0saogonca.br\0yabu.hyogo.jp\0"
-"aomori.jp\0"
-"sakata.yamagata.jp\0"
-"\xe0\xae\x9a\xe0\xae\xbf\xe0\xae\x99\xe0\xaf\x8d\xe0\xae\x95\xe0\xae\xaa\xe0\xaf\x8d\xe0\xae\xaa\xe0\xaf\x82\xe0\xae\xb0\xe0\xaf\x8d\0"
-"sera.hiroshima.jp\0psse.gov.pl\0"
-"safety\0*.platformsh.site\0"
-"\xe7\xa6\x8f\xe5\xb2\xa1.jp\0ngo.ph\0travelchannel\0"
-"express\0s3.dualstack.ap-southeast-1.amazonaws.com\0"
-"kv\xc3\xa6""fjord.no\0"
-"slg.br\0"
-"ventures\0"
-"sakuho.nagano.jp\0utsunomiya.tochigi.jp\0"
-"audible\0"
-"yanagawa.fukuoka.jp\0"
-"kashiwara.osaka.jp\0a.prod.fastly.net\0"
-"homedns.org\0"
-"lib.md.us\0"
-"*.ex.futurecms.at\0"
-"gaivuotna.no\0k12.in.us\0"
-"protection\0"
-"engineer.aero\0lavangen.no\0"
-"opencraft.hosting\0"
-"olayangroup\0"
-"celtic.museum\0d.se\0"
-"\xe6\x9c\xba\xe6\x9e\x84\0"
-"and.museum\0"
-"kanzaki.saga.jp\0"
-"principe.st\0"
-"politie\0song\0"
-"\xd8\xb9\xd8\xb1\xd8\xa7\xd9\x82\0"
-"cheltenham.museum\0marker.no\0"
-"\xc3\xa5""fjord.no\0"
-"daejeon.kr\0"
-"mizusawa.iwate.jp\0"
-"sony\0"
-"gru.br\0tosa.kochi.jp\0"
-"barlettatraniandria.it\0"
-"if.ua\0"
-"u.bg\0"
-"shimamaki.hokkaido.jp\0"
-"h\xc3\xb8ylandet.no\0"
-"bible\0ferrari\0"
-"vana\0"
-"medecin.fr\0"
-"pyatigorsk.ru\0"
-"\xe9\xa6\x99\xe6\xb8\xaf\0statefarm\0today\0"
-"kutno.pl\0"
-"education.museum\0is-a-player.com\0"
-"!city.kobe.jp\0bialowieza.pl\0frontdoor\0"
-"ap-southeast-2.elasticbeanstalk.com\0"
-"firewall-gateway.net\0"
-"presse.km\0mozilla-iot.org\0"
-"airguard.museum\0hzc.io\0"
-"arteducation.museum\0research.museum\0"
-"tsushima.nagasaki.jp\0"
-"karacol.su\0"
-"ishigaki.okinawa.jp\0"
-"freight.aero\0\xc3\xb8rland.no\0"
-"dnsdojo.com\0"
-"selfip.biz\0hasura.app\0"
-"tozsde.hu\0vlaanderen.museum\0"
-"nakasatsunai.hokkaido.jp\0"
-"\xe6\x84\x9b\xe7\x9f\xa5.jp\0mihama.aichi.jp\0matsudo.chiba.jp\0tachikawa.tokyo.jp\0"
-"toyonaka.osaka.jp\0"
-"ws.na\0"
-"tomisato.chiba.jp\0takahashi.okayama.jp\0matsuzaki.shizuoka.jp\0"
-"presse.ml\0"
-"gouv.fr\0"
-"cafe\0"
-"ascolipiceno.it\0"
-"pu.it\0"
-"osaka\0"
-"demon.nl\0"
-"lotte\0pt.eu.org\0"
-"sortland.no\0"
-"nord-odal.no\0"
-"servebeer.com\0"
-"lotto\0"
-"kazo.saitama.jp\0"
-"nalchik.ru\0"
-"pi.gov.br\0vlaanderen\0"
-"dsmynas.com\0"
-"kepno.pl\0"
-"childrens.museum\0"
-"gouv.ht\0"
-"api.stdlib.com\0"
-"\xce\xb5\xce\xbb\0"
-"mn.it\0\xe5\x8c\x97\xe6\xb5\xb7\xe9\x81\x93.jp\0"
-"pb.ao\0fylkesbibl.no\0"
-"fusa.no\0ngo.za\0nalchik.su\0"
-"dodge\0"
-"or.at\0"
-"grue.no\0"
-"kazimierz-dolny.pl\0"
-"or.bi\0"
-"se.net\0ru.net\0"
-"scientist.aero\0"
-"gouv.bj\0"
-"selje.no\0"
-"sopot.pl\0"
-"spdns.eu\0"
-"shimotsuma.ibaraki.jp\0tanabe.wakayama.jp\0intl.tn\0dev.static.land\0"
-"taka.hyogo.jp\0shimokitayama.nara.jp\0"
-"or.ci\0"
-"szex.hu\0chesapeakebay.museum\0"
-"gouv.ci\0"
-"sener\0"
-"kraanghke.no\0"
-"or.cr\0nakano.tokyo.jp\0"
-"lib.ky.us\0"
-"\xd8\xa7\xd8\xaa\xd8\xb5\xd8\xa7\xd9\x84\xd8\xa7\xd8\xaa\0"
-"microlight.aero\0ollo\0"
-"ota.gunma.jp\0himeshima.oita.jp\0"
-"tokashiki.okinawa.jp\0"
-"nsw.edu.au\0"
-"\xe7\x86\x8a\xe6\x9c\xac.jp\0"
-"botanical.museum\0"
-"house.museum\0"
-"cc.mn.us\0"
-"ogaki.gifu.jp\0"
-"gran.no\0"
-"shinichi.hiroshima.jp\0nadex\0"
-"ibigawa.gifu.jp\0"
-"koto.tokyo.jp\0"
-"steam.museum\0"
-"arakawa.tokyo.jp\0"
-"medicina.bo\0"
-"turek.pl\0call\0"
-"apps.fbsbx.com\0"
-"*.dapps.earth\0"
-"utazu.kagawa.jp\0"
-"assassination.museum\0zero\0"
-"\xe7\xbd\x91\xe7\xb5\xa1.hk\0"
-"himi.toyama.jp\0"
-"k12.fl.us\0"
-"sar.it\0ichihara.chiba.jp\0unazuki.toyama.jp\0"
-"furniture\0"
-"id.au\0b.bg\0"
-"nissan\0"
-"bjarkoy.no\0azurecontainer.io\0"
-"camp\0"
-"mykolaiv.ua\0"
-"online.museum\0is-a-hunter.com\0"
-"b.br\0"
-"far.br\0"
-"nissay\0"
-"wpcomstaging.com\0"
-"starachowice.pl\0"
"si.it\0"
-"erotika.hu\0garden.museum\0"
-"nikon\0"
-"cultural.museum\0issmarterthanyou.com\0"
-"egyptian.museum\0\xe5\x98\x89\xe9\x87\x8c\xe5\xa4\xa7\xe9\x85\x92\xe5\xba\x97\0"
-"misato.miyagi.jp\0weatherchannel\0"
-"br\xc3\xb8nn\xc3\xb8ysund.no\0"
-"ci.it\0karpacz.pl\0"
-"dynvpn.de\0"
-"togo.aichi.jp\0"
-"trader.aero\0k12.as.us\0"
-"sannohe.aomori.jp\0mizunami.gifu.jp\0hu.net\0"
-"cambridge.museum\0lewismiller.museum\0svn-repos.de\0"
-"pe.gov.br\0nosegawa.nara.jp\0cieszyn.pl\0hicam.net\0"
-"spdns.de\0"
-"or.id\0"
-"otsuchi.iwate.jp\0"
-"jessheim.no\0"
-"chernivtsi.ua\0kyoto\0from-nm.com\0"
-"macerata.it\0"
-"kr.com\0"
-"takanezawa.tochigi.jp\0"
-"london.museum\0bod\xc3\xb8.no\0is-a-conservative.com\0"
-"or.it\0"
-"desa.id\0mar.it\0"
-"k12.nv.us\0nis.za\0"
-"zappos\0"
-"aurskog-holand.no\0skiptvet.no\0my-gateway.de\0"
-"or.jp\0shiogama.miyagi.jp\0bungotakada.oita.jp\0"
-"clock.museum\0strand.no\0"
-"higashiyamato.tokyo.jp\0oguni.yamagata.jp\0"
-"andasuolo.no\0"
-"musica.ar\0shimamoto.osaka.jp\0"
-"or.ke\0"
-"mikawa.yamagata.jp\0"
-"sumy.ua\0care\0selfip.com\0"
-"gon.pk\0dst.mi.us\0"
-"sokndal.no\0s3-website-us-east-1.amazonaws.com\0"
-"from-az.net\0"
-"ikeda.osaka.jp\0"
-"musica.bo\0"
-"takaoka.toyama.jp\0or.kr\0fund\0"
-"casa\0"
-"cars\0"
-"nishiaizu.fukushima.jp\0kusu.oita.jp\0minato.osaka.jp\0bieszczady.pl\0spot\0"
-"case\0gr.com\0"
-"nayoro.hokkaido.jp\0"
-"lib.ne.us\0"
-"cash\0"
-"owariasahi.aichi.jp\0"
-"utazas.hu\0"
-"decorativearts.museum\0sigdal.no\0"
-"mattel\0"
-"u.se\0gb.com\0"
-"shiraoka.saitama.jp\0gent\0"
-"bauhaus\0"
-"artcenter.museum\0cc.or.us\0serveftp.org\0shacknet.nu\0"
-"jdf.br\0"
-"collegefan.org\0"
-"isen.kagoshima.jp\0"
-"b\xc3\xb8.telemark.no\0"
-"tsuruta.aomori.jp\0"
-"mn.us\0"
-"higashiyoshino.nara.jp\0"
-"or.na\0"
-"tochigi.jp\0osakikamijima.hiroshima.jp\0kitagata.saga.jp\0"
-"or.mu\0"
-"enonic.io\0"
-"texas.museum\0leclerc\0"
-"id.ir\0habikino.osaka.jp\0"
-"qa2.com\0"
-"pa.gov.pl\0"
-"air-surveillance.aero\0axis.museum\0marine.ru\0"
-"ricoh\0"
-"ballangen.no\0"
-"odessa.ua\0careers\0"
-"palermo.it\0"
-"kitahata.saga.jp\0"
-"br.com\0"
-"\xe9\x95\xb7\xe5\xb4\x8e.jp\0"
-"campania.it\0hirogawa.wakayama.jp\0"
-"macapa.br\0yura.wakayama.jp\0"
-"my-wan.de\0"
-"k\xc3\xa5""fjord.no\0ar.com\0"
-"aisai.aichi.jp\0sanda.hyogo.jp\0"
-"trentin-s\xc3\xbc""dtirol.it\0"
-"estate.museum\0ringerike.no\0"
-"dyndns-at-home.com\0is-a-libertarian.com\0"
-"jx.cn\0"
-"newyork.museum\0"
-"yuzawa.niigata.jp\0"
-"hitachiomiya.ibaraki.jp\0test.tj\0"
-"k12.co.us\0linkitools.space\0"
-"or.pw\0"
-"fukui.jp\0mitaka.tokyo.jp\0"
-"\xe0\xac\xad\xe0\xac\xbe\xe0\xac\xb0\xe0\xac\xa4\0"
-"is-a-blogger.com\0"
-"kijo.miyazaki.jp\0id.lv\0"
-"cc.id.us\0"
-"id.ly\0"
-"altoadige.it\0"
-"hirara.okinawa.jp\0"
-"hapmir.no\0"
-"obira.hokkaido.jp\0kochi.kochi.jp\0higashiyodogawa.osaka.jp\0"
-"damnserver.com\0"
-"yame.fukuoka.jp\0ina.saitama.jp\0lowicz.pl\0"
-"war.museum\0"
-"omigawa.chiba.jp\0datsun\0"
-"modalen.no\0k12.pr.us\0tattoo\0karelia.su\0"
-"grajewo.pl\0"
-"sanofi\0"
-"ha.cn\0"
-"academy\0filegear-gb.me\0"
-"pr.gov.br\0tsukumi.oita.jp\0"
-"stjordalshalsen.no\0komforb.se\0"
-"av.it\0sunagawa.hokkaido.jp\0iijima.nagano.jp\0"
-"ishinomaki.miyagi.jp\0"
-"stord.no\0"
-"sakai.osaka.jp\0"
-"gouv.rw\0"
-"psc.br\0"
-"test.ru\0"
-"kakogawa.hyogo.jp\0"
-"budejju.no\0"
-"kariwa.niigata.jp\0iide.yamagata.jp\0"
-"gouv.sn\0"
-"kameoka.kyoto.jp\0"
-"uchinada.ishikawa.jp\0or.th\0observer\0"
-"tj.cn\0handa.aichi.jp\0kaga.ishikawa.jp\0"
-"snillfjord.no\0"
-"idf.il\0tuscany.it\0"
-"azure\0"
-"no.it\0"
-"ac.ae\0lib.pa.us\0"
-"presse.ci\0k12.ma.us\0\xe0\xa4\xa8\xe0\xa5\x87\xe0\xa4\x9f\0"
-"kasama.ibaraki.jp\0"
-"tec.mi.us\0"
-"karuizawa.nagano.jp\0"
-"photography\0"
-"reisen\0\xe5\x95\x86\xe5\x9f\x8e\0"
-"or.ug\0"
-"hamatonbetsu.hokkaido.jp\0tomari.hokkaido.jp\0kita.tokyo.jp\0select\0"
-"or.tz\0"
-"mayfirst.info\0"
-"ac.at\0"
-"ac.be\0"
-"rovigo.it\0ise.mie.jp\0"
-"qc.ca\0"
-"or.us\0"
-"laquila.it\0gamagori.aichi.jp\0foundation\0"
-"taira.toyama.jp\0"
-"valle-daosta.it\0"
-"barclaycard\0"
-"cloudcontrolapp.com\0"
-"hasvik.no\0"
-"takaharu.miyazaki.jp\0"
-"cisco\0"
-"hatoyama.saitama.jp\0credit\0"
-"ac.ci\0malselv.no\0"
-"ullensvang.no\0"
-"ac.cn\0gallup\0"
-"\xe9\x9d\x92\xe6\xa3\xae.jp\0minami-alps.yamanashi.jp\0"
-"g\xc3\xa1ivuotna.no\0b.se\0"
-"ac.cr\0"
-"baths.museum\0balat.no\0"
-"liguria.it\0kanan.osaka.jp\0"
-"ac.cy\0forum.hu\0"
-"is-a-knight.org\0"
-"pol.dz\0kitakata.fukushima.jp\0iizuna.nagano.jp\0"
-"presse.fr\0"
-"tsugaru.aomori.jp\0"
-"talk\0"
-"sandnes.no\0"
-"graphics\0"
-"carraramassa.it\0"
-"lipsy\0"
-"iiyama.nagano.jp\0nyuzen.toyama.jp\0"
-"network\0"
-"s.bg\0chocolate.museum\0labour.museum\0marburg.museum\0kongsvinger.no\0"
-"bnpparibas\0"
-"kashiba.nara.jp\0parliament.nz\0chrysler\0poznan.pl\0"
-"kiwi\0"
-"gdynia.pl\0"
-"barueri.br\0"
-"\xd0\xbf\xd1\x80.\xd1\x81\xd1\x80\xd0\xb1\0"
-"kamaishi.iwate.jp\0"
-"id.us\0lasalle\0"
-"warszawa.pl\0"
-"sciencecenter.museum\0yodobashi\0myiphost.com\0"
-"is-a-republican.com\0"
-"chikujo.fukuoka.jp\0usa.oita.jp\0"
-"lib.ut.us\0"
-"gorizia.it\0ozu.kumamoto.jp\0"
-"franziskaner.museum\0mein-vigor.de\0"
-"cbre\0"
-"ac.gn\0friuli-v-giulia.it\0kuki.saitama.jp\0"
-"bentley\0"
-"cz.it\0"
-"gouv.km\0froland.no\0"
-"pol.ht\0worse-than.tv\0"
-"s3-website-eu-west-1.amazonaws.com\0"
-"salerno.it\0"
-"mino.gifu.jp\0\xe8\x81\x94\xe9\x80\x9a\0"
-"atami.shizuoka.jp\0"
-"building.museum\0flanders.museum\0""12hp.de\0"
-"ac.id\0kira.aichi.jp\0flt.cloud.muni.cz\0"
-"suldal.no\0"
-"british.museum\0reg.dk\0"
-"\xe6\x97\xb6\xe5\xb0\x9a\0"
-"journal.aero\0"
-"ac.il\0poniatowa.pl\0"
-"ac.im\0vang.no\0"
-"ac.in\0"
-"\xd8\xa7\xd9\x84\xd9\x85\xd8\xba\xd8\xb1\xd8\xa8\0"
-"ac.ir\0kagawa.jp\0\xe6\x84\x9b\xe5\xaa\x9b.jp\0"
-"coal.museum\0davvesiida.no\0knowsitall.info\0"
-"\xe7\xbe\xa4\xe9\xa6\xac.jp\0asahi.chiba.jp\0bato.tochigi.jp\0"
-"gouv.ml\0"
-"ha.no\0"
+"se.gov.br\0k12.il\0"
+"nakagawa.hokkaido.jp\0edeka\0ac.leg.br\0"
+"ono.fukui.jp\0"
+"kiyosato.hokkaido.jp\0shika.ishikawa.jp\0atsugi.kanagawa.jp\0"
+"mikasa.hokkaido.jp\0"
+"tako.chiba.jp\0"
+"appspot.com\0"
+"le.it\0seika.kyoto.jp\0"
+"barcelona.museum\0"
+"space-to-rent.com\0"
+"verdal.no\0"
+"inazawa.aichi.jp\0"
+"heguri.nara.jp\0epson\0"
+"microlight.aero\0ag.it\0"
+"blogspot.com.uy\0"
+"\xe7\xbd\x91\xe7\xbb\x9c\0"
+"katano.osaka.jp\0mosj\xc3\xb8""en.no\0lt.ua\0"
+"e12.ve\0"
+"\xe7\xbd\x91\xe7\xbb\x9c.cn\0"
+"yn.cn\0"
+"not.br\0"
"av.tr\0"
-"n\xc3\xa5\xc3\xa5mesjevuemie.no\0"
-"mashike.hokkaido.jp\0"
-"fuoisku.no\0"
-"ac.jp\0isa.kagoshima.jp\0"
-"portland.museum\0doesntexist.org\0"
-"12hp.at\0"
-"ac.ke\0"
-"mol.it\0saroma.hokkaido.jp\0ohda.shimane.jp\0"
-"\xe6\xa0\x83\xe6\x9c\xa8.jp\0"
-"schweiz.museum\0duck\0"
-"leg.br\0kuromatsunai.hokkaido.jp\0"
-"ryugasaki.ibaraki.jp\0"
-"ainan.ehime.jp\0wakasa.fukui.jp\0"
-"sumoto.kumamoto.jp\0"
-"murayama.yamagata.jp\0ac.kr\0"
-"portlligat.museum\0"
-"12hp.ch\0"
-"aircraft.aero\0navigation.aero\0"
-"ac.lk\0"
-"finance\0"
-"usr.cloud.muni.cz\0"
-"betainabox.com\0"
-"ac.ma\0"
-"trentino-alto-adige.it\0nonoichi.ishikawa.jp\0"
-"ac.ls\0"
-"ac.me\0mywire.org\0"
-"yuki.ibaraki.jp\0nantan.kyoto.jp\0"
-"stjohn.museum\0bplaced.de\0"
-"hanamaki.iwate.jp\0"
-"pittsburgh.museum\0"
-"educator.aero\0"
-"muenster.museum\0taifun-dns.de\0"
-"blanco\0"
-"ac.mu\0kh.ua\0"
-"ac.mw\0"
-"ascoli-piceno.it\0"
-"uslivinghistory.museum\0ac.ni\0"
-"trentin-sud-tirol.it\0ac.mz\0"
-"svalbard.no\0"
-"giize.com\0customer.speedpartner.de\0dyn-vpn.de\0"
-"inuyama.aichi.jp\0po.gov.pl\0"
-"mortgage\0toshiba\0"
-"cagliari.it\0sharp\0\xe7\xbd\x91\xe7\xbb\x9c\0"
-"ggee\0"
-"pug.it\0ac.nz\0"
-"ac.pa\0"
-"shibukawa.gunma.jp\0"
-"sorum.no\0"
-"fukuchi.fukuoka.jp\0"
-"sarpsborg.no\0"
-"vestnes.no\0chase\0"
-"tarumizu.kagoshima.jp\0shimane.shimane.jp\0"
-"farm.museum\0ilovecollege.info\0"
-"hitachi\0"
-"education\0"
-"taxi\0"
-"date.fukushima.jp\0ac.pr\0"
-"barrell-of-knowledge.info\0"
-"dealer\0"
-"fishing\0"
-"trentin-sued-tirol.it\0nanae.hokkaido.jp\0akashi.hyogo.jp\0sumida.tokyo.jp\0"
-"selbu.no\0"
-"rost.no\0"
-"tomika.gifu.jp\0"
-"ookuwa.nagano.jp\0hachijo.tokyo.jp\0"
-"silk.museum\0"
-"mjondalen.no\0k12.ri.us\0uk.com\0"
-"hidaka.hokkaido.jp\0"
-"austevoll.no\0"
-"iyo.ehime.jp\0"
-"plurinacional.bo\0"
-"kanagawa.jp\0"
-"is-a-cpa.com\0"
-"aerodrome.aero\0"
-"operaunite.com\0"
-"zuerich\0"
-"hol.no\0ac.rs\0"
-"nord-fron.no\0ac.ru\0ac.se\0lighting\0eu.org\0"
-"kujukuri.chiba.jp\0tara.saga.jp\0"
-"ac.rw\0"
-"yugawa.fukushima.jp\0dyndns.biz\0"
-"sauherad.no\0accountants\0"
-"eniwa.hokkaido.jp\0"
-"gol.no\0bridgestone\0dyndns-pics.com\0point2this.com\0"
-"takahama.fukui.jp\0"
-"skierv\xc3\xa1.no\0\xd2\x9b\xd0\xb0\xd0\xb7\0"
-"iitate.fukushima.jp\0otoyo.kochi.jp\0"
-"tatsuno.nagano.jp\0ibaraki.osaka.jp\0"
-"clinique\0"
-"pol.tr\0kosher\0"
-"ac.th\0"
-"mazury.pl\0slask.pl\0ac.sz\0ac.tj\0"
-"rhcloud.com\0"
-"natura\0"
-"okaya.nagano.jp\0b.ssl.fastly.net\0"
-"lunner.no\0aetna\0s3-website.eu-central-1.amazonaws.com\0"
-"fuchu.toyama.jp\0salon\0ma.leg.br\0"
-"divttasvuotna.no\0"
-"campobasso.it\0inagi.tokyo.jp\0"
-"ac.ug\0"
-"bristol.museum\0"
-"ac.tz\0"
-"ac.uk\0"
-"matsue.shimane.jp\0"
-"abiko.chiba.jp\0qpon\0"
-"aarp\0"
-"mobile\0"
-"oji.nara.jp\0"
-"ae.org\0"
-"li.it\0"
-"glass.museum\0"
-"serveminecraft.net\0"
-"amber.museum\0"
-"hirado.nagasaki.jp\0\xe5\x8f\xb0\xe6\xb9\xbe\0in.net\0"
-"ac.vn\0"
-"fussa.tokyo.jp\0\xe6\x88\x91\xe7\x88\xb1\xe4\xbd\xa0\0"
-"ltd.cy\0money.museum\0s.se\0duns\0"
-"minamifurano.hokkaido.jp\0"
-"glas.museum\0"
-"mihama.mie.jp\0"
-"degree\0mobily\0\xe5\x9c\xa8\xe7\xba\xbf\0logoip.de\0"
-"e4.cz\0"
-"fashion\0"
-"realty\0"
-"from-nh.com\0"
-"recife.br\0nm.cn\0"
-"rio.br\0ueno.gunma.jp\0"
-"citic\0from-oh.com\0"
-"blogspot.vn\0"
-"ca-central-1.elasticbeanstalk.com\0"
-"viterbo.it\0shingu.fukuoka.jp\0"
-"chuo.chiba.jp\0urakawa.hokkaido.jp\0"
-"dvag\0"
-"fst.br\0tsunan.niigata.jp\0"
-"stockholm.museum\0"
-"kobayashi.miyazaki.jp\0\xe5\xa8\xb1\xe4\xb9\x90\0"
-"cc.ky.us\0"
-"bizen.okayama.jp\0"
-"koshimizu.hokkaido.jp\0shinjo.nara.jp\0"
-"trading\0from-tx.com\0"
-"ltd.gi\0ac.za\0al.eu.org\0"
-"gamo.shiga.jp\0"
-"rovno.ua\0hk.com\0"
-"yatsushiro.kumamoto.jp\0"
-"vn.ua\0richardli\0"
-"taishi.osaka.jp\0kaufen\0"
-"bearalv\xc3\xa1hki.no\0ac.zm\0"
-"chirurgiens-dentistes.fr\0rebun.hokkaido.jp\0"
-"state.museum\0"
-"equipment.aero\0"
-"k12.de.us\0ltd.hk\0"
-"setagaya.tokyo.jp\0"
-"ac.zw\0"
-"pvh.br\0firm.ht\0bbs.tr\0\xe5\x85\xab\xe5\x8d\xa6\0"
-"grandrapids.museum\0enterprises\0"
-"a\xc3\xa9roport.ci\0\xe4\xb8\xad\xe6\x96\x87\xe7\xbd\x91\0nodum.co\0"
-"bolt.hu\0technology\0"
-"firm.in\0hiroo.hokkaido.jp\0kadoma.osaka.jp\0"
-"isernia.it\0"
-"act.au\0"
-"agrigento.it\0"
-"drammen.no\0troandin.no\0pl.eu.org\0blogspot.re\0"
-"shioya.tochigi.jp\0mitou.yamaguchi.jp\0"
-"badaddja.no\0"
-"nogata.fukuoka.jp\0tonosho.kagawa.jp\0minamioguni.kumamoto.jp\0opoczno.pl\0"
-"go.ci\0"
-"shitara.aichi.jp\0"
-"beats\0meteorapp.com\0"
-"kumano.hiroshima.jp\0"
-"leksvik.no\0blogspot.ro\0"
-"maniwa.okayama.jp\0health\0"
-"londrina.br\0go.cr\0at.it\0yoichi.hokkaido.jp\0"
-"oygarden.no\0blogspot.rs\0"
-"zgorzelec.pl\0"
-"airbus\0blogspot.ru\0blogspot.se\0"
-"blogspot.sg\0"
-"andriabarlettatrani.it\0"
-"stj\xc3\xb8rdal.no\0blogspot.si\0"
-"blogspot.sk\0"
-"alto-adige.it\0"
-"filegear-sg.me\0nodum.io\0"
-"blogspot.sn\0"
-"firm.co\0"
-"kerryproperties\0dd-dns.de\0"
-"fuchu.hiroshima.jp\0blogspot.td\0"
-"temp-dns.com\0"
-"sx.cn\0tokai.aichi.jp\0"
-"ninja\0"
-"marylhurst.museum\0science-fiction.museum\0"
-"tozawa.yamagata.jp\0oshino.yamanashi.jp\0"
-"casino.hu\0firm.dk\0"
-"ac.gov.br\0mw.gov.pl\0"
-"ltd.lk\0hyundai\0"
-"kosai.shizuoka.jp\0kainan.wakayama.jp\0"
-"shintomi.miyazaki.jp\0raid\0"
-"lorenskog.no\0able\0cust.dev.thingdust.io\0"
-"hanno.saitama.jp\0"
-"rennebu.no\0blogspot.tw\0blogspot.ug\0"
-"nakayama.yamagata.jp\0"
-"nishio.aichi.jp\0"
-"origins\0dyn.cosidns.de\0abkhazia.su\0tula.su\0"
-"dattolocal.net\0"
-"baseball.museum\0vantaa.museum\0os\xc3\xb8yro.no\0"
-"\xe3\x82\xb9\xe3\x83\x88\xe3\x82\xa2\0blogspot.mr\0"
-"quicksytes.com\0"
-"sex.hu\0agriculture.museum\0"
-"muni.il\0kikuchi.kumamoto.jp\0\xe5\xa4\xa7\xe4\xbc\x97\xe6\xb1\xbd\xe8\xbd\xa6\0"
-"blogspot.mx\0"
-"blogspot.my\0"
-"bci.dnstrace.pro\0"
-"blogspot.nl\0"
-"qld.edu.au\0"
-"ikusaka.nagano.jp\0"
-"blogspot.no\0"
-"\xc3\xb8yer.no\0"
-"ms.gov.br\0otobe.hokkaido.jp\0"
-"sakaki.nagano.jp\0"
-"knx-server.net\0"
-"cc.nm.us\0"
-"moriya.ibaraki.jp\0"
-"miyawaka.fukuoka.jp\0"
-"sciencehistory.museum\0circle\0"
-"go.id\0"
-"burghof.museum\0donetsk.ua\0ky.us\0blogspot.pe\0"
-"bio.br\0"
-"izunokuni.shizuoka.jp\0"
-"frogans\0spdns.org\0"
-"york.museum\0k12.va.us\0ap-northeast-3.elasticbeanstalk.com\0"
-"takanabe.miyazaki.jp\0\xe0\xb9\x84\xe0\xb8\x97\xe0\xb8\xa2\0"
-"isehara.kanagawa.jp\0auspost\0"
-"blogspot.qa\0"
-"scienceandhistory.museum\0"
-"trentinsued-tirol.it\0go.it\0blogspot.pt\0"
-"parliament.cy\0lib.ia.us\0"
-"mt.gov.br\0"
-"etne.no\0"
-"trentinos\xc3\xbc""d-tirol.it\0trentinsudtirol.it\0olbiatempio.it\0fukumitsu.toyama.jp\0juniper\0"
-"q.bg\0naturalhistory.museum\0s3-website-us-west-2.amazonaws.com\0"
-"sologne.museum\0"
-"santoandre.br\0"
-"go.jp\0kawaba.gunma.jp\0"
-"flor\xc3\xb8.no\0l-o-g-i-n.de\0"
-"ohtawara.tochigi.jp\0"
-"weibo\0blogspot.is\0"
-"lecce.it\0memorial\0blogspot.it\0"
-"go.ke\0"
-"tabayama.yamanashi.jp\0"
-"accident-investigation.aero\0"
-"kadena.okinawa.jp\0"
-"frosta.no\0"
-"toyokawa.aichi.jp\0banamex\0"
-"sibenik.museum\0"
-"blogspot.jp\0"
-"go.kr\0chirurgiens-dentistes-en-france.fr\0"
-"hamar.no\0"
-"environment.museum\0"
-"higashikagawa.kagawa.jp\0matsukawa.nagano.jp\0\xe5\x85\xac\xe5\x8f\xb8\0"
-"gs.aa.no\0"
-"honai.ehime.jp\0"
-"skole.museum\0utah.museum\0"
-"blogspot.kr\0"
-"trolley.museum\0bd.se\0from-me.org\0"
-"carrier.museum\0salat.no\0brussels\0cipriani\0"
-"grimstad.no\0krager\xc3\xb8.no\0"
-"lea\xc5\x8bgaviika.no\0blogspot.li\0"
-"is-by.us\0"
-"shiso.hyogo.jp\0"
-"arq.br\0"
-"\xed\x95\x9c\xea\xb5\xad\0"
-"blogspot.lt\0blogspot.md\0"
-"roan.no\0blogspot.lu\0"
-"dni.us\0ltd.ua\0"
-"championship.aero\0"
-"kobierzyce.pl\0"
-"schlesisches.museum\0blogspot.mk\0"
-"sex.pl\0"
-"archaeology.museum\0"
-"tonaki.okinawa.jp\0est.pr\0"
-"gotdns.com\0"
-"ltd.uk\0healthcare\0"
-"webhop.biz\0"
-"firm.ve\0"
-"itayanagi.aomori.jp\0suita.osaka.jp\0"
-"blogspot.fi\0"
-"narashino.chiba.jp\0"
-"\xe7\xbd\x91\xe5\xba\x97\0"
-"tsukui.kanagawa.jp\0shimosuwa.nagano.jp\0"
-"troms\xc3\xb8.no\0"
-"otaki.nagano.jp\0"
-"\xe5\xb9\xbf\xe4\xb8\x9c\0"
-"jfk.museum\0kl\xc3\xa6""bu.no\0ferrero\0"
-"berlin\0blogspot.fr\0"
-"oracle\0"
-"sukagawa.fukushima.jp\0\xe5\x98\x89\xe9\x87\x8c\0"
-"works\0"
-"world\0"
-"tcp4.me\0"
-"kumiyama.kyoto.jp\0open\0"
-"is-saved.org\0"
-"channelsdvr.net\0"
-"friuli-vegiulia.it\0"
-"taobao\0co.events\0"
-"\xe3\x82\xaf\xe3\x83\xa9\xe3\x82\xa6\xe3\x83\x89\0"
-"blogspot.gr\0"
-"praxi\0barsy.online\0resindevice.io\0"
-"tadaoka.osaka.jp\0"
-"go.pw\0is-a-anarchist.com\0"
-"trentinostirol.it\0star\0"
-"on.ca\0"
-"cloudeity.net\0"
-"nm.us\0blogspot.hk\0"
-"leirvik.no\0"
-"ong.br\0blogspot.hr\0"
-"lahppi.no\0"
-"*.compute.estate\0blogspot.hu\0blogspot.ie\0"
-"edu.ac\0\xc3\xa5lesund.no\0blackfriday\0"
-"is.it\0zentsuji.kagawa.jp\0"
-"paroch.k12.ma.us\0"
-"edu.af\0"
-"blogspot.in\0"
-"rennes\xc3\xb8y.no\0"
-"ozora.hokkaido.jp\0busan.kr\0"
-"blogspot.ba\0withyoutube.com\0"
-"edu.al\0"
-"sykkylven.no\0"
-"hirakata.osaka.jp\0"
-"eng.pro\0blogspot.be\0"
-"edu.ba\0aa.no\0blogspot.bg\0"
-"edu.ar\0edu.bb\0matera.it\0ibara.okayama.jp\0de.cool\0"
-"plc.ly\0"
-"blogspot.bj\0"
-"edu.au\0godaddy\0is-a-soxfan.org\0"
-"keisen.fukuoka.jp\0"
-"edu.bh\0moseushi.hokkaido.jp\0"
-"edu.bi\0crafts.museum\0"
-"edu.az\0kumamoto.kumamoto.jp\0"
-"firm.ro\0eu-central-1.elasticbeanstalk.com\0blogspot.ca\0"
-"exchange.aero\0edu.bm\0"
-"edu.bn\0tsurugi.ishikawa.jp\0"
-"edu.bo\0s\xc3\xb8r-odal.no\0"
-"blogspot.cf\0"
-"aremark.no\0"
-"edu.br\0go.th\0blogspot.ch\0"
+"md.us\0"
+"christiansburg.museum\0"
+"hiraizumi.iwate.jp\0"
+"montreal.museum\0"
+"nichinan.miyazaki.jp\0"
+"makeup\0"
+"doomdns.com\0"
+"al.eu.org\0"
+"saves-the-whales.com\0"
+"hanyu.saitama.jp\0"
+"gs.hm.no\0"
+"kainan.wakayama.jp\0"
+"protonet.io\0"
+"construction\0"
+"katsuyama.fukui.jp\0"
+"kaho.fukuoka.jp\0"
+"acct.pro\0"
+"\xc3\xa5seral.no\0kaszuby.pl\0"
+"edu.ac\0"
+"isesaki.gunma.jp\0caseih\0"
+"l\xc3\xa1hppi.no\0"
+"edu.af\0vana\0operaunite.com\0"
+"neyagawa.osaka.jp\0saskatchewan.museum\0photography\0"
+"ginan.gifu.jp\0\xd8\xa7\xd9\x84\xd8\xb3\xd8\xb9\xd9\x88\xd8\xaf\xdb\x8c\xdb\x83\0"
+"edu.al\0davvenj\xc3\xa1rga.no\0is-a-rockstar.com\0"
+"hidaka.wakayama.jp\0"
+"audnedaln.no\0"
+"mopar\0"
+"edu.ba\0"
+"edu.ar\0edu.bb\0\xd9\x81\xd9\x84\xd8\xb3\xd8\xb7\xd9\x8a\xd9\x86\0"
+"cody.museum\0"
+"khmelnytskyi.ua\0\xe5\xbe\xae\xe5\x8d\x9a\0"
+"edu.au\0nogata.fukuoka.jp\0ashibetsu.hokkaido.jp\0\xe7\xbb\x84\xe7\xbb\x87\xe6\x9c\xba\xe6\x9e\x84\0"
+"sa.gov.pl\0"
+"edu.bh\0"
+"gliding.aero\0edu.bi\0sohu\0"
+"edu.az\0miyagi.jp\0"
+"science-fiction.museum\0"
+"edu.bm\0allstate\0"
+"edu.bn\0"
+"edu.bo\0v\xc3\xa1rgg\xc3\xa1t.no\0"
+"yamada.iwate.jp\0"
+"wanggou\0"
+"edu.br\0"
"edu.bs\0"
-"edu.bt\0go.tj\0"
-"s\xc3\xb8r-varanger.no\0"
-"blogspot.cl\0"
-"jogasz.hu\0orkanger.no\0"
+"edu.bt\0"
+"arida.wakayama.jp\0"
"edu.ci\0"
"edu.bz\0"
-"gs.bu.no\0jambyl.su\0"
-"lublin.pl\0mysecuritycamera.net\0"
-"v\xc3\xa1rgg\xc3\xa1t.no\0"
-"edu.cn\0"
-"edu.co\0contemporary.museum\0blogspot.de\0"
-"blogspot.cv\0"
-"laakesvuemie.no\0go.ug\0"
-"boldlygoingnowhere.org\0"
-"go.tz\0blogspot.cz\0"
-"edu.cu\0blogspot.dk\0"
-"edu.cw\0stranda.no\0"
-"hikawa.shimane.jp\0"
-"serveftp.com\0"
-"shinanomachi.nagano.jp\0"
-"edu.dm\0finnoy.no\0"
-"yoka.hyogo.jp\0"
-"edu.do\0museet.museum\0b\xc3\xa1l\xc3\xa1t.no\0"
-"sano.tochigi.jp\0\xd8\xa7\xd9\x85\xd8\xa7\xd8\xb1\xd8\xa7\xd8\xaa\0"
-"\xe9\xb9\xbf\xe5\x85\x90\xe5\xb3\xb6.jp\0"
-"edu.ec\0"
+"tsubame.niigata.jp\0habikino.osaka.jp\0"
+"edu.cn\0\xe7\xbd\x91\xe7\xbb\x9c.hk\0"
+"edu.co\0"
+"\xe9\x95\xb7\xe9\x87\x8e.jp\0hzc.io\0"
+"sa.edu.au\0aso.kumamoto.jp\0kasukabe.saitama.jp\0"
+"kamikawa.saitama.jp\0"
+"edu.cu\0"
+"geisei.kochi.jp\0"
+"edu.cw\0"
+"saogonca.br\0"
+"beauxarts.museum\0"
+"izumiotsu.osaka.jp\0no-ip.biz\0"
+"karikatur.museum\0anquan\0"
+"edu.dm\0\xe0\xa8\xad\xe0\xa8\xbe\xe0\xa8\xb0\xe0\xa8\xa4\0"
+"k12.ma.us\0grainger\0"
+"edu.do\0nakijin.okinawa.jp\0"
+"lixil\0"
+"cc.pa.us\0"
+"edu.ec\0higashiosaka.osaka.jp\0"
"edu.ee\0"
-"edu.eg\0broadway\0"
-"livorno.it\0"
-"edu.dz\0carboniaiglesias.it\0"
-"lesja.no\0"
-"ce.it\0sytes.net\0"
-"linz.museum\0virtualuser.de\0"
-"seiyo.ehime.jp\0"
-"my-firewall.org\0"
-"kanmaki.nara.jp\0tendo.yamagata.jp\0wolomin.pl\0"
-"sula.no\0"
-"firm.nf\0"
-"edu.es\0savannahga.museum\0tonsberg.no\0"
-"edu.et\0"
-"myvnc.com\0"
-"engineer\0"
-"avoues.fr\0bihoro.hokkaido.jp\0caseih\0"
-"juedisches.museum\0"
-"al.gov.br\0"
-"group.aero\0cc.fl.us\0"
-"mg.leg.br\0"
-"pulawy.pl\0"
-"eng.br\0gift\0"
-"columbus.museum\0"
-"otari.nagano.jp\0"
-"edu.ge\0hermes\0"
-"honjo.saitama.jp\0"
+"edu.eg\0"
+"edu.dz\0val-daosta.it\0chikusei.ibaraki.jp\0"
+"psi.br\0"
+"gotpantheon.com\0"
+"h.se\0"
+"edu.es\0"
+"edu.et\0myiphost.com\0"
+"istmein.de\0"
+"balsan.it\0"
+"media\0"
+"docs\0"
+"ora.gunma.jp\0"
+"rockart.museum\0\xe3\x82\xaf\xe3\x83\xa9\xe3\x82\xa6\xe3\x83\x89\0barsy.site\0"
+"s3-ap-southeast-1.amazonaws.com\0"
+"witd.gov.pl\0"
+"edu.ge\0nemuro.hokkaido.jp\0"
+"trentino-s\xc3\xbc""dtirol.it\0cr.it\0"
"edu.gh\0"
-"edu.gi\0coastaldefence.museum\0"
-"partners\0"
-"edu.gl\0minamiyamashiro.kyoto.jp\0"
-"edu.gn\0cloudns.biz\0"
-"no.eu.org\0"
-"edu.gp\0namikata.ehime.jp\0"
-"edu.gr\0"
-"cng.br\0edu.gt\0gosen.niigata.jp\0"
-"agro.bo\0edu.gu\0phoenix.museum\0lugansk.ua\0"
-"digital\0"
-"dyn-o-saur.com\0"
-"motoyama.kochi.jp\0"
-"industria.bo\0edu.gy\0"
-"edu.hk\0"
-"lombardia.it\0"
-"edu.hn\0iwaizumi.iwate.jp\0chino.nagano.jp\0futsu.nagasaki.jp\0"
-"fuel.aero\0blogspot.ae\0"
-"ishikari.hokkaido.jp\0"
-"akrehamn.no\0"
-"edu.ht\0"
-"toyota\0"
-"blogspot.al\0"
-"mobi\0tunes\0blogspot.am\0"
-"goiania.br\0co.financial\0"
-"yokoze.saitama.jp\0"
-"naoshima.kagawa.jp\0"
-"sola.no\0adac\0\xe6\xb8\xb8\xe6\x88\x8f\0"
-"edu.in\0yamanashi.jp\0"
+"edu.gi\0miharu.fukushima.jp\0"
+"cesena-forl\xc3\xac.it\0property\0"
+"song\0"
+"edu.gl\0"
+"sakawa.kochi.jp\0oirm.gov.pl\0"
+"edu.gn\0holiday\0"
+"edu.gp\0benevento.it\0"
+"aju.br\0edu.gr\0k12.tr\0"
+"hashimoto.wakayama.jp\0blog\0final\0"
+"show.aero\0edu.gt\0trentino-alto-adige.it\0chanel\0"
+"edu.gu\0"
+"edu.gy\0"
+"edu.hk\0""2000.hu\0"
+"gs.vf.no\0cust.prod.thingdust.io\0"
+"sony\0"
+"edu.hn\0"
+"gs.rl.no\0hyatt\0"
+"yachimata.chiba.jp\0"
+"edu.ht\0gniezno.pl\0"
+"izumozaki.niigata.jp\0"
+"asso.fr\0tsuruta.aomori.jp\0celtic.museum\0"
+"fm.br\0k12.vi\0"
+"beats\0net-freaks.com\0"
+"cn-northwest-1.eb.amazonaws.com.cn\0"
+"\xe5\xba\x83\xe5\xb3\xb6.jp\0takahama.aichi.jp\0"
+"edu.in\0"
"edu.iq\0"
-"edu.is\0"
-"edu.it\0"
-"plc.uk\0"
-"piacenza.it\0terni.it\0lg.jp\0echizen.fukui.jp\0actor\0"
-"bu.no\0modum.no\0dy.fi\0"
-"takino.hyogo.jp\0"
-"\xe5\x8f\xb0\xe7\x81\xa3\0"
-"\xe5\x85\xac\xe7\x9b\x8a\0"
-"isa.us\0"
-"arts.co\0village.museum\0s\xc3\xb8r-fron.no\0vodka\0"
-"edu.jo\0moda\0dnshome.de\0"
-"tashkent.su\0byen.site\0"
-"akune.kagoshima.jp\0canon\0"
-"edu.kg\0"
-"edu.ki\0countryestate.museum\0"
-"green\0"
-"edu.km\0"
-"sango.nara.jp\0edu.kn\0"
-"navuotna.no\0lib.in.us\0"
-"yakumo.hokkaido.jp\0edu.kp\0"
-"edu.la\0"
-"nagahama.shiga.jp\0edu.lb\0"
-"edu.lc\0afjord.no\0"
-"rotorcraft.aero\0edu.kw\0"
-"udono.mie.jp\0global.prod.fastly.net\0"
-"edu.ky\0n\xc3\xa1vuotna.no\0"
-"\xe7\xbd\x91\xe7\xbb\x9c.cn\0edu.kz\0"
+"edu.is\0game\0"
+"asso.gp\0edu.it\0dscloud.biz\0"
+"k\xc3\xa1r\xc3\xa1\xc5\xa1johka.no\0"
+"depot.museum\0"
+"natural.bo\0lib.md.us\0"
+"sano.tochigi.jp\0"
+"edu.jo\0kaminokawa.tochigi.jp\0"
+"store\0"
+"zagan.pl\0"
+"kmpsp.gov.pl\0vologda.su\0"
+"accident-prevention.aero\0"
+"edu.kg\0land-4-sale.us\0"
+"asso.ht\0"
+"edu.ki\0lib.ar.us\0"
+"unzen.nagasaki.jp\0edu.km\0"
+"edu.kn\0is-saved.org\0"
+"edu.kp\0comcast\0"
+"akita.akita.jp\0edu.la\0"
+"edu.lb\0"
+"rikubetsu.hokkaido.jp\0edu.lc\0"
+"finance\0"
+"daiwa.hiroshima.jp\0s\xc3\xa1l\xc3\xa1t.no\0dunlop\0"
+"edu.kw\0history.museum\0"
+"niyodogawa.kochi.jp\0""1kapp.com\0"
+"shonai.yamagata.jp\0edu.ky\0sciences.museum\0"
+"edu.kz\0"
"edu.lk\0"
-"pisa.it\0"
-"toyota.yamaguchi.jp\0comcast\0"
-"lombardy.it\0shikatsu.aichi.jp\0"
-"\xc3\xa1lt\xc3\xa1.no\0"
+"asso.bj\0for.sale\0"
+"aurland.no\0"
+"foundation\0otsuka\0"
"edu.lr\0"
"edu.ls\0"
-"kawaue.gifu.jp\0"
"edu.me\0"
-"edu.lv\0"
+"mihama.chiba.jp\0edu.lv\0"
"edu.mg\0"
-"edu.ly\0penza.su\0"
+"edu.ly\0"
"edu.mk\0"
-"edu.ml\0cricket\0telebit.app\0"
-"misaki.osaka.jp\0edu.mn\0cern\0"
-"edu.mo\0nz.eu.org\0"
-"tatebayashi.gunma.jp\0"
-"redstone\0nym.by\0"
-"nym.bz\0"
-"edu.ms\0mordovia.su\0"
+"edu.ml\0nittedal.no\0"
+"asso.ci\0"
+"edu.mn\0"
+"edu.mo\0"
+"blue\0"
+"edu.ms\0"
+"edu.mt\0dnsalias.com\0"
+"edu.mv\0lab.ms\0"
+"marburg.museum\0edu.mw\0edu.ng\0"
+"edu.mx\0"
+"edu.my\0edu.ni\0"
+"tas.edu.au\0edu.mz\0"
+"muosat.no\0"
+"amami.kagoshima.jp\0omi.niigata.jp\0"
+"etnedal.no\0kutno.pl\0"
+"\xe5\xb2\xa9\xe6\x89\x8b.jp\0energy\0al.leg.br\0"
+"from-hi.com\0"
+"kharkiv.ua\0"
+"crd.co\0"
+"\xe9\xb3\xa5\xe5\x8f\x96.jp\0edu.nr\0mytis.ru\0"
+"sicily.it\0ichinoseki.iwate.jp\0s3-website.eu-west-2.amazonaws.com\0webhop.me\0"
+"sharp\0"
+"kiev.ua\0"
+"yuasa.wakayama.jp\0cc.ct.us\0"
+"schlesisches.museum\0marine.ru\0filegear-ie.me\0caa.li\0"
+"!city.kawasaki.jp\0azerbaijan.su\0""32-b.it\0"
+"edu.om\0"
+"asso.dz\0read-books.org\0"
+"troms\xc3\xb8.no\0"
+"immobilien\0"
+"na.it\0hob\xc3\xb8l.no\0edu.pa\0"
+"\xe4\xbf\xa1\xe6\x81\xaf\0"
+"no.eu.org\0"
+"edu.pe\0"
+"steigen.no\0edu.pf\0"
+"kautokeino.no\0"
+"edu.ph\0"
+"fm.it\0edu.pk\0vladikavkaz.ru\0"
+"edu.pl\0"
+"dnipropetrovsk.ua\0"
+"edu.pn\0"
+"bs.it\0abashiri.hokkaido.jp\0otsuki.yamanashi.jp\0"
+"gjerdrum.no\0edu.qa\0"
+"gojome.akita.jp\0yamanashi.yamanashi.jp\0edu.pr\0"
+"oshima.tokyo.jp\0edu.ps\0"
+"edu.pt\0"
+"lind\xc3\xa5s.no\0"
+"edu.py\0devices.resinstaging.io\0"
+"u.bg\0"
+"vladikavkaz.su\0"
+"davvenjarga.no\0"
+"yamada.fukuoka.jp\0sakuho.nagano.jp\0ut.us\0"
+"koza.wakayama.jp\0ravendb.community\0"
+"moriguchi.osaka.jp\0nsn.us\0"
+"tgory.pl\0"
+"engine.aero\0"
+"media.museum\0free\0"
+"cr.ua\0svn-repos.de\0"
+"sosa.chiba.jp\0"
+"joburg\0storage.yandexcloud.net\0"
+"mb.ca\0beta.bounty-full.com\0"
+"omi.nagano.jp\0tushu\0"
+"from-or.com\0"
+"iwakura.aichi.jp\0"
+"\xe5\x8c\x97\xe6\xb5\xb7\xe9\x81\x93.jp\0yasuoka.nagano.jp\0guitars\0"
+"oumu.hokkaido.jp\0"
+"rawa-maz.pl\0edu.sa\0"
+"shinjo.okayama.jp\0edu.sb\0"
+"edu.rs\0edu.sc\0"
+"fukui.fukui.jp\0torsken.no\0edu.sd\0"
+"edu.ru\0"
+"ikusaka.nagano.jp\0monticello.museum\0"
+"edu.sg\0for-our.info\0"
+"tas.gov.au\0"
+"historisch.museum\0servemp3.com\0"
+"kaga.ishikawa.jp\0edu.sl\0"
+"shikama.miyagi.jp\0gs.bu.no\0edu.sn\0"
+"edu.so\0"
+"blog.bo\0"
+"edu.ss\0"
+"edu.st\0"
+"blog.br\0"
+"bozen-sudtirol.it\0edu.sv\0"
+"edu.sy\0"
+"edu.tj\0mypi.co\0"
+"\xe7\xb6\xb2\xe7\xbb\x9c.hk\0"
+"cc.na\0edu.tm\0"
+"bygland.no\0"
+"grandrapids.museum\0edu.to\0e4.cz\0"
+"yamaguchi.jp\0malselv.no\0rovno.ua\0"
+"kami.kochi.jp\0edu.ua\0tokyo\0"
+"edu.tr\0r.cdn77.net\0"
+"g\xc3\xa1\xc5\x8bgaviika.no\0s3-ap-northeast-1.amazonaws.com\0"
+"kawara.fukuoka.jp\0heroy.more-og-romsdal.no\0edu.tt\0"
+"from-ms.com\0from-nc.com\0"
+"fm.no\0"
+"edu.tw\0"
+"windmill.museum\0bss.design\0"
+"kiyosu.aichi.jp\0"
};
static const quint16 tldChunkCount = 2;
-static const quint32 tldChunks[] = {65517, 101828};
+static const quint32 tldChunks[] = {65526, 103395};
QT_END_NAMESPACE
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index 15c9f52cf3..1f03ac5d5a 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -40,6 +40,7 @@
#include "qwindowspipereader_p.h"
#include "qiodevice_p.h"
#include <qelapsedtimer.h>
+#include <qscopedvaluerollback.h>
QT_BEGIN_NAMESPACE
@@ -301,9 +302,8 @@ void QWindowsPipeReader::emitPendingReadyRead()
{
if (readyReadPending) {
readyReadPending = false;
- inReadyRead = true;
+ QScopedValueRollback<bool> guard(inReadyRead, true);
emit readyRead();
- inReadyRead = false;
}
}
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index 92e8b6db52..32536f495b 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -39,6 +39,7 @@
#include "qwindowspipewriter_p.h"
#include "qiodevice_p.h"
+#include <qscopedvaluerollback.h>
QT_BEGIN_NAMESPACE
@@ -111,9 +112,8 @@ void QWindowsPipeWriter::emitPendingBytesWrittenValue()
emit canWrite();
if (!inBytesWritten) {
- inBytesWritten = true;
+ QScopedValueRollback<bool> guard(inBytesWritten, true);
emit bytesWritten(bytes);
- inBytesWritten = false;
}
}
}
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 25a80a640c..6e97c2fd39 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -45,6 +45,7 @@
#include <qmimedata.h>
#include <qdebug.h>
#include <qvector.h>
+#include <qregexp.h>
#include <qstack.h>
#include <qbitarray.h>
#include <qdatetime.h>
@@ -76,7 +77,7 @@ QPersistentModelIndexData *QPersistentModelIndexData::create(const QModelIndex &
void QPersistentModelIndexData::destroy(QPersistentModelIndexData *data)
{
Q_ASSERT(data);
- Q_ASSERT(data->ref.load() == 0);
+ Q_ASSERT(data->ref.loadRelaxed() == 0);
QAbstractItemModel *model = const_cast<QAbstractItemModel *>(data->index.model());
// a valid persistent model index with a null model pointer can only happen if the model was destroyed
if (model) {
@@ -531,21 +532,16 @@ void QAbstractItemModelPrivate::invalidatePersistentIndex(const QModelIndex &ind
}
}
-namespace {
- struct DefaultRoleNames : public QHash<int, QByteArray>
+using DefaultRoleNames = QHash<int, QByteArray>;
+Q_GLOBAL_STATIC_WITH_ARGS(DefaultRoleNames, qDefaultRoleNames, (
{
- DefaultRoleNames() {
- (*this)[Qt::DisplayRole] = "display";
- (*this)[Qt::DecorationRole] = "decoration";
- (*this)[Qt::EditRole] = "edit";
- (*this)[Qt::ToolTipRole] = "toolTip";
- (*this)[Qt::StatusTipRole] = "statusTip";
- (*this)[Qt::WhatsThisRole] = "whatsThis";
- }
- };
-}
-
-Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames)
+ { Qt::DisplayRole, "display" },
+ { Qt::DecorationRole, "decoration" },
+ { Qt::EditRole, "edit" },
+ { Qt::ToolTipRole, "toolTip" },
+ { Qt::StatusTipRole, "statusTip" },
+ { Qt::WhatsThisRole, "whatsThis" },
+ }))
const QHash<int,QByteArray> &QAbstractItemModelPrivate::defaultRoleNames()
{
@@ -1902,10 +1898,17 @@ bool QAbstractItemModel::clearItemData(const QModelIndex &index)
*/
bool QAbstractItemModel::setItemData(const QModelIndex &index, const QMap<int, QVariant> &roles)
{
- bool b = true;
- for (QMap<int, QVariant>::ConstIterator it = roles.begin(); it != roles.end(); ++it)
- b = b && setData(index, it.value(), it.key());
- return b;
+ // ### Qt 6: Consider change the semantics of this function,
+ // or deprecating/removing it altogether.
+ //
+ // For instance, it should try setting *all* the data
+ // in \a roles, and not bail out at the first setData that returns
+ // false. It should also have a transactional approach.
+ for (auto it = roles.begin(), e = roles.end(); it != e; ++it) {
+ if (!setData(index, it.value(), it.key()))
+ return false;
+ }
+ return true;
}
/*!
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h
index c34876d1d6..43649cf79b 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.h
+++ b/src/corelib/itemmodels/qabstractitemmodel.h
@@ -57,12 +57,12 @@ class Q_CORE_EXPORT QModelIndex
{
friend class QAbstractItemModel;
public:
- Q_DECL_CONSTEXPR inline QModelIndex() Q_DECL_NOTHROW : r(-1), c(-1), i(0), m(nullptr) {}
+ Q_DECL_CONSTEXPR inline QModelIndex() noexcept : r(-1), c(-1), i(0), m(nullptr) {}
// compiler-generated copy/move ctors/assignment operators are fine!
- Q_DECL_CONSTEXPR inline int row() const Q_DECL_NOTHROW { return r; }
- Q_DECL_CONSTEXPR inline int column() const Q_DECL_NOTHROW { return c; }
- Q_DECL_CONSTEXPR inline quintptr internalId() const Q_DECL_NOTHROW { return i; }
- inline void *internalPointer() const Q_DECL_NOTHROW { return reinterpret_cast<void*>(i); }
+ Q_DECL_CONSTEXPR inline int row() const noexcept { return r; }
+ Q_DECL_CONSTEXPR inline int column() const noexcept { return c; }
+ Q_DECL_CONSTEXPR inline quintptr internalId() const noexcept { return i; }
+ inline void *internalPointer() const noexcept { return reinterpret_cast<void*>(i); }
inline QModelIndex parent() const;
inline QModelIndex sibling(int row, int column) const;
inline QModelIndex siblingAtColumn(int column) const;
@@ -72,13 +72,13 @@ public:
#endif
inline QVariant data(int role = Qt::DisplayRole) const;
inline Qt::ItemFlags flags() const;
- Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const Q_DECL_NOTHROW { return m; }
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW { return (r >= 0) && (c >= 0) && (m != nullptr); }
- Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline const QAbstractItemModel *model() const noexcept { return m; }
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept { return (r >= 0) && (c >= 0) && (m != nullptr); }
+ Q_DECL_CONSTEXPR inline bool operator==(const QModelIndex &other) const noexcept
{ return (other.r == r) && (other.i == i) && (other.c == c) && (other.m == m); }
- Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline bool operator!=(const QModelIndex &other) const noexcept
{ return !(*this == other); }
- Q_DECL_CONSTEXPR inline bool operator<(const QModelIndex &other) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline bool operator<(const QModelIndex &other) const noexcept
{
return r < other.r
|| (r == other.r && (c < other.c
@@ -86,9 +86,9 @@ public:
|| (i == other.i && std::less<const QAbstractItemModel *>()(m, other.m))))));
}
private:
- inline QModelIndex(int arow, int acolumn, void *ptr, const QAbstractItemModel *amodel) Q_DECL_NOTHROW
+ inline QModelIndex(int arow, int acolumn, void *ptr, const QAbstractItemModel *amodel) noexcept
: r(arow), c(acolumn), i(reinterpret_cast<quintptr>(ptr)), m(amodel) {}
- Q_DECL_CONSTEXPR inline QModelIndex(int arow, int acolumn, quintptr id, const QAbstractItemModel *amodel) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline QModelIndex(int arow, int acolumn, quintptr id, const QAbstractItemModel *amodel) noexcept
: r(arow), c(acolumn), i(id), m(amodel) {}
int r, c;
quintptr i;
@@ -103,7 +103,7 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QModelIndex &);
class QPersistentModelIndexData;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-uint qHash(const QPersistentModelIndex &index, uint seed = 0) Q_DECL_NOTHROW;
+uint qHash(const QPersistentModelIndex &index, uint seed = 0) noexcept;
class Q_CORE_EXPORT QPersistentModelIndex
{
@@ -117,13 +117,11 @@ public:
inline bool operator!=(const QPersistentModelIndex &other) const
{ return !operator==(other); }
QPersistentModelIndex &operator=(const QPersistentModelIndex &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QPersistentModelIndex(QPersistentModelIndex &&other) Q_DECL_NOTHROW
+ inline QPersistentModelIndex(QPersistentModelIndex &&other) noexcept
: d(other.d) { other.d = nullptr; }
- inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) Q_DECL_NOTHROW
+ inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QPersistentModelIndex &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QPersistentModelIndex &other) noexcept { qSwap(d, other.d); }
bool operator==(const QModelIndex &other) const;
bool operator!=(const QModelIndex &other) const;
QPersistentModelIndex &operator=(const QModelIndex &other);
@@ -143,14 +141,14 @@ public:
bool isValid() const;
private:
QPersistentModelIndexData *d;
- friend uint qHash(const QPersistentModelIndex &, uint seed) Q_DECL_NOTHROW;
+ friend uint qHash(const QPersistentModelIndex &, uint seed) noexcept;
#ifndef QT_NO_DEBUG_STREAM
friend Q_CORE_EXPORT QDebug operator<<(QDebug, const QPersistentModelIndex &);
#endif
};
Q_DECLARE_SHARED(QPersistentModelIndex)
-inline uint qHash(const QPersistentModelIndex &index, uint seed) Q_DECL_NOTHROW
+inline uint qHash(const QPersistentModelIndex &index, uint seed) noexcept
{ return qHash(index.d, seed); }
@@ -464,7 +462,7 @@ inline QVariant QModelIndex::data(int arole) const
inline Qt::ItemFlags QModelIndex::flags() const
{ return m ? m->flags(*this) : Qt::ItemFlags(); }
-inline uint qHash(const QModelIndex &index) Q_DECL_NOTHROW
+inline uint qHash(const QModelIndex &index) noexcept
{ return uint((uint(index.row()) << 4) + index.column() + index.internalId()); }
QT_END_NAMESPACE
diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h b/src/corelib/itemmodels/qabstractitemmodel_p.h
index e6085eca94..92a440a125 100644
--- a/src/corelib/itemmodels/qabstractitemmodel_p.h
+++ b/src/corelib/itemmodels/qabstractitemmodel_p.h
@@ -98,7 +98,7 @@ public:
void itemsMoved(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
bool allowMove(const QModelIndex &srcParent, int srcFirst, int srcLast, const QModelIndex &destinationParent, int destinationChild, Qt::Orientation orientation);
- inline QModelIndex createIndex(int row, int column, void *data = 0) const {
+ inline QModelIndex createIndex(int row, int column, void *data = nullptr) const {
return q_func()->createIndex(row, column, data);
}
diff --git a/src/corelib/itemmodels/qabstractproxymodel_p.h b/src/corelib/itemmodels/qabstractproxymodel_p.h
index f7bd5cc691..a95687c970 100644
--- a/src/corelib/itemmodels/qabstractproxymodel_p.h
+++ b/src/corelib/itemmodels/qabstractproxymodel_p.h
@@ -62,7 +62,7 @@ class Q_CORE_EXPORT QAbstractProxyModelPrivate : public QAbstractItemModelPrivat
{
Q_DECLARE_PUBLIC(QAbstractProxyModel)
public:
- QAbstractProxyModelPrivate() : QAbstractItemModelPrivate(), model(0) {}
+ QAbstractProxyModelPrivate() : QAbstractItemModelPrivate(), model(nullptr) {}
QAbstractItemModel *model;
virtual void _q_sourceModelDestroyed();
void mapDropCoordinatesToSource(int row, int column, const QModelIndex &parent,
diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
index a20024f468..0319d215a1 100644
--- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
+++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
@@ -55,7 +55,7 @@ public:
struct SourceModelForRowResult
{
- SourceModelForRowResult() : sourceModel(Q_NULLPTR), sourceRow(-1) {}
+ SourceModelForRowResult() : sourceModel(nullptr), sourceRow(-1) {}
QAbstractItemModel *sourceModel;
int sourceRow;
};
diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.h b/src/corelib/itemmodels/qconcatenatetablesproxymodel.h
index 85fc6a9c72..69b3a2ba09 100644
--- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.h
+++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.h
@@ -42,6 +42,8 @@
#include <QtCore/qabstractitemmodel.h>
+QT_REQUIRE_CONFIG(concatenatetablesproxymodel);
+
QT_BEGIN_NAMESPACE
class QConcatenateTablesProxyModelPrivate;
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index 1bacb63b17..c93a4d15b9 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -1273,10 +1273,10 @@ struct IsNotValid {
typedef bool result_type;
struct is_transparent : std::true_type {};
template <typename T>
- Q_DECL_CONSTEXPR bool operator()(T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(t.isValid()))
+ Q_DECL_CONSTEXPR bool operator()(T &t) const noexcept(noexcept(t.isValid()))
{ return !t.isValid(); }
template <typename T>
- Q_DECL_CONSTEXPR bool operator()(T *t) const Q_DECL_NOEXCEPT_EXPR(noexcept(t->isValid()))
+ Q_DECL_CONSTEXPR bool operator()(T *t) const noexcept(noexcept(t->isValid()))
{ return !t->isValid(); }
};
}
diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h
index 1c924053a5..3c3f9fb1ac 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.h
+++ b/src/corelib/itemmodels/qitemselectionmodel.h
@@ -60,19 +60,17 @@ public:
// ### Qt 6: remove them all, the compiler-generated ones are fine
inline QItemSelectionRange(const QItemSelectionRange &other)
: tl(other.tl), br(other.br) {}
-# ifdef Q_COMPILER_RVALUE_REFS
- QItemSelectionRange(QItemSelectionRange &&other) Q_DECL_NOTHROW
+ QItemSelectionRange(QItemSelectionRange &&other) noexcept
: tl(std::move(other.tl)), br(std::move(other.br)) {}
- QItemSelectionRange &operator=(QItemSelectionRange &&other) Q_DECL_NOTHROW
+ QItemSelectionRange &operator=(QItemSelectionRange &&other) noexcept
{ tl = std::move(other.tl); br = std::move(other.br); return *this; }
-# endif
QItemSelectionRange &operator=(const QItemSelectionRange &other)
{ tl = other.tl; br = other.br; return *this; }
#endif // Qt < 6
QItemSelectionRange(const QModelIndex &topL, const QModelIndex &bottomR) : tl(topL), br(bottomR) {}
explicit QItemSelectionRange(const QModelIndex &index) : tl(index), br(tl) {}
- void swap(QItemSelectionRange &other) Q_DECL_NOTHROW
+ void swap(QItemSelectionRange &other) noexcept
{
qSwap(tl, other.tl);
qSwap(br, other.br);
@@ -249,7 +247,7 @@ Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QList<QItemSelectionRange>;
class Q_CORE_EXPORT QItemSelection : public QList<QItemSelectionRange>
{
public:
- QItemSelection() Q_DECL_NOTHROW : QList<QItemSelectionRange>() {}
+ QItemSelection() noexcept : QList<QItemSelectionRange>() {}
QItemSelection(const QModelIndex &topLeft, const QModelIndex &bottomRight);
// reusing QList::swap() here is OK!
diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h
index e12a0c2928..ba85f22be3 100644
--- a/src/corelib/itemmodels/qitemselectionmodel_p.h
+++ b/src/corelib/itemmodels/qitemselectionmodel_p.h
@@ -62,7 +62,7 @@ class QItemSelectionModelPrivate: public QObjectPrivate
Q_DECLARE_PUBLIC(QItemSelectionModel)
public:
QItemSelectionModelPrivate()
- : model(0),
+ : model(nullptr),
currentCommand(QItemSelectionModel::NoUpdate),
tableSelected(false), tableColCount(0), tableRowCount(0) {}
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index d13e6199db..978102035e 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -64,11 +64,7 @@ struct QSortFilterProxyModelDataChanged
static inline QSet<int> qVectorToSet(const QVector<int> &vector)
{
- QSet<int> set;
- set.reserve(vector.size());
- for(int i=0; i < vector.size(); ++i)
- set << vector.at(i);
- return set;
+ return {vector.begin(), vector.end()};
}
class QSortFilterProxyModelLessThan
@@ -130,7 +126,7 @@ struct QRowsRemoval
{
}
- bool contains(QModelIndex parent, int row)
+ bool contains(QModelIndex parent, int row) const
{
do {
if (parent == parent_source)
@@ -381,6 +377,7 @@ public:
void sort();
bool update_source_sort_column();
+ int find_source_sort_column() const;
void sort_source_rows(QVector<int> &source_rows,
const QModelIndex &source_parent) const;
QVector<QPair<int, QVector<int > > > proxy_intervals_for_source_items_to_add(
@@ -470,8 +467,8 @@ bool QSortFilterProxyModelPrivate::filterRecursiveAcceptsRow(int source_row, con
void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source_parent)
{
if (Mapping *m = source_index_mapping.take(source_parent)) {
- for (int i = 0; i < m->mapped_children.size(); ++i)
- remove_from_mapping(m->mapped_children.at(i));
+ for (const QModelIndex &mappedIdx : qAsConst(m->mapped_children))
+ remove_from_mapping(mappedIdx);
delete m;
}
}
@@ -483,11 +480,8 @@ void QSortFilterProxyModelPrivate::_q_clearMapping()
qDeleteAll(source_index_mapping);
source_index_mapping.clear();
- if (dynamic_sortfilter && update_source_sort_column()) {
- //update_source_sort_column might have created wrong mapping so we have to clear it again
- qDeleteAll(source_index_mapping);
- source_index_mapping.clear();
- }
+ if (dynamic_sortfilter)
+ source_sort_column = find_source_sort_column();
// update the persistent indexes
update_persistent_indexes(source_indexes);
@@ -607,9 +601,9 @@ void QSortFilterProxyModelPrivate::sort()
Q_Q(QSortFilterProxyModel);
emit q->layoutAboutToBeChanged(QList<QPersistentModelIndex>(), QAbstractItemModel::VerticalSortHint);
QModelIndexPairList source_indexes = store_persistent_indexes();
- IndexMap::const_iterator it = source_index_mapping.constBegin();
- for (; it != source_index_mapping.constEnd(); ++it) {
- QModelIndex source_parent = it.key();
+ const auto end = source_index_mapping.constEnd();
+ for (auto it = source_index_mapping.constBegin(); it != end; ++it) {
+ const QModelIndex &source_parent = it.key();
Mapping *m = it.value();
sort_source_rows(m->source_rows, source_parent);
build_source_to_proxy_mapping(m->source_rows, m->proxy_rows);
@@ -644,6 +638,31 @@ bool QSortFilterProxyModelPrivate::update_source_sort_column()
return old_source_sort_column != source_sort_column;
}
+/*!
+ \internal
+
+ Find the source_sort_column without creating a full mapping and
+ without updating anything.
+*/
+int QSortFilterProxyModelPrivate::find_source_sort_column() const
+{
+ if (proxy_sort_column == -1)
+ return -1;
+
+ const QModelIndex rootIndex;
+ const int source_cols = model->columnCount();
+ int accepted_columns = -1;
+
+ Q_Q(const QSortFilterProxyModel);
+ for (int i = 0; i < source_cols; ++i) {
+ if (q->filterAcceptsColumn(i, rootIndex)) {
+ if (++accepted_columns == proxy_sort_column)
+ return i;
+ }
+ }
+
+ return -1;
+}
/*!
\internal
@@ -735,13 +754,14 @@ void QSortFilterProxyModelPrivate::remove_source_items(
if (!proxy_parent.isValid() && source_parent.isValid())
return; // nothing to do (already removed)
- QVector<QPair<int, int> > proxy_intervals;
- proxy_intervals = proxy_intervals_for_source_items(source_to_proxy, source_items);
+ const auto proxy_intervals = proxy_intervals_for_source_items(
+ source_to_proxy, source_items);
- for (int i = proxy_intervals.size()-1; i >= 0; --i) {
- QPair<int, int> interval = proxy_intervals.at(i);
- int proxy_start = interval.first;
- int proxy_end = interval.second;
+ const auto end = proxy_intervals.rend();
+ for (auto it = proxy_intervals.rbegin(); it != end; ++it) {
+ const QPair<int, int> &interval = *it;
+ const int proxy_start = interval.first;
+ const int proxy_end = interval.second;
remove_proxy_interval(source_to_proxy, proxy_to_source, proxy_start, proxy_end,
proxy_parent, orient, emit_signal);
}
@@ -875,15 +895,15 @@ void QSortFilterProxyModelPrivate::insert_source_items(
if (!proxy_parent.isValid() && source_parent.isValid())
return; // nothing to do (source_parent is not mapped)
- QVector<QPair<int, QVector<int> > > proxy_intervals;
- proxy_intervals = proxy_intervals_for_source_items_to_add(
+ const auto proxy_intervals = proxy_intervals_for_source_items_to_add(
proxy_to_source, source_items, source_parent, orient);
- for (int i = proxy_intervals.size()-1; i >= 0; --i) {
- QPair<int, QVector<int> > interval = proxy_intervals.at(i);
- int proxy_start = interval.first;
- QVector<int> source_items = interval.second;
- int proxy_end = proxy_start + source_items.size() - 1;
+ const auto end = proxy_intervals.rend();
+ for (auto it = proxy_intervals.rbegin(); it != end; ++it) {
+ const QPair<int, QVector<int> > &interval = *it;
+ const int proxy_start = interval.first;
+ const QVector<int> &source_items = interval.second;
+ const int proxy_end = proxy_start + source_items.size() - 1;
if (emit_signal) {
if (orient == Qt::Vertical)
@@ -1195,8 +1215,8 @@ QModelIndexPairList QSortFilterProxyModelPrivate::store_persistent_indexes() con
Q_Q(const QSortFilterProxyModel);
QModelIndexPairList source_indexes;
source_indexes.reserve(persistent.indexes.count());
- for (QPersistentModelIndexData *data : qAsConst(persistent.indexes)) {
- QModelIndex proxy_index = data->index;
+ for (const QPersistentModelIndexData *data : qAsConst(persistent.indexes)) {
+ const QModelIndex &proxy_index = data->index;
QModelIndex source_index = q->mapToSource(proxy_index);
source_indexes.append(qMakePair(proxy_index, QPersistentModelIndex(source_index)));
}
@@ -1217,9 +1237,9 @@ void QSortFilterProxyModelPrivate::update_persistent_indexes(
const int numSourceIndexes = source_indexes.count();
from.reserve(numSourceIndexes);
to.reserve(numSourceIndexes);
- for (int i = 0; i < numSourceIndexes; ++i) {
- QModelIndex source_index = source_indexes.at(i).second;
- QModelIndex old_proxy_index = source_indexes.at(i).first;
+ for (const auto &indexPair : source_indexes) {
+ const QPersistentModelIndex &source_index = indexPair.second;
+ const QModelIndex &old_proxy_index = indexPair.first;
create_mapping(source_index.parent());
QModelIndex proxy_index = q->mapFromSource(source_index);
from << old_proxy_index;
@@ -1264,7 +1284,7 @@ void QSortFilterProxyModelPrivate::filter_changed(const QModelIndex &source_pare
const QVector<QModelIndex> mappedChildren = m->mapped_children;
QVector<int> indexesToRemove;
for (int i = 0; i < mappedChildren.size(); ++i) {
- const QModelIndex source_child_index = mappedChildren.at(i);
+ const QModelIndex &source_child_index = mappedChildren.at(i);
if (rows_removed.contains(source_child_index.row()) || columns_removed.contains(source_child_index.column())) {
indexesToRemove.push_back(i);
remove_from_mapping(source_child_index);
@@ -1594,11 +1614,8 @@ void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersisten
update_persistent_indexes(saved_persistent_indexes);
saved_persistent_indexes.clear();
- if (dynamic_sortfilter && update_source_sort_column()) {
- //update_source_sort_column might have created wrong mapping so we have to clear it again
- qDeleteAll(source_index_mapping);
- source_index_mapping.clear();
- }
+ if (dynamic_sortfilter)
+ source_sort_column = find_source_sort_column();
emit q->layoutChanged(saved_layoutChange_parents);
saved_layoutChange_parents.clear();
@@ -2296,10 +2313,9 @@ QMimeData *QSortFilterProxyModel::mimeData(const QModelIndexList &indexes) const
{
Q_D(const QSortFilterProxyModel);
QModelIndexList source_indexes;
- const int numIndexes = indexes.count();
- source_indexes.reserve(numIndexes);
- for (int i = 0; i < numIndexes; ++i)
- source_indexes << mapToSource(indexes.at(i));
+ source_indexes.reserve(indexes.count());
+ for (const QModelIndex &idx : indexes)
+ source_indexes << mapToSource(idx);
return d->model->mimeData(source_indexes);
}
diff --git a/src/corelib/itemmodels/qtransposeproxymodel.h b/src/corelib/itemmodels/qtransposeproxymodel.h
index 879266d931..854a547fd4 100644
--- a/src/corelib/itemmodels/qtransposeproxymodel.h
+++ b/src/corelib/itemmodels/qtransposeproxymodel.h
@@ -43,6 +43,8 @@
#include <QtCore/qabstractproxymodel.h>
#include <QtCore/qscopedpointer.h>
+QT_REQUIRE_CONFIG(transposeproxymodel);
+
QT_BEGIN_NAMESPACE
class QTransposeProxyModelPrivate;
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 3f7bf3cd47..bd3cabc01a 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -7,7 +7,7 @@ HEADERS += \
kernel/qdeadlinetimer.h \
kernel/qdeadlinetimer_p.h \
kernel/qelapsedtimer.h \
- kernel/qeventloop.h\
+ kernel/qeventloop.h \
kernel/qpointer.h \
kernel/qcorecmdlineargs_p.h \
kernel/qcoreapplication.h \
@@ -88,8 +88,10 @@ win32 {
SOURCES += kernel/qeventdispatcher_winrt.cpp
HEADERS += kernel/qeventdispatcher_winrt_p.h
} else {
- SOURCES += kernel/qeventdispatcher_win.cpp
- HEADERS += kernel/qeventdispatcher_win_p.h
+ SOURCES += kernel/qeventdispatcher_win.cpp \
+ kernel/qwinregistry.cpp
+ HEADERS += kernel/qeventdispatcher_win_p.h \
+ kernel/qwinregistry_p.h
}
!winrt: LIBS_PRIVATE += -lversion
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index ea08ff571f..7215b3f2bd 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -170,7 +170,7 @@ QAbstractEventDispatcher::~QAbstractEventDispatcher()
QAbstractEventDispatcher *QAbstractEventDispatcher::instance(QThread *thread)
{
QThreadData *data = thread ? QThreadData::get2(thread) : QThreadData::current();
- return data->eventDispatcher.load();
+ return data->eventDispatcher.loadRelaxed();
}
/*!
@@ -470,7 +470,11 @@ void QAbstractEventDispatcher::removeNativeEventFilter(QAbstractNativeEventFilte
\sa installNativeEventFilter(), QAbstractNativeEventFilter::nativeEventFilter()
\since 5.0
*/
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QAbstractEventDispatcher::filterNativeEvent(const QByteArray &eventType, void *message, long *result)
+#endif
{
Q_D(QAbstractEventDispatcher);
if (!d->eventFilters.isEmpty()) {
diff --git a/src/corelib/kernel/qabstracteventdispatcher.h b/src/corelib/kernel/qabstracteventdispatcher.h
index bd8da5c35d..4ef9c068df 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.h
+++ b/src/corelib/kernel/qabstracteventdispatcher.h
@@ -110,7 +110,11 @@ public:
void installNativeEventFilter(QAbstractNativeEventFilter *filterObj);
void removeNativeEventFilter(QAbstractNativeEventFilter *filterObj);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result);
+#else
bool filterNativeEvent(const QByteArray &eventType, void *message, long *result);
+#endif
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED bool filterEvent(void *message)
{ return filterNativeEvent("", message, nullptr); }
diff --git a/src/corelib/kernel/qabstractnativeeventfilter.cpp b/src/corelib/kernel/qabstractnativeeventfilter.cpp
index dcbb92f044..eaadea4c12 100644
--- a/src/corelib/kernel/qabstractnativeeventfilter.cpp
+++ b/src/corelib/kernel/qabstractnativeeventfilter.cpp
@@ -74,6 +74,7 @@ QAbstractNativeEventFilter::~QAbstractNativeEventFilter()
eventDispatcher->removeNativeEventFilter(this);
}
+// ### fixme Qt 6: result will be qintptr *
/*!
\fn bool QAbstractNativeEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
diff --git a/src/corelib/kernel/qabstractnativeeventfilter.h b/src/corelib/kernel/qabstractnativeeventfilter.h
index d7baa42513..a468bffd61 100644
--- a/src/corelib/kernel/qabstractnativeeventfilter.h
+++ b/src/corelib/kernel/qabstractnativeeventfilter.h
@@ -52,7 +52,11 @@ public:
QAbstractNativeEventFilter();
virtual ~QAbstractNativeEventFilter();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ virtual bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) = 0;
+#else
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) = 0;
+#endif
private:
Q_DISABLE_COPY(QAbstractNativeEventFilter)
diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp
index 637c98cd40..ea8f8e2c77 100644
--- a/src/corelib/kernel/qbasictimer.cpp
+++ b/src/corelib/kernel/qbasictimer.cpp
@@ -65,6 +65,10 @@ QT_BEGIN_NAMESPACE
has not been stopped. The timer's ID can be retrieved using
timerId().
+ Objects of this class cannot be copied, but can be moved, so you
+ can maintain a list of basic timers by holding them in container
+ that supports move-only types, e.g. std::vector.
+
The \l{widgets/wiggly}{Wiggly} example uses QBasicTimer to repaint
a widget at regular intervals.
@@ -79,6 +83,51 @@ QT_BEGIN_NAMESPACE
\sa start()
*/
+
+/*!
+ \fn QBasicTimer::QBasicTimer(QBasicTimer &&other)
+ \since 5.14
+
+ Move-constructs a basic timer from \a other, which is left
+ \l{isActive()}{inactive}.
+
+ \sa isActive(), swap()
+*/
+
+/*!
+ \fn QBasicTimer &QBasicTimer::operator=(QBasicTimer &&other)
+ \since 5.14
+
+ Move-assigns \a other to this basic timer. The timer
+ previously represented by this basic timer is stopped.
+ \a other is left as \l{isActive()}{inactive}.
+
+ \sa stop(), isActive(), swap()
+*/
+
+#if QT_DEPRECATED_SINCE(5, 14)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/*!
+ \internal
+*/
+QBasicTimer::QBasicTimer(const QBasicTimer &other)
+ : id{other.id}
+{
+ qWarning("QBasicTimer can't be copied");
+}
+
+/*!
+ \internal
+*/
+QBasicTimer &QBasicTimer::operator=(const QBasicTimer &other)
+{
+ id = other.id;
+ qWarning("QBasicTimer can't be assigned to");
+ return *this;
+}
+#endif
+#endif
+
/*!
\fn QBasicTimer::~QBasicTimer()
@@ -95,6 +144,15 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QBasicTimer::swap(QBasicTimer &other)
+ \fn swap(QBasicTimer &lhs, QBasicTimer &rhs)
+ \since 5.14
+
+ Swaps string \a other with this string, or \a lhs with \a rhs.
+ This operation is very fast and never fails.
+*/
+
+/*!
\fn int QBasicTimer::timerId() const
Returns the timer's ID.
@@ -115,24 +173,7 @@ QT_BEGIN_NAMESPACE
*/
void QBasicTimer::start(int msec, QObject *obj)
{
- QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance();
- if (Q_UNLIKELY(!eventDispatcher)) {
- qWarning("QBasicTimer::start: QBasicTimer can only be used with threads started with QThread");
- return;
- }
- if (Q_UNLIKELY(obj && obj->thread() != eventDispatcher->thread())) {
- qWarning("QBasicTimer::start: Timers cannot be started from another thread");
- return;
- }
- if (id) {
- if (Q_LIKELY(eventDispatcher->unregisterTimer(id)))
- QAbstractEventDispatcherPrivate::releaseTimerId(id);
- else
- qWarning("QBasicTimer::start: Stopping previous timer failed. Possibly trying to stop from a different thread");
- }
- id = 0;
- if (obj)
- id = eventDispatcher->registerTimer(msec, Qt::CoarseTimer, obj);
+ start(msec, Qt::CoarseTimer, obj);
}
/*!
@@ -161,13 +202,7 @@ void QBasicTimer::start(int msec, Qt::TimerType timerType, QObject *obj)
qWarning("QBasicTimer::start: Timers cannot be started from another thread");
return;
}
- if (id) {
- if (Q_LIKELY(eventDispatcher->unregisterTimer(id)))
- QAbstractEventDispatcherPrivate::releaseTimerId(id);
- else
- qWarning("QBasicTimer::start: Stopping previous timer failed. Possibly trying to stop from a different thread");
- }
- id = 0;
+ stop();
if (obj)
id = eventDispatcher->registerTimer(msec, timerType, obj);
}
diff --git a/src/corelib/kernel/qbasictimer.h b/src/corelib/kernel/qbasictimer.h
index bfd6ffd125..769898f835 100644
--- a/src/corelib/kernel/qbasictimer.h
+++ b/src/corelib/kernel/qbasictimer.h
@@ -51,12 +51,35 @@ class QObject;
class Q_CORE_EXPORT QBasicTimer
{
int id;
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+ Q_DISABLE_COPY(QBasicTimer)
+#elif QT_DEPRECATED_SINCE(5, 14)
public:
- inline QBasicTimer() : id(0) {}
+ // Just here to preserve BC, we can't remove them yet
+ QT_DEPRECATED_X("copy-construction is unsupported; use move-construction instead")
+ QBasicTimer(const QBasicTimer &);
+ QT_DEPRECATED_X("copy-assignment is unsupported; use move-assignment instead")
+ QBasicTimer &operator=(const QBasicTimer &);
+#endif
+
+public:
+ constexpr QBasicTimer() noexcept : id{0} {}
inline ~QBasicTimer() { if (id) stop(); }
- inline bool isActive() const { return id != 0; }
- inline int timerId() const { return id; }
+ QBasicTimer(QBasicTimer &&other) noexcept
+ : id{qExchange(other.id, 0)}
+ {}
+
+ QBasicTimer& operator=(QBasicTimer &&other) noexcept
+ {
+ QBasicTimer{std::move(other)}.swap(*this);
+ return *this;
+ }
+
+ void swap(QBasicTimer &other) noexcept { qSwap(id, other.id); }
+
+ bool isActive() const noexcept { return id != 0; }
+ int timerId() const noexcept { return id; }
void start(int msec, QObject *obj);
void start(int msec, Qt::TimerType timerType, QObject *obj);
@@ -64,6 +87,8 @@ public:
};
Q_DECLARE_TYPEINFO(QBasicTimer, Q_MOVABLE_TYPE);
+inline void swap(QBasicTimer &lhs, QBasicTimer &rhs) noexcept { lhs.swap(rhs); }
+
QT_END_NAMESPACE
#endif // QBASICTIMER_H
diff --git a/src/corelib/kernel/qcore_foundation.mm b/src/corelib/kernel/qcore_foundation.mm
index 56eabc4b8c..623d462749 100644
--- a/src/corelib/kernel/qcore_foundation.mm
+++ b/src/corelib/kernel/qcore_foundation.mm
@@ -501,7 +501,7 @@ NSTimeZone *QTimeZone::toNSTimeZone() const
\sa QRectF::fromCGRect()
*/
-CGRect QRect::toCGRect() const Q_DECL_NOTHROW
+CGRect QRect::toCGRect() const noexcept
{
return CGRectMake(x(), y(), width(), height());
}
@@ -513,7 +513,7 @@ CGRect QRect::toCGRect() const Q_DECL_NOTHROW
\sa fromCGRect()
*/
-CGRect QRectF::toCGRect() const Q_DECL_NOTHROW
+CGRect QRectF::toCGRect() const noexcept
{
return CGRectMake(x(), y(), width(), height());
}
@@ -525,7 +525,7 @@ CGRect QRectF::toCGRect() const Q_DECL_NOTHROW
\sa toCGRect()
*/
-QRectF QRectF::fromCGRect(CGRect rect) Q_DECL_NOTHROW
+QRectF QRectF::fromCGRect(CGRect rect) noexcept
{
return QRectF(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
}
@@ -539,7 +539,7 @@ QRectF QRectF::fromCGRect(CGRect rect) Q_DECL_NOTHROW
\sa QPointF::fromCGPoint()
*/
-CGPoint QPoint::toCGPoint() const Q_DECL_NOTHROW
+CGPoint QPoint::toCGPoint() const noexcept
{
return CGPointMake(x(), y());
}
@@ -551,7 +551,7 @@ CGPoint QPoint::toCGPoint() const Q_DECL_NOTHROW
\sa fromCGPoint()
*/
-CGPoint QPointF::toCGPoint() const Q_DECL_NOTHROW
+CGPoint QPointF::toCGPoint() const noexcept
{
return CGPointMake(x(), y());
}
@@ -563,7 +563,7 @@ CGPoint QPointF::toCGPoint() const Q_DECL_NOTHROW
\sa toCGPoint()
*/
-QPointF QPointF::fromCGPoint(CGPoint point) Q_DECL_NOTHROW
+QPointF QPointF::fromCGPoint(CGPoint point) noexcept
{
return QPointF(point.x, point.y);
}
@@ -577,7 +577,7 @@ QPointF QPointF::fromCGPoint(CGPoint point) Q_DECL_NOTHROW
\sa QSizeF::fromCGSize()
*/
-CGSize QSize::toCGSize() const Q_DECL_NOTHROW
+CGSize QSize::toCGSize() const noexcept
{
return CGSizeMake(width(), height());
}
@@ -589,7 +589,7 @@ CGSize QSize::toCGSize() const Q_DECL_NOTHROW
\sa fromCGSize()
*/
-CGSize QSizeF::toCGSize() const Q_DECL_NOTHROW
+CGSize QSizeF::toCGSize() const noexcept
{
return CGSizeMake(width(), height());
}
@@ -601,7 +601,7 @@ CGSize QSizeF::toCGSize() const Q_DECL_NOTHROW
\sa toCGSize()
*/
-QSizeF QSizeF::fromCGSize(CGSize size) Q_DECL_NOTHROW
+QSizeF QSizeF::fromCGSize(CGSize size) noexcept
{
return QSizeF(size.width, size.height);
}
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp
index b048576f5b..e59835be48 100644
--- a/src/corelib/kernel/qcore_mac.cpp
+++ b/src/corelib/kernel/qcore_mac.cpp
@@ -44,6 +44,7 @@
#include "qpair.h"
#include "qmutex.h"
#include "qvarlengtharray.h"
+#include "private/qlocking_p.h"
QT_BEGIN_NAMESPACE
@@ -135,7 +136,7 @@ os_log_type_t AppleUnifiedLogger::logTypeForMessageType(QtMsgType msgType)
os_log_t AppleUnifiedLogger::cachedLog(const QString &subsystem, const QString &category)
{
static QBasicMutex mutex;
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
static QHash<QPair<QString, QString>, os_log_t> logs;
const auto cacheKey = qMakePair(subsystem, category);
diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
index 15df303502..b1f3b74cd4 100644
--- a/src/corelib/kernel/qcore_mac_objc.mm
+++ b/src/corelib/kernel/qcore_mac_objc.mm
@@ -211,6 +211,12 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool)
debug << "QMacAutoReleasePool(" << (const void *)pool << ')';
return debug;
}
+
+QDebug operator<<(QDebug debug, const QCFString &string)
+{
+ debug << static_cast<QString>(string);
+ return debug;
+}
#endif // !QT_NO_DEBUG_STREAM
#ifdef Q_OS_MACOS
@@ -371,7 +377,7 @@ bool operator<(const KeyPair &entry, const Qt::Key &key)
struct qtKey2CocoaKeySortLessThan
{
typedef bool result_type;
- Q_DECL_CONSTEXPR result_type operator()(const KeyPair &entry1, const KeyPair &entry2) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR result_type operator()(const KeyPair &entry1, const KeyPair &entry2) const noexcept
{
return entry1.qtKey < entry2.qtKey;
}
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 168e0418e4..535d3579b2 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -86,16 +86,24 @@ template <typename T, typename U, U (*RetainFunction)(U), void (*ReleaseFunction
class QAppleRefCounted
{
public:
- QAppleRefCounted(const T &t = T()) : value(t) {}
- QAppleRefCounted(QAppleRefCounted &&other) : value(other.value) { other.value = T(); }
+ QAppleRefCounted() : value() {}
+ QAppleRefCounted(const T &t) : value(t) {}
+ QAppleRefCounted(T &&t) noexcept(std::is_nothrow_move_constructible<T>::value)
+ : value(std::move(t)) {}
+ QAppleRefCounted(QAppleRefCounted &&other)
+ noexcept(std::is_nothrow_move_assignable<T>::value &&
+ std::is_nothrow_move_constructible<T>::value)
+ : value(qExchange(other.value, T())) {}
QAppleRefCounted(const QAppleRefCounted &other) : value(other.value) { if (value) RetainFunction(value); }
~QAppleRefCounted() { if (value) ReleaseFunction(value); }
operator T() const { return value; }
- void swap(QAppleRefCounted &other) Q_DECL_NOEXCEPT_EXPR(noexcept(qSwap(value, other.value)))
+ void swap(QAppleRefCounted &other) noexcept(noexcept(qSwap(value, other.value)))
{ qSwap(value, other.value); }
QAppleRefCounted &operator=(const QAppleRefCounted &other)
{ QAppleRefCounted copy(other); swap(copy); return *this; }
QAppleRefCounted &operator=(QAppleRefCounted &&other)
+ noexcept(std::is_nothrow_move_assignable<T>::value &&
+ std::is_nothrow_move_constructible<T>::value)
{ QAppleRefCounted moved(std::move(other)); swap(moved); return *this; }
T *operator&() { return &value; }
protected:
@@ -129,8 +137,10 @@ private:
template <typename T>
class QCFType : public QAppleRefCounted<T, CFTypeRef, CFRetain, CFRelease>
{
+ using Base = QAppleRefCounted<T, CFTypeRef, CFRetain, CFRelease>;
public:
- using QAppleRefCounted<T, CFTypeRef, CFRetain, CFRelease>::QAppleRefCounted;
+ using Base::Base;
+ explicit QCFType(CFTypeRef r) : Base(static_cast<T>(r)) {}
template <typename X> X as() const { return reinterpret_cast<X>(this->value); }
static QCFType constructFromGet(const T &t)
{
@@ -143,6 +153,7 @@ public:
class Q_CORE_EXPORT QCFString : public QCFType<CFStringRef>
{
public:
+ using QCFType<CFStringRef>::QCFType;
inline QCFString(const QString &str) : QCFType<CFStringRef>(0), string(str) {}
inline QCFString(const CFStringRef cfstr = 0) : QCFType<CFStringRef>(cfstr) {}
inline QCFString(const QCFType<CFStringRef> &other) : QCFType<CFStringRef>(other) {}
@@ -160,7 +171,8 @@ Q_CORE_EXPORT bool qt_mac_applicationIsInDarkMode();
#endif
#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool);
+Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool);
+Q_CORE_EXPORT QDebug operator<<(QDebug debug, const QCFString &string);
#endif
Q_CORE_EXPORT bool qt_apple_isApplicationExtension();
diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp
index 18c031f137..ff0c957770 100644
--- a/src/corelib/kernel/qcore_unix.cpp
+++ b/src/corelib/kernel/qcore_unix.cpp
@@ -132,8 +132,10 @@ static inline int qt_ppoll(struct pollfd *fds, nfds_t nfds, const struct timespe
return ::ppoll(fds, nfds, timeout_ts, nullptr);
#elif QT_CONFIG(poll_poll)
return ::poll(fds, nfds, timespecToMillisecs(timeout_ts));
-#else
+#elif QT_CONFIG(poll_select)
return qt_poll(fds, nfds, timeout_ts);
+#else
+ // configure.json reports an error when everything is not available
#endif
}
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 5a2a29a327..6ec7d28318 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -52,8 +52,8 @@
// We mean it.
//
-#include <QtCore/private/qglobal_p.h>
#include "qplatformdefs.h"
+#include <QtCore/private/qglobal_p.h>
#include "qatomic.h"
#include "qbytearray.h"
@@ -164,15 +164,15 @@ inline void qt_ignore_sigpipe()
{
// Set to ignore SIGPIPE once only.
static QBasicAtomicInt atom = Q_BASIC_ATOMIC_INITIALIZER(0);
- if (!atom.load()) {
+ if (!atom.loadRelaxed()) {
// More than one thread could turn off SIGPIPE at the same time
// But that's acceptable because they all would be doing the same
// action
struct sigaction noaction;
memset(&noaction, 0, sizeof(noaction));
noaction.sa_handler = SIG_IGN;
- ::sigaction(SIGPIPE, &noaction, 0);
- atom.store(1);
+ ::sigaction(SIGPIPE, &noaction, nullptr);
+ atom.storeRelaxed(1);
}
}
@@ -347,7 +347,7 @@ static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options)
#endif
// in qelapsedtimer_mac.cpp or qtimestamp_unix.cpp
-timespec qt_gettime() Q_DECL_NOTHROW;
+timespec qt_gettime() noexcept;
void qt_nanosleep(timespec amount);
QByteArray qt_readlink(const char *path);
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 75597f8739..e25049f821 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -55,6 +55,7 @@
#include <qfileinfo.h>
#include <qmutex.h>
#include <private/qloggingregistry_p.h>
+#include <qscopeguard.h>
#include <qstandardpaths.h>
#ifndef QT_NO_QOBJECT
#include <qthread.h>
@@ -70,6 +71,7 @@
#include <private/qfactoryloader_p.h>
#include <private/qfunctions_p.h>
#include <private/qlocale_p.h>
+#include <private/qlocking_p.h>
#include <private/qhooks_p.h>
#ifndef QT_NO_QOBJECT
@@ -217,16 +219,25 @@ QString QCoreApplicationPrivate::appVersion() const
}
#endif
-QString *QCoreApplicationPrivate::cachedApplicationFilePath = 0;
+QString *QCoreApplicationPrivate::cachedApplicationFilePath = nullptr;
bool QCoreApplicationPrivate::checkInstance(const char *function)
{
- bool b = (QCoreApplication::self != 0);
+ bool b = (QCoreApplication::self != nullptr);
if (!b)
qWarning("QApplication::%s: Please instantiate the QApplication object first", function);
return b;
}
+#if QT_CONFIG(commandlineparser)
+void QCoreApplicationPrivate::addQtOptions(QList<QCommandLineOption> *options)
+{
+ options->append(QCommandLineOption(QStringLiteral("qmljsdebugger"),
+ QStringLiteral("Activates the QML/JS debugger with a specified port. The value must be of format port:1234[,block]. \"block\" makes the application wait for a connection."),
+ QStringLiteral("value")));
+}
+#endif
+
void QCoreApplicationPrivate::processCommandLineArguments()
{
int j = argc ? 1 : 0;
@@ -251,22 +262,13 @@ void QCoreApplicationPrivate::processCommandLineArguments()
}
if (j < argc) {
- argv[j] = 0;
+ argv[j] = nullptr;
argc = j;
}
}
// Support for introspection
-#ifndef QT_NO_QOBJECT
-QSignalSpyCallbackSet Q_CORE_EXPORT qt_signal_spy_callback_set = { 0, 0, 0, 0 };
-
-void qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet &callback_set)
-{
- qt_signal_spy_callback_set = callback_set;
-}
-#endif
-
extern "C" void Q_CORE_EXPORT qt_startup_hook()
{
}
@@ -294,7 +296,7 @@ void qAddPreRoutine(QtStartUpFunction p)
// Due to C++11 parallel dynamic initialization, this can be called
// from multiple threads.
- QMutexLocker locker(&globalRoutinesMutex);
+ const auto locker = qt_scoped_lock(globalRoutinesMutex);
list->prepend(p); // in case QCoreApplication is re-created, see qt_call_pre_routines
}
@@ -303,7 +305,7 @@ void qAddPostRoutine(QtCleanUpFunction p)
QVFuncList *list = postRList();
if (!list)
return;
- QMutexLocker locker(&globalRoutinesMutex);
+ const auto locker = qt_scoped_lock(globalRoutinesMutex);
list->prepend(p);
}
@@ -312,7 +314,7 @@ void qRemovePostRoutine(QtCleanUpFunction p)
QVFuncList *list = postRList();
if (!list)
return;
- QMutexLocker locker(&globalRoutinesMutex);
+ const auto locker = qt_scoped_lock(globalRoutinesMutex);
list->removeAll(p);
}
@@ -323,7 +325,7 @@ static void qt_call_pre_routines()
QVFuncList list;
{
- QMutexLocker locker(&globalRoutinesMutex);
+ const auto locker = qt_scoped_lock(globalRoutinesMutex);
// Unlike qt_call_post_routines, we don't empty the list, because
// Q_COREAPP_STARTUP_FUNCTION is a macro, so the user expects
// the function to be executed every time QCoreApplication is created.
@@ -342,7 +344,7 @@ void Q_CORE_EXPORT qt_call_post_routines()
QVFuncList list;
{
// extract the current list and make the stored list empty
- QMutexLocker locker(&globalRoutinesMutex);
+ const auto locker = qt_scoped_lock(globalRoutinesMutex);
qSwap(*postRList, list);
}
@@ -370,25 +372,25 @@ Q_CORE_EXPORT uint qGlobalPostedEventsCount()
return currentThreadData->postEventList.size() - currentThreadData->postEventList.startOffset;
}
-QAbstractEventDispatcher *QCoreApplicationPrivate::eventDispatcher = 0;
+QAbstractEventDispatcher *QCoreApplicationPrivate::eventDispatcher = nullptr;
#endif // QT_NO_QOBJECT
-QCoreApplication *QCoreApplication::self = 0;
+QCoreApplication *QCoreApplication::self = nullptr;
uint QCoreApplicationPrivate::attribs =
(1 << Qt::AA_SynthesizeMouseForUnhandledTouchEvents) |
(1 << Qt::AA_SynthesizeMouseForUnhandledTabletEvents);
struct QCoreApplicationData {
- QCoreApplicationData() Q_DECL_NOTHROW {
+ QCoreApplicationData() noexcept {
applicationNameSet = false;
applicationVersionSet = false;
}
~QCoreApplicationData() {
#ifndef QT_NO_QOBJECT
// cleanup the QAdoptedThread created for the main() thread
- if (QCoreApplicationPrivate::theMainThread) {
- QThreadData *data = QThreadData::get2(QCoreApplicationPrivate::theMainThread);
+ if (auto *t = QCoreApplicationPrivate::theMainThread.loadAcquire()) {
+ QThreadData *data = QThreadData::get2(t);
data->deref(); // deletes the data and the adopted thread
}
#endif
@@ -458,12 +460,12 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
, aboutToQuitEmitted(false)
, threadData_clean(false)
#else
- , q_ptr(0)
+ , q_ptr(nullptr)
#endif
{
app_compile_version = flags & 0xffffff;
static const char *const empty = "";
- if (argc == 0 || argv == 0) {
+ if (argc == 0 || argv == nullptr) {
argc = 0;
argv = const_cast<char **>(&empty);
}
@@ -488,7 +490,7 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint
#endif
QThread *cur = QThread::currentThread(); // note: this may end up setting theMainThread!
- if (cur != theMainThread)
+ if (cur != theMainThread.loadAcquire())
qWarning("WARNING: QApplication was not created in the main() thread.");
#endif
}
@@ -522,7 +524,7 @@ void QCoreApplicationPrivate::cleanupThreadData()
#endif
// need to clear the state of the mainData, just in case a new QCoreApplication comes along.
- QMutexLocker locker(&threadData->postEventList.mutex);
+ const auto locker = qt_scoped_lock(threadData->postEventList.mutex);
for (int i = 0; i < threadData->postEventList.size(); ++i) {
const QPostEvent &pe = threadData->postEventList.at(i);
if (pe.event) {
@@ -554,8 +556,8 @@ void QCoreApplicationPrivate::eventDispatcherReady()
QBasicAtomicPointer<QThread> QCoreApplicationPrivate::theMainThread = Q_BASIC_ATOMIC_INITIALIZER(0);
QThread *QCoreApplicationPrivate::mainThread()
{
- Q_ASSERT(theMainThread.load() != 0);
- return theMainThread.load();
+ Q_ASSERT(theMainThread.loadRelaxed() != 0);
+ return theMainThread.loadRelaxed();
}
bool QCoreApplicationPrivate::threadRequiresCoreApplication()
@@ -856,7 +858,7 @@ void QCoreApplicationPrivate::init()
#ifndef QT_NO_QOBJECT
// use the event dispatcher created by the app programmer (if any)
Q_ASSERT(!eventDispatcher);
- eventDispatcher = threadData->eventDispatcher.load();
+ eventDispatcher = threadData->eventDispatcher.loadRelaxed();
// otherwise we create one
if (!eventDispatcher)
@@ -864,7 +866,7 @@ void QCoreApplicationPrivate::init()
Q_ASSERT(eventDispatcher);
if (!eventDispatcher->parent()) {
- eventDispatcher->moveToThread(threadData->thread);
+ eventDispatcher->moveToThread(threadData->thread.loadAcquire());
eventDispatcher->setParent(q);
}
@@ -872,11 +874,6 @@ void QCoreApplicationPrivate::init()
eventDispatcherReady();
#endif
-#ifdef QT_EVAL
- extern void qt_core_eval_init(QCoreApplicationPrivate::Type);
- qt_core_eval_init(application_type);
-#endif
-
processCommandLineArguments();
qt_call_pre_routines();
@@ -898,7 +895,7 @@ QCoreApplication::~QCoreApplication()
{
qt_call_post_routines();
- self = 0;
+ self = nullptr;
#ifndef QT_NO_QOBJECT
QCoreApplicationPrivate::is_app_closing = true;
QCoreApplicationPrivate::is_app_running = false;
@@ -906,7 +903,7 @@ QCoreApplication::~QCoreApplication()
#if QT_CONFIG(thread)
// Synchronize and stop the global thread pool threads.
- QThreadPool *globalThreadPool = 0;
+ QThreadPool *globalThreadPool = nullptr;
QT_TRY {
globalThreadPool = QThreadPool::globalInstance();
} QT_CATCH (...) {
@@ -917,10 +914,10 @@ QCoreApplication::~QCoreApplication()
#endif
#ifndef QT_NO_QOBJECT
- d_func()->threadData->eventDispatcher = 0;
+ d_func()->threadData->eventDispatcher = nullptr;
if (QCoreApplicationPrivate::eventDispatcher)
QCoreApplicationPrivate::eventDispatcher->closingDown();
- QCoreApplicationPrivate::eventDispatcher = 0;
+ QCoreApplicationPrivate::eventDispatcher = nullptr;
#endif
#if QT_CONFIG(library)
@@ -1188,7 +1185,7 @@ static bool doNotify(QObject *receiver, QEvent *event)
bool QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject *receiver, QEvent *event)
{
// We can't access the application event filters outside of the main thread (race conditions)
- Q_ASSERT(receiver->d_func()->threadData->thread == mainThread());
+ Q_ASSERT(receiver->d_func()->threadData->thread.loadAcquire() == mainThread());
if (extraData) {
// application event filters are only called for objects in the GUI thread
@@ -1241,7 +1238,7 @@ bool QCoreApplicationPrivate::notify_helper(QObject *receiver, QEvent * event)
// send to all application event filters (only does anything in the main thread)
if (QCoreApplication::self
- && receiver->d_func()->threadData->thread == mainThread()
+ && receiver->d_func()->threadData->thread.loadAcquire() == mainThread()
&& QCoreApplication::self->d_func()->sendThroughApplicationEventFilters(receiver, event)) {
filtered = true;
return filtered;
@@ -1313,7 +1310,7 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags)
QThreadData *data = QThreadData::current();
if (!data->hasEventDispatcher())
return;
- data->eventDispatcher.load()->processEvents(flags);
+ data->eventDispatcher.loadRelaxed()->processEvents(flags);
}
/*!
@@ -1345,7 +1342,7 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags, int m
return;
QElapsedTimer start;
start.start();
- while (data->eventDispatcher.load()->processEvents(flags & ~QEventLoop::WaitForMoreEvents)) {
+ while (data->eventDispatcher.loadRelaxed()->processEvents(flags & ~QEventLoop::WaitForMoreEvents)) {
if (start.elapsed() > ms)
break;
}
@@ -1710,7 +1707,7 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
++data->postEventList.recursion;
- QMutexLocker locker(&data->postEventList.mutex);
+ auto locker = qt_unique_lock(data->postEventList.mutex);
// by default, we assume that the event dispatcher can go to sleep after
// processing all events. if any new events are posted while we send
@@ -1749,7 +1746,7 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
--data->postEventList.recursion;
if (!data->postEventList.recursion && !data->canWait && data->hasEventDispatcher())
- data->eventDispatcher.load()->wakeUp();
+ data->eventDispatcher.loadRelaxed()->wakeUp();
// clear the global list, i.e. remove everything that was
// delivered.
@@ -1826,13 +1823,8 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
// for the next event.
const_cast<QPostEvent &>(pe).event = 0;
- struct MutexUnlocker
- {
- QMutexLocker &m;
- MutexUnlocker(QMutexLocker &m) : m(m) { m.unlock(); }
- ~MutexUnlocker() { m.relock(); }
- };
- MutexUnlocker unlocker(locker);
+ locker.unlock();
+ const auto relocker = qScopeGuard([&locker] { locker.lock(); });
QScopedPointer<QEvent> event_deleter(e); // will delete the event (with the mutex unlocked)
@@ -1869,7 +1861,7 @@ void QCoreApplicationPrivate::sendPostedEvents(QObject *receiver, int event_type
void QCoreApplication::removePostedEvents(QObject *receiver, int eventType)
{
QThreadData *data = receiver ? receiver->d_func()->threadData : QThreadData::current();
- QMutexLocker locker(&data->postEventList.mutex);
+ auto locker = qt_unique_lock(data->postEventList.mutex);
// the QObject destructor calls this function directly. this can
// happen while the event loop is in the middle of posting events,
@@ -1932,7 +1924,7 @@ void QCoreApplicationPrivate::removePostedEvent(QEvent * event)
QThreadData *data = QThreadData::current();
- QMutexLocker locker(&data->postEventList.mutex);
+ const auto locker = qt_scoped_lock(data->postEventList.mutex);
if (data->postEventList.size() == 0) {
#if defined(QT_DEBUG)
@@ -2000,7 +1992,7 @@ void QCoreApplicationPrivate::deref()
void QCoreApplicationPrivate::maybeQuit()
{
- if (quitLockRef.load() == 0 && in_exec && quitLockRefEnabled && shouldQuit())
+ if (quitLockRef.loadRelaxed() == 0 && in_exec && quitLockRefEnabled && shouldQuit())
QCoreApplication::postEvent(QCoreApplication::instance(), new QEvent(QEvent::Quit));
}
@@ -2662,7 +2654,7 @@ QString QCoreApplication::applicationVersion()
#if QT_CONFIG(library)
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, libraryPathMutex)
/*!
Returns a list of paths that the application will search when
@@ -2701,7 +2693,14 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
QStringList QCoreApplication::libraryPaths()
{
QMutexLocker locker(libraryPathMutex());
+ return libraryPathsLocked();
+}
+/*!
+ \internal
+*/
+QStringList QCoreApplication::libraryPathsLocked()
+{
if (coreappdata()->manual_libpaths)
return *(coreappdata()->manual_libpaths);
@@ -2709,18 +2708,22 @@ QStringList QCoreApplication::libraryPaths()
QStringList *app_libpaths = new QStringList;
coreappdata()->app_libpaths.reset(app_libpaths);
- QString libPathEnv = qEnvironmentVariable("QT_PLUGIN_PATH");
- if (!libPathEnv.isEmpty()) {
- QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
- for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
- QString canonicalPath = QDir(*it).canonicalPath();
- if (!canonicalPath.isEmpty()
- && !app_libpaths->contains(canonicalPath)) {
- app_libpaths->append(canonicalPath);
+ auto setPathsFromEnv = [&](QString libPathEnv) {
+ if (!libPathEnv.isEmpty()) {
+ QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
+ for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
+ QString canonicalPath = QDir(*it).canonicalPath();
+ if (!canonicalPath.isEmpty()
+ && !app_libpaths->contains(canonicalPath)) {
+ app_libpaths->append(canonicalPath);
+ }
}
}
- }
-
+ };
+ setPathsFromEnv(qEnvironmentVariable("QT_PLUGIN_PATH"));
+#ifdef Q_OS_ANDROID
+ setPathsFromEnv(qEnvironmentVariable("QT_BUNDLED_LIBS_PATH"));
+#endif
#ifdef Q_OS_DARWIN
// Check the main bundle's PlugIns directory as this is a standard location for Apple OSes.
// Note that the QLibraryInfo::PluginsPath below will coincidentally be the same as this value
@@ -2777,7 +2780,7 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths)
// When the application is constructed it should still amend the paths. So we keep the originals
// around, and even create them if they don't exist, yet.
if (!coreappdata()->app_libpaths)
- libraryPaths();
+ libraryPathsLocked();
if (coreappdata()->manual_libpaths)
*(coreappdata()->manual_libpaths) = paths;
@@ -2820,7 +2823,7 @@ void QCoreApplication::addLibraryPath(const QString &path)
return;
} else {
// make sure that library paths are initialized
- libraryPaths();
+ libraryPathsLocked();
QStringList *app_libpaths = coreappdata()->app_libpaths.data();
if (app_libpaths->contains(canonicalPath))
return;
@@ -2859,7 +2862,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
return;
} else {
// make sure that library paths is initialized
- libraryPaths();
+ libraryPathsLocked();
QStringList *app_libpaths = coreappdata()->app_libpaths.data();
if (!app_libpaths->contains(canonicalPath))
return;
@@ -2912,7 +2915,7 @@ void QCoreApplication::installNativeEventFilter(QAbstractNativeEventFilter *filt
return;
}
- QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(QCoreApplicationPrivate::theMainThread);
+ QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(QCoreApplicationPrivate::theMainThread.loadAcquire());
if (!filterObj || !eventDispatcher)
return;
eventDispatcher->installNativeEventFilter(filterObj);
@@ -2968,8 +2971,8 @@ bool QCoreApplication::hasPendingEvents()
*/
QAbstractEventDispatcher *QCoreApplication::eventDispatcher()
{
- if (QCoreApplicationPrivate::theMainThread)
- return QCoreApplicationPrivate::theMainThread.load()->eventDispatcher();
+ if (QCoreApplicationPrivate::theMainThread.loadAcquire())
+ return QCoreApplicationPrivate::theMainThread.loadRelaxed()->eventDispatcher();
return 0;
}
@@ -2981,7 +2984,7 @@ QAbstractEventDispatcher *QCoreApplication::eventDispatcher()
*/
void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher)
{
- QThread *mainThread = QCoreApplicationPrivate::theMainThread;
+ QThread *mainThread = QCoreApplicationPrivate::theMainThread.loadAcquire();
if (!mainThread)
mainThread = QThread::currentThread(); // will also setup theMainThread
mainThread->setEventDispatcher(eventDispatcher);
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 3581970765..71ea124fbe 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -208,6 +208,9 @@ private:
static bool notifyInternal2(QObject *receiver, QEvent *);
static bool forwardEvent(QObject *receiver, QEvent *event, QEvent *originatingEvent = nullptr);
#endif
+#if QT_CONFIG(library)
+ static QStringList libraryPathsLocked();
+#endif
static QCoreApplication *self;
@@ -227,6 +230,7 @@ private:
#endif
friend Q_CORE_EXPORT QString qAppName();
friend class QClassFactory;
+ friend class QCommandLineParserPrivate;
};
#ifdef QT_NO_DEPRECATED
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index b3479414ab..3bad42d076 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -52,6 +52,9 @@
//
#include "QtCore/qcoreapplication.h"
+#if QT_CONFIG(commandlineparser)
+#include "QtCore/qcommandlineoption.h"
+#endif
#include "QtCore/qtranslator.h"
#if QT_CONFIG(settings)
#include "QtCore/qsettings.h"
@@ -84,6 +87,11 @@ public:
};
QCoreApplicationPrivate(int &aargc, char **aargv, uint flags);
+
+ // If not inheriting from QObjectPrivate: force this class to be polymorphic
+#ifdef QT_NO_QOBJECT
+ virtual
+#endif
~QCoreApplicationPrivate();
void init();
@@ -99,6 +107,10 @@ public:
static bool checkInstance(const char *method);
+#if QT_CONFIG(commandlineparser)
+ virtual void addQtOptions(QList<QCommandLineOption> *options);
+#endif
+
#ifndef QT_NO_QOBJECT
bool sendThroughApplicationEventFilters(QObject *, QEvent *);
static bool sendThroughObjectEventFilters(QObject *, QEvent *);
@@ -149,7 +161,7 @@ public:
QString cachedApplicationDirPath;
static QString *cachedApplicationFilePath;
static void setApplicationFilePath(const QString &path);
- static inline void clearApplicationFilePath() { delete cachedApplicationFilePath; cachedApplicationFilePath = 0; }
+ static inline void clearApplicationFilePath() { delete cachedApplicationFilePath; cachedApplicationFilePath = nullptr; }
#ifndef QT_NO_QOBJECT
void execCleanup();
diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp
index 4f4a29b41b..961b96710e 100644
--- a/src/corelib/kernel/qcoreapplication_win.cpp
+++ b/src/corelib/kernel/qcoreapplication_win.cpp
@@ -47,6 +47,7 @@
#ifndef QT_NO_QOBJECT
#include "qmutex.h"
#include <private/qthread_p.h>
+#include <private/qlocking_p.h>
#endif
#include "qtextstream.h"
#include <ctype.h>
@@ -64,8 +65,6 @@ using namespace Microsoft::WRL::Wrappers;
QT_BEGIN_NAMESPACE
-int appCmdShow = 0;
-
Q_CORE_EXPORT QString qAppFileName() // get application file name
{
/*
@@ -175,16 +174,12 @@ Q_CORE_EXPORT HINSTANCE qWinAppPrevInst() // get Windows prev app
Q_CORE_EXPORT int qWinAppCmdShow() // get main window show command
{
-#if defined(Q_OS_WINCE)
- return appCmdShow;
-#else
STARTUPINFO startupInfo;
GetStartupInfo(&startupInfo);
return (startupInfo.dwFlags & STARTF_USESHOWWINDOW)
? startupInfo.wShowWindow
: SW_SHOWDEFAULT;
-#endif
}
#endif
@@ -925,7 +920,7 @@ void QCoreApplicationPrivate::removePostedTimerEvent(QObject *object, int timerI
{
QThreadData *data = object->d_func()->threadData;
- QMutexLocker locker(&data->postEventList.mutex);
+ const auto locker = qt_scoped_lock(data->postEventList.mutex);
if (data->postEventList.size() == 0)
return;
for (int i = 0; i < data->postEventList.size(); ++i) {
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index cacbb1e495..4cfc749386 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -421,10 +421,10 @@ struct QBasicAtomicBitField {
QBasicAtomicInteger<uint> next;
QBasicAtomicInteger<uint> data[NumInts];
- bool allocateSpecific(int which) Q_DECL_NOTHROW
+ bool allocateSpecific(int which) noexcept
{
QBasicAtomicInteger<uint> &entry = data[which / BitsPerInt];
- const uint old = entry.load();
+ const uint old = entry.loadRelaxed();
const uint bit = 1U << (which % BitsPerInt);
return !(old & bit) // wasn't taken
&& entry.testAndSetRelaxed(old, old | bit); // still wasn't taken
@@ -437,7 +437,7 @@ struct QBasicAtomicBitField {
// loop.
}
- int allocateNext() Q_DECL_NOTHROW
+ int allocateNext() noexcept
{
// Unroll loop to iterate over ints, then bits? Would save
// potentially a lot of cmpxchgs, because we can scan the
@@ -445,10 +445,10 @@ struct QBasicAtomicBitField {
// Then again, this should never execute many iterations, so
// leave like this for now:
- for (uint i = next.load(); i < NumBits; ++i) {
+ for (uint i = next.loadRelaxed(); i < NumBits; ++i) {
if (allocateSpecific(i)) {
// remember next (possibly) free id:
- const uint oldNext = next.load();
+ const uint oldNext = next.loadRelaxed();
next.testAndSetRelaxed(oldNext, qMax(i + 1, oldNext));
return i;
}
@@ -463,7 +463,7 @@ typedef QBasicAtomicBitField<QEvent::MaxUser - QEvent::User + 1> UserEventTypeRe
static UserEventTypeRegistry userEventTypeRegistry;
-static inline int registerEventTypeZeroBased(int id) Q_DECL_NOTHROW
+static inline int registerEventTypeZeroBased(int id) noexcept
{
// if the type hint hasn't been registered yet, take it:
if (id < UserEventTypeRegistry::NumBits && id >= 0 && userEventTypeRegistry.allocateSpecific(id))
@@ -486,7 +486,7 @@ static inline int registerEventTypeZeroBased(int id) Q_DECL_NOTHROW
Returns -1 if all available values are already taken or the
program is shutting down.
*/
-int QEvent::registerEventType(int hint) Q_DECL_NOTHROW
+int QEvent::registerEventType(int hint) noexcept
{
const int result = registerEventTypeZeroBased(QEvent::MaxUser - hint);
return result < 0 ? -1 : QEvent::MaxUser - result ;
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index ac974ba411..05af1a6132 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -307,7 +307,7 @@ public:
inline void accept() { m_accept = true; }
inline void ignore() { m_accept = false; }
- static int registerEventType(int hint = -1) Q_DECL_NOTHROW;
+ static int registerEventType(int hint = -1) noexcept;
protected:
QEventPrivate *d;
diff --git a/src/corelib/kernel/qcoreglobaldata.cpp b/src/corelib/kernel/qcoreglobaldata.cpp
index 104be1b87b..7ff222f170 100644
--- a/src/corelib/kernel/qcoreglobaldata.cpp
+++ b/src/corelib/kernel/qcoreglobaldata.cpp
@@ -48,7 +48,7 @@ Q_GLOBAL_STATIC(QCoreGlobalData, globalInstance)
QCoreGlobalData::QCoreGlobalData()
#if QT_CONFIG(textcodec)
- : codecForLocale(0)
+ : codecForLocale(nullptr)
#endif
{
}
@@ -56,7 +56,7 @@ QCoreGlobalData::QCoreGlobalData()
QCoreGlobalData::~QCoreGlobalData()
{
#if QT_CONFIG(textcodec)
- codecForLocale = 0;
+ codecForLocale = nullptr;
QList<QTextCodec *> tmp = allCodecs;
allCodecs.clear();
codecCache.clear();
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp
index 49874b94b4..06b56bb09b 100644
--- a/src/corelib/kernel/qdeadlinetimer.cpp
+++ b/src/corelib/kernel/qdeadlinetimer.cpp
@@ -464,7 +464,7 @@ inline bool TimeReference::toNanoseconds(qint64 *result) const
\sa hasExpired(), isForever(), remainingTime(), setRemainingTime()
*/
-QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
+QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) noexcept
: t2(0)
{
setRemainingTime(msecs, type);
@@ -536,7 +536,7 @@ QDeadlineTimer::QDeadlineTimer(qint64 msecs, Qt::TimerType type) Q_DECL_NOTHROW
\sa setPreciseRemainingTime(), hasExpired(), isForever(), remainingTime()
*/
-void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) noexcept
{
if (msecs == -1) {
*this = QDeadlineTimer(Forever, timerType);
@@ -562,7 +562,7 @@ void QDeadlineTimer::setRemainingTime(qint64 msecs, Qt::TimerType timerType) Q_D
\sa setRemainingTime(), hasExpired(), isForever(), remainingTime()
*/
-void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::TimerType timerType) noexcept
{
if (secs == -1) {
*this = QDeadlineTimer(Forever, timerType);
@@ -619,7 +619,7 @@ void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, qint64 nsecs, Qt::Time
\sa isForever(), remainingTime()
*/
-bool QDeadlineTimer::hasExpired() const Q_DECL_NOTHROW
+bool QDeadlineTimer::hasExpired() const noexcept
{
if (isForever())
return false;
@@ -666,7 +666,7 @@ void QDeadlineTimer::setTimerType(Qt::TimerType timerType)
\sa remainingTimeNSecs(), isForever(), hasExpired()
*/
-qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::remainingTime() const noexcept
{
if (isForever())
return -1;
@@ -694,7 +694,7 @@ qint64 QDeadlineTimer::remainingTime() const Q_DECL_NOTHROW
\sa remainingTime(), isForever(), hasExpired()
*/
-qint64 QDeadlineTimer::remainingTimeNSecs() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::remainingTimeNSecs() const noexcept
{
if (isForever())
return -1;
@@ -708,7 +708,7 @@ qint64 QDeadlineTimer::remainingTimeNSecs() const Q_DECL_NOTHROW
not deal with Forever. In case of underflow the result is saturated to
the minimum possible value, on overflow - the maximum possible value.
*/
-qint64 QDeadlineTimer::rawRemainingTimeNSecs() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::rawRemainingTimeNSecs() const noexcept
{
QDeadlineTimer now = current(timerType());
TimeReference ref(t1, t2);
@@ -744,7 +744,7 @@ qint64 QDeadlineTimer::rawRemainingTimeNSecs() const Q_DECL_NOTHROW
\sa remainingTime(), deadlineNSecs(), setDeadline()
*/
-qint64 QDeadlineTimer::deadline() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::deadline() const noexcept
{
if (isForever())
return TimeReference::Max;
@@ -777,7 +777,7 @@ qint64 QDeadlineTimer::deadline() const Q_DECL_NOTHROW
\sa remainingTime(), deadlineNSecs()
*/
-qint64 QDeadlineTimer::deadlineNSecs() const Q_DECL_NOTHROW
+qint64 QDeadlineTimer::deadlineNSecs() const noexcept
{
if (isForever())
return TimeReference::Max;
@@ -802,7 +802,7 @@ qint64 QDeadlineTimer::deadlineNSecs() const Q_DECL_NOTHROW
\sa setPreciseDeadline(), deadline(), deadlineNSecs(), setRemainingTime()
*/
-void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) noexcept
{
if (msecs == TimeReference::Max) {
*this = QDeadlineTimer(Forever, timerType);
@@ -829,7 +829,7 @@ void QDeadlineTimer::setDeadline(qint64 msecs, Qt::TimerType timerType) Q_DECL_N
\sa setDeadline(), deadline(), deadlineNSecs(), setRemainingTime()
*/
-void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType timerType) Q_DECL_NOTHROW
+void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType timerType) noexcept
{
type = timerType;
@@ -849,7 +849,7 @@ void QDeadlineTimer::setPreciseDeadline(qint64 secs, qint64 nsecs, Qt::TimerType
\note if \a dt was created as expired, its deadline is indeterminate and
adding an amount of time may or may not cause it to become unexpired.
*/
-QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) noexcept
{
if (dt.isForever())
return dt;
diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h
index f9ad4063e5..9dd92481d2 100644
--- a/src/corelib/kernel/qdeadlinetimer.h
+++ b/src/corelib/kernel/qdeadlinetimer.h
@@ -63,49 +63,49 @@ class Q_CORE_EXPORT QDeadlineTimer
public:
enum ForeverConstant { Forever };
- Q_DECL_CONSTEXPR QDeadlineTimer(Qt::TimerType type_ = Qt::CoarseTimer) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QDeadlineTimer(Qt::TimerType type_ = Qt::CoarseTimer) noexcept
: t1(0), t2(0), type(type_) {}
- Q_DECL_CONSTEXPR QDeadlineTimer(ForeverConstant, Qt::TimerType type_ = Qt::CoarseTimer) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QDeadlineTimer(ForeverConstant, Qt::TimerType type_ = Qt::CoarseTimer) noexcept
: t1(std::numeric_limits<qint64>::max()), t2(0), type(type_) {}
- explicit QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ explicit QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) noexcept;
- void swap(QDeadlineTimer &other) Q_DECL_NOTHROW
+ void swap(QDeadlineTimer &other) noexcept
{ qSwap(t1, other.t1); qSwap(t2, other.t2); qSwap(type, other.type); }
- Q_DECL_CONSTEXPR bool isForever() const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR bool isForever() const noexcept
{ return t1 == (std::numeric_limits<qint64>::max)(); }
- bool hasExpired() const Q_DECL_NOTHROW;
+ bool hasExpired() const noexcept;
- Qt::TimerType timerType() const Q_DECL_NOTHROW
+ Qt::TimerType timerType() const noexcept
{ return Qt::TimerType(type & 0xff); }
void setTimerType(Qt::TimerType type);
- qint64 remainingTime() const Q_DECL_NOTHROW;
- qint64 remainingTimeNSecs() const Q_DECL_NOTHROW;
- void setRemainingTime(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ qint64 remainingTime() const noexcept;
+ qint64 remainingTimeNSecs() const noexcept;
+ void setRemainingTime(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) noexcept;
void setPreciseRemainingTime(qint64 secs, qint64 nsecs = 0,
- Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ Qt::TimerType type = Qt::CoarseTimer) noexcept;
- qint64 deadline() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
- qint64 deadlineNSecs() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
- void setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ qint64 deadline() const noexcept Q_DECL_PURE_FUNCTION;
+ qint64 deadlineNSecs() const noexcept Q_DECL_PURE_FUNCTION;
+ void setDeadline(qint64 msecs, Qt::TimerType timerType = Qt::CoarseTimer) noexcept;
void setPreciseDeadline(qint64 secs, qint64 nsecs = 0,
- Qt::TimerType type = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ Qt::TimerType type = Qt::CoarseTimer) noexcept;
- static QDeadlineTimer addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
- static QDeadlineTimer current(Qt::TimerType timerType = Qt::CoarseTimer) Q_DECL_NOTHROW;
+ static QDeadlineTimer addNSecs(QDeadlineTimer dt, qint64 nsecs) noexcept Q_DECL_PURE_FUNCTION;
+ static QDeadlineTimer current(Qt::TimerType timerType = Qt::CoarseTimer) noexcept;
- friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d1.t1 == d2.t1 && d1.t2 == d2.t2; }
- friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return !(d1 == d2); }
- friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d1.t1 < d2.t1 || (d1.t1 == d2.t1 && d1.t2 < d2.t2); }
- friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d1 == d2 || d1 < d2; }
- friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return d2 < d1; }
- friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2) Q_DECL_NOTHROW
+ friend bool operator>=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept
{ return !(d1 < d2); }
friend Q_CORE_EXPORT QDeadlineTimer operator+(QDeadlineTimer dt, qint64 msecs);
@@ -159,7 +159,7 @@ public:
setPreciseRemainingTime(0, std::chrono::nanoseconds(remaining).count(), type_);
}
- std::chrono::nanoseconds remainingTimeAsDuration() const Q_DECL_NOTHROW
+ std::chrono::nanoseconds remainingTimeAsDuration() const noexcept
{
if (isForever())
return std::chrono::nanoseconds::max();
@@ -185,7 +185,7 @@ private:
unsigned t2;
unsigned type;
- qint64 rawRemainingTimeNSecs() const Q_DECL_NOTHROW;
+ qint64 rawRemainingTimeNSecs() const noexcept;
public:
// This is not a public function, it's here only for Qt's internal convenience...
diff --git a/src/corelib/kernel/qelapsedtimer.cpp b/src/corelib/kernel/qelapsedtimer.cpp
index e578b5b8b3..57825583dd 100644
--- a/src/corelib/kernel/qelapsedtimer.cpp
+++ b/src/corelib/kernel/qelapsedtimer.cpp
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
\snippet qelapsedtimer/main.cpp 0
In this example, the timer is started by a call to start() and the
- elapsed timer is calculated by the elapsed() function.
+ elapsed time is calculated by the elapsed() function.
The time elapsed can also be used to recalculate the time available for
another operation, after the first one is complete. This is useful when
@@ -236,7 +236,7 @@ static const qint64 invalidData = Q_INT64_C(0x8000000000000000);
\sa isValid(), start(), restart()
*/
-void QElapsedTimer::invalidate() Q_DECL_NOTHROW
+void QElapsedTimer::invalidate() noexcept
{
t1 = t2 = invalidData;
}
@@ -247,7 +247,7 @@ void QElapsedTimer::invalidate() Q_DECL_NOTHROW
\sa invalidate(), start(), restart()
*/
-bool QElapsedTimer::isValid() const Q_DECL_NOTHROW
+bool QElapsedTimer::isValid() const noexcept
{
return t1 != invalidData && t2 != invalidData;
}
@@ -260,7 +260,7 @@ bool QElapsedTimer::isValid() const Q_DECL_NOTHROW
\sa elapsed(), QDeadlineTimer
*/
-bool QElapsedTimer::hasExpired(qint64 timeout) const Q_DECL_NOTHROW
+bool QElapsedTimer::hasExpired(qint64 timeout) const noexcept
{
// if timeout is -1, quint64(timeout) is LLINT_MAX, so this will be
// considered as never expired
diff --git a/src/corelib/kernel/qelapsedtimer.h b/src/corelib/kernel/qelapsedtimer.h
index 7954b41bf4..873847f6b6 100644
--- a/src/corelib/kernel/qelapsedtimer.h
+++ b/src/corelib/kernel/qelapsedtimer.h
@@ -62,28 +62,28 @@ public:
{
}
- static ClockType clockType() Q_DECL_NOTHROW;
- static bool isMonotonic() Q_DECL_NOTHROW;
+ static ClockType clockType() noexcept;
+ static bool isMonotonic() noexcept;
- void start() Q_DECL_NOTHROW;
- qint64 restart() Q_DECL_NOTHROW;
- void invalidate() Q_DECL_NOTHROW;
- bool isValid() const Q_DECL_NOTHROW;
+ void start() noexcept;
+ qint64 restart() noexcept;
+ void invalidate() noexcept;
+ bool isValid() const noexcept;
- qint64 nsecsElapsed() const Q_DECL_NOTHROW;
- qint64 elapsed() const Q_DECL_NOTHROW;
- bool hasExpired(qint64 timeout) const Q_DECL_NOTHROW;
+ qint64 nsecsElapsed() const noexcept;
+ qint64 elapsed() const noexcept;
+ bool hasExpired(qint64 timeout) const noexcept;
- qint64 msecsSinceReference() const Q_DECL_NOTHROW;
- qint64 msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW;
- qint64 secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW;
+ qint64 msecsSinceReference() const noexcept;
+ qint64 msecsTo(const QElapsedTimer &other) const noexcept;
+ qint64 secsTo(const QElapsedTimer &other) const noexcept;
- bool operator==(const QElapsedTimer &other) const Q_DECL_NOTHROW
+ bool operator==(const QElapsedTimer &other) const noexcept
{ return t1 == other.t1 && t2 == other.t2; }
- bool operator!=(const QElapsedTimer &other) const Q_DECL_NOTHROW
+ bool operator!=(const QElapsedTimer &other) const noexcept
{ return !(*this == other); }
- friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW;
+ friend bool Q_CORE_EXPORT operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept;
private:
qint64 t1;
diff --git a/src/corelib/kernel/qelapsedtimer_generic.cpp b/src/corelib/kernel/qelapsedtimer_generic.cpp
index fdeb385188..fe959e3c94 100644
--- a/src/corelib/kernel/qelapsedtimer_generic.cpp
+++ b/src/corelib/kernel/qelapsedtimer_generic.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\sa isMonotonic()
*/
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
return SystemTime;
}
@@ -60,7 +60,7 @@ QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
\sa clockType(), QElapsedTimer::ClockType
*/
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return false;
}
@@ -75,7 +75,7 @@ bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
\sa restart(), invalidate(), elapsed()
*/
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
restart();
}
@@ -97,7 +97,7 @@ void QElapsedTimer::start() Q_DECL_NOTHROW
\sa start(), invalidate(), elapsed(), isValid()
*/
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
qint64 old = t1;
t1 = QDateTime::currentMSecsSinceEpoch();
@@ -118,7 +118,7 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
\sa start(), restart(), hasExpired(), invalidate()
*/
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
return elapsed() * 1000000;
}
@@ -132,7 +132,7 @@ qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
\sa start(), restart(), hasExpired(), isValid(), invalidate()
*/
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
return QDateTime::currentMSecsSinceEpoch() - t1;
}
@@ -152,7 +152,7 @@ qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
\sa clockType(), elapsed()
*/
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return t1;
}
@@ -167,7 +167,7 @@ qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
\sa secsTo(), elapsed()
*/
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
qint64 diff = other.t1 - t1;
return diff;
@@ -183,7 +183,7 @@ qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
\sa msecsTo(), elapsed()
*/
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return msecsTo(other) / 1000;
}
@@ -197,12 +197,12 @@ qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
and the other isn't. However, two invalid timers are equal and thus this
function will return false.
*/
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return v1.t1 < v2.t1;
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
QDeadlineTimer result;
result.t1 = QDateTime::currentMSecsSinceEpoch() * 1000 * 1000;
diff --git a/src/corelib/kernel/qelapsedtimer_mac.cpp b/src/corelib/kernel/qelapsedtimer_mac.cpp
index 7490693991..5370cf7b3d 100644
--- a/src/corelib/kernel/qelapsedtimer_mac.cpp
+++ b/src/corelib/kernel/qelapsedtimer_mac.cpp
@@ -58,12 +58,12 @@ typedef __int128_t LargeInt;
typedef qint64 LargeInt;
#endif
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
return MachAbsoluteTime;
}
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return true;
}
@@ -87,7 +87,7 @@ static qint64 absoluteToMSecs(qint64 cpuTime)
return absoluteToNSecs(cpuTime) / 1000000;
}
-timespec qt_gettime() Q_DECL_NOTHROW
+timespec qt_gettime() noexcept
{
timespec tv;
@@ -107,13 +107,13 @@ void qt_nanosleep(timespec amount)
EINTR_LOOP(r, nanosleep(&amount, &amount));
}
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
t1 = mach_absolute_time();
t2 = 0;
}
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
qint64 old = t1;
t1 = mach_absolute_time();
@@ -122,39 +122,39 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
return absoluteToMSecs(t1 - old);
}
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
uint64_t cpu_time = mach_absolute_time();
return absoluteToNSecs(cpu_time - t1);
}
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
uint64_t cpu_time = mach_absolute_time();
return absoluteToMSecs(cpu_time - t1);
}
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return absoluteToMSecs(t1);
}
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
return absoluteToMSecs(other.t1 - t1);
}
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return msecsTo(other) / 1000;
}
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return v1.t1 < v2.t1;
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2);
QDeadlineTimer result;
diff --git a/src/corelib/kernel/qelapsedtimer_unix.cpp b/src/corelib/kernel/qelapsedtimer_unix.cpp
index e166d4e3d2..ccc2eeafa3 100644
--- a/src/corelib/kernel/qelapsedtimer_unix.cpp
+++ b/src/corelib/kernel/qelapsedtimer_unix.cpp
@@ -150,12 +150,12 @@ static int unixCheckClockType()
#endif
}
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return clockType() == MonotonicClock;
}
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
return unixCheckClockType() == CLOCK_REALTIME ? SystemTime : MonotonicClock;
}
@@ -169,7 +169,7 @@ static inline void do_gettime(qint64 *sec, qint64 *frac)
}
// used in qcore_unix.cpp and qeventdispatcher_unix.cpp
-struct timespec qt_gettime() Q_DECL_NOTHROW
+struct timespec qt_gettime() noexcept
{
qint64 sec, frac;
do_gettime(&sec, &frac);
@@ -204,17 +204,17 @@ static qint64 elapsedAndRestart(qint64 sec, qint64 frac,
return (sec * Q_INT64_C(1000000000) + frac) / Q_INT64_C(1000000);
}
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
do_gettime(&t1, &t2);
}
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
return elapsedAndRestart(t1, t2, &t1, &t2);
}
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
qint64 sec, frac;
do_gettime(&sec, &frac);
@@ -223,34 +223,34 @@ qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
return sec * Q_INT64_C(1000000000) + frac;
}
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
return nsecsElapsed() / Q_INT64_C(1000000);
}
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return t1 * Q_INT64_C(1000) + t2 / Q_INT64_C(1000000);
}
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
qint64 secs = other.t1 - t1;
qint64 fraction = other.t2 - t2;
return (secs * Q_INT64_C(1000000000) + fraction) / Q_INT64_C(1000000);
}
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return other.t1 - t1;
}
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return v1.t1 < v2.t1 || (v1.t1 == v2.t1 && v1.t2 < v2.t2);
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
Q_STATIC_ASSERT(QDeadlineTimerNanosecondsInT2);
QDeadlineTimer result;
diff --git a/src/corelib/kernel/qelapsedtimer_win.cpp b/src/corelib/kernel/qelapsedtimer_win.cpp
index 3beb158b8a..8becb17461 100644
--- a/src/corelib/kernel/qelapsedtimer_win.cpp
+++ b/src/corelib/kernel/qelapsedtimer_win.cpp
@@ -101,25 +101,25 @@ quint64 qt_msectime()
return ticksToNanoseconds(getTickCount()) / 1000000;
}
-QElapsedTimer::ClockType QElapsedTimer::clockType() Q_DECL_NOTHROW
+QElapsedTimer::ClockType QElapsedTimer::clockType() noexcept
{
resolveCounterFrequency();
return counterFrequency > 0 ? PerformanceCounter : TickCounter;
}
-bool QElapsedTimer::isMonotonic() Q_DECL_NOTHROW
+bool QElapsedTimer::isMonotonic() noexcept
{
return true;
}
-void QElapsedTimer::start() Q_DECL_NOTHROW
+void QElapsedTimer::start() noexcept
{
t1 = getTickCount();
t2 = 0;
}
-qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
+qint64 QElapsedTimer::restart() noexcept
{
qint64 oldt1 = t1;
t1 = getTickCount();
@@ -127,40 +127,40 @@ qint64 QElapsedTimer::restart() Q_DECL_NOTHROW
return ticksToNanoseconds(t1 - oldt1) / 1000000;
}
-qint64 QElapsedTimer::nsecsElapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::nsecsElapsed() const noexcept
{
qint64 elapsed = getTickCount() - t1;
return ticksToNanoseconds(elapsed);
}
-qint64 QElapsedTimer::elapsed() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::elapsed() const noexcept
{
qint64 elapsed = getTickCount() - t1;
return ticksToNanoseconds(elapsed) / 1000000;
}
-qint64 QElapsedTimer::msecsSinceReference() const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsSinceReference() const noexcept
{
return ticksToNanoseconds(t1) / 1000000;
}
-qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::msecsTo(const QElapsedTimer &other) const noexcept
{
qint64 difference = other.t1 - t1;
return ticksToNanoseconds(difference) / 1000000;
}
-qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const Q_DECL_NOTHROW
+qint64 QElapsedTimer::secsTo(const QElapsedTimer &other) const noexcept
{
return msecsTo(other) / 1000;
}
-bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) Q_DECL_NOTHROW
+bool operator<(const QElapsedTimer &v1, const QElapsedTimer &v2) noexcept
{
return (v1.t1 - v2.t1) < 0;
}
-QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) Q_DECL_NOTHROW
+QDeadlineTimer QDeadlineTimer::current(Qt::TimerType timerType) noexcept
{
Q_STATIC_ASSERT(!QDeadlineTimerNanosecondsInT2);
QDeadlineTimer result;
diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm
index b7b379e2c1..177551467c 100644
--- a/src/corelib/kernel/qeventdispatcher_cf.mm
+++ b/src/corelib/kernel/qeventdispatcher_cf.mm
@@ -56,6 +56,14 @@
# include <UIKit/UIApplication.h>
#endif
+QT_BEGIN_NAMESPACE
+namespace QtPrivate {
+Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher");
+Q_LOGGING_CATEGORY(lcEventDispatcherTimers, "qt.eventdispatcher.timers");
+}
+using namespace QtPrivate;
+QT_END_NAMESPACE
+
QT_USE_NAMESPACE
/*
@@ -148,9 +156,6 @@ static CFStringRef runLoopMode(NSDictionary *dictionary)
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher");
-Q_LOGGING_CATEGORY(lcEventDispatcherTimers, "qt.eventdispatcher.timers");
-
class RunLoopDebugger : public QObject
{
Q_OBJECT
@@ -190,7 +195,7 @@ Q_ENUM_PRINTER(Result);
QDebug operator<<(QDebug s, timespec tv)
{
- s << tv.tv_sec << "." << qSetFieldWidth(9) << qSetPadChar(QChar(48)) << tv.tv_nsec << reset;
+ s << tv.tv_sec << "." << qSetFieldWidth(9) << qSetPadChar(QChar(48)) << tv.tv_nsec << Qt::reset;
return s;
}
@@ -423,7 +428,7 @@ bool QEventDispatcherCoreFoundation::processPostedEvents()
m_processEvents.processedPostedEvents = true;
qCDebug(lcEventDispatcher) << "Sending posted events for"
- << QEventLoop::ProcessEventsFlags(m_processEvents.flags.load());
+ << QEventLoop::ProcessEventsFlags(m_processEvents.flags.loadRelaxed());
QCoreApplication::sendPostedEvents();
return true;
diff --git a/src/corelib/kernel/qeventdispatcher_cf_p.h b/src/corelib/kernel/qeventdispatcher_cf_p.h
index 26191d520c..a2cecd9a93 100644
--- a/src/corelib/kernel/qeventdispatcher_cf_p.h
+++ b/src/corelib/kernel/qeventdispatcher_cf_p.h
@@ -98,8 +98,10 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(RunLoopModeTracker));
QT_BEGIN_NAMESPACE
-Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher);
-Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcherTimers)
+namespace QtPrivate {
+Q_CORE_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher);
+Q_CORE_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcherTimers)
+}
class QEventDispatcherCoreFoundation;
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 34c2dde6a8..d9746ef6e2 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -261,7 +261,7 @@ static gboolean postEventSourcePrepare(GSource *s, gint *timeout)
*timeout = canWait ? -1 : 0;
GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
- source->d->wakeUpCalled = source->serialNumber.load() != source->lastSerialNumber;
+ source->d->wakeUpCalled = source->serialNumber.loadRelaxed() != source->lastSerialNumber;
return !canWait || source->d->wakeUpCalled;
}
@@ -273,7 +273,7 @@ static gboolean postEventSourceCheck(GSource *source)
static gboolean postEventSourceDispatch(GSource *s, GSourceFunc, gpointer)
{
GPostEventSource *source = reinterpret_cast<GPostEventSource *>(s);
- source->lastSerialNumber = source->serialNumber.load();
+ source->lastSerialNumber = source->serialNumber.loadRelaxed();
QCoreApplication::sendPostedEvents();
source->d->runTimersOnceWithNormalPriority();
return true; // i dunno, george...
@@ -320,7 +320,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
// setup post event source
postEventSource = reinterpret_cast<GPostEventSource *>(g_source_new(&postEventSourceFuncs,
sizeof(GPostEventSource)));
- postEventSource->serialNumber.store(1);
+ postEventSource->serialNumber.storeRelaxed(1);
postEventSource->d = this;
g_source_set_can_recurse(&postEventSource->source, true);
g_source_attach(&postEventSource->source, mainContext);
diff --git a/src/corelib/kernel/qeventdispatcher_glib_p.h b/src/corelib/kernel/qeventdispatcher_glib_p.h
index 88ff316ee5..313825d0a7 100644
--- a/src/corelib/kernel/qeventdispatcher_glib_p.h
+++ b/src/corelib/kernel/qeventdispatcher_glib_p.h
@@ -66,8 +66,8 @@ class Q_CORE_EXPORT QEventDispatcherGlib : public QAbstractEventDispatcher
Q_DECLARE_PRIVATE(QEventDispatcherGlib)
public:
- explicit QEventDispatcherGlib(QObject *parent = 0);
- explicit QEventDispatcherGlib(GMainContext *context, QObject *parent = 0);
+ explicit QEventDispatcherGlib(QObject *parent = nullptr);
+ explicit QEventDispatcherGlib(GMainContext *context, QObject *parent = nullptr);
~QEventDispatcherGlib();
bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
@@ -102,7 +102,7 @@ class Q_CORE_EXPORT QEventDispatcherGlibPrivate : public QAbstractEventDispatche
{
public:
- QEventDispatcherGlibPrivate(GMainContext *context = 0);
+ QEventDispatcherGlibPrivate(GMainContext *context = nullptr);
GMainContext *mainContext;
GPostEventSource *postEventSource;
GSocketNotifierSource *socketNotifierSource;
diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index df0cac0239..5bc65b7110 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -459,7 +459,7 @@ void QEventDispatcherUNIX::unregisterSocketNotifier(QSocketNotifier *notifier)
bool QEventDispatcherUNIX::processEvents(QEventLoop::ProcessEventsFlags flags)
{
Q_D(QEventDispatcherUNIX);
- d->interrupt.store(0);
+ d->interrupt.storeRelaxed(0);
// we are awake, broadcast it
emit awake();
@@ -470,13 +470,13 @@ bool QEventDispatcherUNIX::processEvents(QEventLoop::ProcessEventsFlags flags)
const bool wait_for_events = flags & QEventLoop::WaitForMoreEvents;
const bool canWait = (d->threadData->canWaitLocked()
- && !d->interrupt.load()
+ && !d->interrupt.loadRelaxed()
&& wait_for_events);
if (canWait)
emit aboutToBlock();
- if (d->interrupt.load())
+ if (d->interrupt.loadRelaxed())
return false;
timespec *tm = nullptr;
@@ -545,7 +545,7 @@ void QEventDispatcherUNIX::wakeUp()
void QEventDispatcherUNIX::interrupt()
{
Q_D(QEventDispatcherUNIX);
- d->interrupt.store(1);
+ d->interrupt.storeRelaxed(1);
wakeUp();
}
diff --git a/src/corelib/kernel/qeventdispatcher_unix_p.h b/src/corelib/kernel/qeventdispatcher_unix_p.h
index 0fd068b074..f37edfc967 100644
--- a/src/corelib/kernel/qeventdispatcher_unix_p.h
+++ b/src/corelib/kernel/qeventdispatcher_unix_p.h
@@ -64,10 +64,10 @@ class QEventDispatcherUNIXPrivate;
struct Q_CORE_EXPORT QSocketNotifierSetUNIX final
{
- inline QSocketNotifierSetUNIX() Q_DECL_NOTHROW;
+ inline QSocketNotifierSetUNIX() noexcept;
- inline bool isEmpty() const Q_DECL_NOTHROW;
- inline short events() const Q_DECL_NOTHROW;
+ inline bool isEmpty() const noexcept;
+ inline short events() const noexcept;
QSocketNotifier *notifiers[3];
};
@@ -102,7 +102,7 @@ class Q_CORE_EXPORT QEventDispatcherUNIX : public QAbstractEventDispatcher
Q_DECLARE_PRIVATE(QEventDispatcherUNIX)
public:
- explicit QEventDispatcherUNIX(QObject *parent = 0);
+ explicit QEventDispatcherUNIX(QObject *parent = nullptr);
~QEventDispatcherUNIX();
bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
@@ -123,7 +123,7 @@ public:
void flush() override;
protected:
- QEventDispatcherUNIX(QEventDispatcherUNIXPrivate &dd, QObject *parent = 0);
+ QEventDispatcherUNIX(QEventDispatcherUNIXPrivate &dd, QObject *parent = nullptr);
};
class Q_CORE_EXPORT QEventDispatcherUNIXPrivate : public QAbstractEventDispatcherPrivate
@@ -150,19 +150,19 @@ public:
QAtomicInt interrupt; // bool
};
-inline QSocketNotifierSetUNIX::QSocketNotifierSetUNIX() Q_DECL_NOTHROW
+inline QSocketNotifierSetUNIX::QSocketNotifierSetUNIX() noexcept
{
- notifiers[0] = 0;
- notifiers[1] = 0;
- notifiers[2] = 0;
+ notifiers[0] = nullptr;
+ notifiers[1] = nullptr;
+ notifiers[2] = nullptr;
}
-inline bool QSocketNotifierSetUNIX::isEmpty() const Q_DECL_NOTHROW
+inline bool QSocketNotifierSetUNIX::isEmpty() const noexcept
{
return !notifiers[0] && !notifiers[1] && !notifiers[2];
}
-inline short QSocketNotifierSetUNIX::events() const Q_DECL_NOTHROW
+inline short QSocketNotifierSetUNIX::events() const noexcept
{
short result = 0;
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 8ff7637b7e..87623f304a 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -52,7 +52,6 @@
#include "qelapsedtimer.h"
#include "qcoreapplication_p.h"
#include <private/qthread_p.h>
-#include <private/qmutexpool_p.h>
#include <private/qwineventnotifier_p.h>
QT_BEGIN_NAMESPACE
@@ -82,11 +81,13 @@ extern uint qGlobalPostedEventsCount();
enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
WM_QT_SENDPOSTEDEVENTS = WM_USER + 1,
- WM_QT_ACTIVATENOTIFIERS = WM_USER + 2,
+ WM_QT_ACTIVATENOTIFIERS = WM_USER + 2
};
-enum : UINT_PTR {
- SendPostedEventsWindowsTimerId = ~UINT_PTR(1)
+// WM_QT_SENDPOSTEDEVENTS message parameter
+enum {
+ WMWP_QT_TOFOREIGNLOOP = 0,
+ WMWP_QT_FROMWAKEUP
};
class QEventDispatcherWin32Private;
@@ -99,8 +100,8 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
QEventDispatcherWin32Private::QEventDispatcherWin32Private()
: threadId(GetCurrentThreadId()), interrupt(false), internalHwnd(0),
- getMessageHook(0), serialNumber(0), lastSerialNumber(0), sendPostedEventsWindowsTimerId(0),
- wakeUps(0), activateNotifiersPosted(false), winEventNotifierActivatedEvent(NULL)
+ getMessageHook(0), wakeUps(0), activateNotifiersPosted(false),
+ winEventNotifierActivatedEvent(NULL)
{
}
@@ -139,7 +140,11 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
msg.wParam = wp;
msg.lParam = lp;
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result;
+#else
long result;
+#endif
if (!dispatcher) {
if (message == WM_TIMER)
KillTimer(hwnd, wp);
@@ -233,30 +238,25 @@ LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPA
return 0;
}
case WM_TIMER:
- if (d->sendPostedEventsWindowsTimerId == 0
- || wp != uint(d->sendPostedEventsWindowsTimerId)) {
- Q_ASSERT(d != 0);
- d->sendTimerEvent(wp);
- return 0;
- }
- // we also use a Windows timer to send posted events when the message queue is full
- Q_FALLTHROUGH();
- case WM_QT_SENDPOSTEDEVENTS: {
- const int localSerialNumber = d->serialNumber.load();
- if (localSerialNumber != d->lastSerialNumber) {
- d->lastSerialNumber = localSerialNumber;
- q->sendPostedEvents();
- }
+ Q_ASSERT(d != 0);
+
+ d->sendTimerEvent(wp);
+ return 0;
+ case WM_QT_SENDPOSTEDEVENTS:
+ Q_ASSERT(d != 0);
+
+ // We send posted events manually, if the window procedure was invoked
+ // by the foreign event loop (e.g. from the native modal dialog).
+ q->sendPostedEvents();
return 0;
- }
} // switch (message)
return DefWindowProc(hwnd, message, wp, lp);
}
-static inline UINT inputTimerMask()
+static inline UINT inputQueueMask()
{
- UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT;
+ UINT result = QS_ALLEVENTS;
// QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
// QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
#if WINVER > 0x0601
@@ -270,41 +270,19 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
{
QEventDispatcherWin32 *q = qobject_cast<QEventDispatcherWin32 *>(QAbstractEventDispatcher::instance());
Q_ASSERT(q != 0);
-
- if (wp == PM_REMOVE) {
- if (q) {
- MSG *msg = (MSG *) lp;
- QEventDispatcherWin32Private *d = q->d_func();
- const int localSerialNumber = d->serialNumber.load();
- static const UINT mask = inputTimerMask();
- if (HIWORD(GetQueueStatus(mask)) == 0) {
- // no more input or timer events in the message queue, we can allow posted events to be sent normally now
- if (d->sendPostedEventsWindowsTimerId != 0) {
- // stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message
- KillTimer(d->internalHwnd, SendPostedEventsWindowsTimerId);
- d->sendPostedEventsWindowsTimerId = 0;
- }
- (void) d->wakeUps.fetchAndStoreRelease(0);
- if (localSerialNumber != d->lastSerialNumber
- // if this message IS the one that triggers sendPostedEvents(), no need to post it again
- && (msg->hwnd != d->internalHwnd
- || msg->message != WM_QT_SENDPOSTEDEVENTS)) {
- PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);
- }
- } else if (d->sendPostedEventsWindowsTimerId == 0
- && localSerialNumber != d->lastSerialNumber) {
- // start a special timer to continue delivering posted events while
- // there are still input and timer messages in the message queue
- d->sendPostedEventsWindowsTimerId = SetTimer(d->internalHwnd,
- SendPostedEventsWindowsTimerId,
- 0, // we specify zero, but Windows uses USER_TIMER_MINIMUM
- NULL);
- // we don't check the return value of SetTimer()... if creating the timer failed, there's little
- // we can do. we just have to accept that posted events will be starved
- }
+ QEventDispatcherWin32Private *d = q->d_func();
+ MSG *msg = reinterpret_cast<MSG *>(lp);
+ static const UINT mask = inputQueueMask();
+
+ if (HIWORD(GetQueueStatus(mask)) == 0 && wp == PM_REMOVE) {
+ // Allow posting WM_QT_SENDPOSTEDEVENTS message.
+ d->wakeUps.storeRelaxed(0);
+ if (!(msg->hwnd == d->internalHwnd && msg->message == WM_QT_SENDPOSTEDEVENTS)) {
+ PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS,
+ WMWP_QT_TOFOREIGNLOOP, 0);
}
}
- return q->d_func()->getMessageHook ? CallNextHookEx(0, code, wp, lp) : 0;
+ return d->getMessageHook ? CallNextHookEx(0, code, wp, lp) : 0;
}
// Provide class name and atom for the message window used by
@@ -341,7 +319,7 @@ QWindowsMessageWindowClassContext::QWindowsMessageWindowClassContext()
wc.lpszClassName = className;
atom = RegisterClass(&wc);
if (!atom) {
- qErrnoWarning("%s RegisterClass() failed", qPrintable(qClassName));
+ qErrnoWarning("%ls RegisterClass() failed", qUtf16Printable(qClassName));
delete [] className;
className = 0;
}
@@ -485,36 +463,17 @@ void QEventDispatcherWin32::createInternalHwnd()
return;
d->internalHwnd = qt_create_internal_window(this);
- installMessageHook();
-
- // start all normal timers
- for (int i = 0; i < d->timerVec.count(); ++i)
- d->registerTimer(d->timerVec.at(i));
-}
-
-void QEventDispatcherWin32::installMessageHook()
-{
- Q_D(QEventDispatcherWin32);
-
- if (d->getMessageHook)
- return;
-
// setup GetMessage hook needed to drive our posted events
d->getMessageHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC) qt_GetMessageHook, NULL, GetCurrentThreadId());
if (Q_UNLIKELY(!d->getMessageHook)) {
int errorCode = GetLastError();
- qFatal("Qt: INTERNAL ERROR: failed to install GetMessage hook: %d, %s",
- errorCode, qPrintable(qt_error_string(errorCode)));
+ qFatal("Qt: INTERNAL ERROR: failed to install GetMessage hook: %d, %ls",
+ errorCode, qUtf16Printable(qt_error_string(errorCode)));
}
-}
-
-void QEventDispatcherWin32::uninstallMessageHook()
-{
- Q_D(QEventDispatcherWin32);
- if (d->getMessageHook)
- UnhookWindowsHookEx(d->getMessageHook);
- d->getMessageHook = 0;
+ // start all normal timers
+ for (int i = 0; i < d->timerVec.count(); ++i)
+ d->registerTimer(d->timerVec.at(i));
}
QEventDispatcherWin32::QEventDispatcherWin32(QObject *parent)
@@ -555,13 +514,15 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
wakeUp(); // trigger a call to sendPostedEvents()
}
- d->interrupt.store(false);
+ d->interrupt.storeRelaxed(false);
emit awake();
+ // To prevent livelocks, send posted events once per iteration.
+ // QCoreApplication::sendPostedEvents() takes care about recursions.
+ sendPostedEvents();
+
bool canWait;
bool retVal = false;
- bool seenWM_QT_SENDPOSTEDEVENTS = false;
- bool needWM_QT_SENDPOSTEDEVENTS = false;
do {
DWORD waitRet = 0;
DWORD nCount = 0;
@@ -571,7 +532,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
pHandles = &d->winEventNotifierActivatedEvent;
}
QVarLengthArray<MSG> processedTimers;
- while (!d->interrupt.load()) {
+ while (!d->interrupt.loadRelaxed()) {
MSG msg;
bool haveMessage;
@@ -609,19 +570,13 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
}
if (haveMessage) {
- // WinCE doesn't support hooks at all, so we have to call this by hand :(
- if (!d->getMessageHook)
- (void) qt_GetMessageHook(0, PM_REMOVE, reinterpret_cast<LPARAM>(&msg));
-
if (d->internalHwnd == msg.hwnd && msg.message == WM_QT_SENDPOSTEDEVENTS) {
- if (seenWM_QT_SENDPOSTEDEVENTS) {
- // when calling processEvents() "manually", we only want to send posted
- // events once
- needWM_QT_SENDPOSTEDEVENTS = true;
- continue;
- }
- seenWM_QT_SENDPOSTEDEVENTS = true;
- } else if (msg.message == WM_TIMER) {
+ // Set result to 'true', if the message was sent by wakeUp().
+ if (msg.wParam == WMWP_QT_FROMWAKEUP)
+ retVal = true;
+ continue;
+ }
+ if (msg.message == WM_TIMER) {
// avoid live-lock by keeping track of the timers we've already sent
bool found = false;
for (int i = 0; !found && i < processedTimers.count(); ++i) {
@@ -652,7 +607,7 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
// still nothing - wait for message or signalled objects
canWait = (!retVal
- && !d->interrupt.load()
+ && !d->interrupt.loadRelaxed()
&& (flags & QEventLoop::WaitForMoreEvents));
if (canWait) {
emit aboutToBlock();
@@ -665,14 +620,6 @@ bool QEventDispatcherWin32::processEvents(QEventLoop::ProcessEventsFlags flags)
}
} while (canWait);
- if (!seenWM_QT_SENDPOSTEDEVENTS && (flags & QEventLoop::EventLoopExec) == 0) {
- // when called "manually", always send posted events
- sendPostedEvents();
- }
-
- if (needWM_QT_SENDPOSTEDEVENTS)
- PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);
-
return retVal;
}
@@ -961,7 +908,7 @@ void QEventDispatcherWin32::activateEventNotifiers()
for (int i = 0; i < d->winEventNotifierList.count(); ++i) {
QWinEventNotifier *notifier = d->winEventNotifierList.at(i);
QWinEventNotifierPrivate *nd = QWinEventNotifierPrivate::get(notifier);
- if (nd->signaledCount.load() != 0) {
+ if (nd->signaledCount.loadRelaxed() != 0) {
--nd->signaledCount;
nd->unregisterWaitObject();
d->activateEventNotifier(notifier);
@@ -1015,17 +962,18 @@ int QEventDispatcherWin32::remainingTime(int timerId)
void QEventDispatcherWin32::wakeUp()
{
Q_D(QEventDispatcherWin32);
- d->serialNumber.ref();
if (d->internalHwnd && d->wakeUps.testAndSetAcquire(0, 1)) {
// post a WM_QT_SENDPOSTEDEVENTS to this thread if there isn't one already pending
- PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS, 0, 0);
+ if (!PostMessage(d->internalHwnd, WM_QT_SENDPOSTEDEVENTS,
+ WMWP_QT_FROMWAKEUP, 0))
+ qErrnoWarning("QEventDispatcherWin32::wakeUp: Failed to post a message");
}
}
void QEventDispatcherWin32::interrupt()
{
Q_D(QEventDispatcherWin32);
- d->interrupt.store(true);
+ d->interrupt.storeRelaxed(true);
wakeUp();
}
@@ -1056,7 +1004,9 @@ void QEventDispatcherWin32::closingDown()
d->closingDown = true;
- uninstallMessageHook();
+ if (d->getMessageHook)
+ UnhookWindowsHookEx(d->getMessageHook);
+ d->getMessageHook = 0;
}
bool QEventDispatcherWin32::event(QEvent *e)
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index a3a0cd1c2f..e6620178d8 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -73,8 +73,6 @@ class Q_CORE_EXPORT QEventDispatcherWin32 : public QAbstractEventDispatcher
protected:
void createInternalHwnd();
- void installMessageHook();
- void uninstallMessageHook();
public:
explicit QEventDispatcherWin32(QObject *parent = 0);
@@ -172,9 +170,6 @@ public:
HHOOK getMessageHook;
// for controlling when to send posted events
- QAtomicInt serialNumber;
- int lastSerialNumber;
- UINT_PTR sendPostedEventsWindowsTimerId;
QAtomicInt wakeUps;
// timers
diff --git a/src/corelib/kernel/qeventdispatcher_winrt.cpp b/src/corelib/kernel/qeventdispatcher_winrt.cpp
index 600c6c38fd..f7a1f969a8 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt.cpp
+++ b/src/corelib/kernel/qeventdispatcher_winrt.cpp
@@ -44,12 +44,13 @@
#include <QtCore/QHash>
#include <QtCore/QMutex>
#include <QtCore/QSemaphore>
-#include <QtCore/QSharedPointer>
#include <QtCore/qfunctions_winrt.h>
#include <private/qabstracteventdispatcher_p.h>
#include <private/qcoreapplication_p.h>
#include <functional>
+#include <memory>
+
#include <wrl.h>
#include <windows.foundation.h>
#include <windows.system.threading.h>
@@ -300,19 +301,19 @@ HRESULT QEventDispatcherWinRT::runOnMainThread(const std::function<HRESULT()> &d
if (QThread::currentThread() == QCoreApplication::instance()->thread())
return delegate();
- auto semaphore = QSharedPointer<QSemaphore>(new QSemaphore);
- auto ptrSemaphore = new QSharedPointer<QSemaphore>(semaphore);
- auto result = QSharedPointer<HRESULT>(new HRESULT);
- auto ptrResult = new QSharedPointer<HRESULT>(result);
+ struct State {
+ QSemaphore semaphore;
+ HRESULT result;
+ };
+
+ const auto state = std::make_shared<State>();
- QMetaObject::invokeMethod(QCoreApplication::instance(), [delegate, ptrSemaphore, ptrResult]() {
- **ptrResult = delegate();
- delete ptrResult;
- (*ptrSemaphore)->release();
- delete ptrSemaphore;
+ QMetaObject::invokeMethod(QCoreApplication::instance(), [delegate, state]() {
+ const QSemaphoreReleaser releaser{state->semaphore};
+ state->result = delegate();
}, nullptr);
- return semaphore->tryAcquire(1, timeout) ? *result : E_FAIL;
+ return state->semaphore.tryAcquire(1, timeout) ? state->result : E_FAIL;
}
bool QEventDispatcherWinRT::processEvents(QEventLoop::ProcessEventsFlags flags)
diff --git a/src/corelib/kernel/qeventdispatcher_winrt_p.h b/src/corelib/kernel/qeventdispatcher_winrt_p.h
index 8b998a7958..2672f11123 100644
--- a/src/corelib/kernel/qeventdispatcher_winrt_p.h
+++ b/src/corelib/kernel/qeventdispatcher_winrt_p.h
@@ -57,7 +57,7 @@
#include <qt_windows.h>
-namespace std { template <typename T> class function; }
+#include <functional>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp
index a6cc51621a..eacd0c4e73 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -135,7 +135,7 @@ bool QEventLoop::processEvents(ProcessEventsFlags flags)
Q_D(QEventLoop);
if (!d->threadData->hasEventDispatcher())
return false;
- return d->threadData->eventDispatcher.load()->processEvents(flags);
+ return d->threadData->eventDispatcher.loadRelaxed()->processEvents(flags);
}
/*!
@@ -165,7 +165,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
{
Q_D(QEventLoop);
//we need to protect from race condition with QThread::exit
- QMutexLocker locker(&static_cast<QThreadPrivate *>(QObjectPrivate::get(d->threadData->thread))->mutex);
+ QMutexLocker locker(&static_cast<QThreadPrivate *>(QObjectPrivate::get(d->threadData->thread.loadAcquire()))->mutex);
if (d->threadData->quitNow)
return -1;
@@ -225,7 +225,7 @@ int QEventLoop::exec(ProcessEventsFlags flags)
processEvents(flags | WaitForMoreEvents | EventLoopExec);
ref.exceptionCaught = false;
- return d->returnCode.load();
+ return d->returnCode.loadRelaxed();
}
/*!
@@ -279,9 +279,9 @@ void QEventLoop::exit(int returnCode)
if (!d->threadData->hasEventDispatcher())
return;
- d->returnCode.store(returnCode);
+ d->returnCode.storeRelaxed(returnCode);
d->exit.storeRelease(true);
- d->threadData->eventDispatcher.load()->interrupt();
+ d->threadData->eventDispatcher.loadRelaxed()->interrupt();
#ifdef Q_OS_WASM
// QEventLoop::exec() never returns in emscripten. We implement approximate behavior here.
@@ -318,7 +318,7 @@ void QEventLoop::wakeUp()
Q_D(QEventLoop);
if (!d->threadData->hasEventDispatcher())
return;
- d->threadData->eventDispatcher.load()->wakeUp();
+ d->threadData->eventDispatcher.loadRelaxed()->wakeUp();
}
diff --git a/src/corelib/kernel/qeventloop_p.h b/src/corelib/kernel/qeventloop_p.h
index dcbb5c63c6..4ad6d92007 100644
--- a/src/corelib/kernel/qeventloop_p.h
+++ b/src/corelib/kernel/qeventloop_p.h
@@ -63,8 +63,8 @@ public:
inline QEventLoopPrivate()
: inExec(false)
{
- returnCode.store(-1);
- exit.store(true);
+ returnCode.storeRelaxed(-1);
+ exit.storeRelaxed(true);
}
QAtomicInt quitLockRef;
diff --git a/src/corelib/kernel/qfunctions_fake_env_p.h b/src/corelib/kernel/qfunctions_fake_env_p.h
index 7010d2cf5d..68d17ed4a1 100644
--- a/src/corelib/kernel/qfunctions_fake_env_p.h
+++ b/src/corelib/kernel/qfunctions_fake_env_p.h
@@ -72,8 +72,8 @@ Q_DECLARE_TYPEINFO(Variable, Q_MOVABLE_TYPE);
struct NameEquals {
typedef bool result_type;
const char *name;
- explicit NameEquals(const char *name) Q_DECL_NOTHROW : name(name) {}
- result_type operator()(const Variable &other) const Q_DECL_NOTHROW
+ explicit NameEquals(const char *name) noexcept : name(name) {}
+ result_type operator()(const Variable &other) const noexcept
{ return qstrcmp(other.name, name) == 0; }
};
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index 75a2436d9d..5f652d70e3 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -47,9 +47,9 @@
QT_BEGIN_NAMESPACE
-static inline QString keyBase()
+static inline QLatin1String keyBase()
{
- return QStringLiteral("%1%2:%3");
+ return QLatin1String("%1%2:%3");
}
static QString qt_convertJString(jstring string)
@@ -154,7 +154,7 @@ static jmethodID getCachedMethodID(JNIEnv *env,
if (className.isEmpty())
return getMethodID(env, clazz, name, sig, isStatic);
- const QString key = keyBase().arg(QLatin1String(className)).arg(QLatin1String(name)).arg(QLatin1String(sig));
+ const QString key = keyBase().arg(QLatin1String(className), QLatin1String(name), QLatin1String(sig));
QHash<QString, jmethodID>::const_iterator it;
{
@@ -206,7 +206,7 @@ static jfieldID getCachedFieldID(JNIEnv *env,
if (className.isNull())
return getFieldID(env, clazz, name, sig, isStatic);
- const QString key = keyBase().arg(QLatin1String(className)).arg(QLatin1String(name)).arg(QLatin1String(sig));
+ const QString key = keyBase().arg(QLatin1String(className), QLatin1String(name), QLatin1String(sig));
QHash<QString, jfieldID>::const_iterator it;
{
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 51866a1867..5cb30a74ac 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -348,7 +348,7 @@ const char *QMetaObject::className() const
\since 5.7
*/
-bool QMetaObject::inherits(const QMetaObject *metaObject) const Q_DECL_NOEXCEPT
+bool QMetaObject::inherits(const QMetaObject *metaObject) const noexcept
{
const QMetaObject *m = this;
do {
@@ -821,6 +821,7 @@ int QMetaObjectPrivate::indexOfConstructor(const QMetaObject *m, const QByteArra
}
/*!
+ \fn int QMetaObjectPrivate::signalOffset(const QMetaObject *m)
\internal
\since 5.0
@@ -830,14 +831,6 @@ int QMetaObjectPrivate::indexOfConstructor(const QMetaObject *m, const QByteArra
Similar to QMetaObject::methodOffset(), but non-signal methods are
excluded.
*/
-int QMetaObjectPrivate::signalOffset(const QMetaObject *m)
-{
- Q_ASSERT(m != 0);
- int offset = 0;
- for (m = m->d.superdata; m; m = m->d.superdata)
- offset += priv(m->d.data)->signalCount;
- return offset;
-}
/*!
\internal
@@ -960,7 +953,7 @@ static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, co
return self;
if (self->d.relatedMetaObjects) {
Q_ASSERT(priv(self->d.data)->revision >= 2);
- const QMetaObject * const *e = self->d.relatedMetaObjects;
+ const auto *e = self->d.relatedMetaObjects;
if (e) {
while (*e) {
if (const QMetaObject *m =QMetaObject_findMetaObject((*e), name))
@@ -1549,21 +1542,14 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *
return false;
}
- // args and typesCopy will be deallocated by ~QMetaCallEvent() using free()
- void **args = static_cast<void **>(calloc(1, sizeof(void *)));
- Q_CHECK_PTR(args);
-
- int *types = static_cast<int *>(calloc(1, sizeof(int)));
- Q_CHECK_PTR(types);
-
- QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 1, types, args));
+ QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 1));
} else if (type == Qt::BlockingQueuedConnection) {
#if QT_CONFIG(thread)
if (currentThread == objectThread)
qWarning("QMetaObject::invokeMethod: Dead lock detected");
QSemaphore semaphore;
- QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, 0, 0, argv, &semaphore));
+ QCoreApplication::postEvent(object, new QMetaCallEvent(slot, 0, -1, argv, &semaphore));
semaphore.acquire();
#endif // QT_CONFIG(thread)
} else {
@@ -2317,42 +2303,31 @@ bool QMetaMethod::invoke(QObject *object,
return false;
}
- int nargs = 1; // include return type
- void **args = (void **) malloc(paramCount * sizeof(void *));
- Q_CHECK_PTR(args);
- int *types = (int *) malloc(paramCount * sizeof(int));
- Q_CHECK_PTR(types);
- types[0] = 0; // return type
- args[0] = 0;
+ QScopedPointer<QMetaCallEvent> event(new QMetaCallEvent(idx_offset, idx_relative, callFunction, 0, -1, paramCount));
+ int *types = event->types();
+ void **args = event->args();
+ int argIndex = 0;
for (int i = 1; i < paramCount; ++i) {
types[i] = QMetaType::type(typeNames[i]);
if (types[i] == QMetaType::UnknownType && param[i]) {
// Try to register the type and try again before reporting an error.
- int index = nargs - 1;
- void *argv[] = { &types[i], &index };
+ void *argv[] = { &types[i], &argIndex };
QMetaObject::metacall(object, QMetaObject::RegisterMethodArgumentMetaType,
idx_relative + idx_offset, argv);
if (types[i] == -1) {
qWarning("QMetaMethod::invoke: Unable to handle unregistered datatype '%s'",
typeNames[i]);
- for (int x = 1; x < i; ++x) {
- if (types[x] && args[x])
- QMetaType::destroy(types[x], args[x]);
- }
- free(types);
- free(args);
return false;
}
}
if (types[i] != QMetaType::UnknownType) {
args[i] = QMetaType::create(types[i], param[i]);
- ++nargs;
+ ++argIndex;
}
}
- QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,
- 0, -1, nargs, types, args));
+ QCoreApplication::postEvent(object, event.take());
} else { // blocking queued connection
#if QT_CONFIG(thread)
QThread *currentThread = QThread::currentThread();
@@ -2365,7 +2340,7 @@ bool QMetaMethod::invoke(QObject *object,
QSemaphore semaphore;
QCoreApplication::postEvent(object, new QMetaCallEvent(idx_offset, idx_relative, callFunction,
- 0, -1, 0, 0, param, &semaphore));
+ 0, -1, param, &semaphore));
semaphore.acquire();
#endif // QT_CONFIG(thread)
}
@@ -3030,6 +3005,18 @@ int QMetaProperty::propertyIndex() const
}
/*!
+ \since 5.14
+
+ Returns this property's index relative within the enclosing meta object.
+*/
+int QMetaProperty::relativePropertyIndex() const
+{
+ if (!mobj)
+ return -1;
+ return idx;
+}
+
+/*!
Returns \c true if the property's type is an enumeration value that
is used as a flag; otherwise returns \c false.
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 1efb49017f..fcd92afd89 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -183,7 +183,7 @@ private:
// signature() has been renamed to methodSignature() in Qt 5.
// Warning, that function returns a QByteArray; check the life time if
// you convert to char*.
- char *signature(struct renamedInQt5_warning_checkTheLifeTime * = nullptr) Q_DECL_EQ_DELETE;
+ char *signature(struct renamedInQt5_warning_checkTheLifeTime * = nullptr) = delete;
#endif
static QMetaMethod fromSignalImpl(const QMetaObject *, void **);
@@ -254,6 +254,7 @@ public:
QVariant::Type type() const;
int userType() const;
int propertyIndex() const;
+ int relativePropertyIndex() const;
bool isReadable() const;
bool isWritable() const;
diff --git a/src/corelib/kernel/qmetaobject_moc_p.h b/src/corelib/kernel/qmetaobject_moc_p.h
index ad258acfcd..8c7900767b 100644
--- a/src/corelib/kernel/qmetaobject_moc_p.h
+++ b/src/corelib/kernel/qmetaobject_moc_p.h
@@ -138,7 +138,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
{ "struct ", 7 },
{ "class ", 6 },
{ "enum ", 5 },
- { 0, 0 }
+ { nullptr, 0 }
};
int i = 0;
do {
@@ -146,7 +146,7 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
t += optional[i].len;
break;
}
- } while (optional[++i].keyword != 0);
+ } while (optional[++i].keyword != nullptr);
}
bool star = false;
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index 522bd78e42..56e3d6cb44 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -54,6 +54,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qobjectdefs.h>
+#include <QtCore/qmutex.h>
#ifndef QT_NO_QOBJECT
#include <private/qobject_p.h> // For QObjectPrivate::Connection
#endif
@@ -168,7 +169,6 @@ Q_DECLARE_TYPEINFO(QArgumentType, Q_MOVABLE_TYPE);
typedef QVarLengthArray<QArgumentType, 10> QArgumentTypeArray;
class QMetaMethodPrivate;
-class QMutex;
struct QMetaObjectPrivate
{
@@ -208,7 +208,13 @@ struct QMetaObjectPrivate
static int indexOfConstructor(const QMetaObject *m, const QByteArray &name,
int argc, const QArgumentType *types);
Q_CORE_EXPORT static QMetaMethod signal(const QMetaObject *m, int signal_index);
- Q_CORE_EXPORT static int signalOffset(const QMetaObject *m);
+ static inline int signalOffset(const QMetaObject *m) {
+ Q_ASSERT(m != nullptr);
+ int offset = 0;
+ for (m = m->d.superdata; m; m = m->d.superdata)
+ offset += reinterpret_cast<const QMetaObjectPrivate*>(m->d.data)->signalCount;
+ return offset;
+ }
Q_CORE_EXPORT static int absoluteSignalCount(const QMetaObject *m);
Q_CORE_EXPORT static int signalIndex(const QMetaMethod &m);
static bool checkConnectArgs(int signalArgc, const QArgumentType *signalTypes,
@@ -226,15 +232,15 @@ struct QMetaObjectPrivate
static QObjectPrivate::Connection *connect(const QObject *sender, int signal_index,
const QMetaObject *smeta,
const QObject *receiver, int method_index_relative,
- const QMetaObject *rmeta = 0,
- int type = 0, int *types = 0);
+ const QMetaObject *rmeta = nullptr,
+ int type = 0, int *types = nullptr);
static bool disconnect(const QObject *sender, int signal_index,
const QMetaObject *smeta,
const QObject *receiver, int method_index, void **slot,
DisconnectType = DisconnectAll);
- static inline bool disconnectHelper(QObjectPrivate::Connection *c,
+ static inline bool disconnectHelper(QObjectPrivate::ConnectionData *connections, int signalIndex,
const QObject *receiver, int method_index, void **slot,
- QMutex *senderMutex, DisconnectType = DisconnectAll);
+ QBasicMutex *senderMutex, DisconnectType = DisconnectAll);
#endif
};
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp
index d2030f0275..f77c4ce32f 100644
--- a/src/corelib/kernel/qmetaobjectbuilder.cpp
+++ b/src/corelib/kernel/qmetaobjectbuilder.cpp
@@ -747,7 +747,7 @@ void QMetaObjectBuilder::addMetaObject
if ((members & RelatedMetaObjects) != 0) {
Q_ASSERT(priv(prototype->d.data)->revision >= 2);
- const QMetaObject * const *objects = prototype->d.relatedMetaObjects;
+ const auto *objects = prototype->d.relatedMetaObjects;
if (objects) {
while (*objects != 0) {
addRelatedMetaObject(*objects);
@@ -1464,16 +1464,16 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
// Create the relatedMetaObjects block if we need one.
if (d->relatedMetaObjects.size() > 0) {
- ALIGN(size, QMetaObject *);
- const QMetaObject **objects =
- reinterpret_cast<const QMetaObject **>(buf + size);
+ using SuperData = QMetaObject::SuperData;
+ ALIGN(size, SuperData);
+ auto objects = reinterpret_cast<SuperData *>(buf + size);
if (buf) {
meta->d.relatedMetaObjects = objects;
for (index = 0; index < d->relatedMetaObjects.size(); ++index)
objects[index] = d->relatedMetaObjects[index];
- objects[index] = 0;
+ objects[index] = nullptr;
}
- size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1);
+ size += sizeof(SuperData) * (d->relatedMetaObjects.size() + 1);
}
// Align the final size and return it.
diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h
index 6100835bad..6d43be7811 100644
--- a/src/corelib/kernel/qmetaobjectbuilder_p.h
+++ b/src/corelib/kernel/qmetaobjectbuilder_p.h
@@ -173,7 +173,7 @@ public:
void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value);
QMetaObject *toMetaObject() const;
- QByteArray toRelocatableData(bool * = 0) const;
+ QByteArray toRelocatableData(bool * = nullptr) const;
static void fromRelocatableData(QMetaObject *, const QMetaObject *, const QByteArray &);
#ifndef QT_NO_DATASTREAM
@@ -196,7 +196,7 @@ private:
class Q_CORE_EXPORT QMetaMethodBuilder
{
public:
- QMetaMethodBuilder() : _mobj(0), _index(0) {}
+ QMetaMethodBuilder() : _mobj(nullptr), _index(0) {}
int index() const;
@@ -238,7 +238,7 @@ private:
class Q_CORE_EXPORT QMetaPropertyBuilder
{
public:
- QMetaPropertyBuilder() : _mobj(0), _index(0) {}
+ QMetaPropertyBuilder() : _mobj(nullptr), _index(0) {}
int index() const { return _index; }
@@ -294,7 +294,7 @@ private:
class Q_CORE_EXPORT QMetaEnumBuilder
{
public:
- QMetaEnumBuilder() : _mobj(0), _index(0) {}
+ QMetaEnumBuilder() : _mobj(nullptr), _index(0) {}
int index() const { return _index; }
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 45d0b5df6c..356a675517 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -47,10 +47,13 @@
#include "qstringlist.h"
#include "qvector.h"
#include "qlocale.h"
+#if QT_CONFIG(easingcurve)
#include "qeasingcurve.h"
+#endif
#include "quuid.h"
#include "qvariant.h"
#include "qdatastream.h"
+#include "qregexp.h"
#include "qmetatypeswitcher_p.h"
#if QT_CONFIG(regularexpression)
@@ -516,12 +519,12 @@ static const struct { const char * typeName; int typeNameLength; int type; } typ
QT_FOR_EACH_STATIC_TYPE(QT_ADD_STATIC_METATYPE)
QT_FOR_EACH_STATIC_ALIAS_TYPE(QT_ADD_STATIC_METATYPE_ALIASES_ITER)
QT_FOR_EACH_STATIC_HACKS_TYPE(QT_ADD_STATIC_METATYPE_HACKS_ITER)
- {0, 0, QMetaType::UnknownType}
+ {nullptr, 0, QMetaType::UnknownType}
};
-Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeGuiHelper = 0;
-Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeWidgetsHelper = 0;
-Q_CORE_EXPORT const QMetaObject *qMetaObjectWidgetsHelper = 0;
+Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeGuiHelper = nullptr;
+Q_CORE_EXPORT const QMetaTypeInterface *qMetaTypeWidgetsHelper = nullptr;
+Q_CORE_EXPORT const QMetaObject *qMetaObjectWidgetsHelper = nullptr;
class QCustomTypeInfo : public QMetaTypeInterface
{
@@ -556,7 +559,7 @@ public:
{
const QWriteLocker locker(&lock);
const T* &fun = map[k];
- if (fun != 0)
+ if (fun)
return false;
fun = f;
return true;
@@ -565,7 +568,7 @@ public:
const T *function(Key k) const
{
const QReadLocker locker(&lock);
- return map.value(k, 0);
+ return map.value(k, nullptr);
}
void remove(int from, int to)
@@ -586,13 +589,7 @@ QMetaTypeComparatorRegistry;
typedef QMetaTypeFunctionRegistry<QtPrivate::AbstractDebugStreamFunction,int>
QMetaTypeDebugStreamRegistry;
-namespace
-{
-union CheckThatItIsPod
-{ // This should break if QMetaTypeInterface is not a POD type
- QMetaTypeInterface iface;
-};
-}
+Q_STATIC_ASSERT(std::is_pod<QMetaTypeInterface>::value);
Q_DECLARE_TYPEINFO(QCustomTypeInfo, Q_MOVABLE_TYPE);
Q_GLOBAL_STATIC(QVector<QCustomTypeInfo>, customTypes)
@@ -915,7 +912,7 @@ template <int... TypeIds> struct MetaTypeOffsets<QtPrivate::IndexesList<TypeIds.
short offsets[sizeof...(TypeIds)];
constexpr MetaTypeOffsets() : offsets{calculateOffsetForTypeId(TypeIds)...} {}
- const char *operator[](int typeId) const Q_DECL_NOTHROW
+ const char *operator[](int typeId) const noexcept
{
short o = offsets[typeId];
return o < 0 ? nullptr : metaTypeStrings + o;
@@ -972,7 +969,7 @@ static inline int qMetaTypeStaticType(const char *typeName, int length)
The extra \a firstInvalidIndex parameter is an easy way to avoid
iterating over customTypes() a second time in registerNormalizedType().
*/
-static int qMetaTypeCustomType_unlocked(const char *typeName, int length, int *firstInvalidIndex = 0)
+static int qMetaTypeCustomType_unlocked(const char *typeName, int length, int *firstInvalidIndex = nullptr)
{
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (!ct)
@@ -1005,7 +1002,7 @@ int QMetaType::registerType(const char *typeName, Deleter deleter,
{
return registerType(typeName, deleter, creator,
QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Destruct,
- QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Construct, 0, TypeFlags(), 0);
+ QtMetaTypePrivate::QMetaTypeFunctionHelper<void>::Construct, 0, TypeFlags(), nullptr);
}
/*!
@@ -1612,7 +1609,7 @@ void *QMetaType::create(int type, const void *copy)
QMetaType info(type);
if (int size = info.sizeOf())
return info.construct(operator new(size), copy);
- return 0;
+ return nullptr;
}
/*!
@@ -1638,14 +1635,18 @@ class TypeConstructor {
static void *Construct(const int type, void *where, const void *copy)
{
if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
- return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy) : 0;
+ return Q_LIKELY(qMetaTypeGuiHelper)
+ ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].constructor(where, copy)
+ : nullptr;
if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
- return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].constructor(where, copy) : 0;
+ return Q_LIKELY(qMetaTypeWidgetsHelper)
+ ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].constructor(where, copy)
+ : nullptr;
// This point can be reached only for known types that definition is not available, for example
// in bootstrap mode. We have no other choice then ignore it.
- return 0;
+ return nullptr;
}
};
public:
@@ -1669,7 +1670,7 @@ private:
{
QReadLocker locker(customTypesLock());
if (Q_UNLIKELY(type < QMetaType::User || !ct || ct->count() <= type - QMetaType::User))
- return 0;
+ return nullptr;
const auto &typeInfo = ct->at(type - QMetaType::User);
ctor = typeInfo.constructor;
tctor = typeInfo.typedConstructor;
@@ -1714,7 +1715,7 @@ private:
void *QMetaType::construct(int type, void *where, const void *copy)
{
if (!where)
- return 0;
+ return nullptr;
TypeConstructor constructor(type, where);
return QMetaTypeSwitcher::switcher<void*>(constructor, type, copy);
}
@@ -1860,7 +1861,7 @@ private:
int QMetaType::sizeOf(int type)
{
SizeOf sizeOf(type);
- return QMetaTypeSwitcher::switcher<int>(sizeOf, type, 0);
+ return QMetaTypeSwitcher::switcher<int>(sizeOf, type);
}
namespace {
@@ -1924,7 +1925,7 @@ private:
QMetaType::TypeFlags QMetaType::typeFlags(int type)
{
Flags flags(type);
- return static_cast<QMetaType::TypeFlags>(QMetaTypeSwitcher::switcher<quint32>(flags, type, 0));
+ return static_cast<QMetaType::TypeFlags>(QMetaTypeSwitcher::switcher<quint32>(flags, type));
}
#ifndef QT_BOOTSTRAPPED
@@ -1947,17 +1948,21 @@ public:
{
static const QMetaObject *MetaObject(int type) {
if (QModulesPrivate::QTypeModuleInfo<T>::IsGui)
- return Q_LIKELY(qMetaTypeGuiHelper) ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].metaObject : 0;
+ return Q_LIKELY(qMetaTypeGuiHelper)
+ ? qMetaTypeGuiHelper[type - QMetaType::FirstGuiType].metaObject
+ : nullptr;
if (QModulesPrivate::QTypeModuleInfo<T>::IsWidget)
- return Q_LIKELY(qMetaTypeWidgetsHelper) ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].metaObject : 0;
+ return Q_LIKELY(qMetaTypeWidgetsHelper)
+ ? qMetaTypeWidgetsHelper[type - QMetaType::FirstWidgetsType].metaObject
+ : nullptr;
return 0;
}
};
template <typename T>
const QMetaObject *delegate(const T *) { return MetaObjectImpl<T>::MetaObject(m_type); }
- const QMetaObject *delegate(const void*) { return 0; }
- const QMetaObject *delegate(const QMetaTypeSwitcher::UnknownType*) { return 0; }
+ const QMetaObject *delegate(const void*) { return nullptr; }
+ const QMetaObject *delegate(const QMetaTypeSwitcher::UnknownType*) { return nullptr; }
const QMetaObject *delegate(const QMetaTypeSwitcher::NotBuiltinType*) { return customMetaObject(m_type); }
private:
const int m_type;
@@ -1965,10 +1970,10 @@ private:
{
const QVector<QCustomTypeInfo> * const ct = customTypes();
if (Q_UNLIKELY(!ct || type < QMetaType::User))
- return 0;
+ return nullptr;
QReadLocker locker(customTypesLock());
if (Q_UNLIKELY(ct->count() <= type - QMetaType::User))
- return 0;
+ return nullptr;
return ct->at(type - QMetaType::User).metaObject;
}
};
@@ -1986,10 +1991,10 @@ const QMetaObject *QMetaType::metaObjectForType(int type)
{
#ifndef QT_BOOTSTRAPPED
MetaObject mo(type);
- return QMetaTypeSwitcher::switcher<const QMetaObject*>(mo, type, 0);
+ return QMetaTypeSwitcher::switcher<const QMetaObject*>(mo, type);
#else
Q_UNUSED(type);
- return 0;
+ return nullptr;
#endif
}
@@ -2186,7 +2191,7 @@ private:
QMetaType QMetaType::typeInfo(const int type)
{
TypeInfo typeInfo(type);
- QMetaTypeSwitcher::switcher<void>(typeInfo, type, 0);
+ QMetaTypeSwitcher::switcher<void>(typeInfo, type);
return (typeInfo.info.constructor || typeInfo.info.typedConstructor)
? QMetaType(static_cast<ExtensionFlag>(QMetaType::CreateEx | QMetaType::DestroyEx |
(typeInfo.info.typedConstructor ? QMetaType::ConstructEx | QMetaType::DestructEx : 0))
@@ -2306,7 +2311,7 @@ void QMetaType::dtor()
void *QMetaType::createExtended(const void *copy) const
{
if (m_typeId == QMetaType::UnknownType)
- return 0;
+ return nullptr;
if (Q_UNLIKELY(m_typedConstructor && !m_constructor))
return m_typedConstructor(m_typeId, operator new(m_size), copy);
return m_constructor(operator new(m_size), copy);
@@ -2386,7 +2391,7 @@ uint QMetaType::sizeExtended() const
*/
QMetaType::TypeFlags QMetaType::flagsExtended() const
{
- return 0;
+ return { };
}
/*!
@@ -2399,7 +2404,7 @@ QMetaType::TypeFlags QMetaType::flagsExtended() const
*/
const QMetaObject *QMetaType::metaObjectExtended() const
{
- return 0;
+ return nullptr;
}
@@ -2408,7 +2413,7 @@ namespace QtPrivate
const QMetaObject *metaObjectForQWidget()
{
if (!qMetaTypeWidgetsHelper)
- return 0;
+ return nullptr;
return qMetaObjectWidgetsHelper;
}
}
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index a47fbfe28d..d41f7ee80e 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -94,6 +94,13 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
#define QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(F)\
F(VoidStar, 31, void*) \
+#if QT_CONFIG(easingcurve)
+#define QT_FOR_EACH_STATIC_EASINGCURVE(F)\
+ F(QEasingCurve, 29, QEasingCurve)
+#else
+#define QT_FOR_EACH_STATIC_EASINGCURVE(F)
+#endif
+
#if QT_CONFIG(itemmodel)
#define QT_FOR_EACH_STATIC_ITEMMODEL_CLASS(F)\
F(QModelIndex, 42, QModelIndex) \
@@ -122,7 +129,7 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
F(QPoint, 25, QPoint) \
F(QPointF, 26, QPointF) \
F(QRegExp, 27, QRegExp) \
- F(QEasingCurve, 29, QEasingCurve) \
+ QT_FOR_EACH_STATIC_EASINGCURVE(F) \
F(QUuid, 30, QUuid) \
F(QVariant, 41, QVariant) \
F(QRegularExpression, 44, QRegularExpression) \
@@ -216,7 +223,7 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
F(QQueue) \
F(QStack) \
F(QSet) \
- F(QLinkedList)
+ /*end*/
#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_2ARG(F) \
F(QHash, class) \
@@ -849,7 +856,7 @@ struct VariantData
const uint flags;
private:
// copy constructor allowed to be implicit to silence level 4 warning from MSVC
- VariantData &operator=(const VariantData &) Q_DECL_EQ_DELETE;
+ VariantData &operator=(const VariantData &) = delete;
};
template<typename const_iterator>
@@ -1715,12 +1722,17 @@ namespace QtPrivate {
}
};
+ // hack to delay name lookup to instantiation time by making
+ // EnableInternalData a dependent name:
+ template <typename T>
+ struct EnableInternalDataWrap;
+
template<typename T>
struct QSmartPointerConvertFunctor<QWeakPointer<T> >
{
QObject* operator()(const QWeakPointer<T> &p) const
{
- return p.data();
+ return QtPrivate::EnableInternalDataWrap<T>::internalData(p);
}
};
}
@@ -1994,7 +2006,7 @@ struct QMetaTypeId< SINGLE_ARG_TEMPLATE<T> > \
static int qt_metatype_id() \
{ \
static QBasicAtomicInt metatype_id = Q_BASIC_ATOMIC_INITIALIZER(0); \
- if (const int id = metatype_id.load()) \
+ if (const int id = metatype_id.loadRelaxed()) \
return id; \
const char *tName = QMetaType::typeName(qMetaTypeId<T>()); \
Q_ASSERT(tName); \
diff --git a/src/corelib/kernel/qmetatype_p.h b/src/corelib/kernel/qmetatype_p.h
index eba0207ea7..d743d5a5c7 100644
--- a/src/corelib/kernel/qmetatype_p.h
+++ b/src/corelib/kernel/qmetatype_p.h
@@ -140,12 +140,12 @@ public:
/*saveOp*/(QtMetaTypePrivate::QMetaTypeFunctionHelper<Type, QtMetaTypePrivate::TypeDefinition<Type>::IsAvailable>::Save), \
/*loadOp*/(QtMetaTypePrivate::QMetaTypeFunctionHelper<Type, QtMetaTypePrivate::TypeDefinition<Type>::IsAvailable>::Load),
# define QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type) \
- /*saveOp*/ 0, \
- /*loadOp*/ 0,
+ /*saveOp*/ nullptr, \
+ /*loadOp*/ nullptr,
#else
# define QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type) \
- /*saveOp*/ 0, \
- /*loadOp*/ 0,
+ /*saveOp*/ nullptr, \
+ /*loadOp*/ nullptr,
# define QT_METATYPE_INTERFACE_INIT_DATASTREAM_IMPL(Type) \
QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(Type)
#endif
@@ -153,7 +153,7 @@ public:
#ifndef QT_BOOTSTRAPPED
#define METAOBJECT_DELEGATE(Type) (QtPrivate::MetaObjectForType<Type>::value())
#else
-#define METAOBJECT_DELEGATE(Type) 0
+#define METAOBJECT_DELEGATE(Type) nullptr
#endif
#define QT_METATYPE_INTERFACE_INIT_IMPL(Type, DATASTREAM_DELEGATE) \
@@ -184,11 +184,11 @@ public:
#define QT_METATYPE_INTERFACE_INIT_EMPTY() \
{ \
QT_METATYPE_INTERFACE_INIT_EMPTY_DATASTREAM_IMPL(void) \
- /*constructor*/ 0, \
- /*destructor*/ 0, \
+ /*constructor*/ nullptr, \
+ /*destructor*/ nullptr, \
/*size*/ 0, \
/*flags*/ 0, \
- /*metaObject*/ 0 , \
+ /*metaObject*/ nullptr , \
/*typedConstructor*/ nullptr, \
/*typedDestructor*/ nullptr \
}
@@ -206,7 +206,9 @@ template<> struct TypeDefinition<QCborArray> { static const bool IsAvailable = f
template<> struct TypeDefinition<QCborMap> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QCborSimpleType> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QCborValue> { static const bool IsAvailable = false; };
+#if QT_CONFIG(easingcurve)
template<> struct TypeDefinition<QEasingCurve> { static const bool IsAvailable = false; };
+#endif
template<> struct TypeDefinition<QJsonArray> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonDocument> { static const bool IsAvailable = false; };
template<> struct TypeDefinition<QJsonObject> { static const bool IsAvailable = false; };
diff --git a/src/corelib/kernel/qmetatypeswitcher_p.h b/src/corelib/kernel/qmetatypeswitcher_p.h
index 154fb8ab7f..dabc70f4b0 100644
--- a/src/corelib/kernel/qmetatypeswitcher_p.h
+++ b/src/corelib/kernel/qmetatypeswitcher_p.h
@@ -60,7 +60,7 @@ public:
class NotBuiltinType; // type is not a built-in type, but it may be a custom type or an unknown type
class UnknownType; // type not known to QMetaType system
template<class ReturnType, class DelegateObject>
- static ReturnType switcher(DelegateObject &logic, int type, const void *data);
+ static ReturnType switcher(DelegateObject &logic, int type, const void *data = nullptr);
};
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 598ce75bd4..cf107498dd 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
@@ -58,6 +58,7 @@
#include <qdebug.h>
#include <qpair.h>
#include <qvarlengtharray.h>
+#include <qscopeguard.h>
#include <qset.h>
#if QT_CONFIG(thread)
#include <qsemaphore.h>
@@ -77,6 +78,12 @@ QT_BEGIN_NAMESPACE
static int DIRECT_CONNECTION_ONLY = 0;
+Q_CORE_EXPORT QBasicAtomicPointer<QSignalSpyCallbackSet> qt_signal_spy_callback_set = Q_BASIC_ATOMIC_INITIALIZER(nullptr);
+
+void qt_register_signal_spy_callbacks(QSignalSpyCallbackSet *callback_set)
+{
+ qt_signal_spy_callback_set.storeRelease(callback_set);
+}
QDynamicMetaObjectData::~QDynamicMetaObjectData()
{
@@ -86,12 +93,6 @@ QAbstractDynamicMetaObject::~QAbstractDynamicMetaObject()
{
}
-
-struct QSlotObjectBaseDeleter { // for use with QScopedPointer<QSlotObjectBase,...>
- static void cleanup(QtPrivate::QSlotObjectBase *slot) {
- if (slot) slot->destroyIfLastRef();
- }
-};
static int *queuedConnectionTypes(const QList<QByteArray> &typeNames)
{
int *types = new int [typeNames.count() + 1];
@@ -146,10 +147,9 @@ static QBasicMutex _q_ObjectMutexPool[131];
* \internal
* mutex to be locked when accessing the connectionlists or the senders list
*/
-static inline QMutex *signalSlotLock(const QObject *o)
+static inline QBasicMutex *signalSlotLock(const QObject *o)
{
- return static_cast<QMutex *>(&_q_ObjectMutexPool[
- uint(quintptr(o)) % sizeof(_q_ObjectMutexPool)/sizeof(QBasicMutex)]);
+ return &_q_ObjectMutexPool[uint(quintptr(o)) % sizeof(_q_ObjectMutexPool)/sizeof(QBasicMutex)];
}
#if QT_VERSION < 0x60000
@@ -160,39 +160,6 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *)
{}
#endif
-struct QConnectionSenderSwitcher {
- QObject *receiver;
- QObjectPrivate::Sender *previousSender;
- QObjectPrivate::Sender currentSender;
- bool switched;
-
- inline QConnectionSenderSwitcher() : switched(false) {}
-
- inline QConnectionSenderSwitcher(QObject *receiver, QObject *sender, int signal_absolute_id)
- {
- switchSender(receiver, sender, signal_absolute_id);
- }
-
- inline void switchSender(QObject *receiver, QObject *sender, int signal_absolute_id)
- {
- this->receiver = receiver;
- currentSender.sender = sender;
- currentSender.signal = signal_absolute_id;
- currentSender.ref = 1;
- previousSender = QObjectPrivate::setCurrentSender(receiver, &currentSender);
- switched = true;
- }
-
- inline ~QConnectionSenderSwitcher()
- {
- if (switched)
- QObjectPrivate::resetCurrentSender(receiver, &currentSender, previousSender);
- }
-private:
- Q_DISABLE_COPY(QConnectionSenderSwitcher)
-};
-
-
void (*QAbstractDeclarativeData::destroyed)(QAbstractDeclarativeData *, QObject *) = 0;
void (*QAbstractDeclarativeData::destroyed_qml1)(QAbstractDeclarativeData *, QObject *) = 0;
void (*QAbstractDeclarativeData::parentChanged)(QAbstractDeclarativeData *, QObject *, QObject *) = 0;
@@ -201,6 +168,12 @@ int (*QAbstractDeclarativeData::receivers)(QAbstractDeclarativeData *, const QO
bool (*QAbstractDeclarativeData::isSignalConnected)(QAbstractDeclarativeData *, const QObject *, int) = 0;
void (*QAbstractDeclarativeData::setWidgetParent)(QObject *, QObject *) = 0;
+/*!
+ \fn QObjectData::QObjectData()
+ \internal
+ */
+
+
QObjectData::~QObjectData() {}
QMetaObject *QObjectData::dynamicMetaObject() const
@@ -209,7 +182,7 @@ QMetaObject *QObjectData::dynamicMetaObject() const
}
QObjectPrivate::QObjectPrivate(int version)
- : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0)
+ : threadData(0), currentChildBeingDeleted(0)
{
#ifdef QT_BUILD_INTERNAL
// Don't check the version parameter in internal builds.
@@ -232,7 +205,6 @@ QObjectPrivate::QObjectPrivate(int version)
receiveChildEvents = true;
postedEvents = 0;
extraData = 0;
- connectedSignals[0] = connectedSignals[1] = 0;
metaObject = 0;
isWindow = false;
deleteLaterCalled = false;
@@ -241,10 +213,10 @@ QObjectPrivate::QObjectPrivate(int version)
QObjectPrivate::~QObjectPrivate()
{
if (extraData && !extraData->runningTimers.isEmpty()) {
- if (Q_LIKELY(threadData->thread == QThread::currentThread())) {
+ if (Q_LIKELY(threadData->thread.loadAcquire() == QThread::currentThread())) {
// unregister pending timers
if (threadData->hasEventDispatcher())
- threadData->eventDispatcher.load()->unregisterTimers(q_ptr);
+ threadData->eventDispatcher.loadRelaxed()->unregisterTimers(q_ptr);
// release the timer ids back to the pool
for (int i = 0; i < extraData->runningTimers.size(); ++i)
@@ -285,59 +257,22 @@ static void computeOffsets(const QMetaObject *metaobject, int *signalOffset, int
}
}
-/*
- This vector contains the all connections from an object.
-
- Each object may have one vector containing the lists of
- connections for a given signal. The index in the vector correspond
- to the signal index. The signal index is the one returned by
- QObjectPrivate::signalIndex (not QMetaObject::indexOfSignal).
- Negative index means connections to all signals.
-
- This vector is protected by the object mutex (signalSlotMutexes())
-
- Each Connection is also part of a 'senders' linked list. The mutex
- of the receiver must be locked when touching the pointers of this
- linked list.
-*/
-class QObjectConnectionListVector : public QVector<QObjectPrivate::ConnectionList>
-{
-public:
- bool orphaned; //the QObject owner of this vector has been destroyed while the vector was inUse
- bool dirty; //some Connection have been disconnected (their receiver is 0) but not removed from the list yet
- int inUse; //number of functions that are currently accessing this object or its connections
- QObjectPrivate::ConnectionList allsignals;
-
- QObjectConnectionListVector()
- : QVector<QObjectPrivate::ConnectionList>(), orphaned(false), dirty(false), inUse(0)
- { }
-
- QObjectPrivate::ConnectionList &operator[](int at)
- {
- if (at < 0)
- return allsignals;
- return QVector<QObjectPrivate::ConnectionList>::operator[](at);
- }
-};
-
// Used by QAccessibleWidget
bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const
{
Q_Q(const QObject);
int signal_index = signalIndex(signal);
- if (signal_index < 0)
+ ConnectionData *cd = connections.loadRelaxed();
+ if (signal_index < 0 || !cd)
return false;
- QMutexLocker locker(signalSlotLock(q));
- if (connectionLists) {
- if (signal_index < connectionLists->count()) {
- const QObjectPrivate::Connection *c =
- connectionLists->at(signal_index).first;
-
- while (c) {
- if (c->receiver == receiver)
- return true;
- c = c->nextConnectionList;
- }
+ QBasicMutexLocker locker(signalSlotLock(q));
+ if (signal_index < cd->signalVectorCount()) {
+ const QObjectPrivate::Connection *c = cd->signalVector.loadRelaxed()->at(signal_index).first.loadRelaxed();
+
+ while (c) {
+ if (c->receiver.loadRelaxed() == receiver)
+ return true;
+ c = c->nextConnectionList.loadRelaxed();
}
}
return false;
@@ -346,21 +281,19 @@ bool QObjectPrivate::isSender(const QObject *receiver, const char *signal) const
// Used by QAccessibleWidget
QObjectList QObjectPrivate::receiverList(const char *signal) const
{
- Q_Q(const QObject);
QObjectList returnValue;
int signal_index = signalIndex(signal);
- if (signal_index < 0)
+ ConnectionData *cd = connections.loadRelaxed();
+ if (signal_index < 0 || !cd)
return returnValue;
- QMutexLocker locker(signalSlotLock(q));
- if (connectionLists) {
- if (signal_index < connectionLists->count()) {
- const QObjectPrivate::Connection *c = connectionLists->at(signal_index).first;
-
- while (c) {
- if (c->receiver)
- returnValue << c->receiver;
- c = c->nextConnectionList;
- }
+ if (signal_index < cd->signalVectorCount()) {
+ const QObjectPrivate::Connection *c = cd->signalVector.loadRelaxed()->at(signal_index).first.loadRelaxed();
+
+ while (c) {
+ QObject *r = c->receiver.loadRelaxed();
+ if (r)
+ returnValue << r;
+ c = c->nextConnectionList.loadRelaxed();
}
}
return returnValue;
@@ -370,9 +303,12 @@ QObjectList QObjectPrivate::receiverList(const char *signal) const
QObjectList QObjectPrivate::senderList() const
{
QObjectList returnValue;
- QMutexLocker locker(signalSlotLock(q_func()));
- for (Connection *c = senders; c; c = c->next)
- returnValue << c->sender;
+ ConnectionData *cd = connections.loadRelaxed();
+ if (cd) {
+ QBasicMutexLocker locker(signalSlotLock(q_func()));
+ for (Connection *c = cd->senders; c; c = c->next)
+ returnValue << c->sender;
+ }
return returnValue;
}
@@ -389,103 +325,271 @@ QObjectList QObjectPrivate::senderList() const
void QObjectPrivate::addConnection(int signal, Connection *c)
{
Q_ASSERT(c->sender == q_ptr);
- if (!connectionLists)
- connectionLists = new QObjectConnectionListVector();
- if (signal >= connectionLists->count())
- connectionLists->resize(signal + 1);
-
- ConnectionList &connectionList = (*connectionLists)[signal];
- if (connectionList.last) {
- connectionList.last->nextConnectionList = c;
+ ensureConnectionData();
+ ConnectionData *cd = connections.loadRelaxed();
+ cd->resizeSignalVector(signal + 1);
+
+ ConnectionList &connectionList = cd->connectionsForSignal(signal);
+ if (connectionList.last.loadRelaxed()) {
+ Q_ASSERT(connectionList.last.loadRelaxed()->receiver.loadRelaxed());
+ connectionList.last.loadRelaxed()->nextConnectionList.storeRelaxed(c);
} else {
- connectionList.first = c;
+ connectionList.first.storeRelaxed(c);
}
- connectionList.last = c;
+ c->id = ++cd->currentConnectionId;
+ c->prevConnectionList = connectionList.last.loadRelaxed();
+ connectionList.last.storeRelaxed(c);
- cleanConnectionLists();
+ QObjectPrivate *rd = QObjectPrivate::get(c->receiver.loadRelaxed());
+ rd->ensureConnectionData();
- c->prev = &(QObjectPrivate::get(c->receiver)->senders);
+ c->prev = &(rd->connections.loadRelaxed()->senders);
c->next = *c->prev;
*c->prev = c;
if (c->next)
c->next->prev = &c->next;
+}
+
+void QObjectPrivate::ConnectionData::removeConnection(QObjectPrivate::Connection *c)
+{
+ Q_ASSERT(c->receiver.loadRelaxed());
+ ConnectionList &connections = signalVector.loadRelaxed()->at(c->signal_index);
+ c->receiver.storeRelaxed(nullptr);
+ QThreadData *td = c->receiverThreadData.loadRelaxed();
+ if (td)
+ td->deref();
+ c->receiverThreadData.storeRelaxed(nullptr);
- if (signal < 0) {
- connectedSignals[0] = connectedSignals[1] = ~0;
- } else if (signal < (int)sizeof(connectedSignals) * 8) {
- connectedSignals[signal >> 5] |= (1 << (signal & 0x1f));
+#ifndef QT_NO_DEBUG
+ bool found = false;
+ for (Connection *cc = connections.first.loadRelaxed(); cc; cc = cc->nextConnectionList.loadRelaxed()) {
+ if (cc == c) {
+ found = true;
+ break;
+ }
+ }
+ Q_ASSERT(found);
+#endif
+
+ // remove from the senders linked list
+ *c->prev = c->next;
+ if (c->next)
+ c->next->prev = c->prev;
+ c->prev = nullptr;
+
+ if (connections.first.loadRelaxed() == c)
+ connections.first.storeRelaxed(c->nextConnectionList.loadRelaxed());
+ if (connections.last.loadRelaxed() == c)
+ connections.last.storeRelaxed(c->prevConnectionList);
+ Q_ASSERT(signalVector.loadRelaxed()->at(c->signal_index).first.loadRelaxed() != c);
+ Q_ASSERT(signalVector.loadRelaxed()->at(c->signal_index).last.loadRelaxed() != c);
+
+ // keep c->nextConnectionList intact, as it might still get accessed by activate
+ Connection *n = c->nextConnectionList.loadRelaxed();
+ if (n)
+ n->prevConnectionList = c->prevConnectionList;
+ if (c->prevConnectionList)
+ c->prevConnectionList->nextConnectionList.storeRelaxed(n);
+ c->prevConnectionList = nullptr;
+
+ Q_ASSERT(c != orphaned.loadRelaxed());
+ // add c to orphanedConnections
+ c->nextInOrphanList = orphaned.loadRelaxed();
+ orphaned.storeRelaxed(c);
+
+#ifndef QT_NO_DEBUG
+ found = false;
+ for (Connection *cc = connections.first.loadRelaxed(); cc; cc = cc->nextConnectionList.loadRelaxed()) {
+ if (cc == c) {
+ found = true;
+ break;
+ }
}
+ Q_ASSERT(!found);
+#endif
+
}
-void QObjectPrivate::cleanConnectionLists()
+void QObjectPrivate::ConnectionData::cleanOrphanedConnectionsImpl(QObject *sender)
{
- if (connectionLists->dirty && !connectionLists->inUse) {
- // remove broken connections
- bool allConnected = false;
- for (int signal = -1; signal < connectionLists->count(); ++signal) {
- QObjectPrivate::ConnectionList &connectionList =
- (*connectionLists)[signal];
-
- // Set to the last entry in the connection list that was *not*
- // deleted. This is needed to update the list's last pointer
- // at the end of the cleanup.
- QObjectPrivate::Connection *last = 0;
-
- QObjectPrivate::Connection **prev = &connectionList.first;
- QObjectPrivate::Connection *c = *prev;
- bool connected = false; // whether the signal is still connected somewhere
- while (c) {
- if (c->receiver) {
- last = c;
- prev = &c->nextConnectionList;
- c = *prev;
- connected = true;
- } else {
- QObjectPrivate::Connection *next = c->nextConnectionList;
- *prev = next;
- c->deref();
- c = next;
- }
- }
+ ConnectionOrSignalVector *c = nullptr;
+ {
+ QBasicMutexLocker l(signalSlotLock(sender));
+ if (ref.loadAcquire() > 1)
+ return;
+
+ // Since ref == 1, no activate() is in process since we locked the mutex. That implies,
+ // that nothing can reference the orphaned connection objects anymore and they can
+ // be safely deleted
+ c = orphaned.loadRelaxed();
+ orphaned.storeRelaxed(nullptr);
+ }
+ deleteOrphaned(c);
+}
- // Correct the connection list's last pointer.
- // As conectionList.last could equal last, this could be a noop
- connectionList.last = last;
+void QObjectPrivate::ConnectionData::deleteOrphaned(QObjectPrivate::ConnectionOrSignalVector *o)
+{
+ while (o) {
+ QObjectPrivate::ConnectionOrSignalVector *next = nullptr;
+ if (SignalVector *v = ConnectionOrSignalVector::asSignalVector(o)) {
+ next = v->nextInOrphanList;
+ free(v);
+ } else {
+ QObjectPrivate::Connection *c = static_cast<Connection *>(o);
+ next = c->nextInOrphanList;
+ Q_ASSERT(!c->receiver.loadRelaxed());
+ Q_ASSERT(!c->prev);
+ c->freeSlotObject();
+ c->deref();
+ }
+ o = next;
+ }
+}
- if (!allConnected && !connected && signal >= 0
- && size_t(signal) < sizeof(connectedSignals) * 8) {
- // This signal is no longer connected
- connectedSignals[signal >> 5] &= ~(1 << (signal & 0x1f));
- } else if (signal == -1) {
- allConnected = connected;
- }
+/*! \internal
+
+ Returns \c true if the signal with index \a signal_index from object \a sender is connected.
+
+ \a signal_index must be the index returned by QObjectPrivate::signalIndex;
+*/
+bool QObjectPrivate::isSignalConnected(uint signalIndex, bool checkDeclarative) const
+{
+ if (checkDeclarative && isDeclarativeSignalConnected(signalIndex))
+ return true;
+
+ ConnectionData *cd = connections.loadRelaxed();
+ if (!cd)
+ return false;
+ SignalVector *signalVector = cd->signalVector.loadRelaxed();
+ if (!signalVector)
+ return false;
+
+ if (signalVector->at(-1).first.loadRelaxed())
+ return true;
+
+ if (signalIndex < uint(cd->signalVectorCount())) {
+ const QObjectPrivate::Connection *c = signalVector->at(signalIndex).first.loadRelaxed();
+ while (c) {
+ if (c->receiver.loadRelaxed())
+ return true;
+ c = c->nextConnectionList.loadRelaxed();
}
- connectionLists->dirty = false;
}
+ return false;
+}
+
+bool QObjectPrivate::maybeSignalConnected(uint signalIndex) const
+{
+ ConnectionData *cd = connections.loadRelaxed();
+ if (!cd)
+ return false;
+ SignalVector *signalVector = cd->signalVector.loadRelaxed();
+ if (!signalVector)
+ return false;
+
+ if (signalVector->at(-1).first.loadAcquire())
+ return true;
+
+ if (signalIndex < uint(cd->signalVectorCount())) {
+ const QObjectPrivate::Connection *c = signalVector->at(signalIndex).first.loadAcquire();
+ return c != nullptr;
+ }
+ return false;
+}
+
+/*!
+ \internal
+ */
+QAbstractMetaCallEvent::~QAbstractMetaCallEvent()
+{
+#if QT_CONFIG(thread)
+ if (semaphore_)
+ semaphore_->release();
+#endif
}
/*!
\internal
*/
-QMetaCallEvent::QMetaCallEvent(ushort method_offset, ushort method_relative, QObjectPrivate::StaticMetaCallFunction callFunction,
+inline void QMetaCallEvent::allocArgs()
+{
+ if (!d.nargs_)
+ return;
+
+ constexpr size_t each = sizeof(void*) + sizeof(int);
+ void *const memory = d.nargs_ * each > sizeof(prealloc_) ?
+ calloc(d.nargs_, each) : prealloc_;
+
+ Q_CHECK_PTR(memory);
+ d.args_ = static_cast<void **>(memory);
+}
+
+/*!
+ \internal
+
+ Used for blocking queued connections, just passes \a args through without
+ allocating any memory.
+ */
+QMetaCallEvent::QMetaCallEvent(ushort method_offset, ushort method_relative,
+ QObjectPrivate::StaticMetaCallFunction callFunction,
const QObject *sender, int signalId,
- int nargs, int *types, void **args, QSemaphore *semaphore)
- : QEvent(MetaCall), slotObj_(0), sender_(sender), signalId_(signalId),
- nargs_(nargs), types_(types), args_(args), semaphore_(semaphore),
- callFunction_(callFunction), method_offset_(method_offset), method_relative_(method_relative)
-{ }
+ void **args, QSemaphore *semaphore)
+ : QAbstractMetaCallEvent(sender, signalId, semaphore),
+ d({nullptr, args, callFunction, 0, method_offset, method_relative}),
+ prealloc_()
+{
+}
+
+/*!
+ \internal
+
+ Used for blocking queued connections, just passes \a args through without
+ allocating any memory.
+ */
+QMetaCallEvent::QMetaCallEvent(QtPrivate::QSlotObjectBase *slotO,
+ const QObject *sender, int signalId,
+ void **args, QSemaphore *semaphore)
+ : QAbstractMetaCallEvent(sender, signalId, semaphore),
+ d({slotO, args, nullptr, 0, 0, ushort(-1)}),
+ prealloc_()
+{
+ if (d.slotObj_)
+ d.slotObj_->ref();
+}
/*!
\internal
+
+ Allocates memory for \a nargs; code creating an event needs to initialize
+ the void* and int arrays by accessing \a args() and \a types(), respectively.
*/
-QMetaCallEvent::QMetaCallEvent(QtPrivate::QSlotObjectBase *slotO, const QObject *sender, int signalId,
- int nargs, int *types, void **args, QSemaphore *semaphore)
- : QEvent(MetaCall), slotObj_(slotO), sender_(sender), signalId_(signalId),
- nargs_(nargs), types_(types), args_(args), semaphore_(semaphore),
- callFunction_(0), method_offset_(0), method_relative_(ushort(-1))
+QMetaCallEvent::QMetaCallEvent(ushort method_offset, ushort method_relative,
+ QObjectPrivate::StaticMetaCallFunction callFunction,
+ const QObject *sender, int signalId,
+ int nargs)
+ : QAbstractMetaCallEvent(sender, signalId),
+ d({nullptr, nullptr, callFunction, nargs, method_offset, method_relative}),
+ prealloc_()
+{
+ allocArgs();
+}
+
+/*!
+ \internal
+
+ Allocates memory for \a nargs; code creating an event needs to initialize
+ the void* and int arrays by accessing \a args() and \a types(), respectively.
+ */
+QMetaCallEvent::QMetaCallEvent(QtPrivate::QSlotObjectBase *slotO,
+ const QObject *sender, int signalId,
+ int nargs)
+ : QAbstractMetaCallEvent(sender, signalId),
+ d({slotO, nullptr, nullptr, nargs, 0, ushort(-1)}),
+ prealloc_()
{
- if (slotObj_)
- slotObj_->ref();
+ if (d.slotObj_)
+ d.slotObj_->ref();
+ allocArgs();
}
/*!
@@ -493,20 +597,17 @@ QMetaCallEvent::QMetaCallEvent(QtPrivate::QSlotObjectBase *slotO, const QObject
*/
QMetaCallEvent::~QMetaCallEvent()
{
- if (types_) {
- for (int i = 0; i < nargs_; ++i) {
- if (types_[i] && args_[i])
- QMetaType::destroy(types_[i], args_[i]);
+ if (d.nargs_) {
+ int *typeIDs = types();
+ for (int i = 0; i < d.nargs_; ++i) {
+ if (typeIDs[i] && d.args_[i])
+ QMetaType::destroy(typeIDs[i], d.args_[i]);
}
- free(types_);
- free(args_);
+ if (reinterpret_cast<void*>(d.args_) != reinterpret_cast<void*>(prealloc_))
+ free(d.args_);
}
-#if QT_CONFIG(thread)
- if (semaphore_)
- semaphore_->release();
-#endif
- if (slotObj_)
- slotObj_->destroyIfLastRef();
+ if (d.slotObj_)
+ d.slotObj_->destroyIfLastRef();
}
/*!
@@ -514,12 +615,13 @@ QMetaCallEvent::~QMetaCallEvent()
*/
void QMetaCallEvent::placeMetaCall(QObject *object)
{
- if (slotObj_) {
- slotObj_->call(object, args_);
- } else if (callFunction_ && method_offset_ <= object->metaObject()->methodOffset()) {
- callFunction_(object, QMetaObject::InvokeMetaMethod, method_relative_, args_);
+ if (d.slotObj_) {
+ d.slotObj_->call(object, d.args_);
+ } else if (d.callFunction_ && d.method_offset_ <= object->metaObject()->methodOffset()) {
+ d.callFunction_(object, QMetaObject::InvokeMetaMethod, d.method_relative_, d.args_);
} else {
- QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod, method_offset_ + method_relative_, args_);
+ QMetaObject::metacall(object, QMetaObject::InvokeMetaMethod,
+ d.method_offset_ + d.method_relative_, d.args_);
}
}
@@ -773,8 +875,8 @@ static bool check_parent_thread(QObject *parent,
QThreadData *currentThreadData)
{
if (parent && parentThreadData != currentThreadData) {
- QThread *parentThread = parentThreadData->thread;
- QThread *currentThread = currentThreadData->thread;
+ QThread *parentThread = parentThreadData->thread.loadAcquire();
+ QThread *currentThread = currentThreadData->thread.loadAcquire();
qWarning("QObject: Cannot create children for a parent that is in a different thread.\n"
"(Parent is %s(%p), parent's thread is %s(%p), current thread is %s(%p)",
parent->metaObject()->className(),
@@ -806,6 +908,8 @@ static bool check_parent_thread(QObject *parent,
QObject::QObject(QObject *parent)
: d_ptr(new QObjectPrivate)
{
+ Q_ASSERT_X(this != parent, Q_FUNC_INFO, "Cannot parent a QObject to itself");
+
Q_D(QObject);
d_ptr->q_ptr = this;
d->threadData = (parent && !parent->thread()) ? parent->d_func()->threadData : QThreadData::current();
@@ -834,6 +938,8 @@ QObject::QObject(QObject *parent)
QObject::QObject(QObjectPrivate &dd, QObject *parent)
: d_ptr(&dd)
{
+ Q_ASSERT_X(this != parent, Q_FUNC_INFO, "Cannot parent a QObject to itself");
+
Q_D(QObject);
d_ptr->q_ptr = this;
d->threadData = (parent && !parent->thread()) ? parent->d_func()->threadData : QThreadData::current();
@@ -894,15 +1000,15 @@ QObject::~QObject()
d->wasDeleted = true;
d->blockSig = 0; // unblock signals so we always emit destroyed()
- QtSharedPointer::ExternalRefCountData *sharedRefcount = d->sharedRefcount.load();
+ QtSharedPointer::ExternalRefCountData *sharedRefcount = d->sharedRefcount.loadRelaxed();
if (sharedRefcount) {
- if (sharedRefcount->strongref.load() > 0) {
+ if (sharedRefcount->strongref.loadRelaxed() > 0) {
qWarning("QObject: shared QObject was deleted directly. The program is malformed and may crash.");
// but continue deleting, it's too late to stop anyway
}
// indicate to all QWeakPointers that this QObject has now been deleted
- sharedRefcount->strongref.store(0);
+ sharedRefcount->strongref.storeRelaxed(0);
if (!sharedRefcount->weakref.deref())
delete sharedRefcount;
}
@@ -921,92 +1027,56 @@ QObject::~QObject()
}
}
- // set ref to zero to indicate that this object has been deleted
- if (d->currentSender != 0)
- d->currentSender->ref = 0;
- d->currentSender = 0;
+ QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed();
+ if (cd) {
+ if (cd->currentSender) {
+ cd->currentSender->receiverDeleted();
+ cd->currentSender = nullptr;
+ }
- if (d->connectionLists || d->senders) {
- QMutex *signalSlotMutex = signalSlotLock(this);
- QMutexLocker locker(signalSlotMutex);
+ QBasicMutex *signalSlotMutex = signalSlotLock(this);
+ QBasicMutexLocker locker(signalSlotMutex);
// disconnect all receivers
- if (d->connectionLists) {
- ++d->connectionLists->inUse;
- int connectionListsCount = d->connectionLists->count();
- for (int signal = -1; signal < connectionListsCount; ++signal) {
- QObjectPrivate::ConnectionList &connectionList =
- (*d->connectionLists)[signal];
-
- while (QObjectPrivate::Connection *c = connectionList.first) {
- if (!c->receiver) {
- connectionList.first = c->nextConnectionList;
- c->deref();
- continue;
- }
-
- QMutex *m = signalSlotLock(c->receiver);
- bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
-
- if (c->receiver) {
- *c->prev = c->next;
- if (c->next) c->next->prev = c->prev;
- }
- c->receiver = 0;
- if (needToUnlock)
- m->unlock();
-
- connectionList.first = c->nextConnectionList;
-
- // The destroy operation must happen outside the lock
- if (c->isSlotObject) {
- c->isSlotObject = false;
- locker.unlock();
- c->slotObj->destroyIfLastRef();
- locker.relock();
- }
- c->deref();
+ int receiverCount = cd->signalVectorCount();
+ for (int signal = -1; signal < receiverCount; ++signal) {
+ QObjectPrivate::ConnectionList &connectionList = cd->connectionsForSignal(signal);
+
+ while (QObjectPrivate::Connection *c = connectionList.first.loadRelaxed()) {
+ Q_ASSERT(c->receiver.loadAcquire());
+
+ QBasicMutex *m = signalSlotLock(c->receiver.loadRelaxed());
+ bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
+ if (c->receiver.loadAcquire()) {
+ cd->removeConnection(c);
+ Q_ASSERT(connectionList.first.loadRelaxed() != c);
}
+ if (needToUnlock)
+ m->unlock();
}
-
- if (!--d->connectionLists->inUse) {
- delete d->connectionLists;
- } else {
- d->connectionLists->orphaned = true;
- }
- d->connectionLists = 0;
}
/* Disconnect all senders:
- * This loop basically just does
- * for (node = d->senders; node; node = node->next) { ... }
- *
- * We need to temporarily unlock the receiver mutex to destroy the functors or to lock the
- * sender's mutex. And when the mutex is released, node->next might be destroyed by another
- * thread. That's why we set node->prev to &node, that way, if node is destroyed, node will
- * be updated.
*/
- QObjectPrivate::Connection *node = d->senders;
- while (node) {
+ while (QObjectPrivate::Connection *node = cd->senders) {
+ Q_ASSERT(node->receiver.loadAcquire());
QObject *sender = node->sender;
// Send disconnectNotify before removing the connection from sender's connection list.
// This ensures any eventual destructor of sender will block on getting receiver's lock
// and not finish until we release it.
sender->disconnectNotify(QMetaObjectPrivate::signal(sender->metaObject(), node->signal_index));
- QMutex *m = signalSlotLock(sender);
- node->prev = &node;
+ QBasicMutex *m = signalSlotLock(sender);
bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
//the node has maybe been removed while the mutex was unlocked in relock?
- if (!node || node->sender != sender) {
+ if (node != cd->senders) {
// We hold the wrong mutex
Q_ASSERT(needToUnlock);
m->unlock();
continue;
}
- node->receiver = 0;
- QObjectConnectionListVector *senderLists = sender->d_func()->connectionLists;
- if (senderLists)
- senderLists->dirty = true;
+
+ QObjectPrivate::ConnectionData *senderData = sender->d_func()->connections.loadRelaxed();
+ Q_ASSERT(senderData);
QtPrivate::QSlotObjectBase *slotObj = nullptr;
if (node->isSlotObject) {
@@ -1014,19 +1084,24 @@ QObject::~QObject()
node->isSlotObject = false;
}
- node = node->next;
+ senderData->removeConnection(node);
if (needToUnlock)
m->unlock();
if (slotObj) {
- if (node)
- node->prev = &node;
locker.unlock();
slotObj->destroyIfLastRef();
locker.relock();
}
}
+
+ // invalidate all connections on the object and make sure
+ // activate() will skip them
+ cd->currentConnectionId.storeRelaxed(0);
}
+ if (cd && !cd->ref.deref())
+ delete cd;
+ d->connections.storeRelaxed(nullptr);
if (!d->children.isEmpty())
d->deleteChildren();
@@ -1046,7 +1121,7 @@ QObject::~QObject()
QObjectPrivate::Connection::~Connection()
{
if (ownArgumentTypes) {
- const int *v = argumentTypes.load();
+ const int *v = argumentTypes.loadRelaxed();
if (v != &DIRECT_CONNECTION_ONLY)
delete [] v;
}
@@ -1253,9 +1328,13 @@ bool QObject::event(QEvent *e)
case QEvent::MetaCall:
{
- QMetaCallEvent *mce = static_cast<QMetaCallEvent*>(e);
+ QAbstractMetaCallEvent *mce = static_cast<QAbstractMetaCallEvent*>(e);
- QConnectionSenderSwitcher sw(this, const_cast<QObject*>(mce->sender()), mce->signalId());
+ if (!d_func()->connections.loadRelaxed()) {
+ QBasicMutexLocker locker(signalSlotLock(this));
+ d_func()->ensureConnectionData();
+ }
+ QObjectPrivate::Sender sender(this, const_cast<QObject*>(mce->sender()), mce->signalId());
mce->placeMetaCall(this);
break;
@@ -1264,7 +1343,7 @@ bool QObject::event(QEvent *e)
case QEvent::ThreadChange: {
Q_D(QObject);
QThreadData *threadData = d->threadData;
- QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher.loadRelaxed();
if (eventDispatcher) {
QList<QAbstractEventDispatcher::TimerInfo> timers = eventDispatcher->registeredTimers(this);
if (!timers.isEmpty()) {
@@ -1415,7 +1494,7 @@ bool QObject::eventFilter(QObject * /* watched */, QEvent * /* event */)
\sa signalsBlocked(), QSignalBlocker
*/
-bool QObject::blockSignals(bool block) Q_DECL_NOTHROW
+bool QObject::blockSignals(bool block) noexcept
{
Q_D(QObject);
bool previous = d->blockSig;
@@ -1430,7 +1509,7 @@ bool QObject::blockSignals(bool block) Q_DECL_NOTHROW
*/
QThread *QObject::thread() const
{
- return d_func()->threadData->thread;
+ return d_func()->threadData->thread.loadAcquire();
}
/*!
@@ -1477,7 +1556,7 @@ void QObject::moveToThread(QThread *targetThread)
{
Q_D(QObject);
- if (d->threadData->thread == targetThread) {
+ if (d->threadData->thread.loadAcquire() == targetThread) {
// object is already in this thread
return;
}
@@ -1493,13 +1572,13 @@ void QObject::moveToThread(QThread *targetThread)
QThreadData *currentData = QThreadData::current();
QThreadData *targetData = targetThread ? QThreadData::get2(targetThread) : nullptr;
- if (d->threadData->thread == 0 && currentData == targetData) {
+ if (d->threadData->thread.loadAcquire() == 0 && currentData == targetData) {
// one exception to the rule: we allow moving objects with no thread affinity to the current thread
currentData = d->threadData;
} else if (d->threadData != currentData) {
qWarning("QObject::moveToThread: Current thread (%p) is not the object's thread (%p).\n"
"Cannot move to target thread (%p)\n",
- currentData->thread.load(), d->threadData->thread.load(), targetData ? targetData->thread.load() : nullptr);
+ currentData->thread.loadRelaxed(), d->threadData->thread.loadRelaxed(), targetData ? targetData->thread.loadRelaxed() : nullptr);
#ifdef Q_OS_MAC
qWarning("You might be loading two sets of Qt binaries into the same process. "
@@ -1516,6 +1595,9 @@ void QObject::moveToThread(QThread *targetThread)
if (!targetData)
targetData = new QThreadData(0);
+ // make sure nobody adds/removes connections to this object while we're moving it
+ QMutexLocker l(signalSlotLock(this));
+
QOrderedMutexLocker locker(&currentData->postEventList.mutex,
&targetData->postEventList.mutex);
@@ -1561,13 +1643,35 @@ void QObjectPrivate::setThreadData_helper(QThreadData *currentData, QThreadData
}
if (eventsMoved > 0 && targetData->hasEventDispatcher()) {
targetData->canWait = false;
- targetData->eventDispatcher.load()->wakeUp();
+ targetData->eventDispatcher.loadRelaxed()->wakeUp();
}
// the current emitting thread shouldn't restore currentSender after calling moveToThread()
- if (currentSender)
- currentSender->ref = 0;
- currentSender = 0;
+ ConnectionData *cd = connections.loadRelaxed();
+ if (cd) {
+ if (cd->currentSender) {
+ cd->currentSender->receiverDeleted();
+ cd->currentSender = nullptr;
+ }
+
+ // adjust the receiverThreadId values in the Connections
+ if (cd) {
+ auto *c = cd->senders;
+ while (c) {
+ QObject *r = c->receiver.loadRelaxed();
+ if (r) {
+ Q_ASSERT(r == q);
+ targetData->ref();
+ QThreadData *old = c->receiverThreadData.loadRelaxed();
+ if (old)
+ old->deref();
+ c->receiverThreadData.storeRelaxed(targetData);
+ }
+ c = c->next;
+ }
+ }
+
+ }
// set new thread data
targetData->ref();
@@ -1584,7 +1688,7 @@ void QObjectPrivate::_q_reregisterTimers(void *pointer)
{
Q_Q(QObject);
QList<QAbstractEventDispatcher::TimerInfo> *timerList = reinterpret_cast<QList<QAbstractEventDispatcher::TimerInfo> *>(pointer);
- QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher.loadRelaxed();
for (int i = 0; i < timerList->size(); ++i) {
const QAbstractEventDispatcher::TimerInfo &ti = timerList->at(i);
eventDispatcher->registerTimer(ti.timerId, ti.interval, ti.timerType, q);
@@ -1650,7 +1754,7 @@ int QObject::startTimer(int interval, Qt::TimerType timerType)
qWarning("QObject::startTimer: Timers cannot be started from another thread");
return 0;
}
- int timerId = d->threadData->eventDispatcher.load()->registerTimer(interval, timerType, this);
+ int timerId = d->threadData->eventDispatcher.loadRelaxed()->registerTimer(interval, timerType, this);
if (!d->extraData)
d->extraData = new QObjectPrivate::ExtraData;
d->extraData->runningTimers.append(timerId);
@@ -1716,16 +1820,16 @@ void QObject::killTimer(int id)
int at = d->extraData ? d->extraData->runningTimers.indexOf(id) : -1;
if (at == -1) {
// timer isn't owned by this object
- qWarning("QObject::killTimer(): Error: timer id %d is not valid for object %p (%s, %s), timer has not been killed",
+ qWarning("QObject::killTimer(): Error: timer id %d is not valid for object %p (%s, %ls), timer has not been killed",
id,
this,
metaObject()->className(),
- qPrintable(objectName()));
+ qUtf16Printable(objectName()));
return;
}
if (d->threadData->hasEventDispatcher())
- d->threadData->eventDispatcher.load()->unregisterTimer(id);
+ d->threadData->eventDispatcher.loadRelaxed()->unregisterTimer(id);
d->extraData->runningTimers.remove(at);
QAbstractEventDispatcherPrivate::releaseTimerId(id);
@@ -2026,8 +2130,25 @@ void QObjectPrivate::deleteChildren()
void QObjectPrivate::setParent_helper(QObject *o)
{
Q_Q(QObject);
+ Q_ASSERT_X(q != o, Q_FUNC_INFO, "Cannot parent a QObject to itself");
+#ifdef QT_DEBUG
+ const auto checkForParentChildLoops = qScopeGuard([&](){
+ int depth = 0;
+ auto p = parent;
+ while (p) {
+ if (++depth == CheckForParentChildLoopsWarnDepth) {
+ qWarning("QObject %p (class: '%s', object name: '%s') may have a loop in its parent-child chain; "
+ "this is undefined behavior",
+ q, q->metaObject()->className(), qPrintable(q->objectName()));
+ }
+ p = p->parent();
+ }
+ });
+#endif
+
if (o == parent)
return;
+
if (parent) {
QObjectPrivate *parentD = parent->d_func();
if (parentD->isDeletingChildren && wasDeleted
@@ -2378,13 +2499,14 @@ QObject *QObject::sender() const
{
Q_D(const QObject);
- QMutexLocker locker(signalSlotLock(this));
- if (!d->currentSender)
- return 0;
+ QBasicMutexLocker locker(signalSlotLock(this));
+ QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed();
+ if (!cd || !cd->currentSender)
+ return nullptr;
- for (QObjectPrivate::Connection *c = d->senders; c; c = c->next) {
- if (c->sender == d->currentSender->sender)
- return d->currentSender->sender;
+ for (QObjectPrivate::Connection *c = cd->senders; c; c = c->next) {
+ if (c->sender == cd->currentSender->sender)
+ return cd->currentSender->sender;
}
return 0;
@@ -2419,14 +2541,15 @@ int QObject::senderSignalIndex() const
{
Q_D(const QObject);
- QMutexLocker locker(signalSlotLock(this));
- if (!d->currentSender)
+ QBasicMutexLocker locker(signalSlotLock(this));
+ QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed();
+ if (!cd || !cd->currentSender)
return -1;
- for (QObjectPrivate::Connection *c = d->senders; c; c = c->next) {
- if (c->sender == d->currentSender->sender) {
+ for (QObjectPrivate::Connection *c = cd->senders; c; c = c->next) {
+ if (c->sender == cd->currentSender->sender) {
// Convert from signal range to method range
- return QMetaObjectPrivate::signal(c->sender->metaObject(), d->currentSender->signal).methodIndex();
+ return QMetaObjectPrivate::signal(c->sender->metaObject(), cd->currentSender->signal).methodIndex();
}
}
@@ -2482,15 +2605,13 @@ int QObject::receivers(const char *signal) const
signal_index);
}
- QMutexLocker locker(signalSlotLock(this));
- if (d->connectionLists) {
- if (signal_index < d->connectionLists->count()) {
- const QObjectPrivate::Connection *c =
- d->connectionLists->at(signal_index).first;
- while (c) {
- receivers += c->receiver ? 1 : 0;
- c = c->nextConnectionList;
- }
+ QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed();
+ QBasicMutexLocker locker(signalSlotLock(this));
+ if (cd && signal_index < cd->signalVectorCount()) {
+ const QObjectPrivate::Connection *c = cd->signalVector.loadRelaxed()->at(signal_index).first.loadRelaxed();
+ while (c) {
+ receivers += c->receiver.loadRelaxed() ? 1 : 0;
+ c = c->nextConnectionList.loadRelaxed();
}
}
}
@@ -2530,22 +2651,8 @@ bool QObject::isSignalConnected(const QMetaMethod &signal) const
signalIndex += QMetaObjectPrivate::signalOffset(signal.mobj);
- QMutexLocker locker(signalSlotLock(this));
- if (d->connectionLists) {
- if (signalIndex < sizeof(d->connectedSignals) * 8 && !d->connectionLists->dirty)
- return d->isSignalConnected(signalIndex);
-
- if (signalIndex < uint(d->connectionLists->count())) {
- const QObjectPrivate::Connection *c =
- d->connectionLists->at(signalIndex).first;
- while (c) {
- if (c->receiver)
- return true;
- c = c->nextConnectionList;
- }
- }
- }
- return d->isDeclarativeSignalConnected(signalIndex);
+ QBasicMutexLocker locker(signalSlotLock(this));
+ return d->isSignalConnected(signalIndex, true);
}
/*!
@@ -3308,49 +3415,49 @@ QObjectPrivate::Connection *QMetaObjectPrivate::connect(const QObject *sender,
int method_offset = rmeta ? rmeta->methodOffset() : 0;
Q_ASSERT(!rmeta || QMetaObjectPrivate::get(rmeta)->revision >= 6);
- QObjectPrivate::StaticMetaCallFunction callFunction =
- rmeta ? rmeta->d.static_metacall : 0;
+ QObjectPrivate::StaticMetaCallFunction callFunction = rmeta ? rmeta->d.static_metacall : nullptr;
QOrderedMutexLocker locker(signalSlotLock(sender),
signalSlotLock(receiver));
- if (type & Qt::UniqueConnection) {
- QObjectConnectionListVector *connectionLists = QObjectPrivate::get(s)->connectionLists;
- if (connectionLists && connectionLists->count() > signal_index) {
- const QObjectPrivate::Connection *c2 =
- (*connectionLists)[signal_index].first;
+ QObjectPrivate::ConnectionData *scd = QObjectPrivate::get(s)->connections.loadRelaxed();
+ if (type & Qt::UniqueConnection && scd) {
+ if (scd->signalVectorCount() > signal_index) {
+ const QObjectPrivate::Connection *c2 = scd->signalVector.loadRelaxed()->at(signal_index).first.loadRelaxed();
int method_index_absolute = method_index + method_offset;
while (c2) {
- if (!c2->isSlotObject && c2->receiver == receiver && c2->method() == method_index_absolute)
- return 0;
- c2 = c2->nextConnectionList;
+ if (!c2->isSlotObject && c2->receiver.loadRelaxed() == receiver && c2->method() == method_index_absolute)
+ return nullptr;
+ c2 = c2->nextConnectionList.loadRelaxed();
}
}
type &= Qt::UniqueConnection - 1;
}
- QScopedPointer<QObjectPrivate::Connection> c(new QObjectPrivate::Connection);
+ std::unique_ptr<QObjectPrivate::Connection> c{new QObjectPrivate::Connection};
c->sender = s;
c->signal_index = signal_index;
- c->receiver = r;
+ c->receiver.storeRelaxed(r);
+ QThreadData *td = r->d_func()->threadData;
+ td->ref();
+ c->receiverThreadData.storeRelaxed(td);
c->method_relative = method_index;
c->method_offset = method_offset;
c->connectionType = type;
c->isSlotObject = false;
- c->argumentTypes.store(types);
- c->nextConnectionList = 0;
+ c->argumentTypes.storeRelaxed(types);
c->callFunction = callFunction;
- QObjectPrivate::get(s)->addConnection(signal_index, c.data());
+ QObjectPrivate::get(s)->addConnection(signal_index, c.get());
locker.unlock();
QMetaMethod smethod = QMetaObjectPrivate::signal(smeta, signal_index);
if (smethod.isValid())
s->connectNotify(smethod);
- return c.take();
+ return c.release();
}
/*!
@@ -3386,47 +3493,38 @@ bool QMetaObject::disconnectOne(const QObject *sender, int signal_index,
\internal
Helper function to remove the connection from the senders list and set the receivers to \nullptr
*/
-bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
+bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::ConnectionData *connections, int signalIndex,
const QObject *receiver, int method_index, void **slot,
- QMutex *senderMutex, DisconnectType disconnectType)
+ QBasicMutex *senderMutex, DisconnectType disconnectType)
{
bool success = false;
+
+ auto &connectionList = connections->connectionsForSignal(signalIndex);
+ auto *c = connectionList.first.loadRelaxed();
while (c) {
- if (c->receiver
- && (receiver == 0 || (c->receiver == receiver
+ QObject *r = c->receiver.loadRelaxed();
+ if (r && (receiver == nullptr || (r == receiver
&& (method_index < 0 || (!c->isSlotObject && c->method() == method_index))
- && (slot == 0 || (c->isSlotObject && c->slotObj->compare(slot)))))) {
+ && (slot == nullptr || (c->isSlotObject && c->slotObj->compare(slot)))))) {
bool needToUnlock = false;
- QMutex *receiverMutex = 0;
- if (c->receiver) {
- receiverMutex = signalSlotLock(c->receiver);
+ QBasicMutex *receiverMutex = nullptr;
+ if (r) {
+ receiverMutex = signalSlotLock(r);
// need to relock this receiver and sender in the correct order
needToUnlock = QOrderedMutexLocker::relock(senderMutex, receiverMutex);
}
- if (c->receiver) {
- *c->prev = c->next;
- if (c->next)
- c->next->prev = c->prev;
- }
+ if (c->receiver.loadRelaxed())
+ connections->removeConnection(c);
if (needToUnlock)
receiverMutex->unlock();
- c->receiver = 0;
-
- if (c->isSlotObject) {
- c->isSlotObject = false;
- senderMutex->unlock();
- c->slotObj->destroyIfLastRef();
- senderMutex->lock();
- }
-
success = true;
if (disconnectType == DisconnectOne)
return success;
}
- c = c->nextConnectionList;
+ c = c->nextConnectionList.loadRelaxed();
}
return success;
}
@@ -3445,43 +3543,34 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender,
QObject *s = const_cast<QObject *>(sender);
- QMutex *senderMutex = signalSlotLock(sender);
- QMutexLocker locker(senderMutex);
+ QBasicMutex *senderMutex = signalSlotLock(sender);
+ QBasicMutexLocker locker(senderMutex);
- QObjectConnectionListVector *connectionLists = QObjectPrivate::get(s)->connectionLists;
- if (!connectionLists)
+ QObjectPrivate::ConnectionData *scd = QObjectPrivate::get(s)->connections.loadRelaxed();
+ if (!scd)
return false;
- // prevent incoming connections changing the connectionLists while unlocked
- ++connectionLists->inUse;
-
bool success = false;
- if (signal_index < 0) {
- // remove from all connection lists
- for (int sig_index = -1; sig_index < connectionLists->count(); ++sig_index) {
- QObjectPrivate::Connection *c =
- (*connectionLists)[sig_index].first;
- if (disconnectHelper(c, receiver, method_index, slot, senderMutex, disconnectType)) {
- success = true;
- connectionLists->dirty = true;
+ {
+ // prevent incoming connections changing the connections->receivers while unlocked
+ QObjectPrivate::ConnectionDataPointer connections(scd);
+
+ if (signal_index < 0) {
+ // remove from all connection lists
+ for (int sig_index = -1; sig_index < scd->signalVectorCount(); ++sig_index) {
+ if (disconnectHelper(connections.data(), sig_index, receiver, method_index, slot, senderMutex, disconnectType))
+ success = true;
}
- }
- } else if (signal_index < connectionLists->count()) {
- QObjectPrivate::Connection *c =
- (*connectionLists)[signal_index].first;
- if (disconnectHelper(c, receiver, method_index, slot, senderMutex, disconnectType)) {
- success = true;
- connectionLists->dirty = true;
+ } else if (signal_index < scd->signalVectorCount()) {
+ if (disconnectHelper(connections.data(), signal_index, receiver, method_index, slot, senderMutex, disconnectType))
+ success = true;
}
}
- --connectionLists->inUse;
- Q_ASSERT(connectionLists->inUse >= 0);
- if (connectionLists->orphaned && !connectionLists->inUse)
- delete connectionLists;
-
locker.unlock();
if (success) {
+ scd->cleanOrphanedConnections(s);
+
QMetaMethod smethod = QMetaObjectPrivate::signal(smeta, signal_index);
if (smethod.isValid())
s->disconnectNotify(smethod);
@@ -3597,10 +3686,9 @@ void QMetaObject::connectSlotsByName(QObject *o)
\a signal must be in the signal index range (see QObjectPrivate::signalIndex()).
*/
-static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connection *c, void **argv,
- QMutexLocker &locker)
+static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connection *c, void **argv)
{
- const int *argumentTypes = c->argumentTypes.load();
+ const int *argumentTypes = c->argumentTypes.loadRelaxed();
if (!argumentTypes) {
QMetaMethod m = QMetaObjectPrivate::signal(sender->metaObject(), signal);
argumentTypes = queuedConnectionTypes(m.parameterTypes());
@@ -3609,7 +3697,7 @@ static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connect
if (!c->argumentTypes.testAndSetOrdered(0, argumentTypes)) {
if (argumentTypes != &DIRECT_CONNECTION_ONLY)
delete [] argumentTypes;
- argumentTypes = c->argumentTypes.load();
+ argumentTypes = c->argumentTypes.loadRelaxed();
}
}
if (argumentTypes == &DIRECT_CONNECTION_ONLY) // cannot activate
@@ -3617,142 +3705,129 @@ static void queued_activate(QObject *sender, int signal, QObjectPrivate::Connect
int nargs = 1; // include return type
while (argumentTypes[nargs-1])
++nargs;
- int *types = (int *) malloc(nargs*sizeof(int));
- Q_CHECK_PTR(types);
- void **args = (void **) malloc(nargs*sizeof(void *));
- Q_CHECK_PTR(args);
+
+ QBasicMutexLocker locker(signalSlotLock(c->receiver.loadRelaxed()));
+ if (!c->receiver.loadRelaxed()) {
+ // the connection has been disconnected before we got the lock
+ return;
+ }
+ if (c->isSlotObject)
+ c->slotObj->ref();
+ locker.unlock();
+
+ QMetaCallEvent *ev = c->isSlotObject ?
+ new QMetaCallEvent(c->slotObj, sender, signal, nargs) :
+ new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction, sender, signal, nargs);
+
+ void **args = ev->args();
+ int *types = ev->types();
+
types[0] = 0; // return type
- args[0] = 0; // return value
+ args[0] = nullptr; // return value
if (nargs > 1) {
for (int n = 1; n < nargs; ++n)
types[n] = argumentTypes[n-1];
- locker.unlock();
for (int n = 1; n < nargs; ++n)
args[n] = QMetaType::create(types[n], argv[n]);
- locker.relock();
-
- if (!c->receiver) {
- locker.unlock();
- // we have been disconnected while the mutex was unlocked
- for (int n = 1; n < nargs; ++n)
- QMetaType::destroy(types[n], args[n]);
- free(types);
- free(args);
- locker.relock();
- return;
- }
}
- QMetaCallEvent *ev = c->isSlotObject ?
- new QMetaCallEvent(c->slotObj, sender, signal, nargs, types, args) :
- new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction, sender, signal, nargs, types, args);
- QCoreApplication::postEvent(c->receiver, ev);
-}
+ locker.relock();
+ if (c->isSlotObject)
+ c->slotObj->destroyIfLastRef();
+ if (!c->receiver.loadRelaxed()) {
+ // the connection has been disconnected while we were unlocked
+ locker.unlock();
+ delete ev;
+ return;
+ }
-/*!
- \internal
- */
-void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_signal_index,
- void **argv)
-{
- activate(sender, QMetaObjectPrivate::signalOffset(m), local_signal_index, argv);
+ QCoreApplication::postEvent(c->receiver.loadRelaxed(), ev);
}
-/*!
- \internal
- */
-void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_index, void **argv)
+template <bool callbacks_enabled>
+void doActivate(QObject *sender, int signal_index, void **argv)
{
- int signal_index = signalOffset + local_signal_index;
+ QObjectPrivate *sp = QObjectPrivate::get(sender);
- if (sender->d_func()->blockSig)
+ if (sp->blockSig)
return;
Q_TRACE_SCOPE(QMetaObject_activate, sender, signal_index);
- if (sender->d_func()->isDeclarativeSignalConnected(signal_index)
+ if (sp->isDeclarativeSignalConnected(signal_index)
&& QAbstractDeclarativeData::signalEmitted) {
Q_TRACE_SCOPE(QMetaObject_activate_declarative_signal, sender, signal_index);
- QAbstractDeclarativeData::signalEmitted(sender->d_func()->declarativeData, sender,
+ QAbstractDeclarativeData::signalEmitted(sp->declarativeData, sender,
signal_index, argv);
}
- if (!sender->d_func()->isSignalConnected(signal_index, /*checkDeclarative =*/ false)
- && !qt_signal_spy_callback_set.signal_begin_callback
- && !qt_signal_spy_callback_set.signal_end_callback) {
- // The possible declarative connection is done, and nothing else is connected, so:
- return;
- }
+ const QSignalSpyCallbackSet *signal_spy_set = callbacks_enabled ? qt_signal_spy_callback_set.loadAcquire() : nullptr;
void *empty_argv[] = { nullptr };
if (!argv)
argv = empty_argv;
- if (qt_signal_spy_callback_set.signal_begin_callback != 0) {
- qt_signal_spy_callback_set.signal_begin_callback(sender, signal_index, argv);
+ if (!sp->maybeSignalConnected(signal_index)) {
+ // The possible declarative connection is done, and nothing else is connected
+ if (callbacks_enabled && signal_spy_set->signal_begin_callback != nullptr)
+ signal_spy_set->signal_begin_callback(sender, signal_index, argv);
+ if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
+ signal_spy_set->signal_end_callback(sender, signal_index);
+ return;
}
- {
- QMutexLocker locker(signalSlotLock(sender));
- struct ConnectionListsRef {
- QObjectConnectionListVector *connectionLists;
- ConnectionListsRef(QObjectConnectionListVector *connectionLists) : connectionLists(connectionLists)
- {
- if (connectionLists)
- ++connectionLists->inUse;
- }
- ~ConnectionListsRef()
- {
- if (!connectionLists)
- return;
-
- --connectionLists->inUse;
- Q_ASSERT(connectionLists->inUse >= 0);
- if (connectionLists->orphaned) {
- if (!connectionLists->inUse)
- delete connectionLists;
- }
- }
+ if (callbacks_enabled && signal_spy_set->signal_begin_callback != nullptr)
+ signal_spy_set->signal_begin_callback(sender, signal_index, argv);
- QObjectConnectionListVector *operator->() const { return connectionLists; }
- };
- ConnectionListsRef connectionLists = sender->d_func()->connectionLists;
- if (!connectionLists.connectionLists) {
- locker.unlock();
- if (qt_signal_spy_callback_set.signal_end_callback != 0)
- qt_signal_spy_callback_set.signal_end_callback(sender, signal_index);
- return;
- }
+ bool senderDeleted = false;
+ {
+ Q_ASSERT(sp->connections.loadAcquire());
+ QObjectPrivate::ConnectionDataPointer connections(sp->connections.loadRelaxed());
+ QObjectPrivate::SignalVector *signalVector = connections->signalVector.loadRelaxed();
const QObjectPrivate::ConnectionList *list;
- if (signal_index < connectionLists->count())
- list = &connectionLists->at(signal_index);
+ if (signal_index < signalVector->count())
+ list = &signalVector->at(signal_index);
else
- list = &connectionLists->allsignals;
+ list = &signalVector->at(-1);
Qt::HANDLE currentThreadId = QThread::currentThreadId();
+ bool inSenderThread = currentThreadId == QObjectPrivate::get(sender)->threadData->threadId.loadRelaxed();
+ // We need to check against the highest connection id to ensure that signals added
+ // during the signal emission are not emitted in this emission.
+ uint highestConnectionId = connections->currentConnectionId.loadRelaxed();
do {
- QObjectPrivate::Connection *c = list->first;
- if (!c) continue;
- // We need to check against last here to ensure that signals added
- // during the signal emission are not emitted in this emission.
- QObjectPrivate::Connection *last = list->last;
+ QObjectPrivate::Connection *c = list->first.loadRelaxed();
+ if (!c)
+ continue;
do {
- if (!c->receiver)
+ QObject * const receiver = c->receiver.loadRelaxed();
+ if (!receiver)
continue;
- QObject * const receiver = c->receiver;
- const bool receiverInSameThread = currentThreadId == receiver->d_func()->threadData->threadId.load();
+ QThreadData *td = c->receiverThreadData.loadRelaxed();
+ if (!td)
+ continue;
+
+ bool receiverInSameThread;
+ if (inSenderThread) {
+ receiverInSameThread = currentThreadId == td->threadId.loadRelaxed();
+ } else {
+ // need to lock before reading the threadId, because moveToThread() could interfere
+ QMutexLocker lock(signalSlotLock(receiver));
+ receiverInSameThread = currentThreadId == td->threadId.loadRelaxed();
+ }
+
// determine if this connection should be sent immediately or
// put into the event queue
if ((c->connectionType == Qt::AutoConnection && !receiverInSameThread)
|| (c->connectionType == Qt::QueuedConnection)) {
- queued_activate(sender, signal_index, c, argv, locker);
+ queued_activate(sender, signal_index, c, argv);
continue;
#if QT_CONFIG(thread)
} else if (c->connectionType == Qt::BlockingQueuedConnection) {
@@ -3763,92 +3838,113 @@ void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_i
receiver->metaObject()->className(), receiver);
}
QSemaphore semaphore;
- QMetaCallEvent *ev = c->isSlotObject ?
- new QMetaCallEvent(c->slotObj, sender, signal_index, 0, 0, argv, &semaphore) :
- new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction, sender, signal_index, 0, 0, argv, &semaphore);
- QCoreApplication::postEvent(receiver, ev);
- locker.unlock();
+ {
+ QBasicMutexLocker locker(signalSlotLock(sender));
+ if (!c->receiver.loadAcquire())
+ continue;
+ QMetaCallEvent *ev = c->isSlotObject ?
+ new QMetaCallEvent(c->slotObj, sender, signal_index, argv, &semaphore) :
+ new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction,
+ sender, signal_index, argv, &semaphore);
+ QCoreApplication::postEvent(receiver, ev);
+ }
semaphore.acquire();
- locker.relock();
continue;
#endif
}
- QConnectionSenderSwitcher sw;
+ QObjectPrivate::Sender senderData(receiverInSameThread ? receiver : nullptr, sender, signal_index);
- if (receiverInSameThread) {
- sw.switchSender(receiver, sender, signal_index);
- }
if (c->isSlotObject) {
c->slotObj->ref();
- QScopedPointer<QtPrivate::QSlotObjectBase, QSlotObjectBaseDeleter> obj(c->slotObj);
- locker.unlock();
+
+ struct Deleter {
+ void operator()(QtPrivate::QSlotObjectBase *slot) const {
+ if (slot) slot->destroyIfLastRef();
+ }
+ };
+ const std::unique_ptr<QtPrivate::QSlotObjectBase, Deleter> obj{c->slotObj};
{
- Q_TRACE_SCOPE(QMetaObject_activate_slot_functor, obj.data());
+ Q_TRACE_SCOPE(QMetaObject_activate_slot_functor, obj.get());
obj->call(receiver, argv);
}
-
- // Make sure the slot object gets destroyed before the mutex is locked again, as the
- // destructor of the slot object might also lock a mutex from the signalSlotLock() mutex pool,
- // and that would deadlock if the pool happens to return the same mutex.
- obj.reset();
-
- locker.relock();
} else if (c->callFunction && c->method_offset <= receiver->metaObject()->methodOffset()) {
//we compare the vtable to make sure we are not in the destructor of the object.
- const int methodIndex = c->method();
const int method_relative = c->method_relative;
const auto callFunction = c->callFunction;
- locker.unlock();
- if (qt_signal_spy_callback_set.slot_begin_callback != 0)
- qt_signal_spy_callback_set.slot_begin_callback(receiver, methodIndex, argv);
+ const int methodIndex = (Q_HAS_TRACEPOINTS || callbacks_enabled) ? c->method() : 0;
+ if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr)
+ signal_spy_set->slot_begin_callback(receiver, methodIndex, argv);
{
Q_TRACE_SCOPE(QMetaObject_activate_slot, receiver, methodIndex);
callFunction(receiver, QMetaObject::InvokeMetaMethod, method_relative, argv);
}
- if (qt_signal_spy_callback_set.slot_end_callback != 0)
- qt_signal_spy_callback_set.slot_end_callback(receiver, methodIndex);
- locker.relock();
+ if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
+ signal_spy_set->slot_end_callback(receiver, methodIndex);
} else {
const int method = c->method_relative + c->method_offset;
- locker.unlock();
- if (qt_signal_spy_callback_set.slot_begin_callback != 0) {
- qt_signal_spy_callback_set.slot_begin_callback(receiver, method, argv);
+ if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr) {
+ signal_spy_set->slot_begin_callback(receiver, method, argv);
}
{
Q_TRACE_SCOPE(QMetaObject_activate_slot, receiver, method);
- metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv);
+ QMetaObject::metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv);
}
- if (qt_signal_spy_callback_set.slot_end_callback != 0)
- qt_signal_spy_callback_set.slot_end_callback(receiver, method);
-
- locker.relock();
+ if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
+ signal_spy_set->slot_end_callback(receiver, method);
}
+ } while ((c = c->nextConnectionList.loadRelaxed()) != nullptr && c->id <= highestConnectionId);
- if (connectionLists->orphaned)
- break;
- } while (c != last && (c = c->nextConnectionList) != 0);
-
- if (connectionLists->orphaned)
- break;
- } while (list != &connectionLists->allsignals &&
+ } while (list != &signalVector->at(-1) &&
//start over for all signals;
- ((list = &connectionLists->allsignals), true));
+ ((list = &signalVector->at(-1)), true));
+ if (connections->currentConnectionId.loadRelaxed() == 0)
+ senderDeleted = true;
}
+ if (!senderDeleted) {
+ sp->connections.loadRelaxed()->cleanOrphanedConnections(sender);
- if (qt_signal_spy_callback_set.signal_end_callback != 0)
- qt_signal_spy_callback_set.signal_end_callback(sender, signal_index);
+ if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
+ signal_spy_set->signal_end_callback(sender, signal_index);
+ }
}
/*!
\internal
+ */
+void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_signal_index,
+ void **argv)
+{
+ int signal_index = local_signal_index + QMetaObjectPrivate::signalOffset(m);
+
+ if (Q_UNLIKELY(qt_signal_spy_callback_set.loadRelaxed()))
+ doActivate<true>(sender, signal_index, argv);
+ else
+ doActivate<false>(sender, signal_index, argv);
+}
+
+/*!
+ \internal
+ */
+void QMetaObject::activate(QObject *sender, int signalOffset, int local_signal_index, void **argv)
+{
+ int signal_index = signalOffset + local_signal_index;
+
+ if (Q_UNLIKELY(qt_signal_spy_callback_set.loadRelaxed()))
+ doActivate<true>(sender, signal_index, argv);
+ else
+ doActivate<false>(sender, signal_index, argv);
+ }
+
+/*!
+ \internal
signal_index comes from indexOfMethod()
*/
void QMetaObject::activate(QObject *sender, int signal_index, void **argv)
@@ -3861,7 +3957,7 @@ void QMetaObject::activate(QObject *sender, int signal_index, void **argv)
/*!
\internal
- Returns the signal index used in the internal connectionLists vector.
+ Returns the signal index used in the internal connections->receivers vector.
It is different from QMetaObject::indexOfSignal(): indexOfSignal is the same as indexOfMethod
while QObjectPrivate::signalIndex is smaller because it doesn't give index to slots.
@@ -4044,6 +4140,7 @@ static void dumpRecursive(int level, const QObject *object)
}
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
\overload
\obsolete
@@ -4057,6 +4154,7 @@ void QObject::dumpObjectTree()
{
const_cast<const QObject *>(this)->dumpObjectTree();
}
+#endif
/*!
Dumps a tree of children to the debug output.
@@ -4071,6 +4169,7 @@ void QObject::dumpObjectTree() const
dumpRecursive(0, this);
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
\overload
\obsolete
@@ -4085,6 +4184,7 @@ void QObject::dumpObjectInfo()
{
const_cast<const QObject *>(this)->dumpObjectInfo();
}
+#endif
/*!
Dumps information about signal connections, etc. for this object
@@ -4101,37 +4201,40 @@ void QObject::dumpObjectInfo() const
objectName().isEmpty() ? "unnamed" : objectName().toLocal8Bit().data());
Q_D(const QObject);
- QMutexLocker locker(signalSlotLock(this));
+ QBasicMutexLocker locker(signalSlotLock(this));
// first, look for connections where this object is the sender
qDebug(" SIGNALS OUT");
- if (d->connectionLists) {
- for (int signal_index = 0; signal_index < d->connectionLists->count(); ++signal_index) {
+ QObjectPrivate::ConnectionData *cd = d->connections.loadRelaxed();
+ if (cd && cd->signalVectorCount()) {
+ QObjectPrivate::SignalVector *signalVector = cd->signalVector.loadRelaxed();
+ for (int signal_index = 0; signal_index < signalVector->count(); ++signal_index) {
+ const QObjectPrivate::Connection *c = signalVector->at(signal_index).first.loadRelaxed();
+ if (!c)
+ continue;
const QMetaMethod signal = QMetaObjectPrivate::signal(metaObject(), signal_index);
qDebug(" signal: %s", signal.methodSignature().constData());
// receivers
- const QObjectPrivate::Connection *c =
- d->connectionLists->at(signal_index).first;
while (c) {
- if (!c->receiver) {
+ if (!c->receiver.loadRelaxed()) {
qDebug(" <Disconnected receiver>");
- c = c->nextConnectionList;
+ c = c->nextConnectionList.loadRelaxed();
continue;
}
if (c->isSlotObject) {
qDebug(" <functor or function pointer>");
- c = c->nextConnectionList;
+ c = c->nextConnectionList.loadRelaxed();
continue;
}
- const QMetaObject *receiverMetaObject = c->receiver->metaObject();
+ const QMetaObject *receiverMetaObject = c->receiver.loadRelaxed()->metaObject();
const QMetaMethod method = receiverMetaObject->method(c->method());
qDebug(" --> %s::%s %s",
receiverMetaObject->className(),
- c->receiver->objectName().isEmpty() ? "unnamed" : qPrintable(c->receiver->objectName()),
+ c->receiver.loadRelaxed()->objectName().isEmpty() ? "unnamed" : qPrintable(c->receiver.loadRelaxed()->objectName()),
method.methodSignature().constData());
- c = c->nextConnectionList;
+ c = c->nextConnectionList.loadRelaxed();
}
}
} else {
@@ -4141,8 +4244,8 @@ void QObject::dumpObjectInfo() const
// now look for connections where this object is the receiver
qDebug(" SIGNALS IN");
- if (d->senders) {
- for (QObjectPrivate::Connection *s = d->senders; s; s = s->next) {
+ if (cd && cd->senders) {
+ for (QObjectPrivate::Connection *s = cd->senders; s; s = s->next) {
QByteArray slotName = QByteArrayLiteral("<unknown>");
if (!s->isSlotObject) {
const QMetaMethod slot = metaObject()->method(s->method());
@@ -4159,16 +4262,22 @@ void QObject::dumpObjectInfo() const
}
#ifndef QT_NO_USERDATA
+static QBasicAtomicInteger<uint> user_data_registration = Q_BASIC_ATOMIC_INITIALIZER(0);
+
/*!
\internal
*/
uint QObject::registerUserData()
{
- static int user_data_registration = 0;
- return user_data_registration++;
+ return user_data_registration.fetchAndAddRelaxed(1);
}
/*!
+ \fn QObjectUserData::QObjectUserData()
+ \internal
+ */
+
+/*!
\internal
*/
QObjectUserData::~QObjectUserData()
@@ -4489,6 +4598,24 @@ QDebug operator<<(QDebug dbg, const QObject *o)
Q_NAMESPACE makes an external variable, \c{staticMetaObject}, available.
\c{staticMetaObject} is of type QMetaObject and provides access to the
enums declared with Q_ENUM_NS/Q_FLAG_NS.
+
+ \sa Q_NAMESPACE_EXPORT
+*/
+
+/*!
+ \macro Q_NAMESPACE_EXPORT(EXPORT_MACRO)
+ \relates QObject
+ \since 5.14
+
+ The Q_NAMESPACE_EXPORT macro can be used to add QMetaObject capabilities
+ to a namespace.
+
+ It works exactly like the Q_NAMESPACE macro. However, the external
+ \c{staticMetaObject} variable that gets defined in the namespace
+ is declared with the supplied \c{EXPORT_MACRO} qualifier. This is
+ useful if the object needs to be exported from a dynamic library.
+
+ \sa Q_NAMESPACE, {Creating Shared Libraries}
*/
/*!
@@ -4873,37 +5000,39 @@ QMetaObject::Connection QObjectPrivate::connectImpl(const QObject *sender, int s
QOrderedMutexLocker locker(signalSlotLock(sender),
signalSlotLock(receiver));
- if (type & Qt::UniqueConnection && slot) {
- QObjectConnectionListVector *connectionLists = QObjectPrivate::get(s)->connectionLists;
- if (connectionLists && connectionLists->count() > signal_index) {
- const QObjectPrivate::Connection *c2 =
- (*connectionLists)[signal_index].first;
+ if (type & Qt::UniqueConnection && slot && QObjectPrivate::get(s)->connections.loadRelaxed()) {
+ QObjectPrivate::ConnectionData *connections = QObjectPrivate::get(s)->connections.loadRelaxed();
+ if (connections->signalVectorCount() > signal_index) {
+ const QObjectPrivate::Connection *c2 = connections->signalVector.loadRelaxed()->at(signal_index).first.loadRelaxed();
while (c2) {
- if (c2->receiver == receiver && c2->isSlotObject && c2->slotObj->compare(slot)) {
+ if (c2->receiver.loadRelaxed() == receiver && c2->isSlotObject && c2->slotObj->compare(slot)) {
slotObj->destroyIfLastRef();
return QMetaObject::Connection();
}
- c2 = c2->nextConnectionList;
+ c2 = c2->nextConnectionList.loadRelaxed();
}
}
type = static_cast<Qt::ConnectionType>(type ^ Qt::UniqueConnection);
}
- QScopedPointer<QObjectPrivate::Connection> c(new QObjectPrivate::Connection);
+ std::unique_ptr<QObjectPrivate::Connection> c{new QObjectPrivate::Connection};
c->sender = s;
c->signal_index = signal_index;
- c->receiver = r;
+ QThreadData *td = r->d_func()->threadData;
+ td->ref();
+ c->receiverThreadData.storeRelaxed(td);
+ c->receiver.storeRelaxed(r);
c->slotObj = slotObj;
c->connectionType = type;
c->isSlotObject = true;
if (types) {
- c->argumentTypes.store(types);
+ c->argumentTypes.storeRelaxed(types);
c->ownArgumentTypes = false;
}
- QObjectPrivate::get(s)->addConnection(signal_index, c.data());
- QMetaObject::Connection ret(c.take());
+ QObjectPrivate::get(s)->addConnection(signal_index, c.get());
+ QMetaObject::Connection ret(c.release());
locker.unlock();
QMetaMethod method = QMetaObjectPrivate::signal(senderMetaObject, signal_index);
@@ -4925,35 +5054,35 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
{
QObjectPrivate::Connection *c = static_cast<QObjectPrivate::Connection *>(connection.d_ptr);
- if (!c || !c->receiver)
+ if (!c)
+ return false;
+ QObject *receiver = c->receiver.loadRelaxed();
+ if (!receiver)
return false;
- QMutex *senderMutex = signalSlotLock(c->sender);
- QMutex *receiverMutex = signalSlotLock(c->receiver);
+ QBasicMutex *senderMutex = signalSlotLock(c->sender);
+ QBasicMutex *receiverMutex = signalSlotLock(receiver);
+ QObjectPrivate::ConnectionData *connections;
{
QOrderedMutexLocker locker(senderMutex, receiverMutex);
- QObjectConnectionListVector *connectionLists = QObjectPrivate::get(c->sender)->connectionLists;
- Q_ASSERT(connectionLists);
- connectionLists->dirty = true;
+ // load receiver once again and recheck to ensure nobody else has removed the connection in the meantime
+ receiver = c->receiver.loadRelaxed();
+ if (!receiver)
+ return false;
- *c->prev = c->next;
- if (c->next)
- c->next->prev = c->prev;
- c->receiver = 0;
+ connections = QObjectPrivate::get(c->sender)->connections.loadRelaxed();
+ Q_ASSERT(connections);
+ connections->removeConnection(c);
}
- // destroy the QSlotObject, if possible
- if (c->isSlotObject) {
- c->slotObj->destroyIfLastRef();
- c->isSlotObject = false;
- }
+ connections->cleanOrphanedConnections(c->sender);
c->sender->disconnectNotify(QMetaObjectPrivate::signal(c->sender->metaObject(),
c->signal_index));
- const_cast<QMetaObject::Connection &>(connection).d_ptr = 0;
+ const_cast<QMetaObject::Connection &>(connection).d_ptr = nullptr;
c->deref(); // has been removed from the QMetaObject::Connection object
return true;
@@ -5036,7 +5165,7 @@ bool QObject::disconnectImpl(const QObject *sender, void **signal, const QObject
}
if (!senderMetaObject) {
qWarning("QObject::disconnect: signal not found in %s", sender->metaObject()->className());
- return QMetaObject::Connection(0);
+ return false;
}
signal_index += QMetaObjectPrivate::signalOffset(senderMetaObject);
}
@@ -5135,7 +5264,7 @@ bool QMetaObject::Connection::isConnected_helper() const
Q_ASSERT(d_ptr); // we're only called from operator RestrictedBool() const
QObjectPrivate::Connection *c = static_cast<QObjectPrivate::Connection *>(d_ptr);
- return c->receiver;
+ return c->receiver.loadRelaxed();
}
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index fc1d7c956c..540b8b32c1 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -71,12 +71,16 @@ class QObjectPrivate;
class QObject;
class QThread;
class QWidget;
+class QAccessibleWidget;
#ifndef QT_NO_REGEXP
class QRegExp;
#endif
#if QT_CONFIG(regularexpression)
class QRegularExpression;
#endif
+#if !QT_DEPRECATED_SINCE(5, 14) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+# define QT_NO_USERDATA
+#endif
#ifndef QT_NO_USERDATA
class QObjectUserData;
#endif
@@ -93,7 +97,9 @@ Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QRegular
Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo, Qt::FindChildOptions options);
class Q_CORE_EXPORT QObjectData {
+ Q_DISABLE_COPY(QObjectData)
public:
+ QObjectData() = default;
virtual ~QObjectData() = 0;
QObject *q_ptr;
QObject *parent;
@@ -111,6 +117,10 @@ public:
int postedEvents;
QDynamicMetaObjectData *metaObject;
QMetaObject *dynamicMetaObject() const;
+
+#ifdef QT_DEBUG
+ enum { CheckForParentChildLoopsWarnDepth = 4096 };
+#endif
};
@@ -143,8 +153,8 @@ public:
inline bool isWidgetType() const { return d_ptr->isWidget; }
inline bool isWindowType() const { return d_ptr->isWindow; }
- inline bool signalsBlocked() const Q_DECL_NOTHROW { return d_ptr->blockSig; }
- bool blockSignals(bool b) Q_DECL_NOTHROW;
+ inline bool signalsBlocked() const noexcept { return d_ptr->blockSig; }
+ bool blockSignals(bool b) noexcept;
QThread *thread() const;
void moveToThread(QThread *thread);
@@ -399,8 +409,11 @@ public:
#endif // QT_NO_PROPERTIES
#ifndef QT_NO_USERDATA
+ QT_DEPRECATED_VERSION_5_14
static uint registerUserData();
+ QT_DEPRECATED_VERSION_X_5_14("Use setProperty()")
void setUserData(uint id, QObjectUserData* data);
+ QT_DEPRECATED_VERSION_X_5_14("Use property()")
QObjectUserData* userData(uint id) const;
#endif // QT_NO_USERDATA
@@ -437,7 +450,7 @@ protected:
QScopedPointer<QObjectData> d_ptr;
static const QMetaObject staticQtMetaObject;
- friend inline const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT;
+ friend inline const QMetaObject *qt_getQtMetaObject() noexcept;
friend struct QMetaObject;
friend struct QMetaObjectPrivate;
@@ -447,6 +460,7 @@ protected:
friend class QCoreApplication;
friend class QCoreApplicationPrivate;
friend class QWidget;
+ friend class QAccessibleWidget;
friend class QThreadData;
private:
@@ -468,12 +482,14 @@ inline QMetaObject::Connection QObject::connect(const QObject *asender, const ch
const char *amember, Qt::ConnectionType atype) const
{ return connect(asender, asignal, this, amember, atype); }
-inline const QMetaObject *qt_getQtMetaObject() Q_DECL_NOEXCEPT
+inline const QMetaObject *qt_getQtMetaObject() noexcept
{ return &QObject::staticQtMetaObject; }
#ifndef QT_NO_USERDATA
class Q_CORE_EXPORT QObjectUserData {
+ Q_DISABLE_COPY(QObjectUserData)
public:
+ QObjectUserData() = default;
virtual ~QObjectUserData();
};
#endif
@@ -541,17 +557,15 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
class QSignalBlocker
{
public:
- inline explicit QSignalBlocker(QObject *o) Q_DECL_NOTHROW;
- inline explicit QSignalBlocker(QObject &o) Q_DECL_NOTHROW;
+ inline explicit QSignalBlocker(QObject *o) noexcept;
+ inline explicit QSignalBlocker(QObject &o) noexcept;
inline ~QSignalBlocker();
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW;
- inline QSignalBlocker &operator=(QSignalBlocker &&other) Q_DECL_NOTHROW;
-#endif
+ inline QSignalBlocker(QSignalBlocker &&other) noexcept;
+ inline QSignalBlocker &operator=(QSignalBlocker &&other) noexcept;
- inline void reblock() Q_DECL_NOTHROW;
- inline void unblock() Q_DECL_NOTHROW;
+ inline void reblock() noexcept;
+ inline void unblock() noexcept;
private:
Q_DISABLE_COPY(QSignalBlocker)
QObject * m_o;
@@ -559,20 +573,19 @@ private:
bool m_inhibited;
};
-QSignalBlocker::QSignalBlocker(QObject *o) Q_DECL_NOTHROW
+QSignalBlocker::QSignalBlocker(QObject *o) noexcept
: m_o(o),
m_blocked(o && o->blockSignals(true)),
m_inhibited(false)
{}
-QSignalBlocker::QSignalBlocker(QObject &o) Q_DECL_NOTHROW
+QSignalBlocker::QSignalBlocker(QObject &o) noexcept
: m_o(&o),
m_blocked(o.blockSignals(true)),
m_inhibited(false)
{}
-#ifdef Q_COMPILER_RVALUE_REFS
-QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
+QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) noexcept
: m_o(other.m_o),
m_blocked(other.m_blocked),
m_inhibited(other.m_inhibited)
@@ -580,7 +593,7 @@ QSignalBlocker::QSignalBlocker(QSignalBlocker &&other) Q_DECL_NOTHROW
other.m_o = nullptr;
}
-QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
+QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) noexcept
{
if (this != &other) {
// if both *this and other block the same object's signals:
@@ -595,7 +608,6 @@ QSignalBlocker &QSignalBlocker::operator=(QSignalBlocker &&other) Q_DECL_NOTHROW
}
return *this;
}
-#endif
QSignalBlocker::~QSignalBlocker()
{
@@ -603,13 +615,13 @@ QSignalBlocker::~QSignalBlocker()
m_o->blockSignals(m_blocked);
}
-void QSignalBlocker::reblock() Q_DECL_NOTHROW
+void QSignalBlocker::reblock() noexcept
{
if (m_o) m_o->blockSignals(true);
m_inhibited = false;
}
-void QSignalBlocker::unblock() Q_DECL_NOTHROW
+void QSignalBlocker::unblock() noexcept
{
if (m_o) m_o->blockSignals(m_blocked);
m_inhibited = true;
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index a762e6f529..feafcaf323 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
**
@@ -79,9 +79,9 @@ struct QSignalSpyCallbackSet
EndCallback signal_end_callback,
slot_end_callback;
};
-void Q_CORE_EXPORT qt_register_signal_spy_callbacks(const QSignalSpyCallbackSet &callback_set);
+void Q_CORE_EXPORT qt_register_signal_spy_callbacks(QSignalSpyCallbackSet *callback_set);
-extern QSignalSpyCallbackSet Q_CORE_EXPORT qt_signal_spy_callback_set;
+extern Q_CORE_EXPORT QBasicAtomicPointer<QSignalSpyCallbackSet> qt_signal_spy_callback_set;
enum { QObjectPrivateVersion = QT_VERSION };
@@ -124,54 +124,199 @@ public:
};
typedef void (*StaticMetaCallFunction)(QObject *, QMetaObject::Call, int, void **);
- struct Connection
+ struct Connection;
+ struct SignalVector;
+
+ struct ConnectionOrSignalVector {
+ union {
+ // linked list of orphaned connections that need cleaning up
+ ConnectionOrSignalVector *nextInOrphanList;
+ // linked list of connections connected to slots in this object
+ Connection *next;
+ };
+
+ static SignalVector *asSignalVector(ConnectionOrSignalVector *c) {
+ if (reinterpret_cast<quintptr>(c) & 1)
+ return reinterpret_cast<SignalVector *>(reinterpret_cast<quintptr>(c) & ~quintptr(1u));
+ return nullptr;
+ }
+ static Connection *fromSignalVector(SignalVector *v) {
+ return reinterpret_cast<Connection *>(reinterpret_cast<quintptr>(v) | quintptr(1u));
+ }
+ };
+
+ struct Connection : public ConnectionOrSignalVector
{
+ // linked list of connections connected to slots in this object, next is in base class
+ Connection **prev;
+ // linked list of connections connected to signals in this object
+ QAtomicPointer<Connection> nextConnectionList;
+ Connection *prevConnectionList;
+
QObject *sender;
- QObject *receiver;
+ QAtomicPointer<QObject> receiver;
+ QAtomicPointer<QThreadData> receiverThreadData;
union {
StaticMetaCallFunction callFunction;
QtPrivate::QSlotObjectBase *slotObj;
};
- // The next pointer for the singly-linked ConnectionList
- Connection *nextConnectionList;
- //senders linked list
- Connection *next;
- Connection **prev;
QAtomicPointer<const int> argumentTypes;
QAtomicInt ref_;
+ uint id = 0;
ushort method_offset;
ushort method_relative;
- uint signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
+ int signal_index : 27; // In signal range (see QObjectPrivate::signalIndex())
ushort connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
ushort isSlotObject : 1;
ushort ownArgumentTypes : 1;
- Connection() : nextConnectionList(nullptr), ref_(2), ownArgumentTypes(true) {
+ Connection() : ref_(2), ownArgumentTypes(true) {
//ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
}
~Connection();
int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; }
void ref() { ref_.ref(); }
+ void freeSlotObject()
+ {
+ if (isSlotObject) {
+ slotObj->destroyIfLastRef();
+ isSlotObject = false;
+ }
+ }
void deref() {
if (!ref_.deref()) {
- Q_ASSERT(!receiver);
+ Q_ASSERT(!receiver.loadRelaxed());
+ Q_ASSERT(!isSlotObject);
delete this;
}
}
};
// ConnectionList is a singly-linked list
struct ConnectionList {
- ConnectionList() : first(nullptr), last(nullptr) {}
- Connection *first;
- Connection *last;
+ QAtomicPointer<Connection> first;
+ QAtomicPointer<Connection> last;
};
struct Sender
{
+ Sender(QObject *receiver, QObject *sender, int signal)
+ : receiver(receiver), sender(sender), signal(signal)
+ {
+ if (receiver) {
+ ConnectionData *cd = receiver->d_func()->connections.loadRelaxed();
+ previous = cd->currentSender;
+ cd->currentSender = this;
+ }
+ }
+ ~Sender()
+ {
+ if (receiver)
+ receiver->d_func()->connections.loadRelaxed()->currentSender = previous;
+ }
+ void receiverDeleted()
+ {
+ Sender *s = this;
+ while (s) {
+ s->receiver = nullptr;
+ s = s->previous;
+ }
+ }
+ Sender *previous;
+ QObject *receiver;
QObject *sender;
int signal;
- int ref;
};
+ struct SignalVector : public ConnectionOrSignalVector {
+ quintptr allocated;
+ // ConnectionList signals[]
+ ConnectionList &at(int i)
+ {
+ return reinterpret_cast<ConnectionList *>(this + 1)[i + 1];
+ }
+ const ConnectionList &at(int i) const
+ {
+ return reinterpret_cast<const ConnectionList *>(this + 1)[i + 1];
+ }
+ int count() const { return static_cast<int>(allocated); }
+ };
+
+
+
+ /*
+ This contains the all connections from and to an object.
+
+ The signalVector contains the lists of connections for a given signal. The index in the vector correspond
+ to the signal index. The signal index is the one returned by QObjectPrivate::signalIndex (not
+ QMetaObject::indexOfSignal). allsignals contains a list of special connections that will get invoked on
+ any signal emission. This is done by connecting to signal index -1.
+
+ This vector is protected by the object mutex (signalSlotLock())
+
+ Each Connection is also part of a 'senders' linked list. This one contains all connections connected
+ to a slot in this object. The mutex of the receiver must be locked when touching the pointers of this
+ linked list.
+ */
+ struct ConnectionData {
+ // the id below is used to avoid activating new connections. When the object gets
+ // deleted it's set to 0, so that signal emission stops
+ QAtomicInteger<uint> currentConnectionId;
+ QAtomicInt ref;
+ QAtomicPointer<SignalVector> signalVector;
+ Connection *senders = nullptr;
+ Sender *currentSender = nullptr; // object currently activating the object
+ QAtomicPointer<Connection> orphaned;
+
+ ~ConnectionData()
+ {
+ deleteOrphaned(orphaned.loadRelaxed());
+ SignalVector *v = signalVector.loadRelaxed();
+ if (v)
+ free(v);
+ }
+
+ // must be called on the senders connection data
+ // assumes the senders and receivers lock are held
+ void removeConnection(Connection *c);
+ void cleanOrphanedConnections(QObject *sender)
+ {
+ if (orphaned.loadRelaxed() && ref.loadAcquire() == 1)
+ cleanOrphanedConnectionsImpl(sender);
+ }
+ void cleanOrphanedConnectionsImpl(QObject *sender);
+
+ ConnectionList &connectionsForSignal(int signal)
+ {
+ return signalVector.loadRelaxed()->at(signal);
+ }
+
+ void resizeSignalVector(uint size) {
+ SignalVector *vector = this->signalVector.loadRelaxed();
+ if (vector && vector->allocated > size)
+ return;
+ size = (size + 7) & ~7;
+ SignalVector *newVector = reinterpret_cast<SignalVector *>(malloc(sizeof(SignalVector) + (size + 1) * sizeof(ConnectionList)));
+ int start = -1;
+ if (vector) {
+ memcpy(newVector, vector, sizeof(SignalVector) + (vector->allocated + 1) * sizeof(ConnectionList));
+ start = vector->count();
+ }
+ for (int i = start; i < int(size); ++i)
+ newVector->at(i) = ConnectionList();
+ newVector->next = nullptr;
+ newVector->allocated = size;
+
+ signalVector.storeRelaxed(newVector);
+ if (vector) {
+ vector->nextInOrphanList = orphaned.loadRelaxed();
+ orphaned.storeRelaxed(ConnectionOrSignalVector::fromSignalVector(vector));
+ }
+ }
+ int signalVectorCount() const {
+ return signalVector.loadAcquire() ? signalVector.loadRelaxed()->count() : -1;
+ }
+
+ static void deleteOrphaned(ConnectionOrSignalVector *c);
+ };
QObjectPrivate(int version = QObjectPrivateVersion);
virtual ~QObjectPrivate();
@@ -187,13 +332,6 @@ public:
QObjectList senderList() const;
void addConnection(int signal, Connection *c);
- void cleanConnectionLists();
-
- static inline Sender *setCurrentSender(QObject *receiver,
- Sender *sender);
- static inline void resetCurrentSender(QObject *receiver,
- Sender *currentSender,
- Sender *previousSender);
static QObjectPrivate *get(QObject *o) {
return o->d_func();
@@ -201,7 +339,8 @@ public:
static const QObjectPrivate *get(const QObject *o) { return o->d_func(); }
int signalIndex(const char *signalName, const QMetaObject **meta = nullptr) const;
- inline bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
+ bool isSignalConnected(uint signalIdx, bool checkDeclarative = true) const;
+ bool maybeSignalConnected(uint signalIndex) const;
inline bool isDeclarativeSignalConnected(uint signalIdx) const;
// To allow abitrary objects to call connectNotify()/disconnectNotify() without making
@@ -224,15 +363,21 @@ public:
const int *types, const QMetaObject *senderMetaObject);
static QMetaObject::Connection connect(const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type);
static bool disconnect(const QObject *sender, int signal_index, void **slot);
+
+ void ensureConnectionData()
+ {
+ if (connections.loadRelaxed())
+ return;
+ ConnectionData *cd = new ConnectionData;
+ cd->ref.ref();
+ connections.storeRelaxed(cd);
+ }
public:
ExtraData *extraData; // extra data set by the user
QThreadData *threadData; // id of the thread that owns the object
- QObjectConnectionListVector *connectionLists;
-
- Connection *senders; // linked list of connections connected to this object
- Sender *currentSender; // object currently activating the object
- mutable quint32 connectedSignals[2];
+ using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>;
+ QAtomicPointer<ConnectionData> connections;
union {
QObject *currentChildBeingDeleted; // should only be used when QObjectData::isDeletingChildren is set
@@ -246,47 +391,12 @@ public:
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_MOVABLE_TYPE);
-/*! \internal
-
- Returns \c true if the signal with index \a signal_index from object \a sender is connected.
- Signals with indices above a certain range are always considered connected (see connectedSignals
- in QObjectPrivate).
-
- \a signal_index must be the index returned by QObjectPrivate::signalIndex;
-*/
-inline bool QObjectPrivate::isSignalConnected(uint signal_index, bool checkDeclarative) const
-{
- return signal_index >= sizeof(connectedSignals) * 8
- || (connectedSignals[signal_index >> 5] & (1 << (signal_index & 0x1f))
- || (checkDeclarative && isDeclarativeSignalConnected(signal_index)));
-}
-
inline bool QObjectPrivate::isDeclarativeSignalConnected(uint signal_index) const
{
return declarativeData && QAbstractDeclarativeData::isSignalConnected
&& QAbstractDeclarativeData::isSignalConnected(declarativeData, q_func(), signal_index);
}
-inline QObjectPrivate::Sender *QObjectPrivate::setCurrentSender(QObject *receiver,
- Sender *sender)
-{
- Sender *previousSender = receiver->d_func()->currentSender;
- receiver->d_func()->currentSender = sender;
- return previousSender;
-}
-
-inline void QObjectPrivate::resetCurrentSender(QObject *receiver,
- Sender *currentSender,
- Sender *previousSender)
-{
- // ref is set to zero when this object is deleted during the metacall
- if (currentSender->ref == 1)
- receiver->d_func()->currentSender = previousSender;
- // if we've recursed, we need to tell the caller about the objects deletion
- if (previousSender)
- previousSender->ref = currentSender->ref;
-}
-
inline void QObjectPrivate::connectNotify(const QMetaMethod &signal)
{
q_ptr->connectNotify(signal);
@@ -372,37 +482,74 @@ Q_DECLARE_TYPEINFO(QObjectPrivate::Connection, Q_MOVABLE_TYPE);
Q_DECLARE_TYPEINFO(QObjectPrivate::Sender, Q_MOVABLE_TYPE);
class QSemaphore;
-class Q_CORE_EXPORT QMetaCallEvent : public QEvent
+class Q_CORE_EXPORT QAbstractMetaCallEvent : public QEvent
{
public:
- QMetaCallEvent(ushort method_offset, ushort method_relative, QObjectPrivate::StaticMetaCallFunction callFunction , const QObject *sender, int signalId,
- int nargs = 0, int *types = nullptr, void **args = nullptr, QSemaphore *semaphore = nullptr);
- /*! \internal
- \a signalId is in the signal index range (see QObjectPrivate::signalIndex()).
- */
- QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj, const QObject *sender, int signalId,
- int nargs = 0, int *types = nullptr, void **args = nullptr, QSemaphore *semaphore = nullptr);
+ QAbstractMetaCallEvent(const QObject *sender, int signalId, QSemaphore *semaphore = nullptr)
+ : QEvent(MetaCall), signalId_(signalId), sender_(sender)
+#if QT_CONFIG(thread)
+ , semaphore_(semaphore)
+#endif
+ { Q_UNUSED(semaphore); }
+ ~QAbstractMetaCallEvent();
- ~QMetaCallEvent();
+ virtual void placeMetaCall(QObject *object) = 0;
- inline int id() const { return method_offset_ + method_relative_; }
inline const QObject *sender() const { return sender_; }
inline int signalId() const { return signalId_; }
- inline void **args() const { return args_; }
-
- virtual void placeMetaCall(QObject *object);
private:
- QtPrivate::QSlotObjectBase *slotObj_;
- const QObject *sender_;
int signalId_;
- int nargs_;
- int *types_;
- void **args_;
+ const QObject *sender_;
+#if QT_CONFIG(thread)
QSemaphore *semaphore_;
- QObjectPrivate::StaticMetaCallFunction callFunction_;
- ushort method_offset_;
- ushort method_relative_;
+#endif
+};
+
+class Q_CORE_EXPORT QMetaCallEvent : public QAbstractMetaCallEvent
+{
+public:
+ // blocking queued with semaphore - args always owned by caller
+ QMetaCallEvent(ushort method_offset, ushort method_relative,
+ QObjectPrivate::StaticMetaCallFunction callFunction,
+ const QObject *sender, int signalId,
+ void **args, QSemaphore *semaphore);
+ QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj,
+ const QObject *sender, int signalId,
+ void **args, QSemaphore *semaphore);
+
+ // queued - args allocated by event, copied by caller
+ QMetaCallEvent(ushort method_offset, ushort method_relative,
+ QObjectPrivate::StaticMetaCallFunction callFunction,
+ const QObject *sender, int signalId,
+ int nargs);
+ QMetaCallEvent(QtPrivate::QSlotObjectBase *slotObj,
+ const QObject *sender, int signalId,
+ int nargs);
+
+ ~QMetaCallEvent() override;
+
+ inline int id() const { return d.method_offset_ + d.method_relative_; }
+ inline const void * const* args() const { return d.args_; }
+ inline void ** args() { return d.args_; }
+ inline const int *types() const { return reinterpret_cast<int*>(d.args_ + d.nargs_); }
+ inline int *types() { return reinterpret_cast<int*>(d.args_ + d.nargs_); }
+
+ virtual void placeMetaCall(QObject *object) override;
+
+private:
+ inline void allocArgs();
+
+ struct Data {
+ QtPrivate::QSlotObjectBase *slotObj_;
+ void **args_;
+ QObjectPrivate::StaticMetaCallFunction callFunction_;
+ int nargs_;
+ ushort method_offset_;
+ ushort method_relative_;
+ } d;
+ // preallocate enough space for three arguments
+ char prealloc_[3*(sizeof(void*) + sizeof(int))];
};
class QBoolBlocker
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index b84e87959a..dc2d832fe5 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -64,11 +64,7 @@ class QString;
// The following macros can be defined by tools that understand Qt
// to have the information from the macro.
#ifndef QT_ANNOTATE_CLASS
-# ifndef Q_COMPILER_VARIADIC_MACROS
-# define QT_ANNOTATE_CLASS(type, x)
-# else
-# define QT_ANNOTATE_CLASS(type, ...)
-# endif
+# define QT_ANNOTATE_CLASS(type, ...)
#endif
#ifndef QT_ANNOTATE_CLASS2
# define QT_ANNOTATE_CLASS2(type, a1, a2)
@@ -105,11 +101,7 @@ class QString;
#endif
#define Q_PLUGIN_METADATA(x) QT_ANNOTATE_CLASS(qt_plugin_metadata, x)
#define Q_INTERFACES(x) QT_ANNOTATE_CLASS(qt_interfaces, x)
-#ifdef Q_COMPILER_VARIADIC_MACROS
-# define Q_PROPERTY(...) QT_ANNOTATE_CLASS(qt_property, __VA_ARGS__)
-#else
-# define Q_PROPERTY(text) QT_ANNOTATE_CLASS(qt_property, text)
-#endif
+#define Q_PROPERTY(...) QT_ANNOTATE_CLASS(qt_property, __VA_ARGS__)
#define Q_PRIVATE_PROPERTY(d, text) QT_ANNOTATE_CLASS2(qt_private_property, d, text)
#ifndef Q_REVISION
# define Q_REVISION(v)
@@ -119,13 +111,13 @@ class QString;
#define Q_ENUMS(x) QT_ANNOTATE_CLASS(qt_enums, x)
#define Q_FLAGS(x) QT_ANNOTATE_CLASS(qt_enums, x)
#define Q_ENUM_IMPL(ENUM) \
- friend Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return &staticMetaObject; } \
- friend Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+ friend Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return &staticMetaObject; } \
+ friend Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
#define Q_ENUM(x) Q_ENUMS(x) Q_ENUM_IMPL(x)
#define Q_FLAG(x) Q_FLAGS(x) Q_ENUM_IMPL(x)
#define Q_ENUM_NS_IMPL(ENUM) \
- inline Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) Q_DECL_NOEXCEPT { return &staticMetaObject; } \
- inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) Q_DECL_NOEXCEPT { return #ENUM; }
+ inline Q_DECL_CONSTEXPR const QMetaObject *qt_getEnumMetaObject(ENUM) noexcept { return &staticMetaObject; } \
+ inline Q_DECL_CONSTEXPR const char *qt_getEnumName(ENUM) noexcept { return #ENUM; }
#define Q_ENUM_NS(x) Q_ENUMS(x) Q_ENUM_NS_IMPL(x)
#define Q_FLAG_NS(x) Q_FLAGS(x) Q_ENUM_NS_IMPL(x)
#define Q_SCRIPTABLE QT_ANNOTATE_FUNCTION(qt_scriptable)
@@ -209,12 +201,16 @@ private: \
QT_ANNOTATE_CLASS(qt_qgadget, "") \
/*end*/
-/* qmake ignore Q_NAMESPACE */
-#define Q_NAMESPACE \
- extern const QMetaObject staticMetaObject; \
+/* qmake ignore Q_NAMESPACE_EXPORT */
+#define Q_NAMESPACE_EXPORT(...) \
+ extern __VA_ARGS__ const QMetaObject staticMetaObject; \
QT_ANNOTATE_CLASS(qt_qnamespace, "") \
/*end*/
+/* qmake ignore Q_NAMESPACE */
+#define Q_NAMESPACE Q_NAMESPACE_EXPORT() \
+ /*end*/
+
#endif // QT_NO_META_MACROS
#else // Q_MOC_RUN
@@ -344,7 +340,7 @@ struct Q_CORE_EXPORT QMetaObject
const char *className() const;
const QMetaObject *superClass() const;
- bool inherits(const QMetaObject *metaObject) const Q_DECL_NOEXCEPT;
+ bool inherits(const QMetaObject *metaObject) const noexcept;
QObject *cast(QObject *obj) const;
const QObject *cast(const QObject *obj) const;
@@ -576,18 +572,48 @@ struct Q_CORE_EXPORT QMetaObject
int static_metacall(Call, int, void **) const;
static int metacall(QObject *, Call, int, void **);
+ template <const QMetaObject &MO> static constexpr const QMetaObject *staticMetaObject()
+ {
+ return &MO;
+ }
+
+ struct SuperData {
+ const QMetaObject *direct;
+ SuperData() = default;
+ constexpr SuperData(std::nullptr_t) : direct(nullptr) {}
+ constexpr SuperData(const QMetaObject *mo) : direct(mo) {}
+
+ constexpr const QMetaObject *operator->() const { return operator const QMetaObject *(); }
+
+#ifdef QT_NO_DATA_RELOCATION
+ using Getter = const QMetaObject *(*)();
+ Getter indirect = nullptr;
+ constexpr SuperData(Getter g) : direct(nullptr), indirect(g) {}
+ constexpr operator const QMetaObject *() const
+ { return indirect ? indirect() : direct; }
+ template <const QMetaObject &MO> static constexpr SuperData link()
+ { return SuperData(QMetaObject::staticMetaObject<MO>); }
+#else
+ constexpr operator const QMetaObject *() const
+ { return direct; }
+ template <const QMetaObject &MO> static constexpr SuperData link()
+ { return SuperData(QMetaObject::staticMetaObject<MO>()); }
+#endif
+ };
+
struct { // private data
- const QMetaObject *superdata;
+ SuperData superdata;
const QByteArrayData *stringdata;
const uint *data;
typedef void (*StaticMetacallFunction)(QObject *, QMetaObject::Call, int, void **);
StaticMetacallFunction static_metacall;
- const QMetaObject * const *relatedMetaObjects;
+ const SuperData *relatedMetaObjects;
void *extradata; //reserved for future use
} d;
private:
static bool invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase *slot, Qt::ConnectionType type, void *ret);
+ friend class QTimer;
};
class Q_CORE_EXPORT QMetaObject::Connection {
@@ -609,8 +635,8 @@ public:
operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : nullptr; }
#endif
- Connection(Connection &&o) Q_DECL_NOTHROW : d_ptr(o.d_ptr) { o.d_ptr = nullptr; }
- Connection &operator=(Connection &&other) Q_DECL_NOTHROW
+ Connection(Connection &&o) noexcept : d_ptr(o.d_ptr) { o.d_ptr = nullptr; }
+ Connection &operator=(Connection &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
};
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index aa6bd84e95..31ecc8b20d 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -386,8 +386,8 @@ namespace QtPrivate {
public:
explicit QSlotObjectBase(ImplFn fn) : m_ref(1), m_impl(fn) {}
- inline int ref() Q_DECL_NOTHROW { return m_ref.ref(); }
- inline void destroyIfLastRef() Q_DECL_NOTHROW
+ inline int ref() noexcept { return m_ref.ref(); }
+ inline void destroyIfLastRef() noexcept
{ if (!m_ref.deref()) m_impl(Destroy, this, nullptr, nullptr, nullptr); }
inline bool compare(void **a) { bool ret = false; m_impl(Compare, this, nullptr, a, &ret); return ret; }
diff --git a/src/corelib/kernel/qpointer.h b/src/corelib/kernel/qpointer.h
index b2b3cda4ab..5efdb0b395 100644
--- a/src/corelib/kernel/qpointer.h
+++ b/src/corelib/kernel/qpointer.h
@@ -54,20 +54,11 @@ class QPointer
{
Q_STATIC_ASSERT_X(!std::is_pointer<T>::value, "QPointer's template type must not be a pointer type");
- template<typename U>
- struct TypeSelector
- {
- typedef QObject Type;
- };
- template<typename U>
- struct TypeSelector<const U>
- {
- typedef const QObject Type;
- };
- typedef typename TypeSelector<T>::Type QObjectType;
+ using QObjectType =
+ typename std::conditional<std::is_const<T>::value, const QObject, QObject>::type;
QWeakPointer<QObjectType> wp;
public:
- inline QPointer() { }
+ QPointer() = default;
inline QPointer(T *p) : wp(p, true) { }
// compiler-generated copy/move ctor/assignment operators are fine!
// compiler-generated dtor is fine!
@@ -77,13 +68,13 @@ public:
~QPointer();
#endif
- inline void swap(QPointer &other) { wp.swap(other.wp); }
+ inline void swap(QPointer &other) noexcept { wp.swap(other.wp); }
inline QPointer<T> &operator=(T* p)
{ wp.assign(static_cast<QObjectType*>(p)); return *this; }
inline T* data() const
- { return static_cast<T*>( wp.data()); }
+ { return static_cast<T*>(wp.internalData()); }
inline T* operator->() const
{ return data(); }
inline T& operator*() const
@@ -143,9 +134,14 @@ template<typename T>
QPointer<T>
qPointerFromVariant(const QVariant &variant)
{
- return QPointer<T>(qobject_cast<T*>(QtSharedPointer::weakPointerFromVariant_internal(variant).data()));
+ const auto wp = QtSharedPointer::weakPointerFromVariant_internal(variant);
+ return QPointer<T>{qobject_cast<T*>(QtPrivate::EnableInternalData::internalData(wp))};
}
+template <class T>
+inline void swap(QPointer<T> &p1, QPointer<T> &p2) noexcept
+{ p1.swap(p2); }
+
QT_END_NAMESPACE
#endif // QT_NO_QOBJECT
diff --git a/src/corelib/kernel/qpoll.cpp b/src/corelib/kernel/qpoll.cpp
index 8e93c4d363..8b87bfe79d 100644
--- a/src/corelib/kernel/qpoll.cpp
+++ b/src/corelib/kernel/qpoll.cpp
@@ -39,6 +39,10 @@
#include "qcore_unix_p.h"
+#ifdef Q_OS_RTEMS
+#include <rtems/rtems_bsdnet_internal.h>
+#endif
+
QT_BEGIN_NAMESPACE
#define QT_POLL_READ_MASK (POLLIN | POLLRDNORM)
@@ -135,6 +139,11 @@ static inline int qt_poll_sweep(struct pollfd *fds, nfds_t nfds,
static inline bool qt_poll_is_bad_fd(int fd)
{
+#ifdef Q_OS_RTEMS
+ if (!rtems_bsdnet_fdToSocket(fd))
+ return true;
+#endif
+
int ret;
EINTR_LOOP(ret, fcntl(fd, F_GETFD));
return (ret == -1 && errno == EBADF);
diff --git a/src/corelib/kernel/qppsattribute.cpp b/src/corelib/kernel/qppsattribute.cpp
index 6be462edb5..166d590872 100644
--- a/src/corelib/kernel/qppsattribute.cpp
+++ b/src/corelib/kernel/qppsattribute.cpp
@@ -145,7 +145,6 @@ QPpsAttribute &QPpsAttribute::operator=(const QPpsAttribute &other)
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
QPpsAttribute::QPpsAttribute(QPpsAttribute &&other) : d(other.d)
{
other.d->type = QPpsAttribute::None;
@@ -156,7 +155,6 @@ QPpsAttribute &QPpsAttribute::operator=(QPpsAttribute &&other)
qSwap(d, other.d);
return *this;
}
-#endif
bool QPpsAttribute::operator==(const QPpsAttribute &other) const
{
diff --git a/src/corelib/kernel/qppsattribute_p.h b/src/corelib/kernel/qppsattribute_p.h
index b59dcd5851..d6611cb675 100644
--- a/src/corelib/kernel/qppsattribute_p.h
+++ b/src/corelib/kernel/qppsattribute_p.h
@@ -96,10 +96,8 @@ public:
bool operator==(const QPpsAttribute &other) const;
bool operator!=(const QPpsAttribute &other) const;
-#ifdef Q_COMPILER_RVALUE_REFS
QPpsAttribute(QPpsAttribute &&other);
QPpsAttribute &operator=(QPpsAttribute &&other);
-#endif
bool isValid() const;
Type type() const;
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index c952655cb8..39f3002394 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -150,11 +150,18 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
\sa setKey()
*/
+
+#ifndef QT_NO_QOBJECT
QSharedMemory::QSharedMemory(QObject *parent)
: QObject(*new QSharedMemoryPrivate, parent)
{
}
-
+#else
+QSharedMemory::QSharedMemory()
+ : d_ptr(new QSharedMemoryPrivate)
+{
+}
+#endif
/*!
Constructs a shared memory object with the given \a parent and with
its key set to \a key. Because its key is set, its create() and
@@ -162,11 +169,19 @@ QSharedMemory::QSharedMemory(QObject *parent)
\sa setKey(), create(), attach()
*/
+#ifndef QT_NO_QOBJECT
QSharedMemory::QSharedMemory(const QString &key, QObject *parent)
: QObject(*new QSharedMemoryPrivate, parent)
{
setKey(key);
}
+#else
+QSharedMemory::QSharedMemory(const QString &key)
+ : d_ptr(new QSharedMemoryPrivate)
+{
+ setKey(key);
+}
+#endif
/*!
The destructor clears the key, which forces the shared memory object
@@ -604,4 +619,6 @@ QString QSharedMemory::errorString() const
QT_END_NAMESPACE
+#ifndef QT_NO_QOBJECT
#include "moc_qsharedmemory.cpp"
+#endif
diff --git a/src/corelib/kernel/qsharedmemory.h b/src/corelib/kernel/qsharedmemory.h
index 67cf52ac17..6236c6aa4c 100644
--- a/src/corelib/kernel/qsharedmemory.h
+++ b/src/corelib/kernel/qsharedmemory.h
@@ -40,8 +40,14 @@
#ifndef QSHAREDMEMORY_H
#define QSHAREDMEMORY_H
-#include <QtCore/qobject.h>
-
+#include <QtCore/qglobal.h>
+#ifndef QT_NO_QOBJECT
+# include <QtCore/qobject.h>
+#else
+# include <QtCore/qobjectdefs.h>
+# include <QtCore/qscopedpointer.h>
+# include <QtCore/qstring.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -49,9 +55,14 @@ QT_BEGIN_NAMESPACE
class QSharedMemoryPrivate;
-class Q_CORE_EXPORT QSharedMemory : public QObject
+class Q_CORE_EXPORT QSharedMemory
+#ifndef QT_NO_QOBJECT
+ : public QObject
+#endif
{
+#ifndef QT_NO_QOBJECT
Q_OBJECT
+#endif
Q_DECLARE_PRIVATE(QSharedMemory)
public:
@@ -74,8 +85,17 @@ public:
UnknownError
};
+#ifndef QT_NO_QOBJECT
QSharedMemory(QObject *parent = nullptr);
QSharedMemory(const QString &key, QObject *parent = nullptr);
+#else
+ QSharedMemory();
+ QSharedMemory(const QString &key);
+ static QString tr(const char * str)
+ {
+ return QString::fromLatin1(str);
+ }
+#endif
~QSharedMemory();
void setKey(const QString &key);
@@ -104,6 +124,9 @@ public:
private:
Q_DISABLE_COPY(QSharedMemory)
+#ifdef QT_NO_QOBJECT
+ QScopedPointer<QSharedMemoryPrivate> d_ptr;
+#endif
};
#endif // QT_NO_SHAREDMEMORY
diff --git a/src/corelib/kernel/qsharedmemory_p.h b/src/corelib/kernel/qsharedmemory_p.h
index 95fe0d1083..e6e989abda 100644
--- a/src/corelib/kernel/qsharedmemory_p.h
+++ b/src/corelib/kernel/qsharedmemory_p.h
@@ -67,9 +67,12 @@ namespace QSharedMemoryPrivate
#else
#include "qsystemsemaphore.h"
-#include "private/qobject_p.h"
-#if !defined(Q_OS_WIN) && !defined(Q_OS_ANDROID) && !defined(Q_OS_INTEGRITY)
+#ifndef QT_NO_QOBJECT
+# include "private/qobject_p.h"
+#endif
+
+#if !defined(Q_OS_WIN) && !defined(Q_OS_ANDROID) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_RTEMS)
# include <sys/sem.h>
#endif
@@ -98,7 +101,7 @@ public:
{
if (q_sm && q_sm->lock())
return true;
- q_sm = 0;
+ q_sm = nullptr;
return false;
}
@@ -107,9 +110,14 @@ private:
};
#endif // QT_NO_SYSTEMSEMAPHORE
-class Q_AUTOTEST_EXPORT QSharedMemoryPrivate : public QObjectPrivate
+class Q_AUTOTEST_EXPORT QSharedMemoryPrivate
+#ifndef QT_NO_QOBJECT
+ : public QObjectPrivate
+#endif
{
+#ifndef QT_NO_QOBJECT
Q_DECLARE_PUBLIC(QSharedMemory)
+#endif
public:
QSharedMemoryPrivate();
diff --git a/src/corelib/kernel/qsharedmemory_unix.cpp b/src/corelib/kernel/qsharedmemory_unix.cpp
index d1d44747e0..f6d7e78441 100644
--- a/src/corelib/kernel/qsharedmemory_unix.cpp
+++ b/src/corelib/kernel/qsharedmemory_unix.cpp
@@ -64,8 +64,11 @@
#ifndef QT_NO_SHAREDMEMORY
QT_BEGIN_NAMESPACE
-QSharedMemoryPrivate::QSharedMemoryPrivate()
- : QObjectPrivate(), memory(0), size(0), error(QSharedMemory::NoError),
+QSharedMemoryPrivate::QSharedMemoryPrivate() :
+#ifndef QT_NO_QOBJECT
+ QObjectPrivate(),
+#endif
+ memory(0), size(0), error(QSharedMemory::NoError),
#ifndef QT_NO_SYSTEMSEMAPHORE
systemSemaphore(QString()), lockedByMe(false),
#endif
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index c1dba30e2b..02de2339a5 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -47,7 +47,10 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_SHAREDMEMORY
-QSharedMemoryPrivate::QSharedMemoryPrivate() : QObjectPrivate(),
+QSharedMemoryPrivate::QSharedMemoryPrivate() :
+#ifndef QT_NO_QOBJECT
+ QObjectPrivate(),
+#endif
memory(0), size(0), error(QSharedMemory::NoError),
systemSemaphore(QString()), lockedByMe(false), hand(0)
{
diff --git a/src/corelib/kernel/qsignalmapper.cpp b/src/corelib/kernel/qsignalmapper.cpp
index 34fea861cd..24b174972f 100644
--- a/src/corelib/kernel/qsignalmapper.cpp
+++ b/src/corelib/kernel/qsignalmapper.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qglobal.h"
-#if QT_DEPRECATED_SINCE(5, 10)
#include "qsignalmapper.h"
#include "qhash.h"
@@ -64,7 +63,6 @@ public:
/*!
\class QSignalMapper
\inmodule QtCore
- \obsolete The recommended solution is connecting the signal to a lambda.
\brief The QSignalMapper class bundles signals from identifiable senders.
\ingroup objectmodel
@@ -72,7 +70,9 @@ public:
This class collects a set of parameterless signals, and re-emits
them with integer, string or widget parameters corresponding to
- the object that sent the signal.
+ the object that sent the signal. Note that in most cases you can
+ use lambdas for passing custom parameters to slots. This is less
+ costly and will simplify the code.
The class supports the mapping of particular strings or integers
with particular objects using setMapping(). The objects' signals
@@ -314,5 +314,3 @@ void QSignalMapper::map(QObject *sender)
QT_END_NAMESPACE
#include "moc_qsignalmapper.cpp"
-
-#endif
diff --git a/src/corelib/kernel/qsignalmapper.h b/src/corelib/kernel/qsignalmapper.h
index 6c4cfa9627..0da1e8f87d 100644
--- a/src/corelib/kernel/qsignalmapper.h
+++ b/src/corelib/kernel/qsignalmapper.h
@@ -42,8 +42,6 @@
#include <QtCore/qobject.h>
-#if QT_DEPRECATED_SINCE(5, 10)
-
QT_BEGIN_NAMESPACE
class QSignalMapperPrivate;
@@ -53,7 +51,7 @@ class Q_CORE_EXPORT QSignalMapper : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QSignalMapper)
public:
- QT_DEPRECATED explicit QSignalMapper(QObject *parent = nullptr);
+ explicit QSignalMapper(QObject *parent = nullptr);
~QSignalMapper();
void setMapping(QObject *sender, int id);
@@ -84,6 +82,4 @@ private:
QT_END_NAMESPACE
-#endif
-
#endif // QSIGNALMAPPER_H
diff --git a/src/corelib/kernel/qsocketnotifier.cpp b/src/corelib/kernel/qsocketnotifier.cpp
index 6ff8268978..2a246b1204 100644
--- a/src/corelib/kernel/qsocketnotifier.cpp
+++ b/src/corelib/kernel/qsocketnotifier.cpp
@@ -152,7 +152,7 @@ QSocketNotifier::QSocketNotifier(qintptr socket, Type type, QObject *parent)
else if (!d->threadData->hasEventDispatcher())
qWarning("QSocketNotifier: Can only be used with threads started with QThread");
else
- d->threadData->eventDispatcher.load()->registerSocketNotifier(this);
+ d->threadData->eventDispatcher.loadRelaxed()->registerSocketNotifier(this);
}
/*!
@@ -241,9 +241,9 @@ void QSocketNotifier::setEnabled(bool enable)
return;
}
if (d->snenabled)
- d->threadData->eventDispatcher.load()->registerSocketNotifier(this);
+ d->threadData->eventDispatcher.loadRelaxed()->registerSocketNotifier(this);
else
- d->threadData->eventDispatcher.load()->unregisterSocketNotifier(this);
+ d->threadData->eventDispatcher.loadRelaxed()->unregisterSocketNotifier(this);
}
diff --git a/src/corelib/kernel/qsystemerror.cpp b/src/corelib/kernel/qsystemerror.cpp
index 9d0394e4a5..a735e12925 100644
--- a/src/corelib/kernel/qsystemerror.cpp
+++ b/src/corelib/kernel/qsystemerror.cpp
@@ -112,7 +112,7 @@ static QString windowsErrorString(int errorCode)
static QString standardLibraryErrorString(int errorCode)
{
- const char *s = 0;
+ const char *s = nullptr;
QString ret;
switch (errorCode) {
case 0:
diff --git a/src/corelib/kernel/qsystemsemaphore_systemv.cpp b/src/corelib/kernel/qsystemsemaphore_systemv.cpp
index 9e438ae2a6..2c38d74d2d 100644
--- a/src/corelib/kernel/qsystemsemaphore_systemv.cpp
+++ b/src/corelib/kernel/qsystemsemaphore_systemv.cpp
@@ -76,7 +76,7 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
#if QT_CONFIG(translation)
QCoreApplication::tr("%1: key is empty", "QSystemSemaphore")
#else
- QString::fromLatin1("%1: key is empty")
+ QLatin1String("%1: key is empty")
#endif
.arg(QLatin1String("QSystemSemaphore::handle:"));
error = QSystemSemaphore::KeyError;
@@ -94,7 +94,7 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
#if QT_CONFIG(translation)
QCoreApplication::tr("%1: unable to make key", "QSystemSemaphore")
#else
- QString::fromLatin1("%1: unable to make key")
+ QLatin1String("%1: unable to make key")
#endif
.arg(QLatin1String("QSystemSemaphore::handle:"));
error = QSystemSemaphore::KeyError;
@@ -111,7 +111,7 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
#if QT_CONFIG(translation)
QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore")
#else
- QString::fromLatin1("%1: ftok failed")
+ QLatin1String("%1: ftok failed")
#endif
.arg(QLatin1String("QSystemSemaphore::handle:"));
error = QSystemSemaphore::KeyError;
diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp
deleted file mode 100644
index 5437210699..0000000000
--- a/src/corelib/kernel/qtcore_eval.cpp
+++ /dev/null
@@ -1,560 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qcoreevent.h>
-#include <qdatetime.h>
-#include <qlibraryinfo.h>
-#include <qobject.h>
-#include <qcoreapplication.h>
-#include <private/qcoreapplication_p.h>
-
-#include "stdio.h"
-#include "stdlib.h"
-
-QT_BEGIN_NAMESPACE
-
-#include "qconfig_eval.cpp"
-
-static const char boilerplate_supported_but_time_limited[] =
- "\nQt %1 Evaluation License\n"
- "Copyright (C) 2016 The Qt Company Ltd.\n"
- "This trial version may only be used for evaluation purposes\n"
- "and will shut down after 120 minutes.\n"
- "Registered to:\n"
- " Licensee: %2\n\n"
- "The evaluation expires in %4 days\n\n"
- "Contact http://www.qt.io/contact-us for pricing and purchasing information.\n";
-
-static const char boilerplate_supported[] =
- "\nQt %1 Evaluation License\n"
- "Copyright (C) 2016 The Qt Company Ltd.\n"
- "This trial version may only be used for evaluation purposes\n"
- "Registered to:\n"
- " Licensee: %2\n\n"
- "The evaluation expires in %4 days\n\n"
- "Contact http://www.qt.io/contact-us for pricing and purchasing information.\n";
-
-static const char boilerplate_expired[] =
- "This software is using the trial version of the Qt GUI toolkit.\n"
- "The trial period has expired. If you need more time to\n"
- "evaluate Qt, or if you have any questions about Qt, contact us\n"
- "at: http://www.qt.io/contact-us.\n\n";
-
-static const char will_shutdown_1min[] =
- "\nThe evaluation of Qt will SHUT DOWN in 1 minute.\n"
- "Contact http://www.qt.io/contact-us for pricing and purchasing information.\n";
-
-static const char will_shutdown_now[] =
- "\nThe evaluation of Qt has now reached its automatic\n"
- "timeout and will shut down.\n"
- "Contact http://www.qt.io/contact-us for pricing and purchasing information.\n";
-
-enum EvaluationStatus {
- EvaluationNotSupported = 0,
- EvaluationSupportedButTimeLimited,
- EvaluationSupported
-};
-
-static EvaluationStatus qt_eval_is_supported()
-{
- const volatile char *const license_key = qt_eval_key_data + 12;
-
- // fast fail
- if (!qt_eval_key_data[0] || !*license_key)
- return EvaluationNotSupported;
-
- // is this an unsupported evaluation?
- const volatile char *typecode = license_key;
- int field = 2;
- for ( ; field && *typecode; ++typecode)
- if (*typecode == '-')
- --field;
-
- if (!field && typecode[1] == '4' && typecode[2] == 'M') {
- if (typecode[0] == 'Q')
- return EvaluationSupportedButTimeLimited;
- else if (typecode[0] == 'R' || typecode[0] == 'Z')
- return EvaluationSupported;
- }
- return EvaluationNotSupported;
-}
-
-static int qt_eval_days_left()
-{
- const volatile char *const expiry_date = qt_eval_expiry_date + 12;
-
- QDate today = QDate::currentDate();
- QDate lastday = QDate::fromString(
- QString::fromLatin1(const_cast<const char*>(expiry_date)), Qt::ISODate);
- return today.daysTo(lastday);
-}
-
-static bool qt_eval_is_expired()
-{
- return qt_eval_days_left() < 0;
-}
-
-static QString qt_eval_string()
-{
- const char *msg;
- switch (qt_eval_is_supported()) {
- case EvaluationSupportedButTimeLimited:
- msg = boilerplate_supported_but_time_limited;
- break;
- case EvaluationSupported:
- msg = boilerplate_supported;
- break;
- default:
- return QString();
- }
-
- return QString::fromLatin1(msg)
- .arg(QLatin1String(QT_VERSION_STR))
- .arg(QLibraryInfo::licensee())
- .arg(qt_eval_days_left());
-}
-
-#define WARN_TIMEOUT 60 * 1000 * 119
-#define KILL_DELAY 60 * 1000 * 1
-
-class QCoreFuriCuri : public QObject
-{
-public:
-
- int warn;
- int kill;
-
- QCoreFuriCuri() : QObject(), warn(-1), kill(-1)
- {
- if (qt_eval_is_supported() == EvaluationSupportedButTimeLimited) {
- warn = startTimer(WARN_TIMEOUT);
- kill = 0;
- }
- }
-
- void timerEvent(QTimerEvent *e) override {
- if (e->timerId() == warn) {
- killTimer(warn);
- fprintf(stderr, "%s\n", will_shutdown_1min);
- kill = startTimer(KILL_DELAY);
- } else if (e->timerId() == kill) {
- fprintf(stderr, "%s\n", will_shutdown_now);
- QCoreApplication::instance()->quit();
- }
- }
-};
-
-#if defined(QT_BUILD_CORE_LIB) || defined (QT_BOOTSTRAPPED)
-
-void qt_core_eval_init(QCoreApplicationPrivate::Type type)
-{
- if (type != QCoreApplicationPrivate::Tty)
- return;
-
- if (!qt_eval_is_supported())
- return;
-
- if (qt_eval_is_expired()) {
- fprintf(stderr, "%s\n", boilerplate_expired);
- exit(0);
- } else {
- fprintf(stderr, "%s\n", qPrintable(qt_eval_string()));
- Q_UNUSED(new QCoreFuriCuri());
- }
-}
-#endif
-
-#ifdef QT_BUILD_WIDGETS_LIB
-
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <qdialog.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qmessagebox.h>
-#if QT_CONFIG(pushbutton)
-#include <qpushbutton.h>
-#endif
-#include <qtimer.h>
-#include <qapplication.h>
-QT_END_INCLUDE_NAMESPACE
-
-
-static const char * const qtlogo_eval_xpm[] = {
-/* columns rows colors chars-per-pixel */
-"46 55 174 2",
-" c #002E02",
-". c #00370D",
-"X c #003A0E",
-"o c #003710",
-"O c #013C13",
-"+ c #043E1A",
-"@ c #084F0A",
-"# c #0B520C",
-"$ c #054413",
-"% c #0C4C17",
-"& c #07421D",
-"* c #09451D",
-"= c #0D491E",
-"- c #125515",
-"; c #13541A",
-": c #17591B",
-"> c #1B5C1D",
-", c #1F611F",
-"< c #20621E",
-"1 c #337B1E",
-"2 c #0B4521",
-"3 c #0F4923",
-"4 c #114B24",
-"5 c #154D2A",
-"6 c #175323",
-"7 c #1C5924",
-"8 c #1C532F",
-"9 c #1E5432",
-"0 c #245936",
-"q c #265938",
-"w c #295C3B",
-"e c #246324",
-"r c #266823",
-"t c #2A6C24",
-"y c #276628",
-"u c #2D7026",
-"i c #327427",
-"p c #367927",
-"a c #37782A",
-"s c #397C2A",
-"d c #2E613E",
-"f c #336C37",
-"g c #2F6040",
-"h c #356545",
-"j c #3C6B4E",
-"k c #3F6C51",
-"l c #406E4F",
-"z c #406D52",
-"x c #477457",
-"c c #497557",
-"v c #4B7857",
-"b c #517B5E",
-"n c #3C8423",
-"m c #3E812C",
-"M c #53A61D",
-"N c #41862C",
-"B c #458A2D",
-"V c #498F2D",
-"C c #479324",
-"Z c #489226",
-"A c #4D952C",
-"S c #478B30",
-"D c #488C30",
-"F c #4D9232",
-"G c #509632",
-"H c #549A33",
-"J c #589F35",
-"K c #56A526",
-"L c #57A821",
-"P c #5BAA27",
-"I c #57A32A",
-"U c #5CA72E",
-"Y c #5DAB2A",
-"T c #5CA336",
-"R c #60AD2E",
-"E c #63B12D",
-"W c #65AF35",
-"Q c #62A53F",
-"! c #65AE39",
-"~ c #66B036",
-"^ c #6AB437",
-"/ c #67B138",
-"( c #6AB339",
-") c #6DB838",
-"_ c #70BA3C",
-"` c #4D8545",
-"' c #4E8942",
-"] c #548851",
-"[ c #6FAF4A",
-"{ c #6DB243",
-"} c #71B546",
-"| c #70B840",
-" . c #73B648",
-".. c #79BA4E",
-"X. c #7CBB53",
-"o. c #598266",
-"O. c #62886D",
-"+. c #6A8F75",
-"@. c #6B9173",
-"#. c #70937A",
-"$. c #799F79",
-"%. c #7BAF66",
-"&. c #81BD5B",
-"*. c #85BF60",
-"=. c #85AC7F",
-"-. c #8DBA7B",
-";. c #87C061",
-":. c #8AC364",
-">. c #8DC46A",
-",. c #90C56E",
-"<. c #93C771",
-"1. c #96CA73",
-"2. c #9ACB7C",
-"3. c #9FD07D",
-"4. c #779981",
-"5. c #7F9F89",
-"6. c #809F88",
-"7. c #82A18B",
-"8. c #86A192",
-"9. c #8DA994",
-"0. c #8FA998",
-"q. c #94AF9B",
-"w. c #97B991",
-"e. c #97B19E",
-"r. c #9DB6A3",
-"t. c #A3BCA7",
-"y. c #A6BCAB",
-"u. c #A9BEB1",
-"i. c #9ECD81",
-"p. c #A2CF85",
-"a. c #A5D284",
-"s. c #A6D189",
-"d. c #A9D28E",
-"f. c #ABD491",
-"g. c #B1D797",
-"h. c #B1D699",
-"j. c #B5D89E",
-"k. c #ADC5AC",
-"l. c #B1CAAE",
-"z. c #B9DAA3",
-"x. c #BDDDA8",
-"c. c #ADC1B4",
-"v. c #B2C6B6",
-"b. c #B5C6BC",
-"n. c #B6C9BA",
-"m. c #BCD1BA",
-"M. c #C6E1B4",
-"N. c #CDE5BD",
-"B. c #C2D2C6",
-"V. c #CADEC2",
-"C. c #C6D3CC",
-"Z. c #C8D7CB",
-"A. c #CEDAD2",
-"S. c #D2DDD4",
-"D. c #D3E9C6",
-"F. c #D7EBC9",
-"G. c #D9EBCD",
-"H. c #DEEED4",
-"J. c #D6E0D9",
-"K. c #DAE4DC",
-"L. c #E0EFD7",
-"P. c #E5F2DD",
-"I. c #DFE8E0",
-"U. c #E4EBE5",
-"Y. c #E9EFEA",
-"T. c #EDF4EB",
-"R. c #F0FAE6",
-"E. c #F1F8EC",
-"W. c #EDF0F0",
-"Q. c #F4F7F3",
-"!. c #F6F9F4",
-"~. c #F8FAF7",
-"^. c #FEFEFE",
-"/. c None",
-/* pixels */
-"/././././.c h ' Q / W _ &.p././././././././././././././././././././././././././././././././.",
-"/././.4 O % Z ~ ~ W ~ W R U R R ( X.>.p././././././././././././././././././././././././././.",
-"/./.. * = J _ ~ ~ ~ ~ ~ / / / / W W U P P U W .;.2././././././././././././././././././././.",
-"/.= = & a ) W ~ ~ ~ ~ ~ / W / ~ ~ ~ ^ ( ( ^ ~ R R U P Y ~ .;.2././././././././././././././.",
-"O.O = = T ^ W ~ ~ ~ ~ ~ ~ W W / W ~ ~ ~ ~ ~ ~ ~ ( ( ( ( ~ W Y Y Y Y W { &.1././././././././.",
-"0 = * 7 ~ ~ ~ ~ ~ ~ ~ ~ ~ / / W ~ ~ ~ ~ ~ ~ ~ ~ W W W ~ ~ ~ ~ ( ( ( W W R U P U W { X.1.f./.",
-"= = & e ^ W ~ ~ ~ ~ ~ ~ ~ ~ / / ~ ~ ~ ~ ~ ~ ~ ~ W ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ^ ( ( / ~ W R U U Y ",
-"= = & e ^ W ~ ~ ~ ~ ~ ~ ~ ~ W W ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W ( W ~ ~ ~ ^ ^ ( ",
-"= = * e ^ W ~ ~ ~ ~ ~ ~ / W / W ! ( / ~ W ^ ( ( ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W ~ W W ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ ! ~ ~ ~ ~ ~ ~ W W ^ _ ~ K Y W W R P Y W ( ~ ~ ~ ~ ~ ~ ~ W / ~ ~ ~ ^ W ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ ~ ~ ~ ~ W ) W 1 ` w.V.L.H.D.z.,.~ Y ^ ~ ~ ~ ~ ~ W ~ ~ ~ ( ~ W W ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ ~ ~ ~ W ) V = 8.~.^.^.^.^.^.^.^.U.<.Y ~ ~ ~ ~ ~ W W ! ~ Y W ^ W ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ ~ ~ W ^ B O u.^.~.^.^.^.^.~.~.^.^.^.h.Y ^ ~ ~ ^ F $ k.R.G.1.Y / ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ ~ ~ ~ / W ( J X 7.^.~.^.^.^.^.^.^.^.^.^.^.^.s.Y / W ) a 2 U.^.^.d.U ( ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W / ~ ~ ~ ^ > w ~.^.^.^.^.^.F.%.v c.^.^.^.^.~.X.W ~ ^ > h ^.^.^.d.P ( ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ W ^ H o e.^.^.^.^.^.G.Y E n . y.^.^.^.^.M.Y ( ! $ @.^.~.^.f.U ( / ~ ~ W ~ ~ ",
-"= = & e ^ W ~ W ! ) t 4 U.^.^.^.^.^.>.U ( _ , 9 ~.^.^.^.~...^ A y.^.~.^.s.M W Y ~ ~ ~ ~ ~ ",
-"= 3 & e ^ W ~ ( ^ ( $ c ^.^.^.^.^.E.) ~ ~ ^ S o n.^.^.^.^.=.- l.v.Y.^.^.^.M.:.:.X.~ ~ ~ ~ ~ ",
-"= = & e ^ ! W W ( J X 7.^.^.^.^.^.F.Y ( W ^ T X 6.^.^.~.^.c.. J.^.^.^.^.^.^.^.^.P.~ ~ ~ ~ ~ ",
-"= = & r ^ W / W ) B o v.^.~.^.^.^.M.U / ~ ~ ! $ o.^.^.^.^.K.* S.^.^.^.^.^.^.^.^.P.~ ~ ~ ~ ~ ",
-"= = & e ^ ! ~ W ) a + S.^.^.^.^.^.z.P ( W ~ ( % z ^.^.^.^.~.f t.U.^.^.^.^.~.^.^.P.~ ~ ~ ~ ~ ",
-"* = & e ^ W ~ W ) t 3 Y.^.^.^.^.^.f.P ( ~ ~ ^ ; h ^.^.^.^.^.:.@ j ^.^.^.^.h.{ X.&.~ ~ ~ ~ ~ ",
-"3 = & e ^ W ~ ~ ^ e 8 Q.^.^.^.^.^.s.P ~ ~ W ^ > 0 ~.^.^.^.^.1.# z ^.^.^.^.d.L W R ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ ^ > q ~.^.^.^.^.^.p.U ^ ~ W ) e 9 ~.^.^.^.^.3.# k ^.^.^.^.f.Y ( / ~ ~ ~ ~ ~ ",
-"= = & e ^ W / W ^ > w ~.^.^.^.^.^.i.Y / ~ W ^ e 8 Q.^.^.^.^.a.# z ^.^.^.^.f.Y / ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W / W ^ > w ^.^.^.^.^.^.2.Y / ~ ~ ) e 8 Q.^.^.^.^.s.# z ^.^.^.^.d.P ( ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W W W ^ > q ^.^.^.^.^.^.p.Y / ~ ~ ^ e 9 Q.^.^.^.^.a.@ z ^.^.^.^.f.U / ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W / W ) 7 9 Q.^.^.^.^.^.a.P / ~ W ) , 9 Q.^.^.^.^.3.# z ^.^.~.^.f.P ^ ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W / W ) r 5 T.^.^.^.^.^.d.Y / ~ W ) > q ~.^.^.^.^.1.# k ^.^.^.^.f.Y ( ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ / / W ) i 2 I.^.^.^.^.^.h.P ( ~ W ( > g ^.^.^.^.^.:.# z ^.^.^.^.f.P / ~ ~ ~ ~ ~ ~ ",
-"= = & e ( W / W ) m O Z.^.^.^.^.^.x.P / ~ ~ ( ; j ^.^.^.^.~.&.- k ^.^.~.^.f.P / ~ ~ ~ ~ ~ ~ ",
-"= = & e ( W / W ) F o y.^.~.^.^.^.N.U ( ~ ~ W $ b ^.^.^.^.R._ - k ^.^.^.^.f.Y ( ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ ^ J X 4.^.^.^.^.^.L.~ ~ W ^ T X #.^.^.^.^.F.~ ; j ^.^.^.^.f.U ( ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ ~ ~ ~ / ^ % l ^.^.^.^.^.!. .R ^ ^ G . r.^.~.^.^.j.E : j ^.^.^.^.f.P ) ( ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ W ) u = U.^.^.^.^.^.1.Y ! ) a & K.^.^.^.^.;.~ : j ^.^.~.^.z.M I I / ~ ~ W ~ ",
-"= = & e ( W ~ ~ W ( G . q.^.^.^.^.^.D.U ^ ! X o.^.^.^.^.P.~ ^ > g ^.^.^.^.E.-.$.m.X.W ~ ~ ~ ",
-"= = & e ^ / ~ ~ ^ ! ( > w ~.^.^.^.^.^.h.T > j T.^.^.~.^.a.Y _ i 3 U.^.^.^.^.^.^.^.X.R ~ ~ ~ ",
-"= = & e ^ / ~ ~ W W ^ H . 9.^.~.^.^.^.^.K.C.~.^.^.^.^.H.W W ^ T . q.^.~.^.^.^.^.^.X.R ~ ~ ~ ",
-"= = + e ^ W / ~ W W W ) m + B.^.~.^.^.^.^.^.^.^.^.^.E.X.Y ( W ^ B 6 y.^.^.^.E.D.2.( ~ ~ ~ ~ ",
-"= = * e ^ ! / ! W ^ W W ) a 4 b.^.^.^.^.^.^.^.^.^.P...Y ( ! W ! ^ W Z [ *.X.{ Y U ~ ~ ~ ~ ~ ",
-"= = & e ( W ~ ~ W / W / W ) A < +.A.~.^.^.^.^.!.p.W R ~ ~ ~ ~ ~ W / ) E U W W / ^ ~ ~ ~ ~ ~ ",
-"= = & e ^ W ~ ~ / W / / / W ( _ Z X 6.^.^.^.^.E.W ~ ^ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ / ~ ~ ~ ~ ~ ~ ~ ~ ",
-"= = & e ^ ~ ~ ~ W W / W ~ ~ ~ ~ ) ; h ^.^.^.^.^.d.M U ~ / ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W ",
-"= = & e ^ W ~ ~ ^ W W / ~ ~ ~ W ) p + S.^.^.^.^.~.M.f. .W ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ .",
-"= = & e ^ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W ( T O +.^.~.^.^.^.^.^.&.Y ( ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W ( Y 2.",
-"= = & e ( W ~ ~ ~ ~ ~ ~ ~ ~ ~ / W ) N + b.^.^.^.^.^.^.&.R ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W /.",
-"= = & e ^ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W ^ N 7 r.W.^.^.^.!.X.W ~ ~ W ~ W ~ ~ ~ ~ ~ ~ / ( ( K p./.",
-"= = & e ( W ~ ~ W ~ ~ ~ ~ ~ ~ ~ ~ ~ W ( W C Q &.:.X.| ~ ~ ~ ~ W ~ / ~ ( / ( ~ W E U P 1././.",
-"= = + e ^ / / / ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W / ) ^ R Y W W ~ ~ ( / ( / W R Y Y U R ( X.,././././.",
-"= = * e ( / ~ / ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ W W W ! ( ( ( W W E U P Y W ( X.,.d./././././././././.",
-"= = * e ( W ~ ~ ~ ~ W ! ~ W ~ W ~ ( ( / ^ W W U Y P W ( X.,.d./././././././././././././././.",
-"8 $ * e ( W ~ ~ ~ ! ( ( ( / ( W R Y Y Y R ( X.>.d./././././././././././././././././././././.",
-"/.d . y ^ / / / ( W Y Y P P W ( X.>.d./././././././././././././././././././././././././././.",
-"/./.h : ^ R R R W ( X.<.f./././././././././././././././././././././././././././././././././.",
-"/././.] _ *.3./././././././././././././././././././././././././././././././././././././././."
-};
-
-class EvalMessageBox : public QDialog
-{
-public:
- EvalMessageBox(bool expired)
- {
- setWindowTitle(QLatin1String(" "));
-
- QString str = expired ? QLatin1String(boilerplate_expired) : qt_eval_string();
- str = str.trimmed();
-
- QFrame *border = new QFrame(this);
-
- QLabel *pixmap_label = new QLabel(border);
- pixmap_label->setPixmap(QPixmap(qtlogo_eval_xpm));
- pixmap_label->setAlignment(Qt::AlignTop);
-
- QLabel *text_label = new QLabel(str, border);
-
- QHBoxLayout *pm_and_text_layout = new QHBoxLayout();
- pm_and_text_layout->addWidget(pixmap_label);
- pm_and_text_layout->addWidget(text_label);
-
- QVBoxLayout *master_layout = new QVBoxLayout(border);
- master_layout->addLayout(pm_and_text_layout);
-
- QVBoxLayout *border_layout = new QVBoxLayout(this);
- border_layout->setMargin(0);
- border_layout->addWidget(border);
-
- if (expired) {
- QPushButton *cmd = new QPushButton(QLatin1String("OK"), border);
- cmd->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- cmd->setDefault(true);
-
- QHBoxLayout *button_layout = new QHBoxLayout();
- master_layout->addLayout(button_layout);
- button_layout->addWidget(cmd);
-
- connect(cmd, SIGNAL(clicked()), this, SLOT(close()));
- } else {
- border->setFrameShape(QFrame::WinPanel);
- border->setFrameShadow(QFrame::Raised);
- setParent(parentWidget(), Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
- QTimer::singleShot(7000, this, SLOT(close()));
- setAttribute(Qt::WA_DeleteOnClose);
- setAttribute(Qt::WA_QuitOnClose, false);
- }
-
- setFixedSize(sizeHint());
- }
-};
-
-class QGuiFuriCuri : public QCoreFuriCuri
-{
-public:
- void timerEvent(QTimerEvent *e) {
- if (e->timerId() == warn) {
- killTimer(warn);
- QMessageBox::information(0, QLatin1String("Automatic Timeout"), QLatin1String(will_shutdown_1min));
- kill = startTimer(KILL_DELAY);
- } else if (e->timerId() == kill) {
- killTimer(kill);
- QMessageBox::information(0, QLatin1String("Automatic Timeout"), QLatin1String(will_shutdown_now));
- qApp->quit();
- }
- }
-};
-
-
-void qt_gui_eval_init(QCoreApplicationPrivate::Type type)
-{
- Q_UNUSED(type);
-
- if (!qt_eval_is_supported())
- return;
-
- if (qt_eval_is_expired()) {
- EvalMessageBox box(true);
- box.exec();
- ::exit(0);
- } else {
- Q_UNUSED(new QGuiFuriCuri());
- }
-}
-
-static QString qt_eval_title_prefix()
-{
- return QLatin1String("[Qt Evaluation] ");
-}
-
-QString qt_eval_adapt_window_title(const QString &title)
-{
- if (!qt_eval_is_supported())
- return title;
- return qt_eval_title_prefix() + title;
-}
-
-void qt_eval_init_widget(QWidget *w)
-{
- if (!qt_eval_is_supported())
- return;
- if (w->isTopLevel() && w->windowTitle().isEmpty() && w->windowType() != Qt::Desktop ) {
- w->setWindowTitle(QLatin1String(" "));
- }
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qtestsupport_core.cpp b/src/corelib/kernel/qtestsupport_core.cpp
index c54b933f94..7bd81ed498 100644
--- a/src/corelib/kernel/qtestsupport_core.cpp
+++ b/src/corelib/kernel/qtestsupport_core.cpp
@@ -102,7 +102,7 @@ Q_CORE_EXPORT void QTest::qWait(int ms)
int remaining = ms;
do {
QCoreApplication::processEvents(QEventLoop::AllEvents, remaining);
- QCoreApplication::sendPostedEvents(Q_NULLPTR, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
remaining = timer.remainingTime();
if (remaining <= 0)
break;
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 9d3bd5fdbf..948f697dc5 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -42,6 +42,8 @@
#include "qabstracteventdispatcher.h"
#include "qcoreapplication.h"
#include "qobject_p.h"
+#include "qthread.h"
+#include "qcoreapplication_p.h"
QT_BEGIN_NAMESPACE
@@ -343,6 +345,33 @@ void QTimer::singleShotImpl(int msec, Qt::TimerType timerType,
const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj)
{
+ if (msec == 0) {
+ bool deleteReceiver = false;
+ // Optimize: set a receiver context when none is given, such that we can use
+ // QMetaObject::invokeMethod which is more efficient than going through a timer.
+ // We need a QObject living in the current thread. But the QThread itself lives
+ // in a different thread - with the exception of the main QThread which lives in
+ // itself. And QThread::currentThread() is among the few QObjects we know that will
+ // most certainly be there. Note that one can actually call singleShot before the
+ // QApplication is created!
+ if (!receiver && QThread::currentThread() == QCoreApplicationPrivate::mainThread()) {
+ // reuse main thread as context object
+ receiver = QThread::currentThread();
+ } else if (!receiver) {
+ // Create a receiver context object on-demand. According to the benchmarks,
+ // this is still more efficient than going through a timer.
+ receiver = new QObject;
+ deleteReceiver = true;
+ }
+
+ QMetaObject::invokeMethodImpl(const_cast<QObject *>(receiver), slotObj,
+ Qt::QueuedConnection, nullptr);
+
+ if (deleteReceiver)
+ const_cast<QObject *>(receiver)->deleteLater();
+ return;
+ }
+
new QSingleShotTimer(msec, timerType, receiver, slotObj);
}
@@ -575,8 +604,8 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
\since 5.12
\overload
- Creates a connection from the timeout() signal to \a slot, and returns a
- handle to the connection.
+ Creates a connection of type \a connectionType from the timeout() signal
+ to \a slot, and returns a handle to the connection.
This method is provided for convenience.
It's equivalent to calling \c {QObject::connect(timer, &QTimer::timeout, timer, slot, connectionType)}.
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 336b814b27..eb7185c12d 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -218,7 +218,7 @@ private:
inline int startTimer(int){ return -1;}
inline void killTimer(int){}
- static Q_DECL_CONSTEXPR Qt::TimerType defaultTypeFor(int msecs) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR Qt::TimerType defaultTypeFor(int msecs) noexcept
{ return msecs >= 2000 ? Qt::CoarseTimer : Qt::PreciseTimer; }
static void singleShotImpl(int msec, Qt::TimerType timerType,
const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj);
diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp
index c3b8c86063..39010c19cb 100644
--- a/src/corelib/kernel/qtimerinfo_unix.cpp
+++ b/src/corelib/kernel/qtimerinfo_unix.cpp
@@ -215,7 +215,7 @@ static timespec roundToMillisecond(timespec val)
QDebug operator<<(QDebug s, timeval tv)
{
QDebugStateSaver saver(s);
- s.nospace() << tv.tv_sec << "." << qSetFieldWidth(6) << qSetPadChar(QChar(48)) << tv.tv_usec << reset;
+ s.nospace() << tv.tv_sec << "." << qSetFieldWidth(6) << qSetPadChar(QChar(48)) << tv.tv_usec << Qt::reset;
return s;
}
QDebug operator<<(QDebug s, Qt::TimerType t)
@@ -373,7 +373,7 @@ static void calculateNextTimeout(QTimerInfo *t, timespec currentTime)
#ifdef QTIMERINFO_DEBUG
if (t->timerType != Qt::PreciseTimer)
- qDebug() << "timer" << t->timerType << hex << t->id << dec << "interval" << t->interval
+ qDebug() << "timer" << t->timerType << Qt::hex << t->id << Qt::dec << "interval" << t->interval
<< "originally expected at" << t->expected << "will fire at" << t->timeout
<< "or" << (t->timeout - t->expected) << "s late";
#endif
@@ -500,7 +500,7 @@ void QTimerInfoList::registerTimer(int timerId, int interval, Qt::TimerType time
t->cumulativeError = 0;
t->count = 0;
if (t->timerType != Qt::PreciseTimer)
- qDebug() << "timer" << t->timerType << hex <<t->id << dec << "interval" << t->interval << "expected at"
+ qDebug() << "timer" << t->timerType << Qt::hex <<t->id << Qt::dec << "interval" << t->interval << "expected at"
<< t->expected << "will fire first at" << t->timeout;
#endif
}
@@ -620,7 +620,7 @@ int QTimerInfoList::activateTimers()
currentTimerInfo->cumulativeError += diff;
++currentTimerInfo->count;
if (currentTimerInfo->timerType != Qt::PreciseTimer)
- qDebug() << "timer" << currentTimerInfo->timerType << hex << currentTimerInfo->id << dec << "interval"
+ qDebug() << "timer" << currentTimerInfo->timerType << Qt::hex << currentTimerInfo->id << Qt::dec << "interval"
<< currentTimerInfo->interval << "firing at" << currentTime
<< "(orig" << currentTimerInfo->expected << "scheduled at" << currentTimerInfo->timeout
<< ") off by" << diff << "activation" << currentTimerInfo->count
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 637ef84d21..ddb96ecad6 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -528,7 +528,8 @@ bool QTranslatorPrivate::do_load(const QString &realname, const QString &directo
// memory, so no need to use QFile to copy it again.
Q_ASSERT(!d->resource);
d->resource = new QResource(realname);
- if (resource->isValid() && !resource->isCompressed() && resource->size() >= MagicLength
+ if (resource->isValid() && resource->compressionAlgorithm() == QResource::NoCompression
+ && resource->size() >= MagicLength
&& !memcmp(resource->data(), magic, MagicLength)) {
d->unmapLength = resource->size();
d->unmapPointer = reinterpret_cast<char *>(const_cast<uchar *>(resource->data()));
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 3b7be3d12f..43a3fb1db0 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2018 Intel Corporation.
** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: https://www.qt.io/licensing/
@@ -46,7 +46,9 @@
#include "qdebug.h"
#include "qmap.h"
#include "qdatetime.h"
+#if QT_CONFIG(easingcurve)
#include "qeasingcurve.h"
+#endif
#include "qlist.h"
#if QT_CONFIG(regularexpression)
#include "qregularexpression.h"
@@ -55,6 +57,7 @@
#include "qstringlist.h"
#include "qurl.h"
#include "qlocale.h"
+#include "qregexp.h"
#include "quuid.h"
#if QT_CONFIG(itemmodel)
#include "qabstractitemmodel.h"
@@ -118,19 +121,19 @@ namespace { // annonymous used to hide QVariant handlers
static void construct(QVariant::Private *x, const void *copy)
{
QVariantConstructor<CoreTypesFilter> constructor(x, copy);
- QMetaTypeSwitcher::switcher<void>(constructor, x->type, 0);
+ QMetaTypeSwitcher::switcher<void>(constructor, x->type);
}
static void clear(QVariant::Private *d)
{
QVariantDestructor<CoreTypesFilter> cleaner(d);
- QMetaTypeSwitcher::switcher<void>(cleaner, d->type, 0);
+ QMetaTypeSwitcher::switcher<void>(cleaner, d->type);
}
static bool isNull(const QVariant::Private *d)
{
QVariantIsNull<CoreTypesFilter> isNull(d);
- return QMetaTypeSwitcher::switcher<bool>(isNull, d->type, 0);
+ return QMetaTypeSwitcher::switcher<bool>(isNull, d->type);
}
/*!
@@ -142,7 +145,7 @@ static bool isNull(const QVariant::Private *d)
static bool compare(const QVariant::Private *a, const QVariant::Private *b)
{
QVariantComparator<CoreTypesFilter> comparator(a, b);
- return QMetaTypeSwitcher::switcher<bool>(comparator, a->type, 0);
+ return QMetaTypeSwitcher::switcher<bool>(comparator, a->type);
}
/*!
@@ -1400,7 +1403,7 @@ static void streamDebug(QDebug dbg, const QVariant &v)
{
QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr());
QVariantDebugStream<CoreTypesFilter> stream(dbg, d);
- QMetaTypeSwitcher::switcher<void>(stream, d->type, 0);
+ QMetaTypeSwitcher::switcher<void>(stream, d->type);
}
#endif
@@ -1409,16 +1412,16 @@ const QVariant::Handler qt_kernel_variant_handler = {
clear,
isNull,
#ifndef QT_NO_DATASTREAM
- 0,
- 0,
+ nullptr,
+ nullptr,
#endif
compare,
convert,
- 0,
+ nullptr,
#if !defined(QT_NO_DEBUG_STREAM)
streamDebug
#else
- 0
+ nullptr
#endif
};
@@ -1435,16 +1438,16 @@ const QVariant::Handler qt_dummy_variant_handler = {
dummyClear,
dummyIsNull,
#ifndef QT_NO_DATASTREAM
- 0,
- 0,
+ nullptr,
+ nullptr,
#endif
dummyCompare,
dummyConvert,
- 0,
+ nullptr,
#if !defined(QT_NO_DEBUG_STREAM)
dummyStreamDebug
#else
- 0
+ nullptr
#endif
};
@@ -1462,6 +1465,7 @@ static void customConstruct(QVariant::Private *d, const void *copy)
if (size <= sizeof(QVariant::Private::Data)
&& (type.flags() & (QMetaType::MovableType | QMetaType::IsEnumeration))) {
type.construct(&d->data.ptr, copy);
+ d->is_null = d->data.ptr == nullptr;
d->is_shared = false;
} else {
// Private::Data contains long long, and long double is the biggest standard type.
@@ -1472,6 +1476,7 @@ static void customConstruct(QVariant::Private *d, const void *copy)
void *data = operator new(offset + size);
void *ptr = static_cast<char *>(data) + offset;
type.construct(ptr, copy);
+ d->is_null = ptr == nullptr;
d->is_shared = true;
d->data.shared = new (data) QVariant::PrivateShared(ptr);
}
@@ -1552,16 +1557,16 @@ const QVariant::Handler qt_custom_variant_handler = {
customClear,
customIsNull,
#ifndef QT_NO_DATASTREAM
- 0,
- 0,
+ nullptr,
+ nullptr,
#endif
customCompare,
customConvert,
- 0,
+ nullptr,
#if !defined(QT_NO_DEBUG_STREAM)
customStreamDebug
#else
- 0
+ nullptr
#endif
};
@@ -2122,7 +2127,7 @@ QVariant::QVariant(const char *val)
*/
QVariant::QVariant(Type type)
-{ create(type, 0); }
+{ create(type, nullptr); }
QVariant::QVariant(int typeId, const void *copy)
{ create(typeId, copy); d.is_null = false; }
@@ -2191,7 +2196,7 @@ QVariant::QVariant(const QTime &val)
QVariant::QVariant(const QDateTime &val)
: d(DateTime)
{ v_construct<QDateTime>(&d, val); }
-#ifndef QT_BOOTSTRAPPED
+#if QT_CONFIG(easingcurve)
QVariant::QVariant(const QEasingCurve &val)
: d(EasingCurve)
{ v_construct<QEasingCurve>(&d, val); }
@@ -2363,7 +2368,7 @@ QVariant& QVariant::operator=(const QVariant &variant)
void QVariant::detach()
{
- if (!d.is_shared || d.data.shared->ref.load() == 1)
+ if (!d.is_shared || d.data.shared->ref.loadRelaxed() == 1)
return;
Private dd;
@@ -2468,7 +2473,9 @@ static const ushort mapIdFromQt3ToCurrent[MapFromThreeCount] =
QVariant::Pen,
QVariant::LongLong,
QVariant::ULongLong,
+#if QT_CONFIG(easingcurve)
QVariant::EasingCurve
+#endif
};
/*!
@@ -2664,7 +2671,7 @@ inline T qVariantToHelper(const QVariant::Private &d, const HandlersManager &han
return ret;
}
- handlerManager[d.type]->convert(&d, targetType, &ret, 0);
+ handlerManager[d.type]->convert(&d, targetType, &ret, nullptr);
return ret;
}
@@ -2785,7 +2792,7 @@ QDateTime QVariant::toDateTime() const
\sa canConvert(int targetTypeId), convert()
*/
-#ifndef QT_BOOTSTRAPPED
+#if QT_CONFIG(easingcurve)
QEasingCurve QVariant::toEasingCurve() const
{
return qVariantToHelper<QEasingCurve>(d, handlerManager);
@@ -3214,7 +3221,7 @@ bool QVariant::toBool() const
return d.data.b;
bool res = false;
- handlerManager[d.type]->convert(&d, Bool, &res, 0);
+ handlerManager[d.type]->convert(&d, Bool, &res, nullptr);
return res;
}
@@ -3732,7 +3739,7 @@ bool QVariant::convert(int targetTypeId)
if (!oldValue.canConvert(targetTypeId))
return false;
- create(targetTypeId, 0);
+ create(targetTypeId, nullptr);
// Fail if the value is not initialized or was forced null by a previous failed convert.
if (oldValue.d.is_null && oldValue.d.type != QMetaType::Nullptr)
return false;
@@ -3757,7 +3764,7 @@ bool QVariant::convert(int targetTypeId)
*/
bool QVariant::convert(const int type, void *ptr) const
{
- return handlerManager[type]->convert(&d, type, ptr, 0);
+ return handlerManager[type]->convert(&d, type, ptr, nullptr);
}
@@ -4002,8 +4009,8 @@ static int numericCompare(const QVariant::Private *d1, const QVariant::Private *
return 0;
// only do fuzzy comparisons for finite, non-zero numbers
- int c1 = std::fpclassify(r1);
- int c2 = std::fpclassify(r2);
+ int c1 = qFpClassify(r1);
+ int c2 = qFpClassify(r2);
if ((c1 == FP_NORMAL || c1 == FP_SUBNORMAL) && (c2 == FP_NORMAL || c2 == FP_SUBNORMAL)) {
if (qFuzzyCompare(r1, r2))
return 0;
@@ -4280,6 +4287,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
\sa fromValue()
*/
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
\fn template<typename T> QVariant qVariantFromValue(const T &value)
\relates QVariant
@@ -4317,6 +4325,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
\sa QVariant::setValue()
*/
+#endif
/*!
\fn template<typename T> T qvariant_cast(const QVariant &value)
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index bb9db3d1ad..e7d3d9c835 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -66,7 +66,9 @@ class QBitArray;
class QDataStream;
class QDate;
class QDateTime;
+#if QT_CONFIG(easingcurve)
class QEasingCurve;
+#endif
class QLine;
class QLineF;
class QLocale;
@@ -92,9 +94,6 @@ class QUrl;
class QVariant;
class QVariantComparisonHelper;
-template <typename T>
-inline QVariant qVariantFromValue(const T &);
-
template<typename T>
inline T qvariant_cast(const QVariant &);
@@ -165,7 +164,9 @@ class Q_CORE_EXPORT QVariant
RegExp = QMetaType::QRegExp,
RegularExpression = QMetaType::QRegularExpression,
Hash = QMetaType::QVariantHash,
+#if QT_CONFIG(easingcurve)
EasingCurve = QMetaType::QEasingCurve,
+#endif
Uuid = QMetaType::QUuid,
#if QT_CONFIG(itemmodel)
ModelIndex = QMetaType::QModelIndex,
@@ -204,7 +205,7 @@ class Q_CORE_EXPORT QVariant
LastType = 0xffffffff // need this so that gcc >= 3.4 allocates 32 bits for Type
};
- QVariant() Q_DECL_NOTHROW : d() {}
+ QVariant() noexcept : d() {}
~QVariant();
QVariant(Type type);
QVariant(int typeId, const void *copy);
@@ -257,7 +258,9 @@ class Q_CORE_EXPORT QVariant
#endif // QT_CONFIG(regularexpression)
#ifndef QT_BOOTSTRAPPED
QVariant(const QUrl &url);
+#if QT_CONFIG(easingcurve)
QVariant(const QEasingCurve &easing);
+#endif
QVariant(const QUuid &uuid);
QVariant(const QJsonValue &jsonValue);
QVariant(const QJsonObject &jsonObject);
@@ -270,14 +273,12 @@ class Q_CORE_EXPORT QVariant
#endif
QVariant& operator=(const QVariant &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QVariant(QVariant &&other) Q_DECL_NOTHROW : d(other.d)
+ inline QVariant(QVariant &&other) noexcept : d(other.d)
{ other.d = Private(); }
- inline QVariant &operator=(QVariant &&other) Q_DECL_NOTHROW
+ inline QVariant &operator=(QVariant &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QVariant &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QVariant &other) noexcept { qSwap(d, other.d); }
Type type() const;
int userType() const;
@@ -333,7 +334,9 @@ class Q_CORE_EXPORT QVariant
#endif // QT_CONFIG(regularexpression)
#ifndef QT_BOOTSTRAPPED
QUrl toUrl() const;
+#if QT_CONFIG(easingcurve)
QEasingCurve toEasingCurve() const;
+#endif
QUuid toUuid() const;
QJsonValue toJsonValue() const;
QJsonObject toJsonObject() const;
@@ -365,7 +368,7 @@ class Q_CORE_EXPORT QVariant
template<typename T>
static inline QVariant fromValue(const T &value)
- { return qVariantFromValue(value); }
+ { return QVariant(qMetaTypeId<T>(), &value, QTypeInfo<T>::isPointer); }
#if (QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L) || defined(Q_CLANG_QDOC)
template<typename... Types>
@@ -390,20 +393,20 @@ class Q_CORE_EXPORT QVariant
};
struct Private
{
- inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true)
+ inline Private() noexcept : type(Invalid), is_shared(false), is_null(true)
{ data.ptr = nullptr; }
// Internal constructor for initialized variants.
- explicit inline Private(uint variantType) Q_DECL_NOTHROW
+ explicit inline Private(uint variantType) noexcept
: type(variantType), is_shared(false), is_null(false)
{}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- Private(const Private &other) Q_DECL_NOTHROW
+ Private(const Private &other) noexcept
: data(other.data), type(other.type),
is_shared(other.is_shared), is_null(other.is_null)
{}
- Private &operator=(const Private &other) Q_DECL_NOTHROW = default;
+ Private &operator=(const Private &other) noexcept = default;
#endif
union Data
{
@@ -491,27 +494,27 @@ public:
private:
// force compile error, prevent QVariant(bool) to be called
- inline QVariant(void *) Q_DECL_EQ_DELETE;
+ inline QVariant(void *) = delete;
// QVariant::Type is marked as \obsolete, but we don't want to
// provide a constructor from its intended replacement,
// QMetaType::Type, instead, because the idea behind these
// constructors is flawed in the first place. But we also don't
// want QVariant(QMetaType::String) to compile and falsely be an
// int variant, so delete this constructor:
- QVariant(QMetaType::Type) Q_DECL_EQ_DELETE;
+ QVariant(QMetaType::Type) = delete;
// These constructors don't create QVariants of the type associcated
// with the enum, as expected, but they would create a QVariant of
// type int with the value of the enum value.
// Use QVariant v = QColor(Qt::red) instead of QVariant v = Qt::red for
// example.
- QVariant(Qt::GlobalColor) Q_DECL_EQ_DELETE;
- QVariant(Qt::BrushStyle) Q_DECL_EQ_DELETE;
- QVariant(Qt::PenStyle) Q_DECL_EQ_DELETE;
- QVariant(Qt::CursorShape) Q_DECL_EQ_DELETE;
+ QVariant(Qt::GlobalColor) = delete;
+ QVariant(Qt::BrushStyle) = delete;
+ QVariant(Qt::PenStyle) = delete;
+ QVariant(Qt::CursorShape) = delete;
#ifdef QT_NO_CAST_FROM_ASCII
// force compile error when implicit conversion is not wanted
- inline QVariant(const char *) Q_DECL_EQ_DELETE;
+ inline QVariant(const char *) = delete;
#endif
public:
typedef Private DataPtr;
@@ -519,50 +522,61 @@ public:
inline const DataPtr &data_ptr() const { return d; }
};
+#if QT_DEPRECATED_SINCE(5, 14)
template <typename T>
+QT_DEPRECATED_X("Use QVariant::fromValue() instead.")
inline QVariant qVariantFromValue(const T &t)
{
- return QVariant(qMetaTypeId<T>(), &t, QTypeInfo<T>::isPointer);
+ return QVariant::fromValue(t);
}
-template <>
-inline QVariant qVariantFromValue(const QVariant &t) { return t; }
+template <typename T>
+QT_DEPRECATED_X("Use QVariant::setValue() instead.")
+inline void qVariantSetValue(QVariant &v, const T &t)
+{
+ v.setValue(t);
+}
+#endif
+
+template<>
+inline QVariant QVariant::fromValue(const QVariant &value)
+{
+ return value;
+}
#if QT_HAS_INCLUDE(<variant>) && __cplusplus >= 201703L
-template <>
-inline QVariant qVariantFromValue(const std::monostate &) { return QVariant(); }
+template<>
+inline QVariant QVariant::fromValue(const std::monostate &)
+{
+ return QVariant();
+}
#endif
-template <typename T>
-inline void qVariantSetValue(QVariant &v, const T &t)
+inline bool QVariant::isValid() const { return d.type != Invalid; }
+
+template<typename T>
+inline void QVariant::setValue(const T &avalue)
{
- //if possible we reuse the current QVariant private
+ // If possible we reuse the current QVariant private.
const uint type = qMetaTypeId<T>();
- QVariant::Private &d = v.data_ptr();
- if (v.isDetached() && (type == d.type || (type <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) {
+ if (isDetached() && (type == d.type || (type <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) {
d.type = type;
d.is_null = false;
T *old = reinterpret_cast<T*>(d.is_shared ? d.data.shared->ptr : &d.data.ptr);
if (QTypeInfo<T>::isComplex)
old->~T();
- new (old) T(t); //call the copy constructor
+ new (old) T(avalue); // call the copy constructor
} else {
- v = QVariant(type, &t, QTypeInfo<T>::isPointer);
+ *this = QVariant(type, &avalue, QTypeInfo<T>::isPointer);
}
}
-template <>
-inline void qVariantSetValue<QVariant>(QVariant &v, const QVariant &t)
+template<>
+inline void QVariant::setValue(const QVariant &avalue)
{
- v = t;
+ *this = avalue;
}
-inline bool QVariant::isValid() const { return d.type != Invalid; }
-
-template<typename T>
-inline void QVariant::setValue(const T &avalue)
-{ qVariantSetValue(*this, avalue); }
-
#ifndef QT_NO_DATASTREAM
Q_CORE_EXPORT QDataStream& operator>> (QDataStream& s, QVariant& p);
Q_CORE_EXPORT QDataStream& operator<< (QDataStream& s, const QVariant& p);
@@ -571,7 +585,7 @@ Q_CORE_EXPORT QDataStream& operator<< (QDataStream& s, const QVariant::Type p);
#endif
inline bool QVariant::isDetached() const
-{ return !d.is_shared || d.data.shared->ref.load() == 1; }
+{ return !d.is_shared || d.data.shared->ref.loadRelaxed() == 1; }
#ifdef Q_QDOC
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index b22b7c231e..3d87beac83 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -88,7 +88,7 @@ inline T *v_cast(const QVariant::Private *nd, T * = 0)
#else // every other compiler in this world
template <typename T>
-inline const T *v_cast(const QVariant::Private *d, T * = 0)
+inline const T *v_cast(const QVariant::Private *d, T * = nullptr)
{
return !QVariantIntegrator<T>::CanUseInternalSpace
? static_cast<const T *>(d->data.shared->ptr)
@@ -96,7 +96,7 @@ inline const T *v_cast(const QVariant::Private *d, T * = 0)
}
template <typename T>
-inline T *v_cast(QVariant::Private *d, T * = 0)
+inline T *v_cast(QVariant::Private *d, T * = nullptr)
{
return !QVariantIntegrator<T>::CanUseInternalSpace
? static_cast<T *>(d->data.shared->ptr)
@@ -154,7 +154,7 @@ inline void v_construct(QVariant::Private *x, const T &t)
// constructs a new variant if copy is 0, otherwise copy-constructs
template <class T>
-inline void v_construct(QVariant::Private *x, const void *copy, T * = 0)
+inline void v_construct(QVariant::Private *x, const void *copy, T * = nullptr)
{
if (copy)
v_construct<T>(x, *static_cast<const T *>(copy));
@@ -164,7 +164,7 @@ inline void v_construct(QVariant::Private *x, const void *copy, T * = 0)
// deletes the internal structures
template <class T>
-inline void v_clear(QVariant::Private *d, T* = 0)
+inline void v_clear(QVariant::Private *d, T* = nullptr)
{
if (!QVariantIntegrator<T>::CanUseInternalSpace) {
@@ -264,7 +264,7 @@ class QVariantIsNull
struct No { char unused[2]; };
Q_STATIC_ASSERT(sizeof(Yes) != sizeof(No));
- template<class C> static decltype(static_cast<const C*>(0)->isNull(), Yes()) test(int);
+ template<class C> static decltype(static_cast<const C*>(nullptr)->isNull(), Yes()) test(int);
template<class C> static No test(...);
public:
static const bool Value = (sizeof(test<T>(0)) == sizeof(Yes));
diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp
index 3c73c0b851..d2ae9668fe 100644
--- a/src/corelib/kernel/qwineventnotifier.cpp
+++ b/src/corelib/kernel/qwineventnotifier.cpp
@@ -124,7 +124,7 @@ QWinEventNotifier::QWinEventNotifier(HANDLE hEvent, QObject *parent)
: QObject(*new QWinEventNotifierPrivate(hEvent, false), parent)
{
Q_D(QWinEventNotifier);
- QAbstractEventDispatcher *eventDispatcher = d->threadData->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = d->threadData->eventDispatcher.loadRelaxed();
if (Q_UNLIKELY(!eventDispatcher)) {
qWarning("QWinEventNotifier: Can only be used with threads started with QThread");
return;
@@ -197,7 +197,7 @@ void QWinEventNotifier::setEnabled(bool enable)
return;
d->enabled = enable;
- QAbstractEventDispatcher *eventDispatcher = d->threadData->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = d->threadData->eventDispatcher.loadRelaxed();
if (!eventDispatcher) { // perhaps application is shutting down
if (!enable && d->waitHandle != nullptr)
d->unregisterWaitObject();
@@ -256,7 +256,7 @@ void QWinEventNotifierPrivate::unregisterWaitObject()
static void CALLBACK wfsoCallback(void *context, BOOLEAN /*ignore*/)
{
QWinEventNotifierPrivate *nd = reinterpret_cast<QWinEventNotifierPrivate *>(context);
- QAbstractEventDispatcher *eventDispatcher = nd->threadData->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = nd->threadData->eventDispatcher.loadRelaxed();
// Happens when Q(Core)Application is destroyed before QWinEventNotifier.
// https://bugreports.qt.io/browse/QTBUG-70214
diff --git a/src/corelib/kernel/qwinregistry.cpp b/src/corelib/kernel/qwinregistry.cpp
new file mode 100644
index 0000000000..6566dd3c76
--- /dev/null
+++ b/src/corelib/kernel/qwinregistry.cpp
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwinregistry_p.h"
+
+#include <QtCore/qvarlengtharray.h>
+
+#include <algorithm>
+
+QT_BEGIN_NAMESPACE
+
+QWinRegistryKey::QWinRegistryKey() :
+ m_key(nullptr)
+{
+}
+
+// Open a key with the specified permissions (KEY_READ/KEY_WRITE).
+// "access" is to explicitly use the 32- or 64-bit branch.
+QWinRegistryKey::QWinRegistryKey(HKEY parentHandle, QStringView subKey,
+ REGSAM permissions, REGSAM access)
+{
+ if (RegOpenKeyEx(parentHandle, reinterpret_cast<const wchar_t *>(subKey.utf16()),
+ 0, permissions | access, &m_key) != ERROR_SUCCESS) {
+ m_key = nullptr;
+ }
+}
+
+QWinRegistryKey::~QWinRegistryKey()
+{
+ close();
+}
+
+void QWinRegistryKey::close()
+{
+ if (isValid()) {
+ RegCloseKey(m_key);
+ m_key = nullptr;
+ }
+}
+
+QString QWinRegistryKey::stringValue(QStringView subKey) const
+{
+ QString result;
+ if (!isValid())
+ return result;
+ DWORD type;
+ DWORD size;
+ auto subKeyC = reinterpret_cast<const wchar_t *>(subKey.utf16());
+ if (RegQueryValueEx(m_key, subKeyC, nullptr, &type, nullptr, &size) != ERROR_SUCCESS
+ || (type != REG_SZ && type != REG_EXPAND_SZ) || size <= 2) {
+ return result;
+ }
+ // Reserve more for rare cases where trailing '\0' are missing in registry,
+ // otherwise chop off the '\0' received.
+ QString buffer(int(size / sizeof(wchar_t)), Qt::Uninitialized);
+ if (RegQueryValueEx(m_key, subKeyC, nullptr, &type,
+ reinterpret_cast<LPBYTE>(buffer.data()), &size) == ERROR_SUCCESS) {
+ if (buffer.endsWith(QChar::Null))
+ buffer.chop(1);
+ } else {
+ buffer.clear();
+ }
+ return buffer;
+}
+
+QPair<DWORD, bool> QWinRegistryKey::dwordValue(QStringView subKey) const
+{
+ if (!isValid())
+ return qMakePair(0, false);
+ DWORD type;
+ auto subKeyC = reinterpret_cast<const wchar_t *>(subKey.utf16());
+ if (RegQueryValueEx(m_key, subKeyC, nullptr, &type, nullptr, nullptr) != ERROR_SUCCESS
+ || type != REG_DWORD) {
+ return qMakePair(0, false);
+ }
+ DWORD value = 0;
+ DWORD size = sizeof(value);
+ const bool ok =
+ RegQueryValueEx(m_key, subKeyC, nullptr, nullptr,
+ reinterpret_cast<unsigned char *>(&value), &size) == ERROR_SUCCESS;
+ return qMakePair(value, ok);
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/kernel/qwinregistry_p.h
index 00710199b8..d249a97988 100644
--- a/src/corelib/thread/qmutexpool_p.h
+++ b/src/corelib/kernel/qwinregistry_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QMUTEXPOOL_P_H
-#define QMUTEXPOOL_P_H
+#ifndef QWINREGISTRY_H
+#define QWINREGISTRY_H
//
// W A R N I N G
@@ -51,38 +51,39 @@
// We mean it.
//
-#include <QtCore/private/qglobal_p.h>
-#include "QtCore/qatomic.h"
-#include "QtCore/qmutex.h"
-#include "QtCore/qvarlengtharray.h"
-
-QT_REQUIRE_CONFIG(thread);
+#include <QtCore/qpair.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringview.h>
+#include <QtCore/qt_windows.h>
QT_BEGIN_NAMESPACE
-class Q_CORE_EXPORT QMutexPool
+class Q_CORE_EXPORT QWinRegistryKey
{
public:
- explicit QMutexPool(QMutex::RecursionMode recursionMode = QMutex::NonRecursive, int size = 131);
- ~QMutexPool();
+ Q_DISABLE_COPY(QWinRegistryKey)
+
+ QWinRegistryKey();
+ explicit QWinRegistryKey(HKEY parentHandle, QStringView subKey,
+ REGSAM permissions = KEY_READ, REGSAM access = 0);
+ ~QWinRegistryKey();
+
+ QWinRegistryKey(QWinRegistryKey &&other) noexcept { swap(other); }
+ QWinRegistryKey &operator=(QWinRegistryKey &&other) noexcept { swap(other); return *this; }
+
+ void swap(QWinRegistryKey &other) noexcept { qSwap(m_key, other.m_key); }
+
+ bool isValid() const { return m_key != nullptr; }
+ operator HKEY() const { return m_key; }
+ void close();
- inline QMutex *get(const void *address) {
- int index = uint(quintptr(address)) % mutexes.count();
- QMutex *m = mutexes[index].loadAcquire();
- if (m)
- return m;
- else
- return createMutex(index);
- }
- static QMutexPool *instance();
- static QMutex *globalInstanceGet(const void *address);
+ QString stringValue(QStringView subKey) const;
+ QPair<DWORD, bool> dwordValue(QStringView subKey) const;
private:
- QMutex *createMutex(int index);
- QVarLengthArray<QAtomicPointer<QMutex>, 131> mutexes;
- QMutex::RecursionMode recursionMode;
+ HKEY m_key;
};
QT_END_NAMESPACE
-#endif // QMUTEXPOOL_P_H
+#endif // QWINREGISTRY_H
diff --git a/src/corelib/mimetypes/qmimeglobpattern.cpp b/src/corelib/mimetypes/qmimeglobpattern.cpp
index e353ba10cc..ad78cd9ffa 100644
--- a/src/corelib/mimetypes/qmimeglobpattern.cpp
+++ b/src/corelib/mimetypes/qmimeglobpattern.cpp
@@ -39,7 +39,9 @@
#include "qmimeglobpattern_p.h"
+#if QT_CONFIG(regularexpression)
#include <QRegularExpression>
+#endif
#include <QStringList>
#include <QDebug>
@@ -142,8 +144,12 @@ bool QMimeGlobPattern::matchFileName(const QString &inputFilename) const
return (m_pattern == filename);
// Other (quite rare) patterns, like "*.anim[1-9j]": use slow but correct method
+#if QT_CONFIG(regularexpression)
QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(m_pattern));
return rx.match(filename).hasMatch();
+#else
+ return false;
+#endif
}
static bool isFastPattern(const QString &pattern)
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h
index bb6f64320b..cf27d6ab30 100644
--- a/src/corelib/mimetypes/qmimeglobpattern_p.h
+++ b/src/corelib/mimetypes/qmimeglobpattern_p.h
@@ -88,7 +88,7 @@ public:
{
}
- void swap(QMimeGlobPattern &other) Q_DECL_NOTHROW
+ void swap(QMimeGlobPattern &other) noexcept
{
qSwap(m_pattern, other.m_pattern);
qSwap(m_mimeType, other.m_mimeType);
diff --git a/src/corelib/mimetypes/qmimemagicrule_p.h b/src/corelib/mimetypes/qmimemagicrule_p.h
index 6962a6ca59..5091d483b6 100644
--- a/src/corelib/mimetypes/qmimemagicrule_p.h
+++ b/src/corelib/mimetypes/qmimemagicrule_p.h
@@ -69,7 +69,7 @@ public:
QMimeMagicRule(const QString &typeStr, const QByteArray &value, const QString &offsets,
const QByteArray &mask, QString *errorString);
- void swap(QMimeMagicRule &other) Q_DECL_NOTHROW
+ void swap(QMimeMagicRule &other) noexcept
{
qSwap(m_type, other.m_type);
qSwap(m_value, other.m_value);
diff --git a/src/corelib/mimetypes/qmimemagicrulematcher_p.h b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
index 5e74e2e3fc..fe714987e6 100644
--- a/src/corelib/mimetypes/qmimemagicrulematcher_p.h
+++ b/src/corelib/mimetypes/qmimemagicrulematcher_p.h
@@ -66,7 +66,7 @@ class QMimeMagicRuleMatcher
public:
explicit QMimeMagicRuleMatcher(const QString &mime, unsigned priority = 65535);
- void swap(QMimeMagicRuleMatcher &other) Q_DECL_NOTHROW
+ void swap(QMimeMagicRuleMatcher &other) noexcept
{
qSwap(m_list, other.m_list);
qSwap(m_priority, other.m_priority);
diff --git a/src/corelib/mimetypes/qmimeprovider.cpp b/src/corelib/mimetypes/qmimeprovider.cpp
index 37c8e3b157..a3a6b9615c 100644
--- a/src/corelib/mimetypes/qmimeprovider.cpp
+++ b/src/corelib/mimetypes/qmimeprovider.cpp
@@ -460,6 +460,7 @@ void QMimeBinaryProvider::addAllMimeTypes(QList<QMimeType> &result)
void QMimeBinaryProvider::loadMimeTypePrivate(QMimeTypePrivate &data)
{
#ifdef QT_NO_XMLSTREAMREADER
+ Q_UNUSED(data);
qWarning("Cannot load mime type since QXmlStreamReader is not available.");
return;
#else
@@ -672,7 +673,7 @@ void QMimeXMLProvider::load(const QString &fileName)
{
QString errorMessage;
if (!load(fileName, &errorMessage))
- qWarning("QMimeDatabase: Error loading %s\n%s", qPrintable(fileName), qPrintable(errorMessage));
+ qWarning("QMimeDatabase: Error loading %ls\n%ls", qUtf16Printable(fileName), qUtf16Printable(errorMessage));
}
bool QMimeXMLProvider::load(const QString &fileName, QString *errorMessage)
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 55c7de0c87..de450c68f4 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -192,7 +192,7 @@ bool QMimeType::operator==(const QMimeType &other) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QMimeType &key, uint seed) noexcept
{
return qHash(key.d->name, seed);
}
@@ -253,7 +253,7 @@ QString QMimeType::name() const
*/
QString QMimeType::comment() const
{
- QMimeDatabasePrivate::instance()->loadMimeTypePrivate(*d);
+ QMimeDatabasePrivate::instance()->loadMimeTypePrivate(const_cast<QMimeTypePrivate&>(*d));
QStringList languageList;
languageList << QLocale().name();
@@ -294,7 +294,7 @@ QString QMimeType::comment() const
*/
QString QMimeType::genericIconName() const
{
- QMimeDatabasePrivate::instance()->loadGenericIcon(*d);
+ QMimeDatabasePrivate::instance()->loadGenericIcon(const_cast<QMimeTypePrivate&>(*d));
if (d->genericIconName.isEmpty()) {
// From the spec:
// If the generic icon name is empty (not specified by the mimetype definition)
@@ -311,6 +311,14 @@ QString QMimeType::genericIconName() const
return d->genericIconName;
}
+static QString make_default_icon_name_from_mimetype_name(QString iconName)
+{
+ const int slashindex = iconName.indexOf(QLatin1Char('/'));
+ if (slashindex != -1)
+ iconName[slashindex] = QLatin1Char('-');
+ return iconName;
+}
+
/*!
\property QMimeType::iconName
\brief the file name of an icon image that represents the MIME type
@@ -322,13 +330,9 @@ QString QMimeType::genericIconName() const
*/
QString QMimeType::iconName() const
{
- QMimeDatabasePrivate::instance()->loadIcon(*d);
+ QMimeDatabasePrivate::instance()->loadIcon(const_cast<QMimeTypePrivate&>(*d));
if (d->iconName.isEmpty()) {
- // Make default icon name from the mimetype name
- d->iconName = name();
- const int slashindex = d->iconName.indexOf(QLatin1Char('/'));
- if (slashindex != -1)
- d->iconName[slashindex] = QLatin1Char('-');
+ return make_default_icon_name_from_mimetype_name(name());
}
return d->iconName;
}
@@ -342,7 +346,7 @@ QString QMimeType::iconName() const
*/
QStringList QMimeType::globPatterns() const
{
- QMimeDatabasePrivate::instance()->loadMimeTypePrivate(*d);
+ QMimeDatabasePrivate::instance()->loadMimeTypePrivate(const_cast<QMimeTypePrivate&>(*d));
return d->globPatterns;
}
@@ -437,7 +441,7 @@ QStringList QMimeType::aliases() const
*/
QStringList QMimeType::suffixes() const
{
- QMimeDatabasePrivate::instance()->loadMimeTypePrivate(*d);
+ QMimeDatabasePrivate::instance()->loadMimeTypePrivate(const_cast<QMimeTypePrivate&>(*d));
QStringList result;
for (const QString &pattern : qAsConst(d->globPatterns)) {
@@ -480,7 +484,7 @@ QString QMimeType::preferredSuffix() const
*/
QString QMimeType::filterString() const
{
- QMimeDatabasePrivate::instance()->loadMimeTypePrivate(*d);
+ QMimeDatabasePrivate::instance()->loadMimeTypePrivate(const_cast<QMimeTypePrivate&>(*d));
QString filter;
if (!d->globPatterns.empty()) {
diff --git a/src/corelib/mimetypes/qmimetype.h b/src/corelib/mimetypes/qmimetype.h
index 8287f1434b..df1b60f2ce 100644
--- a/src/corelib/mimetypes/qmimetype.h
+++ b/src/corelib/mimetypes/qmimetype.h
@@ -48,14 +48,14 @@ QT_REQUIRE_CONFIG(mimetype);
#include <QtCore/qobjectdefs.h>
#include <QtCore/qshareddata.h>
#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
class QMimeTypePrivate;
-class QStringList;
class QMimeType;
-Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QMimeType
{
@@ -78,10 +78,8 @@ public:
QMimeType();
QMimeType(const QMimeType &other);
QMimeType &operator=(const QMimeType &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QMimeType &operator=(QMimeType &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
- void swap(QMimeType &other) Q_DECL_NOTHROW
+ QMimeType &operator=(QMimeType &&other) noexcept { swap(other); return *this; }
+ void swap(QMimeType &other) noexcept
{
qSwap(d, other.d);
}
@@ -121,7 +119,7 @@ protected:
friend class QMimeXMLProvider;
friend class QMimeBinaryProvider;
friend class QMimeTypePrivate;
- friend Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QMimeType &key, uint seed) noexcept;
QExplicitlySharedDataPointer<QMimeTypePrivate> d;
};
diff --git a/src/corelib/mimetypes/qmimetype_p.h b/src/corelib/mimetypes/qmimetype_p.h
index 5a36e6613c..0d6b4b4b12 100644
--- a/src/corelib/mimetypes/qmimetype_p.h
+++ b/src/corelib/mimetypes/qmimetype_p.h
@@ -84,26 +84,6 @@ public:
QT_END_NAMESPACE
-#define QMIMETYPE_BUILDER \
- QT_BEGIN_NAMESPACE \
- static QMimeType buildQMimeType ( \
- const QString &name, \
- const QString &genericIconName, \
- const QString &iconName, \
- const QStringList &globPatterns \
- ) \
- { \
- QMimeTypePrivate qMimeTypeData; \
- qMimeTypeData.name = name; \
- qMimeTypeData.loaded = true; \
- qMimeTypeData.genericIconName = genericIconName; \
- qMimeTypeData.iconName = iconName; \
- qMimeTypeData.globPatterns = globPatterns; \
- return QMimeType(qMimeTypeData); \
- } \
- QT_END_NAMESPACE
-
-#ifdef Q_COMPILER_RVALUE_REFS
#define QMIMETYPE_BUILDER_FROM_RVALUE_REFS \
QT_BEGIN_NAMESPACE \
static QMimeType buildQMimeType ( \
@@ -122,6 +102,5 @@ QT_END_NAMESPACE
return QMimeType(qMimeTypeData); \
} \
QT_END_NAMESPACE
-#endif
#endif // QMIMETYPE_P_H
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index d10575cfe9..815e0aa03b 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -194,8 +194,9 @@ static CreateMagicMatchRuleResult createMagicMatchRule(const QXmlStreamAttribute
bool QMimeTypeParserBase::parse(QIODevice *dev, const QString &fileName, QString *errorMessage)
{
#ifdef QT_NO_XMLSTREAMREADER
+ Q_UNUSED(dev);
if (errorMessage)
- *errorMessage = QString::fromLatin1("QXmlStreamReader is not available, cannot parse.");
+ *errorMessage = QString::fromLatin1("QXmlStreamReader is not available, cannot parse '%1'.").arg(fileName);
return false;
#else
QMimeTypePrivate data;
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 35c64180d4..18f10c9b43 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -170,7 +170,7 @@ public:
Q_GLOBAL_STATIC(QList<QFactoryLoader *>, qt_factory_loaders)
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_factoryloader_mutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, qt_factoryloader_mutex)
QFactoryLoaderPrivate::~QFactoryLoaderPrivate()
{
@@ -193,7 +193,11 @@ void QFactoryLoader::update()
continue;
d->loadedPaths << pluginDir;
+#ifdef Q_OS_ANDROID
+ QString path = pluginDir;
+#else
QString path = pluginDir + d->suffix;
+#endif
if (qt_debug_component())
qDebug() << "QFactoryLoader::QFactoryLoader() checking directory path" << path << "...";
@@ -202,8 +206,10 @@ void QFactoryLoader::update()
continue;
QStringList plugins = QDir(path).entryList(
-#ifdef Q_OS_WIN
+#if defined(Q_OS_WIN)
QStringList(QStringLiteral("*.dll")),
+#elif defined(Q_OS_ANDROID)
+ QStringList(QLatin1String("libplugins_%1_*.so").arg(d->suffix)),
#endif
QDir::Files);
QLibraryPrivate *library = 0;
@@ -239,7 +245,7 @@ void QFactoryLoader::update()
library = QLibraryPrivate::findOrCreate(QFileInfo(fileName).canonicalFilePath());
if (!library->isPlugin()) {
if (qt_debug_component()) {
- qDebug() << library->errorString << endl
+ qDebug() << library->errorString << Qt::endl
<< " not a plugin";
}
library->release();
@@ -339,6 +345,10 @@ QFactoryLoader::QFactoryLoader(const char *iid,
#if QT_CONFIG(library)
d->cs = cs;
d->suffix = suffix;
+# ifdef Q_OS_ANDROID
+ if (!d->suffix.isEmpty() && d->suffix.at(0) == QLatin1Char('/'))
+ d->suffix.remove(0, 1);
+# endif
QMutexLocker locker(qt_factoryloader_mutex());
update();
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 0e32776c71..eeaa3c18ec 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
# define QLIBRARY_AS_DEBUG true
#endif
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) || (defined(Q_CC_MINGW) && !QT_CONFIG(debug_and_release))
// We don't use separate debug and release libs on UNIX, so we want
// to allow loading plugins, regardless of how they were built.
# define QT_NO_DEBUG_PLUGIN_CHECK
@@ -241,8 +241,8 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
if (lib)
lib->errorString = file.errorString();
if (qt_debug_component()) {
- qWarning("%s: %s", QFile::encodeName(library).constData(),
- qPrintable(QSystemError::stdString()));
+ qWarning("%s: %ls", QFile::encodeName(library).constData(),
+ qUtf16Printable(QSystemError::stdString()));
}
return false;
}
@@ -275,7 +275,7 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
int r = QElfParser().parse(filedata, fdlen, library, lib, &pos, &fdlen);
if (r == QElfParser::Corrupt || r == QElfParser::NotElf) {
if (lib && qt_debug_component()) {
- qWarning("QElfParser: %s",qPrintable(lib->errorString));
+ qWarning("QElfParser: %ls", qUtf16Printable(lib->errorString));
}
return false;
} else if (r == QElfParser::QtMetaDataSection) {
@@ -292,7 +292,7 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
int r = QMachOParser::parse(filedata, fdlen, library, &errorString, &pos, &fdlen);
if (r == QMachOParser::NotSuitable) {
if (qt_debug_component())
- qWarning("QMachOParser: %s", qPrintable(errorString));
+ qWarning("QMachOParser: %ls", qUtf16Printable(errorString));
if (lib)
lib->errorString = errorString;
return false;
@@ -319,8 +319,8 @@ static bool findPatternUnloaded(const QString &library, QLibraryPrivate *lib)
QString errMsg;
QJsonDocument doc = qJsonFromRawLibraryMetaData(data, fdlen, &errMsg);
if (doc.isNull()) {
- qWarning("Found invalid metadata in lib %s: %s",
- qPrintable(library), qPrintable(errMsg));
+ qWarning("Found invalid metadata in lib %ls: %ls",
+ qUtf16Printable(library), qUtf16Printable(errMsg));
} else {
lib->metaData = doc.object();
if (qt_debug_component())
@@ -356,11 +356,11 @@ static void installCoverageTool(QLibraryPrivate *libPrivate)
if (qt_debug_component()) {
if (ret >= 0) {
- qDebug("coverage data for %s registered",
- qPrintable(libPrivate->fileName));
+ qDebug("coverage data for %ls registered",
+ qUtf16Printable(libPrivate->fileName));
} else {
- qWarning("could not register %s: error %d; coverage data may be incomplete",
- qPrintable(libPrivate->fileName),
+ qWarning("could not register %ls: error %d; coverage data may be incomplete",
+ qUtf16Printable(libPrivate->fileName),
ret);
}
}
@@ -405,10 +405,10 @@ inline void QLibraryStore::cleanup()
LibraryMap::Iterator it = data->libraryMap.begin();
for (; it != data->libraryMap.end(); ++it) {
QLibraryPrivate *lib = it.value();
- if (lib->libraryRefCount.load() == 1) {
- if (lib->libraryUnloadCount.load() > 0) {
+ if (lib->libraryRefCount.loadRelaxed() == 1) {
+ if (lib->libraryUnloadCount.loadRelaxed() > 0) {
Q_ASSERT(lib->pHnd);
- lib->libraryUnloadCount.store(1);
+ lib->libraryUnloadCount.storeRelaxed(1);
#ifdef __GLIBC__
// glibc has a bug in unloading from global destructors
// see https://bugzilla.novell.com/show_bug.cgi?id=622977
@@ -428,7 +428,7 @@ inline void QLibraryStore::cleanup()
for (QLibraryPrivate *lib : qAsConst(data->libraryMap)) {
if (lib)
qDebug() << "On QtCore unload," << lib->fileName << "was leaked, with"
- << lib->libraryRefCount.load() << "users";
+ << lib->libraryRefCount.loadRelaxed() << "users";
}
}
@@ -487,7 +487,7 @@ inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib)
}
// no one else is using
- Q_ASSERT(lib->libraryUnloadCount.load() == 0);
+ Q_ASSERT(lib->libraryUnloadCount.loadRelaxed() == 0);
if (Q_LIKELY(data) && !lib->fileName.isEmpty()) {
QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
@@ -501,7 +501,7 @@ QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString
: pHnd(0), fileName(canonicalFileName), fullVersion(version), instance(0),
libraryRefCount(0), libraryUnloadCount(0), pluginState(MightBeAPlugin)
{
- loadHintsInt.store(loadHints);
+ loadHintsInt.storeRelaxed(loadHints);
if (canonicalFileName.isEmpty())
errorString = QLibrary::tr("The shared library was not found.");
}
@@ -522,7 +522,7 @@ void QLibraryPrivate::mergeLoadHints(QLibrary::LoadHints lh)
if (pHnd)
return;
- loadHintsInt.store(lh);
+ loadHintsInt.storeRelaxed(lh);
}
QFunctionPointer QLibraryPrivate::resolve(const char *symbol)
@@ -575,7 +575,7 @@ bool QLibraryPrivate::unload(UnloadFlag flag)
{
if (!pHnd)
return false;
- if (libraryUnloadCount.load() > 0 && !libraryUnloadCount.deref()) { // only unload if ALL QLibrary instance wanted to
+ if (libraryUnloadCount.loadRelaxed() > 0 && !libraryUnloadCount.deref()) { // only unload if ALL QLibrary instance wanted to
delete inst.data();
if (flag == NoUnloadSys || unload_sys()) {
if (qt_debug_component())
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 3f650501c8..db5afac98e 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -92,11 +92,11 @@ public:
QFunctionPointer resolve(const char *);
QLibrary::LoadHints loadHints() const
- { return QLibrary::LoadHints(loadHintsInt.load()); }
+ { return QLibrary::LoadHints(loadHintsInt.loadRelaxed()); }
void setLoadHints(QLibrary::LoadHints lh);
static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString(),
- QLibrary::LoadHints loadHints = 0);
+ QLibrary::LoadHints loadHints = nullptr);
static QStringList suffixes_sys(const QString &fullVersion);
static QStringList prefixes_sys();
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index e03814984c..f0de1010d7 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -52,6 +52,10 @@
# include <private/qcore_mac_p.h>
#endif
+#ifdef Q_OS_ANDROID
+# include <private/qjnihelpers_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
static QString qdlerror()
@@ -77,14 +81,14 @@ QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
// .so is preferred.
# if defined(__ia64)
if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
+ suffixes << QLatin1String(".so.%1").arg(fullVersion);
} else {
suffixes << QLatin1String(".so");
}
# endif
if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".sl.%1").arg(fullVersion);
- suffixes << QString::fromLatin1(".%1").arg(fullVersion);
+ suffixes << QLatin1String(".sl.%1").arg(fullVersion);
+ suffixes << QLatin1String(".%1").arg(fullVersion);
} else {
suffixes << QLatin1String(".sl");
}
@@ -93,15 +97,18 @@ QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion)
#else
if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".so.%1").arg(fullVersion);
+ suffixes << QLatin1String(".so.%1").arg(fullVersion);
} else {
suffixes << QLatin1String(".so");
+# ifdef Q_OS_ANDROID
+ suffixes << QStringLiteral(LIBS_SUFFIX);
+# endif
}
#endif
# ifdef Q_OS_MAC
if (!fullVersion.isEmpty()) {
- suffixes << QString::fromLatin1(".%1.bundle").arg(fullVersion);
- suffixes << QString::fromLatin1(".%1.dylib").arg(fullVersion);
+ suffixes << QLatin1String(".%1.bundle").arg(fullVersion);
+ suffixes << QLatin1String(".%1.dylib").arg(fullVersion);
} else {
suffixes << QLatin1String(".bundle") << QLatin1String(".dylib");
}
@@ -157,9 +164,12 @@ bool QLibraryPrivate::load_sys()
// Do not unload the library during dlclose(). Consequently, the
// library's specific static variables are not reinitialized if the
// library is reloaded with dlopen() at a later time.
-#if defined(RTLD_NODELETE) && !defined(Q_OS_ANDROID)
+#if defined(RTLD_NODELETE)
if (loadHints & QLibrary::PreventUnloadHint) {
- dlFlags |= RTLD_NODELETE;
+# ifdef Q_OS_ANDROID // RTLD_NODELETE flag is supported by Android 23+
+ if (QtAndroidPrivate::androidSdkVersion() > 22)
+# endif
+ dlFlags |= RTLD_NODELETE;
}
#endif
@@ -219,7 +229,22 @@ bool QLibraryPrivate::load_sys()
} else {
attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix);
}
+
pHnd = dlopen(QFile::encodeName(attempt), dlFlags);
+#ifdef Q_OS_ANDROID
+ if (!pHnd) {
+ auto attemptFromBundle = attempt;
+ pHnd = dlopen(QFile::encodeName(attemptFromBundle.replace(QLatin1Char('/'), QLatin1Char('_'))), dlFlags);
+ }
+ if (pHnd) {
+ using JniOnLoadPtr = jint (*)(JavaVM *vm, void *reserved);
+ JniOnLoadPtr jniOnLoad = reinterpret_cast<JniOnLoadPtr>(dlsym(pHnd, "JNI_OnLoad"));
+ if (jniOnLoad && jniOnLoad(QtAndroidPrivate::javaVM(), nullptr) == JNI_ERR) {
+ dlclose(pHnd);
+ pHnd = nullptr;
+ }
+ }
+#endif
if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) {
// We only want to continue if dlopen failed due to that the shared library did not exist.
diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h
index 676b5047d6..c176155c28 100644
--- a/src/corelib/plugin/qplugin.h
+++ b/src/corelib/plugin/qplugin.h
@@ -75,7 +75,12 @@ typedef QObject *(*QtPluginInstanceFunction)();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
typedef const char *(*QtPluginMetaDataFunction)();
#else
-typedef QPair<const uchar *, size_t> (*QtPluginMetaDataFunction)();
+struct QPluginMetaData
+{
+ const uchar *data;
+ size_t size;
+};
+typedef QPluginMetaData (*QtPluginMetaDataFunction)();
#endif
@@ -84,12 +89,14 @@ struct Q_CORE_EXPORT QStaticPlugin
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
public:
constexpr QStaticPlugin(QtPluginInstanceFunction i, QtPluginMetaDataFunction m)
- : instance(i), rawMetaData(m().first), rawMetaDataSize(m().second)
+ : instance(i), rawMetaData(m().data), rawMetaDataSize(m().size)
+ {}
QtPluginInstanceFunction instance;
private:
// ### Qt 6: revise, as this is not standard-layout
const void *rawMetaData;
- qsizetype rawMetaDataSize
+ qsizetype rawMetaDataSize;
+public:
#elif !defined(Q_QDOC)
// Note: This struct is initialized using an initializer list.
// As such, it cannot have any new constructors or variables.
@@ -154,6 +161,16 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
#if defined(QT_STATICPLUGIN)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
+ static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASSNAME() \
+ Q_PLUGIN_INSTANCE(PLUGINCLASS) \
+ static QPluginMetaData qt_plugin_query_metadata_##PLUGINCLASSNAME() \
+ { return { qt_pluginMetaData, sizeof qt_pluginMetaData }; } \
+ const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##PLUGINCLASSNAME() { \
+ return { qt_plugin_instance_##PLUGINCLASSNAME, qt_plugin_query_metadata_##PLUGINCLASSNAME}; \
+ }
+#else
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##PLUGINCLASSNAME() \
Q_PLUGIN_INSTANCE(PLUGINCLASS) \
@@ -162,13 +179,15 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance_##PLUGINCLASSNAME, qt_plugin_query_metadata_##PLUGINCLASSNAME}; \
return plugin; \
}
+#endif
-#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#else
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
# define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \
Q_EXTERN_C Q_DECL_EXPORT \
- auto qt_plugin_query_metadata() \
- { return qMakePair<const void *, size_t>(qt_pluginMetaData, sizeof qt_pluginMetaData); } \
+ QPluginMetaData qt_plugin_query_metadata() \
+ { return { qt_pluginMetaData, sizeof qt_pluginMetaData }; } \
Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \
Q_PLUGIN_INSTANCE(PLUGINCLASS)
@@ -183,6 +202,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin);
#endif
+#endif
#define Q_EXPORT_PLUGIN(PLUGIN) \
Q_EXPORT_PLUGIN2(PLUGIN, PLUGIN)
diff --git a/src/corelib/plugin/qplugin_p.h b/src/corelib/plugin/qplugin_p.h
index 717129268b..ce45ebf700 100644
--- a/src/corelib/plugin/qplugin_p.h
+++ b/src/corelib/plugin/qplugin_p.h
@@ -60,7 +60,8 @@ enum class QtPluginMetaDataKeys {
Requirements,
IID,
ClassName,
- MetaData
+ MetaData,
+ URI
};
// F(IntKey, StringKey, Description)
@@ -68,7 +69,8 @@ enum class QtPluginMetaDataKeys {
#define QT_PLUGIN_FOREACH_METADATA(F) \
F(QtPluginMetaDataKeys::IID, "IID", "Plugin's Interface ID") \
F(QtPluginMetaDataKeys::ClassName, "className", "Plugin class name") \
- F(QtPluginMetaDataKeys::MetaData, "MetaData", "Other meta data")
+ F(QtPluginMetaDataKeys::MetaData, "MetaData", "Other meta data") \
+ F(QtPluginMetaDataKeys::URI, "URI", "Plugin URI")
QT_END_NAMESPACE
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 4e0c3a511b..c2443dbdda 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -305,12 +305,21 @@ static QString locatePlugin(const QString& fileName)
paths.append(fileName.left(slash)); // don't include the '/'
} else {
paths = QCoreApplication::libraryPaths();
- paths.prepend(QStringLiteral(".")); // search in current dir first
}
for (const QString &path : qAsConst(paths)) {
for (const QString &prefix : qAsConst(prefixes)) {
for (const QString &suffix : qAsConst(suffixes)) {
+#ifdef Q_OS_ANDROID
+ {
+ QString pluginPath = basePath + prefix + baseName + suffix;
+ const QString fn = path + QLatin1String("/lib") + pluginPath.replace(QLatin1Char('/'), QLatin1Char('_'));
+ if (debug)
+ qDebug() << "Trying..." << fn;
+ if (QFileInfo(fn).isFile())
+ return fn;
+ }
+#endif
const QString fn = path + QLatin1Char('/') + basePath + prefix + baseName + suffix;
if (debug)
qDebug() << "Trying..." << fn;
diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 8bb5e1463a..83873edf6f 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -397,7 +397,7 @@ QUuid::QUuid(const QString &text)
\sa toString(), QUuid()
*/
-QUuid QUuid::fromString(QStringView text) Q_DECL_NOTHROW
+QUuid QUuid::fromString(QStringView text) noexcept
{
if (text.size() > MaxStringUuidLength)
text = text.left(MaxStringUuidLength); // text.truncate(MaxStringUuidLength);
@@ -427,7 +427,7 @@ QUuid QUuid::fromString(QStringView text) Q_DECL_NOTHROW
\sa toString(), QUuid()
*/
-QUuid QUuid::fromString(QLatin1String text) Q_DECL_NOTHROW
+QUuid QUuid::fromString(QLatin1String text) noexcept
{
if (Q_UNLIKELY(text.size() < MaxStringUuidLength - 2
|| (text.front() == QLatin1Char('{') && text.size() < MaxStringUuidLength - 1))) {
@@ -864,7 +864,7 @@ QDataStream &operator>>(QDataStream &s, QUuid &id)
Returns \c true if this is the null UUID
{00000000-0000-0000-0000-000000000000}; otherwise returns \c false.
*/
-bool QUuid::isNull() const Q_DECL_NOTHROW
+bool QUuid::isNull() const noexcept
{
return data4[0] == 0 && data4[1] == 0 && data4[2] == 0 && data4[3] == 0 &&
data4[4] == 0 && data4[5] == 0 && data4[6] == 0 && data4[7] == 0 &&
@@ -913,7 +913,7 @@ bool QUuid::isNull() const Q_DECL_NOTHROW
\sa version()
*/
-QUuid::Variant QUuid::variant() const Q_DECL_NOTHROW
+QUuid::Variant QUuid::variant() const noexcept
{
if (isNull())
return VarUnknown;
@@ -934,7 +934,7 @@ QUuid::Variant QUuid::variant() const Q_DECL_NOTHROW
\sa variant()
*/
-QUuid::Version QUuid::version() const Q_DECL_NOTHROW
+QUuid::Version QUuid::version() const noexcept
{
// Check the 4 MSB of data3
Version ver = (Version)(data3>>12);
@@ -957,7 +957,7 @@ QUuid::Version QUuid::version() const Q_DECL_NOTHROW
\sa variant()
*/
-bool QUuid::operator<(const QUuid &other) const Q_DECL_NOTHROW
+bool QUuid::operator<(const QUuid &other) const noexcept
{
if (variant() != other.variant())
return variant() < other.variant();
@@ -984,7 +984,7 @@ bool QUuid::operator<(const QUuid &other) const Q_DECL_NOTHROW
\sa variant()
*/
-bool QUuid::operator>(const QUuid &other) const Q_DECL_NOTHROW
+bool QUuid::operator>(const QUuid &other) const noexcept
{
return other < *this;
}
@@ -1089,7 +1089,7 @@ QDebug operator<<(QDebug dbg, const QUuid &id)
\relates QUuid
Returns a hash of the UUID \a uuid, using \a seed to seed the calculation.
*/
-uint qHash(const QUuid &uuid, uint seed) Q_DECL_NOTHROW
+uint qHash(const QUuid &uuid, uint seed) noexcept
{
return uuid.data1 ^ uuid.data2 ^ (uuid.data3 << 16)
^ ((uuid.data4[0] << 24) | (uuid.data4[1] << 16) | (uuid.data4[2] << 8) | uuid.data4[3])
diff --git a/src/corelib/plugin/quuid.h b/src/corelib/plugin/quuid.h
index 08a1843640..713ca070c8 100644
--- a/src/corelib/plugin/quuid.h
+++ b/src/corelib/plugin/quuid.h
@@ -93,13 +93,13 @@ public:
#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_CLANG_QDOC)
- Q_DECL_CONSTEXPR QUuid() Q_DECL_NOTHROW : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {}
+ Q_DECL_CONSTEXPR QUuid() noexcept : data1(0), data2(0), data3(0), data4{0,0,0,0,0,0,0,0} {}
Q_DECL_CONSTEXPR QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3,
- uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) Q_DECL_NOTHROW
+ uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept
: data1(l), data2(w1), data3(w2), data4{b1, b2, b3, b4, b5, b6, b7, b8} {}
#else
- QUuid() Q_DECL_NOTHROW
+ QUuid() noexcept
{
data1 = 0;
data2 = 0;
@@ -107,7 +107,7 @@ public:
for(int i = 0; i < 8; i++)
data4[i] = 0;
}
- QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) Q_DECL_NOTHROW
+ QUuid(uint l, ushort w1, ushort w2, uchar b1, uchar b2, uchar b3, uchar b4, uchar b5, uchar b6, uchar b7, uchar b8) noexcept
{
data1 = l;
data2 = w1;
@@ -124,8 +124,8 @@ public:
#endif
QUuid(const QString &);
- static QUuid fromString(QStringView string) Q_DECL_NOTHROW;
- static QUuid fromString(QLatin1String string) Q_DECL_NOTHROW;
+ static QUuid fromString(QStringView string) noexcept;
+ static QUuid fromString(QLatin1String string) noexcept;
QUuid(const char *);
QString toString() const;
QString toString(StringFormat mode) const; // ### Qt6: merge with previous
@@ -134,9 +134,9 @@ public:
QByteArray toByteArray(StringFormat mode) const; // ### Qt6: merge with previous
QByteArray toRfc4122() const;
static QUuid fromRfc4122(const QByteArray &);
- bool isNull() const Q_DECL_NOTHROW;
+ bool isNull() const noexcept;
- Q_DECL_RELAXED_CONSTEXPR bool operator==(const QUuid &orig) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator==(const QUuid &orig) const noexcept
{
if (data1 != orig.data1 || data2 != orig.data2 ||
data3 != orig.data3)
@@ -149,24 +149,24 @@ public:
return true;
}
- Q_DECL_RELAXED_CONSTEXPR bool operator!=(const QUuid &orig) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator!=(const QUuid &orig) const noexcept
{
return !(*this == orig);
}
- bool operator<(const QUuid &other) const Q_DECL_NOTHROW;
- bool operator>(const QUuid &other) const Q_DECL_NOTHROW;
+ bool operator<(const QUuid &other) const noexcept;
+ bool operator>(const QUuid &other) const noexcept;
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
// On Windows we have a type GUID that is used by the platform API, so we
// provide convenience operators to cast from and to this type.
#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_CLANG_QDOC)
- Q_DECL_CONSTEXPR QUuid(const GUID &guid) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QUuid(const GUID &guid) noexcept
: data1(guid.Data1), data2(guid.Data2), data3(guid.Data3),
data4{guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]} {}
#else
- QUuid(const GUID &guid) Q_DECL_NOTHROW
+ QUuid(const GUID &guid) noexcept
{
data1 = guid.Data1;
data2 = guid.Data2;
@@ -176,24 +176,24 @@ public:
}
#endif
- Q_DECL_RELAXED_CONSTEXPR QUuid &operator=(const GUID &guid) Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR QUuid &operator=(const GUID &guid) noexcept
{
*this = QUuid(guid);
return *this;
}
- Q_DECL_RELAXED_CONSTEXPR operator GUID() const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR operator GUID() const noexcept
{
GUID guid = { data1, data2, data3, { data4[0], data4[1], data4[2], data4[3], data4[4], data4[5], data4[6], data4[7] } };
return guid;
}
- Q_DECL_RELAXED_CONSTEXPR bool operator==(const GUID &guid) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator==(const GUID &guid) const noexcept
{
return *this == QUuid(guid);
}
- Q_DECL_RELAXED_CONSTEXPR bool operator!=(const GUID &guid) const Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR bool operator!=(const GUID &guid) const noexcept
{
return !(*this == guid);
}
@@ -216,8 +216,8 @@ public:
}
- QUuid::Variant variant() const Q_DECL_NOTHROW;
- QUuid::Version version() const Q_DECL_NOTHROW;
+ QUuid::Variant variant() const noexcept;
+ QUuid::Version version() const noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_CLANG_QDOC)
static QUuid fromCFUUID(CFUUIDRef uuid);
@@ -243,11 +243,11 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QUuid &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QUuid &);
#endif
-Q_CORE_EXPORT uint qHash(const QUuid &uuid, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QUuid &uuid, uint seed = 0) noexcept;
-inline bool operator<=(const QUuid &lhs, const QUuid &rhs) Q_DECL_NOTHROW
+inline bool operator<=(const QUuid &lhs, const QUuid &rhs) noexcept
{ return !(rhs < lhs); }
-inline bool operator>=(const QUuid &lhs, const QUuid &rhs) Q_DECL_NOTHROW
+inline bool operator>=(const QUuid &lhs, const QUuid &rhs) noexcept
{ return !(lhs < rhs); }
QT_END_NAMESPACE
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp
index 288446878c..9053618014 100644
--- a/src/corelib/serialization/qcborvalue.cpp
+++ b/src/corelib/serialization/qcborvalue.cpp
@@ -766,8 +766,8 @@ static void writeDoubleToCbor(QCborStreamWriter &writer, double d, QCborValue::E
if (qt_is_nan(d)) {
if (opt & QCborValue::UseFloat16) {
if ((opt & QCborValue::UseFloat16) == QCborValue::UseFloat16)
- return writer.append(qfloat16(qt_qnan()));
- return writer.append(float(qt_qnan()));
+ return writer.append(std::numeric_limits<qfloat16>::quiet_NaN());
+ return writer.append(std::numeric_limits<float>::quiet_NaN());
}
return writer.append(qt_qnan());
}
@@ -849,7 +849,7 @@ QCborContainerPrivate *QCborContainerPrivate::clone(QCborContainerPrivate *d, qs
QCborContainerPrivate *QCborContainerPrivate::detach(QCborContainerPrivate *d, qsizetype reserved)
{
- if (!d || d->ref.load() != 1)
+ if (!d || d->ref.loadRelaxed() != 1)
return clone(d, reserved);
return d;
}
@@ -884,12 +884,12 @@ void QCborContainerPrivate::replaceAt_complex(Element &e, const QCborValue &valu
// detect self-assignment
if (Q_UNLIKELY(this == value.container)) {
- Q_ASSERT(ref.load() >= 2);
+ Q_ASSERT(ref.loadRelaxed() >= 2);
if (disp == MoveContainer)
ref.deref(); // not deref() because it can't drop to 0
QCborContainerPrivate *d = QCborContainerPrivate::clone(this);
d->elements.detach();
- d->ref.store(1);
+ d->ref.storeRelaxed(1);
e.container = d;
} else {
e.container = value.container;
@@ -915,7 +915,7 @@ void QCborContainerPrivate::replaceAt_complex(Element &e, const QCborValue &valu
// in qstring.cpp
void qt_to_latin1_unchecked(uchar *dst, const ushort *uc, qsizetype len);
-Q_NEVER_INLINE void QCborContainerPrivate::appendAsciiString(const QString &s)
+Q_NEVER_INLINE void QCborContainerPrivate::appendAsciiString(QStringView s)
{
qsizetype len = s.size();
QtCbor::Element e;
@@ -926,7 +926,7 @@ Q_NEVER_INLINE void QCborContainerPrivate::appendAsciiString(const QString &s)
char *ptr = data.data() + e.value + sizeof(ByteData);
uchar *l = reinterpret_cast<uchar *>(ptr);
- const ushort *uc = (const ushort *)s.unicode();
+ const ushort *uc = (const ushort *)s.utf16();
qt_to_latin1_unchecked(l, uc, len);
}
@@ -1368,7 +1368,7 @@ static Element decodeBasicValueFromCbor(QCborStreamReader &reader)
static inline QCborContainerPrivate *createContainerFromCbor(QCborStreamReader &reader)
{
auto d = new QCborContainerPrivate;
- d->ref.store(1);
+ d->ref.storeRelaxed(1);
d->decodeFromCbor(reader);
return d;
}
@@ -1643,20 +1643,30 @@ QCborValue::QCborValue(const QByteArray &ba)
: n(0), container(new QCborContainerPrivate), t(ByteArray)
{
container->appendByteData(ba.constData(), ba.size(), t);
- container->ref.store(1);
+ container->ref.storeRelaxed(1);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Creates a QCborValue with string value \a s. The value can later be
retrieved using toString().
\sa toString(), isString(), isByteArray()
*/
-QCborValue::QCborValue(const QString &s)
+QCborValue::QCborValue(const QString &s) : QCborValue(qToStringViewIgnoringNull(s)) {}
+#endif
+
+/*!
+ Creates a QCborValue with string value \a s. The value can later be
+ retrieved using toString().
+
+ \sa toString(), isString(), isByteArray()
+*/
+QCborValue::QCborValue(QStringView s)
: n(0), container(new QCborContainerPrivate), t(String)
{
container->append(s);
- container->ref.store(1);
+ container->ref.storeRelaxed(1);
}
/*!
@@ -1671,7 +1681,7 @@ QCborValue::QCborValue(QLatin1String s)
: n(0), container(new QCborContainerPrivate), t(String)
{
container->append(s);
- container->ref.store(1);
+ container->ref.storeRelaxed(1);
}
/*!
@@ -1719,7 +1729,7 @@ QCborValue::QCborValue(const QCborMap &m)
QCborValue::QCborValue(QCborTag t, const QCborValue &tv)
: n(-1), container(new QCborContainerPrivate), t(Tag)
{
- container->ref.store(1);
+ container->ref.storeRelaxed(1);
container->append(t);
container->append(tv);
}
@@ -2941,7 +2951,7 @@ static QDebug debugContents(QDebug &dbg, const QCborValue &v)
}
if (v.isSimpleType())
return dbg << v.toSimpleType();
- return dbg << "<unknown type " << hex << int(v.type()) << dec << '>';
+ return dbg << "<unknown type " << Qt::hex << int(v.type()) << Qt::dec << '>';
}
QDebug operator<<(QDebug dbg, const QCborValue &v)
{
diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h
index f542e44c47..f79fc572c4 100644
--- a/src/corelib/serialization/qcborvalue.h
+++ b/src/corelib/serialization/qcborvalue.h
@@ -143,7 +143,10 @@ public:
QCborValue(QCborSimpleType st) : t(type_helper(st)) {}
QCborValue(const QByteArray &ba);
+#if QT_STRINGVIEW_LEVEL < 2
QCborValue(const QString &s);
+#endif
+ QCborValue(QStringView s);
QCborValue(QLatin1String s);
#ifndef QT_NO_CAST_FROM_ASCII
QT_ASCII_CAST_WARN QCborValue(const char *s) : QCborValue(QString::fromUtf8(s)) {}
diff --git a/src/corelib/serialization/qcborvalue_p.h b/src/corelib/serialization/qcborvalue_p.h
index 4050d18fa9..590c2d6e05 100644
--- a/src/corelib/serialization/qcborvalue_p.h
+++ b/src/corelib/serialization/qcborvalue_p.h
@@ -245,13 +245,21 @@ public:
appendByteData(s.latin1(), s.size(), QCborValue::String,
QtCbor::Element::StringIsAscii);
}
- void appendAsciiString(const QString &s);
+ void appendAsciiString(QStringView s);
+
+#if QT_STRINGVIEW_LEVEL < 2
void append(const QString &s)
{
+ append(qToStringViewIgnoringNull(s));
+ }
+#endif
+
+ void append(QStringView s)
+ {
if (QtPrivate::isAscii(s))
appendAsciiString(s);
else
- appendByteData(reinterpret_cast<const char *>(s.constData()), s.size() * 2,
+ appendByteData(reinterpret_cast<const char *>(s.utf16()), s.size() * 2,
QCborValue::String, QtCbor::Element::StringIsUtf16);
}
void append(const QCborValue &v)
@@ -345,33 +353,41 @@ public:
return e;
}
- bool stringEqualsElement(qsizetype idx, QLatin1String s) const
+ static int compareUtf8(const QtCbor::ByteData *b, const QLatin1String &s)
{
- const auto &e = elements.at(idx);
- if (e.type != QCborValue::String)
- return false;
-
- const QtCbor::ByteData *b = byteData(idx);
- if (!b)
- return s.isEmpty();
+ return QUtf8::compareUtf8(b->byte(), b->len, s);
+ }
- if (e.flags & QtCbor::Element::StringIsUtf16)
- return QtPrivate::compareStrings(b->asStringView(), s) == 0;
- return QUtf8::compareUtf8(b->byte(), b->len, s) == 0;
+ static int compareUtf8(const QtCbor::ByteData *b, QStringView s)
+ {
+ return QUtf8::compareUtf8(b->byte(), b->len, s.data(), s.size());
}
- bool stringEqualsElement(qsizetype idx, const QString &s) const
+
+ template<typename String>
+ int stringCompareElement(const QtCbor::Element &e, String s) const
{
- const auto &e = elements.at(idx);
if (e.type != QCborValue::String)
- return false;
+ return int(e.type) - int(QCborValue::String);
- const QtCbor::ByteData *b = byteData(idx);
+ const QtCbor::ByteData *b = byteData(e);
if (!b)
- return s.isEmpty();
+ return s.isEmpty() ? 0 : -1;
if (e.flags & QtCbor::Element::StringIsUtf16)
- return QtPrivate::compareStrings(b->asStringView(), s) == 0;
- return QUtf8::compareUtf8(b->byte(), b->len, s.data(), s.size()) == 0;
+ return QtPrivate::compareStrings(b->asStringView(), s);
+ return compareUtf8(b, s);
+ }
+
+ template<typename String>
+ bool stringEqualsElement(const QtCbor::Element &e, String s) const
+ {
+ return stringCompareElement(e, s) == 0;
+ }
+
+ template<typename String>
+ bool stringEqualsElement(qsizetype idx, String s) const
+ {
+ return stringEqualsElement(elements.at(idx), s);
}
static int compareElement_helper(const QCborContainerPrivate *c1, QtCbor::Element e1,
diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp
index 02c1d1c573..b3330d6cea 100644
--- a/src/corelib/serialization/qdatastream.cpp
+++ b/src/corelib/serialization/qdatastream.cpp
@@ -98,6 +98,10 @@ QT_BEGIN_NAMESPACE
ensures that you get integers of the size you want and insulates
you from compiler and platform differences.
+ Enumerations can be serialized through QDataStream without the
+ need of manually defining streaming operators. Enum classes are
+ serialized using the declared size.
+
To take one example, a \c{char *} string is written as a 32-bit
integer equal to the length of the string including the '\\0' byte,
followed by all the characters of the string including the
@@ -273,7 +277,7 @@ QT_BEGIN_NAMESPACE
QDataStream::QDataStream()
{
- dev = 0;
+ dev = nullptr;
owndev = false;
byteorder = BigEndian;
ver = Qt_DefaultCompiledVersion;
@@ -429,7 +433,7 @@ bool QDataStream::atEnd() const
*/
QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const
{
- return d == 0 ? QDataStream::DoublePrecision : d->floatingPointPrecision;
+ return d ? d->floatingPointPrecision : QDataStream::DoublePrecision;
}
/*!
@@ -454,7 +458,7 @@ QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const
*/
void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision precision)
{
- if (d == 0)
+ if (!d)
d.reset(new QDataStreamPrivate());
d->floatingPointPrecision = precision;
}
@@ -561,6 +565,7 @@ void QDataStream::setByteOrder(ByteOrder bo)
\value Qt_5_11 Same as Qt_5_6
\value Qt_5_12 Version 18 (Qt 5.12)
\value Qt_5_13 Version 19 (Qt 5.13)
+ \value Qt_5_14 Same as Qt_5_13
\omitvalue Qt_DefaultCompiledVersion
\sa setVersion(), version()
@@ -634,7 +639,7 @@ void QDataStream::startTransaction()
{
CHECK_STREAM_PRECOND(Q_VOID)
- if (d == 0)
+ if (!d)
d.reset(new QDataStreamPrivate());
if (++d->transactionDepth == 1) {
@@ -1038,7 +1043,7 @@ QDataStream &QDataStream::operator>>(char *&s)
QDataStream &QDataStream::readBytes(char *&s, uint &l)
{
- s = 0;
+ s = nullptr;
l = 0;
CHECK_STREAM_PRECOND(*this)
@@ -1049,8 +1054,8 @@ QDataStream &QDataStream::readBytes(char *&s, uint &l)
const quint32 Step = 1024 * 1024;
quint32 allocated = 0;
- char *prevBuf = 0;
- char *curBuf = 0;
+ char *prevBuf = nullptr;
+ char *curBuf = nullptr;
do {
int blockSize = qMin(Step, len - allocated);
diff --git a/src/corelib/serialization/qdatastream.h b/src/corelib/serialization/qdatastream.h
index 81134f74b0..cfcd89333b 100644
--- a/src/corelib/serialization/qdatastream.h
+++ b/src/corelib/serialization/qdatastream.h
@@ -55,7 +55,6 @@ class QByteArray;
class QIODevice;
template <typename T> class QList;
-template <typename T> class QLinkedList;
template <typename T> class QVector;
template <typename T> class QSet;
template <class Key, class T> class QHash;
@@ -100,10 +99,19 @@ public:
Qt_5_11 = Qt_5_10,
Qt_5_12 = 18,
Qt_5_13 = 19,
-#if QT_VERSION >= 0x050e00
+ Qt_5_14 = Qt_5_13,
+#if QT_VERSION >= 0x050f00
+ Qt_5_15 = Qt_5_14,
+ Qt_DefaultCompiledVersion = Qt_5_15
+#elif QT_VERSION >= 0x060000
+ Qt_6_0 = Qt_5_15,
+ Qt_DefaultCompiledVersion = Qt_6_0
+#else
+ Qt_DefaultCompiledVersion = Qt_5_14
+#endif
+#if QT_VERSION >= 0x060100
#error Add the datastream version for this Qt version and update Qt_DefaultCompiledVersion
#endif
- Qt_DefaultCompiledVersion = Qt_5_13
};
enum ByteOrder {
@@ -377,25 +385,23 @@ inline QDataStream &operator>>(QDataStream &s, QFlags<Enum> &e)
{ return s >> e.i; }
template <typename T>
-inline QDataStream &operator>>(QDataStream &s, QList<T> &l)
-{
- return QtPrivate::readArrayBasedContainer(s, l);
-}
+typename std::enable_if<std::is_enum<T>::value, QDataStream &>::type&
+operator<<(QDataStream &s, const T &t)
+{ return s << static_cast<typename std::underlying_type<T>::type>(t); }
template <typename T>
-inline QDataStream &operator<<(QDataStream &s, const QList<T> &l)
-{
- return QtPrivate::writeSequentialContainer(s, l);
-}
+typename std::enable_if<std::is_enum<T>::value, QDataStream &>::type&
+operator>>(QDataStream &s, T &t)
+{ return s >> reinterpret_cast<typename std::underlying_type<T>::type &>(t); }
template <typename T>
-inline QDataStream &operator>>(QDataStream &s, QLinkedList<T> &l)
+inline QDataStream &operator>>(QDataStream &s, QList<T> &l)
{
- return QtPrivate::readListBasedContainer(s, l);
+ return QtPrivate::readArrayBasedContainer(s, l);
}
template <typename T>
-inline QDataStream &operator<<(QDataStream &s, const QLinkedList<T> &l)
+inline QDataStream &operator<<(QDataStream &s, const QList<T> &l)
{
return QtPrivate::writeSequentialContainer(s, l);
}
diff --git a/src/corelib/serialization/qjson.cpp b/src/corelib/serialization/qjson.cpp
index d74ffb2a20..76f1eae1ce 100644
--- a/src/corelib/serialization/qjson.cpp
+++ b/src/corelib/serialization/qjson.cpp
@@ -175,7 +175,7 @@ void Base::removeItems(int pos, int numItems)
length -= numItems;
}
-int Object::indexOf(const QString &key, bool *exists) const
+int Object::indexOf(QStringView key, bool *exists) const
{
int min = 0;
int n = length;
@@ -257,7 +257,7 @@ bool Array::isValid(int maxSize) const
}
-bool Entry::operator ==(const QString &key) const
+bool Entry::operator ==(QStringView key) const
{
if (value.latinKey)
return (shallowLatin1Key() == key);
@@ -270,7 +270,7 @@ bool Entry::operator==(QLatin1String key) const
if (value.latinKey)
return shallowLatin1Key() == key;
else
- return shallowKey() == key;
+ return shallowKey() == QString(key); // ### conversion to QString
}
bool Entry::operator ==(const Entry &other) const
diff --git a/src/corelib/serialization/qjson_p.h b/src/corelib/serialization/qjson_p.h
index ff010cb902..7978bed7da 100644
--- a/src/corelib/serialization/qjson_p.h
+++ b/src/corelib/serialization/qjson_p.h
@@ -66,11 +66,13 @@
#include <limits.h>
#include <limits>
+#include <type_traits>
QT_BEGIN_NAMESPACE
// in qstring.cpp
void qt_to_latin1_unchecked(uchar *dst, const ushort *uc, qsizetype len);
+void qt_from_latin1(ushort *dst, const char *str, size_t size) noexcept;
/*
This defines a binary data structure for Json data. The data structure is optimised for fast reading
@@ -153,16 +155,24 @@ typedef qle_uint offset;
// round the size up to the next 4 byte boundary
inline int alignedSize(int size) { return (size + 3) & ~3; }
-static inline bool useCompressed(const QString &s)
+const int MaxLatin1Length = 0x7fff;
+
+static inline bool useCompressed(QStringView s)
{
- if (s.length() >= 0x8000)
+ if (s.length() > MaxLatin1Length)
return false;
return QtPrivate::isLatin1(s);
}
-static inline int qStringSize(const QString &string, bool compress)
+static inline bool useCompressed(QLatin1String s)
+{
+ return s.size() <= MaxLatin1Length;
+}
+
+template <typename T>
+static inline int qStringSize(T string, bool compress)
{
- int l = 2 + string.length();
+ int l = 2 + string.size();
if (!compress)
l *= 2;
return alignedSize(l);
@@ -214,39 +224,49 @@ public:
return maxSize >= 0 && uint(d->length) <= maxSize / sizeof(ushort);
}
- inline String &operator=(const QString &str)
+ inline String &operator=(QStringView str)
{
d->length = str.length();
+ qToLittleEndian<quint16>(str.utf16(), str.length(), d->utf16);
+ fillTrailingZeros();
+ return *this;
+ }
+
+ inline String &operator=(QLatin1String str)
+ {
+ d->length = str.size();
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- const ushort *uc = (const ushort *)str.unicode();
- for (int i = 0; i < str.length(); ++i)
- d->utf16[i] = uc[i];
+ for (int i = 0; i < str.size(); ++i)
+ d->utf16[i] = str[i].unicode();
#else
- memcpy(static_cast<void *>(d->utf16),
- static_cast<const void *>(str.unicode()),
- str.length()*sizeof(ushort));
+ qt_from_latin1((ushort *)d->utf16, str.data(), str.size());
#endif
- if (str.length() & 1)
- d->utf16[str.length()] = 0;
+ fillTrailingZeros();
return *this;
}
- inline bool operator ==(const QString &str) const {
+ void fillTrailingZeros()
+ {
+ if (d->length & 1)
+ d->utf16[d->length] = 0;
+ }
+
+ inline bool operator ==(QStringView str) const {
int slen = str.length();
int l = d->length;
if (slen != l)
return false;
- const ushort *s = (const ushort *)str.constData();
+ const ushort *s = (const ushort *)str.utf16();
const qle_ushort *a = d->utf16;
const ushort *b = s;
while (l-- && *a == *b)
a++,b++;
return (l == -1);
}
- inline bool operator !=(const QString &str) const {
+ inline bool operator !=(QStringView str) const {
return !operator ==(str);
}
- inline bool operator >=(const QString &str) const {
+ inline bool operator >=(QStringView str) const {
// ###
return toString() >= str;
}
@@ -294,19 +314,35 @@ public:
return byteSize() <= maxSize;
}
- inline Latin1String &operator=(const QString &str)
+ inline Latin1String &operator=(QStringView str)
{
int len = d->length = str.length();
uchar *l = (uchar *)d->latin1;
- const ushort *uc = (const ushort *)str.unicode();
+ const ushort *uc = (const ushort *)str.utf16();
qt_to_latin1_unchecked(l, uc, len);
- for ( ; (quintptr)(l+len) & 0x3; ++len)
- l[len] = 0;
+ fillTrailingZeros();
return *this;
}
- QLatin1String toQLatin1String() const Q_DECL_NOTHROW {
+ inline Latin1String &operator=(QLatin1String str)
+ {
+ int len = d->length = str.size();
+ uchar *l = (uchar *)d->latin1;
+ memcpy(l, str.data(), len);
+
+ fillTrailingZeros();
+ return *this;
+ }
+
+ void fillTrailingZeros()
+ {
+ uchar *l = (uchar *)d->latin1;
+ for (int len = d->length; (quintptr)(l + len) & 0x3; ++len)
+ l[len] = 0;
+ }
+
+ QLatin1String toQLatin1String() const noexcept {
return QLatin1String(d->latin1, d->length);
}
@@ -341,23 +377,23 @@ public:
};
#define DEF_OP(op) \
- inline bool operator op(Latin1String lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(Latin1String lhs, Latin1String rhs) noexcept \
{ \
return lhs.toQLatin1String() op rhs.toQLatin1String(); \
} \
- inline bool operator op(QLatin1String lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(QLatin1String lhs, Latin1String rhs) noexcept \
{ \
return lhs op rhs.toQLatin1String(); \
} \
- inline bool operator op(Latin1String lhs, QLatin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(Latin1String lhs, QLatin1String rhs) noexcept \
{ \
return lhs.toQLatin1String() op rhs; \
} \
- inline bool operator op(const QString &lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ inline bool operator op(QStringView lhs, Latin1String rhs) noexcept \
{ \
return lhs op rhs.toQLatin1String(); \
} \
- inline bool operator op(Latin1String lhs, const QString &rhs) Q_DECL_NOTHROW \
+ inline bool operator op(Latin1String lhs, QStringView rhs) noexcept \
{ \
return lhs.toQLatin1String() op rhs; \
} \
@@ -421,7 +457,8 @@ inline bool String::operator<(const Latin1String &str) const
}
-static inline void copyString(char *dest, const QString &str, bool compress)
+template <typename T>
+static inline void copyString(char *dest, T str, bool compress)
{
if (compress) {
Latin1String string(dest);
@@ -471,7 +508,7 @@ public:
Entry *entryAt(int i) const {
return reinterpret_cast<Entry *>(((char *)this) + table()[i]);
}
- int indexOf(const QString &key, bool *exists) const;
+ int indexOf(QStringView key, bool *exists) const;
int indexOf(QLatin1String key, bool *exists) const;
bool isValid(int maxSize) const;
@@ -579,9 +616,9 @@ public:
return shallowKey().isValid(maxSize);
}
- bool operator ==(const QString &key) const;
- inline bool operator !=(const QString &key) const { return !operator ==(key); }
- inline bool operator >=(const QString &key) const;
+ bool operator ==(QStringView key) const;
+ inline bool operator !=(QStringView key) const { return !operator ==(key); }
+ inline bool operator >=(QStringView key) const;
bool operator==(QLatin1String key) const;
inline bool operator!=(QLatin1String key) const { return !operator ==(key); }
@@ -591,7 +628,7 @@ public:
bool operator >=(const Entry &other) const;
};
-inline bool Entry::operator >=(const QString &key) const
+inline bool Entry::operator >=(QStringView key) const
{
if (value.latinKey)
return (shallowLatin1Key() >= key);
@@ -604,10 +641,10 @@ inline bool Entry::operator >=(QLatin1String key) const
if (value.latinKey)
return shallowLatin1Key() >= key;
else
- return shallowKey() >= key;
+ return shallowKey() >= QString(key); // ### conversion to QString
}
-inline bool operator <(const QString &key, const Entry &e)
+inline bool operator <(QStringView key, const Entry &e)
{ return e >= key; }
inline bool operator<(QLatin1String key, const Entry &e)
@@ -688,7 +725,7 @@ public:
{
}
inline Data(int reserved, QJsonValue::Type valueType)
- : rawData(0), compactionCounter(0), ownsData(true)
+ : rawData(nullptr), compactionCounter(0), ownsData(true)
{
Q_ASSERT(valueType == QJsonValue::Array || valueType == QJsonValue::Object);
@@ -721,7 +758,7 @@ public:
Data *clone(Base *b, int reserve = 0)
{
int size = sizeof(Header) + b->size;
- if (b == header->root() && ref.load() == 1 && alloc >= size + reserve)
+ if (b == header->root() && ref.loadRelaxed() == 1 && alloc >= size + reserve)
return this;
if (reserve) {
@@ -730,7 +767,7 @@ public:
size = qMax(size + reserve, qMin(size *2, (int)Value::MaxSize));
if (size > Value::MaxSize) {
qWarning("QJson: Document too large to store in data structure");
- return 0;
+ return nullptr;
}
}
char *raw = (char *)malloc(size);
diff --git a/src/corelib/serialization/qjsonarray.cpp b/src/corelib/serialization/qjsonarray.cpp
index f5f02b886a..9636ac5856 100644
--- a/src/corelib/serialization/qjsonarray.cpp
+++ b/src/corelib/serialization/qjsonarray.cpp
@@ -132,7 +132,7 @@ QT_BEGIN_NAMESPACE
Creates an empty array.
*/
QJsonArray::QJsonArray()
- : d(0), a(0)
+ : d(nullptr), a(nullptr)
{
}
@@ -168,8 +168,8 @@ QJsonArray::QJsonArray(QJsonPrivate::Data *data, QJsonPrivate::Array *array)
*/
void QJsonArray::initialize()
{
- d = 0;
- a = 0;
+ d = nullptr;
+ a = nullptr;
}
/*!
@@ -1226,7 +1226,7 @@ bool QJsonArray::detach2(uint reserve)
d->ref.ref();
return true;
}
- if (reserve == 0 && d->ref.load() == 1)
+ if (reserve == 0 && d->ref.loadRelaxed() == 1)
return true;
QJsonPrivate::Data *x = d->clone(a, reserve);
diff --git a/src/corelib/serialization/qjsonarray.h b/src/corelib/serialization/qjsonarray.h
index ba346fb848..983a6753b5 100644
--- a/src/corelib/serialization/qjsonarray.h
+++ b/src/corelib/serialization/qjsonarray.h
@@ -42,9 +42,7 @@
#include <QtCore/qjsonvalue.h>
#include <QtCore/qiterator.h>
-#if defined(Q_COMPILER_INITIALIZER_LISTS)
#include <initializer_list>
-#endif
QT_BEGIN_NAMESPACE
@@ -58,21 +56,19 @@ class Q_CORE_EXPORT QJsonArray
public:
QJsonArray();
-#if defined(Q_COMPILER_INITIALIZER_LISTS) || defined(Q_QDOC)
QJsonArray(std::initializer_list<QJsonValue> args)
{
initialize();
for (std::initializer_list<QJsonValue>::const_iterator i = args.begin(); i != args.end(); ++i)
append(*i);
}
-#endif
~QJsonArray();
QJsonArray(const QJsonArray &other);
QJsonArray &operator =(const QJsonArray &other);
- QJsonArray(QJsonArray &&other) Q_DECL_NOTHROW
+ QJsonArray(QJsonArray &&other) noexcept
: d(other.d),
a(other.a)
{
@@ -80,7 +76,7 @@ public:
other.a = nullptr;
}
- QJsonArray &operator =(QJsonArray &&other) Q_DECL_NOTHROW
+ QJsonArray &operator =(QJsonArray &&other) noexcept
{
swap(other);
return *this;
@@ -115,7 +111,7 @@ public:
bool operator==(const QJsonArray &other) const;
bool operator!=(const QJsonArray &other) const;
- void swap(QJsonArray &other) Q_DECL_NOTHROW
+ void swap(QJsonArray &other) noexcept
{
qSwap(d, other.d);
qSwap(a, other.a);
diff --git a/src/corelib/serialization/qjsondocument.cpp b/src/corelib/serialization/qjsondocument.cpp
index ed7c3f21f1..8c3818caff 100644
--- a/src/corelib/serialization/qjsondocument.cpp
+++ b/src/corelib/serialization/qjsondocument.cpp
@@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE
* Constructs an empty and invalid document.
*/
QJsonDocument::QJsonDocument()
- : d(0)
+ : d(nullptr)
{
}
@@ -92,7 +92,7 @@ QJsonDocument::QJsonDocument()
* Creates a QJsonDocument from \a object.
*/
QJsonDocument::QJsonDocument(const QJsonObject &object)
- : d(0)
+ : d(nullptr)
{
setObject(object);
}
@@ -101,7 +101,7 @@ QJsonDocument::QJsonDocument(const QJsonObject &object)
* Constructs a QJsonDocument from \a array.
*/
QJsonDocument::QJsonDocument(const QJsonArray &array)
- : d(0)
+ : d(nullptr)
{
setArray(array);
}
@@ -236,7 +236,7 @@ const char *QJsonDocument::rawData(int *size) const
{
if (!d) {
*size = 0;
- return 0;
+ return nullptr;
}
*size = d->alloc;
return d->rawData;
@@ -544,6 +544,7 @@ void QJsonDocument::setArray(const QJsonArray &array)
d->ref.ref();
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a QJsonValue representing the value for the key \a key.
@@ -558,6 +559,16 @@ void QJsonDocument::setArray(const QJsonArray &array)
*/
const QJsonValue QJsonDocument::operator[](const QString &key) const
{
+ return (*this)[QStringView(key)];
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+const QJsonValue QJsonDocument::operator[](QStringView key) const
+{
if (!isObject())
return QJsonValue(QJsonValue::Undefined);
@@ -635,7 +646,7 @@ bool QJsonDocument::operator==(const QJsonDocument &other) const
*/
bool QJsonDocument::isNull() const
{
- return (d == 0);
+ return (d == nullptr);
}
#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY)
diff --git a/src/corelib/serialization/qjsondocument.h b/src/corelib/serialization/qjsondocument.h
index a749439b7d..a8e7485f5d 100644
--- a/src/corelib/serialization/qjsondocument.h
+++ b/src/corelib/serialization/qjsondocument.h
@@ -93,19 +93,19 @@ public:
QJsonDocument(const QJsonDocument &other);
QJsonDocument &operator =(const QJsonDocument &other);
- QJsonDocument(QJsonDocument &&other) Q_DECL_NOTHROW
+ QJsonDocument(QJsonDocument &&other) noexcept
: d(other.d)
{
other.d = nullptr;
}
- QJsonDocument &operator =(QJsonDocument &&other) Q_DECL_NOTHROW
+ QJsonDocument &operator =(QJsonDocument &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QJsonDocument &other) Q_DECL_NOTHROW
+ void swap(QJsonDocument &other) noexcept
{
qSwap(d, other.d);
}
@@ -146,7 +146,10 @@ public:
void setObject(const QJsonObject &object);
void setArray(const QJsonArray &array);
+#if QT_STRINGVIEW_LEVEL < 2
const QJsonValue operator[](const QString &key) const;
+#endif
+ const QJsonValue operator[](QStringView key) const;
const QJsonValue operator[](QLatin1String key) const;
const QJsonValue operator[](int i) const;
diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp
index a9f25a119c..329bc4d2c9 100644
--- a/src/corelib/serialization/qjsonobject.cpp
+++ b/src/corelib/serialization/qjsonobject.cpp
@@ -110,7 +110,7 @@ QT_BEGIN_NAMESPACE
\sa isEmpty()
*/
QJsonObject::QJsonObject()
- : d(0), o(0)
+ : d(nullptr), o(nullptr)
{
}
@@ -149,8 +149,8 @@ QJsonObject::QJsonObject(QJsonPrivate::Data *data, QJsonPrivate::Object *object)
void QJsonObject::initialize()
{
- d = 0;
- o = 0;
+ d = nullptr;
+ o = nullptr;
}
/*!
@@ -377,6 +377,7 @@ bool QJsonObject::isEmpty() const
return !o->length;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a QJsonValue representing the value for the key \a key.
@@ -386,14 +387,17 @@ bool QJsonObject::isEmpty() const
*/
QJsonValue QJsonObject::value(const QString &key) const
{
- if (!d)
- return QJsonValue(QJsonValue::Undefined);
+ return value(QStringView(key));
+}
+#endif
- bool keyExists;
- int i = o->indexOf(key, &keyExists);
- if (!keyExists)
- return QJsonValue(QJsonValue::Undefined);
- return QJsonValue(d, o, o->entryAt(i)->value);
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonValue QJsonObject::value(QStringView key) const
+{
+ return valueImpl(key);
}
/*!
@@ -402,6 +406,15 @@ QJsonValue QJsonObject::value(const QString &key) const
*/
QJsonValue QJsonObject::value(QLatin1String key) const
{
+ return valueImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+QJsonValue QJsonObject::valueImpl(T key) const
+{
if (!d)
return QJsonValue(QJsonValue::Undefined);
@@ -412,6 +425,7 @@ QJsonValue QJsonObject::value(QLatin1String key) const
return QJsonValue(d, o, o->entryAt(i)->value);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a QJsonValue representing the value for the key \a key.
@@ -423,8 +437,16 @@ QJsonValue QJsonObject::value(QLatin1String key) const
*/
QJsonValue QJsonObject::operator [](const QString &key) const
{
- return value(key);
+ return (*this)[QStringView(key)];
}
+#endif
+
+/*!
+ \fn QJsonValue QJsonObject::operator [](QStringView key) const
+
+ \overload
+ \since 5.14
+*/
/*!
\fn QJsonValue QJsonObject::operator [](QLatin1String key) const
@@ -433,6 +455,7 @@ QJsonValue QJsonObject::operator [](const QString &key) const
\since 5.7
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a reference to the value for \a key.
@@ -446,14 +469,17 @@ QJsonValue QJsonObject::operator [](const QString &key) const
*/
QJsonValueRef QJsonObject::operator [](const QString &key)
{
- // ### somewhat inefficient, as we lookup the key twice if it doesn't yet exist
- bool keyExists = false;
- int index = o ? o->indexOf(key, &keyExists) : -1;
- if (!keyExists) {
- iterator i = insert(key, QJsonValue());
- index = i.i;
- }
- return QJsonValueRef(this, index);
+ return (*this)[QStringView(key)];
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonValueRef QJsonObject::operator [](QStringView key)
+{
+ return atImpl(key);
}
/*!
@@ -462,10 +488,25 @@ QJsonValueRef QJsonObject::operator [](const QString &key)
*/
QJsonValueRef QJsonObject::operator [](QLatin1String key)
{
- // ### optimize me
- return operator[](QString(key));
+ return atImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+QJsonValueRef QJsonObject::atImpl(T key)
+{
+ bool keyExists = false;
+ int index = o ? o->indexOf(key, &keyExists) : 0;
+ if (!keyExists) {
+ iterator i = insertAt(index, key, QJsonValue(), false);
+ index = i.i;
+ }
+ return QJsonValueRef(this, index);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Inserts a new item with the key \a key and a value of \a value.
@@ -481,10 +522,49 @@ QJsonValueRef QJsonObject::operator [](QLatin1String key)
*/
QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &value)
{
+ return insert(QStringView(key), value);
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonObject::iterator QJsonObject::insert(QStringView key, const QJsonValue &value)
+{
+ return insertImpl(key, value);
+}
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonObject::iterator QJsonObject::insert(QLatin1String key, const QJsonValue &value)
+{
+ return insertImpl(key, value);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+QJsonObject::iterator QJsonObject::insertImpl(T key, const QJsonValue &value)
+{
if (value.t == QJsonValue::Undefined) {
remove(key);
return end();
}
+ bool keyExists = false;
+ int pos = o ? o->indexOf(key, &keyExists) : 0;
+ return insertAt(pos, key, value, keyExists);
+}
+
+/*!
+ \internal
+ */
+template <typename T>
+QJsonObject::iterator QJsonObject::insertAt(int pos, T key, const QJsonValue &value, bool keyExists)
+{
QJsonValue val = value;
bool latinOrIntValue;
@@ -500,8 +580,6 @@ QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &
if (!o->length)
o->tableOffset = sizeof(QJsonPrivate::Object);
- bool keyExists = false;
- int pos = o->indexOf(key, &keyExists);
if (keyExists)
++d->compactionCounter;
@@ -518,12 +596,12 @@ QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &
if (valueSize)
QJsonPrivate::Value::copyData(val, (char *)e + valueOffset, latinOrIntValue);
- if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
- compact();
+ compactIfNeeded();
return iterator(this, pos);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Removes \a key from the object.
@@ -531,6 +609,34 @@ QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &
*/
void QJsonObject::remove(const QString &key)
{
+ remove(QStringView(key));
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+void QJsonObject::remove(QStringView key)
+{
+ removeImpl(key);
+}
+
+/*!
+ \overload
+ \since 5.14
+*/
+void QJsonObject::remove(QLatin1String key)
+{
+ removeImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+void QJsonObject::removeImpl(T key)
+{
if (!d)
return;
@@ -539,13 +645,10 @@ void QJsonObject::remove(const QString &key)
if (!keyExists)
return;
- detach2();
- o->removeItems(index, 1);
- ++d->compactionCounter;
- if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
- compact();
+ removeAt(index);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Removes \a key from the object.
@@ -557,6 +660,34 @@ void QJsonObject::remove(const QString &key)
*/
QJsonValue QJsonObject::take(const QString &key)
{
+ return take(QStringView(key));
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonValue QJsonObject::take(QStringView key)
+{
+ return takeImpl(key);
+}
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonValue QJsonObject::take(QLatin1String key)
+{
+ return takeImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+QJsonValue QJsonObject::takeImpl(T key)
+{
if (!o)
return QJsonValue(QJsonValue::Undefined);
@@ -566,15 +697,12 @@ QJsonValue QJsonObject::take(const QString &key)
return QJsonValue(QJsonValue::Undefined);
QJsonValue v(d, o, o->entryAt(index)->value);
- detach2();
- o->removeItems(index, 1);
- ++d->compactionCounter;
- if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
- compact();
+ removeAt(index);
return v;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns \c true if the object contains key \a key.
@@ -582,12 +710,17 @@ QJsonValue QJsonObject::take(const QString &key)
*/
bool QJsonObject::contains(const QString &key) const
{
- if (!o)
- return false;
+ return contains(QStringView(key));
+}
+#endif
- bool keyExists;
- o->indexOf(key, &keyExists);
- return keyExists;
+/*!
+ \overload
+ \since 5.14
+*/
+bool QJsonObject::contains(QStringView key) const
+{
+ return containsImpl(key);
}
/*!
@@ -596,6 +729,15 @@ bool QJsonObject::contains(const QString &key) const
*/
bool QJsonObject::contains(QLatin1String key) const
{
+ return containsImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+bool QJsonObject::containsImpl(T key) const
+{
if (!o)
return false;
@@ -646,21 +788,19 @@ bool QJsonObject::operator!=(const QJsonObject &other) const
*/
QJsonObject::iterator QJsonObject::erase(QJsonObject::iterator it)
{
- Q_ASSERT(d && d->ref.load() == 1);
+ Q_ASSERT(d && d->ref.loadRelaxed() == 1);
if (it.o != this || it.i < 0 || it.i >= (int)o->length)
return iterator(this, o->length);
int index = it.i;
- o->removeItems(index, 1);
- ++d->compactionCounter;
- if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
- compact();
+ removeAt(index);
// iterator hasn't changed
return it;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns an iterator pointing to the item with key \a key in the
map.
@@ -670,12 +810,17 @@ QJsonObject::iterator QJsonObject::erase(QJsonObject::iterator it)
*/
QJsonObject::iterator QJsonObject::find(const QString &key)
{
- bool keyExists = false;
- int index = o ? o->indexOf(key, &keyExists) : 0;
- if (!keyExists)
- return end();
- detach2();
- return iterator(this, index);
+ return find(QStringView(key));
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonObject::iterator QJsonObject::find(QStringView key)
+{
+ return findImpl(key);
}
/*!
@@ -684,6 +829,15 @@ QJsonObject::iterator QJsonObject::find(const QString &key)
*/
QJsonObject::iterator QJsonObject::find(QLatin1String key)
{
+ return findImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+QJsonObject::iterator QJsonObject::findImpl(T key)
+{
bool keyExists = false;
int index = o ? o->indexOf(key, &keyExists) : 0;
if (!keyExists)
@@ -692,10 +846,18 @@ QJsonObject::iterator QJsonObject::find(QLatin1String key)
return iterator(this, index);
}
+#if QT_STRINGVIEW_LEVEL < 2
/*! \fn QJsonObject::const_iterator QJsonObject::find(const QString &key) const
\overload
*/
+#endif
+
+/*! \fn QJsonObject::const_iterator QJsonObject::find(QStringView key) const
+
+ \overload
+ \since 5.14
+*/
/*! \fn QJsonObject::const_iterator QJsonObject::find(QLatin1String key) const
@@ -703,6 +865,7 @@ QJsonObject::iterator QJsonObject::find(QLatin1String key)
\since 5.7
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a const iterator pointing to the item with key \a key in the
map.
@@ -712,11 +875,17 @@ QJsonObject::iterator QJsonObject::find(QLatin1String key)
*/
QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
{
- bool keyExists = false;
- int index = o ? o->indexOf(key, &keyExists) : 0;
- if (!keyExists)
- return end();
- return const_iterator(this, index);
+ return constFind(QStringView(key));
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+QJsonObject::const_iterator QJsonObject::constFind(QStringView key) const
+{
+ return constFindImpl(key);
}
/*!
@@ -725,6 +894,15 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
*/
QJsonObject::const_iterator QJsonObject::constFind(QLatin1String key) const
{
+ return constFindImpl(key);
+}
+
+/*!
+ \internal
+*/
+template <typename T>
+QJsonObject::const_iterator QJsonObject::constFindImpl(T key) const
+{
bool keyExists = false;
int index = o ? o->indexOf(key, &keyExists) : 0;
if (!keyExists)
@@ -1231,7 +1409,7 @@ bool QJsonObject::detach2(uint reserve)
d->ref.ref();
return true;
}
- if (reserve == 0 && d->ref.load() == 1)
+ if (reserve == 0 && d->ref.loadRelaxed() == 1)
return true;
QJsonPrivate::Data *x = d->clone(o, reserve);
@@ -1261,6 +1439,15 @@ void QJsonObject::compact()
/*!
\internal
*/
+void QJsonObject::compactIfNeeded()
+{
+ if (d->compactionCounter > 32u && d->compactionCounter >= unsigned(o->length) / 2u)
+ compact();
+}
+
+/*!
+ \internal
+ */
QString QJsonObject::keyAt(int i) const
{
Q_ASSERT(o && i >= 0 && i < (int)o->length);
@@ -1289,7 +1476,21 @@ void QJsonObject::setValueAt(int i, const QJsonValue &val)
Q_ASSERT(o && i >= 0 && i < (int)o->length);
QJsonPrivate::Entry *e = o->entryAt(i);
- insert(e->key(), val);
+ if (val.t == QJsonValue::Undefined)
+ removeAt(i);
+ else
+ insertAt(i, e->key(), val, true);
+}
+
+/*!
+ \internal
+ */
+void QJsonObject::removeAt(int index)
+{
+ detach2();
+ o->removeItems(index, 1);
+ ++d->compactionCounter;
+ compactIfNeeded();
}
uint qHash(const QJsonObject &object, uint seed)
diff --git a/src/corelib/serialization/qjsonobject.h b/src/corelib/serialization/qjsonobject.h
index 80fe6b2f3f..05463f6f36 100644
--- a/src/corelib/serialization/qjsonobject.h
+++ b/src/corelib/serialization/qjsonobject.h
@@ -42,10 +42,8 @@
#include <QtCore/qjsonvalue.h>
#include <QtCore/qiterator.h>
-#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <QtCore/qpair.h>
#include <initializer_list>
-#endif
QT_BEGIN_NAMESPACE
@@ -60,34 +58,32 @@ class Q_CORE_EXPORT QJsonObject
public:
QJsonObject();
-#if defined(Q_COMPILER_INITIALIZER_LISTS) || defined(Q_QDOC)
QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args)
{
initialize();
for (std::initializer_list<QPair<QString, QJsonValue> >::const_iterator i = args.begin(); i != args.end(); ++i)
insert(i->first, i->second);
}
-#endif
~QJsonObject();
QJsonObject(const QJsonObject &other);
QJsonObject &operator =(const QJsonObject &other);
- QJsonObject(QJsonObject &&other) Q_DECL_NOTHROW
+ QJsonObject(QJsonObject &&other) noexcept
: d(other.d), o(other.o)
{
other.d = nullptr;
other.o = nullptr;
}
- QJsonObject &operator =(QJsonObject &&other) Q_DECL_NOTHROW
+ QJsonObject &operator =(QJsonObject &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QJsonObject &other) Q_DECL_NOTHROW
+ void swap(QJsonObject &other) noexcept
{
qSwap(d, other.d);
qSwap(o, other.o);
@@ -104,16 +100,28 @@ public:
inline int length() const { return size(); }
bool isEmpty() const;
+#if QT_STRINGVIEW_LEVEL < 2
QJsonValue value(const QString &key) const;
- QJsonValue value(QLatin1String key) const;
QJsonValue operator[] (const QString &key) const;
- QJsonValue operator[] (QLatin1String key) const { return value(key); }
QJsonValueRef operator[] (const QString &key);
+#endif
+ QJsonValue value(QStringView key) const;
+ QJsonValue value(QLatin1String key) const;
+ QJsonValue operator[] (QStringView key) const { return value(key); }
+ QJsonValue operator[] (QLatin1String key) const { return value(key); }
+ QJsonValueRef operator[] (QStringView key);
QJsonValueRef operator[] (QLatin1String key);
+#if QT_STRINGVIEW_LEVEL < 2
void remove(const QString &key);
QJsonValue take(const QString &key);
bool contains(const QString &key) const;
+#endif
+ void remove(QStringView key);
+ void remove(QLatin1String key);
+ QJsonValue take(QStringView key);
+ QJsonValue take(QLatin1String key);
+ bool contains(QStringView key) const;
bool contains(QLatin1String key) const;
bool operator==(const QJsonObject &other) const;
@@ -222,13 +230,20 @@ public:
// more Qt
typedef iterator Iterator;
typedef const_iterator ConstIterator;
+#if QT_STRINGVIEW_LEVEL < 2
iterator find(const QString &key);
- iterator find(QLatin1String key);
const_iterator find(const QString &key) const { return constFind(key); }
- const_iterator find(QLatin1String key) const { return constFind(key); }
const_iterator constFind(const QString &key) const;
- const_iterator constFind(QLatin1String key) const;
iterator insert(const QString &key, const QJsonValue &value);
+#endif
+ iterator find(QStringView key);
+ iterator find(QLatin1String key);
+ const_iterator find(QStringView key) const { return constFind(key); }
+ const_iterator find(QLatin1String key) const { return constFind(key); }
+ const_iterator constFind(QStringView key) const;
+ const_iterator constFind(QLatin1String key) const;
+ iterator insert(QStringView key, const QJsonValue &value);
+ iterator insert(QLatin1String key, const QJsonValue &value);
// STL compatibility
typedef QJsonValue mapped_type;
@@ -251,10 +266,22 @@ private:
void detach(uint reserve = 0);
bool detach2(uint reserve = 0);
void compact();
+ void compactIfNeeded();
+
+ template <typename T> QJsonValue valueImpl(T key) const;
+ template <typename T> QJsonValueRef atImpl(T key);
+ template <typename T> void removeImpl(T key);
+ template <typename T> QJsonValue takeImpl(T key);
+ template <typename T> bool containsImpl(T key) const;
+ template <typename T> iterator findImpl(T key);
+ template <typename T> const_iterator constFindImpl(T key) const;
+ template <typename T> iterator insertImpl(T key, const QJsonValue &value);
QString keyAt(int i) const;
QJsonValue valueAt(int i) const;
void setValueAt(int i, const QJsonValue &val);
+ void removeAt(int i);
+ template <typename T> iterator insertAt(int i, T key, const QJsonValue &val, bool exists);
QJsonPrivate::Data *d;
QJsonPrivate::Object *o;
diff --git a/src/corelib/serialization/qjsonparser.cpp b/src/corelib/serialization/qjsonparser.cpp
index bfba95520e..cd36bd5a5b 100644
--- a/src/corelib/serialization/qjsonparser.cpp
+++ b/src/corelib/serialization/qjsonparser.cpp
@@ -198,7 +198,9 @@ QString QJsonParseError::errorString() const
using namespace QJsonPrivate;
Parser::Parser(const char *json, int length)
- : head(json), json(json), data(0), dataLength(0), current(0), nestingLevel(0), lastError(QJsonParseError::NoError)
+ : head(json), json(json), data(nullptr)
+ , dataLength(0), current(0), nestingLevel(0)
+ , lastError(QJsonParseError::NoError)
{
end = json + length;
}
@@ -316,7 +318,7 @@ QJsonDocument Parser::parse(QJsonParseError *error)
eatBOM();
char token = nextToken();
- DEBUG << hex << (uint)token;
+ DEBUG << Qt::hex << (uint)token;
if (token == BeginArray) {
if (!parseArray())
goto error;
diff --git a/src/corelib/serialization/qjsonvalue.cpp b/src/corelib/serialization/qjsonvalue.cpp
index 1fc610d7c7..5f07a6a03e 100644
--- a/src/corelib/serialization/qjsonvalue.cpp
+++ b/src/corelib/serialization/qjsonvalue.cpp
@@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE
The default is to create a Null value.
*/
QJsonValue::QJsonValue(Type type)
- : ui(0), d(0), t(type)
+ : ui(0), d(nullptr), t(type)
{
}
@@ -120,7 +120,7 @@ QJsonValue::QJsonValue(Type type)
\internal
*/
QJsonValue::QJsonValue(QJsonPrivate::Data *data, QJsonPrivate::Base *base, const QJsonPrivate::Value &v)
- : d(0)
+ : d(nullptr)
{
t = (Type)(uint)v.type;
switch (t) {
@@ -154,7 +154,7 @@ QJsonValue::QJsonValue(QJsonPrivate::Data *data, QJsonPrivate::Base *base, const
Creates a value of type Bool, with value \a b.
*/
QJsonValue::QJsonValue(bool b)
- : d(0), t(Bool)
+ : d(nullptr), t(Bool)
{
this->b = b;
}
@@ -163,7 +163,7 @@ QJsonValue::QJsonValue(bool b)
Creates a value of type Double, with value \a n.
*/
QJsonValue::QJsonValue(double n)
- : d(0), t(Double)
+ : d(nullptr), t(Double)
{
this->dbl = n;
}
@@ -173,7 +173,7 @@ QJsonValue::QJsonValue(double n)
Creates a value of type Double, with value \a n.
*/
QJsonValue::QJsonValue(int n)
- : d(0), t(Double)
+ : d(nullptr), t(Double)
{
this->dbl = n;
}
@@ -185,7 +185,7 @@ QJsonValue::QJsonValue(int n)
If you pass in values outside this range expect a loss of precision to occur.
*/
QJsonValue::QJsonValue(qint64 n)
- : d(0), t(Double)
+ : d(nullptr), t(Double)
{
this->dbl = double(n);
}
@@ -194,7 +194,7 @@ QJsonValue::QJsonValue(qint64 n)
Creates a value of type String, with value \a s.
*/
QJsonValue::QJsonValue(const QString &s)
- : d(0), t(String)
+ : d(nullptr), t(String)
{
stringDataFromQStringHelper(s);
}
@@ -221,7 +221,7 @@ void QJsonValue::stringDataFromQStringHelper(const QString &string)
Creates a value of type String, with value \a s.
*/
QJsonValue::QJsonValue(QLatin1String s)
- : d(0), t(String)
+ : d(nullptr), t(String)
{
// ### FIXME: Avoid creating the temp QString below
QString str(s);
@@ -694,6 +694,7 @@ QJsonObject QJsonValue::toObject() const
return toObject(QJsonObject());
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns a QJsonValue representing the value for the key \a key.
@@ -708,6 +709,16 @@ QJsonObject QJsonValue::toObject() const
*/
const QJsonValue QJsonValue::operator[](const QString &key) const
{
+ return (*this)[QStringView(key)];
+}
+#endif
+
+/*!
+ \overload
+ \since 5.14
+*/
+const QJsonValue QJsonValue::operator[](QStringView key) const
+{
if (!isObject())
return QJsonValue(QJsonValue::Undefined);
diff --git a/src/corelib/serialization/qjsonvalue.h b/src/corelib/serialization/qjsonvalue.h
index 5235ba1969..8ade18509b 100644
--- a/src/corelib/serialization/qjsonvalue.h
+++ b/src/corelib/serialization/qjsonvalue.h
@@ -92,7 +92,7 @@ public:
QJsonValue(const QJsonValue &other);
QJsonValue &operator =(const QJsonValue &other);
- QJsonValue(QJsonValue &&other) Q_DECL_NOTHROW
+ QJsonValue(QJsonValue &&other) noexcept
: ui(other.ui),
d(other.d),
t(other.t)
@@ -102,13 +102,13 @@ public:
other.t = Null;
}
- QJsonValue &operator =(QJsonValue &&other) Q_DECL_NOTHROW
+ QJsonValue &operator =(QJsonValue &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QJsonValue &other) Q_DECL_NOTHROW
+ void swap(QJsonValue &other) noexcept
{
qSwap(ui, other.ui);
qSwap(d, other.d);
@@ -137,7 +137,10 @@ public:
QJsonObject toObject() const;
QJsonObject toObject(const QJsonObject &defaultValue) const;
+#if QT_STRINGVIEW_LEVEL < 2
const QJsonValue operator[](const QString &key) const;
+#endif
+ const QJsonValue operator[](QStringView key) const;
const QJsonValue operator[](QLatin1String key) const;
const QJsonValue operator[](int i) const;
diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp
index c9ba183a50..cf59cc54c7 100644
--- a/src/corelib/serialization/qtextstream.cpp
+++ b/src/corelib/serialization/qtextstream.cpp
@@ -135,30 +135,30 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384;
\table
\header \li Manipulator \li Description
- \row \li \c bin \li Same as setIntegerBase(2).
- \row \li \c oct \li Same as setIntegerBase(8).
- \row \li \c dec \li Same as setIntegerBase(10).
- \row \li \c hex \li Same as setIntegerBase(16).
- \row \li \c showbase \li Same as setNumberFlags(numberFlags() | ShowBase).
- \row \li \c forcesign \li Same as setNumberFlags(numberFlags() | ForceSign).
- \row \li \c forcepoint \li Same as setNumberFlags(numberFlags() | ForcePoint).
- \row \li \c noshowbase \li Same as setNumberFlags(numberFlags() & ~ShowBase).
- \row \li \c noforcesign \li Same as setNumberFlags(numberFlags() & ~ForceSign).
- \row \li \c noforcepoint \li Same as setNumberFlags(numberFlags() & ~ForcePoint).
- \row \li \c uppercasebase \li Same as setNumberFlags(numberFlags() | UppercaseBase).
- \row \li \c uppercasedigits \li Same as setNumberFlags(numberFlags() | UppercaseDigits).
- \row \li \c lowercasebase \li Same as setNumberFlags(numberFlags() & ~UppercaseBase).
- \row \li \c lowercasedigits \li Same as setNumberFlags(numberFlags() & ~UppercaseDigits).
- \row \li \c fixed \li Same as setRealNumberNotation(FixedNotation).
- \row \li \c scientific \li Same as setRealNumberNotation(ScientificNotation).
- \row \li \c left \li Same as setFieldAlignment(AlignLeft).
- \row \li \c right \li Same as setFieldAlignment(AlignRight).
- \row \li \c center \li Same as setFieldAlignment(AlignCenter).
- \row \li \c endl \li Same as operator<<('\\n') and flush().
- \row \li \c flush \li Same as flush().
- \row \li \c reset \li Same as reset().
- \row \li \c ws \li Same as skipWhiteSpace().
- \row \li \c bom \li Same as setGenerateByteOrderMark(true).
+ \row \li \c Qt::bin \li Same as setIntegerBase(2).
+ \row \li \c Qt::oct \li Same as setIntegerBase(8).
+ \row \li \c Qt::dec \li Same as setIntegerBase(10).
+ \row \li \c Qt::hex \li Same as setIntegerBase(16).
+ \row \li \c Qt::showbase \li Same as setNumberFlags(numberFlags() | ShowBase).
+ \row \li \c Qt::forcesign \li Same as setNumberFlags(numberFlags() | ForceSign).
+ \row \li \c Qt::forcepoint \li Same as setNumberFlags(numberFlags() | ForcePoint).
+ \row \li \c Qt::noshowbase \li Same as setNumberFlags(numberFlags() & ~ShowBase).
+ \row \li \c Qt::noforcesign \li Same as setNumberFlags(numberFlags() & ~ForceSign).
+ \row \li \c Qt::noforcepoint \li Same as setNumberFlags(numberFlags() & ~ForcePoint).
+ \row \li \c Qt::uppercasebase \li Same as setNumberFlags(numberFlags() | UppercaseBase).
+ \row \li \c Qt::uppercasedigits \li Same as setNumberFlags(numberFlags() | UppercaseDigits).
+ \row \li \c Qt::lowercasebase \li Same as setNumberFlags(numberFlags() & ~UppercaseBase).
+ \row \li \c Qt::lowercasedigits \li Same as setNumberFlags(numberFlags() & ~UppercaseDigits).
+ \row \li \c Qt::fixed \li Same as setRealNumberNotation(FixedNotation).
+ \row \li \c Qt::scientific \li Same as setRealNumberNotation(ScientificNotation).
+ \row \li \c Qt::left \li Same as setFieldAlignment(AlignLeft).
+ \row \li \c Qt::right \li Same as setFieldAlignment(AlignRight).
+ \row \li \c Qt::center \li Same as setFieldAlignment(AlignCenter).
+ \row \li \c Qt::endl \li Same as operator<<('\\n') and flush().
+ \row \li \c Qt::flush \li Same as flush().
+ \row \li \c Qt::reset \li Same as reset().
+ \row \li \c Qt::ws \li Same as skipWhiteSpace().
+ \row \li \c Qt::bom \li Same as setGenerateByteOrderMark(true).
\endtable
In addition, Qt provides three global manipulators that take a
@@ -327,7 +327,7 @@ QT_BEGIN_NAMESPACE
QTextStreamPrivate::QTextStreamPrivate(QTextStream *q_ptr)
:
#if QT_CONFIG(textcodec)
- readConverterSavedState(0),
+ readConverterSavedState(nullptr),
#endif
readConverterSavedStateOffset(0),
locale(QLocale::c())
@@ -381,7 +381,7 @@ void QTextStreamPrivate::Params::reset()
padChar = QLatin1Char(' ');
fieldAlignment = QTextStream::AlignRight;
realNumberNotation = QTextStream::SmartNotation;
- numberFlags = 0;
+ numberFlags = { };
}
/*!
@@ -391,9 +391,9 @@ void QTextStreamPrivate::reset()
{
params.reset();
- device = 0;
+ device = nullptr;
deleteDevice = false;
- string = 0;
+ string = nullptr;
stringOffset = 0;
stringOpenMode = QIODevice::NotOpen;
@@ -406,7 +406,7 @@ void QTextStreamPrivate::reset()
resetCodecConverterStateHelper(&readConverterState);
resetCodecConverterStateHelper(&writeConverterState);
delete readConverterSavedState;
- readConverterSavedState = 0;
+ readConverterSavedState = nullptr;
writeConverterState.flags |= QTextCodec::IgnoreHeader;
autoDetectUnicode = true;
#endif
@@ -888,7 +888,7 @@ inline bool QTextStreamPrivate::getChar(QChar *ch)
if ((string && stringOffset == string->size())
|| (device && readBuffer.isEmpty() && !fillReadBuffer())) {
if (ch)
- *ch = 0;
+ *ch = QChar();
return false;
}
if (ch)
@@ -1207,7 +1207,7 @@ bool QTextStream::seek(qint64 pos)
resetCodecConverterStateHelper(&d->readConverterState);
resetCodecConverterStateHelper(&d->writeConverterState);
delete d->readConverterSavedState;
- d->readConverterSavedState = 0;
+ d->readConverterSavedState = nullptr;
d->writeConverterState.flags |= QTextCodec::IgnoreHeader;
#endif
return true;
@@ -1295,7 +1295,7 @@ void QTextStream::skipWhiteSpace()
{
Q_D(QTextStream);
CHECK_VALID_STREAM(Q_VOID);
- d->scan(0, 0, 0, QTextStreamPrivate::NotSpace);
+ d->scan(nullptr, nullptr, 0, QTextStreamPrivate::NotSpace);
d->consumeLastToken();
}
@@ -1751,7 +1751,7 @@ QString QTextStream::read(qint64 maxlen)
*/
QTextStreamPrivate::NumberParsingStatus QTextStreamPrivate::getNumber(qulonglong *ret)
{
- scan(0, 0, 0, NotSpace);
+ scan(nullptr, nullptr, 0, NotSpace);
consumeLastToken();
// detect int encoding
@@ -1980,7 +1980,7 @@ bool QTextStreamPrivate::getReal(double *f)
ParserState state = Init;
InputToken input = None;
- scan(0, 0, 0, NotSpace);
+ scan(nullptr, nullptr, 0, NotSpace);
consumeLastToken();
const int BufferSize = 128;
@@ -2056,7 +2056,7 @@ bool QTextStreamPrivate::getReal(double *f)
// nan/+inf/-inf, so here we also check for uppercase and mixed
// case versions.
if (!qstricmp(buf, "nan") || !qstricmp(buf, "+nan") || !qstricmp(buf, "-nan")) {
- *f = qSNaN();
+ *f = qQNaN();
return true;
} else if (!qstricmp(buf, "+inf") || !qstricmp(buf, "inf")) {
*f = qInf();
@@ -2084,7 +2084,7 @@ QTextStream &QTextStream::operator>>(QChar &c)
{
Q_D(QTextStream);
CHECK_VALID_STREAM(*this);
- d->scan(0, 0, 0, QTextStreamPrivate::NotSpace);
+ d->scan(nullptr, nullptr, 0, QTextStreamPrivate::NotSpace);
if (!d->getChar(&c))
setStatus(ReadPastEnd);
return *this;
@@ -2245,7 +2245,7 @@ QTextStream &QTextStream::operator>>(QString &str)
CHECK_VALID_STREAM(*this);
str.clear();
- d->scan(0, 0, 0, QTextStreamPrivate::NotSpace);
+ d->scan(nullptr, nullptr, 0, QTextStreamPrivate::NotSpace);
d->consumeLastToken();
const QChar *ptr;
@@ -2273,7 +2273,7 @@ QTextStream &QTextStream::operator>>(QByteArray &array)
CHECK_VALID_STREAM(*this);
array.clear();
- d->scan(0, 0, 0, QTextStreamPrivate::NotSpace);
+ d->scan(nullptr, nullptr, 0, QTextStreamPrivate::NotSpace);
d->consumeLastToken();
const QChar *ptr;
@@ -2308,7 +2308,7 @@ QTextStream &QTextStream::operator>>(char *c)
Q_D(QTextStream);
*c = 0;
CHECK_VALID_STREAM(*this);
- d->scan(0, 0, 0, QTextStreamPrivate::NotSpace);
+ d->scan(nullptr, nullptr, 0, QTextStreamPrivate::NotSpace);
d->consumeLastToken();
const QChar *ptr;
@@ -2356,7 +2356,7 @@ void QTextStreamPrivate::putNumber(qulonglong number, bool negative)
} else if (negative) {
// Workaround for backward compatibility for writing negative
// numbers in octal and hex:
- // QTextStream(result) << showbase << hex << -1 << oct << -1
+ // QTextStream(result) << Qt::showbase << Qt::hex << -1 << oct << -1
// should output: -0x1 -0b1
result = dd->unsLongLongToString(number, -1, base, -1, flags);
result.prepend(locale.negativeSign());
@@ -2689,6 +2689,11 @@ QTextStream &QTextStream::operator<<(const void *ptr)
d->params.numberFlags = oldFlags;
return *this;
}
+#if defined(Q_QDOC) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+namespace Qt {
+#else
+namespace QTextStreamFunctions {
+#endif
/*!
\relates QTextStream
@@ -2973,7 +2978,7 @@ QTextStream &center(QTextStream &stream)
*/
QTextStream &endl(QTextStream &stream)
{
- return stream << QLatin1Char('\n') << flush;
+ return stream << QLatin1Char('\n') << Qt::flush;
}
/*!
@@ -3015,6 +3020,8 @@ QTextStream &ws(QTextStream &stream)
return stream;
}
+} // namespace QTextStreamFunctions
+
/*!
\fn QTextStreamManipulator qSetFieldWidth(int width)
\relates QTextStream
@@ -3037,6 +3044,12 @@ QTextStream &ws(QTextStream &stream)
*/
#if QT_CONFIG(textcodec)
+
+#if defined(Q_QDOC) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+namespace Qt {
+#else
+namespace QTextStreamFunctions {
+#endif
/*!
\relates QTextStream
@@ -3051,6 +3064,8 @@ QTextStream &bom(QTextStream &stream)
return stream;
}
+} // namespace QTextStreamFunctions
+
/*!
Sets the codec for this stream to \a codec. The codec is used for
decoding any data that is read from the assigned device, and for
@@ -3200,6 +3215,43 @@ QLocale QTextStream::locale() const
return d->locale;
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_QDOC)
+// Binary compatible definitions for Qt<5.14
+Q_CORE_EXPORT QTextStream &bin(QTextStream &s) { return Qt::bin(s); }
+Q_CORE_EXPORT QTextStream &oct(QTextStream &s) { return Qt::oct(s); }
+Q_CORE_EXPORT QTextStream &dec(QTextStream &s) { return Qt::dec(s); }
+Q_CORE_EXPORT QTextStream &hex(QTextStream &s) { return Qt::hex(s); }
+
+Q_CORE_EXPORT QTextStream &showbase(QTextStream &s) { return Qt::showbase(s); }
+Q_CORE_EXPORT QTextStream &forcesign(QTextStream &s) { return Qt::forcesign(s); }
+Q_CORE_EXPORT QTextStream &forcepoint(QTextStream &s) { return Qt::forcepoint(s); }
+Q_CORE_EXPORT QTextStream &noshowbase(QTextStream &s) { return Qt::noshowbase(s); }
+Q_CORE_EXPORT QTextStream &noforcesign(QTextStream &s) { return Qt::noforcesign(s); }
+Q_CORE_EXPORT QTextStream &noforcepoint(QTextStream &s) { return Qt::noforcepoint(s); }
+
+Q_CORE_EXPORT QTextStream &uppercasebase(QTextStream &s) { return Qt::uppercasebase(s); }
+Q_CORE_EXPORT QTextStream &uppercasedigits(QTextStream &s) { return Qt::uppercasedigits(s); }
+Q_CORE_EXPORT QTextStream &lowercasebase(QTextStream &s) { return Qt::lowercasebase(s); }
+Q_CORE_EXPORT QTextStream &lowercasedigits(QTextStream &s) { return Qt::lowercasedigits(s); }
+
+Q_CORE_EXPORT QTextStream &fixed(QTextStream &s) { return Qt::fixed(s); }
+Q_CORE_EXPORT QTextStream &scientific(QTextStream &s) { return Qt::scientific(s); }
+
+Q_CORE_EXPORT QTextStream &left(QTextStream &s) { return Qt::left(s); }
+Q_CORE_EXPORT QTextStream &right(QTextStream &s) { return Qt::right(s); }
+Q_CORE_EXPORT QTextStream &center(QTextStream &s) { return Qt::center(s); }
+
+Q_CORE_EXPORT QTextStream &endl(QTextStream &s) { return Qt::endl(s); }
+Q_CORE_EXPORT QTextStream &flush(QTextStream &s) { return Qt::flush(s); }
+Q_CORE_EXPORT QTextStream &reset(QTextStream &s) { return Qt::reset(s); }
+
+Q_CORE_EXPORT QTextStream &ws(QTextStream &s) { return Qt::ws(s); }
+
+#if QT_CONFIG(textcodec)
+Q_CORE_EXPORT QTextStream &bom(QTextStream &s) { return Qt::bom(s); }
+#endif
+#endif
+
QT_END_NAMESPACE
#ifndef QT_NO_QOBJECT
diff --git a/src/corelib/serialization/qtextstream.h b/src/corelib/serialization/qtextstream.h
index 1d86a18b9c..935ec16536 100644
--- a/src/corelib/serialization/qtextstream.h
+++ b/src/corelib/serialization/qtextstream.h
@@ -213,8 +213,8 @@ typedef void (QTextStream::*QTSMFC)(QChar); // manipulator w/QChar argument
class Q_CORE_EXPORT QTextStreamManipulator
{
public:
- Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW : mf(m), mc(nullptr), arg(a), ch() {}
- Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(nullptr), mc(m), arg(-1), ch(c) {}
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) noexcept : mf(m), mc(nullptr), arg(a), ch() {}
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) noexcept : mf(nullptr), mc(m), arg(-1), ch(c) {}
void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
private:
@@ -233,6 +233,13 @@ inline QTextStream &operator<<(QTextStream &s, QTextStreamFunction f)
inline QTextStream &operator<<(QTextStream &s, QTextStreamManipulator m)
{ m.exec(s); return s; }
+#if defined(Q_QDOC) || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+namespace Qt {
+#else
+// This namespace only exists for 'using namespace' declarations.
+namespace QTextStreamFunctions {
+#endif
+
Q_CORE_EXPORT QTextStream &bin(QTextStream &s);
Q_CORE_EXPORT QTextStream &oct(QTextStream &s);
Q_CORE_EXPORT QTextStream &dec(QTextStream &s);
@@ -265,6 +272,21 @@ Q_CORE_EXPORT QTextStream &bom(QTextStream &s);
Q_CORE_EXPORT QTextStream &ws(QTextStream &s);
+} // namespace QTextStreamFunctions
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_QDOC)
+namespace Qt {
+using namespace QTextStreamFunctions;
+}
+
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_CLANG("-Wheader-hygiene")
+// We use 'using namespace' as that doesn't cause
+// conflicting definitions compiler errors.
+using namespace QTextStreamFunctions;
+QT_WARNING_POP
+#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_QDOC)
+
inline QTextStreamManipulator qSetFieldWidth(int width)
{
QTSMFI func = &QTextStream::setFieldWidth;
diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp
index 0170be7602..500e0aa6be 100644
--- a/src/corelib/serialization/qxmlstream.cpp
+++ b/src/corelib/serialization/qxmlstream.cpp
@@ -58,9 +58,9 @@
// case for most bootstrapped applications.
#define Q_DECLARE_TR_FUNCTIONS(context) \
public: \
- static inline QString tr(const char *sourceText, const char *comment = 0) \
+ static inline QString tr(const char *sourceText, const char *comment = nullptr) \
{ Q_UNUSED(comment); return QString::fromLatin1(sourceText); } \
- static inline QString trUtf8(const char *sourceText, const char *comment = 0) \
+ static inline QString trUtf8(const char *sourceText, const char *comment = nullptr) \
{ Q_UNUSED(comment); return QString::fromLatin1(sourceText); } \
static inline QString tr(const char *sourceText, const char*, int) \
{ return QString::fromLatin1(sourceText); } \
@@ -548,7 +548,7 @@ void QXmlStreamReader::clear()
if (d->device) {
if (d->deleteDevice)
delete d->device;
- d->device = 0;
+ d->device = nullptr;
}
}
@@ -782,8 +782,8 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
tagStackStringStorage.reserve(32);
tagStackStringStorageSize = 0;
NamespaceDeclaration &namespaceDeclaration = namespaceDeclarations.push();
- namespaceDeclaration.prefix = addToStringStorage(QStringViewLiteral("xml"));
- namespaceDeclaration.namespaceUri = addToStringStorage(QStringViewLiteral("http://www.w3.org/XML/1998/namespace"));
+ namespaceDeclaration.prefix = addToStringStorage(u"xml");
+ namespaceDeclaration.namespaceUri = addToStringStorage(u"http://www.w3.org/XML/1998/namespace");
initialTagStackStringStorageSize = tagStackStringStorageSize;
}
@@ -792,16 +792,16 @@ QXmlStreamPrivateTagStack::QXmlStreamPrivateTagStack()
QXmlStreamReaderPrivate::QXmlStreamReaderPrivate(QXmlStreamReader *q)
:q_ptr(q)
{
- device = 0;
+ device = nullptr;
deleteDevice = false;
#if QT_CONFIG(textcodec)
- decoder = 0;
+ decoder = nullptr;
#endif
stack_size = 64;
- sym_stack = 0;
- state_stack = 0;
+ sym_stack = nullptr;
+ state_stack = nullptr;
reallocateStack();
- entityResolver = 0;
+ entityResolver = nullptr;
init();
#define ADD_PREDEFINED(n, v) \
do { \
@@ -843,11 +843,11 @@ void QXmlStreamReaderPrivate::init()
#if QT_CONFIG(textcodec)
codec = QTextCodec::codecForMib(106); // utf8
delete decoder;
- decoder = 0;
+ decoder = nullptr;
#endif
attributeStack.clear();
attributeStack.reserve(16);
- entityParser = 0;
+ entityParser = nullptr;
hasCheckedStartDocument = false;
normalizeLiterals = false;
hasSeenTag = false;
@@ -1423,7 +1423,7 @@ inline int QXmlStreamReaderPrivate::fastScanNMTOKEN()
int n = 0;
uint c;
while ((c = getChar()) != StreamEOF) {
- if (fastDetermineNameChar(c) == NotName) {
+ if (fastDetermineNameChar(QChar(c)) == NotName) {
putChar(c);
return n;
} else {
@@ -2285,12 +2285,14 @@ QXmlStreamAttribute::QXmlStreamAttribute()
m_isDefault = false;
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
Destructs an attribute.
*/
QXmlStreamAttribute::~QXmlStreamAttribute()
{
}
+#endif
/*! Constructs an attribute in the namespace described with \a
namespaceUri with \a name and value \a value.
@@ -2366,6 +2368,7 @@ QXmlStreamAttribute::QXmlStreamAttribute(const QString &qualifiedName, const QSt
*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
Creates a copy of \a other.
*/
@@ -2386,7 +2389,7 @@ QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &o
m_isDefault = other.m_isDefault;
return *this;
}
-
+#endif
/*!
\class QXmlStreamAttributes
@@ -2442,6 +2445,8 @@ QXmlStreamAttribute& QXmlStreamAttribute::operator=(const QXmlStreamAttribute &o
QXmlStreamNotationDeclaration::QXmlStreamNotationDeclaration()
{
}
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
Creates a copy of \a other.
*/
@@ -2467,6 +2472,7 @@ Destructs this notation declaration.
QXmlStreamNotationDeclaration::~QXmlStreamNotationDeclaration()
{
}
+#endif
/*! \fn QStringRef QXmlStreamNotationDeclaration::name() const
@@ -2539,6 +2545,7 @@ QXmlStreamNamespaceDeclaration::QXmlStreamNamespaceDeclaration(const QString &pr
m_namespaceUri = namespaceUri;
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
Creates a copy of \a other.
*/
@@ -2562,6 +2569,7 @@ Destructs this namespace declaration.
QXmlStreamNamespaceDeclaration::~QXmlStreamNamespaceDeclaration()
{
}
+#endif
/*! \fn QStringRef QXmlStreamNamespaceDeclaration::prefix() const
@@ -2609,6 +2617,7 @@ QXmlStreamEntityDeclaration::QXmlStreamEntityDeclaration()
{
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/*!
Creates a copy of \a other.
*/
@@ -2636,6 +2645,7 @@ QXmlStreamEntityDeclaration& QXmlStreamEntityDeclaration::operator=(const QXmlSt
QXmlStreamEntityDeclaration::~QXmlStreamEntityDeclaration()
{
}
+#endif
/*! \fn QXmlStreamStringRef::swap(QXmlStreamStringRef &other)
\since 5.6
@@ -3014,8 +3024,8 @@ QXmlStreamWriterPrivate::QXmlStreamWriterPrivate(QXmlStreamWriter *q)
:autoFormattingIndent(4, ' ')
{
q_ptr = q;
- device = 0;
- stringDevice = 0;
+ device = nullptr;
+ stringDevice = nullptr;
deleteDevice = false;
#if QT_CONFIG(textcodec)
codec = QTextCodec::codecForMib(106); // utf8
@@ -3305,7 +3315,7 @@ void QXmlStreamWriter::setDevice(QIODevice *device)
Q_D(QXmlStreamWriter);
if (device == d->device)
return;
- d->stringDevice = 0;
+ d->stringDevice = nullptr;
if (d->deleteDevice) {
delete d->device;
d->deleteDevice = false;
diff --git a/src/corelib/serialization/qxmlstream.g b/src/corelib/serialization/qxmlstream.g
index e6328a11ac..12ecc9bdb2 100644
--- a/src/corelib/serialization/qxmlstream.g
+++ b/src/corelib/serialization/qxmlstream.g
@@ -506,7 +506,7 @@ public:
int fastScanLiteralContent();
int fastScanSpace();
int fastScanContentCharList();
- int fastScanName(int *prefix = 0);
+ int fastScanName(int *prefix = nullptr);
inline int fastScanNMTOKEN();
diff --git a/src/corelib/serialization/qxmlstream.h b/src/corelib/serialization/qxmlstream.h
index d30c6bc01f..7d0aa64570 100644
--- a/src/corelib/serialization/qxmlstream.h
+++ b/src/corelib/serialization/qxmlstream.h
@@ -59,19 +59,15 @@ public:
inline QXmlStreamStringRef(const QStringRef &aString)
:m_string(aString.string()?*aString.string():QString()), m_position(aString.position()), m_size(aString.size()){}
QXmlStreamStringRef(const QString &aString) : m_string(aString), m_position(0), m_size(m_string.size()) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- QXmlStreamStringRef(QString &&aString) Q_DECL_NOTHROW : m_string(std::move(aString)), m_position(0), m_size(m_string.size()) {}
-#endif
+ QXmlStreamStringRef(QString &&aString) noexcept : m_string(std::move(aString)), m_position(0), m_size(m_string.size()) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QXmlStreamStringRef(const QXmlStreamStringRef &other) // = default
: m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- QXmlStreamStringRef(QXmlStreamStringRef &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamStringRef(QXmlStreamStringRef &&other) noexcept // = default
: m_string(std::move(other.m_string)), m_position(other.m_position), m_size(other.m_size) {}
- QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamStringRef &operator=(QXmlStreamStringRef &&other) noexcept // = default
{ swap(other); return *this; }
-#endif
QXmlStreamStringRef &operator=(const QXmlStreamStringRef &other) // = default
{ m_string = other.m_string; m_position = other.m_position; m_size = other.m_size; return *this; }
inline ~QXmlStreamStringRef() {} // ### this prevents (or deprecates) all the move/copy special member functions,
@@ -79,7 +75,7 @@ public:
// ### Qt 5, since that would change the way its passed to functions. In Qt 6, remove all.
#endif // Qt < 6.0
- void swap(QXmlStreamStringRef &other) Q_DECL_NOTHROW
+ void swap(QXmlStreamStringRef &other) noexcept
{
qSwap(m_string, other.m_string);
qSwap(m_position, other.m_position);
@@ -108,11 +104,10 @@ class Q_CORE_EXPORT QXmlStreamAttribute {
public:
QXmlStreamAttribute();
QXmlStreamAttribute(const QString &qualifiedName, const QString &value);
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QXmlStreamAttribute(const QString &namespaceUri, const QString &name, const QString &value);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QXmlStreamAttribute(const QXmlStreamAttribute &);
-#ifdef Q_COMPILER_RVALUE_REFS
- QXmlStreamAttribute(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
+ QXmlStreamAttribute(QXmlStreamAttribute &&other) noexcept // = default;
: m_name(std::move(other.m_name)),
m_namespaceUri(std::move(other.m_namespaceUri)),
m_qualifiedName(std::move(other.m_qualifiedName)),
@@ -122,7 +117,7 @@ public:
{
other.reserved = nullptr;
}
- QXmlStreamAttribute &operator=(QXmlStreamAttribute &&other) Q_DECL_NOTHROW // = default;
+ QXmlStreamAttribute &operator=(QXmlStreamAttribute &&other) noexcept // = default;
{
m_name = std::move(other.m_name);
m_namespaceUri = std::move(other.m_namespaceUri);
@@ -132,7 +127,6 @@ public:
m_isDefault = other.m_isDefault;
return *this;
}
-#endif
QXmlStreamAttribute& operator=(const QXmlStreamAttribute &);
~QXmlStreamAttribute();
#endif // < Qt 6
@@ -197,23 +191,23 @@ class Q_CORE_EXPORT QXmlStreamNamespaceDeclaration {
friend class QXmlStreamReaderPrivate;
public:
QXmlStreamNamespaceDeclaration();
+ QXmlStreamNamespaceDeclaration(const QString &prefix, const QString &namespaceUri);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QXmlStreamNamespaceDeclaration(const QXmlStreamNamespaceDeclaration &);
- QXmlStreamNamespaceDeclaration(QXmlStreamNamespaceDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNamespaceDeclaration(QXmlStreamNamespaceDeclaration &&other) noexcept // = default
: m_prefix(std::move(other.m_prefix)),
m_namespaceUri(std::move(other.m_namespaceUri)),
reserved(other.reserved)
{
other.reserved = nullptr;
}
- QXmlStreamNamespaceDeclaration &operator=(QXmlStreamNamespaceDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNamespaceDeclaration &operator=(QXmlStreamNamespaceDeclaration &&other) noexcept // = default
{
m_prefix = std::move(other.m_prefix);
m_namespaceUri = std::move(other.m_namespaceUri);
qSwap(reserved, other.reserved);
return *this;
}
- QXmlStreamNamespaceDeclaration(const QString &prefix, const QString &namespaceUri);
~QXmlStreamNamespaceDeclaration();
QXmlStreamNamespaceDeclaration& operator=(const QXmlStreamNamespaceDeclaration &);
#endif // < Qt 6
@@ -242,7 +236,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
~QXmlStreamNotationDeclaration();
QXmlStreamNotationDeclaration(const QXmlStreamNotationDeclaration &);
- QXmlStreamNotationDeclaration(QXmlStreamNotationDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNotationDeclaration(QXmlStreamNotationDeclaration &&other) noexcept // = default
: m_name(std::move(other.m_name)),
m_systemId(std::move(other.m_systemId)),
m_publicId(std::move(other.m_publicId)),
@@ -251,7 +245,7 @@ public:
other.reserved = nullptr;
}
QXmlStreamNotationDeclaration& operator=(const QXmlStreamNotationDeclaration &);
- QXmlStreamNotationDeclaration &operator=(QXmlStreamNotationDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamNotationDeclaration &operator=(QXmlStreamNotationDeclaration &&other) noexcept // = default
{
m_name = std::move(other.m_name);
m_systemId = std::move(other.m_systemId);
@@ -287,7 +281,7 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
~QXmlStreamEntityDeclaration();
QXmlStreamEntityDeclaration(const QXmlStreamEntityDeclaration &);
- QXmlStreamEntityDeclaration(QXmlStreamEntityDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamEntityDeclaration(QXmlStreamEntityDeclaration &&other) noexcept // = default
: m_name(std::move(other.m_name)),
m_notationName(std::move(other.m_notationName)),
m_systemId(std::move(other.m_systemId)),
@@ -298,7 +292,7 @@ public:
other.reserved = nullptr;
}
QXmlStreamEntityDeclaration& operator=(const QXmlStreamEntityDeclaration &);
- QXmlStreamEntityDeclaration &operator=(QXmlStreamEntityDeclaration &&other) Q_DECL_NOTHROW // = default
+ QXmlStreamEntityDeclaration &operator=(QXmlStreamEntityDeclaration &&other) noexcept // = default
{
m_name = std::move(other.m_name);
m_notationName = std::move(other.m_notationName);
diff --git a/src/corelib/serialization/qxmlstream_p.h b/src/corelib/serialization/qxmlstream_p.h
index 61f501f81b..cde66a48a3 100644
--- a/src/corelib/serialization/qxmlstream_p.h
+++ b/src/corelib/serialization/qxmlstream_p.h
@@ -162,12 +162,12 @@ public:
const char *const QXmlStreamReader_Table::spell [] = {
- "end of file", 0, " ", "<", ">", "&", "#", "\'", "\"", "[",
+ "end of file", nullptr, " ", "<", ">", "&", "#", "\'", "\"", "[",
"]", "(", ")", "|", "=", "%", "/", ":", ";", ",",
"-", "+", "*", ".", "?", "!", "[a-zA-Z]", "[0-9]", "[CDATA[", "DOCTYPE",
"ELEMENT", "ATTLIST", "ENTITY", "NOTATION", "SYSTEM", "PUBLIC", "NDATA", "REQUIRED", "IMPLIED", "FIXED",
- "EMPTY", "ANY", "PCDATA", 0, 0, 0, 0, "CDATA", "ID", "IDREF",
- "IDREFS", "ENTITIES", "NMTOKEN", "NMTOKENS", "<?xml", "version", 0};
+ "EMPTY", "ANY", "PCDATA", nullptr, nullptr, nullptr, nullptr, "CDATA", "ID", "IDREF",
+ "IDREFS", "ENTITIES", "NMTOKEN", "NMTOKENS", "<?xml", "version", nullptr};
const short QXmlStreamReader_Table::lhs [] = {
57, 57, 59, 59, 59, 59, 59, 59, 59, 59,
@@ -645,7 +645,7 @@ template <typename T> class QXmlStreamSimpleStack {
T *data;
int tos, cap;
public:
- inline QXmlStreamSimpleStack():data(0), tos(-1), cap(0){}
+ inline QXmlStreamSimpleStack():data(nullptr), tos(-1), cap(0){}
inline ~QXmlStreamSimpleStack(){ if (data) free(data); }
inline void reserve(int extraCapacity) {
@@ -995,7 +995,7 @@ public:
int fastScanLiteralContent();
int fastScanSpace();
int fastScanContentCharList();
- int fastScanName(int *prefix = 0);
+ int fastScanName(int *prefix = nullptr);
inline int fastScanNMTOKEN();
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 7fb40392e7..ec746caae1 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -68,14 +68,14 @@ QT_BEGIN_NAMESPACE
struct QPropertyAssignment
{
QPropertyAssignment()
- : object(0), explicitlySet(true) {}
+ : object(nullptr), explicitlySet(true) {}
QPropertyAssignment(QObject *o, const QByteArray &n,
const QVariant &v, bool es = true)
: object(o), propertyName(n), value(v), explicitlySet(es)
{}
bool objectDeleted() const { return !object; }
- void write() const { Q_ASSERT(object != 0); object->setProperty(propertyName, value); }
+ void write() const { Q_ASSERT(object != nullptr); object->setProperty(propertyName, value); }
bool hasTarget(QObject *o, const QByteArray &pn) const
{ return object == o && propertyName == pn; }
@@ -99,8 +99,8 @@ public:
QStatePrivate();
~QStatePrivate();
- static QStatePrivate *get(QState *q) { return q ? q->d_func() : 0; }
- static const QStatePrivate *get(const QState *q) { return q? q->d_func() : 0; }
+ static QStatePrivate *get(QState *q) { return q ? q->d_func() : nullptr; }
+ static const QStatePrivate *get(const QState *q) { return q? q->d_func() : nullptr; }
QList<QAbstractState*> childStates() const;
QList<QHistoryState*> historyStates() const;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index ee3f7be279..44e4e151cb 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -140,6 +140,10 @@ QT_BEGIN_NAMESPACE
no error state applies to the erroneous state, the machine will stop
executing and an error message will be printed to the console.
+ \note Important: setting the \l{ChildMode} of a state machine to parallel (\l{ParallelStates})
+ results in an invalid state machine. It can only be set to (or kept as)
+ \l{ExclusiveStates}.
+
\sa QAbstractState, QAbstractTransition, QState, {The State Machine Framework}
*/
@@ -370,10 +374,11 @@ static QList<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *tra
QList<QAbstractState*> historyConfiguration = QHistoryStatePrivate::get(historyState)->configuration;
if (!historyConfiguration.isEmpty()) {
// There is a saved history, so apply that.
- targets.unite(historyConfiguration.toSet());
+ targets.unite(QSet<QAbstractState *>(historyConfiguration.constBegin(), historyConfiguration.constEnd()));
} else if (QAbstractTransition *defaultTransition = historyState->defaultTransition()) {
// No saved history, take all default transition targets.
- targets.unite(defaultTransition->targetStates().toSet());
+ const auto &targetStates = defaultTransition->targetStates();
+ targets.unite(QSet<QAbstractState *>(targetStates.constBegin(), targetStates.constEnd()));
} else {
// Woops, we found a history state without a default state. That's not valid!
QStateMachinePrivate *m = QStateMachinePrivate::get(historyState->machine());
@@ -384,7 +389,7 @@ static QList<QAbstractState *> getEffectiveTargetStates(QAbstractTransition *tra
}
}
- targetsList = targets.toList();
+ targetsList = targets.values();
cache->insert(transition, targetsList);
return targetsList;
}
@@ -518,7 +523,7 @@ bool QStateMachinePrivate::stateExitLessThan(QAbstractState *s1, QAbstractState
}
}
-QState *QStateMachinePrivate::findLCA(const QList<QAbstractState*> &states, bool onlyCompound) const
+QState *QStateMachinePrivate::findLCA(const QList<QAbstractState*> &states, bool onlyCompound)
{
if (states.isEmpty())
return 0;
@@ -537,10 +542,16 @@ QState *QStateMachinePrivate::findLCA(const QList<QAbstractState*> &states, bool
if (ok)
return anc;
}
- return 0;
+
+ // Oops, this should never happen! The state machine itself is a common ancestor of all states,
+ // no matter what. But, for the onlyCompound case: we probably have a state machine whose
+ // childMode is set to parallel, which is illegal. However, we're stuck with it (and with
+ // exposing this invalid/dangerous API to users), so recover in the least horrible way.
+ setError(QStateMachine::StateMachineChildModeSetToParallelError, q_func());
+ return q_func(); // make the statemachine the LCA/LCCA (which it should have been anyway)
}
-QState *QStateMachinePrivate::findLCCA(const QList<QAbstractState*> &states) const
+QState *QStateMachinePrivate::findLCCA(const QList<QAbstractState*> &states)
{
return findLCA(states, true);
}
@@ -740,7 +751,7 @@ QList<QAbstractState*> QStateMachinePrivate::computeExitSet(const QList<QAbstrac
{
Q_ASSERT(cache);
- QList<QAbstractState*> statesToExit_sorted = computeExitSet_Unordered(enabledTransitions, cache).toList();
+ QList<QAbstractState*> statesToExit_sorted = computeExitSet_Unordered(enabledTransitions, cache).values();
std::sort(statesToExit_sorted.begin(), statesToExit_sorted.end(), stateExitLessThan);
return statesToExit_sorted;
}
@@ -777,7 +788,7 @@ QSet<QAbstractState*> QStateMachinePrivate::computeExitSet_Unordered(QAbstractTr
// makes the state machine invalid.
if (error == QStateMachine::NoError)
setError(QStateMachine::NoCommonAncestorForTransitionError, t->sourceState());
- QList<QAbstractState *> lst = pendingErrorStates.toList();
+ QList<QAbstractState *> lst = pendingErrorStates.values();
lst.prepend(t->sourceState());
domain = findLCCA(lst);
@@ -879,7 +890,7 @@ QList<QAbstractState*> QStateMachinePrivate::computeEntrySet(const QList<QAbstra
pendingErrorStatesForDefaultEntry.clear();
}
- QList<QAbstractState*> statesToEnter_sorted = statesToEnter.toList();
+ QList<QAbstractState*> statesToEnter_sorted = statesToEnter.values();
std::sort(statesToEnter_sorted.begin(), statesToEnter_sorted.end(), stateEntryLessThan);
return statesToEnter_sorted;
}
@@ -902,7 +913,7 @@ function getTransitionDomain(t)
*/
QAbstractState *QStateMachinePrivate::getTransitionDomain(QAbstractTransition *t,
const QList<QAbstractState *> &effectiveTargetStates,
- CalculationCache *cache) const
+ CalculationCache *cache)
{
Q_ASSERT(cache);
@@ -1483,6 +1494,14 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta
errorString = QStateMachine::tr("No common ancestor for targets and source of transition from state '%1'")
.arg(currentContext->objectName());
break;
+
+ case QStateMachine::StateMachineChildModeSetToParallelError:
+ Q_ASSERT(currentContext != nullptr);
+
+ errorString = QStateMachine::tr("Child mode of state machine '%1' is not 'ExclusiveStates'.")
+ .arg(currentContext->objectName());
+ break;
+
default:
errorString = QStateMachine::tr("Unknown error");
};
@@ -1507,8 +1526,8 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta
addAncestorStatesToEnter(currentErrorState, rootState(), pendingErrorStates, pendingErrorStatesForDefaultEntry);
pendingErrorStates -= configuration;
} else {
- qWarning("Unrecoverable error detected in running state machine: %s",
- qPrintable(errorString));
+ qWarning("Unrecoverable error detected in running state machine: %ls",
+ qUtf16Printable(errorString));
q->stop();
}
}
@@ -2444,9 +2463,13 @@ QStateMachine::QStateMachine(QObject *parent)
/*!
\since 5.0
+ \deprecated
Constructs a new state machine with the given \a childMode
and \a parent.
+
+ \warning Do not set the \a childMode to anything else than \l{ExclusiveStates}, otherwise the
+ state machine is invalid, and might work incorrectly.
*/
QStateMachine::QStateMachine(QState::ChildMode childMode, QObject *parent)
: QState(*new QStateMachinePrivate, /*parentState=*/0)
@@ -2454,6 +2477,18 @@ QStateMachine::QStateMachine(QState::ChildMode childMode, QObject *parent)
Q_D(QStateMachine);
d->childMode = childMode;
setParent(parent); // See comment in constructor above
+
+ if (childMode != ExclusiveStates) {
+ //### FIXME for Qt6: remove this constructor completely, and hide the childMode property.
+ // Yes, the StateMachine itself is conceptually a state, but it should only expose a limited
+ // number of properties. The execution algorithm (in the URL below) treats a state machine
+ // as a state, but from an API point of view, it's questionable if the QStateMachine should
+ // inherit from QState.
+ //
+ // See function findLCCA in https://www.w3.org/TR/2014/WD-scxml-20140529/#AlgorithmforSCXMLInterpretation
+ // to see where setting childMode to parallel will break down.
+ qWarning() << "Invalid childMode for QStateMachine" << this;
+ }
}
/*!
@@ -2503,6 +2538,10 @@ QStateMachine::~QStateMachine()
state machine. Commonly, this could mean that one of the states has not been given
any parent or added to any machine. The context of this error is the source state of
the transition.
+ \value StateMachineChildModeSetToParallelError The machine's \l childMode
+ property was set to \l{QState::ParallelStates}. This is illegal.
+ Only states may be declared as parallel, not the state machine
+ itself. This enum value was added in Qt 5.14.
\sa setErrorState()
*/
@@ -2560,7 +2599,7 @@ void QStateMachine::setGlobalRestorePolicy(QState::RestorePolicy restorePolicy)
/*!
Adds the given \a state to this state machine. The state becomes a top-level
- state.
+ state and the state machine takes ownership of the state.
If the state is already in a different machine, it will first be removed
from its old machine, and then added to this machine.
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index e520285437..07781d09a4 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -106,7 +106,8 @@ public:
NoError,
NoInitialStateError,
NoDefaultStateInHistoryStateError,
- NoCommonAncestorForTransitionError
+ NoCommonAncestorForTransitionError,
+ StateMachineChildModeSetToParallelError
};
explicit QStateMachine(QObject *parent = nullptr);
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index f3366ca5f7..f140023e31 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -108,10 +108,10 @@ public:
~QStateMachinePrivate();
static QStateMachinePrivate *get(QStateMachine *q)
- { return q ? q->d_func() : 0; }
+ { return q ? q->d_func() : nullptr; }
- QState *findLCA(const QList<QAbstractState*> &states, bool onlyCompound = false) const;
- QState *findLCCA(const QList<QAbstractState*> &states) const;
+ QState *findLCA(const QList<QAbstractState*> &states, bool onlyCompound = false);
+ QState *findLCCA(const QList<QAbstractState*> &states);
static bool transitionStateEntryLessThan(QAbstractTransition *t1, QAbstractTransition *t2);
static bool stateEntryLessThan(QAbstractState *s1, QAbstractState *s2);
@@ -160,7 +160,7 @@ public:
QSet<QAbstractState*> &statesForDefaultEntry, CalculationCache *cache);
QAbstractState *getTransitionDomain(QAbstractTransition *t,
const QList<QAbstractState *> &effectiveTargetStates,
- CalculationCache *cache) const;
+ CalculationCache *cache);
void addDescendantStatesToEnter(QAbstractState *state,
QSet<QAbstractState*> &statesToEnter,
QSet<QAbstractState*> &statesForDefaultEntry);
@@ -218,18 +218,18 @@ public:
QByteArray prop;
// two overloads because friends can't have default arguments
friend uint qHash(const RestorableId &key, uint seed)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval<QByteArray>())))
+ noexcept(noexcept(qHash(std::declval<QByteArray>())))
{ return qHash(qMakePair(key.obj, key.prop), seed); }
- friend uint qHash(const RestorableId &key) Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key, 0U)))
+ friend uint qHash(const RestorableId &key) noexcept(noexcept(qHash(key, 0U)))
{ return qHash(key, 0U); }
- friend bool operator==(const RestorableId &lhs, const RestorableId &rhs) Q_DECL_NOTHROW
+ friend bool operator==(const RestorableId &lhs, const RestorableId &rhs) noexcept
{ return lhs.obj == rhs.obj && lhs.prop == rhs.prop; }
- friend bool operator!=(const RestorableId &lhs, const RestorableId &rhs) Q_DECL_NOTHROW
+ friend bool operator!=(const RestorableId &lhs, const RestorableId &rhs) noexcept
{ return !operator==(lhs, rhs); }
public:
- explicit RestorableId(QObject *o, QByteArray p) Q_DECL_NOTHROW : guard(o), obj(o), prop(qMove(p)) {}
- QObject *object() const Q_DECL_NOTHROW { return guard; }
- QByteArray propertyName() const Q_DECL_NOTHROW { return prop; }
+ explicit RestorableId(QObject *o, QByteArray p) noexcept : guard(o), obj(o), prop(std::move(p)) {}
+ QObject *object() const noexcept { return guard; }
+ QByteArray propertyName() const noexcept { return prop; }
};
QHash<QAbstractState*, QHash<RestorableId, QVariant> > registeredRestorablesForState;
bool hasRestorable(QAbstractState *state, QObject *object, const QByteArray &propertyName) const;
@@ -271,7 +271,7 @@ public:
QList<QAbstractAnimation*> handledAnimations;
QList<QAbstractAnimation*> localResetEndValues;
- void swap(InitializeAnimationResult &other) Q_DECL_NOTHROW
+ void swap(InitializeAnimationResult &other) noexcept
{
qSwap(handledAnimations, other.handledAnimations);
qSwap(localResetEndValues, other.localResetEndValues);
@@ -313,7 +313,7 @@ public:
DelayedEvent(QEvent *e, int tid)
: event(e), timerId(tid) {}
DelayedEvent()
- : event(0), timerId(0) {}
+ : event(nullptr), timerId(0) {}
};
QHash<int, DelayedEvent> delayedEvents;
QHash<int, int> timerIdToDelayedEventId;
diff --git a/src/corelib/tools/UNICODE_LICENSE.txt b/src/corelib/text/UNICODE_LICENSE.txt
index 1c73202b74..1c73202b74 100644
--- a/src/corelib/tools/UNICODE_LICENSE.txt
+++ b/src/corelib/text/UNICODE_LICENSE.txt
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index 2337d9f9c6..c50e087c10 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -40,7 +40,7 @@
#include "qbytearray.h"
#include "qbytearraymatcher.h"
-#include "qtools_p.h"
+#include "private/qtools_p.h"
#include "qstring.h"
#include "qlist.h"
#include "qlocale.h"
@@ -130,106 +130,6 @@ int qFindByteArray(
const char *haystack0, int haystackLen, int from,
const char *needle0, int needleLen);
-/*
- * This pair of functions is declared in qtools_p.h and is used by the Qt
- * containers to allocate memory and grow the memory block during append
- * operations.
- *
- * They take size_t parameters and return size_t so they will change sizes
- * according to the pointer width. However, knowing Qt containers store the
- * container size and element indexes in ints, these functions never return a
- * size larger than INT_MAX. This is done by casting the element count and
- * memory block size to int in several comparisons: the check for negative is
- * very fast on most platforms as the code only needs to check the sign bit.
- *
- * These functions return SIZE_MAX on overflow, which can be passed to malloc()
- * and will surely cause a NULL return (there's no way you can allocate a
- * memory block the size of your entire VM space).
- */
-
-/*!
- \internal
- \since 5.7
-
- Returns the memory block size for a container containing \a elementCount
- elements, each of \a elementSize bytes, plus a header of \a headerSize
- bytes. That is, this function returns \c
- {elementCount * elementSize + headerSize}
-
- but unlike the simple calculation, it checks for overflows during the
- multiplication and the addition.
-
- Both \a elementCount and \a headerSize can be zero, but \a elementSize
- cannot.
-
- This function returns SIZE_MAX (~0) on overflow or if the memory block size
- would not fit an int.
-*/
-size_t qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) Q_DECL_NOTHROW
-{
- unsigned count = unsigned(elementCount);
- unsigned size = unsigned(elementSize);
- unsigned header = unsigned(headerSize);
- Q_ASSERT(elementSize);
- Q_ASSERT(size == elementSize);
- Q_ASSERT(header == headerSize);
-
- if (Q_UNLIKELY(count != elementCount))
- return std::numeric_limits<size_t>::max();
-
- unsigned bytes;
- if (Q_UNLIKELY(mul_overflow(size, count, &bytes)) ||
- Q_UNLIKELY(add_overflow(bytes, header, &bytes)))
- return std::numeric_limits<size_t>::max();
- if (Q_UNLIKELY(int(bytes) < 0)) // catches bytes >= 2GB
- return std::numeric_limits<size_t>::max();
-
- return bytes;
-}
-
-/*!
- \internal
- \since 5.7
-
- Returns the memory block size and the number of elements that will fit in
- that block for a container containing \a elementCount elements, each of \a
- elementSize bytes, plus a header of \a headerSize bytes. This function
- assumes the container will grow and pre-allocates a growth factor.
-
- Both \a elementCount and \a headerSize can be zero, but \a elementSize
- cannot.
-
- This function returns SIZE_MAX (~0) on overflow or if the memory block size
- would not fit an int.
-
- \note The memory block may contain up to \a elementSize - 1 bytes more than
- needed.
-*/
-CalculateGrowingBlockSizeResult
-qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) Q_DECL_NOTHROW
-{
- CalculateGrowingBlockSizeResult result = {
- std::numeric_limits<size_t>::max(),std::numeric_limits<size_t>::max()
- };
-
- unsigned bytes = unsigned(qCalculateBlockSize(elementCount, elementSize, headerSize));
- if (int(bytes) < 0) // catches std::numeric_limits<size_t>::max()
- return result;
-
- unsigned morebytes = qNextPowerOfTwo(bytes);
- if (Q_UNLIKELY(int(morebytes) < 0)) {
- // catches morebytes == 2GB
- // grow by half the difference between bytes and morebytes
- bytes += (morebytes - bytes) / 2;
- } else {
- bytes = morebytes;
- }
-
- result.elementCount = (bytes - unsigned(headerSize)) / unsigned(elementSize);
- result.size = bytes;
- return result;
-}
-
/*****************************************************************************
Safe and portable C string functions; extensions to standard string.h
*****************************************************************************/
@@ -1297,7 +1197,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
Assigns \a other to this byte array and returns a reference to
this byte array.
*/
-QByteArray &QByteArray::operator=(const QByteArray & other) Q_DECL_NOTHROW
+QByteArray &QByteArray::operator=(const QByteArray & other) noexcept
{
other.d->ref.ref();
if (!d->ref.deref())
@@ -1553,6 +1453,15 @@ QByteArray &QByteArray::operator=(const char *str)
will apply to the character in the QByteArray from which you got
the reference.
+ \note Before Qt 5.14 it was possible to use this operator to access
+ a character at an out-of-bounds position in the byte array, and
+ then assign to such a position, causing the byte array to be
+ automatically resized. Furthermore, assigning a value to the
+ returned QByteRef would cause a detach of the byte array, even if the
+ byte array has been copied in the meanwhile (and the QByteRef kept
+ alive while the copy was taken). These behaviors are deprecated,
+ and will be changed in a future version of Qt.
+
\sa at()
*/
@@ -2179,7 +2088,7 @@ static inline QByteArray &qbytearray_insert(QByteArray *ba,
{
Q_ASSERT(pos >= 0);
- if (pos < 0 || len <= 0 || arr == 0)
+ if (pos < 0 || len <= 0 || arr == nullptr)
return *ba;
int oldsize = ba->size();
@@ -3298,10 +3207,10 @@ static QByteArray toCase_template(T &input, const uchar * table)
}
if (firstBad == e)
- return qMove(input);
+ return std::move(input);
// transform the rest
- QByteArray s = qMove(input); // will copy if T is const QByteArray
+ QByteArray s = std::move(input); // will copy if T is const QByteArray
char *b = s.begin(); // will detach if necessary
char *p = b + (firstBad - orig_begin);
e = b + s.size();
@@ -4152,10 +4061,9 @@ ushort QByteArray::toUShort(bool *ok, int base) const
double QByteArray::toDouble(bool *ok) const
{
- QByteArray nulled = nulTerminated();
bool nonNullOk = false;
int processed = 0;
- double d = qt_asciiToDouble(nulled.constData(), nulled.length(),
+ double d = qt_asciiToDouble(constData(), size(),
nonNullOk, processed, WhitespacesAllowed);
if (ok)
*ok = nonNullOk;
@@ -4883,7 +4791,7 @@ static void q_toPercentEncoding(QByteArray *ba, const char *dontEncode, const ch
QByteArray input = *ba;
int len = input.count();
const char *inputData = input.constData();
- char *output = 0;
+ char *output = nullptr;
int length = 0;
for (int i = 0; i < len; ++i) {
@@ -4923,7 +4831,7 @@ void q_toPercentEncoding(QByteArray *ba, const char *exclude, const char *includ
void q_normalizePercentEncoding(QByteArray *ba, const char *exclude)
{
q_fromPercentEncoding(ba, '%');
- q_toPercentEncoding(ba, exclude, 0, '%');
+ q_toPercentEncoding(ba, exclude, nullptr, '%');
}
/*!
@@ -5071,4 +4979,41 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA
\sa QStringLiteral
*/
+namespace QtPrivate {
+namespace DeprecatedRefClassBehavior {
+void warn(WarningType w, EmittingClass c)
+{
+ static const char deprecatedBehaviorString[] =
+ "The corresponding behavior is deprecated, and will be changed"
+ " in a future version of Qt.";
+
+ const char *emittingClassName = nullptr;
+ const char *containerClassName = nullptr;
+
+ switch (c) {
+ case EmittingClass::QByteRef:
+ emittingClassName = "QByteRef";
+ containerClassName = "QByteArray";
+ break;
+ case EmittingClass::QCharRef:
+ emittingClassName = "QCharRef";
+ containerClassName = "QString";
+ break;
+ }
+
+ switch (w) {
+ case WarningType::OutOfRange:
+ qWarning("Using %s with an index pointing outside the valid range of a %s. %s",
+ emittingClassName, containerClassName, deprecatedBehaviorString);
+ break;
+ case WarningType::DelayedDetach:
+ qWarning("Using %s with on a %s that is not already detached. %s",
+ emittingClassName, containerClassName, deprecatedBehaviorString);
+ break;
+ }
+}
+} // namespace DeprecatedRefClassBehavior
+} // namespace QtPrivate
+
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/text/qbytearray.h
index 8ee3a29ecc..7c571706d8 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/text/qbytearray.h
@@ -168,22 +168,20 @@ public:
};
Q_DECLARE_FLAGS(Base64Options, Base64Option)
- inline QByteArray() Q_DECL_NOTHROW;
+ inline QByteArray() noexcept;
QByteArray(const char *, int size = -1);
QByteArray(int size, char c);
QByteArray(int size, Qt::Initialization);
- inline QByteArray(const QByteArray &) Q_DECL_NOTHROW;
+ inline QByteArray(const QByteArray &) noexcept;
inline ~QByteArray();
- QByteArray &operator=(const QByteArray &) Q_DECL_NOTHROW;
+ QByteArray &operator=(const QByteArray &) noexcept;
QByteArray &operator=(const char *str);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QByteArray(QByteArray && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
- inline QByteArray &operator=(QByteArray &&other) Q_DECL_NOTHROW
+ inline QByteArray(QByteArray && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
+ inline QByteArray &operator=(QByteArray &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QByteArray &other) Q_DECL_NOTHROW
+ inline void swap(QByteArray &other) noexcept
{ qSwap(d, other.d); }
inline int size() const;
@@ -211,8 +209,8 @@ public:
inline char at(int i) const;
inline char operator[](int i) const;
inline char operator[](uint i) const;
- inline QByteRef operator[](int i);
- inline QByteRef operator[](uint i);
+ Q_REQUIRED_RESULT inline QByteRef operator[](int i);
+ Q_REQUIRED_RESULT inline QByteRef operator[](uint i);
Q_REQUIRED_RESULT char front() const { return at(0); }
Q_REQUIRED_RESULT inline QByteRef front();
Q_REQUIRED_RESULT char back() const { return at(size() - 1); }
@@ -472,7 +470,7 @@ public:
Q_DECLARE_OPERATORS_FOR_FLAGS(QByteArray::Base64Options)
-inline QByteArray::QByteArray() Q_DECL_NOTHROW : d(Data::sharedNull()) { }
+inline QByteArray::QByteArray() noexcept : d(Data::sharedNull()) { }
inline QByteArray::~QByteArray() { if (!d->ref.deref()) Data::deallocate(d); }
inline int QByteArray::size() const
{ return d->size; }
@@ -502,7 +500,7 @@ inline void QByteArray::detach()
{ if (d->ref.isShared() || (d->offset != sizeof(QByteArrayData))) reallocData(uint(d->size) + 1u, d->detachFlags()); }
inline bool QByteArray::isDetached() const
{ return !d->ref.isShared(); }
-inline QByteArray::QByteArray(const QByteArray &a) Q_DECL_NOTHROW : d(a.d)
+inline QByteArray::QByteArray(const QByteArray &a) noexcept : d(a.d)
{ d->ref.ref(); }
inline int QByteArray::capacity() const
@@ -530,7 +528,27 @@ inline void QByteArray::squeeze()
}
}
-class Q_CORE_EXPORT QByteRef {
+namespace QtPrivate {
+namespace DeprecatedRefClassBehavior {
+ enum class EmittingClass {
+ QByteRef,
+ QCharRef,
+ };
+
+ enum class WarningType {
+ OutOfRange,
+ DelayedDetach,
+ };
+
+ Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void warn(WarningType w, EmittingClass c);
+} // namespace DeprecatedAssignmentOperatorBehavior
+} // namespace QtPrivate
+
+class
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+Q_CORE_EXPORT
+#endif
+QByteRef { // ### Qt 7: remove
QByteArray &a;
int i;
inline QByteRef(QByteArray &array, int idx)
@@ -538,13 +556,37 @@ class Q_CORE_EXPORT QByteRef {
friend class QByteArray;
public:
inline operator char() const
- { return i < a.d->size ? a.d->data()[i] : char(0); }
+ {
+ using namespace QtPrivate::DeprecatedRefClassBehavior;
+ if (Q_LIKELY(i < a.d->size))
+ return a.d->data()[i];
+#ifdef QT_DEBUG
+ warn(WarningType::OutOfRange, EmittingClass::QByteRef);
+#endif
+ return char(0);
+ }
inline QByteRef &operator=(char c)
- { if (i >= a.d->size) a.expand(i); else a.detach();
- a.d->data()[i] = c; return *this; }
+ {
+ using namespace QtPrivate::DeprecatedRefClassBehavior;
+ if (Q_UNLIKELY(i >= a.d->size)) {
+#ifdef QT_DEBUG
+ warn(WarningType::OutOfRange, EmittingClass::QByteRef);
+#endif
+ a.expand(i);
+ } else {
+#ifdef QT_DEBUG
+ if (Q_UNLIKELY(!a.isDetached()))
+ warn(WarningType::DelayedDetach, EmittingClass::QByteRef);
+#endif
+ a.detach();
+ }
+ a.d->data()[i] = c;
+ return *this;
+ }
inline QByteRef &operator=(const QByteRef &c)
- { if (i >= a.d->size) a.expand(i); else a.detach();
- a.d->data()[i] = c.a.d->data()[c.i]; return *this; }
+ {
+ return operator=(char(c));
+ }
inline bool operator==(char c) const
{ return a.d->data()[i] == c; }
inline bool operator!=(char c) const
@@ -560,9 +602,9 @@ public:
};
inline QByteRef QByteArray::operator[](int i)
-{ Q_ASSERT(i >= 0); return QByteRef(*this, i); }
+{ Q_ASSERT(i >= 0); detach(); return QByteRef(*this, i); }
inline QByteRef QByteArray::operator[](uint i)
-{ return QByteRef(*this, i); }
+{ detach(); return QByteRef(*this, i); }
inline QByteRef QByteArray::front() { return operator[](0); }
inline QByteRef QByteArray::back() { return operator[](size() - 1); }
inline QByteArray::iterator QByteArray::begin()
@@ -617,41 +659,41 @@ inline int QByteArray::compare(const QByteArray &a, Qt::CaseSensitivity cs) cons
return cs == Qt::CaseSensitive ? qstrcmp(*this, a) :
qstrnicmp(data(), size(), a.data(), a.size());
}
-inline bool operator==(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator==(const QByteArray &a1, const QByteArray &a2) noexcept
{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
-inline bool operator==(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator==(const QByteArray &a1, const char *a2) noexcept
{ return a2 ? qstrcmp(a1,a2) == 0 : a1.isEmpty(); }
-inline bool operator==(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator==(const char *a1, const QByteArray &a2) noexcept
{ return a1 ? qstrcmp(a1,a2) == 0 : a2.isEmpty(); }
-inline bool operator!=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator!=(const QByteArray &a1, const QByteArray &a2) noexcept
{ return !(a1==a2); }
-inline bool operator!=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator!=(const QByteArray &a1, const char *a2) noexcept
{ return a2 ? qstrcmp(a1,a2) != 0 : !a1.isEmpty(); }
-inline bool operator!=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator!=(const char *a1, const QByteArray &a2) noexcept
{ return a1 ? qstrcmp(a1,a2) != 0 : !a2.isEmpty(); }
-inline bool operator<(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) < 0; }
- inline bool operator<(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+ inline bool operator<(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) < 0; }
-inline bool operator<(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) < 0; }
-inline bool operator<=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<=(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) <= 0; }
-inline bool operator<=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator<=(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) <= 0; }
-inline bool operator<=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator<=(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) <= 0; }
-inline bool operator>(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) > 0; }
-inline bool operator>(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator>(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) > 0; }
-inline bool operator>(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) > 0; }
-inline bool operator>=(const QByteArray &a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>=(const QByteArray &a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) >= 0; }
-inline bool operator>=(const QByteArray &a1, const char *a2) Q_DECL_NOTHROW
+inline bool operator>=(const QByteArray &a1, const char *a2) noexcept
{ return qstrcmp(a1, a2) >= 0; }
-inline bool operator>=(const char *a1, const QByteArray &a2) Q_DECL_NOTHROW
+inline bool operator>=(const char *a1, const QByteArray &a2) noexcept
{ return qstrcmp(a1, a2) >= 0; }
#if !defined(QT_USE_QSTRINGBUILDER)
inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2)
diff --git a/src/corelib/tools/qbytearray_p.h b/src/corelib/text/qbytearray_p.h
index 6ebff739cd..3c6257f786 100644
--- a/src/corelib/tools/qbytearray_p.h
+++ b/src/corelib/text/qbytearray_p.h
@@ -52,7 +52,7 @@
//
#include <QtCore/qbytearray.h>
-#include "qtools_p.h"
+#include "private/qtools_p.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/qbytearraylist.cpp b/src/corelib/text/qbytearraylist.cpp
index d04555ed4d..d04555ed4d 100644
--- a/src/corelib/tools/qbytearraylist.cpp
+++ b/src/corelib/text/qbytearraylist.cpp
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/text/qbytearraylist.h
index 1261e1757c..0250b649b8 100644
--- a/src/corelib/tools/qbytearraylist.h
+++ b/src/corelib/text/qbytearraylist.h
@@ -48,8 +48,11 @@
QT_BEGIN_NAMESPACE
+#if !defined(QT_NO_JAVA_STYLE_ITERATORS)
typedef QListIterator<QByteArray> QByteArrayListIterator;
typedef QMutableListIterator<QByteArray> QMutableByteArrayListIterator;
+#endif
+
#ifndef Q_CLANG_QDOC
typedef QList<QByteArray> QByteArrayList;
diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/text/qbytearraymatcher.cpp
index 72f0e0519d..72e09226af 100644
--- a/src/corelib/tools/qbytearraymatcher.cpp
+++ b/src/corelib/text/qbytearraymatcher.cpp
@@ -116,9 +116,9 @@ static inline int bm_find(const uchar *cc, int l, int index, const uchar *puc, u
Call setPattern() to give it a pattern to match.
*/
QByteArrayMatcher::QByteArrayMatcher()
- : d(0)
+ : d(nullptr)
{
- p.p = 0;
+ p.p = nullptr;
p.l = 0;
memset(p.q_skiptable, 0, sizeof(p.q_skiptable));
}
@@ -129,7 +129,7 @@ QByteArrayMatcher::QByteArrayMatcher()
the destructor does not delete \a pattern.
*/
QByteArrayMatcher::QByteArrayMatcher(const char *pattern, int length)
- : d(0)
+ : d(nullptr)
{
p.p = reinterpret_cast<const uchar *>(pattern);
p.l = length;
@@ -141,7 +141,7 @@ QByteArrayMatcher::QByteArrayMatcher(const char *pattern, int length)
Call indexIn() to perform a search.
*/
QByteArrayMatcher::QByteArrayMatcher(const QByteArray &pattern)
- : d(0), q_pattern(pattern)
+ : d(nullptr), q_pattern(pattern)
{
p.p = reinterpret_cast<const uchar *>(pattern.constData());
p.l = pattern.size();
@@ -152,7 +152,7 @@ QByteArrayMatcher::QByteArrayMatcher(const QByteArray &pattern)
Copies the \a other byte array matcher to this byte array matcher.
*/
QByteArrayMatcher::QByteArrayMatcher(const QByteArrayMatcher &other)
- : d(0)
+ : d(nullptr)
{
operator=(other);
}
@@ -404,7 +404,7 @@ int qFindByteArray(
/*!
\internal
*/
-int QStaticByteArrayMatcherBase::indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const Q_DECL_NOTHROW
+int QStaticByteArrayMatcherBase::indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const noexcept
{
if (from < 0)
from = 0;
diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h
index dafaea9c12..0eedfc1d20 100644
--- a/src/corelib/tools/qbytearraymatcher.h
+++ b/src/corelib/text/qbytearraymatcher.h
@@ -90,15 +90,15 @@ class QStaticByteArrayMatcherBase
uchar data[256];
} m_skiptable;
protected:
- explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcherBase(const char *pattern, uint n) Q_DECL_NOTHROW
+ explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcherBase(const char *pattern, uint n) noexcept
: m_skiptable(generate(pattern, n)) {}
// compiler-generated copy/more ctors/assignment operators are ok!
// compiler-generated dtor is ok!
- Q_CORE_EXPORT int indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const Q_DECL_NOTHROW;
+ Q_CORE_EXPORT int indexOfIn(const char *needle, uint nlen, const char *haystack, int hlen, int from) const noexcept;
private:
- static Q_DECL_RELAXED_CONSTEXPR Skiptable generate(const char *pattern, uint n) Q_DECL_NOTHROW
+ static Q_DECL_RELAXED_CONSTEXPR Skiptable generate(const char *pattern, uint n) noexcept
{
const auto uchar_max = (std::numeric_limits<uchar>::max)();
uchar max = n > uchar_max ? uchar_max : n;
@@ -140,23 +140,23 @@ class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase
char m_pattern[N];
Q_STATIC_ASSERT_X(N > 2, "QStaticByteArrayMatcher makes no sense for finding a single-char pattern");
public:
- explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher(const char (&patternToMatch)[N]) Q_DECL_NOTHROW
+ explicit Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher(const char (&patternToMatch)[N]) noexcept
: QStaticByteArrayMatcherBase(patternToMatch, N - 1), m_pattern()
{
for (uint i = 0; i < N; ++i)
m_pattern[i] = patternToMatch[i];
}
- int indexIn(const QByteArray &haystack, int from = 0) const Q_DECL_NOTHROW
+ int indexIn(const QByteArray &haystack, int from = 0) const noexcept
{ return this->indexOfIn(m_pattern, N - 1, haystack.data(), haystack.size(), from); }
- int indexIn(const char *haystack, int hlen, int from = 0) const Q_DECL_NOTHROW
+ int indexIn(const char *haystack, int hlen, int from = 0) const noexcept
{ return this->indexOfIn(m_pattern, N - 1, haystack, hlen, from); }
QByteArray pattern() const { return QByteArray(m_pattern, int(N - 1)); }
};
template <uint N>
-Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher<N> qMakeStaticByteArrayMatcher(const char (&pattern)[N]) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher<N> qMakeStaticByteArrayMatcher(const char (&pattern)[N]) noexcept
{ return QStaticByteArrayMatcher<N>(pattern); }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qbytedata_p.h b/src/corelib/text/qbytedata_p.h
index 8331be112d..b319d75811 100644
--- a/src/corelib/tools/qbytedata_p.h
+++ b/src/corelib/text/qbytedata_p.h
@@ -199,7 +199,7 @@ public:
}
// the number of QByteArrays
- inline qint64 bufferCount() const
+ inline int bufferCount() const
{
return buffers.length();
}
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/text/qchar.cpp
index 47c853084b..9b03a93278 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/text/qchar.cpp
@@ -61,6 +61,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QLatin1Char
\inmodule QtCore
+ \reentrant
\brief The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
\ingroup string-processing
@@ -572,6 +573,7 @@ QT_BEGIN_NAMESPACE
\value Null A QChar with this value isNull().
\value Tabulation Character tabulation.
\value LineFeed
+ \value FormFeed
\value CarriageReturn
\value Space
\value Nbsp Non-breaking space.
@@ -733,7 +735,7 @@ QT_BEGIN_NAMESPACE
Note that this gives no indication of whether the character is
available in a particular font.
*/
-bool QChar::isPrint(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isPrint(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -766,7 +768,7 @@ bool QChar::isPrint(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -792,7 +794,7 @@ bool QT_FASTCALL QChar::isSpace_helper(uint ucs4) Q_DECL_NOTHROW
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a mark (Mark_* categories); otherwise returns \c false.
*/
-bool QChar::isMark(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isMark(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -816,7 +818,7 @@ bool QChar::isMark(uint ucs4) Q_DECL_NOTHROW
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a punctuation mark (Punctuation_* categories); otherwise returns \c false.
*/
-bool QChar::isPunct(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isPunct(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -844,7 +846,7 @@ bool QChar::isPunct(uint ucs4) Q_DECL_NOTHROW
Returns \c true if the UCS-4-encoded character specified by \a ucs4 is
a symbol (Symbol_* categories); otherwise returns \c false.
*/
-bool QChar::isSymbol(uint ucs4) Q_DECL_NOTHROW
+bool QChar::isSymbol(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -874,7 +876,7 @@ bool QChar::isSymbol(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -909,7 +911,7 @@ bool QT_FASTCALL QChar::isLetter_helper(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -938,7 +940,7 @@ bool QT_FASTCALL QChar::isNumber_helper(uint ucs4) Q_DECL_NOTHROW
/*!
\internal
*/
-bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW
+bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -1101,7 +1103,7 @@ bool QT_FASTCALL QChar::isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW
Returns the numeric value of the digit specified by the UCS-4-encoded
character, \a ucs4, or -1 if the character is not a digit.
*/
-int QChar::digitValue(uint ucs4) Q_DECL_NOTHROW
+int QChar::digitValue(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return -1;
@@ -1118,7 +1120,7 @@ int QChar::digitValue(uint ucs4) Q_DECL_NOTHROW
\overload
Returns the category of the UCS-4-encoded character specified by \a ucs4.
*/
-QChar::Category QChar::category(uint ucs4) Q_DECL_NOTHROW
+QChar::Category QChar::category(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Other_NotAssigned;
@@ -1135,7 +1137,7 @@ QChar::Category QChar::category(uint ucs4) Q_DECL_NOTHROW
\overload
Returns the direction of the UCS-4-encoded character specified by \a ucs4.
*/
-QChar::Direction QChar::direction(uint ucs4) Q_DECL_NOTHROW
+QChar::Direction QChar::direction(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::DirL;
@@ -1158,7 +1160,7 @@ QChar::Direction QChar::direction(uint ucs4) Q_DECL_NOTHROW
character specified by \a ucs4
(needed for certain languages such as Arabic or Syriac).
*/
-QChar::JoiningType QChar::joiningType(uint ucs4) Q_DECL_NOTHROW
+QChar::JoiningType QChar::joiningType(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Joining_None;
@@ -1181,7 +1183,7 @@ QChar::JoiningType QChar::joiningType(uint ucs4) Q_DECL_NOTHROW
Returns information about the joining properties of the UCS-4-encoded
character specified by \a ucs4 (needed for certain languages such as Arabic).
*/
-QChar::Joining QChar::joining(uint ucs4) Q_DECL_NOTHROW
+QChar::Joining QChar::joining(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::OtherJoining;
@@ -1217,7 +1219,7 @@ QChar::Joining QChar::joining(uint ucs4) Q_DECL_NOTHROW
\sa mirroredChar()
*/
-bool QChar::hasMirrored(uint ucs4) Q_DECL_NOTHROW
+bool QChar::hasMirrored(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return false;
@@ -1299,7 +1301,7 @@ bool QChar::hasMirrored(uint ucs4) Q_DECL_NOTHROW
\sa hasMirrored()
*/
-uint QChar::mirroredChar(uint ucs4) Q_DECL_NOTHROW
+uint QChar::mirroredChar(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
@@ -1339,7 +1341,7 @@ static const unsigned short * QT_FASTCALL decompositionHelper
if (index == 0xffff) {
*length = 0;
*tag = QChar::NoDecomposition;
- return 0;
+ return nullptr;
}
const unsigned short *decomposition = uc_decomposition_map+index;
@@ -1383,7 +1385,7 @@ QString QChar::decomposition(uint ucs4)
Returns the tag defining the composition of the UCS-4-encoded character
specified by \a ucs4. Returns QChar::NoDecomposition if no decomposition exists.
*/
-QChar::Decomposition QChar::decompositionTag(uint ucs4) Q_DECL_NOTHROW
+QChar::Decomposition QChar::decompositionTag(uint ucs4) noexcept
{
if (ucs4 >= Hangul_SBase && ucs4 < Hangul_SBase + Hangul_SCount)
return QChar::Canonical;
@@ -1409,7 +1411,7 @@ QChar::Decomposition QChar::decompositionTag(uint ucs4) Q_DECL_NOTHROW
Returns the combining class for the UCS-4-encoded character specified by
\a ucs4, as defined in the Unicode standard.
*/
-unsigned char QChar::combiningClass(uint ucs4) Q_DECL_NOTHROW
+unsigned char QChar::combiningClass(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return 0;
@@ -1430,7 +1432,7 @@ unsigned char QChar::combiningClass(uint ucs4) Q_DECL_NOTHROW
Returns the Unicode script property value for the character specified in
its UCS-4-encoded form as \a ucs4.
*/
-QChar::Script QChar::script(uint ucs4) Q_DECL_NOTHROW
+QChar::Script QChar::script(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Script_Unknown;
@@ -1448,7 +1450,7 @@ QChar::Script QChar::script(uint ucs4) Q_DECL_NOTHROW
Returns the Unicode version that introduced the character specified in
its UCS-4-encoded form as \a ucs4.
*/
-QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) Q_DECL_NOTHROW
+QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return QChar::Unicode_Unassigned;
@@ -1458,24 +1460,24 @@ QChar::UnicodeVersion QChar::unicodeVersion(uint ucs4) Q_DECL_NOTHROW
/*!
Returns the most recent supported Unicode version.
*/
-QChar::UnicodeVersion QChar::currentUnicodeVersion() Q_DECL_NOTHROW
+QChar::UnicodeVersion QChar::currentUnicodeVersion() noexcept
{
return UNICODE_DATA_VERSION;
}
-template <typename Traits, typename T>
-Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc) Q_DECL_NOTHROW
+template <typename T>
+Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc, QUnicodeTables::Case which) noexcept
{
- const QUnicodeTables::Properties *prop = qGetProp(uc);
+ const auto fold = qGetProp(uc)->cases[which];
- if (Q_UNLIKELY(Traits::caseSpecial(prop))) {
- const ushort *specialCase = specialCaseMap + Traits::caseDiff(prop);
+ if (Q_UNLIKELY(fold.special)) {
+ const ushort *specialCase = specialCaseMap + fold.diff;
// so far, there are no special cases beyond BMP (guaranteed by the qunicodetables generator)
return *specialCase == 1 ? specialCase[1] : uc;
}
- return uc + Traits::caseDiff(prop);
+ return uc + fold.diff;
}
/*!
@@ -1491,11 +1493,11 @@ Q_DECL_CONST_FUNCTION static inline T convertCase_helper(T uc) Q_DECL_NOTHROW
by \a ucs4 if the character is uppercase or titlecase; otherwise returns
the character itself.
*/
-uint QChar::toLower(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toLower(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return convertCase_helper<QUnicodeTables::LowercaseTraits>(ucs4);
+ return convertCase_helper(ucs4, QUnicodeTables::LowerCase);
}
/*!
@@ -1511,11 +1513,11 @@ uint QChar::toLower(uint ucs4) Q_DECL_NOTHROW
by \a ucs4 if the character is lowercase or titlecase; otherwise returns
the character itself.
*/
-uint QChar::toUpper(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toUpper(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return convertCase_helper<QUnicodeTables::UppercaseTraits>(ucs4);
+ return convertCase_helper(ucs4, QUnicodeTables::UpperCase);
}
/*!
@@ -1531,11 +1533,11 @@ uint QChar::toUpper(uint ucs4) Q_DECL_NOTHROW
by \a ucs4 if the character is lowercase or uppercase; otherwise returns
the character itself.
*/
-uint QChar::toTitleCase(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toTitleCase(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return convertCase_helper<QUnicodeTables::TitlecaseTraits>(ucs4);
+ return convertCase_helper(ucs4, QUnicodeTables::TitleCase);
}
static inline uint foldCase(const ushort *ch, const ushort *start)
@@ -1543,24 +1545,24 @@ static inline uint foldCase(const ushort *ch, const ushort *start)
uint ucs4 = *ch;
if (QChar::isLowSurrogate(ucs4) && ch > start && QChar::isHighSurrogate(*(ch - 1)))
ucs4 = QChar::surrogateToUcs4(*(ch - 1), ucs4);
- return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
+ return convertCase_helper(ucs4, QUnicodeTables::CaseFold);
}
-static inline uint foldCase(uint ch, uint &last) Q_DECL_NOTHROW
+static inline uint foldCase(uint ch, uint &last) noexcept
{
uint ucs4 = ch;
if (QChar::isLowSurrogate(ucs4) && QChar::isHighSurrogate(last))
ucs4 = QChar::surrogateToUcs4(last, ucs4);
last = ch;
- return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
+ return convertCase_helper(ucs4, QUnicodeTables::CaseFold);
}
-static inline ushort foldCase(ushort ch) Q_DECL_NOTHROW
+static inline ushort foldCase(ushort ch) noexcept
{
- return convertCase_helper<QUnicodeTables::CasefoldTraits>(ch);
+ return convertCase_helper(ch, QUnicodeTables::CaseFold);
}
-static inline QChar foldCase(QChar ch) Q_DECL_NOTHROW
+static inline QChar foldCase(QChar ch) noexcept
{
return QChar(foldCase(ch.unicode()));
}
@@ -1577,11 +1579,11 @@ static inline QChar foldCase(QChar ch) Q_DECL_NOTHROW
Returns the case folded equivalent of the UCS-4-encoded character specified
by \a ucs4. For most Unicode characters this is the same as toLower().
*/
-uint QChar::toCaseFolded(uint ucs4) Q_DECL_NOTHROW
+uint QChar::toCaseFolded(uint ucs4) noexcept
{
if (ucs4 > LastValidCodePoint)
return ucs4;
- return convertCase_helper<QUnicodeTables::CasefoldTraits>(ucs4);
+ return convertCase_helper(ucs4, QUnicodeTables::CaseFold);
}
/*!
@@ -1885,11 +1887,11 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, int from)
QChar *d = s.data();
// ligatureHelper() never changes planes
if (QChar::requiresSurrogates(ligature)) {
- d[starter] = QChar::highSurrogate(ligature);
- d[starter + 1] = QChar::lowSurrogate(ligature);
+ d[starter] = QChar(QChar::highSurrogate(ligature));
+ d[starter + 1] = QChar(QChar::lowSurrogate(ligature));
s.remove(i, 2);
} else {
- d[starter] = ligature;
+ d[starter] = QChar(ligature);
s.remove(i, 1);
}
continue;
@@ -1962,16 +1964,16 @@ static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, in
int p = pos;
// exchange characters
if (!QChar::requiresSurrogates(u2)) {
- uc[p++] = u2;
+ uc[p++] = QChar(u2);
} else {
- uc[p++] = QChar::highSurrogate(u2);
- uc[p++] = QChar::lowSurrogate(u2);
+ uc[p++] = QChar(QChar::highSurrogate(u2));
+ uc[p++] = QChar(QChar::lowSurrogate(u2));
}
if (!QChar::requiresSurrogates(u1)) {
- uc[p++] = u1;
+ uc[p++] = QChar(u1);
} else {
- uc[p++] = QChar::highSurrogate(u1);
- uc[p++] = QChar::lowSurrogate(u1);
+ uc[p++] = QChar(QChar::highSurrogate(u1));
+ uc[p++] = QChar(QChar::lowSurrogate(u1));
}
if (pos > 0)
--pos;
diff --git a/src/corelib/tools/qchar.h b/src/corelib/text/qchar.h
index 8590b91ba3..f67a7ea90a 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/text/qchar.h
@@ -50,14 +50,27 @@ class QString;
struct QLatin1Char
{
public:
- Q_DECL_CONSTEXPR inline explicit QLatin1Char(char c) Q_DECL_NOTHROW : ch(c) {}
- Q_DECL_CONSTEXPR inline char toLatin1() const Q_DECL_NOTHROW { return ch; }
- Q_DECL_CONSTEXPR inline ushort unicode() const Q_DECL_NOTHROW { return ushort(uchar(ch)); }
+ Q_DECL_CONSTEXPR inline explicit QLatin1Char(char c) noexcept : ch(c) {}
+ Q_DECL_CONSTEXPR inline char toLatin1() const noexcept { return ch; }
+ Q_DECL_CONSTEXPR inline ushort unicode() const noexcept { return ushort(uchar(ch)); }
private:
char ch;
};
+Q_DECL_CONSTEXPR inline bool operator==(char lhs, QLatin1Char rhs) noexcept { return lhs == rhs.toLatin1(); }
+Q_DECL_CONSTEXPR inline bool operator!=(char lhs, QLatin1Char rhs) noexcept { return lhs != rhs.toLatin1(); }
+Q_DECL_CONSTEXPR inline bool operator<=(char lhs, QLatin1Char rhs) noexcept { return lhs <= rhs.toLatin1(); }
+Q_DECL_CONSTEXPR inline bool operator>=(char lhs, QLatin1Char rhs) noexcept { return lhs >= rhs.toLatin1(); }
+Q_DECL_CONSTEXPR inline bool operator< (char lhs, QLatin1Char rhs) noexcept { return lhs < rhs.toLatin1(); }
+Q_DECL_CONSTEXPR inline bool operator> (char lhs, QLatin1Char rhs) noexcept { return lhs > rhs.toLatin1(); }
+
+Q_DECL_CONSTEXPR inline bool operator==(QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() == rhs; }
+Q_DECL_CONSTEXPR inline bool operator!=(QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() != rhs; }
+Q_DECL_CONSTEXPR inline bool operator<=(QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() <= rhs; }
+Q_DECL_CONSTEXPR inline bool operator>=(QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() >= rhs; }
+Q_DECL_CONSTEXPR inline bool operator< (QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() < rhs; }
+Q_DECL_CONSTEXPR inline bool operator> (QLatin1Char lhs, char rhs) noexcept { return lhs.toLatin1() > rhs; }
class Q_CORE_EXPORT QChar {
public:
@@ -65,6 +78,7 @@ public:
Null = 0x0000,
Tabulation = 0x0009,
LineFeed = 0x000a,
+ FormFeed = 0x000c,
CarriageReturn = 0x000d,
Space = 0x0020,
Nbsp = 0x00a0,
@@ -78,30 +92,30 @@ public:
LastValidCodePoint = 0x10ffff
};
- Q_DECL_CONSTEXPR QChar() Q_DECL_NOTHROW : ucs(0) {}
- Q_DECL_CONSTEXPR QChar(ushort rc) Q_DECL_NOTHROW : ucs(rc) {} // implicit
- Q_DECL_CONSTEXPR QChar(uchar c, uchar r) Q_DECL_NOTHROW : ucs(ushort((r << 8) | c)) {}
- Q_DECL_CONSTEXPR QChar(short rc) Q_DECL_NOTHROW : ucs(ushort(rc)) {} // implicit
- Q_DECL_CONSTEXPR QChar(uint rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
- Q_DECL_CONSTEXPR QChar(int rc) Q_DECL_NOTHROW : ucs(ushort(rc & 0xffff)) {}
- Q_DECL_CONSTEXPR QChar(SpecialCharacter s) Q_DECL_NOTHROW : ucs(ushort(s)) {} // implicit
- Q_DECL_CONSTEXPR QChar(QLatin1Char ch) Q_DECL_NOTHROW : ucs(ch.unicode()) {} // implicit
+ Q_DECL_CONSTEXPR QChar() noexcept : ucs(0) {}
+ Q_DECL_CONSTEXPR QChar(ushort rc) noexcept : ucs(rc) {} // implicit
+ Q_DECL_CONSTEXPR QChar(uchar c, uchar r) noexcept : ucs(ushort((r << 8) | c)) {}
+ Q_DECL_CONSTEXPR QChar(short rc) noexcept : ucs(ushort(rc)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(uint rc) noexcept : ucs(ushort(rc & 0xffff)) {}
+ Q_DECL_CONSTEXPR QChar(int rc) noexcept : ucs(ushort(rc & 0xffff)) {}
+ Q_DECL_CONSTEXPR QChar(SpecialCharacter s) noexcept : ucs(ushort(s)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(QLatin1Char ch) noexcept : ucs(ch.unicode()) {} // implicit
#if defined(Q_COMPILER_UNICODE_STRINGS)
- Q_DECL_CONSTEXPR QChar(char16_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(char16_t ch) noexcept : ucs(ushort(ch)) {} // implicit
#endif
#if defined(Q_OS_WIN)
Q_STATIC_ASSERT(sizeof(wchar_t) == sizeof(ushort));
#endif
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
# if !defined(_WCHAR_T_DEFINED) || defined(_NATIVE_WCHAR_T_DEFINED)
- Q_DECL_CONSTEXPR QChar(wchar_t ch) Q_DECL_NOTHROW : ucs(ushort(ch)) {} // implicit
+ Q_DECL_CONSTEXPR QChar(wchar_t ch) noexcept : ucs(ushort(ch)) {} // implicit
# endif
#endif
#ifndef QT_NO_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) Q_DECL_NOTHROW : ucs(uchar(c)) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(char c) noexcept : ucs(uchar(c)) { }
#ifndef QT_RESTRICTED_CAST_FROM_ASCII
- QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) Q_DECL_NOTHROW : ucs(c) { }
+ QT_ASCII_CAST_WARN Q_DECL_CONSTEXPR explicit QChar(uchar c) noexcept : ucs(c) { }
#endif
#endif
// Unicode information
@@ -411,11 +425,11 @@ public:
};
// ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
- inline Category category() const Q_DECL_NOTHROW { return QChar::category(ucs); }
- inline Direction direction() const Q_DECL_NOTHROW { return QChar::direction(ucs); }
- inline JoiningType joiningType() const Q_DECL_NOTHROW { return QChar::joiningType(ucs); }
+ inline Category category() const noexcept { return QChar::category(ucs); }
+ inline Direction direction() const noexcept { return QChar::direction(ucs); }
+ inline JoiningType joiningType() const noexcept { return QChar::joiningType(ucs); }
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED inline Joining joining() const Q_DECL_NOTHROW
+ QT_DEPRECATED inline Joining joining() const noexcept
{
switch (QChar::joiningType(ucs)) {
case QChar::Joining_Causing: return QChar::Center;
@@ -428,198 +442,198 @@ public:
}
}
#endif
- inline unsigned char combiningClass() const Q_DECL_NOTHROW { return QChar::combiningClass(ucs); }
+ inline unsigned char combiningClass() const noexcept { return QChar::combiningClass(ucs); }
- inline QChar mirroredChar() const Q_DECL_NOTHROW { return QChar::mirroredChar(ucs); }
- inline bool hasMirrored() const Q_DECL_NOTHROW { return QChar::hasMirrored(ucs); }
+ inline QChar mirroredChar() const noexcept { return QChar(QChar::mirroredChar(ucs)); }
+ inline bool hasMirrored() const noexcept { return QChar::hasMirrored(ucs); }
QString decomposition() const;
- inline Decomposition decompositionTag() const Q_DECL_NOTHROW { return QChar::decompositionTag(ucs); }
+ inline Decomposition decompositionTag() const noexcept { return QChar::decompositionTag(ucs); }
- inline int digitValue() const Q_DECL_NOTHROW { return QChar::digitValue(ucs); }
- inline QChar toLower() const Q_DECL_NOTHROW { return QChar::toLower(ucs); }
- inline QChar toUpper() const Q_DECL_NOTHROW { return QChar::toUpper(ucs); }
- inline QChar toTitleCase() const Q_DECL_NOTHROW { return QChar::toTitleCase(ucs); }
- inline QChar toCaseFolded() const Q_DECL_NOTHROW { return QChar::toCaseFolded(ucs); }
+ inline int digitValue() const noexcept { return QChar::digitValue(ucs); }
+ inline QChar toLower() const noexcept { return QChar(QChar::toLower(ucs)); }
+ inline QChar toUpper() const noexcept { return QChar(QChar::toUpper(ucs)); }
+ inline QChar toTitleCase() const noexcept { return QChar(QChar::toTitleCase(ucs)); }
+ inline QChar toCaseFolded() const noexcept { return QChar(QChar::toCaseFolded(ucs)); }
- inline Script script() const Q_DECL_NOTHROW { return QChar::script(ucs); }
+ inline Script script() const noexcept { return QChar::script(ucs); }
- inline UnicodeVersion unicodeVersion() const Q_DECL_NOTHROW { return QChar::unicodeVersion(ucs); }
+ inline UnicodeVersion unicodeVersion() const noexcept { return QChar::unicodeVersion(ucs); }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED Q_DECL_CONSTEXPR inline char toAscii() const Q_DECL_NOTHROW { return toLatin1(); }
+ QT_DEPRECATED Q_DECL_CONSTEXPR inline char toAscii() const noexcept { return toLatin1(); }
#endif
- Q_DECL_CONSTEXPR inline char toLatin1() const Q_DECL_NOTHROW { return ucs > 0xff ? '\0' : char(ucs); }
- Q_DECL_CONSTEXPR inline ushort unicode() const Q_DECL_NOTHROW { return ucs; }
- Q_DECL_RELAXED_CONSTEXPR inline ushort &unicode() Q_DECL_NOTHROW { return ucs; }
+ Q_DECL_CONSTEXPR inline char toLatin1() const noexcept { return ucs > 0xff ? '\0' : char(ucs); }
+ Q_DECL_CONSTEXPR inline ushort unicode() const noexcept { return ucs; }
+ Q_DECL_RELAXED_CONSTEXPR inline ushort &unicode() noexcept { return ucs; }
#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED static Q_DECL_CONSTEXPR inline QChar fromAscii(char c) Q_DECL_NOTHROW
+ QT_DEPRECATED static Q_DECL_CONSTEXPR inline QChar fromAscii(char c) noexcept
{ return fromLatin1(c); }
#endif
- static Q_DECL_CONSTEXPR inline QChar fromLatin1(char c) Q_DECL_NOTHROW { return QChar(ushort(uchar(c))); }
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW { return ucs == 0; }
-
- inline bool isPrint() const Q_DECL_NOTHROW { return QChar::isPrint(ucs); }
- Q_DECL_CONSTEXPR inline bool isSpace() const Q_DECL_NOTHROW { return QChar::isSpace(ucs); }
- inline bool isMark() const Q_DECL_NOTHROW { return QChar::isMark(ucs); }
- inline bool isPunct() const Q_DECL_NOTHROW { return QChar::isPunct(ucs); }
- inline bool isSymbol() const Q_DECL_NOTHROW { return QChar::isSymbol(ucs); }
- Q_DECL_CONSTEXPR inline bool isLetter() const Q_DECL_NOTHROW { return QChar::isLetter(ucs); }
- Q_DECL_CONSTEXPR inline bool isNumber() const Q_DECL_NOTHROW { return QChar::isNumber(ucs); }
- Q_DECL_CONSTEXPR inline bool isLetterOrNumber() const Q_DECL_NOTHROW { return QChar::isLetterOrNumber(ucs); }
- Q_DECL_CONSTEXPR inline bool isDigit() const Q_DECL_NOTHROW { return QChar::isDigit(ucs); }
- Q_DECL_CONSTEXPR inline bool isLower() const Q_DECL_NOTHROW { return QChar::isLower(ucs); }
- Q_DECL_CONSTEXPR inline bool isUpper() const Q_DECL_NOTHROW { return QChar::isUpper(ucs); }
- Q_DECL_CONSTEXPR inline bool isTitleCase() const Q_DECL_NOTHROW { return QChar::isTitleCase(ucs); }
-
- Q_DECL_CONSTEXPR inline bool isNonCharacter() const Q_DECL_NOTHROW { return QChar::isNonCharacter(ucs); }
- Q_DECL_CONSTEXPR inline bool isHighSurrogate() const Q_DECL_NOTHROW { return QChar::isHighSurrogate(ucs); }
- Q_DECL_CONSTEXPR inline bool isLowSurrogate() const Q_DECL_NOTHROW { return QChar::isLowSurrogate(ucs); }
- Q_DECL_CONSTEXPR inline bool isSurrogate() const Q_DECL_NOTHROW { return QChar::isSurrogate(ucs); }
-
- Q_DECL_CONSTEXPR inline uchar cell() const Q_DECL_NOTHROW { return uchar(ucs & 0xff); }
- Q_DECL_CONSTEXPR inline uchar row() const Q_DECL_NOTHROW { return uchar((ucs>>8)&0xff); }
- Q_DECL_RELAXED_CONSTEXPR inline void setCell(uchar acell) Q_DECL_NOTHROW { ucs = ushort((ucs & 0xff00) + acell); }
- Q_DECL_RELAXED_CONSTEXPR inline void setRow(uchar arow) Q_DECL_NOTHROW { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
-
- static Q_DECL_CONSTEXPR inline bool isNonCharacter(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline QChar fromLatin1(char c) noexcept { return QChar(ushort(uchar(c))); }
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept { return ucs == 0; }
+
+ inline bool isPrint() const noexcept { return QChar::isPrint(ucs); }
+ Q_DECL_CONSTEXPR inline bool isSpace() const noexcept { return QChar::isSpace(ucs); }
+ inline bool isMark() const noexcept { return QChar::isMark(ucs); }
+ inline bool isPunct() const noexcept { return QChar::isPunct(ucs); }
+ inline bool isSymbol() const noexcept { return QChar::isSymbol(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLetter() const noexcept { return QChar::isLetter(ucs); }
+ Q_DECL_CONSTEXPR inline bool isNumber() const noexcept { return QChar::isNumber(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLetterOrNumber() const noexcept { return QChar::isLetterOrNumber(ucs); }
+ Q_DECL_CONSTEXPR inline bool isDigit() const noexcept { return QChar::isDigit(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLower() const noexcept { return QChar::isLower(ucs); }
+ Q_DECL_CONSTEXPR inline bool isUpper() const noexcept { return QChar::isUpper(ucs); }
+ Q_DECL_CONSTEXPR inline bool isTitleCase() const noexcept { return QChar::isTitleCase(ucs); }
+
+ Q_DECL_CONSTEXPR inline bool isNonCharacter() const noexcept { return QChar::isNonCharacter(ucs); }
+ Q_DECL_CONSTEXPR inline bool isHighSurrogate() const noexcept { return QChar::isHighSurrogate(ucs); }
+ Q_DECL_CONSTEXPR inline bool isLowSurrogate() const noexcept { return QChar::isLowSurrogate(ucs); }
+ Q_DECL_CONSTEXPR inline bool isSurrogate() const noexcept { return QChar::isSurrogate(ucs); }
+
+ Q_DECL_CONSTEXPR inline uchar cell() const noexcept { return uchar(ucs & 0xff); }
+ Q_DECL_CONSTEXPR inline uchar row() const noexcept { return uchar((ucs>>8)&0xff); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setCell(uchar acell) noexcept { ucs = ushort((ucs & 0xff00) + acell); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setRow(uchar arow) noexcept { ucs = ushort((ushort(arow)<<8) + (ucs&0xff)); }
+
+ static Q_DECL_CONSTEXPR inline bool isNonCharacter(uint ucs4) noexcept
{
return ucs4 >= 0xfdd0 && (ucs4 <= 0xfdef || (ucs4 & 0xfffe) == 0xfffe);
}
- static Q_DECL_CONSTEXPR inline bool isHighSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool isHighSurrogate(uint ucs4) noexcept
{
return ((ucs4 & 0xfffffc00) == 0xd800);
}
- static Q_DECL_CONSTEXPR inline bool isLowSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool isLowSurrogate(uint ucs4) noexcept
{
return ((ucs4 & 0xfffffc00) == 0xdc00);
}
- static Q_DECL_CONSTEXPR inline bool isSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool isSurrogate(uint ucs4) noexcept
{
return (ucs4 - 0xd800u < 2048u);
}
- static Q_DECL_CONSTEXPR inline bool requiresSurrogates(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline bool requiresSurrogates(uint ucs4) noexcept
{
return (ucs4 >= 0x10000);
}
- static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(ushort high, ushort low) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(ushort high, ushort low) noexcept
{
return (uint(high)<<10) + low - 0x35fdc00;
}
- static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(QChar high, QChar low) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline uint surrogateToUcs4(QChar high, QChar low) noexcept
{
return surrogateToUcs4(high.ucs, low.ucs);
}
- static Q_DECL_CONSTEXPR inline ushort highSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline ushort highSurrogate(uint ucs4) noexcept
{
return ushort((ucs4>>10) + 0xd7c0);
}
- static Q_DECL_CONSTEXPR inline ushort lowSurrogate(uint ucs4) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR inline ushort lowSurrogate(uint ucs4) noexcept
{
return ushort(ucs4%0x400 + 0xdc00);
}
- static Category QT_FASTCALL category(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Direction QT_FASTCALL direction(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static JoiningType QT_FASTCALL joiningType(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Category QT_FASTCALL category(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static Direction QT_FASTCALL direction(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static JoiningType QT_FASTCALL joiningType(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED static Joining QT_FASTCALL joining(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ QT_DEPRECATED static Joining QT_FASTCALL joining(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
#endif
- static unsigned char QT_FASTCALL combiningClass(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static unsigned char QT_FASTCALL combiningClass(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL mirroredChar(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL hasMirrored(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL mirroredChar(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL hasMirrored(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
static QString QT_FASTCALL decomposition(uint ucs4);
- static Decomposition QT_FASTCALL decompositionTag(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Decomposition QT_FASTCALL decompositionTag(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static int QT_FASTCALL digitValue(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toLower(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toUpper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toTitleCase(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static uint QT_FASTCALL toCaseFolded(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static int QT_FASTCALL digitValue(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toLower(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toUpper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toTitleCase(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static uint QT_FASTCALL toCaseFolded(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static Script QT_FASTCALL script(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static Script QT_FASTCALL script(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static UnicodeVersion QT_FASTCALL unicodeVersion(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
- static UnicodeVersion QT_FASTCALL currentUnicodeVersion() Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static UnicodeVersion QT_FASTCALL currentUnicodeVersion() noexcept Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isPrint(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isSpace(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static bool QT_FASTCALL isPrint(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static Q_DECL_CONSTEXPR inline bool isSpace(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{
// note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly
return ucs4 == 0x20 || (ucs4 <= 0x0d && ucs4 >= 0x09)
|| (ucs4 > 127 && (ucs4 == 0x85 || ucs4 == 0xa0 || QChar::isSpace_helper(ucs4)));
}
- static bool QT_FASTCALL isMark(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isPunct(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isSymbol(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static Q_DECL_CONSTEXPR inline bool isLetter(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static bool QT_FASTCALL isMark(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isPunct(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isSymbol(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static Q_DECL_CONSTEXPR inline bool isLetter(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{
return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
|| (ucs4 > 127 && QChar::isLetter_helper(ucs4));
}
- static Q_DECL_CONSTEXPR inline bool isNumber(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isNumber(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::isNumber_helper(ucs4)); }
- static Q_DECL_CONSTEXPR inline bool isLetterOrNumber(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isLetterOrNumber(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{
return (ucs4 >= 'A' && ucs4 <= 'z' && (ucs4 >= 'a' || ucs4 <= 'Z'))
|| (ucs4 >= '0' && ucs4 <= '9')
|| (ucs4 > 127 && QChar::isLetterOrNumber_helper(ucs4));
}
- static Q_DECL_CONSTEXPR inline bool isDigit(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isDigit(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= '9' && ucs4 >= '0') || (ucs4 > 127 && QChar::category(ucs4) == Number_DecimalDigit); }
- static Q_DECL_CONSTEXPR inline bool isLower(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isLower(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= 'z' && ucs4 >= 'a') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Lowercase); }
- static Q_DECL_CONSTEXPR inline bool isUpper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isUpper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return (ucs4 <= 'Z' && ucs4 >= 'A') || (ucs4 > 127 && QChar::category(ucs4) == Letter_Uppercase); }
- static Q_DECL_CONSTEXPR inline bool isTitleCase(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION
+ static Q_DECL_CONSTEXPR inline bool isTitleCase(uint ucs4) noexcept Q_DECL_CONST_FUNCTION
{ return ucs4 > 127 && QChar::category(ucs4) == Letter_Titlecase; }
private:
- static bool QT_FASTCALL isSpace_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isLetter_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isNumber_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
- static bool QT_FASTCALL isLetterOrNumber_helper(uint ucs4) Q_DECL_NOTHROW Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isSpace_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isLetter_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isNumber_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
+ static bool QT_FASTCALL isLetterOrNumber_helper(uint ucs4) noexcept Q_DECL_CONST_FUNCTION;
#ifdef QT_NO_CAST_FROM_ASCII
- QChar(char c) Q_DECL_NOTHROW;
- QChar(uchar c) Q_DECL_NOTHROW;
+ QChar(char c) noexcept;
+ QChar(uchar c) noexcept;
#endif
- friend Q_DECL_CONSTEXPR bool operator==(QChar, QChar) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR bool operator< (QChar, QChar) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR bool operator==(QChar, QChar) noexcept;
+ friend Q_DECL_CONSTEXPR bool operator< (QChar, QChar) noexcept;
ushort ucs;
};
Q_DECLARE_TYPEINFO(QChar, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs == c2.ucs; }
-Q_DECL_CONSTEXPR inline bool operator< (QChar c1, QChar c2) Q_DECL_NOTHROW { return c1.ucs < c2.ucs; }
+Q_DECL_CONSTEXPR inline bool operator==(QChar c1, QChar c2) noexcept { return c1.ucs == c2.ucs; }
+Q_DECL_CONSTEXPR inline bool operator< (QChar c1, QChar c2) noexcept { return c1.ucs < c2.ucs; }
-Q_DECL_CONSTEXPR inline bool operator!=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator==(c1, c2); }
-Q_DECL_CONSTEXPR inline bool operator>=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator< (c1, c2); }
-Q_DECL_CONSTEXPR inline bool operator> (QChar c1, QChar c2) Q_DECL_NOTHROW { return operator< (c2, c1); }
-Q_DECL_CONSTEXPR inline bool operator<=(QChar c1, QChar c2) Q_DECL_NOTHROW { return !operator< (c2, c1); }
+Q_DECL_CONSTEXPR inline bool operator!=(QChar c1, QChar c2) noexcept { return !operator==(c1, c2); }
+Q_DECL_CONSTEXPR inline bool operator>=(QChar c1, QChar c2) noexcept { return !operator< (c1, c2); }
+Q_DECL_CONSTEXPR inline bool operator> (QChar c1, QChar c2) noexcept { return operator< (c2, c1); }
+Q_DECL_CONSTEXPR inline bool operator<=(QChar c1, QChar c2) noexcept { return !operator< (c2, c1); }
-Q_DECL_CONSTEXPR inline bool operator==(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return lhs.isNull(); }
-Q_DECL_CONSTEXPR inline bool operator< (QChar, std::nullptr_t) Q_DECL_NOTHROW { return false; }
-Q_DECL_CONSTEXPR inline bool operator==(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return rhs.isNull(); }
-Q_DECL_CONSTEXPR inline bool operator< (std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !rhs.isNull(); }
+Q_DECL_CONSTEXPR inline bool operator==(QChar lhs, std::nullptr_t) noexcept { return lhs.isNull(); }
+Q_DECL_CONSTEXPR inline bool operator< (QChar, std::nullptr_t) noexcept { return false; }
+Q_DECL_CONSTEXPR inline bool operator==(std::nullptr_t, QChar rhs) noexcept { return rhs.isNull(); }
+Q_DECL_CONSTEXPR inline bool operator< (std::nullptr_t, QChar rhs) noexcept { return !rhs.isNull(); }
-Q_DECL_CONSTEXPR inline bool operator!=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator==(lhs, nullptr); }
-Q_DECL_CONSTEXPR inline bool operator>=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator< (lhs, nullptr); }
-Q_DECL_CONSTEXPR inline bool operator> (QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return operator< (nullptr, lhs); }
-Q_DECL_CONSTEXPR inline bool operator<=(QChar lhs, std::nullptr_t) Q_DECL_NOTHROW { return !operator< (nullptr, lhs); }
+Q_DECL_CONSTEXPR inline bool operator!=(QChar lhs, std::nullptr_t) noexcept { return !operator==(lhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator>=(QChar lhs, std::nullptr_t) noexcept { return !operator< (lhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator> (QChar lhs, std::nullptr_t) noexcept { return operator< (nullptr, lhs); }
+Q_DECL_CONSTEXPR inline bool operator<=(QChar lhs, std::nullptr_t) noexcept { return !operator< (nullptr, lhs); }
-Q_DECL_CONSTEXPR inline bool operator!=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator==(nullptr, rhs); }
-Q_DECL_CONSTEXPR inline bool operator>=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator< (nullptr, rhs); }
-Q_DECL_CONSTEXPR inline bool operator> (std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return operator< (rhs, nullptr); }
-Q_DECL_CONSTEXPR inline bool operator<=(std::nullptr_t, QChar rhs) Q_DECL_NOTHROW { return !operator< (rhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator!=(std::nullptr_t, QChar rhs) noexcept { return !operator==(nullptr, rhs); }
+Q_DECL_CONSTEXPR inline bool operator>=(std::nullptr_t, QChar rhs) noexcept { return !operator< (nullptr, rhs); }
+Q_DECL_CONSTEXPR inline bool operator> (std::nullptr_t, QChar rhs) noexcept { return operator< (rhs, nullptr); }
+Q_DECL_CONSTEXPR inline bool operator<=(std::nullptr_t, QChar rhs) noexcept { return !operator< (rhs, nullptr); }
#ifndef QT_NO_DATASTREAM
Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, QChar);
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/text/qcollator.cpp
index 76dcf35833..958216bde8 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/text/qcollator.cpp
@@ -46,7 +46,6 @@
QT_BEGIN_NAMESPACE
-
/*!
\class QCollator
\inmodule QtCore
@@ -59,20 +58,32 @@ QT_BEGIN_NAMESPACE
\ingroup string-processing
\ingroup shared
- QCollator is initialized with a QLocale and an optional collation strategy. It tries to
- initialize the collator with the specified values. The collator can then be used to compare
- and sort strings in a locale dependent fashion.
+ QCollator is initialized with a QLocale and an optional collation strategy.
+ It tries to initialize the collator with the specified values. The collator
+ can then be used to compare and sort strings in a locale dependent fashion.
- A QCollator object can be used together with template based sorting algorithms such as std::sort
- to sort a list of QStrings.
+ A QCollator object can be used together with template based sorting
+ algorithms such as std::sort to sort a list of QStrings.
- In addition to the locale and collation strategy, several optional flags can be set that influence
- the result of the collation.
+ In addition to the locale and collation strategy, several optional flags can
+ be set that influence the result of the collation.
*/
/*!
- Constructs a QCollator from \a locale. If \a locale is not specified
- the system's default locale is used.
+ \since 5.13
+
+ Constructs a QCollator using the system's default collation locale.
+
+ \sa setLocale(), QLocale::collation()
+*/
+QCollator::QCollator()
+ : d(new QCollatorPrivate(QLocale::system().collation()))
+{
+ d->init();
+}
+
+/*!
+ Constructs a QCollator from \a locale.
\sa setLocale()
*/
@@ -128,9 +139,9 @@ QCollator &QCollator::operator=(const QCollator &other)
Move constructor. Moves from \a other into this collator.
- Note that a moved-from QCollator can only be destroyed or assigned
- to. The effect of calling other functions than the destructor or
- one of the assignment operators is undefined.
+ Note that a moved-from QCollator can only be destroyed or assigned to.
+ The effect of calling other functions than the destructor or one of the
+ assignment operators is undefined.
*/
/*!
@@ -138,9 +149,9 @@ QCollator &QCollator::operator=(const QCollator &other)
Move-assigns from \a other to this collator.
- Note that a moved-from QCollator can only be destroyed or assigned
- to. The effect of calling other functions than the destructor or
- one of the assignment operators is undefined.
+ Note that a moved-from QCollator can only be destroyed or assigned to.
+ The effect of calling other functions than the destructor or one of the
+ assignment operators is undefined.
*/
/*!
@@ -155,7 +166,7 @@ QCollator &QCollator::operator=(const QCollator &other)
*/
void QCollator::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QCollatorPrivate *x = new QCollatorPrivate(d->locale);
if (!d->ref.deref())
delete d;
@@ -218,7 +229,8 @@ Qt::CaseSensitivity QCollator::caseSensitivity() const
Enables numeric sorting mode when \a on is set to true.
- This will enable proper sorting of numeric digits, so that e.g. 100 sorts after 99.
+ This will enable proper sorting of numeric digits, so that e.g. 100 sorts
+ after 99.
By default this mode is off.
@@ -248,11 +260,13 @@ bool QCollator::numericMode() const
/*!
\fn void QCollator::setIgnorePunctuation(bool on)
- If \a on is set to true, punctuation characters and symbols are ignored when determining sort order.
+ If \a on is set to true, punctuation characters and symbols are ignored when
+ determining sort order.
The default is locale dependent.
- \note This method is not currently supported if Qt is configured to not use ICU on Linux.
+ \note This method is not currently supported if Qt is configured to not use
+ ICU on Linux.
\sa ignorePunctuation()
*/
@@ -268,7 +282,8 @@ void QCollator::setIgnorePunctuation(bool on)
/*!
\fn bool QCollator::ignorePunctuation() const
- Returns \c true if punctuation characters and symbols are ignored when determining sort order.
+ Returns \c true if punctuation characters and symbols are ignored when
+ determining sort order.
\sa setIgnorePunctuation()
*/
@@ -278,35 +293,66 @@ bool QCollator::ignorePunctuation() const
}
/*!
- \fn int QCollator::compare(const QString &s1, const QString &s2) const
+ \since 5.13
+ \fn bool QCollator::operator()(QStringView s1, QStringView s2) const
+ \internal
+*/
- Compares \a s1 with \a s2. Returns an integer less than, equal to, or greater than zero
- depending on whether \a s1 is smaller, equal or larger than \a s2.
- */
+/*!
+ \since 5.13
+ \fn int QCollator::compare(QStringView s1, QStringView s2) const
+
+ Compares \a s1 with \a s2.
+ Returns an integer less than, equal to, or greater than zero depending on
+ whether \a s1 sorts before, with or after \a s2.
+*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn bool QCollator::operator()(const QString &s1, const QString &s2) const
\internal
*/
/*!
- \fn int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
\overload
- Compares \a s1 with \a s2. Returns an integer less than, equal to, or greater than zero
- depending on whether \a s1 is smaller, equal or larger than \a s2.
+ Compares \a s1 with \a s2.
+
+ Returns an integer less than, equal to, or greater than zero depending on
+ whether \a s1 sorts before, with or after \a s2.
+*/
+int QCollator::compare(const QString &s1, const QString &s2) const
+{
+ return compare(QStringView(s1), QStringView(s2));
+}
+
+/*!
+ \overload
+
+ Compares \a s1 with \a s2.
+
+ Returns an integer less than, equal to, or greater than zero depending on
+ whether \a s1 sorts before, with or after \a s2.
*/
+int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
+{
+ return compare(QStringView(s1), QStringView(s2));
+}
/*!
- \fn int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
\overload
- Compares \a s1 with \a s2. \a len1 and \a len2 specify the length of the
- QChar arrays pointer to by \a s1 and \a s2.
+ Compares \a s1 with \a s2. \a len1 and \a len2 specify the lengths of the
+ QChar arrays pointed to by \a s1 and \a s2.
- Returns an integer less than, equal to, or greater than zero
- depending on whether \a s1 is smaller, equal or larger than \a s2.
+ Returns an integer less than, equal to, or greater than zero depending on
+ whether \a s1 sorts before, with or after \a s2.
*/
+int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
+{
+ return compare(QStringView(s1, len1), QStringView(s2, len2));
+}
+#endif // QT_STRINGVIEW_LEVEL < 2
/*!
\fn QCollatorSortKey QCollator::sortKey(const QString &string) const
@@ -314,9 +360,9 @@ bool QCollator::ignorePunctuation() const
Returns a sortKey for \a string.
Creating the sort key is usually somewhat slower, than using the compare()
- methods directly. But if the string is compared repeatedly (e.g. when sorting
- a whole list of strings), it's usually faster to create the sort keys for each
- string and then sort using the keys.
+ methods directly. But if the string is compared repeatedly (e.g. when
+ sorting a whole list of strings), it's usually faster to create the sort
+ keys for each string and then sort using the keys.
\note Not supported with the C (a.k.a. POSIX) locale on Darwin.
*/
@@ -328,8 +374,8 @@ bool QCollator::ignorePunctuation() const
\since 5.2
- The QCollatorSortKey class is always created by QCollator::sortKey()
- and is used for fast strings collation, for example when collating many strings.
+ The QCollatorSortKey class is always created by QCollator::sortKey() and is
+ used for fast strings collation, for example when collating many strings.
\reentrant
\ingroup i18n
@@ -398,9 +444,11 @@ QCollatorSortKey& QCollatorSortKey::operator=(const QCollatorSortKey &other)
/*!
\fn int QCollatorSortKey::compare(const QCollatorSortKey &otherKey) const
- Compares the key to \a otherKey. Returns a negative value if the key
- is less than \a otherKey, 0 if the key is equal to \a otherKey or a
- positive value if the key is greater than \a otherKey.
+ Compares this key to \a otherKey.
+
+ Returns a negative value if the key is less than \a otherKey, 0 if the key
+ is equal to \a otherKey or a positive value if the key is greater than \a
+ otherKey.
\sa operator<()
*/
diff --git a/src/corelib/tools/qcollator.h b/src/corelib/text/qcollator.h
index 6fa199cb0f..6bb5038371 100644
--- a/src/corelib/tools/qcollator.h
+++ b/src/corelib/text/qcollator.h
@@ -57,11 +57,9 @@ public:
QCollatorSortKey(const QCollatorSortKey &other);
~QCollatorSortKey();
QCollatorSortKey &operator=(const QCollatorSortKey &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QCollatorSortKey &operator=(QCollatorSortKey &&other) Q_DECL_NOTHROW
+ inline QCollatorSortKey &operator=(QCollatorSortKey &&other) noexcept
{ swap(other); return *this; }
-#endif
- void swap(QCollatorSortKey &other) Q_DECL_NOTHROW
+ void swap(QCollatorSortKey &other) noexcept
{ d.swap(other.d); }
int compare(const QCollatorSortKey &key) const;
@@ -83,18 +81,17 @@ inline bool operator<(const QCollatorSortKey &lhs, const QCollatorSortKey &rhs)
class Q_CORE_EXPORT QCollator
{
public:
- explicit QCollator(const QLocale &locale = QLocale());
+ QCollator();
+ explicit QCollator(const QLocale &locale);
QCollator(const QCollator &);
~QCollator();
QCollator &operator=(const QCollator &);
-#ifdef Q_COMPILER_RVALUE_REFS
- QCollator(QCollator &&other) Q_DECL_NOTHROW
+ QCollator(QCollator &&other) noexcept
: d(other.d) { other.d = nullptr; }
- QCollator &operator=(QCollator &&other) Q_DECL_NOTHROW
+ QCollator &operator=(QCollator &&other) noexcept
{ swap(other); return *this; }
-#endif
- void swap(QCollator &other) Q_DECL_NOTHROW
+ void swap(QCollator &other) noexcept
{ qSwap(d, other.d); }
void setLocale(const QLocale &locale);
@@ -109,12 +106,18 @@ public:
void setIgnorePunctuation(bool on);
bool ignorePunctuation() const;
+#if QT_STRINGVIEW_LEVEL < 2
int compare(const QString &s1, const QString &s2) const;
int compare(const QStringRef &s1, const QStringRef &s2) const;
int compare(const QChar *s1, int len1, const QChar *s2, int len2) const;
bool operator()(const QString &s1, const QString &s2) const
{ return compare(s1, s2) < 0; }
+#endif
+ int compare(QStringView s1, QStringView s2) const;
+
+ bool operator()(QStringView s1, QStringView s2) const
+ { return compare(s1, s2) < 0; }
QCollatorSortKey sortKey(const QString &string) const;
diff --git a/src/corelib/tools/qcollator_icu.cpp b/src/corelib/text/qcollator_icu.cpp
index ab45b9a1a1..8acda45070 100644
--- a/src/corelib/tools/qcollator_icu.cpp
+++ b/src/corelib/text/qcollator_icu.cpp
@@ -78,7 +78,8 @@ void QCollatorPrivate::init()
// and does case sensitive comparison.
// UCOL_QUATERNARY is used as default in a few languages such as Japanese to take care of some
// additional differences in those languages.
- UColAttributeValue val = (caseSensitivity == Qt::CaseSensitive) ? UCOL_DEFAULT_STRENGTH : UCOL_SECONDARY;
+ UColAttributeValue val = (caseSensitivity == Qt::CaseSensitive)
+ ? UCOL_DEFAULT_STRENGTH : UCOL_SECONDARY;
status = U_ZERO_ERROR;
ucol_setAttribute(collator, UCOL_STRENGTH, val, &status);
@@ -91,7 +92,8 @@ void QCollatorPrivate::init()
qWarning("ucol_setAttribute: numeric collation failed: %d", status);
status = U_ZERO_ERROR;
- ucol_setAttribute(collator, UCOL_ALTERNATE_HANDLING, ignorePunctuation ? UCOL_SHIFTED : UCOL_NON_IGNORABLE, &status);
+ ucol_setAttribute(collator, UCOL_ALTERNATE_HANDLING,
+ ignorePunctuation ? UCOL_SHIFTED : UCOL_NON_IGNORABLE, &status);
if (U_FAILURE(status))
qWarning("ucol_setAttribute: Alternate handling failed: %d", status);
@@ -105,37 +107,20 @@ void QCollatorPrivate::cleanup()
collator = nullptr;
}
-int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
+int QCollator::compare(QStringView s1, QStringView s2) const
{
if (d->dirty)
d->init();
- if (d->collator)
- return ucol_strcoll(d->collator, (const UChar *)s1, len1, (const UChar *)s2, len2);
-
- return QString::compare_helper(s1, len1, s2, len2, d->caseSensitivity);
-}
-
-int QCollator::compare(const QString &s1, const QString &s2) const
-{
- if (d->dirty)
- d->init();
-
- if (d->collator)
- return compare(s1.constData(), s1.size(), s2.constData(), s2.size());
-
- return QString::compare(s1, s2, d->caseSensitivity);
-}
-
-int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
-{
- if (d->dirty)
- d->init();
-
- if (d->collator)
- return compare(s1.constData(), s1.size(), s2.constData(), s2.size());
+ if (d->collator) {
+ return ucol_strcoll(d->collator,
+ reinterpret_cast<const UChar *>(s1.data()), s1.size(),
+ reinterpret_cast<const UChar *>(s2.data()), s2.size());
+ }
- return QStringRef::compare(s1, s2, d->caseSensitivity);
+ return QString::compare_helper(s1.data(), s1.size(),
+ s2.data(), s2.size(),
+ d->caseSensitivity);
}
QCollatorSortKey QCollator::sortKey(const QString &string) const
diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/text/qcollator_macx.cpp
index 42e67e0c12..071d7c048f 100644
--- a/src/corelib/tools/qcollator_macx.cpp
+++ b/src/corelib/text/qcollator_macx.cpp
@@ -65,12 +65,12 @@ void QCollatorPrivate::init()
return;
LocaleRef localeRef;
- int rc = LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
- if (rc != 0)
- qWarning("couldn't initialize the locale");
+ OSStatus status =
+ LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef);
+ if (status != 0)
+ qWarning("Couldn't initialize the locale (%d)", int(status));
UInt32 options = 0;
-
if (caseSensitivity == Qt::CaseInsensitive)
options |= kUCCollateCaseInsensitiveMask;
if (numericMode)
@@ -78,14 +78,9 @@ void QCollatorPrivate::init()
if (!ignorePunctuation)
options |= kUCCollatePunctuationSignificantMask;
- OSStatus status = UCCreateCollator(
- localeRef,
- 0,
- options,
- &collator
- );
+ status = UCCreateCollator(localeRef, 0, options, &collator);
if (status != 0)
- qWarning("Couldn't initialize the collator");
+ qWarning("Couldn't initialize the collator (%d)", int(status));
dirty = false;
}
@@ -97,18 +92,18 @@ void QCollatorPrivate::cleanup()
collator = 0;
}
-int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
+int QCollator::compare(QStringView s1, QStringView s2) const
{
if (d->dirty)
d->init();
if (!d->collator)
- return QStringView(s1, len1).compare(QStringView(s2, len2), caseSensitivity());
+ return s1.compare(s2, caseSensitivity());
SInt32 result;
Boolean equivalent;
UCCompareText(d->collator,
- reinterpret_cast<const UniChar *>(s1), len1,
- reinterpret_cast<const UniChar *>(s2), len2,
+ reinterpret_cast<const UniChar *>(s1.data()), s1.size(),
+ reinterpret_cast<const UniChar *>(s2.data()), s2.size(),
&equivalent,
&result);
if (equivalent)
@@ -116,16 +111,6 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con
return result < 0 ? -1 : 1;
}
-int QCollator::compare(const QString &str1, const QString &str2) const
-{
- return compare(str1.constData(), str1.size(), str2.constData(), str2.size());
-}
-
-int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
-{
- return compare(s1.constData(), s1.size(), s2.constData(), s2.size());
-}
-
QCollatorSortKey QCollator::sortKey(const QString &string) const
{
if (d->dirty)
@@ -139,13 +124,14 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
//Documentation recommends having it 5 times as big as the input
QVector<UCCollationValue> ret(string.size() * 5);
ItemCount actualSize;
- int status = UCGetCollationKey(d->collator, reinterpret_cast<const UniChar *>(string.constData()), string.count(),
- ret.size(), &actualSize, ret.data());
+ int status = UCGetCollationKey(d->collator,
+ reinterpret_cast<const UniChar *>(string.constData()),
+ string.count(), ret.size(), &actualSize, ret.data());
- ret.resize(actualSize+1);
+ ret.resize(actualSize + 1);
if (status == kUCOutputBufferTooSmall) {
- UCGetCollationKey(d->collator, reinterpret_cast<const UniChar *>(string.constData()), string.count(),
- ret.size(), &actualSize, ret.data());
+ UCGetCollationKey(d->collator, reinterpret_cast<const UniChar *>(string.constData()),
+ string.count(), ret.size(), &actualSize, ret.data());
}
ret[actualSize] = 0;
return QCollatorSortKey(new QCollatorSortKeyPrivate(std::move(ret)));
diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/text/qcollator_p.h
index fc2d434a8d..fc2d434a8d 100644
--- a/src/corelib/tools/qcollator_p.h
+++ b/src/corelib/text/qcollator_p.h
diff --git a/src/corelib/tools/qcollator_posix.cpp b/src/corelib/text/qcollator_posix.cpp
index 81f97a02e1..9cbc539ebe 100644
--- a/src/corelib/tools/qcollator_posix.cpp
+++ b/src/corelib/text/qcollator_posix.cpp
@@ -65,7 +65,7 @@ void QCollatorPrivate::cleanup()
{
}
-static void stringToWCharArray(QVarLengthArray<wchar_t> &ret, const QString &string)
+static void stringToWCharArray(QVarLengthArray<wchar_t> &ret, QStringView string)
{
ret.resize(string.length());
int len = string.toWCharArray(ret.data());
@@ -73,12 +73,7 @@ static void stringToWCharArray(QVarLengthArray<wchar_t> &ret, const QString &str
ret[len] = 0;
}
-int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
-{
- return compare(QString::fromRawData(s1, len1), QString::fromRawData(s2, len2));
-}
-
-int QCollator::compare(const QString &s1, const QString &s2) const
+int QCollator::compare(QStringView s1, QStringView s2) const
{
if (d->isC())
return s1.compare(s2, caseSensitivity());
@@ -91,11 +86,6 @@ int QCollator::compare(const QString &s1, const QString &s2) const
return std::wcscoll(array1.constData(), array2.constData());
}
-int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
-{
- return compare(s1.toString(), s2.toString());
-}
-
QCollatorSortKey QCollator::sortKey(const QString &string) const
{
if (d->dirty)
diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/text/qcollator_win.cpp
index 10cfdaa264..9d81de882f 100644
--- a/src/corelib/tools/qcollator_win.cpp
+++ b/src/corelib/text/qcollator_win.cpp
@@ -87,30 +87,30 @@ void QCollatorPrivate::cleanup()
{
}
-
-int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const
+int QCollator::compare(QStringView s1, QStringView s2) const
{
if (d->isC())
- return QString::compare_helper(s1, len1, s2, len2, d->caseSensitivity);
+ return s1.compare(s2, d->caseSensitivity);
if (d->dirty)
d->init();
//* from Windows documentation *
- // Returns one of the following values if successful. To maintain the C runtime convention of
- // comparing strings, the value 2 can be subtracted from a nonzero return value. Then, the
- // meaning of <0, ==0, and >0 is consistent with the C runtime.
+ // Returns one of the following values if successful. To maintain the C
+ // runtime convention of comparing strings, the value 2 can be subtracted
+ // from a nonzero return value. Then, the meaning of <0, ==0, and >0 is
+ // consistent with the C runtime.
// [...] The function returns 0 if it does not succeed.
// https://docs.microsoft.com/en-us/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex#return-value
#ifndef USE_COMPARESTRINGEX
const int ret = CompareString(d->localeID, d->collator,
- reinterpret_cast<const wchar_t*>(s1), len1,
- reinterpret_cast<const wchar_t*>(s2), len2);
+ reinterpret_cast<const wchar_t *>(s1.data()), s1.size(),
+ reinterpret_cast<const wchar_t *>(s2.data()), s2.size());
#else
const int ret = CompareStringEx(LPCWSTR(d->localeName.utf16()), d->collator,
- reinterpret_cast<LPCWSTR>(s1), len1,
- reinterpret_cast<LPCWSTR>(s2), len2,
+ reinterpret_cast<LPCWSTR>(s1.data()), s1.size(),
+ reinterpret_cast<LPCWSTR>(s2.data()), s2.size(),
nullptr, nullptr, 0);
#endif
if (Q_LIKELY(ret))
@@ -132,16 +132,6 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con
return 0;
}
-int QCollator::compare(const QString &str1, const QString &str2) const
-{
- return compare(str1.constData(), str1.size(), str2.constData(), str2.size());
-}
-
-int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const
-{
- return compare(s1.constData(), s1.size(), s2.constData(), s2.size());
-}
-
QCollatorSortKey QCollator::sortKey(const QString &string) const
{
if (d->dirty)
@@ -170,7 +160,9 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
NULL, NULL, 0);
#endif
if (finalSize == 0) {
- qWarning() << "there were problems when generating the ::sortKey by LCMapStringW with error:" << GetLastError();
+ qWarning()
+ << "there were problems when generating the ::sortKey by LCMapStringW with error:"
+ << GetLastError();
}
return QCollatorSortKey(new QCollatorSortKeyPrivate(std::move(ret)));
}
diff --git a/src/corelib/tools/qdoublescanprint_p.h b/src/corelib/text/qdoublescanprint_p.h
index 3865c69a99..3865c69a99 100644
--- a/src/corelib/tools/qdoublescanprint_p.h
+++ b/src/corelib/text/qdoublescanprint_p.h
diff --git a/src/corelib/tools/qharfbuzz.cpp b/src/corelib/text/qharfbuzz.cpp
index a3e266ccd2..a3e266ccd2 100644
--- a/src/corelib/tools/qharfbuzz.cpp
+++ b/src/corelib/text/qharfbuzz.cpp
diff --git a/src/corelib/tools/qharfbuzz_p.h b/src/corelib/text/qharfbuzz_p.h
index 2a0307d35f..2a0307d35f 100644
--- a/src/corelib/tools/qharfbuzz_p.h
+++ b/src/corelib/text/qharfbuzz_p.h
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/text/qlocale.cpp
index 152c2edb50..75a5bc802e 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -55,7 +55,7 @@
#include "qlocale_p.h"
#include "qlocale_tools_p.h"
#if QT_CONFIG(datetimeparser)
-#include "qdatetimeparser_p.h"
+#include "private/qdatetimeparser_p.h"
#endif
#include "qnamespace.h"
#include "qdatetime.h"
@@ -72,6 +72,10 @@
# include <time.h>
#endif
+#include "private/qcalendarbackend_p.h"
+#include "private/qgregoriancalendar_p.h"
+#include "qcalendar.h"
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SYSTEMLOCALE
@@ -94,7 +98,7 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qlocale_data_p.h"
QT_END_INCLUDE_NAMESPACE
-QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) Q_DECL_NOTHROW
+QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) noexcept
{
const auto len = code.size();
if (len != 2 && len != 3)
@@ -138,7 +142,7 @@ QLocale::Language QLocalePrivate::codeToLanguage(QStringView code) Q_DECL_NOTHRO
return QLocale::C;
}
-QLocale::Script QLocalePrivate::codeToScript(QStringView code) Q_DECL_NOTHROW
+QLocale::Script QLocalePrivate::codeToScript(QStringView code) noexcept
{
const auto len = code.size();
if (len != 4)
@@ -158,7 +162,7 @@ QLocale::Script QLocalePrivate::codeToScript(QStringView code) Q_DECL_NOTHROW
return QLocale::AnyScript;
}
-QLocale::Country QLocalePrivate::codeToCountry(QStringView code) Q_DECL_NOTHROW
+QLocale::Country QLocalePrivate::codeToCountry(QStringView code) noexcept
{
const auto len = code.size();
if (len != 2 && len != 3)
@@ -301,10 +305,11 @@ QByteArray QLocaleId::name(char separator) const
const unsigned char *lang = language_code_list + 3 * language_id;
const unsigned char *script =
- (script_id != QLocale::AnyScript ? script_code_list + 4 * script_id : 0);
+ (script_id != QLocale::AnyScript ? script_code_list + 4 * script_id : nullptr);
const unsigned char *country =
- (country_id != QLocale::AnyCountry ? country_code_list + 3 * country_id : 0);
- char len = (lang[2] != 0 ? 3 : 2) + (script ? 4+1 : 0) + (country ? (country[2] != 0 ? 3 : 2)+1 : 0);
+ (country_id != QLocale::AnyCountry ? country_code_list + 3 * country_id : nullptr);
+ char len = (lang[2] != 0 ? 3 : 2) + (script ? 4 + 1 : 0)
+ + (country ? (country[2] != 0 ? 3 : 2) + 1 : 0);
QByteArray name(len, Qt::Uninitialized);
char *uc = name.data();
*uc++ = lang[0];
@@ -335,12 +340,32 @@ QByteArray QLocalePrivate::bcp47Name(char separator) const
if (m_data->m_language_id == QLocale::C)
return QByteArrayLiteral("en");
- QLocaleId localeId = QLocaleId::fromIds(m_data->m_language_id, m_data->m_script_id, m_data->m_country_id);
+ QLocaleId localeId = QLocaleId::fromIds(m_data->m_language_id, m_data->m_script_id,
+ m_data->m_country_id);
return localeId.withLikelySubtagsRemoved().name(separator);
}
-static const QLocaleData *findLocaleDataById(const QLocaleId &localeId)
+/*!
+ \internal
+ */
+QByteArray QLocalePrivate::rawName(char separator) const
+{
+ QByteArrayList parts;
+ if (m_data->m_language_id != QLocale::AnyLanguage)
+ parts.append(languageCode().latin1());
+ if (m_data->m_script_id != QLocale::AnyScript)
+ parts.append(scriptCode().latin1());
+ if (m_data->m_country_id != QLocale::AnyCountry)
+ parts.append(countryCode().latin1());
+
+ return parts.join(separator);
+}
+
+
+static const QLocaleData *findLocaleDataById(const QLocaleId &lid)
{
+ QLocaleId localeId = lid.withLikelySubtagsAdded();
+
const uint idx = locale_index[localeId.language_id];
const QLocaleData *data = locale_data + idx;
@@ -367,16 +392,19 @@ static const QLocaleData *findLocaleDataById(const QLocaleId &localeId)
} while (data->m_language_id && data->m_language_id == localeId.language_id);
} else {
do {
- if (data->m_script_id == localeId.script_id && data->m_country_id == localeId.country_id)
+ if (data->m_script_id == localeId.script_id
+ && data->m_country_id == localeId.country_id) {
return data;
+ }
++data;
} while (data->m_language_id && data->m_language_id == localeId.language_id);
}
- return 0;
+ return nullptr;
}
-const QLocaleData *QLocaleData::findLocaleData(QLocale::Language language, QLocale::Script script, QLocale::Country country)
+const QLocaleData *QLocaleData::findLocaleData(QLocale::Language language, QLocale::Script script,
+ QLocale::Country country)
{
QLocaleId localeId = QLocaleId::fromIds(language, script, country);
QLocaleId likelyId = localeId.withLikelySubtagsAdded();
@@ -438,7 +466,14 @@ const QLocaleData *QLocaleData::findLocaleData(QLocale::Language language, QLoca
return locale_data + idx;
}
-static bool parse_locale_tag(const QString &input, int &i, QString *result, const QString &separators)
+uint QLocaleData::findLocaleOffset(QLocale::Language language, QLocale::Script script,
+ QLocale::Country country)
+{
+ return findLocaleData(language, script, country) - locale_data;
+}
+
+static bool parse_locale_tag(const QString &input, int &i, QString *result,
+ const QString &separators)
{
*result = QString(8, Qt::Uninitialized); // worst case according to BCP47
QChar *pch = result->data();
@@ -487,7 +522,8 @@ bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QSt
state = ScriptState;
break;
case ScriptState: {
- QString scripts = QString::fromLatin1((const char *)script_code_list, sizeof(script_code_list) - 1);
+ QString scripts = QString::fromLatin1((const char *)script_code_list,
+ sizeof(script_code_list) - 1);
if (value.length() == 4 && scripts.indexOf(value) % 4 == 0) {
// script name is always 4 characters
script = value;
@@ -543,6 +579,16 @@ static const QLocaleData *findLocaleData(const QString &name)
return QLocaleData::findLocaleData(lang, script, cntry);
}
+static uint findLocaleOffset(const QString &name)
+{
+ QLocale::Language lang;
+ QLocale::Script script;
+ QLocale::Country cntry;
+ QLocalePrivate::getLangAndCountry(name, lang, script, cntry);
+
+ return QLocaleData::findLocaleOffset(lang, script, cntry);
+}
+
QString qt_readEscapedFormatString(QStringView format, int *idx)
{
int &i = *idx;
@@ -560,8 +606,8 @@ QString qt_readEscapedFormatString(QStringView format, int *idx)
while (i < format.size()) {
if (format.at(i).unicode() == '\'') {
- if (i + 1 < format.size() && format.at(i + 1).unicode() == '\'') {
- // "''" inside of a quoted string
+ if (format.mid(i + 1).startsWith(QLatin1Char('\''))) {
+ // "''" inside a quoted string
result.append(QLatin1Char('\''));
i += 2;
} else {
@@ -604,13 +650,14 @@ int qt_repeatCount(QStringView s)
return int(j);
}
-static const QLocaleData *default_data = 0;
+static const QLocaleData *default_data = nullptr;
static QLocale::NumberOptions default_number_options = QLocale::DefaultNumberOptions;
static const QLocaleData *const c_data = locale_data;
static QLocalePrivate *c_private()
{
- static QLocalePrivate c_locale = { c_data, Q_BASIC_ATOMIC_INITIALIZER(1), QLocale::OmitGroupSeparator };
+ static QLocalePrivate c_locale{
+ c_data, Q_BASIC_ATOMIC_INITIALIZER(1), 0, QLocale::OmitGroupSeparator };
return &c_locale;
}
@@ -795,9 +842,11 @@ static QLocalePrivate *localePrivateByName(const QString &name)
{
if (name == QLatin1String("C"))
return c_private();
+ // TODO: Remove this version, and use offset everywhere
const QLocaleData *data = findLocaleData(name);
- return QLocalePrivate::create(data, data->m_language_id == QLocale::C ?
- QLocale::OmitGroupSeparator : QLocale::DefaultNumberOptions);
+ return QLocalePrivate::create(data, findLocaleOffset(name),
+ data->m_language_id == QLocale::C
+ ? QLocale::OmitGroupSeparator : QLocale::DefaultNumberOptions);
}
static QLocalePrivate *findLocalePrivate(QLocale::Language language, QLocale::Script script,
@@ -806,7 +855,9 @@ static QLocalePrivate *findLocalePrivate(QLocale::Language language, QLocale::Sc
if (language == QLocale::C)
return c_private();
+ // TODO: Remove pointer, use index instead
const QLocaleData *data = QLocaleData::findLocaleData(language, script, country);
+ const uint offset = QLocaleData::findLocaleOffset(language, script, country);
QLocale::NumberOptions numberOptions = QLocale::DefaultNumberOptions;
@@ -815,7 +866,7 @@ static QLocalePrivate *findLocalePrivate(QLocale::Language language, QLocale::Sc
numberOptions = default_number_options;
data = defaultData();
}
- return QLocalePrivate::create(data, numberOptions);
+ return QLocalePrivate::create(data, offset, numberOptions);
}
@@ -833,9 +884,11 @@ QLocale::QLocale(QLocalePrivate &dd)
"language[_script][_country][.codeset][@modifier]" or "C", where:
\list
- \li language is a lowercase, two-letter, ISO 639 language code (also some three-letter codes),
+ \li language is a lowercase, two-letter, ISO 639 language code (also some
+ three-letter codes),
\li script is a titlecase, four-letter, ISO 15924 script code,
- \li country is an uppercase, two-letter, ISO 3166 country code (also "419" as defined by United Nations),
+ \li country is an uppercase, two-letter, ISO 3166 country code
+ (also "419" as defined by United Nations),
\li and codeset and modifier are ignored.
\endlist
@@ -982,7 +1035,7 @@ bool QLocale::operator!=(const QLocale &other) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QLocale &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.d->m_data);
@@ -1036,9 +1089,11 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const
if (d->m_data == systemData()) {
QVariant res;
if (style == QLocale::AlternateQuotation)
- res = systemLocale()->query(QSystemLocale::StringToAlternateQuotation, QVariant::fromValue(str));
+ res = systemLocale()->query(QSystemLocale::StringToAlternateQuotation,
+ QVariant::fromValue(str));
if (res.isNull() || style == QLocale::StandardQuotation)
- res = systemLocale()->query(QSystemLocale::StringToStandardQuotation, QVariant::fromValue(str));
+ res = systemLocale()->query(QSystemLocale::StringToStandardQuotation,
+ QVariant::fromValue(str));
if (!res.isNull())
return res.toString();
}
@@ -1046,8 +1101,9 @@ QString QLocale::quoteString(const QStringRef &str, QuotationStyle style) const
if (style == QLocale::StandardQuotation)
return QChar(d->m_data->m_quotation_start) % str % QChar(d->m_data->m_quotation_end);
- else
- return QChar(d->m_data->m_alternate_quotation_start) % str % QChar(d->m_data->m_alternate_quotation_end);
+
+ return QChar(d->m_data->m_alternate_quotation_start)
+ % str % QChar(d->m_data->m_alternate_quotation_end);
}
/*!
@@ -1060,8 +1116,8 @@ QString QLocale::createSeparatedList(const QStringList &list) const
{
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
- QVariant res;
- res = systemLocale()->query(QSystemLocale::ListToSeparatedString, QVariant::fromValue(list));
+ QVariant res =
+ systemLocale()->query(QSystemLocale::ListToSeparatedString, QVariant::fromValue(list));
if (!res.isNull())
return res.toString();
@@ -1072,12 +1128,20 @@ QString QLocale::createSeparatedList(const QStringList &list) const
if (size == 1) {
return list.at(0);
} else if (size == 2) {
- QString format = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_two_idx, d->m_data->m_list_pattern_part_two_size);
+ QString format = getLocaleData(
+ list_pattern_part_data + d->m_data->m_list_pattern_part_two_idx,
+ d->m_data->m_list_pattern_part_two_size);
return format.arg(list.at(0), list.at(1));
} else if (size > 2) {
- QString formatStart = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_start_idx, d->m_data->m_list_pattern_part_start_size);
- QString formatMid = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_mid_idx, d->m_data->m_list_pattern_part_mid_size);
- QString formatEnd = getLocaleData(list_pattern_part_data + d->m_data->m_list_pattern_part_end_idx, d->m_data->m_list_pattern_part_end_size);
+ QString formatStart = getLocaleData(
+ list_pattern_part_data + d->m_data->m_list_pattern_part_start_idx,
+ d->m_data->m_list_pattern_part_start_size);
+ QString formatMid = getLocaleData(
+ list_pattern_part_data + d->m_data->m_list_pattern_part_mid_idx,
+ d->m_data->m_list_pattern_part_mid_size);
+ QString formatEnd = getLocaleData(
+ list_pattern_part_data + d->m_data->m_list_pattern_part_end_idx,
+ d->m_data->m_list_pattern_part_end_size);
QString result = formatStart.arg(list.at(0), list.at(1));
for (int i = 2; i < size - 1; ++i)
result = formatMid.arg(result, list.at(i));
@@ -1187,7 +1251,8 @@ static qulonglong toIntegral_helper(const QLocaleData *d, QStringView str, bool
template <typename T> static inline
T toIntegral_helper(const QLocalePrivate *d, QStringView str, bool *ok)
{
- using Int64 = typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type;
+ using Int64 =
+ typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type;
// we select the right overload by the last, unused parameter
Int64 val = toIntegral_helper(d->m_data, str, ok, d->m_numberOptions, Int64());
@@ -1203,8 +1268,8 @@ T toIntegral_helper(const QLocalePrivate *d, QStringView str, bool *ok)
/*!
\since 4.8
- Returns the dash-separated language, script and country (and possibly other BCP47 fields)
- of this locale as a string.
+ Returns the dash-separated language, script and country (and possibly other
+ BCP47 fields) of this locale as a string.
Unlike the uiLanguages() the returned value of the bcp47Name() represents
the locale name of the QLocale data but not the language the user-interface
@@ -1935,7 +2000,7 @@ QString QLocale::toString(qulonglong i) const
QString QLocale::toString(const QDate &date, const QString &format) const
{
- return d->dateTimeToString(format, QDateTime(), date, QTime(), this);
+ return QCalendar().dateTimeToString(format, QDateTime(), date, QTime(), *this);
}
#endif
@@ -1950,7 +2015,7 @@ QString QLocale::toString(const QDate &date, const QString &format) const
*/
QString QLocale::toString(const QDate &date, QStringView format) const
{
- return d->dateTimeToString(format, QDateTime(), date, QTime(), this);
+ return QCalendar().dateTimeToString(format, QDateTime(), date, QTime(), *this);
}
/*!
@@ -1966,7 +2031,8 @@ QString QLocale::toString(const QDate &date, FormatType format) const
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
- ? QSystemLocale::DateToStringLong : QSystemLocale::DateToStringShort,
+ ? QSystemLocale::DateToStringLong
+ : QSystemLocale::DateToStringShort,
date);
if (!res.isNull())
return res.toString();
@@ -2004,7 +2070,7 @@ static bool timeFormatContainsAP(QStringView format)
*/
QString QLocale::toString(const QTime &time, const QString &format) const
{
- return d->dateTimeToString(format, QDateTime(), QDate(), time, this);
+ return QCalendar().dateTimeToString(format, QDateTime(), QDate(), time, *this);
}
#endif
@@ -2019,7 +2085,7 @@ QString QLocale::toString(const QTime &time, const QString &format) const
*/
QString QLocale::toString(const QTime &time, QStringView format) const
{
- return d->dateTimeToString(format, QDateTime(), QDate(), time, this);
+ return QCalendar().dateTimeToString(format, QDateTime(), QDate(), time, *this);
}
#if QT_STRINGVIEW_LEVEL < 2
@@ -2035,7 +2101,7 @@ QString QLocale::toString(const QTime &time, QStringView format) const
QString QLocale::toString(const QDateTime &dateTime, const QString &format) const
{
- return d->dateTimeToString(format, dateTime, QDate(), QTime(), this);
+ return QCalendar().dateTimeToString(format, dateTime, QDate(), QTime(), *this);
}
#endif
@@ -2050,7 +2116,58 @@ QString QLocale::toString(const QDateTime &dateTime, const QString &format) cons
*/
QString QLocale::toString(const QDateTime &dateTime, QStringView format) const
{
- return d->dateTimeToString(format, dateTime, QDate(), QTime(), this);
+ return QCalendar().dateTimeToString(format, dateTime, QDate(), QTime(), *this);
+}
+
+QString QLocale::toString(const QDate &date, QStringView format, QCalendar cal) const
+{
+ return cal.dateTimeToString(format, QDateTime(), date, QTime(), *this);
+}
+
+QString QLocale::toString(const QDate &date, QLocale::FormatType format, QCalendar cal) const
+{
+ if (!date.isValid())
+ return QString();
+
+#ifndef QT_NO_SYSTEMLOCALE
+ if (cal.isGregorian() && d->m_data == systemData()) {
+ QVariant res = systemLocale()->query(format == LongFormat
+ ? QSystemLocale::DateToStringLong
+ : QSystemLocale::DateToStringShort,
+ date);
+ if (!res.isNull())
+ return res.toString();
+ }
+#endif
+
+ QString format_str = dateFormat(format);
+ return toString(date, format_str, cal);
+}
+
+QString QLocale::toString(const QDateTime &dateTime, QLocale::FormatType format,
+ QCalendar cal) const
+{
+ if (!dateTime.isValid())
+ return QString();
+
+#ifndef QT_NO_SYSTEMLOCALE
+ if (cal.isGregorian() && d->m_data == systemData()) {
+ QVariant res = systemLocale()->query(format == LongFormat
+ ? QSystemLocale::DateTimeToStringLong
+ : QSystemLocale::DateTimeToStringShort,
+ dateTime);
+ if (!res.isNull())
+ return res.toString();
+ }
+#endif
+
+ const QString format_str = dateTimeFormat(format);
+ return toString(dateTime, format_str, cal);
+}
+
+QString QLocale::toString(const QDateTime &dateTime, QStringView format, QCalendar cal) const
+{
+ return cal.dateTimeToString(format, dateTime, QDate(), QTime(), *this);
}
/*!
@@ -2094,7 +2211,8 @@ QString QLocale::toString(const QTime &time, FormatType format) const
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
- ? QSystemLocale::TimeToStringLong : QSystemLocale::TimeToStringShort,
+ ? QSystemLocale::TimeToStringLong
+ : QSystemLocale::TimeToStringShort,
time);
if (!res.isNull())
return res.toString();
@@ -2121,7 +2239,8 @@ QString QLocale::dateFormat(FormatType format) const
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
- ? QSystemLocale::DateFormatLong : QSystemLocale::DateFormatShort,
+ ? QSystemLocale::DateFormatLong
+ : QSystemLocale::DateFormatShort,
QVariant());
if (!res.isNull())
return res.toString();
@@ -2158,7 +2277,8 @@ QString QLocale::timeFormat(FormatType format) const
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(format == LongFormat
- ? QSystemLocale::TimeFormatLong : QSystemLocale::TimeFormatShort,
+ ? QSystemLocale::TimeFormatLong
+ : QSystemLocale::TimeFormatShort,
QVariant());
if (!res.isNull())
return res.toString();
@@ -2206,6 +2326,7 @@ QString QLocale::dateTimeFormat(FormatType format) const
return dateFormat(format) + QLatin1Char(' ') + timeFormat(format);
}
+#if QT_CONFIG(datestring)
/*!
\since 4.4
@@ -2217,12 +2338,19 @@ QString QLocale::dateTimeFormat(FormatType format) const
\sa timeFormat(), toDate(), toDateTime(), QTime::fromString()
*/
-#if QT_CONFIG(datestring)
QTime QLocale::toTime(const QString &string, FormatType format) const
{
return toTime(string, timeFormat(format));
}
-#endif
+
+/*!
+ \since 5.14
+ \overload
+*/
+QTime QLocale::toTime(const QString &string, FormatType format, QCalendar cal) const
+{
+ return toTime(string, timeFormat(format), cal);
+}
/*!
\since 4.4
@@ -2235,12 +2363,19 @@ QTime QLocale::toTime(const QString &string, FormatType format) const
\sa dateFormat(), toTime(), toDateTime(), QDate::fromString()
*/
-#if QT_CONFIG(datestring)
QDate QLocale::toDate(const QString &string, FormatType format) const
{
return toDate(string, dateFormat(format));
}
-#endif
+
+/*!
+ \since 5.14
+ \overload
+*/
+QDate QLocale::toDate(const QString &string, FormatType format, QCalendar cal) const
+{
+ return toDate(string, dateFormat(format), cal);
+}
/*!
\since 4.4
@@ -2253,13 +2388,19 @@ QDate QLocale::toDate(const QString &string, FormatType format) const
\sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString()
*/
-
-#if QT_CONFIG(datestring)
QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
{
return toDateTime(string, dateTimeFormat(format));
}
-#endif
+
+/*!
+ \since 5.14
+ \overload
+*/
+QDateTime QLocale::toDateTime(const QString &string, FormatType format, QCalendar cal) const
+{
+ return toDateTime(string, dateTimeFormat(format), cal);
+}
/*!
\since 4.4
@@ -2272,22 +2413,30 @@ QDateTime QLocale::toDateTime(const QString &string, FormatType format) const
\sa timeFormat(), toDate(), toDateTime(), QTime::fromString()
*/
-#if QT_CONFIG(datestring)
QTime QLocale::toTime(const QString &string, const QString &format) const
{
+ return toTime(string, format, QCalendar());
+}
+
+/*!
+ \since 5.14
+ \overload
+*/
+QTime QLocale::toTime(const QString &string, const QString &format, QCalendar cal) const
+{
QTime time;
#if QT_CONFIG(datetimeparser)
- QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString);
+ QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString, cal);
dt.setDefaultLocale(*this);
if (dt.parseFormat(format))
dt.fromString(string, 0, &time);
#else
+ Q_UNUSED(cal);
Q_UNUSED(string);
Q_UNUSED(format);
#endif
return time;
}
-#endif
/*!
\since 4.4
@@ -2303,22 +2452,30 @@ QTime QLocale::toTime(const QString &string, const QString &format) const
\sa dateFormat(), toTime(), toDateTime(), QDate::fromString()
*/
-#if QT_CONFIG(datestring)
QDate QLocale::toDate(const QString &string, const QString &format) const
{
+ return toDate(string, format, QCalendar());
+}
+
+/*!
+ \since 5.14
+ \overload
+*/
+QDate QLocale::toDate(const QString &string, const QString &format, QCalendar cal) const
+{
QDate date;
#if QT_CONFIG(datetimeparser)
- QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString);
+ QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString, cal);
dt.setDefaultLocale(*this);
if (dt.parseFormat(format))
dt.fromString(string, &date, 0);
#else
Q_UNUSED(string);
Q_UNUSED(format);
+ Q_UNUSED(cal);
#endif
return date;
}
-#endif
/*!
\since 4.4
@@ -2334,25 +2491,33 @@ QDate QLocale::toDate(const QString &string, const QString &format) const
\sa dateTimeFormat(), toTime(), toDate(), QDateTime::fromString()
*/
-#if QT_CONFIG(datestring)
QDateTime QLocale::toDateTime(const QString &string, const QString &format) const
{
+ return toDateTime(string, format, QCalendar());
+}
+
+/*!
+ \since 5.14
+ \overload
+*/
+QDateTime QLocale::toDateTime(const QString &string, const QString &format, QCalendar cal) const
+{
#if QT_CONFIG(datetimeparser)
QTime time;
QDate date;
- QDateTimeParser dt(QVariant::DateTime, QDateTimeParser::FromString);
+ QDateTimeParser dt(QVariant::DateTime, QDateTimeParser::FromString, cal);
dt.setDefaultLocale(*this);
if (dt.parseFormat(format) && dt.fromString(string, &date, &time))
return QDateTime(date, time);
#else
Q_UNUSED(string);
Q_UNUSED(format);
+ Q_UNUSED(cal);
#endif
return QDateTime(QDate(), QTime(-1, -1, -1));
}
-#endif
-
+#endif // datestring
/*!
\since 4.1
@@ -2499,8 +2664,8 @@ QString QLocale::toString(double i, char f, int prec) const
/*!
Returns a QLocale object initialized to the system locale.
- On Windows and Mac, this locale will use the decimal/grouping characters and date/time
- formats specified in the system configuration panel.
+ On Windows and Mac, this locale will use the decimal/grouping characters and
+ date/time formats specified in the system configuration panel.
\sa c()
*/
@@ -2521,10 +2686,12 @@ QLocale QLocale::system()
script and \a country.
Getting a list of all locales:
- QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
+ QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript,
+ QLocale::AnyCountry);
Getting a list of locales suitable for Russia:
- QList<QLocale> locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::Russia);
+ QList<QLocale> locales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript,
+ QLocale::Russia);
*/
QList<QLocale> QLocale::matchingLocales(QLocale::Language language,
QLocale::Script script,
@@ -2538,8 +2705,10 @@ QList<QLocale> QLocale::matchingLocales(QLocale::Language language,
return QList<QLocale>() << QLocale(QLocale::C);
QList<QLocale> result;
- if (language == QLocale::AnyLanguage && script == QLocale::AnyScript && country == QLocale::AnyCountry)
+ if (language == QLocale::AnyLanguage && script == QLocale::AnyScript
+ && country == QLocale::AnyCountry) {
result.reserve(locale_data_size);
+ }
const QLocaleData *data = locale_data + locale_index[language];
while ( (data != locale_data + locale_data_size)
&& (language == QLocale::AnyLanguage || data->m_language_id == uint(language))) {
@@ -2593,37 +2762,7 @@ QList<QLocale::Country> QLocale::countriesForLanguage(Language language)
*/
QString QLocale::monthName(int month, FormatType type) const
{
- if (month < 1 || month > 12)
- return QString();
-
-#ifndef QT_NO_SYSTEMLOCALE
- if (d->m_data == systemData()) {
- QVariant res = systemLocale()->query(type == LongFormat
- ? QSystemLocale::MonthNameLong : QSystemLocale::MonthNameShort,
- month);
- if (!res.isNull())
- return res.toString();
- }
-#endif
-
- quint32 idx, size;
- switch (type) {
- case QLocale::LongFormat:
- idx = d->m_data->m_long_month_names_idx;
- size = d->m_data->m_long_month_names_size;
- break;
- case QLocale::ShortFormat:
- idx = d->m_data->m_short_month_names_idx;
- size = d->m_data->m_short_month_names_size;
- break;
- case QLocale::NarrowFormat:
- idx = d->m_data->m_narrow_month_names_idx;
- size = d->m_data->m_narrow_month_names_size;
- break;
- default:
- return QString();
- }
- return getLocaleListData(months_data + idx, size, month - 1);
+ return QCalendar().monthName(*this, month, QCalendar::Unspecified, type);
}
/*!
@@ -2639,140 +2778,254 @@ QString QLocale::monthName(int month, FormatType type) const
*/
QString QLocale::standaloneMonthName(int month, FormatType type) const
{
- if (month < 1 || month > 12)
- return QString();
+ return QCalendar().standaloneMonthName(*this, month, QCalendar::Unspecified, type);
+}
-#ifndef QT_NO_SYSTEMLOCALE
- if (d->m_data == systemData()) {
- QVariant res = systemLocale()->query(type == LongFormat
- ? QSystemLocale::StandaloneMonthNameLong : QSystemLocale::StandaloneMonthNameShort,
- month);
- if (!res.isNull())
- return res.toString();
+/*!
+ \since 4.2
+
+ Returns the localized name of the \a day (where 1 represents
+ Monday, 2 represents Tuesday and so on), in the format specified
+ by \a type.
+
+ \sa monthName(), standaloneDayName()
+*/
+QString QLocale::dayName(int day, FormatType type) const
+{
+ return QCalendar().weekDayName(*this, day, type);
+}
+
+/*!
+ \since 4.5
+
+ Returns the localized name of the \a day (where 1 represents
+ Monday, 2 represents Tuesday and so on) that is used as a
+ standalone text, in the format specified by \a type.
+
+ If the locale information does not specify the standalone day
+ name then return value is the same as in dayName().
+
+ \sa dayName(), standaloneMonthName()
+*/
+QString QLocale::standaloneDayName(int day, FormatType type) const
+{
+ return QCalendar().standaloneWeekDayName(*this, day, type);
+}
+
+// Calendar look-up of month and day names:
+
+/*!
+ \internal
+ */
+
+static QString rawMonthName(const QCalendarLocale &localeData,
+ const ushort *monthsData, int month,
+ QLocale::FormatType type)
+{
+ quint32 idx, size;
+ switch (type) {
+ case QLocale::LongFormat:
+ idx = localeData.m_long.index;
+ size = localeData.m_long.size;
+ break;
+ case QLocale::ShortFormat:
+ idx = localeData.m_short.index;
+ size = localeData.m_short.size;
+ break;
+ case QLocale::NarrowFormat:
+ idx = localeData.m_narrow.index;
+ size = localeData.m_narrow.size;
+ break;
+ default:
+ return QString();
}
-#endif
+ return getLocaleListData(monthsData + idx, size, month - 1);
+}
+/*!
+ \internal
+ */
+
+static QString rawStandaloneMonthName(const QCalendarLocale &localeData,
+ const ushort *monthsData, int month,
+ QLocale::FormatType type)
+{
quint32 idx, size;
switch (type) {
case QLocale::LongFormat:
- idx = d->m_data->m_standalone_long_month_names_idx;
- size = d->m_data->m_standalone_long_month_names_size;
+ idx = localeData.m_standalone_long.index;
+ size = localeData.m_standalone_long.size;
break;
case QLocale::ShortFormat:
- idx = d->m_data->m_standalone_short_month_names_idx;
- size = d->m_data->m_standalone_short_month_names_size;
+ idx = localeData.m_standalone_short.index;
+ size = localeData.m_standalone_short.size;
break;
case QLocale::NarrowFormat:
- idx = d->m_data->m_standalone_narrow_month_names_idx;
- size = d->m_data->m_standalone_narrow_month_names_size;
+ idx = localeData.m_standalone_narrow.index;
+ size = localeData.m_standalone_narrow.size;
break;
default:
return QString();
}
- QString name = getLocaleListData(months_data + idx, size, month - 1);
- if (name.isEmpty())
- return monthName(month, type);
- return name;
+ QString name = getLocaleListData(monthsData + idx, size, month - 1);
+ return name.isEmpty() ? rawMonthName(localeData, monthsData, month, type) : name;
}
/*!
- \since 4.2
-
- Returns the localized name of the \a day (where 1 represents
- Monday, 2 represents Tuesday and so on), in the format specified
- by \a type.
+ \internal
+ */
- \sa monthName(), standaloneDayName()
-*/
-QString QLocale::dayName(int day, FormatType type) const
+static QString rawWeekDayName(const QLocaleData *data, const int day,
+ QLocale::FormatType type)
{
- if (day < 1 || day > 7)
+ quint32 idx, size;
+ switch (type) {
+ case QLocale::LongFormat:
+ idx = data->m_long_day_names_idx;
+ size = data->m_long_day_names_size;
+ break;
+ case QLocale::ShortFormat:
+ idx = data->m_short_day_names_idx;
+ size = data->m_short_day_names_size;
+ break;
+ case QLocale::NarrowFormat:
+ idx = data->m_narrow_day_names_idx;
+ size = data->m_narrow_day_names_size;
+ break;
+ default:
return QString();
-
-#ifndef QT_NO_SYSTEMLOCALE
- if (d->m_data == systemData()) {
- QVariant res = systemLocale()->query(type == LongFormat
- ? QSystemLocale::DayNameLong : QSystemLocale::DayNameShort,
- day);
- if (!res.isNull())
- return res.toString();
}
-#endif
- if (day == 7)
- day = 0;
+ return getLocaleListData(days_data + idx, size, day == 7 ? 0 : day);
+}
+
+/*!
+ \internal
+ */
+static QString rawStandaloneWeekDayName(const QLocaleData *data, const int day,
+ QLocale::FormatType type)
+{
quint32 idx, size;
switch (type) {
case QLocale::LongFormat:
- idx = d->m_data->m_long_day_names_idx;
- size = d->m_data->m_long_day_names_size;
+ idx = data->m_standalone_long_day_names_idx;
+ size = data->m_standalone_long_day_names_size;
break;
case QLocale::ShortFormat:
- idx = d->m_data->m_short_day_names_idx;
- size = d->m_data->m_short_day_names_size;
+ idx = data->m_standalone_short_day_names_idx;
+ size = data->m_standalone_short_day_names_size;
break;
case QLocale::NarrowFormat:
- idx = d->m_data->m_narrow_day_names_idx;
- size = d->m_data->m_narrow_day_names_size;
+ idx = data->m_standalone_narrow_day_names_idx;
+ size = data->m_standalone_narrow_day_names_size;
break;
default:
return QString();
}
- return getLocaleListData(days_data + idx, size, day);
+ QString name = getLocaleListData(days_data + idx, size, day == 7 ? 0 : day);
+ if (name.isEmpty())
+ return rawWeekDayName(data, day, type);
+ return name;
}
-/*!
- \since 4.5
+// Refugees from qcalendar.cpp that need functions above:
- Returns the localized name of the \a day (where 1 represents
- Monday, 2 represents Tuesday and so on) that is used as a
- standalone text, in the format specified by \a type.
+QString QCalendarBackend::monthName(const QLocale &locale, int month, int,
+ QLocale::FormatType format) const
+{
+ Q_ASSERT(month >= 1 && month <= maximumMonthsInYear());
+ return rawMonthName(localeMonthIndexData()[locale.d->m_data_offset],
+ localeMonthData(), month, format);
+}
- If the locale information does not specify the standalone day
- name then return value is the same as in dayName().
+QString QGregorianCalendar::monthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const
+{
+#ifndef QT_NO_SYSTEMLOCALE
+ if (locale.d->m_data == systemData()) {
+ Q_ASSERT(month >= 1 && month <= 12);
+ QVariant res = systemLocale()->query(format == QLocale::LongFormat
+ ? QSystemLocale::MonthNameLong
+ : QSystemLocale::MonthNameShort,
+ month);
+ if (!res.isNull())
+ return res.toString();
+ }
+#endif
- \sa dayName(), standaloneMonthName()
-*/
-QString QLocale::standaloneDayName(int day, FormatType type) const
+ return QCalendarBackend::monthName(locale, month, year, format);
+}
+
+QString QCalendarBackend::standaloneMonthName(const QLocale &locale, int month, int,
+ QLocale::FormatType format) const
+{
+ Q_ASSERT(month >= 1 && month <= maximumMonthsInYear());
+ return rawStandaloneMonthName(localeMonthIndexData()[locale.d->m_data_offset],
+ localeMonthData(), month, format);
+}
+
+QString QGregorianCalendar::standaloneMonthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const
+{
+#ifndef QT_NO_SYSTEMLOCALE
+ if (locale.d->m_data == systemData()) {
+ Q_ASSERT(month >= 1 && month <= 12);
+ QVariant res = systemLocale()->query(format == QLocale::LongFormat
+ ? QSystemLocale::StandaloneMonthNameLong
+ : QSystemLocale::StandaloneMonthNameShort,
+ month);
+ if (!res.isNull())
+ return res.toString();
+ }
+#endif
+
+ return QCalendarBackend::standaloneMonthName(locale, month, year, format);
+}
+
+// Most calendars share the common week-day naming, modulo locale.
+// Calendars that don't must override these methods.
+QString QCalendarBackend::weekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const
{
if (day < 1 || day > 7)
return QString();
#ifndef QT_NO_SYSTEMLOCALE
- if (d->m_data == systemData()) {
- QVariant res = systemLocale()->query(type == LongFormat
- ? QSystemLocale::DayNameLong : QSystemLocale::DayNameShort,
+ if (locale.d->m_data == systemData()) {
+ QVariant res = systemLocale()->query(format == QLocale::LongFormat
+ ? QSystemLocale::DayNameLong
+ : QSystemLocale::DayNameShort,
day);
if (!res.isNull())
return res.toString();
}
#endif
- if (day == 7)
- day = 0;
- quint32 idx, size;
- switch (type) {
- case QLocale::LongFormat:
- idx = d->m_data->m_standalone_long_day_names_idx;
- size = d->m_data->m_standalone_long_day_names_size;
- break;
- case QLocale::ShortFormat:
- idx = d->m_data->m_standalone_short_day_names_idx;
- size = d->m_data->m_standalone_short_day_names_size;
- break;
- case QLocale::NarrowFormat:
- idx = d->m_data->m_standalone_narrow_day_names_idx;
- size = d->m_data->m_standalone_narrow_day_names_size;
- break;
- default:
+ return rawWeekDayName(locale.d->m_data, day, format);
+}
+
+QString QCalendarBackend::standaloneWeekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const
+{
+ if (day < 1 || day > 7)
return QString();
+
+#ifndef QT_NO_SYSTEMLOCALE
+ if (locale.d->m_data == systemData()) {
+ QVariant res = systemLocale()->query(format == QLocale::LongFormat
+ ? QSystemLocale::DayNameLong
+ : QSystemLocale::DayNameShort,
+ day);
+ if (!res.isNull())
+ return res.toString();
}
- QString name = getLocaleListData(days_data + idx, size, day);
- if (name.isEmpty())
- return dayName(day == 0 ? 7 : day, type);
- return name;
+#endif
+
+ return rawStandaloneWeekDayName(locale.d->m_data, day, format);
}
+// End of this block of qcalendar.cpp refugees. (One more follows.)
+
/*!
\since 4.8
@@ -2976,10 +3229,11 @@ QString QLocale::pmText() const
return getLocaleData(pm_data + d->m_data->m_pm_idx, d->m_data->m_pm_size);
}
+// Another intrusion from QCalendar, using some of the tools above:
-QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &datetime,
- const QDate &dateOnly, const QTime &timeOnly,
- const QLocale *q) const
+QString QCalendarBackend::dateTimeToString(QStringView format, const QDateTime &datetime,
+ const QDate &dateOnly, const QTime &timeOnly,
+ const QLocale &locale) const
{
QDate date;
QTime time;
@@ -3001,6 +3255,15 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
}
QString result;
+ int year = 0, month = 0, day = 0;
+ if (formatDate) {
+ const auto parts = julianDayToDate(date.toJulianDay());
+ if (!parts.isValid())
+ return QString();
+ year = parts.year;
+ month = parts.month;
+ day = parts.day;
+ }
int i = 0;
while (i < format.size()) {
@@ -3023,14 +3286,14 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
switch (repeat) {
case 4: {
- const int yr = date.year();
- const int len = (yr < 0) ? 5 : 4;
- result.append(m_data->longLongToString(yr, -1, 10, len, QLocaleData::ZeroPadded));
+ const int len = (year < 0) ? 5 : 4;
+ result.append(locale.d->m_data->longLongToString(year, -1, 10, len,
+ QLocaleData::ZeroPadded));
break;
}
case 2:
- result.append(m_data->longLongToString(date.year() % 100, -1, 10, 2,
- QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(year % 100, -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
default:
repeat = 1;
@@ -3044,16 +3307,17 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
repeat = qMin(repeat, 4);
switch (repeat) {
case 1:
- result.append(m_data->longLongToString(date.month()));
+ result.append(locale.d->m_data->longLongToString(month));
break;
case 2:
- result.append(m_data->longLongToString(date.month(), -1, 10, 2, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(month, -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
case 3:
- result.append(q->monthName(date.month(), QLocale::ShortFormat));
+ result.append(monthName(locale, month, year, QLocale::ShortFormat));
break;
case 4:
- result.append(q->monthName(date.month(), QLocale::LongFormat));
+ result.append(monthName(locale, month, year, QLocale::LongFormat));
break;
}
break;
@@ -3063,16 +3327,19 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
repeat = qMin(repeat, 4);
switch (repeat) {
case 1:
- result.append(m_data->longLongToString(date.day()));
+ result.append(locale.d->m_data->longLongToString(day));
break;
case 2:
- result.append(m_data->longLongToString(date.day(), -1, 10, 2, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(day, -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
case 3:
- result.append(q->dayName(date.dayOfWeek(), QLocale::ShortFormat));
+ result.append(locale.dayName(
+ dayOfWeek(date.toJulianDay()), QLocale::ShortFormat));
break;
case 4:
- result.append(q->dayName(date.dayOfWeek(), QLocale::LongFormat));
+ result.append(locale.dayName(
+ dayOfWeek(date.toJulianDay()), QLocale::LongFormat));
break;
}
break;
@@ -3096,10 +3363,11 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
switch (repeat) {
case 1:
- result.append(m_data->longLongToString(hour));
+ result.append(locale.d->m_data->longLongToString(hour));
break;
case 2:
- result.append(m_data->longLongToString(hour, -1, 10, 2, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(hour, -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
}
break;
@@ -3109,10 +3377,11 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
repeat = qMin(repeat, 2);
switch (repeat) {
case 1:
- result.append(m_data->longLongToString(time.hour()));
+ result.append(locale.d->m_data->longLongToString(time.hour()));
break;
case 2:
- result.append(m_data->longLongToString(time.hour(), -1, 10, 2, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(time.hour(), -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
}
break;
@@ -3122,10 +3391,11 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
repeat = qMin(repeat, 2);
switch (repeat) {
case 1:
- result.append(m_data->longLongToString(time.minute()));
+ result.append(locale.d->m_data->longLongToString(time.minute()));
break;
case 2:
- result.append(m_data->longLongToString(time.minute(), -1, 10, 2, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(time.minute(), -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
}
break;
@@ -3135,78 +3405,67 @@ QString QLocalePrivate::dateTimeToString(QStringView format, const QDateTime &da
repeat = qMin(repeat, 2);
switch (repeat) {
case 1:
- result.append(m_data->longLongToString(time.second()));
+ result.append(locale.d->m_data->longLongToString(time.second()));
break;
case 2:
- result.append(m_data->longLongToString(time.second(), -1, 10, 2, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(time.second(), -1, 10, 2,
+ QLocaleData::ZeroPadded));
break;
}
break;
case 'a':
used = true;
- if (i + 1 < format.size() && format.at(i + 1).unicode() == 'p') {
- repeat = 2;
- } else {
- repeat = 1;
- }
- result.append(time.hour() < 12 ? q->amText().toLower() : q->pmText().toLower());
+ repeat = format.mid(i + 1).startsWith(QLatin1Char('p')) ? 2 : 1;
+ result.append(time.hour() < 12 ? locale.amText().toLower()
+ : locale.pmText().toLower());
break;
case 'A':
used = true;
- if (i + 1 < format.size() && format.at(i + 1).unicode() == 'P') {
- repeat = 2;
- } else {
- repeat = 1;
- }
- result.append(time.hour() < 12 ? q->amText().toUpper() : q->pmText().toUpper());
+ repeat = format.mid(i + 1).startsWith(QLatin1Char('P')) ? 2 : 1;
+ result.append(time.hour() < 12 ? locale.amText().toUpper()
+ : locale.pmText().toUpper());
break;
case 'z':
used = true;
- if (repeat >= 3) {
- repeat = 3;
- } else {
- repeat = 1;
- }
+ repeat = (repeat >= 3) ? 3 : 1;
// note: the millisecond component is treated like the decimal part of the seconds
// so ms == 2 is always printed as "002", but ms == 200 can be either "2" or "200"
- result.append(m_data->longLongToString(time.msec(), -1, 10, 3, QLocaleData::ZeroPadded));
+ result.append(locale.d->m_data->longLongToString(time.msec(), -1, 10, 3,
+ QLocaleData::ZeroPadded));
if (repeat == 1) {
- if (result.endsWith(zero()))
+ if (result.endsWith(locale.d->zero()))
result.chop(1);
- if (result.endsWith(zero()))
+ if (result.endsWith(locale.d->zero()))
result.chop(1);
}
-
break;
case 't':
used = true;
repeat = 1;
// If we have a QDateTime use the time spec otherwise use the current system tzname
- if (formatDate) {
- result.append(datetime.timeZoneAbbreviation());
- } else {
- result.append(QDateTime::currentDateTime().timeZoneAbbreviation());
- }
+ result.append(formatDate ? datetime.timeZoneAbbreviation()
+ : QDateTime::currentDateTime().timeZoneAbbreviation());
break;
default:
break;
}
}
- if (!used) {
+ if (!used)
result.append(QString(repeat, c));
- }
i += repeat;
}
return result;
}
+// End of QCalendar intrustions
+
QString QLocaleData::doubleToString(double d, int precision, DoubleForm form,
int width, unsigned flags) const
{
@@ -3216,7 +3475,8 @@ QString QLocaleData::doubleToString(double d, int precision, DoubleForm form,
QString QLocaleData::doubleToString(const QChar _zero, const QChar plus, const QChar minus,
const QChar exponential, const QChar group, const QChar decimal,
- double d, int precision, DoubleForm form, int width, unsigned flags)
+ double d, int precision, DoubleForm form, int width,
+ unsigned flags)
{
if (precision != QLocale::FloatingPointShortest && precision < 0)
precision = 6;
@@ -3589,11 +3849,14 @@ bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_o
return false;
// check distance from the last separator or from the beginning of the digits
- // ### FIXME: Some locales allow other groupings! See https://en.wikipedia.org/wiki/Thousands_separator
+ // ### FIXME: Some locales allow other groupings!
+ // See https://en.wikipedia.org/wiki/Thousands_separator
if (last_separator_idx != -1 && idx - last_separator_idx != 4)
return false;
- if (last_separator_idx == -1 && (start_of_digits_idx == -1 || idx - start_of_digits_idx > 3))
+ if (last_separator_idx == -1
+ && (start_of_digits_idx == -1 || idx - start_of_digits_idx > 3)) {
return false;
+ }
last_separator_idx = idx;
++group_cnt;
@@ -3603,7 +3866,8 @@ bool QLocaleData::numberToCLocale(QStringView s, QLocale::NumberOptions number_o
continue;
} else if (out == '.' || out == 'e' || out == 'E') {
// check distance from the last separator
- // ### FIXME: Some locales allow other groupings! See https://en.wikipedia.org/wiki/Thousands_separator
+ // ### FIXME: Some locales allow other groupings!
+ // See https://en.wikipedia.org/wiki/Thousands_separator
if (last_separator_idx != -1 && idx - last_separator_idx != 4)
return false;
@@ -3663,9 +3927,10 @@ bool QLocaleData::validateChars(QStringView str, NumberMode numMode, QByteArray
// The only non-digit character after the 'e' can be '+' or '-'.
// If a zero is directly after that, then the exponent is zero-padded.
- if ((number_options & QLocale::RejectLeadingZeroInExponent) && c == '0' && eCnt > 0 &&
- !lastWasDigit)
+ if ((number_options & QLocale::RejectLeadingZeroInExponent)
+ && c == '0' && eCnt > 0 && !lastWasDigit) {
return false;
+ }
lastWasDigit = true;
} else {
@@ -3917,7 +4182,8 @@ QString QLocale::toCurrencyString(qlonglong value, const QString &symbol) const
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QSystemLocale::CurrencyToStringArgument arg(value, symbol);
- QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
+ QVariant res =
+ systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
if (!res.isNull())
return res.toString();
}
@@ -3947,7 +4213,8 @@ QString QLocale::toCurrencyString(qulonglong value, const QString &symbol) const
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QSystemLocale::CurrencyToStringArgument arg(value, symbol);
- QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
+ QVariant res =
+ systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
if (!res.isNull())
return res.toString();
}
@@ -3989,7 +4256,8 @@ QString QLocale::toCurrencyString(double value, const QString &symbol, int preci
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QSystemLocale::CurrencyToStringArgument arg(value, symbol);
- QVariant res = systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
+ QVariant res =
+ systemLocale()->query(QSystemLocale::CurrencyToString, QVariant::fromValue(arg));
if (!res.isNull())
return res.toString();
}
@@ -4116,33 +4384,90 @@ QString QLocale::formattedDataSize(qint64 bytes, int precision, DataSizeFormats
*/
QStringList QLocale::uiLanguages() const
{
+ QStringList uiLanguages;
+ QVector<QLocale> locales;
#ifndef QT_NO_SYSTEMLOCALE
if (d->m_data == systemData()) {
QVariant res = systemLocale()->query(QSystemLocale::UILanguages, QVariant());
if (!res.isNull()) {
- QStringList result = res.toStringList();
- if (!result.isEmpty())
- return result;
+ uiLanguages = res.toStringList();
+ // ... but we need to include likely-adjusted forms of each of those, too:
+ for (const auto entry : qAsConst(uiLanguages))
+ locales.append(QLocale(entry));
}
- }
+ } else
#endif
- QLocaleId id = QLocaleId::fromIds(d->m_data->m_language_id, d->m_data->m_script_id, d->m_data->m_country_id);
- const QLocaleId max = id.withLikelySubtagsAdded();
- const QLocaleId min = max.withLikelySubtagsRemoved();
+ {
+ locales.append(*this);
+ }
+ for (int i = locales.size(); i-- > 0; ) {
+ const QLocale &locale = locales.at(i);
+ int j;
+ QByteArray prior;
+ if (i < uiLanguages.size()) {
+ // Adding likely-adjusted forms to system locale's list.
+ // Name the locale is derived from:
+ const QString &name = uiLanguages.at(i);
+ prior = name.toLatin1();
+ // Don't try to likely-adjust if construction's likely-adjustments
+ // were so drastic the result doesn't match the prior name:
+ if (locale.name() != name && locale.d->rawName() != prior)
+ continue;
+ // Insert just after prior:
+ j = i + 1;
+ } else {
+ // Plain locale, not system locale; just append.
+ j = uiLanguages.size();
+ }
+ const auto data = locale.d->m_data;
+
+ QLocaleId id
+ = QLocaleId::fromIds(data->m_language_id, data->m_script_id, data->m_country_id);
+ const QLocaleId max = id.withLikelySubtagsAdded();
+ const QLocaleId min = max.withLikelySubtagsRemoved();
+ id.script_id = 0; // For re-use as script-less variant.
+
+ // Include version with all likely sub-tags (last) if distinct from the rest:
+ if (max != min && max != id && max.name() != prior)
+ uiLanguages.insert(j, QString::fromLatin1(max.name()));
+
+ // Include scriptless version if likely-equivalent and distinct:
+ if (data->m_script_id && id != min && id.name() != prior
+ && id.withLikelySubtagsAdded() == max) {
+ uiLanguages.insert(j, QString::fromLatin1(id.name()));
+ }
- QStringList uiLanguages;
- uiLanguages.append(QString::fromLatin1(min.name()));
- if (id.script_id) {
- id.script_id = 0;
- if (id != min && id.withLikelySubtagsAdded() == max)
- uiLanguages.append(QString::fromLatin1(id.name()));
+ // Include minimal version (first) unless it's what our locale is derived from:
+ if (min.name() != prior)
+ uiLanguages.insert(j, QString::fromLatin1(min.name()));
}
- if (max != min && max != id)
- uiLanguages.append(QString::fromLatin1(max.name()));
return uiLanguages;
}
/*!
+ \since 5.13
+
+ Returns the locale to use for collation.
+
+ The result is usually this locale; however, the system locale (which is
+ commonly the default locale) will return the system collation locale.
+ The result is suitable for passing to QCollator's constructor.
+
+ \sa QCollator
+*/
+QLocale QLocale::collation() const
+{
+#ifndef QT_NO_SYSTEMLOCALE
+ if (d->m_data == systemData()) {
+ QString res = systemLocale()->query(QSystemLocale::Collation, QVariant()).toString();
+ if (!res.isEmpty())
+ return QLocale(res);
+ }
+#endif
+ return *this;
+}
+
+/*!
\since 4.8
Returns a native name of the language for the locale. For example
@@ -4159,7 +4484,8 @@ QString QLocale::nativeLanguageName() const
return res.toString();
}
#endif
- return getLocaleData(endonyms_data + d->m_data->m_language_endonym_idx, d->m_data->m_language_endonym_size);
+ return getLocaleData(endonyms_data + d->m_data->m_language_endonym_idx,
+ d->m_data->m_language_endonym_size);
}
/*!
@@ -4179,7 +4505,8 @@ QString QLocale::nativeCountryName() const
return res.toString();
}
#endif
- return getLocaleData(endonyms_data + d->m_data->m_country_endonym_idx, d->m_data->m_country_endonym_size);
+ return getLocaleData(endonyms_data + d->m_data->m_country_endonym_idx,
+ d->m_data->m_country_endonym_size);
}
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/corelib/tools/qlocale.h b/src/corelib/text/qlocale.h
index 2b4f131552..8b73eb5493 100644
--- a/src/corelib/tools/qlocale.h
+++ b/src/corelib/text/qlocale.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -47,7 +47,7 @@
QT_BEGIN_NAMESPACE
-
+class QCalendar;
class QDataStream;
class QDate;
class QDateTime;
@@ -59,7 +59,7 @@ class QTextStreamPrivate;
class QLocalePrivate;
-Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QLocale
{
@@ -441,6 +441,11 @@ public:
Sicilian = 362,
SouthernKurdish = 363,
WesternBalochi = 364,
+ Cebuano = 365,
+ Erzya = 366,
+ Chickasaw = 367,
+ Muscogee = 368,
+ Silesian = 369,
Afan = Oromo,
Bhutani = Dzongkha,
@@ -457,7 +462,7 @@ public:
Twi = Akan,
Uigur = Uighur,
- LastLanguage = WesternBalochi
+ LastLanguage = Silesian
};
enum Script {
@@ -939,13 +944,11 @@ public:
QLocale(Language language, Country country = AnyCountry);
QLocale(Language language, Script script, Country country);
QLocale(const QLocale &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QLocale &operator=(QLocale &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QLocale &operator=(QLocale &&other) noexcept { swap(other); return *this; }
QLocale &operator=(const QLocale &other);
~QLocale();
- void swap(QLocale &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QLocale &other) noexcept { qSwap(d, other.d); }
Language language() const;
Script script() const;
@@ -1013,6 +1016,14 @@ public:
QString toString(const QDate &date, FormatType format = LongFormat) const;
QString toString(const QTime &time, FormatType format = LongFormat) const;
QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const;
+ /* Removing default value for `format' is done intentionally,
+ * after all tests we will remove non-calendar-aware version of these functions,
+ * and add a default value for both calendar instance, and format
+ */
+ QString toString(const QDate &date, QStringView formatStr, QCalendar cal) const;
+ QString toString(const QDate &date, FormatType format, QCalendar cal) const;
+ QString toString(const QDateTime &dateTime, FormatType format, QCalendar cal) const;
+ QString toString(const QDateTime &dateTime, QStringView formatStr, QCalendar cal) const;
QString dateFormat(FormatType format = LongFormat) const;
QString timeFormat(FormatType format = LongFormat) const;
@@ -1024,6 +1035,13 @@ public:
QDate toDate(const QString &string, const QString &format) const;
QTime toTime(const QString &string, const QString &format) const;
QDateTime toDateTime(const QString &string, const QString &format) const;
+ // Calendar-aware API
+ QDate toDate(const QString &string, FormatType format, QCalendar cal) const;
+ QTime toTime(const QString &string, FormatType format, QCalendar cal) const;
+ QDateTime toDateTime(const QString &string, FormatType format, QCalendar cal) const;
+ QDate toDate(const QString &string, const QString &format, QCalendar cal) const;
+ QTime toTime(const QString &string, const QString &format, QCalendar cal) const;
+ QDateTime toDateTime(const QString &string, const QString &format, QCalendar cal) const;
#endif
// ### Qt 5: We need to return QString from these function since
@@ -1048,7 +1066,7 @@ public:
QString pmText() const;
MeasurementSystem measurementSystem() const;
-
+ QLocale collation() const;
Qt::LayoutDirection textDirection() const;
QString toUpper(const QString &str) const;
@@ -1108,7 +1126,9 @@ private:
QLocale(QLocalePrivate &dd);
friend class QLocalePrivate;
friend class QSystemLocale;
- friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) Q_DECL_NOTHROW;
+ friend class QCalendarBackend;
+ friend class QGregorianCalendar;
+ friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) noexcept;
QSharedDataPointer<QLocalePrivate> d;
};
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/text/qlocale.qdoc
index 484987c40b..6c9d6f9d11 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/text/qlocale.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -92,7 +92,7 @@
\note For the current keyboard input locale take a look at
QInputMethod::locale().
- QLocale's data is based on Common Locale Data Repository v35.1.
+ QLocale's data is based on Common Locale Data Repository v36.
\sa QString::arg(), QString::toInt(), QString::toDouble(),
QInputMethod::locale()
@@ -164,6 +164,7 @@
\value Cantonese Since Qt 5.7
\value Carian Since Qt 5.1
\value Catalan
+ \value Cebuano Since Qt 5.14
\value CentralKurdish Since Qt 5.5
\value CentralMoroccoTamazight
\value Chakma Since Qt 5.1
@@ -171,6 +172,7 @@
\value Chechen
\value Cherokee
\value Chewa Obsolete, please use Nyanja
+ \value Chickasaw Since Qt 5.14
\value Chiga
\value Chinese
\value Church
@@ -194,6 +196,7 @@
\value EasternKayah Since Qt 5.1
\value Embu
\value English
+ \value Erzya Since Qt 5.14
\value Esperanto
\value Estonian
\value Etruscan Since Qt 5.1
@@ -331,6 +334,7 @@
\value Morisyen
\value Mru Since Qt 5.7
\value Mundang
+ \value Muscogee Since Qt 5.14
\value Nama
\value NauruLanguage
\value Navaho
@@ -404,6 +408,7 @@
\value SichuanYi
\value Sicilian Since Qt 5.12
\value Sidamo
+ \value Silesian Since Qt 5.14
\value Sindhi
\value Sinhala
\value SkoltSami Since Qt 5.5
diff --git a/src/corelib/text/qlocale_data_p.h b/src/corelib/text/qlocale_data_p.h
new file mode 100644
index 0000000000..5f29a74d37
--- /dev/null
+++ b/src/corelib/text/qlocale_data_p.h
@@ -0,0 +1,6874 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QLOCALE_DATA_P_H
+#define QLOCALE_DATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/* This part of the file isn't generated, but written by hand since
+ * Unicode CLDR doesn't contain measurement system information.
+ */
+struct CountryLanguage
+{
+ quint16 languageId;
+ quint16 countryId;
+ QLocale::MeasurementSystem system;
+};
+static const CountryLanguage ImperialMeasurementSystems[] = {
+ { QLocale::English, QLocale::UnitedStates, QLocale::ImperialUSSystem },
+ { QLocale::English, QLocale::UnitedStatesMinorOutlyingIslands, QLocale::ImperialUSSystem },
+ { QLocale::Spanish, QLocale::UnitedStates, QLocale::ImperialUSSystem },
+ { QLocale::Hawaiian, QLocale::UnitedStates, QLocale::ImperialUSSystem },
+ { QLocale::English, QLocale::UnitedKingdom, QLocale::ImperialUKSystem }
+};
+static const int ImperialMeasurementSystemsCount =
+ sizeof(ImperialMeasurementSystems)/sizeof(ImperialMeasurementSystems[0]);
+
+// GENERATED PART STARTS HERE
+
+/*
+ This part of the file was generated on 2019-10-24 from the
+ Common Locale Data Repository v36
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this section: instead regenerate it using
+ cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+static const QLocaleId likely_subtags[] = {
+ { 4, 0, 0 }, { 4, 7, 69 }, // aa -> aa_Latn_ET
+ { 2, 0, 0 }, { 2, 2, 81 }, // ab -> ab_Cyrl_GE
+ { 255, 0, 0 }, { 255, 36, 102 }, // ae -> ae_Avst_IR
+ { 5, 0, 0 }, { 5, 7, 195 }, // af -> af_Latn_ZA
+ { 237, 0, 0 }, { 237, 7, 37 }, // agq -> agq_Latn_CM
+ { 340, 0, 0 }, { 340, 128, 100 }, // aho -> aho_Ahom_IN
+ { 146, 0, 0 }, { 146, 7, 83 }, // ak -> ak_Latn_GH
+ { 262, 0, 0 }, { 262, 94, 103 }, // akk -> akk_Xsux_IQ
+ { 7, 0, 0 }, { 7, 14, 69 }, // am -> am_Ethi_ET
+ { 261, 0, 0 }, { 261, 7, 197 }, // an -> an_Latn_ES
+ { 8, 0, 0 }, { 8, 1, 64 }, // ar -> ar_Arab_EG
+ { 265, 0, 0 }, { 265, 57, 102 }, // arc -> arc_Armi_IR
+ { 265, 119, 0 }, { 265, 119, 109 }, // arc_Nbat -> arc_Nbat_JO
+ { 265, 120, 0 }, { 265, 120, 207 }, // arc_Palm -> arc_Palm_SY
+ { 315, 0, 0 }, { 315, 7, 43 }, // arn -> arn_Latn_CL
+ { 10, 0, 0 }, { 10, 11, 100 }, // as -> as_Beng_IN
+ { 205, 0, 0 }, { 205, 7, 210 }, // asa -> asa_Latn_TZ
+ { 341, 0, 0 }, { 341, 133, 225 }, // ase -> ase_Sgnw_US
+ { 256, 0, 0 }, { 256, 7, 197 }, // ast -> ast_Latn_ES
+ { 216, 0, 0 }, { 216, 2, 178 }, // av -> av_Cyrl_RU
+ { 11, 0, 0 }, { 11, 7, 26 }, // ay -> ay_Latn_BO
+ { 12, 0, 0 }, { 12, 7, 15 }, // az -> az_Latn_AZ
+ { 12, 0, 103 }, { 12, 1, 103 }, // az_IQ -> az_Arab_IQ
+ { 12, 0, 102 }, { 12, 1, 102 }, // az_IR -> az_Arab_IR
+ { 12, 0, 178 }, { 12, 2, 178 }, // az_RU -> az_Cyrl_RU
+ { 12, 1, 0 }, { 12, 1, 102 }, // az_Arab -> az_Arab_IR
+ { 13, 0, 0 }, { 13, 2, 178 }, // ba -> ba_Cyrl_RU
+ { 266, 0, 0 }, { 266, 7, 101 }, // ban -> ban_Latn_ID
+ { 238, 0, 0 }, { 238, 7, 37 }, // bas -> bas_Latn_CM
+ { 267, 0, 0 }, { 267, 38, 37 }, // bax -> bax_Bamu_CM
+ { 268, 0, 0 }, { 268, 7, 101 }, // bbc -> bbc_Latn_ID
+ { 22, 0, 0 }, { 22, 2, 20 }, // be -> be_Cyrl_BY
+ { 195, 0, 0 }, { 195, 7, 239 }, // bem -> bem_Latn_ZM
+ { 186, 0, 0 }, { 186, 7, 210 }, // bez -> bez_Latn_TZ
+ { 20, 0, 0 }, { 20, 2, 33 }, // bg -> bg_Cyrl_BG
+ { 364, 0, 0 }, { 364, 1, 163 }, // bgn -> bgn_Arab_PK
+ { 343, 0, 0 }, { 343, 13, 100 }, // bho -> bho_Deva_IN
+ { 18, 0, 0 }, { 18, 7, 229 }, // bi -> bi_Latn_VU
+ { 270, 0, 0 }, { 270, 7, 170 }, // bku -> bku_Latn_PH
+ { 309, 0, 0 }, { 309, 100, 232 }, // blt -> blt_Tavt_VN
+ { 188, 0, 0 }, { 188, 7, 132 }, // bm -> bm_Latn_ML
+ { 15, 0, 0 }, { 15, 11, 18 }, // bn -> bn_Beng_BD
+ { 121, 0, 0 }, { 121, 31, 44 }, // bo -> bo_Tibt_CN
+ { 19, 0, 0 }, { 19, 7, 74 }, // br -> br_Latn_FR
+ { 215, 0, 0 }, { 215, 13, 100 }, // brx -> brx_Deva_IN
+ { 142, 0, 0 }, { 142, 7, 27 }, // bs -> bs_Latn_BA
+ { 336, 0, 0 }, { 336, 106, 121 }, // bsq -> bsq_Bass_LR
+ { 312, 0, 0 }, { 312, 7, 37 }, // bss -> bss_Latn_CM
+ { 269, 0, 0 }, { 269, 7, 101 }, // bug -> bug_Latn_ID
+ { 152, 0, 0 }, { 152, 14, 67 }, // byn -> byn_Ethi_ER
+ { 24, 0, 0 }, { 24, 7, 197 }, // ca -> ca_Latn_ES
+ { 156, 0, 0 }, { 156, 7, 157 }, // cch -> cch_Latn_NG
+ { 272, 0, 0 }, { 272, 46, 18 }, // ccp -> ccp_Cakm_BD
+ { 218, 0, 0 }, { 218, 2, 178 }, // ce -> ce_Cyrl_RU
+ { 365, 0, 0 }, { 365, 7, 170 }, // ceb -> ceb_Latn_PH
+ { 211, 0, 0 }, { 211, 7, 221 }, // cgg -> cgg_Latn_UG
+ { 217, 0, 0 }, { 217, 7, 89 }, // ch -> ch_Latn_GU
+ { 190, 0, 0 }, { 190, 12, 225 }, // chr -> chr_Cher_US
+ { 367, 0, 0 }, { 367, 7, 225 }, // cic -> cic_Latn_US
+ { 276, 0, 0 }, { 276, 47, 232 }, // cjm -> cjm_Cham_VN
+ { 316, 0, 0 }, { 316, 1, 103 }, // ckb -> ckb_Arab_IQ
+ { 26, 0, 0 }, { 26, 7, 74 }, // co -> co_Latn_FR
+ { 274, 0, 0 }, { 274, 48, 64 }, // cop -> cop_Copt_EG
+ { 221, 0, 0 }, { 221, 44, 38 }, // cr -> cr_Cans_CA
+ { 28, 0, 0 }, { 28, 7, 57 }, // cs -> cs_Latn_CZ
+ { 338, 0, 0 }, { 338, 121, 147 }, // ctd -> ctd_Pauc_MM
+ { 219, 0, 0 }, { 219, 2, 178 }, // cu -> cu_Cyrl_RU
+ { 219, 52, 0 }, { 219, 52, 33 }, // cu_Glag -> cu_Glag_BG
+ { 220, 0, 0 }, { 220, 2, 178 }, // cv -> cv_Cyrl_RU
+ { 134, 0, 0 }, { 134, 7, 224 }, // cy -> cy_Latn_GB
+ { 29, 0, 0 }, { 29, 7, 58 }, // da -> da_Latn_DK
+ { 176, 0, 0 }, { 176, 7, 111 }, // dav -> dav_Latn_KE
+ { 42, 0, 0 }, { 42, 7, 82 }, // de -> de_Latn_DE
+ { 239, 0, 0 }, { 239, 7, 156 }, // dje -> dje_Latn_NE
+ { 275, 0, 0 }, { 275, 1, 100 }, // doi -> doi_Arab_IN
+ { 317, 0, 0 }, { 317, 7, 82 }, // dsb -> dsb_Latn_DE
+ { 240, 0, 0 }, { 240, 7, 37 }, // dua -> dua_Latn_CM
+ { 143, 0, 0 }, { 143, 29, 131 }, // dv -> dv_Thaa_MV
+ { 241, 0, 0 }, { 241, 7, 187 }, // dyo -> dyo_Latn_SN
+ { 16, 0, 0 }, { 16, 31, 25 }, // dz -> dz_Tibt_BT
+ { 189, 0, 0 }, { 189, 7, 111 }, // ebu -> ebu_Latn_KE
+ { 161, 0, 0 }, { 161, 7, 83 }, // ee -> ee_Latn_GH
+ { 263, 0, 0 }, { 263, 50, 64 }, // egy -> egy_Egyp_EG
+ { 277, 0, 0 }, { 277, 63, 147 }, // eky -> eky_Kali_MM
+ { 43, 0, 0 }, { 43, 16, 85 }, // el -> el_Grek_GR
+ { 31, 0, 0 }, { 31, 7, 225 }, // en -> en_Latn_US
+ { 31, 92, 0 }, { 31, 92, 224 }, // en_Shaw -> en_Shaw_GB
+ { 32, 0, 0 }, { 32, 7, 260 }, // eo -> eo_Latn_001
+ { 111, 0, 0 }, { 111, 7, 197 }, // es -> es_Latn_ES
+ { 33, 0, 0 }, { 33, 7, 68 }, // et -> et_Latn_EE
+ { 278, 0, 0 }, { 278, 79, 106 }, // ett -> ett_Ital_IT
+ { 14, 0, 0 }, { 14, 7, 197 }, // eu -> eu_Latn_ES
+ { 242, 0, 0 }, { 242, 7, 37 }, // ewo -> ewo_Latn_CM
+ { 89, 0, 0 }, { 89, 1, 102 }, // fa -> fa_Arab_IR
+ { 177, 0, 0 }, { 177, 7, 187 }, // ff -> ff_Latn_SN
+ { 177, 134, 0 }, { 177, 134, 91 }, // ff_Adlm -> ff_Adlm_GN
+ { 36, 0, 0 }, { 36, 7, 73 }, // fi -> fi_Latn_FI
+ { 166, 0, 0 }, { 166, 7, 170 }, // fil -> fil_Latn_PH
+ { 35, 0, 0 }, { 35, 7, 72 }, // fj -> fj_Latn_FJ
+ { 34, 0, 0 }, { 34, 7, 71 }, // fo -> fo_Latn_FO
+ { 37, 0, 0 }, { 37, 7, 74 }, // fr -> fr_Latn_FR
+ { 159, 0, 0 }, { 159, 7, 106 }, // fur -> fur_Latn_IT
+ { 38, 0, 0 }, { 38, 7, 151 }, // fy -> fy_Latn_NL
+ { 57, 0, 0 }, { 57, 7, 104 }, // ga -> ga_Latn_IE
+ { 148, 0, 0 }, { 148, 7, 83 }, // gaa -> gaa_Latn_GH
+ { 39, 0, 0 }, { 39, 7, 224 }, // gd -> gd_Latn_GB
+ { 153, 0, 0 }, { 153, 14, 69 }, // gez -> gez_Ethi_ET
+ { 40, 0, 0 }, { 40, 7, 197 }, // gl -> gl_Latn_ES
+ { 45, 0, 0 }, { 45, 7, 168 }, // gn -> gn_Latn_PY
+ { 279, 0, 0 }, { 279, 53, 222 }, // got -> got_Goth_UA
+ { 264, 0, 0 }, { 264, 49, 56 }, // grc -> grc_Cprt_CY
+ { 264, 68, 0 }, { 264, 68, 85 }, // grc_Linb -> grc_Linb_GR
+ { 167, 0, 0 }, { 167, 7, 206 }, // gsw -> gsw_Latn_CH
+ { 46, 0, 0 }, { 46, 17, 100 }, // gu -> gu_Gujr_IN
+ { 175, 0, 0 }, { 175, 7, 111 }, // guz -> guz_Latn_KE
+ { 144, 0, 0 }, { 144, 7, 251 }, // gv -> gv_Latn_IM
+ { 47, 0, 0 }, { 47, 7, 157 }, // ha -> ha_Latn_NG
+ { 47, 0, 37 }, { 47, 1, 37 }, // ha_CM -> ha_Arab_CM
+ { 47, 0, 201 }, { 47, 1, 201 }, // ha_SD -> ha_Arab_SD
+ { 163, 0, 0 }, { 163, 7, 225 }, // haw -> haw_Latn_US
+ { 48, 0, 0 }, { 48, 18, 105 }, // he -> he_Hebr_IL
+ { 49, 0, 0 }, { 49, 13, 100 }, // hi -> hi_Deva_IN
+ { 344, 0, 0 }, { 344, 129, 217 }, // hlu -> hlu_Hluw_TR
+ { 282, 0, 0 }, { 282, 86, 44 }, // hmd -> hmd_Plrd_CN
+ { 333, 0, 0 }, { 333, 110, 117 }, // hnj -> hnj_Hmng_LA
+ { 280, 0, 0 }, { 280, 7, 170 }, // hnn -> hnn_Latn_PH
+ { 224, 0, 0 }, { 224, 7, 167 }, // ho -> ho_Latn_PG
+ { 334, 0, 0 }, { 334, 13, 100 }, // hoc -> hoc_Deva_IN
+ { 27, 0, 0 }, { 27, 7, 54 }, // hr -> hr_Latn_HR
+ { 318, 0, 0 }, { 318, 7, 82 }, // hsb -> hsb_Latn_DE
+ { 222, 0, 0 }, { 222, 7, 94 }, // ht -> ht_Latn_HT
+ { 50, 0, 0 }, { 50, 7, 98 }, // hu -> hu_Latn_HU
+ { 9, 0, 0 }, { 9, 10, 11 }, // hy -> hy_Armn_AM
+ { 223, 0, 0 }, { 223, 7, 148 }, // hz -> hz_Latn_NA
+ { 53, 0, 0 }, { 53, 7, 260 }, // ia -> ia_Latn_001
+ { 52, 0, 0 }, { 52, 7, 101 }, // id -> id_Latn_ID
+ { 149, 0, 0 }, { 149, 7, 157 }, // ig -> ig_Latn_NG
+ { 168, 0, 0 }, { 168, 34, 44 }, // ii -> ii_Yiii_CN
+ { 56, 0, 0 }, { 56, 7, 225 }, // ik -> ik_Latn_US
+ { 281, 0, 0 }, { 281, 2, 178 }, // inh -> inh_Cyrl_RU
+ { 360, 0, 0 }, { 360, 7, 260 }, // io -> io_Latn_001
+ { 51, 0, 0 }, { 51, 7, 99 }, // is -> is_Latn_IS
+ { 58, 0, 0 }, { 58, 7, 106 }, // it -> it_Latn_IT
+ { 55, 0, 0 }, { 55, 44, 38 }, // iu -> iu_Cans_CA
+ { 59, 0, 0 }, { 59, 19, 108 }, // ja -> ja_Jpan_JP
+ { 361, 0, 0 }, { 361, 7, 260 }, // jbo -> jbo_Latn_001
+ { 257, 0, 0 }, { 257, 7, 37 }, // jgo -> jgo_Latn_CM
+ { 200, 0, 0 }, { 200, 7, 210 }, // jmc -> jmc_Latn_TZ
+ { 60, 0, 0 }, { 60, 7, 101 }, // jv -> jv_Latn_ID
+ { 41, 0, 0 }, { 41, 15, 81 }, // ka -> ka_Geor_GE
+ { 184, 0, 0 }, { 184, 7, 3 }, // kab -> kab_Latn_DZ
+ { 158, 0, 0 }, { 158, 7, 157 }, // kaj -> kaj_Latn_NG
+ { 150, 0, 0 }, { 150, 7, 111 }, // kam -> kam_Latn_KE
+ { 164, 0, 0 }, { 164, 7, 157 }, // kcg -> kcg_Latn_NG
+ { 192, 0, 0 }, { 192, 7, 210 }, // kde -> kde_Latn_TZ
+ { 196, 0, 0 }, { 196, 7, 39 }, // kea -> kea_Latn_CV
+ { 319, 0, 0 }, { 319, 7, 37 }, // ken -> ken_Latn_CM
+ { 154, 0, 0 }, { 154, 7, 53 }, // kfo -> kfo_Latn_CI
+ { 227, 0, 0 }, { 227, 7, 49 }, // kg -> kg_Latn_CD
+ { 286, 0, 0 }, { 286, 76, 44 }, // khb -> khb_Talu_CN
+ { 208, 0, 0 }, { 208, 7, 132 }, // khq -> khq_Latn_ML
+ { 178, 0, 0 }, { 178, 7, 111 }, // ki -> ki_Latn_KE
+ { 228, 0, 0 }, { 228, 7, 148 }, // kj -> kj_Latn_NA
+ { 63, 0, 0 }, { 63, 2, 110 }, // kk -> kk_Cyrl_KZ
+ { 63, 0, 1 }, { 63, 1, 1 }, // kk_AF -> kk_Arab_AF
+ { 63, 0, 44 }, { 63, 1, 44 }, // kk_CN -> kk_Arab_CN
+ { 63, 0, 102 }, { 63, 1, 102 }, // kk_IR -> kk_Arab_IR
+ { 63, 0, 143 }, { 63, 1, 143 }, // kk_MN -> kk_Arab_MN
+ { 63, 1, 0 }, { 63, 1, 44 }, // kk_Arab -> kk_Arab_CN
+ { 258, 0, 0 }, { 258, 7, 37 }, // kkj -> kkj_Latn_CM
+ { 44, 0, 0 }, { 44, 7, 86 }, // kl -> kl_Latn_GL
+ { 198, 0, 0 }, { 198, 7, 111 }, // kln -> kln_Latn_KE
+ { 23, 0, 0 }, { 23, 20, 36 }, // km -> km_Khmr_KH
+ { 61, 0, 0 }, { 61, 21, 100 }, // kn -> kn_Knda_IN
+ { 66, 0, 0 }, { 66, 22, 114 }, // ko -> ko_Kore_KR
+ { 147, 0, 0 }, { 147, 13, 100 }, // kok -> kok_Deva_IN
+ { 169, 0, 0 }, { 169, 7, 121 }, // kpe -> kpe_Latn_LR
+ { 225, 0, 0 }, { 225, 7, 0 }, // kr -> kr_Latn
+ { 62, 0, 0 }, { 62, 1, 100 }, // ks -> ks_Arab_IN
+ { 214, 0, 0 }, { 214, 7, 210 }, // ksb -> ksb_Latn_TZ
+ { 243, 0, 0 }, { 243, 7, 37 }, // ksf -> ksf_Latn_CM
+ { 201, 0, 0 }, { 201, 7, 82 }, // ksh -> ksh_Latn_DE
+ { 67, 0, 0 }, { 67, 7, 217 }, // ku -> ku_Latn_TR
+ { 67, 0, 119 }, { 67, 1, 119 }, // ku_LB -> ku_Arab_LB
+ { 67, 1, 0 }, { 67, 1, 103 }, // ku_Arab -> ku_Arab_IQ
+ { 226, 0, 0 }, { 226, 2, 178 }, // kv -> kv_Cyrl_RU
+ { 145, 0, 0 }, { 145, 7, 224 }, // kw -> kw_Latn_GB
+ { 65, 0, 0 }, { 65, 2, 116 }, // ky -> ky_Cyrl_KG
+ { 65, 0, 44 }, { 65, 1, 44 }, // ky_CN -> ky_Arab_CN
+ { 65, 0, 217 }, { 65, 7, 217 }, // ky_TR -> ky_Latn_TR
+ { 65, 1, 0 }, { 65, 1, 44 }, // ky_Arab -> ky_Arab_CN
+ { 65, 7, 0 }, { 65, 7, 217 }, // ky_Latn -> ky_Latn_TR
+ { 70, 0, 0 }, { 70, 7, 230 }, // la -> la_Latn_VA
+ { 332, 0, 0 }, { 332, 112, 85 }, // lab -> lab_Lina_GR
+ { 193, 0, 0 }, { 193, 7, 210 }, // lag -> lag_Latn_TZ
+ { 231, 0, 0 }, { 231, 7, 125 }, // lb -> lb_Latn_LU
+ { 283, 0, 0 }, { 283, 66, 100 }, // lep -> lep_Lepc_IN
+ { 335, 0, 0 }, { 335, 2, 178 }, // lez -> lez_Cyrl_RU
+ { 194, 0, 0 }, { 194, 7, 221 }, // lg -> lg_Latn_UG
+ { 229, 0, 0 }, { 229, 7, 151 }, // li -> li_Latn_NL
+ { 284, 0, 0 }, { 284, 13, 150 }, // lif -> lif_Deva_NP
+ { 284, 67, 0 }, { 284, 67, 100 }, // lif_Limb -> lif_Limb_IN
+ { 285, 0, 0 }, { 285, 51, 44 }, // lis -> lis_Lisu_CN
+ { 313, 0, 0 }, { 313, 7, 225 }, // lkt -> lkt_Latn_US
+ { 72, 0, 0 }, { 72, 7, 49 }, // ln -> ln_Latn_CD
+ { 69, 0, 0 }, { 69, 23, 117 }, // lo -> lo_Laoo_LA
+ { 349, 0, 0 }, { 349, 1, 102 }, // lrc -> lrc_Arab_IR
+ { 73, 0, 0 }, { 73, 7, 124 }, // lt -> lt_Latn_LT
+ { 230, 0, 0 }, { 230, 7, 49 }, // lu -> lu_Latn_CD
+ { 210, 0, 0 }, { 210, 7, 111 }, // luo -> luo_Latn_KE
+ { 204, 0, 0 }, { 204, 7, 111 }, // luy -> luy_Latn_KE
+ { 71, 0, 0 }, { 71, 7, 118 }, // lv -> lv_Latn_LV
+ { 345, 0, 0 }, { 345, 5, 44 }, // lzh -> lzh_Hans_CN
+ { 339, 0, 0 }, { 339, 13, 100 }, // mai -> mai_Deva_IN
+ { 289, 0, 0 }, { 289, 7, 80 }, // man -> man_Latn_GM
+ { 289, 0, 91 }, { 289, 75, 91 }, // man_GN -> man_Nkoo_GN
+ { 289, 75, 0 }, { 289, 75, 91 }, // man_Nkoo -> man_Nkoo_GN
+ { 202, 0, 0 }, { 202, 7, 111 }, // mas -> mas_Latn_KE
+ { 330, 0, 0 }, { 330, 7, 189 }, // men -> men_Latn_SL
+ { 197, 0, 0 }, { 197, 7, 111 }, // mer -> mer_Latn_KE
+ { 191, 0, 0 }, { 191, 7, 137 }, // mfe -> mfe_Latn_MU
+ { 75, 0, 0 }, { 75, 7, 128 }, // mg -> mg_Latn_MG
+ { 244, 0, 0 }, { 244, 7, 146 }, // mgh -> mgh_Latn_MZ
+ { 259, 0, 0 }, { 259, 7, 37 }, // mgo -> mgo_Latn_CM
+ { 81, 0, 0 }, { 81, 7, 134 }, // mh -> mh_Latn_MH
+ { 79, 0, 0 }, { 79, 7, 154 }, // mi -> mi_Latn_NZ
+ { 356, 0, 0 }, { 356, 130, 103 }, // mis -> mis_Hatr_IQ
+ { 74, 0, 0 }, { 74, 2, 127 }, // mk -> mk_Cyrl_MK
+ { 77, 0, 0 }, { 77, 24, 100 }, // ml -> ml_Mlym_IN
+ { 82, 0, 0 }, { 82, 2, 143 }, // mn -> mn_Cyrl_MN
+ { 82, 0, 44 }, { 82, 8, 44 }, // mn_CN -> mn_Mong_CN
+ { 82, 8, 0 }, { 82, 8, 44 }, // mn_Mong -> mn_Mong_CN
+ { 290, 0, 0 }, { 290, 11, 100 }, // mni -> mni_Beng_IN
+ { 320, 0, 0 }, { 320, 7, 38 }, // moh -> moh_Latn_CA
+ { 80, 0, 0 }, { 80, 13, 100 }, // mr -> mr_Deva_IN
+ { 347, 0, 0 }, { 347, 117, 18 }, // mro -> mro_Mroo_BD
+ { 76, 0, 0 }, { 76, 7, 130 }, // ms -> ms_Latn_MY
+ { 76, 0, 46 }, { 76, 1, 46 }, // ms_CC -> ms_Arab_CC
+ { 76, 0, 101 }, { 76, 1, 101 }, // ms_ID -> ms_Arab_ID
+ { 78, 0, 0 }, { 78, 7, 133 }, // mt -> mt_Latn_MT
+ { 245, 0, 0 }, { 245, 7, 37 }, // mua -> mua_Latn_CM
+ { 368, 0, 0 }, { 368, 7, 225 }, // mus -> mus_Latn_US
+ { 21, 0, 0 }, { 21, 25, 147 }, // my -> my_Mymr_MM
+ { 366, 0, 0 }, { 366, 2, 178 }, // myv -> myv_Cyrl_RU
+ { 273, 0, 0 }, { 273, 71, 102 }, // myz -> myz_Mand_IR
+ { 346, 0, 0 }, { 346, 1, 102 }, // mzn -> mzn_Arab_IR
+ { 83, 0, 0 }, { 83, 7, 149 }, // na -> na_Latn_NR
+ { 199, 0, 0 }, { 199, 7, 148 }, // naq -> naq_Latn_NA
+ { 85, 0, 0 }, { 85, 7, 161 }, // nb -> nb_Latn_NO
+ { 181, 0, 0 }, { 181, 7, 240 }, // nd -> nd_Latn_ZW
+ { 170, 0, 0 }, { 170, 7, 82 }, // nds -> nds_Latn_DE
+ { 84, 0, 0 }, { 84, 13, 150 }, // ne -> ne_Deva_NP
+ { 348, 0, 0 }, { 348, 13, 150 }, // new -> new_Deva_NP
+ { 233, 0, 0 }, { 233, 7, 148 }, // ng -> ng_Latn_NA
+ { 30, 0, 0 }, { 30, 7, 151 }, // nl -> nl_Latn_NL
+ { 246, 0, 0 }, { 246, 7, 37 }, // nmg -> nmg_Latn_CM
+ { 141, 0, 0 }, { 141, 7, 161 }, // nn -> nn_Latn_NO
+ { 260, 0, 0 }, { 260, 7, 37 }, // nnh -> nnh_Latn_CM
+ { 292, 0, 0 }, { 292, 65, 211 }, // nod -> nod_Lana_TH
+ { 294, 0, 0 }, { 294, 88, 205 }, // non -> non_Runr_SE
+ { 321, 0, 0 }, { 321, 75, 91 }, // nqo -> nqo_Nkoo_GN
+ { 171, 0, 0 }, { 171, 7, 195 }, // nr -> nr_Latn_ZA
+ { 172, 0, 0 }, { 172, 7, 195 }, // nso -> nso_Latn_ZA
+ { 247, 0, 0 }, { 247, 7, 254 }, // nus -> nus_Latn_SS
+ { 232, 0, 0 }, { 232, 7, 225 }, // nv -> nv_Latn_US
+ { 165, 0, 0 }, { 165, 7, 129 }, // ny -> ny_Latn_MW
+ { 185, 0, 0 }, { 185, 7, 221 }, // nyn -> nyn_Latn_UG
+ { 86, 0, 0 }, { 86, 7, 74 }, // oc -> oc_Latn_FR
+ { 3, 0, 0 }, { 3, 7, 69 }, // om -> om_Latn_ET
+ { 87, 0, 0 }, { 87, 26, 100 }, // or -> or_Orya_IN
+ { 101, 0, 0 }, { 101, 2, 81 }, // os -> os_Cyrl_GE
+ { 358, 0, 0 }, { 358, 138, 225 }, // osa -> osa_Osge_US
+ { 296, 0, 0 }, { 296, 82, 143 }, // otk -> otk_Orkh_MN
+ { 92, 0, 0 }, { 92, 4, 100 }, // pa -> pa_Guru_IN
+ { 92, 0, 163 }, { 92, 1, 163 }, // pa_PK -> pa_Arab_PK
+ { 92, 1, 0 }, { 92, 1, 163 }, // pa_Arab -> pa_Arab_PK
+ { 297, 0, 0 }, { 297, 58, 102 }, // pal -> pal_Phli_IR
+ { 297, 123, 0 }, { 297, 123, 44 }, // pal_Phlp -> pal_Phlp_CN
+ { 351, 0, 0 }, { 351, 7, 12 }, // pap -> pap_Latn_AW
+ { 350, 0, 0 }, { 350, 7, 164 }, // pau -> pau_Latn_PW
+ { 295, 0, 0 }, { 295, 80, 102 }, // peo -> peo_Xpeo_IR
+ { 299, 0, 0 }, { 299, 85, 119 }, // phn -> phn_Phnx_LB
+ { 342, 0, 0 }, { 342, 41, 100 }, // pka -> pka_Brah_IN
+ { 90, 0, 0 }, { 90, 7, 172 }, // pl -> pl_Latn_PL
+ { 300, 0, 0 }, { 300, 64, 163 }, // pra -> pra_Khar_PK
+ { 322, 0, 0 }, { 322, 7, 260 }, // prg -> prg_Latn_001
+ { 88, 0, 0 }, { 88, 1, 1 }, // ps -> ps_Arab_AF
+ { 91, 0, 0 }, { 91, 7, 30 }, // pt -> pt_Latn_BR
+ { 93, 0, 0 }, { 93, 7, 169 }, // qu -> qu_Latn_PE
+ { 323, 0, 0 }, { 323, 7, 90 }, // quc -> quc_Latn_GT
+ { 301, 0, 0 }, { 301, 7, 101 }, // rej -> rej_Latn_ID
+ { 94, 0, 0 }, { 94, 7, 206 }, // rm -> rm_Latn_CH
+ { 68, 0, 0 }, { 68, 7, 35 }, // rn -> rn_Latn_BI
+ { 95, 0, 0 }, { 95, 7, 177 }, // ro -> ro_Latn_RO
+ { 182, 0, 0 }, { 182, 7, 210 }, // rof -> rof_Latn_TZ
+ { 96, 0, 0 }, { 96, 2, 178 }, // ru -> ru_Cyrl_RU
+ { 64, 0, 0 }, { 64, 7, 179 }, // rw -> rw_Latn_RW
+ { 209, 0, 0 }, { 209, 7, 210 }, // rwk -> rwk_Latn_TZ
+ { 99, 0, 0 }, { 99, 13, 100 }, // sa -> sa_Deva_IN
+ { 248, 0, 0 }, { 248, 2, 178 }, // sah -> sah_Cyrl_RU
+ { 179, 0, 0 }, { 179, 7, 111 }, // saq -> saq_Latn_KE
+ { 304, 0, 0 }, { 304, 7, 100 }, // sat -> sat_Latn_IN
+ { 305, 0, 0 }, { 305, 90, 100 }, // saz -> saz_Saur_IN
+ { 249, 0, 0 }, { 249, 7, 210 }, // sbp -> sbp_Latn_TZ
+ { 115, 0, 0 }, { 115, 7, 106 }, // sc -> sc_Latn_IT
+ { 362, 0, 0 }, { 362, 7, 106 }, // scn -> scn_Latn_IT
+ { 105, 0, 0 }, { 105, 1, 163 }, // sd -> sd_Arab_PK
+ { 105, 13, 0 }, { 105, 13, 100 }, // sd_Deva -> sd_Deva_IN
+ { 105, 111, 0 }, { 105, 111, 100 }, // sd_Khoj -> sd_Khoj_IN
+ { 105, 125, 0 }, { 105, 125, 100 }, // sd_Sind -> sd_Sind_IN
+ { 363, 0, 0 }, { 363, 1, 102 }, // sdh -> sdh_Arab_IR
+ { 173, 0, 0 }, { 173, 7, 161 }, // se -> se_Latn_NO
+ { 180, 0, 0 }, { 180, 7, 146 }, // seh -> seh_Latn_MZ
+ { 213, 0, 0 }, { 213, 7, 132 }, // ses -> ses_Latn_ML
+ { 98, 0, 0 }, { 98, 7, 41 }, // sg -> sg_Latn_CF
+ { 293, 0, 0 }, { 293, 77, 104 }, // sga -> sga_Ogam_IE
+ { 183, 0, 0 }, { 183, 9, 145 }, // shi -> shi_Tfng_MA
+ { 106, 0, 0 }, { 106, 32, 198 }, // si -> si_Sinh_LK
+ { 155, 0, 0 }, { 155, 7, 69 }, // sid -> sid_Latn_ET
+ { 108, 0, 0 }, { 108, 7, 191 }, // sk -> sk_Latn_SK
+ { 352, 0, 0 }, { 352, 1, 163 }, // skr -> skr_Arab_PK
+ { 109, 0, 0 }, { 109, 7, 192 }, // sl -> sl_Latn_SI
+ { 97, 0, 0 }, { 97, 7, 183 }, // sm -> sm_Latn_WS
+ { 324, 0, 0 }, { 324, 7, 205 }, // sma -> sma_Latn_SE
+ { 325, 0, 0 }, { 325, 7, 205 }, // smj -> smj_Latn_SE
+ { 326, 0, 0 }, { 326, 7, 73 }, // smn -> smn_Latn_FI
+ { 303, 0, 0 }, { 303, 89, 105 }, // smp -> smp_Samr_IL
+ { 327, 0, 0 }, { 327, 7, 73 }, // sms -> sms_Latn_FI
+ { 104, 0, 0 }, { 104, 7, 240 }, // sn -> sn_Latn_ZW
+ { 110, 0, 0 }, { 110, 7, 194 }, // so -> so_Latn_SO
+ { 6, 0, 0 }, { 6, 7, 2 }, // sq -> sq_Latn_AL
+ { 100, 0, 0 }, { 100, 2, 243 }, // sr -> sr_Cyrl_RS
+ { 100, 0, 242 }, { 100, 7, 242 }, // sr_ME -> sr_Latn_ME
+ { 100, 0, 177 }, { 100, 7, 177 }, // sr_RO -> sr_Latn_RO
+ { 100, 0, 178 }, { 100, 7, 178 }, // sr_RU -> sr_Latn_RU
+ { 100, 0, 217 }, { 100, 7, 217 }, // sr_TR -> sr_Latn_TR
+ { 306, 0, 0 }, { 306, 93, 100 }, // srb -> srb_Sora_IN
+ { 107, 0, 0 }, { 107, 7, 195 }, // ss -> ss_Latn_ZA
+ { 207, 0, 0 }, { 207, 7, 67 }, // ssy -> ssy_Latn_ER
+ { 102, 0, 0 }, { 102, 7, 195 }, // st -> st_Latn_ZA
+ { 112, 0, 0 }, { 112, 7, 101 }, // su -> su_Latn_ID
+ { 114, 0, 0 }, { 114, 7, 205 }, // sv -> sv_Latn_SE
+ { 113, 0, 0 }, { 113, 7, 210 }, // sw -> sw_Latn_TZ
+ { 250, 0, 0 }, { 250, 7, 49 }, // swc -> swc_Latn_CD
+ { 307, 0, 0 }, { 307, 11, 18 }, // syl -> syl_Beng_BD
+ { 151, 0, 0 }, { 151, 33, 103 }, // syr -> syr_Syrc_IQ
+ { 369, 0, 0 }, { 369, 7, 172 }, // szl -> szl_Latn_PL
+ { 117, 0, 0 }, { 117, 27, 100 }, // ta -> ta_Taml_IN
+ { 308, 0, 0 }, { 308, 7, 170 }, // tbw -> tbw_Latn_PH
+ { 310, 0, 0 }, { 310, 99, 44 }, // tdd -> tdd_Tale_CN
+ { 119, 0, 0 }, { 119, 28, 100 }, // te -> te_Telu_IN
+ { 206, 0, 0 }, { 206, 7, 221 }, // teo -> teo_Latn_UG
+ { 116, 0, 0 }, { 116, 2, 209 }, // tg -> tg_Cyrl_TJ
+ { 116, 0, 163 }, { 116, 1, 163 }, // tg_PK -> tg_Arab_PK
+ { 116, 1, 0 }, { 116, 1, 163 }, // tg_Arab -> tg_Arab_PK
+ { 120, 0, 0 }, { 120, 30, 211 }, // th -> th_Thai_TH
+ { 122, 0, 0 }, { 122, 14, 69 }, // ti -> ti_Ethi_ET
+ { 157, 0, 0 }, { 157, 14, 67 }, // tig -> tig_Ethi_ER
+ { 126, 0, 0 }, { 126, 7, 218 }, // tk -> tk_Latn_TM
+ { 353, 0, 0 }, { 353, 7, 213 }, // tkl -> tkl_Latn_TK
+ { 103, 0, 0 }, { 103, 7, 195 }, // tn -> tn_Latn_ZA
+ { 123, 0, 0 }, { 123, 7, 214 }, // to -> to_Latn_TO
+ { 354, 0, 0 }, { 354, 7, 167 }, // tpi -> tpi_Latn_PG
+ { 125, 0, 0 }, { 125, 7, 217 }, // tr -> tr_Latn_TR
+ { 174, 0, 0 }, { 174, 7, 208 }, // trv -> trv_Latn_TW
+ { 124, 0, 0 }, { 124, 7, 195 }, // ts -> ts_Latn_ZA
+ { 118, 0, 0 }, { 118, 2, 178 }, // tt -> tt_Cyrl_RU
+ { 355, 0, 0 }, { 355, 7, 220 }, // tvl -> tvl_Latn_TV
+ { 251, 0, 0 }, { 251, 7, 156 }, // twq -> twq_Latn_NE
+ { 359, 0, 0 }, { 359, 139, 44 }, // txg -> txg_Tang_CN
+ { 127, 0, 0 }, { 127, 7, 77 }, // ty -> ty_Latn_PF
+ { 212, 0, 0 }, { 212, 7, 145 }, // tzm -> tzm_Latn_MA
+ { 128, 0, 0 }, { 128, 1, 44 }, // ug -> ug_Arab_CN
+ { 128, 0, 110 }, { 128, 2, 110 }, // ug_KZ -> ug_Cyrl_KZ
+ { 128, 0, 143 }, { 128, 2, 143 }, // ug_MN -> ug_Cyrl_MN
+ { 128, 2, 0 }, { 128, 2, 110 }, // ug_Cyrl -> ug_Cyrl_KZ
+ { 311, 0, 0 }, { 311, 102, 207 }, // uga -> uga_Ugar_SY
+ { 129, 0, 0 }, { 129, 2, 222 }, // uk -> uk_Cyrl_UA
+ { 130, 0, 0 }, { 130, 1, 163 }, // ur -> ur_Arab_PK
+ { 131, 0, 0 }, { 131, 7, 228 }, // uz -> uz_Latn_UZ
+ { 131, 0, 1 }, { 131, 1, 1 }, // uz_AF -> uz_Arab_AF
+ { 131, 0, 44 }, { 131, 2, 44 }, // uz_CN -> uz_Cyrl_CN
+ { 131, 1, 0 }, { 131, 1, 1 }, // uz_Arab -> uz_Arab_AF
+ { 252, 0, 0 }, { 252, 35, 121 }, // vai -> vai_Vaii_LR
+ { 160, 0, 0 }, { 160, 7, 195 }, // ve -> ve_Latn_ZA
+ { 132, 0, 0 }, { 132, 7, 232 }, // vi -> vi_Latn_VN
+ { 133, 0, 0 }, { 133, 7, 260 }, // vo -> vo_Latn_001
+ { 187, 0, 0 }, { 187, 7, 210 }, // vun -> vun_Latn_TZ
+ { 236, 0, 0 }, { 236, 7, 21 }, // wa -> wa_Latn_BE
+ { 253, 0, 0 }, { 253, 7, 206 }, // wae -> wae_Latn_CH
+ { 162, 0, 0 }, { 162, 14, 69 }, // wal -> wal_Ethi_ET
+ { 328, 0, 0 }, { 328, 7, 13 }, // wbp -> wbp_Latn_AU
+ { 135, 0, 0 }, { 135, 7, 187 }, // wo -> wo_Latn_SN
+ { 271, 0, 0 }, { 271, 45, 217 }, // xcr -> xcr_Cari_TR
+ { 136, 0, 0 }, { 136, 7, 195 }, // xh -> xh_Latn_ZA
+ { 287, 0, 0 }, { 287, 69, 217 }, // xlc -> xlc_Lyci_TR
+ { 288, 0, 0 }, { 288, 70, 217 }, // xld -> xld_Lydi_TR
+ { 329, 0, 0 }, { 329, 114, 44 }, // xmn -> xmn_Mani_CN
+ { 291, 0, 0 }, { 291, 74, 201 }, // xmr -> xmr_Merc_SD
+ { 331, 0, 0 }, { 331, 118, 186 }, // xna -> xna_Narb_SA
+ { 203, 0, 0 }, { 203, 7, 221 }, // xog -> xog_Latn_UG
+ { 298, 0, 0 }, { 298, 59, 102 }, // xpr -> xpr_Prti_IR
+ { 302, 0, 0 }, { 302, 81, 237 }, // xsa -> xsa_Sarb_YE
+ { 254, 0, 0 }, { 254, 7, 37 }, // yav -> yav_Latn_CM
+ { 137, 0, 0 }, { 137, 18, 260 }, // yi -> yi_Hebr_001
+ { 138, 0, 0 }, { 138, 7, 157 }, // yo -> yo_Latn_NG
+ { 357, 0, 0 }, { 357, 6, 97 }, // yue -> yue_Hant_HK
+ { 357, 0, 44 }, { 357, 5, 44 }, // yue_CN -> yue_Hans_CN
+ { 357, 5, 0 }, { 357, 5, 44 }, // yue_Hans -> yue_Hans_CN
+ { 139, 0, 0 }, { 139, 7, 44 }, // za -> za_Latn_CN
+ { 314, 0, 0 }, { 314, 9, 145 }, // zgh -> zgh_Tfng_MA
+ { 25, 0, 0 }, { 25, 5, 44 }, // zh -> zh_Hans_CN
+ { 25, 0, 13 }, { 25, 6, 13 }, // zh_AU -> zh_Hant_AU
+ { 25, 0, 32 }, { 25, 6, 32 }, // zh_BN -> zh_Hant_BN
+ { 25, 0, 224 }, { 25, 6, 224 }, // zh_GB -> zh_Hant_GB
+ { 25, 0, 76 }, { 25, 6, 76 }, // zh_GF -> zh_Hant_GF
+ { 25, 0, 97 }, { 25, 6, 97 }, // zh_HK -> zh_Hant_HK
+ { 25, 0, 101 }, { 25, 6, 101 }, // zh_ID -> zh_Hant_ID
+ { 25, 0, 126 }, { 25, 6, 126 }, // zh_MO -> zh_Hant_MO
+ { 25, 0, 130 }, { 25, 6, 130 }, // zh_MY -> zh_Hant_MY
+ { 25, 0, 166 }, { 25, 6, 166 }, // zh_PA -> zh_Hant_PA
+ { 25, 0, 77 }, { 25, 6, 77 }, // zh_PF -> zh_Hant_PF
+ { 25, 0, 170 }, { 25, 6, 170 }, // zh_PH -> zh_Hant_PH
+ { 25, 0, 202 }, { 25, 6, 202 }, // zh_SR -> zh_Hant_SR
+ { 25, 0, 211 }, { 25, 6, 211 }, // zh_TH -> zh_Hant_TH
+ { 25, 0, 208 }, { 25, 6, 208 }, // zh_TW -> zh_Hant_TW
+ { 25, 0, 225 }, { 25, 6, 225 }, // zh_US -> zh_Hant_US
+ { 25, 0, 232 }, { 25, 6, 232 }, // zh_VN -> zh_Hant_VN
+ { 25, 40, 0 }, { 25, 40, 208 }, // zh_Bopo -> zh_Bopo_TW
+ { 25, 140, 0 }, { 25, 140, 208 }, // zh_Hanb -> zh_Hanb_TW
+ { 25, 6, 0 }, { 25, 6, 208 }, // zh_Hant -> zh_Hant_TW
+ { 140, 0, 0 }, { 140, 7, 195 }, // zu -> zu_Latn_ZA
+ { 0, 0, 261 }, { 96, 2, 178 }, // und_150 -> ru_Cyrl_RU
+ { 0, 0, 246 }, { 111, 7, 246 }, // und_419 -> es_Latn_419
+ { 0, 0, 5 }, { 24, 7, 5 }, // und_AD -> ca_Latn_AD
+ { 0, 0, 223 }, { 8, 1, 223 }, // und_AE -> ar_Arab_AE
+ { 0, 0, 1 }, { 89, 1, 1 }, // und_AF -> fa_Arab_AF
+ { 0, 0, 2 }, { 6, 7, 2 }, // und_AL -> sq_Latn_AL
+ { 0, 0, 11 }, { 9, 10, 11 }, // und_AM -> hy_Armn_AM
+ { 0, 0, 6 }, { 91, 7, 6 }, // und_AO -> pt_Latn_AO
+ { 0, 0, 8 }, { 0, 7, 8 }, // und_AQ -> und_Latn_AQ
+ { 0, 0, 10 }, { 111, 7, 10 }, // und_AR -> es_Latn_AR
+ { 0, 0, 4 }, { 97, 7, 4 }, // und_AS -> sm_Latn_AS
+ { 0, 0, 14 }, { 42, 7, 14 }, // und_AT -> de_Latn_AT
+ { 0, 0, 12 }, { 30, 7, 12 }, // und_AW -> nl_Latn_AW
+ { 0, 0, 248 }, { 114, 7, 248 }, // und_AX -> sv_Latn_AX
+ { 0, 0, 15 }, { 12, 7, 15 }, // und_AZ -> az_Latn_AZ
+ { 0, 0, 27 }, { 142, 7, 27 }, // und_BA -> bs_Latn_BA
+ { 0, 0, 18 }, { 15, 11, 18 }, // und_BD -> bn_Beng_BD
+ { 0, 0, 21 }, { 30, 7, 21 }, // und_BE -> nl_Latn_BE
+ { 0, 0, 34 }, { 37, 7, 34 }, // und_BF -> fr_Latn_BF
+ { 0, 0, 33 }, { 20, 2, 33 }, // und_BG -> bg_Cyrl_BG
+ { 0, 0, 17 }, { 8, 1, 17 }, // und_BH -> ar_Arab_BH
+ { 0, 0, 35 }, { 68, 7, 35 }, // und_BI -> rn_Latn_BI
+ { 0, 0, 23 }, { 37, 7, 23 }, // und_BJ -> fr_Latn_BJ
+ { 0, 0, 244 }, { 37, 7, 244 }, // und_BL -> fr_Latn_BL
+ { 0, 0, 32 }, { 76, 7, 32 }, // und_BN -> ms_Latn_BN
+ { 0, 0, 26 }, { 111, 7, 26 }, // und_BO -> es_Latn_BO
+ { 0, 0, 255 }, { 351, 7, 255 }, // und_BQ -> pap_Latn_BQ
+ { 0, 0, 30 }, { 91, 7, 30 }, // und_BR -> pt_Latn_BR
+ { 0, 0, 25 }, { 16, 31, 25 }, // und_BT -> dz_Tibt_BT
+ { 0, 0, 29 }, { 0, 7, 29 }, // und_BV -> und_Latn_BV
+ { 0, 0, 20 }, { 22, 2, 20 }, // und_BY -> be_Cyrl_BY
+ { 0, 0, 49 }, { 113, 7, 49 }, // und_CD -> sw_Latn_CD
+ { 0, 0, 41 }, { 37, 7, 41 }, // und_CF -> fr_Latn_CF
+ { 0, 0, 50 }, { 37, 7, 50 }, // und_CG -> fr_Latn_CG
+ { 0, 0, 206 }, { 42, 7, 206 }, // und_CH -> de_Latn_CH
+ { 0, 0, 53 }, { 37, 7, 53 }, // und_CI -> fr_Latn_CI
+ { 0, 0, 43 }, { 111, 7, 43 }, // und_CL -> es_Latn_CL
+ { 0, 0, 37 }, { 37, 7, 37 }, // und_CM -> fr_Latn_CM
+ { 0, 0, 44 }, { 25, 5, 44 }, // und_CN -> zh_Hans_CN
+ { 0, 0, 47 }, { 111, 7, 47 }, // und_CO -> es_Latn_CO
+ { 0, 0, 241 }, { 0, 7, 241 }, // und_CP -> und_Latn_CP
+ { 0, 0, 52 }, { 111, 7, 52 }, // und_CR -> es_Latn_CR
+ { 0, 0, 55 }, { 111, 7, 55 }, // und_CU -> es_Latn_CU
+ { 0, 0, 39 }, { 91, 7, 39 }, // und_CV -> pt_Latn_CV
+ { 0, 0, 152 }, { 351, 7, 152 }, // und_CW -> pap_Latn_CW
+ { 0, 0, 56 }, { 43, 16, 56 }, // und_CY -> el_Grek_CY
+ { 0, 0, 57 }, { 28, 7, 57 }, // und_CZ -> cs_Latn_CZ
+ { 0, 0, 82 }, { 42, 7, 82 }, // und_DE -> de_Latn_DE
+ { 0, 0, 59 }, { 4, 7, 59 }, // und_DJ -> aa_Latn_DJ
+ { 0, 0, 58 }, { 29, 7, 58 }, // und_DK -> da_Latn_DK
+ { 0, 0, 61 }, { 111, 7, 61 }, // und_DO -> es_Latn_DO
+ { 0, 0, 3 }, { 8, 1, 3 }, // und_DZ -> ar_Arab_DZ
+ { 0, 0, 250 }, { 111, 7, 250 }, // und_EA -> es_Latn_EA
+ { 0, 0, 63 }, { 111, 7, 63 }, // und_EC -> es_Latn_EC
+ { 0, 0, 68 }, { 33, 7, 68 }, // und_EE -> et_Latn_EE
+ { 0, 0, 64 }, { 8, 1, 64 }, // und_EG -> ar_Arab_EG
+ { 0, 0, 236 }, { 8, 1, 236 }, // und_EH -> ar_Arab_EH
+ { 0, 0, 67 }, { 122, 14, 67 }, // und_ER -> ti_Ethi_ER
+ { 0, 0, 197 }, { 111, 7, 197 }, // und_ES -> es_Latn_ES
+ { 0, 0, 69 }, { 7, 14, 69 }, // und_ET -> am_Ethi_ET
+ { 0, 0, 258 }, { 31, 7, 224 }, // und_EU -> en_Latn_GB
+ { 0, 0, 73 }, { 36, 7, 73 }, // und_FI -> fi_Latn_FI
+ { 0, 0, 71 }, { 34, 7, 71 }, // und_FO -> fo_Latn_FO
+ { 0, 0, 74 }, { 37, 7, 74 }, // und_FR -> fr_Latn_FR
+ { 0, 0, 79 }, { 37, 7, 79 }, // und_GA -> fr_Latn_GA
+ { 0, 0, 81 }, { 41, 15, 81 }, // und_GE -> ka_Geor_GE
+ { 0, 0, 76 }, { 37, 7, 76 }, // und_GF -> fr_Latn_GF
+ { 0, 0, 83 }, { 146, 7, 83 }, // und_GH -> ak_Latn_GH
+ { 0, 0, 86 }, { 44, 7, 86 }, // und_GL -> kl_Latn_GL
+ { 0, 0, 91 }, { 37, 7, 91 }, // und_GN -> fr_Latn_GN
+ { 0, 0, 88 }, { 37, 7, 88 }, // und_GP -> fr_Latn_GP
+ { 0, 0, 66 }, { 111, 7, 66 }, // und_GQ -> es_Latn_GQ
+ { 0, 0, 85 }, { 43, 16, 85 }, // und_GR -> el_Grek_GR
+ { 0, 0, 196 }, { 0, 7, 196 }, // und_GS -> und_Latn_GS
+ { 0, 0, 90 }, { 111, 7, 90 }, // und_GT -> es_Latn_GT
+ { 0, 0, 92 }, { 91, 7, 92 }, // und_GW -> pt_Latn_GW
+ { 0, 0, 97 }, { 25, 6, 97 }, // und_HK -> zh_Hant_HK
+ { 0, 0, 95 }, { 0, 7, 95 }, // und_HM -> und_Latn_HM
+ { 0, 0, 96 }, { 111, 7, 96 }, // und_HN -> es_Latn_HN
+ { 0, 0, 54 }, { 27, 7, 54 }, // und_HR -> hr_Latn_HR
+ { 0, 0, 94 }, { 222, 7, 94 }, // und_HT -> ht_Latn_HT
+ { 0, 0, 98 }, { 50, 7, 98 }, // und_HU -> hu_Latn_HU
+ { 0, 0, 238 }, { 111, 7, 238 }, // und_IC -> es_Latn_IC
+ { 0, 0, 101 }, { 52, 7, 101 }, // und_ID -> id_Latn_ID
+ { 0, 0, 105 }, { 48, 18, 105 }, // und_IL -> he_Hebr_IL
+ { 0, 0, 100 }, { 49, 13, 100 }, // und_IN -> hi_Deva_IN
+ { 0, 0, 103 }, { 8, 1, 103 }, // und_IQ -> ar_Arab_IQ
+ { 0, 0, 102 }, { 89, 1, 102 }, // und_IR -> fa_Arab_IR
+ { 0, 0, 99 }, { 51, 7, 99 }, // und_IS -> is_Latn_IS
+ { 0, 0, 106 }, { 58, 7, 106 }, // und_IT -> it_Latn_IT
+ { 0, 0, 109 }, { 8, 1, 109 }, // und_JO -> ar_Arab_JO
+ { 0, 0, 108 }, { 59, 19, 108 }, // und_JP -> ja_Jpan_JP
+ { 0, 0, 111 }, { 113, 7, 111 }, // und_KE -> sw_Latn_KE
+ { 0, 0, 116 }, { 65, 2, 116 }, // und_KG -> ky_Cyrl_KG
+ { 0, 0, 36 }, { 23, 20, 36 }, // und_KH -> km_Khmr_KH
+ { 0, 0, 48 }, { 8, 1, 48 }, // und_KM -> ar_Arab_KM
+ { 0, 0, 113 }, { 66, 22, 113 }, // und_KP -> ko_Kore_KP
+ { 0, 0, 114 }, { 66, 22, 114 }, // und_KR -> ko_Kore_KR
+ { 0, 0, 115 }, { 8, 1, 115 }, // und_KW -> ar_Arab_KW
+ { 0, 0, 110 }, { 96, 2, 110 }, // und_KZ -> ru_Cyrl_KZ
+ { 0, 0, 117 }, { 69, 23, 117 }, // und_LA -> lo_Laoo_LA
+ { 0, 0, 119 }, { 8, 1, 119 }, // und_LB -> ar_Arab_LB
+ { 0, 0, 123 }, { 42, 7, 123 }, // und_LI -> de_Latn_LI
+ { 0, 0, 198 }, { 106, 32, 198 }, // und_LK -> si_Sinh_LK
+ { 0, 0, 120 }, { 102, 7, 120 }, // und_LS -> st_Latn_LS
+ { 0, 0, 124 }, { 73, 7, 124 }, // und_LT -> lt_Latn_LT
+ { 0, 0, 125 }, { 37, 7, 125 }, // und_LU -> fr_Latn_LU
+ { 0, 0, 118 }, { 71, 7, 118 }, // und_LV -> lv_Latn_LV
+ { 0, 0, 122 }, { 8, 1, 122 }, // und_LY -> ar_Arab_LY
+ { 0, 0, 145 }, { 8, 1, 145 }, // und_MA -> ar_Arab_MA
+ { 0, 0, 142 }, { 37, 7, 142 }, // und_MC -> fr_Latn_MC
+ { 0, 0, 141 }, { 95, 7, 141 }, // und_MD -> ro_Latn_MD
+ { 0, 0, 242 }, { 100, 7, 242 }, // und_ME -> sr_Latn_ME
+ { 0, 0, 245 }, { 37, 7, 245 }, // und_MF -> fr_Latn_MF
+ { 0, 0, 128 }, { 75, 7, 128 }, // und_MG -> mg_Latn_MG
+ { 0, 0, 127 }, { 74, 2, 127 }, // und_MK -> mk_Cyrl_MK
+ { 0, 0, 132 }, { 188, 7, 132 }, // und_ML -> bm_Latn_ML
+ { 0, 0, 147 }, { 21, 25, 147 }, // und_MM -> my_Mymr_MM
+ { 0, 0, 143 }, { 82, 2, 143 }, // und_MN -> mn_Cyrl_MN
+ { 0, 0, 126 }, { 25, 6, 126 }, // und_MO -> zh_Hant_MO
+ { 0, 0, 135 }, { 37, 7, 135 }, // und_MQ -> fr_Latn_MQ
+ { 0, 0, 136 }, { 8, 1, 136 }, // und_MR -> ar_Arab_MR
+ { 0, 0, 133 }, { 78, 7, 133 }, // und_MT -> mt_Latn_MT
+ { 0, 0, 137 }, { 191, 7, 137 }, // und_MU -> mfe_Latn_MU
+ { 0, 0, 131 }, { 143, 29, 131 }, // und_MV -> dv_Thaa_MV
+ { 0, 0, 139 }, { 111, 7, 139 }, // und_MX -> es_Latn_MX
+ { 0, 0, 130 }, { 76, 7, 130 }, // und_MY -> ms_Latn_MY
+ { 0, 0, 146 }, { 91, 7, 146 }, // und_MZ -> pt_Latn_MZ
+ { 0, 0, 148 }, { 5, 7, 148 }, // und_NA -> af_Latn_NA
+ { 0, 0, 153 }, { 37, 7, 153 }, // und_NC -> fr_Latn_NC
+ { 0, 0, 156 }, { 47, 7, 156 }, // und_NE -> ha_Latn_NE
+ { 0, 0, 155 }, { 111, 7, 155 }, // und_NI -> es_Latn_NI
+ { 0, 0, 151 }, { 30, 7, 151 }, // und_NL -> nl_Latn_NL
+ { 0, 0, 161 }, { 85, 7, 161 }, // und_NO -> nb_Latn_NO
+ { 0, 0, 150 }, { 84, 13, 150 }, // und_NP -> ne_Deva_NP
+ { 0, 0, 162 }, { 8, 1, 162 }, // und_OM -> ar_Arab_OM
+ { 0, 0, 166 }, { 111, 7, 166 }, // und_PA -> es_Latn_PA
+ { 0, 0, 169 }, { 111, 7, 169 }, // und_PE -> es_Latn_PE
+ { 0, 0, 77 }, { 37, 7, 77 }, // und_PF -> fr_Latn_PF
+ { 0, 0, 167 }, { 354, 7, 167 }, // und_PG -> tpi_Latn_PG
+ { 0, 0, 170 }, { 166, 7, 170 }, // und_PH -> fil_Latn_PH
+ { 0, 0, 163 }, { 130, 1, 163 }, // und_PK -> ur_Arab_PK
+ { 0, 0, 172 }, { 90, 7, 172 }, // und_PL -> pl_Latn_PL
+ { 0, 0, 200 }, { 37, 7, 200 }, // und_PM -> fr_Latn_PM
+ { 0, 0, 174 }, { 111, 7, 174 }, // und_PR -> es_Latn_PR
+ { 0, 0, 165 }, { 8, 1, 165 }, // und_PS -> ar_Arab_PS
+ { 0, 0, 173 }, { 91, 7, 173 }, // und_PT -> pt_Latn_PT
+ { 0, 0, 164 }, { 350, 7, 164 }, // und_PW -> pau_Latn_PW
+ { 0, 0, 168 }, { 45, 7, 168 }, // und_PY -> gn_Latn_PY
+ { 0, 0, 175 }, { 8, 1, 175 }, // und_QA -> ar_Arab_QA
+ { 0, 0, 259 }, { 31, 7, 249 }, // und_QO -> en_Latn_DG
+ { 0, 0, 176 }, { 37, 7, 176 }, // und_RE -> fr_Latn_RE
+ { 0, 0, 177 }, { 95, 7, 177 }, // und_RO -> ro_Latn_RO
+ { 0, 0, 243 }, { 100, 2, 243 }, // und_RS -> sr_Cyrl_RS
+ { 0, 0, 178 }, { 96, 2, 178 }, // und_RU -> ru_Cyrl_RU
+ { 0, 0, 179 }, { 64, 7, 179 }, // und_RW -> rw_Latn_RW
+ { 0, 0, 186 }, { 8, 1, 186 }, // und_SA -> ar_Arab_SA
+ { 0, 0, 188 }, { 37, 7, 188 }, // und_SC -> fr_Latn_SC
+ { 0, 0, 201 }, { 8, 1, 201 }, // und_SD -> ar_Arab_SD
+ { 0, 0, 205 }, { 114, 7, 205 }, // und_SE -> sv_Latn_SE
+ { 0, 0, 192 }, { 109, 7, 192 }, // und_SI -> sl_Latn_SI
+ { 0, 0, 203 }, { 85, 7, 203 }, // und_SJ -> nb_Latn_SJ
+ { 0, 0, 191 }, { 108, 7, 191 }, // und_SK -> sk_Latn_SK
+ { 0, 0, 184 }, { 58, 7, 184 }, // und_SM -> it_Latn_SM
+ { 0, 0, 187 }, { 37, 7, 187 }, // und_SN -> fr_Latn_SN
+ { 0, 0, 194 }, { 110, 7, 194 }, // und_SO -> so_Latn_SO
+ { 0, 0, 202 }, { 30, 7, 202 }, // und_SR -> nl_Latn_SR
+ { 0, 0, 185 }, { 91, 7, 185 }, // und_ST -> pt_Latn_ST
+ { 0, 0, 65 }, { 111, 7, 65 }, // und_SV -> es_Latn_SV
+ { 0, 0, 207 }, { 8, 1, 207 }, // und_SY -> ar_Arab_SY
+ { 0, 0, 42 }, { 37, 7, 42 }, // und_TD -> fr_Latn_TD
+ { 0, 0, 78 }, { 37, 7, 78 }, // und_TF -> fr_Latn_TF
+ { 0, 0, 212 }, { 37, 7, 212 }, // und_TG -> fr_Latn_TG
+ { 0, 0, 211 }, { 120, 30, 211 }, // und_TH -> th_Thai_TH
+ { 0, 0, 209 }, { 116, 2, 209 }, // und_TJ -> tg_Cyrl_TJ
+ { 0, 0, 213 }, { 353, 7, 213 }, // und_TK -> tkl_Latn_TK
+ { 0, 0, 62 }, { 91, 7, 62 }, // und_TL -> pt_Latn_TL
+ { 0, 0, 218 }, { 126, 7, 218 }, // und_TM -> tk_Latn_TM
+ { 0, 0, 216 }, { 8, 1, 216 }, // und_TN -> ar_Arab_TN
+ { 0, 0, 214 }, { 123, 7, 214 }, // und_TO -> to_Latn_TO
+ { 0, 0, 217 }, { 125, 7, 217 }, // und_TR -> tr_Latn_TR
+ { 0, 0, 220 }, { 355, 7, 220 }, // und_TV -> tvl_Latn_TV
+ { 0, 0, 208 }, { 25, 6, 208 }, // und_TW -> zh_Hant_TW
+ { 0, 0, 210 }, { 113, 7, 210 }, // und_TZ -> sw_Latn_TZ
+ { 0, 0, 222 }, { 129, 2, 222 }, // und_UA -> uk_Cyrl_UA
+ { 0, 0, 221 }, { 113, 7, 221 }, // und_UG -> sw_Latn_UG
+ { 0, 0, 227 }, { 111, 7, 227 }, // und_UY -> es_Latn_UY
+ { 0, 0, 228 }, { 131, 7, 228 }, // und_UZ -> uz_Latn_UZ
+ { 0, 0, 230 }, { 58, 7, 230 }, // und_VA -> it_Latn_VA
+ { 0, 0, 231 }, { 111, 7, 231 }, // und_VE -> es_Latn_VE
+ { 0, 0, 232 }, { 132, 7, 232 }, // und_VN -> vi_Latn_VN
+ { 0, 0, 229 }, { 18, 7, 229 }, // und_VU -> bi_Latn_VU
+ { 0, 0, 235 }, { 37, 7, 235 }, // und_WF -> fr_Latn_WF
+ { 0, 0, 183 }, { 97, 7, 183 }, // und_WS -> sm_Latn_WS
+ { 0, 0, 257 }, { 6, 7, 257 }, // und_XK -> sq_Latn_XK
+ { 0, 0, 237 }, { 8, 1, 237 }, // und_YE -> ar_Arab_YE
+ { 0, 0, 138 }, { 37, 7, 138 }, // und_YT -> fr_Latn_YT
+ { 0, 0, 240 }, { 104, 7, 240 }, // und_ZW -> sn_Latn_ZW
+ { 0, 134, 0 }, { 177, 134, 91 }, // und_Adlm -> ff_Adlm_GN
+ { 0, 105, 0 }, { 335, 105, 178 }, // und_Aghb -> lez_Aghb_RU
+ { 0, 128, 0 }, { 340, 128, 100 }, // und_Ahom -> aho_Ahom_IN
+ { 0, 1, 0 }, { 8, 1, 64 }, // und_Arab -> ar_Arab_EG
+ { 0, 1, 46 }, { 76, 1, 46 }, // und_Arab_CC -> ms_Arab_CC
+ { 0, 1, 44 }, { 128, 1, 44 }, // und_Arab_CN -> ug_Arab_CN
+ { 0, 1, 224 }, { 62, 1, 224 }, // und_Arab_GB -> ks_Arab_GB
+ { 0, 1, 101 }, { 76, 1, 101 }, // und_Arab_ID -> ms_Arab_ID
+ { 0, 1, 100 }, { 130, 1, 100 }, // und_Arab_IN -> ur_Arab_IN
+ { 0, 1, 143 }, { 63, 1, 143 }, // und_Arab_MN -> kk_Arab_MN
+ { 0, 1, 137 }, { 130, 1, 137 }, // und_Arab_MU -> ur_Arab_MU
+ { 0, 1, 157 }, { 47, 1, 157 }, // und_Arab_NG -> ha_Arab_NG
+ { 0, 1, 163 }, { 130, 1, 163 }, // und_Arab_PK -> ur_Arab_PK
+ { 0, 1, 209 }, { 89, 1, 209 }, // und_Arab_TJ -> fa_Arab_TJ
+ { 0, 1, 217 }, { 12, 1, 217 }, // und_Arab_TR -> az_Arab_TR
+ { 0, 57, 0 }, { 265, 57, 102 }, // und_Armi -> arc_Armi_IR
+ { 0, 10, 0 }, { 9, 10, 11 }, // und_Armn -> hy_Armn_AM
+ { 0, 36, 0 }, { 255, 36, 102 }, // und_Avst -> ae_Avst_IR
+ { 0, 37, 0 }, { 266, 37, 101 }, // und_Bali -> ban_Bali_ID
+ { 0, 38, 0 }, { 267, 38, 37 }, // und_Bamu -> bax_Bamu_CM
+ { 0, 106, 0 }, { 336, 106, 121 }, // und_Bass -> bsq_Bass_LR
+ { 0, 39, 0 }, { 268, 39, 101 }, // und_Batk -> bbc_Batk_ID
+ { 0, 11, 0 }, { 15, 11, 18 }, // und_Beng -> bn_Beng_BD
+ { 0, 135, 0 }, { 99, 135, 100 }, // und_Bhks -> sa_Bhks_IN
+ { 0, 40, 0 }, { 25, 40, 208 }, // und_Bopo -> zh_Bopo_TW
+ { 0, 41, 0 }, { 342, 41, 100 }, // und_Brah -> pka_Brah_IN
+ { 0, 103, 0 }, { 37, 103, 74 }, // und_Brai -> fr_Brai_FR
+ { 0, 42, 0 }, { 269, 42, 101 }, // und_Bugi -> bug_Bugi_ID
+ { 0, 43, 0 }, { 270, 43, 170 }, // und_Buhd -> bku_Buhd_PH
+ { 0, 46, 0 }, { 272, 46, 18 }, // und_Cakm -> ccp_Cakm_BD
+ { 0, 44, 0 }, { 221, 44, 38 }, // und_Cans -> cr_Cans_CA
+ { 0, 45, 0 }, { 271, 45, 217 }, // und_Cari -> xcr_Cari_TR
+ { 0, 47, 0 }, { 276, 47, 232 }, // und_Cham -> cjm_Cham_VN
+ { 0, 12, 0 }, { 190, 12, 225 }, // und_Cher -> chr_Cher_US
+ { 0, 48, 0 }, { 274, 48, 64 }, // und_Copt -> cop_Copt_EG
+ { 0, 49, 0 }, { 264, 49, 56 }, // und_Cprt -> grc_Cprt_CY
+ { 0, 2, 0 }, { 96, 2, 178 }, // und_Cyrl -> ru_Cyrl_RU
+ { 0, 2, 2 }, { 74, 2, 2 }, // und_Cyrl_AL -> mk_Cyrl_AL
+ { 0, 2, 27 }, { 100, 2, 27 }, // und_Cyrl_BA -> sr_Cyrl_BA
+ { 0, 2, 81 }, { 2, 2, 81 }, // und_Cyrl_GE -> ab_Cyrl_GE
+ { 0, 2, 85 }, { 74, 2, 85 }, // und_Cyrl_GR -> mk_Cyrl_GR
+ { 0, 2, 141 }, { 129, 2, 141 }, // und_Cyrl_MD -> uk_Cyrl_MD
+ { 0, 2, 177 }, { 20, 2, 177 }, // und_Cyrl_RO -> bg_Cyrl_RO
+ { 0, 2, 191 }, { 129, 2, 191 }, // und_Cyrl_SK -> uk_Cyrl_SK
+ { 0, 2, 257 }, { 100, 2, 257 }, // und_Cyrl_XK -> sr_Cyrl_XK
+ { 0, 13, 0 }, { 49, 13, 100 }, // und_Deva -> hi_Deva_IN
+ { 0, 13, 25 }, { 84, 13, 25 }, // und_Deva_BT -> ne_Deva_BT
+ { 0, 13, 137 }, { 343, 13, 137 }, // und_Deva_MU -> bho_Deva_MU
+ { 0, 107, 0 }, { 37, 107, 74 }, // und_Dupl -> fr_Dupl_FR
+ { 0, 50, 0 }, { 263, 50, 64 }, // und_Egyp -> egy_Egyp_EG
+ { 0, 108, 0 }, { 6, 108, 2 }, // und_Elba -> sq_Elba_AL
+ { 0, 14, 0 }, { 7, 14, 69 }, // und_Ethi -> am_Ethi_ET
+ { 0, 15, 0 }, { 41, 15, 81 }, // und_Geor -> ka_Geor_GE
+ { 0, 52, 0 }, { 219, 52, 33 }, // und_Glag -> cu_Glag_BG
+ { 0, 53, 0 }, { 279, 53, 222 }, // und_Goth -> got_Goth_UA
+ { 0, 109, 0 }, { 99, 109, 100 }, // und_Gran -> sa_Gran_IN
+ { 0, 16, 0 }, { 43, 16, 85 }, // und_Grek -> el_Grek_GR
+ { 0, 17, 0 }, { 46, 17, 100 }, // und_Gujr -> gu_Gujr_IN
+ { 0, 4, 0 }, { 92, 4, 100 }, // und_Guru -> pa_Guru_IN
+ { 0, 140, 0 }, { 25, 140, 208 }, // und_Hanb -> zh_Hanb_TW
+ { 0, 55, 0 }, { 66, 55, 114 }, // und_Hang -> ko_Hang_KR
+ { 0, 54, 0 }, { 25, 54, 44 }, // und_Hani -> zh_Hani_CN
+ { 0, 56, 0 }, { 280, 56, 170 }, // und_Hano -> hnn_Hano_PH
+ { 0, 5, 0 }, { 25, 5, 44 }, // und_Hans -> zh_Hans_CN
+ { 0, 6, 0 }, { 25, 6, 208 }, // und_Hant -> zh_Hant_TW
+ { 0, 130, 0 }, { 356, 130, 103 }, // und_Hatr -> mis_Hatr_IQ
+ { 0, 18, 0 }, { 48, 18, 105 }, // und_Hebr -> he_Hebr_IL
+ { 0, 18, 38 }, { 137, 18, 38 }, // und_Hebr_CA -> yi_Hebr_CA
+ { 0, 18, 224 }, { 137, 18, 224 }, // und_Hebr_GB -> yi_Hebr_GB
+ { 0, 18, 205 }, { 137, 18, 205 }, // und_Hebr_SE -> yi_Hebr_SE
+ { 0, 18, 222 }, { 137, 18, 222 }, // und_Hebr_UA -> yi_Hebr_UA
+ { 0, 18, 225 }, { 137, 18, 225 }, // und_Hebr_US -> yi_Hebr_US
+ { 0, 104, 0 }, { 59, 104, 108 }, // und_Hira -> ja_Hira_JP
+ { 0, 129, 0 }, { 344, 129, 217 }, // und_Hluw -> hlu_Hluw_TR
+ { 0, 110, 0 }, { 333, 110, 117 }, // und_Hmng -> hnj_Hmng_LA
+ { 0, 132, 0 }, { 50, 132, 98 }, // und_Hung -> hu_Hung_HU
+ { 0, 79, 0 }, { 278, 79, 106 }, // und_Ital -> ett_Ital_IT
+ { 0, 141, 0 }, { 66, 141, 114 }, // und_Jamo -> ko_Jamo_KR
+ { 0, 60, 0 }, { 60, 60, 101 }, // und_Java -> jv_Java_ID
+ { 0, 19, 0 }, { 59, 19, 108 }, // und_Jpan -> ja_Jpan_JP
+ { 0, 63, 0 }, { 277, 63, 147 }, // und_Kali -> eky_Kali_MM
+ { 0, 62, 0 }, { 59, 62, 108 }, // und_Kana -> ja_Kana_JP
+ { 0, 64, 0 }, { 300, 64, 163 }, // und_Khar -> pra_Khar_PK
+ { 0, 20, 0 }, { 23, 20, 36 }, // und_Khmr -> km_Khmr_KH
+ { 0, 111, 0 }, { 105, 111, 100 }, // und_Khoj -> sd_Khoj_IN
+ { 0, 21, 0 }, { 61, 21, 100 }, // und_Knda -> kn_Knda_IN
+ { 0, 22, 0 }, { 66, 22, 114 }, // und_Kore -> ko_Kore_KR
+ { 0, 61, 0 }, { 343, 61, 100 }, // und_Kthi -> bho_Kthi_IN
+ { 0, 65, 0 }, { 292, 65, 211 }, // und_Lana -> nod_Lana_TH
+ { 0, 23, 0 }, { 69, 23, 117 }, // und_Laoo -> lo_Laoo_LA
+ { 0, 7, 1 }, { 126, 7, 1 }, // und_Latn_AF -> tk_Latn_AF
+ { 0, 7, 11 }, { 67, 7, 11 }, // und_Latn_AM -> ku_Latn_AM
+ { 0, 7, 44 }, { 139, 7, 44 }, // und_Latn_CN -> za_Latn_CN
+ { 0, 7, 56 }, { 125, 7, 56 }, // und_Latn_CY -> tr_Latn_CY
+ { 0, 7, 3 }, { 37, 7, 3 }, // und_Latn_DZ -> fr_Latn_DZ
+ { 0, 7, 69 }, { 31, 7, 69 }, // und_Latn_ET -> en_Latn_ET
+ { 0, 7, 81 }, { 67, 7, 81 }, // und_Latn_GE -> ku_Latn_GE
+ { 0, 7, 102 }, { 126, 7, 102 }, // und_Latn_IR -> tk_Latn_IR
+ { 0, 7, 48 }, { 37, 7, 48 }, // und_Latn_KM -> fr_Latn_KM
+ { 0, 7, 145 }, { 37, 7, 145 }, // und_Latn_MA -> fr_Latn_MA
+ { 0, 7, 127 }, { 6, 7, 127 }, // und_Latn_MK -> sq_Latn_MK
+ { 0, 7, 126 }, { 91, 7, 126 }, // und_Latn_MO -> pt_Latn_MO
+ { 0, 7, 136 }, { 37, 7, 136 }, // und_Latn_MR -> fr_Latn_MR
+ { 0, 7, 207 }, { 37, 7, 207 }, // und_Latn_SY -> fr_Latn_SY
+ { 0, 7, 216 }, { 37, 7, 216 }, // und_Latn_TN -> fr_Latn_TN
+ { 0, 7, 208 }, { 174, 7, 208 }, // und_Latn_TW -> trv_Latn_TW
+ { 0, 7, 222 }, { 90, 7, 222 }, // und_Latn_UA -> pl_Latn_UA
+ { 0, 66, 0 }, { 283, 66, 100 }, // und_Lepc -> lep_Lepc_IN
+ { 0, 67, 0 }, { 284, 67, 100 }, // und_Limb -> lif_Limb_IN
+ { 0, 112, 0 }, { 332, 112, 85 }, // und_Lina -> lab_Lina_GR
+ { 0, 68, 0 }, { 264, 68, 85 }, // und_Linb -> grc_Linb_GR
+ { 0, 51, 0 }, { 285, 51, 44 }, // und_Lisu -> lis_Lisu_CN
+ { 0, 69, 0 }, { 287, 69, 217 }, // und_Lyci -> xlc_Lyci_TR
+ { 0, 70, 0 }, { 288, 70, 217 }, // und_Lydi -> xld_Lydi_TR
+ { 0, 113, 0 }, { 49, 113, 100 }, // und_Mahj -> hi_Mahj_IN
+ { 0, 71, 0 }, { 273, 71, 102 }, // und_Mand -> myz_Mand_IR
+ { 0, 114, 0 }, { 329, 114, 44 }, // und_Mani -> xmn_Mani_CN
+ { 0, 136, 0 }, { 121, 136, 44 }, // und_Marc -> bo_Marc_CN
+ { 0, 115, 0 }, { 330, 115, 189 }, // und_Mend -> men_Mend_SL
+ { 0, 74, 0 }, { 291, 74, 201 }, // und_Merc -> xmr_Merc_SD
+ { 0, 73, 0 }, { 291, 73, 201 }, // und_Mero -> xmr_Mero_SD
+ { 0, 24, 0 }, { 77, 24, 100 }, // und_Mlym -> ml_Mlym_IN
+ { 0, 116, 0 }, { 80, 116, 100 }, // und_Modi -> mr_Modi_IN
+ { 0, 8, 0 }, { 82, 8, 44 }, // und_Mong -> mn_Mong_CN
+ { 0, 117, 0 }, { 347, 117, 18 }, // und_Mroo -> mro_Mroo_BD
+ { 0, 72, 0 }, { 290, 72, 100 }, // und_Mtei -> mni_Mtei_IN
+ { 0, 131, 0 }, { 352, 131, 163 }, // und_Mult -> skr_Mult_PK
+ { 0, 25, 0 }, { 21, 25, 147 }, // und_Mymr -> my_Mymr_MM
+ { 0, 118, 0 }, { 331, 118, 186 }, // und_Narb -> xna_Narb_SA
+ { 0, 119, 0 }, { 265, 119, 109 }, // und_Nbat -> arc_Nbat_JO
+ { 0, 137, 0 }, { 348, 137, 150 }, // und_Newa -> new_Newa_NP
+ { 0, 75, 0 }, { 289, 75, 91 }, // und_Nkoo -> man_Nkoo_GN
+ { 0, 77, 0 }, { 293, 77, 104 }, // und_Ogam -> sga_Ogam_IE
+ { 0, 78, 0 }, { 304, 78, 100 }, // und_Olck -> sat_Olck_IN
+ { 0, 82, 0 }, { 296, 82, 143 }, // und_Orkh -> otk_Orkh_MN
+ { 0, 26, 0 }, { 87, 26, 100 }, // und_Orya -> or_Orya_IN
+ { 0, 138, 0 }, { 358, 138, 225 }, // und_Osge -> osa_Osge_US
+ { 0, 83, 0 }, { 110, 83, 194 }, // und_Osma -> so_Osma_SO
+ { 0, 120, 0 }, { 265, 120, 207 }, // und_Palm -> arc_Palm_SY
+ { 0, 121, 0 }, { 338, 121, 147 }, // und_Pauc -> ctd_Pauc_MM
+ { 0, 122, 0 }, { 226, 122, 178 }, // und_Perm -> kv_Perm_RU
+ { 0, 84, 0 }, { 345, 84, 44 }, // und_Phag -> lzh_Phag_CN
+ { 0, 58, 0 }, { 297, 58, 102 }, // und_Phli -> pal_Phli_IR
+ { 0, 123, 0 }, { 297, 123, 44 }, // und_Phlp -> pal_Phlp_CN
+ { 0, 85, 0 }, { 299, 85, 119 }, // und_Phnx -> phn_Phnx_LB
+ { 0, 86, 0 }, { 282, 86, 44 }, // und_Plrd -> hmd_Plrd_CN
+ { 0, 59, 0 }, { 298, 59, 102 }, // und_Prti -> xpr_Prti_IR
+ { 0, 87, 0 }, { 301, 87, 101 }, // und_Rjng -> rej_Rjng_ID
+ { 0, 88, 0 }, { 294, 88, 205 }, // und_Runr -> non_Runr_SE
+ { 0, 89, 0 }, { 303, 89, 105 }, // und_Samr -> smp_Samr_IL
+ { 0, 81, 0 }, { 302, 81, 237 }, // und_Sarb -> xsa_Sarb_YE
+ { 0, 90, 0 }, { 305, 90, 100 }, // und_Saur -> saz_Saur_IN
+ { 0, 133, 0 }, { 341, 133, 225 }, // und_Sgnw -> ase_Sgnw_US
+ { 0, 92, 0 }, { 31, 92, 224 }, // und_Shaw -> en_Shaw_GB
+ { 0, 91, 0 }, { 99, 91, 100 }, // und_Shrd -> sa_Shrd_IN
+ { 0, 124, 0 }, { 99, 124, 100 }, // und_Sidd -> sa_Sidd_IN
+ { 0, 125, 0 }, { 105, 125, 100 }, // und_Sind -> sd_Sind_IN
+ { 0, 32, 0 }, { 106, 32, 198 }, // und_Sinh -> si_Sinh_LK
+ { 0, 93, 0 }, { 306, 93, 100 }, // und_Sora -> srb_Sora_IN
+ { 0, 95, 0 }, { 112, 95, 101 }, // und_Sund -> su_Sund_ID
+ { 0, 96, 0 }, { 307, 96, 18 }, // und_Sylo -> syl_Sylo_BD
+ { 0, 33, 0 }, { 151, 33, 103 }, // und_Syrc -> syr_Syrc_IQ
+ { 0, 98, 0 }, { 308, 98, 170 }, // und_Tagb -> tbw_Tagb_PH
+ { 0, 101, 0 }, { 275, 101, 100 }, // und_Takr -> doi_Takr_IN
+ { 0, 99, 0 }, { 310, 99, 44 }, // und_Tale -> tdd_Tale_CN
+ { 0, 76, 0 }, { 286, 76, 44 }, // und_Talu -> khb_Talu_CN
+ { 0, 27, 0 }, { 117, 27, 100 }, // und_Taml -> ta_Taml_IN
+ { 0, 139, 0 }, { 359, 139, 44 }, // und_Tang -> txg_Tang_CN
+ { 0, 100, 0 }, { 309, 100, 232 }, // und_Tavt -> blt_Tavt_VN
+ { 0, 28, 0 }, { 119, 28, 100 }, // und_Telu -> te_Telu_IN
+ { 0, 9, 0 }, { 314, 9, 145 }, // und_Tfng -> zgh_Tfng_MA
+ { 0, 97, 0 }, { 166, 97, 170 }, // und_Tglg -> fil_Tglg_PH
+ { 0, 29, 0 }, { 143, 29, 131 }, // und_Thaa -> dv_Thaa_MV
+ { 0, 30, 0 }, { 120, 30, 211 }, // und_Thai -> th_Thai_TH
+ { 0, 31, 0 }, { 121, 31, 44 }, // und_Tibt -> bo_Tibt_CN
+ { 0, 126, 0 }, { 339, 126, 100 }, // und_Tirh -> mai_Tirh_IN
+ { 0, 102, 0 }, { 311, 102, 207 }, // und_Ugar -> uga_Ugar_SY
+ { 0, 35, 0 }, { 252, 35, 121 }, // und_Vaii -> vai_Vaii_LR
+ { 0, 127, 0 }, { 334, 127, 100 }, // und_Wara -> hoc_Wara_IN
+ { 0, 80, 0 }, { 295, 80, 102 }, // und_Xpeo -> peo_Xpeo_IR
+ { 0, 94, 0 }, { 262, 94, 103 }, // und_Xsux -> akk_Xsux_IQ
+ { 0, 34, 0 }, { 168, 34, 44 } // und_Yiii -> ii_Yiii_CN
+};
+
+static const quint16 locale_index[] = {
+ 0, // AnyLanguage
+ 0, // C
+ 0, // Abkhazian
+ 1, // Oromo
+ 3, // Afar
+ 4, // Afrikaans
+ 6, // Albanian
+ 9, // Amharic
+ 10, // Arabic
+ 38, // Armenian
+ 39, // Assamese
+ 0, // Aymara
+ 40, // Azerbaijani
+ 43, // Bashkir
+ 44, // Basque
+ 45, // Bengali
+ 47, // Dzongkha
+ 0, // Bihari
+ 0, // Bislama
+ 48, // Breton
+ 49, // Bulgarian
+ 50, // Burmese
+ 51, // Belarusian
+ 52, // Khmer
+ 53, // Catalan
+ 57, // Chinese
+ 64, // Corsican
+ 65, // Croatian
+ 67, // Czech
+ 68, // Danish
+ 70, // Dutch
+ 77, // English
+ 183, // Esperanto
+ 184, // Estonian
+ 185, // Faroese
+ 0, // Fijian
+ 187, // Finnish
+ 188, // French
+ 234, // Western Frisian
+ 235, // Gaelic
+ 236, // Galician
+ 237, // Georgian
+ 238, // German
+ 245, // Greek
+ 247, // Greenlandic
+ 248, // Guarani
+ 249, // Gujarati
+ 250, // Hausa
+ 254, // Hebrew
+ 255, // Hindi
+ 256, // Hungarian
+ 257, // Icelandic
+ 258, // Indonesian
+ 259, // Interlingua
+ 0, // Interlingue
+ 260, // Inuktitut
+ 0, // Inupiak
+ 262, // Irish
+ 264, // Italian
+ 268, // Japanese
+ 269, // Javanese
+ 270, // Kannada
+ 271, // Kashmiri
+ 272, // Kazakh
+ 273, // Kinyarwanda
+ 274, // Kirghiz
+ 275, // Korean
+ 277, // Kurdish
+ 278, // Rundi
+ 279, // Lao
+ 0, // Latin
+ 280, // Latvian
+ 281, // Lingala
+ 285, // Lithuanian
+ 286, // Macedonian
+ 287, // Malagasy
+ 288, // Malay
+ 292, // Malayalam
+ 293, // Maltese
+ 294, // Maori
+ 295, // Marathi
+ 0, // Marshallese
+ 296, // Mongolian
+ 0, // Nauru
+ 298, // Nepali
+ 300, // Norwegian Bokmal
+ 302, // Occitan
+ 303, // Oriya
+ 304, // Pashto
+ 306, // Persian
+ 308, // Polish
+ 309, // Portuguese
+ 321, // Punjabi
+ 323, // Quechua
+ 326, // Romansh
+ 327, // Romanian
+ 329, // Russian
+ 0, // Samoan
+ 335, // Sango
+ 336, // Sanskrit
+ 337, // Serbian
+ 345, // Ossetic
+ 347, // Southern Sotho
+ 348, // Tswana
+ 349, // Shona
+ 350, // Sindhi
+ 351, // Sinhala
+ 352, // Swati
+ 353, // Slovak
+ 354, // Slovenian
+ 355, // Somali
+ 359, // Spanish
+ 387, // Sundanese
+ 388, // Swahili
+ 392, // Swedish
+ 395, // Sardinian
+ 396, // Tajik
+ 397, // Tamil
+ 401, // Tatar
+ 402, // Telugu
+ 403, // Thai
+ 404, // Tibetan
+ 406, // Tigrinya
+ 408, // Tongan
+ 409, // Tsonga
+ 410, // Turkish
+ 412, // Turkmen
+ 0, // Tahitian
+ 413, // Uighur
+ 414, // Ukrainian
+ 415, // Urdu
+ 417, // Uzbek
+ 420, // Vietnamese
+ 421, // Volapuk
+ 422, // Welsh
+ 423, // Wolof
+ 424, // Xhosa
+ 425, // Yiddish
+ 426, // Yoruba
+ 0, // Zhuang
+ 428, // Zulu
+ 429, // Norwegian Nynorsk
+ 430, // Bosnian
+ 432, // Divehi
+ 433, // Manx
+ 434, // Cornish
+ 435, // Akan
+ 436, // Konkani
+ 437, // Ga
+ 438, // Igbo
+ 439, // Kamba
+ 440, // Syriac
+ 441, // Blin
+ 442, // Geez
+ 0, // Koro
+ 443, // Sidamo
+ 444, // Atsam
+ 445, // Tigre
+ 446, // Jju
+ 447, // Friulian
+ 448, // Venda
+ 449, // Ewe
+ 451, // Walamo
+ 452, // Hawaiian
+ 453, // Tyap
+ 454, // Nyanja
+ 455, // Filipino
+ 456, // Swiss German
+ 459, // Sichuan Yi
+ 460, // Kpelle
+ 461, // Low German
+ 463, // South Ndebele
+ 464, // Northern Sotho
+ 465, // Northern Sami
+ 468, // Taroko
+ 469, // Gusii
+ 470, // Taita
+ 471, // Fulah
+ 484, // Kikuyu
+ 485, // Samburu
+ 486, // Sena
+ 487, // North Ndebele
+ 488, // Rombo
+ 489, // Tachelhit
+ 491, // Kabyle
+ 492, // Nyankole
+ 493, // Bena
+ 494, // Vunjo
+ 495, // Bambara
+ 497, // Embu
+ 498, // Cherokee
+ 499, // Morisyen
+ 500, // Makonde
+ 501, // Langi
+ 502, // Ganda
+ 503, // Bemba
+ 504, // Kabuverdianu
+ 505, // Meru
+ 506, // Kalenjin
+ 507, // Nama
+ 508, // Machame
+ 509, // Colognian
+ 510, // Masai
+ 512, // Soga
+ 513, // Luyia
+ 514, // Asu
+ 515, // Teso
+ 517, // Saho
+ 518, // Koyra Chiini
+ 519, // Rwa
+ 520, // Luo
+ 521, // Chiga
+ 522, // Central Morocco Tamazight
+ 523, // Koyraboro Senni
+ 524, // Shambala
+ 525, // Bodo
+ 0, // Avaric
+ 0, // Chamorro
+ 526, // Chechen
+ 527, // Church
+ 528, // Chuvash
+ 0, // Cree
+ 0, // Haitian
+ 0, // Herero
+ 0, // Hiri Motu
+ 0, // Kanuri
+ 0, // Komi
+ 0, // Kongo
+ 0, // Kwanyama
+ 0, // Limburgish
+ 529, // Luba Katanga
+ 530, // Luxembourgish
+ 0, // Navaho
+ 0, // Ndonga
+ 0, // Ojibwa
+ 0, // Pali
+ 531, // Walloon
+ 532, // Aghem
+ 533, // Basaa
+ 534, // Zarma
+ 535, // Duala
+ 536, // Jola Fonyi
+ 537, // Ewondo
+ 538, // Bafia
+ 539, // Makhuwa Meetto
+ 540, // Mundang
+ 541, // Kwasio
+ 542, // Nuer
+ 543, // Sakha
+ 544, // Sangu
+ 0, // Congo Swahili
+ 545, // Tasawaq
+ 546, // Vai
+ 548, // Walser
+ 549, // Yangben
+ 0, // Avestan
+ 550, // Asturian
+ 551, // Ngomba
+ 552, // Kako
+ 553, // Meta
+ 554, // Ngiemboon
+ 555, // Aragonese
+ 0, // Akkadian
+ 0, // Ancient Egyptian
+ 0, // Ancient Greek
+ 0, // Aramaic
+ 0, // Balinese
+ 0, // Bamun
+ 0, // Batak Toba
+ 0, // Buginese
+ 0, // Buhid
+ 0, // Carian
+ 0, // Chakma
+ 0, // Classical Mandaic
+ 0, // Coptic
+ 0, // Dogri
+ 0, // Eastern Cham
+ 0, // Eastern Kayah
+ 0, // Etruscan
+ 0, // Gothic
+ 0, // Hanunoo
+ 0, // Ingush
+ 0, // Large Flowery Miao
+ 0, // Lepcha
+ 0, // Limbu
+ 0, // Lisu
+ 0, // Lu
+ 0, // Lycian
+ 0, // Lydian
+ 0, // Mandingo
+ 556, // Manipuri
+ 0, // Meroitic
+ 0, // Northern Thai
+ 0, // Old Irish
+ 0, // Old Norse
+ 0, // Old Persian
+ 0, // Old Turkish
+ 0, // Pahlavi
+ 0, // Parthian
+ 0, // Phoenician
+ 0, // Prakrit Language
+ 0, // Rejang
+ 0, // Sabaean
+ 0, // Samaritan
+ 0, // Santali
+ 0, // Saurashtra
+ 0, // Sora
+ 0, // Sylheti
+ 0, // Tagbanwa
+ 557, // Tai Dam
+ 0, // Tai Nua
+ 0, // Ugaritic
+ 558, // Akoose
+ 559, // Lakota
+ 560, // Standard Moroccan Tamazight
+ 561, // Mapuche
+ 562, // Central Kurdish
+ 564, // Lower Sorbian
+ 565, // Upper Sorbian
+ 566, // Kenyang
+ 567, // Mohawk
+ 568, // Nko
+ 569, // Prussian
+ 570, // Kiche
+ 571, // Southern Sami
+ 572, // Lule Sami
+ 573, // Inari Sami
+ 574, // Skolt Sami
+ 575, // Warlpiri
+ 0, // Manichaean Middle Persian
+ 0, // Mende
+ 0, // Ancient North Arabian
+ 0, // Linear A
+ 0, // Hmong Njua
+ 0, // Ho
+ 0, // Lezghian
+ 0, // Bassa
+ 0, // Mono
+ 0, // Tedim Chin
+ 0, // Maithili
+ 0, // Ahom
+ 0, // American Sign Language
+ 0, // Ardhamagadhi Prakrit
+ 0, // Bhojpuri
+ 0, // Hieroglyphic Luwian
+ 0, // Literary Chinese
+ 576, // Mazanderani
+ 0, // Mru
+ 0, // Newari
+ 577, // Northern Luri
+ 0, // Palauan
+ 0, // Papiamento
+ 0, // Saraiki
+ 0, // Tokelau
+ 0, // Tok Pisin
+ 0, // Tuvalu
+ 0, // Uncoded Languages
+ 579, // Cantonese
+ 581, // Osage
+ 0, // Tangut
+ 582, // Ido
+ 583, // Lojban
+ 584, // Sicilian
+ 585, // Southern Kurdish
+ 586, // Western Balochi
+ 587, // Cebuano
+ 588, // Erzya
+ 589, // Chickasaw
+ 590, // Muscogee
+ 591, // Silesian
+ 0 // trailing 0
+};
+
+static const QLocaleData locale_data[] = {
+ // lang script terr dec group list prcnt zero minus plus exp quotOpn quotEnd altQtOpn altQtEnd lpStart lpMid lpEnd lpTwo sDtFmt lDtFmt sTmFmt lTmFmt ssDays slDays snDays sDays lDays nDays am pm byte siQuant iecQuant currISO currSym currDsply currFmt currFmtNeg endoLang endoCntry curDgt curRnd dow1st wknd+ wknd-
+ { 1, 0, 0, 46, 44, 59, 37, 48, 45, 43, 101, 34, 34, 39, 39, 0,6 , 0,6 , 0,6 , 0,6 , 0,10 , 10,17 , 0,8 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 99,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 0,7 , 0,4 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // C/AnyScript/AnyCountry
+ { 3, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 35,18 , 18,7 , 25,12 , 113,28 , 141,55 , 85,14 , 113,28 , 141,55 , 85,14 , 2,2 , 2,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,2 , 7,24 , 4,4 , 4,0 , 0,6 , 6,10 , 2, 1, 7, 6, 7 }, // Oromo/Latin/Ethiopia
+ { 3, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 35,18 , 37,5 , 8,10 , 113,28 , 141,55 , 196,14 , 113,28 , 141,55 , 196,14 , 2,2 , 2,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 0,7 , 4,4 , 4,0 , 0,6 , 16,8 , 2, 1, 7, 6, 7 }, // Oromo/Latin/Kenya
+ { 4, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Afar/Latin/Ethiopia
+ { 5, 7, 195, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 6,8 , 6,8 , 53,10 , 80,17 , 37,5 , 8,10 , 210,28 , 238,58 , 296,14 , 210,28 , 238,58 , 296,14 , 4,3 , 4,3 , 49,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 31,67 , 4,4 , 4,0 , 24,9 , 33,11 , 2, 1, 7, 6, 7 }, // Afrikaans/Latin/South Africa
+ { 5, 7, 148, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 6,8 , 6,8 , 53,10 , 97,16 , 18,7 , 25,12 , 210,28 , 238,58 , 296,14 , 210,28 , 238,58 , 296,14 , 4,3 , 4,3 , 49,5 , 5,17 , 22,23 , {78,65,68}, 6,1 , 98,55 , 4,4 , 4,0 , 24,9 , 44,7 , 2, 1, 1, 6, 7 }, // Afrikaans/Latin/Namibia
+ { 6, 7, 2, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 14,9 , 14,9 , 113,6 , 10,17 , 18,7 , 42,13 , 310,28 , 338,58 , 396,15 , 411,28 , 338,58 , 396,15 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {65,76,76}, 7,4 , 153,45 , 13,5 , 4,0 , 51,5 , 56,8 , 0, 0, 1, 6, 7 }, // Albanian/Latin/Albania
+ { 6, 7, 127, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 14,9 , 14,9 , 113,6 , 10,17 , 37,5 , 8,10 , 310,28 , 338,58 , 396,15 , 411,28 , 338,58 , 396,15 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {77,75,68}, 11,3 , 198,54 , 13,5 , 4,0 , 51,5 , 64,18 , 2, 1, 1, 6, 7 }, // Albanian/Latin/Macedonia
+ { 6, 7, 257, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 14,9 , 14,9 , 113,6 , 10,17 , 37,5 , 8,10 , 310,28 , 338,58 , 396,15 , 411,28 , 338,58 , 396,15 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 252,21 , 13,5 , 4,0 , 51,5 , 82,6 , 2, 1, 1, 6, 7 }, // Albanian/Latin/Kosovo
+ { 7, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 23,6 , 23,6 , 29,9 , 38,8 , 119,10 , 63,17 , 18,7 , 25,12 , 439,27 , 466,28 , 494,14 , 439,27 , 466,28 , 494,14 , 18,3 , 17,4 , 58,3 , 61,23 , 22,23 , {69,84,66}, 15,2 , 273,34 , 4,4 , 4,0 , 88,4 , 92,5 , 2, 1, 7, 6, 7 }, // Amharic/Ethiopic/Ethiopia
+ { 8, 1, 64, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {69,71,80}, 17,5 , 307,81 , 13,5 , 4,0 , 97,7 , 104,3 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Egypt
+ { 8, 1, 3, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {68,90,68}, 22,5 , 388,102 , 13,5 , 4,0 , 97,7 , 107,7 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Algeria
+ { 8, 1, 17, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {66,72,68}, 27,5 , 490,91 , 13,5 , 4,0 , 97,7 , 114,7 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Bahrain
+ { 8, 1, 42, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {88,65,70}, 32,4 , 581,112 , 13,5 , 4,0 , 97,7 , 121,4 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Chad
+ { 8, 1, 48, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 37,5 , 8,10 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {75,77,70}, 36,2 , 693,105 , 13,5 , 4,0 , 97,7 , 125,9 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Comoros
+ { 8, 1, 59, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {68,74,70}, 38,3 , 798,84 , 13,5 , 4,0 , 97,7 , 134,6 , 0, 0, 6, 6, 7 }, // Arabic/Arabic/Djibouti
+ { 8, 1, 67, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {69,82,78}, 41,3 , 882,91 , 13,5 , 4,0 , 97,7 , 140,7 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Eritrea
+ { 8, 1, 103, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {73,81,68}, 44,5 , 973,84 , 13,5 , 4,0 , 97,7 , 147,6 , 0, 0, 6, 5, 6 }, // Arabic/Arabic/Iraq
+ { 8, 1, 105, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 55,4 , 59,9 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {73,76,83}, 49,1 , 1057,133 , 13,5 , 4,0 , 97,7 , 153,7 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/Israel
+ { 8, 1, 109, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {74,79,68}, 50,5 , 1190,84 , 13,5 , 4,0 , 97,7 , 160,6 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Jordan
+ { 8, 1, 115, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {75,87,68}, 55,5 , 1274,84 , 13,5 , 4,0 , 97,7 , 166,6 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Kuwait
+ { 8, 1, 119, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {76,66,80}, 60,5 , 1358,84 , 13,5 , 4,0 , 97,7 , 172,5 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Lebanon
+ { 8, 1, 122, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {76,89,68}, 65,5 , 1442,88 , 13,5 , 4,0 , 97,7 , 177,5 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Libya
+ { 8, 1, 136, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {77,82,85}, 70,4 , 1530,112 , 13,5 , 4,0 , 97,7 , 182,9 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Mauritania
+ { 8, 1, 145, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 37,5 , 8,10 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {77,65,68}, 74,5 , 1642,87 , 13,5 , 4,0 , 97,7 , 191,6 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Morocco
+ { 8, 1, 162, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {79,77,82}, 79,5 , 1729,77 , 13,5 , 4,0 , 97,7 , 197,5 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Oman
+ { 8, 1, 165, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {73,76,83}, 49,1 , 1057,133 , 13,5 , 4,0 , 97,7 , 202,18 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Palestinian Territories
+ { 8, 1, 175, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {81,65,82}, 84,5 , 1806,70 , 13,5 , 4,0 , 97,7 , 220,3 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Qatar
+ { 8, 1, 186, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,65,82}, 89,5 , 1876,77 , 13,5 , 4,0 , 97,7 , 223,24 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/Saudi Arabia
+ { 8, 1, 194, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,79,83}, 94,1 , 1953,77 , 13,5 , 4,0 , 97,7 , 247,7 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Somalia
+ { 8, 1, 201, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,68,71}, 95,4 , 2030,91 , 13,5 , 4,0 , 97,7 , 254,7 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Sudan
+ { 8, 1, 207, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,89,80}, 99,5 , 2121,77 , 13,5 , 4,0 , 97,7 , 261,5 , 0, 0, 6, 5, 6 }, // Arabic/Arabic/Syria
+ { 8, 1, 216, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {84,78,68}, 104,5 , 2198,95 , 13,5 , 4,0 , 97,7 , 266,4 , 3, 0, 1, 6, 7 }, // Arabic/Arabic/Tunisia
+ { 8, 1, 223, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {65,69,68}, 109,5 , 2293,91 , 13,5 , 4,0 , 97,7 , 270,24 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/United Arab Emirates
+ { 8, 1, 236, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {77,65,68}, 74,5 , 1642,87 , 13,5 , 4,0 , 97,7 , 294,15 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Western Sahara
+ { 8, 1, 237, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {89,69,82}, 114,5 , 2384,70 , 13,5 , 4,0 , 97,7 , 309,5 , 0, 0, 7, 5, 6 }, // Arabic/Arabic/Yemen
+ { 8, 1, 254, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,83,80}, 119,1 , 2454,132 , 13,5 , 4,0 , 97,7 , 314,12 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/South Sudan
+ { 8, 1, 260, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 46,6 , 46,6 , 129,10 , 139,17 , 18,7 , 25,12 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 13,5 , 4,0 , 326,22 , 348,6 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/World
+ { 9, 10, 11, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 52,7 , 52,7 , 156,8 , 164,20 , 37,5 , 8,10 , 574,28 , 602,62 , 664,14 , 574,28 , 602,62 , 664,14 , 0,2 , 0,2 , 135,6 , 141,17 , 22,23 , {65,77,68}, 120,1 , 2586,46 , 13,5 , 4,0 , 354,7 , 361,8 , 2, 0, 1, 6, 7 }, // Armenian/Armenian/Armenia
+ { 10, 11, 100, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 59,9 , 59,9 , 184,8 , 192,18 , 68,7 , 75,12 , 678,32 , 710,58 , 768,14 , 678,32 , 710,58 , 768,14 , 22,9 , 22,7 , 158,4 , 162,37 , 22,23 , {73,78,82}, 121,1 , 2632,43 , 8,5 , 4,0 , 369,7 , 376,4 , 2, 1, 7, 7, 7 }, // Assamese/Bengali/India
+ { 12, 7, 15, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 68,8 , 68,8 , 156,8 , 210,17 , 37,5 , 8,10 , 782,27 , 809,67 , 99,14 , 876,27 , 809,67 , 99,14 , 0,2 , 0,2 , 199,4 , 5,17 , 22,23 , {65,90,78}, 122,1 , 2675,58 , 13,5 , 4,0 , 380,10 , 390,10 , 2, 1, 1, 6, 7 }, // Azerbaijani/Latin/Azerbaijan
+ { 12, 1, 102, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 5 }, // Azerbaijani/Arabic/Iran
+ { 12, 2, 15, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 156,8 , 210,17 , 37,5 , 8,10 , 903,27 , 930,67 , 99,14 , 903,27 , 930,67 , 99,14 , 31,2 , 29,2 , 45,4 , 5,17 , 22,23 , {65,90,78}, 122,1 , 2733,12 , 13,5 , 4,0 , 400,10 , 410,10 , 2, 1, 1, 6, 7 }, // Azerbaijani/Cyrillic/Azerbaijan
+ { 13, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Bashkir/Cyrillic/Russia
+ { 14, 7, 197, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8220, 8221, 0,6 , 0,6 , 76,9 , 76,9 , 227,6 , 233,36 , 37,5 , 87,12 , 997,28 , 1025,68 , 1093,14 , 997,28 , 1025,68 , 1093,14 , 0,2 , 0,2 , 203,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 2745,20 , 13,5 , 4,0 , 420,7 , 427,8 , 2, 1, 1, 6, 7 }, // Basque/Latin/Spain
+ { 15, 11, 18, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 85,9 , 85,9 , 269,6 , 192,18 , 18,7 , 25,12 , 1107,37 , 1144,58 , 1202,18 , 1107,37 , 1144,58 , 1202,18 , 0,2 , 0,2 , 158,4 , 5,17 , 22,23 , {66,68,84}, 124,1 , 2765,49 , 0,4 , 4,0 , 435,5 , 440,8 , 2, 1, 7, 6, 7 }, // Bengali/Bengali/Bangladesh
+ { 15, 11, 100, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 85,9 , 85,9 , 269,6 , 192,18 , 18,7 , 25,12 , 1107,37 , 1144,58 , 1202,18 , 1107,37 , 1144,58 , 1202,18 , 0,2 , 0,2 , 158,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 2814,43 , 0,4 , 4,0 , 435,5 , 448,4 , 2, 1, 7, 7, 7 }, // Bengali/Bengali/India
+ { 16, 31, 25, 46, 44, 59, 37, 3872, 45, 43, 101, 8220, 8221, 8216, 8217, 94,9 , 94,9 , 94,9 , 94,9 , 53,10 , 275,30 , 99,22 , 121,27 , 1220,34 , 1254,79 , 1333,27 , 1220,34 , 1254,79 , 1333,27 , 33,5 , 31,6 , 45,4 , 5,17 , 22,23 , {66,84,78}, 125,3 , 2857,15 , 4,4 , 4,0 , 452,6 , 458,5 , 2, 1, 7, 6, 7 }, // Dzongkha/Tibetan/Bhutan
+ { 19, 7, 74, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 103,8 , 103,8 , 119,10 , 97,16 , 37,5 , 8,10 , 1360,33 , 1393,43 , 1436,18 , 1360,33 , 1393,43 , 1436,18 , 38,4 , 37,4 , 210,7 , 217,17 , 234,23 , {69,85,82}, 14,1 , 2872,36 , 13,5 , 4,0 , 463,9 , 472,5 , 2, 1, 1, 6, 7 }, // Breton/Latin/France
+ { 20, 2, 33, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 305,12 , 317,22 , 55,4 , 59,9 , 1454,21 , 1475,55 , 1530,14 , 1454,21 , 1475,55 , 1530,14 , 42,6 , 41,6 , 257,7 , 5,17 , 22,23 , {66,71,78}, 128,3 , 2908,47 , 13,5 , 4,0 , 477,9 , 486,8 , 2, 1, 1, 6, 7 }, // Bulgarian/Cyrillic/Bulgaria
+ { 21, 25, 147, 46, 44, 4170, 37, 4160, 45, 43, 101, 8220, 8221, 8216, 8217, 118,5 , 118,5 , 123,10 , 123,10 , 339,8 , 347,18 , 148,6 , 154,10 , 1544,54 , 1544,54 , 1598,14 , 1544,54 , 1544,54 , 1598,14 , 48,5 , 47,3 , 264,5 , 5,17 , 22,23 , {77,77,75}, 131,1 , 2955,29 , 13,5 , 4,0 , 494,6 , 494,6 , 0, 0, 7, 6, 7 }, // Burmese/Myanmar/Myanmar
+ { 22, 2, 20, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 133,7 , 133,7 , 365,7 , 317,22 , 37,5 , 164,11 , 1612,21 , 1633,56 , 1689,14 , 1612,21 , 1633,56 , 1689,14 , 0,2 , 0,2 , 269,5 , 274,17 , 22,23 , {66,89,78}, 0,2 , 2984,89 , 13,5 , 4,0 , 500,10 , 510,8 , 2, 0, 1, 6, 7 }, // Belarusian/Cyrillic/Belarus
+ { 23, 20, 36, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 140,9 , 149,9 , 269,6 , 97,16 , 18,7 , 25,12 , 1703,40 , 1743,46 , 1789,14 , 1703,40 , 1803,47 , 1789,14 , 0,2 , 0,2 , 291,2 , 5,17 , 22,23 , {75,72,82}, 132,1 , 3073,29 , 0,4 , 4,0 , 518,5 , 523,7 , 2, 1, 7, 6, 7 }, // Khmer/Khmer/Cambodia
+ { 24, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 158,7 , 158,7 , 269,6 , 372,22 , 55,4 , 59,9 , 1850,28 , 1878,60 , 1938,21 , 1850,28 , 1878,60 , 1938,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 530,6 , 536,7 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Spain
+ { 24, 7, 5, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 158,7 , 158,7 , 269,6 , 372,22 , 55,4 , 59,9 , 1850,28 , 1878,60 , 1938,21 , 1850,28 , 1878,60 , 1938,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 530,6 , 543,7 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Andorra
+ { 24, 7, 74, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 158,7 , 158,7 , 269,6 , 372,22 , 55,4 , 59,9 , 1850,28 , 1878,60 , 1938,21 , 1850,28 , 1878,60 , 1938,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 530,6 , 550,6 , 2, 1, 1, 6, 7 }, // Catalan/Latin/France
+ { 24, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 158,7 , 158,7 , 269,6 , 372,22 , 55,4 , 59,9 , 1850,28 , 1878,60 , 1938,21 , 1850,28 , 1878,60 , 1938,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 530,6 , 556,6 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Italy
+ { 25, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 165,5 , 165,5 , 170,5 , 170,5 , 394,8 , 402,13 , 175,6 , 181,11 , 1959,21 , 1980,28 , 2008,14 , 1959,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 293,2 , 295,21 , 22,23 , {67,78,89}, 133,1 , 3122,13 , 4,4 , 4,0 , 562,4 , 566,2 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/China
+ { 25, 5, 97, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 165,5 , 165,5 , 170,5 , 170,5 , 269,6 , 402,13 , 175,6 , 181,11 , 1959,21 , 1980,28 , 2008,14 , 1959,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 293,2 , 295,21 , 22,23 , {72,75,68}, 134,3 , 3135,11 , 4,4 , 4,0 , 562,4 , 568,9 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/Hong Kong
+ { 25, 5, 126, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 165,5 , 165,5 , 170,5 , 170,5 , 269,6 , 402,13 , 175,6 , 181,11 , 1959,21 , 1980,28 , 2008,14 , 1959,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 293,2 , 295,21 , 22,23 , {77,79,80}, 137,4 , 3146,13 , 4,4 , 4,0 , 562,4 , 577,9 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/Macau
+ { 25, 5, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 165,5 , 165,5 , 170,5 , 170,5 , 27,8 , 402,13 , 175,6 , 181,11 , 1959,21 , 1980,28 , 2008,14 , 1959,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 293,2 , 295,21 , 22,23 , {83,71,68}, 6,1 , 3159,15 , 4,4 , 4,0 , 562,4 , 586,3 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/Singapore
+ { 25, 6, 97, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 165,5 , 165,5 , 175,5 , 175,5 , 415,8 , 402,13 , 175,6 , 192,13 , 2022,21 , 1980,28 , 2008,14 , 2022,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 316,3 , 5,17 , 22,23 , {72,75,68}, 134,3 , 3135,11 , 18,5 , 4,0 , 589,4 , 593,9 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/Hong Kong
+ { 25, 6, 126, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 165,5 , 165,5 , 175,5 , 175,5 , 415,8 , 402,13 , 175,6 , 192,13 , 2022,21 , 1980,28 , 2008,14 , 2022,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 316,3 , 5,17 , 22,23 , {77,79,80}, 137,4 , 3174,13 , 18,5 , 4,0 , 589,4 , 602,9 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/Macau
+ { 25, 6, 208, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 165,5 , 165,5 , 170,5 , 170,5 , 394,8 , 423,14 , 175,6 , 192,13 , 2022,21 , 1980,28 , 2008,14 , 2022,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {84,87,68}, 6,1 , 3187,13 , 4,4 , 4,0 , 589,4 , 611,2 , 2, 0, 7, 6, 7 }, // Chinese/Traditional Han/Taiwan
+ { 26, 7, 74, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Corsican/Latin/France
+ { 27, 7, 54, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 158,7 , 158,7 , 437,13 , 450,19 , 37,5 , 87,12 , 2043,28 , 2071,58 , 2129,14 , 2043,28 , 2071,58 , 2143,14 , 0,2 , 0,2 , 319,7 , 5,17 , 22,23 , {72,82,75}, 141,3 , 3200,60 , 13,5 , 4,0 , 613,8 , 621,8 , 2, 1, 1, 6, 7 }, // Croatian/Latin/Croatia
+ { 27, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 158,7 , 158,7 , 469,9 , 450,19 , 37,5 , 87,12 , 2043,28 , 2071,58 , 2143,14 , 2043,28 , 2071,58 , 2143,14 , 0,2 , 0,2 , 319,7 , 5,17 , 22,23 , {66,65,77}, 144,2 , 3260,85 , 13,5 , 4,0 , 613,8 , 629,19 , 2, 1, 1, 6, 7 }, // Croatian/Latin/Bosnia And Herzegowina
+ { 28, 7, 57, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 180,7 , 180,7 , 156,8 , 478,17 , 55,4 , 59,9 , 2157,21 , 2178,49 , 2227,14 , 2157,21 , 2178,49 , 2227,14 , 60,4 , 57,4 , 326,5 , 5,17 , 22,23 , {67,90,75}, 146,2 , 3345,68 , 13,5 , 4,0 , 648,7 , 655,5 , 2, 0, 1, 6, 7 }, // Czech/Latin/Czech Republic
+ { 29, 7, 58, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 495,10 , 505,23 , 205,5 , 210,10 , 2241,28 , 2269,51 , 2320,14 , 2334,35 , 2269,51 , 2320,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {68,75,75}, 148,3 , 3413,42 , 13,5 , 4,0 , 660,5 , 665,7 , 2, 0, 1, 6, 7 }, // Danish/Latin/Denmark
+ { 29, 7, 86, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 495,10 , 505,23 , 205,5 , 210,10 , 2241,28 , 2269,51 , 2320,14 , 2334,35 , 2269,51 , 2320,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {68,75,75}, 148,3 , 3413,42 , 13,5 , 4,0 , 660,5 , 672,8 , 2, 0, 1, 6, 7 }, // Danish/Latin/Greenland
+ { 30, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3455,19 , 13,5 , 4,0 , 680,10 , 690,9 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Netherlands
+ { 30, 7, 12, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,87,71}, 151,4 , 3474,55 , 13,5 , 4,0 , 680,10 , 699,5 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Aruba
+ { 30, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 538,9 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3455,19 , 13,5 , 4,0 , 680,10 , 704,6 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Belgium
+ { 30, 7, 152, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,78,71}, 155,4 , 3529,97 , 13,5 , 4,0 , 680,10 , 710,7 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Cura Sao
+ { 30, 7, 202, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {83,82,68}, 6,1 , 3626,58 , 13,5 , 4,0 , 680,10 , 717,8 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Suriname
+ { 30, 7, 255, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3684,61 , 13,5 , 4,0 , 680,10 , 725,19 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Bonaire
+ { 30, 7, 256, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 2369,21 , 2390,59 , 2449,14 , 2369,21 , 2390,59 , 2449,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,78,71}, 155,4 , 3529,97 , 13,5 , 4,0 , 680,10 , 744,12 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Sint Maarten
+ { 31, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 756,16 , 772,13 , 2, 1, 7, 6, 7 }, // English/Latin/United States
+ { 31, 3, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 159,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // English/Deseret/United States
+ { 31, 7, 4, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 792,14 , 2, 1, 7, 6, 7 }, // English/Latin/American Samoa
+ { 31, 7, 7, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 806,8 , 2, 1, 1, 6, 7 }, // English/Latin/Anguilla
+ { 31, 7, 9, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 814,17 , 2, 1, 7, 6, 7 }, // English/Latin/Antigua And Barbuda
+ { 31, 7, 13, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 269,6 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 2463,25 , 0,28 , 28,57 , 2463,25 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 831,18 , 849,9 , 2, 1, 7, 6, 7 }, // English/Latin/Australia
+ { 31, 7, 14, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 8,5 , 4,0 , 785,7 , 858,7 , 2, 1, 1, 6, 7 }, // English/Latin/Austria
+ { 31, 7, 16, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,83,68}, 6,1 , 3930,53 , 4,4 , 4,0 , 785,7 , 865,7 , 2, 1, 7, 6, 7 }, // English/Latin/Bahamas
+ { 31, 7, 19, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,66,68}, 6,1 , 3983,56 , 4,4 , 4,0 , 785,7 , 872,8 , 2, 1, 1, 6, 7 }, // English/Latin/Barbados
+ { 31, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 27,8 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 785,7 , 880,7 , 2, 1, 1, 6, 7 }, // English/Latin/Belgium
+ { 31, 7, 22, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 27,8 , 553,18 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,90,68}, 6,1 , 4039,47 , 4,4 , 4,0 , 785,7 , 887,6 , 2, 1, 7, 6, 7 }, // English/Latin/Belize
+ { 31, 7, 24, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,77,68}, 6,1 , 4086,53 , 4,4 , 4,0 , 785,7 , 893,7 , 2, 1, 1, 6, 7 }, // English/Latin/Bermuda
+ { 31, 7, 28, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 27,8 , 553,18 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,87,80}, 162,1 , 4139,50 , 4,4 , 4,0 , 785,7 , 900,8 , 2, 1, 7, 6, 7 }, // English/Latin/Botswana
+ { 31, 7, 31, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 908,30 , 2, 1, 1, 6, 7 }, // English/Latin/British Indian Ocean Territory
+ { 31, 7, 35, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {66,73,70}, 163,3 , 4189,53 , 4,4 , 4,0 , 785,7 , 938,7 , 0, 0, 1, 6, 7 }, // English/Latin/Burundi
+ { 31, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 4242,83 , 4,4 , 4,0 , 785,7 , 945,8 , 0, 0, 1, 6, 7 }, // English/Latin/Cameroon
+ { 31, 7, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 53,10 , 35,18 , 18,7 , 25,12 , 2488,35 , 28,57 , 85,14 , 2488,35 , 28,57 , 85,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {67,65,68}, 6,1 , 4325,53 , 4,4 , 4,0 , 953,16 , 969,6 , 2, 0, 7, 6, 7 }, // English/Latin/Canada
+ { 31, 7, 40, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {75,89,68}, 6,1 , 4378,71 , 4,4 , 4,0 , 785,7 , 975,14 , 2, 1, 1, 6, 7 }, // English/Latin/Cayman Islands
+ { 31, 7, 45, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 785,7 , 989,16 , 2, 1, 1, 6, 7 }, // English/Latin/Christmas Island
+ { 31, 7, 46, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 785,7 , 1005,23 , 2, 1, 1, 6, 7 }, // English/Latin/Cocos Islands
+ { 31, 7, 51, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 785,7 , 1028,12 , 2, 1, 1, 6, 7 }, // English/Latin/Cook Islands
+ { 31, 7, 56, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 4,4 , 4,0 , 785,7 , 1040,6 , 2, 1, 1, 6, 7 }, // English/Latin/Cyprus
+ { 31, 7, 58, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 205,5 , 210,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {68,75,75}, 148,3 , 4511,44 , 13,5 , 4,0 , 785,7 , 1046,7 , 2, 0, 1, 6, 7 }, // English/Latin/Denmark
+ { 31, 7, 60, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 1053,8 , 2, 1, 7, 6, 7 }, // English/Latin/Dominica
+ { 31, 7, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,82,78}, 41,3 , 4555,50 , 4,4 , 4,0 , 785,7 , 1061,7 , 2, 1, 1, 6, 7 }, // English/Latin/Eritrea
+ { 31, 7, 70, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {70,75,80}, 119,1 , 4605,74 , 4,4 , 4,0 , 785,7 , 1068,16 , 2, 1, 1, 6, 7 }, // English/Latin/Falkland Islands
+ { 31, 7, 72, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {70,74,68}, 6,1 , 4679,47 , 4,4 , 4,0 , 785,7 , 1084,4 , 2, 1, 1, 6, 7 }, // English/Latin/Fiji
+ { 31, 7, 73, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 220,4 , 224,9 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 785,7 , 1088,7 , 2, 1, 1, 6, 7 }, // English/Latin/Finland
+ { 31, 7, 75, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 4726,32 , 4,4 , 4,0 , 785,7 , 1095,8 , 2, 1, 1, 6, 7 }, // English/Latin/Guernsey
+ { 31, 7, 80, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,77,68}, 166,1 , 4758,50 , 4,4 , 4,0 , 785,7 , 1103,6 , 2, 1, 1, 6, 7 }, // English/Latin/Gambia
+ { 31, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 785,7 , 1109,7 , 2, 1, 1, 6, 7 }, // English/Latin/Germany
+ { 31, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,72,83}, 167,3 , 4808,47 , 4,4 , 4,0 , 785,7 , 1116,5 , 2, 1, 1, 6, 7 }, // English/Latin/Ghana
+ { 31, 7, 84, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,73,80}, 119,1 , 4855,53 , 4,4 , 4,0 , 785,7 , 1121,9 , 2, 1, 1, 6, 7 }, // English/Latin/Gibraltar
+ { 31, 7, 87, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 1130,7 , 2, 1, 1, 6, 7 }, // English/Latin/Grenada
+ { 31, 7, 89, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 1137,4 , 2, 1, 7, 6, 7 }, // English/Latin/Guam
+ { 31, 7, 93, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,89,68}, 6,1 , 4908,56 , 4,4 , 4,0 , 785,7 , 1141,6 , 2, 0, 1, 6, 7 }, // English/Latin/Guyana
+ { 31, 7, 97, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 415,8 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {72,75,68}, 134,3 , 4964,56 , 4,4 , 4,0 , 785,7 , 1147,19 , 2, 1, 7, 6, 7 }, // English/Latin/Hong Kong
+ { 31, 7, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 27,8 , 192,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {73,78,82}, 121,1 , 5020,44 , 4,4 , 4,0 , 785,7 , 1166,5 , 2, 1, 7, 7, 7 }, // English/Latin/India
+ { 31, 7, 104, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 97,16 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 4,4 , 4,0 , 785,7 , 1171,7 , 2, 1, 1, 6, 7 }, // English/Latin/Ireland
+ { 31, 7, 105, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 55,4 , 59,9 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {73,76,83}, 49,1 , 5064,62 , 4,4 , 4,0 , 785,7 , 1178,6 , 2, 1, 7, 5, 6 }, // English/Latin/Israel
+ { 31, 7, 107, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 269,6 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {74,77,68}, 6,1 , 5126,53 , 4,4 , 4,0 , 785,7 , 1184,7 , 2, 1, 7, 6, 7 }, // English/Latin/Jamaica
+ { 31, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {75,69,83}, 2,3 , 5179,53 , 4,4 , 4,0 , 785,7 , 1191,5 , 2, 1, 7, 6, 7 }, // English/Latin/Kenya
+ { 31, 7, 112, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 785,7 , 1196,8 , 2, 1, 1, 6, 7 }, // English/Latin/Kiribati
+ { 31, 7, 120, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 5232,61 , 4,4 , 4,0 , 785,7 , 1204,7 , 2, 1, 1, 6, 7 }, // English/Latin/Lesotho
+ { 31, 7, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {76,82,68}, 6,1 , 5293,53 , 4,4 , 4,0 , 785,7 , 1211,7 , 2, 1, 1, 6, 7 }, // English/Latin/Liberia
+ { 31, 7, 126, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,79,80}, 137,4 , 5346,53 , 4,4 , 4,0 , 785,7 , 1218,15 , 2, 1, 7, 6, 7 }, // English/Latin/Macau
+ { 31, 7, 128, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,71,65}, 170,2 , 5399,54 , 4,4 , 4,0 , 785,7 , 1233,10 , 0, 0, 1, 6, 7 }, // English/Latin/Madagascar
+ { 31, 7, 129, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,87,75}, 172,2 , 5453,53 , 4,4 , 4,0 , 785,7 , 1243,6 , 2, 1, 1, 6, 7 }, // English/Latin/Malawi
+ { 31, 7, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,89,82}, 174,2 , 5506,59 , 4,4 , 4,0 , 785,7 , 1249,8 , 2, 1, 1, 6, 7 }, // English/Latin/Malaysia
+ { 31, 7, 133, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 4,4 , 4,0 , 785,7 , 1257,5 , 2, 1, 7, 6, 7 }, // English/Latin/Malta
+ { 31, 7, 134, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 1262,16 , 2, 1, 7, 6, 7 }, // English/Latin/Marshall Islands
+ { 31, 7, 137, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,85,82}, 176,2 , 5565,53 , 4,4 , 4,0 , 785,7 , 1278,9 , 2, 0, 1, 6, 7 }, // English/Latin/Mauritius
+ { 31, 7, 140, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 1287,10 , 2, 1, 1, 6, 7 }, // English/Latin/Micronesia
+ { 31, 7, 144, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 1297,10 , 2, 1, 1, 6, 7 }, // English/Latin/Montserrat
+ { 31, 7, 148, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,65,68}, 6,1 , 5618,53 , 4,4 , 4,0 , 785,7 , 1307,7 , 2, 1, 1, 6, 7 }, // English/Latin/Namibia
+ { 31, 7, 149, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 785,7 , 1314,5 , 2, 1, 1, 6, 7 }, // English/Latin/Nauru
+ { 31, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 8,5 , 23,6 , 785,7 , 1319,11 , 2, 1, 1, 6, 7 }, // English/Latin/Netherlands
+ { 31, 7, 154, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 571,7 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 785,7 , 1330,11 , 2, 1, 1, 6, 7 }, // English/Latin/New Zealand
+ { 31, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,71,78}, 178,1 , 5671,50 , 4,4 , 4,0 , 785,7 , 1341,7 , 2, 1, 1, 6, 7 }, // English/Latin/Nigeria
+ { 31, 7, 158, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 785,7 , 1348,4 , 2, 1, 1, 6, 7 }, // English/Latin/Niue
+ { 31, 7, 159, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 785,7 , 1352,14 , 2, 1, 1, 6, 7 }, // English/Latin/Norfolk Island
+ { 31, 7, 160, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 1366,24 , 2, 1, 1, 6, 7 }, // English/Latin/Northern Mariana Islands
+ { 31, 7, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {80,75,82}, 176,2 , 5721,53 , 4,4 , 4,0 , 785,7 , 1390,8 , 2, 0, 7, 6, 7 }, // English/Latin/Pakistan
+ { 31, 7, 164, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 1398,5 , 2, 1, 1, 6, 7 }, // English/Latin/Palau
+ { 31, 7, 167, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {80,71,75}, 131,1 , 5774,73 , 4,4 , 4,0 , 785,7 , 1403,16 , 2, 1, 1, 6, 7 }, // English/Latin/Papua New Guinea
+ { 31, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {80,72,80}, 179,1 , 5847,53 , 4,4 , 4,0 , 785,7 , 1419,11 , 2, 1, 7, 6, 7 }, // English/Latin/Philippines
+ { 31, 7, 171, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 785,7 , 1430,16 , 2, 1, 1, 6, 7 }, // English/Latin/Pitcairn
+ { 31, 7, 174, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 1446,11 , 2, 1, 7, 6, 7 }, // English/Latin/Puerto Rico
+ { 31, 7, 179, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {82,87,70}, 180,2 , 5900,47 , 4,4 , 4,0 , 785,7 , 1457,6 , 0, 0, 1, 6, 7 }, // English/Latin/Rwanda
+ { 31, 7, 180, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 1463,16 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Kitts And Nevis
+ { 31, 7, 181, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 1479,8 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Lucia
+ { 31, 7, 182, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 785,7 , 1487,23 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Vincent And The Grenadines
+ { 31, 7, 183, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {87,83,84}, 182,3 , 5947,40 , 4,4 , 4,0 , 785,7 , 1510,5 , 2, 1, 7, 6, 7 }, // English/Latin/Samoa
+ { 31, 7, 188, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,67,82}, 185,2 , 5987,59 , 4,4 , 4,0 , 785,7 , 1515,10 , 2, 1, 1, 6, 7 }, // English/Latin/Seychelles
+ { 31, 7, 189, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,76,76}, 187,2 , 6046,68 , 4,4 , 4,0 , 785,7 , 1525,12 , 0, 0, 1, 6, 7 }, // English/Latin/Sierra Leone
+ { 31, 7, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 269,6 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,71,68}, 6,1 , 6114,56 , 4,4 , 4,0 , 785,7 , 1537,9 , 2, 1, 7, 6, 7 }, // English/Latin/Singapore
+ { 31, 7, 192, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 29,7 , 785,7 , 1546,8 , 2, 1, 1, 6, 7 }, // English/Latin/Slovenia
+ { 31, 7, 193, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,66,68}, 6,1 , 6170,74 , 4,4 , 4,0 , 785,7 , 1554,15 , 2, 1, 1, 6, 7 }, // English/Latin/Solomon Islands
+ { 31, 7, 195, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 578,10 , 553,18 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 5232,61 , 4,4 , 4,0 , 785,7 , 1569,12 , 2, 1, 7, 6, 7 }, // English/Latin/South Africa
+ { 31, 7, 199, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,72,80}, 119,1 , 6244,53 , 4,4 , 4,0 , 785,7 , 1581,9 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Helena
+ { 31, 7, 201, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,68,71}, 0,0 , 6297,50 , 4,4 , 4,0 , 785,7 , 1590,5 , 2, 1, 6, 5, 6 }, // English/Latin/Sudan
+ { 31, 7, 204, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,90,76}, 189,1 , 6347,53 , 4,4 , 4,0 , 785,7 , 1595,8 , 2, 1, 1, 6, 7 }, // English/Latin/Swaziland
+ { 31, 7, 205, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 53,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,69,75}, 190,2 , 6400,47 , 13,5 , 4,0 , 785,7 , 1603,6 , 2, 0, 1, 6, 7 }, // English/Latin/Sweden
+ { 31, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {67,72,70}, 0,0 , 6447,41 , 8,5 , 36,5 , 785,7 , 1609,11 , 2, 0, 1, 6, 7 }, // English/Latin/Switzerland
+ { 31, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {84,90,83}, 192,3 , 6488,62 , 4,4 , 4,0 , 785,7 , 1620,8 , 2, 0, 1, 6, 7 }, // English/Latin/Tanzania
+ { 31, 7, 213, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 785,7 , 1628,7 , 2, 1, 1, 6, 7 }, // English/Latin/Tokelau
+ { 31, 7, 214, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {84,79,80}, 195,2 , 6550,49 , 4,4 , 4,0 , 785,7 , 1635,5 , 2, 1, 1, 6, 7 }, // English/Latin/Tonga
+ { 31, 7, 215, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {84,84,68}, 6,1 , 6599,80 , 4,4 , 4,0 , 785,7 , 1640,17 , 2, 1, 7, 6, 7 }, // English/Latin/Trinidad And Tobago
+ { 31, 7, 219, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 1657,22 , 2, 1, 1, 6, 7 }, // English/Latin/Turks And Caicos Islands
+ { 31, 7, 220, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 785,7 , 1679,6 , 2, 1, 1, 6, 7 }, // English/Latin/Tuvalu
+ { 31, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,71,88}, 197,3 , 6679,56 , 4,4 , 4,0 , 785,7 , 1685,6 , 0, 0, 1, 7, 7 }, // English/Latin/Uganda
+ { 31, 7, 223, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,69,68}, 200,3 , 6735,55 , 4,4 , 4,0 , 785,7 , 1691,20 , 2, 1, 6, 5, 6 }, // English/Latin/United Arab Emirates
+ { 31, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 6790,47 , 4,4 , 4,0 , 1711,15 , 1726,14 , 2, 1, 1, 6, 7 }, // English/Latin/United Kingdom
+ { 31, 7, 226, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 1740,21 , 2, 1, 7, 6, 7 }, // English/Latin/United States Minor Outlying Islands
+ { 31, 7, 229, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {86,85,86}, 203,2 , 6837,44 , 4,4 , 4,0 , 785,7 , 1761,7 , 0, 0, 1, 6, 7 }, // English/Latin/Vanuatu
+ { 31, 7, 233, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 1768,22 , 2, 1, 1, 6, 7 }, // English/Latin/British Virgin Islands
+ { 31, 7, 234, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 195,10 , 205,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 785,7 , 1790,19 , 2, 1, 7, 6, 7 }, // English/Latin/United States Virgin Islands
+ { 31, 7, 239, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {90,77,87}, 131,1 , 6881,50 , 4,4 , 4,0 , 785,7 , 1809,6 , 2, 1, 1, 6, 7 }, // English/Latin/Zambia
+ { 31, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 415,8 , 553,18 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 1815,8 , 2, 1, 7, 6, 7 }, // English/Latin/Zimbabwe
+ { 31, 7, 249, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 3745,35 , 4,4 , 4,0 , 785,7 , 1823,12 , 2, 1, 1, 6, 7 }, // English/Latin/Diego Garcia
+ { 31, 7, 251, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 4726,32 , 4,4 , 4,0 , 785,7 , 1835,11 , 2, 1, 1, 6, 7 }, // English/Latin/Isle Of Man
+ { 31, 7, 252, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 4726,32 , 4,4 , 4,0 , 785,7 , 1846,6 , 2, 1, 1, 6, 7 }, // English/Latin/Jersey
+ { 31, 7, 254, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,83,80}, 119,1 , 6931,68 , 4,4 , 4,0 , 785,7 , 1852,11 , 2, 1, 1, 6, 7 }, // English/Latin/South Sudan
+ { 31, 7, 256, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,78,71}, 155,4 , 6999,95 , 4,4 , 4,0 , 785,7 , 1863,12 , 2, 1, 1, 6, 7 }, // English/Latin/Sint Maarten
+ { 31, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 4,4 , 4,0 , 785,7 , 1875,5 , 2, 1, 1, 6, 7 }, // English/Latin/World
+ { 31, 7, 261, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 205,9 , 205,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 13,5 , 4,0 , 785,7 , 1880,6 , 2, 1, 1, 6, 7 }, // English/Latin/Europe
+ { 32, 7, 260, 44, 160, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 214,9 , 214,9 , 588,8 , 596,26 , 37,5 , 233,25 , 2523,21 , 2544,51 , 2595,14 , 2523,21 , 2544,51 , 2595,14 , 70,3 , 67,3 , 331,6 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 41,6 , 4,0 , 1886,9 , 1895,5 , 2, 1, 1, 6, 7 }, // Esperanto/Latin/World
+ { 33, 7, 68, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 223,8 , 223,8 , 156,8 , 622,18 , 37,5 , 8,10 , 2609,14 , 2623,63 , 2609,14 , 2609,14 , 2623,63 , 2609,14 , 0,2 , 0,2 , 337,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 7094,20 , 13,5 , 4,0 , 1900,5 , 1905,5 , 2, 1, 1, 6, 7 }, // Estonian/Latin/Estonia
+ { 34, 7, 71, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 156,8 , 622,18 , 37,5 , 8,10 , 2686,28 , 2714,74 , 2788,14 , 2802,35 , 2714,74 , 2788,14 , 0,2 , 0,2 , 343,3 , 5,17 , 22,23 , {68,75,75}, 190,2 , 7114,43 , 13,5 , 4,0 , 1910,8 , 1918,7 , 2, 0, 1, 6, 7 }, // Faroese/Latin/Faroe Islands
+ { 34, 7, 58, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 156,8 , 622,18 , 37,5 , 8,10 , 2686,28 , 2714,74 , 2788,14 , 2802,35 , 2714,74 , 2788,14 , 0,2 , 0,2 , 343,3 , 5,17 , 22,23 , {68,75,75}, 148,3 , 7114,43 , 13,5 , 4,0 , 1910,8 , 665,7 , 2, 0, 1, 6, 7 }, // Faroese/Latin/Denmark
+ { 36, 7, 73, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 223,8 , 223,8 , 640,8 , 478,17 , 220,4 , 224,9 , 2837,21 , 2858,67 , 2925,14 , 2837,21 , 2939,81 , 2925,14 , 73,3 , 70,3 , 346,5 , 351,17 , 368,23 , {69,85,82}, 14,1 , 7157,20 , 13,5 , 4,0 , 1925,5 , 1930,5 , 2, 1, 1, 6, 7 }, // Finnish/Latin/Finland
+ { 37, 7, 74, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 1943,6 , 2, 1, 1, 6, 7 }, // French/Latin/France
+ { 37, 7, 3, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {68,90,68}, 205,2 , 7177,51 , 13,5 , 4,0 , 1935,8 , 1949,7 , 2, 1, 6, 5, 6 }, // French/Latin/Algeria
+ { 37, 7, 21, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 571,7 , 97,16 , 37,5 , 258,23 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 1956,8 , 2, 1, 1, 6, 7 }, // French/Latin/Belgium
+ { 37, 7, 23, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 1964,5 , 0, 0, 1, 6, 7 }, // French/Latin/Benin
+ { 37, 7, 34, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 1969,12 , 0, 0, 1, 6, 7 }, // French/Latin/Burkina Faso
+ { 37, 7, 35, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {66,73,70}, 163,3 , 7287,53 , 13,5 , 4,0 , 1935,8 , 938,7 , 0, 0, 1, 6, 7 }, // French/Latin/Burundi
+ { 37, 7, 37, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 76,5 , 73,4 , 391,6 , 217,17 , 234,23 , {88,65,70}, 32,4 , 7340,56 , 13,5 , 4,0 , 1935,8 , 1981,8 , 0, 0, 1, 6, 7 }, // French/Latin/Cameroon
+ { 37, 7, 38, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8221, 8220, 0,6 , 0,6 , 231,8 , 231,8 , 53,10 , 97,16 , 281,9 , 290,24 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 64,4 , 61,4 , 391,6 , 217,17 , 234,23 , {67,65,68}, 6,1 , 7396,54 , 47,6 , 4,0 , 1989,17 , 969,6 , 2, 0, 7, 6, 7 }, // French/Latin/Canada
+ { 37, 7, 41, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,65,70}, 32,4 , 7340,56 , 13,5 , 4,0 , 1935,8 , 2006,25 , 0, 0, 1, 6, 7 }, // French/Latin/Central African Republic
+ { 37, 7, 42, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,65,70}, 32,4 , 7340,56 , 13,5 , 4,0 , 1935,8 , 2031,5 , 0, 0, 1, 6, 7 }, // French/Latin/Chad
+ { 37, 7, 48, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {75,77,70}, 36,2 , 7450,51 , 13,5 , 4,0 , 1935,8 , 2036,7 , 0, 0, 1, 6, 7 }, // French/Latin/Comoros
+ { 37, 7, 49, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {67,68,70}, 210,2 , 7501,53 , 13,5 , 4,0 , 1935,8 , 2043,14 , 2, 1, 1, 6, 7 }, // French/Latin/Congo Kinshasa
+ { 37, 7, 50, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,65,70}, 32,4 , 7340,56 , 13,5 , 4,0 , 1935,8 , 2057,17 , 0, 0, 1, 6, 7 }, // French/Latin/Congo Brazzaville
+ { 37, 7, 53, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 2074,13 , 0, 0, 1, 6, 7 }, // French/Latin/Ivory Coast
+ { 37, 7, 59, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {68,74,70}, 38,3 , 7554,57 , 13,5 , 4,0 , 1935,8 , 2087,8 , 0, 0, 6, 6, 7 }, // French/Latin/Djibouti
+ { 37, 7, 66, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,65,70}, 32,4 , 7340,56 , 13,5 , 4,0 , 1935,8 , 2095,18 , 0, 0, 1, 6, 7 }, // French/Latin/Equatorial Guinea
+ { 37, 7, 76, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2113,16 , 2, 1, 1, 6, 7 }, // French/Latin/French Guiana
+ { 37, 7, 77, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,80,70}, 212,4 , 7611,35 , 13,5 , 4,0 , 1935,8 , 2129,19 , 0, 0, 1, 6, 7 }, // French/Latin/French Polynesia
+ { 37, 7, 79, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,65,70}, 32,4 , 7340,56 , 13,5 , 4,0 , 1935,8 , 2148,5 , 0, 0, 1, 6, 7 }, // French/Latin/Gabon
+ { 37, 7, 88, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2153,10 , 2, 1, 1, 6, 7 }, // French/Latin/Guadeloupe
+ { 37, 7, 91, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {71,78,70}, 216,2 , 7646,48 , 13,5 , 4,0 , 1935,8 , 2163,6 , 0, 0, 1, 6, 7 }, // French/Latin/Guinea
+ { 37, 7, 94, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {72,84,71}, 218,1 , 7694,57 , 13,5 , 4,0 , 1935,8 , 2169,5 , 2, 1, 1, 6, 7 }, // French/Latin/Haiti
+ { 37, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2174,10 , 2, 1, 1, 6, 7 }, // French/Latin/Luxembourg
+ { 37, 7, 128, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {77,71,65}, 170,2 , 7751,54 , 13,5 , 4,0 , 1935,8 , 1233,10 , 0, 0, 1, 6, 7 }, // French/Latin/Madagascar
+ { 37, 7, 132, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 2184,4 , 0, 0, 1, 6, 7 }, // French/Latin/Mali
+ { 37, 7, 135, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2188,10 , 2, 1, 1, 6, 7 }, // French/Latin/Martinique
+ { 37, 7, 136, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {77,82,85}, 219,2 , 7805,66 , 13,5 , 4,0 , 1935,8 , 2198,10 , 2, 1, 1, 6, 7 }, // French/Latin/Mauritania
+ { 37, 7, 137, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {77,85,82}, 176,2 , 7871,63 , 13,5 , 4,0 , 1935,8 , 2208,7 , 2, 0, 1, 6, 7 }, // French/Latin/Mauritius
+ { 37, 7, 138, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2215,7 , 2, 1, 1, 6, 7 }, // French/Latin/Mayotte
+ { 37, 7, 142, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2222,6 , 2, 1, 1, 6, 7 }, // French/Latin/Monaco
+ { 37, 7, 145, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 64,4 , 61,4 , 391,6 , 217,17 , 234,23 , {77,65,68}, 221,3 , 7934,54 , 13,5 , 4,0 , 1935,8 , 2228,5 , 2, 1, 1, 6, 7 }, // French/Latin/Morocco
+ { 37, 7, 153, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,80,70}, 212,4 , 7611,35 , 13,5 , 4,0 , 1935,8 , 2233,18 , 0, 0, 1, 6, 7 }, // French/Latin/New Caledonia
+ { 37, 7, 156, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 2251,5 , 0, 0, 1, 6, 7 }, // French/Latin/Niger
+ { 37, 7, 176, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2256,10 , 2, 1, 1, 6, 7 }, // French/Latin/Reunion
+ { 37, 7, 179, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {82,87,70}, 180,2 , 7988,50 , 13,5 , 4,0 , 1935,8 , 1457,6 , 0, 0, 1, 6, 7 }, // French/Latin/Rwanda
+ { 37, 7, 187, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 2266,7 , 0, 0, 1, 6, 7 }, // French/Latin/Senegal
+ { 37, 7, 188, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {83,67,82}, 185,2 , 8038,71 , 13,5 , 4,0 , 1935,8 , 1515,10 , 2, 1, 1, 6, 7 }, // French/Latin/Seychelles
+ { 37, 7, 200, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2273,24 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Pierre And Miquelon
+ { 37, 7, 206, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 231,8 , 231,8 , 156,8 , 10,17 , 37,5 , 314,14 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {67,72,70}, 224,3 , 8109,45 , 13,5 , 4,0 , 2297,15 , 2312,6 , 2, 0, 1, 6, 7 }, // French/Latin/Switzerland
+ { 37, 7, 207, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {83,89,80}, 227,2 , 8154,51 , 13,5 , 4,0 , 1935,8 , 2318,5 , 0, 0, 6, 5, 6 }, // French/Latin/Syria
+ { 37, 7, 212, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,79,70}, 207,3 , 7228,59 , 13,5 , 4,0 , 1935,8 , 2323,4 , 0, 0, 1, 6, 7 }, // French/Latin/Togo
+ { 37, 7, 216, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {84,78,68}, 229,2 , 8205,51 , 13,5 , 4,0 , 1935,8 , 2327,7 , 3, 0, 1, 6, 7 }, // French/Latin/Tunisia
+ { 37, 7, 229, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 18,7 , 25,12 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {86,85,86}, 203,2 , 8256,51 , 13,5 , 4,0 , 1935,8 , 1761,7 , 0, 0, 1, 6, 7 }, // French/Latin/Vanuatu
+ { 37, 7, 235, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {88,80,70}, 212,4 , 7611,35 , 13,5 , 4,0 , 1935,8 , 2334,16 , 0, 0, 1, 6, 7 }, // French/Latin/Wallis And Futuna Islands
+ { 37, 7, 244, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2350,16 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Barthelemy
+ { 37, 7, 245, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 231,8 , 231,8 , 119,10 , 97,16 , 37,5 , 8,10 , 3020,35 , 3055,52 , 3107,14 , 3020,35 , 3055,52 , 3107,14 , 0,2 , 0,2 , 391,6 , 217,17 , 234,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1935,8 , 2366,12 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Martin
+ { 38, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 6,8 , 6,8 , 339,8 , 97,16 , 37,5 , 8,10 , 3121,21 , 3142,54 , 85,14 , 3121,21 , 3142,54 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3455,19 , 8,5 , 53,6 , 2378,5 , 2383,8 , 2, 1, 1, 6, 7 }, // Western Frisian/Latin/Netherlands
+ { 39, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 239,10 , 239,10 , 119,10 , 648,21 , 37,5 , 8,10 , 3196,28 , 3224,69 , 3293,14 , 3196,28 , 3224,69 , 3293,14 , 81,1 , 77,1 , 397,6 , 5,17 , 22,23 , {71,66,80}, 119,1 , 8307,86 , 4,4 , 4,0 , 2391,8 , 2399,22 , 2, 1, 1, 6, 7 }, // Gaelic/Latin/United Kingdom
+ { 40, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 3307,35 , 3342,49 , 3391,14 , 3405,35 , 3440,49 , 3489,21 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 2421,6 , 2427,6 , 2, 1, 1, 6, 7 }, // Galician/Latin/Spain
+ { 41, 15, 81, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 171, 187, 0,6 , 0,6 , 256,8 , 256,8 , 156,8 , 696,19 , 37,5 , 8,10 , 3510,28 , 3538,62 , 3600,14 , 3510,28 , 3538,62 , 3600,14 , 0,2 , 0,2 , 403,5 , 408,37 , 22,23 , {71,69,76}, 231,1 , 8393,43 , 13,5 , 4,0 , 2433,7 , 2440,10 , 2, 1, 1, 6, 7 }, // Georgian/Georgian/Georgia
+ { 42, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 13,5 , 4,0 , 2450,7 , 2457,11 , 2, 1, 1, 6, 7 }, // German/Latin/Germany
+ { 42, 7, 14, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 8,5 , 4,0 , 2468,24 , 2492,10 , 2, 1, 1, 6, 7 }, // German/Latin/Austria
+ { 42, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 13,5 , 4,0 , 2450,7 , 2502,7 , 2, 1, 1, 6, 7 }, // German/Latin/Belgium
+ { 42, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 13,5 , 4,0 , 2450,7 , 2509,7 , 2, 1, 1, 6, 7 }, // German/Latin/Italy
+ { 42, 7, 123, 46, 8217, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {67,72,70}, 224,3 , 8455,58 , 8,5 , 4,0 , 2450,7 , 2516,13 , 2, 0, 1, 6, 7 }, // German/Latin/Liechtenstein
+ { 42, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 13,5 , 4,0 , 2450,7 , 2529,9 , 2, 1, 1, 6, 7 }, // German/Latin/Luxembourg
+ { 42, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 3614,21 , 3635,60 , 3695,14 , 3709,28 , 3635,60 , 3695,14 , 0,2 , 0,2 , 445,5 , 5,17 , 22,23 , {67,72,70}, 224,3 , 8455,58 , 8,5 , 36,5 , 2538,21 , 2559,7 , 2, 0, 1, 6, 7 }, // German/Latin/Switzerland
+ { 43, 16, 85, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 273,9 , 273,9 , 269,6 , 10,17 , 18,7 , 25,12 , 3737,28 , 3765,55 , 3820,14 , 3737,28 , 3765,55 , 3820,14 , 82,4 , 78,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8513,19 , 13,5 , 4,0 , 2566,8 , 2574,6 , 2, 1, 1, 6, 7 }, // Greek/Greek/Greece
+ { 43, 16, 56, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 273,9 , 273,9 , 269,6 , 10,17 , 18,7 , 25,12 , 3737,28 , 3765,55 , 3820,14 , 3737,28 , 3765,55 , 3820,14 , 82,4 , 78,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8513,19 , 13,5 , 4,0 , 2566,8 , 2580,6 , 2, 1, 1, 6, 7 }, // Greek/Greek/Cyprus
+ { 44, 7, 86, 44, 46, 59, 37, 48, 8722, 43, 101, 187, 171, 8250, 8249, 0,6 , 0,6 , 282,11 , 282,11 , 53,10 , 80,17 , 205,5 , 210,10 , 3834,28 , 3862,98 , 3960,14 , 3834,28 , 3862,98 , 3960,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {68,75,75}, 148,3 , 8532,62 , 4,4 , 59,5 , 2586,11 , 2597,16 , 2, 0, 1, 6, 7 }, // Greenlandic/Latin/Greenland
+ { 45, 7, 168, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,89,71}, 232,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 7, 6, 7 }, // Guarani/Latin/Paraguay
+ { 46, 17, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 293,9 , 293,9 , 269,6 , 192,18 , 328,8 , 336,13 , 3974,32 , 4006,53 , 4059,19 , 3974,32 , 4006,53 , 4059,19 , 0,2 , 0,2 , 450,4 , 454,19 , 22,23 , {73,78,82}, 121,1 , 8594,46 , 4,4 , 4,0 , 2613,7 , 2620,4 , 2, 1, 7, 7, 7 }, // Gujarati/Gujarati/India
+ { 47, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 302,8 , 302,8 , 269,6 , 715,17 , 37,5 , 8,10 , 4078,28 , 4106,52 , 4158,14 , 4078,28 , 4106,52 , 4158,14 , 86,6 , 82,5 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 8640,54 , 64,6 , 4,0 , 2624,5 , 2629,8 , 2, 1, 1, 6, 7 }, // Hausa/Latin/Nigeria
+ { 47, 1, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Hausa/Arabic/Nigeria
+ { 47, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 302,8 , 302,8 , 269,6 , 715,17 , 18,7 , 25,12 , 4078,28 , 4106,52 , 4158,14 , 4078,28 , 4106,52 , 4158,14 , 86,6 , 82,5 , 45,4 , 5,17 , 22,23 , {71,72,83}, 167,3 , 0,7 , 64,6 , 4,0 , 2624,5 , 2637,4 , 2, 1, 1, 6, 7 }, // Hausa/Latin/Ghana
+ { 47, 7, 156, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 302,8 , 302,8 , 269,6 , 715,17 , 37,5 , 8,10 , 4078,28 , 4106,52 , 4158,14 , 4078,28 , 4106,52 , 4158,14 , 86,6 , 82,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 8694,36 , 64,6 , 4,0 , 2624,5 , 2641,5 , 0, 0, 1, 6, 7 }, // Hausa/Latin/Niger
+ { 48, 18, 105, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 310,6 , 310,6 , 640,8 , 732,18 , 55,4 , 59,9 , 4172,46 , 4218,65 , 4283,21 , 4172,46 , 4218,65 , 4283,21 , 92,6 , 87,5 , 473,4 , 5,17 , 22,23 , {73,76,83}, 49,1 , 8730,54 , 70,6 , 76,8 , 2646,5 , 2651,5 , 2, 1, 7, 5, 6 }, // Hebrew/Hebrew/Israel
+ { 49, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 316,9 , 325,8 , 269,6 , 10,17 , 18,7 , 25,12 , 4304,32 , 4336,53 , 4389,19 , 4304,32 , 4336,53 , 4389,19 , 68,2 , 65,2 , 477,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 8784,42 , 4,4 , 4,0 , 2656,6 , 2662,4 , 2, 1, 7, 7, 7 }, // Hindi/Devanagari/India
+ { 50, 7, 98, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 187, 171, 0,6 , 0,6 , 333,8 , 333,8 , 750,13 , 763,19 , 55,4 , 59,9 , 4408,19 , 4427,52 , 4479,17 , 4408,19 , 4427,52 , 4479,17 , 98,3 , 92,3 , 481,4 , 5,17 , 22,23 , {72,85,70}, 233,2 , 8826,46 , 13,5 , 4,0 , 2666,6 , 2672,12 , 2, 0, 1, 6, 7 }, // Hungarian/Latin/Hungary
+ { 51, 7, 99, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 187,8 , 187,8 , 640,8 , 622,18 , 37,5 , 8,10 , 4496,35 , 4531,81 , 4612,14 , 4496,35 , 4531,81 , 4612,14 , 101,4 , 95,4 , 485,4 , 5,17 , 22,23 , {73,83,75}, 235,3 , 8872,49 , 13,5 , 4,0 , 2684,8 , 2692,6 , 0, 0, 1, 6, 7 }, // Icelandic/Latin/Iceland
+ { 52, 7, 101, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 341,10 , 351,9 , 27,8 , 553,18 , 205,5 , 210,10 , 4626,28 , 4654,43 , 4697,14 , 4626,28 , 4654,43 , 4697,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,68,82}, 238,2 , 8921,39 , 4,4 , 4,0 , 2698,9 , 2698,9 , 2, 0, 7, 6, 7 }, // Indonesian/Latin/Indonesia
+ { 53, 7, 260, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 528,10 , 782,26 , 37,5 , 8,10 , 4711,28 , 4739,57 , 4796,14 , 4711,28 , 4739,57 , 4796,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 2707,11 , 2718,5 , 2, 1, 1, 6, 7 }, // Interlingua/Latin/World
+ { 55, 44, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,65,68}, 240,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Inuktitut/Canadian Aboriginal/Canada
+ { 55, 7, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,65,68}, 240,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Inuktitut/Latin/Canada
+ { 57, 7, 104, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 360,11 , 239,10 , 119,10 , 97,16 , 37,5 , 8,10 , 4810,37 , 4847,75 , 4922,14 , 4810,37 , 4847,75 , 4922,14 , 105,4 , 99,4 , 489,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8960,31 , 4,4 , 4,0 , 2723,7 , 2730,4 , 2, 1, 1, 6, 7 }, // Irish/Latin/Ireland
+ { 57, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 360,11 , 239,10 , 119,10 , 97,16 , 37,5 , 8,10 , 4810,37 , 4847,75 , 4922,14 , 4810,37 , 4847,75 , 4922,14 , 105,4 , 99,4 , 489,6 , 5,17 , 22,23 , {71,66,80}, 119,1 , 8991,95 , 4,4 , 4,0 , 2723,7 , 2734,19 , 2, 1, 1, 6, 7 }, // Irish/Latin/United Kingdom
+ { 58, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 97,16 , 37,5 , 8,10 , 4936,28 , 4964,57 , 5021,14 , 4936,28 , 4964,57 , 5021,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9086,19 , 13,5 , 4,0 , 2753,8 , 2761,6 , 2, 1, 1, 6, 7 }, // Italian/Latin/Italy
+ { 58, 7, 184, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 97,16 , 37,5 , 8,10 , 4936,28 , 4964,57 , 5021,14 , 4936,28 , 4964,57 , 5021,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9086,19 , 13,5 , 4,0 , 2753,8 , 2767,10 , 2, 1, 1, 6, 7 }, // Italian/Latin/San Marino
+ { 58, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 249,7 , 249,7 , 156,8 , 10,17 , 37,5 , 8,10 , 4936,28 , 4964,57 , 5021,14 , 4936,28 , 4964,57 , 5021,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 0,0 , 9105,53 , 8,5 , 36,5 , 2753,8 , 2777,8 , 2, 0, 1, 6, 7 }, // Italian/Latin/Switzerland
+ { 58, 7, 230, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 97,16 , 37,5 , 8,10 , 4936,28 , 4964,57 , 5021,14 , 4936,28 , 4964,57 , 5021,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9086,19 , 13,5 , 4,0 , 2753,8 , 2785,18 , 2, 1, 1, 6, 7 }, // Italian/Latin/Vatican City State
+ { 59, 19, 108, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 165,5 , 165,5 , 165,5 , 165,5 , 578,10 , 402,13 , 55,4 , 349,10 , 5035,14 , 5049,28 , 5035,14 , 5035,14 , 5049,28 , 5035,14 , 109,2 , 103,2 , 495,3 , 498,17 , 22,23 , {74,80,89}, 243,1 , 9158,11 , 4,4 , 4,0 , 2803,3 , 2806,2 , 0, 0, 7, 6, 7 }, // Japanese/Japanese/Japan
+ { 60, 7, 101, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 371,10 , 381,9 , 528,10 , 10,17 , 37,5 , 8,10 , 5077,29 , 5106,41 , 5147,14 , 5077,29 , 5106,41 , 5147,14 , 111,4 , 105,5 , 515,4 , 5,17 , 22,23 , {73,68,82}, 238,2 , 8921,39 , 8,5 , 4,0 , 2808,4 , 2812,9 , 2, 0, 7, 6, 7 }, // Javanese/Latin/Indonesia
+ { 61, 21, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 390,12 , 402,11 , 269,6 , 35,18 , 328,8 , 336,13 , 5161,33 , 5194,54 , 5248,20 , 5161,33 , 5194,54 , 5248,20 , 115,9 , 110,7 , 519,8 , 527,35 , 22,23 , {73,78,82}, 121,1 , 9169,49 , 4,4 , 4,0 , 2821,5 , 2826,4 , 2, 1, 7, 7, 7 }, // Kannada/Kannada/India
+ { 62, 1, 100, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 547,6 , 35,18 , 18,7 , 25,12 , 5268,50 , 5318,52 , 5370,14 , 5268,50 , 5318,52 , 5370,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 9218,23 , 8,5 , 4,0 , 2830,5 , 2835,9 , 2, 1, 7, 7, 7 }, // Kashmiri/Arabic/India
+ { 63, 2, 110, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 413,10 , 156,8 , 808,22 , 37,5 , 8,10 , 5384,21 , 5405,56 , 5461,14 , 5384,21 , 5405,56 , 5461,14 , 0,2 , 0,2 , 562,4 , 566,17 , 583,23 , {75,90,84}, 244,1 , 9241,58 , 13,5 , 4,0 , 2844,10 , 2854,9 , 2, 1, 1, 6, 7 }, // Kazakh/Cyrillic/Kazakhstan
+ { 64, 7, 179, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 5475,35 , 5510,84 , 85,14 , 5475,35 , 5510,84 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,87,70}, 180,2 , 0,7 , 8,5 , 4,0 , 2863,11 , 2874,8 , 0, 0, 1, 6, 7 }, // Kinyarwanda/Latin/Rwanda
+ { 65, 2, 116, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 423,10 , 423,10 , 269,6 , 830,23 , 37,5 , 8,10 , 5594,38 , 5632,57 , 5689,14 , 5594,38 , 5632,57 , 5689,14 , 124,5 , 117,14 , 562,4 , 606,18 , 22,23 , {75,71,83}, 245,3 , 9299,52 , 13,5 , 4,0 , 2882,8 , 2890,10 , 2, 1, 1, 6, 7 }, // Kirghiz/Cyrillic/Kyrgyzstan
+ { 66, 22, 114, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 433,7 , 433,7 , 853,9 , 862,16 , 359,7 , 366,13 , 5703,14 , 5717,28 , 5703,14 , 5703,14 , 5717,28 , 5703,14 , 129,2 , 131,2 , 624,3 , 5,17 , 22,23 , {75,82,87}, 248,1 , 9351,19 , 4,4 , 4,0 , 2900,3 , 2903,4 , 0, 0, 7, 6, 7 }, // Korean/Korean/South Korea
+ { 66, 22, 113, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 433,7 , 433,7 , 853,9 , 862,16 , 359,7 , 366,13 , 5703,14 , 5717,28 , 5703,14 , 5703,14 , 5717,28 , 5703,14 , 129,2 , 131,2 , 624,3 , 5,17 , 22,23 , {75,80,87}, 249,3 , 9370,39 , 4,4 , 4,0 , 2900,3 , 2907,11 , 0, 0, 1, 6, 7 }, // Korean/Korean/North Korea
+ { 67, 7, 217, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 440,7 , 440,7 , 53,10 , 63,17 , 37,5 , 8,10 , 5745,20 , 5765,42 , 5807,14 , 5745,20 , 5765,42 , 5807,14 , 131,2 , 133,2 , 45,4 , 5,17 , 22,23 , {84,82,89}, 252,1 , 0,7 , 13,5 , 4,0 , 2918,5 , 2923,7 , 2, 1, 1, 6, 7 }, // Kurdish/Latin/Turkey
+ { 68, 7, 35, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 5821,34 , 5855,89 , 85,14 , 5821,34 , 5855,89 , 85,14 , 133,5 , 135,5 , 45,4 , 5,17 , 22,23 , {66,73,70}, 163,3 , 9409,27 , 0,4 , 4,0 , 2930,8 , 2938,8 , 0, 0, 1, 6, 7 }, // Rundi/Latin/Burundi
+ { 69, 23, 117, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 447,9 , 415,8 , 878,19 , 55,4 , 379,24 , 5944,36 , 5980,57 , 6037,17 , 5944,36 , 5980,57 , 6037,17 , 138,8 , 140,8 , 45,4 , 5,17 , 22,23 , {76,65,75}, 253,1 , 9436,21 , 4,4 , 36,5 , 2946,3 , 2946,3 , 0, 0, 7, 6, 7 }, // Lao/Lao/Laos
+ { 71, 7, 118, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 456,8 , 456,8 , 156,8 , 897,26 , 37,5 , 8,10 , 6054,51 , 6105,72 , 6177,14 , 6191,51 , 6242,72 , 6177,14 , 146,14 , 148,11 , 627,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9457,23 , 13,5 , 4,0 , 2949,8 , 2957,7 , 2, 1, 1, 6, 7 }, // Latvian/Latin/Latvia
+ { 72, 7, 49, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 464,9 , 464,9 , 415,8 , 97,16 , 37,5 , 8,10 , 6314,28 , 6342,100 , 6442,14 , 6314,28 , 6342,100 , 6442,14 , 160,8 , 159,6 , 45,4 , 5,17 , 22,23 , {67,68,70}, 210,2 , 9480,23 , 13,5 , 4,0 , 2964,7 , 2971,30 , 2, 1, 1, 6, 7 }, // Lingala/Latin/Congo Kinshasa
+ { 72, 7, 6, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 464,9 , 464,9 , 415,8 , 97,16 , 37,5 , 8,10 , 6314,28 , 6342,100 , 6442,14 , 6314,28 , 6342,100 , 6442,14 , 160,8 , 159,6 , 45,4 , 5,17 , 22,23 , {65,79,65}, 254,2 , 9503,23 , 13,5 , 4,0 , 2964,7 , 3001,6 , 2, 1, 1, 6, 7 }, // Lingala/Latin/Angola
+ { 72, 7, 41, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 464,9 , 464,9 , 415,8 , 97,16 , 37,5 , 8,10 , 6314,28 , 6342,100 , 6442,14 , 6314,28 , 6342,100 , 6442,14 , 160,8 , 159,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 9526,23 , 13,5 , 4,0 , 2964,7 , 3007,26 , 0, 0, 1, 6, 7 }, // Lingala/Latin/Central African Republic
+ { 72, 7, 50, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 464,9 , 464,9 , 415,8 , 97,16 , 37,5 , 8,10 , 6314,28 , 6342,100 , 6442,14 , 6314,28 , 6342,100 , 6442,14 , 160,8 , 159,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 9526,23 , 13,5 , 4,0 , 2964,7 , 3033,5 , 0, 0, 1, 6, 7 }, // Lingala/Latin/Congo Brazzaville
+ { 73, 7, 124, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 473,8 , 473,8 , 53,10 , 923,27 , 37,5 , 8,10 , 6456,21 , 6477,89 , 6566,14 , 6456,21 , 6477,89 , 6566,14 , 168,9 , 165,6 , 632,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9549,30 , 13,5 , 4,0 , 3038,8 , 3046,7 , 2, 1, 1, 6, 7 }, // Lithuanian/Latin/Lithuania
+ { 74, 2, 127, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 111,7 , 111,7 , 113,6 , 10,17 , 37,5 , 8,10 , 6580,35 , 6615,54 , 1530,14 , 6669,34 , 6615,54 , 1530,14 , 177,10 , 171,8 , 638,5 , 5,17 , 22,23 , {77,75,68}, 256,4 , 9579,56 , 13,5 , 4,0 , 3053,10 , 3063,18 , 2, 1, 1, 6, 7 }, // Macedonian/Cyrillic/Macedonia
+ { 75, 7, 128, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 97,16 , 37,5 , 8,10 , 6703,34 , 6737,60 , 6797,14 , 6703,34 , 6737,60 , 6797,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,71,65}, 170,2 , 9635,13 , 8,5 , 4,0 , 3081,8 , 3089,12 , 0, 0, 1, 6, 7 }, // Malagasy/Latin/Madagascar
+ { 76, 7, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 351,9 , 351,9 , 571,7 , 10,17 , 18,7 , 25,12 , 6811,28 , 6839,43 , 6882,14 , 6811,28 , 6839,43 , 6882,14 , 187,2 , 179,3 , 643,4 , 5,17 , 22,23 , {77,89,82}, 174,2 , 9648,39 , 4,4 , 4,0 , 3101,6 , 1249,8 , 2, 1, 1, 6, 7 }, // Malay/Latin/Malaysia
+ { 76, 1, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,89,82}, 174,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Malay/Arabic/Malaysia
+ { 76, 7, 32, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 351,9 , 351,9 , 571,7 , 950,12 , 18,7 , 25,12 , 6811,28 , 6839,43 , 6882,14 , 6811,28 , 6839,43 , 6882,14 , 187,2 , 179,3 , 643,4 , 5,17 , 22,23 , {66,78,68}, 6,1 , 9687,31 , 8,5 , 4,0 , 3101,6 , 3107,6 , 2, 1, 1, 6, 7 }, // Malay/Latin/Brunei
+ { 76, 7, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 351,9 , 351,9 , 571,7 , 10,17 , 18,7 , 25,12 , 6811,28 , 6839,43 , 6882,14 , 6811,28 , 6839,43 , 6882,14 , 187,2 , 179,3 , 643,4 , 5,17 , 22,23 , {83,71,68}, 6,1 , 9718,37 , 4,4 , 4,0 , 3101,6 , 3113,9 , 2, 1, 7, 6, 7 }, // Malay/Latin/Singapore
+ { 77, 24, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 481,13 , 494,12 , 269,6 , 962,18 , 18,7 , 25,12 , 6896,41 , 6937,77 , 7014,22 , 6896,41 , 7036,76 , 7112,21 , 0,2 , 0,2 , 647,6 , 653,27 , 22,23 , {73,78,82}, 121,1 , 9755,40 , 4,4 , 4,0 , 3122,6 , 3128,6 , 2, 1, 7, 7, 7 }, // Malayalam/Malayalam/India
+ { 78, 7, 133, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 506,8 , 514,7 , 119,10 , 980,23 , 37,5 , 8,10 , 7133,28 , 7161,63 , 7224,21 , 7133,28 , 7161,63 , 7245,20 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9795,27 , 4,4 , 4,0 , 3134,5 , 1257,5 , 2, 1, 7, 6, 7 }, // Maltese/Latin/Malta
+ { 79, 7, 154, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 528,10 , 10,17 , 18,7 , 25,12 , 7265,27 , 7292,47 , 7339,14 , 7265,27 , 7292,47 , 7339,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,90,68}, 6,1 , 9822,37 , 8,5 , 4,0 , 3139,5 , 3144,8 , 2, 1, 1, 6, 7 }, // Maori/Latin/New Zealand
+ { 80, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 521,9 , 521,9 , 269,6 , 192,18 , 18,7 , 25,12 , 7353,32 , 7385,53 , 4389,19 , 7353,32 , 7385,53 , 4389,19 , 189,5 , 182,4 , 477,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 9859,43 , 4,4 , 4,0 , 3152,5 , 2662,4 , 2, 1, 7, 7, 7 }, // Marathi/Devanagari/India
+ { 82, 2, 143, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1003,10 , 1013,35 , 37,5 , 87,12 , 7438,21 , 7459,43 , 7438,21 , 7438,21 , 7502,43 , 7438,21 , 194,4 , 186,4 , 562,4 , 680,17 , 22,23 , {77,78,84}, 260,1 , 9902,46 , 8,5 , 4,0 , 3157,6 , 3163,6 , 2, 0, 1, 6, 7 }, // Mongolian/Cyrillic/Mongolia
+ { 82, 8, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 261,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Mongolian/Mongolian/China
+ { 84, 13, 150, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 530,5 , 0,6 , 535,7 , 535,7 , 227,6 , 63,17 , 37,5 , 8,10 , 7545,33 , 7578,54 , 7632,18 , 7545,33 , 7578,54 , 7632,18 , 198,9 , 190,7 , 477,4 , 697,19 , 22,23 , {78,80,82}, 264,4 , 9948,49 , 8,5 , 4,0 , 3169,6 , 3175,5 , 2, 1, 7, 6, 7 }, // Nepali/Devanagari/Nepal
+ { 84, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 530,5 , 0,6 , 535,7 , 535,7 , 227,6 , 63,17 , 18,7 , 25,12 , 7545,33 , 7578,54 , 7632,18 , 7545,33 , 7578,54 , 7632,18 , 198,9 , 190,7 , 477,4 , 697,19 , 22,23 , {73,78,82}, 121,1 , 9997,49 , 8,5 , 4,0 , 3169,6 , 2662,4 , 2, 1, 7, 7, 7 }, // Nepali/Devanagari/India
+ { 85, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 495,10 , 478,17 , 37,5 , 8,10 , 2334,35 , 2269,51 , 2320,14 , 2334,35 , 2269,51 , 2320,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {78,79,75}, 190,2 , 10046,44 , 8,5 , 4,0 , 3180,12 , 3192,5 , 2, 0, 1, 6, 7 }, // Norwegian Bokmal/Latin/Norway
+ { 85, 7, 203, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 495,10 , 478,17 , 37,5 , 8,10 , 2334,35 , 2269,51 , 2320,14 , 2334,35 , 2269,51 , 2320,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {78,79,75}, 190,2 , 10046,44 , 8,5 , 4,0 , 3180,12 , 3197,21 , 2, 0, 1, 6, 7 }, // Norwegian Bokmal/Latin/Svalbard And Jan Mayen Islands
+ { 86, 7, 74, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Occitan/Latin/France
+ { 87, 26, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 542,8 , 550,7 , 547,6 , 35,18 , 18,7 , 25,12 , 7650,33 , 7683,54 , 7737,18 , 7650,33 , 7683,54 , 7737,18 , 0,2 , 0,2 , 716,5 , 5,17 , 22,23 , {73,78,82}, 121,1 , 10090,43 , 4,4 , 4,0 , 3218,5 , 3223,4 , 2, 1, 7, 7, 7 }, // Oriya/Oriya/India
+ { 88, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 557,6 , 557,6 , 563,9 , 572,8 , 394,8 , 1048,20 , 55,4 , 403,11 , 7755,39 , 7755,39 , 85,14 , 7755,39 , 7755,39 , 85,14 , 207,4 , 197,4 , 721,5 , 5,17 , 22,23 , {65,70,78}, 268,1 , 10133,25 , 13,5 , 4,0 , 3227,4 , 3231,9 , 0, 0, 6, 4, 5 }, // Pashto/Arabic/Afghanistan
+ { 88, 1, 163, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 557,6 , 557,6 , 563,9 , 572,8 , 394,8 , 1048,20 , 18,7 , 25,12 , 7755,39 , 7755,39 , 85,14 , 7755,39 , 7755,39 , 85,14 , 207,4 , 197,4 , 721,5 , 5,17 , 22,23 , {80,75,82}, 176,2 , 10158,52 , 13,5 , 4,0 , 3227,4 , 3240,7 , 2, 0, 7, 6, 7 }, // Pashto/Arabic/Pakistan
+ { 89, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 580,7 , 580,7 , 587,8 , 595,7 , 394,8 , 97,16 , 55,4 , 403,11 , 7794,49 , 7794,49 , 7843,14 , 7794,49 , 7794,49 , 7843,14 , 211,9 , 201,8 , 726,4 , 730,44 , 22,23 , {73,82,82}, 269,4 , 10210,37 , 84,5 , 4,0 , 3247,5 , 3252,5 , 0, 0, 6, 5, 5 }, // Persian/Arabic/Iran
+ { 89, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 580,7 , 580,7 , 587,8 , 595,7 , 394,8 , 97,16 , 55,4 , 403,11 , 7794,49 , 7794,49 , 7843,14 , 7794,49 , 7794,49 , 7843,14 , 211,9 , 201,8 , 726,4 , 730,44 , 22,23 , {65,70,78}, 268,1 , 10247,55 , 8,5 , 4,0 , 3257,3 , 3231,9 , 0, 0, 6, 4, 5 }, // Persian/Arabic/Afghanistan
+ { 90, 7, 172, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 158,7 , 158,7 , 495,10 , 10,17 , 37,5 , 8,10 , 7857,34 , 7891,59 , 7950,14 , 7857,34 , 7891,59 , 7964,14 , 0,2 , 0,2 , 326,5 , 5,17 , 22,23 , {80,76,78}, 273,2 , 10302,77 , 13,5 , 4,0 , 3260,6 , 3266,6 , 2, 1, 1, 6, 7 }, // Polish/Latin/Poland
+ { 91, 7, 30, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 249,7 , 249,7 , 119,10 , 669,27 , 37,5 , 8,10 , 7978,35 , 8013,79 , 8092,14 , 7978,35 , 8013,79 , 8092,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {66,82,76}, 275,2 , 10379,54 , 8,5 , 4,0 , 3272,9 , 3281,6 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Brazil
+ { 91, 7, 6, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {65,79,65}, 254,2 , 10433,54 , 13,5 , 4,0 , 3272,9 , 3287,6 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Angola
+ { 91, 7, 39, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {67,86,69}, 277,1 , 10487,69 , 13,5 , 4,0 , 3272,9 , 3293,10 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Cape Verde
+ { 91, 7, 62, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {85,83,68}, 159,3 , 10556,81 , 13,5 , 4,0 , 3272,9 , 3303,11 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/East Timor
+ { 91, 7, 66, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 10637,59 , 13,5 , 4,0 , 3272,9 , 3314,16 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/Equatorial Guinea
+ { 91, 7, 92, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {88,79,70}, 207,3 , 10696,62 , 13,5 , 4,0 , 3272,9 , 3330,12 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/Guinea Bissau
+ { 91, 7, 125, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3272,9 , 3342,10 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Luxembourg
+ { 91, 7, 126, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 18,7 , 25,12 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {77,79,80}, 137,4 , 10758,54 , 13,5 , 4,0 , 3272,9 , 3352,19 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Macau
+ { 91, 7, 146, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {77,90,78}, 278,3 , 10812,66 , 13,5 , 4,0 , 3272,9 , 3371,10 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Mozambique
+ { 91, 7, 173, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3381,17 , 3398,8 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Portugal
+ { 91, 7, 185, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {83,84,78}, 281,2 , 10878,92 , 13,5 , 4,0 , 3272,9 , 3406,19 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Sao Tome And Principe
+ { 91, 7, 206, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 669,27 , 37,5 , 8,10 , 8106,49 , 8013,79 , 8092,14 , 8106,49 , 8013,79 , 8092,14 , 220,8 , 209,8 , 0,5 , 5,17 , 22,23 , {67,72,70}, 224,3 , 10970,45 , 13,5 , 4,0 , 3272,9 , 3425,5 , 2, 0, 1, 6, 7 }, // Portuguese/Latin/Switzerland
+ { 92, 4, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 602,9 , 602,9 , 269,6 , 10,17 , 18,7 , 25,12 , 8155,36 , 8191,57 , 8248,23 , 8155,36 , 8191,57 , 8248,23 , 228,6 , 217,6 , 774,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 11015,39 , 4,4 , 4,0 , 3430,6 , 3436,4 , 2, 1, 7, 7, 7 }, // Punjabi/Gurmukhi/India
+ { 92, 1, 163, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 553,18 , 18,7 , 25,12 , 8271,37 , 8271,37 , 85,14 , 8271,37 , 8271,37 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 283,1 , 11054,13 , 41,6 , 4,0 , 3440,6 , 3240,7 , 2, 0, 7, 6, 7 }, // Punjabi/Arabic/Pakistan
+ { 93, 7, 169, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 611,11 , 622,10 , 119,10 , 192,18 , 37,5 , 8,10 , 8308,28 , 8336,53 , 8389,14 , 8308,28 , 8336,53 , 8389,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {80,69,78}, 284,2 , 11067,29 , 8,5 , 4,0 , 3446,8 , 3454,4 , 2, 1, 7, 6, 7 }, // Quechua/Latin/Peru
+ { 93, 7, 26, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 611,11 , 622,10 , 119,10 , 192,18 , 37,5 , 8,10 , 8308,28 , 8336,53 , 8389,14 , 8308,28 , 8336,53 , 8389,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {66,79,66}, 286,2 , 11096,25 , 8,5 , 4,0 , 3446,8 , 3458,7 , 2, 1, 1, 6, 7 }, // Quechua/Latin/Bolivia
+ { 93, 7, 63, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 611,11 , 622,10 , 119,10 , 192,18 , 37,5 , 8,10 , 8308,28 , 8336,53 , 8389,14 , 8308,28 , 8336,53 , 8389,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 11121,37 , 8,5 , 4,0 , 3446,8 , 3465,7 , 2, 1, 1, 6, 7 }, // Quechua/Latin/Ecuador
+ { 94, 7, 206, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 339,8 , 1068,23 , 37,5 , 8,10 , 8403,23 , 8426,56 , 8482,14 , 8403,23 , 8426,56 , 8482,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 224,3 , 11158,46 , 13,5 , 4,0 , 3472,9 , 3481,6 , 2, 0, 1, 6, 7 }, // Romansh/Latin/Switzerland
+ { 95, 7, 177, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 632,8 , 632,8 , 495,10 , 10,17 , 37,5 , 8,10 , 8496,34 , 8530,48 , 3107,14 , 8496,34 , 8530,48 , 3107,14 , 64,4 , 61,4 , 778,4 , 5,17 , 22,23 , {82,79,78}, 288,3 , 11204,57 , 13,5 , 4,0 , 3487,6 , 3493,7 , 2, 1, 1, 6, 7 }, // Romanian/Latin/Romania
+ { 95, 7, 141, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 632,8 , 632,8 , 495,10 , 10,17 , 37,5 , 8,10 , 8578,28 , 8530,48 , 8606,16 , 8578,28 , 8530,48 , 8606,16 , 64,4 , 61,4 , 778,4 , 5,17 , 22,23 , {77,68,76}, 291,1 , 11261,69 , 13,5 , 4,0 , 3487,6 , 3500,17 , 2, 1, 1, 6, 7 }, // Romanian/Latin/Moldova
+ { 96, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 495,10 , 317,22 , 37,5 , 8,10 , 8622,21 , 8643,62 , 8705,14 , 8622,21 , 8643,62 , 8622,21 , 0,2 , 0,2 , 269,5 , 680,17 , 22,23 , {82,85,66}, 123,1 , 11330,89 , 13,5 , 4,0 , 3517,7 , 3524,6 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Russia
+ { 96, 2, 20, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 495,10 , 317,22 , 37,5 , 8,10 , 8622,21 , 8643,62 , 8705,14 , 8622,21 , 8643,62 , 8622,21 , 0,2 , 0,2 , 269,5 , 680,17 , 22,23 , {66,89,78}, 0,2 , 11419,94 , 13,5 , 4,0 , 3517,7 , 510,8 , 2, 0, 1, 6, 7 }, // Russian/Cyrillic/Belarus
+ { 96, 2, 110, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 495,10 , 317,22 , 37,5 , 8,10 , 8622,21 , 8643,62 , 8705,14 , 8622,21 , 8643,62 , 8622,21 , 0,2 , 0,2 , 269,5 , 680,17 , 22,23 , {75,90,84}, 244,1 , 11513,83 , 13,5 , 4,0 , 3517,7 , 3530,9 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Kazakhstan
+ { 96, 2, 116, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 495,10 , 317,22 , 37,5 , 8,10 , 8622,21 , 8643,62 , 8705,14 , 8622,21 , 8643,62 , 8622,21 , 0,2 , 0,2 , 269,5 , 680,17 , 22,23 , {75,71,83}, 245,3 , 11596,82 , 13,5 , 4,0 , 3517,7 , 3539,8 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Kyrgyzstan
+ { 96, 2, 141, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 495,10 , 317,22 , 37,5 , 8,10 , 8622,21 , 8643,62 , 8705,14 , 8622,21 , 8643,62 , 8622,21 , 0,2 , 0,2 , 269,5 , 680,17 , 22,23 , {77,68,76}, 291,1 , 11678,79 , 13,5 , 4,0 , 3517,7 , 3547,7 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Moldova
+ { 96, 2, 222, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 111,7 , 111,7 , 495,10 , 317,22 , 37,5 , 8,10 , 8622,21 , 8643,62 , 8705,14 , 8622,21 , 8643,62 , 8622,21 , 0,2 , 0,2 , 269,5 , 680,17 , 22,23 , {85,65,72}, 292,1 , 11757,92 , 13,5 , 4,0 , 3517,7 , 3554,7 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Ukraine
+ { 98, 7, 41, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 8719,28 , 8747,66 , 8813,14 , 8719,28 , 8747,66 , 8813,14 , 234,2 , 223,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 11849,25 , 4,4 , 36,5 , 3561,5 , 3566,22 , 0, 0, 1, 6, 7 }, // Sango/Latin/Central African Republic
+ { 99, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 7, 7 }, // Sanskrit/Devanagari/India
+ { 100, 2, 243, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 111,7 , 111,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 8827,28 , 8855,52 , 8907,14 , 8827,28 , 8855,52 , 8907,14 , 236,9 , 225,8 , 782,7 , 5,17 , 22,23 , {82,83,68}, 293,3 , 11874,58 , 13,5 , 4,0 , 3588,6 , 3594,6 , 0, 0, 1, 6, 7 }, // Serbian/Cyrillic/Serbia
+ { 100, 2, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 111,7 , 111,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 8921,26 , 8947,55 , 8907,14 , 8921,26 , 8947,55 , 8907,14 , 245,11 , 225,8 , 782,7 , 5,17 , 22,23 , {66,65,77}, 296,2 , 11932,174 , 13,5 , 4,0 , 3588,6 , 3600,19 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/Bosnia And Herzegowina
+ { 100, 2, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 111,7 , 111,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 8827,28 , 8947,55 , 8907,14 , 8827,28 , 8947,55 , 8907,14 , 245,11 , 225,8 , 782,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12106,23 , 13,5 , 4,0 , 3588,6 , 3619,9 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/Montenegro
+ { 100, 2, 257, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 111,7 , 111,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 8827,28 , 8855,52 , 8907,14 , 8827,28 , 8855,52 , 8907,14 , 236,9 , 225,8 , 782,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12106,23 , 13,5 , 4,0 , 3588,6 , 3628,6 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/Kosovo
+ { 100, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 158,7 , 158,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 9002,26 , 9028,57 , 2129,14 , 9002,26 , 9028,57 , 2129,14 , 256,11 , 233,8 , 319,7 , 5,17 , 22,23 , {66,65,77}, 144,2 , 12129,174 , 13,5 , 4,0 , 3634,6 , 629,19 , 2, 1, 1, 6, 7 }, // Serbian/Latin/Bosnia And Herzegowina
+ { 100, 7, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 158,7 , 158,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 9085,28 , 9028,57 , 2129,14 , 9085,28 , 9028,57 , 2129,14 , 256,11 , 233,8 , 319,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12303,23 , 13,5 , 4,0 , 3634,6 , 3640,9 , 2, 1, 1, 6, 7 }, // Serbian/Latin/Montenegro
+ { 100, 7, 243, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 158,7 , 158,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 9085,28 , 9113,54 , 2129,14 , 9085,28 , 9113,54 , 2129,14 , 267,9 , 233,8 , 319,7 , 5,17 , 22,23 , {82,83,68}, 293,3 , 12326,58 , 13,5 , 4,0 , 3634,6 , 3649,6 , 0, 0, 1, 6, 7 }, // Serbian/Latin/Serbia
+ { 100, 7, 257, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 158,7 , 158,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 9085,28 , 9113,54 , 2129,14 , 9085,28 , 9113,54 , 2129,14 , 267,9 , 233,8 , 319,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12303,23 , 13,5 , 4,0 , 3634,6 , 3655,6 , 2, 1, 1, 6, 7 }, // Serbian/Latin/Kosovo
+ { 101, 2, 81, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 640,9 , 640,9 , 156,8 , 1118,23 , 37,5 , 8,10 , 9167,28 , 9195,61 , 9256,14 , 9270,28 , 9298,61 , 9256,14 , 276,15 , 241,15 , 45,4 , 5,17 , 22,23 , {71,69,76}, 231,1 , 12384,17 , 8,5 , 4,0 , 3661,4 , 3665,11 , 2, 1, 1, 6, 7 }, // Ossetic/Cyrillic/Georgia
+ { 101, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 640,9 , 640,9 , 156,8 , 1118,23 , 37,5 , 8,10 , 9167,28 , 9195,61 , 9256,14 , 9270,28 , 9298,61 , 9256,14 , 276,15 , 241,15 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 12401,17 , 8,5 , 4,0 , 3661,4 , 3676,6 , 2, 1, 1, 6, 7 }, // Ossetic/Cyrillic/Russia
+ { 102, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Southern Sotho/Latin/South Africa
+ { 103, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Tswana/Latin/South Africa
+ { 104, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 9359,28 , 9387,55 , 9442,14 , 9359,28 , 9387,55 , 9442,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 159,3 , 12418,22 , 4,4 , 4,0 , 3682,8 , 1815,8 , 2, 1, 7, 6, 7 }, // Shona/Latin/Zimbabwe
+ { 105, 1, 163, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 649,8 , 657,7 , 53,10 , 63,17 , 18,7 , 25,12 , 9456,35 , 9456,35 , 9491,31 , 9456,35 , 9456,35 , 9491,31 , 291,11 , 256,11 , 789,6 , 795,61 , 22,23 , {80,75,82}, 176,2 , 12440,43 , 8,5 , 4,0 , 3690,4 , 3694,7 , 2, 0, 7, 6, 7 }, // Sindhi/Arabic/Pakistan
+ { 106, 32, 198, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 664,9 , 673,8 , 53,10 , 63,17 , 205,5 , 210,10 , 9522,39 , 9561,62 , 9623,19 , 9522,39 , 9561,62 , 9623,19 , 302,5 , 267,4 , 856,5 , 861,42 , 22,23 , {76,75,82}, 298,3 , 12483,58 , 4,4 , 4,0 , 3701,5 , 3706,11 , 2, 1, 1, 6, 7 }, // Sinhala/Sinhala/Sri Lanka
+ { 107, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Swati/Latin/South Africa
+ { 108, 7, 191, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 180,7 , 681,7 , 1141,10 , 478,17 , 55,4 , 59,9 , 9642,21 , 9663,52 , 9715,14 , 9642,21 , 9663,52 , 9715,14 , 0,2 , 0,2 , 326,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12541,26 , 13,5 , 4,0 , 3717,10 , 3727,9 , 2, 1, 1, 6, 7 }, // Slovak/Latin/Slovakia
+ { 109, 7, 192, 44, 46, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 688,8 , 688,8 , 1151,9 , 1160,19 , 37,5 , 8,10 , 9729,35 , 9764,52 , 9816,14 , 9729,35 , 9764,52 , 9816,14 , 60,4 , 271,4 , 54,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12567,28 , 13,5 , 4,0 , 3736,11 , 3747,9 , 2, 1, 1, 6, 7 }, // Slovenian/Latin/Slovenia
+ { 110, 7, 194, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 696,9 , 696,9 , 27,8 , 1179,19 , 18,7 , 25,12 , 9830,32 , 9862,47 , 9909,15 , 9830,32 , 9862,47 , 9909,15 , 307,2 , 275,2 , 903,6 , 909,17 , 22,23 , {83,79,83}, 94,1 , 12595,27 , 4,4 , 4,0 , 3756,8 , 3764,10 , 0, 0, 1, 6, 7 }, // Somali/Latin/Somalia
+ { 110, 7, 59, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 696,9 , 696,9 , 27,8 , 1179,19 , 18,7 , 25,12 , 9830,32 , 9862,47 , 9909,15 , 9830,32 , 9862,47 , 9909,15 , 307,2 , 275,2 , 903,6 , 909,17 , 22,23 , {68,74,70}, 38,3 , 12622,50 , 4,4 , 4,0 , 3756,8 , 3774,7 , 0, 0, 6, 6, 7 }, // Somali/Latin/Djibouti
+ { 110, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 696,9 , 696,9 , 27,8 , 1179,19 , 18,7 , 25,12 , 9830,32 , 9862,47 , 9909,15 , 9830,32 , 9862,47 , 9909,15 , 307,2 , 275,2 , 903,6 , 909,17 , 22,23 , {69,84,66}, 0,2 , 12672,52 , 4,4 , 4,0 , 3756,8 , 3781,8 , 2, 1, 7, 6, 7 }, // Somali/Latin/Ethiopia
+ { 110, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 696,9 , 696,9 , 27,8 , 1179,19 , 37,5 , 8,10 , 9830,32 , 9862,47 , 9909,15 , 9830,32 , 9862,47 , 9909,15 , 307,2 , 275,2 , 903,6 , 909,17 , 22,23 , {75,69,83}, 2,3 , 12724,52 , 4,4 , 4,0 , 3756,8 , 1191,5 , 2, 1, 7, 6, 7 }, // Somali/Latin/Kenya
+ { 111, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 55,4 , 403,11 , 9924,35 , 9959,53 , 8389,14 , 9924,35 , 9959,53 , 8389,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3789,17 , 2427,6 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Spain
+ { 111, 7, 10, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 3107,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {65,82,83}, 6,1 , 12776,51 , 8,5 , 4,0 , 3806,7 , 3813,9 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Argentina
+ { 111, 7, 22, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {66,90,68}, 6,1 , 12827,52 , 4,4 , 4,0 , 3806,7 , 3822,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Belize
+ { 111, 7, 26, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {66,79,66}, 286,2 , 12879,35 , 4,4 , 4,0 , 3806,7 , 3458,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Bolivia
+ { 111, 7, 30, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {66,82,76}, 275,2 , 12914,52 , 4,4 , 4,0 , 3806,7 , 3281,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Brazil
+ { 111, 7, 43, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 339,8 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,76,80}, 6,1 , 12966,45 , 4,4 , 36,5 , 3806,7 , 3828,5 , 0, 0, 1, 6, 7 }, // Spanish/Latin/Chile
+ { 111, 7, 47, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 571,7 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 4796,14 , 9924,35 , 9959,53 , 3107,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,79,80}, 6,1 , 13011,54 , 8,5 , 4,0 , 3806,7 , 3833,8 , 2, 0, 7, 6, 7 }, // Spanish/Latin/Colombia
+ { 111, 7, 52, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,82,67}, 301,1 , 13065,67 , 4,4 , 4,0 , 3806,7 , 3841,10 , 2, 0, 1, 6, 7 }, // Spanish/Latin/Costa Rica
+ { 111, 7, 55, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {67,85,80}, 6,1 , 13132,42 , 4,4 , 4,0 , 3806,7 , 3851,4 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Cuba
+ { 111, 7, 61, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 3107,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {68,79,80}, 302,3 , 13174,54 , 4,4 , 89,6 , 3806,7 , 3855,20 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Dominican Republic
+ { 111, 7, 63, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 13228,70 , 4,4 , 36,5 , 3806,7 , 3465,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Ecuador
+ { 111, 7, 65, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 13228,70 , 4,4 , 4,0 , 3806,7 , 3875,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/El Salvador
+ { 111, 7, 66, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 55,4 , 403,11 , 9924,35 , 9959,53 , 8389,14 , 9924,35 , 9959,53 , 8389,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 13298,92 , 4,4 , 4,0 , 3806,7 , 3886,17 , 0, 0, 1, 6, 7 }, // Spanish/Latin/Equatorial Guinea
+ { 111, 7, 90, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 571,7 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {71,84,81}, 305,1 , 13390,30 , 18,5 , 4,0 , 3806,7 , 3903,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Guatemala
+ { 111, 7, 96, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 1198,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {72,78,76}, 291,1 , 13420,60 , 4,4 , 4,0 , 3806,7 , 3912,8 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Honduras
+ { 111, 7, 139, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 27,8 , 669,27 , 55,4 , 59,9 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 3107,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {77,88,78}, 6,1 , 13480,48 , 47,6 , 4,0 , 3920,17 , 3937,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Mexico
+ { 111, 7, 155, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {78,73,79}, 306,2 , 13528,69 , 4,4 , 4,0 , 3806,7 , 3943,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Nicaragua
+ { 111, 7, 166, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 1225,8 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,65,66}, 308,3 , 13597,54 , 4,4 , 4,0 , 3806,7 , 3952,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Panama
+ { 111, 7, 168, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,89,71}, 311,3 , 13651,61 , 8,5 , 23,6 , 3806,7 , 3958,8 , 0, 0, 7, 6, 7 }, // Spanish/Latin/Paraguay
+ { 111, 7, 169, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 571,7 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,69,78}, 284,2 , 13712,43 , 8,5 , 4,0 , 3806,7 , 3454,4 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Peru
+ { 111, 7, 170, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 8389,14 , 9924,35 , 9959,53 , 8389,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,72,80}, 179,1 , 13755,48 , 13,5 , 4,0 , 3806,7 , 3966,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Philippines
+ { 111, 7, 174, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 1225,8 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 13228,70 , 4,4 , 4,0 , 3806,7 , 1446,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Puerto Rico
+ { 111, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 415,8 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 3107,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 13228,70 , 95,7 , 4,0 , 3806,7 , 3975,14 , 2, 1, 7, 6, 7 }, // Spanish/Latin/United States
+ { 111, 7, 227, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,89,85}, 6,1 , 13803,48 , 8,5 , 4,0 , 3806,7 , 3989,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Uruguay
+ { 111, 7, 231, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 18,7 , 25,12 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {86,69,83}, 314,4 , 13851,58 , 4,4 , 36,5 , 3806,7 , 3996,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Venezuela
+ { 111, 7, 238, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 55,4 , 403,11 , 9924,35 , 9959,53 , 8389,14 , 9924,35 , 9959,53 , 8389,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3806,7 , 4005,8 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Canary Islands
+ { 111, 7, 246, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 37,5 , 8,10 , 9924,35 , 9959,53 , 3107,14 , 9924,35 , 9959,53 , 4796,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 4,4 , 4,0 , 4013,23 , 4036,13 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Latin America
+ { 111, 7, 250, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 669,27 , 55,4 , 403,11 , 9924,35 , 9959,53 , 8389,14 , 9924,35 , 9959,53 , 8389,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3806,7 , 4049,15 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Ceuta And Melilla
+ { 112, 7, 101, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,68,82}, 238,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Sundanese/Latin/Indonesia
+ { 113, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 712,8 , 712,8 , 119,10 , 10,17 , 37,5 , 8,10 , 10012,60 , 10012,60 , 85,14 , 10012,60 , 10012,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {84,90,83}, 192,3 , 13909,67 , 8,5 , 4,0 , 4064,9 , 1620,8 , 2, 0, 1, 6, 7 }, // Swahili/Latin/Tanzania
+ { 113, 7, 49, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 712,8 , 712,8 , 119,10 , 10,17 , 37,5 , 8,10 , 10012,60 , 10012,60 , 85,14 , 10012,60 , 10012,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {67,68,70}, 210,2 , 13976,55 , 8,5 , 4,0 , 4064,9 , 4073,32 , 2, 1, 1, 6, 7 }, // Swahili/Latin/Congo Kinshasa
+ { 113, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 712,8 , 712,8 , 119,10 , 10,17 , 37,5 , 8,10 , 10012,60 , 10012,60 , 85,14 , 10012,60 , 10012,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {75,69,83}, 2,3 , 14031,58 , 102,6 , 108,6 , 4064,9 , 1191,5 , 2, 1, 7, 6, 7 }, // Swahili/Latin/Kenya
+ { 113, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 712,8 , 712,8 , 119,10 , 10,17 , 37,5 , 8,10 , 10012,60 , 10012,60 , 85,14 , 10012,60 , 10012,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {85,71,88}, 197,3 , 14089,61 , 8,5 , 4,0 , 4064,9 , 1685,6 , 0, 0, 1, 7, 7 }, // Swahili/Latin/Uganda
+ { 114, 7, 205, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 720,9 , 720,9 , 53,10 , 97,16 , 37,5 , 414,16 , 10072,29 , 10101,50 , 2320,14 , 10072,29 , 10101,50 , 2320,14 , 309,2 , 277,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 190,2 , 14150,45 , 13,5 , 4,0 , 4105,7 , 4112,7 , 2, 0, 1, 6, 7 }, // Swedish/Latin/Sweden
+ { 114, 7, 73, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 720,9 , 720,9 , 53,10 , 97,16 , 37,5 , 414,16 , 10072,29 , 10101,50 , 2320,14 , 10072,29 , 10101,50 , 2320,14 , 309,2 , 277,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9086,19 , 13,5 , 4,0 , 4105,7 , 1088,7 , 2, 1, 1, 6, 7 }, // Swedish/Latin/Finland
+ { 114, 7, 248, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 720,9 , 720,9 , 53,10 , 97,16 , 37,5 , 414,16 , 10072,29 , 10101,50 , 2320,14 , 10072,29 , 10101,50 , 2320,14 , 309,2 , 277,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9086,19 , 13,5 , 4,0 , 4105,7 , 4119,5 , 2, 1, 1, 6, 7 }, // Swedish/Latin/Aland Islands
+ { 115, 7, 106, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Sardinian/Latin/Italy
+ { 116, 2, 209, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 553,18 , 37,5 , 8,10 , 10151,28 , 10179,55 , 10234,14 , 10151,28 , 10179,55 , 10234,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {84,74,83}, 318,4 , 14195,19 , 13,5 , 4,0 , 4124,6 , 4130,10 , 2, 1, 1, 6, 7 }, // Tajik/Cyrillic/Tajikistan
+ { 117, 27, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 729,13 , 729,13 , 269,6 , 192,18 , 359,7 , 430,12 , 10248,39 , 10287,49 , 10336,20 , 10248,39 , 10287,49 , 10336,20 , 311,8 , 279,8 , 977,7 , 5,17 , 22,23 , {73,78,82}, 121,1 , 14214,49 , 8,5 , 4,0 , 4140,5 , 4145,7 , 2, 1, 7, 7, 7 }, // Tamil/Tamil/India
+ { 117, 27, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 729,13 , 729,13 , 269,6 , 192,18 , 359,7 , 430,12 , 10248,39 , 10287,49 , 10336,20 , 10248,39 , 10287,49 , 10336,20 , 311,8 , 279,8 , 977,7 , 5,17 , 22,23 , {77,89,82}, 174,2 , 14263,61 , 8,5 , 4,0 , 4140,5 , 4152,7 , 2, 1, 1, 6, 7 }, // Tamil/Tamil/Malaysia
+ { 117, 27, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 729,13 , 729,13 , 269,6 , 192,18 , 359,7 , 430,12 , 10248,39 , 10287,49 , 10336,20 , 10248,39 , 10287,49 , 10336,20 , 311,8 , 279,8 , 977,7 , 5,17 , 22,23 , {83,71,68}, 6,1 , 14324,61 , 8,5 , 4,0 , 4140,5 , 4159,11 , 2, 1, 7, 6, 7 }, // Tamil/Tamil/Singapore
+ { 117, 27, 198, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 729,13 , 729,13 , 269,6 , 192,18 , 37,5 , 8,10 , 10248,39 , 10287,49 , 10336,20 , 10248,39 , 10287,49 , 10336,20 , 311,8 , 279,8 , 977,7 , 5,17 , 22,23 , {76,75,82}, 322,3 , 14385,49 , 8,5 , 4,0 , 4140,5 , 4170,6 , 2, 1, 1, 6, 7 }, // Tamil/Tamil/Sri Lanka
+ { 118, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 742,9 , 742,9 , 495,10 , 1233,23 , 55,4 , 59,9 , 10356,36 , 10392,56 , 10448,14 , 10356,36 , 10392,56 , 10448,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 14434,21 , 0,4 , 4,0 , 4176,5 , 3524,6 , 2, 1, 1, 6, 7 }, // Tatar/Cyrillic/Russia
+ { 119, 28, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 751,11 , 751,11 , 339,8 , 1256,18 , 18,7 , 25,12 , 10462,32 , 10494,60 , 10554,18 , 10462,32 , 10494,60 , 10554,18 , 0,2 , 0,2 , 984,7 , 991,29 , 22,23 , {73,78,82}, 121,1 , 14455,26 , 4,4 , 4,0 , 4181,6 , 4187,8 , 2, 1, 7, 7, 7 }, // Telugu/Telugu/India
+ { 120, 30, 211, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 118,5 , 118,5 , 762,8 , 770,7 , 269,6 , 1274,19 , 37,5 , 442,28 , 10572,23 , 10595,68 , 10663,16 , 10572,23 , 10595,68 , 10663,16 , 319,10 , 287,10 , 1020,4 , 5,17 , 22,23 , {84,72,66}, 325,1 , 14481,16 , 4,4 , 4,0 , 4195,3 , 4195,3 , 2, 1, 7, 6, 7 }, // Thai/Thai/Thailand
+ { 121, 31, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1293,23 , 18,7 , 25,12 , 10679,51 , 10730,79 , 10809,27 , 10679,51 , 10730,79 , 10809,27 , 329,7 , 297,8 , 45,4 , 5,17 , 22,23 , {67,78,89}, 133,1 , 14497,13 , 8,5 , 4,0 , 4198,8 , 4206,6 , 2, 1, 7, 6, 7 }, // Tibetan/Tibetan/China
+ { 121, 31, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1293,23 , 18,7 , 25,12 , 10679,51 , 10730,79 , 10809,27 , 10679,51 , 10730,79 , 10809,27 , 329,7 , 297,8 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 14510,19 , 8,5 , 4,0 , 4198,8 , 4212,7 , 2, 1, 7, 7, 7 }, // Tibetan/Tibetan/India
+ { 122, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 1316,23 , 18,7 , 25,12 , 10836,21 , 10857,29 , 10886,14 , 10836,21 , 10857,29 , 10900,14 , 336,7 , 305,7 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,2 , 14529,16 , 4,4 , 4,0 , 4219,4 , 92,5 , 2, 1, 7, 6, 7 }, // Tigrinya/Ethiopic/Ethiopia
+ { 122, 14, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 1316,23 , 18,7 , 25,12 , 10836,21 , 10857,29 , 10900,14 , 10836,21 , 10857,29 , 10900,14 , 336,7 , 305,7 , 45,4 , 5,17 , 22,23 , {69,82,78}, 41,3 , 0,7 , 4,4 , 4,0 , 4219,4 , 4223,4 , 2, 1, 1, 6, 7 }, // Tigrinya/Ethiopic/Eritrea
+ { 123, 7, 214, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 777,8 , 777,8 , 777,8 , 777,8 , 269,6 , 97,16 , 18,7 , 25,12 , 10914,29 , 10943,60 , 11003,14 , 10914,29 , 10943,60 , 11003,14 , 343,10 , 312,6 , 1024,5 , 1029,59 , 1088,65 , {84,79,80}, 195,2 , 14545,41 , 13,5 , 4,0 , 4227,13 , 1635,5 , 2, 1, 1, 6, 7 }, // Tongan/Latin/Tonga
+ { 124, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Tsonga/Latin/South Africa
+ { 125, 7, 217, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 785,8 , 785,8 , 1339,9 , 1348,16 , 37,5 , 8,10 , 11017,28 , 11045,54 , 11099,14 , 11017,28 , 11045,54 , 11099,14 , 353,2 , 318,2 , 199,4 , 5,17 , 22,23 , {84,82,89}, 252,1 , 14586,40 , 4,4 , 4,0 , 4240,6 , 4246,7 , 2, 1, 1, 6, 7 }, // Turkish/Latin/Turkey
+ { 125, 7, 56, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 785,8 , 785,8 , 1339,9 , 1348,16 , 18,7 , 25,12 , 11017,28 , 11045,54 , 11099,14 , 11017,28 , 11045,54 , 11099,14 , 353,2 , 318,2 , 199,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 4,4 , 4,0 , 4240,6 , 4253,6 , 2, 1, 1, 6, 7 }, // Turkish/Latin/Cyprus
+ { 126, 7, 218, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8220, 8221, 0,6 , 0,6 , 793,8 , 793,8 , 495,10 , 1348,16 , 37,5 , 8,10 , 11113,28 , 11141,54 , 11195,14 , 11209,28 , 11237,54 , 11195,14 , 355,13 , 320,14 , 1153,4 , 5,17 , 22,23 , {84,77,84}, 326,3 , 14626,49 , 13,5 , 4,0 , 4259,12 , 4271,12 , 2, 1, 1, 6, 7 }, // Turkmen/Latin/Turkmenistan
+ { 128, 1, 44, 46, 44, 59, 37, 48, 45, 43, 101, 187, 171, 8250, 8249, 0,6 , 0,6 , 195,10 , 205,9 , 53,10 , 1364,17 , 18,7 , 25,12 , 11291,21 , 11312,55 , 11367,14 , 11291,21 , 11312,55 , 11367,14 , 368,12 , 334,12 , 45,4 , 5,17 , 22,23 , {67,78,89}, 243,1 , 14675,40 , 4,4 , 4,0 , 4283,8 , 4291,5 , 2, 1, 7, 6, 7 }, // Uighur/Arabic/China
+ { 129, 2, 222, 44, 160, 59, 37, 48, 45, 43, 1077, 171, 187, 8222, 8220, 0,6 , 0,6 , 133,7 , 133,7 , 156,8 , 1381,22 , 37,5 , 8,10 , 1454,21 , 11381,56 , 11437,14 , 1454,21 , 11381,56 , 11437,14 , 380,2 , 346,2 , 1157,5 , 680,17 , 22,23 , {85,65,72}, 292,1 , 14715,49 , 13,5 , 4,0 , 4296,10 , 4306,7 , 2, 1, 1, 6, 7 }, // Ukrainian/Cyrillic/Ukraine
+ { 130, 1, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 557,6 , 557,6 , 801,10 , 811,9 , 269,6 , 1403,18 , 18,7 , 25,12 , 11451,36 , 11451,36 , 85,14 , 11451,36 , 11451,36 , 85,14 , 0,2 , 0,2 , 1162,4 , 1166,20 , 22,23 , {80,75,82}, 176,2 , 14764,49 , 4,4 , 4,0 , 4313,4 , 3240,7 , 2, 0, 7, 6, 7 }, // Urdu/Arabic/Pakistan
+ { 130, 1, 100, 1643, 1644, 59, 37, 1776, 45, 43, 101, 8221, 8220, 8217, 8216, 557,6 , 557,6 , 820,6 , 820,6 , 269,6 , 1403,18 , 18,7 , 25,12 , 11451,36 , 11451,36 , 85,14 , 11451,36 , 11451,36 , 85,14 , 0,2 , 0,2 , 1162,4 , 1166,20 , 22,23 , {73,78,82}, 121,1 , 14813,42 , 8,5 , 4,0 , 4313,4 , 4317,5 , 2, 1, 7, 7, 7 }, // Urdu/Arabic/India
+ { 131, 7, 228, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8217, 8216, 0,6 , 0,6 , 826,8 , 826,8 , 27,8 , 1421,18 , 37,5 , 403,11 , 11487,32 , 11519,61 , 11580,14 , 11487,32 , 11519,61 , 11580,14 , 382,2 , 348,2 , 199,4 , 5,17 , 22,23 , {85,90,83}, 329,4 , 14855,58 , 13,5 , 4,0 , 4322,6 , 4328,11 , 2, 0, 1, 6, 7 }, // Uzbek/Latin/Uzbekistan
+ { 131, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 394,8 , 1439,33 , 55,4 , 403,11 , 11594,21 , 7794,49 , 85,14 , 11594,21 , 7794,49 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {65,70,78}, 268,1 , 14913,13 , 13,5 , 4,0 , 4339,6 , 3231,9 , 0, 0, 6, 4, 5 }, // Uzbek/Arabic/Afghanistan
+ { 131, 2, 228, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 696,19 , 37,5 , 87,12 , 11615,28 , 11643,53 , 11696,14 , 11615,28 , 11643,53 , 11696,14 , 384,2 , 350,2 , 45,4 , 5,17 , 22,23 , {85,90,83}, 333,3 , 14926,49 , 13,5 , 4,0 , 4345,7 , 4352,10 , 2, 0, 1, 6, 7 }, // Uzbek/Cyrillic/Uzbekistan
+ { 132, 7, 232, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 834,8 , 834,8 , 119,10 , 192,18 , 37,5 , 8,10 , 11710,33 , 11743,55 , 11798,21 , 11710,33 , 11743,55 , 11798,21 , 386,2 , 352,2 , 45,4 , 5,17 , 22,23 , {86,78,68}, 336,1 , 14975,33 , 13,5 , 4,0 , 4362,10 , 4372,8 , 0, 0, 1, 6, 7 }, // Vietnamese/Latin/Vietnam
+ { 133, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1472,23 , 37,5 , 8,10 , 11819,21 , 11840,43 , 11883,14 , 11897,28 , 11840,43 , 11883,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 4380,7 , 0,0 , 2, 1, 1, 6, 7 }, // Volapuk/Latin/World
+ { 134, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 842,11 , 853,10 , 27,8 , 10,17 , 37,5 , 8,10 , 11925,29 , 11954,77 , 12031,15 , 12046,30 , 11954,77 , 12031,15 , 388,2 , 354,2 , 1186,7 , 5,17 , 22,23 , {71,66,80}, 119,1 , 15008,91 , 4,4 , 4,0 , 4387,7 , 4394,16 , 2, 1, 1, 6, 7 }, // Welsh/Latin/United Kingdom
+ { 135, 7, 187, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 528,10 , 1495,17 , 37,5 , 8,10 , 12076,28 , 12104,50 , 12076,28 , 12076,28 , 12104,50 , 12076,28 , 390,3 , 356,3 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 15099,65 , 8,5 , 4,0 , 4410,5 , 4415,8 , 0, 0, 1, 6, 7 }, // Wolof/Latin/Senegal
+ { 136, 7, 195, 46, 160, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 12154,28 , 12182,61 , 85,14 , 12154,28 , 12182,61 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 15164,79 , 4,4 , 4,0 , 4423,8 , 4431,15 , 2, 1, 7, 6, 7 }, // Xhosa/Latin/South Africa
+ { 137, 18, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 863,9 , 863,9 , 27,8 , 1512,19 , 37,5 , 8,10 , 12243,54 , 12243,54 , 85,14 , 12243,54 , 12243,54 , 85,14 , 393,11 , 359,10 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 41,6 , 4,0 , 4446,6 , 4452,5 , 2, 1, 1, 6, 7 }, // Yiddish/Hebrew/World
+ { 138, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 1531,16 , 470,3 , 8,10 , 12297,33 , 12330,44 , 12374,14 , 12297,33 , 12388,69 , 12374,14 , 404,5 , 369,5 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 15243,49 , 4,4 , 4,0 , 4457,10 , 4467,19 , 2, 1, 1, 6, 7 }, // Yoruba/Latin/Nigeria
+ { 138, 7, 23, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 1531,16 , 470,3 , 8,10 , 12457,33 , 12490,44 , 12534,14 , 12457,33 , 12548,69 , 12534,14 , 409,5 , 374,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 15292,34 , 4,4 , 4,0 , 4457,10 , 4486,16 , 0, 0, 1, 6, 7 }, // Yoruba/Latin/Benin
+ { 140, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 872,9 , 881,8 , 547,6 , 35,18 , 37,5 , 8,10 , 12617,28 , 12645,74 , 12719,14 , 12617,28 , 12645,74 , 12719,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 15326,67 , 4,4 , 4,0 , 4502,7 , 4509,17 , 2, 1, 7, 6, 7 }, // Zulu/Latin/South Africa
+ { 141, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 187,8 , 187,8 , 495,10 , 478,17 , 37,5 , 414,16 , 12733,28 , 12761,51 , 2320,14 , 12812,28 , 12761,51 , 2320,14 , 414,9 , 379,11 , 45,4 , 5,17 , 22,23 , {78,79,75}, 190,2 , 10046,44 , 13,5 , 4,0 , 4526,7 , 4533,5 , 2, 0, 1, 6, 7 }, // Norwegian Nynorsk/Latin/Norway
+ { 142, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 8216, 8217, 0,6 , 0,6 , 158,7 , 158,7 , 1547,11 , 450,19 , 37,5 , 8,10 , 2043,28 , 2071,58 , 2129,14 , 2043,28 , 2071,58 , 2143,14 , 423,10 , 390,7 , 319,7 , 5,17 , 22,23 , {66,65,77}, 144,2 , 15393,170 , 13,5 , 4,0 , 4538,8 , 629,19 , 2, 1, 1, 6, 7 }, // Bosnian/Latin/Bosnia And Herzegowina
+ { 142, 2, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 111,7 , 111,7 , 1091,7 , 1098,20 , 37,5 , 8,10 , 12840,28 , 12868,56 , 8907,14 , 12840,28 , 12868,56 , 8907,14 , 245,11 , 397,13 , 45,4 , 5,17 , 22,23 , {66,65,77}, 296,2 , 15563,152 , 13,5 , 4,0 , 4546,8 , 3600,19 , 2, 1, 1, 6, 7 }, // Bosnian/Cyrillic/Bosnia And Herzegowina
+ { 143, 29, 131, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,86,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 5, 6, 7 }, // Divehi/Thaana/Maldives
+ { 144, 7, 251, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 80,17 , 37,5 , 8,10 , 12924,30 , 12954,57 , 85,14 , 12924,30 , 12954,57 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {71,66,80}, 119,1 , 0,7 , 4,4 , 4,0 , 4554,5 , 4559,12 , 2, 1, 1, 6, 7 }, // Manx/Latin/Isle Of Man
+ { 145, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 97,16 , 37,5 , 8,10 , 13011,28 , 13039,61 , 85,14 , 13011,28 , 13039,61 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {71,66,80}, 119,1 , 0,7 , 4,4 , 4,0 , 4571,8 , 4579,14 , 2, 1, 1, 6, 7 }, // Cornish/Latin/United Kingdom
+ { 146, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1558,8 , 1566,18 , 18,7 , 25,12 , 13100,28 , 13128,49 , 13177,14 , 13100,28 , 13128,49 , 13177,14 , 433,2 , 410,2 , 45,4 , 5,17 , 22,23 , {71,72,83}, 167,3 , 15715,17 , 4,4 , 4,0 , 4593,4 , 4597,5 , 2, 1, 1, 6, 7 }, // Akan/Latin/Ghana
+ { 147, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1584,6 , 97,16 , 18,7 , 25,12 , 13191,49 , 13191,49 , 13240,20 , 13191,49 , 13191,49 , 13240,20 , 0,2 , 0,2 , 1193,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 15732,31 , 4,4 , 4,0 , 4602,6 , 2662,4 , 2, 1, 7, 7, 7 }, // Konkani/Devanagari/India
+ { 148, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,72,83}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Ga/Latin/Ghana
+ { 149, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 889,9 , 712,8 , 269,6 , 10,17 , 37,5 , 8,10 , 13260,29 , 13289,54 , 85,14 , 13260,29 , 13289,54 , 85,14 , 435,7 , 412,7 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 15763,12 , 4,4 , 4,0 , 4608,10 , 4618,8 , 2, 1, 1, 6, 7 }, // Igbo/Latin/Nigeria
+ { 150, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 13343,28 , 13371,74 , 13445,14 , 13343,28 , 13371,74 , 13445,14 , 442,9 , 419,7 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15775,23 , 4,4 , 4,0 , 4626,7 , 1191,5 , 2, 1, 7, 6, 7 }, // Kamba/Latin/Kenya
+ { 151, 33, 103, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,81,68}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 6 }, // Syriac/Syriac/Iraq
+ { 152, 14, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,82,78}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Blin/Ethiopic/Eritrea
+ { 153, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Geez/Ethiopic/Ethiopia
+ { 155, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Sidamo/Latin/Ethiopia
+ { 156, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Atsam/Latin/Nigeria
+ { 157, 14, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,82,78}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Tigre/Ethiopic/Eritrea
+ { 158, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Jju/Latin/Nigeria
+ { 159, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 249,7 , 249,7 , 27,8 , 1590,27 , 37,5 , 8,10 , 13459,28 , 13487,50 , 3107,14 , 13459,28 , 13487,50 , 3107,14 , 451,2 , 426,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 8,5 , 4,0 , 4633,6 , 4639,6 , 2, 1, 1, 6, 7 }, // Friulian/Latin/Italy
+ { 160, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Venda/Latin/South Africa
+ { 161, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 898,11 , 909,10 , 547,6 , 1617,23 , 473,12 , 485,17 , 13537,28 , 13565,44 , 13609,14 , 13537,28 , 13565,44 , 13609,14 , 453,3 , 428,5 , 45,4 , 5,17 , 22,23 , {71,72,83}, 167,3 , 15798,37 , 4,4 , 4,0 , 4645,6 , 4651,12 , 2, 1, 1, 6, 7 }, // Ewe/Latin/Ghana
+ { 161, 7, 212, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 898,11 , 909,10 , 547,6 , 1617,23 , 37,5 , 8,10 , 13537,28 , 13565,44 , 13609,14 , 13537,28 , 13565,44 , 13609,14 , 453,3 , 428,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 15835,106 , 4,4 , 4,0 , 4645,6 , 4663,11 , 0, 0, 1, 6, 7 }, // Ewe/Latin/Togo
+ { 162, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Walamo/Ethiopic/Ethiopia
+ { 163, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 269,6 , 10,17 , 18,7 , 25,12 , 13623,21 , 13644,57 , 85,14 , 13623,21 , 13644,57 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 4,4 , 4,0 , 4674,14 , 4688,19 , 2, 1, 7, 6, 7 }, // Hawaiian/Latin/United States
+ { 164, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Tyap/Latin/Nigeria
+ { 165, 7, 129, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,87,75}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Nyanja/Latin/Malawi
+ { 166, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 919,9 , 928,8 , 547,6 , 35,18 , 18,7 , 25,12 , 13701,28 , 13729,55 , 13701,28 , 13701,28 , 13729,55 , 13701,28 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {80,72,80}, 179,1 , 15941,58 , 4,4 , 4,0 , 4707,8 , 4715,9 , 2, 1, 7, 6, 7 }, // Filipino/Latin/Philippines
+ { 167, 7, 206, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 13784,28 , 13812,63 , 3695,14 , 13784,28 , 13812,63 , 3695,14 , 456,12 , 433,11 , 45,4 , 5,17 , 22,23 , {67,72,70}, 224,3 , 15999,55 , 13,5 , 4,0 , 4724,16 , 4740,7 , 2, 0, 1, 6, 7 }, // Swiss German/Latin/Switzerland
+ { 167, 7, 74, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 13784,28 , 13812,63 , 3695,14 , 13784,28 , 13812,63 , 3695,14 , 456,12 , 433,11 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 13,5 , 4,0 , 4724,16 , 4747,10 , 2, 1, 1, 6, 7 }, // Swiss German/Latin/France
+ { 167, 7, 123, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 264,9 , 264,9 , 156,8 , 622,18 , 37,5 , 8,10 , 13784,28 , 13812,63 , 3695,14 , 13784,28 , 13812,63 , 3695,14 , 456,12 , 433,11 , 45,4 , 5,17 , 22,23 , {67,72,70}, 224,3 , 15999,55 , 13,5 , 4,0 , 4724,16 , 4757,13 , 2, 0, 1, 6, 7 }, // Swiss German/Latin/Liechtenstein
+ { 168, 34, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 13875,21 , 13896,28 , 13924,14 , 13875,21 , 13896,28 , 13924,14 , 468,2 , 444,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 133,1 , 0,7 , 8,5 , 4,0 , 4770,3 , 4773,2 , 2, 1, 7, 6, 7 }, // Sichuan Yi/Yi/China
+ { 169, 7, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Kpelle/Latin/Liberia
+ { 170, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 456,8 , 456,8 , 365,7 , 1640,23 , 502,10 , 512,19 , 13938,28 , 13966,65 , 3695,14 , 13938,28 , 13966,65 , 3695,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16054,15 , 13,5 , 4,0 , 4775,14 , 4789,11 , 2, 1, 1, 6, 7 }, // Low German/Latin/Germany
+ { 170, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 456,8 , 456,8 , 365,7 , 1640,23 , 502,10 , 512,19 , 13938,28 , 13966,65 , 3695,14 , 13938,28 , 13966,65 , 3695,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16054,15 , 13,5 , 4,0 , 4775,14 , 4800,12 , 2, 1, 1, 6, 7 }, // Low German/Latin/Netherlands
+ { 171, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // South Ndebele/Latin/South Africa
+ { 172, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Northern Sotho/Latin/South Africa
+ { 173, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 223,8 , 223,8 , 53,10 , 63,17 , 37,5 , 8,10 , 14031,33 , 14064,75 , 14139,14 , 14031,33 , 14064,75 , 14139,14 , 470,11 , 446,13 , 45,4 , 5,17 , 22,23 , {78,79,75}, 190,2 , 16069,63 , 13,5 , 4,0 , 4812,15 , 4827,5 , 2, 0, 1, 6, 7 }, // Northern Sami/Latin/Norway
+ { 173, 7, 73, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 223,8 , 223,8 , 495,10 , 97,16 , 37,5 , 8,10 , 14153,21 , 14174,70 , 14244,14 , 14153,21 , 14174,70 , 14244,14 , 481,2 , 459,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16132,23 , 13,5 , 4,0 , 4812,15 , 4832,6 , 2, 1, 1, 6, 7 }, // Northern Sami/Latin/Finland
+ { 173, 7, 205, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 223,8 , 223,8 , 53,10 , 63,17 , 37,5 , 8,10 , 14031,33 , 14064,75 , 14139,14 , 14031,33 , 14064,75 , 14139,14 , 470,11 , 446,13 , 45,4 , 5,17 , 22,23 , {83,69,75}, 190,2 , 16155,63 , 13,5 , 4,0 , 4812,15 , 4838,6 , 2, 0, 1, 6, 7 }, // Northern Sami/Latin/Sweden
+ { 174, 7, 208, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {84,87,68}, 337,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Taroko/Latin/Taiwan
+ { 175, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 14258,28 , 14286,62 , 14348,14 , 14258,28 , 14286,62 , 14348,14 , 483,6 , 461,3 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16218,24 , 4,4 , 4,0 , 4844,8 , 1191,5 , 2, 1, 7, 6, 7 }, // Gusii/Latin/Kenya
+ { 176, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 14362,28 , 14390,105 , 14495,14 , 14362,28 , 14390,105 , 14495,14 , 489,10 , 464,10 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16218,24 , 4,4 , 4,0 , 4852,7 , 1191,5 , 2, 1, 7, 6, 7 }, // Taita/Latin/Kenya
+ { 177, 7, 187, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 16242,26 , 13,5 , 4,0 , 4859,6 , 4415,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Senegal
+ { 177, 7, 34, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 16242,26 , 13,5 , 4,0 , 4859,6 , 4865,14 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Burkina Faso
+ { 177, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 16268,25 , 13,5 , 4,0 , 4859,6 , 4879,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Cameroon
+ { 177, 7, 80, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {71,77,68}, 166,1 , 16293,20 , 13,5 , 4,0 , 4859,6 , 4887,6 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Gambia
+ { 177, 7, 83, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {71,72,83}, 167,3 , 0,7 , 13,5 , 4,0 , 4859,6 , 4893,5 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Ghana
+ { 177, 7, 91, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {71,78,70}, 216,2 , 0,7 , 13,5 , 4,0 , 4859,6 , 4898,4 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Guinea
+ { 177, 7, 92, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 16242,26 , 13,5 , 4,0 , 4859,6 , 4902,12 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Guinea Bissau
+ { 177, 7, 121, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 16313,23 , 13,5 , 4,0 , 4859,6 , 4914,9 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Liberia
+ { 177, 7, 136, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {77,82,85}, 219,2 , 16336,22 , 13,5 , 4,0 , 4859,6 , 4923,8 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Mauritania
+ { 177, 7, 156, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 16242,26 , 13,5 , 4,0 , 4859,6 , 4931,6 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Niger
+ { 177, 7, 157, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {78,71,78}, 178,1 , 16358,23 , 13,5 , 4,0 , 4859,6 , 4937,9 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Nigeria
+ { 177, 7, 189, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 14509,28 , 14537,59 , 14596,14 , 14509,28 , 14537,59 , 14596,14 , 499,6 , 474,7 , 45,4 , 5,17 , 22,23 , {83,76,76}, 187,2 , 16381,25 , 13,5 , 4,0 , 4859,6 , 4946,11 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Sierra Leone
+ { 177, 134, 91, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,78,70}, 216,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Fulah/Adlam/Guinea
+ { 178, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 14610,28 , 14638,63 , 14701,14 , 14610,28 , 14638,63 , 14701,14 , 505,6 , 481,8 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16406,23 , 4,4 , 4,0 , 4957,6 , 1191,5 , 2, 1, 7, 6, 7 }, // Kikuyu/Latin/Kenya
+ { 179, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 14715,28 , 14743,105 , 14848,14 , 14715,28 , 14743,105 , 14848,14 , 511,7 , 489,5 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16429,25 , 4,4 , 4,0 , 4963,8 , 1191,5 , 2, 1, 7, 6, 7 }, // Samburu/Latin/Kenya
+ { 180, 7, 146, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 669,27 , 37,5 , 8,10 , 14862,28 , 14890,55 , 14945,14 , 14862,28 , 14890,55 , 14945,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,90,78}, 278,3 , 16454,28 , 0,4 , 4,0 , 4971,4 , 3371,10 , 2, 1, 7, 6, 7 }, // Sena/Latin/Mozambique
+ { 181, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 14959,28 , 14987,50 , 15037,14 , 14959,28 , 14987,50 , 15037,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 159,3 , 16482,24 , 4,4 , 4,0 , 4975,10 , 1815,8 , 2, 1, 7, 6, 7 }, // North Ndebele/Latin/Zimbabwe
+ { 182, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15051,29 , 15080,65 , 15145,14 , 15051,29 , 15080,65 , 15145,14 , 518,8 , 494,7 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16506,25 , 4,4 , 4,0 , 4985,9 , 1620,8 , 2, 0, 1, 6, 7 }, // Rombo/Latin/Tanzania
+ { 183, 9, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 15159,30 , 15189,47 , 85,14 , 15159,30 , 15189,47 , 85,14 , 526,6 , 501,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16531,21 , 0,4 , 4,0 , 4994,7 , 5001,6 , 2, 1, 1, 6, 7 }, // Tachelhit/Tifinagh/Morocco
+ { 183, 7, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 15236,30 , 15266,48 , 85,14 , 15236,30 , 15266,48 , 85,14 , 532,6 , 509,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16552,21 , 0,4 , 4,0 , 5007,10 , 5017,6 , 2, 1, 1, 6, 7 }, // Tachelhit/Latin/Morocco
+ { 184, 7, 3, 44, 160, 59, 37, 48, 45, 43, 122, 171, 187, 8220, 8221, 0,6 , 0,6 , 936,12 , 948,11 , 415,8 , 97,16 , 18,7 , 25,12 , 15314,28 , 15342,34 , 15376,14 , 15390,30 , 15420,51 , 15471,14 , 538,7 , 517,9 , 1197,7 , 1204,21 , 22,23 , {68,90,68}, 205,2 , 16573,53 , 0,4 , 4,0 , 5023,9 , 5032,8 , 2, 1, 6, 5, 6 }, // Kabyle/Latin/Algeria
+ { 185, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15485,28 , 15513,74 , 15587,14 , 15485,28 , 15513,74 , 15587,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 197,3 , 16626,26 , 4,4 , 4,0 , 5040,10 , 1685,6 , 0, 0, 1, 7, 7 }, // Nyankole/Latin/Uganda
+ { 186, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15601,28 , 15629,82 , 15711,14 , 15601,28 , 15629,82 , 15711,14 , 545,7 , 526,7 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16652,29 , 0,4 , 4,0 , 5050,6 , 5056,10 , 2, 0, 1, 6, 7 }, // Bena/Latin/Tanzania
+ { 187, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15725,28 , 15753,62 , 15815,14 , 15725,28 , 15753,62 , 15815,14 , 552,5 , 533,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16681,27 , 4,4 , 4,0 , 5066,8 , 1620,8 , 2, 0, 1, 6, 7 }, // Vunjo/Latin/Tanzania
+ { 188, 7, 132, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 15829,28 , 15857,44 , 15901,14 , 15829,28 , 15857,44 , 15901,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 16708,24 , 4,4 , 4,0 , 5074,9 , 2184,4 , 0, 0, 1, 6, 7 }, // Bambara/Latin/Mali
+ { 188, 75, 132, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Bambara/Nko/Mali
+ { 189, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15915,28 , 15943,64 , 16007,14 , 15915,28 , 15943,64 , 16007,14 , 557,2 , 542,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16218,24 , 4,4 , 4,0 , 5083,6 , 1191,5 , 2, 1, 7, 6, 7 }, // Embu/Latin/Kenya
+ { 190, 12, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 959,9 , 968,8 , 547,6 , 35,18 , 18,7 , 25,12 , 16021,28 , 16049,49 , 16098,14 , 16021,28 , 16049,49 , 16098,14 , 559,3 , 544,6 , 1225,6 , 5,17 , 22,23 , {85,83,68}, 6,1 , 16732,25 , 4,4 , 4,0 , 5089,3 , 5092,15 , 2, 1, 7, 6, 7 }, // Cherokee/Cherokee/United States
+ { 191, 7, 137, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 16112,27 , 16139,48 , 16187,14 , 16112,27 , 16139,48 , 16187,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,85,82}, 176,2 , 16757,21 , 41,6 , 4,0 , 5107,14 , 5121,5 , 2, 0, 1, 6, 7 }, // Morisyen/Latin/Mauritius
+ { 192, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 16201,28 , 16229,133 , 15145,14 , 16201,28 , 16229,133 , 15145,14 , 562,4 , 550,5 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16681,27 , 4,4 , 4,0 , 5126,10 , 1620,8 , 2, 0, 1, 6, 7 }, // Makonde/Latin/Tanzania
+ { 193, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 16362,36 , 16398,63 , 16461,14 , 16362,36 , 16398,63 , 16461,14 , 566,3 , 555,3 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16778,29 , 41,6 , 4,0 , 5136,8 , 5144,9 , 2, 0, 1, 6, 7 }, // Langi/Latin/Tanzania
+ { 194, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 16475,28 , 16503,66 , 16569,14 , 16475,28 , 16503,66 , 16569,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 197,3 , 16807,26 , 0,4 , 4,0 , 5153,7 , 5160,7 , 0, 0, 1, 7, 7 }, // Ganda/Latin/Uganda
+ { 195, 7, 239, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 16583,80 , 16583,80 , 85,14 , 16583,80 , 16583,80 , 85,14 , 569,8 , 558,7 , 45,4 , 5,17 , 22,23 , {90,77,87}, 131,1 , 0,7 , 4,4 , 4,0 , 5167,9 , 1809,6 , 2, 1, 1, 6, 7 }, // Bemba/Latin/Zambia
+ { 196, 7, 39, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 158,7 , 158,7 , 119,10 , 1663,27 , 37,5 , 8,10 , 16663,28 , 16691,73 , 16764,14 , 16663,28 , 16778,73 , 16764,14 , 68,2 , 65,2 , 45,4 , 5,17 , 22,23 , {67,86,69}, 277,1 , 16833,43 , 13,5 , 4,0 , 5176,12 , 5188,10 , 2, 1, 1, 6, 7 }, // Kabuverdianu/Latin/Cape Verde
+ { 197, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 16851,28 , 16879,51 , 16930,14 , 16851,28 , 16879,51 , 16930,14 , 577,2 , 565,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16218,24 , 4,4 , 4,0 , 5198,6 , 1191,5 , 2, 1, 7, 6, 7 }, // Meru/Latin/Kenya
+ { 198, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 16944,28 , 16972,53 , 17025,14 , 16944,28 , 16972,53 , 17025,14 , 579,6 , 567,10 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16876,26 , 4,4 , 4,0 , 5204,8 , 5212,12 , 2, 1, 7, 6, 7 }, // Kalenjin/Latin/Kenya
+ { 199, 7, 148, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 17039,23 , 17062,92 , 17154,14 , 17039,23 , 17062,92 , 17154,14 , 585,7 , 577,5 , 45,4 , 5,17 , 22,23 , {78,65,68}, 6,1 , 16902,22 , 4,4 , 4,0 , 5224,13 , 5237,8 , 2, 1, 1, 6, 7 }, // Nama/Latin/Namibia
+ { 200, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15725,28 , 15753,62 , 15815,14 , 15725,28 , 15753,62 , 15815,14 , 552,5 , 533,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16681,27 , 4,4 , 4,0 , 5245,9 , 1620,8 , 2, 0, 1, 6, 7 }, // Machame/Latin/Tanzania
+ { 201, 7, 82, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 456,8 , 456,8 , 1141,10 , 1690,23 , 37,5 , 8,10 , 17168,28 , 17196,72 , 3695,14 , 17168,28 , 17196,72 , 3695,14 , 592,16 , 582,16 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16924,11 , 13,5 , 4,0 , 5254,6 , 5260,11 , 2, 1, 1, 6, 7 }, // Colognian/Latin/Germany
+ { 202, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15725,28 , 17268,58 , 15145,14 , 15725,28 , 17268,58 , 15145,14 , 608,9 , 598,6 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16935,25 , 4,4 , 4,0 , 5271,3 , 1191,5 , 2, 1, 7, 6, 7 }, // Masai/Latin/Kenya
+ { 202, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15725,28 , 17268,58 , 15145,14 , 15725,28 , 17268,58 , 15145,14 , 608,9 , 598,6 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16960,28 , 4,4 , 4,0 , 5271,3 , 5274,8 , 2, 0, 1, 6, 7 }, // Masai/Latin/Tanzania
+ { 203, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17326,35 , 17361,65 , 17426,14 , 17326,35 , 17361,65 , 17426,14 , 617,6 , 604,6 , 45,4 , 5,17 , 22,23 , {85,71,88}, 197,3 , 16807,26 , 13,5 , 4,0 , 5282,7 , 5160,7 , 0, 0, 1, 7, 7 }, // Soga/Latin/Uganda
+ { 204, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17440,21 , 17461,75 , 85,14 , 17440,21 , 17461,75 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16988,23 , 4,4 , 114,6 , 5289,7 , 1191,5 , 2, 1, 7, 6, 7 }, // Luyia/Latin/Kenya
+ { 205, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17536,28 , 10012,60 , 15815,14 , 17536,28 , 10012,60 , 15815,14 , 623,9 , 610,8 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 17011,28 , 13,5 , 4,0 , 5296,6 , 5302,8 , 2, 0, 1, 6, 7 }, // Asu/Latin/Tanzania
+ { 206, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17564,28 , 17592,69 , 17661,14 , 17564,28 , 17592,69 , 17661,14 , 632,9 , 618,6 , 45,4 , 5,17 , 22,23 , {85,71,88}, 197,3 , 17039,28 , 4,4 , 4,0 , 5310,6 , 1685,6 , 0, 0, 1, 7, 7 }, // Teso/Latin/Uganda
+ { 206, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17564,28 , 17592,69 , 17661,14 , 17564,28 , 17592,69 , 17661,14 , 632,9 , 618,6 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 17067,27 , 4,4 , 4,0 , 5310,6 , 5316,5 , 2, 1, 7, 6, 7 }, // Teso/Latin/Kenya
+ { 207, 7, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,82,78}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Saho/Latin/Eritrea
+ { 208, 7, 132, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 17675,28 , 17703,53 , 17756,14 , 17675,28 , 17703,53 , 17756,14 , 641,6 , 624,6 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 17094,23 , 0,4 , 4,0 , 5321,11 , 5332,5 , 0, 0, 1, 6, 7 }, // Koyra Chiini/Latin/Mali
+ { 209, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15725,28 , 15753,62 , 15815,14 , 15725,28 , 15753,62 , 15815,14 , 552,5 , 533,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 16681,27 , 0,4 , 4,0 , 5337,6 , 1620,8 , 2, 0, 1, 6, 7 }, // Rwa/Latin/Tanzania
+ { 210, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17770,28 , 17798,69 , 17867,14 , 17770,28 , 17798,69 , 17867,14 , 647,2 , 630,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 17117,23 , 0,4 , 4,0 , 5343,6 , 1191,5 , 2, 1, 7, 6, 7 }, // Luo/Latin/Kenya
+ { 211, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 15485,28 , 15513,74 , 15587,14 , 15485,28 , 15513,74 , 15587,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 197,3 , 16626,26 , 4,4 , 4,0 , 5349,6 , 1685,6 , 0, 0, 1, 7, 7 }, // Chiga/Latin/Uganda
+ { 212, 7, 145, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 17881,28 , 17909,48 , 17957,14 , 17881,28 , 17909,48 , 17957,14 , 649,9 , 632,10 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 17140,22 , 13,5 , 4,0 , 5355,17 , 5372,6 , 2, 1, 1, 6, 7 }, // Central Morocco Tamazight/Latin/Morocco
+ { 213, 7, 132, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 17971,28 , 17999,54 , 17756,14 , 17971,28 , 17999,54 , 17756,14 , 641,6 , 624,6 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 17094,23 , 0,4 , 4,0 , 5378,15 , 5332,5 , 0, 0, 1, 6, 7 }, // Koyraboro Senni/Latin/Mali
+ { 214, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 18053,28 , 18081,63 , 18144,14 , 18053,28 , 18081,63 , 18144,14 , 658,5 , 642,8 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 17162,27 , 0,4 , 4,0 , 5393,9 , 1620,8 , 2, 0, 1, 6, 7 }, // Shambala/Latin/Tanzania
+ { 215, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 547,6 , 35,18 , 18,7 , 25,12 , 18158,33 , 18191,54 , 18245,19 , 18158,33 , 18191,54 , 18245,19 , 663,3 , 650,6 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 17189,10 , 8,5 , 4,0 , 5402,4 , 2662,4 , 2, 1, 7, 7, 7 }, // Bodo/Devanagari/India
+ { 218, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 18264,25 , 18289,45 , 18334,17 , 18264,25 , 18289,45 , 18264,25 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 17199,43 , 13,5 , 4,0 , 5406,7 , 5413,5 , 2, 1, 1, 6, 7 }, // Chechen/Cyrillic/Russia
+ { 219, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 976,8 , 976,8 , 1003,10 , 1713,23 , 37,5 , 8,10 , 18351,37 , 18388,68 , 11437,14 , 18351,37 , 18388,68 , 11437,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 17242,44 , 13,5 , 4,0 , 5418,19 , 5437,7 , 2, 1, 1, 6, 7 }, // Church/Cyrillic/Russia
+ { 220, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Chuvash/Cyrillic/Russia
+ { 230, 7, 49, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 18456,28 , 18484,50 , 18534,14 , 18456,28 , 18484,50 , 18534,14 , 666,5 , 656,6 , 45,4 , 5,17 , 22,23 , {67,68,70}, 210,2 , 17286,24 , 0,4 , 4,0 , 5444,8 , 5452,16 , 2, 1, 1, 6, 7 }, // Luba Katanga/Latin/Congo Kinshasa
+ { 231, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 984,10 , 984,10 , 156,8 , 622,18 , 37,5 , 8,10 , 18548,28 , 18576,65 , 3695,14 , 18641,35 , 18576,65 , 3695,14 , 671,5 , 662,8 , 445,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8436,19 , 13,5 , 4,0 , 5468,14 , 5482,10 , 2, 1, 1, 6, 7 }, // Luxembourgish/Latin/Luxembourg
+ { 236, 7, 21, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Walloon/Latin/Belgium
+ { 237, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 18676,28 , 18704,72 , 18776,14 , 18676,28 , 18704,72 , 18776,14 , 676,3 , 670,3 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17310,21 , 0,4 , 4,0 , 5492,5 , 5497,7 , 0, 0, 1, 6, 7 }, // Aghem/Latin/Cameroon
+ { 238, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 18790,28 , 18818,70 , 18888,14 , 18790,28 , 18818,70 , 18888,14 , 679,10 , 673,9 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17331,22 , 13,5 , 4,0 , 5504,5 , 5509,8 , 0, 0, 1, 6, 7 }, // Basaa/Latin/Cameroon
+ { 239, 7, 156, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 17971,28 , 18902,53 , 18955,14 , 17971,28 , 18902,53 , 18955,14 , 689,8 , 682,10 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 17094,23 , 0,4 , 4,0 , 5517,10 , 5527,5 , 0, 0, 1, 6, 7 }, // Zarma/Latin/Niger
+ { 240, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 18969,28 , 18997,45 , 19042,14 , 18969,28 , 18997,45 , 19042,14 , 697,5 , 692,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5532,5 , 1981,8 , 0, 0, 1, 6, 7 }, // Duala/Latin/Cameroon
+ { 241, 7, 187, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 19056,28 , 19084,50 , 19134,14 , 19056,28 , 19084,50 , 19134,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 17353,23 , 13,5 , 4,0 , 5537,5 , 5542,7 , 0, 0, 1, 6, 7 }, // Jola Fonyi/Latin/Senegal
+ { 242, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 19148,30 , 19178,85 , 19263,14 , 19148,30 , 19178,85 , 19263,14 , 702,7 , 698,9 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17376,23 , 13,5 , 4,0 , 5549,6 , 5555,7 , 0, 0, 1, 6, 7 }, // Ewondo/Latin/Cameroon
+ { 243, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 19277,29 , 19306,45 , 19351,14 , 19277,29 , 19306,45 , 19351,14 , 709,6 , 707,7 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17399,11 , 13,5 , 4,0 , 5562,5 , 5567,7 , 0, 0, 1, 6, 7 }, // Bafia/Latin/Cameroon
+ { 244, 7, 146, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19365,28 , 19393,59 , 19452,14 , 19365,28 , 19393,59 , 19452,14 , 715,8 , 714,10 , 45,4 , 5,17 , 22,23 , {77,90,78}, 278,3 , 0,7 , 41,6 , 4,0 , 5574,5 , 5579,10 , 2, 1, 7, 6, 7 }, // Makhuwa Meetto/Latin/Mozambique
+ { 245, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 19466,28 , 19494,74 , 19568,14 , 19466,28 , 19494,74 , 19568,14 , 723,5 , 724,5 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17410,17 , 4,4 , 4,0 , 5589,6 , 5595,7 , 0, 0, 1, 6, 7 }, // Mundang/Latin/Cameroon
+ { 246, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 19582,30 , 19612,89 , 19701,14 , 19582,30 , 19612,89 , 19701,14 , 728,4 , 729,4 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17427,20 , 13,5 , 4,0 , 5602,6 , 5608,7 , 0, 0, 1, 6, 7 }, // Kwasio/Latin/Cameroon
+ { 247, 7, 254, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 538,9 , 97,16 , 18,7 , 531,12 , 19715,38 , 19753,79 , 19832,14 , 19715,38 , 19753,79 , 19832,14 , 732,2 , 733,2 , 45,4 , 5,17 , 22,23 , {83,83,80}, 119,1 , 0,7 , 4,4 , 4,0 , 5615,9 , 0,0 , 2, 1, 1, 6, 7 }, // Nuer/Latin/South Sudan
+ { 248, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 994,11 , 994,11 , 227,6 , 1736,30 , 37,5 , 8,10 , 19846,21 , 19867,71 , 19938,14 , 19846,21 , 19867,71 , 19938,14 , 734,2 , 735,2 , 1231,5 , 1236,17 , 22,23 , {82,85,66}, 123,1 , 17447,47 , 13,5 , 4,0 , 5624,9 , 5633,9 , 2, 1, 1, 6, 7 }, // Sakha/Cyrillic/Russia
+ { 249, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19952,28 , 19980,60 , 20040,14 , 19952,28 , 19980,60 , 20040,14 , 736,9 , 737,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 192,3 , 17494,25 , 0,4 , 4,0 , 5642,9 , 5651,9 , 2, 0, 1, 6, 7 }, // Sangu/Latin/Tanzania
+ { 251, 7, 156, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 17971,28 , 17999,54 , 17756,14 , 17971,28 , 17999,54 , 17756,14 , 689,8 , 682,10 , 45,4 , 5,17 , 22,23 , {88,79,70}, 207,3 , 17094,23 , 0,4 , 4,0 , 5660,13 , 5527,5 , 0, 0, 1, 6, 7 }, // Tasawaq/Latin/Niger
+ { 252, 35, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 20054,30 , 20054,30 , 85,14 , 20054,30 , 20054,30 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 17519,15 , 4,4 , 4,0 , 5673,2 , 5675,4 , 2, 1, 1, 6, 7 }, // Vai/Vai/Liberia
+ { 252, 7, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 20084,48 , 20084,48 , 85,14 , 20084,48 , 20084,48 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 17534,20 , 4,4 , 4,0 , 5679,3 , 5682,8 , 2, 1, 1, 6, 7 }, // Vai/Latin/Liberia
+ { 253, 7, 206, 44, 8217, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 264,9 , 264,9 , 53,10 , 622,18 , 37,5 , 8,10 , 20132,28 , 20160,53 , 20213,14 , 20132,28 , 20160,53 , 20213,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 0,0 , 0,7 , 41,6 , 4,0 , 5690,6 , 5696,6 , 2, 0, 1, 6, 7 }, // Walser/Latin/Switzerland
+ { 254, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 20227,21 , 20248,71 , 20319,14 , 20227,21 , 20248,71 , 20319,14 , 745,8 , 746,8 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5702,6 , 5708,7 , 0, 0, 1, 6, 7 }, // Yangben/Latin/Cameroon
+ { 256, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 705,7 , 705,7 , 269,6 , 372,22 , 37,5 , 8,10 , 20333,28 , 20361,54 , 3391,14 , 20333,28 , 20361,54 , 3391,14 , 753,12 , 754,11 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 5715,9 , 2427,6 , 2, 1, 1, 6, 7 }, // Asturian/Latin/Spain
+ { 257, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 1005,11 , 1005,11 , 1016,16 , 1032,9 , 53,10 , 1566,18 , 37,5 , 8,10 , 20415,60 , 20415,60 , 20475,25 , 20415,60 , 20415,60 , 20475,25 , 765,8 , 765,13 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17554,12 , 8,5 , 4,0 , 5724,5 , 5729,7 , 0, 0, 1, 6, 7 }, // Ngomba/Latin/Cameroon
+ { 258, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 1766,10 , 80,17 , 37,5 , 8,10 , 20500,54 , 20500,54 , 20554,21 , 20500,54 , 20500,54 , 20554,21 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17566,16 , 41,6 , 4,0 , 5736,4 , 5740,7 , 0, 0, 1, 6, 7 }, // Kako/Latin/Cameroon
+ { 259, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1566,18 , 37,5 , 8,10 , 20575,49 , 20575,49 , 20624,21 , 20575,49 , 20575,49 , 20624,21 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17582,12 , 8,5 , 4,0 , 5747,5 , 5752,7 , 0, 0, 1, 6, 7 }, // Meta/Latin/Cameroon
+ { 260, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 1776,32 , 37,5 , 8,10 , 20645,111 , 20645,111 , 85,14 , 20645,111 , 20645,111 , 85,14 , 773,9 , 778,8 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17594,16 , 8,5 , 4,0 , 5759,16 , 5775,7 , 0, 0, 1, 6, 7 }, // Ngiemboon/Latin/Cameroon
+ { 261, 7, 197, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Aragonese/Latin/Spain
+ { 290, 11, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 7, 7 }, // Manipuri/Bengali/India
+ { 309, 100, 232, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {86,78,68}, 336,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Tai Dam/Tai Viet/Vietnam
+ { 312, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Akoose/Latin/Cameroon
+ { 313, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 547,6 , 35,18 , 18,7 , 25,12 , 20756,87 , 20756,87 , 85,14 , 20756,87 , 20756,87 , 20843,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 41,6 , 4,0 , 5782,12 , 5794,22 , 2, 1, 7, 6, 7 }, // Lakota/Latin/United States
+ { 314, 9, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 15159,30 , 20857,48 , 85,14 , 15159,30 , 20857,48 , 85,14 , 526,6 , 501,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16531,21 , 0,4 , 4,0 , 5816,8 , 5001,6 , 2, 1, 1, 6, 7 }, // Standard Moroccan Tamazight/Tifinagh/Morocco
+ { 315, 7, 43, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,76,80}, 6,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Mapuche/Latin/Chile
+ { 316, 1, 103, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 20905,58 , 20905,58 , 20963,14 , 20905,58 , 20905,58 , 20963,14 , 782,3 , 786,3 , 45,4 , 5,17 , 22,23 , {73,81,68}, 44,5 , 17610,20 , 13,5 , 4,0 , 5824,14 , 5838,5 , 0, 0, 6, 5, 6 }, // Central Kurdish/Arabic/Iraq
+ { 316, 1, 102, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 20905,58 , 20905,58 , 20963,14 , 20905,58 , 20905,58 , 20963,14 , 782,3 , 786,3 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 17630,19 , 13,5 , 4,0 , 5824,14 , 5843,5 , 0, 0, 6, 5, 5 }, // Central Kurdish/Arabic/Iran
+ { 317, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 180,7 , 180,7 , 113,6 , 622,18 , 55,4 , 59,9 , 20977,28 , 21005,53 , 21058,14 , 20977,28 , 21005,53 , 21058,14 , 785,9 , 789,10 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 17649,27 , 13,5 , 4,0 , 5848,14 , 5862,6 , 2, 1, 1, 6, 7 }, // Lower Sorbian/Latin/Germany
+ { 318, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 180,7 , 180,7 , 113,6 , 622,18 , 543,12 , 59,9 , 21072,28 , 21100,53 , 21153,14 , 21072,28 , 21100,53 , 21153,14 , 785,9 , 799,9 , 1253,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 17676,29 , 13,5 , 4,0 , 5868,15 , 5883,6 , 2, 1, 1, 6, 7 }, // Upper Sorbian/Latin/Germany
+ { 319, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Kenyang/Latin/Cameroon
+ { 320, 7, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,65,68}, 240,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Mohawk/Latin/Canada
+ { 321, 75, 91, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,78,70}, 216,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Nko/Nko/Guinea
+ { 322, 7, 260, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 1041,8 , 1041,8 , 156,8 , 1808,27 , 37,5 , 8,10 , 21167,28 , 21195,69 , 21264,14 , 21167,28 , 21195,69 , 21264,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 13,5 , 4,0 , 5889,9 , 5898,6 , 2, 1, 1, 6, 7 }, // Prussian/Latin/World
+ { 323, 7, 90, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,84,81}, 305,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Kiche/Latin/Guatemala
+ { 324, 7, 205, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 190,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 1, 6, 7 }, // Southern Sami/Latin/Sweden
+ { 325, 7, 205, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 190,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 1, 6, 7 }, // Lule Sami/Latin/Sweden
+ { 326, 7, 73, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 640,8 , 1835,18 , 220,4 , 224,9 , 21278,28 , 21306,70 , 85,14 , 21278,28 , 21376,73 , 21449,14 , 794,3 , 808,3 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 17705,11 , 13,5 , 4,0 , 5904,11 , 5915,5 , 2, 1, 1, 6, 7 }, // Inari Sami/Latin/Finland
+ { 327, 7, 73, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Skolt Sami/Latin/Finland
+ { 328, 7, 13, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {65,85,68}, 340,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Warlpiri/Latin/Australia
+ { 346, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 726,4 , 1258,39 , 22,23 , {73,82,82}, 342,3 , 17716,27 , 8,5 , 4,0 , 5920,7 , 3252,5 , 0, 0, 6, 5, 5 }, // Mazanderani/Arabic/Iran
+ { 349, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 5927,11 , 0,0 , 0, 0, 6, 5, 5 }, // Northern Luri/Arabic/Iran
+ { 349, 1, 103, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,81,68}, 44,5 , 0,7 , 8,5 , 4,0 , 5927,11 , 0,0 , 0, 0, 6, 5, 6 }, // Northern Luri/Arabic/Iraq
+ { 357, 6, 97, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 165,5 , 165,5 , 1049,5 , 1049,5 , 394,8 , 423,14 , 175,6 , 192,13 , 1980,28 , 1980,28 , 2008,14 , 1980,28 , 1980,28 , 2008,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {72,75,68}, 134,3 , 17743,11 , 4,4 , 4,0 , 5938,2 , 5940,14 , 2, 1, 7, 6, 7 }, // Cantonese/Traditional Han/Hong Kong
+ { 357, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 165,5 , 165,5 , 1049,5 , 1049,5 , 394,8 , 402,13 , 175,6 , 181,11 , 1959,21 , 1980,28 , 2008,14 , 1959,21 , 1980,28 , 2008,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 243,1 , 3122,13 , 4,4 , 4,0 , 5954,2 , 5956,7 , 2, 1, 7, 6, 7 }, // Cantonese/Simplified Han/China
+ { 358, 138, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 159,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Osage/Osage/United States
+ { 360, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Ido/Latin/World
+ { 361, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Lojban/Latin/World
+ { 362, 7, 106, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Sicilian/Latin/Italy
+ { 363, 1, 102, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 5 }, // Southern Kurdish/Arabic/Iran
+ { 364, 1, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 176,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Western Balochi/Arabic/Pakistan
+ { 365, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 919,9 , 928,8 , 547,6 , 35,18 , 18,7 , 25,12 , 21463,25 , 21488,56 , 21544,14 , 21463,25 , 21488,56 , 21544,14 , 0,2 , 0,2 , 1297,8 , 5,17 , 22,23 , {80,72,80}, 179,1 , 17754,56 , 4,4 , 4,0 , 5963,8 , 4715,9 , 2, 1, 7, 6, 7 }, // Cebuano/Latin/Philippines
+ { 366, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Erzya/Cyrillic/Russia
+ { 367, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 159,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Chickasaw/Latin/United States
+ { 368, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 159,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Muscogee/Latin/United States
+ { 369, 7, 172, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,76,78}, 273,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Silesian/Latin/Poland
+ { 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 } // trailing 0s
+};
+
+static const ushort list_pattern_part_data[] = {
+0x25, 0x31, 0x2c, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x64, 0x68, 0x65,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x1363, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x12a5, 0x1293, 0x20, 0x25, 0x32, 0x25, 0x31,
+0x20, 0x12a5, 0x1293, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x648, 0x25, 0x32, 0x25, 0x31, 0x20, 0x587, 0x20, 0x25, 0x32, 0x25,
+0x31, 0x20, 0x986, 0x9f0, 0x9c1, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x76, 0x259, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65,
+0x74, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x98f, 0x9ac, 0x982, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xf51, 0xf44, 0xf0b,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x68, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x438, 0x20, 0x25, 0x32, 0x25, 0x31,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x1014, 0x103e, 0x1004, 0x1037, 0x103a, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x456, 0x20, 0x25, 0x32,
+0x25, 0x31, 0x20, 0x1793, 0x17b7, 0x1784, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x1793, 0x17b7, 0x1784, 0x200b, 0x25, 0x32, 0x25, 0x31,
+0x20, 0x69, 0x20, 0x25, 0x32, 0x25, 0x31, 0x3001, 0x25, 0x32, 0x25, 0x31, 0x548c, 0x25, 0x32, 0x25, 0x31, 0x53ca, 0x25, 0x32,
+0x25, 0x31, 0x20, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6f, 0x67, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x61,
+0x6e, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6b, 0x61, 0x6a,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6a, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65, 0x74, 0x20, 0x25, 0x32, 0x25,
+0x31, 0x20, 0x61, 0x67, 0x75, 0x73, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x10d3,
+0x10d0, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x75, 0x6e, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x3ba, 0x3b1, 0x3b9, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x61, 0x6d, 0x6d, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xa85, 0xaa8, 0xac7, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0x64, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x5d5, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20,
+0x914, 0x930, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x914, 0x930, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xe9, 0x73, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x2c, 0x20, 0x64, 0x61, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x64, 0x61, 0x6e, 0x20, 0x25, 0x32,
+0x25, 0x31, 0x2c, 0x20, 0x61, 0x67, 0x75, 0x73, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x6c, 0x61, 0x6e, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x20, 0x6c, 0x61, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0xcae, 0xca4, 0xccd, 0xca4, 0xcc1, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0xcae, 0xca4, 0xccd, 0xca4, 0xcc1, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x436, 0x4d9, 0x43d, 0x435,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x436, 0x430, 0x43d, 0x430, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xbc0f, 0x20, 0x25, 0x32,
+0x25, 0x31, 0x20, 0xfb, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xec1, 0xea5, 0xeb0, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x75,
+0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6d, 0x70, 0xe9, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x69, 0x72, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x2c, 0x20, 0x25, 0x32, 0x20, 0xd0e, 0xd28, 0xd4d, 0xd28, 0xd3f, 0xd35, 0x25, 0x31, 0x20, 0xd15, 0xd42, 0xd1f,
+0xd3e, 0xd24, 0xd46, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x75, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x75, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x20, 0x906, 0x923, 0x93f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x25, 0x32, 0x25, 0x31, 0x20, 0x930, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0xb13, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xb13, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x627, 0x648, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x627, 0x648, 0x20, 0x25, 0x32,
+0x25, 0x31, 0x60c, 0x200f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x648, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x648, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0xa05, 0xa24, 0xa47, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x75, 0x74, 0x61, 0x71, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0x75, 0x74, 0x61, 0x71, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x219, 0x69, 0x20, 0x25, 0x32,
+0x25, 0x31, 0x20, 0x4d5, 0x43c, 0x4d5, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x6fd, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20,
+0x6fd, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0xdc3, 0xdc4, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xdc3, 0xdc4, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x20, 0x61, 0xa0, 0x25, 0x32, 0x25, 0x31, 0x20, 0x69, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x69,
+0x79, 0x6f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x79, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6e, 0x61, 0x20, 0x25, 0x32,
+0x25, 0x31, 0x20, 0x6f, 0x63, 0x68, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xbae, 0xbb1, 0xbcd, 0xbb1, 0xbc1, 0xbae, 0xbcd, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0x4bb, 0x4d9, 0x43c, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xc2e, 0xc30, 0xc3f, 0xc2f, 0xc41, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x20, 0xe41, 0xe25, 0xe30, 0x25, 0x32, 0x25, 0x31, 0xe41, 0xe25, 0xe30, 0x25, 0x32, 0x25, 0x31, 0x20,
+0x6d, 0x6f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x76, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x77, 0x65, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x60c, 0x20, 0x627, 0x648, 0x631, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x627, 0x648, 0x631, 0x20, 0x25, 0x32,
+0x25, 0x32, 0x60c, 0x20, 0x25, 0x31, 0x25, 0x31, 0x20, 0x76, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x76, 0xe0, 0x20,
+0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x61, 0x28, 0x63, 0x29, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x28, 0x63, 0x29,
+0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x5d0, 0x5d5, 0x5df, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x6e, 0x65, 0x2d, 0x25,
+0x32, 0x25, 0x31, 0x20, 0x6e, 0x65, 0x2d, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x6e, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31,
+0x2c, 0x20, 0x6b, 0x70, 0x6c, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6b, 0x70, 0x6c, 0x65, 0x20, 0x25, 0x32, 0x25,
+0x31, 0x2c, 0x20, 0x61, 0x74, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x74, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20,
+0x61, 0x6b, 0x6b, 0x65, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x6b, 0x6b, 0x65, 0x64, 0x20, 0x25, 0x32, 0x25,
+0x31, 0x2c, 0x20, 0x13a0, 0x13b4, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x13a0, 0x13b4, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x438,
+0x486, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x28, 0x6e, 0x29, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x443, 0x43e, 0x43d,
+0x43d, 0x430, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x14b, 0x301, 0x67, 0x25b, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20,
+0x1e3f, 0x62, 0x25b, 0x6e, 0x20, 0x14b, 0x301, 0x67, 0x25b, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x70, 0x254, 0x70, 0x20, 0x25,
+0x32, 0x25, 0x31, 0x20, 0x62, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x540c, 0x25, 0x32
+};
+
+static const ushort date_format_data[] = {
+0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d,
+0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c,
+0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2d, 0x4d, 0x4d,
+0x2d, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64,
+0x64, 0x64, 0x64, 0x64, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64,
+0x64, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x64,
+0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x64, 0x200f, 0x2f, 0x4d, 0x200f, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x64,
+0x64, 0x64, 0x64, 0x60c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2e, 0x4d,
+0x4d, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x569, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20,
+0x64, 0x64, 0x64, 0x64, 0x64, 0x2d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20,
+0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79,
+0x79, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x2f, 0x4d, 0x2f, 0x64, 0x79, 0x79, 0x79, 0x79, 0x28, 0x27, 0x65,
+0x27, 0x29, 0x27, 0x6b, 0x6f, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x27, 0x72, 0x65, 0x6e, 0x27, 0x20, 0x64, 0x28, 0x27,
+0x61, 0x27, 0x29, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2f, 0x4d, 0x2f, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c,
+0x20, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf63, 0xf7c, 0xf0b, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0xf5a,
+0xf7a, 0xf66, 0xf0b, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x20, 0x27, 0x433, 0x27, 0x2e, 0x64, 0x64, 0x64,
+0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x433, 0x27, 0x2e, 0x64,
+0x64, 0x2d, 0x4d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x104a, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x104a,
+0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20,
+0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2f, 0x4d,
+0x2f, 0x64, 0x79, 0x79, 0x79, 0x79, 0x5e74, 0x4d, 0x6708, 0x64, 0x65e5, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2f, 0x4d, 0x2f, 0x79,
+0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x5e74, 0x4d, 0x6708, 0x64, 0x65e5, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2e,
+0x20, 0x4d, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x2e, 0x20, 0x4d,
+0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x2e, 0x20, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x2e, 0x64, 0x64,
+0x64, 0x64, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2e, 0x4d, 0x4d,
+0x2e, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x27, 0x64, 0x65, 0x6e, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d,
+0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2d, 0x4d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2f,
+0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x4d, 0x2f, 0x64, 0x2f, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64,
+0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79,
+0x79, 0x79, 0x2f, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 0x79, 0x79, 0x2d, 0x4d, 0x4d, 0x2d, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
+0x2c, 0x20, 0x64, 0x2d, 0x27, 0x61, 0x27, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79,
+0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79,
+0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x27, 0x6d, 0x68, 0x27, 0x20,
+0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x27, 0x64, 0x65,
+0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64,
+0x2c, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20,
+0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20,
+0x5d1, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x20, 0x4d, 0x4d, 0x2e, 0x20,
+0x64, 0x64, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2e, 0x2c, 0x20, 0x64, 0x64,
+0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x20, 0x27, 0x6c, 0x65, 0x27, 0x20, 0x64, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x4d,
+0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x436, 0x27, 0x2e, 0x20, 0x64, 0x20,
+0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x2d, 0x27, 0x436, 0x27, 0x2e, 0x2c,
+0x20, 0x64, 0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x2e, 0x20, 0x4d, 0x2e, 0x20,
+0x64, 0x2e, 0x79, 0x79, 0x79, 0x79, 0xb144, 0x20, 0x4d, 0xc6d4, 0x20, 0x64, 0xc77c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
+0x64, 0x64, 0x20, 0xe97, 0xeb5, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64,
+0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x20, 0x27, 0x67, 0x61, 0x64, 0x61, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d,
+0x4d, 0x4d, 0x4d, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x6d, 0x27, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x20,
+0x27, 0x64, 0x27, 0x2e, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79,
+0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64,
+0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x27, 0x74, 0x61, 0x27, 0x2019, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79,
+0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x4d, 0x4d, 0x2e, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x43e,
+0x43d, 0x44b, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x27, 0x44b, 0x43d, 0x27, 0x20, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64,
+0x20, 0x27, 0x433, 0x430, 0x440, 0x430, 0x433, 0x27, 0x64, 0x64, 0x64, 0x64, 0x20, 0x62f, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20,
+0x62f, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x27, 0x69, 0x6c, 0x73, 0x27, 0x20,
+0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x2e, 0x64, 0x64,
+0x64, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x64,
+0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x430, 0x437,
+0x27, 0x64, 0x2e, 0x20, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x2e, 0x20, 0x79, 0x79,
+0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64,
+0x64, 0x64, 0x64, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64,
+0x64, 0x64, 0x20, 0x64, 0x64, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x65, 0x27,
+0x20, 0x79, 0x79, 0x79, 0x79, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 0x2f, 0x79, 0x79, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c,
+0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x435, 0x43b, 0x27, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x4d,
+0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0xe17, 0xe35,
+0xe48, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d,
+0x4d, 0x4d, 0xf60, 0xf72, 0xf0b, 0xf5a, 0xf7a, 0xf66, 0xf0b, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
+0x1363, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x1218, 0x12d3, 0x120d, 0x1272, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64,
+0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20,
+0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x20, 0x64, 0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x60c, 0x20, 0x64, 0x64, 0x64,
+0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27,
+0x440, 0x27, 0x2e, 0x64, 0x64, 0x64, 0x64, 0x60c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x60c, 0x20, 0x79, 0x79, 0x79,
+0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79,
+0x79, 0x79, 0x79, 0x20, 0x646, 0x686, 0x6cc, 0x20, 0x6cc, 0x6cc, 0x644, 0x20, 0x64, 0x20, 0x646, 0x686, 0x6cc, 0x20, 0x4d, 0x4d,
+0x4d, 0x4d, 0x20, 0x64, 0x64, 0x64, 0x64, 0x20, 0x6a9, 0x648, 0x646, 0x6cc, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d,
+0x4d, 0x27, 0x61, 0x27, 0x20, 0x27, 0x64, 0x27, 0x2e, 0x20, 0x64, 0x27, 0x69, 0x64, 0x27, 0x64, 0x64, 0x64, 0x64, 0x2c,
+0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x5d8,
+0x5df, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d,
+0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x20, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x79, 0x79,
+0x2f, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d,
+0x4d, 0x20, 0x64, 0x64, 0x64, 0x2d, 0x4d, 0x2d, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x64, 0x20, 0x27, 0x64, 0x69,
+0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x61, 0x6c, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64,
+0x64, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x20, 0x27, 0x6c, 0x69, 0x61, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79,
+0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79,
+0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x27, 0x64, 0x69, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d,
+0x20, 0x27, 0x64, 0x69, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x27, 0x64, 0xe4, 0x27,
+0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64,
+0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x43b, 0x27, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x79, 0x79, 0x79, 0x79,
+0x20, 0x27, 0x441, 0x44b, 0x43b, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x20, 0x27, 0x43a, 0x4af, 0x43d, 0x44d, 0x27,
+0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2f, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64,
+0x20, 0x2c, 0x20, 0x27, 0x6c, 0x79, 0x25b, 0x27, 0x30c, 0x2bc, 0x20, 0x64, 0x20, 0x27, 0x6e, 0x61, 0x27, 0x20, 0x4d, 0x4d,
+0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27,
+0x6d, 0x65, 0x74, 0x74, 0x61, 0x73, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x64, 0x64, 0x64, 0x64, 0x2c,
+0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79
+};
+
+static const ushort time_format_data[] = {
+0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x68, 0x3a,
+0x6d, 0x6d, 0x20, 0x41, 0x50, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x20, 0x74, 0x48, 0x48, 0x3a,
+0x6d, 0x6d, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x2c, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x6d, 0x48,
+0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x41, 0x50, 0x20, 0x68, 0x2e, 0x6d, 0x6d, 0x41, 0x50, 0x20, 0x68, 0x2e,
+0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x28, 0x74, 0x29, 0xf46,
+0xf74, 0xf0b, 0xf5a, 0xf7c, 0xf51, 0xf0b, 0x20, 0x68, 0x20, 0xf66, 0xf90, 0xf62, 0xf0b, 0xf58, 0xf0b, 0x20, 0x6d, 0x6d, 0x20, 0x41,
+0x50, 0xf46, 0xf74, 0xf0b, 0xf5a, 0xf7c, 0xf51, 0xf0b, 0x20, 0x68, 0x20, 0xf66, 0xf90, 0xf62, 0xf0b, 0xf58, 0xf0b, 0x20, 0x6d, 0x6d,
+0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x20, 0x74, 0x42, 0x20, 0x48, 0x3a, 0x6d, 0x6d, 0x74, 0x20, 0x48, 0x48, 0x3a, 0x6d,
+0x6d, 0x3a, 0x73, 0x73, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x2c, 0x20, 0x74, 0x41, 0x50, 0x68, 0x3a, 0x6d,
+0x6d, 0x74, 0x20, 0x41, 0x50, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x41, 0x50, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73,
+0x73, 0x20, 0x5b, 0x74, 0x5d, 0x48, 0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x48, 0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74,
+0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74, 0x48, 0x2d, 0x27, 0x61, 0x27, 0x20, 0x27,
+0x68, 0x6f, 0x72, 0x6f, 0x27, 0x20, 0x27, 0x6b, 0x61, 0x6a, 0x27, 0x20, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x48, 0x20,
+0x27, 0x68, 0x27, 0x20, 0x6d, 0x6d, 0x20, 0x27, 0x6d, 0x69, 0x6e, 0x27, 0x20, 0x73, 0x73, 0x20, 0x27, 0x73, 0x27, 0x20,
+0x74, 0x48, 0x48, 0x20, 0x27, 0x68, 0x27, 0x20, 0x6d, 0x6d, 0x48, 0x48, 0x20, 0x27, 0x68, 0x27, 0x20, 0x6d, 0x6d, 0x20,
+0x27, 0x6d, 0x69, 0x6e, 0x27, 0x20, 0x73, 0x73, 0x20, 0x27, 0x73, 0x27, 0x20, 0x74, 0x48, 0x48, 0x2e, 0x6d, 0x6d, 0x3a,
+0x73, 0x73, 0x20, 0x27, 0x68, 0x27, 0x20, 0x74, 0x68, 0x68, 0x3a, 0x6d, 0x6d, 0x20, 0x41, 0x50, 0x68, 0x68, 0x3a, 0x6d,
+0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x20, 0x74, 0x48, 0x6642, 0x6d, 0x6d, 0x5206, 0x73, 0x73, 0x79d2, 0x20, 0x74, 0x41,
+0x50, 0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x41, 0x50, 0x20, 0x68, 0xc2dc, 0x20, 0x6d, 0xbd84, 0x20, 0x73, 0xcd08, 0x20, 0x74, 0x48,
+0x20, 0xec2, 0xea1, 0xe87, 0x20, 0x6d, 0x20, 0xe99, 0xeb2, 0xe97, 0xeb5, 0x20, 0x73, 0x73, 0x20, 0xea7, 0xeb4, 0xe99, 0xeb2, 0xe97,
+0xeb5, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x28, 0x74, 0x29, 0x27, 0x6b, 0x6c, 0x27, 0x2e, 0x20,
+0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x41, 0x50, 0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73,
+0x20, 0x74, 0x48, 0x20, 0xe19, 0xe32, 0xe2c, 0xe34, 0xe01, 0xe32, 0x20, 0x6d, 0x6d, 0x20, 0xe19, 0xe32, 0xe17, 0xe35, 0x20, 0x73,
+0x73, 0x20, 0xe27, 0xe34, 0xe19, 0xe32, 0xe17, 0xe35, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x41, 0x50, 0x20, 0x27, 0x67, 0x61, 0x27,
+0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x41, 0x50, 0x20, 0x27, 0x67, 0x61, 0x27, 0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73,
+0x20, 0x74, 0x27, 0x4b, 0x6c, 0x27, 0x2e, 0x20, 0x48, 0x2e, 0x6d, 0x6d, 0x27, 0x4b, 0x6c, 0x6f, 0x63, 0x6b, 0x27, 0x20,
+0x48, 0x2e, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x28, 0x74, 0x29, 0x74, 0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73,
+0x20, 0x41, 0x50, 0x48, 0x3a, 0x6d, 0x6d, 0x20, 0x27, 0x68, 0x6f, 0x64, 0x17a, 0x27, 0x2e
+};
+
+static const ushort days_data[] = {
+0x53, 0x75, 0x6e, 0x3b, 0x4d, 0x6f, 0x6e, 0x3b, 0x54, 0x75, 0x65, 0x3b, 0x57, 0x65, 0x64, 0x3b, 0x54, 0x68, 0x75, 0x3b,
+0x46, 0x72, 0x69, 0x3b, 0x53, 0x61, 0x74, 0x3b, 0x53, 0x75, 0x6e, 0x64, 0x61, 0x79, 0x3b, 0x4d, 0x6f, 0x6e, 0x64, 0x61,
+0x79, 0x3b, 0x54, 0x75, 0x65, 0x73, 0x64, 0x61, 0x79, 0x3b, 0x57, 0x65, 0x64, 0x6e, 0x65, 0x73, 0x64, 0x61, 0x79, 0x3b,
+0x54, 0x68, 0x75, 0x72, 0x73, 0x64, 0x61, 0x79, 0x3b, 0x46, 0x72, 0x69, 0x64, 0x61, 0x79, 0x3b, 0x53, 0x61, 0x74, 0x75,
+0x72, 0x64, 0x61, 0x79, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x57, 0x3b, 0x54, 0x3b, 0x46, 0x3b, 0x53, 0x3b, 0x37,
+0x3b, 0x31, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x44, 0x69, 0x6c, 0x3b, 0x57, 0x69, 0x78,
+0x3b, 0x51, 0x69, 0x62, 0x3b, 0x52, 0x6f, 0x62, 0x3b, 0x4b, 0x61, 0x6d, 0x3b, 0x4a, 0x69, 0x6d, 0x3b, 0x53, 0x61, 0x6e,
+0x3b, 0x44, 0x69, 0x6c, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x57, 0x69, 0x69, 0x78, 0x61, 0x74, 0x61, 0x3b, 0x51, 0x69, 0x62,
+0x78, 0x61, 0x74, 0x61, 0x3b, 0x52, 0x6f, 0x6f, 0x62, 0x69, 0x69, 0x3b, 0x4b, 0x61, 0x6d, 0x69, 0x69, 0x73, 0x61, 0x3b,
+0x4a, 0x69, 0x6d, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x53, 0x61, 0x6e, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x44, 0x3b, 0x57, 0x3b,
+0x51, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x53, 0x6f, 0x2e, 0x3b, 0x4d, 0x61, 0x2e, 0x3b, 0x44, 0x69,
+0x2e, 0x3b, 0x57, 0x6f, 0x2e, 0x3b, 0x44, 0x6f, 0x2e, 0x3b, 0x56, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0x6f,
+0x6e, 0x64, 0x61, 0x67, 0x3b, 0x4d, 0x61, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x44, 0x69, 0x6e, 0x73, 0x64, 0x61, 0x67,
+0x3b, 0x57, 0x6f, 0x65, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x44, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x64, 0x61, 0x67, 0x3b,
+0x56, 0x72, 0x79, 0x64, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x74, 0x65, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x53, 0x3b, 0x4d, 0x3b,
+0x44, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x64, 0x69, 0x65, 0x3b, 0x68, 0xeb, 0x6e, 0x3b, 0x6d, 0x61,
+0x72, 0x3b, 0x6d, 0xeb, 0x72, 0x3b, 0x65, 0x6e, 0x6a, 0x3b, 0x70, 0x72, 0x65, 0x3b, 0x73, 0x68, 0x74, 0x3b, 0x65, 0x20,
+0x64, 0x69, 0x65, 0x6c, 0x3b, 0x65, 0x20, 0x68, 0xeb, 0x6e, 0xeb, 0x3b, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x74, 0xeb, 0x3b,
+0x65, 0x20, 0x6d, 0xeb, 0x72, 0x6b, 0x75, 0x72, 0xeb, 0x3b, 0x65, 0x20, 0x65, 0x6e, 0x6a, 0x74, 0x65, 0x3b, 0x65, 0x20,
+0x70, 0x72, 0x65, 0x6d, 0x74, 0x65, 0x3b, 0x65, 0x20, 0x73, 0x68, 0x74, 0x75, 0x6e, 0xeb, 0x3b, 0x64, 0x3b, 0x68, 0x3b,
+0x6d, 0x3b, 0x6d, 0x3b, 0x65, 0x3b, 0x70, 0x3b, 0x73, 0x68, 0x3b, 0x44, 0x69, 0x65, 0x3b, 0x48, 0xeb, 0x6e, 0x3b, 0x4d,
+0x61, 0x72, 0x3b, 0x4d, 0xeb, 0x72, 0x3b, 0x45, 0x6e, 0x6a, 0x3b, 0x50, 0x72, 0x65, 0x3b, 0x53, 0x68, 0x74, 0x3b, 0x12a5,
+0x1211, 0x12f5, 0x3b, 0x1230, 0x129e, 0x3b, 0x121b, 0x12ad, 0x1230, 0x3b, 0x1228, 0x1261, 0x12d5, 0x3b, 0x1210, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d,
+0x1265, 0x3b, 0x1245, 0x12f3, 0x121c, 0x3b, 0x12a5, 0x1211, 0x12f5, 0x3b, 0x1230, 0x129e, 0x3b, 0x121b, 0x12ad, 0x1230, 0x129e, 0x3b, 0x1228, 0x1261,
+0x12d5, 0x3b, 0x1210, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d, 0x1265, 0x3b, 0x1245, 0x12f3, 0x121c, 0x3b, 0x12a5, 0x3b, 0x1230, 0x3b, 0x121b, 0x3b,
+0x1228, 0x3b, 0x1210, 0x3b, 0x12d3, 0x3b, 0x1245, 0x3b, 0x627, 0x644, 0x623, 0x62d, 0x62f, 0x3b, 0x627, 0x644, 0x627, 0x62b, 0x646, 0x64a,
+0x646, 0x3b, 0x627, 0x644, 0x62b, 0x644, 0x627, 0x62b, 0x627, 0x621, 0x3b, 0x627, 0x644, 0x623, 0x631, 0x628, 0x639, 0x627, 0x621, 0x3b,
+0x627, 0x644, 0x62e, 0x645, 0x64a, 0x633, 0x3b, 0x627, 0x644, 0x62c, 0x645, 0x639, 0x629, 0x3b, 0x627, 0x644, 0x633, 0x628, 0x62a, 0x3b,
+0x62d, 0x3b, 0x646, 0x3b, 0x62b, 0x3b, 0x631, 0x3b, 0x62e, 0x3b, 0x62c, 0x3b, 0x633, 0x3b, 0x56f, 0x56b, 0x580, 0x3b, 0x565, 0x580,
+0x56f, 0x3b, 0x565, 0x580, 0x584, 0x3b, 0x579, 0x580, 0x584, 0x3b, 0x570, 0x576, 0x563, 0x3b, 0x578, 0x582, 0x580, 0x3b, 0x577, 0x562,
+0x569, 0x3b, 0x56f, 0x56b, 0x580, 0x561, 0x56f, 0x56b, 0x3b, 0x565, 0x580, 0x56f, 0x578, 0x582, 0x577, 0x561, 0x562, 0x569, 0x56b, 0x3b,
+0x565, 0x580, 0x565, 0x584, 0x577, 0x561, 0x562, 0x569, 0x56b, 0x3b, 0x579, 0x578, 0x580, 0x565, 0x584, 0x577, 0x561, 0x562, 0x569, 0x56b,
+0x3b, 0x570, 0x56b, 0x576, 0x563, 0x577, 0x561, 0x562, 0x569, 0x56b, 0x3b, 0x578, 0x582, 0x580, 0x562, 0x561, 0x569, 0x3b, 0x577, 0x561,
+0x562, 0x561, 0x569, 0x3b, 0x53f, 0x3b, 0x535, 0x3b, 0x535, 0x3b, 0x549, 0x3b, 0x540, 0x3b, 0x548, 0x3b, 0x547, 0x3b, 0x9a6, 0x9c7,
+0x993, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x3b,
+0x9b6, 0x9c1, 0x995, 0x9cd, 0x9f0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x3b, 0x9a6, 0x9c7, 0x993, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b8, 0x9cb, 0x9ae,
+0x9ac, 0x9be, 0x9f0, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x9ac, 0x9be, 0x9f0, 0x3b,
+0x9ac, 0x9c3, 0x9b9, 0x9b8, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9f0, 0x9ac, 0x9be, 0x9f0,
+0x3b, 0x9b6, 0x9a8, 0x9bf, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9a6, 0x3b, 0x9b8, 0x3b, 0x9ae, 0x3b, 0x9ac, 0x3b, 0x9ac, 0x3b, 0x9b6, 0x3b,
+0x9b6, 0x3b, 0x42, 0x2e, 0x3b, 0x42, 0x2e, 0x45, 0x2e, 0x3b, 0xc7, 0x2e, 0x41, 0x2e, 0x3b, 0xc7, 0x2e, 0x3b, 0x43, 0x2e,
+0x41, 0x2e, 0x3b, 0x43, 0x2e, 0x3b, 0x15e, 0x2e, 0x3b, 0x62, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x62, 0x61, 0x7a, 0x61, 0x72,
+0x20, 0x65, 0x72, 0x74, 0x259, 0x73, 0x69, 0x3b, 0xe7, 0x259, 0x72, 0x15f, 0x259, 0x6e, 0x62, 0x259, 0x20, 0x61, 0x78, 0x15f,
+0x61, 0x6d, 0x131, 0x3b, 0xe7, 0x259, 0x72, 0x15f, 0x259, 0x6e, 0x62, 0x259, 0x3b, 0x63, 0xfc, 0x6d, 0x259, 0x20, 0x61, 0x78,
+0x15f, 0x61, 0x6d, 0x131, 0x3b, 0x63, 0xfc, 0x6d, 0x259, 0x3b, 0x15f, 0x259, 0x6e, 0x62, 0x259, 0x3b, 0x42, 0x2e, 0x3b, 0x42,
+0x2e, 0x65, 0x2e, 0x3b, 0xc7, 0x2e, 0x61, 0x2e, 0x3b, 0xc7, 0x2e, 0x3b, 0x43, 0x2e, 0x61, 0x2e, 0x3b, 0x43, 0x2e, 0x3b,
+0x15e, 0x2e, 0x3b, 0x411, 0x2e, 0x3b, 0x411, 0x2e, 0x415, 0x2e, 0x3b, 0x427, 0x2e, 0x410, 0x2e, 0x3b, 0x427, 0x2e, 0x3b, 0x4b8,
+0x2e, 0x410, 0x2e, 0x3b, 0x4b8, 0x2e, 0x3b, 0x428, 0x2e, 0x3b, 0x431, 0x430, 0x437, 0x430, 0x440, 0x3b, 0x431, 0x430, 0x437, 0x430,
+0x440, 0x20, 0x435, 0x440, 0x442, 0x4d9, 0x441, 0x438, 0x3b, 0x447, 0x4d9, 0x440, 0x448, 0x4d9, 0x43d, 0x431, 0x4d9, 0x20, 0x430, 0x445,
+0x448, 0x430, 0x43c, 0x44b, 0x3b, 0x447, 0x4d9, 0x440, 0x448, 0x4d9, 0x43d, 0x431, 0x4d9, 0x3b, 0x4b9, 0x4af, 0x43c, 0x4d9, 0x20, 0x430,
+0x445, 0x448, 0x430, 0x43c, 0x44b, 0x3b, 0x4b9, 0x4af, 0x43c, 0x4d9, 0x3b, 0x448, 0x4d9, 0x43d, 0x431, 0x4d9, 0x3b, 0x69, 0x67, 0x2e,
+0x3b, 0x61, 0x6c, 0x2e, 0x3b, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x7a, 0x2e, 0x3b, 0x6f, 0x67, 0x2e, 0x3b, 0x6f, 0x72, 0x2e,
+0x3b, 0x6c, 0x72, 0x2e, 0x3b, 0x69, 0x67, 0x61, 0x6e, 0x64, 0x65, 0x61, 0x3b, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x65, 0x68,
+0x65, 0x6e, 0x61, 0x3b, 0x61, 0x73, 0x74, 0x65, 0x61, 0x72, 0x74, 0x65, 0x61, 0x3b, 0x61, 0x73, 0x74, 0x65, 0x61, 0x7a,
+0x6b, 0x65, 0x6e, 0x61, 0x3b, 0x6f, 0x73, 0x74, 0x65, 0x67, 0x75, 0x6e, 0x61, 0x3b, 0x6f, 0x73, 0x74, 0x69, 0x72, 0x61,
+0x6c, 0x61, 0x3b, 0x6c, 0x61, 0x72, 0x75, 0x6e, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41,
+0x3b, 0x4f, 0x3b, 0x4f, 0x3b, 0x4c, 0x3b, 0x9b0, 0x9ac, 0x9bf, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2,
+0x3b, 0x9ac, 0x9c1, 0x9a7, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x9b8, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9b0, 0x3b,
+0x9b6, 0x9a8, 0x9bf, 0x3b, 0x9b0, 0x9ac, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ae, 0x999,
+0x9cd, 0x997, 0x9b2, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x9b8, 0x9cd, 0x9aa,
+0x9a4, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9b0, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x9ac, 0x9be,
+0x9b0, 0x3b, 0x9b0, 0x3b, 0x9b8, 0x9cb, 0x3b, 0x9ae, 0x3b, 0x9ac, 0x9c1, 0x3b, 0x9ac, 0x9c3, 0x3b, 0x9b6, 0x9c1, 0x3b, 0x9b6, 0x3b,
+0xf5f, 0xfb3, 0xf0b, 0x3b, 0xf58, 0xf72, 0xf62, 0xf0b, 0x3b, 0xf63, 0xfb7, 0xf42, 0xf0b, 0x3b, 0xf55, 0xf74, 0xf62, 0xf0b, 0x3b, 0xf66,
+0xf44, 0xf66, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0xf0b, 0x3b, 0xf49, 0xf72, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf5f, 0xfb3,
+0xf0b, 0xf56, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf58, 0xf72, 0xf42, 0xf0b, 0xf51, 0xf58, 0xf62, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60,
+0xf0b, 0xf63, 0xfb7, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf55, 0xf74, 0xf62, 0xf0b, 0xf56, 0xf74, 0xf0b, 0x3b,
+0xf42, 0xf5f, 0xf60, 0xf0b, 0xf54, 0xf0b, 0xf66, 0xf44, 0xf66, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0xf0b,
+0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf49, 0xf72, 0xf0b, 0xf58, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0x3b, 0xf58, 0xf72, 0xf62, 0x3b,
+0xf63, 0xfb7, 0xf42, 0x3b, 0xf55, 0xf74, 0xf62, 0x3b, 0xf66, 0xf44, 0xfb6, 0x3b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0x3b, 0xf49, 0xf72, 0x3b,
+0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x65, 0x75, 0x2e, 0x3b, 0x4d, 0x65, 0x72, 0x2e, 0x3b, 0x59, 0x61,
+0x6f, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x2e, 0x3b, 0x53, 0x61, 0x64, 0x2e, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x75, 0x6e,
+0x3b, 0x4d, 0x65, 0x75, 0x72, 0x7a, 0x68, 0x3b, 0x4d, 0x65, 0x72, 0x63, 0x2bc, 0x68, 0x65, 0x72, 0x3b, 0x59, 0x61, 0x6f,
+0x75, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x53, 0x61, 0x64, 0x6f, 0x72, 0x6e, 0x3b, 0x53, 0x75, 0x3b, 0x4c,
+0x3b, 0x4d, 0x7a, 0x3b, 0x4d, 0x63, 0x3b, 0x59, 0x3b, 0x47, 0x3b, 0x53, 0x61, 0x3b, 0x43d, 0x434, 0x3b, 0x43f, 0x43d, 0x3b,
+0x432, 0x442, 0x3b, 0x441, 0x440, 0x3b, 0x447, 0x442, 0x3b, 0x43f, 0x442, 0x3b, 0x441, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x435, 0x43b,
+0x44f, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x435, 0x43b, 0x43d, 0x438, 0x43a, 0x3b, 0x432, 0x442, 0x43e, 0x440, 0x43d, 0x438, 0x43a,
+0x3b, 0x441, 0x440, 0x44f, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x44a, 0x440, 0x442, 0x44a, 0x43a, 0x3b, 0x43f, 0x435, 0x442,
+0x44a, 0x43a, 0x3b, 0x441, 0x44a, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x43d, 0x3b, 0x43f, 0x3b, 0x432, 0x3b, 0x441, 0x3b, 0x447, 0x3b,
+0x43f, 0x3b, 0x441, 0x3b, 0x1010, 0x1014, 0x1004, 0x103a, 0x1039, 0x1002, 0x1014, 0x103d, 0x1031, 0x3b, 0x1010, 0x1014, 0x1004, 0x103a, 0x1039, 0x101c,
+0x102c, 0x3b, 0x1021, 0x1004, 0x103a, 0x1039, 0x1002, 0x102b, 0x3b, 0x1017, 0x102f, 0x1012, 0x1039, 0x1013, 0x101f, 0x1030, 0x1038, 0x3b, 0x1000, 0x103c,
+0x102c, 0x101e, 0x1015, 0x1010, 0x1031, 0x1038, 0x3b, 0x101e, 0x1031, 0x102c, 0x1000, 0x103c, 0x102c, 0x3b, 0x1005, 0x1014, 0x1031, 0x3b, 0x1010, 0x3b,
+0x1010, 0x3b, 0x1021, 0x3b, 0x1017, 0x3b, 0x1000, 0x3b, 0x101e, 0x3b, 0x1005, 0x3b, 0x43d, 0x434, 0x3b, 0x43f, 0x43d, 0x3b, 0x430, 0x45e,
+0x3b, 0x441, 0x440, 0x3b, 0x447, 0x446, 0x3b, 0x43f, 0x442, 0x3b, 0x441, 0x431, 0x3b, 0x43d, 0x44f, 0x434, 0x437, 0x435, 0x43b, 0x44f,
+0x3b, 0x43f, 0x430, 0x43d, 0x44f, 0x434, 0x437, 0x435, 0x43b, 0x430, 0x43a, 0x3b, 0x430, 0x45e, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b,
+0x441, 0x435, 0x440, 0x430, 0x434, 0x430, 0x3b, 0x447, 0x430, 0x446, 0x432, 0x435, 0x440, 0x3b, 0x43f, 0x44f, 0x442, 0x43d, 0x456, 0x446,
+0x430, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x43d, 0x3b, 0x43f, 0x3b, 0x430, 0x3b, 0x441, 0x3b, 0x447, 0x3b, 0x43f,
+0x3b, 0x441, 0x3b, 0x17a2, 0x17b6, 0x1791, 0x17b7, 0x178f, 0x17d2, 0x1799, 0x3b, 0x1785, 0x1793, 0x17d2, 0x1791, 0x3b, 0x17a2, 0x1784, 0x17d2, 0x1782,
+0x17b6, 0x179a, 0x3b, 0x1796, 0x17bb, 0x1792, 0x3b, 0x1796, 0x17d2, 0x179a, 0x17a0, 0x3b, 0x179f, 0x17bb, 0x1780, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17c5,
+0x179a, 0x17cd, 0x3b, 0x17a2, 0x17b6, 0x1791, 0x17b7, 0x178f, 0x17d2, 0x1799, 0x3b, 0x1785, 0x1793, 0x17d2, 0x1791, 0x3b, 0x17a2, 0x1784, 0x17d2, 0x1782,
+0x17b6, 0x179a, 0x3b, 0x1796, 0x17bb, 0x1792, 0x3b, 0x1796, 0x17d2, 0x179a, 0x17a0, 0x179f, 0x17d2, 0x1794, 0x178f, 0x17b7, 0x17cd, 0x3b, 0x179f, 0x17bb,
+0x1780, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17c5, 0x179a, 0x17cd, 0x3b, 0x17a2, 0x3b, 0x1785, 0x3b, 0x17a2, 0x3b, 0x1796, 0x3b, 0x1796, 0x3b, 0x179f,
+0x3b, 0x179f, 0x3b, 0x17a2, 0x17b6, 0x1791, 0x17b7, 0x178f, 0x17d2, 0x1799, 0x3b, 0x1785, 0x17d0, 0x1793, 0x17d2, 0x1791, 0x3b, 0x17a2, 0x1784, 0x17d2,
+0x1782, 0x17b6, 0x179a, 0x3b, 0x1796, 0x17bb, 0x1792, 0x3b, 0x1796, 0x17d2, 0x179a, 0x17a0, 0x179f, 0x17d2, 0x1794, 0x178f, 0x17b7, 0x17cd, 0x3b, 0x179f,
+0x17bb, 0x1780, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17c5, 0x179a, 0x17cd, 0x3b, 0x64, 0x67, 0x2e, 0x3b, 0x64, 0x6c, 0x2e, 0x3b, 0x64, 0x74,
+0x2e, 0x3b, 0x64, 0x63, 0x2e, 0x3b, 0x64, 0x6a, 0x2e, 0x3b, 0x64, 0x76, 0x2e, 0x3b, 0x64, 0x73, 0x2e, 0x3b, 0x64, 0x69,
+0x75, 0x6d, 0x65, 0x6e, 0x67, 0x65, 0x3b, 0x64, 0x69, 0x6c, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x64, 0x69, 0x6d, 0x61, 0x72,
+0x74, 0x73, 0x3b, 0x64, 0x69, 0x6d, 0x65, 0x63, 0x72, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x6a, 0x6f, 0x75, 0x73, 0x3b, 0x64,
+0x69, 0x76, 0x65, 0x6e, 0x64, 0x72, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x73, 0x73, 0x61, 0x62, 0x74, 0x65, 0x3b, 0x64, 0x67,
+0x3b, 0x64, 0x6c, 0x3b, 0x64, 0x74, 0x3b, 0x64, 0x63, 0x3b, 0x64, 0x6a, 0x3b, 0x64, 0x76, 0x3b, 0x64, 0x73, 0x3b, 0x5468,
+0x65e5, 0x3b, 0x5468, 0x4e00, 0x3b, 0x5468, 0x4e8c, 0x3b, 0x5468, 0x4e09, 0x3b, 0x5468, 0x56db, 0x3b, 0x5468, 0x4e94, 0x3b, 0x5468, 0x516d, 0x3b,
+0x661f, 0x671f, 0x65e5, 0x3b, 0x661f, 0x671f, 0x4e00, 0x3b, 0x661f, 0x671f, 0x4e8c, 0x3b, 0x661f, 0x671f, 0x4e09, 0x3b, 0x661f, 0x671f, 0x56db, 0x3b,
+0x661f, 0x671f, 0x4e94, 0x3b, 0x661f, 0x671f, 0x516d, 0x3b, 0x65e5, 0x3b, 0x4e00, 0x3b, 0x4e8c, 0x3b, 0x4e09, 0x3b, 0x56db, 0x3b, 0x4e94, 0x3b,
+0x516d, 0x3b, 0x9031, 0x65e5, 0x3b, 0x9031, 0x4e00, 0x3b, 0x9031, 0x4e8c, 0x3b, 0x9031, 0x4e09, 0x3b, 0x9031, 0x56db, 0x3b, 0x9031, 0x4e94, 0x3b,
+0x9031, 0x516d, 0x3b, 0x6e, 0x65, 0x64, 0x3b, 0x70, 0x6f, 0x6e, 0x3b, 0x75, 0x74, 0x6f, 0x3b, 0x73, 0x72, 0x69, 0x3b, 0x10d,
+0x65, 0x74, 0x3b, 0x70, 0x65, 0x74, 0x3b, 0x73, 0x75, 0x62, 0x3b, 0x6e, 0x65, 0x64, 0x6a, 0x65, 0x6c, 0x6a, 0x61, 0x3b,
+0x70, 0x6f, 0x6e, 0x65, 0x64, 0x6a, 0x65, 0x6c, 0x6a, 0x61, 0x6b, 0x3b, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x6b, 0x3b, 0x73,
+0x72, 0x69, 0x6a, 0x65, 0x64, 0x61, 0x3b, 0x10d, 0x65, 0x74, 0x76, 0x72, 0x74, 0x61, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x61,
+0x6b, 0x3b, 0x73, 0x75, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x75, 0x3b, 0x73, 0x3b, 0x10d, 0x3b, 0x70,
+0x3b, 0x73, 0x3b, 0x4e, 0x3b, 0x50, 0x3b, 0x55, 0x3b, 0x53, 0x3b, 0x10c, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x6e, 0x65, 0x3b,
+0x70, 0x6f, 0x3b, 0xfa, 0x74, 0x3b, 0x73, 0x74, 0x3b, 0x10d, 0x74, 0x3b, 0x70, 0xe1, 0x3b, 0x73, 0x6f, 0x3b, 0x6e, 0x65,
+0x64, 0x11b, 0x6c, 0x65, 0x3b, 0x70, 0x6f, 0x6e, 0x64, 0x11b, 0x6c, 0xed, 0x3b, 0xfa, 0x74, 0x65, 0x72, 0xfd, 0x3b, 0x73,
+0x74, 0x159, 0x65, 0x64, 0x61, 0x3b, 0x10d, 0x74, 0x76, 0x72, 0x74, 0x65, 0x6b, 0x3b, 0x70, 0xe1, 0x74, 0x65, 0x6b, 0x3b,
+0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x4e, 0x3b, 0x50, 0x3b, 0xda, 0x3b, 0x53, 0x3b, 0x10c, 0x3b, 0x50, 0x3b, 0x53,
+0x3b, 0x73, 0xf8, 0x6e, 0x3b, 0x6d, 0x61, 0x6e, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6f, 0x6e, 0x73, 0x3b, 0x74, 0x6f, 0x72,
+0x3b, 0x66, 0x72, 0x65, 0x3b, 0x6c, 0xf8, 0x72, 0x3b, 0x73, 0xf8, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0x61, 0x6e, 0x64,
+0x61, 0x67, 0x3b, 0x74, 0x69, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x6f, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x6f,
+0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x66, 0x72, 0x65, 0x64, 0x61, 0x67, 0x3b, 0x6c, 0xf8, 0x72, 0x64, 0x61, 0x67, 0x3b,
+0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x4f, 0x3b, 0x54, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x73, 0xf8, 0x6e, 0x2e, 0x3b, 0x6d,
+0x61, 0x6e, 0x2e, 0x3b, 0x74, 0x69, 0x72, 0x2e, 0x3b, 0x6f, 0x6e, 0x73, 0x2e, 0x3b, 0x74, 0x6f, 0x72, 0x2e, 0x3b, 0x66,
+0x72, 0x65, 0x2e, 0x3b, 0x6c, 0xf8, 0x72, 0x2e, 0x3b, 0x7a, 0x6f, 0x3b, 0x6d, 0x61, 0x3b, 0x64, 0x69, 0x3b, 0x77, 0x6f,
+0x3b, 0x64, 0x6f, 0x3b, 0x76, 0x72, 0x3b, 0x7a, 0x61, 0x3b, 0x7a, 0x6f, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0x61, 0x61,
+0x6e, 0x64, 0x61, 0x67, 0x3b, 0x64, 0x69, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x77, 0x6f, 0x65, 0x6e, 0x73, 0x64, 0x61,
+0x67, 0x3b, 0x64, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x76, 0x72, 0x69, 0x6a, 0x64, 0x61, 0x67, 0x3b,
+0x7a, 0x61, 0x74, 0x65, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x5a, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x56,
+0x3b, 0x5a, 0x3b, 0x53, 0x75, 0x2e, 0x3b, 0x4d, 0x2e, 0x3b, 0x54, 0x75, 0x2e, 0x3b, 0x57, 0x2e, 0x3b, 0x54, 0x68, 0x2e,
+0x3b, 0x46, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0x75, 0x6e, 0x2e, 0x3b, 0x4d, 0x6f, 0x6e, 0x2e, 0x3b, 0x54, 0x75,
+0x65, 0x2e, 0x3b, 0x57, 0x65, 0x64, 0x2e, 0x3b, 0x54, 0x68, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x69, 0x2e, 0x3b, 0x53, 0x61,
+0x74, 0x2e, 0x3b, 0x64, 0x69, 0x3b, 0x6c, 0x75, 0x3b, 0x6d, 0x61, 0x3b, 0x6d, 0x65, 0x3b, 0x135, 0x61, 0x3b, 0x76, 0x65,
+0x3b, 0x73, 0x61, 0x3b, 0x64, 0x69, 0x6d, 0x61, 0x6e, 0x109, 0x6f, 0x3b, 0x6c, 0x75, 0x6e, 0x64, 0x6f, 0x3b, 0x6d, 0x61,
+0x72, 0x64, 0x6f, 0x3b, 0x6d, 0x65, 0x72, 0x6b, 0x72, 0x65, 0x64, 0x6f, 0x3b, 0x135, 0x61, 0x16d, 0x64, 0x6f, 0x3b, 0x76,
+0x65, 0x6e, 0x64, 0x72, 0x65, 0x64, 0x6f, 0x3b, 0x73, 0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d,
+0x3b, 0x4d, 0x3b, 0x134, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x50, 0x3b, 0x45, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x52,
+0x3b, 0x4c, 0x3b, 0x70, 0xfc, 0x68, 0x61, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x65, 0x73, 0x6d, 0x61, 0x73, 0x70, 0xe4, 0x65,
+0x76, 0x3b, 0x74, 0x65, 0x69, 0x73, 0x69, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x6b, 0x6f, 0x6c, 0x6d, 0x61, 0x70, 0xe4, 0x65,
+0x76, 0x3b, 0x6e, 0x65, 0x6c, 0x6a, 0x61, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x72, 0x65, 0x65, 0x64, 0x65, 0x3b, 0x6c, 0x61,
+0x75, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x73, 0x75, 0x6e, 0x3b, 0x6d, 0xe1, 0x6e, 0x3b, 0x74, 0xfd, 0x73, 0x3b, 0x6d, 0x69,
+0x6b, 0x3b, 0x68, 0xf3, 0x73, 0x3b, 0x66, 0x72, 0xed, 0x3b, 0x6c, 0x65, 0x79, 0x3b, 0x73, 0x75, 0x6e, 0x6e, 0x75, 0x64,
+0x61, 0x67, 0x75, 0x72, 0x3b, 0x6d, 0xe1, 0x6e, 0x61, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x74, 0xfd, 0x73, 0x64, 0x61,
+0x67, 0x75, 0x72, 0x3b, 0x6d, 0x69, 0x6b, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x68, 0xf3, 0x73, 0x64, 0x61, 0x67,
+0x75, 0x72, 0x3b, 0x66, 0x72, 0xed, 0x67, 0x67, 0x6a, 0x61, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6c, 0x65, 0x79, 0x67,
+0x61, 0x72, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x46, 0x3b,
+0x4c, 0x3b, 0x73, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0xe1, 0x6e, 0x2e, 0x3b, 0x74, 0xfd, 0x73, 0x2e, 0x3b, 0x6d, 0x69, 0x6b,
+0x2e, 0x3b, 0x68, 0xf3, 0x73, 0x2e, 0x3b, 0x66, 0x72, 0xed, 0x2e, 0x3b, 0x6c, 0x65, 0x79, 0x2e, 0x3b, 0x73, 0x75, 0x3b,
+0x6d, 0x61, 0x3b, 0x74, 0x69, 0x3b, 0x6b, 0x65, 0x3b, 0x74, 0x6f, 0x3b, 0x70, 0x65, 0x3b, 0x6c, 0x61, 0x3b, 0x73, 0x75,
+0x6e, 0x6e, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x3b, 0x6d, 0x61, 0x61, 0x6e, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x3b, 0x74, 0x69,
+0x69, 0x73, 0x74, 0x61, 0x69, 0x3b, 0x6b, 0x65, 0x73, 0x6b, 0x69, 0x76, 0x69, 0x69, 0x6b, 0x6b, 0x6f, 0x3b, 0x74, 0x6f,
+0x72, 0x73, 0x74, 0x61, 0x69, 0x3b, 0x70, 0x65, 0x72, 0x6a, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x3b, 0x6c, 0x61, 0x75, 0x61,
+0x6e, 0x74, 0x61, 0x69, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x50, 0x3b, 0x4c, 0x3b, 0x73,
+0x75, 0x6e, 0x6e, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x6d, 0x61, 0x61, 0x6e, 0x61, 0x6e, 0x74, 0x61, 0x69,
+0x6e, 0x61, 0x3b, 0x74, 0x69, 0x69, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x6b, 0x65, 0x73, 0x6b, 0x69, 0x76, 0x69,
+0x69, 0x6b, 0x6b, 0x6f, 0x6e, 0x61, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x70, 0x65, 0x72,
+0x6a, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x6c, 0x61, 0x75, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b,
+0x64, 0x69, 0x6d, 0x2e, 0x3b, 0x6c, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d, 0x65, 0x72, 0x2e, 0x3b,
+0x6a, 0x65, 0x75, 0x2e, 0x3b, 0x76, 0x65, 0x6e, 0x2e, 0x3b, 0x73, 0x61, 0x6d, 0x2e, 0x3b, 0x64, 0x69, 0x6d, 0x61, 0x6e,
+0x63, 0x68, 0x65, 0x3b, 0x6c, 0x75, 0x6e, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x69, 0x3b, 0x6d, 0x65, 0x72, 0x63,
+0x72, 0x65, 0x64, 0x69, 0x3b, 0x6a, 0x65, 0x75, 0x64, 0x69, 0x3b, 0x76, 0x65, 0x6e, 0x64, 0x72, 0x65, 0x64, 0x69, 0x3b,
+0x73, 0x61, 0x6d, 0x65, 0x64, 0x69, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x56, 0x3b, 0x53,
+0x3b, 0x73, 0x69, 0x3b, 0x6d, 0x6f, 0x3b, 0x74, 0x69, 0x3b, 0x77, 0x6f, 0x3b, 0x74, 0x6f, 0x3b, 0x66, 0x72, 0x3b, 0x73,
+0x6f, 0x3b, 0x73, 0x6e, 0x65, 0x69, 0x6e, 0x3b, 0x6d, 0x6f, 0x61, 0x6e, 0x64, 0x65, 0x69, 0x3b, 0x74, 0x69, 0x69, 0x73,
+0x64, 0x65, 0x69, 0x3b, 0x77, 0x6f, 0x61, 0x6e, 0x73, 0x64, 0x65, 0x69, 0x3b, 0x74, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x73,
+0x64, 0x65, 0x69, 0x3b, 0x66, 0x72, 0x65, 0x65, 0x64, 0x3b, 0x73, 0x6e, 0x65, 0x6f, 0x6e, 0x3b, 0x44, 0x69, 0x44, 0x3b,
+0x44, 0x69, 0x4c, 0x3b, 0x44, 0x69, 0x4d, 0x3b, 0x44, 0x69, 0x43, 0x3b, 0x44, 0x69, 0x61, 0x3b, 0x44, 0x69, 0x68, 0x3b,
+0x44, 0x69, 0x53, 0x3b, 0x44, 0x69, 0x44, 0xf2, 0x6d, 0x68, 0x6e, 0x61, 0x69, 0x63, 0x68, 0x3b, 0x44, 0x69, 0x4c, 0x75,
+0x61, 0x69, 0x6e, 0x3b, 0x44, 0x69, 0x4d, 0xe0, 0x69, 0x72, 0x74, 0x3b, 0x44, 0x69, 0x43, 0x69, 0x61, 0x64, 0x61, 0x69,
+0x6e, 0x3b, 0x44, 0x69, 0x61, 0x72, 0x44, 0x61, 0x6f, 0x69, 0x6e, 0x3b, 0x44, 0x69, 0x68, 0x41, 0x6f, 0x69, 0x6e, 0x65,
+0x3b, 0x44, 0x69, 0x53, 0x61, 0x74, 0x68, 0x61, 0x69, 0x72, 0x6e, 0x65, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x43,
+0x3b, 0x41, 0x3b, 0x48, 0x3b, 0x53, 0x3b, 0x44, 0x6f, 0x6d, 0x2e, 0x3b, 0x4c, 0x75, 0x6e, 0x73, 0x3b, 0x4d, 0x61, 0x72,
+0x2e, 0x3b, 0x4d, 0xe9, 0x72, 0x2e, 0x3b, 0x58, 0x6f, 0x76, 0x2e, 0x3b, 0x56, 0x65, 0x6e, 0x2e, 0x3b, 0x53, 0xe1, 0x62,
+0x2e, 0x3b, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65,
+0x73, 0x3b, 0x4d, 0xe9, 0x72, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x3b, 0x58, 0x6f, 0x76, 0x65, 0x73, 0x3b, 0x56, 0x65, 0x6e,
+0x72, 0x65, 0x73, 0x3b, 0x53, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x58,
+0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x2e, 0x3b, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b,
+0x6d, 0xe9, 0x72, 0x2e, 0x3b, 0x78, 0x6f, 0x76, 0x2e, 0x3b, 0x76, 0x65, 0x6e, 0x2e, 0x3b, 0x73, 0xe1, 0x62, 0x2e, 0x3b,
+0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b,
+0x6d, 0xe9, 0x72, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x3b, 0x78, 0x6f, 0x76, 0x65, 0x73, 0x3b, 0x76, 0x65, 0x6e, 0x72, 0x65,
+0x73, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x64, 0x2e, 0x3b, 0x6c, 0x2e, 0x3b, 0x6d, 0x2e, 0x3b, 0x6d, 0x2e,
+0x3b, 0x78, 0x2e, 0x3b, 0x76, 0x2e, 0x3b, 0x73, 0x2e, 0x3b, 0x10d9, 0x10d5, 0x10d8, 0x3b, 0x10dd, 0x10e0, 0x10e8, 0x3b, 0x10e1, 0x10d0,
+0x10db, 0x3b, 0x10dd, 0x10d7, 0x10ee, 0x3b, 0x10ee, 0x10e3, 0x10d7, 0x3b, 0x10de, 0x10d0, 0x10e0, 0x3b, 0x10e8, 0x10d0, 0x10d1, 0x3b, 0x10d9, 0x10d5,
+0x10d8, 0x10e0, 0x10d0, 0x3b, 0x10dd, 0x10e0, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10e1, 0x10d0, 0x10db, 0x10e8, 0x10d0, 0x10d1, 0x10d0,
+0x10d7, 0x10d8, 0x3b, 0x10dd, 0x10d7, 0x10ee, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10ee, 0x10e3, 0x10d7, 0x10e8, 0x10d0, 0x10d1, 0x10d0,
+0x10d7, 0x10d8, 0x3b, 0x10de, 0x10d0, 0x10e0, 0x10d0, 0x10e1, 0x10d9, 0x10d4, 0x10d5, 0x10d8, 0x3b, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b,
+0x10d9, 0x3b, 0x10dd, 0x3b, 0x10e1, 0x3b, 0x10dd, 0x3b, 0x10ee, 0x3b, 0x10de, 0x3b, 0x10e8, 0x3b, 0x53, 0x6f, 0x3b, 0x4d, 0x6f, 0x3b,
+0x44, 0x69, 0x3b, 0x4d, 0x69, 0x3b, 0x44, 0x6f, 0x3b, 0x46, 0x72, 0x3b, 0x53, 0x61, 0x3b, 0x53, 0x6f, 0x6e, 0x6e, 0x74,
+0x61, 0x67, 0x3b, 0x4d, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x3b, 0x44, 0x69, 0x65, 0x6e, 0x73, 0x74, 0x61, 0x67, 0x3b, 0x4d,
+0x69, 0x74, 0x74, 0x77, 0x6f, 0x63, 0x68, 0x3b, 0x44, 0x6f, 0x6e, 0x6e, 0x65, 0x72, 0x73, 0x74, 0x61, 0x67, 0x3b, 0x46,
+0x72, 0x65, 0x69, 0x74, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x73, 0x74, 0x61, 0x67, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x44,
+0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x46, 0x3b, 0x53, 0x3b, 0x53, 0x6f, 0x2e, 0x3b, 0x4d, 0x6f, 0x2e, 0x3b, 0x44, 0x69, 0x2e,
+0x3b, 0x4d, 0x69, 0x2e, 0x3b, 0x44, 0x6f, 0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x39a, 0x3c5, 0x3c1,
+0x3b, 0x394, 0x3b5, 0x3c5, 0x3b, 0x3a4, 0x3c1, 0x3af, 0x3b, 0x3a4, 0x3b5, 0x3c4, 0x3b, 0x3a0, 0x3ad, 0x3bc, 0x3b, 0x3a0, 0x3b1, 0x3c1,
+0x3b, 0x3a3, 0x3ac, 0x3b2, 0x3b, 0x39a, 0x3c5, 0x3c1, 0x3b9, 0x3b1, 0x3ba, 0x3ae, 0x3b, 0x394, 0x3b5, 0x3c5, 0x3c4, 0x3ad, 0x3c1, 0x3b1,
+0x3b, 0x3a4, 0x3c1, 0x3af, 0x3c4, 0x3b7, 0x3b, 0x3a4, 0x3b5, 0x3c4, 0x3ac, 0x3c1, 0x3c4, 0x3b7, 0x3b, 0x3a0, 0x3ad, 0x3bc, 0x3c0, 0x3c4,
+0x3b7, 0x3b, 0x3a0, 0x3b1, 0x3c1, 0x3b1, 0x3c3, 0x3ba, 0x3b5, 0x3c5, 0x3ae, 0x3b, 0x3a3, 0x3ac, 0x3b2, 0x3b2, 0x3b1, 0x3c4, 0x3bf, 0x3b,
+0x39a, 0x3b, 0x394, 0x3b, 0x3a4, 0x3b, 0x3a4, 0x3b, 0x3a0, 0x3b, 0x3a0, 0x3b, 0x3a3, 0x3b, 0x73, 0x61, 0x70, 0x3b, 0x61, 0x74,
+0x61, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x70, 0x69, 0x6e, 0x3b, 0x73, 0x69, 0x73, 0x3b, 0x74, 0x61, 0x6c, 0x3b, 0x61, 0x72,
+0x66, 0x3b, 0x73, 0x61, 0x70, 0x61, 0x61, 0x74, 0x3b, 0x61, 0x74, 0x61, 0x61, 0x73, 0x69, 0x6e, 0x6e, 0x67, 0x6f, 0x72,
+0x6e, 0x65, 0x71, 0x3b, 0x6d, 0x61, 0x72, 0x6c, 0x75, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x70, 0x69,
+0x6e, 0x67, 0x61, 0x73, 0x75, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x73, 0x69, 0x73, 0x61, 0x6d, 0x61,
+0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x74, 0x61, 0x6c, 0x6c, 0x69, 0x6d, 0x61, 0x6e, 0x6e, 0x67, 0x6f,
+0x72, 0x6e, 0x65, 0x71, 0x3b, 0x61, 0x72, 0x66, 0x69, 0x6e, 0x69, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b,
+0x53, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0xab0, 0xab5, 0xabf, 0x3b, 0xab8, 0xacb,
+0xaae, 0x3b, 0xaae, 0xa82, 0xa97, 0xab3, 0x3b, 0xaac, 0xac1, 0xaa7, 0x3b, 0xa97, 0xac1, 0xab0, 0xac1, 0x3b, 0xab6, 0xac1, 0xa95, 0xacd,
+0xab0, 0x3b, 0xab6, 0xaa8, 0xabf, 0x3b, 0xab0, 0xab5, 0xabf, 0xab5, 0xabe, 0xab0, 0x3b, 0xab8, 0xacb, 0xaae, 0xab5, 0xabe, 0xab0, 0x3b,
+0xaae, 0xa82, 0xa97, 0xab3, 0xab5, 0xabe, 0xab0, 0x3b, 0xaac, 0xac1, 0xaa7, 0xab5, 0xabe, 0xab0, 0x3b, 0xa97, 0xac1, 0xab0, 0xac1, 0xab5,
+0xabe, 0xab0, 0x3b, 0xab6, 0xac1, 0xa95, 0xacd, 0xab0, 0xab5, 0xabe, 0xab0, 0x3b, 0xab6, 0xaa8, 0xabf, 0xab5, 0xabe, 0xab0, 0x3b, 0xab0,
+0x3b, 0xab8, 0xacb, 0x3b, 0xaae, 0xa82, 0x3b, 0xaac, 0xac1, 0x3b, 0xa97, 0xac1, 0x3b, 0xab6, 0xac1, 0x3b, 0xab6, 0x3b, 0x4c, 0x61,
+0x68, 0x3b, 0x4c, 0x69, 0x74, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0x4c, 0x61, 0x72, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x4a, 0x75,
+0x6d, 0x3b, 0x41, 0x73, 0x61, 0x3b, 0x4c, 0x61, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x4c, 0x69, 0x74, 0x69, 0x6e, 0x69, 0x6e,
+0x3b, 0x54, 0x61, 0x6c, 0x61, 0x74, 0x61, 0x3b, 0x4c, 0x61, 0x72, 0x61, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d,
+0x69, 0x73, 0x3b, 0x4a, 0x75, 0x6d, 0x6d, 0x61, 0x2bc, 0x61, 0x3b, 0x41, 0x73, 0x61, 0x62, 0x61, 0x72, 0x3b, 0x4c, 0x3b,
+0x4c, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x41, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d0, 0x5f3, 0x3b, 0x5d9,
+0x5d5, 0x5dd, 0x20, 0x5d1, 0x5f3, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d2, 0x5f3, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d3, 0x5f3, 0x3b,
+0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d4, 0x5f3, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d5, 0x5f3, 0x3b, 0x5e9, 0x5d1, 0x5ea, 0x3b, 0x5d9, 0x5d5,
+0x5dd, 0x20, 0x5e8, 0x5d0, 0x5e9, 0x5d5, 0x5df, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e9, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20,
+0x5e9, 0x5dc, 0x5d9, 0x5e9, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20,
+0x5d7, 0x5de, 0x5d9, 0x5e9, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e9, 0x5d9, 0x5e9, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e9,
+0x5d1, 0x5ea, 0x3b, 0x5d0, 0x5f3, 0x3b, 0x5d1, 0x5f3, 0x3b, 0x5d2, 0x5f3, 0x3b, 0x5d3, 0x5f3, 0x3b, 0x5d4, 0x5f3, 0x3b, 0x5d5, 0x5f3,
+0x3b, 0x5e9, 0x5f3, 0x3b, 0x930, 0x935, 0x93f, 0x3b, 0x938, 0x94b, 0x92e, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x3b, 0x92c, 0x941, 0x927,
+0x3b, 0x917, 0x941, 0x930, 0x941, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x3b, 0x930, 0x935, 0x93f, 0x935,
+0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x935, 0x93e, 0x930, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x935, 0x93e, 0x930, 0x3b, 0x92c, 0x941,
+0x927, 0x935, 0x93e, 0x930, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x935, 0x93e,
+0x930, 0x3b, 0x936, 0x928, 0x93f, 0x935, 0x93e, 0x930, 0x3b, 0x930, 0x3b, 0x938, 0x94b, 0x3b, 0x92e, 0x902, 0x3b, 0x92c, 0x941, 0x3b,
+0x917, 0x941, 0x3b, 0x936, 0x941, 0x3b, 0x936, 0x3b, 0x56, 0x3b, 0x48, 0x3b, 0x4b, 0x3b, 0x53, 0x7a, 0x65, 0x3b, 0x43, 0x73,
+0x3b, 0x50, 0x3b, 0x53, 0x7a, 0x6f, 0x3b, 0x76, 0x61, 0x73, 0xe1, 0x72, 0x6e, 0x61, 0x70, 0x3b, 0x68, 0xe9, 0x74, 0x66,
+0x151, 0x3b, 0x6b, 0x65, 0x64, 0x64, 0x3b, 0x73, 0x7a, 0x65, 0x72, 0x64, 0x61, 0x3b, 0x63, 0x73, 0xfc, 0x74, 0xf6, 0x72,
+0x74, 0xf6, 0x6b, 0x3b, 0x70, 0xe9, 0x6e, 0x74, 0x65, 0x6b, 0x3b, 0x73, 0x7a, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x3b, 0x56,
+0x3b, 0x48, 0x3b, 0x4b, 0x3b, 0x53, 0x7a, 0x3b, 0x43, 0x73, 0x3b, 0x50, 0x3b, 0x53, 0x7a, 0x3b, 0x73, 0x75, 0x6e, 0x2e,
+0x3b, 0x6d, 0xe1, 0x6e, 0x2e, 0x3b, 0xfe, 0x72, 0x69, 0x2e, 0x3b, 0x6d, 0x69, 0xf0, 0x2e, 0x3b, 0x66, 0x69, 0x6d, 0x2e,
+0x3b, 0x66, 0xf6, 0x73, 0x2e, 0x3b, 0x6c, 0x61, 0x75, 0x2e, 0x3b, 0x73, 0x75, 0x6e, 0x6e, 0x75, 0x64, 0x61, 0x67, 0x75,
+0x72, 0x3b, 0x6d, 0xe1, 0x6e, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0xfe, 0x72, 0x69, 0xf0, 0x6a, 0x75, 0x64, 0x61,
+0x67, 0x75, 0x72, 0x3b, 0x6d, 0x69, 0xf0, 0x76, 0x69, 0x6b, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x66, 0x69, 0x6d,
+0x6d, 0x74, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x66, 0xf6, 0x73, 0x74, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b,
+0x6c, 0x61, 0x75, 0x67, 0x61, 0x72, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0xde, 0x3b, 0x4d, 0x3b,
+0x46, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x4d, 0x69, 0x6e, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x3b, 0x52, 0x61,
+0x62, 0x3b, 0x4b, 0x61, 0x6d, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4d, 0x69, 0x6e, 0x67, 0x67, 0x75,
+0x3b, 0x53, 0x65, 0x6e, 0x69, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x61, 0x73, 0x61, 0x3b, 0x52, 0x61, 0x62, 0x75, 0x3b, 0x4b,
+0x61, 0x6d, 0x69, 0x73, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x3b, 0x53, 0x61, 0x62, 0x74, 0x75, 0x3b, 0x4d, 0x3b, 0x53,
+0x3b, 0x53, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x3b, 0x6c, 0x75, 0x6e, 0x3b, 0x6d,
+0x61, 0x72, 0x3b, 0x6d, 0x65, 0x72, 0x3b, 0x6a, 0x6f, 0x76, 0x3b, 0x76, 0x65, 0x6e, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64,
+0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x61, 0x3b, 0x6c, 0x75, 0x6e, 0x65, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65,
+0x64, 0x69, 0x3b, 0x6d, 0x65, 0x72, 0x63, 0x75, 0x72, 0x69, 0x64, 0x69, 0x3b, 0x6a, 0x6f, 0x76, 0x65, 0x64, 0x69, 0x3b,
+0x76, 0x65, 0x6e, 0x65, 0x72, 0x64, 0x69, 0x3b, 0x73, 0x61, 0x62, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x64, 0x3b, 0x6c, 0x3b,
+0x6d, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x76, 0x3b, 0x73, 0x3b, 0x44, 0x6f, 0x6d, 0x68, 0x3b, 0x4c, 0x75, 0x61, 0x6e, 0x3b,
+0x4d, 0xe1, 0x69, 0x72, 0x74, 0x3b, 0x43, 0xe9, 0x61, 0x64, 0x3b, 0x44, 0xe9, 0x61, 0x72, 0x3b, 0x41, 0x6f, 0x69, 0x6e,
+0x65, 0x3b, 0x53, 0x61, 0x74, 0x68, 0x3b, 0x44, 0xe9, 0x20, 0x44, 0x6f, 0x6d, 0x68, 0x6e, 0x61, 0x69, 0x67, 0x68, 0x3b,
+0x44, 0xe9, 0x20, 0x4c, 0x75, 0x61, 0x69, 0x6e, 0x3b, 0x44, 0xe9, 0x20, 0x4d, 0xe1, 0x69, 0x72, 0x74, 0x3b, 0x44, 0xe9,
+0x20, 0x43, 0xe9, 0x61, 0x64, 0x61, 0x6f, 0x69, 0x6e, 0x3b, 0x44, 0xe9, 0x61, 0x72, 0x64, 0x61, 0x6f, 0x69, 0x6e, 0x3b,
+0x44, 0xe9, 0x20, 0x68, 0x41, 0x6f, 0x69, 0x6e, 0x65, 0x3b, 0x44, 0xe9, 0x20, 0x53, 0x61, 0x74, 0x68, 0x61, 0x69, 0x72,
+0x6e, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x43, 0x3b, 0x44, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x3b,
+0x6c, 0x75, 0x6e, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x72, 0x3b, 0x67, 0x69, 0x6f, 0x3b, 0x76, 0x65, 0x6e, 0x3b,
+0x73, 0x61, 0x62, 0x3b, 0x64, 0x6f, 0x6d, 0x65, 0x6e, 0x69, 0x63, 0x61, 0x3b, 0x6c, 0x75, 0x6e, 0x65, 0x64, 0xec, 0x3b,
+0x6d, 0x61, 0x72, 0x74, 0x65, 0x64, 0xec, 0x3b, 0x6d, 0x65, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x64, 0xec, 0x3b, 0x67, 0x69,
+0x6f, 0x76, 0x65, 0x64, 0xec, 0x3b, 0x76, 0x65, 0x6e, 0x65, 0x72, 0x64, 0xec, 0x3b, 0x73, 0x61, 0x62, 0x61, 0x74, 0x6f,
+0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x65e5, 0x3b, 0x6708, 0x3b, 0x706b,
+0x3b, 0x6c34, 0x3b, 0x6728, 0x3b, 0x91d1, 0x3b, 0x571f, 0x3b, 0x65e5, 0x66dc, 0x65e5, 0x3b, 0x6708, 0x66dc, 0x65e5, 0x3b, 0x706b, 0x66dc, 0x65e5,
+0x3b, 0x6c34, 0x66dc, 0x65e5, 0x3b, 0x6728, 0x66dc, 0x65e5, 0x3b, 0x91d1, 0x66dc, 0x65e5, 0x3b, 0x571f, 0x66dc, 0x65e5, 0x3b, 0x41, 0x68, 0x61,
+0x64, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x3b, 0x4b, 0x61, 0x6d, 0x3b, 0x4a, 0x75,
+0x6d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x41, 0x68, 0x61, 0x64, 0x3b, 0x53, 0x65, 0x6e, 0x69, 0x6e, 0x3b, 0x53, 0x65, 0x6c,
+0x61, 0x73, 0x61, 0x3b, 0x52, 0x61, 0x62, 0x75, 0x3b, 0x4b, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74,
+0x3b, 0x53, 0x61, 0x62, 0x74, 0x75, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53,
+0x3b, 0xcad, 0xcbe, 0xca8, 0xcc1, 0x3b, 0xcb8, 0xccb, 0xcae, 0x3b, 0xcae, 0xc82, 0xc97, 0xcb3, 0x3b, 0xcac, 0xcc1, 0xca7, 0x3b, 0xc97,
+0xcc1, 0xcb0, 0xcc1, 0x3b, 0xcb6, 0xcc1, 0xc95, 0xccd, 0xcb0, 0x3b, 0xcb6, 0xca8, 0xcbf, 0x3b, 0xcad, 0xcbe, 0xca8, 0xcc1, 0xcb5, 0xcbe,
+0xcb0, 0x3b, 0xcb8, 0xccb, 0xcae, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcae, 0xc82, 0xc97, 0xcb3, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcac, 0xcc1, 0xca7,
+0xcb5, 0xcbe, 0xcb0, 0x3b, 0xc97, 0xcc1, 0xcb0, 0xcc1, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcb6, 0xcc1, 0xc95, 0xccd, 0xcb0, 0xcb5, 0xcbe, 0xcb0,
+0x3b, 0xcb6, 0xca8, 0xcbf, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcad, 0xcbe, 0x3b, 0xcb8, 0xccb, 0x3b, 0xcae, 0xc82, 0x3b, 0xcac, 0xcc1, 0x3b,
+0xc97, 0xcc1, 0x3b, 0xcb6, 0xcc1, 0x3b, 0xcb6, 0x3b, 0x622, 0x62a, 0x6be, 0x648, 0x627, 0x631, 0x3b, 0x698, 0x654, 0x646, 0x62f, 0x655,
+0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x6c6, 0x645, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648, 0x627, 0x631, 0x3b, 0x628,
+0x631, 0x620, 0x633, 0x648, 0x627, 0x631, 0x3b, 0x62c, 0x64f, 0x645, 0x6c1, 0x3b, 0x628, 0x679, 0x648, 0x627, 0x631, 0x3b, 0x627, 0x64e,
+0x62a, 0x6be, 0x648, 0x627, 0x631, 0x3b, 0x698, 0x654, 0x646, 0x62f, 0x631, 0x655, 0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x6c6, 0x645,
+0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x631, 0x620, 0x633, 0x648, 0x627, 0x631, 0x3b, 0x62c,
+0x64f, 0x645, 0x6c1, 0x3b, 0x628, 0x679, 0x648, 0x627, 0x631, 0x3b, 0x627, 0x3b, 0x698, 0x3b, 0x628, 0x3b, 0x628, 0x3b, 0x628, 0x3b,
+0x62c, 0x3b, 0x628, 0x3b, 0x436, 0x441, 0x3b, 0x434, 0x441, 0x3b, 0x441, 0x441, 0x3b, 0x441, 0x440, 0x3b, 0x431, 0x441, 0x3b, 0x436,
+0x43c, 0x3b, 0x441, 0x431, 0x3b, 0x436, 0x435, 0x43a, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x434, 0x4af, 0x439, 0x441, 0x435, 0x43d,
+0x431, 0x456, 0x3b, 0x441, 0x435, 0x439, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x441, 0x4d9, 0x440, 0x441, 0x435, 0x43d, 0x431, 0x456,
+0x3b, 0x431, 0x435, 0x439, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x436, 0x4b1, 0x43c, 0x430, 0x3b, 0x441, 0x435, 0x43d, 0x431, 0x456,
+0x3b, 0x416, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x421, 0x3b, 0x411, 0x3b, 0x416, 0x3b, 0x421, 0x3b, 0x63, 0x79, 0x75, 0x2e, 0x3b,
+0x6d, 0x62, 0x65, 0x2e, 0x3b, 0x6b, 0x61, 0x62, 0x2e, 0x3b, 0x67, 0x74, 0x75, 0x2e, 0x3b, 0x6b, 0x61, 0x6e, 0x2e, 0x3b,
+0x67, 0x6e, 0x75, 0x2e, 0x3b, 0x67, 0x6e, 0x64, 0x2e, 0x3b, 0x4b, 0x75, 0x20, 0x63, 0x79, 0x75, 0x6d, 0x77, 0x65, 0x72,
+0x75, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x6d, 0x62, 0x65, 0x72, 0x65, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x6b, 0x61,
+0x62, 0x69, 0x72, 0x69, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4b, 0x75, 0x77,
+0x61, 0x20, 0x6b, 0x61, 0x6e, 0x65, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x4b,
+0x75, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x74, 0x75, 0x3b, 0x436, 0x435, 0x43a, 0x2e, 0x3b, 0x434,
+0x4af, 0x439, 0x2e, 0x3b, 0x448, 0x435, 0x439, 0x448, 0x2e, 0x3b, 0x448, 0x430, 0x440, 0x448, 0x2e, 0x3b, 0x431, 0x435, 0x439, 0x448,
+0x2e, 0x3b, 0x436, 0x443, 0x43c, 0x430, 0x3b, 0x438, 0x448, 0x43c, 0x2e, 0x3b, 0x436, 0x435, 0x43a, 0x448, 0x435, 0x43c, 0x431, 0x438,
+0x3b, 0x434, 0x4af, 0x439, 0x448, 0x4e9, 0x43c, 0x431, 0x4af, 0x3b, 0x448, 0x435, 0x439, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x448,
+0x430, 0x440, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x431, 0x435, 0x439, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x436, 0x443, 0x43c,
+0x430, 0x3b, 0x438, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x416, 0x3b, 0x414, 0x3b, 0x428, 0x3b, 0x428, 0x3b, 0x411, 0x3b, 0x416,
+0x3b, 0x418, 0x3b, 0xc77c, 0x3b, 0xc6d4, 0x3b, 0xd654, 0x3b, 0xc218, 0x3b, 0xbaa9, 0x3b, 0xae08, 0x3b, 0xd1a0, 0x3b, 0xc77c, 0xc694, 0xc77c,
+0x3b, 0xc6d4, 0xc694, 0xc77c, 0x3b, 0xd654, 0xc694, 0xc77c, 0x3b, 0xc218, 0xc694, 0xc77c, 0x3b, 0xbaa9, 0xc694, 0xc77c, 0x3b, 0xae08, 0xc694, 0xc77c,
+0x3b, 0xd1a0, 0xc694, 0xc77c, 0x3b, 0x79, 0x15f, 0x3b, 0x64, 0x15f, 0x3b, 0x73, 0x15f, 0x3b, 0xe7, 0x15f, 0x3b, 0x70, 0x15f, 0x3b,
+0xee, 0x6e, 0x3b, 0x15f, 0x3b, 0x79, 0x65, 0x6b, 0x15f, 0x65, 0x6d, 0x3b, 0x64, 0x75, 0x15f, 0x65, 0x6d, 0x3b, 0x73, 0xea,
+0x15f, 0x65, 0x6d, 0x3b, 0xe7, 0x61, 0x72, 0x15f, 0x65, 0x6d, 0x3b, 0x70, 0xea, 0x6e, 0x63, 0x15f, 0x65, 0x6d, 0x3b, 0xee,
+0x6e, 0x3b, 0x15f, 0x65, 0x6d, 0xee, 0x3b, 0x59, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0xc7, 0x3b, 0x50, 0x3b, 0xce, 0x3b, 0x15e,
+0x3b, 0x63, 0x75, 0x2e, 0x3b, 0x6d, 0x62, 0x65, 0x2e, 0x3b, 0x6b, 0x61, 0x62, 0x2e, 0x3b, 0x67, 0x74, 0x75, 0x2e, 0x3b,
+0x6b, 0x61, 0x6e, 0x2e, 0x3b, 0x67, 0x6e, 0x75, 0x2e, 0x3b, 0x67, 0x6e, 0x64, 0x2e, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x2019,
+0x69, 0x6e, 0x64, 0x77, 0x69, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x62, 0x65, 0x72, 0x65, 0x3b, 0x4b, 0x75,
+0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74,
+0x61, 0x74, 0x75, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x65, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61,
+0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x74, 0x75, 0x3b, 0xead, 0xeb2, 0xe97, 0xeb4, 0xe94, 0x3b, 0xe88, 0xeb1, 0xe99, 0x3b, 0xead, 0xeb1, 0xe87, 0xe84, 0xeb2, 0xe99,
+0x3b, 0xe9e, 0xeb8, 0xe94, 0x3b, 0xe9e, 0xeb0, 0xeab, 0xeb1, 0xe94, 0x3b, 0xeaa, 0xeb8, 0xe81, 0x3b, 0xec0, 0xeaa, 0xebb, 0xeb2, 0x3b,
+0xea7, 0xeb1, 0xe99, 0xead, 0xeb2, 0xe97, 0xeb4, 0xe94, 0x3b, 0xea7, 0xeb1, 0xe99, 0xe88, 0xeb1, 0xe99, 0x3b, 0xea7, 0xeb1, 0xe99, 0xead,
+0xeb1, 0xe87, 0xe84, 0xeb2, 0xe99, 0x3b, 0xea7, 0xeb1, 0xe99, 0xe9e, 0xeb8, 0xe94, 0x3b, 0xea7, 0xeb1, 0xe99, 0xe9e, 0xeb0, 0xeab, 0xeb1,
+0xe94, 0x3b, 0xea7, 0xeb1, 0xe99, 0xeaa, 0xeb8, 0xe81, 0x3b, 0xea7, 0xeb1, 0xe99, 0xec0, 0xeaa, 0xebb, 0xeb2, 0x3b, 0xead, 0xeb2, 0x3b,
+0xe88, 0x3b, 0xead, 0x3b, 0xe9e, 0x3b, 0xe9e, 0xeab, 0x3b, 0xeaa, 0xeb8, 0x3b, 0xeaa, 0x3b, 0x53, 0x76, 0x113, 0x74, 0x64, 0x2e,
+0x3b, 0x50, 0x69, 0x72, 0x6d, 0x64, 0x2e, 0x3b, 0x4f, 0x74, 0x72, 0x64, 0x2e, 0x3b, 0x54, 0x72, 0x65, 0x161, 0x64, 0x2e,
+0x3b, 0x43, 0x65, 0x74, 0x75, 0x72, 0x74, 0x64, 0x2e, 0x3b, 0x50, 0x69, 0x65, 0x6b, 0x74, 0x64, 0x2e, 0x3b, 0x53, 0x65,
+0x73, 0x74, 0x64, 0x2e, 0x3b, 0x53, 0x76, 0x113, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x50, 0x69, 0x72, 0x6d, 0x64,
+0x69, 0x65, 0x6e, 0x61, 0x3b, 0x4f, 0x74, 0x72, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x54, 0x72, 0x65, 0x161, 0x64, 0x69,
+0x65, 0x6e, 0x61, 0x3b, 0x43, 0x65, 0x74, 0x75, 0x72, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x50, 0x69, 0x65, 0x6b,
+0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x53, 0x65, 0x73, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x53, 0x3b, 0x50,
+0x3b, 0x4f, 0x3b, 0x54, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x73, 0x76, 0x113, 0x74, 0x64, 0x2e, 0x3b, 0x70, 0x69,
+0x72, 0x6d, 0x64, 0x2e, 0x3b, 0x6f, 0x74, 0x72, 0x64, 0x2e, 0x3b, 0x74, 0x72, 0x65, 0x161, 0x64, 0x2e, 0x3b, 0x63, 0x65,
+0x74, 0x75, 0x72, 0x74, 0x64, 0x2e, 0x3b, 0x70, 0x69, 0x65, 0x6b, 0x74, 0x64, 0x2e, 0x3b, 0x73, 0x65, 0x73, 0x74, 0x64,
+0x2e, 0x3b, 0x73, 0x76, 0x113, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x70, 0x69, 0x72, 0x6d, 0x64, 0x69, 0x65, 0x6e,
+0x61, 0x3b, 0x6f, 0x74, 0x72, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x74, 0x72, 0x65, 0x161, 0x64, 0x69, 0x65, 0x6e, 0x61,
+0x3b, 0x63, 0x65, 0x74, 0x75, 0x72, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x70, 0x69, 0x65, 0x6b, 0x74, 0x64, 0x69,
+0x65, 0x6e, 0x61, 0x3b, 0x73, 0x65, 0x73, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x65, 0x79, 0x65, 0x3b, 0x79, 0x62,
+0x6f, 0x3b, 0x6d, 0x62, 0x6c, 0x3b, 0x6d, 0x73, 0x74, 0x3b, 0x6d, 0x69, 0x6e, 0x3b, 0x6d, 0x74, 0x6e, 0x3b, 0x6d, 0x70,
+0x73, 0x3b, 0x65, 0x79, 0x65, 0x6e, 0x67, 0x61, 0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254, 0x20, 0x6d, 0x77, 0x61, 0x20,
+0x79, 0x61, 0x6d, 0x62, 0x6f, 0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254, 0x20, 0x6d, 0x77, 0x61, 0x20, 0x6d, 0xed, 0x62,
+0x61, 0x6c, 0xe9, 0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254, 0x20, 0x6d, 0x77, 0x61, 0x20, 0x6d, 0xed, 0x73, 0xe1, 0x74,
+0x6f, 0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x6e, 0xe9, 0x69, 0x3b, 0x6d, 0x6f,
+0x6b, 0x254, 0x6c, 0x254, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x74, 0xe1, 0x6e, 0x6f, 0x3b, 0x6d, 0x70, 0x254, 0x301, 0x73,
+0x254, 0x3b, 0x65, 0x3b, 0x79, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x70, 0x3b, 0x73, 0x6b, 0x3b, 0x70,
+0x72, 0x3b, 0x61, 0x6e, 0x3b, 0x74, 0x72, 0x3b, 0x6b, 0x74, 0x3b, 0x70, 0x6e, 0x3b, 0x161, 0x74, 0x3b, 0x73, 0x65, 0x6b,
+0x6d, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x70, 0x69, 0x72, 0x6d, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73,
+0x3b, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x74, 0x72, 0x65, 0x10d, 0x69, 0x61, 0x64,
+0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x6b, 0x65, 0x74, 0x76, 0x69, 0x72, 0x74, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73,
+0x3b, 0x70, 0x65, 0x6e, 0x6b, 0x74, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x161, 0x65, 0x161, 0x74, 0x61, 0x64,
+0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x53, 0x3b, 0x50, 0x3b, 0x41, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x50, 0x3b, 0x160, 0x3b,
+0x43d, 0x435, 0x434, 0x2e, 0x3b, 0x43f, 0x43e, 0x43d, 0x2e, 0x3b, 0x432, 0x442, 0x43e, 0x2e, 0x3b, 0x441, 0x440, 0x435, 0x2e, 0x3b,
+0x447, 0x435, 0x442, 0x2e, 0x3b, 0x43f, 0x435, 0x442, 0x2e, 0x3b, 0x441, 0x430, 0x431, 0x2e, 0x3b, 0x43d, 0x435, 0x434, 0x435, 0x43b,
+0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x435, 0x43b, 0x43d, 0x438, 0x43a, 0x3b, 0x432, 0x442, 0x43e, 0x440, 0x43d, 0x438, 0x43a,
+0x3b, 0x441, 0x440, 0x435, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x43e, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x43e,
+0x43a, 0x3b, 0x441, 0x430, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x43d, 0x435, 0x434, 0x2e, 0x3b, 0x43f, 0x43e, 0x43d, 0x2e, 0x3b, 0x432,
+0x442, 0x2e, 0x3b, 0x441, 0x440, 0x435, 0x2e, 0x3b, 0x447, 0x435, 0x442, 0x2e, 0x3b, 0x43f, 0x435, 0x442, 0x2e, 0x3b, 0x441, 0x430,
+0x431, 0x2e, 0x3b, 0x41, 0x6c, 0x61, 0x68, 0x3b, 0x41, 0x6c, 0x61, 0x74, 0x73, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0x41, 0x6c,
+0x61, 0x72, 0x3b, 0x41, 0x6c, 0x61, 0x6b, 0x3b, 0x5a, 0x6f, 0x6d, 0x3b, 0x41, 0x73, 0x61, 0x62, 0x3b, 0x41, 0x6c, 0x61,
+0x68, 0x61, 0x64, 0x79, 0x3b, 0x41, 0x6c, 0x61, 0x74, 0x73, 0x69, 0x6e, 0x61, 0x69, 0x6e, 0x79, 0x3b, 0x54, 0x61, 0x6c,
+0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x6f, 0x62, 0x69, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x6b, 0x61, 0x6d, 0x69,
+0x73, 0x79, 0x3b, 0x5a, 0x6f, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x61, 0x62, 0x6f, 0x74, 0x73, 0x79, 0x3b, 0x41, 0x3b, 0x41,
+0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x5a, 0x3b, 0x41, 0x3b, 0x41, 0x68, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x3b, 0x53,
+0x65, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x3b, 0x4b, 0x68, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x41,
+0x68, 0x61, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x69, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x61, 0x73, 0x61, 0x3b, 0x52, 0x61, 0x62,
+0x75, 0x3b, 0x4b, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x74, 0x3b, 0x53, 0x61, 0x62, 0x74,
+0x75, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0xd1e, 0xd3e, 0xd2f, 0xd7c,
+0x3b, 0xd24, 0xd3f, 0xd19, 0xd4d, 0xd15, 0xd7e, 0x3b, 0xd1a, 0xd4a, 0xd35, 0xd4d, 0xd35, 0x3b, 0xd2c, 0xd41, 0xd27, 0xd7b, 0x3b, 0xd35,
+0xd4d, 0xd2f, 0xd3e, 0xd34, 0xd02, 0x3b, 0xd35, 0xd46, 0xd33, 0xd4d, 0xd33, 0xd3f, 0x3b, 0xd36, 0xd28, 0xd3f, 0x3b, 0xd1e, 0xd3e, 0xd2f,
+0xd31, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd24, 0xd3f, 0xd19, 0xd4d, 0xd15, 0xd33, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1a,
+0xd4a, 0xd35, 0xd4d, 0xd35, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd2c, 0xd41, 0xd27, 0xd28, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b,
+0xd35, 0xd4d, 0xd2f, 0xd3e, 0xd34, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd35, 0xd46, 0xd33, 0xd4d, 0xd33, 0xd3f, 0xd2f, 0xd3e, 0xd34,
+0xd4d, 0x200c, 0xd1a, 0x3b, 0xd36, 0xd28, 0xd3f, 0xd2f, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1e, 0xd3e, 0x3b, 0xd24, 0xd3f, 0x3b,
+0xd1a, 0xd4a, 0x3b, 0xd2c, 0xd41, 0x3b, 0xd35, 0xd4d, 0xd2f, 0xd3e, 0x3b, 0xd35, 0xd46, 0x3b, 0xd36, 0x3b, 0xd1e, 0xd3e, 0xd2f, 0xd31,
+0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd24, 0xd3f, 0xd19, 0xd4d, 0xd15, 0xd33, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1a, 0xd4a,
+0xd35, 0xd4d, 0xd35, 0xd3e, 0xd34, 0xd4d, 0xd1a, 0x3b, 0xd2c, 0xd41, 0xd27, 0xd28, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd35, 0xd4d,
+0xd2f, 0xd3e, 0xd34, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd35, 0xd46, 0xd33, 0xd4d, 0xd33, 0xd3f, 0xd2f, 0xd3e, 0xd34, 0xd4d, 0x200c,
+0xd1a, 0x3b, 0xd36, 0xd28, 0xd3f, 0xd2f, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1e, 0x3b, 0xd24, 0xd3f, 0x3b, 0xd1a, 0xd4a, 0x3b,
+0xd2c, 0xd41, 0x3b, 0xd35, 0xd4d, 0xd2f, 0xd3e, 0x3b, 0xd35, 0xd46, 0x3b, 0xd36, 0x3b, 0x126, 0x61, 0x64, 0x3b, 0x54, 0x6e, 0x65,
+0x3b, 0x54, 0x6c, 0x69, 0x3b, 0x45, 0x72, 0x62, 0x3b, 0x126, 0x61, 0x6d, 0x3b, 0x120, 0x69, 0x6d, 0x3b, 0x53, 0x69, 0x62,
+0x3b, 0x49, 0x6c, 0x2d, 0x126, 0x61, 0x64, 0x64, 0x3b, 0x49, 0x74, 0x2d, 0x54, 0x6e, 0x65, 0x6a, 0x6e, 0x3b, 0x49, 0x74,
+0x2d, 0x54, 0x6c, 0x69, 0x65, 0x74, 0x61, 0x3b, 0x4c, 0x2d, 0x45, 0x72, 0x62, 0x67, 0x127, 0x61, 0x3b, 0x49, 0x6c, 0x2d,
+0x126, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x49, 0x6c, 0x2d, 0x120, 0x69, 0x6d, 0x67, 0x127, 0x61, 0x3b, 0x49, 0x73, 0x2d, 0x53,
+0x69, 0x62, 0x74, 0x3b, 0x126, 0x64, 0x3b, 0x54, 0x6e, 0x3b, 0x54, 0x6c, 0x3b, 0x45, 0x72, 0x3b, 0x126, 0x6d, 0x3b, 0x120,
+0x6d, 0x3b, 0x53, 0x62, 0x3b, 0x126, 0x64, 0x3b, 0x54, 0x3b, 0x54, 0x6c, 0x3b, 0x45, 0x72, 0x3b, 0x126, 0x6d, 0x3b, 0x120,
+0x6d, 0x3b, 0x53, 0x62, 0x3b, 0x54, 0x61, 0x70, 0x3b, 0x48, 0x69, 0x6e, 0x3b, 0x54, 0x16b, 0x3b, 0x41, 0x70, 0x61, 0x3b,
+0x50, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x72, 0x3b, 0x48, 0x6f, 0x72, 0x3b, 0x52, 0x101, 0x74, 0x61, 0x70, 0x75, 0x3b, 0x52,
+0x101, 0x68, 0x69, 0x6e, 0x61, 0x3b, 0x52, 0x101, 0x74, 0x16b, 0x3b, 0x52, 0x101, 0x61, 0x70, 0x61, 0x3b, 0x52, 0x101, 0x70,
+0x61, 0x72, 0x65, 0x3b, 0x52, 0x101, 0x6d, 0x65, 0x72, 0x65, 0x3b, 0x52, 0x101, 0x68, 0x6f, 0x72, 0x6f, 0x69, 0x3b, 0x54,
+0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x930, 0x935, 0x93f, 0x3b, 0x938, 0x94b, 0x92e,
+0x3b, 0x92e, 0x902, 0x917, 0x933, 0x3b, 0x92c, 0x941, 0x927, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930,
+0x3b, 0x936, 0x928, 0x93f, 0x3b, 0x930, 0x935, 0x93f, 0x935, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x935, 0x93e, 0x930, 0x3b, 0x92e,
+0x902, 0x917, 0x933, 0x935, 0x93e, 0x930, 0x3b, 0x92c, 0x941, 0x927, 0x935, 0x93e, 0x930, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x935, 0x93e,
+0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x935, 0x93e, 0x930, 0x3b, 0x41d, 0x44f,
+0x3b, 0x414, 0x430, 0x3b, 0x41c, 0x44f, 0x3b, 0x41b, 0x445, 0x3b, 0x41f, 0x4af, 0x3b, 0x411, 0x430, 0x3b, 0x411, 0x44f, 0x3b, 0x41d,
+0x44f, 0x43c, 0x3b, 0x414, 0x430, 0x432, 0x430, 0x430, 0x3b, 0x41c, 0x44f, 0x433, 0x43c, 0x430, 0x440, 0x3b, 0x41b, 0x445, 0x430, 0x433,
+0x432, 0x430, 0x3b, 0x41f, 0x4af, 0x440, 0x44d, 0x432, 0x3b, 0x411, 0x430, 0x430, 0x441, 0x430, 0x43d, 0x3b, 0x411, 0x44f, 0x43c, 0x431,
+0x430, 0x3b, 0x43d, 0x44f, 0x43c, 0x3b, 0x434, 0x430, 0x432, 0x430, 0x430, 0x3b, 0x43c, 0x44f, 0x433, 0x43c, 0x430, 0x440, 0x3b, 0x43b,
+0x445, 0x430, 0x433, 0x432, 0x430, 0x3b, 0x43f, 0x4af, 0x440, 0x44d, 0x432, 0x3b, 0x431, 0x430, 0x430, 0x441, 0x430, 0x43d, 0x3b, 0x431,
+0x44f, 0x43c, 0x431, 0x430, 0x3b, 0x906, 0x907, 0x924, 0x3b, 0x938, 0x94b, 0x92e, 0x3b, 0x92e, 0x919, 0x94d, 0x917, 0x932, 0x3b, 0x92c,
+0x941, 0x927, 0x3b, 0x92c, 0x93f, 0x939, 0x93f, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x3b, 0x906, 0x907,
+0x924, 0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x92c, 0x93e, 0x930, 0x3b, 0x92e, 0x919, 0x94d, 0x917, 0x932, 0x92c, 0x93e, 0x930,
+0x3b, 0x92c, 0x941, 0x927, 0x92c, 0x93e, 0x930, 0x3b, 0x92c, 0x93f, 0x939, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d,
+0x930, 0x92c, 0x93e, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x906, 0x3b, 0x938, 0x94b, 0x3b, 0x92e, 0x3b, 0x92c,
+0x941, 0x3b, 0x92c, 0x93f, 0x3b, 0x936, 0x941, 0x3b, 0x936, 0x3b, 0xb30, 0xb2c, 0xb3f, 0x3b, 0xb38, 0xb4b, 0xb2e, 0x3b, 0xb2e, 0xb19,
+0xb4d, 0xb17, 0xb33, 0x3b, 0xb2c, 0xb41, 0xb27, 0x3b, 0xb17, 0xb41, 0xb30, 0xb41, 0x3b, 0xb36, 0xb41, 0xb15, 0xb4d, 0xb30, 0x3b, 0xb36,
+0xb28, 0xb3f, 0x3b, 0xb30, 0xb2c, 0xb3f, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb38, 0xb4b, 0xb2e, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb2e, 0xb19, 0xb4d,
+0xb17, 0xb33, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb2c, 0xb41, 0xb27, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb17, 0xb41, 0xb30, 0xb41, 0xb2c, 0xb3e, 0xb30,
+0x3b, 0xb36, 0xb41, 0xb15, 0xb4d, 0xb30, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb36, 0xb28, 0xb3f, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb30, 0x3b, 0xb38,
+0xb4b, 0x3b, 0xb2e, 0x3b, 0xb2c, 0xb41, 0x3b, 0xb17, 0xb41, 0x3b, 0xb36, 0xb41, 0x3b, 0xb36, 0x3b, 0x64a, 0x648, 0x646, 0x6cd, 0x3b,
+0x62f, 0x648, 0x646, 0x6cd, 0x3b, 0x62f, 0x631, 0x6d0, 0x646, 0x6cd, 0x3b, 0x685, 0x644, 0x631, 0x646, 0x6cd, 0x3b, 0x67e, 0x64a, 0x646,
+0x681, 0x646, 0x6cd, 0x3b, 0x62c, 0x645, 0x639, 0x647, 0x3b, 0x627, 0x648, 0x646, 0x6cd, 0x3b, 0x6cc, 0x6a9, 0x634, 0x646, 0x628, 0x647,
+0x3b, 0x62f, 0x648, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x633, 0x647, 0x200c, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x686, 0x647, 0x627, 0x631,
+0x634, 0x646, 0x628, 0x647, 0x3b, 0x67e, 0x646, 0x62c, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x62c, 0x645, 0x639, 0x647, 0x3b, 0x634, 0x646,
+0x628, 0x647, 0x3b, 0x6cc, 0x3b, 0x62f, 0x3b, 0x633, 0x3b, 0x686, 0x3b, 0x67e, 0x3b, 0x62c, 0x3b, 0x634, 0x3b, 0x6e, 0x69, 0x65,
+0x64, 0x7a, 0x2e, 0x3b, 0x70, 0x6f, 0x6e, 0x2e, 0x3b, 0x77, 0x74, 0x2e, 0x3b, 0x15b, 0x72, 0x2e, 0x3b, 0x63, 0x7a, 0x77,
+0x2e, 0x3b, 0x70, 0x74, 0x2e, 0x3b, 0x73, 0x6f, 0x62, 0x2e, 0x3b, 0x6e, 0x69, 0x65, 0x64, 0x7a, 0x69, 0x65, 0x6c, 0x61,
+0x3b, 0x70, 0x6f, 0x6e, 0x69, 0x65, 0x64, 0x7a, 0x69, 0x61, 0x142, 0x65, 0x6b, 0x3b, 0x77, 0x74, 0x6f, 0x72, 0x65, 0x6b,
+0x3b, 0x15b, 0x72, 0x6f, 0x64, 0x61, 0x3b, 0x63, 0x7a, 0x77, 0x61, 0x72, 0x74, 0x65, 0x6b, 0x3b, 0x70, 0x69, 0x105, 0x74,
+0x65, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x4e, 0x3b, 0x50, 0x3b, 0x57, 0x3b, 0x15a, 0x3b, 0x43, 0x3b,
+0x50, 0x3b, 0x53, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x77, 0x3b, 0x15b, 0x3b, 0x63, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x64, 0x6f,
+0x6d, 0x2e, 0x3b, 0x73, 0x65, 0x67, 0x2e, 0x3b, 0x74, 0x65, 0x72, 0x2e, 0x3b, 0x71, 0x75, 0x61, 0x2e, 0x3b, 0x71, 0x75,
+0x69, 0x2e, 0x3b, 0x73, 0x65, 0x78, 0x2e, 0x3b, 0x73, 0xe1, 0x62, 0x2e, 0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f,
+0x3b, 0x73, 0x65, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b, 0x74, 0x65, 0x72, 0xe7, 0x61,
+0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b, 0x71, 0x75, 0x61, 0x72, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b,
+0x71, 0x75, 0x69, 0x6e, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b, 0x73, 0x65, 0x78, 0x74, 0x61, 0x2d, 0x66,
+0x65, 0x69, 0x72, 0x61, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x51, 0x3b,
+0x51, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x67, 0x75, 0x6e, 0x64,
+0x61, 0x3b, 0x74, 0x65, 0x72, 0xe7, 0x61, 0x3b, 0x71, 0x75, 0x61, 0x72, 0x74, 0x61, 0x3b, 0x71, 0x75, 0x69, 0x6e, 0x74,
+0x61, 0x3b, 0x73, 0x65, 0x78, 0x74, 0x61, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0xa10, 0xa24, 0x3b, 0xa38, 0xa4b,
+0xa2e, 0x3b, 0xa2e, 0xa70, 0xa17, 0xa32, 0x3b, 0xa2c, 0xa41, 0xa71, 0xa27, 0x3b, 0xa35, 0xa40, 0xa30, 0x3b, 0xa38, 0xa3c, 0xa41, 0xa71,
+0xa15, 0xa30, 0x3b, 0xa38, 0xa3c, 0xa28, 0xa3f, 0xa71, 0xa1a, 0xa30, 0x3b, 0xa10, 0xa24, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa38, 0xa4b, 0xa2e,
+0xa35, 0xa3e, 0xa30, 0x3b, 0xa2e, 0xa70, 0xa17, 0xa32, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa2c, 0xa41, 0xa71, 0xa27, 0xa35, 0xa3e, 0xa30, 0x3b,
+0xa35, 0xa40, 0xa30, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa38, 0xa3c, 0xa41, 0xa71, 0xa15, 0xa30, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa38, 0xa3c, 0xa28,
+0xa3f, 0xa71, 0xa1a, 0xa30, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa10, 0x3b, 0xa38, 0xa4b, 0x3b, 0xa2e, 0xa70, 0x3b, 0xa2c, 0xa41, 0xa71, 0x3b,
+0xa35, 0xa40, 0x3b, 0xa38, 0xa3c, 0xa41, 0xa71, 0x3b, 0xa38, 0xa3c, 0x3b, 0x627, 0x62a, 0x648, 0x627, 0x631, 0x3b, 0x67e, 0x6cc, 0x631,
+0x3b, 0x645, 0x646, 0x6af, 0x644, 0x3b, 0x628, 0x64f, 0x62f, 0x6be, 0x3b, 0x62c, 0x645, 0x639, 0x631, 0x627, 0x62a, 0x3b, 0x62c, 0x645,
+0x639, 0x6c1, 0x3b, 0x6c1, 0x641, 0x62a, 0x6c1, 0x3b, 0x44, 0x6f, 0x6d, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b,
+0x4d, 0x69, 0xe9, 0x3b, 0x4a, 0x75, 0x65, 0x3b, 0x56, 0x69, 0x65, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x44, 0x6f, 0x6d, 0x69,
+0x6e, 0x67, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x65, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x4d, 0x69, 0xe9,
+0x72, 0x63, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x4a, 0x75, 0x65, 0x76, 0x65, 0x73, 0x3b, 0x56, 0x69, 0x65, 0x72, 0x6e, 0x65,
+0x73, 0x3b, 0x53, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x58, 0x3b, 0x4a, 0x3b, 0x56,
+0x3b, 0x53, 0x3b, 0x64, 0x75, 0x3b, 0x67, 0x6c, 0x69, 0x3b, 0x6d, 0x61, 0x3b, 0x6d, 0x65, 0x3b, 0x67, 0x69, 0x65, 0x3b,
+0x76, 0x65, 0x3b, 0x73, 0x6f, 0x3b, 0x64, 0x75, 0x6d, 0x65, 0x6e, 0x67, 0x69, 0x61, 0x3b, 0x67, 0x6c, 0x69, 0x6e, 0x64,
+0x65, 0x73, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x69, 0x3b, 0x6d, 0x65, 0x73, 0x65, 0x6d, 0x6e, 0x61, 0x3b, 0x67,
+0x69, 0x65, 0x76, 0x67, 0x69, 0x61, 0x3b, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x64, 0x69, 0x3b, 0x73, 0x6f, 0x6e, 0x64,
+0x61, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x64, 0x75, 0x6d, 0x2e,
+0x3b, 0x6c, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d, 0x69, 0x65, 0x2e, 0x3b, 0x6a, 0x6f, 0x69, 0x3b,
+0x76, 0x69, 0x6e, 0x2e, 0x3b, 0x73, 0xe2, 0x6d, 0x2e, 0x3b, 0x64, 0x75, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x103, 0x3b, 0x6c,
+0x75, 0x6e, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x21b, 0x69, 0x3b, 0x6d, 0x69, 0x65, 0x72, 0x63, 0x75, 0x72, 0x69, 0x3b, 0x6a,
+0x6f, 0x69, 0x3b, 0x76, 0x69, 0x6e, 0x65, 0x72, 0x69, 0x3b, 0x73, 0xe2, 0x6d, 0x62, 0x103, 0x74, 0x103, 0x3b, 0x44, 0x75,
+0x6d, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x69, 0x65, 0x3b, 0x4a, 0x6f, 0x69, 0x3b, 0x56, 0x69,
+0x6e, 0x3b, 0x53, 0xe2, 0x6d, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x61, 0x3b, 0x4d, 0x69, 0x3b, 0x4a, 0x3b, 0x56, 0x3b,
+0x53, 0x3b, 0x432, 0x441, 0x3b, 0x43f, 0x43d, 0x3b, 0x432, 0x442, 0x3b, 0x441, 0x440, 0x3b, 0x447, 0x442, 0x3b, 0x43f, 0x442, 0x3b,
+0x441, 0x431, 0x3b, 0x432, 0x43e, 0x441, 0x43a, 0x440, 0x435, 0x441, 0x435, 0x43d, 0x44c, 0x435, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434,
+0x435, 0x43b, 0x44c, 0x43d, 0x438, 0x43a, 0x3b, 0x432, 0x442, 0x43e, 0x440, 0x43d, 0x438, 0x43a, 0x3b, 0x441, 0x440, 0x435, 0x434, 0x430,
+0x3b, 0x447, 0x435, 0x442, 0x432, 0x435, 0x440, 0x433, 0x3b, 0x43f, 0x44f, 0x442, 0x43d, 0x438, 0x446, 0x430, 0x3b, 0x441, 0x443, 0x431,
+0x431, 0x43e, 0x442, 0x430, 0x3b, 0x412, 0x3b, 0x41f, 0x3b, 0x412, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x421, 0x3b, 0x42,
+0x6b, 0x31, 0x3b, 0x42, 0x6b, 0x32, 0x3b, 0x42, 0x6b, 0x33, 0x3b, 0x42, 0x6b, 0x34, 0x3b, 0x42, 0x6b, 0x35, 0x3b, 0x4c,
+0xe2, 0x70, 0x3b, 0x4c, 0xe2, 0x79, 0x3b, 0x42, 0x69, 0x6b, 0x75, 0x61, 0x2d, 0xf4, 0x6b, 0x6f, 0x3b, 0x42, 0xef, 0x6b,
+0x75, 0x61, 0x2d, 0xfb, 0x73, 0x65, 0x3b, 0x42, 0xef, 0x6b, 0x75, 0x61, 0x2d, 0x70, 0x74, 0xe2, 0x3b, 0x42, 0xef, 0x6b,
+0x75, 0x61, 0x2d, 0x75, 0x73, 0xef, 0xf6, 0x3b, 0x42, 0xef, 0x6b, 0x75, 0x61, 0x2d, 0x6f, 0x6b, 0xfc, 0x3b, 0x4c, 0xe2,
+0x70, 0xf4, 0x73, 0xf6, 0x3b, 0x4c, 0xe2, 0x79, 0x65, 0x6e, 0x67, 0x61, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x53,
+0x3b, 0x4b, 0x3b, 0x50, 0x3b, 0x59, 0x3b, 0x43d, 0x435, 0x434, 0x3b, 0x43f, 0x43e, 0x43d, 0x3b, 0x443, 0x442, 0x43e, 0x3b, 0x441,
+0x440, 0x435, 0x3b, 0x447, 0x435, 0x442, 0x3b, 0x43f, 0x435, 0x442, 0x3b, 0x441, 0x443, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x435, 0x459,
+0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x435, 0x459, 0x430, 0x43a, 0x3b, 0x443, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b, 0x441,
+0x440, 0x435, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x430, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x430, 0x43a, 0x3b,
+0x441, 0x443, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x43d, 0x3b, 0x43f, 0x3b, 0x443, 0x3b, 0x441, 0x3b, 0x447, 0x3b, 0x43f, 0x3b, 0x441,
+0x3b, 0x43d, 0x435, 0x434, 0x3b, 0x43f, 0x43e, 0x43d, 0x3b, 0x443, 0x442, 0x3b, 0x441, 0x440, 0x3b, 0x447, 0x435, 0x442, 0x3b, 0x43f,
+0x435, 0x442, 0x3b, 0x441, 0x443, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x458, 0x435, 0x459, 0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434,
+0x435, 0x459, 0x430, 0x43a, 0x3b, 0x443, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b, 0x441, 0x440, 0x438, 0x458, 0x435, 0x434, 0x430, 0x3b,
+0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x430, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x430, 0x43a, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442,
+0x430, 0x3b, 0x6e, 0x65, 0x64, 0x3b, 0x70, 0x6f, 0x6e, 0x3b, 0x75, 0x74, 0x3b, 0x73, 0x72, 0x3b, 0x10d, 0x65, 0x74, 0x3b,
+0x70, 0x65, 0x74, 0x3b, 0x73, 0x75, 0x62, 0x3b, 0x6e, 0x65, 0x64, 0x6a, 0x65, 0x6c, 0x6a, 0x61, 0x3b, 0x70, 0x6f, 0x6e,
+0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x6b, 0x3b, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x6b, 0x3b, 0x73, 0x72, 0x69, 0x6a, 0x65,
+0x64, 0x61, 0x3b, 0x10d, 0x65, 0x74, 0x76, 0x72, 0x74, 0x61, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x61, 0x6b, 0x3b, 0x73, 0x75,
+0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x65, 0x64, 0x3b, 0x70, 0x6f, 0x6e, 0x3b, 0x75, 0x74, 0x6f, 0x3b, 0x73, 0x72, 0x65,
+0x3b, 0x10d, 0x65, 0x74, 0x3b, 0x70, 0x65, 0x74, 0x3b, 0x73, 0x75, 0x62, 0x3b, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61,
+0x3b, 0x70, 0x6f, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x6b, 0x3b, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x6b, 0x3b, 0x73,
+0x72, 0x65, 0x64, 0x61, 0x3b, 0x10d, 0x65, 0x74, 0x76, 0x72, 0x74, 0x61, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x61, 0x6b, 0x3b,
+0x73, 0x75, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x425, 0x446, 0x431, 0x3b, 0x41a, 0x440, 0x441, 0x3b, 0x414, 0x446, 0x433, 0x3b, 0x4d4,
+0x440, 0x442, 0x3b, 0x426, 0x43f, 0x440, 0x3b, 0x41c, 0x440, 0x431, 0x3b, 0x421, 0x431, 0x442, 0x3b, 0x425, 0x443, 0x44b, 0x446, 0x430,
+0x443, 0x431, 0x43e, 0x43d, 0x3b, 0x41a, 0x44a, 0x443, 0x44b, 0x440, 0x438, 0x441, 0x4d5, 0x440, 0x3b, 0x414, 0x44b, 0x446, 0x446, 0x4d5,
+0x433, 0x3b, 0x4d4, 0x440, 0x442, 0x44b, 0x446, 0x446, 0x4d5, 0x433, 0x3b, 0x426, 0x44b, 0x43f, 0x43f, 0x4d5, 0x440, 0x4d5, 0x43c, 0x3b,
+0x41c, 0x430, 0x439, 0x440, 0x4d5, 0x43c, 0x431, 0x43e, 0x43d, 0x3b, 0x421, 0x430, 0x431, 0x430, 0x442, 0x3b, 0x425, 0x3b, 0x41a, 0x3b,
+0x414, 0x3b, 0x4d4, 0x3b, 0x426, 0x3b, 0x41c, 0x3b, 0x421, 0x3b, 0x445, 0x446, 0x431, 0x3b, 0x43a, 0x440, 0x441, 0x3b, 0x434, 0x446,
+0x433, 0x3b, 0x4d5, 0x440, 0x442, 0x3b, 0x446, 0x43f, 0x440, 0x3b, 0x43c, 0x440, 0x431, 0x3b, 0x441, 0x431, 0x442, 0x3b, 0x445, 0x443,
+0x44b, 0x446, 0x430, 0x443, 0x431, 0x43e, 0x43d, 0x3b, 0x43a, 0x44a, 0x443, 0x44b, 0x440, 0x438, 0x441, 0x4d5, 0x440, 0x3b, 0x434, 0x44b,
+0x446, 0x446, 0x4d5, 0x433, 0x3b, 0x4d5, 0x440, 0x442, 0x44b, 0x446, 0x446, 0x4d5, 0x433, 0x3b, 0x446, 0x44b, 0x43f, 0x43f, 0x4d5, 0x440,
+0x4d5, 0x43c, 0x3b, 0x43c, 0x430, 0x439, 0x440, 0x4d5, 0x43c, 0x431, 0x43e, 0x43d, 0x3b, 0x441, 0x430, 0x431, 0x430, 0x442, 0x3b, 0x53,
+0x76, 0x6f, 0x3b, 0x4d, 0x75, 0x76, 0x3b, 0x43, 0x68, 0x70, 0x3b, 0x43, 0x68, 0x74, 0x3b, 0x43, 0x68, 0x6e, 0x3b, 0x43,
+0x68, 0x73, 0x3b, 0x4d, 0x75, 0x67, 0x3b, 0x53, 0x76, 0x6f, 0x6e, 0x64, 0x6f, 0x3b, 0x4d, 0x75, 0x76, 0x68, 0x75, 0x72,
+0x6f, 0x3b, 0x43, 0x68, 0x69, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x43, 0x68,
+0x69, 0x6e, 0x61, 0x3b, 0x43, 0x68, 0x69, 0x73, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x75, 0x67, 0x6f, 0x76, 0x65, 0x72,
+0x61, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x4d, 0x3b, 0x622, 0x686, 0x631, 0x3b,
+0x633, 0x648, 0x645, 0x631, 0x3b, 0x627, 0x6b1, 0x627, 0x631, 0x648, 0x3b, 0x627, 0x631, 0x628, 0x639, 0x3b, 0x62e, 0x645, 0x64a, 0x633,
+0x3b, 0x62c, 0x645, 0x639, 0x648, 0x3b, 0x687, 0x646, 0x687, 0x631, 0x3b, 0x622, 0x686, 0x631, 0x3b, 0x633, 0x648, 0x3b, 0x627, 0x6b1,
+0x627, 0x631, 0x648, 0x3b, 0x627, 0x631, 0x628, 0x639, 0x3b, 0x62e, 0x645, 0x3b, 0x62c, 0x645, 0x639, 0x648, 0x3b, 0x687, 0x646, 0x687,
+0x631, 0x3b, 0xd89, 0xdbb, 0xdd2, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdb3, 0xdd4, 0xdaf, 0xdcf, 0x3b, 0xd85, 0xd9f, 0xdc4, 0x3b, 0xdb6, 0xdaf,
+0xdcf, 0xdaf, 0xdcf, 0x3b, 0xdb6, 0xdca, 0x200d, 0xdbb, 0xdc4, 0xdc3, 0xdca, 0x3b, 0xdc3, 0xdd2, 0xd9a, 0xdd4, 0x3b, 0xdc3, 0xdd9, 0xdb1,
+0x3b, 0xd89, 0xdbb, 0xdd2, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdb3, 0xdd4, 0xdaf, 0xdcf, 0x3b, 0xd85, 0xd9f, 0xdc4, 0xdbb, 0xdd4, 0xdc0, 0xdcf,
+0xdaf, 0xdcf, 0x3b, 0xdb6, 0xdaf, 0xdcf, 0xdaf, 0xdcf, 0x3b, 0xdb6, 0xdca, 0x200d, 0xdbb, 0xdc4, 0xdc3, 0xdca, 0xdb4, 0xdad, 0xdd2, 0xdb1,
+0xdca, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdd2, 0xd9a, 0xdd4, 0xdbb, 0xdcf, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdd9, 0xdb1, 0xdc3, 0xdd4, 0xdbb, 0xdcf,
+0xdaf, 0xdcf, 0x3b, 0xd89, 0x3b, 0xdc3, 0x3b, 0xd85, 0x3b, 0xdb6, 0x3b, 0xdb6, 0xdca, 0x200d, 0xdbb, 0x3b, 0xdc3, 0xdd2, 0x3b, 0xdc3,
+0xdd9, 0x3b, 0x6e, 0x65, 0x3b, 0x70, 0x6f, 0x3b, 0x75, 0x74, 0x3b, 0x73, 0x74, 0x3b, 0x161, 0x74, 0x3b, 0x70, 0x69, 0x3b,
+0x73, 0x6f, 0x3b, 0x6e, 0x65, 0x64, 0x65, 0x13e, 0x61, 0x3b, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x6c, 0x6f, 0x6b, 0x3b, 0x75,
+0x74, 0x6f, 0x72, 0x6f, 0x6b, 0x3b, 0x73, 0x74, 0x72, 0x65, 0x64, 0x61, 0x3b, 0x161, 0x74, 0x76, 0x72, 0x74, 0x6f, 0x6b,
+0x3b, 0x70, 0x69, 0x61, 0x74, 0x6f, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x75,
+0x3b, 0x73, 0x3b, 0x161, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x6e, 0x65, 0x64, 0x2e, 0x3b, 0x70, 0x6f, 0x6e, 0x2e, 0x3b, 0x74,
+0x6f, 0x72, 0x2e, 0x3b, 0x73, 0x72, 0x65, 0x2e, 0x3b, 0x10d, 0x65, 0x74, 0x2e, 0x3b, 0x70, 0x65, 0x74, 0x2e, 0x3b, 0x73,
+0x6f, 0x62, 0x2e, 0x3b, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x3b, 0x70, 0x6f, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a,
+0x65, 0x6b, 0x3b, 0x74, 0x6f, 0x72, 0x65, 0x6b, 0x3b, 0x73, 0x72, 0x65, 0x64, 0x61, 0x3b, 0x10d, 0x65, 0x74, 0x72, 0x74,
+0x65, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x65, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b,
+0x74, 0x3b, 0x73, 0x3b, 0x10d, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x41, 0x78, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x3b, 0x54, 0x6c,
+0x64, 0x6f, 0x3b, 0x41, 0x72, 0x62, 0x63, 0x3b, 0x4b, 0x68, 0x6d, 0x73, 0x3b, 0x4a, 0x6d, 0x63, 0x3b, 0x53, 0x62, 0x74,
+0x69, 0x3b, 0x41, 0x78, 0x61, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x69, 0x69, 0x6e, 0x3b, 0x54, 0x61, 0x6c, 0x61, 0x61, 0x64,
+0x6f, 0x3b, 0x41, 0x72, 0x62, 0x61, 0x63, 0x6f, 0x3b, 0x4b, 0x68, 0x61, 0x6d, 0x69, 0x69, 0x73, 0x3b, 0x4a, 0x69, 0x6d,
+0x63, 0x6f, 0x3b, 0x53, 0x61, 0x62, 0x74, 0x69, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x4b, 0x68, 0x3b,
+0x4a, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x2e, 0x3b, 0x6c, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d,
+0x69, 0xe9, 0x2e, 0x3b, 0x6a, 0x75, 0x65, 0x2e, 0x3b, 0x76, 0x69, 0x65, 0x2e, 0x3b, 0x73, 0xe1, 0x62, 0x2e, 0x3b, 0x64,
+0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x6c, 0x75, 0x6e, 0x65, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b,
+0x6d, 0x69, 0xe9, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x6a, 0x75, 0x65, 0x76, 0x65, 0x73, 0x3b, 0x76, 0x69, 0x65,
+0x72, 0x6e, 0x65, 0x73, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c, 0x69,
+0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75,
+0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d,
+0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x73, 0xf6, 0x6e, 0x3b, 0x6d, 0xe5, 0x6e, 0x3b,
+0x74, 0x69, 0x73, 0x3b, 0x6f, 0x6e, 0x73, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x3b, 0x66, 0x72, 0x65, 0x3b, 0x6c, 0xf6, 0x72,
+0x3b, 0x73, 0xf6, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0xe5, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x69, 0x73, 0x64, 0x61,
+0x67, 0x3b, 0x6f, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x66, 0x72, 0x65,
+0x64, 0x61, 0x67, 0x3b, 0x6c, 0xf6, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x42f, 0x448, 0x431, 0x3b, 0x414, 0x448, 0x431, 0x3b, 0x421,
+0x448, 0x431, 0x3b, 0x427, 0x448, 0x431, 0x3b, 0x41f, 0x448, 0x431, 0x3b, 0x4b6, 0x43c, 0x44a, 0x3b, 0x428, 0x43d, 0x431, 0x3b, 0x42f,
+0x43a, 0x448, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x414, 0x443, 0x448, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x421, 0x435, 0x448, 0x430, 0x43d,
+0x431, 0x435, 0x3b, 0x427, 0x43e, 0x440, 0x448, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x41f, 0x430, 0x43d, 0x4b7, 0x448, 0x430, 0x43d, 0x431,
+0x435, 0x3b, 0x4b6, 0x443, 0x43c, 0x44a, 0x430, 0x3b, 0x428, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x42f, 0x3b, 0x414, 0x3b, 0x421, 0x3b,
+0x427, 0x3b, 0x41f, 0x3b, 0x4b6, 0x3b, 0x428, 0x3b, 0xb9e, 0xbbe, 0xbaf, 0xbbf, 0x2e, 0x3b, 0xba4, 0xbbf, 0xb99, 0xbcd, 0x2e, 0x3b,
+0xb9a, 0xbc6, 0xbb5, 0xbcd, 0x2e, 0x3b, 0xbaa, 0xbc1, 0xba4, 0x2e, 0x3b, 0xbb5, 0xbbf, 0xbaf, 0xbbe, 0x2e, 0x3b, 0xbb5, 0xbc6, 0xbb3,
+0xbcd, 0x2e, 0x3b, 0xb9a, 0xba9, 0xbbf, 0x3b, 0xb9e, 0xbbe, 0xbaf, 0xbbf, 0xbb1, 0xbc1, 0x3b, 0xba4, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbb3,
+0xbcd, 0x3b, 0xb9a, 0xbc6, 0xbb5, 0xbcd, 0xbb5, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0xbaa, 0xbc1, 0xba4, 0xba9, 0xbcd, 0x3b, 0xbb5, 0xbbf, 0xbaf,
+0xbbe, 0xbb4, 0xba9, 0xbcd, 0x3b, 0xbb5, 0xbc6, 0xbb3, 0xbcd, 0xbb3, 0xbbf, 0x3b, 0xb9a, 0xba9, 0xbbf, 0x3b, 0xb9e, 0xbbe, 0x3b, 0xba4,
+0xbbf, 0x3b, 0xb9a, 0xbc6, 0x3b, 0xbaa, 0xbc1, 0x3b, 0xbb5, 0xbbf, 0x3b, 0xbb5, 0xbc6, 0x3b, 0xb9a, 0x3b, 0x44f, 0x43a, 0x448, 0x2e,
+0x3b, 0x434, 0x4af, 0x448, 0x2e, 0x3b, 0x441, 0x438, 0x448, 0x2e, 0x3b, 0x447, 0x4d9, 0x440, 0x2e, 0x3b, 0x43f, 0x4d9, 0x43d, 0x497,
+0x2e, 0x3b, 0x497, 0x43e, 0x43c, 0x2e, 0x3b, 0x448, 0x438, 0x43c, 0x2e, 0x3b, 0x44f, 0x43a, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b,
+0x434, 0x4af, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x441, 0x438, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x447, 0x4d9, 0x440, 0x448,
+0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x43f, 0x4d9, 0x43d, 0x497, 0x435, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x497, 0x43e, 0x43c, 0x433,
+0x430, 0x3b, 0x448, 0x438, 0x43c, 0x431, 0x4d9, 0x3b, 0x42f, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x496, 0x3b,
+0x428, 0x3b, 0xc06, 0xc26, 0xc3f, 0x3b, 0xc38, 0xc4b, 0xc2e, 0x3b, 0xc2e, 0xc02, 0xc17, 0xc33, 0x3b, 0xc2c, 0xc41, 0xc27, 0x3b, 0xc17,
+0xc41, 0xc30, 0xc41, 0x3b, 0xc36, 0xc41, 0xc15, 0xc4d, 0xc30, 0x3b, 0xc36, 0xc28, 0xc3f, 0x3b, 0xc06, 0xc26, 0xc3f, 0xc35, 0xc3e, 0xc30,
+0xc02, 0x3b, 0xc38, 0xc4b, 0xc2e, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc2e, 0xc02, 0xc17, 0xc33, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc2c,
+0xc41, 0xc27, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc17, 0xc41, 0xc30, 0xc41, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc36, 0xc41, 0xc15, 0xc4d,
+0xc30, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc36, 0xc28, 0xc3f, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc06, 0x3b, 0xc38, 0xc4b, 0x3b, 0xc2e,
+0x3b, 0xc2c, 0xc41, 0x3b, 0xc17, 0xc41, 0x3b, 0xc36, 0xc41, 0x3b, 0xc36, 0x3b, 0xe2d, 0xe32, 0x2e, 0x3b, 0xe08, 0x2e, 0x3b, 0xe2d,
+0x2e, 0x3b, 0xe1e, 0x2e, 0x3b, 0xe1e, 0xe24, 0x2e, 0x3b, 0xe28, 0x2e, 0x3b, 0xe2a, 0x2e, 0x3b, 0xe27, 0xe31, 0xe19, 0xe2d, 0xe32,
+0xe17, 0xe34, 0xe15, 0xe22, 0xe4c, 0x3b, 0xe27, 0xe31, 0xe19, 0xe08, 0xe31, 0xe19, 0xe17, 0xe23, 0xe4c, 0x3b, 0xe27, 0xe31, 0xe19, 0xe2d,
+0xe31, 0xe07, 0xe04, 0xe32, 0xe23, 0x3b, 0xe27, 0xe31, 0xe19, 0xe1e, 0xe38, 0xe18, 0x3b, 0xe27, 0xe31, 0xe19, 0xe1e, 0xe24, 0xe2b, 0xe31,
+0xe2a, 0xe1a, 0xe14, 0xe35, 0x3b, 0xe27, 0xe31, 0xe19, 0xe28, 0xe38, 0xe01, 0xe23, 0xe4c, 0x3b, 0xe27, 0xe31, 0xe19, 0xe40, 0xe2a, 0xe32,
+0xe23, 0xe4c, 0x3b, 0xe2d, 0xe32, 0x3b, 0xe08, 0x3b, 0xe2d, 0x3b, 0xe1e, 0x3b, 0xe1e, 0xe24, 0x3b, 0xe28, 0x3b, 0xe2a, 0x3b, 0xf49,
+0xf72, 0xf0b, 0xf58, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0x3b, 0xf58, 0xf72, 0xf42, 0xf0b, 0xf51, 0xf58, 0xf62, 0xf0b, 0x3b,
+0xf63, 0xfb7, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf55, 0xf74, 0xf62, 0xf0b, 0xf56, 0xf74, 0xf0b, 0x3b, 0xf54, 0xf0b, 0xf66, 0xf44, 0xf66,
+0xf0b, 0x3b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf49, 0xf72, 0xf0b, 0xf58, 0xf0b, 0x3b,
+0xf42, 0xf5f, 0xf60, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf58, 0xf72, 0xf42, 0xf0b, 0xf51, 0xf58,
+0xf62, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf63, 0xfb7, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf55, 0xf74,
+0xf62, 0xf0b, 0xf56, 0xf74, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf54, 0xf0b, 0xf66, 0xf44, 0xf66, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60,
+0xf0b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf49, 0xf72, 0x3b, 0xf5f, 0xfb3, 0x3b, 0xf58, 0xf72, 0xf42, 0x3b, 0xf63,
+0xfb7, 0xf42, 0x3b, 0xf55, 0xf74, 0xf62, 0x3b, 0xf66, 0xf44, 0xf66, 0x3b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0x3b, 0x1230, 0x1295, 0x3b, 0x1230,
+0x1291, 0x3b, 0x1230, 0x1209, 0x3b, 0x1228, 0x1261, 0x3b, 0x1213, 0x1219, 0x3b, 0x12d3, 0x122d, 0x3b, 0x1240, 0x12f3, 0x3b, 0x1230, 0x1295, 0x1260,
+0x1275, 0x3b, 0x1230, 0x1291, 0x12ed, 0x3b, 0x1220, 0x1209, 0x1235, 0x3b, 0x1228, 0x1261, 0x12d5, 0x3b, 0x1283, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d,
+0x1262, 0x3b, 0x1240, 0x12f3, 0x121d, 0x3b, 0x1230, 0x3b, 0x1230, 0x3b, 0x1220, 0x3b, 0x1228, 0x3b, 0x1213, 0x3b, 0x12d3, 0x3b, 0x1240, 0x3b,
+0x1230, 0x3b, 0x1230, 0x3b, 0x1230, 0x3b, 0x1228, 0x3b, 0x1213, 0x3b, 0x12d3, 0x3b, 0x1240, 0x3b, 0x53, 0x101, 0x70, 0x3b, 0x4d, 0x14d,
+0x6e, 0x3b, 0x54, 0x16b, 0x73, 0x3b, 0x50, 0x75, 0x6c, 0x3b, 0x54, 0x75, 0x2bb, 0x61, 0x3b, 0x46, 0x61, 0x6c, 0x3b, 0x54,
+0x6f, 0x6b, 0x3b, 0x53, 0x101, 0x70, 0x61, 0x74, 0x65, 0x3b, 0x4d, 0x14d, 0x6e, 0x69, 0x74, 0x65, 0x3b, 0x54, 0x16b, 0x73,
+0x69, 0x74, 0x65, 0x3b, 0x50, 0x75, 0x6c, 0x65, 0x6c, 0x75, 0x6c, 0x75, 0x3b, 0x54, 0x75, 0x2bb, 0x61, 0x70, 0x75, 0x6c,
+0x65, 0x6c, 0x75, 0x6c, 0x75, 0x3b, 0x46, 0x61, 0x6c, 0x61, 0x69, 0x74, 0x65, 0x3b, 0x54, 0x6f, 0x6b, 0x6f, 0x6e, 0x61,
+0x6b, 0x69, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x46, 0x3b, 0x54, 0x3b, 0x50, 0x61, 0x7a,
+0x3b, 0x50, 0x7a, 0x74, 0x3b, 0x53, 0x61, 0x6c, 0x3b, 0xc7, 0x61, 0x72, 0x3b, 0x50, 0x65, 0x72, 0x3b, 0x43, 0x75, 0x6d,
+0x3b, 0x43, 0x6d, 0x74, 0x3b, 0x50, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x50, 0x61, 0x7a, 0x61, 0x72, 0x74, 0x65, 0x73, 0x69,
+0x3b, 0x53, 0x61, 0x6c, 0x131, 0x3b, 0xc7, 0x61, 0x72, 0x15f, 0x61, 0x6d, 0x62, 0x61, 0x3b, 0x50, 0x65, 0x72, 0x15f, 0x65,
+0x6d, 0x62, 0x65, 0x3b, 0x43, 0x75, 0x6d, 0x61, 0x3b, 0x43, 0x75, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x69, 0x3b, 0x50,
+0x3b, 0x50, 0x3b, 0x53, 0x3b, 0xc7, 0x3b, 0x50, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0xdd, 0x65, 0x6b, 0x3b, 0x44, 0x75, 0x15f,
+0x3b, 0x53, 0x69, 0x15f, 0x3b, 0xc7, 0x61, 0x72, 0x3b, 0x50, 0x65, 0x6e, 0x3b, 0x41, 0x6e, 0x6e, 0x3b, 0x15e, 0x65, 0x6e,
+0x3b, 0xdd, 0x65, 0x6b, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x44, 0x75, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x53, 0x69,
+0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0xc7, 0x61, 0x72, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x50, 0x65, 0x6e, 0x15f, 0x65,
+0x6e, 0x62, 0x65, 0x3b, 0x41, 0x6e, 0x6e, 0x61, 0x3b, 0x15e, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0xdd, 0x3b, 0x44, 0x3b, 0x53,
+0x3b, 0xc7, 0x3b, 0x50, 0x3b, 0x41, 0x3b, 0x15e, 0x3b, 0xfd, 0x65, 0x6b, 0x3b, 0x64, 0x75, 0x15f, 0x3b, 0x73, 0x69, 0x15f,
+0x3b, 0xe7, 0x61, 0x72, 0x3b, 0x70, 0x65, 0x6e, 0x3b, 0x61, 0x6e, 0x6e, 0x3b, 0x15f, 0x65, 0x6e, 0x3b, 0xfd, 0x65, 0x6b,
+0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x64, 0x75, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x73, 0x69, 0x15f, 0x65, 0x6e, 0x62,
+0x65, 0x3b, 0xe7, 0x61, 0x72, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x70, 0x65, 0x6e, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b,
+0x61, 0x6e, 0x6e, 0x61, 0x3b, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x64a, 0x6d5, 0x3b, 0x62f, 0x6c8, 0x3b, 0x633, 0x6d5, 0x3b,
+0x686, 0x627, 0x3b, 0x67e, 0x6d5, 0x3b, 0x62c, 0x6c8, 0x3b, 0x634, 0x6d5, 0x3b, 0x64a, 0x6d5, 0x643, 0x634, 0x6d5, 0x646, 0x628, 0x6d5,
+0x3b, 0x62f, 0x6c8, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x633, 0x6d5, 0x64a, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x686, 0x627,
+0x631, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x67e, 0x6d5, 0x64a, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x62c, 0x6c8, 0x645, 0x6d5,
+0x3b, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x64a, 0x3b, 0x62f, 0x3b, 0x633, 0x3b, 0x686, 0x3b, 0x67e, 0x3b, 0x62c, 0x3b, 0x634,
+0x3b, 0x43d, 0x435, 0x434, 0x456, 0x43b, 0x44f, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x456, 0x43b, 0x43e, 0x43a, 0x3b, 0x432, 0x456,
+0x432, 0x442, 0x43e, 0x440, 0x43e, 0x43a, 0x3b, 0x441, 0x435, 0x440, 0x435, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x435, 0x440,
+0x3b, 0x43f, 0x2bc, 0x44f, 0x442, 0x43d, 0x438, 0x446, 0x44f, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x41d, 0x3b, 0x41f,
+0x3b, 0x412, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x421, 0x3b, 0x627, 0x62a, 0x648, 0x627, 0x631, 0x3b, 0x67e, 0x6cc, 0x631,
+0x3b, 0x645, 0x646, 0x6af, 0x644, 0x3b, 0x628, 0x62f, 0x6be, 0x3b, 0x62c, 0x645, 0x639, 0x631, 0x627, 0x62a, 0x3b, 0x62c, 0x645, 0x639,
+0x6c1, 0x3b, 0x6c1, 0x641, 0x62a, 0x6c1, 0x3b, 0x59, 0x61, 0x6b, 0x3b, 0x44, 0x75, 0x73, 0x68, 0x3b, 0x53, 0x65, 0x73, 0x68,
+0x3b, 0x43, 0x68, 0x6f, 0x72, 0x3b, 0x50, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x53, 0x68, 0x61, 0x6e, 0x3b, 0x79,
+0x61, 0x6b, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x64, 0x75, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x73, 0x65,
+0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x63, 0x68, 0x6f, 0x72, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x70, 0x61,
+0x79, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b,
+0x59, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x6cc, 0x2e, 0x3b, 0x62f, 0x2e, 0x3b,
+0x633, 0x2e, 0x3b, 0x686, 0x2e, 0x3b, 0x67e, 0x2e, 0x3b, 0x62c, 0x2e, 0x3b, 0x634, 0x2e, 0x3b, 0x44f, 0x43a, 0x448, 0x3b, 0x434,
+0x443, 0x448, 0x3b, 0x441, 0x435, 0x448, 0x3b, 0x447, 0x43e, 0x440, 0x3b, 0x43f, 0x430, 0x439, 0x3b, 0x436, 0x443, 0x43c, 0x3b, 0x448,
+0x430, 0x43d, 0x3b, 0x44f, 0x43a, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x434, 0x443, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x441,
+0x435, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x447, 0x43e, 0x440, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x43f, 0x430, 0x439, 0x448,
+0x430, 0x43d, 0x431, 0x430, 0x3b, 0x436, 0x443, 0x43c, 0x430, 0x3b, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x42f, 0x3b, 0x414, 0x3b,
+0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x416, 0x3b, 0x428, 0x3b, 0x43, 0x4e, 0x3b, 0x54, 0x68, 0x20, 0x32, 0x3b, 0x54, 0x68,
+0x20, 0x33, 0x3b, 0x54, 0x68, 0x20, 0x34, 0x3b, 0x54, 0x68, 0x20, 0x35, 0x3b, 0x54, 0x68, 0x20, 0x36, 0x3b, 0x54, 0x68,
+0x20, 0x37, 0x3b, 0x43, 0x68, 0x1ee7, 0x20, 0x4e, 0x68, 0x1ead, 0x74, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x48, 0x61, 0x69, 0x3b,
+0x54, 0x68, 0x1ee9, 0x20, 0x42, 0x61, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x54, 0x1b0, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x4e, 0x103,
+0x6d, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x53, 0xe1, 0x75, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x42, 0x1ea3, 0x79, 0x3b, 0x43, 0x4e,
+0x3b, 0x54, 0x32, 0x3b, 0x54, 0x33, 0x3b, 0x54, 0x34, 0x3b, 0x54, 0x35, 0x3b, 0x54, 0x36, 0x3b, 0x54, 0x37, 0x3b, 0x53,
+0x75, 0x3b, 0x4d, 0x75, 0x3b, 0x54, 0x75, 0x3b, 0x56, 0x65, 0x3b, 0x44, 0xf6, 0x3b, 0x46, 0x72, 0x3b, 0x5a, 0xe4, 0x3b,
+0x73, 0x75, 0x64, 0x65, 0x6c, 0x3b, 0x6d, 0x75, 0x64, 0x65, 0x6c, 0x3b, 0x74, 0x75, 0x64, 0x65, 0x6c, 0x3b, 0x76, 0x65,
+0x64, 0x65, 0x6c, 0x3b, 0x64, 0xf6, 0x64, 0x65, 0x6c, 0x3b, 0x66, 0x72, 0x69, 0x64, 0x65, 0x6c, 0x3b, 0x7a, 0xe4, 0x64,
+0x65, 0x6c, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x56, 0x3b, 0x44, 0x3b, 0x46, 0x3b, 0x5a, 0x3b, 0x73, 0x75, 0x2e,
+0x3b, 0x6d, 0x75, 0x2e, 0x3b, 0x74, 0x75, 0x2e, 0x3b, 0x76, 0x65, 0x2e, 0x3b, 0x64, 0xf6, 0x2e, 0x3b, 0x66, 0x72, 0x2e,
+0x3b, 0x7a, 0xe4, 0x2e, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x6c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x4d, 0x65,
+0x72, 0x3b, 0x49, 0x61, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x53,
+0x75, 0x6c, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x4c, 0x6c, 0x75, 0x6e, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x4d, 0x61,
+0x77, 0x72, 0x74, 0x68, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x4d, 0x65, 0x72, 0x63, 0x68, 0x65, 0x72, 0x3b, 0x44, 0x79,
+0x64, 0x64, 0x20, 0x49, 0x61, 0x75, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x47, 0x77, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x44,
+0x79, 0x64, 0x64, 0x20, 0x53, 0x61, 0x64, 0x77, 0x72, 0x6e, 0x3b, 0x53, 0x3b, 0x4c, 0x6c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b,
+0x49, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x6c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x4d,
+0x65, 0x72, 0x3b, 0x49, 0x61, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x44, 0x69, 0x62, 0x3b,
+0x41, 0x6c, 0x74, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0xc0, 0x6c, 0x61, 0x3b, 0x41, 0x6c, 0x78, 0x3b, 0xc0, 0x6a, 0x6a, 0x3b,
+0x41, 0x73, 0x65, 0x3b, 0x44, 0x69, 0x62, 0xe9, 0x65, 0x72, 0x3b, 0x41, 0x6c, 0x74, 0x69, 0x6e, 0x65, 0x3b, 0x54, 0x61,
+0x6c, 0x61, 0x61, 0x74, 0x61, 0x3b, 0xc0, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x78, 0x61, 0x6d, 0x69, 0x73,
+0x3b, 0xc0, 0x6a, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x65, 0x65, 0x72, 0x3b, 0x43, 0x61, 0x77, 0x3b, 0x4d, 0x76,
+0x75, 0x3b, 0x42, 0x69, 0x6e, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x53, 0x69, 0x6e, 0x3b, 0x48, 0x6c, 0x61, 0x3b, 0x4d, 0x67,
+0x71, 0x3b, 0x43, 0x61, 0x77, 0x65, 0x3b, 0x4d, 0x76, 0x75, 0x6c, 0x6f, 0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x62, 0x69,
+0x6e, 0x69, 0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x74, 0x68, 0x61, 0x74, 0x68, 0x75, 0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69,
+0x6e, 0x65, 0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x68, 0x6c, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x67, 0x71, 0x69, 0x62, 0x65,
+0x6c, 0x6f, 0x3b, 0x5d6, 0x5d5, 0x5e0, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5de, 0x5d0, 0x5b8, 0x5e0, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5d3, 0x5d9,
+0x5e0, 0x5e1, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5de, 0x5d9, 0x5d8, 0x5d5, 0x5d5, 0x5d0, 0x5da, 0x3b, 0x5d3, 0x5d0, 0x5e0, 0x5e2, 0x5e8, 0x5e9,
+0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5e4, 0x5bf, 0x5e8, 0x5f2, 0x5b7, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5e9, 0x5d1, 0x5ea, 0x3b, 0xc0, 0xec, 0x6b,
+0x3b, 0x41, 0x6a, 0x3b, 0xcc, 0x73, 0x1eb9, 0x301, 0x67, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x72, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301,
+0x62, 0x3b, 0x1eb8, 0x74, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x3b, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x41, 0x6a, 0xe9, 0x3b, 0xcc,
+0x73, 0x1eb9, 0x301, 0x67, 0x75, 0x6e, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x72, 0xfa, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x62, 0x1ecd,
+0x3b, 0x1eb8, 0x74, 0xec, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x1eb9, 0x301, 0x74, 0x61, 0x3b, 0xc0, 0x3b, 0x41, 0x3b, 0xcc, 0x3b,
+0x1ecc, 0x3b, 0x1ecc, 0x3b, 0x1eb8, 0x3b, 0xc0, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x1ecc, 0x6a,
+0x1ecd, 0x301, 0x20, 0x41, 0x6a, 0xe9, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0xcc, 0x73, 0x1eb9, 0x301, 0x67, 0x75, 0x6e, 0x3b,
+0x1ecc, 0x6a, 0x1ecd, 0x301, 0x72, 0xfa, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x62, 0x1ecd, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0x1eb8,
+0x74, 0xec, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0xc0, 0x62, 0xe1, 0x6d, 0x1eb9, 0x301, 0x74, 0x61, 0x3b, 0xc0, 0xec, 0x6b,
+0x3b, 0x41, 0x6a, 0x3b, 0xcc, 0x73, 0x25b, 0x301, 0x67, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x72, 0x3b, 0x186, 0x6a, 0x254, 0x301,
+0x62, 0x3b, 0x190, 0x74, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x3b, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x41, 0x6a, 0xe9, 0x3b, 0xcc,
+0x73, 0x25b, 0x301, 0x67, 0x75, 0x6e, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x72, 0xfa, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x62, 0x254,
+0x3b, 0x190, 0x74, 0xec, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x25b, 0x301, 0x74, 0x61, 0x3b, 0xc0, 0x3b, 0x41, 0x3b, 0xcc, 0x3b,
+0x186, 0x3b, 0x186, 0x3b, 0x190, 0x3b, 0xc0, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x186, 0x6a,
+0x254, 0x301, 0x20, 0x41, 0x6a, 0xe9, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0xcc, 0x73, 0x25b, 0x301, 0x67, 0x75, 0x6e, 0x3b,
+0x186, 0x6a, 0x254, 0x301, 0x72, 0xfa, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x62, 0x254, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0x190,
+0x74, 0xec, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0xc0, 0x62, 0xe1, 0x6d, 0x25b, 0x301, 0x74, 0x61, 0x3b, 0x53, 0x6f, 0x6e,
+0x3b, 0x4d, 0x73, 0x6f, 0x3b, 0x42, 0x69, 0x6c, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x53, 0x69, 0x6e, 0x3b, 0x48, 0x6c, 0x61,
+0x3b, 0x4d, 0x67, 0x71, 0x3b, 0x49, 0x53, 0x6f, 0x6e, 0x74, 0x6f, 0x3b, 0x55, 0x4d, 0x73, 0x6f, 0x6d, 0x62, 0x75, 0x6c,
+0x75, 0x6b, 0x6f, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73,
+0x69, 0x74, 0x68, 0x61, 0x74, 0x68, 0x75, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x6e, 0x65, 0x3b, 0x55, 0x4c, 0x77,
+0x65, 0x73, 0x69, 0x68, 0x6c, 0x61, 0x6e, 0x75, 0x3b, 0x55, 0x4d, 0x67, 0x71, 0x69, 0x62, 0x65, 0x6c, 0x6f, 0x3b, 0x53,
+0x3b, 0x4d, 0x3b, 0x42, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x73, 0xf8, 0x6e, 0x3b, 0x6d, 0xe5, 0x6e,
+0x3b, 0x74, 0x79, 0x73, 0x3b, 0x6f, 0x6e, 0x73, 0x3b, 0x74, 0x6f, 0x72, 0x3b, 0x66, 0x72, 0x65, 0x3b, 0x6c, 0x61, 0x75,
+0x3b, 0x73, 0xf8, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0xe5, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x79, 0x73, 0x64, 0x61,
+0x67, 0x3b, 0x6f, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x66, 0x72, 0x65,
+0x64, 0x61, 0x67, 0x3b, 0x6c, 0x61, 0x75, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x73, 0xf8, 0x2e, 0x3b, 0x6d, 0xe5, 0x2e, 0x3b,
+0x74, 0x79, 0x2e, 0x3b, 0x6f, 0x6e, 0x2e, 0x3b, 0x74, 0x6f, 0x2e, 0x3b, 0x66, 0x72, 0x2e, 0x3b, 0x6c, 0x61, 0x2e, 0x3b,
+0x43d, 0x435, 0x434, 0x3b, 0x43f, 0x43e, 0x43d, 0x3b, 0x443, 0x442, 0x43e, 0x3b, 0x441, 0x440, 0x438, 0x3b, 0x447, 0x435, 0x442, 0x3b,
+0x43f, 0x435, 0x442, 0x3b, 0x441, 0x443, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x458, 0x435, 0x459, 0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435,
+0x434, 0x458, 0x435, 0x459, 0x430, 0x43a, 0x3b, 0x443, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b, 0x441, 0x440, 0x438, 0x458, 0x435, 0x434,
+0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x430, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x430, 0x43a, 0x3b, 0x441, 0x443, 0x431,
+0x43e, 0x442, 0x430, 0x3b, 0x4a, 0x65, 0x64, 0x3b, 0x4a, 0x65, 0x6c, 0x3b, 0x4a, 0x65, 0x6d, 0x3b, 0x4a, 0x65, 0x72, 0x63,
+0x3b, 0x4a, 0x65, 0x72, 0x64, 0x3b, 0x4a, 0x65, 0x68, 0x3b, 0x4a, 0x65, 0x73, 0x3b, 0x4a, 0x65, 0x64, 0x6f, 0x6f, 0x6e,
+0x65, 0x65, 0x3b, 0x4a, 0x65, 0x6c, 0x68, 0x65, 0x69, 0x6e, 0x3b, 0x4a, 0x65, 0x6d, 0x61, 0x79, 0x72, 0x74, 0x3b, 0x4a,
+0x65, 0x72, 0x63, 0x65, 0x61, 0x6e, 0x3b, 0x4a, 0x65, 0x72, 0x64, 0x65, 0x69, 0x6e, 0x3b, 0x4a, 0x65, 0x68, 0x65, 0x69,
+0x6e, 0x65, 0x79, 0x3b, 0x4a, 0x65, 0x73, 0x61, 0x72, 0x6e, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d,
+0x74, 0x68, 0x3b, 0x4d, 0x68, 0x72, 0x3b, 0x59, 0x6f, 0x77, 0x3b, 0x47, 0x77, 0x65, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x64,
+0x79, 0x20, 0x53, 0x75, 0x6c, 0x3b, 0x64, 0x79, 0x20, 0x4c, 0x75, 0x6e, 0x3b, 0x64, 0x79, 0x20, 0x4d, 0x65, 0x75, 0x72,
+0x74, 0x68, 0x3b, 0x64, 0x79, 0x20, 0x4d, 0x65, 0x72, 0x68, 0x65, 0x72, 0x3b, 0x64, 0x79, 0x20, 0x59, 0x6f, 0x77, 0x3b,
+0x64, 0x79, 0x20, 0x47, 0x77, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x64, 0x79, 0x20, 0x53, 0x61, 0x64, 0x6f, 0x72, 0x6e, 0x3b,
+0x4b, 0x77, 0x65, 0x3b, 0x44, 0x77, 0x6f, 0x3b, 0x42, 0x65, 0x6e, 0x3b, 0x57, 0x75, 0x6b, 0x3b, 0x59, 0x61, 0x77, 0x3b,
+0x46, 0x69, 0x61, 0x3b, 0x4d, 0x65, 0x6d, 0x3b, 0x4b, 0x77, 0x65, 0x73, 0x69, 0x64, 0x61, 0x3b, 0x44, 0x77, 0x6f, 0x77,
+0x64, 0x61, 0x3b, 0x42, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x3b, 0x57, 0x75, 0x6b, 0x75, 0x64, 0x61, 0x3b, 0x59, 0x61, 0x77,
+0x64, 0x61, 0x3b, 0x46, 0x69, 0x64, 0x61, 0x3b, 0x4d, 0x65, 0x6d, 0x65, 0x6e, 0x65, 0x64, 0x61, 0x3b, 0x4b, 0x3b, 0x44,
+0x3b, 0x42, 0x3b, 0x57, 0x3b, 0x59, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x906, 0x92f, 0x924, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e,
+0x93e, 0x930, 0x3b, 0x92e, 0x902, 0x917, 0x933, 0x93e, 0x930, 0x3b, 0x92c, 0x941, 0x927, 0x935, 0x93e, 0x930, 0x3b, 0x917, 0x941, 0x930,
+0x941, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x93e, 0x930, 0x3b, 0x936, 0x947, 0x928, 0x935, 0x93e, 0x930, 0x3b,
+0x906, 0x3b, 0x938, 0x94b, 0x3b, 0x92e, 0x902, 0x3b, 0x92c, 0x941, 0x3b, 0x917, 0x941, 0x3b, 0x936, 0x941, 0x3b, 0x936, 0x947, 0x3b,
+0x1ee4, 0x6b, 0x61, 0x3b, 0x4d, 0x1ecd, 0x6e, 0x3b, 0x54, 0x69, 0x75, 0x3b, 0x57, 0x65, 0x6e, 0x3b, 0x54, 0x1ecd, 0x1ecd, 0x3b,
+0x46, 0x72, 0x61, 0x1ecb, 0x3b, 0x53, 0x61, 0x74, 0x3b, 0x53, 0x1ecd, 0x6e, 0x64, 0x65, 0x65, 0x3b, 0x4d, 0x1ecd, 0x6e, 0x64,
+0x65, 0x3b, 0x54, 0x69, 0x75, 0x7a, 0x64, 0x65, 0x65, 0x3b, 0x57, 0x65, 0x6e, 0x65, 0x7a, 0x64, 0x65, 0x65, 0x3b, 0x54,
+0x1ecd, 0x1ecd, 0x7a, 0x64, 0x65, 0x65, 0x3b, 0x46, 0x72, 0x61, 0x1ecb, 0x64, 0x65, 0x65, 0x3b, 0x53, 0x61, 0x74, 0x1ecd, 0x64,
+0x65, 0x65, 0x3b, 0x57, 0x6b, 0x79, 0x3b, 0x57, 0x6b, 0x77, 0x3b, 0x57, 0x6b, 0x6c, 0x3b, 0x57, 0x74, 0x169, 0x3b, 0x57,
+0x6b, 0x6e, 0x3b, 0x57, 0x74, 0x6e, 0x3b, 0x57, 0x74, 0x68, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x79, 0x75, 0x6d, 0x77, 0x61,
+0x3b, 0x57, 0x61, 0x20, 0x6b, 0x77, 0x61, 0x6d, 0x62, 0x129, 0x6c, 0x129, 0x6c, 0x79, 0x61, 0x3b, 0x57, 0x61, 0x20, 0x6b,
+0x65, 0x6c, 0x129, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x61, 0x6e,
+0x61, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x57, 0x61, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x74,
+0x68, 0x61, 0x74, 0x169, 0x3b, 0x59, 0x3b, 0x57, 0x3b, 0x45, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x64,
+0x6f, 0x6d, 0x3b, 0x6c, 0x75, 0x6e, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x69, 0x65, 0x3b, 0x6a, 0x6f, 0x69, 0x3b, 0x76,
+0x69, 0x6e, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64, 0x6f, 0x6d, 0x65, 0x6e, 0x69, 0x65, 0x3b, 0x6c, 0x75, 0x6e, 0x69, 0x73,
+0x3b, 0x6d, 0x61, 0x72, 0x74, 0x61, 0x72, 0x73, 0x3b, 0x6d, 0x69, 0x65, 0x72, 0x63, 0x75, 0x73, 0x3b, 0x6a, 0x6f, 0x69,
+0x62, 0x65, 0x3b, 0x76, 0x69, 0x6e, 0x61, 0x72, 0x73, 0x3b, 0x73, 0x61, 0x62, 0x69, 0x64, 0x65, 0x3b, 0x6b, 0x254, 0x73,
+0x3b, 0x64, 0x7a, 0x6f, 0x3b, 0x62, 0x6c, 0x61, 0x3b, 0x6b, 0x75, 0x256, 0x3b, 0x79, 0x61, 0x77, 0x3b, 0x66, 0x69, 0x256,
+0x3b, 0x6d, 0x65, 0x6d, 0x3b, 0x6b, 0x254, 0x73, 0x69, 0x256, 0x61, 0x3b, 0x64, 0x7a, 0x6f, 0x256, 0x61, 0x3b, 0x62, 0x6c,
+0x61, 0x256, 0x61, 0x3b, 0x6b, 0x75, 0x256, 0x61, 0x3b, 0x79, 0x61, 0x77, 0x6f, 0x256, 0x61, 0x3b, 0x66, 0x69, 0x256, 0x61,
+0x3b, 0x6d, 0x65, 0x6d, 0x6c, 0x65, 0x256, 0x61, 0x3b, 0x6b, 0x3b, 0x64, 0x3b, 0x62, 0x3b, 0x6b, 0x3b, 0x79, 0x3b, 0x66,
+0x3b, 0x6d, 0x3b, 0x4c, 0x50, 0x3b, 0x50, 0x31, 0x3b, 0x50, 0x32, 0x3b, 0x50, 0x33, 0x3b, 0x50, 0x34, 0x3b, 0x50, 0x35,
+0x3b, 0x50, 0x36, 0x3b, 0x4c, 0x101, 0x70, 0x75, 0x6c, 0x65, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6b, 0x61, 0x68, 0x69, 0x3b,
+0x50, 0x6f, 0x2bb, 0x61, 0x6c, 0x75, 0x61, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6b, 0x6f, 0x6c, 0x75, 0x3b, 0x50, 0x6f, 0x2bb,
+0x61, 0x68, 0x101, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6c, 0x69, 0x6d, 0x61, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6f, 0x6e, 0x6f,
+0x3b, 0x4c, 0x69, 0x6e, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x69, 0x79, 0x3b, 0x48, 0x75, 0x77,
+0x3b, 0x42, 0x69, 0x79, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4c, 0x69, 0x6e, 0x67, 0x67, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x65,
+0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x4d, 0x69, 0x79, 0x65, 0x72, 0x6b, 0x75, 0x6c, 0x65, 0x73, 0x3b,
+0x48, 0x75, 0x77, 0x65, 0x62, 0x65, 0x73, 0x3b, 0x42, 0x69, 0x79, 0x65, 0x72, 0x6e, 0x65, 0x73, 0x3b, 0x53, 0x61, 0x62,
+0x61, 0x64, 0x6f, 0x3b, 0x53, 0x75, 0x2e, 0x3b, 0x4d, 0xe4, 0x2e, 0x3b, 0x5a, 0x69, 0x2e, 0x3b, 0x4d, 0x69, 0x2e, 0x3b,
+0x44, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0x75, 0x6e, 0x6e, 0x74, 0x69, 0x67, 0x3b,
+0x4d, 0xe4, 0xe4, 0x6e, 0x74, 0x69, 0x67, 0x3b, 0x5a, 0x69, 0x69, 0x73, 0x63, 0x68, 0x74, 0x69, 0x67, 0x3b, 0x4d, 0x69,
+0x74, 0x74, 0x77, 0x75, 0x63, 0x68, 0x3b, 0x44, 0x75, 0x6e, 0x73, 0x63, 0x68, 0x74, 0x69, 0x67, 0x3b, 0x46, 0x72, 0x69,
+0x69, 0x74, 0x69, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x73, 0x63, 0x68, 0x74, 0x69, 0x67, 0x3b, 0xa46d, 0xa18f, 0x3b, 0xa18f, 0xa2cd,
+0x3b, 0xa18f, 0xa44d, 0x3b, 0xa18f, 0xa315, 0x3b, 0xa18f, 0xa1d6, 0x3b, 0xa18f, 0xa26c, 0x3b, 0xa18f, 0xa0d8, 0x3b, 0xa46d, 0xa18f, 0xa44d, 0x3b,
+0xa18f, 0xa282, 0xa2cd, 0x3b, 0xa18f, 0xa282, 0xa44d, 0x3b, 0xa18f, 0xa282, 0xa315, 0x3b, 0xa18f, 0xa282, 0xa1d6, 0x3b, 0xa18f, 0xa282, 0xa26c, 0x3b,
+0xa18f, 0xa282, 0xa0d8, 0x3b, 0xa18f, 0x3b, 0xa2cd, 0x3b, 0xa44d, 0x3b, 0xa315, 0x3b, 0xa1d6, 0x3b, 0xa26c, 0x3b, 0xa0d8, 0x3b, 0x53, 0xfc,
+0x2e, 0x3b, 0x4d, 0x61, 0x2e, 0x3b, 0x44, 0x69, 0x2e, 0x3b, 0x4d, 0x69, 0x2e, 0x3b, 0x44, 0x75, 0x2e, 0x3b, 0x46, 0x72,
+0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0xfc, 0x6e, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x4d, 0x61, 0x61, 0x6e, 0x64, 0x61,
+0x67, 0x3b, 0x44, 0x69, 0x6e, 0x67, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x4d, 0x69, 0x64, 0x64, 0x65, 0x77, 0x65, 0x6b, 0x65,
+0x6e, 0x3b, 0x44, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x46, 0x72, 0x65, 0x65, 0x64, 0x61, 0x67,
+0x3b, 0x53, 0xfc, 0x6e, 0x6e, 0x61, 0x76, 0x65, 0x6e, 0x64, 0x3b, 0x73, 0x6f, 0x74, 0x6e, 0x3b, 0x76, 0x75, 0x6f, 0x73,
+0x3b, 0x6d, 0x61, 0x14b, 0x3b, 0x67, 0x61, 0x73, 0x6b, 0x3b, 0x64, 0x75, 0x6f, 0x72, 0x3b, 0x62, 0x65, 0x61, 0x72, 0x3b,
+0x6c, 0xe1, 0x76, 0x3b, 0x73, 0x6f, 0x74, 0x6e, 0x61, 0x62, 0x65, 0x61, 0x69, 0x76, 0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73,
+0x73, 0xe1, 0x72, 0x67, 0x61, 0x3b, 0x6d, 0x61, 0x14b, 0x14b, 0x65, 0x62, 0xe1, 0x72, 0x67, 0x61, 0x3b, 0x67, 0x61, 0x73,
+0x6b, 0x61, 0x76, 0x61, 0x68, 0x6b, 0x6b, 0x75, 0x3b, 0x64, 0x75, 0x6f, 0x72, 0x61, 0x73, 0x64, 0x61, 0x74, 0x3b, 0x62,
+0x65, 0x61, 0x72, 0x6a, 0x61, 0x64, 0x61, 0x74, 0x3b, 0x6c, 0xe1, 0x76, 0x76, 0x61, 0x72, 0x64, 0x61, 0x74, 0x3b, 0x53,
+0x3b, 0x56, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x73, 0x6f, 0x3b, 0x6d, 0xe1, 0x3b, 0x64,
+0x69, 0x3b, 0x67, 0x61, 0x3b, 0x64, 0x75, 0x3b, 0x62, 0x65, 0x3b, 0x6c, 0xe1, 0x3b, 0x73, 0x6f, 0x74, 0x6e, 0x61, 0x62,
+0x65, 0x61, 0x69, 0x76, 0x69, 0x3b, 0x6d, 0xe1, 0x6e, 0x6e, 0x6f, 0x64, 0x61, 0x74, 0x3b, 0x64, 0x69, 0x73, 0x64, 0x61,
+0x74, 0x3b, 0x67, 0x61, 0x73, 0x6b, 0x61, 0x76, 0x61, 0x68, 0x6b, 0x6b, 0x75, 0x3b, 0x64, 0x75, 0x6f, 0x72, 0x61, 0x73,
+0x74, 0x61, 0x74, 0x3b, 0x62, 0x65, 0x61, 0x72, 0x6a, 0x61, 0x64, 0x61, 0x74, 0x3b, 0x6c, 0xe1, 0x76, 0x76, 0x6f, 0x72,
+0x64, 0x61, 0x74, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x43, 0x70,
+0x72, 0x3b, 0x43, 0x74, 0x74, 0x3b, 0x43, 0x6d, 0x6e, 0x3b, 0x43, 0x6d, 0x74, 0x3b, 0x41, 0x72, 0x73, 0x3b, 0x49, 0x63,
+0x6d, 0x3b, 0x45, 0x73, 0x74, 0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x43, 0x68, 0x75, 0x6d,
+0x61, 0x74, 0x61, 0x74, 0x6f, 0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61, 0x69, 0x6e, 0x65, 0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61,
+0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x72, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x63, 0x68, 0x75, 0x6d, 0x61, 0x3b,
+0x45, 0x73, 0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x41, 0x3b, 0x49, 0x3b,
+0x45, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x4a, 0x69, 0x6d, 0x3b, 0x4b, 0x61, 0x77, 0x3b, 0x4b, 0x61, 0x64, 0x3b, 0x4b, 0x61,
+0x6e, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x4e, 0x67, 0x75, 0x3b, 0x49, 0x74, 0x75, 0x6b, 0x75, 0x20, 0x6a, 0x61, 0x20, 0x6a,
+0x75, 0x6d, 0x77, 0x61, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6a, 0x69, 0x6d, 0x77, 0x65, 0x72,
+0x69, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6b, 0x61, 0x77, 0x69, 0x3b, 0x4b, 0x75, 0x72, 0x61,
+0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6b, 0x61, 0x64, 0x61, 0x64, 0x75, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61,
+0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6b, 0x61, 0x73, 0x61, 0x6e,
+0x75, 0x3b, 0x4b, 0x69, 0x66, 0x75, 0x6c, 0x61, 0x20, 0x6e, 0x67, 0x75, 0x77, 0x6f, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4b,
+0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x64, 0x65, 0x77, 0x3b, 0x61, 0x61, 0x253, 0x3b, 0x6d, 0x61, 0x77,
+0x3b, 0x6e, 0x6a, 0x65, 0x3b, 0x6e, 0x61, 0x61, 0x3b, 0x6d, 0x77, 0x64, 0x3b, 0x68, 0x62, 0x69, 0x3b, 0x64, 0x65, 0x77,
+0x6f, 0x3b, 0x61, 0x61, 0x253, 0x6e, 0x64, 0x65, 0x3b, 0x6d, 0x61, 0x77, 0x62, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x6e, 0x6a,
+0x65, 0x73, 0x6c, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x6e, 0x61, 0x61, 0x73, 0x61, 0x61, 0x6e, 0x64, 0x65, 0x3b, 0x6d, 0x61,
+0x77, 0x6e, 0x64, 0x65, 0x3b, 0x68, 0x6f, 0x6f, 0x72, 0x65, 0x2d, 0x62, 0x69, 0x69, 0x72, 0x3b, 0x64, 0x3b, 0x61, 0x3b,
+0x6d, 0x3b, 0x6e, 0x3b, 0x6e, 0x3b, 0x6d, 0x3b, 0x68, 0x3b, 0x4b, 0x4d, 0x41, 0x3b, 0x4e, 0x54, 0x54, 0x3b, 0x4e, 0x4d,
+0x4e, 0x3b, 0x4e, 0x4d, 0x54, 0x3b, 0x41, 0x52, 0x54, 0x3b, 0x4e, 0x4d, 0x41, 0x3b, 0x4e, 0x4d, 0x4d, 0x3b, 0x4b, 0x69,
+0x75, 0x6d, 0x69, 0x61, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61,
+0x69, 0x6e, 0x65, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x61, 0x3b, 0x41, 0x72, 0x61, 0x6d, 0x69, 0x74,
+0x68, 0x69, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x74, 0x68, 0x69,
+0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x41, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x41, 0x72, 0x65, 0x3b, 0x4b,
+0x75, 0x6e, 0x3b, 0x4f, 0x6e, 0x67, 0x3b, 0x49, 0x6e, 0x65, 0x3b, 0x49, 0x6c, 0x65, 0x3b, 0x53, 0x61, 0x70, 0x3b, 0x4b,
+0x77, 0x65, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x61, 0x72, 0x65, 0x3b, 0x4d, 0x64, 0x65,
+0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x6b, 0x75, 0x6e, 0x69, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65,
+0x65, 0x20, 0x6f, 0x6e, 0x67, 0x2019, 0x77, 0x61, 0x6e, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20,
+0x69, 0x6e, 0x65, 0x74, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x69, 0x6c, 0x65, 0x3b, 0x4d,
+0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x73, 0x61, 0x70, 0x61, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74,
+0x20, 0x65, 0x65, 0x20, 0x6b, 0x77, 0x65, 0x3b, 0x41, 0x3b, 0x4b, 0x3b, 0x4f, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x53, 0x3b,
+0x4b, 0x3b, 0x44, 0x69, 0x6d, 0x3b, 0x50, 0x6f, 0x73, 0x3b, 0x50, 0x69, 0x72, 0x3b, 0x54, 0x61, 0x74, 0x3b, 0x4e, 0x61,
+0x69, 0x3b, 0x53, 0x68, 0x61, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x44, 0x69, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x43, 0x68,
+0x69, 0x70, 0x6f, 0x73, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x74, 0x61, 0x74,
+0x75, 0x3b, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x73, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x53, 0x61,
+0x62, 0x75, 0x64, 0x75, 0x3b, 0x44, 0x3b, 0x50, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x4e, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53,
+0x6f, 0x6e, 0x3b, 0x4d, 0x76, 0x75, 0x3b, 0x53, 0x69, 0x62, 0x3b, 0x53, 0x69, 0x74, 0x3b, 0x53, 0x69, 0x6e, 0x3b, 0x53,
+0x69, 0x68, 0x3b, 0x4d, 0x67, 0x71, 0x3b, 0x53, 0x6f, 0x6e, 0x74, 0x6f, 0x3b, 0x4d, 0x76, 0x75, 0x6c, 0x6f, 0x3b, 0x53,
+0x69, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x53, 0x69, 0x74, 0x68, 0x61, 0x74, 0x68, 0x75, 0x3b, 0x53, 0x69, 0x6e, 0x65, 0x3b,
+0x53, 0x69, 0x68, 0x6c, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x67, 0x71, 0x69, 0x62, 0x65, 0x6c, 0x6f, 0x3b, 0x53, 0x3b, 0x4d,
+0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x49, 0x6a, 0x70, 0x3b, 0x49, 0x6a, 0x74, 0x3b, 0x49,
+0x6a, 0x6e, 0x3b, 0x49, 0x6a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x49, 0x6a, 0x6d, 0x3b,
+0x49, 0x6a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b,
+0x49, 0x6a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41,
+0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61,
+0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x31, 0x3b, 0x2d30,
+0x2d59, 0x2d30, 0x3b, 0x2d30, 0x2d62, 0x2d4f, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x3b, 0x2d30, 0x2d3d, 0x2d55, 0x3b, 0x2d30, 0x2d3d, 0x2d61, 0x3b, 0x2d30,
+0x2d59, 0x2d49, 0x2d4e, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d39, 0x3b, 0x2d30, 0x2d59, 0x2d30, 0x2d4e, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d62, 0x2d4f, 0x2d30,
+0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4f, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d55, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d61, 0x2d30, 0x2d59,
+0x3b, 0x2d59, 0x2d49, 0x2d4e, 0x2d61, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d39, 0x2d62, 0x2d30, 0x2d59, 0x3b, 0x61, 0x73, 0x61, 0x3b,
+0x61, 0x79, 0x6e, 0x3b, 0x61, 0x73, 0x69, 0x3b, 0x61, 0x6b, 0x1e5b, 0x3b, 0x61, 0x6b, 0x77, 0x3b, 0x61, 0x73, 0x69, 0x6d,
+0x3b, 0x61, 0x73, 0x69, 0x1e0d, 0x3b, 0x61, 0x73, 0x61, 0x6d, 0x61, 0x73, 0x3b, 0x61, 0x79, 0x6e, 0x61, 0x73, 0x3b, 0x61,
+0x73, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x61, 0x6b, 0x1e5b, 0x61, 0x73, 0x3b, 0x61, 0x6b, 0x77, 0x61, 0x73, 0x3b, 0x61, 0x73,
+0x69, 0x6d, 0x77, 0x61, 0x73, 0x3b, 0x61, 0x73, 0x69, 0x1e0d, 0x79, 0x61, 0x73, 0x3b, 0x41, 0x63, 0x65, 0x3b, 0x41, 0x72,
+0x69, 0x3b, 0x41, 0x72, 0x61, 0x3b, 0x41, 0x68, 0x61, 0x3b, 0x41, 0x6d, 0x68, 0x3b, 0x53, 0x65, 0x6d, 0x3b, 0x53, 0x65,
+0x64, 0x3b, 0x41, 0x63, 0x65, 0x72, 0x3b, 0x41, 0x72, 0x69, 0x6d, 0x3b, 0x41, 0x72, 0x61, 0x6d, 0x3b, 0x41, 0x68, 0x61,
+0x64, 0x3b, 0x41, 0x6d, 0x68, 0x61, 0x64, 0x3b, 0x53, 0x65, 0x6d, 0x3b, 0x53, 0x65, 0x64, 0x3b, 0x59, 0x3b, 0x53, 0x3b,
+0x4b, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x59, 0x61, 0x6e, 0x3b, 0x53, 0x61, 0x6e, 0x3b, 0x4b, 0x72,
+0x61, 0x1e0d, 0x3b, 0x4b, 0x75, 0x1e93, 0x3b, 0x53, 0x61, 0x6d, 0x3b, 0x53, 0x1e0d, 0x69, 0x73, 0x3b, 0x53, 0x61, 0x79, 0x3b,
+0x59, 0x61, 0x6e, 0x61, 0x73, 0x73, 0x3b, 0x53, 0x61, 0x6e, 0x61, 0x73, 0x73, 0x3b, 0x4b, 0x72, 0x61, 0x1e0d, 0x61, 0x73,
+0x73, 0x3b, 0x4b, 0x75, 0x1e93, 0x61, 0x73, 0x73, 0x3b, 0x53, 0x61, 0x6d, 0x61, 0x73, 0x73, 0x3b, 0x53, 0x1e0d, 0x69, 0x73,
+0x61, 0x73, 0x73, 0x3b, 0x53, 0x61, 0x79, 0x61, 0x73, 0x73, 0x3b, 0x43, 0x3b, 0x52, 0x3b, 0x41, 0x3b, 0x48, 0x3b, 0x4d,
+0x3b, 0x53, 0x3b, 0x44, 0x3b, 0x53, 0x41, 0x4e, 0x3b, 0x4f, 0x52, 0x4b, 0x3b, 0x4f, 0x4b, 0x42, 0x3b, 0x4f, 0x4b, 0x53,
+0x3b, 0x4f, 0x4b, 0x4e, 0x3b, 0x4f, 0x4b, 0x54, 0x3b, 0x4f, 0x4d, 0x4b, 0x3b, 0x53, 0x61, 0x6e, 0x64, 0x65, 0x3b, 0x4f,
+0x72, 0x77, 0x6f, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61, 0x62, 0x69, 0x72,
+0x69, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61, 0x73, 0x68, 0x61, 0x74, 0x75, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61,
+0x6e, 0x61, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61, 0x74, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6d,
+0x75, 0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x52, 0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4d,
+0x3b, 0x4d, 0x75, 0x6c, 0x3b, 0x56, 0x69, 0x6c, 0x3b, 0x48, 0x69, 0x76, 0x3b, 0x48, 0x69, 0x64, 0x3b, 0x48, 0x69, 0x74,
+0x3b, 0x48, 0x69, 0x68, 0x3b, 0x4c, 0x65, 0x6d, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x75, 0x6c, 0x75, 0x6e, 0x67, 0x75, 0x3b,
+0x70, 0x61, 0x20, 0x73, 0x68, 0x61, 0x68, 0x75, 0x76, 0x69, 0x6c, 0x75, 0x68, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x68, 0x69,
+0x76, 0x69, 0x6c, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x68, 0x69, 0x64, 0x61, 0x74, 0x75, 0x3b, 0x70, 0x61, 0x20, 0x68, 0x69,
+0x74, 0x61, 0x79, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x68, 0x69, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x70, 0x61, 0x20, 0x73, 0x68,
+0x61, 0x68, 0x75, 0x6c, 0x65, 0x6d, 0x62, 0x65, 0x6c, 0x61, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x48, 0x3b, 0x48, 0x3b, 0x48,
+0x3b, 0x57, 0x3b, 0x4a, 0x3b, 0x4a, 0x70, 0x69, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a, 0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e,
+0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c,
+0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65,
+0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49,
+0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4a,
+0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4a, 0x3b, 0x6b, 0x61, 0x72, 0x3b, 0x6e, 0x74, 0x25b, 0x3b, 0x74, 0x61, 0x72,
+0x3b, 0x61, 0x72, 0x61, 0x3b, 0x61, 0x6c, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x3b, 0x73, 0x69, 0x62, 0x3b, 0x6b, 0x61, 0x72,
+0x69, 0x3b, 0x6e, 0x74, 0x25b, 0x6e, 0x25b, 0x3b, 0x74, 0x61, 0x72, 0x61, 0x74, 0x61, 0x3b, 0x61, 0x72, 0x61, 0x62, 0x61,
+0x3b, 0x61, 0x6c, 0x61, 0x6d, 0x69, 0x73, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x73, 0x69, 0x62, 0x69, 0x72, 0x69,
+0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x4b, 0x6d, 0x61, 0x3b, 0x54,
+0x61, 0x74, 0x3b, 0x49, 0x6e, 0x65, 0x3b, 0x54, 0x61, 0x6e, 0x3b, 0x41, 0x72, 0x6d, 0x3b, 0x4d, 0x61, 0x61, 0x3b, 0x4e,
+0x4d, 0x4d, 0x3b, 0x4b, 0x69, 0x75, 0x6d, 0x69, 0x61, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b,
+0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x69, 0x6e, 0x65, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41,
+0x72, 0x61, 0x6d, 0x69, 0x74, 0x68, 0x69, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4e, 0x4a, 0x75, 0x6d, 0x61,
+0x6d, 0x6f, 0x74, 0x68, 0x69, 0x69, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4e,
+0x3b, 0x13c6, 0x13cd, 0x13ac, 0x3b, 0x13c9, 0x13c5, 0x13af, 0x3b, 0x13d4, 0x13b5, 0x13c1, 0x3b, 0x13e6, 0x13a2, 0x13c1, 0x3b, 0x13c5, 0x13a9, 0x13c1,
+0x3b, 0x13e7, 0x13be, 0x13a9, 0x3b, 0x13c8, 0x13d5, 0x13be, 0x3b, 0x13a4, 0x13be, 0x13d9, 0x13d3, 0x13c6, 0x13cd, 0x13ac, 0x3b, 0x13a4, 0x13be, 0x13d9,
+0x13d3, 0x13c9, 0x13c5, 0x13af, 0x3b, 0x13d4, 0x13b5, 0x13c1, 0x13a2, 0x13a6, 0x3b, 0x13e6, 0x13a2, 0x13c1, 0x13a2, 0x13a6, 0x3b, 0x13c5, 0x13a9, 0x13c1,
+0x13a2, 0x13a6, 0x3b, 0x13e7, 0x13be, 0x13a9, 0x13b6, 0x13cd, 0x13d7, 0x3b, 0x13a4, 0x13be, 0x13d9, 0x13d3, 0x13c8, 0x13d5, 0x13be, 0x3b, 0x13c6, 0x3b,
+0x13c9, 0x3b, 0x13d4, 0x3b, 0x13e6, 0x3b, 0x13c5, 0x3b, 0x13e7, 0x3b, 0x13a4, 0x3b, 0x64, 0x69, 0x6d, 0x3b, 0x6c, 0x69, 0x6e, 0x3b,
+0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x72, 0x3b, 0x7a, 0x65, 0x3b, 0x76, 0x61, 0x6e, 0x3b, 0x73, 0x61, 0x6d, 0x3b, 0x64,
+0x69, 0x6d, 0x61, 0x6e, 0x73, 0x3b, 0x6c, 0x69, 0x6e, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x69, 0x3b, 0x6d, 0x65,
+0x72, 0x6b, 0x72, 0x65, 0x64, 0x69, 0x3b, 0x7a, 0x65, 0x64, 0x69, 0x3b, 0x76, 0x61, 0x6e, 0x64, 0x72, 0x65, 0x64, 0x69,
+0x3b, 0x73, 0x61, 0x6d, 0x64, 0x69, 0x3b, 0x64, 0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x7a, 0x3b, 0x76, 0x3b, 0x73,
+0x3b, 0x4c, 0x6c, 0x32, 0x3b, 0x4c, 0x6c, 0x33, 0x3b, 0x4c, 0x6c, 0x34, 0x3b, 0x4c, 0x6c, 0x35, 0x3b, 0x4c, 0x6c, 0x36,
+0x3b, 0x4c, 0x6c, 0x37, 0x3b, 0x4c, 0x6c, 0x31, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x70,
+0x69, 0x6c, 0x69, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4c,
+0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x63, 0x68, 0x69, 0x3b, 0x4c, 0x69, 0x64,
+0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61,
+0x20, 0x6c, 0x79, 0x61, 0x6e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x6c, 0x69, 0x6e, 0x6a, 0x69, 0x3b,
+0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20,
+0x6d, 0x61, 0x76, 0x69, 0x6c, 0x69, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x69, 0x74, 0x61, 0x6e, 0x64,
+0x69, 0x3b, 0x50, 0xed, 0x69, 0x6c, 0x69, 0x3b, 0x54, 0xe1, 0x61, 0x74, 0x75, 0x3b, 0xcd, 0x6e, 0x65, 0x3b, 0x54, 0xe1,
+0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x6d, 0x3b, 0x4d, 0xf3, 0x6f, 0x73, 0x69, 0x3b, 0x4a, 0x75,
+0x6d, 0x61, 0x70, 0xed, 0x69, 0x72, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0xe1, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d,
+0x61, 0xed, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0xe1, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x61, 0x6d, 0xed,
+0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0xe1, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0xf3, 0x6f, 0x73, 0x69,
+0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x45, 0x3b, 0x4f, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x42,
+0x61, 0x6c, 0x3b, 0x4c, 0x77, 0x32, 0x3b, 0x4c, 0x77, 0x33, 0x3b, 0x4c, 0x77, 0x34, 0x3b, 0x4c, 0x77, 0x35, 0x3b, 0x4c,
+0x77, 0x36, 0x3b, 0x53, 0x61, 0x62, 0x62, 0x69, 0x69, 0x74, 0x69, 0x3b, 0x42, 0x61, 0x6c, 0x61, 0x7a, 0x61, 0x3b, 0x4c,
+0x77, 0x61, 0x6b, 0x75, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4c, 0x77, 0x61, 0x6b, 0x75, 0x73, 0x61, 0x74, 0x75, 0x3b, 0x4c,
+0x77, 0x61, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x4c, 0x77, 0x61, 0x6b, 0x75, 0x74, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0x4c, 0x77,
+0x61, 0x6d, 0x75, 0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c,
+0x3b, 0x4c, 0x3b, 0x50, 0x61, 0x20, 0x4d, 0x75, 0x6c, 0x75, 0x6e, 0x67, 0x75, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68,
+0x69, 0x6d, 0x6f, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68, 0x69, 0x62, 0x75, 0x6c, 0x69, 0x3b, 0x50, 0x61, 0x6c, 0x69,
+0x63, 0x68, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x3b, 0x50, 0x61,
+0x6c, 0x69, 0x63, 0x68, 0x69, 0x73, 0x61, 0x6e, 0x6f, 0x3b, 0x50, 0x61, 0x63, 0x68, 0x69, 0x62, 0x65, 0x6c, 0x75, 0x73,
+0x68, 0x69, 0x3b, 0x64, 0x75, 0x6d, 0x3b, 0x73, 0x69, 0x67, 0x3b, 0x74, 0x65, 0x72, 0x3b, 0x6b, 0x75, 0x61, 0x3b, 0x6b,
+0x69, 0x6e, 0x3b, 0x73, 0x65, 0x73, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64, 0x75, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x73,
+0x69, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x74, 0x65, 0x72, 0x73, 0x61, 0x2d, 0x66, 0x65,
+0x72, 0x61, 0x3b, 0x6b, 0x75, 0x61, 0x72, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x6b, 0x69, 0x6e, 0x74, 0x61,
+0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x73, 0x65, 0x73, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x73, 0xe1, 0x62,
+0x61, 0x64, 0x75, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x64, 0x75,
+0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x73, 0x69, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x74,
+0x65, 0x72, 0x73, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x6b, 0x75, 0x61, 0x72, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72,
+0x61, 0x3b, 0x6b, 0x69, 0x6e, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x73, 0x65, 0x73, 0x74, 0x61, 0x2d, 0x66,
+0x65, 0x72, 0x61, 0x3b, 0x73, 0x61, 0x62, 0x61, 0x64, 0x75, 0x3b, 0x4b, 0x49, 0x55, 0x3b, 0x4d, 0x52, 0x41, 0x3b, 0x57,
+0x41, 0x49, 0x3b, 0x57, 0x45, 0x54, 0x3b, 0x57, 0x45, 0x4e, 0x3b, 0x57, 0x54, 0x4e, 0x3b, 0x4a, 0x55, 0x4d, 0x3b, 0x4b,
+0x69, 0x75, 0x6d, 0x69, 0x61, 0x3b, 0x4d, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x6f, 0x3b, 0x57, 0x61, 0x69, 0x72, 0x69,
+0x3b, 0x57, 0x65, 0x74, 0x68, 0x61, 0x74, 0x75, 0x3b, 0x57, 0x65, 0x6e, 0x61, 0x3b, 0x57, 0x65, 0x74, 0x61, 0x6e, 0x6f,
+0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x57, 0x3b, 0x57, 0x3b, 0x57, 0x3b,
+0x57, 0x3b, 0x4a, 0x3b, 0x4b, 0x74, 0x73, 0x3b, 0x4b, 0x6f, 0x74, 0x3b, 0x4b, 0x6f, 0x6f, 0x3b, 0x4b, 0x6f, 0x73, 0x3b,
+0x4b, 0x6f, 0x61, 0x3b, 0x4b, 0x6f, 0x6d, 0x3b, 0x4b, 0x6f, 0x6c, 0x3b, 0x4b, 0x6f, 0x74, 0x69, 0x73, 0x61, 0x70, 0x3b,
+0x4b, 0x6f, 0x74, 0x61, 0x61, 0x69, 0x3b, 0x4b, 0x6f, 0x61, 0x65, 0x6e, 0x67, 0x2019, 0x3b, 0x4b, 0x6f, 0x73, 0x6f, 0x6d,
+0x6f, 0x6b, 0x3b, 0x4b, 0x6f, 0x61, 0x6e, 0x67, 0x2019, 0x77, 0x61, 0x6e, 0x3b, 0x4b, 0x6f, 0x6d, 0x75, 0x75, 0x74, 0x3b,
+0x4b, 0x6f, 0x6c, 0x6f, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4c, 0x3b, 0x53,
+0x6f, 0x6e, 0x3b, 0x4d, 0x61, 0x3b, 0x44, 0x65, 0x3b, 0x57, 0x75, 0x3b, 0x44, 0x6f, 0x3b, 0x46, 0x72, 0x3b, 0x53, 0x61,
+0x74, 0x3b, 0x53, 0x6f, 0x6e, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x4d, 0x61, 0x6e, 0x74, 0x61, 0x78,
+0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x44, 0x65, 0x6e, 0x73, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x57,
+0x75, 0x6e, 0x73, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x44, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x74, 0x61,
+0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x46, 0x72, 0x61, 0x69, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b,
+0x53, 0x61, 0x74, 0x65, 0x72, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x45, 0x3b,
+0x57, 0x3b, 0x44, 0x3b, 0x46, 0x3b, 0x41, 0x3b, 0x53, 0x75, 0x2e, 0x3b, 0x4d, 0x6f, 0x2e, 0x3b, 0x44, 0x69, 0x2e, 0x3b,
+0x4d, 0x65, 0x2e, 0x3b, 0x44, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0x75, 0x6e, 0x6e,
+0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x4d, 0x6f, 0x68, 0x6e, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x44, 0x69, 0x6e, 0x6e,
+0x73, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x4d, 0x65, 0x74, 0x77, 0x6f, 0x63, 0x68, 0x3b, 0x44, 0x75, 0x6e, 0x6e, 0x65,
+0x72, 0x73, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x46, 0x72, 0x69, 0x69, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x53, 0x61,
+0x6d, 0x73, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0xed, 0x6c, 0xed, 0x3b, 0x4a, 0x75, 0x6d,
+0x61, 0x74, 0xe1, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0xe1, 0x6e,
+0x254, 0x3b, 0x41, 0x6c, 0x61, 0xe1, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0xe1, 0x61, 0x3b, 0x4a, 0x75, 0x6d,
+0x61, 0x6d, 0xf3, 0x73, 0x69, 0x3b, 0x53, 0x61, 0x62, 0x69, 0x3b, 0x42, 0x61, 0x6c, 0x61, 0x3b, 0x4b, 0x75, 0x62, 0x69,
+0x3b, 0x4b, 0x75, 0x73, 0x61, 0x3b, 0x4b, 0x75, 0x6e, 0x61, 0x3b, 0x4b, 0x75, 0x74, 0x61, 0x3b, 0x4d, 0x75, 0x6b, 0x61,
+0x3b, 0x53, 0x61, 0x62, 0x69, 0x69, 0x74, 0x69, 0x3b, 0x42, 0x61, 0x6c, 0x61, 0x7a, 0x61, 0x3b, 0x4f, 0x77, 0x6f, 0x6b,
+0x75, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x4f, 0x77, 0x6f, 0x6b, 0x75, 0x73, 0x61, 0x74, 0x75, 0x3b, 0x4f, 0x6c, 0x6f, 0x6b,
+0x75, 0x6e, 0x61, 0x3b, 0x4f, 0x6c, 0x6f, 0x6b, 0x75, 0x74, 0x61, 0x61, 0x6e, 0x75, 0x3b, 0x4f, 0x6c, 0x6f, 0x6d, 0x75,
+0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x42, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b,
+0x4a, 0x32, 0x3b, 0x4a, 0x33, 0x3b, 0x4a, 0x34, 0x3b, 0x4a, 0x35, 0x3b, 0x41, 0x6c, 0x3b, 0x49, 0x6a, 0x3b, 0x4a, 0x31,
+0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a,
+0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x75, 0x72, 0x77,
+0x61, 0x20, 0x77, 0x61, 0x20, 0x4b, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4d, 0x75, 0x72, 0x77, 0x61, 0x20, 0x77, 0x61, 0x20,
+0x4b, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x4a, 0x70, 0x69, 0x3b,
+0x4a, 0x74, 0x74, 0x3b, 0x4a, 0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x6d, 0x3b,
+0x4a, 0x6d, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x42, 0x61, 0x72, 0x3b, 0x41, 0x61, 0x72, 0x3b, 0x55, 0x6e, 0x69, 0x3b,
+0x55, 0x6e, 0x67, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x65, 0x6a, 0x75, 0x6d,
+0x61, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x65, 0x62, 0x61, 0x72, 0x61, 0x73, 0x61, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x61, 0x72,
+0x65, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x75, 0x6e, 0x69, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x75, 0x6e, 0x67, 0x2019, 0x6f, 0x6e,
+0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x6b, 0x61, 0x6e, 0x79, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x73, 0x61, 0x62, 0x69, 0x74, 0x69,
+0x3b, 0x4a, 0x3b, 0x42, 0x3b, 0x41, 0x3b, 0x55, 0x3b, 0x55, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x41,
+0x74, 0x69, 0x3b, 0x41, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x3b, 0x41, 0x6c, 0x6d, 0x3b, 0x41, 0x6c, 0x6a, 0x3b, 0x41,
+0x73, 0x73, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x41, 0x74, 0x69, 0x6e, 0x69, 0x3b, 0x41, 0x74, 0x61, 0x6c,
+0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x69, 0x73, 0x61,
+0x3b, 0x41, 0x6c, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x73, 0x61, 0x62, 0x64, 0x75, 0x3b, 0x48, 0x3b, 0x54, 0x3b,
+0x54, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x4a, 0x4d, 0x50, 0x3b, 0x57, 0x55, 0x54, 0x3b, 0x54, 0x41,
+0x52, 0x3b, 0x54, 0x41, 0x44, 0x3b, 0x54, 0x41, 0x4e, 0x3b, 0x54, 0x41, 0x42, 0x3b, 0x4e, 0x47, 0x53, 0x3b, 0x4a, 0x75,
+0x6d, 0x61, 0x70, 0x69, 0x6c, 0x3b, 0x57, 0x75, 0x6f, 0x6b, 0x20, 0x54, 0x69, 0x63, 0x68, 0x3b, 0x54, 0x69, 0x63, 0x68,
+0x20, 0x41, 0x72, 0x69, 0x79, 0x6f, 0x3b, 0x54, 0x69, 0x63, 0x68, 0x20, 0x41, 0x64, 0x65, 0x6b, 0x3b, 0x54, 0x69, 0x63,
+0x68, 0x20, 0x41, 0x6e, 0x67, 0x2019, 0x77, 0x65, 0x6e, 0x3b, 0x54, 0x69, 0x63, 0x68, 0x20, 0x41, 0x62, 0x69, 0x63, 0x68,
+0x3b, 0x4e, 0x67, 0x65, 0x73, 0x6f, 0x3b, 0x4a, 0x3b, 0x57, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4e,
+0x3b, 0x41, 0x73, 0x61, 0x3b, 0x41, 0x79, 0x6e, 0x3b, 0x41, 0x73, 0x6e, 0x3b, 0x41, 0x6b, 0x72, 0x3b, 0x41, 0x6b, 0x77,
+0x3b, 0x41, 0x73, 0x6d, 0x3b, 0x41, 0x73, 0x1e0d, 0x3b, 0x41, 0x73, 0x61, 0x6d, 0x61, 0x73, 0x3b, 0x41, 0x79, 0x6e, 0x61,
+0x73, 0x3b, 0x41, 0x73, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x41, 0x6b, 0x72, 0x61, 0x73, 0x3b, 0x41, 0x6b, 0x77, 0x61, 0x73,
+0x3b, 0x41, 0x73, 0x69, 0x6d, 0x77, 0x61, 0x73, 0x3b, 0x41, 0x73, 0x69, 0x1e0d, 0x79, 0x61, 0x73, 0x3b, 0x41, 0x3b, 0x41,
+0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x41, 0x74, 0x69, 0x3b, 0x41,
+0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x3b, 0x41, 0x6c, 0x6d, 0x3b, 0x41, 0x6c, 0x7a, 0x3b, 0x41, 0x73, 0x69, 0x3b, 0x41,
+0x6c, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x41, 0x74, 0x69, 0x6e, 0x6e, 0x69, 0x3b, 0x41, 0x74, 0x61, 0x6c, 0x61, 0x61, 0x74,
+0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x69, 0x73, 0x61, 0x3b, 0x41,
+0x6c, 0x7a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x69, 0x62, 0x74, 0x69, 0x3b, 0x4a, 0x70, 0x69, 0x3b, 0x4a, 0x74, 0x74,
+0x3b, 0x4a, 0x6d, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f,
+0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x70, 0x69, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b,
+0x4a, 0x75, 0x6d, 0x61, 0x61, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c,
+0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x6d,
+0x6f, 0x73, 0x69, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x31, 0x3b, 0x930, 0x92c,
+0x93f, 0x3b, 0x938, 0x92e, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x3b, 0x92c, 0x941, 0x926, 0x3b, 0x92c, 0x93f, 0x938, 0x925, 0x93f, 0x3b,
+0x938, 0x941, 0x916, 0x941, 0x930, 0x3b, 0x938, 0x941, 0x928, 0x93f, 0x3b, 0x930, 0x92c, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x92e,
+0x92c, 0x93e, 0x930, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x92c, 0x93e, 0x930, 0x3b, 0x92c, 0x941, 0x926, 0x92c, 0x93e, 0x930, 0x3b, 0x92c,
+0x93f, 0x938, 0x925, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x941, 0x916, 0x941, 0x930, 0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x941, 0x928,
+0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x930, 0x3b, 0x938, 0x3b, 0x92e, 0x902, 0x3b, 0x92c, 0x941, 0x3b, 0x92c, 0x93f, 0x3b, 0x938, 0x941,
+0x3b, 0x938, 0x941, 0x3b, 0x43a, 0x4c0, 0x438, 0x3b, 0x43e, 0x440, 0x3b, 0x448, 0x438, 0x3b, 0x43a, 0x445, 0x430, 0x3b, 0x435, 0x430,
+0x3b, 0x43f, 0x4c0, 0x435, 0x3b, 0x448, 0x443, 0x43e, 0x3b, 0x43a, 0x4c0, 0x438, 0x440, 0x430, 0x3b, 0x43e, 0x440, 0x448, 0x43e, 0x442,
+0x3b, 0x448, 0x438, 0x43d, 0x430, 0x440, 0x430, 0x3b, 0x43a, 0x445, 0x430, 0x430, 0x440, 0x430, 0x3b, 0x435, 0x430, 0x440, 0x430, 0x3b,
+0x43f, 0x4c0, 0x435, 0x440, 0x430, 0x441, 0x43a, 0x430, 0x3b, 0x448, 0x443, 0x43e, 0x442, 0x3b, 0x43a, 0x4c0, 0x3b, 0x43e, 0x3b, 0x448,
+0x3b, 0x43a, 0x445, 0x3b, 0x435, 0x3b, 0x43f, 0x4c0, 0x3b, 0x448, 0x3b, 0x43d, 0x434, 0x2de7, 0x487, 0x467, 0x3b, 0x43f, 0x43d, 0x2de3,
+0x435, 0x3b, 0x432, 0x442, 0x43e, 0x2dec, 0x487, 0x3b, 0x441, 0x440, 0x2de3, 0x435, 0x3b, 0x447, 0x435, 0x2de6, 0x487, 0x3b, 0x43f, 0x467,
+0x2de6, 0x487, 0x3b, 0x441, 0xa64b, 0x2de0, 0x487, 0x3b, 0x43d, 0x435, 0x434, 0x463, 0x301, 0x43b, 0x467, 0x3b, 0x43f, 0x43e, 0x43d, 0x435,
+0x434, 0x463, 0x301, 0x43b, 0x44c, 0x43d, 0x438, 0x43a, 0x44a, 0x3b, 0x432, 0x442, 0x43e, 0x301, 0x440, 0x43d, 0x438, 0x43a, 0x44a, 0x3b,
+0x441, 0x440, 0x435, 0x434, 0x430, 0x300, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x435, 0x440, 0x442, 0x43e, 0x301, 0x43a, 0x44a, 0x3b, 0x43f,
+0x467, 0x442, 0x43e, 0x301, 0x43a, 0x44a, 0x3b, 0x441, 0xa64b, 0x431, 0x431, 0x461, 0x301, 0x442, 0x430, 0x3b, 0x4c, 0x75, 0x6d, 0x3b,
+0x4e, 0x6b, 0x6f, 0x3b, 0x4e, 0x64, 0x79, 0x3b, 0x4e, 0x64, 0x67, 0x3b, 0x4e, 0x6a, 0x77, 0x3b, 0x4e, 0x67, 0x76, 0x3b,
+0x4c, 0x75, 0x62, 0x3b, 0x4c, 0x75, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x4e, 0x6b, 0x6f, 0x64, 0x79, 0x61, 0x3b, 0x4e,
+0x64, 0xe0, 0x61, 0x79, 0xe0, 0x3b, 0x4e, 0x64, 0x61, 0x6e, 0x67, 0xf9, 0x3b, 0x4e, 0x6a, 0xf2, 0x77, 0x61, 0x3b, 0x4e,
+0x67, 0xf2, 0x76, 0x79, 0x61, 0x3b, 0x4c, 0x75, 0x62, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x4c, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b,
+0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4c, 0x3b, 0x53, 0x6f, 0x6e, 0x3b, 0x4d, 0xe9, 0x69, 0x3b, 0x44, 0xeb, 0x6e, 0x3b,
+0x4d, 0xeb, 0x74, 0x3b, 0x44, 0x6f, 0x6e, 0x3b, 0x46, 0x72, 0x65, 0x3b, 0x53, 0x61, 0x6d, 0x3b, 0x53, 0x6f, 0x6e, 0x6e,
+0x64, 0x65, 0x67, 0x3b, 0x4d, 0xe9, 0x69, 0x6e, 0x64, 0x65, 0x67, 0x3b, 0x44, 0xeb, 0x6e, 0x73, 0x63, 0x68, 0x64, 0x65,
+0x67, 0x3b, 0x4d, 0xeb, 0x74, 0x74, 0x77, 0x6f, 0x63, 0x68, 0x3b, 0x44, 0x6f, 0x6e, 0x6e, 0x65, 0x73, 0x63, 0x68, 0x64,
+0x65, 0x67, 0x3b, 0x46, 0x72, 0x65, 0x69, 0x64, 0x65, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x73, 0x63, 0x68, 0x64, 0x65, 0x67,
+0x3b, 0x53, 0x6f, 0x6e, 0x2e, 0x3b, 0x4d, 0xe9, 0x69, 0x2e, 0x3b, 0x44, 0xeb, 0x6e, 0x2e, 0x3b, 0x4d, 0xeb, 0x74, 0x2e,
+0x3b, 0x44, 0x6f, 0x6e, 0x2e, 0x3b, 0x46, 0x72, 0x65, 0x2e, 0x3b, 0x53, 0x61, 0x6d, 0x2e, 0x3b, 0x6e, 0x74, 0x73, 0x3b,
+0x6b, 0x70, 0x61, 0x3b, 0x67, 0x68, 0x254, 0x3b, 0x74, 0x254, 0x6d, 0x3b, 0x75, 0x6d, 0x65, 0x3b, 0x67, 0x68, 0x268, 0x3b,
+0x64, 0x7a, 0x6b, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x6e, 0x74, 0x73, 0x268, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x6b, 0x70,
+0xe0, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x67, 0x68, 0x254, 0x65, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x74, 0x254, 0x300,
+0x6d, 0x6c, 0xf2, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x6d, 0xe8, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x67, 0x68, 0x268,
+0x302, 0x6d, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x6e, 0x64, 0x7a, 0x268, 0x6b, 0x254, 0x294, 0x254, 0x3b, 0x6e, 0x3b, 0x6b, 0x3b,
+0x67, 0x3b, 0x74, 0x3b, 0x75, 0x3b, 0x67, 0x3b, 0x64, 0x3b, 0x6e, 0x254, 0x79, 0x3b, 0x6e, 0x6a, 0x61, 0x3b, 0x75, 0x75,
+0x6d, 0x3b, 0x14b, 0x67, 0x65, 0x3b, 0x6d, 0x62, 0x254, 0x3b, 0x6b, 0x254, 0x254, 0x3b, 0x6a, 0x6f, 0x6e, 0x3b, 0x14b, 0x67,
+0x77, 0xe0, 0x20, 0x6e, 0x254, 0x302, 0x79, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6e, 0x6a, 0x61, 0x14b, 0x67, 0x75, 0x6d,
+0x62, 0x61, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0xfb, 0x6d, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x14b, 0x67, 0xea, 0x3b,
+0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6d, 0x62, 0x254, 0x6b, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6b, 0x254, 0x254, 0x3b, 0x14b,
+0x67, 0x77, 0xe0, 0x20, 0x6a, 0xf4, 0x6e, 0x3b, 0x6e, 0x3b, 0x6e, 0x3b, 0x75, 0x3b, 0x14b, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b,
+0x6a, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x41, 0x74, 0x69, 0x6e, 0x6e, 0x69, 0x3b, 0x41, 0x74, 0x61, 0x6c,
+0x61, 0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69,
+0x3b, 0x41, 0x6c, 0x7a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x69, 0x62, 0x74, 0x69, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x54,
+0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x53, 0x3b, 0xe9, 0x74, 0x3b, 0x6d, 0x254, 0x301, 0x73, 0x3b, 0x6b, 0x77, 0x61,
+0x3b, 0x6d, 0x75, 0x6b, 0x3b, 0x14b, 0x67, 0x69, 0x3b, 0x257, 0xf3, 0x6e, 0x3b, 0x65, 0x73, 0x61, 0x3b, 0xe9, 0x74, 0x69,
+0x3b, 0x6d, 0x254, 0x301, 0x73, 0xfa, 0x3b, 0x6b, 0x77, 0x61, 0x73, 0xfa, 0x3b, 0x6d, 0x75, 0x6b, 0x254, 0x301, 0x73, 0xfa,
+0x3b, 0x14b, 0x67, 0x69, 0x73, 0xfa, 0x3b, 0x257, 0xf3, 0x6e, 0x25b, 0x73, 0xfa, 0x3b, 0x65, 0x73, 0x61, 0x253, 0x61, 0x73,
+0xfa, 0x3b, 0x65, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x14b, 0x3b, 0x257, 0x3b, 0x65, 0x3b, 0x44, 0x69, 0x6d, 0x3b,
+0x54, 0x65, 0x6e, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0x41, 0x6c, 0x61, 0x3b, 0x41, 0x72, 0x61, 0x3b, 0x41, 0x72, 0x6a, 0x3b,
+0x53, 0x69, 0x62, 0x3b, 0x44, 0x69, 0x6d, 0x61, 0x73, 0x3b, 0x54, 0x65, 0x6e, 0x65, 0x14b, 0x3b, 0x54, 0x61, 0x6c, 0x61,
+0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x79, 0x3b, 0x41, 0x72, 0x61, 0x6d, 0x69, 0x73, 0x61, 0x79, 0x3b,
+0x41, 0x72, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x53, 0x69, 0x62, 0x69, 0x74, 0x69, 0x3b, 0x44, 0x3b, 0x54, 0x3b, 0x54, 0x3b,
+0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x3b, 0x6d, 0x254, 0x301, 0x6e, 0x3b, 0x73, 0x6d,
+0x62, 0x3b, 0x73, 0x6d, 0x6c, 0x3b, 0x73, 0x6d, 0x6e, 0x3b, 0x66, 0xfa, 0x6c, 0x3b, 0x73, 0xe9, 0x72, 0x3b, 0x73, 0x254,
+0x301, 0x6e, 0x64, 0x254, 0x3b, 0x6d, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d,
+0x259, 0x6c, 0xfa, 0x20, 0x6d, 0x259, 0x301, 0x62, 0x25b, 0x30c, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x259,
+0x6c, 0xfa, 0x20, 0x6d, 0x259, 0x301, 0x6c, 0x25b, 0x301, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x259, 0x6c,
+0xfa, 0x20, 0x6d, 0x259, 0x301, 0x6e, 0x79, 0x69, 0x3b, 0x66, 0xfa, 0x6c, 0x61, 0x64, 0xe9, 0x3b, 0x73, 0xe9, 0x72, 0x61,
+0x64, 0xe9, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x66, 0x3b, 0x73, 0x3b, 0x73, 0x254, 0x301,
+0x6e, 0x3b, 0x6c, 0x1dd, 0x6e, 0x3b, 0x6d, 0x61, 0x61, 0x3b, 0x6d, 0x25b, 0x6b, 0x3b, 0x6a, 0x1dd, 0x1dd, 0x3b, 0x6a, 0xfa,
+0x6d, 0x3b, 0x73, 0x61, 0x6d, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x1dd, 0x3b, 0x6c, 0x1dd, 0x6e, 0x64, 0xed, 0x3b, 0x6d,
+0x61, 0x61, 0x64, 0xed, 0x3b, 0x6d, 0x25b, 0x6b, 0x72, 0x25b, 0x64, 0xed, 0x3b, 0x6a, 0x1dd, 0x1dd, 0x64, 0xed, 0x3b, 0x6a,
+0xfa, 0x6d, 0x62, 0xe1, 0x3b, 0x73, 0x61, 0x6d, 0x64, 0xed, 0x3b, 0x73, 0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6a,
+0x3b, 0x6a, 0x3b, 0x73, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a, 0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e,
+0x3b, 0x41, 0x72, 0x61, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x53, 0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b,
+0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d,
+0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x72, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d,
+0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x53, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b,
+0x41, 0x3b, 0x49, 0x3b, 0x4a, 0x3b, 0x43, 0x79, 0x61, 0x3b, 0x43, 0x6c, 0x61, 0x3b, 0x43, 0x7a, 0x69, 0x3b, 0x43, 0x6b,
+0x6f, 0x3b, 0x43, 0x6b, 0x61, 0x3b, 0x43, 0x67, 0x61, 0x3b, 0x43, 0x7a, 0x65, 0x3b, 0x43, 0x6f, 0x6d, 0x2019, 0x79, 0x61,
+0x6b, 0x6b, 0x65, 0x3b, 0x43, 0x6f, 0x6d, 0x6c, 0x61, 0x61, 0x257, 0x69, 0x69, 0x3b, 0x43, 0x6f, 0x6d, 0x7a, 0x79, 0x69,
+0x69, 0x257, 0x69, 0x69, 0x3b, 0x43, 0x6f, 0x6d, 0x6b, 0x6f, 0x6c, 0x6c, 0x65, 0x3b, 0x43, 0x6f, 0x6d, 0x6b, 0x61, 0x6c,
+0x64, 0x1dd, 0x253, 0x6c, 0x69, 0x69, 0x3b, 0x43, 0x6f, 0x6d, 0x67, 0x61, 0x69, 0x73, 0x75, 0x75, 0x3b, 0x43, 0x6f, 0x6d,
+0x7a, 0x79, 0x65, 0x253, 0x73, 0x75, 0x75, 0x3b, 0x59, 0x3b, 0x4c, 0x3b, 0x5a, 0x3b, 0x4f, 0x3b, 0x41, 0x3b, 0x47, 0x3b,
+0x45, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x3b, 0x6d, 0x254, 0x301, 0x6e, 0x3b, 0x73, 0x6d, 0x62, 0x3b, 0x73, 0x6d, 0x6c, 0x3b,
+0x73, 0x6d, 0x6e, 0x3b, 0x6d, 0x62, 0x73, 0x3b, 0x73, 0x61, 0x73, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x3b, 0x6d,
+0x254, 0x301, 0x6e, 0x64, 0x254, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x61, 0x66, 0xfa, 0x20, 0x6d, 0xe1,
+0x62, 0x61, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x61, 0x66, 0xfa, 0x20, 0x6d, 0xe1, 0x6c, 0x61, 0x6c,
+0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x61, 0x66, 0xfa, 0x20, 0x6d, 0xe1, 0x6e, 0x61, 0x3b, 0x6d, 0x61,
+0x62, 0xe1, 0x67, 0xe1, 0x20, 0x6d, 0xe1, 0x20, 0x73, 0x75, 0x6b, 0x75, 0x6c, 0x3b, 0x73, 0xe1, 0x73, 0x61, 0x64, 0x69,
+0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x43, 0xe4, 0x14b, 0x3b, 0x4a,
+0x69, 0x65, 0x63, 0x3b, 0x52, 0x25b, 0x77, 0x3b, 0x44, 0x69, 0x254, 0x331, 0x6b, 0x3b, 0x14a, 0x75, 0x61, 0x61, 0x6e, 0x3b,
+0x44, 0x68, 0x69, 0x65, 0x65, 0x63, 0x3b, 0x42, 0xe4, 0x6b, 0x25b, 0x6c, 0x3b, 0x43, 0xe4, 0x14b, 0x20, 0x6b, 0x75, 0x254,
+0x74, 0x68, 0x3b, 0x4a, 0x69, 0x65, 0x63, 0x20, 0x6c, 0x61, 0x331, 0x74, 0x3b, 0x52, 0x25b, 0x77, 0x20, 0x6c, 0xe4, 0x74,
+0x6e, 0x69, 0x3b, 0x44, 0x69, 0x254, 0x331, 0x6b, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x14a, 0x75, 0x61, 0x61, 0x6e,
+0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x44, 0x68, 0x69, 0x65, 0x65, 0x63, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b,
+0x42, 0xe4, 0x6b, 0x25b, 0x6c, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x43, 0x3b, 0x4a, 0x3b, 0x52, 0x3b, 0x44, 0x3b,
+0x14a, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x431, 0x441, 0x3b, 0x431, 0x43d, 0x3b, 0x43e, 0x43f, 0x3b, 0x441, 0x44d, 0x3b, 0x447, 0x43f,
+0x3b, 0x431, 0x44d, 0x3b, 0x441, 0x431, 0x3b, 0x431, 0x430, 0x441, 0x43a, 0x44b, 0x4bb, 0x44b, 0x430, 0x43d, 0x43d, 0x44c, 0x430, 0x3b,
+0x431, 0x44d, 0x43d, 0x438, 0x434, 0x438, 0x44d, 0x43d, 0x43d, 0x44c, 0x438, 0x43a, 0x3b, 0x43e, 0x43f, 0x442, 0x443, 0x43e, 0x440, 0x443,
+0x43d, 0x43d, 0x44c, 0x443, 0x43a, 0x3b, 0x441, 0x44d, 0x440, 0x44d, 0x434, 0x44d, 0x3b, 0x447, 0x44d, 0x43f, 0x43f, 0x438, 0x44d, 0x440,
+0x3b, 0x411, 0x44d, 0x44d, 0x442, 0x438, 0x4a5, 0x441, 0x44d, 0x3b, 0x441, 0x443, 0x431, 0x443, 0x43e, 0x442, 0x430, 0x3b, 0x411, 0x3b,
+0x411, 0x3b, 0x41e, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x411, 0x3b, 0x421, 0x3b, 0x4d, 0x75, 0x6c, 0x3b, 0x4a, 0x74, 0x74, 0x3b,
+0x4a, 0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b,
+0x4d, 0x75, 0x6c, 0x75, 0x6e, 0x67, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d,
+0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x61, 0x68, 0x61, 0x6d,
+0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b,
+0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4a, 0x3b, 0xa55e, 0xa54c, 0xa535, 0x3b, 0xa5f3, 0xa5e1,
+0xa609, 0x3b, 0xa55a, 0xa55e, 0xa55a, 0x3b, 0xa549, 0xa55e, 0xa552, 0x3b, 0xa549, 0xa524, 0xa546, 0xa562, 0x3b, 0xa549, 0xa524, 0xa540, 0xa56e, 0x3b,
+0xa53b, 0xa52c, 0xa533, 0x3b, 0x6c, 0x61, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x74, 0x25b, 0x25b, 0x6e, 0x25b, 0x25b, 0x3b, 0x74, 0x61,
+0x6c, 0x61, 0x74, 0x61, 0x3b, 0x61, 0x6c, 0x61, 0x62, 0x61, 0x3b, 0x61, 0x69, 0x6d, 0x69, 0x73, 0x61, 0x3b, 0x61, 0x69,
+0x6a, 0x69, 0x6d, 0x61, 0x3b, 0x73, 0x69, 0x253, 0x69, 0x74, 0x69, 0x3b, 0x53, 0x75, 0x6e, 0x3b, 0x4d, 0xe4, 0x6e, 0x3b,
+0x5a, 0x69, 0x161, 0x3b, 0x4d, 0x69, 0x74, 0x3b, 0x46, 0x72, 0xf3, 0x3b, 0x46, 0x72, 0x69, 0x3b, 0x53, 0x61, 0x6d, 0x3b,
+0x53, 0x75, 0x6e, 0x6e, 0x74, 0x61, 0x67, 0x3b, 0x4d, 0xe4, 0x6e, 0x74, 0x61, 0x67, 0x3b, 0x5a, 0x69, 0x161, 0x74, 0x61,
+0x67, 0x3b, 0x4d, 0x69, 0x74, 0x74, 0x77, 0x75, 0x10d, 0x3b, 0x46, 0x72, 0xf3, 0x6e, 0x74, 0x61, 0x67, 0x3b, 0x46, 0x72,
+0x69, 0x74, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x161, 0x74, 0x61, 0x67, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x4d,
+0x3b, 0x46, 0x3b, 0x46, 0x3b, 0x53, 0x3b, 0x73, 0x64, 0x3b, 0x6d, 0x64, 0x3b, 0x6d, 0x77, 0x3b, 0x65, 0x74, 0x3b, 0x6b,
+0x6c, 0x3b, 0x66, 0x6c, 0x3b, 0x73, 0x73, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x25b, 0x3b, 0x6d, 0xf3, 0x6e, 0x64,
+0x69, 0x65, 0x3b, 0x6d, 0x75, 0xe1, 0x6e, 0x79, 0xe1, 0x14b, 0x6d, 0xf3, 0x6e, 0x64, 0x69, 0x65, 0x3b, 0x6d, 0x65, 0x74,
+0xfa, 0x6b, 0x70, 0xed, 0xe1, 0x70, 0x25b, 0x3b, 0x6b, 0xfa, 0x70, 0xe9, 0x6c, 0x69, 0x6d, 0x65, 0x74, 0xfa, 0x6b, 0x70,
+0x69, 0x61, 0x70, 0x25b, 0x3b, 0x66, 0x65, 0x6c, 0xe9, 0x74, 0x65, 0x3b, 0x73, 0xe9, 0x73, 0x65, 0x6c, 0xe9, 0x3b, 0x73,
+0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x65, 0x3b, 0x6b, 0x3b, 0x66, 0x3b, 0x73, 0x3b, 0x64, 0x6f, 0x6d, 0x3b, 0x6c, 0x6c, 0x75,
+0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x69, 0xe9, 0x3b, 0x78, 0x75, 0x65, 0x3b, 0x76, 0x69, 0x65, 0x3b, 0x73, 0xe1, 0x62,
+0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x6c, 0x6c, 0x75, 0x6e, 0x65, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74,
+0x65, 0x73, 0x3b, 0x6d, 0x69, 0xe9, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x78, 0x75, 0x65, 0x76, 0x65, 0x73, 0x3b,
+0x76, 0x69, 0x65, 0x6e, 0x72, 0x65, 0x73, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x75, 0x3b, 0x53, 0x254, 0x301, 0x6e, 0x64,
+0x69, 0x3b, 0x4d, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x3b, 0xc1, 0x70, 0x74, 0x61, 0x20, 0x4d, 0x254, 0x301, 0x6e, 0x64, 0x69,
+0x3b, 0x57, 0x25b, 0x301, 0x6e, 0x25b, 0x73, 0x25b, 0x64, 0x25b, 0x3b, 0x54, 0x254, 0x301, 0x73, 0x25b, 0x64, 0x25b, 0x3b, 0x46,
+0x25b, 0x6c, 0xe2, 0x79, 0x25b, 0x64, 0x25b, 0x3b, 0x53, 0xe1, 0x73, 0x69, 0x64, 0x25b, 0x3b, 0x53, 0x254, 0x301, 0x3b, 0x4d,
+0x254, 0x301, 0x3b, 0xc1, 0x4d, 0x3b, 0x57, 0x25b, 0x301, 0x3b, 0x54, 0x254, 0x301, 0x3b, 0x46, 0x25b, 0x3b, 0x53, 0xe1, 0x3b,
+0x73, 0x254, 0x6e, 0x64, 0x69, 0x3b, 0x6c, 0x75, 0x6e, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x69, 0x3b, 0x6d, 0x25b,
+0x72, 0x6b, 0x25b, 0x72, 0x25b, 0x64, 0x69, 0x3b, 0x79, 0x65, 0x64, 0x69, 0x3b, 0x76, 0x61, 0x14b, 0x64, 0x25b, 0x72, 0x25b,
+0x64, 0x69, 0x3b, 0x6d, 0x254, 0x6e, 0x254, 0x20, 0x73, 0x254, 0x6e, 0x64, 0x69, 0x3b, 0x73, 0x6f, 0x3b, 0x6c, 0x75, 0x3b,
+0x6d, 0x61, 0x3b, 0x6d, 0x25b, 0x3b, 0x79, 0x65, 0x3b, 0x76, 0x61, 0x3b, 0x6d, 0x73, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20,
+0x31, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x32, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x33, 0x3b, 0x41, 0x6e, 0x65, 0x67,
+0x20, 0x34, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x35, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x36, 0x3b, 0x41, 0x6e, 0x65,
+0x67, 0x20, 0x37, 0x3b, 0x41, 0x31, 0x3b, 0x41, 0x32, 0x3b, 0x41, 0x33, 0x3b, 0x41, 0x34, 0x3b, 0x41, 0x35, 0x3b, 0x41,
+0x36, 0x3b, 0x41, 0x37, 0x3b, 0x6c, 0x79, 0x25b, 0x2bc, 0x25b, 0x301, 0x20, 0x73, 0x1e85, 0xed, 0x14b, 0x74, 0xe8, 0x3b, 0x6d,
+0x76, 0x66, 0xf2, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0x62, 0x254, 0x301, 0x254, 0x6e, 0x74, 0xe8, 0x20, 0x6d,
+0x76, 0x66, 0xf2, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x74, 0x73, 0xe8, 0x74, 0x73, 0x25b, 0x300, 0x25b, 0x20, 0x6c,
+0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0x62, 0x254, 0x301, 0x254, 0x6e, 0x74, 0xe8, 0x20, 0x74, 0x73, 0x65, 0x74, 0x73, 0x25b,
+0x300, 0x25b, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0x76, 0x66, 0xf2, 0x20, 0x6d, 0xe0, 0x67, 0x61, 0x20, 0x6c,
+0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0xe0, 0x67, 0x61, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x41, 0x14b, 0x70, 0xe9,
+0x74, 0x75, 0x77, 0x61, 0x6b, 0x21f, 0x61, 0x14b, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x77, 0x61, 0x14b, 0x17e, 0x69,
+0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x6e, 0x75, 0x14b, 0x70, 0x61, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x79,
+0x61, 0x6d, 0x6e, 0x69, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x74, 0x6f, 0x70, 0x61, 0x3b, 0x41, 0x14b, 0x70, 0xe9,
+0x74, 0x75, 0x7a, 0x61, 0x70, 0x74, 0x61, 0x14b, 0x3b, 0x4f, 0x77, 0xe1, 0x14b, 0x67, 0x79, 0x75, 0x17e, 0x61, 0x17e, 0x61,
+0x70, 0x69, 0x3b, 0x41, 0x3b, 0x57, 0x3b, 0x4e, 0x3b, 0x59, 0x3b, 0x54, 0x3b, 0x5a, 0x3b, 0x4f, 0x3b, 0x2d30, 0x2d59, 0x2d30,
+0x2d4e, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d62, 0x2d4f, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4f, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d55,
+0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d61, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4e, 0x2d61, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49,
+0x2d39, 0x2d62, 0x2d30, 0x2d59, 0x3b, 0x6cc, 0x6d5, 0x6a9, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x62f, 0x648, 0x648, 0x634, 0x6d5, 0x645,
+0x645, 0x6d5, 0x3b, 0x633, 0x6ce, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x686, 0x648, 0x627, 0x631, 0x634, 0x6d5, 0x645, 0x645, 0x6d5,
+0x3b, 0x67e, 0x6ce, 0x646, 0x62c, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x6be, 0x6d5, 0x6cc, 0x646, 0x6cc, 0x3b, 0x634, 0x6d5, 0x645,
+0x645, 0x6d5, 0x3b, 0x6cc, 0x3b, 0x62f, 0x3b, 0x633, 0x3b, 0x686, 0x3b, 0x67e, 0x3b, 0x6be, 0x3b, 0x634, 0x3b, 0x6e, 0x6a, 0x65,
+0x3b, 0x70, 0xf3, 0x6e, 0x3b, 0x77, 0x61, 0x142, 0x3b, 0x73, 0x72, 0x6a, 0x3b, 0x73, 0x74, 0x77, 0x3b, 0x70, 0x11b, 0x74,
+0x3b, 0x73, 0x6f, 0x62, 0x3b, 0x6e, 0x6a, 0x65, 0x17a, 0x65, 0x6c, 0x61, 0x3b, 0x70, 0xf3, 0x6e, 0x6a, 0x65, 0x17a, 0x65,
+0x6c, 0x65, 0x3b, 0x77, 0x61, 0x142, 0x74, 0x6f, 0x72, 0x61, 0x3b, 0x73, 0x72, 0x6a, 0x6f, 0x64, 0x61, 0x3b, 0x73, 0x74,
+0x77, 0xf3, 0x72, 0x74, 0x6b, 0x3b, 0x70, 0x11b, 0x74, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b,
+0x70, 0x3b, 0x77, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x6e, 0x6a, 0x65, 0x3b, 0x70, 0xf3, 0x6e, 0x3b,
+0x77, 0x75, 0x74, 0x3b, 0x73, 0x72, 0x6a, 0x3b, 0x161, 0x74, 0x77, 0x3b, 0x70, 0x6a, 0x61, 0x3b, 0x73, 0x6f, 0x62, 0x3b,
+0x6e, 0x6a, 0x65, 0x64, 0x17a, 0x65, 0x6c, 0x61, 0x3b, 0x70, 0xf3, 0x6e, 0x64, 0x17a, 0x65, 0x6c, 0x61, 0x3b, 0x77, 0x75,
+0x74, 0x6f, 0x72, 0x61, 0x3b, 0x73, 0x72, 0x6a, 0x65, 0x64, 0x61, 0x3b, 0x161, 0x74, 0x77, 0xf3, 0x72, 0x74, 0x6b, 0x3b,
+0x70, 0x6a, 0x61, 0x74, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x77, 0x3b, 0x73,
+0x3b, 0x161, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x6e, 0x61, 0x64, 0x3b, 0x70, 0x61, 0x6e, 0x3b, 0x77, 0x69, 0x73, 0x3b, 0x70,
+0x75, 0x73, 0x3b, 0x6b, 0x65, 0x74, 0x3b, 0x70, 0x113, 0x6e, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x6e, 0x61, 0x64, 0x12b, 0x6c,
+0x69, 0x3b, 0x70, 0x61, 0x6e, 0x61, 0x64, 0x12b, 0x6c, 0x69, 0x3b, 0x77, 0x69, 0x73, 0x61, 0x73, 0x12b, 0x64, 0x69, 0x73,
+0x3b, 0x70, 0x75, 0x73, 0x73, 0x69, 0x73, 0x61, 0x77, 0x61, 0x69, 0x74, 0x69, 0x3b, 0x6b, 0x65, 0x74, 0x77, 0x69, 0x72,
+0x74, 0x69, 0x6b, 0x73, 0x3b, 0x70, 0x113, 0x6e, 0x74, 0x6e, 0x69, 0x6b, 0x73, 0x3b, 0x73, 0x61, 0x62, 0x61, 0x74, 0x74,
+0x69, 0x6b, 0x61, 0x3b, 0x4e, 0x3b, 0x50, 0x3b, 0x57, 0x3b, 0x50, 0x3b, 0x4b, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x70, 0x61,
+0x73, 0x3b, 0x76, 0x75, 0x6f, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6b, 0x6f, 0x73, 0x3b, 0x74, 0x75, 0x6f, 0x3b, 0x76, 0xe1,
+0x73, 0x3b, 0x6c, 0xe1, 0x76, 0x3b, 0x70, 0x61, 0x73, 0x65, 0x70, 0x65, 0x69, 0x76, 0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73,
+0x73, 0x61, 0x72, 0x67, 0xe2, 0x3b, 0x6d, 0x61, 0x6a, 0x65, 0x62, 0x61, 0x72, 0x67, 0xe2, 0x3b, 0x6b, 0x6f, 0x73, 0x6b,
+0x6f, 0x6b, 0x6b, 0x6f, 0x3b, 0x74, 0x75, 0x6f, 0x72, 0xe2, 0x73, 0x74, 0xe2, 0x68, 0x3b, 0x76, 0xe1, 0x73, 0x74, 0x75,
+0x70, 0x70, 0x65, 0x69, 0x76, 0x69, 0x3b, 0x6c, 0xe1, 0x76, 0x75, 0x72, 0x64, 0xe2, 0x68, 0x3b, 0x70, 0x61, 0x73, 0x65,
+0x70, 0x65, 0x65, 0x69, 0x76, 0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x73, 0x61, 0x61, 0x72, 0x67, 0xe2, 0x3b, 0x6d, 0x61,
+0x6a, 0x65, 0x62, 0x61, 0x61, 0x72, 0x67, 0xe2, 0x3b, 0x6b, 0x6f, 0x73, 0x6b, 0x6f, 0x68, 0x6f, 0x3b, 0x74, 0x75, 0x6f,
+0x72, 0xe2, 0x73, 0x74, 0x75, 0x76, 0x3b, 0x76, 0xe1, 0x73, 0x74, 0x75, 0x70, 0x70, 0x65, 0x65, 0x69, 0x76, 0x69, 0x3b,
+0x6c, 0xe1, 0x76, 0x75, 0x72, 0x64, 0x75, 0x76, 0x3b, 0x70, 0x3b, 0x56, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x56,
+0x3b, 0x4c, 0x3b, 0x44, 0x6f, 0x6d, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x6b, 0x73, 0x3b, 0x48,
+0x75, 0x3b, 0x42, 0x69, 0x3b, 0x53, 0x61, 0x3b, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x65,
+0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x4d, 0x69, 0x79, 0x65, 0x72, 0x6b, 0x75, 0x6c, 0x65, 0x73, 0x3b,
+0x48, 0x75, 0x77, 0x65, 0x62, 0x65, 0x73, 0x3b, 0x42, 0x69, 0x79, 0x65, 0x72, 0x6e, 0x65, 0x73, 0x3b, 0x53, 0x61, 0x62,
+0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x42, 0x3b, 0x53, 0x3b
+};
+
+static const ushort byte_unit_data[] = {
+0x62, 0x79, 0x74, 0x65, 0x73, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b,
+0x45, 0x42, 0x4b, 0x69, 0x42, 0x3b, 0x4d, 0x69, 0x42, 0x3b, 0x47, 0x69, 0x42, 0x3b, 0x54, 0x69, 0x42, 0x3b, 0x50, 0x69,
+0x42, 0x3b, 0x45, 0x69, 0x42, 0x62, 0x79, 0x74, 0x65, 0x67, 0x72, 0x65, 0x65, 0x70, 0x62, 0x61, 0x6a, 0x74, 0x1263, 0x12ed,
+0x1275, 0x12aa, 0x1263, 0x3b, 0x121c, 0x130b, 0x1263, 0x12ed, 0x1275, 0x3b, 0x130a, 0x1263, 0x3b, 0x1274, 0x122b, 0x1263, 0x12ed, 0x1275, 0x3b, 0x1354,
+0x1263, 0x3b, 0x45, 0x42, 0x628, 0x627, 0x64a, 0x62a, 0x643, 0x64a, 0x644, 0x648, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x645, 0x64a, 0x63a,
+0x627, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x63a, 0x64a, 0x63a, 0x627, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x62a, 0x64a, 0x631, 0x627, 0x628,
+0x627, 0x64a, 0x62a, 0x3b, 0x628, 0x64a, 0x62a, 0x627, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x45, 0x42, 0x562, 0x561, 0x575, 0x569, 0x565,
+0x580, 0x56f, 0x532, 0x3b, 0x544, 0x532, 0x3b, 0x533, 0x532, 0x3b, 0x54f, 0x532, 0x3b, 0x54a, 0x532, 0x3b, 0x45, 0x42, 0x9ac, 0x9be,
+0x987, 0x99f, 0x995, 0x9bf, 0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x9ae, 0x9c7, 0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x997, 0x9bf,
+0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x99f, 0x9c7, 0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x62,
+0x61, 0x79, 0x74, 0x62, 0x79, 0x74, 0x65, 0x2d, 0x61, 0x6b, 0x6f, 0x6b, 0x74, 0x65, 0x64, 0x6f, 0xf9, 0x6b, 0x6f, 0x3b,
+0x4d, 0x6f, 0x3b, 0x47, 0x6f, 0x3b, 0x54, 0x6f, 0x3b, 0x50, 0x6f, 0x3b, 0x45, 0x6f, 0x4b, 0x69, 0x6f, 0x3b, 0x4d, 0x69,
+0x6f, 0x3b, 0x47, 0x69, 0x6f, 0x3b, 0x54, 0x69, 0x6f, 0x3b, 0x50, 0x69, 0x6f, 0x3b, 0x45, 0x69, 0x6f, 0x431, 0x430, 0x439,
+0x442, 0x43e, 0x432, 0x435, 0x1018, 0x102d, 0x102f, 0x1000, 0x103a, 0x431, 0x430, 0x439, 0x442, 0x44b, 0x41a, 0x411, 0x3b, 0x41c, 0x411, 0x3b,
+0x413, 0x411, 0x3b, 0x422, 0x411, 0x3b, 0x41f, 0x411, 0x3b, 0x45, 0x42, 0x1794, 0x17c3, 0x5b57, 0x8282, 0x5343, 0x5b57, 0x8282, 0x3b, 0x5146,
+0x5b57, 0x8282, 0x3b, 0x5409, 0x5b57, 0x8282, 0x3b, 0x592a, 0x5b57, 0x8282, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x4f4d, 0x5143, 0x7d44, 0x62,
+0x61, 0x6a, 0x74, 0x6f, 0x76, 0x69, 0x62, 0x61, 0x6a, 0x74, 0x79, 0x62, 0x61, 0x6a, 0x74, 0x6f, 0x6a, 0x62, 0x61, 0x69,
+0x64, 0x69, 0x64, 0x62, 0xfd, 0x74, 0x74, 0x61, 0x76, 0x75, 0x74, 0x6b, 0x74, 0x3b, 0x4d, 0x74, 0x3b, 0x47, 0x74, 0x3b,
+0x54, 0x74, 0x3b, 0x50, 0x74, 0x3b, 0x45, 0x74, 0x4b, 0x69, 0x74, 0x3b, 0x4d, 0x69, 0x74, 0x3b, 0x47, 0x69, 0x74, 0x3b,
+0x54, 0x69, 0x74, 0x3b, 0x50, 0x69, 0x74, 0x3b, 0x45, 0x69, 0x74, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x62, 0x61, 0x69,
+0x64, 0x68, 0x74, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x10d9, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10db, 0x10d1, 0x10d0, 0x10d8, 0x10e2,
+0x10d8, 0x3b, 0x10d2, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10e2, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10de, 0x10d1, 0x10d0, 0x10d8,
+0x10e2, 0x10d8, 0x3b, 0x45, 0x42, 0x42, 0x79, 0x74, 0x65, 0x73, 0xaac, 0xabe, 0xa87, 0xa9f, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b,
+0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0xaaa, 0xac0, 0xaac, 0xac0, 0x3b, 0x45, 0x42, 0x5d1, 0x5d9, 0x5d9, 0x5d8, 0x92c, 0x93e, 0x907,
+0x91f, 0x62, 0xe1, 0x6a, 0x74, 0x62, 0xe6, 0x74, 0x69, 0x62, 0x65, 0x61, 0x72, 0x74, 0x61, 0x30d0, 0x30a4, 0x30c8, 0x4b, 0x42,
+0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x62, 0x69, 0x74, 0x65, 0xcac,
+0xcc8, 0xc9f, 0xccd, 0x200c, 0xc97, 0xcb3, 0xcc1, 0xc95, 0xcbf, 0x2e, 0xcac, 0xcc8, 0x2e, 0x3b, 0xcae, 0xcc6, 0x2e, 0xcac, 0xcc8, 0x2e,
+0x3b, 0xc97, 0xcbf, 0x2e, 0xcac, 0xcc8, 0x2e, 0x3b, 0xc9f, 0xcc6, 0x2e, 0xcac, 0xcc8, 0x2e, 0x3b, 0xcaa, 0xcc6, 0xcac, 0xcc8, 0x3b,
+0x45, 0x42, 0x431, 0x430, 0x439, 0x442, 0x43a, 0x411, 0x3b, 0x4d, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x54, 0x411, 0x3b, 0x41f, 0x411,
+0x3b, 0x45, 0x411, 0x4b, 0x69, 0x411, 0x3b, 0x4d, 0x69, 0x411, 0x3b, 0x47, 0x69, 0x411, 0x3b, 0x54, 0x69, 0x411, 0x3b, 0x50,
+0x69, 0x411, 0x3b, 0x45, 0x69, 0x411, 0x43a, 0x411, 0x3b, 0x41c, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x422, 0x411, 0x3b, 0x41f, 0x442,
+0x431, 0x3b, 0x45, 0x42, 0xbc14, 0xc774, 0xd2b8, 0x62, 0x61, 0x69, 0x74, 0x69, 0x62, 0x61, 0x69, 0x74, 0x61, 0x69, 0x431, 0x430,
+0x458, 0x442, 0x438, 0x62, 0x61, 0x69, 0x74, 0xd2c, 0xd48, 0xd31, 0xd4d, 0xd31, 0xd4d, 0xd15, 0xd46, 0xd2c, 0xd3f, 0x3b, 0xd0e, 0xd02,
+0xd2c, 0xd3f, 0x3b, 0xd1c, 0xd3f, 0xd2c, 0xd3f, 0x3b, 0xd1f, 0xd3f, 0xd2c, 0xd3f, 0x3b, 0xd2a, 0xd3f, 0xd2c, 0xd3f, 0x3b, 0x45, 0x42,
+0x43a, 0x411, 0x3b, 0x41c, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x422, 0x411, 0x3b, 0x41f, 0x411, 0x3b, 0x45, 0x42, 0x6b, 0x42, 0x3b,
+0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x92a, 0x93f, 0x91f, 0x93e, 0x3b, 0x45, 0x42, 0xb2c, 0xb3e, 0xb07, 0xb1f,
+0xb4d, 0x628, 0x627, 0x64a, 0x67c, 0x633, 0x628, 0x627, 0x6cc, 0x62a, 0x6a9, 0x6cc, 0x644, 0x648, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x645,
+0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x6af, 0x6cc, 0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x62a, 0x631, 0x627, 0x628,
+0x627, 0x6cc, 0x62a, 0x3b, 0x67e, 0x62a, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x45, 0x42, 0xa2c, 0xa3e, 0xa07, 0xa1f, 0x62, 0x79,
+0x21b, 0x69, 0x431, 0x430, 0x458, 0x442, 0x43e, 0x432, 0x438, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x632, 0x6aa, 0x644, 0x648, 0x20, 0x628,
+0x627, 0x626, 0x64a, 0x67d, 0x632, 0x3b, 0x645, 0x64a, 0x6af, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x632, 0x3b, 0x6af, 0x64a,
+0x6af, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x632, 0x3b, 0x67d, 0x64a, 0x631, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d,
+0x632, 0x3b, 0x67e, 0x64a, 0x631, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x633, 0x3b, 0x45, 0x42, 0xdb6, 0xdba, 0xdd2, 0xda7,
+0xdca, 0xd9a, 0xdd2, 0xdb6, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xdb8, 0xdd9, 0xdb6, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xd9c, 0xdd2, 0xdb6,
+0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xda7, 0xdd9, 0xdb6, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xdb4, 0xdd9, 0xdb6, 0x20, 0x7b, 0x30, 0x7d,
+0x3b, 0x45, 0x42, 0x62, 0x65, 0x79, 0x74, 0x69, 0x73, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42,
+0x3b, 0x42, 0x42, 0x3b, 0x45, 0x42, 0x6b, 0x69, 0x6c, 0x6f, 0x62, 0x61, 0x69, 0x74, 0x69, 0x20, 0x7b, 0x30, 0x7d, 0x3b,
+0x4d, 0x42, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x47, 0x42, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x74, 0x65, 0x72, 0x61, 0x62, 0x61,
+0x69, 0x74, 0x69, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x50, 0x42, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x45, 0x42, 0xbaa, 0xbc8, 0xb9f,
+0xbcd, 0xb95, 0xbb3, 0xbcd, 0xc2c, 0xc48, 0xc1f, 0xc4d, 0x200c, 0xc32, 0xc41, 0xc15, 0xc47, 0xc2c, 0xc40, 0x3b, 0xc0e, 0xc2e, 0xc4d, 0x200c,
+0xc2c, 0xc3f, 0x3b, 0xc1c, 0xc40, 0xc2c, 0xc40, 0x3b, 0xc1f, 0xc40, 0xc2c, 0xc40, 0x3b, 0xc2a, 0xc40, 0xc2c, 0xc40, 0x3b, 0x45, 0x42,
+0xe44, 0xe1a, 0xe15, 0xe4c, 0x70, 0x61, 0x69, 0x74, 0x69, 0x6b, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x4d,
+0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x47, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x54,
+0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x50, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x45,
+0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x4b, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x4d,
+0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x47, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d,
+0x3b, 0x54, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x50, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b,
+0x30, 0x7d, 0x3b, 0x45, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x62, 0x61, 0xfd, 0x74, 0x431, 0x430, 0x439,
+0x442, 0x438, 0x628, 0x627, 0x626, 0x679, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x67e, 0x6cc,
+0x20, 0x628, 0x6cc, 0x3b, 0x45, 0x42, 0x62, 0x65, 0x69, 0x74, 0x69, 0x61, 0x75, 0x92c, 0x93e, 0x92f, 0x91f, 0x61, 0x1e6d, 0x61,
+0x6d, 0x1e0d, 0x61, 0x6e, 0x6b, 0x41, 0x1e6c, 0x3b, 0x4d, 0x41, 0x1e6c, 0x3b, 0x47, 0x41, 0x1e6c, 0x3b, 0x54, 0x41, 0x1e6c, 0x3b,
+0x50, 0x42, 0x3b, 0x45, 0x42, 0x13d7, 0x13d3, 0x13cd, 0x13a6, 0x13b5, 0x13a9, 0x431, 0x430, 0x430, 0x439, 0x442, 0x43a, 0x411, 0x3b, 0x41c,
+0x411, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x62, 0x79, 0x74, 0x65, 0x79, 0x6a9, 0x6cc,
+0x644, 0x648, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x645, 0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x6af, 0x6cc, 0x6af, 0x627, 0x628,
+0x627, 0x6cc, 0x62a, 0x3b, 0x62a, 0x631, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x6d, 0x67, 0x61,
+0x20, 0x62, 0x79, 0x74, 0x65
+};
+
+static const ushort am_data[] = {
+0x41, 0x4d, 0x57, 0x44, 0x76, 0x6d, 0x2e, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x64, 0x69, 0x74, 0x65, 0x73, 0x1325, 0x12cb,
+0x1275, 0x635, 0x9aa, 0x9c2, 0x9f0, 0x9cd, 0x9ac, 0x9be, 0x9b9, 0x9cd, 0x9a8, 0x410, 0x41c, 0xf66, 0xf94, 0xf0b, 0xf46, 0xf0b, 0x41, 0x2e,
+0x4d, 0x2e, 0x43f, 0x440, 0x2e, 0x43e, 0x431, 0x2e, 0x1014, 0x1036, 0x1014, 0x1000, 0x103a, 0x61, 0x2e, 0xa0, 0x6d, 0x2e, 0x4e0a, 0x5348,
+0x64, 0x6f, 0x70, 0x2e, 0x61, 0x2e, 0x6d, 0x2e, 0x61, 0x6d, 0x61, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x6d, 0x61, 0x74, 0x69,
+0x6e, 0x6d, 0x3c0, 0x2e, 0x3bc, 0x2e, 0x53, 0x61, 0x66, 0x69, 0x79, 0x61, 0x5dc, 0x5e4, 0x5e0, 0x5d4, 0x5f4, 0x5e6, 0x64, 0x65,
+0x2e, 0x66, 0x2e, 0x68, 0x2e, 0x72, 0x2e, 0x6e, 0x2e, 0x5348, 0x524d, 0x49, 0x73, 0x75, 0x6b, 0xcaa, 0xcc2, 0xcb0, 0xccd, 0xcb5,
+0xcbe, 0xcb9, 0xccd, 0xca8, 0x442, 0x430, 0x4a3, 0x43a, 0x44b, 0xc624, 0xc804, 0x42, 0x4e, 0x5a, 0x2e, 0x4d, 0x55, 0x2e, 0xe81, 0xec8,
+0xead, 0xe99, 0xe97, 0xec8, 0xebd, 0xe87, 0x70, 0x72, 0x69, 0x65, 0x6b, 0x161, 0x70, 0x75, 0x73, 0x64, 0x69, 0x65, 0x6e, 0x101,
+0x6e, 0x74, 0x254, 0x301, 0x6e, 0x67, 0x254, 0x301, 0x70, 0x72, 0x69, 0x65, 0x161, 0x70, 0x69, 0x65, 0x74, 0x43f, 0x440, 0x435,
+0x442, 0x43f, 0x43b, 0x430, 0x434, 0x43d, 0x435, 0x50, 0x47, 0x92e, 0x2e, 0x92a, 0x942, 0x2e, 0x4af, 0x2e, 0x4e9, 0x2e, 0x92a, 0x942,
+0x930, 0x94d, 0x935, 0x93e, 0x939, 0x94d, 0x928, 0x63a, 0x2e, 0x645, 0x2e, 0x642, 0x628, 0x644, 0x200c, 0x627, 0x632, 0x638, 0x647, 0x631,
+0x64, 0x61, 0x20, 0x6d, 0x61, 0x6e, 0x68, 0xe3, 0xa2a, 0xa42, 0x2e, 0xa26, 0xa41, 0x2e, 0x4e, 0x44, 0x43f, 0x440, 0x435, 0x20,
+0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x43f, 0x440, 0x438, 0x458, 0x435, 0x20, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x70, 0x72, 0x69, 0x6a,
+0x65, 0x20, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x70, 0x72, 0x65, 0x20, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x4d5, 0x43c, 0x431, 0x438,
+0x441, 0x431, 0x43e, 0x43d, 0x44b, 0x20, 0x440, 0x430, 0x437, 0x43c, 0x4d5, 0x635, 0x628, 0x62d, 0x60c, 0x20, 0x645, 0x646, 0x62c, 0x647,
+0x646, 0x62f, 0xdb4, 0xdd9, 0x2e, 0xdc0, 0x2e, 0x47, 0x48, 0x66, 0x6d, 0xbae, 0xbc1, 0xbb1, 0xbcd, 0xbaa, 0xb95, 0xbb2, 0xbcd, 0xe01,
+0xe48, 0xe2d, 0xe19, 0xe40, 0xe17, 0xe35, 0xe48, 0xe22, 0xe07, 0xf66, 0xf94, 0xf0b, 0xf51, 0xfb2, 0xf7c, 0xf0b, 0x1295, 0x1309, 0x1206, 0x20,
+0x1230, 0x12d3, 0x1270, 0x68, 0x65, 0x6e, 0x67, 0x69, 0x68, 0x65, 0x6e, 0x67, 0x69, 0xd6, 0xd6, 0x67, 0xfc, 0x6e, 0x6f, 0x72,
+0x74, 0x61, 0x64, 0x61, 0x6e, 0x20, 0xf6, 0x148, 0x686, 0x6c8, 0x634, 0x62a, 0x649, 0x646, 0x20, 0x628, 0x6c7, 0x631, 0x6c7, 0x646,
+0x434, 0x43f, 0x54, 0x4f, 0x422, 0x41e, 0x53, 0x41, 0x79, 0x62, 0x53, 0x75, 0x62, 0x5e4, 0x5bf, 0x5d0, 0x5b7, 0x5e8, 0x5de, 0x5d9,
+0x5d8, 0x5d0, 0x5b8, 0x5d2, 0xc0, 0xe1, 0x72, 0x1ecd, 0x300, 0xc0, 0xe1, 0x72, 0x254, 0x300, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x64,
+0x64, 0x61, 0x67, 0x70, 0x72, 0x69, 0x6a, 0x65, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x41, 0x4e, 0x4e, 0x2019, 0x1ee5, 0x74, 0x1ee5,
+0x74, 0x1ee5, 0x128, 0x79, 0x61, 0x6b, 0x77, 0x61, 0x6b, 0x79, 0x61, 0x61, 0x2e, 0x14b, 0x64, 0x69, 0x61, 0x6d, 0x20, 0x56,
+0x6f, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x61, 0x67, 0xa3b8, 0xa111, 0x69, 0x111, 0x69, 0x74, 0x62, 0x65, 0x61, 0x69, 0x76, 0x65,
+0x74, 0x69, 0x62, 0x4d, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x4c, 0x75, 0x6d, 0x61, 0x20, 0x6c, 0x77, 0x61, 0x20, 0x4b, 0x73,
+0x75, 0x62, 0x61, 0x6b, 0x61, 0x4b, 0x69, 0x72, 0x6f, 0x6b, 0x6f, 0x54, 0x65, 0x73, 0x69, 0x72, 0x61, 0x6e, 0x6b, 0x61,
+0x6e, 0x67, 0x2019, 0x61, 0x6d, 0x61, 0x2d5c, 0x2d49, 0x2d3c, 0x2d30, 0x2d61, 0x2d5c, 0x74, 0x69, 0x66, 0x61, 0x77, 0x74, 0x6e, 0x20,
+0x74, 0x75, 0x66, 0x61, 0x74, 0x70, 0x61, 0x6d, 0x69, 0x6c, 0x61, 0x75, 0x75, 0x74, 0x75, 0x6b, 0x6f, 0x4b, 0x49, 0x13cc,
+0x13be, 0x13b4, 0x4d, 0x75, 0x68, 0x69, 0x54, 0x4f, 0x4f, 0x75, 0x6c, 0x75, 0x63, 0x68, 0x65, 0x6c, 0x6f, 0x52, 0x168, 0x6b,
+0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x1c1, 0x67, 0x6f, 0x61, 0x67, 0x61, 0x73, 0x55, 0x68, 0x72, 0x20, 0x76, 0xf6, 0x72, 0x6d,
+0x69, 0x64, 0x64, 0x61, 0x61, 0x63, 0x68, 0x73, 0x190, 0x6e, 0x6b, 0x61, 0x6b, 0x25b, 0x6e, 0x79, 0xe1, 0x4d, 0x75, 0x6e,
+0x6b, 0x79, 0x6f, 0x69, 0x63, 0x68, 0x65, 0x68, 0x65, 0x61, 0x76, 0x6f, 0x54, 0x61, 0x70, 0x61, 0x72, 0x61, 0x63, 0x68,
+0x75, 0x41, 0x64, 0x64, 0x75, 0x68, 0x61, 0x4f, 0x44, 0x5a, 0x64, 0x61, 0x74, 0x20, 0x61, 0x7a, 0x61, 0x6c, 0x6d, 0x61,
+0x6b, 0x65, 0x6f, 0x92b, 0x941, 0x902, 0x44, 0x69, 0x6e, 0x64, 0x61, 0x6d, 0x6f, 0x69, 0x65, 0x73, 0x61, 0x2e, 0x67, 0x49,
+0x20, 0x62, 0x69, 0x6b, 0x25b, 0x302, 0x67, 0x6c, 0xe0, 0x53, 0x75, 0x62, 0x62, 0x61, 0x61, 0x68, 0x69, 0x69, 0x64, 0x69,
+0x253, 0x61, 0x6b, 0xed, 0x6b, 0xed, 0x72, 0xed, 0x67, 0x73, 0xe1, 0x72, 0xfa, 0x77, 0xe1, 0x77, 0x69, 0x63, 0x68, 0x69,
+0x73, 0x68, 0x75, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6d, 0x61, 0x6e, 0xe1, 0x52, 0x57, 0x42d, 0x418, 0x4c, 0x77, 0x61, 0x6d,
+0x69, 0x6c, 0x61, 0x77, 0x75, 0x6b, 0x69, 0x25b, 0x6d, 0x25b, 0x301, 0x25b, 0x6d, 0x64, 0x65, 0x20, 0x6c, 0x61, 0x20, 0x6d,
+0x61, 0xf1, 0x61, 0x6e, 0x61, 0x6d, 0x62, 0x61, 0xa78c, 0x6d, 0x62, 0x61, 0xa78c, 0x6d, 0x62, 0x61, 0x2bc, 0xe1, 0x6d, 0x62,
+0x61, 0x2bc, 0x628, 0x2e, 0x646, 0x64, 0x6f, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x61, 0x69, 0x70, 0x2e
+};
+
+static const ushort pm_data[] = {
+0x50, 0x4d, 0x57, 0x42, 0x6e, 0x6d, 0x2e, 0x65, 0x20, 0x70, 0x61, 0x73, 0x64, 0x69, 0x74, 0x65, 0x73, 0x12a8, 0x1230, 0x12d3,
+0x1275, 0x645, 0x985, 0x9aa, 0x9f0, 0x9be, 0x9b9, 0x9cd, 0x9a8, 0x41f, 0x41c, 0xf55, 0xfb1, 0xf72, 0xf0b, 0xf46, 0xf0b, 0x47, 0x2e, 0x4d,
+0x2e, 0x441, 0x43b, 0x2e, 0x43e, 0x431, 0x2e, 0x100a, 0x1014, 0x1031, 0x70, 0x2e, 0xa0, 0x6d, 0x2e, 0x4e0b, 0x5348, 0x6f, 0x64, 0x70,
+0x2e, 0x70, 0x2e, 0x6d, 0x2e, 0x70, 0x6d, 0x70, 0x74, 0x6d, 0x69, 0x70, 0x2e, 0x73, 0x6f, 0x69, 0x72, 0x66, 0x3bc, 0x2e,
+0x3bc, 0x2e, 0x59, 0x61, 0x6d, 0x6d, 0x61, 0x5d0, 0x5d7, 0x5d4, 0x5f4, 0x5e6, 0x64, 0x75, 0x2e, 0x65, 0x2e, 0x68, 0x2e, 0x69,
+0x2e, 0x6e, 0x2e, 0x5348, 0x5f8c, 0x57, 0x65, 0x6e, 0x67, 0x69, 0xc85, 0xcaa, 0xcb0, 0xcbe, 0xcb9, 0xccd, 0xca8, 0x442, 0x4af, 0x448,
+0x442, 0x4e9, 0x43d, 0x20, 0x43a, 0x438, 0x439, 0x438, 0x43d, 0x43a, 0x438, 0xc624, 0xd6c4, 0x50, 0x4e, 0x5a, 0x2e, 0x4d, 0x57, 0x2e,
+0xeab, 0xebc, 0xeb1, 0xe87, 0xe97, 0xec8, 0xebd, 0xe87, 0x70, 0x113, 0x63, 0x70, 0x75, 0x73, 0x64, 0x69, 0x65, 0x6e, 0x101, 0x6d,
+0x70, 0xf3, 0x6b, 0x77, 0x61, 0x70, 0x6f, 0x70, 0x69, 0x65, 0x74, 0x43f, 0x43e, 0x43f, 0x43b, 0x430, 0x434, 0x43d, 0x435, 0x50,
+0x54, 0x47, 0x92e, 0x2e, 0x909, 0x2e, 0x4af, 0x2e, 0x445, 0x2e, 0x905, 0x92a, 0x930, 0x93e, 0x939, 0x94d, 0x928, 0x63a, 0x2e, 0x648,
+0x2e, 0x628, 0x639, 0x62f, 0x627, 0x632, 0x638, 0x647, 0x631, 0x64, 0x61, 0x20, 0x74, 0x61, 0x72, 0x64, 0x65, 0xa2c, 0xa3e, 0x2e,
+0xa26, 0xa41, 0x2e, 0x4c, 0x4b, 0x43f, 0x43e, 0x20, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x70, 0x6f, 0x20, 0x70, 0x6f, 0x64, 0x6e,
+0x65, 0x4d5, 0x43c, 0x431, 0x438, 0x441, 0x431, 0x43e, 0x43d, 0x44b, 0x20, 0x444, 0x4d5, 0x441, 0x442, 0x4d5, 0x645, 0x646, 0x62c, 0x647,
+0x646, 0x62f, 0x60c, 0x20, 0x634, 0x627, 0x645, 0xdb4, 0x2e, 0xdc0, 0x2e, 0x70, 0x6f, 0x70, 0x2e, 0x47, 0x44, 0x65, 0x6d, 0xbaa,
+0xbbf, 0xbb1, 0xbcd, 0xbaa, 0xb95, 0xbb2, 0xbcd, 0xe2b, 0xe25, 0xe31, 0xe07, 0xe40, 0xe17, 0xe35, 0xe48, 0xe22, 0xe07, 0xf55, 0xfb1, 0xf72,
+0xf0b, 0xf51, 0xfb2, 0xf7c, 0xf0b, 0x12f5, 0x1215, 0x122d, 0x20, 0x1230, 0x12d3, 0x1275, 0x65, 0x66, 0x69, 0x61, 0x66, 0x69, 0xd6, 0x53,
+0x67, 0xfc, 0x6e, 0x6f, 0x72, 0x74, 0x61, 0x64, 0x61, 0x6e, 0x20, 0x73, 0x6f, 0x148, 0x686, 0x6c8, 0x634, 0x62a, 0x649, 0x646,
+0x20, 0x643, 0x6d0, 0x64a, 0x649, 0x646, 0x43f, 0x43f, 0x54, 0x4b, 0x422, 0x41a, 0x43, 0x48, 0x79, 0x68, 0x4e, 0x67, 0x6f, 0x5e0,
+0x5d0, 0x5b8, 0x5db, 0x5de, 0x5d9, 0x5d8, 0x5d0, 0x5b8, 0x5d2, 0x1ecc, 0x300, 0x73, 0xe1, 0x6e, 0x186, 0x300, 0x73, 0xe1, 0x6e, 0x65,
+0x74, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x64, 0x64, 0x61, 0x67, 0x70, 0x6f, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x43f, 0x43e, 0x441,
+0x43b, 0x438, 0x458, 0x435, 0x20, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x45, 0x57, 0x4e, 0x2019, 0x61, 0x62, 0x61, 0x6c, 0x69, 0x128,
+0x79, 0x61, 0x77, 0x129, 0x6f, 0x6f, 0x70, 0x2e, 0x263, 0x65, 0x74, 0x72, 0x254, 0x61, 0x6d, 0x20, 0x4e, 0x61, 0x6d, 0x69,
+0x74, 0x74, 0x61, 0x67, 0xa06f, 0xa2d2, 0x65, 0x61, 0x68, 0x6b, 0x65, 0x74, 0x62, 0x65, 0x61, 0x69, 0x76, 0x65, 0x74, 0x65,
+0x62, 0x4d, 0x6f, 0x67, 0x6c, 0x75, 0x6d, 0x61, 0x20, 0x6c, 0x77, 0x61, 0x20, 0x70, 0x6b, 0x69, 0x6b, 0x69, 0x69, 0x257,
+0x65, 0x48, 0x77, 0x61, 0x129, 0x2d, 0x69, 0x6e, 0x129, 0x54, 0x65, 0x69, 0x70, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x6f, 0x74,
+0x6f, 0x2d5c, 0x2d30, 0x2d37, 0x2d33, 0x2d33, 0x2d6f, 0x2d30, 0x2d5c, 0x74, 0x61, 0x64, 0x67, 0x67, 0x2b7, 0x61, 0x74, 0x6e, 0x20, 0x74,
+0x6d, 0x65, 0x64, 0x64, 0x69, 0x74, 0x70, 0x61, 0x6d, 0x75, 0x6e, 0x79, 0x69, 0x6b, 0x79, 0x69, 0x75, 0x6b, 0x6f, 0x6e,
+0x79, 0x69, 0x55, 0x54, 0x13d2, 0x13af, 0x13f1, 0x13a2, 0x13d7, 0x13e2, 0x43, 0x68, 0x69, 0x6c, 0x6f, 0x4d, 0x55, 0x55, 0x61, 0x6b,
+0x61, 0x73, 0x75, 0x62, 0x61, 0x168, 0x47, 0x6b, 0x6f, 0x6f, 0x73, 0x6b, 0x6f, 0x6c, 0x69, 0x6e, 0x79, 0x1c3, 0x75, 0x69,
+0x61, 0x73, 0x55, 0x68, 0x72, 0x20, 0x6e, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x61, 0x63, 0x68, 0x73, 0x190, 0x6e,
+0x64, 0xe1, 0x6d, 0xe2, 0x45, 0x69, 0x67, 0x75, 0x6c, 0x6f, 0x69, 0x63, 0x68, 0x61, 0x6d, 0x74, 0x68, 0x69, 0x45, 0x62,
+0x6f, 0x6e, 0x67, 0x69, 0x41, 0x6c, 0x75, 0x75, 0x6c, 0x61, 0x4f, 0x54, 0x1e0c, 0x65, 0x66, 0x66, 0x69, 0x72, 0x20, 0x61,
+0x7a, 0x61, 0x6e, 0x79, 0x69, 0x61, 0x67, 0x68, 0x75, 0x6f, 0x92c, 0x947, 0x932, 0x93e, 0x938, 0x947, 0x44, 0x69, 0x6c, 0x6f,
+0x6c, 0x6f, 0x6e, 0x6f, 0x6d, 0xeb, 0x74, 0x74, 0x65, 0x73, 0x61, 0x2e, 0x6b, 0x49, 0x20, 0x253, 0x75, 0x67, 0x61, 0x6a,
+0x254, 0x70, 0x5a, 0x61, 0x61, 0x72, 0x69, 0x6b, 0x61, 0x79, 0x20, 0x62, 0x65, 0x62, 0x79, 0xe1, 0x6d, 0x75, 0x6e, 0x67,
+0x259, 0x67, 0xf3, 0x67, 0x259, 0x6c, 0x65, 0x63, 0x25b, 0x25b, 0x301, 0x6e, 0x6b, 0x6f, 0x6d, 0x63, 0x68, 0x6f, 0x63, 0x68,
+0x69, 0x6c, 0x2019, 0x6c, 0x6c, 0x69, 0x6c, 0x6c, 0x69, 0x6b, 0x75, 0x67, 0xfa, 0x54, 0x14a, 0x42d, 0x41a, 0x50, 0x61, 0x73,
+0x68, 0x61, 0x6d, 0x69, 0x68, 0x65, 0x6b, 0x69, 0x73, 0x25b, 0x301, 0x6e, 0x64, 0x25b, 0x64, 0x65, 0x20, 0x6c, 0x61, 0x20,
+0x74, 0x61, 0x72, 0x64, 0x65, 0x14b, 0x6b, 0x61, 0x20, 0x6d, 0x62, 0x254, 0x301, 0x74, 0x20, 0x6e, 0x6a, 0x69, 0x6e, 0x63,
+0x77, 0xf2, 0x6e, 0x7a, 0xe9, 0x6d, 0x62f, 0x2e, 0x646, 0x77, 0xf3, 0x74, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x61, 0x70,
+0x6f, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x75, 0x65, 0x70, 0x2e
+};
+
+static const ushort currency_symbol_data[] = {
+0x42, 0x72, 0x4b, 0x73, 0x68, 0x52, 0x24, 0x4c, 0x65, 0x6b, 0xeb, 0x64, 0x65, 0x6e, 0x20ac, 0x1265, 0x122d, 0x62c, 0x2e, 0x645,
+0x2e, 0x200f, 0x62f, 0x2e, 0x62c, 0x2e, 0x200f, 0x62f, 0x2e, 0x628, 0x2e, 0x200f, 0x46, 0x43, 0x46, 0x41, 0x43, 0x46, 0x46, 0x64,
+0x6a, 0x4e, 0x66, 0x6b, 0x62f, 0x2e, 0x639, 0x2e, 0x200f, 0x20aa, 0x62f, 0x2e, 0x623, 0x2e, 0x200f, 0x62f, 0x2e, 0x643, 0x2e, 0x200f,
+0x644, 0x2e, 0x644, 0x2e, 0x200f, 0x62f, 0x2e, 0x644, 0x2e, 0x200f, 0x623, 0x2e, 0x645, 0x2e, 0x62f, 0x2e, 0x645, 0x2e, 0x200f, 0x631,
+0x2e, 0x639, 0x2e, 0x200f, 0x631, 0x2e, 0x642, 0x2e, 0x200f, 0x631, 0x2e, 0x633, 0x2e, 0x200f, 0x53, 0x62c, 0x2e, 0x633, 0x2e, 0x644,
+0x2e, 0x633, 0x2e, 0x200f, 0x62f, 0x2e, 0x62a, 0x2e, 0x200f, 0x62f, 0x2e, 0x625, 0x2e, 0x200f, 0x631, 0x2e, 0x64a, 0x2e, 0x200f, 0xa3,
+0x58f, 0x20b9, 0x20bc, 0x20bd, 0x9f3, 0x4e, 0x75, 0x2e, 0x43b, 0x432, 0x2e, 0x4b, 0x17db, 0xa5, 0x48, 0x4b, 0x24, 0x4d, 0x4f, 0x50,
+0x24, 0x48, 0x52, 0x4b, 0x4b, 0x4d, 0x4b, 0x10d, 0x6b, 0x72, 0x2e, 0x41, 0x66, 0x6c, 0x2e, 0x4e, 0x41, 0x66, 0x2e, 0x55,
+0x53, 0x24, 0x50, 0x46, 0x42, 0x75, 0x44, 0x47, 0x48, 0x20b5, 0x41, 0x72, 0x4d, 0x4b, 0x52, 0x4d, 0x52, 0x73, 0x20a6, 0x20b1,
+0x52, 0x46, 0x57, 0x53, 0x24, 0x53, 0x52, 0x4c, 0x65, 0x45, 0x6b, 0x72, 0x54, 0x53, 0x68, 0x54, 0x24, 0x55, 0x53, 0x68,
+0x41, 0x45, 0x44, 0x56, 0x54, 0x44, 0x41, 0x43, 0x46, 0x41, 0x46, 0x43, 0x46, 0x43, 0x46, 0x50, 0x46, 0x47, 0x47, 0x55,
+0x4d, 0x4d, 0x41, 0x44, 0x43, 0x48, 0x46, 0x4c, 0x53, 0x44, 0x54, 0x20be, 0x20b2, 0x46, 0x74, 0x49, 0x53, 0x4b, 0x52, 0x70,
+0x43, 0x41, 0x24, 0xffe5, 0x20b8, 0x441, 0x43e, 0x43c, 0x20a9, 0x4b, 0x50, 0x57, 0x20ba, 0x20ad, 0x4b, 0x7a, 0x434, 0x435, 0x43d, 0x2e,
+0x20ae, 0x43, 0x4e, 0xa5, 0x928, 0x947, 0x930, 0x942, 0x60b, 0x631, 0x6cc, 0x627, 0x644, 0x7a, 0x142, 0x52, 0x24, 0x200b, 0x4d, 0x54,
+0x6e, 0x44, 0x62, 0x631, 0x53, 0x2f, 0x42, 0x73, 0x52, 0x4f, 0x4e, 0x4c, 0x20b4, 0x52, 0x53, 0x44, 0x41a, 0x41c, 0xdbb, 0xdd4,
+0x2e, 0x20a1, 0x52, 0x44, 0x24, 0x51, 0x43, 0x24, 0x42, 0x2f, 0x2e, 0x47, 0x73, 0x2e, 0x42, 0x73, 0x2e, 0x53, 0x441, 0x43e,
+0x43c, 0x2e, 0x52, 0x73, 0x2e, 0xe3f, 0x54, 0x4d, 0x54, 0x73, 0x6f, 0x2bb, 0x6d, 0x441, 0x45e, 0x43c, 0x20ab, 0x4e, 0x54, 0x24,
+0x41, 0x24, 0x49, 0x52, 0x52
+};
+
+static const ushort currency_display_name_data[] = {
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x74, 0x6f, 0x6f, 0x70, 0x68, 0x69, 0x79, 0x61, 0x61, 0x20, 0x42, 0x69,
+0x72, 0x72, 0x69, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66, 0x72, 0x69,
+0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66,
+0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x69,
+0x64, 0x2d, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x4e, 0x61,
+0x6d, 0x69, 0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69,
+0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69,
+0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x4c, 0x65, 0x6b, 0x75, 0x20, 0x73, 0x68,
+0x71, 0x69, 0x70, 0x74, 0x61, 0x72, 0x3b, 0x3b, 0x6c, 0x65, 0x6b, 0x20, 0x73, 0x68, 0x71, 0x69, 0x70, 0x74, 0x61, 0x72,
+0x3b, 0x3b, 0x3b, 0x3b, 0x6c, 0x65, 0x6b, 0xeb, 0x20, 0x73, 0x68, 0x71, 0x69, 0x70, 0x74, 0x61, 0x72, 0x3b, 0x44, 0x65,
+0x6e, 0x61, 0x72, 0x69, 0x20, 0x6d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x61, 0x73, 0x3b, 0x3b, 0x64, 0x65, 0x6e, 0x61,
+0x72, 0x20, 0x6d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x61, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x65, 0x6e, 0x61, 0x72,
+0xeb, 0x20, 0x6d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x61, 0x73, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x6a, 0x61, 0x3b, 0x3b,
+0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x12e8, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x20,
+0x1265, 0x122d, 0x3b, 0x3b, 0x12e8, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x20, 0x1265, 0x122d, 0x3b, 0x3b, 0x3b, 0x3b, 0x12e8, 0x12a2, 0x1275,
+0x12ee, 0x1335, 0x12eb, 0x20, 0x1265, 0x122d, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62c, 0x646, 0x64a,
+0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62c, 0x646, 0x64a,
+0x647, 0x627, 0x646, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x627, 0x62a, 0x20, 0x645, 0x635,
+0x631, 0x64a, 0x629, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x64b, 0x627, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x64b, 0x627, 0x3b, 0x62c, 0x646,
+0x64a, 0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a,
+0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
+0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x646, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631,
+0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x629, 0x3b,
+0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x64b, 0x627, 0x3b, 0x62f, 0x64a, 0x646,
+0x627, 0x631, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a,
+0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627,
+0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646,
+0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631,
+0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a,
+0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646,
+0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633,
+0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641,
+0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a,
+0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646,
+0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632,
+0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642,
+0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631,
+0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632,
+0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642,
+0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631,
+0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a,
+0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c,
+0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631,
+0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a,
+0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627,
+0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a,
+0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20,
+0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b,
+0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639,
+0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646,
+0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a,
+0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639,
+0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x634, 0x64a, 0x643,
+0x644, 0x20, 0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644,
+0x20, 0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20,
+0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625,
+0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625, 0x633,
+0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625, 0x633, 0x631,
+0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625, 0x633, 0x631, 0x627,
+0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646,
+0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
+0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a,
+0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646,
+0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
+0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a,
+0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a,
+0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
+0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62c, 0x646,
+0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646,
+0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644,
+0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646,
+0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646,
+0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x644,
+0x64a, 0x628, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631,
+0x627, 0x646, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x644, 0x64a,
+0x628, 0x64a, 0x629, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x64b, 0x627, 0x3b, 0x62f,
+0x64a, 0x646, 0x627, 0x631, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a,
+0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a,
+0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648,
+0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20,
+0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a,
+0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a,
+0x629, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x645, 0x63a,
+0x631, 0x628, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x627,
+0x646, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x631, 0x627, 0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628,
+0x64a, 0x629, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x64b, 0x627, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x64b, 0x627, 0x3b, 0x62f, 0x631,
+0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b,
+0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646,
+0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645,
+0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20,
+0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
+0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
+0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
+0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
+0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a,
+0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b,
+0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f,
+0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645,
+0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635,
+0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646,
+0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634,
+0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646,
+0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633,
+0x648, 0x62f, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646,
+0x64a, 0x647, 0x627, 0x62a, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x64b, 0x627, 0x20,
+0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x64b, 0x627, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a,
+0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631,
+0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633,
+0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629,
+0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x62f, 0x64a,
+0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633,
+0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627,
+0x646, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x62a, 0x648,
+0x646, 0x633, 0x64a, 0x629, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x64b, 0x627,
+0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645,
+0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f,
+0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627,
+0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631,
+0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631,
+0x627, 0x62a, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a,
+0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a,
+0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a,
+0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c,
+0x646, 0x648, 0x628, 0x20, 0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c, 0x646, 0x648,
+0x628, 0x20, 0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
+0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x627, 0x646, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
+0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x627, 0x62a, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
+0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x64b, 0x627, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
+0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20, 0x627, 0x644,
+0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x570, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b,
+0x3b, 0x570, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b, 0x3b, 0x3b, 0x3b, 0x570, 0x561,
+0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b, 0x9ad, 0x9be, 0x9f0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20,
+0x9f0, 0x9c1, 0x9aa, 0x9c0, 0x3b, 0x3b, 0x9ad, 0x9be, 0x9f0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9f0, 0x9c1, 0x9aa, 0x9c0, 0x3b, 0x3b,
+0x3b, 0x3b, 0x9ad, 0x9be, 0x9f0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9f0, 0x9c1, 0x9aa, 0x9c0, 0x3b, 0x41, 0x7a, 0x259, 0x72, 0x62,
+0x61, 0x79, 0x63, 0x61, 0x6e, 0x20, 0x4d, 0x61, 0x6e, 0x61, 0x74, 0x131, 0x3b, 0x3b, 0x41, 0x7a, 0x259, 0x72, 0x62, 0x61,
+0x79, 0x63, 0x61, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x74, 0x131, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x7a, 0x259, 0x72, 0x62,
+0x61, 0x79, 0x63, 0x61, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x74, 0x131, 0x3b, 0x43c, 0x430, 0x43d, 0x430, 0x442, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x61, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x65, 0x75, 0x72, 0x6f, 0x3b, 0x9ac, 0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9c0, 0x20, 0x99f, 0x9be, 0x995, 0x9be, 0x3b,
+0x3b, 0x9ac, 0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9c0, 0x20, 0x99f, 0x9be, 0x995, 0x9be, 0x3b, 0x3b, 0x3b, 0x3b, 0x9ac,
+0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9c0, 0x20, 0x99f, 0x9be, 0x995, 0x9be, 0x3b, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0x9c0, 0x9af,
+0x9bc, 0x20, 0x9b0, 0x9c1, 0x9aa, 0x9bf, 0x3b, 0x3b, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9b0, 0x9c1, 0x9aa, 0x9bf,
+0x3b, 0x3b, 0x3b, 0x3b, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9b0, 0x9c1, 0x9aa, 0x9bf, 0x3b, 0xf51, 0xf44, 0xf74,
+0xf63, 0xf0b, 0xf40, 0xfb2, 0xf58, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75,
+0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x61, 0x20, 0x65, 0x75, 0x72, 0x6f, 0x69,
+0x6f, 0xf9, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x411, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x20, 0x43b, 0x435,
+0x432, 0x3b, 0x3b, 0x431, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x20, 0x43b, 0x435, 0x432, 0x3b, 0x3b, 0x3b, 0x3b,
+0x431, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x20, 0x43b, 0x435, 0x432, 0x430, 0x3b, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019,
+0x102c, 0x20, 0x1000, 0x103b, 0x1015, 0x103a, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019, 0x102c, 0x20, 0x1000,
+0x103b, 0x1015, 0x103a, 0x3b, 0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x20, 0x440, 0x443, 0x431, 0x435, 0x43b, 0x44c,
+0x3b, 0x3b, 0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x20, 0x440, 0x443, 0x431, 0x435, 0x43b, 0x44c, 0x3b, 0x3b,
+0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x44f, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x456, 0x3b, 0x431, 0x435, 0x43b,
+0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x451, 0x45e, 0x3b, 0x431, 0x435, 0x43b, 0x430, 0x440,
+0x443, 0x441, 0x43a, 0x430, 0x433, 0x430, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x179a, 0x17c0, 0x179b, 0x200b, 0x1780, 0x1798, 0x17d2,
+0x1796, 0x17bb, 0x1787, 0x17b6, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x179a, 0x17c0, 0x179b, 0x200b, 0x1780, 0x1798, 0x17d2, 0x1796, 0x17bb, 0x1787,
+0x17b6, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f,
+0x73, 0x3b, 0x4eba, 0x6c11, 0x5e01, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4eba, 0x6c11, 0x5e01, 0x3b, 0x6e2f, 0x5143, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x6e2f, 0x5143, 0x3b, 0x6fb3, 0x95e8, 0x5e01, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x6fb3, 0x95e8, 0x5143, 0x3b, 0x65b0,
+0x52a0, 0x5761, 0x5143, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65b0, 0x52a0, 0x5761, 0x5143, 0x3b, 0x6fb3, 0x9580, 0x5143, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x6fb3, 0x9580, 0x5143, 0x3b, 0x65b0, 0x53f0, 0x5e63, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65b0, 0x53f0, 0x5e63, 0x3b,
+0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x61, 0x20, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x68, 0x72, 0x76, 0x61, 0x74,
+0x73, 0x6b, 0x61, 0x20, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x65, 0x20, 0x6b,
+0x75, 0x6e, 0x65, 0x3b, 0x3b, 0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x69, 0x68, 0x20, 0x6b, 0x75, 0x6e, 0x61, 0x3b,
+0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b,
+0x3b, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61,
+0x3b, 0x3b, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b,
+0x65, 0x3b, 0x3b, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x69, 0x68, 0x20, 0x6d, 0x61,
+0x72, 0x61, 0x6b, 0x61, 0x3b, 0x10d, 0x65, 0x73, 0x6b, 0xe1, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x10d,
+0x65, 0x73, 0x6b, 0xe1, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x10d, 0x65, 0x73, 0x6b, 0xe9, 0x20, 0x6b,
+0x6f, 0x72, 0x75, 0x6e, 0x79, 0x3b, 0x10d, 0x65, 0x73, 0x6b, 0xe9, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x79, 0x3b, 0x10d,
+0x65, 0x73, 0x6b, 0xfd, 0x63, 0x68, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x20, 0x6b,
+0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b,
+0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x65, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b,
+0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x41, 0x72, 0x75, 0x62, 0x61, 0x61,
+0x6e, 0x73, 0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x3b, 0x41, 0x72, 0x75, 0x62, 0x61, 0x61, 0x6e, 0x73,
+0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x72, 0x75, 0x62, 0x61, 0x61, 0x6e, 0x73,
+0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x2d,
+0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b,
+0x3b, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x2d, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x69, 0x61,
+0x61, 0x6e, 0x73, 0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x65, 0x64, 0x65, 0x72,
+0x6c, 0x61, 0x6e, 0x64, 0x73, 0x2d, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x67,
+0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x53, 0x75, 0x72, 0x69, 0x6e, 0x61, 0x61, 0x6d, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c,
+0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x53, 0x75, 0x72, 0x69, 0x6e, 0x61, 0x61, 0x6d, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x72, 0x69, 0x6e, 0x61, 0x61, 0x6d, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c,
+0x6c, 0x61, 0x72, 0x3b, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x3b, 0x3b, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f,
+0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x55, 0x53, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x64,
+0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b,
+0x45, 0x61, 0x73, 0x74, 0x20, 0x43, 0x61, 0x72, 0x69, 0x62, 0x62, 0x65, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
+0x72, 0x3b, 0x3b, 0x45, 0x61, 0x73, 0x74, 0x20, 0x43, 0x61, 0x72, 0x69, 0x62, 0x62, 0x65, 0x61, 0x6e, 0x20, 0x64, 0x6f,
+0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x61, 0x73, 0x74, 0x20, 0x43, 0x61, 0x72, 0x69, 0x62, 0x62, 0x65,
+0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
+0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x6e,
+0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
+0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f,
+0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x73, 0x3b, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x61, 0x6e, 0x20, 0x44,
+0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61,
+0x72, 0x73, 0x3b, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b,
+0x3b, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b,
+0x3b, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x42,
+0x65, 0x6c, 0x69, 0x7a, 0x65, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65,
+0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x20, 0x64, 0x6f,
+0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
+0x72, 0x3b, 0x3b, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b,
+0x3b, 0x3b, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x42,
+0x6f, 0x74, 0x73, 0x77, 0x61, 0x6e, 0x61, 0x6e, 0x20, 0x50, 0x75, 0x6c, 0x61, 0x3b, 0x3b, 0x42, 0x6f, 0x74, 0x73, 0x77,
+0x61, 0x6e, 0x61, 0x6e, 0x20, 0x70, 0x75, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x6f, 0x74, 0x73, 0x77, 0x61, 0x6e,
+0x61, 0x6e, 0x20, 0x70, 0x75, 0x6c, 0x61, 0x73, 0x3b, 0x42, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x46,
+0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x42, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x66, 0x72, 0x61, 0x6e,
+0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63,
+0x73, 0x3b, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x43, 0x46,
+0x41, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72,
+0x69, 0x63, 0x61, 0x6e, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x65,
+0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x73, 0x3b, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72,
+0x3b, 0x3b, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b,
+0x3b, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x43, 0x61,
+0x79, 0x6d, 0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b,
+0x3b, 0x43, 0x61, 0x79, 0x6d, 0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x61, 0x79, 0x6d, 0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73,
+0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61, 0x6e, 0x64,
+0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61, 0x6e, 0x64,
+0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61,
+0x6e, 0x64, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x44, 0x61, 0x6e, 0x69, 0x73, 0x68, 0x20, 0x4b, 0x72,
+0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x44, 0x61, 0x6e, 0x69, 0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b,
+0x3b, 0x44, 0x61, 0x6e, 0x69, 0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x45, 0x72, 0x69, 0x74, 0x72,
+0x65, 0x61, 0x6e, 0x20, 0x4e, 0x61, 0x6b, 0x66, 0x61, 0x3b, 0x3b, 0x45, 0x72, 0x69, 0x74, 0x72, 0x65, 0x61, 0x6e, 0x20,
+0x6e, 0x61, 0x6b, 0x66, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x72, 0x69, 0x74, 0x72, 0x65, 0x61, 0x6e, 0x20, 0x6e, 0x61,
+0x6b, 0x66, 0x61, 0x73, 0x3b, 0x46, 0x61, 0x6c, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64,
+0x73, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x46, 0x61, 0x6c, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x49, 0x73,
+0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x61, 0x6c, 0x6b, 0x6c,
+0x61, 0x6e, 0x64, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x46,
+0x69, 0x6a, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x46, 0x69, 0x6a, 0x69, 0x61, 0x6e,
+0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x69, 0x6a, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f,
+0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x55, 0x4b, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x55, 0x4b, 0x20, 0x70,
+0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x4b, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x47, 0x61,
+0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x3b, 0x3b, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x61,
+0x6e, 0x20, 0x64, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20,
+0x64, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x73, 0x3b, 0x47, 0x68, 0x61, 0x6e, 0x61, 0x69, 0x61, 0x6e, 0x20, 0x43, 0x65, 0x64,
+0x69, 0x3b, 0x3b, 0x47, 0x68, 0x61, 0x6e, 0x61, 0x69, 0x61, 0x6e, 0x20, 0x63, 0x65, 0x64, 0x69, 0x3b, 0x3b, 0x3b, 0x3b,
+0x47, 0x68, 0x61, 0x6e, 0x61, 0x69, 0x61, 0x6e, 0x20, 0x63, 0x65, 0x64, 0x69, 0x73, 0x3b, 0x47, 0x69, 0x62, 0x72, 0x61,
+0x6c, 0x74, 0x61, 0x72, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61,
+0x72, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61, 0x72,
+0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x65, 0x73, 0x65, 0x20, 0x44, 0x6f,
+0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x73, 0x3b, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72,
+0x3b, 0x3b, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b,
+0x3b, 0x3b, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b,
+0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x52, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e,
+0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x75, 0x70,
+0x65, 0x65, 0x73, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x53, 0x68, 0x65, 0x6b,
+0x65, 0x6c, 0x3b, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x68, 0x65, 0x6b,
+0x65, 0x6c, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x68,
+0x65, 0x6b, 0x65, 0x6c, 0x73, 0x3b, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
+0x72, 0x3b, 0x3b, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b,
+0x3b, 0x3b, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4b,
+0x65, 0x6e, 0x79, 0x61, 0x6e, 0x20, 0x53, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x4b, 0x65, 0x6e, 0x79,
+0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x3b, 0x3b, 0x4b, 0x65, 0x6e, 0x79, 0x61,
+0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66,
+0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66,
+0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20,
+0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61,
+0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x64,
+0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f,
+0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4d, 0x61, 0x63, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x50, 0x61, 0x74, 0x61, 0x63,
+0x61, 0x3b, 0x3b, 0x4d, 0x61, 0x63, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x61, 0x74, 0x61, 0x63, 0x61, 0x3b, 0x3b,
+0x3b, 0x3b, 0x4d, 0x61, 0x63, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x61, 0x74, 0x61, 0x63, 0x61, 0x73, 0x3b, 0x4d,
+0x61, 0x6c, 0x61, 0x67, 0x61, 0x73, 0x79, 0x20, 0x41, 0x72, 0x69, 0x61, 0x72, 0x79, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61,
+0x67, 0x61, 0x73, 0x79, 0x20, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x67,
+0x61, 0x73, 0x79, 0x20, 0x61, 0x72, 0x69, 0x61, 0x72, 0x69, 0x65, 0x73, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x61,
+0x6e, 0x20, 0x4b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x61, 0x6e, 0x20, 0x6b,
+0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x61, 0x6e, 0x20, 0x6b, 0x77,
+0x61, 0x63, 0x68, 0x61, 0x73, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x52, 0x69, 0x6e, 0x67,
+0x67, 0x69, 0x74, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x69, 0x6e, 0x67, 0x67,
+0x69, 0x74, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x69, 0x6e, 0x67,
+0x67, 0x69, 0x74, 0x73, 0x3b, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x52, 0x75, 0x70, 0x65, 0x65,
+0x3b, 0x3b, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b,
+0x3b, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x73, 0x3b, 0x4e, 0x61,
+0x6d, 0x69, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69, 0x62,
+0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69,
+0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20,
+0x4e, 0x61, 0x69, 0x72, 0x61, 0x3b, 0x3b, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x6e, 0x61, 0x69, 0x72,
+0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x6e, 0x61, 0x69, 0x72, 0x61, 0x73,
+0x3b, 0x50, 0x61, 0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x69, 0x20, 0x52, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x50, 0x61,
+0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x69, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x6b,
+0x69, 0x73, 0x74, 0x61, 0x6e, 0x69, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x73, 0x3b, 0x50, 0x61, 0x70, 0x75, 0x61, 0x20,
+0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x6e, 0x20, 0x4b, 0x69, 0x6e, 0x61, 0x3b, 0x3b, 0x50, 0x61,
+0x70, 0x75, 0x61, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x6e, 0x20, 0x6b, 0x69, 0x6e, 0x61,
+0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x70, 0x75, 0x61, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61,
+0x6e, 0x20, 0x6b, 0x69, 0x6e, 0x61, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x50, 0x69,
+0x73, 0x6f, 0x3b, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x69, 0x73, 0x6f, 0x3b,
+0x3b, 0x3b, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x69, 0x73, 0x6f, 0x73, 0x3b,
+0x52, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x52, 0x77, 0x61, 0x6e, 0x64,
+0x61, 0x6e, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20,
+0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x3b, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x6e, 0x20, 0x54, 0x61, 0x6c, 0x61, 0x3b, 0x3b,
+0x53, 0x61, 0x6d, 0x6f, 0x61, 0x6e, 0x20, 0x74, 0x61, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x61, 0x6d, 0x6f, 0x61,
+0x6e, 0x20, 0x74, 0x61, 0x6c, 0x61, 0x3b, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x69, 0x73, 0x20, 0x52,
+0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x69, 0x73, 0x20, 0x72, 0x75,
+0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x69, 0x73, 0x20, 0x72,
+0x75, 0x70, 0x65, 0x65, 0x73, 0x3b, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65, 0x61, 0x6e,
+0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65,
+0x61, 0x6e, 0x20, 0x6c, 0x65, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c,
+0x65, 0x6f, 0x6e, 0x65, 0x61, 0x6e, 0x20, 0x6c, 0x65, 0x6f, 0x6e, 0x65, 0x73, 0x3b, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70,
+0x6f, 0x72, 0x65, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72,
+0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72,
+0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x49, 0x73,
+0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f,
+0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b,
+0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x73, 0x3b, 0x53, 0x74, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b,
+0x3b, 0x53, 0x74, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b,
+0x53, 0x74, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x53, 0x75, 0x64,
+0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73,
+0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20,
+0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x20, 0x4c, 0x69, 0x6c, 0x61, 0x6e, 0x67, 0x65,
+0x6e, 0x69, 0x3b, 0x3b, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x20, 0x6c, 0x69, 0x6c, 0x61, 0x6e, 0x67, 0x65, 0x6e, 0x69, 0x3b,
+0x3b, 0x3b, 0x3b, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x20, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x6e, 0x67, 0x65, 0x6e, 0x69, 0x3b,
+0x53, 0x77, 0x65, 0x64, 0x69, 0x73, 0x68, 0x20, 0x4b, 0x72, 0x6f, 0x6e, 0x61, 0x3b, 0x3b, 0x53, 0x77, 0x65, 0x64, 0x69,
+0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x77, 0x65, 0x64, 0x69, 0x73, 0x68, 0x20,
+0x6b, 0x72, 0x6f, 0x6e, 0x6f, 0x72, 0x3b, 0x53, 0x77, 0x69, 0x73, 0x73, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b,
+0x53, 0x77, 0x69, 0x73, 0x73, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x77, 0x69, 0x73, 0x73,
+0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x3b, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x68,
+0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x6e, 0x20, 0x73, 0x68,
+0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x6e, 0x20,
+0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x3b, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x20, 0x50, 0x61, 0x2bb,
+0x61, 0x6e, 0x67, 0x61, 0x3b, 0x3b, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x20, 0x70, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61,
+0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x20, 0x70, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61, 0x3b, 0x54,
+0x72, 0x69, 0x6e, 0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x20, 0x44, 0x6f, 0x6c,
+0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x54, 0x72, 0x69, 0x6e, 0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61,
+0x67, 0x6f, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0x72, 0x69, 0x6e, 0x69, 0x64, 0x61,
+0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x55,
+0x67, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20, 0x53, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x55, 0x67, 0x61,
+0x6e, 0x64, 0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x67, 0x61,
+0x6e, 0x64, 0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x3b, 0x55, 0x6e, 0x69, 0x74, 0x65,
+0x64, 0x20, 0x41, 0x72, 0x61, 0x62, 0x20, 0x45, 0x6d, 0x69, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x44, 0x69, 0x72, 0x68,
+0x61, 0x6d, 0x3b, 0x3b, 0x55, 0x41, 0x45, 0x20, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x41,
+0x45, 0x20, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x73, 0x3b, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x50, 0x6f,
+0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b,
+0x3b, 0x3b, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x56, 0x61, 0x6e,
+0x75, 0x61, 0x74, 0x75, 0x20, 0x56, 0x61, 0x74, 0x75, 0x3b, 0x3b, 0x56, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x20, 0x76,
+0x61, 0x74, 0x75, 0x3b, 0x3b, 0x3b, 0x3b, 0x56, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x20, 0x76, 0x61, 0x74, 0x75, 0x73,
+0x3b, 0x5a, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x4b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x5a, 0x61, 0x6d,
+0x62, 0x69, 0x61, 0x6e, 0x20, 0x6b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x5a, 0x61, 0x6d, 0x62, 0x69,
+0x61, 0x6e, 0x20, 0x6b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x73, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x53, 0x75, 0x64,
+0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x53,
+0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6f, 0x75,
+0x74, 0x68, 0x20, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x4e,
+0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x65, 0x61, 0x6e,
+0x20, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x3b, 0x3b, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64,
+0x73, 0x20, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x3b,
+0x3b, 0x3b, 0x3b, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x41, 0x6e, 0x74, 0x69, 0x6c,
+0x6c, 0x65, 0x61, 0x6e, 0x20, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b,
+0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x74, 0x3b, 0x64, 0x6f, 0x6e, 0x73, 0x6b, 0x20,
+0x6b, 0x72, 0xf3, 0x6e, 0x61, 0x3b, 0x3b, 0x64, 0x6f, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x61, 0x3b, 0x3b,
+0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x61, 0x72, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x75, 0x72, 0x3b, 0x65, 0x75, 0x72,
+0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x61, 0x3b, 0x64, 0x69, 0x6e,
+0x61, 0x72, 0x20, 0x61, 0x6c, 0x67, 0xe9, 0x72, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x61,
+0x6c, 0x67, 0xe9, 0x72, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x73, 0x20, 0x61, 0x6c,
+0x67, 0xe9, 0x72, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42,
+0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43,
+0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28,
+0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x61,
+0x69, 0x73, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x61, 0x69, 0x73, 0x3b,
+0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x61, 0x69, 0x73, 0x3b,
+0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x64, 0x6f, 0x6c, 0x6c,
+0x61, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x20,
+0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x20,
+0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6d, 0x6f,
+0x72, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6d, 0x6f, 0x72, 0x69, 0x65, 0x6e,
+0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x73,
+0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x69, 0x73, 0x3b, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x69, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61,
+0x6e, 0x63, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x69, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20,
+0x64, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x64, 0x6a,
+0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x64,
+0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x50,
+0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x50, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63,
+0x73, 0x20, 0x43, 0x46, 0x50, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x67, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x6e, 0x3b,
+0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x67, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x73, 0x20, 0x67, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x6e, 0x73, 0x3b, 0x67, 0x6f, 0x75, 0x72, 0x64, 0x65,
+0x20, 0x68, 0x61, 0xef, 0x74, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x67, 0x6f, 0x75, 0x72, 0x64, 0x65, 0x20, 0x68,
+0x61, 0xef, 0x74, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x6f, 0x75, 0x72, 0x64, 0x65, 0x73, 0x20,
+0x68, 0x61, 0xef, 0x74, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x3b, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x20, 0x6d, 0x61,
+0x6c, 0x67, 0x61, 0x63, 0x68, 0x65, 0x3b, 0x3b, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x20, 0x6d, 0x61, 0x6c, 0x67, 0x61,
+0x63, 0x68, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x73, 0x20, 0x6d, 0x61, 0x6c, 0x67, 0x61,
+0x63, 0x68, 0x65, 0x73, 0x3b, 0x6f, 0x75, 0x67, 0x75, 0x69, 0x79, 0x61, 0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x61,
+0x6e, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x6f, 0x75, 0x67, 0x75, 0x69, 0x79, 0x61, 0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x74,
+0x61, 0x6e, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x6f, 0x75, 0x67, 0x75, 0x69, 0x79, 0x61, 0x73, 0x20, 0x6d, 0x61,
+0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x20, 0x6d, 0x61,
+0x75, 0x72, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x20, 0x6d, 0x61,
+0x75, 0x72, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x73,
+0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d,
+0x20, 0x6d, 0x61, 0x72, 0x6f, 0x63, 0x61, 0x69, 0x6e, 0x3b, 0x3b, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x20, 0x6d, 0x61,
+0x72, 0x6f, 0x63, 0x61, 0x69, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x73, 0x20, 0x6d, 0x61,
+0x72, 0x6f, 0x63, 0x61, 0x69, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61,
+0x69, 0x73, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x69, 0x73, 0x3b, 0x3b,
+0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x69, 0x73, 0x3b, 0x72, 0x6f,
+0x75, 0x70, 0x69, 0x65, 0x20, 0x64, 0x65, 0x73, 0x20, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x3b,
+0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x20, 0x64, 0x65, 0x73, 0x20, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c,
+0x65, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x73, 0x20, 0x64, 0x65, 0x73, 0x20, 0x53, 0x65,
+0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73,
+0x65, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x66,
+0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x73, 0x3b, 0x6c, 0x69, 0x76, 0x72, 0x65, 0x20,
+0x73, 0x79, 0x72, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x6c, 0x69, 0x76, 0x72, 0x65, 0x20, 0x73, 0x79, 0x72, 0x69,
+0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x6c, 0x69, 0x76, 0x72, 0x65, 0x73, 0x20, 0x73, 0x79, 0x72, 0x69, 0x65,
+0x6e, 0x6e, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x74, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x3b,
+0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x74, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64,
+0x69, 0x6e, 0x61, 0x72, 0x73, 0x20, 0x74, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x76, 0x61, 0x74, 0x75,
+0x20, 0x76, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x61, 0x6e, 0x3b, 0x3b, 0x76, 0x61, 0x74, 0x75, 0x20, 0x76, 0x61, 0x6e,
+0x75, 0x61, 0x74, 0x75, 0x61, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x76, 0x61, 0x74, 0x75, 0x73, 0x20, 0x76, 0x61, 0x6e, 0x75,
+0x61, 0x74, 0x75, 0x61, 0x6e, 0x73, 0x3b, 0x50, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61,
+0x63, 0x68, 0x3b, 0x3b, 0x70, 0x68, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68,
+0x3b, 0x70, 0x68, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68, 0x3b, 0x70, 0x75,
+0x69, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x68, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68, 0x3b, 0x3b, 0x70, 0x75, 0x6e,
+0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68, 0x3b, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8,
+0x20, 0x10da, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x3b, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8, 0x20, 0x10da, 0x10d0, 0x10e0, 0x10d8, 0x3b,
+0x3b, 0x3b, 0x3b, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8, 0x20, 0x10da, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x45, 0x75, 0x72, 0x6f,
+0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x53, 0x63, 0x68, 0x77, 0x65,
+0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x3b, 0x3b, 0x53, 0x63, 0x68, 0x77, 0x65, 0x69,
+0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x63, 0x68, 0x77, 0x65,
+0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x3b, 0x395, 0x3c5, 0x3c1, 0x3ce, 0x3b, 0x3b, 0x3b5,
+0x3c5, 0x3c1, 0x3ce, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b5, 0x3c5, 0x3c1, 0x3ce, 0x3b, 0x64, 0x61, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x69,
+0x6d, 0x75, 0x74, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x69, 0x6e,
+0x75, 0x74, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x6d, 0x61, 0x72,
+0x6b, 0x69, 0x6d, 0x75, 0x74, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0xaad, 0xabe, 0xab0, 0xaa4, 0xac0, 0xaaf,
+0x20, 0xab0, 0xac2, 0xaaa, 0xabf, 0xaaf, 0xabe, 0x3b, 0x3b, 0xaad, 0xabe, 0xab0, 0xaa4, 0xac0, 0xaaf, 0x20, 0xab0, 0xac2, 0xaaa, 0xabf,
+0xaaf, 0xabe, 0x3b, 0x3b, 0x3b, 0x3b, 0xaad, 0xabe, 0xab0, 0xaa4, 0xac0, 0xaaf, 0x20, 0xab0, 0xac2, 0xaaa, 0xabf, 0xaaf, 0xabe, 0x3b,
+0x4e, 0x61, 0x69, 0x72, 0x61, 0x72, 0x20, 0x4e, 0x61, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x4e, 0x61, 0x69,
+0x72, 0x61, 0x72, 0x20, 0x4e, 0x61, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x69, 0x72,
+0x6f, 0x72, 0x69, 0x6e, 0x20, 0x4e, 0x61, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x3b, 0x4b, 0x75, 0x257, 0x69, 0x6e, 0x20,
+0x53, 0x65, 0x66, 0x61, 0x20, 0x6e, 0x61, 0x20, 0x41, 0x66, 0x69, 0x72, 0x6b, 0x61, 0x20, 0x54, 0x61, 0x20, 0x59, 0x61,
+0x6d, 0x6d, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x5e9, 0x5e7, 0x5dc, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x3b, 0x3b, 0x5e9,
+0x5e7, 0x5dc, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x3b, 0x5e9, 0x5e7, 0x5dc, 0x5d9, 0x5dd, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x5d9, 0x5dd, 0x3b, 0x3b,
+0x5e9, 0x5e7, 0x5dc, 0x5d9, 0x5dd, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x5d9, 0x5dd, 0x3b, 0x5e9, 0x5e7, 0x5dc, 0x5d9, 0x5dd, 0x20, 0x5d7, 0x5d3,
+0x5e9, 0x5d9, 0x5dd, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x92d, 0x93e,
+0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f,
+0x20, 0x930, 0x941, 0x92a, 0x90f, 0x3b, 0x6d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x69, 0x6e, 0x74, 0x3b,
+0x3b, 0x6d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x69, 0x6e, 0x74, 0x3b, 0x3b, 0x3b, 0x3b, 0x6d, 0x61,
+0x67, 0x79, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x69, 0x6e, 0x74, 0x3b, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x20,
+0x6b, 0x72, 0xf3, 0x6e, 0x61, 0x3b, 0x3b, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x61,
+0x3b, 0x3b, 0x3b, 0x3b, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0x72, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x75, 0x72,
+0x3b, 0x52, 0x75, 0x70, 0x69, 0x61, 0x68, 0x20, 0x49, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x52, 0x75, 0x70, 0x69, 0x61, 0x68, 0x20, 0x49, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x3b,
+0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f,
+0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x50, 0x75, 0x6e, 0x74, 0x20, 0x53, 0x74, 0x65, 0x69,
+0x72, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x70, 0x68, 0x75, 0x6e, 0x74, 0x20, 0x73, 0x74, 0x65, 0x69, 0x72, 0x6c, 0x69,
+0x6e, 0x67, 0x3b, 0x70, 0x68, 0x75, 0x6e, 0x74, 0x20, 0x73, 0x74, 0x65, 0x69, 0x72, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x70,
+0x68, 0x75, 0x6e, 0x74, 0x20, 0x73, 0x74, 0x65, 0x69, 0x72, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x62, 0x70, 0x75, 0x6e, 0x74,
+0x20, 0x73, 0x74, 0x65, 0x69, 0x72, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x70, 0x75, 0x6e, 0x74, 0x20, 0x73, 0x74, 0x65, 0x69,
+0x72, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x65, 0x75, 0x72, 0x6f, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x6f,
+0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x6f, 0x3b, 0x3b, 0x3b,
+0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x69, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x69, 0x3b, 0x65e5, 0x672c,
+0x5186, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x5186, 0x3b, 0xcad, 0xcbe, 0xcb0, 0xca4, 0xcc0, 0xcaf, 0x20, 0xcb0, 0xcc2, 0xcaa, 0xcbe,
+0xcaf, 0xcbf, 0x3b, 0x3b, 0xcad, 0xcbe, 0xcb0, 0xca4, 0xcc0, 0xcaf, 0x20, 0xcb0, 0xcc2, 0xcaa, 0xcbe, 0xcaf, 0xcbf, 0x3b, 0x3b, 0x3b,
+0x3b, 0xcad, 0xcbe, 0xcb0, 0xca4, 0xcc0, 0xcaf, 0x20, 0xcb0, 0xcc2, 0xcaa, 0xcbe, 0xcaf, 0xcbf, 0xc97, 0xcb3, 0xcc1, 0x3b, 0x6c1, 0x650,
+0x646, 0x62f, 0x64f, 0x633, 0x62a, 0x672, 0x646, 0x6cd, 0x20, 0x631, 0x6c4, 0x67e, 0x64e, 0x6d2, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x442, 0x435, 0x4a3, 0x433, 0x435, 0x441, 0x456, 0x3b, 0x3b,
+0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x442, 0x435, 0x4a3, 0x433, 0x435, 0x441, 0x456, 0x3b, 0x3b, 0x3b,
+0x3b, 0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x442, 0x435, 0x4a3, 0x433, 0x435, 0x441, 0x456, 0x3b, 0x41a,
+0x44b, 0x440, 0x433, 0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x443, 0x3b, 0x3b, 0x41a, 0x44b, 0x440, 0x433,
+0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x443, 0x3b, 0x3b, 0x3b, 0x3b, 0x41a, 0x44b, 0x440, 0x433, 0x44b,
+0x437, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x443, 0x3b, 0xb300, 0xd55c, 0xbbfc, 0xad6d, 0x20, 0xc6d0, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0xb300, 0xd55c, 0xbbfc, 0xad6d, 0x20, 0xc6d0, 0x3b, 0xc870, 0xc120, 0x20, 0xbbfc, 0xc8fc, 0xc8fc, 0xc758, 0x20, 0xc778, 0xbbfc,
+0x20, 0xacf5, 0xd654, 0xad6d, 0x20, 0xc6d0, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xc870, 0xc120, 0x20, 0xbbfc, 0xc8fc, 0xc8fc, 0xc758, 0x20,
+0xc778, 0xbbfc, 0x20, 0xacf5, 0xd654, 0xad6d, 0x20, 0xc6d0, 0x3b, 0x49, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x72, 0x79,
+0x2019, 0x55, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xea5, 0xeb2, 0xea7, 0x20,
+0xe81, 0xeb5, 0xe9a, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xea5, 0xeb2, 0xea7, 0x20, 0xe81, 0xeb5, 0xe9a, 0x3b, 0x65, 0x69, 0x72,
+0x6f, 0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b,
+0x46, 0x61, 0x6c, 0xe1, 0x6e, 0x67, 0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0xf3, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x79, 0x61, 0x20, 0x41, 0x6e, 0x67, 0xf3, 0x6c, 0x61, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x61, 0x6c, 0xe1, 0x6e, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x42, 0x45,
+0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x61, 0x73, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x61,
+0x73, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x69, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x173, 0x3b, 0x41c,
+0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x435, 0x43d, 0x430, 0x440, 0x3b, 0x3b, 0x41c, 0x430, 0x43a,
+0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x435, 0x43d, 0x430, 0x440, 0x3b, 0x3b, 0x3b, 0x3b, 0x41c, 0x430, 0x43a,
+0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x435, 0x43d, 0x430, 0x440, 0x438, 0x3b, 0x41, 0x72, 0x69, 0x61, 0x72,
+0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x69, 0x6e, 0x67, 0x67, 0x69, 0x74, 0x20, 0x4d, 0x61, 0x6c, 0x61,
+0x79, 0x73, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x69, 0x6e, 0x67, 0x67, 0x69, 0x74, 0x20, 0x4d, 0x61,
+0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x72, 0x20, 0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x72, 0x20, 0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x3b, 0x44, 0x6f,
+0x6c, 0x61, 0x72, 0x20, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x75, 0x72, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44,
+0x6f, 0x6c, 0x61, 0x72, 0x20, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x75, 0x72, 0x61, 0x3b, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d,
+0xd2f, 0xd7b, 0x20, 0xd30, 0xd42, 0xd2a, 0x3b, 0x3b, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f, 0xd7b, 0x20, 0xd30, 0xd42, 0xd2a, 0x3b,
+0x3b, 0x3b, 0x3b, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f, 0xd7b, 0x20, 0xd30, 0xd42, 0xd2a, 0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b,
+0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x65, 0x77, 0x72,
+0x6f, 0x3b, 0x54, 0x101, 0x72, 0x61, 0x20, 0x6f, 0x20, 0x41, 0x6f, 0x74, 0x65, 0x61, 0x72, 0x6f, 0x61, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x74, 0x101, 0x72, 0x61, 0x20, 0x6f, 0x20, 0x41, 0x6f, 0x74, 0x65, 0x61, 0x72, 0x6f, 0x61, 0x3b, 0x92d,
+0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20,
+0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f,
+0x947, 0x3b, 0x41c, 0x43e, 0x43d, 0x433, 0x43e, 0x43b, 0x20, 0x442, 0x4e9, 0x433, 0x440, 0x4e9, 0x433, 0x3b, 0x3b, 0x41c, 0x43e, 0x43d,
+0x433, 0x43e, 0x43b, 0x20, 0x442, 0x4e9, 0x433, 0x440, 0x4e9, 0x433, 0x3b, 0x3b, 0x3b, 0x3b, 0x41c, 0x43e, 0x43d, 0x433, 0x43e, 0x43b,
+0x20, 0x442, 0x4e9, 0x433, 0x440, 0x4e9, 0x433, 0x3b, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x940, 0x20, 0x930, 0x942, 0x92a, 0x948, 0x92f,
+0x93e, 0x901, 0x3b, 0x3b, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x940, 0x20, 0x930, 0x942, 0x92a, 0x948, 0x92f, 0x93e, 0x901, 0x3b, 0x3b,
+0x3b, 0x3b, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x940, 0x20, 0x930, 0x942, 0x92a, 0x948, 0x92f, 0x93e, 0x901, 0x3b, 0x92d, 0x93e, 0x930,
+0x924, 0x940, 0x92f, 0x20, 0x930, 0x942, 0x92a, 0x93f, 0x901, 0x92f, 0x93e, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20,
+0x930, 0x942, 0x92a, 0x93f, 0x901, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x942,
+0x92a, 0x93f, 0x901, 0x92f, 0x93e, 0x3b, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x65, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b,
+0x3b, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x6e, 0x6f, 0x72, 0x73,
+0x6b, 0x65, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0xb2d, 0xb3e, 0xb30, 0xb24, 0xb40, 0xb5f, 0x20, 0xb1f, 0xb19, 0xb4d,
+0xb15, 0xb3e, 0x3b, 0x3b, 0xb2d, 0xb3e, 0xb30, 0xb24, 0xb40, 0xb5f, 0x20, 0xb1f, 0xb19, 0xb4d, 0xb15, 0xb3e, 0x3b, 0x3b, 0x3b, 0x3b,
+0xb2d, 0xb3e, 0xb30, 0xb24, 0xb40, 0xb5f, 0x20, 0xb1f, 0xb19, 0xb4d, 0xb15, 0xb3e, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b,
+0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b, 0x67e, 0x627,
+0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cd, 0x20, 0x6a9, 0x644, 0x62f, 0x627, 0x631, 0x647, 0x3b, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a,
+0x627, 0x646, 0x6cd, 0x20, 0x6a9, 0x644, 0x62f, 0x627, 0x631, 0x647, 0x3b, 0x3b, 0x3b, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627,
+0x646, 0x6cd, 0x20, 0x6a9, 0x644, 0x62f, 0x627, 0x631, 0x6d2, 0x3b, 0x631, 0x6cc, 0x627, 0x644, 0x20, 0x627, 0x6cc, 0x631, 0x627, 0x646,
+0x3b, 0x3b, 0x631, 0x6cc, 0x627, 0x644, 0x20, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x3b, 0x3b, 0x3b, 0x3b, 0x631, 0x6cc, 0x627, 0x644,
+0x20, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc, 0x20, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633,
+0x62a, 0x627, 0x646, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc, 0x20, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633, 0x62a, 0x627,
+0x646, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc, 0x20, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633, 0x62a, 0x627,
+0x646, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x79, 0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x3b, 0x3b, 0x7a, 0x142, 0x6f, 0x74,
+0x79, 0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x3b, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x6f, 0x6c, 0x73,
+0x6b, 0x69, 0x65, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x79, 0x63, 0x68, 0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x63, 0x68,
+0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x65, 0x67, 0x6f, 0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x65, 0x67, 0x6f, 0x3b, 0x52,
+0x65, 0x61, 0x6c, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x3b, 0x52, 0x65, 0x61, 0x6c,
+0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x65, 0x61, 0x69, 0x73,
+0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0x69, 0x72, 0x6f, 0x73, 0x3b, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20,
+0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x61, 0x6e, 0x67,
+0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x67,
+0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x65, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76,
+0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x65, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x61, 0x62, 0x6f,
+0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x73,
+0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0xf3, 0x6c, 0x61,
+0x72, 0x20, 0x64, 0x6f, 0x73, 0x20, 0x45, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x73, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73,
+0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x73, 0x20, 0x45, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x73, 0x20,
+0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x65, 0x73, 0x20, 0x64, 0x6f,
+0x73, 0x20, 0x45, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x73, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73, 0x3b, 0x66, 0x72, 0x61,
+0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e,
+0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61,
+0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x66, 0x72, 0x61, 0x6e,
+0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e,
+0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x70, 0x61,
+0x74, 0x61, 0x63, 0x61, 0x20, 0x6d, 0x61, 0x63, 0x61, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x70, 0x61, 0x74, 0x61, 0x63,
+0x61, 0x20, 0x6d, 0x61, 0x63, 0x61, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x61, 0x74, 0x61, 0x63, 0x61,
+0x73, 0x20, 0x6d, 0x61, 0x63, 0x61, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x6d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20,
+0x6d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x6d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c,
+0x20, 0x6d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x6d, 0x65, 0x74, 0x69,
+0x63, 0x61, 0x69, 0x73, 0x20, 0x6d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0x6f,
+0x62, 0x72, 0x61, 0x20, 0x64, 0x65, 0x20, 0x53, 0xe3, 0x6f, 0x20, 0x54, 0x6f, 0x6d, 0xe9, 0x20, 0x65, 0x20, 0x50, 0x72,
+0xed, 0x6e, 0x63, 0x69, 0x70, 0x65, 0x3b, 0x3b, 0x64, 0x6f, 0x62, 0x72, 0x61, 0x20, 0x64, 0x65, 0x20, 0x53, 0xe3, 0x6f,
+0x20, 0x54, 0x6f, 0x6d, 0xe9, 0x20, 0x65, 0x20, 0x50, 0x72, 0xed, 0x6e, 0x63, 0x69, 0x70, 0x65, 0x3b, 0x3b, 0x3b, 0x3b,
+0x64, 0x6f, 0x62, 0x72, 0x61, 0x73, 0x20, 0x64, 0x65, 0x20, 0x53, 0xe3, 0x6f, 0x20, 0x54, 0x6f, 0x6d, 0xe9, 0x20, 0x65,
+0x20, 0x50, 0x72, 0xed, 0x6e, 0x63, 0x69, 0x70, 0x65, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x75, 0xed,
+0xe7, 0x6f, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x75, 0xed, 0xe7, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x73, 0x75, 0xed, 0xe7, 0x6f, 0x73, 0x3b, 0xa2d, 0xa3e, 0xa30, 0xa24, 0xa40,
+0x20, 0xa30, 0xa41, 0xa2a, 0xa07, 0xa06, 0x3b, 0x3b, 0xa2d, 0xa3e, 0xa30, 0xa24, 0xa40, 0x20, 0xa30, 0xa41, 0xa2a, 0xa07, 0xa06, 0x3b,
+0x3b, 0x3b, 0x3b, 0xa2d, 0xa3e, 0xa30, 0xa24, 0xa40, 0x20, 0xa30, 0xa41, 0xa2a, 0xa0f, 0x3b, 0x631, 0x648, 0x67e, 0x626, 0x6cc, 0x6c1,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6f, 0x6c, 0x20, 0x50, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6f, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x3b, 0x42, 0x6f, 0x6c, 0x69,
+0x76, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x6e, 0x6f,
+0x3b, 0x44, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x44, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x61, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73,
+0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x76, 0x69, 0x7a,
+0x7a, 0x65, 0x72, 0x3b, 0x6c, 0x65, 0x75, 0x20, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65,
+0x75, 0x20, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x72, 0x6f, 0x6d, 0xe2,
+0x6e, 0x65, 0x219, 0x74, 0x69, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x219, 0x74, 0x69,
+0x3b, 0x6c, 0x65, 0x75, 0x20, 0x6d, 0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65,
+0x75, 0x20, 0x6d, 0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x6d,
+0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x219, 0x74, 0x69, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x6d, 0x6f, 0x6c,
+0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x219, 0x74, 0x69, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x439,
+0x20, 0x440, 0x443, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440,
+0x443, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431,
+0x43b, 0x44f, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x435, 0x439,
+0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x431,
+0x435, 0x43b, 0x43e, 0x440, 0x443, 0x441, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x431, 0x435,
+0x43b, 0x43e, 0x440, 0x443, 0x441, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x431, 0x435, 0x43b,
+0x43e, 0x440, 0x443, 0x441, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x431, 0x435, 0x43b, 0x43e, 0x440,
+0x443, 0x441, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x435, 0x439, 0x3b, 0x431, 0x435, 0x43b, 0x43e, 0x440, 0x443,
+0x441, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a,
+0x438, 0x439, 0x20, 0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x439, 0x20,
+0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x442, 0x435, 0x43d,
+0x433, 0x435, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x43a,
+0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x43a, 0x438, 0x440, 0x433,
+0x438, 0x437, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a,
+0x438, 0x439, 0x20, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x441,
+0x43e, 0x43c, 0x430, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x441, 0x43e, 0x43c, 0x43e, 0x432,
+0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x441, 0x43e, 0x43c, 0x430, 0x3b, 0x43c, 0x43e,
+0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x43b, 0x435, 0x439, 0x3b, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432,
+0x441, 0x43a, 0x438, 0x439, 0x20, 0x43b, 0x435, 0x439, 0x3b, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x438, 0x445,
+0x20, 0x43b, 0x435, 0x44f, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x43b, 0x435, 0x435, 0x432,
+0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x43b, 0x435, 0x44f, 0x3b, 0x443, 0x43a, 0x440,
+0x430, 0x438, 0x43d, 0x441, 0x43a, 0x430, 0x44f, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x430, 0x3b, 0x3b, 0x443, 0x43a, 0x440, 0x430,
+0x438, 0x43d, 0x441, 0x43a, 0x430, 0x44f, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x430, 0x3b, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438,
+0x43d, 0x441, 0x43a, 0x438, 0x435, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44b, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x441,
+0x43a, 0x438, 0x445, 0x20, 0x433, 0x440, 0x438, 0x432, 0x435, 0x43d, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x441, 0x43a, 0x43e,
+0x439, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44b, 0x3b, 0x66, 0x61, 0x72, 0xe2, 0x6e, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41,
+0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x421, 0x440, 0x43f, 0x441, 0x43a, 0x438,
+0x20, 0x434, 0x438, 0x43d, 0x430, 0x440, 0x3b, 0x3b, 0x441, 0x440, 0x43f, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x438, 0x43d, 0x430, 0x440,
+0x3b, 0x3b, 0x441, 0x440, 0x43f, 0x441, 0x43a, 0x430, 0x20, 0x434, 0x438, 0x43d, 0x430, 0x440, 0x430, 0x3b, 0x3b, 0x441, 0x440, 0x43f,
+0x441, 0x43a, 0x438, 0x445, 0x20, 0x434, 0x438, 0x43d, 0x430, 0x440, 0x430, 0x3b, 0x411, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e,
+0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x430, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440,
+0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x430, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d,
+0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x430, 0x20, 0x43a, 0x43e, 0x43d,
+0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x430, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e,
+0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x435, 0x20,
+0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x435, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x65, 0x3b,
+0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447,
+0x43a, 0x438, 0x445, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x438, 0x445, 0x20, 0x43c,
+0x430, 0x440, 0x430, 0x43a, 0x430, 0x3b, 0x415, 0x432, 0x440, 0x43e, 0x3b, 0x3b, 0x435, 0x432, 0x440, 0x43e, 0x3b, 0x3b, 0x435, 0x432,
+0x440, 0x430, 0x3b, 0x3b, 0x435, 0x432, 0x440, 0x430, 0x3b, 0x42, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x2d, 0x68, 0x65,
+0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62,
+0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f,
+0x2d, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72,
+0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e,
+0x73, 0x6b, 0x6f, 0x2d, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x65, 0x20, 0x6b, 0x6f, 0x6e,
+0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x3b, 0x3b, 0x62, 0x6f,
+0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x2d, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x69, 0x68,
+0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x69, 0x68, 0x20, 0x6d, 0x61, 0x72, 0x61,
+0x6b, 0x61, 0x3b, 0x45, 0x76, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x61, 0x3b,
+0x3b, 0x65, 0x76, 0x72, 0x61, 0x3b, 0x53, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x20, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x3b, 0x3b,
+0x73, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x20, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x3b, 0x3b, 0x73, 0x72, 0x70, 0x73, 0x6b, 0x61,
+0x20, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x61, 0x3b, 0x3b, 0x73, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x68, 0x20, 0x64, 0x69, 0x6e,
+0x61, 0x72, 0x61, 0x3b, 0x41b, 0x430, 0x440, 0x3b, 0x3b, 0x43b, 0x430, 0x440, 0x3b, 0x3b, 0x3b, 0x3b, 0x43b, 0x430, 0x440, 0x44b,
+0x3b, 0x421, 0x43e, 0x43c, 0x3b, 0x3b, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x3b, 0x3b, 0x441, 0x43e, 0x43c, 0x44b, 0x3b, 0x44, 0x6f,
+0x72, 0x61, 0x20, 0x72, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627, 0x646, 0x64a, 0x20, 0x631, 0x67e, 0x64a, 0x3b, 0x3b, 0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627,
+0x646, 0x64a, 0x20, 0x631, 0x67e, 0x64a, 0x3b, 0x3b, 0x3b, 0x3b, 0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627, 0x646, 0x64a, 0x20, 0x631,
+0x67e, 0x64a, 0x3b, 0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0x20, 0xdbb, 0xdd4, 0xdb4, 0xdd2, 0xdba, 0xdbd,
+0x3b, 0x3b, 0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0x20, 0xdbb, 0xdd4, 0xdb4, 0xdd2, 0xdba, 0xdbd, 0x3b,
+0x3b, 0x3b, 0x3b, 0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0x20, 0xdbb, 0xdd4, 0xdb4, 0xdd2, 0xdba, 0xdbd,
+0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0xe1, 0x3b, 0x65, 0x75,
+0x72, 0x61, 0x3b, 0x65, 0x75, 0x72, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x3b, 0x65, 0x76,
+0x72, 0x61, 0x3b, 0x65, 0x76, 0x72, 0x69, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x76, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69,
+0x6e, 0x67, 0x6b, 0x61, 0x20, 0x53, 0x6f, 0x6f, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x46, 0x61, 0x72, 0x61, 0x6e, 0x20, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x3b, 0x66, 0x61, 0x72,
+0x61, 0x6e, 0x6b, 0x61, 0x20, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61,
+0x6e, 0x6b, 0x61, 0x20, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x42, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74,
+0x6f, 0x6f, 0x62, 0x62, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x62, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74, 0x6f, 0x6f, 0x62,
+0x62, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74, 0x6f, 0x6f, 0x62, 0x62,
+0x69, 0x79, 0x61, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x6b, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b,
+0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x6b, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b,
+0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x6b, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x70, 0x65, 0x73, 0x6f,
+0x20, 0x61, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x61, 0x72, 0x67,
+0x65, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x61, 0x72, 0x67, 0x65,
+0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x63, 0x65, 0xf1,
+0x6f, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x63, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b,
+0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x65, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x63, 0x65, 0xf1, 0x6f, 0x73, 0x3b, 0x62,
+0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x6e, 0x6f, 0x3b,
+0x3b, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x72, 0x65, 0x61, 0x6c, 0x20, 0x62,
+0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x72, 0x65, 0x61, 0x6c, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69,
+0x6c, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x72, 0x65, 0x61, 0x6c, 0x65, 0x73, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69,
+0x6c, 0x65, 0xf1, 0x6f, 0x73, 0x3b, 0x50, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x68, 0x69, 0x6c, 0x65, 0x6e, 0x6f, 0x3b, 0x3b,
+0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x68, 0x69, 0x6c, 0x65, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f,
+0x73, 0x20, 0x63, 0x68, 0x69, 0x6c, 0x65, 0x6e, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
+0x6d, 0x62, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69,
+0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69,
+0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x63, 0x6f, 0x6c, 0xf3, 0x6e, 0x20, 0x63, 0x6f, 0x73, 0x74, 0x61, 0x72, 0x72, 0x69, 0x63,
+0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x63, 0x6f, 0x6c, 0xf3, 0x6e, 0x20, 0x63, 0x6f, 0x73, 0x74, 0x61, 0x72, 0x72, 0x69,
+0x63, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x63, 0x6f, 0x6c, 0x6f, 0x6e, 0x65, 0x73, 0x20, 0x63, 0x6f, 0x73,
+0x74, 0x61, 0x72, 0x72, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x75, 0x62,
+0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x75, 0x62, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x63, 0x75, 0x62, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x64,
+0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x64, 0x6f, 0x6d, 0x69,
+0x6e, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x64, 0x6f, 0x6d, 0x69,
+0x6e, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x65, 0x73, 0x74, 0x61, 0x64, 0x6f,
+0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x65, 0x73, 0x74, 0x61,
+0x64, 0x6f, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x65,
+0x73, 0x20, 0x65, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x66, 0x72,
+0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x64, 0x65, 0x20, 0xc1, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x43,
+0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x64,
+0x65, 0x20, 0xc1, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x3b, 0x3b, 0x3b, 0x3b,
+0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x64, 0x65, 0x20, 0xc1, 0x66, 0x72, 0x69, 0x63,
+0x61, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x3b, 0x71, 0x75, 0x65, 0x74, 0x7a, 0x61, 0x6c, 0x3b, 0x3b, 0x71,
+0x75, 0x65, 0x74, 0x7a, 0x61, 0x6c, 0x3b, 0x3b, 0x3b, 0x3b, 0x71, 0x75, 0x65, 0x74, 0x7a, 0x61, 0x6c, 0x65, 0x73, 0x3b,
+0x6c, 0x65, 0x6d, 0x70, 0x69, 0x72, 0x61, 0x20, 0x68, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x6c,
+0x65, 0x6d, 0x70, 0x69, 0x72, 0x61, 0x20, 0x68, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x6c, 0x65, 0x6d, 0x70, 0x69, 0x72, 0x61, 0x73, 0x20, 0x68, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x65, 0xf1, 0x6f, 0x73, 0x3b,
+0x70, 0x65, 0x73, 0x6f, 0x20, 0x6d, 0x65, 0x78, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20,
+0x6d, 0x65, 0x78, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x6d, 0x65,
+0x78, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x63, 0xf3, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x20, 0x6e, 0x69, 0x63, 0x61,
+0x72, 0x61, 0x67, 0xfc, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x63, 0xf3, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x20, 0x6e, 0x69,
+0x63, 0x61, 0x72, 0x61, 0x67, 0xfc, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x63, 0xf3, 0x72, 0x64, 0x6f, 0x62,
+0x61, 0x73, 0x20, 0x6e, 0x69, 0x63, 0x61, 0x72, 0x61, 0x67, 0xfc, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x62, 0x61, 0x6c,
+0x62, 0x6f, 0x61, 0x20, 0x70, 0x61, 0x6e, 0x61, 0x6d, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x62, 0x61, 0x6c, 0x62, 0x6f, 0x61,
+0x20, 0x70, 0x61, 0x6e, 0x61, 0x6d, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x61, 0x6c, 0x62, 0x6f, 0x61, 0x73,
+0x20, 0x70, 0x61, 0x6e, 0x61, 0x6d, 0x65, 0xf1, 0x6f, 0x73, 0x3b, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0xed, 0x20, 0x70,
+0x61, 0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0xed, 0x20, 0x70, 0x61,
+0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0xed, 0x65, 0x73,
+0x20, 0x70, 0x61, 0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x73, 0x3b, 0x73, 0x6f, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x75,
+0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x73, 0x6f, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
+0x73, 0x6f, 0x6c, 0x65, 0x73, 0x20, 0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20,
+0x66, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x69, 0x70,
+0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e,
+0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x75, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x70, 0x65,
+0x73, 0x6f, 0x20, 0x75, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73,
+0x20, 0x75, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x73, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x20, 0x73,
+0x6f, 0x62, 0x65, 0x72, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x20, 0x73, 0x6f, 0x62,
+0x65, 0x72, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x65, 0x73, 0x20, 0x73,
+0x6f, 0x62, 0x65, 0x72, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61,
+0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20,
+0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69,
+0x6e, 0x67, 0x69, 0x20, 0x7a, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x46, 0x61, 0x72, 0x61,
+0x6e, 0x67, 0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x67,
+0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x67,
+0x61, 0x20, 0x7a, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20,
+0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79,
+0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20,
+0x7a, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61,
+0x20, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61,
+0x20, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20,
+0x7a, 0x61, 0x20, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f,
+0x6e, 0x61, 0x3b, 0x3b, 0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x61, 0x3b, 0x3b, 0x3b, 0x3b,
+0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x6f, 0x72, 0x3b, 0x421, 0x43e, 0x43c, 0x43e, 0x43d,
+0x4e3, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x421, 0x43e, 0x43c, 0x43e, 0x43d, 0x4e3, 0x3b, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf,
+0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0x3b, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe,
+0xbaf, 0xbcd, 0x3b, 0x3b, 0x3b, 0x3b, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0xb95,
+0xbb3, 0xbcd, 0x3b, 0xbae, 0xbb2, 0xbc7, 0xbb7, 0xbbf, 0xbaf, 0xba9, 0xbcd, 0x20, 0xbb0, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbbf, 0xb9f, 0xbcd,
+0x3b, 0x3b, 0xbae, 0xbb2, 0xbc7, 0xbb7, 0xbbf, 0xbaf, 0xba9, 0xbcd, 0x20, 0xbb0, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbbf, 0xb9f, 0xbcd, 0x3b,
+0x3b, 0x3b, 0x3b, 0xbae, 0xbb2, 0xbc7, 0xbb7, 0xbbf, 0xbaf, 0xba9, 0xbcd, 0x20, 0xbb0, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbbf, 0xb9f, 0xbcd,
+0xb95, 0xbb3, 0xbcd, 0x3b, 0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0x20, 0xb9f, 0xbbe, 0xbb2, 0xbb0,
+0xbcd, 0x3b, 0x3b, 0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0x20, 0xb9f, 0xbbe, 0xbb2, 0xbb0, 0xbcd,
+0x3b, 0x3b, 0x3b, 0x3b, 0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0x20, 0xb9f, 0xbbe, 0xbb2, 0xbb0,
+0xbcd, 0xb95, 0xbb3, 0xbcd, 0x3b, 0xb87, 0xbb2, 0xb99, 0xbcd, 0xb95, 0xbc8, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0x3b,
+0xb87, 0xbb2, 0xb99, 0xbcd, 0xb95, 0xbc8, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0x3b, 0x3b, 0x3b, 0xb87, 0xbb2, 0xb99,
+0xbcd, 0xb95, 0xbc8, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0xb95, 0xbb3, 0xbcd, 0x3b, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x44f,
+0x20, 0x441, 0x443, 0x43c, 0x44b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x441, 0x443, 0x43c, 0x3b, 0xc30, 0xc42, 0xc2a, 0xc3e, 0xc2f,
+0xc3f, 0x3b, 0x3b, 0xc30, 0xc42, 0xc2a, 0xc3e, 0xc2f, 0xc3f, 0x3b, 0x3b, 0x3b, 0x3b, 0xc30, 0xc42, 0xc2a, 0xc3e, 0xc2f, 0xc32, 0xc41,
+0x3b, 0xe1a, 0xe32, 0xe17, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xe1a, 0xe32, 0xe17, 0xe44, 0xe17, 0xe22, 0x3b, 0xf61, 0xf74, 0xf0b,
+0xf68, 0xf53, 0xf0b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xf62, 0xf92, 0xfb1, 0xf0b, 0xf42, 0xf62, 0xf0b, 0xf66, 0xf92, 0xf7c,
+0xf62, 0xf0b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x12e8, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x20, 0x1265, 0x122d, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x66, 0x61, 0x6b, 0x61, 0x74, 0x6f, 0x6e,
+0x67, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x66, 0x61, 0x6b, 0x61,
+0x74, 0x6f, 0x6e, 0x67, 0x61, 0x3b, 0x54, 0xfc, 0x72, 0x6b, 0x20, 0x4c, 0x69, 0x72, 0x61, 0x73, 0x131, 0x3b, 0x3b, 0x54,
+0xfc, 0x72, 0x6b, 0x20, 0x6c, 0x69, 0x72, 0x61, 0x73, 0x131, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0xfc, 0x72, 0x6b, 0x20, 0x6c,
+0x69, 0x72, 0x61, 0x73, 0x131, 0x3b, 0x54, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x64, 0x79,
+0x3b, 0x3b, 0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x64, 0x79, 0x3b, 0x3b, 0x3b, 0x3b,
+0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x64, 0x79, 0x3b, 0x62c, 0x6c7, 0x6ad, 0x6af, 0x648,
+0x20, 0x64a, 0x6c8, 0x6d5, 0x646, 0x649, 0x3b, 0x3b, 0x62c, 0x6c7, 0x6ad, 0x6af, 0x648, 0x20, 0x64a, 0x6c8, 0x6d5, 0x646, 0x649, 0x3b,
+0x3b, 0x3b, 0x3b, 0x62c, 0x6c7, 0x6ad, 0x6af, 0x648, 0x20, 0x64a, 0x6c8, 0x6d5, 0x646, 0x649, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x457,
+0x43d, 0x441, 0x44c, 0x43a, 0x430, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44f, 0x3b, 0x3b, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44f,
+0x3b, 0x3b, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x456, 0x3b, 0x433, 0x440, 0x438, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x433, 0x440, 0x438,
+0x432, 0x43d, 0x456, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x3b,
+0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x3b, 0x3b, 0x3b, 0x67e, 0x627,
+0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6cc, 0x20,
+0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x3b, 0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b,
+0x3b, 0x3b, 0x3b, 0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6d2, 0x3b, 0x4f, 0x2018, 0x7a, 0x62, 0x65,
+0x6b, 0x69, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2018, 0x6d, 0x69, 0x3b, 0x3b, 0x4f, 0x2018, 0x7a, 0x62, 0x65, 0x6b,
+0x69, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2018, 0x6d, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x4f, 0x2018, 0x7a, 0x62, 0x65,
+0x6b, 0x69, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2018, 0x6d, 0x69, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x40e, 0x437, 0x431, 0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x20, 0x441, 0x45e, 0x43c,
+0x3b, 0x3b, 0x40e, 0x437, 0x431, 0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x20, 0x441, 0x45e, 0x43c, 0x3b, 0x3b, 0x3b, 0x3b,
+0x40e, 0x437, 0x431, 0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x20, 0x441, 0x45e, 0x43c, 0x3b, 0x110, 0x1ed3, 0x6e, 0x67, 0x20,
+0x56, 0x69, 0x1ec7, 0x74, 0x20, 0x4e, 0x61, 0x6d, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x110, 0x1ed3, 0x6e, 0x67, 0x20, 0x56,
+0x69, 0x1ec7, 0x74, 0x20, 0x4e, 0x61, 0x6d, 0x3b, 0x50, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e,
+0x3b, 0x70, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x62, 0x75, 0x6e, 0x74, 0x20, 0x50,
+0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x62, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b,
+0x70, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x70, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72,
+0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x70, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x46,
+0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x62, 0x75, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x20, 0x53, 0x6f,
+0x77, 0x77, 0x75, 0x2d, 0x6a, 0x61, 0x6e, 0x74, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x20,
+0x43, 0x46, 0x41, 0x20, 0x79, 0x75, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x20, 0x53, 0x6f, 0x77, 0x77, 0x75, 0x2d, 0x6a,
+0x61, 0x6e, 0x74, 0x3b, 0x69, 0x52, 0x61, 0x6e, 0x64, 0x69, 0x20, 0x79, 0x61, 0x73, 0x65, 0x4d, 0x7a, 0x61, 0x6e, 0x7a,
+0x69, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x69, 0x52, 0x61, 0x6e, 0x64, 0x69, 0x20, 0x59, 0x61, 0x73,
+0x65, 0x4d, 0x7a, 0x61, 0x6e, 0x7a, 0x69, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x69, 0x52,
+0x61, 0x6e, 0x64, 0x69, 0x20, 0x79, 0x61, 0x73, 0x65, 0x4d, 0x7a, 0x61, 0x6e, 0x7a, 0x69, 0x20, 0x41, 0x66, 0x72, 0x69,
+0x6b, 0x61, 0x3b, 0x4e, 0xe1, 0xec, 0x72, 0xe0, 0x20, 0x74, 0x69, 0x20, 0x4f, 0x72, 0xed, 0x6c, 0x1eb9, 0x300, 0x2d, 0xe8,
+0x64, 0xe8, 0x20, 0x4e, 0xe0, 0xec, 0x6a, 0xed, 0x72, 0xed, 0xe0, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0xe1, 0xed,
+0x72, 0xe0, 0x20, 0x4e, 0xe0, 0xec, 0x6a, 0xed, 0x72, 0xed, 0xe0, 0x3b, 0x46, 0x61, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x20,
+0x74, 0x69, 0x20, 0x4f, 0x72, 0xed, 0x6c, 0x25b, 0x301, 0xe8, 0x64, 0x65, 0x20, 0x42, 0x49, 0x4b, 0x45, 0x41, 0x4f, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x69, 0x2d, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
+0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x69, 0x2d, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69,
+0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x69, 0x2d, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20,
+0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x42, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b,
+0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72,
+0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e,
+0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f, 0x6e, 0x76,
+0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62, 0x6f, 0x73,
+0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x65, 0x20, 0x6b, 0x6f,
+0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x3b, 0x3b, 0x62,
+0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x69, 0x68,
+0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x69, 0x68, 0x20, 0x6d, 0x61, 0x72, 0x61,
+0x6b, 0x61, 0x3b, 0x41a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x430, 0x20, 0x43c, 0x430, 0x440,
+0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e,
+0x432, 0x430, 0x447, 0x43a, 0x430, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x430, 0x20,
+0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446,
+0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x435, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b,
+0x43d, 0x435, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x435, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445,
+0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x438, 0x445, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442,
+0x438, 0x431, 0x438, 0x43b, 0x43d, 0x438, 0x445, 0x20, 0x43c, 0x430, 0x440, 0x430, 0x43a, 0x430, 0x3b, 0x47, 0x68, 0x61, 0x6e, 0x61,
+0x20, 0x53, 0x69, 0x64, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930,
+0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a,
+0x92f, 0x93e, 0x3b, 0x4e, 0x61, 0x1ecb, 0x72, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x6c, 0x69, 0x6e,
+0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x68,
+0x61, 0x6e, 0x61, 0x20, 0x73, 0x69, 0x256, 0x69, 0x3b, 0x3b, 0x67, 0x68, 0x61, 0x6e, 0x61, 0x20, 0x73, 0x69, 0x256, 0x69,
+0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x68, 0x61, 0x6e, 0x61, 0x20, 0x73, 0x69, 0x256, 0x69, 0x3b, 0x263, 0x65, 0x74, 0x6f, 0x256,
+0x6f, 0x66, 0x65, 0x20, 0x61, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61,
+0x6e, 0x63, 0x20, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x263, 0x65, 0x74, 0x6f, 0x256, 0x6f, 0x66, 0x65, 0x20, 0x61,
+0x66, 0x72, 0x69, 0x6b, 0x61, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x42, 0x43,
+0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x263, 0x65, 0x74, 0x6f, 0x256, 0x6f, 0x66, 0x65, 0x20, 0x61, 0x66, 0x72, 0x69,
+0x6b, 0x61, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x42, 0x43, 0x45, 0x41, 0x4f,
+0x3b, 0x50, 0x69, 0x73, 0x6f, 0x20, 0x6e, 0x67, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x3b,
+0x70, 0x69, 0x73, 0x6f, 0x20, 0x6e, 0x67, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x3b, 0x3b,
+0x3b, 0x70, 0x69, 0x73, 0x6f, 0x20, 0x6e, 0x67, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x53,
+0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x3b, 0x3b, 0x53, 0x63, 0x68,
+0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x63, 0x68,
+0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76,
+0x64, 0x6e, 0x6f, 0x3b, 0x3b, 0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b,
+0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x6e, 0x6f, 0x72,
+0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75,
+0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x72, 0x75, 0x6f, 0x167, 0x167,
+0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x3b, 0x72, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x20, 0x6b, 0x72,
+0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x72, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f,
+0x3b, 0x3b, 0x3b, 0x72, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x53, 0x68,
+0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x4d, 0x62, 0x75, 0x75, 0x257, 0x75, 0x20, 0x53, 0x65, 0x65, 0x66, 0x61, 0x61, 0x20, 0x42, 0x43, 0x45, 0x41,
+0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x62, 0x75, 0x75, 0x257, 0x69, 0x20, 0x53, 0x65, 0x65, 0x66, 0x61,
+0x61, 0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x20,
+0x47, 0x61, 0x6d, 0x6d, 0x62, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x61, 0x72, 0x20,
+0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x67, 0x69, 0x79,
+0x79, 0x61, 0x20, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61,
+0x79, 0x72, 0x61, 0x61, 0x20, 0x4e, 0x69, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x4c, 0x65, 0x77, 0x6f, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x61, 0x61, 0x20, 0x4c, 0x69, 0x79, 0x6f, 0x6e, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e,
+0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x6a, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x65, 0x65,
+0x6c, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x65, 0x74, 0x69, 0x63, 0x61,
+0x6c, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x71, 0x75, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x20, 0x79, 0x61, 0x73, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x6c, 0x69, 0x6b, 0x61, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x68, 0x65, 0x6c, 0x65, 0x72, 0x69, 0x20, 0x73, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x7a,
+0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x2d30, 0x2d37, 0x2d54, 0x2d49, 0x2d4e, 0x20, 0x2d4f, 0x20, 0x2d4d,
+0x2d4e, 0x2d56, 0x2d54, 0x2d49, 0x2d31, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x61, 0x64, 0x72, 0x69, 0x6d, 0x20, 0x6e, 0x20,
+0x6c, 0x6d, 0x263, 0x72, 0x69, 0x62, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20,
+0x41, 0x7a, 0x7a, 0x61, 0x79, 0x72, 0x69, 0x3b, 0x3b, 0x41, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x6e, 0x20, 0x5a, 0x7a,
+0x61, 0x79, 0x65, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x65, 0x6e, 0x20, 0x6e, 0x20, 0x5a,
+0x7a, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x45, 0x73, 0x68, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x55,
+0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69,
+0x20, 0x79, 0x61, 0x20, 0x48, 0x75, 0x74, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69,
+0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x65, 0x66, 0x61, 0x20, 0x46, 0x72, 0x61, 0x14b, 0x20, 0x28, 0x42,
+0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x13a0, 0x13d5, 0x13b3, 0x3b, 0x3b,
+0x55, 0x53, 0x20, 0x13a0, 0x13d5, 0x13b3, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x13a0, 0x13d5, 0x13b3, 0x3b, 0x72, 0x6f, 0x75,
+0x70, 0x69, 0x20, 0x6d, 0x6f, 0x72, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x68,
+0x69, 0x6c, 0xed, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0xed, 0x61,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x65, 0x79, 0x61, 0x20, 0x59,
+0x75, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6b, 0x75, 0x64, 0x75, 0x20, 0x4b,
+0x61, 0x62, 0x75, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x75, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6b, 0x75,
+0x64, 0x75, 0x20, 0x4b, 0x61, 0x62, 0x75, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x75, 0x3b, 0x53, 0x69, 0x6c, 0x69,
+0x6e, 0x67, 0x69, 0x74, 0x61, 0x62, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x69, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x72, 0x6f, 0x70, 0x69,
+0x79, 0x69, 0x61, 0x6e, 0xed, 0x20, 0x65, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x49, 0x72, 0x6f, 0x70, 0x69, 0x79, 0x69, 0x61, 0x6e, 0xed, 0x20, 0x65, 0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69,
+0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x72, 0x69, 0x6e, 0x6a, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b,
+0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20,
+0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x64, 0x68, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x41,
+0x6e, 0x67, 0x6f, 0x2019, 0x6f, 0x74, 0x6f, 0x6c, 0x20, 0x6c, 0x6f, 0x6b, 0x2019, 0x20, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x6e, 0x67, 0x6f, 0x2019, 0x6f, 0x74, 0x6f, 0x6c, 0x20, 0x6c, 0x6f, 0x6b,
+0x2019, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x46, 0x41, 0x20, 0x46, 0x72,
+0x61, 0x14b, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x6c,
+0x69, 0x6e, 0x67, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x44, 0x65, 0x72, 0x68, 0x65, 0x6d, 0x20, 0x55, 0x6d, 0x65, 0x1e5b, 0x1e5b, 0x75, 0x6b, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e,
+0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x930, 0x93e, 0x902, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x420,
+0x43e, 0x441, 0x441, 0x438, 0x439, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x43d, 0x20,
+0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x3b, 0x3b, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x43d, 0x20, 0x441, 0x43e, 0x44c, 0x43c, 0x430,
+0x448, 0x3b, 0x440, 0x461, 0x441, 0x441, 0x456, 0x301, 0x439, 0x441, 0x43a, 0x457, 0x439, 0x20, 0x440, 0xa64b, 0x301, 0x431, 0x43b, 0x44c,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x440, 0x461, 0x441, 0x441, 0x456, 0x301, 0x439, 0x441, 0x43a, 0x430, 0x433, 0x461, 0x20, 0x440,
+0xa64b, 0x431, 0x43b, 0x467, 0x300, 0x3b, 0x4e, 0x66, 0x61, 0x6c, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x77, 0x61, 0x20, 0x4b, 0x6f,
+0x6e, 0x67, 0x75, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x46, 0x41, 0x20, 0x46, 0xe0, 0x6c, 0xe2, 0x14b, 0x20,
+0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x1ce, 0x14b, 0x20, 0x43, 0x46, 0x41, 0x20,
+0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x65, 0x65, 0x66, 0x61, 0x20, 0x79,
+0x61, 0x74, 0x69, 0x20, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x259, 0x6c, 0xe1,
+0x14b, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x66,
+0x72, 0xe1, 0x14b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x6f, 0x6c, 0x61, 0x69, 0x20, 0x42, 0x45, 0x41, 0x43,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x14b, 0x20, 0x43, 0x46, 0x41, 0x20, 0x42, 0x45, 0x41, 0x43,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x410, 0x440, 0x430, 0x441, 0x441, 0x44b, 0x44b, 0x439, 0x430, 0x20, 0x441, 0x43e, 0x43b,
+0x43a, 0x443, 0x43e, 0x431, 0x430, 0x439, 0x430, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x410, 0x440, 0x430, 0x441, 0x441, 0x44b, 0x44b,
+0x439, 0x430, 0x20, 0x441, 0x43e, 0x43b, 0x43a, 0x443, 0x43e, 0x431, 0x430, 0x439, 0x430, 0x3b, 0x49, 0x68, 0x65, 0x6c, 0x61, 0x20,
+0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xa55e,
+0xa524, 0xa52b, 0xa569, 0x20, 0xa55c, 0xa55e, 0xa54c, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4c, 0x61, 0x69, 0x62, 0x68, 0x69,
+0x79, 0x61, 0x20, 0x44, 0x61, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x25b, 0x6c, 0xe2, 0x14b, 0x3b,
+0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
+0x3b, 0x3b, 0x73, 0x68, 0x69, 0x72, 0xe8, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x65, 0x6c, 0xe1, 0x14b, 0x20,
+0x43, 0x46, 0x41, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x62f, 0x6cc, 0x646, 0x627, 0x631, 0x6cc, 0x20, 0x639, 0x6ce, 0x631,
+0x627, 0x642, 0x6cc, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x695, 0x6cc, 0x627, 0x6b5, 0x6cc, 0x20, 0x626, 0x6ce, 0x631, 0x627,
+0x646, 0x6cc, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b,
+0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f,
+0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x6a, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x3b, 0x3b, 0x65,
+0x75, 0x72, 0x6f, 0x77, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x6cc, 0x631, 0x627,
+0x646, 0x20, 0x631, 0x6cc, 0x627, 0x644, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x20, 0x631, 0x6cc,
+0x627, 0x644, 0x3b, 0x6e2f, 0x5e63, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x6e2f, 0x5e63, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70,
+0x70, 0x69, 0x6e, 0x65, 0x20, 0x50, 0x69, 0x73, 0x6f, 0x3b, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e,
+0x65, 0x20, 0x70, 0x69, 0x73, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x67, 0x61, 0x20, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70,
+0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x69, 0x73, 0x6f, 0x3b
+};
+
+static const ushort currency_format_data[] = {
+0x25, 0x31, 0x25, 0x32, 0x25, 0x32, 0x25, 0x31, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x25, 0x32,
+0x25, 0x31, 0x4b, 0x25, 0x32, 0xa0, 0x2d, 0x25, 0x31, 0x28, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x29, 0x25, 0x32, 0x2d, 0x25,
+0x31, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x4b, 0x25, 0x31, 0xa0, 0x6b, 0x25, 0x32, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x2d, 0x25,
+0x32, 0x2212, 0x25, 0x31, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x44, 0x200f, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x200f, 0x200e, 0x2d, 0x25,
+0x31, 0xa0, 0x25, 0x32, 0x200e, 0x25, 0x32, 0x25, 0x31, 0x28, 0x25, 0x32, 0x25, 0x31, 0x29, 0x25, 0x31, 0xa0, 0x4b, 0xa0,
+0x25, 0x32, 0x25, 0x32, 0xa0, 0x4d, 0x25, 0x31, 0x25, 0x32, 0x2d, 0x4d, 0x25, 0x31, 0x25, 0x32, 0x2d, 0xa0, 0x25, 0x31
+};
+
+static const ushort endonyms_data[] = {
+0x4f, 0x72, 0x6f, 0x6d, 0x6f, 0x6f, 0x49, 0x74, 0x6f, 0x6f, 0x70, 0x68, 0x69, 0x79, 0x61, 0x61, 0x4b, 0x65, 0x65, 0x6e,
+0x69, 0x79, 0x61, 0x61, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66,
+0x72, 0x69, 0x6b, 0x61, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0xeb, 0x73, 0x68, 0x71, 0x69, 0x70, 0x53, 0x68, 0x71, 0x69,
+0x70, 0xeb, 0x72, 0x69, 0x4d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x69, 0x61, 0x20, 0x65, 0x20, 0x56, 0x65, 0x72, 0x69,
+0x75, 0x74, 0x4b, 0x6f, 0x73, 0x6f, 0x76, 0xeb, 0x12a0, 0x121b, 0x122d, 0x129b, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x627, 0x644, 0x639,
+0x631, 0x628, 0x64a, 0x629, 0x645, 0x635, 0x631, 0x627, 0x644, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x627, 0x644, 0x628, 0x62d, 0x631, 0x64a,
+0x646, 0x62a, 0x634, 0x627, 0x62f, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a,
+0x625, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x627, 0x627, 0x644, 0x639, 0x631, 0x627, 0x642, 0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644,
+0x627, 0x644, 0x623, 0x631, 0x62f, 0x646, 0x627, 0x644, 0x643, 0x648, 0x64a, 0x62a, 0x644, 0x628, 0x646, 0x627, 0x646, 0x644, 0x64a, 0x628,
+0x64a, 0x627, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x627, 0x627, 0x644, 0x645, 0x63a, 0x631, 0x628, 0x639, 0x64f, 0x645,
+0x627, 0x646, 0x627, 0x644, 0x623, 0x631, 0x627, 0x636, 0x64a, 0x20, 0x627, 0x644, 0x641, 0x644, 0x633, 0x637, 0x64a, 0x646, 0x64a, 0x629,
+0x642, 0x637, 0x631, 0x627, 0x644, 0x645, 0x645, 0x644, 0x643, 0x629, 0x20, 0x627, 0x644, 0x639, 0x631, 0x628, 0x64a, 0x629, 0x20, 0x627,
+0x644, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x629, 0x627, 0x644, 0x635, 0x648, 0x645, 0x627, 0x644, 0x627, 0x644, 0x633, 0x648, 0x62f, 0x627,
+0x646, 0x633, 0x648, 0x631, 0x64a, 0x627, 0x62a, 0x648, 0x646, 0x633, 0x627, 0x644, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x627,
+0x644, 0x639, 0x631, 0x628, 0x64a, 0x629, 0x20, 0x627, 0x644, 0x645, 0x62a, 0x62d, 0x62f, 0x629, 0x627, 0x644, 0x635, 0x62d, 0x631, 0x627,
+0x621, 0x20, 0x627, 0x644, 0x63a, 0x631, 0x628, 0x64a, 0x629, 0x627, 0x644, 0x64a, 0x645, 0x646, 0x62c, 0x646, 0x648, 0x628, 0x20, 0x627,
+0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x627, 0x644, 0x639, 0x631, 0x628, 0x64a, 0x629, 0x20, 0x627, 0x644, 0x641, 0x635, 0x62d, 0x649,
+0x20, 0x627, 0x644, 0x62d, 0x62f, 0x64a, 0x62b, 0x629, 0x627, 0x644, 0x639, 0x627, 0x644, 0x645, 0x570, 0x561, 0x575, 0x565, 0x580, 0x565,
+0x576, 0x540, 0x561, 0x575, 0x561, 0x57d, 0x57f, 0x561, 0x576, 0x985, 0x9b8, 0x9ae, 0x9c0, 0x9af, 0x9bc, 0x9be, 0x9ad, 0x9be, 0x9f0, 0x9a4,
+0x61, 0x7a, 0x259, 0x72, 0x62, 0x61, 0x79, 0x63, 0x61, 0x6e, 0x41, 0x7a, 0x259, 0x72, 0x62, 0x61, 0x79, 0x63, 0x61, 0x6e,
+0x430, 0x437, 0x4d9, 0x440, 0x431, 0x430, 0x458, 0x4b9, 0x430, 0x43d, 0x410, 0x437, 0x4d9, 0x440, 0x431, 0x430, 0x458, 0x4b9, 0x430, 0x43d,
+0x65, 0x75, 0x73, 0x6b, 0x61, 0x72, 0x61, 0x45, 0x73, 0x70, 0x61, 0x69, 0x6e, 0x69, 0x61, 0x9ac, 0x9be, 0x982, 0x9b2, 0x9be,
+0x9ac, 0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0xf62, 0xfab, 0xf7c, 0xf44, 0xf0b, 0xf41, 0xf60, 0xf56,
+0xfb2, 0xf74, 0xf42, 0x62, 0x72, 0x65, 0x7a, 0x68, 0x6f, 0x6e, 0x65, 0x67, 0x46, 0x72, 0x61, 0xf1, 0x73, 0x431, 0x44a, 0x43b,
+0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x411, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x438, 0x44f, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019, 0x102c,
+0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x430, 0x44f, 0x411, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x44c, 0x1781, 0x17d2,
+0x1798, 0x17c2, 0x179a, 0x1780, 0x1798, 0x17d2, 0x1796, 0x17bb, 0x1787, 0x17b6, 0x63, 0x61, 0x74, 0x61, 0x6c, 0xe0, 0x45, 0x73, 0x70, 0x61,
+0x6e, 0x79, 0x61, 0x41, 0x6e, 0x64, 0x6f, 0x72, 0x72, 0x61, 0x46, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x49, 0x74, 0xe0, 0x6c,
+0x69, 0x61, 0x7b80, 0x4f53, 0x4e2d, 0x6587, 0x4e2d, 0x56fd, 0x4e2d, 0x56fd, 0x9999, 0x6e2f, 0x7279, 0x522b, 0x884c, 0x653f, 0x533a, 0x4e2d, 0x56fd, 0x6fb3,
+0x95e8, 0x7279, 0x522b, 0x884c, 0x653f, 0x533a, 0x65b0, 0x52a0, 0x5761, 0x7e41, 0x9ad4, 0x4e2d, 0x6587, 0x4e2d, 0x570b, 0x9999, 0x6e2f, 0x7279, 0x5225, 0x884c,
+0x653f, 0x5340, 0x4e2d, 0x570b, 0x6fb3, 0x9580, 0x7279, 0x5225, 0x884c, 0x653f, 0x5340, 0x53f0, 0x7063, 0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b,
+0x69, 0x48, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x61, 0x42, 0x6f, 0x73, 0x6e, 0x61, 0x20, 0x69, 0x20, 0x48, 0x65, 0x72,
+0x63, 0x65, 0x67, 0x6f, 0x76, 0x69, 0x6e, 0x61, 0x10d, 0x65, 0x161, 0x74, 0x69, 0x6e, 0x61, 0x10c, 0x65, 0x73, 0x6b, 0x6f,
+0x64, 0x61, 0x6e, 0x73, 0x6b, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x47, 0x72, 0xf8, 0x6e, 0x6c, 0x61, 0x6e, 0x64,
+0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x41,
+0x72, 0x75, 0x62, 0x61, 0x42, 0x65, 0x6c, 0x67, 0x69, 0xeb, 0x43, 0x75, 0x72, 0x61, 0xe7, 0x61, 0x6f, 0x53, 0x75, 0x72,
+0x69, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x61, 0x72, 0x69, 0x62, 0x69, 0x73, 0x63, 0x68, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72,
+0x6c, 0x61, 0x6e, 0x64, 0x53, 0x69, 0x6e, 0x74, 0x2d, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x65, 0x6e, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x6e, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x53,
+0x74, 0x61, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e,
+0x20, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x41, 0x6e, 0x67, 0x75, 0x69, 0x6c, 0x6c, 0x61, 0x41, 0x6e, 0x74, 0x69, 0x67, 0x75,
+0x61, 0x20, 0x26, 0x20, 0x42, 0x61, 0x72, 0x62, 0x75, 0x64, 0x61, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
+0x6e, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x41, 0x75,
+0x73, 0x74, 0x72, 0x69, 0x61, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x61, 0x73, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x6f, 0x73,
+0x42, 0x65, 0x6c, 0x67, 0x69, 0x75, 0x6d, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61,
+0x42, 0x6f, 0x74, 0x73, 0x77, 0x61, 0x6e, 0x61, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x49, 0x6e, 0x64, 0x69,
+0x61, 0x6e, 0x20, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x20, 0x54, 0x65, 0x72, 0x72, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x75,
+0x72, 0x75, 0x6e, 0x64, 0x69, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x6f, 0x6f, 0x6e, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61,
+0x6e, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x43, 0x61, 0x79, 0x6d, 0x61,
+0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x43, 0x68, 0x72, 0x69, 0x73, 0x74, 0x6d, 0x61, 0x73, 0x20, 0x49,
+0x73, 0x6c, 0x61, 0x6e, 0x64, 0x43, 0x6f, 0x63, 0x6f, 0x73, 0x20, 0x28, 0x4b, 0x65, 0x65, 0x6c, 0x69, 0x6e, 0x67, 0x29,
+0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x43, 0x6f, 0x6f, 0x6b, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73,
+0x43, 0x79, 0x70, 0x72, 0x75, 0x73, 0x44, 0x65, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63,
+0x61, 0x45, 0x72, 0x69, 0x74, 0x72, 0x65, 0x61, 0x46, 0x61, 0x6c, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x49, 0x73, 0x6c,
+0x61, 0x6e, 0x64, 0x73, 0x46, 0x69, 0x6a, 0x69, 0x46, 0x69, 0x6e, 0x6c, 0x61, 0x6e, 0x64, 0x47, 0x75, 0x65, 0x72, 0x6e,
+0x73, 0x65, 0x79, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x47, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x79, 0x47, 0x68, 0x61, 0x6e,
+0x61, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61, 0x72, 0x47, 0x72, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x47, 0x75, 0x61,
+0x6d, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x53, 0x41, 0x52,
+0x20, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x49, 0x72, 0x65, 0x6c, 0x61, 0x6e, 0x64, 0x49, 0x73,
+0x72, 0x61, 0x65, 0x6c, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x4b, 0x69, 0x72, 0x69,
+0x62, 0x61, 0x74, 0x69, 0x4c, 0x65, 0x73, 0x6f, 0x74, 0x68, 0x6f, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, 0x4d, 0x61,
+0x63, 0x61, 0x6f, 0x20, 0x53, 0x41, 0x52, 0x20, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x4d, 0x61, 0x64, 0x61, 0x67, 0x61, 0x73,
+0x63, 0x61, 0x72, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x4d, 0x61, 0x6c,
+0x74, 0x61, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x6c, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x4d, 0x61,
+0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x4d, 0x6f, 0x6e,
+0x74, 0x73, 0x65, 0x72, 0x72, 0x61, 0x74, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x4e, 0x61, 0x75, 0x72, 0x75, 0x4e,
+0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61, 0x6e,
+0x64, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x4e, 0x69, 0x75, 0x65, 0x4e, 0x6f, 0x72, 0x66, 0x6f, 0x6c, 0x6b, 0x20,
+0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x72, 0x69, 0x61,
+0x6e, 0x61, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x50, 0x61, 0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x50, 0x61,
+0x6c, 0x61, 0x75, 0x50, 0x61, 0x70, 0x75, 0x61, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x50,
+0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x50, 0x69, 0x74, 0x63, 0x61, 0x69, 0x72, 0x6e, 0x20, 0x49,
+0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, 0x63, 0x6f, 0x52, 0x77, 0x61,
+0x6e, 0x64, 0x61, 0x53, 0x74, 0x20, 0x4b, 0x69, 0x74, 0x74, 0x73, 0x20, 0x26, 0x20, 0x4e, 0x65, 0x76, 0x69, 0x73, 0x53,
+0x74, 0x20, 0x4c, 0x75, 0x63, 0x69, 0x61, 0x53, 0x74, 0x20, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x20, 0x26, 0x20,
+0x47, 0x72, 0x65, 0x6e, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x53, 0x65, 0x79, 0x63, 0x68,
+0x65, 0x6c, 0x6c, 0x65, 0x73, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65, 0x53, 0x69, 0x6e,
+0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x69, 0x61, 0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f,
+0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63,
+0x61, 0x53, 0x74, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x45, 0x73, 0x77, 0x61, 0x74,
+0x69, 0x6e, 0x69, 0x53, 0x77, 0x65, 0x64, 0x65, 0x6e, 0x53, 0x77, 0x69, 0x74, 0x7a, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64,
+0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x54, 0x6f, 0x6b, 0x65, 0x6c, 0x61, 0x75, 0x54, 0x6f, 0x6e, 0x67, 0x61,
+0x54, 0x72, 0x69, 0x6e, 0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x54, 0x75, 0x72,
+0x6b, 0x73, 0x20, 0x26, 0x20, 0x43, 0x61, 0x69, 0x63, 0x6f, 0x73, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x54,
+0x75, 0x76, 0x61, 0x6c, 0x75, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x41, 0x72,
+0x61, 0x62, 0x20, 0x45, 0x6d, 0x69, 0x72, 0x61, 0x74, 0x65, 0x73, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x45,
+0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x4b, 0x69, 0x6e, 0x67, 0x64, 0x6f, 0x6d,
+0x55, 0x2e, 0x53, 0x2e, 0x20, 0x4f, 0x75, 0x74, 0x6c, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64,
+0x73, 0x56, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x56, 0x69, 0x72, 0x67,
+0x69, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x55, 0x2e, 0x53, 0x2e, 0x20, 0x56, 0x69, 0x72, 0x67, 0x69,
+0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x5a, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x5a, 0x69, 0x6d, 0x62, 0x61,
+0x62, 0x77, 0x65, 0x44, 0x69, 0x65, 0x67, 0x6f, 0x20, 0x47, 0x61, 0x72, 0x63, 0x69, 0x61, 0x49, 0x73, 0x6c, 0x65, 0x20,
+0x6f, 0x66, 0x20, 0x4d, 0x61, 0x6e, 0x4a, 0x65, 0x72, 0x73, 0x65, 0x79, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x53, 0x75,
+0x64, 0x61, 0x6e, 0x53, 0x69, 0x6e, 0x74, 0x20, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x65, 0x6e, 0x57, 0x6f, 0x72, 0x6c, 0x64,
+0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x65, 0x73, 0x70, 0x65, 0x72, 0x61, 0x6e, 0x74, 0x6f, 0x4d, 0x6f, 0x6e, 0x64, 0x6f,
+0x65, 0x65, 0x73, 0x74, 0x69, 0x45, 0x65, 0x73, 0x74, 0x69, 0x66, 0xf8, 0x72, 0x6f, 0x79, 0x73, 0x6b, 0x74, 0x46, 0xf8,
+0x72, 0x6f, 0x79, 0x61, 0x72, 0x73, 0x75, 0x6f, 0x6d, 0x69, 0x53, 0x75, 0x6f, 0x6d, 0x69, 0x66, 0x72, 0x61, 0x6e, 0xe7,
+0x61, 0x69, 0x73, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x6c, 0x67, 0xe9, 0x72, 0x69, 0x65, 0x42, 0x65, 0x6c, 0x67,
+0x69, 0x71, 0x75, 0x65, 0x42, 0xe9, 0x6e, 0x69, 0x6e, 0x42, 0x75, 0x72, 0x6b, 0x69, 0x6e, 0x61, 0x20, 0x46, 0x61, 0x73,
+0x6f, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x6f, 0x75, 0x6e, 0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x20, 0x63, 0x61,
+0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x52, 0xe9, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x71, 0x75, 0x65, 0x20, 0x63, 0x65, 0x6e,
+0x74, 0x72, 0x61, 0x66, 0x72, 0x69, 0x63, 0x61, 0x69, 0x6e, 0x65, 0x54, 0x63, 0x68, 0x61, 0x64, 0x43, 0x6f, 0x6d, 0x6f,
+0x72, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x67, 0x6f, 0x2d, 0x4b, 0x69, 0x6e, 0x73, 0x68, 0x61, 0x73, 0x61, 0x43, 0x6f, 0x6e,
+0x67, 0x6f, 0x2d, 0x42, 0x72, 0x61, 0x7a, 0x7a, 0x61, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x43, 0xf4, 0x74, 0x65, 0x20, 0x64,
+0x2019, 0x49, 0x76, 0x6f, 0x69, 0x72, 0x65, 0x44, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x47, 0x75, 0x69, 0x6e, 0xe9,
+0x65, 0x20, 0xe9, 0x71, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x61, 0x6c, 0x65, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x65, 0x20,
+0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x79, 0x6e, 0xe9, 0x73, 0x69, 0x65, 0x20, 0x66,
+0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x65, 0x47, 0x61, 0x62, 0x6f, 0x6e, 0x47, 0x75, 0x61, 0x64, 0x65, 0x6c, 0x6f,
+0x75, 0x70, 0x65, 0x47, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x48, 0x61, 0xef, 0x74, 0x69, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62,
+0x6f, 0x75, 0x72, 0x67, 0x4d, 0x61, 0x6c, 0x69, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4d, 0x61,
+0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x65, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x63, 0x65, 0x4d, 0x61, 0x79, 0x6f, 0x74,
+0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x61, 0x63, 0x6f, 0x4d, 0x61, 0x72, 0x6f, 0x63, 0x4e, 0x6f, 0x75, 0x76, 0x65, 0x6c, 0x6c,
+0x65, 0x2d, 0x43, 0x61, 0x6c, 0xe9, 0x64, 0x6f, 0x6e, 0x69, 0x65, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x4c, 0x61, 0x20, 0x52,
+0xe9, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x53, 0xe9, 0x6e, 0xe9, 0x67, 0x61, 0x6c, 0x53, 0x61, 0x69, 0x6e, 0x74, 0x2d, 0x50,
+0x69, 0x65, 0x72, 0x72, 0x65, 0x2d, 0x65, 0x74, 0x2d, 0x4d, 0x69, 0x71, 0x75, 0x65, 0x6c, 0x6f, 0x6e, 0x66, 0x72, 0x61,
+0x6e, 0xe7, 0x61, 0x69, 0x73, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x53, 0x75, 0x69, 0x73, 0x73, 0x65, 0x53, 0x79,
+0x72, 0x69, 0x65, 0x54, 0x6f, 0x67, 0x6f, 0x54, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x69, 0x73,
+0x2d, 0x65, 0x74, 0x2d, 0x46, 0x75, 0x74, 0x75, 0x6e, 0x61, 0x53, 0x61, 0x69, 0x6e, 0x74, 0x2d, 0x42, 0x61, 0x72, 0x74,
+0x68, 0xe9, 0x6c, 0x65, 0x6d, 0x79, 0x53, 0x61, 0x69, 0x6e, 0x74, 0x2d, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x46, 0x72,
+0x79, 0x73, 0x6b, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0xe2, 0x6e, 0x47, 0xe0, 0x69, 0x64, 0x68, 0x6c, 0x69, 0x67, 0x41,
+0x6e, 0x20, 0x52, 0xec, 0x6f, 0x67, 0x68, 0x61, 0x63, 0x68, 0x64, 0x20, 0x41, 0x6f, 0x6e, 0x61, 0x69, 0x63, 0x68, 0x74,
+0x65, 0x67, 0x61, 0x6c, 0x65, 0x67, 0x6f, 0x45, 0x73, 0x70, 0x61, 0xf1, 0x61, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8,
+0x10e1, 0x10d0, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10d5, 0x10d4, 0x10da, 0x10dd, 0x44, 0x65, 0x75, 0x74, 0x73, 0x63, 0x68, 0x44, 0x65, 0x75,
+0x74, 0x73, 0x63, 0x68, 0x6c, 0x61, 0x6e, 0x64, 0xd6, 0x73, 0x74, 0x65, 0x72, 0x72, 0x65, 0x69, 0x63, 0x68, 0x69, 0x73,
+0x63, 0x68, 0x65, 0x73, 0x20, 0x44, 0x65, 0x75, 0x74, 0x73, 0x63, 0x68, 0xd6, 0x73, 0x74, 0x65, 0x72, 0x72, 0x65, 0x69,
+0x63, 0x68, 0x42, 0x65, 0x6c, 0x67, 0x69, 0x65, 0x6e, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x65, 0x6e, 0x4c, 0x69, 0x65, 0x63,
+0x68, 0x74, 0x65, 0x6e, 0x73, 0x74, 0x65, 0x69, 0x6e, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62, 0x75, 0x72, 0x67, 0x53, 0x63,
+0x68, 0x77, 0x65, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x48, 0x6f, 0x63, 0x68, 0x64, 0x65, 0x75, 0x74, 0x73, 0x63, 0x68, 0x53,
+0x63, 0x68, 0x77, 0x65, 0x69, 0x7a, 0x395, 0x3bb, 0x3bb, 0x3b7, 0x3bd, 0x3b9, 0x3ba, 0x3ac, 0x395, 0x3bb, 0x3bb, 0x3ac, 0x3b4, 0x3b1,
+0x39a, 0x3cd, 0x3c0, 0x3c1, 0x3bf, 0x3c2, 0x6b, 0x61, 0x6c, 0x61, 0x61, 0x6c, 0x6c, 0x69, 0x73, 0x75, 0x74, 0x4b, 0x61, 0x6c,
+0x61, 0x61, 0x6c, 0x6c, 0x69, 0x74, 0x20, 0x4e, 0x75, 0x6e, 0x61, 0x61, 0x74, 0xa97, 0xac1, 0xa9c, 0xab0, 0xabe, 0xaa4, 0xac0,
+0xaad, 0xabe, 0xab0, 0xaa4, 0x48, 0x61, 0x75, 0x73, 0x61, 0x4e, 0x61, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x47, 0x61, 0x6e,
+0x61, 0x4e, 0x69, 0x6a, 0x61, 0x72, 0x5e2, 0x5d1, 0x5e8, 0x5d9, 0x5ea, 0x5d9, 0x5e9, 0x5e8, 0x5d0, 0x5dc, 0x939, 0x93f, 0x928, 0x94d,
+0x926, 0x940, 0x92d, 0x93e, 0x930, 0x924, 0x6d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x4d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x6f, 0x72,
+0x73, 0x7a, 0xe1, 0x67, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0xcd, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x49, 0x6e,
+0x64, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x67, 0x75, 0x61, 0x4d, 0x75,
+0x6e, 0x64, 0x6f, 0x47, 0x61, 0x65, 0x69, 0x6c, 0x67, 0x65, 0xc9, 0x69, 0x72, 0x65, 0x61, 0x6e, 0x20, 0x52, 0xed, 0x6f,
+0x63, 0x68, 0x74, 0x20, 0x41, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x74, 0x68, 0x65, 0x69, 0x74, 0x61, 0x6c, 0x69, 0x61, 0x6e,
+0x6f, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x61, 0x53, 0x61, 0x6e, 0x20, 0x4d, 0x61, 0x72, 0x69, 0x6e, 0x6f, 0x53, 0x76, 0x69,
+0x7a, 0x7a, 0x65, 0x72, 0x61, 0x43, 0x69, 0x74, 0x74, 0xe0, 0x20, 0x64, 0x65, 0x6c, 0x20, 0x56, 0x61, 0x74, 0x69, 0x63,
+0x61, 0x6e, 0x6f, 0x65e5, 0x672c, 0x8a9e, 0x65e5, 0x672c, 0x4a, 0x61, 0x77, 0x61, 0x49, 0x6e, 0x64, 0x6f, 0x6e, 0xe9, 0x73, 0x69,
+0x61, 0xc95, 0xca8, 0xccd, 0xca8, 0xca1, 0xcad, 0xcbe, 0xcb0, 0xca4, 0x6a9, 0x672, 0x634, 0x64f, 0x631, 0x6c1, 0x650, 0x646, 0x62f, 0x648,
+0x633, 0x62a, 0x627, 0x646, 0x49b, 0x430, 0x437, 0x430, 0x49b, 0x20, 0x442, 0x456, 0x43b, 0x456, 0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441,
+0x442, 0x430, 0x43d, 0x4b, 0x69, 0x6e, 0x79, 0x61, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x55, 0x20, 0x52, 0x77, 0x61, 0x6e,
+0x64, 0x61, 0x43a, 0x44b, 0x440, 0x433, 0x44b, 0x437, 0x447, 0x430, 0x41a, 0x44b, 0x440, 0x433, 0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d,
+0xd55c, 0xad6d, 0xc5b4, 0xb300, 0xd55c, 0xbbfc, 0xad6d, 0xc870, 0xc120, 0xbbfc, 0xc8fc, 0xc8fc, 0xc758, 0xc778, 0xbbfc, 0xacf5, 0xd654, 0xad6d, 0x6b, 0x75,
+0x72, 0x64, 0xee, 0x54, 0x69, 0x72, 0x6b, 0x69, 0x79, 0x65, 0x49, 0x6b, 0x69, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x55, 0x62,
+0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0xea5, 0xeb2, 0xea7, 0x6c, 0x61, 0x74, 0x76, 0x69, 0x65, 0x161, 0x75, 0x4c, 0x61, 0x74,
+0x76, 0x69, 0x6a, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0xe1, 0x6c, 0x61, 0x52, 0x65, 0x70, 0x75, 0x62, 0x6c, 0xed, 0x6b, 0x69,
+0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0xf3, 0x20, 0x44, 0x65, 0x6d, 0x6f, 0x6b, 0x72, 0x61, 0x74, 0xed, 0x6b,
+0x69, 0x41, 0x6e, 0x67, 0xf3, 0x6c, 0x61, 0x52, 0x65, 0x70, 0x69, 0x62, 0x69, 0x6b, 0x69, 0x20, 0x79, 0x61, 0x20, 0x41,
+0x66, 0x72, 0xed, 0x6b, 0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0xe1, 0x74, 0x69, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x69,
+0x65, 0x74, 0x75, 0x76, 0x69, 0x173, 0x4c, 0x69, 0x65, 0x74, 0x75, 0x76, 0x61, 0x43c, 0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d,
+0x441, 0x43a, 0x438, 0x421, 0x435, 0x432, 0x435, 0x440, 0x43d, 0x430, 0x20, 0x41c, 0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d, 0x438, 0x458,
+0x430, 0x4d, 0x61, 0x6c, 0x61, 0x67, 0x61, 0x73, 0x79, 0x4d, 0x61, 0x64, 0x61, 0x67, 0x61, 0x73, 0x69, 0x6b, 0x61, 0x72,
+0x61, 0x4d, 0x65, 0x6c, 0x61, 0x79, 0x75, 0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x75,
+0x72, 0x61, 0xd2e, 0xd32, 0xd2f, 0xd3e, 0xd33, 0xd02, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f, 0x4d, 0x61, 0x6c, 0x74, 0x69, 0x4d,
+0x101, 0x6f, 0x72, 0x69, 0x41, 0x6f, 0x74, 0x65, 0x61, 0x72, 0x6f, 0x61, 0x92e, 0x930, 0x93e, 0x920, 0x940, 0x43c, 0x43e, 0x43d,
+0x433, 0x43e, 0x43b, 0x41c, 0x43e, 0x43d, 0x433, 0x43e, 0x43b, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x940, 0x928, 0x947, 0x92a, 0x93e, 0x932,
+0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x20, 0x62, 0x6f, 0x6b, 0x6d, 0xe5, 0x6c, 0x4e, 0x6f, 0x72, 0x67, 0x65, 0x53, 0x76, 0x61,
+0x6c, 0x62, 0x61, 0x72, 0x64, 0x20, 0x6f, 0x67, 0x20, 0x4a, 0x61, 0x6e, 0x20, 0x4d, 0x61, 0x79, 0x65, 0x6e, 0xb13, 0xb21,
+0xb3c, 0xb3f, 0xb06, 0xb2d, 0xb3e, 0xb30, 0xb24, 0x67e, 0x69a, 0x62a, 0x648, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633, 0x62a, 0x627, 0x646,
+0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x641, 0x627, 0x631, 0x633, 0x6cc, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x62f, 0x631, 0x6cc,
+0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x50, 0x6f, 0x6c, 0x73, 0x6b, 0x61, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x67, 0x75, 0xea,
+0x73, 0x42, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x41, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x43, 0x61, 0x62, 0x6f, 0x20, 0x56, 0x65,
+0x72, 0x64, 0x65, 0x54, 0x69, 0x6d, 0x6f, 0x72, 0x2d, 0x4c, 0x65, 0x73, 0x74, 0x65, 0x47, 0x75, 0x69, 0x6e, 0xe9, 0x20,
+0x45, 0x71, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x61, 0x6c, 0x47, 0x75, 0x69, 0x6e, 0xe9, 0x2d, 0x42, 0x69, 0x73, 0x73,
+0x61, 0x75, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62, 0x75, 0x72, 0x67, 0x6f, 0x4d, 0x61, 0x63, 0x61, 0x75, 0x2c, 0x20, 0x52,
+0x41, 0x45, 0x20, 0x64, 0x61, 0x20, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x4d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x71, 0x75,
+0x65, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x67, 0x75, 0xea, 0x73, 0x20, 0x65, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x75, 0x50, 0x6f,
+0x72, 0x74, 0x75, 0x67, 0x61, 0x6c, 0x53, 0xe3, 0x6f, 0x20, 0x54, 0x6f, 0x6d, 0xe9, 0x20, 0x65, 0x20, 0x50, 0x72, 0xed,
+0x6e, 0x63, 0x69, 0x70, 0x65, 0x53, 0x75, 0xed, 0xe7, 0x61, 0xa2a, 0xa70, 0xa1c, 0xa3e, 0xa2c, 0xa40, 0xa2d, 0xa3e, 0xa30, 0xa24,
+0x67e, 0x646, 0x62c, 0x627, 0x628, 0x6cc, 0x52, 0x75, 0x6e, 0x61, 0x73, 0x69, 0x6d, 0x69, 0x50, 0x65, 0x72, 0xfa, 0x42, 0x6f,
+0x6c, 0x69, 0x76, 0x69, 0x61, 0x45, 0x63, 0x75, 0x61, 0x64, 0x6f, 0x72, 0x72, 0x75, 0x6d, 0x61, 0x6e, 0x74, 0x73, 0x63,
+0x68, 0x53, 0x76, 0x69, 0x7a, 0x72, 0x61, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x103, 0x52, 0x6f, 0x6d, 0xe2, 0x6e, 0x69, 0x61,
+0x52, 0x65, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x20, 0x4d, 0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x61, 0x440, 0x443, 0x441,
+0x441, 0x43a, 0x438, 0x439, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x44f, 0x41a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x442, 0x430, 0x43d, 0x41a,
+0x438, 0x440, 0x433, 0x438, 0x437, 0x438, 0x44f, 0x41c, 0x43e, 0x43b, 0x434, 0x43e, 0x432, 0x430, 0x423, 0x43a, 0x440, 0x430, 0x438, 0x43d,
+0x430, 0x53, 0xe4, 0x6e, 0x67, 0xf6, 0x4b, 0xf6, 0x64, 0xf6, 0x72, 0xf6, 0x73, 0xea, 0x73, 0x65, 0x20, 0x74, 0xee, 0x20,
+0x42, 0xea, 0x61, 0x66, 0x72, 0xee, 0x6b, 0x61, 0x441, 0x440, 0x43f, 0x441, 0x43a, 0x438, 0x421, 0x440, 0x431, 0x438, 0x458, 0x430,
+0x411, 0x43e, 0x441, 0x43d, 0x430, 0x20, 0x438, 0x20, 0x425, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x438, 0x43d, 0x430, 0x426,
+0x440, 0x43d, 0x430, 0x20, 0x413, 0x43e, 0x440, 0x430, 0x41a, 0x43e, 0x441, 0x43e, 0x432, 0x43e, 0x73, 0x72, 0x70, 0x73, 0x6b, 0x69,
+0x43, 0x72, 0x6e, 0x61, 0x20, 0x47, 0x6f, 0x72, 0x61, 0x53, 0x72, 0x62, 0x69, 0x6a, 0x61, 0x4b, 0x6f, 0x73, 0x6f, 0x76,
+0x6f, 0x438, 0x440, 0x43e, 0x43d, 0x413, 0x443, 0x44b, 0x440, 0x434, 0x437, 0x44b, 0x441, 0x442, 0x43e, 0x43d, 0x423, 0x4d5, 0x440, 0x4d5,
+0x441, 0x435, 0x63, 0x68, 0x69, 0x53, 0x68, 0x6f, 0x6e, 0x61, 0x633, 0x646, 0x68c, 0x64a, 0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627,
+0x646, 0xdc3, 0xdd2, 0xd82, 0xdc4, 0xdbd, 0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0xdc0, 0x73, 0x6c, 0x6f,
+0x76, 0x65, 0x6e, 0x10d, 0x69, 0x6e, 0x61, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x6f, 0x73, 0x6c, 0x6f, 0x76,
+0x65, 0x6e, 0x161, 0x10d, 0x69, 0x6e, 0x61, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x69, 0x6a, 0x61, 0x53, 0x6f, 0x6f, 0x6d,
+0x61, 0x61, 0x6c, 0x69, 0x53, 0x6f, 0x6f, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x79, 0x61, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74,
+0x69, 0x49, 0x74, 0x6f, 0x6f, 0x62, 0x69, 0x79, 0x61, 0x65, 0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x20,
+0x45, 0x73, 0x70, 0x61, 0xf1, 0x61, 0x65, 0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69,
+0x6e, 0x61, 0x42, 0x65, 0x6c, 0x69, 0x63, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69,
+0x61, 0x43, 0x6f, 0x73, 0x74, 0x61, 0x20, 0x52, 0x69, 0x63, 0x61, 0x43, 0x75, 0x62, 0x61, 0x52, 0x65, 0x70, 0xfa, 0x62,
+0x6c, 0x69, 0x63, 0x61, 0x20, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x61, 0x6e, 0x61, 0x45, 0x6c, 0x20, 0x53, 0x61,
+0x6c, 0x76, 0x61, 0x64, 0x6f, 0x72, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x20, 0x45, 0x63, 0x75, 0x61, 0x74, 0x6f, 0x72,
+0x69, 0x61, 0x6c, 0x47, 0x75, 0x61, 0x74, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x48, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x61, 0x73,
+0x65, 0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x20, 0x4d, 0xe9, 0x78, 0x69, 0x63, 0x6f, 0x4d, 0xe9, 0x78,
+0x69, 0x63, 0x6f, 0x4e, 0x69, 0x63, 0x61, 0x72, 0x61, 0x67, 0x75, 0x61, 0x50, 0x61, 0x6e, 0x61, 0x6d, 0xe1, 0x50, 0x61,
+0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x46, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x61, 0x73, 0x45, 0x73, 0x74, 0x61, 0x64,
+0x6f, 0x73, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73, 0x55, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x56, 0x65, 0x6e, 0x65,
+0x7a, 0x75, 0x65, 0x6c, 0x61, 0x43, 0x61, 0x6e, 0x61, 0x72, 0x69, 0x61, 0x73, 0x65, 0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c,
+0x20, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x6f, 0x61, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x4c, 0x61, 0x74, 0x69,
+0x6e, 0x6f, 0x61, 0x6d, 0xe9, 0x72, 0x69, 0x63, 0x61, 0x43, 0x65, 0x75, 0x74, 0x61, 0x20, 0x79, 0x20, 0x4d, 0x65, 0x6c,
+0x69, 0x6c, 0x6c, 0x61, 0x4b, 0x69, 0x73, 0x77, 0x61, 0x68, 0x69, 0x6c, 0x69, 0x4a, 0x61, 0x6d, 0x68, 0x75, 0x72, 0x69,
+0x20, 0x79, 0x61, 0x20, 0x4b, 0x69, 0x64, 0x65, 0x6d, 0x6f, 0x6b, 0x72, 0x61, 0x73, 0x69, 0x61, 0x20, 0x79, 0x61, 0x20,
+0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0x53, 0x76, 0x65, 0x72, 0x69, 0x67, 0x65, 0xc5,
+0x6c, 0x61, 0x6e, 0x64, 0x442, 0x43e, 0x4b7, 0x438, 0x43a, 0x4e3, 0x422, 0x43e, 0x4b7, 0x438, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d,
+0xba4, 0xbae, 0xbbf, 0xbb4, 0xbcd, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0xbbe, 0xbae, 0xbb2, 0xbc7, 0xb9a, 0xbbf, 0xbaf, 0xbbe, 0xb9a,
+0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0xb87, 0xbb2, 0xb99, 0xbcd, 0xb95, 0xbc8, 0x442, 0x430, 0x442, 0x430,
+0x440, 0xc24, 0xc46, 0xc32, 0xc41, 0xc17, 0xc41, 0xc2d, 0xc3e, 0xc30, 0xc24, 0xc26, 0xc47, 0xc36, 0xc02, 0xe44, 0xe17, 0xe22, 0xf56, 0xf7c,
+0xf51, 0xf0b, 0xf66, 0xf90, 0xf51, 0xf0b, 0xf62, 0xf92, 0xfb1, 0xf0b, 0xf53, 0xf42, 0xf62, 0xf92, 0xfb1, 0xf0b, 0xf42, 0xf62, 0xf0b, 0x1275,
+0x130d, 0x122d, 0x129b, 0x12a4, 0x122d, 0x1275, 0x122b, 0x6c, 0x65, 0x61, 0x20, 0x66, 0x61, 0x6b, 0x61, 0x74, 0x6f, 0x6e, 0x67, 0x61,
+0x54, 0xfc, 0x72, 0x6b, 0xe7, 0x65, 0x54, 0xfc, 0x72, 0x6b, 0x69, 0x79, 0x65, 0x4b, 0x131, 0x62, 0x72, 0x131, 0x73, 0x74,
+0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x64, 0x69, 0x6c, 0x69, 0x54, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x69, 0x73,
+0x74, 0x61, 0x6e, 0x626, 0x6c7, 0x64a, 0x63a, 0x6c7, 0x631, 0x686, 0x6d5, 0x62c, 0x6c7, 0x6ad, 0x6af, 0x648, 0x443, 0x43a, 0x440, 0x430,
+0x457, 0x43d, 0x441, 0x44c, 0x43a, 0x430, 0x423, 0x43a, 0x440, 0x430, 0x457, 0x43d, 0x430, 0x627, 0x631, 0x62f, 0x648, 0x628, 0x6be, 0x627,
+0x631, 0x62a, 0x6f, 0x2018, 0x7a, 0x62, 0x65, 0x6b, 0x4f, 0x2bb, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73, 0x74, 0x6f, 0x6e, 0x627,
+0x648, 0x632, 0x628, 0x6cc, 0x6a9, 0x45e, 0x437, 0x431, 0x435, 0x43a, 0x447, 0x430, 0x40e, 0x437, 0x431, 0x435, 0x43a, 0x438, 0x441, 0x442,
+0x43e, 0x43d, 0x54, 0x69, 0x1ebf, 0x6e, 0x67, 0x20, 0x56, 0x69, 0x1ec7, 0x74, 0x56, 0x69, 0x1ec7, 0x74, 0x20, 0x4e, 0x61, 0x6d,
+0x56, 0x6f, 0x6c, 0x61, 0x70, 0xfc, 0x6b, 0x43, 0x79, 0x6d, 0x72, 0x61, 0x65, 0x67, 0x59, 0x20, 0x44, 0x65, 0x79, 0x72,
+0x6e, 0x61, 0x73, 0x20, 0x55, 0x6e, 0x65, 0x64, 0x69, 0x67, 0x57, 0x6f, 0x6c, 0x6f, 0x66, 0x53, 0x65, 0x6e, 0x65, 0x67,
+0x61, 0x61, 0x6c, 0x69, 0x73, 0x69, 0x58, 0x68, 0x6f, 0x73, 0x61, 0x65, 0x4d, 0x7a, 0x61, 0x6e, 0x74, 0x73, 0x69, 0x20,
+0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x5d9, 0x5d9, 0x5b4, 0x5d3, 0x5d9, 0x5e9, 0x5d5, 0x5d5, 0x5e2, 0x5dc, 0x5d8, 0xc8, 0x64, 0xe8,
+0x20, 0x59, 0x6f, 0x72, 0xf9, 0x62, 0xe1, 0x4f, 0x72, 0x69, 0x6c, 0x1eb9, 0x300, 0x2d, 0xe8, 0x64, 0xe8, 0x20, 0x4e, 0xe0,
+0xec, 0x6a, 0xed, 0x72, 0xed, 0xe0, 0x4f, 0x72, 0xed, 0x6c, 0x25b, 0x301, 0xe8, 0x64, 0x65, 0x20, 0x42, 0x25b, 0x300, 0x6e,
+0x25b, 0x300, 0x69, 0x73, 0x69, 0x5a, 0x75, 0x6c, 0x75, 0x69, 0x4e, 0x69, 0x6e, 0x67, 0x69, 0x7a, 0x69, 0x6d, 0x75, 0x20,
+0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x6e, 0x79, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x4e, 0x6f, 0x72, 0x65, 0x67, 0x62, 0x6f,
+0x73, 0x61, 0x6e, 0x73, 0x6b, 0x69, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x438, 0x47, 0x61, 0x65, 0x6c, 0x67, 0x45,
+0x6c, 0x6c, 0x61, 0x6e, 0x20, 0x56, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x77, 0x65, 0x6b, 0x52,
+0x79, 0x77, 0x76, 0x61, 0x6e, 0x65, 0x74, 0x68, 0x20, 0x55, 0x6e, 0x79, 0x73, 0x41, 0x6b, 0x61, 0x6e, 0x47, 0x61, 0x61,
+0x6e, 0x61, 0x915, 0x94b, 0x902, 0x915, 0x923, 0x940, 0x41, 0x73, 0x1ee5, 0x73, 0x1ee5, 0x20, 0x49, 0x67, 0x62, 0x6f, 0x4e, 0x61,
+0x1ecb, 0x6a, 0x1ecb, 0x72, 0x1ecb, 0x61, 0x4b, 0x69, 0x6b, 0x61, 0x6d, 0x62, 0x61, 0x66, 0x75, 0x72, 0x6c, 0x61, 0x6e, 0x49,
+0x74, 0x61, 0x6c, 0x69, 0x65, 0x45, 0x28b, 0x65, 0x67, 0x62, 0x65, 0x47, 0x68, 0x61, 0x6e, 0x61, 0x20, 0x6e, 0x75, 0x74,
+0x6f, 0x6d, 0x65, 0x54, 0x6f, 0x67, 0x6f, 0x20, 0x6e, 0x75, 0x74, 0x6f, 0x6d, 0x65, 0x2bb, 0x14c, 0x6c, 0x65, 0x6c, 0x6f,
+0x20, 0x48, 0x61, 0x77, 0x61, 0x69, 0x2bb, 0x69, 0x2bb, 0x41, 0x6d, 0x65, 0x6c, 0x69, 0x6b, 0x61, 0x20, 0x48, 0x75, 0x69,
+0x20, 0x50, 0x16b, 0x20, 0x2bb, 0x49, 0x61, 0x46, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x6f, 0x50, 0x69, 0x6c, 0x69, 0x70,
+0x69, 0x6e, 0x61, 0x73, 0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x74, 0xfc, 0xfc, 0x74, 0x73, 0x63, 0x68,
+0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x72, 0x69, 0x69, 0x63, 0x68, 0x4c, 0x69, 0xe4,
+0x63, 0x68, 0x74, 0x65, 0x73, 0x63, 0x68, 0x74, 0xe4, 0x69, 0xa188, 0xa320, 0xa259, 0xa34f, 0xa1e9, 0x4e, 0x65, 0x64, 0x64, 0x65,
+0x72, 0x73, 0x61, 0x73, 0x73, 0x2019, 0x73, 0x63, 0x68, 0x44, 0xfc, 0xfc, 0x74, 0x73, 0x63, 0x68, 0x6c, 0x61, 0x6e, 0x64,
+0x4e, 0x65, 0x64, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x6e, 0x64, 0x61, 0x76, 0x76, 0x69, 0x73, 0xe1, 0x6d,
+0x65, 0x67, 0x69, 0x65, 0x6c, 0x6c, 0x61, 0x4e, 0x6f, 0x72, 0x67, 0x61, 0x53, 0x75, 0x6f, 0x70, 0x6d, 0x61, 0x52, 0x75,
+0x6f, 0x167, 0x167, 0x61, 0x45, 0x6b, 0x65, 0x67, 0x75, 0x73, 0x69, 0x69, 0x4b, 0x69, 0x74, 0x61, 0x69, 0x74, 0x61, 0x50,
+0x75, 0x6c, 0x61, 0x61, 0x72, 0x42, 0x75, 0x72, 0x6b, 0x69, 0x62, 0x61, 0x61, 0x20, 0x46, 0x61, 0x61, 0x73, 0x6f, 0x4b,
+0x61, 0x6d, 0x65, 0x72, 0x75, 0x75, 0x6e, 0x47, 0x61, 0x6d, 0x6d, 0x62, 0x69, 0x47, 0x61, 0x6e, 0x61, 0x61, 0x47, 0x69,
+0x6e, 0x65, 0x47, 0x69, 0x6e, 0x65, 0x2d, 0x42, 0x69, 0x73, 0x61, 0x61, 0x77, 0x6f, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69,
+0x79, 0x61, 0x61, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x4e, 0x69, 0x6a, 0x65, 0x65, 0x72, 0x4e, 0x69, 0x6a,
+0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x53, 0x65, 0x72, 0x61, 0x61, 0x20, 0x6c, 0x69, 0x79, 0x6f, 0x6e, 0x47, 0x69, 0x6b,
+0x75, 0x79, 0x75, 0x4b, 0x69, 0x73, 0x61, 0x6d, 0x70, 0x75, 0x72, 0x73, 0x65, 0x6e, 0x61, 0x69, 0x73, 0x69, 0x4e, 0x64,
+0x65, 0x62, 0x65, 0x6c, 0x65, 0x4b, 0x69, 0x68, 0x6f, 0x72, 0x6f, 0x6d, 0x62, 0x6f, 0x2d5c, 0x2d30, 0x2d5b, 0x2d4d, 0x2d43, 0x2d49,
+0x2d5c, 0x2d4d, 0x2d4e, 0x2d56, 0x2d54, 0x2d49, 0x2d31, 0x54, 0x61, 0x73, 0x68, 0x65, 0x6c, 0x1e25, 0x69, 0x79, 0x74, 0x6c, 0x6d, 0x263,
+0x72, 0x69, 0x62, 0x54, 0x61, 0x71, 0x62, 0x61, 0x79, 0x6c, 0x69, 0x74, 0x4c, 0x65, 0x7a, 0x7a, 0x61, 0x79, 0x65, 0x72,
+0x52, 0x75, 0x6e, 0x79, 0x61, 0x6e, 0x6b, 0x6f, 0x72, 0x65, 0x48, 0x69, 0x62, 0x65, 0x6e, 0x61, 0x48, 0x75, 0x74, 0x61,
+0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x4b, 0x79, 0x69, 0x76, 0x75, 0x6e, 0x6a, 0x6f, 0x62, 0x61, 0x6d, 0x61, 0x6e, 0x61,
+0x6b, 0x61, 0x6e, 0x4b, 0x129, 0x65, 0x6d, 0x62, 0x75, 0x13e3, 0x13b3, 0x13a9, 0x13cc, 0x13ca, 0x20, 0x13a2, 0x13f3, 0x13be, 0x13b5, 0x13cd,
+0x13d4, 0x13c5, 0x20, 0x13cd, 0x13a6, 0x13da, 0x13a9, 0x6b, 0x72, 0x65, 0x6f, 0x6c, 0x20, 0x6d, 0x6f, 0x72, 0x69, 0x73, 0x69, 0x65,
+0x6e, 0x4d, 0x6f, 0x72, 0x69, 0x73, 0x43, 0x68, 0x69, 0x6d, 0x61, 0x6b, 0x6f, 0x6e, 0x64, 0x65, 0x4b, 0x268, 0x6c, 0x61,
+0x61, 0x6e, 0x67, 0x69, 0x54, 0x61, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0xed, 0x61, 0x4c, 0x75, 0x67, 0x61, 0x6e, 0x64, 0x61,
+0x59, 0x75, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x49, 0x63, 0x68, 0x69, 0x62, 0x65, 0x6d, 0x62, 0x61, 0x6b, 0x61, 0x62, 0x75,
+0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x75, 0x4b, 0x61, 0x62, 0x75, 0x20, 0x56, 0x65, 0x72, 0x64, 0x69, 0x4b, 0x129,
+0x6d, 0x129, 0x72, 0x169, 0x4b, 0x61, 0x6c, 0x65, 0x6e, 0x6a, 0x69, 0x6e, 0x45, 0x6d, 0x65, 0x74, 0x61, 0x62, 0x20, 0x4b,
+0x65, 0x6e, 0x79, 0x61, 0x4b, 0x68, 0x6f, 0x65, 0x6b, 0x68, 0x6f, 0x65, 0x67, 0x6f, 0x77, 0x61, 0x62, 0x4e, 0x61, 0x6d,
+0x69, 0x62, 0x69, 0x61, 0x62, 0x4b, 0x69, 0x6d, 0x61, 0x63, 0x68, 0x61, 0x6d, 0x65, 0x4b, 0xf6, 0x6c, 0x73, 0x63, 0x68,
+0x44, 0x6f, 0xfc, 0x74, 0x73, 0x63, 0x68, 0x6c, 0x61, 0x6e, 0x64, 0x4d, 0x61, 0x61, 0x54, 0x61, 0x6e, 0x73, 0x61, 0x6e,
+0x69, 0x61, 0x4f, 0x6c, 0x75, 0x73, 0x6f, 0x67, 0x61, 0x4c, 0x75, 0x6c, 0x75, 0x68, 0x69, 0x61, 0x4b, 0x69, 0x70, 0x61,
+0x72, 0x65, 0x54, 0x61, 0x64, 0x68, 0x61, 0x6e, 0x69, 0x61, 0x4b, 0x69, 0x74, 0x65, 0x73, 0x6f, 0x4b, 0x65, 0x6e, 0x69,
+0x61, 0x4b, 0x6f, 0x79, 0x72, 0x61, 0x20, 0x63, 0x69, 0x69, 0x6e, 0x69, 0x4d, 0x61, 0x61, 0x6c, 0x69, 0x4b, 0x69, 0x72,
+0x75, 0x77, 0x61, 0x44, 0x68, 0x6f, 0x6c, 0x75, 0x6f, 0x52, 0x75, 0x6b, 0x69, 0x67, 0x61, 0x54, 0x61, 0x6d, 0x61, 0x7a,
+0x69, 0x263, 0x74, 0x20, 0x6e, 0x20, 0x6c, 0x61, 0x1e6d, 0x6c, 0x61, 0x1e63, 0x4d, 0x65, 0x1e5b, 0x1e5b, 0x75, 0x6b, 0x4b, 0x6f,
+0x79, 0x72, 0x61, 0x62, 0x6f, 0x72, 0x6f, 0x20, 0x73, 0x65, 0x6e, 0x6e, 0x69, 0x4b, 0x69, 0x73, 0x68, 0x61, 0x6d, 0x62,
+0x61, 0x61, 0x92c, 0x921, 0x93c, 0x94b, 0x43d, 0x43e, 0x445, 0x447, 0x438, 0x439, 0x43d, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x446, 0x435,
+0x440, 0x43a, 0x43e, 0x432, 0x43d, 0x43e, 0x441, 0x43b, 0x43e, 0x432, 0x435, 0x301, 0x43d, 0x441, 0x43a, 0x457, 0x439, 0x440, 0x461, 0x441,
+0x441, 0x456, 0x301, 0x430, 0x54, 0x73, 0x68, 0x69, 0x6c, 0x75, 0x62, 0x61, 0x44, 0x69, 0x74, 0x75, 0x6e, 0x67, 0x61, 0x20,
+0x77, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x75, 0x4c, 0xeb, 0x74, 0x7a, 0x65, 0x62, 0x75, 0x65, 0x72, 0x67, 0x65, 0x73,
+0x63, 0x68, 0x4c, 0xeb, 0x74, 0x7a, 0x65, 0x62, 0x75, 0x65, 0x72, 0x67, 0x41, 0x67, 0x68, 0x65, 0x6d, 0x4b, 0xe0, 0x6d,
+0xe0, 0x6c, 0xfb, 0x14b, 0x181, 0xe0, 0x73, 0xe0, 0x61, 0x4b, 0xe0, 0x6d, 0x25b, 0x300, 0x72, 0xfb, 0x6e, 0x5a, 0x61, 0x72,
+0x6d, 0x61, 0x63, 0x69, 0x69, 0x6e, 0x65, 0x4e, 0x69, 0x17e, 0x65, 0x72, 0x64, 0x75, 0xe1, 0x6c, 0xe1, 0x6a, 0x6f, 0x6f,
+0x6c, 0x61, 0x53, 0x65, 0x6e, 0x65, 0x67, 0x61, 0x6c, 0x65, 0x77, 0x6f, 0x6e, 0x64, 0x6f, 0x4b, 0x61, 0x6d, 0x259, 0x72,
+0xfa, 0x6e, 0x72, 0x69, 0x6b, 0x70, 0x61, 0x6b, 0x61, 0x6d, 0x25b, 0x72, 0xfa, 0x6e, 0x4d, 0x61, 0x6b, 0x75, 0x61, 0x55,
+0x6d, 0x6f, 0x7a, 0x61, 0x6d, 0x62, 0x69, 0x6b, 0x69, 0x4d, 0x55, 0x4e, 0x44, 0x41, 0x14a, 0x6b, 0x61, 0x6d, 0x65, 0x72,
+0x75, 0x14b, 0x4b, 0x77, 0x61, 0x73, 0x69, 0x6f, 0x4b, 0x61, 0x6d, 0x65, 0x72, 0x75, 0x6e, 0x54, 0x68, 0x6f, 0x6b, 0x20,
+0x4e, 0x61, 0x74, 0x68, 0x441, 0x430, 0x445, 0x430, 0x20, 0x442, 0x44b, 0x43b, 0x430, 0x410, 0x440, 0x430, 0x441, 0x441, 0x44b, 0x44b,
+0x439, 0x430, 0x49, 0x73, 0x68, 0x69, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x54, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x79, 0x61,
+0x54, 0x61, 0x73, 0x61, 0x77, 0x61, 0x71, 0x20, 0x73, 0x65, 0x6e, 0x6e, 0x69, 0xa559, 0xa524, 0xa55e, 0xa524, 0xa52b, 0xa569, 0x56,
+0x61, 0x69, 0x4c, 0x61, 0x69, 0x62, 0x68, 0x69, 0x79, 0x61, 0x57, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x53, 0x63, 0x68, 0x77,
+0x69, 0x7a, 0x6e, 0x75, 0x61, 0x73, 0x75, 0x65, 0x4b, 0x65, 0x6d, 0x65, 0x6c, 0xfa, 0x6e, 0x61, 0x73, 0x74, 0x75, 0x72,
+0x69, 0x61, 0x6e, 0x75, 0x4e, 0x64, 0x61, 0xa78c, 0x61, 0x4b, 0x61, 0x6d, 0x25b, 0x6c, 0xfb, 0x6e, 0x6b, 0x61, 0x6b, 0x254,
+0x4b, 0x61, 0x6d, 0x25b, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x61, 0x2bc, 0x4b, 0x61, 0x6d, 0x61, 0x6c, 0x75, 0x6e, 0x53,
+0x68, 0x77, 0xf3, 0x14b, 0xf2, 0x20, 0x6e, 0x67, 0x69, 0x65, 0x6d, 0x62, 0x254, 0x254, 0x6e, 0x4b, 0xe0, 0x6d, 0x61, 0x6c,
+0xfb, 0x6d, 0x4c, 0x61, 0x6b, 0x21f, 0xf3, 0x6c, 0x2bc, 0x69, 0x79, 0x61, 0x70, 0x69, 0x4d, 0xed, 0x6c, 0x61, 0x68, 0x61,
+0x14b, 0x73, 0x6b, 0x61, 0x20, 0x54, 0x21f, 0x61, 0x6d, 0xe1, 0x6b, 0x21f, 0x6f, 0x10d, 0x68, 0x65, 0x2d5c, 0x2d30, 0x2d4e, 0x2d30,
+0x2d63, 0x2d49, 0x2d56, 0x2d5c, 0x6a9, 0x648, 0x631, 0x62f, 0x6cc, 0x6cc, 0x20, 0x646, 0x627, 0x648, 0x6d5, 0x646, 0x62f, 0x6cc, 0x639, 0x6ce,
+0x631, 0x627, 0x642, 0x626, 0x6ce, 0x631, 0x627, 0x646, 0x64, 0x6f, 0x6c, 0x6e, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x161, 0x107, 0x69,
+0x6e, 0x61, 0x4e, 0x69, 0x6d, 0x73, 0x6b, 0x61, 0x68, 0x6f, 0x72, 0x6e, 0x6a, 0x6f, 0x73, 0x65, 0x72, 0x62, 0x161, 0x107,
+0x69, 0x6e, 0x61, 0x4e, 0x11b, 0x6d, 0x73, 0x6b, 0x61, 0x70, 0x72, 0x16b, 0x73, 0x69, 0x73, 0x6b, 0x61, 0x6e, 0x73, 0x77,
+0x12b, 0x74, 0x61, 0x69, 0x61, 0x6e, 0x61, 0x72, 0xe2, 0x161, 0x6b, 0x69, 0x65, 0x6c, 0xe2, 0x53, 0x75, 0x6f, 0x6d, 0xe2,
+0x645, 0x627, 0x632, 0x631, 0x648, 0x646, 0x6cc, 0x644, 0x6ca, 0x631, 0x6cc, 0x20, 0x634, 0x648, 0x645, 0x627, 0x644, 0x6cc, 0x7cb5, 0x8a9e,
+0x4e2d, 0x83ef, 0x4eba, 0x6c11, 0x5171, 0x548c, 0x570b, 0x9999, 0x6e2f, 0x7279, 0x5225, 0x884c, 0x653f, 0x5340, 0x7ca4, 0x8bed, 0x4e2d, 0x534e, 0x4eba, 0x6c11,
+0x5171, 0x548c, 0x56fd, 0x42, 0x69, 0x6e, 0x69, 0x73, 0x61, 0x79, 0x61
+};
+
+static const char language_name_list[] =
+"Default\0"
+"C\0"
+"Abkhazian\0"
+"Oromo\0"
+"Afar\0"
+"Afrikaans\0"
+"Albanian\0"
+"Amharic\0"
+"Arabic\0"
+"Armenian\0"
+"Assamese\0"
+"Aymara\0"
+"Azerbaijani\0"
+"Bashkir\0"
+"Basque\0"
+"Bengali\0"
+"Dzongkha\0"
+"Bihari\0"
+"Bislama\0"
+"Breton\0"
+"Bulgarian\0"
+"Burmese\0"
+"Belarusian\0"
+"Khmer\0"
+"Catalan\0"
+"Chinese\0"
+"Corsican\0"
+"Croatian\0"
+"Czech\0"
+"Danish\0"
+"Dutch\0"
+"English\0"
+"Esperanto\0"
+"Estonian\0"
+"Faroese\0"
+"Fijian\0"
+"Finnish\0"
+"French\0"
+"Western Frisian\0"
+"Gaelic\0"
+"Galician\0"
+"Georgian\0"
+"German\0"
+"Greek\0"
+"Greenlandic\0"
+"Guarani\0"
+"Gujarati\0"
+"Hausa\0"
+"Hebrew\0"
+"Hindi\0"
+"Hungarian\0"
+"Icelandic\0"
+"Indonesian\0"
+"Interlingua\0"
+"Interlingue\0"
+"Inuktitut\0"
+"Inupiak\0"
+"Irish\0"
+"Italian\0"
+"Japanese\0"
+"Javanese\0"
+"Kannada\0"
+"Kashmiri\0"
+"Kazakh\0"
+"Kinyarwanda\0"
+"Kirghiz\0"
+"Korean\0"
+"Kurdish\0"
+"Rundi\0"
+"Lao\0"
+"Latin\0"
+"Latvian\0"
+"Lingala\0"
+"Lithuanian\0"
+"Macedonian\0"
+"Malagasy\0"
+"Malay\0"
+"Malayalam\0"
+"Maltese\0"
+"Maori\0"
+"Marathi\0"
+"Marshallese\0"
+"Mongolian\0"
+"Nauru\0"
+"Nepali\0"
+"Norwegian Bokmal\0"
+"Occitan\0"
+"Oriya\0"
+"Pashto\0"
+"Persian\0"
+"Polish\0"
+"Portuguese\0"
+"Punjabi\0"
+"Quechua\0"
+"Romansh\0"
+"Romanian\0"
+"Russian\0"
+"Samoan\0"
+"Sango\0"
+"Sanskrit\0"
+"Serbian\0"
+"Ossetic\0"
+"Southern Sotho\0"
+"Tswana\0"
+"Shona\0"
+"Sindhi\0"
+"Sinhala\0"
+"Swati\0"
+"Slovak\0"
+"Slovenian\0"
+"Somali\0"
+"Spanish\0"
+"Sundanese\0"
+"Swahili\0"
+"Swedish\0"
+"Sardinian\0"
+"Tajik\0"
+"Tamil\0"
+"Tatar\0"
+"Telugu\0"
+"Thai\0"
+"Tibetan\0"
+"Tigrinya\0"
+"Tongan\0"
+"Tsonga\0"
+"Turkish\0"
+"Turkmen\0"
+"Tahitian\0"
+"Uighur\0"
+"Ukrainian\0"
+"Urdu\0"
+"Uzbek\0"
+"Vietnamese\0"
+"Volapuk\0"
+"Welsh\0"
+"Wolof\0"
+"Xhosa\0"
+"Yiddish\0"
+"Yoruba\0"
+"Zhuang\0"
+"Zulu\0"
+"Norwegian Nynorsk\0"
+"Bosnian\0"
+"Divehi\0"
+"Manx\0"
+"Cornish\0"
+"Akan\0"
+"Konkani\0"
+"Ga\0"
+"Igbo\0"
+"Kamba\0"
+"Syriac\0"
+"Blin\0"
+"Geez\0"
+"Koro\0"
+"Sidamo\0"
+"Atsam\0"
+"Tigre\0"
+"Jju\0"
+"Friulian\0"
+"Venda\0"
+"Ewe\0"
+"Walamo\0"
+"Hawaiian\0"
+"Tyap\0"
+"Nyanja\0"
+"Filipino\0"
+"Swiss German\0"
+"Sichuan Yi\0"
+"Kpelle\0"
+"Low German\0"
+"South Ndebele\0"
+"Northern Sotho\0"
+"Northern Sami\0"
+"Taroko\0"
+"Gusii\0"
+"Taita\0"
+"Fulah\0"
+"Kikuyu\0"
+"Samburu\0"
+"Sena\0"
+"North Ndebele\0"
+"Rombo\0"
+"Tachelhit\0"
+"Kabyle\0"
+"Nyankole\0"
+"Bena\0"
+"Vunjo\0"
+"Bambara\0"
+"Embu\0"
+"Cherokee\0"
+"Morisyen\0"
+"Makonde\0"
+"Langi\0"
+"Ganda\0"
+"Bemba\0"
+"Kabuverdianu\0"
+"Meru\0"
+"Kalenjin\0"
+"Nama\0"
+"Machame\0"
+"Colognian\0"
+"Masai\0"
+"Soga\0"
+"Luyia\0"
+"Asu\0"
+"Teso\0"
+"Saho\0"
+"Koyra Chiini\0"
+"Rwa\0"
+"Luo\0"
+"Chiga\0"
+"Central Morocco Tamazight\0"
+"Koyraboro Senni\0"
+"Shambala\0"
+"Bodo\0"
+"Avaric\0"
+"Chamorro\0"
+"Chechen\0"
+"Church\0"
+"Chuvash\0"
+"Cree\0"
+"Haitian\0"
+"Herero\0"
+"Hiri Motu\0"
+"Kanuri\0"
+"Komi\0"
+"Kongo\0"
+"Kwanyama\0"
+"Limburgish\0"
+"Luba Katanga\0"
+"Luxembourgish\0"
+"Navaho\0"
+"Ndonga\0"
+"Ojibwa\0"
+"Pali\0"
+"Walloon\0"
+"Aghem\0"
+"Basaa\0"
+"Zarma\0"
+"Duala\0"
+"Jola Fonyi\0"
+"Ewondo\0"
+"Bafia\0"
+"Makhuwa Meetto\0"
+"Mundang\0"
+"Kwasio\0"
+"Nuer\0"
+"Sakha\0"
+"Sangu\0"
+"Congo Swahili\0"
+"Tasawaq\0"
+"Vai\0"
+"Walser\0"
+"Yangben\0"
+"Avestan\0"
+"Asturian\0"
+"Ngomba\0"
+"Kako\0"
+"Meta\0"
+"Ngiemboon\0"
+"Aragonese\0"
+"Akkadian\0"
+"Ancient Egyptian\0"
+"Ancient Greek\0"
+"Aramaic\0"
+"Balinese\0"
+"Bamun\0"
+"Batak Toba\0"
+"Buginese\0"
+"Buhid\0"
+"Carian\0"
+"Chakma\0"
+"Classical Mandaic\0"
+"Coptic\0"
+"Dogri\0"
+"Eastern Cham\0"
+"Eastern Kayah\0"
+"Etruscan\0"
+"Gothic\0"
+"Hanunoo\0"
+"Ingush\0"
+"Large Flowery Miao\0"
+"Lepcha\0"
+"Limbu\0"
+"Lisu\0"
+"Lu\0"
+"Lycian\0"
+"Lydian\0"
+"Mandingo\0"
+"Manipuri\0"
+"Meroitic\0"
+"Northern Thai\0"
+"Old Irish\0"
+"Old Norse\0"
+"Old Persian\0"
+"Old Turkish\0"
+"Pahlavi\0"
+"Parthian\0"
+"Phoenician\0"
+"Prakrit Language\0"
+"Rejang\0"
+"Sabaean\0"
+"Samaritan\0"
+"Santali\0"
+"Saurashtra\0"
+"Sora\0"
+"Sylheti\0"
+"Tagbanwa\0"
+"Tai Dam\0"
+"Tai Nua\0"
+"Ugaritic\0"
+"Akoose\0"
+"Lakota\0"
+"Standard Moroccan Tamazight\0"
+"Mapuche\0"
+"Central Kurdish\0"
+"Lower Sorbian\0"
+"Upper Sorbian\0"
+"Kenyang\0"
+"Mohawk\0"
+"Nko\0"
+"Prussian\0"
+"Kiche\0"
+"Southern Sami\0"
+"Lule Sami\0"
+"Inari Sami\0"
+"Skolt Sami\0"
+"Warlpiri\0"
+"Manichaean Middle Persian\0"
+"Mende\0"
+"Ancient North Arabian\0"
+"Linear A\0"
+"Hmong Njua\0"
+"Ho\0"
+"Lezghian\0"
+"Bassa\0"
+"Mono\0"
+"Tedim Chin\0"
+"Maithili\0"
+"Ahom\0"
+"American Sign Language\0"
+"Ardhamagadhi Prakrit\0"
+"Bhojpuri\0"
+"Hieroglyphic Luwian\0"
+"Literary Chinese\0"
+"Mazanderani\0"
+"Mru\0"
+"Newari\0"
+"Northern Luri\0"
+"Palauan\0"
+"Papiamento\0"
+"Saraiki\0"
+"Tokelau\0"
+"Tok Pisin\0"
+"Tuvalu\0"
+"Uncoded Languages\0"
+"Cantonese\0"
+"Osage\0"
+"Tangut\0"
+"Ido\0"
+"Lojban\0"
+"Sicilian\0"
+"Southern Kurdish\0"
+"Western Balochi\0"
+"Cebuano\0"
+"Erzya\0"
+"Chickasaw\0"
+"Muscogee\0"
+"Silesian\0"
+;
+
+static const quint16 language_name_index[] = {
+ 0, // AnyLanguage
+ 8, // C
+ 10, // Abkhazian
+ 20, // Oromo
+ 26, // Afar
+ 31, // Afrikaans
+ 41, // Albanian
+ 50, // Amharic
+ 58, // Arabic
+ 65, // Armenian
+ 74, // Assamese
+ 83, // Aymara
+ 90, // Azerbaijani
+ 102, // Bashkir
+ 110, // Basque
+ 117, // Bengali
+ 125, // Dzongkha
+ 134, // Bihari
+ 141, // Bislama
+ 149, // Breton
+ 156, // Bulgarian
+ 166, // Burmese
+ 174, // Belarusian
+ 185, // Khmer
+ 191, // Catalan
+ 199, // Chinese
+ 207, // Corsican
+ 216, // Croatian
+ 225, // Czech
+ 231, // Danish
+ 238, // Dutch
+ 244, // English
+ 252, // Esperanto
+ 262, // Estonian
+ 271, // Faroese
+ 279, // Fijian
+ 286, // Finnish
+ 294, // French
+ 301, // Western Frisian
+ 317, // Gaelic
+ 324, // Galician
+ 333, // Georgian
+ 342, // German
+ 349, // Greek
+ 355, // Greenlandic
+ 367, // Guarani
+ 375, // Gujarati
+ 384, // Hausa
+ 390, // Hebrew
+ 397, // Hindi
+ 403, // Hungarian
+ 413, // Icelandic
+ 423, // Indonesian
+ 434, // Interlingua
+ 446, // Interlingue
+ 458, // Inuktitut
+ 468, // Inupiak
+ 476, // Irish
+ 482, // Italian
+ 490, // Japanese
+ 499, // Javanese
+ 508, // Kannada
+ 516, // Kashmiri
+ 525, // Kazakh
+ 532, // Kinyarwanda
+ 544, // Kirghiz
+ 552, // Korean
+ 559, // Kurdish
+ 567, // Rundi
+ 573, // Lao
+ 577, // Latin
+ 583, // Latvian
+ 591, // Lingala
+ 599, // Lithuanian
+ 610, // Macedonian
+ 621, // Malagasy
+ 630, // Malay
+ 636, // Malayalam
+ 646, // Maltese
+ 654, // Maori
+ 660, // Marathi
+ 668, // Marshallese
+ 680, // Mongolian
+ 690, // Nauru
+ 696, // Nepali
+ 703, // Norwegian Bokmal
+ 720, // Occitan
+ 728, // Oriya
+ 734, // Pashto
+ 741, // Persian
+ 749, // Polish
+ 756, // Portuguese
+ 767, // Punjabi
+ 775, // Quechua
+ 783, // Romansh
+ 791, // Romanian
+ 800, // Russian
+ 808, // Samoan
+ 815, // Sango
+ 821, // Sanskrit
+ 830, // Serbian
+ 838, // Ossetic
+ 846, // Southern Sotho
+ 861, // Tswana
+ 868, // Shona
+ 874, // Sindhi
+ 881, // Sinhala
+ 889, // Swati
+ 895, // Slovak
+ 902, // Slovenian
+ 912, // Somali
+ 919, // Spanish
+ 927, // Sundanese
+ 937, // Swahili
+ 945, // Swedish
+ 953, // Sardinian
+ 963, // Tajik
+ 969, // Tamil
+ 975, // Tatar
+ 981, // Telugu
+ 988, // Thai
+ 993, // Tibetan
+ 1001, // Tigrinya
+ 1010, // Tongan
+ 1017, // Tsonga
+ 1024, // Turkish
+ 1032, // Turkmen
+ 1040, // Tahitian
+ 1049, // Uighur
+ 1056, // Ukrainian
+ 1066, // Urdu
+ 1071, // Uzbek
+ 1077, // Vietnamese
+ 1088, // Volapuk
+ 1096, // Welsh
+ 1102, // Wolof
+ 1108, // Xhosa
+ 1114, // Yiddish
+ 1122, // Yoruba
+ 1129, // Zhuang
+ 1136, // Zulu
+ 1141, // Norwegian Nynorsk
+ 1159, // Bosnian
+ 1167, // Divehi
+ 1174, // Manx
+ 1179, // Cornish
+ 1187, // Akan
+ 1192, // Konkani
+ 1200, // Ga
+ 1203, // Igbo
+ 1208, // Kamba
+ 1214, // Syriac
+ 1221, // Blin
+ 1226, // Geez
+ 1231, // Koro
+ 1236, // Sidamo
+ 1243, // Atsam
+ 1249, // Tigre
+ 1255, // Jju
+ 1259, // Friulian
+ 1268, // Venda
+ 1274, // Ewe
+ 1278, // Walamo
+ 1285, // Hawaiian
+ 1294, // Tyap
+ 1299, // Nyanja
+ 1306, // Filipino
+ 1315, // Swiss German
+ 1328, // Sichuan Yi
+ 1339, // Kpelle
+ 1346, // Low German
+ 1357, // South Ndebele
+ 1371, // Northern Sotho
+ 1386, // Northern Sami
+ 1400, // Taroko
+ 1407, // Gusii
+ 1413, // Taita
+ 1419, // Fulah
+ 1425, // Kikuyu
+ 1432, // Samburu
+ 1440, // Sena
+ 1445, // North Ndebele
+ 1459, // Rombo
+ 1465, // Tachelhit
+ 1475, // Kabyle
+ 1482, // Nyankole
+ 1491, // Bena
+ 1496, // Vunjo
+ 1502, // Bambara
+ 1510, // Embu
+ 1515, // Cherokee
+ 1524, // Morisyen
+ 1533, // Makonde
+ 1541, // Langi
+ 1547, // Ganda
+ 1553, // Bemba
+ 1559, // Kabuverdianu
+ 1572, // Meru
+ 1577, // Kalenjin
+ 1586, // Nama
+ 1591, // Machame
+ 1599, // Colognian
+ 1609, // Masai
+ 1615, // Soga
+ 1620, // Luyia
+ 1626, // Asu
+ 1630, // Teso
+ 1635, // Saho
+ 1640, // Koyra Chiini
+ 1653, // Rwa
+ 1657, // Luo
+ 1661, // Chiga
+ 1667, // Central Morocco Tamazight
+ 1693, // Koyraboro Senni
+ 1709, // Shambala
+ 1718, // Bodo
+ 1723, // Avaric
+ 1730, // Chamorro
+ 1739, // Chechen
+ 1747, // Church
+ 1754, // Chuvash
+ 1762, // Cree
+ 1767, // Haitian
+ 1775, // Herero
+ 1782, // Hiri Motu
+ 1792, // Kanuri
+ 1799, // Komi
+ 1804, // Kongo
+ 1810, // Kwanyama
+ 1819, // Limburgish
+ 1830, // Luba Katanga
+ 1843, // Luxembourgish
+ 1857, // Navaho
+ 1864, // Ndonga
+ 1871, // Ojibwa
+ 1878, // Pali
+ 1883, // Walloon
+ 1891, // Aghem
+ 1897, // Basaa
+ 1903, // Zarma
+ 1909, // Duala
+ 1915, // Jola Fonyi
+ 1926, // Ewondo
+ 1933, // Bafia
+ 1939, // Makhuwa Meetto
+ 1954, // Mundang
+ 1962, // Kwasio
+ 1969, // Nuer
+ 1974, // Sakha
+ 1980, // Sangu
+ 1986, // Congo Swahili
+ 2000, // Tasawaq
+ 2008, // Vai
+ 2012, // Walser
+ 2019, // Yangben
+ 2027, // Avestan
+ 2035, // Asturian
+ 2044, // Ngomba
+ 2051, // Kako
+ 2056, // Meta
+ 2061, // Ngiemboon
+ 2071, // Aragonese
+ 2081, // Akkadian
+ 2090, // Ancient Egyptian
+ 2107, // Ancient Greek
+ 2121, // Aramaic
+ 2129, // Balinese
+ 2138, // Bamun
+ 2144, // Batak Toba
+ 2155, // Buginese
+ 2164, // Buhid
+ 2170, // Carian
+ 2177, // Chakma
+ 2184, // Classical Mandaic
+ 2202, // Coptic
+ 2209, // Dogri
+ 2215, // Eastern Cham
+ 2228, // Eastern Kayah
+ 2242, // Etruscan
+ 2251, // Gothic
+ 2258, // Hanunoo
+ 2266, // Ingush
+ 2273, // Large Flowery Miao
+ 2292, // Lepcha
+ 2299, // Limbu
+ 2305, // Lisu
+ 2310, // Lu
+ 2313, // Lycian
+ 2320, // Lydian
+ 2327, // Mandingo
+ 2336, // Manipuri
+ 2345, // Meroitic
+ 2354, // Northern Thai
+ 2368, // Old Irish
+ 2378, // Old Norse
+ 2388, // Old Persian
+ 2400, // Old Turkish
+ 2412, // Pahlavi
+ 2420, // Parthian
+ 2429, // Phoenician
+ 2440, // Prakrit Language
+ 2457, // Rejang
+ 2464, // Sabaean
+ 2472, // Samaritan
+ 2482, // Santali
+ 2490, // Saurashtra
+ 2501, // Sora
+ 2506, // Sylheti
+ 2514, // Tagbanwa
+ 2523, // Tai Dam
+ 2531, // Tai Nua
+ 2539, // Ugaritic
+ 2548, // Akoose
+ 2555, // Lakota
+ 2562, // Standard Moroccan Tamazight
+ 2590, // Mapuche
+ 2598, // Central Kurdish
+ 2614, // Lower Sorbian
+ 2628, // Upper Sorbian
+ 2642, // Kenyang
+ 2650, // Mohawk
+ 2657, // Nko
+ 2661, // Prussian
+ 2670, // Kiche
+ 2676, // Southern Sami
+ 2690, // Lule Sami
+ 2700, // Inari Sami
+ 2711, // Skolt Sami
+ 2722, // Warlpiri
+ 2731, // Manichaean Middle Persian
+ 2757, // Mende
+ 2763, // Ancient North Arabian
+ 2785, // Linear A
+ 2794, // Hmong Njua
+ 2805, // Ho
+ 2808, // Lezghian
+ 2817, // Bassa
+ 2823, // Mono
+ 2828, // Tedim Chin
+ 2839, // Maithili
+ 2848, // Ahom
+ 2853, // American Sign Language
+ 2876, // Ardhamagadhi Prakrit
+ 2897, // Bhojpuri
+ 2906, // Hieroglyphic Luwian
+ 2926, // Literary Chinese
+ 2943, // Mazanderani
+ 2955, // Mru
+ 2959, // Newari
+ 2966, // Northern Luri
+ 2980, // Palauan
+ 2988, // Papiamento
+ 2999, // Saraiki
+ 3007, // Tokelau
+ 3015, // Tok Pisin
+ 3025, // Tuvalu
+ 3032, // Uncoded Languages
+ 3050, // Cantonese
+ 3060, // Osage
+ 3066, // Tangut
+ 3073, // Ido
+ 3077, // Lojban
+ 3084, // Sicilian
+ 3093, // Southern Kurdish
+ 3110, // Western Balochi
+ 3126, // Cebuano
+ 3134, // Erzya
+ 3140, // Chickasaw
+ 3150, // Muscogee
+ 3159, // Silesian
+};
+
+static const char script_name_list[] =
+"Default\0"
+"Arabic\0"
+"Cyrillic\0"
+"Deseret\0"
+"Gurmukhi\0"
+"Simplified Han\0"
+"Traditional Han\0"
+"Latin\0"
+"Mongolian\0"
+"Tifinagh\0"
+"Armenian\0"
+"Bengali\0"
+"Cherokee\0"
+"Devanagari\0"
+"Ethiopic\0"
+"Georgian\0"
+"Greek\0"
+"Gujarati\0"
+"Hebrew\0"
+"Japanese\0"
+"Khmer\0"
+"Kannada\0"
+"Korean\0"
+"Lao\0"
+"Malayalam\0"
+"Myanmar\0"
+"Oriya\0"
+"Tamil\0"
+"Telugu\0"
+"Thaana\0"
+"Thai\0"
+"Tibetan\0"
+"Sinhala\0"
+"Syriac\0"
+"Yi\0"
+"Vai\0"
+"Avestan\0"
+"Balinese\0"
+"Bamum\0"
+"Batak\0"
+"Bopomofo\0"
+"Brahmi\0"
+"Buginese\0"
+"Buhid\0"
+"Canadian Aboriginal\0"
+"Carian\0"
+"Chakma\0"
+"Cham\0"
+"Coptic\0"
+"Cypriot\0"
+"Egyptian Hieroglyphs\0"
+"Fraser\0"
+"Glagolitic\0"
+"Gothic\0"
+"Han\0"
+"Hangul\0"
+"Hanunoo\0"
+"Imperial Aramaic\0"
+"Inscriptional Pahlavi\0"
+"Inscriptional Parthian\0"
+"Javanese\0"
+"Kaithi\0"
+"Katakana\0"
+"Kayah Li\0"
+"Kharoshthi\0"
+"Lanna\0"
+"Lepcha\0"
+"Limbu\0"
+"Linear B\0"
+"Lycian\0"
+"Lydian\0"
+"Mandaean\0"
+"Meitei Mayek\0"
+"Meroitic\0"
+"Meroitic Cursive\0"
+"Nko\0"
+"New Tai Lue\0"
+"Ogham\0"
+"Ol Chiki\0"
+"Old Italic\0"
+"Old Persian\0"
+"Old South Arabian\0"
+"Orkhon\0"
+"Osmanya\0"
+"Phags Pa\0"
+"Phoenician\0"
+"Pollard Phonetic\0"
+"Rejang\0"
+"Runic\0"
+"Samaritan\0"
+"Saurashtra\0"
+"Sharada\0"
+"Shavian\0"
+"Sora Sompeng\0"
+"Cuneiform\0"
+"Sundanese\0"
+"Syloti Nagri\0"
+"Tagalog\0"
+"Tagbanwa\0"
+"Tai Le\0"
+"Tai Viet\0"
+"Takri\0"
+"Ugaritic\0"
+"Braille\0"
+"Hiragana\0"
+"Caucasian Albanian\0"
+"Bassa Vah\0"
+"Duployan\0"
+"Elbasan\0"
+"Grantha\0"
+"Pahawh Hmong\0"
+"Khojki\0"
+"Linear A\0"
+"Mahajani\0"
+"Manichaean\0"
+"Mende Kikakui\0"
+"Modi\0"
+"Mro\0"
+"Old North Arabian\0"
+"Nabataean\0"
+"Palmyrene\0"
+"Pau Cin Hau\0"
+"Old Permic\0"
+"Psalter Pahlavi\0"
+"Siddham\0"
+"Khudawadi\0"
+"Tirhuta\0"
+"Varang Kshiti\0"
+"Ahom\0"
+"Anatolian Hieroglyphs\0"
+"Hatran\0"
+"Multani\0"
+"Old Hungarian\0"
+"Sign Writing\0"
+"Adlam\0"
+"Bhaiksuki\0"
+"Marchen\0"
+"Newa\0"
+"Osage\0"
+"Tangut\0"
+"Han with Bopomofo\0"
+"Jamo\0"
+;
+
+static const quint16 script_name_index[] = {
+ 0, // AnyScript
+ 8, // Arabic
+ 15, // Cyrillic
+ 24, // Deseret
+ 32, // Gurmukhi
+ 41, // Simplified Han
+ 56, // Traditional Han
+ 72, // Latin
+ 78, // Mongolian
+ 88, // Tifinagh
+ 97, // Armenian
+ 106, // Bengali
+ 114, // Cherokee
+ 123, // Devanagari
+ 134, // Ethiopic
+ 143, // Georgian
+ 152, // Greek
+ 158, // Gujarati
+ 167, // Hebrew
+ 174, // Japanese
+ 183, // Khmer
+ 189, // Kannada
+ 197, // Korean
+ 204, // Lao
+ 208, // Malayalam
+ 218, // Myanmar
+ 226, // Oriya
+ 232, // Tamil
+ 238, // Telugu
+ 245, // Thaana
+ 252, // Thai
+ 257, // Tibetan
+ 265, // Sinhala
+ 273, // Syriac
+ 280, // Yi
+ 283, // Vai
+ 287, // Avestan
+ 295, // Balinese
+ 304, // Bamum
+ 310, // Batak
+ 316, // Bopomofo
+ 325, // Brahmi
+ 332, // Buginese
+ 341, // Buhid
+ 347, // Canadian Aboriginal
+ 367, // Carian
+ 374, // Chakma
+ 381, // Cham
+ 386, // Coptic
+ 393, // Cypriot
+ 401, // Egyptian Hieroglyphs
+ 422, // Fraser
+ 429, // Glagolitic
+ 440, // Gothic
+ 447, // Han
+ 451, // Hangul
+ 458, // Hanunoo
+ 466, // Imperial Aramaic
+ 483, // Inscriptional Pahlavi
+ 505, // Inscriptional Parthian
+ 528, // Javanese
+ 537, // Kaithi
+ 544, // Katakana
+ 553, // Kayah Li
+ 562, // Kharoshthi
+ 573, // Lanna
+ 579, // Lepcha
+ 586, // Limbu
+ 592, // Linear B
+ 601, // Lycian
+ 608, // Lydian
+ 615, // Mandaean
+ 624, // Meitei Mayek
+ 637, // Meroitic
+ 646, // Meroitic Cursive
+ 663, // Nko
+ 667, // New Tai Lue
+ 679, // Ogham
+ 685, // Ol Chiki
+ 694, // Old Italic
+ 705, // Old Persian
+ 717, // Old South Arabian
+ 735, // Orkhon
+ 742, // Osmanya
+ 750, // Phags Pa
+ 759, // Phoenician
+ 770, // Pollard Phonetic
+ 787, // Rejang
+ 794, // Runic
+ 800, // Samaritan
+ 810, // Saurashtra
+ 821, // Sharada
+ 829, // Shavian
+ 837, // Sora Sompeng
+ 850, // Cuneiform
+ 860, // Sundanese
+ 870, // Syloti Nagri
+ 883, // Tagalog
+ 891, // Tagbanwa
+ 900, // Tai Le
+ 907, // Tai Viet
+ 916, // Takri
+ 922, // Ugaritic
+ 931, // Braille
+ 939, // Hiragana
+ 948, // Caucasian Albanian
+ 967, // Bassa Vah
+ 977, // Duployan
+ 986, // Elbasan
+ 994, // Grantha
+ 1002, // Pahawh Hmong
+ 1015, // Khojki
+ 1022, // Linear A
+ 1031, // Mahajani
+ 1040, // Manichaean
+ 1051, // Mende Kikakui
+ 1065, // Modi
+ 1070, // Mro
+ 1074, // Old North Arabian
+ 1092, // Nabataean
+ 1102, // Palmyrene
+ 1112, // Pau Cin Hau
+ 1124, // Old Permic
+ 1135, // Psalter Pahlavi
+ 1151, // Siddham
+ 1159, // Khudawadi
+ 1169, // Tirhuta
+ 1177, // Varang Kshiti
+ 1191, // Ahom
+ 1196, // Anatolian Hieroglyphs
+ 1218, // Hatran
+ 1225, // Multani
+ 1233, // Old Hungarian
+ 1247, // Sign Writing
+ 1260, // Adlam
+ 1266, // Bhaiksuki
+ 1276, // Marchen
+ 1284, // Newa
+ 1289, // Osage
+ 1295, // Tangut
+ 1302, // Han with Bopomofo
+ 1320, // Jamo
+};
+
+static const char country_name_list[] =
+"Default\0"
+"Afghanistan\0"
+"Albania\0"
+"Algeria\0"
+"American Samoa\0"
+"Andorra\0"
+"Angola\0"
+"Anguilla\0"
+"Antarctica\0"
+"Antigua And Barbuda\0"
+"Argentina\0"
+"Armenia\0"
+"Aruba\0"
+"Australia\0"
+"Austria\0"
+"Azerbaijan\0"
+"Bahamas\0"
+"Bahrain\0"
+"Bangladesh\0"
+"Barbados\0"
+"Belarus\0"
+"Belgium\0"
+"Belize\0"
+"Benin\0"
+"Bermuda\0"
+"Bhutan\0"
+"Bolivia\0"
+"Bosnia And Herzegowina\0"
+"Botswana\0"
+"Bouvet Island\0"
+"Brazil\0"
+"British Indian Ocean Territory\0"
+"Brunei\0"
+"Bulgaria\0"
+"Burkina Faso\0"
+"Burundi\0"
+"Cambodia\0"
+"Cameroon\0"
+"Canada\0"
+"Cape Verde\0"
+"Cayman Islands\0"
+"Central African Republic\0"
+"Chad\0"
+"Chile\0"
+"China\0"
+"Christmas Island\0"
+"Cocos Islands\0"
+"Colombia\0"
+"Comoros\0"
+"Congo Kinshasa\0"
+"Congo Brazzaville\0"
+"Cook Islands\0"
+"Costa Rica\0"
+"Ivory Coast\0"
+"Croatia\0"
+"Cuba\0"
+"Cyprus\0"
+"Czech Republic\0"
+"Denmark\0"
+"Djibouti\0"
+"Dominica\0"
+"Dominican Republic\0"
+"East Timor\0"
+"Ecuador\0"
+"Egypt\0"
+"El Salvador\0"
+"Equatorial Guinea\0"
+"Eritrea\0"
+"Estonia\0"
+"Ethiopia\0"
+"Falkland Islands\0"
+"Faroe Islands\0"
+"Fiji\0"
+"Finland\0"
+"France\0"
+"Guernsey\0"
+"French Guiana\0"
+"French Polynesia\0"
+"French Southern Territories\0"
+"Gabon\0"
+"Gambia\0"
+"Georgia\0"
+"Germany\0"
+"Ghana\0"
+"Gibraltar\0"
+"Greece\0"
+"Greenland\0"
+"Grenada\0"
+"Guadeloupe\0"
+"Guam\0"
+"Guatemala\0"
+"Guinea\0"
+"Guinea Bissau\0"
+"Guyana\0"
+"Haiti\0"
+"Heard And McDonald Islands\0"
+"Honduras\0"
+"Hong Kong\0"
+"Hungary\0"
+"Iceland\0"
+"India\0"
+"Indonesia\0"
+"Iran\0"
+"Iraq\0"
+"Ireland\0"
+"Israel\0"
+"Italy\0"
+"Jamaica\0"
+"Japan\0"
+"Jordan\0"
+"Kazakhstan\0"
+"Kenya\0"
+"Kiribati\0"
+"North Korea\0"
+"South Korea\0"
+"Kuwait\0"
+"Kyrgyzstan\0"
+"Laos\0"
+"Latvia\0"
+"Lebanon\0"
+"Lesotho\0"
+"Liberia\0"
+"Libya\0"
+"Liechtenstein\0"
+"Lithuania\0"
+"Luxembourg\0"
+"Macau\0"
+"Macedonia\0"
+"Madagascar\0"
+"Malawi\0"
+"Malaysia\0"
+"Maldives\0"
+"Mali\0"
+"Malta\0"
+"Marshall Islands\0"
+"Martinique\0"
+"Mauritania\0"
+"Mauritius\0"
+"Mayotte\0"
+"Mexico\0"
+"Micronesia\0"
+"Moldova\0"
+"Monaco\0"
+"Mongolia\0"
+"Montserrat\0"
+"Morocco\0"
+"Mozambique\0"
+"Myanmar\0"
+"Namibia\0"
+"Nauru\0"
+"Nepal\0"
+"Netherlands\0"
+"Cura Sao\0"
+"New Caledonia\0"
+"New Zealand\0"
+"Nicaragua\0"
+"Niger\0"
+"Nigeria\0"
+"Niue\0"
+"Norfolk Island\0"
+"Northern Mariana Islands\0"
+"Norway\0"
+"Oman\0"
+"Pakistan\0"
+"Palau\0"
+"Palestinian Territories\0"
+"Panama\0"
+"Papua New Guinea\0"
+"Paraguay\0"
+"Peru\0"
+"Philippines\0"
+"Pitcairn\0"
+"Poland\0"
+"Portugal\0"
+"Puerto Rico\0"
+"Qatar\0"
+"Reunion\0"
+"Romania\0"
+"Russia\0"
+"Rwanda\0"
+"Saint Kitts And Nevis\0"
+"Saint Lucia\0"
+"Saint Vincent And The Grenadines\0"
+"Samoa\0"
+"San Marino\0"
+"Sao Tome And Principe\0"
+"Saudi Arabia\0"
+"Senegal\0"
+"Seychelles\0"
+"Sierra Leone\0"
+"Singapore\0"
+"Slovakia\0"
+"Slovenia\0"
+"Solomon Islands\0"
+"Somalia\0"
+"South Africa\0"
+"South Georgia And The South Sandwich Islands\0"
+"Spain\0"
+"Sri Lanka\0"
+"Saint Helena\0"
+"Saint Pierre And Miquelon\0"
+"Sudan\0"
+"Suriname\0"
+"Svalbard And Jan Mayen Islands\0"
+"Swaziland\0"
+"Sweden\0"
+"Switzerland\0"
+"Syria\0"
+"Taiwan\0"
+"Tajikistan\0"
+"Tanzania\0"
+"Thailand\0"
+"Togo\0"
+"Tokelau\0"
+"Tonga\0"
+"Trinidad And Tobago\0"
+"Tunisia\0"
+"Turkey\0"
+"Turkmenistan\0"
+"Turks And Caicos Islands\0"
+"Tuvalu\0"
+"Uganda\0"
+"Ukraine\0"
+"United Arab Emirates\0"
+"United Kingdom\0"
+"United States\0"
+"United States Minor Outlying Islands\0"
+"Uruguay\0"
+"Uzbekistan\0"
+"Vanuatu\0"
+"Vatican City State\0"
+"Venezuela\0"
+"Vietnam\0"
+"British Virgin Islands\0"
+"United States Virgin Islands\0"
+"Wallis And Futuna Islands\0"
+"Western Sahara\0"
+"Yemen\0"
+"Canary Islands\0"
+"Zambia\0"
+"Zimbabwe\0"
+"Clipperton Island\0"
+"Montenegro\0"
+"Serbia\0"
+"Saint Barthelemy\0"
+"Saint Martin\0"
+"Latin America\0"
+"Ascension Island\0"
+"Aland Islands\0"
+"Diego Garcia\0"
+"Ceuta And Melilla\0"
+"Isle Of Man\0"
+"Jersey\0"
+"Tristan Da Cunha\0"
+"South Sudan\0"
+"Bonaire\0"
+"Sint Maarten\0"
+"Kosovo\0"
+"European Union\0"
+"Outlying Oceania\0"
+"World\0"
+"Europe\0"
+;
+
+static const quint16 country_name_index[] = {
+ 0, // AnyCountry
+ 8, // Afghanistan
+ 20, // Albania
+ 28, // Algeria
+ 36, // American Samoa
+ 51, // Andorra
+ 59, // Angola
+ 66, // Anguilla
+ 75, // Antarctica
+ 86, // Antigua And Barbuda
+ 106, // Argentina
+ 116, // Armenia
+ 124, // Aruba
+ 130, // Australia
+ 140, // Austria
+ 148, // Azerbaijan
+ 159, // Bahamas
+ 167, // Bahrain
+ 175, // Bangladesh
+ 186, // Barbados
+ 195, // Belarus
+ 203, // Belgium
+ 211, // Belize
+ 218, // Benin
+ 224, // Bermuda
+ 232, // Bhutan
+ 239, // Bolivia
+ 247, // Bosnia And Herzegowina
+ 270, // Botswana
+ 279, // Bouvet Island
+ 293, // Brazil
+ 300, // British Indian Ocean Territory
+ 331, // Brunei
+ 338, // Bulgaria
+ 347, // Burkina Faso
+ 360, // Burundi
+ 368, // Cambodia
+ 377, // Cameroon
+ 386, // Canada
+ 393, // Cape Verde
+ 404, // Cayman Islands
+ 419, // Central African Republic
+ 444, // Chad
+ 449, // Chile
+ 455, // China
+ 461, // Christmas Island
+ 478, // Cocos Islands
+ 492, // Colombia
+ 501, // Comoros
+ 509, // Congo Kinshasa
+ 524, // Congo Brazzaville
+ 542, // Cook Islands
+ 555, // Costa Rica
+ 566, // Ivory Coast
+ 578, // Croatia
+ 586, // Cuba
+ 591, // Cyprus
+ 598, // Czech Republic
+ 613, // Denmark
+ 621, // Djibouti
+ 630, // Dominica
+ 639, // Dominican Republic
+ 658, // East Timor
+ 669, // Ecuador
+ 677, // Egypt
+ 683, // El Salvador
+ 695, // Equatorial Guinea
+ 713, // Eritrea
+ 721, // Estonia
+ 729, // Ethiopia
+ 738, // Falkland Islands
+ 755, // Faroe Islands
+ 769, // Fiji
+ 774, // Finland
+ 782, // France
+ 789, // Guernsey
+ 798, // French Guiana
+ 812, // French Polynesia
+ 829, // French Southern Territories
+ 857, // Gabon
+ 863, // Gambia
+ 870, // Georgia
+ 878, // Germany
+ 886, // Ghana
+ 892, // Gibraltar
+ 902, // Greece
+ 909, // Greenland
+ 919, // Grenada
+ 927, // Guadeloupe
+ 938, // Guam
+ 943, // Guatemala
+ 953, // Guinea
+ 960, // Guinea Bissau
+ 974, // Guyana
+ 981, // Haiti
+ 987, // Heard And McDonald Islands
+ 1014, // Honduras
+ 1023, // Hong Kong
+ 1033, // Hungary
+ 1041, // Iceland
+ 1049, // India
+ 1055, // Indonesia
+ 1065, // Iran
+ 1070, // Iraq
+ 1075, // Ireland
+ 1083, // Israel
+ 1090, // Italy
+ 1096, // Jamaica
+ 1104, // Japan
+ 1110, // Jordan
+ 1117, // Kazakhstan
+ 1128, // Kenya
+ 1134, // Kiribati
+ 1143, // North Korea
+ 1155, // South Korea
+ 1167, // Kuwait
+ 1174, // Kyrgyzstan
+ 1185, // Laos
+ 1190, // Latvia
+ 1197, // Lebanon
+ 1205, // Lesotho
+ 1213, // Liberia
+ 1221, // Libya
+ 1227, // Liechtenstein
+ 1241, // Lithuania
+ 1251, // Luxembourg
+ 1262, // Macau
+ 1268, // Macedonia
+ 1278, // Madagascar
+ 1289, // Malawi
+ 1296, // Malaysia
+ 1305, // Maldives
+ 1314, // Mali
+ 1319, // Malta
+ 1325, // Marshall Islands
+ 1342, // Martinique
+ 1353, // Mauritania
+ 1364, // Mauritius
+ 1374, // Mayotte
+ 1382, // Mexico
+ 1389, // Micronesia
+ 1400, // Moldova
+ 1408, // Monaco
+ 1415, // Mongolia
+ 1424, // Montserrat
+ 1435, // Morocco
+ 1443, // Mozambique
+ 1454, // Myanmar
+ 1462, // Namibia
+ 1470, // Nauru
+ 1476, // Nepal
+ 1482, // Netherlands
+ 1494, // Cura Sao
+ 1503, // New Caledonia
+ 1517, // New Zealand
+ 1529, // Nicaragua
+ 1539, // Niger
+ 1545, // Nigeria
+ 1553, // Niue
+ 1558, // Norfolk Island
+ 1573, // Northern Mariana Islands
+ 1598, // Norway
+ 1605, // Oman
+ 1610, // Pakistan
+ 1619, // Palau
+ 1625, // Palestinian Territories
+ 1649, // Panama
+ 1656, // Papua New Guinea
+ 1673, // Paraguay
+ 1682, // Peru
+ 1687, // Philippines
+ 1699, // Pitcairn
+ 1708, // Poland
+ 1715, // Portugal
+ 1724, // Puerto Rico
+ 1736, // Qatar
+ 1742, // Reunion
+ 1750, // Romania
+ 1758, // Russia
+ 1765, // Rwanda
+ 1772, // Saint Kitts And Nevis
+ 1794, // Saint Lucia
+ 1806, // Saint Vincent And The Grenadines
+ 1839, // Samoa
+ 1845, // San Marino
+ 1856, // Sao Tome And Principe
+ 1878, // Saudi Arabia
+ 1891, // Senegal
+ 1899, // Seychelles
+ 1910, // Sierra Leone
+ 1923, // Singapore
+ 1933, // Slovakia
+ 1942, // Slovenia
+ 1951, // Solomon Islands
+ 1967, // Somalia
+ 1975, // South Africa
+ 1988, // South Georgia And The South Sandwich Islands
+ 2033, // Spain
+ 2039, // Sri Lanka
+ 2049, // Saint Helena
+ 2062, // Saint Pierre And Miquelon
+ 2088, // Sudan
+ 2094, // Suriname
+ 2103, // Svalbard And Jan Mayen Islands
+ 2134, // Swaziland
+ 2144, // Sweden
+ 2151, // Switzerland
+ 2163, // Syria
+ 2169, // Taiwan
+ 2176, // Tajikistan
+ 2187, // Tanzania
+ 2196, // Thailand
+ 2205, // Togo
+ 2210, // Tokelau
+ 2218, // Tonga
+ 2224, // Trinidad And Tobago
+ 2244, // Tunisia
+ 2252, // Turkey
+ 2259, // Turkmenistan
+ 2272, // Turks And Caicos Islands
+ 2297, // Tuvalu
+ 2304, // Uganda
+ 2311, // Ukraine
+ 2319, // United Arab Emirates
+ 2340, // United Kingdom
+ 2355, // United States
+ 2369, // United States Minor Outlying Islands
+ 2406, // Uruguay
+ 2414, // Uzbekistan
+ 2425, // Vanuatu
+ 2433, // Vatican City State
+ 2452, // Venezuela
+ 2462, // Vietnam
+ 2470, // British Virgin Islands
+ 2493, // United States Virgin Islands
+ 2522, // Wallis And Futuna Islands
+ 2548, // Western Sahara
+ 2563, // Yemen
+ 2569, // Canary Islands
+ 2584, // Zambia
+ 2591, // Zimbabwe
+ 2600, // Clipperton Island
+ 2618, // Montenegro
+ 2629, // Serbia
+ 2636, // Saint Barthelemy
+ 2653, // Saint Martin
+ 2666, // Latin America
+ 2680, // Ascension Island
+ 2697, // Aland Islands
+ 2711, // Diego Garcia
+ 2724, // Ceuta And Melilla
+ 2742, // Isle Of Man
+ 2754, // Jersey
+ 2761, // Tristan Da Cunha
+ 2778, // South Sudan
+ 2790, // Bonaire
+ 2798, // Sint Maarten
+ 2811, // Kosovo
+ 2818, // European Union
+ 2833, // Outlying Oceania
+ 2850, // World
+ 2856, // Europe
+};
+
+static const unsigned char language_code_list[] =
+" \0" // AnyLanguage
+" \0" // C
+"ab\0" // Abkhazian
+"om\0" // Oromo
+"aa\0" // Afar
+"af\0" // Afrikaans
+"sq\0" // Albanian
+"am\0" // Amharic
+"ar\0" // Arabic
+"hy\0" // Armenian
+"as\0" // Assamese
+"ay\0" // Aymara
+"az\0" // Azerbaijani
+"ba\0" // Bashkir
+"eu\0" // Basque
+"bn\0" // Bengali
+"dz\0" // Dzongkha
+"bh\0" // Bihari
+"bi\0" // Bislama
+"br\0" // Breton
+"bg\0" // Bulgarian
+"my\0" // Burmese
+"be\0" // Belarusian
+"km\0" // Khmer
+"ca\0" // Catalan
+"zh\0" // Chinese
+"co\0" // Corsican
+"hr\0" // Croatian
+"cs\0" // Czech
+"da\0" // Danish
+"nl\0" // Dutch
+"en\0" // English
+"eo\0" // Esperanto
+"et\0" // Estonian
+"fo\0" // Faroese
+"fj\0" // Fijian
+"fi\0" // Finnish
+"fr\0" // French
+"fy\0" // Western Frisian
+"gd\0" // Gaelic
+"gl\0" // Galician
+"ka\0" // Georgian
+"de\0" // German
+"el\0" // Greek
+"kl\0" // Greenlandic
+"gn\0" // Guarani
+"gu\0" // Gujarati
+"ha\0" // Hausa
+"he\0" // Hebrew
+"hi\0" // Hindi
+"hu\0" // Hungarian
+"is\0" // Icelandic
+"id\0" // Indonesian
+"ia\0" // Interlingua
+"ie\0" // Interlingue
+"iu\0" // Inuktitut
+"ik\0" // Inupiak
+"ga\0" // Irish
+"it\0" // Italian
+"ja\0" // Japanese
+"jv\0" // Javanese
+"kn\0" // Kannada
+"ks\0" // Kashmiri
+"kk\0" // Kazakh
+"rw\0" // Kinyarwanda
+"ky\0" // Kirghiz
+"ko\0" // Korean
+"ku\0" // Kurdish
+"rn\0" // Rundi
+"lo\0" // Lao
+"la\0" // Latin
+"lv\0" // Latvian
+"ln\0" // Lingala
+"lt\0" // Lithuanian
+"mk\0" // Macedonian
+"mg\0" // Malagasy
+"ms\0" // Malay
+"ml\0" // Malayalam
+"mt\0" // Maltese
+"mi\0" // Maori
+"mr\0" // Marathi
+"mh\0" // Marshallese
+"mn\0" // Mongolian
+"na\0" // Nauru
+"ne\0" // Nepali
+"nb\0" // Norwegian Bokmal
+"oc\0" // Occitan
+"or\0" // Oriya
+"ps\0" // Pashto
+"fa\0" // Persian
+"pl\0" // Polish
+"pt\0" // Portuguese
+"pa\0" // Punjabi
+"qu\0" // Quechua
+"rm\0" // Romansh
+"ro\0" // Romanian
+"ru\0" // Russian
+"sm\0" // Samoan
+"sg\0" // Sango
+"sa\0" // Sanskrit
+"sr\0" // Serbian
+"os\0" // Ossetic
+"st\0" // Southern Sotho
+"tn\0" // Tswana
+"sn\0" // Shona
+"sd\0" // Sindhi
+"si\0" // Sinhala
+"ss\0" // Swati
+"sk\0" // Slovak
+"sl\0" // Slovenian
+"so\0" // Somali
+"es\0" // Spanish
+"su\0" // Sundanese
+"sw\0" // Swahili
+"sv\0" // Swedish
+"sc\0" // Sardinian
+"tg\0" // Tajik
+"ta\0" // Tamil
+"tt\0" // Tatar
+"te\0" // Telugu
+"th\0" // Thai
+"bo\0" // Tibetan
+"ti\0" // Tigrinya
+"to\0" // Tongan
+"ts\0" // Tsonga
+"tr\0" // Turkish
+"tk\0" // Turkmen
+"ty\0" // Tahitian
+"ug\0" // Uighur
+"uk\0" // Ukrainian
+"ur\0" // Urdu
+"uz\0" // Uzbek
+"vi\0" // Vietnamese
+"vo\0" // Volapuk
+"cy\0" // Welsh
+"wo\0" // Wolof
+"xh\0" // Xhosa
+"yi\0" // Yiddish
+"yo\0" // Yoruba
+"za\0" // Zhuang
+"zu\0" // Zulu
+"nn\0" // Norwegian Nynorsk
+"bs\0" // Bosnian
+"dv\0" // Divehi
+"gv\0" // Manx
+"kw\0" // Cornish
+"ak\0" // Akan
+"kok" // Konkani
+"gaa" // Ga
+"ig\0" // Igbo
+"kam" // Kamba
+"syr" // Syriac
+"byn" // Blin
+"gez" // Geez
+"kfo" // Koro
+"sid" // Sidamo
+"cch" // Atsam
+"tig" // Tigre
+"kaj" // Jju
+"fur" // Friulian
+"ve\0" // Venda
+"ee\0" // Ewe
+"wal" // Walamo
+"haw" // Hawaiian
+"kcg" // Tyap
+"ny\0" // Nyanja
+"fil" // Filipino
+"gsw" // Swiss German
+"ii\0" // Sichuan Yi
+"kpe" // Kpelle
+"nds" // Low German
+"nr\0" // South Ndebele
+"nso" // Northern Sotho
+"se\0" // Northern Sami
+"trv" // Taroko
+"guz" // Gusii
+"dav" // Taita
+"ff\0" // Fulah
+"ki\0" // Kikuyu
+"saq" // Samburu
+"seh" // Sena
+"nd\0" // North Ndebele
+"rof" // Rombo
+"shi" // Tachelhit
+"kab" // Kabyle
+"nyn" // Nyankole
+"bez" // Bena
+"vun" // Vunjo
+"bm\0" // Bambara
+"ebu" // Embu
+"chr" // Cherokee
+"mfe" // Morisyen
+"kde" // Makonde
+"lag" // Langi
+"lg\0" // Ganda
+"bem" // Bemba
+"kea" // Kabuverdianu
+"mer" // Meru
+"kln" // Kalenjin
+"naq" // Nama
+"jmc" // Machame
+"ksh" // Colognian
+"mas" // Masai
+"xog" // Soga
+"luy" // Luyia
+"asa" // Asu
+"teo" // Teso
+"ssy" // Saho
+"khq" // Koyra Chiini
+"rwk" // Rwa
+"luo" // Luo
+"cgg" // Chiga
+"tzm" // Central Morocco Tamazight
+"ses" // Koyraboro Senni
+"ksb" // Shambala
+"brx" // Bodo
+"av\0" // Avaric
+"ch\0" // Chamorro
+"ce\0" // Chechen
+"cu\0" // Church
+"cv\0" // Chuvash
+"cr\0" // Cree
+"ht\0" // Haitian
+"hz\0" // Herero
+"ho\0" // Hiri Motu
+"kr\0" // Kanuri
+"kv\0" // Komi
+"kg\0" // Kongo
+"kj\0" // Kwanyama
+"li\0" // Limburgish
+"lu\0" // Luba Katanga
+"lb\0" // Luxembourgish
+"nv\0" // Navaho
+"ng\0" // Ndonga
+"oj\0" // Ojibwa
+"pi\0" // Pali
+"wa\0" // Walloon
+"agq" // Aghem
+"bas" // Basaa
+"dje" // Zarma
+"dua" // Duala
+"dyo" // Jola Fonyi
+"ewo" // Ewondo
+"ksf" // Bafia
+"mgh" // Makhuwa Meetto
+"mua" // Mundang
+"nmg" // Kwasio
+"nus" // Nuer
+"sah" // Sakha
+"sbp" // Sangu
+"swc" // Congo Swahili
+"twq" // Tasawaq
+"vai" // Vai
+"wae" // Walser
+"yav" // Yangben
+"ae\0" // Avestan
+"ast" // Asturian
+"jgo" // Ngomba
+"kkj" // Kako
+"mgo" // Meta
+"nnh" // Ngiemboon
+"an\0" // Aragonese
+"akk" // Akkadian
+"egy" // Ancient Egyptian
+"grc" // Ancient Greek
+"arc" // Aramaic
+"ban" // Balinese
+"bax" // Bamun
+"bbc" // Batak Toba
+"bug" // Buginese
+"bku" // Buhid
+"xcr" // Carian
+"ccp" // Chakma
+"myz" // Classical Mandaic
+"cop" // Coptic
+"doi" // Dogri
+"cjm" // Eastern Cham
+"eky" // Eastern Kayah
+"ett" // Etruscan
+"got" // Gothic
+"hnn" // Hanunoo
+"inh" // Ingush
+"hmd" // Large Flowery Miao
+"lep" // Lepcha
+"lif" // Limbu
+"lis" // Lisu
+"khb" // Lu
+"xlc" // Lycian
+"xld" // Lydian
+"man" // Mandingo
+"mni" // Manipuri
+"xmr" // Meroitic
+"nod" // Northern Thai
+"sga" // Old Irish
+"non" // Old Norse
+"peo" // Old Persian
+"otk" // Old Turkish
+"pal" // Pahlavi
+"xpr" // Parthian
+"phn" // Phoenician
+"pra" // Prakrit Language
+"rej" // Rejang
+"xsa" // Sabaean
+"smp" // Samaritan
+"sat" // Santali
+"saz" // Saurashtra
+"srb" // Sora
+"syl" // Sylheti
+"tbw" // Tagbanwa
+"blt" // Tai Dam
+"tdd" // Tai Nua
+"uga" // Ugaritic
+"bss" // Akoose
+"lkt" // Lakota
+"zgh" // Standard Moroccan Tamazight
+"arn" // Mapuche
+"ckb" // Central Kurdish
+"dsb" // Lower Sorbian
+"hsb" // Upper Sorbian
+"ken" // Kenyang
+"moh" // Mohawk
+"nqo" // Nko
+"prg" // Prussian
+"quc" // Kiche
+"sma" // Southern Sami
+"smj" // Lule Sami
+"smn" // Inari Sami
+"sms" // Skolt Sami
+"wbp" // Warlpiri
+"xmn" // Manichaean Middle Persian
+"men" // Mende
+"xna" // Ancient North Arabian
+"lab" // Linear A
+"hnj" // Hmong Njua
+"hoc" // Ho
+"lez" // Lezghian
+"bsq" // Bassa
+"mru" // Mono
+"ctd" // Tedim Chin
+"mai" // Maithili
+"aho" // Ahom
+"ase" // American Sign Language
+"pka" // Ardhamagadhi Prakrit
+"bho" // Bhojpuri
+"hlu" // Hieroglyphic Luwian
+"lzh" // Literary Chinese
+"mzn" // Mazanderani
+"mro" // Mru
+"new" // Newari
+"lrc" // Northern Luri
+"pau" // Palauan
+"pap" // Papiamento
+"skr" // Saraiki
+"tkl" // Tokelau
+"tpi" // Tok Pisin
+"tvl" // Tuvalu
+"mis" // Uncoded Languages
+"yue" // Cantonese
+"osa" // Osage
+"txg" // Tangut
+"io\0" // Ido
+"jbo" // Lojban
+"scn" // Sicilian
+"sdh" // Southern Kurdish
+"bgn" // Western Balochi
+"ceb" // Cebuano
+"myv" // Erzya
+"cic" // Chickasaw
+"mus" // Muscogee
+"szl" // Silesian
+;
+
+static const unsigned char script_code_list[] =
+"Zzzz" // AnyScript
+"Arab" // Arabic
+"Cyrl" // Cyrillic
+"Dsrt" // Deseret
+"Guru" // Gurmukhi
+"Hans" // Simplified Han
+"Hant" // Traditional Han
+"Latn" // Latin
+"Mong" // Mongolian
+"Tfng" // Tifinagh
+"Armn" // Armenian
+"Beng" // Bengali
+"Cher" // Cherokee
+"Deva" // Devanagari
+"Ethi" // Ethiopic
+"Geor" // Georgian
+"Grek" // Greek
+"Gujr" // Gujarati
+"Hebr" // Hebrew
+"Jpan" // Japanese
+"Khmr" // Khmer
+"Knda" // Kannada
+"Kore" // Korean
+"Laoo" // Lao
+"Mlym" // Malayalam
+"Mymr" // Myanmar
+"Orya" // Oriya
+"Taml" // Tamil
+"Telu" // Telugu
+"Thaa" // Thaana
+"Thai" // Thai
+"Tibt" // Tibetan
+"Sinh" // Sinhala
+"Syrc" // Syriac
+"Yiii" // Yi
+"Vaii" // Vai
+"Avst" // Avestan
+"Bali" // Balinese
+"Bamu" // Bamum
+"Batk" // Batak
+"Bopo" // Bopomofo
+"Brah" // Brahmi
+"Bugi" // Buginese
+"Buhd" // Buhid
+"Cans" // Canadian Aboriginal
+"Cari" // Carian
+"Cakm" // Chakma
+"Cham" // Cham
+"Copt" // Coptic
+"Cprt" // Cypriot
+"Egyp" // Egyptian Hieroglyphs
+"Lisu" // Fraser
+"Glag" // Glagolitic
+"Goth" // Gothic
+"Hani" // Han
+"Hang" // Hangul
+"Hano" // Hanunoo
+"Armi" // Imperial Aramaic
+"Phli" // Inscriptional Pahlavi
+"Prti" // Inscriptional Parthian
+"Java" // Javanese
+"Kthi" // Kaithi
+"Kana" // Katakana
+"Kali" // Kayah Li
+"Khar" // Kharoshthi
+"Lana" // Lanna
+"Lepc" // Lepcha
+"Limb" // Limbu
+"Linb" // Linear B
+"Lyci" // Lycian
+"Lydi" // Lydian
+"Mand" // Mandaean
+"Mtei" // Meitei Mayek
+"Mero" // Meroitic
+"Merc" // Meroitic Cursive
+"Nkoo" // Nko
+"Talu" // New Tai Lue
+"Ogam" // Ogham
+"Olck" // Ol Chiki
+"Ital" // Old Italic
+"Xpeo" // Old Persian
+"Sarb" // Old South Arabian
+"Orkh" // Orkhon
+"Osma" // Osmanya
+"Phag" // Phags Pa
+"Phnx" // Phoenician
+"Plrd" // Pollard Phonetic
+"Rjng" // Rejang
+"Runr" // Runic
+"Samr" // Samaritan
+"Saur" // Saurashtra
+"Shrd" // Sharada
+"Shaw" // Shavian
+"Sora" // Sora Sompeng
+"Xsux" // Cuneiform
+"Sund" // Sundanese
+"Sylo" // Syloti Nagri
+"Tglg" // Tagalog
+"Tagb" // Tagbanwa
+"Tale" // Tai Le
+"Tavt" // Tai Viet
+"Takr" // Takri
+"Ugar" // Ugaritic
+"Brai" // Braille
+"Hira" // Hiragana
+"Aghb" // Caucasian Albanian
+"Bass" // Bassa Vah
+"Dupl" // Duployan
+"Elba" // Elbasan
+"Gran" // Grantha
+"Hmng" // Pahawh Hmong
+"Khoj" // Khojki
+"Lina" // Linear A
+"Mahj" // Mahajani
+"Mani" // Manichaean
+"Mend" // Mende Kikakui
+"Modi" // Modi
+"Mroo" // Mro
+"Narb" // Old North Arabian
+"Nbat" // Nabataean
+"Palm" // Palmyrene
+"Pauc" // Pau Cin Hau
+"Perm" // Old Permic
+"Phlp" // Psalter Pahlavi
+"Sidd" // Siddham
+"Sind" // Khudawadi
+"Tirh" // Tirhuta
+"Wara" // Varang Kshiti
+"Ahom" // Ahom
+"Hluw" // Anatolian Hieroglyphs
+"Hatr" // Hatran
+"Mult" // Multani
+"Hung" // Old Hungarian
+"Sgnw" // Sign Writing
+"Adlm" // Adlam
+"Bhks" // Bhaiksuki
+"Marc" // Marchen
+"Newa" // Newa
+"Osge" // Osage
+"Tang" // Tangut
+"Hanb" // Han with Bopomofo
+"Jamo" // Jamo
+;
+static const unsigned char country_code_list[] =
+"ZZ\0" // AnyCountry
+"AF\0" // Afghanistan
+"AL\0" // Albania
+"DZ\0" // Algeria
+"AS\0" // American Samoa
+"AD\0" // Andorra
+"AO\0" // Angola
+"AI\0" // Anguilla
+"AQ\0" // Antarctica
+"AG\0" // Antigua And Barbuda
+"AR\0" // Argentina
+"AM\0" // Armenia
+"AW\0" // Aruba
+"AU\0" // Australia
+"AT\0" // Austria
+"AZ\0" // Azerbaijan
+"BS\0" // Bahamas
+"BH\0" // Bahrain
+"BD\0" // Bangladesh
+"BB\0" // Barbados
+"BY\0" // Belarus
+"BE\0" // Belgium
+"BZ\0" // Belize
+"BJ\0" // Benin
+"BM\0" // Bermuda
+"BT\0" // Bhutan
+"BO\0" // Bolivia
+"BA\0" // Bosnia And Herzegowina
+"BW\0" // Botswana
+"BV\0" // Bouvet Island
+"BR\0" // Brazil
+"IO\0" // British Indian Ocean Territory
+"BN\0" // Brunei
+"BG\0" // Bulgaria
+"BF\0" // Burkina Faso
+"BI\0" // Burundi
+"KH\0" // Cambodia
+"CM\0" // Cameroon
+"CA\0" // Canada
+"CV\0" // Cape Verde
+"KY\0" // Cayman Islands
+"CF\0" // Central African Republic
+"TD\0" // Chad
+"CL\0" // Chile
+"CN\0" // China
+"CX\0" // Christmas Island
+"CC\0" // Cocos Islands
+"CO\0" // Colombia
+"KM\0" // Comoros
+"CD\0" // Congo Kinshasa
+"CG\0" // Congo Brazzaville
+"CK\0" // Cook Islands
+"CR\0" // Costa Rica
+"CI\0" // Ivory Coast
+"HR\0" // Croatia
+"CU\0" // Cuba
+"CY\0" // Cyprus
+"CZ\0" // Czech Republic
+"DK\0" // Denmark
+"DJ\0" // Djibouti
+"DM\0" // Dominica
+"DO\0" // Dominican Republic
+"TL\0" // East Timor
+"EC\0" // Ecuador
+"EG\0" // Egypt
+"SV\0" // El Salvador
+"GQ\0" // Equatorial Guinea
+"ER\0" // Eritrea
+"EE\0" // Estonia
+"ET\0" // Ethiopia
+"FK\0" // Falkland Islands
+"FO\0" // Faroe Islands
+"FJ\0" // Fiji
+"FI\0" // Finland
+"FR\0" // France
+"GG\0" // Guernsey
+"GF\0" // French Guiana
+"PF\0" // French Polynesia
+"TF\0" // French Southern Territories
+"GA\0" // Gabon
+"GM\0" // Gambia
+"GE\0" // Georgia
+"DE\0" // Germany
+"GH\0" // Ghana
+"GI\0" // Gibraltar
+"GR\0" // Greece
+"GL\0" // Greenland
+"GD\0" // Grenada
+"GP\0" // Guadeloupe
+"GU\0" // Guam
+"GT\0" // Guatemala
+"GN\0" // Guinea
+"GW\0" // Guinea Bissau
+"GY\0" // Guyana
+"HT\0" // Haiti
+"HM\0" // Heard And McDonald Islands
+"HN\0" // Honduras
+"HK\0" // Hong Kong
+"HU\0" // Hungary
+"IS\0" // Iceland
+"IN\0" // India
+"ID\0" // Indonesia
+"IR\0" // Iran
+"IQ\0" // Iraq
+"IE\0" // Ireland
+"IL\0" // Israel
+"IT\0" // Italy
+"JM\0" // Jamaica
+"JP\0" // Japan
+"JO\0" // Jordan
+"KZ\0" // Kazakhstan
+"KE\0" // Kenya
+"KI\0" // Kiribati
+"KP\0" // North Korea
+"KR\0" // South Korea
+"KW\0" // Kuwait
+"KG\0" // Kyrgyzstan
+"LA\0" // Laos
+"LV\0" // Latvia
+"LB\0" // Lebanon
+"LS\0" // Lesotho
+"LR\0" // Liberia
+"LY\0" // Libya
+"LI\0" // Liechtenstein
+"LT\0" // Lithuania
+"LU\0" // Luxembourg
+"MO\0" // Macau
+"MK\0" // Macedonia
+"MG\0" // Madagascar
+"MW\0" // Malawi
+"MY\0" // Malaysia
+"MV\0" // Maldives
+"ML\0" // Mali
+"MT\0" // Malta
+"MH\0" // Marshall Islands
+"MQ\0" // Martinique
+"MR\0" // Mauritania
+"MU\0" // Mauritius
+"YT\0" // Mayotte
+"MX\0" // Mexico
+"FM\0" // Micronesia
+"MD\0" // Moldova
+"MC\0" // Monaco
+"MN\0" // Mongolia
+"MS\0" // Montserrat
+"MA\0" // Morocco
+"MZ\0" // Mozambique
+"MM\0" // Myanmar
+"NA\0" // Namibia
+"NR\0" // Nauru
+"NP\0" // Nepal
+"NL\0" // Netherlands
+"CW\0" // Cura Sao
+"NC\0" // New Caledonia
+"NZ\0" // New Zealand
+"NI\0" // Nicaragua
+"NE\0" // Niger
+"NG\0" // Nigeria
+"NU\0" // Niue
+"NF\0" // Norfolk Island
+"MP\0" // Northern Mariana Islands
+"NO\0" // Norway
+"OM\0" // Oman
+"PK\0" // Pakistan
+"PW\0" // Palau
+"PS\0" // Palestinian Territories
+"PA\0" // Panama
+"PG\0" // Papua New Guinea
+"PY\0" // Paraguay
+"PE\0" // Peru
+"PH\0" // Philippines
+"PN\0" // Pitcairn
+"PL\0" // Poland
+"PT\0" // Portugal
+"PR\0" // Puerto Rico
+"QA\0" // Qatar
+"RE\0" // Reunion
+"RO\0" // Romania
+"RU\0" // Russia
+"RW\0" // Rwanda
+"KN\0" // Saint Kitts And Nevis
+"LC\0" // Saint Lucia
+"VC\0" // Saint Vincent And The Grenadines
+"WS\0" // Samoa
+"SM\0" // San Marino
+"ST\0" // Sao Tome And Principe
+"SA\0" // Saudi Arabia
+"SN\0" // Senegal
+"SC\0" // Seychelles
+"SL\0" // Sierra Leone
+"SG\0" // Singapore
+"SK\0" // Slovakia
+"SI\0" // Slovenia
+"SB\0" // Solomon Islands
+"SO\0" // Somalia
+"ZA\0" // South Africa
+"GS\0" // South Georgia And The South Sandwich Islands
+"ES\0" // Spain
+"LK\0" // Sri Lanka
+"SH\0" // Saint Helena
+"PM\0" // Saint Pierre And Miquelon
+"SD\0" // Sudan
+"SR\0" // Suriname
+"SJ\0" // Svalbard And Jan Mayen Islands
+"SZ\0" // Swaziland
+"SE\0" // Sweden
+"CH\0" // Switzerland
+"SY\0" // Syria
+"TW\0" // Taiwan
+"TJ\0" // Tajikistan
+"TZ\0" // Tanzania
+"TH\0" // Thailand
+"TG\0" // Togo
+"TK\0" // Tokelau
+"TO\0" // Tonga
+"TT\0" // Trinidad And Tobago
+"TN\0" // Tunisia
+"TR\0" // Turkey
+"TM\0" // Turkmenistan
+"TC\0" // Turks And Caicos Islands
+"TV\0" // Tuvalu
+"UG\0" // Uganda
+"UA\0" // Ukraine
+"AE\0" // United Arab Emirates
+"GB\0" // United Kingdom
+"US\0" // United States
+"UM\0" // United States Minor Outlying Islands
+"UY\0" // Uruguay
+"UZ\0" // Uzbekistan
+"VU\0" // Vanuatu
+"VA\0" // Vatican City State
+"VE\0" // Venezuela
+"VN\0" // Vietnam
+"VG\0" // British Virgin Islands
+"VI\0" // United States Virgin Islands
+"WF\0" // Wallis And Futuna Islands
+"EH\0" // Western Sahara
+"YE\0" // Yemen
+"IC\0" // Canary Islands
+"ZM\0" // Zambia
+"ZW\0" // Zimbabwe
+"CP\0" // Clipperton Island
+"ME\0" // Montenegro
+"RS\0" // Serbia
+"BL\0" // Saint Barthelemy
+"MF\0" // Saint Martin
+"419" // Latin America
+"AC\0" // Ascension Island
+"AX\0" // Aland Islands
+"DG\0" // Diego Garcia
+"EA\0" // Ceuta And Melilla
+"IM\0" // Isle Of Man
+"JE\0" // Jersey
+"TA\0" // Tristan Da Cunha
+"SS\0" // South Sudan
+"BQ\0" // Bonaire
+"SX\0" // Sint Maarten
+"XK\0" // Kosovo
+"EU\0" // European Union
+"QO\0" // Outlying Oceania
+"001" // World
+"150" // Europe
+;
+
+// GENERATED PART ENDS HERE
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/corelib/tools/qlocale_icu.cpp b/src/corelib/text/qlocale_icu.cpp
index afe0aae583..afe0aae583 100644
--- a/src/corelib/tools/qlocale_icu.cpp
+++ b/src/corelib/text/qlocale_icu.cpp
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/text/qlocale_mac.mm
index 574cb0714c..9719278426 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/text/qlocale_mac.mm
@@ -44,10 +44,8 @@
#include "qdatetime.h"
#ifdef Q_OS_DARWIN
-#include "qtimezone.h"
#include "private/qcore_mac_p.h"
#include <CoreFoundation/CoreFoundation.h>
-QT_REQUIRE_CONFIG(timezone);
#endif
QT_BEGIN_NAMESPACE
@@ -147,7 +145,7 @@ static QString macTimeToString(const QTime &time, bool short_format)
// Mac uses the Unicode CLDR format codes
// http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
-// See also qtbase/util/local_database/dateconverter.py
+// See also qtbase/util/locale_database/dateconverter.py
// Makes the assumption that input formats are always well formed and consecutive letters
// never exceed the maximum for the format code.
static QString macToQtFormat(QStringView sys_fmt)
@@ -491,8 +489,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
} else if (typeId == CFStringGetTypeID()) {
result = QStringList(QString::fromCFString(languages.as<CFStringRef>()));
} else {
- qWarning("QLocale::uiLanguages(): CFPreferencesCopyValue returned unhandled type \"%s\"; please report to http://bugreports.qt.io",
- qPrintable(QString::fromCFString(CFCopyTypeIDDescription(typeId))));
+ qWarning("QLocale::uiLanguages(): CFPreferencesCopyValue returned unhandled type \"%ls\"; please report to http://bugreports.qt.io",
+ qUtf16Printable(QString::fromCFString(CFCopyTypeIDDescription(typeId))));
}
return QVariant(result);
}
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/text/qlocale_p.h
index 70430beb00..edee3a89c7 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/text/qlocale_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -57,6 +57,7 @@
#include "QtCore/qvarlengtharray.h"
#include "QtCore/qvariant.h"
#include "QtCore/qnumeric.h"
+#include <QtCore/qcalendar.h>
#include "qlocale.h"
@@ -113,6 +114,7 @@ public:
Weekdays, // QList<Qt::DayOfWeek>
CurrencySymbol, // QString in: CurrencyToStringArgument
CurrencyToString, // QString in: qlonglong, qulonglong or double
+ Collation, // QString
UILanguages, // QStringList
StringToStandardQuotation, // QString in: QStringRef to quote
StringToAlternateQuotation, // QString in: QStringRef to quote
@@ -170,9 +172,14 @@ Q_DECLARE_TYPEINFO(QLocaleId, Q_PRIMITIVE_TYPE);
struct QLocaleData
{
public:
+ // TODO: Remove this?
static const QLocaleData *findLocaleData(QLocale::Language language,
QLocale::Script script,
QLocale::Country country);
+ // Having an offset of current locale, enables us to have multiple sources of data, i.e. user-provided calendar locales
+ static uint findLocaleOffset(QLocale::Language language,
+ QLocale::Script script,
+ QLocale::Country country);
static const QLocaleData *c();
// Maximum number of significant digits needed to represent a double.
@@ -249,14 +256,14 @@ public:
if (qIsInf(d))
return float(d);
if (std::fabs(d) > std::numeric_limits<float>::max()) {
- if (ok != 0)
+ if (ok)
*ok = false;
const float huge = std::numeric_limits<float>::infinity();
return d < 0 ? -huge : huge;
}
if (d != 0 && float(d) == 0) {
// Values that underflow double already failed. Match them:
- if (ok != 0)
+ if (ok)
*ok = false;
return 0;
}
@@ -284,9 +291,9 @@ public:
quint16 m_language_id, m_script_id, m_country_id;
// FIXME QTBUG-69324: not all unicode code-points map to single-token UTF-16 :-(
- quint16 m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential;
- quint16 m_quotation_start, m_quotation_end;
- quint16 m_alternate_quotation_start, m_alternate_quotation_end;
+ char16_t m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential;
+ char16_t m_quotation_start, m_quotation_end;
+ char16_t m_alternate_quotation_start, m_alternate_quotation_end;
quint16 m_list_pattern_part_start_idx, m_list_pattern_part_start_size;
quint16 m_list_pattern_part_mid_idx, m_list_pattern_part_mid_size;
@@ -296,12 +303,6 @@ public:
quint16 m_long_date_format_idx, m_long_date_format_size;
quint16 m_short_time_format_idx, m_short_time_format_size;
quint16 m_long_time_format_idx, m_long_time_format_size;
- quint16 m_standalone_short_month_names_idx, m_standalone_short_month_names_size;
- quint16 m_standalone_long_month_names_idx, m_standalone_long_month_names_size;
- quint16 m_standalone_narrow_month_names_idx, m_standalone_narrow_month_names_size;
- quint16 m_short_month_names_idx, m_short_month_names_size;
- quint16 m_long_month_names_idx, m_long_month_names_size;
- quint16 m_narrow_month_names_idx, m_narrow_month_names_size;
quint16 m_standalone_short_day_names_idx, m_standalone_short_day_names_size;
quint16 m_standalone_long_day_names_idx, m_standalone_long_day_names_size;
quint16 m_standalone_narrow_day_names_idx, m_standalone_narrow_day_names_size;
@@ -327,22 +328,23 @@ public:
quint16 m_weekend_end : 3;
};
-class Q_CORE_EXPORT QLocalePrivate
+class Q_CORE_EXPORT QLocalePrivate // A POD type
{
public:
static QLocalePrivate *create(
- const QLocaleData *data,
+ const QLocaleData *data, const uint data_offset = 0,
QLocale::NumberOptions numberOptions = QLocale::DefaultNumberOptions)
{
- QLocalePrivate *retval = new QLocalePrivate;
+ auto *retval = new QLocalePrivate;
retval->m_data = data;
- retval->ref.store(0);
+ retval->ref.storeRelaxed(0);
+ retval->m_data_offset = data_offset;
retval->m_numberOptions = numberOptions;
return retval;
}
static QLocalePrivate *get(QLocale &l) { return l.d; }
- static const QLocalePrivate *get(const QLocale &l) { return l.d; }
+ static const QLocalePrivate *get(const QLocale &l) { return l.d; }
QChar decimal() const { return QChar(m_data->m_decimal); }
QChar group() const { return QChar(m_data->m_group); }
@@ -357,28 +359,26 @@ public:
quint16 countryId() const { return m_data->m_country_id; }
QByteArray bcp47Name(char separator = '-') const;
+ QByteArray rawName(char separator = '-') const;
- inline QLatin1String languageCode() const { return QLocalePrivate::languageToCode(QLocale::Language(m_data->m_language_id)); }
- inline QLatin1String scriptCode() const { return QLocalePrivate::scriptToCode(QLocale::Script(m_data->m_script_id)); }
- inline QLatin1String countryCode() const { return QLocalePrivate::countryToCode(QLocale::Country(m_data->m_country_id)); }
+ inline QLatin1String languageCode() const { return languageToCode(QLocale::Language(m_data->m_language_id)); }
+ inline QLatin1String scriptCode() const { return scriptToCode(QLocale::Script(m_data->m_script_id)); }
+ inline QLatin1String countryCode() const { return countryToCode(QLocale::Country(m_data->m_country_id)); }
static QLatin1String languageToCode(QLocale::Language language);
static QLatin1String scriptToCode(QLocale::Script script);
static QLatin1String countryToCode(QLocale::Country country);
- static QLocale::Language codeToLanguage(QStringView code) Q_DECL_NOTHROW;
- static QLocale::Script codeToScript(QStringView code) Q_DECL_NOTHROW;
- static QLocale::Country codeToCountry(QStringView code) Q_DECL_NOTHROW;
+ static QLocale::Language codeToLanguage(QStringView code) noexcept;
+ static QLocale::Script codeToScript(QStringView code) noexcept;
+ static QLocale::Country codeToCountry(QStringView code) noexcept;
static void getLangAndCountry(const QString &name, QLocale::Language &lang,
QLocale::Script &script, QLocale::Country &cntry);
QLocale::MeasurementSystem measurementSystem() const;
- QString dateTimeToString(QStringView format, const QDateTime &datetime,
- const QDate &dateOnly, const QTime &timeOnly,
- const QLocale *q) const;
-
const QLocaleData *m_data;
QBasicAtomicInt ref;
+ uint m_data_offset;
QLocale::NumberOptions m_numberOptions;
};
@@ -391,7 +391,7 @@ inline QLocalePrivate *QSharedDataPointer<QLocalePrivate>::clone()
{
// cannot use QLocalePrivate's copy constructor
// since it is deleted in C++11
- return QLocalePrivate::create(d->m_data, d->m_numberOptions);
+ return QLocalePrivate::create(d->m_data, d->m_data_offset, d->m_numberOptions);
}
inline char QLocaleData::digitToCLocale(QChar in) const
@@ -416,7 +416,7 @@ inline char QLocaleData::digitToCLocale(QChar in) const
if (in == m_group)
return ',';
- if (in == m_exponential || in == QChar::toUpper(m_exponential))
+ if (in == m_exponential || in == QChar(QChar::toUpper(m_exponential)))
return 'e';
// In several languages group() is a non-breaking space (U+00A0) or its thin
diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/text/qlocale_tools.cpp
index 53258bec3e..c246028b4d 100644
--- a/src/corelib/tools/qlocale_tools.cpp
+++ b/src/corelib/text/qlocale_tools.cpp
@@ -293,7 +293,7 @@ double qt_asciiToDouble(const char *num, int numLen, bool &ok, int &processed,
// "-nan" or "+nan"
if (qstrcmp(num, "nan") == 0) {
processed = 3;
- return qt_snan();
+ return qt_qnan();
} else if ((num[0] == '-' || num[0] == '+') && qstrcmp(num + 1, "nan") == 0) {
processed = 0;
ok = false;
@@ -322,7 +322,7 @@ double qt_asciiToDouble(const char *num, int numLen, bool &ok, int &processed,
conv_flags = double_conversion::StringToDoubleConverter::ALLOW_LEADING_SPACES
| double_conversion::StringToDoubleConverter::ALLOW_TRAILING_SPACES;
}
- double_conversion::StringToDoubleConverter conv(conv_flags, 0.0, qt_snan(), 0, 0);
+ double_conversion::StringToDoubleConverter conv(conv_flags, 0.0, qt_qnan(), 0, 0);
d = conv.StringToDouble(num, numLen, &processed);
if (!qIsFinite(d)) {
@@ -398,7 +398,7 @@ qstrtoull(const char * nptr, const char **endptr, int base, bool *ok)
*ok = true;
errno = 0;
- char *endptr2 = 0;
+ char *endptr2 = nullptr;
unsigned long long result = qt_strtoull(nptr, &endptr2, base);
if (endptr)
*endptr = endptr2;
@@ -415,7 +415,7 @@ qstrtoll(const char * nptr, const char **endptr, int base, bool *ok)
{
*ok = true;
errno = 0;
- char *endptr2 = 0;
+ char *endptr2 = nullptr;
long long result = qt_strtoll(nptr, &endptr2, base);
if (endptr)
*endptr = endptr2;
diff --git a/src/corelib/tools/qlocale_tools_p.h b/src/corelib/text/qlocale_tools_p.h
index 594331ae37..594331ae37 100644
--- a/src/corelib/tools/qlocale_tools_p.h
+++ b/src/corelib/text/qlocale_tools_p.h
diff --git a/src/corelib/tools/qlocale_unix.cpp b/src/corelib/text/qlocale_unix.cpp
index f202082213..ff4274d932 100644
--- a/src/corelib/tools/qlocale_unix.cpp
+++ b/src/corelib/text/qlocale_unix.cpp
@@ -69,6 +69,7 @@ struct QSystemLocaleData
QLocale lc_messages;
QByteArray lc_messages_var;
QByteArray lc_measurement_var;
+ QByteArray lc_collate_var;
QStringList uiLanguages;
};
@@ -82,6 +83,7 @@ void QSystemLocaleData::readEnvironment()
QByteArray monetary = all.isEmpty() ? qgetenv("LC_MONETARY") : all;
lc_messages_var = all.isEmpty() ? qgetenv("LC_MESSAGES") : all;
lc_measurement_var = all.isEmpty() ? qgetenv("LC_MEASUREMENT") : all;
+ lc_collate_var = all.isEmpty() ? qgetenv("LC_COLLATE") : all;
QByteArray lang = qgetenv("LANG");
if (lang.isEmpty())
lang = QByteArray("C");
@@ -95,6 +97,8 @@ void QSystemLocaleData::readEnvironment()
lc_messages_var = lang;
if (lc_measurement_var.isEmpty())
lc_measurement_var = lang;
+ if (lc_collate_var.isEmpty())
+ lc_collate_var = lang;
lc_numeric = QLocale(QString::fromLatin1(numeric));
lc_time = QLocale(QString::fromLatin1(time));
lc_monetary = QLocale(QString::fromLatin1(monetary));
@@ -247,13 +251,15 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const
return QString();
}
case MeasurementSystem: {
- const QString meas_locale = QString::fromLatin1(d->lc_measurement_var.constData(), d->lc_measurement_var.size());
+ const QString meas_locale = QString::fromLatin1(d->lc_measurement_var);
if (meas_locale.compare(QLatin1String("Metric"), Qt::CaseInsensitive) == 0)
return QLocale::MetricSystem;
if (meas_locale.compare(QLatin1String("Other"), Qt::CaseInsensitive) == 0)
return QLocale::MetricSystem;
return QVariant((int)QLocale(meas_locale).measurementSystem());
}
+ case Collation:
+ return QString::fromLatin1(d->lc_collate_var);
case UILanguages: {
if (!d->uiLanguages.isEmpty())
return d->uiLanguages;
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp
index ebc4430046..79ea67f966 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/text/qlocale_win.cpp
@@ -116,10 +116,11 @@ struct QSystemLocalePrivate
QVariant dateTimeFormat(QLocale::FormatType);
QVariant dayName(int, QLocale::FormatType);
QVariant monthName(int, QLocale::FormatType);
- QVariant toString(const QDate &, QLocale::FormatType);
- QVariant toString(const QTime &, QLocale::FormatType);
+ QVariant toString(QDate, QLocale::FormatType);
+ QVariant toString(QTime, QLocale::FormatType);
QVariant toString(const QDateTime &, QLocale::FormatType);
QVariant measurementSystem();
+ QVariant collation();
QVariant amText();
QVariant pmText();
QVariant firstDayOfWeek();
@@ -393,7 +394,7 @@ QVariant QSystemLocalePrivate::monthName(int month, QLocale::FormatType type)
return getLocaleInfo(lctype);
}
-QVariant QSystemLocalePrivate::toString(const QDate &date, QLocale::FormatType type)
+QVariant QSystemLocalePrivate::toString(QDate date, QLocale::FormatType type)
{
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
@@ -412,7 +413,7 @@ QVariant QSystemLocalePrivate::toString(const QDate &date, QLocale::FormatType t
return QString();
}
-QVariant QSystemLocalePrivate::toString(const QTime &time, QLocale::FormatType type)
+QVariant QSystemLocalePrivate::toString(QTime time, QLocale::FormatType type)
{
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
@@ -455,6 +456,11 @@ QVariant QSystemLocalePrivate::measurementSystem()
return QLocale::MetricSystem;
}
+QVariant QSystemLocalePrivate::collation()
+{
+ return getLocaleInfo(LOCALE_SSORTLOCALE);
+}
+
QVariant QSystemLocalePrivate::amText()
{
wchar_t output[15]; // maximum length including terminating zero character for Win2003+
@@ -808,6 +814,8 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
return QVariant(QLocale::AnyScript);
case MeasurementSystem:
return d->measurementSystem();
+ case Collation:
+ return d->collation();
case AMText:
return d->amText();
case PMText:
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/text/qregexp.cpp
index adca8624f9..ac4d9bbc36 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/text/qregexp.cpp
@@ -52,15 +52,13 @@
#include "qstringlist.h"
#include "qstringmatcher.h"
#include "qvector.h"
+#include "private/qlocking_p.h"
#include <limits.h>
#include <algorithm>
QT_BEGIN_NAMESPACE
-int qFindString(const QChar *haystack, int haystackLen, int from,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs);
-
// error strings for the regexp parser
#define RXERR_OK QT_TRANSLATE_NOOP("QRegExp", "no error occurred")
#define RXERR_DISABLED QT_TRANSLATE_NOOP("QRegExp", "disabled feature used")
@@ -893,7 +891,7 @@ static bool operator==(const QRegExpEngineKey &key1, const QRegExpEngineKey &key
&& key1.cs == key2.cs;
}
-static uint qHash(const QRegExpEngineKey &key, uint seed = 0) Q_DECL_NOTHROW
+static uint qHash(const QRegExpEngineKey &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.pattern);
@@ -940,10 +938,10 @@ struct QRegExpMatchState
const QRegExpEngine *eng;
- inline QRegExpMatchState() : bigArray(0), captured(0) {}
+ inline QRegExpMatchState() : bigArray(nullptr), captured(nullptr) {}
inline ~QRegExpMatchState() { free(bigArray); }
- void drain() { free(bigArray); bigArray = 0; captured = 0; } // to save memory
+ void drain() { free(bigArray); bigArray = nullptr; captured = nullptr; } // to save memory
void prepareForMatch(QRegExpEngine *eng);
void match(const QChar *str, int len, int pos, bool minimal,
bool oneTest, int caretIndex);
@@ -1423,14 +1421,15 @@ void QRegExpMatchState::match(const QChar *str0, int len0, int pos0,
#ifndef QT_NO_REGEXP_OPTIM
if (eng->trivial && !oneTest) {
- pos = qFindString(str0, len0, pos0, eng->goodStr.unicode(), eng->goodStr.length(), eng->cs);
+ // ### Qt6: qsizetype
+ pos = int(QtPrivate::findString(QStringView(str0, len0), pos0, QStringView(eng->goodStr.unicode(), eng->goodStr.length()), eng->cs));
matchLen = eng->goodStr.length();
matched = (pos != -1);
} else
#endif
{
in = str0;
- if (in == 0)
+ if (in == nullptr)
in = &char_null;
pos = pos0;
caretPos = caretIndex;
@@ -1709,7 +1708,7 @@ void QRegExpEngine::dump() const
void QRegExpEngine::setup()
{
- ref.store(1);
+ ref.storeRelaxed(1);
#ifndef QT_NO_REGEXP_CAPTURE
f.resize(32);
nf = 0;
@@ -2037,7 +2036,7 @@ bool QRegExpMatchState::matchHere()
#ifndef QT_NO_REGEXP_CCLASS
const QRegExpCharClass &cc = eng->cl.at(m ^ QRegExpEngine::CharClassBit);
if (eng->cs)
- inside = cc.in(ch);
+ inside = cc.in(QChar(ch));
else if (cc.negative())
inside = cc.in(QChar(ch).toLower()) &&
cc.in(QChar(ch).toUpper());
@@ -2912,7 +2911,7 @@ int QRegExpEngine::getEscape()
#ifndef QT_NO_REGEXP_ESCAPE
if ((prevCh & ~0xff) == 0) {
const char *p = strchr(tab, prevCh);
- if (p != 0)
+ if (p != nullptr)
return Tok_Char | backTab[p - tab];
}
#endif
@@ -3526,7 +3525,7 @@ int QRegExpEngine::parse(const QChar *pattern, int len)
#endif
box.cat(middleBox);
box.cat(rightBox);
- yyCharClass.reset(0);
+ yyCharClass.reset();
#ifndef QT_NO_REGEXP_CAPTURE
for (int i = 0; i < nf; ++i) {
@@ -3604,7 +3603,7 @@ int QRegExpEngine::parse(const QChar *pattern, int len)
void QRegExpEngine::parseAtom(Box *box)
{
#ifndef QT_NO_REGEXP_LOOKAHEAD
- QRegExpEngine *eng = 0;
+ QRegExpEngine *eng = nullptr;
bool neg;
int len;
#endif
@@ -3801,9 +3800,9 @@ struct QRegExpPrivate
QRegExpMatchState matchState;
inline QRegExpPrivate()
- : eng(0), engineKey(QString(), QRegExp::RegExp, Qt::CaseSensitive), minimal(false) { }
+ : eng(nullptr), engineKey(QString(), QRegExp::RegExp, Qt::CaseSensitive), minimal(false) { }
inline QRegExpPrivate(const QRegExpEngineKey &key)
- : eng(0), engineKey(key), minimal(false) {}
+ : eng(nullptr), engineKey(key), minimal(false) {}
};
#if !defined(QT_NO_REGEXP_OPTIM)
@@ -3821,7 +3820,7 @@ static QBasicMutex engineCacheMutex;
static void derefEngine(QRegExpEngine *eng, const QRegExpEngineKey &key)
{
#if !defined(QT_NO_REGEXP_OPTIM)
- QMutexLocker locker(&engineCacheMutex);
+ const auto locker = qt_scoped_lock(engineCacheMutex);
if (!eng->ref.deref()) {
if (QRECache *c = engineCache()) {
c->unusedEngines.insert(key, eng, 4 + key.pattern.length() / 4);
@@ -3842,7 +3841,7 @@ static void prepareEngine_helper(QRegExpPrivate *priv)
Q_ASSERT(!priv->eng);
#if !defined(QT_NO_REGEXP_OPTIM)
- QMutexLocker locker(&engineCacheMutex);
+ const auto locker = qt_scoped_lock(engineCacheMutex);
if (QRECache *c = engineCache()) {
priv->eng = c->unusedEngines.take(priv->engineKey);
if (!priv->eng)
@@ -3882,9 +3881,9 @@ static void prepareEngineForMatch(QRegExpPrivate *priv, const QString &str)
static void invalidateEngine(QRegExpPrivate *priv)
{
- if (priv->eng != 0) {
+ if (priv->eng) {
derefEngine(priv->eng, priv->engineKey);
- priv->eng = 0;
+ priv->eng = nullptr;
priv->matchState.drain();
}
}
@@ -4042,7 +4041,7 @@ bool QRegExp::operator==(const QRegExp &rx) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QRegExp &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.priv->engineKey);
diff --git a/src/corelib/tools/qregexp.h b/src/corelib/text/qregexp.h
index b3fa242168..8f6de24c74 100644
--- a/src/corelib/tools/qregexp.h
+++ b/src/corelib/text/qregexp.h
@@ -53,7 +53,7 @@ struct QRegExpPrivate;
class QStringList;
class QRegExp;
-Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QRegExp
{
@@ -73,10 +73,8 @@ public:
QRegExp(const QRegExp &rx);
~QRegExp();
QRegExp &operator=(const QRegExp &rx);
-#ifdef Q_COMPILER_RVALUE_REFS
- QRegExp &operator=(QRegExp &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
- void swap(QRegExp &other) Q_DECL_NOTHROW { qSwap(priv, other.priv); }
+ QRegExp &operator=(QRegExp &&other) noexcept { swap(other); return *this; }
+ void swap(QRegExp &other) noexcept { qSwap(priv, other.priv); }
bool operator==(const QRegExp &rx) const;
inline bool operator!=(const QRegExp &rx) const { return !operator==(rx); }
@@ -112,7 +110,7 @@ public:
static QString escape(const QString &str);
- friend Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QRegExp &key, uint seed) noexcept;
private:
QRegExpPrivate *priv;
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index bdaa2d3243..8d2187eb28 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -460,34 +460,13 @@ QT_BEGIN_NAMESPACE
\row \li \c{"[a-z]+\\d+"} \li \b true \li \b true
\endtable
- Exact matching is not reflected in QRegularExpression. If you want to be
- sure that the subject string matches the regular expression exactly, you can wrap the
- pattern between a couple of anchoring expressions. Simply
- putting the pattern between the \c{^} and the \c{$} anchors is enough
- in most cases:
+ Exact matching is not reflected in QRegularExpression. If you want
+ to be sure that the subject string matches the regular expression
+ exactly, you can wrap the pattern using the anchoredPattern()
+ function:
\snippet code/src_corelib_tools_qregularexpression.cpp 24
- However, remember that the \c{$} anchor not only matches at the end of the
- string, but also at a newline character right before the end of the string;
- that is, the previous pattern matches against the string "this pattern must
- match exactly\\n". Also, the behaviour of both the \c{^} and the \c{$}
- anchors changes if the MultiLineOption is set either explicitly (as a
- pattern option) or implicitly (as a directive inside the pattern string).
-
- Therefore, in the most general case, you should wrap the pattern between
- the \c{\A} and the \c{\z} anchors:
-
- \snippet code/src_corelib_tools_qregularexpression.cpp 25
-
- Note the usage of the non-capturing group in order to preserve the meaning
- of the branch operator inside the pattern.
-
- The QRegularExpression::anchoredPattern() helper method does exactly that for
- you.
-
- \sa anchoredPattern
-
\section3 Porting from QRegExp's Partial Matching
When using QRegExp::exactMatch(), if an exact match was not found, one
@@ -552,7 +531,7 @@ QT_BEGIN_NAMESPACE
optimize the execution of the matching algorithm. The JIT makes extensive
usage of self-modifying code, which can lead debugging tools such as
Valgrind to crash. You must enable all checks for self-modifying code if
- you want to debug programs using QRegularExpression (f.i., see Valgrind's
+ you want to debug programs using QRegularExpression (for instance, Valgrind's
\c{--smc-check} command line option). The downside of enabling such checks
is that your program will run considerably slower.
@@ -1048,8 +1027,8 @@ void QRegularExpressionPrivate::getPatternInfo()
unsigned int hasJOptionChanged;
pcre2_pattern_info_16(compiledPattern, PCRE2_INFO_JCHANGED, &hasJOptionChanged);
if (Q_UNLIKELY(hasJOptionChanged)) {
- qWarning("QRegularExpressionPrivate::getPatternInfo(): the pattern '%s'\n is using the (?J) option; duplicate capturing group names are not supported by Qt",
- qPrintable(pattern));
+ qWarning("QRegularExpressionPrivate::getPatternInfo(): the pattern '%ls'\n is using the (?J) option; duplicate capturing group names are not supported by Qt",
+ qUtf16Printable(pattern));
}
}
@@ -1810,7 +1789,7 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QRegularExpression &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QRegularExpression &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.d->pattern);
diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/text/qregularexpression.h
index f9e7029550..f799a38ae4 100644
--- a/src/corelib/tools/qregularexpression.h
+++ b/src/corelib/text/qregularexpression.h
@@ -59,7 +59,7 @@ class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate;
class QRegularExpression;
-Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed = 0) noexcept;
class Q_CORE_EXPORT QRegularExpression
{
@@ -86,13 +86,10 @@ public:
QRegularExpression(const QRegularExpression &re);
~QRegularExpression();
QRegularExpression &operator=(const QRegularExpression &re);
-
-#ifdef Q_COMPILER_RVALUE_REFS
- QRegularExpression &operator=(QRegularExpression &&re) Q_DECL_NOTHROW
+ QRegularExpression &operator=(QRegularExpression &&re) noexcept
{ d.swap(re.d); return *this; }
-#endif
- void swap(QRegularExpression &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QRegularExpression &other) noexcept { d.swap(other.d); }
QString pattern() const;
void setPattern(const QString &pattern);
@@ -157,7 +154,7 @@ private:
friend class QRegularExpressionMatch;
friend struct QRegularExpressionMatchPrivate;
friend class QRegularExpressionMatchIterator;
- friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) noexcept;
QRegularExpression(QRegularExpressionPrivate &dd);
QExplicitlySharedDataPointer<QRegularExpressionPrivate> d;
@@ -186,12 +183,9 @@ public:
~QRegularExpressionMatch();
QRegularExpressionMatch(const QRegularExpressionMatch &match);
QRegularExpressionMatch &operator=(const QRegularExpressionMatch &match);
-
-#ifdef Q_COMPILER_RVALUE_REFS
- QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) Q_DECL_NOTHROW
+ QRegularExpressionMatch &operator=(QRegularExpressionMatch &&match) noexcept
{ d.swap(match.d); return *this; }
-#endif
- void swap(QRegularExpressionMatch &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QRegularExpressionMatch &other) noexcept { d.swap(other.d); }
QRegularExpression regularExpression() const;
QRegularExpression::MatchType matchType() const;
@@ -257,11 +251,9 @@ public:
~QRegularExpressionMatchIterator();
QRegularExpressionMatchIterator(const QRegularExpressionMatchIterator &iterator);
QRegularExpressionMatchIterator &operator=(const QRegularExpressionMatchIterator &iterator);
-#ifdef Q_COMPILER_RVALUE_REFS
- QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) Q_DECL_NOTHROW
+ QRegularExpressionMatchIterator &operator=(QRegularExpressionMatchIterator &&iterator) noexcept
{ d.swap(iterator.d); return *this; }
-#endif
- void swap(QRegularExpressionMatchIterator &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QRegularExpressionMatchIterator &other) noexcept { d.swap(other.d); }
bool isValid() const;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/text/qstring.cpp
index b25685923c..51aa0b7512 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -2,6 +2,7 @@
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2018 Intel Corporation.
+** Copyright (C) 2019 Mail.ru Group.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -48,8 +49,8 @@
#include <qtextcodec.h>
#endif
#include <private/qutfcodec_p.h>
-#include <private/qlocale_tools_p.h>
-#include "qsimd_p.h"
+#include "qlocale_tools_p.h"
+#include "private/qsimd_p.h"
#include <qnumeric.h>
#include <qdatastream.h>
#include <qlist.h>
@@ -58,7 +59,6 @@
#include "qstringbuilder.h"
#include "qstringmatcher.h"
#include "qvarlengtharray.h"
-#include "qtools_p.h"
#include "qdebug.h"
#include "qendian.h"
#include "qcollator.h"
@@ -142,19 +142,13 @@ extern "C" void qt_toLatin1_mips_dsp_asm(uchar *dst, const ushort *src, int leng
#endif
// internal
-int qFindString(const QChar *haystack, int haystackLen, int from,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs);
-int qFindStringBoyerMoore(const QChar *haystack, int haystackLen, int from,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs);
-static inline int qt_last_index_of(const QChar *haystack, int haystackLen, QChar needle,
- int from, Qt::CaseSensitivity cs);
-static inline int qt_string_count(const QChar *haystack, int haystackLen,
- const QChar *needle, int needleLen,
- Qt::CaseSensitivity cs);
-static inline int qt_string_count(const QChar *haystack, int haystackLen,
- QChar needle, Qt::CaseSensitivity cs);
-static inline int qt_find_latin1_string(const QChar *hay, int size, QLatin1String needle,
- int from, Qt::CaseSensitivity cs);
+qsizetype qFindStringBoyerMoore(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs);
+static inline qsizetype qFindChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs) noexcept;
+template <typename Haystack>
+static inline qsizetype qLastIndexOf(Haystack haystack, QChar needle, qsizetype from, Qt::CaseSensitivity cs) noexcept;
+static inline qsizetype qt_string_count(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs);
+static inline qsizetype qt_string_count(QStringView haystack, QChar needle, Qt::CaseSensitivity cs);
+
static inline bool qt_starts_with(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs);
static inline bool qt_starts_with(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs);
static inline bool qt_starts_with(QStringView haystack, QChar needle, Qt::CaseSensitivity cs);
@@ -162,7 +156,7 @@ static inline bool qt_ends_with(QStringView haystack, QStringView needle, Qt::Ca
static inline bool qt_ends_with(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs);
static inline bool qt_ends_with(QStringView haystack, QChar needle, Qt::CaseSensitivity cs);
-qsizetype QtPrivate::qustrlen(const ushort *str) Q_DECL_NOTHROW
+qsizetype QtPrivate::qustrlen(const ushort *str) noexcept
{
qsizetype result = 0;
@@ -208,7 +202,7 @@ qsizetype QtPrivate::qustrlen(const ushort *str) Q_DECL_NOTHROW
return result;
}
-#if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)
+#if !defined(__OPTIMIZE_SIZE__)
namespace {
template <uint MaxCount> struct UnrollTailLoop
{
@@ -460,7 +454,7 @@ static Q_ALWAYS_INLINE __m128i mm_load8_zero_extend(const void *ptr)
// Note: ptr on output may be off by one and point to a preceding US-ASCII
// character. Usually harmless.
-bool qt_is_ascii(const char *&ptr, const char *end) Q_DECL_NOTHROW
+bool qt_is_ascii(const char *&ptr, const char *end) noexcept
{
#if defined(__SSE2__)
// Testing for the high bit can be done efficiently with just PMOVMSKB
@@ -520,7 +514,7 @@ bool qt_is_ascii(const char *&ptr, const char *end) Q_DECL_NOTHROW
return true;
}
-bool QtPrivate::isAscii(QLatin1String s) Q_DECL_NOTHROW
+bool QtPrivate::isAscii(QLatin1String s) noexcept
{
const char *ptr = s.begin();
const char *end = s.end();
@@ -547,7 +541,7 @@ static bool isAscii(const QChar *&ptr, const QChar *end)
return true;
}
-bool QtPrivate::isAscii(QStringView s) Q_DECL_NOTHROW
+bool QtPrivate::isAscii(QStringView s) noexcept
{
const QChar *ptr = s.begin();
const QChar *end = s.end();
@@ -555,7 +549,7 @@ bool QtPrivate::isAscii(QStringView s) Q_DECL_NOTHROW
return isAscii(ptr, end);
}
-bool QtPrivate::isLatin1(QStringView s) Q_DECL_NOTHROW
+bool QtPrivate::isLatin1(QStringView s) noexcept
{
const QChar *ptr = s.begin();
const QChar *end = s.end();
@@ -595,7 +589,7 @@ bool QtPrivate::isLatin1(QStringView s) Q_DECL_NOTHROW
}
// conversion between Latin 1 and UTF-16
-void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW
+void qt_from_latin1(ushort *dst, const char *str, size_t size) noexcept
{
/* SIMD:
* Unpacking with SSE has been shown to improve performance on recent CPUs
@@ -638,7 +632,7 @@ void qt_from_latin1(ushort *dst, const char *str, size_t size) Q_DECL_NOTHROW
size = size % 8;
dst += offset;
str += offset;
-# if defined(Q_COMPILER_LAMBDA) && !defined(__OPTIMIZE_SIZE__)
+# if !defined(__OPTIMIZE_SIZE__)
return UnrollTailLoop<7>::exec(int(size), [=](int i) { dst[i] = (uchar)str[i]; });
# endif
#endif
@@ -833,9 +827,9 @@ static int ucstricmp(const QChar *a, const QChar *ae, const QChar *b, const QCha
uint alast = 0;
uint blast = 0;
while (a < e) {
-// qDebug() << hex << alast << blast;
-// qDebug() << hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast);
-// qDebug() << hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast);
+// qDebug() << Qt::hex << alast << blast;
+// qDebug() << Qt::hex << "*a=" << *a << "alast=" << alast << "folded=" << foldCase (*a, alast);
+// qDebug() << Qt::hex << "*b=" << *b << "blast=" << blast << "folded=" << foldCase (*b, blast);
int diff = foldCase(a->unicode(), alast) - foldCase(b->unicode(), blast);
if ((diff))
return diff;
@@ -1152,7 +1146,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l)
}
template <typename Number>
-Q_DECL_CONSTEXPR int lencmp(Number lhs, Number rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR int lencmp(Number lhs, Number rhs) noexcept
{
return lhs == rhs ? 0 :
lhs > rhs ? 1 :
@@ -1176,7 +1170,7 @@ static int ucstrcmp(const QChar *a, size_t alen, const char *b, size_t blen)
return cmp ? cmp : lencmp(alen, blen);
}
-static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
if (cs == Qt::CaseSensitive)
return ucstrcmp(lhs.begin(), lhs.size(), rhs.begin(), rhs.size());
@@ -1184,7 +1178,7 @@ static int qt_compare_strings(QStringView lhs, QStringView rhs, Qt::CaseSensitiv
return ucstricmp(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
-static int qt_compare_strings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
if (cs == Qt::CaseSensitive)
return ucstrcmp(lhs.begin(), lhs.size(), rhs.begin(), rhs.size());
@@ -1192,12 +1186,12 @@ static int qt_compare_strings(QStringView lhs, QLatin1String rhs, Qt::CaseSensit
return ucstricmp(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
-static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
return -qt_compare_strings(rhs, lhs, cs);
}
-static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
if (lhs.isEmpty())
return lencmp(0, rhs.size());
@@ -1222,7 +1216,7 @@ static int qt_compare_strings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSens
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -1242,7 +1236,7 @@ int QtPrivate::compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitiv
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -1262,7 +1256,7 @@ int QtPrivate::compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensit
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
@@ -1282,47 +1276,14 @@ int QtPrivate::compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensit
of the characters and is very fast, but is not what a human would expect.
Consider sorting user-visible strings with QString::localeAwareCompare().
*/
-int QtPrivate::compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+int QtPrivate::compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs) noexcept
{
return qt_compare_strings(lhs, rhs, cs);
}
-/*!
- \internal
-
- Returns the index position of the first occurrence of the
- character \a ch in the string given by \a str and \a len,
- searching forward from index
- position \a from. Returns -1 if \a ch could not be found.
-*/
-static int findChar(const QChar *str, int len, QChar ch, int from,
- Qt::CaseSensitivity cs)
-{
- const ushort *s = (const ushort *)str;
- ushort c = ch.unicode();
- if (from < 0)
- from = qMax(from + len, 0);
- if (from < len) {
- const ushort *n = s + from;
- const ushort *e = s + len;
- if (cs == Qt::CaseSensitive) {
- n = QtPrivate::qustrchr(QStringView(n, e), c);
- if (n != e)
- return n - s;
- } else {
- c = foldCase(c);
- --n;
- while (++n != e)
- if (foldCase(*n) == c)
- return n - s;
- }
- }
- return -1;
-}
-
#define REHASH(a) \
- if (sl_minus_1 < sizeof(uint) * CHAR_BIT) \
- hashHaystack -= uint(a) << sl_minus_1; \
+ if (sl_minus_1 < sizeof(std::size_t) * CHAR_BIT) \
+ hashHaystack -= std::size_t(a) << sl_minus_1; \
hashHaystack <<= 1
inline bool qIsUpper(char ch)
@@ -2107,7 +2068,7 @@ int QString::toUcs4_helper(const ushort *uc, int length, uint *out)
\note This function does not append a null character to the array.
- \sa utf16(), toUcs4(), toLatin1(), toUtf8(), toLocal8Bit(), toStdWString()
+ \sa utf16(), toUcs4(), toLatin1(), toUtf8(), toLocal8Bit(), toStdWString(), QStringView::toWCharArray()
*/
/*! \fn QString::QString(const QString &other)
@@ -2428,7 +2389,7 @@ void QString::expand(int i)
string.
*/
-QString &QString::operator=(const QString &other) Q_DECL_NOTHROW
+QString &QString::operator=(const QString &other) noexcept
{
other.d->ref.ref();
if (!d->ref.deref())
@@ -3101,7 +3062,7 @@ void QString::replace_helper(uint *indices, int nIndices, int blen, const QChar
{
// Copy after if it lies inside our own d->data() area (which we could
// possibly invalidate via a realloc or modify by replacement).
- QChar *afterBuffer = 0;
+ QChar *afterBuffer = nullptr;
if (pointsIntoRange(after, d->data(), d->size)) // Use copy in place of vulnerable original:
after = afterBuffer = textCopy(after, alen);
@@ -3186,7 +3147,7 @@ QString &QString::replace(const QChar *before, int blen,
return *this;
QStringMatcher matcher(before, blen, cs);
- QChar *beforeBuffer = 0, *afterBuffer = 0;
+ QChar *beforeBuffer = nullptr, *afterBuffer = nullptr;
int index = 0;
while (1) {
@@ -3246,7 +3207,7 @@ QString& QString::replace(QChar ch, const QString &after, Qt::CaseSensitivity cs
return remove(ch, cs);
if (after.d->size == 1)
- return replace(ch, after.d->data()[0], cs);
+ return replace(ch, after.front(), cs);
if (d->size == 0)
return *this;
@@ -3414,7 +3375,7 @@ QString &QString::replace(QChar c, QLatin1String after, Qt::CaseSensitivity cs)
expect. Consider sorting user-interface strings with
localeAwareCompare().
*/
-bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW
+bool operator==(const QString &s1, const QString &s2) noexcept
{
if (s1.d->size != s2.d->size)
return false;
@@ -3427,7 +3388,7 @@ bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW
Returns \c true if this string is equal to \a other; otherwise
returns \c false.
*/
-bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
+bool QString::operator==(QLatin1String other) const noexcept
{
if (d->size != other.size())
return false;
@@ -3479,7 +3440,7 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW
expect. Consider sorting user-interface strings using the
QString::localeAwareCompare() function.
*/
-bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW
+bool operator<(const QString &s1, const QString &s2) noexcept
{
return qt_compare_strings(s1, s2, Qt::CaseSensitive) < 0;
}
@@ -3490,7 +3451,7 @@ bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW
Returns \c true if this string is lexically less than the parameter
string called \a other; otherwise returns \c false.
*/
-bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
+bool QString::operator<(QLatin1String other) const noexcept
{
return qt_compare_strings(*this, other, Qt::CaseSensitive) < 0;
}
@@ -3599,7 +3560,7 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW
Returns \c true if this string is lexically greater than the parameter
string \a other; otherwise returns \c false.
*/
-bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
+bool QString::operator>(QLatin1String other) const noexcept
{
return qt_compare_strings(*this, other, Qt::CaseSensitive) > 0;
}
@@ -3737,6 +3698,7 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
\sa QT_NO_CAST_FROM_ASCII
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
Returns the index position of the first occurrence of the string \a
str in this string, searching forward from index position \a
@@ -3756,8 +3718,28 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW
*/
int QString::indexOf(const QString &str, int from, Qt::CaseSensitivity cs) const
{
- return qFindString(unicode(), length(), from, str.unicode(), str.length(), cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::findString(QStringView(unicode(), length()), from, QStringView(str.unicode(), str.length()), cs));
}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ \fn int QString::indexOf(QStringView str, int from, Qt::CaseSensitivity cs) const
+ \since 5.14
+ \overload indexOf()
+
+ Returns the index position of the first occurrence of the string view \a str
+ in this string, searching forward from index position \a from.
+ Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ If \a from is -1, the search starts at the last character; if it is
+ -2, at the next to last character and so on.
+
+ \sa QStringView::indexOf(), lastIndexOf(), contains(), count()
+*/
/*!
\since 4.5
@@ -3780,85 +3762,8 @@ int QString::indexOf(const QString &str, int from, Qt::CaseSensitivity cs) const
int QString::indexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) const
{
- return qt_find_latin1_string(unicode(), size(), str, from, cs);
-}
-
-int qFindString(
- const QChar *haystack0, int haystackLen, int from,
- const QChar *needle0, int needleLen, Qt::CaseSensitivity cs)
-{
- const int l = haystackLen;
- const int sl = needleLen;
- if (from < 0)
- from += l;
- if (uint(sl + from) > (uint)l)
- return -1;
- if (!sl)
- return from;
- if (!l)
- return -1;
-
- if (sl == 1)
- return findChar(haystack0, haystackLen, needle0[0], from, cs);
-
- /*
- We use the Boyer-Moore algorithm in cases where the overhead
- for the skip table should pay off, otherwise we use a simple
- hash function.
- */
- if (l > 500 && sl > 5)
- return qFindStringBoyerMoore(haystack0, haystackLen, from,
- needle0, needleLen, cs);
-
- auto sv = [sl](const ushort *v) { return QStringView(v, sl); };
- /*
- We use some hashing for efficiency's sake. Instead of
- comparing strings, we compare the hash value of str with that
- of a part of this QString. Only if that matches, we call
- qt_string_compare().
- */
- const ushort *needle = (const ushort *)needle0;
- const ushort *haystack = (const ushort *)haystack0 + from;
- const ushort *end = (const ushort *)haystack0 + (l-sl);
- const uint sl_minus_1 = sl - 1;
- uint hashNeedle = 0, hashHaystack = 0;
- int idx;
-
- if (cs == Qt::CaseSensitive) {
- for (idx = 0; idx < sl; ++idx) {
- hashNeedle = ((hashNeedle<<1) + needle[idx]);
- hashHaystack = ((hashHaystack<<1) + haystack[idx]);
- }
- hashHaystack -= haystack[sl_minus_1];
-
- while (haystack <= end) {
- hashHaystack += haystack[sl_minus_1];
- if (hashHaystack == hashNeedle
- && qt_compare_strings(sv(needle), sv(haystack), Qt::CaseSensitive) == 0)
- return haystack - (const ushort *)haystack0;
-
- REHASH(*haystack);
- ++haystack;
- }
- } else {
- const ushort *haystack_start = (const ushort *)haystack0;
- for (idx = 0; idx < sl; ++idx) {
- hashNeedle = (hashNeedle<<1) + foldCase(needle + idx, needle);
- hashHaystack = (hashHaystack<<1) + foldCase(haystack + idx, haystack_start);
- }
- hashHaystack -= foldCase(haystack + sl_minus_1, haystack_start);
-
- while (haystack <= end) {
- hashHaystack += foldCase(haystack + sl_minus_1, haystack_start);
- if (hashHaystack == hashNeedle
- && qt_compare_strings(sv(needle), sv(haystack), Qt::CaseInsensitive) == 0)
- return haystack - (const ushort *)haystack0;
-
- REHASH(foldCase(haystack, haystack_start));
- ++haystack;
- }
- }
- return -1;
+ // ### Qt6: qsizetype
+ return int(QtPrivate::findString(QStringView(unicode(), size()), from, str, cs));
}
/*!
@@ -3870,9 +3775,11 @@ int qFindString(
*/
int QString::indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
{
- return findChar(unicode(), length(), ch, from, cs);
+ // ### Qt6: qsizetype
+ return int(qFindChar(QStringView(unicode(), length()), ch, from, cs));
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -3887,74 +3794,8 @@ int QString::indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
*/
int QString::indexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs) const
{
- return qFindString(unicode(), length(), from, str.unicode(), str.length(), cs);
-}
-
-static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *needle, int sl, Qt::CaseSensitivity cs)
-{
- /*
- See indexOf() for explanations.
- */
-
- auto sv = [sl](const ushort *v) { return QStringView(v, sl); };
-
- const ushort *end = haystack;
- haystack += from;
- const uint sl_minus_1 = sl - 1;
- const ushort *n = needle+sl_minus_1;
- const ushort *h = haystack+sl_minus_1;
- uint hashNeedle = 0, hashHaystack = 0;
- int idx;
-
- if (cs == Qt::CaseSensitive) {
- for (idx = 0; idx < sl; ++idx) {
- hashNeedle = ((hashNeedle<<1) + *(n-idx));
- hashHaystack = ((hashHaystack<<1) + *(h-idx));
- }
- hashHaystack -= *haystack;
-
- while (haystack >= end) {
- hashHaystack += *haystack;
- if (hashHaystack == hashNeedle
- && qt_compare_strings(sv(needle), sv(haystack), Qt::CaseSensitive) == 0)
- return haystack - end;
- --haystack;
- REHASH(haystack[sl]);
- }
- } else {
- for (idx = 0; idx < sl; ++idx) {
- hashNeedle = ((hashNeedle<<1) + foldCase(n-idx, needle));
- hashHaystack = ((hashHaystack<<1) + foldCase(h-idx, end));
- }
- hashHaystack -= foldCase(haystack, end);
-
- while (haystack >= end) {
- hashHaystack += foldCase(haystack, end);
- if (hashHaystack == hashNeedle
- && qt_compare_strings(sv(haystack), sv(needle), Qt::CaseInsensitive) == 0)
- return haystack - end;
- --haystack;
- REHASH(foldCase(haystack + sl, end));
- }
- }
- return -1;
-}
-
-static inline int lastIndexOfHelper(
- const QStringRef &haystack, int from, const QStringRef &needle, Qt::CaseSensitivity cs)
-{
- return lastIndexOfHelper(reinterpret_cast<const ushort*>(haystack.unicode()), from,
- reinterpret_cast<const ushort*>(needle.unicode()), needle.size(), cs);
-}
-
-static inline int lastIndexOfHelper(
- const QStringRef &haystack, int from, QLatin1String needle, Qt::CaseSensitivity cs)
-{
- const int size = needle.size();
- QVarLengthArray<ushort> s(size);
- qt_from_latin1(s.data(), needle.latin1(), size);
- return lastIndexOfHelper(reinterpret_cast<const ushort*>(haystack.unicode()), from,
- s.data(), size, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::findString(QStringView(unicode(), length()), from, QStringView(str.unicode(), str.length()), cs));
}
/*!
@@ -3975,9 +3816,12 @@ static inline int lastIndexOfHelper(
*/
int QString::lastIndexOf(const QString &str, int from, Qt::CaseSensitivity cs) const
{
- return QStringRef(this).lastIndexOf(QStringRef(&str), from, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::lastIndexOf(*this, from, str, cs));
}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
/*!
\since 4.5
\overload lastIndexOf()
@@ -3999,7 +3843,8 @@ int QString::lastIndexOf(const QString &str, int from, Qt::CaseSensitivity cs) c
*/
int QString::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) const
{
- return QStringRef(this).lastIndexOf(str, from, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::lastIndexOf(*this, from, str, cs));
}
/*!
@@ -4010,9 +3855,11 @@ int QString::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) co
*/
int QString::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
{
- return qt_last_index_of(unicode(), size(), ch, from, cs);
+ // ### Qt6: qsizetype
+ return int(qLastIndexOf(*this, ch, from, cs));
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
\overload lastIndexOf()
@@ -4030,8 +3877,27 @@ int QString::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
*/
int QString::lastIndexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs) const
{
- return QStringRef(this).lastIndexOf(str, from, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::lastIndexOf(*this, from, str, cs));
}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ \fn int QString::lastIndexOf(QStringView str, int from, Qt::CaseSensitivity cs) const
+ \since 5.14
+ \overload lastIndexOf()
+
+ Returns the index position of the last occurrence of the string view \a
+ str in this string, searching backward from index position \a
+ from. If \a from is -1 (default), the search starts at the last
+ character; if \a from is -2, at the next to last character and so
+ on. Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ \sa indexOf(), contains(), count()
+*/
#if !(defined(QT_NO_REGEXP) && !QT_CONFIG(regularexpression))
@@ -4343,7 +4209,8 @@ QString &QString::replace(const QRegularExpression &re, const QString &after)
int QString::count(const QString &str, Qt::CaseSensitivity cs) const
{
- return qt_string_count(unicode(), size(), str.unicode(), str.size(), cs);
+ // ### Qt6: qsizetype
+ return int(qt_string_count(QStringView(unicode(), size()), QStringView(str.unicode(), str.size()), cs));
}
/*!
@@ -4359,8 +4226,9 @@ int QString::count(const QString &str, Qt::CaseSensitivity cs) const
int QString::count(QChar ch, Qt::CaseSensitivity cs) const
{
- return qt_string_count(unicode(), size(), ch, cs);
- }
+ // ### Qt6: qsizetype
+ return int(qt_string_count(QStringView(unicode(), size()), ch, cs));
+}
/*!
\since 4.8
@@ -4375,10 +4243,11 @@ int QString::count(QChar ch, Qt::CaseSensitivity cs) const
*/
int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const
{
- return qt_string_count(unicode(), size(), str.unicode(), str.size(), cs);
+ // ### Qt6: qsizetype
+ return int(qt_string_count(QStringView(unicode(), size()), QStringView(str.unicode(), str.size()), cs));
}
-
+#if QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QString::contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
Returns \c true if this string contains an occurrence of the string
@@ -4392,6 +4261,7 @@ int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
+#endif // QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QString::contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\since 5.3
@@ -4410,6 +4280,7 @@ int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const
character \a ch; otherwise returns \c false.
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QString::contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\since 4.8
@@ -4421,6 +4292,20 @@ int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*! \fn bool QString::contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \since 5.14
+ \overload contains()
+
+ Returns \c true if this string contains an occurrence of the string view
+ \a str; otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (default), the search is
+ case sensitive; otherwise the search is case insensitive.
+
+ \sa indexOf(), count()
+*/
/*! \fn bool QString::contains(const QRegExp &rx) const
@@ -4589,7 +4474,7 @@ int QString::indexOf(const QRegularExpression &re, int from, QRegularExpressionM
if (match.hasMatch()) {
const int ret = match.capturedStart();
if (rmatch)
- *rmatch = qMove(match);
+ *rmatch = std::move(match);
return ret;
}
@@ -4645,7 +4530,7 @@ int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpress
if (start < endpos) {
lastIndex = start;
if (rmatch)
- *rmatch = qMove(match);
+ *rmatch = std::move(match);
} else {
break;
}
@@ -4688,7 +4573,7 @@ bool QString::contains(const QRegularExpression &re, QRegularExpressionMatch *rm
QRegularExpressionMatch m = re.match(*this);
bool hasMatch = m.hasMatch();
if (hasMatch && rmatch)
- *rmatch = qMove(m);
+ *rmatch = std::move(m);
return hasMatch;
}
@@ -4848,7 +4733,7 @@ QString QString::section(const QString &sep, int start, int end, SectionFlags fl
class qt_section_chunk {
public:
qt_section_chunk() {}
- qt_section_chunk(int l, QStringRef s) : length(l), string(qMove(s)) {}
+ qt_section_chunk(int l, QStringRef s) : length(l), string(std::move(s)) {}
int length;
QStringRef string;
};
@@ -5680,7 +5565,7 @@ QString QString::fromUtf16(const ushort *unicode, int size)
while (unicode[size] != 0)
++size;
}
- return QUtf16::convertToUnicode((const char *)unicode, size*2, 0);
+ return QUtf16::convertToUnicode((const char *)unicode, size*2, nullptr);
}
/*!
@@ -5734,7 +5619,7 @@ QString QString::fromUcs4(const uint *unicode, int size)
while (unicode[size] != 0)
++size;
}
- return QUtf32::convertToUnicode((const char *)unicode, size*4, 0);
+ return QUtf32::convertToUnicode((const char *)unicode, size*4, nullptr);
}
@@ -5799,7 +5684,7 @@ QString QString::simplified_helper(QString &str)
namespace {
template <typename StringView>
- StringView qt_trimmed(StringView s) Q_DECL_NOTHROW
+ StringView qt_trimmed(StringView s) noexcept
{
auto begin = s.begin();
auto end = s.end();
@@ -5823,12 +5708,12 @@ namespace {
\sa QString::trimmed(), QStringView::trimmed(), QLatin1String::trimmed()
*/
-QStringView QtPrivate::trimmed(QStringView s) Q_DECL_NOTHROW
+QStringView QtPrivate::trimmed(QStringView s) noexcept
{
return qt_trimmed(s);
}
-QLatin1String QtPrivate::trimmed(QLatin1String s) Q_DECL_NOTHROW
+QLatin1String QtPrivate::trimmed(QLatin1String s) noexcept
{
return qt_trimmed(s);
}
@@ -5887,6 +5772,15 @@ QString QString::trimmed_helper(QString &str)
were a reference to a QChar. If you assign to it, the assignment will apply to
the character in the QString from which you got the reference.
+ \note Before Qt 5.14 it was possible to use this operator to access
+ a character at an out-of-bounds position in the string, and
+ then assign to such a position, causing the string to be
+ automatically resized. Furthermore, assigning a value to the
+ returned QCharRef would cause a detach of the string, even if the
+ string has been copied in the meanwhile (and the QCharRef kept
+ alive while the copy was taken). These behaviors are deprecated,
+ and will be changed in a future version of Qt.
+
\sa at()
*/
@@ -6366,7 +6260,7 @@ QString& QString::fill(QChar ch, int size)
Same as compare(*this, \a other, \a cs).
*/
-int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+int QString::compare(const QString &other, Qt::CaseSensitivity cs) const noexcept
{
return qt_compare_strings(*this, other, cs);
}
@@ -6377,7 +6271,7 @@ int QString::compare(const QString &other, Qt::CaseSensitivity cs) const Q_DECL_
\since 4.5
*/
int QString::compare_helper(const QChar *data1, int length1, const QChar *data2, int length2,
- Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs) noexcept
{
Q_ASSERT(length1 >= 0);
Q_ASSERT(length2 >= 0);
@@ -6392,7 +6286,7 @@ int QString::compare_helper(const QChar *data1, int length1, const QChar *data2,
Same as compare(*this, \a other, \a cs).
*/
-int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+int QString::compare(QLatin1String other, Qt::CaseSensitivity cs) const noexcept
{
return qt_compare_strings(*this, other, cs);
}
@@ -6438,7 +6332,7 @@ int QString::compare_helper(const QChar *data1, int length1, const char *data2,
\since 4.5
*/
int QString::compare_helper(const QChar *data1, int length1, QLatin1String s2,
- Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs) noexcept
{
Q_ASSERT(length1 >= 0);
Q_ASSERT(data1 || length1 == 0);
@@ -6735,21 +6629,21 @@ namespace QUnicodeTables {
reallocate memory to grow the buffer. In that case, we need to adjust the \a
it pointer.
*/
-template <typename Traits, typename T>
+template <typename T>
Q_NEVER_INLINE
-static QString detachAndConvertCase(T &str, QStringIterator it)
+static QString detachAndConvertCase(T &str, QStringIterator it, QUnicodeTables::Case which)
{
Q_ASSERT(!str.isEmpty());
- QString s = qMove(str); // will copy if T is const QString
+ QString s = std::move(str); // will copy if T is const QString
QChar *pp = s.begin() + it.index(); // will detach if necessary
do {
uint uc = it.nextUnchecked();
- const QUnicodeTables::Properties *prop = qGetProp(uc);
- signed short caseDiff = Traits::caseDiff(prop);
+ const auto fold = qGetProp(uc)->cases[which];
+ signed short caseDiff = fold.diff;
- if (Q_UNLIKELY(Traits::caseSpecial(prop))) {
+ if (Q_UNLIKELY(fold.special)) {
const ushort *specialCase = specialCaseMap + caseDiff;
ushort length = *specialCase++;
@@ -6771,7 +6665,7 @@ static QString detachAndConvertCase(T &str, QStringIterator it)
} else if (Q_UNLIKELY(QChar::requiresSurrogates(uc))) {
// so far, case convertion never changes planes (guaranteed by the qunicodetables generator)
pp++;
- *pp++ = QChar::lowSurrogate(uc + caseDiff);
+ *pp++ = QChar(QChar::lowSurrogate(uc + caseDiff));
} else {
*pp++ = QChar(uc + caseDiff);
}
@@ -6780,8 +6674,8 @@ static QString detachAndConvertCase(T &str, QStringIterator it)
return s;
}
-template <typename Traits, typename T>
-static QString convertCase(T &str)
+template <typename T>
+static QString convertCase(T &str, QUnicodeTables::Case which)
{
const QChar *p = str.constBegin();
const QChar *e = p + str.size();
@@ -6793,23 +6687,23 @@ static QString convertCase(T &str)
QStringIterator it(p, e);
while (it.hasNext()) {
uint uc = it.nextUnchecked();
- if (Traits::caseDiff(qGetProp(uc))) {
+ if (qGetProp(uc)->cases[which].diff) {
it.recedeUnchecked();
- return detachAndConvertCase<Traits>(str, it);
+ return detachAndConvertCase(str, it, which);
}
}
- return qMove(str);
+ return std::move(str);
}
} // namespace QUnicodeTables
QString QString::toLower_helper(const QString &str)
{
- return QUnicodeTables::convertCase<QUnicodeTables::LowercaseTraits>(str);
+ return QUnicodeTables::convertCase(str, QUnicodeTables::LowerCase);
}
QString QString::toLower_helper(QString &str)
{
- return QUnicodeTables::convertCase<QUnicodeTables::LowercaseTraits>(str);
+ return QUnicodeTables::convertCase(str, QUnicodeTables::LowerCase);
}
/*!
@@ -6821,12 +6715,12 @@ QString QString::toLower_helper(QString &str)
QString QString::toCaseFolded_helper(const QString &str)
{
- return QUnicodeTables::convertCase<QUnicodeTables::CasefoldTraits>(str);
+ return QUnicodeTables::convertCase(str, QUnicodeTables::CaseFold);
}
QString QString::toCaseFolded_helper(QString &str)
{
- return QUnicodeTables::convertCase<QUnicodeTables::CasefoldTraits>(str);
+ return QUnicodeTables::convertCase(str, QUnicodeTables::CaseFold);
}
/*!
@@ -6844,14 +6738,15 @@ QString QString::toCaseFolded_helper(QString &str)
QString QString::toUpper_helper(const QString &str)
{
- return QUnicodeTables::convertCase<QUnicodeTables::UppercaseTraits>(str);
+ return QUnicodeTables::convertCase(str, QUnicodeTables::UpperCase);
}
QString QString::toUpper_helper(QString &str)
{
- return QUnicodeTables::convertCase<QUnicodeTables::UppercaseTraits>(str);
+ return QUnicodeTables::convertCase(str, QUnicodeTables::UpperCase);
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
\obsolete
@@ -6865,6 +6760,7 @@ QString &QString::sprintf(const char *cformat, ...)
va_end(ap);
return *this;
}
+#endif
// ### Qt 6: Consider whether this function shouldn't be removed See task 202871.
/*!
@@ -6910,6 +6806,7 @@ QString QString::asprintf(const char *cformat, ...)
return s;
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
\obsolete
@@ -6919,6 +6816,7 @@ QString &QString::vsprintf(const char *cformat, va_list ap)
{
return *this = vasprintf(cformat, ap);
}
+#endif
static void append_utf8(QString &qs, const char *cs, int len)
{
@@ -6928,7 +6826,7 @@ static void append_utf8(QString &qs, const char *cs, int len)
qs.resize(newEnd - qs.constData());
}
-static uint parse_flag_characters(const char * &c) Q_DECL_NOTHROW
+static uint parse_flag_characters(const char * &c) noexcept
{
uint flags = QLocaleData::ZeroPadExponent;
while (true) {
@@ -6965,7 +6863,7 @@ static int parse_field_width(const char * &c)
enum LengthMod { lm_none, lm_hh, lm_h, lm_l, lm_ll, lm_L, lm_j, lm_z, lm_t };
-static inline bool can_consume(const char * &c, char ch) Q_DECL_NOTHROW
+static inline bool can_consume(const char * &c, char ch) noexcept
{
if (*c == ch) {
++c;
@@ -6974,7 +6872,7 @@ static inline bool can_consume(const char * &c, char ch) Q_DECL_NOTHROW
return false;
}
-static LengthMod parse_length_modifier(const char * &c) Q_DECL_NOTHROW
+static LengthMod parse_length_modifier(const char * &c) noexcept
{
switch (*c++) {
case 'h': return can_consume(c, 'h') ? lm_hh : lm_h;
@@ -7799,10 +7697,10 @@ static ResultList splitString(const StringSource &source, const QChar *sep,
QString::SplitBehavior behavior, Qt::CaseSensitivity cs, const int separatorSize)
{
ResultList list;
- int start = 0;
- int end;
- int extra = 0;
- while ((end = qFindString(source.constData(), source.size(), start + extra, sep, separatorSize, cs)) != -1) {
+ typename StringSource::size_type start = 0;
+ typename StringSource::size_type end;
+ typename StringSource::size_type extra = 0;
+ while ((end = QtPrivate::findString(QStringView(source.constData(), source.size()), start + extra, QStringView(sep, separatorSize), cs)) != -1) {
if (start != end || behavior == QString::KeepEmptyParts)
list.append(source.mid(start, end - start));
start = end + separatorSize;
@@ -8136,7 +8034,7 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar::
version = QChar::currentUnicodeVersion();
} else if (int(version) <= NormalizationCorrectionsVersionMax) {
const QString &s = *data;
- QChar *d = 0;
+ QChar *d = nullptr;
for (int i = 0; i < NumNormalizationCorrections; ++i) {
const NormalizationCorrection &n = uc_normalization_corrections[i];
if (n.version > version) {
@@ -8873,19 +8771,23 @@ QString QString::arg(double a, int fieldWidth, char fmt, int prec, QChar fillCha
return replaceArgEscapes(*this, d, fieldWidth, arg, locale_arg, fillChar);
}
-static int getEscape(const QChar *uc, int *pos, int len, int maxNumber = 999)
+static inline ushort to_unicode(const QChar c) { return c.unicode(); }
+static inline ushort to_unicode(const char c) { return QLatin1Char{c}.unicode(); }
+
+template <typename Char>
+static int getEscape(const Char *uc, qsizetype *pos, qsizetype len, int maxNumber = 999)
{
int i = *pos;
++i;
if (i < len && uc[i] == QLatin1Char('L'))
++i;
if (i < len) {
- int escape = uc[i].unicode() - '0';
+ int escape = to_unicode(uc[i]) - '0';
if (uint(escape) >= 10U)
return -1;
++i;
while (i < len) {
- int digit = uc[i].unicode() - '0';
+ int digit = to_unicode(uc[i]) - '0';
if (uint(digit) >= 10U)
break;
escape = (escape * 10) + digit;
@@ -8936,18 +8838,23 @@ static int getEscape(const QChar *uc, int *pos, int len, int maxNumber = 999)
namespace {
struct Part
{
- Part() : stringRef(), number(0) {}
- Part(const QString &s, int pos, int len, int num = -1) Q_DECL_NOTHROW
- : stringRef(&s, pos, len), number(num) {}
+ Part() = default; // for QVarLengthArray; do not use
+ Q_DECL_CONSTEXPR Part(QStringView s, int num = -1)
+ : tag{QtPrivate::ArgBase::U16}, number{num}, data{s.utf16()}, size{s.size()} {}
+ Q_DECL_CONSTEXPR Part(QLatin1String s, int num = -1)
+ : tag{QtPrivate::ArgBase::L1}, number{num}, data{s.data()}, size{s.size()} {}
- QStringRef stringRef;
+ void reset(QStringView s) noexcept { *this = {s, number}; }
+ void reset(QLatin1String s) noexcept { *this = {s, number}; }
+
+ QtPrivate::ArgBase::Tag tag;
int number;
+ const void *data;
+ qsizetype size;
};
} // unnamed namespace
-template <>
-class QTypeInfo<Part> : public QTypeInfoMerger<Part, QStringRef, int> {}; // Q_DECLARE_METATYPE
-
+Q_DECLARE_TYPEINFO(Part, Q_PRIMITIVE_TYPE);
namespace {
@@ -8956,24 +8863,25 @@ enum { ExpectedParts = 32 };
typedef QVarLengthArray<Part, ExpectedParts> ParseResult;
typedef QVarLengthArray<int, ExpectedParts/2> ArgIndexToPlaceholderMap;
-static ParseResult parseMultiArgFormatString(const QString &s)
+template <typename StringView>
+static ParseResult parseMultiArgFormatString(StringView s)
{
ParseResult result;
- const QChar *uc = s.constData();
- const int len = s.size();
- const int end = len - 1;
- int i = 0;
- int last = 0;
+ const auto uc = s.data();
+ const auto len = s.size();
+ const auto end = len - 1;
+ qsizetype i = 0;
+ qsizetype last = 0;
while (i < end) {
if (uc[i] == QLatin1Char('%')) {
- int percent = i;
+ qsizetype percent = i;
int number = getEscape(uc, &i, len);
if (number != -1) {
if (last != percent)
- result.push_back(Part(s, last, percent - last)); // literal text (incl. failed placeholders)
- result.push_back(Part(s, percent, i - percent, number)); // parsed placeholder
+ result.push_back(Part{s.mid(last, percent - last)}); // literal text (incl. failed placeholders)
+ result.push_back(Part{s.mid(percent, i - percent), number}); // parsed placeholder
last = i;
continue;
}
@@ -8982,7 +8890,7 @@ static ParseResult parseMultiArgFormatString(const QString &s)
}
if (last < len)
- result.push_back(Part(s, last, len - last)); // trailing literal text
+ result.push_back(Part{s.mid(last, len - last)}); // trailing literal text
return result;
}
@@ -8991,9 +8899,9 @@ static ArgIndexToPlaceholderMap makeArgIndexToPlaceholderMap(const ParseResult &
{
ArgIndexToPlaceholderMap result;
- for (ParseResult::const_iterator it = parts.begin(), end = parts.end(); it != end; ++it) {
- if (it->number >= 0)
- result.push_back(it->number);
+ for (Part part : parts) {
+ if (part.number >= 0)
+ result.push_back(part.number);
}
std::sort(result.begin(), result.end());
@@ -9003,54 +8911,107 @@ static ArgIndexToPlaceholderMap makeArgIndexToPlaceholderMap(const ParseResult &
return result;
}
-static int resolveStringRefsAndReturnTotalSize(ParseResult &parts, const ArgIndexToPlaceholderMap &argIndexToPlaceholderMap, const QString *args[])
+static qsizetype resolveStringRefsAndReturnTotalSize(ParseResult &parts, const ArgIndexToPlaceholderMap &argIndexToPlaceholderMap, const QtPrivate::ArgBase *args[])
{
- int totalSize = 0;
- for (ParseResult::iterator pit = parts.begin(), end = parts.end(); pit != end; ++pit) {
- if (pit->number != -1) {
- const ArgIndexToPlaceholderMap::const_iterator ait
- = std::find(argIndexToPlaceholderMap.begin(), argIndexToPlaceholderMap.end(), pit->number);
- if (ait != argIndexToPlaceholderMap.end())
- pit->stringRef = QStringRef(args[ait - argIndexToPlaceholderMap.begin()]);
+ using namespace QtPrivate;
+ qsizetype totalSize = 0;
+ for (Part &part : parts) {
+ if (part.number != -1) {
+ const auto it = std::find(argIndexToPlaceholderMap.begin(), argIndexToPlaceholderMap.end(), part.number);
+ if (it != argIndexToPlaceholderMap.end()) {
+ const auto &arg = *args[it - argIndexToPlaceholderMap.begin()];
+ switch (arg.tag) {
+ case ArgBase::L1:
+ part.reset(static_cast<const QLatin1StringArg&>(arg).string);
+ break;
+ case ArgBase::U8:
+ Q_UNREACHABLE(); // waiting for QUtf8String...
+ break;
+ case ArgBase::U16:
+ part.reset(static_cast<const QStringViewArg&>(arg).string);
+ break;
+ }
+ }
}
- totalSize += pit->stringRef.size();
+ totalSize += part.size;
}
return totalSize;
}
} // unnamed namespace
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QString QString::multiArg(int numArgs, const QString **args) const
{
+ QVarLengthArray<QtPrivate::QStringViewArg, 9> sva;
+ sva.reserve(numArgs);
+ QVarLengthArray<const QtPrivate::ArgBase *, 9> pointers;
+ pointers.reserve(numArgs);
+ for (int i = 0; i < numArgs; ++i) {
+ sva.push_back(QtPrivate::qStringLikeToArg(*args[i]));
+ pointers.push_back(&sva.back());
+ }
+ return QtPrivate::argToQString(qToStringViewIgnoringNull(*this), static_cast<size_t>(numArgs), pointers.data());
+}
+#endif
+
+Q_ALWAYS_INLINE QString to_string(QLatin1String s) noexcept { return s; }
+Q_ALWAYS_INLINE QString to_string(QStringView s) noexcept { return s.toString(); }
+
+template <typename StringView>
+static QString argToQStringImpl(StringView pattern, size_t numArgs, const QtPrivate::ArgBase **args)
+{
// Step 1-2 above
- ParseResult parts = parseMultiArgFormatString(*this);
+ ParseResult parts = parseMultiArgFormatString(pattern);
// 3-4
ArgIndexToPlaceholderMap argIndexToPlaceholderMap = makeArgIndexToPlaceholderMap(parts);
- if (argIndexToPlaceholderMap.size() > numArgs) // 3a
- argIndexToPlaceholderMap.resize(numArgs);
- else if (argIndexToPlaceholderMap.size() < numArgs) // 3b
- qWarning("QString::arg: %d argument(s) missing in %s",
- numArgs - argIndexToPlaceholderMap.size(), toLocal8Bit().data());
+ if (static_cast<size_t>(argIndexToPlaceholderMap.size()) > numArgs) // 3a
+ argIndexToPlaceholderMap.resize(int(numArgs));
+ else if (Q_UNLIKELY(static_cast<size_t>(argIndexToPlaceholderMap.size()) < numArgs)) // 3b
+ qWarning("QString::arg: %d argument(s) missing in %ls",
+ int(numArgs - argIndexToPlaceholderMap.size()), qUtf16Printable(to_string(pattern)));
// 5
- const int totalSize = resolveStringRefsAndReturnTotalSize(parts, argIndexToPlaceholderMap, args);
+ const qsizetype totalSize = resolveStringRefsAndReturnTotalSize(parts, argIndexToPlaceholderMap, args);
// 6:
QString result(totalSize, Qt::Uninitialized);
- QChar *out = result.data();
-
- for (ParseResult::const_iterator it = parts.begin(), end = parts.end(); it != end; ++it) {
- if (const int sz = it->stringRef.size()) {
- memcpy(out, it->stringRef.constData(), sz * sizeof(QChar));
- out += sz;
+ auto out = const_cast<QChar*>(result.constData());
+
+ for (Part part : parts) {
+ switch (part.tag) {
+ case QtPrivate::ArgBase::L1:
+ if (part.size) {
+ qt_from_latin1(reinterpret_cast<ushort*>(out),
+ reinterpret_cast<const char*>(part.data), part.size);
+ }
+ break;
+ case QtPrivate::ArgBase::U8:
+ Q_UNREACHABLE(); // waiting for QUtf8String
+ break;
+ case QtPrivate::ArgBase::U16:
+ if (part.size)
+ memcpy(out, part.data, part.size * sizeof(QChar));
+ break;
}
+ out += part.size;
}
return result;
}
+QString QtPrivate::argToQString(QStringView pattern, size_t n, const ArgBase **args)
+{
+ return argToQStringImpl(pattern, n, args);
+}
+
+QString QtPrivate::argToQString(QLatin1String pattern, size_t n, const ArgBase **args)
+{
+ return argToQStringImpl(pattern, n, args);
+}
+
/*! \fn bool QString::isSimpleText() const
\internal
@@ -9604,6 +9565,58 @@ QString &QString::setRawData(const QChar *unicode, int size)
*/
/*!
+ \fn int QLatin1String::indexOf(QStringView str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \fn int QLatin1String::indexOf(QLatin1String l1, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \fn int QLatin1String::indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \since 5.14
+
+ Returns the index position of the first occurrence of the string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively, in this Latin-1 string,
+ searching forward from index position \a from. Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ If \a from is -1, the search starts at the last character; if it is
+ -2, at the next to last character and so on.
+
+ \sa QString::indexOf()
+*/
+
+/*!
+ \fn bool QLatin1String::contains(QStringView str, Qt::CaseSensitivity cs) const
+ \fn bool QLatin1String::contains(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \fn bool QLatin1String::contains(QChar c, Qt::CaseSensitivity cs) const
+ \since 5.14
+
+ Returns \c true if this Latin-1 string contains an occurrence of the string-view
+ \a str, Latin-1 string \a l1, or character \a ch; otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is
+ case-sensitive; otherwise the search is case-insensitive.
+
+ \sa indexOf(), QStringView::contains(), QStringView::indexOf(), QString::indexOf()
+*/
+
+/*!
+ \fn int QLatin1String::lastIndexOf(QStringView str, int from, Qt::CaseSensitivity cs) const
+ \fn int QLatin1String::lastIndexOf(QLatin1String l1, int from, Qt::CaseSensitivity cs) const
+ \fn int QLatin1String::lastIndexOf(QChar c, int from, Qt::CaseSensitivity cs) const
+ \since 5.14
+
+ Returns the index position of the last occurrence of the string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively, in this Latin-1 string,
+ searching backward from index position \a from. If \a from is -1 (default),
+ the search starts at the last character; if \a from is -2, at the next to last
+ character and so on. Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ \sa indexOf(), QStringView::lastIndexOf(), QStringView::indexOf(), QString::indexOf()
+*/
+
+/*!
\fn QLatin1String::const_iterator QLatin1String::begin() const
\since 5.10
@@ -10506,7 +10519,7 @@ QString QStringRef::toString() const {
Returns \c true if string reference \a s1 is lexically equal to string reference \a s2; otherwise
returns \c false.
*/
-bool operator==(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
+bool operator==(const QStringRef &s1,const QStringRef &s2) noexcept
{
return s1.size() == s2.size() && qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
@@ -10516,7 +10529,7 @@ bool operator==(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if string \a s1 is lexically equal to string reference \a s2; otherwise
returns \c false.
*/
-bool operator==(const QString &s1,const QStringRef &s2) Q_DECL_NOTHROW
+bool operator==(const QString &s1,const QStringRef &s2) noexcept
{
return s1.size() == s2.size() && qt_compare_strings(s1, s2, Qt::CaseSensitive) == 0;
}
@@ -10526,7 +10539,7 @@ bool operator==(const QString &s1,const QStringRef &s2) Q_DECL_NOTHROW
Returns \c true if string \a s1 is lexically equal to string reference \a s2; otherwise
returns \c false.
*/
-bool operator==(QLatin1String s1, const QStringRef &s2) Q_DECL_NOTHROW
+bool operator==(QLatin1String s1, const QStringRef &s2) noexcept
{
if (s1.size() != s2.size())
return false;
@@ -10545,7 +10558,7 @@ bool operator==(QLatin1String s1, const QStringRef &s2) Q_DECL_NOTHROW
expect. Consider sorting user-interface strings using the
QString::localeAwareCompare() function.
*/
-bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW
+bool operator<(const QStringRef &s1,const QStringRef &s2) noexcept
{
return qt_compare_strings(s1, s2, Qt::CaseSensitive) < 0;
}
@@ -11158,6 +11171,7 @@ QStringRef QString::midRef(int position, int n) const
\sa QString::chop(), truncate()
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -11175,8 +11189,28 @@ QStringRef QString::midRef(int position, int n) const
*/
int QStringRef::indexOf(const QString &str, int from, Qt::CaseSensitivity cs) const
{
- return qFindString(unicode(), length(), from, str.unicode(), str.length(), cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::findString(QStringView(unicode(), length()), from, QStringView(str.unicode(), str.length()), cs));
}
+#endif // QT_STRINGVIEW_LEVEL < 2
+
+/*!
+ \fn int QStringRef::indexOf(QStringView str, int from, Qt::CaseSensitivity cs) const
+ \since 5.14
+ \overload indexOf()
+
+ Returns the index position of the first occurrence of the string view \a str
+ in this string reference, searching forward from index position \a from.
+ Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ If \a from is -1, the search starts at the last character; if it is
+ -2, at the next to last character and so on.
+
+ \sa QString::indexOf(), QStringView::indexOf(), lastIndexOf(), contains(), count()
+*/
/*!
\since 4.8
@@ -11190,7 +11224,8 @@ int QStringRef::indexOf(const QString &str, int from, Qt::CaseSensitivity cs) co
*/
int QStringRef::indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
{
- return findChar(unicode(), length(), ch, from, cs);
+ // ### Qt6: qsizetype
+ return int(qFindChar(QStringView(unicode(), length()), ch, from, cs));
}
/*!
@@ -11210,9 +11245,11 @@ int QStringRef::indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
*/
int QStringRef::indexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) const
{
- return qt_find_latin1_string(unicode(), size(), str, from, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::findString(QStringView(unicode(), size()), from, str, cs));
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -11229,8 +11266,10 @@ int QStringRef::indexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) con
*/
int QStringRef::indexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs) const
{
- return qFindString(unicode(), size(), from, str.unicode(), str.size(), cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::findString(QStringView(unicode(), size()), from, QStringView(str.unicode(), str.size()), cs));
}
+#endif // QT_STRINGVIEW_LEVEL < 2
/*!
\since 4.8
@@ -11248,7 +11287,8 @@ int QStringRef::indexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs)
*/
int QStringRef::lastIndexOf(const QString &str, int from, Qt::CaseSensitivity cs) const
{
- return lastIndexOf(QStringRef(&str), from, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::lastIndexOf(*this, from, str, cs));
}
/*!
@@ -11262,28 +11302,8 @@ int QStringRef::lastIndexOf(const QString &str, int from, Qt::CaseSensitivity cs
*/
int QStringRef::lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
{
- return qt_last_index_of(unicode(), size(), ch, from, cs);
-}
-
-template<typename T>
-static int last_index_of_impl(const QStringRef &haystack, int from, const T &needle, Qt::CaseSensitivity cs)
-{
- const int sl = needle.size();
- if (sl == 1)
- return haystack.lastIndexOf(needle.at(0), from, cs);
-
- const int l = haystack.size();
- if (from < 0)
- from += l;
- int delta = l - sl;
- if (from == l && sl == 0)
- return from;
- if (uint(from) >= uint(l) || delta < 0)
- return -1;
- if (from > delta)
- from = delta;
-
- return lastIndexOfHelper(haystack, from, needle, cs);
+ // ### Qt6: qsizetype
+ return int(qLastIndexOf(*this, ch, from, cs));
}
/*!
@@ -11303,7 +11323,8 @@ static int last_index_of_impl(const QStringRef &haystack, int from, const T &nee
*/
int QStringRef::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs) const
{
- return last_index_of_impl(*this, from, str, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::lastIndexOf(*this, from, str, cs));
}
/*!
@@ -11323,10 +11344,28 @@ int QStringRef::lastIndexOf(QLatin1String str, int from, Qt::CaseSensitivity cs)
*/
int QStringRef::lastIndexOf(const QStringRef &str, int from, Qt::CaseSensitivity cs) const
{
- return last_index_of_impl(*this, from, str, cs);
+ // ### Qt6: qsizetype
+ return int(QtPrivate::lastIndexOf(*this, from, str, cs));
}
/*!
+ \fn int QStringRef::lastIndexOf(QStringView str, int from, Qt::CaseSensitivity cs) const
+ \since 5.14
+ \overload lastIndexOf()
+
+ Returns the index position of the last occurrence of the string view \a
+ str in this string, searching backward from index position \a
+ from. If \a from is -1 (default), the search starts at the last
+ character; if \a from is -2, at the next to last character and so
+ on. Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ \sa indexOf(), contains(), count()
+*/
+
+/*!
\since 4.8
Returns the number of (potentially overlapping) occurrences of
the string \a str in this string reference.
@@ -11338,7 +11377,8 @@ int QStringRef::lastIndexOf(const QStringRef &str, int from, Qt::CaseSensitivity
*/
int QStringRef::count(const QString &str, Qt::CaseSensitivity cs) const
{
- return qt_string_count(unicode(), size(), str.unicode(), str.size(), cs);
+ // ### Qt6: qsizetype
+ return int(qt_string_count(QStringView(unicode(), size()), QStringView(str.unicode(), str.size()), cs));
}
/*!
@@ -11355,7 +11395,8 @@ int QStringRef::count(const QString &str, Qt::CaseSensitivity cs) const
*/
int QStringRef::count(QChar ch, Qt::CaseSensitivity cs) const
{
- return qt_string_count(unicode(), size(), ch, cs);
+ // ### Qt6: qsizetype
+ return int(qt_string_count(QStringView(unicode(), size()), ch, cs));
}
/*!
@@ -11372,7 +11413,8 @@ int QStringRef::count(QChar ch, Qt::CaseSensitivity cs) const
*/
int QStringRef::count(const QStringRef &str, Qt::CaseSensitivity cs) const
{
- return qt_string_count(unicode(), size(), str.unicode(), str.size(), cs);
+ // ### Qt6: qsizetype
+ return int(qt_string_count(QStringView(unicode(), size()), QStringView(str.unicode(), str.size()), cs));
}
/*!
@@ -11396,7 +11438,7 @@ bool QStringRef::isRightToLeft() const
\sa QString::isRightToLeft()
*/
-bool QtPrivate::isRightToLeft(QStringView string)
+bool QtPrivate::isRightToLeft(QStringView string) noexcept
{
const ushort *p = reinterpret_cast<const ushort*>(string.data());
const ushort * const end = p + string.size();
@@ -11557,7 +11599,7 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
return qt_ends_with(*this, str, cs);
}
-
+#if QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\since 4.8
@@ -11569,6 +11611,7 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
+#endif // QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
@@ -11583,6 +11626,7 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
*/
+#if QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
\overload contains()
\since 4.8
@@ -11595,6 +11639,7 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
+#endif // QT_STRINGVIEW_LEVEL < 2
/*! \fn bool QStringRef::contains(QLatin1String str, Qt::CaseSensitivity cs) const
\since 4.8
@@ -11609,57 +11654,41 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const
\sa indexOf(), count()
*/
-static inline int qt_last_index_of(const QChar *haystack, int haystackLen, QChar needle,
- int from, Qt::CaseSensitivity cs)
-{
- ushort c = needle.unicode();
- if (from < 0)
- from += haystackLen;
- if (uint(from) >= uint(haystackLen))
- return -1;
- if (from >= 0) {
- const ushort *b = reinterpret_cast<const ushort*>(haystack);
- const ushort *n = b + from;
- if (cs == Qt::CaseSensitive) {
- for (; n >= b; --n)
- if (*n == c)
- return n - b;
- } else {
- c = foldCase(c);
- for (; n >= b; --n)
- if (foldCase(*n) == c)
- return n - b;
- }
- }
- return -1;
+/*! \fn bool QStringRef::contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \since 5.14
+ \overload contains()
+ Returns \c true if this string reference contains an occurrence of
+ the string view \a str; otherwise returns \c false.
-}
+ If \a cs is Qt::CaseSensitive (default), the search is
+ case sensitive; otherwise the search is case insensitive.
-static inline int qt_string_count(const QChar *haystack, int haystackLen,
- const QChar *needle, int needleLen,
- Qt::CaseSensitivity cs)
+ \sa indexOf(), count()
+*/
+
+static inline qsizetype qt_string_count(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs)
{
- int num = 0;
- int i = -1;
- if (haystackLen > 500 && needleLen > 5) {
- QStringMatcher matcher(needle, needleLen, cs);
- while ((i = matcher.indexIn(haystack, haystackLen, i + 1)) != -1)
+ qsizetype num = 0;
+ qsizetype i = -1;
+ if (haystack.size() > 500 && needle.size() > 5) {
+ QStringMatcher matcher(needle, cs);
+ while ((i = matcher.indexIn(haystack, i + 1)) != -1)
++num;
} else {
- while ((i = qFindString(haystack, haystackLen, i + 1, needle, needleLen, cs)) != -1)
+ while ((i = QtPrivate::findString(haystack, i + 1, needle, cs)) != -1)
++num;
}
return num;
}
-static inline int qt_string_count(const QChar *unicode, int size, QChar ch,
+static inline qsizetype qt_string_count(QStringView haystack, QChar ch,
Qt::CaseSensitivity cs)
{
ushort c = ch.unicode();
- int num = 0;
- const ushort *b = reinterpret_cast<const ushort*>(unicode);
- const ushort *i = b + size;
+ qsizetype num = 0;
+ const ushort *b = reinterpret_cast<const ushort*>(haystack.data());
+ const ushort *i = b + haystack.size();
if (cs == Qt::CaseSensitive) {
while (i != b)
if (*--i == c)
@@ -11673,24 +11702,8 @@ static inline int qt_string_count(const QChar *unicode, int size, QChar ch,
return num;
}
-static inline int qt_find_latin1_string(const QChar *haystack, int size,
- QLatin1String needle,
- int from, Qt::CaseSensitivity cs)
-{
- if (size < needle.size())
- return -1;
-
- const char *latin1 = needle.latin1();
- int len = needle.size();
- QVarLengthArray<ushort> s(len);
- qt_from_latin1(s.data(), latin1, len);
-
- return qFindString(haystack, size, from,
- reinterpret_cast<const QChar*>(s.constData()), len, cs);
-}
-
template <typename Haystack, typename Needle>
-bool qt_starts_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool qt_starts_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) noexcept
{
if (haystack.isNull())
return needle.isNull(); // historical behavior, consider changing in ### Qt 6.
@@ -11742,28 +11755,28 @@ static inline bool qt_starts_with(QStringView haystack, QChar needle, Qt::CaseSe
\sa QtPrivate::endsWith(), QString::endsWith(), QStringView::endsWith(), QLatin1String::endsWith()
*/
-bool QtPrivate::startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
-bool QtPrivate::startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
-bool QtPrivate::startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
-bool QtPrivate::startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_starts_with_impl(haystack, needle, cs);
}
template <typename Haystack, typename Needle>
-bool qt_ends_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool qt_ends_with_impl(Haystack haystack, Needle needle, Qt::CaseSensitivity cs) noexcept
{
if (haystack.isNull())
return needle.isNull(); // historical behavior, consider changing in ### Qt 6.
@@ -11815,26 +11828,310 @@ static inline bool qt_ends_with(QStringView haystack, QChar needle, Qt::CaseSens
\sa QtPrivate::startsWith(), QString::endsWith(), QStringView::endsWith(), QLatin1String::endsWith()
*/
-bool QtPrivate::endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
-bool QtPrivate::endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
-bool QtPrivate::endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
-bool QtPrivate::endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+bool QtPrivate::endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
{
return qt_ends_with_impl(haystack, needle, cs);
}
+namespace {
+template <typename Pointer>
+uint foldCaseHelper(Pointer ch, Pointer start) = delete;
+
+template <>
+uint foldCaseHelper<const QChar*>(const QChar* ch, const QChar* start)
+{
+ return foldCase(reinterpret_cast<const ushort*>(ch), reinterpret_cast<const ushort*>(start));
+}
+
+template <>
+uint foldCaseHelper<const char*>(const char* ch, const char*)
+{
+ return foldCase(ushort(uchar(*ch)));
+}
+
+template <typename T>
+ushort valueTypeToUtf16(T t) = delete;
+
+template <>
+ushort valueTypeToUtf16<QChar>(QChar t)
+{
+ return t.unicode();
+}
+
+template <>
+ushort valueTypeToUtf16<char>(char t)
+{
+ return ushort(uchar(t));
+}
+}
+
+/*!
+ \internal
+
+ Returns the index position of the first occurrence of the
+ character \a ch in the string given by \a str and \a len,
+ searching forward from index
+ position \a from. Returns -1 if \a ch could not be found.
+*/
+
+static inline qsizetype qFindChar(QStringView str, QChar ch, qsizetype from, Qt::CaseSensitivity cs) noexcept
+{
+ if (from < 0)
+ from = qMax(from + str.size(), qsizetype(0));
+ if (from < str.size()) {
+ const ushort *s = (const ushort *)str.data();
+ ushort c = ch.unicode();
+ const ushort *n = s + from;
+ const ushort *e = s + str.size();
+ if (cs == Qt::CaseSensitive) {
+ n = QtPrivate::qustrchr(QStringView(n, e), c);
+ if (n != e)
+ return n - s;
+ } else {
+ c = foldCase(c);
+ --n;
+ while (++n != e)
+ if (foldCase(*n) == c)
+ return n - s;
+ }
+ }
+ return -1;
+}
+
+qsizetype QtPrivate::findString(QStringView haystack0, qsizetype from, QStringView needle0, Qt::CaseSensitivity cs) noexcept
+{
+ const qsizetype l = haystack0.size();
+ const qsizetype sl = needle0.size();
+ if (from < 0)
+ from += l;
+ if (std::size_t(sl + from) > std::size_t(l))
+ return -1;
+ if (!sl)
+ return from;
+ if (!l)
+ return -1;
+
+ if (sl == 1)
+ return qFindChar(haystack0, needle0[0], from, cs);
+
+ /*
+ We use the Boyer-Moore algorithm in cases where the overhead
+ for the skip table should pay off, otherwise we use a simple
+ hash function.
+ */
+ if (l > 500 && sl > 5)
+ return qFindStringBoyerMoore(haystack0, from, needle0, cs);
+
+ auto sv = [sl](const ushort *v) { return QStringView(v, sl); };
+ /*
+ We use some hashing for efficiency's sake. Instead of
+ comparing strings, we compare the hash value of str with that
+ of a part of this QString. Only if that matches, we call
+ qt_string_compare().
+ */
+ const ushort *needle = (const ushort *)needle0.data();
+ const ushort *haystack = (const ushort *)(haystack0.data()) + from;
+ const ushort *end = (const ushort *)(haystack0.data()) + (l - sl);
+ const std::size_t sl_minus_1 = sl - 1;
+ std::size_t hashNeedle = 0, hashHaystack = 0;
+ qsizetype idx;
+
+ if (cs == Qt::CaseSensitive) {
+ for (idx = 0; idx < sl; ++idx) {
+ hashNeedle = ((hashNeedle<<1) + needle[idx]);
+ hashHaystack = ((hashHaystack<<1) + haystack[idx]);
+ }
+ hashHaystack -= haystack[sl_minus_1];
+
+ while (haystack <= end) {
+ hashHaystack += haystack[sl_minus_1];
+ if (hashHaystack == hashNeedle
+ && qt_compare_strings(needle0, sv(haystack), Qt::CaseSensitive) == 0)
+ return haystack - (const ushort *)haystack0.data();
+
+ REHASH(*haystack);
+ ++haystack;
+ }
+ } else {
+ const ushort *haystack_start = (const ushort *)haystack0.data();
+ for (idx = 0; idx < sl; ++idx) {
+ hashNeedle = (hashNeedle<<1) + foldCase(needle + idx, needle);
+ hashHaystack = (hashHaystack<<1) + foldCase(haystack + idx, haystack_start);
+ }
+ hashHaystack -= foldCase(haystack + sl_minus_1, haystack_start);
+
+ while (haystack <= end) {
+ hashHaystack += foldCase(haystack + sl_minus_1, haystack_start);
+ if (hashHaystack == hashNeedle
+ && qt_compare_strings(needle0, sv(haystack), Qt::CaseInsensitive) == 0)
+ return haystack - (const ushort *)haystack0.data();
+
+ REHASH(foldCase(haystack, haystack_start));
+ ++haystack;
+ }
+ }
+ return -1;
+}
+
+template <typename Haystack>
+static inline qsizetype qLastIndexOf(Haystack haystack, QChar needle,
+ qsizetype from, Qt::CaseSensitivity cs) noexcept
+{
+ if (from < 0)
+ from += haystack.size();
+ if (std::size_t(from) >= std::size_t(haystack.size()))
+ return -1;
+ if (from >= 0) {
+ ushort c = needle.unicode();
+ const auto b = haystack.data();
+ auto n = b + from;
+ if (cs == Qt::CaseSensitive) {
+ for (; n >= b; --n)
+ if (valueTypeToUtf16(*n) == c)
+ return n - b;
+ } else {
+ c = foldCase(c);
+ for (; n >= b; --n)
+ if (foldCase(valueTypeToUtf16(*n)) == c)
+ return n - b;
+ }
+ }
+ return -1;
+}
+
+template<typename Haystack, typename Needle>
+static qsizetype qLastIndexOf(Haystack haystack0, qsizetype from,
+ Needle needle0, Qt::CaseSensitivity cs) noexcept
+{
+ const qsizetype sl = needle0.size();
+ if (sl == 1)
+ return qLastIndexOf(haystack0, needle0.front(), from, cs);
+
+ const qsizetype l = haystack0.size();
+ if (from < 0)
+ from += l;
+ if (from == l && sl == 0)
+ return from;
+ const qsizetype delta = l - sl;
+ if (std::size_t(from) >= std::size_t(l) || delta < 0)
+ return -1;
+ if (from > delta)
+ from = delta;
+
+ auto sv = [sl](const typename Haystack::value_type *v) { return Haystack(v, sl); };
+
+ auto haystack = haystack0.data();
+ const auto needle = needle0.data();
+ const auto *end = haystack;
+ haystack += from;
+ const std::size_t sl_minus_1 = sl - 1;
+ const auto *n = needle + sl_minus_1;
+ const auto *h = haystack + sl_minus_1;
+ std::size_t hashNeedle = 0, hashHaystack = 0;
+ qsizetype idx;
+
+ if (cs == Qt::CaseSensitive) {
+ for (idx = 0; idx < sl; ++idx) {
+ hashNeedle = (hashNeedle << 1) + valueTypeToUtf16(*(n - idx));
+ hashHaystack = (hashHaystack << 1) + valueTypeToUtf16(*(h - idx));
+ }
+ hashHaystack -= valueTypeToUtf16(*haystack);
+
+ while (haystack >= end) {
+ hashHaystack += valueTypeToUtf16(*haystack);
+ if (hashHaystack == hashNeedle
+ && qt_compare_strings(needle0, sv(haystack), Qt::CaseSensitive) == 0)
+ return haystack - end;
+ --haystack;
+ REHASH(valueTypeToUtf16(haystack[sl]));
+ }
+ } else {
+ for (idx = 0; idx < sl; ++idx) {
+ hashNeedle = (hashNeedle << 1) + foldCaseHelper(n - idx, needle);
+ hashHaystack = (hashHaystack << 1) + foldCaseHelper(h - idx, end);
+ }
+ hashHaystack -= foldCaseHelper(haystack, end);
+
+ while (haystack >= end) {
+ hashHaystack += foldCaseHelper(haystack, end);
+ if (hashHaystack == hashNeedle
+ && qt_compare_strings(sv(haystack), needle0, Qt::CaseInsensitive) == 0)
+ return haystack - end;
+ --haystack;
+ REHASH(foldCaseHelper(haystack + sl, end));
+ }
+ }
+ return -1;
+}
+
+qsizetype QtPrivate::findString(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
+{
+ if (haystack.size() < needle.size())
+ return -1;
+
+ QVarLengthArray<ushort> s(needle.size());
+ qt_from_latin1(s.data(), needle.latin1(), needle.size());
+ return QtPrivate::findString(haystack, from, QStringView(reinterpret_cast<const QChar*>(s.constData()), s.size()), cs);
+}
+
+qsizetype QtPrivate::findString(QLatin1String haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs) noexcept
+{
+ if (haystack.size() < needle.size())
+ return -1;
+
+ QVarLengthArray<ushort> s(haystack.size());
+ qt_from_latin1(s.data(), haystack.latin1(), haystack.size());
+ return QtPrivate::findString(QStringView(reinterpret_cast<const QChar*>(s.constData()), s.size()), from, needle, cs);
+}
+
+qsizetype QtPrivate::findString(QLatin1String haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
+{
+ if (haystack.size() < needle.size())
+ return -1;
+
+ QVarLengthArray<ushort> h(haystack.size());
+ qt_from_latin1(h.data(), haystack.latin1(), haystack.size());
+ QVarLengthArray<ushort> n(needle.size());
+ qt_from_latin1(n.data(), needle.latin1(), needle.size());
+ return QtPrivate::findString(QStringView(reinterpret_cast<const QChar*>(h.constData()), h.size()), from,
+ QStringView(reinterpret_cast<const QChar*>(n.constData()), n.size()), cs);
+}
+
+qsizetype QtPrivate::lastIndexOf(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs) noexcept
+{
+ return qLastIndexOf(haystack, from, needle, cs);
+}
+
+qsizetype QtPrivate::lastIndexOf(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
+{
+ return qLastIndexOf(haystack, from, needle, cs);
+}
+
+qsizetype QtPrivate::lastIndexOf(QLatin1String haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs) noexcept
+{
+ return qLastIndexOf(haystack, from, needle, cs);
+}
+
+qsizetype QtPrivate::lastIndexOf(QLatin1String haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs) noexcept
+{
+ return qLastIndexOf(haystack, from, needle, cs);
+}
+
/*!
\since 4.8
@@ -12287,7 +12584,7 @@ QString QString::toHtmlEscaped() const
/*!
\internal
*/
-void QAbstractConcatenable::appendLatin1To(const char *a, int len, QChar *out) Q_DECL_NOTHROW
+void QAbstractConcatenable::appendLatin1To(const char *a, int len, QChar *out) noexcept
{
qt_from_latin1(reinterpret_cast<ushort *>(out), a, uint(len));
}
diff --git a/src/corelib/tools/qstring.h b/src/corelib/text/qstring.h
index b138c3f140..5def2c81a1 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/text/qstring.h
@@ -2,6 +2,7 @@
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2019 Mail.ru Group.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -56,15 +57,6 @@
#include <string>
#include <iterator>
-#if defined(Q_OS_ANDROID) && !defined(ANDROID_HAS_WSTRING)
-// std::wstring is disabled on android's glibc, as bionic lacks certain features
-// that libstdc++ checks for (like mbcslen).
-namespace std
-{
- typedef basic_string<wchar_t> wstring;
-}
-#endif
-
#include <stdarg.h>
#ifdef truncate
@@ -88,22 +80,29 @@ class QTextCodec;
class QStringRef;
template <typename T> class QVector;
+namespace QtPrivate {
+template <bool...B> class BoolList;
+}
+
class QLatin1String
{
public:
- Q_DECL_CONSTEXPR inline QLatin1String() Q_DECL_NOTHROW : m_size(0), m_data(nullptr) {}
- Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) Q_DECL_NOTHROW : m_size(s ? int(strlen(s)) : 0), m_data(s) {}
+ Q_DECL_CONSTEXPR inline QLatin1String() noexcept : m_size(0), m_data(nullptr) {}
+ Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) noexcept : m_size(s ? int(strlen(s)) : 0), m_data(s) {}
Q_DECL_CONSTEXPR explicit QLatin1String(const char *f, const char *l)
: QLatin1String(f, int(l - f)) {}
- Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int sz) Q_DECL_NOTHROW : m_size(sz), m_data(s) {}
- inline explicit QLatin1String(const QByteArray &s) Q_DECL_NOTHROW : m_size(int(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
+ Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int sz) noexcept : m_size(sz), m_data(s) {}
+ inline explicit QLatin1String(const QByteArray &s) noexcept : m_size(int(qstrnlen(s.constData(), s.size()))), m_data(s.constData()) {}
- Q_DECL_CONSTEXPR const char *latin1() const Q_DECL_NOTHROW { return m_data; }
- Q_DECL_CONSTEXPR int size() const Q_DECL_NOTHROW { return m_size; }
- Q_DECL_CONSTEXPR const char *data() const Q_DECL_NOTHROW { return m_data; }
+ Q_DECL_CONSTEXPR const char *latin1() const noexcept { return m_data; }
+ Q_DECL_CONSTEXPR int size() const noexcept { return m_size; }
+ Q_DECL_CONSTEXPR const char *data() const noexcept { return m_data; }
- Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW { return !data(); }
- Q_DECL_CONSTEXPR bool isEmpty() const Q_DECL_NOTHROW { return !size(); }
+ Q_DECL_CONSTEXPR bool isNull() const noexcept { return !data(); }
+ Q_DECL_CONSTEXPR bool isEmpty() const noexcept { return !size(); }
+
+ template <typename...Args>
+ Q_REQUIRED_RESULT inline QString arg(Args &&...args) const;
Q_DECL_CONSTEXPR QLatin1Char at(int i) const
{ return Q_ASSERT(i >= 0), Q_ASSERT(i < size()), QLatin1Char(m_data[i]); }
@@ -112,24 +111,45 @@ public:
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1Char front() const { return at(0); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QLatin1Char back() const { return at(size() - 1); }
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
- Q_REQUIRED_RESULT bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool startsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool startsWith(QChar c) const noexcept
{ return !isEmpty() && front() == c; }
- Q_REQUIRED_RESULT inline bool startsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool startsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::startsWith(*this, QStringView(&c, 1), cs); }
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
- Q_REQUIRED_RESULT bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool endsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool endsWith(QChar c) const noexcept
{ return !isEmpty() && back() == c; }
- Q_REQUIRED_RESULT inline bool endsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool endsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::endsWith(*this, QStringView(&c, 1), cs); }
+ Q_REQUIRED_RESULT int indexOf(QStringView s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::findString(*this, from, s, cs)); } // ### Qt6: qsizetype
+ Q_REQUIRED_RESULT int indexOf(QLatin1String s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::findString(*this, from, s, cs)); } // ### Qt6: qsizetype
+ Q_REQUIRED_RESULT inline int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::findString(*this, from, QStringView(&c, 1), cs)); } // ### Qt6: qsizetype
+
+ Q_REQUIRED_RESULT bool contains(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return indexOf(s, 0, cs) != -1; }
+ Q_REQUIRED_RESULT bool contains(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return indexOf(s, 0, cs) != -1; }
+ Q_REQUIRED_RESULT inline bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return indexOf(QStringView(&c, 1), 0, cs) != -1; }
+
+ Q_REQUIRED_RESULT int lastIndexOf(QStringView s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::lastIndexOf(*this, from, s, cs)); } // ### Qt6: qsizetype
+ Q_REQUIRED_RESULT int lastIndexOf(QLatin1String s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::lastIndexOf(*this, from, s, cs)); } // ### Qt6: qsizetype
+ Q_REQUIRED_RESULT inline int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::lastIndexOf(*this, from, QStringView(&c, 1), cs)); } // ### Qt6: qsizetype
+
using value_type = const char;
using reference = value_type&;
using const_reference = reference;
@@ -138,18 +158,18 @@ public:
using difference_type = int; // violates Container concept requirements
using size_type = int; // violates Container concept requirements
- Q_DECL_CONSTEXPR const_iterator begin() const Q_DECL_NOTHROW { return data(); }
- Q_DECL_CONSTEXPR const_iterator cbegin() const Q_DECL_NOTHROW { return data(); }
- Q_DECL_CONSTEXPR const_iterator end() const Q_DECL_NOTHROW { return data() + size(); }
- Q_DECL_CONSTEXPR const_iterator cend() const Q_DECL_NOTHROW { return data() + size(); }
+ Q_DECL_CONSTEXPR const_iterator begin() const noexcept { return data(); }
+ Q_DECL_CONSTEXPR const_iterator cbegin() const noexcept { return data(); }
+ Q_DECL_CONSTEXPR const_iterator end() const noexcept { return data() + size(); }
+ Q_DECL_CONSTEXPR const_iterator cend() const noexcept { return data() + size(); }
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = reverse_iterator;
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
Q_DECL_CONSTEXPR QLatin1String mid(int pos) const
{ return Q_ASSERT(pos >= 0), Q_ASSERT(pos <= size()), QLatin1String(m_data + pos, m_size - pos); }
@@ -167,14 +187,14 @@ public:
Q_DECL_RELAXED_CONSTEXPR void truncate(int n)
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size = n; }
- Q_REQUIRED_RESULT QLatin1String trimmed() const Q_DECL_NOTHROW { return QtPrivate::trimmed(*this); }
+ Q_REQUIRED_RESULT QLatin1String trimmed() const noexcept { return QtPrivate::trimmed(*this); }
- inline bool operator==(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator!=(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator>(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator<(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator>=(const QString &s) const Q_DECL_NOTHROW;
- inline bool operator<=(const QString &s) const Q_DECL_NOTHROW;
+ inline bool operator==(const QString &s) const noexcept;
+ inline bool operator!=(const QString &s) const noexcept;
+ inline bool operator>(const QString &s) const noexcept;
+ inline bool operator<(const QString &s) const noexcept;
+ inline bool operator>=(const QString &s) const noexcept;
+ inline bool operator<=(const QString &s) const noexcept;
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
inline QT_ASCII_CAST_WARN bool operator==(const char *s) const;
@@ -199,43 +219,50 @@ private:
Q_DECLARE_TYPEINFO(QLatin1String, Q_MOVABLE_TYPE);
// Qt 4.x compatibility
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_DEPRECATED_X("Use QLatin1String")
typedef QLatin1String QLatin1Literal;
+#endif
//
// QLatin1String inline implementations
//
-inline bool QtPrivate::isLatin1(QLatin1String) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR bool QtPrivate::isLatin1(QLatin1String) noexcept
{ return true; }
//
// QStringView members that require QLatin1String:
//
-bool QStringView::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+bool QStringView::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
-bool QStringView::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+bool QStringView::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
+qsizetype QStringView::indexOf(QLatin1String s, qsizetype from, Qt::CaseSensitivity cs) const noexcept
+{ return QtPrivate::findString(*this, from, s, cs); }
+bool QStringView::contains(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
+{ return indexOf(s, 0, cs) != qsizetype(-1); }
+qsizetype QStringView::lastIndexOf(QLatin1String s, qsizetype from, Qt::CaseSensitivity cs) const noexcept
+{ return QtPrivate::lastIndexOf(*this, from, s, cs); }
class Q_CORE_EXPORT QString
{
public:
typedef QStringData Data;
- inline QString() Q_DECL_NOTHROW;
+ inline QString() noexcept;
explicit QString(const QChar *unicode, int size = -1);
QString(QChar c);
QString(int size, QChar c);
inline QString(QLatin1String latin1);
- inline QString(const QString &) Q_DECL_NOTHROW;
+ inline QString(const QString &) noexcept;
inline ~QString();
QString &operator=(QChar c);
- QString &operator=(const QString &) Q_DECL_NOTHROW;
+ QString &operator=(const QString &) noexcept;
QString &operator=(QLatin1String latin1);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QString(QString && other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
- inline QString &operator=(QString &&other) Q_DECL_NOTHROW
+ inline QString(QString && other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
+ inline QString &operator=(QString &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QString &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QString &other) noexcept { qSwap(d, other.d); }
inline int size() const { return d->size; }
inline int count() const { return d->size; }
inline int length() const;
@@ -263,9 +290,9 @@ public:
inline const QChar at(int i) const;
const QChar operator[](int i) const;
- QCharRef operator[](int i);
+ Q_REQUIRED_RESULT QCharRef operator[](int i);
const QChar operator[](uint i) const;
- QCharRef operator[](uint i);
+ Q_REQUIRED_RESULT QCharRef operator[](uint i);
Q_REQUIRED_RESULT inline QChar front() const { return at(0); }
Q_REQUIRED_RESULT inline QCharRef front();
@@ -302,6 +329,7 @@ public:
QChar fillChar = QLatin1Char(' ')) const;
Q_REQUIRED_RESULT QString arg(QLatin1String a, int fieldWidth = 0,
QChar fillChar = QLatin1Char(' ')) const;
+#if QT_STRINGVIEW_LEVEL < 2
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3) const;
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
@@ -319,25 +347,68 @@ public:
Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8, const QString &a9) const;
+#endif
+private:
+ template <typename T>
+ struct is_convertible_to_view_or_qstring_helper
+ : std::integral_constant<bool,
+ std::is_convertible<T, QString>::value ||
+ std::is_convertible<T, QStringView>::value ||
+ std::is_convertible<T, QLatin1String>::value> {};
+ template <typename T>
+ struct is_convertible_to_view_or_qstring
+ : is_convertible_to_view_or_qstring_helper<typename std::decay<T>::type> {};
+public:
+ template <typename...Args>
+ Q_REQUIRED_RESULT
+#ifdef Q_CLANG_QDOC
+ QString
+#else
+ typename std::enable_if<
+ sizeof...(Args) >= 2 && std::is_same<
+ QtPrivate::BoolList<is_convertible_to_view_or_qstring<Args>::value..., true>,
+ QtPrivate::BoolList<true, is_convertible_to_view_or_qstring<Args>::value...>
+ >::value,
+ QString
+ >::type
+#endif
+ arg(Args &&...args) const
+ { return qToStringViewIgnoringNull(*this).arg(std::forward<Args>(args)...); }
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("Use vasprintf(), arg() or QTextStream instead")
QString &vsprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(2, 0);
+ QT_DEPRECATED_X("Use asprintf(), arg() or QTextStream instead")
QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3);
+#endif
static QString vasprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(1, 0);
static QString asprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(1, 2);
int indexOf(QChar c, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QLatin1String s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#if QT_STRINGVIEW_LEVEL < 2
+ int indexOf(const QString &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(const QStringRef &s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
+ Q_REQUIRED_RESULT int indexOf(QStringView s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::findString(*this, from, s, cs)); } // ### Qt6: qsizetype
int lastIndexOf(QChar c, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(QLatin1String s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#if QT_STRINGVIEW_LEVEL < 2
+ int lastIndexOf(const QString &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QStringRef &s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
+
+ Q_REQUIRED_RESULT int lastIndexOf(QStringView s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::lastIndexOf(*this, from, s, cs)); } // ### Qt6: qsizetype
inline bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#if QT_STRINGVIEW_LEVEL < 2
inline bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- inline bool contains(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline bool contains(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
+ inline bool contains(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline bool contains(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -395,7 +466,7 @@ public:
bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -404,7 +475,7 @@ public:
bool endsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -529,6 +600,30 @@ public:
Q_REQUIRED_RESULT QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const;
Q_REQUIRED_RESULT QVector<QStringRef> splitRef(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const;
#endif
+
+private:
+ static Q_DECL_CONSTEXPR SplitBehavior _sb(Qt::SplitBehavior sb) Q_DECL_NOTHROW
+ { return sb & Qt::SkipEmptyParts ? SkipEmptyParts : KeepEmptyParts; }
+public:
+
+ Q_REQUIRED_RESULT inline QStringList split(const QString &sep, Qt::SplitBehavior behavior,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(const QString &sep, Qt::SplitBehavior behavior,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT inline QStringList split(QChar sep, Qt::SplitBehavior behavior,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(QChar sep, Qt::SplitBehavior behavior,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#ifndef QT_NO_REGEXP
+ Q_REQUIRED_RESULT inline QStringList split(const QRegExp &sep, Qt::SplitBehavior behavior) const;
+ Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(const QRegExp &sep, Qt::SplitBehavior behavior) const;
+#endif
+#ifndef QT_NO_REGULAREXPRESSION
+ Q_REQUIRED_RESULT inline QStringList split(const QRegularExpression &sep, Qt::SplitBehavior behavior) const;
+ Q_REQUIRED_RESULT inline QVector<QStringRef> splitRef(const QRegularExpression &sep, Qt::SplitBehavior behavior) const;
+#endif
+
+
enum NormalizationForm {
NormalizationForm_D,
NormalizationForm_C,
@@ -609,25 +704,25 @@ public:
inline QString &setUtf16(const ushort *utf16, int size);
#if QT_STRINGVIEW_LEVEL < 2
- int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ inline int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
#endif
- int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ int compare(QLatin1String other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
static inline int compare(const QString &s1, const QString &s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept
{ return s1.compare(s2, cs); }
static inline int compare(const QString &s1, QLatin1String s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept
{ return s1.compare(s2, cs); }
static inline int compare(QLatin1String s1, const QString &s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept
{ return -s2.compare(s1, cs); }
static int compare(const QString &s1, const QStringRef &s2,
- Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity = Qt::CaseSensitive) noexcept;
int localeAwareCompare(const QString& s) const;
static int localeAwareCompare(const QString& s1, const QString& s2)
@@ -667,19 +762,19 @@ public:
static QString number(qulonglong, int base=10);
static QString number(double, char f='g', int prec=6);
- friend Q_CORE_EXPORT bool operator==(const QString &s1, const QString &s2) Q_DECL_NOTHROW;
- friend Q_CORE_EXPORT bool operator<(const QString &s1, const QString &s2) Q_DECL_NOTHROW;
- friend inline bool operator>(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return s2 < s1; }
- friend inline bool operator!=(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return !(s1 == s2); }
- friend inline bool operator<=(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return !(s1 > s2); }
- friend inline bool operator>=(const QString &s1, const QString &s2) Q_DECL_NOTHROW { return !(s1 < s2); }
+ friend Q_CORE_EXPORT bool operator==(const QString &s1, const QString &s2) noexcept;
+ friend Q_CORE_EXPORT bool operator<(const QString &s1, const QString &s2) noexcept;
+ friend inline bool operator>(const QString &s1, const QString &s2) noexcept { return s2 < s1; }
+ friend inline bool operator!=(const QString &s1, const QString &s2) noexcept { return !(s1 == s2); }
+ friend inline bool operator<=(const QString &s1, const QString &s2) noexcept { return !(s1 > s2); }
+ friend inline bool operator>=(const QString &s1, const QString &s2) noexcept { return !(s1 < s2); }
- bool operator==(QLatin1String s) const Q_DECL_NOTHROW;
- bool operator<(QLatin1String s) const Q_DECL_NOTHROW;
- bool operator>(QLatin1String s) const Q_DECL_NOTHROW;
- inline bool operator!=(QLatin1String s) const Q_DECL_NOTHROW { return !operator==(s); }
- inline bool operator<=(QLatin1String s) const Q_DECL_NOTHROW { return !operator>(s); }
- inline bool operator>=(QLatin1String s) const Q_DECL_NOTHROW { return !operator<(s); }
+ bool operator==(QLatin1String s) const noexcept;
+ bool operator<(QLatin1String s) const noexcept;
+ bool operator>(QLatin1String s) const noexcept;
+ inline bool operator!=(QLatin1String s) const noexcept { return !operator==(s); }
+ inline bool operator<=(QLatin1String s) const noexcept { return !operator>(s); }
+ inline bool operator>=(QLatin1String s) const noexcept { return !operator<(s); }
// ASCII compatibility
#if defined(QT_RESTRICTED_CAST_FROM_ASCII)
@@ -840,30 +935,30 @@ private:
Data *d;
- friend inline bool operator==(QChar, const QString &) Q_DECL_NOTHROW;
- friend inline bool operator< (QChar, const QString &) Q_DECL_NOTHROW;
- friend inline bool operator> (QChar, const QString &) Q_DECL_NOTHROW;
- friend inline bool operator==(QChar, const QStringRef &) Q_DECL_NOTHROW;
- friend inline bool operator< (QChar, const QStringRef &) Q_DECL_NOTHROW;
- friend inline bool operator> (QChar, const QStringRef &) Q_DECL_NOTHROW;
- friend inline bool operator==(QChar, QLatin1String) Q_DECL_NOTHROW;
- friend inline bool operator< (QChar, QLatin1String) Q_DECL_NOTHROW;
- friend inline bool operator> (QChar, QLatin1String) Q_DECL_NOTHROW;
+ friend inline bool operator==(QChar, const QString &) noexcept;
+ friend inline bool operator< (QChar, const QString &) noexcept;
+ friend inline bool operator> (QChar, const QString &) noexcept;
+ friend inline bool operator==(QChar, const QStringRef &) noexcept;
+ friend inline bool operator< (QChar, const QStringRef &) noexcept;
+ friend inline bool operator> (QChar, const QStringRef &) noexcept;
+ friend inline bool operator==(QChar, QLatin1String) noexcept;
+ friend inline bool operator< (QChar, QLatin1String) noexcept;
+ friend inline bool operator> (QChar, QLatin1String) noexcept;
void reallocData(uint alloc, bool grow = false);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void expand(int i);
-#endif
QString multiArg(int numArgs, const QString **args) const;
+#endif
static int compare_helper(const QChar *data1, int length1,
const QChar *data2, int length2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
static int compare_helper(const QChar *data1, int length1,
const char *data2, int length2,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
static int compare_helper(const QChar *data1, int length1,
QLatin1String s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
static int localeAwareCompare_helper(const QChar *data1, int length1,
const QChar *data2, int length2);
static QString toLower_helper(const QString &str);
@@ -931,11 +1026,11 @@ inline QString::QString(QLatin1String aLatin1) : d(fromLatin1_helper(aLatin1.lat
inline int QString::length() const
{ return d->size; }
inline const QChar QString::at(int i) const
-{ Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; }
+{ Q_ASSERT(uint(i) < uint(size())); return QChar(d->data()[i]); }
inline const QChar QString::operator[](int i) const
-{ Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; }
+{ Q_ASSERT(uint(i) < uint(size())); return QChar(d->data()[i]); }
inline const QChar QString::operator[](uint i) const
-{ Q_ASSERT(i < uint(size())); return d->data()[i]; }
+{ Q_ASSERT(i < uint(size())); return QChar(d->data()[i]); }
inline bool QString::isEmpty() const
{ return d->size == 0; }
inline const QChar *QString::unicode() const
@@ -952,7 +1047,7 @@ inline bool QString::isDetached() const
{ return !d->ref.isShared(); }
inline void QString::clear()
{ if (!isNull()) *this = QString(); }
-inline QString::QString(const QString &other) Q_DECL_NOTHROW : d(other.d)
+inline QString::QString(const QString &other) noexcept : d(other.d)
{ Q_ASSERT(&other != this); d->ref.ref(); }
inline int QString::capacity() const
{ return d->alloc ? d->alloc - 1 : 0; }
@@ -982,31 +1077,33 @@ inline QString QString::arg(short a, int fieldWidth, int base, QChar fillChar) c
{ return arg(qlonglong(a), fieldWidth, base, fillChar); }
inline QString QString::arg(ushort a, int fieldWidth, int base, QChar fillChar) const
{ return arg(qulonglong(a), fieldWidth, base, fillChar); }
+#if QT_STRINGVIEW_LEVEL < 2
inline QString QString::arg(const QString &a1, const QString &a2) const
-{ const QString *args[2] = { &a1, &a2 }; return multiArg(2, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3) const
-{ const QString *args[3] = { &a1, &a2, &a3 }; return multiArg(3, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4) const
-{ const QString *args[4] = { &a1, &a2, &a3, &a4 }; return multiArg(4, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3, a4); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5) const
-{ const QString *args[5] = { &a1, &a2, &a3, &a4, &a5 }; return multiArg(5, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3, a4, a5); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6) const
-{ const QString *args[6] = { &a1, &a2, &a3, &a4, &a5, &a6 }; return multiArg(6, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3, a4, a5, a6); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7) const
-{ const QString *args[7] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7 }; return multiArg(7, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3, a4, a5, a6, a7); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8) const
-{ const QString *args[8] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8 }; return multiArg(8, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3, a4, a5, a6, a7, a8); }
inline QString QString::arg(const QString &a1, const QString &a2, const QString &a3,
const QString &a4, const QString &a5, const QString &a6,
const QString &a7, const QString &a8, const QString &a9) const
-{ const QString *args[9] = { &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9 }; return multiArg(9, args); }
+{ return qToStringViewIgnoringNull(*this).arg(a1, a2, a3, a4, a5, a6, a7, a8, a9); }
+#endif
inline QString QString::section(QChar asep, int astart, int aend, SectionFlags aflags) const
{ return section(QString(asep), astart, aend, aflags); }
@@ -1017,11 +1114,18 @@ QT_WARNING_DISABLE_INTEL(111) // "statement is unreachable"
inline int QString::toWCharArray(wchar_t *array) const
{
+ return qToStringViewIgnoringNull(*this).toWCharArray(array);
+}
+
+int QStringView::toWCharArray(wchar_t *array) const
+{
if (sizeof(wchar_t) == sizeof(QChar)) {
- memcpy(array, d->data(), sizeof(QChar) * size());
+ if (auto src = data())
+ memcpy(array, src, sizeof(QChar) * size());
return size();
} else {
- return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array));
+ return QString::toUcs4_helper(reinterpret_cast<const ushort *>(data()), int(size()),
+ reinterpret_cast<uint *>(array));
}
}
@@ -1033,8 +1137,11 @@ inline QString QString::fromWCharArray(const wchar_t *string, int size)
: fromUcs4(reinterpret_cast<const uint *>(string), size);
}
-
-class Q_CORE_EXPORT QCharRef {
+class
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+Q_CORE_EXPORT
+#endif
+QCharRef { // ### Qt 7: remove
QString &s;
int i;
inline QCharRef(QString &str, int idx)
@@ -1046,10 +1153,33 @@ public:
// all this is not documented: We just say "like QChar" and let it be.
inline operator QChar() const
- { return i < s.d->size ? s.d->data()[i] : 0; }
+ {
+ using namespace QtPrivate::DeprecatedRefClassBehavior;
+ if (Q_LIKELY(i < s.d->size))
+ return QChar(s.d->data()[i]);
+#ifdef QT_DEBUG
+ warn(WarningType::OutOfRange, EmittingClass::QCharRef);
+#endif
+ return QChar();
+ }
inline QCharRef &operator=(QChar c)
- { if (i >= s.d->size) s.resize(i + 1, QLatin1Char(' ')); else s.detach();
- s.d->data()[i] = c.unicode(); return *this; }
+ {
+ using namespace QtPrivate::DeprecatedRefClassBehavior;
+ if (Q_UNLIKELY(i >= s.d->size)) {
+#ifdef QT_DEBUG
+ warn(WarningType::OutOfRange, EmittingClass::QCharRef);
+#endif
+ s.resize(i + 1, QLatin1Char(' '));
+ } else {
+#ifdef QT_DEBUG
+ if (Q_UNLIKELY(!s.isDetached()))
+ warn(WarningType::DelayedDetach, EmittingClass::QCharRef);
+#endif
+ s.detach();
+ }
+ s.d->data()[i] = c.unicode();
+ return *this;
+ }
// An operator= for each QChar cast constructors
#ifndef QT_NO_CAST_FROM_ASCII
@@ -1129,7 +1259,7 @@ inline void QCharRef::setRow(uchar arow) { QChar(*this).setRow(arow); }
inline void QCharRef::setCell(uchar acell) { QChar(*this).setCell(acell); }
-inline QString::QString() Q_DECL_NOTHROW : d(Data::sharedNull()) {}
+inline QString::QString() noexcept : d(Data::sharedNull()) {}
inline QString::~QString() { if (!d->ref.deref()) Data::deallocate(d); }
inline void QString::reserve(int asize)
@@ -1158,9 +1288,9 @@ inline void QString::squeeze()
inline QString &QString::setUtf16(const ushort *autf16, int asize)
{ return setUnicode(reinterpret_cast<const QChar *>(autf16), asize); }
inline QCharRef QString::operator[](int i)
-{ Q_ASSERT(i >= 0); return QCharRef(*this, i); }
+{ Q_ASSERT(i >= 0); detach(); return QCharRef(*this, i); }
inline QCharRef QString::operator[](uint i)
-{ return QCharRef(*this, i); }
+{ detach(); return QCharRef(*this, i); }
inline QCharRef QString::front() { return operator[](0); }
inline QCharRef QString::back() { return operator[](size() - 1); }
inline QString::iterator QString::begin()
@@ -1179,14 +1309,18 @@ inline QString::const_iterator QString::cend() const
{ return reinterpret_cast<const QChar*>(d->data() + d->size); }
inline QString::const_iterator QString::constEnd() const
{ return reinterpret_cast<const QChar*>(d->data() + d->size); }
+#if QT_STRINGVIEW_LEVEL < 2
inline bool QString::contains(const QString &s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
inline bool QString::contains(const QStringRef &s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
+#endif
inline bool QString::contains(QLatin1String s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
inline bool QString::contains(QChar c, Qt::CaseSensitivity cs) const
{ return indexOf(c, 0, cs) != -1; }
+inline bool QString::contains(QStringView s, Qt::CaseSensitivity cs) const noexcept
+{ return indexOf(s, 0, cs) != -1; }
#if QT_DEPRECATED_SINCE(5, 9)
inline bool operator==(QString::Null, QString::Null) { return true; }
@@ -1201,34 +1335,34 @@ QT_DEPRECATED_X("use !QString::isNull()")
inline bool operator!=(const QString &s, QString::Null) { return !s.isNull(); }
#endif
-inline bool operator==(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator==(QLatin1String s1, QLatin1String s2) noexcept
{ return s1.size() == s2.size() && (!s1.size() || !memcmp(s1.latin1(), s2.latin1(), s1.size())); }
-inline bool operator!=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator!=(QLatin1String s1, QLatin1String s2) noexcept
{ return !operator==(s1, s2); }
-inline bool operator<(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator<(QLatin1String s1, QLatin1String s2) noexcept
{
const int len = qMin(s1.size(), s2.size());
const int r = len ? memcmp(s1.latin1(), s2.latin1(), len) : 0;
return r < 0 || (r == 0 && s1.size() < s2.size());
}
-inline bool operator>(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator>(QLatin1String s1, QLatin1String s2) noexcept
{ return operator<(s2, s1); }
-inline bool operator<=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator<=(QLatin1String s1, QLatin1String s2) noexcept
{ return !operator>(s1, s2); }
-inline bool operator>=(QLatin1String s1, QLatin1String s2) Q_DECL_NOTHROW
+inline bool operator>=(QLatin1String s1, QLatin1String s2) noexcept
{ return !operator<(s1, s2); }
-inline bool QLatin1String::operator==(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator==(const QString &s) const noexcept
{ return s == *this; }
-inline bool QLatin1String::operator!=(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator!=(const QString &s) const noexcept
{ return s != *this; }
-inline bool QLatin1String::operator>(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator>(const QString &s) const noexcept
{ return s < *this; }
-inline bool QLatin1String::operator<(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator<(const QString &s) const noexcept
{ return s > *this; }
-inline bool QLatin1String::operator>=(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator>=(const QString &s) const noexcept
{ return s <= *this; }
-inline bool QLatin1String::operator<=(const QString &s) const Q_DECL_NOTHROW
+inline bool QLatin1String::operator<=(const QString &s) const noexcept
{ return s >= *this; }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
@@ -1376,14 +1510,12 @@ inline std::wstring QString::toStdWString() const
{
std::wstring str;
str.resize(length());
-
-#ifdef Q_CC_MSVC
- // VS2005 crashes if the string is empty
- if (!length())
- return str;
+#if __cplusplus >= 201703L
+ str.resize(toWCharArray(str.data()));
+#else
+ if (length())
+ str.resize(toWCharArray(&str.front()));
#endif
-
- str.resize(toWCharArray(&(*str.begin())));
return str;
}
@@ -1437,14 +1569,12 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// ### Qt 6: remove all of these, the implicit ones are fine
- QStringRef(const QStringRef &other) Q_DECL_NOTHROW
+ QStringRef(const QStringRef &other) noexcept
:m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
{}
-#ifdef Q_COMPILER_RVALUE_REFS
- QStringRef(QStringRef &&other) Q_DECL_NOTHROW : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
- QStringRef &operator=(QStringRef &&other) Q_DECL_NOTHROW { return *this = other; }
-#endif
- QStringRef &operator=(const QStringRef &other) Q_DECL_NOTHROW
+ QStringRef(QStringRef &&other) noexcept : m_string(other.m_string), m_position(other.m_position), m_size(other.m_size) {}
+ QStringRef &operator=(QStringRef &&other) noexcept { return *this = other; }
+ QStringRef &operator=(const QStringRef &other) noexcept
{
m_string = other.m_string; m_position = other.m_position;
m_size = other.m_size; return *this;
@@ -1458,19 +1588,30 @@ public:
inline int count() const { return m_size; }
inline int length() const { return m_size; }
+#if QT_STRINGVIEW_LEVEL < 2
int indexOf(const QString &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ int indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
+ Q_REQUIRED_RESULT int indexOf(QStringView s, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::findString(*this, from, s, cs)); } // ### Qt6: qsizetype
int indexOf(QChar ch, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int indexOf(QLatin1String str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- int indexOf(const QStringRef &str, int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#if QT_STRINGVIEW_LEVEL < 2
+ int lastIndexOf(const QStringRef &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(const QString &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
int lastIndexOf(QChar ch, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int lastIndexOf(QLatin1String str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- int lastIndexOf(const QStringRef &str, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT int lastIndexOf(QStringView s, int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return int(QtPrivate::lastIndexOf(*this, from, s, cs)); } // ### Qt6: qsizetype
+#if QT_STRINGVIEW_LEVEL < 2
inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline bool contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+#endif
inline bool contains(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline bool contains(QLatin1String str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
- inline bool contains(const QStringRef &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline bool contains(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
int count(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1481,14 +1622,19 @@ public:
Q_REQUIRED_RESULT QVector<QStringRef> split(QChar sep, QString::SplitBehavior behavior = QString::KeepEmptyParts,
Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT inline QVector<QStringRef> split(const QString &sep, Qt::SplitBehavior behavior,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ Q_REQUIRED_RESULT inline QVector<QStringRef> split(QChar sep, Qt::SplitBehavior behavior,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+
Q_REQUIRED_RESULT QStringRef left(int n) const;
Q_REQUIRED_RESULT QStringRef right(int n) const;
Q_REQUIRED_RESULT QStringRef mid(int pos, int n = -1) const;
Q_REQUIRED_RESULT QStringRef chopped(int n) const
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); return left(size() - n); }
- void truncate(int pos) Q_DECL_NOTHROW { m_size = qBound(0, pos, m_size); }
- void chop(int n) Q_DECL_NOTHROW
+ void truncate(int pos) noexcept { m_size = qBound(0, pos, m_size); }
+ void chop(int n) noexcept
{
if (n >= m_size)
m_size = 0;
@@ -1498,7 +1644,7 @@ public:
bool isRightToLeft() const;
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1507,7 +1653,7 @@ public:
bool startsWith(const QStringRef &c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
#endif
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -1570,19 +1716,19 @@ public:
inline QT_ASCII_CAST_WARN bool operator>=(const char *s) const;
#endif
- int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
+ int compare(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ int compare(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ int compare(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
int compare(const QByteArray &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
{ return QString::compare_helper(unicode(), size(), s.data(), qstrnlen(s.data(), s.size()), cs); }
#endif
static int compare(const QStringRef &s1, const QString &s2,
- Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity = Qt::CaseSensitive) noexcept;
static int compare(const QStringRef &s1, const QStringRef &s2,
- Qt::CaseSensitivity = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity = Qt::CaseSensitive) noexcept;
static int compare(const QStringRef &s1, QLatin1String s2,
- Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+ Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
int localeAwareCompare(const QString &s) const;
int localeAwareCompare(const QStringRef &s) const;
@@ -1613,162 +1759,162 @@ inline QStringRef::QStringRef(const QString *aString)
:m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
// QStringRef <> QStringRef
-Q_CORE_EXPORT bool operator==(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW;
-inline bool operator!=(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+Q_CORE_EXPORT bool operator==(const QStringRef &s1, const QStringRef &s2) noexcept;
+inline bool operator!=(const QStringRef &s1, const QStringRef &s2) noexcept
{ return !(s1 == s2); }
-Q_CORE_EXPORT bool operator<(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW;
-inline bool operator>(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+Q_CORE_EXPORT bool operator<(const QStringRef &s1, const QStringRef &s2) noexcept;
+inline bool operator>(const QStringRef &s1, const QStringRef &s2) noexcept
{ return s2 < s1; }
-inline bool operator<=(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+inline bool operator<=(const QStringRef &s1, const QStringRef &s2) noexcept
{ return !(s1 > s2); }
-inline bool operator>=(const QStringRef &s1, const QStringRef &s2) Q_DECL_NOTHROW
+inline bool operator>=(const QStringRef &s1, const QStringRef &s2) noexcept
{ return !(s1 < s2); }
// QString <> QStringRef
-Q_CORE_EXPORT bool operator==(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW;
-inline bool operator!=(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) != 0; }
-inline bool operator< (const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) < 0; }
-inline bool operator> (const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) > 0; }
-inline bool operator<=(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) <= 0; }
-inline bool operator>=(const QString &lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return lhs.compare(rhs) >= 0; }
-
-inline bool operator==(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs != lhs; }
-inline bool operator< (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs >= lhs; }
-inline bool operator>=(const QStringRef &lhs, const QString &rhs) Q_DECL_NOTHROW { return rhs <= lhs; }
+Q_CORE_EXPORT bool operator==(const QString &lhs, const QStringRef &rhs) noexcept;
+inline bool operator!=(const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) != 0; }
+inline bool operator< (const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) < 0; }
+inline bool operator> (const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) > 0; }
+inline bool operator<=(const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) <= 0; }
+inline bool operator>=(const QString &lhs, const QStringRef &rhs) noexcept { return lhs.compare(rhs) >= 0; }
+
+inline bool operator==(const QStringRef &lhs, const QString &rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QStringRef &lhs, const QString &rhs) noexcept { return rhs != lhs; }
+inline bool operator< (const QStringRef &lhs, const QString &rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QStringRef &lhs, const QString &rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QStringRef &lhs, const QString &rhs) noexcept { return rhs >= lhs; }
+inline bool operator>=(const QStringRef &lhs, const QString &rhs) noexcept { return rhs <= lhs; }
#if QT_STRINGVIEW_LEVEL < 2
-inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QString::compare(const QStringRef &s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
#endif
-inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QString::compare(QStringView s, Qt::CaseSensitivity cs) const noexcept
{ return -s.compare(*this, cs); }
-inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QString::compare(const QString &s1, const QStringRef &s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
-inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QStringRef::compare(const QString &s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
-inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
-inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+inline int QStringRef::compare(QLatin1String s, Qt::CaseSensitivity cs) const noexcept
{ return QString::compare_helper(constData(), length(), s, cs); }
-inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s1, const QString &s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
-inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
-inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs) Q_DECL_NOTHROW
+inline int QStringRef::compare(const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs) noexcept
{ return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
// QLatin1String <> QStringRef
-Q_CORE_EXPORT bool operator==(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW;
-inline bool operator!=(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) != 0; }
-inline bool operator< (QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) > 0; }
-inline bool operator> (QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) < 0; }
-inline bool operator<=(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) >= 0; }
-inline bool operator>=(QLatin1String lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return rhs.compare(lhs) <= 0; }
-
-inline bool operator==(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs != lhs; }
-inline bool operator< (const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs >= lhs; }
-inline bool operator>=(const QStringRef &lhs, QLatin1String rhs) Q_DECL_NOTHROW { return rhs <= lhs; }
+Q_CORE_EXPORT bool operator==(QLatin1String lhs, const QStringRef &rhs) noexcept;
+inline bool operator!=(QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) != 0; }
+inline bool operator< (QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) > 0; }
+inline bool operator> (QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) < 0; }
+inline bool operator<=(QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) >= 0; }
+inline bool operator>=(QLatin1String lhs, const QStringRef &rhs) noexcept { return rhs.compare(lhs) <= 0; }
+
+inline bool operator==(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs != lhs; }
+inline bool operator< (const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs >= lhs; }
+inline bool operator>=(const QStringRef &lhs, QLatin1String rhs) noexcept { return rhs <= lhs; }
// QChar <> QString
-inline bool operator==(QChar lhs, const QString &rhs) Q_DECL_NOTHROW
+inline bool operator==(QChar lhs, const QString &rhs) noexcept
{ return rhs.size() == 1 && lhs == rhs.front(); }
-inline bool operator< (QChar lhs, const QString &rhs) Q_DECL_NOTHROW
+inline bool operator< (QChar lhs, const QString &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) < 0; }
-inline bool operator> (QChar lhs, const QString &rhs) Q_DECL_NOTHROW
+inline bool operator> (QChar lhs, const QString &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) > 0; }
-inline bool operator!=(QChar lhs, const QString &rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator<=(QChar lhs, const QString &rhs) Q_DECL_NOTHROW { return !(lhs > rhs); }
-inline bool operator>=(QChar lhs, const QString &rhs) Q_DECL_NOTHROW { return !(lhs < rhs); }
+inline bool operator!=(QChar lhs, const QString &rhs) noexcept { return !(lhs == rhs); }
+inline bool operator<=(QChar lhs, const QString &rhs) noexcept { return !(lhs > rhs); }
+inline bool operator>=(QChar lhs, const QString &rhs) noexcept { return !(lhs < rhs); }
-inline bool operator==(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs == lhs); }
-inline bool operator< (const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs < lhs); }
-inline bool operator>=(const QString &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs > lhs); }
+inline bool operator==(const QString &lhs, QChar rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QString &lhs, QChar rhs) noexcept { return !(rhs == lhs); }
+inline bool operator< (const QString &lhs, QChar rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QString &lhs, QChar rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QString &lhs, QChar rhs) noexcept { return !(rhs < lhs); }
+inline bool operator>=(const QString &lhs, QChar rhs) noexcept { return !(rhs > lhs); }
// QChar <> QStringRef
-inline bool operator==(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
+inline bool operator==(QChar lhs, const QStringRef &rhs) noexcept
{ return rhs.size() == 1 && lhs == rhs.front(); }
-inline bool operator< (QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
+inline bool operator< (QChar lhs, const QStringRef &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) < 0; }
-inline bool operator> (QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW
+inline bool operator> (QChar lhs, const QStringRef &rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs.data(), rhs.size()) > 0; }
-inline bool operator!=(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator<=(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return !(lhs > rhs); }
-inline bool operator>=(QChar lhs, const QStringRef &rhs) Q_DECL_NOTHROW { return !(lhs < rhs); }
+inline bool operator!=(QChar lhs, const QStringRef &rhs) noexcept { return !(lhs == rhs); }
+inline bool operator<=(QChar lhs, const QStringRef &rhs) noexcept { return !(lhs > rhs); }
+inline bool operator>=(QChar lhs, const QStringRef &rhs) noexcept { return !(lhs < rhs); }
-inline bool operator==(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs == lhs); }
-inline bool operator< (const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs < lhs); }
-inline bool operator>=(const QStringRef &lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs > lhs); }
+inline bool operator==(const QStringRef &lhs, QChar rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(const QStringRef &lhs, QChar rhs) noexcept { return !(rhs == lhs); }
+inline bool operator< (const QStringRef &lhs, QChar rhs) noexcept { return rhs > lhs; }
+inline bool operator> (const QStringRef &lhs, QChar rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(const QStringRef &lhs, QChar rhs) noexcept { return !(rhs < lhs); }
+inline bool operator>=(const QStringRef &lhs, QChar rhs) noexcept { return !(rhs > lhs); }
// QChar <> QLatin1String
-inline bool operator==(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
+inline bool operator==(QChar lhs, QLatin1String rhs) noexcept
{ return rhs.size() == 1 && lhs == rhs.front(); }
-inline bool operator< (QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
+inline bool operator< (QChar lhs, QLatin1String rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs) < 0; }
-inline bool operator> (QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW
+inline bool operator> (QChar lhs, QLatin1String rhs) noexcept
{ return QString::compare_helper(&lhs, 1, rhs) > 0; }
-inline bool operator!=(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator<=(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs > rhs); }
-inline bool operator>=(QChar lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs < rhs); }
+inline bool operator!=(QChar lhs, QLatin1String rhs) noexcept { return !(lhs == rhs); }
+inline bool operator<=(QChar lhs, QLatin1String rhs) noexcept { return !(lhs > rhs); }
+inline bool operator>=(QChar lhs, QLatin1String rhs) noexcept { return !(lhs < rhs); }
-inline bool operator==(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return rhs == lhs; }
-inline bool operator!=(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs == lhs); }
-inline bool operator< (QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return rhs > lhs; }
-inline bool operator> (QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return rhs < lhs; }
-inline bool operator<=(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs < lhs); }
-inline bool operator>=(QLatin1String lhs, QChar rhs) Q_DECL_NOTHROW { return !(rhs > lhs); }
+inline bool operator==(QLatin1String lhs, QChar rhs) noexcept { return rhs == lhs; }
+inline bool operator!=(QLatin1String lhs, QChar rhs) noexcept { return !(rhs == lhs); }
+inline bool operator< (QLatin1String lhs, QChar rhs) noexcept { return rhs > lhs; }
+inline bool operator> (QLatin1String lhs, QChar rhs) noexcept { return rhs < lhs; }
+inline bool operator<=(QLatin1String lhs, QChar rhs) noexcept { return !(rhs < lhs); }
+inline bool operator>=(QLatin1String lhs, QChar rhs) noexcept { return !(rhs > lhs); }
// QStringView <> QStringView
-inline bool operator==(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
-inline bool operator!=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator< (QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) < 0; }
-inline bool operator<=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
-inline bool operator> (QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) > 0; }
-inline bool operator>=(QStringView lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
+inline bool operator==(QStringView lhs, QStringView rhs) noexcept { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
+inline bool operator!=(QStringView lhs, QStringView rhs) noexcept { return !(lhs == rhs); }
+inline bool operator< (QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QStringView lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
// QStringView <> QChar
-inline bool operator==(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs == QStringView(&rhs, 1); }
-inline bool operator!=(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs != QStringView(&rhs, 1); }
-inline bool operator< (QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs < QStringView(&rhs, 1); }
-inline bool operator<=(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs <= QStringView(&rhs, 1); }
-inline bool operator> (QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs > QStringView(&rhs, 1); }
-inline bool operator>=(QStringView lhs, QChar rhs) Q_DECL_NOTHROW { return lhs >= QStringView(&rhs, 1); }
-
-inline bool operator==(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) == rhs; }
-inline bool operator!=(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) != rhs; }
-inline bool operator< (QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) < rhs; }
-inline bool operator<=(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) <= rhs; }
-inline bool operator> (QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) > rhs; }
-inline bool operator>=(QChar lhs, QStringView rhs) Q_DECL_NOTHROW { return QStringView(&lhs, 1) >= rhs; }
+inline bool operator==(QStringView lhs, QChar rhs) noexcept { return lhs == QStringView(&rhs, 1); }
+inline bool operator!=(QStringView lhs, QChar rhs) noexcept { return lhs != QStringView(&rhs, 1); }
+inline bool operator< (QStringView lhs, QChar rhs) noexcept { return lhs < QStringView(&rhs, 1); }
+inline bool operator<=(QStringView lhs, QChar rhs) noexcept { return lhs <= QStringView(&rhs, 1); }
+inline bool operator> (QStringView lhs, QChar rhs) noexcept { return lhs > QStringView(&rhs, 1); }
+inline bool operator>=(QStringView lhs, QChar rhs) noexcept { return lhs >= QStringView(&rhs, 1); }
+
+inline bool operator==(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) == rhs; }
+inline bool operator!=(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) != rhs; }
+inline bool operator< (QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) < rhs; }
+inline bool operator<=(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) <= rhs; }
+inline bool operator> (QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) > rhs; }
+inline bool operator>=(QChar lhs, QStringView rhs) noexcept { return QStringView(&lhs, 1) >= rhs; }
// QStringView <> QLatin1String
-inline bool operator==(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
-inline bool operator!=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator< (QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) < 0; }
-inline bool operator<=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
-inline bool operator> (QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) > 0; }
-inline bool operator>=(QStringView lhs, QLatin1String rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
-
-inline bool operator==(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
-inline bool operator!=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
-inline bool operator< (QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) < 0; }
-inline bool operator<=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
-inline bool operator> (QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) > 0; }
-inline bool operator>=(QLatin1String lhs, QStringView rhs) Q_DECL_NOTHROW { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
+inline bool operator==(QStringView lhs, QLatin1String rhs) noexcept { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
+inline bool operator!=(QStringView lhs, QLatin1String rhs) noexcept { return !(lhs == rhs); }
+inline bool operator< (QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QStringView lhs, QLatin1String rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
+
+inline bool operator==(QLatin1String lhs, QStringView rhs) noexcept { return lhs.size() == rhs.size() && QtPrivate::compareStrings(lhs, rhs) == 0; }
+inline bool operator!=(QLatin1String lhs, QStringView rhs) noexcept { return !(lhs == rhs); }
+inline bool operator< (QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) < 0; }
+inline bool operator<=(QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) <= 0; }
+inline bool operator> (QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) > 0; }
+inline bool operator>=(QLatin1String lhs, QStringView rhs) noexcept { return QtPrivate::compareStrings(lhs, rhs) >= 0; }
#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
// QStringRef <> QByteArray
@@ -1827,13 +1973,17 @@ inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QString &s
inline int QStringRef::localeAwareCompare(const QStringRef &s1, const QStringRef &s2)
{ return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
+#if QT_STRINGVIEW_LEVEL < 2
inline bool QStringRef::contains(const QString &s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
+inline bool QStringRef::contains(const QStringRef &s, Qt::CaseSensitivity cs) const
+{ return indexOf(s, 0, cs) != -1; }
+#endif
inline bool QStringRef::contains(QLatin1String s, Qt::CaseSensitivity cs) const
{ return indexOf(s, 0, cs) != -1; }
inline bool QStringRef::contains(QChar c, Qt::CaseSensitivity cs) const
{ return indexOf(c, 0, cs) != -1; }
-inline bool QStringRef::contains(const QStringRef &s, Qt::CaseSensitivity cs) const
+inline bool QStringRef::contains(QStringView s, Qt::CaseSensitivity cs) const noexcept
{ return indexOf(s, 0, cs) != -1; }
inline QString &QString::insert(int i, const QStringRef &s)
@@ -1870,6 +2020,59 @@ inline const QString &asString(const QString &s) { return s; }
inline QString &&asString(QString &&s) { return std::move(s); }
}
+//
+// QStringView::arg() implementation
+//
+
+namespace QtPrivate {
+
+struct ArgBase {
+ enum Tag : uchar { L1, U8, U16 } tag;
+};
+
+struct QStringViewArg : ArgBase {
+ QStringView string;
+ QStringViewArg() = default;
+ Q_DECL_CONSTEXPR explicit QStringViewArg(QStringView v) noexcept : ArgBase{U16}, string{v} {}
+};
+
+struct QLatin1StringArg : ArgBase {
+ QLatin1String string;
+ QLatin1StringArg() = default;
+ Q_DECL_CONSTEXPR explicit QLatin1StringArg(QLatin1String v) noexcept : ArgBase{L1}, string{v} {}
+};
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT QString argToQString(QStringView pattern, size_t n, const ArgBase **args);
+Q_REQUIRED_RESULT Q_CORE_EXPORT QString argToQString(QLatin1String pattern, size_t n, const ArgBase **args);
+
+template <typename StringView, typename...Args>
+Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString argToQStringDispatch(StringView pattern, const Args &...args)
+{
+ const ArgBase *argBases[] = {&args..., /* avoid zero-sized array */ nullptr};
+ return QtPrivate::argToQString(pattern, sizeof...(Args), argBases);
+}
+
+ inline QStringViewArg qStringLikeToArg(const QString &s) noexcept { return QStringViewArg{qToStringViewIgnoringNull(s)}; }
+Q_DECL_CONSTEXPR inline QStringViewArg qStringLikeToArg(QStringView s) noexcept { return QStringViewArg{s}; }
+ inline QStringViewArg qStringLikeToArg(const QChar &c) noexcept { return QStringViewArg{QStringView{&c, 1}}; }
+Q_DECL_CONSTEXPR inline QLatin1StringArg qStringLikeToArg(QLatin1String s) noexcept { return QLatin1StringArg{s}; }
+
+} // namespace QtPrivate
+
+template <typename...Args>
+Q_ALWAYS_INLINE
+QString QStringView::arg(Args &&...args) const
+{
+ return QtPrivate::argToQStringDispatch(*this, QtPrivate::qStringLikeToArg(args)...);
+}
+
+template <typename...Args>
+Q_ALWAYS_INLINE
+QString QLatin1String::arg(Args &&...args) const
+{
+ return QtPrivate::argToQStringDispatch(*this, QtPrivate::qStringLikeToArg(args)...);
+}
+
QT_END_NAMESPACE
#if defined(QT_USE_FAST_OPERATOR_PLUS) || defined(QT_USE_QSTRINGBUILDER)
diff --git a/src/corelib/tools/qstring_compat.cpp b/src/corelib/text/qstring_compat.cpp
index 45bb816e4b..45bb816e4b 100644
--- a/src/corelib/tools/qstring_compat.cpp
+++ b/src/corelib/text/qstring_compat.cpp
diff --git a/src/corelib/tools/qstring_mips_dsp_asm.S b/src/corelib/text/qstring_mips_dsp_asm.S
index 202f322310..202f322310 100644
--- a/src/corelib/tools/qstring_mips_dsp_asm.S
+++ b/src/corelib/text/qstring_mips_dsp_asm.S
diff --git a/src/corelib/tools/qstringalgorithms.h b/src/corelib/text/qstringalgorithms.h
index cc0eda71f3..d54e376aa9 100644
--- a/src/corelib/tools/qstringalgorithms.h
+++ b/src/corelib/text/qstringalgorithms.h
@@ -51,42 +51,54 @@ QT_BEGIN_NAMESPACE
class QByteArray;
class QLatin1String;
class QStringView;
+class QChar;
template <typename T> class QVector;
namespace QtPrivate {
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype qustrlen(const ushort *str) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype qustrlen(const ushort *str) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION const ushort *qustrchr(QStringView str, ushort ch) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QStringView rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QLatin1String lhs, QLatin1String rhs, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool startsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QStringView haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool endsWith(QLatin1String haystack, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QStringView trimmed(QStringView s) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QLatin1String trimmed(QLatin1String s) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QLatin1String haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype findString(QLatin1String haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QStringView haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QStringView haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QLatin1String haystack, qsizetype from, QStringView needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION qsizetype lastIndexOf(QLatin1String haystack, qsizetype from, QLatin1String needle, Qt::CaseSensitivity cs = Qt::CaseSensitive) noexcept;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QStringView trimmed(QStringView s) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION QLatin1String trimmed(QLatin1String s) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLatin1(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToUtf8(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QByteArray convertToLocal8Bit(QStringView str);
Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<uint> convertToUcs4(QStringView str);
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isRightToLeft(QStringView string);
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QLatin1String s) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isAscii(QStringView s) Q_DECL_NOTHROW;
-Q_REQUIRED_RESULT bool isLatin1(QLatin1String s) Q_DECL_NOTHROW; // in qstring.h
-Q_REQUIRED_RESULT Q_CORE_EXPORT bool isLatin1(QStringView s) Q_DECL_NOTHROW;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isRightToLeft(QStringView string) noexcept;
+
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QLatin1String s) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isAscii(QStringView s) noexcept;
+Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline bool isLatin1(QLatin1String s) noexcept;
+Q_REQUIRED_RESULT Q_CORE_EXPORT Q_DECL_PURE_FUNCTION bool isLatin1(QStringView s) noexcept;
} // namespace QtPRivate
diff --git a/src/corelib/tools/qstringalgorithms_p.h b/src/corelib/text/qstringalgorithms_p.h
index 4bcf697f78..64d9f2e676 100644
--- a/src/corelib/tools/qstringalgorithms_p.h
+++ b/src/corelib/text/qstringalgorithms_p.h
@@ -77,7 +77,7 @@ template <typename StringType> struct QStringAlgorithms
if (begin != data)
memmove(data, begin, (end - begin) * sizeof(Char));
str.resize(end - begin);
- return qMove(str);
+ return std::move(str);
}
static inline StringType trimmed_helper_inplace(const NakedStringType &, const Char *, const Char *)
@@ -118,7 +118,7 @@ template <typename StringType> struct QStringAlgorithms
const Char *end = str.cend();
NakedStringType result = isConst || !str.isDetached() ?
StringType(str.size(), Qt::Uninitialized) :
- qMove(str);
+ std::move(str);
Char *dst = const_cast<Char *>(result.cbegin());
Char *ptr = dst;
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/text/qstringbuilder.cpp
index 8afc83819b..cf443ec369 100644
--- a/src/corelib/tools/qstringbuilder.cpp
+++ b/src/corelib/text/qstringbuilder.cpp
@@ -124,7 +124,7 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) Q_DECL_NOTHROW
+void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) noexcept
{
if (Q_UNLIKELY(len == -1)) {
if (!a)
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/text/qstringbuilder.h
index 1d96d70637..288d98d633 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/text/qstringbuilder.h
@@ -58,12 +58,12 @@ QT_BEGIN_NAMESPACE
struct Q_CORE_EXPORT QAbstractConcatenable
{
protected:
- static void convertFromAscii(const char *a, int len, QChar *&out) Q_DECL_NOTHROW;
- static inline void convertFromAscii(char a, QChar *&out) Q_DECL_NOTHROW
+ static void convertFromAscii(const char *a, int len, QChar *&out) noexcept;
+ static inline void convertFromAscii(char a, QChar *&out) noexcept
{
*out++ = QLatin1Char(a);
}
- static void appendLatin1To(const char *a, int len, QChar *out) Q_DECL_NOTHROW;
+ static void appendLatin1To(const char *a, int len, QChar *out) noexcept;
};
template <typename T> struct QConcatenable {};
@@ -150,7 +150,7 @@ class QStringBuilder <QString, QString> : public QStringBuilderBase<QStringBuild
const QString &b;
private:
- QStringBuilder &operator=(const QStringBuilder &) Q_DECL_EQ_DELETE;
+ QStringBuilder &operator=(const QStringBuilder &) = delete;
};
template <>
@@ -167,7 +167,7 @@ class QStringBuilder <QByteArray, QByteArray> : public QStringBuilderBase<QStrin
const QByteArray &b;
private:
- QStringBuilder &operator=(const QStringBuilder &) Q_DECL_EQ_DELETE;
+ QStringBuilder &operator=(const QStringBuilder &) = delete;
};
@@ -375,7 +375,7 @@ template <> struct QConcatenable<const char16_t *> : private QAbstractConcatenab
using type = const char16_t *;
using ConvertTo = QString;
enum { ExactSize = true };
- static int size(const char16_t *a) { return QStringView(a).length(); };
+ static int size(const char16_t *a) { return QStringView(a).length(); }
static inline void QT_ASCII_CAST_WARN appendTo(const char16_t *a, QChar *&out)
{
if (!a)
diff --git a/src/corelib/tools/qstringiterator.qdoc b/src/corelib/text/qstringiterator.qdoc
index 9d7c54ce9f..9d7c54ce9f 100644
--- a/src/corelib/tools/qstringiterator.qdoc
+++ b/src/corelib/text/qstringiterator.qdoc
diff --git a/src/corelib/tools/qstringiterator_p.h b/src/corelib/text/qstringiterator_p.h
index 219589b6e4..219589b6e4 100644
--- a/src/corelib/tools/qstringiterator_p.h
+++ b/src/corelib/text/qstringiterator_p.h
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/text/qstringlist.cpp
index cc6eaf8ad2..4bbe424ed2 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/text/qstringlist.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include <qstringlist.h>
+#include <qregexp.h>
#include <qset.h>
#if QT_CONFIG(regularexpression)
# include <qregularexpression.h>
@@ -282,6 +283,7 @@ void QtPrivate::QStringList_sort(QStringList *that, Qt::CaseSensitivity cs)
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn QStringList QStringList::filter(const QString &str, Qt::CaseSensitivity cs) const
@@ -301,6 +303,26 @@ void QtPrivate::QStringList_sort(QStringList *that, Qt::CaseSensitivity cs)
\sa contains()
*/
+#endif
+
+/*!
+ \fn QStringList QStringList::filter(QStringView str, Qt::CaseSensitivity cs) const
+ \overload
+ \since 5.14
+*/
+QStringList QtPrivate::QStringList_filter(const QStringList *that, QStringView str,
+ Qt::CaseSensitivity cs)
+{
+ QStringMatcher matcher(str, cs);
+ QStringList res;
+ for (int i = 0; i < that->size(); ++i)
+ if (matcher.indexIn(that->at(i)) != -1)
+ res << that->at(i);
+ return res;
+}
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/// Not really needed anymore, but kept for binary compatibility
QStringList QtPrivate::QStringList_filter(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs)
{
@@ -311,6 +333,7 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QString
res << that->at(i);
return res;
}
+#endif
template<typename T>
static bool stringList_contains(const QStringList &stringList, const T &str, Qt::CaseSensitivity cs)
@@ -465,6 +488,7 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegula
}
#endif // QT_CONFIG(regularexpression)
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn QStringList &QStringList::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
@@ -480,12 +504,41 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegula
\sa QString::replace()
*/
+
+/*!
+ \fn QStringList &QStringList::replaceInStrings(QStringView before, const QString &after, Qt::CaseSensitivity cs)
+ \overload
+ \since 5.14
+*/
+
+/*!
+ \fn QStringList &QStringList::replaceInStrings(const QString &before, QStringView after, Qt::CaseSensitivity cs)
+ \overload
+ \since 5.14
+*/
+#endif
+
+/*!
+ \fn QStringList &QStringList::replaceInStrings(QStringView before, QStringView after, Qt::CaseSensitivity cs)
+ \overload
+ \since 5.14
+*/
+void QtPrivate::QStringList_replaceInStrings(QStringList *that, QStringView before,
+ QStringView after, Qt::CaseSensitivity cs)
+{
+ for (int i = 0; i < that->size(); ++i)
+ (*that)[i].replace(before.data(), before.length(), after.data(), after.length(), cs);
+}
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/// Not really needed anymore, but kept for binary compatibility
void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QString &before,
const QString &after, Qt::CaseSensitivity cs)
{
for (int i = 0; i < that->size(); ++i)
(*that)[i].replace(before, after, cs);
}
+#endif
#ifndef QT_NO_REGEXP
@@ -560,6 +613,7 @@ static int accumulatedSize(const QStringList &list, int seplen)
return result;
}
+#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn QString QStringList::join(const QString &separator) const
@@ -569,6 +623,7 @@ static int accumulatedSize(const QStringList &list, int seplen)
\sa QString::split()
*/
+#endif
/*!
\fn QString QStringList::join(QChar separator) const
@@ -614,6 +669,16 @@ QString QtPrivate::QStringList_join(const QStringList &list, QLatin1String sep)
}
/*!
+ \fn QString QStringList::join(QStringView separator) const
+ \overload
+ \since 5.14
+*/
+QString QtPrivate::QStringList_join(const QStringList *that, QStringView sep)
+{
+ return QStringList_join(that, sep.data(), sep.length());
+}
+
+/*!
\fn QStringList QStringList::operator+(const QStringList &other) const
Returns a string list that is the concatenation of this string
@@ -847,5 +912,12 @@ int QtPrivate::QStringList_removeDuplicates(QStringList *that)
lists.
*/
+ /*! \fn template<typename InputIterator> QStringList::QStringList(InputIterator first, InputIterator last)
+ \since 5.14
+
+ Constructs a QStringList with the contents in the iterator range [\a first, \a last).
+
+ The value type of \c InputIterator must be convertible to \c QString.
+ */
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/text/qstringlist.h
index 6b04b7aef1..a464d443dc 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/text/qstringlist.h
@@ -44,6 +44,7 @@
#define QSTRINGLIST_H
#include <QtCore/qalgorithms.h>
+#include <QtCore/qcontainertools_impl.h>
#include <QtCore/qregexp.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringmatcher.h>
@@ -53,8 +54,10 @@ QT_BEGIN_NAMESPACE
class QRegExp;
class QRegularExpression;
+#if !defined(QT_NO_JAVA_STYLE_ITERATORS)
typedef QListIterator<QString> QStringListIterator;
typedef QMutableListIterator<QString> QMutableStringListIterator;
+#endif
class QStringList;
@@ -72,12 +75,21 @@ public:
inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive);
inline int removeDuplicates();
+#if QT_STRINGVIEW_LEVEL < 2
inline QString join(const QString &sep) const;
+#endif
+ inline QString join(QStringView sep) const;
inline QString join(QLatin1String sep) const;
inline QString join(QChar sep) const;
+ inline QStringList filter(QStringView str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
+ inline QStringList &replaceInStrings(QStringView before, QStringView after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+#if QT_STRINGVIEW_LEVEL < 2
inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ inline QStringList &replaceInStrings(const QString &before, QStringView after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ inline QStringList &replaceInStrings(QStringView before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
+#endif
#ifndef QT_NO_REGEXP
inline QStringList filter(const QRegExp &rx) const;
@@ -100,22 +112,19 @@ class QStringList : public QList<QString>
{
#endif
public:
- inline QStringList() Q_DECL_NOTHROW { }
+ inline QStringList() noexcept { }
inline explicit QStringList(const QString &i) { append(i); }
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QStringList(QList<QString> &&l) Q_DECL_NOTHROW : QList<QString>(std::move(l)) { }
-#endif
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ inline QStringList(QList<QString> &&l) noexcept : QList<QString>(std::move(l)) { }
inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
-#endif
+ template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
+ inline QStringList(InputIterator first, InputIterator last)
+ : QList<QString>(first, last) { }
QStringList &operator=(const QList<QString> &other)
{ QList<QString>::operator=(other); return *this; }
-#ifdef Q_COMPILER_RVALUE_REFS
- QStringList &operator=(QList<QString> &&other) Q_DECL_NOTHROW
+ QStringList &operator=(QList<QString> &&other) noexcept
{ QList<QString>::operator=(std::move(other)); return *this; }
-#endif
#if QT_STRINGVIEW_LEVEL < 2
inline bool contains(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
@@ -165,18 +174,27 @@ inline const QStringList *QListSpecialMethods<QString>::self() const
namespace QtPrivate {
void Q_CORE_EXPORT QStringList_sort(QStringList *that, Qt::CaseSensitivity cs);
int Q_CORE_EXPORT QStringList_removeDuplicates(QStringList *that);
+ QString Q_CORE_EXPORT QStringList_join(const QStringList *that, QStringView sep);
QString Q_CORE_EXPORT QStringList_join(const QStringList *that, const QChar *sep, int seplen);
Q_CORE_EXPORT QString QStringList_join(const QStringList &list, QLatin1String sep);
+ QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, QStringView str,
+ Qt::CaseSensitivity cs);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QStringList Q_CORE_EXPORT QStringList_filter(const QStringList *that, const QString &str,
Qt::CaseSensitivity cs);
+#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, const QString &str, Qt::CaseSensitivity cs);
#endif
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QStringView str, Qt::CaseSensitivity cs);
bool Q_CORE_EXPORT QStringList_contains(const QStringList *that, QLatin1String str, Qt::CaseSensitivity cs);
+ void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, QStringView before, QStringView after,
+ Qt::CaseSensitivity cs);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QString &before, const QString &after,
Qt::CaseSensitivity cs);
+#endif
#ifndef QT_NO_REGEXP
void Q_CORE_EXPORT QStringList_replaceInStrings(QStringList *that, const QRegExp &rx, const QString &after);
@@ -205,10 +223,17 @@ inline int QListSpecialMethods<QString>::removeDuplicates()
return QtPrivate::QStringList_removeDuplicates(self());
}
+#if QT_STRINGVIEW_LEVEL < 2
inline QString QListSpecialMethods<QString>::join(const QString &sep) const
{
return QtPrivate::QStringList_join(self(), sep.constData(), sep.length());
}
+#endif
+
+inline QString QListSpecialMethods<QString>::join(QStringView sep) const
+{
+ return QtPrivate::QStringList_join(self(), sep);
+}
QString QListSpecialMethods<QString>::join(QLatin1String sep) const
{
@@ -220,10 +245,17 @@ inline QString QListSpecialMethods<QString>::join(QChar sep) const
return QtPrivate::QStringList_join(self(), &sep, 1);
}
+inline QStringList QListSpecialMethods<QString>::filter(QStringView str, Qt::CaseSensitivity cs) const
+{
+ return QtPrivate::QStringList_filter(self(), str, cs);
+}
+
+#if QT_STRINGVIEW_LEVEL < 2
inline QStringList QListSpecialMethods<QString>::filter(const QString &str, Qt::CaseSensitivity cs) const
{
return QtPrivate::QStringList_filter(self(), str, cs);
}
+#endif
#if QT_STRINGVIEW_LEVEL < 2
inline bool QStringList::contains(const QString &str, Qt::CaseSensitivity cs) const
@@ -242,12 +274,32 @@ inline bool QStringList::contains(QStringView str, Qt::CaseSensitivity cs) const
return QtPrivate::QStringList_contains(this, str, cs);
}
+inline QStringList &QListSpecialMethods<QString>::replaceInStrings(QStringView before, QStringView after, Qt::CaseSensitivity cs)
+{
+ QtPrivate::QStringList_replaceInStrings(self(), before, after, cs);
+ return *self();
+}
+
+#if QT_STRINGVIEW_LEVEL < 2
inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs)
{
QtPrivate::QStringList_replaceInStrings(self(), before, after, cs);
return *self();
}
+inline QStringList &QListSpecialMethods<QString>::replaceInStrings(QStringView before, const QString &after, Qt::CaseSensitivity cs)
+{
+ QtPrivate::QStringList_replaceInStrings(self(), before, qToStringViewIgnoringNull(after), cs);
+ return *self();
+}
+
+inline QStringList &QListSpecialMethods<QString>::replaceInStrings(const QString &before, QStringView after, Qt::CaseSensitivity cs)
+{
+ QtPrivate::QStringList_replaceInStrings(self(), QStringView(before), after, cs);
+ return *self();
+}
+#endif
+
inline QStringList operator+(const QList<QString> &one, const QStringList &other)
{
QStringList n = one;
@@ -332,6 +384,23 @@ inline int QStringList::lastIndexOf(const QRegularExpression &rx, int from) cons
#endif // QT_CONFIG(regularexpression)
#endif // Q_QDOC
+//
+// QString inline functions:
+//
+
+QStringList QString::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+{ return split(sep, _sb(behavior), cs); }
+QStringList QString::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+{ return split(sep, _sb(behavior), cs); }
+#ifndef QT_NO_REGEXP
+QStringList QString::split(const QRegExp &sep, Qt::SplitBehavior behavior) const
+{ return split(sep, _sb(behavior)); }
+#endif
+#if QT_CONFIG(regularexpression)
+QStringList QString::split(const QRegularExpression &sep, Qt::SplitBehavior behavior) const
+{ return split(sep, _sb(behavior)); }
+#endif
+
QT_END_NAMESPACE
#endif // QSTRINGLIST_H
diff --git a/src/corelib/tools/qstringliteral.h b/src/corelib/text/qstringliteral.h
index 64296b89fc..2a7e607c63 100644
--- a/src/corelib/tools/qstringliteral.h
+++ b/src/corelib/text/qstringliteral.h
@@ -63,7 +63,7 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2,
#define QT_UNICODE_LITERAL(str) u"" str
#define QStringLiteral(str) \
- ([]() Q_DECL_NOEXCEPT -> QString { \
+ ([]() noexcept -> QString { \
enum { Size = sizeof(QT_UNICODE_LITERAL(str))/2 - 1 }; \
static const QStaticStringData<Size> qstring_literal = { \
Q_STATIC_STRING_DATA_HEADER_INITIALIZER(Size), \
@@ -82,11 +82,8 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2,
Q_STATIC_STRING_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, sizeof(QStringData)) \
/**/
-#ifndef QT_NO_UNICODE_LITERAL
-# ifndef QT_UNICODE_LITERAL
-# error "If you change QStringLiteral, please change QStringViewLiteral, too"
-# endif
-# define QStringViewLiteral(str) QStringView(QT_UNICODE_LITERAL(str))
+#if QT_DEPRECATED_SINCE(5, 14)
+# define QStringViewLiteral(str) QStringView(QT_UNICODE_LITERAL(str), QtPrivate::Deprecated)
#endif
template <int N>
diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/text/qstringmatcher.cpp
index 67d3f0ebc8..167a467480 100644
--- a/src/corelib/tools/qstringmatcher.cpp
+++ b/src/corelib/text/qstringmatcher.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 Mail.ru Group.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -41,43 +42,43 @@
QT_BEGIN_NAMESPACE
-static void bm_init_skiptable(const ushort *uc, int len, uchar *skiptable, Qt::CaseSensitivity cs)
+static void bm_init_skiptable(const ushort *uc, qsizetype len, uchar *skiptable, Qt::CaseSensitivity cs)
{
- int l = qMin(len, 255);
- memset(skiptable, l, 256*sizeof(uchar));
+ int l = int(qMin(len, qsizetype(255)));
+ memset(skiptable, l, 256 * sizeof(uchar));
uc += len - l;
if (cs == Qt::CaseSensitive) {
while (l--) {
skiptable[*uc & 0xff] = l;
- uc++;
+ ++uc;
}
} else {
const ushort *start = uc;
while (l--) {
skiptable[foldCase(uc, start) & 0xff] = l;
- uc++;
+ ++uc;
}
}
}
-static inline int bm_find(const ushort *uc, uint l, int index, const ushort *puc, uint pl,
+static inline qsizetype bm_find(const ushort *uc, qsizetype l, qsizetype index, const ushort *puc, qsizetype pl,
const uchar *skiptable, Qt::CaseSensitivity cs)
{
if (pl == 0)
- return index > (int)l ? -1 : index;
- const uint pl_minus_one = pl - 1;
+ return index > l ? -1 : index;
+ const qsizetype pl_minus_one = pl - 1;
const ushort *current = uc + index + pl_minus_one;
const ushort *end = uc + l;
if (cs == Qt::CaseSensitive) {
while (current < end) {
- uint skip = skiptable[*current & 0xff];
+ qsizetype skip = skiptable[*current & 0xff];
if (!skip) {
// possible match
while (skip < pl) {
if (*(current - skip) != puc[pl_minus_one-skip])
break;
- skip++;
+ ++skip;
}
if (skip > pl_minus_one) // we have a match
return (current - uc) - pl_minus_one;
@@ -95,13 +96,13 @@ static inline int bm_find(const ushort *uc, uint l, int index, const ushort *puc
}
} else {
while (current < end) {
- uint skip = skiptable[foldCase(current, uc) & 0xff];
+ qsizetype skip = skiptable[foldCase(current, uc) & 0xff];
if (!skip) {
// possible match
while (skip < pl) {
if (foldCase(current - skip, uc) != foldCase(puc + pl_minus_one - skip, puc))
break;
- skip++;
+ ++skip;
}
if (skip > pl_minus_one) // we have a match
return (current - uc) - pl_minus_one;
@@ -148,7 +149,7 @@ static inline int bm_find(const ushort *uc, uint l, int index, const ushort *puc
Call setPattern() to give it a pattern to match.
*/
QStringMatcher::QStringMatcher()
- : d_ptr(0), q_cs(Qt::CaseSensitive)
+ : d_ptr(nullptr), q_cs(Qt::CaseSensitive)
{
memset(q_data, 0, sizeof(q_data));
}
@@ -160,7 +161,7 @@ QStringMatcher::QStringMatcher()
Call indexIn() to perform a search.
*/
QStringMatcher::QStringMatcher(const QString &pattern, Qt::CaseSensitivity cs)
- : d_ptr(0), q_pattern(pattern), q_cs(cs)
+ : d_ptr(nullptr), q_pattern(pattern), q_cs(cs)
{
p.uc = pattern.unicode();
p.len = pattern.size();
@@ -175,18 +176,31 @@ QStringMatcher::QStringMatcher(const QString &pattern, Qt::CaseSensitivity cs)
by \a uc with the given \a length and case sensitivity specified by \a cs.
*/
QStringMatcher::QStringMatcher(const QChar *uc, int len, Qt::CaseSensitivity cs)
- : d_ptr(0), q_cs(cs)
+ : QStringMatcher(QStringView(uc, len), cs)
{
- p.uc = uc;
- p.len = len;
- bm_init_skiptable((const ushort *)p.uc, len, p.q_skiptable, cs);
}
/*!
+ \fn QStringMatcher::QStringMatcher(QStringView pattern, Qt::CaseSensitivity cs = Qt::CaseSensitive)
+ \since 5.14
+
+ Constructs a string matcher that will search for \a pattern, with
+ case sensitivity \a cs.
+
+ Call indexIn() to perform a search.
+*/
+QStringMatcher::QStringMatcher(QStringView str, Qt::CaseSensitivity cs)
+ : d_ptr(nullptr), q_cs(cs)
+{
+ p.uc = str.data();
+ p.len = int(str.size());
+ bm_init_skiptable((const ushort *)p.uc, p.len, p.q_skiptable, cs);
+}
+/*!
Copies the \a other string matcher to this string matcher.
*/
QStringMatcher::QStringMatcher(const QStringMatcher &other)
- : d_ptr(0)
+ : d_ptr(nullptr)
{
operator=(other);
}
@@ -267,11 +281,7 @@ void QStringMatcher::setCaseSensitivity(Qt::CaseSensitivity cs)
*/
int QStringMatcher::indexIn(const QString &str, int from) const
{
- if (from < 0)
- from = 0;
- return bm_find((const ushort *)str.unicode(), str.size(), from,
- (const ushort *)p.uc, p.len,
- p.q_skiptable, q_cs);
+ return int(indexIn(QStringView(str), from));
}
/*!
@@ -288,9 +298,25 @@ int QStringMatcher::indexIn(const QString &str, int from) const
*/
int QStringMatcher::indexIn(const QChar *str, int length, int from) const
{
+ return int(indexIn(QStringView(str, length), from));
+}
+
+/*!
+ \since 5.14
+
+ Searches the string \a str from character position \a from
+ (default 0, i.e. from the first character), for the string
+ pattern() that was set in the constructor or in the most recent
+ call to setPattern(). Returns the position where the pattern()
+ matched in \a str, or -1 if no match was found.
+
+ \sa setPattern(), setCaseSensitivity()
+*/
+qsizetype QStringMatcher::indexIn(QStringView str, qsizetype from) const
+{
if (from < 0)
from = 0;
- return bm_find((const ushort *)str, length, from,
+ return bm_find((const ushort *)str.data(), str.size(), from,
(const ushort *)p.uc, p.len,
p.q_skiptable, q_cs);
}
@@ -307,16 +333,16 @@ int QStringMatcher::indexIn(const QChar *str, int length, int from) const
\internal
*/
-int qFindStringBoyerMoore(
- const QChar *haystack, int haystackLen, int haystackOffset,
- const QChar *needle, int needleLen, Qt::CaseSensitivity cs)
+qsizetype qFindStringBoyerMoore(
+ QStringView haystack, qsizetype haystackOffset,
+ QStringView needle, Qt::CaseSensitivity cs)
{
uchar skiptable[256];
- bm_init_skiptable((const ushort *)needle, needleLen, skiptable, cs);
+ bm_init_skiptable((const ushort *)needle.data(), needle.size(), skiptable, cs);
if (haystackOffset < 0)
haystackOffset = 0;
- return bm_find((const ushort *)haystack, haystackLen, haystackOffset,
- (const ushort *)needle, needleLen, skiptable, cs);
+ return bm_find((const ushort *)haystack.data(), haystack.size(), haystackOffset,
+ (const ushort *)needle.data(), needle.size(), skiptable, cs);
}
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstringmatcher.h b/src/corelib/text/qstringmatcher.h
index 549bff9f29..6de4353930 100644
--- a/src/corelib/tools/qstringmatcher.h
+++ b/src/corelib/text/qstringmatcher.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 Mail.ru Group.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -41,6 +42,7 @@
#define QSTRINGMATCHER_H
#include <QtCore/qstring.h>
+#include <QtCore/qstringview.h>
QT_BEGIN_NAMESPACE
@@ -55,6 +57,8 @@ public:
Qt::CaseSensitivity cs = Qt::CaseSensitive);
QStringMatcher(const QChar *uc, int len,
Qt::CaseSensitivity cs = Qt::CaseSensitive);
+ QStringMatcher(QStringView pattern,
+ Qt::CaseSensitivity cs = Qt::CaseSensitive);
QStringMatcher(const QStringMatcher &other);
~QStringMatcher();
@@ -65,6 +69,7 @@ public:
int indexIn(const QString &str, int from = 0) const;
int indexIn(const QChar *str, int length, int from = 0) const;
+ qsizetype indexIn(QStringView str, qsizetype from = 0) const;
QString pattern() const;
inline Qt::CaseSensitivity caseSensitivity() const { return q_cs; }
diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/text/qstringview.cpp
index b97e989110..75de827583 100644
--- a/src/corelib/tools/qstringview.cpp
+++ b/src/corelib/text/qstringview.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qstringview.h"
+#include "qstring.h"
QT_BEGIN_NAMESPACE
@@ -56,9 +57,8 @@ QT_BEGIN_NAMESPACE
The UTF-16 string may be represented as an array (or an array-compatible
data-structure such as QString,
- std::basic_string, etc.) of QChar, \c ushort, \c char16_t (on compilers that
- support C++11 Unicode strings) or (on platforms, such as Windows,
- where it is a 16-bit type) \c wchar_t.
+ std::basic_string, etc.) of QChar, \c ushort, \c char16_t or
+ (on platforms, such as Windows, where it is a 16-bit type) \c wchar_t.
QStringView is designed as an interface type; its main use-case is
as a function parameter type. When QStringViews are used as automatic
@@ -114,8 +114,7 @@ QT_BEGIN_NAMESPACE
/*!
\typedef QStringView::storage_type
- Alias for \c{char16_t} for non-Windows or if Q_COMPILER_UNICODE_STRINGS
- is defined. Otherwise, alias for \c{wchar_t}.
+ Alias for \c{char16_t}.
*/
/*!
@@ -529,6 +528,25 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QString QStringView::arg(Args &&...args) const
+ \fn QString QLatin1String::arg(Args &&...args) const
+ \fn QString QString::arg(Args &&...args) const
+ \since 5.14
+
+ Replaces occurrences of \c{%N} in this string with the corresponding
+ argument from \a args. The arguments are not positional: the first of
+ the \a args replaces the \c{%N} with the lowest \c{N} (all of them), the
+ second of the \a args the \c{%N} with the next-lowest \c{N} etc.
+
+ \c Args can consist of anything that implicitly converts to QString,
+ QStringView or QLatin1String.
+
+ In addition, the following types are also supported: QChar, QLatin1Char.
+
+ \sa QString::arg()
+*/
+
+/*!
\fn QChar QStringView::front() const
Returns the first character in the string. Same as first().
@@ -720,6 +738,58 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn qsizetype QStringView::indexOf(QStringView str, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \fn qsizetype QStringView::indexOf(QLatin1String l1, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \fn qsizetype QStringView::indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const
+ \since 5.14
+
+ Returns the index position of the first occurrence of the string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively, in this string-view,
+ searching forward from index position \a from. Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ If \a from is -1, the search starts at the last character; if it is
+ -2, at the next to last character and so on.
+
+ \sa QString::indexOf()
+*/
+
+/*!
+ \fn bool QStringView::contains(QStringView str, Qt::CaseSensitivity cs) const
+ \fn bool QStringView::contains(QLatin1String l1, Qt::CaseSensitivity cs) const
+ \fn bool QStringView::contains(QChar c, Qt::CaseSensitivity cs) const
+ \since 5.14
+
+ Returns \c true if this string-view contains an occurrence of the string-view
+ \a str, Latin-1 string \a l1, or character \a ch; otherwise returns \c false.
+
+ If \a cs is Qt::CaseSensitive (the default), the search is
+ case-sensitive; otherwise the search is case-insensitive.
+
+ \sa indexOf()
+*/
+
+/*!
+ \fn qsizetype QStringView::lastIndexOf(QStringView str, qsizetype from, Qt::CaseSensitivity cs) const
+ \fn qsizetype QStringView::lastIndexOf(QLatin1String l1, qsizetype from, Qt::CaseSensitivity cs) const
+ \fn qsizetype QStringView::lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs) const
+ \since 5.14
+
+ Returns the index position of the last occurrence of the string-view \a str,
+ Latin-1 string \a l1, or character \a ch, respectively, in this string-view,
+ searching backward from index position \a from. If \a from is -1 (default),
+ the search starts at the last character; if \a from is -2, at the next to last
+ character and so on. Returns -1 if \a str is not found.
+
+ If \a cs is Qt::CaseSensitive (default), the search is case
+ sensitive; otherwise the search is case insensitive.
+
+ \sa QString::lastIndexOf()
+*/
+
+/*!
\fn QByteArray QStringView::toLatin1() const
Returns a Latin-1 representation of the string as a QByteArray.
@@ -794,4 +864,24 @@ QT_BEGIN_NAMESPACE
\sa QString::isRightToLeft()
*/
+/*!
+ \fn QStringView::toWCharArray(wchar_t *array) const
+ \since 5.14
+
+ Transcribes this string into the given \a array.
+
+ The caller is responsible for ensuring \a array is large enough to hold the
+ \c wchar_t encoding of this string (allocating the array with the same length
+ as the string is always sufficient). The array is encoded in UTF-16 on
+ platforms where \c wchar_t is 2 bytes wide (e.g. Windows); otherwise (Unix
+ systems), \c wchar_t is assumed to be 4 bytes wide and the data is written
+ in UCS-4.
+
+ \note This function writes no null terminator to the end of \a array.
+
+ Returns the number of \c wchar_t entries written to \a array.
+
+ \sa QString::toWCharArray()
+*/
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qstringview.h b/src/corelib/text/qstringview.h
index 2e95c2b218..4ab4d2570f 100644
--- a/src/corelib/tools/qstringview.h
+++ b/src/corelib/text/qstringview.h
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Copyright (C) 2019 Mail.ru Group.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -61,9 +62,7 @@ struct IsCompatibleCharTypeHelper
: std::integral_constant<bool,
std::is_same<Char, QChar>::value ||
std::is_same<Char, ushort>::value ||
-#if defined(Q_COMPILER_UNICODE_STRINGS)
std::is_same<Char, char16_t>::value ||
-#endif
(std::is_same<Char, wchar_t>::value && sizeof(wchar_t) == sizeof(QChar))> {};
template <typename Char>
struct IsCompatibleCharType
@@ -104,11 +103,7 @@ struct IsCompatibleStdBasicString
class QStringView
{
public:
-#if defined(Q_OS_WIN) && !defined(Q_COMPILER_UNICODE_STRINGS)
- typedef wchar_t storage_type;
-#else
typedef char16_t storage_type;
-#endif
typedef const QChar value_type;
typedef std::ptrdiff_t difference_type;
typedef qsizetype size_type;
@@ -139,13 +134,13 @@ private:
using if_compatible_qstring_like = typename std::enable_if<std::is_same<T, QString>::value || std::is_same<T, QStringRef>::value, bool>::type;
template <typename Char, size_t N>
- static Q_DECL_CONSTEXPR qsizetype lengthHelperArray(const Char (&)[N]) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR qsizetype lengthHelperArray(const Char (&)[N]) noexcept
{
return qsizetype(N - 1);
}
template <typename Char>
- static qsizetype lengthHelperPointer(const Char *str) Q_DECL_NOTHROW
+ static qsizetype lengthHelperPointer(const Char *str) noexcept
{
#if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
if (__builtin_constant_p(*str)) {
@@ -157,21 +152,21 @@ private:
#endif
return QtPrivate::qustrlen(reinterpret_cast<const ushort *>(str));
}
- static qsizetype lengthHelperPointer(const QChar *str) Q_DECL_NOTHROW
+ static qsizetype lengthHelperPointer(const QChar *str) noexcept
{
return QtPrivate::qustrlen(reinterpret_cast<const ushort *>(str));
}
template <typename Char>
- static const storage_type *castHelper(const Char *str) Q_DECL_NOTHROW
+ static const storage_type *castHelper(const Char *str) noexcept
{ return reinterpret_cast<const storage_type*>(str); }
- static Q_DECL_CONSTEXPR const storage_type *castHelper(const storage_type *str) Q_DECL_NOTHROW
+ static Q_DECL_CONSTEXPR const storage_type *castHelper(const storage_type *str) noexcept
{ return str; }
public:
- Q_DECL_CONSTEXPR QStringView() Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView() noexcept
: m_size(0), m_data(nullptr) {}
- Q_DECL_CONSTEXPR QStringView(std::nullptr_t) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView(std::nullptr_t) noexcept
: QStringView() {}
template <typename Char, if_compatible_char<Char> = true>
@@ -185,38 +180,45 @@ public:
#ifdef Q_CLANG_QDOC
template <typename Char, size_t N>
- Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QStringView(const Char (&array)[N]) noexcept;
template <typename Char>
- Q_DECL_CONSTEXPR QStringView(const Char *str) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QStringView(const Char *str) noexcept;
#else
+#if QT_DEPRECATED_SINCE(5, 14)
+ template <typename Array, if_compatible_array<Array> = true>
+ QT_DEPRECATED_VERSION_X_5_14(R"(Use u"~~~" or QStringView(u"~~~") instead of QStringViewLiteral("~~~"))")
+ Q_DECL_CONSTEXPR QStringView(const Array &str, QtPrivate::Deprecated_t) noexcept
+ : QStringView(str, lengthHelperArray(str)) {}
+#endif // QT_DEPRECATED_SINCE
+
template <typename Array, if_compatible_array<Array> = true>
- Q_DECL_CONSTEXPR QStringView(const Array &str) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView(const Array &str) noexcept
: QStringView(str, lengthHelperArray(str)) {}
template <typename Pointer, if_compatible_pointer<Pointer> = true>
- Q_DECL_CONSTEXPR QStringView(const Pointer &str) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QStringView(const Pointer &str) noexcept
: QStringView(str, str ? lengthHelperPointer(str) : 0) {}
#endif
#ifdef Q_CLANG_QDOC
- QStringView(const QString &str) Q_DECL_NOTHROW;
- QStringView(const QStringRef &str) Q_DECL_NOTHROW;
+ QStringView(const QString &str) noexcept;
+ QStringView(const QStringRef &str) noexcept;
#else
template <typename String, if_compatible_qstring_like<String> = true>
- QStringView(const String &str) Q_DECL_NOTHROW
+ QStringView(const String &str) noexcept
: QStringView(str.isNull() ? nullptr : str.data(), qsizetype(str.size())) {}
#endif
template <typename StdBasicString, if_compatible_string<StdBasicString> = true>
- QStringView(const StdBasicString &str) Q_DECL_NOTHROW
+ QStringView(const StdBasicString &str) noexcept
: QStringView(str.data(), qsizetype(str.size())) {}
Q_REQUIRED_RESULT inline QString toString() const; // defined in qstring.h
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR qsizetype size() const Q_DECL_NOTHROW { return m_size; }
- Q_REQUIRED_RESULT const_pointer data() const Q_DECL_NOTHROW { return reinterpret_cast<const_pointer>(m_data); }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR const storage_type *utf16() const Q_DECL_NOTHROW { return m_data; }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR qsizetype size() const noexcept { return m_size; }
+ Q_REQUIRED_RESULT const_pointer data() const noexcept { return reinterpret_cast<const_pointer>(m_data); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR const storage_type *utf16() const noexcept { return m_data; }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar operator[](qsizetype n) const
{ return Q_ASSERT(n >= 0), Q_ASSERT(n < size()), QChar(m_data[n]); }
@@ -225,6 +227,9 @@ public:
// QString API
//
+ template <typename...Args>
+ Q_REQUIRED_RESULT inline QString arg(Args &&...args) const; // defined in qstring.h
+
Q_REQUIRED_RESULT QByteArray toLatin1() const { return QtPrivate::convertToLatin1(*this); }
Q_REQUIRED_RESULT QByteArray toUtf8() const { return QtPrivate::convertToUtf8(*this); }
Q_REQUIRED_RESULT QByteArray toLocal8Bit() const { return QtPrivate::convertToLocal8Bit(*this); }
@@ -248,51 +253,71 @@ public:
Q_DECL_RELAXED_CONSTEXPR void chop(qsizetype n)
{ Q_ASSERT(n >= 0); Q_ASSERT(n <= size()); m_size -= n; }
- Q_REQUIRED_RESULT QStringView trimmed() const Q_DECL_NOTHROW { return QtPrivate::trimmed(*this); }
+ Q_REQUIRED_RESULT QStringView trimmed() const noexcept { return QtPrivate::trimmed(*this); }
- Q_REQUIRED_RESULT int compare(QStringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT int compare(QStringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::compareStrings(*this, other, cs); }
- Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::startsWith(*this, s, cs); }
- Q_REQUIRED_RESULT inline bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT bool startsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool startsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ Q_REQUIRED_RESULT bool startsWith(QChar c) const noexcept
{ return !empty() && front() == c; }
- Q_REQUIRED_RESULT bool startsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool startsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::startsWith(*this, QStringView(&c, 1), cs); }
- Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
{ return QtPrivate::endsWith(*this, s, cs); }
- Q_REQUIRED_RESULT inline bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT bool endsWith(QChar c) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+ Q_REQUIRED_RESULT bool endsWith(QChar c) const noexcept
{ return !empty() && back() == c; }
- Q_REQUIRED_RESULT bool endsWith(QChar c, Qt::CaseSensitivity cs) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT bool endsWith(QChar c, Qt::CaseSensitivity cs) const noexcept
{ return QtPrivate::endsWith(*this, QStringView(&c, 1), cs); }
- Q_REQUIRED_RESULT bool isRightToLeft() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT qsizetype indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return QtPrivate::findString(*this, from, QStringView(&c, 1), cs); }
+ Q_REQUIRED_RESULT qsizetype indexOf(QStringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return QtPrivate::findString(*this, from, s, cs); }
+ Q_REQUIRED_RESULT inline qsizetype indexOf(QLatin1String s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+
+ Q_REQUIRED_RESULT bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return indexOf(QStringView(&c, 1), 0, cs) != qsizetype(-1); }
+ Q_REQUIRED_RESULT bool contains(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return indexOf(s, 0, cs) != qsizetype(-1); }
+ Q_REQUIRED_RESULT inline bool contains(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+
+ Q_REQUIRED_RESULT qsizetype lastIndexOf(QChar c, qsizetype from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return QtPrivate::lastIndexOf(*this, from, QStringView(&c, 1), cs); }
+ Q_REQUIRED_RESULT qsizetype lastIndexOf(QStringView s, qsizetype from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept
+ { return QtPrivate::lastIndexOf(*this, from, s, cs); }
+ Q_REQUIRED_RESULT inline qsizetype lastIndexOf(QLatin1String s, qsizetype from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const noexcept;
+
+ Q_REQUIRED_RESULT bool isRightToLeft() const noexcept
{ return QtPrivate::isRightToLeft(*this); }
+ Q_REQUIRED_RESULT inline int toWCharArray(wchar_t *array) const; // defined in qstring.h
+
//
// STL compatibility API:
//
- Q_REQUIRED_RESULT const_iterator begin() const Q_DECL_NOTHROW { return data(); }
- Q_REQUIRED_RESULT const_iterator end() const Q_DECL_NOTHROW { return data() + size(); }
- Q_REQUIRED_RESULT const_iterator cbegin() const Q_DECL_NOTHROW { return begin(); }
- Q_REQUIRED_RESULT const_iterator cend() const Q_DECL_NOTHROW { return end(); }
- Q_REQUIRED_RESULT const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- Q_REQUIRED_RESULT const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- Q_REQUIRED_RESULT const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return rbegin(); }
- Q_REQUIRED_RESULT const_reverse_iterator crend() const Q_DECL_NOTHROW { return rend(); }
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool empty() const Q_DECL_NOTHROW { return size() == 0; }
+ Q_REQUIRED_RESULT const_iterator begin() const noexcept { return data(); }
+ Q_REQUIRED_RESULT const_iterator end() const noexcept { return data() + size(); }
+ Q_REQUIRED_RESULT const_iterator cbegin() const noexcept { return begin(); }
+ Q_REQUIRED_RESULT const_iterator cend() const noexcept { return end(); }
+ Q_REQUIRED_RESULT const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ Q_REQUIRED_RESULT const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ Q_REQUIRED_RESULT const_reverse_iterator crbegin() const noexcept { return rbegin(); }
+ Q_REQUIRED_RESULT const_reverse_iterator crend() const noexcept { return rend(); }
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool empty() const noexcept { return size() == 0; }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar front() const { return Q_ASSERT(!empty()), QChar(m_data[0]); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar back() const { return Q_ASSERT(!empty()), QChar(m_data[m_size - 1]); }
//
// Qt compatibility API:
//
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW { return !m_data; }
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isEmpty() const Q_DECL_NOTHROW { return empty(); }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isNull() const noexcept { return !m_data; }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR bool isEmpty() const noexcept { return empty(); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR int length() const /* not nothrow! */
{ return Q_ASSERT(int(size()) == size()), int(size()); }
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QChar first() const { return front(); }
@@ -306,7 +331,7 @@ Q_DECLARE_TYPEINFO(QStringView, Q_PRIMITIVE_TYPE);
template <typename QStringLike, typename std::enable_if<
std::is_same<QStringLike, QString>::value || std::is_same<QStringLike, QStringRef>::value,
bool>::type = true>
-inline QStringView qToStringViewIgnoringNull(const QStringLike &s) Q_DECL_NOTHROW
+inline QStringView qToStringViewIgnoringNull(const QStringLike &s) noexcept
{ return QStringView(s.data(), s.size()); }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qt_attribution.json b/src/corelib/text/qt_attribution.json
index 912da3f22c..a488f1341e 100644
--- a/src/corelib/tools/qt_attribution.json
+++ b/src/corelib/text/qt_attribution.json
@@ -22,18 +22,18 @@
"Name": "Unicode Common Locale Data Repository (CLDR)",
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core (QTimeZone, QLocale).",
- "Files": "For update, see qtbase/util/local_database/cldr2qlocalexml.py",
+ "Files": "For update, see qtbase/util/locale_database/cldr2qlocalexml.py",
"Files": "qlocale_data_p.h qtimezoneprivate_data_p.h",
"Description": "The Unicode CLDR provides key building blocks for software to support the
world's languages, with the largest and most extensive standard repository of locale data
available.",
"Homepage": "http://cldr.unicode.org/",
- "Version": "v35.1",
+ "Version": "v36",
"License": "// as specified in https://spdx.org/licenses/Unicode-DFS-2016.html",
"License": "Unicode License Agreement - Data Files and Software (2016)",
"LicenseId": "Unicode-DFS-2016",
"LicenseFile": "UNICODE_LICENSE.txt",
- "Copyright": "Copyright (C) 1991-2018 Unicode, Inc."
+ "Copyright": "Copyright (C) 1991-2019 Unicode, Inc."
}
]
diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/text/qtextboundaryfinder.cpp
index 67dd15377b..67dd15377b 100644
--- a/src/corelib/tools/qtextboundaryfinder.cpp
+++ b/src/corelib/text/qtextboundaryfinder.cpp
diff --git a/src/corelib/tools/qtextboundaryfinder.h b/src/corelib/text/qtextboundaryfinder.h
index b1e5008f54..b1e5008f54 100644
--- a/src/corelib/tools/qtextboundaryfinder.h
+++ b/src/corelib/text/qtextboundaryfinder.h
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/text/qunicodetables.cpp
index 4c4821802d..805a5a6e34 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/text/qunicodetables.cpp
@@ -6149,2696 +6149,2696 @@ static const unsigned short uc_property_trie[] = {
(uc_property_trie[uc_property_trie[ucs2>>5] + (ucs2 & 0x1f)])
static const Properties uc_properties[] = {
- { 9, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 21, 2 },
- { 9, 8, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 5, 17, 2 },
- { 9, 7, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 2, 37, 2 },
- { 9, 8, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 5, 38, 2 },
- { 9, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 5, 38, 2 },
- { 9, 7, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 36, 2 },
- { 9, 7, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 21, 2 },
- { 9, 8, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 21, 2 },
- { 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 35, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 6, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 12, 13, 3, 2 },
- { 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 2 },
- { 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 11, 13, 3, 2 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 2, 2 },
- { 26, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 15, 11, 8, 2 },
- { 20, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 16, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 15, 10, 8, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 7, 2 },
- { 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 8, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 15, 0, 8, 2 },
- { 26, 10, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 0, 0, 10, 7, 12, 3 },
- { 21, 10, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 2 },
- { 22, 10, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 2, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 19, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 17, 0, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 17, 2 },
- { 22, 10, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 1, 2 },
- { 9, 7, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 3, 38, 2 },
- { 6, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 5, 4, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 23, 10, 0, 0, -1, 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 17, 2 },
- { 29, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 2 },
- { 26, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 9, 2 },
- { 5, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 18, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 743, 0, 743, 0, 775, 1, 80, 0, 10, 6, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 0, 12, 2 },
- { 5, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 24, 10, 0, 0, -1, -16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 17, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 410, 1, 407, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 121, 0, 121, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 17, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 413, 0, 0, 0, 0, 0, 0, 1, 17, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -232, 0, -232, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 80, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 492, 1, 492, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -121, 0, 0, 0, 0, 0, -121, 1, 17, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -300, 0, -300, 0, -268, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 195, 0, 195, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 210, 0, 0, 0, 0, 0, 210, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 206, 0, 0, 0, 0, 0, 206, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 205, 0, 0, 0, 0, 0, 205, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 79, 0, 0, 0, 0, 0, 79, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 202, 0, 0, 0, 0, 0, 202, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 203, 0, 0, 0, 0, 0, 203, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 207, 0, 0, 0, 0, 0, 207, 1, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 97, 0, 97, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 211, 0, 0, 0, 0, 0, 211, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 209, 0, 0, 0, 0, 0, 209, 1, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 163, 0, 163, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 213, 0, 0, 0, 0, 0, 213, 1, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 130, 0, 130, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 214, 0, 0, 0, 0, 0, 214, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 218, 0, 0, 0, 0, 0, 218, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 217, 0, 0, 0, 0, 0, 217, 1, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 219, 0, 0, 0, 0, 0, 219, 1, 0, 0, 10, 7, 12, 3 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 56, 0, 56, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 2, 0, 0, 0, 1, 0, 2, 1, 80, 0, 10, 7, 12, 3 },
- { 16, 0, 0, 0, -1, 0, 0, 1, 0, -1, 0, 0, 0, 1, 1, 80, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -2, 0, -1, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -79, 0, -79, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 503, 1, 503, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -97, 0, 0, 0, 0, 0, -97, 4, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -56, 0, 0, 0, 0, 0, -56, 4, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 4, 17, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 4, 17, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 4, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 4, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -130, 0, 0, 0, 0, 0, -130, 6, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 8, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 8, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 8, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -163, 0, 0, 0, 0, 0, -163, 8, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 3, 0, 0, 0, 0, 1, 3, 8, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 5, 1, 5, 0, 0, 8, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 7, 1, 7, 0, 0, 8, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 9, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -195, 0, 0, 0, 0, 0, -195, 9, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 69, 0, 0, 0, 0, 0, 69, 9, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 71, 0, 0, 0, 0, 0, 71, 9, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 9, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 9, 1, 9, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 11, 1, 11, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 13, 1, 13, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -210, 0, -210, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -206, 0, -206, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -205, 0, -205, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -202, 0, -202, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -203, 0, -203, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 15, 1, 15, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 17, 1, 17, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -207, 0, -207, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 19, 1, 19, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 21, 1, 21, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -209, 0, -209, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -211, 0, -211, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 23, 1, 23, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 25, 1, 25, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 27, 1, 27, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 29, 1, 29, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -213, 0, -213, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -214, 0, -214, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 31, 1, 31, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -218, 0, -218, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 33, 1, 33, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -69, 0, -69, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -217, 0, -217, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -71, 0, -71, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -219, 0, -219, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 35, 1, 35, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 37, 1, 37, 0, 0, 1, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 6, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 6, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 0, 12, 2 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 18, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 0, 18, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 36 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 0, 12, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 0, 12, 2 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 232, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 216, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 202, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 202, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 4, 4, 4, 21, 1 },
- { 0, 17, 240, 5, -1, 0, 0, 0, 0, 84, 0, 84, 0, 116, 1, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 4, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 232, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 233, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 4, 1 },
- { 0, 17, 234, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 4, 1 },
- { 0, 17, 233, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 4, 1 },
- { 0, 17, 234, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 4, 1 },
- { 0, 17, 233, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 4, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 1 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 10, 0, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 10, 0, 0, 10, 6, 12, 4 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 10, 8, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 4 },
- { 13, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 130, 0, 130, 0, 0, 9, 0, 0, 10, 6, 12, 4 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 15, 0, 8, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 116, 0, 0, 0, 0, 0, 116, 16, 0, 0, 10, 7, 12, 4 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 4 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 38, 0, 0, 0, 0, 0, 38, 1, 17, 0, 10, 7, 12, 4 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 14, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 37, 0, 0, 0, 0, 0, 37, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 64, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 63, 0, 0, 0, 0, 0, 63, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 495, 1, 495, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 0, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -38, 0, -38, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -37, 0, -37, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 499, 1, 499, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 0, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -31, 0, -31, 0, 1, 1, 0, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -64, 0, -64, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -63, 0, -63, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 8, 0, 0, 0, 0, 0, 8, 10, 0, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -62, 0, -62, 0, -30, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -57, 0, -57, 0, -25, 1, 80, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -47, 0, -47, 0, -15, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -54, 0, -54, 0, -22, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -8, 0, -8, 0, 0, 4, 0, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 6, 0, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 6, 0, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 4, 0, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 10, 7, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 0, 0, 10, 6, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -86, 0, -86, 0, -54, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -80, 0, -80, 0, -48, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 7, 0, 0, 1, 80, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -116, 0, -116, 0, 0, 1, 0, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -60, 0, 0, 0, 0, 0, -60, 5, 80, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -96, 0, -96, 0, -64, 5, 80, 0, 10, 6, 12, 4 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 7, 0, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 7, 0, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -7, 0, 0, 0, 0, 0, -7, 7, 80, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -130, 0, 0, 0, 0, 0, -130, 8, 0, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, 80, 0, 0, 0, 0, 0, 80, 4, 17, 0, 10, 7, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 80, 0, 0, 0, 0, 0, 80, 1, 17, 0, 10, 7, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 80, 0, 0, 0, 0, 0, 80, 1, 0, 0, 10, 7, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 0, 0, 10, 7, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 17, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 17, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -80, 0, -80, 0, 0, 4, 17, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -80, 0, -80, 0, 0, 1, 17, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -80, 0, -80, 0, 0, 1, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 17, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 1, 17, 0, 10, 6, 12, 5 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 5 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 5 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 5 },
- { 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 6, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 6, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 4, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 4, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 15, 0, 0, 0, 0, 0, 15, 1, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -15, 0, -15, 0, 0, 9, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 4, 17, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 4, 17, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 8, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 8, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 9, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 9, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 10, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 10, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 11, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 11, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 12, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 12, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 16, 0, 0, 10, 7, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 16, 0, 0, 10, 6, 12, 5 },
- { 14, 0, 0, 0, -1, 0, 0, 48, 0, 0, 0, 0, 0, 48, 1, 0, 0, 10, 7, 12, 6 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 6 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 6 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -48, 0, -48, 0, 0, 1, 0, 0, 10, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 459, 1, 456, 0, 0, 1, 80, 0, 10, 6, 12, 6 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 15, 12, 8, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 6 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 6 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 9, 6 },
- { 13, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 222, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 228, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 10, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 11, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 12, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 13, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 14, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 15, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 16, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 17, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 18, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 19, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 19, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 20, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 21, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 22, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 20, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 17, 7 },
- { 0, 17, 23, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 7 },
- { 0, 17, 24, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 0, 17, 25, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 6, 7 },
- { 0, 17, 18, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 7 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 9, 8, 13, 7 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 7 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 0, 12, 7 },
- { 10, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 6, 4, 12, 8 },
- { 10, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 7, 6, 4, 12, 8 },
- { 10, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 7, 6, 4, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 8 },
- { 26, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 8 },
- { 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 10, 8 },
- { 27, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 10, 8 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 15, 11, 8, 8 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 30, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 31, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 32, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 8 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 6, 2 },
- { 10, 13, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 3, 6, 4, 21, 8 },
- { 13, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 6, 8 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 6, 2 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 8 },
- { 17, 13, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 2 },
- { 0, 17, 27, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 28, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 29, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 30, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 31, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 32, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 33, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 34, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 204, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 8 },
- { 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 5, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 8 },
- { 25, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 25, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 15, 9, 11, 8 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 8 },
- { 0, 17, 35, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 8 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 6, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 8 },
- { 10, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 7, 6, 4, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 8 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 8 },
- { 17, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 8 },
- { 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 3, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 8 },
- { 29, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 8 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 12, 9 },
- { 25, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 9 },
- { 10, 13, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 7, 6, 4, 12, 9 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 9 },
- { 0, 17, 36, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 9 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 9 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 9 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 9 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 9 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 9 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 10 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 10 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 10 },
- { 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 3, 1, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 66 },
- { 18, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 66 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 66 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 66 },
- { 17, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 66 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 66 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 66 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 15, 11, 8, 66 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 12, 6, 66 },
- { 17, 1, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 66 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 82 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 82 },
- { 17, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 82 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 82 },
- { 18, 1, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 95 },
- { 18, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 95 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 95 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 95 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 95 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 9 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 9 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 9 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 8 },
- { 18, 13, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 8 },
- { 10, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 7, 6, 4, 12, 2 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 27, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 28, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 29, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 8 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 11 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 11 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 10, 8, 12, 11 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 11 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 8, 4, 4, 21, 11 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 11 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 11 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 21, 11 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 10, 8, 12, 11 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 17, 2 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 11 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 11 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 12 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 12 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 12 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 12 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 12 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 12 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 12 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 8, 4, 4, 21, 12 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 12 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 12 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 10, 8, 12, 12 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 12 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 12 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 12 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 12 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 12 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 9, 12 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 12 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 12, 12 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 13 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 13 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 4, 4, 21, 13 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 13 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 10, 8, 12, 13 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 13 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 13 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 13 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 13 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 13 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 14 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 14 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 14 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 14 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 14 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 14 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 14 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 14 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 14 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 9, 14 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 14 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 14 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 15 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 15 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 15 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 15 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 15 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 15 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 15 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 8, 4, 4, 21, 15 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 15 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 15 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 10, 8, 12, 15 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 15 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 15 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 15 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 16 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 16 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 10, 8, 12, 16 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 16 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 16 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 16 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 8, 4, 4, 21, 16 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 16 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 16 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 16 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 16 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 16 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 9, 16 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 17 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 17 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 17 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 17 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 17 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 17 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 4, 4, 21, 17 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 17 },
- { 0, 17, 84, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 17 },
- { 0, 17, 91, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 17 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 17 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 17 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 17 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 17 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 17 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 18 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 18 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 18 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 18 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 18 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 18 },
- { 0, 0, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 18 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 8, 4, 4, 21, 18 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 18 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 18 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 18 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 18 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 18 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 18 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 19 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 19 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 8, 4, 4, 21, 19 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 19 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 19 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 19 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 19 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 19 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 19 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 19 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 8, 4, 4, 21, 19 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 19 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 7, 10, 8, 12, 19 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 19 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 19 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 19 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 19 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 19 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 19 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 10, 19 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 8, 4, 4, 21, 20 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 20 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 204, 4, 4, 4, 21, 20 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 204, 4, 4, 4, 21, 20 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 20 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 17, 8, 4, 4, 21, 20 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 20 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 20 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 33, 21 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 21 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 8, 0, 8, 33, 21 },
- { 0, 17, 103, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 21 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 21 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 33, 21 },
- { 0, 17, 107, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 21 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 21 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 21 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 17, 21 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 33, 22 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 22 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 8, 0, 8, 33, 22 },
- { 0, 17, 118, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 22 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 33, 22 },
- { 0, 17, 122, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 33, 22 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 16, 9, 11, 22 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 8, 33, 22 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 8, 33, 22 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 10, 8, 12, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 18, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 18, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 12, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 4, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 17, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 80, 0, 0, 0, 4, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 6, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 12, 23 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 9, 11, 23 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 12, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 17, 23 },
- { 0, 17, 216, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 13, 0, 23 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 13, 1, 23 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 8, 4, 4, 21, 23 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 85, 0, 10, 8, 12, 23 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 23 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 23 },
- { 0, 17, 129, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 0, 17, 130, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 85, 4, 4, 4, 21, 23 },
- { 0, 17, 132, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 80, 4, 4, 4, 21, 23 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 8, 4, 4, 17, 23 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 4, 4, 21, 23 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 23 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 23 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 23 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 18, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 17, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 18, 23 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 23 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 2 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 4, 23 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 33, 24 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 8, 33, 24 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 17, 0, 0, 8, 33, 24 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 4, 4, 33, 24 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 4, 33, 24 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 33, 24 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 204, 4, 4, 4, 33, 24 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 8, 4, 4, 33, 24 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 33, 24 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 33, 24 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 33, 24 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 33, 24 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 33, 24 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 24 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 17, 24 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 24 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 33, 24 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 24 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 4, 4, 33, 24 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 33, 24 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 33, 24 },
- { 14, 0, 0, 0, -1, 0, 0, 7264, 0, 0, 0, 0, 0, 7264, 1, 0, 0, 10, 7, 12, 25 },
- { 14, 0, 0, 0, -1, 0, 0, 7264, 0, 0, 0, 0, 0, 7264, 13, 0, 0, 10, 7, 12, 25 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 25 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 25 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 25 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 10, 8, 12, 25 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 25 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 9, 10, 8, 25, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 9, 10, 8, 25, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 10, 10, 8, 26, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 10, 10, 8, 26, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 10, 10, 8, 26, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 11, 10, 8, 27, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 11, 10, 8, 27, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 11, 10, 8, 27, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 27 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 27 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 27 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 27 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 27 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 27 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 12, 27 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 27 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 27 },
- { 14, 0, 0, 0, -1, 0, 1, 39, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 41, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 43, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 45, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 47, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 49, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 51, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 53, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 55, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 57, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 59, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 61, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 63, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 65, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 67, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 69, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 71, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 73, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 75, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 77, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 79, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 81, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 83, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 85, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 87, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 89, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 91, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 93, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 95, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 97, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 99, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 101, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 103, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 105, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 107, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 109, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 111, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 113, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 115, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 117, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 119, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 121, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 123, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 125, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 127, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 129, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 131, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 133, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 135, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 137, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 139, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 141, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 143, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 145, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 147, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 149, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 151, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 153, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 155, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 157, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 159, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 161, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 163, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 165, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 167, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 169, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 171, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 173, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 175, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 177, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 179, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 181, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 183, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 185, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 187, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 189, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 191, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 193, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 195, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 1, 197, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 7, 12, 28 },
- { 14, 0, 0, 0, -1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 7, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -8, 0, -8, 0, -8, 17, 0, 0, 10, 6, 12, 28 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 29 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 29 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 29 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 12, 29 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 29 },
- { 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 5, 17, 30 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 30 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 13, 0, 30 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 13, 1, 30 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 31 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 2 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 31 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 31 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 42 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 42 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 42 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 43 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 43 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 43 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 12, 17, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 44 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 44 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 45 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 45 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 33, 32 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 33, 32 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 8, 4, 4, 33, 32 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 33, 32 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 32 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 5, 32 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 33, 32 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 32 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 9, 32 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 33, 32 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 32 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 32 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 33 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 11, 6, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 6, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 33 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 17, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 18, 33 },
- { 25, 10, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 33 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 11, 6, 33 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 12, 6, 33 },
- { 25, 10, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 33 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 33 },
- { 10, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 3, 6, 4, 4, 33 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 16, 9, 11, 33 },
- { 18, 0, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 33 },
- { 17, 0, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 33 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 12, 33 },
- { 0, 17, 228, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 33 },
- { 18, 0, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 33 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 47 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 47 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 47 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 4, 4, 21, 47 },
- { 0, 17, 222, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 47 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 47 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 47 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 47 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 12, 6, 47 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 47 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 33, 48 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8, 33, 56 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 56 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 16, 9, 11, 56 },
- { 5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 33, 56 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 33, 56 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 32 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 55 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 55 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 55 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 4, 4, 21, 55 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 55 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 55 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 78 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 33, 78 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 33, 78 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 33, 78 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 4, 4, 33, 78 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 33, 78 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 78 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 78 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 33, 78 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 78 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 33, 78 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 1 },
- { 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 62 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 8, 4, 4, 21, 62 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 62 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 17, 0, 10, 8, 12, 62 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 62 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 204, 8, 4, 4, 21, 62 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 17, 8, 4, 4, 21, 62 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 8, 4, 4, 21, 62 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 16, 9, 11, 62 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 12, 17, 62 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 62 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 17, 62 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 62 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 62 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 62 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 67 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 67 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 67 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 67 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 67 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 67 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 67 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 67 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 93 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 93 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 8, 4, 4, 21, 93 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 93 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 8, 4, 4, 21, 93 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 93 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 68 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 68 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 68 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 68 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 17, 68 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 17, 68 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 68 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 69 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 69 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 69 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 17, 69 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6254, 0, -6254, 0, -6222, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6253, 0, -6253, 0, -6221, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6244, 0, -6244, 0, -6212, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6242, 0, -6242, 0, -6210, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6243, 0, -6243, 0, -6211, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6236, 0, -6236, 0, -6204, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -6181, 0, -6181, 0, -6180, 18, 0, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 199, 1, 199, 1, 711, 18, 0, 0, 10, 6, 12, 5 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 67 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 1 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 2 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 1 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 21, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 2 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 2 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 1 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 2 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 8, 4, 4, 21, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 6, 12, 5 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 10, 6, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 6, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 10, 6, 12, 4 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 10, 6, 12, 5 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 201, 1, 201, 0, 0, 8, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 3814, 0, 3814, 0, 0, 8, 0, 0, 10, 6, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 10, 6, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 10, 6, 12, 4 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 234, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 214, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 202, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 232, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 228, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 233, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 1 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 506, 1, 506, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 509, 1, 509, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 512, 1, 512, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 515, 1, 515, 0, 0, 1, 17, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 518, 1, 518, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -59, 0, -59, 0, -58, 2, 81, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -7615, 0, 0, 0, 0, 0, -7615, 10, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 10, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 10, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 8, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -8, 0, 0, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 521, 1, 521, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 524, 1, 524, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 528, 1, 528, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 532, 1, 532, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 74, 0, 74, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 74, 0, 74, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 86, 0, 86, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 86, 0, 86, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 100, 0, 100, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 100, 0, 100, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 128, 0, 128, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 128, 0, 128, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 112, 0, 112, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 112, 0, 112, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 126, 0, 126, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 126, 0, 126, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 570, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 573, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 576, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 579, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 582, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 585, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 588, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 591, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 570, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 573, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 576, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 579, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 582, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 585, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 588, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 591, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 594, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 597, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 600, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 603, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 606, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 609, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 612, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 615, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 594, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 597, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 600, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 603, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 606, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 609, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 612, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 615, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 618, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 621, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 624, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 627, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 630, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 633, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 636, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 639, 0, 8, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 618, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 621, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 624, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 627, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 630, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 633, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 636, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -8, 1, 639, 0, 0, 0, -8, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 654, 1, 651, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 642, 0, 9, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 660, 1, 657, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 536, 1, 536, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 691, 1, 687, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -74, 0, 0, 0, 0, 0, -74, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -74, 0, 0, 0, 0, 0, -74, 1, 85, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -9, 1, 642, 0, 0, 0, -9, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -7205, 0, -7205, 0, -7173, 1, 85, 0, 10, 6, 12, 4 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 81, 0, 0, 0, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 666, 1, 663, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 645, 0, 9, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 672, 1, 669, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 539, 1, 539, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 699, 1, 695, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -86, 0, 0, 0, 0, 0, -86, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -86, 0, 0, 0, 0, 0, -86, 1, 85, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -9, 1, 645, 0, 0, 0, -9, 1, 17, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 542, 1, 542, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 495, 1, 495, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 546, 1, 546, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 549, 1, 549, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -100, 0, 0, 0, 0, 0, -100, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -100, 0, 0, 0, 0, 0, -100, 1, 85, 0, 10, 7, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 553, 1, 553, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 499, 1, 499, 0, 0, 1, 85, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 557, 1, 557, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 7, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 560, 1, 560, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 563, 1, 563, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -112, 0, 0, 0, 0, 0, -112, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -112, 0, 0, 0, 0, 0, -112, 1, 85, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -7, 0, 0, 0, 0, 0, -7, 1, 17, 0, 10, 7, 12, 4 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 0, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 678, 1, 675, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 648, 0, 9, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 684, 1, 681, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 567, 1, 567, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 707, 1, 703, 0, 0, 1, 17, 0, 10, 6, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -128, 0, 0, 0, 0, 0, -128, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -128, 0, 0, 0, 0, 0, -128, 1, 85, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -126, 0, 0, 0, 0, 0, -126, 1, 17, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 0, -126, 0, 0, 0, 0, 0, -126, 1, 85, 0, 10, 7, 12, 4 },
- { 16, 0, 0, 0, -1, 0, 0, -9, 1, 648, 0, 0, 0, -9, 1, 17, 0, 10, 7, 12, 4 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 0, 18, 4 },
- { 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 5, 17, 2 },
- { 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 5, 17, 2 },
- { 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 5, 4, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 4, 20, 2 },
- { 10, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 10, 18, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 5, 5, 4, 32, 1 },
- { 10, 0, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 10, 1, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 17, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 4, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 17, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 19, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 23, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 13, 13, 3, 2 },
- { 24, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 13, 13, 3, 2 },
- { 21, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 2 },
- { 23, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 24, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 13, 10, 15, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 15, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 14, 0, 17, 2 },
- { 7, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 3, 38, 2 },
- { 8, 7, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 3, 38, 2 },
- { 10, 11, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 10, 14, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 10, 16, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 10, 12, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 10, 15, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 6, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 80, 0, 17, 5, 4, 2 },
- { 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 10, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 10, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 10, 2 },
- { 23, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 24, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 12, 5, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 5, 2 },
- { 26, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 15, 0, 8, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 12, 5, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 80, 0, 0, 12, 5, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 2 },
- { 19, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 17, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 0, 12, 2 },
- { 6, 9, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 5, 17, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 6, 4, 22, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 6, 4, 12, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 3, 6, 4, 12, 2 },
- { 13, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 12, 0 },
- { 10, 19, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 3, 6, 4, 21, 2 },
- { 10, 20, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 3, 6, 4, 21, 2 },
- { 10, 21, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 3, 6, 4, 21, 2 },
- { 10, 22, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 3, 6, 4, 21, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 21, 2 },
- { 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 10, 6, 12, 3 },
- { 5, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 26, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 13, 1, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 80, 0, 10, 6, 12, 3 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 10, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 10, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 9, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 10, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 9, 2 },
- { 13, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0 },
- { 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 4, 4, 21, 1 },
- { 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 1 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 7, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 10, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 6, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 9, 2 },
- { 14, 0, 0, 0, -1, 0, 0, -7517, 0, 0, 0, 0, 0, -7517, 1, 85, 0, 10, 7, 12, 4 },
- { 14, 0, 0, 0, -1, 0, 1, 203, 0, 0, 0, 0, 1, 203, 1, 85, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 205, 0, 0, 0, 0, 1, 205, 1, 85, 0, 10, 7, 12, 3 },
- { 29, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 28, 0, 0, 0, 0, 0, 28, 1, 0, 0, 10, 7, 12, 3 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 8, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 80, 0, 10, 6, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 0, 0, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 10, 6, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 10, 6, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 10, 7, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -28, 0, -28, 0, 0, 9, 0, 0, 10, 6, 12, 3 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 4, 0, 0, 0, -1, 0, 0, 16, 0, 0, 0, 0, 0, 16, 1, 80, 0, 10, 7, 12, 3 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, -16, 0, -16, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 12, 3 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 3 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 2016, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 138, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 1824, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 2104, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 2108, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 2106, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -138, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 15, 2 },
- { 26, 10, 0, 0, -1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -8, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -7, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 14, 2 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 13, 1, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 26, 0, 0, 0, 0, 0, 26, 1, 80, 0, 10, 7, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, -26, 0, -26, 0, 0, 1, 80, 0, 10, 6, 12, 2 },
- { 5, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 14, 18, 0, 30, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 16, 20, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 16, 20, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 14, 18, 0, 30, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 16, 20, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 14, 18, 0, 30, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 3, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 13, 3, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 6, 2 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 13, 1, 2 },
- { 5, 10, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 13, 1, 2 },
- { 26, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 13, 1, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 12, 54 },
- { 21, 10, 0, 0, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 13, 1, 2 },
- { 21, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -3, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 13, 1, 2 },
- { 26, 10, 0, 0, -1, -1824, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -2016, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 85, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -2104, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -2106, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, -2108, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 48, 0, 0, 0, 0, 0, 48, 8, 0, 0, 10, 7, 12, 57 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -48, 0, -48, 0, 0, 8, 0, 0, 10, 6, 12, 57 },
- { 14, 0, 0, 0, -1, 0, 1, 207, 0, 0, 0, 0, 1, 207, 9, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, -3814, 0, 0, 0, 0, 0, -3814, 9, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 209, 0, 0, 0, 0, 1, 209, 9, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 211, 1, 211, 0, 0, 9, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 213, 1, 213, 0, 0, 9, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 215, 0, 0, 0, 0, 1, 215, 10, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 217, 0, 0, 0, 0, 1, 217, 10, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 219, 0, 0, 0, 0, 1, 219, 10, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 221, 0, 0, 0, 0, 1, 221, 11, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 6, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 80, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 223, 0, 0, 0, 0, 1, 223, 11, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 225, 0, 0, 0, 0, 1, 225, 11, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 8, 0, 0, 10, 7, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 8, 0, 0, 10, 6, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 6, 12, 46 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 46 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 11, 0, 0, 10, 7, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 11, 0, 0, 10, 6, 12, 46 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 46 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 13, 0, 0, 10, 7, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 13, 0, 0, 10, 6, 12, 46 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 6, 46 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 17, 46 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 46 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -7264, 0, -7264, 0, 0, 8, 0, 0, 10, 6, 12, 25 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -7264, 0, -7264, 0, 0, 13, 0, 0, 10, 6, 12, 25 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 58 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 58 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 10, 8, 12, 58 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 17, 58 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 58 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 13, 3, 2 },
- { 23, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 13, 3, 2 },
- { 24, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 13, 3, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 17, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 2 },
- { 23, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 13, 3, 2 },
- { 24, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 13, 3, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 6, 2 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 17, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 19, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 17, 2 },
- { 21, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 13, 0, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 17, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 14, 37 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 80, 0, 0, 0, 14, 37 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 14, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 11, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 14, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 5, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 14, 2 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 14, 37 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 5, 2 },
- { 22, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 13, 1, 2 },
- { 0, 17, 218, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 228, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 222, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 1 },
- { 1, 0, 224, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 26 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 14, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 14, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 21, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 80, 0, 0, 8, 14, 37 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 5, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 5, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 14, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 5, 34 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 14, 34 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 8, 14, 34 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 5, 34 },
- { 0, 17, 8, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 204, 4, 4, 4, 21, 1 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 0, 5, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 5, 34 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 0, 8, 5, 34 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 8, 14, 34 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 8, 0, 5, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 5, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 14, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 8, 8, 14, 35 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 5, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 5, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 8, 8, 5, 35 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 0, 8, 8, 5, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 8, 8, 14, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 10, 8, 14, 36 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 14, 36 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 14, 36 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 8, 14, 26 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 14, 2 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 14, 36 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 14, 36 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 8, 8, 5, 35 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 26 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 0, 0, 14, 26 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 14, 2 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 0, 0, 14, 2 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 0, 14, 26 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 0, 14, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 8, 14, 37 },
- { 13, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 14, 38 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 10, 8, 5, 38 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 14, 38 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 14, 38 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 83 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 83 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 83 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 17, 83 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 70 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 70 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 17, 70 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 6, 70 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 17, 70 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 70 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 5 },
- { 2, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 5 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 5 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 5 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 5 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 80, 0, 10, 6, 12, 5 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 5 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 84 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 84 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 84 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 84 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 17, 84 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 84 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 2 },
- { 17, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 1, 227, 0, 0, 0, 0, 1, 227, 10, 0, 0, 10, 7, 12, 3 },
- { 28, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 1, 229, 0, 0, 0, 0, 1, 229, 12, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 6, 12, 3 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 12, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 12, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 13, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 13, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 16, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 16, 0, 0, 10, 6, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 231, 0, 0, 0, 0, 1, 231, 13, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 233, 0, 0, 0, 0, 1, 233, 16, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 235, 0, 0, 0, 0, 1, 235, 16, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 237, 0, 0, 0, 0, 1, 237, 16, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 239, 0, 0, 0, 0, 1, 239, 18, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 241, 0, 0, 0, 0, 1, 241, 16, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 243, 0, 0, 0, 0, 1, 243, 16, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 1, 245, 0, 0, 0, 0, 1, 245, 17, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 928, 0, 0, 0, 0, 0, 928, 17, 0, 0, 10, 7, 12, 3 },
- { 14, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 17, 0, 0, 10, 7, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 17, 0, 0, 10, 6, 12, 3 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 3 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 80, 0, 10, 6, 12, 3 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 3 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 59 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 59 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 59 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 8, 4, 4, 21, 59 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 59 },
- { 29, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 2 },
- { 18, 0, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 65 },
- { 18, 0, 0, 4, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 65 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 65 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 18, 65 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 12, 6, 65 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 71 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 71 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 71 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 71 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 17, 71 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 71 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 11 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 11 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 18, 11 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 11 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 72 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 72 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 72 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 72 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 17, 2 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 17, 72 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 73 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 73 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 73 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 73 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 73 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 85 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 21, 85 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 85 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 85 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 21, 85 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 85 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 85 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 17, 85 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 2 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 85 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 8, 33, 24 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 33, 24 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 8, 33, 24 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 24 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 77 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 4, 4, 4, 21, 77 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 8, 4, 4, 21, 77 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 16, 9, 11, 77 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 77 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 12, 17, 77 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 24 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 24 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 33, 24 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 4, 4, 33, 24 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 79 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 33, 79 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 33, 79 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 8, 33, 79 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 33, 79 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 86 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 86 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 86 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 12, 17, 86 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 86 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 86 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 27 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -928, 0, -928, 0, 0, 16, 0, 0, 10, 6, 12, 3 },
- { 28, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 0, 12, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 6, 12, 4 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 247, 1, 247, 1, 247, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 249, 1, 249, 1, 249, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 251, 1, 251, 1, 251, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 253, 1, 253, 1, 253, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 255, 1, 255, 1, 255, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 257, 1, 257, 1, 257, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 259, 1, 259, 1, 259, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 261, 1, 261, 1, 261, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 263, 1, 263, 1, 263, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 265, 1, 265, 1, 265, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 267, 1, 267, 1, 267, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 269, 1, 269, 1, 269, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 271, 1, 271, 1, 271, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 273, 1, 273, 1, 273, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 275, 1, 275, 1, 275, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 277, 1, 277, 1, 277, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 279, 1, 279, 1, 279, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 281, 1, 281, 1, 281, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 283, 1, 283, 1, 283, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 285, 1, 285, 1, 285, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 287, 1, 287, 1, 287, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 289, 1, 289, 1, 289, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 291, 1, 291, 1, 291, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 293, 1, 293, 1, 293, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 295, 1, 295, 1, 295, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 297, 1, 297, 1, 297, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 299, 1, 299, 1, 299, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 301, 1, 301, 1, 301, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 303, 1, 303, 1, 303, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 305, 1, 305, 1, 305, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 307, 1, 307, 1, 307, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 309, 1, 309, 1, 309, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 311, 1, 311, 1, 311, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 313, 1, 313, 1, 313, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 315, 1, 315, 1, 315, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 317, 1, 317, 1, 317, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 319, 1, 319, 1, 319, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 321, 1, 321, 1, 321, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 323, 1, 323, 1, 323, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 325, 1, 325, 1, 325, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 327, 1, 327, 1, 327, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 329, 1, 329, 1, 329, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 331, 1, 331, 1, 331, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 333, 1, 333, 1, 333, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 335, 1, 335, 1, 335, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 337, 1, 337, 1, 337, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 339, 1, 339, 1, 339, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 341, 1, 341, 1, 341, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 343, 1, 343, 1, 343, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 345, 1, 345, 1, 345, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 347, 1, 347, 1, 347, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 349, 1, 349, 1, 349, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 351, 1, 351, 1, 351, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 353, 1, 353, 1, 353, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 355, 1, 355, 1, 355, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 357, 1, 357, 1, 357, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 359, 1, 359, 1, 359, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 361, 1, 361, 1, 361, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 363, 1, 363, 1, 363, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 365, 1, 365, 1, 365, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 367, 1, 367, 1, 367, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 369, 1, 369, 1, 369, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 371, 1, 371, 1, 371, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 373, 1, 373, 1, 373, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 375, 1, 375, 1, 375, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 377, 1, 377, 1, 377, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 379, 1, 379, 1, 379, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 381, 1, 381, 1, 381, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 383, 1, 383, 1, 383, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 385, 1, 385, 1, 385, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 387, 1, 387, 1, 387, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 389, 1, 389, 1, 389, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 391, 1, 391, 1, 391, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 393, 1, 393, 1, 393, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 395, 1, 395, 1, 395, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 397, 1, 397, 1, 397, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 399, 1, 399, 1, 399, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 401, 1, 401, 1, 401, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 403, 1, 403, 1, 403, 17, 0, 0, 10, 6, 12, 28 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 405, 1, 405, 1, 405, 17, 0, 0, 10, 6, 12, 28 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 86 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 21, 86 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 86 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 17, 86 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 86 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 16, 9, 11, 86 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17, 12, 10, 8, 23, 26 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 17, 13, 10, 8, 24, 26 },
- { 11, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 34, 0 },
- { 12, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 0 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 85, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 85, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 85, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 85, 0, 0, 8, 14, 37 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 419, 1, 416, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 425, 1, 422, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 431, 1, 428, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 438, 1, 434, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 446, 1, 442, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 453, 1, 450, 0, 0, 1, 80, 0, 10, 6, 12, 3 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 465, 1, 462, 0, 0, 1, 80, 0, 10, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 471, 1, 468, 0, 0, 1, 80, 0, 10, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 477, 1, 474, 0, 0, 1, 80, 0, 10, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 483, 1, 480, 0, 0, 1, 80, 0, 10, 6, 12, 6 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 1, 489, 1, 486, 0, 0, 1, 80, 0, 10, 6, 12, 6 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 85, 0, 9, 8, 13, 7 },
- { 0, 17, 26, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 4, 4, 21, 7 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 85, 0, 9, 8, 13, 7 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 9, 8, 13, 7 },
- { 26, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 12, 7 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 10, 8, 12, 8 },
- { 28, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 8 },
- { 13, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 12, 0 },
- { 27, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 0, 10, 8 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 4, 21, 1 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 15, 11, 8, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 11, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 0, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 14, 11, 8, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 15, 0, 8, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 0, 6, 2 },
- { 21, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 13, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 80, 0, 0, 0, 15, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 20, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 11, 14, 2 },
- { 19, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 17, 0, 14, 2 },
- { 21, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 13, 1, 2 },
- { 21, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 0, 13, 1, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 15, 11, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 11, 14, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 13, 10, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 15, 0, 5, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 14, 11, 5, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 12, 6, 2 },
- { 25, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 26, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 20, 3, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 11, 14, 2 },
- { 26, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 26, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 10, 8, 12, 8 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 6, 4, 22, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 13, 0, 14, 2 },
- { 25, 6, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 3, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 26, 10, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 26, 10, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 1, 80, 0, 10, 7, 14, 3 },
- { 21, 10, 0, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 13, 1, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 14, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 1, 80, 0, 10, 6, 14, 3 },
- { 21, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 13, 0, 2 },
- { 22, 10, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 80, 0, 0, 13, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 12, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 11, 1, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 5, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 8, 14, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 8, 5, 35 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 8, 8, 5, 2 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 4, 4, 4, 5, 2 },
- { 27, 4, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 80, 0, 0, 0, 10, 2 },
- { 10, 10, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 3, 6, 4, 21, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 29, 2 },
- { 13, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 12, 0 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 49 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 17, 2 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 17, 2 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 12, 2 },
- { 4, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 4 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 4 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 4 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 4 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 4 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 4 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 74 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 75 },
- { 5, 2, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 2 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 10, 8, 12, 39 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 39 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 12, 39 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 39 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 10, 8, 12, 40 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 10, 8, 12, 40 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 120 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 120 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 50 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 17, 50 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 60 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 17, 60 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 60 },
- { 14, 0, 0, 0, -1, 0, 0, 40, 0, 0, 0, 0, 0, 40, 5, 0, 0, 10, 7, 12, 41 },
- { 14, 0, 0, 0, -1, 0, 0, 40, 0, 0, 0, 0, 0, 40, 7, 0, 0, 10, 7, 12, 41 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -40, 0, -40, 0, 0, 5, 0, 0, 10, 6, 12, 41 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -40, 0, -40, 0, 0, 7, 0, 0, 10, 6, 12, 41 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 51 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 52 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 16, 9, 11, 52 },
- { 14, 0, 0, 0, -1, 0, 0, 40, 0, 0, 0, 0, 0, 40, 18, 0, 0, 10, 7, 12, 136 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -40, 0, -40, 0, 0, 18, 0, 0, 10, 6, 12, 136 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 106 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 103 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 103 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 110 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 10, 8, 12, 53 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 87 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 87 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 87 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 118 },
- { 29, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 118 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 118 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 117 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 117 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 128 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 128 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 64 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 64 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 64 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 17, 64 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 10, 8, 12, 76 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 12, 76 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 98 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 97 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 97 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 10, 8, 12, 61 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 61 },
- { 5, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 61 },
- { 5, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 61 },
- { 5, 1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 61 },
- { 5, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 61 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 61 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 17, 61 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 12, 17, 61 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 12, 61 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 88 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 88 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 88 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 116 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 116 },
- { 18, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 112 },
- { 18, 1, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 112 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 112 },
- { 29, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 112 },
- { 18, 1, 0, 4, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 112 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 112 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 112 },
- { 5, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 112 },
- { 5, 1, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 112 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 17, 112 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 15, 112 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 80 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 17, 80 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 89 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 89 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 90 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 90 },
- { 18, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 121 },
- { 18, 1, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 121 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 121 },
- { 5, 1, 0, 3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 121 },
- { 5, 1, 0, 2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 121 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 121 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 91 },
- { 14, 1, 0, 0, -1, 0, 0, 64, 0, 0, 0, 0, 0, 64, 17, 0, 0, 10, 7, 12, 130 },
- { 15, 1, 0, 0, -1, 0, 0, 0, 0, -64, 0, -64, 0, 0, 17, 0, 0, 10, 6, 12, 130 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 130 },
- { 5, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 5, 5, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 8 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 8, 4, 4, 21, 94 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 94 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 94 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 4, 4, 21, 94 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 12, 17, 94 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 94 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 16, 9, 11, 94 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 94 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 92 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 8, 4, 4, 21, 92 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 92 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 17, 0, 10, 8, 12, 92 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 4, 4, 4, 21, 92 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 204, 4, 4, 4, 21, 92 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 12, 92 },
- { 10, 0, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 7, 6, 4, 12, 92 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 17, 92 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 101 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 101 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 96 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 96 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 204, 4, 4, 4, 21, 96 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 96 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 96 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 17, 4, 4, 4, 21, 96 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 96 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 96 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 17, 96 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 12, 17, 96 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 111 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 111 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 111 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 18, 111 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 100 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 100 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 100 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 100 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 7, 10, 8, 12, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 12, 17, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 17, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 100 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 100 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 12, 100 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 100 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 18, 100 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 17, 100 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 100 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 20 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 109 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 109 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 109 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 109 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 109 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 109 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 109 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 109 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 129 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 129 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 123 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 123 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 123 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 123 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 123 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 123 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 107 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 107 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 107 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 107 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 107 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 204, 4, 4, 4, 21, 107 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 8, 4, 4, 21, 107 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 107 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 107 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 107 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 135 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 8, 4, 4, 21, 135 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 135 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 135 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 135 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 12, 17, 135 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 17, 135 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 135 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 135 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 124 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 204, 4, 4, 4, 21, 124 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 124 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 124 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 204, 4, 4, 4, 21, 124 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 8, 4, 4, 21, 124 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 124 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 124 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 124 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 124 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 122 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 204, 4, 4, 4, 21, 122 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 122 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 122 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 8, 4, 4, 21, 122 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 122 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 122 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 18, 122 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 122 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 6, 122 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 122 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 122 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 122 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 122 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 114 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 8, 4, 4, 21, 114 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 114 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 114 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 114 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 114 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 114 },
- { 25, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 18, 33 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 102 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 102 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 102 },
- { 1, 0, 9, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 102 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 102 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 16, 9, 11, 102 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 8, 33, 126 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 33, 126 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 8, 4, 4, 33, 126 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 33, 126 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 16, 9, 11, 126 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 33, 126 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 126 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 33, 126 },
- { 14, 0, 0, 0, -1, 0, 0, 32, 0, 0, 0, 0, 0, 32, 16, 0, 0, 10, 7, 12, 125 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, -32, 0, -32, 0, 0, 16, 0, 0, 10, 6, 12, 125 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 125 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 125 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 125 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 141 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 141 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 8, 4, 4, 21, 141 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 141 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 7, 10, 8, 12, 141 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 18, 141 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 12, 141 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 17, 141 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 12, 17, 141 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 140 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 140 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 8, 4, 4, 21, 140 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 7, 10, 8, 12, 140 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 140 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 17, 140 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 12, 17, 140 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 18, 140 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 119 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 133 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 8, 4, 4, 21, 133 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 133 },
- { 0, 0, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 133 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 12, 17, 133 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 17, 133 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 133 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 133 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 18, 134 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 6, 134 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 12, 134 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 134 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 8, 4, 4, 21, 134 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 12, 138 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 138 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 138 },
- { 0, 17, 9, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 4, 4, 4, 21, 138 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 7, 10, 8, 12, 138 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 16, 9, 11, 138 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 63 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 63 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 63 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 10, 8, 12, 63 },
- { 4, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 63 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 17, 63 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 17, 63 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 12, 81 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 0, 81 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 8, 1, 81 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 12, 127 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 0, 127 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 10, 8, 1, 127 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 8, 12, 84 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 115 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 115 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 115 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 104 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 104 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 104 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 108 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 108 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 108 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 17, 108 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 108 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 108 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 108 },
- { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 16, 9, 11, 108 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 108 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 99 },
- { 1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 8, 4, 4, 21, 99 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 4, 4, 4, 21, 99 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 10, 8, 12, 99 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 10, 8, 5, 137 },
- { 17, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 10, 8, 5, 139 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 8, 14, 137 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 8, 8, 14, 35 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 8, 14, 34 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 8, 14, 34 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 8, 14, 139 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 105 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 105 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 105 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 105 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 12, 17, 105 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 3, 6, 4, 21, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 85, 0, 0, 0, 12, 2 },
- { 1, 0, 216, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 2 },
- { 1, 0, 216, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 4, 4, 21, 2 },
- { 0, 17, 1, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 1 },
- { 1, 0, 226, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 4, 4, 21, 2 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 6, 4, 21, 2 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 1 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 1 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 2 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 4, 4, 4, 21, 4 },
- { 5, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 10, 7, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 10, 6, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 80, 0, 10, 6, 12, 2 },
- { 26, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 0, 0, 12, 2 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 0, 0, 12, 2 },
- { 14, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 80, 0, 10, 7, 12, 2 },
- { 15, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 80, 0, 10, 6, 12, 2 },
- { 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 3, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 80, 0, 16, 9, 11, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 131 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 4, 4, 4, 21, 131 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 17, 131 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 12, 17, 131 },
- { 25, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 12, 131 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 57 },
- { 18, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 10, 8, 12, 113 },
- { 5, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 113 },
- { 0, 17, 220, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 4, 21, 113 },
- { 14, 1, 0, 2, -1, 0, 0, 34, 0, 0, 0, 0, 0, 34, 18, 0, 0, 10, 7, 12, 132 },
- { 15, 1, 0, 2, -1, 0, 0, 0, 0, -34, 0, -34, 0, 0, 18, 0, 0, 10, 6, 12, 132 },
- { 0, 17, 230, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 132 },
- { 0, 17, 7, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 4, 4, 4, 21, 132 },
- { 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 3, 1, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 16, 9, 11, 132 },
- { 25, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 132 },
- { 18, 13, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 80, 0, 10, 8, 12, 8 },
- { 26, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 8 },
- { 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 2, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 5, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 80, 0, 10, 7, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 10, 7, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 80, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 10, 7, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 10, 7, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 80, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 12, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 6, 7, 0, 28, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 80, 0, 0, 0, 14, 34 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 80, 0, 0, 0, 14, 2 },
- { 29, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 80, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 16, 20, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 14, 18, 0, 30, 2 },
- { 28, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 15, 19, 0, 31, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 17, 21, 0, 30, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 12, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 14, 18, 0, 30, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 16, 20, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 14, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 13, 3, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 5, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 14, 18, 0, 30, 2 },
- { 29, 10, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 14, 18, 0, 30, 2 },
- { 13, 18, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 12, 0 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 8, 14, 37 },
- { 18, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 85, 0, 0, 8, 14, 37 },
- { 10, 18, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 4, 4, 4, 21, 2 },
- { 0, 17, 0, 5, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 4, 4, 4, 21, 1 },
- { 12, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 12, 0 }
+ { 9, 18, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 21, 0, 2 },
+ { 9, 8, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 17, 5, 2 },
+ { 9, 7, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 2, 2, 37, 2, 2 },
+ { 9, 8, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 3, 38, 5, 2 },
+ { 9, 9, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 3, 38, 5, 2 },
+ { 9, 7, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 1, 1, 36, 1, 2 },
+ { 9, 7, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 21, 0, 2 },
+ { 9, 8, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 21, 0, 2 },
+ { 6, 9, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 35, 5, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 12, 3, 13, 2 },
+ { 25, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 25, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 11, 3, 13, 2 },
+ { 21, 10, 0, 0, -1, 1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 2, 13, 2 },
+ { 26, 3, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 11, 2 },
+ { 20, 3, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 16, 11, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 10, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 7, 0, 2 },
+ { 3, 2, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 8, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 0, 2 },
+ { 26, 10, 0, 0, -1, 2, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -2, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 3 },
+ { 21, 10, 0, 0, -1, 2, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 22, 10, 0, 0, -1, -2, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 2, 13, 2 },
+ { 28, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 19, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 17, 12, 0, 2 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 26, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 22, 10, 0, 0, -1, -2, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 9, 7, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 3, 38, 3, 2 },
+ { 6, 6, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 4, 5, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 28, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 23, 10, 0, 0, -1, 16, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 10, 18, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 17, 4, 2 },
+ { 29, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 26, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 5, 2, 0, 0, 2, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 3, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 28, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 2 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 743}, {0, 743}, {0, 775} }, 0, 10, 12, 6, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 14, 12, 0, 2 },
+ { 5, 2, 0, 0, 1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 24, 10, 0, 0, -1, -16, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 5, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 410}, {1, 407}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 121}, {0, 121}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {1, 413}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -232}, {0, -232}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 80, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 492}, {1, 492}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -121}, {0, 0}, {0, 0}, {0, -121} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -300}, {0, -300}, {0, -268} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 195}, {0, 195}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 210}, {0, 0}, {0, 0}, {0, 210} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 206}, {0, 0}, {0, 0}, {0, 206} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 205}, {0, 0}, {0, 0}, {0, 205} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 79}, {0, 0}, {0, 0}, {0, 79} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 202}, {0, 0}, {0, 0}, {0, 202} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 203}, {0, 0}, {0, 0}, {0, 203} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 207}, {0, 0}, {0, 0}, {0, 207} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 97}, {0, 97}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 211}, {0, 0}, {0, 0}, {0, 211} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 209}, {0, 0}, {0, 0}, {0, 209} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 163}, {0, 163}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 213}, {0, 0}, {0, 0}, {0, 213} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 130}, {0, 130}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 214}, {0, 0}, {0, 0}, {0, 214} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 218}, {0, 0}, {0, 0}, {0, 218} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 217}, {0, 0}, {0, 0}, {0, 217} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 219}, {0, 0}, {0, 0}, {0, 219} }, 0, 10, 12, 7, 3 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 56}, {0, 56}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 80, { {0, 2}, {0, 0}, {0, 1}, {0, 2} }, 0, 10, 12, 7, 3 },
+ { 16, 0, 0, 0, -1, 0, 1, 80, { {0, 1}, {0, -1}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -2}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -79}, {0, -79}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 503}, {1, 503}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {0, -97}, {0, 0}, {0, 0}, {0, -97} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {0, -56}, {0, 0}, {0, 0}, {0, -56} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 4, 17, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 4, 17, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 6, 0, { {0, -130}, {0, 0}, {0, 0}, {0, -130} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {1, 1}, {0, 0}, {0, 0}, {1, 1} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {0, -163}, {0, 0}, {0, 0}, {0, -163} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {1, 3}, {0, 0}, {0, 0}, {1, 3} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {1, 5}, {1, 5}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {1, 7}, {1, 7}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {0, -195}, {0, 0}, {0, 0}, {0, -195} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {0, 69}, {0, 0}, {0, 0}, {0, 69} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {0, 71}, {0, 0}, {0, 0}, {0, 71} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 9}, {1, 9}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 11}, {1, 11}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 13}, {1, 13}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -210}, {0, -210}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -206}, {0, -206}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -205}, {0, -205}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -202}, {0, -202}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -203}, {0, -203}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 15}, {1, 15}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 17}, {1, 17}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -207}, {0, -207}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 19}, {1, 19}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 21}, {1, 21}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -209}, {0, -209}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -211}, {0, -211}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 23}, {1, 23}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 25}, {1, 25}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 27}, {1, 27}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 29}, {1, 29}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -213}, {0, -213}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -214}, {0, -214}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 31}, {1, 31}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -218}, {0, -218}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 33}, {1, 33}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -69}, {0, -69}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -217}, {0, -217}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -71}, {0, -71}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -219}, {0, -219}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 35}, {1, 35}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {1, 37}, {1, 37}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 28, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 0, 2 },
+ { 17, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 18, 8, 2 },
+ { 28, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 18, 0, 2 },
+ { 28, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 36 },
+ { 17, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 28, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 28, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 0, 2 },
+ { 0, 17, 230, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 232, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 216, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 202, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 202, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 1, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 1, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 240, 5, -1, 0, 1, 204, { {0, 0}, {0, 84}, {0, 84}, {0, 116} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 4, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 232, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 233, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 4, 4, 1 },
+ { 0, 17, 234, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 4, 4, 1 },
+ { 0, 17, 233, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 4, 4, 1 },
+ { 0, 17, 234, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 4, 4, 1 },
+ { 0, 17, 233, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 4, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 17, 10, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 28, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 13, 0, 0, 0, -1, 0, 0, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 17, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 130}, {0, 130}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 25, 10, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {0, 116}, {0, 0}, {0, 0}, {0, 116} }, 0, 10, 12, 7, 4 },
+ { 28, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 28, 10, 0, 0, -1, 0, 1, 81, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 38}, {0, 0}, {0, 0}, {0, 38} }, 0, 10, 12, 7, 4 },
+ { 25, 10, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 14, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 37}, {0, 0}, {0, 0}, {0, 37} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 64}, {0, 0}, {0, 0}, {0, 64} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 63}, {0, 0}, {0, 0}, {0, 63} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 495}, {1, 495}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -38}, {0, -38}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -37}, {0, -37}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 499}, {1, 499}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -31}, {0, -31}, {0, 1} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -64}, {0, -64}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -63}, {0, -63}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {0, 8}, {0, 0}, {0, 0}, {0, 8} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -62}, {0, -62}, {0, -30} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -57}, {0, -57}, {0, -25} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 81, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -47}, {0, -47}, {0, -15} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -54}, {0, -54}, {0, -22} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, -8}, {0, -8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 6, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 46 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 46 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -86}, {0, -86}, {0, -54} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -80}, {0, -80}, {0, -48} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 7}, {0, 7}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -116}, {0, -116}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 5, 80, { {0, -60}, {0, 0}, {0, 0}, {0, -60} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 5, 80, { {0, 0}, {0, -96}, {0, -96}, {0, -64} }, 0, 10, 12, 6, 4 },
+ { 26, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 14, 0, 0, 0, -1, 0, 7, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 7, 80, { {0, -7}, {0, 0}, {0, 0}, {0, -7} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {0, -130}, {0, 0}, {0, 0}, {0, -130} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 4, 17, { {0, 80}, {0, 0}, {0, 0}, {0, 80} }, 0, 10, 12, 7, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 80}, {0, 0}, {0, 0}, {0, 80} }, 0, 10, 12, 7, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 80}, {0, 0}, {0, 0}, {0, 80} }, 0, 10, 12, 7, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 4, 17, { {0, 0}, {0, -80}, {0, -80}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -80}, {0, -80}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -80}, {0, -80}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 29, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 5 },
+ { 0, 17, 230, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 5 },
+ { 0, 17, 230, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 5 },
+ { 2, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 5 },
+ { 14, 0, 0, 0, -1, 0, 6, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 15}, {0, 0}, {0, 0}, {0, 15} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, -15}, {0, -15}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 4, 17, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 4, 17, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 11, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 12, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 5 },
+ { 15, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 48}, {0, 0}, {0, 0}, {0, 48} }, 0, 10, 12, 7, 6 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 6 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 6 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 11, 6 },
+ { 15, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, -48}, {0, -48}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 459}, {1, 456}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 12, 2 },
+ { 20, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 6 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 6 },
+ { 27, 4, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 6 },
+ { 13, 1, 0, 0, -1, 0, 0, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 0, 17, 220, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 230, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 222, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 220, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 228, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 10, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 11, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 12, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 13, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 14, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 15, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 16, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 17, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 18, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 19, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 19, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 20, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 21, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 22, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 20, 1, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 7 },
+ { 0, 17, 23, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 25, 1, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 7 },
+ { 0, 17, 24, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 0, 17, 25, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 25, 1, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 7 },
+ { 0, 17, 18, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 18, 1, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 9, 13, 8, 7 },
+ { 25, 1, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 7 },
+ { 25, 1, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 14, 12, 0, 7 },
+ { 10, 5, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 8 },
+ { 10, 5, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 8 },
+ { 10, 5, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 2 },
+ { 26, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 26, 13, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 25, 4, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 8 },
+ { 27, 13, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 8 },
+ { 25, 13, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 11, 8 },
+ { 29, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 0, 17, 230, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 230, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 30, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 31, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 32, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 25, 13, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 2 },
+ { 10, 13, 0, 5, -1, 0, 15, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 8 },
+ { 13, 13, 0, 0, -1, 0, 0, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 25, 13, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 8 },
+ { 25, 13, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 2 },
+ { 18, 13, 0, 2, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 17, 13, 0, 1, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 0, 17, 27, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 28, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 29, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 30, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 31, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 32, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 33, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 34, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 4, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 4, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 230, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 220, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 220, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 3, 5, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 5, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 25, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 8 },
+ { 25, 5, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 25, 5, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 11, 9, 8 },
+ { 25, 13, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 18, 13, 0, 2, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 0, 17, 35, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 18, 13, 0, 3, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 25, 13, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 8 },
+ { 0, 17, 230, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 10, 5, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 0, 17, 220, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 17, 13, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 3, 2, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 3, 2, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 8 },
+ { 29, 13, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 18, 13, 0, 2, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 25, 13, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 12, 9 },
+ { 25, 13, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 9 },
+ { 10, 13, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 9 },
+ { 18, 13, 0, 3, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 0, 17, 36, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 9 },
+ { 18, 13, 0, 2, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 18, 13, 0, 2, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 18, 13, 0, 3, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 0, 17, 230, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 9 },
+ { 0, 17, 220, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 9 },
+ { 18, 13, 0, 2, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 10 },
+ { 0, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 10 },
+ { 18, 13, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 10 },
+ { 3, 1, 0, 0, 0, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 2, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 3, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 4, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 5, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 6, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 7, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 8, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 3, 1, 0, 0, 9, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 66 },
+ { 18, 1, 0, 2, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 66 },
+ { 0, 17, 230, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 66 },
+ { 0, 17, 220, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 66 },
+ { 17, 1, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 66 },
+ { 29, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 66 },
+ { 25, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 66 },
+ { 25, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 11, 66 },
+ { 25, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 66 },
+ { 17, 1, 0, 1, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 66 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 82 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 82 },
+ { 17, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 82 },
+ { 25, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 82 },
+ { 18, 1, 0, 3, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 95 },
+ { 18, 1, 0, 2, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 95 },
+ { 18, 1, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 95 },
+ { 0, 17, 220, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 95 },
+ { 25, 1, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 95 },
+ { 18, 13, 0, 2, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 18, 13, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 18, 13, 0, 3, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 9 },
+ { 18, 13, 0, 2, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 2, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 18, 13, 0, 3, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 0, 17, 230, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 10, 5, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 2 },
+ { 0, 17, 220, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 230, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 220, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 27, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 28, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 29, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 230, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 8 },
+ { 0, 17, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 11 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 0, 17, 0, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 1, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 11 },
+ { 0, 17, 7, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 11 },
+ { 0, 17, 230, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 18, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 2 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 11 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 11 },
+ { 17, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 12 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 12 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 12 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 12 },
+ { 0, 17, 7, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 12 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 12 },
+ { 1, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 12 },
+ { 1, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 12 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 12 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 12 },
+ { 18, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 12 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 12 },
+ { 27, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 12 },
+ { 5, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 12 },
+ { 5, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 12 },
+ { 29, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 12 },
+ { 27, 4, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 12 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 12 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 12 },
+ { 0, 17, 0, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 13 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 13 },
+ { 1, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 13 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 13 },
+ { 18, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 13 },
+ { 0, 17, 7, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 13 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 13 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 13 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 13 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 13 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 14 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 14 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 14 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 14 },
+ { 0, 17, 7, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 14 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 14 },
+ { 0, 17, 0, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 14 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 14 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 14 },
+ { 27, 4, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 14 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 14 },
+ { 0, 17, 0, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 14 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 15 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 15 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 15 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 15 },
+ { 0, 17, 7, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 15 },
+ { 1, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 15 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 15 },
+ { 1, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 15 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 15 },
+ { 0, 17, 0, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 15 },
+ { 18, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 15 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 15 },
+ { 29, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 15 },
+ { 5, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 15 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 16 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 16 },
+ { 18, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 16 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 16 },
+ { 1, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 16 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 16 },
+ { 1, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 16 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 16 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 16 },
+ { 3, 0, 0, 0, 0, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 16 },
+ { 5, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 16 },
+ { 29, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 16 },
+ { 27, 4, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 16 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 17 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 17 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 17 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 17 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 0, 17, 0, 5, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 0, 17, 84, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 0, 17, 91, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 17 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 17 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 17 },
+ { 5, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 17 },
+ { 29, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 17 },
+ { 18, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 18 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 18 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 18 },
+ { 0, 17, 7, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 18 },
+ { 0, 0, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 1, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 18 },
+ { 1, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 0, 17, 0, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 18 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 18 },
+ { 18, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 18 },
+ { 0, 17, 0, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 1, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 19 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 19 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 19 },
+ { 0, 17, 9, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 19 },
+ { 1, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 1, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 19 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 19 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 10, 12, 8, 19 },
+ { 29, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 19 },
+ { 18, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 19 },
+ { 5, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 19 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 19 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 19 },
+ { 5, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 19 },
+ { 29, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 19 },
+ { 1, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 20 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 20 },
+ { 0, 17, 9, 5, -1, 0, 4, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 20 },
+ { 1, 0, 0, 0, -1, 0, 4, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 20 },
+ { 0, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 20 },
+ { 1, 0, 0, 0, -1, 0, 4, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 20 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 20 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 20 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 21 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 21 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 0, 33, 8, 21 },
+ { 0, 17, 103, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 21 },
+ { 0, 17, 9, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 21 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 21 },
+ { 0, 17, 107, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 21 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 21 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 21 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 21 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 22 },
+ { 0, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 22 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 0, 33, 8, 22 },
+ { 0, 17, 118, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 22 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 22 },
+ { 0, 17, 122, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 22 },
+ { 3, 0, 0, 0, 0, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 3, 0, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 22 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 22 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 22 },
+ { 18, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 23 },
+ { 29, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 4, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 2, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 4, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 23 },
+ { 29, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 23 },
+ { 0, 17, 220, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 3, 0, 0, 0, 0, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 2, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 3, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 4, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 5, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 6, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 7, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 8, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 3, 0, 0, 0, 9, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 23 },
+ { 5, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 23 },
+ { 29, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 23 },
+ { 0, 17, 216, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 21, 10, 0, 0, -1, 1, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 23 },
+ { 22, 10, 0, 0, -1, -1, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 23 },
+ { 1, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 23 },
+ { 18, 0, 0, 0, -1, 0, 2, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 23 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 23 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 23 },
+ { 0, 17, 129, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 130, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 0, 5, -1, 0, 2, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 132, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 0, 5, -1, 0, 2, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 0, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 1, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 17, 4, 23 },
+ { 0, 17, 230, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 9, 5, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 23 },
+ { 0, 17, 0, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 0, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 29, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 23 },
+ { 29, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 23 },
+ { 0, 17, 220, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 23 },
+ { 29, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 23 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 23 },
+ { 29, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 4, 0, 23 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 18, 0, 0, 0, -1, 0, 4, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 4, 33, 4, 24 },
+ { 1, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 4, 33, 4, 24 },
+ { 0, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 0, 17, 0, 5, -1, 0, 4, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 1, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 33, 4, 24 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 0, 17, 7, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 0, 17, 9, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 0, 17, 9, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 33, 4, 24 },
+ { 3, 0, 0, 0, 0, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 2, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 3, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 4, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 5, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 6, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 7, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 8, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 9, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 24 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 24 },
+ { 0, 17, 220, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 4, 33, 4, 24 },
+ { 0, 17, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 29, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 24 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 7264}, {0, 0}, {0, 0}, {0, 7264} }, 0, 10, 12, 7, 25 },
+ { 14, 0, 0, 0, -1, 0, 13, 0, { {0, 7264}, {0, 0}, {0, 0}, {0, 7264} }, 0, 10, 12, 7, 25 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 25 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 25 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 25 },
+ { 25, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 25 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 25 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 9, 10, 25, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 9, 10, 25, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 10, 10, 26, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 10, 10, 26, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 10, 10, 26, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 11, 10, 27, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 11, 10, 27, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 11, 10, 27, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 27 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 27 },
+ { 0, 17, 230, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 27 },
+ { 0, 17, 230, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 27 },
+ { 25, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 27 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 12, 27 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 2, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 3, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 4, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 5, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 6, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 7, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 8, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, 9, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 5, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 27 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 39}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 41}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 43}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 45}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 47}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 49}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 51}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 53}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 55}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 57}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 59}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 61}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 63}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 65}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 67}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 69}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 71}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 73}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 75}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 77}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 79}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 81}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 83}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 85}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 87}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 89}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 91}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 93}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 95}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 97}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 99}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 101}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 103}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 105}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 107}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 109}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 111}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 113}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 115}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 117}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 119}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 121}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 123}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 125}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 127}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 129}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 131}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 133}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 135}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 137}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 139}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 141}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 143}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 145}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 147}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 149}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 151}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 153}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 155}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 157}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 159}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 161}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 163}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 165}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 167}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 169}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 171}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 173}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 175}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 177}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 179}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 181}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 183}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 185}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 187}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 189}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 191}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 193}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 195}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {1, 197}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 4, 0, { {0, 8}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 14, 0, 0, 0, -1, 0, 17, 0, { {0, 8}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, -8}, {0, -8}, {0, -8} }, 0, 10, 12, 6, 28 },
+ { 20, 10, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 29 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 29 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 29 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 12, 29 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 29 },
+ { 6, 9, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 5, 30 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 30 },
+ { 21, 10, 0, 0, -1, 1, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 30 },
+ { 22, 10, 0, 0, -1, -1, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 30 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 31 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 4, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 31 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 31 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 42 },
+ { 0, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 42 },
+ { 0, 17, 9, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 42 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 43 },
+ { 0, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 43 },
+ { 0, 17, 9, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 43 },
+ { 25, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 2 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 44 },
+ { 0, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 44 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 45 },
+ { 0, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 45 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 32 },
+ { 0, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 32 },
+ { 1, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 33, 4, 32 },
+ { 0, 17, 9, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 32 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 32 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 0, 32 },
+ { 17, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 32 },
+ { 25, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 32 },
+ { 27, 4, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 32 },
+ { 0, 17, 230, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 32 },
+ { 3, 0, 0, 0, 0, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 2, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 3, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 4, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 5, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 6, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 7, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 8, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 3, 0, 0, 0, 9, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 32 },
+ { 5, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 32 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 33 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 33 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 33 },
+ { 25, 10, 0, 2, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 33 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 11, 33 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 33 },
+ { 25, 10, 0, 1, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 33 },
+ { 0, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 33 },
+ { 10, 18, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 4, 4, 33 },
+ { 3, 0, 0, 0, 0, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 2, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 3, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 4, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 5, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 6, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 7, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 8, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 3, 0, 0, 0, 9, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 33 },
+ { 18, 0, 0, 2, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 33 },
+ { 17, 0, 0, 2, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 33 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 33 },
+ { 0, 17, 228, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 33 },
+ { 18, 0, 0, 2, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 33 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 47 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 47 },
+ { 0, 17, 0, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 47 },
+ { 1, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 47 },
+ { 0, 17, 222, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 47 },
+ { 0, 17, 230, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 47 },
+ { 0, 17, 220, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 47 },
+ { 29, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 47 },
+ { 25, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 47 },
+ { 3, 0, 0, 0, 0, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 2, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 3, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 4, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 5, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 6, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 7, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 8, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 3, 0, 0, 0, 9, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 47 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 48 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 56 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 56 },
+ { 3, 0, 0, 0, 0, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 2, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 3, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 4, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 5, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 6, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 7, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 8, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 3, 0, 0, 0, 9, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 56 },
+ { 5, 0, 0, 0, 1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 56 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 56 },
+ { 29, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 32 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 55 },
+ { 0, 17, 230, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 55 },
+ { 0, 17, 220, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 55 },
+ { 1, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 55 },
+ { 0, 17, 0, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 55 },
+ { 25, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 55 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 78 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 33, 4, 78 },
+ { 0, 17, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 78 },
+ { 0, 17, 9, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 78 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 4, 33, 4, 78 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 78 },
+ { 0, 17, 220, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 78 },
+ { 3, 0, 0, 0, 0, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 2, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 3, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 4, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 5, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 6, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 7, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 8, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 3, 0, 0, 0, 9, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 78 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 78 },
+ { 17, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 78 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 12, 78 },
+ { 0, 17, 230, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 2, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 0, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 62 },
+ { 1, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 62 },
+ { 18, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 62 },
+ { 18, 0, 0, 0, -1, 0, 9, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 62 },
+ { 0, 17, 7, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 62 },
+ { 1, 0, 0, 0, -1, 0, 9, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 62 },
+ { 1, 0, 0, 0, -1, 0, 9, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 62 },
+ { 1, 0, 9, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 62 },
+ { 3, 0, 0, 0, 0, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 2, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 3, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 4, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 5, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 6, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 7, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 8, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 3, 0, 0, 0, 9, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 62 },
+ { 25, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 62 },
+ { 25, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 62 },
+ { 25, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 62 },
+ { 29, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 62 },
+ { 0, 17, 230, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 62 },
+ { 0, 17, 220, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 62 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 67 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 67 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 67 },
+ { 1, 0, 9, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 67 },
+ { 0, 17, 9, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 67 },
+ { 0, 17, 0, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 67 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 67 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 67 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 93 },
+ { 0, 17, 7, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 93 },
+ { 1, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 93 },
+ { 0, 17, 0, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 93 },
+ { 1, 0, 9, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 93 },
+ { 25, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 93 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 68 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 68 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 68 },
+ { 0, 17, 7, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 68 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 68 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 68 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 68 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 69 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 69 },
+ { 17, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 69 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 69 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6254}, {0, -6254}, {0, -6222} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6253}, {0, -6253}, {0, -6221} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6244}, {0, -6244}, {0, -6212} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6242}, {0, -6242}, {0, -6210} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6243}, {0, -6243}, {0, -6211} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6236}, {0, -6236}, {0, -6204} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -6181}, {0, -6181}, {0, -6180} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {1, 199}, {1, 199}, {1, 711} }, 0, 10, 12, 6, 5 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 67 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 0, 17, 1, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 2 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 1, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 2 },
+ { 0, 17, 230, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 1, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 2 },
+ { 15, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 17, 0, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 0, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 17, 0, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {1, 201}, {1, 201}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 3814}, {0, 3814}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 0, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 0, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 0, 17, 230, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 234, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 214, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 202, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 232, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 228, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 233, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 506}, {1, 506}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 509}, {1, 509}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 512}, {1, 512}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 515}, {1, 515}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 518}, {1, 518}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 2, 81, { {0, 0}, {0, -59}, {0, -59}, {0, -58} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {0, -7615}, {0, 0}, {0, 0}, {0, -7615} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 8}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {0, 0}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 521}, {1, 521}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 524}, {1, 524}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 528}, {1, 528}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 532}, {1, 532}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 74}, {0, 74}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 74}, {0, 74}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 86}, {0, 86}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 86}, {0, 86}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 100}, {0, 100}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 100}, {0, 100}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 128}, {0, 128}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 128}, {0, 128}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 112}, {0, 112}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 112}, {0, 112}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 126}, {0, 126}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 126}, {0, 126}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 570}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 573}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 576}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 579}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 582}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 585}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 588}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 591}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 570}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 573}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 576}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 579}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 582}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 585}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 588}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 591}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 594}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 597}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 600}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 603}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 606}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 609}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 612}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 615}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 594}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 597}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 600}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 603}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 606}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 609}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 612}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 615}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 618}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 621}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 624}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 627}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 630}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 633}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 636}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 639}, {0, 8}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 618}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 621}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 624}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 627}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 630}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 633}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 636}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -8}, {1, 639}, {0, 0}, {0, -8} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 654}, {1, 651}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 642}, {0, 9}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 660}, {1, 657}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 536}, {1, 536}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 691}, {1, 687}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -74}, {0, 0}, {0, 0}, {0, -74} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -74}, {0, 0}, {0, 0}, {0, -74} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -9}, {1, 642}, {0, 0}, {0, -9} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, -7205}, {0, -7205}, {0, -7173} }, 0, 10, 12, 6, 4 },
+ { 28, 10, 0, 0, -1, 0, 1, 81, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 666}, {1, 663}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 645}, {0, 9}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 672}, {1, 669}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 539}, {1, 539}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 699}, {1, 695}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -86}, {0, 0}, {0, 0}, {0, -86} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -86}, {0, 0}, {0, 0}, {0, -86} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -9}, {1, 645}, {0, 0}, {0, -9} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 542}, {1, 542}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {1, 495}, {1, 495}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 546}, {1, 546}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 549}, {1, 549}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -100}, {0, 0}, {0, 0}, {0, -100} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -100}, {0, 0}, {0, 0}, {0, -100} }, 0, 10, 12, 7, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 553}, {1, 553}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {1, 499}, {1, 499}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 557}, {1, 557}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 7}, {0, 7}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 560}, {1, 560}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 563}, {1, 563}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -112}, {0, 0}, {0, 0}, {0, -112} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -112}, {0, 0}, {0, 0}, {0, -112} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -7}, {0, 0}, {0, 0}, {0, -7} }, 0, 10, 12, 7, 4 },
+ { 28, 10, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 678}, {1, 675}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 648}, {0, 9}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 684}, {1, 681}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 567}, {1, 567}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {1, 707}, {1, 703}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -128}, {0, 0}, {0, 0}, {0, -128} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -128}, {0, 0}, {0, 0}, {0, -128} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 17, { {0, -126}, {0, 0}, {0, 0}, {0, -126} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -126}, {0, 0}, {0, 0}, {0, -126} }, 0, 10, 12, 7, 4 },
+ { 16, 0, 0, 0, -1, 0, 1, 17, { {0, -9}, {1, 648}, {0, 0}, {0, -9} }, 0, 10, 12, 7, 4 },
+ { 28, 10, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 4 },
+ { 6, 9, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 5, 2 },
+ { 6, 9, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 5, 2 },
+ { 6, 9, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 4, 5, 2 },
+ { 10, 18, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 20, 4, 2 },
+ { 10, 18, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 10, 18, 0, 1, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 5, 5, 32, 4, 1 },
+ { 10, 0, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 1, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 20, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 4, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 11, 2 },
+ { 20, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 19, 11, 2 },
+ { 20, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 23, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 13, 3, 13, 2 },
+ { 24, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 13, 3, 13, 2 },
+ { 21, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 23, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 24, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 13, 15, 10, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 15, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 14, 17, 0, 2 },
+ { 7, 9, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 3, 38, 3, 2 },
+ { 8, 7, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 3, 38, 3, 2 },
+ { 10, 11, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 14, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 16, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 12, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 15, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 6, 6, 0, 0, -1, 0, 4, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 17, 4, 5, 2 },
+ { 25, 4, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 23, 10, 0, 0, -1, 1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 24, 10, 0, 0, -1, -1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 12, 2 },
+ { 26, 6, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 0, 2 },
+ { 22, 10, 0, 0, -1, -1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 4, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 19, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 17, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 6, 9, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 5, 2 },
+ { 10, 18, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 22, 4, 2 },
+ { 10, 18, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 12, 4, 2 },
+ { 10, 18, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 12, 4, 2 },
+ { 13, 18, 0, 0, -1, 0, 0, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 12, 0, 0 },
+ { 10, 19, 0, 0, -1, 0, 15, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 20, 0, 0, -1, 0, 15, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 21, 0, 0, -1, 0, 15, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 22, 0, 0, -1, 0, 15, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 10, 18, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 5, 2, 0, 0, 0, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 5, 2, 0, 0, 4, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 5, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 6, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 7, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 8, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 9, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 3, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 21, 10, 0, 0, -1, 1, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 17, 0, 0, 0, -1, 0, 12, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 27, 4, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 3, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 14, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 27, 4, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 13, 4, 0, 0, -1, 0, 0, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 0 },
+ { 2, 17, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 2, 17, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 2, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 1, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 220, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 1, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 29, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 9, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {0, -7517}, {0, 0}, {0, 0}, {0, -7517} }, 0, 10, 12, 7, 4 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {1, 203}, {0, 0}, {0, 0}, {1, 203} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 1, 85, { {1, 205}, {0, 0}, {0, 0}, {1, 205} }, 0, 10, 12, 7, 3 },
+ { 29, 4, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 0, { {0, 28}, {0, 0}, {0, 0}, {0, 28} }, 0, 10, 12, 7, 3 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 15, 0, 0, 0, -1, 0, 4, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 29, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 15, 0, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 15, 0, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 14, 0, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 26, 10, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, -28}, {0, -28}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 29, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, -1, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 4, 0, 0, 0, -1, 0, 1, 80, { {0, 16}, {0, 0}, {0, 0}, {0, 16} }, 0, 10, 12, 7, 3 },
+ { 4, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -16}, {0, -16}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 4, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 3 },
+ { 4, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 3 },
+ { 29, 10, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 3, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 3, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -3, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -3, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 2016, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -1, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 138, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 1, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -1, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 1824, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 2104, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 2108, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 2106, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -138, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 15, 0, 2 },
+ { 26, 10, 0, 0, -1, 8, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 7, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -8, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -7, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 21, 10, 0, 0, -1, 1, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 29, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 2, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 3, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 4, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 5, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 6, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 7, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 8, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 9, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 1, 80, { {0, 26}, {0, 0}, {0, 0}, {0, 26} }, 0, 10, 12, 7, 2 },
+ { 29, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -26}, {0, -26}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 5, 10, 0, 0, 0, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 2, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 3, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 4, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 5, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 6, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 7, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 8, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 9, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 0, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 16, 20, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 16, 20, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 16, 20, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 29, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 2 },
+ { 21, 10, 0, 0, -1, 1, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 5, 10, 0, 0, 1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 2, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 3, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 4, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 5, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 6, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 7, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 8, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, 9, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 1, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -1, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 21, 10, 0, 0, -1, 1, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 26, 10, 0, 0, -1, 1, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -1, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 2, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -2, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 1, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -1, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 21, 10, 0, 0, -1, 1, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 29, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 54 },
+ { 21, 10, 0, 0, -1, 3, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, 1, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 21, 10, 0, 0, -1, -1, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -3, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 26, 10, 0, 0, -1, -1824, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -2016, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 6, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -2104, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -2106, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, -2108, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {0, 48}, {0, 0}, {0, 0}, {0, 48} }, 0, 10, 12, 7, 57 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, -48}, {0, -48}, {0, 0} }, 0, 10, 12, 6, 57 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {1, 207}, {0, 0}, {0, 0}, {1, 207} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {0, -3814}, {0, 0}, {0, 0}, {0, -3814} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 9, 0, { {1, 209}, {0, 0}, {0, 0}, {1, 209} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {1, 211}, {1, 211}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {1, 213}, {1, 213}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {1, 215}, {0, 0}, {0, 0}, {1, 215} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {1, 217}, {0, 0}, {0, 0}, {1, 217} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {1, 219}, {0, 0}, {0, 0}, {1, 219} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 11, 0, { {1, 221}, {0, 0}, {0, 0}, {1, 221} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 17, 0, 0, 0, -1, 0, 10, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 11, 0, { {1, 223}, {0, 0}, {0, 0}, {1, 223} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 11, 0, { {1, 225}, {0, 0}, {0, 0}, {1, 225} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 8, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 46 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 46 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 46 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 46 },
+ { 14, 0, 0, 0, -1, 0, 11, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 46 },
+ { 15, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 46 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 46 },
+ { 14, 0, 0, 0, -1, 0, 13, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 46 },
+ { 15, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 46 },
+ { 25, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 46 },
+ { 25, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 46 },
+ { 5, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 46 },
+ { 15, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, -7264}, {0, -7264}, {0, 0} }, 0, 10, 12, 6, 25 },
+ { 15, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, -7264}, {0, -7264}, {0, 0} }, 0, 10, 12, 6, 25 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 58 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 58 },
+ { 17, 0, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 58 },
+ { 25, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 58 },
+ { 0, 17, 9, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 58 },
+ { 25, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 23, 10, 0, 0, -1, 1, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 24, 10, 0, 0, -1, -1, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 20, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 23, 10, 0, 0, -1, 1, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 24, 10, 0, 0, -1, -1, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 2 },
+ { 17, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 25, 10, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 19, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 21, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 37 },
+ { 29, 10, 0, 0, -1, 0, 4, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 37 },
+ { 29, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 5, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 2 },
+ { 4, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 20, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 0, 2 },
+ { 22, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 0, 17, 218, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 228, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 222, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 1, 0, 224, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 26 },
+ { 20, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 8, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 21, 8, 2 },
+ { 29, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 4, 0, 0, 0, -1, 0, 4, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 17, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 5, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 5, 8, 2 },
+ { 25, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 8, 34 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 34 },
+ { 18, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 34 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 8, 34 },
+ { 0, 17, 8, 5, -1, 0, 1, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 28, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 8, 34 },
+ { 17, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 8, 34 },
+ { 18, 0, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 34 },
+ { 20, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 0, 2 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 35 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 8, 35 },
+ { 18, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 8, 35 },
+ { 25, 10, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 35 },
+ { 17, 0, 0, 0, -1, 0, 1, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 35 },
+ { 18, 0, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 8, 35 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 36 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 36 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 36 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 26 },
+ { 29, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 5, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 36 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 36 },
+ { 18, 0, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 35 },
+ { 29, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 26 },
+ { 29, 10, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 26 },
+ { 29, 0, 0, 0, -1, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 5, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 5, 10, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 26 },
+ { 29, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 0, 35 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 13, 0, 0, 0, -1, 0, 0, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 0 },
+ { 18, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 14, 8, 38 },
+ { 17, 0, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 5, 8, 38 },
+ { 29, 10, 0, 0, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 38 },
+ { 29, 10, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 38 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 83 },
+ { 17, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 83 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 83 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 83 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 70 },
+ { 17, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 70 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 70 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 70 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 70 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 70 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 5 },
+ { 2, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 5 },
+ { 25, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 5 },
+ { 0, 17, 230, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 5 },
+ { 17, 10, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 5 },
+ { 17, 0, 0, 0, -1, 0, 16, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 5 },
+ { 0, 17, 230, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 5 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 84 },
+ { 4, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 84 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 84 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 84 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 84 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 84 },
+ { 28, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 17, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 28, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 10, 0, { {1, 227}, {0, 0}, {0, 0}, {1, 227} }, 0, 10, 12, 7, 3 },
+ { 28, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 12, 0, { {1, 229}, {0, 0}, {0, 0}, {1, 229} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 3 },
+ { 14, 0, 0, 0, -1, 0, 12, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 13, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 14, 0, 0, 0, -1, 0, 13, 0, { {1, 231}, {0, 0}, {0, 0}, {1, 231} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {1, 233}, {0, 0}, {0, 0}, {1, 233} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {1, 235}, {0, 0}, {0, 0}, {1, 235} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {1, 237}, {0, 0}, {0, 0}, {1, 237} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 18, 0, { {1, 239}, {0, 0}, {0, 0}, {1, 239} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {1, 241}, {0, 0}, {0, 0}, {1, 241} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {1, 243}, {0, 0}, {0, 0}, {1, 243} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 17, 0, { {1, 245}, {0, 0}, {0, 0}, {1, 245} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 17, 0, { {0, 928}, {0, 0}, {0, 0}, {0, 928} }, 0, 10, 12, 7, 3 },
+ { 14, 0, 0, 0, -1, 0, 17, 0, { {0, 1}, {0, 0}, {0, 0}, {0, 1} }, 0, 10, 12, 7, 3 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, -1}, {0, -1}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 3 },
+ { 17, 0, 0, 0, -1, 0, 13, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 3 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 59 },
+ { 0, 17, 0, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 59 },
+ { 0, 17, 9, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 59 },
+ { 1, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 59 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 59 },
+ { 29, 4, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 18, 0, 0, 2, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 65 },
+ { 18, 0, 0, 4, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 65 },
+ { 18, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 65 },
+ { 25, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 65 },
+ { 25, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 65 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 71 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 71 },
+ { 0, 17, 9, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 71 },
+ { 0, 17, 0, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 71 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 71 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 71 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 11 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 11 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 11 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 11 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 72 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 72 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 72 },
+ { 0, 17, 220, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 72 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 72 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 73 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 73 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 73 },
+ { 1, 0, 9, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 73 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 73 },
+ { 0, 17, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 85 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 85 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 85 },
+ { 0, 17, 7, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 85 },
+ { 1, 0, 9, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 85 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 85 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 85 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 85 },
+ { 17, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 2 },
+ { 3, 0, 0, 0, 0, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 2, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 3, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 4, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 5, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 6, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 7, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 8, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 3, 0, 0, 0, 9, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 85 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 24 },
+ { 17, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 24 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 77 },
+ { 0, 17, 0, 5, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 77 },
+ { 1, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 77 },
+ { 3, 0, 0, 0, 0, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 2, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 3, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 4, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 5, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 6, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 7, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 8, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 3, 0, 0, 0, 9, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 77 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 77 },
+ { 25, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 77 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 17, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 24 },
+ { 29, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 24 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 4, 33, 4, 24 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 79 },
+ { 0, 17, 230, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 79 },
+ { 0, 17, 220, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 79 },
+ { 17, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 79 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 79 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 86 },
+ { 1, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 86 },
+ { 0, 17, 0, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 86 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 86 },
+ { 17, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 86 },
+ { 0, 17, 9, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 86 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 27 },
+ { 15, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, -928}, {0, -928}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 28, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 0, 2 },
+ { 17, 0, 0, 0, -1, 0, 16, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 4 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 247}, {1, 247}, {1, 247} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 249}, {1, 249}, {1, 249} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 251}, {1, 251}, {1, 251} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 253}, {1, 253}, {1, 253} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 255}, {1, 255}, {1, 255} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 257}, {1, 257}, {1, 257} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 259}, {1, 259}, {1, 259} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 261}, {1, 261}, {1, 261} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 263}, {1, 263}, {1, 263} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 265}, {1, 265}, {1, 265} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 267}, {1, 267}, {1, 267} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 269}, {1, 269}, {1, 269} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 271}, {1, 271}, {1, 271} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 273}, {1, 273}, {1, 273} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 275}, {1, 275}, {1, 275} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 277}, {1, 277}, {1, 277} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 279}, {1, 279}, {1, 279} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 281}, {1, 281}, {1, 281} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 283}, {1, 283}, {1, 283} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 285}, {1, 285}, {1, 285} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 287}, {1, 287}, {1, 287} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 289}, {1, 289}, {1, 289} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 291}, {1, 291}, {1, 291} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 293}, {1, 293}, {1, 293} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 295}, {1, 295}, {1, 295} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 297}, {1, 297}, {1, 297} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 299}, {1, 299}, {1, 299} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 301}, {1, 301}, {1, 301} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 303}, {1, 303}, {1, 303} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 305}, {1, 305}, {1, 305} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 307}, {1, 307}, {1, 307} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 309}, {1, 309}, {1, 309} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 311}, {1, 311}, {1, 311} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 313}, {1, 313}, {1, 313} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 315}, {1, 315}, {1, 315} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 317}, {1, 317}, {1, 317} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 319}, {1, 319}, {1, 319} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 321}, {1, 321}, {1, 321} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 323}, {1, 323}, {1, 323} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 325}, {1, 325}, {1, 325} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 327}, {1, 327}, {1, 327} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 329}, {1, 329}, {1, 329} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 331}, {1, 331}, {1, 331} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 333}, {1, 333}, {1, 333} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 335}, {1, 335}, {1, 335} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 337}, {1, 337}, {1, 337} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 339}, {1, 339}, {1, 339} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 341}, {1, 341}, {1, 341} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 343}, {1, 343}, {1, 343} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 345}, {1, 345}, {1, 345} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 347}, {1, 347}, {1, 347} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 349}, {1, 349}, {1, 349} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 351}, {1, 351}, {1, 351} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 353}, {1, 353}, {1, 353} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 355}, {1, 355}, {1, 355} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 357}, {1, 357}, {1, 357} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 359}, {1, 359}, {1, 359} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 361}, {1, 361}, {1, 361} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 363}, {1, 363}, {1, 363} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 365}, {1, 365}, {1, 365} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 367}, {1, 367}, {1, 367} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 369}, {1, 369}, {1, 369} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 371}, {1, 371}, {1, 371} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 373}, {1, 373}, {1, 373} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 375}, {1, 375}, {1, 375} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 377}, {1, 377}, {1, 377} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 379}, {1, 379}, {1, 379} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 381}, {1, 381}, {1, 381} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 383}, {1, 383}, {1, 383} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 385}, {1, 385}, {1, 385} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 387}, {1, 387}, {1, 387} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 389}, {1, 389}, {1, 389} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 391}, {1, 391}, {1, 391} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 393}, {1, 393}, {1, 393} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 395}, {1, 395}, {1, 395} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 397}, {1, 397}, {1, 397} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 399}, {1, 399}, {1, 399} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 401}, {1, 401}, {1, 401} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 403}, {1, 403}, {1, 403} }, 0, 10, 12, 6, 28 },
+ { 15, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {1, 405}, {1, 405}, {1, 405} }, 0, 10, 12, 6, 28 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 86 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 86 },
+ { 0, 17, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 86 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 86 },
+ { 0, 17, 9, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 86 },
+ { 3, 0, 0, 0, 0, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 2, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 3, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 4, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 5, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 6, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 7, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 8, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 3, 0, 0, 0, 9, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 86 },
+ { 18, 0, 0, 0, -1, 0, 2, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 12, 10, 23, 8, 26 },
+ { 18, 0, 0, 0, -1, 0, 2, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 13, 10, 24, 8, 26 },
+ { 11, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 0, 34, 0, 0 },
+ { 12, 0, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 18, 0, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 13, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 6, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 11, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 8, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 419}, {1, 416}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 425}, {1, 422}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 431}, {1, 428}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 438}, {1, 434}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 446}, {1, 442}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 453}, {1, 450}, {0, 0} }, 0, 10, 12, 6, 3 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 465}, {1, 462}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 471}, {1, 468}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 477}, {1, 474}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 483}, {1, 480}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {1, 489}, {1, 486}, {0, 0} }, 0, 10, 12, 6, 6 },
+ { 18, 1, 0, 0, -1, 0, 4, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 9, 13, 8, 7 },
+ { 0, 17, 26, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 7 },
+ { 18, 1, 0, 0, -1, 0, 1, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 9, 13, 8, 7 },
+ { 18, 1, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 9, 13, 8, 7 },
+ { 26, 3, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 7 },
+ { 18, 13, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 28, 13, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 13, 18, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 27, 13, 0, 0, -1, 0, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 8 },
+ { 0, 17, 0, 5, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 14, 8, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 8, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 2 },
+ { 21, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 8, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 15, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 20, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 11, 2 },
+ { 19, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 17, 14, 0, 2 },
+ { 21, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 21, 10, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 1, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 11, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 13, 1, 10, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 15, 5, 0, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 14, 5, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 12, 2 },
+ { 25, 4, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 26, 3, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 20, 3, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 11, 2 },
+ { 26, 10, 0, 0, -1, 1, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 26, 10, 0, 0, -1, -1, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 18, 13, 0, 0, -1, 0, 6, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 10, 18, 0, 5, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 22, 4, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 13, 14, 0, 2 },
+ { 25, 6, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 0, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 2, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 3, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 4, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 5, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 6, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 7, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 8, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 3, 2, 0, 0, 9, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 26, 10, 0, 0, -1, 2, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 26, 10, 0, 0, -1, -2, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 1, 80, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 14, 7, 3 },
+ { 21, 10, 0, 0, -1, 2, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -2, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 28, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 15, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 14, 6, 3 },
+ { 21, 10, 0, 0, -1, 1, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 13, 2 },
+ { 22, 10, 0, 0, -1, -1, 6, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 13, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 12, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 1, 11, 2 },
+ { 25, 10, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 0, 2 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 8, 35 },
+ { 18, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 35 },
+ { 17, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 5, 8, 2 },
+ { 17, 0, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 5, 4, 2 },
+ { 27, 4, 0, 0, -1, 0, 1, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 10, 0, 2 },
+ { 10, 10, 0, 5, -1, 0, 4, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 29, 10, 0, 0, -1, 0, 3, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 29, 0, 2 },
+ { 13, 18, 0, 0, -1, 0, 1, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 49 },
+ { 25, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 25, 10, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 2 },
+ { 5, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 4, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 4 },
+ { 5, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 29, 10, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 5, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 29, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 4 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 74 },
+ { 18, 0, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 75 },
+ { 5, 2, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 18, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 39 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 39 },
+ { 5, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 39 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 39 },
+ { 18, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 40 },
+ { 4, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 40 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 120 },
+ { 0, 17, 230, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 120 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 50 },
+ { 25, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 50 },
+ { 18, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 60 },
+ { 25, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 60 },
+ { 4, 0, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 60 },
+ { 14, 0, 0, 0, -1, 0, 5, 0, { {0, 40}, {0, 0}, {0, 0}, {0, 40} }, 0, 10, 12, 7, 41 },
+ { 14, 0, 0, 0, -1, 0, 7, 0, { {0, 40}, {0, 0}, {0, 0}, {0, 40} }, 0, 10, 12, 7, 41 },
+ { 15, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, -40}, {0, -40}, {0, 0} }, 0, 10, 12, 6, 41 },
+ { 15, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, -40}, {0, -40}, {0, 0} }, 0, 10, 12, 6, 41 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 51 },
+ { 18, 0, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 52 },
+ { 3, 0, 0, 0, 0, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 2, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 3, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 4, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 5, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 6, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 7, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 8, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 3, 0, 0, 0, 9, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 52 },
+ { 14, 0, 0, 0, -1, 0, 18, 0, { {0, 40}, {0, 0}, {0, 0}, {0, 40} }, 0, 10, 12, 7, 136 },
+ { 15, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, -40}, {0, -40}, {0, 0} }, 0, 10, 12, 6, 136 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 106 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 103 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 103 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 110 },
+ { 18, 1, 0, 0, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 53 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 87 },
+ { 25, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 87 },
+ { 5, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 87 },
+ { 18, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 118 },
+ { 29, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 118 },
+ { 5, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 118 },
+ { 18, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 117 },
+ { 5, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 117 },
+ { 18, 1, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 128 },
+ { 5, 1, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 128 },
+ { 18, 1, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 64 },
+ { 5, 1, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 64 },
+ { 5, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 64 },
+ { 25, 10, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 64 },
+ { 18, 1, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 76 },
+ { 25, 1, 0, 0, -1, 0, 10, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 76 },
+ { 18, 1, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 98 },
+ { 18, 1, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 97 },
+ { 5, 1, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 97 },
+ { 18, 1, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 61 },
+ { 0, 17, 0, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 61 },
+ { 0, 17, 220, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 61 },
+ { 0, 17, 230, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 61 },
+ { 0, 17, 1, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 61 },
+ { 0, 17, 9, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 61 },
+ { 5, 1, 0, 0, 1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 61 },
+ { 5, 1, 0, 0, 2, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 61 },
+ { 5, 1, 0, 0, 3, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 61 },
+ { 5, 1, 0, 0, 4, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 61 },
+ { 5, 1, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 61 },
+ { 25, 1, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 61 },
+ { 25, 1, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 61 },
+ { 25, 1, 0, 0, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 61 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 88 },
+ { 5, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 88 },
+ { 25, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 88 },
+ { 18, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 116 },
+ { 5, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 116 },
+ { 18, 1, 0, 2, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 112 },
+ { 18, 1, 0, 3, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 112 },
+ { 18, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 112 },
+ { 29, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 112 },
+ { 18, 1, 0, 4, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 112 },
+ { 0, 17, 230, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 112 },
+ { 0, 17, 220, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 112 },
+ { 5, 1, 0, 2, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 112 },
+ { 5, 1, 0, 3, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 112 },
+ { 25, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 112 },
+ { 25, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 15, 0, 112 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 80 },
+ { 25, 10, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 80 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 89 },
+ { 5, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 89 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 90 },
+ { 5, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 90 },
+ { 18, 1, 0, 2, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 121 },
+ { 18, 1, 0, 3, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 121 },
+ { 25, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 121 },
+ { 5, 1, 0, 3, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 121 },
+ { 5, 1, 0, 2, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 121 },
+ { 5, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 121 },
+ { 18, 1, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 91 },
+ { 14, 1, 0, 0, -1, 0, 17, 0, { {0, 64}, {0, 0}, {0, 0}, {0, 64} }, 0, 10, 12, 7, 130 },
+ { 15, 1, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, -64}, {0, -64}, {0, 0} }, 0, 10, 12, 6, 130 },
+ { 5, 1, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 130 },
+ { 5, 5, 0, 0, 1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 2, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 3, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 4, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 5, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 6, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 7, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 8, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, 9, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 5, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 1, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 94 },
+ { 0, 17, 0, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 94 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 94 },
+ { 0, 17, 9, 5, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 94 },
+ { 25, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 94 },
+ { 25, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 2, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 3, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 4, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 5, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 6, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 7, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 8, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, 9, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 5, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 94 },
+ { 3, 0, 0, 0, 0, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 2, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 3, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 4, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 5, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 6, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 7, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 8, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 3, 0, 0, 0, 9, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 94 },
+ { 0, 17, 9, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 94 },
+ { 0, 17, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 92 },
+ { 1, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 92 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 92 },
+ { 18, 0, 0, 0, -1, 0, 11, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 92 },
+ { 0, 17, 9, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 92 },
+ { 0, 17, 7, 5, -1, 0, 11, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 92 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 92 },
+ { 10, 0, 0, 5, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 6, 12, 4, 92 },
+ { 25, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 92 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 101 },
+ { 3, 0, 0, 0, 0, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 2, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 3, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 4, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 5, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 6, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 7, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 8, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 3, 0, 0, 0, 9, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 101 },
+ { 0, 17, 230, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 96 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 96 },
+ { 0, 17, 0, 5, -1, 0, 13, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 96 },
+ { 0, 17, 0, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 96 },
+ { 1, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 96 },
+ { 0, 17, 0, 5, -1, 0, 13, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 96 },
+ { 0, 17, 9, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 96 },
+ { 3, 0, 0, 0, 0, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 2, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 3, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 4, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 5, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 6, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 7, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 8, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 3, 0, 0, 0, 9, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 96 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 96 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 96 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 111 },
+ { 0, 17, 7, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 111 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 111 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 111 },
+ { 0, 17, 0, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 100 },
+ { 1, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 100 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 100 },
+ { 1, 0, 9, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 100 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 10, 12, 8, 100 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 100 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 100 },
+ { 25, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 100 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 100 },
+ { 0, 17, 7, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 100 },
+ { 0, 17, 0, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 100 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 12, 100 },
+ { 3, 0, 0, 0, 0, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 2, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 3, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 4, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 5, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 6, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 7, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 8, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 3, 0, 0, 0, 9, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 100 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 100 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 100 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 100 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 100 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 100 },
+ { 5, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 20 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 109 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 109 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 109 },
+ { 1, 0, 9, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 109 },
+ { 0, 17, 7, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 109 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 109 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 109 },
+ { 0, 17, 0, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 109 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 129 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 129 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 123 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 123 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 123 },
+ { 0, 17, 7, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 123 },
+ { 0, 17, 9, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 123 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 123 },
+ { 0, 17, 0, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 107 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 107 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 107 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 107 },
+ { 0, 17, 7, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 107 },
+ { 1, 0, 0, 0, -1, 0, 16, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 107 },
+ { 1, 0, 0, 0, -1, 0, 16, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 107 },
+ { 1, 0, 9, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 107 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 107 },
+ { 0, 17, 230, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 107 },
+ { 18, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 135 },
+ { 1, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 135 },
+ { 0, 17, 0, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 135 },
+ { 0, 17, 9, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 135 },
+ { 0, 17, 7, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 135 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 135 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 135 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 135 },
+ { 3, 0, 0, 0, 0, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 2, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 3, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 4, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 5, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 6, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 7, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 8, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 3, 0, 0, 0, 9, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 135 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 124 },
+ { 1, 0, 0, 0, -1, 0, 16, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 124 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 124 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 124 },
+ { 0, 17, 0, 5, -1, 0, 16, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 124 },
+ { 1, 0, 0, 0, -1, 0, 16, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 124 },
+ { 0, 17, 9, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 124 },
+ { 0, 17, 7, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 124 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 124 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 124 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 122 },
+ { 1, 0, 0, 0, -1, 0, 16, 204, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 122 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 122 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 122 },
+ { 1, 0, 0, 0, -1, 0, 16, 17, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 122 },
+ { 0, 17, 9, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 122 },
+ { 0, 17, 7, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 122 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 122 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 122 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 122 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 122 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 122 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 122 },
+ { 0, 17, 0, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 122 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 114 },
+ { 1, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 114 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 114 },
+ { 0, 17, 9, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 114 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 114 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 114 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 114 },
+ { 25, 10, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 33 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 102 },
+ { 0, 17, 0, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 102 },
+ { 1, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 102 },
+ { 1, 0, 9, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 102 },
+ { 0, 17, 7, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 102 },
+ { 3, 0, 0, 0, 0, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 2, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 3, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 4, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 5, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 6, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 7, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 8, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 3, 0, 0, 0, 9, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 102 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 8, 126 },
+ { 0, 17, 0, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 126 },
+ { 1, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 33, 4, 126 },
+ { 0, 17, 9, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 33, 4, 126 },
+ { 3, 0, 0, 0, 0, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 2, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 3, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 4, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 5, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 6, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 7, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 8, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 3, 0, 0, 0, 9, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 126 },
+ { 5, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 126 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 126 },
+ { 29, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 33, 0, 126 },
+ { 14, 0, 0, 0, -1, 0, 16, 0, { {0, 32}, {0, 0}, {0, 0}, {0, 32} }, 0, 10, 12, 7, 125 },
+ { 15, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, -32}, {0, -32}, {0, 0} }, 0, 10, 12, 6, 125 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 125 },
+ { 5, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 125 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 125 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 141 },
+ { 0, 17, 0, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 141 },
+ { 1, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 141 },
+ { 0, 17, 9, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 141 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 10, 12, 8, 141 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 141 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 141 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 141 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 141 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 140 },
+ { 0, 17, 0, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 140 },
+ { 1, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 140 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 10, 12, 8, 140 },
+ { 0, 17, 9, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 140 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 140 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 140 },
+ { 25, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 140 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 119 },
+ { 18, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 133 },
+ { 1, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 133 },
+ { 0, 17, 0, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 133 },
+ { 0, 0, 9, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 133 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 133 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 133 },
+ { 3, 0, 0, 0, 0, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 2, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 3, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 4, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 5, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 6, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 7, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 8, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 3, 0, 0, 0, 9, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 133 },
+ { 5, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 133 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 18, 0, 134 },
+ { 25, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 6, 0, 134 },
+ { 18, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 134 },
+ { 0, 17, 0, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 134 },
+ { 1, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 134 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 138 },
+ { 0, 17, 0, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 138 },
+ { 0, 17, 7, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 138 },
+ { 0, 17, 9, 5, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 138 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 7, 10, 12, 8, 138 },
+ { 3, 0, 0, 0, 0, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 2, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 3, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 4, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 5, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 6, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 7, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 8, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 3, 0, 0, 0, 9, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 138 },
+ { 18, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 63 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 63 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 63 },
+ { 4, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 63 },
+ { 4, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 63 },
+ { 25, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 63 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 63 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 81 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 0, 8, 81 },
+ { 18, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 1, 8, 81 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 127 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 0, 8, 127 },
+ { 18, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 1, 8, 127 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 84 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 115 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 115 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 115 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 104 },
+ { 0, 17, 1, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 104 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 104 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 108 },
+ { 0, 17, 230, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 108 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 108 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 108 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 108 },
+ { 29, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 108 },
+ { 17, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 108 },
+ { 3, 0, 0, 0, 0, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 2, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 3, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 4, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 5, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 6, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 7, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 8, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 3, 0, 0, 0, 9, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 108 },
+ { 5, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 108 },
+ { 18, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 99 },
+ { 1, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 99 },
+ { 0, 17, 0, 5, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 99 },
+ { 17, 0, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 99 },
+ { 17, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 5, 8, 137 },
+ { 17, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 5, 8, 139 },
+ { 18, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 137 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 8, 14, 8, 35 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 34 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 34 },
+ { 18, 0, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 139 },
+ { 18, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 105 },
+ { 29, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 105 },
+ { 0, 17, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 105 },
+ { 0, 17, 1, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 105 },
+ { 25, 0, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 105 },
+ { 10, 18, 0, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 29, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 5, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 1, 0, 216, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 2 },
+ { 1, 0, 216, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 2 },
+ { 0, 17, 1, 5, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 1, 0, 226, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 8, 4, 21, 4, 2 },
+ { 10, 18, 0, 5, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 3, 6, 21, 4, 2 },
+ { 0, 17, 220, 5, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 0, 17, 230, 5, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 29, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 0, 17, 230, 5, -1, 0, 8, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 4 },
+ { 5, 0, 0, 0, -1, 0, 9, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 15, 0, 0, 0, -1, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 15, 0, 0, 0, -1, 0, 7, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 26, 0, 0, 0, -1, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 26, 10, 0, 0, -1, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 14, 0, 0, 0, -1, 0, 9, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 15, 0, 0, 0, -1, 0, 9, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 6, 2 },
+ { 3, 2, 0, 0, 0, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 1, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 2, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 3, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 4, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 5, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 6, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 7, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 8, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 3, 2, 0, 0, 9, 0, 5, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 2 },
+ { 29, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 131 },
+ { 0, 17, 0, 5, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 131 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 0, 131 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 17, 12, 131 },
+ { 25, 0, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 131 },
+ { 0, 17, 230, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 57 },
+ { 18, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 113 },
+ { 5, 1, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 113 },
+ { 0, 17, 220, 5, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 113 },
+ { 14, 1, 0, 2, -1, 0, 18, 0, { {0, 34}, {0, 0}, {0, 0}, {0, 34} }, 0, 10, 12, 7, 132 },
+ { 15, 1, 0, 2, -1, 0, 18, 0, { {0, 0}, {0, -34}, {0, -34}, {0, 0} }, 0, 10, 12, 6, 132 },
+ { 0, 17, 230, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 132 },
+ { 0, 17, 7, 5, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 132 },
+ { 3, 1, 0, 0, 0, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 2, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 3, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 4, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 5, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 6, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 7, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 8, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 3, 1, 0, 0, 9, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 16, 11, 9, 132 },
+ { 25, 1, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 0, 0, 132 },
+ { 18, 13, 0, 0, -1, 0, 13, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 8, 8 },
+ { 26, 10, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 8 },
+ { 5, 2, 0, 0, 0, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 1, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 2, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 3, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 4, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 5, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 6, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 7, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 8, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 2, 0, 0, 9, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 5, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 12, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 29, 0, 0, 0, -1, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 29, 0, 0, 0, -1, 0, 12, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 29, 0, 0, 0, -1, 0, 11, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 10, 12, 7, 2 },
+ { 29, 10, 0, 0, -1, 0, 13, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 6, 7, 28, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 11, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 34 },
+ { 29, 0, 0, 0, -1, 0, 12, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 0, 0, 0, -1, 0, 18, 80, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 16, 20, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 28, 10, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 15, 19, 31, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 17, 21, 30, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 18, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 16, 20, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 13, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 3, 13, 2 },
+ { 29, 10, 0, 0, -1, 0, 16, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 5, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 17, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 29, 10, 0, 0, -1, 0, 19, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 14, 18, 30, 0, 2 },
+ { 13, 18, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 },
+ { 18, 0, 0, 0, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 12, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 18, 0, 0, 0, -1, 0, 5, 85, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 14, 8, 37 },
+ { 10, 18, 0, 5, -1, 0, 5, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 2 },
+ { 0, 17, 0, 5, -1, 0, 7, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 4, 4, 21, 4, 1 },
+ { 12, 0, 0, 0, -1, 0, 2, 0, { {0, 0}, {0, 0}, {0, 0}, {0, 0} }, 0, 0, 12, 0, 0 }
};
-Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) noexcept
{
return uc_properties + GET_PROP_INDEX(ucs4);
}
-Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) noexcept
{
return uc_properties + GET_PROP_INDEX_UCS2(ucs2);
}
-Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept
{
return qGetProp(ucs4);
}
-Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept
{
return qGetProp(ucs2);
}
-Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept
{
return static_cast<GraphemeBreakClass>(qGetProp(ucs4)->graphemeBreakClass);
}
-Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept
{
return static_cast<WordBreakClass>(qGetProp(ucs4)->wordBreakClass);
}
-Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept
{
return static_cast<SentenceBreakClass>(qGetProp(ucs4)->sentenceBreakClass);
}
-Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW
+Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept
{
return static_cast<LineBreakClass>(qGetProp(ucs4)->lineBreakClass);
}
diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/text/qunicodetables_p.h
index 3f2e91a9b2..c453ef53e7 100644
--- a/src/corelib/tools/qunicodetables_p.h
+++ b/src/corelib/text/qunicodetables_p.h
@@ -63,6 +63,15 @@ QT_BEGIN_NAMESPACE
namespace QUnicodeTables {
+enum Case {
+ LowerCase,
+ UpperCase,
+ TitleCase,
+ CaseFold,
+
+ NumCases
+};
+
struct Properties {
ushort category : 8; /* 5 used */
ushort direction : 8; /* 5 used */
@@ -70,63 +79,29 @@ struct Properties {
ushort joining : 3;
signed short digitValue : 5;
signed short mirrorDiff : 16;
- ushort lowerCaseSpecial : 1;
- signed short lowerCaseDiff : 15;
+ ushort unicodeVersion : 8; /* 5 used */
+ ushort nfQuickCheck : 8;
#ifdef Q_OS_WASM
unsigned char : 0; //wasm 64 packing trick
#endif
- ushort upperCaseSpecial : 1;
- signed short upperCaseDiff : 15;
- ushort titleCaseSpecial : 1;
- signed short titleCaseDiff : 15;
- ushort caseFoldSpecial : 1;
- signed short caseFoldDiff : 15;
- ushort unicodeVersion : 8; /* 5 used */
- ushort nfQuickCheck : 8;
+ struct {
+ ushort special : 1;
+ signed short diff : 15;
+ } cases[NumCases];
#ifdef Q_OS_WASM
unsigned char : 0; //wasm 64 packing trick
#endif
ushort graphemeBreakClass : 5; /* 5 used */
ushort wordBreakClass : 5; /* 5 used */
- ushort sentenceBreakClass : 8; /* 4 used */
ushort lineBreakClass : 6; /* 6 used */
+ ushort sentenceBreakClass : 8; /* 4 used */
ushort script : 8;
};
-Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW;
-Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW;
-
-struct LowercaseTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->lowerCaseDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->lowerCaseSpecial; }
-};
-
-struct UppercaseTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->upperCaseDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->upperCaseSpecial; }
-};
-
-struct TitlecaseTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->titleCaseDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->titleCaseSpecial; }
-};
+Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept;
+Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept;
-struct CasefoldTraits
-{
- static inline signed short caseDiff(const Properties *prop)
- { return prop->caseFoldDiff; }
- static inline bool caseSpecial(const Properties *prop)
- { return prop->caseFoldSpecial; }
-};
+Q_STATIC_ASSERT(sizeof(Properties) == 20);
enum GraphemeBreakClass {
GraphemeBreak_Any,
@@ -209,20 +184,20 @@ enum LineBreakClass {
NumLineBreakClasses
};
-Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline GraphemeBreakClass graphemeBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept;
+inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept
{ return graphemeBreakClass(ch.unicode()); }
-Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline WordBreakClass wordBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept;
+inline WordBreakClass wordBreakClass(QChar ch) noexcept
{ return wordBreakClass(ch.unicode()); }
-Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline SentenceBreakClass sentenceBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept;
+inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept
{ return sentenceBreakClass(ch.unicode()); }
-Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW;
-inline LineBreakClass lineBreakClass(QChar ch) Q_DECL_NOTHROW
+Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept;
+inline LineBreakClass lineBreakClass(QChar ch) noexcept
{ return lineBreakClass(ch.unicode()); }
} // namespace QUnicodeTables
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/text/qunicodetools.cpp
index 0a2bea28e2..08e1146c59 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/text/qunicodetools.cpp
@@ -542,7 +542,7 @@ static const uchar breakTable[QUnicodeTables::LineBreak_SA][QUnicodeTables::Line
} // namespace LB
-static void getLineBreaks(const ushort *string, quint32 len, QCharAttributes *attributes)
+static void getLineBreaks(const ushort *string, quint32 len, QCharAttributes *attributes, QUnicodeTools::CharAttributeOptions options)
{
quint32 nestart = 0;
LB::NS::Class nelast = LB::NS::XX;
@@ -564,6 +564,31 @@ static void getLineBreaks(const ushort *string, quint32 len, QCharAttributes *at
QUnicodeTables::LineBreakClass ncls = (QUnicodeTables::LineBreakClass) prop->lineBreakClass;
QUnicodeTables::LineBreakClass tcls;
+ if (options & QUnicodeTools::HangulLineBreakTailoring) {
+ if (Q_UNLIKELY((ncls >= QUnicodeTables::LineBreak_H2
+ && ncls <= QUnicodeTables::LineBreak_JT)
+ || (ucs4 >= 0x3130 && ucs4 <= 0x318F && ncls == QUnicodeTables::LineBreak_ID))
+ ) {
+ // LB27: use SPACE for line breaking
+ // "When Korean uses SPACE for line breaking, the classes in rule LB26,
+ // as well as characters of class ID, are often tailored to AL; see Section 8, Customization."
+ // In case of Korean syllables: "3130..318F HANGUL COMPATIBILITY JAMO"
+ ncls = QUnicodeTables::LineBreak_AL;
+ } else {
+ if (Q_UNLIKELY(ncls == QUnicodeTables::LineBreak_SA)) {
+ // LB1: resolve SA to AL, except of those that have Category Mn or Mc be resolved to CM
+ static const int test = FLAG(QChar::Mark_NonSpacing) | FLAG(QChar::Mark_SpacingCombining);
+ if (FLAG(prop->category) & test)
+ ncls = QUnicodeTables::LineBreak_CM;
+ }
+ if (Q_UNLIKELY(ncls == QUnicodeTables::LineBreak_CM)) {
+ // LB10: treat CM that follows SP, BK, CR, LF, NL, or ZW as AL
+ if (lcls == QUnicodeTables::LineBreak_ZW || lcls >= QUnicodeTables::LineBreak_SP)
+ ncls = QUnicodeTables::LineBreak_AL;
+ }
+ }
+ }
+
if (Q_UNLIKELY(ncls == QUnicodeTables::LineBreak_SA)) {
// LB1: resolve SA to AL, except of those that have Category Mn or Mc be resolved to CM
static const int test = FLAG(QChar::Mark_NonSpacing) | FLAG(QChar::Mark_SpacingCombining);
@@ -716,7 +741,7 @@ Q_CORE_EXPORT void initCharAttributes(const ushort *string, int length,
if (options & SentenceBreaks)
getSentenceBreaks(string, length, attributes);
if (options & LineBreaks)
- getLineBreaks(string, length, attributes);
+ getLineBreaks(string, length, attributes, options);
if (options & WhiteSpaces)
getWhiteSpaces(string, length, attributes);
diff --git a/src/corelib/tools/qunicodetools_p.h b/src/corelib/text/qunicodetools_p.h
index 5e2d56a226..ed6fcb5d65 100644
--- a/src/corelib/tools/qunicodetools_p.h
+++ b/src/corelib/text/qunicodetools_p.h
@@ -88,6 +88,7 @@ enum CharAttributeOption {
SentenceBreaks = 0x04,
LineBreaks = 0x08,
WhiteSpaces = 0x10,
+ HangulLineBreakTailoring = 0x20,
DefaultOptionsCompat = GraphemeBreaks | LineBreaks | WhiteSpaces, // ### remove
DontClearAttributes = 0x1000
diff --git a/src/corelib/tools/qvsnprintf.cpp b/src/corelib/text/qvsnprintf.cpp
index 43a21771a1..43a21771a1 100644
--- a/src/corelib/tools/qvsnprintf.cpp
+++ b/src/corelib/text/qvsnprintf.cpp
diff --git a/src/corelib/text/text.pri b/src/corelib/text/text.pri
new file mode 100644
index 0000000000..25e281f37a
--- /dev/null
+++ b/src/corelib/text/text.pri
@@ -0,0 +1,100 @@
+# Qt text / string / character / unicode / byte array module
+
+HEADERS += \
+ text/qbytearray.h \
+ text/qbytearray_p.h \
+ text/qbytearraylist.h \
+ text/qbytearraymatcher.h \
+ text/qbytedata_p.h \
+ text/qchar.h \
+ text/qcollator.h \
+ text/qcollator_p.h \
+ text/qdoublescanprint_p.h \
+ text/qlocale.h \
+ text/qlocale_p.h \
+ text/qlocale_tools_p.h \
+ text/qlocale_data_p.h \
+ text/qregexp.h \
+ text/qstring.h \
+ text/qstringalgorithms.h \
+ text/qstringalgorithms_p.h \
+ text/qstringbuilder.h \
+ text/qstringiterator_p.h \
+ text/qstringlist.h \
+ text/qstringliteral.h \
+ text/qstringmatcher.h \
+ text/qstringview.h \
+ text/qtextboundaryfinder.h \
+ text/qunicodetables_p.h \
+ text/qunicodetools_p.h
+
+
+SOURCES += \
+ text/qbytearray.cpp \
+ text/qbytearraylist.cpp \
+ text/qbytearraymatcher.cpp \
+ text/qcollator.cpp \
+ text/qlocale.cpp \
+ text/qlocale_tools.cpp \
+ text/qregexp.cpp \
+ text/qstring.cpp \
+ text/qstringbuilder.cpp \
+ text/qstringlist.cpp \
+ text/qstringview.cpp \
+ text/qtextboundaryfinder.cpp \
+ text/qunicodetools.cpp \
+ text/qvsnprintf.cpp
+
+NO_PCH_SOURCES += text/qstring_compat.cpp
+false: SOURCES += $$NO_PCH_SOURCES # Hack for QtCreator
+
+!nacl:macos: {
+ SOURCES += text/qlocale_mac.mm
+}
+else:unix {
+ SOURCES += text/qlocale_unix.cpp
+}
+else:win32 {
+ SOURCES += text/qlocale_win.cpp
+} else:integrity {
+ SOURCES += text/qlocale_unix.cpp
+}
+
+qtConfig(icu) {
+ QMAKE_USE_PRIVATE += icu
+
+ SOURCES += text/qlocale_icu.cpp \
+ text/qcollator_icu.cpp
+} else: win32 {
+ SOURCES += text/qcollator_win.cpp
+} else: macos {
+ SOURCES += text/qcollator_macx.cpp
+} else {
+ SOURCES += text/qcollator_posix.cpp
+}
+
+qtConfig(regularexpression) {
+ QMAKE_USE_PRIVATE += pcre2
+
+ HEADERS += \
+ text/qregularexpression.h
+ SOURCES += text/qregularexpression.cpp
+}
+
+INCLUDEPATH += ../3rdparty/harfbuzz/src
+HEADERS += ../3rdparty/harfbuzz/src/harfbuzz.h
+SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-gdef.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-gsub.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-gpos.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-impl.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-open.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-stream.c \
+ ../3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp \
+ text/qharfbuzz.cpp
+HEADERS += text/qharfbuzz_p.h
+
+TR_EXCLUDE += ../3rdparty/*
+
+# MIPS DSP
+MIPS_DSP_ASM += text/qstring_mips_dsp_asm.S
diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp
index c161bec537..b1a7edad91 100644
--- a/src/corelib/thread/qatomic.cpp
+++ b/src/corelib/thread/qatomic.cpp
@@ -258,12 +258,26 @@
/*!
\fn template <typename T> T QAtomicInteger<T>::load() const
+ \obsolete
+
+ Use loadRelaxed() instead.
Atomically loads the value of this QAtomicInteger using relaxed memory
ordering. The value is not modified in any way, but note that there's no
guarantee that it remains so.
- \sa store(), loadAcquire()
+ \sa storeRelaxed(), loadAcquire()
+*/
+
+/*!
+ \fn template <typename T> T QAtomicInteger<T>::loadRelaxed() const
+ \since 5.14
+
+ Atomically loads the value of this QAtomicInteger using relaxed memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa storeRelaxed(), loadAcquire()
*/
/*!
@@ -273,16 +287,29 @@
ordering. The value is not modified in any way, but note that there's no
guarantee that it remains so.
- \sa store(), load()
+ \sa storeRelaxed(), loadRelaxed()
*/
/*!
\fn template <typename T> void QAtomicInteger<T>::store(T newValue)
+ \obsolete
+
+ Use storeRelaxed() instead.
Atomically stores the \a newValue value into this atomic type, using
relaxed memory ordering.
- \sa storeRelease(), load()
+ \sa storeRelease(), loadRelaxed()
+*/
+
+/*!
+ \fn template <typename T> void QAtomicInteger<T>::storeRelaxed(T newValue)
+ \since 5.14
+
+ Atomically stores the \a newValue value into this atomic type, using
+ relaxed memory ordering.
+
+ \sa storeRelease(), loadRelaxed()
*/
/*!
@@ -291,7 +318,7 @@
Atomically stores the \a newValue value into this atomic type, using
the "Release" memory ordering.
- \sa store(), load()
+ \sa store(), loadAcquire()
*/
/*!
@@ -303,7 +330,7 @@
value is not modified in any way, but note that there's no guarantee that
it remains so.
- \sa load(), loadAcquire()
+ \sa loadRelaxed(), loadAcquire()
*/
/*!
@@ -314,7 +341,7 @@
sequentially consistent memory ordering if possible; or "Release" ordering
if not. This function returns a reference to this object.
- \sa store(), storeRelease()
+ \sa storeRelaxed(), storeRelease()
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isReferenceCountingNative()
@@ -1278,31 +1305,59 @@
/*!
\fn template <typename T> T *QAtomicPointer<T>::load() const
+ \obsolete
+
+ Use loadRelaxed() instead.
Atomically loads the value of this QAtomicPointer using relaxed memory
ordering. The value is not modified in any way, but note that there's no
guarantee that it remains so.
- \sa store(), loadAcquire()
+ \sa storeRelaxed(), loadAcquire()
*/
/*!
+ \fn template <typename T> T *QAtomicPointer<T>::loadRelaxed() const
+ \since 5.14
+
+ Atomically loads the value of this QAtomicPointer using relaxed memory
+ ordering. The value is not modified in any way, but note that there's no
+ guarantee that it remains so.
+
+ \sa storeRelaxed(), loadAcquire()
+*/
+
+
+/*!
\fn template <typename T> T *QAtomicPointer<T>::loadAcquire() const
Atomically loads the value of this QAtomicPointer using the "Acquire" memory
ordering. The value is not modified in any way, but note that there's no
guarantee that it remains so.
- \sa store(), load()
+ \sa storeRelease(), loadRelaxed()
*/
/*!
\fn template <typename T> void QAtomicPointer<T>::store(T *newValue)
+ \obsolete
+
+ Use storeRelaxed() instead.
+
+ Atomically stores the \a newValue value into this atomic type, using
+ relaxed memory ordering.
+
+ \sa storeRelease(), loadRelaxed()
+*/
+
+/*!
+ \fn template <typename T> void QAtomicPointer<T>::storeRelaxed(T *newValue)
+ \since 5.14
Atomically stores the \a newValue value into this atomic type, using
relaxed memory ordering.
- \sa storeRelease(), load()
+ \sa storeRelease(), loadRelaxed()
*/
/*!
@@ -1311,7 +1366,7 @@
Atomically stores the \a newValue value into this atomic type, using
the "Release" memory ordering.
- \sa store(), load()
+ \sa storeRelaxed(), loadRelaxed()
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isTestAndSetNative()
diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h
index f842534c38..a3b9be0729 100644
--- a/src/corelib/thread/qatomic.h
+++ b/src/corelib/thread/qatomic.h
@@ -57,15 +57,15 @@ class QAtomicInteger : public QBasicAtomicInteger<T>
public:
// Non-atomic API
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
- constexpr QAtomicInteger(T value = 0) Q_DECL_NOTHROW : QBasicAtomicInteger<T>(value) {}
+ constexpr QAtomicInteger(T value = 0) noexcept : QBasicAtomicInteger<T>(value) {}
#else
- inline QAtomicInteger(T value = 0) Q_DECL_NOTHROW
+ inline QAtomicInteger(T value = 0) noexcept
{
this->_q_value = value;
}
#endif
- inline QAtomicInteger(const QAtomicInteger &other) Q_DECL_NOTHROW
+ inline QAtomicInteger(const QAtomicInteger &other) noexcept
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
: QBasicAtomicInteger<T>()
#endif
@@ -73,7 +73,7 @@ public:
this->storeRelease(other.loadAcquire());
}
- inline QAtomicInteger &operator=(const QAtomicInteger &other) Q_DECL_NOTHROW
+ inline QAtomicInteger &operator=(const QAtomicInteger &other) noexcept
{
this->storeRelease(other.loadAcquire());
return *this;
@@ -81,8 +81,10 @@ public:
#ifdef Q_CLANG_QDOC
T load() const;
+ T loadRelaxed() const;
T loadAcquire() const;
void store(T newValue);
+ void storeRelaxed(T newValue);
void storeRelease(T newValue);
operator T() const;
@@ -159,7 +161,7 @@ public:
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
constexpr
#endif
- QAtomicInt(int value = 0) Q_DECL_NOTHROW : QAtomicInteger<int>(value) {}
+ QAtomicInt(int value = 0) noexcept : QAtomicInteger<int>(value) {}
};
// High-level atomic pointer operations
@@ -168,14 +170,14 @@ class QAtomicPointer : public QBasicAtomicPointer<T>
{
public:
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
- constexpr QAtomicPointer(T *value = nullptr) Q_DECL_NOTHROW : QBasicAtomicPointer<T>(value) {}
+ constexpr QAtomicPointer(T *value = nullptr) noexcept : QBasicAtomicPointer<T>(value) {}
#else
- inline QAtomicPointer(T *value = nullptr) Q_DECL_NOTHROW
+ inline QAtomicPointer(T *value = nullptr) noexcept
{
- this->store(value);
+ this->storeRelaxed(value);
}
#endif
- inline QAtomicPointer(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
+ inline QAtomicPointer(const QAtomicPointer<T> &other) noexcept
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
: QBasicAtomicPointer<T>()
#endif
@@ -183,7 +185,7 @@ public:
this->storeRelease(other.loadAcquire());
}
- inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other) Q_DECL_NOTHROW
+ inline QAtomicPointer<T> &operator=(const QAtomicPointer<T> &other) noexcept
{
this->storeRelease(other.loadAcquire());
return *this;
@@ -255,7 +257,7 @@ inline void qAtomicAssign(T *&d, T *x)
template <typename T>
inline void qAtomicDetach(T *&d)
{
- if (d->ref.load() == 1)
+ if (d->ref.loadRelaxed() == 1)
return;
T *x = d;
d = new T(*d);
diff --git a/src/corelib/thread/qatomic_bootstrap.h b/src/corelib/thread/qatomic_bootstrap.h
index b463f817bd..c4279ee7b1 100644
--- a/src/corelib/thread/qatomic_bootstrap.h
+++ b/src/corelib/thread/qatomic_bootstrap.h
@@ -56,16 +56,16 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
{
typedef T Type;
- static bool ref(T &_q_value) Q_DECL_NOTHROW
+ static bool ref(T &_q_value) noexcept
{
return ++_q_value != 0;
}
- static bool deref(T &_q_value) Q_DECL_NOTHROW
+ static bool deref(T &_q_value) noexcept
{
return --_q_value != 0;
}
- static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue = 0) Q_DECL_NOTHROW
+ static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
if (currentValue)
*currentValue = _q_value;
@@ -76,7 +76,7 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
return false;
}
- static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
T tmp = _q_value;
_q_value = newValue;
@@ -84,7 +84,7 @@ template <typename T> struct QAtomicOps: QGenericAtomicOps<QAtomicOps<T> >
}
template <typename AdditiveType> static
- T fetchAndAddRelaxed(T &_q_value, AdditiveType valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(T &_q_value, AdditiveType valueToAdd) noexcept
{
T returnValue = _q_value;
_q_value += valueToAdd;
diff --git a/src/corelib/thread/qatomic_cxx11.h b/src/corelib/thread/qatomic_cxx11.h
index 2fc0bf5419..7386aee126 100644
--- a/src/corelib/thread/qatomic_cxx11.h
+++ b/src/corelib/thread/qatomic_cxx11.h
@@ -222,43 +222,61 @@ template <typename X> struct QAtomicOps
typedef std::atomic<X> Type;
template <typename T> static inline
- T load(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T load(const std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_relaxed);
}
template <typename T> static inline
- T load(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T load(const volatile std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_relaxed);
}
template <typename T> static inline
- T loadAcquire(const std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T loadRelaxed(const std::atomic<T> &_q_value) noexcept
+ {
+ return _q_value.load(std::memory_order_relaxed);
+ }
+
+ template <typename T> static inline
+ T loadRelaxed(const volatile std::atomic<T> &_q_value) noexcept
+ {
+ return _q_value.load(std::memory_order_relaxed);
+ }
+
+ template <typename T> static inline
+ T loadAcquire(const std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_acquire);
}
template <typename T> static inline
- T loadAcquire(const volatile std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ T loadAcquire(const volatile std::atomic<T> &_q_value) noexcept
{
return _q_value.load(std::memory_order_acquire);
}
template <typename T> static inline
- void store(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ void store(std::atomic<T> &_q_value, T newValue) noexcept
+ {
+ _q_value.store(newValue, std::memory_order_relaxed);
+ }
+
+ template <typename T> static inline
+ void storeRelaxed(std::atomic<T> &_q_value, T newValue) noexcept
{
_q_value.store(newValue, std::memory_order_relaxed);
}
template <typename T> static inline
- void storeRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ void storeRelease(std::atomic<T> &_q_value, T newValue) noexcept
{
_q_value.store(newValue, std::memory_order_release);
}
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return isTestAndSetNative(); }
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return isTestAndSetNative(); }
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return false; }
template <typename T>
static inline bool ref(std::atomic<T> &_q_value)
{
@@ -266,17 +284,17 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static inline bool deref(std::atomic<T> &_q_value) Q_DECL_NOTHROW
+ static inline bool deref(std::atomic<T> &_q_value) noexcept
{
return --_q_value != 0;
}
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept
{ return QAtomicTraits<sizeof(X)>::isLockFree(); }
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return false; }
template <typename T>
- static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetRelaxed(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_relaxed, std::memory_order_relaxed);
if (currentValue)
@@ -285,7 +303,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetAcquire(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire);
if (currentValue)
@@ -294,7 +312,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetRelease(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_release, std::memory_order_relaxed);
if (currentValue)
@@ -303,7 +321,7 @@ template <typename X> struct QAtomicOps
}
template <typename T>
- static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) Q_DECL_NOTHROW
+ static bool testAndSetOrdered(std::atomic<T> &_q_value, T expectedValue, T newValue, T *currentValue = nullptr) noexcept
{
bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel, std::memory_order_acquire);
if (currentValue)
@@ -311,158 +329,158 @@ template <typename X> struct QAtomicOps
return tmp;
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return isTestAndSetNative(); }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return isTestAndSetNative(); }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; }
template <typename T>
- static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreRelaxed(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_relaxed);
}
template <typename T>
- static T fetchAndStoreAcquire(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreAcquire(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_acquire);
}
template <typename T>
- static T fetchAndStoreRelease(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreRelease(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_release);
}
template <typename T>
- static T fetchAndStoreOrdered(std::atomic<T> &_q_value, T newValue) Q_DECL_NOTHROW
+ static T fetchAndStoreOrdered(std::atomic<T> &_q_value, T newValue) noexcept
{
return _q_value.exchange(newValue, std::memory_order_acq_rel);
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return isTestAndSetNative(); }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return isTestAndSetNative(); }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; }
template <typename T> static inline
- T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndAddAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndAddRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndAddOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_add(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndSubRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndSubAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndSubRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndSubOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_sub(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndAndRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndAndAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndAndRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndAndOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_and(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndOrRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndOrAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndOrRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndOrOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_or(valueToAdd, std::memory_order_acq_rel);
}
template <typename T> static inline
- T fetchAndXorRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelaxed(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_relaxed);
}
template <typename T> static inline
- T fetchAndXorAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorAcquire(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_acquire);
}
template <typename T> static inline
- T fetchAndXorRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelease(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_release);
}
template <typename T> static inline
- T fetchAndXorOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorOrdered(std::atomic<T> &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return _q_value.fetch_xor(valueToAdd, std::memory_order_acq_rel);
}
};
-#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
+#if defined(Q_COMPILER_CONSTEXPR)
# define Q_BASIC_ATOMIC_INITIALIZER(a) { a }
#else
# define Q_BASIC_ATOMIC_INITIALIZER(a) { ATOMIC_VAR_INIT(a) }
diff --git a/src/corelib/thread/qatomic_msvc.h b/src/corelib/thread/qatomic_msvc.h
index 5eae2bdc48..67b5224cd7 100644
--- a/src/corelib/thread/qatomic_msvc.h
+++ b/src/corelib/thread/qatomic_msvc.h
@@ -269,24 +269,24 @@ template <> struct QAtomicWindowsType<4> { typedef long Type; };
template <int N> struct QAtomicOpsBySize : QGenericAtomicOps<QAtomicOpsBySize<N> >
{
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static bool ref(T &_q_value) Q_DECL_NOTHROW;
- template <typename T> static bool deref(T &_q_value) Q_DECL_NOTHROW;
-
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return true; }
+ template <typename T> static bool ref(T &_q_value) noexcept;
+ template <typename T> static bool deref(T &_q_value) noexcept;
+
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return true; }
+ template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept;
template <typename T>
- static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW;
+ static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return true; }
+ template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return true; }
- template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return true; }
+ template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept;
private:
typedef typename QAtomicWindowsType<N>::Type Type;
@@ -303,76 +303,76 @@ struct QAtomicOps : QAtomicOpsBySize<sizeof(T)>
};
template<> template<typename T>
-inline bool QAtomicOpsBySize<4>::ref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::ref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Increment)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<4>::deref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::deref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Decrement)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(CompareExchange)(atomic(&_q_value), value(newValue), value(expectedValue)) == value(expectedValue);
}
template<> template <typename T>
-inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept
{
*currentValue = T(QT_INTERLOCKED_FUNCTION(CompareExchange)(atomic(&_q_value), newValue, expectedValue));
return *currentValue == expectedValue;
}
template<> template<typename T>
-inline T QAtomicOpsBySize<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(Exchange)(atomic(&_q_value), value(newValue));
}
template<> template<typename T>
-inline T QAtomicOpsBySize<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return QT_INTERLOCKED_FUNCTION(ExchangeAdd)(atomic(&_q_value), value<T>(valueToAdd * QAtomicAdditiveType<T>::AddScale));
}
#ifdef Q_ATOMIC_INT16_IS_SUPPORTED
template<> template<typename T>
-inline bool QAtomicOpsBySize<2>::ref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::ref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Increment16)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<2>::deref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::deref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Decrement16)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(CompareExchange16)(atomic(&_q_value), value(newValue), value(expectedValue)) == value(expectedValue);
}
template<> template <typename T>
-inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept
{
*currentValue = T(QT_INTERLOCKED_FUNCTION(CompareExchange16)(atomic(&_q_value), newValue, expectedValue));
return *currentValue == expectedValue;
}
template<> template<typename T>
-inline T QAtomicOpsBySize<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(Exchange16)(atomic(&_q_value), value(newValue));
}
template<> template<typename T>
-inline T QAtomicOpsBySize<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return QT_INTERLOCKED_FUNCTION(ExchangeAdd16)(atomic(&_q_value), value<T>(valueToAdd * QAtomicAdditiveType<T>::AddScale));
}
@@ -380,38 +380,38 @@ inline T QAtomicOpsBySize<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAd
#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
template<> template<typename T>
-inline bool QAtomicOpsBySize<8>::ref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::ref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Increment64)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<8>::deref(T &_q_value) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::deref(T &_q_value) noexcept
{
return QT_INTERLOCKED_FUNCTION(Decrement64)(atomic(&_q_value)) != 0;
}
template<> template<typename T>
-inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(CompareExchange64)(atomic(&_q_value), value(newValue), value(expectedValue)) == value(expectedValue);
}
template<> template <typename T>
-inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOpsBySize<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) noexcept
{
*currentValue = T(QT_INTERLOCKED_FUNCTION(CompareExchange64)(atomic(&_q_value), newValue, expectedValue));
return *currentValue == expectedValue;
}
template<> template<typename T>
-inline T QAtomicOpsBySize<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) noexcept
{
return QT_INTERLOCKED_FUNCTION(Exchange64)(atomic(&_q_value), value(newValue));
}
template<> template<typename T>
-inline T QAtomicOpsBySize<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+inline T QAtomicOpsBySize<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
return QT_INTERLOCKED_FUNCTION(ExchangeAdd64)(atomic(&_q_value), value<T>(valueToAdd * QAtomicAdditiveType<T>::AddScale));
}
@@ -423,41 +423,41 @@ struct QAtomicOps<T *> : QGenericAtomicOps<QAtomicOps<T *> >
{
typedef T *Type;
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return true; }
- static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) Q_DECL_NOTHROW;
- static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return true; }
+ static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) noexcept;
+ static bool testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return true; }
- static T *fetchAndStoreRelaxed(T *&_q_value, T *newValue) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return true; }
+ static T *fetchAndStoreRelaxed(T *&_q_value, T *newValue) noexcept;
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return true; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return true; }
- static T *fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return true; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return true; }
+ static T *fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) noexcept;
};
template <typename T>
-inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) Q_DECL_NOTHROW
+inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue) noexcept
{
return QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&_q_value, newValue, expectedValue) == expectedValue;
}
template <typename T>
-inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) Q_DECL_NOTHROW
+inline bool QAtomicOps<T *>::testAndSetRelaxed(T *&_q_value, T *expectedValue, T *newValue, T **currentValue) noexcept
{
*currentValue = reinterpret_cast<T *>(QT_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&_q_value, newValue, expectedValue));
return *currentValue == expectedValue;
}
template <typename T>
-inline T *QAtomicOps<T *>::fetchAndStoreRelaxed(T *&_q_value, T *newValue) Q_DECL_NOTHROW
+inline T *QAtomicOps<T *>::fetchAndStoreRelaxed(T *&_q_value, T *newValue) noexcept
{
return reinterpret_cast<T *>(QT_INTERLOCKED_EXCHANGE_POINTER(&_q_value, newValue));
}
template <typename T>
-inline T *QAtomicOps<T *>::fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) Q_DECL_NOTHROW
+inline T *QAtomicOps<T *>::fetchAndAddRelaxed(T *&_q_value, qptrdiff valueToAdd) noexcept
{
return reinterpret_cast<T *>(QT_INTERLOCKED_EXCHANGE_ADD_POINTER(&_q_value, valueToAdd * sizeof(T)));
}
diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h
index 6b6ac10713..9804e60119 100644
--- a/src/corelib/thread/qbasicatomic.h
+++ b/src/corelib/thread/qbasicatomic.h
@@ -75,7 +75,7 @@ QT_END_NAMESPACE
// New atomics
-#if defined(Q_COMPILER_CONSTEXPR) && defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
+#if defined(Q_COMPILER_CONSTEXPR)
# if defined(Q_CC_CLANG) && Q_CC_CLANG < 303
/*
Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for Clang before version 3.3.
@@ -99,126 +99,130 @@ public:
typename Ops::Type _q_value;
// Everything below is either implemented in ../arch/qatomic_XXX.h or (as fallback) in qgenericatomic.h
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") T load() const noexcept { return loadRelaxed(); }
+ QT_DEPRECATED_VERSION_X_5_14("Use storeRelaxed") void store(T newValue) noexcept { storeRelaxed(newValue); }
+#endif
- T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
- void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
+ T loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
+ void storeRelaxed(T newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); }
- T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); }
- void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); }
- operator T() const Q_DECL_NOTHROW { return loadAcquire(); }
- T operator=(T newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; }
+ T loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); }
+ void storeRelease(T newValue) noexcept { Ops::storeRelease(_q_value, newValue); }
+ operator T() const noexcept { return loadAcquire(); }
+ T operator=(T newValue) noexcept { storeRelease(newValue); return newValue; }
- static Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return Ops::isReferenceCountingNative(); }
- static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return Ops::isReferenceCountingWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept { return Ops::isReferenceCountingNative(); }
+ static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept { return Ops::isReferenceCountingWaitFree(); }
- bool ref() Q_DECL_NOTHROW { return Ops::ref(_q_value); }
- bool deref() Q_DECL_NOTHROW { return Ops::deref(_q_value); }
+ bool ref() noexcept { return Ops::ref(_q_value); }
+ bool deref() noexcept { return Ops::deref(_q_value); }
- static Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return Ops::isTestAndSetNative(); }
- static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return Ops::isTestAndSetWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); }
- bool testAndSetRelaxed(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue); }
- bool testAndSetAcquire(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue); }
- bool testAndSetRelease(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue); }
- bool testAndSetOrdered(T expectedValue, T newValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T expectedValue, T newValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue); }
- bool testAndSetRelaxed(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetAcquire(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetRelease(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetOrdered(T expectedValue, T newValue, T &currentValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T expectedValue, T newValue, T &currentValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue, &currentValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return Ops::isFetchAndStoreNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndStoreWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); }
- T fetchAndStoreRelaxed(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelaxed(T newValue) noexcept
{ return Ops::fetchAndStoreRelaxed(_q_value, newValue); }
- T fetchAndStoreAcquire(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreAcquire(T newValue) noexcept
{ return Ops::fetchAndStoreAcquire(_q_value, newValue); }
- T fetchAndStoreRelease(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelease(T newValue) noexcept
{ return Ops::fetchAndStoreRelease(_q_value, newValue); }
- T fetchAndStoreOrdered(T newValue) Q_DECL_NOTHROW
+ T fetchAndStoreOrdered(T newValue) noexcept
{ return Ops::fetchAndStoreOrdered(_q_value, newValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return Ops::isFetchAndAddNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndAddWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); }
- T fetchAndAddRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndAddRelaxed(_q_value, valueToAdd); }
- T fetchAndAddAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndAddAcquire(_q_value, valueToAdd); }
- T fetchAndAddRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelease(T valueToAdd) noexcept
{ return Ops::fetchAndAddRelease(_q_value, valueToAdd); }
- T fetchAndAddOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndAddOrdered(_q_value, valueToAdd); }
- T fetchAndSubRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndSubRelaxed(_q_value, valueToAdd); }
- T fetchAndSubAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndSubAcquire(_q_value, valueToAdd); }
- T fetchAndSubRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubRelease(T valueToAdd) noexcept
{ return Ops::fetchAndSubRelease(_q_value, valueToAdd); }
- T fetchAndSubOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndSubOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndSubOrdered(_q_value, valueToAdd); }
- T fetchAndAndRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndAndRelaxed(_q_value, valueToAdd); }
- T fetchAndAndAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndAndAcquire(_q_value, valueToAdd); }
- T fetchAndAndRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndRelease(T valueToAdd) noexcept
{ return Ops::fetchAndAndRelease(_q_value, valueToAdd); }
- T fetchAndAndOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAndOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndAndOrdered(_q_value, valueToAdd); }
- T fetchAndOrRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndOrRelaxed(_q_value, valueToAdd); }
- T fetchAndOrAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndOrAcquire(_q_value, valueToAdd); }
- T fetchAndOrRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrRelease(T valueToAdd) noexcept
{ return Ops::fetchAndOrRelease(_q_value, valueToAdd); }
- T fetchAndOrOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndOrOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndOrOrdered(_q_value, valueToAdd); }
- T fetchAndXorRelaxed(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelaxed(T valueToAdd) noexcept
{ return Ops::fetchAndXorRelaxed(_q_value, valueToAdd); }
- T fetchAndXorAcquire(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorAcquire(T valueToAdd) noexcept
{ return Ops::fetchAndXorAcquire(_q_value, valueToAdd); }
- T fetchAndXorRelease(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorRelease(T valueToAdd) noexcept
{ return Ops::fetchAndXorRelease(_q_value, valueToAdd); }
- T fetchAndXorOrdered(T valueToAdd) Q_DECL_NOTHROW
+ T fetchAndXorOrdered(T valueToAdd) noexcept
{ return Ops::fetchAndXorOrdered(_q_value, valueToAdd); }
- T operator++() Q_DECL_NOTHROW
+ T operator++() noexcept
{ return fetchAndAddOrdered(1) + 1; }
- T operator++(int) Q_DECL_NOTHROW
+ T operator++(int) noexcept
{ return fetchAndAddOrdered(1); }
- T operator--() Q_DECL_NOTHROW
+ T operator--() noexcept
{ return fetchAndSubOrdered(1) - 1; }
- T operator--(int) Q_DECL_NOTHROW
+ T operator--(int) noexcept
{ return fetchAndSubOrdered(1); }
- T operator+=(T v) Q_DECL_NOTHROW
+ T operator+=(T v) noexcept
{ return fetchAndAddOrdered(v) + v; }
- T operator-=(T v) Q_DECL_NOTHROW
+ T operator-=(T v) noexcept
{ return fetchAndSubOrdered(v) - v; }
- T operator&=(T v) Q_DECL_NOTHROW
+ T operator&=(T v) noexcept
{ return fetchAndAndOrdered(v) & v; }
- T operator|=(T v) Q_DECL_NOTHROW
+ T operator|=(T v) noexcept
{ return fetchAndOrOrdered(v) | v; }
- T operator^=(T v) Q_DECL_NOTHROW
+ T operator^=(T v) noexcept
{ return fetchAndXorOrdered(v) ^ v; }
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
QBasicAtomicInteger() = default;
- constexpr QBasicAtomicInteger(T value) Q_DECL_NOTHROW : _q_value(value) {}
+ constexpr QBasicAtomicInteger(T value) noexcept : _q_value(value) {}
QBasicAtomicInteger(const QBasicAtomicInteger &) = delete;
QBasicAtomicInteger &operator=(const QBasicAtomicInteger &) = delete;
QBasicAtomicInteger &operator=(const QBasicAtomicInteger &) volatile = delete;
@@ -236,85 +240,91 @@ public:
AtomicType _q_value;
- Type load() const Q_DECL_NOTHROW { return Ops::load(_q_value); }
- void store(Type newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); }
- operator Type() const Q_DECL_NOTHROW { return loadAcquire(); }
- Type operator=(Type newValue) Q_DECL_NOTHROW { storeRelease(newValue); return newValue; }
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_VERSION_X_5_14("Use loadRelaxed") Type load() const noexcept { return loadRelaxed(); }
+ QT_DEPRECATED_VERSION_X_5_14("Use storeRelaxed") void store(Type newValue) noexcept { storeRelaxed(newValue); }
+#endif
+
+ Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
+ void storeRelaxed(Type newValue) noexcept { Ops::storeRelaxed(_q_value, newValue); }
+
+ operator Type() const noexcept { return loadAcquire(); }
+ Type operator=(Type newValue) noexcept { storeRelease(newValue); return newValue; }
// Atomic API, implemented in qatomic_XXX.h
- Type loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); }
- void storeRelease(Type newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); }
+ Type loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); }
+ void storeRelease(Type newValue) noexcept { Ops::storeRelease(_q_value, newValue); }
- static Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return Ops::isTestAndSetNative(); }
- static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return Ops::isTestAndSetWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept { return Ops::isTestAndSetNative(); }
+ static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept { return Ops::isTestAndSetWaitFree(); }
- bool testAndSetRelaxed(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue); }
- bool testAndSetAcquire(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue); }
- bool testAndSetRelease(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue); }
- bool testAndSetOrdered(Type expectedValue, Type newValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(Type expectedValue, Type newValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue); }
- bool testAndSetRelaxed(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelaxed(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetRelaxed(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetAcquire(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetAcquire(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetRelease(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetRelease(_q_value, expectedValue, newValue, &currentValue); }
- bool testAndSetOrdered(Type expectedValue, Type newValue, Type &currentValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(Type expectedValue, Type newValue, Type &currentValue) noexcept
{ return Ops::testAndSetOrdered(_q_value, expectedValue, newValue, &currentValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return Ops::isFetchAndStoreNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndStoreWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return Ops::isFetchAndStoreNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return Ops::isFetchAndStoreWaitFree(); }
- Type fetchAndStoreRelaxed(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreRelaxed(Type newValue) noexcept
{ return Ops::fetchAndStoreRelaxed(_q_value, newValue); }
- Type fetchAndStoreAcquire(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreAcquire(Type newValue) noexcept
{ return Ops::fetchAndStoreAcquire(_q_value, newValue); }
- Type fetchAndStoreRelease(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreRelease(Type newValue) noexcept
{ return Ops::fetchAndStoreRelease(_q_value, newValue); }
- Type fetchAndStoreOrdered(Type newValue) Q_DECL_NOTHROW
+ Type fetchAndStoreOrdered(Type newValue) noexcept
{ return Ops::fetchAndStoreOrdered(_q_value, newValue); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return Ops::isFetchAndAddNative(); }
- static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return Ops::isFetchAndAddWaitFree(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return Ops::isFetchAndAddNative(); }
+ static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return Ops::isFetchAndAddWaitFree(); }
- Type fetchAndAddRelaxed(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddRelaxed(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddRelaxed(_q_value, valueToAdd); }
- Type fetchAndAddAcquire(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddAcquire(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddAcquire(_q_value, valueToAdd); }
- Type fetchAndAddRelease(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddRelease(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddRelease(_q_value, valueToAdd); }
- Type fetchAndAddOrdered(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndAddOrdered(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndAddOrdered(_q_value, valueToAdd); }
- Type fetchAndSubRelaxed(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubRelaxed(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubRelaxed(_q_value, valueToAdd); }
- Type fetchAndSubAcquire(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubAcquire(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubAcquire(_q_value, valueToAdd); }
- Type fetchAndSubRelease(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubRelease(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubRelease(_q_value, valueToAdd); }
- Type fetchAndSubOrdered(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type fetchAndSubOrdered(qptrdiff valueToAdd) noexcept
{ return Ops::fetchAndSubOrdered(_q_value, valueToAdd); }
- Type operator++() Q_DECL_NOTHROW
+ Type operator++() noexcept
{ return fetchAndAddOrdered(1) + 1; }
- Type operator++(int) Q_DECL_NOTHROW
+ Type operator++(int) noexcept
{ return fetchAndAddOrdered(1); }
- Type operator--() Q_DECL_NOTHROW
+ Type operator--() noexcept
{ return fetchAndSubOrdered(1) - 1; }
- Type operator--(int) Q_DECL_NOTHROW
+ Type operator--(int) noexcept
{ return fetchAndSubOrdered(1); }
- Type operator+=(qptrdiff valueToAdd) Q_DECL_NOTHROW
+ Type operator+=(qptrdiff valueToAdd) noexcept
{ return fetchAndAddOrdered(valueToAdd) + valueToAdd; }
- Type operator-=(qptrdiff valueToSub) Q_DECL_NOTHROW
+ Type operator-=(qptrdiff valueToSub) noexcept
{ return fetchAndSubOrdered(valueToSub) - valueToSub; }
#ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
QBasicAtomicPointer() = default;
- constexpr QBasicAtomicPointer(Type value) Q_DECL_NOTHROW : _q_value(value) {}
+ constexpr QBasicAtomicPointer(Type value) noexcept : _q_value(value) {}
QBasicAtomicPointer(const QBasicAtomicPointer &) = delete;
QBasicAtomicPointer &operator=(const QBasicAtomicPointer &) = delete;
QBasicAtomicPointer &operator=(const QBasicAtomicPointer &) volatile = delete;
diff --git a/src/corelib/thread/qfutex_p.h b/src/corelib/thread/qfutex_p.h
index 483664c783..7bec4554b7 100644
--- a/src/corelib/thread/qfutex_p.h
+++ b/src/corelib/thread/qfutex_p.h
@@ -81,15 +81,43 @@ QT_END_NAMESPACE
// if not defined in linux/futex.h
# define FUTEX_PRIVATE_FLAG 128 // added in v2.6.22
+# if QT_HAS_FEATURE(thread_sanitizer) || defined(__SANITIZE_THREAD__)
+# include <sanitizer/tsan_interface.h>
+inline void _q_tsan_acquire(void *addr, void *addr2)
+{
+ __tsan_acquire(addr);
+ if (addr2)
+ __tsan_acquire(addr2);
+}
+inline void _q_tsan_release(void *addr, void *addr2)
+{
+ if (addr2)
+ __tsan_release(addr2);
+ __tsan_release(addr);
+}
+# else
+inline void _q_tsan_acquire(void *, void *) {}
+inline void _q_tsan_release(void *, void *) {}
+# endif // QT_HAS_FEATURE(thread_sanitizer) || defined(__SANITIZE_THREAD__)
+
QT_BEGIN_NAMESPACE
namespace QtLinuxFutex {
constexpr inline bool futexAvailable() { return true; }
inline int _q_futex(int *addr, int op, int val, quintptr val2 = 0,
- int *addr2 = nullptr, int val3 = 0) Q_DECL_NOTHROW
+ int *addr2 = nullptr, int val3 = 0) noexcept
{
+ // A futex call ensures total ordering on the futex words
+ // (in either success or failure of the call). Instruct TSAN accordingly,
+ // as TSAN does not understand the futex(2) syscall.
+ _q_tsan_release(addr, addr2);
+
// we use __NR_futex because some libcs (like Android's bionic) don't
// provide SYS_futex etc.
- return syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3);
+ int result = syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3);
+
+ _q_tsan_acquire(addr, addr2);
+
+ return result;
}
template <typename T> int *addr(T *ptr)
{
diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h
index a456dd9139..d3135510b3 100644
--- a/src/corelib/thread/qfuture.h
+++ b/src/corelib/thread/qfuture.h
@@ -111,33 +111,79 @@ public:
typedef const T &reference;
inline const_iterator() {}
- inline const_iterator(QFuture const * const _future, int _index) : future(_future), index(_index) {}
+ inline const_iterator(QFuture const * const _future, int _index)
+ : future(_future), index(advanceIndex(_index, 0)) { }
inline const_iterator(const const_iterator &o) : future(o.future), index(o.index) {}
inline const_iterator &operator=(const const_iterator &o)
{ future = o.future; index = o.index; return *this; }
inline const T &operator*() const { return future->d.resultReference(index); }
inline const T *operator->() const { return future->d.resultPointer(index); }
-
- inline bool operator!=(const const_iterator &other) const
+ inline bool operator!=(const const_iterator &other) const { return index != other.index; }
+ inline bool operator==(const const_iterator &o) const { return !operator!=(o); }
+ inline const_iterator &operator++()
+ { index = advanceIndex(index, 1); return *this; }
+ inline const_iterator &operator--()
+ { index = advanceIndex(index, -1); return *this; }
+ inline const_iterator operator++(int)
+ {
+ const_iterator r = *this;
+ index = advanceIndex(index, 1);
+ return r;
+ }
+ inline const_iterator operator--(int)
{
- if (index == -1 && other.index == -1) // comparing end != end?
- return false;
- if (other.index == -1)
- return (future->isRunning() || (index < future->resultCount()));
- return (index != other.index);
+ const_iterator r = *this;
+ index = advanceIndex(index, -1);
+ return r;
}
+ inline const_iterator operator+(int j) const
+ { return const_iterator(future, advanceIndex(index, j)); }
+ inline const_iterator operator-(int j) const
+ { return const_iterator(future, advanceIndex(index, -j)); }
+ inline const_iterator &operator+=(int j)
+ { index = advanceIndex(index, j); return *this; }
+ inline const_iterator &operator-=(int j)
+ { index = advanceIndex(index, -j); return *this; }
+ friend inline const_iterator operator+(int j, const_iterator k)
+ { return const_iterator(k.future, k.advanceIndex(k.index, j)); }
- inline bool operator==(const const_iterator &o) const { return !operator!=(o); }
- inline const_iterator &operator++() { ++index; return *this; }
- inline const_iterator operator++(int) { const_iterator r = *this; ++index; return r; }
- inline const_iterator &operator--() { --index; return *this; }
- inline const_iterator operator--(int) { const_iterator r = *this; --index; return r; }
- inline const_iterator operator+(int j) const { return const_iterator(future, index + j); }
- inline const_iterator operator-(int j) const { return const_iterator(future, index - j); }
- inline const_iterator &operator+=(int j) { index += j; return *this; }
- inline const_iterator &operator-=(int j) { index -= j; return *this; }
- friend inline const_iterator operator+(int j, const_iterator k) { return k + j; }
private:
+ /*! \internal
+
+ Advances the iterator index \a idx \a n steps, waits for the
+ result at the target index, and returns the target index.
+
+ The index may be -1, indicating the end iterator, either
+ as the argument or as the return value. The end iterator
+ may be decremented.
+
+ The caller is responsible for not advancing the iterator
+ before begin() or past end(), with the exception that
+ attempting to advance a non-end iterator past end() for
+ a running future is allowed and will return the end iterator.
+
+ Note that n == 0 is valid and will wait for the result
+ at the given index.
+ */
+ int advanceIndex(int idx, int n) const
+ {
+ // The end iterator can be decremented, leave as-is for other cases
+ if (idx == -1 && n >= 0)
+ return idx;
+
+ // Special case for decrementing the end iterator: wait for
+ // finished to get the total result count.
+ if (idx == -1 && future->isRunning())
+ future->d.waitForFinished();
+
+ // Wait for result at target index
+ const int targetIndex = (idx == -1) ? future->resultCount() + n : idx + n;
+ future->d.waitForResult(targetIndex);
+
+ // After waiting there is either a result or the end was reached
+ return (targetIndex < future->resultCount()) ? targetIndex : -1;
+ }
+
QFuture const * future;
int index;
};
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp
index dfbed5fb0f..6430f38a3b 100644
--- a/src/corelib/thread/qfutureinterface.cpp
+++ b/src/corelib/thread/qfutureinterface.cpp
@@ -97,7 +97,7 @@ static inline int switch_off(QAtomicInt &a, int which)
static inline int switch_from_to(QAtomicInt &a, int from, int to)
{
int newValue;
- int expected = a.load();
+ int expected = a.loadRelaxed();
do {
newValue = (expected & ~from) | to;
} while (!a.testAndSetRelaxed(expected, newValue, expected));
@@ -107,7 +107,7 @@ static inline int switch_from_to(QAtomicInt &a, int from, int to)
void QFutureInterfaceBase::cancel()
{
QMutexLocker locker(&d->m_mutex);
- if (d->state.load() & Canceled)
+ if (d->state.loadRelaxed() & Canceled)
return;
switch_from_to(d->state, Paused, Canceled);
@@ -132,7 +132,7 @@ void QFutureInterfaceBase::setPaused(bool paused)
void QFutureInterfaceBase::togglePaused()
{
QMutexLocker locker(&d->m_mutex);
- if (d->state.load() & Paused) {
+ if (d->state.loadRelaxed() & Paused) {
switch_off(d->state, Paused);
d->pausedWaitCondition.wakeAll();
d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed));
@@ -149,7 +149,7 @@ void QFutureInterfaceBase::setThrottled(bool enable)
switch_on(d->state, Throttled);
} else {
switch_off(d->state, Throttled);
- if (!(d->state.load() & Paused))
+ if (!(d->state.loadRelaxed() & Paused))
d->pausedWaitCondition.wakeAll();
}
}
@@ -201,13 +201,13 @@ void QFutureInterfaceBase::waitForResume()
{
// return early if possible to avoid taking the mutex lock.
{
- const int state = d->state.load();
+ const int state = d->state.loadRelaxed();
if (!(state & Paused) || (state & Canceled))
return;
}
QMutexLocker lock(&d->m_mutex);
- const int state = d->state.load();
+ const int state = d->state.loadRelaxed();
if (!(state & Paused) || (state & Canceled))
return;
@@ -256,7 +256,7 @@ bool QFutureInterfaceBase::isProgressUpdateNeeded() const
void QFutureInterfaceBase::reportStarted()
{
QMutexLocker locker(&d->m_mutex);
- if (d->state.load() & (Started|Canceled|Finished))
+ if (d->state.loadRelaxed() & (Started|Canceled|Finished))
return;
d->setState(State(Started | Running));
@@ -272,7 +272,7 @@ void QFutureInterfaceBase::reportCanceled()
void QFutureInterfaceBase::reportException(const QException &exception)
{
QMutexLocker locker(&d->m_mutex);
- if (d->state.load() & (Canceled|Finished))
+ if (d->state.loadRelaxed() & (Canceled|Finished))
return;
d->m_exceptionStore.setException(exception);
@@ -307,7 +307,7 @@ int QFutureInterfaceBase::expectedResultCount()
bool QFutureInterfaceBase::queryState(State state) const
{
- return d->state.load() & state;
+ return d->state.loadRelaxed() & state;
}
void QFutureInterfaceBase::waitForResult(int resultIndex)
@@ -352,7 +352,7 @@ void QFutureInterfaceBase::waitForFinished()
void QFutureInterfaceBase::reportResultsReady(int beginIndex, int endIndex)
{
- if (beginIndex == endIndex || (d->state.load() & (Canceled|Finished)))
+ if (beginIndex == endIndex || (d->state.loadRelaxed() & (Canceled|Finished)))
return;
d->waitCondition.wakeAll();
@@ -414,7 +414,7 @@ void QFutureInterfaceBase::setProgressValueAndText(int progressValue,
if (d->m_progressValue >= progressValue)
return;
- if (d->state.load() & (Canceled|Finished))
+ if (d->state.loadRelaxed() & (Canceled|Finished))
return;
if (d->internal_updateProgress(progressValue, progressText)) {
@@ -429,6 +429,11 @@ QMutex *QFutureInterfaceBase::mutex() const
return &d->m_mutex;
}
+QMutex &QFutureInterfaceBase::mutex(int) const
+{
+ return d->m_mutex;
+}
+
QtPrivate::ExceptionStore &QFutureInterfaceBase::exceptionStore()
{
return d->m_exceptionStore;
@@ -486,10 +491,10 @@ bool QFutureInterfaceBasePrivate::internal_waitForNextResult()
if (m_results.hasNextResult())
return true;
- while ((state.load() & QFutureInterfaceBase::Running) && m_results.hasNextResult() == false)
+ while ((state.loadRelaxed() & QFutureInterfaceBase::Running) && m_results.hasNextResult() == false)
waitCondition.wait(&m_mutex);
- return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
+ return !(state.loadRelaxed() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();
}
bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
@@ -512,8 +517,8 @@ bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress,
void QFutureInterfaceBasePrivate::internal_setThrottled(bool enable)
{
// bail out if we are not changing the state
- if ((enable && (state.load() & QFutureInterfaceBase::Throttled))
- || (!enable && !(state.load() & QFutureInterfaceBase::Throttled)))
+ if ((enable && (state.loadRelaxed() & QFutureInterfaceBase::Throttled))
+ || (!enable && !(state.loadRelaxed() & QFutureInterfaceBase::Throttled)))
return;
// change the state
@@ -521,7 +526,7 @@ void QFutureInterfaceBasePrivate::internal_setThrottled(bool enable)
switch_on(state, QFutureInterfaceBase::Throttled);
} else {
switch_off(state, QFutureInterfaceBase::Throttled);
- if (!(state.load() & QFutureInterfaceBase::Paused))
+ if (!(state.loadRelaxed() & QFutureInterfaceBase::Paused))
pausedWaitCondition.wakeAll();
}
}
@@ -556,7 +561,7 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
{
QMutexLocker locker(&m_mutex);
- if (state.load() & QFutureInterfaceBase::Started) {
+ if (state.loadRelaxed() & QFutureInterfaceBase::Started) {
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Started));
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange,
m_progressMinimum,
@@ -576,13 +581,13 @@ void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface
it.batchedAdvance();
}
- if (state.load() & QFutureInterfaceBase::Paused)
+ if (state.loadRelaxed() & QFutureInterfaceBase::Paused)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));
- if (state.load() & QFutureInterfaceBase::Canceled)
+ if (state.loadRelaxed() & QFutureInterfaceBase::Canceled)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));
- if (state.load() & QFutureInterfaceBase::Finished)
+ if (state.loadRelaxed() & QFutureInterfaceBase::Finished)
interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));
outputConnections.append(interface);
@@ -601,7 +606,7 @@ void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterf
void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState)
{
- state.store(newState);
+ state.storeRelaxed(newState);
}
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qfutureinterface.h b/src/corelib/thread/qfutureinterface.h
index d5e2401eee..bcdae24833 100644
--- a/src/corelib/thread/qfutureinterface.h
+++ b/src/corelib/thread/qfutureinterface.h
@@ -45,6 +45,8 @@
#include <QtCore/qexception.h>
#include <QtCore/qresultstore.h>
+#include <mutex>
+
QT_REQUIRE_CONFIG(future);
QT_BEGIN_NAMESPACE
@@ -118,6 +120,7 @@ public:
void waitForResume();
QMutex *mutex() const;
+ QMutex &mutex(int) const;
QtPrivate::ExceptionStore &exceptionStore();
QtPrivate::ResultStoreBase &resultStoreBase();
const QtPrivate::ResultStoreBase &resultStoreBase() const;
@@ -188,7 +191,7 @@ public:
template <typename T>
inline void QFutureInterface<T>::reportResult(const T *result, int index)
{
- QMutexLocker locker(mutex());
+ std::lock_guard<QMutex> locker(mutex(0));
if (this->queryState(Canceled) || this->queryState(Finished)) {
return;
}
@@ -214,7 +217,7 @@ inline void QFutureInterface<T>::reportResult(const T &result, int index)
template <typename T>
inline void QFutureInterface<T>::reportResults(const QVector<T> &_results, int beginIndex, int count)
{
- QMutexLocker locker(mutex());
+ std::lock_guard<QMutex> locker(mutex(0));
if (this->queryState(Canceled) || this->queryState(Finished)) {
return;
}
@@ -242,14 +245,14 @@ inline void QFutureInterface<T>::reportFinished(const T *result)
template <typename T>
inline const T &QFutureInterface<T>::resultReference(int index) const
{
- QMutexLocker lock(mutex());
+ std::lock_guard<QMutex> locker(mutex(0));
return resultStoreBase().resultAt(index).template value<T>();
}
template <typename T>
inline const T *QFutureInterface<T>::resultPointer(int index) const
{
- QMutexLocker lock(mutex());
+ std::lock_guard<QMutex> locker(mutex(0));
return resultStoreBase().resultAt(index).template pointer<T>();
}
@@ -263,7 +266,7 @@ inline QList<T> QFutureInterface<T>::results()
QFutureInterfaceBase::waitForResult(-1);
QList<T> res;
- QMutexLocker lock(mutex());
+ std::lock_guard<QMutex> locker(mutex(0));
QtPrivate::ResultIteratorBase it = resultStoreBase().begin();
while (it != resultStoreBase().end()) {
diff --git a/src/corelib/thread/qfutureinterface_p.h b/src/corelib/thread/qfutureinterface_p.h
index 63e534464f..b297dff633 100644
--- a/src/corelib/thread/qfutureinterface_p.h
+++ b/src/corelib/thread/qfutureinterface_p.h
@@ -144,11 +144,11 @@ public:
// Default ref counter for QFIBP
inline bool ref() { return m_refCount.ref(); }
inline bool deref() { return m_refCount.deref(); }
- inline int load() const { return m_refCount.load(); }
+ inline int load() const { return m_refCount.loadRelaxed(); }
// Ref counter for type T
inline bool refT() { return m_refCountT.ref(); }
inline bool derefT() { return m_refCountT.deref(); }
- inline int loadT() const { return m_refCountT.load(); }
+ inline int loadT() const { return m_refCountT.loadRelaxed(); }
private:
QAtomicInt m_refCount;
diff --git a/src/corelib/thread/qfuturewatcher.cpp b/src/corelib/thread/qfuturewatcher.cpp
index cf220bbd48..06bc4740f9 100644
--- a/src/corelib/thread/qfuturewatcher.cpp
+++ b/src/corelib/thread/qfuturewatcher.cpp
@@ -402,7 +402,7 @@ void QFutureWatcherBase::disconnectOutputInterface(bool pendingAssignment)
{
if (pendingAssignment) {
Q_D(QFutureWatcherBase);
- d->pendingResultsReady.store(0);
+ d->pendingResultsReady.storeRelaxed(0);
qDeleteAll(d->pendingCallOutEvents);
d->pendingCallOutEvents.clear();
d->finished = false; /* May soon be amended, during connectOutputInterface() */
@@ -441,7 +441,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
emit q->finished();
break;
case QFutureCallOutEvent::Canceled:
- pendingResultsReady.store(0);
+ pendingResultsReady.storeRelaxed(0);
emit q->canceled();
break;
case QFutureCallOutEvent::Paused:
@@ -466,7 +466,7 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
emit q->resultsReadyAt(beginIndex, endIndex);
- if (resultAtConnected.load() <= 0)
+ if (resultAtConnected.loadRelaxed() <= 0)
break;
for (int i = beginIndex; i < endIndex; ++i)
diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h
index 89c4fe9a11..e9e5f3c74b 100644
--- a/src/corelib/thread/qgenericatomic.h
+++ b/src/corelib/thread/qgenericatomic.h
@@ -72,32 +72,44 @@ template <typename BaseClass> struct QGenericAtomicOps
{
template <typename T> struct AtomicType { typedef T Type; typedef T *PointerType; };
- template <typename T> static void acquireMemoryFence(const T &_q_value) Q_DECL_NOTHROW
+ template <typename T> static void acquireMemoryFence(const T &_q_value) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
}
- template <typename T> static void releaseMemoryFence(const T &_q_value) Q_DECL_NOTHROW
+ template <typename T> static void releaseMemoryFence(const T &_q_value) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
}
- template <typename T> static void orderedMemoryFence(const T &) Q_DECL_NOTHROW
+ template <typename T> static void orderedMemoryFence(const T &) noexcept
{
}
template <typename T> static Q_ALWAYS_INLINE
- T load(const T &_q_value) Q_DECL_NOTHROW
+ T load(const T &_q_value) noexcept
{
return _q_value;
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- void store(T &_q_value, X newValue) Q_DECL_NOTHROW
+ void store(T &_q_value, X newValue) noexcept
{
_q_value = newValue;
}
template <typename T> static Q_ALWAYS_INLINE
- T loadAcquire(const T &_q_value) Q_DECL_NOTHROW
+ T loadRelaxed(const T &_q_value) noexcept
+ {
+ return _q_value;
+ }
+
+ template <typename T, typename X> static Q_ALWAYS_INLINE
+ void storeRelaxed(T &_q_value, X newValue) noexcept
+ {
+ _q_value = newValue;
+ }
+
+ template <typename T> static Q_ALWAYS_INLINE
+ T loadAcquire(const T &_q_value) noexcept
{
T tmp = *static_cast<const volatile T *>(&_q_value);
BaseClass::acquireMemoryFence(_q_value);
@@ -105,24 +117,24 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- void storeRelease(T &_q_value, X newValue) Q_DECL_NOTHROW
+ void storeRelease(T &_q_value, X newValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
*static_cast<volatile T *>(&_q_value) = newValue;
}
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept
{ return BaseClass::isFetchAndAddNative(); }
- static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW
+ static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept
{ return BaseClass::isFetchAndAddWaitFree(); }
template <typename T> static Q_ALWAYS_INLINE
- bool ref(T &_q_value) Q_DECL_NOTHROW
+ bool ref(T &_q_value) noexcept
{
return BaseClass::fetchAndAddRelaxed(_q_value, 1) != T(-1);
}
template <typename T> static Q_ALWAYS_INLINE
- bool deref(T &_q_value) Q_DECL_NOTHROW
+ bool deref(T &_q_value) noexcept
{
return BaseClass::fetchAndAddRelaxed(_q_value, -1) != 1;
}
@@ -130,16 +142,16 @@ template <typename BaseClass> struct QGenericAtomicOps
#if 0
// These functions have no default implementation
// Archictectures must implement them
- static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW;
- static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW;
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept;
+ static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept;
template <typename T, typename X> static inline
- bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW;
+ bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue) noexcept;
template <typename T, typename X> static inline
- bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW;
+ bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept;
#endif
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue) noexcept
{
bool tmp = BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
BaseClass::acquireMemoryFence(_q_value);
@@ -147,21 +159,21 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetRelease(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T &_q_value, X expectedValue, X newValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
+ bool testAndSetAcquire(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept
{
bool tmp = BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
BaseClass::acquireMemoryFence(_q_value);
@@ -169,35 +181,35 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetRelease(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
+ bool testAndSetRelease(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue, X *currentValue) Q_DECL_NOTHROW
+ bool testAndSetOrdered(T &_q_value, X expectedValue, X newValue, X *currentValue) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue);
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return false; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; }
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreRelaxed(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelaxed(T &_q_value, X newValue) noexcept
{
// implement fetchAndStore on top of testAndSet
Q_FOREVER {
- T tmp = load(_q_value);
+ T tmp = loadRelaxed(_q_value);
if (BaseClass::testAndSetRelaxed(_q_value, tmp, newValue))
return tmp;
}
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreAcquire(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreAcquire(T &_q_value, X newValue) noexcept
{
T tmp = BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
BaseClass::acquireMemoryFence(_q_value);
@@ -205,34 +217,34 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreRelease(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreRelease(T &_q_value, X newValue) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
}
template <typename T, typename X> static Q_ALWAYS_INLINE
- T fetchAndStoreOrdered(T &_q_value, X newValue) Q_DECL_NOTHROW
+ T fetchAndStoreOrdered(T &_q_value, X newValue) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndStoreRelaxed(_q_value, newValue);
}
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return false; }
- static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return false; }
+ static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; }
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
// implement fetchAndAdd on top of testAndSet
Q_FOREVER {
- T tmp = BaseClass::load(_q_value);
+ T tmp = BaseClass::loadRelaxed(_q_value);
if (BaseClass::testAndSetRelaxed(_q_value, tmp, T(tmp + valueToAdd)))
return tmp;
}
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
T tmp = BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
BaseClass::acquireMemoryFence(_q_value);
@@ -240,14 +252,14 @@ template <typename BaseClass> struct QGenericAtomicOps
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAddOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW
+ T fetchAndAddOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndAddRelaxed(_q_value, valueToAdd);
@@ -256,7 +268,7 @@ template <typename BaseClass> struct QGenericAtomicOps
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4146) // unary minus operator applied to unsigned type, result still unsigned
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
// implement fetchAndSub on top of fetchAndAdd
return fetchAndAddRelaxed(_q_value, -operand);
@@ -264,7 +276,7 @@ QT_WARNING_DISABLE_MSVC(4146) // unary minus operator applied to unsigned type
QT_WARNING_POP
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubAcquire(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
T tmp = BaseClass::fetchAndSubRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -272,24 +284,24 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubRelease(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndSubRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndSubOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) Q_DECL_NOTHROW
+ T fetchAndSubOrdered(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndSubRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
// implement fetchAndAnd on top of testAndSet
- T tmp = BaseClass::load(_q_value);
+ T tmp = BaseClass::loadRelaxed(_q_value);
Q_FOREVER {
if (BaseClass::testAndSetRelaxed(_q_value, tmp, T(tmp & operand), &tmp))
return tmp;
@@ -297,7 +309,7 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
T tmp = BaseClass::fetchAndAndRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -305,24 +317,24 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndAndRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndAndOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndAndOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndAndRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
// implement fetchAndOr on top of testAndSet
- T tmp = BaseClass::load(_q_value);
+ T tmp = BaseClass::loadRelaxed(_q_value);
Q_FOREVER {
if (BaseClass::testAndSetRelaxed(_q_value, tmp, T(tmp | operand), &tmp))
return tmp;
@@ -330,7 +342,7 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
T tmp = BaseClass::fetchAndOrRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -338,24 +350,24 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndOrRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndOrOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndOrOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndOrRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorRelaxed(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
// implement fetchAndXor on top of testAndSet
- T tmp = BaseClass::load(_q_value);
+ T tmp = BaseClass::loadRelaxed(_q_value);
Q_FOREVER {
if (BaseClass::testAndSetRelaxed(_q_value, tmp, T(tmp ^ operand), &tmp))
return tmp;
@@ -363,7 +375,7 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorAcquire(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
T tmp = BaseClass::fetchAndXorRelaxed(_q_value, operand);
BaseClass::acquireMemoryFence(_q_value);
@@ -371,14 +383,14 @@ QT_WARNING_POP
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorRelease(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::releaseMemoryFence(_q_value);
return BaseClass::fetchAndXorRelaxed(_q_value, operand);
}
template <typename T> static Q_ALWAYS_INLINE
- T fetchAndXorOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) Q_DECL_NOTHROW
+ T fetchAndXorOrdered(T &_q_value, typename std::enable_if<QTypeInfo<T>::isIntegral, T>::type operand) noexcept
{
BaseClass::orderedMemoryFence(_q_value);
return BaseClass::fetchAndXorRelaxed(_q_value, operand);
diff --git a/src/corelib/thread/qlocking_p.h b/src/corelib/thread/qlocking_p.h
new file mode 100644
index 0000000000..9a796cf7f7
--- /dev/null
+++ b/src/corelib/thread/qlocking_p.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QLOCKING_P_H
+#define QLOCKING_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qmutex.cpp, qmutex_unix.cpp, and qmutex_win.cpp. This header
+// file may change from version to version without notice, or even be
+// removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qmutex.h>
+
+#include <mutex>
+
+QT_BEGIN_NAMESPACE
+
+//
+// This API is bridging the time until we can depend on C++17:
+//
+// - qt_scoped_lock returns a lock that cannot be unlocked again before the end of the scope
+// - qt_unique_lock returns a lock that can be unlock()ed and moved around
+// - for compat with QMutexLocker, qt_unique_lock supports passing by pointer.
+// Do NOT use this overload lightly; it's only for cases such as where a Q_GLOBAL_STATIC
+// may have already been deleted. In particular, do NOT port from
+// QMutexLocker locker(&mutex);
+// to
+// auto locker = qt_unique_lock(&mutex);
+// as this will not port automatically to std::unique_lock come C++17!
+//
+// The intent, come C++17, is to replace
+// qt_scoped_lock(mutex);
+// qt_unique_lock(mutex); // except qt_unique_lock(&mutex)
+// with
+// std::scoped_lock(mutex);
+// std::unique_lock(mutex);
+// resp. (C++17 meaning CTAD, guaranteed copy elision + scoped_lock available on all platforms),
+// so please use these functions only in ways which don't break this mechanical search & replace.
+//
+
+namespace {
+
+template <typename Mutex, typename Lock =
+#if defined(__cpp_guaranteed_copy_elision) && __cpp_guaranteed_copy_elision >= 201606L
+# if defined(__cpp_lib_scoped_lock) && __cpp_lib_scoped_lock >= 201703L
+ std::scoped_lock
+# else
+ std::lock_guard
+# endif
+#else
+ std::unique_lock
+#endif
+ <typename std::decay<Mutex>::type>
+>
+Lock qt_scoped_lock(Mutex &mutex)
+{
+ return Lock(mutex);
+}
+
+template <typename Mutex, typename Lock = std::unique_lock<typename std::decay<Mutex>::type>>
+Lock qt_unique_lock(Mutex &mutex)
+{
+ return Lock(mutex);
+}
+
+template <typename Mutex, typename Lock = std::unique_lock<typename std::decay<Mutex>::type>>
+Lock qt_unique_lock(Mutex *mutex)
+{
+ return mutex ? Lock(*mutex) : Lock() ;
+}
+
+} // unnamed namespace
+
+QT_END_NAMESPACE
+
+#endif // QLOCKING_P_H
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 3881ac017e..9e52f286ee 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -82,7 +82,7 @@ public:
QMutex mutex;
bool lock(int timeout) QT_MUTEX_LOCK_NOEXCEPT;
- void unlock() Q_DECL_NOTHROW;
+ void unlock() noexcept;
};
/*
@@ -147,7 +147,7 @@ public:
It is constructed and destroyed with almost no overhead,
which means it is fine to have many mutexes as part of other classes.
- \sa QMutexLocker, QReadWriteLock, QSemaphore, QWaitCondition
+ \sa QRecursiveMutex, QMutexLocker, QReadWriteLock, QSemaphore, QWaitCondition
*/
/*!
@@ -156,12 +156,19 @@ public:
\value Recursive In this mode, a thread can lock the same mutex
multiple times and the mutex won't be unlocked
until a corresponding number of unlock() calls
- have been made.
+ have been made. You should use QRecursiveMutex
+ for this use-case.
\value NonRecursive In this mode, a thread may only lock a mutex
once.
- \sa QMutex()
+ \sa QMutex(), QRecursiveMutex
+*/
+
+/*!
+ \fn QMutex::QMutex()
+
+ Constructs a new mutex. The mutex is created in an unlocked state.
*/
/*!
@@ -179,7 +186,7 @@ public:
*/
QMutex::QMutex(RecursionMode mode)
{
- d_ptr.store(mode == Recursive ? new QRecursiveMutexPrivate : 0);
+ d_ptr.storeRelaxed(mode == Recursive ? new QRecursiveMutexPrivate : 0);
}
/*!
@@ -189,12 +196,12 @@ QMutex::QMutex(RecursionMode mode)
*/
QMutex::~QMutex()
{
- QMutexData *d = d_ptr.load();
+ QMutexData *d = d_ptr.loadRelaxed();
if (isRecursive()) {
delete static_cast<QRecursiveMutexPrivate *>(d);
} else if (d) {
#ifndef QT_LINUX_FUTEX
- if (d != dummyLocked() && static_cast<QMutexPrivate *>(d)->possiblyUnlocked.load()
+ if (d != dummyLocked() && static_cast<QMutexPrivate *>(d)->possiblyUnlocked.loadRelaxed()
&& tryLock()) {
unlock();
return;
@@ -205,13 +212,15 @@ QMutex::~QMutex()
}
/*! \fn void QMutex::lock()
+ \fn QRecursiveMutex::lock()
+
Locks the mutex. If another thread has locked the mutex then this
call will block until that thread has unlocked it.
Calling this function multiple times on the same mutex from the
same thread is allowed if this mutex is a
- \l{QMutex::Recursive}{recursive mutex}. If this mutex is a
- \l{QMutex::NonRecursive}{non-recursive mutex}, this function will
+ \l{QRecursiveMutex}{recursive mutex}. If this mutex is a
+ \l{QMutex}{non-recursive mutex}, this function will
\e dead-lock when the mutex is locked recursively.
\sa unlock()
@@ -228,6 +237,7 @@ void QMutex::lock() QT_MUTEX_LOCK_NOEXCEPT
}
/*! \fn bool QMutex::tryLock(int timeout)
+ \fn bool QRecursiveMutex::tryLock(int timeout)
Attempts to lock the mutex. This function returns \c true if the lock
was obtained; otherwise it returns \c false. If another thread has
@@ -243,8 +253,8 @@ void QMutex::lock() QT_MUTEX_LOCK_NOEXCEPT
Calling this function multiple times on the same mutex from the
same thread is allowed if this mutex is a
- \l{QMutex::Recursive}{recursive mutex}. If this mutex is a
- \l{QMutex::NonRecursive}{non-recursive mutex}, this function will
+ \l{QRecursiveMutex}{recursive mutex}. If this mutex is a
+ \l{QMutex}{non-recursive mutex}, this function will
\e always return false when attempting to lock the mutex
recursively.
@@ -262,6 +272,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
}
/*! \fn bool QMutex::try_lock()
+ \fn bool QRecursiveMutex::try_lock()
\since 5.8
Attempts to lock the mutex. This function returns \c true if the lock
@@ -275,6 +286,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
*/
/*! \fn template <class Rep, class Period> bool QMutex::try_lock_for(std::chrono::duration<Rep, Period> duration)
+ \fn template <class Rep, class Period> bool QRecursiveMutex::try_lock_for(std::chrono::duration<Rep, Period> duration)
\since 5.8
Attempts to lock the mutex. This function returns \c true if the lock
@@ -290,8 +302,8 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
Calling this function multiple times on the same mutex from the
same thread is allowed if this mutex is a
- \l{QMutex::Recursive}{recursive mutex}. If this mutex is a
- \l{QMutex::NonRecursive}{non-recursive mutex}, this function will
+ \l{QRecursiveMutex}{recursive mutex}. If this mutex is a
+ \l{QMutex}{non-recursive mutex}, this function will
\e always return false when attempting to lock the mutex
recursively.
@@ -299,6 +311,7 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
*/
/*! \fn template<class Clock, class Duration> bool QMutex::try_lock_until(std::chrono::time_point<Clock, Duration> timePoint)
+ \fn template<class Clock, class Duration> bool QRecursiveMutex::try_lock_until(std::chrono::time_point<Clock, Duration> timePoint)
\since 5.8
Attempts to lock the mutex. This function returns \c true if the lock
@@ -314,8 +327,8 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
Calling this function multiple times on the same mutex from the
same thread is allowed if this mutex is a
- \l{QMutex::Recursive}{recursive mutex}. If this mutex is a
- \l{QMutex::NonRecursive}{non-recursive mutex}, this function will
+ \l{QRecursiveMutex}{recursive mutex}. If this mutex is a
+ \l{QMutex}{non-recursive mutex}, this function will
\e always return false when attempting to lock the mutex
recursively.
@@ -323,13 +336,15 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
*/
/*! \fn void QMutex::unlock()
+ \fn void QRecursiveMutex::unlock()
+
Unlocks the mutex. Attempting to unlock a mutex in a different
thread to the one that locked it results in an error. Unlocking a
mutex that is not locked results in undefined behavior.
\sa lock()
*/
-void QMutex::unlock() Q_DECL_NOTHROW
+void QMutex::unlock() noexcept
{
QMutexData *current;
if (fastTryUnlock(current))
@@ -348,7 +363,7 @@ void QMutex::unlock() Q_DECL_NOTHROW
Returns \c true if the mutex is recursive.
*/
-bool QBasicMutex::isRecursive() Q_DECL_NOTHROW
+bool QBasicMutex::isRecursive() noexcept
{
return QT_PREPEND_NAMESPACE(isRecursive)(d_ptr.loadAcquire());
}
@@ -358,12 +373,64 @@ bool QBasicMutex::isRecursive() Q_DECL_NOTHROW
Returns \c true if the mutex is recursive.
*/
-bool QBasicMutex::isRecursive() const Q_DECL_NOTHROW
+bool QBasicMutex::isRecursive() const noexcept
{
return QT_PREPEND_NAMESPACE(isRecursive)(d_ptr.loadAcquire());
}
/*!
+ \class QRecursiveMutex
+ \inmodule QtCore
+ \since 5.14
+ \brief The QRecursiveMutex class provides access serialization between threads.
+
+ \threadsafe
+
+ \ingroup thread
+
+ The QRecursiveMutex class is a mutex, like QMutex, with which it is
+ API-compatible. It differs from QMutex by accepting lock() calls from
+ the same thread any number of times. QMutex would deadlock in this situation.
+
+ QRecursiveMutex is much more expensive to construct and operate on, so
+ use a plain QMutex whenever you can. Sometimes, one public function,
+ however, calls another public function, and they both need to lock the
+ same mutex. In this case, you have two options:
+
+ \list
+ \li Factor the code that needs mutex protection into private functions,
+ which assume that the mutex is held when they are called, and lock a
+ plain QMutex in the public functions before you call the private
+ implementation ones.
+ \li Or use a recursive mutex, so it doesn't matter that the first public
+ function has already locked the mutex when the second one wishes to do so.
+ \endlist
+
+ \sa QMutex, QMutexLocker, QReadWriteLock, QSemaphore, QWaitCondition
+*/
+
+/*!
+ Constructs a new recursive mutex. The mutex is created in an unlocked state.
+
+ \sa lock(), unlock()
+*/
+QRecursiveMutex::QRecursiveMutex()
+ : QMutex()
+{
+ d_ptr.storeRelaxed(new QRecursiveMutexPrivate);
+}
+
+/*!
+ Destroys the mutex.
+
+ \warning Destroying a locked mutex may result in undefined behavior.
+*/
+QRecursiveMutex::~QRecursiveMutex()
+{
+ delete static_cast<QRecursiveMutexPrivate*>(d_ptr.fetchAndStoreAcquire(nullptr));
+}
+
+/*!
\class QMutexLocker
\inmodule QtCore
\brief The QMutexLocker class is a convenience class that simplifies
@@ -427,6 +494,17 @@ bool QBasicMutex::isRecursive() const Q_DECL_NOTHROW
*/
/*!
+ \fn QMutexLocker::QMutexLocker(QRecursiveMutex *mutex)
+ \since 5.14
+
+ Constructs a QMutexLocker and locks \a mutex. The mutex will be
+ unlocked (unlock() called) when the QMutexLocker is destroyed.
+ If \a mutex is \nullptr, QMutexLocker does nothing.
+
+ \sa QMutex::lock()
+*/
+
+/*!
\fn QMutexLocker::~QMutexLocker()
Destroys the QMutexLocker and unlocks the mutex that was locked
@@ -517,7 +595,7 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
}
QMutexPrivate *d = static_cast<QMutexPrivate *>(copy);
- if (timeout == 0 && !d->possiblyUnlocked.load())
+ if (timeout == 0 && !d->possiblyUnlocked.loadRelaxed())
return false;
// At this point we have a pointer to a QMutexPrivate. But the other thread
@@ -541,7 +619,7 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
// is set to the BigNumber magic value set in unlockInternal()
int old_waiters;
do {
- old_waiters = d->waiters.load();
+ old_waiters = d->waiters.loadRelaxed();
if (old_waiters == -QMutexPrivate::BigNumber) {
// we are unlocking, and the thread that unlocks is about to change d to 0
// we try to acquire the mutex by changing to dummyLocked()
@@ -550,7 +628,7 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
d->deref();
return true;
} else {
- Q_ASSERT(d != d_ptr.load()); //else testAndSetAcquire should have succeeded
+ Q_ASSERT(d != d_ptr.loadRelaxed()); //else testAndSetAcquire should have succeeded
// Mutex is likely to bo 0, we should continue the outer-loop,
// set old_waiters to the magic value of BigNumber
old_waiters = QMutexPrivate::BigNumber;
@@ -563,7 +641,7 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
// The mutex was unlocked before we incremented waiters.
if (old_waiters != QMutexPrivate::BigNumber) {
//we did not break the previous loop
- Q_ASSERT(d->waiters.load() >= 1);
+ Q_ASSERT(d->waiters.loadRelaxed() >= 1);
d->waiters.deref();
}
d->deref();
@@ -572,11 +650,11 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
if (d->wait(timeout)) {
// reset the possiblyUnlocked flag if needed (and deref its corresponding reference)
- if (d->possiblyUnlocked.load() && d->possiblyUnlocked.testAndSetRelaxed(true, false))
+ if (d->possiblyUnlocked.loadRelaxed() && d->possiblyUnlocked.testAndSetRelaxed(true, false))
d->deref();
d->derefWaiters(1);
//we got the lock. (do not deref)
- Q_ASSERT(d == d_ptr.load());
+ Q_ASSERT(d == d_ptr.loadRelaxed());
return true;
} else {
Q_ASSERT(timeout >= 0);
@@ -593,14 +671,14 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT
return false;
}
}
- Q_ASSERT(d_ptr.load() != 0);
+ Q_ASSERT(d_ptr.loadRelaxed() != 0);
return true;
}
/*!
\internal
*/
-void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
+void QBasicMutex::unlockInternal() noexcept
{
QMutexData *copy = d_ptr.loadAcquire();
Q_ASSERT(copy); //we must be locked
@@ -618,7 +696,7 @@ void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
//there is no one waiting on this mutex anymore, set the mutex as unlocked (d = 0)
if (d_ptr.testAndSetRelease(d, 0)) {
// reset the possiblyUnlocked flag if needed (and deref its corresponding reference)
- if (d->possiblyUnlocked.load() && d->possiblyUnlocked.testAndSetRelaxed(true, false))
+ if (d->possiblyUnlocked.loadRelaxed() && d->possiblyUnlocked.testAndSetRelaxed(true, false))
d->deref();
}
d->derefWaiters(0);
@@ -657,30 +735,30 @@ QMutexPrivate *QMutexPrivate::allocate()
int i = freelist()->next();
QMutexPrivate *d = &(*freelist())[i];
d->id = i;
- Q_ASSERT(d->refCount.load() == 0);
+ Q_ASSERT(d->refCount.loadRelaxed() == 0);
Q_ASSERT(!d->recursive);
- Q_ASSERT(!d->possiblyUnlocked.load());
- Q_ASSERT(d->waiters.load() == 0);
- d->refCount.store(1);
+ Q_ASSERT(!d->possiblyUnlocked.loadRelaxed());
+ Q_ASSERT(d->waiters.loadRelaxed() == 0);
+ d->refCount.storeRelaxed(1);
return d;
}
void QMutexPrivate::release()
{
Q_ASSERT(!recursive);
- Q_ASSERT(refCount.load() == 0);
- Q_ASSERT(!possiblyUnlocked.load());
- Q_ASSERT(waiters.load() == 0);
+ Q_ASSERT(refCount.loadRelaxed() == 0);
+ Q_ASSERT(!possiblyUnlocked.loadRelaxed());
+ Q_ASSERT(waiters.loadRelaxed() == 0);
freelist()->release(id);
}
// atomically subtract "value" to the waiters, and remove the QMutexPrivate::BigNumber flag
-void QMutexPrivate::derefWaiters(int value) Q_DECL_NOTHROW
+void QMutexPrivate::derefWaiters(int value) noexcept
{
int old_waiters;
int new_waiters;
do {
- old_waiters = waiters.load();
+ old_waiters = waiters.loadRelaxed();
new_waiters = old_waiters;
if (new_waiters < 0) {
new_waiters += QMutexPrivate::BigNumber;
@@ -696,7 +774,7 @@ void QMutexPrivate::derefWaiters(int value) Q_DECL_NOTHROW
inline bool QRecursiveMutexPrivate::lock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
{
Qt::HANDLE self = QThread::currentThreadId();
- if (owner.load() == self) {
+ if (owner.loadRelaxed() == self) {
++count;
Q_ASSERT_X(count != 0, "QMutex::lock", "Overflow in recursion counter");
return true;
@@ -709,19 +787,19 @@ inline bool QRecursiveMutexPrivate::lock(int timeout) QT_MUTEX_LOCK_NOEXCEPT
}
if (success)
- owner.store(self);
+ owner.storeRelaxed(self);
return success;
}
/*!
\internal
*/
-inline void QRecursiveMutexPrivate::unlock() Q_DECL_NOTHROW
+inline void QRecursiveMutexPrivate::unlock() noexcept
{
if (count > 0) {
count--;
} else {
- owner.store(0);
+ owner.storeRelaxed(0);
mutex.QBasicMutex::unlock();
}
}
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index 837355a602..c693ff65d8 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -57,11 +57,13 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(thread) || defined(Q_CLANG_QDOC)
#ifdef Q_OS_LINUX
-# define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW
+# define QT_MUTEX_LOCK_NOEXCEPT noexcept
#else
# define QT_MUTEX_LOCK_NOEXCEPT
#endif
+class QMutex;
+class QRecursiveMutex;
class QMutexData;
class Q_CORE_EXPORT QBasicMutex
@@ -80,39 +82,39 @@ public:
}
// BasicLockable concept
- inline void unlock() Q_DECL_NOTHROW {
- Q_ASSERT(d_ptr.load()); //mutex must be locked
+ inline void unlock() noexcept {
+ Q_ASSERT(d_ptr.loadRelaxed()); //mutex must be locked
if (!fastTryUnlock())
unlockInternal();
}
- bool tryLock() Q_DECL_NOTHROW {
+ bool tryLock() noexcept {
return fastTryLock();
}
// Lockable concept
- bool try_lock() Q_DECL_NOTHROW { return tryLock(); }
+ bool try_lock() noexcept { return tryLock(); }
- bool isRecursive() Q_DECL_NOTHROW; //### Qt6: remove me
- bool isRecursive() const Q_DECL_NOTHROW;
+ bool isRecursive() noexcept; //### Qt6: remove me
+ bool isRecursive() const noexcept;
private:
- inline bool fastTryLock() Q_DECL_NOTHROW {
+ inline bool fastTryLock() noexcept {
return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
}
- inline bool fastTryUnlock() Q_DECL_NOTHROW {
+ inline bool fastTryUnlock() noexcept {
return d_ptr.testAndSetRelease(dummyLocked(), nullptr);
}
- inline bool fastTryLock(QMutexData *&current) Q_DECL_NOTHROW {
+ inline bool fastTryLock(QMutexData *&current) noexcept {
return d_ptr.testAndSetAcquire(nullptr, dummyLocked(), current);
}
- inline bool fastTryUnlock(QMutexData *&current) Q_DECL_NOTHROW {
+ inline bool fastTryUnlock(QMutexData *&current) noexcept {
return d_ptr.testAndSetRelease(dummyLocked(), nullptr, current);
}
void lockInternal() QT_MUTEX_LOCK_NOEXCEPT;
bool lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT;
- void unlockInternal() Q_DECL_NOTHROW;
+ void unlockInternal() noexcept;
QBasicAtomicPointer<QMutexData> d_ptr;
static inline QMutexData *dummyLocked() {
@@ -120,21 +122,27 @@ private:
}
friend class QMutex;
+ friend class QRecursiveMutex;
friend class QMutexData;
};
class Q_CORE_EXPORT QMutex : public QBasicMutex
{
public:
+#if defined(Q_COMPILER_CONSTEXPR)
+ constexpr QMutex() = default;
+#else
+ QMutex() { d_ptr.storeRelaxed(nullptr); }
+#endif
enum RecursionMode { NonRecursive, Recursive };
- explicit QMutex(RecursionMode mode = NonRecursive);
+ explicit QMutex(RecursionMode mode);
~QMutex();
// BasicLockable concept
void lock() QT_MUTEX_LOCK_NOEXCEPT;
bool tryLock(int timeout = 0) QT_MUTEX_LOCK_NOEXCEPT;
// BasicLockable concept
- void unlock() Q_DECL_NOTHROW;
+ void unlock() noexcept;
// Lockable concept
bool try_lock() QT_MUTEX_LOCK_NOEXCEPT { return tryLock(); }
@@ -158,12 +166,13 @@ public:
}
#endif
- bool isRecursive() const Q_DECL_NOTHROW
+ bool isRecursive() const noexcept
{ return QBasicMutex::isRecursive(); }
private:
Q_DISABLE_COPY(QMutex)
friend class QMutexLocker;
+ friend class QRecursiveMutex;
friend class ::tst_QMutex;
#if QT_HAS_INCLUDE(<chrono>)
@@ -192,6 +201,24 @@ private:
#endif
};
+class QRecursiveMutex : private QMutex
+{
+ // ### Qt 6: make it independent of QMutex
+ friend class QMutexLocker;
+public:
+ Q_CORE_EXPORT QRecursiveMutex();
+ Q_CORE_EXPORT ~QRecursiveMutex();
+
+ using QMutex::lock;
+ using QMutex::tryLock;
+ using QMutex::unlock;
+ using QMutex::try_lock;
+#if QT_HAS_INCLUDE(<chrono>)
+ using QMutex::try_lock_for;
+ using QMutex::try_lock_until;
+#endif
+};
+
class Q_CORE_EXPORT QMutexLocker
{
public:
@@ -207,12 +234,15 @@ public:
val |= 1;
}
}
+ explicit QMutexLocker(QRecursiveMutex *m) QT_MUTEX_LOCK_NOEXCEPT
+ : QMutexLocker{static_cast<QBasicMutex*>(m)} {}
#else
QMutexLocker(QMutex *) { }
+ QMutexLocker(QRecursiveMutex *) {}
#endif
inline ~QMutexLocker() { unlock(); }
- inline void unlock() Q_DECL_NOTHROW
+ inline void unlock() noexcept
{
if ((val & quintptr(1u)) == quintptr(1u)) {
val &= ~quintptr(1u);
@@ -257,24 +287,24 @@ class Q_CORE_EXPORT QMutex
public:
enum RecursionMode { NonRecursive, Recursive };
- inline Q_DECL_CONSTEXPR explicit QMutex(RecursionMode = NonRecursive) Q_DECL_NOTHROW { }
+ inline Q_DECL_CONSTEXPR explicit QMutex(RecursionMode = NonRecursive) noexcept { }
- inline void lock() Q_DECL_NOTHROW {}
- inline bool tryLock(int timeout = 0) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
- inline bool try_lock() Q_DECL_NOTHROW { return true; }
- inline void unlock() Q_DECL_NOTHROW {}
- inline bool isRecursive() const Q_DECL_NOTHROW { return true; }
+ inline void lock() noexcept {}
+ inline bool tryLock(int timeout = 0) noexcept { Q_UNUSED(timeout); return true; }
+ inline bool try_lock() noexcept { return true; }
+ inline void unlock() noexcept {}
+ inline bool isRecursive() const noexcept { return true; }
#if QT_HAS_INCLUDE(<chrono>)
template <class Rep, class Period>
- inline bool try_lock_for(std::chrono::duration<Rep, Period> duration) Q_DECL_NOTHROW
+ inline bool try_lock_for(std::chrono::duration<Rep, Period> duration) noexcept
{
Q_UNUSED(duration);
return true;
}
template<class Clock, class Duration>
- inline bool try_lock_until(std::chrono::time_point<Clock, Duration> timePoint) Q_DECL_NOTHROW
+ inline bool try_lock_until(std::chrono::time_point<Clock, Duration> timePoint) noexcept
{
Q_UNUSED(timePoint);
return true;
@@ -285,15 +315,17 @@ private:
Q_DISABLE_COPY(QMutex)
};
+class QRecursiveMutex : public QMutex {};
+
class Q_CORE_EXPORT QMutexLocker
{
public:
- inline explicit QMutexLocker(QMutex *) Q_DECL_NOTHROW {}
- inline ~QMutexLocker() Q_DECL_NOTHROW {}
+ inline explicit QMutexLocker(QMutex *) noexcept {}
+ inline ~QMutexLocker() noexcept {}
- inline void unlock() Q_DECL_NOTHROW {}
- void relock() Q_DECL_NOTHROW {}
- inline QMutex *mutex() const Q_DECL_NOTHROW { return nullptr; }
+ inline void unlock() noexcept {}
+ void relock() noexcept {}
+ inline QMutex *mutex() const noexcept { return nullptr; }
private:
Q_DISABLE_COPY(QMutexLocker)
diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp
index 507e72cb76..3270875471 100644
--- a/src/corelib/thread/qmutex_linux.cpp
+++ b/src/corelib/thread/qmutex_linux.cpp
@@ -106,7 +106,7 @@ static inline QMutexData *dummyFutexValue()
}
template <bool IsTimed> static inline
-bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -1, QElapsedTimer *elapsedTimer = 0) Q_DECL_NOTHROW
+bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -1, QElapsedTimer *elapsedTimer = 0) noexcept
{
if (!IsTimed)
timeout = -1;
@@ -149,17 +149,17 @@ bool lockInternal_helper(QBasicAtomicPointer<QMutexData> &d_ptr, int timeout = -
}
}
- Q_ASSERT(d_ptr.load());
+ Q_ASSERT(d_ptr.loadRelaxed());
return true;
}
-void QBasicMutex::lockInternal() Q_DECL_NOTHROW
+void QBasicMutex::lockInternal() noexcept
{
Q_ASSERT(!isRecursive());
lockInternal_helper<false>(d_ptr);
}
-bool QBasicMutex::lockInternal(int timeout) Q_DECL_NOTHROW
+bool QBasicMutex::lockInternal(int timeout) noexcept
{
Q_ASSERT(!isRecursive());
QElapsedTimer elapsedTimer;
@@ -167,9 +167,9 @@ bool QBasicMutex::lockInternal(int timeout) Q_DECL_NOTHROW
return lockInternal_helper<true>(d_ptr, timeout, &elapsedTimer);
}
-void QBasicMutex::unlockInternal() Q_DECL_NOTHROW
+void QBasicMutex::unlockInternal() noexcept
{
- QMutexData *d = d_ptr.load();
+ QMutexData *d = d_ptr.loadRelaxed();
Q_ASSERT(d); //we must be locked
Q_ASSERT(d != dummyLocked()); // testAndSetRelease(dummyLocked(), 0) failed
Q_UNUSED(d);
diff --git a/src/corelib/thread/qmutex_mac.cpp b/src/corelib/thread/qmutex_mac.cpp
index 9a8d9bc750..923f89f697 100644
--- a/src/corelib/thread/qmutex_mac.cpp
+++ b/src/corelib/thread/qmutex_mac.cpp
@@ -79,7 +79,7 @@ bool QMutexPrivate::wait(int timeout)
return (r == KERN_SUCCESS);
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{
semaphore_signal(mach_semaphore);
}
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index ec9bfc1152..048d8707c4 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -92,28 +92,28 @@ public:
QMutexPrivate();
bool wait(int timeout = -1);
- void wakeUp() Q_DECL_NOTHROW;
+ void wakeUp() noexcept;
// Control the lifetime of the privates
QAtomicInt refCount;
int id;
bool ref() {
- Q_ASSERT(refCount.load() >= 0);
+ Q_ASSERT(refCount.loadRelaxed() >= 0);
int c;
do {
- c = refCount.load();
+ c = refCount.loadRelaxed();
if (c == 0)
return false;
} while (!refCount.testAndSetRelaxed(c, c + 1));
- Q_ASSERT(refCount.load() >= 0);
+ Q_ASSERT(refCount.loadRelaxed() >= 0);
return true;
}
void deref() {
- Q_ASSERT(refCount.load() >= 0);
+ Q_ASSERT(refCount.loadRelaxed() >= 0);
if (!refCount.deref())
release();
- Q_ASSERT(refCount.load() >= 0);
+ Q_ASSERT(refCount.loadRelaxed() >= 0);
}
void release();
static QMutexPrivate *allocate();
@@ -125,7 +125,7 @@ public:
when the mutex is unlocked.
*/
enum { BigNumber = 0x100000 }; //Must be bigger than the possible number of waiters (number of threads)
- void derefWaiters(int value) Q_DECL_NOTHROW;
+ void derefWaiters(int value) noexcept;
//platform specific stuff
#if defined(Q_OS_MAC)
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index 3ee24a292c..df2f606a23 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
static void report_error(int code, const char *where, const char *what)
{
if (code != 0)
- qWarning("%s: %s failure: %s", where, what, qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "%s: %s failure", where, what);
}
#ifdef QT_UNIX_SEMAPHORE
@@ -99,7 +99,7 @@ bool QMutexPrivate::wait(int timeout)
return true;
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{
report_error(sem_post(&semaphore), "QMutex::unlock", "sem_post");
}
@@ -146,7 +146,7 @@ bool QMutexPrivate::wait(int timeout)
return ret;
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{
report_error(pthread_mutex_lock(&mutex), "QMutex::unlock", "mutex lock");
wakeup = true;
diff --git a/src/corelib/thread/qmutex_win.cpp b/src/corelib/thread/qmutex_win.cpp
index 3c314a4c0c..e221bc89cb 100644
--- a/src/corelib/thread/qmutex_win.cpp
+++ b/src/corelib/thread/qmutex_win.cpp
@@ -64,7 +64,7 @@ bool QMutexPrivate::wait(int timeout)
return (WaitForSingleObjectEx(event, timeout < 0 ? INFINITE : timeout, FALSE) == WAIT_OBJECT_0);
}
-void QMutexPrivate::wakeUp() Q_DECL_NOTHROW
+void QMutexPrivate::wakeUp() noexcept
{ SetEvent(event); }
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp
deleted file mode 100644
index bb063b8ab6..0000000000
--- a/src/corelib/thread/qmutexpool.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qatomic.h"
-#include "qmutexpool_p.h"
-
-QT_BEGIN_NAMESPACE
-
-Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive))
-
-/*!
- \class QMutexPool
- \inmodule QtCore
- \brief The QMutexPool class provides a pool of QMutex objects.
-
- \internal
-
- \ingroup thread
-
- QMutexPool is a convenience class that provides access to a fixed
- number of QMutex objects.
-
- Typical use of a QMutexPool is in situations where it is not
- possible or feasible to use one QMutex for every protected object.
- The mutex pool will return a mutex based on the address of the
- object that needs protection.
-
- For example, consider this simple class:
-
- \snippet code/src_corelib_thread_qmutexpool.cpp 0
-
- Adding a QMutex member to the Number class does not make sense,
- because it is so small. However, in order to ensure that access to
- each Number is protected, you need to use a mutex. In this case, a
- QMutexPool would be ideal.
-
- Code to calculate the square of a number would then look something
- like this:
-
- \snippet code/src_corelib_thread_qmutexpool.cpp 1
-
- This function will safely calculate the square of a number, since
- it uses a mutex from a QMutexPool. The mutex is locked and
- unlocked automatically by the QMutexLocker class. See the
- QMutexLocker documentation for more details.
-*/
-
-/*!
- Constructs a QMutexPool, reserving space for \a size QMutexes. All
- mutexes in the pool are created with \a recursionMode. By default,
- all mutexes are non-recursive.
-
- The QMutexes are created when needed, and deleted when the
- QMutexPool is destructed.
-*/
-QMutexPool::QMutexPool(QMutex::RecursionMode recursionMode, int size)
- : mutexes(size), recursionMode(recursionMode)
-{
- for (int index = 0; index < mutexes.count(); ++index) {
- mutexes[index].store(0);
- }
-}
-
-/*!
- Destructs a QMutexPool. All QMutexes that were created by the pool
- are deleted.
-*/
-QMutexPool::~QMutexPool()
-{
- for (int index = 0; index < mutexes.count(); ++index)
- delete mutexes[index].loadAcquire();
-}
-
-/*!
- Returns the global QMutexPool instance.
-*/
-QMutexPool *QMutexPool::instance()
-{
- return globalMutexPool();
-}
-
-/*!
- \fn QMutexPool::get(const void *address)
- Returns a QMutex from the pool. QMutexPool uses the value \a address
- to determine which mutex is returned from the pool.
-*/
-
-/*!
- \internal
- create the mutex for the given index
- */
-QMutex *QMutexPool::createMutex(int index)
-{
- // mutex not created, create one
- QMutex *newMutex = new QMutex(recursionMode);
- if (!mutexes[index].testAndSetRelease(nullptr, newMutex)) {
- delete newMutex;
- return mutexes[index].loadAcquire();
- } else {
- return newMutex;
- }
-}
-
-/*!
- Returns a QMutex from the global mutex pool.
-*/
-QMutex *QMutexPool::globalInstanceGet(const void *address)
-{
- QMutexPool * const globalInstance = globalMutexPool();
- if (globalInstance == 0)
- return 0;
- return globalInstance->get(address);
-}
-
-QT_END_NAMESPACE
diff --git a/src/corelib/thread/qorderedmutexlocker_p.h b/src/corelib/thread/qorderedmutexlocker_p.h
index ded102d32d..570c526225 100644
--- a/src/corelib/thread/qorderedmutexlocker_p.h
+++ b/src/corelib/thread/qorderedmutexlocker_p.h
@@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
+#if QT_CONFIG(thread)
+
/*
Locks 2 mutexes in a defined order, avoiding a recursive lock if
we're trying to lock the same mutex twice.
@@ -65,9 +67,9 @@ QT_BEGIN_NAMESPACE
class QOrderedMutexLocker
{
public:
- QOrderedMutexLocker(QMutex *m1, QMutex *m2)
- : mtx1((m1 == m2) ? m1 : (std::less<QMutex *>()(m1, m2) ? m1 : m2)),
- mtx2((m1 == m2) ? 0 : (std::less<QMutex *>()(m1, m2) ? m2 : m1)),
+ QOrderedMutexLocker(QBasicMutex *m1, QBasicMutex *m2)
+ : mtx1((m1 == m2) ? m1 : (std::less<QBasicMutex *>()(m1, m2) ? m1 : m2)),
+ mtx2((m1 == m2) ? 0 : (std::less<QBasicMutex *>()(m1, m2) ? m2 : m1)),
locked(false)
{
relock();
@@ -95,12 +97,12 @@ public:
}
}
- static bool relock(QMutex *mtx1, QMutex *mtx2)
+ static bool relock(QBasicMutex *mtx1, QBasicMutex *mtx2)
{
// mtx1 is already locked, mtx2 not... do we need to unlock and relock?
if (mtx1 == mtx2)
return false;
- if (std::less<QMutex *>()(mtx1, mtx2)) {
+ if (std::less<QBasicMutex *>()(mtx1, mtx2)) {
mtx2->lock();
return true;
}
@@ -113,10 +115,58 @@ public:
}
private:
- QMutex *mtx1, *mtx2;
+ QBasicMutex *mtx1, *mtx2;
bool locked;
};
+class QBasicMutexLocker
+{
+public:
+ inline explicit QBasicMutexLocker(QBasicMutex *m) QT_MUTEX_LOCK_NOEXCEPT
+ : m(m), isLocked(true)
+ {
+ m->lock();
+ }
+ inline ~QBasicMutexLocker() { if (isLocked) unlock(); }
+
+ inline void unlock() noexcept
+ {
+ isLocked = false;
+ m->unlock();
+ }
+
+ inline void relock() QT_MUTEX_LOCK_NOEXCEPT
+ {
+ isLocked = true;
+ m->lock();
+ }
+
+private:
+ Q_DISABLE_COPY(QBasicMutexLocker)
+
+ QBasicMutex *m;
+ bool isLocked;
+};
+
+#else
+
+class QOrderedMutexLocker
+{
+public:
+ QOrderedMutexLocker(QBasicMutex *, QBasicMutex *) {}
+ ~QOrderedMutexLocker() {}
+
+ void relock() {}
+ void unlock() {}
+
+ static bool relock(QBasicMutex *, QBasicMutex *) { return false; }
+};
+
+using QBasicMutexLocker = QMutexLocker;
+
+#endif
+
+
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp
index d7cf7a7284..14654986a0 100644
--- a/src/corelib/thread/qreadwritelock.cpp
+++ b/src/corelib/thread/qreadwritelock.cpp
@@ -48,6 +48,7 @@
#include "qreadwritelock_p.h"
#include "qelapsedtimer.h"
#include "private/qfreelist_p.h"
+#include "private/qlocking_p.h"
QT_BEGIN_NAMESPACE
@@ -143,7 +144,7 @@ inline bool isUncontendedLocked(const QReadWriteLockPrivate *d)
QReadWriteLock::QReadWriteLock(RecursionMode recursionMode)
: d_ptr(recursionMode == Recursive ? new QReadWriteLockPrivate(true) : nullptr)
{
- Q_ASSERT_X(!(quintptr(d_ptr.load()) & StateMask), "QReadWriteLock::QReadWriteLock", "bad d_ptr alignment");
+ Q_ASSERT_X(!(quintptr(d_ptr.loadRelaxed()) & StateMask), "QReadWriteLock::QReadWriteLock", "bad d_ptr alignment");
}
/*!
@@ -154,7 +155,7 @@ QReadWriteLock::QReadWriteLock(RecursionMode recursionMode)
*/
QReadWriteLock::~QReadWriteLock()
{
- auto d = d_ptr.load();
+ auto d = d_ptr.loadRelaxed();
if (isUncontendedLocked(d)) {
qWarning("QReadWriteLock: destroying locked QReadWriteLock");
return;
@@ -262,8 +263,8 @@ bool QReadWriteLock::tryLockForRead(int timeout)
if (d->recursive)
return d->recursiveLockForRead(timeout);
- QMutexLocker lock(&d->mutex);
- if (d != d_ptr.load()) {
+ auto lock = qt_unique_lock(d->mutex);
+ if (d != d_ptr.loadRelaxed()) {
// d_ptr has changed: this QReadWriteLock was unlocked before we had
// time to lock d->mutex.
// We are holding a lock to a mutex within a QReadWriteLockPrivate
@@ -369,8 +370,8 @@ bool QReadWriteLock::tryLockForWrite(int timeout)
if (d->recursive)
return d->recursiveLockForWrite(timeout);
- QMutexLocker lock(&d->mutex);
- if (d != d_ptr.load()) {
+ auto lock = qt_unique_lock(d->mutex);
+ if (d != d_ptr.loadRelaxed()) {
// The mutex was unlocked before we had time to lock the mutex.
// We are holding to a mutex within a QReadWriteLockPrivate that is already released
// (or even is already re-used) but that's ok because the QFreeList never frees them.
@@ -418,7 +419,7 @@ void QReadWriteLock::unlock()
return;
}
- QMutexLocker locker(&d->mutex);
+ const auto lock = qt_scoped_lock(d->mutex);
if (d->writerCount) {
Q_ASSERT(d->writerCount == 1);
Q_ASSERT(d->readerCount == 0);
@@ -433,7 +434,7 @@ void QReadWriteLock::unlock()
if (d->waitingReaders || d->waitingWriters) {
d->unlock();
} else {
- Q_ASSERT(d_ptr.load() == d); // should not change when we still hold the mutex
+ Q_ASSERT(d_ptr.loadRelaxed() == d); // should not change when we still hold the mutex
d_ptr.storeRelease(nullptr);
d->release();
}
@@ -444,7 +445,7 @@ void QReadWriteLock::unlock()
/*! \internal Helper for QWaitCondition::wait */
QReadWriteLock::StateForWaitCondition QReadWriteLock::stateForWaitCondition() const
{
- QReadWriteLockPrivate *d = d_ptr.load();
+ QReadWriteLockPrivate *d = d_ptr.loadRelaxed();
switch (quintptr(d) & StateMask) {
case StateLockedForRead: return LockedForRead;
case StateLockedForWrite: return LockedForWrite;
@@ -536,7 +537,7 @@ void QReadWriteLockPrivate::unlock()
bool QReadWriteLockPrivate::recursiveLockForRead(int timeout)
{
Q_ASSERT(recursive);
- QMutexLocker lock(&mutex);
+ auto lock = qt_unique_lock(mutex);
Qt::HANDLE self = QThread::currentThreadId();
@@ -556,7 +557,7 @@ bool QReadWriteLockPrivate::recursiveLockForRead(int timeout)
bool QReadWriteLockPrivate::recursiveLockForWrite(int timeout)
{
Q_ASSERT(recursive);
- QMutexLocker lock(&mutex);
+ auto lock = qt_unique_lock(mutex);
Qt::HANDLE self = QThread::currentThreadId();
if (currentWriter == self) {
@@ -574,7 +575,7 @@ bool QReadWriteLockPrivate::recursiveLockForWrite(int timeout)
void QReadWriteLockPrivate::recursiveUnlock()
{
Q_ASSERT(recursive);
- QMutexLocker lock(&mutex);
+ auto lock = qt_unique_lock(mutex);
Qt::HANDLE self = QThread::currentThreadId();
if (self == currentWriter) {
diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h
index 65fa76fd6d..3c1ed91b94 100644
--- a/src/corelib/thread/qreadwritelock.h
+++ b/src/corelib/thread/qreadwritelock.h
@@ -180,18 +180,18 @@ class Q_CORE_EXPORT QReadWriteLock
{
public:
enum RecursionMode { NonRecursive, Recursive };
- inline explicit QReadWriteLock(RecursionMode = NonRecursive) Q_DECL_NOTHROW { }
+ inline explicit QReadWriteLock(RecursionMode = NonRecursive) noexcept { }
inline ~QReadWriteLock() { }
- static inline void lockForRead() Q_DECL_NOTHROW { }
- static inline bool tryLockForRead() Q_DECL_NOTHROW { return true; }
- static inline bool tryLockForRead(int timeout) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
+ void lockForRead() noexcept { }
+ bool tryLockForRead() noexcept { return true; }
+ bool tryLockForRead(int timeout) noexcept { Q_UNUSED(timeout); return true; }
- static inline void lockForWrite() Q_DECL_NOTHROW { }
- static inline bool tryLockForWrite() Q_DECL_NOTHROW { return true; }
- static inline bool tryLockForWrite(int timeout) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
+ void lockForWrite() noexcept { }
+ bool tryLockForWrite() noexcept { return true; }
+ bool tryLockForWrite(int timeout) noexcept { Q_UNUSED(timeout); return true; }
- static inline void unlock() Q_DECL_NOTHROW { }
+ void unlock() noexcept { }
private:
Q_DISABLE_COPY(QReadWriteLock)
@@ -200,12 +200,12 @@ private:
class Q_CORE_EXPORT QReadLocker
{
public:
- inline QReadLocker(QReadWriteLock *) Q_DECL_NOTHROW { }
- inline ~QReadLocker() Q_DECL_NOTHROW { }
+ inline explicit QReadLocker(QReadWriteLock *) noexcept { }
+ inline ~QReadLocker() noexcept { }
- static inline void unlock() Q_DECL_NOTHROW { }
- static inline void relock() Q_DECL_NOTHROW { }
- static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; }
+ void unlock() noexcept { }
+ void relock() noexcept { }
+ QReadWriteLock *readWriteLock() noexcept { return nullptr; }
private:
Q_DISABLE_COPY(QReadLocker)
@@ -214,12 +214,12 @@ private:
class Q_CORE_EXPORT QWriteLocker
{
public:
- inline explicit QWriteLocker(QReadWriteLock *) Q_DECL_NOTHROW { }
- inline ~QWriteLocker() Q_DECL_NOTHROW { }
+ inline explicit QWriteLocker(QReadWriteLock *) noexcept { }
+ inline ~QWriteLocker() noexcept { }
- static inline void unlock() Q_DECL_NOTHROW { }
- static inline void relock() Q_DECL_NOTHROW { }
- static inline QReadWriteLock *readWriteLock() Q_DECL_NOTHROW { return nullptr; }
+ void unlock() noexcept { }
+ void relock() noexcept { }
+ QReadWriteLock *readWriteLock() noexcept { return nullptr; }
private:
Q_DISABLE_COPY(QWriteLocker)
diff --git a/src/corelib/thread/qreadwritelock_p.h b/src/corelib/thread/qreadwritelock_p.h
index 31da2401c0..a4d002b7f2 100644
--- a/src/corelib/thread/qreadwritelock_p.h
+++ b/src/corelib/thread/qreadwritelock_p.h
@@ -63,17 +63,16 @@ QT_BEGIN_NAMESPACE
class QReadWriteLockPrivate
{
public:
- QReadWriteLockPrivate(bool isRecursive = false)
- : readerCount(0), writerCount(0), waitingReaders(0), waitingWriters(0),
- recursive(isRecursive), id(0), currentWriter(nullptr) {}
+ explicit QReadWriteLockPrivate(bool isRecursive = false)
+ : recursive(isRecursive) {}
QMutex mutex;
QWaitCondition writerCond;
QWaitCondition readerCond;
- int readerCount;
- int writerCount;
- int waitingReaders;
- int waitingWriters;
+ int readerCount = 0;
+ int writerCount = 0;
+ int waitingReaders = 0;
+ int waitingWriters = 0;
const bool recursive;
//Called with the mutex locked
@@ -82,19 +81,18 @@ public:
void unlock();
//memory management
- int id;
+ int id = 0;
void release();
static QReadWriteLockPrivate *allocate();
// Recusive mutex handling
- Qt::HANDLE currentWriter;
+ Qt::HANDLE currentWriter = {};
QHash<Qt::HANDLE, int> currentReaders;
// called with the mutex unlocked
bool recursiveLockForWrite(int timeout);
bool recursiveLockForRead(int timeout);
void recursiveUnlock();
-
};
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qresultstore.h b/src/corelib/thread/qresultstore.h
index 1f29e8d187..7a65089396 100644
--- a/src/corelib/thread/qresultstore.h
+++ b/src/corelib/thread/qresultstore.h
@@ -142,7 +142,7 @@ public:
template <typename T>
int addResult(int index, const T *result)
{
- if (result == 0)
+ if (result == nullptr)
return addResult(index, static_cast<void *>(nullptr));
else
return addResult(index, static_cast<void *>(new T(*result)));
@@ -158,7 +158,7 @@ public:
int addResults(int index, const QVector<T> *results, int totalCount)
{
if (m_filterMode == true && results->count() != totalCount && 0 == results->count())
- return addResults(index, 0, 0, totalCount);
+ return addResults(index, nullptr, 0, totalCount);
else
return addResults(index, new QVector<T>(*results), results->count(), totalCount);
}
diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp
index 2e0b6f2bc0..d4fb756b94 100644
--- a/src/corelib/thread/qsemaphore.cpp
+++ b/src/corelib/thread/qsemaphore.cpp
@@ -264,7 +264,7 @@ template <bool IsTimed> bool futexSemaphoreTryAcquire(QBasicAtomicInteger<quintp
if (futexHasWaiterCount) {
// decrement the number of threads waiting
- Q_ASSERT(futexHigh32(&u)->load() & 0x7fffffffU);
+ Q_ASSERT(futexHigh32(&u)->loadRelaxed() & 0x7fffffffU);
u.fetchAndSubRelaxed(oneWaiter);
}
return false;
@@ -293,7 +293,7 @@ QSemaphore::QSemaphore(int n)
quintptr nn = unsigned(n);
if (futexHasWaiterCount)
nn |= quint64(nn) << 32; // token count replicated in high word
- u.store(nn);
+ u.storeRelaxed(nn);
} else {
d = new QSemaphorePrivate(n);
}
@@ -425,7 +425,7 @@ void QSemaphore::release(int n)
int QSemaphore::available() const
{
if (futexAvailable())
- return futexAvailCounter(u.load());
+ return futexAvailCounter(u.loadRelaxed());
QMutexLocker locker(&d->mutex);
return d->avail;
diff --git a/src/corelib/thread/qsemaphore.h b/src/corelib/thread/qsemaphore.h
index b830ff1bfd..58c12997ad 100644
--- a/src/corelib/thread/qsemaphore.h
+++ b/src/corelib/thread/qsemaphore.h
@@ -75,14 +75,14 @@ class QSemaphoreReleaser
{
public:
QSemaphoreReleaser() = default;
- explicit QSemaphoreReleaser(QSemaphore &sem, int n = 1) Q_DECL_NOTHROW
+ explicit QSemaphoreReleaser(QSemaphore &sem, int n = 1) noexcept
: m_sem(&sem), m_n(n) {}
- explicit QSemaphoreReleaser(QSemaphore *sem, int n = 1) Q_DECL_NOTHROW
+ explicit QSemaphoreReleaser(QSemaphore *sem, int n = 1) noexcept
: m_sem(sem), m_n(n) {}
- QSemaphoreReleaser(QSemaphoreReleaser &&other) Q_DECL_NOTHROW
+ QSemaphoreReleaser(QSemaphoreReleaser &&other) noexcept
: m_sem(other.m_sem), m_n(other.m_n)
{ other.m_sem = nullptr; }
- QSemaphoreReleaser &operator=(QSemaphoreReleaser &&other) Q_DECL_NOTHROW
+ QSemaphoreReleaser &operator=(QSemaphoreReleaser &&other) noexcept
{ QSemaphoreReleaser moved(std::move(other)); swap(moved); return *this; }
~QSemaphoreReleaser()
@@ -91,16 +91,16 @@ public:
m_sem->release(m_n);
}
- void swap(QSemaphoreReleaser &other) Q_DECL_NOTHROW
+ void swap(QSemaphoreReleaser &other) noexcept
{
qSwap(m_sem, other.m_sem);
qSwap(m_n, other.m_n);
}
- QSemaphore *semaphore() const Q_DECL_NOTHROW
+ QSemaphore *semaphore() const noexcept
{ return m_sem; }
- QSemaphore *cancel() Q_DECL_NOTHROW
+ QSemaphore *cancel() noexcept
{
QSemaphore *old = m_sem;
m_sem = nullptr;
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 9f60de1f87..880ae9e046 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -65,7 +65,7 @@ QThreadData::QThreadData(int initialRefCount)
QThreadData::~QThreadData()
{
- Q_ASSERT(_ref.load() == 0);
+ Q_ASSERT(_ref.loadRelaxed() == 0);
// In the odd case that Qt is running on a secondary thread, the main
// thread instance will have been dereffed asunder because of the deref in
@@ -73,8 +73,8 @@ QThreadData::~QThreadData()
// crashing during QCoreApplicationData's global static cleanup we need to
// safeguard the main thread here.. This fix is a bit crude, but it solves
// the problem...
- if (this->thread == QCoreApplicationPrivate::theMainThread) {
- QCoreApplicationPrivate::theMainThread = 0;
+ if (this->thread.loadAcquire() == QCoreApplicationPrivate::theMainThread.loadAcquire()) {
+ QCoreApplicationPrivate::theMainThread.storeRelease(nullptr);
QThreadData::clearCurrentThreadData();
}
@@ -85,8 +85,8 @@ QThreadData::~QThreadData()
// because this destructor is still running (the _ref sub-object has not
// been destroyed) and there's no reentrancy. The refcount will become
// negative, but that's acceptable.
- QThread *t = thread;
- thread = 0;
+ QThread *t = thread.loadAcquire();
+ thread.storeRelease(nullptr);
delete t;
for (int i = 0; i < postEventList.size(); ++i) {
@@ -105,7 +105,7 @@ void QThreadData::ref()
{
#if QT_CONFIG(thread)
(void) _ref.ref();
- Q_ASSERT(_ref.load() != 0);
+ Q_ASSERT(_ref.loadRelaxed() != 0);
#endif
}
@@ -171,6 +171,11 @@ QThreadPrivate::QThreadPrivate(QThreadData *d)
// to 128K.
#ifdef Q_OS_INTEGRITY
stackSize = 128 * 1024;
+#elif defined(Q_OS_RTEMS)
+ static bool envStackSizeOk = false;
+ static const int envStackSize = qEnvironmentVariableIntValue("QT_DEFAULT_THREAD_STACK_SIZE", &envStackSizeOk);
+ if (envStackSizeOk)
+ stackSize = envStackSize;
#endif
#if defined (Q_OS_WIN)
@@ -393,7 +398,7 @@ QThread *QThread::currentThread()
{
QThreadData *data = QThreadData::current();
Q_ASSERT(data != 0);
- return data->thread;
+ return data->thread.loadAcquire();
}
/*!
@@ -839,17 +844,17 @@ bool QThread::event(QEvent* event)
return QObject::event(event);
}
-Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
+Qt::HANDLE QThread::currentThreadId() noexcept
{
return Qt::HANDLE(currentThread());
}
QThread *QThread::currentThread()
{
- return QThreadData::current()->thread;
+ return QThreadData::current()->thread.loadAcquire();
}
-int QThread::idealThreadCount() Q_DECL_NOTHROW
+int QThread::idealThreadCount() noexcept
{
return 1;
}
@@ -878,11 +883,11 @@ QThreadData *QThreadData::current(bool createIfNecessary)
if (!data && createIfNecessary) {
data = new QThreadData;
data->thread = new QAdoptedThread(data);
- data->threadId.store(Qt::HANDLE(data->thread));
+ data->threadId.storeRelaxed(Qt::HANDLE(data->thread.loadAcquire()));
data->deref();
data->isAdopted = true;
- if (!QCoreApplicationPrivate::theMainThread)
- QCoreApplicationPrivate::theMainThread = data->thread.load();
+ if (!QCoreApplicationPrivate::theMainThread.loadAcquire())
+ QCoreApplicationPrivate::theMainThread.storeRelease(data->thread.loadRelaxed());
}
return data;
}
@@ -914,6 +919,16 @@ QThreadPrivate::~QThreadPrivate()
delete data;
}
+void QThread::setStackSize(uint stackSize)
+{
+ Q_UNUSED(stackSize);
+}
+
+uint QThread::stackSize() const
+{
+ return 0;
+}
+
#endif // QT_CONFIG(thread)
/*!
@@ -925,7 +940,7 @@ QThreadPrivate::~QThreadPrivate()
QAbstractEventDispatcher *QThread::eventDispatcher() const
{
Q_D(const QThread);
- return d->data->eventDispatcher.load();
+ return d->data->eventDispatcher.loadRelaxed();
}
/*!
@@ -980,7 +995,7 @@ bool QThread::event(QEvent *event)
void QThread::requestInterruption()
{
- if (this == QCoreApplicationPrivate::theMainThread) {
+ if (this == QCoreApplicationPrivate::theMainThread.loadAcquire()) {
qWarning("QThread::requestInterruption has no effect on the main thread");
return;
}
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index b6c5bf47d0..c7a6dc8f1a 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -70,9 +70,9 @@ class Q_CORE_EXPORT QThread : public QObject
{
Q_OBJECT
public:
- static Qt::HANDLE currentThreadId() Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
+ static Qt::HANDLE currentThreadId() noexcept Q_DECL_PURE_FUNCTION;
static QThread *currentThread();
- static int idealThreadCount() Q_DECL_NOTHROW;
+ static int idealThreadCount() noexcept;
static void yieldCurrentThread();
explicit QThread(QObject *parent = nullptr);
@@ -209,7 +209,6 @@ struct Callable
{
}
-#if defined(Q_COMPILER_DEFAULT_MEMBERS) && defined(Q_COMPILER_DELETE_MEMBERS)
// Apply the same semantics of a lambda closure type w.r.t. the special
// member functions, if possible: delete the copy assignment operator,
// bring back all the others as per the RO5 (cf. §8.1.5.1/11 [expr.prim.lambda.closure])
@@ -218,7 +217,6 @@ struct Callable
Callable(Callable &&) = default;
Callable &operator=(const Callable &) = delete;
Callable &operator=(Callable &&) = default;
-#endif
void operator()()
{
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h
index 57e6c995c5..b2d1628e6e 100644
--- a/src/corelib/thread/qthread_p.h
+++ b/src/corelib/thread/qthread_p.h
@@ -89,7 +89,7 @@ public:
QEvent *event;
int priority;
inline QPostEvent()
- : receiver(0), event(0), priority(0)
+ : receiver(nullptr), event(nullptr), priority(0)
{ }
inline QPostEvent(QObject *r, QEvent *e, int p)
: receiver(r), event(e), priority(p)
@@ -148,7 +148,7 @@ private:
class Q_CORE_EXPORT QDaemonThread : public QThread
{
public:
- QDaemonThread(QObject *parent = 0);
+ QDaemonThread(QObject *parent = nullptr);
~QDaemonThread();
};
@@ -157,7 +157,7 @@ class QThreadPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QThread)
public:
- QThreadPrivate(QThreadData *d = 0);
+ QThreadPrivate(QThreadData *d = nullptr);
~QThreadPrivate();
void setPriority(QThread::Priority prio);
@@ -187,8 +187,8 @@ public:
#endif // Q_OS_UNIX
#ifdef Q_OS_WIN
- static unsigned int __stdcall start(void *) Q_DECL_NOEXCEPT;
- static void finish(void *, bool lockAnyway=true) Q_DECL_NOEXCEPT;
+ static unsigned int __stdcall start(void *) noexcept;
+ static void finish(void *, bool lockAnyway=true) noexcept;
Qt::HANDLE handle;
unsigned int id;
@@ -251,17 +251,17 @@ public:
#endif
static void clearCurrentThreadData();
static QThreadData *get2(QThread *thread)
- { Q_ASSERT_X(thread != 0, "QThread", "internal error"); return thread->d_func()->data; }
+ { Q_ASSERT_X(thread != nullptr, "QThread", "internal error"); return thread->d_func()->data; }
void ref();
void deref();
inline bool hasEventDispatcher() const
- { return eventDispatcher.load() != nullptr; }
+ { return eventDispatcher.loadRelaxed() != nullptr; }
QAbstractEventDispatcher *createEventDispatcher();
QAbstractEventDispatcher *ensureEventDispatcher()
{
- QAbstractEventDispatcher *ed = eventDispatcher.load();
+ QAbstractEventDispatcher *ed = eventDispatcher.loadRelaxed();
if (Q_LIKELY(ed))
return ed;
return createEventDispatcher();
@@ -284,7 +284,7 @@ public:
public:
FlaggedDebugSignatures() : idx(0)
- { std::fill_n(locations, Count, static_cast<char*>(0)); }
+ { std::fill_n(locations, Count, static_cast<char*>(nullptr)); }
void store(const char* method)
{ locations[idx++ % Count] = method; }
@@ -331,7 +331,7 @@ class QAdoptedThread : public QThread
Q_DECLARE_PRIVATE(QThread)
public:
- QAdoptedThread(QThreadData *data = 0);
+ QAdoptedThread(QThreadData *data = nullptr);
~QAdoptedThread();
void init();
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 710528ea41..cb3c0d6bb1 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -108,17 +108,8 @@ Q_STATIC_ASSERT(sizeof(pthread_t) <= sizeof(Qt::HANDLE));
enum { ThreadPriorityResetFlag = 0x80000000 };
-#if defined(Q_OS_LINUX) && defined(__GLIBC__) && (defined(Q_CC_GNU) || defined(Q_CC_INTEL)) && !defined(QT_LINUXBASE)
-/* LSB doesn't have __thread, https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=993 */
-#define HAVE_TLS
-#endif
-#if defined(Q_CC_XLC) || defined (Q_CC_SUN)
-#define HAVE_TLS
-#endif
-#ifdef HAVE_TLS
-static __thread QThreadData *currentThreadData = 0;
-#endif
+static thread_local QThreadData *currentThreadData = 0;
static pthread_once_t current_thread_data_once = PTHREAD_ONCE_INIT;
static pthread_key_t current_thread_data_key;
@@ -138,7 +129,7 @@ static void destroy_current_thread_data(void *p)
pthread_setspecific(current_thread_data_key, p);
QThreadData *data = static_cast<QThreadData *>(p);
if (data->isAdopted) {
- QThread *thread = data->thread;
+ QThread *thread = data->thread.loadAcquire();
Q_ASSERT(thread);
QThreadPrivate *thread_p = static_cast<QThreadPrivate *>(QObjectPrivate::get(thread));
Q_ASSERT(!thread_p->finished);
@@ -179,28 +170,19 @@ Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key)
// Utility functions for getting, setting and clearing thread specific data.
static QThreadData *get_thread_data()
{
-#ifdef HAVE_TLS
return currentThreadData;
-#else
- pthread_once(&current_thread_data_once, create_current_thread_data_key);
- return reinterpret_cast<QThreadData *>(pthread_getspecific(current_thread_data_key));
-#endif
}
static void set_thread_data(QThreadData *data)
{
-#ifdef HAVE_TLS
currentThreadData = data;
-#endif
pthread_once(&current_thread_data_once, create_current_thread_data_key);
pthread_setspecific(current_thread_data_key, data);
}
static void clear_thread_data()
{
-#ifdef HAVE_TLS
currentThreadData = 0;
-#endif
pthread_setspecific(current_thread_data_key, 0);
}
@@ -249,9 +231,9 @@ QThreadData *QThreadData::current(bool createIfNecessary)
}
data->deref();
data->isAdopted = true;
- data->threadId.store(to_HANDLE(pthread_self()));
- if (!QCoreApplicationPrivate::theMainThread)
- QCoreApplicationPrivate::theMainThread = data->thread.load();
+ data->threadId.storeRelaxed(to_HANDLE(pthread_self()));
+ if (!QCoreApplicationPrivate::theMainThread.loadAcquire())
+ QCoreApplicationPrivate::theMainThread.storeRelease(data->thread.loadRelaxed());
}
return data;
}
@@ -282,7 +264,7 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat
else
return new QEventDispatcherUNIX;
#elif !defined(QT_NO_GLIB)
- const bool isQtMainThread = data->thread == QCoreApplicationPrivate::mainThread();
+ const bool isQtMainThread = data->thread.loadAcquire() == QCoreApplicationPrivate::mainThread();
if (qEnvironmentVariableIsEmpty("QT_NO_GLIB")
&& (isQtMainThread || qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB"))
&& QEventDispatcherGlib::versionSupported())
@@ -331,7 +313,7 @@ void *QThreadPrivate::start(void *arg)
thr->d_func()->setPriority(QThread::Priority(thr->d_func()->priority & ~ThreadPriorityResetFlag));
}
- data->threadId.store(to_HANDLE(pthread_self()));
+ data->threadId.storeRelaxed(to_HANDLE(pthread_self()));
set_thread_data(data);
data->ref();
@@ -401,7 +383,7 @@ void QThreadPrivate::finish(void *arg)
QThreadStorageData::finish((void **)data);
locker.relock();
- QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.loadRelaxed();
if (eventDispatcher) {
d->data->eventDispatcher = 0;
locker.unlock();
@@ -439,7 +421,7 @@ void QThreadPrivate::finish(void *arg)
** QThread
*************************************************************************/
-Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
+Qt::HANDLE QThread::currentThreadId() noexcept
{
// requires a C cast here otherwise we run into trouble on AIX
return to_HANDLE(pthread_self());
@@ -454,7 +436,7 @@ Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
int QThreadPrivate::idealThreadCount = 1;
#endif
-int QThread::idealThreadCount() Q_DECL_NOTHROW
+int QThread::idealThreadCount() noexcept
{
int cores = 1;
@@ -714,8 +696,7 @@ void QThread::start(Priority priority)
#endif // _POSIX_THREAD_ATTR_STACKSIZE
if (code) {
- qWarning("QThread::start: Thread stack size error: %s",
- qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "QThread::start: Thread stack size error");
// we failed to set the stacksize, and as the documentation states,
// the thread will fail to run...
@@ -741,16 +722,16 @@ void QThread::start(Priority priority)
#endif
code = pthread_create(&threadId, &attr, QThreadPrivate::start, this);
}
- d->data->threadId.store(to_HANDLE(threadId));
+ d->data->threadId.storeRelaxed(to_HANDLE(threadId));
pthread_attr_destroy(&attr);
if (code) {
- qWarning("QThread::start: Thread creation error: %s", qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "QThread::start: Thread creation error");
d->running = false;
d->finished = false;
- d->data->threadId.store(nullptr);
+ d->data->threadId.storeRelaxed(nullptr);
}
}
@@ -760,13 +741,12 @@ void QThread::terminate()
Q_D(QThread);
QMutexLocker locker(&d->mutex);
- if (!d->data->threadId.load())
+ if (!d->data->threadId.loadRelaxed())
return;
- int code = pthread_cancel(from_HANDLE<pthread_t>(d->data->threadId.load()));
+ int code = pthread_cancel(from_HANDLE<pthread_t>(d->data->threadId.loadRelaxed()));
if (code) {
- qWarning("QThread::start: Thread termination error: %s",
- qPrintable(qt_error_string((code))));
+ qErrnoWarning(code, "QThread::start: Thread termination error");
}
#endif
}
@@ -776,7 +756,7 @@ bool QThread::wait(unsigned long time)
Q_D(QThread);
QMutexLocker locker(&d->mutex);
- if (from_HANDLE<pthread_t>(d->data->threadId.load()) == pthread_self()) {
+ if (from_HANDLE<pthread_t>(d->data->threadId.loadRelaxed()) == pthread_self()) {
qWarning("QThread::wait: Thread tried to wait on itself");
return false;
}
@@ -818,7 +798,7 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority)
int sched_policy;
sched_param param;
- if (pthread_getschedparam(from_HANDLE<pthread_t>(data->threadId.load()), &sched_policy, &param) != 0) {
+ if (pthread_getschedparam(from_HANDLE<pthread_t>(data->threadId.loadRelaxed()), &sched_policy, &param) != 0) {
// failed to get the scheduling policy, don't bother setting
// the priority
qWarning("QThread::setPriority: Cannot get scheduler parameters");
@@ -834,15 +814,15 @@ void QThreadPrivate::setPriority(QThread::Priority threadPriority)
}
param.sched_priority = prio;
- int status = pthread_setschedparam(from_HANDLE<pthread_t>(data->threadId.load()), sched_policy, &param);
+ int status = pthread_setschedparam(from_HANDLE<pthread_t>(data->threadId.loadRelaxed()), sched_policy, &param);
# ifdef SCHED_IDLE
// were we trying to set to idle priority and failed?
if (status == -1 && sched_policy == SCHED_IDLE && errno == EINVAL) {
// reset to lowest priority possible
- pthread_getschedparam(from_HANDLE<pthread_t>(data->threadId.load()), &sched_policy, &param);
+ pthread_getschedparam(from_HANDLE<pthread_t>(data->threadId.loadRelaxed()), &sched_policy, &param);
param.sched_priority = sched_get_priority_min(sched_policy);
- pthread_setschedparam(from_HANDLE<pthread_t>(data->threadId.load()), sched_policy, &param);
+ pthread_setschedparam(from_HANDLE<pthread_t>(data->threadId.loadRelaxed()), sched_policy, &param);
}
# else
Q_UNUSED(status);
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index 5c7642c26e..a72df2fc40 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -140,11 +140,11 @@ QThreadData *QThreadData::current(bool createIfNecessary)
}
threadData->deref();
threadData->isAdopted = true;
- threadData->threadId.store(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
+ threadData->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
#ifndef Q_OS_WINRT
if (!QCoreApplicationPrivate::theMainThread) {
- QCoreApplicationPrivate::theMainThread = threadData->thread.load();
+ QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed();
} else {
#else
// for winrt the main thread is set explicitly in QCoreApplication's constructor as the
@@ -186,9 +186,9 @@ void QThreadData::setMainThread()
}
threadData->deref();
threadData->isAdopted = true;
- threadData->threadId.store(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
+ threadData->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
}
- QCoreApplicationPrivate::theMainThread = threadData->thread.load();
+ QCoreApplicationPrivate::theMainThread = threadData->thread.loadRelaxed();
}
#endif
@@ -374,14 +374,14 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat
#if QT_CONFIG(thread)
-unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) Q_DECL_NOEXCEPT
+unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(void *arg) noexcept
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadData *data = QThreadData::get2(thr);
qt_create_tls();
TlsSetValue(qt_current_thread_data_tls_index, data);
- data->threadId.store(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
+ data->threadId.storeRelaxed(reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId())));
QThread::setTerminationEnabled(false);
@@ -408,7 +408,7 @@ unsigned int __stdcall QT_ENSURE_STACK_ALIGNED_FOR_SSE QThreadPrivate::start(voi
return 0;
}
-void QThreadPrivate::finish(void *arg, bool lockAnyway) Q_DECL_NOEXCEPT
+void QThreadPrivate::finish(void *arg, bool lockAnyway) noexcept
{
QThread *thr = reinterpret_cast<QThread *>(arg);
QThreadPrivate *d = thr->d_func();
@@ -423,7 +423,7 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway) Q_DECL_NOEXCEPT
QThreadStorageData::finish(tls_data);
locker.relock();
- QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.load();
+ QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.loadRelaxed();
if (eventDispatcher) {
d->data->eventDispatcher = 0;
locker.unlock();
@@ -449,12 +449,12 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway) Q_DECL_NOEXCEPT
** QThread
*************************************************************************/
-Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
+Qt::HANDLE QThread::currentThreadId() noexcept
{
return reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
}
-int QThread::idealThreadCount() Q_DECL_NOTHROW
+int QThread::idealThreadCount() noexcept
{
SYSTEM_INFO sysinfo;
#ifndef Q_OS_WINRT
diff --git a/src/corelib/thread/qthreadpool_p.h b/src/corelib/thread/qthreadpool_p.h
index 952e02ef20..01852d8366 100644
--- a/src/corelib/thread/qthreadpool_p.h
+++ b/src/corelib/thread/qthreadpool_p.h
@@ -162,7 +162,7 @@ public:
void tryToStartMoreThreads();
bool tooManyThreadsActive() const;
- void startThread(QRunnable *runnable = 0);
+ void startThread(QRunnable *runnable = nullptr);
void reset();
bool waitForDone(int msecs);
bool waitForDone(const QDeadlineTimer &timer);
diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp
index 8b82118a5c..fdc484d2d2 100644
--- a/src/corelib/thread/qthreadstorage.cpp
+++ b/src/corelib/thread/qthreadstorage.cpp
@@ -126,7 +126,7 @@ void **QThreadStorageData::get() const
DEBUG_MSG("QThreadStorageData: Returning storage %d, data %p, for thread %p",
id,
*v,
- data->thread.load());
+ data->thread.loadRelaxed());
return *v ? v : 0;
}
@@ -148,7 +148,7 @@ void **QThreadStorageData::set(void *p)
DEBUG_MSG("QThreadStorageData: Deleting previous storage %d, data %p, for thread %p",
id,
value,
- data->thread.load());
+ data->thread.loadRelaxed());
QMutexLocker locker(&destructorsMutex);
DestructorMap *destr = destructors();
@@ -164,7 +164,7 @@ void **QThreadStorageData::set(void *p)
// store new data
value = p;
- DEBUG_MSG("QThreadStorageData: Set storage %d for thread %p to %p", id, data->thread.load(), p);
+ DEBUG_MSG("QThreadStorageData: Set storage %d for thread %p to %p", id, data->thread.loadRelaxed(), p);
return &value;
}
diff --git a/src/corelib/thread/qthreadstorage.h b/src/corelib/thread/qthreadstorage.h
index 55fc482da3..9eb8672e92 100644
--- a/src/corelib/thread/qthreadstorage.h
+++ b/src/corelib/thread/qthreadstorage.h
@@ -69,7 +69,7 @@ inline
T *&qThreadStorage_localData(QThreadStorageData &d, T **)
{
void **v = d.get();
- if (!v) v = d.set(0);
+ if (!v) v = d.set(nullptr);
return *(reinterpret_cast<T**>(v));
}
@@ -139,7 +139,7 @@ public:
inline ~QThreadStorage() { }
inline bool hasLocalData() const
- { return d.get() != 0; }
+ { return d.get() != nullptr; }
inline T& localData()
{ return qThreadStorage_localData(d, reinterpret_cast<T*>(0)); }
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp
index 0ba90763cf..dd7475cec5 100644
--- a/src/corelib/thread/qwaitcondition_unix.cpp
+++ b/src/corelib/thread/qwaitcondition_unix.cpp
@@ -72,7 +72,7 @@ __attribute__((weakref("__pthread_cond_timedwait_relative")));
static void report_error(int code, const char *where, const char *what)
{
if (code != 0)
- qWarning("%s: %s failure: %s", where, what, qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "%s: %s failure", where, what);
}
void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
diff --git a/src/corelib/thread/thread.pri b/src/corelib/thread/thread.pri
index 22f0de0523..9fc9af0e65 100644
--- a/src/corelib/thread/thread.pri
+++ b/src/corelib/thread/thread.pri
@@ -28,7 +28,7 @@ qtConfig(thread) {
thread/qbasicatomic.h \
thread/qfutex_p.h \
thread/qgenericatomic.h \
- thread/qmutexpool_p.h \
+ thread/qlocking_p.h \
thread/qmutex_p.h \
thread/qorderedmutexlocker_p.h \
thread/qreadwritelock_p.h \
@@ -40,7 +40,6 @@ qtConfig(thread) {
SOURCES += \
thread/qatomic.cpp \
thread/qmutex.cpp \
- thread/qmutexpool.cpp \
thread/qreadwritelock.cpp \
thread/qsemaphore.cpp \
thread/qthreadpool.cpp \
diff --git a/src/corelib/time/qcalendar.cpp b/src/corelib/time/qcalendar.cpp
new file mode 100644
index 0000000000..d308aeba2b
--- /dev/null
+++ b/src/corelib/time/qcalendar.cpp
@@ -0,0 +1,1109 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qcalendar.h"
+#include "qcalendarbackend_p.h"
+#include "qgregoriancalendar_p.h"
+#ifndef QT_BOOTSTRAPPED
+#include "qjuliancalendar_p.h"
+#include "qmilankoviccalendar_p.h"
+#endif
+#if QT_CONFIG(jalalicalendar)
+#include "qjalalicalendar_p.h"
+#endif
+#if QT_CONFIG(islamiccivilcalendar)
+#include "qislamiccivilcalendar_p.h"
+#endif
+
+#include "qdatetime.h"
+#include "qcalendarmath_p.h"
+#include <qhash.h>
+#include <qdebug.h>
+
+#include <unordered_map>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+
+struct CalendarName : public QString
+{
+ CalendarName(const QString &name) : QString(name) {}
+};
+
+inline bool operator==(const CalendarName &u, const CalendarName &v)
+{
+ return u.compare(v, Qt::CaseInsensitive) == 0;
+}
+
+inline uint qHash(const CalendarName &key, uint seed = 0) noexcept
+{
+ return qHash(key.toLower(), seed);
+}
+
+struct Registry {
+ std::vector<QCalendarBackend *> byId;
+ QHash<CalendarName, QCalendarBackend *> byName;
+ QCalendarBackend *gregorianCalendar = nullptr;
+ bool populated = false;
+
+ Registry()
+ {
+ byId.resize(int(QCalendar::System::Last) + 1);
+ }
+
+ ~Registry()
+ {
+ qDeleteAll(byId);
+ }
+
+ bool registerName(QCalendarBackend *calendar, const QString &name)
+ {
+ if (byName.find(name) != byName.end()) {
+ qWarning() << "Calendar name" << name
+ << "is already taken, new calendar will not be registered.";
+ return false;
+ }
+ byName.insert(name, calendar);
+ return true;
+ }
+ void addCalendar(QCalendarBackend *calendar, const QString &name, QCalendar::System id)
+ {
+ if (!registerName(calendar, name))
+ return;
+ Q_ASSERT(byId.size() >= size_t(id));
+ if (id == QCalendar::System::User) {
+ byId.push_back(calendar);
+ } else {
+ Q_ASSERT(byId.at(size_t(id)) == nullptr);
+ byId[size_t(id)] = calendar;
+ }
+ if (id == QCalendar::System::Gregorian) {
+ Q_ASSERT(!gregorianCalendar);
+ gregorianCalendar = calendar;
+ }
+ }
+ /*
+ \internal
+ Ensures each enum-available calendar has been instantiated.
+
+ This arranges for each to register itself by name; it only does anything on
+ its first call, which ensures that name-based lookups can always find all
+ the calendars available via the enum.
+ */
+ void populate()
+ {
+ if (populated)
+ return;
+
+ for (int i = 0; i <= int(QCalendar::System::Last); ++i)
+ (void)QCalendar(QCalendar::System(i));
+ }
+};
+
+}
+
+Q_GLOBAL_STATIC(Registry, calendarRegistry);
+
+
+/*!
+ \since 5.14
+
+ \class QCalendarBackend
+ \inmodule QtCore
+ \internal
+ \reentrant
+ \brief The QCalendarBackend class provides basic calendaring functions.
+
+ QCalendarBackend provides the base class on which all calendar types are
+ implemented. On construction, the backend is registered with its primary
+ name.
+
+ A backend may also be registered with aliases, where the calendar is known
+ by several names. Registering with the name used by CLDR (the Unicode
+ consortium's Common Locale Data Repository) is recommended, particularly
+ when interacting with third-party software. Once a backend is registered for
+ a name, QCalendar can be constructed using that name to select the backend.
+
+ Each calendar backend must inherit from QCalendarBackend and implement its
+ pure virtual methods. It may also override some other virtual methods, as
+ needed.
+
+ Most backends are pure code, with no data elements. Such backends should
+ normally be implemented as singletons. For a backend to be added to the
+ QCalendar::System enum, it should be such a singleton, with a case in
+ QCalendar::fromEnum()'s switch statement to instantiate it.
+
+ Non-singleton calendar backends should ensure that each instance is created
+ with a distinct primary name. Later instances attempting to register with a
+ name already in use shall fail to register and be unavailable to QCalendar,
+ hence unusable.
+
+ \sa registerAlias(), QDate, QDateTime, QDateEdit, QDateTimeEdit, QCalendarWidget
+*/
+
+/*!
+ Constructs the calendar and registers it under \a name using \a id.
+*/
+QCalendarBackend::QCalendarBackend(const QString &name, QCalendar::System id)
+{
+ calendarRegistry->addCalendar(this, name, id);
+}
+
+/*!
+ Destroys the calendar.
+
+ Never call this from user code. Each calendar backend, once instantiated,
+ shall exist for the lifetime of the program. Its destruction is taken care
+ of by destruction of the registry of calendar backends and their names.
+*/
+QCalendarBackend::~QCalendarBackend()
+{
+}
+
+/*!
+ The calendar system of this calendar.
+
+ Each calendar backend constructible from the QCalendar::System enum should
+ return the member of that enum that produces it. Other calendars should
+ return User.
+
+ \sa QCalendarBackend::fromEnum()
+*/
+QCalendar::System QCalendarBackend::calendarSystem() const
+{
+ return QCalendar::System::User;
+}
+
+/*!
+ The primary name of this calendar.
+ */
+QString QCalendar::name() const
+{
+ return d ? d->name() : QString();
+}
+
+// date queries
+/*!
+ \fn int QCalendarBackend::daysInMonth(int month, int year) const
+
+ Returns number of days in the month number \a month, in year \a year.
+
+ An implementation should return 0 if the given year had no such month. If
+ year is QCalendar::Unspecified, return the usual number of days for the
+ month, in those years that include it.
+
+ Calendars with intercallary days may represent these as extra days of the
+ preceding month, or as short months separate from the usual ones. In the
+ former case, daysInMonth(month, year) should be the number of ordinary days
+ in the month, although \c{isDateValid(year, month, day)} might return \c true
+ for some larger values of \c day.
+
+ \sa daysInYear(), monthsInYear(), minimumDaysInMonth(), maximumDaysInMonth()
+*/
+
+// properties of the calendar
+
+/*!
+ \fn bool QCalendarBackend::isLeapYear(int year) const
+
+ Returns \c true if the specified \a year is a leap year for this calendar.
+
+ \sa daysInYear(), isDateValid()
+*/
+
+/*!
+ \fn bool QCalendarBackend::isLunar() const
+
+ Returns \c true if this calendar is a lunar calendar. Otherwise returns \c
+ false.
+
+ A lunar calendar is a calendar based upon the monthly cycles of the Moon's
+ phases (synodic months). This contrasts with solar calendars, whose annual
+ cycles are based only upon the solar year.
+
+ \sa isLuniSolar(), isSolar(), isProleptic()
+*/
+
+/*!
+ \fn bool QCalendarBackend::isLuniSolar() const
+
+ Returns \c true if this calendar is a lunisolar calendar. Otherwise returns
+ \c false.
+
+ A lunisolar calendar is a calendar whose date indicates both the moon phase
+ and the time of the solar year.
+
+ \sa isLunar(), isSolar(), isProleptic()
+*/
+
+/*!
+ \fn bool QCalendarBackend::isSolar() const
+
+ Returns \c true if this calendar is a solar calendar. Otherwise returns
+ \c false.
+
+ A solar calendar is a calendar whose dates indicate the season or almost
+ equivalently the apparent position of the sun relative to the fixed stars.
+ The Gregorian calendar, widely accepted as standard in the world,
+ is an example of solar calendar.
+
+ \sa isLuniSolar(), isLunar(), isProleptic()
+*/
+
+/*!
+ Returns the total number of days in the year number \a year.
+ Returns zero if there is no such year in this calendar.
+
+ This base implementation returns 366 for leap years and 365 for ordinary
+ years.
+
+ \sa monthsInYear(), daysInMonth(), isLeapYear()
+*/
+int QCalendarBackend::daysInYear(int year) const
+{
+ return monthsInYear(year) ? isLeapYear(year) ? 366 : 365 : 0;
+}
+
+/*!
+ Returns the total number of months in the year number \a year.
+ Returns zero if there is no such year in this calendar.
+
+ This base implementation returns 12 for any valid year.
+
+ \sa daysInYear(), maximumMonthsInYear(), isDateValid()
+*/
+int QCalendarBackend::monthsInYear(int year) const
+{
+ return year > 0 || (year < 0 ? isProleptic() : hasYearZero()) ? 12 : 0;
+}
+
+/*!
+ Returns \c true if the date specified by \a year, \a month, and \a day is
+ valid for this calendar; otherwise returns \c false. For example,
+ the date 2018-04-19 is valid for the Gregorian calendar, but 2018-16-19 and
+ 2018-04-38 are invalid.
+
+ Calendars with intercallary days may represent these as extra days of the
+ preceding month or as short months separate from the usual ones. In the
+ former case, a \a day value greater than \c{daysInMonth(\a{month},
+ \a{year})} may be valid.
+
+ \sa daysInMonth(), monthsInYear()
+*/
+bool QCalendarBackend::isDateValid(int year, int month, int day) const
+{
+ return day > 0 && day <= daysInMonth(month, year);
+}
+
+/*!
+ Returns \c true if this calendar is a proleptic calendar. Otherwise returns
+ \c false.
+
+ A proleptic calendar results from allowing negative year numbers to indicate
+ years before the nominal start of the calendar system.
+
+ \sa isLuniSolar(), isSolar(), isLunar(), hasYearZero()
+*/
+
+bool QCalendarBackend::isProleptic() const
+{
+ return true;
+}
+
+/*!
+ Returns \c true if year number \c 0 is considered a valid year in this
+ calendar. Otherwise returns \c false.
+
+ \sa isDateValid(), isProleptic()
+*/
+
+bool QCalendarBackend::hasYearZero() const
+{
+ return false;
+}
+
+/*!
+ Returns the maximum number of days in a month for any year.
+
+ This base implementation returns 31, as this is a common case.
+
+ For calendars with intercallary days, although daysInMonth() doesn't include
+ the intercallary days in its count for an individual month,
+ maximumDaysInMonth() should include intercallary days, so that it is the
+ maximum value of \c day for which \c{isDateValid(year, month, day)} can be
+ true.
+
+ \sa maximumMonthsInYear(), daysInMonth()
+*/
+int QCalendarBackend::maximumDaysInMonth() const
+{
+ return 31;
+}
+
+/*!
+ Returns the minimum number of days in any valid month of any valid year.
+
+ This base implementation returns 29, as this is a common case.
+
+ \sa maximumMonthsInYear(), daysInMonth()
+*/
+int QCalendarBackend::minimumDaysInMonth() const
+{
+ return 29;
+}
+
+/*!
+ Returns the maximum number of months possible in any year.
+
+ This base implementation returns 12, as this is a common case.
+
+ \sa maximumDaysInMonth(), monthsInYear()
+*/
+int QCalendarBackend::maximumMonthsInYear() const
+{
+ return 12;
+}
+
+// Julian day number calculations
+
+/*!
+ \fn bool QCalendarBackend::dateToJulianDay(int year, int month, int day, qint64 *jd) const
+
+ Computes the Julian day number corresponding to the specified \a year, \a
+ month, and \a day. Returns true and sets \a jd if there is such a date in
+ this calendar; otherwise, returns false.
+
+ \sa QCalendar::partsFromDate(), julianDayToDate()
+*/
+
+/*!
+ \fn QCalendar::YearMonthDay QCalendarBackend::julianDayToDate(qint64 jd) const
+
+ Computes the year, month, and day in this calendar for the given Julian day
+ number \a jd. If the given day falls outside this calendar's scope
+ (e.g. before the start-date of a non-proleptic calendar), the returned
+ structure's isValid() is false; otherwise, its year, month, and day fields
+ provide this calendar's description of the date.
+
+ \sa QCalendar::dateFromParts(), dateToJulianDay()
+*/
+
+/*!
+ Returns the day of the week for the given Julian Day Number \a jd.
+
+ This is 1 for Monday through 7 for Sunday.
+
+ Calendars with intercallary days may return larger values for these
+ intercallary days. They should avoid using 0 for any special purpose (it is
+ already used in QDate::dayOfWeek() to mean an invalid date). The calendar
+ should treat the numbers used as an \c enum, whose values need not be
+ contiguous, nor need they follow closely from the 1 through 7 of the usual
+ returns. It suffices that weekDayName() can recognize each such number as
+ identifying a distinct name, that it returns to identify the particular
+ intercallary day.
+
+ This base implementation uses the day-numbering that various calendars have
+ borrowed off the Hebrew calendar.
+
+ \sa weekDayName(), standaloneWeekDayName(), QDate::dayOfWeek()
+ */
+int QCalendarBackend::dayOfWeek(qint64 jd) const
+{
+ return QRoundingDown::qMod(jd, 7) + 1;
+}
+
+// Month and week-day name look-ups (implemented in qlocale.cpp):
+/*!
+ \fn QString QCalendarBackend::monthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const
+
+ Returns the name of the specified \a month in the given \a year for the
+ chosen \a locale, using the given \a format to determine how complete the
+ name is.
+
+ If \a year is Unspecified, return the name for the month that usually has
+ this number within a typical year. Calendars with a leap month that isn't
+ always the last may need to take account of the year to map the month number
+ to the particular year's month with that number.
+
+ \note Backends for which CLDR provides data can configure the default
+ implementation of the two month name look-up methods by arranging for
+ localeMonthIndexData() and localeMonthData() to provide access to the CLDR
+ data (see cldr2qlocalexml.py, qlocalexml2cpp.py and existing backends).
+ Conversely, backends that override both month name look-up methods need not
+ return anything meaningful from localeMonthIndexData() or localeMonthData().
+
+ \sa standaloneMonthName(), QLocale::monthName()
+*/
+
+/*!
+ \fn QString QCalendarBackend::standaloneMonthName(const QLocale &locale, int month, int year
+ QLocale::FormatType format) const
+
+ Returns the standalone name of the specified \a month in the chosen \a
+ locale, using the specified \a format to determine how complete the name is.
+
+ If \a year is Unspecified, return the standalone name for the month that
+ usually has this number within a typical year. Calendars with a leap month
+ that isn't always the last may need to take account of the year to map the
+ month number to the particular year's month with that number.
+
+ \sa monthName(), QLocale::standaloneMonthName()
+*/
+
+/*!
+ \fn QString QCalendarBackend::weekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const
+
+ Returns the name of the specified \a day of the week in the chosen \a
+ locale, using the specified \a format to determine how complete the name is.
+
+ The base implementation handles \a day values from 1 to 7 using the day
+ names CLDR provides, which are suitable for calendards that use the same
+ (Hebrew-derived) week as the Gregorian calendar.
+
+ Calendars whose dayOfWeek() returns a value outside the range from 1 to 7
+ need to reimplement this method to handle such extra week-day values. They
+ can assume that \a day is a value returned by the same calendar's
+ dayOfWeek().
+
+ \sa dayOfWeek(), standaloneWeekDayName(), QLocale::dayName()
+*/
+
+/*!
+ \fn QString QCalendarBackend::standaloneWeekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const
+
+ Returns the standalone name of the specified \a day of the week in the
+ chosen \a locale, using the specified \a format to determine how complete
+ the name is.
+
+ The base implementation handles \a day values from 1 to 7 using the
+ standalone day names CLDR provides, which are suitable for calendards that
+ use the same (Hebrew-derived) week as the Gregorian calendar.
+
+ Calendars whose dayOfWeek() returns a value outside the range from 1 to 7
+ need to reimplement this method to handle such extra week-day values. They
+ can assume that \a day is a value returned by the same calendar's
+ dayOfWeek().
+
+ \sa dayOfWeek(), weekDayName(), QLocale::standaloneDayName()
+*/
+
+/*!
+ \fn QString QCalendarBackend::dateTimeToString(QStringView format, const QDateTime &datetime,
+ const QDate &dateOnly, const QTime &timeOnly,
+ const QLocale &locale) const
+
+ Returns a string representing a given date, time or date-time.
+
+ If \a datetime is specified and valid, it is used and both date and time
+ format tokens are converted to appropriate representations of the parts of
+ the datetime. Otherwise, if \a dateOnly is valid, only date format tokens
+ are converted; else, if \a timeOnly is valid, only time format tokens are
+ converted. If none are valid, an empty string is returned.
+
+ The specified \a locale influences how some format tokens are converted; for
+ example, when substituting day and month names and their short-forms. For
+ the supported formatting tokens, see QDate::toString() and
+ QTime::toString(). As described above, the provided date, time and date-time
+ determine which of these tokens are recognized: where these appear in \a
+ format they are replaced by data. Any text in \a format not recognized as a
+ format token is copied verbatim into the result string.
+
+ \sa QDate::toString(), QTime::toString(), QDateTime::toString()
+*/
+// End of methods implemented in qlocale.cpp
+
+/*!
+ Returns a list of names of the available calendar systems. Any
+ QCalendarBackend sub-class must be registered before being exposed to Date
+ and Time APIs.
+
+ \sa registerAlias(), fromName()
+*/
+QStringList QCalendarBackend::availableCalendars()
+{
+ if (calendarRegistry.isDestroyed())
+ return {};
+ calendarRegistry->populate();
+ return QStringList(calendarRegistry->byName.keyBegin(), calendarRegistry->byName.keyEnd());
+}
+
+/*!
+ Registers an alias for this calendar backend. Once a backend is registered,
+ its name will be included in the list of available calendars and the
+ calendar can be instantiated by name.
+
+ Returns \c false if the given \a name is already in use, otherwise it
+ registers this calendar backend and returns \c true.
+
+ \sa availableCalendars(), fromName()
+*/
+bool QCalendarBackend::registerAlias(const QString &name)
+{
+ if (calendarRegistry.isDestroyed())
+ return false;
+ return calendarRegistry->registerName(this, name);
+}
+
+/*!
+ Returns a pointer to a named calendar backend.
+
+ If the given \a name is present in availableCalendars(), the backend
+ matching it is returned; otherwise, \c nullptr is returned. Matching of
+ names ignores case. Note that this won't provoke construction of a calendar
+ backend, it will only return ones that have been instantiated (and not yet
+ destroyed) by some other means. However, calendars available via the
+ QCalendar::System enum are always registered when this is called.
+
+ \sa availableCalendars(), registerAlias(), fromEnum()
+*/
+const QCalendarBackend *QCalendarBackend::fromName(QStringView name)
+{
+ if (calendarRegistry.isDestroyed())
+ return nullptr;
+ calendarRegistry->populate();
+ auto it = calendarRegistry->byName.find(name.toString());
+ return it == calendarRegistry->byName.end() ? nullptr : *it;
+}
+
+/*!
+ \overload
+ */
+const QCalendarBackend *QCalendarBackend::fromName(QLatin1String name)
+{
+ if (calendarRegistry.isDestroyed())
+ return nullptr;
+ calendarRegistry->populate();
+ auto it = calendarRegistry->byName.find(QString(name));
+ return it == calendarRegistry->byName.end() ? nullptr : *it;
+}
+
+/*!
+ Returns a pointer to a calendar backend, specified by enum.
+
+ This will instantiate the indicated calendar (which will enable fromName()
+ to return it subsequently), but only for the Qt-supported calendars for
+ which (where relevant) the appropriate feature has been enabled.
+*/
+const QCalendarBackend *QCalendarBackend::fromEnum(QCalendar::System system)
+{
+ if (calendarRegistry.isDestroyed() || system == QCalendar::System::User)
+ return nullptr;
+ Q_ASSERT(calendarRegistry->byId.size() >= size_t(system));
+ if (auto *c = calendarRegistry->byId.at(size_t(system)))
+ return c;
+ switch (system) {
+ case QCalendar::System::Gregorian:
+ return new QGregorianCalendar;
+#ifndef QT_BOOTSTRAPPED
+ case QCalendar::System::Julian:
+ return new QJulianCalendar;
+ case QCalendar::System::Milankovic:
+ return new QMilankovicCalendar;
+#endif
+#if QT_CONFIG(jalalicalendar)
+ case QCalendar::System::Jalali:
+ return new QJalaliCalendar;
+#endif
+#if QT_CONFIG(islamiccivilcalendar)
+ case QCalendar::System::IslamicCivil:
+ return new QIslamicCivilCalendar;
+#else // When highest-numbered system isn't enabled, ensure we have a case for Last:
+ case QCalendar::System::Last:
+#endif
+ case QCalendar::System::User:
+ Q_UNREACHABLE();
+ }
+ return nullptr;
+}
+
+/*!
+ \since 5.14
+
+ \class QCalendar
+ \inmodule QtCore
+ \reentrant
+ \brief The QCalendar class describes calendar systems.
+
+ A QCalendar object maps a year, month, and day-number to a specific day
+ (ultimately identified by its Julian day number), using the rules of a
+ particular system.
+
+ The default QCalendar() is a proleptic Gregorian calendar, which has no year
+ zero. Other calendars may be supported by enabling suitable features or
+ loading plugins. Calendars supported as features can be constructed by
+ passing the QCalendar::System enumeration to the constructor. All supported
+ calendars may be constructed by name, once they have been constructed. (Thus
+ plugins instantiate their calendar backend to register it.) Built-in
+ backends, accessible via QCalendar::System, are also always available by
+ name.
+
+ A QCalendar value is immutable.
+
+ \sa QDate, QDateTime
+*/
+
+/*!
+ \enum QCalendar::System
+
+ This enumerated type is used to specify a choice of calendar system.
+
+ \value Gregorian The default calendar, used internationally.
+ \value Julian An ancient Roman calendar with too few leap years.
+ \value Milankovic A revised Julian calendar used by some Orthodox churches.
+ \value Jalali The Solar Hijri calendar (also called Persian).
+ \value IslamicCivil The (tabular) Islamic Civil calendar.
+ \omitvalue Last
+ \omitvalue User
+
+ \sa QCalendar
+*/
+
+/*!
+ \fn QCalendar::QCalendar()
+ \fn QCalendar::QCalendar(QCalendar::System system)
+ \fn QCalendar::QCalendar(QLatin1String name)
+ \fn QCalendar::QCalendar(QStringView name)
+
+ Constructs a calendar object.
+
+ The choice of calendar to use may be indicated as \a system, using the
+ enumeration QCalendar::System, or by \a name, using a string (either Unicode
+ or Latin 1). Construction by name may depend on an instance of the given
+ calendar being constructed by other means first. With no argument, the
+ default constructor returns the Gregorian calendar.
+
+ \sa QCalendar, System, isValid()
+*/
+
+QCalendar::QCalendar()
+ : d(nullptr)
+{
+ if (calendarRegistry.isDestroyed())
+ return;
+ d = calendarRegistry->gregorianCalendar;
+ if (!d)
+ d = new QGregorianCalendar;
+}
+
+QCalendar::QCalendar(QCalendar::System system)
+ : d(QCalendarBackend::fromEnum(system)) {}
+
+QCalendar::QCalendar(QLatin1String name)
+ : d(QCalendarBackend::fromName(name)) {}
+
+QCalendar::QCalendar(QStringView name)
+ : d(QCalendarBackend::fromName(name)) {}
+
+/*
+ \fn bool QCalendar::isValid() const
+
+ Returns true if this is a valid calendar object.
+
+ Constructing a calendar with an unrecognised calendar name may result in an
+ invalid object. Use this method to check after creating a calendar by name.
+*/
+
+// Date queries:
+
+/*!
+ Returns the number of days in the given \a month of the given \a year.
+
+ Months are numbered consecutively, starting with 1 for the first month of
+ each year. If \a year is \c Unspecified (its default, if not passed), the
+ month's length in a normal year is returned.
+
+ \sa maximumDaysInMonth(), minimumDaysInMonth()
+*/
+int QCalendar::daysInMonth(int month, int year) const
+{
+ return d ? d->daysInMonth(month, year) : 0;
+}
+
+/*!
+ Returns the number of days in the given \a year.
+*/
+int QCalendar::daysInYear(int year) const
+{
+ return d ? d->daysInYear(year) : 0;
+}
+
+/*!
+ Returns the number of months in the given \a year.
+*/
+int QCalendar::monthsInYear(int year) const
+{
+ return d ? d->monthsInYear(year) : 0;
+}
+
+/*!
+ Returns \c true precisely if the given \a year, \a month, and \a day specify
+ a valid date in this calendar.
+
+ Usually this means 1 <= month <= monthsInYear(year) and 1 <= day <=
+ daysInMonth(month, year). However, calendars with intercallary days or
+ months may complicate that.
+*/
+bool QCalendar::isDateValid(int year, int month, int day) const
+{
+ return d && d->isDateValid(year, month, day);
+}
+
+// properties of the calendar
+
+/*!
+ Returns \c true if this calendar object is the Gregorian calendar object
+ used as default calendar by other Qt APIs, e.g. in QDate.
+*/
+bool QCalendar::isGregorian() const
+{
+ Q_ASSERT(!calendarRegistry.isDestroyed());
+ return d == calendarRegistry->gregorianCalendar;
+}
+
+/*!
+ Returns \c true if the given \a year is a leap year.
+
+ Since the year is not a whole number of days long, some years are longer
+ than others. The difference may be a whole month or just a single day; the
+ details vary between calendars.
+
+ \sa isDateValid()
+*/
+bool QCalendar::isLeapYear(int year) const
+{
+ return d && d->isLeapYear(year);
+}
+
+/*!
+ Returns \c true if this calendar is a lunar calendar.
+
+ A lunar calendar is one based primarily on the phases of the moon.
+*/
+bool QCalendar::isLunar() const
+{
+ return d && d->isLunar();
+}
+
+/*!
+ Returns \c true if this calendar is luni-solar.
+
+ A luni-solar calendar expresses the phases of the moon but adapts itself to
+ also keep track of the Sun's varying position in the sky, relative to the
+ fixed stars.
+*/
+bool QCalendar::isLuniSolar() const
+{
+ return d && d->isLuniSolar();
+}
+
+/*!
+ Returns \c true if this calendar is solar.
+
+ A solar calendar is based primarily on the Sun's varying position in the
+ sky, relative to the fixed stars.
+*/
+bool QCalendar::isSolar() const
+{
+ return d && d->isSolar();
+}
+
+/*!
+ Returns \c true if this calendar is proleptic.
+
+ A proleptic calendar is able to describe years arbitrarily long before its
+ first. These are represented by negative year numbers and possibly by a year
+ zero.
+
+ \sa hasYearZero()
+*/
+bool QCalendar::isProleptic() const
+{
+ return d && d->isProleptic();
+}
+
+/*!
+ Returns \c true if this calendar has a year zero.
+
+ A calendar may represent years from its first year onwards but provide no
+ way to describe years before its first; such a calendar has no year zero and
+ is not proleptic.
+
+ A calendar which represents years before its first may number these years
+ simply by following the usual integer counting, so that the year before the
+ first is year zero, with negative-numbered years preceding this; such a
+ calendar is proleptic and has a year zero. A calendar might also have a year
+ zero (for example, the year of some great event, with subsequent years being
+ the first year after that event, the second year after, and so on) without
+ describing years before its year zero. Such a calendar would have a year
+ zero without being proleptic.
+
+ Some calendars, however, represent years before their first by an alternate
+ numbering; for example, the proleptic Gregorian calendar's first year is 1
+ CE and the year before it is 1 BCE, preceded by 2 BCE and so on. In this
+ case, we use negative year numbers for this alternate numbering, with year
+ -1 as the year before year 1, year -2 as the year before year -1 and so
+ on. Such a calendar is proleptic but has no year zero.
+
+ \sa isProleptic()
+*/
+bool QCalendar::hasYearZero() const
+{
+ return d && d->hasYearZero();
+}
+
+/*!
+ Returns the number of days in the longest month in the calendar, in any year.
+
+ \sa daysInMonth(), minimumDaysInMonth()
+*/
+int QCalendar::maximumDaysInMonth() const
+{
+ return d ? d->maximumDaysInMonth() : 0;
+}
+
+/*!
+ Returns the number of days in the shortest month in the calendar, in any year.
+
+ \sa daysInMonth(), maximumDaysInMonth()
+*/
+int QCalendar::minimumDaysInMonth() const
+{
+ return d ? d->minimumDaysInMonth() : 0;
+}
+
+/*!
+ Returns the largest number of months that any year may contain.
+
+ \sa monthName(), standaloneMonthName(), monthsInYear()
+*/
+int QCalendar::maximumMonthsInYear() const
+{
+ return d ? d->maximumMonthsInYear() : 0;
+}
+
+// Julian Day conversions:
+
+/*!
+ \fn QDate QCalendar::dateFromParts(int year, int month, int day) const
+ \fn QDate QCalendar::dateFromParts(const QCalendar::YearMonthDay &parts) const
+
+ Converts a year, month, and day to a QDate.
+
+ The \a year, \a month, and \a day may be passed as separate numbers or
+ packaged together as the members of \a parts. Returns a QDate with the given
+ year, month, and day of the month in this calendar, if there is one.
+ Otherwise, including the case where any of the values is
+ QCalendar::Unspecified, returns a QDate whose isNull() is true.
+
+ \sa isDateValid(), partsFromDate()
+*/
+QDate QCalendar::dateFromParts(int year, int month, int day) const
+{
+ qint64 jd;
+ return d && d->dateToJulianDay(year, month, day, &jd)
+ ? QDate::fromJulianDay(jd) : QDate();
+}
+
+QDate QCalendar::dateFromParts(const QCalendar::YearMonthDay &parts) const
+{
+ return parts.isValid() ? dateFromParts(parts.year, parts.month, parts.day) : QDate();
+}
+
+/*!
+ Converts a QDate to a year, month, and day of the month.
+
+ The returned structure's isValid() shall be false if the calendar is unable
+ to represent the given \a date. Otherwise its year, month, and day
+ members record the so-named parts of its representation.
+
+ \sa dateFromParts(), isProleptic(), hasYearZero()
+*/
+QCalendar::YearMonthDay QCalendar::partsFromDate(QDate date) const
+{
+ return d ? d->julianDayToDate(date.toJulianDay()) : YearMonthDay();
+}
+
+/*!
+ Returns the day of the week number for the given \a date.
+
+ Returns zero if the calendar is unable to represent the indicated date.
+ Returns 1 for Monday through 7 for Sunday. Calendars with intercallary days
+ may use other numbers to represent these.
+
+ \sa partsFromDate(), Qt::DayOfWeek
+*/
+int QCalendar::dayOfWeek(QDate date) const
+{
+ return d ? d->dayOfWeek(date.toJulianDay()) : 0;
+}
+
+// Locale data access
+
+/*!
+ Returns a suitably localised name for a month.
+
+ The month is indicated by a number, with \a month = 1 meaning the first
+ month of the year and subsequent months numbered accordingly. Returns an
+ empty string if the \a month number is unrecognized.
+
+ The \a year may be Unspecified, in which case the mapping from numbers to
+ names for a typical year's months should be used. Some calendars have leap
+ months that aren't always at the end of the year; their mapping of month
+ numbers to names may then depend on the placement of a leap month. Thus the
+ year should normally be specified, if known.
+
+ The name is returned in the form that would normally be used in a full date,
+ in the specified \a locale; the \a format determines how fully it shall be
+ expressed (i.e. to what extent it is abbreviated).
+
+ \sa standaloneMonthName(), maximumMonthsInYear(), dateTimeToString()
+*/
+QString QCalendar::monthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const
+{
+ const int maxMonth = year == Unspecified ? maximumMonthsInYear() : monthsInYear(year);
+ if (!d || month < 1 || month > maxMonth)
+ return QString();
+
+ return d->monthName(locale, month, year, format);
+}
+
+/*!
+ Returns a suitably localised standalone name for a month.
+
+ The month is indicated by a number, with \a month = 1 meaning the first
+ month of the year and subsequent months numbered accordingly. Returns an
+ empty string if the \a month number is unrecognized.
+
+ The \a year may be Unspecified, in which case the mapping from numbers to
+ names for a typical year's months should be used. Some calendars have leap
+ months that aren't always at the end of the year; their mapping of month
+ numbers to names may then depend on the placement of a leap month. Thus the
+ year should normally be specified, if known.
+
+ The name is returned in the form that would be used in isolation in the
+ specified \a locale; the \a format determines how fully it shall be
+ expressed (i.e. to what extent it is abbreviated).
+
+ \sa monthName(), maximumMonthsInYear(), dateTimeToString()
+*/
+QString QCalendar::standaloneMonthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const
+{
+ const int maxMonth = year == Unspecified ? maximumMonthsInYear() : monthsInYear(year);
+ if (!d || month < 1 || month > maxMonth)
+ return QString();
+
+ return d->standaloneMonthName(locale, month, year, format);
+}
+
+/*!
+ Returns a suitably localised name for a day of the week.
+
+ The days of the week are numbered from 1 for Monday through 7 for
+ Sunday. Some calendars may support higher numbers for other days
+ (e.g. intercallary days, that are not part of any week). Returns an empty
+ string if the \a day number is unrecognized.
+
+ The name is returned in the form that would normally be used in a full date,
+ in the specified \a locale; the \a format determines how fully it shall be
+ expressed (i.e. to what extent it is abbreviated).
+
+ \sa standaloneWeekDayName(), dayOfWeek()
+*/
+QString QCalendar::weekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const
+{
+ return d ? d->weekDayName(locale, day, format) : QString();
+}
+
+/*!
+ Returns a suitably localised standalone name for a day of the week.
+
+ The days of the week are numbered from 1 for Monday through 7 for
+ Sunday. Some calendars may support higher numbers for other days
+ (e.g. intercallary days, that are not part of any week). Returns an empty
+ string if the \a day number is unrecognized.
+
+ The name is returned in the form that would be used in isolation (for
+ example as a column heading in a calendar's tabular display of a month with
+ successive weeks as rows) in the specified \a locale; the \a format
+ determines how fully it shall be expressed (i.e. to what extent it is
+ abbreviated).
+
+ \sa weekDayName(), dayOfWeek()
+*/
+QString QCalendar::standaloneWeekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const
+{
+ return d ? d->standaloneWeekDayName(locale, day, format) : QString();
+}
+
+/*!
+ Returns a string representing a given date, time or date-time.
+
+ If \a datetime is valid, it is represented and format specifiers for both
+ date and time fields are recognized; otherwise, if \a dateOnly is valid, it
+ is represented and only format specifiers for date fields are recognized;
+ finally, if \a timeOnly is valid, it is represented and only format
+ specifiers for time fields are recognized. If none of these is valid, an
+ empty string is returned.
+
+ See QDate::toString and QTime::toString() for the supported field
+ specifiers. Characters in \a format that are recognized as field specifiers
+ are replaced by text representing appropriate data from the date and/or time
+ being represented. The texts to represent them may depend on the \a locale
+ specified. Other charagers in \a format are copied verbatim into the
+ returned string.
+
+ \sa monthName(), weekDayName(), QDate::toString(), QTime::toString()
+*/
+QString QCalendar::dateTimeToString(QStringView format, const QDateTime &datetime,
+ const QDate &dateOnly, const QTime &timeOnly,
+ const QLocale &locale) const
+{
+ return d ? d->dateTimeToString(format, datetime, dateOnly, timeOnly, locale) : QString();
+}
+
+/*!
+ Returns a list of names of the available calendar systems.
+
+ These may be supplied by plugins or other code linked into an application,
+ in addition to the ones provided by Qt, some of which are controlled by
+ features.
+*/
+QStringList QCalendar::availableCalendars()
+{
+ return QCalendarBackend::availableCalendars();
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qcalendar.h b/src/corelib/time/qcalendar.h
new file mode 100644
index 0000000000..42c8e150c5
--- /dev/null
+++ b/src/corelib/time/qcalendar.h
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCALENDAR_H
+#define QCALENDAR_H
+
+#include <limits>
+
+#include <QtCore/qglobal.h>
+#include <QtCore/qlocale.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qstringview.h>
+
+/* Suggested enum names for other calendars known to CLDR (v33.1)
+
+ Not yet implemented - see QCalendar::System - contributions welcome:
+
+ * Buddhist -- Thai Buddhist, to be specific
+ * Chinese
+ * Coptic
+ * Dangi -- Korean
+ * Ethiopic (Amete Mihret - epoch approx. 8 C.E.)
+ * EthiopicAmeteAlem (Amete Alem - epoch approx. 5493 B.C.E; data from
+ type="ethiopic-amete-alem", an alias for type="ethioaa")
+ * Hebrew
+ * Indian -- National
+ * Islamic -- Based on astronomical observations, not predictions, so hard to
+ implement. CLDR's data for type="islamic" apply, unless overridden, to the
+ other Islamic calendar variants, i.e. IslamicCivil, above, and the three
+ following. See QHijriCalendar, a common base to provide that data.
+ * IslamicTabular -- tabular, astronomical epoch (same as IslamicCivil, except
+ for epoch), CLDR type="islamic-tbla"
+ * Saudi -- Saudi Arabia, sighting; CLDR type="islamic-rgsa"
+ * UmmAlQura -- Umm al-Qura, Saudi Arabia, calculated; CLDR type="islamic-umalqura"
+ * Iso8601 -- as Gregorian, but treating ISO 8601 weeks as "months"
+ * Japanese -- Imperial calendar
+ * Minguo -- Republic of China, Taiwan; CLDR type="roc"
+
+ See:
+ http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
+
+ These can potentially be supported, as features, using CLDR's data; any
+ others shall need hand-crafted localization data; it would probably be best
+ to do that by contributing data for them to CLDR.
+*/
+
+QT_BEGIN_NAMESPACE
+
+class QCalendarBackend;
+class QDate;
+
+class Q_CORE_EXPORT QCalendar
+{
+ Q_GADGET
+public:
+ // (Extra parentheses to suppress bogus reading of min() as a macro.)
+ enum : int { Unspecified = (std::numeric_limits<int>::min)() };
+ struct YearMonthDay
+ {
+ YearMonthDay() = default;
+ YearMonthDay(int y, int m = 1, int d = 1) : year(y), month(m), day(d) {}
+
+ bool isValid() const
+ { return month != Unspecified && day != Unspecified; }
+ // (The first year supported by QDate has year == Unspecified.)
+
+ int year = Unspecified;
+ int month = Unspecified;
+ int day = Unspecified;
+ };
+ // Feature (\w+)calendar uses CLDR type="\1" data, except as noted in type="..." comments below
+ enum class System
+ {
+ Gregorian, // CLDR: type = "gregory", alias = "gregorian"
+#ifndef QT_BOOTSTRAPPED
+ Julian = 8,
+ Milankovic = 9,
+#endif // These are Roman-based, so share Gregorian's CLDR data
+
+ // Feature-controlled calendars:
+#if QT_CONFIG(jalalicalendar) // type="persian"
+ Jalali = 10,
+#endif
+#if QT_CONFIG(islamiccivilcalendar) // type="islamic-civil", uses data from type="islamic"
+ IslamicCivil = 11,
+ // tabular, civil epoch
+ // 30 year cycle, leap on 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29
+ // (Other variants: 2, 5, 8, (10|11), 13, 16, 19, 21, 24, 27 and 29.)
+#endif
+
+ Last = 11, // Highest number of any above
+ User = -1
+ };
+ // New entries must be added to the \enum doc in qcalendar.cpp and
+ // handled in QCalendarBackend::fromEnum()
+ Q_ENUM(System)
+
+ explicit QCalendar(); // Gregorian, optimised
+ explicit QCalendar(System system);
+ explicit QCalendar(QLatin1String name);
+ explicit QCalendar(QStringView name);
+
+ // QCalendar is a trivially copyable value type.
+ bool isValid() const { return d != nullptr; }
+
+ // Date queries:
+ int daysInMonth(int month, int year = Unspecified) const;
+ int daysInYear(int year) const;
+ int monthsInYear(int year) const;
+ bool isDateValid(int year, int month, int day) const;
+
+ // Leap years:
+ bool isLeapYear(int year) const;
+
+ // Properties of the calendar:
+ bool isGregorian() const;
+ bool isLunar() const;
+ bool isLuniSolar() const;
+ bool isSolar() const;
+ bool isProleptic() const;
+ bool hasYearZero() const;
+ int maximumDaysInMonth() const;
+ int minimumDaysInMonth() const;
+ int maximumMonthsInYear() const;
+ QString name() const;
+
+ // QDate conversions:
+ QDate dateFromParts(int year, int month, int day) const;
+ QDate dateFromParts(const YearMonthDay &parts) const;
+ YearMonthDay partsFromDate(QDate date) const;
+ int dayOfWeek(QDate date) const;
+
+ // Month and week-day names (as in QLocale):
+ QString monthName(const QLocale &locale, int month, int year = Unspecified,
+ QLocale::FormatType format=QLocale::LongFormat) const;
+ QString standaloneMonthName(const QLocale &locale, int month, int year = Unspecified,
+ QLocale::FormatType format = QLocale::LongFormat) const;
+ QString weekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format = QLocale::LongFormat) const;
+ QString standaloneWeekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format=QLocale::LongFormat) const;
+
+ // Formatting of date-times:
+ QString dateTimeToString(QStringView format, const QDateTime &datetime,
+ const QDate &dateOnly, const QTime &timeOnly,
+ const QLocale &locale) const;
+
+ // What's available ?
+ static QStringList availableCalendars();
+private:
+ // Always supplied by QCalendarBackend and expected to be a singleton
+ const QCalendarBackend *d;
+};
+
+QT_END_NAMESPACE
+
+#endif // QCALENDAR_H
diff --git a/src/corelib/time/qcalendarbackend_p.h b/src/corelib/time/qcalendarbackend_p.h
new file mode 100644
index 0000000000..21506e9e2c
--- /dev/null
+++ b/src/corelib/time/qcalendarbackend_p.h
@@ -0,0 +1,144 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCALENDAR_BACKEND_P_H
+#define QCALENDAR_BACKEND_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qobjectdefs.h>
+#include <QtCore/qcalendar.h>
+#include <QtCore/qstringlist.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qmap.h>
+
+QT_BEGIN_NAMESPACE
+
+// Locale-related parts, mostly handled in ../text/qlocale.cpp
+struct QLocaleDataEntry {
+ quint16 index, size;
+};
+
+struct QCalendarLocale {
+ quint16 m_language_id, m_script_id, m_country_id;
+ // Month name indexes:
+ QLocaleDataEntry m_standalone_short;
+ QLocaleDataEntry m_standalone_long;
+ QLocaleDataEntry m_standalone_narrow;
+ QLocaleDataEntry m_short;
+ QLocaleDataEntry m_long;
+ QLocaleDataEntry m_narrow;
+};
+
+// Partial implementation, of methods with common forms, in qcalendar.cpp
+class Q_CORE_EXPORT QCalendarBackend
+{
+ friend class QCalendar;
+public:
+ virtual ~QCalendarBackend();
+ virtual QString name() const = 0;
+ virtual QCalendar::System calendarSystem() const;
+ // Date queries:
+ virtual int daysInMonth(int month, int year = QCalendar::Unspecified) const = 0;
+ virtual int daysInYear(int year) const;
+ virtual int monthsInYear(int year) const;
+ virtual bool isDateValid(int year, int month, int day) const;
+ // Properties of the calendar:
+ virtual bool isLeapYear(int year) const = 0;
+ virtual bool isLunar() const = 0;
+ virtual bool isLuniSolar() const = 0;
+ virtual bool isSolar() const = 0;
+ virtual bool isProleptic() const;
+ virtual bool hasYearZero() const;
+ virtual int maximumDaysInMonth() const;
+ virtual int minimumDaysInMonth() const;
+ virtual int maximumMonthsInYear() const;
+ // Julian Day conversions:
+ virtual bool dateToJulianDay(int year, int month, int day, qint64 *jd) const = 0;
+ virtual QCalendar::YearMonthDay julianDayToDate(qint64 jd) const = 0;
+ // Day of week and week numbering:
+ virtual int dayOfWeek(qint64 jd) const;
+
+ // Names of months and week-days (implemented in qlocale.cpp):
+ virtual QString monthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const;
+ virtual QString standaloneMonthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const;
+ virtual QString weekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const;
+ virtual QString standaloneWeekDayName(const QLocale &locale, int day,
+ QLocale::FormatType format) const;
+
+ // Formatting of date-times (implemented in qlocale.cpp):
+ virtual QString dateTimeToString(QStringView format, const QDateTime &datetime,
+ const QDate &dateOnly, const QTime &timeOnly,
+ const QLocale &locale) const;
+
+ // Calendar enumeration by name:
+ static QStringList availableCalendars();
+
+protected:
+ QCalendarBackend(const QString &name, QCalendar::System id = QCalendar::System::User);
+
+ // Locale support:
+ virtual const QCalendarLocale *localeMonthIndexData() const = 0;
+ virtual const ushort *localeMonthData() const = 0;
+
+ bool registerAlias(const QString &name);
+
+private:
+ // QCalendar's access to its registry:
+ static const QCalendarBackend *fromName(QStringView name);
+ static const QCalendarBackend *fromName(QLatin1String name);
+ // QCalendar's access to singletons:
+ static const QCalendarBackend *fromEnum(QCalendar::System system);
+};
+
+QT_END_NAMESPACE
+
+#endif // QCALENDAR_BACKEND_P_H
diff --git a/src/corelib/time/qcalendarmath_p.h b/src/corelib/time/qcalendarmath_p.h
new file mode 100644
index 0000000000..61c2c5d2b5
--- /dev/null
+++ b/src/corelib/time/qcalendarmath_p.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCALENDARMATH_P_H
+#define QCALENDARMATH_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of q*calendar.cpp. This header file may change from version to version
+// without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QRoundingDown {
+/*
+ Division, rounding down (rather than towards zero).
+
+ From C++11 onwards, integer division is defined to round towards zero, so we
+ can rely on that when implementing this. This is only used with denominator b
+ > 0, so we only have to treat negative numerator, a, specially.
+*/
+
+template<typename Int> constexpr Int qDiv(Int a, unsigned b)
+{ return (a - (a < 0 ? int(b - 1) : 0)) / int(b); }
+
+template<typename Int> constexpr Int qMod(Int a, unsigned b)
+{ return a - qDiv(a, b) * b; }
+
+} // QRoundingDown
+
+QT_END_NAMESPACE
+
+#endif // QCALENDARMATH_P_H
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/time/qdatetime.cpp
index aa1ffff400..878a2c1e46 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/time/qdatetime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -73,6 +73,9 @@
#include <private/qcore_mac_p.h>
#endif
+#include "qcalendar.h"
+#include "qgregoriancalendar_p.h"
+
QT_BEGIN_NAMESPACE
/*****************************************************************************
@@ -94,90 +97,35 @@ enum {
QDate static helper functions
*****************************************************************************/
-static inline QDate fixedDate(int y, int m, int d)
-{
- QDate result(y, m, 1);
- result.setDate(y, m, qMin(d, result.daysInMonth()));
- return result;
-}
-
-/*
- Division, rounding down (rather than towards zero).
-
- From C++11 onwards, integer division is defined to round towards zero, so we
- can rely on that when implementing this. This is only used with denominator b
- > 0, so we only have to treat negative numerator, a, specially.
- */
-static inline qint64 floordiv(qint64 a, int b)
-{
- return (a - (a < 0 ? b - 1 : 0)) / b;
-}
-
-static inline int floordiv(int a, int b)
-{
- return (a - (a < 0 ? b - 1 : 0)) / b;
-}
-
-static inline qint64 julianDayFromDate(int year, int month, int day)
+static inline QDate fixedDate(QCalendar::YearMonthDay &&parts, QCalendar cal)
{
- // Adjust for no year 0
- if (year < 0)
- ++year;
+ if ((parts.year < 0 && !cal.isProleptic()) || (parts.year == 0 && !cal.hasYearZero()))
+ return QDate();
-/*
- * Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php
- * This formula is correct for all julian days, when using mathematical integer
- * division (round to negative infinity), not c++11 integer division (round to zero)
- */
- int a = floordiv(14 - month, 12);
- qint64 y = (qint64)year + 4800 - a;
- int m = month + 12 * a - 3;
- return day + floordiv(153 * m + 2, 5) + 365 * y + floordiv(y, 4) - floordiv(y, 100) + floordiv(y, 400) - 32045;
+ parts.day = qMin(parts.day, cal.daysInMonth(parts.month, parts.year));
+ return cal.dateFromParts(parts);
}
-struct ParsedDate
-{
- int year, month, day;
-};
-
-// prevent this function from being inlined into all 10 users
-Q_NEVER_INLINE
-static ParsedDate getDateFromJulianDay(qint64 julianDay)
+static inline QDate fixedDate(QCalendar::YearMonthDay &&parts)
{
-/*
- * Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php
- * This formula is correct for all julian days, when using mathematical integer
- * division (round to negative infinity), not c++11 integer division (round to zero)
- */
- qint64 a = julianDay + 32044;
- qint64 b = floordiv(4 * a + 3, 146097);
- int c = a - floordiv(146097 * b, 4);
-
- int d = floordiv(4 * c + 3, 1461);
- int e = c - floordiv(1461 * d, 4);
- int m = floordiv(5 * e + 2, 153);
-
- int day = e - floordiv(153 * m + 2, 5) + 1;
- int month = m + 3 - 12 * floordiv(m, 10);
- int year = 100 * b + d - 4800 + floordiv(m, 10);
-
- // Adjust for no year 0
- if (year <= 0)
- --year ;
-
- return { year, month, day };
+ if (parts.year) {
+ parts.day = qMin(parts.day, QGregorianCalendar::monthLength(parts.month, parts.year));
+ qint64 jd;
+ if (QGregorianCalendar::julianFromParts(parts.year, parts.month, parts.day, &jd))
+ return QDate::fromJulianDay(jd);
+ }
+ return QDate();
}
/*****************************************************************************
Date/Time formatting helper functions
*****************************************************************************/
-static const char monthDays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
#if QT_CONFIG(textdate)
static const char qt_shortMonthNames[][4] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
static int qt_monthNumberFromShortName(QStringRef shortName)
{
@@ -190,7 +138,7 @@ static int qt_monthNumberFromShortName(QStringRef shortName)
static int qt_monthNumberFromShortName(const QString &shortName)
{ return qt_monthNumberFromShortName(QStringRef(&shortName)); }
-static int fromShortMonthName(const QStringRef &monthName)
+static int fromShortMonthName(const QStringRef &monthName, int year)
{
// Assume that English monthnames are the default
int month = qt_monthNumberFromShortName(monthName);
@@ -198,7 +146,7 @@ static int fromShortMonthName(const QStringRef &monthName)
return month;
// If English names can't be found, search the localized ones
for (int i = 1; i <= 12; ++i) {
- if (monthName == QLocale::system().monthName(i, QLocale::ShortFormat))
+ if (monthName == QCalendar().monthName(QLocale::system(), i, year, QLocale::ShortFormat))
return i;
}
return -1;
@@ -259,7 +207,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
#if QT_CONFIG(datestring)
// Parse offset in [+-]HH[[:]mm] format
-static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_NOTHROW
+static int fromOffsetString(const QStringRef &offsetString, bool *valid) noexcept
{
*valid = false;
@@ -344,7 +292,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
The year(), month(), and day() functions provide access to the year, month,
and day numbers. Also, dayOfWeek() and dayOfYear() functions are
provided. The same information is provided in textual format by
- toString(). The day and month numbers can be mapped to names using QLocal.
+ toString(). The day and month numbers can be mapped to names using QLocale.
QDate provides a full set of operators to compare two QDate
objects where smaller means earlier, and larger means later.
@@ -380,7 +328,7 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
for technical reasons limited to between -784350574879 and 784354017364,
which means from before 2 billion BCE to after 2 billion CE.
- \sa QTime, QDateTime, QDateEdit, QDateTimeEdit, QCalendarWidget
+ \sa QTime, QDateTime, QCalendar, QDateTime::YearRange, QDateEdit, QDateTimeEdit, QCalendarWidget
*/
/*!
@@ -394,19 +342,24 @@ static int fromOffsetString(const QStringRef &offsetString, bool *valid) Q_DECL_
/*!
Constructs a date with year \a y, month \a m and day \a d.
- If the specified date is invalid, the date is not set and
- isValid() returns \c false.
+ The date is understood in terms of the Gregorian calendar. If the specified
+ date is invalid, the date is not set and isValid() returns \c false.
\warning Years 1 to 99 are interpreted as is. Year 0 is invalid.
- \sa isValid()
+ \sa isValid(), QCalendar::dateFromParts()
*/
QDate::QDate(int y, int m, int d)
{
- setDate(y, m, d);
+ if (!QGregorianCalendar::julianFromParts(y, m, d, &jd))
+ jd = nullJd();
}
+QDate::QDate(int y, int m, int d, QCalendar cal)
+{
+ *this = cal.dateFromParts(y, m, d);
+}
/*!
\fn bool QDate::isNull() const
@@ -419,36 +372,66 @@ QDate::QDate(int y, int m, int d)
\sa isValid()
*/
-
/*!
\fn bool QDate::isValid() const
Returns \c true if this date is valid; otherwise returns \c false.
- \sa isNull()
+ \sa isNull(), QCalendar::isDateValid()
*/
-
/*!
- Returns the year of this date. Negative numbers indicate years
- before 1 CE, such that year -44 is 44 BCE.
+ Returns the year of this date.
- Returns 0 if the date is invalid.
+ Uses \a cal as calendar, if supplied, else the Gregorian calendar.
- \sa month(), day()
+ Returns 0 if the date is invalid. For some calendars, dates before their
+ first year may all be invalid.
+
+ If using a calendar which has a year 0, check using isValid() if the return
+ is 0. Such calendars use negative year numbers in the obvious way, with
+ year 1 preceded by year 0, in turn preceded by year -1 and so on.
+
+ Some calendars, despite having no year 0, have a conventional numbering of
+ the years before their first year, counting backwards from 1. For example,
+ in the proleptic Gregorian calendar, successive years before 1 CE (the first
+ year) are identified as 1 BCE, 2 BCE, 3 BCE and so on. For such calendars,
+ negative year numbers are used to indicate these years before year 1, with
+ -1 indicating the year before 1.
+
+ \sa month(), day(), QCalendar::hasYearZero(), QCalendar::isProleptic()
*/
-int QDate::year() const
+int QDate::year(QCalendar cal) const
{
- if (isNull())
- return 0;
+ if (isValid()) {
+ const auto parts = cal.partsFromDate(*this);
+ if (parts.isValid())
+ return parts.year;
+ }
+ return 0;
+}
+
+/*!
+ \overload
+ */
- return getDateFromJulianDay(jd).year;
+int QDate::year() const
+{
+ if (isValid()) {
+ const auto parts = QGregorianCalendar::partsFromJulian(jd);
+ if (parts.isValid())
+ return parts.year;
+ }
+ return 0;
}
/*!
- Returns the number corresponding to the month of this date, using
- the following convention:
+ Returns the month-number for the date.
+
+ Numbers the months of the year starting with 1 for the first. Uses \a cal
+ as calendar if supplied, else the Gregorian calendar, for which the month
+ numbering is as follows:
\list
\li 1 = "January"
@@ -465,118 +448,201 @@ int QDate::year() const
\li 12 = "December"
\endlist
- Returns 0 if the date is invalid.
+ Returns 0 if the date is invalid. Note that some calendars may have more
+ than 12 months in some years.
\sa year(), day()
*/
-int QDate::month() const
+int QDate::month(QCalendar cal) const
{
- if (isNull())
- return 0;
+ if (isValid()) {
+ const auto parts = cal.partsFromDate(*this);
+ if (parts.isValid())
+ return parts.month;
+ }
+ return 0;
+}
- return getDateFromJulianDay(jd).month;
+/*!
+ \overload
+ */
+
+int QDate::month() const
+{
+ if (isValid()) {
+ const auto parts = QGregorianCalendar::partsFromJulian(jd);
+ if (parts.isValid())
+ return parts.month;
+ }
+ return 0;
}
/*!
- Returns the day of the month (1 to 31) of this date.
+ Returns the day of the month for this date.
- Returns 0 if the date is invalid.
+ Uses \a cal as calendar if supplied, else the Gregorian calendar (for which
+ the return ranges from 1 to 31). Returns 0 if the date is invalid.
\sa year(), month(), dayOfWeek()
*/
-int QDate::day() const
+int QDate::day(QCalendar cal) const
{
- if (isNull())
- return 0;
+ if (isValid()) {
+ const auto parts = cal.partsFromDate(*this);
+ if (parts.isValid())
+ return parts.day;
+ }
+ return 0;
+}
- return getDateFromJulianDay(jd).day;
+/*!
+ \overload
+ */
+
+int QDate::day() const
+{
+ if (isValid()) {
+ const auto parts = QGregorianCalendar::partsFromJulian(jd);
+ if (parts.isValid())
+ return parts.day;
+ }
+ return 0;
}
/*!
Returns the weekday (1 = Monday to 7 = Sunday) for this date.
- Returns 0 if the date is invalid.
+ Uses \a cal as calendar if supplied, else the Gregorian calendar. Returns 0
+ if the date is invalid. Some calendars may give special meaning
+ (e.g. intercallary days) to values greater than 7.
\sa day(), dayOfYear(), Qt::DayOfWeek
*/
-int QDate::dayOfWeek() const
+int QDate::dayOfWeek(QCalendar cal) const
{
if (isNull())
return 0;
- if (jd >= 0)
- return (jd % 7) + 1;
- else
- return ((jd + 1) % 7) + 7;
+ return cal.dayOfWeek(*this);
}
/*!
- Returns the day of the year (1 to 365 or 366 on leap years) for
- this date.
+ \overload
+ */
- Returns 0 if the date is invalid.
+int QDate::dayOfWeek() const
+{
+ return isValid() ? QGregorianCalendar::weekDayOfJulian(jd) : 0;
+}
+
+/*!
+ Returns the day of the year (1 for the first day) for this date.
+
+ Uses \a cal as calendar if supplied, else the Gregorian calendar.
+ Returns 0 if either the date or the first day of its year is invalid.
\sa day(), dayOfWeek()
*/
-int QDate::dayOfYear() const
+int QDate::dayOfYear(QCalendar cal) const
{
- if (isNull())
- return 0;
+ if (isValid()) {
+ QDate firstDay = cal.dateFromParts(year(cal), 1, 1);
+ if (firstDay.isValid())
+ return firstDay.daysTo(*this) + 1;
+ }
+ return 0;
+}
- return jd - julianDayFromDate(year(), 1, 1) + 1;
+/*!
+ \overload
+ */
+
+int QDate::dayOfYear() const
+{
+ if (isValid()) {
+ qint64 first;
+ if (QGregorianCalendar::julianFromParts(year(), 1, 1, &first))
+ return jd - first + 1;
+ }
+ return 0;
}
/*!
- Returns the number of days in the month (28 to 31) for this date.
+ Returns the number of days in the month for this date.
- Returns 0 if the date is invalid.
+ Uses \a cal as calendar if supplied, else the Gregorian calendar (for which
+ the result ranges from 28 to 31). Returns 0 if the date is invalid.
\sa day(), daysInYear()
*/
-int QDate::daysInMonth() const
+int QDate::daysInMonth(QCalendar cal) const
{
- if (isNull())
- return 0;
+ if (isValid()) {
+ const auto parts = cal.partsFromDate(*this);
+ if (parts.isValid())
+ return cal.daysInMonth(parts.month, parts.year);
+ }
+ return 0;
+}
- const ParsedDate pd = getDateFromJulianDay(jd);
- if (pd.month == 2 && isLeapYear(pd.year))
- return 29;
- else
- return monthDays[pd.month];
+/*!
+ \overload
+ */
+
+int QDate::daysInMonth() const
+{
+ if (isValid()) {
+ const auto parts = QGregorianCalendar::partsFromJulian(jd);
+ if (parts.isValid())
+ return QGregorianCalendar::monthLength(parts.month, parts.year);
+ }
+ return 0;
}
/*!
- Returns the number of days in the year (365 or 366) for this date.
+ Returns the number of days in the year for this date.
- Returns 0 if the date is invalid.
+ Uses \a cal as calendar if supplied, else the Gregorian calendar (for which
+ the result is 365 or 366). Returns 0 if the date is invalid.
\sa day(), daysInMonth()
*/
-int QDate::daysInYear() const
+int QDate::daysInYear(QCalendar cal) const
{
if (isNull())
return 0;
- return isLeapYear(getDateFromJulianDay(jd).year) ? 366 : 365;
+ return cal.daysInYear(year(cal));
}
/*!
- Returns the week number (1 to 53), and stores the year in
- *\a{yearNumber} unless \a yearNumber is null (the default).
+ \overload
+ */
- Returns 0 if the date is invalid.
+int QDate::daysInYear() const
+{
+ return isValid() ? QGregorianCalendar::leapTest(year()) ? 366 : 365 : 0;
+}
+
+/*!
+ Returns the ISO 8601 week number (1 to 53).
+
+ Returns 0 if the date is invalid. Otherwise, returns the week number for the
+ date. If \a yearNumber is not \nullptr (its default), stores the year as
+ *\a{yearNumber}.
- In accordance with ISO 8601, weeks start on Monday and the first
- Thursday of a year is always in week 1 of that year. Most years
- have 52 weeks, but some have 53.
+ In accordance with ISO 8601, each week falls in the year to which most of
+ its days belong, in the Gregorian calendar. As ISO 8601's week starts on
+ Monday, this is the year in which the week's Thursday falls. Most years have
+ 52 weeks, but some have 53.
- *\a{yearNumber} is not always the same as year(). For example, 1
+ \note *\a{yearNumber} is not always the same as year(). For example, 1
January 2000 has week number 52 in the year 1999, and 31 December
2002 has week number 1 in the year 2003.
@@ -588,33 +654,282 @@ int QDate::weekNumber(int *yearNumber) const
if (!isValid())
return 0;
- int year = QDate::year();
- int yday = dayOfYear();
- int wday = dayOfWeek();
-
- int week = (yday - wday + 10) / 7;
-
- if (week == 0) {
- // last week of previous year
- --year;
- week = (yday + 365 + (QDate::isLeapYear(year) ? 1 : 0) - wday + 10) / 7;
- Q_ASSERT(week == 52 || week == 53);
- } else if (week == 53) {
- // maybe first week of next year
- int w = (yday - 365 - (QDate::isLeapYear(year) ? 1 : 0) - wday + 10) / 7;
- if (w > 0) {
- ++year;
- week = w;
- }
- Q_ASSERT(week == 53 || week == 1);
- }
+ // This could be replaced by use of QIso8601Calendar, once we implement it.
+ // The Thursday of the same week determines our answer:
+ QDate thursday(addDays(4 - dayOfWeek()));
+ int year = thursday.year();
+ // Week n's Thurs's DOY has 1 <= DOY - 7*(n-1) < 8, so 0 <= DOY + 6 - 7*n < 7:
+ int week = (thursday.dayOfYear() + 6) / 7;
- if (yearNumber != 0)
+ if (yearNumber)
*yearNumber = year;
return week;
}
+static bool inDateTimeRange(qint64 jd, bool start)
+{
+ using Bounds = std::numeric_limits<qint64>;
+ if (jd < Bounds::min() + JULIAN_DAY_FOR_EPOCH)
+ return false;
+ jd -= JULIAN_DAY_FOR_EPOCH;
+ const qint64 maxDay = Bounds::max() / MSECS_PER_DAY;
+ const qint64 minDay = Bounds::min() / MSECS_PER_DAY - 1;
+ // (Divisions rounded towards zero, as MSECS_PER_DAY has factors other than two.)
+ // Range includes start of last day and end of first:
+ if (start)
+ return jd > minDay && jd <= maxDay;
+ return jd >= minDay && jd < maxDay;
+}
+
+static QDateTime toEarliest(const QDate &day, const QDateTime &form)
+{
+ const Qt::TimeSpec spec = form.timeSpec();
+ const int offset = (spec == Qt::OffsetFromUTC) ? form.offsetFromUtc() : 0;
+#if QT_CONFIG(timezone)
+ QTimeZone zone;
+ if (spec == Qt::TimeZone)
+ zone = form.timeZone();
+#endif
+ auto moment = [=](QTime time) {
+ switch (spec) {
+ case Qt::OffsetFromUTC: return QDateTime(day, time, spec, offset);
+#if QT_CONFIG(timezone)
+ case Qt::TimeZone: return QDateTime(day, time, zone);
+#endif
+ default: return QDateTime(day, time, spec);
+ }
+ };
+ // Longest routine time-zone transition is 2 hours:
+ QDateTime when = moment(QTime(2, 0));
+ if (!when.isValid()) {
+ // Noon should be safe ...
+ when = moment(QTime(12, 0));
+ if (!when.isValid()) {
+ // ... unless it's a 24-hour jump (moving the date-line)
+ when = moment(QTime(23, 59, 59, 999));
+ if (!when.isValid())
+ return QDateTime();
+ }
+ }
+ int high = when.time().msecsSinceStartOfDay() / 60000;
+ int low = 0;
+ // Binary chop to the right minute
+ while (high > low + 1) {
+ int mid = (high + low) / 2;
+ QDateTime probe = moment(QTime(mid / 60, mid % 60));
+ if (probe.isValid() && probe.date() == day) {
+ high = mid;
+ when = probe;
+ } else {
+ low = mid;
+ }
+ }
+ return when;
+}
+
+/*!
+ \since 5.14
+ \fn QDateTime QDate::startOfDay(Qt::TimeSpec spec, int offsetSeconds) const
+ \fn QDateTime QDate::startOfDay(const QTimeZone &zone) const
+
+ Returns the start-moment of the day. Usually, this shall be midnight at the
+ start of the day: however, if a time-zone transition causes the given date
+ to skip over that midnight (e.g. a DST spring-forward skipping from the end
+ of the previous day to 01:00 of the new day), the actual earliest time in
+ the day is returned. This can only arise when the start-moment is specified
+ in terms of a time-zone (by passing its QTimeZone as \a zone) or in terms of
+ local time (by passing Qt::LocalTime as \a spec; this is its default).
+
+ The \a offsetSeconds is ignored unless \a spec is Qt::OffsetFromUTC, when it
+ gives the implied zone's offset from UTC. As UTC and such zones have no
+ transitions, the start of the day is QTime(0, 0) in these cases.
+
+ In the rare case of a date that was entirely skipped (this happens when a
+ zone east of the international date-line switches to being west of it), the
+ return shall be invalid. Passing Qt::TimeZone as \a spec (instead of
+ passing a QTimeZone) or passing an invalid time-zone as \a zone will also
+ produce an invalid result, as shall dates that start outside the range
+ representable by QDateTime.
+
+ \sa endOfDay()
+*/
+QDateTime QDate::startOfDay(Qt::TimeSpec spec, int offsetSeconds) const
+{
+ if (!inDateTimeRange(jd, true))
+ return QDateTime();
+
+ switch (spec) {
+ case Qt::TimeZone: // should pass a QTimeZone instead of Qt::TimeZone
+ qWarning() << "Called QDate::startOfDay(Qt::TimeZone) on" << *this;
+ return QDateTime();
+ case Qt::OffsetFromUTC:
+ case Qt::UTC:
+ return QDateTime(*this, QTime(0, 0), spec, offsetSeconds);
+
+ case Qt::LocalTime:
+ if (offsetSeconds)
+ qWarning("Ignoring offset (%d seconds) passed with Qt::LocalTime", offsetSeconds);
+ break;
+ }
+ QDateTime when(*this, QTime(0, 0), spec);
+ if (!when.isValid())
+ when = toEarliest(*this, when);
+
+ return when.isValid() ? when : QDateTime();
+}
+
+#if QT_CONFIG(timezone)
+/*!
+ \overload
+ \since 5.14
+*/
+QDateTime QDate::startOfDay(const QTimeZone &zone) const
+{
+ if (!inDateTimeRange(jd, true) || !zone.isValid())
+ return QDateTime();
+
+ QDateTime when(*this, QTime(0, 0), zone);
+ if (when.isValid())
+ return when;
+
+ // The start of the day must have fallen in a spring-forward's gap; find the spring-forward:
+ if (zone.hasTransitions()) {
+ QTimeZone::OffsetData tran = zone.previousTransition(QDateTime(*this, QTime(23, 59, 59, 999), zone));
+ const QDateTime &at = tran.atUtc.toTimeZone(zone);
+ if (at.isValid() && at.date() == *this)
+ return at;
+ }
+
+ when = toEarliest(*this, when);
+ return when.isValid() ? when : QDateTime();
+}
+#endif // timezone
+
+static QDateTime toLatest(const QDate &day, const QDateTime &form)
+{
+ const Qt::TimeSpec spec = form.timeSpec();
+ const int offset = (spec == Qt::OffsetFromUTC) ? form.offsetFromUtc() : 0;
+#if QT_CONFIG(timezone)
+ QTimeZone zone;
+ if (spec == Qt::TimeZone)
+ zone = form.timeZone();
+#endif
+ auto moment = [=](QTime time) {
+ switch (spec) {
+ case Qt::OffsetFromUTC: return QDateTime(day, time, spec, offset);
+#if QT_CONFIG(timezone)
+ case Qt::TimeZone: return QDateTime(day, time, zone);
+#endif
+ default: return QDateTime(day, time, spec);
+ }
+ };
+ // Longest routine time-zone transition is 2 hours:
+ QDateTime when = moment(QTime(21, 59, 59, 999));
+ if (!when.isValid()) {
+ // Noon should be safe ...
+ when = moment(QTime(12, 0));
+ if (!when.isValid()) {
+ // ... unless it's a 24-hour jump (moving the date-line)
+ when = moment(QTime(0, 0));
+ if (!when.isValid())
+ return QDateTime();
+ }
+ }
+ int high = 24 * 60;
+ int low = when.time().msecsSinceStartOfDay() / 60000;
+ // Binary chop to the right minute
+ while (high > low + 1) {
+ int mid = (high + low) / 2;
+ QDateTime probe = moment(QTime(mid / 60, mid % 60, 59, 999));
+ if (probe.isValid() && probe.date() == day) {
+ low = mid;
+ when = probe;
+ } else {
+ high = mid;
+ }
+ }
+ return when;
+}
+
+/*!
+ \since 5.14
+ \fn QDateTime QDate::endOfDay(Qt::TimeSpec spec, int offsetSeconds) const
+ \fn QDateTime QDate::endOfDay(const QTimeZone &zone) const
+
+ Returns the end-moment of the day. Usually, this is one millisecond before
+ the midnight at the end of the day: however, if a time-zone transition
+ causes the given date to skip over that midnight (e.g. a DST spring-forward
+ skipping from just before 23:00 to the start of the next day), the actual
+ latest time in the day is returned. This can only arise when the
+ start-moment is specified in terms of a time-zone (by passing its QTimeZone
+ as \a zone) or in terms of local time (by passing Qt::LocalTime as \a spec;
+ this is its default).
+
+ The \a offsetSeconds is ignored unless \a spec is Qt::OffsetFromUTC, when it
+ gives the implied zone's offset from UTC. As UTC and such zones have no
+ transitions, the end of the day is QTime(23, 59, 59, 999) in these cases.
+
+ In the rare case of a date that was entirely skipped (this happens when a
+ zone east of the international date-line switches to being west of it), the
+ return shall be invalid. Passing Qt::TimeZone as \a spec (instead of
+ passing a QTimeZone) will also produce an invalid result, as shall dates
+ that end outside the range representable by QDateTime.
+
+ \sa startOfDay()
+*/
+QDateTime QDate::endOfDay(Qt::TimeSpec spec, int offsetSeconds) const
+{
+ if (!inDateTimeRange(jd, false))
+ return QDateTime();
+
+ switch (spec) {
+ case Qt::TimeZone: // should pass a QTimeZone instead of Qt::TimeZone
+ qWarning() << "Called QDate::endOfDay(Qt::TimeZone) on" << *this;
+ return QDateTime();
+ case Qt::UTC:
+ case Qt::OffsetFromUTC:
+ return QDateTime(*this, QTime(23, 59, 59, 999), spec, offsetSeconds);
+
+ case Qt::LocalTime:
+ if (offsetSeconds)
+ qWarning("Ignoring offset (%d seconds) passed with Qt::LocalTime", offsetSeconds);
+ break;
+ }
+ QDateTime when(*this, QTime(23, 59, 59, 999), spec);
+ if (!when.isValid())
+ when = toLatest(*this, when);
+ return when.isValid() ? when : QDateTime();
+}
+
+#if QT_CONFIG(timezone)
+/*!
+ \overload
+ \since 5.14
+*/
+QDateTime QDate::endOfDay(const QTimeZone &zone) const
+{
+ if (!inDateTimeRange(jd, false) || !zone.isValid())
+ return QDateTime();
+
+ QDateTime when(*this, QTime(23, 59, 59, 999), zone);
+ if (when.isValid())
+ return when;
+
+ // The end of the day must have fallen in a spring-forward's gap; find the spring-forward:
+ if (zone.hasTransitions()) {
+ QTimeZone::OffsetData tran = zone.nextTransition(QDateTime(*this, QTime(0, 0), zone));
+ const QDateTime &at = tran.atUtc.toTimeZone(zone);
+ if (at.isValid() && at.date() == *this)
+ return at;
+ }
+
+ when = toLatest(*this, when);
+ return when.isValid() ? when : QDateTime();
+}
+#endif // timezone
+
#if QT_DEPRECATED_SINCE(5, 11) && QT_CONFIG(textdate)
+
/*!
\since 4.5
\deprecated
@@ -651,9 +966,11 @@ QString QDate::shortMonthName(int month, QDate::MonthNameType type)
{
switch (type) {
case QDate::DateFormat:
- return QLocale::system().monthName(month, QLocale::ShortFormat);
+ return QCalendar().monthName(QLocale::system(), month,
+ QCalendar::Unspecified, QLocale::ShortFormat);
case QDate::StandaloneFormat:
- return QLocale::system().standaloneMonthName(month, QLocale::ShortFormat);
+ return QCalendar().standaloneMonthName(QLocale::system(), month,
+ QCalendar::Unspecified, QLocale::ShortFormat);
}
return QString();
}
@@ -694,9 +1011,11 @@ QString QDate::longMonthName(int month, MonthNameType type)
{
switch (type) {
case QDate::DateFormat:
- return QLocale::system().monthName(month, QLocale::LongFormat);
+ return QCalendar().monthName(QLocale::system(), month,
+ QCalendar::Unspecified, QLocale::LongFormat);
case QDate::StandaloneFormat:
- return QLocale::system().standaloneMonthName(month, QLocale::LongFormat);
+ return QCalendar().standaloneMonthName(QLocale::system(), month,
+ QCalendar::Unspecified, QLocale::LongFormat);
}
return QString();
}
@@ -781,24 +1100,32 @@ QString QDate::longDayName(int weekday, MonthNameType type)
#if QT_CONFIG(datestring)
#if QT_CONFIG(textdate)
+static QString toStringTextDate(QDate date, QCalendar cal)
+{
+ if (date.isValid()) {
+ const auto parts = cal.partsFromDate(date);
+ if (parts.isValid()) {
+ const QLatin1Char sp(' ');
+ return QLocale::system().dayName(cal.dayOfWeek(date), QLocale::ShortFormat) + sp
+ + cal.monthName(QLocale::system(), parts.month, parts.year, QLocale::ShortFormat)
+ + sp + QString::number(parts.day) + sp + QString::number(parts.year);
+ }
+ }
+ return QString();
+}
+
static QString toStringTextDate(QDate date)
{
- const ParsedDate pd = getDateFromJulianDay(date.toJulianDay());
- static const QLatin1Char sp(' ');
- return QLocale::system().dayName(date.dayOfWeek(), QLocale::ShortFormat) + sp
- + QLocale::system().monthName(pd.month, QLocale::ShortFormat) + sp
- + QString::number(pd.day) + sp
- + QString::number(pd.year);
+ return toStringTextDate(date, QCalendar());
}
#endif // textdate
-static QString toStringIsoDate(qint64 jd)
+static QString toStringIsoDate(const QDate &date)
{
- const ParsedDate pd = getDateFromJulianDay(jd);
- if (pd.year >= 0 && pd.year <= 9999)
- return QString::asprintf("%04d-%02d-%02d", pd.year, pd.month, pd.day);
- else
- return QString();
+ const auto parts = QCalendar().partsFromDate(date);
+ if (parts.isValid() && parts.year >= 0 && parts.year <= 9999)
+ return QString::asprintf("%04d-%02d-%02d", parts.year, parts.month, parts.day);
+ return QString();
}
/*!
@@ -863,7 +1190,7 @@ QString QDate::toString(Qt::DateFormat format) const
case Qt::DefaultLocaleLongDate:
return QLocale().toString(*this, QLocale::LongFormat);
case Qt::RFC2822Date:
- return QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy"));
+ return QLocale::c().toString(*this, u"dd MMM yyyy");
default:
#if QT_CONFIG(textdate)
case Qt::TextDate:
@@ -871,7 +1198,7 @@ QString QDate::toString(Qt::DateFormat format) const
#endif
case Qt::ISODate:
case Qt::ISODateWithMs:
- return toStringIsoDate(jd);
+ return toStringIsoDate(*this);
}
}
@@ -886,25 +1213,25 @@ QString QDate::toString(Qt::DateFormat format) const
\table
\header \li Expression \li Output
- \row \li d \li the day as number without a leading zero (1 to 31)
- \row \li dd \li the day as number with a leading zero (01 to 31)
+ \row \li d \li The day as a number without a leading zero (1 to 31)
+ \row \li dd \li The day as a number with a leading zero (01 to 31)
\row \li ddd
- \li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
+ \li The abbreviated localized day name (e.g. 'Mon' to 'Sun').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li dddd
- \li the long localized day name (e.g. 'Monday' to 'Sunday').
+ \li The long localized day name (e.g. 'Monday' to 'Sunday').
Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li M \li the month as number without a leading zero (1 to 12)
- \row \li MM \li the month as number with a leading zero (01 to 12)
+ \row \li M \li The month as a number without a leading zero (1 to 12)
+ \row \li MM \li The month as a number with a leading zero (01 to 12)
\row \li MMM
- \li the abbreviated localized month name (e.g. 'Jan' to 'Dec').
+ \li The abbreviated localized month name (e.g. 'Jan' to 'Dec').
Uses the system locale to localize the name, i.e. QLocale::system().
\row \li MMMM
- \li the long localized month name (e.g. 'January' to 'December').
+ \li The long localized month name (e.g. 'January' to 'December').
Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li yy \li the year as two digit number (00 to 99)
- \row \li yyyy \li the year as four digit number. If the year is negative,
- a minus sign is prepended in addition.
+ \row \li yy \li The year as a two digit number (00 to 99)
+ \row \li yyyy \li The year as a four digit number. If the year is negative,
+ a minus sign is prepended, making five characters.
\endtable
Any sequence of characters enclosed in single quotes will be included
@@ -945,6 +1272,47 @@ QString QDate::toString(const QString &format) const
}
#endif
+QString QDate::toString(Qt::DateFormat format, QCalendar cal) const
+{
+ if (!isValid())
+ return QString();
+
+ switch (format) {
+ case Qt::SystemLocaleDate:
+ case Qt::SystemLocaleShortDate:
+ return QLocale::system().toString(*this, QLocale::ShortFormat, cal);
+ case Qt::SystemLocaleLongDate:
+ return QLocale::system().toString(*this, QLocale::LongFormat, cal);
+ case Qt::LocaleDate:
+ case Qt::DefaultLocaleShortDate:
+ return QLocale().toString(*this, QLocale::ShortFormat, cal);
+ case Qt::DefaultLocaleLongDate:
+ return QLocale().toString(*this, QLocale::LongFormat, cal);
+ case Qt::RFC2822Date:
+ return QLocale::c().toString(*this, QStringView(u"dd MMM yyyy"), cal);
+ default:
+#ifndef QT_NO_TEXTDATE
+ case Qt::TextDate:
+ return toStringTextDate(*this, cal);
+#endif
+ case Qt::ISODate:
+ case Qt::ISODateWithMs:
+ return toStringIsoDate(*this);
+ }
+}
+
+QString QDate::toString(QStringView format, QCalendar cal) const
+{
+ return QLocale::system().toString(*this, format, cal); // QLocale::c() ### Qt6
+}
+
+#if QT_STRINGVIEW_LEVEL < 2
+QString QDate::toString(const QString &format, QCalendar cal) const
+{
+ return toString(qToStringViewIgnoringNull(format), cal);
+}
+#endif
+
#endif // datestring
/*!
@@ -964,21 +1332,36 @@ QString QDate::toString(const QString &format) const
/*!
\since 4.2
- Sets the date's \a year, \a month, and \a day. Returns \c true if
- the date is valid; otherwise returns \c false.
-
- If the specified date is invalid, the QDate object is set to be
- invalid.
+ Sets this to represent the date, in the Gregorian calendar, with the given
+ \a year, \a month and \a day numbers. Returns true if the resulting date is
+ valid, otherwise it sets this to represent an invalid date and returns
+ false.
- \sa isValid()
+ \sa isValid(), QCalendar::dateFromParts()
*/
bool QDate::setDate(int year, int month, int day)
{
- if (isValid(year, month, day))
- jd = julianDayFromDate(year, month, day);
- else
- jd = nullJd();
+ if (QGregorianCalendar::julianFromParts(year, month, day, &jd))
+ return true;
+
+ jd = nullJd();
+ return false;
+}
+/*!
+ \since 5.14
+
+ Sets this to represent the date, in the given calendar \a cal, with the
+ given \a year, \a month and \a day numbers. Returns true if the resulting
+ date is valid, otherwise it sets this to represent an invalid date and
+ returns false.
+
+ \sa isValid(), QCalendar::dateFromParts()
+*/
+
+bool QDate::setDate(int year, int month, int day, QCalendar cal)
+{
+ *this = QDate(year, month, day, cal);
return isValid();
}
@@ -992,20 +1375,21 @@ bool QDate::setDate(int year, int month, int day)
\note In Qt versions prior to 5.7, this function is marked as non-\c{const}.
- \sa year(), month(), day(), isValid()
+ \sa year(), month(), day(), isValid(), QCalendar::partsFromDate()
*/
void QDate::getDate(int *year, int *month, int *day) const
{
- ParsedDate pd = { 0, 0, 0 };
+ QCalendar::YearMonthDay parts; // invalid by default
if (isValid())
- pd = getDateFromJulianDay(jd);
+ parts = QGregorianCalendar::partsFromJulian(jd);
+ const bool ok = parts.isValid();
if (year)
- *year = pd.year;
+ *year = ok ? parts.year : 0;
if (month)
- *month = pd.month;
+ *month = ok ? parts.month : 0;
if (day)
- *day = pd.day;
+ *day = ok ? parts.day : 0;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@@ -1043,96 +1427,129 @@ QDate QDate::addDays(qint64 ndays) const
Returns a QDate object containing a date \a nmonths later than the
date of this object (or earlier if \a nmonths is negative).
- \note If the ending day/month combination does not exist in the
- resulting month/year, this function will return a date that is the
- latest valid date.
+ Uses \a cal as calendar, if supplied, else the Gregorian calendar.
+
+ \note If the ending day/month combination does not exist in the resulting
+ month/year, this function will return a date that is the latest valid date
+ in the selected month.
\sa addDays(), addYears()
*/
-QDate QDate::addMonths(int nmonths) const
+QDate QDate::addMonths(int nmonths, QCalendar cal) const
{
if (!isValid())
return QDate();
- if (!nmonths)
+
+ if (nmonths == 0)
return *this;
- int old_y, y, m, d;
- {
- const ParsedDate pd = getDateFromJulianDay(jd);
- y = pd.year;
- m = pd.month;
- d = pd.day;
+ auto parts = cal.partsFromDate(*this);
+
+ if (!parts.isValid())
+ return QDate();
+ Q_ASSERT(parts.year || cal.hasYearZero());
+
+ parts.month += nmonths;
+ while (parts.month <= 0) {
+ if (--parts.year || cal.hasYearZero())
+ parts.month += cal.monthsInYear(parts.year);
}
- old_y = y;
-
- bool increasing = nmonths > 0;
-
- while (nmonths != 0) {
- if (nmonths < 0 && nmonths + 12 <= 0) {
- y--;
- nmonths+=12;
- } else if (nmonths < 0) {
- m+= nmonths;
- nmonths = 0;
- if (m <= 0) {
- --y;
- m += 12;
- }
- } else if (nmonths - 12 >= 0) {
- y++;
- nmonths -= 12;
- } else if (m == 12) {
- y++;
- m = 0;
- } else {
- m += nmonths;
- nmonths = 0;
- if (m > 12) {
- ++y;
- m -= 12;
- }
- }
+ int count = cal.monthsInYear(parts.year);
+ while (parts.month > count) {
+ parts.month -= count;
+ count = (++parts.year || cal.hasYearZero()) ? cal.monthsInYear(parts.year) : 0;
}
- // was there a sign change?
- if ((old_y > 0 && y <= 0) ||
- (old_y < 0 && y >= 0))
- // yes, adjust the date by +1 or -1 years
- y += increasing ? +1 : -1;
+ return fixedDate(std::move(parts), cal);
+}
+
+/*!
+ \overload
+*/
+
+QDate QDate::addMonths(int nmonths) const
+{
+ if (isNull())
+ return QDate();
+
+ if (nmonths == 0)
+ return *this;
+
+ auto parts = QGregorianCalendar::partsFromJulian(jd);
+
+ if (!parts.isValid())
+ return QDate();
+ Q_ASSERT(parts.year);
+
+ parts.month += nmonths;
+ while (parts.month <= 0) {
+ if (--parts.year) // skip over year 0
+ parts.month += 12;
+ }
+ while (parts.month > 12) {
+ parts.month -= 12;
+ if (!++parts.year) // skip over year 0
+ ++parts.year;
+ }
- return fixedDate(y, m, d);
+ return fixedDate(std::move(parts));
}
/*!
Returns a QDate object containing a date \a nyears later than the
date of this object (or earlier if \a nyears is negative).
- \note If the ending day/month combination does not exist in the
- resulting year (i.e., if the date was Feb 29 and the final year is
- not a leap year), this function will return a date that is the
- latest valid date (that is, Feb 28).
+ Uses \a cal as calendar, if supplied, else the Gregorian calendar.
+
+ \note If the ending day/month combination does not exist in the resulting
+ year (e.g., for the Gregorian calendar, if the date was Feb 29 and the final
+ year is not a leap year), this function will return a date that is the
+ latest valid date in the given month (in the example, Feb 28).
\sa addDays(), addMonths()
*/
-QDate QDate::addYears(int nyears) const
+QDate QDate::addYears(int nyears, QCalendar cal) const
{
if (!isValid())
return QDate();
- ParsedDate pd = getDateFromJulianDay(jd);
+ auto parts = cal.partsFromDate(*this);
+ if (!parts.isValid())
+ return QDate();
- int old_y = pd.year;
- pd.year += nyears;
+ int old_y = parts.year;
+ parts.year += nyears;
- // was there a sign change?
- if ((old_y > 0 && pd.year <= 0) ||
- (old_y < 0 && pd.year >= 0))
- // yes, adjust the date by +1 or -1 years
- pd.year += nyears > 0 ? +1 : -1;
+ // If we just crossed (or hit) a missing year zero, adjust year by +/- 1:
+ if (!cal.hasYearZero() && ((old_y > 0) != (parts.year > 0) || !parts.year))
+ parts.year += nyears > 0 ? +1 : -1;
- return fixedDate(pd.year, pd.month, pd.day);
+ return fixedDate(std::move(parts), cal);
+}
+
+/*!
+ \overload
+*/
+
+QDate QDate::addYears(int nyears) const
+{
+ if (isNull())
+ return QDate();
+
+ auto parts = QGregorianCalendar::partsFromJulian(jd);
+ if (!parts.isValid())
+ return QDate();
+
+ int old_y = parts.year;
+ parts.year += nyears;
+
+ // If we just crossed (or hit) a missing year zero, adjust year by +/- 1:
+ if ((old_y > 0) != (parts.year > 0) || !parts.year)
+ parts.year += nyears > 0 ? +1 : -1;
+
+ return fixedDate(std::move(parts));
}
/*!
@@ -1209,8 +1626,6 @@ qint64 QDate::daysTo(const QDate &d) const
#if QT_CONFIG(datestring)
/*!
- \fn QDate QDate::fromString(const QString &string, Qt::DateFormat format)
-
Returns the QDate represented by the \a string, using the
\a format given, or an invalid date if the string cannot be
parsed.
@@ -1221,7 +1636,8 @@ qint64 QDate::daysTo(const QDate &d) const
\sa toString(), QLocale::toDate()
*/
-QDate QDate::fromString(const QString& string, Qt::DateFormat format)
+
+QDate QDate::fromString(const QString &string, Qt::DateFormat format)
{
if (string.isEmpty())
return QDate();
@@ -1247,19 +1663,17 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
if (parts.count() != 4)
return QDate();
- QStringRef monthName = parts.at(1);
- const int month = fromShortMonthName(monthName);
- if (month == -1) {
- // Month name matches neither English nor other localised name.
- return QDate();
- }
-
bool ok = false;
int year = parts.at(3).toInt(&ok);
- if (!ok)
+ int day = ok ? parts.at(2).toInt(&ok) : 0;
+ if (!ok || !day)
+ return QDate();
+
+ const int month = fromShortMonthName(parts.at(1), year);
+ if (month == -1) // Month name matches no English or localised name.
return QDate();
- return QDate(year, month, parts.at(2).toInt());
+ return QDate(year, month, day);
}
#endif // textdate
case Qt::ISODate: {
@@ -1278,11 +1692,13 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
}
/*!
- \fn QDate QDate::fromString(const QString &string, const QString &format)
-
Returns the QDate represented by the \a string, using the \a
format given, or an invalid date if the string cannot be parsed.
+ Uses \a cal as calendar if supplied, else the Gregorian calendar. Ranges of
+ values in the format descriptions below are for the latter; they may be
+ different for other calendars.
+
These expressions may be used for the format:
\table
@@ -1303,11 +1719,15 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
\row \li MMMM
\li The long localized month name (e.g. 'January' to 'December').
Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li yy \li The year as two digit number (00 to 99)
- \row \li yyyy \li The year as four digit number. If the year is negative,
- a minus sign is prepended in addition.
+ \row \li yy \li The year as a two digit number (00 to 99)
+ \row \li yyyy \li The year as a four digit number, possibly plus a leading
+ minus sign for negative years.
\endtable
+ \note Unlike the other version of this function, day and month names must
+ be given in the user's local language. It is only possible to use the English
+ names if the user's language is English.
+
All other input characters will be treated as text. Any sequence
of characters that are enclosed in single quotes will also be
treated as text and will not be used as an expression. For example:
@@ -1342,58 +1762,61 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format)
QLocale::toDate()
*/
-QDate QDate::fromString(const QString &string, const QString &format)
+QDate QDate::fromString(const QString &string, const QString &format, QCalendar cal)
{
QDate date;
#if QT_CONFIG(datetimeparser)
- QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString);
+ QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString, cal);
// dt.setDefaultLocale(QLocale::c()); ### Qt 6
if (dt.parseFormat(format))
dt.fromString(string, &date, 0);
#else
Q_UNUSED(string);
Q_UNUSED(format);
+ Q_UNUSED(cal);
#endif
return date;
}
+
+/*!
+ \overload
+*/
+
+QDate QDate::fromString(const QString &string, const QString &format)
+{
+ return fromString(string, format, QCalendar());
+}
#endif // datestring
/*!
\overload
- Returns \c true if the specified date (\a year, \a month, and \a
- day) is valid; otherwise returns \c false.
+ Returns \c true if the specified date (\a year, \a month, and \a day) is
+ valid in the Gregorian calendar; otherwise returns \c false.
Example:
\snippet code/src_corelib_tools_qdatetime.cpp 4
- \sa isNull(), setDate()
+ \sa isNull(), setDate(), QCalendar::isDateValid()
*/
bool QDate::isValid(int year, int month, int day)
{
- // there is no year 0 in the Gregorian calendar
- if (year == 0)
- return false;
-
- return (day > 0 && month > 0 && month <= 12) &&
- (day <= monthDays[month] || (day == 29 && month == 2 && isLeapYear(year)));
+ return QGregorianCalendar::validParts(year, month, day);
}
/*!
\fn bool QDate::isLeapYear(int year)
- Returns \c true if the specified \a year is a leap year; otherwise
- returns \c false.
+ Returns \c true if the specified \a year is a leap year in the Gregorian
+ calendar; otherwise returns \c false.
+
+ \sa QCalendar::isLeapYear()
*/
bool QDate::isLeapYear(int y)
{
- // No year 0 in Gregorian calendar, so -1, -5, -9 etc are leap years
- if ( y < 1)
- ++y;
-
- return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0;
+ return QGregorianCalendar::leapTest(y);
}
/*! \fn static QDate QDate::fromJulianDay(qint64 jd)
@@ -1422,12 +1845,10 @@ bool QDate::isLeapYear(int y)
\brief The QTime class provides clock time functions.
- A QTime object contains a clock time, which it can express as the
- numbers of hours, minutes, seconds, and milliseconds since
- midnight. It can read the current time from the system clock and
- measure a span of elapsed time. It provides functions for
- comparing times and for manipulating a time by adding a number of
- milliseconds.
+ A QTime object contains a clock time, which it can express as the numbers of
+ hours, minutes, seconds, and milliseconds since midnight. It provides
+ functions for comparing times and for manipulating a time by adding a number
+ of milliseconds.
QTime uses the 24-hour clock format; it has no concept of AM/PM.
Unlike QDateTime, QTime knows nothing about time zones or
@@ -1452,18 +1873,15 @@ bool QDate::isLeapYear(int y)
objects; an earlier time is considered smaller than a later one;
if A.msecsTo(B) is positive, then A < B.
- QTime can be used to measure a span of elapsed time using the
- start(), restart(), and elapsed() functions.
-
\sa QDate, QDateTime
*/
/*!
\fn QTime::QTime()
- Constructs a null time object. A null time can be a QTime(0, 0, 0, 0)
- (i.e., midnight) object, except that isNull() returns \c true and isValid()
- returns \c false.
+ Constructs a null time object. For a null time, isNull() returns \c true and
+ isValid() returns \c false. If you need a zero time, use QTime(0, 0). For
+ the start of a day, see QDate::startOfDay().
\sa isNull(), isValid()
*/
@@ -1649,30 +2067,30 @@ QString QTime::toString(Qt::DateFormat format) const
\table
\header \li Expression \li Output
\row \li h
- \li the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
+ \li The hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
\row \li hh
- \li the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
+ \li The hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
\row \li H
- \li the hour without a leading zero (0 to 23, even with AM/PM display)
+ \li The hour without a leading zero (0 to 23, even with AM/PM display)
\row \li HH
- \li the hour with a leading zero (00 to 23, even with AM/PM display)
- \row \li m \li the minute without a leading zero (0 to 59)
- \row \li mm \li the minute with a leading zero (00 to 59)
- \row \li s \li the whole second, without any leading zero (0 to 59)
- \row \li ss \li the whole second, with a leading zero where applicable (00 to 59)
- \row \li z \li the fractional part of the second, to go after a decimal
+ \li The hour with a leading zero (00 to 23, even with AM/PM display)
+ \row \li m \li The minute without a leading zero (0 to 59)
+ \row \li mm \li The minute with a leading zero (00 to 59)
+ \row \li s \li The whole second, without any leading zero (0 to 59)
+ \row \li ss \li The whole second, with a leading zero where applicable (00 to 59)
+ \row \li z \li The fractional part of the second, to go after a decimal
point, without trailing zeroes (0 to 999). Thus "\c{s.z}"
reports the seconds to full available (millisecond) precision
without trailing zeroes.
- \row \li zzz \li the fractional part of the second, to millisecond
+ \row \li zzz \li The fractional part of the second, to millisecond
precision, including trailing zeroes where applicable (000 to 999).
\row \li AP or A
- \li use AM/PM display. \e A/AP will be replaced by either
- QLocale::amText() or QLocale::pmText().
+ \li Use AM/PM display. \e A/AP will be replaced by an upper-case
+ version of either QLocale::amText() or QLocale::pmText().
\row \li ap or a
- \li use am/pm display. \e a/ap will be replaced by a lower-case version of
- QLocale::amText() or QLocale::pmText().
- \row \li t \li the timezone (for example "CEST")
+ \li Use am/pm display. \e a/ap will be replaced by a lower-case version
+ of either QLocale::amText() or QLocale::pmText().
+ \row \li t \li The timezone (for example "CEST")
\endtable
Any sequence of characters enclosed in single quotes will be included
@@ -1977,8 +2395,6 @@ static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format,
}
/*!
- \fn QTime QTime::fromString(const QString &string, Qt::DateFormat format)
-
Returns the time represented in the \a string as a QTime using the
\a format given, or an invalid time if this is not possible.
@@ -1990,7 +2406,7 @@ static QTime fromIsoTimeString(const QStringRef &string, Qt::DateFormat format,
\sa toString(), QLocale::toTime()
*/
-QTime QTime::fromString(const QString& string, Qt::DateFormat format)
+QTime QTime::fromString(const QString &string, Qt::DateFormat format)
{
if (string.isEmpty())
return QTime();
@@ -2012,13 +2428,11 @@ QTime QTime::fromString(const QString& string, Qt::DateFormat format)
case Qt::ISODateWithMs:
case Qt::TextDate:
default:
- return fromIsoTimeString(QStringRef(&string), format, 0);
+ return fromIsoTimeString(QStringRef(&string), format, nullptr);
}
}
/*!
- \fn QTime QTime::fromString(const QString &string, const QString &format)
-
Returns the QTime represented by the \a string, using the \a
format given, or an invalid time if the string cannot be parsed.
@@ -2027,23 +2441,30 @@ QTime QTime::fromString(const QString& string, Qt::DateFormat format)
\table
\header \li Expression \li Output
\row \li h
- \li the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
+ \li The hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
\row \li hh
- \li the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
- \row \li m \li the minute without a leading zero (0 to 59)
- \row \li mm \li the minute with a leading zero (00 to 59)
- \row \li s \li the whole second, without any leading zero (0 to 59)
- \row \li ss \li the whole second, with a leading zero where applicable (00 to 59)
- \row \li z \li the fractional part of the second, to go after a decimal
+ \li The hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
+ \row \li H
+ \li The hour without a leading zero (0 to 23, even with AM/PM display)
+ \row \li HH
+ \li The hour with a leading zero (00 to 23, even with AM/PM display)
+ \row \li m \li The minute without a leading zero (0 to 59)
+ \row \li mm \li The minute with a leading zero (00 to 59)
+ \row \li s \li The whole second, without any leading zero (0 to 59)
+ \row \li ss \li The whole second, with a leading zero where applicable (00 to 59)
+ \row \li z \li The fractional part of the second, to go after a decimal
point, without trailing zeroes (0 to 999). Thus "\c{s.z}"
reports the seconds to full available (millisecond) precision
without trailing zeroes.
- \row \li zzz \li the fractional part of the second, to millisecond
+ \row \li zzz \li The fractional part of the second, to millisecond
precision, including trailing zeroes where applicable (000 to 999).
- \row \li AP
- \li interpret as an AM/PM time. \e AP must be either "AM" or "PM".
- \row \li ap
- \li Interpret as an AM/PM time. \e ap must be either "am" or "pm".
+ \row \li AP or A
+ \li Interpret as an AM/PM time. \e A/AP will match an upper-case
+ version of either QLocale::amText() or QLocale::pmText().
+ \row \li ap or a
+ \li Interpret as an am/pm time. \e a/ap will match a lower-case version
+ of either QLocale::amText() or QLocale::pmText().
+ \row \li t \li the timezone (for example "CEST")
\endtable
All other input characters will be treated as text. Any sequence
@@ -2075,7 +2496,7 @@ QTime QTime::fromString(const QString &string, const QString &format)
{
QTime time;
#if QT_CONFIG(datetimeparser)
- QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString);
+ QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString, QCalendar());
// dt.setDefaultLocale(QLocale::c()); ### Qt 6
if (dt.parseFormat(format))
dt.fromString(string, 0, &time);
@@ -2108,7 +2529,7 @@ bool QTime::isValid(int h, int m, int s, int ms)
return (uint)h < 24 && (uint)m < 60 && (uint)s < 60 && (uint)ms < 1000;
}
-
+#if QT_DEPRECATED_SINCE(5, 14) // ### Qt 6: remove
/*!
Sets this time to the current time. This is practical for timing:
@@ -2177,6 +2598,7 @@ int QTime::elapsed() const
n += 86400 * 1000;
return n;
}
+#endif // Use QElapsedTimer instead !
/*****************************************************************************
QDateTime static helper functions
@@ -2212,7 +2634,7 @@ static int qt_timezone()
// - It also takes DST into account, so we need to adjust it to always
// get the Standard Time offset.
return -t.tm_gmtoff + (t.tm_isdst ? (long)SECS_PER_HOUR : 0L);
-#elif defined(Q_OS_INTEGRITY)
+#elif defined(Q_OS_INTEGRITY) || defined(Q_OS_RTEMS)
return 0;
#else
return timezone;
@@ -2260,7 +2682,7 @@ int QDateTimeParser::startsWithLocalTimeZone(const QStringRef name)
// then null date/time will be returned, you should adjust the date first if
// you need a guaranteed result.
static qint64 qt_mktime(QDate *date, QTime *time, QDateTimePrivate::DaylightStatus *daylightStatus,
- QString *abbreviation, bool *ok = 0)
+ QString *abbreviation, bool *ok = nullptr)
{
const qint64 msec = time->msec();
int yy, mm, dd;
@@ -2349,7 +2771,7 @@ static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localT
#if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
// Use the reentrant version of localtime() where available
// as is thread-safe and doesn't use a shared static data area
- tm *res = 0;
+ tm *res = nullptr;
res = localtime_r(&secsSinceEpoch, &local);
if (res)
valid = true;
@@ -2359,7 +2781,7 @@ static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localT
#else
// Returns shared static data which may be overwritten at any time
// So copy the result asap
- tm *res = 0;
+ tm *res = nullptr;
res = localtime(&secsSinceEpoch);
if (res) {
local = *res;
@@ -2393,8 +2815,8 @@ static void msecsToTime(qint64 msecs, QDate *date, QTime *time)
qint64 jd = JULIAN_DAY_FOR_EPOCH;
qint64 ds = 0;
- if (qAbs(msecs) >= MSECS_PER_DAY) {
- jd += (msecs / MSECS_PER_DAY);
+ if (msecs >= MSECS_PER_DAY || msecs <= -MSECS_PER_DAY) {
+ jd += msecs / MSECS_PER_DAY;
msecs %= MSECS_PER_DAY;
}
@@ -2422,7 +2844,7 @@ static qint64 timeToMSecs(const QDate &date, const QTime &time)
// Convert an MSecs Since Epoch into Local Time
static bool epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTime *localTime,
- QDateTimePrivate::DaylightStatus *daylightStatus = 0)
+ QDateTimePrivate::DaylightStatus *daylightStatus = nullptr)
{
if (msecs < 0) {
// Docs state any LocalTime before 1970-01-01 will *not* have any Daylight Time applied
@@ -2462,8 +2884,8 @@ static bool epochMSecsToLocalTime(qint64 msecs, QDate *localDate, QTime *localTi
// values from mktime for the adjusted local date and time.
static qint64 localMSecsToEpochMSecs(qint64 localMsecs,
QDateTimePrivate::DaylightStatus *daylightStatus,
- QDate *localDate = 0, QTime *localTime = 0,
- QString *abbreviation = 0)
+ QDate *localDate = nullptr, QTime *localTime = nullptr,
+ QString *abbreviation = nullptr)
{
QDate dt;
QTime tm;
@@ -2766,7 +3188,7 @@ static void setDateTime(QDateTimeData &d, const QDate &date, const QTime &time)
if (!useTime.isValid() && date.isValid())
useTime = QTime::fromMSecsSinceStartOfDay(0);
- QDateTimePrivate::StatusFlags newStatus = 0;
+ QDateTimePrivate::StatusFlags newStatus = { };
// Set date value and status
qint64 days = 0;
@@ -2844,7 +3266,7 @@ inline QDateTime::Data::Data(Qt::TimeSpec spec)
// the structure is too small, we need to detach
d = new QDateTimePrivate;
d->ref.ref();
- d->m_status = mergeSpec(0, spec);
+ d->m_status = mergeSpec(nullptr, spec);
}
}
@@ -2929,13 +3351,13 @@ inline void QDateTime::Data::detach()
x->m_status = QDateTimePrivate::StatusFlag(data.status & ~QDateTimePrivate::ShortData);
x->m_msecs = data.msecs;
} else {
- if (d->ref.load() == 1)
+ if (d->ref.loadRelaxed() == 1)
return;
x = new QDateTimePrivate(*d);
}
- x->ref.store(1);
+ x->ref.storeRelaxed(1);
if (!wasShort && !d->ref.deref())
delete d;
d = x;
@@ -2951,7 +3373,7 @@ inline QDateTimePrivate *QDateTime::Data::operator->()
{
// should we attempt to detach here?
Q_ASSERT(!isShort());
- Q_ASSERT(d->ref.load() == 1);
+ Q_ASSERT(d->ref.loadRelaxed() == 1);
return d;
}
@@ -3021,15 +3443,15 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
datetime by adding a number of seconds, days, months, or years.
QDateTime can describe datetimes with respect to \l{Qt::LocalTime}{local
- time}, to \l{Qt::UTC}{UTC}, to a specified \l{Qt::OffsetFromUTC}{offset
- from UTC} or to a specified \l{Qt::TimeZone}{time zone}, in conjunction
- with the QTimeZone class. For example, a time zone of "Europe/Berlin" will
- apply the daylight-saving rules as used in Germany since 1970. In contrast,
- an offset from UTC of +3600 seconds is one hour ahead of UTC (usually
- written in ISO standard notation as "UTC+01:00"), with no daylight-saving
- offset or changes. When using either local time or a specified time zone,
- time-zone transitions such as the starts and ends of daylight-saving time
- (DST) are taken into account. The choice of system used to represent a
+ time}, to \l{Qt::UTC}{UTC}, to a specified \l{Qt::OffsetFromUTC}{offset from
+ UTC} or to a specified \l{Qt::TimeZone}{time zone}, in conjunction with the
+ QTimeZone class. For example, a time zone of "Europe/Berlin" will apply the
+ daylight-saving rules as used in Germany since 1970. In contrast, an offset
+ from UTC of +3600 seconds is one hour ahead of UTC (usually written in ISO
+ standard notation as "UTC+01:00"), with no daylight-saving offset or
+ changes. When using either local time or a specified time zone, time-zone
+ transitions such as the starts and ends of daylight-saving time (DST; but
+ see below) are taken into account. The choice of system used to represent a
datetime is described as its "timespec".
A QDateTime object is typically created either by giving a date and time
@@ -3117,11 +3539,13 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
The range of valid dates taking DST into account is 1970-01-01 to the
present, and rules are in place for handling DST correctly until 2037-12-31,
- but these could change. For dates falling outside that range, QDateTime
- makes a \e{best guess} using the rules for year 1970 or 2037, but we can't
- guarantee accuracy. This means QDateTime doesn't take into account changes
- in a time zone before 1970, even if the system's time zone database provides
- that information.
+ but these could change. For dates after 2037, QDateTime makes a \e{best
+ guess} using the rules for year 2037, but we can't guarantee accuracy;
+ indeed, for \e{any} future date, the time-zone may change its rules before
+ that date comes around. For dates before 1970, QDateTime doesn't take DST
+ changes into account, even if the system's time zone database provides that
+ information, although it does take into account changes to the time-zone's
+ standard offset, where this information is available.
\section2 Offsets From UTC
@@ -3135,12 +3559,32 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
*/
/*!
+ \since 5.14
+ \enum QDateTime::YearRange
+
+ This enumerated type describes the range of years (in the Gregorian
+ calendar) representable by QDateTime:
+
+ \value First The later parts of this year are representable
+ \value Last The earlier parts of this year are representable
+
+ All dates strictly between these two years are also representable.
+ Note, however, that the Gregorian Calendar has no year zero.
+
+ \note QDate can describe dates in a wider range of years. For most
+ purposes, this makes little difference, as the range of years that QDateTime
+ can support reaches 292 million years either side of 1970.
+
+ \sa isValid(), QDate
+*/
+
+/*!
Constructs a null datetime (i.e. null date and null time). A null
datetime is invalid, since the date is invalid.
\sa isValid()
*/
-QDateTime::QDateTime() Q_DECL_NOEXCEPT_EXPR(Data::CanBeSmall)
+QDateTime::QDateTime() noexcept(Data::CanBeSmall)
{
}
@@ -3151,7 +3595,7 @@ QDateTime::QDateTime() Q_DECL_NOEXCEPT_EXPR(Data::CanBeSmall)
*/
QDateTime::QDateTime(const QDate &date)
- : d(QDateTimePrivate::create(date, QTime(0, 0, 0), Qt::LocalTime, 0))
+ : d(QDateTimePrivate::create(date, QTime(0, 0), Qt::LocalTime, 0))
{
}
@@ -3219,7 +3663,7 @@ QDateTime::QDateTime(const QDate &date, const QTime &time, const QTimeZone &time
/*!
Constructs a copy of the \a other datetime.
*/
-QDateTime::QDateTime(const QDateTime &other) Q_DECL_NOTHROW
+QDateTime::QDateTime(const QDateTime &other) noexcept
: d(other.d)
{
}
@@ -3229,7 +3673,7 @@ QDateTime::QDateTime(const QDateTime &other) Q_DECL_NOTHROW
Moves the content of the temporary \a other datetime to this object and
leaves \a other in an unspecified (but proper) state.
*/
-QDateTime::QDateTime(QDateTime &&other) Q_DECL_NOTHROW
+QDateTime::QDateTime(QDateTime &&other) noexcept
: d(std::move(other.d))
{
}
@@ -3246,7 +3690,7 @@ QDateTime::~QDateTime()
copy.
*/
-QDateTime &QDateTime::operator=(const QDateTime &other) Q_DECL_NOTHROW
+QDateTime &QDateTime::operator=(const QDateTime &other) noexcept
{
d = other.d;
return *this;
@@ -3282,7 +3726,7 @@ bool QDateTime::isNull() const
hour, i.e. if the transition is at 2am and the clock goes forward to 3am
then the time from 02:00:00 to 02:59:59.999 is considered to be invalid.
- \sa QDate::isValid(), QTime::isValid()
+ \sa QDateTime::YearRange, QDate::isValid(), QTime::isValid()
*/
bool QDateTime::isValid() const
@@ -3303,7 +3747,7 @@ QDate QDateTime::date() const
if (!status.testFlag(QDateTimePrivate::ValidDate))
return QDate();
QDate dt;
- msecsToTime(getMSecs(d), &dt, 0);
+ msecsToTime(getMSecs(d), &dt, nullptr);
return dt;
}
@@ -3319,7 +3763,7 @@ QTime QDateTime::time() const
if (!status.testFlag(QDateTimePrivate::ValidTime))
return QTime();
QTime tm;
- msecsToTime(getMSecs(d), 0, &tm);
+ msecsToTime(getMSecs(d), nullptr, &tm);
return tm;
}
@@ -3367,17 +3811,22 @@ QTimeZone QDateTime::timeZone() const
/*!
\since 5.2
- Returns the current Offset From UTC in seconds.
-
- If the timeSpec() is Qt::OffsetFromUTC this will be the value originally set.
+ Returns this date-time's Offset From UTC in seconds.
- If the timeSpec() is Qt::TimeZone this will be the offset effective in the
- Time Zone including any Daylight-Saving Offset.
-
- If the timeSpec() is Qt::LocalTime this will be the difference between the
- Local Time and UTC including any Daylight-Saving Offset.
+ The result depends on timeSpec():
+ \list
+ \li \c Qt::UTC The offset is 0.
+ \li \c Qt::OffsetFromUTC The offset is the value originally set.
+ \li \c Qt::LocalTime The local time's offset from UTC is returned.
+ \li \c Qt::TimeZone The offset used by the time-zone is returned.
+ \endlist
- If the timeSpec() is Qt::UTC this will be 0.
+ For the last two, the offset at this date and time will be returned, taking
+ account of Daylight-Saving Offset unless the date precedes the start of
+ 1970. The offset is the difference between the local time or time in the
+ given time-zone and UTC time; it is positive in time-zones ahead of UTC
+ (East of The Prime Meridian), negative for those behind UTC (West of The
+ Prime Meridian).
\sa setOffsetFromUtc()
*/
@@ -3423,6 +3872,9 @@ int QDateTime::offsetFromUtc() const
QString QDateTime::timeZoneAbbreviation() const
{
+ if (!isValid())
+ return QString();
+
switch (getSpec(d)) {
case Qt::UTC:
return QLatin1String("UTC");
@@ -3437,7 +3889,7 @@ QString QDateTime::timeZoneAbbreviation() const
case Qt::LocalTime: {
QString abbrev;
auto status = extractDaylightStatus(getStatus(d));
- localMSecsToEpochMSecs(getMSecs(d), &status, 0, 0, &abbrev);
+ localMSecsToEpochMSecs(getMSecs(d), &status, nullptr, nullptr, &abbrev);
return abbrev;
}
}
@@ -3457,6 +3909,9 @@ QString QDateTime::timeZoneAbbreviation() const
bool QDateTime::isDaylightTime() const
{
+ if (!isValid())
+ return false;
+
switch (getSpec(d)) {
case Qt::UTC:
case Qt::OffsetFromUTC:
@@ -3853,7 +4308,7 @@ QString QDateTime::toString(Qt::DateFormat format) const
case Qt::DefaultLocaleLongDate:
return QLocale().toString(*this, QLocale::LongFormat);
case Qt::RFC2822Date: {
- buf = QLocale::c().toString(*this, QStringViewLiteral("dd MMM yyyy hh:mm:ss "));
+ buf = QLocale::c().toString(*this, u"dd MMM yyyy hh:mm:ss ");
buf += toOffsetString(Qt::TextDate, offsetFromUtc());
return buf;
}
@@ -3914,61 +4369,9 @@ QString QDateTime::toString(Qt::DateFormat format) const
\fn QString QDateTime::toString(const QString &format) const
\fn QString QDateTime::toString(QStringView format) const
- Returns the datetime as a string. The \a format parameter
- determines the format of the result string.
-
- These expressions may be used for the date:
-
- \table
- \header \li Expression \li Output
- \row \li d \li the day as number without a leading zero (1 to 31)
- \row \li dd \li the day as number with a leading zero (01 to 31)
- \row \li ddd
- \li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
- Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li dddd
- \li the long localized day name (e.g. 'Monday' to 'Sunday').
- Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li M \li the month as number without a leading zero (1-12)
- \row \li MM \li the month as number with a leading zero (01-12)
- \row \li MMM
- \li the abbreviated localized month name (e.g. 'Jan' to 'Dec').
- Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li MMMM
- \li the long localized month name (e.g. 'January' to 'December').
- Uses the system locale to localize the name, i.e. QLocale::system().
- \row \li yy \li the year as two digit number (00-99)
- \row \li yyyy \li the year as four digit number
- \endtable
-
- These expressions may be used for the time:
-
- \table
- \header \li Expression \li Output
- \row \li h
- \li the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
- \row \li hh
- \li the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
- \row \li H
- \li the hour without a leading zero (0 to 23, even with AM/PM display)
- \row \li HH
- \li the hour with a leading zero (00 to 23, even with AM/PM display)
- \row \li m \li the minute without a leading zero (0 to 59)
- \row \li mm \li the minute with a leading zero (00 to 59)
- \row \li s \li the whole second without a leading zero (0 to 59)
- \row \li ss \li the whole second with a leading zero where applicable (00 to 59)
- \row \li z \li the fractional part of the second, to go after a decimal
- point, without trailing zeroes (0 to 999). Thus "\c{s.z}"
- reports the seconds to full available (millisecond) precision
- without trailing zeroes.
- \row \li zzz \li the fractional part of the second, to millisecond
- precision, including trailing zeroes where applicable (000 to 999).
- \row \li AP or A
- \li use AM/PM display. \e A/AP will be replaced by either "AM" or "PM".
- \row \li ap or a
- \li use am/pm display. \e a/ap will be replaced by either "am" or "pm".
- \row \li t \li the timezone (for example "CEST")
- \endtable
+ Returns the datetime as a string. The \a format parameter determines the
+ format of the result string. See QTime::toString() and QDate::toString() for
+ the supported specifiers for time and date, respectively.
Any sequence of characters enclosed in single quotes will be included
verbatim in the output string (stripped of the quotes), even if it contains
@@ -4323,17 +4726,24 @@ QDateTime QDateTime::toTimeZone(const QTimeZone &timeZone) const
Returns \c true if this datetime is equal to the \a other datetime;
otherwise returns \c false.
+ Since 5.14, all invalid datetimes are equal to one another and differ from
+ all other datetimes.
+
\sa operator!=()
*/
bool QDateTime::operator==(const QDateTime &other) const
{
- if (getSpec(d) == Qt::LocalTime
- && getStatus(d) == getStatus(other.d)) {
+ if (!isValid())
+ return !other.isValid();
+ if (!other.isValid())
+ return false;
+
+ if (getSpec(d) == Qt::LocalTime && getStatus(d) == getStatus(other.d))
return getMSecs(d) == getMSecs(other.d);
- }
+
// Convert to UTC and compare
- return (toMSecsSinceEpoch() == other.toMSecsSinceEpoch());
+ return toMSecsSinceEpoch() == other.toMSecsSinceEpoch();
}
/*!
@@ -4342,8 +4752,9 @@ bool QDateTime::operator==(const QDateTime &other) const
Returns \c true if this datetime is different from the \a other
datetime; otherwise returns \c false.
- Two datetimes are different if either the date, the time, or the
- time zone components are different.
+ Two datetimes are different if either the date, the time, or the time zone
+ components are different. Since 5.14, any invalid datetime is less than all
+ valid datetimes.
\sa operator==()
*/
@@ -4355,12 +4766,16 @@ bool QDateTime::operator==(const QDateTime &other) const
bool QDateTime::operator<(const QDateTime &other) const
{
- if (getSpec(d) == Qt::LocalTime
- && getStatus(d) == getStatus(other.d)) {
+ if (!isValid())
+ return other.isValid();
+ if (!other.isValid())
+ return false;
+
+ if (getSpec(d) == Qt::LocalTime && getStatus(d) == getStatus(other.d))
return getMSecs(d) < getMSecs(other.d);
- }
+
// Convert to UTC and compare
- return (toMSecsSinceEpoch() < other.toMSecsSinceEpoch());
+ return toMSecsSinceEpoch() < other.toMSecsSinceEpoch();
}
/*!
@@ -4430,12 +4845,10 @@ static inline uint msecsFromDecomposed(int hour, int minute, int sec, int msec =
QDate QDate::currentDate()
{
- QDate d;
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
GetLocalTime(&st);
- d.jd = julianDayFromDate(st.wYear, st.wMonth, st.wDay);
- return d;
+ return QDate(st.wYear, st.wMonth, st.wDay);
}
QTime QTime::currentTime()
@@ -4450,48 +4863,46 @@ QTime QTime::currentTime()
QDateTime QDateTime::currentDateTime()
{
- QDate d;
QTime t;
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
GetLocalTime(&st);
- d.jd = julianDayFromDate(st.wYear, st.wMonth, st.wDay);
+ QDate d(st.wYear, st.wMonth, st.wDay);
t.mds = msecsFromDecomposed(st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
return QDateTime(d, t);
}
QDateTime QDateTime::currentDateTimeUtc()
{
- QDate d;
QTime t;
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
GetSystemTime(&st);
- d.jd = julianDayFromDate(st.wYear, st.wMonth, st.wDay);
+ QDate d(st.wYear, st.wMonth, st.wDay);
t.mds = msecsFromDecomposed(st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
return QDateTime(d, t, Qt::UTC);
}
-qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentMSecsSinceEpoch() noexcept
{
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
GetSystemTime(&st);
+ const qint64 daysAfterEpoch = QDate(1970, 1, 1).daysTo(QDate(st.wYear, st.wMonth, st.wDay));
return msecsFromDecomposed(st.wHour, st.wMinute, st.wSecond, st.wMilliseconds) +
- qint64(julianDayFromDate(st.wYear, st.wMonth, st.wDay)
- - julianDayFromDate(1970, 1, 1)) * Q_INT64_C(86400000);
+ daysAfterEpoch * Q_INT64_C(86400000);
}
-qint64 QDateTime::currentSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentSecsSinceEpoch() noexcept
{
SYSTEMTIME st;
memset(&st, 0, sizeof(SYSTEMTIME));
GetSystemTime(&st);
+ const qint64 daysAfterEpoch = QDate(1970, 1, 1).daysTo(QDate(st.wYear, st.wMonth, st.wDay));
return st.wHour * SECS_PER_HOUR + st.wMinute * SECS_PER_MIN + st.wSecond +
- qint64(julianDayFromDate(st.wYear, st.wMonth, st.wDay)
- - julianDayFromDate(1970, 1, 1)) * Q_INT64_C(86400);
+ daysAfterEpoch * Q_INT64_C(86400);
}
#elif defined(Q_OS_UNIX)
@@ -4515,19 +4926,19 @@ QDateTime QDateTime::currentDateTimeUtc()
return fromMSecsSinceEpoch(currentMSecsSinceEpoch(), Qt::UTC);
}
-qint64 QDateTime::currentMSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentMSecsSinceEpoch() noexcept
{
// posix compliant system
// we have milliseconds
struct timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, nullptr);
return qint64(tv.tv_sec) * Q_INT64_C(1000) + tv.tv_usec / 1000;
}
-qint64 QDateTime::currentSecsSinceEpoch() Q_DECL_NOTHROW
+qint64 QDateTime::currentSecsSinceEpoch() noexcept
{
struct timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, nullptr);
return qint64(tv.tv_sec);
}
#else
@@ -4741,8 +5152,6 @@ int QDateTime::utcOffset() const
#if QT_CONFIG(datestring)
/*!
- \fn QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
-
Returns the QDateTime represented by the \a string, using the
\a format given, or an invalid datetime if this is not possible.
@@ -4752,7 +5161,7 @@ int QDateTime::utcOffset() const
\sa toString(), QLocale::toDateTime()
*/
-QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
+QDateTime QDateTime::fromString(const QString &string, Qt::DateFormat format)
{
if (string.isEmpty())
return QDateTime();
@@ -4851,48 +5260,45 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
return QDateTime();
// Accept "Sun Dec 1 13:02:00 1974" and "Sun 1. Dec 13:02:00 1974"
+
+ // Year and time can be in either order.
+ // Guess which by looking for ':' in the time
+ int yearPart = 3;
+ int timePart = 3;
+ if (parts.at(3).contains(QLatin1Char(':')))
+ yearPart = 4;
+ else if (parts.at(4).contains(QLatin1Char(':')))
+ timePart = 4;
+ else
+ return QDateTime();
+
int month = 0;
int day = 0;
bool ok = false;
- // First try month then day
- month = fromShortMonthName(parts.at(1));
+ int year = parts.at(yearPart).toInt(&ok);
+ if (!ok || year == 0)
+ return QDateTime();
+
+ // Next try month then day
+ month = fromShortMonthName(parts.at(1), year);
if (month)
- day = parts.at(2).toInt();
+ day = parts.at(2).toInt(&ok);
- // If failed try day then month
- if (!month || !day) {
- month = fromShortMonthName(parts.at(2));
+ // If failed, try day then month
+ if (!ok || !month || !day) {
+ month = fromShortMonthName(parts.at(2), year);
if (month) {
QStringRef dayStr = parts.at(1);
if (dayStr.endsWith(QLatin1Char('.'))) {
dayStr = dayStr.left(dayStr.size() - 1);
- day = dayStr.toInt();
+ day = dayStr.toInt(&ok);
}
}
}
// If both failed, give up
- if (!month || !day)
- return QDateTime();
-
- // Year can be before or after time, "Sun Dec 1 1974 13:02:00" or "Sun Dec 1 13:02:00 1974"
- // Guess which by looking for ':' in the time
- int year = 0;
- int yearPart = 0;
- int timePart = 0;
- if (parts.at(3).contains(QLatin1Char(':'))) {
- yearPart = 4;
- timePart = 3;
- } else if (parts.at(4).contains(QLatin1Char(':'))) {
- yearPart = 3;
- timePart = 4;
- } else {
- return QDateTime();
- }
-
- year = parts.at(yearPart).toInt(&ok);
- if (!ok)
+ if (!ok || !month || !day)
return QDateTime();
QDate date(year, month, day);
@@ -4959,66 +5365,16 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
}
/*!
- \fn QDateTime QDateTime::fromString(const QString &string, const QString &format)
-
Returns the QDateTime represented by the \a string, using the \a
format given, or an invalid datetime if the string cannot be parsed.
- These expressions may be used for the date part of the format string:
-
- \table
- \header \li Expression \li Output
- \row \li d \li the day as number without a leading zero (1 to 31)
- \row \li dd \li the day as number with a leading zero (01 to 31)
- \row \li ddd
- \li the abbreviated localized day name (e.g. 'Mon' to 'Sun').
- \row \li dddd
- \li the long localized day name (e.g. 'Monday' to 'Sunday').
- \row \li M \li the month as number without a leading zero (1-12)
- \row \li MM \li the month as number with a leading zero (01-12)
- \row \li MMM
- \li the abbreviated localized month name (e.g. 'Jan' to 'Dec').
- \row \li MMMM
- \li the long localized month name (e.g. 'January' to 'December').
- \row \li yy \li the year as two digit number (00-99)
- \row \li yyyy \li the year as four digit number
- \endtable
-
- \note Unlike the other version of this function, day and month names must
- be given in the user's local language. It is only possible to use the English
- names if the user's language is English.
+ Uses the calendar \a cal if supplied, else Gregorian.
- These expressions may be used for the time part of the format string:
-
- \table
- \header \li Expression \li Output
- \row \li h
- \li the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
- \row \li hh
- \li the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
- \row \li H
- \li the hour without a leading zero (0 to 23, even with AM/PM display)
- \row \li HH
- \li the hour with a leading zero (00 to 23, even with AM/PM display)
- \row \li m \li the minute without a leading zero (0 to 59)
- \row \li mm \li the minute with a leading zero (00 to 59)
- \row \li s \li the whole second without a leading zero (0 to 59)
- \row \li ss \li the whole second with a leading zero where applicable (00 to 59)
- \row \li z \li the fractional part of the second, to go after a decimal
- point, without trailing zeroes (0 to 999). Thus "\c{s.z}"
- reports the seconds to full available (millisecond) precision
- without trailing zeroes.
- \row \li zzz \li the fractional part of the second, to millisecond
- precision, including trailing zeroes where applicable (000 to 999).
- \row \li AP or A
- \li interpret as an AM/PM time. \e AP must be either "AM" or "PM".
- \row \li ap or a
- \li Interpret as an AM/PM time. \e ap must be either "am" or "pm".
- \endtable
-
- All other input characters will be treated as text. Any sequence
- of characters that are enclosed in single quotes will also be
- treated as text and not be used as an expression.
+ See QDate::fromString() and QTime::fromString() for the expressions
+ recognized in the format string to represent parts of the date and time.
+ All other input characters will be treated as text. Any sequence of
+ characters that are enclosed in single quotes will also be treated as text
+ and not be used as an expression.
\snippet code/src_corelib_tools_qdatetime.cpp 12
@@ -5066,23 +5422,33 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format)
QLocale::toDateTime()
*/
-QDateTime QDateTime::fromString(const QString &string, const QString &format)
+QDateTime QDateTime::fromString(const QString &string, const QString &format, QCalendar cal)
{
#if QT_CONFIG(datetimeparser)
QTime time;
QDate date;
- QDateTimeParser dt(QVariant::DateTime, QDateTimeParser::FromString);
+ QDateTimeParser dt(QVariant::DateTime, QDateTimeParser::FromString, cal);
// dt.setDefaultLocale(QLocale::c()); ### Qt 6
if (dt.parseFormat(format) && dt.fromString(string, &date, &time))
return QDateTime(date, time);
#else
Q_UNUSED(string);
Q_UNUSED(format);
+ Q_UNUSED(cal);
#endif
return QDateTime();
}
+/*
+ \overload
+*/
+
+QDateTime QDateTime::fromString(const QString &string, const QString &format)
+{
+ return fromString(string, format, QCalendar());
+}
+
#endif // datestring
/*!
\fn QDateTime QDateTime::toLocalTime() const
@@ -5360,7 +5726,7 @@ QDebug operator<<(QDebug dbg, const QTime &time)
QDebugStateSaver saver(dbg);
dbg.nospace() << "QTime(";
if (time.isValid())
- dbg.nospace() << time.toString(QStringViewLiteral("HH:mm:ss.zzz"));
+ dbg.nospace() << time.toString(u"HH:mm:ss.zzz");
else
dbg.nospace() << "Invalid";
dbg.nospace() << ')';
@@ -5373,7 +5739,7 @@ QDebug operator<<(QDebug dbg, const QDateTime &date)
dbg.nospace() << "QDateTime(";
if (date.isValid()) {
const Qt::TimeSpec ts = date.timeSpec();
- dbg.noquote() << date.toString(QStringViewLiteral("yyyy-MM-dd HH:mm:ss.zzz t"))
+ dbg.noquote() << date.toString(u"yyyy-MM-dd HH:mm:ss.zzz t")
<< ' ' << ts;
switch (ts) {
case Qt::UTC:
@@ -5408,7 +5774,7 @@ uint qHash(const QDateTime &key, uint seed)
// QDate/QTime/spec/offset because QDateTime::operator== converts both arguments
// to the same timezone. If we don't, qHash would return different hashes for
// two QDateTimes that are equivalent once converted to the same timezone.
- return qHash(key.toMSecsSinceEpoch(), seed);
+ return key.isValid() ? qHash(key.toMSecsSinceEpoch(), seed) : seed;
}
/*! \fn uint qHash(const QDate &key, uint seed = 0)
@@ -5417,7 +5783,7 @@ uint qHash(const QDateTime &key, uint seed)
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QDate &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QDate &key, uint seed) noexcept
{
return qHash(key.toJulianDay(), seed);
}
@@ -5428,7 +5794,7 @@ uint qHash(const QDate &key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QTime &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QTime &key, uint seed) noexcept
{
return qHash(key.msecsSinceStartOfDay(), seed);
}
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/time/qdatetime.h
index 8b2a60acaa..3eae8ebf64 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/time/qdatetime.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -54,9 +54,11 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSDate);
QT_BEGIN_NAMESPACE
+class QCalendar;
class QTimeZone;
+class QDateTime;
-class Q_CORE_EXPORT QDate
+class Q_CORE_EXPORT QDate // ### Qt 6: change to be used by value, not const &
{
public:
enum MonthNameType { // ### Qt 6: remove, along with methods using it
@@ -68,6 +70,7 @@ private:
public:
Q_DECL_CONSTEXPR QDate() : jd(nullJd()) {}
QDate(int y, int m, int d);
+ QDate(int y, int m, int d, QCalendar cal);
Q_DECL_CONSTEXPR bool isNull() const { return !isValid(); }
Q_DECL_CONSTEXPR bool isValid() const { return jd >= minJd() && jd <= maxJd(); }
@@ -81,6 +84,21 @@ public:
int daysInYear() const;
int weekNumber(int *yearNum = nullptr) const;
+ int year(QCalendar cal) const;
+ int month(QCalendar cal) const;
+ int day(QCalendar cal) const;
+ int dayOfWeek(QCalendar cal) const;
+ int dayOfYear(QCalendar cal) const;
+ int daysInMonth(QCalendar cal) const;
+ int daysInYear(QCalendar cal) const;
+
+ QDateTime startOfDay(Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0) const;
+ QDateTime endOfDay(Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0) const;
+#if QT_CONFIG(timezone)
+ QDateTime startOfDay(const QTimeZone &zone) const;
+ QDateTime endOfDay(const QTimeZone &zone) const;
+#endif
+
#if QT_DEPRECATED_SINCE(5, 10) && QT_CONFIG(textdate)
QT_DEPRECATED_X("Use QLocale::monthName or QLocale::standaloneMonthName")
static QString shortMonthName(int month, MonthNameType type = DateFormat);
@@ -95,15 +113,20 @@ public:
QString toString(Qt::DateFormat f = Qt::TextDate) const;
#if QT_STRINGVIEW_LEVEL < 2
QString toString(const QString &format) const;
+ QString toString(const QString &format, QCalendar cal) const;
#endif
+
QString toString(QStringView format) const;
+ QString toString(Qt::DateFormat f, QCalendar cal) const;
+ QString toString(QStringView format, QCalendar cal) const;
#endif
#if QT_DEPRECATED_SINCE(5,0)
-QT_DEPRECATED inline bool setYMD(int y, int m, int d)
-{ if (uint(y) <= 99) y += 1900; return setDate(y, m, d); }
+ QT_DEPRECATED_X("Use setDate() instead") inline bool setYMD(int y, int m, int d)
+ { if (uint(y) <= 99) y += 1900; return setDate(y, m, d); }
#endif
bool setDate(int year, int month, int day);
+ bool setDate(int year, int month, int day, QCalendar cal);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void getDate(int *year, int *month, int *day); // ### Qt 6: remove
@@ -113,7 +136,9 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
Q_REQUIRED_RESULT QDate addDays(qint64 days) const;
Q_REQUIRED_RESULT QDate addMonths(int months) const;
Q_REQUIRED_RESULT QDate addYears(int years) const;
- qint64 daysTo(const QDate &) const;
+ Q_REQUIRED_RESULT QDate addMonths(int months, QCalendar cal) const;
+ Q_REQUIRED_RESULT QDate addYears(int years, QCalendar cal) const;
+ qint64 daysTo(const QDate &) const; // ### Qt 6: QDate
Q_DECL_CONSTEXPR bool operator==(const QDate &other) const { return jd == other.jd; }
Q_DECL_CONSTEXPR bool operator!=(const QDate &other) const { return jd != other.jd; }
@@ -126,6 +151,7 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d)
#if QT_CONFIG(datestring)
static QDate fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDate fromString(const QString &s, const QString &format);
+ static QDate fromString(const QString &s, const QString &format, QCalendar cal);
#endif
static bool isValid(int y, int m, int d);
static bool isLeapYear(int year);
@@ -151,7 +177,7 @@ private:
};
Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE);
-class Q_CORE_EXPORT QTime
+class Q_CORE_EXPORT QTime // ### Qt 6: change to be used by value, not const &
{
explicit Q_DECL_CONSTEXPR QTime(int ms) : mds(ms)
{}
@@ -177,9 +203,9 @@ public:
bool setHMS(int h, int m, int s, int ms = 0);
Q_REQUIRED_RESULT QTime addSecs(int secs) const;
- int secsTo(const QTime &) const;
+ int secsTo(const QTime &) const; // ### Qt 6: plain QTime
Q_REQUIRED_RESULT QTime addMSecs(int ms) const;
- int msecsTo(const QTime &) const;
+ int msecsTo(const QTime &) const; // ### Qt 6: plain QTime
Q_DECL_CONSTEXPR bool operator==(const QTime &other) const { return mds == other.mds; }
Q_DECL_CONSTEXPR bool operator!=(const QTime &other) const { return mds != other.mds; }
@@ -198,9 +224,11 @@ public:
#endif
static bool isValid(int h, int m, int s, int ms = 0);
- void start();
- int restart();
- int elapsed() const;
+#if QT_DEPRECATED_SINCE(5, 14) // ### Qt 6: remove
+ QT_DEPRECATED_X("Use QElapsedTimer instead") void start();
+ QT_DEPRECATED_X("Use QElapsedTimer instead") int restart();
+ QT_DEPRECATED_X("Use QElapsedTimer instead") int elapsed() const;
+#endif
private:
enum TimeFlag { NullTime = -1 };
Q_DECL_CONSTEXPR inline int ds() const { return mds == -1 ? 0 : mds; }
@@ -208,7 +236,7 @@ private:
friend class QDateTime;
friend class QDateTimePrivate;
-#ifndef QT_NO_DATASTREAM
+#ifndef QT_NO_DATASTREAM // ### Qt 6: plain QTime
friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QTime &);
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QTime &);
#endif
@@ -258,24 +286,22 @@ class Q_CORE_EXPORT QDateTime
};
public:
- QDateTime() Q_DECL_NOEXCEPT_EXPR(Data::CanBeSmall);
- explicit QDateTime(const QDate &);
+ QDateTime() noexcept(Data::CanBeSmall);
+ explicit QDateTime(const QDate &); // ### Qt 6: plain QDate, QTime
QDateTime(const QDate &, const QTime &, Qt::TimeSpec spec = Qt::LocalTime);
// ### Qt 6: Merge with above with default offsetSeconds = 0
QDateTime(const QDate &date, const QTime &time, Qt::TimeSpec spec, int offsetSeconds);
#if QT_CONFIG(timezone)
QDateTime(const QDate &date, const QTime &time, const QTimeZone &timeZone);
#endif // timezone
- QDateTime(const QDateTime &other) Q_DECL_NOTHROW;
- QDateTime(QDateTime &&other) Q_DECL_NOTHROW;
+ QDateTime(const QDateTime &other) noexcept;
+ QDateTime(QDateTime &&other) noexcept;
~QDateTime();
-#ifdef Q_COMPILER_RVALUE_REFS
- QDateTime &operator=(QDateTime &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
- QDateTime &operator=(const QDateTime &other) Q_DECL_NOTHROW;
+ QDateTime &operator=(QDateTime &&other) noexcept { swap(other); return *this; }
+ QDateTime &operator=(const QDateTime &other) noexcept;
- void swap(QDateTime &other) Q_DECL_NOTHROW { qSwap(d.d, other.d.d); }
+ void swap(QDateTime &other) noexcept { qSwap(d.d, other.d.d); }
bool isNull() const;
bool isValid() const;
@@ -293,7 +319,7 @@ public:
qint64 toMSecsSinceEpoch() const;
qint64 toSecsSinceEpoch() const;
- void setDate(const QDate &date);
+ void setDate(const QDate &date); // ### Qt 6: plain QDate
void setTime(const QTime &time);
void setTimeSpec(Qt::TimeSpec spec);
void setOffsetFromUtc(int offsetSeconds);
@@ -336,8 +362,8 @@ public:
inline bool operator>=(const QDateTime &other) const { return !(*this < other); }
#if QT_DEPRECATED_SINCE(5, 2) // ### Qt 6: remove
- QT_DEPRECATED void setUtcOffset(int seconds);
- QT_DEPRECATED int utcOffset() const;
+ QT_DEPRECATED_X("Use setOffsetFromUtc() instead") void setUtcOffset(int seconds);
+ QT_DEPRECATED_X("Use offsetFromUtc() instead") int utcOffset() const;
#endif // QT_DEPRECATED_SINCE
static QDateTime currentDateTime();
@@ -345,6 +371,7 @@ public:
#if QT_CONFIG(datestring)
static QDateTime fromString(const QString &s, Qt::DateFormat f = Qt::TextDate);
static QDateTime fromString(const QString &s, const QString &format);
+ static QDateTime fromString(const QString &s, const QString &format, QCalendar cal);
#endif
#if QT_DEPRECATED_SINCE(5, 8)
@@ -366,8 +393,8 @@ public:
static QDateTime fromSecsSinceEpoch(qint64 secs, const QTimeZone &timeZone);
#endif
- static qint64 currentMSecsSinceEpoch() Q_DECL_NOTHROW;
- static qint64 currentSecsSinceEpoch() Q_DECL_NOTHROW;
+ static qint64 currentMSecsSinceEpoch() noexcept;
+ static qint64 currentSecsSinceEpoch() noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
static QDateTime fromCFDate(CFDateRef date);
@@ -376,6 +403,10 @@ public:
NSDate *toNSDate() const Q_DECL_NS_RETURNS_AUTORELEASED;
#endif
+ // (1<<63) ms is 292277024.6 (average Gregorian) years, counted from the start of 1970, so
+ // Last is floor(1970 + 292277024.6); no year 0, so First is floor(1970 - 1 - 292277024.6)
+ enum class YearRange : qint32 { First = -292275056, Last = +292278994 };
+
private:
friend class QDateTimePrivate;
@@ -410,8 +441,8 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
// QDateTime is not noexcept for now -- to be revised once
// timezone and calendaring support is added
Q_CORE_EXPORT uint qHash(const QDateTime &key, uint seed = 0);
-Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0) noexcept;
+Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0) noexcept;
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/time/qdatetime_p.h
index b3d00745d0..f4f00a8b9b 100644
--- a/src/corelib/tools/qdatetime_p.h
+++ b/src/corelib/time/qdatetime_p.h
@@ -56,7 +56,7 @@
#include "qplatformdefs.h"
#include "QtCore/qatomic.h"
#include "QtCore/qdatetime.h"
-#include "QtCore/qpair.h"
+#include "QtCore/qshareddata.h"
#if QT_CONFIG(timezone)
#include "qtimezone.h"
@@ -64,7 +64,7 @@
QT_BEGIN_NAMESPACE
-class QDateTimePrivate
+class QDateTimePrivate : public QSharedData
{
public:
// forward the declarations from QDateTime (this makes them public)
@@ -110,13 +110,6 @@ public:
DaylightMask = SetToStandardTime | SetToDaylightTime
};
- QDateTimePrivate() : m_msecs(0),
- m_status(StatusFlag(Qt::LocalTime << TimeSpecShift)),
- m_offsetFromUtc(0),
- ref(0)
- {
- }
-
static QDateTime::Data create(const QDate &toDate, const QTime &toTime, Qt::TimeSpec toSpec,
int offsetSeconds);
@@ -124,10 +117,9 @@ public:
static QDateTime::Data create(const QDate &toDate, const QTime &toTime, const QTimeZone & timeZone);
#endif // timezone
- qint64 m_msecs;
- StatusFlags m_status;
- int m_offsetFromUtc;
- mutable QAtomicInt ref;
+ StatusFlags m_status = StatusFlag(Qt::LocalTime << TimeSpecShift);
+ qint64 m_msecs = 0;
+ int m_offsetFromUtc = 0;
#if QT_CONFIG(timezone)
QTimeZone m_timeZone;
#endif // timezone
@@ -135,15 +127,11 @@ public:
#if QT_CONFIG(timezone)
static qint64 zoneMSecsToEpochMSecs(qint64 msecs, const QTimeZone &zone,
DaylightStatus hint = UnknownDaylightTime,
- QDate *localDate = 0, QTime *localTime = 0);
+ QDate *localDate = nullptr, QTime *localTime = nullptr);
// Inlined for its one caller in qdatetime.cpp
inline void setUtcOffsetByTZ(qint64 atMSecsSinceEpoch);
#endif // timezone
-
- // ### Qt 5.14: expose publicly in QDateTime
- // The first and last years of which QDateTime can represent some part:
- enum class YearRange : qint32 { First = -292275056, Last = +292278994 };
};
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/time/qdatetimeparser.cpp
index adc5451dec..2c566e3584 100644
--- a/src/corelib/tools/qdatetimeparser.cpp
+++ b/src/corelib/time/qdatetimeparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -47,7 +47,6 @@
#if QT_CONFIG(timezone)
#include "qtimezone.h"
#endif
-#include "qregexp.h"
#include "qdebug.h"
//#define QDATETIMEPARSER_DEBUG
@@ -61,6 +60,9 @@
QT_BEGIN_NAMESPACE
+template <typename T>
+using ShortVector = QVarLengthArray<T, 13>; // enough for month (incl. leap) and day-of-week names
+
QDateTimeParser::~QDateTimeParser()
{
}
@@ -78,8 +80,8 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
{
if (index < 0 || index >= sectionNodes.size()) {
#if QT_CONFIG(datestring)
- qWarning("QDateTimeParser::getDigit() Internal error (%s %d)",
- qPrintable(t.toString()), index);
+ qWarning("QDateTimeParser::getDigit() Internal error (%ls %d)",
+ qUtf16Printable(t.toString()), index);
#else
qWarning("QDateTimeParser::getDigit() Internal error (%d)", index);
#endif
@@ -93,19 +95,19 @@ int QDateTimeParser::getDigit(const QDateTime &t, int index) const
case SecondSection: return t.time().second();
case MSecSection: return t.time().msec();
case YearSection2Digits:
- case YearSection: return t.date().year();
- case MonthSection: return t.date().month();
- case DaySection: return t.date().day();
+ case YearSection: return t.date().year(calendar);
+ case MonthSection: return t.date().month(calendar);
+ case DaySection: return t.date().day(calendar);
case DayOfWeekSectionShort:
- case DayOfWeekSectionLong: return t.date().day();
+ case DayOfWeekSectionLong: return t.date().day(calendar);
case AmPmSection: return t.time().hour() > 11 ? 1 : 0;
default: break;
}
#if QT_CONFIG(datestring)
- qWarning("QDateTimeParser::getDigit() Internal error 2 (%s %d)",
- qPrintable(t.toString()), index);
+ qWarning("QDateTimeParser::getDigit() Internal error 2 (%ls %d)",
+ qUtf16Printable(t.toString()), index);
#else
qWarning("QDateTimeParser::getDigit() Internal error 2 (%d)", index);
#endif
@@ -128,8 +130,8 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
{
if (index < 0 || index >= sectionNodes.size()) {
#if QT_CONFIG(datestring)
- qWarning("QDateTimeParser::setDigit() Internal error (%s %d %d)",
- qPrintable(v.toString()), index, newVal);
+ qWarning("QDateTimeParser::setDigit() Internal error (%ls %d %d)",
+ qUtf16Printable(v.toString()), index, newVal);
#else
qWarning("QDateTimeParser::setDigit() Internal error (%d %d)", index, newVal);
#endif
@@ -139,9 +141,9 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
const QDate date = v.date();
const QTime time = v.time();
- int year = date.year();
- int month = date.month();
- int day = date.day();
+ int year = date.year(calendar);
+ int month = date.month(calendar);
+ int day = date.day(calendar);
int hour = time.hour();
int minute = time.minute();
int second = time.second();
@@ -177,21 +179,21 @@ bool QDateTimeParser::setDigit(QDateTime &v, int index, int newVal) const
break;
case AmPmSection: hour = (newVal == 0 ? hour % 12 : (hour % 12) + 12); break;
default:
- qWarning("QDateTimeParser::setDigit() Internal error (%s)",
- qPrintable(node.name()));
+ qWarning("QDateTimeParser::setDigit() Internal error (%ls)",
+ qUtf16Printable(node.name()));
break;
}
if (!(node.type & DaySectionMask)) {
if (day < cachedDay)
day = cachedDay;
- const int max = QDate(year, month, 1).daysInMonth();
+ const int max = calendar.daysInMonth(month, year);
if (day > max) {
day = max;
}
}
- const QDate newDate(year, month, day);
+ const QDate newDate(year, month, day, calendar);
const QTime newTime(hour, minute, second, msec);
if (!newDate.isValid() || !newTime.isValid())
return false;
@@ -221,26 +223,28 @@ int QDateTimeParser::absoluteMax(int s, const QDateTime &cur) const
case TimeZoneSection: return QTimeZone::MaxUtcOffsetSecs;
#endif
case Hour24Section:
- case Hour12Section: return 23; // this is special-cased in
- // parseSection. We want it to be
- // 23 for the stepBy case.
+ case Hour12Section:
+ // This is special-cased in parseSection.
+ // We want it to be 23 for the stepBy case.
+ return 23;
case MinuteSection:
case SecondSection: return 59;
case MSecSection: return 999;
case YearSection2Digits:
- case YearSection: return 9999; // sectionMaxSize will prevent
- // people from typing in a larger
- // number in count == 2 sections.
- // stepBy() will work on real years anyway
- case MonthSection: return 12;
+ case YearSection:
+ // sectionMaxSize will prevent people from typing in a larger number in
+ // count == 2 sections; stepBy() will work on real years anyway.
+ return 9999;
+ case MonthSection: return calendar.maximumMonthsInYear();
case DaySection:
case DayOfWeekSectionShort:
- case DayOfWeekSectionLong: return cur.isValid() ? cur.date().daysInMonth() : 31;
+ case DayOfWeekSectionLong:
+ return cur.isValid() ? cur.date().daysInMonth(calendar) : calendar.maximumDaysInMonth();
case AmPmSection: return 1;
default: break;
}
- qWarning("QDateTimeParser::absoluteMax() Internal error (%s)",
- qPrintable(sn.name()));
+ qWarning("QDateTimeParser::absoluteMax() Internal error (%ls)",
+ qUtf16Printable(sn.name()));
return -1;
}
@@ -271,8 +275,8 @@ int QDateTimeParser::absoluteMin(int s) const
case AmPmSection: return 0;
default: break;
}
- qWarning("QDateTimeParser::absoluteMin() Internal error (%s, %0x)",
- qPrintable(sn.name()), sn.type);
+ qWarning("QDateTimeParser::absoluteMin() Internal error (%ls, %0x)",
+ qUtf16Printable(sn.name()), sn.type);
return -1;
}
@@ -327,7 +331,7 @@ int QDateTimeParser::sectionPos(const SectionNode &sn) const
default: break;
}
if (sn.pos == -1) {
- qWarning("QDateTimeParser::sectionPos Internal error (%s)", qPrintable(sn.name()));
+ qWarning("QDateTimeParser::sectionPos Internal error (%ls)", qUtf16Printable(sn.name()));
return -1;
}
return sn.pos;
@@ -613,7 +617,7 @@ int QDateTimeParser::sectionSize(int sectionIndex) const
int QDateTimeParser::sectionMaxSize(Section s, int count) const
{
#if QT_CONFIG(textdate)
- int mcount = 12;
+ int mcount = calendar.maximumMonthsInYear();
#endif
switch (s) {
@@ -655,7 +659,7 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
const QLocale::FormatType format = count == 4 ? QLocale::LongFormat : QLocale::ShortFormat;
for (int i=1; i<=mcount; ++i) {
const QString str = (s == MonthSection
- ? l.monthName(i, format)
+ ? calendar.monthName(l, i, QCalendar::Unspecified, format)
: l.dayName(i, format));
ret = qMax(str.size(), ret);
}
@@ -734,8 +738,8 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
ParsedSection result; // initially Invalid
const SectionNode &sn = sectionNode(sectionIndex);
if (sn.type & Internal) {
- qWarning("QDateTimeParser::parseSection Internal error (%s %d)",
- qPrintable(sn.name()), sectionIndex);
+ qWarning("QDateTimeParser::parseSection Internal error (%ls %d)",
+ qUtf16Printable(sn.name()), sectionIndex);
return result;
}
@@ -788,9 +792,9 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
int num = 0, used = 0;
if (sn.type == MonthSection) {
const QDate minDate = getMinimum().date();
- const int min = (currentValue.date().year() == minDate.year())
- ? minDate.month() : 1;
- num = findMonth(sectiontext.toLower(), min, sectionIndex, &sectiontext, &used);
+ const int year = currentValue.date().year(calendar);
+ const int min = (year == minDate.year(calendar)) ? minDate.month(calendar) : 1;
+ num = findMonth(sectiontext.toLower(), min, sectionIndex, year, &sectiontext, &used);
} else {
num = findDay(sectiontext.toLower(), 1, sectionIndex, &sectiontext, &used);
}
@@ -885,8 +889,8 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
}
break; }
default:
- qWarning("QDateTimeParser::parseSection Internal error (%s %d)",
- qPrintable(sn.name()), sectionIndex);
+ qWarning("QDateTimeParser::parseSection Internal error (%ls %d)",
+ qUtf16Printable(sn.name()), sectionIndex);
return result;
}
Q_ASSERT(result.state != Invalid || result.value == -1);
@@ -897,16 +901,36 @@ QDateTimeParser::parseSection(const QDateTime &currentValue, int sectionIndex,
/*!
\internal
+ Returns a day-number, in the same month as \a rough and as close to \a rough's
+ day number as is valid, that \a calendar puts on the day of the week indicated
+ by \a weekDay.
+*/
+
+static int weekDayWithinMonth(const QCalendar &calendar, const QDate &rough, int weekDay)
+{
+ // TODO: can we adapt this to cope gracefully with intercallary days (day of
+ // week > 7) without making it slower for more widely-used calendars ?
+ int day = rough.day(calendar) + weekDay - calendar.dayOfWeek(rough);
+ if (day <= 0)
+ return day + 7;
+ if (day > rough.daysInMonth(calendar))
+ return day - 7;
+ return day;
+}
+
+/*!
+ \internal
+
Returns a date consistent with the given data on parts specified by known,
while staying as close to the given data as it can. Returns an invalid date
when on valid date is consistent with the data.
*/
-static QDate actualDate(QDateTimeParser::Sections known, int year, int year2digits,
- int month, int day, int dayofweek)
+static QDate actualDate(QDateTimeParser::Sections known, const QCalendar &calendar,
+ int year, int year2digits, int month, int day, int dayofweek)
{
- QDate actual(year, month, day);
- if (actual.isValid() && year % 100 == year2digits && actual.dayOfWeek() == dayofweek)
+ QDate actual(year, month, day, calendar);
+ if (actual.isValid() && year % 100 == year2digits && calendar.dayOfWeek(actual) == dayofweek)
return actual; // The obvious candidate is fine :-)
if (dayofweek < 1 || dayofweek > 7) // Invalid: ignore
@@ -932,18 +956,18 @@ static QDate actualDate(QDateTimeParser::Sections known, int year, int year2digi
known &= ~QDateTimeParser::MonthSection;
}
- QDate first(year, month, 1);
+ QDate first(year, month, 1, calendar);
int last = known & QDateTimeParser::YearSection && known & QDateTimeParser::MonthSection
- ? first.daysInMonth() : 0;
+ ? first.daysInMonth(calendar) : 0;
// If we also know day-of-week, tweak last to the last in the month that matches it:
if (last && known & QDateTimeParser::DayOfWeekSectionMask) {
- int diff = (dayofweek - first.dayOfWeek() - last) % 7;
+ int diff = (dayofweek - calendar.dayOfWeek(first) - last) % 7;
Q_ASSERT(diff <= 0); // C++11 specifies (-ve) % (+ve) to be <= 0.
last += diff;
}
if (day < 1) {
if (known & QDateTimeParser::DayOfWeekSectionMask && last) {
- day = 1 + dayofweek - first.dayOfWeek();
+ day = 1 + dayofweek - calendar.dayOfWeek(first);
if (day < 1)
day += 7;
} else {
@@ -957,12 +981,12 @@ static QDate actualDate(QDateTimeParser::Sections known, int year, int year2digi
day = last;
}
- actual = QDate(year, month, day);
+ actual = QDate(year, month, day, calendar);
if (!actual.isValid() // We can't do better than we have, in this case
|| (known & QDateTimeParser::DaySection
&& known & QDateTimeParser::MonthSection
&& known & QDateTimeParser::YearSection) // ditto
- || actual.dayOfWeek() == dayofweek // Good enough, use it.
+ || calendar.dayOfWeek(actual) == dayofweek // Good enough, use it.
|| (known & QDateTimeParser::DayOfWeekSectionMask) == 0) { // No contradiction, use it.
return actual;
}
@@ -977,12 +1001,8 @@ static QDate actualDate(QDateTimeParser::Sections known, int year, int year2digi
if ((known & QDateTimeParser::DaySection) == 0) {
// Relatively easy to fix.
- day += dayofweek - actual.dayOfWeek();
- if (day < 1)
- day += 7;
- else if (day > actual.daysInMonth())
- day -= 7;
- actual = QDate(year, month, day);
+ day = weekDayWithinMonth(calendar, actual, dayofweek);
+ actual = QDate(year, month, day, calendar);
return actual;
}
@@ -994,18 +1014,18 @@ static QDate actualDate(QDateTimeParser::Sections known, int year, int year2digi
*/
for (int m = 1; m < 12; m++) {
if (m < month) {
- actual = QDate(year, month - m, day);
- if (actual.dayOfWeek() == dayofweek)
+ actual = QDate(year, month - m, day, calendar);
+ if (calendar.dayOfWeek(actual) == dayofweek)
return actual;
}
if (m + month <= 12) {
- actual = QDate(year, month + m, day);
- if (actual.dayOfWeek() == dayofweek)
+ actual = QDate(year, month + m, day, calendar);
+ if (calendar.dayOfWeek(actual) == dayofweek)
return actual;
}
}
// Should only get here in corner cases; e.g. day == 31
- actual = QDate(year, month, day); // Restore from trial values.
+ actual = QDate(year, month, day, calendar); // Restore from trial values.
}
if ((known & QDateTimeParser::YearSection) == 0) {
@@ -1018,24 +1038,24 @@ static QDate actualDate(QDateTimeParser::Sections known, int year, int year2digi
is '97, it makes sense to consider 1997. If either adjacent
century does work, the other won't.
*/
- actual = QDate(year + 100, month, day);
- if (actual.dayOfWeek() == dayofweek)
+ actual = QDate(year + 100, month, day, calendar);
+ if (calendar.dayOfWeek(actual) == dayofweek)
return actual;
- actual = QDate(year - 100, month, day);
- if (actual.dayOfWeek() == dayofweek)
+ actual = QDate(year - 100, month, day, calendar);
+ if (calendar.dayOfWeek(actual) == dayofweek)
return actual;
} else {
// Offset by 7 is usually enough, but rare cases may need more:
for (int y = 1; y < 12; y++) {
- actual = QDate(year - y, month, day);
- if (actual.dayOfWeek() == dayofweek)
+ actual = QDate(year - y, month, day, calendar);
+ if (calendar.dayOfWeek(actual) == dayofweek)
return actual;
- actual = QDate(year + y, month, day);
- if (actual.dayOfWeek() == dayofweek)
+ actual = QDate(year + y, month, day, calendar);
+ if (calendar.dayOfWeek(actual) == dayofweek)
return actual;
}
}
- actual = QDate(year, month, day); // Restore from trial values.
+ actual = QDate(year, month, day, calendar); // Restore from trial values.
}
return actual; // It'll just have to do :-(
@@ -1098,7 +1118,7 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
int minute = defaultTime.minute();
int second = defaultTime.second();
int msec = defaultTime.msec();
- int dayofweek = defaultDate.dayOfWeek();
+ int dayofweek = calendar.dayOfWeek(defaultDate);
Qt::TimeSpec tspec = defaultValue.timeSpec();
int zoneOffset = 0; // In seconds; local - UTC
#if QT_CONFIG(timezone)
@@ -1139,7 +1159,8 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
ParsedSection sect;
{
- const QDate date = actualDate(isSet, year, year2digits, month, day, dayofweek);
+ const QDate date = actualDate(isSet, calendar, year, year2digits,
+ month, day, dayofweek);
const QTime time = actualTime(isSet, hour, hour12, ampm, minute, second, msec);
sect = parseSection(
#if QT_CONFIG(timezone)
@@ -1200,8 +1221,8 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
case DaySection: current = &day; sect.value = qMax<int>(1, sect.value); break;
case AmPmSection: current = &ampm; break;
default:
- qWarning("QDateTimeParser::parse Internal error (%s)",
- qPrintable(sn.name()));
+ qWarning("QDateTimeParser::parse Internal error (%ls)",
+ qUtf16Printable(sn.name()));
break;
}
@@ -1249,22 +1270,17 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
}
}
- const QDate date(year, month, day);
- const int diff = dayofweek - date.dayOfWeek();
- if (diff != 0 && state == Acceptable && isSet & DayOfWeekSectionMask) {
+ const QDate date(year, month, day, calendar);
+ if (dayofweek != calendar.dayOfWeek(date)
+ && state == Acceptable && isSet & DayOfWeekSectionMask) {
if (isSet & DaySection)
conflicts = true;
const SectionNode &sn = sectionNode(currentSectionIndex);
if (sn.type & DayOfWeekSectionMask || currentSectionIndex == -1) {
// dayofweek should be preferred
- day += diff;
- if (day <= 0) {
- day += 7;
- } else if (day > date.daysInMonth()) {
- day -= 7;
- }
+ day = weekDayWithinMonth(calendar, date, dayofweek);
QDTPDEBUG << year << month << day << dayofweek
- << diff << QDate(year, month, day).dayOfWeek();
+ << calendar.dayOfWeek(QDate(year, month, day, calendar));
}
}
@@ -1276,20 +1292,18 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
needfixday = true;
}
- if (!QDate::isValid(year, month, day)) {
- if (day < 32) {
+ if (!calendar.isDateValid(year, month, day)) {
+ if (day <= calendar.maximumDaysInMonth())
cachedDay = day;
- }
- if (day > 28 && QDate::isValid(year, month, 1)) {
+ if (day > calendar.minimumDaysInMonth() && calendar.isDateValid(year, month, 1))
needfixday = true;
- }
}
if (needfixday) {
if (context == FromString) {
return StateNode();
}
if (state == Acceptable && fixday) {
- day = qMin<int>(day, QDate(year, month, 1).daysInMonth());
+ day = qMin<int>(day, calendar.daysInMonth(month, year));
const QLocale loc = locale();
for (int i=0; i<sectionNodesCount; ++i) {
@@ -1297,7 +1311,7 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
if (sn.type & DaySection) {
input->replace(sectionPos(sn), sectionSize(i), loc.toString(day));
} else if (sn.type & DayOfWeekSectionMask) {
- const int dayOfWeek = QDate(year, month, day).dayOfWeek();
+ const int dayOfWeek = calendar.dayOfWeek(QDate(year, month, day, calendar));
const QLocale::FormatType dayFormat =
(sn.type == DayOfWeekSectionShort
? QLocale::ShortFormat : QLocale::LongFormat);
@@ -1334,13 +1348,12 @@ QDateTimeParser::scanString(const QDateTime &defaultValue,
conflicts = true;
}
}
-
}
QDTPDEBUG << year << month << day << hour << minute << second << msec;
Q_ASSERT(state != Invalid);
- const QDate date(year, month, day);
+ const QDate date(year, month, day, calendar);
const QTime time(hour, minute, second, msec);
const QDateTime when =
#if QT_CONFIG(timezone)
@@ -1391,8 +1404,8 @@ QDateTimeParser::parse(QString input, int position, const QDateTime &defaultValu
if (context != FromString && scan.value < minimum) {
const QLatin1Char space(' ');
if (scan.value >= minimum)
- qWarning("QDateTimeParser::parse Internal error 3 (%s %s)",
- qPrintable(scan.value.toString()), qPrintable(minimum.toString()));
+ qWarning("QDateTimeParser::parse Internal error 3 (%ls %ls)",
+ qUtf16Printable(scan.value.toString()), qUtf16Printable(minimum.toString()));
bool done = false;
scan.state = Invalid;
@@ -1428,10 +1441,11 @@ QDateTimeParser::parse(QString input, int position, const QDateTime &defaultValu
Q_FALLTHROUGH();
case MonthSection:
if (sn.count >= 3) {
- const int finalMonth = scan.value.date().month();
+ const QDate when = scan.value.date();
+ const int finalMonth = when.month(calendar);
int tmp = finalMonth;
// I know the first possible month makes the date too early
- while ((tmp = findMonth(t, tmp + 1, i)) != -1) {
+ while ((tmp = findMonth(t, tmp + 1, i, when.year(calendar))) != -1) {
const QDateTime copy(scan.value.addMonths(tmp - finalMonth));
if (copy >= minimum && copy <= maximum)
break; // break out of while
@@ -1474,8 +1488,8 @@ QDateTimeParser::parse(QString input, int position, const QDateTime &defaultValu
const int min = getDigit(minimum, i);
if (min == -1) {
- qWarning("QDateTimeParser::parse Internal error 4 (%s)",
- qPrintable(sn.name()));
+ qWarning("QDateTimeParser::parse Internal error 4 (%ls)",
+ qUtf16Printable(sn.name()));
scan.state = Invalid;
done = true;
break;
@@ -1529,7 +1543,7 @@ QDateTimeParser::parse(QString input, int position, const QDateTime &defaultValu
length of overlap in *used (if \a used is non-NULL) and the first entry that
overlapped this much in *usedText (if \a usedText is non-NULL).
*/
-static int findTextEntry(const QString &text, const QVector<QString> &entries, QString *usedText, int *used)
+static int findTextEntry(const QString &text, const ShortVector<QString> &entries, QString *usedText, int *used)
{
if (text.isEmpty())
return -1;
@@ -1567,7 +1581,7 @@ static int findTextEntry(const QString &text, const QVector<QString> &entries, Q
*/
int QDateTimeParser::findMonth(const QString &str1, int startMonth, int sectionIndex,
- QString *usedMonth, int *used) const
+ int year, QString *usedMonth, int *used) const
{
const SectionNode &sn = sectionNode(sectionIndex);
if (sn.type != MonthSection) {
@@ -1577,10 +1591,10 @@ int QDateTimeParser::findMonth(const QString &str1, int startMonth, int sectionI
QLocale::FormatType type = sn.count == 3 ? QLocale::ShortFormat : QLocale::LongFormat;
QLocale l = locale();
- QVector<QString> monthNames;
+ ShortVector<QString> monthNames;
monthNames.reserve(13 - startMonth);
for (int month = startMonth; month <= 12; ++month)
- monthNames.append(l.monthName(month, type));
+ monthNames.append(calendar.monthName(l, month, year, type));
const int index = findTextEntry(str1, monthNames, usedMonth, used);
return index < 0 ? index : index + startMonth;
@@ -1596,7 +1610,7 @@ int QDateTimeParser::findDay(const QString &str1, int startDay, int sectionIndex
QLocale::FormatType type = sn.count == 4 ? QLocale::LongFormat : QLocale::ShortFormat;
QLocale l = locale();
- QVector<QString> daysOfWeek;
+ ShortVector<QString> daysOfWeek;
daysOfWeek.reserve(8 - startDay);
for (int day = startDay; day <= 7; ++day)
daysOfWeek.append(l.dayName(day, type));
@@ -1776,8 +1790,8 @@ int QDateTimeParser::SectionNode::maxChange() const
case YearSection: return 9999 * 365;
case YearSection2Digits: return 100 * 365;
default:
- qWarning("QDateTimeParser::maxChange() Internal error (%s)",
- qPrintable(name()));
+ qWarning("QDateTimeParser::maxChange() Internal error (%ls)",
+ qUtf16Printable(name()));
}
return -1;
@@ -1825,8 +1839,8 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const
case TimeZoneSection:
break;
default:
- qWarning("QDateTimeParser::fieldInfo Internal error 2 (%d %s %d)",
- index, qPrintable(sn.name()), sn.count);
+ qWarning("QDateTimeParser::fieldInfo Internal error 2 (%d %ls %d)",
+ index, qUtf16Printable(sn.name()), sn.count);
break;
}
return ret;
@@ -1849,8 +1863,8 @@ QString QDateTimeParser::SectionNode::format() const
case YearSection2Digits:
case YearSection: fillChar = QLatin1Char('y'); break;
default:
- qWarning("QDateTimeParser::sectionFormat Internal error (%s)",
- qPrintable(name(type)));
+ qWarning("QDateTimeParser::sectionFormat Internal error (%ls)",
+ qUtf16Printable(name(type)));
return QString();
}
if (fillChar.isNull()) {
@@ -1878,7 +1892,7 @@ bool QDateTimeParser::potentialValue(const QStringRef &str, int min, int max, in
int val = (int)locale().toUInt(str);
const SectionNode &sn = sectionNode(index);
if (sn.type == YearSection2Digits) {
- const int year = currentValue.date().year();
+ const int year = currentValue.date().year(calendar);
val += year - (year % 100);
}
if (val >= min && val <= max && str.size() == size) {
@@ -1986,7 +2000,7 @@ QString QDateTimeParser::stateName(State s) const
#if QT_CONFIG(datestring)
bool QDateTimeParser::fromString(const QString &t, QDate *date, QTime *time) const
{
- QDateTime val(QDate(1900, 1, 1), QDATETIMEEDIT_TIME_MIN);
+ QDateTime val(QDate(1900, 1, 1).startOfDay());
const StateNode tmp = parse(t, -1, val, false);
if (tmp.state != Acceptable || tmp.conflicts) {
return false;
@@ -2014,20 +2028,20 @@ QDateTime QDateTimeParser::getMinimum() const
{
// Cache the most common case
if (spec == Qt::LocalTime) {
- static const QDateTime localTimeMin(QDATETIMEEDIT_DATE_MIN, QDATETIMEEDIT_TIME_MIN, Qt::LocalTime);
+ static const QDateTime localTimeMin(QDATETIMEEDIT_DATE_MIN.startOfDay(Qt::LocalTime));
return localTimeMin;
}
- return QDateTime(QDATETIMEEDIT_DATE_MIN, QDATETIMEEDIT_TIME_MIN, spec);
+ return QDateTime(QDATETIMEEDIT_DATE_MIN.startOfDay(spec));
}
QDateTime QDateTimeParser::getMaximum() const
{
// Cache the most common case
if (spec == Qt::LocalTime) {
- static const QDateTime localTimeMax(QDATETIMEEDIT_DATE_MAX, QDATETIMEEDIT_TIME_MAX, Qt::LocalTime);
+ static const QDateTime localTimeMax(QDATETIMEEDIT_DATE_MAX.endOfDay(Qt::LocalTime));
return localTimeMax;
}
- return QDateTime(QDATETIMEEDIT_DATE_MAX, QDATETIMEEDIT_TIME_MAX, spec);
+ return QDateTime(QDATETIMEEDIT_DATE_MAX.endOfDay(spec));
}
QString QDateTimeParser::getAmPmText(AmPm ap, Case cs) const
@@ -2048,4 +2062,13 @@ bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::S
return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count);
}
+/*!
+ Sets \a cal as the calendar to use. The default is Gregorian.
+*/
+
+void QDateTimeParser::setCalendar(const QCalendar &cal)
+{
+ calendar = cal;
+}
+
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/time/qdatetimeparser_p.h
index f7e6e351fe..e9f1455380 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/time/qdatetimeparser_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -57,6 +57,7 @@
#include "QtCore/qdatetime.h"
#include "QtCore/qstringlist.h"
#include "QtCore/qlocale.h"
+#include "QtCore/qcalendar.h"
#ifndef QT_BOOTSTRAPPED
# include "QtCore/qvariant.h"
#endif
@@ -65,14 +66,11 @@
QT_REQUIRE_CONFIG(datetimeparser);
-#define QDATETIMEEDIT_TIME_MIN QTime(0, 0, 0, 0)
-#define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999)
+#define QDATETIMEEDIT_TIME_MIN QTime(0, 0) // Prefer QDate::startOfDay()
+#define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999) // Prefer QDate::endOfDay()
#define QDATETIMEEDIT_DATE_MIN QDate(100, 1, 1)
#define QDATETIMEEDIT_COMPAT_DATE_MIN QDate(1752, 9, 14)
#define QDATETIMEEDIT_DATE_MAX QDate(9999, 12, 31)
-#define QDATETIMEEDIT_DATETIME_MIN QDateTime(QDATETIMEEDIT_DATE_MIN, QDATETIMEEDIT_TIME_MIN)
-#define QDATETIMEEDIT_COMPAT_DATETIME_MIN QDateTime(QDATETIMEEDIT_COMPAT_DATE_MIN, QDATETIMEEDIT_TIME_MIN)
-#define QDATETIMEEDIT_DATETIME_MAX QDateTime(QDATETIMEEDIT_DATE_MAX, QDATETIMEEDIT_TIME_MAX)
#define QDATETIMEEDIT_DATE_INITIAL QDate(2000, 1, 1)
QT_BEGIN_NAMESPACE
@@ -85,9 +83,9 @@ public:
FromString,
DateTimeEdit
};
- QDateTimeParser(QVariant::Type t, Context ctx)
- : currentSectionIndex(-1), display(0), cachedDay(-1), parserType(t),
- fixday(false), spec(Qt::LocalTime), context(ctx)
+ QDateTimeParser(QVariant::Type t, Context ctx, const QCalendar &cal = QCalendar())
+ : currentSectionIndex(-1), display(nullptr), cachedDay(-1), parserType(t),
+ fixday(false), spec(Qt::LocalTime), context(ctx), calendar(cal)
{
defaultLocale = QLocale::system();
first.type = FirstSection;
@@ -198,6 +196,7 @@ public:
void setDefaultLocale(const QLocale &loc) { defaultLocale = loc; }
virtual QString displayText() const { return text; }
+ void setCalendar(const QCalendar &calendar);
private:
int sectionMaxSize(Section s, int count) const;
@@ -218,9 +217,9 @@ private:
ParsedSection parseSection(const QDateTime &currentValue, int sectionIndex,
int offset, QString *text) const;
int findMonth(const QString &str1, int monthstart, int sectionIndex,
- QString *monthName = 0, int *used = 0) const;
+ int year, QString *monthName = nullptr, int *used = nullptr) const;
int findDay(const QString &str1, int intDaystart, int sectionIndex,
- QString *dayName = 0, int *used = 0) const;
+ QString *dayName = nullptr, int *used = nullptr) const;
ParsedSection findTimeZone(QStringRef str, const QDateTime &when,
int maxVal, int minVal) const;
#if QT_CONFIG(timezone)
@@ -236,7 +235,7 @@ private:
PossiblePM = 3,
PossibleBoth = 4
};
- AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
+ AmPmFinder findAmPm(QString &str, int index, int *used = nullptr) const;
#endif // datestring
bool potentialValue(const QStringRef &str, int min, int max, int index,
@@ -300,6 +299,7 @@ protected: // for the benefit of QDateTimeEditPrivate
bool fixday;
Qt::TimeSpec spec; // spec if used by QDateTimeEdit
Context context;
+ QCalendar calendar;
};
Q_DECLARE_TYPEINFO(QDateTimeParser::SectionNode, Q_PRIMITIVE_TYPE);
diff --git a/src/corelib/time/qgregoriancalendar.cpp b/src/corelib/time/qgregoriancalendar.cpp
new file mode 100644
index 0000000000..633b1ea94e
--- /dev/null
+++ b/src/corelib/time/qgregoriancalendar.cpp
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qgregoriancalendar_p.h"
+#include "qcalendarmath_p.h"
+#include <QtCore/qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QRoundingDown;
+
+/*!
+ \since 5.14
+
+ \class QGregorianCalendar
+ \inmodule QtCore
+ \brief The QGregorianCalendar class implements the Gregorian calendar.
+
+ \section1 The Gregorian Calendar
+
+ The Gregorian calendar is a refinement of the earlier Julian calendar,
+ itself a late form of the Roman calendar. It is widely used.
+
+ \sa QRomanCalendar, QJulianCalendar, QCalendar
+*/
+
+QGregorianCalendar::QGregorianCalendar()
+ : QRomanCalendar(QStringLiteral("Gregorian"), QCalendar::System::Gregorian)
+{
+ registerAlias(QStringLiteral("gregory"));
+}
+
+QString QGregorianCalendar::name() const
+{
+ return QStringLiteral("Gregorian");
+}
+
+QCalendar::System QGregorianCalendar::calendarSystem() const
+{
+ return QCalendar::System::Gregorian;
+}
+
+bool QGregorianCalendar::isLeapYear(int year) const
+{
+ return leapTest(year);
+}
+
+bool QGregorianCalendar::leapTest(int year)
+{
+ if (year == QCalendar::Unspecified)
+ return false;
+
+ // No year 0 in Gregorian calendar, so -1, -5, -9 etc are leap years
+ if (year < 1)
+ ++year;
+
+ return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);
+}
+
+// Duplicating code from QRomanCalendar, but inlining isLeapYear() as leapTest():
+int QGregorianCalendar::monthLength(int month, int year)
+{
+ if (month < 1 || month > 12)
+ return 0;
+
+ if (month == 2)
+ return leapTest(year) ? 29 : 28;
+
+ return 30 | ((month & 1) ^ (month >> 3));
+}
+
+bool QGregorianCalendar::validParts(int year, int month, int day)
+{
+ return year && 0 < day && day <= monthLength(month, year);
+}
+
+int QGregorianCalendar::weekDayOfJulian(qint64 jd)
+{
+ return qMod(jd, 7) + 1;
+}
+
+bool QGregorianCalendar::dateToJulianDay(int year, int month, int day, qint64 *jd) const
+{
+ return julianFromParts(year, month, day, jd);
+}
+
+bool QGregorianCalendar::julianFromParts(int year, int month, int day, qint64 *jd)
+{
+ Q_ASSERT(jd);
+ if (!validParts(year, month, day))
+ return false;
+
+ if (year < 0)
+ ++year;
+
+ /*
+ * Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php
+ * This formula is correct for all julian days, when using mathematical integer
+ * division (round to negative infinity), not c++11 integer division (round to zero)
+ */
+ int a = month < 3 ? 1 : 0;
+ qint64 y = qint64(year) + 4800 - a;
+ int m = month + 12 * a - 3;
+ *jd = day + qDiv(153 * m + 2, 5) - 32045
+ + 365 * y + qDiv(y, 4) - qDiv(y, 100) + qDiv(y, 400);
+ return true;
+}
+
+QCalendar::YearMonthDay QGregorianCalendar::julianDayToDate(qint64 jd) const
+{
+ return partsFromJulian(jd);
+}
+
+QCalendar::YearMonthDay QGregorianCalendar::partsFromJulian(qint64 jd)
+{
+ /*
+ * Math from The Calendar FAQ at http://www.tondering.dk/claus/cal/julperiod.php
+ * This formula is correct for all julian days, when using mathematical integer
+ * division (round to negative infinity), not c++11 integer division (round to zero)
+ */
+ qint64 a = jd + 32044;
+ qint64 b = qDiv(4 * a + 3, 146097);
+ int c = a - qDiv(146097 * b, 4);
+
+ int d = qDiv(4 * c + 3, 1461);
+ int e = c - qDiv(1461 * d, 4);
+ int m = qDiv(5 * e + 2, 153);
+
+ int y = 100 * b + d - 4800 + qDiv(m, 10);
+
+ // Adjust for no year 0
+ int year = y > 0 ? y : y - 1;
+ int month = m + 3 - 12 * qDiv(m, 10);
+ int day = e - qDiv(153 * m + 2, 5) + 1;
+
+ return QCalendar::YearMonthDay(year, month, day);
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qgregoriancalendar_p.h b/src/corelib/time/qgregoriancalendar_p.h
new file mode 100644
index 0000000000..191f9c127b
--- /dev/null
+++ b/src/corelib/time/qgregoriancalendar_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGREGORIAN_CALENDAR_P_H
+#define QGREGORIAN_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qromancalendar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QGregorianCalendar : public QRomanCalendar
+{
+ // TODO: provide static methods, called by the overrides, that can be called
+ // directly by QDate to optimize various parts.
+public:
+ QGregorianCalendar();
+ // CAlendar properties:
+ QString name() const override;
+ QCalendar::System calendarSystem() const override;
+ // Date queries:
+ bool isLeapYear(int year) const override;
+ // Julian Day conversions:
+ bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
+ QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
+
+ // Names of months (implemented in qlocale.cpp):
+ QString monthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const override;
+ QString standaloneMonthName(const QLocale &locale, int month, int year,
+ QLocale::FormatType format) const override;
+
+ // Static optimized versions for the benefit of QDate:
+ static int weekDayOfJulian(qint64 jd);
+ static bool leapTest(int year);
+ static int monthLength(int month, int year);
+ static bool validParts(int year, int month, int day);
+ static QCalendar::YearMonthDay partsFromJulian(qint64 jd);
+ static bool julianFromParts(int year, int month, int day, qint64 *jd);
+};
+
+QT_END_NAMESPACE
+
+#endif // QGREGORIAN_CALENDAR_P_H
diff --git a/src/corelib/time/qhijricalendar.cpp b/src/corelib/time/qhijricalendar.cpp
new file mode 100644
index 0000000000..b5d89fbc5c
--- /dev/null
+++ b/src/corelib/time/qhijricalendar.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+#include "qhijricalendar_p.h"
+#include "qhijricalendar_data_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \since 5.14
+ \internal
+
+ \class QHijriCalendar
+ \inmodule QtCore
+ \brief The QHijriCalendar class supports Islamic (Hijri) calendar implementations.
+
+ \section1 Islamic Calendar System
+
+ The Islamic, Muslim, or Hijri calendar is a lunar calendar consisting of 12
+ months in a year of 354 or 355 days. It is used (often alongside the
+ Gregorian calendar) to date events in many Muslim countries. It is also used
+ by Muslims to determine the proper days of Islamic holidays and rituals,
+ such as the annual period of fasting and the proper time for the pilgrimage
+ to Mecca.
+
+ Source: \l {https://en.wikipedia.org/wiki/Islamic_calendar}{Wikipedia page
+ on Hijri Calendar}
+
+ \section1 Support for variants
+
+ This base class provides the common details shared by all variants on the
+ Islamic calendar. Each year comprises 12 months of 29 or 30 days each; most
+ years have as many of 29 as of 30, but leap years extend one 29-day month to
+ 30 days. In tabular versions of the calendar (where mathematical rules are
+ used to determine the details), odd-numbered months have 30 days, as does
+ the last (twelfth) month of a leap year; all other months have 29
+ days. Other versions are based on actual astronomical observations of the
+ moon's phase at sunset, which vary from place to place.
+
+ \sa QIslamicCivilCalendar, QCalendar
+*/
+
+bool QHijriCalendar::isLunar() const
+{
+ return true;
+}
+
+bool QHijriCalendar::isLuniSolar() const
+{
+ return false;
+}
+
+bool QHijriCalendar::isSolar() const
+{
+ return false;
+}
+
+int QHijriCalendar::daysInMonth(int month, int year) const
+{
+ if (year == 0 || month < 1 || month > 12)
+ return 0;
+
+ if (month == 12 && isLeapYear(year))
+ return 30;
+
+ return month % 2 == 0 ? 29 : 30;
+}
+
+int QHijriCalendar::maximumDaysInMonth() const
+{
+ return 30;
+}
+
+int QHijriCalendar::daysInYear(int year) const
+{
+ return monthsInYear(year) ? isLeapYear(year) ? 355 : 354 : 0;
+}
+
+const QCalendarLocale *QHijriCalendar::localeMonthIndexData() const
+{
+ return locale_data;
+}
+
+const ushort *QHijriCalendar::localeMonthData() const
+{
+ return months_data;
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qhijricalendar_data_p.h b/src/corelib/time/qhijricalendar_data_p.h
new file mode 100644
index 0000000000..66039e9e5d
--- /dev/null
+++ b/src/corelib/time/qhijricalendar_data_p.h
@@ -0,0 +1,1205 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QHIJRI_CALENDAR_DATA_P_H
+#define QHIJRI_CALENDAR_DATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+#include <QtCore/private/qcalendarbackend_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// GENERATED PART STARTS HERE
+
+/*
+ This part of the file was generated on 2019-10-24 from the
+ Common Locale Data Repository v36
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this section: instead regenerate it using
+ cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+static const QCalendarLocale locale_data[] = {
+ // lang script terr sShort sLong sNarrow short long narrow
+ { 1, 0, 0,{ 0,79 },{ 79,107 },{ 186,29 },{ 0,79 },{ 79,107 },{ 186,29 }}, // C/AnyScript/AnyCountry
+ { 3, 7, 69,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Oromo/Latin/Ethiopia
+ { 3, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Oromo/Latin/Kenya
+ { 4, 7, 69,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Afar/Latin/Ethiopia
+ { 5, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Afrikaans/Latin/South Africa
+ { 5, 7, 148,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Afrikaans/Latin/Namibia
+ { 6, 7, 2,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Albanian/Latin/Albania
+ { 6, 7, 127,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Albanian/Latin/Macedonia
+ { 6, 7, 257,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Albanian/Latin/Kosovo
+ { 7, 14, 69,{ 0,79 },{ 242,75 },{ 215,27 },{ 0,79 },{ 242,75 },{ 215,27 }}, // Amharic/Ethiopic/Ethiopia
+ { 8, 1, 64,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Egypt
+ { 8, 1, 3,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Algeria
+ { 8, 1, 17,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Bahrain
+ { 8, 1, 42,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Chad
+ { 8, 1, 48,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Comoros
+ { 8, 1, 59,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Djibouti
+ { 8, 1, 67,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Eritrea
+ { 8, 1, 103,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Iraq
+ { 8, 1, 105,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Israel
+ { 8, 1, 109,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Jordan
+ { 8, 1, 115,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Kuwait
+ { 8, 1, 119,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Lebanon
+ { 8, 1, 122,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Libya
+ { 8, 1, 136,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Mauritania
+ { 8, 1, 145,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Morocco
+ { 8, 1, 162,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Oman
+ { 8, 1, 165,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Palestinian Territories
+ { 8, 1, 175,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Qatar
+ { 8, 1, 186,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Saudi Arabia
+ { 8, 1, 194,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Somalia
+ { 8, 1, 201,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Sudan
+ { 8, 1, 207,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Syria
+ { 8, 1, 216,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Tunisia
+ { 8, 1, 223,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/United Arab Emirates
+ { 8, 1, 236,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Western Sahara
+ { 8, 1, 237,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/Yemen
+ { 8, 1, 254,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/South Sudan
+ { 8, 1, 260,{ 317,97 },{ 317,97 },{ 414,27 },{ 317,97 },{ 317,97 },{ 414,27 }}, // Arabic/Arabic/World
+ { 9, 10, 11,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Armenian/Armenian/Armenia
+ { 10, 11, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Assamese/Bengali/India
+ { 12, 7, 15,{ 441,72 },{ 513,111 },{ 215,27 },{ 441,72 },{ 513,111 },{ 215,27 }}, // Azerbaijani/Latin/Azerbaijan
+ { 12, 1, 102,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Azerbaijani/Arabic/Iran
+ { 12, 2, 15,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Azerbaijani/Cyrillic/Azerbaijan
+ { 13, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bashkir/Cyrillic/Russia
+ { 14, 7, 197,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Basque/Latin/Spain
+ { 15, 11, 18,{ 624,105 },{ 624,105 },{ 729,27 },{ 624,105 },{ 624,105 },{ 729,27 }}, // Bengali/Bengali/Bangladesh
+ { 15, 11, 100,{ 624,105 },{ 624,105 },{ 729,27 },{ 624,105 },{ 624,105 },{ 729,27 }}, // Bengali/Bengali/India
+ { 16, 31, 25,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Dzongkha/Tibetan/Bhutan
+ { 19, 7, 74,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Breton/Latin/France
+ { 20, 2, 33,{ 0,79 },{ 756,97 },{ 215,27 },{ 0,79 },{ 756,97 },{ 215,27 }}, // Bulgarian/Cyrillic/Bulgaria
+ { 21, 25, 147,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Burmese/Myanmar/Myanmar
+ { 22, 2, 20,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Belarusian/Cyrillic/Belarus
+ { 23, 20, 36,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Khmer/Khmer/Cambodia
+ { 24, 7, 197,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Catalan/Latin/Spain
+ { 24, 7, 5,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Catalan/Latin/Andorra
+ { 24, 7, 74,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Catalan/Latin/France
+ { 24, 7, 106,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Catalan/Latin/Italy
+ { 25, 5, 44,{ 853,39 },{ 892,38 },{ 215,27 },{ 853,39 },{ 892,38 },{ 215,27 }}, // Chinese/Simplified Han/China
+ { 25, 5, 97,{ 853,39 },{ 892,38 },{ 215,27 },{ 853,39 },{ 892,38 },{ 215,27 }}, // Chinese/Simplified Han/Hong Kong
+ { 25, 5, 126,{ 853,39 },{ 892,38 },{ 215,27 },{ 853,39 },{ 892,38 },{ 215,27 }}, // Chinese/Simplified Han/Macau
+ { 25, 5, 190,{ 853,39 },{ 892,38 },{ 215,27 },{ 853,39 },{ 892,38 },{ 215,27 }}, // Chinese/Simplified Han/Singapore
+ { 25, 6, 97,{ 930,72 },{ 930,72 },{ 215,27 },{ 930,72 },{ 930,72 },{ 215,27 }}, // Chinese/Traditional Han/Hong Kong
+ { 25, 6, 126,{ 930,72 },{ 930,72 },{ 215,27 },{ 930,72 },{ 930,72 },{ 215,27 }}, // Chinese/Traditional Han/Macau
+ { 25, 6, 208,{ 930,72 },{ 930,72 },{ 215,27 },{ 930,72 },{ 930,72 },{ 215,27 }}, // Chinese/Traditional Han/Taiwan
+ { 26, 7, 74,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Corsican/Latin/France
+ { 27, 7, 54,{ 0,79 },{ 79,107 },{ 1002,39 },{ 0,79 },{ 79,107 },{ 1002,39 }}, // Croatian/Latin/Croatia
+ { 27, 7, 27,{ 0,79 },{ 79,107 },{ 1002,39 },{ 0,79 },{ 79,107 },{ 1002,39 }}, // Croatian/Latin/Bosnia And Herzegowina
+ { 28, 7, 57,{ 1041,77 },{ 1118,130 },{ 215,27 },{ 1041,77 },{ 1118,130 },{ 215,27 }}, // Czech/Latin/Czech Republic
+ { 29, 7, 58,{ 0,79 },{ 1248,107 },{ 215,27 },{ 0,79 },{ 1248,107 },{ 215,27 }}, // Danish/Latin/Denmark
+ { 29, 7, 86,{ 0,79 },{ 1248,107 },{ 215,27 },{ 0,79 },{ 1248,107 },{ 215,27 }}, // Danish/Latin/Greenland
+ { 30, 7, 151,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Netherlands
+ { 30, 7, 12,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Aruba
+ { 30, 7, 21,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Belgium
+ { 30, 7, 152,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Cura Sao
+ { 30, 7, 202,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Suriname
+ { 30, 7, 255,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Bonaire
+ { 30, 7, 256,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Dutch/Latin/Sint Maarten
+ { 31, 7, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/United States
+ { 31, 3, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Deseret/United States
+ { 31, 7, 4,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/American Samoa
+ { 31, 7, 7,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Anguilla
+ { 31, 7, 9,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Antigua And Barbuda
+ { 31, 7, 13,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Australia
+ { 31, 7, 14,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Austria
+ { 31, 7, 16,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Bahamas
+ { 31, 7, 19,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Barbados
+ { 31, 7, 21,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Belgium
+ { 31, 7, 22,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Belize
+ { 31, 7, 24,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Bermuda
+ { 31, 7, 28,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Botswana
+ { 31, 7, 31,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/British Indian Ocean Territory
+ { 31, 7, 35,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Burundi
+ { 31, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Cameroon
+ { 31, 7, 38,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Canada
+ { 31, 7, 40,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Cayman Islands
+ { 31, 7, 45,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Christmas Island
+ { 31, 7, 46,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Cocos Islands
+ { 31, 7, 51,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Cook Islands
+ { 31, 7, 56,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Cyprus
+ { 31, 7, 58,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Denmark
+ { 31, 7, 60,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Dominica
+ { 31, 7, 67,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Eritrea
+ { 31, 7, 70,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Falkland Islands
+ { 31, 7, 72,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Fiji
+ { 31, 7, 73,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Finland
+ { 31, 7, 75,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Guernsey
+ { 31, 7, 80,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Gambia
+ { 31, 7, 82,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Germany
+ { 31, 7, 83,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Ghana
+ { 31, 7, 84,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Gibraltar
+ { 31, 7, 87,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Grenada
+ { 31, 7, 89,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Guam
+ { 31, 7, 93,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Guyana
+ { 31, 7, 97,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Hong Kong
+ { 31, 7, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/India
+ { 31, 7, 104,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Ireland
+ { 31, 7, 105,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Israel
+ { 31, 7, 107,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Jamaica
+ { 31, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Kenya
+ { 31, 7, 112,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Kiribati
+ { 31, 7, 120,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Lesotho
+ { 31, 7, 121,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Liberia
+ { 31, 7, 126,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Macau
+ { 31, 7, 128,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Madagascar
+ { 31, 7, 129,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Malawi
+ { 31, 7, 130,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Malaysia
+ { 31, 7, 133,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Malta
+ { 31, 7, 134,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Marshall Islands
+ { 31, 7, 137,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Mauritius
+ { 31, 7, 140,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Micronesia
+ { 31, 7, 144,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Montserrat
+ { 31, 7, 148,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Namibia
+ { 31, 7, 149,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Nauru
+ { 31, 7, 151,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Netherlands
+ { 31, 7, 154,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/New Zealand
+ { 31, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Nigeria
+ { 31, 7, 158,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Niue
+ { 31, 7, 159,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Norfolk Island
+ { 31, 7, 160,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Northern Mariana Islands
+ { 31, 7, 163,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Pakistan
+ { 31, 7, 164,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Palau
+ { 31, 7, 167,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Papua New Guinea
+ { 31, 7, 170,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Philippines
+ { 31, 7, 171,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Pitcairn
+ { 31, 7, 174,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Puerto Rico
+ { 31, 7, 179,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Rwanda
+ { 31, 7, 180,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Saint Kitts And Nevis
+ { 31, 7, 181,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Saint Lucia
+ { 31, 7, 182,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Saint Vincent And The Grenadines
+ { 31, 7, 183,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Samoa
+ { 31, 7, 188,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Seychelles
+ { 31, 7, 189,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Sierra Leone
+ { 31, 7, 190,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Singapore
+ { 31, 7, 192,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Slovenia
+ { 31, 7, 193,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Solomon Islands
+ { 31, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/South Africa
+ { 31, 7, 199,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Saint Helena
+ { 31, 7, 201,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Sudan
+ { 31, 7, 204,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Swaziland
+ { 31, 7, 205,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Sweden
+ { 31, 7, 206,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Switzerland
+ { 31, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Tanzania
+ { 31, 7, 213,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Tokelau
+ { 31, 7, 214,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Tonga
+ { 31, 7, 215,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Trinidad And Tobago
+ { 31, 7, 219,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Turks And Caicos Islands
+ { 31, 7, 220,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Tuvalu
+ { 31, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Uganda
+ { 31, 7, 223,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/United Arab Emirates
+ { 31, 7, 224,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/United Kingdom
+ { 31, 7, 226,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/United States Minor Outlying Islands
+ { 31, 7, 229,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Vanuatu
+ { 31, 7, 233,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/British Virgin Islands
+ { 31, 7, 234,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/United States Virgin Islands
+ { 31, 7, 239,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Zambia
+ { 31, 7, 240,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Zimbabwe
+ { 31, 7, 249,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Diego Garcia
+ { 31, 7, 251,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Isle Of Man
+ { 31, 7, 252,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Jersey
+ { 31, 7, 254,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/South Sudan
+ { 31, 7, 256,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Sint Maarten
+ { 31, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/World
+ { 31, 7, 261,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // English/Latin/Europe
+ { 32, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Esperanto/Latin/World
+ { 33, 7, 68,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Estonian/Latin/Estonia
+ { 34, 7, 71,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Faroese/Latin/Faroe Islands
+ { 34, 7, 58,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Faroese/Latin/Denmark
+ { 36, 7, 73,{ 0,79 },{ 1574,130 },{ 215,27 },{ 0,79 },{ 1574,130 },{ 215,27 }}, // Finnish/Latin/Finland
+ { 37, 7, 74,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/France
+ { 37, 7, 3,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Algeria
+ { 37, 7, 21,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Belgium
+ { 37, 7, 23,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Benin
+ { 37, 7, 34,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Burkina Faso
+ { 37, 7, 35,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Burundi
+ { 37, 7, 37,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Cameroon
+ { 37, 7, 38,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Canada
+ { 37, 7, 41,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Central African Republic
+ { 37, 7, 42,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Chad
+ { 37, 7, 48,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Comoros
+ { 37, 7, 49,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Congo Kinshasa
+ { 37, 7, 50,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Congo Brazzaville
+ { 37, 7, 53,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Ivory Coast
+ { 37, 7, 59,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Djibouti
+ { 37, 7, 66,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Equatorial Guinea
+ { 37, 7, 76,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/French Guiana
+ { 37, 7, 77,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/French Polynesia
+ { 37, 7, 79,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Gabon
+ { 37, 7, 88,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Guadeloupe
+ { 37, 7, 91,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Guinea
+ { 37, 7, 94,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Haiti
+ { 37, 7, 125,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Luxembourg
+ { 37, 7, 128,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Madagascar
+ { 37, 7, 132,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Mali
+ { 37, 7, 135,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Martinique
+ { 37, 7, 136,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Mauritania
+ { 37, 7, 137,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Mauritius
+ { 37, 7, 138,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Mayotte
+ { 37, 7, 142,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Monaco
+ { 37, 7, 145,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Morocco
+ { 37, 7, 153,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/New Caledonia
+ { 37, 7, 156,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Niger
+ { 37, 7, 176,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Reunion
+ { 37, 7, 179,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Rwanda
+ { 37, 7, 187,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Senegal
+ { 37, 7, 188,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Seychelles
+ { 37, 7, 200,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Saint Pierre And Miquelon
+ { 37, 7, 206,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Switzerland
+ { 37, 7, 207,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Syria
+ { 37, 7, 212,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Togo
+ { 37, 7, 216,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Tunisia
+ { 37, 7, 229,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Vanuatu
+ { 37, 7, 235,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Wallis And Futuna Islands
+ { 37, 7, 244,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Saint Barthelemy
+ { 37, 7, 245,{ 1704,91 },{ 1795,140 },{ 215,27 },{ 1935,91 },{ 1795,140 },{ 215,27 }}, // French/Latin/Saint Martin
+ { 38, 7, 151,{ 1355,84 },{ 1439,135 },{ 215,27 },{ 1355,84 },{ 1439,135 },{ 215,27 }}, // Western Frisian/Latin/Netherlands
+ { 39, 7, 224,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Gaelic/Latin/United Kingdom
+ { 40, 7, 197,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Galician/Latin/Spain
+ { 41, 15, 81,{ 2026,74 },{ 2100,125 },{ 215,27 },{ 2026,74 },{ 2100,125 },{ 215,27 }}, // Georgian/Georgian/Georgia
+ { 42, 7, 82,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Germany
+ { 42, 7, 14,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Austria
+ { 42, 7, 21,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Belgium
+ { 42, 7, 106,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Italy
+ { 42, 7, 123,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Liechtenstein
+ { 42, 7, 125,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Luxembourg
+ { 42, 7, 206,{ 0,79 },{ 2225,117 },{ 215,27 },{ 0,79 },{ 2225,117 },{ 215,27 }}, // German/Latin/Switzerland
+ { 43, 16, 85,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Greek/Greek/Greece
+ { 43, 16, 56,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Greek/Greek/Cyprus
+ { 44, 7, 86,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Greenlandic/Latin/Greenland
+ { 45, 7, 168,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Guarani/Latin/Paraguay
+ { 46, 17, 100,{ 2342,75 },{ 2417,99 },{ 215,27 },{ 2342,75 },{ 2417,99 },{ 215,27 }}, // Gujarati/Gujarati/India
+ { 47, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Hausa/Latin/Nigeria
+ { 47, 1, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Hausa/Arabic/Nigeria
+ { 47, 7, 83,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Hausa/Latin/Ghana
+ { 47, 7, 156,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Hausa/Latin/Niger
+ { 48, 18, 105,{ 2516,96 },{ 2612,117 },{ 215,27 },{ 2516,96 },{ 2729,117 },{ 215,27 }}, // Hebrew/Hebrew/Israel
+ { 49, 13, 100,{ 0,79 },{ 2846,109 },{ 215,27 },{ 0,79 },{ 2846,109 },{ 215,27 }}, // Hindi/Devanagari/India
+ { 50, 7, 98,{ 2955,77 },{ 3032,100 },{ 215,27 },{ 2955,77 },{ 3132,128 },{ 215,27 }}, // Hungarian/Latin/Hungary
+ { 51, 7, 99,{ 3260,79 },{ 1248,107 },{ 215,27 },{ 3260,79 },{ 1248,107 },{ 215,27 }}, // Icelandic/Latin/Iceland
+ { 52, 7, 101,{ 3339,87 },{ 3426,110 },{ 215,27 },{ 3339,87 },{ 3426,110 },{ 215,27 }}, // Indonesian/Latin/Indonesia
+ { 53, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Interlingua/Latin/World
+ { 55, 44, 38,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Inuktitut/Canadian Aboriginal/Canada
+ { 55, 7, 38,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Inuktitut/Latin/Canada
+ { 57, 7, 104,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Irish/Latin/Ireland
+ { 57, 7, 224,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Irish/Latin/United Kingdom
+ { 58, 7, 106,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Italian/Latin/Italy
+ { 58, 7, 184,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Italian/Latin/San Marino
+ { 58, 7, 206,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Italian/Latin/Switzerland
+ { 58, 7, 230,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Italian/Latin/Vatican City State
+ { 59, 19, 108,{ 3536,98 },{ 3536,98 },{ 215,27 },{ 3536,98 },{ 3536,98 },{ 215,27 }}, // Japanese/Japanese/Japan
+ { 60, 7, 101,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Javanese/Latin/Indonesia
+ { 61, 21, 100,{ 3634,80 },{ 3714,101 },{ 215,27 },{ 3634,80 },{ 3714,101 },{ 215,27 }}, // Kannada/Kannada/India
+ { 62, 1, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kashmiri/Arabic/India
+ { 63, 2, 110,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kazakh/Cyrillic/Kazakhstan
+ { 64, 7, 179,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kinyarwanda/Latin/Rwanda
+ { 65, 2, 116,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kirghiz/Cyrillic/Kyrgyzstan
+ { 66, 22, 114,{ 0,79 },{ 3815,70 },{ 215,27 },{ 0,79 },{ 3815,70 },{ 215,27 }}, // Korean/Korean/South Korea
+ { 66, 22, 113,{ 0,79 },{ 3815,70 },{ 215,27 },{ 0,79 },{ 3815,70 },{ 215,27 }}, // Korean/Korean/North Korea
+ { 67, 7, 217,{ 0,79 },{ 3885,110 },{ 215,27 },{ 0,79 },{ 3885,110 },{ 215,27 }}, // Kurdish/Latin/Turkey
+ { 68, 7, 35,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Rundi/Latin/Burundi
+ { 69, 23, 117,{ 3995,76 },{ 4071,96 },{ 215,27 },{ 4167,78 },{ 4071,96 },{ 215,27 }}, // Lao/Lao/Laos
+ { 71, 7, 118,{ 0,79 },{ 4245,109 },{ 215,27 },{ 0,79 },{ 4245,109 },{ 215,27 }}, // Latvian/Latin/Latvia
+ { 72, 7, 49,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lingala/Latin/Congo Kinshasa
+ { 72, 7, 6,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lingala/Latin/Angola
+ { 72, 7, 41,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lingala/Latin/Central African Republic
+ { 72, 7, 50,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lingala/Latin/Congo Brazzaville
+ { 73, 7, 124,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lithuanian/Latin/Lithuania
+ { 74, 2, 127,{ 4354,72 },{ 4426,90 },{ 215,27 },{ 4354,72 },{ 4426,90 },{ 215,27 }}, // Macedonian/Cyrillic/Macedonia
+ { 75, 7, 128,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Malagasy/Latin/Madagascar
+ { 76, 7, 130,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Malay/Latin/Malaysia
+ { 76, 1, 130,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Malay/Arabic/Malaysia
+ { 76, 7, 32,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Malay/Latin/Brunei
+ { 76, 7, 190,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Malay/Latin/Singapore
+ { 77, 24, 100,{ 4516,98 },{ 4614,103 },{ 4717,27 },{ 4516,98 },{ 4744,103 },{ 4717,27 }}, // Malayalam/Malayalam/India
+ { 78, 7, 133,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Maltese/Latin/Malta
+ { 79, 7, 154,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Maori/Latin/New Zealand
+ { 80, 13, 100,{ 4847,79 },{ 4926,88 },{ 5014,27 },{ 4847,79 },{ 4926,88 },{ 5014,27 }}, // Marathi/Devanagari/India
+ { 82, 2, 143,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Mongolian/Cyrillic/Mongolia
+ { 82, 8, 44,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Mongolian/Mongolian/China
+ { 84, 13, 150,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nepali/Devanagari/Nepal
+ { 84, 13, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nepali/Devanagari/India
+ { 85, 7, 161,{ 5041,79 },{ 5120,107 },{ 215,27 },{ 5227,79 },{ 5120,107 },{ 215,27 }}, // Norwegian Bokmal/Latin/Norway
+ { 85, 7, 203,{ 5041,79 },{ 5120,107 },{ 215,27 },{ 5227,79 },{ 5120,107 },{ 215,27 }}, // Norwegian Bokmal/Latin/Svalbard And Jan Mayen Islands
+ { 86, 7, 74,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Occitan/Latin/France
+ { 87, 26, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Oriya/Oriya/India
+ { 88, 1, 1,{ 5306,74 },{ 5380,75 },{ 215,27 },{ 5455,74 },{ 5529,76 },{ 215,27 }}, // Pashto/Arabic/Afghanistan
+ { 88, 1, 163,{ 5306,74 },{ 5605,80 },{ 215,27 },{ 5455,74 },{ 5685,81 },{ 215,27 }}, // Pashto/Arabic/Pakistan
+ { 89, 1, 102,{ 5766,91 },{ 5766,91 },{ 5857,24 },{ 5881,93 },{ 5881,93 },{ 5857,24 }}, // Persian/Arabic/Iran
+ { 89, 1, 1,{ 5766,91 },{ 5766,91 },{ 5857,24 },{ 5881,93 },{ 5881,93 },{ 5857,24 }}, // Persian/Arabic/Afghanistan
+ { 90, 7, 172,{ 5974,78 },{ 6052,108 },{ 215,27 },{ 5974,78 },{ 6052,108 },{ 215,27 }}, // Polish/Latin/Poland
+ { 91, 7, 30,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Brazil
+ { 91, 7, 6,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Angola
+ { 91, 7, 39,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Cape Verde
+ { 91, 7, 62,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/East Timor
+ { 91, 7, 66,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Equatorial Guinea
+ { 91, 7, 92,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Guinea Bissau
+ { 91, 7, 125,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Luxembourg
+ { 91, 7, 126,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Macau
+ { 91, 7, 146,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Mozambique
+ { 91, 7, 173,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Portugal
+ { 91, 7, 185,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Sao Tome And Principe
+ { 91, 7, 206,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Portuguese/Latin/Switzerland
+ { 92, 4, 100,{ 6160,78 },{ 6238,93 },{ 215,27 },{ 6160,78 },{ 6331,95 },{ 215,27 }}, // Punjabi/Gurmukhi/India
+ { 92, 1, 163,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Punjabi/Arabic/Pakistan
+ { 93, 7, 169,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Quechua/Latin/Peru
+ { 93, 7, 26,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Quechua/Latin/Bolivia
+ { 93, 7, 63,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Quechua/Latin/Ecuador
+ { 94, 7, 206,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Romansh/Latin/Switzerland
+ { 95, 7, 177,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Romanian/Latin/Romania
+ { 95, 7, 141,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Romanian/Latin/Moldova
+ { 96, 2, 178,{ 6426,80 },{ 6506,132 },{ 215,27 },{ 6426,80 },{ 6506,132 },{ 215,27 }}, // Russian/Cyrillic/Russia
+ { 96, 2, 20,{ 6426,80 },{ 6506,132 },{ 215,27 },{ 6426,80 },{ 6506,132 },{ 215,27 }}, // Russian/Cyrillic/Belarus
+ { 96, 2, 110,{ 6426,80 },{ 6506,132 },{ 215,27 },{ 6426,80 },{ 6506,132 },{ 215,27 }}, // Russian/Cyrillic/Kazakhstan
+ { 96, 2, 116,{ 6426,80 },{ 6506,132 },{ 215,27 },{ 6426,80 },{ 6506,132 },{ 215,27 }}, // Russian/Cyrillic/Kyrgyzstan
+ { 96, 2, 141,{ 6426,80 },{ 6506,132 },{ 215,27 },{ 6426,80 },{ 6506,132 },{ 215,27 }}, // Russian/Cyrillic/Moldova
+ { 96, 2, 222,{ 6426,80 },{ 6506,132 },{ 215,27 },{ 6426,80 },{ 6506,132 },{ 215,27 }}, // Russian/Cyrillic/Ukraine
+ { 98, 7, 41,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sango/Latin/Central African Republic
+ { 99, 13, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sanskrit/Devanagari/India
+ { 100, 2, 243,{ 6638,70 },{ 6708,91 },{ 215,27 },{ 6638,70 },{ 6799,98 },{ 215,27 }}, // Serbian/Cyrillic/Serbia
+ { 100, 2, 27,{ 6638,70 },{ 6708,91 },{ 215,27 },{ 6638,70 },{ 6799,98 },{ 215,27 }}, // Serbian/Cyrillic/Bosnia And Herzegowina
+ { 100, 2, 242,{ 6638,70 },{ 6708,91 },{ 215,27 },{ 6638,70 },{ 6799,98 },{ 215,27 }}, // Serbian/Cyrillic/Montenegro
+ { 100, 2, 257,{ 6638,70 },{ 6708,91 },{ 215,27 },{ 6638,70 },{ 6799,98 },{ 215,27 }}, // Serbian/Cyrillic/Kosovo
+ { 100, 7, 27,{ 6897,73 },{ 6970,95 },{ 215,27 },{ 6897,73 },{ 7065,98 },{ 215,27 }}, // Serbian/Latin/Bosnia And Herzegowina
+ { 100, 7, 242,{ 6897,73 },{ 6970,95 },{ 215,27 },{ 6897,73 },{ 7065,98 },{ 215,27 }}, // Serbian/Latin/Montenegro
+ { 100, 7, 243,{ 6897,73 },{ 6970,95 },{ 215,27 },{ 6897,73 },{ 7065,98 },{ 215,27 }}, // Serbian/Latin/Serbia
+ { 100, 7, 257,{ 6897,73 },{ 6970,95 },{ 215,27 },{ 6897,73 },{ 7065,98 },{ 215,27 }}, // Serbian/Latin/Kosovo
+ { 101, 2, 81,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ossetic/Cyrillic/Georgia
+ { 101, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ossetic/Cyrillic/Russia
+ { 102, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Southern Sotho/Latin/South Africa
+ { 103, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tswana/Latin/South Africa
+ { 104, 7, 240,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Shona/Latin/Zimbabwe
+ { 105, 1, 163,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sindhi/Arabic/Pakistan
+ { 106, 32, 198,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sinhala/Sinhala/Sri Lanka
+ { 107, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swati/Latin/South Africa
+ { 108, 7, 191,{ 7163,79 },{ 7242,136 },{ 215,27 },{ 7163,79 },{ 7242,136 },{ 215,27 }}, // Slovak/Latin/Slovakia
+ { 109, 7, 192,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Slovenian/Latin/Slovenia
+ { 110, 7, 194,{ 7378,75 },{ 7453,132 },{ 215,27 },{ 7585,79 },{ 7664,131 },{ 215,27 }}, // Somali/Latin/Somalia
+ { 110, 7, 59,{ 7378,75 },{ 7453,132 },{ 215,27 },{ 7585,79 },{ 7664,131 },{ 215,27 }}, // Somali/Latin/Djibouti
+ { 110, 7, 69,{ 7378,75 },{ 7453,132 },{ 215,27 },{ 7585,79 },{ 7664,131 },{ 215,27 }}, // Somali/Latin/Ethiopia
+ { 110, 7, 111,{ 7378,75 },{ 7453,132 },{ 215,27 },{ 7585,79 },{ 7664,131 },{ 215,27 }}, // Somali/Latin/Kenya
+ { 111, 7, 197,{ 5227,79 },{ 7795,107 },{ 215,27 },{ 5227,79 },{ 7795,107 },{ 215,27 }}, // Spanish/Latin/Spain
+ { 111, 7, 10,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Argentina
+ { 111, 7, 22,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Belize
+ { 111, 7, 26,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Bolivia
+ { 111, 7, 30,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Brazil
+ { 111, 7, 43,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Chile
+ { 111, 7, 47,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Colombia
+ { 111, 7, 52,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Costa Rica
+ { 111, 7, 55,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Cuba
+ { 111, 7, 61,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Dominican Republic
+ { 111, 7, 63,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Ecuador
+ { 111, 7, 65,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/El Salvador
+ { 111, 7, 66,{ 5227,79 },{ 7795,107 },{ 215,27 },{ 5227,79 },{ 7795,107 },{ 215,27 }}, // Spanish/Latin/Equatorial Guinea
+ { 111, 7, 90,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Guatemala
+ { 111, 7, 96,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Honduras
+ { 111, 7, 139,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Mexico
+ { 111, 7, 155,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Nicaragua
+ { 111, 7, 166,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Panama
+ { 111, 7, 168,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Paraguay
+ { 111, 7, 169,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Peru
+ { 111, 7, 170,{ 5227,79 },{ 7795,107 },{ 215,27 },{ 5227,79 },{ 7795,107 },{ 215,27 }}, // Spanish/Latin/Philippines
+ { 111, 7, 174,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Puerto Rico
+ { 111, 7, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/United States
+ { 111, 7, 227,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Uruguay
+ { 111, 7, 231,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Venezuela
+ { 111, 7, 238,{ 5227,79 },{ 7795,107 },{ 215,27 },{ 5227,79 },{ 7795,107 },{ 215,27 }}, // Spanish/Latin/Canary Islands
+ { 111, 7, 246,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Spanish/Latin/Latin America
+ { 111, 7, 250,{ 5227,79 },{ 7795,107 },{ 215,27 },{ 5227,79 },{ 7795,107 },{ 215,27 }}, // Spanish/Latin/Ceuta And Melilla
+ { 112, 7, 101,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sundanese/Latin/Indonesia
+ { 113, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swahili/Latin/Tanzania
+ { 113, 7, 49,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swahili/Latin/Congo Kinshasa
+ { 113, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swahili/Latin/Kenya
+ { 113, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swahili/Latin/Uganda
+ { 114, 7, 205,{ 0,79 },{ 7902,128 },{ 215,27 },{ 0,79 },{ 8030,128 },{ 215,27 }}, // Swedish/Latin/Sweden
+ { 114, 7, 73,{ 0,79 },{ 7902,128 },{ 215,27 },{ 0,79 },{ 8030,128 },{ 215,27 }}, // Swedish/Latin/Finland
+ { 114, 7, 248,{ 0,79 },{ 7902,128 },{ 215,27 },{ 0,79 },{ 8030,128 },{ 215,27 }}, // Swedish/Latin/Aland Islands
+ { 115, 7, 106,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sardinian/Latin/Italy
+ { 116, 2, 209,{ 8158,75 },{ 8233,111 },{ 215,27 },{ 8158,75 },{ 8344,111 },{ 215,27 }}, // Tajik/Cyrillic/Tajikistan
+ { 117, 27, 100,{ 8455,73 },{ 8528,92 },{ 215,27 },{ 8455,73 },{ 8528,92 },{ 215,27 }}, // Tamil/Tamil/India
+ { 117, 27, 130,{ 8455,73 },{ 8528,92 },{ 215,27 },{ 8455,73 },{ 8528,92 },{ 215,27 }}, // Tamil/Tamil/Malaysia
+ { 117, 27, 190,{ 8455,73 },{ 8528,92 },{ 215,27 },{ 8455,73 },{ 8528,92 },{ 215,27 }}, // Tamil/Tamil/Singapore
+ { 117, 27, 198,{ 8455,73 },{ 8528,92 },{ 215,27 },{ 8455,73 },{ 8528,92 },{ 215,27 }}, // Tamil/Tamil/Sri Lanka
+ { 118, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tatar/Cyrillic/Russia
+ { 119, 28, 100,{ 8620,75 },{ 8695,96 },{ 215,27 },{ 8620,75 },{ 79,107 },{ 215,27 }}, // Telugu/Telugu/India
+ { 120, 30, 211,{ 8791,90 },{ 8881,103 },{ 215,27 },{ 8791,90 },{ 8881,103 },{ 215,27 }}, // Thai/Thai/Thailand
+ { 121, 31, 44,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tibetan/Tibetan/China
+ { 121, 31, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tibetan/Tibetan/India
+ { 122, 14, 69,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tigrinya/Ethiopic/Ethiopia
+ { 122, 14, 67,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tigrinya/Ethiopic/Eritrea
+ { 123, 7, 214,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tongan/Latin/Tonga
+ { 124, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tsonga/Latin/South Africa
+ { 125, 7, 217,{ 8984,84 },{ 9068,111 },{ 215,27 },{ 8984,84 },{ 9068,111 },{ 215,27 }}, // Turkish/Latin/Turkey
+ { 125, 7, 56,{ 8984,84 },{ 9068,111 },{ 215,27 },{ 8984,84 },{ 9068,111 },{ 215,27 }}, // Turkish/Latin/Cyprus
+ { 126, 7, 218,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Turkmen/Latin/Turkmenistan
+ { 128, 1, 44,{ 9179,119 },{ 9179,119 },{ 215,27 },{ 9179,119 },{ 9179,119 },{ 215,27 }}, // Uighur/Arabic/China
+ { 129, 2, 222,{ 9298,72 },{ 9370,104 },{ 215,27 },{ 9474,82 },{ 9370,104 },{ 215,27 }}, // Ukrainian/Cyrillic/Ukraine
+ { 130, 1, 163,{ 9556,99 },{ 9655,97 },{ 215,27 },{ 9556,99 },{ 9655,97 },{ 215,27 }}, // Urdu/Arabic/Pakistan
+ { 130, 1, 100,{ 9556,99 },{ 9655,97 },{ 215,27 },{ 9556,99 },{ 9655,97 },{ 215,27 }}, // Urdu/Arabic/India
+ { 131, 7, 228,{ 9752,83 },{ 9835,123 },{ 215,27 },{ 9752,83 },{ 9835,123 },{ 215,27 }}, // Uzbek/Latin/Uzbekistan
+ { 131, 1, 1,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Uzbek/Arabic/Afghanistan
+ { 131, 2, 228,{ 0,79 },{ 9958,115 },{ 215,27 },{ 0,79 },{ 9958,115 },{ 215,27 }}, // Uzbek/Cyrillic/Uzbekistan
+ { 132, 7, 232,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Vietnamese/Latin/Vietnam
+ { 133, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Volapuk/Latin/World
+ { 134, 7, 224,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Welsh/Latin/United Kingdom
+ { 135, 7, 187,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Wolof/Latin/Senegal
+ { 136, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Xhosa/Latin/South Africa
+ { 137, 18, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Yiddish/Hebrew/World
+ { 138, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Yoruba/Latin/Nigeria
+ { 138, 7, 23,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Yoruba/Latin/Benin
+ { 140, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Zulu/Latin/South Africa
+ { 141, 7, 161,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Norwegian Nynorsk/Latin/Norway
+ { 142, 7, 27,{ 10073,75 },{ 10148,99 },{ 215,27 },{ 10073,75 },{ 10148,99 },{ 215,27 }}, // Bosnian/Latin/Bosnia And Herzegowina
+ { 142, 2, 27,{ 6638,70 },{ 6708,91 },{ 215,27 },{ 6638,70 },{ 6799,98 },{ 215,27 }}, // Bosnian/Cyrillic/Bosnia And Herzegowina
+ { 143, 29, 131,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Divehi/Thaana/Maldives
+ { 144, 7, 251,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Manx/Latin/Isle Of Man
+ { 145, 7, 224,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Cornish/Latin/United Kingdom
+ { 146, 7, 83,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Akan/Latin/Ghana
+ { 147, 13, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Konkani/Devanagari/India
+ { 148, 7, 83,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ga/Latin/Ghana
+ { 149, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Igbo/Latin/Nigeria
+ { 150, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kamba/Latin/Kenya
+ { 151, 33, 103,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Syriac/Syriac/Iraq
+ { 152, 14, 67,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Blin/Ethiopic/Eritrea
+ { 153, 14, 69,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Geez/Ethiopic/Ethiopia
+ { 155, 7, 69,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sidamo/Latin/Ethiopia
+ { 156, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Atsam/Latin/Nigeria
+ { 157, 14, 67,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tigre/Ethiopic/Eritrea
+ { 158, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Jju/Latin/Nigeria
+ { 159, 7, 106,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Friulian/Latin/Italy
+ { 160, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Venda/Latin/South Africa
+ { 161, 7, 83,{ 10247,48 },{ 10295,87 },{ 215,27 },{ 10247,48 },{ 10295,87 },{ 215,27 }}, // Ewe/Latin/Ghana
+ { 161, 7, 212,{ 10247,48 },{ 10295,87 },{ 215,27 },{ 10247,48 },{ 10295,87 },{ 215,27 }}, // Ewe/Latin/Togo
+ { 162, 14, 69,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Walamo/Ethiopic/Ethiopia
+ { 163, 7, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Hawaiian/Latin/United States
+ { 164, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tyap/Latin/Nigeria
+ { 165, 7, 129,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nyanja/Latin/Malawi
+ { 166, 7, 170,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Filipino/Latin/Philippines
+ { 167, 7, 206,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swiss German/Latin/Switzerland
+ { 167, 7, 74,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swiss German/Latin/France
+ { 167, 7, 123,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Swiss German/Latin/Liechtenstein
+ { 168, 34, 44,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sichuan Yi/Yi/China
+ { 169, 7, 121,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kpelle/Latin/Liberia
+ { 170, 7, 82,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Low German/Latin/Germany
+ { 170, 7, 151,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Low German/Latin/Netherlands
+ { 171, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // South Ndebele/Latin/South Africa
+ { 172, 7, 195,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Northern Sotho/Latin/South Africa
+ { 173, 7, 161,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Northern Sami/Latin/Norway
+ { 173, 7, 73,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Northern Sami/Latin/Finland
+ { 173, 7, 205,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Northern Sami/Latin/Sweden
+ { 174, 7, 208,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Taroko/Latin/Taiwan
+ { 175, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Gusii/Latin/Kenya
+ { 176, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Taita/Latin/Kenya
+ { 177, 7, 187,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Senegal
+ { 177, 7, 34,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Burkina Faso
+ { 177, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Cameroon
+ { 177, 7, 80,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Gambia
+ { 177, 7, 83,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Ghana
+ { 177, 7, 91,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Guinea
+ { 177, 7, 92,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Guinea Bissau
+ { 177, 7, 121,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Liberia
+ { 177, 7, 136,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Mauritania
+ { 177, 7, 156,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Niger
+ { 177, 7, 157,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Nigeria
+ { 177, 7, 189,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Latin/Sierra Leone
+ { 177, 134, 91,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Fulah/Adlam/Guinea
+ { 178, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kikuyu/Latin/Kenya
+ { 179, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Samburu/Latin/Kenya
+ { 180, 7, 146,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sena/Latin/Mozambique
+ { 181, 7, 240,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // North Ndebele/Latin/Zimbabwe
+ { 182, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Rombo/Latin/Tanzania
+ { 183, 9, 145,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tachelhit/Tifinagh/Morocco
+ { 183, 7, 145,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tachelhit/Latin/Morocco
+ { 184, 7, 3,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kabyle/Latin/Algeria
+ { 185, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nyankole/Latin/Uganda
+ { 186, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bena/Latin/Tanzania
+ { 187, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Vunjo/Latin/Tanzania
+ { 188, 7, 132,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bambara/Latin/Mali
+ { 188, 75, 132,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bambara/Nko/Mali
+ { 189, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Embu/Latin/Kenya
+ { 190, 12, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Cherokee/Cherokee/United States
+ { 191, 7, 137,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Morisyen/Latin/Mauritius
+ { 192, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Makonde/Latin/Tanzania
+ { 193, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Langi/Latin/Tanzania
+ { 194, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ganda/Latin/Uganda
+ { 195, 7, 239,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bemba/Latin/Zambia
+ { 196, 7, 39,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kabuverdianu/Latin/Cape Verde
+ { 197, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Meru/Latin/Kenya
+ { 198, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kalenjin/Latin/Kenya
+ { 199, 7, 148,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nama/Latin/Namibia
+ { 200, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Machame/Latin/Tanzania
+ { 201, 7, 82,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Colognian/Latin/Germany
+ { 202, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Masai/Latin/Kenya
+ { 202, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Masai/Latin/Tanzania
+ { 203, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Soga/Latin/Uganda
+ { 204, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Luyia/Latin/Kenya
+ { 205, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Asu/Latin/Tanzania
+ { 206, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Teso/Latin/Uganda
+ { 206, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Teso/Latin/Kenya
+ { 207, 7, 67,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Saho/Latin/Eritrea
+ { 208, 7, 132,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Koyra Chiini/Latin/Mali
+ { 209, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Rwa/Latin/Tanzania
+ { 210, 7, 111,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Luo/Latin/Kenya
+ { 211, 7, 221,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Chiga/Latin/Uganda
+ { 212, 7, 145,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Central Morocco Tamazight/Latin/Morocco
+ { 213, 7, 132,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Koyraboro Senni/Latin/Mali
+ { 214, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Shambala/Latin/Tanzania
+ { 215, 13, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bodo/Devanagari/India
+ { 218, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Chechen/Cyrillic/Russia
+ { 219, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Church/Cyrillic/Russia
+ { 220, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Chuvash/Cyrillic/Russia
+ { 230, 7, 49,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Luba Katanga/Latin/Congo Kinshasa
+ { 231, 7, 125,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Luxembourgish/Latin/Luxembourg
+ { 236, 7, 21,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Walloon/Latin/Belgium
+ { 237, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Aghem/Latin/Cameroon
+ { 238, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Basaa/Latin/Cameroon
+ { 239, 7, 156,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Zarma/Latin/Niger
+ { 240, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Duala/Latin/Cameroon
+ { 241, 7, 187,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Jola Fonyi/Latin/Senegal
+ { 242, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ewondo/Latin/Cameroon
+ { 243, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Bafia/Latin/Cameroon
+ { 244, 7, 146,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Makhuwa Meetto/Latin/Mozambique
+ { 245, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Mundang/Latin/Cameroon
+ { 246, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kwasio/Latin/Cameroon
+ { 247, 7, 254,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nuer/Latin/South Sudan
+ { 248, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sakha/Cyrillic/Russia
+ { 249, 7, 210,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sangu/Latin/Tanzania
+ { 251, 7, 156,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tasawaq/Latin/Niger
+ { 252, 35, 121,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Vai/Vai/Liberia
+ { 252, 7, 121,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Vai/Latin/Liberia
+ { 253, 7, 206,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Walser/Latin/Switzerland
+ { 254, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Yangben/Latin/Cameroon
+ { 256, 7, 197,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 10382,143 },{ 215,27 }}, // Asturian/Latin/Spain
+ { 257, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ngomba/Latin/Cameroon
+ { 258, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kako/Latin/Cameroon
+ { 259, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Meta/Latin/Cameroon
+ { 260, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ngiemboon/Latin/Cameroon
+ { 261, 7, 197,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Aragonese/Latin/Spain
+ { 290, 11, 100,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Manipuri/Bengali/India
+ { 309, 100, 232,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Tai Dam/Tai Viet/Vietnam
+ { 312, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Akoose/Latin/Cameroon
+ { 313, 7, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lakota/Latin/United States
+ { 314, 9, 145,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Standard Moroccan Tamazight/Tifinagh/Morocco
+ { 315, 7, 43,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Mapuche/Latin/Chile
+ { 316, 1, 103,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Central Kurdish/Arabic/Iraq
+ { 316, 1, 102,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Central Kurdish/Arabic/Iran
+ { 317, 7, 82,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lower Sorbian/Latin/Germany
+ { 318, 7, 82,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Upper Sorbian/Latin/Germany
+ { 319, 7, 37,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kenyang/Latin/Cameroon
+ { 320, 7, 38,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Mohawk/Latin/Canada
+ { 321, 75, 91,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Nko/Nko/Guinea
+ { 322, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Prussian/Latin/World
+ { 323, 7, 90,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Kiche/Latin/Guatemala
+ { 324, 7, 205,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Southern Sami/Latin/Sweden
+ { 325, 7, 205,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lule Sami/Latin/Sweden
+ { 326, 7, 73,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Inari Sami/Latin/Finland
+ { 327, 7, 73,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Skolt Sami/Latin/Finland
+ { 328, 7, 13,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Warlpiri/Latin/Australia
+ { 346, 1, 102,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Mazanderani/Arabic/Iran
+ { 349, 1, 102,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Northern Luri/Arabic/Iran
+ { 349, 1, 103,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Northern Luri/Arabic/Iraq
+ { 357, 6, 97,{ 930,72 },{ 930,72 },{ 215,27 },{ 930,72 },{ 930,72 },{ 215,27 }}, // Cantonese/Traditional Han/Hong Kong
+ { 357, 5, 44,{ 10525,72 },{ 10525,72 },{ 215,27 },{ 10525,72 },{ 10525,72 },{ 215,27 }}, // Cantonese/Simplified Han/China
+ { 358, 138, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Osage/Osage/United States
+ { 360, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Ido/Latin/World
+ { 361, 7, 260,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Lojban/Latin/World
+ { 362, 7, 106,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Sicilian/Latin/Italy
+ { 363, 1, 102,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Southern Kurdish/Arabic/Iran
+ { 364, 1, 163,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Western Balochi/Arabic/Pakistan
+ { 365, 7, 170,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Cebuano/Latin/Philippines
+ { 366, 2, 178,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Erzya/Cyrillic/Russia
+ { 367, 7, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Chickasaw/Latin/United States
+ { 368, 7, 225,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Muscogee/Latin/United States
+ { 369, 7, 172,{ 0,79 },{ 79,107 },{ 215,27 },{ 0,79 },{ 79,107 },{ 215,27 }}, // Silesian/Latin/Poland
+ { 0, 0, 0,{ 0,0},{ 0,0},{ 0,0},{ 0,0},{ 0,0},{ 0,0}}, // trailing zeros
+};
+
+static const ushort months_data[] = {
+0x4d, 0x75, 0x68, 0x2e, 0x3b, 0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62,
+0x2e, 0x20, 0x49, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x49, 0x3b,
+0x52, 0x61, 0x6a, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x77, 0x2e,
+0x3b, 0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x51, 0x2e, 0x3b, 0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x48, 0x2e, 0x3b, 0x4d,
+0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20,
+0x49, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x3b,
+0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x53, 0x68, 0x61, 0x2bb,
+0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x53, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b,
+0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x51, 0x69, 0x2bb, 0x64, 0x61, 0x68, 0x3b, 0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x48,
+0x69, 0x6a, 0x6a, 0x61, 0x68, 0x3b, 0x31, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b,
+0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31, 0x32, 0x3b, 0x31, 0x33, 0x31, 0x3b, 0x32, 0x3b, 0x33,
+0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31,
+0x32, 0x3b, 0x1219, 0x1200, 0x1228, 0x121d, 0x3b, 0x1233, 0x1348, 0x122d, 0x3b, 0x1228, 0x1262, 0x12d1, 0x120d, 0x20, 0x12a0, 0x12c8, 0x120d, 0x3b,
+0x1228, 0x1262, 0x12d1, 0x120d, 0x20, 0x12a0, 0x12ba, 0x122d, 0x3b, 0x1300, 0x121b, 0x12f0, 0x120d, 0x20, 0x12a0, 0x12c8, 0x120d, 0x3b, 0x1300, 0x121b,
+0x12f0, 0x120d, 0x20, 0x12a0, 0x12ba, 0x122d, 0x3b, 0x1228, 0x1300, 0x1265, 0x3b, 0x123b, 0x12a5, 0x1263, 0x1295, 0x3b, 0x1228, 0x1218, 0x12f3, 0x1295,
+0x3b, 0x1238, 0x12cb, 0x120d, 0x3b, 0x12d9, 0x120d, 0x1242, 0x12f3, 0x1205, 0x3b, 0x12d9, 0x120d, 0x1202, 0x1303, 0x1205, 0x3b, 0x645, 0x62d, 0x631,
+0x645, 0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x631, 0x628, 0x64a,
+0x639, 0x20, 0x627, 0x644, 0x622, 0x62e, 0x631, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x649, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x649,
+0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x649, 0x20, 0x627, 0x644, 0x622, 0x62e, 0x631, 0x629, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639,
+0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x630, 0x648, 0x20, 0x627, 0x644,
+0x642, 0x639, 0x62f, 0x629, 0x3b, 0x630, 0x648, 0x20, 0x627, 0x644, 0x62d, 0x62c, 0x629, 0x3b, 0x661, 0x3b, 0x662, 0x3b, 0x663, 0x3b,
+0x664, 0x3b, 0x665, 0x3b, 0x666, 0x3b, 0x667, 0x3b, 0x668, 0x3b, 0x669, 0x3b, 0x661, 0x660, 0x3b, 0x661, 0x661, 0x3b, 0x661, 0x662,
+0x3b, 0x4d, 0x259, 0x68, 0x2e, 0x3b, 0x53, 0x259, 0x66, 0x2e, 0x3b, 0x52, 0x259, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x52, 0x259,
+0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x43, 0x259, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x43, 0x259, 0x6d, 0x2e, 0x20, 0x49, 0x49,
+0x3b, 0x52, 0x259, 0x63, 0x2e, 0x3b, 0x15e, 0x61, 0x62, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x15e, 0x259, 0x76, 0x2e,
+0x3b, 0x5a, 0x69, 0x6c, 0x71, 0x2e, 0x3b, 0x5a, 0x69, 0x6c, 0x68, 0x2e, 0x3b, 0x4d, 0x259, 0x68, 0x259, 0x72, 0x72, 0x259,
+0x6d, 0x3b, 0x53, 0x259, 0x66, 0x259, 0x72, 0x3b, 0x52, 0x259, 0x62, 0x69, 0xfc, 0x6c, 0x259, 0x76, 0x76, 0x259, 0x6c, 0x3b,
+0x52, 0x259, 0x62, 0x69, 0xfc, 0x6c, 0x61, 0x78, 0x131, 0x72, 0x3b, 0x43, 0x259, 0x6d, 0x61, 0x64, 0x69, 0x79, 0x259, 0x6c,
+0x259, 0x76, 0x76, 0x259, 0x6c, 0x3b, 0x43, 0x259, 0x6d, 0x61, 0x64, 0x69, 0x79, 0x259, 0x6c, 0x61, 0x78, 0x131, 0x72, 0x3b,
+0x52, 0x259, 0x63, 0x259, 0x62, 0x3b, 0x15e, 0x61, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x7a, 0x61, 0x6e, 0x3b,
+0x15e, 0x259, 0x76, 0x76, 0x61, 0x6c, 0x3b, 0x5a, 0x69, 0x6c, 0x71, 0x259, 0x64, 0x259, 0x3b, 0x5a, 0x69, 0x6c, 0x68, 0x69,
+0x63, 0x63, 0x259, 0x3b, 0x9ae, 0x9b9, 0x9b0, 0x9b0, 0x9ae, 0x3b, 0x9b8, 0x9ab, 0x9b0, 0x3b, 0x9b0, 0x9ac, 0x9bf, 0x989, 0x9b2, 0x20,
+0x986, 0x989, 0x9af, 0x9bc, 0x9be, 0x9b2, 0x3b, 0x9b0, 0x9ac, 0x9bf, 0x989, 0x9b8, 0x20, 0x9b8, 0x9be, 0x9a8, 0x9bf, 0x3b, 0x99c, 0x9ae,
+0x9be, 0x9a6, 0x9bf, 0x989, 0x9b2, 0x20, 0x986, 0x989, 0x9af, 0x9bc, 0x9be, 0x9b2, 0x3b, 0x99c, 0x9ae, 0x9be, 0x9a6, 0x9bf, 0x989, 0x9b8,
+0x20, 0x9b8, 0x9be, 0x9a8, 0x9bf, 0x3b, 0x9b0, 0x99c, 0x9ac, 0x3b, 0x9b6, 0x9be, 0x2018, 0x9ac, 0x9be, 0x9a8, 0x3b, 0x9b0, 0x9ae, 0x99c,
+0x9be, 0x9a8, 0x3b, 0x9b6, 0x9be, 0x993, 0x9af, 0x9bc, 0x9be, 0x9b2, 0x3b, 0x99c, 0x9cd, 0x9ac, 0x9bf, 0x9b2, 0x995, 0x9a6, 0x3b, 0x99c,
+0x9cd, 0x9ac, 0x9bf, 0x9b2, 0x9b9, 0x99c, 0x9cd, 0x99c, 0x3b, 0x9e7, 0x3b, 0x9e8, 0x3b, 0x9e9, 0x3b, 0x9ea, 0x3b, 0x9eb, 0x3b, 0x9ec,
+0x3b, 0x9ed, 0x3b, 0x9ee, 0x3b, 0x9ef, 0x3b, 0x9e7, 0x9e6, 0x3b, 0x9e7, 0x9e7, 0x3b, 0x9e7, 0x9e8, 0x3b, 0x43c, 0x443, 0x445, 0x430,
+0x440, 0x430, 0x43c, 0x3b, 0x441, 0x430, 0x444, 0x430, 0x440, 0x3b, 0x440, 0x430, 0x431, 0x438, 0x2d, 0x31, 0x3b, 0x440, 0x430, 0x431,
+0x438, 0x2d, 0x32, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x430, 0x434, 0x430, 0x2d, 0x31, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x430, 0x434,
+0x430, 0x2d, 0x32, 0x3b, 0x440, 0x430, 0x434, 0x436, 0x430, 0x431, 0x3b, 0x448, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x440, 0x430, 0x43c,
+0x430, 0x437, 0x430, 0x43d, 0x3b, 0x428, 0x430, 0x432, 0x430, 0x43b, 0x3b, 0x414, 0x445, 0x443, 0x43b, 0x2d, 0x41a, 0x430, 0x430, 0x434,
+0x430, 0x3b, 0x414, 0x445, 0x443, 0x43b, 0x2d, 0x445, 0x438, 0x434, 0x436, 0x430, 0x3b, 0x31, 0x6708, 0x3b, 0x32, 0x6708, 0x3b, 0x33,
+0x6708, 0x3b, 0x34, 0x6708, 0x3b, 0x35, 0x6708, 0x3b, 0x36, 0x6708, 0x3b, 0x37, 0x6708, 0x3b, 0x38, 0x6708, 0x3b, 0x39, 0x6708, 0x3b,
+0x31, 0x30, 0x6708, 0x3b, 0x31, 0x31, 0x6708, 0x3b, 0x31, 0x32, 0x6708, 0x3b, 0x4e00, 0x6708, 0x3b, 0x4e8c, 0x6708, 0x3b, 0x4e09, 0x6708,
+0x3b, 0x56db, 0x6708, 0x3b, 0x4e94, 0x6708, 0x3b, 0x516d, 0x6708, 0x3b, 0x4e03, 0x6708, 0x3b, 0x516b, 0x6708, 0x3b, 0x4e5d, 0x6708, 0x3b, 0x5341,
+0x6708, 0x3b, 0x5341, 0x4e00, 0x6708, 0x3b, 0x5341, 0x4e8c, 0x6708, 0x3b, 0x7a46, 0x54c8, 0x862d, 0x59c6, 0x6708, 0x3b, 0x8272, 0x6cd5, 0x723e, 0x6708,
+0x3b, 0x8cf4, 0x6bd4, 0x6708, 0x20, 0x49, 0x3b, 0x8cf4, 0x6bd4, 0x6708, 0x20, 0x49, 0x49, 0x3b, 0x4e3b, 0x99ac, 0x9054, 0x6708, 0x20, 0x49,
+0x3b, 0x4e3b, 0x99ac, 0x9054, 0x6708, 0x20, 0x49, 0x49, 0x3b, 0x8cf4, 0x54f2, 0x535c, 0x6708, 0x3b, 0x820d, 0x723e, 0x90a6, 0x6708, 0x3b, 0x8cf4,
+0x8cb7, 0x4e39, 0x6708, 0x3b, 0x9583, 0x74e6, 0x9b6f, 0x6708, 0x3b, 0x90fd, 0x723e, 0x5580, 0x723e, 0x5fb7, 0x6708, 0x3b, 0x90fd, 0x723e, 0x9ed1, 0x54f2,
+0x6708, 0x3b, 0x31, 0x2e, 0x3b, 0x32, 0x2e, 0x3b, 0x33, 0x2e, 0x3b, 0x34, 0x2e, 0x3b, 0x35, 0x2e, 0x3b, 0x36, 0x2e, 0x3b,
+0x37, 0x2e, 0x3b, 0x38, 0x2e, 0x3b, 0x39, 0x2e, 0x3b, 0x31, 0x30, 0x2e, 0x3b, 0x31, 0x31, 0x2e, 0x3b, 0x31, 0x32, 0x2e,
+0x3b, 0x6d, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x65, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x72, 0x65,
+0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0x2e, 0x20,
+0x49, 0x49, 0x3b, 0x72, 0x65, 0x64, 0x2e, 0x3b, 0x161, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d, 0x2e, 0x3b, 0x161, 0x61, 0x77,
+0x2e, 0x3b, 0x7a, 0xfa, 0x20, 0x6c, 0x2d, 0x6b, 0x2e, 0x3b, 0x7a, 0xfa, 0x20, 0x6c, 0x2d, 0x68, 0x2e, 0x3b, 0x6d, 0x75,
+0x68, 0x61, 0x72, 0x72, 0x65, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x72, 0x65, 0x62, 0xed, 0x2019, 0x75, 0x20,
+0x6c, 0x2d, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x72, 0x65, 0x62, 0xed, 0x2019, 0x75, 0x20, 0x73, 0x2d, 0x73, 0xe1, 0x6e,
+0xed, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0xe1, 0x64, 0xe1, 0x20, 0x61, 0x6c, 0x2d, 0xfa, 0x6c, 0xe1, 0x3b, 0x64, 0x17e, 0x75,
+0x6d, 0xe1, 0x64, 0xe1, 0x20, 0x61, 0x6c, 0x2d, 0xe1, 0x63, 0x68, 0x69, 0x72, 0x61, 0x3b, 0x72, 0x65, 0x64, 0x17e, 0x65,
+0x62, 0x3b, 0x161, 0x61, 0x2019, 0x62, 0xe1, 0x6e, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x64, 0xe1, 0x6e, 0x3b, 0x161, 0x61, 0x77,
+0x77, 0x61, 0x6c, 0x3b, 0x7a, 0xfa, 0x20, 0x6c, 0x2d, 0x6b, 0x61, 0x2019, 0x64, 0x61, 0x3b, 0x7a, 0xfa, 0x20, 0x6c, 0x2d,
+0x68, 0x69, 0x64, 0x17e, 0x64, 0x17e, 0x61, 0x3b, 0x6d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x73, 0x61, 0x66,
+0x61, 0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b,
+0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x49, 0x3b, 0x72,
+0x61, 0x6a, 0x61, 0x62, 0x3b, 0x73, 0x68, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e,
+0x3b, 0x73, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x51, 0x69, 0x2bb, 0x64, 0x61,
+0x68, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x48, 0x69, 0x6a, 0x6a, 0x61, 0x68, 0x3b, 0x4d, 0x6f, 0x65, 0x68, 0x2e,
+0x3b, 0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x49,
+0x3b, 0x4a, 0x6f, 0x65, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x4a, 0x6f, 0x65, 0x6d, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61,
+0x6a, 0x2e, 0x3b, 0x53, 0x6a, 0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x6a, 0x61, 0x77, 0x2e, 0x3b, 0x44,
+0x6f, 0x65, 0x20, 0x61, 0x6c, 0x20, 0x6b, 0x2e, 0x3b, 0x44, 0x6f, 0x65, 0x20, 0x61, 0x6c, 0x20, 0x68, 0x2e, 0x3b, 0x4d,
+0x6f, 0x65, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb,
+0x61, 0x20, 0x61, 0x6c, 0x20, 0x61, 0x77, 0x61, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x61, 0x20, 0x61, 0x6c, 0x20,
+0x74, 0x68, 0x61, 0x6e, 0x69, 0x3b, 0x4a, 0x6f, 0x65, 0x6d, 0x61, 0x64, 0x2bb, 0x61, 0x6c, 0x20, 0x61, 0x77, 0x61, 0x6c,
+0x3b, 0x4a, 0x6f, 0x65, 0x6d, 0x61, 0x64, 0x2bb, 0x61, 0x6c, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x69, 0x3b, 0x52, 0x61, 0x6a,
+0x61, 0x62, 0x3b, 0x53, 0x6a, 0x61, 0x2bb, 0x61, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b,
+0x53, 0x6a, 0x61, 0x77, 0x61, 0x6c, 0x3b, 0x44, 0x6f, 0x65, 0x20, 0x61, 0x6c, 0x20, 0x6b, 0x61, 0x2bb, 0x61, 0x62, 0x61,
+0x3b, 0x44, 0x6f, 0x65, 0x20, 0x61, 0x6c, 0x20, 0x68, 0x69, 0x7a, 0x6a, 0x61, 0x3b, 0x6d, 0x75, 0x68, 0x61, 0x72, 0x72,
+0x61, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2019, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x77,
+0x77, 0x61, 0x6c, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2019, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x6b, 0x68, 0x69, 0x72, 0x3b, 0x64,
+0x17e, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x2d, 0x6c, 0x2d, 0x75, 0x6c, 0x61, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0x61, 0x64, 0x61,
+0x2d, 0x6c, 0x2d, 0x61, 0x6b, 0x68, 0x69, 0x72, 0x61, 0x3b, 0x72, 0x61, 0x64, 0x17e, 0x61, 0x62, 0x3b, 0x161, 0x61, 0x2019,
+0x62, 0x61, 0x6e, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x161, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x64,
+0x68, 0x75, 0x2d, 0x6c, 0x2d, 0x71, 0x61, 0x2019, 0x64, 0x61, 0x3b, 0x64, 0x68, 0x75, 0x2d, 0x6c, 0x2d, 0x68, 0x69, 0x64,
+0x64, 0x17e, 0x61, 0x3b, 0x6d, 0x6f, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20,
+0x61, 0x77, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x74, 0x68, 0x2e, 0x3b, 0x6a, 0x6f, 0x75, 0x6d, 0x2e, 0x20, 0x6f,
+0x75, 0x2e, 0x3b, 0x6a, 0x6f, 0x75, 0x6d, 0x2e, 0x20, 0x74, 0x68, 0x2e, 0x3b, 0x72, 0x61, 0x6a, 0x2e, 0x3b, 0x63, 0x68,
+0x61, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d, 0x2e, 0x3b, 0x63, 0x68, 0x61, 0x77, 0x2e, 0x3b, 0x64, 0x68, 0x6f, 0x75, 0x2e,
+0x20, 0x71, 0x69, 0x2e, 0x3b, 0x64, 0x68, 0x6f, 0x75, 0x2e, 0x20, 0x68, 0x69, 0x2e, 0x3b, 0x6d, 0x6f, 0x75, 0x68, 0x61,
+0x72, 0x72, 0x61, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x61, 0x20, 0x61, 0x6c, 0x20,
+0x61, 0x77, 0x61, 0x6c, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x61, 0x20, 0x61, 0x74, 0x68, 0x2d, 0x74, 0x68, 0x61, 0x6e, 0x69,
+0x3b, 0x6a, 0x6f, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x61, 0x6c, 0x20, 0x6f, 0x75, 0x6c, 0x61, 0x3b, 0x6a, 0x6f, 0x75,
+0x6d, 0x61, 0x64, 0x61, 0x20, 0x61, 0x74, 0x68, 0x2d, 0x74, 0x68, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x72, 0x61, 0x6a, 0x61,
+0x62, 0x3b, 0x63, 0x68, 0x61, 0x61, 0x62, 0x61, 0x6e, 0x65, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x63,
+0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x64, 0x68, 0x6f, 0x75, 0x20, 0x61, 0x6c, 0x20, 0x71, 0x69, 0x60, 0x64, 0x61,
+0x3b, 0x64, 0x68, 0x6f, 0x75, 0x20, 0x61, 0x6c, 0x2d, 0x68, 0x69, 0x6a, 0x6a, 0x61, 0x3b, 0x6d, 0x6f, 0x75, 0x68, 0x2e,
+0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x61, 0x77, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20,
+0x74, 0x68, 0x2e, 0x3b, 0x6a, 0x6f, 0x75, 0x6d, 0x2e, 0x20, 0x6f, 0x75, 0x6c, 0x2e, 0x3b, 0x6a, 0x6f, 0x75, 0x6d, 0x2e,
+0x20, 0x74, 0x68, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6a, 0x2e, 0x3b, 0x63, 0x68, 0x61, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d,
+0x2e, 0x3b, 0x63, 0x68, 0x61, 0x77, 0x2e, 0x3b, 0x64, 0x68, 0x6f, 0x75, 0x2e, 0x20, 0x71, 0x2e, 0x3b, 0x64, 0x68, 0x6f,
+0x75, 0x2e, 0x20, 0x68, 0x2e, 0x3b, 0x10db, 0x10e3, 0x10f0, 0x2e, 0x3b, 0x10e1, 0x10d0, 0x10e4, 0x2e, 0x3b, 0x10e0, 0x10d0, 0x10d1, 0x2e,
+0x20, 0x49, 0x3b, 0x10e0, 0x10d0, 0x10d1, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x10ef, 0x10e3, 0x10db, 0x2e, 0x20, 0x49, 0x3b, 0x10ef, 0x10e3,
+0x10db, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x10e0, 0x10d0, 0x10ef, 0x2e, 0x3b, 0x10e8, 0x10d0, 0x10d1, 0x2e, 0x3b, 0x10e0, 0x10d0, 0x10db, 0x2e,
+0x3b, 0x10e8, 0x10d0, 0x10d5, 0x2e, 0x3b, 0x10d6, 0x10e3, 0x10da, 0x2d, 0x10d9, 0x2e, 0x3b, 0x10d6, 0x10e3, 0x10da, 0x2d, 0x10f0, 0x2e, 0x3b,
+0x10db, 0x10e3, 0x10f0, 0x10d0, 0x10e0, 0x10d0, 0x10db, 0x10d8, 0x3b, 0x10e1, 0x10d0, 0x10e4, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x10e0, 0x10d0, 0x10d1, 0x10d8,
+0x20, 0x10e3, 0x10da, 0x2d, 0x10d0, 0x10d5, 0x10d0, 0x10da, 0x10d8, 0x3b, 0x10e0, 0x10d0, 0x10d1, 0x10d8, 0x20, 0x10e3, 0x10da, 0x2d, 0x10d0, 0x10ee,
+0x10d8, 0x10e0, 0x10d8, 0x3b, 0x10ef, 0x10e3, 0x10db, 0x10d0, 0x10d3, 0x10d0, 0x20, 0x10e3, 0x10da, 0x2d, 0x10d0, 0x10d5, 0x10d0, 0x10da, 0x10d8, 0x3b,
+0x10ef, 0x10e3, 0x10db, 0x10d0, 0x10d3, 0x10d0, 0x20, 0x10e3, 0x10da, 0x2d, 0x10d0, 0x10ee, 0x10d8, 0x10e0, 0x10d8, 0x3b, 0x10e0, 0x10d0, 0x10ef, 0x10d0,
+0x10d1, 0x10d8, 0x3b, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10dc, 0x10d8, 0x3b, 0x10e0, 0x10d0, 0x10db, 0x10d0, 0x10d3, 0x10d0, 0x10dc, 0x10d8, 0x3b, 0x10e8,
+0x10d0, 0x10d5, 0x10d0, 0x10da, 0x10d8, 0x3b, 0x10d6, 0x10e3, 0x10da, 0x2d, 0x10d9, 0x10d0, 0x10d0, 0x10d3, 0x10d0, 0x3b, 0x10d6, 0x10e3, 0x10da, 0x2d,
+0x10f0, 0x10d8, 0x10ef, 0x10d0, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b,
+0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x44, 0x73, 0x63,
+0x68, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x3b, 0x44, 0x73, 0x63, 0x68, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49,
+0x49, 0x3b, 0x52, 0x61, 0x64, 0x73, 0x63, 0x68, 0x61, 0x62, 0x3b, 0x53, 0x68, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x52,
+0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x53, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x44, 0x68, 0x75, 0x20, 0x6c,
+0x2d, 0x71, 0x61, 0x2bf, 0x64, 0x61, 0x3b, 0x44, 0x68, 0x75, 0x20, 0x6c, 0x2d, 0x48, 0x69, 0x64, 0x64, 0x73, 0x63, 0x68,
+0x61, 0x3b, 0xaae, 0xac1, 0xab9, 0x2e, 0x3b, 0xab8, 0xaab, 0x2e, 0x3b, 0xab0, 0xaac, 0x2e, 0x49, 0x3b, 0xab0, 0xaac, 0x2e, 0x20,
+0x49, 0x49, 0x3b, 0xa9c, 0xac1, 0xaae, 0x2e, 0x20, 0x49, 0x3b, 0xa9c, 0xac1, 0xaae, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0xab0, 0xabe,
+0xa9c, 0x2e, 0x3b, 0xab6, 0xabe, 0x2e, 0x3b, 0xab0, 0xabe, 0xaae, 0x2e, 0x3b, 0xab6, 0xabe, 0xab5, 0x2e, 0x3b, 0xaa7, 0xac1, 0x2bb,
+0xab2, 0x2d, 0xa95, 0xacd, 0xaaf, 0xac1, 0x2e, 0x3b, 0xaa7, 0xac1, 0x2bb, 0xab2, 0x2d, 0xa8f, 0xa9a, 0x2e, 0x3b, 0xaae, 0xac1, 0xab9,
+0xab0, 0xacd, 0xab0, 0xaae, 0x3b, 0xab8, 0xaab, 0xab0, 0x3b, 0xab0, 0xabe, 0xaac, 0xac0, 0x2bb, 0x20, 0x49, 0x3b, 0xab0, 0xabe, 0xaac,
+0xac0, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0xa9c, 0xac1, 0xaae, 0xabe, 0xaa6, 0xabe, 0x20, 0x49, 0x3b, 0xa9c, 0xac1, 0xaae, 0xabe, 0xaa6,
+0xabe, 0x20, 0x49, 0x49, 0x3b, 0xab0, 0xa9c, 0xaac, 0x3b, 0xab6, 0xabe, 0x2bb, 0xaac, 0xabe, 0xaa8, 0x3b, 0xab0, 0xaae, 0xaa6, 0xabe,
+0xaa8, 0x3b, 0xab6, 0xabe, 0xab5, 0xacd, 0xab5, 0xab2, 0x3b, 0xaa7, 0xac1, 0x2bb, 0xab2, 0x2d, 0xa95, 0xacd, 0xab5, 0xac0, 0x2bb, 0xaa1,
+0xabe, 0xab9, 0x3b, 0xaa7, 0xac1, 0x2bb, 0xab2, 0x2d, 0xab9, 0xabf, 0xa9c, 0xacd, 0xa9c, 0xabe, 0xab9, 0x3b, 0x5de, 0x5d5, 0x5d7, 0x5e8,
+0x5dd, 0x3b, 0x5e6, 0x5e4, 0x5e8, 0x3b, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x20, 0x5d0, 0x5f3, 0x3b, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x20, 0x5d1,
+0x5f3, 0x3b, 0x5d2, 0x5f3, 0x5d5, 0x5de, 0x5d0, 0x5d3, 0x5d0, 0x20, 0x5d0, 0x5f3, 0x3b, 0x5d2, 0x5f3, 0x5d5, 0x5de, 0x5d0, 0x5d3, 0x5d0,
+0x20, 0x5d1, 0x5f3, 0x3b, 0x5e8, 0x5d2, 0x5f3, 0x5d1, 0x3b, 0x5e9, 0x5e2, 0x5d1, 0x5d0, 0x5df, 0x3b, 0x5e8, 0x5de, 0x5d3, 0x5d0, 0x5df,
+0x3b, 0x5e9, 0x5d5, 0x5d5, 0x5d0, 0x5dc, 0x3b, 0x5d3, 0x5f3, 0x5d5, 0x20, 0x5d0, 0x5dc, 0x5be, 0x5e7, 0x5e2, 0x5d3, 0x5d4, 0x3b, 0x5d3,
+0x5f3, 0x5d5, 0x20, 0x5d0, 0x5dc, 0x5be, 0x5d7, 0x5d9, 0x5d2, 0x5f3, 0x5d4, 0x3b, 0x5de, 0x5d5, 0x5d7, 0x5e8, 0x5dd, 0x3b, 0x5e6, 0x5e4,
+0x5e8, 0x3b, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x20, 0x5d0, 0x5dc, 0x5be, 0x5d0, 0x5d5, 0x5d5, 0x5dc, 0x3b, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x20,
+0x5d0, 0x5be, 0x5ea, 0x5f3, 0x5d0, 0x5e0, 0x5d9, 0x3b, 0x5d2, 0x5f3, 0x5d5, 0x5de, 0x5d0, 0x5d3, 0x5d0, 0x20, 0x5d0, 0x5dc, 0x5be, 0x5d0,
+0x5d5, 0x5dc, 0x5d0, 0x3b, 0x5d2, 0x5f3, 0x5d5, 0x5de, 0x5d0, 0x5d3, 0x5d0, 0x20, 0x5d0, 0x5be, 0x5ea, 0x5f3, 0x5d0, 0x5e0, 0x5d9, 0x5d4,
+0x3b, 0x5e8, 0x5d2, 0x5f3, 0x5d1, 0x3b, 0x5e9, 0x5e2, 0x5d1, 0x5d0, 0x5df, 0x3b, 0x5e8, 0x5de, 0x5d3, 0x5d0, 0x5df, 0x3b, 0x5e9, 0x5d5,
+0x5d5, 0x5d0, 0x5dc, 0x3b, 0x5d3, 0x5f3, 0x5d5, 0x20, 0x5d0, 0x5dc, 0x5be, 0x5e7, 0x5e2, 0x5d3, 0x5d4, 0x3b, 0x5d3, 0x5f3, 0x5d5, 0x20,
+0x5d0, 0x5dc, 0x5be, 0x5d7, 0x5d9, 0x5d2, 0x5f3, 0x5d4, 0x3b, 0x5de, 0x5d5, 0x5d7, 0x5e8, 0x5dd, 0x3b, 0x5e6, 0x5e4, 0x5e8, 0x3b, 0x5e8,
+0x5d1, 0x5d9, 0x5e2, 0x20, 0x5d0, 0x5dc, 0x2d, 0x5d0, 0x5d5, 0x5d5, 0x5dc, 0x3b, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x20, 0x5d0, 0x2d, 0x5ea,
+0x5f3, 0x5d0, 0x5e0, 0x5d9, 0x3b, 0x5d2, 0x5f3, 0x5d5, 0x5de, 0x5d0, 0x5d3, 0x5d0, 0x20, 0x5d0, 0x5dc, 0x2d, 0x5d0, 0x5d5, 0x5dc, 0x5d0,
+0x3b, 0x5d2, 0x5f3, 0x5d5, 0x5de, 0x5d0, 0x5d3, 0x5d0, 0x20, 0x5d0, 0x2d, 0x5ea, 0x5f3, 0x5d0, 0x5e0, 0x5d9, 0x5d4, 0x3b, 0x5e8, 0x5d2,
+0x5f3, 0x5d1, 0x3b, 0x5e9, 0x5e2, 0x5d1, 0x5d0, 0x5df, 0x3b, 0x5e8, 0x5de, 0x5d3, 0x5d0, 0x5df, 0x3b, 0x5e9, 0x5d5, 0x5d5, 0x5d0, 0x5dc,
+0x3b, 0x5d3, 0x5f3, 0x5d5, 0x20, 0x5d0, 0x5dc, 0x5be, 0x5e7, 0x5e2, 0x5d3, 0x5d4, 0x3b, 0x5d3, 0x5f3, 0x5d5, 0x20, 0x5d0, 0x5dc, 0x5be,
+0x5d7, 0x5d9, 0x5d2, 0x5f3, 0x5d4, 0x3b, 0x92e, 0x941, 0x939, 0x930, 0x94d, 0x930, 0x92e, 0x3b, 0x938, 0x92b, 0x930, 0x3b, 0x930, 0x93e,
+0x92c, 0x940, 0x20, 0x92a, 0x94d, 0x930, 0x925, 0x92e, 0x3b, 0x930, 0x93e, 0x92c, 0x940, 0x20, 0x926, 0x94d, 0x935, 0x93f, 0x924, 0x940,
+0x92f, 0x3b, 0x91c, 0x941, 0x92e, 0x94d, 0x921, 0x93e, 0x20, 0x92a, 0x94d, 0x930, 0x925, 0x92e, 0x3b, 0x91c, 0x941, 0x92e, 0x94d, 0x921,
+0x93e, 0x20, 0x926, 0x94d, 0x935, 0x93f, 0x924, 0x940, 0x92f, 0x3b, 0x930, 0x91c, 0x92c, 0x3b, 0x936, 0x93e, 0x935, 0x928, 0x3b, 0x930,
+0x92e, 0x91c, 0x93e, 0x928, 0x3b, 0x936, 0x935, 0x94d, 0x935, 0x94d, 0x932, 0x3b, 0x91c, 0x93f, 0x932, 0x2d, 0x915, 0x94d, 0x926, 0x93e,
+0x939, 0x3b, 0x91c, 0x93f, 0x932, 0x94d, 0x2d, 0x939, 0x93f, 0x91c, 0x94d, 0x91c, 0x93e, 0x939, 0x3b, 0x4d, 0x6f, 0x68, 0x2e, 0x3b,
+0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0xe9, 0x62, 0x2e, 0x20, 0x31, 0x3b, 0x52, 0xe9, 0x62, 0x2e, 0x20, 0x32, 0x3b, 0x44,
+0x73, 0x65, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x44, 0x73, 0x65, 0x6d, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x65, 0x64, 0x2e,
+0x3b, 0x53, 0x61, 0x62, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x65, 0x76, 0x2e, 0x3b, 0x44, 0x73, 0xfc, 0x6c,
+0x20, 0x6b, 0x2e, 0x3b, 0x44, 0x73, 0xfc, 0x6c, 0x20, 0x68, 0x2e, 0x3b, 0x4d, 0x6f, 0x68, 0x61, 0x72, 0x72, 0x65, 0x6d,
+0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0xe9, 0x62, 0x69, 0x20, 0x49, 0x3b, 0x52, 0xe9, 0x62, 0x69, 0x20, 0x49,
+0x49, 0x3b, 0x44, 0x73, 0x65, 0x6d, 0xe1, 0x64, 0x69, 0x20, 0x49, 0x3b, 0x44, 0x73, 0x65, 0x6d, 0xe1, 0x64, 0x69, 0x20,
+0x49, 0x49, 0x3b, 0x52, 0x65, 0x64, 0x73, 0x65, 0x62, 0x3b, 0x53, 0x61, 0x62, 0xe1, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61,
+0x64, 0xe1, 0x6e, 0x3b, 0x53, 0x65, 0x76, 0x76, 0xe1, 0x6c, 0x3b, 0x44, 0x73, 0xfc, 0x6c, 0x20, 0x6b, 0x61, 0x64, 0x65,
+0x3b, 0x44, 0x73, 0xfc, 0x6c, 0x20, 0x68, 0x65, 0x64, 0x73, 0x65, 0x3b, 0x4d, 0x6f, 0x68, 0x61, 0x72, 0x72, 0x65, 0x6d,
+0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0xe9, 0x62, 0x69, 0x20, 0x65, 0x6c, 0x20, 0x61, 0x76, 0x76, 0x65, 0x6c,
+0x3b, 0x52, 0xe9, 0x62, 0x69, 0x20, 0x65, 0x6c, 0x20, 0x61, 0x63, 0x63, 0x68, 0x65, 0x72, 0x3b, 0x44, 0x73, 0x65, 0x6d,
+0xe1, 0x64, 0x69, 0x20, 0x65, 0x6c, 0x20, 0x61, 0x76, 0x76, 0x65, 0x6c, 0x3b, 0x44, 0x73, 0x65, 0x6d, 0xe1, 0x64, 0x69,
+0x20, 0x65, 0x6c, 0x20, 0x61, 0x63, 0x63, 0x68, 0x65, 0x72, 0x3b, 0x52, 0x65, 0x64, 0x73, 0x65, 0x62, 0x3b, 0x53, 0x61,
+0x62, 0xe1, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0xe1, 0x6e, 0x3b, 0x53, 0x65, 0x76, 0x76, 0xe1, 0x6c, 0x3b, 0x44,
+0x73, 0xfc, 0x6c, 0x20, 0x6b, 0x61, 0x64, 0x65, 0x3b, 0x44, 0x73, 0xfc, 0x6c, 0x20, 0x68, 0x65, 0x64, 0x73, 0x65, 0x3b,
+0x6d, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x72, 0x61, 0x62,
+0x2e, 0x20, 0x49, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x49, 0x3b,
+0x72, 0x61, 0x6a, 0x2e, 0x3b, 0x73, 0x68, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d, 0x2e, 0x3b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x51, 0x2e, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x48, 0x2e, 0x3b, 0x4d,
+0x75, 0x68, 0x2e, 0x3b, 0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x41, 0x77, 0x61, 0x6c, 0x3b, 0x52,
+0x61, 0x62, 0x2e, 0x20, 0x41, 0x6b, 0x68, 0x69, 0x72, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x41, 0x77, 0x61, 0x6c, 0x3b,
+0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x41, 0x6b, 0x68, 0x69, 0x72, 0x3b, 0x52, 0x61, 0x6a, 0x2e, 0x3b, 0x53, 0x79, 0x61, 0x2e,
+0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x79, 0x61, 0x77, 0x2e, 0x3b, 0x5a, 0x75, 0x6c, 0x6b, 0x61, 0x2e, 0x3b, 0x5a,
+0x75, 0x6c, 0x68, 0x69, 0x2e, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b,
+0x52, 0x61, 0x62, 0x69, 0x75, 0x6c, 0x61, 0x77, 0x61, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x75, 0x6c, 0x61, 0x6b, 0x68,
+0x69, 0x72, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x69, 0x6c, 0x61, 0x77, 0x61, 0x6c, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64,
+0x69, 0x6c, 0x61, 0x6b, 0x68, 0x69, 0x72, 0x3b, 0x52, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x53, 0x79, 0x61, 0x6b, 0x62, 0x61,
+0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x53, 0x79, 0x61, 0x77, 0x61, 0x6c, 0x3b, 0x5a, 0x75, 0x6c,
+0x6b, 0x61, 0x69, 0x64, 0x61, 0x68, 0x3b, 0x5a, 0x75, 0x6c, 0x68, 0x69, 0x6a, 0x61, 0x68, 0x3b, 0x30e0, 0x30cf, 0x30c3, 0x30e9,
+0x30e0, 0x3b, 0x30b5, 0x30d5, 0x30a2, 0x30eb, 0x3b, 0x30e9, 0x30d3, 0x30fc, 0x30fb, 0x30a6, 0x30eb, 0x30fb, 0x30a2, 0x30a6, 0x30ef, 0x30eb, 0x3b, 0x30e9,
+0x30d3, 0x30fc, 0x30fb, 0x30a6, 0x30c3, 0x30fb, 0x30b5, 0x30fc, 0x30cb, 0x30fc, 0x3b, 0x30b8, 0x30e5, 0x30de, 0x30fc, 0x30c0, 0x30eb, 0x30fb, 0x30a2, 0x30a6,
+0x30ef, 0x30eb, 0x3b, 0x30b8, 0x30e5, 0x30de, 0x30fc, 0x30c0, 0x30c3, 0x30b5, 0x30fc, 0x30cb, 0x30fc, 0x3b, 0x30e9, 0x30b8, 0x30e3, 0x30d6, 0x3b, 0x30b7,
+0x30e3, 0x30a2, 0x30d0, 0x30fc, 0x30f3, 0x3b, 0x30e9, 0x30de, 0x30c0, 0x30fc, 0x30f3, 0x3b, 0x30b7, 0x30e3, 0x30a6, 0x30ef, 0x30fc, 0x30eb, 0x3b, 0x30ba,
+0x30eb, 0x30fb, 0x30ab, 0x30a4, 0x30c0, 0x3b, 0x30ba, 0x30eb, 0x30fb, 0x30d2, 0x30c3, 0x30b8, 0x30e3, 0x3b, 0xcae, 0xcc1, 0xcb9, 0xccd, 0x2e, 0x3b,
+0xcb8, 0xcab, 0xcbe, 0x2e, 0x3b, 0xcb0, 0xcac, 0xcbf, 0x2018, 0x20, 0x49, 0x3b, 0xcb0, 0xcac, 0xcbf, 0x2018, 0x20, 0x49, 0x49, 0x3b,
+0xc9c, 0xcc1, 0xcae, 0xccd, 0x2e, 0x20, 0x49, 0x3b, 0xc9c, 0xcc1, 0xcae, 0xccd, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0xcb0, 0xc9c, 0xccd,
+0x2e, 0x3b, 0xcb6, 0x2e, 0x3b, 0xcb0, 0xcae, 0xccd, 0x2e, 0x3b, 0xcb6, 0xcb5, 0xccd, 0x2e, 0x3b, 0xca7, 0xcc1, 0x2018, 0xcb2, 0xccd,
+0x2d, 0xc95, 0xcbf, 0x2e, 0x3b, 0xca7, 0xcc1, 0x2018, 0xcb2, 0xccd, 0x2d, 0xcb9, 0x2e, 0x3b, 0xcae, 0xcc1, 0xcb9, 0xcb0, 0xcae, 0xccd,
+0x3b, 0xcb8, 0xcab, 0xcbe, 0xcb0, 0xccd, 0x3b, 0xcb0, 0xcac, 0xcbf, 0x2018, 0x20, 0x49, 0x3b, 0xcb0, 0xcac, 0xcbf, 0x2018, 0x20, 0x49,
+0x49, 0x3b, 0xc9c, 0xcc1, 0xcae, 0xcbe, 0xca6, 0xcbe, 0x20, 0x49, 0x3b, 0xc9c, 0xcc1, 0xcae, 0xcbe, 0xca6, 0xcbe, 0x20, 0x49, 0x49,
+0x3b, 0xcb0, 0xc9c, 0xcac, 0xccd, 0x3b, 0xcb6, 0x2019, 0xcac, 0xcbe, 0xca8, 0xccd, 0x3b, 0xcb0, 0xcae, 0xca6, 0xcbe, 0xca8, 0xccd, 0x3b,
+0xcb6, 0xcb5, 0xccd, 0xcb5, 0xcbe, 0xcb2, 0xccd, 0x3b, 0xca7, 0xcc1, 0x2018, 0xcb2, 0xccd, 0x2d, 0xc95, 0xcbf, 0x2018, 0xca1, 0xcbe, 0xcb9,
+0xccd, 0x3b, 0xca7, 0xcc1, 0x2018, 0xcb2, 0xccd, 0x2d, 0xcb9, 0xcbf, 0xc9c, 0xcbe, 0xcb9, 0xccd, 0x3b, 0xbb34, 0xd558, 0xb78c, 0x3b, 0xc0ac,
+0xd30c, 0xb974, 0x3b, 0xb77c, 0xbe44, 0x20, 0xc54c, 0x20, 0xc544, 0xc648, 0x3b, 0xb77c, 0xbe44, 0x20, 0xc54c, 0x20, 0xc384, 0xb2c8, 0x3b, 0xc8fc,
+0xb9c8, 0xb2e4, 0x20, 0xc54c, 0x20, 0xc544, 0xc648, 0x3b, 0xc8fc, 0xb9c8, 0xb2e4, 0x20, 0xc54c, 0x20, 0xc384, 0xb2c8, 0x3b, 0xb77c, 0xc7a1, 0x3b,
+0xc250, 0xc544, 0xbc18, 0x3b, 0xb77c, 0xb9c8, 0xb2e8, 0x3b, 0xc250, 0xc648, 0x3b, 0xb4c0, 0x20, 0xc54c, 0x20, 0xae4c, 0xb2e4, 0x3b, 0xb4c0, 0x20,
+0xc54c, 0x20, 0xd788, 0xc790, 0x3b, 0x6d, 0x75, 0x1e96, 0x65, 0x72, 0x65, 0x6d, 0x3b, 0x73, 0x65, 0x66, 0x65, 0x72, 0x3b, 0x72,
+0x65, 0x62, 0xee, 0x2bf, 0x75, 0x6c, 0x65, 0x77, 0x65, 0x6c, 0x3b, 0x72, 0x65, 0x62, 0xee, 0x2bf, 0x75, 0x6c, 0x61, 0x78,
+0x65, 0x72, 0x3b, 0x63, 0x65, 0x6d, 0x61, 0x7a, 0xee, 0x79, 0x65, 0x6c, 0x65, 0x77, 0x65, 0x6c, 0x3b, 0x63, 0x65, 0x6d,
+0x61, 0x7a, 0xee, 0x79, 0x65, 0x6c, 0x61, 0x78, 0x65, 0x72, 0x3b, 0x72, 0x65, 0x63, 0x65, 0x62, 0x3b, 0x15f, 0x65, 0x2bf,
+0x62, 0x61, 0x6e, 0x3b, 0x72, 0x65, 0x6d, 0x65, 0x7a, 0x61, 0x6e, 0x3b, 0x15f, 0x65, 0x77, 0x61, 0x6c, 0x3b, 0x7a, 0xee,
+0x6c, 0x71, 0x65, 0x2bf, 0x64, 0x65, 0x3b, 0x7a, 0xee, 0x6c, 0x1e96, 0x65, 0x63, 0x65, 0x3b, 0xea1, 0xeb8, 0xeae, 0xeb1, 0xe94,
+0x3b, 0xec0, 0xe84, 0xeb2, 0xeb0, 0x3b, 0xeae, 0xead, 0xe81, 0xe9a, 0xeb5, 0x20, 0x31, 0x3b, 0xeae, 0xead, 0xe81, 0xe9a, 0xeb5, 0x20,
+0x32, 0x3b, 0xe99, 0xeb8, 0xea1, 0xeb2, 0x20, 0x31, 0x3b, 0xe99, 0xeb8, 0xea1, 0xeb2, 0x20, 0x32, 0x3b, 0xec0, 0xeae, 0xeb2, 0xeb0,
+0x3b, 0xe8a, 0xeb2, 0x3b, 0xec0, 0xeae, 0xeb2, 0xeb0, 0xea1, 0xeb0, 0x3b, 0xec0, 0xe8a, 0xebb, 0xeb2, 0x3b, 0xe8a, 0xeb8, 0xea5, 0xe81,
+0xeb4, 0xead, 0xeb8, 0x3b, 0xe8a, 0xeb8, 0xea5, 0xeab, 0xeb4, 0xe88, 0x3b, 0xea1, 0xeb8, 0xea3, 0xeb0, 0xeae, 0xead, 0xea1, 0x3b, 0xe8a,
+0xeb2, 0xe9f, 0xeb2, 0xea3, 0x3b, 0xeae, 0xead, 0xe94, 0xe9a, 0xeb5, 0x20, 0x31, 0x3b, 0xeae, 0xead, 0xe94, 0xe9a, 0xeb5, 0x20, 0x32,
+0x3b, 0xe88, 0xeb8, 0xea1, 0xeb2, 0xe94, 0xeb2, 0x20, 0x31, 0x3b, 0xe88, 0xeb8, 0xea1, 0xeb2, 0xe94, 0xeb2, 0x20, 0x32, 0x3b, 0xeae,
+0xeb2, 0xe88, 0xeb1, 0xe9a, 0x3b, 0xe8a, 0xeb0, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xeae, 0xeb2, 0xea1, 0xeb2, 0xe94, 0xead, 0xe99, 0x3b, 0xec0,
+0xe8a, 0xebb, 0xeb2, 0xea7, 0xeb1, 0xe94, 0x3b, 0xe94, 0xeb8, 0xead, 0xeb1, 0xe94, 0xe81, 0xeb4, 0xe94, 0xeb0, 0x3b, 0xe94, 0xeb8, 0xead,
+0xeb1, 0xe94, 0xe81, 0xeb4, 0xe88, 0xeb0, 0x3b, 0xea1, 0xeb8, 0xeae, 0xeb1, 0xe94, 0x3b, 0xec0, 0xe84, 0xeb2, 0xeb0, 0x3b, 0xeae, 0xead,
+0xe94, 0xe9a, 0xeb5, 0x20, 0x31, 0x3b, 0xeae, 0xead, 0xe81, 0xe9a, 0xeb5, 0x20, 0x32, 0x3b, 0xe99, 0xeb8, 0xea1, 0xeb2, 0x20, 0x31,
+0x3b, 0xe99, 0xeb8, 0xea1, 0xeb2, 0x20, 0x32, 0x3b, 0xec0, 0xeae, 0xeb2, 0xeb0, 0x3b, 0xe8a, 0xeb0, 0xead, 0xecc, 0x3b, 0xec0, 0xeae,
+0xeb2, 0xeb0, 0xea1, 0xeb0, 0x3b, 0xec0, 0xe8a, 0xebb, 0xeb2, 0x3b, 0xe8a, 0xeb8, 0xea5, 0xe81, 0xeb4, 0xead, 0xeb8, 0x3b, 0xe8a, 0xeb8,
+0xea5, 0xeab, 0xeb4, 0xe88, 0x3b, 0x6d, 0x75, 0x68, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x73,
+0x3b, 0x31, 0x2e, 0x20, 0x72, 0x61, 0x62, 0x12b, 0x3b, 0x32, 0x2e, 0x20, 0x72, 0x61, 0x62, 0x12b, 0x3b, 0x31, 0x2e, 0x20,
+0x64, 0x17e, 0x75, 0x6d, 0x101, 0x64, 0x101, 0x3b, 0x32, 0x2e, 0x20, 0x64, 0x17e, 0x75, 0x6d, 0x101, 0x64, 0x101, 0x3b, 0x72,
+0x61, 0x64, 0x17e, 0x61, 0x62, 0x73, 0x3b, 0x161, 0x61, 0x62, 0x61, 0x6e, 0x73, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x64, 0x101,
+0x6e, 0x73, 0x3b, 0x161, 0x61, 0x75, 0x76, 0x61, 0x6c, 0x73, 0x3b, 0x64, 0x75, 0x20, 0x61, 0x6c, 0x2d, 0x6b, 0x69, 0x64,
+0x101, 0x3b, 0x64, 0x75, 0x20, 0x61, 0x6c, 0x2d, 0x68, 0x69, 0x64, 0x17e, 0x101, 0x3b, 0x43c, 0x443, 0x445, 0x2e, 0x3b, 0x441,
+0x430, 0x444, 0x2e, 0x3b, 0x440, 0x430, 0x431, 0x2e, 0x20, 0x49, 0x3b, 0x440, 0x430, 0x431, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x45f,
+0x443, 0x43c, 0x2e, 0x20, 0x49, 0x3b, 0x45f, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x440, 0x430, 0x45f, 0x2e, 0x3b, 0x448,
+0x430, 0x431, 0x2e, 0x3b, 0x440, 0x430, 0x43c, 0x2e, 0x3b, 0x448, 0x430, 0x432, 0x2e, 0x3b, 0x434, 0x443, 0x43b, 0x43a, 0x2e, 0x3b,
+0x434, 0x443, 0x43b, 0x445, 0x2e, 0x3b, 0x43c, 0x443, 0x445, 0x430, 0x440, 0x435, 0x43c, 0x3b, 0x441, 0x430, 0x444, 0x430, 0x440, 0x3b,
+0x440, 0x430, 0x431, 0x438, 0x20, 0x49, 0x3b, 0x440, 0x430, 0x431, 0x438, 0x20, 0x49, 0x49, 0x3b, 0x45f, 0x443, 0x43c, 0x430, 0x434,
+0x430, 0x20, 0x49, 0x3b, 0x45f, 0x443, 0x43c, 0x430, 0x434, 0x430, 0x20, 0x49, 0x49, 0x3b, 0x440, 0x430, 0x45f, 0x430, 0x431, 0x3b,
+0x448, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x440, 0x430, 0x43c, 0x430, 0x434, 0x430, 0x43d, 0x3b, 0x448, 0x430, 0x432, 0x430, 0x43b, 0x3b,
+0x434, 0x443, 0x43b, 0x43a, 0x438, 0x434, 0x430, 0x3b, 0x434, 0x443, 0x43b, 0x445, 0x438, 0x45f, 0x430, 0x3b, 0xd2e, 0xd41, 0xd39, 0x2e,
+0x3b, 0xd38, 0xd2b, 0x2e, 0x3b, 0xd31, 0xd2c, 0xd40, 0xd39, 0xd41, 0xd7d, 0x20, 0xd05, 0xd35, 0xd4d, 0xd35, 0x2e, 0x3b, 0xd31, 0xd2c,
+0xd40, 0xd39, 0xd41, 0xd7d, 0x20, 0xd06, 0xd16, 0xd3f, 0x2e, 0x3b, 0xd1c, 0xd2e, 0xd3e, 0xd26, 0xd41, 0xd7d, 0x20, 0xd05, 0xd35, 0xd4d,
+0xd35, 0x2e, 0x3b, 0xd1c, 0xd2e, 0xd3e, 0xd26, 0xd41, 0xd7d, 0x20, 0xd06, 0xd16, 0xd3f, 0x2e, 0x3b, 0xd31, 0xd1c, 0x2e, 0x3b, 0xd36,
+0xd39, 0xd2c, 0xd3e, 0x2e, 0x3b, 0xd31, 0xd2e, 0xd26, 0xd3e, 0x2e, 0x3b, 0xd36, 0xd35, 0xd4d, 0xd35, 0xd3e, 0x2e, 0x3b, 0xd26, 0xd41,
+0xd7d, 0x20, 0xd16, 0xd39, 0x2e, 0x3b, 0xd26, 0xd41, 0xd7d, 0x20, 0xd39, 0xd3f, 0x2e, 0x3b, 0xd2e, 0xd41, 0xd39, 0xd31, 0xd02, 0x3b,
+0xd38, 0xd2b, 0xd7c, 0x3b, 0xd31, 0xd2c, 0xd40, 0xd39, 0xd41, 0xd7d, 0x20, 0xd05, 0xd35, 0xd4d, 0xd35, 0xd7d, 0x3b, 0xd31, 0xd2c, 0xd40,
+0xd39, 0xd41, 0xd7d, 0x20, 0xd06, 0xd16, 0xd3f, 0xd7c, 0x3b, 0xd1c, 0xd2e, 0xd3e, 0xd26, 0xd41, 0xd7d, 0x20, 0xd05, 0xd35, 0xd4d, 0xd35,
+0xd7d, 0x3b, 0xd1c, 0xd2e, 0xd3e, 0xd26, 0xd41, 0xd7d, 0x20, 0xd06, 0xd16, 0xd3f, 0xd7c, 0x3b, 0xd31, 0xd1c, 0xd2c, 0xd4d, 0x3b, 0xd36,
+0xd39, 0xd2c, 0xd3e, 0xd7b, 0x3b, 0xd31, 0xd2e, 0xd26, 0xd3e, 0xd7b, 0x3b, 0xd36, 0xd35, 0xd4d, 0xd35, 0xd3e, 0xd7d, 0x3b, 0xd26, 0xd41,
+0xd7d, 0x20, 0xd16, 0xd39, 0xd26, 0xd4d, 0x3b, 0xd26, 0xd41, 0xd7d, 0x20, 0xd39, 0xd3f, 0xd1c, 0xd4d, 0xd1c, 0x3b, 0xd2e, 0xd41, 0x3b,
+0xd38, 0x3b, 0xd31, 0x3b, 0xd31, 0x3b, 0xd1c, 0x3b, 0xd1c, 0x3b, 0xd31, 0x3b, 0xd36, 0x3b, 0xd31, 0x3b, 0xd36, 0x3b, 0xd26, 0xd41,
+0x3b, 0xd26, 0xd41, 0x3b, 0xd2e, 0xd41, 0xd39, 0xd31, 0xd02, 0x3b, 0xd38, 0xd2b, 0xd7c, 0x3b, 0xd31, 0xd2c, 0xd40, 0xd39, 0xd41, 0xd7d,
+0x20, 0xd05, 0xd35, 0xd4d, 0xd35, 0xd7d, 0x3b, 0xd31, 0xd2c, 0xd40, 0xd39, 0xd41, 0xd7d, 0x20, 0xd06, 0xd16, 0xd3f, 0xd7c, 0x3b, 0xd1c,
+0xd2e, 0xd3e, 0xd26, 0xd41, 0xd7d, 0x20, 0xd05, 0xd35, 0xd4d, 0xd35, 0xd7d, 0x3b, 0xd1c, 0xd2e, 0xd3e, 0xd26, 0xd41, 0xd7d, 0x20, 0xd06,
+0xd16, 0xd3f, 0xd7c, 0x3b, 0xd31, 0xd1c, 0xd2c, 0xd4d, 0x3b, 0xd36, 0xd39, 0xd2c, 0xd3e, 0xd7b, 0x3b, 0xd31, 0xd2e, 0xd33, 0xd3e, 0xd7b,
+0x3b, 0xd36, 0xd35, 0xd4d, 0xd35, 0xd3e, 0xd7d, 0x3b, 0xd26, 0xd41, 0xd7d, 0x20, 0xd16, 0xd39, 0xd26, 0xd4d, 0x3b, 0xd26, 0xd41, 0xd7d,
+0x20, 0xd39, 0xd3f, 0xd1c, 0xd4d, 0xd1c, 0x3b, 0x92e, 0x94b, 0x939, 0x2e, 0x3b, 0x938, 0x92b, 0x2e, 0x3b, 0x930, 0x93e, 0x92c, 0x940,
+0x20, 0x49, 0x3b, 0x930, 0x93e, 0x92c, 0x940, 0x20, 0x49, 0x49, 0x3b, 0x91c, 0x941, 0x92e, 0x93e, 0x2e, 0x20, 0x49, 0x3b, 0x91c,
+0x941, 0x92e, 0x93e, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x930, 0x91d, 0x93e, 0x2e, 0x3b, 0x936, 0x93e, 0x92c, 0x93e, 0x2e, 0x3b, 0x930,
+0x92e, 0x2e, 0x3b, 0x936, 0x935, 0x94d, 0x935, 0x93e, 0x2e, 0x3b, 0x927, 0x941, 0x932, 0x2d, 0x915, 0x940, 0x2e, 0x3b, 0x927, 0x941,
+0x932, 0x2d, 0x939, 0x93f, 0x2e, 0x3b, 0x92e, 0x94b, 0x939, 0x930, 0x92e, 0x3b, 0x938, 0x92b, 0x930, 0x3b, 0x930, 0x93e, 0x92c, 0x940,
+0x20, 0x49, 0x3b, 0x930, 0x93e, 0x92c, 0x940, 0x20, 0x49, 0x49, 0x3b, 0x91c, 0x941, 0x92e, 0x93e, 0x926, 0x93e, 0x20, 0x49, 0x3b,
+0x91c, 0x941, 0x92e, 0x93e, 0x926, 0x93e, 0x20, 0x49, 0x49, 0x3b, 0x930, 0x91d, 0x93e, 0x92c, 0x3b, 0x936, 0x93e, 0x92c, 0x93e, 0x928,
+0x3b, 0x930, 0x92e, 0x91c, 0x93e, 0x928, 0x3b, 0x936, 0x935, 0x94d, 0x935, 0x93e, 0x932, 0x3b, 0x927, 0x941, 0x932, 0x2d, 0x915, 0x940,
+0x926, 0x93e, 0x939, 0x3b, 0x927, 0x941, 0x932, 0x2d, 0x939, 0x93f, 0x91c, 0x93e, 0x939, 0x3b, 0x967, 0x3b, 0x968, 0x3b, 0x969, 0x3b,
+0x96a, 0x3b, 0x96b, 0x3b, 0x96c, 0x3b, 0x96d, 0x3b, 0x96e, 0x3b, 0x96f, 0x3b, 0x967, 0x966, 0x3b, 0x967, 0x967, 0x3b, 0x967, 0x968,
+0x3b, 0x6d, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x72, 0x61,
+0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x49,
+0x3b, 0x72, 0x61, 0x6a, 0x2e, 0x3b, 0x73, 0x68, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d, 0x2e, 0x3b, 0x73, 0x68, 0x61, 0x77,
+0x2e, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x71, 0x2e, 0x3b, 0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x48, 0x2e, 0x3b,
+0x6d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb,
+0x20, 0x49, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49,
+0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x49, 0x3b, 0x72, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x73, 0x68, 0x61,
+0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x73, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c,
+0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x71, 0x69, 0x2bb, 0x64, 0x61, 0x68, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d,
+0x68, 0x69, 0x6a, 0x6a, 0x61, 0x68, 0x3b, 0x6d, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62,
+0x2e, 0x20, 0x49, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x6a,
+0x75, 0x6d, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x72, 0x61, 0x6a, 0x2e, 0x3b, 0x73, 0x68, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d,
+0x2e, 0x3b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x71, 0x2e, 0x3b, 0x64, 0x68, 0x75,
+0x2bb, 0x6c, 0x2d, 0x68, 0x2e, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x3b,
+0x631, 0x628, 0x64a, 0x639, 0x20, 0x49, 0x49, 0x3b, 0x62c, 0x645, 0x627, 0x639, 0x647, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x64a, 0x20,
+0x6f2, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648,
+0x627, 0x644, 0x3b, 0x62f, 0x627, 0x644, 0x642, 0x627, 0x639, 0x62f, 0x647, 0x3b, 0x630, 0x64a, 0x20, 0x627, 0x644, 0x62d, 0x62c, 0x3b,
+0x645, 0x62d, 0x631, 0x645, 0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x20, 0x49,
+0x49, 0x3b, 0x62c, 0x645, 0x627, 0x639, 0x647, 0x3b, 0x62c, 0x645, 0x648, 0x645, 0x627, 0x20, 0x49, 0x49, 0x3b, 0x631, 0x62c, 0x628,
+0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x62f, 0x627,
+0x644, 0x642, 0x627, 0x639, 0x62f, 0x647, 0x3b, 0x630, 0x64a, 0x20, 0x627, 0x644, 0x62d, 0x62c, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b,
+0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x20, 0x49, 0x49, 0x3b, 0x62c, 0x645, 0x627,
+0x62f, 0x20, 0x6f1, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x20, 0x6f2, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646,
+0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x62f, 0x627, 0x644, 0x642, 0x627, 0x639, 0x62f, 0x647,
+0x3b, 0x630, 0x64a, 0x20, 0x627, 0x644, 0x62d, 0x62c, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628,
+0x64a, 0x639, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x20, 0x49, 0x49, 0x3b, 0x62c, 0x645, 0x627, 0x639, 0x647, 0x3b, 0x62c, 0x645, 0x648,
+0x645, 0x627, 0x20, 0x49, 0x49, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627,
+0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x630, 0x64a, 0x20, 0x627, 0x644, 0x642, 0x639, 0x62f, 0x647, 0x3b, 0x630, 0x64a, 0x20,
+0x627, 0x644, 0x62d, 0x62c, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b, 0x62f, 0x20, 0x635, 0x641, 0x631, 0x6d2, 0x20, 0x62f, 0x3b, 0x631,
+0x628, 0x64a, 0x639, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x20, 0x49, 0x49, 0x3b, 0x62c, 0x645, 0x627, 0x639, 0x647, 0x3b, 0x62c, 0x645,
+0x648, 0x645, 0x627, 0x20, 0x49, 0x49, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636,
+0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x62f, 0x627, 0x644, 0x642, 0x627, 0x639, 0x62f, 0x647, 0x3b, 0x630, 0x64a, 0x20,
+0x627, 0x644, 0x62d, 0x62c, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b, 0x62f, 0x20, 0x635, 0x641, 0x631, 0x6d2, 0x20, 0x62f, 0x3b, 0x631,
+0x628, 0x64a, 0x639, 0x3b, 0x631, 0x628, 0x64a, 0x639, 0x20, 0x49, 0x49, 0x3b, 0x62c, 0x645, 0x627, 0x639, 0x647, 0x3b, 0x62c, 0x645,
+0x648, 0x645, 0x627, 0x20, 0x49, 0x49, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636,
+0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x630, 0x64a, 0x20, 0x627, 0x644, 0x642, 0x639, 0x62f, 0x647, 0x3b, 0x630, 0x64a,
+0x20, 0x627, 0x644, 0x62d, 0x62c, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x6cc, 0x639, 0x200c,
+0x627, 0x644, 0x627, 0x648, 0x644, 0x3b, 0x631, 0x628, 0x6cc, 0x639, 0x200c, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x6cc, 0x3b, 0x62c, 0x645,
+0x627, 0x62f, 0x6cc, 0x200c, 0x627, 0x644, 0x627, 0x648, 0x644, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x200c, 0x627, 0x644, 0x62b, 0x627,
+0x646, 0x6cc, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634,
+0x648, 0x627, 0x644, 0x3b, 0x630, 0x6cc, 0x642, 0x639, 0x62f, 0x647, 0x3b, 0x630, 0x6cc, 0x62d, 0x62c, 0x647, 0x3b, 0x645, 0x3b, 0x635,
+0x3b, 0x631, 0x3b, 0x631, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x631, 0x3b, 0x634, 0x3b, 0x631, 0x3b, 0x634, 0x3b, 0x630, 0x3b, 0x630,
+0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x6cc, 0x639, 0x200c, 0x627, 0x644, 0x627, 0x648, 0x644,
+0x3b, 0x631, 0x628, 0x6cc, 0x639, 0x200c, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x6cc, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x200c, 0x627,
+0x644, 0x627, 0x648, 0x644, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x200c, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x6cc, 0x3b, 0x631, 0x62c,
+0x628, 0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x630,
+0x6cc, 0x642, 0x639, 0x62f, 0x647, 0x654, 0x3b, 0x630, 0x6cc, 0x62d, 0x62c, 0x647, 0x654, 0x3b, 0x4d, 0x75, 0x68, 0x2e, 0x3b, 0x53,
+0x61, 0x66, 0x2e, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x44,
+0x17c, 0x75, 0x2e, 0x20, 0x49, 0x3b, 0x44, 0x17c, 0x75, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61, 0x2e, 0x3b, 0x53, 0x7a,
+0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x7a, 0x61, 0x77, 0x2e, 0x3b, 0x5a, 0x75, 0x20, 0x61, 0x6c, 0x2d,
+0x6b, 0x2e, 0x3b, 0x5a, 0x75, 0x20, 0x61, 0x6c, 0x2d, 0x68, 0x2e, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d,
+0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb,
+0x20, 0x49, 0x49, 0x3b, 0x44, 0x17c, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x3b, 0x44, 0x17c, 0x75, 0x6d, 0x61, 0x64,
+0x61, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61, 0x64, 0x17c, 0x61, 0x62, 0x3b, 0x53, 0x7a, 0x61, 0x62, 0x61, 0x6e, 0x3b, 0x52,
+0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x53, 0x7a, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x5a, 0x75, 0x20, 0x61, 0x6c,
+0x2d, 0x6b, 0x61, 0x64, 0x61, 0x3b, 0x5a, 0x75, 0x20, 0x61, 0x6c, 0x2d, 0x68, 0x69, 0x64, 0x17c, 0x64, 0x17c, 0x61, 0x3b,
+0xa2e, 0xa41, 0xa39, 0xa71, 0x2e, 0x3b, 0xa38, 0xa2b, 0x2e, 0x3b, 0xa30, 0xa2c, 0x2e, 0x20, 0x49, 0x3b, 0xa30, 0xa2c, 0x2e, 0x20,
+0x49, 0x49, 0x3b, 0xa1c, 0xa41, 0xa2e, 0x2e, 0x20, 0x49, 0x3b, 0xa1c, 0xa41, 0xa2e, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0xa30, 0xa3e,
+0xa1c, 0x2e, 0x3b, 0xa38, 0xa3c, 0xa3e, 0x2e, 0x3b, 0xa30, 0xa3e, 0xa2e, 0x2e, 0x3b, 0xa38, 0xa3c, 0xa05, 0x2e, 0x3b, 0xa26, 0xa42,
+0x2d, 0xa05, 0xa32, 0x2d, 0xa15, 0xa40, 0x2e, 0x3b, 0xa26, 0xa42, 0x2d, 0xa05, 0xa32, 0x2d, 0xa39, 0xa3f, 0x2e, 0x3b, 0xa2e, 0xa41,
+0xa39, 0xa71, 0xa30, 0xa2e, 0x3b, 0xa38, 0xa2b, 0xa30, 0x3b, 0xa30, 0xa2c, 0xa40, 0x2bb, 0x20, 0x49, 0x3b, 0xa30, 0xa2c, 0xa40, 0x2bb,
+0x20, 0x49, 0x49, 0x3b, 0xa1c, 0xa41, 0xa2e, 0xa3e, 0xa26, 0xa3e, 0x20, 0x49, 0x3b, 0xa1c, 0xa41, 0xa2e, 0xa3e, 0xa26, 0xa3e, 0x20,
+0x49, 0x49, 0x3b, 0xa30, 0xa1c, 0xa2c, 0x3b, 0xa38, 0xa3c, 0xa2c, 0xa3e, 0xa28, 0x3b, 0xa30, 0xa2e, 0xa1c, 0xa3c, 0xa3e, 0xa28, 0x3b,
+0xa38, 0xa3c, 0xa35, 0xa3e, 0xa32, 0x3b, 0xa26, 0xa42, 0x2d, 0xa05, 0xa32, 0x2d, 0xa15, 0xa40, 0xa26, 0xa3e, 0xa39, 0x3b, 0xa26, 0xa42,
+0x2d, 0xa05, 0xa32, 0x2d, 0xa39, 0xa3f, 0xa1c, 0xa4d, 0xa39, 0xa3e, 0x3b, 0xa2e, 0xa41, 0xa39, 0xa71, 0xa30, 0xa2e, 0x3b, 0xa38, 0xa2b,
+0xa30, 0x3b, 0xa30, 0xa2c, 0xa40, 0x20, 0x2bb, 0x20, 0x49, 0x3b, 0xa30, 0xa2c, 0xa40, 0x20, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0xa1c,
+0xa41, 0xa2e, 0xa3e, 0xa26, 0xa3e, 0x20, 0x49, 0x3b, 0xa1c, 0xa41, 0xa2e, 0xa3e, 0xa26, 0xa3e, 0x20, 0x49, 0x49, 0x3b, 0xa30, 0xa1c,
+0xa2c, 0x3b, 0xa38, 0xa3c, 0xa2c, 0xa3e, 0xa28, 0x3b, 0xa30, 0xa2e, 0xa1c, 0xa3c, 0xa3e, 0xa28, 0x3b, 0xa38, 0xa3c, 0xa35, 0xa3e, 0xa32,
+0x3b, 0xa26, 0xa42, 0x2d, 0xa05, 0xa32, 0x2d, 0xa15, 0xa40, 0xa26, 0xa3e, 0xa39, 0x3b, 0xa26, 0xa42, 0x2d, 0xa05, 0xa32, 0x2d, 0xa39,
+0xa3f, 0xa1c, 0xa4d, 0xa39, 0xa3e, 0x3b, 0x43c, 0x443, 0x445, 0x2e, 0x3b, 0x441, 0x430, 0x444, 0x2e, 0x3b, 0x440, 0x430, 0x431, 0x2e,
+0x20, 0x49, 0x3b, 0x440, 0x430, 0x431, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x3b, 0x434,
+0x436, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x440, 0x430, 0x434, 0x436, 0x2e, 0x3b, 0x448, 0x430, 0x430, 0x431, 0x2e, 0x3b,
+0x440, 0x430, 0x43c, 0x2e, 0x3b, 0x448, 0x430, 0x432, 0x2e, 0x3b, 0x437, 0x443, 0x43b, 0x44c, 0x2d, 0x43a, 0x2e, 0x3b, 0x437, 0x443,
+0x43b, 0x44c, 0x2d, 0x445, 0x2e, 0x3b, 0x43c, 0x443, 0x445, 0x430, 0x440, 0x440, 0x430, 0x43c, 0x3b, 0x441, 0x430, 0x444, 0x430, 0x440,
+0x3b, 0x440, 0x430, 0x431, 0x438, 0x2d, 0x443, 0x43b, 0x44c, 0x2d, 0x430, 0x432, 0x432, 0x430, 0x43b, 0x44c, 0x3b, 0x440, 0x430, 0x431,
+0x438, 0x2d, 0x443, 0x43b, 0x44c, 0x2d, 0x430, 0x445, 0x438, 0x440, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x430, 0x434, 0x2d, 0x443, 0x43b,
+0x44c, 0x2d, 0x430, 0x432, 0x432, 0x430, 0x43b, 0x44c, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x430, 0x434, 0x2d, 0x443, 0x43b, 0x44c, 0x2d,
+0x430, 0x445, 0x438, 0x440, 0x3b, 0x440, 0x430, 0x434, 0x436, 0x430, 0x431, 0x3b, 0x448, 0x430, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x440,
+0x430, 0x43c, 0x430, 0x434, 0x430, 0x43d, 0x3b, 0x448, 0x430, 0x432, 0x432, 0x430, 0x43b, 0x44c, 0x3b, 0x437, 0x443, 0x43b, 0x44c, 0x2d,
+0x43a, 0x430, 0x430, 0x434, 0x430, 0x3b, 0x437, 0x443, 0x43b, 0x44c, 0x2d, 0x445, 0x438, 0x434, 0x436, 0x436, 0x430, 0x3b, 0x41c, 0x443,
+0x445, 0x2e, 0x3b, 0x421, 0x430, 0x444, 0x2e, 0x3b, 0x420, 0x435, 0x431, 0x2e, 0x20, 0x31, 0x3b, 0x420, 0x435, 0x431, 0x2e, 0x20,
+0x32, 0x3b, 0x40f, 0x443, 0x43c, 0x2e, 0x20, 0x31, 0x3b, 0x40f, 0x443, 0x43c, 0x2e, 0x20, 0x32, 0x3b, 0x420, 0x435, 0x45f, 0x2e,
+0x3b, 0x428, 0x430, 0x2e, 0x3b, 0x420, 0x430, 0x43c, 0x2e, 0x3b, 0x428, 0x435, 0x2e, 0x3b, 0x417, 0x443, 0x43b, 0x2d, 0x43a, 0x2e,
+0x3b, 0x417, 0x443, 0x43b, 0x2d, 0x445, 0x2e, 0x3b, 0x41c, 0x443, 0x445, 0x430, 0x440, 0x435, 0x43c, 0x3b, 0x421, 0x430, 0x444, 0x435,
+0x440, 0x3b, 0x420, 0x435, 0x431, 0x438, 0x20, 0x31, 0x3b, 0x420, 0x435, 0x431, 0x438, 0x20, 0x32, 0x3b, 0x40f, 0x443, 0x43c, 0x430,
+0x434, 0x435, 0x20, 0x31, 0x3b, 0x40f, 0x443, 0x43c, 0x430, 0x434, 0x435, 0x20, 0x32, 0x3b, 0x420, 0x435, 0x45f, 0x435, 0x431, 0x3b,
+0x428, 0x430, 0x2bb, 0x431, 0x430, 0x43d, 0x3b, 0x420, 0x430, 0x43c, 0x430, 0x437, 0x430, 0x43d, 0x3b, 0x428, 0x435, 0x432, 0x430, 0x43b,
+0x3b, 0x417, 0x443, 0x43b, 0x2d, 0x43a, 0x430, 0x434, 0x435, 0x3b, 0x417, 0x443, 0x43b, 0x2d, 0x445, 0x438, 0x45f, 0x435, 0x3b, 0x41c,
+0x443, 0x440, 0x430, 0x445, 0x430, 0x43c, 0x3b, 0x421, 0x430, 0x444, 0x430, 0x440, 0x3b, 0x420, 0x430, 0x431, 0x438, 0x2bb, 0x20, 0x49,
+0x3b, 0x420, 0x430, 0x431, 0x438, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x408, 0x443, 0x43c, 0x430, 0x434, 0x430, 0x20, 0x49, 0x3b, 0x408,
+0x443, 0x43c, 0x430, 0x434, 0x430, 0x20, 0x49, 0x49, 0x3b, 0x420, 0x430, 0x452, 0x430, 0x431, 0x3b, 0x428, 0x430, 0x2bb, 0x431, 0x430,
+0x43d, 0x3b, 0x420, 0x430, 0x43c, 0x430, 0x434, 0x430, 0x43d, 0x3b, 0x428, 0x430, 0x432, 0x430, 0x43b, 0x3b, 0x414, 0x443, 0x2bb, 0x43b,
+0x2d, 0x41a, 0x438, 0x2bb, 0x434, 0x430, 0x3b, 0x414, 0x443, 0x2bb, 0x43b, 0x2d, 0x445, 0x438, 0x452, 0x430, 0x3b, 0x4d, 0x75, 0x68,
+0x2e, 0x3b, 0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0x65, 0x62, 0x2e, 0x20, 0x31, 0x3b, 0x52, 0x65, 0x62, 0x2e, 0x20, 0x32,
+0x3b, 0x44, 0x17e, 0x75, 0x6d, 0x2e, 0x20, 0x31, 0x3b, 0x44, 0x17e, 0x75, 0x6d, 0x2e, 0x20, 0x32, 0x3b, 0x52, 0x65, 0x64,
+0x17e, 0x2e, 0x3b, 0x160, 0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x160, 0x65, 0x2e, 0x3b, 0x5a, 0x75, 0x6c, 0x2d,
+0x6b, 0x2e, 0x3b, 0x5a, 0x75, 0x6c, 0x2d, 0x68, 0x2e, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x65, 0x6d, 0x3b, 0x53, 0x61,
+0x66, 0x65, 0x72, 0x3b, 0x52, 0x65, 0x62, 0x69, 0x20, 0x31, 0x3b, 0x52, 0x65, 0x62, 0x69, 0x20, 0x32, 0x3b, 0x44, 0x17e,
+0x75, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x31, 0x3b, 0x44, 0x17e, 0x75, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x32, 0x3b, 0x52, 0x65,
+0x64, 0x17e, 0x65, 0x62, 0x3b, 0x160, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x7a, 0x61, 0x6e, 0x3b,
+0x160, 0x65, 0x76, 0x61, 0x6c, 0x3b, 0x5a, 0x75, 0x6c, 0x2d, 0x6b, 0x61, 0x64, 0x65, 0x3b, 0x5a, 0x75, 0x6c, 0x2d, 0x68,
+0x69, 0x64, 0x17e, 0x65, 0x3b, 0x4d, 0x75, 0x72, 0x61, 0x68, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52,
+0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x61,
+0x64, 0x61, 0x20, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61, 0x111, 0x61, 0x62,
+0x3b, 0x160, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x160, 0x61, 0x76, 0x61,
+0x6c, 0x3b, 0x44, 0x75, 0x2bb, 0x6c, 0x2d, 0x4b, 0x69, 0x2bb, 0x64, 0x61, 0x3b, 0x44, 0x75, 0x2bb, 0x6c, 0x2d, 0x68, 0x69,
+0x111, 0x61, 0x3b, 0x6d, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61, 0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b,
+0x72, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x64, 0x17e, 0x75, 0x6d,
+0x2e, 0x20, 0x49, 0x49, 0x3b, 0x72, 0x61, 0x64, 0x2e, 0x3b, 0x161, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d, 0x2e, 0x3b, 0x161,
+0x61, 0x75, 0x2e, 0x3b, 0x64, 0x68, 0xfa, 0x20, 0x6c, 0x2d, 0x6b, 0x2e, 0x3b, 0x64, 0x68, 0xfa, 0x20, 0x6c, 0x2d, 0x68,
+0x2e, 0x3b, 0x61, 0x6c, 0x2d, 0x6d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x3b,
+0x72, 0x61, 0x62, 0xed, 0xb4, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x76, 0x76, 0x61, 0x6c, 0x3b, 0x72, 0x61, 0x62, 0xed, 0xb4,
+0x61, 0x74, 0x68, 0x2d, 0x74, 0x68, 0xe1, 0x6e, 0xed, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0xe1, 0x64, 0xe1, 0x20, 0x6c, 0x2d,
+0xfa, 0x6c, 0xe1, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0xe1, 0x64, 0xe1, 0x20, 0x6c, 0x2d, 0xe1, 0x63, 0x68, 0x69, 0x72, 0x61,
+0x3b, 0x72, 0x61, 0x64, 0x17e, 0x61, 0x62, 0x3b, 0x161, 0x61, 0xb4, 0x20, 0x62, 0xe1, 0x6e, 0x3b, 0x72, 0x61, 0x6d, 0x61,
+0x64, 0xe1, 0x6e, 0x3b, 0x161, 0x61, 0x75, 0x76, 0xe1, 0x6c, 0x3b, 0x64, 0x68, 0xfa, 0x20, 0x6c, 0x2d, 0x6b, 0x61, 0xb4,
+0x20, 0x64, 0x61, 0x3b, 0x64, 0x68, 0xfa, 0x20, 0x6c, 0x2d, 0x68, 0x69, 0x64, 0x17e, 0x64, 0x17e, 0x61, 0x3b, 0x4d, 0x75,
+0x78, 0x2e, 0x3b, 0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20,
+0x49, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61,
+0x6a, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x77, 0x2e, 0x3b, 0x44,
+0x75, 0x6c, 0x2d, 0x51, 0x2e, 0x3b, 0x44, 0x75, 0x6c, 0x2d, 0x58, 0x2e, 0x3b, 0x4d, 0x75, 0x78, 0x61, 0x72, 0x72, 0x61,
+0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x63, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x77, 0x77,
+0x61, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x63, 0x20, 0x61, 0x6c, 0x2d, 0x74, 0x68, 0x61, 0x6e, 0x69, 0x3b, 0x4a, 0x75,
+0x6d, 0x61, 0x64, 0x61, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61,
+0x20, 0x61, 0x6c, 0x2d, 0x74, 0x68, 0x61, 0x6e, 0x69, 0x3b, 0x52, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x53, 0x68, 0x61, 0x63,
+0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x53, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b,
+0x44, 0x75, 0x6c, 0x20, 0x61, 0x6c, 0x2d, 0x71, 0x61, 0x63, 0x64, 0x61, 0x68, 0x3b, 0x44, 0x75, 0x6c, 0x20, 0x78, 0x69,
+0x6a, 0x6a, 0x61, 0x68, 0x3b, 0x4d, 0x75, 0x78, 0x2e, 0x3b, 0x53, 0x61, 0x66, 0x2e, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20,
+0x49, 0x3b, 0x52, 0x61, 0x62, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x49, 0x3b, 0x4a, 0x75, 0x6d,
+0x2e, 0x20, 0x49, 0x49, 0x3b, 0x52, 0x61, 0x6a, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b,
+0x53, 0x68, 0x61, 0x77, 0x2e, 0x3b, 0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x51, 0x2e, 0x3b, 0x44, 0x68, 0x75, 0x2bb, 0x6c,
+0x2d, 0x48, 0x2e, 0x3b, 0x4d, 0x75, 0x78, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52,
+0x61, 0x62, 0x69, 0x63, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x63, 0x20,
+0x61, 0x6c, 0x2d, 0x74, 0x68, 0x61, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x61, 0x6c, 0x2d, 0x61,
+0x77, 0x77, 0x61, 0x6c, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x61, 0x6c, 0x2d, 0x74, 0x68, 0x61, 0x6e, 0x69,
+0x3b, 0x52, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x53, 0x68, 0x61, 0x63, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64,
+0x61, 0x6e, 0x3b, 0x53, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x44, 0x75, 0x6c, 0x20, 0x61, 0x6c, 0x2d, 0x71, 0x61,
+0x63, 0x64, 0x61, 0x3b, 0x44, 0x75, 0x6c, 0x20, 0x78, 0x69, 0x6a, 0x6a, 0x61, 0x68, 0x3b, 0x6d, 0x75, 0x68, 0x61, 0x72,
+0x72, 0x61, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x3b, 0x72, 0x61,
+0x62, 0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x3b, 0x6a, 0x75, 0x6d, 0x61,
+0x64, 0x61, 0x20, 0x49, 0x49, 0x3b, 0x72, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x73, 0x68, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b,
+0x72, 0x61, 0x6d, 0x61, 0x64, 0xe1, 0x6e, 0x3b, 0x73, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x64, 0x68, 0x75, 0x2bb,
+0x6c, 0x2d, 0x71, 0x69, 0x2bb, 0x64, 0x61, 0x68, 0x3b, 0x64, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x68, 0x69, 0x6a, 0x6a, 0x61,
+0x68, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0x61, 0x62,
+0x69, 0x2019, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x69, 0x2019, 0x20, 0x61, 0x6c,
+0x2d, 0x61, 0x6b, 0x68, 0x69, 0x72, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x2d, 0x6c, 0x2d, 0x75, 0x6c, 0x61, 0x3b,
+0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x2d, 0x6c, 0x2d, 0x61, 0x6b, 0x68, 0x69, 0x72, 0x61, 0x3b, 0x52, 0x61, 0x6a, 0x61,
+0x62, 0x3b, 0x53, 0x68, 0x61, 0x2019, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x53, 0x68,
+0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x44, 0x68, 0x75, 0x2d, 0x6c, 0x2d, 0x67, 0x61, 0x2019, 0x64, 0x61, 0x3b, 0x44, 0x68,
+0x75, 0x2d, 0x6c, 0x2d, 0x68, 0x69, 0x6a, 0x6a, 0x61, 0x3b, 0x6d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x73,
+0x61, 0x66, 0x61, 0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2019, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b,
+0x72, 0x61, 0x62, 0x69, 0x2019, 0x20, 0x61, 0x6c, 0x2d, 0x61, 0x6b, 0x68, 0x69, 0x72, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64,
+0x61, 0x2d, 0x6c, 0x2d, 0x75, 0x6c, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x2d, 0x6c, 0x2d, 0x61, 0x6b, 0x68,
+0x69, 0x72, 0x61, 0x3b, 0x72, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x73, 0x68, 0x61, 0x2019, 0x62, 0x61, 0x6e, 0x3b, 0x72, 0x61,
+0x6d, 0x61, 0x64, 0x61, 0x6e, 0x3b, 0x73, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x64, 0x68, 0x75, 0x2d, 0x6c, 0x2d,
+0x67, 0x61, 0x2019, 0x64, 0x61, 0x3b, 0x64, 0x68, 0x75, 0x2d, 0x6c, 0x2d, 0x68, 0x69, 0x6a, 0x6a, 0x61, 0x3b, 0x41c, 0x443,
+0x4b3, 0x2e, 0x3b, 0x421, 0x430, 0x444, 0x2e, 0x3b, 0x420, 0x430, 0x431, 0x2e, 0x20, 0x49, 0x3b, 0x420, 0x430, 0x431, 0x2e, 0x20,
+0x49, 0x49, 0x3b, 0x4b6, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x3b, 0x4b6, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x420, 0x430,
+0x4b7, 0x2e, 0x3b, 0x428, 0x430, 0x2e, 0x3b, 0x420, 0x430, 0x43c, 0x2e, 0x3b, 0x428, 0x430, 0x432, 0x2e, 0x3b, 0x414, 0x445, 0x443,
+0x43b, 0x2d, 0x49a, 0x2e, 0x3b, 0x414, 0x445, 0x443, 0x43b, 0x2d, 0x4b2, 0x2e, 0x3b, 0x43c, 0x443, 0x4b3, 0x430, 0x440, 0x440, 0x430,
+0x43c, 0x3b, 0x441, 0x430, 0x444, 0x430, 0x440, 0x3b, 0x420, 0x430, 0x431, 0x435, 0x44a, 0x20, 0x49, 0x3b, 0x420, 0x430, 0x431, 0x435,
+0x44a, 0x20, 0x49, 0x49, 0x3b, 0x4b7, 0x438, 0x43c, 0x43e, 0x434, 0x438, 0x2d, 0x443, 0x43b, 0x2d, 0x443, 0x43b, 0x43e, 0x3b, 0x4b7,
+0x438, 0x43c, 0x43e, 0x434, 0x438, 0x2d, 0x443, 0x43b, 0x2d, 0x441, 0x43e, 0x43d, 0x438, 0x3b, 0x440, 0x430, 0x4b7, 0x430, 0x431, 0x3b,
+0x428, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x420, 0x430, 0x43c, 0x430, 0x434, 0x430, 0x43d, 0x3b, 0x428, 0x430, 0x432, 0x432, 0x430, 0x43b,
+0x3b, 0x414, 0x445, 0x443, 0x43b, 0x2d, 0x49a, 0x438, 0x434, 0x430, 0x4b3, 0x3b, 0x414, 0x445, 0x443, 0x43b, 0x2d, 0x4b2, 0x438, 0x4b7,
+0x4b7, 0x430, 0x4b3, 0x3b, 0x43c, 0x443, 0x4b3, 0x430, 0x440, 0x440, 0x430, 0x43c, 0x3b, 0x441, 0x430, 0x444, 0x430, 0x440, 0x3b, 0x420,
+0x430, 0x431, 0x435, 0x44a, 0x20, 0x49, 0x3b, 0x420, 0x430, 0x431, 0x435, 0x44a, 0x20, 0x49, 0x49, 0x3b, 0x4b7, 0x438, 0x43c, 0x43e,
+0x434, 0x438, 0x2d, 0x443, 0x43b, 0x2d, 0x443, 0x43b, 0x43e, 0x3b, 0x4b7, 0x438, 0x43c, 0x43e, 0x434, 0x438, 0x2d, 0x443, 0x43b, 0x2d,
+0x441, 0x43e, 0x43d, 0x438, 0x3b, 0x440, 0x430, 0x4b7, 0x430, 0x431, 0x3b, 0x428, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x420, 0x430, 0x43c,
+0x430, 0x434, 0x430, 0x43d, 0x3b, 0x428, 0x430, 0x432, 0x432, 0x430, 0x43b, 0x3b, 0x414, 0x445, 0x443, 0x442, 0x2d, 0x49a, 0x438, 0x434,
+0x430, 0x4b3, 0x3b, 0x414, 0x445, 0x443, 0x442, 0x2d, 0x4b2, 0x438, 0x4b7, 0x4b7, 0x430, 0x4b3, 0x3b, 0xbae, 0xbc1, 0xbb9, 0x2e, 0x3b,
+0xb9a, 0xb83, 0xbaa, 0x2e, 0x3b, 0xbb0, 0xbaa, 0xbbf, 0x20, 0x31, 0x3b, 0xbb0, 0xbaa, 0xbbf, 0x20, 0x32, 0x3b, 0xb9c, 0xbc1, 0xbae,
+0x2e, 0x20, 0x31, 0x3b, 0xb9c, 0xbc1, 0xbae, 0x2e, 0x20, 0x32, 0x3b, 0xbb0, 0xb9c, 0x2e, 0x3b, 0xbb7, 0xb83, 0x2e, 0x3b, 0xbb0,
+0xbae, 0x2e, 0x3b, 0xbb7, 0xbb5, 0xbcd, 0x2e, 0x3b, 0xba4, 0xbc1, 0xbb2, 0xbcd, 0x20, 0xb95, 0xb83, 0x2e, 0x3b, 0xba4, 0xbc1, 0xbb2,
+0xbcd, 0x20, 0xbb9, 0xbbf, 0xb9c, 0xbcd, 0x2e, 0x3b, 0xbae, 0xbc1, 0xbb9, 0xbb0, 0xbcd, 0xbb0, 0xbae, 0xbcd, 0x3b, 0xb9a, 0xb83, 0xbaa,
+0xbb0, 0xbcd, 0x3b, 0xbb0, 0xbaa, 0xbbf, 0x20, 0x31, 0x3b, 0xbb0, 0xbaa, 0xbbf, 0x20, 0x32, 0x3b, 0xb9c, 0xbc1, 0xbae, 0xba4, 0xbbe,
+0x20, 0x31, 0x3b, 0xb9c, 0xbc1, 0xbae, 0xba4, 0xbbe, 0x20, 0x32, 0x3b, 0xbb0, 0xb9c, 0xbaa, 0xbcd, 0x3b, 0xbb7, 0xb83, 0xbaa, 0xbbe,
+0xba9, 0xbcd, 0x3b, 0xbb0, 0xbae, 0xbb2, 0xbbe, 0xba9, 0xbcd, 0x3b, 0xbb7, 0xbb5, 0xbcd, 0xbb5, 0xbbe, 0xbb2, 0xbcd, 0x3b, 0xba4, 0xbc1,
+0xbb2, 0xbcd, 0x20, 0xb95, 0xb83, 0xba4, 0xbbe, 0x3b, 0xba4, 0xbc1, 0xbb2, 0xbcd, 0x20, 0xbb9, 0xbbf, 0xb9c, 0xbcd, 0xb9c, 0xbbe, 0x3b,
+0xc2e, 0xc41, 0xc39, 0x2e, 0x3b, 0xc38, 0xc2b, 0x2e, 0x3b, 0xc30, 0x2e, 0x20, 0x49, 0x3b, 0xc30, 0x2e, 0x20, 0x49, 0x49, 0x3b,
+0xc1c, 0xc41, 0xc2e, 0x2e, 0x20, 0x49, 0x3b, 0xc1c, 0xc41, 0xc2e, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0xc30, 0xc1c, 0x2e, 0x3b, 0xc37,
+0xc2c, 0xc3e, 0x2e, 0x3b, 0xc30, 0xc02, 0xc1c, 0xc3e, 0x2e, 0x3b, 0xc37, 0xc35, 0xc4d, 0xc35, 0xc3e, 0x2e, 0x3b, 0xc27, 0xc41, 0xc32,
+0xc4d, 0x2d, 0xc15, 0xc3f, 0x2e, 0x3b, 0xc27, 0xc41, 0xc32, 0xc4d, 0x2d, 0xc39, 0xc3f, 0x2e, 0x3b, 0xc2e, 0xc41, 0xc39, 0xc30, 0xc4d,
+0xc30, 0xc02, 0x3b, 0xc38, 0xc2b, 0xc30, 0xc4d, 0x3b, 0xc30, 0xc2c, 0xc40, 0x20, 0x49, 0x3b, 0xc30, 0xc2c, 0xc40, 0x20, 0x49, 0x49,
+0x3b, 0xc1c, 0xc41, 0xc2e, 0xc26, 0xc3e, 0x20, 0x49, 0x3b, 0xc1c, 0xc41, 0xc2e, 0xc26, 0xc3e, 0x20, 0x49, 0x49, 0x3b, 0xc30, 0xc1c,
+0xc2c, 0xc4d, 0x3b, 0xc37, 0xc2c, 0xc3e, 0xc28, 0xc4d, 0x3b, 0xc30, 0xc02, 0xc1c, 0xc3e, 0xc28, 0xc4d, 0x3b, 0xc37, 0xc35, 0xc4d, 0xc35,
+0xc3e, 0xc32, 0xc4d, 0x3b, 0xc27, 0xc41, 0xc32, 0xc4d, 0x2d, 0xc15, 0xc3f, 0x20, 0xc26, 0xc3e, 0xc39, 0xc4d, 0x3b, 0xc27, 0xc41, 0xc32,
+0xc4d, 0x2d, 0xc39, 0xc3f, 0xc1c, 0xc4d, 0xc1c, 0xc3e, 0xc39, 0xc4d, 0x3b, 0xe21, 0xe38, 0xe2e, 0xe31, 0xe23, 0x2e, 0x3b, 0xe40, 0xe28,
+0xe32, 0xe30, 0x2e, 0x3b, 0xe23, 0xe2d, 0xe1a, 0xe35, 0x20, 0x49, 0x3b, 0xe23, 0xe2d, 0xe1a, 0xe35, 0x20, 0x49, 0x49, 0x3b, 0xe08,
+0xe38, 0xe21, 0xe32, 0xe14, 0xe32, 0x20, 0x49, 0x3b, 0xe08, 0xe38, 0xe21, 0xe32, 0xe14, 0xe32, 0x20, 0x49, 0x49, 0x3b, 0xe40, 0xe23,
+0xe32, 0xe30, 0x2e, 0x3b, 0xe0a, 0xe30, 0xe2d, 0xe4c, 0x2e, 0x3b, 0xe40, 0xe23, 0xe32, 0xe30, 0xe21, 0xe30, 0x2e, 0x3b, 0xe40, 0xe0a,
+0xe32, 0xe27, 0x2e, 0x3b, 0xe0b, 0xe38, 0xe25, 0xe01, 0xe34, 0xe2d, 0xe3a, 0x2e, 0x3b, 0xe0b, 0xe38, 0xe25, 0xe2b, 0xe34, 0xe08, 0x2e,
+0x3b, 0xe21, 0xe38, 0xe2e, 0xe30, 0xe23, 0xe4c, 0xe23, 0xe2d, 0xe21, 0x3b, 0xe0b, 0xe2d, 0xe1f, 0xe32, 0xe23, 0xe4c, 0x3b, 0xe23, 0xe2d,
+0xe1a, 0xe35, 0x20, 0x49, 0x3b, 0xe23, 0xe2d, 0xe1a, 0xe35, 0x20, 0x49, 0x49, 0x3b, 0xe08, 0xe38, 0xe21, 0xe32, 0xe14, 0xe32, 0x20,
+0x49, 0x3b, 0xe08, 0xe38, 0xe21, 0xe32, 0xe14, 0xe32, 0x20, 0x49, 0x49, 0x3b, 0xe23, 0xe2d, 0xe08, 0xe31, 0xe1a, 0x3b, 0xe0a, 0xe30,
+0xe2d, 0xe30, 0xe1a, 0xe32, 0xe19, 0x3b, 0xe23, 0xe2d, 0xe21, 0xe30, 0xe14, 0xe2d, 0xe19, 0x3b, 0xe40, 0xe0a, 0xe32, 0xe27, 0xe31, 0xe25,
+0x3b, 0xe0b, 0xe38, 0xe25, 0xe01, 0xe34, 0xe2d, 0xe3a, 0xe14, 0xe30, 0xe2e, 0xe3a, 0x3b, 0xe0b, 0xe38, 0xe25, 0xe2b, 0xe34, 0xe08, 0xe0d,
+0xe30, 0xe2e, 0xe3a, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x66, 0x65, 0x72, 0x3b, 0x52, 0x2e, 0x65,
+0x76, 0x76, 0x65, 0x6c, 0x3b, 0x52, 0x2e, 0x61, 0x68, 0x69, 0x72, 0x3b, 0x43, 0x2e, 0x65, 0x76, 0x76, 0x65, 0x6c, 0x3b,
+0x43, 0x2e, 0x61, 0x68, 0x69, 0x72, 0x3b, 0x52, 0x65, 0x63, 0x65, 0x70, 0x3b, 0x15e, 0x61, 0x62, 0x61, 0x6e, 0x3b, 0x52,
+0x61, 0x6d, 0x2e, 0x3b, 0x15e, 0x65, 0x76, 0x76, 0x61, 0x6c, 0x3b, 0x5a, 0x69, 0x6c, 0x6b, 0x61, 0x64, 0x65, 0x3b, 0x5a,
+0x69, 0x6c, 0x68, 0x69, 0x63, 0x63, 0x65, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x65, 0x6d, 0x3b, 0x53, 0x61, 0x66,
+0x65, 0x72, 0x3b, 0x52, 0x65, 0x62, 0x69, 0xfc, 0x6c, 0x65, 0x76, 0x76, 0x65, 0x6c, 0x3b, 0x52, 0x65, 0x62, 0x69, 0xfc,
+0x6c, 0x61, 0x68, 0x69, 0x72, 0x3b, 0x43, 0x65, 0x6d, 0x61, 0x7a, 0x69, 0x79, 0x65, 0x6c, 0x65, 0x76, 0x76, 0x65, 0x6c,
+0x3b, 0x43, 0x65, 0x6d, 0x61, 0x7a, 0x69, 0x79, 0x65, 0x6c, 0x61, 0x68, 0x69, 0x72, 0x3b, 0x52, 0x65, 0x63, 0x65, 0x70,
+0x3b, 0x15e, 0x61, 0x62, 0x61, 0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x7a, 0x61, 0x6e, 0x3b, 0x15e, 0x65, 0x76, 0x76, 0x61,
+0x6c, 0x3b, 0x5a, 0x69, 0x6c, 0x6b, 0x61, 0x64, 0x65, 0x3b, 0x5a, 0x69, 0x6c, 0x68, 0x69, 0x63, 0x63, 0x65, 0x3b, 0x645,
+0x6c7, 0x6be, 0x6d5, 0x631, 0x631, 0x6d5, 0x645, 0x3b, 0x633, 0x6d5, 0x67e, 0x6d5, 0x631, 0x3b, 0x631, 0x6d5, 0x628, 0x649, 0x626, 0x6c7,
+0x644, 0x626, 0x6d5, 0x6cb, 0x6cb, 0x6d5, 0x644, 0x3b, 0x631, 0x6d5, 0x628, 0x649, 0x626, 0x6c7, 0x644, 0x626, 0x627, 0x62e, 0x649, 0x631,
+0x3b, 0x62c, 0x6d5, 0x645, 0x627, 0x62f, 0x649, 0x64a, 0x6d5, 0x644, 0x626, 0x6d5, 0x6cb, 0x6cb, 0x6d5, 0x644, 0x3b, 0x62c, 0x6d5, 0x645,
+0x627, 0x62f, 0x649, 0x64a, 0x6d5, 0x644, 0x626, 0x627, 0x62e, 0x649, 0x631, 0x3b, 0x631, 0x6d5, 0x62c, 0x6d5, 0x628, 0x3b, 0x634, 0x6d5,
+0x626, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x627, 0x645, 0x649, 0x632, 0x627, 0x646, 0x3b, 0x634, 0x6d5, 0x6cb, 0x6cb, 0x627, 0x644, 0x3b,
+0x632, 0x6c7, 0x644, 0x642, 0x6d5, 0x626, 0x62f, 0x6d5, 0x3b, 0x632, 0x6c7, 0x644, 0x6be, 0x6d5, 0x62c, 0x62c, 0x6d5, 0x3b, 0x43c, 0x443,
+0x445, 0x3b, 0x441, 0x430, 0x444, 0x3b, 0x440, 0x430, 0x431, 0x456, 0x20, 0x49, 0x3b, 0x440, 0x430, 0x431, 0x456, 0x20, 0x49, 0x49,
+0x3b, 0x434, 0x436, 0x443, 0x43c, 0x20, 0x49, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x20, 0x49, 0x49, 0x3b, 0x440, 0x430, 0x434, 0x436,
+0x3b, 0x448, 0x430, 0x430, 0x431, 0x3b, 0x440, 0x430, 0x43c, 0x3b, 0x434, 0x430, 0x432, 0x3b, 0x437, 0x443, 0x2d, 0x43b, 0x44c, 0x2d,
+0x43a, 0x3b, 0x437, 0x443, 0x2d, 0x43b, 0x44c, 0x2d, 0x445, 0x3b, 0x43c, 0x443, 0x445, 0x430, 0x440, 0x440, 0x430, 0x43c, 0x3b, 0x441,
+0x430, 0x444, 0x430, 0x440, 0x3b, 0x440, 0x430, 0x431, 0x456, 0x20, 0x49, 0x3b, 0x440, 0x430, 0x431, 0x456, 0x20, 0x49, 0x49, 0x3b,
+0x434, 0x436, 0x443, 0x43c, 0x430, 0x434, 0x430, 0x20, 0x49, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x430, 0x434, 0x430, 0x20, 0x49, 0x49,
+0x3b, 0x440, 0x430, 0x434, 0x436, 0x430, 0x431, 0x3b, 0x448, 0x430, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x440, 0x430, 0x43c, 0x430, 0x434,
+0x430, 0x43d, 0x3b, 0x434, 0x430, 0x432, 0x432, 0x430, 0x43b, 0x3b, 0x437, 0x443, 0x2d, 0x43b, 0x44c, 0x2d, 0x43a, 0x430, 0x430, 0x434,
+0x430, 0x3b, 0x437, 0x443, 0x2d, 0x43b, 0x44c, 0x2d, 0x445, 0x456, 0x434, 0x436, 0x430, 0x3b, 0x43c, 0x443, 0x445, 0x2e, 0x3b, 0x441,
+0x430, 0x444, 0x2e, 0x3b, 0x440, 0x430, 0x431, 0x456, 0x20, 0x49, 0x3b, 0x440, 0x430, 0x431, 0x456, 0x20, 0x49, 0x49, 0x3b, 0x434,
+0x436, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x3b, 0x434, 0x436, 0x443, 0x43c, 0x2e, 0x20, 0x49, 0x49, 0x3b, 0x440, 0x430, 0x434, 0x436,
+0x2e, 0x3b, 0x448, 0x430, 0x430, 0x431, 0x2e, 0x3b, 0x440, 0x430, 0x43c, 0x2e, 0x3b, 0x434, 0x430, 0x432, 0x2e, 0x3b, 0x437, 0x443,
+0x2d, 0x43b, 0x44c, 0x2d, 0x43a, 0x2e, 0x3b, 0x437, 0x443, 0x2d, 0x43b, 0x44c, 0x2d, 0x445, 0x2e, 0x3b, 0x645, 0x62d, 0x631, 0x645,
+0x3b, 0x635, 0x641, 0x631, 0x3b, 0x631, 0x628, 0x6cc, 0x639, 0x20, 0x627, 0x644, 0x627, 0x648, 0x651, 0x644, 0x3b, 0x631, 0x628, 0x6cc,
+0x639, 0x20, 0x627, 0x644, 0x62b, 0x651, 0x627, 0x646, 0x6cc, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x20, 0x627, 0x644, 0x627, 0x648,
+0x651, 0x644, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x20, 0x627, 0x644, 0x62b, 0x651, 0x627, 0x646, 0x6cc, 0x3b, 0x631, 0x62c, 0x628,
+0x3b, 0x634, 0x639, 0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x630, 0x648,
+0x627, 0x644, 0x642, 0x639, 0x62f, 0x6c3, 0x3b, 0x630, 0x648, 0x627, 0x644, 0x62d, 0x62c, 0x6c3, 0x3b, 0x645, 0x62d, 0x631, 0x645, 0x3b,
+0x635, 0x641, 0x631, 0x3b, 0x631, 0x20, 0x628, 0x6cc, 0x639, 0x20, 0x627, 0x644, 0x627, 0x648, 0x644, 0x3b, 0x631, 0x20, 0x628, 0x6cc,
+0x639, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x6cc, 0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x20, 0x627, 0x644, 0x627, 0x648, 0x644,
+0x3b, 0x62c, 0x645, 0x627, 0x62f, 0x6cc, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x6cc, 0x3b, 0x631, 0x62c, 0x628, 0x3b, 0x634, 0x639,
+0x628, 0x627, 0x646, 0x3b, 0x631, 0x645, 0x636, 0x627, 0x646, 0x3b, 0x634, 0x648, 0x627, 0x644, 0x3b, 0x630, 0x648, 0x627, 0x644, 0x642,
+0x639, 0x62f, 0x6c3, 0x3b, 0x630, 0x648, 0x627, 0x644, 0x62d, 0x62c, 0x6c3, 0x3b, 0x4d, 0x75, 0x68, 0x2e, 0x3b, 0x53, 0x61, 0x66,
+0x2e, 0x3b, 0x52, 0x6f, 0x62, 0x2e, 0x20, 0x61, 0x76, 0x76, 0x2e, 0x3b, 0x52, 0x6f, 0x62, 0x2e, 0x20, 0x6f, 0x78, 0x2e,
+0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x61, 0x76, 0x76, 0x2e, 0x3b, 0x4a, 0x75, 0x6d, 0x2e, 0x20, 0x6f, 0x78, 0x2e, 0x3b,
+0x52, 0x61, 0x6a, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x2e, 0x3b, 0x52, 0x61, 0x6d, 0x2e, 0x3b, 0x53, 0x68, 0x61, 0x76, 0x2e,
+0x3b, 0x5a, 0x75, 0x6c, 0x2d, 0x71, 0x2e, 0x3b, 0x5a, 0x75, 0x6c, 0x2d, 0x68, 0x2e, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x72,
+0x72, 0x61, 0x6d, 0x3b, 0x53, 0x61, 0x66, 0x61, 0x72, 0x3b, 0x52, 0x6f, 0x62, 0x69, 0x2019, 0x20, 0x75, 0x6c, 0x2d, 0x61,
+0x76, 0x76, 0x61, 0x6c, 0x3b, 0x52, 0x6f, 0x62, 0x69, 0x2019, 0x20, 0x75, 0x6c, 0x2d, 0x6f, 0x78, 0x69, 0x72, 0x3b, 0x4a,
+0x75, 0x6d, 0x61, 0x64, 0x20, 0x75, 0x6c, 0x2d, 0x61, 0x76, 0x76, 0x61, 0x6c, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x20,
+0x75, 0x6c, 0x2d, 0x6f, 0x78, 0x69, 0x72, 0x3b, 0x52, 0x61, 0x6a, 0x61, 0x62, 0x3b, 0x53, 0x68, 0x61, 0x2019, 0x62, 0x6f,
+0x6e, 0x3b, 0x52, 0x61, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x3b, 0x53, 0x68, 0x61, 0x76, 0x76, 0x6f, 0x6c, 0x3b, 0x5a, 0x75,
+0x6c, 0x2d, 0x71, 0x61, 0x2019, 0x64, 0x61, 0x3b, 0x5a, 0x75, 0x6c, 0x2d, 0x68, 0x69, 0x6a, 0x6a, 0x61, 0x3b, 0x41c, 0x443,
+0x4b3, 0x430, 0x440, 0x440, 0x430, 0x43c, 0x3b, 0x421, 0x430, 0x444, 0x430, 0x440, 0x3b, 0x420, 0x430, 0x431, 0x438, 0x443, 0x43b, 0x2d,
+0x430, 0x432, 0x432, 0x430, 0x43b, 0x3b, 0x420, 0x430, 0x431, 0x438, 0x443, 0x43b, 0x2d, 0x43e, 0x445, 0x438, 0x440, 0x3b, 0x416, 0x443,
+0x43c, 0x43e, 0x434, 0x438, 0x443, 0x43b, 0x2d, 0x443, 0x43b, 0x43e, 0x3b, 0x416, 0x443, 0x43c, 0x43e, 0x434, 0x438, 0x443, 0x43b, 0x2d,
+0x443, 0x445, 0x440, 0x43e, 0x3b, 0x420, 0x430, 0x436, 0x430, 0x431, 0x3b, 0x428, 0x430, 0x44a, 0x431, 0x43e, 0x43d, 0x3b, 0x420, 0x430,
+0x43c, 0x430, 0x437, 0x43e, 0x43d, 0x3b, 0x428, 0x430, 0x432, 0x432, 0x43e, 0x43b, 0x3b, 0x417, 0x438, 0x43b, 0x2d, 0x49b, 0x430, 0x44a,
+0x434, 0x430, 0x3b, 0x417, 0x438, 0x43b, 0x2d, 0x4b3, 0x438, 0x436, 0x436, 0x430, 0x3b, 0x6d, 0x75, 0x68, 0x2e, 0x3b, 0x73, 0x61,
+0x66, 0x2e, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x69, 0x3b, 0x72, 0x61, 0x62, 0x2e, 0x20, 0x69, 0x69, 0x3b, 0x64, 0x17e,
+0x75, 0x6d, 0x2e, 0x20, 0x69, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0x2e, 0x20, 0x69, 0x69, 0x3b, 0x72, 0x65, 0x64, 0x17e, 0x2e,
+0x3b, 0x161, 0x61, 0x2e, 0x3b, 0x72, 0x61, 0x6d, 0x2e, 0x3b, 0x161, 0x65, 0x2e, 0x3b, 0x7a, 0x75, 0x6c, 0x2d, 0x6b, 0x2e,
+0x3b, 0x7a, 0x75, 0x6c, 0x2d, 0x68, 0x2e, 0x3b, 0x6d, 0x75, 0x68, 0x61, 0x72, 0x65, 0x6d, 0x3b, 0x73, 0x61, 0x66, 0x65,
+0x72, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x69, 0x3b, 0x72, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x69, 0x69, 0x3b, 0x64,
+0x17e, 0x75, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x69, 0x3b, 0x64, 0x17e, 0x75, 0x6d, 0x61, 0x64, 0x65, 0x20, 0x69, 0x69, 0x3b,
+0x72, 0x65, 0x64, 0x17e, 0x65, 0x62, 0x3b, 0x161, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x72, 0x61, 0x6d, 0x61, 0x7a, 0x61,
+0x6e, 0x3b, 0x161, 0x65, 0x76, 0x61, 0x6c, 0x3b, 0x7a, 0x75, 0x6c, 0x2d, 0x6b, 0x61, 0x64, 0x65, 0x3b, 0x7a, 0x75, 0x6c,
+0x2d, 0x68, 0x69, 0x64, 0x17e, 0x65, 0x3b, 0x64, 0x7a, 0x76, 0x3b, 0x64, 0x7a, 0x64, 0x3b, 0x74, 0x65, 0x64, 0x3b, 0x61,
+0x66, 0x254, 0x3b, 0x64, 0x61, 0x6d, 0x3b, 0x6d, 0x61, 0x73, 0x3b, 0x73, 0x69, 0x61, 0x3b, 0x64, 0x65, 0x61, 0x3b, 0x61,
+0x6e, 0x79, 0x3b, 0x6b, 0x65, 0x6c, 0x3b, 0x61, 0x64, 0x65, 0x3b, 0x64, 0x7a, 0x6d, 0x3b, 0x64, 0x7a, 0x6f, 0x76, 0x65,
+0x3b, 0x64, 0x7a, 0x6f, 0x64, 0x7a, 0x65, 0x3b, 0x74, 0x65, 0x64, 0x6f, 0x78, 0x65, 0x3b, 0x61, 0x66, 0x254, 0x66, 0x69,
+0x1ebd, 0x3b, 0x64, 0x61, 0x6d, 0x25b, 0x3b, 0x6d, 0x61, 0x73, 0x61, 0x3b, 0x73, 0x69, 0x61, 0x6d, 0x6c, 0x254, 0x6d, 0x3b,
+0x64, 0x65, 0x61, 0x73, 0x69, 0x61, 0x6d, 0x69, 0x6d, 0x65, 0x3b, 0x61, 0x6e, 0x79, 0x254, 0x6e, 0x79, 0x254, 0x3b, 0x6b,
+0x65, 0x6c, 0x65, 0x3b, 0x61, 0x64, 0x65, 0x25b, 0x6d, 0x65, 0x6b, 0x70, 0x254, 0x78, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x6d,
+0x65, 0x3b, 0x64, 0x65, 0x20, 0x4d, 0x75, 0x68, 0x61, 0x72, 0x72, 0x61, 0x6d, 0x3b, 0x64, 0x65, 0x20, 0x53, 0x61, 0x66,
+0x61, 0x72, 0x3b, 0x64, 0x65, 0x20, 0x52, 0x61, 0x62, 0x69, 0x2bb, 0x20, 0x49, 0x3b, 0x64, 0x65, 0x20, 0x52, 0x61, 0x62,
+0x69, 0x2bb, 0x20, 0x49, 0x49, 0x3b, 0x64, 0x65, 0x20, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x3b, 0x64, 0x65,
+0x20, 0x4a, 0x75, 0x6d, 0x61, 0x64, 0x61, 0x20, 0x49, 0x49, 0x3b, 0x64, 0x65, 0x20, 0x52, 0x61, 0x6a, 0x61, 0x62, 0x3b,
+0x64, 0x65, 0x20, 0x53, 0x68, 0x61, 0x2bb, 0x62, 0x61, 0x6e, 0x3b, 0x64, 0x65, 0x20, 0x52, 0x61, 0x6d, 0x61, 0x64, 0x61,
+0x6e, 0x3b, 0x64, 0x65, 0x20, 0x53, 0x68, 0x61, 0x77, 0x77, 0x61, 0x6c, 0x3b, 0x64, 0x65, 0x20, 0x44, 0x68, 0x75, 0x2bb,
+0x6c, 0x2d, 0x51, 0x69, 0x2bb, 0x64, 0x61, 0x68, 0x3b, 0x64, 0x65, 0x20, 0x44, 0x68, 0x75, 0x2bb, 0x6c, 0x2d, 0x48, 0x69,
+0x6a, 0x6a, 0x61, 0x68, 0x3b, 0x7a46, 0x54c8, 0x5170, 0x59c6, 0x6708, 0x3b, 0x8272, 0x6cd5, 0x5c14, 0x6708, 0x3b, 0x8d56, 0x6bd4, 0x6708, 0x20,
+0x49, 0x3b, 0x8d56, 0x6bd4, 0x6708, 0x20, 0x49, 0x49, 0x3b, 0x4e3b, 0x9a6c, 0x8fbe, 0x6708, 0x20, 0x49, 0x3b, 0x4e3b, 0x9a6c, 0x8fbe, 0x6708,
+0x20, 0x49, 0x49, 0x3b, 0x8d56, 0x54f2, 0x535c, 0x6708, 0x3b, 0x820d, 0x5c14, 0x90a6, 0x6708, 0x3b, 0x8d56, 0x4e70, 0x4e39, 0x6708, 0x3b, 0x95ea,
+0x74e6, 0x9c81, 0x6708, 0x3b, 0x90fd, 0x5c14, 0x5580, 0x5c14, 0x5fb7, 0x6708, 0x3b, 0x90fd, 0x5c14, 0x9ed1, 0x54f2, 0x6708, 0x3b
+};
+// GENERATED PART ENDS HERE
+
+QT_END_NAMESPACE
+
+#endif // QHIJRI_CALENDAR_DATA_P_H
diff --git a/src/corelib/time/qhijricalendar_p.h b/src/corelib/time/qhijricalendar_p.h
new file mode 100644
index 0000000000..60820488b4
--- /dev/null
+++ b/src/corelib/time/qhijricalendar_p.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QHIJRI_CALENDAR_P_H
+#define QHIJRI_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+#include "qcalendarbackend_p.h"
+
+QT_REQUIRE_CONFIG(hijricalendar);
+
+QT_BEGIN_NAMESPACE
+
+// Base for sharing with other variants on the Islamic calendar, as needed:
+class Q_CORE_EXPORT QHijriCalendar : public QCalendarBackend
+{
+public:
+ int daysInMonth(int month, int year = QCalendar::Unspecified) const override;
+ int maximumDaysInMonth() const override;
+ int daysInYear(int year) const override;
+
+ bool isLunar() const override;
+ bool isLuniSolar() const override;
+ bool isSolar() const override;
+
+protected:
+ const QCalendarLocale *localeMonthIndexData() const override;
+ const ushort *localeMonthData() const override;
+ // (The INTEGRITY compiler got upset at: using QCalendarBackend:QCalendarBackend;)
+ QHijriCalendar(const QString &name, QCalendar::System id = QCalendar::System::User)
+ : QCalendarBackend(name, id) {}
+};
+
+QT_END_NAMESPACE
+
+#endif // QHIJRI_CALENDAR_P_H
diff --git a/src/corelib/time/qislamiccivilcalendar.cpp b/src/corelib/time/qislamiccivilcalendar.cpp
new file mode 100644
index 0000000000..a6a2afd207
--- /dev/null
+++ b/src/corelib/time/qislamiccivilcalendar.cpp
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+#include "qislamiccivilcalendar_p.h"
+#include "qcalendarmath_p.h"
+#include <QtCore/qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QRoundingDown;
+
+/*!
+ \since 5.14
+ \internal
+
+ \class QIslamicCivilCalendar
+ \inmodule QtCore
+ \brief Implements a commonly-used computed version of the Islamic calendar.
+
+ \section1 Civil Islamic Calendar
+
+ QIslamicCivilCalendar implements a tabular version of the Hijri calendar
+ which is known as the Islamic Civil Calendar. It has the same numbering of
+ years and months, but the months are determined by arithmetical rules rather
+ than by observation or astronomical calculations.
+
+ \section2 Calendar Organization
+
+ The civil calendar follows the usual tabular scheme of odd-numbered months
+ and the last month of each leap year being 30 days long, the rest being 29
+ days long. Its determination of leap years follows a 30-year cycle, in each
+ of which the years 2, 5, 7, 10, 13, 16, 18, 21, 24, 26 and 29 are leap
+ years.
+
+ \sa QHijriCalendar, QCalendar
+*/
+
+QIslamicCivilCalendar::QIslamicCivilCalendar()
+ : QHijriCalendar(QStringLiteral("Islamic Civil"), QCalendar::System::IslamicCivil)
+{
+ registerAlias(QStringLiteral("islamic-civil")); // CLDR name
+ registerAlias(QStringLiteral("islamicc")); // old CLDR name, still (2018) used by Mozilla
+ // Until we have a oncrete implementation that knows all the needed ephemerides:
+ registerAlias(QStringLiteral("Islamic"));
+}
+
+QString QIslamicCivilCalendar::name() const
+{
+ return QStringLiteral("Islamic Civil");
+}
+
+QCalendar::System QIslamicCivilCalendar::calendarSystem() const
+{
+ return QCalendar::System::IslamicCivil;
+}
+
+bool QIslamicCivilCalendar::isLeapYear(int year) const
+{
+ if (year == QCalendar::Unspecified)
+ return false;
+ if (year < 0)
+ ++year;
+ return qMod(year * 11 + 14, 30) < 11;
+}
+
+bool QIslamicCivilCalendar::dateToJulianDay(int year, int month, int day, qint64 *jd) const
+{
+ Q_ASSERT(jd);
+ if (!isDateValid(year, month, day))
+ return false;
+ if (year <= 0)
+ ++year;
+ *jd = qDiv(10631 * year - 10617, 30)
+ + qDiv(325 * month - 320, 11)
+ + day + 1948439;
+ return true;
+}
+
+QCalendar::YearMonthDay QIslamicCivilCalendar::julianDayToDate(qint64 jd) const
+{
+ const qint64 epoch = 1948440;
+ const int32_t k2 = 30 * (jd - epoch) + 15;
+ const int32_t k1 = 11 * qDiv(qMod(k2, 10631), 30) + 5;
+ int y = qDiv(k2, 10631) + 1;
+ const int month = qDiv(k1, 325) + 1;
+ const int day = qDiv(qMod(k1, 325), 11) + 1;
+ return QCalendar::YearMonthDay(y > 0 ? y : y - 1, month, day);
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qislamiccivilcalendar_p.h b/src/corelib/time/qislamiccivilcalendar_p.h
new file mode 100644
index 0000000000..01d0525f62
--- /dev/null
+++ b/src/corelib/time/qislamiccivilcalendar_p.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QISLAMIC_CIVIL_CALENDAR_P_H
+#define QISLAMIC_CIVIL_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qhijricalendar_p.h"
+
+QT_REQUIRE_CONFIG(islamiccivilcalendar);
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QIslamicCivilCalendar : public QHijriCalendar
+{
+public:
+ QIslamicCivilCalendar();
+ // Calendar properties:
+ QString name() const override;
+ QCalendar::System calendarSystem() const override;
+ // Date queries:
+ bool isLeapYear(int year) const override;
+ // Julian Day conversions:
+ bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
+ QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QISLAMIC_CIVIL_CALENDAR_P_H
diff --git a/src/corelib/time/qjalalicalendar.cpp b/src/corelib/time/qjalalicalendar.cpp
new file mode 100644
index 0000000000..be9246d7db
--- /dev/null
+++ b/src/corelib/time/qjalalicalendar.cpp
@@ -0,0 +1,212 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+#include "qjalalicalendar_p.h"
+#include "qjalalicalendar_data_p.h"
+#include "qcalendarmath_p.h"
+#include <QtCore/qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QRoundingDown;
+
+// Constants
+
+static const qint64 cycleDays = 1029983;
+static const int cycleYears = 2820;
+static const double yearLength = 365.24219858156028368; // 365 + leapRatio;
+static const qint64 jalaliEpoch = 2121446; // 475/01/01 AP, start of 2820 cycle
+
+// Calendar implementation
+
+static inline int cycle(qint64 jdn)
+{
+ return qDiv(jdn - jalaliEpoch, cycleDays);
+}
+
+qint64 cycleStart(int cycleNo)
+{
+ return jalaliEpoch + cycleNo * cycleDays;
+}
+
+qint64 firstDayOfYear(int year, int cycleNo)
+{
+ qint64 firstDOYinEra = static_cast<qint64>(qFloor(year * yearLength));
+ return jalaliEpoch + cycleNo * cycleDays + firstDOYinEra;
+}
+
+/*!
+ \since 5.14
+
+ \class QJalaliCalendar
+ \inmodule QtCore
+ \brief The QJalaliCalendar class provides Jalali (Hijri Shamsi) calendar
+ system implementation.
+
+ \section1 Solar Hijri Calendar System
+
+ The Solar Hijri calendar, also called the Solar Hejri calendar, Shamsi
+ Hijri calendar or Jalali calendar, is the official calendar of Iran and
+ Afghanistan. It begins on the vernal equinox (Nowruz) as determined by
+ astronomical calculation for the Iran Standard Time meridian
+ (52.5°E or GMT+3.5h). This determination of starting moment is more accurate
+ than the Gregorian calendar for predicting the date of the vernal equinox,
+ because it uses astronomical observations rather than mathematical rules.
+
+ \section2 Calendar Organization
+
+ Each of the twelve months corresponds with a zodiac sign. The first six
+ months have 31 days, the next five have 30 days, and the last month has 29
+ days in usual years but 30 days in leap years. The New Year's Day always
+ falls on the March equinox.
+
+ \section2 Leap Year Rules
+
+ The Solar Hijri calendar produces a five-year leap year interval after about
+ every seven four-year leap year intervals. It usually follows a 33-year
+ cycle with occasional interruptions by single 29-year or 37-year subcycles.
+ The reason for this behavior is that it tracks the observed vernal equinox.
+ By contrast, some less accurate predictive algorithms are in use based
+ on confusion between the average tropical year (365.2422 days, approximated
+ with near 128-year cycles or 2820-year great cycles) and the mean interval
+ between spring equinoxes (365.2424 days, approximated with a near 33-year
+ cycle).
+
+ Source: \l {https://en.wikipedia.org/wiki/Solar_Hijri_calendar}{Wikipedia
+ page on Solar Hijri Calendar}
+ */
+
+QJalaliCalendar::QJalaliCalendar()
+ : QCalendarBackend(QStringLiteral("Jalali"), QCalendar::System::Jalali)
+{
+ registerAlias(QStringLiteral("Persian"));
+}
+
+QString QJalaliCalendar::name() const
+{
+ return QStringLiteral("Jalali");
+}
+
+QCalendar::System QJalaliCalendar::calendarSystem() const
+{
+ return QCalendar::System::Jalali;
+}
+
+bool QJalaliCalendar::isLeapYear(int year) const
+{
+ if (year == QCalendar::Unspecified)
+ return false;
+ if (year < 0)
+ year++;
+ return qMod((year + 2346) * 683, 2820) < 683;
+}
+
+bool QJalaliCalendar::isLunar() const
+{
+ return false;
+}
+
+bool QJalaliCalendar::isLuniSolar() const
+{
+ return false;
+}
+
+bool QJalaliCalendar::isSolar() const
+{
+ return true;
+}
+
+bool QJalaliCalendar::dateToJulianDay(int year, int month, int day, qint64 *jd) const
+{
+ Q_ASSERT(jd);
+ if (!isDateValid(year, month, day))
+ return false;
+
+ const int y = year - (year < 0 ? 474 : 475);
+ const int c = qDiv(y, cycleYears);
+ const int yearInCycle = y - c * cycleYears;
+ int dayInYear = day;
+ for (int i = 1; i < month; ++i)
+ dayInYear += daysInMonth(i, year);
+ *jd = firstDayOfYear(yearInCycle, c) + dayInYear - 1;
+ return true;
+}
+
+QCalendar::YearMonthDay QJalaliCalendar::julianDayToDate(qint64 jd) const
+{
+ const int c = cycle(jd);
+ int yearInCycle = qFloor((jd - cycleStart(c)) / yearLength);
+ int year = yearInCycle + 475 + c * cycleYears;
+ int day = jd - firstDayOfYear(yearInCycle, c) + 1;
+ if (day > daysInYear(year <= 0 ? year - 1 : year)) {
+ year++;
+ day = 1;
+ }
+ if (year <= 0)
+ year--;
+ int month;
+ for (month = 1; month < 12; ++month) {
+ const int last = daysInMonth(month, year);
+ if (day <= last)
+ break;
+ day -= last;
+ }
+ return QCalendar::YearMonthDay(year, month, day);
+}
+
+int QJalaliCalendar::daysInMonth(int month, int year) const
+{
+ if (year && month > 0 && month <= 12)
+ return month < 7 ? 31 : month < 12 || isLeapYear(year) ? 30 : 29;
+
+ return 0;
+}
+
+const QCalendarLocale *QJalaliCalendar::localeMonthIndexData() const
+{
+ return locale_data;
+}
+
+const ushort *QJalaliCalendar::localeMonthData() const
+{
+ return months_data;
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qjalalicalendar_data_p.h b/src/corelib/time/qjalalicalendar_data_p.h
new file mode 100644
index 0000000000..5bc44c83a0
--- /dev/null
+++ b/src/corelib/time/qjalalicalendar_data_p.h
@@ -0,0 +1,906 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPERSIANCALENDAR_DATA_P_H
+#define QPERSIANCALENDAR_DATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+#include <QtCore/private/qcalendarbackend_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// GENERATED PART STARTS HERE
+
+/*
+ This part of the file was generated on 2019-10-24 from the
+ Common Locale Data Repository v36
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this section: instead regenerate it using
+ cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+static const QCalendarLocale locale_data[] = {
+ // lang script terr sShort sLong sNarrow short long narrow
+ { 1, 0, 0,{ 0,48 },{ 48,84 },{ 132,24 },{ 0,48 },{ 48,84 },{ 156,29 }}, // C/AnyScript/AnyCountry
+ { 3, 7, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Oromo/Latin/Ethiopia
+ { 3, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Oromo/Latin/Kenya
+ { 4, 7, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Afar/Latin/Ethiopia
+ { 5, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Afrikaans/Latin/South Africa
+ { 5, 7, 148,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Afrikaans/Latin/Namibia
+ { 6, 7, 2,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Albanian/Latin/Albania
+ { 6, 7, 127,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Albanian/Latin/Macedonia
+ { 6, 7, 257,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Albanian/Latin/Kosovo
+ { 7, 14, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Amharic/Ethiopic/Ethiopia
+ { 8, 1, 64,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Egypt
+ { 8, 1, 3,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Algeria
+ { 8, 1, 17,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Bahrain
+ { 8, 1, 42,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Chad
+ { 8, 1, 48,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Comoros
+ { 8, 1, 59,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Djibouti
+ { 8, 1, 67,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Eritrea
+ { 8, 1, 103,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Iraq
+ { 8, 1, 105,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Israel
+ { 8, 1, 109,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Jordan
+ { 8, 1, 115,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Kuwait
+ { 8, 1, 119,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Lebanon
+ { 8, 1, 122,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Libya
+ { 8, 1, 136,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Mauritania
+ { 8, 1, 145,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Morocco
+ { 8, 1, 162,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Oman
+ { 8, 1, 165,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Palestinian Territories
+ { 8, 1, 175,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Qatar
+ { 8, 1, 186,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Saudi Arabia
+ { 8, 1, 194,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Somalia
+ { 8, 1, 201,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Sudan
+ { 8, 1, 207,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Syria
+ { 8, 1, 216,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Tunisia
+ { 8, 1, 223,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/United Arab Emirates
+ { 8, 1, 236,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Western Sahara
+ { 8, 1, 237,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/Yemen
+ { 8, 1, 254,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/South Sudan
+ { 8, 1, 260,{ 212,68 },{ 212,68 },{ 185,27 },{ 212,68 },{ 212,68 },{ 185,27 }}, // Arabic/Arabic/World
+ { 9, 10, 11,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Armenian/Armenian/Armenia
+ { 10, 11, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Assamese/Bengali/India
+ { 12, 7, 15,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Azerbaijani/Latin/Azerbaijan
+ { 12, 1, 102,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Azerbaijani/Arabic/Iran
+ { 12, 2, 15,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Azerbaijani/Cyrillic/Azerbaijan
+ { 13, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bashkir/Cyrillic/Russia
+ { 14, 7, 197,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Basque/Latin/Spain
+ { 15, 11, 18,{ 280,88 },{ 368,89 },{ 457,27 },{ 280,88 },{ 368,89 },{ 457,27 }}, // Bengali/Bengali/Bangladesh
+ { 15, 11, 100,{ 280,88 },{ 368,89 },{ 457,27 },{ 280,88 },{ 368,89 },{ 457,27 }}, // Bengali/Bengali/India
+ { 16, 31, 25,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dzongkha/Tibetan/Bhutan
+ { 19, 7, 74,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Breton/Latin/France
+ { 20, 2, 33,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bulgarian/Cyrillic/Bulgaria
+ { 21, 25, 147,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Burmese/Myanmar/Myanmar
+ { 22, 2, 20,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Belarusian/Cyrillic/Belarus
+ { 23, 20, 36,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Khmer/Khmer/Cambodia
+ { 24, 7, 197,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Catalan/Latin/Spain
+ { 24, 7, 5,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Catalan/Latin/Andorra
+ { 24, 7, 74,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Catalan/Latin/France
+ { 24, 7, 106,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Catalan/Latin/Italy
+ { 25, 5, 44,{ 484,39 },{ 523,38 },{ 185,27 },{ 484,39 },{ 523,38 },{ 185,27 }}, // Chinese/Simplified Han/China
+ { 25, 5, 97,{ 484,39 },{ 523,38 },{ 185,27 },{ 484,39 },{ 523,38 },{ 185,27 }}, // Chinese/Simplified Han/Hong Kong
+ { 25, 5, 126,{ 484,39 },{ 523,38 },{ 185,27 },{ 484,39 },{ 523,38 },{ 185,27 }}, // Chinese/Simplified Han/Macau
+ { 25, 5, 190,{ 484,39 },{ 523,38 },{ 185,27 },{ 484,39 },{ 523,38 },{ 185,27 }}, // Chinese/Simplified Han/Singapore
+ { 25, 6, 97,{ 484,39 },{ 484,39 },{ 185,27 },{ 484,39 },{ 484,39 },{ 185,27 }}, // Chinese/Traditional Han/Hong Kong
+ { 25, 6, 126,{ 484,39 },{ 484,39 },{ 185,27 },{ 484,39 },{ 484,39 },{ 185,27 }}, // Chinese/Traditional Han/Macau
+ { 25, 6, 208,{ 484,39 },{ 484,39 },{ 185,27 },{ 484,39 },{ 484,39 },{ 185,27 }}, // Chinese/Traditional Han/Taiwan
+ { 26, 7, 74,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Corsican/Latin/France
+ { 27, 7, 54,{ 48,84 },{ 48,84 },{ 561,39 },{ 48,84 },{ 48,84 },{ 561,39 }}, // Croatian/Latin/Croatia
+ { 27, 7, 27,{ 48,84 },{ 48,84 },{ 561,39 },{ 48,84 },{ 48,84 },{ 561,39 }}, // Croatian/Latin/Bosnia And Herzegowina
+ { 28, 7, 57,{ 600,82 },{ 600,82 },{ 185,27 },{ 600,82 },{ 600,82 },{ 185,27 }}, // Czech/Latin/Czech Republic
+ { 29, 7, 58,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Danish/Latin/Denmark
+ { 29, 7, 86,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Danish/Latin/Greenland
+ { 30, 7, 151,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Netherlands
+ { 30, 7, 12,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Aruba
+ { 30, 7, 21,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Belgium
+ { 30, 7, 152,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Cura Sao
+ { 30, 7, 202,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Suriname
+ { 30, 7, 255,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Bonaire
+ { 30, 7, 256,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Dutch/Latin/Sint Maarten
+ { 31, 7, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/United States
+ { 31, 3, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Deseret/United States
+ { 31, 7, 4,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/American Samoa
+ { 31, 7, 7,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Anguilla
+ { 31, 7, 9,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Antigua And Barbuda
+ { 31, 7, 13,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Australia
+ { 31, 7, 14,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Austria
+ { 31, 7, 16,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Bahamas
+ { 31, 7, 19,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Barbados
+ { 31, 7, 21,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Belgium
+ { 31, 7, 22,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Belize
+ { 31, 7, 24,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Bermuda
+ { 31, 7, 28,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Botswana
+ { 31, 7, 31,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/British Indian Ocean Territory
+ { 31, 7, 35,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Burundi
+ { 31, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Cameroon
+ { 31, 7, 38,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Canada
+ { 31, 7, 40,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Cayman Islands
+ { 31, 7, 45,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Christmas Island
+ { 31, 7, 46,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Cocos Islands
+ { 31, 7, 51,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Cook Islands
+ { 31, 7, 56,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Cyprus
+ { 31, 7, 58,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Denmark
+ { 31, 7, 60,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Dominica
+ { 31, 7, 67,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Eritrea
+ { 31, 7, 70,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Falkland Islands
+ { 31, 7, 72,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Fiji
+ { 31, 7, 73,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Finland
+ { 31, 7, 75,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Guernsey
+ { 31, 7, 80,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Gambia
+ { 31, 7, 82,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Germany
+ { 31, 7, 83,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Ghana
+ { 31, 7, 84,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Gibraltar
+ { 31, 7, 87,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Grenada
+ { 31, 7, 89,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Guam
+ { 31, 7, 93,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Guyana
+ { 31, 7, 97,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Hong Kong
+ { 31, 7, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/India
+ { 31, 7, 104,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Ireland
+ { 31, 7, 105,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Israel
+ { 31, 7, 107,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Jamaica
+ { 31, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Kenya
+ { 31, 7, 112,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Kiribati
+ { 31, 7, 120,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Lesotho
+ { 31, 7, 121,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Liberia
+ { 31, 7, 126,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Macau
+ { 31, 7, 128,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Madagascar
+ { 31, 7, 129,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Malawi
+ { 31, 7, 130,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Malaysia
+ { 31, 7, 133,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Malta
+ { 31, 7, 134,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Marshall Islands
+ { 31, 7, 137,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Mauritius
+ { 31, 7, 140,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Micronesia
+ { 31, 7, 144,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Montserrat
+ { 31, 7, 148,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Namibia
+ { 31, 7, 149,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Nauru
+ { 31, 7, 151,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Netherlands
+ { 31, 7, 154,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/New Zealand
+ { 31, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Nigeria
+ { 31, 7, 158,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Niue
+ { 31, 7, 159,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Norfolk Island
+ { 31, 7, 160,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Northern Mariana Islands
+ { 31, 7, 163,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Pakistan
+ { 31, 7, 164,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Palau
+ { 31, 7, 167,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Papua New Guinea
+ { 31, 7, 170,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Philippines
+ { 31, 7, 171,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Pitcairn
+ { 31, 7, 174,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Puerto Rico
+ { 31, 7, 179,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Rwanda
+ { 31, 7, 180,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Saint Kitts And Nevis
+ { 31, 7, 181,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Saint Lucia
+ { 31, 7, 182,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Saint Vincent And The Grenadines
+ { 31, 7, 183,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Samoa
+ { 31, 7, 188,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Seychelles
+ { 31, 7, 189,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Sierra Leone
+ { 31, 7, 190,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Singapore
+ { 31, 7, 192,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Slovenia
+ { 31, 7, 193,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Solomon Islands
+ { 31, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/South Africa
+ { 31, 7, 199,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Saint Helena
+ { 31, 7, 201,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Sudan
+ { 31, 7, 204,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Swaziland
+ { 31, 7, 205,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Sweden
+ { 31, 7, 206,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Switzerland
+ { 31, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Tanzania
+ { 31, 7, 213,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Tokelau
+ { 31, 7, 214,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Tonga
+ { 31, 7, 215,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Trinidad And Tobago
+ { 31, 7, 219,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Turks And Caicos Islands
+ { 31, 7, 220,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Tuvalu
+ { 31, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Uganda
+ { 31, 7, 223,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/United Arab Emirates
+ { 31, 7, 224,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/United Kingdom
+ { 31, 7, 226,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/United States Minor Outlying Islands
+ { 31, 7, 229,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Vanuatu
+ { 31, 7, 233,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/British Virgin Islands
+ { 31, 7, 234,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/United States Virgin Islands
+ { 31, 7, 239,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Zambia
+ { 31, 7, 240,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Zimbabwe
+ { 31, 7, 249,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Diego Garcia
+ { 31, 7, 251,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Isle Of Man
+ { 31, 7, 252,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Jersey
+ { 31, 7, 254,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/South Sudan
+ { 31, 7, 256,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Sint Maarten
+ { 31, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/World
+ { 31, 7, 261,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // English/Latin/Europe
+ { 32, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Esperanto/Latin/World
+ { 33, 7, 68,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Estonian/Latin/Estonia
+ { 34, 7, 71,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Faroese/Latin/Faroe Islands
+ { 34, 7, 58,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Faroese/Latin/Denmark
+ { 36, 7, 73,{ 766,82 },{ 848,118 },{ 185,27 },{ 966,142 },{ 966,142 },{ 185,27 }}, // Finnish/Latin/Finland
+ { 37, 7, 74,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/France
+ { 37, 7, 3,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Algeria
+ { 37, 7, 21,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Belgium
+ { 37, 7, 23,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Benin
+ { 37, 7, 34,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Burkina Faso
+ { 37, 7, 35,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Burundi
+ { 37, 7, 37,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Cameroon
+ { 37, 7, 38,{ 1248,58 },{ 1306,82 },{ 185,27 },{ 1248,58 },{ 1306,82 },{ 185,27 }}, // French/Latin/Canada
+ { 37, 7, 41,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Central African Republic
+ { 37, 7, 42,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Chad
+ { 37, 7, 48,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Comoros
+ { 37, 7, 49,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Congo Kinshasa
+ { 37, 7, 50,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Congo Brazzaville
+ { 37, 7, 53,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Ivory Coast
+ { 37, 7, 59,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Djibouti
+ { 37, 7, 66,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Equatorial Guinea
+ { 37, 7, 76,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/French Guiana
+ { 37, 7, 77,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/French Polynesia
+ { 37, 7, 79,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Gabon
+ { 37, 7, 88,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Guadeloupe
+ { 37, 7, 91,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Guinea
+ { 37, 7, 94,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Haiti
+ { 37, 7, 125,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Luxembourg
+ { 37, 7, 128,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Madagascar
+ { 37, 7, 132,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Mali
+ { 37, 7, 135,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Martinique
+ { 37, 7, 136,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Mauritania
+ { 37, 7, 137,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Mauritius
+ { 37, 7, 138,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Mayotte
+ { 37, 7, 142,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Monaco
+ { 37, 7, 145,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Morocco
+ { 37, 7, 153,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/New Caledonia
+ { 37, 7, 156,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Niger
+ { 37, 7, 176,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Reunion
+ { 37, 7, 179,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Rwanda
+ { 37, 7, 187,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Senegal
+ { 37, 7, 188,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Seychelles
+ { 37, 7, 200,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Saint Pierre And Miquelon
+ { 37, 7, 206,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Switzerland
+ { 37, 7, 207,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Syria
+ { 37, 7, 212,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Togo
+ { 37, 7, 216,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Tunisia
+ { 37, 7, 229,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Vanuatu
+ { 37, 7, 235,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Wallis And Futuna Islands
+ { 37, 7, 244,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Saint Barthelemy
+ { 37, 7, 245,{ 1108,58 },{ 1166,82 },{ 185,27 },{ 1108,58 },{ 1166,82 },{ 185,27 }}, // French/Latin/Saint Martin
+ { 38, 7, 151,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Western Frisian/Latin/Netherlands
+ { 39, 7, 224,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Gaelic/Latin/United Kingdom
+ { 40, 7, 197,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Galician/Latin/Spain
+ { 41, 15, 81,{ 1388,92 },{ 1388,92 },{ 185,27 },{ 1388,92 },{ 1388,92 },{ 185,27 }}, // Georgian/Georgian/Georgia
+ { 42, 7, 82,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Germany
+ { 42, 7, 14,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Austria
+ { 42, 7, 21,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Belgium
+ { 42, 7, 106,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Italy
+ { 42, 7, 123,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Liechtenstein
+ { 42, 7, 125,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Luxembourg
+ { 42, 7, 206,{ 1480,87 },{ 1480,87 },{ 185,27 },{ 1480,87 },{ 1480,87 },{ 185,27 }}, // German/Latin/Switzerland
+ { 43, 16, 85,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Greek/Greek/Greece
+ { 43, 16, 56,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Greek/Greek/Cyprus
+ { 44, 7, 86,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Greenlandic/Latin/Greenland
+ { 45, 7, 168,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Guarani/Latin/Paraguay
+ { 46, 17, 100,{ 1567,86 },{ 1567,86 },{ 185,27 },{ 1567,86 },{ 1567,86 },{ 185,27 }}, // Gujarati/Gujarati/India
+ { 47, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Hausa/Latin/Nigeria
+ { 47, 1, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Hausa/Arabic/Nigeria
+ { 47, 7, 83,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Hausa/Latin/Ghana
+ { 47, 7, 156,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Hausa/Latin/Niger
+ { 48, 18, 105,{ 1653,69 },{ 1653,69 },{ 185,27 },{ 1653,69 },{ 1653,69 },{ 185,27 }}, // Hebrew/Hebrew/Israel
+ { 49, 13, 100,{ 1722,82 },{ 1722,82 },{ 185,27 },{ 1722,82 },{ 1722,82 },{ 185,27 }}, // Hindi/Devanagari/India
+ { 50, 7, 98,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Hungarian/Latin/Hungary
+ { 51, 7, 99,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Icelandic/Latin/Iceland
+ { 52, 7, 101,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Indonesian/Latin/Indonesia
+ { 53, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Interlingua/Latin/World
+ { 55, 44, 38,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Inuktitut/Canadian Aboriginal/Canada
+ { 55, 7, 38,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Inuktitut/Latin/Canada
+ { 57, 7, 104,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Irish/Latin/Ireland
+ { 57, 7, 224,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Irish/Latin/United Kingdom
+ { 58, 7, 106,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Italian/Latin/Italy
+ { 58, 7, 184,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Italian/Latin/San Marino
+ { 58, 7, 206,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Italian/Latin/Switzerland
+ { 58, 7, 230,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Italian/Latin/Vatican City State
+ { 59, 19, 108,{ 1804,78 },{ 1804,78 },{ 185,27 },{ 1804,78 },{ 1804,78 },{ 185,27 }}, // Japanese/Japanese/Japan
+ { 60, 7, 101,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Javanese/Latin/Indonesia
+ { 61, 21, 100,{ 1882,93 },{ 1882,93 },{ 185,27 },{ 1882,93 },{ 1882,93 },{ 185,27 }}, // Kannada/Kannada/India
+ { 62, 1, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kashmiri/Arabic/India
+ { 63, 2, 110,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kazakh/Cyrillic/Kazakhstan
+ { 64, 7, 179,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kinyarwanda/Latin/Rwanda
+ { 65, 2, 116,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kirghiz/Cyrillic/Kyrgyzstan
+ { 66, 22, 114,{ 1975,55 },{ 1975,55 },{ 185,27 },{ 1975,55 },{ 1975,55 },{ 185,27 }}, // Korean/Korean/South Korea
+ { 66, 22, 113,{ 1975,55 },{ 1975,55 },{ 185,27 },{ 1975,55 },{ 1975,55 },{ 185,27 }}, // Korean/Korean/North Korea
+ { 67, 7, 217,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kurdish/Latin/Turkey
+ { 68, 7, 35,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Rundi/Latin/Burundi
+ { 69, 23, 117,{ 2030,80 },{ 2110,81 },{ 185,27 },{ 2191,80 },{ 2110,81 },{ 185,27 }}, // Lao/Lao/Laos
+ { 71, 7, 118,{ 2271,93 },{ 2271,93 },{ 185,27 },{ 2271,93 },{ 2271,93 },{ 185,27 }}, // Latvian/Latin/Latvia
+ { 72, 7, 49,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lingala/Latin/Congo Kinshasa
+ { 72, 7, 6,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lingala/Latin/Angola
+ { 72, 7, 41,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lingala/Latin/Central African Republic
+ { 72, 7, 50,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lingala/Latin/Congo Brazzaville
+ { 73, 7, 124,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lithuanian/Latin/Lithuania
+ { 74, 2, 127,{ 2364,80 },{ 2364,80 },{ 185,27 },{ 2364,80 },{ 2364,80 },{ 185,27 }}, // Macedonian/Cyrillic/Macedonia
+ { 75, 7, 128,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Malagasy/Latin/Madagascar
+ { 76, 7, 130,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Malay/Latin/Malaysia
+ { 76, 1, 130,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Malay/Arabic/Malaysia
+ { 76, 7, 32,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Malay/Latin/Brunei
+ { 76, 7, 190,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Malay/Latin/Singapore
+ { 77, 24, 100,{ 2444,92 },{ 2444,92 },{ 2536,40 },{ 2444,92 },{ 2444,92 },{ 2536,40 }}, // Malayalam/Malayalam/India
+ { 78, 7, 133,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Maltese/Latin/Malta
+ { 79, 7, 154,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Maori/Latin/New Zealand
+ { 80, 13, 100,{ 2576,81 },{ 2576,81 },{ 2657,27 },{ 2576,81 },{ 2576,81 },{ 2657,27 }}, // Marathi/Devanagari/India
+ { 82, 2, 143,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Mongolian/Cyrillic/Mongolia
+ { 82, 8, 44,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Mongolian/Mongolian/China
+ { 84, 13, 150,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nepali/Devanagari/Nepal
+ { 84, 13, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nepali/Devanagari/India
+ { 85, 7, 161,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Norwegian Bokmal/Latin/Norway
+ { 85, 7, 203,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Norwegian Bokmal/Latin/Svalbard And Jan Mayen Islands
+ { 86, 7, 74,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Occitan/Latin/France
+ { 87, 26, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Oriya/Oriya/India
+ { 88, 1, 1,{ 2684,63 },{ 2684,63 },{ 2747,27 },{ 2684,63 },{ 2684,63 },{ 2747,27 }}, // Pashto/Arabic/Afghanistan
+ { 88, 1, 163,{ 2684,63 },{ 2684,63 },{ 2747,27 },{ 2684,63 },{ 2684,63 },{ 2747,27 }}, // Pashto/Arabic/Pakistan
+ { 89, 1, 102,{ 2774,67 },{ 2774,67 },{ 2841,24 },{ 2774,67 },{ 2774,67 },{ 2841,24 }}, // Persian/Arabic/Iran
+ { 89, 1, 1,{ 2774,67 },{ 2774,67 },{ 2865,24 },{ 2774,67 },{ 2889,57 },{ 2841,24 }}, // Persian/Arabic/Afghanistan
+ { 90, 7, 172,{ 2946,84 },{ 2946,84 },{ 185,27 },{ 2946,84 },{ 2946,84 },{ 185,27 }}, // Polish/Latin/Poland
+ { 91, 7, 30,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Brazil
+ { 91, 7, 6,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Angola
+ { 91, 7, 39,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Cape Verde
+ { 91, 7, 62,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/East Timor
+ { 91, 7, 66,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Equatorial Guinea
+ { 91, 7, 92,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Guinea Bissau
+ { 91, 7, 125,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Luxembourg
+ { 91, 7, 126,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Macau
+ { 91, 7, 146,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Mozambique
+ { 91, 7, 173,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Portugal
+ { 91, 7, 185,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Sao Tome And Principe
+ { 91, 7, 206,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Portuguese/Latin/Switzerland
+ { 92, 4, 100,{ 3030,78 },{ 3030,78 },{ 185,27 },{ 3030,78 },{ 3030,78 },{ 185,27 }}, // Punjabi/Gurmukhi/India
+ { 92, 1, 163,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Punjabi/Arabic/Pakistan
+ { 93, 7, 169,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Quechua/Latin/Peru
+ { 93, 7, 26,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Quechua/Latin/Bolivia
+ { 93, 7, 63,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Quechua/Latin/Ecuador
+ { 94, 7, 206,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Romansh/Latin/Switzerland
+ { 95, 7, 177,{ 3108,86 },{ 3108,86 },{ 185,27 },{ 3108,86 },{ 3108,86 },{ 185,27 }}, // Romanian/Latin/Romania
+ { 95, 7, 141,{ 3108,86 },{ 3108,86 },{ 185,27 },{ 3108,86 },{ 3108,86 },{ 185,27 }}, // Romanian/Latin/Moldova
+ { 96, 2, 178,{ 3194,81 },{ 3194,81 },{ 185,27 },{ 3194,81 },{ 3194,81 },{ 185,27 }}, // Russian/Cyrillic/Russia
+ { 96, 2, 20,{ 3194,81 },{ 3194,81 },{ 185,27 },{ 3194,81 },{ 3194,81 },{ 185,27 }}, // Russian/Cyrillic/Belarus
+ { 96, 2, 110,{ 3194,81 },{ 3194,81 },{ 185,27 },{ 3194,81 },{ 3194,81 },{ 185,27 }}, // Russian/Cyrillic/Kazakhstan
+ { 96, 2, 116,{ 3194,81 },{ 3194,81 },{ 185,27 },{ 3194,81 },{ 3194,81 },{ 185,27 }}, // Russian/Cyrillic/Kyrgyzstan
+ { 96, 2, 141,{ 3194,81 },{ 3194,81 },{ 185,27 },{ 3194,81 },{ 3194,81 },{ 185,27 }}, // Russian/Cyrillic/Moldova
+ { 96, 2, 222,{ 3194,81 },{ 3194,81 },{ 185,27 },{ 3194,81 },{ 3194,81 },{ 185,27 }}, // Russian/Cyrillic/Ukraine
+ { 98, 7, 41,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sango/Latin/Central African Republic
+ { 99, 13, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sanskrit/Devanagari/India
+ { 100, 2, 243,{ 3275,81 },{ 3275,81 },{ 185,27 },{ 3275,81 },{ 3275,81 },{ 185,27 }}, // Serbian/Cyrillic/Serbia
+ { 100, 2, 27,{ 3275,81 },{ 3275,81 },{ 185,27 },{ 3275,81 },{ 3275,81 },{ 185,27 }}, // Serbian/Cyrillic/Bosnia And Herzegowina
+ { 100, 2, 242,{ 3275,81 },{ 3275,81 },{ 185,27 },{ 3275,81 },{ 3275,81 },{ 185,27 }}, // Serbian/Cyrillic/Montenegro
+ { 100, 2, 257,{ 3275,81 },{ 3275,81 },{ 185,27 },{ 3275,81 },{ 3275,81 },{ 185,27 }}, // Serbian/Cyrillic/Kosovo
+ { 100, 7, 27,{ 3356,81 },{ 3356,81 },{ 185,27 },{ 3356,81 },{ 3356,81 },{ 185,27 }}, // Serbian/Latin/Bosnia And Herzegowina
+ { 100, 7, 242,{ 3356,81 },{ 3356,81 },{ 185,27 },{ 3356,81 },{ 3356,81 },{ 185,27 }}, // Serbian/Latin/Montenegro
+ { 100, 7, 243,{ 3356,81 },{ 3356,81 },{ 185,27 },{ 3356,81 },{ 3356,81 },{ 185,27 }}, // Serbian/Latin/Serbia
+ { 100, 7, 257,{ 3356,81 },{ 3356,81 },{ 185,27 },{ 3356,81 },{ 3356,81 },{ 185,27 }}, // Serbian/Latin/Kosovo
+ { 101, 2, 81,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ossetic/Cyrillic/Georgia
+ { 101, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ossetic/Cyrillic/Russia
+ { 102, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Southern Sotho/Latin/South Africa
+ { 103, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tswana/Latin/South Africa
+ { 104, 7, 240,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Shona/Latin/Zimbabwe
+ { 105, 1, 163,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sindhi/Arabic/Pakistan
+ { 106, 32, 198,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sinhala/Sinhala/Sri Lanka
+ { 107, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swati/Latin/South Africa
+ { 108, 7, 191,{ 600,82 },{ 600,82 },{ 185,27 },{ 600,82 },{ 600,82 },{ 185,27 }}, // Slovak/Latin/Slovakia
+ { 109, 7, 192,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Slovenian/Latin/Slovenia
+ { 110, 7, 194,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Somali/Latin/Somalia
+ { 110, 7, 59,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Somali/Latin/Djibouti
+ { 110, 7, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Somali/Latin/Ethiopia
+ { 110, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Somali/Latin/Kenya
+ { 111, 7, 197,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Spain
+ { 111, 7, 10,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Argentina
+ { 111, 7, 22,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Belize
+ { 111, 7, 26,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Bolivia
+ { 111, 7, 30,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Brazil
+ { 111, 7, 43,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Chile
+ { 111, 7, 47,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Colombia
+ { 111, 7, 52,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Costa Rica
+ { 111, 7, 55,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Cuba
+ { 111, 7, 61,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Dominican Republic
+ { 111, 7, 63,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Ecuador
+ { 111, 7, 65,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/El Salvador
+ { 111, 7, 66,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Equatorial Guinea
+ { 111, 7, 90,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Guatemala
+ { 111, 7, 96,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Honduras
+ { 111, 7, 139,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Mexico
+ { 111, 7, 155,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Nicaragua
+ { 111, 7, 166,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Panama
+ { 111, 7, 168,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Paraguay
+ { 111, 7, 169,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Peru
+ { 111, 7, 170,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Philippines
+ { 111, 7, 174,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Puerto Rico
+ { 111, 7, 225,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/United States
+ { 111, 7, 227,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Uruguay
+ { 111, 7, 231,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Venezuela
+ { 111, 7, 238,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Canary Islands
+ { 111, 7, 246,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Latin America
+ { 111, 7, 250,{ 682,84 },{ 682,84 },{ 185,27 },{ 682,84 },{ 682,84 },{ 185,27 }}, // Spanish/Latin/Ceuta And Melilla
+ { 112, 7, 101,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sundanese/Latin/Indonesia
+ { 113, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swahili/Latin/Tanzania
+ { 113, 7, 49,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swahili/Latin/Congo Kinshasa
+ { 113, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swahili/Latin/Kenya
+ { 113, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swahili/Latin/Uganda
+ { 114, 7, 205,{ 3437,84 },{ 3437,84 },{ 185,27 },{ 3521,84 },{ 3521,84 },{ 185,27 }}, // Swedish/Latin/Sweden
+ { 114, 7, 73,{ 3437,84 },{ 3437,84 },{ 185,27 },{ 3521,84 },{ 3521,84 },{ 185,27 }}, // Swedish/Latin/Finland
+ { 114, 7, 248,{ 3437,84 },{ 3437,84 },{ 185,27 },{ 3521,84 },{ 3521,84 },{ 185,27 }}, // Swedish/Latin/Aland Islands
+ { 115, 7, 106,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sardinian/Latin/Italy
+ { 116, 2, 209,{ 3605,81 },{ 3605,81 },{ 185,27 },{ 3605,81 },{ 3605,81 },{ 185,27 }}, // Tajik/Cyrillic/Tajikistan
+ { 117, 27, 100,{ 3686,64 },{ 3750,94 },{ 185,27 },{ 3686,64 },{ 3750,94 },{ 185,27 }}, // Tamil/Tamil/India
+ { 117, 27, 130,{ 3686,64 },{ 3750,94 },{ 185,27 },{ 3686,64 },{ 3750,94 },{ 185,27 }}, // Tamil/Tamil/Malaysia
+ { 117, 27, 190,{ 3686,64 },{ 3750,94 },{ 185,27 },{ 3686,64 },{ 3750,94 },{ 185,27 }}, // Tamil/Tamil/Singapore
+ { 117, 27, 198,{ 3686,64 },{ 3750,94 },{ 185,27 },{ 3686,64 },{ 3750,94 },{ 185,27 }}, // Tamil/Tamil/Sri Lanka
+ { 118, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tatar/Cyrillic/Russia
+ { 119, 28, 100,{ 3844,89 },{ 3844,89 },{ 185,27 },{ 3844,89 },{ 3844,89 },{ 185,27 }}, // Telugu/Telugu/India
+ { 120, 30, 211,{ 3933,99 },{ 3933,99 },{ 185,27 },{ 3933,99 },{ 3933,99 },{ 185,27 }}, // Thai/Thai/Thailand
+ { 121, 31, 44,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tibetan/Tibetan/China
+ { 121, 31, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tibetan/Tibetan/India
+ { 122, 14, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tigrinya/Ethiopic/Ethiopia
+ { 122, 14, 67,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tigrinya/Ethiopic/Eritrea
+ { 123, 7, 214,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tongan/Latin/Tonga
+ { 124, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tsonga/Latin/South Africa
+ { 125, 7, 217,{ 4032,81 },{ 4032,81 },{ 185,27 },{ 4032,81 },{ 4032,81 },{ 185,27 }}, // Turkish/Latin/Turkey
+ { 125, 7, 56,{ 4032,81 },{ 4032,81 },{ 185,27 },{ 4032,81 },{ 4032,81 },{ 185,27 }}, // Turkish/Latin/Cyprus
+ { 126, 7, 218,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Turkmen/Latin/Turkmenistan
+ { 128, 1, 44,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Uighur/Arabic/China
+ { 129, 2, 222,{ 4113,50 },{ 4163,81 },{ 185,27 },{ 4244,58 },{ 4163,81 },{ 185,27 }}, // Ukrainian/Cyrillic/Ukraine
+ { 130, 1, 163,{ 4302,67 },{ 4302,67 },{ 185,27 },{ 4302,67 },{ 4302,67 },{ 185,27 }}, // Urdu/Arabic/Pakistan
+ { 130, 1, 100,{ 4302,67 },{ 4302,67 },{ 185,27 },{ 4302,67 },{ 4302,67 },{ 185,27 }}, // Urdu/Arabic/India
+ { 131, 7, 228,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Uzbek/Latin/Uzbekistan
+ { 131, 1, 1,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Uzbek/Arabic/Afghanistan
+ { 131, 2, 228,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Uzbek/Cyrillic/Uzbekistan
+ { 132, 7, 232,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Vietnamese/Latin/Vietnam
+ { 133, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Volapuk/Latin/World
+ { 134, 7, 224,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Welsh/Latin/United Kingdom
+ { 135, 7, 187,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Wolof/Latin/Senegal
+ { 136, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Xhosa/Latin/South Africa
+ { 137, 18, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Yiddish/Hebrew/World
+ { 138, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Yoruba/Latin/Nigeria
+ { 138, 7, 23,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Yoruba/Latin/Benin
+ { 140, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Zulu/Latin/South Africa
+ { 141, 7, 161,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Norwegian Nynorsk/Latin/Norway
+ { 142, 7, 27,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bosnian/Latin/Bosnia And Herzegowina
+ { 142, 2, 27,{ 3275,81 },{ 3275,81 },{ 185,27 },{ 3275,81 },{ 3275,81 },{ 185,27 }}, // Bosnian/Cyrillic/Bosnia And Herzegowina
+ { 143, 29, 131,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Divehi/Thaana/Maldives
+ { 144, 7, 251,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Manx/Latin/Isle Of Man
+ { 145, 7, 224,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Cornish/Latin/United Kingdom
+ { 146, 7, 83,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Akan/Latin/Ghana
+ { 147, 13, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Konkani/Devanagari/India
+ { 148, 7, 83,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ga/Latin/Ghana
+ { 149, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Igbo/Latin/Nigeria
+ { 150, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kamba/Latin/Kenya
+ { 151, 33, 103,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Syriac/Syriac/Iraq
+ { 152, 14, 67,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Blin/Ethiopic/Eritrea
+ { 153, 14, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Geez/Ethiopic/Ethiopia
+ { 155, 7, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sidamo/Latin/Ethiopia
+ { 156, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Atsam/Latin/Nigeria
+ { 157, 14, 67,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tigre/Ethiopic/Eritrea
+ { 158, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Jju/Latin/Nigeria
+ { 159, 7, 106,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Friulian/Latin/Italy
+ { 160, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Venda/Latin/South Africa
+ { 161, 7, 83,{ 4369,48 },{ 4417,87 },{ 185,27 },{ 4369,48 },{ 4417,87 },{ 185,27 }}, // Ewe/Latin/Ghana
+ { 161, 7, 212,{ 4369,48 },{ 4417,87 },{ 185,27 },{ 4369,48 },{ 4417,87 },{ 185,27 }}, // Ewe/Latin/Togo
+ { 162, 14, 69,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Walamo/Ethiopic/Ethiopia
+ { 163, 7, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Hawaiian/Latin/United States
+ { 164, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tyap/Latin/Nigeria
+ { 165, 7, 129,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nyanja/Latin/Malawi
+ { 166, 7, 170,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Filipino/Latin/Philippines
+ { 167, 7, 206,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swiss German/Latin/Switzerland
+ { 167, 7, 74,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swiss German/Latin/France
+ { 167, 7, 123,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Swiss German/Latin/Liechtenstein
+ { 168, 34, 44,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sichuan Yi/Yi/China
+ { 169, 7, 121,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kpelle/Latin/Liberia
+ { 170, 7, 82,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Low German/Latin/Germany
+ { 170, 7, 151,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Low German/Latin/Netherlands
+ { 171, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // South Ndebele/Latin/South Africa
+ { 172, 7, 195,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Northern Sotho/Latin/South Africa
+ { 173, 7, 161,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Northern Sami/Latin/Norway
+ { 173, 7, 73,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Northern Sami/Latin/Finland
+ { 173, 7, 205,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Northern Sami/Latin/Sweden
+ { 174, 7, 208,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Taroko/Latin/Taiwan
+ { 175, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Gusii/Latin/Kenya
+ { 176, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Taita/Latin/Kenya
+ { 177, 7, 187,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Senegal
+ { 177, 7, 34,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Burkina Faso
+ { 177, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Cameroon
+ { 177, 7, 80,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Gambia
+ { 177, 7, 83,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Ghana
+ { 177, 7, 91,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Guinea
+ { 177, 7, 92,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Guinea Bissau
+ { 177, 7, 121,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Liberia
+ { 177, 7, 136,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Mauritania
+ { 177, 7, 156,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Niger
+ { 177, 7, 157,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Nigeria
+ { 177, 7, 189,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Latin/Sierra Leone
+ { 177, 134, 91,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Fulah/Adlam/Guinea
+ { 178, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kikuyu/Latin/Kenya
+ { 179, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Samburu/Latin/Kenya
+ { 180, 7, 146,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sena/Latin/Mozambique
+ { 181, 7, 240,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // North Ndebele/Latin/Zimbabwe
+ { 182, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Rombo/Latin/Tanzania
+ { 183, 9, 145,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tachelhit/Tifinagh/Morocco
+ { 183, 7, 145,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tachelhit/Latin/Morocco
+ { 184, 7, 3,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kabyle/Latin/Algeria
+ { 185, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nyankole/Latin/Uganda
+ { 186, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bena/Latin/Tanzania
+ { 187, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Vunjo/Latin/Tanzania
+ { 188, 7, 132,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bambara/Latin/Mali
+ { 188, 75, 132,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bambara/Nko/Mali
+ { 189, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Embu/Latin/Kenya
+ { 190, 12, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Cherokee/Cherokee/United States
+ { 191, 7, 137,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Morisyen/Latin/Mauritius
+ { 192, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Makonde/Latin/Tanzania
+ { 193, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Langi/Latin/Tanzania
+ { 194, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ganda/Latin/Uganda
+ { 195, 7, 239,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bemba/Latin/Zambia
+ { 196, 7, 39,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kabuverdianu/Latin/Cape Verde
+ { 197, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Meru/Latin/Kenya
+ { 198, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kalenjin/Latin/Kenya
+ { 199, 7, 148,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nama/Latin/Namibia
+ { 200, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Machame/Latin/Tanzania
+ { 201, 7, 82,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Colognian/Latin/Germany
+ { 202, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Masai/Latin/Kenya
+ { 202, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Masai/Latin/Tanzania
+ { 203, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Soga/Latin/Uganda
+ { 204, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Luyia/Latin/Kenya
+ { 205, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Asu/Latin/Tanzania
+ { 206, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Teso/Latin/Uganda
+ { 206, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Teso/Latin/Kenya
+ { 207, 7, 67,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Saho/Latin/Eritrea
+ { 208, 7, 132,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Koyra Chiini/Latin/Mali
+ { 209, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Rwa/Latin/Tanzania
+ { 210, 7, 111,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Luo/Latin/Kenya
+ { 211, 7, 221,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Chiga/Latin/Uganda
+ { 212, 7, 145,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Central Morocco Tamazight/Latin/Morocco
+ { 213, 7, 132,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Koyraboro Senni/Latin/Mali
+ { 214, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Shambala/Latin/Tanzania
+ { 215, 13, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bodo/Devanagari/India
+ { 218, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Chechen/Cyrillic/Russia
+ { 219, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Church/Cyrillic/Russia
+ { 220, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Chuvash/Cyrillic/Russia
+ { 230, 7, 49,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Luba Katanga/Latin/Congo Kinshasa
+ { 231, 7, 125,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Luxembourgish/Latin/Luxembourg
+ { 236, 7, 21,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Walloon/Latin/Belgium
+ { 237, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Aghem/Latin/Cameroon
+ { 238, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Basaa/Latin/Cameroon
+ { 239, 7, 156,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Zarma/Latin/Niger
+ { 240, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Duala/Latin/Cameroon
+ { 241, 7, 187,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Jola Fonyi/Latin/Senegal
+ { 242, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ewondo/Latin/Cameroon
+ { 243, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Bafia/Latin/Cameroon
+ { 244, 7, 146,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Makhuwa Meetto/Latin/Mozambique
+ { 245, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Mundang/Latin/Cameroon
+ { 246, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kwasio/Latin/Cameroon
+ { 247, 7, 254,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nuer/Latin/South Sudan
+ { 248, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sakha/Cyrillic/Russia
+ { 249, 7, 210,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sangu/Latin/Tanzania
+ { 251, 7, 156,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tasawaq/Latin/Niger
+ { 252, 35, 121,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Vai/Vai/Liberia
+ { 252, 7, 121,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Vai/Latin/Liberia
+ { 253, 7, 206,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Walser/Latin/Switzerland
+ { 254, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Yangben/Latin/Cameroon
+ { 256, 7, 197,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Asturian/Latin/Spain
+ { 257, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ngomba/Latin/Cameroon
+ { 258, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kako/Latin/Cameroon
+ { 259, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Meta/Latin/Cameroon
+ { 260, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ngiemboon/Latin/Cameroon
+ { 261, 7, 197,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Aragonese/Latin/Spain
+ { 290, 11, 100,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Manipuri/Bengali/India
+ { 309, 100, 232,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Tai Dam/Tai Viet/Vietnam
+ { 312, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Akoose/Latin/Cameroon
+ { 313, 7, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lakota/Latin/United States
+ { 314, 9, 145,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Standard Moroccan Tamazight/Tifinagh/Morocco
+ { 315, 7, 43,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Mapuche/Latin/Chile
+ { 316, 1, 103,{ 4504,102 },{ 4504,102 },{ 185,27 },{ 4504,102 },{ 4504,102 },{ 185,27 }}, // Central Kurdish/Arabic/Iraq
+ { 316, 1, 102,{ 4504,102 },{ 4504,102 },{ 185,27 },{ 4504,102 },{ 4504,102 },{ 185,27 }}, // Central Kurdish/Arabic/Iran
+ { 317, 7, 82,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lower Sorbian/Latin/Germany
+ { 318, 7, 82,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Upper Sorbian/Latin/Germany
+ { 319, 7, 37,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kenyang/Latin/Cameroon
+ { 320, 7, 38,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Mohawk/Latin/Canada
+ { 321, 75, 91,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Nko/Nko/Guinea
+ { 322, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Prussian/Latin/World
+ { 323, 7, 90,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Kiche/Latin/Guatemala
+ { 324, 7, 205,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Southern Sami/Latin/Sweden
+ { 325, 7, 205,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lule Sami/Latin/Sweden
+ { 326, 7, 73,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Inari Sami/Latin/Finland
+ { 327, 7, 73,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Skolt Sami/Latin/Finland
+ { 328, 7, 13,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Warlpiri/Latin/Australia
+ { 346, 1, 102,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Mazanderani/Arabic/Iran
+ { 349, 1, 102,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Northern Luri/Arabic/Iran
+ { 349, 1, 103,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Northern Luri/Arabic/Iraq
+ { 357, 6, 97,{ 484,39 },{ 484,39 },{ 185,27 },{ 484,39 },{ 484,39 },{ 185,27 }}, // Cantonese/Traditional Han/Hong Kong
+ { 357, 5, 44,{ 484,39 },{ 484,39 },{ 185,27 },{ 484,39 },{ 484,39 },{ 185,27 }}, // Cantonese/Simplified Han/China
+ { 358, 138, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Osage/Osage/United States
+ { 360, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Ido/Latin/World
+ { 361, 7, 260,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Lojban/Latin/World
+ { 362, 7, 106,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Sicilian/Latin/Italy
+ { 363, 1, 102,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Southern Kurdish/Arabic/Iran
+ { 364, 1, 163,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Western Balochi/Arabic/Pakistan
+ { 365, 7, 170,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Cebuano/Latin/Philippines
+ { 366, 2, 178,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Erzya/Cyrillic/Russia
+ { 367, 7, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Chickasaw/Latin/United States
+ { 368, 7, 225,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Muscogee/Latin/United States
+ { 369, 7, 172,{ 48,84 },{ 48,84 },{ 185,27 },{ 48,84 },{ 48,84 },{ 185,27 }}, // Silesian/Latin/Poland
+ { 0, 0, 0,{ 0,0},{ 0,0},{ 0,0},{ 0,0},{ 0,0},{ 0,0}}, // trailing zeros
+};
+
+static const ushort months_data[] = {
+0x46, 0x61, 0x72, 0x3b, 0x4f, 0x72, 0x64, 0x3b, 0x4b, 0x68, 0x6f, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x3b,
+0x53, 0x68, 0x61, 0x3b, 0x4d, 0x65, 0x68, 0x3b, 0x41, 0x62, 0x61, 0x3b, 0x41, 0x7a, 0x61, 0x3b, 0x44, 0x65, 0x79, 0x3b,
+0x42, 0x61, 0x68, 0x3b, 0x45, 0x73, 0x66, 0x3b, 0x46, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72,
+0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x68, 0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x54, 0x69,
+0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x53, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d,
+0x65, 0x68, 0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e, 0x3b, 0x41, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61,
+0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x46, 0x3b, 0x4f, 0x3b, 0x4b, 0x3b, 0x54, 0x3b,
+0x4d, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x45, 0x3b, 0x31, 0x3b, 0x32, 0x3b,
+0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b,
+0x31, 0x32, 0x3b, 0x31, 0x33, 0x31, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38,
+0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31, 0x32, 0x3b, 0x641, 0x631, 0x641, 0x631, 0x62f, 0x646, 0x3b, 0x623,
+0x630, 0x631, 0x628, 0x64a, 0x647, 0x634, 0x62a, 0x3b, 0x62e, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x62a, 0x627, 0x631, 0x3b, 0x645, 0x631,
+0x62f, 0x627, 0x62f, 0x3b, 0x634, 0x647, 0x631, 0x641, 0x627, 0x631, 0x3b, 0x645, 0x647, 0x631, 0x3b, 0x622, 0x64a, 0x627, 0x646, 0x3b,
+0x622, 0x630, 0x631, 0x3b, 0x62f, 0x64a, 0x3b, 0x628, 0x647, 0x645, 0x646, 0x3b, 0x627, 0x633, 0x641, 0x646, 0x62f, 0x627, 0x631, 0x3b,
+0x9ab, 0x9cd, 0x9af, 0x9be, 0x9ad, 0x9be, 0x9b0, 0x9cd, 0x9a1, 0x9bf, 0x9a8, 0x3b, 0x985, 0x9b0, 0x9a1, 0x9bf, 0x9ac, 0x9c7, 0x9b9, 0x9c7,
+0x9b6, 0x9cd, 0x9a4, 0x3b, 0x996, 0x9cb, 0x9b0, 0x9cd, 0x9a6, 0x9cd, 0x9a6, 0x3b, 0x9a4, 0x9c0, 0x9b0, 0x3b, 0x9ae, 0x9b0, 0x9cd, 0x9af,
+0x9be, 0x9a6, 0x3b, 0x9b6, 0x9be, 0x9b9, 0x9b0, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ae, 0x9c7, 0x9b9, 0x9c7, 0x9b0, 0x3b, 0x986, 0x9ac,
+0x9be, 0x9a8, 0x3b, 0x986, 0x99c, 0x9be, 0x9b0, 0x3b, 0x9a6, 0x9c7, 0x3b, 0x9ac, 0x9be, 0x9b9, 0x9ae, 0x9be, 0x9a8, 0x3b, 0x98f, 0x9b8,
+0x9ab, 0x9cd, 0x9af, 0x9be, 0x9a8, 0x9cd, 0x9a1, 0x3b, 0x9ab, 0x9cd, 0x9af, 0x9be, 0x9ad, 0x9be, 0x9b0, 0x9cd, 0x9a1, 0x9bf, 0x9a8, 0x3b,
+0x985, 0x9b0, 0x9a1, 0x9bf, 0x9ac, 0x9c7, 0x9b9, 0x9c7, 0x9b6, 0x9cd, 0x9a4, 0x3b, 0x996, 0x9cb, 0x9b0, 0x9cd, 0x9a6, 0x9cd, 0x9a6, 0x3b,
+0x9a4, 0x9c0, 0x9b0, 0x3b, 0x9ae, 0x9b0, 0x9cd, 0x9af, 0x9be, 0x9a6, 0x3b, 0x9b6, 0x9be, 0x9b9, 0x9b0, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b,
+0x9ae, 0x9c7, 0x9b9, 0x9c7, 0x9b0, 0x3b, 0x986, 0x9ac, 0x9be, 0x9a8, 0x3b, 0x9ac, 0x9be, 0x99c, 0x9be, 0x9b0, 0x3b, 0x9a6, 0x9c7, 0x3b,
+0x9ac, 0x9be, 0x9b9, 0x9ae, 0x9be, 0x9a8, 0x3b, 0x98f, 0x9b8, 0x9ab, 0x9cd, 0x9af, 0x9be, 0x9a8, 0x9cd, 0x9a1, 0x3b, 0x9e7, 0x3b, 0x9e8,
+0x3b, 0x9e9, 0x3b, 0x9ea, 0x3b, 0x9eb, 0x3b, 0x9ec, 0x3b, 0x9ed, 0x3b, 0x9ee, 0x3b, 0x9ef, 0x3b, 0x9e7, 0x9e6, 0x3b, 0x9e7, 0x9e7,
+0x3b, 0x9e7, 0x9e8, 0x3b, 0x31, 0x6708, 0x3b, 0x32, 0x6708, 0x3b, 0x33, 0x6708, 0x3b, 0x34, 0x6708, 0x3b, 0x35, 0x6708, 0x3b, 0x36,
+0x6708, 0x3b, 0x37, 0x6708, 0x3b, 0x38, 0x6708, 0x3b, 0x39, 0x6708, 0x3b, 0x31, 0x30, 0x6708, 0x3b, 0x31, 0x31, 0x6708, 0x3b, 0x31,
+0x32, 0x6708, 0x3b, 0x4e00, 0x6708, 0x3b, 0x4e8c, 0x6708, 0x3b, 0x4e09, 0x6708, 0x3b, 0x56db, 0x6708, 0x3b, 0x4e94, 0x6708, 0x3b, 0x516d, 0x6708,
+0x3b, 0x4e03, 0x6708, 0x3b, 0x516b, 0x6708, 0x3b, 0x4e5d, 0x6708, 0x3b, 0x5341, 0x6708, 0x3b, 0x5341, 0x4e00, 0x6708, 0x3b, 0x5341, 0x4e8c, 0x6708,
+0x3b, 0x31, 0x2e, 0x3b, 0x32, 0x2e, 0x3b, 0x33, 0x2e, 0x3b, 0x34, 0x2e, 0x3b, 0x35, 0x2e, 0x3b, 0x36, 0x2e, 0x3b, 0x37,
+0x2e, 0x3b, 0x38, 0x2e, 0x3b, 0x39, 0x2e, 0x3b, 0x31, 0x30, 0x2e, 0x3b, 0x31, 0x31, 0x2e, 0x3b, 0x31, 0x32, 0x2e, 0x3b,
+0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74,
+0x3b, 0x63, 0x68, 0x6f, 0x72, 0x64, 0xe1, 0x64, 0x3b, 0x74, 0xed, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0xe1, 0x64, 0x3b,
+0x161, 0x61, 0x68, 0x72, 0xed, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0xe1, 0x62, 0xe1, 0x6e, 0x3b, 0xe1,
+0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x69, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e,
+0x64, 0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65,
+0x73, 0x68, 0x74, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64,
+0x61, 0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x61, 0x62,
+0x61, 0x6e, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65,
+0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69,
+0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d,
+0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b,
+0x61, 0x62, 0x61, 0x6e, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e,
+0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x6b, 0x75, 0x75,
+0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x6b, 0x75, 0x75, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64,
+0x61, 0x64, 0x6b, 0x75, 0x75, 0x3b, 0x74, 0x69, 0x72, 0x6b, 0x75, 0x75, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x6b,
+0x75, 0x75, 0x3b, 0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x6b, 0x75, 0x75, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x6b,
+0x75, 0x75, 0x3b, 0x61, 0x62, 0x61, 0x6e, 0x6b, 0x75, 0x75, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x6b, 0x75, 0x75, 0x3b, 0x64,
+0x65, 0x79, 0x6b, 0x75, 0x75, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x6b, 0x75, 0x75, 0x3b, 0x65, 0x73, 0x66, 0x61,
+0x6e, 0x64, 0x6b, 0x75, 0x75, 0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x6b, 0x75, 0x75, 0x74, 0x61,
+0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6b, 0x68, 0x6f,
+0x72, 0x64, 0x61, 0x64, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x74, 0x69, 0x72, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d,
+0x6f, 0x72, 0x64, 0x61, 0x64, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x6b,
+0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x61, 0x62, 0x61, 0x6e, 0x6b,
+0x75, 0x75, 0x74, 0x61, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x64, 0x65, 0x79, 0x6b, 0x75,
+0x75, 0x74, 0x61, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x65, 0x73, 0x66, 0x61,
+0x6e, 0x64, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x66, 0x61, 0x72, 0x2e, 0x3b, 0x6f, 0x72, 0x64, 0x2e, 0x3b, 0x6b, 0x68,
+0x6f, 0x2e, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x2e, 0x3b, 0x161, 0x61, 0x68, 0x2e, 0x3b, 0x6d, 0x65, 0x68,
+0x72, 0x3b, 0xe2, 0x62, 0xe2, 0x6e, 0x3b, 0xe2, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x2e,
+0x3b, 0x65, 0x73, 0x66, 0x2e, 0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69,
+0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d,
+0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x161, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b,
+0xe2, 0x62, 0xe2, 0x6e, 0x3b, 0xe2, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e,
+0x3b, 0x65, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x46, 0x61, 0x72, 0x2e, 0x3b, 0x4f, 0x72, 0x64, 0x2e, 0x3b, 0x4b, 0x68,
+0x6f, 0x2e, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x2e, 0x3b, 0x160, 0x61, 0x68, 0x2e, 0x3b, 0x4d, 0x65, 0x68,
+0x72, 0x3b, 0xc2, 0x62, 0xe2, 0x2e, 0x3b, 0xc2, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x2e,
+0x3b, 0x45, 0x73, 0x66, 0x2e, 0x3b, 0x46, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69,
+0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d,
+0x6f, 0x72, 0x64, 0xe2, 0x64, 0x3b, 0x160, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b,
+0xc2, 0x62, 0xe2, 0x6e, 0x3b, 0xc2, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e,
+0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x10e4, 0x10d0, 0x10e0, 0x10d5, 0x10d0, 0x10e0, 0x10d3, 0x10d8, 0x10dc, 0x10d8, 0x3b, 0x10dd,
+0x10e0, 0x10d3, 0x10d8, 0x10d1, 0x10d4, 0x10f0, 0x10d4, 0x10e8, 0x10d7, 0x10d8, 0x3b, 0x10ee, 0x10dd, 0x10e0, 0x10d3, 0x10d0, 0x10d3, 0x10d8, 0x3b, 0x10d7,
+0x10d8, 0x10e0, 0x10d8, 0x3b, 0x10db, 0x10dd, 0x10e0, 0x10d3, 0x10d0, 0x10d3, 0x10d8, 0x3b, 0x10e8, 0x10d0, 0x10f0, 0x10e0, 0x10d8, 0x10d5, 0x10d0, 0x10e0,
+0x10d8, 0x3b, 0x10db, 0x10d4, 0x10f0, 0x10e0, 0x10d8, 0x3b, 0x10d0, 0x10d1, 0x10d0, 0x10dc, 0x10d8, 0x3b, 0x10d0, 0x10d6, 0x10d0, 0x10e0, 0x10d8, 0x3b,
+0x10d3, 0x10d4, 0x10d8, 0x3b, 0x10d1, 0x10d0, 0x10f0, 0x10db, 0x10d0, 0x10dc, 0x10d8, 0x3b, 0x10d4, 0x10e1, 0x10e4, 0x10d0, 0x10dc, 0x10d3, 0x10d8, 0x3b,
+0x46, 0x61, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x63,
+0x68, 0x74, 0x3b, 0x43, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x101,
+0x64, 0x3b, 0x53, 0x63, 0x68, 0x61, 0x68, 0x72, 0x69, 0x77, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x100, 0x62,
+0x101, 0x6e, 0x3b, 0x100, 0x73, 0x61, 0x72, 0x3b, 0x44, 0xe9, 0x69, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45,
+0x73, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0xaab, 0xabe, 0xab0, 0xacd, 0xab5, 0xabe, 0xab0, 0xacd, 0xaa6, 0xabf, 0xaa8, 0x3b, 0xa93,
+0xab0, 0xaa1, 0xac0, 0xaac, 0xac7, 0xab9, 0xac7, 0xab6, 0xacd, 0xa9f, 0x3b, 0xa96, 0xacb, 0xab0, 0xaa6, 0xabe, 0xaa6, 0x3b, 0xaa4, 0xabf,
+0xab0, 0x3b, 0xaae, 0xacb, 0xab0, 0xacd, 0xaa6, 0xabe, 0xaa6, 0x3b, 0xab6, 0xabe, 0xab9, 0xab0, 0xabf, 0xab5, 0xab0, 0x3b, 0xaae, 0xac7,
+0xab9, 0xab0, 0x3b, 0xa85, 0xaac, 0xabe, 0xaa8, 0x3b, 0xa85, 0xa9d, 0xabe, 0xab0, 0x3b, 0xaa1, 0xac7, 0xaaf, 0x3b, 0xaac, 0xabe, 0xab9,
+0xaae, 0xac7, 0xaa8, 0x3b, 0xa8f, 0xab8, 0xacd, 0xaab, 0xabe, 0xaa8, 0xacd, 0xaa1, 0x3b, 0x5e4, 0x5e8, 0x5d5, 0x5e8, 0x5d3, 0x5d9, 0x5df,
+0x3b, 0x5d0, 0x5e8, 0x5d3, 0x5d9, 0x5d1, 0x5d4, 0x5e9, 0x5ea, 0x3b, 0x5d7, 0x5f3, 0x5e8, 0x5d3, 0x5d0, 0x5d3, 0x3b, 0x5ea, 0x5d9, 0x5e8,
+0x3b, 0x5de, 0x5e8, 0x5d3, 0x5d0, 0x5d3, 0x3b, 0x5e9, 0x5d4, 0x5e8, 0x5d9, 0x5d5, 0x5e8, 0x3b, 0x5de, 0x5d4, 0x5e8, 0x3b, 0x5d0, 0x5d1,
+0x5d0, 0x5df, 0x3b, 0x5d0, 0x5d3, 0x5f3, 0x5e8, 0x3b, 0x5d3, 0x5d9, 0x3b, 0x5d1, 0x5d4, 0x5de, 0x5df, 0x3b, 0x5d0, 0x5e1, 0x5e4, 0x5e0,
+0x5d3, 0x3b, 0x92b, 0x930, 0x94d, 0x935, 0x93e, 0x926, 0x93f, 0x928, 0x3b, 0x913, 0x930, 0x94d, 0x926, 0x93f, 0x935, 0x947, 0x939, 0x947,
+0x938, 0x94d, 0x91f, 0x3b, 0x916, 0x94b, 0x930, 0x930, 0x94d, 0x926, 0x93e, 0x926, 0x3b, 0x91f, 0x93f, 0x930, 0x3b, 0x92e, 0x94b, 0x930,
+0x926, 0x93e, 0x926, 0x3b, 0x936, 0x93e, 0x939, 0x930, 0x940, 0x935, 0x930, 0x94d, 0x3b, 0x92e, 0x947, 0x939, 0x930, 0x3b, 0x905, 0x935,
+0x928, 0x3b, 0x905, 0x91c, 0x93c, 0x930, 0x3b, 0x921, 0x947, 0x3b, 0x92c, 0x939, 0x92e, 0x928, 0x3b, 0x908, 0x938, 0x94d, 0x92b, 0x928,
+0x94d, 0x926, 0x94d, 0x3b, 0x30d5, 0x30a1, 0x30eb, 0x30f4, 0x30a1, 0x30eb, 0x30c7, 0x30a3, 0x30fc, 0x30f3, 0x3b, 0x30aa, 0x30eb, 0x30c7, 0x30a3, 0x30fc,
+0x30d9, 0x30d8, 0x30b7, 0x30e5, 0x30c8, 0x3b, 0x30db, 0x30eb, 0x30c0, 0x30fc, 0x30c9, 0x3b, 0x30c6, 0x30a3, 0x30fc, 0x30eb, 0x3b, 0x30e2, 0x30eb, 0x30c0,
+0x30fc, 0x30c9, 0x3b, 0x30b7, 0x30e3, 0x30cf, 0x30ea, 0x30fc, 0x30f4, 0x30a1, 0x30eb, 0x3b, 0x30e1, 0x30d5, 0x30eb, 0x3b, 0x30a2, 0x30fc, 0x30d0, 0x30fc,
+0x30f3, 0x3b, 0x30a2, 0x30fc, 0x30b6, 0x30eb, 0x3b, 0x30c7, 0x30a4, 0x3b, 0x30d0, 0x30d5, 0x30de, 0x30f3, 0x3b, 0x30a8, 0x30b9, 0x30d5, 0x30a1, 0x30f3,
+0x30c9, 0x3b, 0xcab, 0xcb0, 0xccd, 0xcb5, 0xcb0, 0xccd, 0xca6, 0xcbf, 0xca8, 0xccd, 0x3b, 0xc93, 0xcb0, 0xccd, 0xca6, 0xcbf, 0xcac, 0xcc6,
+0xcb9, 0xcc6, 0xcb6, 0xccd, 0xc9f, 0xccd, 0x3b, 0xc96, 0xccb, 0xcb0, 0xccd, 0xca1, 0xcbe, 0xca6, 0xccd, 0x3b, 0xc9f, 0xcbf, 0xcb0, 0xccd,
+0x3b, 0xcae, 0xcca, 0xcb0, 0xccd, 0xca6, 0xcbe, 0xca6, 0xccd, 0x3b, 0xcb6, 0xcb9, 0xcb0, 0xcbf, 0xcb5, 0xcbe, 0xcb0, 0xccd, 0x3b, 0xcae,
+0xcc6, 0xcb9, 0xccd, 0xcb0, 0xccd, 0x3b, 0xc85, 0xcac, 0xca8, 0xccd, 0x3b, 0xc85, 0xc9d, 0xcb0, 0xccd, 0x3b, 0xca1, 0xcc7, 0x3b, 0xcac,
+0xcb9, 0xccd, 0xcae, 0xca8, 0xccd, 0x3b, 0xc8e, 0xcb8, 0xccd, 0xcab, 0xcbe, 0xc82, 0xca1, 0xccd, 0x3b, 0xd654, 0xb974, 0xbc14, 0xb518, 0x3b,
+0xc624, 0xb974, 0xb514, 0xbca0, 0xd5e4, 0xc26c, 0xd2b8, 0x3b, 0xd638, 0xb974, 0xb2e4, 0xb4dc, 0x3b, 0xd2f0, 0xb974, 0x3b, 0xbaa8, 0xb974, 0xb2e4, 0xb4dc,
+0x3b, 0xc0e4, 0xd750, 0xb9ac, 0xbc14, 0xb974, 0x3b, 0xba54, 0xd750, 0xb974, 0x3b, 0xc544, 0xbc18, 0x3b, 0xc544, 0xc790, 0xb974, 0x3b, 0xb2e4, 0xc774,
+0x3b, 0xbc14, 0xd750, 0xb9cc, 0x3b, 0xc5d0, 0xc2a4, 0xd310, 0xb4dc, 0x3b, 0xe9f, 0xea3, 0xeb2, 0xea7, 0xeb2, 0xe94, 0xeb4, 0xe99, 0x3b, 0xead,
+0xecd, 0xea3, 0xe94, 0xeb5, 0xe9a, 0xeb5, 0xec0, 0xeab, 0xeae, 0xe94, 0x3b, 0xe84, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xec1, 0xe95,
+0xea3, 0x3b, 0xea1, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xe8a, 0xeb2, 0xea3, 0xea5, 0xeb4, 0xea7, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeb5,
+0x3b, 0xead, 0xeb2, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xead, 0xeb2, 0xe8a, 0xeb2, 0x3b, 0xe94, 0xeb5, 0xea3, 0x3b, 0xe9a, 0xea3, 0xeb2, 0xea1,
+0xeb2, 0xe99, 0x3b, 0xec0, 0xead, 0xeaa, 0xe9f, 0xeb2, 0xe99, 0x3b, 0xe9f, 0xea3, 0xeb2, 0xea7, 0xeb2, 0xe94, 0xeb4, 0xe99, 0x3b, 0xead,
+0xecd, 0xea3, 0xe94, 0xeb5, 0xe9a, 0xeb5, 0xec0, 0xeab, 0xea3, 0xe94, 0x3b, 0xe84, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xec1, 0xe95,
+0xea3, 0x3b, 0xea1, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xe8a, 0xeb2, 0xea3, 0xeab, 0xeb4, 0xea7, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeb5,
+0x3b, 0xead, 0xeb2, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xead, 0xeb2, 0xe8a, 0xeb2, 0xea3, 0x3b, 0xe94, 0xeb5, 0xea3, 0x3b, 0xe9a, 0xea3, 0xeb2,
+0xec1, 0xea1, 0xe99, 0x3b, 0xec0, 0xead, 0xeaa, 0xe9f, 0xeb2, 0xe99, 0x3b, 0xe9f, 0xeb2, 0xea3, 0xea7, 0xeb2, 0xe94, 0xeb4, 0xe99, 0x3b,
+0xead, 0xecd, 0xea3, 0xe94, 0xeb5, 0xe9a, 0xeb5, 0xec0, 0xeab, 0xea3, 0xe94, 0x3b, 0xe84, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xec1,
+0xe95, 0xea3, 0x3b, 0xea1, 0xecd, 0xea3, 0xec0, 0xe94, 0xe94, 0x3b, 0xe8a, 0xeb2, 0xea3, 0xeab, 0xeb4, 0xea7, 0xeb2, 0x3b, 0xec0, 0xea1,
+0xeb5, 0x3b, 0xead, 0xeb2, 0xe9a, 0xeb2, 0xe99, 0x3b, 0xead, 0xeb2, 0xe8a, 0xeb2, 0x3b, 0xe94, 0xeb5, 0xea3, 0x3b, 0xe9a, 0xea3, 0xeb2,
+0xea1, 0xeb2, 0xe99, 0x3b, 0xec0, 0xead, 0xeaa, 0xe9f, 0xeb2, 0xe99, 0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x12b, 0x6e,
+0x73, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x73, 0x3b, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64,
+0x73, 0x3b, 0x74, 0x12b, 0x72, 0x73, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x73, 0x3b, 0x161, 0x61, 0x68, 0x72, 0x69,
+0x76, 0x113, 0x72, 0x73, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x73, 0x3b, 0x61, 0x62, 0x61, 0x6e, 0x73, 0x3b, 0x61, 0x7a, 0x65,
+0x72, 0x73, 0x3b, 0x64, 0x65, 0x6a, 0x73, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x73, 0x3b, 0x65, 0x73, 0x66, 0x61,
+0x6e, 0x64, 0x73, 0x3b, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x438, 0x43d, 0x3b, 0x43e, 0x440, 0x434, 0x438, 0x431, 0x435,
+0x445, 0x435, 0x448, 0x442, 0x3b, 0x43a, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x442, 0x438, 0x440, 0x3b, 0x43c, 0x43e, 0x440, 0x434,
+0x430, 0x434, 0x3b, 0x448, 0x430, 0x445, 0x440, 0x438, 0x432, 0x430, 0x440, 0x3b, 0x43c, 0x435, 0x440, 0x3b, 0x430, 0x431, 0x430, 0x43d,
+0x3b, 0x430, 0x437, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x458, 0x3b, 0x431, 0x430, 0x445, 0x43c, 0x430, 0x43d, 0x3b, 0x435, 0x441, 0x444,
+0x430, 0x43d, 0x434, 0x3b, 0xd2b, 0xd7c, 0xd35, 0xd3e, 0xd7c, 0xd26, 0xd3f, 0xd7b, 0x3b, 0xd13, 0xd7c, 0xd21, 0xd3f, 0xd2c, 0xd46, 0xd39,
+0xd46, 0xd37, 0xd4d, 0x200c, 0xd31, 0xd4d, 0xd31, 0xd4d, 0x3b, 0xd16, 0xd4b, 0xd7c, 0xd26, 0xd3e, 0xd26, 0xd4d, 0x3b, 0xd1f, 0xd3f, 0xd7c,
+0x3b, 0xd2e, 0xd4b, 0xd7c, 0xd26, 0xd3e, 0xd26, 0xd4d, 0x3b, 0xd37, 0xd39, 0xd4d, 0x200c, 0xd30, 0xd3f, 0xd35, 0xd3e, 0xd7c, 0x3b, 0xd2e,
+0xd46, 0xd39, 0xd7c, 0x3b, 0xd05, 0xd2c, 0xd3e, 0xd7b, 0x3b, 0xd05, 0xd38, 0xd7c, 0x3b, 0xd21, 0xd46, 0xd2f, 0xd4d, 0x3b, 0xd2c, 0xd39,
+0xd4d, 0x200c, 0xd2e, 0xd3e, 0xd7b, 0x3b, 0xd0e, 0xd38, 0xd4d, 0x200c, 0xd2b, 0xd3e, 0xd7b, 0xd21, 0xd4d, 0x3b, 0xd2b, 0x2e, 0x3b, 0xd13,
+0x2e, 0x3b, 0xd16, 0xd4b, 0x3b, 0xd1f, 0xd3f, 0x2e, 0x3b, 0xd2e, 0xd4b, 0x2e, 0x3b, 0xd37, 0x2e, 0x3b, 0xd2e, 0xd46, 0x2e, 0x3b,
+0xd05, 0x2e, 0x3b, 0xd05, 0x2e, 0x3b, 0xd21, 0xd46, 0x2e, 0x3b, 0xd2c, 0x2e, 0x3b, 0xd0e, 0x2e, 0x3b, 0x92b, 0x930, 0x935, 0x930,
+0x926, 0x93f, 0x928, 0x3b, 0x913, 0x930, 0x94d, 0x926, 0x93f, 0x92c, 0x947, 0x939, 0x947, 0x936, 0x94d, 0x924, 0x3b, 0x916, 0x94b, 0x930,
+0x926, 0x93e, 0x926, 0x3b, 0x924, 0x93f, 0x930, 0x3b, 0x92e, 0x94b, 0x930, 0x926, 0x93e, 0x926, 0x3b, 0x936, 0x93e, 0x939, 0x930, 0x940,
+0x935, 0x93e, 0x930, 0x3b, 0x92e, 0x947, 0x939, 0x947, 0x930, 0x3b, 0x905, 0x92c, 0x93e, 0x928, 0x3b, 0x905, 0x91d, 0x93e, 0x930, 0x3b,
+0x926, 0x947, 0x3b, 0x92c, 0x93e, 0x939, 0x92e, 0x93e, 0x928, 0x3b, 0x90f, 0x938, 0x92b, 0x93e, 0x902, 0x926, 0x3b, 0x967, 0x3b, 0x968,
+0x3b, 0x969, 0x3b, 0x96a, 0x3b, 0x96b, 0x3b, 0x96c, 0x3b, 0x96d, 0x3b, 0x96e, 0x3b, 0x96f, 0x3b, 0x967, 0x966, 0x3b, 0x967, 0x967,
+0x3b, 0x967, 0x968, 0x3b, 0x648, 0x631, 0x6cc, 0x3b, 0x63a, 0x648, 0x6cc, 0x6cc, 0x3b, 0x63a, 0x628, 0x631, 0x6af, 0x648, 0x644, 0x6cc,
+0x3b, 0x686, 0x646, 0x6af, 0x627, 0x69a, 0x3b, 0x632, 0x645, 0x631, 0x6cc, 0x3b, 0x648, 0x696, 0x6cc, 0x3b, 0x62a, 0x644, 0x647, 0x3b,
+0x644, 0x693, 0x645, 0x3b, 0x644, 0x6cc, 0x646, 0x62f, 0x6cd, 0x3b, 0x645, 0x631, 0x63a, 0x648, 0x645, 0x6cc, 0x3b, 0x633, 0x644, 0x648,
+0x627, 0x63a, 0x647, 0x3b, 0x6a9, 0x628, 0x3b, 0x6f1, 0x3b, 0x6f2, 0x3b, 0x6f3, 0x3b, 0x6f4, 0x3b, 0x6f5, 0x3b, 0x6f6, 0x3b, 0x6f7,
+0x3b, 0x6f8, 0x3b, 0x6f9, 0x3b, 0x6f1, 0x6f0, 0x3b, 0x6f1, 0x6f1, 0x3b, 0x6f1, 0x6f2, 0x3b, 0x641, 0x631, 0x648, 0x631, 0x62f, 0x6cc,
+0x646, 0x3b, 0x627, 0x631, 0x62f, 0x6cc, 0x628, 0x647, 0x634, 0x62a, 0x3b, 0x62e, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x62a, 0x6cc, 0x631,
+0x3b, 0x645, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x634, 0x647, 0x631, 0x6cc, 0x648, 0x631, 0x3b, 0x645, 0x647, 0x631, 0x3b, 0x622, 0x628,
+0x627, 0x646, 0x3b, 0x622, 0x630, 0x631, 0x3b, 0x62f, 0x6cc, 0x3b, 0x628, 0x647, 0x645, 0x646, 0x3b, 0x627, 0x633, 0x641, 0x646, 0x62f,
+0x3b, 0x641, 0x3b, 0x627, 0x3b, 0x62e, 0x3b, 0x62a, 0x3b, 0x645, 0x3b, 0x634, 0x3b, 0x645, 0x3b, 0x622, 0x3b, 0x622, 0x3b, 0x62f,
+0x3b, 0x628, 0x3b, 0x627, 0x3b, 0x62d, 0x3b, 0x62b, 0x3b, 0x62c, 0x3b, 0x633, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x645, 0x3b, 0x639,
+0x3b, 0x642, 0x3b, 0x62c, 0x3b, 0x62f, 0x3b, 0x62d, 0x3b, 0x62d, 0x645, 0x644, 0x3b, 0x62b, 0x648, 0x631, 0x3b, 0x62c, 0x648, 0x632,
+0x627, 0x3b, 0x633, 0x631, 0x637, 0x627, 0x646, 0x3b, 0x627, 0x633, 0x62f, 0x3b, 0x633, 0x646, 0x628, 0x644, 0x647, 0x654, 0x3b, 0x645,
+0x6cc, 0x632, 0x627, 0x646, 0x3b, 0x639, 0x642, 0x631, 0x628, 0x3b, 0x642, 0x648, 0x633, 0x3b, 0x62c, 0x62f, 0x6cc, 0x3b, 0x62f, 0x644,
+0x648, 0x3b, 0x62d, 0x648, 0x62a, 0x3b, 0x46, 0x61, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69,
+0x62, 0x65, 0x68, 0x65, 0x73, 0x7a, 0x74, 0x3b, 0x43, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b,
+0x4d, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x53, 0x7a, 0x61, 0x68, 0x72, 0x69, 0x77, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68,
+0x72, 0x3b, 0x100, 0x62, 0x101, 0x6e, 0x3b, 0x100, 0x73, 0x61, 0x72, 0x3b, 0x44, 0xe9, 0x69, 0x3b, 0x42, 0x61, 0x68, 0x6d,
+0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0xa2b, 0xa3e, 0xa30, 0xa35, 0xa30, 0xa21, 0xa40, 0xa28, 0x3b, 0xa14,
+0xa30, 0xa21, 0xa3e, 0xa08, 0xa2c, 0xa39, 0xa48, 0xa38, 0xa3c, 0xa1f, 0x3b, 0xa16, 0xa4b, 0xa21, 0xa30, 0xa21, 0x3b, 0xa1f, 0xa3f, 0xa30,
+0x3b, 0xa2e, 0xa4b, 0xa30, 0xa21, 0xa3e, 0xa26, 0x3b, 0xa38, 0xa3c, 0xa30, 0xa3e, 0xa07, 0xa35, 0xa30, 0x3b, 0xa2e, 0xa47, 0xa39, 0xa30,
+0x3b, 0xa05, 0xa2c, 0xa3e, 0xa28, 0x3b, 0xa05, 0xa1c, 0xa3c, 0xa3e, 0xa30, 0x3b, 0xa21, 0xa47, 0xa05, 0x3b, 0xa2c, 0xa3e, 0xa39, 0xa2e,
+0xa28, 0x3b, 0xa10, 0xa38, 0xa2b, 0xa70, 0xa21, 0x3b, 0x46, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72,
+0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x68, 0x74, 0x3b, 0x4b, 0x68, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x54, 0x69,
+0x72, 0x3b, 0x41, 0x2d, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x53, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72,
+0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e, 0x3b, 0x41, 0x7a, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b,
+0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440,
+0x434, 0x438, 0x43d, 0x3b, 0x43e, 0x440, 0x434, 0x438, 0x431, 0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x445, 0x43e, 0x440, 0x434, 0x430,
+0x434, 0x3b, 0x442, 0x438, 0x440, 0x3b, 0x43c, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x448, 0x430, 0x445, 0x440, 0x438, 0x432, 0x435,
+0x440, 0x3b, 0x43c, 0x435, 0x445, 0x440, 0x3b, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439,
+0x3b, 0x431, 0x430, 0x445, 0x43c, 0x430, 0x43d, 0x3b, 0x44d, 0x441, 0x444, 0x430, 0x43d, 0x434, 0x3b, 0x424, 0x430, 0x440, 0x430, 0x432,
+0x430, 0x434, 0x438, 0x43d, 0x3b, 0x41e, 0x440, 0x434, 0x438, 0x431, 0x435, 0x445, 0x435, 0x448, 0x442, 0x3b, 0x41a, 0x43e, 0x440, 0x434,
+0x430, 0x434, 0x3b, 0x422, 0x438, 0x440, 0x3b, 0x41c, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x428, 0x430, 0x445, 0x440, 0x438, 0x432,
+0x430, 0x440, 0x3b, 0x41c, 0x435, 0x445, 0x440, 0x3b, 0x410, 0x431, 0x430, 0x43d, 0x3b, 0x410, 0x437, 0x430, 0x440, 0x3b, 0x414, 0x435,
+0x458, 0x3b, 0x411, 0x430, 0x445, 0x43c, 0x430, 0x43d, 0x3b, 0x415, 0x441, 0x444, 0x430, 0x43d, 0x434, 0x3b, 0x46, 0x61, 0x72, 0x61,
+0x76, 0x61, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x161, 0x74, 0x3b, 0x4b, 0x6f, 0x72,
+0x64, 0x61, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x160, 0x61, 0x68, 0x72, 0x69,
+0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e, 0x3b, 0x41, 0x7a, 0x61, 0x72, 0x3b, 0x44,
+0x65, 0x6a, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64, 0x3b, 0x46, 0x61, 0x72,
+0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73, 0x68, 0x74, 0x3b, 0x4b,
+0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x53, 0x68,
+0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x68, 0x72, 0x3b, 0x100, 0x62, 0x101, 0x6e, 0x3b, 0x100, 0x7a,
+0x61, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x61, 0x6e, 0x64,
+0x3b, 0x66, 0x61, 0x72, 0x76, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x3b, 0x6f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x73,
+0x68, 0x74, 0x3b, 0x6b, 0x68, 0x6f, 0x72, 0x64, 0x101, 0x64, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x64, 0x101,
+0x64, 0x3b, 0x73, 0x68, 0x61, 0x68, 0x72, 0x69, 0x76, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x68, 0x72, 0x3b, 0x101, 0x62, 0x101,
+0x6e, 0x3b, 0x101, 0x7a, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x79, 0x3b, 0x62, 0x61, 0x68, 0x6d, 0x61, 0x6e, 0x3b, 0x65, 0x73,
+0x66, 0x61, 0x6e, 0x64, 0x3b, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x438, 0x43d, 0x3b, 0x443, 0x440, 0x434, 0x438, 0x431,
+0x438, 0x4b3, 0x438, 0x448, 0x442, 0x3b, 0x445, 0x443, 0x440, 0x434, 0x43e, 0x434, 0x3b, 0x442, 0x438, 0x440, 0x3b, 0x43c, 0x443, 0x440,
+0x434, 0x43e, 0x434, 0x3b, 0x448, 0x430, 0x4b3, 0x440, 0x438, 0x432, 0x430, 0x440, 0x3b, 0x43c, 0x435, 0x4b3, 0x440, 0x3b, 0x43e, 0x431,
+0x43e, 0x43d, 0x3b, 0x43e, 0x437, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x4b3, 0x43c, 0x430, 0x43d, 0x3b, 0x438,
+0x441, 0x444, 0x430, 0x43d, 0x434, 0x3b, 0xb83, 0xbaa, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xb86, 0xbb0, 0xbcd, 0xb9f, 0xbbf, 0x2e, 0x3b, 0xb95,
+0xbca, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xba4, 0xbbf, 0xbb0, 0xbcd, 0x3b, 0xbae, 0xbca, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xbb7, 0xbbe, 0xbb0, 0xbbf,
+0x2e, 0x3b, 0xbae, 0xbc6, 0xbb9, 0xbcd, 0x2e, 0x3b, 0xb85, 0xbaa, 0xbbe, 0x2e, 0x3b, 0xb85, 0xb9a, 0xbbe, 0x2e, 0x3b, 0xba4, 0xbc7,
+0x3b, 0xbaa, 0xbb9, 0xbcd, 0x2e, 0x3b, 0xb8e, 0xb83, 0x2e, 0x3b, 0xb83, 0xbaa, 0xbb0, 0xbcd, 0xbb5, 0xbbe, 0xba4, 0xbbf, 0xba9, 0xbcd,
+0x3b, 0xb86, 0xbb0, 0xbcd, 0xb9f, 0xbbf, 0xbaa, 0xbc6, 0xbb9, 0xbc6, 0xbb7, 0xbcd, 0xba4, 0xbcd, 0x3b, 0xb95, 0xbca, 0xbb0, 0xbcd, 0xba4,
+0xbbe, 0xba4, 0xbcd, 0x3b, 0xba4, 0xbbf, 0xbb0, 0xbcd, 0x3b, 0xbae, 0xbca, 0xbb0, 0xbcd, 0xba4, 0xbbe, 0xba4, 0xbcd, 0x3b, 0xbb7, 0xbbe,
+0xbb0, 0xbbf, 0xbb5, 0xbbe, 0xbb0, 0xbcd, 0x3b, 0xbae, 0xbc6, 0xbb9, 0xbcd, 0xbb0, 0xbcd, 0x3b, 0xb85, 0xbaa, 0xbbe, 0xba9, 0xbcd, 0x3b,
+0xb85, 0xb9a, 0xbbe, 0xbb0, 0xbcd, 0x3b, 0xba4, 0xbc7, 0x3b, 0xbaa, 0xbb9, 0xbcd, 0xbae, 0xbbe, 0xba9, 0xbcd, 0x3b, 0xb8e, 0xb83, 0xbaa,
+0xbbe, 0xba9, 0xbcd, 0x3b, 0xc2b, 0xc3e, 0xc35, 0xc30, 0xc4d, 0xc21, 0xc3f, 0xc28, 0xc4d, 0x3b, 0xc0a, 0xc21, 0xc3e, 0xc2c, 0xc39, 0xc37,
+0xc4d, 0xc1f, 0xc4d, 0x3b, 0xc16, 0xc4b, 0xc30, 0xc4d, 0xc21, 0xc3e, 0xc21, 0xc4d, 0x3b, 0xc1f, 0xc3f, 0xc30, 0xc4d, 0x3b, 0xc2e, 0xc46,
+0xc30, 0xc4d, 0xc21, 0xc3e, 0xc21, 0xc4d, 0x3b, 0xc36, 0xc36, 0xc3f, 0xc35, 0xc30, 0xc4d, 0x3b, 0xc2e, 0xc46, 0xc39, 0xc30, 0xc4d, 0x3b,
+0xc05, 0xc2c, 0xc28, 0xc4d, 0x3b, 0xc05, 0xc1c, 0xc30, 0xc4d, 0x3b, 0xc21, 0xc47, 0x3b, 0xc2c, 0xc3e, 0xc39, 0xc4d, 0x200c, 0xc2e, 0xc3e,
+0xc28, 0xc4d, 0x3b, 0xc0e, 0xc38, 0xc4d, 0x200c, 0xc2b, 0xc3e, 0xc02, 0xc21, 0xc4d, 0x3b, 0xe1f, 0xe32, 0xe23, 0xe4c, 0xe27, 0xe32, 0xe23,
+0xe4c, 0xe14, 0xe34, 0xe19, 0x3b, 0xe2d, 0xe2d, 0xe23, 0xe4c, 0xe14, 0xe34, 0xe40, 0xe1a, 0xe40, 0xe2e, 0xe0a, 0xe15, 0xe4c, 0x3b, 0xe04,
+0xe2d, 0xe23, 0xe4c, 0xe41, 0xe14, 0xe14, 0x3b, 0xe40, 0xe15, 0xe2d, 0xe23, 0xe4c, 0x3b, 0xe21, 0xe2d, 0xe23, 0xe4c, 0xe41, 0xe14, 0xe14,
+0x3b, 0xe0a, 0xe32, 0xe2b, 0xe23, 0xe34, 0xe27, 0xe32, 0xe23, 0xe4c, 0x3b, 0xe40, 0xe21, 0xe2e, 0xe23, 0xe4c, 0x3b, 0xe2d, 0xe30, 0xe1a,
+0xe32, 0xe19, 0x3b, 0xe2d, 0xe30, 0xe0b, 0xe32, 0xe23, 0xe4c, 0x3b, 0xe40, 0xe14, 0xe22, 0xe4c, 0x3b, 0xe1a, 0xe32, 0xe2e, 0xe4c, 0xe21,
+0xe32, 0xe19, 0x3b, 0xe40, 0xe2d, 0xe2a, 0xe1f, 0xe32, 0xe19, 0xe14, 0xe4c, 0x3b, 0x46, 0x65, 0x72, 0x76, 0x65, 0x72, 0x64, 0x69,
+0x6e, 0x3b, 0x4f, 0x72, 0x64, 0x69, 0x62, 0x65, 0x68, 0x65, 0x15f, 0x74, 0x3b, 0x48, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b,
+0x54, 0x69, 0x72, 0x3b, 0x4d, 0x6f, 0x72, 0x64, 0x61, 0x64, 0x3b, 0x15e, 0x65, 0x68, 0x72, 0x69, 0x76, 0x65, 0x72, 0x3b,
+0x4d, 0x65, 0x68, 0x72, 0x3b, 0x41, 0x62, 0x61, 0x6e, 0x3b, 0x41, 0x7a, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x79, 0x3b, 0x42,
+0x65, 0x68, 0x6d, 0x65, 0x6e, 0x3b, 0x45, 0x73, 0x66, 0x65, 0x6e, 0x64, 0x3b, 0x444, 0x430, 0x440, 0x3b, 0x43e, 0x440, 0x434,
+0x3b, 0x445, 0x43e, 0x440, 0x3b, 0x442, 0x456, 0x440, 0x3b, 0x43c, 0x43e, 0x440, 0x3b, 0x448, 0x430, 0x445, 0x3b, 0x43c, 0x435, 0x445,
+0x3b, 0x430, 0x431, 0x430, 0x43d, 0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x3b, 0x435,
+0x441, 0x444, 0x3b, 0x444, 0x430, 0x440, 0x432, 0x430, 0x440, 0x434, 0x456, 0x43d, 0x3b, 0x43e, 0x440, 0x434, 0x456, 0x431, 0x435, 0x445,
+0x435, 0x448, 0x442, 0x3b, 0x445, 0x43e, 0x440, 0x434, 0x430, 0x434, 0x3b, 0x442, 0x456, 0x440, 0x3b, 0x43c, 0x43e, 0x440, 0x434, 0x430,
+0x434, 0x3b, 0x448, 0x430, 0x445, 0x440, 0x456, 0x432, 0x435, 0x440, 0x3b, 0x43c, 0x435, 0x445, 0x440, 0x3b, 0x430, 0x431, 0x430, 0x43d,
+0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x43c, 0x430, 0x43d, 0x3b, 0x435, 0x441, 0x444,
+0x430, 0x43d, 0x434, 0x3b, 0x444, 0x430, 0x440, 0x2e, 0x3b, 0x43e, 0x440, 0x434, 0x2e, 0x3b, 0x445, 0x43e, 0x440, 0x2e, 0x3b, 0x442,
+0x456, 0x440, 0x3b, 0x43c, 0x43e, 0x440, 0x2e, 0x3b, 0x448, 0x430, 0x445, 0x2e, 0x3b, 0x43c, 0x435, 0x445, 0x2e, 0x3b, 0x430, 0x431,
+0x430, 0x43d, 0x3b, 0x430, 0x437, 0x435, 0x440, 0x3b, 0x434, 0x435, 0x439, 0x3b, 0x431, 0x430, 0x445, 0x2e, 0x3b, 0x435, 0x441, 0x444,
+0x2e, 0x3b, 0x641, 0x631, 0x648, 0x631, 0x62f, 0x646, 0x3b, 0x622, 0x631, 0x688, 0x628, 0x627, 0x626, 0x634, 0x3b, 0x62e, 0x62f, 0x627,
+0x62f, 0x627, 0x62f, 0x3b, 0x62a, 0x6cc, 0x631, 0x3b, 0x645, 0x631, 0x62f, 0x627, 0x62f, 0x3b, 0x634, 0x6c1, 0x631, 0x6cc, 0x648, 0x627,
+0x631, 0x3b, 0x645, 0x6c1, 0x631, 0x3b, 0x627, 0x628, 0x627, 0x646, 0x3b, 0x622, 0x632, 0x631, 0x3b, 0x688, 0x6d2, 0x3b, 0x628, 0x6c1,
+0x645, 0x646, 0x3b, 0x627, 0x633, 0x641, 0x646, 0x62f, 0x3b, 0x64, 0x7a, 0x76, 0x3b, 0x64, 0x7a, 0x64, 0x3b, 0x74, 0x65, 0x64,
+0x3b, 0x61, 0x66, 0x254, 0x3b, 0x64, 0x61, 0x6d, 0x3b, 0x6d, 0x61, 0x73, 0x3b, 0x73, 0x69, 0x61, 0x3b, 0x64, 0x65, 0x61,
+0x3b, 0x61, 0x6e, 0x79, 0x3b, 0x6b, 0x65, 0x6c, 0x3b, 0x61, 0x64, 0x65, 0x3b, 0x64, 0x7a, 0x6d, 0x3b, 0x64, 0x7a, 0x6f,
+0x76, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x64, 0x7a, 0x65, 0x3b, 0x74, 0x65, 0x64, 0x6f, 0x78, 0x65, 0x3b, 0x61, 0x66, 0x254,
+0x66, 0x69, 0x1ebd, 0x3b, 0x64, 0x61, 0x6d, 0x25b, 0x3b, 0x6d, 0x61, 0x73, 0x61, 0x3b, 0x73, 0x69, 0x61, 0x6d, 0x6c, 0x254,
+0x6d, 0x3b, 0x64, 0x65, 0x61, 0x73, 0x69, 0x61, 0x6d, 0x69, 0x6d, 0x65, 0x3b, 0x61, 0x6e, 0x79, 0x254, 0x6e, 0x79, 0x254,
+0x3b, 0x6b, 0x65, 0x6c, 0x65, 0x3b, 0x61, 0x64, 0x65, 0x25b, 0x6d, 0x65, 0x6b, 0x70, 0x254, 0x78, 0x65, 0x3b, 0x64, 0x7a,
+0x6f, 0x6d, 0x65, 0x3b, 0x62e, 0x627, 0x6a9, 0x6d5, 0x644, 0x6ce, 0x648, 0x6d5, 0x3b, 0x628, 0x627, 0x646, 0x6d5, 0x645, 0x6d5, 0x695,
+0x3b, 0x62c, 0x6c6, 0x632, 0x6d5, 0x631, 0x62f, 0x627, 0x646, 0x3b, 0x67e, 0x648, 0x648, 0x634, 0x67e, 0x6d5, 0x695, 0x3b, 0x6af, 0x6d5,
+0x644, 0x627, 0x648, 0x6ce, 0x698, 0x3b, 0x62e, 0x6d5, 0x631, 0x645, 0x627, 0x646, 0x627, 0x646, 0x3b, 0x695, 0x6d5, 0x632, 0x628, 0x6d5,
+0x631, 0x3b, 0x62e, 0x6d5, 0x632, 0x6d5, 0x6b5, 0x648, 0x6d5, 0x631, 0x3b, 0x633, 0x6d5, 0x631, 0x645, 0x627, 0x648, 0x6d5, 0x632, 0x3b,
+0x628, 0x6d5, 0x641, 0x631, 0x627, 0x646, 0x628, 0x627, 0x631, 0x3b, 0x695, 0x6ce, 0x628, 0x6d5, 0x646, 0x62f, 0x627, 0x646, 0x3b, 0x631,
+0x6d5, 0x634, 0x6d5, 0x645, 0x6ce, 0x3b
+};
+// GENERATED PART ENDS HERE
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/corelib/time/qjalalicalendar_p.h b/src/corelib/time/qjalalicalendar_p.h
new file mode 100644
index 0000000000..5b94dada9f
--- /dev/null
+++ b/src/corelib/time/qjalalicalendar_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QJALALI_CALENDAR_P_H
+#define QJALALI_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qcalendarbackend_p.h"
+
+QT_REQUIRE_CONFIG(jalalicalendar);
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QJalaliCalendar : public QCalendarBackend
+{
+public:
+ QJalaliCalendar();
+ // Calendar properties:
+ QString name() const override;
+ QCalendar::System calendarSystem() const override;
+ // Date queries:
+ int daysInMonth(int month, int year = QCalendar::Unspecified) const override;
+ bool isLeapYear(int year) const override;
+ // Properties of the calendar
+ bool isLunar() const override;
+ bool isLuniSolar() const override;
+ bool isSolar() const override;
+ // Julian Day conversions:
+ bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
+ QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
+
+protected:
+ // locale support:
+ const QCalendarLocale *localeMonthIndexData() const override;
+ const ushort *localeMonthData() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QJALALI_CALENDAR_P_H
diff --git a/src/corelib/time/qjuliancalendar.cpp b/src/corelib/time/qjuliancalendar.cpp
new file mode 100644
index 0000000000..8c6818eb31
--- /dev/null
+++ b/src/corelib/time/qjuliancalendar.cpp
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+#include "qjuliancalendar_p.h"
+#include "qromancalendar_data_p.h"
+#include "qcalendarmath_p.h"
+#include <QtCore/qmath.h>
+#include <QtCore/qlocale.h>
+#include <QtCore/qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QRoundingDown;
+
+/*!
+ \since 5.14
+
+ \class QJulianCalendar
+ \inmodule QtCore
+ \brief The QJulianCalendar class provides Julian calendar system
+ implementation.
+
+ \section1 Julian Calendar
+
+ The Julian calendar, proposed by Julius Caesar in 46 BC (708 AUC), was a
+ reform of the Roman calendar. It took effect on 1 January 45 BC (AUC 709),
+ by edict. It was the predominant calendar in the Roman world, most of
+ Europe, and in European settlements in the Americas and elsewhere, until it
+ was refined and gradually replaced by the Gregorian calendar,
+ promulgated in 1582 by Pope Gregory XIII.
+
+ The Julian calendar gains against the mean tropical year at the rate of one
+ day in 128 years. For the Gregorian calendar, the figure is one day in
+ 3030 years. The difference in the average length of the year
+ between Julian (365.25 days) and Gregorian (365.2425 days) is 0.002%.
+
+ Source: \l {https://en.wikipedia.org/wiki/Julian_calendar}{Wikipedia page on
+ Julian Calendar}
+ */
+
+QJulianCalendar::QJulianCalendar()
+ : QRomanCalendar(QStringLiteral("Julian"), QCalendar::System::Julian) {}
+
+QString QJulianCalendar::name() const
+{
+ return QStringLiteral("Julian");
+}
+
+QCalendar::System QJulianCalendar::calendarSystem() const
+{
+ return QCalendar::System::Julian;
+}
+
+bool QJulianCalendar::isLeapYear(int year) const
+{
+ if (year == QCalendar::Unspecified || !year)
+ return false;
+
+ return qMod(year < 0 ? year + 1 : year, 4) == 0;
+}
+
+// Julian Day 0 was January the first in the proleptic Julian calendar's 4713 BC
+
+bool QJulianCalendar::dateToJulianDay(int year, int month, int day, qint64 *jd) const
+{
+ Q_ASSERT(jd);
+ if (!isDateValid(year, month, day))
+ return false;
+ if (year < 0)
+ ++year;
+ const qint64 c0 = month < 3 ? -1 : 0;
+ const qint64 j1 = qDiv(1461 * (year + c0), 4);
+ const qint64 j2 = qDiv(153 * month - 1836 * c0 - 457, 5);
+ *jd = j1 + j2 + day + 1721117;
+ return true;
+}
+
+QCalendar::YearMonthDay QJulianCalendar::julianDayToDate(qint64 jd) const
+{
+ const qint64 y2 = jd - 1721118;
+ const qint64 k2 = 4 * y2 + 3;
+ const qint64 k1 = 5 * qDiv(qMod(k2, 1461), 4) + 2;
+ const qint64 x1 = qDiv(k1, 153);
+ const qint64 c0 = qDiv(x1 + 2, 12);
+ const int y = qint16(qDiv(k2, 1461) + c0);
+ const int month = quint8(x1 - 12 * c0 + 3);
+ const int day = qDiv(qMod(k1, 153), 5) + 1;
+ return QCalendar::YearMonthDay(y > 0 ? y : y - 1, month, day);
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qjuliancalendar_p.h b/src/corelib/time/qjuliancalendar_p.h
new file mode 100644
index 0000000000..104cf6aa30
--- /dev/null
+++ b/src/corelib/time/qjuliancalendar_p.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QJULIAN_CALENDAR_P_H
+#define QJULIAN_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qromancalendar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QJulianCalendar : public QRomanCalendar
+{
+public:
+ QJulianCalendar();
+ // Calendar properties:
+ QString name() const override;
+ QCalendar::System calendarSystem() const override;
+ // Date queries:
+ bool isLeapYear(int year) const override;
+ // Julian Day conversions:
+ bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
+ QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QJULIAN_CALENDAR_P_H
diff --git a/src/corelib/time/qmilankoviccalendar.cpp b/src/corelib/time/qmilankoviccalendar.cpp
new file mode 100644
index 0000000000..673713a266
--- /dev/null
+++ b/src/corelib/time/qmilankoviccalendar.cpp
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+#include "qmilankoviccalendar_p.h"
+#include "qcalendarmath_p.h"
+#include <QtCore/qmath.h>
+#include <QtCore/qlocale.h>
+#include <QtCore/qdatetime.h>
+
+QT_BEGIN_NAMESPACE
+
+using namespace QRoundingDown;
+
+/*!
+ \since 5.14
+
+ \class QMilankovicCalendar
+ \inmodule QtCore
+ \brief The QMilankovicCalendar class provides Milanković calendar system
+ implementation.
+
+ The Revised Julian calendar, also known as the Milanković calendar, or,
+ less formally, new calendar, is a calendar, developed and proposed by the
+ Serbian scientist Milutin Milanković in 1923, which effectively discontinued
+ the 340 years of divergence between the naming of dates sanctioned by those
+ Eastern Orthodox churches adopting it and the Gregorian calendar that has
+ come to predominate worldwide. This calendar was intended to replace the
+ ecclesiastical calendar based on the Julian calendar hitherto in use by all
+ of the Eastern Orthodox Church. The Revised Julian calendar temporarily
+ aligned its dates with the Gregorian calendar proclaimed in 1582 by Pope
+ Gregory XIII for adoption by the Christian world. The calendar has been
+ adopted by the Orthodox churches of Constantinople, Albania, Alexandria,
+ Antioch, Bulgaria, Cyprus, Greece, Poland, and Romania.
+
+ Source: \l {https://en.wikipedia.org/wiki/Revised_Julian_calendar}{Wikipedia
+ page on Milanković Calendar}
+ */
+
+QMilankovicCalendar::QMilankovicCalendar()
+ : QRomanCalendar(QStringLiteral("Milankovic"), QCalendar::System::Milankovic) {}
+
+QString QMilankovicCalendar::name() const
+{
+ return QStringLiteral("Milankovic");
+}
+
+QCalendar::System QMilankovicCalendar::calendarSystem() const
+{
+ return QCalendar::System::Milankovic;
+}
+
+bool QMilankovicCalendar::isLeapYear(int year) const
+{
+ if (year == QCalendar::Unspecified)
+ return false;
+ if (year <= 0)
+ ++year;
+ if (qMod(year, 4))
+ return false;
+ if (qMod(year, 100) == 0) {
+ const qint16 century = qMod(qDiv(year, 100), 9);
+ if (century != 2 && century != 6)
+ return false;
+ }
+ return true;
+}
+
+bool QMilankovicCalendar::dateToJulianDay(int year, int month, int day, qint64 *jd) const
+{
+ Q_ASSERT(jd);
+ if (!isDateValid(year, month, day))
+ return false;
+ if (year <= 0)
+ ++year;
+ const qint16 c0 = month < 3 ? -1 : 0;
+ const qint16 x1 = month - 12 * c0 - 3;
+ const qint16 x4 = year + c0;
+ const qint16 x3 = qDiv(x4, 100);
+ const qint16 x2 = qMod(x4, 100);
+ *jd = qDiv(328718 * x3 + 6, 9)
+ + qDiv(36525 * x2 , 100)
+ + qDiv(153 * x1 + 2 , 5)
+ + day + 1721119;
+ return true;
+}
+
+QCalendar::YearMonthDay QMilankovicCalendar::julianDayToDate(qint64 jd) const
+{
+ const qint64 k3 = 9 * (jd - 1721120) + 2;
+ const qint64 x3 = qDiv(k3, 328718);
+ const qint64 k2 = 100 * qDiv(qMod(k3, 328718), 9) + 99;
+ const qint64 k1 = qDiv(qMod(k2, 36525), 100) * 5 + 2;
+ const qint64 x2 = qDiv(k2, 36525);
+ const qint64 x1 = qDiv(5 * qDiv(qMod(k2, 36525), 100) + 2, 153);
+ const qint64 c0 = qDiv(x1 + 2, 12);
+ const int y = 100 * x3 + x2 + c0;
+ const int month = x1 - 12 * c0 + 3;
+ const int day = qDiv(qMod(k1, 153), 5) + 1;
+ return QCalendar::YearMonthDay(y > 0 ? y : y - 1, month, day);
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qmilankoviccalendar_p.h b/src/corelib/time/qmilankoviccalendar_p.h
new file mode 100644
index 0000000000..ebff7e7f39
--- /dev/null
+++ b/src/corelib/time/qmilankoviccalendar_p.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QMILANKOVICCALENDAR_CALENDAR_P_H
+#define QMILANKOVICCALENDAR_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qromancalendar_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QMilankovicCalendar : public QRomanCalendar
+{
+public:
+ QMilankovicCalendar();
+ // Calendar properties:
+ QString name() const override;
+ QCalendar::System calendarSystem() const override;
+ // Date queries:
+ bool isLeapYear(int year) const override;
+ // Julian Day conversions:
+ bool dateToJulianDay(int year, int month, int day, qint64 *jd) const override;
+ QCalendar::YearMonthDay julianDayToDate(qint64 jd) const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMILANKOVICCALENDAR_CALENDAR_P_H
diff --git a/src/corelib/time/qromancalendar.cpp b/src/corelib/time/qromancalendar.cpp
new file mode 100644
index 0000000000..c3cd134490
--- /dev/null
+++ b/src/corelib/time/qromancalendar.cpp
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qglobal.h"
+#include "qromancalendar_p.h"
+#include "qromancalendar_data_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \since 5.14
+
+ \class QRomanCalendar
+ \inmodule QtCore
+ \brief The QRomanCalendar class is a shared base for calendars based on the
+ ancient Roman calendar.
+
+ \section1
+
+ Calendars based on the ancient Roman calendar share the names of months,
+ whose lengths depend in a common way on whether the year is a leap
+ year. They differ in how they determine which years are leap years.
+
+ \sa QGregorianCalendar, QJulianCalendar, QMilankovicCalendar
+*/
+
+int QRomanCalendar::daysInMonth(int month, int year) const
+{
+ if (!year || month < 1 || month > 12)
+ return 0;
+
+ if (month == 2)
+ return isLeapYear(year) ? 29 : 28;
+
+ // Long if odd up to July = 7, or if even from 8 = August onwards:
+ return 30 | ((month & 1) ^ (month >> 3));
+}
+
+int QRomanCalendar::minimumDaysInMonth() const
+{
+ return 28;
+}
+
+bool QRomanCalendar::isLunar() const
+{
+ return false;
+}
+
+bool QRomanCalendar::isLuniSolar() const
+{
+ return false;
+}
+
+bool QRomanCalendar::isSolar() const
+{
+ return true;
+}
+
+const QCalendarLocale *QRomanCalendar::localeMonthIndexData() const
+{
+ return locale_data;
+}
+
+const ushort *QRomanCalendar::localeMonthData() const
+{
+ return months_data;
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/time/qromancalendar_data_p.h b/src/corelib/time/qromancalendar_data_p.h
new file mode 100644
index 0000000000..37ac0be07d
--- /dev/null
+++ b/src/corelib/time/qromancalendar_data_p.h
@@ -0,0 +1,2661 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QROMANCALENDAR_DATA_P_H
+#define QROMANCALENDAR_DATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
+// file may change from version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+#include <QtCore/private/qcalendarbackend_p.h>
+
+QT_BEGIN_NAMESPACE
+
+// GENERATED PART STARTS HERE
+
+/*
+ This part of the file was generated on 2019-10-24 from the
+ Common Locale Data Repository v36
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this section: instead regenerate it using
+ cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+static const QCalendarLocale locale_data[] = {
+ // lang script terr sShort sLong sNarrow short long narrow
+ { 1, 0, 0,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 158,29 }}, // C/AnyScript/AnyCountry
+ { 3, 7, 69,{ 187,48 },{ 235,111 },{ 134,24 },{ 187,48 },{ 235,111 },{ 134,24 }}, // Oromo/Latin/Ethiopia
+ { 3, 7, 111,{ 187,48 },{ 235,111 },{ 346,24 },{ 187,48 },{ 235,111 },{ 134,24 }}, // Oromo/Latin/Kenya
+ { 4, 7, 69,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Afar/Latin/Ethiopia
+ { 5, 7, 195,{ 445,59 },{ 504,92 },{ 134,24 },{ 445,59 },{ 504,92 },{ 134,24 }}, // Afrikaans/Latin/South Africa
+ { 5, 7, 148,{ 445,59 },{ 504,92 },{ 134,24 },{ 445,59 },{ 504,92 },{ 134,24 }}, // Afrikaans/Latin/Namibia
+ { 6, 7, 2,{ 596,50 },{ 646,78 },{ 724,27 },{ 596,50 },{ 646,78 },{ 724,27 }}, // Albanian/Latin/Albania
+ { 6, 7, 127,{ 596,50 },{ 646,78 },{ 724,27 },{ 596,50 },{ 646,78 },{ 724,27 }}, // Albanian/Latin/Macedonia
+ { 6, 7, 257,{ 596,50 },{ 646,78 },{ 724,27 },{ 596,50 },{ 646,78 },{ 724,27 }}, // Albanian/Latin/Kosovo
+ { 7, 14, 69,{ 751,46 },{ 797,61 },{ 858,24 },{ 751,46 },{ 797,61 },{ 858,24 }}, // Amharic/Ethiopic/Ethiopia
+ { 8, 1, 64,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Egypt
+ { 8, 1, 3,{ 981,71 },{ 981,71 },{ 1052,24 },{ 981,71 },{ 981,71 },{ 1052,24 }}, // Arabic/Arabic/Algeria
+ { 8, 1, 17,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Bahrain
+ { 8, 1, 42,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Chad
+ { 8, 1, 48,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Comoros
+ { 8, 1, 59,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Djibouti
+ { 8, 1, 67,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Eritrea
+ { 8, 1, 103,{ 1076,92 },{ 1076,92 },{ 1168,24 },{ 1192,92 },{ 1076,92 },{ 1168,24 }}, // Arabic/Arabic/Iraq
+ { 8, 1, 105,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Israel
+ { 8, 1, 109,{ 1076,92 },{ 1076,92 },{ 1168,24 },{ 1076,92 },{ 1076,92 },{ 1168,24 }}, // Arabic/Arabic/Jordan
+ { 8, 1, 115,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Kuwait
+ { 8, 1, 119,{ 1076,92 },{ 1076,92 },{ 1168,24 },{ 1076,92 },{ 1076,92 },{ 1168,24 }}, // Arabic/Arabic/Lebanon
+ { 8, 1, 122,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Libya
+ { 8, 1, 136,{ 1284,72 },{ 1284,72 },{ 1356,24 },{ 1284,72 },{ 1284,72 },{ 1356,24 }}, // Arabic/Arabic/Mauritania
+ { 8, 1, 145,{ 1380,70 },{ 1380,70 },{ 1450,24 },{ 1380,70 },{ 1380,70 },{ 1450,24 }}, // Arabic/Arabic/Morocco
+ { 8, 1, 162,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Oman
+ { 8, 1, 165,{ 1076,92 },{ 1076,92 },{ 1168,24 },{ 1076,92 },{ 1076,92 },{ 1168,24 }}, // Arabic/Arabic/Palestinian Territories
+ { 8, 1, 175,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Qatar
+ { 8, 1, 186,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Saudi Arabia
+ { 8, 1, 194,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Somalia
+ { 8, 1, 201,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Sudan
+ { 8, 1, 207,{ 1076,92 },{ 1076,92 },{ 1168,24 },{ 1076,92 },{ 1076,92 },{ 1168,24 }}, // Arabic/Arabic/Syria
+ { 8, 1, 216,{ 981,71 },{ 981,71 },{ 1052,24 },{ 981,71 },{ 981,71 },{ 1052,24 }}, // Arabic/Arabic/Tunisia
+ { 8, 1, 223,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/United Arab Emirates
+ { 8, 1, 236,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Western Sahara
+ { 8, 1, 237,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/Yemen
+ { 8, 1, 254,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/South Sudan
+ { 8, 1, 260,{ 882,75 },{ 882,75 },{ 957,24 },{ 882,75 },{ 882,75 },{ 957,24 }}, // Arabic/Arabic/World
+ { 9, 10, 11,{ 1474,48 },{ 1522,94 },{ 1616,24 },{ 1474,48 },{ 1640,106 },{ 1616,24 }}, // Armenian/Armenian/Armenia
+ { 10, 11, 100,{ 1746,64 },{ 1810,89 },{ 1899,24 },{ 1746,64 },{ 1810,89 },{ 1899,24 }}, // Assamese/Bengali/India
+ { 12, 7, 15,{ 1923,48 },{ 1971,77 },{ 418,27 },{ 1923,48 },{ 2048,77 },{ 418,27 }}, // Azerbaijani/Latin/Azerbaijan
+ { 12, 1, 102,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Azerbaijani/Arabic/Iran
+ { 12, 2, 15,{ 2125,48 },{ 2173,77 },{ 418,27 },{ 2125,48 },{ 2250,77 },{ 418,27 }}, // Azerbaijani/Cyrillic/Azerbaijan
+ { 13, 2, 178,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Bashkir/Cyrillic/Russia
+ { 14, 7, 197,{ 2327,60 },{ 2387,93 },{ 2480,24 },{ 2327,60 },{ 2387,93 },{ 2480,24 }}, // Basque/Latin/Spain
+ { 15, 11, 18,{ 2504,90 },{ 2504,90 },{ 2594,33 },{ 2627,77 },{ 2504,90 },{ 2594,33 }}, // Bengali/Bengali/Bangladesh
+ { 15, 11, 100,{ 2504,90 },{ 2504,90 },{ 2594,33 },{ 2627,77 },{ 2504,90 },{ 2594,33 }}, // Bengali/Bengali/India
+ { 16, 31, 25,{ 2704,63 },{ 2767,191 },{ 2958,27 },{ 2985,27 },{ 3012,132 },{ 3144,27 }}, // Dzongkha/Tibetan/Bhutan
+ { 19, 7, 74,{ 3171,63 },{ 3234,78 },{ 3312,36 },{ 3171,63 },{ 3234,78 },{ 3312,36 }}, // Breton/Latin/France
+ { 20, 2, 33,{ 3348,49 },{ 3397,82 },{ 3479,24 },{ 3348,49 },{ 3397,82 },{ 3479,24 }}, // Bulgarian/Cyrillic/Bulgaria
+ { 21, 25, 147,{ 3503,43 },{ 3546,88 },{ 3634,24 },{ 3503,43 },{ 3546,88 },{ 3634,24 }}, // Burmese/Myanmar/Myanmar
+ { 22, 2, 20,{ 3658,48 },{ 3706,95 },{ 3801,24 },{ 3825,48 },{ 3873,98 },{ 3801,24 }}, // Belarusian/Cyrillic/Belarus
+ { 23, 20, 36,{ 3971,71 },{ 3971,71 },{ 4042,24 },{ 3971,71 },{ 3971,71 },{ 4042,24 }}, // Khmer/Khmer/Cambodia
+ { 24, 7, 197,{ 4066,60 },{ 4126,82 },{ 4208,36 },{ 4244,93 },{ 4337,115 },{ 4208,36 }}, // Catalan/Latin/Spain
+ { 24, 7, 5,{ 4066,60 },{ 4126,82 },{ 4208,36 },{ 4244,93 },{ 4337,115 },{ 4208,36 }}, // Catalan/Latin/Andorra
+ { 24, 7, 74,{ 4066,60 },{ 4126,82 },{ 4208,36 },{ 4244,93 },{ 4337,115 },{ 4208,36 }}, // Catalan/Latin/France
+ { 24, 7, 106,{ 4066,60 },{ 4126,82 },{ 4208,36 },{ 4244,93 },{ 4337,115 },{ 4208,36 }}, // Catalan/Latin/Italy
+ { 25, 5, 44,{ 4452,39 },{ 4491,38 },{ 418,27 },{ 4452,39 },{ 4491,38 },{ 418,27 }}, // Chinese/Simplified Han/China
+ { 25, 5, 97,{ 4452,39 },{ 4491,38 },{ 418,27 },{ 4452,39 },{ 4491,38 },{ 418,27 }}, // Chinese/Simplified Han/Hong Kong
+ { 25, 5, 126,{ 4452,39 },{ 4491,38 },{ 418,27 },{ 4452,39 },{ 4491,38 },{ 418,27 }}, // Chinese/Simplified Han/Macau
+ { 25, 5, 190,{ 4452,39 },{ 4491,38 },{ 418,27 },{ 4452,39 },{ 4491,38 },{ 418,27 }}, // Chinese/Simplified Han/Singapore
+ { 25, 6, 97,{ 4452,39 },{ 4452,39 },{ 418,27 },{ 4452,39 },{ 4452,39 },{ 418,27 }}, // Chinese/Traditional Han/Hong Kong
+ { 25, 6, 126,{ 4452,39 },{ 4452,39 },{ 418,27 },{ 4452,39 },{ 4452,39 },{ 418,27 }}, // Chinese/Traditional Han/Macau
+ { 25, 6, 208,{ 4452,39 },{ 4452,39 },{ 418,27 },{ 4452,39 },{ 4452,39 },{ 418,27 }}, // Chinese/Traditional Han/Taiwan
+ { 26, 7, 74,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Corsican/Latin/France
+ { 27, 7, 54,{ 4529,49 },{ 4578,94 },{ 4672,39 },{ 4529,49 },{ 4711,98 },{ 4672,39 }}, // Croatian/Latin/Croatia
+ { 27, 7, 27,{ 4529,49 },{ 4578,94 },{ 4672,39 },{ 4529,49 },{ 4711,98 },{ 4672,39 }}, // Croatian/Latin/Bosnia And Herzegowina
+ { 28, 7, 57,{ 4809,48 },{ 4857,82 },{ 418,27 },{ 4809,48 },{ 4939,84 },{ 418,27 }}, // Czech/Latin/Czech Republic
+ { 29, 7, 58,{ 5023,59 },{ 5082,84 },{ 134,24 },{ 5023,59 },{ 5082,84 },{ 134,24 }}, // Danish/Latin/Denmark
+ { 29, 7, 86,{ 5023,59 },{ 5082,84 },{ 134,24 },{ 5023,59 },{ 5082,84 },{ 134,24 }}, // Danish/Latin/Greenland
+ { 30, 7, 151,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Netherlands
+ { 30, 7, 12,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Aruba
+ { 30, 7, 21,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Belgium
+ { 30, 7, 152,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Cura Sao
+ { 30, 7, 202,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Suriname
+ { 30, 7, 255,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Bonaire
+ { 30, 7, 256,{ 5166,59 },{ 5225,88 },{ 134,24 },{ 5166,59 },{ 5225,88 },{ 134,24 }}, // Dutch/Latin/Sint Maarten
+ { 31, 7, 225,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/United States
+ { 31, 3, 225,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // English/Deseret/United States
+ { 31, 7, 4,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/American Samoa
+ { 31, 7, 7,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Anguilla
+ { 31, 7, 9,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Antigua And Barbuda
+ { 31, 7, 13,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Australia
+ { 31, 7, 14,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Austria
+ { 31, 7, 16,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Bahamas
+ { 31, 7, 19,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Barbados
+ { 31, 7, 21,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Belgium
+ { 31, 7, 22,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Belize
+ { 31, 7, 24,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Bermuda
+ { 31, 7, 28,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Botswana
+ { 31, 7, 31,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/British Indian Ocean Territory
+ { 31, 7, 35,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Burundi
+ { 31, 7, 37,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Cameroon
+ { 31, 7, 38,{ 5313,59 },{ 48,86 },{ 134,24 },{ 5313,59 },{ 48,86 },{ 134,24 }}, // English/Latin/Canada
+ { 31, 7, 40,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Cayman Islands
+ { 31, 7, 45,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Christmas Island
+ { 31, 7, 46,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Cocos Islands
+ { 31, 7, 51,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Cook Islands
+ { 31, 7, 56,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Cyprus
+ { 31, 7, 58,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Denmark
+ { 31, 7, 60,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Dominica
+ { 31, 7, 67,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Eritrea
+ { 31, 7, 70,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Falkland Islands
+ { 31, 7, 72,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Fiji
+ { 31, 7, 73,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Finland
+ { 31, 7, 75,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Guernsey
+ { 31, 7, 80,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Gambia
+ { 31, 7, 82,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Germany
+ { 31, 7, 83,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Ghana
+ { 31, 7, 84,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Gibraltar
+ { 31, 7, 87,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Grenada
+ { 31, 7, 89,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Guam
+ { 31, 7, 93,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Guyana
+ { 31, 7, 97,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Hong Kong
+ { 31, 7, 100,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/India
+ { 31, 7, 104,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Ireland
+ { 31, 7, 105,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Israel
+ { 31, 7, 107,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Jamaica
+ { 31, 7, 111,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Kenya
+ { 31, 7, 112,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Kiribati
+ { 31, 7, 120,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Lesotho
+ { 31, 7, 121,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Liberia
+ { 31, 7, 126,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Macau
+ { 31, 7, 128,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Madagascar
+ { 31, 7, 129,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Malawi
+ { 31, 7, 130,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Malaysia
+ { 31, 7, 133,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Malta
+ { 31, 7, 134,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Marshall Islands
+ { 31, 7, 137,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Mauritius
+ { 31, 7, 140,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Micronesia
+ { 31, 7, 144,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Montserrat
+ { 31, 7, 148,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Namibia
+ { 31, 7, 149,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Nauru
+ { 31, 7, 151,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Netherlands
+ { 31, 7, 154,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/New Zealand
+ { 31, 7, 157,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Nigeria
+ { 31, 7, 158,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Niue
+ { 31, 7, 159,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Norfolk Island
+ { 31, 7, 160,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Northern Mariana Islands
+ { 31, 7, 163,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Pakistan
+ { 31, 7, 164,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Palau
+ { 31, 7, 167,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Papua New Guinea
+ { 31, 7, 170,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Philippines
+ { 31, 7, 171,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Pitcairn
+ { 31, 7, 174,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Puerto Rico
+ { 31, 7, 179,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Rwanda
+ { 31, 7, 180,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Saint Kitts And Nevis
+ { 31, 7, 181,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Saint Lucia
+ { 31, 7, 182,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Saint Vincent And The Grenadines
+ { 31, 7, 183,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Samoa
+ { 31, 7, 188,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Seychelles
+ { 31, 7, 189,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Sierra Leone
+ { 31, 7, 190,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Singapore
+ { 31, 7, 192,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Slovenia
+ { 31, 7, 193,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Solomon Islands
+ { 31, 7, 195,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/South Africa
+ { 31, 7, 199,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Saint Helena
+ { 31, 7, 201,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Sudan
+ { 31, 7, 204,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Swaziland
+ { 31, 7, 205,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Sweden
+ { 31, 7, 206,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Switzerland
+ { 31, 7, 210,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Tanzania
+ { 31, 7, 213,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Tokelau
+ { 31, 7, 214,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Tonga
+ { 31, 7, 215,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Trinidad And Tobago
+ { 31, 7, 219,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Turks And Caicos Islands
+ { 31, 7, 220,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Tuvalu
+ { 31, 7, 221,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Uganda
+ { 31, 7, 223,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/United Arab Emirates
+ { 31, 7, 224,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/United Kingdom
+ { 31, 7, 226,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/United States Minor Outlying Islands
+ { 31, 7, 229,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Vanuatu
+ { 31, 7, 233,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/British Virgin Islands
+ { 31, 7, 234,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/United States Virgin Islands
+ { 31, 7, 239,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Zambia
+ { 31, 7, 240,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Zimbabwe
+ { 31, 7, 249,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Diego Garcia
+ { 31, 7, 251,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Isle Of Man
+ { 31, 7, 252,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Jersey
+ { 31, 7, 254,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/South Sudan
+ { 31, 7, 256,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Sint Maarten
+ { 31, 7, 260,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/World
+ { 31, 7, 261,{ 0,48 },{ 48,86 },{ 134,24 },{ 0,48 },{ 48,86 },{ 134,24 }}, // English/Latin/Europe
+ { 32, 7, 260,{ 5372,48 },{ 5420,91 },{ 134,24 },{ 5372,48 },{ 5420,91 },{ 134,24 }}, // Esperanto/Latin/World
+ { 33, 7, 68,{ 5511,59 },{ 5570,91 },{ 5661,24 },{ 5511,59 },{ 5570,91 },{ 5661,24 }}, // Estonian/Latin/Estonia
+ { 34, 7, 71,{ 5685,48 },{ 5733,83 },{ 134,24 },{ 5816,59 },{ 5733,83 },{ 134,24 }}, // Faroese/Latin/Faroe Islands
+ { 34, 7, 58,{ 5685,48 },{ 5733,83 },{ 134,24 },{ 5816,59 },{ 5733,83 },{ 134,24 }}, // Faroese/Latin/Denmark
+ { 36, 7, 73,{ 5875,69 },{ 5944,105 },{ 6049,24 },{ 6073,93 },{ 6166,129 },{ 6049,24 }}, // Finnish/Latin/Finland
+ { 37, 7, 74,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/France
+ { 37, 7, 3,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Algeria
+ { 37, 7, 21,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Belgium
+ { 37, 7, 23,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Benin
+ { 37, 7, 34,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Burkina Faso
+ { 37, 7, 35,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Burundi
+ { 37, 7, 37,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Cameroon
+ { 37, 7, 38,{ 6443,64 },{ 6358,85 },{ 134,24 },{ 6443,64 },{ 6358,85 },{ 134,24 }}, // French/Latin/Canada
+ { 37, 7, 41,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Central African Republic
+ { 37, 7, 42,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Chad
+ { 37, 7, 48,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Comoros
+ { 37, 7, 49,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Congo Kinshasa
+ { 37, 7, 50,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Congo Brazzaville
+ { 37, 7, 53,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Ivory Coast
+ { 37, 7, 59,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Djibouti
+ { 37, 7, 66,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Equatorial Guinea
+ { 37, 7, 76,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/French Guiana
+ { 37, 7, 77,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/French Polynesia
+ { 37, 7, 79,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Gabon
+ { 37, 7, 88,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Guadeloupe
+ { 37, 7, 91,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Guinea
+ { 37, 7, 94,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Haiti
+ { 37, 7, 125,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Luxembourg
+ { 37, 7, 128,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Madagascar
+ { 37, 7, 132,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Mali
+ { 37, 7, 135,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Martinique
+ { 37, 7, 136,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Mauritania
+ { 37, 7, 137,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Mauritius
+ { 37, 7, 138,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Mayotte
+ { 37, 7, 142,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Monaco
+ { 37, 7, 145,{ 6507,61 },{ 6358,85 },{ 134,24 },{ 6507,61 },{ 6358,85 },{ 134,24 }}, // French/Latin/Morocco
+ { 37, 7, 153,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/New Caledonia
+ { 37, 7, 156,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Niger
+ { 37, 7, 176,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Reunion
+ { 37, 7, 179,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Rwanda
+ { 37, 7, 187,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Senegal
+ { 37, 7, 188,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Seychelles
+ { 37, 7, 200,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Saint Pierre And Miquelon
+ { 37, 7, 206,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Switzerland
+ { 37, 7, 207,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Syria
+ { 37, 7, 212,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Togo
+ { 37, 7, 216,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Tunisia
+ { 37, 7, 229,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Vanuatu
+ { 37, 7, 235,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Wallis And Futuna Islands
+ { 37, 7, 244,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Saint Barthelemy
+ { 37, 7, 245,{ 6295,63 },{ 6358,85 },{ 134,24 },{ 6295,63 },{ 6358,85 },{ 134,24 }}, // French/Latin/Saint Martin
+ { 38, 7, 151,{ 6568,48 },{ 6616,95 },{ 134,24 },{ 6568,48 },{ 6616,95 },{ 134,24 }}, // Western Frisian/Latin/Netherlands
+ { 39, 7, 224,{ 6711,61 },{ 6772,142 },{ 6914,24 },{ 6711,61 },{ 6938,167 },{ 6914,24 }}, // Gaelic/Latin/United Kingdom
+ { 40, 7, 197,{ 7105,60 },{ 7165,87 },{ 7252,24 },{ 7276,60 },{ 7336,87 },{ 7423,36 }}, // Galician/Latin/Spain
+ { 41, 15, 81,{ 7459,48 },{ 7507,99 },{ 7606,24 },{ 7459,48 },{ 7507,99 },{ 7606,24 }}, // Georgian/Georgian/Georgia
+ { 42, 7, 82,{ 7630,48 },{ 7678,83 },{ 134,24 },{ 7761,60 },{ 7678,83 },{ 134,24 }}, // German/Latin/Germany
+ { 42, 7, 14,{ 7821,48 },{ 7869,83 },{ 134,24 },{ 7952,59 },{ 7869,83 },{ 134,24 }}, // German/Latin/Austria
+ { 42, 7, 21,{ 7630,48 },{ 7678,83 },{ 134,24 },{ 7761,60 },{ 7678,83 },{ 134,24 }}, // German/Latin/Belgium
+ { 42, 7, 106,{ 7821,48 },{ 7869,83 },{ 134,24 },{ 7952,59 },{ 7869,83 },{ 134,24 }}, // German/Latin/Italy
+ { 42, 7, 123,{ 7630,48 },{ 7678,83 },{ 134,24 },{ 7761,60 },{ 7678,83 },{ 134,24 }}, // German/Latin/Liechtenstein
+ { 42, 7, 125,{ 7630,48 },{ 7678,83 },{ 134,24 },{ 7761,60 },{ 7678,83 },{ 134,24 }}, // German/Latin/Luxembourg
+ { 42, 7, 206,{ 7630,48 },{ 7678,83 },{ 134,24 },{ 7761,60 },{ 7678,83 },{ 134,24 }}, // German/Latin/Switzerland
+ { 43, 16, 85,{ 8011,50 },{ 8061,115 },{ 8176,24 },{ 8200,50 },{ 8250,115 },{ 8176,24 }}, // Greek/Greek/Greece
+ { 43, 16, 56,{ 8011,50 },{ 8061,115 },{ 8176,24 },{ 8200,50 },{ 8250,115 },{ 8176,24 }}, // Greek/Greek/Cyprus
+ { 44, 7, 86,{ 8365,50 },{ 8415,99 },{ 134,24 },{ 8365,50 },{ 8514,111 },{ 134,24 }}, // Greenlandic/Latin/Greenland
+ { 45, 7, 168,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Guarani/Latin/Paraguay
+ { 46, 17, 100,{ 8625,67 },{ 8692,87 },{ 8779,31 },{ 8625,67 },{ 8692,87 },{ 8779,31 }}, // Gujarati/Gujarati/India
+ { 47, 7, 157,{ 8810,48 },{ 8858,85 },{ 8943,24 },{ 8810,48 },{ 8858,85 },{ 8943,24 }}, // Hausa/Latin/Nigeria
+ { 47, 1, 157,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Hausa/Arabic/Nigeria
+ { 47, 7, 83,{ 8810,48 },{ 8858,85 },{ 8943,24 },{ 8810,48 },{ 8858,85 },{ 8943,24 }}, // Hausa/Latin/Ghana
+ { 47, 7, 156,{ 8810,48 },{ 8858,85 },{ 8943,24 },{ 8810,48 },{ 8858,85 },{ 8943,24 }}, // Hausa/Latin/Niger
+ { 48, 18, 105,{ 8967,58 },{ 9025,72 },{ 418,27 },{ 8967,58 },{ 9025,72 },{ 418,27 }}, // Hebrew/Hebrew/Israel
+ { 49, 13, 100,{ 9097,59 },{ 9156,73 },{ 9229,30 },{ 9097,59 },{ 9156,73 },{ 9229,30 }}, // Hindi/Devanagari/India
+ { 50, 7, 98,{ 9259,64 },{ 9323,98 },{ 9421,25 },{ 9259,64 },{ 9323,98 },{ 9421,25 }}, // Hungarian/Latin/Hungary
+ { 51, 7, 99,{ 9446,59 },{ 9505,82 },{ 9587,24 },{ 9446,59 },{ 9505,82 },{ 9587,24 }}, // Icelandic/Latin/Iceland
+ { 52, 7, 101,{ 9611,48 },{ 9659,87 },{ 134,24 },{ 9611,48 },{ 9659,87 },{ 134,24 }}, // Indonesian/Latin/Indonesia
+ { 53, 7, 260,{ 9746,48 },{ 9794,93 },{ 418,27 },{ 9746,48 },{ 9794,93 },{ 9887,24 }}, // Interlingua/Latin/World
+ { 55, 44, 38,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Inuktitut/Canadian Aboriginal/Canada
+ { 55, 7, 38,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Inuktitut/Latin/Canada
+ { 57, 7, 104,{ 9911,62 },{ 9973,107 },{ 10080,24 },{ 9911,62 },{ 9973,107 },{ 10080,24 }}, // Irish/Latin/Ireland
+ { 57, 7, 224,{ 9911,62 },{ 9973,107 },{ 10080,24 },{ 9911,62 },{ 9973,107 },{ 10080,24 }}, // Irish/Latin/United Kingdom
+ { 58, 7, 106,{ 10104,48 },{ 10152,94 },{ 10246,24 },{ 10104,48 },{ 10152,94 },{ 10246,24 }}, // Italian/Latin/Italy
+ { 58, 7, 184,{ 10104,48 },{ 10152,94 },{ 10246,24 },{ 10104,48 },{ 10152,94 },{ 10246,24 }}, // Italian/Latin/San Marino
+ { 58, 7, 206,{ 10104,48 },{ 10152,94 },{ 10246,24 },{ 10104,48 },{ 10152,94 },{ 10246,24 }}, // Italian/Latin/Switzerland
+ { 58, 7, 230,{ 10104,48 },{ 10152,94 },{ 10246,24 },{ 10104,48 },{ 10152,94 },{ 10246,24 }}, // Italian/Latin/Vatican City State
+ { 59, 19, 108,{ 4452,39 },{ 4452,39 },{ 418,27 },{ 4452,39 },{ 4452,39 },{ 418,27 }}, // Japanese/Japanese/Japan
+ { 60, 7, 101,{ 10270,48 },{ 9659,87 },{ 134,24 },{ 10270,48 },{ 9659,87 },{ 134,24 }}, // Javanese/Latin/Indonesia
+ { 61, 21, 100,{ 10318,63 },{ 10381,87 },{ 10468,31 },{ 10499,69 },{ 10381,87 },{ 10468,31 }}, // Kannada/Kannada/India
+ { 62, 1, 100,{ 10568,72 },{ 10568,72 },{ 10640,24 },{ 10568,72 },{ 10568,72 },{ 10640,24 }}, // Kashmiri/Arabic/India
+ { 63, 2, 110,{ 10664,60 },{ 10724,83 },{ 10807,24 },{ 10664,60 },{ 10831,83 },{ 10807,24 }}, // Kazakh/Cyrillic/Kazakhstan
+ { 64, 7, 179,{ 10914,60 },{ 10974,101 },{ 418,27 },{ 10914,60 },{ 10974,101 },{ 418,27 }}, // Kinyarwanda/Latin/Rwanda
+ { 65, 2, 116,{ 11075,48 },{ 11123,80 },{ 11203,24 },{ 11227,59 },{ 11286,80 },{ 11203,24 }}, // Kirghiz/Cyrillic/Kyrgyzstan
+ { 66, 22, 114,{ 11366,39 },{ 11366,39 },{ 11366,39 },{ 11366,39 },{ 11366,39 },{ 11366,39 }}, // Korean/Korean/South Korea
+ { 66, 22, 113,{ 11366,39 },{ 11366,39 },{ 11366,39 },{ 11366,39 },{ 11366,39 },{ 11366,39 }}, // Korean/Korean/North Korea
+ { 67, 7, 217,{ 11405,48 },{ 11453,88 },{ 11541,24 },{ 11405,48 },{ 11565,101 },{ 11541,24 }}, // Kurdish/Latin/Turkey
+ { 68, 7, 35,{ 11666,60 },{ 11726,106 },{ 418,27 },{ 11666,60 },{ 11726,106 },{ 418,27 }}, // Rundi/Latin/Burundi
+ { 69, 23, 117,{ 11832,61 },{ 11893,75 },{ 418,27 },{ 11832,61 },{ 11893,75 },{ 418,27 }}, // Lao/Lao/Laos
+ { 71, 7, 118,{ 11968,65 },{ 12033,101 },{ 134,24 },{ 11968,65 },{ 12033,101 },{ 134,24 }}, // Latvian/Latin/Latvia
+ { 72, 7, 49,{ 12134,48 },{ 12182,203 },{ 12385,24 },{ 12134,48 },{ 12182,203 },{ 12385,24 }}, // Lingala/Latin/Congo Kinshasa
+ { 72, 7, 6,{ 12134,48 },{ 12182,203 },{ 12385,24 },{ 12134,48 },{ 12182,203 },{ 12385,24 }}, // Lingala/Latin/Angola
+ { 72, 7, 41,{ 12134,48 },{ 12182,203 },{ 12385,24 },{ 12134,48 },{ 12182,203 },{ 12385,24 }}, // Lingala/Latin/Central African Republic
+ { 72, 7, 50,{ 12134,48 },{ 12182,203 },{ 12385,24 },{ 12134,48 },{ 12182,203 },{ 12385,24 }}, // Lingala/Latin/Congo Brazzaville
+ { 73, 7, 124,{ 12409,70 },{ 12479,96 },{ 12575,24 },{ 12409,70 },{ 12599,98 },{ 12575,24 }}, // Lithuanian/Latin/Lithuania
+ { 74, 2, 127,{ 12697,61 },{ 12758,85 },{ 12843,24 },{ 12697,61 },{ 12758,85 },{ 12843,24 }}, // Macedonian/Cyrillic/Macedonia
+ { 75, 7, 128,{ 12867,48 },{ 12915,92 },{ 134,24 },{ 12867,48 },{ 12915,92 },{ 134,24 }}, // Malagasy/Latin/Madagascar
+ { 76, 7, 130,{ 13007,48 },{ 13055,82 },{ 13137,24 },{ 13007,48 },{ 13055,82 },{ 13137,24 }}, // Malay/Latin/Malaysia
+ { 76, 1, 130,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Malay/Arabic/Malaysia
+ { 76, 7, 32,{ 13007,48 },{ 13055,82 },{ 13137,24 },{ 13007,48 },{ 13055,82 },{ 13137,24 }}, // Malay/Latin/Brunei
+ { 76, 7, 190,{ 13007,48 },{ 13055,82 },{ 13137,24 },{ 13007,48 },{ 13055,82 },{ 13137,24 }}, // Malay/Latin/Singapore
+ { 77, 24, 100,{ 13161,62 },{ 13223,88 },{ 13311,32 },{ 13161,62 },{ 13223,88 },{ 13311,32 }}, // Malayalam/Malayalam/India
+ { 78, 7, 133,{ 13343,48 },{ 13391,86 },{ 13477,36 },{ 13343,48 },{ 13391,86 },{ 13513,24 }}, // Maltese/Latin/Malta
+ { 79, 7, 154,{ 13537,59 },{ 13596,133 },{ 13729,24 },{ 13537,59 },{ 13596,133 },{ 13729,24 }}, // Maori/Latin/New Zealand
+ { 80, 13, 100,{ 13753,66 },{ 13819,86 },{ 13905,32 },{ 13753,66 },{ 13819,86 },{ 13905,32 }}, // Marathi/Devanagari/India
+ { 82, 2, 143,{ 13937,99 },{ 14036,192 },{ 14228,38 },{ 13937,99 },{ 14266,192 },{ 14228,38 }}, // Mongolian/Cyrillic/Mongolia
+ { 82, 8, 44,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Mongolian/Mongolian/China
+ { 84, 13, 150,{ 14458,85 },{ 14458,85 },{ 14543,53 },{ 14458,85 },{ 14458,85 },{ 14596,52 }}, // Nepali/Devanagari/Nepal
+ { 84, 13, 100,{ 14458,85 },{ 14458,85 },{ 14543,53 },{ 14458,85 },{ 14458,85 },{ 14596,52 }}, // Nepali/Devanagari/India
+ { 85, 7, 161,{ 5685,48 },{ 14648,83 },{ 134,24 },{ 5816,59 },{ 14648,83 },{ 134,24 }}, // Norwegian Bokmal/Latin/Norway
+ { 85, 7, 203,{ 5685,48 },{ 14648,83 },{ 134,24 },{ 5816,59 },{ 14648,83 },{ 134,24 }}, // Norwegian Bokmal/Latin/Svalbard And Jan Mayen Islands
+ { 86, 7, 74,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Occitan/Latin/France
+ { 87, 26, 100,{ 14731,86 },{ 14731,86 },{ 14817,32 },{ 14731,86 },{ 14731,86 },{ 14817,32 }}, // Oriya/Oriya/India
+ { 88, 1, 1,{ 14849,68 },{ 14917,69 },{ 418,27 },{ 14986,69 },{ 14986,69 },{ 15055,24 }}, // Pashto/Arabic/Afghanistan
+ { 88, 1, 163,{ 14849,68 },{ 14917,69 },{ 418,27 },{ 14986,69 },{ 14986,69 },{ 15055,24 }}, // Pashto/Arabic/Pakistan
+ { 89, 1, 102,{ 15079,70 },{ 15079,70 },{ 15149,24 },{ 15173,74 },{ 15173,74 },{ 15149,24 }}, // Persian/Arabic/Iran
+ { 89, 1, 1,{ 15247,68 },{ 15247,68 },{ 15055,24 },{ 15315,62 },{ 15247,68 },{ 15055,24 }}, // Persian/Arabic/Afghanistan
+ { 90, 7, 172,{ 15377,48 },{ 15425,97 },{ 15522,24 },{ 15377,48 },{ 15546,99 },{ 15645,24 }}, // Polish/Latin/Poland
+ { 91, 7, 30,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Brazil
+ { 91, 7, 6,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Angola
+ { 91, 7, 39,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Cape Verde
+ { 91, 7, 62,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/East Timor
+ { 91, 7, 66,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Equatorial Guinea
+ { 91, 7, 92,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Guinea Bissau
+ { 91, 7, 125,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Luxembourg
+ { 91, 7, 126,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Macau
+ { 91, 7, 146,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Mozambique
+ { 91, 7, 173,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Portugal
+ { 91, 7, 185,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Sao Tome And Principe
+ { 91, 7, 206,{ 15669,60 },{ 15729,89 },{ 134,24 },{ 15669,60 },{ 15729,89 },{ 134,24 }}, // Portuguese/Latin/Switzerland
+ { 92, 4, 100,{ 15818,50 },{ 15868,68 },{ 15936,28 },{ 15818,50 },{ 15868,68 },{ 15936,28 }}, // Punjabi/Gurmukhi/India
+ { 92, 1, 163,{ 15964,67 },{ 15964,67 },{ 418,27 },{ 15964,67 },{ 15964,67 },{ 418,27 }}, // Punjabi/Arabic/Pakistan
+ { 93, 7, 169,{ 16031,48 },{ 16079,88 },{ 418,27 },{ 16031,48 },{ 16079,88 },{ 418,27 }}, // Quechua/Latin/Peru
+ { 93, 7, 26,{ 16031,48 },{ 16079,88 },{ 418,27 },{ 16031,48 },{ 16079,88 },{ 418,27 }}, // Quechua/Latin/Bolivia
+ { 93, 7, 63,{ 16031,48 },{ 16079,88 },{ 418,27 },{ 16031,48 },{ 16079,88 },{ 418,27 }}, // Quechua/Latin/Ecuador
+ { 94, 7, 206,{ 16167,67 },{ 16234,92 },{ 16326,24 },{ 16167,67 },{ 16350,125 },{ 16326,24 }}, // Romansh/Latin/Switzerland
+ { 95, 7, 177,{ 16475,60 },{ 16535,98 },{ 16633,24 },{ 16475,60 },{ 16535,98 },{ 16633,24 }}, // Romanian/Latin/Romania
+ { 95, 7, 141,{ 16475,60 },{ 16535,98 },{ 16633,24 },{ 16475,60 },{ 16535,98 },{ 16633,24 }}, // Romanian/Latin/Moldova
+ { 96, 2, 178,{ 16657,62 },{ 11286,80 },{ 11203,24 },{ 16719,62 },{ 16781,82 },{ 11203,24 }}, // Russian/Cyrillic/Russia
+ { 96, 2, 20,{ 16657,62 },{ 11286,80 },{ 11203,24 },{ 16719,62 },{ 16781,82 },{ 11203,24 }}, // Russian/Cyrillic/Belarus
+ { 96, 2, 110,{ 16657,62 },{ 11286,80 },{ 11203,24 },{ 16719,62 },{ 16781,82 },{ 11203,24 }}, // Russian/Cyrillic/Kazakhstan
+ { 96, 2, 116,{ 16657,62 },{ 11286,80 },{ 11203,24 },{ 16719,62 },{ 16781,82 },{ 11203,24 }}, // Russian/Cyrillic/Kyrgyzstan
+ { 96, 2, 141,{ 16657,62 },{ 11286,80 },{ 11203,24 },{ 16719,62 },{ 16781,82 },{ 11203,24 }}, // Russian/Cyrillic/Moldova
+ { 96, 2, 222,{ 16657,62 },{ 11286,80 },{ 11203,24 },{ 16719,62 },{ 16781,82 },{ 11203,24 }}, // Russian/Cyrillic/Ukraine
+ { 98, 7, 41,{ 16863,48 },{ 16911,91 },{ 17002,24 },{ 16863,48 },{ 16911,91 },{ 17002,24 }}, // Sango/Latin/Central African Republic
+ { 99, 13, 100,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Sanskrit/Devanagari/India
+ { 100, 2, 243,{ 17026,48 },{ 17074,81 },{ 12843,24 },{ 17026,48 },{ 17074,81 },{ 12843,24 }}, // Serbian/Cyrillic/Serbia
+ { 100, 2, 27,{ 17026,48 },{ 17074,81 },{ 12843,24 },{ 17026,48 },{ 17074,81 },{ 12843,24 }}, // Serbian/Cyrillic/Bosnia And Herzegowina
+ { 100, 2, 242,{ 17155,50 },{ 17074,81 },{ 12843,24 },{ 17155,50 },{ 17074,81 },{ 12843,24 }}, // Serbian/Cyrillic/Montenegro
+ { 100, 2, 257,{ 17155,50 },{ 17074,81 },{ 12843,24 },{ 17155,50 },{ 17074,81 },{ 12843,24 }}, // Serbian/Cyrillic/Kosovo
+ { 100, 7, 27,{ 17205,48 },{ 17253,81 },{ 9887,24 },{ 17205,48 },{ 17253,81 },{ 9887,24 }}, // Serbian/Latin/Bosnia And Herzegowina
+ { 100, 7, 242,{ 17334,50 },{ 17253,81 },{ 9887,24 },{ 17334,50 },{ 17253,81 },{ 9887,24 }}, // Serbian/Latin/Montenegro
+ { 100, 7, 243,{ 17205,48 },{ 17253,81 },{ 9887,24 },{ 17205,48 },{ 17253,81 },{ 9887,24 }}, // Serbian/Latin/Serbia
+ { 100, 7, 257,{ 17334,50 },{ 17253,81 },{ 9887,24 },{ 17334,50 },{ 17253,81 },{ 9887,24 }}, // Serbian/Latin/Kosovo
+ { 101, 2, 81,{ 17384,63 },{ 17447,82 },{ 11203,24 },{ 17529,60 },{ 17589,86 },{ 11203,24 }}, // Ossetic/Cyrillic/Georgia
+ { 101, 2, 178,{ 17384,63 },{ 17447,82 },{ 11203,24 },{ 17529,60 },{ 17589,86 },{ 11203,24 }}, // Ossetic/Cyrillic/Russia
+ { 102, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Southern Sotho/Latin/South Africa
+ { 103, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Tswana/Latin/South Africa
+ { 104, 7, 240,{ 17675,48 },{ 17723,100 },{ 17823,24 },{ 17675,48 },{ 17723,100 },{ 17823,24 }}, // Shona/Latin/Zimbabwe
+ { 105, 1, 163,{ 17847,72 },{ 17847,72 },{ 134,24 },{ 17847,72 },{ 17847,72 },{ 134,24 }}, // Sindhi/Arabic/Pakistan
+ { 106, 32, 198,{ 17919,59 },{ 17978,96 },{ 18074,32 },{ 18106,61 },{ 17978,96 },{ 18074,32 }}, // Sinhala/Sinhala/Sri Lanka
+ { 107, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Swati/Latin/South Africa
+ { 108, 7, 191,{ 18167,48 },{ 18215,82 },{ 9887,24 },{ 18167,48 },{ 18297,89 },{ 9887,24 }}, // Slovak/Latin/Slovakia
+ { 109, 7, 192,{ 18386,59 },{ 18445,86 },{ 9887,24 },{ 18386,59 },{ 18445,86 },{ 9887,24 }}, // Slovenian/Latin/Slovenia
+ { 110, 7, 194,{ 18531,48 },{ 18579,92 },{ 18671,24 },{ 18531,48 },{ 18695,189 },{ 18671,24 }}, // Somali/Latin/Somalia
+ { 110, 7, 59,{ 18531,48 },{ 18579,92 },{ 18671,24 },{ 18531,48 },{ 18695,189 },{ 18671,24 }}, // Somali/Latin/Djibouti
+ { 110, 7, 69,{ 18531,48 },{ 18579,92 },{ 18671,24 },{ 18531,48 },{ 18695,189 },{ 18671,24 }}, // Somali/Latin/Ethiopia
+ { 110, 7, 111,{ 18531,48 },{ 18579,92 },{ 18671,24 },{ 18531,48 },{ 18695,189 },{ 18671,24 }}, // Somali/Latin/Kenya
+ { 111, 7, 197,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Spain
+ { 111, 7, 10,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Argentina
+ { 111, 7, 22,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Belize
+ { 111, 7, 26,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Bolivia
+ { 111, 7, 30,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Brazil
+ { 111, 7, 43,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Chile
+ { 111, 7, 47,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Colombia
+ { 111, 7, 52,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Costa Rica
+ { 111, 7, 55,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Cuba
+ { 111, 7, 61,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Dominican Republic
+ { 111, 7, 63,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Ecuador
+ { 111, 7, 65,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/El Salvador
+ { 111, 7, 66,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Equatorial Guinea
+ { 111, 7, 90,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Guatemala
+ { 111, 7, 96,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Honduras
+ { 111, 7, 139,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Mexico
+ { 111, 7, 155,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Nicaragua
+ { 111, 7, 166,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Panama
+ { 111, 7, 168,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Paraguay
+ { 111, 7, 169,{ 19118,60 },{ 16079,88 },{ 19034,24 },{ 19178,60 },{ 19238,88 },{ 19034,24 }}, // Spanish/Latin/Peru
+ { 111, 7, 170,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Philippines
+ { 111, 7, 174,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Puerto Rico
+ { 111, 7, 225,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/United States
+ { 111, 7, 227,{ 19118,60 },{ 16079,88 },{ 19034,24 },{ 19178,60 },{ 19238,88 },{ 19034,24 }}, // Spanish/Latin/Uruguay
+ { 111, 7, 231,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Venezuela
+ { 111, 7, 238,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Canary Islands
+ { 111, 7, 246,{ 19058,60 },{ 18945,89 },{ 19034,24 },{ 19058,60 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Latin America
+ { 111, 7, 250,{ 18884,61 },{ 18945,89 },{ 19034,24 },{ 18884,61 },{ 18945,89 },{ 19034,24 }}, // Spanish/Latin/Ceuta And Melilla
+ { 112, 7, 101,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Sundanese/Latin/Indonesia
+ { 113, 7, 210,{ 19326,48 },{ 19374,84 },{ 134,24 },{ 19326,48 },{ 19374,84 },{ 134,24 }}, // Swahili/Latin/Tanzania
+ { 113, 7, 49,{ 19326,48 },{ 19374,84 },{ 134,24 },{ 19326,48 },{ 19374,84 },{ 134,24 }}, // Swahili/Latin/Congo Kinshasa
+ { 113, 7, 111,{ 19326,48 },{ 19374,84 },{ 134,24 },{ 19326,48 },{ 19374,84 },{ 134,24 }}, // Swahili/Latin/Kenya
+ { 113, 7, 221,{ 19326,48 },{ 19374,84 },{ 134,24 },{ 19326,48 },{ 19374,84 },{ 134,24 }}, // Swahili/Latin/Uganda
+ { 114, 7, 205,{ 19458,59 },{ 19517,86 },{ 134,24 },{ 19458,59 },{ 19517,86 },{ 134,24 }}, // Swedish/Latin/Sweden
+ { 114, 7, 73,{ 19458,59 },{ 19517,86 },{ 134,24 },{ 19458,59 },{ 19517,86 },{ 134,24 }}, // Swedish/Latin/Finland
+ { 114, 7, 248,{ 19458,59 },{ 19517,86 },{ 134,24 },{ 19458,59 },{ 19517,86 },{ 134,24 }}, // Swedish/Latin/Aland Islands
+ { 115, 7, 106,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Sardinian/Latin/Italy
+ { 116, 2, 209,{ 11075,48 },{ 19603,71 },{ 11203,24 },{ 11075,48 },{ 19603,71 },{ 11203,24 }}, // Tajik/Cyrillic/Tajikistan
+ { 117, 27, 100,{ 19674,58 },{ 19732,86 },{ 19818,31 },{ 19674,58 },{ 19732,86 },{ 19818,31 }}, // Tamil/Tamil/India
+ { 117, 27, 130,{ 19674,58 },{ 19732,86 },{ 19818,31 },{ 19674,58 },{ 19732,86 },{ 19818,31 }}, // Tamil/Tamil/Malaysia
+ { 117, 27, 190,{ 19674,58 },{ 19732,86 },{ 19818,31 },{ 19674,58 },{ 19732,86 },{ 19818,31 }}, // Tamil/Tamil/Singapore
+ { 117, 27, 198,{ 19674,58 },{ 19732,86 },{ 19818,31 },{ 19674,58 },{ 19732,86 },{ 19818,31 }}, // Tamil/Tamil/Sri Lanka
+ { 118, 2, 178,{ 19849,62 },{ 19911,81 },{ 418,27 },{ 19849,62 },{ 19911,81 },{ 418,27 }}, // Tatar/Cyrillic/Russia
+ { 119, 28, 100,{ 19992,62 },{ 20054,86 },{ 20140,31 },{ 19992,62 },{ 20054,86 },{ 20140,31 }}, // Telugu/Telugu/India
+ { 120, 30, 211,{ 20171,63 },{ 20234,98 },{ 20171,63 },{ 20171,63 },{ 20234,98 },{ 20171,63 }}, // Thai/Thai/Thailand
+ { 121, 31, 44,{ 2704,63 },{ 20332,159 },{ 418,27 },{ 2704,63 },{ 20491,147 },{ 418,27 }}, // Tibetan/Tibetan/China
+ { 121, 31, 100,{ 2704,63 },{ 20332,159 },{ 418,27 },{ 2704,63 },{ 20491,147 },{ 418,27 }}, // Tibetan/Tibetan/India
+ { 122, 14, 69,{ 20638,36 },{ 20674,54 },{ 20728,24 },{ 20638,36 },{ 20674,54 },{ 20728,24 }}, // Tigrinya/Ethiopic/Ethiopia
+ { 122, 14, 67,{ 20638,36 },{ 20674,54 },{ 20728,24 },{ 20638,36 },{ 20674,54 },{ 20728,24 }}, // Tigrinya/Ethiopic/Eritrea
+ { 123, 7, 214,{ 20752,51 },{ 20803,87 },{ 20890,24 },{ 20752,51 },{ 20803,87 },{ 20890,24 }}, // Tongan/Latin/Tonga
+ { 124, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Tsonga/Latin/South Africa
+ { 125, 7, 217,{ 20914,48 },{ 20962,75 },{ 21037,24 },{ 20914,48 },{ 20962,75 },{ 21037,24 }}, // Turkish/Latin/Turkey
+ { 125, 7, 56,{ 20914,48 },{ 20962,75 },{ 21037,24 },{ 20914,48 },{ 20962,75 },{ 21037,24 }}, // Turkish/Latin/Cyprus
+ { 126, 7, 218,{ 21061,50 },{ 21111,77 },{ 21188,24 },{ 21212,51 },{ 21263,77 },{ 21188,24 }}, // Turkmen/Latin/Turkmenistan
+ { 128, 1, 44,{ 21340,84 },{ 21340,84 },{ 418,27 },{ 21340,84 },{ 21340,84 },{ 418,27 }}, // Uighur/Arabic/China
+ { 129, 2, 222,{ 21424,48 },{ 21472,95 },{ 21567,24 },{ 21591,67 },{ 21658,87 },{ 21745,24 }}, // Ukrainian/Cyrillic/Ukraine
+ { 130, 1, 163,{ 21769,68 },{ 21769,68 },{ 134,24 },{ 21769,68 },{ 21769,68 },{ 134,24 }}, // Urdu/Arabic/Pakistan
+ { 130, 1, 100,{ 21769,68 },{ 21769,68 },{ 134,24 },{ 21769,68 },{ 21769,68 },{ 134,24 }}, // Urdu/Arabic/India
+ { 131, 7, 228,{ 21837,48 },{ 21885,75 },{ 21960,24 },{ 21984,48 },{ 22032,75 },{ 21960,24 }}, // Uzbek/Latin/Uzbekistan
+ { 131, 1, 1,{ 22107,47 },{ 15247,68 },{ 418,27 },{ 22107,47 },{ 15247,68 },{ 418,27 }}, // Uzbek/Arabic/Afghanistan
+ { 131, 2, 228,{ 22154,48 },{ 22202,71 },{ 11203,24 },{ 22154,48 },{ 22202,71 },{ 11203,24 }}, // Uzbek/Cyrillic/Uzbekistan
+ { 132, 7, 232,{ 22273,75 },{ 22348,99 },{ 418,27 },{ 22447,75 },{ 22522,99 },{ 418,27 }}, // Vietnamese/Latin/Vietnam
+ { 133, 7, 260,{ 22621,48 },{ 22669,74 },{ 22743,24 },{ 22767,48 },{ 22669,74 },{ 22743,24 }}, // Volapuk/Latin/World
+ { 134, 7, 224,{ 22815,52 },{ 22867,87 },{ 22954,26 },{ 22980,56 },{ 22867,87 },{ 22954,26 }}, // Welsh/Latin/United Kingdom
+ { 135, 7, 187,{ 23036,47 },{ 23083,84 },{ 418,27 },{ 23036,47 },{ 23083,84 },{ 418,27 }}, // Wolof/Latin/Senegal
+ { 136, 7, 195,{ 23167,48 },{ 23215,91 },{ 418,27 },{ 23167,48 },{ 23215,91 },{ 418,27 }}, // Xhosa/Latin/South Africa
+ { 137, 18, 260,{ 23306,58 },{ 23364,92 },{ 418,27 },{ 23364,92 },{ 23364,92 },{ 418,27 }}, // Yiddish/Hebrew/World
+ { 138, 7, 157,{ 23456,40 },{ 23496,73 },{ 23569,27 },{ 23596,55 },{ 23651,121 },{ 23569,27 }}, // Yoruba/Latin/Nigeria
+ { 138, 7, 23,{ 23772,41 },{ 23813,74 },{ 23887,27 },{ 23914,56 },{ 23970,134 },{ 23887,27 }}, // Yoruba/Latin/Benin
+ { 140, 7, 195,{ 24104,48 },{ 24152,91 },{ 134,24 },{ 24104,48 },{ 24152,91 },{ 24243,24 }}, // Zulu/Latin/South Africa
+ { 141, 7, 161,{ 5685,48 },{ 14648,83 },{ 134,24 },{ 24267,59 },{ 14648,83 },{ 134,24 }}, // Norwegian Nynorsk/Latin/Norway
+ { 142, 7, 27,{ 24326,48 },{ 24374,83 },{ 9887,24 },{ 24326,48 },{ 24374,83 },{ 9887,24 }}, // Bosnian/Latin/Bosnia And Herzegowina
+ { 142, 2, 27,{ 24457,48 },{ 24505,83 },{ 12843,24 },{ 24457,48 },{ 24505,83 },{ 12843,24 }}, // Bosnian/Cyrillic/Bosnia And Herzegowina
+ { 143, 29, 131,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Divehi/Thaana/Maldives
+ { 144, 7, 251,{ 24588,102 },{ 24690,140 },{ 418,27 },{ 24588,102 },{ 24690,140 },{ 418,27 }}, // Manx/Latin/Isle Of Man
+ { 145, 7, 224,{ 24830,46 },{ 24876,130 },{ 418,27 },{ 24830,46 },{ 24876,130 },{ 418,27 }}, // Cornish/Latin/United Kingdom
+ { 146, 7, 83,{ 25006,48 },{ 25054,192 },{ 418,27 },{ 25006,48 },{ 25054,192 },{ 418,27 }}, // Akan/Latin/Ghana
+ { 147, 13, 100,{ 25246,88 },{ 25246,88 },{ 418,27 },{ 25246,88 },{ 25246,88 },{ 418,27 }}, // Konkani/Devanagari/India
+ { 148, 7, 83,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Ga/Latin/Ghana
+ { 149, 7, 157,{ 25334,48 },{ 25382,87 },{ 25469,24 },{ 25334,48 },{ 25382,87 },{ 25469,24 }}, // Igbo/Latin/Nigeria
+ { 150, 7, 111,{ 25493,48 },{ 25541,189 },{ 25730,24 },{ 25493,48 },{ 25541,189 },{ 25730,24 }}, // Kamba/Latin/Kenya
+ { 151, 33, 103,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Syriac/Syriac/Iraq
+ { 152, 14, 67,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Blin/Ethiopic/Eritrea
+ { 153, 14, 69,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Geez/Ethiopic/Ethiopia
+ { 155, 7, 69,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Sidamo/Latin/Ethiopia
+ { 156, 7, 157,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Atsam/Latin/Nigeria
+ { 157, 14, 67,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Tigre/Ethiopic/Eritrea
+ { 158, 7, 157,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Jju/Latin/Nigeria
+ { 159, 7, 106,{ 25754,48 },{ 25802,77 },{ 25879,24 },{ 25754,48 },{ 25802,77 },{ 25879,24 }}, // Friulian/Latin/Italy
+ { 160, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Venda/Latin/South Africa
+ { 161, 7, 83,{ 25903,48 },{ 25951,87 },{ 26038,24 },{ 25903,48 },{ 25951,87 },{ 26038,24 }}, // Ewe/Latin/Ghana
+ { 161, 7, 212,{ 25903,48 },{ 25951,87 },{ 26038,24 },{ 25903,48 },{ 25951,87 },{ 26038,24 }}, // Ewe/Latin/Togo
+ { 162, 14, 69,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Walamo/Ethiopic/Ethiopia
+ { 163, 7, 225,{ 26062,59 },{ 26121,95 },{ 418,27 },{ 26062,59 },{ 26121,95 },{ 418,27 }}, // Hawaiian/Latin/United States
+ { 164, 7, 157,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Tyap/Latin/Nigeria
+ { 165, 7, 129,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Nyanja/Latin/Malawi
+ { 166, 7, 170,{ 26216,48 },{ 26264,88 },{ 26352,38 },{ 26216,48 },{ 26264,88 },{ 26216,48 }}, // Filipino/Latin/Philippines
+ { 167, 7, 206,{ 7630,48 },{ 26390,86 },{ 134,24 },{ 7630,48 },{ 26390,86 },{ 134,24 }}, // Swiss German/Latin/Switzerland
+ { 167, 7, 74,{ 7630,48 },{ 26390,86 },{ 134,24 },{ 7630,48 },{ 26390,86 },{ 134,24 }}, // Swiss German/Latin/France
+ { 167, 7, 123,{ 7630,48 },{ 26390,86 },{ 134,24 },{ 7630,48 },{ 26390,86 },{ 134,24 }}, // Swiss German/Latin/Liechtenstein
+ { 168, 34, 44,{ 26476,38 },{ 26476,38 },{ 418,27 },{ 26476,38 },{ 26476,38 },{ 418,27 }}, // Sichuan Yi/Yi/China
+ { 169, 7, 121,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Kpelle/Latin/Liberia
+ { 170, 7, 82,{ 26514,59 },{ 26573,85 },{ 134,24 },{ 26514,59 },{ 26573,85 },{ 134,24 }}, // Low German/Latin/Germany
+ { 170, 7, 151,{ 26514,59 },{ 26573,85 },{ 134,24 },{ 26514,59 },{ 26573,85 },{ 134,24 }}, // Low German/Latin/Netherlands
+ { 171, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // South Ndebele/Latin/South Africa
+ { 172, 7, 195,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Northern Sotho/Latin/South Africa
+ { 173, 7, 161,{ 26658,59 },{ 26717,145 },{ 26862,24 },{ 26658,59 },{ 26717,145 },{ 26862,24 }}, // Northern Sami/Latin/Norway
+ { 173, 7, 73,{ 26886,60 },{ 26717,145 },{ 26862,24 },{ 26886,60 },{ 26717,145 },{ 26862,24 }}, // Northern Sami/Latin/Finland
+ { 173, 7, 205,{ 26658,59 },{ 26717,145 },{ 26862,24 },{ 26658,59 },{ 26717,145 },{ 26862,24 }}, // Northern Sami/Latin/Sweden
+ { 174, 7, 208,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Taroko/Latin/Taiwan
+ { 175, 7, 111,{ 26946,48 },{ 26994,88 },{ 27082,24 },{ 26946,48 },{ 26994,88 },{ 27082,24 }}, // Gusii/Latin/Kenya
+ { 176, 7, 111,{ 27106,48 },{ 27154,221 },{ 27375,24 },{ 27106,48 },{ 27154,221 },{ 27375,24 }}, // Taita/Latin/Kenya
+ { 177, 7, 187,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Senegal
+ { 177, 7, 34,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Burkina Faso
+ { 177, 7, 37,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Cameroon
+ { 177, 7, 80,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Gambia
+ { 177, 7, 83,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Ghana
+ { 177, 7, 91,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Guinea
+ { 177, 7, 92,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Guinea Bissau
+ { 177, 7, 121,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Liberia
+ { 177, 7, 136,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Mauritania
+ { 177, 7, 156,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Niger
+ { 177, 7, 157,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Nigeria
+ { 177, 7, 189,{ 27399,48 },{ 27447,77 },{ 27524,24 },{ 27399,48 },{ 27447,77 },{ 27524,24 }}, // Fulah/Latin/Sierra Leone
+ { 177, 134, 91,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Fulah/Adlam/Guinea
+ { 178, 7, 111,{ 27548,48 },{ 27596,185 },{ 27781,24 },{ 27548,48 },{ 27596,185 },{ 27781,24 }}, // Kikuyu/Latin/Kenya
+ { 179, 7, 111,{ 27805,48 },{ 27853,173 },{ 28026,24 },{ 27805,48 },{ 27853,173 },{ 28026,24 }}, // Samburu/Latin/Kenya
+ { 180, 7, 146,{ 28050,48 },{ 28098,88 },{ 134,24 },{ 28050,48 },{ 28098,88 },{ 134,24 }}, // Sena/Latin/Mozambique
+ { 181, 7, 240,{ 28186,52 },{ 28238,112 },{ 28350,24 },{ 28186,52 },{ 28238,112 },{ 28350,24 }}, // North Ndebele/Latin/Zimbabwe
+ { 182, 7, 210,{ 28374,39 },{ 28413,194 },{ 28607,24 },{ 28374,39 },{ 28413,194 },{ 28607,24 }}, // Rombo/Latin/Tanzania
+ { 183, 9, 145,{ 28631,48 },{ 28679,81 },{ 28760,24 },{ 28631,48 },{ 28679,81 },{ 28760,24 }}, // Tachelhit/Tifinagh/Morocco
+ { 183, 7, 145,{ 28784,48 },{ 28832,81 },{ 28913,24 },{ 28784,48 },{ 28832,81 },{ 28913,24 }}, // Tachelhit/Latin/Morocco
+ { 184, 7, 3,{ 28937,48 },{ 28985,82 },{ 29067,24 },{ 29091,48 },{ 29139,84 },{ 29223,24 }}, // Kabyle/Latin/Algeria
+ { 185, 7, 221,{ 29247,48 },{ 29295,152 },{ 134,24 },{ 29247,48 },{ 29295,152 },{ 134,24 }}, // Nyankole/Latin/Uganda
+ { 186, 7, 210,{ 29447,48 },{ 29495,254 },{ 29749,24 },{ 29447,48 },{ 29495,254 },{ 29749,24 }}, // Bena/Latin/Tanzania
+ { 187, 7, 210,{ 19326,48 },{ 29773,87 },{ 134,24 },{ 19326,48 },{ 29773,87 },{ 134,24 }}, // Vunjo/Latin/Tanzania
+ { 188, 7, 132,{ 29860,47 },{ 29907,92 },{ 29999,24 },{ 29860,47 },{ 29907,92 },{ 29999,24 }}, // Bambara/Latin/Mali
+ { 188, 75, 132,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Bambara/Nko/Mali
+ { 189, 7, 111,{ 30023,48 },{ 30071,207 },{ 30278,24 },{ 30023,48 },{ 30071,207 },{ 30278,24 }}, // Embu/Latin/Kenya
+ { 190, 12, 225,{ 30302,36 },{ 30338,58 },{ 30396,24 },{ 30302,36 },{ 30338,58 },{ 30396,24 }}, // Cherokee/Cherokee/United States
+ { 191, 7, 137,{ 30420,47 },{ 30467,68 },{ 30535,24 },{ 30420,47 },{ 30467,68 },{ 30535,24 }}, // Morisyen/Latin/Mauritius
+ { 192, 7, 210,{ 19326,48 },{ 30559,264 },{ 134,24 },{ 19326,48 },{ 30559,264 },{ 134,24 }}, // Makonde/Latin/Tanzania
+ { 193, 7, 210,{ 30823,83 },{ 30906,111 },{ 31017,24 },{ 30823,83 },{ 30906,111 },{ 31017,24 }}, // Langi/Latin/Tanzania
+ { 194, 7, 221,{ 31041,48 },{ 31089,97 },{ 134,24 },{ 31041,48 },{ 31089,97 },{ 134,24 }}, // Ganda/Latin/Uganda
+ { 195, 7, 239,{ 31186,48 },{ 31234,83 },{ 31317,24 },{ 31186,48 },{ 31234,83 },{ 31317,24 }}, // Bemba/Latin/Zambia
+ { 196, 7, 39,{ 31341,48 },{ 31389,85 },{ 134,24 },{ 31341,48 },{ 31389,85 },{ 134,24 }}, // Kabuverdianu/Latin/Cape Verde
+ { 197, 7, 111,{ 31474,48 },{ 31522,86 },{ 31608,24 },{ 31474,48 },{ 31522,86 },{ 31608,24 }}, // Meru/Latin/Kenya
+ { 198, 7, 111,{ 31632,49 },{ 31681,121 },{ 31802,24 },{ 31632,49 },{ 31681,121 },{ 31802,24 }}, // Kalenjin/Latin/Kenya
+ { 199, 7, 148,{ 0,48 },{ 31826,136 },{ 134,24 },{ 0,48 },{ 31826,136 },{ 134,24 }}, // Nama/Latin/Namibia
+ { 200, 7, 210,{ 19326,48 },{ 29773,87 },{ 134,24 },{ 19326,48 },{ 29773,87 },{ 134,24 }}, // Machame/Latin/Tanzania
+ { 201, 7, 82,{ 31962,59 },{ 32021,87 },{ 13137,24 },{ 32108,48 },{ 32021,87 },{ 13137,24 }}, // Colognian/Latin/Germany
+ { 202, 7, 111,{ 32156,51 },{ 32207,132 },{ 418,27 },{ 32156,51 },{ 32207,132 },{ 418,27 }}, // Masai/Latin/Kenya
+ { 202, 7, 210,{ 32156,51 },{ 32207,132 },{ 418,27 },{ 32156,51 },{ 32207,132 },{ 418,27 }}, // Masai/Latin/Tanzania
+ { 203, 7, 221,{ 31041,48 },{ 31089,97 },{ 134,24 },{ 31041,48 },{ 31089,97 },{ 134,24 }}, // Soga/Latin/Uganda
+ { 204, 7, 111,{ 32339,48 },{ 19374,84 },{ 134,24 },{ 32339,48 },{ 19374,84 },{ 134,24 }}, // Luyia/Latin/Kenya
+ { 205, 7, 210,{ 32387,48 },{ 19374,84 },{ 134,24 },{ 32387,48 },{ 19374,84 },{ 134,24 }}, // Asu/Latin/Tanzania
+ { 206, 7, 221,{ 32435,48 },{ 32483,94 },{ 32577,24 },{ 32435,48 },{ 32483,94 },{ 32577,24 }}, // Teso/Latin/Uganda
+ { 206, 7, 111,{ 32435,48 },{ 32483,94 },{ 32577,24 },{ 32435,48 },{ 32483,94 },{ 32577,24 }}, // Teso/Latin/Kenya
+ { 207, 7, 67,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Saho/Latin/Eritrea
+ { 208, 7, 132,{ 32601,46 },{ 32647,88 },{ 32735,24 },{ 32601,46 },{ 32647,88 },{ 32735,24 }}, // Koyra Chiini/Latin/Mali
+ { 209, 7, 210,{ 19326,48 },{ 29773,87 },{ 134,24 },{ 19326,48 },{ 29773,87 },{ 134,24 }}, // Rwa/Latin/Tanzania
+ { 210, 7, 111,{ 32759,48 },{ 32807,186 },{ 32993,24 },{ 32759,48 },{ 32807,186 },{ 32993,24 }}, // Luo/Latin/Kenya
+ { 211, 7, 221,{ 29247,48 },{ 29295,152 },{ 134,24 },{ 29247,48 },{ 29295,152 },{ 134,24 }}, // Chiga/Latin/Uganda
+ { 212, 7, 145,{ 33017,48 },{ 33065,86 },{ 33151,24 },{ 33017,48 },{ 33065,86 },{ 33151,24 }}, // Central Morocco Tamazight/Latin/Morocco
+ { 213, 7, 132,{ 32601,46 },{ 32647,88 },{ 32735,24 },{ 32601,46 },{ 32647,88 },{ 32735,24 }}, // Koyraboro Senni/Latin/Mali
+ { 214, 7, 210,{ 19326,48 },{ 33175,84 },{ 134,24 },{ 19326,48 },{ 33175,84 },{ 134,24 }}, // Shambala/Latin/Tanzania
+ { 215, 13, 100,{ 33259,88 },{ 33259,88 },{ 33347,31 },{ 33259,88 },{ 33259,88 },{ 33347,31 }}, // Bodo/Devanagari/India
+ { 218, 2, 178,{ 22154,48 },{ 11286,80 },{ 11203,24 },{ 22154,48 },{ 11286,80 },{ 11203,24 }}, // Chechen/Cyrillic/Russia
+ { 219, 2, 178,{ 33378,65 },{ 33443,117 },{ 33560,30 },{ 33378,65 },{ 33590,117 },{ 33560,30 }}, // Church/Cyrillic/Russia
+ { 220, 2, 178,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Chuvash/Cyrillic/Russia
+ { 230, 7, 49,{ 33707,49 },{ 33756,99 },{ 33855,24 },{ 33707,49 },{ 33756,99 },{ 33855,24 }}, // Luba Katanga/Latin/Congo Kinshasa
+ { 231, 7, 125,{ 33879,48 },{ 33927,85 },{ 134,24 },{ 34012,59 },{ 33927,85 },{ 134,24 }}, // Luxembourgish/Latin/Luxembourg
+ { 236, 7, 21,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Walloon/Latin/Belgium
+ { 237, 7, 37,{ 34071,48 },{ 34119,195 },{ 34314,24 },{ 34071,48 },{ 34119,195 },{ 34314,24 }}, // Aghem/Latin/Cameroon
+ { 238, 7, 37,{ 34338,48 },{ 34386,90 },{ 34476,24 },{ 34338,48 },{ 34386,90 },{ 34476,24 }}, // Basaa/Latin/Cameroon
+ { 239, 7, 156,{ 32601,46 },{ 32647,88 },{ 32735,24 },{ 32601,46 },{ 32647,88 },{ 32735,24 }}, // Zarma/Latin/Niger
+ { 240, 7, 37,{ 34500,49 },{ 34549,99 },{ 34648,24 },{ 34500,49 },{ 34549,99 },{ 34648,24 }}, // Duala/Latin/Cameroon
+ { 241, 7, 187,{ 34672,36 },{ 34708,82 },{ 34790,24 },{ 34672,36 },{ 34708,82 },{ 34790,24 }}, // Jola Fonyi/Latin/Senegal
+ { 242, 7, 37,{ 34814,50 },{ 34864,141 },{ 35005,24 },{ 34814,50 },{ 34864,141 },{ 35005,24 }}, // Ewondo/Latin/Cameroon
+ { 243, 7, 37,{ 35029,39 },{ 35068,191 },{ 418,27 },{ 35029,39 },{ 35068,191 },{ 418,27 }}, // Bafia/Latin/Cameroon
+ { 244, 7, 146,{ 35259,48 },{ 35307,213 },{ 35520,24 },{ 35259,48 },{ 35307,213 },{ 35520,24 }}, // Makhuwa Meetto/Latin/Mozambique
+ { 245, 7, 37,{ 35544,48 },{ 35592,139 },{ 35731,24 },{ 35544,48 },{ 35592,139 },{ 35731,24 }}, // Mundang/Latin/Cameroon
+ { 246, 7, 37,{ 35755,51 },{ 35806,143 },{ 418,27 },{ 35755,51 },{ 35806,143 },{ 418,27 }}, // Kwasio/Latin/Cameroon
+ { 247, 7, 254,{ 35949,54 },{ 36003,96 },{ 36099,24 },{ 35949,54 },{ 36003,96 },{ 36099,24 }}, // Nuer/Latin/South Sudan
+ { 248, 2, 178,{ 36123,50 },{ 36173,116 },{ 36289,24 },{ 36123,50 },{ 36313,121 },{ 36289,24 }}, // Sakha/Cyrillic/Russia
+ { 249, 7, 210,{ 36434,48 },{ 36482,117 },{ 418,27 },{ 36434,48 },{ 36482,117 },{ 418,27 }}, // Sangu/Latin/Tanzania
+ { 251, 7, 156,{ 32601,46 },{ 32647,88 },{ 32735,24 },{ 32601,46 },{ 32647,88 },{ 32735,24 }}, // Tasawaq/Latin/Niger
+ { 252, 35, 121,{ 36599,38 },{ 36637,61 },{ 418,27 },{ 36599,38 },{ 36637,61 },{ 418,27 }}, // Vai/Vai/Liberia
+ { 252, 7, 121,{ 36698,81 },{ 36698,81 },{ 418,27 },{ 36698,81 },{ 36698,81 },{ 418,27 }}, // Vai/Latin/Liberia
+ { 253, 7, 206,{ 36779,48 },{ 36827,99 },{ 36926,24 },{ 36779,48 },{ 36827,99 },{ 36926,24 }}, // Walser/Latin/Switzerland
+ { 254, 7, 37,{ 36950,51 },{ 37001,191 },{ 418,27 },{ 36950,51 },{ 37001,191 },{ 418,27 }}, // Yangben/Latin/Cameroon
+ { 256, 7, 197,{ 37192,48 },{ 37240,85 },{ 37325,24 },{ 37349,48 },{ 37397,117 },{ 37325,24 }}, // Asturian/Latin/Spain
+ { 257, 7, 37,{ 37514,174 },{ 37514,174 },{ 418,27 },{ 37514,174 },{ 37514,174 },{ 418,27 }}, // Ngomba/Latin/Cameroon
+ { 258, 7, 37,{ 37688,102 },{ 37688,102 },{ 418,27 },{ 37688,102 },{ 37688,102 },{ 418,27 }}, // Kako/Latin/Cameroon
+ { 259, 7, 37,{ 37790,137 },{ 37927,142 },{ 38069,36 },{ 37790,137 },{ 37927,142 },{ 38069,36 }}, // Meta/Latin/Cameroon
+ { 260, 7, 37,{ 38105,165 },{ 38105,165 },{ 418,27 },{ 38105,165 },{ 38105,165 },{ 418,27 }}, // Ngiemboon/Latin/Cameroon
+ { 261, 7, 197,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Aragonese/Latin/Spain
+ { 290, 11, 100,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Manipuri/Bengali/India
+ { 309, 100, 232,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Tai Dam/Tai Viet/Vietnam
+ { 312, 7, 37,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Akoose/Latin/Cameroon
+ { 313, 7, 225,{ 38270,180 },{ 38270,180 },{ 418,27 },{ 38270,180 },{ 38270,180 },{ 418,27 }}, // Lakota/Latin/United States
+ { 314, 9, 145,{ 28631,48 },{ 28679,81 },{ 28760,24 },{ 28631,48 },{ 28679,81 },{ 28760,24 }}, // Standard Moroccan Tamazight/Tifinagh/Morocco
+ { 315, 7, 43,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Mapuche/Latin/Chile
+ { 316, 1, 103,{ 38450,105 },{ 38450,105 },{ 38555,24 },{ 38450,105 },{ 38450,105 },{ 38555,24 }}, // Central Kurdish/Arabic/Iraq
+ { 316, 1, 102,{ 38450,105 },{ 38450,105 },{ 38555,24 },{ 38450,105 },{ 38450,105 },{ 38555,24 }}, // Central Kurdish/Arabic/Iran
+ { 317, 7, 82,{ 38579,48 },{ 38627,85 },{ 9887,24 },{ 38712,60 },{ 38772,93 },{ 9887,24 }}, // Lower Sorbian/Latin/Germany
+ { 318, 7, 82,{ 38865,48 },{ 38913,86 },{ 9887,24 },{ 38999,60 },{ 39059,93 },{ 9887,24 }}, // Upper Sorbian/Latin/Germany
+ { 319, 7, 37,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Kenyang/Latin/Cameroon
+ { 320, 7, 38,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Mohawk/Latin/Canada
+ { 321, 75, 91,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Nko/Nko/Guinea
+ { 322, 7, 260,{ 39152,48 },{ 39200,91 },{ 39291,24 },{ 39152,48 },{ 39200,91 },{ 39291,24 }}, // Prussian/Latin/World
+ { 323, 7, 90,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Kiche/Latin/Guatemala
+ { 324, 7, 205,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Southern Sami/Latin/Sweden
+ { 325, 7, 205,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Lule Sami/Latin/Sweden
+ { 326, 7, 73,{ 39315,77 },{ 39392,140 },{ 39532,25 },{ 39315,77 },{ 39392,140 },{ 39532,25 }}, // Inari Sami/Latin/Finland
+ { 327, 7, 73,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Skolt Sami/Latin/Finland
+ { 328, 7, 13,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Warlpiri/Latin/Australia
+ { 346, 1, 102,{ 15079,70 },{ 15079,70 },{ 418,27 },{ 15079,70 },{ 15079,70 },{ 418,27 }}, // Mazanderani/Arabic/Iran
+ { 349, 1, 102,{ 39557,77 },{ 39557,77 },{ 418,27 },{ 39557,77 },{ 39557,77 },{ 418,27 }}, // Northern Luri/Arabic/Iran
+ { 349, 1, 103,{ 39557,77 },{ 39557,77 },{ 418,27 },{ 39557,77 },{ 39557,77 },{ 418,27 }}, // Northern Luri/Arabic/Iraq
+ { 357, 6, 97,{ 4452,39 },{ 4452,39 },{ 418,27 },{ 4452,39 },{ 4452,39 },{ 418,27 }}, // Cantonese/Traditional Han/Hong Kong
+ { 357, 5, 44,{ 4452,39 },{ 4491,38 },{ 418,27 },{ 4452,39 },{ 4491,38 },{ 418,27 }}, // Cantonese/Simplified Han/China
+ { 358, 138, 225,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Osage/Osage/United States
+ { 360, 7, 260,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Ido/Latin/World
+ { 361, 7, 260,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Lojban/Latin/World
+ { 362, 7, 106,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Sicilian/Latin/Italy
+ { 363, 1, 102,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Southern Kurdish/Arabic/Iran
+ { 364, 1, 163,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Western Balochi/Arabic/Pakistan
+ { 365, 7, 170,{ 39634,46 },{ 26264,88 },{ 39680,24 },{ 39634,46 },{ 26264,88 },{ 39680,24 }}, // Cebuano/Latin/Philippines
+ { 366, 2, 178,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Erzya/Cyrillic/Russia
+ { 367, 7, 225,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Chickasaw/Latin/United States
+ { 368, 7, 225,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Muscogee/Latin/United States
+ { 369, 7, 172,{ 370,48 },{ 370,48 },{ 418,27 },{ 370,48 },{ 370,48 },{ 418,27 }}, // Silesian/Latin/Poland
+ { 0, 0, 0,{ 0,0},{ 0,0},{ 0,0},{ 0,0},{ 0,0},{ 0,0}}, // trailing zeros
+};
+
+static const ushort months_data[] = {
+0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b,
+0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x63, 0x74, 0x3b,
+0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x63, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x79, 0x3b, 0x46, 0x65, 0x62, 0x72,
+0x75, 0x61, 0x72, 0x79, 0x3b, 0x4d, 0x61, 0x72, 0x63, 0x68, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79,
+0x3b, 0x4a, 0x75, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6c, 0x79, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65,
+0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x63, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65,
+0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b,
+0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x31, 0x3b,
+0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31,
+0x31, 0x3b, 0x31, 0x32, 0x3b, 0x31, 0x33, 0x41, 0x6d, 0x61, 0x3b, 0x47, 0x75, 0x72, 0x3b, 0x42, 0x69, 0x74, 0x3b, 0x45,
+0x6c, 0x62, 0x3b, 0x43, 0x61, 0x6d, 0x3b, 0x57, 0x61, 0x78, 0x3b, 0x41, 0x64, 0x6f, 0x3b, 0x48, 0x61, 0x67, 0x3b, 0x46,
+0x75, 0x6c, 0x3b, 0x4f, 0x6e, 0x6b, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x4d, 0x75, 0x64, 0x3b, 0x41, 0x6d, 0x61, 0x6a, 0x6a,
+0x69, 0x69, 0x3b, 0x47, 0x75, 0x72, 0x61, 0x61, 0x6e, 0x64, 0x68, 0x61, 0x6c, 0x61, 0x3b, 0x42, 0x69, 0x74, 0x6f, 0x6f,
+0x74, 0x65, 0x65, 0x73, 0x73, 0x61, 0x3b, 0x45, 0x6c, 0x62, 0x61, 0x3b, 0x43, 0x61, 0x61, 0x6d, 0x73, 0x61, 0x3b, 0x57,
+0x61, 0x78, 0x61, 0x62, 0x61, 0x6a, 0x6a, 0x69, 0x69, 0x3b, 0x41, 0x64, 0x6f, 0x6f, 0x6c, 0x65, 0x65, 0x73, 0x73, 0x61,
+0x3b, 0x48, 0x61, 0x67, 0x61, 0x79, 0x79, 0x61, 0x3b, 0x46, 0x75, 0x75, 0x6c, 0x62, 0x61, 0x6e, 0x61, 0x3b, 0x4f, 0x6e,
+0x6b, 0x6f, 0x6c, 0x6f, 0x6c, 0x65, 0x65, 0x73, 0x73, 0x61, 0x3b, 0x53, 0x61, 0x64, 0x61, 0x61, 0x73, 0x61, 0x3b, 0x4d,
+0x75, 0x64, 0x64, 0x65, 0x65, 0x3b, 0x41, 0x3b, 0x47, 0x3b, 0x42, 0x3b, 0x45, 0x3b, 0x43, 0x3b, 0x57, 0x3b, 0x41, 0x3b,
+0x48, 0x3b, 0x46, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x4d, 0x30, 0x31, 0x3b, 0x4d, 0x30, 0x32, 0x3b, 0x4d, 0x30,
+0x33, 0x3b, 0x4d, 0x30, 0x34, 0x3b, 0x4d, 0x30, 0x35, 0x3b, 0x4d, 0x30, 0x36, 0x3b, 0x4d, 0x30, 0x37, 0x3b, 0x4d, 0x30,
+0x38, 0x3b, 0x4d, 0x30, 0x39, 0x3b, 0x4d, 0x31, 0x30, 0x3b, 0x4d, 0x31, 0x31, 0x3b, 0x4d, 0x31, 0x32, 0x3b, 0x31, 0x3b,
+0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31,
+0x31, 0x3b, 0x31, 0x32, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x72, 0x74, 0x2e, 0x3b,
+0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x41,
+0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44,
+0x65, 0x73, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x65, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72,
+0x69, 0x65, 0x3b, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a,
+0x75, 0x6e, 0x69, 0x65, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x65, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b,
+0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f,
+0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x3b,
+0x73, 0x68, 0x6b, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x70, 0x72, 0x69, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x71, 0x65, 0x72, 0x3b,
+0x6b, 0x6f, 0x72, 0x72, 0x3b, 0x67, 0x75, 0x73, 0x68, 0x3b, 0x73, 0x68, 0x74, 0x3b, 0x74, 0x65, 0x74, 0x3b, 0x6e, 0xeb,
+0x6e, 0x3b, 0x64, 0x68, 0x6a, 0x3b, 0x6a, 0x61, 0x6e, 0x61, 0x72, 0x3b, 0x73, 0x68, 0x6b, 0x75, 0x72, 0x74, 0x3b, 0x6d,
+0x61, 0x72, 0x73, 0x3b, 0x70, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x71, 0x65, 0x72, 0x73, 0x68, 0x6f,
+0x72, 0x3b, 0x6b, 0x6f, 0x72, 0x72, 0x69, 0x6b, 0x3b, 0x67, 0x75, 0x73, 0x68, 0x74, 0x3b, 0x73, 0x68, 0x74, 0x61, 0x74,
+0x6f, 0x72, 0x3b, 0x74, 0x65, 0x74, 0x6f, 0x72, 0x3b, 0x6e, 0xeb, 0x6e, 0x74, 0x6f, 0x72, 0x3b, 0x64, 0x68, 0x6a, 0x65,
+0x74, 0x6f, 0x72, 0x3b, 0x6a, 0x3b, 0x73, 0x68, 0x3b, 0x6d, 0x3b, 0x70, 0x3b, 0x6d, 0x3b, 0x71, 0x3b, 0x6b, 0x3b, 0x67,
+0x3b, 0x73, 0x68, 0x3b, 0x74, 0x3b, 0x6e, 0x3b, 0x64, 0x68, 0x3b, 0x1303, 0x1295, 0x12e9, 0x3b, 0x134c, 0x1265, 0x1229, 0x3b, 0x121b,
+0x122d, 0x127d, 0x3b, 0x12a4, 0x1355, 0x122a, 0x3b, 0x121c, 0x12ed, 0x3b, 0x1301, 0x1295, 0x3b, 0x1301, 0x120b, 0x12ed, 0x3b, 0x12a6, 0x1308, 0x1235,
+0x3b, 0x1234, 0x1355, 0x1274, 0x3b, 0x12a6, 0x12ad, 0x1276, 0x3b, 0x1296, 0x126c, 0x121d, 0x3b, 0x12f2, 0x1234, 0x121d, 0x3b, 0x1303, 0x1295, 0x12e9,
+0x12c8, 0x122a, 0x3b, 0x134c, 0x1265, 0x1229, 0x12c8, 0x122a, 0x3b, 0x121b, 0x122d, 0x127d, 0x3b, 0x12a4, 0x1355, 0x122a, 0x120d, 0x3b, 0x121c, 0x12ed,
+0x3b, 0x1301, 0x1295, 0x3b, 0x1301, 0x120b, 0x12ed, 0x3b, 0x12a6, 0x1308, 0x1235, 0x1275, 0x3b, 0x1234, 0x1355, 0x1274, 0x121d, 0x1260, 0x122d, 0x3b,
+0x12a6, 0x12ad, 0x1276, 0x1260, 0x122d, 0x3b, 0x1296, 0x126c, 0x121d, 0x1260, 0x122d, 0x3b, 0x12f2, 0x1234, 0x121d, 0x1260, 0x122d, 0x3b, 0x1303, 0x3b,
+0x134c, 0x3b, 0x121b, 0x3b, 0x12a4, 0x3b, 0x121c, 0x3b, 0x1301, 0x3b, 0x1301, 0x3b, 0x12a6, 0x3b, 0x1234, 0x3b, 0x12a6, 0x3b, 0x1296, 0x3b,
+0x12f2, 0x3b, 0x64a, 0x646, 0x627, 0x64a, 0x631, 0x3b, 0x641, 0x628, 0x631, 0x627, 0x64a, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b,
+0x623, 0x628, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x646, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x644,
+0x64a, 0x648, 0x3b, 0x623, 0x63a, 0x633, 0x637, 0x633, 0x3b, 0x633, 0x628, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648,
+0x628, 0x631, 0x3b, 0x646, 0x648, 0x641, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x64a, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x64a, 0x3b, 0x641,
+0x3b, 0x645, 0x3b, 0x623, 0x3b, 0x648, 0x3b, 0x646, 0x3b, 0x644, 0x3b, 0x63a, 0x3b, 0x633, 0x3b, 0x643, 0x3b, 0x628, 0x3b, 0x62f,
+0x3b, 0x62c, 0x627, 0x646, 0x641, 0x64a, 0x3b, 0x641, 0x64a, 0x641, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x623, 0x641,
+0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x3b, 0x62c, 0x648, 0x627, 0x646, 0x3b, 0x62c, 0x648, 0x64a, 0x644, 0x64a, 0x629, 0x3b,
+0x623, 0x648, 0x62a, 0x3b, 0x633, 0x628, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648,
+0x641, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x64a, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x623, 0x3b,
+0x645, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x623, 0x3b, 0x633, 0x3b, 0x623, 0x3b, 0x646, 0x3b, 0x62f, 0x3b, 0x643, 0x627, 0x646, 0x648,
+0x646, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x64a, 0x3b, 0x634, 0x628, 0x627, 0x637, 0x3b, 0x622, 0x630, 0x627, 0x631, 0x3b, 0x646,
+0x64a, 0x633, 0x627, 0x646, 0x3b, 0x623, 0x64a, 0x627, 0x631, 0x3b, 0x62d, 0x632, 0x64a, 0x631, 0x627, 0x646, 0x3b, 0x62a, 0x645, 0x648,
+0x632, 0x3b, 0x622, 0x628, 0x3b, 0x623, 0x64a, 0x644, 0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x64a, 0x646, 0x20, 0x627, 0x644, 0x623,
+0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x64a, 0x646, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x64a, 0x3b, 0x643, 0x627, 0x646, 0x648,
+0x646, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x643, 0x3b, 0x634, 0x3b, 0x622, 0x3b, 0x646, 0x3b, 0x623, 0x3b, 0x62d, 0x3b,
+0x62a, 0x3b, 0x622, 0x3b, 0x623, 0x3b, 0x62a, 0x3b, 0x62a, 0x3b, 0x643, 0x3b, 0x643, 0x627, 0x646, 0x648, 0x646, 0x20, 0x627, 0x644,
+0x62b, 0x627, 0x646, 0x64a, 0x3b, 0x634, 0x628, 0x627, 0x637, 0x3b, 0x622, 0x630, 0x627, 0x631, 0x3b, 0x646, 0x64a, 0x633, 0x627, 0x646,
+0x3b, 0x623, 0x64a, 0x627, 0x631, 0x3b, 0x62d, 0x632, 0x64a, 0x631, 0x627, 0x646, 0x3b, 0x62a, 0x645, 0x648, 0x632, 0x3b, 0x622, 0x628,
+0x3b, 0x623, 0x64a, 0x644, 0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x64a, 0x646, 0xa0, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x62a,
+0x634, 0x631, 0x64a, 0x646, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x64a, 0x3b, 0x643, 0x627, 0x646, 0x648, 0x646, 0x20, 0x627, 0x644,
+0x623, 0x648, 0x644, 0x3b, 0x64a, 0x646, 0x627, 0x64a, 0x631, 0x3b, 0x641, 0x628, 0x631, 0x627, 0x64a, 0x631, 0x3b, 0x645, 0x627, 0x631,
+0x633, 0x3b, 0x625, 0x628, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x646, 0x64a, 0x648, 0x3b, 0x64a,
+0x648, 0x644, 0x64a, 0x648, 0x3b, 0x623, 0x63a, 0x634, 0x62a, 0x3b, 0x634, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648,
+0x628, 0x631, 0x3b, 0x646, 0x648, 0x641, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x62c, 0x645, 0x628, 0x631, 0x3b, 0x64a, 0x3b, 0x641, 0x3b,
+0x645, 0x3b, 0x625, 0x3b, 0x648, 0x3b, 0x646, 0x3b, 0x644, 0x3b, 0x63a, 0x3b, 0x634, 0x3b, 0x643, 0x3b, 0x628, 0x3b, 0x62f, 0x3b,
+0x64a, 0x646, 0x627, 0x64a, 0x631, 0x3b, 0x641, 0x628, 0x631, 0x627, 0x64a, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x623, 0x628,
+0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x3b, 0x64a, 0x648, 0x646, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x644, 0x64a, 0x648, 0x632,
+0x3b, 0x63a, 0x634, 0x62a, 0x3b, 0x634, 0x62a, 0x646, 0x628, 0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648,
+0x646, 0x628, 0x631, 0x3b, 0x62f, 0x62c, 0x646, 0x628, 0x631, 0x3b, 0x64a, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x623, 0x3b, 0x645, 0x3b,
+0x646, 0x3b, 0x644, 0x3b, 0x63a, 0x3b, 0x634, 0x3b, 0x643, 0x3b, 0x628, 0x3b, 0x62f, 0x3b, 0x570, 0x576, 0x57e, 0x3b, 0x583, 0x57f,
+0x57e, 0x3b, 0x574, 0x580, 0x57f, 0x3b, 0x561, 0x57a, 0x580, 0x3b, 0x574, 0x575, 0x57d, 0x3b, 0x570, 0x576, 0x57d, 0x3b, 0x570, 0x56c,
+0x57d, 0x3b, 0x585, 0x563, 0x57d, 0x3b, 0x57d, 0x565, 0x57a, 0x3b, 0x570, 0x578, 0x56f, 0x3b, 0x576, 0x578, 0x575, 0x3b, 0x564, 0x565,
+0x56f, 0x3b, 0x570, 0x578, 0x582, 0x576, 0x57e, 0x561, 0x580, 0x3b, 0x583, 0x565, 0x57f, 0x580, 0x57e, 0x561, 0x580, 0x3b, 0x574, 0x561,
+0x580, 0x57f, 0x3b, 0x561, 0x57a, 0x580, 0x56b, 0x56c, 0x3b, 0x574, 0x561, 0x575, 0x56b, 0x57d, 0x3b, 0x570, 0x578, 0x582, 0x576, 0x56b,
+0x57d, 0x3b, 0x570, 0x578, 0x582, 0x56c, 0x56b, 0x57d, 0x3b, 0x585, 0x563, 0x578, 0x57d, 0x57f, 0x578, 0x57d, 0x3b, 0x57d, 0x565, 0x57a,
+0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x570, 0x578, 0x56f, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x576, 0x578, 0x575,
+0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x564, 0x565, 0x56f, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x540, 0x3b, 0x553, 0x3b,
+0x544, 0x3b, 0x531, 0x3b, 0x544, 0x3b, 0x540, 0x3b, 0x540, 0x3b, 0x555, 0x3b, 0x54d, 0x3b, 0x540, 0x3b, 0x546, 0x3b, 0x534, 0x3b,
+0x570, 0x578, 0x582, 0x576, 0x57e, 0x561, 0x580, 0x56b, 0x3b, 0x583, 0x565, 0x57f, 0x580, 0x57e, 0x561, 0x580, 0x56b, 0x3b, 0x574, 0x561,
+0x580, 0x57f, 0x56b, 0x3b, 0x561, 0x57a, 0x580, 0x56b, 0x56c, 0x56b, 0x3b, 0x574, 0x561, 0x575, 0x56b, 0x57d, 0x56b, 0x3b, 0x570, 0x578,
+0x582, 0x576, 0x56b, 0x57d, 0x56b, 0x3b, 0x570, 0x578, 0x582, 0x56c, 0x56b, 0x57d, 0x56b, 0x3b, 0x585, 0x563, 0x578, 0x57d, 0x57f, 0x578,
+0x57d, 0x56b, 0x3b, 0x57d, 0x565, 0x57a, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x56b, 0x3b, 0x570, 0x578, 0x56f, 0x57f, 0x565, 0x574,
+0x562, 0x565, 0x580, 0x56b, 0x3b, 0x576, 0x578, 0x575, 0x565, 0x574, 0x562, 0x565, 0x580, 0x56b, 0x3b, 0x564, 0x565, 0x56f, 0x57f, 0x565,
+0x574, 0x562, 0x565, 0x580, 0x56b, 0x3b, 0x99c, 0x9be, 0x9a8, 0x9c1, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x9cd, 0x9f0, 0x9c1, 0x3b, 0x9ae, 0x9be,
+0x9f0, 0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9f0, 0x9bf, 0x9b2, 0x3b, 0x9ae, 0x9c7, 0x2019, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c,
+0x9c1, 0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x3b, 0x99b, 0x9c7, 0x9aa, 0x9cd, 0x9a4, 0x9c7, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb,
+0x3b, 0x9a8, 0x9f1, 0x9c7, 0x3b, 0x9a1, 0x9bf, 0x99a, 0x9c7, 0x3b, 0x99c, 0x9be, 0x9a8, 0x9c1, 0x9f1, 0x9be, 0x9f0, 0x9c0, 0x3b, 0x9ab,
+0x9c7, 0x9ac, 0x9cd, 0x9f0, 0x9c1, 0x9f1, 0x9be, 0x9f0, 0x9c0, 0x3b, 0x9ae, 0x9be, 0x9f0, 0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9f0,
+0x9bf, 0x9b2, 0x3b, 0x9ae, 0x9c7, 0x2019, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x9b7,
+0x9cd, 0x99f, 0x3b, 0x99b, 0x9c7, 0x9aa, 0x9cd, 0x9a4, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9f0, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x9ac,
+0x9f0, 0x3b, 0x9a8, 0x9f1, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9f0, 0x3b, 0x9a1, 0x9bf, 0x99a, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9f0, 0x3b, 0x99c,
+0x3b, 0x9ab, 0x3b, 0x9ae, 0x3b, 0x98f, 0x3b, 0x9ae, 0x3b, 0x99c, 0x3b, 0x99c, 0x3b, 0x986, 0x3b, 0x99b, 0x3b, 0x985, 0x3b, 0x9a8,
+0x3b, 0x9a1, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x76, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d,
+0x61, 0x79, 0x3b, 0x69, 0x79, 0x6e, 0x3b, 0x69, 0x79, 0x6c, 0x3b, 0x61, 0x76, 0x71, 0x3b, 0x73, 0x65, 0x6e, 0x3b, 0x6f,
+0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x79, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x79, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x46, 0x65,
+0x76, 0x72, 0x61, 0x6c, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x3b,
+0x130, 0x79, 0x75, 0x6e, 0x3b, 0x130, 0x79, 0x75, 0x6c, 0x3b, 0x41, 0x76, 0x71, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x6e,
+0x74, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x4e, 0x6f, 0x79, 0x61, 0x62, 0x72,
+0x3b, 0x64, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0x79, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x76, 0x72, 0x61,
+0x6c, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x69, 0x79, 0x75,
+0x6e, 0x3b, 0x69, 0x79, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x71, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x6e, 0x74, 0x79, 0x61,
+0x62, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x6e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x64, 0x65,
+0x6b, 0x61, 0x62, 0x72, 0x3b, 0x458, 0x430, 0x43d, 0x3b, 0x444, 0x435, 0x432, 0x3b, 0x43c, 0x430, 0x440, 0x3b, 0x430, 0x43f, 0x440,
+0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x458, 0x43d, 0x3b, 0x438, 0x458, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435, 0x43d,
+0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x458, 0x3b, 0x434, 0x435, 0x43a, 0x3b, 0x408, 0x430, 0x43d, 0x432, 0x430, 0x440, 0x3b,
+0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x3b, 0x410, 0x43f, 0x440, 0x435, 0x43b, 0x3b, 0x41c, 0x430,
+0x439, 0x3b, 0x418, 0x458, 0x443, 0x43d, 0x3b, 0x418, 0x458, 0x443, 0x43b, 0x3b, 0x410, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421,
+0x435, 0x43d, 0x442, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x41e, 0x43a, 0x442, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x41d, 0x43e, 0x458, 0x430,
+0x431, 0x440, 0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0x458, 0x430, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x444, 0x435, 0x432,
+0x440, 0x430, 0x43b, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438,
+0x458, 0x443, 0x43d, 0x3b, 0x438, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43d, 0x442,
+0x458, 0x430, 0x431, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x43d, 0x43e, 0x458, 0x430, 0x431, 0x440, 0x3b,
+0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0x75, 0x72, 0x74, 0x2e, 0x3b, 0x6f, 0x74, 0x73, 0x2e, 0x3b, 0x6d, 0x61, 0x72,
+0x2e, 0x3b, 0x61, 0x70, 0x69, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x2e, 0x3b, 0x65, 0x6b, 0x61, 0x2e, 0x3b, 0x75, 0x7a, 0x74,
+0x2e, 0x3b, 0x61, 0x62, 0x75, 0x2e, 0x3b, 0x69, 0x72, 0x61, 0x2e, 0x3b, 0x75, 0x72, 0x72, 0x2e, 0x3b, 0x61, 0x7a, 0x61,
+0x2e, 0x3b, 0x61, 0x62, 0x65, 0x2e, 0x3b, 0x75, 0x72, 0x74, 0x61, 0x72, 0x72, 0x69, 0x6c, 0x61, 0x3b, 0x6f, 0x74, 0x73,
+0x61, 0x69, 0x6c, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x78, 0x6f, 0x61, 0x3b, 0x61, 0x70, 0x69, 0x72, 0x69, 0x6c, 0x61,
+0x3b, 0x6d, 0x61, 0x69, 0x61, 0x74, 0x7a, 0x61, 0x3b, 0x65, 0x6b, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x75, 0x7a, 0x74, 0x61,
+0x69, 0x6c, 0x61, 0x3b, 0x61, 0x62, 0x75, 0x7a, 0x74, 0x75, 0x61, 0x3b, 0x69, 0x72, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x75,
+0x72, 0x72, 0x69, 0x61, 0x3b, 0x61, 0x7a, 0x61, 0x72, 0x6f, 0x61, 0x3b, 0x61, 0x62, 0x65, 0x6e, 0x64, 0x75, 0x61, 0x3b,
+0x55, 0x3b, 0x4f, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x55, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x55, 0x3b,
+0x41, 0x3b, 0x41, 0x3b, 0x99c, 0x9be, 0x9a8, 0x9c1, 0x9af, 0x9bc, 0x9be, 0x9b0, 0x9c0, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x9cd, 0x9b0, 0x9c1,
+0x9af, 0x9bc, 0x9be, 0x9b0, 0x9c0, 0x3b, 0x9ae, 0x9be, 0x9b0, 0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9b0, 0x9bf, 0x9b2, 0x3b, 0x9ae,
+0x9c7, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x9b8, 0x9cd, 0x99f, 0x3b, 0x9b8, 0x9c7,
+0x9aa, 0x9cd, 0x99f, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x9ac, 0x9b0, 0x3b, 0x9a8, 0x9ad, 0x9c7,
+0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x9a1, 0x9bf, 0x9b8, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x99c, 0x9be, 0x3b, 0x9ab, 0x9c7, 0x3b,
+0x9ae, 0x9be, 0x3b, 0x98f, 0x3b, 0x9ae, 0x9c7, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x3b, 0x986, 0x3b, 0x9b8, 0x9c7, 0x3b,
+0x985, 0x3b, 0x9a8, 0x3b, 0x9a1, 0x9bf, 0x3b, 0x99c, 0x9be, 0x9a8, 0x9c1, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x3b, 0x9ae, 0x9be, 0x9b0, 0x9cd,
+0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9b0, 0x9bf, 0x9b2, 0x3b, 0x9ae, 0x9c7, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be,
+0x987, 0x3b, 0x986, 0x997, 0x9b8, 0x9cd, 0x99f, 0x3b, 0x9b8, 0x9c7, 0x9aa, 0x9cd, 0x99f, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x985,
+0x995, 0x9cd, 0x99f, 0x9cb, 0x9ac, 0x9b0, 0x3b, 0x9a8, 0x9ad, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x9a1, 0x9bf, 0x9b8, 0x9c7, 0x9ae,
+0x9cd, 0x9ac, 0x9b0, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf22, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf23, 0x3b, 0xf5f,
+0xfb3, 0xf0b, 0xf24, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf25, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf26, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf27, 0x3b, 0xf5f,
+0xfb3, 0xf0b, 0xf28, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf29, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0xf20, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0xf21,
+0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0xf22, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf44, 0xf54, 0xf0b, 0x3b,
+0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72,
+0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf66, 0xf74, 0xf58, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b,
+0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0xf0b, 0x3b,
+0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xfb2, 0xf74, 0xf42, 0xf0b, 0xf54, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b,
+0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56,
+0xf62, 0xf92, 0xfb1, 0xf51, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf42, 0xf74, 0xf0b,
+0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4,
+0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4,
+0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf21, 0x3b,
+0xf22, 0x3b, 0xf23, 0x3b, 0xf24, 0x3b, 0xf25, 0x3b, 0xf26, 0x3b, 0xf27, 0x3b, 0xf28, 0x3b, 0xf29, 0x3b, 0xf21, 0xf20, 0x3b, 0xf21,
+0xf21, 0x3b, 0xf21, 0xf22, 0x3b, 0xf21, 0x3b, 0xf22, 0x3b, 0xf23, 0x3b, 0xf24, 0x3b, 0xf25, 0x3b, 0xf26, 0x3b, 0xf27, 0x3b, 0xf28,
+0x3b, 0xf29, 0x3b, 0xf21, 0xf20, 0x3b, 0xf21, 0xf21, 0x3b, 0x31, 0x32, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf44, 0xf54, 0xf0b, 0x3b,
+0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf66, 0xf74, 0xf58, 0xf0b, 0xf54,
+0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0xf0b,
+0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xfb2, 0xf74, 0xf42, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54,
+0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf62, 0xf92, 0xfb1, 0xf51, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf42, 0xf74,
+0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74,
+0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66,
+0xf0b, 0xf54, 0xf0b, 0x3b, 0xf21, 0x3b, 0xf22, 0x3b, 0xf23, 0x3b, 0x34, 0x3b, 0xf25, 0x3b, 0xf26, 0x3b, 0xf27, 0x3b, 0xf28, 0x3b,
+0x39, 0x3b, 0xf21, 0xf20, 0x3b, 0xf21, 0xf21, 0x3b, 0xf21, 0xf22, 0x3b, 0x47, 0x65, 0x6e, 0x2e, 0x3b, 0x43, 0x2bc, 0x68, 0x77,
+0x65, 0x2e, 0x3b, 0x4d, 0x65, 0x75, 0x72, 0x2e, 0x3b, 0x45, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x65, 0x3b, 0x4d, 0x65,
+0x7a, 0x68, 0x2e, 0x3b, 0x47, 0x6f, 0x75, 0x65, 0x2e, 0x3b, 0x45, 0x6f, 0x73, 0x74, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x2e,
+0x3b, 0x48, 0x65, 0x72, 0x65, 0x3b, 0x44, 0x75, 0x3b, 0x4b, 0x7a, 0x75, 0x2e, 0x3b, 0x47, 0x65, 0x6e, 0x76, 0x65, 0x72,
+0x3b, 0x43, 0x2bc, 0x68, 0x77, 0x65, 0x76, 0x72, 0x65, 0x72, 0x3b, 0x4d, 0x65, 0x75, 0x72, 0x7a, 0x68, 0x3b, 0x45, 0x62,
+0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0x65, 0x3b, 0x4d, 0x65, 0x7a, 0x68, 0x65, 0x76, 0x65, 0x6e, 0x3b, 0x47, 0x6f, 0x75,
+0x65, 0x72, 0x65, 0x3b, 0x45, 0x6f, 0x73, 0x74, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x67, 0x6f, 0x6c, 0x6f, 0x3b, 0x48, 0x65,
+0x72, 0x65, 0x3b, 0x44, 0x75, 0x3b, 0x4b, 0x65, 0x72, 0x7a, 0x75, 0x3b, 0x30, 0x31, 0x3b, 0x30, 0x32, 0x3b, 0x30, 0x33,
+0x3b, 0x30, 0x34, 0x3b, 0x30, 0x35, 0x3b, 0x30, 0x36, 0x3b, 0x30, 0x37, 0x3b, 0x30, 0x38, 0x3b, 0x30, 0x39, 0x3b, 0x31,
+0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31, 0x32, 0x3b, 0x44f, 0x43d, 0x443, 0x3b, 0x444, 0x435, 0x432, 0x3b, 0x43c, 0x430, 0x440, 0x442,
+0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x44e, 0x43d, 0x438, 0x3b, 0x44e, 0x43b, 0x438, 0x3b, 0x430, 0x432, 0x433,
+0x3b, 0x441, 0x435, 0x43f, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x435, 0x3b, 0x434, 0x435, 0x43a, 0x3b, 0x44f, 0x43d, 0x443,
+0x430, 0x440, 0x438, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x443, 0x430, 0x440, 0x438, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f,
+0x440, 0x438, 0x43b, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x44e, 0x43d, 0x438, 0x3b, 0x44e, 0x43b, 0x438, 0x3b, 0x430, 0x432, 0x433, 0x443,
+0x441, 0x442, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x43c, 0x432, 0x440,
+0x438, 0x3b, 0x43d, 0x43e, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x434, 0x435, 0x43a, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x44f,
+0x3b, 0x444, 0x3b, 0x43c, 0x3b, 0x430, 0x3b, 0x43c, 0x3b, 0x44e, 0x3b, 0x44e, 0x3b, 0x430, 0x3b, 0x441, 0x3b, 0x43e, 0x3b, 0x43d,
+0x3b, 0x434, 0x3b, 0x1007, 0x1014, 0x103a, 0x3b, 0x1016, 0x1031, 0x3b, 0x1019, 0x1010, 0x103a, 0x3b, 0x1027, 0x3b, 0x1019, 0x1031, 0x3b, 0x1007,
+0x103d, 0x1014, 0x103a, 0x3b, 0x1007, 0x1030, 0x3b, 0x1029, 0x3b, 0x1005, 0x1000, 0x103a, 0x3b, 0x1021, 0x1031, 0x102c, 0x1000, 0x103a, 0x3b, 0x1014,
+0x102d, 0x102f, 0x3b, 0x1012, 0x102e, 0x3b, 0x1007, 0x1014, 0x103a, 0x1014, 0x101d, 0x102b, 0x101b, 0x102e, 0x3b, 0x1016, 0x1031, 0x1016, 0x1031, 0x102c,
+0x103a, 0x101d, 0x102b, 0x101b, 0x102e, 0x3b, 0x1019, 0x1010, 0x103a, 0x3b, 0x1027, 0x1015, 0x103c, 0x102e, 0x3b, 0x1019, 0x1031, 0x3b, 0x1007, 0x103d,
+0x1014, 0x103a, 0x3b, 0x1007, 0x1030, 0x101c, 0x102d, 0x102f, 0x1004, 0x103a, 0x3b, 0x1029, 0x1002, 0x102f, 0x1010, 0x103a, 0x3b, 0x1005, 0x1000, 0x103a,
+0x1010, 0x1004, 0x103a, 0x1018, 0x102c, 0x3b, 0x1021, 0x1031, 0x102c, 0x1000, 0x103a, 0x1010, 0x102d, 0x102f, 0x1018, 0x102c, 0x3b, 0x1014, 0x102d, 0x102f,
+0x101d, 0x1004, 0x103a, 0x1018, 0x102c, 0x3b, 0x1012, 0x102e, 0x1007, 0x1004, 0x103a, 0x1018, 0x102c, 0x3b, 0x1007, 0x3b, 0x1016, 0x3b, 0x1019, 0x3b,
+0x1027, 0x3b, 0x1019, 0x3b, 0x1007, 0x3b, 0x1007, 0x3b, 0x1029, 0x3b, 0x1005, 0x3b, 0x1021, 0x3b, 0x1014, 0x3b, 0x1012, 0x3b, 0x441, 0x442,
+0x443, 0x3b, 0x43b, 0x44e, 0x442, 0x3b, 0x441, 0x430, 0x43a, 0x3b, 0x43a, 0x440, 0x430, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x447, 0x44d,
+0x440, 0x3b, 0x43b, 0x456, 0x43f, 0x3b, 0x436, 0x43d, 0x456, 0x3b, 0x432, 0x435, 0x440, 0x3b, 0x43a, 0x430, 0x441, 0x3b, 0x43b, 0x456,
+0x441, 0x3b, 0x441, 0x43d, 0x435, 0x3b, 0x441, 0x442, 0x443, 0x434, 0x437, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x44e, 0x442, 0x44b, 0x3b,
+0x441, 0x430, 0x43a, 0x430, 0x432, 0x456, 0x43a, 0x3b, 0x43a, 0x440, 0x430, 0x441, 0x430, 0x432, 0x456, 0x43a, 0x3b, 0x43c, 0x430, 0x439,
+0x3b, 0x447, 0x44d, 0x440, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x456, 0x43f, 0x435, 0x43d, 0x44c, 0x3b, 0x436, 0x43d, 0x456, 0x432,
+0x435, 0x43d, 0x44c, 0x3b, 0x432, 0x435, 0x440, 0x430, 0x441, 0x435, 0x43d, 0x44c, 0x3b, 0x43a, 0x430, 0x441, 0x442, 0x440, 0x44b, 0x447,
+0x43d, 0x456, 0x43a, 0x3b, 0x43b, 0x456, 0x441, 0x442, 0x430, 0x43f, 0x430, 0x434, 0x3b, 0x441, 0x43d, 0x435, 0x436, 0x430, 0x43d, 0x44c,
+0x3b, 0x441, 0x3b, 0x43b, 0x3b, 0x441, 0x3b, 0x43a, 0x3b, 0x43c, 0x3b, 0x447, 0x3b, 0x43b, 0x3b, 0x436, 0x3b, 0x432, 0x3b, 0x43a,
+0x3b, 0x43b, 0x3b, 0x441, 0x3b, 0x441, 0x442, 0x443, 0x3b, 0x43b, 0x44e, 0x442, 0x3b, 0x441, 0x430, 0x43a, 0x3b, 0x43a, 0x440, 0x430,
+0x3b, 0x43c, 0x430, 0x44f, 0x3b, 0x447, 0x44d, 0x440, 0x3b, 0x43b, 0x456, 0x43f, 0x3b, 0x436, 0x43d, 0x456, 0x3b, 0x432, 0x435, 0x440,
+0x3b, 0x43a, 0x430, 0x441, 0x3b, 0x43b, 0x456, 0x441, 0x3b, 0x441, 0x43d, 0x435, 0x3b, 0x441, 0x442, 0x443, 0x434, 0x437, 0x435, 0x43d,
+0x44f, 0x3b, 0x43b, 0x44e, 0x442, 0x430, 0x433, 0x430, 0x3b, 0x441, 0x430, 0x43a, 0x430, 0x432, 0x456, 0x43a, 0x430, 0x3b, 0x43a, 0x440,
+0x430, 0x441, 0x430, 0x432, 0x456, 0x43a, 0x430, 0x3b, 0x43c, 0x430, 0x44f, 0x3b, 0x447, 0x44d, 0x440, 0x432, 0x435, 0x43d, 0x44f, 0x3b,
+0x43b, 0x456, 0x43f, 0x435, 0x43d, 0x44f, 0x3b, 0x436, 0x43d, 0x456, 0x45e, 0x43d, 0x44f, 0x3b, 0x432, 0x435, 0x440, 0x430, 0x441, 0x43d,
+0x44f, 0x3b, 0x43a, 0x430, 0x441, 0x442, 0x440, 0x44b, 0x447, 0x43d, 0x456, 0x43a, 0x430, 0x3b, 0x43b, 0x456, 0x441, 0x442, 0x430, 0x43f,
+0x430, 0x434, 0x430, 0x3b, 0x441, 0x43d, 0x435, 0x436, 0x43d, 0x44f, 0x3b, 0x1798, 0x1780, 0x179a, 0x17b6, 0x3b, 0x1780, 0x17bb, 0x1798, 0x17d2,
+0x1797, 0x17c8, 0x3b, 0x1798, 0x17b8, 0x1793, 0x17b6, 0x3b, 0x1798, 0x17c1, 0x179f, 0x17b6, 0x3b, 0x17a7, 0x179f, 0x1797, 0x17b6, 0x3b, 0x1798, 0x17b7,
+0x1790, 0x17bb, 0x1793, 0x17b6, 0x3b, 0x1780, 0x1780, 0x17d2, 0x1780, 0x178a, 0x17b6, 0x3b, 0x179f, 0x17b8, 0x17a0, 0x17b6, 0x3b, 0x1780, 0x1789, 0x17d2,
+0x1789, 0x17b6, 0x3b, 0x178f, 0x17bb, 0x179b, 0x17b6, 0x3b, 0x179c, 0x17b7, 0x1785, 0x17d2, 0x1786, 0x17b7, 0x1780, 0x17b6, 0x3b, 0x1792, 0x17d2, 0x1793,
+0x17bc, 0x3b, 0x1798, 0x3b, 0x1780, 0x3b, 0x1798, 0x3b, 0x1798, 0x3b, 0x17a7, 0x3b, 0x1798, 0x3b, 0x1780, 0x3b, 0x179f, 0x3b, 0x1780, 0x3b,
+0x178f, 0x3b, 0x179c, 0x3b, 0x1792, 0x3b, 0x67, 0x65, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72,
+0xe7, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x67, 0x3b, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x6a, 0x75, 0x6c,
+0x2e, 0x3b, 0x61, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e,
+0x3b, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x3b, 0x6d,
+0x61, 0x72, 0xe7, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x67, 0x3b, 0x6a, 0x75, 0x6e, 0x79, 0x3b,
+0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x6c, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72,
+0x65, 0x3b, 0x6f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64,
+0x65, 0x73, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x47, 0x4e, 0x3b, 0x46, 0x42, 0x3b, 0x4d, 0xc7, 0x3b, 0x41, 0x42, 0x3b,
+0x4d, 0x47, 0x3b, 0x4a, 0x4e, 0x3b, 0x4a, 0x4c, 0x3b, 0x41, 0x47, 0x3b, 0x53, 0x54, 0x3b, 0x4f, 0x43, 0x3b, 0x4e, 0x56,
+0x3b, 0x44, 0x53, 0x3b, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x66, 0x65, 0x62, 0x72, 0x2e,
+0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x72, 0xe7, 0x3b, 0x64, 0x2019, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x6d,
+0x61, 0x69, 0x67, 0x3b, 0x64, 0x65, 0x20, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x64, 0x65, 0x20, 0x6a, 0x75, 0x6c, 0x2e, 0x3b,
+0x64, 0x2019, 0x61, 0x67, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2e, 0x3b, 0x64, 0x2019, 0x6f, 0x63, 0x74, 0x2e,
+0x3b, 0x64, 0x65, 0x20, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x64, 0x65, 0x20,
+0x67, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x20, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x20, 0x6d,
+0x61, 0x72, 0xe7, 0x3b, 0x64, 0x2019, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x69, 0x67, 0x3b,
+0x64, 0x65, 0x20, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x64, 0x65, 0x20, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x6c, 0x3b, 0x64, 0x2019,
+0x61, 0x67, 0x6f, 0x73, 0x74, 0x3b, 0x64, 0x65, 0x20, 0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x2019,
+0x6f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x65, 0x20, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b,
+0x64, 0x65, 0x20, 0x64, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x31, 0x6708, 0x3b, 0x32, 0x6708, 0x3b, 0x33, 0x6708,
+0x3b, 0x34, 0x6708, 0x3b, 0x35, 0x6708, 0x3b, 0x36, 0x6708, 0x3b, 0x37, 0x6708, 0x3b, 0x38, 0x6708, 0x3b, 0x39, 0x6708, 0x3b, 0x31,
+0x30, 0x6708, 0x3b, 0x31, 0x31, 0x6708, 0x3b, 0x31, 0x32, 0x6708, 0x3b, 0x4e00, 0x6708, 0x3b, 0x4e8c, 0x6708, 0x3b, 0x4e09, 0x6708, 0x3b,
+0x56db, 0x6708, 0x3b, 0x4e94, 0x6708, 0x3b, 0x516d, 0x6708, 0x3b, 0x4e03, 0x6708, 0x3b, 0x516b, 0x6708, 0x3b, 0x4e5d, 0x6708, 0x3b, 0x5341, 0x6708,
+0x3b, 0x5341, 0x4e00, 0x6708, 0x3b, 0x5341, 0x4e8c, 0x6708, 0x3b, 0x73, 0x69, 0x6a, 0x3b, 0x76, 0x65, 0x6c, 0x6a, 0x3b, 0x6f, 0x17e,
+0x75, 0x3b, 0x74, 0x72, 0x61, 0x3b, 0x73, 0x76, 0x69, 0x3b, 0x6c, 0x69, 0x70, 0x3b, 0x73, 0x72, 0x70, 0x3b, 0x6b, 0x6f,
+0x6c, 0x3b, 0x72, 0x75, 0x6a, 0x3b, 0x6c, 0x69, 0x73, 0x3b, 0x73, 0x74, 0x75, 0x3b, 0x70, 0x72, 0x6f, 0x3b, 0x73, 0x69,
+0x6a, 0x65, 0x10d, 0x61, 0x6e, 0x6a, 0x3b, 0x76, 0x65, 0x6c, 0x6a, 0x61, 0x10d, 0x61, 0x3b, 0x6f, 0x17e, 0x75, 0x6a, 0x61,
+0x6b, 0x3b, 0x74, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x6a, 0x3b, 0x73, 0x76, 0x69, 0x62, 0x61, 0x6e, 0x6a, 0x3b, 0x6c, 0x69,
+0x70, 0x61, 0x6e, 0x6a, 0x3b, 0x73, 0x72, 0x70, 0x61, 0x6e, 0x6a, 0x3b, 0x6b, 0x6f, 0x6c, 0x6f, 0x76, 0x6f, 0x7a, 0x3b,
+0x72, 0x75, 0x6a, 0x61, 0x6e, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x3b, 0x73, 0x74, 0x75, 0x64, 0x65,
+0x6e, 0x69, 0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e, 0x61, 0x63, 0x3b, 0x31, 0x2e, 0x3b, 0x32, 0x2e, 0x3b, 0x33, 0x2e,
+0x3b, 0x34, 0x2e, 0x3b, 0x35, 0x2e, 0x3b, 0x36, 0x2e, 0x3b, 0x37, 0x2e, 0x3b, 0x38, 0x2e, 0x3b, 0x39, 0x2e, 0x3b, 0x31,
+0x30, 0x2e, 0x3b, 0x31, 0x31, 0x2e, 0x3b, 0x31, 0x32, 0x2e, 0x3b, 0x73, 0x69, 0x6a, 0x65, 0x10d, 0x6e, 0x6a, 0x61, 0x3b,
+0x76, 0x65, 0x6c, 0x6a, 0x61, 0x10d, 0x65, 0x3b, 0x6f, 0x17e, 0x75, 0x6a, 0x6b, 0x61, 0x3b, 0x74, 0x72, 0x61, 0x76, 0x6e,
+0x6a, 0x61, 0x3b, 0x73, 0x76, 0x69, 0x62, 0x6e, 0x6a, 0x61, 0x3b, 0x6c, 0x69, 0x70, 0x6e, 0x6a, 0x61, 0x3b, 0x73, 0x72,
+0x70, 0x6e, 0x6a, 0x61, 0x3b, 0x6b, 0x6f, 0x6c, 0x6f, 0x76, 0x6f, 0x7a, 0x61, 0x3b, 0x72, 0x75, 0x6a, 0x6e, 0x61, 0x3b,
+0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x61, 0x3b, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x6f, 0x67, 0x61, 0x3b,
+0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e, 0x63, 0x61, 0x3b, 0x6c, 0x65, 0x64, 0x3b, 0xfa, 0x6e, 0x6f, 0x3b, 0x62, 0x159, 0x65,
+0x3b, 0x64, 0x75, 0x62, 0x3b, 0x6b, 0x76, 0x11b, 0x3b, 0x10d, 0x76, 0x6e, 0x3b, 0x10d, 0x76, 0x63, 0x3b, 0x73, 0x72, 0x70,
+0x3b, 0x7a, 0xe1, 0x159, 0x3b, 0x159, 0xed, 0x6a, 0x3b, 0x6c, 0x69, 0x73, 0x3b, 0x70, 0x72, 0x6f, 0x3b, 0x6c, 0x65, 0x64,
+0x65, 0x6e, 0x3b, 0xfa, 0x6e, 0x6f, 0x72, 0x3b, 0x62, 0x159, 0x65, 0x7a, 0x65, 0x6e, 0x3b, 0x64, 0x75, 0x62, 0x65, 0x6e,
+0x3b, 0x6b, 0x76, 0x11b, 0x74, 0x65, 0x6e, 0x3b, 0x10d, 0x65, 0x72, 0x76, 0x65, 0x6e, 0x3b, 0x10d, 0x65, 0x72, 0x76, 0x65,
+0x6e, 0x65, 0x63, 0x3b, 0x73, 0x72, 0x70, 0x65, 0x6e, 0x3b, 0x7a, 0xe1, 0x159, 0xed, 0x3b, 0x159, 0xed, 0x6a, 0x65, 0x6e,
+0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e, 0x65, 0x63, 0x3b, 0x6c,
+0x65, 0x64, 0x6e, 0x61, 0x3b, 0xfa, 0x6e, 0x6f, 0x72, 0x61, 0x3b, 0x62, 0x159, 0x65, 0x7a, 0x6e, 0x61, 0x3b, 0x64, 0x75,
+0x62, 0x6e, 0x61, 0x3b, 0x6b, 0x76, 0x11b, 0x74, 0x6e, 0x61, 0x3b, 0x10d, 0x65, 0x72, 0x76, 0x6e, 0x61, 0x3b, 0x10d, 0x65,
+0x72, 0x76, 0x65, 0x6e, 0x63, 0x65, 0x3b, 0x73, 0x72, 0x70, 0x6e, 0x61, 0x3b, 0x7a, 0xe1, 0x159, 0xed, 0x3b, 0x159, 0xed,
+0x6a, 0x6e, 0x61, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x75, 0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e,
+0x63, 0x65, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70,
+0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67,
+0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63,
+0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72,
+0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75,
+0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b,
+0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63,
+0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x72, 0x74, 0x2e,
+0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x65, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b,
+0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b,
+0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72,
+0x69, 0x3b, 0x6d, 0x61, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x65, 0x69, 0x3b, 0x6a, 0x75,
+0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x73, 0x65, 0x70,
+0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d,
+0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65,
+0x62, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6e,
+0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x63, 0x74,
+0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b,
+0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b,
+0x61, 0x16d, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b,
+0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72,
+0x74, 0x6f, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x6f, 0x3b, 0x6d, 0x61, 0x6a, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f,
+0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x16d, 0x67, 0x75, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65,
+0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72,
+0x6f, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6a, 0x61, 0x61, 0x6e, 0x3b, 0x76, 0x65, 0x65, 0x62,
+0x72, 0x3b, 0x6d, 0xe4, 0x72, 0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6e,
+0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x3b, 0x6f, 0x6b, 0x74,
+0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x74, 0x73, 0x3b, 0x6a, 0x61, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x76, 0x65,
+0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0xe4, 0x72, 0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x6c, 0x3b,
+0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75,
+0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x65,
+0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x74, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72,
+0x3b, 0x4a, 0x3b, 0x56, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f,
+0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72,
+0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65, 0x70,
+0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x73, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b,
+0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0xed, 0x6c, 0x3b, 0x6d,
+0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b,
+0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f,
+0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x2e,
+0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b,
+0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b,
+0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69,
+0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x3b, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x3b, 0x68, 0x75, 0x68, 0x74, 0x69, 0x3b,
+0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x3b, 0x65, 0x6c, 0x6f,
+0x3b, 0x73, 0x79, 0x79, 0x73, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x3b, 0x6a, 0x6f,
+0x75, 0x6c, 0x75, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69, 0x6b, 0x75, 0x75, 0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x6b, 0x75,
+0x75, 0x3b, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x6b, 0x75, 0x75, 0x3b, 0x68, 0x75, 0x68, 0x74, 0x69, 0x6b, 0x75, 0x75,
+0x3b, 0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x6b, 0x75, 0x75, 0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x6b, 0x75, 0x75, 0x3b, 0x68, 0x65,
+0x69, 0x6e, 0xe4, 0x6b, 0x75, 0x75, 0x3b, 0x65, 0x6c, 0x6f, 0x6b, 0x75, 0x75, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x6b, 0x75,
+0x75, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x6b, 0x75, 0x75, 0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x6b, 0x75, 0x75, 0x3b,
+0x6a, 0x6f, 0x75, 0x6c, 0x75, 0x6b, 0x75, 0x75, 0x3b, 0x54, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x4b,
+0x3b, 0x48, 0x3b, 0x45, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69, 0x6b, 0x2e,
+0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x6b, 0x2e, 0x3b, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x6b, 0x2e, 0x3b, 0x68, 0x75,
+0x68, 0x74, 0x69, 0x6b, 0x2e, 0x3b, 0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x6b, 0x2e, 0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x6b, 0x2e,
+0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x6b, 0x2e, 0x3b, 0x65, 0x6c, 0x6f, 0x6b, 0x2e, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x6b,
+0x2e, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x6b, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x6b, 0x2e, 0x3b, 0x6a, 0x6f,
+0x75, 0x6c, 0x75, 0x6b, 0x2e, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x68, 0x65, 0x6c,
+0x6d, 0x69, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b,
+0x68, 0x75, 0x68, 0x74, 0x69, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x6b, 0x75, 0x75, 0x74,
+0x61, 0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x6b, 0x75, 0x75,
+0x74, 0x61, 0x3b, 0x65, 0x6c, 0x6f, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x6b, 0x75, 0x75, 0x74,
+0x61, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x6b, 0x75,
+0x75, 0x74, 0x61, 0x3b, 0x6a, 0x6f, 0x75, 0x6c, 0x75, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x2e,
+0x3b, 0x66, 0xe9, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69,
+0x3b, 0x6a, 0x75, 0x69, 0x6e, 0x3b, 0x6a, 0x75, 0x69, 0x6c, 0x2e, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65, 0x70,
+0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0xe9, 0x63, 0x2e, 0x3b, 0x6a, 0x61,
+0x6e, 0x76, 0x69, 0x65, 0x72, 0x3b, 0x66, 0xe9, 0x76, 0x72, 0x69, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61,
+0x76, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x69, 0x6e, 0x3b, 0x6a, 0x75, 0x69, 0x6c, 0x6c, 0x65,
+0x74, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x74,
+0x6f, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0xe9, 0x63, 0x65, 0x6d, 0x62,
+0x72, 0x65, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x2e, 0x3b, 0x66, 0xe9, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b,
+0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x69, 0x6e, 0x3b, 0x6a, 0x75, 0x69, 0x6c, 0x6c, 0x2e,
+0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76,
+0x2e, 0x3b, 0x64, 0xe9, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0xe9, 0x76, 0x2e, 0x3b, 0x6d, 0x61, 0x72,
+0x2e, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x69, 0x2e, 0x3b, 0x6a, 0x75, 0x69, 0x6c,
+0x2e, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f,
+0x76, 0x2e, 0x3b, 0x64, 0xe9, 0x63, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x72, 0x74, 0x3b,
+0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b,
+0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x6e,
+0x65, 0x77, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x65, 0x77, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x4d, 0x61,
+0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x61, 0x69, 0x65, 0x3b, 0x4a, 0x75, 0x6e, 0x79,
+0x3b, 0x4a, 0x75, 0x6c, 0x79, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x69,
+0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x69, 0x6d, 0x62, 0x65,
+0x72, 0x3b, 0x44, 0x65, 0x73, 0x69, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x46, 0x61, 0x6f, 0x69, 0x3b, 0x47, 0x65, 0x61, 0x72,
+0x72, 0x3b, 0x4d, 0xe0, 0x72, 0x74, 0x3b, 0x47, 0x69, 0x62, 0x6c, 0x3b, 0x43, 0xe8, 0x69, 0x74, 0x3b, 0xd2, 0x67, 0x6d,
+0x68, 0x3b, 0x49, 0x75, 0x63, 0x68, 0x3b, 0x4c, 0xf9, 0x6e, 0x61, 0x3b, 0x53, 0x75, 0x6c, 0x74, 0x3b, 0x44, 0xe0, 0x6d,
+0x68, 0x3b, 0x53, 0x61, 0x6d, 0x68, 0x3b, 0x44, 0xf9, 0x62, 0x68, 0x3b, 0x41, 0x6d, 0x20, 0x46, 0x61, 0x6f, 0x69, 0x6c,
+0x6c, 0x65, 0x61, 0x63, 0x68, 0x3b, 0x41, 0x6e, 0x20, 0x47, 0x65, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x3b, 0x41, 0x6d, 0x20,
+0x4d, 0xe0, 0x72, 0x74, 0x3b, 0x41, 0x6e, 0x20, 0x47, 0x69, 0x62, 0x6c, 0x65, 0x61, 0x6e, 0x3b, 0x41, 0x6e, 0x20, 0x43,
+0xe8, 0x69, 0x74, 0x65, 0x61, 0x6e, 0x3b, 0x41, 0x6e, 0x20, 0x74, 0x2d, 0xd2, 0x67, 0x6d, 0x68, 0x69, 0x6f, 0x73, 0x3b,
+0x41, 0x6e, 0x20, 0x74, 0x2d, 0x49, 0x75, 0x63, 0x68, 0x61, 0x72, 0x3b, 0x41, 0x6e, 0x20, 0x4c, 0xf9, 0x6e, 0x61, 0x73,
+0x74, 0x61, 0x6c, 0x3b, 0x41, 0x6e, 0x20, 0x74, 0x2d, 0x53, 0x75, 0x6c, 0x74, 0x61, 0x69, 0x6e, 0x3b, 0x41, 0x6e, 0x20,
+0x44, 0xe0, 0x6d, 0x68, 0x61, 0x69, 0x72, 0x3b, 0x41, 0x6e, 0x20, 0x74, 0x2d, 0x53, 0x61, 0x6d, 0x68, 0x61, 0x69, 0x6e,
+0x3b, 0x41, 0x6e, 0x20, 0x44, 0xf9, 0x62, 0x68, 0x6c, 0x61, 0x63, 0x68, 0x64, 0x3b, 0x46, 0x3b, 0x47, 0x3b, 0x4d, 0x3b,
+0x47, 0x3b, 0x43, 0x3b, 0xd2, 0x3b, 0x49, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x44, 0x3b, 0x64, 0x68,
+0x65, 0x6e, 0x20, 0x46, 0x68, 0x61, 0x6f, 0x69, 0x6c, 0x6c, 0x65, 0x61, 0x63, 0x68, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20,
+0x47, 0x68, 0x65, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x4d, 0x68, 0xe0, 0x72, 0x74, 0x3b,
+0x64, 0x68, 0x65, 0x6e, 0x20, 0x47, 0x68, 0x69, 0x62, 0x6c, 0x65, 0x61, 0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x43,
+0x68, 0xe8, 0x69, 0x74, 0x65, 0x61, 0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0xd2, 0x67, 0x6d, 0x68, 0x69, 0x6f, 0x73,
+0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x75, 0x63, 0x68, 0x61, 0x72, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x4c, 0xf9,
+0x6e, 0x61, 0x73, 0x74, 0x61, 0x6c, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x2d, 0x53, 0x75, 0x6c, 0x74, 0x61, 0x69,
+0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x44, 0xe0, 0x6d, 0x68, 0x61, 0x69, 0x72, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20,
+0x74, 0x2d, 0x53, 0x61, 0x6d, 0x68, 0x61, 0x69, 0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x44, 0xf9, 0x62, 0x68, 0x6c,
+0x61, 0x63, 0x68, 0x64, 0x3b, 0x58, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b,
+0x41, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x6f, 0x3b, 0x58, 0x75, 0xf1, 0x6f, 0x3b, 0x58, 0x75, 0x6c, 0x2e, 0x3b,
+0x41, 0x67, 0x6f, 0x2e, 0x3b, 0x53, 0x65, 0x74, 0x2e, 0x3b, 0x4f, 0x75, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b,
+0x44, 0x65, 0x63, 0x2e, 0x3b, 0x58, 0x61, 0x6e, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x65, 0x69, 0x72,
+0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x6f, 0x3b, 0x58,
+0x75, 0xf1, 0x6f, 0x3b, 0x58, 0x75, 0x6c, 0x6c, 0x6f, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74,
+0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x4f, 0x75, 0x74, 0x75, 0x62, 0x72, 0x6f, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
+0x72, 0x6f, 0x3b, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x58, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b,
+0x4d, 0x3b, 0x58, 0x3b, 0x58, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x78, 0x61, 0x6e, 0x2e,
+0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x6f,
+0x3b, 0x78, 0x75, 0xf1, 0x6f, 0x3b, 0x78, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65, 0x74, 0x2e,
+0x3b, 0x6f, 0x75, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x78, 0x61, 0x6e, 0x65,
+0x69, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61,
+0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x6f, 0x3b, 0x78, 0x75, 0xf1, 0x6f, 0x3b, 0x78, 0x75, 0x6c, 0x6c, 0x6f,
+0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6f, 0x75, 0x74,
+0x75, 0x62, 0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62,
+0x72, 0x6f, 0x3b, 0x78, 0x2e, 0x3b, 0x66, 0x2e, 0x3b, 0x6d, 0x2e, 0x3b, 0x61, 0x2e, 0x3b, 0x6d, 0x2e, 0x3b, 0x78, 0x2e,
+0x3b, 0x78, 0x2e, 0x3b, 0x61, 0x2e, 0x3b, 0x73, 0x2e, 0x3b, 0x6f, 0x2e, 0x3b, 0x6e, 0x2e, 0x3b, 0x64, 0x2e, 0x3b, 0x10d8,
+0x10d0, 0x10dc, 0x3b, 0x10d7, 0x10d4, 0x10d1, 0x3b, 0x10db, 0x10d0, 0x10e0, 0x3b, 0x10d0, 0x10de, 0x10e0, 0x3b, 0x10db, 0x10d0, 0x10d8, 0x3b, 0x10d8,
+0x10d5, 0x10dc, 0x3b, 0x10d8, 0x10d5, 0x10da, 0x3b, 0x10d0, 0x10d2, 0x10d5, 0x3b, 0x10e1, 0x10d4, 0x10e5, 0x3b, 0x10dd, 0x10e5, 0x10e2, 0x3b, 0x10dc,
+0x10dd, 0x10d4, 0x3b, 0x10d3, 0x10d4, 0x10d9, 0x3b, 0x10d8, 0x10d0, 0x10dc, 0x10d5, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x10d7, 0x10d4, 0x10d1, 0x10d4, 0x10e0,
+0x10d5, 0x10d0, 0x10da, 0x10d8, 0x3b, 0x10db, 0x10d0, 0x10e0, 0x10e2, 0x10d8, 0x3b, 0x10d0, 0x10de, 0x10e0, 0x10d8, 0x10da, 0x10d8, 0x3b, 0x10db, 0x10d0,
+0x10d8, 0x10e1, 0x10d8, 0x3b, 0x10d8, 0x10d5, 0x10dc, 0x10d8, 0x10e1, 0x10d8, 0x3b, 0x10d8, 0x10d5, 0x10da, 0x10d8, 0x10e1, 0x10d8, 0x3b, 0x10d0, 0x10d2,
+0x10d5, 0x10d8, 0x10e1, 0x10e2, 0x10dd, 0x3b, 0x10e1, 0x10d4, 0x10e5, 0x10e2, 0x10d4, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10dd, 0x10e5, 0x10e2,
+0x10dd, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10dc, 0x10dd, 0x10d4, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10d3, 0x10d4, 0x10d9, 0x10d4,
+0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10d8, 0x3b, 0x10d7, 0x3b, 0x10db, 0x3b, 0x10d0, 0x3b, 0x10db, 0x3b, 0x10d8, 0x3b, 0x10d8, 0x3b,
+0x10d0, 0x3b, 0x10e1, 0x3b, 0x10dd, 0x3b, 0x10dc, 0x3b, 0x10d3, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0xe4,
+0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75,
+0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x4a, 0x61,
+0x6e, 0x75, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70,
+0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75,
+0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62,
+0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72,
+0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x2e,
+0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b,
+0x53, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e,
+0x3b, 0x4a, 0xe4, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0xe4, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69,
+0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74,
+0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x4a, 0xe4, 0x6e, 0x6e, 0x65, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72,
+0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a,
+0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74,
+0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
+0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0xe4, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62,
+0x2e, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69,
+0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e,
+0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e, 0x3b, 0x399, 0x3b1, 0x3bd, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3b, 0x39c,
+0x3ac, 0x3c1, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3b, 0x39c, 0x3ac, 0x3b9, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bd, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bb,
+0x3b, 0x391, 0x3cd, 0x3b3, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3b, 0x39f, 0x3ba, 0x3c4, 0x3b, 0x39d, 0x3bf, 0x3ad, 0x3b, 0x394, 0x3b5, 0x3ba,
+0x3b, 0x399, 0x3b1, 0x3bd, 0x3bf, 0x3c5, 0x3ac, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3c1, 0x3bf, 0x3c5, 0x3ac, 0x3c1,
+0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39c, 0x3ac, 0x3c1, 0x3c4, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3af, 0x3bb, 0x3b9, 0x3bf, 0x3c2,
+0x3b, 0x39c, 0x3ac, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bd, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bb, 0x3b9,
+0x3bf, 0x3c2, 0x3b, 0x391, 0x3cd, 0x3b3, 0x3bf, 0x3c5, 0x3c3, 0x3c4, 0x3bf, 0x3c2, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3c4, 0x3ad, 0x3bc, 0x3b2,
+0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39f, 0x3ba, 0x3c4, 0x3ce, 0x3b2, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39d, 0x3bf, 0x3ad, 0x3bc, 0x3b2,
+0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x394, 0x3b5, 0x3ba, 0x3ad, 0x3bc, 0x3b2, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x399, 0x3b, 0x3a6, 0x3b,
+0x39c, 0x3b, 0x391, 0x3b, 0x39c, 0x3b, 0x399, 0x3b, 0x399, 0x3b, 0x391, 0x3b, 0x3a3, 0x3b, 0x39f, 0x3b, 0x39d, 0x3b, 0x394, 0x3b,
+0x399, 0x3b1, 0x3bd, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3b, 0x39c, 0x3b1, 0x3c1, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3b, 0x39c, 0x3b1, 0x390, 0x3b,
+0x399, 0x3bf, 0x3c5, 0x3bd, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bb, 0x3b, 0x391, 0x3c5, 0x3b3, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3b, 0x39f, 0x3ba,
+0x3c4, 0x3b, 0x39d, 0x3bf, 0x3b5, 0x3b, 0x394, 0x3b5, 0x3ba, 0x3b, 0x399, 0x3b1, 0x3bd, 0x3bf, 0x3c5, 0x3b1, 0x3c1, 0x3af, 0x3bf, 0x3c5,
+0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3c1, 0x3bf, 0x3c5, 0x3b1, 0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x39c, 0x3b1, 0x3c1, 0x3c4, 0x3af, 0x3bf, 0x3c5,
+0x3b, 0x391, 0x3c0, 0x3c1, 0x3b9, 0x3bb, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x39c, 0x3b1, 0x390, 0x3bf, 0x3c5, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bd,
+0x3af, 0x3bf, 0x3c5, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bb, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x391, 0x3c5, 0x3b3, 0x3bf, 0x3cd, 0x3c3, 0x3c4, 0x3bf,
+0x3c5, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3c4, 0x3b5, 0x3bc, 0x3b2, 0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x39f, 0x3ba, 0x3c4, 0x3c9, 0x3b2, 0x3c1,
+0x3af, 0x3bf, 0x3c5, 0x3b, 0x39d, 0x3bf, 0x3b5, 0x3bc, 0x3b2, 0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x394, 0x3b5, 0x3ba, 0x3b5, 0x3bc, 0x3b2,
+0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70,
+0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65,
+0x70, 0x74, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61,
+0x61, 0x72, 0x69, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x61, 0x72, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x69, 0x3b,
+0x61, 0x70, 0x72, 0x69, 0x69, 0x6c, 0x69, 0x3b, 0x6d, 0x61, 0x61, 0x6a, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6e, 0x69, 0x3b,
+0x6a, 0x75, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x67, 0x67, 0x75, 0x73, 0x74, 0x69, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d,
+0x62, 0x61, 0x72, 0x69, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x72, 0x69, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
+0x61, 0x72, 0x69, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x69, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x61,
+0x72, 0x69, 0x70, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x61, 0x72, 0x69, 0x70, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x69,
+0x70, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x69, 0x6c, 0x69, 0x70, 0x3b, 0x6d, 0x61, 0x61, 0x6a, 0x69, 0x70, 0x3b, 0x6a, 0x75,
+0x75, 0x6e, 0x69, 0x70, 0x3b, 0x6a, 0x75, 0x75, 0x6c, 0x69, 0x70, 0x3b, 0x61, 0x67, 0x67, 0x75, 0x73, 0x74, 0x69, 0x70,
+0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x69, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x72,
+0x69, 0x70, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x69, 0x70, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62,
+0x61, 0x72, 0x69, 0x70, 0x3b, 0xa9c, 0xabe, 0xaa8, 0xacd, 0xaaf, 0xac1, 0x3b, 0xaab, 0xac7, 0xaac, 0xacd, 0xab0, 0xac1, 0x3b, 0xaae,
+0xabe, 0xab0, 0xacd, 0xa9a, 0x3b, 0xa8f, 0xaaa, 0xacd, 0xab0, 0xabf, 0xab2, 0x3b, 0xaae, 0xac7, 0x3b, 0xa9c, 0xac2, 0xaa8, 0x3b, 0xa9c,
+0xac1, 0xab2, 0xabe, 0xa88, 0x3b, 0xa91, 0xa97, 0xab8, 0xacd, 0xa9f, 0x3b, 0xab8, 0xaaa, 0xacd, 0xa9f, 0xac7, 0x3b, 0xa91, 0xa95, 0xacd,
+0xa9f, 0xacb, 0x3b, 0xaa8, 0xab5, 0xac7, 0x3b, 0xaa1, 0xabf, 0xab8, 0xac7, 0x3b, 0xa9c, 0xabe, 0xaa8, 0xacd, 0xaaf, 0xac1, 0xa86, 0xab0,
+0xac0, 0x3b, 0xaab, 0xac7, 0xaac, 0xacd, 0xab0, 0xac1, 0xa86, 0xab0, 0xac0, 0x3b, 0xaae, 0xabe, 0xab0, 0xacd, 0xa9a, 0x3b, 0xa8f, 0xaaa,
+0xacd, 0xab0, 0xabf, 0xab2, 0x3b, 0xaae, 0xac7, 0x3b, 0xa9c, 0xac2, 0xaa8, 0x3b, 0xa9c, 0xac1, 0xab2, 0xabe, 0xa88, 0x3b, 0xa91, 0xa97,
+0xab8, 0xacd, 0xa9f, 0x3b, 0xab8, 0xaaa, 0xacd, 0xa9f, 0xac7, 0xaae, 0xacd, 0xaac, 0xab0, 0x3b, 0xa91, 0xa95, 0xacd, 0xa9f, 0xacb, 0xaac,
+0xab0, 0x3b, 0xaa8, 0xab5, 0xac7, 0xaae, 0xacd, 0xaac, 0xab0, 0x3b, 0xaa1, 0xabf, 0xab8, 0xac7, 0xaae, 0xacd, 0xaac, 0xab0, 0x3b, 0xa9c,
+0xabe, 0x3b, 0xaab, 0xac7, 0x3b, 0xaae, 0xabe, 0x3b, 0xa8f, 0x3b, 0xaae, 0xac7, 0x3b, 0xa9c, 0xac2, 0x3b, 0xa9c, 0xac1, 0x3b, 0xa91,
+0x3b, 0xab8, 0x3b, 0xa91, 0x3b, 0xaa8, 0x3b, 0xaa1, 0xabf, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x61, 0x62, 0x3b, 0x4d, 0x61,
+0x72, 0x3b, 0x41, 0x66, 0x69, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e, 0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x41, 0x67,
+0x75, 0x3b, 0x53, 0x61, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x75, 0x77, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61,
+0x6e, 0x61, 0x69, 0x72, 0x75, 0x3b, 0x46, 0x61, 0x62, 0x75, 0x72, 0x61, 0x69, 0x72, 0x75, 0x3b, 0x4d, 0x61, 0x72, 0x69,
+0x73, 0x3b, 0x41, 0x66, 0x69, 0x72, 0x69, 0x6c, 0x75, 0x3b, 0x4d, 0x61, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6e, 0x69, 0x3b,
+0x59, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x53, 0x61, 0x74, 0x75, 0x6d, 0x62, 0x61, 0x3b,
+0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x75, 0x77, 0x61, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x61, 0x6d,
+0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x41, 0x3b, 0x53,
+0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x5d9, 0x5e0, 0x5d5, 0x5f3, 0x3b, 0x5e4, 0x5d1, 0x5e8, 0x5f3, 0x3b, 0x5de, 0x5e8, 0x5e5,
+0x3b, 0x5d0, 0x5e4, 0x5e8, 0x5f3, 0x3b, 0x5de, 0x5d0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9, 0x3b,
+0x5d0, 0x5d5, 0x5d2, 0x5f3, 0x3b, 0x5e1, 0x5e4, 0x5d8, 0x5f3, 0x3b, 0x5d0, 0x5d5, 0x5e7, 0x5f3, 0x3b, 0x5e0, 0x5d5, 0x5d1, 0x5f3, 0x3b,
+0x5d3, 0x5e6, 0x5de, 0x5f3, 0x3b, 0x5d9, 0x5e0, 0x5d5, 0x5d0, 0x5e8, 0x3b, 0x5e4, 0x5d1, 0x5e8, 0x5d5, 0x5d0, 0x5e8, 0x3b, 0x5de, 0x5e8,
+0x5e5, 0x3b, 0x5d0, 0x5e4, 0x5e8, 0x5d9, 0x5dc, 0x3b, 0x5de, 0x5d0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc,
+0x5d9, 0x3b, 0x5d0, 0x5d5, 0x5d2, 0x5d5, 0x5e1, 0x5d8, 0x3b, 0x5e1, 0x5e4, 0x5d8, 0x5de, 0x5d1, 0x5e8, 0x3b, 0x5d0, 0x5d5, 0x5e7, 0x5d8,
+0x5d5, 0x5d1, 0x5e8, 0x3b, 0x5e0, 0x5d5, 0x5d1, 0x5de, 0x5d1, 0x5e8, 0x3b, 0x5d3, 0x5e6, 0x5de, 0x5d1, 0x5e8, 0x3b, 0x91c, 0x928, 0x970,
+0x3b, 0x92b, 0x93c, 0x930, 0x970, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x948, 0x932, 0x3b, 0x92e,
+0x908, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x970, 0x3b, 0x905, 0x917, 0x970, 0x3b, 0x938, 0x93f, 0x924, 0x970, 0x3b,
+0x905, 0x915, 0x94d, 0x924, 0x942, 0x970, 0x3b, 0x928, 0x935, 0x970, 0x3b, 0x926, 0x93f, 0x938, 0x970, 0x3b, 0x91c, 0x928, 0x935, 0x930,
+0x940, 0x3b, 0x92b, 0x93c, 0x930, 0x935, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x948,
+0x932, 0x3b, 0x92e, 0x908, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x93e, 0x908, 0x3b, 0x905, 0x917, 0x938, 0x94d, 0x924,
+0x3b, 0x938, 0x93f, 0x924, 0x902, 0x92c, 0x930, 0x3b, 0x905, 0x915, 0x94d, 0x924, 0x942, 0x92c, 0x930, 0x3b, 0x928, 0x935, 0x902, 0x92c,
+0x930, 0x3b, 0x926, 0x93f, 0x938, 0x902, 0x92c, 0x930, 0x3b, 0x91c, 0x3b, 0x92b, 0x93c, 0x3b, 0x92e, 0x93e, 0x3b, 0x905, 0x3b, 0x92e,
+0x3b, 0x91c, 0x942, 0x3b, 0x91c, 0x941, 0x3b, 0x905, 0x3b, 0x938, 0x93f, 0x3b, 0x905, 0x3b, 0x928, 0x3b, 0x926, 0x93f, 0x3b, 0x6a,
+0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0xe1, 0x72, 0x63, 0x2e, 0x3b, 0xe1, 0x70, 0x72, 0x2e,
+0x3b, 0x6d, 0xe1, 0x6a, 0x2e, 0x3b, 0x6a, 0xfa, 0x6e, 0x2e, 0x3b, 0x6a, 0xfa, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e,
+0x3b, 0x73, 0x7a, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65,
+0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0xe1, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0xe1, 0x72, 0x3b, 0x6d, 0xe1,
+0x72, 0x63, 0x69, 0x75, 0x73, 0x3b, 0xe1, 0x70, 0x72, 0x69, 0x6c, 0x69, 0x73, 0x3b, 0x6d, 0xe1, 0x6a, 0x75, 0x73, 0x3b,
+0x6a, 0xfa, 0x6e, 0x69, 0x75, 0x73, 0x3b, 0x6a, 0xfa, 0x6c, 0x69, 0x75, 0x73, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x7a,
+0x74, 0x75, 0x73, 0x3b, 0x73, 0x7a, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0xf3, 0x62,
+0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72,
+0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0xc1, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x7a, 0x3b,
+0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e,
+0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0xed, 0x3b, 0x6a, 0xfa, 0x6e, 0x2e, 0x3b, 0x6a, 0xfa, 0x6c, 0x2e, 0x3b,
+0xe1, 0x67, 0xfa, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0xf3, 0x76, 0x2e, 0x3b,
+0x64, 0x65, 0x73, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0xfa, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0xfa, 0x61, 0x72, 0x3b,
+0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0xed, 0x6c, 0x3b, 0x6d, 0x61, 0xed, 0x3b, 0x6a, 0xfa, 0x6e, 0xed, 0x3b,
+0x6a, 0xfa, 0x6c, 0xed, 0x3b, 0xe1, 0x67, 0xfa, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72,
+0x3b, 0x6f, 0x6b, 0x74, 0xf3, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0xf3, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65,
+0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a,
+0x3b, 0xc1, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d,
+0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41,
+0x67, 0x75, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a,
+0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x72, 0x65,
+0x74, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c,
+0x69, 0x3b, 0x41, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b,
+0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x73,
+0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70,
+0x72, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65,
+0x70, 0x3b, 0x6f, 0x63, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72,
+0x69, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x6f, 0x3b,
+0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6c,
+0x69, 0x6f, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65,
+0x3b, 0x6f, 0x63, 0x74, 0x6f, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x65,
+0x63, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6a, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x6a,
+0x3b, 0x61, 0x3b, 0x73, 0x3b, 0x6f, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x45, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x61, 0x62, 0x68,
+0x3b, 0x4d, 0xe1, 0x72, 0x74, 0x61, 0x3b, 0x41, 0x69, 0x62, 0x3b, 0x42, 0x65, 0x61, 0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x74,
+0x68, 0x3b, 0x49, 0xfa, 0x69, 0x6c, 0x3b, 0x4c, 0xfa, 0x6e, 0x3b, 0x4d, 0x46, 0xf3, 0x6d, 0x68, 0x3b, 0x44, 0x46, 0xf3,
+0x6d, 0x68, 0x3b, 0x53, 0x61, 0x6d, 0x68, 0x3b, 0x4e, 0x6f, 0x6c, 0x6c, 0x3b, 0x45, 0x61, 0x6e, 0xe1, 0x69, 0x72, 0x3b,
+0x46, 0x65, 0x61, 0x62, 0x68, 0x72, 0x61, 0x3b, 0x4d, 0xe1, 0x72, 0x74, 0x61, 0x3b, 0x41, 0x69, 0x62, 0x72, 0x65, 0xe1,
+0x6e, 0x3b, 0x42, 0x65, 0x61, 0x6c, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x3b, 0x4d, 0x65, 0x69, 0x74, 0x68, 0x65, 0x61, 0x6d,
+0x68, 0x3b, 0x49, 0xfa, 0x69, 0x6c, 0x3b, 0x4c, 0xfa, 0x6e, 0x61, 0x73, 0x61, 0x3b, 0x4d, 0x65, 0xe1, 0x6e, 0x20, 0x46,
+0xf3, 0x6d, 0x68, 0x61, 0x69, 0x72, 0x3b, 0x44, 0x65, 0x69, 0x72, 0x65, 0x61, 0x64, 0x68, 0x20, 0x46, 0xf3, 0x6d, 0x68,
+0x61, 0x69, 0x72, 0x3b, 0x53, 0x61, 0x6d, 0x68, 0x61, 0x69, 0x6e, 0x3b, 0x4e, 0x6f, 0x6c, 0x6c, 0x61, 0x69, 0x67, 0x3b,
+0x45, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x42, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x44, 0x3b,
+0x53, 0x3b, 0x4e, 0x3b, 0x67, 0x65, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b,
+0x6d, 0x61, 0x67, 0x3b, 0x67, 0x69, 0x75, 0x3b, 0x6c, 0x75, 0x67, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x3b,
+0x6f, 0x74, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x69, 0x63, 0x3b, 0x67, 0x65, 0x6e, 0x6e, 0x61, 0x69, 0x6f, 0x3b,
+0x66, 0x65, 0x62, 0x62, 0x72, 0x61, 0x69, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c,
+0x65, 0x3b, 0x6d, 0x61, 0x67, 0x67, 0x69, 0x6f, 0x3b, 0x67, 0x69, 0x75, 0x67, 0x6e, 0x6f, 0x3b, 0x6c, 0x75, 0x67, 0x6c,
+0x69, 0x6f, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b,
+0x6f, 0x74, 0x74, 0x6f, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x69, 0x63,
+0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x47, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x4c, 0x3b,
+0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61,
+0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67,
+0x74, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0xc9c, 0xca8,
+0x3b, 0xcab, 0xcc6, 0xcac, 0xccd, 0xcb0, 0x3b, 0xcae, 0xcbe, 0xcb0, 0xccd, 0xc9a, 0xccd, 0x3b, 0xc8f, 0xcaa, 0xccd, 0xcb0, 0xcbf, 0x3b,
+0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2, 0xca8, 0xccd, 0x3b, 0xc9c, 0xcc1, 0xcb2, 0xcc8, 0x3b, 0xc86, 0xc97, 0x3b, 0xcb8, 0xcc6, 0xcaa, 0xccd,
+0xc9f, 0xcc6, 0xc82, 0x3b, 0xc85, 0xc95, 0xccd, 0xc9f, 0xccb, 0x3b, 0xca8, 0xcb5, 0xcc6, 0xc82, 0x3b, 0xca1, 0xcbf, 0xcb8, 0xcc6, 0xc82,
+0x3b, 0xc9c, 0xca8, 0xcb5, 0xcb0, 0xcbf, 0x3b, 0xcab, 0xcc6, 0xcac, 0xccd, 0xcb0, 0xcb5, 0xcb0, 0xcbf, 0x3b, 0xcae, 0xcbe, 0xcb0, 0xccd,
+0xc9a, 0xccd, 0x3b, 0xc8f, 0xcaa, 0xccd, 0xcb0, 0xcbf, 0xcb2, 0xccd, 0x3b, 0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2, 0xca8, 0xccd, 0x3b, 0xc9c,
+0xcc1, 0xcb2, 0xcc8, 0x3b, 0xc86, 0xc97, 0xcb8, 0xccd, 0xc9f, 0xccd, 0x3b, 0xcb8, 0xcc6, 0xcaa, 0xccd, 0xc9f, 0xcc6, 0xc82, 0xcac, 0xcb0,
+0xccd, 0x3b, 0xc85, 0xc95, 0xccd, 0xc9f, 0xccb, 0xcac, 0xcb0, 0xccd, 0x3b, 0xca8, 0xcb5, 0xcc6, 0xc82, 0xcac, 0xcb0, 0xccd, 0x3b, 0xca1,
+0xcbf, 0xcb8, 0xcc6, 0xc82, 0xcac, 0xcb0, 0xccd, 0x3b, 0xc9c, 0x3b, 0xcab, 0xcc6, 0x3b, 0xcae, 0xcbe, 0x3b, 0xc8f, 0x3b, 0xcae, 0xcc7,
+0x3b, 0xc9c, 0xcc2, 0x3b, 0xc9c, 0xcc1, 0x3b, 0xc86, 0x3b, 0xcb8, 0xcc6, 0x3b, 0xc85, 0x3b, 0xca8, 0x3b, 0xca1, 0xcbf, 0x3b, 0xc9c,
+0xca8, 0xcb5, 0xcb0, 0xcbf, 0x3b, 0xcab, 0xcc6, 0xcac, 0xccd, 0xcb0, 0xcb5, 0xcb0, 0xcbf, 0x3b, 0xcae, 0xcbe, 0xcb0, 0xccd, 0xc9a, 0xccd,
+0x3b, 0xc8f, 0xcaa, 0xccd, 0xcb0, 0xcbf, 0x3b, 0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2, 0xca8, 0xccd, 0x3b, 0xc9c, 0xcc1, 0xcb2, 0xcc8, 0x3b,
+0xc86, 0xc97, 0x3b, 0xcb8, 0xcc6, 0xcaa, 0xccd, 0xc9f, 0xcc6, 0xc82, 0x3b, 0xc85, 0xc95, 0xccd, 0xc9f, 0xccb, 0x3b, 0xca8, 0xcb5, 0xcc6,
+0xc82, 0x3b, 0xca1, 0xcbf, 0xcb8, 0xcc6, 0xc82, 0x3b, 0x62c, 0x646, 0x624, 0x631, 0x6cc, 0x3b, 0x641, 0x631, 0x624, 0x631, 0x6cc, 0x3b,
+0x645, 0x627, 0x631, 0x655, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cc, 0x654, 0x3b, 0x62c, 0x648, 0x657, 0x646,
+0x3b, 0x62c, 0x648, 0x657, 0x644, 0x627, 0x6cc, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x62a, 0x645, 0x628, 0x631, 0x3b,
+0x627, 0x6a9, 0x62a, 0x648, 0x657, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b,
+0x62c, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x627, 0x3b, 0x645, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x633, 0x3b,
+0x627, 0x3b, 0x646, 0x3b, 0x49b, 0x430, 0x4a3, 0x2e, 0x3b, 0x430, 0x49b, 0x43f, 0x2e, 0x3b, 0x43d, 0x430, 0x443, 0x2e, 0x3b, 0x441,
+0x4d9, 0x443, 0x2e, 0x3b, 0x43c, 0x430, 0x43c, 0x2e, 0x3b, 0x43c, 0x430, 0x443, 0x2e, 0x3b, 0x448, 0x456, 0x43b, 0x2e, 0x3b, 0x442,
+0x430, 0x43c, 0x2e, 0x3b, 0x49b, 0x44b, 0x440, 0x2e, 0x3b, 0x49b, 0x430, 0x437, 0x2e, 0x3b, 0x49b, 0x430, 0x440, 0x2e, 0x3b, 0x436,
+0x435, 0x43b, 0x2e, 0x3b, 0x49a, 0x430, 0x4a3, 0x442, 0x430, 0x440, 0x3b, 0x410, 0x49b, 0x43f, 0x430, 0x43d, 0x3b, 0x41d, 0x430, 0x443,
+0x440, 0x44b, 0x437, 0x3b, 0x421, 0x4d9, 0x443, 0x456, 0x440, 0x3b, 0x41c, 0x430, 0x43c, 0x44b, 0x440, 0x3b, 0x41c, 0x430, 0x443, 0x441,
+0x44b, 0x43c, 0x3b, 0x428, 0x456, 0x43b, 0x434, 0x435, 0x3b, 0x422, 0x430, 0x43c, 0x44b, 0x437, 0x3b, 0x49a, 0x44b, 0x440, 0x43a, 0x4af,
+0x439, 0x435, 0x43a, 0x3b, 0x49a, 0x430, 0x437, 0x430, 0x43d, 0x3b, 0x49a, 0x430, 0x440, 0x430, 0x448, 0x430, 0x3b, 0x416, 0x435, 0x43b,
+0x442, 0x43e, 0x49b, 0x441, 0x430, 0x43d, 0x3b, 0x49a, 0x3b, 0x410, 0x3b, 0x41d, 0x3b, 0x421, 0x3b, 0x41c, 0x3b, 0x41c, 0x3b, 0x428,
+0x3b, 0x422, 0x3b, 0x49a, 0x3b, 0x49a, 0x3b, 0x49a, 0x3b, 0x416, 0x3b, 0x49b, 0x430, 0x4a3, 0x442, 0x430, 0x440, 0x3b, 0x430, 0x49b,
+0x43f, 0x430, 0x43d, 0x3b, 0x43d, 0x430, 0x443, 0x440, 0x44b, 0x437, 0x3b, 0x441, 0x4d9, 0x443, 0x456, 0x440, 0x3b, 0x43c, 0x430, 0x43c,
+0x44b, 0x440, 0x3b, 0x43c, 0x430, 0x443, 0x441, 0x44b, 0x43c, 0x3b, 0x448, 0x456, 0x43b, 0x434, 0x435, 0x3b, 0x442, 0x430, 0x43c, 0x44b,
+0x437, 0x3b, 0x49b, 0x44b, 0x440, 0x43a, 0x4af, 0x439, 0x435, 0x43a, 0x3b, 0x49b, 0x430, 0x437, 0x430, 0x43d, 0x3b, 0x49b, 0x430, 0x440,
+0x430, 0x448, 0x430, 0x3b, 0x436, 0x435, 0x43b, 0x442, 0x43e, 0x49b, 0x441, 0x430, 0x43d, 0x3b, 0x6d, 0x75, 0x74, 0x2e, 0x3b, 0x67,
+0x61, 0x73, 0x2e, 0x3b, 0x77, 0x65, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x74, 0x2e, 0x3b, 0x67, 0x69, 0x63, 0x2e, 0x3b, 0x6b,
+0x61, 0x6d, 0x2e, 0x3b, 0x6e, 0x79, 0x61, 0x2e, 0x3b, 0x6b, 0x61, 0x6e, 0x2e, 0x3b, 0x6e, 0x7a, 0x65, 0x2e, 0x3b, 0x75,
+0x6b, 0x77, 0x2e, 0x3b, 0x75, 0x67, 0x75, 0x2e, 0x3b, 0x75, 0x6b, 0x75, 0x2e, 0x3b, 0x4d, 0x75, 0x74, 0x61, 0x72, 0x61,
+0x6d, 0x61, 0x3b, 0x47, 0x61, 0x73, 0x68, 0x79, 0x61, 0x6e, 0x74, 0x61, 0x72, 0x65, 0x3b, 0x57, 0x65, 0x72, 0x75, 0x72,
+0x77, 0x65, 0x3b, 0x4d, 0x61, 0x74, 0x61, 0x3b, 0x47, 0x69, 0x63, 0x75, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x3b, 0x4b, 0x61,
+0x6d, 0x65, 0x6e, 0x61, 0x3b, 0x4e, 0x79, 0x61, 0x6b, 0x61, 0x6e, 0x67, 0x61, 0x3b, 0x4b, 0x61, 0x6e, 0x61, 0x6d, 0x61,
+0x3b, 0x4e, 0x7a, 0x65, 0x6c, 0x69, 0x3b, 0x55, 0x6b, 0x77, 0x61, 0x6b, 0x69, 0x72, 0x61, 0x3b, 0x55, 0x67, 0x75, 0x73,
+0x68, 0x79, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x55, 0x6b, 0x75, 0x62, 0x6f, 0x7a, 0x61, 0x3b, 0x42f, 0x43d, 0x432, 0x3b, 0x424,
+0x435, 0x432, 0x3b, 0x41c, 0x430, 0x440, 0x3b, 0x410, 0x43f, 0x440, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x3b, 0x418,
+0x44e, 0x43b, 0x3b, 0x410, 0x432, 0x433, 0x3b, 0x421, 0x435, 0x43d, 0x3b, 0x41e, 0x43a, 0x442, 0x3b, 0x41d, 0x43e, 0x44f, 0x3b, 0x414,
+0x435, 0x43a, 0x3b, 0x42f, 0x43d, 0x432, 0x430, 0x440, 0x44c, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44c, 0x3b, 0x41c, 0x430,
+0x440, 0x442, 0x3b, 0x410, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x44c, 0x3b, 0x418,
+0x44e, 0x43b, 0x44c, 0x3b, 0x410, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b,
+0x41e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x41d, 0x43e, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431,
+0x440, 0x44c, 0x3b, 0x42f, 0x3b, 0x424, 0x3b, 0x41c, 0x3b, 0x410, 0x3b, 0x41c, 0x3b, 0x418, 0x3b, 0x418, 0x3b, 0x410, 0x3b, 0x421,
+0x3b, 0x41e, 0x3b, 0x41d, 0x3b, 0x414, 0x3b, 0x44f, 0x43d, 0x432, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b, 0x43c, 0x430, 0x440,
+0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x2e, 0x3b, 0x438, 0x44e, 0x43b, 0x2e,
+0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x2e,
+0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x44f, 0x43d, 0x432, 0x430, 0x440, 0x44c, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44c,
+0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d,
+0x44c, 0x3b, 0x438, 0x44e, 0x43b, 0x44c, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431,
+0x440, 0x44c, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x434, 0x435,
+0x43a, 0x430, 0x431, 0x440, 0x44c, 0x3b, 0x31, 0xc6d4, 0x3b, 0x32, 0xc6d4, 0x3b, 0x33, 0xc6d4, 0x3b, 0x34, 0xc6d4, 0x3b, 0x35, 0xc6d4,
+0x3b, 0x36, 0xc6d4, 0x3b, 0x37, 0xc6d4, 0x3b, 0x38, 0xc6d4, 0x3b, 0x39, 0xc6d4, 0x3b, 0x31, 0x30, 0xc6d4, 0x3b, 0x31, 0x31, 0xc6d4,
+0x3b, 0x31, 0x32, 0xc6d4, 0x3b, 0x72, 0xea, 0x62, 0x3b, 0x72, 0x65, 0x15f, 0x3b, 0x61, 0x64, 0x61, 0x3b, 0x61, 0x76, 0x72,
+0x3b, 0x67, 0x75, 0x6c, 0x3b, 0x70, 0xfb, 0x15f, 0x3b, 0x74, 0xee, 0x72, 0x3b, 0x67, 0x65, 0x6c, 0x3b, 0x72, 0x65, 0x7a,
+0x3b, 0x6b, 0x65, 0x77, 0x3b, 0x73, 0x65, 0x72, 0x3b, 0x62, 0x65, 0x72, 0x3b, 0x72, 0xea, 0x62, 0x65, 0x6e, 0x64, 0x61,
+0x6e, 0x3b, 0x72, 0x65, 0x15f, 0x65, 0x6d, 0xee, 0x3b, 0x61, 0x64, 0x61, 0x72, 0x3b, 0x61, 0x76, 0x72, 0xea, 0x6c, 0x3b,
+0x67, 0x75, 0x6c, 0x61, 0x6e, 0x3b, 0x70, 0xfb, 0x15f, 0x70, 0x65, 0x72, 0x3b, 0x74, 0xee, 0x72, 0x6d, 0x65, 0x68, 0x3b,
+0x67, 0x65, 0x6c, 0x61, 0x77, 0xea, 0x6a, 0x3b, 0x72, 0x65, 0x7a, 0x62, 0x65, 0x72, 0x3b, 0x6b, 0x65, 0x77, 0xe7, 0xea,
+0x72, 0x3b, 0x73, 0x65, 0x72, 0x6d, 0x61, 0x77, 0x65, 0x7a, 0x3b, 0x62, 0x65, 0x72, 0x66, 0x61, 0x6e, 0x62, 0x61, 0x72,
+0x3b, 0x52, 0x3b, 0x52, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x47, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x47, 0x3b, 0x52, 0x3b, 0x4b,
+0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x72, 0xea, 0x62, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0xea, 0x3b, 0x72, 0x65, 0x15f, 0x65, 0x6d,
+0x69, 0x79, 0xea, 0x3b, 0x61, 0x64, 0x61, 0x72, 0xea, 0x3b, 0x61, 0x76, 0x72, 0xea, 0x6c, 0xea, 0x3b, 0x67, 0x75, 0x6c,
+0x61, 0x6e, 0xea, 0x3b, 0x70, 0xfb, 0x15f, 0x70, 0x65, 0x72, 0xea, 0x3b, 0x74, 0xee, 0x72, 0x6d, 0x65, 0x68, 0xea, 0x3b,
+0x67, 0x65, 0x6c, 0x61, 0x77, 0xea, 0x6a, 0xea, 0x3b, 0x72, 0x65, 0x7a, 0x62, 0x65, 0x72, 0xea, 0x3b, 0x6b, 0x65, 0x77,
+0xe7, 0xea, 0x72, 0xea, 0x3b, 0x73, 0x65, 0x72, 0x6d, 0x61, 0x77, 0x65, 0x7a, 0xea, 0x3b, 0x62, 0x65, 0x72, 0x66, 0x61,
+0x6e, 0x62, 0x61, 0x72, 0xea, 0x3b, 0x4d, 0x75, 0x74, 0x2e, 0x3b, 0x47, 0x61, 0x73, 0x2e, 0x3b, 0x57, 0x65, 0x72, 0x2e,
+0x3b, 0x4d, 0x61, 0x74, 0x2e, 0x3b, 0x47, 0x69, 0x63, 0x2e, 0x3b, 0x4b, 0x61, 0x6d, 0x2e, 0x3b, 0x4e, 0x79, 0x61, 0x2e,
+0x3b, 0x4b, 0x61, 0x6e, 0x2e, 0x3b, 0x4e, 0x7a, 0x65, 0x2e, 0x3b, 0x55, 0x6b, 0x77, 0x2e, 0x3b, 0x55, 0x67, 0x75, 0x2e,
+0x3b, 0x55, 0x6b, 0x75, 0x2e, 0x3b, 0x4e, 0x7a, 0x65, 0x72, 0x6f, 0x3b, 0x52, 0x75, 0x68, 0x75, 0x68, 0x75, 0x6d, 0x61,
+0x3b, 0x4e, 0x74, 0x77, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x3b, 0x4e, 0x64, 0x61, 0x6d, 0x75, 0x6b, 0x69, 0x7a, 0x61,
+0x3b, 0x52, 0x75, 0x73, 0x61, 0x6d, 0x61, 0x3b, 0x52, 0x75, 0x68, 0x65, 0x73, 0x68, 0x69, 0x3b, 0x4d, 0x75, 0x6b, 0x61,
+0x6b, 0x61, 0x72, 0x6f, 0x3b, 0x4e, 0x79, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x61, 0x72, 0x6f, 0x3b, 0x4e, 0x79, 0x61, 0x6b,
+0x61, 0x6e, 0x67, 0x61, 0x3b, 0x47, 0x69, 0x74, 0x75, 0x67, 0x75, 0x74, 0x75, 0x3b, 0x4d, 0x75, 0x6e, 0x79, 0x6f, 0x6e,
+0x79, 0x6f, 0x3b, 0x4b, 0x69, 0x67, 0x61, 0x72, 0x61, 0x6d, 0x61, 0x3b, 0xea1, 0x2e, 0xe81, 0x2e, 0x3b, 0xe81, 0x2e, 0xe9e,
+0x2e, 0x3b, 0xea1, 0x2e, 0xe99, 0x2e, 0x3b, 0xea1, 0x2e, 0xeaa, 0x2e, 0x3b, 0xe9e, 0x2e, 0xe9e, 0x2e, 0x3b, 0xea1, 0xeb4, 0x2e,
+0xe96, 0x2e, 0x3b, 0xe81, 0x2e, 0xea5, 0x2e, 0x3b, 0xeaa, 0x2e, 0xeab, 0x2e, 0x3b, 0xe81, 0x2e, 0xe8d, 0x2e, 0x3b, 0xe95, 0x2e,
+0xea5, 0x2e, 0x3b, 0xe9e, 0x2e, 0xe88, 0x2e, 0x3b, 0xe97, 0x2e, 0xea7, 0x2e, 0x3b, 0xea1, 0xeb1, 0xe87, 0xe81, 0xead, 0xe99, 0x3b,
+0xe81, 0xeb8, 0xea1, 0xe9e, 0xeb2, 0x3b, 0xea1, 0xeb5, 0xe99, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeaa, 0xeb2, 0x3b, 0xe9e, 0xeb6, 0xe94, 0xeaa,
+0xeb0, 0xe9e, 0xeb2, 0x3b, 0xea1, 0xeb4, 0xe96, 0xeb8, 0xe99, 0xeb2, 0x3b, 0xe81, 0xecd, 0xea5, 0xeb0, 0xe81, 0xebb, 0xe94, 0x3b, 0xeaa,
+0xeb4, 0xe87, 0xeab, 0xeb2, 0x3b, 0xe81, 0xeb1, 0xe99, 0xe8d, 0xeb2, 0x3b, 0xe95, 0xeb8, 0xea5, 0xeb2, 0x3b, 0xe9e, 0xeb0, 0xe88, 0xeb4,
+0xe81, 0x3b, 0xe97, 0xeb1, 0xe99, 0xea7, 0xeb2, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x2e, 0x3b,
+0x6d, 0x61, 0x72, 0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x6a, 0x73, 0x3b, 0x6a, 0x16b, 0x6e,
+0x2e, 0x3b, 0x6a, 0x16b, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x6b,
+0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x101, 0x72, 0x69,
+0x73, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x101, 0x72, 0x69, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x73, 0x3b, 0x61, 0x70,
+0x72, 0x12b, 0x6c, 0x69, 0x73, 0x3b, 0x6d, 0x61, 0x69, 0x6a, 0x73, 0x3b, 0x6a, 0x16b, 0x6e, 0x69, 0x6a, 0x73, 0x3b, 0x6a,
+0x16b, 0x6c, 0x69, 0x6a, 0x73, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x73, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d,
+0x62, 0x72, 0x69, 0x73, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
+0x72, 0x69, 0x73, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x62,
+0x6c, 0x3b, 0x6d, 0x73, 0x69, 0x3b, 0x61, 0x70, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79, 0x75,
+0x6c, 0x3b, 0x61, 0x67, 0x74, 0x3b, 0x73, 0x74, 0x62, 0x3b, 0x254, 0x74, 0x62, 0x3b, 0x6e, 0x76, 0x62, 0x3b, 0x64, 0x73,
+0x62, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x79, 0x61, 0x6d, 0x62, 0x6f, 0x3b, 0x73, 0xe1, 0x6e,
+0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x62, 0x61, 0x6c, 0xe9, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79,
+0x61, 0x20, 0x6d, 0xed, 0x73, 0xe1, 0x74, 0x6f, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed,
+0x6e, 0x65, 0x69, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x74, 0xe1, 0x6e, 0x6f, 0x3b,
+0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0x6f, 0x74, 0xf3, 0x62, 0xe1, 0x3b, 0x73, 0xe1, 0x6e, 0x7a,
+0xe1, 0x20, 0x79, 0x61, 0x20, 0x6e, 0x73, 0x61, 0x6d, 0x62, 0x6f, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61,
+0x20, 0x6d, 0x77, 0x61, 0x6d, 0x62, 0x65, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6c, 0x69, 0x62,
+0x77, 0x61, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x7a, 0xf3, 0x6d, 0x69, 0x3b, 0x73, 0xe1, 0x6e,
+0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x7a, 0xf3, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x254, 0x30c, 0x6b, 0x254, 0x301,
+0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x7a, 0xf3, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0xed,
+0x62, 0x61, 0x6c, 0xe9, 0x3b, 0x79, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x79, 0x3b, 0x79, 0x3b, 0x61,
+0x3b, 0x73, 0x3b, 0x254, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x73, 0x61, 0x75, 0x73, 0x2e, 0x3b, 0x76, 0x61, 0x73, 0x2e, 0x3b,
+0x6b, 0x6f, 0x76, 0x2e, 0x3b, 0x62, 0x61, 0x6c, 0x2e, 0x3b, 0x67, 0x65, 0x67, 0x2e, 0x3b, 0x62, 0x69, 0x72, 0x17e, 0x2e,
+0x3b, 0x6c, 0x69, 0x65, 0x70, 0x2e, 0x3b, 0x72, 0x75, 0x67, 0x70, 0x2e, 0x3b, 0x72, 0x75, 0x67, 0x73, 0x2e, 0x3b, 0x73,
+0x70, 0x61, 0x6c, 0x2e, 0x3b, 0x6c, 0x61, 0x70, 0x6b, 0x72, 0x2e, 0x3b, 0x67, 0x72, 0x75, 0x6f, 0x64, 0x2e, 0x3b, 0x73,
+0x61, 0x75, 0x73, 0x69, 0x73, 0x3b, 0x76, 0x61, 0x73, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x6b, 0x6f, 0x76, 0x61, 0x73, 0x3b,
+0x62, 0x61, 0x6c, 0x61, 0x6e, 0x64, 0x69, 0x73, 0x3b, 0x67, 0x65, 0x67, 0x75, 0x17e, 0x117, 0x3b, 0x62, 0x69, 0x72, 0x17e,
+0x65, 0x6c, 0x69, 0x73, 0x3b, 0x6c, 0x69, 0x65, 0x70, 0x61, 0x3b, 0x72, 0x75, 0x67, 0x70, 0x6a, 0x16b, 0x74, 0x69, 0x73,
+0x3b, 0x72, 0x75, 0x67, 0x73, 0x117, 0x6a, 0x69, 0x73, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x69, 0x73, 0x3b, 0x6c, 0x61, 0x70,
+0x6b, 0x72, 0x69, 0x74, 0x69, 0x73, 0x3b, 0x67, 0x72, 0x75, 0x6f, 0x64, 0x69, 0x73, 0x3b, 0x53, 0x3b, 0x56, 0x3b, 0x4b,
+0x3b, 0x42, 0x3b, 0x47, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x52, 0x3b, 0x52, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x47, 0x3b, 0x73,
+0x61, 0x75, 0x73, 0x69, 0x6f, 0x3b, 0x76, 0x61, 0x73, 0x61, 0x72, 0x69, 0x6f, 0x3b, 0x6b, 0x6f, 0x76, 0x6f, 0x3b, 0x62,
+0x61, 0x6c, 0x61, 0x6e, 0x64, 0x17e, 0x69, 0x6f, 0x3b, 0x67, 0x65, 0x67, 0x75, 0x17e, 0x117, 0x73, 0x3b, 0x62, 0x69, 0x72,
+0x17e, 0x65, 0x6c, 0x69, 0x6f, 0x3b, 0x6c, 0x69, 0x65, 0x70, 0x6f, 0x73, 0x3b, 0x72, 0x75, 0x67, 0x70, 0x6a, 0x16b, 0x10d,
+0x69, 0x6f, 0x3b, 0x72, 0x75, 0x67, 0x73, 0x117, 0x6a, 0x6f, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x69, 0x6f, 0x3b, 0x6c, 0x61,
+0x70, 0x6b, 0x72, 0x69, 0x10d, 0x69, 0x6f, 0x3b, 0x67, 0x72, 0x75, 0x6f, 0x64, 0x17e, 0x69, 0x6f, 0x3b, 0x458, 0x430, 0x43d,
+0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x458,
+0x3b, 0x458, 0x443, 0x43d, 0x2e, 0x3b, 0x458, 0x443, 0x43b, 0x2e, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43f, 0x442,
+0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x435, 0x43c, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x458, 0x430,
+0x43d, 0x443, 0x430, 0x440, 0x438, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x443, 0x430, 0x440, 0x438, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b,
+0x430, 0x43f, 0x440, 0x438, 0x43b, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x438, 0x3b, 0x458, 0x443, 0x43b, 0x438, 0x3b,
+0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x43e, 0x43a, 0x442,
+0x43e, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x43d, 0x43e, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x434, 0x435, 0x43a, 0x435, 0x43c, 0x432,
+0x440, 0x438, 0x3b, 0x458, 0x3b, 0x444, 0x3b, 0x43c, 0x3b, 0x430, 0x3b, 0x43c, 0x3b, 0x458, 0x3b, 0x458, 0x3b, 0x430, 0x3b, 0x441,
+0x3b, 0x43e, 0x3b, 0x43d, 0x3b, 0x434, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41,
+0x70, 0x72, 0x3b, 0x4d, 0x65, 0x79, 0x3b, 0x4a, 0x6f, 0x6e, 0x3b, 0x4a, 0x6f, 0x6c, 0x3b, 0x41, 0x6f, 0x67, 0x3b, 0x53,
+0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x6f, 0x61,
+0x72, 0x79, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x6f, 0x61, 0x72, 0x79, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x73, 0x61, 0x3b, 0x41,
+0x70, 0x72, 0x69, 0x6c, 0x79, 0x3b, 0x4d, 0x65, 0x79, 0x3b, 0x4a, 0x6f, 0x6e, 0x61, 0x3b, 0x4a, 0x6f, 0x6c, 0x61, 0x79,
+0x3b, 0x41, 0x6f, 0x67, 0x6f, 0x73, 0x69, 0x74, 0x72, 0x61, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x61, 0x6d, 0x62, 0x72, 0x61,
+0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x61, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x44, 0x65,
+0x73, 0x61, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41,
+0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x4f, 0x67, 0x6f, 0x3b, 0x53,
+0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61,
+0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70, 0x72, 0x69,
+0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x4f, 0x67, 0x6f, 0x73,
+0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e,
+0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x46,
+0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44,
+0x3b, 0xd1c, 0xd28, 0xd41, 0x3b, 0xd2b, 0xd46, 0xd2c, 0xd4d, 0xd30, 0xd41, 0x3b, 0xd2e, 0xd3e, 0xd7c, 0x3b, 0xd0f, 0xd2a, 0xd4d, 0xd30,
+0xd3f, 0x3b, 0xd2e, 0xd47, 0xd2f, 0xd4d, 0x3b, 0xd1c, 0xd42, 0xd7a, 0x3b, 0xd1c, 0xd42, 0xd32, 0xd48, 0x3b, 0xd13, 0xd17, 0x3b, 0xd38,
+0xd46, 0xd2a, 0xd4d, 0xd31, 0xd4d, 0xd31, 0xd02, 0x3b, 0xd12, 0xd15, 0xd4d, 0xd1f, 0xd4b, 0x3b, 0xd28, 0xd35, 0xd02, 0x3b, 0xd21, 0xd3f,
+0xd38, 0xd02, 0x3b, 0xd1c, 0xd28, 0xd41, 0xd35, 0xd30, 0xd3f, 0x3b, 0xd2b, 0xd46, 0xd2c, 0xd4d, 0xd30, 0xd41, 0xd35, 0xd30, 0xd3f, 0x3b,
+0xd2e, 0xd3e, 0xd7c, 0xd1a, 0xd4d, 0xd1a, 0xd4d, 0x3b, 0xd0f, 0xd2a, 0xd4d, 0xd30, 0xd3f, 0xd7d, 0x3b, 0xd2e, 0xd47, 0xd2f, 0xd4d, 0x3b,
+0xd1c, 0xd42, 0xd7a, 0x3b, 0xd1c, 0xd42, 0xd32, 0xd48, 0x3b, 0xd13, 0xd17, 0xd38, 0xd4d, 0xd31, 0xd4d, 0xd31, 0xd4d, 0x3b, 0xd38, 0xd46,
+0xd2a, 0xd4d, 0xd31, 0xd4d, 0xd31, 0xd02, 0xd2c, 0xd7c, 0x3b, 0xd12, 0xd15, 0xd4d, 0x200c, 0xd1f, 0xd4b, 0xd2c, 0xd7c, 0x3b, 0xd28, 0xd35,
+0xd02, 0xd2c, 0xd7c, 0x3b, 0xd21, 0xd3f, 0xd38, 0xd02, 0xd2c, 0xd7c, 0x3b, 0xd1c, 0x3b, 0xd2b, 0xd46, 0x3b, 0xd2e, 0xd3e, 0x3b, 0xd0f,
+0x3b, 0xd2e, 0xd46, 0x3b, 0xd1c, 0xd42, 0xd7a, 0x3b, 0xd1c, 0xd42, 0x3b, 0xd13, 0x3b, 0xd38, 0xd46, 0x3b, 0xd12, 0x3b, 0xd28, 0x3b,
+0xd21, 0xd3f, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x72, 0x61, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d,
+0x65, 0x6a, 0x3b, 0x120, 0x75, 0x6e, 0x3b, 0x4c, 0x75, 0x6c, 0x3b, 0x41, 0x77, 0x77, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f,
+0x74, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x10b, 0x3b, 0x4a, 0x61, 0x6e, 0x6e, 0x61, 0x72, 0x3b, 0x46, 0x72,
+0x61, 0x72, 0x3b, 0x4d, 0x61, 0x72, 0x7a, 0x75, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x6a, 0x6a, 0x75,
+0x3b, 0x120, 0x75, 0x6e, 0x6a, 0x75, 0x3b, 0x4c, 0x75, 0x6c, 0x6a, 0x75, 0x3b, 0x41, 0x77, 0x77, 0x69, 0x73, 0x73, 0x75,
+0x3b, 0x53, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x75, 0x3b, 0x4f, 0x74, 0x74, 0x75, 0x62, 0x72, 0x75, 0x3b, 0x4e,
+0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x75, 0x3b, 0x44, 0x69, 0x10b, 0x65, 0x6d, 0x62, 0x72, 0x75, 0x3b, 0x4a, 0x6e, 0x3b,
+0x46, 0x72, 0x3b, 0x4d, 0x7a, 0x3b, 0x41, 0x70, 0x3b, 0x4d, 0x6a, 0x3b, 0x120, 0x6e, 0x3b, 0x4c, 0x6a, 0x3b, 0x41, 0x77,
+0x3b, 0x53, 0x74, 0x3b, 0x4f, 0x62, 0x3b, 0x4e, 0x76, 0x3b, 0x44, 0x10b, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41,
+0x3b, 0x4d, 0x3b, 0x120, 0x3b, 0x4c, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4b, 0x6f, 0x68,
+0x69, 0x3b, 0x48, 0x75, 0x69, 0x3b, 0x50, 0x6f, 0x75, 0x3b, 0x50, 0x61, 0x65, 0x3b, 0x48, 0x61, 0x72, 0x61, 0x3b, 0x50,
+0x69, 0x70, 0x69, 0x3b, 0x48, 0x14d, 0x6e, 0x67, 0x6f, 0x3b, 0x48, 0x65, 0x72, 0x65, 0x3b, 0x4d, 0x61, 0x68, 0x75, 0x3b,
+0x4e, 0x75, 0x6b, 0x75, 0x3b, 0x52, 0x61, 0x6e, 0x67, 0x69, 0x3b, 0x48, 0x61, 0x6b, 0x69, 0x3b, 0x4b, 0x6f, 0x68, 0x69,
+0x74, 0x101, 0x74, 0x65, 0x61, 0x3b, 0x48, 0x75, 0x69, 0x74, 0x61, 0x6e, 0x67, 0x75, 0x72, 0x75, 0x3b, 0x50, 0x6f, 0x75,
+0x74, 0x16b, 0x74, 0x65, 0x72, 0x61, 0x6e, 0x67, 0x69, 0x3b, 0x50, 0x61, 0x65, 0x6e, 0x67, 0x61, 0x77, 0x68, 0x101, 0x77,
+0x68, 0x101, 0x3b, 0x48, 0x61, 0x72, 0x61, 0x74, 0x75, 0x61, 0x3b, 0x50, 0x69, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x48, 0x14d,
+0x6e, 0x67, 0x6f, 0x6e, 0x67, 0x6f, 0x69, 0x3b, 0x48, 0x65, 0x72, 0x65, 0x74, 0x75, 0x72, 0x69, 0x6b, 0x14d, 0x6b, 0x101,
+0x3b, 0x4d, 0x61, 0x68, 0x75, 0x72, 0x75, 0x3b, 0x57, 0x68, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x61, 0x2d, 0x101, 0x2d, 0x6e,
+0x75, 0x6b, 0x75, 0x3b, 0x57, 0x68, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x61, 0x2d, 0x101, 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x69,
+0x3b, 0x48, 0x61, 0x6b, 0x69, 0x68, 0x65, 0x61, 0x3b, 0x4b, 0x3b, 0x48, 0x3b, 0x50, 0x3b, 0x50, 0x3b, 0x48, 0x3b, 0x50,
+0x3b, 0x48, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x52, 0x3b, 0x48, 0x3b, 0x91c, 0x93e, 0x928, 0x947, 0x3b, 0x92b, 0x947,
+0x92c, 0x94d, 0x930, 0x941, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x90f, 0x92a, 0x94d, 0x930, 0x93f, 0x3b, 0x92e, 0x947, 0x3b,
+0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x948, 0x3b, 0x911, 0x917, 0x3b, 0x938, 0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x3b, 0x911,
+0x915, 0x94d, 0x91f, 0x94b, 0x3b, 0x928, 0x94b, 0x935, 0x94d, 0x939, 0x947, 0x902, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x902, 0x3b, 0x91c,
+0x93e, 0x928, 0x947, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92e,
+0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x90f, 0x92a, 0x94d, 0x930, 0x93f, 0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c,
+0x941, 0x932, 0x948, 0x3b, 0x911, 0x917, 0x938, 0x94d, 0x91f, 0x3b, 0x938, 0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x911,
+0x915, 0x94d, 0x91f, 0x94b, 0x92c, 0x930, 0x3b, 0x928, 0x94b, 0x935, 0x94d, 0x939, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x921, 0x93f, 0x938,
+0x947, 0x902, 0x92c, 0x930, 0x3b, 0x91c, 0x93e, 0x3b, 0x92b, 0x947, 0x3b, 0x92e, 0x93e, 0x3b, 0x90f, 0x3b, 0x92e, 0x947, 0x3b, 0x91c,
+0x942, 0x3b, 0x91c, 0x941, 0x3b, 0x911, 0x3b, 0x938, 0x3b, 0x911, 0x3b, 0x928, 0x94b, 0x3b, 0x921, 0x93f, 0x3b, 0x31, 0x2d, 0x440,
+0x20, 0x441, 0x430, 0x440, 0x3b, 0x32, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x33, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440,
+0x3b, 0x34, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x35, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x36, 0x2d, 0x440,
+0x20, 0x441, 0x430, 0x440, 0x3b, 0x37, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x38, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440,
+0x3b, 0x39, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x31, 0x30, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x31, 0x31,
+0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x31, 0x32, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x41d, 0x44d, 0x433, 0x434,
+0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x425, 0x43e, 0x451, 0x440, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440,
+0x20, 0x441, 0x430, 0x440, 0x3b, 0x413, 0x443, 0x440, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440,
+0x3b, 0x414, 0x4e9, 0x440, 0x4e9, 0x432, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x422, 0x430, 0x432,
+0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x417, 0x443, 0x440, 0x433, 0x430, 0x430, 0x434, 0x443, 0x433,
+0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x414, 0x43e, 0x43b, 0x43e, 0x43e, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20,
+0x441, 0x430, 0x440, 0x3b, 0x41d, 0x430, 0x439, 0x43c, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x415,
+0x441, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x410, 0x440, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430,
+0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x410, 0x440, 0x432, 0x430, 0x43d, 0x20, 0x43d, 0x44d, 0x433, 0x434, 0x4af, 0x433, 0x44d,
+0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x410, 0x440, 0x432, 0x430, 0x43d, 0x20, 0x445, 0x43e, 0x451, 0x440, 0x434, 0x443, 0x433,
+0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x49, 0x3b, 0x49, 0x49, 0x3b, 0x49, 0x49, 0x49, 0x3b, 0x49, 0x56, 0x3b,
+0x56, 0x3b, 0x56, 0x49, 0x3b, 0x56, 0x49, 0x49, 0x3b, 0x56, 0x49, 0x49, 0x49, 0x3b, 0x49, 0x58, 0x3b, 0x58, 0x3b, 0x58,
+0x49, 0x3b, 0x58, 0x49, 0x49, 0x3b, 0x43d, 0x44d, 0x433, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b,
+0x445, 0x43e, 0x451, 0x440, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x433, 0x443, 0x440, 0x430, 0x432,
+0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x434, 0x4e9, 0x440, 0x4e9, 0x432, 0x434, 0x4af, 0x433, 0x44d,
+0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x442, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440,
+0x3b, 0x437, 0x443, 0x440, 0x433, 0x430, 0x430, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x434, 0x43e,
+0x43b, 0x43e, 0x43e, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x43d, 0x430, 0x439, 0x43c, 0x434, 0x443,
+0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x435, 0x441, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430,
+0x440, 0x3b, 0x430, 0x440, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x430, 0x440, 0x432,
+0x430, 0x43d, 0x20, 0x43d, 0x44d, 0x433, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x430, 0x440, 0x432,
+0x430, 0x43d, 0x20, 0x445, 0x43e, 0x451, 0x440, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x91c, 0x928,
+0x935, 0x930, 0x940, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930, 0x941, 0x905, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b,
+0x905, 0x92a, 0x94d, 0x930, 0x93f, 0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x93e, 0x908, 0x3b,
+0x905, 0x917, 0x938, 0x94d, 0x91f, 0x3b, 0x938, 0x947, 0x92a, 0x94d, 0x91f, 0x947, 0x92e, 0x94d, 0x92c, 0x930, 0x3b, 0x905, 0x915, 0x94d,
+0x91f, 0x94b, 0x92c, 0x930, 0x3b, 0x928, 0x94b, 0x92d, 0x947, 0x92e, 0x94d, 0x92c, 0x930, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x92e, 0x94d,
+0x92c, 0x930, 0x3b, 0x91c, 0x928, 0x3b, 0x92b, 0x947, 0x947, 0x92c, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d,
+0x930, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x3b, 0x905, 0x917, 0x3b, 0x938, 0x947, 0x92a, 0x3b,
+0x905, 0x915, 0x94d, 0x91f, 0x94b, 0x3b, 0x928, 0x94b, 0x92d, 0x947, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x3b, 0x91c, 0x928, 0x3b, 0x92b,
+0x947, 0x92c, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928,
+0x3b, 0x91c, 0x941, 0x932, 0x3b, 0x905, 0x917, 0x3b, 0x938, 0x947, 0x92a, 0x3b, 0x905, 0x915, 0x94d, 0x91f, 0x94b, 0x3b, 0x928, 0x94b,
+0x92d, 0x947, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75,
+0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75,
+0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65,
+0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65,
+0x72, 0x3b, 0x64, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0xb1c, 0xb3e, 0xb28, 0xb41, 0xb06, 0xb30, 0xb40, 0x3b, 0xb2b,
+0xb47, 0xb2c, 0xb43, 0xb06, 0xb30, 0xb40, 0x3b, 0xb2e, 0xb3e, 0xb30, 0xb4d, 0xb1a, 0xb4d, 0xb1a, 0x3b, 0xb05, 0xb2a, 0xb4d, 0xb30, 0xb47,
+0xb32, 0x3b, 0xb2e, 0xb07, 0x3b, 0xb1c, 0xb41, 0xb28, 0x3b, 0xb1c, 0xb41, 0xb32, 0xb3e, 0xb07, 0x3b, 0xb05, 0xb17, 0xb37, 0xb4d, 0xb1f,
+0x3b, 0xb38, 0xb47, 0xb2a, 0xb4d, 0xb1f, 0xb47, 0xb2e, 0xb4d, 0xb2c, 0xb30, 0x3b, 0xb05, 0xb15, 0xb4d, 0xb1f, 0xb4b, 0xb2c, 0xb30, 0x3b,
+0xb28, 0xb2d, 0xb47, 0xb2e, 0xb4d, 0xb2c, 0xb30, 0x3b, 0xb21, 0xb3f, 0xb38, 0xb47, 0xb2e, 0xb4d, 0xb2c, 0xb30, 0x3b, 0xb1c, 0xb3e, 0x3b,
+0xb2b, 0xb47, 0x3b, 0xb2e, 0xb3e, 0x3b, 0xb05, 0x3b, 0xb2e, 0xb07, 0x3b, 0xb1c, 0xb41, 0x3b, 0xb1c, 0xb41, 0x3b, 0xb05, 0x3b, 0xb38,
+0xb47, 0x3b, 0xb05, 0x3b, 0xb28, 0x3b, 0xb21, 0xb3f, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631,
+0x64a, 0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cd, 0x3b, 0x62c, 0x648, 0x646, 0x3b,
+0x62c, 0x648, 0x644, 0x627, 0x6cc, 0x3b, 0x627, 0x6ab, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9,
+0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x646, 0x648,
+0x631, 0x64a, 0x3b, 0x641, 0x6d0, 0x628, 0x631, 0x648, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc,
+0x644, 0x3b, 0x645, 0x6cd, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x6cc, 0x3b, 0x627, 0x6ab, 0x633, 0x62a, 0x3b,
+0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b,
+0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631, 0x64a, 0x3b, 0x645,
+0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cd, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644,
+0x627, 0x6cc, 0x3b, 0x627, 0x6ab, 0x633, 0x62a, 0x3b, 0x633, 0x6d0, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648,
+0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x3b, 0x641, 0x3b, 0x645,
+0x3b, 0x627, 0x3b, 0x645, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x627, 0x3b, 0x646, 0x3b, 0x62f, 0x3b, 0x698,
+0x627, 0x646, 0x648, 0x6cc, 0x647, 0x3b, 0x641, 0x648, 0x631, 0x6cc, 0x647, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x622, 0x648, 0x631,
+0x6cc, 0x644, 0x3b, 0x645, 0x647, 0x3b, 0x698, 0x648, 0x626, 0x646, 0x3b, 0x698, 0x648, 0x626, 0x6cc, 0x647, 0x3b, 0x627, 0x648, 0x62a,
+0x3b, 0x633, 0x67e, 0x62a, 0x627, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x627, 0x645, 0x628,
+0x631, 0x3b, 0x62f, 0x633, 0x627, 0x645, 0x628, 0x631, 0x3b, 0x698, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x622, 0x3b, 0x645, 0x3b, 0x698,
+0x3b, 0x698, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x627, 0x3b, 0x646, 0x3b, 0x62f, 0x3b, 0x698, 0x627, 0x646, 0x648, 0x6cc, 0x647, 0x654,
+0x3b, 0x641, 0x648, 0x631, 0x6cc, 0x647, 0x654, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x622, 0x648, 0x631, 0x6cc, 0x644, 0x3b, 0x645,
+0x647, 0x654, 0x3b, 0x698, 0x648, 0x626, 0x646, 0x3b, 0x698, 0x648, 0x626, 0x6cc, 0x647, 0x654, 0x3b, 0x627, 0x648, 0x62a, 0x3b, 0x633,
+0x67e, 0x62a, 0x627, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x627, 0x645, 0x628, 0x631, 0x3b,
+0x62f, 0x633, 0x627, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x6cc, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631, 0x6cc, 0x3b,
+0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648,
+0x644, 0x627, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648,
+0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x646, 0x648, 0x3b, 0x641,
+0x628, 0x631, 0x648, 0x631, 0x6cc, 0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cc, 0x3b,
+0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b,
+0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x3b, 0x73, 0x74, 0x79,
+0x3b, 0x6c, 0x75, 0x74, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6b, 0x77, 0x69, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x63, 0x7a, 0x65,
+0x3b, 0x6c, 0x69, 0x70, 0x3b, 0x73, 0x69, 0x65, 0x3b, 0x77, 0x72, 0x7a, 0x3b, 0x70, 0x61, 0x17a, 0x3b, 0x6c, 0x69, 0x73,
+0x3b, 0x67, 0x72, 0x75, 0x3b, 0x73, 0x74, 0x79, 0x63, 0x7a, 0x65, 0x144, 0x3b, 0x6c, 0x75, 0x74, 0x79, 0x3b, 0x6d, 0x61,
+0x72, 0x7a, 0x65, 0x63, 0x3b, 0x6b, 0x77, 0x69, 0x65, 0x63, 0x69, 0x65, 0x144, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x63, 0x7a,
+0x65, 0x72, 0x77, 0x69, 0x65, 0x63, 0x3b, 0x6c, 0x69, 0x70, 0x69, 0x65, 0x63, 0x3b, 0x73, 0x69, 0x65, 0x72, 0x70, 0x69,
+0x65, 0x144, 0x3b, 0x77, 0x72, 0x7a, 0x65, 0x73, 0x69, 0x65, 0x144, 0x3b, 0x70, 0x61, 0x17a, 0x64, 0x7a, 0x69, 0x65, 0x72,
+0x6e, 0x69, 0x6b, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x3b, 0x67, 0x72, 0x75, 0x64, 0x7a, 0x69, 0x65,
+0x144, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x43, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x57, 0x3b,
+0x50, 0x3b, 0x4c, 0x3b, 0x47, 0x3b, 0x73, 0x74, 0x79, 0x63, 0x7a, 0x6e, 0x69, 0x61, 0x3b, 0x6c, 0x75, 0x74, 0x65, 0x67,
+0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x63, 0x61, 0x3b, 0x6b, 0x77, 0x69, 0x65, 0x74, 0x6e, 0x69, 0x61, 0x3b, 0x6d, 0x61, 0x6a,
+0x61, 0x3b, 0x63, 0x7a, 0x65, 0x72, 0x77, 0x63, 0x61, 0x3b, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x3b, 0x73, 0x69, 0x65, 0x72,
+0x70, 0x6e, 0x69, 0x61, 0x3b, 0x77, 0x72, 0x7a, 0x65, 0x15b, 0x6e, 0x69, 0x61, 0x3b, 0x70, 0x61, 0x17a, 0x64, 0x7a, 0x69,
+0x65, 0x72, 0x6e, 0x69, 0x6b, 0x61, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x61, 0x3b, 0x67, 0x72, 0x75,
+0x64, 0x6e, 0x69, 0x61, 0x3b, 0x73, 0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x63, 0x3b, 0x6c, 0x3b, 0x73,
+0x3b, 0x77, 0x3b, 0x70, 0x3b, 0x6c, 0x3b, 0x67, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x76, 0x2e, 0x3b, 0x6d,
+0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a,
+0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65, 0x74, 0x2e, 0x3b, 0x6f, 0x75, 0x74, 0x2e, 0x3b, 0x6e,
+0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x7a, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x76,
+0x65, 0x72, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0xe7, 0x6f, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d,
+0x61, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x68, 0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x68, 0x6f, 0x3b, 0x61, 0x67, 0x6f, 0x73,
+0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x72, 0x6f, 0x3b,
+0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x64, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0xa1c, 0xa28,
+0x3b, 0xa2b, 0xa3c, 0xa30, 0x3b, 0xa2e, 0xa3e, 0xa30, 0xa1a, 0x3b, 0xa05, 0xa2a, 0xa4d, 0xa30, 0xa48, 0x3b, 0xa2e, 0xa08, 0x3b, 0xa1c,
+0xa42, 0xa28, 0x3b, 0xa1c, 0xa41, 0xa32, 0xa3e, 0x3b, 0xa05, 0xa17, 0x3b, 0xa38, 0xa24, 0xa70, 0x3b, 0xa05, 0xa15, 0xa24, 0xa42, 0x3b,
+0xa28, 0xa35, 0xa70, 0x3b, 0xa26, 0xa38, 0xa70, 0x3b, 0xa1c, 0xa28, 0xa35, 0xa30, 0xa40, 0x3b, 0xa2b, 0xa3c, 0xa30, 0xa35, 0xa30, 0xa40,
+0x3b, 0xa2e, 0xa3e, 0xa30, 0xa1a, 0x3b, 0xa05, 0xa2a, 0xa4d, 0xa30, 0xa48, 0xa32, 0x3b, 0xa2e, 0xa08, 0x3b, 0xa1c, 0xa42, 0xa28, 0x3b,
+0xa1c, 0xa41, 0xa32, 0xa3e, 0xa08, 0x3b, 0xa05, 0xa17, 0xa38, 0xa24, 0x3b, 0xa38, 0xa24, 0xa70, 0xa2c, 0xa30, 0x3b, 0xa05, 0xa15, 0xa24,
+0xa42, 0xa2c, 0xa30, 0x3b, 0xa28, 0xa35, 0xa70, 0xa2c, 0xa30, 0x3b, 0xa26, 0xa38, 0xa70, 0xa2c, 0xa30, 0x3b, 0xa1c, 0x3b, 0xa2b, 0xa3c,
+0x3b, 0xa2e, 0xa3e, 0x3b, 0xa05, 0x3b, 0xa2e, 0x3b, 0xa1c, 0xa42, 0x3b, 0xa1c, 0xa41, 0x3b, 0xa05, 0x3b, 0xa38, 0x3b, 0xa05, 0x3b,
+0xa28, 0x3b, 0xa26, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x6cc, 0x3b, 0x641, 0x631, 0x648, 0x631, 0x6cc, 0x3b, 0x645, 0x627, 0x631, 0x686,
+0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x626, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x626, 0x6cc,
+0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646,
+0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x45, 0x6e, 0x65, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d,
+0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41,
+0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x63, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x63, 0x3b, 0x45,
+0x6e, 0x65, 0x72, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x41,
+0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x6f, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x4a, 0x75, 0x6c, 0x69,
+0x6f, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x4f,
+0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x4e, 0x6f, 0x76, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x44, 0x69, 0x63,
+0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x73, 0x63, 0x68, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x61, 0x76, 0x72, 0x2e, 0x3b,
+0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x74, 0x67, 0x3b, 0x7a, 0x65, 0x72, 0x63, 0x6c,
+0x2e, 0x3b, 0x66, 0x61, 0x6e, 0x2e, 0x3b, 0x61, 0x76, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x74, 0x2e, 0x3b, 0x6f,
+0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x73, 0x63, 0x68, 0x61, 0x6e, 0x65,
+0x72, 0x3b, 0x66, 0x61, 0x76, 0x72, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x69, 0x67, 0x6c,
+0x3b, 0x6d, 0x61, 0x74, 0x67, 0x3b, 0x7a, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x64, 0x75, 0x72, 0x3b, 0x66, 0x61, 0x6e, 0x61,
+0x64, 0x75, 0x72, 0x3b, 0x61, 0x76, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b,
+0x6f, 0x63, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63,
+0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x53, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x46, 0x3b,
+0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x64, 0x61, 0x20, 0x73, 0x63, 0x68, 0x61, 0x6e, 0x65, 0x72,
+0x3b, 0x64, 0x61, 0x20, 0x66, 0x61, 0x76, 0x72, 0x65, 0x72, 0x3b, 0x64, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x64,
+0x2019, 0x61, 0x76, 0x72, 0x69, 0x67, 0x6c, 0x3b, 0x64, 0x61, 0x20, 0x6d, 0x61, 0x74, 0x67, 0x3b, 0x64, 0x61, 0x20, 0x7a,
+0x65, 0x72, 0x63, 0x6c, 0x61, 0x64, 0x75, 0x72, 0x3b, 0x64, 0x61, 0x20, 0x66, 0x61, 0x6e, 0x61, 0x64, 0x75, 0x72, 0x3b,
+0x64, 0x2019, 0x61, 0x76, 0x75, 0x73, 0x74, 0x3b, 0x64, 0x61, 0x20, 0x73, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72,
+0x3b, 0x64, 0x2019, 0x6f, 0x63, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x61, 0x20, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
+0x65, 0x72, 0x3b, 0x64, 0x61, 0x20, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x69, 0x61, 0x6e, 0x2e, 0x3b,
+0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x69,
+0x75, 0x6e, 0x2e, 0x3b, 0x69, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b,
+0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x69, 0x61, 0x6e, 0x75, 0x61,
+0x72, 0x69, 0x65, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x65, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x65,
+0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x69, 0x65, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x69, 0x75, 0x6e, 0x69, 0x65, 0x3b, 0x69,
+0x75, 0x6c, 0x69, 0x65, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72,
+0x69, 0x65, 0x3b, 0x6f, 0x63, 0x74, 0x6f, 0x6d, 0x62, 0x72, 0x69, 0x65, 0x3b, 0x6e, 0x6f, 0x69, 0x65, 0x6d, 0x62, 0x72,
+0x69, 0x65, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x65, 0x3b, 0x49, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41,
+0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x44f, 0x43d, 0x432,
+0x2e, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430,
+0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x44c, 0x3b, 0x438, 0x44e, 0x43b, 0x44c, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d,
+0x442, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x44f,
+0x43d, 0x432, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b,
+0x43c, 0x430, 0x44f, 0x3b, 0x438, 0x44e, 0x43d, 0x2e, 0x3b, 0x438, 0x44e, 0x43b, 0x2e, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441,
+0x435, 0x43d, 0x442, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e,
+0x3b, 0x44f, 0x43d, 0x432, 0x430, 0x440, 0x44f, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44f, 0x3b, 0x43c, 0x430, 0x440, 0x442,
+0x430, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44f, 0x3b, 0x43c, 0x430, 0x44f, 0x3b, 0x438, 0x44e, 0x43d, 0x44f, 0x3b, 0x438, 0x44e,
+0x43b, 0x44f, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x430, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44f, 0x3b,
+0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44f, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x44f, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431,
+0x440, 0x44f, 0x3b, 0x4e, 0x79, 0x65, 0x3b, 0x46, 0x75, 0x6c, 0x3b, 0x4d, 0x62, 0xe4, 0x3b, 0x4e, 0x67, 0x75, 0x3b, 0x42,
+0xea, 0x6c, 0x3b, 0x46, 0xf6, 0x6e, 0x3b, 0x4c, 0x65, 0x6e, 0x3b, 0x4b, 0xfc, 0x6b, 0x3b, 0x4d, 0x76, 0x75, 0x3b, 0x4e,
+0x67, 0x62, 0x3b, 0x4e, 0x61, 0x62, 0x3b, 0x4b, 0x61, 0x6b, 0x3b, 0x4e, 0x79, 0x65, 0x6e, 0x79, 0x65, 0x3b, 0x46, 0x75,
+0x6c, 0x75, 0x6e, 0x64, 0xef, 0x67, 0x69, 0x3b, 0x4d, 0x62, 0xe4, 0x6e, 0x67, 0xfc, 0x3b, 0x4e, 0x67, 0x75, 0x62, 0xf9,
+0x65, 0x3b, 0x42, 0xea, 0x6c, 0xe4, 0x77, 0xfc, 0x3b, 0x46, 0xf6, 0x6e, 0x64, 0x6f, 0x3b, 0x4c, 0x65, 0x6e, 0x67, 0x75,
+0x61, 0x3b, 0x4b, 0xfc, 0x6b, 0xfc, 0x72, 0xfc, 0x3b, 0x4d, 0x76, 0x75, 0x6b, 0x61, 0x3b, 0x4e, 0x67, 0x62, 0x65, 0x72,
+0x65, 0x72, 0x65, 0x3b, 0x4e, 0x61, 0x62, 0xe4, 0x6e, 0x64, 0xfc, 0x72, 0x75, 0x3b, 0x4b, 0x61, 0x6b, 0x61, 0x75, 0x6b,
+0x61, 0x3b, 0x4e, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x42, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b,
+0x4e, 0x3b, 0x4e, 0x3b, 0x4b, 0x3b, 0x458, 0x430, 0x43d, 0x3b, 0x444, 0x435, 0x431, 0x3b, 0x43c, 0x430, 0x440, 0x3b, 0x430, 0x43f,
+0x440, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435,
+0x43f, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x432, 0x3b, 0x434, 0x435, 0x446, 0x3b, 0x458, 0x430, 0x43d, 0x443, 0x430, 0x440,
+0x3b, 0x444, 0x435, 0x431, 0x440, 0x443, 0x430, 0x440, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x438, 0x43b, 0x3b,
+0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441,
+0x435, 0x43f, 0x442, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x431, 0x430, 0x440, 0x3b, 0x43d, 0x43e, 0x432,
+0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x446, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x458, 0x430, 0x43d, 0x3b, 0x444,
+0x435, 0x431, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b,
+0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x432,
+0x3b, 0x434, 0x435, 0x446, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72,
+0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x3b, 0x73, 0x65, 0x70,
+0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b,
+0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d,
+0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65,
+0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65,
+0x6d, 0x62, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65,
+0x62, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a,
+0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b,
+0x64, 0x65, 0x63, 0x3b, 0x42f, 0x43d, 0x432, 0x2e, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x2e,
+0x3b, 0x410, 0x43f, 0x440, 0x2e, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x44c, 0x3b, 0x418, 0x44e, 0x43b, 0x44c, 0x3b,
+0x410, 0x432, 0x433, 0x2e, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x2e, 0x3b, 0x41e, 0x43a, 0x442, 0x2e, 0x3b, 0x41d, 0x43e, 0x44f, 0x431,
+0x2e, 0x3b, 0x414, 0x435, 0x43a, 0x2e, 0x3b, 0x42f, 0x43d, 0x432, 0x430, 0x440, 0x44c, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b,
+0x44c, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x44a, 0x438, 0x3b, 0x410, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x41c, 0x430, 0x439, 0x3b,
+0x418, 0x44e, 0x43d, 0x44c, 0x3b, 0x418, 0x44e, 0x43b, 0x44c, 0x3b, 0x410, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421, 0x435, 0x43d,
+0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x41e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x41d, 0x43e, 0x44f, 0x431, 0x440, 0x44c,
+0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44c, 0x3b, 0x44f, 0x43d, 0x432, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b, 0x43c,
+0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x44b, 0x3b, 0x438, 0x44e, 0x43d, 0x44b, 0x3b, 0x438,
+0x44e, 0x43b, 0x44b, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d,
+0x43e, 0x44f, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x44f, 0x43d, 0x432, 0x430, 0x440, 0x44b, 0x3b, 0x444, 0x435, 0x432, 0x440,
+0x430, 0x43b, 0x44b, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x44a, 0x438, 0x439, 0x44b, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44b, 0x3b,
+0x43c, 0x430, 0x439, 0x44b, 0x3b, 0x438, 0x44e, 0x43d, 0x44b, 0x3b, 0x438, 0x44e, 0x43b, 0x44b, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441,
+0x442, 0x44b, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44b, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44b, 0x3b,
+0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x44b, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44b, 0x3b, 0x4e, 0x64, 0x69, 0x3b, 0x4b,
+0x75, 0x6b, 0x3b, 0x4b, 0x75, 0x72, 0x3b, 0x4b, 0x75, 0x62, 0x3b, 0x43, 0x68, 0x76, 0x3b, 0x43, 0x68, 0x6b, 0x3b, 0x43,
+0x68, 0x67, 0x3b, 0x4e, 0x79, 0x61, 0x3b, 0x47, 0x75, 0x6e, 0x3b, 0x47, 0x75, 0x6d, 0x3b, 0x4d, 0x62, 0x75, 0x3b, 0x5a,
+0x76, 0x69, 0x3b, 0x4e, 0x64, 0x69, 0x72, 0x61, 0x3b, 0x4b, 0x75, 0x6b, 0x61, 0x64, 0x7a, 0x69, 0x3b, 0x4b, 0x75, 0x72,
+0x75, 0x6d, 0x65, 0x3b, 0x4b, 0x75, 0x62, 0x76, 0x75, 0x6d, 0x62, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x76, 0x61, 0x62, 0x76,
+0x75, 0x3b, 0x43, 0x68, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x6b, 0x75, 0x6e, 0x67, 0x75, 0x72, 0x75,
+0x3b, 0x4e, 0x79, 0x61, 0x6d, 0x61, 0x76, 0x68, 0x75, 0x76, 0x68, 0x75, 0x3b, 0x47, 0x75, 0x6e, 0x79, 0x61, 0x6e, 0x61,
+0x3b, 0x47, 0x75, 0x6d, 0x69, 0x67, 0x75, 0x72, 0x75, 0x3b, 0x4d, 0x62, 0x75, 0x64, 0x7a, 0x69, 0x3b, 0x5a, 0x76, 0x69,
+0x74, 0x61, 0x3b, 0x4e, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x4e, 0x3b, 0x47,
+0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x64a, 0x628, 0x631, 0x648, 0x631, 0x64a,
+0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x626, 0x64a, 0x3b, 0x62c, 0x648, 0x646, 0x3b,
+0x62c, 0x648, 0x644, 0x627, 0x621, 0x650, 0x3b, 0x622, 0x6af, 0x633, 0x67d, 0x3b, 0x633, 0x64a, 0x67e, 0x67d, 0x645, 0x628, 0x631, 0x3b,
+0x622, 0x6aa, 0x67d, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x68a, 0x633, 0x645, 0x628, 0x631, 0x3b, 0xda2,
+0xdb1, 0x3b, 0xdb4, 0xdd9, 0xdb6, 0x3b, 0xdb8, 0xdcf, 0xdbb, 0xdca, 0x3b, 0xd85, 0xdb4, 0xdca, 0x200d, 0xdbb, 0xdda, 0xdbd, 0xdca, 0x3b,
+0xdb8, 0xdd0, 0xdba, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdb1, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdbd, 0xdd2, 0x3b, 0xd85, 0xd9c, 0xddd, 0x3b, 0xdc3,
+0xdd0, 0xdb4, 0xdca, 0x3b, 0xd94, 0xd9a, 0xdca, 0x3b, 0xdb1, 0xddc, 0xdc0, 0xdd0, 0x3b, 0xdaf, 0xdd9, 0xdc3, 0xdd0, 0x3b, 0xda2, 0xdb1,
+0xdc0, 0xdcf, 0xdbb, 0xdd2, 0x3b, 0xdb4, 0xdd9, 0xdb6, 0xdbb, 0xdc0, 0xdcf, 0xdbb, 0xdd2, 0x3b, 0xdb8, 0xdcf, 0xdbb, 0xdca, 0xdad, 0xdd4,
+0x3b, 0xd85, 0xdb4, 0xdca, 0x200d, 0xdbb, 0xdda, 0xdbd, 0xdca, 0x3b, 0xdb8, 0xdd0, 0xdba, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdb1, 0xdd2, 0x3b,
+0xda2, 0xdd6, 0xdbd, 0xdd2, 0x3b, 0xd85, 0xd9c, 0xddd, 0xdc3, 0xdca, 0xdad, 0xdd4, 0x3b, 0xdc3, 0xdd0, 0xdb4, 0xdca, 0xdad, 0xdd0, 0xdb8,
+0xdca, 0xdb6, 0xdbb, 0xdca, 0x3b, 0xd94, 0xd9a, 0xdca, 0xdad, 0xddd, 0xdb6, 0xdbb, 0xdca, 0x3b, 0xdb1, 0xddc, 0xdc0, 0xdd0, 0xdb8, 0xdca,
+0xdb6, 0xdbb, 0xdca, 0x3b, 0xdaf, 0xdd9, 0xdc3, 0xdd0, 0xdb8, 0xdca, 0xdb6, 0xdbb, 0xdca, 0x3b, 0xda2, 0x3b, 0xdb4, 0xdd9, 0x3b, 0xdb8,
+0xdcf, 0x3b, 0xd85, 0x3b, 0xdb8, 0xdd0, 0x3b, 0xda2, 0xdd6, 0x3b, 0xda2, 0xdd6, 0x3b, 0xd85, 0x3b, 0xdc3, 0xdd0, 0x3b, 0xd94, 0x3b,
+0xdb1, 0xdd9, 0x3b, 0xdaf, 0xdd9, 0x3b, 0xda2, 0xdb1, 0x3b, 0xdb4, 0xdd9, 0xdb6, 0x3b, 0xdb8, 0xdcf, 0xdbb, 0xdca, 0xdad, 0xdd4, 0x3b,
+0xd85, 0xdb4, 0xdca, 0x200d, 0xdbb, 0xdda, 0xdbd, 0xdca, 0x3b, 0xdb8, 0xdd0, 0xdba, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdb1, 0xdd2, 0x3b, 0xda2,
+0xdd6, 0xdbd, 0xdd2, 0x3b, 0xd85, 0xd9c, 0xddd, 0x3b, 0xdc3, 0xdd0, 0xdb4, 0xdca, 0x3b, 0xd94, 0xd9a, 0xdca, 0x3b, 0xdb1, 0xddc, 0xdc0,
+0xdd0, 0x3b, 0xdaf, 0xdd9, 0xdc3, 0xdd0, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61,
+0x70, 0x72, 0x3b, 0x6d, 0xe1, 0x6a, 0x3b, 0x6a, 0xfa, 0x6e, 0x3b, 0x6a, 0xfa, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73,
+0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0xe1,
+0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0xe1, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x65, 0x63, 0x3b, 0x61, 0x70, 0x72, 0xed,
+0x6c, 0x3b, 0x6d, 0xe1, 0x6a, 0x3b, 0x6a, 0xfa, 0x6e, 0x3b, 0x6a, 0xfa, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74,
+0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0xf3, 0x62, 0x65, 0x72, 0x3b, 0x6e,
+0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e,
+0x75, 0xe1, 0x72, 0x61, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0xe1, 0x72, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x63, 0x61, 0x3b,
+0x61, 0x70, 0x72, 0xed, 0x6c, 0x61, 0x3b, 0x6d, 0xe1, 0x6a, 0x61, 0x3b, 0x6a, 0xfa, 0x6e, 0x61, 0x3b, 0x6a, 0xfa, 0x6c,
+0x61, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b,
+0x6f, 0x6b, 0x74, 0xf3, 0x62, 0x72, 0x61, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x64, 0x65, 0x63,
+0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e,
+0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b,
+0x61, 0x76, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b,
+0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b,
+0x6d, 0x61, 0x72, 0x65, 0x63, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69,
+0x6a, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x3b, 0x61, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65,
+0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65,
+0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d,
+0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4c, 0x75, 0x6c, 0x3b, 0x4f,
+0x67, 0x73, 0x3b, 0x53, 0x65, 0x62, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x66, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a,
+0x61, 0x6e, 0x6e, 0x61, 0x61, 0x79, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x61, 0x61, 0x79, 0x6f, 0x3b, 0x4d, 0x61, 0x61,
+0x72, 0x73, 0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x75, 0x6e, 0x3b,
+0x4c, 0x75, 0x75, 0x6c, 0x69, 0x79, 0x6f, 0x3b, 0x4f, 0x67, 0x6f, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x62, 0x74, 0x65, 0x6d,
+0x62, 0x61, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x66, 0x65, 0x6d, 0x62, 0x61,
+0x72, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d,
+0x3b, 0x4a, 0x3b, 0x4c, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61,
+0x20, 0x4b, 0x6f, 0x6f, 0x62, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x4c, 0x61, 0x62, 0x61, 0x61,
+0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53, 0x61, 0x64, 0x64, 0x65, 0x78, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69,
+0x73, 0x68, 0x61, 0x20, 0x41, 0x66, 0x72, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53, 0x68, 0x61,
+0x6e, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x4c, 0x69, 0x78, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69,
+0x73, 0x68, 0x61, 0x20, 0x54, 0x6f, 0x64, 0x6f, 0x62, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53,
+0x69, 0x64, 0x65, 0x65, 0x64, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53, 0x61, 0x67, 0x61, 0x61,
+0x6c, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x54, 0x6f, 0x62, 0x6e, 0x61, 0x61, 0x64, 0x3b, 0x42,
+0x69, 0x73, 0x68, 0x61, 0x20, 0x4b, 0x6f, 0x77, 0x20, 0x69, 0x79, 0x6f, 0x20, 0x54, 0x6f, 0x62, 0x6e, 0x61, 0x61, 0x64,
+0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x4c, 0x61, 0x62, 0x61, 0x20, 0x69, 0x79, 0x6f, 0x20, 0x54, 0x6f, 0x62, 0x6e,
+0x61, 0x61, 0x64, 0x3b, 0x65, 0x6e, 0x65, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61,
+0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x79, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61,
+0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b,
+0x64, 0x69, 0x63, 0x2e, 0x3b, 0x65, 0x6e, 0x65, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x6d,
+0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69,
+0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x69,
+0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x69, 0x65, 0x6d,
+0x62, 0x72, 0x65, 0x3b, 0x64, 0x69, 0x63, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x45, 0x3b, 0x46, 0x3b, 0x4d, 0x3b,
+0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x65, 0x6e,
+0x65, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61,
+0x79, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65,
+0x70, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x69, 0x63, 0x2e, 0x3b, 0x45, 0x6e,
+0x65, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x41, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x61,
+0x79, 0x2e, 0x3b, 0x4a, 0x75, 0x6e, 0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x41, 0x67, 0x6f, 0x2e, 0x3b, 0x53, 0x65,
+0x74, 0x2e, 0x3b, 0x4f, 0x63, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x69, 0x63, 0x2e, 0x3b, 0x65, 0x6e,
+0x65, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61,
+0x79, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65,
+0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x69, 0x63, 0x2e, 0x3b, 0x65, 0x6e,
+0x65, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61, 0x62,
+0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f,
+0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63,
+0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x69, 0x63, 0x69,
+0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70,
+0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65,
+0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72,
+0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70, 0x72,
+0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x41,
+0x67, 0x6f, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62,
+0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x6a, 0x61,
+0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61,
+0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70,
+0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e,
+0x75, 0x61, 0x72, 0x69, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61,
+0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61,
+0x75, 0x67, 0x75, 0x73, 0x74, 0x69, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74,
+0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62,
+0x65, 0x72, 0x3b, 0x42f, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x41c, 0x430, 0x440, 0x442,
+0x3b, 0x410, 0x43f, 0x440, 0x435, 0x43b, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x3b, 0x418, 0x44e, 0x43b, 0x3b, 0x410,
+0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x3b, 0x41e, 0x43a, 0x442, 0x44f, 0x431, 0x440,
+0x3b, 0x41d, 0x43e, 0x44f, 0x431, 0x440, 0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0xb9c, 0xba9, 0x2e, 0x3b, 0xbaa, 0xbbf,
+0xbaa, 0xbcd, 0x2e, 0x3b, 0xbae, 0xbbe, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xb8f, 0xbaa, 0xbcd, 0x2e, 0x3b, 0xbae, 0xbc7, 0x3b, 0xb9c, 0xbc2,
+0xba9, 0xbcd, 0x3b, 0xb9c, 0xbc2, 0xbb2, 0xbc8, 0x3b, 0xb86, 0xb95, 0x2e, 0x3b, 0xb9a, 0xbc6, 0xbaa, 0xbcd, 0x2e, 0x3b, 0xb85, 0xb95,
+0xbcd, 0x2e, 0x3b, 0xba8, 0xbb5, 0x2e, 0x3b, 0xb9f, 0xbbf, 0xb9a, 0x2e, 0x3b, 0xb9c, 0xba9, 0xbb5, 0xbb0, 0xbbf, 0x3b, 0xbaa, 0xbbf,
+0xbaa, 0xbcd, 0xbb0, 0xbb5, 0xbb0, 0xbbf, 0x3b, 0xbae, 0xbbe, 0xbb0, 0xbcd, 0xb9a, 0xbcd, 0x3b, 0xb8f, 0xbaa, 0xbcd, 0xbb0, 0xbb2, 0xbcd,
+0x3b, 0xbae, 0xbc7, 0x3b, 0xb9c, 0xbc2, 0xba9, 0xbcd, 0x3b, 0xb9c, 0xbc2, 0xbb2, 0xbc8, 0x3b, 0xb86, 0xb95, 0xbb8, 0xbcd, 0xb9f, 0xbcd,
+0x3b, 0xb9a, 0xbc6, 0xbaa, 0xbcd, 0xb9f, 0xbae, 0xbcd, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xb85, 0xb95, 0xbcd, 0xb9f, 0xbcb, 0xbaa, 0xbb0, 0xbcd,
+0x3b, 0xba8, 0xbb5, 0xbae, 0xbcd, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xb9f, 0xbbf, 0xb9a, 0xbae, 0xbcd, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xb9c, 0x3b,
+0xbaa, 0xbbf, 0x3b, 0xbae, 0xbbe, 0x3b, 0xb8f, 0x3b, 0xbae, 0xbc7, 0x3b, 0xb9c, 0xbc2, 0x3b, 0xb9c, 0xbc2, 0x3b, 0xb86, 0x3b, 0xb9a,
+0xbc6, 0x3b, 0xb85, 0x3b, 0xba8, 0x3b, 0xb9f, 0xbbf, 0x3b, 0x433, 0x44b, 0x439, 0x43d, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b,
+0x43c, 0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x44c, 0x3b, 0x438,
+0x44e, 0x43b, 0x44c, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b,
+0x43d, 0x43e, 0x44f, 0x431, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x433, 0x44b, 0x439, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x444,
+0x435, 0x432, 0x440, 0x430, 0x43b, 0x44c, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x43c,
+0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x44c, 0x3b, 0x438, 0x44e, 0x43b, 0x44c, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b,
+0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43d, 0x43e, 0x44f,
+0x431, 0x440, 0x44c, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44c, 0x3b, 0xc1c, 0xc28, 0x3b, 0xc2b, 0xc3f, 0xc2c, 0xc4d, 0xc30,
+0x3b, 0xc2e, 0xc3e, 0xc30, 0xc4d, 0xc1a, 0xc3f, 0x3b, 0xc0f, 0xc2a, 0xc4d, 0xc30, 0xc3f, 0x3b, 0xc2e, 0xc47, 0x3b, 0xc1c, 0xc42, 0xc28,
+0xc4d, 0x3b, 0xc1c, 0xc41, 0xc32, 0xc48, 0x3b, 0xc06, 0xc17, 0x3b, 0xc38, 0xc46, 0xc2a, 0xc4d, 0xc1f, 0xc46, 0xc02, 0x3b, 0xc05, 0xc15,
+0xc4d, 0xc1f, 0xc4b, 0x3b, 0xc28, 0xc35, 0xc02, 0x3b, 0xc21, 0xc3f, 0xc38, 0xc46, 0xc02, 0x3b, 0xc1c, 0xc28, 0xc35, 0xc30, 0xc3f, 0x3b,
+0xc2b, 0xc3f, 0xc2c, 0xc4d, 0xc30, 0xc35, 0xc30, 0xc3f, 0x3b, 0xc2e, 0xc3e, 0xc30, 0xc4d, 0xc1a, 0xc3f, 0x3b, 0xc0f, 0xc2a, 0xc4d, 0xc30,
+0xc3f, 0xc32, 0xc4d, 0x3b, 0xc2e, 0xc47, 0x3b, 0xc1c, 0xc42, 0xc28, 0xc4d, 0x3b, 0xc1c, 0xc41, 0xc32, 0xc48, 0x3b, 0xc06, 0xc17, 0xc38,
+0xc4d, 0xc1f, 0xc41, 0x3b, 0xc38, 0xc46, 0xc2a, 0xc4d, 0xc1f, 0xc46, 0xc02, 0xc2c, 0xc30, 0xc4d, 0x3b, 0xc05, 0xc15, 0xc4d, 0xc1f, 0xc4b,
+0xc2c, 0xc30, 0xc4d, 0x3b, 0xc28, 0xc35, 0xc02, 0xc2c, 0xc30, 0xc4d, 0x3b, 0xc21, 0xc3f, 0xc38, 0xc46, 0xc02, 0xc2c, 0xc30, 0xc4d, 0x3b,
+0xc1c, 0x3b, 0xc2b, 0xc3f, 0x3b, 0xc2e, 0xc3e, 0x3b, 0xc0f, 0x3b, 0xc2e, 0xc47, 0x3b, 0xc1c, 0xc42, 0x3b, 0xc1c, 0xc41, 0x3b, 0xc06,
+0x3b, 0xc38, 0xc46, 0x3b, 0xc05, 0x3b, 0xc28, 0x3b, 0xc21, 0xc3f, 0x3b, 0xe21, 0x2e, 0xe04, 0x2e, 0x3b, 0xe01, 0x2e, 0xe1e, 0x2e,
+0x3b, 0xe21, 0xe35, 0x2e, 0xe04, 0x2e, 0x3b, 0xe40, 0xe21, 0x2e, 0xe22, 0x2e, 0x3b, 0xe1e, 0x2e, 0xe04, 0x2e, 0x3b, 0xe21, 0xe34,
+0x2e, 0xe22, 0x2e, 0x3b, 0xe01, 0x2e, 0xe04, 0x2e, 0x3b, 0xe2a, 0x2e, 0xe04, 0x2e, 0x3b, 0xe01, 0x2e, 0xe22, 0x2e, 0x3b, 0xe15,
+0x2e, 0xe04, 0x2e, 0x3b, 0xe1e, 0x2e, 0xe22, 0x2e, 0x3b, 0xe18, 0x2e, 0xe04, 0x2e, 0x3b, 0xe21, 0xe01, 0xe23, 0xe32, 0xe04, 0xe21,
+0x3b, 0xe01, 0xe38, 0xe21, 0xe20, 0xe32, 0xe1e, 0xe31, 0xe19, 0xe18, 0xe4c, 0x3b, 0xe21, 0xe35, 0xe19, 0xe32, 0xe04, 0xe21, 0x3b, 0xe40,
+0xe21, 0xe29, 0xe32, 0xe22, 0xe19, 0x3b, 0xe1e, 0xe24, 0xe29, 0xe20, 0xe32, 0xe04, 0xe21, 0x3b, 0xe21, 0xe34, 0xe16, 0xe38, 0xe19, 0xe32,
+0xe22, 0xe19, 0x3b, 0xe01, 0xe23, 0xe01, 0xe0e, 0xe32, 0xe04, 0xe21, 0x3b, 0xe2a, 0xe34, 0xe07, 0xe2b, 0xe32, 0xe04, 0xe21, 0x3b, 0xe01,
+0xe31, 0xe19, 0xe22, 0xe32, 0xe22, 0xe19, 0x3b, 0xe15, 0xe38, 0xe25, 0xe32, 0xe04, 0xe21, 0x3b, 0xe1e, 0xe24, 0xe28, 0xe08, 0xe34, 0xe01,
+0xe32, 0xe22, 0xe19, 0x3b, 0xe18, 0xe31, 0xe19, 0xe27, 0xe32, 0xe04, 0xe21, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf44, 0xf0b,
+0xf54, 0xf7c, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b,
+0xf56, 0xf0b, 0xf42, 0xf66, 0xf74, 0xf58, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54,
+0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xfb2,
+0xf74, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f,
+0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf62, 0xf92, 0xfb1, 0xf51, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf42,
+0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b,
+0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56,
+0xf45, 0xf74, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf44, 0xf0b, 0xf54,
+0xf7c, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf42,
+0xf66, 0xf74, 0xf58, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b,
+0xf56, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xfb2, 0xf74, 0xf42, 0xf0b, 0xf54, 0x3b, 0xf5f,
+0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf62, 0xf92, 0xfb1,
+0xf51, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf42, 0xf74, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b,
+0xf56, 0xf45, 0xf74, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b,
+0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0x3b, 0x1325, 0x122a,
+0x3b, 0x1208, 0x12ab, 0x3b, 0x1218, 0x130b, 0x3b, 0x121a, 0x12eb, 0x3b, 0x130d, 0x1295, 0x3b, 0x1230, 0x1290, 0x3b, 0x1213, 0x121d, 0x3b, 0x1290,
+0x1213, 0x3b, 0x1218, 0x1235, 0x3b, 0x1325, 0x1245, 0x3b, 0x1215, 0x12f3, 0x3b, 0x1273, 0x1215, 0x3b, 0x1325, 0x122a, 0x3b, 0x1208, 0x12ab, 0x1272,
+0x1275, 0x3b, 0x1218, 0x130b, 0x1262, 0x1275, 0x3b, 0x121a, 0x12eb, 0x12dd, 0x12eb, 0x3b, 0x130d, 0x1295, 0x1266, 0x1275, 0x3b, 0x1230, 0x1290, 0x3b,
+0x1213, 0x121d, 0x1208, 0x3b, 0x1290, 0x1213, 0x1230, 0x3b, 0x1218, 0x1235, 0x12a8, 0x1228, 0x121d, 0x3b, 0x1325, 0x1245, 0x121d, 0x1272, 0x3b, 0x1215,
+0x12f3, 0x122d, 0x3b, 0x1273, 0x1215, 0x1233, 0x1235, 0x3b, 0x1325, 0x3b, 0x1208, 0x3b, 0x1218, 0x3b, 0x121a, 0x3b, 0x130d, 0x3b, 0x1230, 0x3b,
+0x1213, 0x3b, 0x1290, 0x3b, 0x1218, 0x3b, 0x1325, 0x3b, 0x1215, 0x3b, 0x1273, 0x3b, 0x53, 0x101, 0x6e, 0x3b, 0x46, 0x113, 0x70, 0x3b,
+0x4d, 0x61, 0x2bb, 0x61, 0x3b, 0x2bb, 0x45, 0x70, 0x65, 0x3b, 0x4d, 0x113, 0x3b, 0x53, 0x75, 0x6e, 0x3b, 0x53, 0x69, 0x75,
+0x3b, 0x2bb, 0x41, 0x6f, 0x6b, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x2bb, 0x4f, 0x6b, 0x61, 0x3b, 0x4e, 0x14d, 0x76, 0x3b, 0x54,
+0x12b, 0x73, 0x3b, 0x53, 0x101, 0x6e, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x46, 0x113, 0x70, 0x75, 0x65, 0x6c, 0x69, 0x3b, 0x4d,
+0x61, 0x2bb, 0x61, 0x73, 0x69, 0x3b, 0x2bb, 0x45, 0x70, 0x65, 0x6c, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x113, 0x3b, 0x53, 0x75,
+0x6e, 0x65, 0x3b, 0x53, 0x69, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x2bb, 0x41, 0x6f, 0x6b, 0x6f, 0x73, 0x69, 0x3b, 0x53, 0x65,
+0x70, 0x69, 0x74, 0x65, 0x6d, 0x61, 0x3b, 0x2bb, 0x4f, 0x6b, 0x61, 0x74, 0x6f, 0x70, 0x61, 0x3b, 0x4e, 0x14d, 0x76, 0x65,
+0x6d, 0x61, 0x3b, 0x54, 0x12b, 0x73, 0x65, 0x6d, 0x61, 0x3b, 0x53, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b,
+0x53, 0x3b, 0x53, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4f, 0x63, 0x61, 0x3b, 0x15e, 0x75,
+0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4e, 0x69, 0x73, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x48, 0x61, 0x7a, 0x3b, 0x54, 0x65,
+0x6d, 0x3b, 0x41, 0x11f, 0x75, 0x3b, 0x45, 0x79, 0x6c, 0x3b, 0x45, 0x6b, 0x69, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x41, 0x72,
+0x61, 0x3b, 0x4f, 0x63, 0x61, 0x6b, 0x3b, 0x15e, 0x75, 0x62, 0x61, 0x74, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x3b, 0x4e, 0x69,
+0x73, 0x61, 0x6e, 0x3b, 0x4d, 0x61, 0x79, 0x131, 0x73, 0x3b, 0x48, 0x61, 0x7a, 0x69, 0x72, 0x61, 0x6e, 0x3b, 0x54, 0x65,
+0x6d, 0x6d, 0x75, 0x7a, 0x3b, 0x41, 0x11f, 0x75, 0x73, 0x74, 0x6f, 0x73, 0x3b, 0x45, 0x79, 0x6c, 0xfc, 0x6c, 0x3b, 0x45,
+0x6b, 0x69, 0x6d, 0x3b, 0x4b, 0x61, 0x73, 0x131, 0x6d, 0x3b, 0x41, 0x72, 0x61, 0x6c, 0x131, 0x6b, 0x3b, 0x4f, 0x3b, 0x15e,
+0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x45, 0x3b, 0x45, 0x3b, 0x4b, 0x3b, 0x41,
+0x3b, 0xdd, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x77, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0xfd,
+0x3b, 0x49, 0xfd, 0x75, 0x6e, 0x3b, 0x49, 0xfd, 0x75, 0x6c, 0x3b, 0x41, 0x77, 0x67, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x4f,
+0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0xfd, 0x3b, 0x44, 0x65, 0x6b, 0x3b, 0xdd, 0x61, 0x6e, 0x77, 0x61, 0x72, 0x3b, 0x46, 0x65,
+0x77, 0x72, 0x61, 0x6c, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0xfd, 0x3b,
+0x49, 0xfd, 0x75, 0x6e, 0x3b, 0x49, 0xfd, 0x75, 0x6c, 0x3b, 0x41, 0x77, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x6e,
+0x74, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x4e, 0x6f, 0xfd, 0x61, 0x62, 0x72,
+0x3b, 0x44, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0xdd, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x49, 0x3b,
+0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0xfd, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x77, 0x3b,
+0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0xfd, 0x3b, 0x69, 0xfd, 0x75, 0x6e, 0x3b, 0x69, 0xfd,
+0x75, 0x6c, 0x3b, 0x61, 0x77, 0x67, 0x3b, 0x73, 0x65, 0x6e, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0xfd, 0x3b, 0x64,
+0x65, 0x6b, 0x3b, 0xfd, 0x61, 0x6e, 0x77, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x77, 0x72, 0x61, 0x6c, 0x3b, 0x6d, 0x61, 0x72,
+0x74, 0x3b, 0x61, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x61, 0xfd, 0x3b, 0x69, 0xfd, 0x75, 0x6e, 0x3b, 0x69, 0xfd, 0x75,
+0x6c, 0x3b, 0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x6e, 0x74, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x6f, 0x6b,
+0x74, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x6e, 0x6f, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x64, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b,
+0x64a, 0x627, 0x646, 0x6cb, 0x627, 0x631, 0x3b, 0x641, 0x6d0, 0x6cb, 0x631, 0x627, 0x644, 0x3b, 0x645, 0x627, 0x631, 0x62a, 0x3b, 0x626,
+0x627, 0x67e, 0x631, 0x6d0, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x3b, 0x626, 0x649, 0x64a, 0x6c7, 0x646, 0x3b, 0x626, 0x649, 0x64a, 0x6c7,
+0x644, 0x3b, 0x626, 0x627, 0x6cb, 0x63a, 0x6c7, 0x633, 0x62a, 0x3b, 0x633, 0x6d0, 0x646, 0x62a, 0x6d5, 0x628, 0x649, 0x631, 0x3b, 0x626,
+0x6c6, 0x643, 0x62a, 0x6d5, 0x628, 0x649, 0x631, 0x3b, 0x646, 0x648, 0x64a, 0x627, 0x628, 0x649, 0x631, 0x3b, 0x62f, 0x6d0, 0x643, 0x627,
+0x628, 0x649, 0x631, 0x3b, 0x441, 0x456, 0x447, 0x3b, 0x43b, 0x44e, 0x442, 0x3b, 0x431, 0x435, 0x440, 0x3b, 0x43a, 0x432, 0x456, 0x3b,
+0x442, 0x440, 0x430, 0x3b, 0x447, 0x435, 0x440, 0x3b, 0x43b, 0x438, 0x43f, 0x3b, 0x441, 0x435, 0x440, 0x3b, 0x432, 0x435, 0x440, 0x3b,
+0x436, 0x43e, 0x432, 0x3b, 0x43b, 0x438, 0x441, 0x3b, 0x433, 0x440, 0x443, 0x3b, 0x441, 0x456, 0x447, 0x435, 0x43d, 0x44c, 0x3b, 0x43b,
+0x44e, 0x442, 0x438, 0x439, 0x3b, 0x431, 0x435, 0x440, 0x435, 0x437, 0x435, 0x43d, 0x44c, 0x3b, 0x43a, 0x432, 0x456, 0x442, 0x435, 0x43d,
+0x44c, 0x3b, 0x442, 0x440, 0x430, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x447, 0x435, 0x440, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x438,
+0x43f, 0x435, 0x43d, 0x44c, 0x3b, 0x441, 0x435, 0x440, 0x43f, 0x435, 0x43d, 0x44c, 0x3b, 0x432, 0x435, 0x440, 0x435, 0x441, 0x435, 0x43d,
+0x44c, 0x3b, 0x436, 0x43e, 0x432, 0x442, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x438, 0x441, 0x442, 0x43e, 0x43f, 0x430, 0x434, 0x3b, 0x433,
+0x440, 0x443, 0x434, 0x435, 0x43d, 0x44c, 0x3b, 0x421, 0x3b, 0x41b, 0x3b, 0x411, 0x3b, 0x41a, 0x3b, 0x422, 0x3b, 0x427, 0x3b, 0x41b,
+0x3b, 0x421, 0x3b, 0x412, 0x3b, 0x416, 0x3b, 0x41b, 0x3b, 0x413, 0x3b, 0x441, 0x456, 0x447, 0x2e, 0x3b, 0x43b, 0x44e, 0x442, 0x2e,
+0x3b, 0x431, 0x435, 0x440, 0x2e, 0x3b, 0x43a, 0x432, 0x456, 0x442, 0x2e, 0x3b, 0x442, 0x440, 0x430, 0x432, 0x2e, 0x3b, 0x447, 0x435,
+0x440, 0x432, 0x2e, 0x3b, 0x43b, 0x438, 0x43f, 0x2e, 0x3b, 0x441, 0x435, 0x440, 0x43f, 0x2e, 0x3b, 0x432, 0x435, 0x440, 0x2e, 0x3b,
+0x436, 0x43e, 0x432, 0x442, 0x2e, 0x3b, 0x43b, 0x438, 0x441, 0x442, 0x2e, 0x3b, 0x433, 0x440, 0x443, 0x434, 0x2e, 0x3b, 0x441, 0x456,
+0x447, 0x43d, 0x44f, 0x3b, 0x43b, 0x44e, 0x442, 0x43e, 0x433, 0x43e, 0x3b, 0x431, 0x435, 0x440, 0x435, 0x437, 0x43d, 0x44f, 0x3b, 0x43a,
+0x432, 0x456, 0x442, 0x43d, 0x44f, 0x3b, 0x442, 0x440, 0x430, 0x432, 0x43d, 0x44f, 0x3b, 0x447, 0x435, 0x440, 0x432, 0x43d, 0x44f, 0x3b,
+0x43b, 0x438, 0x43f, 0x43d, 0x44f, 0x3b, 0x441, 0x435, 0x440, 0x43f, 0x43d, 0x44f, 0x3b, 0x432, 0x435, 0x440, 0x435, 0x441, 0x43d, 0x44f,
+0x3b, 0x436, 0x43e, 0x432, 0x442, 0x43d, 0x44f, 0x3b, 0x43b, 0x438, 0x441, 0x442, 0x43e, 0x43f, 0x430, 0x434, 0x430, 0x3b, 0x433, 0x440,
+0x443, 0x434, 0x43d, 0x44f, 0x3b, 0x441, 0x3b, 0x43b, 0x3b, 0x431, 0x3b, 0x43a, 0x3b, 0x442, 0x3b, 0x447, 0x3b, 0x43b, 0x3b, 0x441,
+0x3b, 0x432, 0x3b, 0x436, 0x3b, 0x43b, 0x3b, 0x433, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x6cc, 0x3b, 0x641, 0x631, 0x648, 0x631, 0x6cc,
+0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x626, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b,
+0x62c, 0x648, 0x644, 0x627, 0x626, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9,
+0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x59, 0x61, 0x6e,
+0x3b, 0x46, 0x65, 0x76, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x49, 0x79, 0x6e,
+0x3b, 0x49, 0x79, 0x6c, 0x3b, 0x41, 0x76, 0x67, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x79,
+0x3b, 0x44, 0x65, 0x6b, 0x3b, 0x59, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x76, 0x72, 0x61, 0x6c, 0x3b, 0x4d,
+0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x49, 0x79, 0x75, 0x6e, 0x3b, 0x49,
+0x79, 0x75, 0x6c, 0x3b, 0x41, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x6e, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x4f,
+0x6b, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x4e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x44, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b,
+0x59, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b,
+0x4e, 0x3b, 0x44, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x76, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b,
+0x6d, 0x61, 0x79, 0x3b, 0x69, 0x79, 0x6e, 0x3b, 0x69, 0x79, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x3b, 0x73, 0x65, 0x6e, 0x3b,
+0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x79, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x79, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x66,
+0x65, 0x76, 0x72, 0x61, 0x6c, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x61, 0x79,
+0x3b, 0x69, 0x79, 0x75, 0x6e, 0x3b, 0x69, 0x79, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65,
+0x6e, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x6e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b,
+0x64, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0x62c, 0x646, 0x648, 0x3b, 0x641, 0x628, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x3b, 0x627,
+0x67e, 0x631, 0x3b, 0x645, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x3b, 0x627, 0x6af, 0x633, 0x3b, 0x633, 0x67e,
+0x62a, 0x3b, 0x627, 0x6a9, 0x62a, 0x3b, 0x646, 0x648, 0x645, 0x3b, 0x62f, 0x633, 0x645, 0x3b, 0x44f, 0x43d, 0x432, 0x3b, 0x444, 0x435,
+0x432, 0x3b, 0x43c, 0x430, 0x440, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x3b, 0x438, 0x44e,
+0x43b, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435, 0x43d, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x44f, 0x3b, 0x434, 0x435,
+0x43a, 0x3b, 0x44f, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b,
+0x430, 0x43f, 0x440, 0x435, 0x43b, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x3b, 0x438, 0x44e, 0x43b, 0x3b, 0x430, 0x432,
+0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x3b,
+0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x3b, 0x54,
+0x68, 0x67, 0x20, 0x32, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x33, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x34, 0x3b, 0x54, 0x68, 0x67,
+0x20, 0x35, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x36, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x37, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x38,
+0x3b, 0x54, 0x68, 0x67, 0x20, 0x39, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x30, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x31,
+0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x32, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x3b, 0x54, 0x68, 0xe1, 0x6e,
+0x67, 0x20, 0x32, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x33, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x34, 0x3b,
+0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x35, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x36, 0x3b, 0x54, 0x68, 0xe1, 0x6e,
+0x67, 0x20, 0x37, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x38, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x39, 0x3b,
+0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x30, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x54, 0x68,
+0xe1, 0x6e, 0x67, 0x20, 0x31, 0x32, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x31, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x32, 0x3b, 0x74,
+0x68, 0x67, 0x20, 0x33, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x34, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x35, 0x3b, 0x74, 0x68, 0x67,
+0x20, 0x36, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x37, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x38, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x39,
+0x3b, 0x74, 0x68, 0x67, 0x20, 0x31, 0x30, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x31,
+0x32, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x32, 0x3b, 0x74, 0x68,
+0xe1, 0x6e, 0x67, 0x20, 0x33, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x34, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20,
+0x35, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x36, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x37, 0x3b, 0x74, 0x68,
+0xe1, 0x6e, 0x67, 0x20, 0x38, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x39, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20,
+0x31, 0x30, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x32,
+0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0xe4, 0x7a, 0x3b, 0x70, 0x72, 0x6c, 0x3b, 0x6d, 0x61, 0x79,
+0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79, 0x75, 0x6c, 0x3b, 0x67, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x3b, 0x74, 0x6f, 0x62,
+0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x79, 0x61, 0x6e, 0x75, 0x6c, 0x3b, 0x66, 0x65, 0x62, 0x75, 0x6c,
+0x3b, 0x6d, 0xe4, 0x7a, 0x75, 0x6c, 0x3b, 0x70, 0x72, 0x69, 0x6c, 0x75, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x75, 0x6c, 0x3b,
+0x79, 0x75, 0x6e, 0x75, 0x6c, 0x3b, 0x79, 0x75, 0x6c, 0x75, 0x6c, 0x3b, 0x67, 0x75, 0x73, 0x74, 0x75, 0x6c, 0x3b, 0x73,
+0x65, 0x74, 0x75, 0x6c, 0x3b, 0x74, 0x6f, 0x62, 0x75, 0x6c, 0x3b, 0x6e, 0x6f, 0x76, 0x75, 0x6c, 0x3b, 0x64, 0x65, 0x6b,
+0x75, 0x6c, 0x3b, 0x59, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x47, 0x3b, 0x53,
+0x3b, 0x54, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0xe4, 0x7a, 0x3b, 0x70,
+0x72, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79, 0x75, 0x6c, 0x3b, 0x67, 0x73, 0x74, 0x3b, 0x73,
+0x65, 0x74, 0x3b, 0x74, 0x6f, 0x6e, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x49, 0x6f, 0x6e, 0x3b, 0x43,
+0x68, 0x77, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x45, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4d, 0x65, 0x68, 0x3b, 0x47,
+0x6f, 0x72, 0x3b, 0x41, 0x77, 0x73, 0x74, 0x3b, 0x4d, 0x65, 0x64, 0x69, 0x3b, 0x48, 0x79, 0x64, 0x3b, 0x54, 0x61, 0x63,
+0x68, 0x3b, 0x52, 0x68, 0x61, 0x67, 0x3b, 0x49, 0x6f, 0x6e, 0x61, 0x77, 0x72, 0x3b, 0x43, 0x68, 0x77, 0x65, 0x66, 0x72,
+0x6f, 0x72, 0x3b, 0x4d, 0x61, 0x77, 0x72, 0x74, 0x68, 0x3b, 0x45, 0x62, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x4d, 0x61, 0x69,
+0x3b, 0x4d, 0x65, 0x68, 0x65, 0x66, 0x69, 0x6e, 0x3b, 0x47, 0x6f, 0x72, 0x66, 0x66, 0x65, 0x6e, 0x6e, 0x61, 0x66, 0x3b,
+0x41, 0x77, 0x73, 0x74, 0x3b, 0x4d, 0x65, 0x64, 0x69, 0x3b, 0x48, 0x79, 0x64, 0x72, 0x65, 0x66, 0x3b, 0x54, 0x61, 0x63,
+0x68, 0x77, 0x65, 0x64, 0x64, 0x3b, 0x52, 0x68, 0x61, 0x67, 0x66, 0x79, 0x72, 0x3b, 0x49, 0x3b, 0x43, 0x68, 0x3b, 0x4d,
+0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x52, 0x68, 0x3b,
+0x49, 0x6f, 0x6e, 0x3b, 0x43, 0x68, 0x77, 0x65, 0x66, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x45, 0x62, 0x72, 0x3b, 0x4d, 0x61,
+0x69, 0x3b, 0x4d, 0x65, 0x68, 0x3b, 0x47, 0x6f, 0x72, 0x66, 0x66, 0x3b, 0x41, 0x77, 0x73, 0x74, 0x3b, 0x4d, 0x65, 0x64,
+0x69, 0x3b, 0x48, 0x79, 0x64, 0x3b, 0x54, 0x61, 0x63, 0x68, 0x3b, 0x52, 0x68, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x3b,
+0x46, 0x65, 0x77, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x77, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x53, 0x75, 0x77, 0x3b,
+0x53, 0x75, 0x6c, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0xe0, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x77, 0x3b, 0x44,
+0x65, 0x73, 0x3b, 0x53, 0x61, 0x6d, 0x77, 0x69, 0x79, 0x65, 0x65, 0x3b, 0x46, 0x65, 0x77, 0x72, 0x69, 0x79, 0x65, 0x65,
+0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x41, 0x77, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x53, 0x75, 0x77, 0x65,
+0x3b, 0x53, 0x75, 0x6c, 0x65, 0x74, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0xe0, 0x74, 0x74, 0x75, 0x6d, 0x62, 0x61, 0x72, 0x3b,
+0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x77, 0xe0, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x44, 0x65,
+0x73, 0xe0, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x74, 0x3b, 0x45,
+0x70, 0x72, 0x3b, 0x4d, 0x65, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x61, 0x3b, 0x53,
+0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x79, 0x75,
+0x77, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x77, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x74, 0x73, 0x68,
+0x69, 0x3b, 0x45, 0x70, 0x72, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a,
+0x75, 0x6c, 0x61, 0x79, 0x69, 0x3b, 0x41, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62,
+0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x68, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69,
+0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x5d9, 0x5d0, 0x5b7, 0x5e0, 0x3b, 0x5e4, 0x5bf, 0x5e2, 0x5d1, 0x3b, 0x5de, 0x5e2, 0x5e8, 0x5e5,
+0x3b, 0x5d0, 0x5b7, 0x5e4, 0x5bc, 0x5e8, 0x3b, 0x5de, 0x5d9, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9,
+0x3b, 0x5d0, 0x5d5, 0x5d9, 0x5d2, 0x3b, 0x5e1, 0x5e2, 0x5e4, 0x5bc, 0x3b, 0x5d0, 0x5e7, 0x5d8, 0x3b, 0x5e0, 0x5d0, 0x5d5, 0x5d5, 0x3b,
+0x5d3, 0x5e2, 0x5e6, 0x3b, 0x5d9, 0x5d0, 0x5b7, 0x5e0, 0x5d5, 0x5d0, 0x5b7, 0x5e8, 0x3b, 0x5e4, 0x5bf, 0x5e2, 0x5d1, 0x5e8, 0x5d5, 0x5d0,
+0x5b7, 0x5e8, 0x3b, 0x5de, 0x5e2, 0x5e8, 0x5e5, 0x3b, 0x5d0, 0x5b7, 0x5e4, 0x5bc, 0x5e8, 0x5d9, 0x5dc, 0x3b, 0x5de, 0x5d9, 0x5d9, 0x3b,
+0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9, 0x3b, 0x5d0, 0x5d5, 0x5d9, 0x5d2, 0x5d5, 0x5e1, 0x5d8, 0x3b, 0x5e1, 0x5e2,
+0x5e4, 0x5bc, 0x5d8, 0x5e2, 0x5de, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x5d0, 0x5e7, 0x5d8, 0x5d0, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x5e0, 0x5d0, 0x5d5,
+0x5d5, 0x5e2, 0x5de, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x5d3, 0x5e2, 0x5e6, 0x5e2, 0x5de, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x1e62, 0x1eb9, 0x301, 0x3b,
+0xc8, 0x72, 0x3b, 0x1eb8, 0x72, 0x3b, 0xcc, 0x67, 0x3b, 0x1eb8, 0x300, 0x62, 0x3b, 0xd2, 0x6b, 0x3b, 0x41, 0x67, 0x3b, 0xd2,
+0x67, 0x3b, 0x4f, 0x77, 0x3b, 0x1ecc, 0x300, 0x77, 0x3b, 0x42, 0xe9, 0x3b, 0x1ecc, 0x300, 0x70, 0x3b, 0x1e62, 0x1eb9, 0x301, 0x72,
+0x1eb9, 0x301, 0x3b, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x1eb8, 0x72, 0x1eb9, 0x300, 0x6e, 0xe0, 0x3b, 0xcc, 0x67, 0x62, 0xe9,
+0x3b, 0x1eb8, 0x300, 0x62, 0x69, 0x62, 0x69, 0x3b, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x41, 0x67, 0x1eb9, 0x6d, 0x1ecd, 0x3b,
+0xd2, 0x67, 0xfa, 0x6e, 0x3b, 0x4f, 0x77, 0x65, 0x77, 0x65, 0x3b, 0x1ecc, 0x300, 0x77, 0xe0, 0x72, 0xe0, 0x3b, 0x42, 0xe9,
+0x6c, 0xfa, 0x3b, 0x1ecc, 0x300, 0x70, 0x1eb9, 0x300, 0x3b, 0x53, 0x3b, 0xc8, 0x3b, 0x1eb8, 0x3b, 0xcc, 0x3b, 0x1eb8, 0x300, 0x3b,
+0xd2, 0x3b, 0x41, 0x3b, 0xd2, 0x3b, 0x4f, 0x3b, 0x1ecc, 0x300, 0x3b, 0x42, 0x3b, 0x1ecc, 0x300, 0x3b, 0x1e62, 0x1eb9, 0x301, 0x72,
+0x3b, 0xc8, 0x72, 0xe8, 0x6c, 0x3b, 0x1eb8, 0x72, 0x1eb9, 0x300, 0x6e, 0x3b, 0xcc, 0x67, 0x62, 0x3b, 0x1eb8, 0x300, 0x62, 0x69,
+0x3b, 0xd2, 0x6b, 0xfa, 0x3b, 0x41, 0x67, 0x1eb9, 0x3b, 0xd2, 0x67, 0xfa, 0x3b, 0x4f, 0x77, 0x65, 0x3b, 0x1ecc, 0x300, 0x77,
+0xe0, 0x3b, 0x42, 0xe9, 0x6c, 0x3b, 0x1ecc, 0x300, 0x70, 0x1eb9, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1e62, 0x1eb9, 0x301, 0x72, 0x1eb9,
+0x301, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1eb8, 0x72, 0x1eb9, 0x300,
+0x6e, 0xe0, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xcc, 0x67, 0x62, 0xe9, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1eb8, 0x300, 0x62, 0x69,
+0x62, 0x69, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x41, 0x67, 0x1eb9,
+0x6d, 0x1ecd, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xd2, 0x67, 0xfa, 0x6e, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x4f, 0x77, 0x65, 0x77,
+0x65, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1ecc, 0x300, 0x77, 0xe0, 0x72, 0xe0, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x42, 0xe9, 0x6c,
+0xfa, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1ecc, 0x300, 0x70, 0x1eb9, 0x300, 0x3b, 0x53, 0x68, 0x25b, 0x301, 0x3b, 0xc8, 0x72, 0x3b,
+0x190, 0x72, 0x3b, 0xcc, 0x67, 0x3b, 0x190, 0x300, 0x62, 0x3b, 0xd2, 0x6b, 0x3b, 0x41, 0x67, 0x3b, 0xd2, 0x67, 0x3b, 0x4f,
+0x77, 0x3b, 0x186, 0x300, 0x77, 0x3b, 0x42, 0xe9, 0x3b, 0x186, 0x300, 0x70, 0x3b, 0x53, 0x68, 0x25b, 0x301, 0x72, 0x25b, 0x301,
+0x3b, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x190, 0x72, 0x25b, 0x300, 0x6e, 0xe0, 0x3b, 0xcc, 0x67, 0x62, 0xe9, 0x3b, 0x190,
+0x300, 0x62, 0x69, 0x62, 0x69, 0x3b, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x41, 0x67, 0x25b, 0x6d, 0x254, 0x3b, 0xd2, 0x67,
+0xfa, 0x6e, 0x3b, 0x4f, 0x77, 0x65, 0x77, 0x65, 0x3b, 0x186, 0x300, 0x77, 0xe0, 0x72, 0xe0, 0x3b, 0x42, 0xe9, 0x6c, 0xfa,
+0x3b, 0x186, 0x300, 0x70, 0x25b, 0x300, 0x3b, 0x53, 0x3b, 0xc8, 0x3b, 0x190, 0x3b, 0xcc, 0x3b, 0x190, 0x300, 0x3b, 0xd2, 0x3b,
+0x41, 0x3b, 0xd2, 0x3b, 0x4f, 0x3b, 0x186, 0x300, 0x3b, 0x42, 0x3b, 0x186, 0x300, 0x3b, 0x53, 0x68, 0x25b, 0x301, 0x72, 0x3b,
+0xc8, 0x72, 0xe8, 0x6c, 0x3b, 0x190, 0x72, 0x25b, 0x300, 0x6e, 0x3b, 0xcc, 0x67, 0x62, 0x3b, 0x190, 0x300, 0x62, 0x69, 0x3b,
+0xd2, 0x6b, 0xfa, 0x3b, 0x41, 0x67, 0x25b, 0x3b, 0xd2, 0x67, 0xfa, 0x3b, 0x4f, 0x77, 0x65, 0x3b, 0x186, 0x300, 0x77, 0xe0,
+0x3b, 0x42, 0xe9, 0x6c, 0x3b, 0x186, 0x300, 0x70, 0x25b, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x53, 0x68, 0x25b, 0x301, 0x72,
+0x25b, 0x301, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x190,
+0x72, 0x25b, 0x300, 0x6e, 0xe0, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xcc, 0x67, 0x62, 0xe9, 0x3b, 0x4f, 0x73, 0x68, 0xf9,
+0x20, 0x190, 0x300, 0x62, 0x69, 0x62, 0x69, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x4f,
+0x73, 0x68, 0xf9, 0x20, 0x41, 0x67, 0x25b, 0x6d, 0x254, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xd2, 0x67, 0xfa, 0x6e, 0x3b,
+0x4f, 0x73, 0x68, 0xf9, 0x20, 0x4f, 0x77, 0x65, 0x77, 0x65, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x186, 0x300, 0x77, 0xe0,
+0x72, 0xe0, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x42, 0xe9, 0x6c, 0xfa, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x186, 0x300,
+0x70, 0x25b, 0x300, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x73, 0x3b, 0x45, 0x70, 0x68, 0x3b,
+0x4d, 0x65, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x61, 0x3b, 0x53, 0x65, 0x70, 0x3b,
+0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x77, 0x61, 0x72, 0x69,
+0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x77, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x73, 0x68, 0x69, 0x3b, 0x45, 0x70, 0x68,
+0x72, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x79,
+0x69, 0x3b, 0x41, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x68, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f,
+0x6b, 0x74, 0x68, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d,
+0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53,
+0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72,
+0x73, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69,
+0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e,
+0x3b, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70,
+0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65,
+0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72,
+0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b,
+0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74,
+0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x6e,
+0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x458, 0x430, 0x43d,
+0x3b, 0x444, 0x435, 0x431, 0x3b, 0x43c, 0x430, 0x440, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d,
+0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x443, 0x433, 0x3b, 0x441, 0x435, 0x43f, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x432,
+0x3b, 0x434, 0x435, 0x446, 0x3b, 0x458, 0x430, 0x43d, 0x443, 0x430, 0x440, 0x3b, 0x444, 0x435, 0x431, 0x440, 0x443, 0x430, 0x440, 0x3b,
+0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x438, 0x43b, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x438, 0x3b,
+0x458, 0x443, 0x43b, 0x438, 0x3b, 0x430, 0x443, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x43c, 0x431, 0x430,
+0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x431, 0x430, 0x440, 0x3b, 0x43d, 0x43e, 0x432, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x434,
+0x435, 0x446, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x4a, 0x2d, 0x67, 0x75, 0x65, 0x72, 0x3b, 0x54, 0x2d, 0x61, 0x72, 0x72,
+0x65, 0x65, 0x3b, 0x4d, 0x61, 0x79, 0x72, 0x6e, 0x74, 0x3b, 0x41, 0x76, 0x72, 0x72, 0x69, 0x6c, 0x3b, 0x42, 0x6f, 0x61,
+0x6c, 0x64, 0x79, 0x6e, 0x3b, 0x4d, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x65, 0x65, 0x3b, 0x4a, 0x2d, 0x73, 0x6f, 0x75, 0x72,
+0x65, 0x65, 0x3b, 0x4c, 0x75, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x79, 0x6e, 0x3b, 0x4d, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69,
+0x72, 0x3b, 0x4a, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69, 0x72, 0x3b, 0x4d, 0x2d, 0x48, 0x6f, 0x75, 0x6e, 0x65, 0x79, 0x3b,
+0x4d, 0x2d, 0x4e, 0x6f, 0x6c, 0x6c, 0x69, 0x63, 0x6b, 0x3b, 0x4a, 0x65, 0x72, 0x72, 0x65, 0x79, 0x2d, 0x67, 0x65, 0x75,
+0x72, 0x65, 0x65, 0x3b, 0x54, 0x6f, 0x73, 0x68, 0x69, 0x61, 0x67, 0x68, 0x74, 0x2d, 0x61, 0x72, 0x72, 0x65, 0x65, 0x3b,
+0x4d, 0x61, 0x79, 0x72, 0x6e, 0x74, 0x3b, 0x41, 0x76, 0x65, 0x72, 0x69, 0x6c, 0x3b, 0x42, 0x6f, 0x61, 0x6c, 0x64, 0x79,
+0x6e, 0x3b, 0x4d, 0x65, 0x61, 0x6e, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x65, 0x65, 0x3b, 0x4a, 0x65, 0x72, 0x72, 0x65, 0x79,
+0x2d, 0x73, 0x6f, 0x75, 0x72, 0x65, 0x65, 0x3b, 0x4c, 0x75, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x79, 0x6e, 0x3b, 0x4d, 0x65,
+0x61, 0x6e, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69, 0x72, 0x3b, 0x4a, 0x65, 0x72, 0x72, 0x65, 0x79, 0x2d, 0x66, 0x6f, 0x75,
+0x79, 0x69, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x20, 0x48, 0x6f, 0x75, 0x6e, 0x65, 0x79, 0x3b, 0x4d, 0x65, 0x65, 0x20, 0x6e,
+0x79, 0x20, 0x4e, 0x6f, 0x6c, 0x6c, 0x69, 0x63, 0x6b, 0x3b, 0x47, 0x65, 0x6e, 0x3b, 0x48, 0x77, 0x65, 0x3b, 0x4d, 0x65,
+0x75, 0x3b, 0x45, 0x62, 0x72, 0x3b, 0x4d, 0x65, 0x3b, 0x4d, 0x65, 0x74, 0x3b, 0x47, 0x6f, 0x72, 0x3b, 0x45, 0x73, 0x74,
+0x3b, 0x47, 0x77, 0x6e, 0x3b, 0x48, 0x65, 0x64, 0x3b, 0x44, 0x75, 0x3b, 0x4b, 0x65, 0x76, 0x3b, 0x6d, 0x69, 0x73, 0x20,
+0x47, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x48, 0x77, 0x65, 0x76, 0x72, 0x65, 0x72, 0x3b, 0x6d,
+0x69, 0x73, 0x20, 0x4d, 0x65, 0x75, 0x72, 0x74, 0x68, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x45, 0x62, 0x72, 0x65, 0x6c, 0x3b,
+0x6d, 0x69, 0x73, 0x20, 0x4d, 0x65, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x65, 0x76, 0x65, 0x6e, 0x3b,
+0x6d, 0x69, 0x73, 0x20, 0x47, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x72, 0x65, 0x6e, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x45, 0x73,
+0x74, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x47, 0x77, 0x79, 0x6e, 0x6e, 0x67, 0x61, 0x6c, 0x61, 0x3b, 0x6d, 0x69, 0x73, 0x20,
+0x48, 0x65, 0x64, 0x72, 0x61, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x44, 0x75, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x4b, 0x65, 0x76,
+0x61, 0x72, 0x64, 0x68, 0x75, 0x3b, 0x53, 0x2d, 0x186, 0x3b, 0x4b, 0x2d, 0x186, 0x3b, 0x45, 0x2d, 0x186, 0x3b, 0x45, 0x2d,
+0x4f, 0x3b, 0x45, 0x2d, 0x4b, 0x3b, 0x4f, 0x2d, 0x41, 0x3b, 0x41, 0x2d, 0x4b, 0x3b, 0x44, 0x2d, 0x186, 0x3b, 0x46, 0x2d,
+0x190, 0x3b, 0x186, 0x2d, 0x41, 0x3b, 0x186, 0x2d, 0x4f, 0x3b, 0x4d, 0x2d, 0x186, 0x3b, 0x53, 0x61, 0x6e, 0x64, 0x61, 0x2d,
+0x186, 0x70, 0x25b, 0x70, 0x254, 0x6e, 0x3b, 0x4b, 0x77, 0x61, 0x6b, 0x77, 0x61, 0x72, 0x2d, 0x186, 0x67, 0x79, 0x65, 0x66,
+0x75, 0x6f, 0x3b, 0x45, 0x62, 0x254, 0x77, 0x2d, 0x186, 0x62, 0x65, 0x6e, 0x65, 0x6d, 0x3b, 0x45, 0x62, 0x254, 0x62, 0x69,
+0x72, 0x61, 0x2d, 0x4f, 0x66, 0x6f, 0x72, 0x69, 0x73, 0x75, 0x6f, 0x3b, 0x45, 0x73, 0x75, 0x73, 0x6f, 0x77, 0x20, 0x41,
+0x6b, 0x65, 0x74, 0x73, 0x65, 0x61, 0x62, 0x61, 0x2d, 0x4b, 0x254, 0x74, 0x254, 0x6e, 0x69, 0x6d, 0x62, 0x61, 0x3b, 0x4f,
+0x62, 0x69, 0x72, 0x61, 0x64, 0x65, 0x2d, 0x41, 0x79, 0x25b, 0x77, 0x6f, 0x68, 0x6f, 0x6d, 0x75, 0x6d, 0x75, 0x3b, 0x41,
+0x79, 0x25b, 0x77, 0x6f, 0x68, 0x6f, 0x2d, 0x4b, 0x69, 0x74, 0x61, 0x77, 0x6f, 0x6e, 0x73, 0x61, 0x3b, 0x44, 0x69, 0x66,
+0x75, 0x75, 0x2d, 0x186, 0x73, 0x61, 0x6e, 0x64, 0x61, 0x61, 0x3b, 0x46, 0x61, 0x6e, 0x6b, 0x77, 0x61, 0x2d, 0x190, 0x62,
+0x254, 0x3b, 0x186, 0x62, 0x25b, 0x73, 0x25b, 0x2d, 0x41, 0x68, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x3b, 0x186, 0x62, 0x65, 0x72,
+0x25b, 0x66, 0x25b, 0x77, 0x2d, 0x4f, 0x62, 0x75, 0x62, 0x75, 0x6f, 0x3b, 0x4d, 0x75, 0x6d, 0x75, 0x2d, 0x186, 0x70, 0x25b,
+0x6e, 0x69, 0x6d, 0x62, 0x61, 0x3b, 0x91c, 0x93e, 0x928, 0x947, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930,
+0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x90f, 0x92a, 0x94d, 0x930, 0x93f, 0x932, 0x3b, 0x92e,
+0x947, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x93e, 0x92f, 0x3b, 0x906, 0x917, 0x94b, 0x938, 0x94d, 0x924, 0x3b, 0x938,
+0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x911, 0x915, 0x94d, 0x91f, 0x94b, 0x92c, 0x930, 0x3b, 0x928, 0x94b, 0x935, 0x94d,
+0x939, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x4a, 0x65, 0x6e, 0x3b, 0x46, 0x65,
+0x62, 0x3b, 0x4d, 0x61, 0x61, 0x3b, 0x45, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x75, 0x3b, 0x4a, 0x75,
+0x6c, 0x3b, 0x1ecc, 0x67, 0x1ecd, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x1ecc, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69,
+0x73, 0x3b, 0x4a, 0x65, 0x6e, 0x1ee5, 0x77, 0x61, 0x72, 0x1ecb, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x1ee5, 0x77, 0x61, 0x72, 0x1ecb,
+0x3b, 0x4d, 0x61, 0x61, 0x63, 0x68, 0x1ecb, 0x3b, 0x45, 0x70, 0x72, 0x65, 0x65, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a,
+0x75, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x1ecb, 0x3b, 0x1ecc, 0x67, 0x1ecd, 0x1ecd, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70,
+0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x1ecc, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61,
+0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4a,
+0x3b, 0x4a, 0x3b, 0x1ecc, 0x3b, 0x53, 0x3b, 0x1ecc, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4d, 0x62, 0x65, 0x3b, 0x4b, 0x65, 0x6c,
+0x3b, 0x4b, 0x74, 0x169, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x4b, 0x74, 0x6e, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x4d, 0x6f, 0x6f,
+0x3b, 0x4e, 0x79, 0x61, 0x3b, 0x4b, 0x6e, 0x64, 0x3b, 0x128, 0x6b, 0x75, 0x3b, 0x128, 0x6b, 0x6d, 0x3b, 0x128, 0x6b, 0x6c,
+0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x62, 0x65, 0x65, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77,
+0x61, 0x20, 0x6b, 0x65, 0x6c, 0x129, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x74,
+0x169, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20,
+0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x74, 0x68,
+0x61, 0x6e, 0x74, 0x68, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x75, 0x6f, 0x6e,
+0x7a, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6e, 0x79, 0x61, 0x61, 0x6e, 0x79, 0x61, 0x3b, 0x4d,
+0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61,
+0x20, 0x129, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x129, 0x6b, 0x75, 0x6d, 0x69,
+0x20, 0x6e, 0x61, 0x20, 0x129, 0x6d, 0x77, 0x65, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x129, 0x6b, 0x75,
+0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x69, 0x6c, 0x129, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b,
+0x54, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4b, 0x3b, 0x128, 0x3b, 0x128, 0x3b, 0x128, 0x3b, 0x5a, 0x65, 0x6e, 0x3b, 0x46, 0x65,
+0x76, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x76, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x67, 0x3b, 0x4c, 0x75,
+0x69, 0x3b, 0x41, 0x76, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x74, 0x75, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69,
+0x63, 0x3b, 0x5a, 0x65, 0x6e, 0xe2, 0x72, 0x3b, 0x46, 0x65, 0x76, 0x72, 0xe2, 0x72, 0x3b, 0x4d, 0x61, 0x72, 0xe7, 0x3b,
+0x41, 0x76, 0x72, 0xee, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x67, 0x6e, 0x3b, 0x4c, 0x75, 0x69, 0x3b, 0x41,
+0x76, 0x6f, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4f, 0x74, 0x75, 0x62, 0x61, 0x72,
+0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x44, 0x69, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x5a,
+0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4c, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e,
+0x3b, 0x44, 0x3b, 0x64, 0x7a, 0x76, 0x3b, 0x64, 0x7a, 0x64, 0x3b, 0x74, 0x65, 0x64, 0x3b, 0x61, 0x66, 0x254, 0x3b, 0x64,
+0x61, 0x6d, 0x3b, 0x6d, 0x61, 0x73, 0x3b, 0x73, 0x69, 0x61, 0x3b, 0x64, 0x65, 0x61, 0x3b, 0x61, 0x6e, 0x79, 0x3b, 0x6b,
+0x65, 0x6c, 0x3b, 0x61, 0x64, 0x65, 0x3b, 0x64, 0x7a, 0x6d, 0x3b, 0x64, 0x7a, 0x6f, 0x76, 0x65, 0x3b, 0x64, 0x7a, 0x6f,
+0x64, 0x7a, 0x65, 0x3b, 0x74, 0x65, 0x64, 0x6f, 0x78, 0x65, 0x3b, 0x61, 0x66, 0x254, 0x66, 0x129, 0x65, 0x3b, 0x64, 0x61,
+0x6d, 0x61, 0x3b, 0x6d, 0x61, 0x73, 0x61, 0x3b, 0x73, 0x69, 0x61, 0x6d, 0x6c, 0x254, 0x6d, 0x3b, 0x64, 0x65, 0x61, 0x73,
+0x69, 0x61, 0x6d, 0x69, 0x6d, 0x65, 0x3b, 0x61, 0x6e, 0x79, 0x254, 0x6e, 0x79, 0x254, 0x3b, 0x6b, 0x65, 0x6c, 0x65, 0x3b,
+0x61, 0x64, 0x65, 0x25b, 0x6d, 0x65, 0x6b, 0x70, 0x254, 0x78, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x6d, 0x65, 0x3b, 0x64, 0x3b,
+0x64, 0x3b, 0x74, 0x3b, 0x61, 0x3b, 0x64, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x64, 0x3b, 0x61, 0x3b, 0x6b, 0x3b, 0x61, 0x3b,
+0x64, 0x3b, 0x49, 0x61, 0x6e, 0x2e, 0x3b, 0x50, 0x65, 0x70, 0x2e, 0x3b, 0x4d, 0x61, 0x6c, 0x2e, 0x3b, 0x2bb, 0x41, 0x70,
+0x2e, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x49, 0x75, 0x6e, 0x2e, 0x3b, 0x49, 0x75, 0x6c, 0x2e, 0x3b, 0x2bb, 0x41, 0x75, 0x2e,
+0x3b, 0x4b, 0x65, 0x70, 0x2e, 0x3b, 0x2bb, 0x4f, 0x6b, 0x2e, 0x3b, 0x4e, 0x6f, 0x77, 0x2e, 0x3b, 0x4b, 0x65, 0x6b, 0x2e,
+0x3b, 0x49, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x50, 0x65, 0x70, 0x65, 0x6c, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x4d,
+0x61, 0x6c, 0x61, 0x6b, 0x69, 0x3b, 0x2bb, 0x41, 0x70, 0x65, 0x6c, 0x69, 0x6c, 0x61, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x49,
+0x75, 0x6e, 0x65, 0x3b, 0x49, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x2bb, 0x41, 0x75, 0x6b, 0x61, 0x6b, 0x65, 0x3b, 0x4b, 0x65,
+0x70, 0x61, 0x6b, 0x65, 0x6d, 0x61, 0x70, 0x61, 0x3b, 0x2bb, 0x4f, 0x6b, 0x61, 0x6b, 0x6f, 0x70, 0x61, 0x3b, 0x4e, 0x6f,
+0x77, 0x65, 0x6d, 0x61, 0x70, 0x61, 0x3b, 0x4b, 0x65, 0x6b, 0x65, 0x6d, 0x61, 0x70, 0x61, 0x3b, 0x45, 0x6e, 0x65, 0x3b,
+0x50, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x48, 0x75, 0x6e, 0x3b,
+0x48, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x62, 0x3b,
+0x44, 0x69, 0x73, 0x3b, 0x45, 0x6e, 0x65, 0x72, 0x6f, 0x3b, 0x50, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x4d, 0x61,
+0x72, 0x73, 0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x6f, 0x3b, 0x48, 0x75, 0x6e, 0x79, 0x6f,
+0x3b, 0x48, 0x75, 0x6c, 0x79, 0x6f, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x79, 0x65, 0x6d,
+0x62, 0x72, 0x65, 0x3b, 0x4f, 0x6b, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x4e, 0x6f, 0x62, 0x79, 0x65, 0x6d, 0x62, 0x72,
+0x65, 0x3b, 0x44, 0x69, 0x73, 0x79, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x45, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x41, 0x3b,
+0x4d, 0x3b, 0x48, 0x75, 0x6e, 0x3b, 0x48, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x6b,
+0x74, 0x3b, 0x4e, 0x6f, 0x62, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62,
+0x72, 0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b,
+0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x63, 0x68, 0x74, 0x3b, 0x53,
+0x65, 0x70, 0x74, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f,
+0x76, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0xa2cd, 0xa1aa, 0x3b, 0xa44d,
+0xa1aa, 0x3b, 0xa315, 0xa1aa, 0x3b, 0xa1d6, 0xa1aa, 0x3b, 0xa26c, 0xa1aa, 0x3b, 0xa0d8, 0xa1aa, 0x3b, 0xa3c3, 0xa1aa, 0x3b, 0xa246, 0xa1aa, 0x3b,
+0xa22c, 0xa1aa, 0x3b, 0xa2b0, 0xa1aa, 0x3b, 0xa2b0, 0xa2aa, 0xa1aa, 0x3b, 0xa2b0, 0xa44b, 0xa1aa, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46,
+0x65, 0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75,
+0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b,
+0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x61, 0x72,
+0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c,
+0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73,
+0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x76, 0x65, 0x72, 0x3b,
+0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x111,
+0x111, 0x6a, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x3b, 0x6e, 0x6a, 0x75, 0x6b, 0x3b, 0x63, 0x75, 0x6f, 0x3b, 0x6d, 0x69, 0x65,
+0x73, 0x3b, 0x67, 0x65, 0x61, 0x73, 0x3b, 0x73, 0x75, 0x6f, 0x69, 0x3b, 0x62, 0x6f, 0x72, 0x67, 0x3b, 0x10d, 0x61, 0x6b,
+0x10d, 0x3b, 0x67, 0x6f, 0x6c, 0x67, 0x3b, 0x73, 0x6b, 0xe1, 0x62, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x3b, 0x6f, 0x111, 0x111,
+0x61, 0x6a, 0x61, 0x67, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x76, 0x61, 0x6d, 0xe1, 0x6e,
+0x6e, 0x75, 0x3b, 0x6e, 0x6a, 0x75, 0x6b, 0x10d, 0x61, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x63, 0x75, 0x6f, 0x14b, 0x6f,
+0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x6d, 0x69, 0x65, 0x73, 0x73, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x67, 0x65,
+0x61, 0x73, 0x73, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x73, 0x75, 0x6f, 0x69, 0x64, 0x6e, 0x65, 0x6d, 0xe1, 0x6e,
+0x6e, 0x75, 0x3b, 0x62, 0x6f, 0x72, 0x67, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x10d, 0x61, 0x6b, 0x10d, 0x61, 0x6d,
+0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x67, 0x6f, 0x6c, 0x67, 0x67, 0x6f, 0x74, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x73, 0x6b,
+0xe1, 0x62, 0x6d, 0x61, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x6c, 0x61, 0x6d, 0xe1, 0x6e, 0x6e,
+0x75, 0x3b, 0x4f, 0x3b, 0x47, 0x3b, 0x4e, 0x3b, 0x43, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x10c, 0x3b,
+0x47, 0x3b, 0x53, 0x3b, 0x4a, 0x3b, 0x6f, 0x111, 0x111, 0x6a, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x3b, 0x6e, 0x6a, 0x75, 0x6b,
+0x3b, 0x63, 0x75, 0x6f, 0x14b, 0x3b, 0x6d, 0x69, 0x65, 0x73, 0x3b, 0x67, 0x65, 0x61, 0x73, 0x3b, 0x73, 0x75, 0x6f, 0x69,
+0x3b, 0x62, 0x6f, 0x72, 0x67, 0x3b, 0x10d, 0x61, 0x6b, 0x10d, 0x3b, 0x67, 0x6f, 0x6c, 0x67, 0x3b, 0x73, 0x6b, 0xe1, 0x62,
+0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x3b, 0x43, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70,
+0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x43, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x74, 0x3b, 0x53, 0x65,
+0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x62, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x43, 0x68, 0x61, 0x6e, 0x75, 0x61,
+0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x75, 0x72, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70,
+0x69, 0x72, 0x69, 0x72, 0x69, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x43, 0x68, 0x75, 0x6c, 0x61,
+0x69, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b,
+0x69, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x62, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62,
+0x61, 0x3b, 0x43, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x43, 0x3b, 0x41, 0x3b, 0x53, 0x3b,
+0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x49, 0x6d, 0x62, 0x3b, 0x4b, 0x61, 0x77, 0x3b, 0x4b, 0x61, 0x64, 0x3b, 0x4b, 0x61,
+0x6e, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x4b, 0x61, 0x72, 0x3b, 0x4d, 0x66, 0x75, 0x3b, 0x57, 0x75, 0x6e, 0x3b, 0x49, 0x6b,
+0x65, 0x3b, 0x49, 0x6b, 0x75, 0x3b, 0x49, 0x6d, 0x77, 0x3b, 0x49, 0x77, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67,
+0x68, 0x77, 0x61, 0x20, 0x69, 0x6d, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61,
+0x20, 0x6b, 0x61, 0x77, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x64, 0x61,
+0x64, 0x75, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x6f,
+0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x73, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20,
+0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x72, 0x61, 0x6e, 0x64, 0x61, 0x64, 0x75, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20,
+0x67, 0x68, 0x77, 0x61, 0x20, 0x6d, 0x66, 0x75, 0x6e, 0x67, 0x61, 0x64, 0x65, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67,
+0x68, 0x77, 0x61, 0x20, 0x77, 0x75, 0x6e, 0x79, 0x61, 0x6e, 0x79, 0x61, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68,
+0x77, 0x61, 0x20, 0x69, 0x6b, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20,
+0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d,
+0x69, 0x20, 0x6e, 0x61, 0x20, 0x69, 0x6d, 0x77, 0x65, 0x72, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77,
+0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x69, 0x77, 0x69, 0x3b, 0x49, 0x3b, 0x4b, 0x3b, 0x4b,
+0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x57, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x73,
+0x69, 0x69, 0x3b, 0x63, 0x6f, 0x6c, 0x3b, 0x6d, 0x62, 0x6f, 0x3b, 0x73, 0x65, 0x65, 0x3b, 0x64, 0x75, 0x75, 0x3b, 0x6b,
+0x6f, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x3b, 0x6a, 0x75, 0x6b, 0x3b, 0x73, 0x6c, 0x74, 0x3b, 0x79, 0x61, 0x72, 0x3b, 0x6a,
+0x6f, 0x6c, 0x3b, 0x62, 0x6f, 0x77, 0x3b, 0x73, 0x69, 0x69, 0x6c, 0x6f, 0x3b, 0x63, 0x6f, 0x6c, 0x74, 0x65, 0x3b, 0x6d,
+0x62, 0x6f, 0x6f, 0x79, 0x3b, 0x73, 0x65, 0x65, 0x257, 0x74, 0x6f, 0x3b, 0x64, 0x75, 0x75, 0x6a, 0x61, 0x6c, 0x3b, 0x6b,
+0x6f, 0x72, 0x73, 0x65, 0x3b, 0x6d, 0x6f, 0x72, 0x73, 0x6f, 0x3b, 0x6a, 0x75, 0x6b, 0x6f, 0x3b, 0x73, 0x69, 0x69, 0x6c,
+0x74, 0x6f, 0x3b, 0x79, 0x61, 0x72, 0x6b, 0x6f, 0x6d, 0x61, 0x61, 0x3b, 0x6a, 0x6f, 0x6c, 0x61, 0x6c, 0x3b, 0x62, 0x6f,
+0x77, 0x74, 0x65, 0x3b, 0x73, 0x3b, 0x63, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x64, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b,
+0x73, 0x3b, 0x79, 0x3b, 0x6a, 0x3b, 0x62, 0x3b, 0x4a, 0x45, 0x4e, 0x3b, 0x57, 0x4b, 0x52, 0x3b, 0x57, 0x47, 0x54, 0x3b,
+0x57, 0x4b, 0x4e, 0x3b, 0x57, 0x54, 0x4e, 0x3b, 0x57, 0x54, 0x44, 0x3b, 0x57, 0x4d, 0x4a, 0x3b, 0x57, 0x4e, 0x4e, 0x3b,
+0x57, 0x4b, 0x44, 0x3b, 0x57, 0x49, 0x4b, 0x3b, 0x57, 0x4d, 0x57, 0x3b, 0x44, 0x49, 0x54, 0x3b, 0x4e, 0x6a, 0x65, 0x6e,
+0x75, 0x61, 0x72, 0x129, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65, 0x72, 0x129, 0x3b, 0x4d,
+0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65,
+0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61,
+0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x169, 0x67, 0x77, 0x61, 0x6e, 0x6a,
+0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77,
+0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77,
+0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169,
+0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x169, 0x6d, 0x77, 0x65, 0x3b, 0x4e, 0x64, 0x69, 0x74, 0x68, 0x65, 0x6d, 0x62, 0x61,
+0x3b, 0x4a, 0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x49,
+0x3b, 0x49, 0x3b, 0x44, 0x3b, 0x4f, 0x62, 0x6f, 0x3b, 0x57, 0x61, 0x61, 0x3b, 0x4f, 0x6b, 0x75, 0x3b, 0x4f, 0x6e, 0x67,
+0x3b, 0x49, 0x6d, 0x65, 0x3b, 0x49, 0x6c, 0x65, 0x3b, 0x53, 0x61, 0x70, 0x3b, 0x49, 0x73, 0x69, 0x3b, 0x53, 0x61, 0x61,
+0x3b, 0x54, 0x6f, 0x6d, 0x3b, 0x54, 0x6f, 0x62, 0x3b, 0x54, 0x6f, 0x77, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65,
+0x20, 0x6f, 0x62, 0x6f, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x77, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x4c,
+0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x6f, 0x6b, 0x75, 0x6e, 0x69, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65,
+0x20, 0x6f, 0x6e, 0x67, 0x2019, 0x77, 0x61, 0x6e, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x69, 0x6d, 0x65,
+0x74, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x69, 0x6c, 0x65, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c,
+0x65, 0x20, 0x73, 0x61, 0x70, 0x61, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x69, 0x65, 0x74,
+0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x73, 0x61, 0x61, 0x6c, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c,
+0x65, 0x20, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x6d, 0x6f,
+0x6e, 0x20, 0x6f, 0x62, 0x6f, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x20,
+0x77, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x4f, 0x3b, 0x57, 0x3b, 0x4f, 0x3b, 0x4f, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x53, 0x3b,
+0x49, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x76, 0x3b, 0x4d, 0x61,
+0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75,
+0x67, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x74, 0x75, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x63, 0x3b, 0x4a, 0x61,
+0x6e, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x46, 0x65, 0x76, 0x72, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x63, 0x6f,
+0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x6f, 0x3b, 0x4a, 0x75, 0x6e, 0x68, 0x6f, 0x3b, 0x4a, 0x75,
+0x6c, 0x68, 0x6f, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f,
+0x3b, 0x4f, 0x74, 0x75, 0x62, 0x72, 0x6f, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x44, 0x65, 0x63,
+0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x5a, 0x69, 0x62, 0x3b, 0x4e, 0x68, 0x6c, 0x6f, 0x3b, 0x4d, 0x62, 0x69, 0x3b, 0x4d,
+0x61, 0x62, 0x3b, 0x4e, 0x6b, 0x77, 0x3b, 0x4e, 0x68, 0x6c, 0x61, 0x3b, 0x4e, 0x74, 0x75, 0x3b, 0x4e, 0x63, 0x77, 0x3b,
+0x4d, 0x70, 0x61, 0x6e, 0x3b, 0x4d, 0x66, 0x75, 0x3b, 0x4c, 0x77, 0x65, 0x3b, 0x4d, 0x70, 0x61, 0x6c, 0x3b, 0x5a, 0x69,
+0x62, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x6c, 0x61, 0x3b, 0x4e, 0x68, 0x6c, 0x6f, 0x6c, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x4d,
+0x62, 0x69, 0x6d, 0x62, 0x69, 0x74, 0x68, 0x6f, 0x3b, 0x4d, 0x61, 0x62, 0x61, 0x73, 0x61, 0x3b, 0x4e, 0x6b, 0x77, 0x65,
+0x6e, 0x6b, 0x77, 0x65, 0x7a, 0x69, 0x3b, 0x4e, 0x68, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x6c, 0x61, 0x3b, 0x4e, 0x74, 0x75,
+0x6c, 0x69, 0x6b, 0x61, 0x7a, 0x69, 0x3b, 0x4e, 0x63, 0x77, 0x61, 0x62, 0x61, 0x6b, 0x61, 0x7a, 0x69, 0x3b, 0x4d, 0x70,
+0x61, 0x6e, 0x64, 0x75, 0x6c, 0x61, 0x3b, 0x4d, 0x66, 0x75, 0x6d, 0x66, 0x75, 0x3b, 0x4c, 0x77, 0x65, 0x7a, 0x69, 0x3b,
+0x4d, 0x70, 0x61, 0x6c, 0x61, 0x6b, 0x61, 0x7a, 0x69, 0x3b, 0x5a, 0x3b, 0x4e, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b,
+0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x31, 0x3b, 0x4d, 0x32, 0x3b,
+0x4d, 0x33, 0x3b, 0x4d, 0x34, 0x3b, 0x4d, 0x35, 0x3b, 0x4d, 0x36, 0x3b, 0x4d, 0x37, 0x3b, 0x4d, 0x38, 0x3b, 0x4d, 0x39,
+0x3b, 0x4d, 0x31, 0x30, 0x3b, 0x4d, 0x31, 0x31, 0x3b, 0x4d, 0x31, 0x32, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77,
+0x61, 0x20, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61,
+0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b,
+0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69,
+0x20, 0x77, 0x61, 0x20, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x73, 0x69,
+0x74, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x73, 0x61, 0x62, 0x61, 0x3b, 0x4d, 0x77, 0x65,
+0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6e, 0x61, 0x6e, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20,
+0x74, 0x69, 0x73, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b,
+0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f,
+0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61,
+0x20, 0x6d, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x53,
+0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x2d49, 0x2d4f, 0x2d4f, 0x3b, 0x2d31, 0x2d55, 0x2d30, 0x3b, 0x2d4e,
+0x2d30, 0x2d55, 0x3b, 0x2d49, 0x2d31, 0x2d54, 0x3b, 0x2d4e, 0x2d30, 0x2d62, 0x3b, 0x2d62, 0x2d53, 0x2d4f, 0x3b, 0x2d62, 0x2d53, 0x2d4d, 0x3b, 0x2d56,
+0x2d53, 0x2d5b, 0x3b, 0x2d5b, 0x2d53, 0x2d5c, 0x3b, 0x2d3d, 0x2d5c, 0x2d53, 0x3b, 0x2d4f, 0x2d53, 0x2d61, 0x3b, 0x2d37, 0x2d53, 0x2d4a, 0x3b, 0x2d49,
+0x2d4f, 0x2d4f, 0x2d30, 0x2d62, 0x2d54, 0x3b, 0x2d31, 0x2d55, 0x2d30, 0x2d62, 0x2d55, 0x3b, 0x2d4e, 0x2d30, 0x2d55, 0x2d5a, 0x3b, 0x2d49, 0x2d31, 0x2d54,
+0x2d49, 0x2d54, 0x3b, 0x2d4e, 0x2d30, 0x2d62, 0x2d62, 0x2d53, 0x3b, 0x2d62, 0x2d53, 0x2d4f, 0x2d62, 0x2d53, 0x3b, 0x2d62, 0x2d53, 0x2d4d, 0x2d62, 0x2d53,
+0x2d63, 0x3b, 0x2d56, 0x2d53, 0x2d5b, 0x2d5c, 0x3b, 0x2d5b, 0x2d53, 0x2d5c, 0x2d30, 0x2d4f, 0x2d31, 0x2d49, 0x2d54, 0x3b, 0x2d3d, 0x2d5c, 0x2d53, 0x2d31,
+0x2d54, 0x3b, 0x2d4f, 0x2d53, 0x2d61, 0x2d30, 0x2d4f, 0x2d31, 0x2d49, 0x2d54, 0x3b, 0x2d37, 0x2d53, 0x2d4a, 0x2d30, 0x2d4f, 0x2d31, 0x2d49, 0x2d54, 0x3b,
+0x2d49, 0x3b, 0x2d31, 0x3b, 0x2d4e, 0x3b, 0x2d49, 0x3b, 0x2d4e, 0x3b, 0x2d62, 0x3b, 0x2d62, 0x3b, 0x2d56, 0x3b, 0x2d5b, 0x3b, 0x2d3d, 0x3b,
+0x2d4f, 0x3b, 0x2d37, 0x3b, 0x69, 0x6e, 0x6e, 0x3b, 0x62, 0x1e5b, 0x61, 0x3b, 0x6d, 0x61, 0x1e5b, 0x3b, 0x69, 0x62, 0x72, 0x3b,
+0x6d, 0x61, 0x79, 0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79, 0x75, 0x6c, 0x3b, 0x263, 0x75, 0x63, 0x3b, 0x63, 0x75, 0x74, 0x3b,
+0x6b, 0x74, 0x75, 0x3b, 0x6e, 0x75, 0x77, 0x3b, 0x64, 0x75, 0x6a, 0x3b, 0x69, 0x6e, 0x6e, 0x61, 0x79, 0x72, 0x3b, 0x62,
+0x1e5b, 0x61, 0x79, 0x1e5b, 0x3b, 0x6d, 0x61, 0x1e5b, 0x1e63, 0x3b, 0x69, 0x62, 0x72, 0x69, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x79,
+0x75, 0x3b, 0x79, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x79, 0x75, 0x6c, 0x79, 0x75, 0x7a, 0x3b, 0x263, 0x75, 0x63, 0x74, 0x3b,
+0x63, 0x75, 0x74, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x6b, 0x74, 0x75, 0x62, 0x72, 0x3b, 0x6e, 0x75, 0x77, 0x61, 0x6e,
+0x62, 0x69, 0x72, 0x3b, 0x64, 0x75, 0x6a, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x69, 0x3b, 0x62, 0x3b, 0x6d, 0x3b, 0x69,
+0x3b, 0x6d, 0x3b, 0x79, 0x3b, 0x79, 0x3b, 0x263, 0x3b, 0x63, 0x3b, 0x6b, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x59, 0x65, 0x6e,
+0x3b, 0x46, 0x75, 0x72, 0x3b, 0x4d, 0x65, 0x263, 0x3b, 0x59, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e,
+0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x194, 0x75, 0x63, 0x3b, 0x43, 0x74, 0x65, 0x3b, 0x54, 0x75, 0x62, 0x3b, 0x57, 0x61, 0x6d,
+0x3b, 0x44, 0x75, 0x6a, 0x3b, 0x59, 0x65, 0x6e, 0x6e, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x46, 0x75, 0x1e5b, 0x61, 0x72, 0x3b,
+0x4d, 0x65, 0x263, 0x72, 0x65, 0x73, 0x3b, 0x59, 0x65, 0x62, 0x72, 0x69, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x79, 0x75, 0x3b,
+0x59, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6c, 0x79, 0x75, 0x3b, 0x194, 0x75, 0x63, 0x74, 0x3b, 0x43, 0x74, 0x65,
+0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x54, 0x75, 0x62, 0x65, 0x1e5b, 0x3b, 0x57, 0x61, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x44, 0x75,
+0x1e7, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x59, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59,
+0x3b, 0x194, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x59, 0x65, 0x6e, 0x3b, 0x46, 0x75, 0x72, 0x3b, 0x4d,
+0x65, 0x263, 0x3b, 0x59, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e, 0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x194,
+0x75, 0x63, 0x3b, 0x43, 0x74, 0x65, 0x3b, 0x54, 0x75, 0x62, 0x3b, 0x4e, 0x75, 0x6e, 0x3b, 0x44, 0x75, 0x1e7, 0x3b, 0x59,
+0x65, 0x6e, 0x6e, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x46, 0x75, 0x1e5b, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x263, 0x72, 0x65, 0x73,
+0x3b, 0x59, 0x65, 0x62, 0x72, 0x69, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6e, 0x79, 0x75, 0x3b,
+0x59, 0x75, 0x6c, 0x79, 0x75, 0x3b, 0x194, 0x75, 0x63, 0x74, 0x3b, 0x43, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x54,
+0x75, 0x62, 0x65, 0x1e5b, 0x3b, 0x4e, 0x75, 0x6e, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x44, 0x75, 0x1e7, 0x65, 0x6d, 0x62,
+0x65, 0x1e5b, 0x3b, 0x59, 0x3b, 0x46, 0x3b, 0x194, 0x3b, 0x42, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4c, 0x3b, 0x43, 0x3b, 0x54,
+0x3b, 0x52, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x4b, 0x42, 0x5a, 0x3b, 0x4b, 0x42, 0x52, 0x3b, 0x4b, 0x53, 0x54, 0x3b, 0x4b,
+0x4b, 0x4e, 0x3b, 0x4b, 0x54, 0x4e, 0x3b, 0x4b, 0x4d, 0x4b, 0x3b, 0x4b, 0x4d, 0x53, 0x3b, 0x4b, 0x4d, 0x4e, 0x3b, 0x4b,
+0x4d, 0x57, 0x3b, 0x4b, 0x4b, 0x4d, 0x3b, 0x4b, 0x4e, 0x4b, 0x3b, 0x4b, 0x4e, 0x42, 0x3b, 0x4f, 0x6b, 0x77, 0x6f, 0x6b,
+0x75, 0x62, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6b, 0x61, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4f, 0x6b,
+0x77, 0x61, 0x6b, 0x61, 0x73, 0x68, 0x61, 0x74, 0x75, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4f,
+0x6b, 0x77, 0x61, 0x6b, 0x61, 0x74, 0x61, 0x61, 0x6e, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x61,
+0x67, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x75, 0x73, 0x68, 0x61, 0x6e, 0x6a, 0x75, 0x3b, 0x4f, 0x6b, 0x77, 0x61,
+0x6d, 0x75, 0x6e, 0x61, 0x61, 0x6e, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x77, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4f,
+0x6b, 0x77, 0x61, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e,
+0x61, 0x20, 0x6b, 0x75, 0x6d, 0x77, 0x65, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61,
+0x20, 0x69, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x48, 0x75, 0x74, 0x3b, 0x56, 0x69, 0x6c, 0x3b, 0x44, 0x61, 0x74, 0x3b, 0x54,
+0x61, 0x69, 0x3b, 0x48, 0x61, 0x6e, 0x3b, 0x53, 0x69, 0x74, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4e, 0x61, 0x6e, 0x3b, 0x54,
+0x69, 0x73, 0x3b, 0x4b, 0x75, 0x6d, 0x3b, 0x4b, 0x6d, 0x6a, 0x3b, 0x4b, 0x6d, 0x62, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77,
+0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x68, 0x75, 0x74, 0x61, 0x6c, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d,
+0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x77, 0x75, 0x76, 0x69, 0x6c, 0x69, 0x3b, 0x70, 0x61, 0x20,
+0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x77, 0x75, 0x64, 0x61, 0x74, 0x75, 0x3b, 0x70, 0x61,
+0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x77, 0x75, 0x74, 0x61, 0x69, 0x3b, 0x70, 0x61,
+0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x77, 0x75, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x70,
+0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x73, 0x69, 0x74, 0x61, 0x3b, 0x70, 0x61,
+0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x73, 0x61, 0x62, 0x61, 0x3b, 0x70, 0x61, 0x20,
+0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x6e, 0x61, 0x6e, 0x65, 0x3b, 0x70, 0x61, 0x20, 0x6d,
+0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x74, 0x69, 0x73, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77,
+0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65,
+0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x6a, 0x61,
+0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x20,
+0x6e, 0x61, 0x20, 0x6d, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x48, 0x3b, 0x56, 0x3b, 0x44, 0x3b, 0x54, 0x3b, 0x48, 0x3b, 0x53,
+0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69,
+0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70, 0x72, 0x69,
+0x6c, 0x79, 0x69, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x79, 0x61, 0x69,
+0x3b, 0x41, 0x67, 0x75, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74,
+0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b,
+0x7a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x77, 0x69, 0x3b, 0x6d, 0x25b, 0x3b, 0x7a,
+0x75, 0x77, 0x3b, 0x7a, 0x75, 0x6c, 0x3b, 0x75, 0x74, 0x69, 0x3b, 0x73, 0x25b, 0x74, 0x3b, 0x254, 0x6b, 0x75, 0x3b, 0x6e,
+0x6f, 0x77, 0x3b, 0x64, 0x65, 0x73, 0x3b, 0x7a, 0x61, 0x6e, 0x77, 0x75, 0x79, 0x65, 0x3b, 0x66, 0x65, 0x62, 0x75, 0x72,
+0x75, 0x79, 0x65, 0x3b, 0x6d, 0x61, 0x72, 0x69, 0x73, 0x69, 0x3b, 0x61, 0x77, 0x69, 0x72, 0x69, 0x6c, 0x69, 0x3b, 0x6d,
+0x25b, 0x3b, 0x7a, 0x75, 0x77, 0x25b, 0x6e, 0x3b, 0x7a, 0x75, 0x6c, 0x75, 0x79, 0x65, 0x3b, 0x75, 0x74, 0x69, 0x3b, 0x73,
+0x25b, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x75, 0x3b, 0x254, 0x6b, 0x75, 0x74, 0x254, 0x62, 0x75, 0x72, 0x75, 0x3b, 0x6e,
+0x6f, 0x77, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x75, 0x3b, 0x64, 0x65, 0x73, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x75, 0x3b, 0x5a,
+0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x5a, 0x3b, 0x55, 0x3b, 0x53, 0x3b, 0x186, 0x3b, 0x4e,
+0x3b, 0x44, 0x3b, 0x4d, 0x62, 0x65, 0x3b, 0x4b, 0x61, 0x69, 0x3b, 0x4b, 0x61, 0x74, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x47,
+0x61, 0x74, 0x3b, 0x47, 0x61, 0x6e, 0x3b, 0x4d, 0x75, 0x67, 0x3b, 0x4b, 0x6e, 0x6e, 0x3b, 0x4b, 0x65, 0x6e, 0x3b, 0x49,
+0x6b, 0x75, 0x3b, 0x49, 0x6d, 0x77, 0x3b, 0x49, 0x67, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20,
+0x6d, 0x62, 0x65, 0x72, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x129, 0x72, 0x69,
+0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x68, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77,
+0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61,
+0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74,
+0x61, 0x6e, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x169, 0x67, 0x77,
+0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x6e, 0x61,
+0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72,
+0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20,
+0x69, 0x6b, 0x169, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x169, 0x6d, 0x77, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20,
+0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x4b, 0x61, 0x129, 0x72, 0x129, 0x3b, 0x4d, 0x3b,
+0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x49, 0x3b, 0x49, 0x3b,
+0x49, 0x3b, 0x13a4, 0x13c3, 0x3b, 0x13a7, 0x13a6, 0x3b, 0x13a0, 0x13c5, 0x3b, 0x13a7, 0x13ec, 0x3b, 0x13a0, 0x13c2, 0x3b, 0x13d5, 0x13ad, 0x3b,
+0x13ab, 0x13f0, 0x3b, 0x13a6, 0x13b6, 0x3b, 0x13da, 0x13b5, 0x3b, 0x13da, 0x13c2, 0x3b, 0x13c5, 0x13d3, 0x3b, 0x13a5, 0x13cd, 0x3b, 0x13a4, 0x13c3,
+0x13b8, 0x13d4, 0x13c5, 0x3b, 0x13a7, 0x13a6, 0x13b5, 0x3b, 0x13a0, 0x13c5, 0x13f1, 0x3b, 0x13a7, 0x13ec, 0x13c2, 0x3b, 0x13a0, 0x13c2, 0x13cd, 0x13ac,
+0x13d8, 0x3b, 0x13d5, 0x13ad, 0x13b7, 0x13f1, 0x3b, 0x13ab, 0x13f0, 0x13c9, 0x13c2, 0x3b, 0x13a6, 0x13b6, 0x13c2, 0x3b, 0x13da, 0x13b5, 0x13cd, 0x13d7,
+0x3b, 0x13da, 0x13c2, 0x13c5, 0x13d7, 0x3b, 0x13c5, 0x13d3, 0x13d5, 0x13c6, 0x3b, 0x13a5, 0x13cd, 0x13a9, 0x13f1, 0x3b, 0x13a4, 0x3b, 0x13a7, 0x3b,
+0x13a0, 0x3b, 0x13a7, 0x3b, 0x13a0, 0x3b, 0x13d5, 0x3b, 0x13ab, 0x3b, 0x13a6, 0x3b, 0x13da, 0x3b, 0x13da, 0x3b, 0x13c5, 0x3b, 0x13a5, 0x3b,
+0x7a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x76, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x76, 0x72, 0x3b, 0x6d, 0x65, 0x3b, 0x7a,
+0x69, 0x6e, 0x3b, 0x7a, 0x69, 0x6c, 0x3b, 0x6f, 0x75, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e,
+0x6f, 0x76, 0x3b, 0x64, 0x65, 0x73, 0x3b, 0x7a, 0x61, 0x6e, 0x76, 0x69, 0x65, 0x3b, 0x66, 0x65, 0x76, 0x72, 0x69, 0x79,
+0x65, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x65, 0x3b, 0x7a, 0x69, 0x6e, 0x3b,
+0x7a, 0x69, 0x6c, 0x79, 0x65, 0x3b, 0x6f, 0x75, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x61, 0x6d, 0x3b, 0x6f, 0x6b, 0x74,
+0x6f, 0x62, 0x3b, 0x6e, 0x6f, 0x76, 0x61, 0x6d, 0x3b, 0x64, 0x65, 0x73, 0x61, 0x6d, 0x3b, 0x7a, 0x3b, 0x66, 0x3b, 0x6d,
+0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x7a, 0x3b, 0x7a, 0x3b, 0x6f, 0x3b, 0x73, 0x3b, 0x6f, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x4d,
+0x77, 0x65, 0x64, 0x69, 0x20, 0x4e, 0x74, 0x61, 0x6e, 0x64, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61,
+0x20, 0x50, 0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x54, 0x61, 0x74, 0x75, 0x3b,
+0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x63, 0x68, 0x65, 0x63, 0x68, 0x69, 0x3b, 0x4d, 0x77, 0x65,
+0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77,
+0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x55, 0x6d, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x64,
+0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4d, 0x69, 0x76, 0x69, 0x6c,
+0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61,
+0x20, 0x4d, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79,
+0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x63, 0x68, 0x65, 0x63, 0x68, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69,
+0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f,
+0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20,
+0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x55, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61,
+0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61,
+0x20, 0x4d, 0x3b, 0x46, 0xfa, 0x6e, 0x67, 0x61, 0x74, 0x268, 0x3b, 0x4e, 0x61, 0x61, 0x6e, 0x268, 0x3b, 0x4b, 0x65, 0x65,
+0x6e, 0x64, 0x61, 0x3b, 0x49, 0x6b, 0xfa, 0x6d, 0x69, 0x3b, 0x49, 0x6e, 0x79, 0x61, 0x6d, 0x62, 0x61, 0x6c, 0x61, 0x3b,
+0x49, 0x64, 0x77, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x4d, 0x289, 0x289, 0x6e, 0x63, 0x68, 0x268, 0x3b, 0x56, 0x268, 0x268, 0x72,
+0x268, 0x3b, 0x53, 0x61, 0x61, 0x74, 0x289, 0x3b, 0x49, 0x6e, 0x79, 0x69, 0x3b, 0x53, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0x53,
+0x61, 0x73, 0x61, 0x74, 0x289, 0x3b, 0x4b, 0x289, 0x66, 0xfa, 0x6e, 0x67, 0x61, 0x74, 0x268, 0x3b, 0x4b, 0x289, 0x6e, 0x61,
+0x61, 0x6e, 0x268, 0x3b, 0x4b, 0x289, 0x6b, 0x65, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x6b, 0x75, 0x6d,
+0x69, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x6e, 0x79, 0x61, 0x6d, 0x62, 0xe1, 0x6c, 0x61, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x64,
+0x77, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x4b, 0x289, 0x6d, 0x289, 0x289, 0x6e, 0x63, 0x68, 0x268, 0x3b, 0x4b, 0x289, 0x76, 0x268,
+0x268, 0x72, 0x268, 0x3b, 0x4b, 0x289, 0x73, 0x61, 0x61, 0x74, 0x289, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x6e, 0x79, 0x69, 0x3b,
+0x4b, 0x289, 0x73, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0x4b, 0x289, 0x73, 0x61, 0x73, 0x61, 0x74, 0x289, 0x3b, 0x46, 0x3b, 0x4e,
+0x3b, 0x4b, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x4d, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x53,
+0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x75, 0x3b, 0x4d, 0x61, 0x61,
+0x3b, 0x4a, 0x75, 0x75, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x75, 0x3b, 0x53, 0x65, 0x62, 0x3b, 0x4f, 0x6b, 0x69,
+0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x77, 0x61, 0x6c, 0x69, 0x79, 0x6f, 0x3b, 0x46,
+0x65, 0x62, 0x77, 0x61, 0x6c, 0x69, 0x79, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x69, 0x73, 0x69, 0x3b, 0x41, 0x70, 0x75, 0x6c,
+0x69, 0x3b, 0x4d, 0x61, 0x61, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x61, 0x79,
+0x69, 0x3b, 0x41, 0x67, 0x75, 0x73, 0x69, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x62, 0x75, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x61,
+0x3b, 0x4f, 0x6b, 0x69, 0x74, 0x6f, 0x62, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x65,
+0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x45, 0x70,
+0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x4f, 0x67, 0x61, 0x3b, 0x53, 0x65,
+0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72,
+0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x45, 0x70, 0x72,
+0x65, 0x6f, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x4f, 0x67,
+0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61,
+0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x46,
+0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44,
+0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x69,
+0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x74, 0x75,
+0x3b, 0x4e, 0x75, 0x76, 0x3b, 0x44, 0x69, 0x7a, 0x3b, 0x4a, 0x61, 0x6e, 0x65, 0x72, 0x75, 0x3b, 0x46, 0x65, 0x62, 0x72,
+0x65, 0x72, 0x75, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x75, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x75,
+0x3b, 0x4a, 0x75, 0x6e, 0x68, 0x75, 0x3b, 0x4a, 0x75, 0x6c, 0x68, 0x75, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x75, 0x3b,
+0x53, 0x65, 0x74, 0x65, 0x6e, 0x62, 0x72, 0x75, 0x3b, 0x4f, 0x74, 0x75, 0x62, 0x72, 0x75, 0x3b, 0x4e, 0x75, 0x76, 0x65,
+0x6e, 0x62, 0x72, 0x75, 0x3b, 0x44, 0x69, 0x7a, 0x65, 0x6e, 0x62, 0x72, 0x75, 0x3b, 0x4a, 0x41, 0x4e, 0x3b, 0x46, 0x45,
+0x42, 0x3b, 0x4d, 0x41, 0x43, 0x3b, 0x128, 0x50, 0x55, 0x3b, 0x4d, 0x128, 0x128, 0x3b, 0x4e, 0x4a, 0x55, 0x3b, 0x4e, 0x4a,
+0x52, 0x3b, 0x41, 0x47, 0x41, 0x3b, 0x53, 0x50, 0x54, 0x3b, 0x4f, 0x4b, 0x54, 0x3b, 0x4e, 0x4f, 0x56, 0x3b, 0x44, 0x45,
+0x43, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x129, 0x3b, 0x46, 0x65, 0x62, 0x75, 0x72, 0x75, 0x61, 0x72, 0x129, 0x3b,
+0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x128, 0x70, 0x75, 0x72, 0x169, 0x3b, 0x4d, 0x129, 0x129, 0x3b, 0x4e, 0x6a, 0x75, 0x6e,
+0x69, 0x3b, 0x4e, 0x6a, 0x75, 0x72, 0x61, 0x129, 0x3b, 0x41, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74,
+0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x169, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b,
+0x44, 0x69, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x128, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b,
+0x4e, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4d, 0x75, 0x6c, 0x3b, 0x4e, 0x67, 0x61, 0x74,
+0x3b, 0x54, 0x61, 0x61, 0x3b, 0x49, 0x77, 0x6f, 0x3b, 0x4d, 0x61, 0x6d, 0x3b, 0x50, 0x61, 0x61, 0x3b, 0x4e, 0x67, 0x65,
+0x3b, 0x52, 0x6f, 0x6f, 0x3b, 0x42, 0x75, 0x72, 0x3b, 0x45, 0x70, 0x65, 0x3b, 0x4b, 0x70, 0x74, 0x3b, 0x4b, 0x70, 0x61,
+0x3b, 0x4d, 0x75, 0x6c, 0x67, 0x75, 0x6c, 0x3b, 0x4e, 0x67, 0x2019, 0x61, 0x74, 0x79, 0x61, 0x61, 0x74, 0x6f, 0x3b, 0x4b,
+0x69, 0x70, 0x74, 0x61, 0x61, 0x6d, 0x6f, 0x3b, 0x49, 0x77, 0x6f, 0x6f, 0x74, 0x6b, 0x75, 0x75, 0x74, 0x3b, 0x4d, 0x61,
+0x6d, 0x75, 0x75, 0x74, 0x3b, 0x50, 0x61, 0x61, 0x67, 0x69, 0x3b, 0x4e, 0x67, 0x2019, 0x65, 0x69, 0x79, 0x65, 0x65, 0x74,
+0x3b, 0x52, 0x6f, 0x6f, 0x70, 0x74, 0x75, 0x69, 0x3b, 0x42, 0x75, 0x72, 0x65, 0x65, 0x74, 0x3b, 0x45, 0x70, 0x65, 0x65,
+0x73, 0x6f, 0x3b, 0x4b, 0x69, 0x70, 0x73, 0x75, 0x75, 0x6e, 0x64, 0x65, 0x20, 0x6e, 0x65, 0x20, 0x74, 0x61, 0x61, 0x69,
+0x3b, 0x4b, 0x69, 0x70, 0x73, 0x75, 0x75, 0x6e, 0x64, 0x65, 0x20, 0x6e, 0x65, 0x62, 0x6f, 0x20, 0x61, 0x65, 0x6e, 0x67,
+0x2019, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x49, 0x3b, 0x4d, 0x3b, 0x50, 0x3b, 0x4e, 0x3b, 0x52, 0x3b, 0x42, 0x3b,
+0x45, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x1c3, 0x4b, 0x68, 0x61, 0x6e, 0x6e, 0x69, 0x3b, 0x1c3, 0x4b, 0x68, 0x61, 0x6e, 0x1c0,
+0x67, 0xf4, 0x61, 0x62, 0x3b, 0x1c0, 0x4b, 0x68, 0x75, 0x75, 0x1c1, 0x6b, 0x68, 0xe2, 0x62, 0x3b, 0x1c3, 0x48, 0xf4, 0x61,
+0x1c2, 0x6b, 0x68, 0x61, 0x69, 0x62, 0x3b, 0x1c3, 0x4b, 0x68, 0x61, 0x69, 0x74, 0x73, 0xe2, 0x62, 0x3b, 0x47, 0x61, 0x6d,
+0x61, 0x1c0, 0x61, 0x65, 0x62, 0x3b, 0x1c2, 0x4b, 0x68, 0x6f, 0x65, 0x73, 0x61, 0x6f, 0x62, 0x3b, 0x41, 0x6f, 0x1c1, 0x6b,
+0x68, 0x75, 0x75, 0x6d, 0xfb, 0x1c1, 0x6b, 0x68, 0xe2, 0x62, 0x3b, 0x54, 0x61, 0x72, 0x61, 0x1c0, 0x6b, 0x68, 0x75, 0x75,
+0x6d, 0xfb, 0x1c1, 0x6b, 0x68, 0xe2, 0x62, 0x3b, 0x1c2, 0x4e, 0xfb, 0x1c1, 0x6e, 0xe2, 0x69, 0x73, 0x65, 0x62, 0x3b, 0x1c0,
+0x48, 0x6f, 0x6f, 0x1c2, 0x67, 0x61, 0x65, 0x62, 0x3b, 0x48, 0xf4, 0x61, 0x73, 0x6f, 0x72, 0x65, 0x1c1, 0x6b, 0x68, 0xe2,
+0x62, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0xe4, 0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x7a, 0x2e, 0x3b, 0x41, 0x70, 0x72,
+0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x4f, 0x75, 0x6a, 0x2e,
+0x3b, 0x53, 0xe4, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e,
+0x3b, 0x4a, 0x61, 0x6e, 0x6e, 0x65, 0x77, 0x61, 0x3b, 0x46, 0xe4, 0x62, 0x72, 0x6f, 0x77, 0x61, 0x3b, 0x4d, 0xe4, 0xe4,
+0x7a, 0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x4a,
+0x75, 0x75, 0x6c, 0x69, 0x3b, 0x4f, 0x75, 0x6a, 0x6f, 0xdf, 0x3b, 0x53, 0x65, 0x70, 0x74, 0xe4, 0x6d, 0x62, 0x65, 0x72,
+0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x68, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44,
+0x65, 0x7a, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0xe4, 0x62, 0x3b, 0x4d, 0xe4, 0x7a, 0x3b,
+0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x4f, 0x75, 0x6a, 0x3b,
+0x53, 0xe4, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x44, 0x61, 0x6c, 0x3b,
+0x41, 0x72, 0xe1, 0x3b, 0x186, 0x25b, 0x6e, 0x3b, 0x44, 0x6f, 0x79, 0x3b, 0x4c, 0xe9, 0x70, 0x3b, 0x52, 0x6f, 0x6b, 0x3b,
+0x53, 0xe1, 0x73, 0x3b, 0x42, 0x254, 0x301, 0x72, 0x3b, 0x4b, 0xfa, 0x73, 0x3b, 0x47, 0xed, 0x73, 0x3b, 0x53, 0x68, 0x289,
+0x301, 0x3b, 0x4e, 0x74, 0x289, 0x301, 0x3b, 0x4f, 0x6c, 0x61, 0x64, 0x61, 0x6c, 0x289, 0x301, 0x3b, 0x41, 0x72, 0xe1, 0x74,
+0x3b, 0x186, 0x25b, 0x6e, 0x268, 0x301, 0x254, 0x268, 0x14b, 0x254, 0x6b, 0x3b, 0x4f, 0x6c, 0x6f, 0x64, 0x6f, 0x79, 0xed, 0xf3,
+0x72, 0xed, 0xea, 0x20, 0x69, 0x6e, 0x6b, 0xf3, 0x6b, 0xfa, 0xe2, 0x3b, 0x4f, 0x6c, 0x6f, 0x69, 0x6c, 0xe9, 0x70, 0x16b,
+0x6e, 0x79, 0x12b, 0x113, 0x20, 0x69, 0x6e, 0x6b, 0xf3, 0x6b, 0xfa, 0xe2, 0x3b, 0x4b, 0xfa, 0x6a, 0xfa, 0x254, 0x72, 0x254,
+0x6b, 0x3b, 0x4d, 0xf3, 0x72, 0x75, 0x73, 0xe1, 0x73, 0x69, 0x6e, 0x3b, 0x186, 0x6c, 0x254, 0x301, 0x268, 0x301, 0x62, 0x254,
+0x301, 0x72, 0xe1, 0x72, 0x25b, 0x3b, 0x4b, 0xfa, 0x73, 0x68, 0xee, 0x6e, 0x3b, 0x4f, 0x6c, 0x67, 0xed, 0x73, 0x61, 0x6e,
+0x3b, 0x50, 0x289, 0x73, 0x68, 0x289, 0x301, 0x6b, 0x61, 0x3b, 0x4e, 0x74, 0x289, 0x301, 0x14b, 0x289, 0x301, 0x73, 0x3b, 0x4a,
+0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a,
+0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e,
+0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41,
+0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53,
+0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x63, 0x3b, 0x52, 0x61, 0x72, 0x3b, 0x4d,
+0x75, 0x6b, 0x3b, 0x4b, 0x77, 0x61, 0x3b, 0x44, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x6f, 0x64, 0x3b, 0x4a,
+0x6f, 0x6c, 0x3b, 0x50, 0x65, 0x64, 0x3b, 0x53, 0x6f, 0x6b, 0x3b, 0x54, 0x69, 0x62, 0x3b, 0x4c, 0x61, 0x62, 0x3b, 0x50,
+0x6f, 0x6f, 0x3b, 0x4f, 0x72, 0x61, 0x72, 0x61, 0x3b, 0x4f, 0x6d, 0x75, 0x6b, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x67,
+0x2019, 0x3b, 0x4f, 0x64, 0x75, 0x6e, 0x67, 0x2019, 0x65, 0x6c, 0x3b, 0x4f, 0x6d, 0x61, 0x72, 0x75, 0x6b, 0x3b, 0x4f, 0x6d,
+0x6f, 0x64, 0x6f, 0x6b, 0x2019, 0x6b, 0x69, 0x6e, 0x67, 0x2019, 0x6f, 0x6c, 0x3b, 0x4f, 0x6a, 0x6f, 0x6c, 0x61, 0x3b, 0x4f,
+0x70, 0x65, 0x64, 0x65, 0x6c, 0x3b, 0x4f, 0x73, 0x6f, 0x6b, 0x6f, 0x73, 0x6f, 0x6b, 0x6f, 0x6d, 0x61, 0x3b, 0x4f, 0x74,
+0x69, 0x62, 0x61, 0x72, 0x3b, 0x4f, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x3b, 0x4f, 0x70, 0x6f, 0x6f, 0x3b, 0x52, 0x3b, 0x4d,
+0x3b, 0x4b, 0x3b, 0x44, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x50,
+0x3b, 0x17d, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x65, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x77, 0x69, 0x3b, 0x4d, 0x65, 0x3b,
+0x17d, 0x75, 0x77, 0x3b, 0x17d, 0x75, 0x79, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x6b, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e,
+0x6f, 0x6f, 0x3b, 0x44, 0x65, 0x65, 0x3b, 0x17d, 0x61, 0x6e, 0x77, 0x69, 0x79, 0x65, 0x3b, 0x46, 0x65, 0x65, 0x77, 0x69,
+0x72, 0x69, 0x79, 0x65, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x69, 0x3b, 0x41, 0x77, 0x69, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65,
+0x3b, 0x17d, 0x75, 0x77, 0x65, 0x14b, 0x3b, 0x17d, 0x75, 0x79, 0x79, 0x65, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x6b, 0x74,
+0x61, 0x6e, 0x62, 0x75, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x75, 0x72, 0x3b, 0x4e, 0x6f, 0x6f, 0x77, 0x61,
+0x6e, 0x62, 0x75, 0x72, 0x3b, 0x44, 0x65, 0x65, 0x73, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x3b, 0x17d, 0x3b, 0x46, 0x3b, 0x4d,
+0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x17d, 0x3b, 0x17d, 0x3b, 0x55, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x44,
+0x41, 0x43, 0x3b, 0x44, 0x41, 0x52, 0x3b, 0x44, 0x41, 0x44, 0x3b, 0x44, 0x41, 0x4e, 0x3b, 0x44, 0x41, 0x48, 0x3b, 0x44,
+0x41, 0x55, 0x3b, 0x44, 0x41, 0x4f, 0x3b, 0x44, 0x41, 0x42, 0x3b, 0x44, 0x4f, 0x43, 0x3b, 0x44, 0x41, 0x50, 0x3b, 0x44,
+0x47, 0x49, 0x3b, 0x44, 0x41, 0x47, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x63, 0x68, 0x69, 0x65,
+0x6c, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x72, 0x69, 0x79, 0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20,
+0x6d, 0x61, 0x72, 0x20, 0x41, 0x64, 0x65, 0x6b, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x6e, 0x67,
+0x2019, 0x77, 0x65, 0x6e, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x62, 0x69, 0x63, 0x68, 0x3b, 0x44,
+0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x75, 0x63, 0x68, 0x69, 0x65, 0x6c, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d,
+0x61, 0x72, 0x20, 0x41, 0x62, 0x69, 0x72, 0x69, 0x79, 0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41,
+0x62, 0x6f, 0x72, 0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x4f, 0x63, 0x68, 0x69, 0x6b, 0x6f, 0x3b,
+0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x70, 0x61, 0x72, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72,
+0x20, 0x67, 0x69, 0x20, 0x61, 0x63, 0x68, 0x69, 0x65, 0x6c, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41,
+0x70, 0x61, 0x72, 0x20, 0x67, 0x69, 0x20, 0x61, 0x72, 0x69, 0x79, 0x6f, 0x3b, 0x43, 0x3b, 0x52, 0x3b, 0x44, 0x3b, 0x4e,
+0x3b, 0x42, 0x3b, 0x55, 0x3b, 0x42, 0x3b, 0x42, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x59, 0x65, 0x6e,
+0x3b, 0x59, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x49, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e,
+0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x194, 0x75, 0x63, 0x3b, 0x43, 0x75, 0x74, 0x3b, 0x4b, 0x1e6d, 0x75, 0x3b, 0x4e, 0x77, 0x61,
+0x3b, 0x44, 0x75, 0x6a, 0x3b, 0x59, 0x65, 0x6e, 0x6e, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x59, 0x65, 0x62, 0x72, 0x61, 0x79,
+0x65, 0x72, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x49, 0x62, 0x72, 0x69, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x79, 0x75, 0x3b,
+0x59, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6c, 0x79, 0x75, 0x7a, 0x3b, 0x194, 0x75, 0x63, 0x74, 0x3b, 0x43, 0x75,
+0x74, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x4b, 0x1e6d, 0x75, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x77, 0x61, 0x6e, 0x62, 0x69,
+0x72, 0x3b, 0x44, 0x75, 0x6a, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x4d,
+0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x194, 0x3b, 0x43, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61,
+0x6c, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x6c, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70,
+0x6c, 0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b,
+0x41, 0x67, 0x6f, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f,
+0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x91c,
+0x93e, 0x928, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92e,
+0x93e, 0x930, 0x94d, 0x938, 0x3b, 0x90f, 0x92b, 0x94d, 0x930, 0x93f, 0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928, 0x3b, 0x91c,
+0x941, 0x932, 0x93e, 0x907, 0x3b, 0x906, 0x917, 0x938, 0x94d, 0x925, 0x3b, 0x938, 0x947, 0x92c, 0x925, 0x947, 0x91c, 0x94d, 0x92c, 0x93c,
+0x930, 0x3b, 0x905, 0x916, 0x925, 0x92c, 0x930, 0x3b, 0x928, 0x92c, 0x947, 0x91c, 0x94d, 0x92c, 0x93c, 0x930, 0x3b, 0x926, 0x93f, 0x938,
+0x947, 0x91c, 0x94d, 0x92c, 0x93c, 0x930, 0x3b, 0x91c, 0x3b, 0x92b, 0x947, 0x3b, 0x92e, 0x93e, 0x3b, 0x90f, 0x3b, 0x92e, 0x947, 0x3b,
+0x91c, 0x941, 0x3b, 0x91c, 0x941, 0x3b, 0x906, 0x3b, 0x938, 0x947, 0x3b, 0x905, 0x3b, 0x928, 0x3b, 0x926, 0x93f, 0x3b, 0x456, 0x486,
+0x430, 0x2de9, 0x487, 0x3b, 0x444, 0x435, 0x2de1, 0x487, 0x3b, 0x43c, 0x430, 0x2dec, 0x487, 0x3b, 0x430, 0x486, 0x43f, 0x2dec, 0x487, 0x3b,
+0x43c, 0x430, 0xa675, 0x3b, 0x456, 0x486, 0xa64b, 0x2de9, 0x487, 0x3b, 0x456, 0x486, 0xa64b, 0x2de7, 0x487, 0x3b, 0x430, 0x486, 0x301, 0x475,
+0x2de2, 0x487, 0x3b, 0x441, 0x435, 0x2deb, 0x487, 0x3b, 0x47b, 0x486, 0x43a, 0x2dee, 0x3b, 0x43d, 0x43e, 0x435, 0x2de8, 0x3b, 0x434, 0x435,
+0x2de6, 0x487, 0x3b, 0x456, 0x486, 0x430, 0x43d, 0x43d, 0xa64b, 0x430, 0x301, 0x440, 0x457, 0x439, 0x3b, 0x444, 0x435, 0x432, 0x440, 0xa64b,
+0x430, 0x301, 0x440, 0x457, 0x439, 0x3b, 0x43c, 0x430, 0x301, 0x440, 0x442, 0x44a, 0x3b, 0x430, 0x486, 0x43f, 0x440, 0x456, 0x301, 0x43b,
+0x43b, 0x457, 0x439, 0x3b, 0x43c, 0x430, 0x301, 0x457, 0x439, 0x3b, 0x456, 0x486, 0xa64b, 0x301, 0x43d, 0x457, 0x439, 0x3b, 0x456, 0x486,
+0xa64b, 0x301, 0x43b, 0x457, 0x439, 0x3b, 0x430, 0x486, 0x301, 0x475, 0x433, 0xa64b, 0x441, 0x442, 0x44a, 0x3b, 0x441, 0x435, 0x43f, 0x442,
+0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x439, 0x3b, 0x47b, 0x486, 0x43a, 0x442, 0x461, 0x301, 0x432, 0x440, 0x457, 0x439, 0x3b, 0x43d,
+0x43e, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x439, 0x3b, 0x434, 0x435, 0x43a, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x439, 0x3b,
+0x406, 0x486, 0x3b, 0x424, 0x3b, 0x41c, 0x3b, 0x410, 0x486, 0x3b, 0x41c, 0x3b, 0x406, 0x486, 0x3b, 0x406, 0x486, 0x3b, 0x410, 0x486,
+0x3b, 0x421, 0x3b, 0x47a, 0x486, 0x3b, 0x41d, 0x3b, 0x414, 0x3b, 0x456, 0x486, 0x430, 0x43d, 0x43d, 0xa64b, 0x430, 0x301, 0x440, 0x457,
+0x430, 0x3b, 0x444, 0x435, 0x432, 0x440, 0xa64b, 0x430, 0x301, 0x440, 0x457, 0x430, 0x3b, 0x43c, 0x430, 0x301, 0x440, 0x442, 0x430, 0x3b,
+0x430, 0x486, 0x43f, 0x440, 0x456, 0x301, 0x43b, 0x43b, 0x457, 0x430, 0x3b, 0x43c, 0x430, 0x301, 0x457, 0x430, 0x3b, 0x456, 0x486, 0xa64b,
+0x301, 0x43d, 0x457, 0x430, 0x3b, 0x456, 0x486, 0xa64b, 0x301, 0x43b, 0x457, 0x430, 0x3b, 0x430, 0x486, 0x301, 0x475, 0x433, 0xa64b, 0x441,
+0x442, 0x430, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x47b, 0x486, 0x43a, 0x442, 0x461,
+0x301, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x43d, 0x43e, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x434, 0x435, 0x43a, 0x435,
+0x301, 0x43c, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x43, 0x69, 0x6f, 0x3b, 0x4c, 0x75, 0x69, 0x3b, 0x4c, 0x75, 0x73, 0x3b, 0x4d,
+0x75, 0x75, 0x3b, 0x4c, 0x75, 0x6d, 0x3b, 0x4c, 0x75, 0x66, 0x3b, 0x4b, 0x61, 0x62, 0x3b, 0x4c, 0x75, 0x73, 0x68, 0x3b,
+0x4c, 0x75, 0x74, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x43, 0x69, 0x73, 0x3b, 0x43, 0x69, 0x6f, 0x6e,
+0x67, 0x6f, 0x3b, 0x4c, 0xf9, 0x69, 0x73, 0x68, 0x69, 0x3b, 0x4c, 0x75, 0x73, 0xf2, 0x6c, 0x6f, 0x3b, 0x4d, 0xf9, 0x75,
+0x79, 0xe0, 0x3b, 0x4c, 0x75, 0x6d, 0xf9, 0x6e, 0x67, 0xf9, 0x6c, 0xf9, 0x3b, 0x4c, 0x75, 0x66, 0x75, 0x69, 0x6d, 0x69,
+0x3b, 0x4b, 0x61, 0x62, 0xe0, 0x6c, 0xe0, 0x73, 0x68, 0xec, 0x70, 0xf9, 0x3b, 0x4c, 0xf9, 0x73, 0x68, 0xec, 0x6b, 0xe0,
+0x3b, 0x4c, 0x75, 0x74, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x67, 0xf9, 0x64, 0x69, 0x3b, 0x4b,
+0x61, 0x73, 0x77, 0xe8, 0x6b, 0xe8, 0x73, 0xe8, 0x3b, 0x43, 0x69, 0x73, 0x77, 0xe0, 0x3b, 0x43, 0x3b, 0x4c, 0x3b, 0x4c,
+0x3b, 0x4d, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b, 0x43, 0x3b, 0x4a,
+0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0xe4, 0x65, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a,
+0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e,
+0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61,
+0x72, 0x3b, 0x4d, 0xe4, 0x65, 0x72, 0x7a, 0x3b, 0x41, 0x62, 0x72, 0xeb, 0x6c, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a,
+0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74,
+0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
+0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62,
+0x2e, 0x3b, 0x4d, 0xe4, 0x65, 0x2e, 0x3b, 0x41, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x6e, 0x69,
+0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e,
+0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e, 0x3b, 0x6e, 0xf9, 0x6d, 0x3b, 0x6b, 0x268, 0x7a, 0x3b, 0x74,
+0x268, 0x64, 0x3b, 0x74, 0x61, 0x61, 0x3b, 0x73, 0x65, 0x65, 0x3b, 0x6e, 0x7a, 0x75, 0x3b, 0x64, 0x75, 0x6d, 0x3b, 0x66,
+0x254, 0x65, 0x3b, 0x64, 0x7a, 0x75, 0x3b, 0x6c, 0x254, 0x6d, 0x3b, 0x6b, 0x61, 0x61, 0x3b, 0x66, 0x77, 0x6f, 0x3b, 0x6e,
+0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x6e, 0xf9, 0x6d, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x6b,
+0x197, 0x300, 0x7a, 0xf9, 0x294, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x74, 0x197, 0x300, 0x64, 0x289, 0x300,
+0x67, 0x68, 0xe0, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x74, 0x1ce, 0x61, 0x66, 0x289, 0x304, 0x67, 0x68,
+0x101, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0xe8, 0x73, 0xe8, 0x65, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254,
+0x300, 0x6e, 0x7a, 0xf9, 0x67, 0x68, 0xf2, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x64, 0xf9, 0x6d, 0x6c,
+0x6f, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x6b, 0x77, 0xee, 0x66, 0x254, 0x300, 0x65, 0x3b, 0x6e, 0x64,
+0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x74, 0x197, 0x300, 0x66, 0x289, 0x300, 0x67, 0x68, 0xe0, 0x64, 0x7a, 0x75, 0x67, 0x68,
+0xf9, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x67, 0x68, 0x1d4, 0x75, 0x77, 0x65, 0x6c, 0x254, 0x300, 0x6d,
+0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x63, 0x68, 0x77, 0x61, 0x294, 0xe0, 0x6b, 0x61, 0x61, 0x20, 0x77,
+0x6f, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0xe8, 0x66, 0x77, 0xf2, 0x6f, 0x3b, 0x6e, 0x3b, 0x6b, 0x3b, 0x74, 0x3b,
+0x74, 0x3b, 0x73, 0x3b, 0x7a, 0x3b, 0x6b, 0x3b, 0x66, 0x3b, 0x64, 0x3b, 0x6c, 0x3b, 0x63, 0x3b, 0x66, 0x3b, 0x6b, 0x254,
+0x6e, 0x3b, 0x6d, 0x61, 0x63, 0x3b, 0x6d, 0x61, 0x74, 0x3b, 0x6d, 0x74, 0x6f, 0x3b, 0x6d, 0x70, 0x75, 0x3b, 0x68, 0x69,
+0x6c, 0x3b, 0x6e, 0x6a, 0x65, 0x3b, 0x68, 0x69, 0x6b, 0x3b, 0x64, 0x69, 0x70, 0x3b, 0x62, 0x69, 0x6f, 0x3b, 0x6d, 0x61,
+0x79, 0x3b, 0x6c, 0x69, 0x253, 0x3b, 0x4b, 0x254, 0x6e, 0x64, 0x254, 0x14b, 0x3b, 0x4d, 0xe0, 0x63, 0x25b, 0x302, 0x6c, 0x3b,
+0x4d, 0xe0, 0x74, 0xf9, 0x6d, 0x62, 0x3b, 0x4d, 0xe0, 0x74, 0x6f, 0x70, 0x3b, 0x4d, 0x300, 0x70, 0x75, 0x79, 0x25b, 0x3b,
+0x48, 0xec, 0x6c, 0xf2, 0x6e, 0x64, 0x25b, 0x300, 0x3b, 0x4e, 0x6a, 0xe8, 0x62, 0xe0, 0x3b, 0x48, 0xec, 0x6b, 0x61, 0x14b,
+0x3b, 0x44, 0xec, 0x70, 0x254, 0x300, 0x73, 0x3b, 0x42, 0xec, 0xf2, 0xf4, 0x6d, 0x3b, 0x4d, 0xe0, 0x79, 0x25b, 0x73, 0xe8,
+0x70, 0x3b, 0x4c, 0xec, 0x62, 0x75, 0x79, 0x20, 0x6c, 0x69, 0x20, 0x144, 0x79, 0xe8, 0x65, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b,
+0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x68, 0x3b, 0x6e, 0x3b, 0x68, 0x3b, 0x64, 0x3b, 0x62, 0x3b, 0x6d, 0x3b, 0x6c, 0x3b,
+0x64, 0x69, 0x3b, 0x14b, 0x67, 0x254, 0x6e, 0x3b, 0x73, 0x254, 0x14b, 0x3b, 0x64, 0x69, 0x253, 0x3b, 0x65, 0x6d, 0x69, 0x3b,
+0x65, 0x73, 0x254, 0x3b, 0x6d, 0x61, 0x64, 0x3b, 0x64, 0x69, 0x14b, 0x3b, 0x6e, 0x79, 0x25b, 0x74, 0x3b, 0x6d, 0x61, 0x79,
+0x3b, 0x74, 0x69, 0x6e, 0x3b, 0x65, 0x6c, 0xe1, 0x3b, 0x64, 0x69, 0x6d, 0x254, 0x301, 0x64, 0x69, 0x3b, 0x14b, 0x67, 0x254,
+0x6e, 0x64, 0x25b, 0x3b, 0x73, 0x254, 0x14b, 0x25b, 0x3b, 0x64, 0x69, 0x253, 0xe1, 0x253, 0xe1, 0x3b, 0x65, 0x6d, 0x69, 0x61,
+0x73, 0x65, 0x6c, 0x65, 0x3b, 0x65, 0x73, 0x254, 0x70, 0x25b, 0x73, 0x254, 0x70, 0x25b, 0x3b, 0x6d, 0x61, 0x64, 0x69, 0x253,
+0x25b, 0x301, 0x64, 0xed, 0x253, 0x25b, 0x301, 0x3b, 0x64, 0x69, 0x14b, 0x67, 0x69, 0x6e, 0x64, 0x69, 0x3b, 0x6e, 0x79, 0x25b,
+0x74, 0x25b, 0x6b, 0x69, 0x3b, 0x6d, 0x61, 0x79, 0xe9, 0x73, 0x25b, 0x301, 0x3b, 0x74, 0x69, 0x6e, 0xed, 0x6e, 0xed, 0x3b,
+0x65, 0x6c, 0xe1, 0x14b, 0x67, 0x25b, 0x301, 0x3b, 0x64, 0x3b, 0x14b, 0x3b, 0x73, 0x3b, 0x64, 0x3b, 0x65, 0x3b, 0x65, 0x3b,
+0x6d, 0x3b, 0x64, 0x3b, 0x6e, 0x3b, 0x6d, 0x3b, 0x74, 0x3b, 0x65, 0x3b, 0x53, 0x61, 0x3b, 0x46, 0x65, 0x3b, 0x4d, 0x61,
+0x3b, 0x41, 0x62, 0x3b, 0x4d, 0x65, 0x3b, 0x53, 0x75, 0x3b, 0x53, 0xfa, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x3b, 0x4f,
+0x6b, 0x3b, 0x4e, 0x6f, 0x3b, 0x44, 0x65, 0x3b, 0x53, 0x61, 0x6e, 0x76, 0x69, 0x65, 0x3b, 0x46, 0xe9, 0x62, 0x69, 0x72,
+0x69, 0x65, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x41, 0x62, 0x75, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x53,
+0x75, 0x65, 0x14b, 0x3b, 0x53, 0xfa, 0x75, 0x79, 0x65, 0x65, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x74, 0x74, 0x65, 0x6d,
+0x62, 0x61, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72,
+0x3b, 0x44, 0x69, 0x73, 0x61, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x53, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b,
+0x53, 0x3b, 0x53, 0x3b, 0x55, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6e, 0x67, 0x6f, 0x3b, 0x6e, 0x67,
+0x62, 0x3b, 0x6e, 0x67, 0x6c, 0x3b, 0x6e, 0x67, 0x6e, 0x3b, 0x6e, 0x67, 0x74, 0x3b, 0x6e, 0x67, 0x73, 0x3b, 0x6e, 0x67,
+0x7a, 0x3b, 0x6e, 0x67, 0x6d, 0x3b, 0x6e, 0x67, 0x65, 0x3b, 0x6e, 0x67, 0x61, 0x3b, 0x6e, 0x67, 0x61, 0x64, 0x3b, 0x6e,
+0x67, 0x61, 0x62, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x6f, 0x73, 0xfa, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x62, 0x25b,
+0x30c, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x6c, 0xe1, 0x6c, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x6e, 0x79, 0x69,
+0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x74, 0xe1, 0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x73, 0x61,
+0x6d, 0x259, 0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x7a, 0x61, 0x6d, 0x67, 0x62, 0xe1, 0x6c, 0x61, 0x3b, 0x6e,
+0x67, 0x254, 0x6e, 0x20, 0x6d, 0x77, 0x6f, 0x6d, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x65, 0x62, 0x75, 0x6c, 0xfa, 0x3b,
+0x6e, 0x67, 0x254, 0x6e, 0x20, 0x61, 0x77, 0xf3, 0x6d, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x61, 0x77, 0xf3, 0x6d, 0x20,
+0x61, 0x69, 0x20, 0x64, 0x7a, 0x69, 0xe1, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x61, 0x77, 0xf3, 0x6d, 0x20, 0x61, 0x69,
+0x20, 0x62, 0x25b, 0x30c, 0x3b, 0x6f, 0x3b, 0x62, 0x3b, 0x6c, 0x3b, 0x6e, 0x3b, 0x74, 0x3b, 0x73, 0x3b, 0x7a, 0x3b, 0x6d,
+0x3b, 0x65, 0x3b, 0x61, 0x3b, 0x64, 0x3b, 0x62, 0x3b, 0x14b, 0x31, 0x3b, 0x14b, 0x32, 0x3b, 0x14b, 0x33, 0x3b, 0x14b, 0x34,
+0x3b, 0x14b, 0x35, 0x3b, 0x14b, 0x36, 0x3b, 0x14b, 0x37, 0x3b, 0x14b, 0x38, 0x3b, 0x14b, 0x39, 0x3b, 0x14b, 0x31, 0x30, 0x3b,
+0x14b, 0x31, 0x31, 0x3b, 0x14b, 0x31, 0x32, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x20, 0x6e, 0x74, 0x254, 0x301, 0x6e,
+0x74, 0x254, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x62, 0x25b, 0x301, 0x25b, 0x3b, 0x14b, 0x77, 0xed,
+0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x72, 0xe1, 0xe1, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x6e,
+0x69, 0x6e, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x6e, 0x3b, 0x14b, 0x77, 0xed,
+0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x66, 0x254, 0x6b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b,
+0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x62, 0x25b, 0x25b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1,
+0x61, 0x72, 0x61, 0x61, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x6e, 0x69, 0x6e,
+0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x6e, 0x74, 0x25b, 0x6b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20,
+0x61, 0x6b, 0x1dd, 0x20, 0x6e, 0x74, 0x25b, 0x6b, 0x20, 0x64, 0x69, 0x20, 0x62, 0x254, 0x301, 0x6b, 0x3b, 0x14b, 0x77, 0xed,
+0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x6e, 0x74, 0x25b, 0x6b, 0x20, 0x64, 0x69, 0x20, 0x62, 0x25b, 0x301, 0x25b, 0x3b, 0x4b,
+0x77, 0x61, 0x3b, 0x55, 0x6e, 0x61, 0x3b, 0x52, 0x61, 0x72, 0x3b, 0x43, 0x68, 0x65, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x4d,
+0x6f, 0x63, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4e, 0x61, 0x6e, 0x3b, 0x54, 0x69, 0x73, 0x3b, 0x4b, 0x75, 0x6d, 0x3b, 0x4d,
+0x6f, 0x6a, 0x3b, 0x59, 0x65, 0x6c, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x6b, 0x77, 0x61, 0x6e,
+0x7a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x75, 0x6e, 0x61, 0x79, 0x65, 0x6c, 0x69, 0x3b,
+0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x75, 0x6e, 0x65, 0x72, 0x61, 0x72, 0x75, 0x3b, 0x4d, 0x77, 0x65,
+0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x75, 0x6e, 0x65, 0x63, 0x68, 0x65, 0x73, 0x68, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72,
+0x69, 0x20, 0x77, 0x6f, 0x20, 0x75, 0x6e, 0x65, 0x74, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20,
+0x77, 0x6f, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x75, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x63, 0x68, 0x61, 0x3b, 0x4d, 0x77,
+0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x73, 0x61, 0x62, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f,
+0x20, 0x6e, 0x61, 0x6e, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x74, 0x69, 0x73, 0x61, 0x3b,
+0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20,
+0x77, 0x6f, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72,
+0x69, 0x20, 0x77, 0x6f, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x79, 0x65, 0x6c, 0x2019, 0x6c, 0x69, 0x3b,
+0x4b, 0x3b, 0x55, 0x3b, 0x52, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4b, 0x3b,
+0x4d, 0x3b, 0x59, 0x3b, 0x46, 0x4c, 0x4f, 0x3b, 0x43, 0x4c, 0x41, 0x3b, 0x43, 0x4b, 0x49, 0x3b, 0x46, 0x4d, 0x46, 0x3b,
+0x4d, 0x41, 0x44, 0x3b, 0x4d, 0x42, 0x49, 0x3b, 0x4d, 0x4c, 0x49, 0x3b, 0x4d, 0x41, 0x4d, 0x3b, 0x46, 0x44, 0x45, 0x3b,
+0x46, 0x4d, 0x55, 0x3b, 0x46, 0x47, 0x57, 0x3b, 0x46, 0x59, 0x55, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x4c, 0x6f, 0x6f, 0x3b,
+0x43, 0x6f, 0x6b, 0x63, 0x77, 0x61, 0x6b, 0x6c, 0x61, 0x14b, 0x6e, 0x65, 0x3b, 0x43, 0x6f, 0x6b, 0x63, 0x77, 0x61, 0x6b,
+0x6c, 0x69, 0x69, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x4d, 0x61, 0x72, 0x66, 0x6f, 0x6f, 0x3b, 0x4d, 0x61, 0x64, 0x1dd, 0x1dd,
+0x75, 0x75, 0x74, 0x1dd, 0x62, 0x69, 0x6a, 0x61, 0x14b, 0x3b, 0x4d, 0x61, 0x6d, 0x1dd, 0x14b, 0x67, 0x77, 0xe3, 0x61, 0x66,
+0x61, 0x68, 0x62, 0x69, 0x69, 0x3b, 0x4d, 0x61, 0x6d, 0x1dd, 0x14b, 0x67, 0x77, 0xe3, 0x61, 0x6c, 0x69, 0x69, 0x3b, 0x4d,
+0x61, 0x64, 0x1dd, 0x6d, 0x62, 0x69, 0x69, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x44, 0x1dd, 0x253, 0x6c, 0x69, 0x69, 0x3b, 0x46,
+0x129, 0x69, 0x20, 0x4d, 0x75, 0x6e, 0x64, 0x61, 0x14b, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x47, 0x77, 0x61, 0x68, 0x6c, 0x6c,
+0x65, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x59, 0x75, 0x72, 0x75, 0x3b, 0x4f, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x46, 0x3b, 0x44,
+0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x55, 0x3b, 0x57, 0x3b, 0x59, 0x3b, 0x6e, 0x67, 0x31, 0x3b, 0x6e,
+0x67, 0x32, 0x3b, 0x6e, 0x67, 0x33, 0x3b, 0x6e, 0x67, 0x34, 0x3b, 0x6e, 0x67, 0x35, 0x3b, 0x6e, 0x67, 0x36, 0x3b, 0x6e,
+0x67, 0x37, 0x3b, 0x6e, 0x67, 0x38, 0x3b, 0x6e, 0x67, 0x39, 0x3b, 0x6e, 0x67, 0x31, 0x30, 0x3b, 0x6e, 0x67, 0x31, 0x31,
+0x3b, 0x6b, 0x72, 0x69, 0x73, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x6d, 0x61, 0x74, 0xe1, 0x68, 0x72, 0x61, 0x3b,
+0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x6d, 0x62, 0x61, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x6c, 0x61,
+0x6c, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x74,
+0x61, 0x6e, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x74, 0x75, 0xf3, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20,
+0x68, 0x25b, 0x6d, 0x62, 0x75, 0x25b, 0x72, 0xed, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x6c, 0x254, 0x6d, 0x62, 0x69,
+0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x72, 0x25b, 0x62, 0x76, 0x75, 0xe2, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20,
+0x77, 0x75, 0x6d, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x77, 0x75, 0x6d, 0x20, 0x6e, 0x61, 0x76, 0x1d4, 0x72, 0x3b,
+0x6b, 0x72, 0xed, 0x73, 0x69, 0x6d, 0x69, 0x6e, 0x3b, 0x54, 0x69, 0x6f, 0x70, 0x3b, 0x50, 0x25b, 0x74, 0x3b, 0x44, 0x75,
+0x254, 0x331, 0x254, 0x331, 0x3b, 0x47, 0x75, 0x61, 0x6b, 0x3b, 0x44, 0x75, 0xe4, 0x3b, 0x4b, 0x6f, 0x72, 0x3b, 0x50, 0x61,
+0x79, 0x3b, 0x54, 0x68, 0x6f, 0x6f, 0x3b, 0x54, 0x25b, 0x25b, 0x3b, 0x4c, 0x61, 0x61, 0x3b, 0x4b, 0x75, 0x72, 0x3b, 0x54,
+0x69, 0x64, 0x3b, 0x54, 0x69, 0x6f, 0x70, 0x20, 0x74, 0x68, 0x61, 0x72, 0x20, 0x70, 0x25b, 0x74, 0x3b, 0x50, 0x25b, 0x74,
+0x3b, 0x44, 0x75, 0x254, 0x331, 0x254, 0x331, 0x14b, 0x3b, 0x47, 0x75, 0x61, 0x6b, 0x3b, 0x44, 0x75, 0xe4, 0x74, 0x3b, 0x4b,
+0x6f, 0x72, 0x6e, 0x79, 0x6f, 0x6f, 0x74, 0x3b, 0x50, 0x61, 0x79, 0x20, 0x79, 0x69, 0x65, 0x331, 0x74, 0x6e, 0x69, 0x3b,
+0x54, 0x68, 0x6f, 0x331, 0x6f, 0x331, 0x72, 0x3b, 0x54, 0x25b, 0x25b, 0x72, 0x3b, 0x4c, 0x61, 0x61, 0x74, 0x68, 0x3b, 0x4b,
+0x75, 0x72, 0x3b, 0x54, 0x69, 0x6f, 0x331, 0x70, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x69, 0x331, 0x69, 0x331, 0x74, 0x3b, 0x54,
+0x3b, 0x50, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x44, 0x3b, 0x4b, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x4b,
+0x3b, 0x54, 0x3b, 0x422, 0x43e, 0x445, 0x441, 0x3b, 0x41e, 0x43b, 0x443, 0x43d, 0x3b, 0x41a, 0x43b, 0x43d, 0x3b, 0x41c, 0x441, 0x443,
+0x3b, 0x42b, 0x430, 0x43c, 0x3b, 0x411, 0x44d, 0x441, 0x3b, 0x41e, 0x442, 0x439, 0x3b, 0x410, 0x442, 0x440, 0x3b, 0x411, 0x43b, 0x495,
+0x3b, 0x410, 0x43b, 0x442, 0x3b, 0x421, 0x44d, 0x442, 0x3b, 0x410, 0x445, 0x441, 0x3b, 0x442, 0x43e, 0x445, 0x441, 0x443, 0x43d, 0x43d,
+0x44c, 0x443, 0x3b, 0x43e, 0x43b, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x3b, 0x43a, 0x443, 0x43b, 0x443, 0x43d, 0x20, 0x442, 0x443, 0x442,
+0x430, 0x440, 0x3b, 0x43c, 0x443, 0x443, 0x441, 0x20, 0x443, 0x441, 0x442, 0x430, 0x440, 0x3b, 0x44b, 0x430, 0x43c, 0x20, 0x44b, 0x439,
+0x430, 0x3b, 0x431, 0x44d, 0x441, 0x20, 0x44b, 0x439, 0x430, 0x3b, 0x43e, 0x442, 0x20, 0x44b, 0x439, 0x430, 0x3b, 0x430, 0x442, 0x44b,
+0x440, 0x434, 0x44c, 0x44b, 0x445, 0x20, 0x44b, 0x439, 0x430, 0x3b, 0x431, 0x430, 0x43b, 0x430, 0x495, 0x430, 0x43d, 0x20, 0x44b, 0x439,
+0x430, 0x3b, 0x430, 0x43b, 0x442, 0x44b, 0x43d, 0x43d, 0x44c, 0x44b, 0x3b, 0x441, 0x44d, 0x442, 0x438, 0x43d, 0x43d, 0x44c, 0x438, 0x3b,
+0x430, 0x445, 0x441, 0x44b, 0x43d, 0x43d, 0x44c, 0x44b, 0x3b, 0x422, 0x3b, 0x41e, 0x3b, 0x41a, 0x3b, 0x41c, 0x3b, 0x42b, 0x3b, 0x411,
+0x3b, 0x41e, 0x3b, 0x410, 0x3b, 0x411, 0x3b, 0x410, 0x3b, 0x421, 0x3b, 0x410, 0x3b, 0x422, 0x43e, 0x445, 0x441, 0x443, 0x43d, 0x43d,
+0x44c, 0x443, 0x3b, 0x41e, 0x43b, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x3b, 0x41a, 0x443, 0x43b, 0x443, 0x43d, 0x20, 0x442, 0x443, 0x442,
+0x430, 0x440, 0x3b, 0x41c, 0x443, 0x443, 0x441, 0x20, 0x443, 0x441, 0x442, 0x430, 0x440, 0x3b, 0x42b, 0x430, 0x43c, 0x20, 0x44b, 0x439,
+0x44b, 0x43d, 0x3b, 0x411, 0x44d, 0x441, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x41e, 0x442, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b,
+0x410, 0x442, 0x44b, 0x440, 0x434, 0x44c, 0x44b, 0x445, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x411, 0x430, 0x43b, 0x430, 0x495, 0x430,
+0x43d, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x410, 0x43b, 0x442, 0x44b, 0x43d, 0x43d, 0x44c, 0x44b, 0x3b, 0x421, 0x44d, 0x442, 0x438,
+0x43d, 0x43d, 0x44c, 0x438, 0x3b, 0x430, 0x445, 0x441, 0x44b, 0x43d, 0x43d, 0x44c, 0x44b, 0x3b, 0x4d, 0x75, 0x70, 0x3b, 0x4d, 0x77,
+0x69, 0x3b, 0x4d, 0x73, 0x68, 0x3b, 0x4d, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x67, 0x3b, 0x4d, 0x75, 0x6a, 0x3b, 0x4d, 0x73,
+0x70, 0x3b, 0x4d, 0x70, 0x67, 0x3b, 0x4d, 0x79, 0x65, 0x3b, 0x4d, 0x6f, 0x6b, 0x3b, 0x4d, 0x75, 0x73, 0x3b, 0x4d, 0x75,
+0x68, 0x3b, 0x4d, 0x75, 0x70, 0x61, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x6c, 0x77, 0x61, 0x3b, 0x4d, 0x77, 0x69, 0x74, 0x6f,
+0x70, 0x65, 0x3b, 0x4d, 0x75, 0x73, 0x68, 0x65, 0x6e, 0x64, 0x65, 0x3b, 0x4d, 0x75, 0x6e, 0x79, 0x69, 0x3b, 0x4d, 0x75,
+0x73, 0x68, 0x65, 0x6e, 0x64, 0x65, 0x20, 0x4d, 0x61, 0x67, 0x61, 0x6c, 0x69, 0x3b, 0x4d, 0x75, 0x6a, 0x69, 0x6d, 0x62,
+0x69, 0x3b, 0x4d, 0x75, 0x73, 0x68, 0x69, 0x70, 0x65, 0x70, 0x6f, 0x3b, 0x4d, 0x75, 0x70, 0x75, 0x67, 0x75, 0x74, 0x6f,
+0x3b, 0x4d, 0x75, 0x6e, 0x79, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x4d, 0x6f, 0x6b, 0x68, 0x75, 0x3b, 0x4d, 0x75, 0x73, 0x6f,
+0x6e, 0x67, 0x61, 0x6e, 0x64, 0x65, 0x6d, 0x62, 0x77, 0x65, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0xa5a8,
+0xa595, 0xa51e, 0x3b, 0xa552, 0xa561, 0x3b, 0xa57e, 0xa5ba, 0x3b, 0xa5a2, 0xa595, 0x3b, 0xa591, 0xa571, 0x3b, 0xa5b1, 0xa60b, 0x3b, 0xa5b1, 0xa55e,
+0x3b, 0xa5db, 0xa515, 0x3b, 0xa562, 0xa54c, 0x3b, 0xa56d, 0xa583, 0x3b, 0xa51e, 0xa60b, 0x3b, 0xa5a8, 0xa595, 0xa5cf, 0x3b, 0xa5a8, 0xa595, 0x20,
+0xa56a, 0xa574, 0x20, 0xa51e, 0xa500, 0xa56e, 0xa54a, 0x3b, 0xa552, 0xa561, 0xa59d, 0xa595, 0x3b, 0xa57e, 0xa5ba, 0x3b, 0xa5a2, 0xa595, 0x3b, 0xa591,
+0xa571, 0x3b, 0xa5b1, 0xa60b, 0x3b, 0xa5b1, 0xa55e, 0xa524, 0x3b, 0xa5db, 0xa515, 0x3b, 0xa562, 0xa54c, 0x3b, 0xa56d, 0xa583, 0x3b, 0xa51e, 0xa60b,
+0xa554, 0xa57f, 0x20, 0xa578, 0xa583, 0xa5cf, 0x3b, 0xa5a8, 0xa595, 0x20, 0xa56a, 0xa574, 0x20, 0xa5cf, 0xa5ba, 0xa56e, 0xa54a, 0x3b, 0x6c, 0x75,
+0x75, 0x6b, 0x61, 0x6f, 0x20, 0x6b, 0x65, 0x6d, 0xe3, 0x3b, 0x253, 0x61, 0x6e, 0x64, 0x61, 0x253, 0x75, 0x3b, 0x76, 0x254,
+0x254, 0x3b, 0x66, 0x75, 0x6c, 0x75, 0x3b, 0x67, 0x6f, 0x6f, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x6b, 0x254, 0x6e, 0x64, 0x65,
+0x3b, 0x73, 0x61, 0x61, 0x68, 0x3b, 0x67, 0x61, 0x6c, 0x6f, 0x3b, 0x6b, 0x65, 0x6e, 0x70, 0x6b, 0x61, 0x74, 0x6f, 0x20,
+0x253, 0x6f, 0x6c, 0x6f, 0x6c, 0x254, 0x3b, 0x6c, 0x75, 0x75, 0x6b, 0x61, 0x6f, 0x20, 0x6c, 0x254, 0x6d, 0x61, 0x3b, 0x4a,
+0x65, 0x6e, 0x3b, 0x48, 0x6f, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x42,
+0x72, 0xe1, 0x3b, 0x48, 0x65, 0x69, 0x3b, 0xd6, 0x69, 0x67, 0x3b, 0x48, 0x65, 0x72, 0x3b, 0x57, 0xed, 0x6d, 0x3b, 0x57,
+0x69, 0x6e, 0x3b, 0x43, 0x68, 0x72, 0x3b, 0x4a, 0x65, 0x6e, 0x6e, 0x65, 0x72, 0x3b, 0x48, 0x6f, 0x72, 0x6e, 0x69, 0x67,
+0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x65, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x6c, 0x65, 0x3b, 0x4d, 0x65, 0x69, 0x6a, 0x65,
+0x3b, 0x42, 0x72, 0xe1, 0x10d, 0x65, 0x74, 0x3b, 0x48, 0x65, 0x69, 0x77, 0x65, 0x74, 0x3b, 0xd6, 0x69, 0x67, 0x161, 0x74,
+0x65, 0x3b, 0x48, 0x65, 0x72, 0x62, 0x161, 0x74, 0x6d, 0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x57, 0xed, 0x6d, 0xe1, 0x6e, 0x65,
+0x74, 0x3b, 0x57, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x43, 0x68, 0x72, 0x69, 0x161, 0x74,
+0x6d, 0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x4a, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x42, 0x3b, 0x48, 0x3b,
+0xd6, 0x3b, 0x48, 0x3b, 0x57, 0x3b, 0x57, 0x3b, 0x43, 0x3b, 0x6f, 0x2e, 0x31, 0x3b, 0x6f, 0x2e, 0x32, 0x3b, 0x6f, 0x2e,
+0x33, 0x3b, 0x6f, 0x2e, 0x34, 0x3b, 0x6f, 0x2e, 0x35, 0x3b, 0x6f, 0x2e, 0x36, 0x3b, 0x6f, 0x2e, 0x37, 0x3b, 0x6f, 0x2e,
+0x38, 0x3b, 0x6f, 0x2e, 0x39, 0x3b, 0x6f, 0x2e, 0x31, 0x30, 0x3b, 0x6f, 0x2e, 0x31, 0x31, 0x3b, 0x6f, 0x2e, 0x31, 0x32,
+0x3b, 0x70, 0x69, 0x6b, 0xed, 0x74, 0xed, 0x6b, 0xed, 0x74, 0x69, 0x65, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0xed, 0x20, 0xfa,
+0x20, 0x6b, 0x75, 0x74, 0xfa, 0x61, 0x6e, 0x3b, 0x73, 0x69, 0x25b, 0x79, 0x25b, 0x301, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69,
+0x20, 0xfa, 0x20, 0x6b, 0xe1, 0x6e, 0x64, 0xed, 0x25b, 0x3b, 0x254, 0x6e, 0x73, 0xfa, 0x6d, 0x62, 0x254, 0x6c, 0x2c, 0x20,
+0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe1, 0x74, 0xe1, 0x74, 0xfa, 0x25b, 0x3b, 0x6d, 0x65, 0x73, 0x69, 0x14b,
+0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe9, 0x6e, 0x69, 0x65, 0x3b, 0x65, 0x6e, 0x73, 0x69, 0x6c,
+0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe1, 0x74, 0xe1, 0x6e, 0x75, 0x25b, 0x3b, 0x254, 0x73, 0x254,
+0x6e, 0x3b, 0x65, 0x66, 0x75, 0x74, 0x65, 0x3b, 0x70, 0x69, 0x73, 0x75, 0x79, 0xfa, 0x3b, 0x69, 0x6d, 0x25b, 0x14b, 0x20,
+0x69, 0x20, 0x70, 0x75, 0x254, 0x73, 0x3b, 0x69, 0x6d, 0x25b, 0x14b, 0x20, 0x69, 0x20, 0x70, 0x75, 0x74, 0xfa, 0x6b, 0x2c,
+0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe1, 0x74, 0xed, 0x25b, 0x3b, 0x6d, 0x61, 0x6b, 0x61, 0x6e, 0x64, 0x69,
+0x6b, 0x25b, 0x3b, 0x70, 0x69, 0x6c, 0x254, 0x6e, 0x64, 0x254, 0x301, 0x3b, 0x58, 0x69, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b,
+0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x58, 0x75, 0x6e, 0x3b, 0x58, 0x6e, 0x74, 0x3b,
+0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x63, 0x68, 0x3b, 0x50, 0x61, 0x79, 0x3b, 0x41, 0x76, 0x69, 0x3b,
+0x78, 0x69, 0x6e, 0x65, 0x72, 0x75, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x75, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x75,
+0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x75, 0x3b, 0x78, 0x75, 0x6e, 0x75, 0x3b, 0x78, 0x75, 0x6e,
+0x65, 0x74, 0x75, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x75, 0x3b, 0x73, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65,
+0x3b, 0x6f, 0x63, 0x68, 0x6f, 0x62, 0x72, 0x65, 0x3b, 0x70, 0x61, 0x79, 0x61, 0x72, 0x65, 0x73, 0x3b, 0x61, 0x76, 0x69,
+0x65, 0x6e, 0x74, 0x75, 0x3b, 0x58, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x58, 0x3b, 0x58, 0x3b, 0x41,
+0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x50, 0x3b, 0x41, 0x3b, 0x78, 0x69, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72,
+0x3b, 0x61, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x78, 0x75, 0x6e, 0x3b, 0x78, 0x6e, 0x74, 0x3b, 0x61, 0x67, 0x6f,
+0x3b, 0x73, 0x65, 0x74, 0x3b, 0x6f, 0x63, 0x68, 0x3b, 0x70, 0x61, 0x79, 0x3b, 0x61, 0x76, 0x69, 0x3b, 0x64, 0x65, 0x20,
+0x78, 0x69, 0x6e, 0x65, 0x72, 0x75, 0x3b, 0x64, 0x65, 0x20, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x75, 0x3b, 0x64, 0x65,
+0x20, 0x6d, 0x61, 0x72, 0x7a, 0x75, 0x3b, 0x64, 0x2019, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61,
+0x79, 0x75, 0x3b, 0x64, 0x65, 0x20, 0x78, 0x75, 0x6e, 0x75, 0x3b, 0x64, 0x65, 0x20, 0x78, 0x75, 0x6e, 0x65, 0x74, 0x75,
+0x3b, 0x64, 0x2019, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x75, 0x3b, 0x64, 0x65, 0x20, 0x73, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62,
+0x72, 0x65, 0x3b, 0x64, 0x2019, 0x6f, 0x63, 0x68, 0x6f, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x65, 0x20, 0x70, 0x61, 0x79, 0x61,
+0x72, 0x65, 0x73, 0x3b, 0x64, 0x2019, 0x61, 0x76, 0x69, 0x65, 0x6e, 0x74, 0x75, 0x3b, 0x4e, 0x64, 0x75, 0x14b, 0x6d, 0x62,
+0x69, 0x20, 0x53, 0x61, 0x14b, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x70, 0xe1, 0x3b, 0x50, 0x25b,
+0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x74, 0xe1, 0x74, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301,
+0x6e, 0x25b, 0x301, 0x6b, 0x77, 0x61, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x61, 0x74, 0x61, 0x61, 0x3b, 0x50,
+0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e, 0x25b, 0x301, 0x6e, 0x74, 0xfa, 0x6b, 0xfa, 0x3b, 0x50, 0x25b, 0x73,
+0x61, 0x14b, 0x20, 0x53, 0x61, 0x61, 0x6d, 0x62, 0xe1, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e,
+0x25b, 0x301, 0x66, 0x254, 0x6d, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e, 0x25b, 0x301, 0x70, 0x66,
+0xfa, 0xa78b, 0xfa, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x4e, 0x25b, 0x67, 0x25b, 0x301, 0x6d, 0x3b, 0x50, 0x25b, 0x73,
+0x61, 0x14b, 0x20, 0x4e, 0x74, 0x73, 0x254, 0x30c, 0x70, 0x6d, 0x254, 0x301, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x4e,
+0x74, 0x73, 0x254, 0x30c, 0x70, 0x70, 0xe1, 0x3b, 0x70, 0x61, 0x6d, 0x62, 0x61, 0x3b, 0x77, 0x61, 0x6e, 0x6a, 0x61, 0x3b,
+0x6d, 0x62, 0x69, 0x79, 0x254, 0x20, 0x6d, 0x25b, 0x6e, 0x64, 0x6f, 0x14b, 0x67, 0x254, 0x3b, 0x4e, 0x79, 0x254, 0x6c, 0x254,
+0x6d, 0x62, 0x254, 0x14b, 0x67, 0x254, 0x3b, 0x4d, 0x254, 0x6e, 0x254, 0x20, 0x14b, 0x67, 0x62, 0x61, 0x6e, 0x6a, 0x61, 0x3b,
+0x4e, 0x79, 0x61, 0x14b, 0x67, 0x77, 0x25b, 0x20, 0x14b, 0x67, 0x62, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x6b, 0x75, 0x14b, 0x67,
+0x77, 0x25b, 0x3b, 0x66, 0x25b, 0x3b, 0x6e, 0x6a, 0x61, 0x70, 0x69, 0x3b, 0x6e, 0x79, 0x75, 0x6b, 0x75, 0x6c, 0x3b, 0x31,
+0x31, 0x3b, 0x253, 0x75, 0x6c, 0x253, 0x75, 0x73, 0x25b, 0x3b, 0x6d, 0x62, 0x65, 0x67, 0x74, 0x75, 0x67, 0x3b, 0x69, 0x6d,
+0x65, 0x67, 0x20, 0xe0, 0x62, 0xf9, 0x62, 0xec, 0x3b, 0x69, 0x6d, 0x65, 0x67, 0x20, 0x6d, 0x62, 0x259, 0x14b, 0x63, 0x68,
+0x75, 0x62, 0x69, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6e, 0x67, 0x77, 0x259, 0x300, 0x74, 0x3b, 0x69, 0x6d, 0x259, 0x67,
+0x20, 0x66, 0x6f, 0x67, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x69, 0x63, 0x68, 0x69, 0x69, 0x62, 0x254, 0x64, 0x3b, 0x69,
+0x6d, 0x259, 0x67, 0x20, 0xe0, 0x64, 0xf9, 0x6d, 0x62, 0x259, 0x300, 0x14b, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x69, 0x63,
+0x68, 0x69, 0x6b, 0x61, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6b, 0x75, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x74,
+0xe8, 0x73, 0x69, 0x2bc, 0x65, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x7a, 0xf2, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6b,
+0x72, 0x69, 0x7a, 0x6d, 0x65, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6d, 0x62, 0x65, 0x67, 0x74, 0x75, 0x67, 0x3b,
+0x69, 0x6d, 0x65, 0x67, 0x20, 0xe0, 0x62, 0xf9, 0x62, 0xec, 0x3b, 0x69, 0x6d, 0x65, 0x67, 0x20, 0x6d, 0x62, 0x259, 0x14b,
+0x63, 0x68, 0x75, 0x62, 0x69, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6e, 0x67, 0x77, 0x259, 0x300, 0x74, 0x3b, 0x69, 0x6d,
+0x259, 0x67, 0x20, 0x66, 0x6f, 0x67, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x69, 0x63, 0x68, 0x69, 0x69, 0x62, 0x254, 0x64,
+0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0xe0, 0x64, 0xf9, 0x6d, 0x62, 0x259, 0x300, 0x14b, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20,
+0x69, 0x63, 0x68, 0x69, 0x6b, 0x61, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6b, 0x75, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67,
+0x20, 0x74, 0xe8, 0x73, 0x69, 0x2bc, 0x65, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x7a, 0xf2, 0x3b, 0x69, 0x6d, 0x259, 0x67,
+0x20, 0x6b, 0x72, 0x69, 0x7a, 0x6d, 0x65, 0x64, 0x3b, 0x4d, 0x31, 0x3b, 0x41, 0x32, 0x3b, 0x4d, 0x33, 0x3b, 0x4e, 0x34,
+0x3b, 0x46, 0x35, 0x3b, 0x49, 0x36, 0x3b, 0x41, 0x37, 0x3b, 0x49, 0x38, 0x3b, 0x4b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31,
+0x31, 0x3b, 0x31, 0x32, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x74, 0x73, 0x65, 0x74, 0x73, 0x25b, 0x300, 0x25b, 0x20, 0x6c, 0xf9,
+0x6d, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6b, 0xe0, 0x67, 0x20, 0x6e, 0x67, 0x77, 0xf3, 0x14b, 0x3b, 0x73, 0x61, 0x14b, 0x20,
+0x6c, 0x65, 0x70, 0x79, 0xe8, 0x20, 0x73, 0x68, 0xfa, 0x6d, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x63, 0xff, 0xf3, 0x3b, 0x73,
+0x61, 0x14b, 0x20, 0x74, 0x73, 0x25b, 0x300, 0x25b, 0x20, 0x63, 0xff, 0xf3, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6e, 0x6a, 0xff,
+0x6f, 0x6c, 0xe1, 0x2bc, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x74, 0x79, 0x25b, 0x300, 0x62, 0x20, 0x74, 0x79, 0x25b, 0x300, 0x62,
+0x20, 0x6d, 0x62, 0x289, 0x300, 0x14b, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6d, 0x62, 0x289, 0x300, 0x14b, 0x3b, 0x73, 0x61, 0x14b,
+0x20, 0x6e, 0x67, 0x77, 0x254, 0x300, 0x2bc, 0x20, 0x6d, 0x62, 0xff, 0x25b, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x74, 0xe0, 0x14b,
+0x61, 0x20, 0x74, 0x73, 0x65, 0x74, 0x73, 0xe1, 0x2bc, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6d, 0x65, 0x6a, 0x77, 0x6f, 0x14b,
+0xf3, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6c, 0xf9, 0x6d, 0x3b, 0x57, 0x69, 0xf3, 0x74, 0x68, 0x65, 0x21f, 0x69, 0x6b, 0x61,
+0x20, 0x57, 0xed, 0x3b, 0x54, 0x68, 0x69, 0x79, 0xf3, 0x21f, 0x65, 0x79, 0x75, 0x14b, 0x6b, 0x61, 0x20, 0x57, 0xed, 0x3b,
+0x49, 0x161, 0x74, 0xe1, 0x77, 0x69, 0x10d, 0x68, 0x61, 0x79, 0x61, 0x7a, 0x61, 0x14b, 0x20, 0x57, 0xed, 0x3b, 0x50, 0x21f,
+0x65, 0x17e, 0xed, 0x74, 0x21f, 0x6f, 0x20, 0x57, 0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x77, 0xe1, 0x70, 0x65, 0x74, 0x21f,
+0x6f, 0x20, 0x57, 0xed, 0x3b, 0x57, 0xed, 0x70, 0x61, 0x7a, 0x75, 0x6b, 0x21f, 0x61, 0x2d, 0x77, 0x61, 0x161, 0x74, 0xe9,
+0x20, 0x57, 0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x70, 0x21f, 0xe1, 0x73, 0x61, 0x70, 0x61, 0x20, 0x57, 0xed, 0x3b, 0x57,
+0x61, 0x73, 0xfa, 0x74, 0x21f, 0x75, 0x14b, 0x20, 0x57, 0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x77, 0xe1, 0x70, 0x65, 0x1e7,
+0x69, 0x20, 0x57, 0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x77, 0xe1, 0x70, 0x65, 0x2d, 0x6b, 0x61, 0x73, 0x6e, 0xe1, 0x20,
+0x57, 0xed, 0x3b, 0x57, 0x61, 0x6e, 0xed, 0x79, 0x65, 0x74, 0x75, 0x20, 0x57, 0xed, 0x3b, 0x54, 0x21f, 0x61, 0x68, 0xe9,
+0x6b, 0x61, 0x70, 0x161, 0x75, 0x14b, 0x20, 0x57, 0xed, 0x3b, 0x6a9, 0x627, 0x646, 0x648, 0x648, 0x646, 0x6cc, 0x20, 0x62f, 0x648,
+0x648, 0x6d5, 0x645, 0x3b, 0x634, 0x648, 0x628, 0x627, 0x62a, 0x3b, 0x626, 0x627, 0x632, 0x627, 0x631, 0x3b, 0x646, 0x6cc, 0x633, 0x627,
+0x646, 0x3b, 0x626, 0x627, 0x6cc, 0x627, 0x631, 0x3b, 0x62d, 0x648, 0x632, 0x6d5, 0x6cc, 0x631, 0x627, 0x646, 0x3b, 0x62a, 0x6d5, 0x645,
+0x648, 0x648, 0x632, 0x3b, 0x626, 0x627, 0x628, 0x3b, 0x626, 0x6d5, 0x6cc, 0x644, 0x648, 0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x6cc,
+0x646, 0x6cc, 0x20, 0x6cc, 0x6d5, 0x6a9, 0x6d5, 0x645, 0x3b, 0x62a, 0x634, 0x631, 0x6cc, 0x646, 0x6cc, 0x20, 0x62f, 0x648, 0x648, 0x6d5,
+0x645, 0x3b, 0x6a9, 0x627, 0x646, 0x648, 0x646, 0x6cc, 0x20, 0x6cc, 0x6d5, 0x6a9, 0x6d5, 0x645, 0x3b, 0x6a9, 0x3b, 0x634, 0x3b, 0x626,
+0x3b, 0x646, 0x3b, 0x626, 0x3b, 0x62d, 0x3b, 0x62a, 0x3b, 0x626, 0x3b, 0x626, 0x3b, 0x62a, 0x3b, 0x62a, 0x3b, 0x6a9, 0x3b, 0x6a,
+0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x11b, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a,
+0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x77, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e,
+0x6f, 0x77, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61,
+0x72, 0x3b, 0x6d, 0x11b, 0x72, 0x63, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e,
+0x69, 0x6a, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x3b, 0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74,
+0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62,
+0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62,
+0x2e, 0x3b, 0x6d, 0x11b, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x2e, 0x3b, 0x6a, 0x75, 0x6e,
+0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x77, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74,
+0x2e, 0x3b, 0x6e, 0x6f, 0x77, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x61, 0x3b,
+0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x61, 0x3b, 0x6d, 0x11b, 0x72, 0x63, 0x61, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c,
+0x61, 0x3b, 0x6d, 0x61, 0x6a, 0x61, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a, 0x61, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x61,
+0x3b, 0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6f,
+0x6b, 0x74, 0x6f, 0x62, 0x72, 0x61, 0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x64, 0x65, 0x63, 0x65,
+0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x11b, 0x72, 0x3b, 0x61, 0x70, 0x72,
+0x3b, 0x6d, 0x65, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x77, 0x67, 0x3b, 0x73, 0x65, 0x70,
+0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x77, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b,
+0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x11b, 0x72, 0x63, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c, 0x3b, 0x6d,
+0x65, 0x6a, 0x61, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x3b, 0x61, 0x77, 0x67, 0x75,
+0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72,
+0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a,
+0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x11b, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d,
+0x65, 0x6a, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x77, 0x67, 0x2e, 0x3b, 0x73,
+0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x77, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a,
+0x61, 0x6e, 0x75, 0x61, 0x72, 0x61, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x61, 0x3b, 0x6d, 0x11b, 0x72, 0x63,
+0x61, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c, 0x61, 0x3b, 0x6d, 0x65, 0x6a, 0x65, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a, 0x61,
+0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x61, 0x3b, 0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x73, 0x65, 0x70, 0x74,
+0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x61, 0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62,
+0x72, 0x61, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x72, 0x61, 0x67, 0x3b, 0x77, 0x61, 0x73, 0x3b,
+0x70, 0x16b, 0x6c, 0x3b, 0x73, 0x61, 0x6b, 0x3b, 0x7a, 0x61, 0x6c, 0x3b, 0x73, 0x12b, 0x6d, 0x3b, 0x6c, 0x12b, 0x70, 0x3b,
+0x64, 0x61, 0x67, 0x3b, 0x73, 0x69, 0x6c, 0x3b, 0x73, 0x70, 0x61, 0x3b, 0x6c, 0x61, 0x70, 0x3b, 0x73, 0x61, 0x6c, 0x3b,
+0x72, 0x61, 0x67, 0x73, 0x3b, 0x77, 0x61, 0x73, 0x73, 0x61, 0x72, 0x69, 0x6e, 0x73, 0x3b, 0x70, 0x16b, 0x6c, 0x69, 0x73,
+0x3b, 0x73, 0x61, 0x6b, 0x6b, 0x69, 0x73, 0x3b, 0x7a, 0x61, 0x6c, 0x6c, 0x61, 0x77, 0x73, 0x3b, 0x73, 0x12b, 0x6d, 0x65,
+0x6e, 0x69, 0x73, 0x3b, 0x6c, 0x12b, 0x70, 0x61, 0x3b, 0x64, 0x61, 0x67, 0x67, 0x69, 0x73, 0x3b, 0x73, 0x69, 0x6c, 0x6c,
+0x69, 0x6e, 0x73, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x73, 0x3b, 0x6c, 0x61, 0x70, 0x6b, 0x72, 0x16b, 0x74,
+0x69, 0x73, 0x3b, 0x73, 0x61, 0x6c, 0x6c, 0x61, 0x77, 0x73, 0x3b, 0x52, 0x3b, 0x57, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x5a,
+0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x75, 0x111, 0x69, 0x76, 0x3b,
+0x6b, 0x75, 0x6f, 0x76, 0xe2, 0x3b, 0x6e, 0x6a, 0x75, 0x68, 0x10d, 0xe2, 0x3b, 0x63, 0x75, 0xe1, 0x14b, 0x75, 0x69, 0x3b,
+0x76, 0x79, 0x65, 0x73, 0x69, 0x3b, 0x6b, 0x65, 0x73, 0x69, 0x3b, 0x73, 0x79, 0x65, 0x69, 0x6e, 0x69, 0x3b, 0x70, 0x6f,
+0x72, 0x67, 0x65, 0x3b, 0x10d, 0x6f, 0x68, 0x10d, 0xe2, 0x3b, 0x72, 0x6f, 0x6f, 0x76, 0x76, 0xe2, 0x64, 0x3b, 0x73, 0x6b,
+0x61, 0x6d, 0x6d, 0xe2, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x6c, 0xe2, 0x3b, 0x75, 0x111, 0x111, 0xe2, 0x69, 0x76, 0x65, 0x6d,
+0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x6b, 0x75, 0x6f, 0x76, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x6e, 0x6a, 0x75, 0x68,
+0x10d, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x63, 0x75, 0xe1, 0x14b, 0x75, 0x69, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b,
+0x76, 0x79, 0x65, 0x73, 0x69, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x6b, 0x65, 0x73, 0x69, 0x6d, 0xe1, 0xe1, 0x6e, 0x75,
+0x3b, 0x73, 0x79, 0x65, 0x69, 0x6e, 0x69, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x70, 0x6f, 0x72, 0x67, 0x65, 0x6d, 0xe1,
+0xe1, 0x6e, 0x75, 0x3b, 0x10d, 0x6f, 0x68, 0x10d, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x72, 0x6f, 0x6f, 0x76, 0x76,
+0xe2, 0x64, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x73, 0x6b, 0x61, 0x6d, 0x6d, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b,
+0x6a, 0x75, 0x6f, 0x76, 0x6c, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x55, 0x3b, 0x4b, 0x3b, 0x4e, 0x4a, 0x3b, 0x43,
+0x3b, 0x56, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x50, 0x3b, 0x10c, 0x3b, 0x52, 0x3b, 0x53, 0x3b, 0x4a, 0x3b, 0x62c, 0x627, 0x646,
+0x6a4, 0x6cc, 0x6d5, 0x3b, 0x641, 0x626, 0x6a4, 0x631, 0x6cc, 0x6d5, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x622, 0x6a4, 0x631, 0x6cc,
+0x644, 0x3b, 0x645, 0x626, 0x6cc, 0x3b, 0x62c, 0x648, 0x659, 0x623, 0x646, 0x3b, 0x62c, 0x648, 0x659, 0x644, 0x627, 0x3b, 0x622, 0x6af,
+0x648, 0x633, 0x62a, 0x3b, 0x633, 0x626, 0x67e, 0x62a, 0x627, 0x645, 0x631, 0x3b, 0x626, 0x648, 0x6a9, 0x62a, 0x648, 0x6a4, 0x631, 0x3b,
+0x646, 0x648, 0x6a4, 0x627, 0x645, 0x631, 0x3b, 0x62f, 0x626, 0x633, 0x627, 0x645, 0x631, 0x3b, 0x45, 0x6e, 0x3b, 0x50, 0x65, 0x62,
+0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x48, 0x75, 0x6e, 0x3b, 0x48, 0x75, 0x6c,
+0x3b, 0x41, 0x67, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x62, 0x3b, 0x44, 0x69, 0x73, 0x3b,
+0x45, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x48, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b,
+0x4e, 0x3b, 0x44, 0x3b
+};
+// GENERATED PART ENDS HERE
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/corelib/time/qromancalendar_p.h b/src/corelib/time/qromancalendar_p.h
new file mode 100644
index 0000000000..49efb3df89
--- /dev/null
+++ b/src/corelib/time/qromancalendar_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QROMAN_CALENDAR_P_H
+#define QROMAN_CALENDAR_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of calendar implementations. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qcalendarbackend_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class Q_CORE_EXPORT QRomanCalendar : public QCalendarBackend
+{
+public:
+ // date queries:
+ int daysInMonth(int month, int year = QCalendar::Unspecified) const override;
+ int minimumDaysInMonth() const override;
+ // properties of the calendar
+ bool isLunar() const override;
+ bool isLuniSolar() const override;
+ bool isSolar() const override;
+protected:
+ // locale support:
+ const QCalendarLocale *localeMonthIndexData() const override;
+ const ushort *localeMonthData() const override;
+ // (The INTEGRITY compiler got upset at: using QCalendarBackend:QCalendarBackend;)
+ QRomanCalendar(const QString &name, QCalendar::System id = QCalendar::System::User)
+ : QCalendarBackend(name, id) {}
+};
+
+QT_END_NAMESPACE
+
+#endif // QROMAN_CALENDAR_P_H
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/time/qtimezone.cpp
index cbc6b50c98..ef323de14a 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/time/qtimezone.cpp
@@ -317,7 +317,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
Create a null/invalid time zone instance.
*/
-QTimeZone::QTimeZone() Q_DECL_NOTHROW
+QTimeZone::QTimeZone() noexcept
: d(0)
{
}
diff --git a/src/corelib/tools/qtimezone.h b/src/corelib/time/qtimezone.h
index 29d8a4dbe5..62ecee49bb 100644
--- a/src/corelib/tools/qtimezone.h
+++ b/src/corelib/time/qtimezone.h
@@ -89,7 +89,7 @@ public:
};
typedef QVector<OffsetData> OffsetDataList;
- QTimeZone() Q_DECL_NOTHROW;
+ QTimeZone() noexcept;
explicit QTimeZone(const QByteArray &ianaId);
explicit QTimeZone(int offsetSeconds);
/*implicit*/ QTimeZone(const QByteArray &zoneId, int offsetSeconds, const QString &name,
@@ -99,11 +99,9 @@ public:
~QTimeZone();
QTimeZone &operator=(const QTimeZone &other);
- #ifdef Q_COMPILER_RVALUE_REFS
- QTimeZone &operator=(QTimeZone &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QTimeZone &operator=(QTimeZone &&other) noexcept { swap(other); return *this; }
- void swap(QTimeZone &other) Q_DECL_NOTHROW
+ void swap(QTimeZone &other) noexcept
{ d.swap(other.d); }
bool operator==(const QTimeZone &other) const;
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/time/qtimezoneprivate.cpp
index 569b343187..569b343187 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/time/qtimezoneprivate.cpp
diff --git a/src/corelib/tools/qtimezoneprivate_android.cpp b/src/corelib/time/qtimezoneprivate_android.cpp
index be4f374fdd..be4f374fdd 100644
--- a/src/corelib/tools/qtimezoneprivate_android.cpp
+++ b/src/corelib/time/qtimezoneprivate_android.cpp
diff --git a/src/corelib/time/qtimezoneprivate_data_p.h b/src/corelib/time/qtimezoneprivate_data_p.h
new file mode 100644
index 0000000000..822af9c703
--- /dev/null
+++ b/src/corelib/time/qtimezoneprivate_data_p.h
@@ -0,0 +1,1262 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2013 John Layt <jlayt@kde.org>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#ifndef QTIMEZONEPRIVATE_DATA_P_H
+#define QTIMEZONEPRIVATE_DATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of internal files. This header file may change from version to version
+// without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/private/qglobal_p.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Windows Zone ID support, included in default base class build so can be used on all platforms,
+ e.g. an app running on Linux may need to communicate with a Windows Outlook server. These
+ tables can also be used to look-up Region Codes and UTC Offsets on platforms that don't directly
+ support them., e.g. Mac does not support availableTimeZones() filtering by region or offset.
+
+ Another data table is provided for generic UTC+00:00 format time zones to be used as a
+ fall-back if no system time zones are available (QT_NO_SYSTEMLOCALE is set) or for QDateTimes
+ with a QT:Spec of OffsetFromUTC
+
+ These tables are automatically adapted from the CLDR supplemental/windowsZones.xml data file
+ using a script in qtbase/util/locale_database. Please do not edit this data directly. In the
+ future if ICU is made a hard dependency then the ICU resource can be used directly and this
+ table removed
+*/
+
+struct QZoneData {
+ quint16 windowsIdKey; // Windows ID Key
+ quint16 country; // Country of IANA ID's, AnyCountry means No Country
+ quint16 ianaIdIndex; // All IANA ID's for the Windows ID and Country, space separated
+};
+
+struct QWindowsData {
+ quint16 windowsIdKey; // Windows ID Key
+ quint16 windowsIdIndex; // Windows ID Literal
+ quint16 ianaIdIndex; // Default IANA ID for the Windows ID
+ qint32 offsetFromUtc; // Standard Time Offset from UTC, used for quick look-ups
+};
+
+struct QUtcData {
+ quint16 ianaIdIndex; // IANA ID's
+ qint32 offsetFromUtc; // Offset form UTC is seconds
+};
+
+/*
+ COPYRIGHT AND PERMISSION NOTICE
+
+ Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under
+ the Terms of Use in http://www.unicode.org/copyright.html.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of the Unicode data files and any associated documentation (the "Data
+ Files") or Unicode software and any associated documentation (the "Software")
+ to deal in the Data Files or Software without restriction, including without
+ limitation the rights to use, copy, modify, merge, publish, distribute, and/or
+ sell copies of the Data Files or Software, and to permit persons to whom the
+ Data Files or Software are furnished to do so, provided that (a) the above
+ copyright notice(s) and this permission notice appear with all copies of the
+ Data Files or Software, (b) both the above copyright notice(s) and this
+ permission notice appear in associated documentation, and (c) there is clear
+ notice in each modified Data File or in the Software as well as in the
+ documentation associated with the Data File(s) or Software that the data or
+ software has been modified.
+*/
+
+// GENERATED PART STARTS HERE
+
+/*
+ This part of the file was generated on 2019-10-24 from the
+ Common Locale Data Repository v36 supplemental/windowsZones.xml file $Revision$
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this code: run cldr2qtimezone.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+// Windows ID Key, Country Enum, IANA ID Index
+static const QZoneData zoneDataTable[] = {
+ { 1, 1, 0 }, // Afghanistan Standard Time / Afghanistan
+ { 2, 225, 11 }, // Alaskan Standard Time / United States
+ { 3, 225, 106 }, // Aleutian Standard Time / United States
+ { 4, 178, 119 }, // Altai Standard Time / Russia
+ { 5, 17, 132 }, // Arab Standard Time / Bahrain
+ { 5, 115, 145 }, // Arab Standard Time / Kuwait
+ { 5, 175, 157 }, // Arab Standard Time / Qatar
+ { 5, 186, 168 }, // Arab Standard Time / Saudi Arabia
+ { 5, 237, 180 }, // Arab Standard Time / Yemen
+ { 6, 0, 190 }, // Arabian Standard Time / AnyCountry
+ { 6, 162, 200 }, // Arabian Standard Time / Oman
+ { 6, 223, 212 }, // Arabian Standard Time / United Arab Emirates
+ { 7, 103, 223 }, // Arabic Standard Time / Iraq
+ { 8, 10, 236 }, // Argentina Standard Time / Argentina
+ { 9, 178, 509 }, // Astrakhan Standard Time / Russia
+ { 10, 24, 543 }, // Atlantic Standard Time / Bermuda
+ { 10, 38, 560 }, // Atlantic Standard Time / Canada
+ { 10, 86, 628 }, // Atlantic Standard Time / Greenland
+ { 11, 13, 642 }, // AUS Central Standard Time / Australia
+ { 12, 13, 659 }, // Aus Central W. Standard Time / Australia
+ { 13, 13, 675 }, // AUS Eastern Standard Time / Australia
+ { 14, 15, 712 }, // Azerbaijan Standard Time / Azerbaijan
+ { 15, 86, 722 }, // Azores Standard Time / Greenland
+ { 15, 173, 743 }, // Azores Standard Time / Portugal
+ { 16, 30, 759 }, // Bahia Standard Time / Brazil
+ { 17, 18, 773 }, // Bangladesh Standard Time / Bangladesh
+ { 17, 25, 784 }, // Bangladesh Standard Time / Bhutan
+ { 18, 20, 797 }, // Belarus Standard Time / Belarus
+ { 19, 167, 810 }, // Bougainville Standard Time / Papua New Guinea
+ { 20, 38, 831 }, // Canada Central Standard Time / Canada
+ { 21, 0, 868 }, // Cape Verde Standard Time / AnyCountry
+ { 21, 39, 878 }, // Cape Verde Standard Time / Cape Verde
+ { 22, 11, 898 }, // Caucasus Standard Time / Armenia
+ { 23, 13, 911 }, // Cen. Australia Standard Time / Australia
+ { 24, 0, 952 }, // Central America Standard Time / AnyCountry
+ { 24, 22, 962 }, // Central America Standard Time / Belize
+ { 24, 52, 977 }, // Central America Standard Time / Costa Rica
+ { 24, 63, 996 }, // Central America Standard Time / Ecuador
+ { 24, 65, 1014 }, // Central America Standard Time / El Salvador
+ { 24, 90, 1034 }, // Central America Standard Time / Guatemala
+ { 24, 96, 1052 }, // Central America Standard Time / Honduras
+ { 24, 155, 1072 }, // Central America Standard Time / Nicaragua
+ { 25, 0, 1088 }, // Central Asia Standard Time / AnyCountry
+ { 25, 8, 1098 }, // Central Asia Standard Time / Antarctica
+ { 25, 31, 1116 }, // Central Asia Standard Time / British Indian Ocean Territory
+ { 25, 44, 1130 }, // Central Asia Standard Time / China
+ { 25, 110, 1142 }, // Central Asia Standard Time / Kazakhstan
+ { 25, 116, 1168 }, // Central Asia Standard Time / Kyrgyzstan
+ { 26, 30, 1181 }, // Central Brazilian Standard Time / Brazil
+ { 27, 2, 1217 }, // Central Europe Standard Time / Albania
+ { 27, 57, 1231 }, // Central Europe Standard Time / Czech Republic
+ { 27, 98, 1245 }, // Central Europe Standard Time / Hungary
+ { 27, 191, 1261 }, // Central Europe Standard Time / Slovakia
+ { 27, 192, 1279 }, // Central Europe Standard Time / Slovenia
+ { 27, 242, 1296 }, // Central Europe Standard Time / Montenegro
+ { 27, 243, 1313 }, // Central Europe Standard Time / Serbia
+ { 28, 27, 1329 }, // Central European Standard Time / Bosnia And Herzegowina
+ { 28, 54, 1345 }, // Central European Standard Time / Croatia
+ { 28, 127, 1359 }, // Central European Standard Time / Macedonia
+ { 28, 172, 1373 }, // Central European Standard Time / Poland
+ { 29, 0, 1387 }, // Central Pacific Standard Time / AnyCountry
+ { 29, 13, 1398 }, // Central Pacific Standard Time / Australia
+ { 29, 140, 1419 }, // Central Pacific Standard Time / Micronesia
+ { 29, 153, 1449 }, // Central Pacific Standard Time / New Caledonia
+ { 29, 193, 1464 }, // Central Pacific Standard Time / Solomon Islands
+ { 29, 229, 1484 }, // Central Pacific Standard Time / Vanuatu
+ { 30, 139, 1498 }, // Central Standard Time (Mexico) / Mexico
+ { 31, 0, 1574 }, // Central Standard Time / AnyCountry
+ { 31, 38, 1582 }, // Central Standard Time / Canada
+ { 31, 139, 1657 }, // Central Standard Time / Mexico
+ { 31, 225, 1675 }, // Central Standard Time / United States
+ { 32, 44, 1843 }, // China Standard Time / China
+ { 32, 97, 1857 }, // China Standard Time / Hong Kong
+ { 32, 126, 1872 }, // China Standard Time / Macau
+ { 33, 154, 1883 }, // Chatham Islands Standard Time / New Zealand
+ { 34, 55, 1899 }, // Cuba Standard Time / Cuba
+ { 35, 0, 1914 }, // Dateline Standard Time / AnyCountry
+ { 36, 0, 1925 }, // E. Africa Standard Time / AnyCountry
+ { 36, 8, 1935 }, // E. Africa Standard Time / Antarctica
+ { 36, 48, 1952 }, // E. Africa Standard Time / Comoros
+ { 36, 59, 1966 }, // E. Africa Standard Time / Djibouti
+ { 36, 67, 1982 }, // E. Africa Standard Time / Eritrea
+ { 36, 69, 1996 }, // E. Africa Standard Time / Ethiopia
+ { 36, 111, 2015 }, // E. Africa Standard Time / Kenya
+ { 36, 128, 2030 }, // E. Africa Standard Time / Madagascar
+ { 36, 138, 2050 }, // E. Africa Standard Time / Mayotte
+ { 36, 194, 2065 }, // E. Africa Standard Time / Somalia
+ { 36, 210, 2082 }, // E. Africa Standard Time / Tanzania
+ { 36, 221, 2103 }, // E. Africa Standard Time / Uganda
+ { 36, 254, 2118 }, // E. Africa Standard Time / South Sudan
+ { 37, 13, 2130 }, // E. Australia Standard Time / Australia
+ { 38, 141, 2168 }, // E. Europe Standard Time / Moldova
+ { 39, 30, 2184 }, // E. South America Standard Time / Brazil
+ { 40, 43, 2202 }, // Easter Island Standard Time / Chile
+ { 41, 0, 2217 }, // Eastern Standard Time / AnyCountry
+ { 41, 16, 2225 }, // Eastern Standard Time / Bahamas
+ { 41, 38, 2240 }, // Eastern Standard Time / Canada
+ { 41, 225, 2345 }, // Eastern Standard Time / United States
+ { 42, 139, 2502 }, // Eastern Standard Time (Mexico) / Mexico
+ { 43, 64, 2517 }, // Egypt Standard Time / Egypt
+ { 44, 178, 2530 }, // Ekaterinburg Standard Time / Russia
+ { 45, 72, 2549 }, // Fiji Standard Time / Fiji
+ { 46, 33, 2562 }, // FLE Standard Time / Bulgaria
+ { 46, 68, 2575 }, // FLE Standard Time / Estonia
+ { 46, 73, 2590 }, // FLE Standard Time / Finland
+ { 46, 118, 2606 }, // FLE Standard Time / Latvia
+ { 46, 124, 2618 }, // FLE Standard Time / Lithuania
+ { 46, 222, 2633 }, // FLE Standard Time / Ukraine
+ { 46, 248, 2679 }, // FLE Standard Time / Aland Islands
+ { 47, 81, 2696 }, // Georgian Standard Time / Georgia
+ { 48, 71, 2709 }, // GMT Standard Time / Faroe Islands
+ { 48, 75, 2725 }, // GMT Standard Time / Guernsey
+ { 48, 104, 2741 }, // GMT Standard Time / Ireland
+ { 48, 173, 2755 }, // GMT Standard Time / Portugal
+ { 48, 197, 2786 }, // GMT Standard Time / Spain
+ { 48, 224, 2802 }, // GMT Standard Time / United Kingdom
+ { 48, 251, 2816 }, // GMT Standard Time / Isle Of Man
+ { 48, 252, 2835 }, // GMT Standard Time / Jersey
+ { 49, 86, 2849 }, // Greenland Standard Time / Greenland
+ { 50, 34, 2865 }, // Greenwich Standard Time / Burkina Faso
+ { 50, 53, 2884 }, // Greenwich Standard Time / Ivory Coast
+ { 50, 80, 2899 }, // Greenwich Standard Time / Gambia
+ { 50, 83, 2913 }, // Greenwich Standard Time / Ghana
+ { 50, 91, 2926 }, // Greenwich Standard Time / Guinea
+ { 50, 92, 2941 }, // Greenwich Standard Time / Guinea Bissau
+ { 50, 99, 2955 }, // Greenwich Standard Time / Iceland
+ { 50, 121, 2974 }, // Greenwich Standard Time / Liberia
+ { 50, 132, 2990 }, // Greenwich Standard Time / Mali
+ { 50, 136, 3004 }, // Greenwich Standard Time / Mauritania
+ { 50, 187, 3022 }, // Greenwich Standard Time / Senegal
+ { 50, 189, 3035 }, // Greenwich Standard Time / Sierra Leone
+ { 50, 199, 3051 }, // Greenwich Standard Time / Saint Helena
+ { 50, 212, 3070 }, // Greenwich Standard Time / Togo
+ { 51, 56, 3082 }, // GTB Standard Time / Cyprus
+ { 51, 85, 3110 }, // GTB Standard Time / Greece
+ { 51, 177, 3124 }, // GTB Standard Time / Romania
+ { 52, 94, 3141 }, // Haiti Standard Time / Haiti
+ { 53, 0, 3164 }, // Hawaiian Standard Time / AnyCountry
+ { 53, 51, 3175 }, // Hawaiian Standard Time / Cook Islands
+ { 53, 77, 3193 }, // Hawaiian Standard Time / French Polynesia
+ { 53, 225, 3208 }, // Hawaiian Standard Time / United States
+ { 53, 226, 3225 }, // Hawaiian Standard Time / United States Minor Outlying Islands
+ { 54, 100, 3242 }, // India Standard Time / India
+ { 55, 102, 3256 }, // Iran Standard Time / Iran
+ { 56, 105, 3268 }, // Israel Standard Time / Israel
+ { 57, 109, 3283 }, // Jordan Standard Time / Jordan
+ { 58, 178, 3294 }, // Kaliningrad Standard Time / Russia
+ { 59, 114, 3313 }, // Korea Standard Time / South Korea
+ { 60, 122, 3324 }, // Libya Standard Time / Libya
+ { 61, 0, 3339 }, // Line Islands Standard Time / AnyCountry
+ { 61, 112, 3350 }, // Line Islands Standard Time / Kiribati
+ { 62, 13, 3369 }, // Lord Howe Standard Time / Australia
+ { 63, 178, 3389 }, // Magadan Standard Time / Russia
+ { 64, 43, 3402 }, // Magallanes Standard Time / Chile
+ { 65, 77, 3423 }, // Marquesas Standard Time / French Polynesia
+ { 66, 137, 3441 }, // Mauritius Standard Time / Mauritius
+ { 66, 176, 3458 }, // Mauritius Standard Time / Reunion
+ { 66, 188, 3473 }, // Mauritius Standard Time / Seychelles
+ { 67, 119, 3485 }, // Middle East Standard Time / Lebanon
+ { 68, 227, 3497 }, // Montevideo Standard Time / Uruguay
+ { 69, 145, 3516 }, // Morocco Standard Time / Morocco
+ { 69, 236, 3534 }, // Morocco Standard Time / Western Sahara
+ { 70, 139, 3550 }, // Mountain Standard Time (Mexico) / Mexico
+ { 71, 0, 3585 }, // Mountain Standard Time / AnyCountry
+ { 71, 38, 3593 }, // Mountain Standard Time / Canada
+ { 71, 139, 3667 }, // Mountain Standard Time / Mexico
+ { 71, 225, 3683 }, // Mountain Standard Time / United States
+ { 72, 46, 3712 }, // Myanmar Standard Time / Cocos Islands
+ { 72, 147, 3725 }, // Myanmar Standard Time / Myanmar
+ { 73, 178, 3738 }, // N. Central Asia Standard Time / Russia
+ { 74, 148, 3755 }, // Namibia Standard Time / Namibia
+ { 75, 150, 3771 }, // Nepal Standard Time / Nepal
+ { 76, 8, 3785 }, // New Zealand Standard Time / Antarctica
+ { 76, 154, 3804 }, // New Zealand Standard Time / New Zealand
+ { 77, 38, 3821 }, // Newfoundland Standard Time / Canada
+ { 78, 159, 3838 }, // Norfolk Standard Time / Norfolk Island
+ { 79, 178, 3854 }, // North Asia East Standard Time / Russia
+ { 80, 178, 3867 }, // North Asia Standard Time / Russia
+ { 81, 113, 3902 }, // North Korea Standard Time / North Korea
+ { 82, 178, 3917 }, // Omsk Standard Time / Russia
+ { 83, 43, 3927 }, // Pacific SA Standard Time / Chile
+ { 84, 0, 3944 }, // Pacific Standard Time / AnyCountry
+ { 84, 38, 3952 }, // Pacific Standard Time / Canada
+ { 84, 225, 4004 }, // Pacific Standard Time / United States
+ { 85, 139, 4024 }, // Pacific Standard Time (Mexico) / Mexico
+ { 86, 163, 4061 }, // Pakistan Standard Time / Pakistan
+ { 87, 168, 4074 }, // Paraguay Standard Time / Paraguay
+ { 88, 110, 4091 }, // Qyzylorda Standard Time / Kazakhstan
+ { 89, 21, 4106 }, // Romance Standard Time / Belgium
+ { 89, 58, 4122 }, // Romance Standard Time / Denmark
+ { 89, 74, 4140 }, // Romance Standard Time / France
+ { 89, 197, 4153 }, // Romance Standard Time / Spain
+ { 90, 178, 4180 }, // Russia Time Zone 3 / Russia
+ { 91, 178, 4194 }, // Russia Time Zone 10 / Russia
+ { 92, 178, 4213 }, // Russia Time Zone 11 / Russia
+ { 93, 178, 4240 }, // Russian Standard Time / Russia
+ { 93, 222, 4267 }, // Russian Standard Time / Ukraine
+ { 94, 0, 4285 }, // SA Eastern Standard Time / AnyCountry
+ { 94, 8, 4295 }, // SA Eastern Standard Time / Antarctica
+ { 94, 30, 4332 }, // SA Eastern Standard Time / Brazil
+ { 94, 70, 4411 }, // SA Eastern Standard Time / Falkland Islands
+ { 94, 76, 4428 }, // SA Eastern Standard Time / French Guiana
+ { 94, 202, 4444 }, // SA Eastern Standard Time / Suriname
+ { 95, 0, 4463 }, // SA Pacific Standard Time / AnyCountry
+ { 95, 30, 4473 }, // SA Pacific Standard Time / Brazil
+ { 95, 38, 4509 }, // SA Pacific Standard Time / Canada
+ { 95, 40, 4531 }, // SA Pacific Standard Time / Cayman Islands
+ { 95, 47, 4546 }, // SA Pacific Standard Time / Colombia
+ { 95, 63, 4561 }, // SA Pacific Standard Time / Ecuador
+ { 95, 107, 4579 }, // SA Pacific Standard Time / Jamaica
+ { 95, 166, 4595 }, // SA Pacific Standard Time / Panama
+ { 95, 169, 4610 }, // SA Pacific Standard Time / Peru
+ { 96, 0, 4623 }, // SA Western Standard Time / AnyCountry
+ { 96, 7, 4633 }, // SA Western Standard Time / Anguilla
+ { 96, 9, 4650 }, // SA Western Standard Time / Antigua And Barbuda
+ { 96, 12, 4666 }, // SA Western Standard Time / Aruba
+ { 96, 19, 4680 }, // SA Western Standard Time / Barbados
+ { 96, 26, 4697 }, // SA Western Standard Time / Bolivia
+ { 96, 30, 4712 }, // SA Western Standard Time / Brazil
+ { 96, 38, 4765 }, // SA Western Standard Time / Canada
+ { 96, 60, 4786 }, // SA Western Standard Time / Dominica
+ { 96, 61, 4803 }, // SA Western Standard Time / Dominican Republic
+ { 96, 87, 4825 }, // SA Western Standard Time / Grenada
+ { 96, 88, 4841 }, // SA Western Standard Time / Guadeloupe
+ { 96, 93, 4860 }, // SA Western Standard Time / Guyana
+ { 96, 135, 4875 }, // SA Western Standard Time / Martinique
+ { 96, 144, 4894 }, // SA Western Standard Time / Montserrat
+ { 96, 152, 4913 }, // SA Western Standard Time / Cura Sao
+ { 96, 174, 4929 }, // SA Western Standard Time / Puerto Rico
+ { 96, 180, 4949 }, // SA Western Standard Time / Saint Kitts And Nevis
+ { 96, 181, 4966 }, // SA Western Standard Time / Saint Lucia
+ { 96, 182, 4983 }, // SA Western Standard Time / Saint Vincent And The Grenadines
+ { 96, 215, 5002 }, // SA Western Standard Time / Trinidad And Tobago
+ { 96, 233, 5024 }, // SA Western Standard Time / British Virgin Islands
+ { 96, 234, 5040 }, // SA Western Standard Time / United States Virgin Islands
+ { 96, 244, 5058 }, // SA Western Standard Time / Saint Barthelemy
+ { 96, 245, 5080 }, // SA Western Standard Time / Saint Martin
+ { 96, 255, 5096 }, // SA Western Standard Time / Bonaire
+ { 96, 256, 5115 }, // SA Western Standard Time / Sint Maarten
+ { 97, 200, 5137 }, // Saint Pierre Standard Time / Saint Pierre And Miquelon
+ { 98, 178, 5154 }, // Sakhalin Standard Time / Russia
+ { 99, 183, 5168 }, // Samoa Standard Time / Samoa
+ { 100, 185, 5181 }, // Sao Tome Standard Time / Sao Tome And Principe
+ { 101, 178, 5197 }, // Saratov Standard Time / Russia
+ { 102, 0, 5212 }, // SE Asia Standard Time / AnyCountry
+ { 102, 8, 5222 }, // SE Asia Standard Time / Antarctica
+ { 102, 36, 5239 }, // SE Asia Standard Time / Cambodia
+ { 102, 45, 5255 }, // SE Asia Standard Time / Christmas Island
+ { 102, 101, 5272 }, // SE Asia Standard Time / Indonesia
+ { 102, 117, 5300 }, // SE Asia Standard Time / Laos
+ { 102, 211, 5315 }, // SE Asia Standard Time / Thailand
+ { 102, 232, 5328 }, // SE Asia Standard Time / Vietnam
+ { 103, 0, 5340 }, // Singapore Standard Time / AnyCountry
+ { 103, 8, 5350 }, // Singapore Standard Time / Antarctica
+ { 103, 32, 5367 }, // Singapore Standard Time / Brunei
+ { 103, 101, 5379 }, // Singapore Standard Time / Indonesia
+ { 103, 130, 5393 }, // Singapore Standard Time / Malaysia
+ { 103, 170, 5424 }, // Singapore Standard Time / Philippines
+ { 103, 190, 5436 }, // Singapore Standard Time / Singapore
+ { 104, 0, 5451 }, // South Africa Standard Time / AnyCountry
+ { 104, 28, 5461 }, // South Africa Standard Time / Botswana
+ { 104, 35, 5477 }, // South Africa Standard Time / Burundi
+ { 104, 49, 5494 }, // South Africa Standard Time / Congo Kinshasa
+ { 104, 120, 5512 }, // South Africa Standard Time / Lesotho
+ { 104, 129, 5526 }, // South Africa Standard Time / Malawi
+ { 104, 146, 5542 }, // South Africa Standard Time / Mozambique
+ { 104, 179, 5556 }, // South Africa Standard Time / Rwanda
+ { 104, 195, 5570 }, // South Africa Standard Time / South Africa
+ { 104, 204, 5590 }, // South Africa Standard Time / Swaziland
+ { 104, 239, 5605 }, // South Africa Standard Time / Zambia
+ { 104, 240, 5619 }, // South Africa Standard Time / Zimbabwe
+ { 105, 198, 5633 }, // Sri Lanka Standard Time / Sri Lanka
+ { 106, 201, 5646 }, // Sudan Standard Time / Sudan
+ { 107, 207, 5662 }, // Syria Standard Time / Syria
+ { 108, 208, 5676 }, // Taipei Standard Time / Taiwan
+ { 109, 13, 5688 }, // Tasmania Standard Time / Australia
+ { 110, 30, 5722 }, // Tocantins Standard Time / Brazil
+ { 111, 0, 5740 }, // Tokyo Standard Time / AnyCountry
+ { 111, 62, 5750 }, // Tokyo Standard Time / East Timor
+ { 111, 101, 5760 }, // Tokyo Standard Time / Indonesia
+ { 111, 108, 5774 }, // Tokyo Standard Time / Japan
+ { 111, 164, 5785 }, // Tokyo Standard Time / Palau
+ { 112, 178, 5799 }, // Tomsk Standard Time / Russia
+ { 113, 214, 5810 }, // Tonga Standard Time / Tonga
+ { 114, 178, 5828 }, // Transbaikal Standard Time / Russia
+ { 115, 217, 5839 }, // Turkey Standard Time / Turkey
+ { 116, 219, 5855 }, // Turks And Caicos Standard Time / Turks And Caicos Islands
+ { 117, 143, 5874 }, // Ulaanbaatar Standard Time / Mongolia
+ { 118, 225, 5907 }, // US Eastern Standard Time / United States
+ { 119, 0, 5974 }, // US Mountain Standard Time / AnyCountry
+ { 119, 38, 5984 }, // US Mountain Standard Time / Canada
+ { 119, 139, 6041 }, // US Mountain Standard Time / Mexico
+ { 119, 225, 6060 }, // US Mountain Standard Time / United States
+ { 120, 0, 6076 }, // UTC-11 / AnyCountry
+ { 120, 4, 6087 }, // UTC-11 / American Samoa
+ { 120, 158, 6105 }, // UTC-11 / Niue
+ { 120, 226, 6118 }, // UTC-11 / United States Minor Outlying Islands
+ { 121, 0, 6133 }, // UTC-09 / AnyCountry
+ { 121, 77, 6143 }, // UTC-09 / French Polynesia
+ { 122, 0, 6159 }, // UTC-08 / AnyCountry
+ { 122, 171, 6169 }, // UTC-08 / Pitcairn
+ { 123, 0, 6186 }, // UTC-02 / AnyCountry
+ { 123, 30, 6196 }, // UTC-02 / Brazil
+ { 123, 196, 6212 }, // UTC-02 / South Georgia And The South Sandwich Islands
+ { 124, 0, 6235 }, // UTC / AnyCountry
+ { 124, 86, 6251 }, // UTC / Greenland
+ { 125, 0, 6272 }, // UTC+12 / AnyCountry
+ { 125, 112, 6283 }, // UTC+12 / Kiribati
+ { 125, 134, 6298 }, // UTC+12 / Marshall Islands
+ { 125, 149, 6331 }, // UTC+12 / Nauru
+ { 125, 220, 6345 }, // UTC+12 / Tuvalu
+ { 125, 226, 6362 }, // UTC+12 / United States Minor Outlying Islands
+ { 125, 235, 6375 }, // UTC+12 / Wallis And Futuna Islands
+ { 126, 0, 6390 }, // UTC+13 / AnyCountry
+ { 126, 112, 6401 }, // UTC+13 / Kiribati
+ { 126, 213, 6419 }, // UTC+13 / Tokelau
+ { 127, 231, 6435 }, // Venezuela Standard Time / Venezuela
+ { 128, 178, 6451 }, // Vladivostok Standard Time / Russia
+ { 129, 178, 6482 }, // Volgograd Standard Time / Russia
+ { 130, 13, 6499 }, // W. Australia Standard Time / Australia
+ { 131, 0, 6515 }, // W. Central Africa Standard Time / AnyCountry
+ { 131, 3, 6525 }, // W. Central Africa Standard Time / Algeria
+ { 131, 6, 6540 }, // W. Central Africa Standard Time / Angola
+ { 131, 23, 6554 }, // W. Central Africa Standard Time / Benin
+ { 131, 37, 6572 }, // W. Central Africa Standard Time / Cameroon
+ { 131, 41, 6586 }, // W. Central Africa Standard Time / Central African Republic
+ { 131, 42, 6600 }, // W. Central Africa Standard Time / Chad
+ { 131, 49, 6616 }, // W. Central Africa Standard Time / Congo Kinshasa
+ { 131, 50, 6632 }, // W. Central Africa Standard Time / Congo Brazzaville
+ { 131, 66, 6651 }, // W. Central Africa Standard Time / Equatorial Guinea
+ { 131, 79, 6665 }, // W. Central Africa Standard Time / Gabon
+ { 131, 156, 6683 }, // W. Central Africa Standard Time / Niger
+ { 131, 157, 6697 }, // W. Central Africa Standard Time / Nigeria
+ { 131, 216, 6710 }, // W. Central Africa Standard Time / Tunisia
+ { 132, 5, 6723 }, // W. Europe Standard Time / Andorra
+ { 132, 14, 6738 }, // W. Europe Standard Time / Austria
+ { 132, 82, 6752 }, // W. Europe Standard Time / Germany
+ { 132, 84, 6782 }, // W. Europe Standard Time / Gibraltar
+ { 132, 106, 6799 }, // W. Europe Standard Time / Italy
+ { 132, 123, 6811 }, // W. Europe Standard Time / Liechtenstein
+ { 132, 125, 6824 }, // W. Europe Standard Time / Luxembourg
+ { 132, 133, 6842 }, // W. Europe Standard Time / Malta
+ { 132, 142, 6855 }, // W. Europe Standard Time / Monaco
+ { 132, 151, 6869 }, // W. Europe Standard Time / Netherlands
+ { 132, 161, 6886 }, // W. Europe Standard Time / Norway
+ { 132, 184, 6898 }, // W. Europe Standard Time / San Marino
+ { 132, 203, 6916 }, // W. Europe Standard Time / Svalbard And Jan Mayen Islands
+ { 132, 205, 6936 }, // W. Europe Standard Time / Sweden
+ { 132, 206, 6953 }, // W. Europe Standard Time / Switzerland
+ { 132, 230, 6967 }, // W. Europe Standard Time / Vatican City State
+ { 133, 143, 6982 }, // W. Mongolia Standard Time / Mongolia
+ { 134, 0, 6992 }, // West Asia Standard Time / AnyCountry
+ { 134, 8, 7002 }, // West Asia Standard Time / Antarctica
+ { 134, 78, 7020 }, // West Asia Standard Time / French Southern Territories
+ { 134, 110, 7037 }, // West Asia Standard Time / Kazakhstan
+ { 134, 131, 7082 }, // West Asia Standard Time / Maldives
+ { 134, 209, 7098 }, // West Asia Standard Time / Tajikistan
+ { 134, 218, 7112 }, // West Asia Standard Time / Turkmenistan
+ { 134, 228, 7126 }, // West Asia Standard Time / Uzbekistan
+ { 135, 165, 7155 }, // West Bank Standard Time / Palestinian Territories
+ { 136, 0, 7177 }, // West Pacific Standard Time / AnyCountry
+ { 136, 8, 7188 }, // West Pacific Standard Time / Antarctica
+ { 136, 89, 7214 }, // West Pacific Standard Time / Guam
+ { 136, 140, 7227 }, // West Pacific Standard Time / Micronesia
+ { 136, 160, 7240 }, // West Pacific Standard Time / Northern Mariana Islands
+ { 136, 167, 7255 }, // West Pacific Standard Time / Papua New Guinea
+ { 137, 178, 7276 }, // Yakutsk Standard Time / Russia
+ { 0, 0, 0 } // Trailing zeroes
+};
+
+// Windows ID Key, Windows ID Index, IANA ID Index, UTC Offset
+static const QWindowsData windowsDataTable[] = {
+ { 1, 0, 0, 16200 }, // Afghanistan Standard Time
+ { 2, 26, 7303,-32400 }, // Alaskan Standard Time
+ { 3, 48, 106,-36000 }, // Aleutian Standard Time
+ { 4, 71, 119, 25200 }, // Altai Standard Time
+ { 5, 91, 168, 10800 }, // Arab Standard Time
+ { 6, 110, 212, 14400 }, // Arabian Standard Time
+ { 7, 132, 223, 10800 }, // Arabic Standard Time
+ { 8, 153, 7321,-10800 }, // Argentina Standard Time
+ { 9, 177, 7342, 14400 }, // Astrakhan Standard Time
+ { 10, 201, 7359,-14400 }, // Atlantic Standard Time
+ { 11, 224, 642, 34200 }, // AUS Central Standard Time
+ { 12, 250, 659, 31500 }, // Aus Central W. Standard Time
+ { 13, 279, 7375, 36000 }, // AUS Eastern Standard Time
+ { 14, 305, 712, 14400 }, // Azerbaijan Standard Time
+ { 15, 330, 743, -3600 }, // Azores Standard Time
+ { 16, 351, 759,-10800 }, // Bahia Standard Time
+ { 17, 371, 773, 21600 }, // Bangladesh Standard Time
+ { 18, 396, 797, 10800 }, // Belarus Standard Time
+ { 19, 418, 810, 39600 }, // Bougainville Standard Time
+ { 20, 445, 7392,-21600 }, // Canada Central Standard Time
+ { 21, 474, 878, -3600 }, // Cape Verde Standard Time
+ { 22, 499, 898, 14400 }, // Caucasus Standard Time
+ { 23, 522, 7407, 34200 }, // Cen. Australia Standard Time
+ { 24, 551, 1034,-21600 }, // Central America Standard Time
+ { 25, 581, 7426, 21600 }, // Central Asia Standard Time
+ { 26, 608, 7438,-14400 }, // Central Brazilian Standard Time
+ { 27, 640, 1245, 3600 }, // Central Europe Standard Time
+ { 28, 669, 1373, 3600 }, // Central European Standard Time
+ { 29, 700, 1464, 39600 }, // Central Pacific Standard Time
+ { 30, 730, 7453,-21600 }, // Central Standard Time (Mexico)
+ { 31, 761, 7473,-21600 }, // Central Standard Time
+ { 32, 783, 1843, 28800 }, // China Standard Time
+ { 33, 803, 1883, 45900 }, // Chatham Islands Standard Time
+ { 34, 833, 1899,-18000 }, // Cuba Standard Time
+ { 35, 852, 1914,-43200 }, // Dateline Standard Time
+ { 36, 875, 2015, 10800 }, // E. Africa Standard Time
+ { 37, 899, 7489, 36000 }, // E. Australia Standard Time
+ { 38, 926, 2168, 7200 }, // E. Europe Standard Time
+ { 39, 950, 2184,-10800 }, // E. South America Standard Time
+ { 40, 981, 2202,-21600 }, // Easter Island Standard Time
+ { 41, 1009, 7508,-18000 }, // Eastern Standard Time
+ { 42, 1031, 2502,-18000 }, // Eastern Standard Time (Mexico)
+ { 43, 1062, 2517, 7200 }, // Egypt Standard Time
+ { 44, 1082, 2530, 18000 }, // Ekaterinburg Standard Time
+ { 45, 1109, 2549, 43200 }, // Fiji Standard Time
+ { 46, 1128, 7525, 7200 }, // FLE Standard Time
+ { 47, 1146, 2696, 14400 }, // Georgian Standard Time
+ { 48, 1169, 2802, 0 }, // GMT Standard Time
+ { 49, 1187, 2849,-10800 }, // Greenland Standard Time
+ { 50, 1211, 2955, 0 }, // Greenwich Standard Time
+ { 51, 1235, 3124, 7200 }, // GTB Standard Time
+ { 52, 1253, 3141,-18000 }, // Haiti Standard Time
+ { 53, 1273, 3208,-36000 }, // Hawaiian Standard Time
+ { 54, 1296, 3242, 19800 }, // India Standard Time
+ { 55, 1316, 3256, 12600 }, // Iran Standard Time
+ { 56, 1335, 3268, 7200 }, // Israel Standard Time
+ { 57, 1356, 3283, 7200 }, // Jordan Standard Time
+ { 58, 1377, 3294, 7200 }, // Kaliningrad Standard Time
+ { 59, 1403, 3313, 32400 }, // Korea Standard Time
+ { 60, 1423, 3324, 7200 }, // Libya Standard Time
+ { 61, 1443, 3350, 50400 }, // Line Islands Standard Time
+ { 62, 1470, 3369, 37800 }, // Lord Howe Standard Time
+ { 63, 1494, 3389, 36000 }, // Magadan Standard Time
+ { 64, 1516, 3402,-10800 }, // Magallanes Standard Time
+ { 65, 1541, 3423,-34200 }, // Marquesas Standard Time
+ { 66, 1565, 3441, 14400 }, // Mauritius Standard Time
+ { 67, 1589, 3485, 7200 }, // Middle East Standard Time
+ { 68, 1615, 3497,-10800 }, // Montevideo Standard Time
+ { 69, 1640, 3516, 0 }, // Morocco Standard Time
+ { 70, 1662, 7537,-25200 }, // Mountain Standard Time (Mexico)
+ { 71, 1694, 7555,-25200 }, // Mountain Standard Time
+ { 72, 1717, 3725, 23400 }, // Myanmar Standard Time
+ { 73, 1739, 3738, 21600 }, // N. Central Asia Standard Time
+ { 74, 1769, 3755, 3600 }, // Namibia Standard Time
+ { 75, 1791, 3771, 20700 }, // Nepal Standard Time
+ { 76, 1811, 3804, 43200 }, // New Zealand Standard Time
+ { 77, 1837, 3821,-12600 }, // Newfoundland Standard Time
+ { 78, 1864, 3838, 39600 }, // Norfolk Standard Time
+ { 79, 1886, 3854, 28800 }, // North Asia East Standard Time
+ { 80, 1916, 7570, 25200 }, // North Asia Standard Time
+ { 81, 1941, 3902, 30600 }, // North Korea Standard Time
+ { 82, 1967, 3917, 21600 }, // Omsk Standard Time
+ { 83, 1986, 3927,-10800 }, // Pacific SA Standard Time
+ { 84, 2011, 4004,-28800 }, // Pacific Standard Time
+ { 85, 2033, 7587,-28800 }, // Pacific Standard Time (Mexico)
+ { 86, 2064, 4061, 18000 }, // Pakistan Standard Time
+ { 87, 2087, 4074,-14400 }, // Paraguay Standard Time
+ { 88, 2110, 4091, 18000 }, // Qyzylorda Standard Time
+ { 89, 2134, 4140, 3600 }, // Romance Standard Time
+ { 90, 2156, 4180, 14400 }, // Russia Time Zone 3
+ { 91, 2175, 4194, 39600 }, // Russia Time Zone 10
+ { 92, 2195, 7603, 43200 }, // Russia Time Zone 11
+ { 93, 2215, 7618, 10800 }, // Russian Standard Time
+ { 94, 2237, 4428,-10800 }, // SA Eastern Standard Time
+ { 95, 2262, 4546,-18000 }, // SA Pacific Standard Time
+ { 96, 2287, 4697,-14400 }, // SA Western Standard Time
+ { 97, 2312, 5137,-10800 }, // Saint Pierre Standard Time
+ { 98, 2339, 5154, 39600 }, // Sakhalin Standard Time
+ { 99, 2362, 5168, 46800 }, // Samoa Standard Time
+ { 100, 2382, 5181, 0 }, // Sao Tome Standard Time
+ { 101, 2405, 5197, 14400 }, // Saratov Standard Time
+ { 102, 2427, 5315, 25200 }, // SE Asia Standard Time
+ { 103, 2449, 5436, 28800 }, // Singapore Standard Time
+ { 104, 2473, 5570, 7200 }, // South Africa Standard Time
+ { 105, 2500, 5633, 19800 }, // Sri Lanka Standard Time
+ { 106, 2524, 5646, 7200 }, // Sudan Standard Time
+ { 107, 2544, 5662, 7200 }, // Syria Standard Time
+ { 108, 2564, 5676, 28800 }, // Taipei Standard Time
+ { 109, 2585, 7632, 36000 }, // Tasmania Standard Time
+ { 110, 2608, 5722,-10800 }, // Tocantins Standard Time
+ { 111, 2632, 5774, 32400 }, // Tokyo Standard Time
+ { 112, 2652, 5799, 25200 }, // Tomsk Standard Time
+ { 113, 2672, 5810, 46800 }, // Tonga Standard Time
+ { 114, 2692, 5828, 32400 }, // Transbaikal Standard Time
+ { 115, 2718, 5839, 7200 }, // Turkey Standard Time
+ { 116, 2739, 5855,-14400 }, // Turks And Caicos Standard Time
+ { 117, 2770, 7649, 28800 }, // Ulaanbaatar Standard Time
+ { 118, 2796, 7666,-18000 }, // US Eastern Standard Time
+ { 119, 2821, 6060,-25200 }, // US Mountain Standard Time
+ { 120, 2847, 6076,-39600 }, // UTC-11
+ { 121, 2854, 6133,-32400 }, // UTC-09
+ { 122, 2861, 6159,-28800 }, // UTC-08
+ { 123, 2868, 6186, -7200 }, // UTC-02
+ { 124, 2875, 7687, 0 }, // UTC
+ { 125, 2879, 6272, 43200 }, // UTC+12
+ { 126, 2886, 6390, 46800 }, // UTC+13
+ { 127, 2893, 6435,-16200 }, // Venezuela Standard Time
+ { 128, 2917, 7695, 36000 }, // Vladivostok Standard Time
+ { 129, 2943, 6482, 14400 }, // Volgograd Standard Time
+ { 130, 2967, 6499, 28800 }, // W. Australia Standard Time
+ { 131, 2994, 6697, 3600 }, // W. Central Africa Standard Time
+ { 132, 3026, 7712, 3600 }, // W. Europe Standard Time
+ { 133, 3050, 6982, 25200 }, // W. Mongolia Standard Time
+ { 134, 3076, 7726, 18000 }, // West Asia Standard Time
+ { 135, 3100, 7740, 7200 }, // West Bank Standard Time
+ { 136, 3124, 7255, 36000 }, // West Pacific Standard Time
+ { 137, 3151, 7752, 32400 }, // Yakutsk Standard Time
+ { 0, 0, 0, 0 } // Trailing zeroes
+};
+
+// IANA ID Index, UTC Offset
+static const QUtcData utcDataTable[] = {
+ { 7765, 0 }, // UTC
+ { 7769,-50400 }, // UTC-14:00
+ { 7779,-46800 }, // UTC-13:00
+ { 7789,-43200 }, // UTC-12:00
+ { 7799,-39600 }, // UTC-11:00
+ { 7809,-36000 }, // UTC-10:00
+ { 7819,-32400 }, // UTC-09:00
+ { 7829,-28800 }, // UTC-08:00
+ { 7839,-25200 }, // UTC-07:00
+ { 7849,-21600 }, // UTC-06:00
+ { 7859,-18000 }, // UTC-05:00
+ { 7869,-16200 }, // UTC-04:30
+ { 7879,-14400 }, // UTC-04:00
+ { 7889,-12600 }, // UTC-03:30
+ { 7899,-10800 }, // UTC-03:00
+ { 7909, -7200 }, // UTC-02:00
+ { 7919, -3600 }, // UTC-01:00
+ { 7929, 0 }, // UTC-00:00
+ { 7939, 0 }, // UTC+00:00
+ { 7949, 3600 }, // UTC+01:00
+ { 7959, 7200 }, // UTC+02:00
+ { 7969, 10800 }, // UTC+03:00
+ { 7979, 12600 }, // UTC+03:30
+ { 7989, 14400 }, // UTC+04:00
+ { 7999, 16200 }, // UTC+04:30
+ { 8009, 18000 }, // UTC+05:00
+ { 8019, 19800 }, // UTC+05:30
+ { 8029, 20700 }, // UTC+05:45
+ { 8039, 21600 }, // UTC+06:00
+ { 8049, 23400 }, // UTC+06:30
+ { 8059, 25200 }, // UTC+07:00
+ { 8069, 28800 }, // UTC+08:00
+ { 8079, 30600 }, // UTC+08:30
+ { 8089, 32400 }, // UTC+09:00
+ { 8099, 34200 }, // UTC+09:30
+ { 8109, 36000 }, // UTC+10:00
+ { 8119, 39600 }, // UTC+11:00
+ { 8129, 43200 }, // UTC+12:00
+ { 8139, 46800 }, // UTC+13:00
+ { 8149, 50400 }, // UTC+14:00
+ { 0, 0 } // Trailing zeroes
+};
+
+static const char windowsIdData[] = {
+0x41, 0x66, 0x67, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
+0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x6c, 0x61, 0x73, 0x6b, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
+0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x6c, 0x65, 0x75, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x6c, 0x74, 0x61, 0x69, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x61, 0x62, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x61, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x61, 0x62, 0x69, 0x63, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69,
+0x6e, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x73, 0x74,
+0x72, 0x61, 0x6b, 0x68, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
+0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
+0x69, 0x6d, 0x65, 0x0, 0x41, 0x55, 0x53, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x75, 0x73, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61,
+0x6c, 0x20, 0x57, 0x2e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41,
+0x55, 0x53, 0x20, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
+0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x7a, 0x65, 0x72, 0x62, 0x61, 0x69, 0x6a, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x7a, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x42, 0x61, 0x68, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x42, 0x61, 0x6e, 0x67, 0x6c, 0x61, 0x64, 0x65, 0x73,
+0x68, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x42, 0x65, 0x6c, 0x61,
+0x72, 0x75, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x42, 0x6f,
+0x75, 0x67, 0x61, 0x69, 0x6e, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
+0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20,
+0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x61, 0x70, 0x65, 0x20, 0x56,
+0x65, 0x72, 0x64, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43,
+0x61, 0x75, 0x63, 0x61, 0x73, 0x75, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
+0x65, 0x0, 0x43, 0x65, 0x6e, 0x2e, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
+0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
+0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x42, 0x72, 0x61, 0x7a,
+0x69, 0x6c, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
+0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x45, 0x75, 0x72,
+0x6f, 0x70, 0x65, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
+0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x29,
+0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
+0x6d, 0x65, 0x0, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
+0x6d, 0x65, 0x0, 0x43, 0x68, 0x61, 0x74, 0x68, 0x61, 0x6d, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x75, 0x62, 0x61, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x44, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6e, 0x65,
+0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x41, 0x66,
+0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45,
+0x2e, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
+0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
+0x0, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f,
+0x29, 0x0, 0x45, 0x67, 0x79, 0x70, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
+0x65, 0x0, 0x45, 0x6b, 0x61, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x62, 0x75, 0x72, 0x67, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x46, 0x69, 0x6a, 0x69, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
+0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x46, 0x4c, 0x45, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
+0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x65, 0x6f, 0x72, 0x67, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x4d, 0x54, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x77, 0x69, 0x63, 0x68,
+0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x54, 0x42, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x48, 0x61, 0x69, 0x74, 0x69, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x48, 0x61, 0x77, 0x61, 0x69, 0x69, 0x61,
+0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x49, 0x6e, 0x64, 0x69,
+0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x49, 0x72, 0x61, 0x6e,
+0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x49, 0x73, 0x72, 0x61, 0x65,
+0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4a, 0x6f, 0x72, 0x64,
+0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4b, 0x61, 0x6c,
+0x69, 0x6e, 0x69, 0x6e, 0x67, 0x72, 0x61, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
+0x6d, 0x65, 0x0, 0x4b, 0x6f, 0x72, 0x65, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
+0x6d, 0x65, 0x0, 0x4c, 0x69, 0x62, 0x79, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
+0x6d, 0x65, 0x0, 0x4c, 0x69, 0x6e, 0x65, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4c, 0x6f, 0x72, 0x64, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x20,
+0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x61, 0x67, 0x61, 0x64, 0x61,
+0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x61, 0x67, 0x61,
+0x6c, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
+0x0, 0x4d, 0x61, 0x72, 0x71, 0x75, 0x65, 0x73, 0x61, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
+0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x20, 0x45, 0x61, 0x73, 0x74,
+0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x6f, 0x6e, 0x74, 0x65,
+0x76, 0x69, 0x64, 0x65, 0x6f, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
+0x4d, 0x6f, 0x72, 0x6f, 0x63, 0x63, 0x6f, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
+0x65, 0x0, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
+0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x29, 0x0, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61,
+0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x79, 0x61,
+0x6e, 0x6d, 0x61, 0x72, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e,
+0x2e, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x65, 0x70, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61,
+0x6e, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x65, 0x77,
+0x66, 0x6f, 0x75, 0x6e, 0x64, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
+0x69, 0x6d, 0x65, 0x0, 0x4e, 0x6f, 0x72, 0x66, 0x6f, 0x6c, 0x6b, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
+0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x45, 0x61, 0x73,
+0x74, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x6f, 0x72, 0x74,
+0x68, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
+0x0, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x20, 0x4b, 0x6f, 0x72, 0x65, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4f, 0x6d, 0x73, 0x6b, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
+0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x41, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
+0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69,
+0x63, 0x6f, 0x29, 0x0, 0x50, 0x61, 0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x51, 0x79, 0x7a, 0x79, 0x6c, 0x6f, 0x72, 0x64, 0x61, 0x20,
+0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x52, 0x6f, 0x6d, 0x61, 0x6e, 0x63,
+0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x52, 0x75, 0x73, 0x73,
+0x69, 0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x5a, 0x6f, 0x6e, 0x65, 0x20, 0x33, 0x0, 0x52, 0x75, 0x73, 0x73, 0x69,
+0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x5a, 0x6f, 0x6e, 0x65, 0x20, 0x31, 0x30, 0x0, 0x52, 0x75, 0x73, 0x73, 0x69,
+0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x5a, 0x6f, 0x6e, 0x65, 0x20, 0x31, 0x31, 0x0, 0x52, 0x75, 0x73, 0x73, 0x69,
+0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x41, 0x20,
+0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
+0x65, 0x0, 0x53, 0x41, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x41, 0x20, 0x57, 0x65, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x61, 0x69, 0x6e, 0x74, 0x20, 0x50, 0x69,
+0x65, 0x72, 0x72, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53,
+0x61, 0x6b, 0x68, 0x61, 0x6c, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
+0x65, 0x0, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
+0x65, 0x0, 0x53, 0x61, 0x6f, 0x20, 0x54, 0x6f, 0x6d, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
+0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x76, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x45, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
+0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41,
+0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
+0x53, 0x72, 0x69, 0x20, 0x4c, 0x61, 0x6e, 0x6b, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
+0x69, 0x6d, 0x65, 0x0, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
+0x69, 0x6d, 0x65, 0x0, 0x53, 0x79, 0x72, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
+0x69, 0x6d, 0x65, 0x0, 0x54, 0x61, 0x69, 0x70, 0x65, 0x69, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
+0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x61, 0x73, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
+0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x6f, 0x63, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x73, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x6f, 0x6b, 0x79, 0x6f, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x6f, 0x6d, 0x73, 0x6b, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x20, 0x53, 0x74,
+0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x62, 0x61, 0x69,
+0x6b, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x75,
+0x72, 0x6b, 0x65, 0x79, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54,
+0x75, 0x72, 0x6b, 0x73, 0x20, 0x41, 0x6e, 0x64, 0x20, 0x43, 0x61, 0x69, 0x63, 0x6f, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x55, 0x6c, 0x61, 0x61, 0x6e, 0x62, 0x61, 0x61, 0x74, 0x61,
+0x72, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x55, 0x53, 0x20, 0x45,
+0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
+0x0, 0x55, 0x53, 0x20, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x31, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x39,
+0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x38, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x32, 0x0, 0x55, 0x54, 0x43, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x31, 0x32, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x33, 0x0, 0x56, 0x65, 0x6e, 0x65, 0x7a, 0x75, 0x65,
+0x6c, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x56, 0x6c, 0x61,
+0x64, 0x69, 0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
+0x6d, 0x65, 0x0, 0x56, 0x6f, 0x6c, 0x67, 0x6f, 0x67, 0x72, 0x61, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
+0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x20,
+0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e, 0x20, 0x43, 0x65, 0x6e,
+0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
+0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e,
+0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x69,
+0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x65, 0x73, 0x74,
+0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
+0x57, 0x65, 0x73, 0x74, 0x20, 0x42, 0x61, 0x6e, 0x6b, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
+0x69, 0x6d, 0x65, 0x0, 0x57, 0x65, 0x73, 0x74, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61,
+0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x20, 0x53,
+0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0
+};
+
+static const char ianaIdData[] = {
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x62, 0x75, 0x6c, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41,
+0x6e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x75, 0x6e,
+0x65, 0x61, 0x75, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x74, 0x6c, 0x61, 0x6b, 0x61, 0x74,
+0x6c, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x6d, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x53, 0x69, 0x74, 0x6b, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x59, 0x61,
+0x6b, 0x75, 0x74, 0x61, 0x74, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x64, 0x61, 0x6b, 0x0, 0x41,
+0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x72, 0x6e, 0x61, 0x75, 0x6c, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x68,
+0x72, 0x61, 0x69, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75, 0x77, 0x61, 0x69, 0x74, 0x0, 0x41, 0x73, 0x69,
+0x61, 0x2f, 0x51, 0x61, 0x74, 0x61, 0x72, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x52, 0x69, 0x79, 0x61, 0x64, 0x68, 0x0,
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x64, 0x65, 0x6e, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x34, 0x0,
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x75, 0x73, 0x63, 0x61, 0x74, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x75, 0x62,
+0x61, 0x69, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x67, 0x68, 0x64, 0x61, 0x64, 0x0, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x65, 0x6e, 0x6f, 0x73, 0x5f, 0x41, 0x69, 0x72, 0x65, 0x73, 0x20, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x4c, 0x61, 0x5f, 0x52, 0x69,
+0x6f, 0x6a, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e,
+0x61, 0x2f, 0x52, 0x69, 0x6f, 0x5f, 0x47, 0x61, 0x6c, 0x6c, 0x65, 0x67, 0x6f, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6c, 0x74, 0x61, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6e,
+0x5f, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74,
+0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x5f, 0x4c, 0x75, 0x69, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x54, 0x75, 0x63, 0x75, 0x6d, 0x61, 0x6e, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x55, 0x73, 0x68,
+0x75, 0x61, 0x69, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x72,
+0x63, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x75, 0x6a, 0x75, 0x79, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x4d, 0x65, 0x6e, 0x64, 0x6f, 0x7a, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x73, 0x74, 0x72,
+0x61, 0x6b, 0x68, 0x61, 0x6e, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x55, 0x6c, 0x79, 0x61, 0x6e, 0x6f, 0x76,
+0x73, 0x6b, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x6c, 0x69, 0x66, 0x61, 0x78, 0x20, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x47, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x47, 0x6f, 0x6f, 0x73, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x4d, 0x6f, 0x6e, 0x63, 0x74, 0x6f, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x68, 0x75, 0x6c,
+0x65, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x44, 0x61, 0x72, 0x77, 0x69, 0x6e, 0x0, 0x41,
+0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x45, 0x75, 0x63, 0x6c, 0x61, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72,
+0x61, 0x6c, 0x69, 0x61, 0x2f, 0x53, 0x79, 0x64, 0x6e, 0x65, 0x79, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69,
+0x61, 0x2f, 0x4d, 0x65, 0x6c, 0x62, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x6b,
+0x75, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x62, 0x79, 0x73, 0x75,
+0x6e, 0x64, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x41, 0x7a, 0x6f, 0x72, 0x65, 0x73, 0x0, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x69, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x68,
+0x61, 0x6b, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x68, 0x69, 0x6d, 0x70, 0x68, 0x75, 0x0, 0x45, 0x75, 0x72,
+0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x69, 0x6e, 0x73, 0x6b, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x42, 0x6f,
+0x75, 0x67, 0x61, 0x69, 0x6e, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52,
+0x65, 0x67, 0x69, 0x6e, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x77, 0x69, 0x66, 0x74, 0x5f,
+0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x31, 0x0, 0x41, 0x74,
+0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x43, 0x61, 0x70, 0x65, 0x5f, 0x56, 0x65, 0x72, 0x64, 0x65, 0x0, 0x41, 0x73,
+0x69, 0x61, 0x2f, 0x59, 0x65, 0x72, 0x65, 0x76, 0x61, 0x6e, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
+0x2f, 0x41, 0x64, 0x65, 0x6c, 0x61, 0x69, 0x64, 0x65, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f,
+0x42, 0x72, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x48, 0x69, 0x6c, 0x6c, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b,
+0x36, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x0, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x73, 0x74, 0x61, 0x5f, 0x52, 0x69, 0x63, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69,
+0x66, 0x69, 0x63, 0x2f, 0x47, 0x61, 0x6c, 0x61, 0x70, 0x61, 0x67, 0x6f, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x45, 0x6c, 0x5f, 0x53, 0x61, 0x6c, 0x76, 0x61, 0x64, 0x6f, 0x72, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x47, 0x75, 0x61, 0x74, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x54, 0x65, 0x67, 0x75, 0x63, 0x69, 0x67, 0x61, 0x6c, 0x70, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x4d, 0x61, 0x6e, 0x61, 0x67, 0x75, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x36, 0x0, 0x41, 0x6e,
+0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x56, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x0, 0x49, 0x6e, 0x64, 0x69,
+0x61, 0x6e, 0x2f, 0x43, 0x68, 0x61, 0x67, 0x6f, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x72, 0x75, 0x6d, 0x71,
+0x69, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6c, 0x6d, 0x61, 0x74, 0x79, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x51,
+0x6f, 0x73, 0x74, 0x61, 0x6e, 0x61, 0x79, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x69, 0x73, 0x68, 0x6b, 0x65, 0x6b,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x75, 0x69, 0x61, 0x62, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x6d, 0x70, 0x6f, 0x5f, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x65, 0x0, 0x45, 0x75, 0x72,
+0x6f, 0x70, 0x65, 0x2f, 0x54, 0x69, 0x72, 0x61, 0x6e, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x50, 0x72,
+0x61, 0x67, 0x75, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x64, 0x61, 0x70, 0x65, 0x73, 0x74,
+0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x72, 0x61, 0x74, 0x69, 0x73, 0x6c, 0x61, 0x76, 0x61, 0x0, 0x45,
+0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x6a, 0x75, 0x62, 0x6c, 0x6a, 0x61, 0x6e, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f,
+0x70, 0x65, 0x2f, 0x50, 0x6f, 0x64, 0x67, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
+0x42, 0x65, 0x6c, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x72, 0x61,
+0x6a, 0x65, 0x76, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x5a, 0x61, 0x67, 0x72, 0x65, 0x62, 0x0, 0x45,
+0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x6b, 0x6f, 0x70, 0x6a, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
+0x57, 0x61, 0x72, 0x73, 0x61, 0x77, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x31, 0x0, 0x41, 0x6e,
+0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x71, 0x75, 0x61, 0x72, 0x69, 0x65, 0x0, 0x50,
+0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x6f, 0x6e, 0x61, 0x70, 0x65, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
+0x63, 0x2f, 0x4b, 0x6f, 0x73, 0x72, 0x61, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x6f, 0x75,
+0x6d, 0x65, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x75, 0x61, 0x64, 0x61, 0x6c, 0x63, 0x61,
+0x6e, 0x61, 0x6c, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x66, 0x61, 0x74, 0x65, 0x0, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x20, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x69, 0x61, 0x5f, 0x42, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x61, 0x73,
+0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x72, 0x69, 0x64, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x65, 0x79, 0x0, 0x43, 0x53, 0x54, 0x36, 0x43, 0x44,
+0x54, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x57, 0x69, 0x6e, 0x6e, 0x69, 0x70, 0x65, 0x67, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x61, 0x69, 0x6e, 0x79, 0x5f, 0x52, 0x69, 0x76, 0x65, 0x72, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x5f, 0x49, 0x6e, 0x6c, 0x65, 0x74, 0x20,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x0, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x74, 0x61, 0x6d, 0x6f, 0x72, 0x6f, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x63, 0x61, 0x67, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49,
+0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x4b, 0x6e, 0x6f, 0x78, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x54, 0x65, 0x6c, 0x6c, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x20, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x65, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f, 0x74, 0x61, 0x2f, 0x42, 0x65, 0x75,
+0x6c, 0x61, 0x68, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61,
+0x6b, 0x6f, 0x74, 0x61, 0x2f, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f, 0x74, 0x61, 0x2f, 0x4e, 0x65, 0x77, 0x5f, 0x53, 0x61, 0x6c,
+0x65, 0x6d, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x0, 0x41, 0x73, 0x69,
+0x61, 0x2f, 0x48, 0x6f, 0x6e, 0x67, 0x5f, 0x4b, 0x6f, 0x6e, 0x67, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x63,
+0x61, 0x75, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x43, 0x68, 0x61, 0x74, 0x68, 0x61, 0x6d, 0x0, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x76, 0x61, 0x6e, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
+0x54, 0x2b, 0x31, 0x32, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x33, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72,
+0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x79, 0x6f, 0x77, 0x61, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43,
+0x6f, 0x6d, 0x6f, 0x72, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74,
+0x69, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x73, 0x6d, 0x65, 0x72, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x41, 0x64, 0x64, 0x69, 0x73, 0x5f, 0x41, 0x62, 0x61, 0x62, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x4e, 0x61, 0x69, 0x72, 0x6f, 0x62, 0x69, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x41, 0x6e, 0x74,
+0x61, 0x6e, 0x61, 0x6e, 0x61, 0x72, 0x69, 0x76, 0x6f, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x79,
+0x6f, 0x74, 0x74, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x67, 0x61, 0x64, 0x69, 0x73, 0x68,
+0x75, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x72, 0x5f, 0x65, 0x73, 0x5f, 0x53, 0x61, 0x6c, 0x61,
+0x61, 0x6d, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x61, 0x6d, 0x70, 0x61, 0x6c, 0x61, 0x0, 0x41, 0x66,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x75, 0x62, 0x61, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f,
+0x42, 0x72, 0x69, 0x73, 0x62, 0x61, 0x6e, 0x65, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4c,
+0x69, 0x6e, 0x64, 0x65, 0x6d, 0x61, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x43, 0x68, 0x69, 0x73, 0x69,
+0x6e, 0x61, 0x75, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6f, 0x5f, 0x50, 0x61, 0x75, 0x6c,
+0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x0, 0x45, 0x53, 0x54,
+0x35, 0x45, 0x44, 0x54, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x61, 0x73, 0x73, 0x61, 0x75, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x6f, 0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x49, 0x71, 0x61, 0x6c, 0x75, 0x69, 0x74, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x4d, 0x6f, 0x6e, 0x74, 0x72, 0x65, 0x61, 0x6c, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x69, 0x70,
+0x69, 0x67, 0x6f, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x61, 0x6e, 0x67, 0x6e, 0x69, 0x72,
+0x74, 0x75, 0x6e, 0x67, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x68, 0x75, 0x6e, 0x64, 0x65, 0x72,
+0x5f, 0x42, 0x61, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x65, 0x77, 0x5f, 0x59, 0x6f, 0x72,
+0x6b, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x65, 0x74, 0x72, 0x6f, 0x69, 0x74, 0x20, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x50, 0x65, 0x74, 0x65, 0x72, 0x73,
+0x62, 0x75, 0x72, 0x67, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61,
+0x2f, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49,
+0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x57, 0x69, 0x6e, 0x61, 0x6d, 0x61, 0x63, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x4b, 0x65, 0x6e, 0x74, 0x75, 0x63, 0x6b, 0x79, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x69, 0x63, 0x65, 0x6c,
+0x6c, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x75, 0x69, 0x73, 0x76, 0x69, 0x6c, 0x6c,
+0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x6e, 0x63, 0x75, 0x6e, 0x0, 0x41, 0x66, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x59, 0x65, 0x6b, 0x61, 0x74,
+0x65, 0x72, 0x69, 0x6e, 0x62, 0x75, 0x72, 0x67, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x46, 0x69, 0x6a,
+0x69, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x6f, 0x66, 0x69, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70,
+0x65, 0x2f, 0x54, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x48, 0x65, 0x6c,
+0x73, 0x69, 0x6e, 0x6b, 0x69, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x52, 0x69, 0x67, 0x61, 0x0, 0x45, 0x75,
+0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x69, 0x6c, 0x6e, 0x69, 0x75, 0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
+0x4b, 0x69, 0x65, 0x76, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x55, 0x7a, 0x68, 0x67, 0x6f, 0x72, 0x6f, 0x64,
+0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x5a, 0x61, 0x70, 0x6f, 0x72, 0x6f, 0x7a, 0x68, 0x79, 0x65, 0x0, 0x45,
+0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61, 0x72, 0x69, 0x65, 0x68, 0x61, 0x6d, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61,
+0x2f, 0x54, 0x62, 0x69, 0x6c, 0x69, 0x73, 0x69, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x46, 0x61,
+0x65, 0x72, 0x6f, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x47, 0x75, 0x65, 0x72, 0x6e, 0x73, 0x65, 0x79,
+0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x44, 0x75, 0x62, 0x6c, 0x69, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70,
+0x65, 0x2f, 0x4c, 0x69, 0x73, 0x62, 0x6f, 0x6e, 0x20, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x4d, 0x61,
+0x64, 0x65, 0x69, 0x72, 0x61, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x43, 0x61, 0x6e, 0x61, 0x72,
+0x79, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f,
+0x70, 0x65, 0x2f, 0x49, 0x73, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x4d, 0x61, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70,
+0x65, 0x2f, 0x4a, 0x65, 0x72, 0x73, 0x65, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x6f, 0x64,
+0x74, 0x68, 0x61, 0x62, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4f, 0x75, 0x61, 0x67, 0x61, 0x64, 0x6f, 0x75,
+0x67, 0x6f, 0x75, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x62, 0x69, 0x64, 0x6a, 0x61, 0x6e, 0x0, 0x41,
+0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x6e, 0x6a, 0x75, 0x6c, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x41, 0x63, 0x63, 0x72, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x6e, 0x61, 0x6b, 0x72, 0x79,
+0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x69, 0x73, 0x73, 0x61, 0x75, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e,
+0x74, 0x69, 0x63, 0x2f, 0x52, 0x65, 0x79, 0x6b, 0x6a, 0x61, 0x76, 0x69, 0x6b, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x4d, 0x6f, 0x6e, 0x72, 0x6f, 0x76, 0x69, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x6d,
+0x61, 0x6b, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x75, 0x61, 0x6b, 0x63, 0x68, 0x6f, 0x74,
+0x74, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x6b, 0x61, 0x72, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x46, 0x72, 0x65, 0x65, 0x74, 0x6f, 0x77, 0x6e, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f,
+0x53, 0x74, 0x5f, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x6d,
+0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x69, 0x63, 0x6f, 0x73, 0x69, 0x61, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f,
+0x46, 0x61, 0x6d, 0x61, 0x67, 0x75, 0x73, 0x74, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x74, 0x68,
+0x65, 0x6e, 0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x63, 0x68, 0x61, 0x72, 0x65, 0x73, 0x74,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x2d, 0x61, 0x75, 0x2d, 0x50, 0x72, 0x69,
+0x6e, 0x63, 0x65, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x31, 0x30, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
+0x69, 0x63, 0x2f, 0x52, 0x61, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x67, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
+0x2f, 0x54, 0x61, 0x68, 0x69, 0x74, 0x69, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x48, 0x6f, 0x6e, 0x6f,
+0x6c, 0x75, 0x6c, 0x75, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4a, 0x6f, 0x68, 0x6e, 0x73, 0x74, 0x6f,
+0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x74, 0x74, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61,
+0x2f, 0x54, 0x65, 0x68, 0x72, 0x61, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x65, 0x72, 0x75, 0x73, 0x61, 0x6c,
+0x65, 0x6d, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6d, 0x6d, 0x61, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
+0x2f, 0x4b, 0x61, 0x6c, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x72, 0x61, 0x64, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x65,
+0x6f, 0x75, 0x6c, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x6c, 0x69, 0x0, 0x45,
+0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x34, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4b, 0x69,
+0x72, 0x69, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4c,
+0x6f, 0x72, 0x64, 0x5f, 0x48, 0x6f, 0x77, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x67, 0x61, 0x64, 0x61,
+0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x75, 0x6e, 0x74, 0x61, 0x5f, 0x41, 0x72, 0x65, 0x6e,
+0x61, 0x73, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x61, 0x72, 0x71, 0x75, 0x65, 0x73, 0x61, 0x73,
+0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73, 0x0, 0x49, 0x6e,
+0x64, 0x69, 0x61, 0x6e, 0x2f, 0x52, 0x65, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f,
+0x4d, 0x61, 0x68, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x65, 0x69, 0x72, 0x75, 0x74, 0x0, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x43, 0x61, 0x73, 0x61, 0x62, 0x6c, 0x61, 0x6e, 0x63, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x45, 0x6c, 0x5f, 0x41, 0x61, 0x69, 0x75, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68,
+0x69, 0x68, 0x75, 0x61, 0x68, 0x75, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x7a, 0x61,
+0x74, 0x6c, 0x61, 0x6e, 0x0, 0x4d, 0x53, 0x54, 0x37, 0x4d, 0x44, 0x54, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x45, 0x64, 0x6d, 0x6f, 0x6e, 0x74, 0x6f, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61,
+0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x49, 0x6e, 0x75, 0x76, 0x69, 0x6b, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x59, 0x65, 0x6c, 0x6c, 0x6f,
+0x77, 0x6b, 0x6e, 0x69, 0x66, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4f, 0x6a, 0x69, 0x6e, 0x61,
+0x67, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x20, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f, 0x69, 0x73, 0x65, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43,
+0x6f, 0x63, 0x6f, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x52, 0x61, 0x6e, 0x67, 0x6f, 0x6f, 0x6e, 0x0, 0x41, 0x73,
+0x69, 0x61, 0x2f, 0x4e, 0x6f, 0x76, 0x6f, 0x73, 0x69, 0x62, 0x69, 0x72, 0x73, 0x6b, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x57, 0x69, 0x6e, 0x64, 0x68, 0x6f, 0x65, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x74, 0x6d,
+0x61, 0x6e, 0x64, 0x75, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x63, 0x4d, 0x75,
+0x72, 0x64, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x41, 0x75, 0x63, 0x6b, 0x6c, 0x61, 0x6e, 0x64,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x4a, 0x6f, 0x68, 0x6e, 0x73, 0x0, 0x50, 0x61,
+0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x6f, 0x72, 0x66, 0x6f, 0x6c, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x49,
+0x72, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x72, 0x61, 0x73, 0x6e, 0x6f, 0x79, 0x61,
+0x72, 0x73, 0x6b, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x6f, 0x76, 0x6f, 0x6b, 0x75, 0x7a, 0x6e, 0x65, 0x74, 0x73,
+0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x79, 0x6f, 0x6e, 0x67, 0x79, 0x61, 0x6e, 0x67, 0x0, 0x41, 0x73, 0x69,
+0x61, 0x2f, 0x4f, 0x6d, 0x73, 0x6b, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x69,
+0x61, 0x67, 0x6f, 0x0, 0x50, 0x53, 0x54, 0x38, 0x50, 0x44, 0x54, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x56, 0x61, 0x6e, 0x63, 0x6f, 0x75, 0x76, 0x65, 0x72, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61,
+0x77, 0x73, 0x6f, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x57, 0x68, 0x69, 0x74, 0x65, 0x68, 0x6f,
+0x72, 0x73, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x73, 0x5f, 0x41, 0x6e, 0x67, 0x65,
+0x6c, 0x65, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x69, 0x6a, 0x75, 0x61, 0x6e, 0x61, 0x20,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x61, 0x5f, 0x49, 0x73, 0x61, 0x62, 0x65, 0x6c,
+0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x72, 0x61, 0x63, 0x68, 0x69, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x41, 0x73, 0x75, 0x6e, 0x63, 0x69, 0x6f, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x51, 0x79, 0x7a, 0x79,
+0x6c, 0x6f, 0x72, 0x64, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x72, 0x75, 0x73, 0x73, 0x65, 0x6c,
+0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x43, 0x6f, 0x70, 0x65, 0x6e, 0x68, 0x61, 0x67, 0x65, 0x6e, 0x0,
+0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x50, 0x61, 0x72, 0x69, 0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
+0x4d, 0x61, 0x64, 0x72, 0x69, 0x64, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x65, 0x75, 0x74, 0x61, 0x0,
+0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x6d, 0x61, 0x72, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53,
+0x72, 0x65, 0x64, 0x6e, 0x65, 0x6b, 0x6f, 0x6c, 0x79, 0x6d, 0x73, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61,
+0x6d, 0x63, 0x68, 0x61, 0x74, 0x6b, 0x61, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6e, 0x61, 0x64, 0x79, 0x72, 0x0,
+0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
+0x2f, 0x4b, 0x69, 0x72, 0x6f, 0x76, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x69, 0x6d, 0x66, 0x65, 0x72,
+0x6f, 0x70, 0x6f, 0x6c, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x33, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72,
+0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x61, 0x20, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63,
+0x74, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x61, 0x6c, 0x6d, 0x65, 0x72, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x46, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x65, 0x7a, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x65,
+0x6c, 0x65, 0x6d, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x65, 0x69, 0x6f, 0x20, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x65, 0x63, 0x69, 0x66, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x61, 0x72, 0x65, 0x6d, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f,
+0x53, 0x74, 0x61, 0x6e, 0x6c, 0x65, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x79, 0x65,
+0x6e, 0x6e, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x61, 0x72, 0x69,
+0x62, 0x6f, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x35, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x52, 0x69, 0x6f, 0x5f, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x45, 0x69, 0x72, 0x75, 0x6e, 0x65, 0x70, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x72,
+0x61, 0x6c, 0x5f, 0x48, 0x61, 0x72, 0x62, 0x6f, 0x75, 0x72, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43,
+0x61, 0x79, 0x6d, 0x61, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f, 0x67, 0x6f, 0x74, 0x61,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x61, 0x79, 0x61, 0x71, 0x75, 0x69, 0x6c, 0x0, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x50, 0x61, 0x6e, 0x61, 0x6d, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x69,
+0x6d, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x34, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x41, 0x6e, 0x67, 0x75, 0x69, 0x6c, 0x6c, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e,
+0x74, 0x69, 0x67, 0x75, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x75, 0x62, 0x61, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x6f, 0x73, 0x0, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x61, 0x5f, 0x50, 0x61, 0x7a, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x4d, 0x61, 0x6e, 0x61, 0x75, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f, 0x61, 0x5f, 0x56,
+0x69, 0x73, 0x74, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x6f, 0x5f, 0x56,
+0x65, 0x6c, 0x68, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6c, 0x61, 0x6e, 0x63, 0x2d, 0x53,
+0x61, 0x62, 0x6c, 0x6f, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x69,
+0x63, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x6f, 0x5f, 0x44, 0x6f, 0x6d,
+0x69, 0x6e, 0x67, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x72, 0x65, 0x6e, 0x61, 0x64, 0x61,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x61, 0x64, 0x65, 0x6c, 0x6f, 0x75, 0x70, 0x65, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
+0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x73, 0x65, 0x72, 0x72, 0x61, 0x74, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x43, 0x75, 0x72, 0x61, 0x63, 0x61, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x75, 0x65,
+0x72, 0x74, 0x6f, 0x5f, 0x52, 0x69, 0x63, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f,
+0x4b, 0x69, 0x74, 0x74, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x4c, 0x75, 0x63,
+0x69, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e,
+0x74, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x66, 0x5f, 0x53, 0x70,
+0x61, 0x69, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x6f, 0x72, 0x74, 0x6f, 0x6c, 0x61, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x54, 0x68, 0x6f, 0x6d, 0x61, 0x73, 0x0, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x42, 0x61, 0x72, 0x74, 0x68, 0x65, 0x6c, 0x65, 0x6d, 0x79, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x69, 0x67, 0x6f, 0x74, 0x0, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x4b, 0x72, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6a, 0x6b, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x65, 0x73, 0x0, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x69, 0x71, 0x75, 0x65, 0x6c, 0x6f, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53,
+0x61, 0x6b, 0x68, 0x61, 0x6c, 0x69, 0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x41, 0x70, 0x69, 0x61,
+0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6f, 0x5f, 0x54, 0x6f, 0x6d, 0x65, 0x0, 0x45, 0x75, 0x72,
+0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x76, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d,
+0x37, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x76, 0x69, 0x73, 0x0, 0x41,
+0x73, 0x69, 0x61, 0x2f, 0x50, 0x68, 0x6e, 0x6f, 0x6d, 0x5f, 0x50, 0x65, 0x6e, 0x68, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61,
+0x6e, 0x2f, 0x43, 0x68, 0x72, 0x69, 0x73, 0x74, 0x6d, 0x61, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x61, 0x6b,
+0x61, 0x72, 0x74, 0x61, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x6f, 0x6e, 0x74, 0x69, 0x61, 0x6e, 0x61, 0x6b, 0x0,
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x56, 0x69, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6e, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f,
+0x42, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x69, 0x67, 0x6f, 0x6e, 0x0,
+0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x38, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61,
+0x2f, 0x43, 0x61, 0x73, 0x65, 0x79, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x0, 0x41,
+0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x6b, 0x61, 0x73, 0x73, 0x61, 0x72, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75,
+0x61, 0x6c, 0x61, 0x5f, 0x4c, 0x75, 0x6d, 0x70, 0x75, 0x72, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75, 0x63, 0x68,
+0x69, 0x6e, 0x67, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x6e, 0x69, 0x6c, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61,
+0x2f, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x32,
+0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x61, 0x62, 0x6f, 0x72, 0x6f, 0x6e, 0x65, 0x0, 0x41, 0x66, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x6a, 0x75, 0x6d, 0x62, 0x75, 0x72, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x4c, 0x75, 0x62, 0x75, 0x6d, 0x62, 0x61, 0x73, 0x68, 0x69, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d,
+0x61, 0x73, 0x65, 0x72, 0x75, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6c, 0x61, 0x6e, 0x74, 0x79, 0x72,
+0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x70, 0x75, 0x74, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x4b, 0x69, 0x67, 0x61, 0x6c, 0x69, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x6f, 0x68,
+0x61, 0x6e, 0x6e, 0x65, 0x73, 0x62, 0x75, 0x72, 0x67, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x62, 0x61,
+0x62, 0x61, 0x6e, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x73, 0x61, 0x6b, 0x61, 0x0, 0x41,
+0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x72, 0x61, 0x72, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x6f,
+0x6c, 0x6f, 0x6d, 0x62, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x68, 0x61, 0x72, 0x74, 0x6f, 0x75,
+0x6d, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x61, 0x6d, 0x61, 0x73, 0x63, 0x75, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61,
+0x2f, 0x54, 0x61, 0x69, 0x70, 0x65, 0x69, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x48, 0x6f,
+0x62, 0x61, 0x72, 0x74, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x43, 0x75, 0x72, 0x72, 0x69,
+0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x61, 0x67, 0x75, 0x61, 0x69, 0x6e, 0x61, 0x0,
+0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x39, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x69, 0x6c, 0x69, 0x0,
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x61, 0x79, 0x61, 0x70, 0x75, 0x72, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54,
+0x6f, 0x6b, 0x79, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x61, 0x6c, 0x61, 0x75, 0x0, 0x41,
+0x73, 0x69, 0x61, 0x2f, 0x54, 0x6f, 0x6d, 0x73, 0x6b, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x6f,
+0x6e, 0x67, 0x61, 0x74, 0x61, 0x70, 0x75, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x74, 0x61, 0x0, 0x45,
+0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x49, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x54, 0x75, 0x72, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55,
+0x6c, 0x61, 0x61, 0x6e, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x68, 0x6f, 0x69,
+0x62, 0x61, 0x6c, 0x73, 0x61, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61,
+0x6e, 0x61, 0x70, 0x6f, 0x6c, 0x69, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69,
+0x61, 0x6e, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x65, 0x6e, 0x67, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x56, 0x65, 0x76, 0x61, 0x79, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
+0x54, 0x2b, 0x37, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x77, 0x73, 0x6f, 0x6e, 0x5f, 0x43,
+0x72, 0x65, 0x65, 0x6b, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x6e,
+0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x46, 0x6f, 0x72, 0x74, 0x5f, 0x4e, 0x65, 0x6c, 0x73, 0x6f, 0x6e,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x65, 0x72, 0x6d, 0x6f, 0x73, 0x69, 0x6c, 0x6c, 0x6f, 0x0,
+0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x68, 0x6f, 0x65, 0x6e, 0x69, 0x78, 0x0, 0x45, 0x74, 0x63, 0x2f,
+0x47, 0x4d, 0x54, 0x2b, 0x31, 0x31, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x61, 0x67, 0x6f, 0x5f,
+0x50, 0x61, 0x67, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x69, 0x75, 0x65, 0x0, 0x50, 0x61,
+0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x69, 0x64, 0x77, 0x61, 0x79, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54,
+0x2b, 0x39, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x65, 0x72, 0x0, 0x45,
+0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x38, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x69, 0x74,
+0x63, 0x61, 0x69, 0x72, 0x6e, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x32, 0x0, 0x41, 0x6d, 0x65, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x6f, 0x6e, 0x68, 0x61, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63,
+0x2f, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x5f, 0x47, 0x65, 0x6f, 0x72, 0x67, 0x69, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47,
+0x4d, 0x54, 0x20, 0x45, 0x74, 0x63, 0x2f, 0x55, 0x54, 0x43, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44,
+0x61, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x68, 0x61, 0x76, 0x6e, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d,
+0x31, 0x32, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x61, 0x72, 0x61, 0x77, 0x61, 0x0, 0x50, 0x61,
+0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x61, 0x6a, 0x75, 0x72, 0x6f, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
+0x2f, 0x4b, 0x77, 0x61, 0x6a, 0x61, 0x6c, 0x65, 0x69, 0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e,
+0x61, 0x75, 0x72, 0x75, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x46, 0x75, 0x6e, 0x61, 0x66, 0x75, 0x74,
+0x69, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x57, 0x61, 0x6b, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
+0x69, 0x63, 0x2f, 0x57, 0x61, 0x6c, 0x6c, 0x69, 0x73, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x33,
+0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x6e, 0x64, 0x65, 0x72, 0x62, 0x75, 0x72, 0x79, 0x0, 0x50,
+0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x46, 0x61, 0x6b, 0x61, 0x6f, 0x66, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x43, 0x61, 0x72, 0x61, 0x63, 0x61, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x56, 0x6c, 0x61, 0x64,
+0x69, 0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x73, 0x74, 0x2d, 0x4e, 0x65, 0x72,
+0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x6f, 0x6c, 0x67, 0x6f, 0x67, 0x72, 0x61, 0x64, 0x0, 0x41,
+0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x50, 0x65, 0x72, 0x74, 0x68, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47,
+0x4d, 0x54, 0x2d, 0x31, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6c, 0x67, 0x69, 0x65, 0x72, 0x73, 0x0,
+0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x61, 0x6e, 0x64, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x50, 0x6f, 0x72, 0x74, 0x6f, 0x2d, 0x4e, 0x6f, 0x76, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44,
+0x6f, 0x75, 0x61, 0x6c, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x6e, 0x67, 0x75, 0x69, 0x0,
+0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x64, 0x6a, 0x61, 0x6d, 0x65, 0x6e, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x4b, 0x69, 0x6e, 0x73, 0x68, 0x61, 0x73, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42,
+0x72, 0x61, 0x7a, 0x7a, 0x61, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61,
+0x6c, 0x61, 0x62, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x69, 0x62, 0x72, 0x65, 0x76, 0x69, 0x6c,
+0x6c, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x69, 0x61, 0x6d, 0x65, 0x79, 0x0, 0x41, 0x66, 0x72,
+0x69, 0x63, 0x61, 0x2f, 0x4c, 0x61, 0x67, 0x6f, 0x73, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x75, 0x6e,
+0x69, 0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x6e, 0x64, 0x6f, 0x72, 0x72, 0x61, 0x0, 0x45, 0x75,
+0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x69, 0x65, 0x6e, 0x6e, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42,
+0x65, 0x72, 0x6c, 0x69, 0x6e, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x65,
+0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61, 0x72, 0x0, 0x45,
+0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x52, 0x6f, 0x6d, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x61,
+0x64, 0x75, 0x7a, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62, 0x6f, 0x75, 0x72,
+0x67, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61, 0x6c, 0x74, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70,
+0x65, 0x2f, 0x4d, 0x6f, 0x6e, 0x61, 0x63, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x6d, 0x73, 0x74,
+0x65, 0x72, 0x64, 0x61, 0x6d, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4f, 0x73, 0x6c, 0x6f, 0x0, 0x45, 0x75,
+0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x6e, 0x5f, 0x4d, 0x61, 0x72, 0x69, 0x6e, 0x6f, 0x0, 0x41, 0x72, 0x63, 0x74,
+0x69, 0x63, 0x2f, 0x4c, 0x6f, 0x6e, 0x67, 0x79, 0x65, 0x61, 0x72, 0x62, 0x79, 0x65, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f,
+0x70, 0x65, 0x2f, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x6d, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
+0x5a, 0x75, 0x72, 0x69, 0x63, 0x68, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x61, 0x74, 0x69, 0x63, 0x61,
+0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x48, 0x6f, 0x76, 0x64, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d,
+0x35, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x77, 0x73, 0x6f, 0x6e, 0x0,
+0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4b, 0x65, 0x72, 0x67, 0x75, 0x65, 0x6c, 0x65, 0x6e, 0x0, 0x41, 0x73, 0x69,
+0x61, 0x2f, 0x4f, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x71, 0x74, 0x61, 0x75, 0x20, 0x41, 0x73,
+0x69, 0x61, 0x2f, 0x41, 0x71, 0x74, 0x6f, 0x62, 0x65, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x74, 0x79, 0x72, 0x61,
+0x75, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x6c, 0x64, 0x69, 0x76, 0x65, 0x73, 0x0, 0x41, 0x73,
+0x69, 0x61, 0x2f, 0x44, 0x75, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x73, 0x68,
+0x67, 0x61, 0x62, 0x61, 0x74, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x73, 0x68, 0x6b, 0x65, 0x6e, 0x74, 0x20,
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x6e, 0x64, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f,
+0x48, 0x65, 0x62, 0x72, 0x6f, 0x6e, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x47, 0x61, 0x7a, 0x61, 0x0, 0x45, 0x74, 0x63,
+0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x30, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x44,
+0x75, 0x6d, 0x6f, 0x6e, 0x74, 0x44, 0x55, 0x72, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
+0x63, 0x2f, 0x47, 0x75, 0x61, 0x6d, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x72, 0x75, 0x6b, 0x0,
+0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x53, 0x61, 0x69, 0x70, 0x61, 0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
+0x69, 0x63, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x5f, 0x4d, 0x6f, 0x72, 0x65, 0x73, 0x62, 0x79, 0x0, 0x41, 0x73, 0x69, 0x61,
+0x2f, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x68, 0x61, 0x6e, 0x64, 0x79,
+0x67, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x67, 0x65,
+0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x65, 0x6e, 0x6f, 0x73, 0x5f, 0x41, 0x69, 0x72, 0x65,
+0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x73, 0x74, 0x72, 0x61, 0x6b, 0x68, 0x61, 0x6e, 0x0, 0x41,
+0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x6c, 0x69, 0x66, 0x61, 0x78, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72,
+0x61, 0x6c, 0x69, 0x61, 0x2f, 0x53, 0x79, 0x64, 0x6e, 0x65, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
+0x52, 0x65, 0x67, 0x69, 0x6e, 0x61, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x41, 0x64, 0x65,
+0x6c, 0x61, 0x69, 0x64, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6c, 0x6d, 0x61, 0x74, 0x79, 0x0, 0x41, 0x6d,
+0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x75, 0x69, 0x61, 0x62, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
+0x2f, 0x43, 0x68, 0x69, 0x63, 0x61, 0x67, 0x6f, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x42,
+0x72, 0x69, 0x73, 0x62, 0x61, 0x6e, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x65, 0x77, 0x5f,
+0x59, 0x6f, 0x72, 0x6b, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x69, 0x65, 0x76, 0x0, 0x41, 0x6d, 0x65,
+0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x68, 0x75, 0x61, 0x68, 0x75, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
+0x63, 0x61, 0x2f, 0x44, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x72, 0x61, 0x73, 0x6e,
+0x6f, 0x79, 0x61, 0x72, 0x73, 0x6b, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x69, 0x6a, 0x75, 0x61,
+0x6e, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x6d, 0x63, 0x68, 0x61, 0x74, 0x6b, 0x61, 0x0, 0x45, 0x75,
+0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69,
+0x61, 0x2f, 0x48, 0x6f, 0x62, 0x61, 0x72, 0x74, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x6c, 0x61, 0x61, 0x6e, 0x62,
+0x61, 0x61, 0x74, 0x61, 0x72, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e,
+0x61, 0x70, 0x6f, 0x6c, 0x69, 0x73, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f,
+0x56, 0x6c, 0x61, 0x64, 0x69, 0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42,
+0x65, 0x72, 0x6c, 0x69, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x73, 0x68, 0x6b, 0x65, 0x6e, 0x74, 0x0,
+0x41, 0x73, 0x69, 0x61, 0x2f, 0x48, 0x65, 0x62, 0x72, 0x6f, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x59, 0x61, 0x6b,
+0x75, 0x74, 0x73, 0x6b, 0x0, 0x55, 0x54, 0x43, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x34, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x31, 0x33, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x32, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x31, 0x31, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x30, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x30, 0x39, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x38, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x30, 0x37, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x36, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x30, 0x35, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x34, 0x3a, 0x33, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x30, 0x34, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x33, 0x3a, 0x33, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x30, 0x33, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x32, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2d, 0x30, 0x31, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x31, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x32, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x33, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x33, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x34, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x34, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x35, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x35, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x35, 0x3a, 0x34, 0x35, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x36, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x36, 0x3a, 0x33, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x37, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x38, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x38, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x39, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x30, 0x39, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x30, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x31, 0x31, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x32, 0x3a, 0x30, 0x30, 0x0, 0x55,
+0x54, 0x43, 0x2b, 0x31, 0x33, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x34, 0x3a, 0x30, 0x30, 0x0
+};
+// GENERATED PART ENDS HERE
+
+QT_END_NAMESPACE
+
+#endif // QTIMEZONEPRIVATE_DATA_P_H
diff --git a/src/corelib/tools/qtimezoneprivate_icu.cpp b/src/corelib/time/qtimezoneprivate_icu.cpp
index 5570ce7571..5570ce7571 100644
--- a/src/corelib/tools/qtimezoneprivate_icu.cpp
+++ b/src/corelib/time/qtimezoneprivate_icu.cpp
diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/time/qtimezoneprivate_mac.mm
index d3c4fbe5da..d3c4fbe5da 100644
--- a/src/corelib/tools/qtimezoneprivate_mac.mm
+++ b/src/corelib/time/qtimezoneprivate_mac.mm
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/time/qtimezoneprivate_p.h
index 24a9a00f11..5f6491ef81 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/time/qtimezoneprivate_p.h
@@ -53,7 +53,7 @@
//
#include "qtimezone.h"
-#include "qlocale_p.h"
+#include "private/qlocale_p.h"
#include "qvector.h"
#if QT_CONFIG(icu)
@@ -282,9 +282,9 @@ struct QTzTransitionRule
quint8 abbreviationIndex;
};
Q_DECLARE_TYPEINFO(QTzTransitionRule, Q_PRIMITIVE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) noexcept
{ return lhs.stdOffset == rhs.stdOffset && lhs.dstOffset == rhs.dstOffset && lhs.abbreviationIndex == rhs.abbreviationIndex; }
-Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QTzTransitionRule &lhs, const QTzTransitionRule &rhs) noexcept
{ return !operator==(lhs, rhs); }
class Q_AUTOTEST_EXPORT QTzTimeZonePrivate final : public QTimeZonePrivate
diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index 57bc000af5..3c2695a789 100644
--- a/src/corelib/tools/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -39,7 +39,7 @@
#include "qtimezone.h"
#include "qtimezoneprivate_p.h"
-#include "qdatetime_p.h" // ### Qt 5.14: remove once YearRange is on QDateTime
+#include "private/qlocale_tools_p.h"
#include <QtCore/QFile>
#include <QtCore/QHash>
@@ -48,8 +48,6 @@
#include <qdebug.h>
-#include "qlocale_tools_p.h"
-
#include <algorithm>
#include <errno.h>
#include <limits.h>
@@ -474,7 +472,7 @@ struct PosixZone
static PosixZone invalid() { return {QString(), InvalidOffset}; }
static PosixZone parse(const char *&pos, const char *end);
- bool hasValidOffset() const Q_DECL_NOTHROW { return offset != InvalidOffset; }
+ bool hasValidOffset() const noexcept { return offset != InvalidOffset; }
};
} // unnamed namespace
@@ -522,6 +520,10 @@ PosixZone PosixZone::parse(const char *&pos, const char *end)
QString name = QString::fromUtf8(nameBegin, nameEnd - nameBegin);
const int offset = zoneEnd > zoneBegin ? parsePosixOffset(zoneBegin, zoneEnd) : InvalidOffset;
pos = zoneEnd;
+ // UTC+hh:mm:ss or GMT+hh:mm:ss should be read as offsets from UTC, not as a
+ // POSIX rule naming a zone as UTC or GMT and specifying a non-zero offset.
+ if (offset != 0 && (name == QLatin1String("UTC") || name == QLatin1String("GMT")))
+ return invalid();
return {std::move(name), offset};
}
@@ -586,8 +588,8 @@ static QVector<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArra
stdTime = QTime(2, 0, 0);
// Limit year to the range QDateTime can represent:
- const int minYear = int(QDateTimePrivate::YearRange::First);
- const int maxYear = int(QDateTimePrivate::YearRange::Last);
+ const int minYear = int(QDateTime::YearRange::First);
+ const int maxYear = int(QDateTime::YearRange::Last);
startYear = qBound(minYear, startYear, maxYear);
endYear = qBound(minYear, endYear, maxYear);
Q_ASSERT(startYear <= endYear);
@@ -660,8 +662,17 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
if (!tzif.open(QIODevice::ReadOnly)) {
tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
- if (!tzif.open(QIODevice::ReadOnly))
+ if (!tzif.open(QIODevice::ReadOnly)) {
+ // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+ const QByteArray zoneInfo = ianaId.split(',').at(0);
+ const char *begin = zoneInfo.constBegin();
+ if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
+ && (begin == zoneInfo.constEnd()
+ || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
+ m_id = m_posixRule = ianaId;
+ }
return;
+ }
}
}
@@ -1100,7 +1111,7 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
path = QFile::symLinkTarget(path);
if (index >= 0) {
// /etc/localtime is a symlink to the current TZ file, so extract from path
- ianaId = path.mid(index + zoneinfo.size()).toUtf8();
+ ianaId = path.midRef(index + zoneinfo.size()).toUtf8();
}
}
@@ -1126,14 +1137,21 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
while (ianaId.isEmpty() && !ts.atEnd() && ts.status() == QTextStream::Ok) {
line = ts.readLine();
if (line.startsWith(QLatin1String("ZONE="))) {
- ianaId = line.mid(6, line.size() - 7).toUtf8();
+ ianaId = line.midRef(6, line.size() - 7).toUtf8();
} else if (line.startsWith(QLatin1String("TIMEZONE="))) {
- ianaId = line.mid(10, line.size() - 11).toUtf8();
+ ianaId = line.midRef(10, line.size() - 11).toUtf8();
}
}
}
}
+ // Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
+ if (ianaId.isEmpty()) {
+ QFile zone(QStringLiteral("/etc/TZ"));
+ if (zone.open(QIODevice::ReadOnly))
+ ianaId = zone.readAll().trimmed();
+ }
+
// Give up for now and return UTC
if (ianaId.isEmpty())
ianaId = utcQByteArray();
diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/time/qtimezoneprivate_win.cpp
index 1bf2366748..0fec5355b2 100644
--- a/src/corelib/tools/qtimezoneprivate_win.cpp
+++ b/src/corelib/time/qtimezoneprivate_win.cpp
@@ -46,13 +46,14 @@
#include <algorithm>
-QT_BEGIN_NAMESPACE
-
#ifndef Q_OS_WINRT
+#include <private/qwinregistry_p.h>
// The registry-based timezone backend is not available on WinRT, which falls back to equivalent APIs.
#define QT_USE_REGISTRY_TIMEZONE 1
#endif
+QT_BEGIN_NAMESPACE
+
/*
Private
@@ -71,8 +72,8 @@ QT_BEGIN_NAMESPACE
// Vista introduced support for historic data, see MSDN docs on DYNAMIC_TIME_ZONE_INFORMATION
// http://msdn.microsoft.com/en-gb/library/windows/desktop/ms724253%28v=vs.85%29.aspx
#ifdef QT_USE_REGISTRY_TIMEZONE
-static const char tzRegPath[] = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones";
-static const char currTzRegPath[] = "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation";
+static const wchar_t tzRegPath[] = LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones)";
+static const wchar_t currTzRegPath[] = LR"(SYSTEM\CurrentControlSet\Control\TimeZoneInformation)";
#endif
enum {
@@ -138,27 +139,6 @@ bool equalTzi(const TIME_ZONE_INFORMATION &tzi1, const TIME_ZONE_INFORMATION &tz
}
#ifdef QT_USE_REGISTRY_TIMEZONE
-bool openRegistryKey(const QString &keyPath, HKEY *key)
-{
- return RegOpenKeyEx(HKEY_LOCAL_MACHINE, reinterpret_cast<const wchar_t*>(keyPath.utf16()),
- 0, KEY_READ, key) == ERROR_SUCCESS;
-}
-
-QString readRegistryString(const HKEY &key, const wchar_t *value)
-{
- wchar_t buffer[MAX_PATH] = {0};
- DWORD size = sizeof(wchar_t) * MAX_PATH;
- RegQueryValueEx(key, value, nullptr, nullptr, reinterpret_cast<LPBYTE>(buffer), &size);
- return QString::fromWCharArray(buffer);
-}
-
-int readRegistryValue(const HKEY &key, const wchar_t *value)
-{
- DWORD buffer;
- DWORD size = sizeof(buffer);
- RegQueryValueEx(key, value, nullptr, nullptr, reinterpret_cast<LPBYTE>(&buffer), &size);
- return buffer;
-}
QWinTimeZonePrivate::QWinTransitionRule readRegistryRule(const HKEY &key,
const wchar_t *value, bool *ok)
@@ -185,12 +165,11 @@ TIME_ZONE_INFORMATION getRegistryTzi(const QByteArray &windowsId, bool *ok)
TIME_ZONE_INFORMATION tzi;
REG_TZI_FORMAT regTzi;
DWORD regTziSize = sizeof(regTzi);
- HKEY key = NULL;
- const QString tziKeyPath = QString::fromUtf8(tzRegPath) + QLatin1Char('\\')
+ const QString tziKeyPath = QString::fromWCharArray(tzRegPath) + QLatin1Char('\\')
+ QString::fromUtf8(windowsId);
- if (openRegistryKey(tziKeyPath, &key)) {
-
+ QWinRegistryKey key(HKEY_LOCAL_MACHINE, tziKeyPath);
+ if (key.isValid()) {
DWORD size = sizeof(tzi.DaylightName);
RegQueryValueEx(key, L"Dlt", nullptr, nullptr, reinterpret_cast<LPBYTE>(tzi.DaylightName), &size);
@@ -206,8 +185,6 @@ TIME_ZONE_INFORMATION getRegistryTzi(const QByteArray &windowsId, bool *ok)
tzi.DaylightDate = regTzi.DaylightDate;
*ok = true;
}
-
- RegCloseKey(key);
}
return tzi;
@@ -299,8 +276,8 @@ QList<QByteArray> availableWindowsIds()
#ifdef QT_USE_REGISTRY_TIMEZONE
// TODO Consider caching results in a global static, very unlikely to change.
QList<QByteArray> list;
- HKEY key = NULL;
- if (openRegistryKey(QString::fromUtf8(tzRegPath), &key)) {
+ QWinRegistryKey key(HKEY_LOCAL_MACHINE, tzRegPath);
+ if (key.isValid()) {
DWORD idCount = 0;
if (RegQueryInfoKey(key, 0, 0, 0, &idCount, 0, 0, 0, 0, 0, 0, 0) == ERROR_SUCCESS
&& idCount > 0) {
@@ -311,7 +288,6 @@ QList<QByteArray> availableWindowsIds()
list.append(QString::fromWCharArray(buffer).toUtf8());
}
}
- RegCloseKey(key);
}
return list;
#else // QT_USE_REGISTRY_TIMEZONE
@@ -325,15 +301,10 @@ QByteArray windowsSystemZoneId()
{
#ifdef QT_USE_REGISTRY_TIMEZONE
// On Vista and later is held in the value TimeZoneKeyName in key currTzRegPath
- QString id;
- HKEY key = NULL;
- QString tziKeyPath = QString::fromUtf8(currTzRegPath);
- if (openRegistryKey(tziKeyPath, &key)) {
- id = readRegistryString(key, L"TimeZoneKeyName");
- RegCloseKey(key);
- if (!id.isEmpty())
- return std::move(id).toUtf8();
- }
+ const QString id = QWinRegistryKey(HKEY_LOCAL_MACHINE, currTzRegPath)
+ .stringValue(L"TimeZoneKeyName");
+ if (!id.isEmpty())
+ return id.toUtf8();
// On XP we have to iterate over the zones until we find a match on
// names/offsets with the current data
@@ -371,6 +342,7 @@ QDate calculateTransitionLocalDate(const SYSTEMTIME &rule, int year)
// Otherwise, the rule date is annual and relative:
const int dayOfWeek = rule.wDayOfWeek == 0 ? 7 : rule.wDayOfWeek;
QDate date(year, rule.wMonth, 1);
+ Q_ASSERT(date.isValid());
// How many days before was last dayOfWeek before target month ?
int adjust = dayOfWeek - date.dayOfWeek(); // -6 <= adjust < 7
if (adjust >= 0) // Ensure -7 <= adjust < 0:
@@ -401,6 +373,7 @@ qint64 calculateTransitionForYear(const SYSTEMTIME &rule, int year, int bias)
{
// TODO Consider caching the calculated values - i.e. replace SYSTEMTIME in
// WinTransitionRule; do this in init() once and store the results.
+ Q_ASSERT(year);
const QDate date = calculateTransitionLocalDate(rule, year);
const QTime time = QTime(rule.wHour, rule.wMinute, rule.wSecond);
if (date.isValid() && time.isValid())
@@ -479,6 +452,7 @@ struct TransitionTimePair
int yearEndOffset(const QWinTimeZonePrivate::QWinTransitionRule &rule, int year)
{
+ Q_ASSERT(year);
int offset = rule.standardTimeBias;
// Only needed to help another TransitionTimePair work out year + 1's start
// offset; and the oldYearOffset we use only affects an alleged transition
@@ -572,22 +546,22 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
if (!m_windowsId.isEmpty()) {
#ifdef QT_USE_REGISTRY_TIMEZONE
// Open the base TZI for the time zone
- HKEY baseKey = NULL;
- const QString baseKeyPath = QString::fromUtf8(tzRegPath) + QLatin1Char('\\')
+ const QString baseKeyPath = QString::fromWCharArray(tzRegPath) + QLatin1Char('\\')
+ QString::fromUtf8(m_windowsId);
- if (openRegistryKey(baseKeyPath, &baseKey)) {
+ QWinRegistryKey baseKey(HKEY_LOCAL_MACHINE, baseKeyPath);
+ if (baseKey.isValid()) {
// Load the localized names
- m_displayName = readRegistryString(baseKey, L"Display");
- m_standardName = readRegistryString(baseKey, L"Std");
- m_daylightName = readRegistryString(baseKey, L"Dlt");
+ m_displayName = baseKey.stringValue(L"Display");
+ m_standardName = baseKey.stringValue(L"Std");
+ m_daylightName = baseKey.stringValue(L"Dlt");
// On Vista and later the optional dynamic key holds historic data
const QString dynamicKeyPath = baseKeyPath + QLatin1String("\\Dynamic DST");
- HKEY dynamicKey = NULL;
- if (openRegistryKey(dynamicKeyPath, &dynamicKey)) {
+ QWinRegistryKey dynamicKey(HKEY_LOCAL_MACHINE, dynamicKeyPath);
+ if (dynamicKey.isValid()) {
// Find out the start and end years stored, then iterate over them
- int startYear = readRegistryValue(dynamicKey, L"FirstEntry");
- int endYear = readRegistryValue(dynamicKey, L"LastEntry");
- for (int year = startYear; year <= endYear; ++year) {
+ const auto startYear = dynamicKey.dwordValue(L"FirstEntry");
+ const auto endYear = dynamicKey.dwordValue(L"LastEntry");
+ for (int year = int(startYear.first); year <= int(endYear.first); ++year) {
bool ruleOk;
QWinTransitionRule rule = readRegistryRule(dynamicKey,
reinterpret_cast<LPCWSTR>(QString::number(year).utf16()),
@@ -608,7 +582,6 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
m_tranRules.append(rule);
}
}
- RegCloseKey(dynamicKey);
} else {
// No dynamic data so use the base data
bool ruleOk;
@@ -617,7 +590,6 @@ void QWinTimeZonePrivate::init(const QByteArray &ianaId)
if (ruleOk)
m_tranRules.append(rule);
}
- RegCloseKey(baseKey);
}
#else // QT_USE_REGISTRY_TIMEZONE
if (gTimeZones->isEmpty())
@@ -743,11 +715,12 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
const QWinTransitionRule &rule = m_tranRules.at(ruleIndex);
// Does this rule's period include any transition at all ?
if (rule.standardTimeRule.wMonth > 0 || rule.daylightTimeRule.wMonth > 0) {
- const int endYear = qMax(rule.startYear, year - 1);
+ int prior = year == 1 ? -1 : year - 1; // No year 0.
+ const int endYear = qMax(rule.startYear, prior);
while (year >= endYear) {
const int newYearOffset = (year <= rule.startYear && ruleIndex > 0)
- ? yearEndOffset(m_tranRules.at(ruleIndex - 1), year - 1)
- : yearEndOffset(rule, year - 1);
+ ? yearEndOffset(m_tranRules.at(ruleIndex - 1), prior)
+ : yearEndOffset(rule, prior);
const TransitionTimePair pair(rule, year, newYearOffset);
bool isDst = false;
if (pair.std != invalidMSecs() && pair.std <= forMSecsSinceEpoch) {
@@ -755,7 +728,8 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
} else if (pair.dst != invalidMSecs() && pair.dst <= forMSecsSinceEpoch) {
isDst = true;
} else {
- --year; // Try an earlier year for this rule (once).
+ year = prior; // Try an earlier year for this rule (once).
+ prior = year == 1 ? -1 : year - 1; // No year 0.
continue;
}
return ruleToData(rule, forMSecsSinceEpoch,
@@ -767,8 +741,11 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::data(qint64 forMSecsSinceEpoch) cons
// No transition, no DST, use the year's standard time.
return ruleToData(rule, forMSecsSinceEpoch, QTimeZone::StandardTime);
}
- if (year >= rule.startYear)
+ if (year >= rule.startYear) {
year = rule.startYear - 1; // Seek last transition in new rule.
+ if (!year)
+ --year;
+ }
}
// We don't have relevant data :-(
return invalidData();
@@ -795,9 +772,10 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
year = rule.startYear; // Seek first transition in this rule.
const int endYear = ruleIndex + 1 < m_tranRules.count()
? qMin(m_tranRules.at(ruleIndex + 1).startYear, year + 2) : (year + 2);
+ int prior = year == 1 ? -1 : year - 1; // No year 0.
int newYearOffset = (year <= rule.startYear && ruleIndex > 0)
- ? yearEndOffset(m_tranRules.at(ruleIndex - 1), year - 1)
- : yearEndOffset(rule, year - 1);
+ ? yearEndOffset(m_tranRules.at(ruleIndex - 1), prior)
+ : yearEndOffset(rule, prior);
while (year < endYear) {
const TransitionTimePair pair(rule, year, newYearOffset);
bool isDst = false;
@@ -810,7 +788,9 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::nextTransition(qint64 afterMSecsSinc
newYearOffset = rule.standardTimeBias;
if (pair.dst > pair.std)
newYearOffset += rule.daylightTimeBias;
- ++year; // Try a later year for this rule (once).
+ // Try a later year for this rule (once).
+ prior = year;
+ year = year == -1 ? 1 : year + 1; // No year 0
continue;
}
@@ -837,11 +817,12 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
const QWinTransitionRule &rule = m_tranRules.at(ruleIndex);
// Does this rule's period include any transition at all ?
if (rule.standardTimeRule.wMonth > 0 || rule.daylightTimeRule.wMonth > 0) {
- const int endYear = qMax(rule.startYear, year - 1);
+ int prior = year == 1 ? -1 : year - 1; // No year 0.
+ const int endYear = qMax(rule.startYear, prior);
while (year >= endYear) {
const int newYearOffset = (year <= rule.startYear && ruleIndex > 0)
- ? yearEndOffset(m_tranRules.at(ruleIndex - 1), year - 1)
- : yearEndOffset(rule, year - 1);
+ ? yearEndOffset(m_tranRules.at(ruleIndex - 1), prior)
+ : yearEndOffset(rule, prior);
const TransitionTimePair pair(rule, year, newYearOffset);
bool isDst = false;
if (pair.std != invalidMSecs() && pair.std < beforeMSecsSinceEpoch) {
@@ -849,7 +830,8 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
} else if (pair.dst != invalidMSecs() && pair.dst < beforeMSecsSinceEpoch) {
isDst = true;
} else {
- --year; // Try an earlier year for this rule (once).
+ year = prior; // Try an earlier year for this rule (once).
+ prior = year == 1 ? -1 : year - 1; // No year 0.
continue;
}
if (isDst)
@@ -863,8 +845,11 @@ QTimeZonePrivate::Data QWinTimeZonePrivate::previousTransition(qint64 beforeMSec
// rule:
return ruleToData(rule, startOfTime, QTimeZone::StandardTime, false);
} // else: no transition during rule's period
- if (year >= rule.startYear)
+ if (year >= rule.startYear) {
year = rule.startYear - 1; // Seek last transition in new rule
+ if (!year)
+ --year;
+ }
}
// Apparently no transition before the given time:
return invalidData();
diff --git a/src/corelib/time/time.pri b/src/corelib/time/time.pri
new file mode 100644
index 0000000000..84efbfbfd2
--- /dev/null
+++ b/src/corelib/time/time.pri
@@ -0,0 +1,71 @@
+# Qt time / date / zone / calendar module
+
+HEADERS += \
+ time/qcalendar.h \
+ time/qcalendarbackend_p.h \
+ time/qcalendarmath_p.h \
+ time/qdatetime.h \
+ time/qdatetime_p.h \
+ time/qgregoriancalendar_p.h \
+ time/qjuliancalendar_p.h \
+ time/qmilankoviccalendar_p.h \
+ time/qromancalendar_p.h \
+ time/qromancalendar_data_p.h
+
+SOURCES += \
+ time/qdatetime.cpp \
+ time/qcalendar.cpp \
+ time/qgregoriancalendar.cpp \
+ time/qjuliancalendar.cpp \
+ time/qmilankoviccalendar.cpp \
+ time/qromancalendar.cpp
+
+qtConfig(hijricalendar) {
+ SOURCES += \
+ time/qhijricalendar.cpp
+ HEADERS += \
+ time/qhijricalendar_p.h \
+ time/qhijricalendar_data_p.h
+}
+
+qtConfig(islamiccivilcalendar) {
+ SOURCES += \
+ time/qislamiccivilcalendar.cpp
+ HEADERS += \
+ time/qislamiccivilcalendar_p.h
+}
+
+qtConfig(jalalicalendar) {
+ SOURCES += \
+ time/qjalalicalendar.cpp
+ HEADERS += \
+ time/qjalalicalendar_p.h \
+ time/qjalalicalendar_data_p.h
+}
+
+qtConfig(timezone) {
+ HEADERS += \
+ time/qtimezone.h \
+ time/qtimezoneprivate_p.h \
+ time/qtimezoneprivate_data_p.h
+ SOURCES += \
+ time/qtimezone.cpp \
+ time/qtimezoneprivate.cpp
+ !nacl:darwin: {
+ SOURCES += time/qtimezoneprivate_mac.mm
+ } else: android:!android-embedded: {
+ SOURCES += time/qtimezoneprivate_android.cpp
+ } else: unix: {
+ SOURCES += time/qtimezoneprivate_tz.cpp
+ qtConfig(icu): SOURCES += time/qtimezoneprivate_icu.cpp
+ } else: qtConfig(icu): {
+ SOURCES += time/qtimezoneprivate_icu.cpp
+ } else: win32: {
+ SOURCES += time/qtimezoneprivate_win.cpp
+ }
+}
+
+qtConfig(datetimeparser) {
+ HEADERS += time/qdatetimeparser_p.h
+ SOURCES += time/qdatetimeparser.cpp
+}
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index 0146e22fa3..b01ce0db58 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -524,7 +524,7 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
# if (defined __apple_build_version__ && __clang_major__ >= 7) || (Q_CC_CLANG >= 307)
# define QT_HAS_CONSTEXPR_BUILTINS
# endif
-#elif defined(Q_CC_MSVC) && !defined(Q_CC_INTEL) && !defined(Q_OS_WINCE) && !defined(Q_PROCESSOR_ARM)
+#elif defined(Q_CC_MSVC) && !defined(Q_CC_INTEL) && !defined(Q_PROCESSOR_ARM)
# define QT_HAS_CONSTEXPR_BUILTINS
#elif defined(Q_CC_GNU)
# define QT_HAS_CONSTEXPR_BUILTINS
@@ -533,7 +533,7 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
#if defined QT_HAS_CONSTEXPR_BUILTINS
#if defined(Q_CC_GNU) || defined(Q_CC_CLANG)
# define QT_HAS_BUILTIN_CTZS
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) noexcept
{
# if QT_HAS_BUILTIN(__builtin_ctzs)
return __builtin_ctzs(v);
@@ -542,7 +542,7 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
# endif
}
#define QT_HAS_BUILTIN_CLZS
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) noexcept
{
# if QT_HAS_BUILTIN(__builtin_clzs)
return __builtin_clzs(v);
@@ -551,44 +551,44 @@ Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
# endif
}
#define QT_HAS_BUILTIN_CTZ
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctz(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctz(quint32 v) noexcept
{
return __builtin_ctz(v);
}
#define QT_HAS_BUILTIN_CLZ
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clz(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clz(quint32 v) noexcept
{
return __builtin_clz(v);
}
#define QT_HAS_BUILTIN_CTZLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzll(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzll(quint64 v) noexcept
{
return __builtin_ctzll(v);
}
#define QT_HAS_BUILTIN_CLZLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzll(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzll(quint64 v) noexcept
{
return __builtin_clzll(v);
}
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) noexcept
{
return __builtin_popcount(v);
}
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) noexcept
{
return __builtin_popcount(v);
}
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) noexcept
{
return __builtin_popcount(v);
}
#define QALGORITHMS_USE_BUILTIN_POPCOUNTLL
-Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) noexcept
{
return __builtin_popcountll(v);
}
-#elif defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) && !defined(Q_PROCESSOR_ARM)
+#elif defined(Q_CC_MSVC) && !defined(Q_PROCESSOR_ARM)
#define QT_POPCOUNT_CONSTEXPR
#define QT_POPCOUNT_RELAXED_CONSTEXPR
#define QT_HAS_BUILTIN_CTZ
@@ -630,12 +630,12 @@ Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val)
}
#endif // MSVC 64bit
# define QT_HAS_BUILTIN_CTZS
-Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) noexcept
{
return qt_builtin_ctz(v);
}
#define QT_HAS_BUILTIN_CLZS
-Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) noexcept
{
return qt_builtin_clz(v) - 16U;
}
@@ -652,19 +652,19 @@ Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
#if defined(__AVX__) || defined(__SSE4_2__) || defined(__POPCNT__)
#define QALGORITHMS_USE_BUILTIN_POPCOUNT
#define QALGORITHMS_USE_BUILTIN_POPCOUNTLL
-Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) noexcept
{
return __popcnt(v);
}
-Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint8 v) noexcept
{
return __popcnt16(v);
}
-Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcount(quint16 v) noexcept
{
return __popcnt16(v);
}
-Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
+Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) noexcept
{
#if Q_PROCESSOR_WORDSIZE == 8
return __popcnt64(v);
@@ -685,7 +685,7 @@ Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW
} //namespace QAlgorithmsPrivate
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -698,7 +698,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint32
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -708,7 +708,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint8
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNT
return QAlgorithmsPrivate::qt_builtin_popcount(v);
@@ -719,7 +719,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint16
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64 v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64 v) noexcept
{
#ifdef QALGORITHMS_USE_BUILTIN_POPCOUNTLL
return QAlgorithmsPrivate::qt_builtin_popcountll(v);
@@ -734,7 +734,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(quint64
#endif
}
-Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(long unsigned int v) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(long unsigned int v) noexcept
{
return qPopulationCount(static_cast<quint64>(v));
}
@@ -744,7 +744,7 @@ Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR inline uint qPopulationCount(long un
#endif
#undef QT_POPCOUNT_CONSTEXPR
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZ)
return v ? QAlgorithmsPrivate::qt_builtin_ctz(v) : 32U;
@@ -762,7 +762,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NO
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZ)
return v ? QAlgorithmsPrivate::qt_builtin_ctz(v) : 8U;
@@ -777,7 +777,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOT
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZS)
return v ? QAlgorithmsPrivate::qt_builtin_ctzs(v) : 16U;
@@ -793,7 +793,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NO
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CTZLL)
return v ? QAlgorithmsPrivate::qt_builtin_ctzll(v) : 64;
@@ -804,12 +804,12 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) Q_DECL_NO
#endif
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(unsigned long v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(unsigned long v) noexcept
{
return qCountTrailingZeroBits(QIntegerForSizeof<long>::Unsigned(v));
}
-Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZ)
return v ? QAlgorithmsPrivate::qt_builtin_clz(v) : 32U;
@@ -824,7 +824,7 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOT
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZ)
return v ? QAlgorithmsPrivate::qt_builtin_clz(v)-24U : 8U;
@@ -836,7 +836,7 @@ QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZS)
return v ? QAlgorithmsPrivate::qt_builtin_clzs(v) : 16U;
@@ -849,7 +849,7 @@ QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DEC
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) noexcept
{
#if defined(QT_HAS_BUILTIN_CLZLL)
return v ? QAlgorithmsPrivate::qt_builtin_clzll(v) : 64U;
@@ -864,7 +864,7 @@ QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DEC
#endif
}
-QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) Q_DECL_NOTHROW
+QT_POPCOUNT_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(unsigned long v) noexcept
{
return qCountLeadingZeroBits(QIntegerForSizeof<long>::Unsigned(v));
}
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index a91d833e3b..234a44f6b6 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -41,11 +41,114 @@
#include <QtCore/qarraydata.h>
#include <QtCore/private/qnumeric_p.h>
#include <QtCore/private/qtools_p.h>
+#include <QtCore/qmath.h>
#include <stdlib.h>
QT_BEGIN_NAMESPACE
+/*
+ * This pair of functions is declared in qtools_p.h and is used by the Qt
+ * containers to allocate memory and grow the memory block during append
+ * operations.
+ *
+ * They take size_t parameters and return size_t so they will change sizes
+ * according to the pointer width. However, knowing Qt containers store the
+ * container size and element indexes in ints, these functions never return a
+ * size larger than INT_MAX. This is done by casting the element count and
+ * memory block size to int in several comparisons: the check for negative is
+ * very fast on most platforms as the code only needs to check the sign bit.
+ *
+ * These functions return SIZE_MAX on overflow, which can be passed to malloc()
+ * and will surely cause a NULL return (there's no way you can allocate a
+ * memory block the size of your entire VM space).
+ */
+
+/*!
+ \internal
+ \since 5.7
+
+ Returns the memory block size for a container containing \a elementCount
+ elements, each of \a elementSize bytes, plus a header of \a headerSize
+ bytes. That is, this function returns \c
+ {elementCount * elementSize + headerSize}
+
+ but unlike the simple calculation, it checks for overflows during the
+ multiplication and the addition.
+
+ Both \a elementCount and \a headerSize can be zero, but \a elementSize
+ cannot.
+
+ This function returns SIZE_MAX (~0) on overflow or if the memory block size
+ would not fit an int.
+*/
+size_t qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) noexcept
+{
+ unsigned count = unsigned(elementCount);
+ unsigned size = unsigned(elementSize);
+ unsigned header = unsigned(headerSize);
+ Q_ASSERT(elementSize);
+ Q_ASSERT(size == elementSize);
+ Q_ASSERT(header == headerSize);
+
+ if (Q_UNLIKELY(count != elementCount))
+ return std::numeric_limits<size_t>::max();
+
+ unsigned bytes;
+ if (Q_UNLIKELY(mul_overflow(size, count, &bytes)) ||
+ Q_UNLIKELY(add_overflow(bytes, header, &bytes)))
+ return std::numeric_limits<size_t>::max();
+ if (Q_UNLIKELY(int(bytes) < 0)) // catches bytes >= 2GB
+ return std::numeric_limits<size_t>::max();
+
+ return bytes;
+}
+
+/*!
+ \internal
+ \since 5.7
+
+ Returns the memory block size and the number of elements that will fit in
+ that block for a container containing \a elementCount elements, each of \a
+ elementSize bytes, plus a header of \a headerSize bytes. This function
+ assumes the container will grow and pre-allocates a growth factor.
+
+ Both \a elementCount and \a headerSize can be zero, but \a elementSize
+ cannot.
+
+ This function returns SIZE_MAX (~0) on overflow or if the memory block size
+ would not fit an int.
+
+ \note The memory block may contain up to \a elementSize - 1 bytes more than
+ needed.
+*/
+CalculateGrowingBlockSizeResult
+qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize) noexcept
+{
+ CalculateGrowingBlockSizeResult result = {
+ std::numeric_limits<size_t>::max(),std::numeric_limits<size_t>::max()
+ };
+
+ unsigned bytes = unsigned(qCalculateBlockSize(elementCount, elementSize, headerSize));
+ if (int(bytes) < 0) // catches std::numeric_limits<size_t>::max()
+ return result;
+
+ unsigned morebytes = qNextPowerOfTwo(bytes);
+ if (Q_UNLIKELY(int(morebytes) < 0)) {
+ // catches morebytes == 2GB
+ // grow by half the difference between bytes and morebytes
+ bytes += (morebytes - bytes) / 2;
+ } else {
+ bytes = morebytes;
+ }
+
+ result.elementCount = (bytes - unsigned(headerSize)) / unsigned(elementSize);
+ result.size = bytes;
+ return result;
+}
+
+// End of qtools_p.h implementation
+
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")
@@ -87,7 +190,7 @@ static QArrayData *reallocateData(QArrayData *header, size_t allocSize, uint opt
}
QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
- size_t capacity, AllocationOptions options) Q_DECL_NOTHROW
+ size_t capacity, AllocationOptions options) noexcept
{
// Alignment is a power of two
Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData)
@@ -112,7 +215,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
headerSize += (alignment - Q_ALIGNOF(QArrayData));
if (headerSize > size_t(MaxAllocSize))
- return 0;
+ return nullptr;
size_t allocSize = calculateBlockSize(capacity, objectSize, headerSize, options);
QArrayData *header = static_cast<QArrayData *>(::malloc(allocSize));
@@ -121,9 +224,9 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
& ~(alignment - 1);
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
- header->ref.atomic.store(bool(!(options & Unsharable)));
+ header->ref.atomic.storeRelaxed(bool(!(options & Unsharable)));
#else
- header->ref.atomic.store(1);
+ header->ref.atomic.storeRelaxed(1);
#endif
header->size = 0;
header->alloc = capacity;
@@ -135,7 +238,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
}
QArrayData *QArrayData::reallocateUnaligned(QArrayData *data, size_t objectSize, size_t capacity,
- AllocationOptions options) Q_DECL_NOTHROW
+ AllocationOptions options) noexcept
{
Q_ASSERT(data);
Q_ASSERT(data->isMutable());
@@ -150,7 +253,7 @@ QArrayData *QArrayData::reallocateUnaligned(QArrayData *data, size_t objectSize,
}
void QArrayData::deallocate(QArrayData *data, size_t objectSize,
- size_t alignment) Q_DECL_NOTHROW
+ size_t alignment) noexcept
{
// Alignment is a power of two
Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData)
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index a642fb9b39..dcd95924c1 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -113,14 +113,14 @@ struct Q_CORE_EXPORT QArrayData
}
Q_REQUIRED_RESULT static QArrayData *allocate(size_t objectSize, size_t alignment,
- size_t capacity, AllocationOptions options = Default) Q_DECL_NOTHROW;
+ size_t capacity, AllocationOptions options = Default) noexcept;
Q_REQUIRED_RESULT static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize,
- size_t newCapacity, AllocationOptions newOptions = Default) Q_DECL_NOTHROW;
+ size_t newCapacity, AllocationOptions newOptions = Default) noexcept;
static void deallocate(QArrayData *data, size_t objectSize,
- size_t alignment) Q_DECL_NOTHROW;
+ size_t alignment) noexcept;
static const QArrayData shared_null[2];
- static QArrayData *sharedNull() Q_DECL_NOTHROW { return const_cast<QArrayData*>(shared_null); }
+ static QArrayData *sharedNull() noexcept { return const_cast<QArrayData*>(shared_null); }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QArrayData::AllocationOptions)
@@ -254,7 +254,7 @@ struct QTypedArrayData
return result;
}
- static QTypedArrayData *sharedNull() Q_DECL_NOTHROW
+ static QTypedArrayData *sharedNull() noexcept
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
return static_cast<QTypedArrayData *>(QArrayData::sharedNull());
@@ -306,8 +306,6 @@ struct QArrayDataPointerRef
// accomplished by hiding a static const instance of QStaticArrayData, which is
// POD.
-#if defined(Q_COMPILER_VARIADIC_MACROS)
-#if defined(Q_COMPILER_LAMBDA)
// Hide array inside a lambda
#define Q_ARRAY_LITERAL(Type, ...) \
([]() -> QArrayDataPointerRef<Type> { \
@@ -324,15 +322,18 @@ struct QArrayDataPointerRef
return StaticWrapper::get(); \
}()) \
/**/
+
+#ifdef Q_COMPILER_CONSTEXPR
+#define Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type) Q_STATIC_ASSERT(std::is_literal_type<Type>::value)
+#else
+#define Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type) do {} while (0)
#endif
-#endif // defined(Q_COMPILER_VARIADIC_MACROS)
-#if defined(Q_ARRAY_LITERAL)
#define Q_ARRAY_LITERAL_IMPL(Type, ...) \
- union { Type type_must_be_POD; } dummy; Q_UNUSED(dummy) \
+ Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type); \
\
/* Portable compile-time array size computation */ \
- Type data[] = { __VA_ARGS__ }; Q_UNUSED(data) \
+ Q_CONSTEXPR Type data[] = { __VA_ARGS__ }; Q_UNUSED(data); \
enum { Size = sizeof(data) / sizeof(data[0]) }; \
\
static const QStaticArrayData<Type, Size> literal = { \
@@ -342,31 +343,6 @@ struct QArrayDataPointerRef
{ static_cast<QTypedArrayData<Type> *>( \
const_cast<QArrayData *>(&literal.header)) }; \
/**/
-#else
-// As a fallback, memory is allocated and data copied to the heap.
-
-// The fallback macro does NOT use variadic macros and does NOT support
-// variable number of arguments. It is suitable for char arrays.
-
-namespace QtPrivate {
- template <class T, size_t N>
- inline QArrayDataPointerRef<T> qMakeArrayLiteral(const T (&array)[N])
- {
- union { T type_must_be_POD; } dummy; Q_UNUSED(dummy)
-
- QArrayDataPointerRef<T> result = { QTypedArrayData<T>::allocate(N) };
- Q_CHECK_PTR(result.ptr);
-
- ::memcpy(result.ptr->data(), array, N * sizeof(T));
- result.ptr->size = N;
-
- return result;
- }
-}
-
-#define Q_ARRAY_LITERAL(Type, Array) \
- QT_PREPEND_NAMESPACE(QtPrivate::qMakeArrayLiteral)<Type>( Array )
-#endif // !defined(Q_ARRAY_LITERAL)
namespace QtPrivate {
struct Q_CORE_EXPORT QContainerImplHelper
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 7e1b43f9b1..8e19525f07 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -106,7 +106,7 @@ struct QPodArrayOps
void destroyAll() // Call from destructors, ONLY!
{
Q_ASSERT(this->isMutable());
- Q_ASSERT(this->ref.atomic.load() == 0);
+ Q_ASSERT(this->ref.atomic.loadRelaxed() == 0);
// As this is to be called only from destructor, it doesn't need to be
// exception safe; size not updated.
@@ -204,7 +204,7 @@ struct QGenericArrayOps
// As this is to be called only from destructor, it doesn't need to be
// exception safe; size not updated.
- Q_ASSERT(this->ref.atomic.load() == 0);
+ Q_ASSERT(this->ref.atomic.loadRelaxed() == 0);
const T *const b = this->begin();
const T *i = this->end();
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 51cfa6e849..af5173c9ad 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -52,7 +52,7 @@ private:
typedef QArrayDataOps<T> DataOps;
public:
- QArrayDataPointer() Q_DECL_NOTHROW
+ QArrayDataPointer() noexcept
: d(Data::sharedNull())
{
}
@@ -82,20 +82,18 @@ public:
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
- QArrayDataPointer(QArrayDataPointer &&other) Q_DECL_NOTHROW
+ QArrayDataPointer(QArrayDataPointer &&other) noexcept
: d(other.d)
{
other.d = Data::sharedNull();
}
- QArrayDataPointer &operator=(QArrayDataPointer &&other) Q_DECL_NOTHROW
+ QArrayDataPointer &operator=(QArrayDataPointer &&other) noexcept
{
QArrayDataPointer moved(std::move(other));
this->swap(moved);
return *this;
}
-#endif
DataOps &operator*() const
{
@@ -150,7 +148,7 @@ public:
bool isSharable() const { return d->isSharable(); }
#endif
- void swap(QArrayDataPointer &other) Q_DECL_NOTHROW
+ void swap(QArrayDataPointer &other) noexcept
{
qSwap(d, other.d);
}
@@ -204,22 +202,11 @@ inline bool operator!=(const QArrayDataPointer<T> &lhs, const QArrayDataPointer<
}
template <class T>
-inline void qSwap(QArrayDataPointer<T> &p1, QArrayDataPointer<T> &p2)
+inline void swap(QArrayDataPointer<T> &p1, QArrayDataPointer<T> &p2)
{
p1.swap(p2);
}
QT_END_NAMESPACE
-namespace std
-{
- template <class T>
- inline void swap(
- QT_PREPEND_NAMESPACE(QArrayDataPointer)<T> &p1,
- QT_PREPEND_NAMESPACE(QArrayDataPointer)<T> &p2)
- {
- p1.swap(p2);
- }
-}
-
#endif // include guard
diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h
index ff40bf5654..9b0e931aca 100644
--- a/src/corelib/tools/qbitarray.h
+++ b/src/corelib/tools/qbitarray.h
@@ -50,21 +50,19 @@ class Q_CORE_EXPORT QBitArray
{
friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QBitArray &);
friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QBitArray &);
- friend Q_CORE_EXPORT uint qHash(const QBitArray &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_CORE_EXPORT uint qHash(const QBitArray &key, uint seed) noexcept;
QByteArray d;
public:
- inline QBitArray() Q_DECL_NOTHROW {}
+ inline QBitArray() noexcept {}
explicit QBitArray(int size, bool val = false);
QBitArray(const QBitArray &other) : d(other.d) {}
inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; }
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QBitArray(QBitArray &&other) Q_DECL_NOTHROW : d(std::move(other.d)) {}
- inline QBitArray &operator=(QBitArray &&other) Q_DECL_NOTHROW
+ inline QBitArray(QBitArray &&other) noexcept : d(std::move(other.d)) {}
+ inline QBitArray &operator=(QBitArray &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QBitArray &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QBitArray &other) noexcept { qSwap(d, other.d); }
inline int size() const { return (d.size() << 3) - *d.constData(); }
inline int count() const { return (d.size() << 3) - *d.constData(); }
diff --git a/src/corelib/tools/qcache.h b/src/corelib/tools/qcache.h
index 8c0e7860f7..4fcde46fbc 100644
--- a/src/corelib/tools/qcache.h
+++ b/src/corelib/tools/qcache.h
@@ -51,7 +51,7 @@ class QCache
struct Node {
inline Node() : keyPtr(0) {}
inline Node(T *data, int cost)
- : keyPtr(0), t(data), c(cost), p(0), n(0) {}
+ : keyPtr(nullptr), t(data), c(cost), p(nullptr), n(nullptr) {}
const Key *keyPtr; T *t; int c; Node *p,*n;
};
Node *f, *l;
@@ -71,14 +71,14 @@ class QCache
inline T *relink(const Key &key) {
typename QHash<Key, Node>::iterator i = hash.find(key);
if (typename QHash<Key, Node>::const_iterator(i) == hash.constEnd())
- return 0;
+ return nullptr;
Node &n = *i;
if (f != &n) {
if (n.p) n.p->n = n.n;
if (n.n) n.n->p = n.p;
if (l == &n) l = n.p;
- n.p = 0;
+ n.p = nullptr;
n.n = f;
f->p = &n;
f = &n;
@@ -89,7 +89,7 @@ class QCache
Q_DISABLE_COPY(QCache)
public:
- inline explicit QCache(int maxCost = 100) Q_DECL_NOTHROW;
+ inline explicit QCache(int maxCost = 100) noexcept;
inline ~QCache() { clear(); }
inline int maxCost() const { return mx; }
@@ -116,13 +116,13 @@ private:
};
template <class Key, class T>
-inline QCache<Key, T>::QCache(int amaxCost) Q_DECL_NOTHROW
- : f(0), l(0), mx(amaxCost), total(0) {}
+inline QCache<Key, T>::QCache(int amaxCost) noexcept
+ : f(nullptr), l(nullptr), mx(amaxCost), total(0) {}
template <class Key, class T>
inline void QCache<Key,T>::clear()
{ while (f) { delete f->t; f = f->n; }
- hash.clear(); l = 0; total = 0; }
+ hash.clear(); l = nullptr; total = 0; }
template <class Key, class T>
inline void QCache<Key,T>::setMaxCost(int m)
@@ -153,11 +153,11 @@ inline T *QCache<Key,T>::take(const Key &key)
{
typename QHash<Key, Node>::iterator i = hash.find(key);
if (i == hash.end())
- return 0;
+ return nullptr;
Node &n = *i;
T *t = n.t;
- n.t = 0;
+ n.t = nullptr;
unlink(n);
return t;
}
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index c2b86014ba..aff684fad2 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -254,7 +254,7 @@ namespace {
typedef QString argument_type;
Q_NEVER_INLINE
- result_type operator()(const QString &name) const Q_DECL_NOEXCEPT
+ result_type operator()(const QString &name) const noexcept
{
if (Q_UNLIKELY(name.isEmpty()))
return warn("be empty");
@@ -271,7 +271,7 @@ namespace {
}
Q_NEVER_INLINE
- static bool warn(const char *what) Q_DECL_NOEXCEPT
+ static bool warn(const char *what) noexcept
{
qWarning("QCommandLineOption: Option names cannot %s", what);
return true;
diff --git a/src/corelib/tools/qcommandlineoption.h b/src/corelib/tools/qcommandlineoption.h
index 276be042de..e2ca64acef 100644
--- a/src/corelib/tools/qcommandlineoption.h
+++ b/src/corelib/tools/qcommandlineoption.h
@@ -71,11 +71,9 @@ public:
~QCommandLineOption();
QCommandLineOption &operator=(const QCommandLineOption &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QCommandLineOption &operator=(QCommandLineOption &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QCommandLineOption &operator=(QCommandLineOption &&other) noexcept { swap(other); return *this; }
- void swap(QCommandLineOption &other) Q_DECL_NOTHROW
+ void swap(QCommandLineOption &other) noexcept
{ qSwap(d, other.d); }
QStringList names() const;
diff --git a/src/corelib/tools/qcommandlineparser.cpp b/src/corelib/tools/qcommandlineparser.cpp
index 6817d73143..48501f5271 100644
--- a/src/corelib/tools/qcommandlineparser.cpp
+++ b/src/corelib/tools/qcommandlineparser.cpp
@@ -41,6 +41,7 @@
#include "qcommandlineparser.h"
#include <qcoreapplication.h>
+#include <private/qcoreapplication_p.h>
#include <qhash.h>
#include <qvector.h>
#include <qdebug.h>
@@ -70,11 +71,12 @@ public:
bool parse(const QStringList &args);
void checkParsed(const char *method);
QStringList aliases(const QString &name) const;
- QString helpText() const;
+ QString helpText(bool includeQtOptions) const;
bool registerFoundOption(const QString &optionName);
bool parseOptionValue(const QString &optionName, const QString &argument,
QStringList::const_iterator *argumentIterator,
QStringList::const_iterator argsEnd);
+ Q_NORETURN void showHelp(int exitCode, bool includeQtOptions);
//! Error text set when parse() returns false
QString errorText;
@@ -130,7 +132,7 @@ QStringList QCommandLineParserPrivate::aliases(const QString &optionName) const
{
const NameHash_t::const_iterator it = nameHash.constFind(optionName);
if (it == nameHash.cend()) {
- qWarning("QCommandLineParser: option not defined: \"%s\"", qPrintable(optionName));
+ qWarning("QCommandLineParser: option not defined: \"%ls\"", qUtf16Printable(optionName));
return QStringList();
}
return commandLineOptionList.at(*it).names();
@@ -362,8 +364,10 @@ bool QCommandLineParser::addOption(const QCommandLineOption &option)
if (!optionNames.isEmpty()) {
for (const QString &name : optionNames) {
- if (d->nameHash.contains(name))
+ if (d->nameHash.contains(name)) {
+ qWarning() << "QCommandLineParser: already having an option named" << name;
return false;
+ }
}
d->commandLineOptionList.append(option);
@@ -417,7 +421,9 @@ QCommandLineOption QCommandLineParser::addVersionOption()
/*!
Adds the help option (\c{-h}, \c{--help} and \c{-?} on Windows)
- This option is handled automatically by QCommandLineParser.
+ as well as an option \c{--help-all} to include Qt-specific options in the output.
+
+ These options are handled automatically by QCommandLineParser.
Remember to use setApplicationDescription to set the application description,
which will be displayed when this option is used.
@@ -434,8 +440,10 @@ QCommandLineOption QCommandLineParser::addHelpOption()
<< QStringLiteral("?")
#endif
<< QStringLiteral("h")
- << QStringLiteral("help"), tr("Displays this help."));
+ << QStringLiteral("help"), tr("Displays help on commandline options."));
addOption(opt);
+ QCommandLineOption optHelpAll(QStringLiteral("help-all"), tr("Displays help including Qt specific options."));
+ addOption(optHelpAll);
d->builtinHelpOption = true;
return opt;
}
@@ -552,9 +560,9 @@ static void showParserMessage(const QString &message, MessageType type)
{
#if defined(Q_OS_WINRT)
if (type == UsageMessage)
- qInfo(qPrintable(message));
+ qInfo("%ls", qUtf16Printable(message));
else
- qCritical(qPrintable(message));
+ qCritical("%ls", qUtf16Printable(message));
return;
#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
if (displayMessageBox()) {
@@ -579,7 +587,8 @@ static void showParserMessage(const QString &message, MessageType type)
In addition to parsing the options (like parse()), this function also handles the builtin
options and handles errors.
- The builtin options are \c{--version} if addVersionOption was called and \c{--help} if addHelpOption was called.
+ The builtin options are \c{--version} if addVersionOption was called and
+ \c{--help} / \c{--help-all} if addHelpOption was called.
When invoking one of these options, or when an error happens (for instance an unknown option was
passed), the current process will then stop, using the exit() function.
@@ -598,7 +607,10 @@ void QCommandLineParser::process(const QStringList &arguments)
showVersion();
if (d->builtinHelpOption && isSet(QStringLiteral("help")))
- showHelp(EXIT_SUCCESS);
+ d->showHelp(EXIT_SUCCESS, false);
+
+ if (d->builtinHelpOption && isSet(QStringLiteral("help-all")))
+ d->showHelp(EXIT_SUCCESS, true);
}
/*!
@@ -886,7 +898,7 @@ QStringList QCommandLineParser::values(const QString &optionName) const
return values;
}
- qWarning("QCommandLineParser: option not defined: \"%s\"", qPrintable(optionName));
+ qWarning("QCommandLineParser: option not defined: \"%ls\"", qUtf16Printable(optionName));
return QStringList();
}
@@ -1031,7 +1043,12 @@ Q_NORETURN void QCommandLineParser::showVersion()
*/
Q_NORETURN void QCommandLineParser::showHelp(int exitCode)
{
- showParserMessage(d->helpText(), UsageMessage);
+ d->showHelp(exitCode, false);
+}
+
+Q_NORETURN void QCommandLineParserPrivate::showHelp(int exitCode, bool includeQtOptions)
+{
+ showParserMessage(helpText(includeQtOptions), UsageMessage);
qt_call_post_routines();
::exit(exitCode);
}
@@ -1043,7 +1060,7 @@ Q_NORETURN void QCommandLineParser::showHelp(int exitCode)
*/
QString QCommandLineParser::helpText() const
{
- return d->helpText();
+ return d->helpText(false);
}
static QString wrapText(const QString &names, int longestOptionNameString, const QString &description)
@@ -1101,13 +1118,16 @@ static QString wrapText(const QString &names, int longestOptionNameString, const
return text;
}
-QString QCommandLineParserPrivate::helpText() const
+QString QCommandLineParserPrivate::helpText(bool includeQtOptions) const
{
const QLatin1Char nl('\n');
QString text;
QString usage;
usage += QCoreApplication::instance()->arguments().constFirst(); // executable name
- if (!commandLineOptionList.isEmpty())
+ QList<QCommandLineOption> options = commandLineOptionList;
+ if (includeQtOptions)
+ QCoreApplication::instance()->d_func()->addQtOptions(&options);
+ if (!options.isEmpty())
usage += QLatin1Char(' ') + QCommandLineParser::tr("[options]");
for (const PositionalArgumentDefinition &arg : positionalArgumentDefinitions)
usage += QLatin1Char(' ') + arg.syntax;
@@ -1115,12 +1135,12 @@ QString QCommandLineParserPrivate::helpText() const
if (!description.isEmpty())
text += description + nl;
text += nl;
- if (!commandLineOptionList.isEmpty())
+ if (!options.isEmpty())
text += QCommandLineParser::tr("Options:") + nl;
QStringList optionNameList;
- optionNameList.reserve(commandLineOptionList.size());
+ optionNameList.reserve(options.size());
int longestOptionNameString = 0;
- for (const QCommandLineOption &option : commandLineOptionList) {
+ for (const QCommandLineOption &option : qAsConst(options)) {
if (option.flags() & QCommandLineOption::HiddenFromHelp)
continue;
const QStringList optionNames = option.names();
@@ -1139,14 +1159,14 @@ QString QCommandLineParserPrivate::helpText() const
}
++longestOptionNameString;
auto optionNameIterator = optionNameList.cbegin();
- for (const QCommandLineOption &option : commandLineOptionList) {
+ for (const QCommandLineOption &option : qAsConst(options)) {
if (option.flags() & QCommandLineOption::HiddenFromHelp)
continue;
text += wrapText(*optionNameIterator, longestOptionNameString, option.description());
++optionNameIterator;
}
if (!positionalArgumentDefinitions.isEmpty()) {
- if (!commandLineOptionList.isEmpty())
+ if (!options.isEmpty())
text += nl;
text += QCommandLineParser::tr("Arguments:") + nl;
for (const PositionalArgumentDefinition &arg : positionalArgumentDefinitions)
diff --git a/src/corelib/tools/qcontainerfwd.h b/src/corelib/tools/qcontainerfwd.h
index 646d8908c3..532b4c95ce 100644
--- a/src/corelib/tools/qcontainerfwd.h
+++ b/src/corelib/tools/qcontainerfwd.h
@@ -47,7 +47,9 @@ QT_BEGIN_NAMESPACE
template <class Key, class T> class QCache;
template <class Key, class T> class QHash;
+#ifndef QT_NO_LINKED_LIST
template <class T> class QLinkedList;
+#endif
template <class T> class QList;
template <class Key, class T> class QMap;
template <class Key, class T> class QMultiHash;
diff --git a/src/corelib/tools/qcontainertools_impl.h b/src/corelib/tools/qcontainertools_impl.h
new file mode 100644
index 0000000000..3a0c4381f1
--- /dev/null
+++ b/src/corelib/tools/qcontainertools_impl.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#if 0
+#pragma qt_sync_skip_header_check
+#pragma qt_sync_stop_processing
+#endif
+
+#ifndef QCONTAINERTOOLS_IMPL_H
+#define QCONTAINERTOOLS_IMPL_H
+
+#include <QtCore/qglobal.h>
+#include <iterator>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtPrivate
+{
+template <typename Iterator>
+using IfIsInputIterator = typename std::enable_if<
+ std::is_convertible<typename std::iterator_traits<Iterator>::iterator_category, std::input_iterator_tag>::value,
+ bool>::type;
+
+template <typename Iterator>
+using IfIsForwardIterator = typename std::enable_if<
+ std::is_convertible<typename std::iterator_traits<Iterator>::iterator_category, std::forward_iterator_tag>::value,
+ bool>::type;
+
+template <typename Iterator>
+using IfIsNotForwardIterator = typename std::enable_if<
+ !std::is_convertible<typename std::iterator_traits<Iterator>::iterator_category, std::forward_iterator_tag>::value,
+ bool>::type;
+
+template <typename Container,
+ typename InputIterator,
+ IfIsNotForwardIterator<InputIterator> = true>
+void reserveIfForwardIterator(Container *, InputIterator, InputIterator)
+{
+}
+
+template <typename Container,
+ typename ForwardIterator,
+ IfIsForwardIterator<ForwardIterator> = true>
+void reserveIfForwardIterator(Container *c, ForwardIterator f, ForwardIterator l)
+{
+ c->reserve(static_cast<typename Container::size_type>(std::distance(f, l)));
+}
+
+// for detecting expression validity
+template <typename ... T>
+using void_t = void;
+
+template <typename Iterator, typename = void_t<>>
+struct AssociativeIteratorHasKeyAndValue : std::false_type
+{
+};
+
+template <typename Iterator>
+struct AssociativeIteratorHasKeyAndValue<
+ Iterator,
+ void_t<decltype(std::declval<Iterator &>().key()),
+ decltype(std::declval<Iterator &>().value())>
+ >
+ : std::true_type
+{
+};
+
+template <typename Iterator, typename = void_t<>, typename = void_t<>>
+struct AssociativeIteratorHasFirstAndSecond : std::false_type
+{
+};
+
+template <typename Iterator>
+struct AssociativeIteratorHasFirstAndSecond<
+ Iterator,
+ void_t<decltype(std::declval<Iterator &>()->first),
+ decltype(std::declval<Iterator &>()->second)>
+ >
+ : std::true_type
+{
+};
+
+template <typename Iterator>
+using IfAssociativeIteratorHasKeyAndValue =
+ typename std::enable_if<AssociativeIteratorHasKeyAndValue<Iterator>::value, bool>::type;
+
+template <typename Iterator>
+using IfAssociativeIteratorHasFirstAndSecond =
+ typename std::enable_if<AssociativeIteratorHasFirstAndSecond<Iterator>::value, bool>::type;
+
+} // namespace QtPrivate
+
+QT_END_NAMESPACE
+
+#endif // QCONTAINERTOOLS_IMPL_H
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index fdb9c6d19a..7b74b4f526 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -100,18 +100,16 @@ public:
inline ~QContiguousCache() { if (!d) return; if (!d->ref.deref()) freeData(p); }
- inline void detach() { if (d->ref.load() != 1) detach_helper(); }
- inline bool isDetached() const { return d->ref.load() == 1; }
+ inline void detach() { if (d->ref.loadRelaxed() != 1) detach_helper(); }
+ inline bool isDetached() const { return d->ref.loadRelaxed() == 1; }
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
#endif
QContiguousCache<T> &operator=(const QContiguousCache<T> &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QContiguousCache<T> &operator=(QContiguousCache<T> &&other)
+ inline QContiguousCache<T> &operator=(QContiguousCache<T> &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QContiguousCache<T> &other) { qSwap(d, other.d); }
+ inline void swap(QContiguousCache<T> &other) noexcept { qSwap(d, other.d); }
bool operator==(const QContiguousCache<T> &other) const;
inline bool operator!=(const QContiguousCache<T> &other) const { return !(*this == other); }
@@ -178,7 +176,7 @@ void QContiguousCache<T>::detach_helper()
union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
x.d = allocateData(d->alloc);
- x.d->ref.store(1);
+ x.d->ref.storeRelaxed(1);
x.d->count = d->count;
x.d->start = d->start;
x.d->offset = d->offset;
@@ -217,7 +215,7 @@ void QContiguousCache<T>::setCapacity(int asize)
detach();
union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
x.d = allocateData(asize);
- x.d->ref.store(1);
+ x.d->ref.storeRelaxed(1);
x.d->alloc = asize;
x.d->count = qMin(d->count, asize);
x.d->offset = d->offset + d->count - x.d->count;
@@ -253,7 +251,7 @@ void QContiguousCache<T>::setCapacity(int asize)
template <typename T>
void QContiguousCache<T>::clear()
{
- if (d->ref.load() == 1) {
+ if (d->ref.loadRelaxed() == 1) {
if (QTypeInfo<T>::isComplex) {
int oldcount = d->count;
T * i = p->array + d->start;
@@ -269,7 +267,7 @@ void QContiguousCache<T>::clear()
} else {
union { QContiguousCacheData *d; QContiguousCacheTypedData<T> *p; } x;
x.d = allocateData(d->alloc);
- x.d->ref.store(1);
+ x.d->ref.storeRelaxed(1);
x.d->alloc = d->alloc;
x.d->count = x.d->start = x.d->offset = 0;
x.d->sharable = true;
@@ -289,7 +287,7 @@ QContiguousCache<T>::QContiguousCache(int cap)
{
Q_ASSERT(cap >= 0);
d = allocateData(cap);
- d->ref.store(1);
+ d->ref.storeRelaxed(1);
d->alloc = cap;
d->count = d->start = d->offset = 0;
d->sharable = true;
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 51f48503fb..fa8d21e07a 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -58,6 +58,10 @@ typedef unsigned char BitSequence;
typedef unsigned long long DataLength;
typedef enum { SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2 } HashReturn;
+#ifdef Q_OS_RTEMS
+# undef ALIGN
+#endif
+
#include "../../3rdparty/sha3/KeccakSponge.c"
typedef spongeState hashState;
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index f82048db0f..52c8d13fe3 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -339,6 +339,23 @@ struct TCBPoint {
};
Q_DECLARE_TYPEINFO(TCBPoint, Q_PRIMITIVE_TYPE);
+QDataStream &operator<<(QDataStream &stream, const TCBPoint &point)
+{
+ stream << point._point
+ << point._t
+ << point._c
+ << point._b;
+ return stream;
+}
+
+QDataStream &operator>>(QDataStream &stream, TCBPoint &point)
+{
+ stream >> point._point
+ >> point._t
+ >> point._c
+ >> point._b;
+ return stream;
+}
typedef QVector<TCBPoint> TCBPoints;
@@ -363,6 +380,34 @@ public:
};
+QDataStream &operator<<(QDataStream &stream, QEasingCurveFunction *func)
+{
+ if (func) {
+ stream << func->_p;
+ stream << func->_a;
+ stream << func->_o;
+ if (stream.version() > QDataStream::Qt_5_12) {
+ stream << func->_bezierCurves;
+ stream << func->_tcbPoints;
+ }
+ }
+ return stream;
+}
+
+QDataStream &operator>>(QDataStream &stream, QEasingCurveFunction *func)
+{
+ if (func) {
+ stream >> func->_p;
+ stream >> func->_a;
+ stream >> func->_o;
+ if (stream.version() > QDataStream::Qt_5_12) {
+ stream >> func->_bezierCurves;
+ stream >> func->_tcbPoints;
+ }
+ }
+ return stream;
+}
+
static QEasingCurve::EasingFunction curveToFunc(QEasingCurve::Type curve);
qreal QEasingCurveFunction::value(qreal t)
@@ -538,6 +583,13 @@ struct BezierEase : public QEasingCurveFunction
qWarning("QEasingCurve: Invalid bezier curve");
return x;
}
+
+ // The bezier computation is not always precise on the endpoints, so handle explicitly
+ if (!(x > 0))
+ return 0;
+ if (!(x < 1))
+ return 1;
+
SingleCubicBezier *singleCubicBezier = 0;
getBezierSegment(singleCubicBezier, x);
@@ -862,6 +914,10 @@ struct TCBEase : public BezierEase
return BezierEase::value(x);
}
+ QEasingCurveFunction *copy() const override
+ {
+ return new TCBEase{*this};
+ }
};
struct ElasticEase : public QEasingCurveFunction
@@ -949,6 +1005,11 @@ struct BackEase : public QEasingCurveFunction
qreal value(qreal t) override
{
+ // The *Back() functions are not always precise on the endpoints, so handle explicitly
+ if (!(t > 0))
+ return 0;
+ if (!(t < 1))
+ return 1;
qreal o = (_o < 0) ? qreal(1.70158) : _o;
switch(_t) {
case QEasingCurve::InBack:
@@ -1480,9 +1541,7 @@ QDataStream &operator<<(QDataStream &stream, const QEasingCurve &easing)
bool hasConfig = easing.d_ptr->config;
stream << hasConfig;
if (hasConfig) {
- stream << easing.d_ptr->config->_p;
- stream << easing.d_ptr->config->_a;
- stream << easing.d_ptr->config->_o;
+ stream << easing.d_ptr->config;
}
return stream;
}
@@ -1515,9 +1574,7 @@ QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing)
easing.d_ptr->config = nullptr;
if (hasConfig) {
QEasingCurveFunction *config = curveToFunctionObject(type);
- stream >> config->_p;
- stream >> config->_a;
- stream >> config->_o;
+ stream >> config;
easing.d_ptr->config = config;
}
return stream;
diff --git a/src/corelib/tools/qeasingcurve.h b/src/corelib/tools/qeasingcurve.h
index 74bde5825a..d3a468bb22 100644
--- a/src/corelib/tools/qeasingcurve.h
+++ b/src/corelib/tools/qeasingcurve.h
@@ -41,6 +41,9 @@
#define QEASINGCURVE_H
#include <QtCore/qglobal.h>
+
+QT_REQUIRE_CONFIG(easingcurve);
+
#include <QtCore/qobjectdefs.h>
#include <QtCore/qvector.h>
#if QT_DEPRECATED_SINCE(5, 0)
@@ -80,13 +83,11 @@ public:
QEasingCurve &operator=(const QEasingCurve &other)
{ if ( this != &other ) { QEasingCurve copy(other); swap(copy); } return *this; }
-#ifdef Q_COMPILER_RVALUE_REFS
- QEasingCurve(QEasingCurve &&other) Q_DECL_NOTHROW : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
- QEasingCurve &operator=(QEasingCurve &&other) Q_DECL_NOTHROW
+ QEasingCurve(QEasingCurve &&other) noexcept : d_ptr(other.d_ptr) { other.d_ptr = nullptr; }
+ QEasingCurve &operator=(QEasingCurve &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
-#endif
- void swap(QEasingCurve &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); }
+ void swap(QEasingCurve &other) noexcept { qSwap(d_ptr, other.d_ptr); }
bool operator==(const QEasingCurve &other) const;
inline bool operator!=(const QEasingCurve &other) const
diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h
index 7776dd8c4e..5ba23b344b 100644
--- a/src/corelib/tools/qfreelist_p.h
+++ b/src/corelib/tools/qfreelist_p.h
@@ -171,7 +171,7 @@ class QFreeList
// qDebug("QFreeList: allocating %d elements (%ld bytes) with offset %d", size, size * sizeof(ElementType), offset);
ElementType *v = new ElementType[size];
for (int i = 0; i < size; ++i)
- v[i].next.store(offset + i + 1);
+ v[i].next.storeRelaxed(offset + i + 1);
return v;
}
@@ -225,14 +225,14 @@ template <typename T, typename ConstantsType>
inline typename QFreeList<T, ConstantsType>::ConstReferenceType QFreeList<T, ConstantsType>::at(int x) const
{
const int block = blockfor(x);
- return (_v[block].load())[x].t();
+ return (_v[block].loadRelaxed())[x].t();
}
template <typename T, typename ConstantsType>
inline typename QFreeList<T, ConstantsType>::ReferenceType QFreeList<T, ConstantsType>::operator[](int x)
{
const int block = blockfor(x);
- return (_v[block].load())[x].t();
+ return (_v[block].loadRelaxed())[x].t();
}
template <typename T, typename ConstantsType>
@@ -249,15 +249,15 @@ inline int QFreeList<T, ConstantsType>::next()
if (!v) {
v = allocate((id & ConstantsType::IndexMask) - at, ConstantsType::Sizes[block]);
- if (!_v[block].testAndSetRelease(0, v)) {
+ if (!_v[block].testAndSetRelease(nullptr, v)) {
// race with another thread lost
delete [] v;
v = _v[block].loadAcquire();
- Q_ASSERT(v != 0);
+ Q_ASSERT(v != nullptr);
}
}
- newid = v[at].next.load() | (id & ~ConstantsType::IndexMask);
+ newid = v[at].next.loadRelaxed() | (id & ~ConstantsType::IndexMask);
} while (!_next.testAndSetRelease(id, newid));
// qDebug("QFreeList::next(): returning %d (_next now %d, serial %d)",
// id & ConstantsType::IndexMask,
@@ -271,12 +271,12 @@ inline void QFreeList<T, ConstantsType>::release(int id)
{
int at = id & ConstantsType::IndexMask;
const int block = blockfor(at);
- ElementType *v = _v[block].load();
+ ElementType *v = _v[block].loadRelaxed();
int x, newid;
do {
x = _next.loadAcquire();
- v[at].next.store(x & ConstantsType::IndexMask);
+ v[at].next.storeRelaxed(x & ConstantsType::IndexMask);
newid = incrementserial(x, id);
} while (!_next.testAndSetRelease(x, newid));
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 32e9a4269c..a53d6db997 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -197,7 +197,7 @@ static uint crc32(...)
}
#endif
-static inline uint hash(const uchar *p, size_t len, uint seed) Q_DECL_NOTHROW
+static inline uint hash(const uchar *p, size_t len, uint seed) noexcept
{
uint h = seed;
@@ -210,12 +210,12 @@ static inline uint hash(const uchar *p, size_t len, uint seed) Q_DECL_NOTHROW
return h;
}
-uint qHashBits(const void *p, size_t len, uint seed) Q_DECL_NOTHROW
+uint qHashBits(const void *p, size_t len, uint seed) noexcept
{
return hash(static_cast<const uchar*>(p), int(len), seed);
}
-static inline uint hash(const QChar *p, size_t len, uint seed) Q_DECL_NOTHROW
+static inline uint hash(const QChar *p, size_t len, uint seed) noexcept
{
uint h = seed;
@@ -228,29 +228,29 @@ static inline uint hash(const QChar *p, size_t len, uint seed) Q_DECL_NOTHROW
return h;
}
-uint qHash(const QByteArray &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QByteArray &key, uint seed) noexcept
{
return hash(reinterpret_cast<const uchar *>(key.constData()), size_t(key.size()), seed);
}
#if QT_STRINGVIEW_LEVEL < 2
-uint qHash(const QString &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QString &key, uint seed) noexcept
{
return hash(key.unicode(), size_t(key.size()), seed);
}
-uint qHash(const QStringRef &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QStringRef &key, uint seed) noexcept
{
return hash(key.unicode(), size_t(key.size()), seed);
}
#endif
-uint qHash(QStringView key, uint seed) Q_DECL_NOTHROW
+uint qHash(QStringView key, uint seed) noexcept
{
return hash(key.data(), key.size(), seed);
}
-uint qHash(const QBitArray &bitArray, uint seed) Q_DECL_NOTHROW
+uint qHash(const QBitArray &bitArray, uint seed) noexcept
{
int m = bitArray.d.size() - 1;
uint result = hash(reinterpret_cast<const uchar *>(bitArray.d.constData()),
@@ -264,7 +264,7 @@ uint qHash(const QBitArray &bitArray, uint seed) Q_DECL_NOTHROW
return result;
}
-uint qHash(QLatin1String key, uint seed) Q_DECL_NOTHROW
+uint qHash(QLatin1String key, uint seed) noexcept
{
return hash(reinterpret_cast<const uchar *>(key.data()), size_t(key.size()), seed);
}
@@ -321,7 +321,7 @@ static QBasicAtomicInt qt_qhash_seed = Q_BASIC_ATOMIC_INITIALIZER(-1);
*/
static void qt_initialize_qhash_seed()
{
- if (qt_qhash_seed.load() == -1) {
+ if (qt_qhash_seed.loadRelaxed() == -1) {
int x(qt_create_qhash_seed() & INT_MAX);
qt_qhash_seed.testAndSetRelaxed(-1, x);
}
@@ -340,7 +340,7 @@ static void qt_initialize_qhash_seed()
int qGlobalQHashSeed()
{
qt_initialize_qhash_seed();
- return qt_qhash_seed.load();
+ return qt_qhash_seed.loadRelaxed();
}
/*! \relates QHash
@@ -372,14 +372,14 @@ void qSetGlobalQHashSeed(int newSeed)
return;
if (newSeed == -1) {
int x(qt_create_qhash_seed() & INT_MAX);
- qt_qhash_seed.store(x);
+ qt_qhash_seed.storeRelaxed(x);
} else {
if (newSeed) {
// can't use qWarning here (reentrancy)
fprintf(stderr, "qSetGlobalQHashSeed: forced seed value is not 0, cannot guarantee that the "
"hashing functions will produce a stable value.");
}
- qt_qhash_seed.store(newSeed & INT_MAX);
+ qt_qhash_seed.storeRelaxed(newSeed & INT_MAX);
}
}
@@ -398,7 +398,7 @@ void qSetGlobalQHashSeed(int newSeed)
This function can hash discontiguous memory by invoking it on each chunk,
passing the previous's result in the next call's \a chained argument.
*/
-uint qt_hash(QStringView key, uint chained) Q_DECL_NOTHROW
+uint qt_hash(QStringView key, uint chained) noexcept
{
auto n = key.size();
auto p = key.utf16();
@@ -471,7 +471,7 @@ static int countBits(int hint)
const int MinNumBits = 4;
const QHashData QHashData::shared_null = {
- 0, 0, Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, MinNumBits, 0, 0, 0, true, false, 0
+ nullptr, nullptr, Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, MinNumBits, 0, 0, 0, true, false, 0
};
void *QHashData::allocateNode(int nodeAlign)
@@ -501,15 +501,15 @@ QHashData *QHashData::detach_helper(void (*node_duplicate)(Node *, void *),
if (this == &shared_null)
qt_initialize_qhash_seed(); // may throw
d = new QHashData;
- d->fakeNext = 0;
- d->buckets = 0;
+ d->fakeNext = nullptr;
+ d->buckets = nullptr;
d->ref.initializeOwned();
d->size = size;
d->nodeSize = nodeSize;
d->userNumBits = userNumBits;
d->numBits = numBits;
d->numBuckets = numBuckets;
- d->seed = (this == &shared_null) ? uint(qt_qhash_seed.load()) : seed;
+ d->seed = (this == &shared_null) ? uint(qt_qhash_seed.loadRelaxed()) : seed;
d->sharable = true;
d->strictAlignment = nodeAlign > 8;
d->reserved = 0;
@@ -709,7 +709,7 @@ void QHashData::dump()
}
n = n->next;
}
- qDebug("%s", qPrintable(line));
+ qDebug("%ls", qUtf16Printable(line));
}
}
}
@@ -938,7 +938,7 @@ void QHashData::checkSanity()
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(float key, uint seed) Q_DECL_NOTHROW
+uint qHash(float key, uint seed) noexcept
{
return key != 0.0f ? hash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) : seed ;
}
@@ -948,7 +948,7 @@ uint qHash(float key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(double key, uint seed) Q_DECL_NOTHROW
+uint qHash(double key, uint seed) noexcept
{
return key != 0.0 ? hash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) : seed ;
}
@@ -959,7 +959,7 @@ uint qHash(double key, uint seed) Q_DECL_NOTHROW
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(long double key, uint seed) Q_DECL_NOTHROW
+uint qHash(long double key, uint seed) noexcept
{
return key != 0.0L ? hash(reinterpret_cast<const uchar *>(&key), sizeof(key), seed) : seed ;
}
@@ -1251,6 +1251,17 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
compiled in C++11 mode.
*/
+/*! \fn template <class Key, class T> template <class InputIterator> QHash<Key, T>::QHash(InputIterator begin, InputIterator end)
+ \since 5.14
+
+ Constructs a hash with a copy of each of the elements in the iterator range
+ [\a begin, \a end). Either the elements iterated by the range must be
+ objects with \c{first} and \c{second} data members (like \c{QPair},
+ \c{std::pair}, etc.) convertible to \c Key and to \c T respectively; or the
+ iterators must have \c{key()} and \c{value()} member functions, returning a
+ key convertible to \c Key and a value convertible to \c T respectively.
+*/
+
/*! \fn template <class Key, class T> QHash<Key, T>::QHash(const QHash &other)
Constructs a copy of \a other.
@@ -2586,6 +2597,17 @@ uint qHash(long double key, uint seed) Q_DECL_NOTHROW
\sa operator=()
*/
+/*! \fn template <class Key, class T> template <class InputIterator> QMultiHash::QMultiHash(InputIterator begin, InputIterator end)
+ \since 5.14
+
+ Constructs a multi-hash with a copy of each of the elements in the iterator range
+ [\a begin, \a end). Either the elements iterated by the range must be
+ objects with \c{first} and \c{second} data members (like \c{QPair},
+ \c{std::pair}, etc.) convertible to \c Key and to \c T respectively; or the
+ iterators must have \c{key()} and \c{value()} member functions, returning a
+ key convertible to \c Key and a value convertible to \c T respectively.
+*/
+
/*! \fn template <class Key, class T> QMultiHash<Key, T>::iterator QMultiHash<Key, T>::replace(const Key &key, const T &value)
Inserts a new item with the \a key and a value of \a value.
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index a586ca5671..236e433101 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -46,12 +46,10 @@
#include <QtCore/qlist.h>
#include <QtCore/qrefcount.h>
#include <QtCore/qhashfunctions.h>
-
-#ifdef Q_COMPILER_INITIALIZER_LISTS
-#include <initializer_list>
-#endif
+#include <QtCore/qcontainertools_impl.h>
#include <algorithm>
+#include <initializer_list>
#if defined(Q_CC_MSVC)
#pragma warning( push )
@@ -138,7 +136,7 @@ struct QHashDummyValue
{
};
-inline bool operator==(const QHashDummyValue & /* v1 */, const QHashDummyValue & /* v2 */)
+constexpr bool operator==(const QHashDummyValue &, const QHashDummyValue &) noexcept
{
return true;
}
@@ -240,8 +238,7 @@ class QHash
static inline int alignOfNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(Node)); }
public:
- inline QHash() Q_DECL_NOTHROW : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ inline QHash() noexcept : d(const_cast<QHashData *>(&QHashData::shared_null)) { }
inline QHash(std::initializer_list<std::pair<Key,T> > list)
: d(const_cast<QHashData *>(&QHashData::shared_null))
{
@@ -249,17 +246,36 @@ public:
for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it)
insert(it->first, it->second);
}
-#endif
QHash(const QHash &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); }
~QHash() { if (!d->ref.deref()) freeData(d); }
QHash &operator=(const QHash &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
- QHash &operator=(QHash &&other) Q_DECL_NOTHROW
+ QHash(QHash &&other) noexcept : d(other.d) { other.d = const_cast<QHashData *>(&QHashData::shared_null); }
+ QHash &operator=(QHash &&other) noexcept
{ QHash moved(std::move(other)); swap(moved); return *this; }
+#ifdef Q_QDOC
+ template <typename InputIterator>
+ QHash(InputIterator f, InputIterator l);
+#else
+ template <typename InputIterator, QtPrivate::IfAssociativeIteratorHasKeyAndValue<InputIterator> = true>
+ QHash(InputIterator f, InputIterator l)
+ : QHash()
+ {
+ QtPrivate::reserveIfForwardIterator(this, f, l);
+ for (; f != l; ++f)
+ insert(f.key(), f.value());
+ }
+
+ template <typename InputIterator, QtPrivate::IfAssociativeIteratorHasFirstAndSecond<InputIterator> = true>
+ QHash(InputIterator f, InputIterator l)
+ : QHash()
+ {
+ QtPrivate::reserveIfForwardIterator(this, f, l);
+ for (; f != l; ++f)
+ insert(f->first, f->second);
+ }
#endif
- void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QHash &other) noexcept { qSwap(d, other.d); }
bool operator==(const QHash &other) const;
bool operator!=(const QHash &other) const { return !(*this == other); }
@@ -473,7 +489,7 @@ public:
inline const_key_value_iterator constKeyValueEnd() const { return const_key_value_iterator(end()); }
QPair<iterator, iterator> equal_range(const Key &key);
- QPair<const_iterator, const_iterator> equal_range(const Key &key) const Q_DECL_NOTHROW;
+ QPair<const_iterator, const_iterator> equal_range(const Key &key) const noexcept;
iterator erase(iterator it) { return erase(const_iterator(it.i)); }
iterator erase(const_iterator it);
@@ -512,11 +528,11 @@ private:
static void duplicateNode(QHashData::Node *originalNode, void *newNode);
- bool isValidIterator(const iterator &it) const Q_DECL_NOTHROW
+ bool isValidIterator(const iterator &it) const noexcept
{ return isValidNode(it.i); }
- bool isValidIterator(const const_iterator &it) const Q_DECL_NOTHROW
+ bool isValidIterator(const const_iterator &it) const noexcept
{ return isValidNode(it.i); }
- bool isValidNode(QHashData::Node *node) const Q_DECL_NOTHROW
+ bool isValidNode(QHashData::Node *node) const noexcept
{
#if defined(QT_DEBUG) && !defined(Q_HASH_NO_ITERATOR_DEBUG)
while (node->next)
@@ -941,44 +957,32 @@ Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, T>::findNode(cons
template <class Key, class T>
Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
{
- if (size() != other.size())
- return false;
if (d == other.d)
return true;
+ if (size() != other.size())
+ return false;
const_iterator it = begin();
while (it != end()) {
// Build two equal ranges for i.key(); one for *this and one for other.
// For *this we can avoid a lookup via equal_range, as we know the beginning of the range.
- auto thisEqualRangeEnd = it;
- while (thisEqualRangeEnd != end() && it.key() == thisEqualRangeEnd.key())
- ++thisEqualRangeEnd;
+ auto thisEqualRangeStart = it;
+ const Key &thisEqualRangeKey = it.key();
+ size_type n = 0;
+ do {
+ ++it;
+ ++n;
+ } while (it != end() && it.key() == thisEqualRangeKey);
- const auto otherEqualRange = other.equal_range(it.key());
+ const auto otherEqualRange = other.equal_range(thisEqualRangeKey);
- if (std::distance(it, thisEqualRangeEnd) != std::distance(otherEqualRange.first, otherEqualRange.second))
+ if (n != std::distance(otherEqualRange.first, otherEqualRange.second))
return false;
// Keys in the ranges are equal by construction; this checks only the values.
- //
- // When using the 3-arg std::is_permutation, MSVC will emit warning C4996,
- // passing an unchecked iterator to a Standard Library algorithm. We don't
- // want to suppress the warning, and we can't use stdext::make_checked_array_iterator
- // because QHash::(const_)iterator does not work with size_t and thus will
- // emit more warnings. Use the 4-arg std::is_permutation instead (which
- // is supported since MSVC 2015).
- //
- // ### Qt 6: if C++14 library support is a mandated minimum, remove the ifdef for MSVC.
- if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first
-#ifdef Q_CC_MSVC
- , otherEqualRange.second
-#endif
- )) {
+ if (!qt_is_permutation(thisEqualRangeStart, it, otherEqualRange.first, otherEqualRange.second))
return false;
- }
-
- it = thisEqualRangeEnd;
}
return true;
@@ -993,7 +997,7 @@ QPair<typename QHash<Key, T>::iterator, typename QHash<Key, T>::iterator> QHash<
}
template <class Key, class T>
-QPair<typename QHash<Key, T>::const_iterator, typename QHash<Key, T>::const_iterator> QHash<Key, T>::equal_range(const Key &akey) const Q_DECL_NOTHROW
+QPair<typename QHash<Key, T>::const_iterator, typename QHash<Key, T>::const_iterator> QHash<Key, T>::equal_range(const Key &akey) const noexcept
{
Node *node = *findNode(akey);
const_iterator firstIt = const_iterator(node);
@@ -1020,23 +1024,39 @@ template <class Key, class T>
class QMultiHash : public QHash<Key, T>
{
public:
- QMultiHash() Q_DECL_NOTHROW {}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ QMultiHash() noexcept {}
inline QMultiHash(std::initializer_list<std::pair<Key,T> > list)
{
this->reserve(int(list.size()));
for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it)
insert(it->first, it->second);
}
+#ifdef Q_QDOC
+ template <typename InputIterator>
+ QMultiHash(InputIterator f, InputIterator l);
+#else
+ template <typename InputIterator, QtPrivate::IfAssociativeIteratorHasKeyAndValue<InputIterator> = true>
+ QMultiHash(InputIterator f, InputIterator l)
+ {
+ QtPrivate::reserveIfForwardIterator(this, f, l);
+ for (; f != l; ++f)
+ insert(f.key(), f.value());
+ }
+
+ template <typename InputIterator, QtPrivate::IfAssociativeIteratorHasFirstAndSecond<InputIterator> = true>
+ QMultiHash(InputIterator f, InputIterator l)
+ {
+ QtPrivate::reserveIfForwardIterator(this, f, l);
+ for (; f != l; ++f)
+ insert(f->first, f->second);
+ }
#endif
// compiler-generated copy/move ctors/assignment operators are fine!
// compiler-generated destructor is fine!
QMultiHash(const QHash<Key, T> &other) : QHash<Key, T>(other) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- QMultiHash(QHash<Key, T> &&other) Q_DECL_NOTHROW : QHash<Key, T>(std::move(other)) {}
-#endif
- void swap(QMultiHash &other) Q_DECL_NOTHROW { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
+ QMultiHash(QHash<Key, T> &&other) noexcept : QHash<Key, T>(std::move(other)) {}
+ void swap(QMultiHash &other) noexcept { QHash<Key, T>::swap(other); } // prevent QMultiHash<->QHash swaps
inline typename QHash<Key, T>::iterator replace(const Key &key, const T &value)
{ return QHash<Key, T>::insert(key, value); }
@@ -1130,7 +1150,7 @@ Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash)
template <class Key, class T>
uint qHash(const QHash<Key, T> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval<Key&>())) && noexcept(qHash(std::declval<T&>())))
+ noexcept(noexcept(qHash(std::declval<Key&>())) && noexcept(qHash(std::declval<T&>())))
{
QtPrivate::QHashCombineCommutative hash;
for (auto it = key.begin(), end = key.end(); it != end; ++it) {
@@ -1143,7 +1163,7 @@ uint qHash(const QHash<Key, T> &key, uint seed = 0)
template <class Key, class T>
inline uint qHash(const QMultiHash<Key, T> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(std::declval<Key&>())) && noexcept(qHash(std::declval<T&>())))
+ noexcept(noexcept(qHash(std::declval<Key&>())) && noexcept(qHash(std::declval<T&>())))
{
const QHash<Key, T> &key2 = key;
return qHash(key2, seed);
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
index d013c26d66..2ff3464912 100644
--- a/src/corelib/tools/qhashfunctions.h
+++ b/src/corelib/tools/qhashfunctions.h
@@ -45,6 +45,7 @@
#include <QtCore/qpair.h>
#include <numeric> // for std::accumulate
+#include <functional> // for std::hash
#if 0
#pragma qt_class(QHashFunctions)
@@ -67,54 +68,54 @@ class QLatin1String;
Q_CORE_EXPORT int qGlobalQHashSeed();
Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed);
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHashBits(const void *p, size_t size, uint seed = 0) noexcept;
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uchar key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(signed char key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ushort key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(short key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uint key, uint seed = 0) Q_DECL_NOTHROW { return key ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(int key, uint seed = 0) Q_DECL_NOTHROW { return uint(key) ^ seed; }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ulong key, uint seed = 0) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(char key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uchar key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(signed char key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ushort key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(short key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(uint key, uint seed = 0) noexcept { return key ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(int key, uint seed = 0) noexcept { return uint(key) ^ seed; }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(ulong key, uint seed = 0) noexcept
{
return (sizeof(ulong) > sizeof(uint))
? (uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed)
: (uint(key & (~0U)) ^ seed);
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(long key, uint seed = 0) Q_DECL_NOTHROW { return qHash(ulong(key), seed); }
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(quint64 key, uint seed = 0) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(long key, uint seed = 0) noexcept { return qHash(ulong(key), seed); }
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(quint64 key, uint seed = 0) noexcept
{
return uint(((key >> (8 * sizeof(uint) - 1)) ^ key) & (~0U)) ^ seed;
}
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(qint64 key, uint seed = 0) Q_DECL_NOTHROW { return qHash(quint64(key), seed); }
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(float key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(double key, uint seed = 0) Q_DECL_NOTHROW;
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(qint64 key, uint seed = 0) noexcept { return qHash(quint64(key), seed); }
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(float key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(double key, uint seed = 0) noexcept;
#if !defined(Q_OS_DARWIN) || defined(Q_CLANG_QDOC)
-Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_CONST_FUNCTION uint qHash(long double key, uint seed = 0) noexcept;
#endif
-Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(const QChar key, uint seed = 0) Q_DECL_NOTHROW { return qHash(key.unicode(), seed); }
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QByteArray &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qHash(const QChar key, uint seed = 0) noexcept { return qHash(key.unicode(), seed); }
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QByteArray &key, uint seed = 0) noexcept;
#if QT_STRINGVIEW_LEVEL < 2
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QString &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QStringRef &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QString &key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QStringRef &key, uint seed = 0) noexcept;
#endif
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QStringView key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QBitArray &key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QLatin1String key, uint seed = 0) Q_DECL_NOTHROW;
-Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QStringView key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QBitArray &key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qHash(QLatin1String key, uint seed = 0) noexcept;
+Q_CORE_EXPORT Q_DECL_PURE_FUNCTION uint qt_hash(QStringView key, uint chained = 0) noexcept;
-Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) Q_DECL_NOTHROW
+Q_DECL_CONST_FUNCTION inline uint qHash(std::nullptr_t, uint seed = 0) noexcept
{
return qHash(reinterpret_cast<quintptr>(nullptr), seed);
}
-template <class T> inline uint qHash(const T *key, uint seed = 0) Q_DECL_NOTHROW
+template <class T> inline uint qHash(const T *key, uint seed = 0) noexcept
{
return qHash(reinterpret_cast<quintptr>(key), seed);
}
template<typename T> inline uint qHash(const T &t, uint seed)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
+ noexcept(noexcept(qHash(t)))
{ return qHash(t) ^ seed; }
namespace QtPrivate {
@@ -122,7 +123,7 @@ namespace QtPrivate {
struct QHashCombine {
typedef uint result_type;
template <typename T>
- Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
+ Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const noexcept(noexcept(qHash(t)))
// combiner taken from N3876 / boost::hash_combine
{ return seed ^ (qHash(t) + 0x9e3779b9 + (seed << 6) + (seed >> 2)) ; }
};
@@ -135,7 +136,7 @@ struct QHashCombineCommutative {
// QHash). Therefore, provide a commutative combiner, too.
typedef uint result_type;
template <typename T>
- Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
+ Q_DECL_CONSTEXPR result_type operator()(uint seed, const T &t) const noexcept(noexcept(qHash(t)))
{ return seed + qHash(t); } // don't use xor!
};
@@ -143,20 +144,20 @@ struct QHashCombineCommutative {
template <typename InputIterator>
inline uint qHashRange(InputIterator first, InputIterator last, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw
+ noexcept(noexcept(qHash(*first))) // assume iterator operations don't throw
{
return std::accumulate(first, last, seed, QtPrivate::QHashCombine());
}
template <typename InputIterator>
inline uint qHashRangeCommutative(InputIterator first, InputIterator last, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(*first))) // assume iterator operations don't throw
+ noexcept(noexcept(qHash(*first))) // assume iterator operations don't throw
{
return std::accumulate(first, last, seed, QtPrivate::QHashCombineCommutative());
}
template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed)))
+ noexcept(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed)))
{
uint h1 = qHash(key.first, seed);
uint h2 = qHash(key.second, seed);
@@ -164,7 +165,7 @@ template <typename T1, typename T2> inline uint qHash(const QPair<T1, T2> &key,
}
template <typename T1, typename T2> inline uint qHash(const std::pair<T1, T2> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed)))
+ noexcept(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed)))
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.first);
@@ -172,6 +173,41 @@ template <typename T1, typename T2> inline uint qHash(const std::pair<T1, T2> &k
return seed;
}
+#define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH(Class, Arguments) \
+ QT_BEGIN_INCLUDE_NAMESPACE \
+ namespace std { \
+ template <> \
+ struct hash< QT_PREPEND_NAMESPACE(Class) > { \
+ using argument_type = QT_PREPEND_NAMESPACE(Class); \
+ using result_type = size_t; \
+ size_t operator()(Arguments s) const \
+ noexcept(noexcept(QT_PREPEND_NAMESPACE(qHash)(s))) \
+ { \
+ /* this seeds qHash with the result of */ \
+ /* std::hash applied to an int, to reap */ \
+ /* any protection against predictable hash */ \
+ /* values the std implementation may provide */ \
+ return QT_PREPEND_NAMESPACE(qHash)(s, \
+ QT_PREPEND_NAMESPACE(qHash)( \
+ std::hash<int>{}(0))); \
+ } \
+ }; \
+ } \
+ QT_END_INCLUDE_NAMESPACE \
+ /*end*/
+
+#define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(Class) \
+ QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH(Class, const argument_type &)
+#define QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_VALUE(Class) \
+ QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH(Class, argument_type)
+
+QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QString)
+QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QStringRef)
+QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_VALUE(QStringView)
+QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_VALUE(QLatin1String)
+QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QByteArray)
+QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QBitArray)
+
QT_END_NAMESPACE
#if defined(Q_CC_MSVC)
diff --git a/src/corelib/tools/qiterator.h b/src/corelib/tools/qiterator.h
index 177a4f1a4c..84a0e116ca 100644
--- a/src/corelib/tools/qiterator.h
+++ b/src/corelib/tools/qiterator.h
@@ -44,6 +44,8 @@
QT_BEGIN_NAMESPACE
+#if !defined(QT_NO_JAVA_STYLE_ITERATORS)
+
#define Q_DECLARE_SEQUENTIAL_ITERATOR(C) \
\
template <class T> \
@@ -179,6 +181,13 @@ public: \
n = c->end(); return false; } \
};
+#else // QT_NO_JAVA_STYLE_ITERATORS
+#define Q_DECLARE_SEQUENTIAL_ITERATOR(C)
+#define Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(C)
+#define Q_DECLARE_ASSOCIATIVE_ITERATOR(C)
+#define Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(C)
+#endif // QT_NO_JAVA_STYLE_ITERATORS
+
template<typename Key, typename T, class Iterator>
class QKeyValueIterator
{
@@ -190,15 +199,15 @@ public:
typedef const value_type &reference;
QKeyValueIterator() = default;
- Q_DECL_CONSTEXPR explicit QKeyValueIterator(Iterator o) Q_DECL_NOEXCEPT_EXPR(std::is_nothrow_move_constructible<Iterator>::value)
+ Q_DECL_CONSTEXPR explicit QKeyValueIterator(Iterator o) noexcept(std::is_nothrow_move_constructible<Iterator>::value)
: i(std::move(o)) {}
std::pair<Key, T> operator*() const {
return std::pair<Key, T>(i.key(), i.value());
}
- friend bool operator==(QKeyValueIterator lhs, QKeyValueIterator rhs) Q_DECL_NOEXCEPT { return lhs.i == rhs.i; }
- friend bool operator!=(QKeyValueIterator lhs, QKeyValueIterator rhs) Q_DECL_NOEXCEPT { return lhs.i != rhs.i; }
+ friend bool operator==(QKeyValueIterator lhs, QKeyValueIterator rhs) noexcept { return lhs.i == rhs.i; }
+ friend bool operator!=(QKeyValueIterator lhs, QKeyValueIterator rhs) noexcept { return lhs.i != rhs.i; }
inline QKeyValueIterator &operator++() { ++i; return *this; }
inline QKeyValueIterator operator++(int) { return QKeyValueIterator(i++);}
diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp
index 949f63ea15..3afd23d76b 100644
--- a/src/corelib/tools/qline.cpp
+++ b/src/corelib/tools/qline.cpp
@@ -347,7 +347,7 @@ QDataStream &operator>>(QDataStream &stream, QLine &line)
function to determine whether the QLineF represents a valid line
or a null line.
- The intersect() function determines the IntersectType for this
+ The intersects() function determines the IntersectionType for this
line and a given line, while the angleTo() function returns the
angle between the lines. In addition, the unitVector() function
returns a line that has the same starting point as this line, but
@@ -370,6 +370,11 @@ QDataStream &operator>>(QDataStream &stream, QLine &line)
/*!
\enum QLineF::IntersectType
+ \obsolete Use QLineF::IntersectionType instead
+*/
+
+/*!
+ \enum QLineF::IntersectionType
Describes the intersection between two lines.
@@ -657,8 +662,10 @@ QLineF QLineF::unitVector() const
return f;
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
\fn QLineF::IntersectType QLineF::intersect(const QLineF &line, QPointF *intersectionPoint) const
+ \obsolete Use intersects() instead
Returns a value indicating whether or not \e this line intersects
with the given \a line.
@@ -670,6 +677,23 @@ QLineF QLineF::unitVector() const
QLineF::IntersectType QLineF::intersect(const QLineF &l, QPointF *intersectionPoint) const
{
+ return intersects(l, intersectionPoint);
+}
+#endif
+
+/*!
+ \fn QLineF::IntersectionType QLineF::intersects(const QLineF &line, QPointF *intersectionPoint) const
+ \since 5.14
+
+ Returns a value indicating whether or not \e this line intersects
+ with the given \a line.
+
+ The actual intersection point is extracted to \a intersectionPoint
+ (if the pointer is valid). If the lines are parallel, the
+ intersection point is undefined.
+*/
+QLineF::IntersectionType QLineF::intersects(const QLineF &l, QPointF *intersectionPoint) const
+{
// ipmlementation is based on Graphics Gems III's "Faster Line Segment Intersection"
const QPointF a = pt2 - pt1;
const QPointF b = l.pt1 - l.pt2;
@@ -805,6 +829,7 @@ qreal QLineF::angleTo(const QLineF &l) const
return delta_normalized;
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
\fn qreal QLineF::angle(const QLineF &line) const
@@ -837,6 +862,7 @@ qreal QLineF::angle(const QLineF &l) const
if (cos_line >= -1.0 && cos_line <= 1.0) rad = qAcos( cos_line );
return rad * 360 / M_2PI;
}
+#endif
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/corelib/tools/qline.h b/src/corelib/tools/qline.h
index 6361c1af9f..c96d624afd 100644
--- a/src/corelib/tools/qline.h
+++ b/src/corelib/tools/qline.h
@@ -215,6 +215,7 @@ class Q_CORE_EXPORT QLineF {
public:
enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
+ using IntersectionType = IntersectType;
Q_DECL_CONSTEXPR inline QLineF();
Q_DECL_CONSTEXPR inline QLineF(const QPointF &pt1, const QPointF &pt2);
@@ -248,10 +249,14 @@ public:
Q_REQUIRED_RESULT QLineF unitVector() const;
Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF normalVector() const;
- // ### Qt 6: rename intersects() or intersection() and rename IntersectType IntersectionType
- IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
+ IntersectionType intersects(const QLineF &l, QPointF *intersectionPoint) const;
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_VERSION_X(5, 14, "Use intersects() instead")
+ IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const;
+ QT_DEPRECATED_X("Use angleTo() instead, take care that the return value is between 0 and 360 degree.")
qreal angle(const QLineF &l) const;
+#endif
Q_DECL_CONSTEXPR inline QPointF pointAt(qreal t) const;
inline void translate(const QPointF &p);
diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp
index d9d93862e5..3b1bc8aab1 100644
--- a/src/corelib/tools/qlinkedlist.cpp
+++ b/src/corelib/tools/qlinkedlist.cpp
@@ -37,6 +37,10 @@
**
****************************************************************************/
+#ifdef QT_NO_LINKED_LIST
+# undef QT_NO_LINKED_LIST
+#endif
+
#include "qlinkedlist.h"
QT_BEGIN_NAMESPACE
@@ -153,6 +157,14 @@ const QLinkedListData QLinkedListData::shared_null = {
initializer lists.
*/
+/*! \fn template <class T> template<typename InputIterator> QLinkedList<T>::QLinkedList(InputIterator first, InputIterator last)
+ \since 5.14
+
+ Constructs a list with the contents in the iterator range [\a first, \a last).
+
+ The value type of \c InputIterator must be convertible to \c T.
+*/
+
/*! \fn template <class T> QLinkedList<T>::~QLinkedList()
Destroys the list. References to the values in the list, and all
@@ -734,8 +746,7 @@ const QLinkedListData QLinkedListData::shared_null = {
\snippet code/src_corelib_tools_qlinkedlist.cpp 7
STL-style iterators can be used as arguments to \l{generic
- algorithms}. For example, here's how to find an item in the list
- using the qFind() algorithm:
+ algorithms}. For example, here's how to find an item in the list:
\snippet code/src_corelib_tools_qlinkedlist.cpp 8
@@ -979,8 +990,7 @@ const QLinkedListData QLinkedListData::shared_null = {
\snippet code/src_corelib_tools_qlinkedlist.cpp 14
STL-style iterators can be used as arguments to \l{generic
- algorithms}. For example, here's how to find an item in the list
- using the qFind() algorithm:
+ algorithms}. For example, here's how to find an item in the list:
\snippet code/src_corelib_tools_qlinkedlist.cpp 15
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 1e6d4df474..8970d39be0 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -40,18 +40,21 @@
#ifndef QLINKEDLIST_H
#define QLINKEDLIST_H
+#include <QtCore/qglobal.h>
+
+#ifndef QT_NO_LINKED_LIST
+
#include <QtCore/qiterator.h>
#include <QtCore/qrefcount.h>
+#include <QtCore/qcontainertools_impl.h>
+#include <QtCore/qdatastream.h>
+#include <QtCore/qtypeinfo.h>
+#include <algorithm>
+#include <initializer_list>
#include <iterator>
#include <list>
-#include <algorithm>
-
-#if defined(Q_COMPILER_INITIALIZER_LISTS)
-# include <initializer_list>
-#endif
-
QT_BEGIN_NAMESPACE
@@ -80,24 +83,23 @@ class QLinkedList
union { QLinkedListData *d; QLinkedListNode<T> *e; };
public:
- inline QLinkedList() Q_DECL_NOTHROW : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null)) { }
+ inline QLinkedList() noexcept : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null)) { }
inline QLinkedList(const QLinkedList<T> &l) : d(l.d) { d->ref.ref(); if (!d->sharable) detach(); }
-#if defined(Q_COMPILER_INITIALIZER_LISTS)
inline QLinkedList(std::initializer_list<T> list)
- : d(const_cast<QLinkedListData *>(&QLinkedListData::shared_null))
+ : QLinkedList(list.begin(), list.end()) {}
+ template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
+ inline QLinkedList(InputIterator first, InputIterator last)
+ : QLinkedList()
{
- std::copy(list.begin(), list.end(), std::back_inserter(*this));
+ std::copy(first, last, std::back_inserter(*this));
}
-#endif
~QLinkedList();
QLinkedList<T> &operator=(const QLinkedList<T> &);
-#ifdef Q_COMPILER_RVALUE_REFS
- QLinkedList(QLinkedList<T> &&other) Q_DECL_NOTHROW
+ QLinkedList(QLinkedList<T> &&other) noexcept
: d(other.d) { other.d = const_cast<QLinkedListData *>(&QLinkedListData::shared_null); }
- QLinkedList<T> &operator=(QLinkedList<T> &&other) Q_DECL_NOTHROW
+ QLinkedList<T> &operator=(QLinkedList<T> &&other) noexcept
{ QLinkedList moved(std::move(other)); swap(moved); return *this; }
-#endif
- inline void swap(QLinkedList<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QLinkedList<T> &other) noexcept { qSwap(d, other.d); }
bool operator==(const QLinkedList<T> &l) const;
inline bool operator!=(const QLinkedList<T> &l) const { return !(*this == l); }
@@ -137,10 +139,10 @@ public:
inline iterator() : i(nullptr) {}
inline iterator(Node *n) : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- iterator(const iterator &other) Q_DECL_NOTHROW : i(other.i) {}
- iterator &operator=(const iterator &other) Q_DECL_NOTHROW { i = other.i; return *this; }
- iterator(iterator &&other) Q_DECL_NOTHROW : i(other.i) {}
- iterator &operator=(iterator &&other) Q_DECL_NOTHROW { return *this = other; }
+ iterator(const iterator &other) noexcept : i(other.i) {}
+ iterator &operator=(const iterator &other) noexcept { i = other.i; return *this; }
+ iterator(iterator &&other) noexcept : i(other.i) {}
+ iterator &operator=(iterator &&other) noexcept { return *this = other; }
#endif
inline T &operator*() const { return i->t; }
inline T *operator->() const { return &i->t; }
@@ -176,10 +178,10 @@ public:
inline const_iterator(Node *n) : i(n) {}
inline const_iterator(iterator ci) : i(ci.i){}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- const_iterator(const const_iterator &other) Q_DECL_NOTHROW : i(other.i) {}
- const_iterator &operator=(const const_iterator &other) Q_DECL_NOTHROW { i = other.i; return *this; }
- const_iterator(const_iterator &&other) Q_DECL_NOTHROW : i(other.i) {}
- const_iterator &operator=(const_iterator &&other) Q_DECL_NOTHROW { return *this = other; }
+ const_iterator(const const_iterator &other) noexcept : i(other.i) {}
+ const_iterator &operator=(const const_iterator &other) noexcept { i = other.i; return *this; }
+ const_iterator(const_iterator &&other) noexcept : i(other.i) {}
+ const_iterator &operator=(const_iterator &&other) noexcept { return *this = other; }
#endif
inline const T &operator*() const { return i->t; }
inline const T *operator->() const { return &i->t; }
@@ -203,20 +205,20 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { detach(); return e->n; }
- inline const_iterator begin() const Q_DECL_NOTHROW { return e->n; }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return e->n; }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return e->n; }
+ inline const_iterator begin() const noexcept { return e->n; }
+ inline const_iterator cbegin() const noexcept { return e->n; }
+ inline const_iterator constBegin() const noexcept { return e->n; }
inline iterator end() { detach(); return e; }
- inline const_iterator end() const Q_DECL_NOTHROW { return e; }
- inline const_iterator cend() const Q_DECL_NOTHROW { return e; }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return e; }
+ inline const_iterator end() const noexcept { return e; }
+ inline const_iterator cend() const noexcept { return e; }
+ inline const_iterator constEnd() const noexcept { return e; }
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator insert(iterator before, const T &t);
iterator erase(iterator pos);
@@ -270,6 +272,15 @@ private:
iterator detach_helper2(iterator);
void freeData(QLinkedListData*);
};
+template <typename T>
+Q_DECLARE_TYPEINFO_BODY(QLinkedList<T>, Q_MOVABLE_TYPE|Q_RELOCATABLE_TYPE);
+
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+template <typename InputIterator,
+ typename ValueType = typename std::iterator_traits<InputIterator>::value_type,
+ QtPrivate::IfIsInputIterator<InputIterator> = true>
+QLinkedList(InputIterator, InputIterator) -> QLinkedList<ValueType>;
+#endif
template <typename T>
inline QLinkedList<T>::~QLinkedList()
@@ -340,7 +351,7 @@ void QLinkedList<T>::freeData(QLinkedListData *x)
{
Node *y = reinterpret_cast<Node*>(x);
Node *i = y->n;
- Q_ASSERT(x->ref.atomic.load() == 0);
+ Q_ASSERT(x->ref.atomic.loadRelaxed() == 0);
while (i != y) {
Node *n = i;
i = i->n;
@@ -565,6 +576,24 @@ QLinkedList<T> QLinkedList<T>::operator+(const QLinkedList<T> &l) const
Q_DECLARE_SEQUENTIAL_ITERATOR(LinkedList)
Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(LinkedList)
+#ifndef QT_NO_DATASTREAM
+template <typename T>
+inline QDataStream &operator>>(QDataStream &s, QLinkedList<T> &l)
+{
+ return QtPrivate::readListBasedContainer(s, l);
+}
+
+template <typename T>
+inline QDataStream &operator<<(QDataStream &s, const QLinkedList<T> &l)
+{
+ return QtPrivate::writeSequentialContainer(s, l);
+}
+#endif
+
QT_END_NAMESPACE
+Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(QLinkedList)
+
+#endif // QT_NO_LINKED_LIST
+
#endif // QLINKEDLIST_H
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 6f8084c676..66770f6866 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -75,7 +75,7 @@ template class Q_CORE_EXPORT QVector<QPoint>;
the number of elements in the list.
*/
-const QListData::Data QListData::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, { 0 } };
+const QListData::Data QListData::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, { nullptr } };
/*!
* Detaches the QListData by allocating new memory for a list which will be bigger
@@ -545,6 +545,14 @@ void **QListData::erase(void **xi)
\since 5.2
*/
+/*! \fn template <class T> template<typename InputIterator> QList<T>::QList(InputIterator first, InputIterator last)
+ \since 5.14
+
+ Constructs a QList with the contents in the iterator range [\a first, \a last).
+
+ The value type of \c InputIterator must be convertible to \c T.
+*/
+
/*!
\fn template <class T> QList<T> QList<T>::mid(int pos, int length) const
@@ -2006,6 +2014,8 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 21
+ \include containers-range-constructor.qdocinc
+
\sa fromSet(), toVector(), QVector::toList()
*/
@@ -2017,6 +2027,8 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 22
+ \include containers-range-constructor.qdocinc
+
\sa toSet(), fromVector(), QVector::fromList()
*/
@@ -2029,6 +2041,8 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 23
+ \include containers-range-constructor.qdocinc
+
\sa fromVector(), toSet(), QSet::toList()
*/
@@ -2042,6 +2056,8 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 24
+ \include containers-range-constructor.qdocinc
+
\sa toVector(), fromSet(), QSet::fromList()
*/
@@ -2054,6 +2070,8 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 25
+ \include containers-range-constructor.qdocinc
+
\sa toStdList(), QVector::fromStdVector()
*/
@@ -2064,6 +2082,8 @@ void **QListData::erase(void **xi)
\snippet code/src_corelib_tools_qlistdata.cpp 26
+ \include containers-range-constructor.qdocinc
+
\sa fromStdList(), QVector::toStdVector()
*/
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index a98a9147d6..425ffa42a5 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -46,12 +46,13 @@
#include <QtCore/qarraydata.h>
#include <QtCore/qhashfunctions.h>
#include <QtCore/qvector.h>
+#include <QtCore/qcontainertools_impl.h>
-#include <iterator>
-#include <list>
#include <algorithm>
-#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
+#include <iterator>
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+#include <list>
#endif
#include <stdlib.h>
@@ -111,11 +112,11 @@ struct Q_CORE_EXPORT QListData {
void remove(int i);
void remove(int i, int n);
void move(int from, int to);
- inline int size() const Q_DECL_NOTHROW { return int(d->end - d->begin); } // q6sizetype
- inline bool isEmpty() const Q_DECL_NOTHROW { return d->end == d->begin; }
- inline void **at(int i) const Q_DECL_NOTHROW { return d->array + d->begin + i; }
- inline void **begin() const Q_DECL_NOTHROW { return d->array + d->begin; }
- inline void **end() const Q_DECL_NOTHROW { return d->array + d->end; }
+ inline int size() const noexcept { return int(d->end - d->begin); } // q6sizetype
+ inline bool isEmpty() const noexcept { return d->end == d->begin; }
+ inline void **at(int i) const noexcept { return d->array + d->begin + i; }
+ inline void **begin() const noexcept { return d->array + d->begin; }
+ inline void **end() const noexcept { return d->array + d->end; }
};
namespace QtPrivate {
@@ -156,26 +157,23 @@ private:
union { QListData p; QListData::Data *d; };
public:
- inline QList() Q_DECL_NOTHROW : d(const_cast<QListData::Data *>(&QListData::shared_null)) { }
+ inline QList() noexcept : d(const_cast<QListData::Data *>(&QListData::shared_null)) { }
QList(const QList<T> &l);
~QList();
QList<T> &operator=(const QList<T> &l);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QList(QList<T> &&other) Q_DECL_NOTHROW
+ inline QList(QList<T> &&other) noexcept
: d(other.d) { other.d = const_cast<QListData::Data *>(&QListData::shared_null); }
- inline QList &operator=(QList<T> &&other) Q_DECL_NOTHROW
+ inline QList &operator=(QList<T> &&other) noexcept
{ QList moved(std::move(other)); swap(moved); return *this; }
-#endif
- inline void swap(QList<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ inline void swap(QList<T> &other) noexcept { qSwap(d, other.d); }
inline QList(std::initializer_list<T> args)
- : d(const_cast<QListData::Data *>(&QListData::shared_null))
- { reserve(int(args.size())); std::copy(args.begin(), args.end(), std::back_inserter(*this)); }
-#endif
+ : QList(args.begin(), args.end()) {}
+ template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
+ QList(InputIterator first, InputIterator last);
bool operator==(const QList<T> &l) const;
inline bool operator!=(const QList<T> &l) const { return !(*this == l); }
- inline int size() const Q_DECL_NOTHROW { return p.size(); }
+ inline int size() const noexcept { return p.size(); }
inline void detach() { if (d->ref.isShared()) detach_helper(); }
@@ -198,9 +196,9 @@ public:
d->ref.setSharable(sharable);
}
#endif
- inline bool isSharedWith(const QList<T> &other) const Q_DECL_NOTHROW { return d == other.d; }
+ inline bool isSharedWith(const QList<T> &other) const noexcept { return d == other.d; }
- inline bool isEmpty() const Q_DECL_NOTHROW { return p.isEmpty(); }
+ inline bool isEmpty() const noexcept { return p.isEmpty(); }
void clear();
@@ -243,36 +241,36 @@ public:
typedef T *pointer;
typedef T &reference;
- inline iterator() Q_DECL_NOTHROW : i(nullptr) {}
- inline iterator(Node *n) Q_DECL_NOTHROW : i(n) {}
+ inline iterator() noexcept : i(nullptr) {}
+ inline iterator(Node *n) noexcept : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// can't remove it in Qt 5, since doing so would make the type trivial,
// which changes the way it's passed to functions by value.
- inline iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i){}
- inline iterator &operator=(const iterator &o) Q_DECL_NOTHROW
+ inline iterator(const iterator &o) noexcept : i(o.i){}
+ inline iterator &operator=(const iterator &o) noexcept
{ i = o.i; return *this; }
#endif
inline T &operator*() const { return i->t(); }
inline T *operator->() const { return &i->t(); }
inline T &operator[](difference_type j) const { return i[j].t(); }
- inline bool operator==(const iterator &o) const Q_DECL_NOTHROW { return i == o.i; }
- inline bool operator!=(const iterator &o) const Q_DECL_NOTHROW { return i != o.i; }
- inline bool operator<(const iterator& other) const Q_DECL_NOTHROW { return i < other.i; }
- inline bool operator<=(const iterator& other) const Q_DECL_NOTHROW { return i <= other.i; }
- inline bool operator>(const iterator& other) const Q_DECL_NOTHROW { return i > other.i; }
- inline bool operator>=(const iterator& other) const Q_DECL_NOTHROW { return i >= other.i; }
+ inline bool operator==(const iterator &o) const noexcept { return i == o.i; }
+ inline bool operator!=(const iterator &o) const noexcept { return i != o.i; }
+ inline bool operator<(const iterator& other) const noexcept { return i < other.i; }
+ inline bool operator<=(const iterator& other) const noexcept { return i <= other.i; }
+ inline bool operator>(const iterator& other) const noexcept { return i > other.i; }
+ inline bool operator>=(const iterator& other) const noexcept { return i >= other.i; }
#ifndef QT_STRICT_ITERATORS
- inline bool operator==(const const_iterator &o) const Q_DECL_NOTHROW
+ inline bool operator==(const const_iterator &o) const noexcept
{ return i == o.i; }
- inline bool operator!=(const const_iterator &o) const Q_DECL_NOTHROW
+ inline bool operator!=(const const_iterator &o) const noexcept
{ return i != o.i; }
- inline bool operator<(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator<(const const_iterator& other) const noexcept
{ return i < other.i; }
- inline bool operator<=(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator<=(const const_iterator& other) const noexcept
{ return i <= other.i; }
- inline bool operator>(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator>(const const_iterator& other) const noexcept
{ return i > other.i; }
- inline bool operator>=(const const_iterator& other) const Q_DECL_NOTHROW
+ inline bool operator>=(const const_iterator& other) const noexcept
{ return i >= other.i; }
#endif
inline iterator &operator++() { ++i; return *this; }
@@ -298,29 +296,29 @@ public:
typedef const T *pointer;
typedef const T &reference;
- inline const_iterator() Q_DECL_NOTHROW : i(nullptr) {}
- inline const_iterator(Node *n) Q_DECL_NOTHROW : i(n) {}
+ inline const_iterator() noexcept : i(nullptr) {}
+ inline const_iterator(Node *n) noexcept : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
// can't remove it in Qt 5, since doing so would make the type trivial,
// which changes the way it's passed to functions by value.
- inline const_iterator(const const_iterator &o) Q_DECL_NOTHROW : i(o.i) {}
- inline const_iterator &operator=(const const_iterator &o) Q_DECL_NOTHROW
+ inline const_iterator(const const_iterator &o) noexcept : i(o.i) {}
+ inline const_iterator &operator=(const const_iterator &o) noexcept
{ i = o.i; return *this; }
#endif
#ifdef QT_STRICT_ITERATORS
- inline explicit const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
+ inline explicit const_iterator(const iterator &o) noexcept : i(o.i) {}
#else
- inline const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
+ inline const_iterator(const iterator &o) noexcept : i(o.i) {}
#endif
inline const T &operator*() const { return i->t(); }
inline const T *operator->() const { return &i->t(); }
inline const T &operator[](difference_type j) const { return i[j].t(); }
- inline bool operator==(const const_iterator &o) const Q_DECL_NOTHROW { return i == o.i; }
- inline bool operator!=(const const_iterator &o) const Q_DECL_NOTHROW { return i != o.i; }
- inline bool operator<(const const_iterator& other) const Q_DECL_NOTHROW { return i < other.i; }
- inline bool operator<=(const const_iterator& other) const Q_DECL_NOTHROW { return i <= other.i; }
- inline bool operator>(const const_iterator& other) const Q_DECL_NOTHROW { return i > other.i; }
- inline bool operator>=(const const_iterator& other) const Q_DECL_NOTHROW { return i >= other.i; }
+ inline bool operator==(const const_iterator &o) const noexcept { return i == o.i; }
+ inline bool operator!=(const const_iterator &o) const noexcept { return i != o.i; }
+ inline bool operator<(const const_iterator& other) const noexcept { return i < other.i; }
+ inline bool operator<=(const const_iterator& other) const noexcept { return i <= other.i; }
+ inline bool operator>(const const_iterator& other) const noexcept { return i > other.i; }
+ inline bool operator>=(const const_iterator& other) const noexcept { return i >= other.i; }
inline const_iterator &operator++() { ++i; return *this; }
inline const_iterator operator++(int) { Node *n = i; ++i; return n; }
inline const_iterator &operator--() { i--; return *this; }
@@ -338,19 +336,19 @@ public:
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { detach(); return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator begin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator begin() const noexcept { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator cbegin() const noexcept { return reinterpret_cast<Node *>(p.begin()); }
+ inline const_iterator constBegin() const noexcept { return reinterpret_cast<Node *>(p.begin()); }
inline iterator end() { detach(); return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator end() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator cend() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator end() const noexcept { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator cend() const noexcept { return reinterpret_cast<Node *>(p.end()); }
+ inline const_iterator constEnd() const noexcept { return reinterpret_cast<Node *>(p.end()); }
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator insert(iterator before, const T &t);
iterator erase(iterator pos);
iterator erase(iterator first, iterator last);
@@ -405,16 +403,22 @@ public:
inline QList<T> &operator<<(const QList<T> &l)
{ *this += l; return *this; }
+ static QList<T> fromVector(const QVector<T> &vector);
QVector<T> toVector() const;
- QSet<T> toSet() const;
- static QList<T> fromVector(const QVector<T> &vector);
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ Q_DECL_DEPRECATED_X("Use QList<T>(set.begin(), set.end()) instead.")
static QList<T> fromSet(const QSet<T> &set);
+ Q_DECL_DEPRECATED_X("Use QSet<T>(list.begin(), list.end()) instead.")
+ QSet<T> toSet() const;
+ Q_DECL_DEPRECATED_X("Use QList<T>(list.begin(), list.end()) instead.")
static inline QList<T> fromStdList(const std::list<T> &list)
- { QList<T> tmp; std::copy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
+ { return QList<T>(list.begin(), list.end()); }
+ Q_DECL_DEPRECATED_X("Use std::list<T>(list.begin(), list.end()) instead.")
inline std::list<T> toStdList() const
- { std::list<T> tmp; std::copy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
+ { return std::list<T>(begin(), end()); }
+#endif
private:
Node *detach_helper_grow(int i, int n);
@@ -427,7 +431,7 @@ private:
void node_copy(Node *from, Node *to, Node *src);
void node_destruct(Node *from, Node *to);
- bool isValidIterator(const iterator &i) const Q_DECL_NOTHROW
+ bool isValidIterator(const iterator &i) const noexcept
{
const std::less<const Node *> less = {};
return !less(i.i, cbegin().i) && !less(cend().i, i.i);
@@ -442,6 +446,13 @@ private:
inline int count_impl(const T &, QListData::ArrayCompatibleLayout) const;
};
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+template <typename InputIterator,
+ typename ValueType = typename std::iterator_traits<InputIterator>::value_type,
+ QtPrivate::IfIsInputIterator<InputIterator> = true>
+QList(InputIterator, InputIterator) -> QList<ValueType>;
+#endif
+
#if defined(Q_CC_BOR)
template <typename T>
Q_INLINE_TEMPLATE T &QList<T>::Node::t()
@@ -530,7 +541,7 @@ inline typename QList<T>::iterator QList<T>::insert(iterator before, const T &t)
Q_ASSERT_X(isValidIterator(before), "QList::insert", "The specified iterator argument 'before' is invalid");
int iBefore = int(before.i - reinterpret_cast<Node *>(p.begin()));
- Node *n = 0;
+ Node *n = nullptr;
if (d->ref.isShared())
n = detach_helper_grow(iBefore, 1);
else
@@ -710,7 +721,7 @@ inline void QList<T>::swapItemsAt(int i, int j)
Q_ASSERT_X(i >= 0 && i < p.size() && j >= 0 && j < p.size(),
"QList<T>::swap", "index out of range");
detach();
- std::swap(d->array[d->begin + i], d->array[d->begin + j]);
+ qSwap(d->array[d->begin + i], d->array[d->begin + j]);
}
template <typename T>
@@ -847,6 +858,15 @@ Q_OUTOFLINE_TEMPLATE QList<T>::~QList()
}
template <typename T>
+template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator>>
+QList<T>::QList(InputIterator first, InputIterator last)
+ : QList()
+{
+ QtPrivate::reserveIfForwardIterator(this, first, last);
+ std::copy(first, last, std::back_inserter(*this));
+}
+
+template <typename T>
Q_OUTOFLINE_TEMPLATE bool QList<T>::operator==(const QList<T> &l) const
{
if (d == l.d)
@@ -1092,10 +1112,7 @@ inline int QList<T>::count_impl(const T &t, QListData::ArrayCompatibleLayout) co
template <typename T>
Q_OUTOFLINE_TEMPLATE QVector<T> QList<T>::toVector() const
{
- QVector<T> result(size());
- for (int i = 0; i < size(); ++i)
- result[i] = at(i);
- return result;
+ return QVector<T>(begin(), end());
}
template <typename T>
@@ -1107,11 +1124,7 @@ QList<T> QList<T>::fromVector(const QVector<T> &vector)
template <typename T>
Q_OUTOFLINE_TEMPLATE QList<T> QVector<T>::toList() const
{
- QList<T> result;
- result.reserve(size());
- for (int i = 0; i < size(); ++i)
- result.append(at(i));
- return result;
+ return QList<T>(begin(), end());
}
template <typename T>
@@ -1125,14 +1138,14 @@ Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(List)
template <typename T>
uint qHash(const QList<T> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
+ noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
{
return qHashRange(key.cbegin(), key.cend(), seed);
}
template <typename T>
bool operator<(const QList<T> &lhs, const QList<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
+ noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
rhs.begin(), rhs.end())))
{
return std::lexicographical_compare(lhs.begin(), lhs.end(),
@@ -1141,21 +1154,21 @@ bool operator<(const QList<T> &lhs, const QList<T> &rhs)
template <typename T>
inline bool operator>(const QList<T> &lhs, const QList<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return rhs < lhs;
}
template <typename T>
inline bool operator<=(const QList<T> &lhs, const QList<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return !(lhs > rhs);
}
template <typename T>
inline bool operator>=(const QList<T> &lhs, const QList<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return !(lhs < rhs);
}
diff --git a/src/corelib/tools/qlocale_data_p.h b/src/corelib/tools/qlocale_data_p.h
deleted file mode 100644
index cc9f99ae20..0000000000
--- a/src/corelib/tools/qlocale_data_p.h
+++ /dev/null
@@ -1,8789 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QLOCALE_DATA_P_H
-#define QLOCALE_DATA_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/private/qglobal_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/* This part of the file isn't generated, but written by hand since
- * Unicode CLDR doesn't contain measurement system information.
- */
-struct CountryLanguage
-{
- quint16 languageId;
- quint16 countryId;
- QLocale::MeasurementSystem system;
-};
-static const CountryLanguage ImperialMeasurementSystems[] = {
- { QLocale::English, QLocale::UnitedStates, QLocale::ImperialUSSystem },
- { QLocale::English, QLocale::UnitedStatesMinorOutlyingIslands, QLocale::ImperialUSSystem },
- { QLocale::Spanish, QLocale::UnitedStates, QLocale::ImperialUSSystem },
- { QLocale::Hawaiian, QLocale::UnitedStates, QLocale::ImperialUSSystem },
- { QLocale::English, QLocale::UnitedKingdom, QLocale::ImperialUKSystem }
-};
-static const int ImperialMeasurementSystemsCount =
- sizeof(ImperialMeasurementSystems)/sizeof(ImperialMeasurementSystems[0]);
-
-// GENERATED PART STARTS HERE
-
-/*
- This part of the file was generated on 2019-05-09 from the
- Common Locale Data Repository v35.1
-
- http://www.unicode.org/cldr/
-
- Do not edit this section: instead regenerate it using
- cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
- edited) CLDR data; see qtbase/util/local_database/.
-*/
-
-static const QLocaleId likely_subtags[] = {
- { 4, 0, 0 }, { 4, 7, 69 }, // aa -> aa_Latn_ET
- { 2, 0, 0 }, { 2, 2, 81 }, // ab -> ab_Cyrl_GE
- { 255, 0, 0 }, { 255, 36, 102 }, // ae -> ae_Avst_IR
- { 5, 0, 0 }, { 5, 7, 195 }, // af -> af_Latn_ZA
- { 237, 0, 0 }, { 237, 7, 37 }, // agq -> agq_Latn_CM
- { 340, 0, 0 }, { 340, 128, 100 }, // aho -> aho_Ahom_IN
- { 146, 0, 0 }, { 146, 7, 83 }, // ak -> ak_Latn_GH
- { 262, 0, 0 }, { 262, 94, 103 }, // akk -> akk_Xsux_IQ
- { 7, 0, 0 }, { 7, 14, 69 }, // am -> am_Ethi_ET
- { 8, 0, 0 }, { 8, 1, 64 }, // ar -> ar_Arab_EG
- { 265, 0, 0 }, { 265, 57, 102 }, // arc -> arc_Armi_IR
- { 265, 119, 0 }, { 265, 119, 109 }, // arc_Nbat -> arc_Nbat_JO
- { 265, 120, 0 }, { 265, 120, 207 }, // arc_Palm -> arc_Palm_SY
- { 315, 0, 0 }, { 315, 7, 43 }, // arn -> arn_Latn_CL
- { 10, 0, 0 }, { 10, 11, 100 }, // as -> as_Beng_IN
- { 205, 0, 0 }, { 205, 7, 210 }, // asa -> asa_Latn_TZ
- { 341, 0, 0 }, { 341, 133, 225 }, // ase -> ase_Sgnw_US
- { 256, 0, 0 }, { 256, 7, 197 }, // ast -> ast_Latn_ES
- { 216, 0, 0 }, { 216, 2, 178 }, // av -> av_Cyrl_RU
- { 11, 0, 0 }, { 11, 7, 26 }, // ay -> ay_Latn_BO
- { 12, 0, 0 }, { 12, 7, 15 }, // az -> az_Latn_AZ
- { 12, 0, 103 }, { 12, 1, 103 }, // az_IQ -> az_Arab_IQ
- { 12, 0, 102 }, { 12, 1, 102 }, // az_IR -> az_Arab_IR
- { 12, 0, 178 }, { 12, 2, 178 }, // az_RU -> az_Cyrl_RU
- { 12, 1, 0 }, { 12, 1, 102 }, // az_Arab -> az_Arab_IR
- { 13, 0, 0 }, { 13, 2, 178 }, // ba -> ba_Cyrl_RU
- { 266, 0, 0 }, { 266, 7, 101 }, // ban -> ban_Latn_ID
- { 238, 0, 0 }, { 238, 7, 37 }, // bas -> bas_Latn_CM
- { 267, 0, 0 }, { 267, 38, 37 }, // bax -> bax_Bamu_CM
- { 268, 0, 0 }, { 268, 7, 101 }, // bbc -> bbc_Latn_ID
- { 22, 0, 0 }, { 22, 2, 20 }, // be -> be_Cyrl_BY
- { 195, 0, 0 }, { 195, 7, 239 }, // bem -> bem_Latn_ZM
- { 186, 0, 0 }, { 186, 7, 210 }, // bez -> bez_Latn_TZ
- { 20, 0, 0 }, { 20, 2, 33 }, // bg -> bg_Cyrl_BG
- { 364, 0, 0 }, { 364, 1, 163 }, // bgn -> bgn_Arab_PK
- { 343, 0, 0 }, { 343, 13, 100 }, // bho -> bho_Deva_IN
- { 18, 0, 0 }, { 18, 7, 229 }, // bi -> bi_Latn_VU
- { 270, 0, 0 }, { 270, 7, 170 }, // bku -> bku_Latn_PH
- { 309, 0, 0 }, { 309, 100, 232 }, // blt -> blt_Tavt_VN
- { 188, 0, 0 }, { 188, 7, 132 }, // bm -> bm_Latn_ML
- { 15, 0, 0 }, { 15, 11, 18 }, // bn -> bn_Beng_BD
- { 121, 0, 0 }, { 121, 31, 44 }, // bo -> bo_Tibt_CN
- { 19, 0, 0 }, { 19, 7, 74 }, // br -> br_Latn_FR
- { 215, 0, 0 }, { 215, 13, 100 }, // brx -> brx_Deva_IN
- { 142, 0, 0 }, { 142, 7, 27 }, // bs -> bs_Latn_BA
- { 336, 0, 0 }, { 336, 106, 121 }, // bsq -> bsq_Bass_LR
- { 312, 0, 0 }, { 312, 7, 37 }, // bss -> bss_Latn_CM
- { 269, 0, 0 }, { 269, 7, 101 }, // bug -> bug_Latn_ID
- { 152, 0, 0 }, { 152, 14, 67 }, // byn -> byn_Ethi_ER
- { 24, 0, 0 }, { 24, 7, 197 }, // ca -> ca_Latn_ES
- { 156, 0, 0 }, { 156, 7, 157 }, // cch -> cch_Latn_NG
- { 272, 0, 0 }, { 272, 46, 18 }, // ccp -> ccp_Cakm_BD
- { 218, 0, 0 }, { 218, 2, 178 }, // ce -> ce_Cyrl_RU
- { 211, 0, 0 }, { 211, 7, 221 }, // cgg -> cgg_Latn_UG
- { 217, 0, 0 }, { 217, 7, 89 }, // ch -> ch_Latn_GU
- { 190, 0, 0 }, { 190, 12, 225 }, // chr -> chr_Cher_US
- { 276, 0, 0 }, { 276, 47, 232 }, // cjm -> cjm_Cham_VN
- { 316, 0, 0 }, { 316, 1, 103 }, // ckb -> ckb_Arab_IQ
- { 26, 0, 0 }, { 26, 7, 74 }, // co -> co_Latn_FR
- { 274, 0, 0 }, { 274, 48, 64 }, // cop -> cop_Copt_EG
- { 221, 0, 0 }, { 221, 44, 38 }, // cr -> cr_Cans_CA
- { 28, 0, 0 }, { 28, 7, 57 }, // cs -> cs_Latn_CZ
- { 338, 0, 0 }, { 338, 121, 147 }, // ctd -> ctd_Pauc_MM
- { 219, 0, 0 }, { 219, 2, 178 }, // cu -> cu_Cyrl_RU
- { 219, 52, 0 }, { 219, 52, 33 }, // cu_Glag -> cu_Glag_BG
- { 220, 0, 0 }, { 220, 2, 178 }, // cv -> cv_Cyrl_RU
- { 134, 0, 0 }, { 134, 7, 224 }, // cy -> cy_Latn_GB
- { 29, 0, 0 }, { 29, 7, 58 }, // da -> da_Latn_DK
- { 176, 0, 0 }, { 176, 7, 111 }, // dav -> dav_Latn_KE
- { 42, 0, 0 }, { 42, 7, 82 }, // de -> de_Latn_DE
- { 239, 0, 0 }, { 239, 7, 156 }, // dje -> dje_Latn_NE
- { 275, 0, 0 }, { 275, 1, 100 }, // doi -> doi_Arab_IN
- { 317, 0, 0 }, { 317, 7, 82 }, // dsb -> dsb_Latn_DE
- { 240, 0, 0 }, { 240, 7, 37 }, // dua -> dua_Latn_CM
- { 143, 0, 0 }, { 143, 29, 131 }, // dv -> dv_Thaa_MV
- { 241, 0, 0 }, { 241, 7, 187 }, // dyo -> dyo_Latn_SN
- { 16, 0, 0 }, { 16, 31, 25 }, // dz -> dz_Tibt_BT
- { 189, 0, 0 }, { 189, 7, 111 }, // ebu -> ebu_Latn_KE
- { 161, 0, 0 }, { 161, 7, 83 }, // ee -> ee_Latn_GH
- { 263, 0, 0 }, { 263, 50, 64 }, // egy -> egy_Egyp_EG
- { 277, 0, 0 }, { 277, 63, 147 }, // eky -> eky_Kali_MM
- { 43, 0, 0 }, { 43, 16, 85 }, // el -> el_Grek_GR
- { 31, 0, 0 }, { 31, 7, 225 }, // en -> en_Latn_US
- { 31, 92, 0 }, { 31, 92, 224 }, // en_Shaw -> en_Shaw_GB
- { 32, 0, 0 }, { 32, 7, 260 }, // eo -> eo_Latn_001
- { 111, 0, 0 }, { 111, 7, 197 }, // es -> es_Latn_ES
- { 33, 0, 0 }, { 33, 7, 68 }, // et -> et_Latn_EE
- { 278, 0, 0 }, { 278, 79, 106 }, // ett -> ett_Ital_IT
- { 14, 0, 0 }, { 14, 7, 197 }, // eu -> eu_Latn_ES
- { 242, 0, 0 }, { 242, 7, 37 }, // ewo -> ewo_Latn_CM
- { 89, 0, 0 }, { 89, 1, 102 }, // fa -> fa_Arab_IR
- { 177, 0, 0 }, { 177, 7, 187 }, // ff -> ff_Latn_SN
- { 177, 134, 0 }, { 177, 134, 91 }, // ff_Adlm -> ff_Adlm_GN
- { 36, 0, 0 }, { 36, 7, 73 }, // fi -> fi_Latn_FI
- { 166, 0, 0 }, { 166, 7, 170 }, // fil -> fil_Latn_PH
- { 35, 0, 0 }, { 35, 7, 72 }, // fj -> fj_Latn_FJ
- { 34, 0, 0 }, { 34, 7, 71 }, // fo -> fo_Latn_FO
- { 37, 0, 0 }, { 37, 7, 74 }, // fr -> fr_Latn_FR
- { 159, 0, 0 }, { 159, 7, 106 }, // fur -> fur_Latn_IT
- { 38, 0, 0 }, { 38, 7, 151 }, // fy -> fy_Latn_NL
- { 57, 0, 0 }, { 57, 7, 104 }, // ga -> ga_Latn_IE
- { 148, 0, 0 }, { 148, 7, 83 }, // gaa -> gaa_Latn_GH
- { 39, 0, 0 }, { 39, 7, 224 }, // gd -> gd_Latn_GB
- { 153, 0, 0 }, { 153, 14, 69 }, // gez -> gez_Ethi_ET
- { 40, 0, 0 }, { 40, 7, 197 }, // gl -> gl_Latn_ES
- { 45, 0, 0 }, { 45, 7, 168 }, // gn -> gn_Latn_PY
- { 279, 0, 0 }, { 279, 53, 222 }, // got -> got_Goth_UA
- { 264, 0, 0 }, { 264, 49, 56 }, // grc -> grc_Cprt_CY
- { 264, 68, 0 }, { 264, 68, 85 }, // grc_Linb -> grc_Linb_GR
- { 167, 0, 0 }, { 167, 7, 206 }, // gsw -> gsw_Latn_CH
- { 46, 0, 0 }, { 46, 17, 100 }, // gu -> gu_Gujr_IN
- { 175, 0, 0 }, { 175, 7, 111 }, // guz -> guz_Latn_KE
- { 144, 0, 0 }, { 144, 7, 251 }, // gv -> gv_Latn_IM
- { 47, 0, 0 }, { 47, 7, 157 }, // ha -> ha_Latn_NG
- { 47, 0, 37 }, { 47, 1, 37 }, // ha_CM -> ha_Arab_CM
- { 47, 0, 201 }, { 47, 1, 201 }, // ha_SD -> ha_Arab_SD
- { 163, 0, 0 }, { 163, 7, 225 }, // haw -> haw_Latn_US
- { 48, 0, 0 }, { 48, 18, 105 }, // he -> he_Hebr_IL
- { 49, 0, 0 }, { 49, 13, 100 }, // hi -> hi_Deva_IN
- { 344, 0, 0 }, { 344, 129, 217 }, // hlu -> hlu_Hluw_TR
- { 282, 0, 0 }, { 282, 86, 44 }, // hmd -> hmd_Plrd_CN
- { 333, 0, 0 }, { 333, 110, 117 }, // hnj -> hnj_Hmng_LA
- { 280, 0, 0 }, { 280, 7, 170 }, // hnn -> hnn_Latn_PH
- { 224, 0, 0 }, { 224, 7, 167 }, // ho -> ho_Latn_PG
- { 334, 0, 0 }, { 334, 13, 100 }, // hoc -> hoc_Deva_IN
- { 27, 0, 0 }, { 27, 7, 54 }, // hr -> hr_Latn_HR
- { 318, 0, 0 }, { 318, 7, 82 }, // hsb -> hsb_Latn_DE
- { 222, 0, 0 }, { 222, 7, 94 }, // ht -> ht_Latn_HT
- { 50, 0, 0 }, { 50, 7, 98 }, // hu -> hu_Latn_HU
- { 9, 0, 0 }, { 9, 10, 11 }, // hy -> hy_Armn_AM
- { 223, 0, 0 }, { 223, 7, 148 }, // hz -> hz_Latn_NA
- { 53, 0, 0 }, { 53, 7, 260 }, // ia -> ia_Latn_001
- { 52, 0, 0 }, { 52, 7, 101 }, // id -> id_Latn_ID
- { 149, 0, 0 }, { 149, 7, 157 }, // ig -> ig_Latn_NG
- { 168, 0, 0 }, { 168, 34, 44 }, // ii -> ii_Yiii_CN
- { 56, 0, 0 }, { 56, 7, 225 }, // ik -> ik_Latn_US
- { 281, 0, 0 }, { 281, 2, 178 }, // inh -> inh_Cyrl_RU
- { 360, 0, 0 }, { 360, 7, 260 }, // io -> io_Latn_001
- { 51, 0, 0 }, { 51, 7, 99 }, // is -> is_Latn_IS
- { 58, 0, 0 }, { 58, 7, 106 }, // it -> it_Latn_IT
- { 55, 0, 0 }, { 55, 44, 38 }, // iu -> iu_Cans_CA
- { 59, 0, 0 }, { 59, 19, 108 }, // ja -> ja_Jpan_JP
- { 361, 0, 0 }, { 361, 7, 260 }, // jbo -> jbo_Latn_001
- { 257, 0, 0 }, { 257, 7, 37 }, // jgo -> jgo_Latn_CM
- { 200, 0, 0 }, { 200, 7, 210 }, // jmc -> jmc_Latn_TZ
- { 60, 0, 0 }, { 60, 7, 101 }, // jv -> jv_Latn_ID
- { 41, 0, 0 }, { 41, 15, 81 }, // ka -> ka_Geor_GE
- { 184, 0, 0 }, { 184, 7, 3 }, // kab -> kab_Latn_DZ
- { 158, 0, 0 }, { 158, 7, 157 }, // kaj -> kaj_Latn_NG
- { 150, 0, 0 }, { 150, 7, 111 }, // kam -> kam_Latn_KE
- { 164, 0, 0 }, { 164, 7, 157 }, // kcg -> kcg_Latn_NG
- { 192, 0, 0 }, { 192, 7, 210 }, // kde -> kde_Latn_TZ
- { 196, 0, 0 }, { 196, 7, 39 }, // kea -> kea_Latn_CV
- { 319, 0, 0 }, { 319, 7, 37 }, // ken -> ken_Latn_CM
- { 154, 0, 0 }, { 154, 7, 53 }, // kfo -> kfo_Latn_CI
- { 227, 0, 0 }, { 227, 7, 49 }, // kg -> kg_Latn_CD
- { 286, 0, 0 }, { 286, 76, 44 }, // khb -> khb_Talu_CN
- { 208, 0, 0 }, { 208, 7, 132 }, // khq -> khq_Latn_ML
- { 178, 0, 0 }, { 178, 7, 111 }, // ki -> ki_Latn_KE
- { 228, 0, 0 }, { 228, 7, 148 }, // kj -> kj_Latn_NA
- { 63, 0, 0 }, { 63, 2, 110 }, // kk -> kk_Cyrl_KZ
- { 63, 0, 1 }, { 63, 1, 1 }, // kk_AF -> kk_Arab_AF
- { 63, 0, 44 }, { 63, 1, 44 }, // kk_CN -> kk_Arab_CN
- { 63, 0, 102 }, { 63, 1, 102 }, // kk_IR -> kk_Arab_IR
- { 63, 0, 143 }, { 63, 1, 143 }, // kk_MN -> kk_Arab_MN
- { 63, 1, 0 }, { 63, 1, 44 }, // kk_Arab -> kk_Arab_CN
- { 258, 0, 0 }, { 258, 7, 37 }, // kkj -> kkj_Latn_CM
- { 44, 0, 0 }, { 44, 7, 86 }, // kl -> kl_Latn_GL
- { 198, 0, 0 }, { 198, 7, 111 }, // kln -> kln_Latn_KE
- { 23, 0, 0 }, { 23, 20, 36 }, // km -> km_Khmr_KH
- { 61, 0, 0 }, { 61, 21, 100 }, // kn -> kn_Knda_IN
- { 66, 0, 0 }, { 66, 22, 114 }, // ko -> ko_Kore_KR
- { 147, 0, 0 }, { 147, 13, 100 }, // kok -> kok_Deva_IN
- { 169, 0, 0 }, { 169, 7, 121 }, // kpe -> kpe_Latn_LR
- { 225, 0, 0 }, { 225, 7, 0 }, // kr -> kr_Latn
- { 62, 0, 0 }, { 62, 1, 100 }, // ks -> ks_Arab_IN
- { 214, 0, 0 }, { 214, 7, 210 }, // ksb -> ksb_Latn_TZ
- { 243, 0, 0 }, { 243, 7, 37 }, // ksf -> ksf_Latn_CM
- { 201, 0, 0 }, { 201, 7, 82 }, // ksh -> ksh_Latn_DE
- { 67, 0, 0 }, { 67, 7, 217 }, // ku -> ku_Latn_TR
- { 67, 0, 119 }, { 67, 1, 119 }, // ku_LB -> ku_Arab_LB
- { 67, 1, 0 }, { 67, 1, 103 }, // ku_Arab -> ku_Arab_IQ
- { 226, 0, 0 }, { 226, 2, 178 }, // kv -> kv_Cyrl_RU
- { 145, 0, 0 }, { 145, 7, 224 }, // kw -> kw_Latn_GB
- { 65, 0, 0 }, { 65, 2, 116 }, // ky -> ky_Cyrl_KG
- { 65, 0, 44 }, { 65, 1, 44 }, // ky_CN -> ky_Arab_CN
- { 65, 0, 217 }, { 65, 7, 217 }, // ky_TR -> ky_Latn_TR
- { 65, 1, 0 }, { 65, 1, 44 }, // ky_Arab -> ky_Arab_CN
- { 65, 7, 0 }, { 65, 7, 217 }, // ky_Latn -> ky_Latn_TR
- { 70, 0, 0 }, { 70, 7, 230 }, // la -> la_Latn_VA
- { 332, 0, 0 }, { 332, 112, 85 }, // lab -> lab_Lina_GR
- { 193, 0, 0 }, { 193, 7, 210 }, // lag -> lag_Latn_TZ
- { 231, 0, 0 }, { 231, 7, 125 }, // lb -> lb_Latn_LU
- { 283, 0, 0 }, { 283, 66, 100 }, // lep -> lep_Lepc_IN
- { 335, 0, 0 }, { 335, 2, 178 }, // lez -> lez_Cyrl_RU
- { 194, 0, 0 }, { 194, 7, 221 }, // lg -> lg_Latn_UG
- { 229, 0, 0 }, { 229, 7, 151 }, // li -> li_Latn_NL
- { 284, 0, 0 }, { 284, 13, 150 }, // lif -> lif_Deva_NP
- { 284, 67, 0 }, { 284, 67, 100 }, // lif_Limb -> lif_Limb_IN
- { 285, 0, 0 }, { 285, 51, 44 }, // lis -> lis_Lisu_CN
- { 313, 0, 0 }, { 313, 7, 225 }, // lkt -> lkt_Latn_US
- { 72, 0, 0 }, { 72, 7, 49 }, // ln -> ln_Latn_CD
- { 69, 0, 0 }, { 69, 23, 117 }, // lo -> lo_Laoo_LA
- { 349, 0, 0 }, { 349, 1, 102 }, // lrc -> lrc_Arab_IR
- { 73, 0, 0 }, { 73, 7, 124 }, // lt -> lt_Latn_LT
- { 230, 0, 0 }, { 230, 7, 49 }, // lu -> lu_Latn_CD
- { 210, 0, 0 }, { 210, 7, 111 }, // luo -> luo_Latn_KE
- { 204, 0, 0 }, { 204, 7, 111 }, // luy -> luy_Latn_KE
- { 71, 0, 0 }, { 71, 7, 118 }, // lv -> lv_Latn_LV
- { 345, 0, 0 }, { 345, 5, 44 }, // lzh -> lzh_Hans_CN
- { 339, 0, 0 }, { 339, 13, 100 }, // mai -> mai_Deva_IN
- { 289, 0, 0 }, { 289, 7, 80 }, // man -> man_Latn_GM
- { 289, 0, 91 }, { 289, 75, 91 }, // man_GN -> man_Nkoo_GN
- { 289, 75, 0 }, { 289, 75, 91 }, // man_Nkoo -> man_Nkoo_GN
- { 202, 0, 0 }, { 202, 7, 111 }, // mas -> mas_Latn_KE
- { 330, 0, 0 }, { 330, 7, 189 }, // men -> men_Latn_SL
- { 197, 0, 0 }, { 197, 7, 111 }, // mer -> mer_Latn_KE
- { 191, 0, 0 }, { 191, 7, 137 }, // mfe -> mfe_Latn_MU
- { 75, 0, 0 }, { 75, 7, 128 }, // mg -> mg_Latn_MG
- { 244, 0, 0 }, { 244, 7, 146 }, // mgh -> mgh_Latn_MZ
- { 259, 0, 0 }, { 259, 7, 37 }, // mgo -> mgo_Latn_CM
- { 81, 0, 0 }, { 81, 7, 134 }, // mh -> mh_Latn_MH
- { 79, 0, 0 }, { 79, 7, 154 }, // mi -> mi_Latn_NZ
- { 356, 0, 0 }, { 356, 130, 103 }, // mis -> mis_Hatr_IQ
- { 74, 0, 0 }, { 74, 2, 127 }, // mk -> mk_Cyrl_MK
- { 77, 0, 0 }, { 77, 24, 100 }, // ml -> ml_Mlym_IN
- { 82, 0, 0 }, { 82, 2, 143 }, // mn -> mn_Cyrl_MN
- { 82, 0, 44 }, { 82, 8, 44 }, // mn_CN -> mn_Mong_CN
- { 82, 8, 0 }, { 82, 8, 44 }, // mn_Mong -> mn_Mong_CN
- { 290, 0, 0 }, { 290, 11, 100 }, // mni -> mni_Beng_IN
- { 320, 0, 0 }, { 320, 7, 38 }, // moh -> moh_Latn_CA
- { 80, 0, 0 }, { 80, 13, 100 }, // mr -> mr_Deva_IN
- { 347, 0, 0 }, { 347, 117, 18 }, // mro -> mro_Mroo_BD
- { 76, 0, 0 }, { 76, 7, 130 }, // ms -> ms_Latn_MY
- { 76, 0, 46 }, { 76, 1, 46 }, // ms_CC -> ms_Arab_CC
- { 76, 0, 101 }, { 76, 1, 101 }, // ms_ID -> ms_Arab_ID
- { 78, 0, 0 }, { 78, 7, 133 }, // mt -> mt_Latn_MT
- { 245, 0, 0 }, { 245, 7, 37 }, // mua -> mua_Latn_CM
- { 21, 0, 0 }, { 21, 25, 147 }, // my -> my_Mymr_MM
- { 273, 0, 0 }, { 273, 71, 102 }, // myz -> myz_Mand_IR
- { 346, 0, 0 }, { 346, 1, 102 }, // mzn -> mzn_Arab_IR
- { 83, 0, 0 }, { 83, 7, 149 }, // na -> na_Latn_NR
- { 199, 0, 0 }, { 199, 7, 148 }, // naq -> naq_Latn_NA
- { 85, 0, 0 }, { 85, 7, 161 }, // nb -> nb_Latn_NO
- { 181, 0, 0 }, { 181, 7, 240 }, // nd -> nd_Latn_ZW
- { 170, 0, 0 }, { 170, 7, 82 }, // nds -> nds_Latn_DE
- { 84, 0, 0 }, { 84, 13, 150 }, // ne -> ne_Deva_NP
- { 348, 0, 0 }, { 348, 13, 150 }, // new -> new_Deva_NP
- { 233, 0, 0 }, { 233, 7, 148 }, // ng -> ng_Latn_NA
- { 30, 0, 0 }, { 30, 7, 151 }, // nl -> nl_Latn_NL
- { 246, 0, 0 }, { 246, 7, 37 }, // nmg -> nmg_Latn_CM
- { 141, 0, 0 }, { 141, 7, 161 }, // nn -> nn_Latn_NO
- { 260, 0, 0 }, { 260, 7, 37 }, // nnh -> nnh_Latn_CM
- { 292, 0, 0 }, { 292, 65, 211 }, // nod -> nod_Lana_TH
- { 294, 0, 0 }, { 294, 88, 205 }, // non -> non_Runr_SE
- { 321, 0, 0 }, { 321, 75, 91 }, // nqo -> nqo_Nkoo_GN
- { 171, 0, 0 }, { 171, 7, 195 }, // nr -> nr_Latn_ZA
- { 172, 0, 0 }, { 172, 7, 195 }, // nso -> nso_Latn_ZA
- { 247, 0, 0 }, { 247, 7, 254 }, // nus -> nus_Latn_SS
- { 232, 0, 0 }, { 232, 7, 225 }, // nv -> nv_Latn_US
- { 165, 0, 0 }, { 165, 7, 129 }, // ny -> ny_Latn_MW
- { 185, 0, 0 }, { 185, 7, 221 }, // nyn -> nyn_Latn_UG
- { 86, 0, 0 }, { 86, 7, 74 }, // oc -> oc_Latn_FR
- { 3, 0, 0 }, { 3, 7, 69 }, // om -> om_Latn_ET
- { 87, 0, 0 }, { 87, 26, 100 }, // or -> or_Orya_IN
- { 101, 0, 0 }, { 101, 2, 81 }, // os -> os_Cyrl_GE
- { 358, 0, 0 }, { 358, 138, 225 }, // osa -> osa_Osge_US
- { 296, 0, 0 }, { 296, 82, 143 }, // otk -> otk_Orkh_MN
- { 92, 0, 0 }, { 92, 4, 100 }, // pa -> pa_Guru_IN
- { 92, 0, 163 }, { 92, 1, 163 }, // pa_PK -> pa_Arab_PK
- { 92, 1, 0 }, { 92, 1, 163 }, // pa_Arab -> pa_Arab_PK
- { 297, 0, 0 }, { 297, 58, 102 }, // pal -> pal_Phli_IR
- { 297, 123, 0 }, { 297, 123, 44 }, // pal_Phlp -> pal_Phlp_CN
- { 351, 0, 0 }, { 351, 7, 12 }, // pap -> pap_Latn_AW
- { 350, 0, 0 }, { 350, 7, 164 }, // pau -> pau_Latn_PW
- { 295, 0, 0 }, { 295, 80, 102 }, // peo -> peo_Xpeo_IR
- { 299, 0, 0 }, { 299, 85, 119 }, // phn -> phn_Phnx_LB
- { 342, 0, 0 }, { 342, 41, 100 }, // pka -> pka_Brah_IN
- { 90, 0, 0 }, { 90, 7, 172 }, // pl -> pl_Latn_PL
- { 300, 0, 0 }, { 300, 64, 163 }, // pra -> pra_Khar_PK
- { 322, 0, 0 }, { 322, 7, 260 }, // prg -> prg_Latn_001
- { 88, 0, 0 }, { 88, 1, 1 }, // ps -> ps_Arab_AF
- { 91, 0, 0 }, { 91, 7, 30 }, // pt -> pt_Latn_BR
- { 93, 0, 0 }, { 93, 7, 169 }, // qu -> qu_Latn_PE
- { 323, 0, 0 }, { 323, 7, 90 }, // quc -> quc_Latn_GT
- { 301, 0, 0 }, { 301, 7, 101 }, // rej -> rej_Latn_ID
- { 94, 0, 0 }, { 94, 7, 206 }, // rm -> rm_Latn_CH
- { 68, 0, 0 }, { 68, 7, 35 }, // rn -> rn_Latn_BI
- { 95, 0, 0 }, { 95, 7, 177 }, // ro -> ro_Latn_RO
- { 182, 0, 0 }, { 182, 7, 210 }, // rof -> rof_Latn_TZ
- { 96, 0, 0 }, { 96, 2, 178 }, // ru -> ru_Cyrl_RU
- { 64, 0, 0 }, { 64, 7, 179 }, // rw -> rw_Latn_RW
- { 209, 0, 0 }, { 209, 7, 210 }, // rwk -> rwk_Latn_TZ
- { 99, 0, 0 }, { 99, 13, 100 }, // sa -> sa_Deva_IN
- { 248, 0, 0 }, { 248, 2, 178 }, // sah -> sah_Cyrl_RU
- { 179, 0, 0 }, { 179, 7, 111 }, // saq -> saq_Latn_KE
- { 304, 0, 0 }, { 304, 7, 100 }, // sat -> sat_Latn_IN
- { 305, 0, 0 }, { 305, 90, 100 }, // saz -> saz_Saur_IN
- { 249, 0, 0 }, { 249, 7, 210 }, // sbp -> sbp_Latn_TZ
- { 115, 0, 0 }, { 115, 7, 106 }, // sc -> sc_Latn_IT
- { 362, 0, 0 }, { 362, 7, 106 }, // scn -> scn_Latn_IT
- { 105, 0, 0 }, { 105, 1, 163 }, // sd -> sd_Arab_PK
- { 105, 13, 0 }, { 105, 13, 100 }, // sd_Deva -> sd_Deva_IN
- { 105, 111, 0 }, { 105, 111, 100 }, // sd_Khoj -> sd_Khoj_IN
- { 105, 125, 0 }, { 105, 125, 100 }, // sd_Sind -> sd_Sind_IN
- { 363, 0, 0 }, { 363, 1, 102 }, // sdh -> sdh_Arab_IR
- { 173, 0, 0 }, { 173, 7, 161 }, // se -> se_Latn_NO
- { 180, 0, 0 }, { 180, 7, 146 }, // seh -> seh_Latn_MZ
- { 213, 0, 0 }, { 213, 7, 132 }, // ses -> ses_Latn_ML
- { 98, 0, 0 }, { 98, 7, 41 }, // sg -> sg_Latn_CF
- { 293, 0, 0 }, { 293, 77, 104 }, // sga -> sga_Ogam_IE
- { 183, 0, 0 }, { 183, 9, 145 }, // shi -> shi_Tfng_MA
- { 106, 0, 0 }, { 106, 32, 198 }, // si -> si_Sinh_LK
- { 155, 0, 0 }, { 155, 7, 69 }, // sid -> sid_Latn_ET
- { 108, 0, 0 }, { 108, 7, 191 }, // sk -> sk_Latn_SK
- { 352, 0, 0 }, { 352, 1, 163 }, // skr -> skr_Arab_PK
- { 109, 0, 0 }, { 109, 7, 192 }, // sl -> sl_Latn_SI
- { 97, 0, 0 }, { 97, 7, 183 }, // sm -> sm_Latn_WS
- { 324, 0, 0 }, { 324, 7, 205 }, // sma -> sma_Latn_SE
- { 325, 0, 0 }, { 325, 7, 205 }, // smj -> smj_Latn_SE
- { 326, 0, 0 }, { 326, 7, 73 }, // smn -> smn_Latn_FI
- { 303, 0, 0 }, { 303, 89, 105 }, // smp -> smp_Samr_IL
- { 327, 0, 0 }, { 327, 7, 73 }, // sms -> sms_Latn_FI
- { 104, 0, 0 }, { 104, 7, 240 }, // sn -> sn_Latn_ZW
- { 110, 0, 0 }, { 110, 7, 194 }, // so -> so_Latn_SO
- { 6, 0, 0 }, { 6, 7, 2 }, // sq -> sq_Latn_AL
- { 100, 0, 0 }, { 100, 2, 243 }, // sr -> sr_Cyrl_RS
- { 100, 0, 242 }, { 100, 7, 242 }, // sr_ME -> sr_Latn_ME
- { 100, 0, 177 }, { 100, 7, 177 }, // sr_RO -> sr_Latn_RO
- { 100, 0, 178 }, { 100, 7, 178 }, // sr_RU -> sr_Latn_RU
- { 100, 0, 217 }, { 100, 7, 217 }, // sr_TR -> sr_Latn_TR
- { 306, 0, 0 }, { 306, 93, 100 }, // srb -> srb_Sora_IN
- { 107, 0, 0 }, { 107, 7, 195 }, // ss -> ss_Latn_ZA
- { 207, 0, 0 }, { 207, 7, 67 }, // ssy -> ssy_Latn_ER
- { 102, 0, 0 }, { 102, 7, 195 }, // st -> st_Latn_ZA
- { 112, 0, 0 }, { 112, 7, 101 }, // su -> su_Latn_ID
- { 114, 0, 0 }, { 114, 7, 205 }, // sv -> sv_Latn_SE
- { 113, 0, 0 }, { 113, 7, 210 }, // sw -> sw_Latn_TZ
- { 250, 0, 0 }, { 250, 7, 49 }, // swc -> swc_Latn_CD
- { 307, 0, 0 }, { 307, 11, 18 }, // syl -> syl_Beng_BD
- { 151, 0, 0 }, { 151, 33, 103 }, // syr -> syr_Syrc_IQ
- { 117, 0, 0 }, { 117, 27, 100 }, // ta -> ta_Taml_IN
- { 308, 0, 0 }, { 308, 7, 170 }, // tbw -> tbw_Latn_PH
- { 310, 0, 0 }, { 310, 99, 44 }, // tdd -> tdd_Tale_CN
- { 119, 0, 0 }, { 119, 28, 100 }, // te -> te_Telu_IN
- { 206, 0, 0 }, { 206, 7, 221 }, // teo -> teo_Latn_UG
- { 116, 0, 0 }, { 116, 2, 209 }, // tg -> tg_Cyrl_TJ
- { 116, 0, 163 }, { 116, 1, 163 }, // tg_PK -> tg_Arab_PK
- { 116, 1, 0 }, { 116, 1, 163 }, // tg_Arab -> tg_Arab_PK
- { 120, 0, 0 }, { 120, 30, 211 }, // th -> th_Thai_TH
- { 122, 0, 0 }, { 122, 14, 69 }, // ti -> ti_Ethi_ET
- { 157, 0, 0 }, { 157, 14, 67 }, // tig -> tig_Ethi_ER
- { 126, 0, 0 }, { 126, 7, 218 }, // tk -> tk_Latn_TM
- { 353, 0, 0 }, { 353, 7, 213 }, // tkl -> tkl_Latn_TK
- { 103, 0, 0 }, { 103, 7, 195 }, // tn -> tn_Latn_ZA
- { 123, 0, 0 }, { 123, 7, 214 }, // to -> to_Latn_TO
- { 354, 0, 0 }, { 354, 7, 167 }, // tpi -> tpi_Latn_PG
- { 125, 0, 0 }, { 125, 7, 217 }, // tr -> tr_Latn_TR
- { 174, 0, 0 }, { 174, 7, 208 }, // trv -> trv_Latn_TW
- { 124, 0, 0 }, { 124, 7, 195 }, // ts -> ts_Latn_ZA
- { 118, 0, 0 }, { 118, 2, 178 }, // tt -> tt_Cyrl_RU
- { 355, 0, 0 }, { 355, 7, 220 }, // tvl -> tvl_Latn_TV
- { 251, 0, 0 }, { 251, 7, 156 }, // twq -> twq_Latn_NE
- { 359, 0, 0 }, { 359, 139, 44 }, // txg -> txg_Tang_CN
- { 127, 0, 0 }, { 127, 7, 77 }, // ty -> ty_Latn_PF
- { 212, 0, 0 }, { 212, 7, 145 }, // tzm -> tzm_Latn_MA
- { 128, 0, 0 }, { 128, 1, 44 }, // ug -> ug_Arab_CN
- { 128, 0, 110 }, { 128, 2, 110 }, // ug_KZ -> ug_Cyrl_KZ
- { 128, 0, 143 }, { 128, 2, 143 }, // ug_MN -> ug_Cyrl_MN
- { 128, 2, 0 }, { 128, 2, 110 }, // ug_Cyrl -> ug_Cyrl_KZ
- { 311, 0, 0 }, { 311, 102, 207 }, // uga -> uga_Ugar_SY
- { 129, 0, 0 }, { 129, 2, 222 }, // uk -> uk_Cyrl_UA
- { 130, 0, 0 }, { 130, 1, 163 }, // ur -> ur_Arab_PK
- { 131, 0, 0 }, { 131, 7, 228 }, // uz -> uz_Latn_UZ
- { 131, 0, 1 }, { 131, 1, 1 }, // uz_AF -> uz_Arab_AF
- { 131, 0, 44 }, { 131, 2, 44 }, // uz_CN -> uz_Cyrl_CN
- { 131, 1, 0 }, { 131, 1, 1 }, // uz_Arab -> uz_Arab_AF
- { 252, 0, 0 }, { 252, 35, 121 }, // vai -> vai_Vaii_LR
- { 160, 0, 0 }, { 160, 7, 195 }, // ve -> ve_Latn_ZA
- { 132, 0, 0 }, { 132, 7, 232 }, // vi -> vi_Latn_VN
- { 133, 0, 0 }, { 133, 7, 260 }, // vo -> vo_Latn_001
- { 187, 0, 0 }, { 187, 7, 210 }, // vun -> vun_Latn_TZ
- { 236, 0, 0 }, { 236, 7, 21 }, // wa -> wa_Latn_BE
- { 253, 0, 0 }, { 253, 7, 206 }, // wae -> wae_Latn_CH
- { 162, 0, 0 }, { 162, 14, 69 }, // wal -> wal_Ethi_ET
- { 328, 0, 0 }, { 328, 7, 13 }, // wbp -> wbp_Latn_AU
- { 135, 0, 0 }, { 135, 7, 187 }, // wo -> wo_Latn_SN
- { 271, 0, 0 }, { 271, 45, 217 }, // xcr -> xcr_Cari_TR
- { 136, 0, 0 }, { 136, 7, 195 }, // xh -> xh_Latn_ZA
- { 287, 0, 0 }, { 287, 69, 217 }, // xlc -> xlc_Lyci_TR
- { 288, 0, 0 }, { 288, 70, 217 }, // xld -> xld_Lydi_TR
- { 329, 0, 0 }, { 329, 114, 44 }, // xmn -> xmn_Mani_CN
- { 291, 0, 0 }, { 291, 74, 201 }, // xmr -> xmr_Merc_SD
- { 331, 0, 0 }, { 331, 118, 186 }, // xna -> xna_Narb_SA
- { 203, 0, 0 }, { 203, 7, 221 }, // xog -> xog_Latn_UG
- { 298, 0, 0 }, { 298, 59, 102 }, // xpr -> xpr_Prti_IR
- { 302, 0, 0 }, { 302, 81, 237 }, // xsa -> xsa_Sarb_YE
- { 254, 0, 0 }, { 254, 7, 37 }, // yav -> yav_Latn_CM
- { 137, 0, 0 }, { 137, 18, 260 }, // yi -> yi_Hebr_001
- { 138, 0, 0 }, { 138, 7, 157 }, // yo -> yo_Latn_NG
- { 357, 0, 0 }, { 357, 6, 97 }, // yue -> yue_Hant_HK
- { 357, 0, 44 }, { 357, 5, 44 }, // yue_CN -> yue_Hans_CN
- { 357, 5, 0 }, { 357, 5, 44 }, // yue_Hans -> yue_Hans_CN
- { 139, 0, 0 }, { 139, 7, 44 }, // za -> za_Latn_CN
- { 314, 0, 0 }, { 314, 9, 145 }, // zgh -> zgh_Tfng_MA
- { 25, 0, 0 }, { 25, 5, 44 }, // zh -> zh_Hans_CN
- { 25, 0, 13 }, { 25, 6, 13 }, // zh_AU -> zh_Hant_AU
- { 25, 0, 32 }, { 25, 6, 32 }, // zh_BN -> zh_Hant_BN
- { 25, 0, 224 }, { 25, 6, 224 }, // zh_GB -> zh_Hant_GB
- { 25, 0, 76 }, { 25, 6, 76 }, // zh_GF -> zh_Hant_GF
- { 25, 0, 97 }, { 25, 6, 97 }, // zh_HK -> zh_Hant_HK
- { 25, 0, 101 }, { 25, 6, 101 }, // zh_ID -> zh_Hant_ID
- { 25, 0, 126 }, { 25, 6, 126 }, // zh_MO -> zh_Hant_MO
- { 25, 0, 130 }, { 25, 6, 130 }, // zh_MY -> zh_Hant_MY
- { 25, 0, 166 }, { 25, 6, 166 }, // zh_PA -> zh_Hant_PA
- { 25, 0, 77 }, { 25, 6, 77 }, // zh_PF -> zh_Hant_PF
- { 25, 0, 170 }, { 25, 6, 170 }, // zh_PH -> zh_Hant_PH
- { 25, 0, 202 }, { 25, 6, 202 }, // zh_SR -> zh_Hant_SR
- { 25, 0, 211 }, { 25, 6, 211 }, // zh_TH -> zh_Hant_TH
- { 25, 0, 208 }, { 25, 6, 208 }, // zh_TW -> zh_Hant_TW
- { 25, 0, 225 }, { 25, 6, 225 }, // zh_US -> zh_Hant_US
- { 25, 0, 232 }, { 25, 6, 232 }, // zh_VN -> zh_Hant_VN
- { 25, 40, 0 }, { 25, 40, 208 }, // zh_Bopo -> zh_Bopo_TW
- { 25, 140, 0 }, { 25, 140, 208 }, // zh_Hanb -> zh_Hanb_TW
- { 25, 6, 0 }, { 25, 6, 208 }, // zh_Hant -> zh_Hant_TW
- { 140, 0, 0 }, { 140, 7, 195 }, // zu -> zu_Latn_ZA
- { 0, 0, 261 }, { 96, 2, 178 }, // und_150 -> ru_Cyrl_RU
- { 0, 0, 246 }, { 111, 7, 246 }, // und_419 -> es_Latn_419
- { 0, 0, 5 }, { 24, 7, 5 }, // und_AD -> ca_Latn_AD
- { 0, 0, 223 }, { 8, 1, 223 }, // und_AE -> ar_Arab_AE
- { 0, 0, 1 }, { 89, 1, 1 }, // und_AF -> fa_Arab_AF
- { 0, 0, 2 }, { 6, 7, 2 }, // und_AL -> sq_Latn_AL
- { 0, 0, 11 }, { 9, 10, 11 }, // und_AM -> hy_Armn_AM
- { 0, 0, 6 }, { 91, 7, 6 }, // und_AO -> pt_Latn_AO
- { 0, 0, 8 }, { 0, 7, 8 }, // und_AQ -> und_Latn_AQ
- { 0, 0, 10 }, { 111, 7, 10 }, // und_AR -> es_Latn_AR
- { 0, 0, 4 }, { 97, 7, 4 }, // und_AS -> sm_Latn_AS
- { 0, 0, 14 }, { 42, 7, 14 }, // und_AT -> de_Latn_AT
- { 0, 0, 12 }, { 30, 7, 12 }, // und_AW -> nl_Latn_AW
- { 0, 0, 248 }, { 114, 7, 248 }, // und_AX -> sv_Latn_AX
- { 0, 0, 15 }, { 12, 7, 15 }, // und_AZ -> az_Latn_AZ
- { 0, 0, 27 }, { 142, 7, 27 }, // und_BA -> bs_Latn_BA
- { 0, 0, 18 }, { 15, 11, 18 }, // und_BD -> bn_Beng_BD
- { 0, 0, 21 }, { 30, 7, 21 }, // und_BE -> nl_Latn_BE
- { 0, 0, 34 }, { 37, 7, 34 }, // und_BF -> fr_Latn_BF
- { 0, 0, 33 }, { 20, 2, 33 }, // und_BG -> bg_Cyrl_BG
- { 0, 0, 17 }, { 8, 1, 17 }, // und_BH -> ar_Arab_BH
- { 0, 0, 35 }, { 68, 7, 35 }, // und_BI -> rn_Latn_BI
- { 0, 0, 23 }, { 37, 7, 23 }, // und_BJ -> fr_Latn_BJ
- { 0, 0, 244 }, { 37, 7, 244 }, // und_BL -> fr_Latn_BL
- { 0, 0, 32 }, { 76, 7, 32 }, // und_BN -> ms_Latn_BN
- { 0, 0, 26 }, { 111, 7, 26 }, // und_BO -> es_Latn_BO
- { 0, 0, 255 }, { 351, 7, 255 }, // und_BQ -> pap_Latn_BQ
- { 0, 0, 30 }, { 91, 7, 30 }, // und_BR -> pt_Latn_BR
- { 0, 0, 25 }, { 16, 31, 25 }, // und_BT -> dz_Tibt_BT
- { 0, 0, 29 }, { 0, 7, 29 }, // und_BV -> und_Latn_BV
- { 0, 0, 20 }, { 22, 2, 20 }, // und_BY -> be_Cyrl_BY
- { 0, 0, 49 }, { 113, 7, 49 }, // und_CD -> sw_Latn_CD
- { 0, 0, 41 }, { 37, 7, 41 }, // und_CF -> fr_Latn_CF
- { 0, 0, 50 }, { 37, 7, 50 }, // und_CG -> fr_Latn_CG
- { 0, 0, 206 }, { 42, 7, 206 }, // und_CH -> de_Latn_CH
- { 0, 0, 53 }, { 37, 7, 53 }, // und_CI -> fr_Latn_CI
- { 0, 0, 43 }, { 111, 7, 43 }, // und_CL -> es_Latn_CL
- { 0, 0, 37 }, { 37, 7, 37 }, // und_CM -> fr_Latn_CM
- { 0, 0, 44 }, { 25, 5, 44 }, // und_CN -> zh_Hans_CN
- { 0, 0, 47 }, { 111, 7, 47 }, // und_CO -> es_Latn_CO
- { 0, 0, 241 }, { 0, 7, 241 }, // und_CP -> und_Latn_CP
- { 0, 0, 52 }, { 111, 7, 52 }, // und_CR -> es_Latn_CR
- { 0, 0, 55 }, { 111, 7, 55 }, // und_CU -> es_Latn_CU
- { 0, 0, 39 }, { 91, 7, 39 }, // und_CV -> pt_Latn_CV
- { 0, 0, 152 }, { 351, 7, 152 }, // und_CW -> pap_Latn_CW
- { 0, 0, 56 }, { 43, 16, 56 }, // und_CY -> el_Grek_CY
- { 0, 0, 57 }, { 28, 7, 57 }, // und_CZ -> cs_Latn_CZ
- { 0, 0, 82 }, { 42, 7, 82 }, // und_DE -> de_Latn_DE
- { 0, 0, 59 }, { 4, 7, 59 }, // und_DJ -> aa_Latn_DJ
- { 0, 0, 58 }, { 29, 7, 58 }, // und_DK -> da_Latn_DK
- { 0, 0, 61 }, { 111, 7, 61 }, // und_DO -> es_Latn_DO
- { 0, 0, 3 }, { 8, 1, 3 }, // und_DZ -> ar_Arab_DZ
- { 0, 0, 250 }, { 111, 7, 250 }, // und_EA -> es_Latn_EA
- { 0, 0, 63 }, { 111, 7, 63 }, // und_EC -> es_Latn_EC
- { 0, 0, 68 }, { 33, 7, 68 }, // und_EE -> et_Latn_EE
- { 0, 0, 64 }, { 8, 1, 64 }, // und_EG -> ar_Arab_EG
- { 0, 0, 236 }, { 8, 1, 236 }, // und_EH -> ar_Arab_EH
- { 0, 0, 67 }, { 122, 14, 67 }, // und_ER -> ti_Ethi_ER
- { 0, 0, 197 }, { 111, 7, 197 }, // und_ES -> es_Latn_ES
- { 0, 0, 69 }, { 7, 14, 69 }, // und_ET -> am_Ethi_ET
- { 0, 0, 258 }, { 31, 7, 224 }, // und_EU -> en_Latn_GB
- { 0, 0, 73 }, { 36, 7, 73 }, // und_FI -> fi_Latn_FI
- { 0, 0, 71 }, { 34, 7, 71 }, // und_FO -> fo_Latn_FO
- { 0, 0, 74 }, { 37, 7, 74 }, // und_FR -> fr_Latn_FR
- { 0, 0, 79 }, { 37, 7, 79 }, // und_GA -> fr_Latn_GA
- { 0, 0, 81 }, { 41, 15, 81 }, // und_GE -> ka_Geor_GE
- { 0, 0, 76 }, { 37, 7, 76 }, // und_GF -> fr_Latn_GF
- { 0, 0, 83 }, { 146, 7, 83 }, // und_GH -> ak_Latn_GH
- { 0, 0, 86 }, { 44, 7, 86 }, // und_GL -> kl_Latn_GL
- { 0, 0, 91 }, { 37, 7, 91 }, // und_GN -> fr_Latn_GN
- { 0, 0, 88 }, { 37, 7, 88 }, // und_GP -> fr_Latn_GP
- { 0, 0, 66 }, { 111, 7, 66 }, // und_GQ -> es_Latn_GQ
- { 0, 0, 85 }, { 43, 16, 85 }, // und_GR -> el_Grek_GR
- { 0, 0, 196 }, { 0, 7, 196 }, // und_GS -> und_Latn_GS
- { 0, 0, 90 }, { 111, 7, 90 }, // und_GT -> es_Latn_GT
- { 0, 0, 92 }, { 91, 7, 92 }, // und_GW -> pt_Latn_GW
- { 0, 0, 97 }, { 25, 6, 97 }, // und_HK -> zh_Hant_HK
- { 0, 0, 95 }, { 0, 7, 95 }, // und_HM -> und_Latn_HM
- { 0, 0, 96 }, { 111, 7, 96 }, // und_HN -> es_Latn_HN
- { 0, 0, 54 }, { 27, 7, 54 }, // und_HR -> hr_Latn_HR
- { 0, 0, 94 }, { 222, 7, 94 }, // und_HT -> ht_Latn_HT
- { 0, 0, 98 }, { 50, 7, 98 }, // und_HU -> hu_Latn_HU
- { 0, 0, 238 }, { 111, 7, 238 }, // und_IC -> es_Latn_IC
- { 0, 0, 101 }, { 52, 7, 101 }, // und_ID -> id_Latn_ID
- { 0, 0, 105 }, { 48, 18, 105 }, // und_IL -> he_Hebr_IL
- { 0, 0, 100 }, { 49, 13, 100 }, // und_IN -> hi_Deva_IN
- { 0, 0, 103 }, { 8, 1, 103 }, // und_IQ -> ar_Arab_IQ
- { 0, 0, 102 }, { 89, 1, 102 }, // und_IR -> fa_Arab_IR
- { 0, 0, 99 }, { 51, 7, 99 }, // und_IS -> is_Latn_IS
- { 0, 0, 106 }, { 58, 7, 106 }, // und_IT -> it_Latn_IT
- { 0, 0, 109 }, { 8, 1, 109 }, // und_JO -> ar_Arab_JO
- { 0, 0, 108 }, { 59, 19, 108 }, // und_JP -> ja_Jpan_JP
- { 0, 0, 111 }, { 113, 7, 111 }, // und_KE -> sw_Latn_KE
- { 0, 0, 116 }, { 65, 2, 116 }, // und_KG -> ky_Cyrl_KG
- { 0, 0, 36 }, { 23, 20, 36 }, // und_KH -> km_Khmr_KH
- { 0, 0, 48 }, { 8, 1, 48 }, // und_KM -> ar_Arab_KM
- { 0, 0, 113 }, { 66, 22, 113 }, // und_KP -> ko_Kore_KP
- { 0, 0, 114 }, { 66, 22, 114 }, // und_KR -> ko_Kore_KR
- { 0, 0, 115 }, { 8, 1, 115 }, // und_KW -> ar_Arab_KW
- { 0, 0, 110 }, { 96, 2, 110 }, // und_KZ -> ru_Cyrl_KZ
- { 0, 0, 117 }, { 69, 23, 117 }, // und_LA -> lo_Laoo_LA
- { 0, 0, 119 }, { 8, 1, 119 }, // und_LB -> ar_Arab_LB
- { 0, 0, 123 }, { 42, 7, 123 }, // und_LI -> de_Latn_LI
- { 0, 0, 198 }, { 106, 32, 198 }, // und_LK -> si_Sinh_LK
- { 0, 0, 120 }, { 102, 7, 120 }, // und_LS -> st_Latn_LS
- { 0, 0, 124 }, { 73, 7, 124 }, // und_LT -> lt_Latn_LT
- { 0, 0, 125 }, { 37, 7, 125 }, // und_LU -> fr_Latn_LU
- { 0, 0, 118 }, { 71, 7, 118 }, // und_LV -> lv_Latn_LV
- { 0, 0, 122 }, { 8, 1, 122 }, // und_LY -> ar_Arab_LY
- { 0, 0, 145 }, { 8, 1, 145 }, // und_MA -> ar_Arab_MA
- { 0, 0, 142 }, { 37, 7, 142 }, // und_MC -> fr_Latn_MC
- { 0, 0, 141 }, { 95, 7, 141 }, // und_MD -> ro_Latn_MD
- { 0, 0, 242 }, { 100, 7, 242 }, // und_ME -> sr_Latn_ME
- { 0, 0, 245 }, { 37, 7, 245 }, // und_MF -> fr_Latn_MF
- { 0, 0, 128 }, { 75, 7, 128 }, // und_MG -> mg_Latn_MG
- { 0, 0, 127 }, { 74, 2, 127 }, // und_MK -> mk_Cyrl_MK
- { 0, 0, 132 }, { 188, 7, 132 }, // und_ML -> bm_Latn_ML
- { 0, 0, 147 }, { 21, 25, 147 }, // und_MM -> my_Mymr_MM
- { 0, 0, 143 }, { 82, 2, 143 }, // und_MN -> mn_Cyrl_MN
- { 0, 0, 126 }, { 25, 6, 126 }, // und_MO -> zh_Hant_MO
- { 0, 0, 135 }, { 37, 7, 135 }, // und_MQ -> fr_Latn_MQ
- { 0, 0, 136 }, { 8, 1, 136 }, // und_MR -> ar_Arab_MR
- { 0, 0, 133 }, { 78, 7, 133 }, // und_MT -> mt_Latn_MT
- { 0, 0, 137 }, { 191, 7, 137 }, // und_MU -> mfe_Latn_MU
- { 0, 0, 131 }, { 143, 29, 131 }, // und_MV -> dv_Thaa_MV
- { 0, 0, 139 }, { 111, 7, 139 }, // und_MX -> es_Latn_MX
- { 0, 0, 130 }, { 76, 7, 130 }, // und_MY -> ms_Latn_MY
- { 0, 0, 146 }, { 91, 7, 146 }, // und_MZ -> pt_Latn_MZ
- { 0, 0, 148 }, { 5, 7, 148 }, // und_NA -> af_Latn_NA
- { 0, 0, 153 }, { 37, 7, 153 }, // und_NC -> fr_Latn_NC
- { 0, 0, 156 }, { 47, 7, 156 }, // und_NE -> ha_Latn_NE
- { 0, 0, 155 }, { 111, 7, 155 }, // und_NI -> es_Latn_NI
- { 0, 0, 151 }, { 30, 7, 151 }, // und_NL -> nl_Latn_NL
- { 0, 0, 161 }, { 85, 7, 161 }, // und_NO -> nb_Latn_NO
- { 0, 0, 150 }, { 84, 13, 150 }, // und_NP -> ne_Deva_NP
- { 0, 0, 162 }, { 8, 1, 162 }, // und_OM -> ar_Arab_OM
- { 0, 0, 166 }, { 111, 7, 166 }, // und_PA -> es_Latn_PA
- { 0, 0, 169 }, { 111, 7, 169 }, // und_PE -> es_Latn_PE
- { 0, 0, 77 }, { 37, 7, 77 }, // und_PF -> fr_Latn_PF
- { 0, 0, 167 }, { 354, 7, 167 }, // und_PG -> tpi_Latn_PG
- { 0, 0, 170 }, { 166, 7, 170 }, // und_PH -> fil_Latn_PH
- { 0, 0, 163 }, { 130, 1, 163 }, // und_PK -> ur_Arab_PK
- { 0, 0, 172 }, { 90, 7, 172 }, // und_PL -> pl_Latn_PL
- { 0, 0, 200 }, { 37, 7, 200 }, // und_PM -> fr_Latn_PM
- { 0, 0, 174 }, { 111, 7, 174 }, // und_PR -> es_Latn_PR
- { 0, 0, 165 }, { 8, 1, 165 }, // und_PS -> ar_Arab_PS
- { 0, 0, 173 }, { 91, 7, 173 }, // und_PT -> pt_Latn_PT
- { 0, 0, 164 }, { 350, 7, 164 }, // und_PW -> pau_Latn_PW
- { 0, 0, 168 }, { 45, 7, 168 }, // und_PY -> gn_Latn_PY
- { 0, 0, 175 }, { 8, 1, 175 }, // und_QA -> ar_Arab_QA
- { 0, 0, 259 }, { 31, 7, 249 }, // und_QO -> en_Latn_DG
- { 0, 0, 176 }, { 37, 7, 176 }, // und_RE -> fr_Latn_RE
- { 0, 0, 177 }, { 95, 7, 177 }, // und_RO -> ro_Latn_RO
- { 0, 0, 243 }, { 100, 2, 243 }, // und_RS -> sr_Cyrl_RS
- { 0, 0, 178 }, { 96, 2, 178 }, // und_RU -> ru_Cyrl_RU
- { 0, 0, 179 }, { 64, 7, 179 }, // und_RW -> rw_Latn_RW
- { 0, 0, 186 }, { 8, 1, 186 }, // und_SA -> ar_Arab_SA
- { 0, 0, 188 }, { 37, 7, 188 }, // und_SC -> fr_Latn_SC
- { 0, 0, 201 }, { 8, 1, 201 }, // und_SD -> ar_Arab_SD
- { 0, 0, 205 }, { 114, 7, 205 }, // und_SE -> sv_Latn_SE
- { 0, 0, 192 }, { 109, 7, 192 }, // und_SI -> sl_Latn_SI
- { 0, 0, 203 }, { 85, 7, 203 }, // und_SJ -> nb_Latn_SJ
- { 0, 0, 191 }, { 108, 7, 191 }, // und_SK -> sk_Latn_SK
- { 0, 0, 184 }, { 58, 7, 184 }, // und_SM -> it_Latn_SM
- { 0, 0, 187 }, { 37, 7, 187 }, // und_SN -> fr_Latn_SN
- { 0, 0, 194 }, { 110, 7, 194 }, // und_SO -> so_Latn_SO
- { 0, 0, 202 }, { 30, 7, 202 }, // und_SR -> nl_Latn_SR
- { 0, 0, 185 }, { 91, 7, 185 }, // und_ST -> pt_Latn_ST
- { 0, 0, 65 }, { 111, 7, 65 }, // und_SV -> es_Latn_SV
- { 0, 0, 207 }, { 8, 1, 207 }, // und_SY -> ar_Arab_SY
- { 0, 0, 42 }, { 37, 7, 42 }, // und_TD -> fr_Latn_TD
- { 0, 0, 78 }, { 37, 7, 78 }, // und_TF -> fr_Latn_TF
- { 0, 0, 212 }, { 37, 7, 212 }, // und_TG -> fr_Latn_TG
- { 0, 0, 211 }, { 120, 30, 211 }, // und_TH -> th_Thai_TH
- { 0, 0, 209 }, { 116, 2, 209 }, // und_TJ -> tg_Cyrl_TJ
- { 0, 0, 213 }, { 353, 7, 213 }, // und_TK -> tkl_Latn_TK
- { 0, 0, 62 }, { 91, 7, 62 }, // und_TL -> pt_Latn_TL
- { 0, 0, 218 }, { 126, 7, 218 }, // und_TM -> tk_Latn_TM
- { 0, 0, 216 }, { 8, 1, 216 }, // und_TN -> ar_Arab_TN
- { 0, 0, 214 }, { 123, 7, 214 }, // und_TO -> to_Latn_TO
- { 0, 0, 217 }, { 125, 7, 217 }, // und_TR -> tr_Latn_TR
- { 0, 0, 220 }, { 355, 7, 220 }, // und_TV -> tvl_Latn_TV
- { 0, 0, 208 }, { 25, 6, 208 }, // und_TW -> zh_Hant_TW
- { 0, 0, 210 }, { 113, 7, 210 }, // und_TZ -> sw_Latn_TZ
- { 0, 0, 222 }, { 129, 2, 222 }, // und_UA -> uk_Cyrl_UA
- { 0, 0, 221 }, { 113, 7, 221 }, // und_UG -> sw_Latn_UG
- { 0, 0, 227 }, { 111, 7, 227 }, // und_UY -> es_Latn_UY
- { 0, 0, 228 }, { 131, 7, 228 }, // und_UZ -> uz_Latn_UZ
- { 0, 0, 230 }, { 58, 7, 230 }, // und_VA -> it_Latn_VA
- { 0, 0, 231 }, { 111, 7, 231 }, // und_VE -> es_Latn_VE
- { 0, 0, 232 }, { 132, 7, 232 }, // und_VN -> vi_Latn_VN
- { 0, 0, 229 }, { 18, 7, 229 }, // und_VU -> bi_Latn_VU
- { 0, 0, 235 }, { 37, 7, 235 }, // und_WF -> fr_Latn_WF
- { 0, 0, 183 }, { 97, 7, 183 }, // und_WS -> sm_Latn_WS
- { 0, 0, 257 }, { 6, 7, 257 }, // und_XK -> sq_Latn_XK
- { 0, 0, 237 }, { 8, 1, 237 }, // und_YE -> ar_Arab_YE
- { 0, 0, 138 }, { 37, 7, 138 }, // und_YT -> fr_Latn_YT
- { 0, 0, 240 }, { 104, 7, 240 }, // und_ZW -> sn_Latn_ZW
- { 0, 134, 0 }, { 177, 134, 91 }, // und_Adlm -> ff_Adlm_GN
- { 0, 105, 0 }, { 335, 105, 178 }, // und_Aghb -> lez_Aghb_RU
- { 0, 128, 0 }, { 340, 128, 100 }, // und_Ahom -> aho_Ahom_IN
- { 0, 1, 0 }, { 8, 1, 64 }, // und_Arab -> ar_Arab_EG
- { 0, 1, 46 }, { 76, 1, 46 }, // und_Arab_CC -> ms_Arab_CC
- { 0, 1, 44 }, { 128, 1, 44 }, // und_Arab_CN -> ug_Arab_CN
- { 0, 1, 224 }, { 62, 1, 224 }, // und_Arab_GB -> ks_Arab_GB
- { 0, 1, 101 }, { 76, 1, 101 }, // und_Arab_ID -> ms_Arab_ID
- { 0, 1, 100 }, { 130, 1, 100 }, // und_Arab_IN -> ur_Arab_IN
- { 0, 1, 143 }, { 63, 1, 143 }, // und_Arab_MN -> kk_Arab_MN
- { 0, 1, 137 }, { 130, 1, 137 }, // und_Arab_MU -> ur_Arab_MU
- { 0, 1, 157 }, { 47, 1, 157 }, // und_Arab_NG -> ha_Arab_NG
- { 0, 1, 163 }, { 130, 1, 163 }, // und_Arab_PK -> ur_Arab_PK
- { 0, 1, 209 }, { 89, 1, 209 }, // und_Arab_TJ -> fa_Arab_TJ
- { 0, 1, 217 }, { 12, 1, 217 }, // und_Arab_TR -> az_Arab_TR
- { 0, 57, 0 }, { 265, 57, 102 }, // und_Armi -> arc_Armi_IR
- { 0, 10, 0 }, { 9, 10, 11 }, // und_Armn -> hy_Armn_AM
- { 0, 36, 0 }, { 255, 36, 102 }, // und_Avst -> ae_Avst_IR
- { 0, 37, 0 }, { 266, 37, 101 }, // und_Bali -> ban_Bali_ID
- { 0, 38, 0 }, { 267, 38, 37 }, // und_Bamu -> bax_Bamu_CM
- { 0, 106, 0 }, { 336, 106, 121 }, // und_Bass -> bsq_Bass_LR
- { 0, 39, 0 }, { 268, 39, 101 }, // und_Batk -> bbc_Batk_ID
- { 0, 11, 0 }, { 15, 11, 18 }, // und_Beng -> bn_Beng_BD
- { 0, 135, 0 }, { 99, 135, 100 }, // und_Bhks -> sa_Bhks_IN
- { 0, 40, 0 }, { 25, 40, 208 }, // und_Bopo -> zh_Bopo_TW
- { 0, 41, 0 }, { 342, 41, 100 }, // und_Brah -> pka_Brah_IN
- { 0, 103, 0 }, { 37, 103, 74 }, // und_Brai -> fr_Brai_FR
- { 0, 42, 0 }, { 269, 42, 101 }, // und_Bugi -> bug_Bugi_ID
- { 0, 43, 0 }, { 270, 43, 170 }, // und_Buhd -> bku_Buhd_PH
- { 0, 46, 0 }, { 272, 46, 18 }, // und_Cakm -> ccp_Cakm_BD
- { 0, 44, 0 }, { 221, 44, 38 }, // und_Cans -> cr_Cans_CA
- { 0, 45, 0 }, { 271, 45, 217 }, // und_Cari -> xcr_Cari_TR
- { 0, 47, 0 }, { 276, 47, 232 }, // und_Cham -> cjm_Cham_VN
- { 0, 12, 0 }, { 190, 12, 225 }, // und_Cher -> chr_Cher_US
- { 0, 48, 0 }, { 274, 48, 64 }, // und_Copt -> cop_Copt_EG
- { 0, 49, 0 }, { 264, 49, 56 }, // und_Cprt -> grc_Cprt_CY
- { 0, 2, 0 }, { 96, 2, 178 }, // und_Cyrl -> ru_Cyrl_RU
- { 0, 2, 2 }, { 74, 2, 2 }, // und_Cyrl_AL -> mk_Cyrl_AL
- { 0, 2, 27 }, { 100, 2, 27 }, // und_Cyrl_BA -> sr_Cyrl_BA
- { 0, 2, 81 }, { 2, 2, 81 }, // und_Cyrl_GE -> ab_Cyrl_GE
- { 0, 2, 85 }, { 74, 2, 85 }, // und_Cyrl_GR -> mk_Cyrl_GR
- { 0, 2, 141 }, { 129, 2, 141 }, // und_Cyrl_MD -> uk_Cyrl_MD
- { 0, 2, 177 }, { 20, 2, 177 }, // und_Cyrl_RO -> bg_Cyrl_RO
- { 0, 2, 191 }, { 129, 2, 191 }, // und_Cyrl_SK -> uk_Cyrl_SK
- { 0, 2, 257 }, { 100, 2, 257 }, // und_Cyrl_XK -> sr_Cyrl_XK
- { 0, 13, 0 }, { 49, 13, 100 }, // und_Deva -> hi_Deva_IN
- { 0, 13, 25 }, { 84, 13, 25 }, // und_Deva_BT -> ne_Deva_BT
- { 0, 13, 137 }, { 343, 13, 137 }, // und_Deva_MU -> bho_Deva_MU
- { 0, 107, 0 }, { 37, 107, 74 }, // und_Dupl -> fr_Dupl_FR
- { 0, 50, 0 }, { 263, 50, 64 }, // und_Egyp -> egy_Egyp_EG
- { 0, 108, 0 }, { 6, 108, 2 }, // und_Elba -> sq_Elba_AL
- { 0, 14, 0 }, { 7, 14, 69 }, // und_Ethi -> am_Ethi_ET
- { 0, 15, 0 }, { 41, 15, 81 }, // und_Geor -> ka_Geor_GE
- { 0, 52, 0 }, { 219, 52, 33 }, // und_Glag -> cu_Glag_BG
- { 0, 53, 0 }, { 279, 53, 222 }, // und_Goth -> got_Goth_UA
- { 0, 109, 0 }, { 99, 109, 100 }, // und_Gran -> sa_Gran_IN
- { 0, 16, 0 }, { 43, 16, 85 }, // und_Grek -> el_Grek_GR
- { 0, 17, 0 }, { 46, 17, 100 }, // und_Gujr -> gu_Gujr_IN
- { 0, 4, 0 }, { 92, 4, 100 }, // und_Guru -> pa_Guru_IN
- { 0, 140, 0 }, { 25, 140, 208 }, // und_Hanb -> zh_Hanb_TW
- { 0, 55, 0 }, { 66, 55, 114 }, // und_Hang -> ko_Hang_KR
- { 0, 54, 0 }, { 25, 54, 44 }, // und_Hani -> zh_Hani_CN
- { 0, 56, 0 }, { 280, 56, 170 }, // und_Hano -> hnn_Hano_PH
- { 0, 5, 0 }, { 25, 5, 44 }, // und_Hans -> zh_Hans_CN
- { 0, 6, 0 }, { 25, 6, 208 }, // und_Hant -> zh_Hant_TW
- { 0, 130, 0 }, { 356, 130, 103 }, // und_Hatr -> mis_Hatr_IQ
- { 0, 18, 0 }, { 48, 18, 105 }, // und_Hebr -> he_Hebr_IL
- { 0, 18, 38 }, { 137, 18, 38 }, // und_Hebr_CA -> yi_Hebr_CA
- { 0, 18, 224 }, { 137, 18, 224 }, // und_Hebr_GB -> yi_Hebr_GB
- { 0, 18, 205 }, { 137, 18, 205 }, // und_Hebr_SE -> yi_Hebr_SE
- { 0, 18, 222 }, { 137, 18, 222 }, // und_Hebr_UA -> yi_Hebr_UA
- { 0, 18, 225 }, { 137, 18, 225 }, // und_Hebr_US -> yi_Hebr_US
- { 0, 104, 0 }, { 59, 104, 108 }, // und_Hira -> ja_Hira_JP
- { 0, 129, 0 }, { 344, 129, 217 }, // und_Hluw -> hlu_Hluw_TR
- { 0, 110, 0 }, { 333, 110, 117 }, // und_Hmng -> hnj_Hmng_LA
- { 0, 132, 0 }, { 50, 132, 98 }, // und_Hung -> hu_Hung_HU
- { 0, 79, 0 }, { 278, 79, 106 }, // und_Ital -> ett_Ital_IT
- { 0, 141, 0 }, { 66, 141, 114 }, // und_Jamo -> ko_Jamo_KR
- { 0, 60, 0 }, { 60, 60, 101 }, // und_Java -> jv_Java_ID
- { 0, 19, 0 }, { 59, 19, 108 }, // und_Jpan -> ja_Jpan_JP
- { 0, 63, 0 }, { 277, 63, 147 }, // und_Kali -> eky_Kali_MM
- { 0, 62, 0 }, { 59, 62, 108 }, // und_Kana -> ja_Kana_JP
- { 0, 64, 0 }, { 300, 64, 163 }, // und_Khar -> pra_Khar_PK
- { 0, 20, 0 }, { 23, 20, 36 }, // und_Khmr -> km_Khmr_KH
- { 0, 111, 0 }, { 105, 111, 100 }, // und_Khoj -> sd_Khoj_IN
- { 0, 21, 0 }, { 61, 21, 100 }, // und_Knda -> kn_Knda_IN
- { 0, 22, 0 }, { 66, 22, 114 }, // und_Kore -> ko_Kore_KR
- { 0, 61, 0 }, { 343, 61, 100 }, // und_Kthi -> bho_Kthi_IN
- { 0, 65, 0 }, { 292, 65, 211 }, // und_Lana -> nod_Lana_TH
- { 0, 23, 0 }, { 69, 23, 117 }, // und_Laoo -> lo_Laoo_LA
- { 0, 7, 1 }, { 126, 7, 1 }, // und_Latn_AF -> tk_Latn_AF
- { 0, 7, 11 }, { 67, 7, 11 }, // und_Latn_AM -> ku_Latn_AM
- { 0, 7, 44 }, { 139, 7, 44 }, // und_Latn_CN -> za_Latn_CN
- { 0, 7, 56 }, { 125, 7, 56 }, // und_Latn_CY -> tr_Latn_CY
- { 0, 7, 3 }, { 37, 7, 3 }, // und_Latn_DZ -> fr_Latn_DZ
- { 0, 7, 69 }, { 31, 7, 69 }, // und_Latn_ET -> en_Latn_ET
- { 0, 7, 81 }, { 67, 7, 81 }, // und_Latn_GE -> ku_Latn_GE
- { 0, 7, 102 }, { 126, 7, 102 }, // und_Latn_IR -> tk_Latn_IR
- { 0, 7, 48 }, { 37, 7, 48 }, // und_Latn_KM -> fr_Latn_KM
- { 0, 7, 145 }, { 37, 7, 145 }, // und_Latn_MA -> fr_Latn_MA
- { 0, 7, 127 }, { 6, 7, 127 }, // und_Latn_MK -> sq_Latn_MK
- { 0, 7, 126 }, { 91, 7, 126 }, // und_Latn_MO -> pt_Latn_MO
- { 0, 7, 136 }, { 37, 7, 136 }, // und_Latn_MR -> fr_Latn_MR
- { 0, 7, 207 }, { 37, 7, 207 }, // und_Latn_SY -> fr_Latn_SY
- { 0, 7, 216 }, { 37, 7, 216 }, // und_Latn_TN -> fr_Latn_TN
- { 0, 7, 208 }, { 174, 7, 208 }, // und_Latn_TW -> trv_Latn_TW
- { 0, 7, 222 }, { 90, 7, 222 }, // und_Latn_UA -> pl_Latn_UA
- { 0, 66, 0 }, { 283, 66, 100 }, // und_Lepc -> lep_Lepc_IN
- { 0, 67, 0 }, { 284, 67, 100 }, // und_Limb -> lif_Limb_IN
- { 0, 112, 0 }, { 332, 112, 85 }, // und_Lina -> lab_Lina_GR
- { 0, 68, 0 }, { 264, 68, 85 }, // und_Linb -> grc_Linb_GR
- { 0, 51, 0 }, { 285, 51, 44 }, // und_Lisu -> lis_Lisu_CN
- { 0, 69, 0 }, { 287, 69, 217 }, // und_Lyci -> xlc_Lyci_TR
- { 0, 70, 0 }, { 288, 70, 217 }, // und_Lydi -> xld_Lydi_TR
- { 0, 113, 0 }, { 49, 113, 100 }, // und_Mahj -> hi_Mahj_IN
- { 0, 71, 0 }, { 273, 71, 102 }, // und_Mand -> myz_Mand_IR
- { 0, 114, 0 }, { 329, 114, 44 }, // und_Mani -> xmn_Mani_CN
- { 0, 136, 0 }, { 121, 136, 44 }, // und_Marc -> bo_Marc_CN
- { 0, 115, 0 }, { 330, 115, 189 }, // und_Mend -> men_Mend_SL
- { 0, 74, 0 }, { 291, 74, 201 }, // und_Merc -> xmr_Merc_SD
- { 0, 73, 0 }, { 291, 73, 201 }, // und_Mero -> xmr_Mero_SD
- { 0, 24, 0 }, { 77, 24, 100 }, // und_Mlym -> ml_Mlym_IN
- { 0, 116, 0 }, { 80, 116, 100 }, // und_Modi -> mr_Modi_IN
- { 0, 8, 0 }, { 82, 8, 44 }, // und_Mong -> mn_Mong_CN
- { 0, 117, 0 }, { 347, 117, 18 }, // und_Mroo -> mro_Mroo_BD
- { 0, 72, 0 }, { 290, 72, 100 }, // und_Mtei -> mni_Mtei_IN
- { 0, 131, 0 }, { 352, 131, 163 }, // und_Mult -> skr_Mult_PK
- { 0, 25, 0 }, { 21, 25, 147 }, // und_Mymr -> my_Mymr_MM
- { 0, 118, 0 }, { 331, 118, 186 }, // und_Narb -> xna_Narb_SA
- { 0, 119, 0 }, { 265, 119, 109 }, // und_Nbat -> arc_Nbat_JO
- { 0, 137, 0 }, { 348, 137, 150 }, // und_Newa -> new_Newa_NP
- { 0, 75, 0 }, { 289, 75, 91 }, // und_Nkoo -> man_Nkoo_GN
- { 0, 77, 0 }, { 293, 77, 104 }, // und_Ogam -> sga_Ogam_IE
- { 0, 78, 0 }, { 304, 78, 100 }, // und_Olck -> sat_Olck_IN
- { 0, 82, 0 }, { 296, 82, 143 }, // und_Orkh -> otk_Orkh_MN
- { 0, 26, 0 }, { 87, 26, 100 }, // und_Orya -> or_Orya_IN
- { 0, 138, 0 }, { 358, 138, 225 }, // und_Osge -> osa_Osge_US
- { 0, 83, 0 }, { 110, 83, 194 }, // und_Osma -> so_Osma_SO
- { 0, 120, 0 }, { 265, 120, 207 }, // und_Palm -> arc_Palm_SY
- { 0, 121, 0 }, { 338, 121, 147 }, // und_Pauc -> ctd_Pauc_MM
- { 0, 122, 0 }, { 226, 122, 178 }, // und_Perm -> kv_Perm_RU
- { 0, 84, 0 }, { 345, 84, 44 }, // und_Phag -> lzh_Phag_CN
- { 0, 58, 0 }, { 297, 58, 102 }, // und_Phli -> pal_Phli_IR
- { 0, 123, 0 }, { 297, 123, 44 }, // und_Phlp -> pal_Phlp_CN
- { 0, 85, 0 }, { 299, 85, 119 }, // und_Phnx -> phn_Phnx_LB
- { 0, 86, 0 }, { 282, 86, 44 }, // und_Plrd -> hmd_Plrd_CN
- { 0, 59, 0 }, { 298, 59, 102 }, // und_Prti -> xpr_Prti_IR
- { 0, 87, 0 }, { 301, 87, 101 }, // und_Rjng -> rej_Rjng_ID
- { 0, 88, 0 }, { 294, 88, 205 }, // und_Runr -> non_Runr_SE
- { 0, 89, 0 }, { 303, 89, 105 }, // und_Samr -> smp_Samr_IL
- { 0, 81, 0 }, { 302, 81, 237 }, // und_Sarb -> xsa_Sarb_YE
- { 0, 90, 0 }, { 305, 90, 100 }, // und_Saur -> saz_Saur_IN
- { 0, 133, 0 }, { 341, 133, 225 }, // und_Sgnw -> ase_Sgnw_US
- { 0, 92, 0 }, { 31, 92, 224 }, // und_Shaw -> en_Shaw_GB
- { 0, 91, 0 }, { 99, 91, 100 }, // und_Shrd -> sa_Shrd_IN
- { 0, 124, 0 }, { 99, 124, 100 }, // und_Sidd -> sa_Sidd_IN
- { 0, 125, 0 }, { 105, 125, 100 }, // und_Sind -> sd_Sind_IN
- { 0, 32, 0 }, { 106, 32, 198 }, // und_Sinh -> si_Sinh_LK
- { 0, 93, 0 }, { 306, 93, 100 }, // und_Sora -> srb_Sora_IN
- { 0, 95, 0 }, { 112, 95, 101 }, // und_Sund -> su_Sund_ID
- { 0, 96, 0 }, { 307, 96, 18 }, // und_Sylo -> syl_Sylo_BD
- { 0, 33, 0 }, { 151, 33, 103 }, // und_Syrc -> syr_Syrc_IQ
- { 0, 98, 0 }, { 308, 98, 170 }, // und_Tagb -> tbw_Tagb_PH
- { 0, 101, 0 }, { 275, 101, 100 }, // und_Takr -> doi_Takr_IN
- { 0, 99, 0 }, { 310, 99, 44 }, // und_Tale -> tdd_Tale_CN
- { 0, 76, 0 }, { 286, 76, 44 }, // und_Talu -> khb_Talu_CN
- { 0, 27, 0 }, { 117, 27, 100 }, // und_Taml -> ta_Taml_IN
- { 0, 139, 0 }, { 359, 139, 44 }, // und_Tang -> txg_Tang_CN
- { 0, 100, 0 }, { 309, 100, 232 }, // und_Tavt -> blt_Tavt_VN
- { 0, 28, 0 }, { 119, 28, 100 }, // und_Telu -> te_Telu_IN
- { 0, 9, 0 }, { 314, 9, 145 }, // und_Tfng -> zgh_Tfng_MA
- { 0, 97, 0 }, { 166, 97, 170 }, // und_Tglg -> fil_Tglg_PH
- { 0, 29, 0 }, { 143, 29, 131 }, // und_Thaa -> dv_Thaa_MV
- { 0, 30, 0 }, { 120, 30, 211 }, // und_Thai -> th_Thai_TH
- { 0, 31, 0 }, { 121, 31, 44 }, // und_Tibt -> bo_Tibt_CN
- { 0, 126, 0 }, { 339, 126, 100 }, // und_Tirh -> mai_Tirh_IN
- { 0, 102, 0 }, { 311, 102, 207 }, // und_Ugar -> uga_Ugar_SY
- { 0, 35, 0 }, { 252, 35, 121 }, // und_Vaii -> vai_Vaii_LR
- { 0, 127, 0 }, { 334, 127, 100 }, // und_Wara -> hoc_Wara_IN
- { 0, 80, 0 }, { 295, 80, 102 }, // und_Xpeo -> peo_Xpeo_IR
- { 0, 94, 0 }, { 262, 94, 103 }, // und_Xsux -> akk_Xsux_IQ
- { 0, 34, 0 }, { 168, 34, 44 } // und_Yiii -> ii_Yiii_CN
-};
-
-static const quint16 locale_index[] = {
- 0, // AnyLanguage
- 0, // C
- 0, // Abkhazian
- 1, // Oromo
- 3, // Afar
- 4, // Afrikaans
- 6, // Albanian
- 9, // Amharic
- 10, // Arabic
- 38, // Armenian
- 39, // Assamese
- 0, // Aymara
- 40, // Azerbaijani
- 43, // Bashkir
- 44, // Basque
- 45, // Bengali
- 47, // Dzongkha
- 0, // Bihari
- 0, // Bislama
- 48, // Breton
- 49, // Bulgarian
- 50, // Burmese
- 51, // Belarusian
- 52, // Khmer
- 53, // Catalan
- 57, // Chinese
- 64, // Corsican
- 65, // Croatian
- 67, // Czech
- 68, // Danish
- 70, // Dutch
- 77, // English
- 183, // Esperanto
- 184, // Estonian
- 185, // Faroese
- 0, // Fijian
- 187, // Finnish
- 188, // French
- 234, // Western Frisian
- 235, // Gaelic
- 236, // Galician
- 237, // Georgian
- 238, // German
- 245, // Greek
- 247, // Greenlandic
- 248, // Guarani
- 249, // Gujarati
- 250, // Hausa
- 254, // Hebrew
- 255, // Hindi
- 256, // Hungarian
- 257, // Icelandic
- 258, // Indonesian
- 259, // Interlingua
- 0, // Interlingue
- 260, // Inuktitut
- 0, // Inupiak
- 262, // Irish
- 263, // Italian
- 267, // Japanese
- 268, // Javanese
- 269, // Kannada
- 270, // Kashmiri
- 271, // Kazakh
- 272, // Kinyarwanda
- 273, // Kirghiz
- 274, // Korean
- 276, // Kurdish
- 277, // Rundi
- 278, // Lao
- 0, // Latin
- 279, // Latvian
- 280, // Lingala
- 284, // Lithuanian
- 285, // Macedonian
- 286, // Malagasy
- 287, // Malay
- 291, // Malayalam
- 292, // Maltese
- 293, // Maori
- 294, // Marathi
- 0, // Marshallese
- 295, // Mongolian
- 0, // Nauru
- 297, // Nepali
- 299, // Norwegian Bokmal
- 301, // Occitan
- 302, // Oriya
- 303, // Pashto
- 305, // Persian
- 307, // Polish
- 308, // Portuguese
- 320, // Punjabi
- 322, // Quechua
- 325, // Romansh
- 326, // Romanian
- 328, // Russian
- 0, // Samoan
- 334, // Sango
- 335, // Sanskrit
- 336, // Serbian
- 344, // Ossetic
- 346, // Southern Sotho
- 347, // Tswana
- 348, // Shona
- 349, // Sindhi
- 350, // Sinhala
- 351, // Swati
- 352, // Slovak
- 353, // Slovenian
- 354, // Somali
- 358, // Spanish
- 0, // Sundanese
- 386, // Swahili
- 390, // Swedish
- 393, // Sardinian
- 394, // Tajik
- 395, // Tamil
- 399, // Tatar
- 400, // Telugu
- 401, // Thai
- 402, // Tibetan
- 404, // Tigrinya
- 406, // Tongan
- 407, // Tsonga
- 408, // Turkish
- 410, // Turkmen
- 0, // Tahitian
- 411, // Uighur
- 412, // Ukrainian
- 413, // Urdu
- 415, // Uzbek
- 418, // Vietnamese
- 419, // Volapuk
- 420, // Welsh
- 421, // Wolof
- 422, // Xhosa
- 423, // Yiddish
- 424, // Yoruba
- 0, // Zhuang
- 426, // Zulu
- 427, // Norwegian Nynorsk
- 428, // Bosnian
- 430, // Divehi
- 431, // Manx
- 432, // Cornish
- 433, // Akan
- 434, // Konkani
- 435, // Ga
- 436, // Igbo
- 437, // Kamba
- 438, // Syriac
- 439, // Blin
- 440, // Geez
- 0, // Koro
- 441, // Sidamo
- 442, // Atsam
- 443, // Tigre
- 444, // Jju
- 445, // Friulian
- 446, // Venda
- 447, // Ewe
- 449, // Walamo
- 450, // Hawaiian
- 451, // Tyap
- 452, // Nyanja
- 453, // Filipino
- 454, // Swiss German
- 457, // Sichuan Yi
- 458, // Kpelle
- 459, // Low German
- 461, // South Ndebele
- 462, // Northern Sotho
- 463, // Northern Sami
- 466, // Taroko
- 467, // Gusii
- 468, // Taita
- 469, // Fulah
- 482, // Kikuyu
- 483, // Samburu
- 484, // Sena
- 485, // North Ndebele
- 486, // Rombo
- 487, // Tachelhit
- 489, // Kabyle
- 490, // Nyankole
- 491, // Bena
- 492, // Vunjo
- 493, // Bambara
- 495, // Embu
- 496, // Cherokee
- 497, // Morisyen
- 498, // Makonde
- 499, // Langi
- 500, // Ganda
- 501, // Bemba
- 502, // Kabuverdianu
- 503, // Meru
- 504, // Kalenjin
- 505, // Nama
- 506, // Machame
- 507, // Colognian
- 508, // Masai
- 510, // Soga
- 511, // Luyia
- 512, // Asu
- 513, // Teso
- 515, // Saho
- 516, // Koyra Chiini
- 517, // Rwa
- 518, // Luo
- 519, // Chiga
- 520, // Central Morocco Tamazight
- 521, // Koyraboro Senni
- 522, // Shambala
- 523, // Bodo
- 0, // Avaric
- 0, // Chamorro
- 524, // Chechen
- 525, // Church
- 526, // Chuvash
- 0, // Cree
- 0, // Haitian
- 0, // Herero
- 0, // Hiri Motu
- 0, // Kanuri
- 0, // Komi
- 0, // Kongo
- 0, // Kwanyama
- 0, // Limburgish
- 527, // Luba Katanga
- 528, // Luxembourgish
- 0, // Navaho
- 0, // Ndonga
- 0, // Ojibwa
- 0, // Pali
- 529, // Walloon
- 530, // Aghem
- 531, // Basaa
- 532, // Zarma
- 533, // Duala
- 534, // Jola Fonyi
- 535, // Ewondo
- 536, // Bafia
- 537, // Makhuwa Meetto
- 538, // Mundang
- 539, // Kwasio
- 540, // Nuer
- 541, // Sakha
- 542, // Sangu
- 0, // Congo Swahili
- 543, // Tasawaq
- 544, // Vai
- 546, // Walser
- 547, // Yangben
- 0, // Avestan
- 548, // Asturian
- 549, // Ngomba
- 550, // Kako
- 551, // Meta
- 552, // Ngiemboon
- 0, // Aragonese
- 0, // Akkadian
- 0, // Ancient Egyptian
- 0, // Ancient Greek
- 0, // Aramaic
- 0, // Balinese
- 0, // Bamun
- 0, // Batak Toba
- 0, // Buginese
- 0, // Buhid
- 0, // Carian
- 0, // Chakma
- 0, // Classical Mandaic
- 0, // Coptic
- 0, // Dogri
- 0, // Eastern Cham
- 0, // Eastern Kayah
- 0, // Etruscan
- 0, // Gothic
- 0, // Hanunoo
- 0, // Ingush
- 0, // Large Flowery Miao
- 0, // Lepcha
- 0, // Limbu
- 0, // Lisu
- 0, // Lu
- 0, // Lycian
- 0, // Lydian
- 0, // Mandingo
- 553, // Manipuri
- 0, // Meroitic
- 0, // Northern Thai
- 0, // Old Irish
- 0, // Old Norse
- 0, // Old Persian
- 0, // Old Turkish
- 0, // Pahlavi
- 0, // Parthian
- 0, // Phoenician
- 0, // Prakrit Language
- 0, // Rejang
- 0, // Sabaean
- 0, // Samaritan
- 0, // Santali
- 0, // Saurashtra
- 0, // Sora
- 0, // Sylheti
- 0, // Tagbanwa
- 554, // Tai Dam
- 0, // Tai Nua
- 0, // Ugaritic
- 555, // Akoose
- 556, // Lakota
- 557, // Standard Moroccan Tamazight
- 558, // Mapuche
- 559, // Central Kurdish
- 561, // Lower Sorbian
- 562, // Upper Sorbian
- 563, // Kenyang
- 564, // Mohawk
- 565, // Nko
- 566, // Prussian
- 567, // Kiche
- 568, // Southern Sami
- 569, // Lule Sami
- 570, // Inari Sami
- 571, // Skolt Sami
- 572, // Warlpiri
- 0, // Manichaean Middle Persian
- 0, // Mende
- 0, // Ancient North Arabian
- 0, // Linear A
- 0, // Hmong Njua
- 0, // Ho
- 0, // Lezghian
- 0, // Bassa
- 0, // Mono
- 0, // Tedim Chin
- 0, // Maithili
- 0, // Ahom
- 0, // American Sign Language
- 0, // Ardhamagadhi Prakrit
- 0, // Bhojpuri
- 0, // Hieroglyphic Luwian
- 0, // Literary Chinese
- 573, // Mazanderani
- 0, // Mru
- 0, // Newari
- 574, // Northern Luri
- 0, // Palauan
- 0, // Papiamento
- 0, // Saraiki
- 0, // Tokelau
- 0, // Tok Pisin
- 0, // Tuvalu
- 0, // Uncoded Languages
- 576, // Cantonese
- 0, // Osage
- 0, // Tangut
- 578, // Ido
- 579, // Lojban
- 580, // Sicilian
- 581, // Southern Kurdish
- 582, // Western Balochi
- 0 // trailing 0
-};
-
-static const QLocaleData locale_data[] = {
- // lang script terr dec group list prcnt zero minus plus exp quotOpn quotEnd altQtOpn altQtEnd lpStart lpMid lpEnd lpTwo sDtFmt lDtFmt sTmFmt lTmFmt ssMonth slMonth snMonth sMonth lMonth nMonth ssDays slDays snDays sDays lDays nDays am pm byte siQuant iecQuant currISO currSym currDsply currFmt currFmtNeg endoLang endoCntry curDgt curRnd dow1st wknd+ wknd-
- { 1, 0, 0, 46, 44, 59, 37, 48, 45, 43, 101, 34, 34, 39, 39, 0,6 , 0,6 , 0,6 , 0,6 , 0,10 , 10,17 , 0,8 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 158,27 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 99,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 0,7 , 0,4 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // C/AnyScript/AnyCountry
- { 3, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 35,18 , 18,7 , 25,12 , 185,48 , 233,111 , 134,24 , 185,48 , 233,111 , 134,24 , 113,28 , 141,55 , 85,14 , 113,28 , 141,55 , 85,14 , 2,2 , 2,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,2 , 7,24 , 4,4 , 4,0 , 0,6 , 6,10 , 2, 1, 7, 6, 7 }, // Oromo/Latin/Ethiopia
- { 3, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 35,18 , 37,5 , 8,10 , 185,48 , 233,111 , 344,24 , 185,48 , 233,111 , 134,24 , 113,28 , 141,55 , 196,14 , 113,28 , 141,55 , 196,14 , 2,2 , 2,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 0,7 , 4,4 , 4,0 , 0,6 , 16,8 , 2, 1, 7, 6, 7 }, // Oromo/Latin/Kenya
- { 4, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Afar/Latin/Ethiopia
- { 5, 7, 195, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 6,8 , 6,8 , 53,10 , 80,17 , 37,5 , 8,10 , 416,59 , 475,92 , 134,24 , 416,59 , 475,92 , 134,24 , 210,28 , 238,58 , 296,14 , 210,28 , 238,58 , 296,14 , 4,3 , 4,3 , 49,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 31,67 , 4,4 , 4,0 , 24,9 , 33,11 , 2, 1, 7, 6, 7 }, // Afrikaans/Latin/South Africa
- { 5, 7, 148, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 6,8 , 6,8 , 53,10 , 97,16 , 18,7 , 25,12 , 416,59 , 475,92 , 134,24 , 416,59 , 475,92 , 134,24 , 210,28 , 238,58 , 296,14 , 210,28 , 238,58 , 296,14 , 4,3 , 4,3 , 49,5 , 5,17 , 22,23 , {78,65,68}, 6,1 , 98,55 , 4,4 , 4,0 , 24,9 , 44,7 , 2, 1, 1, 6, 7 }, // Afrikaans/Latin/Namibia
- { 6, 7, 2, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 14,9 , 14,9 , 113,6 , 10,17 , 18,7 , 42,13 , 567,50 , 617,78 , 695,27 , 567,50 , 617,78 , 695,27 , 310,28 , 338,58 , 396,15 , 411,28 , 338,58 , 396,15 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {65,76,76}, 7,4 , 153,45 , 13,5 , 4,0 , 51,5 , 56,8 , 0, 0, 1, 6, 7 }, // Albanian/Latin/Albania
- { 6, 7, 127, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 14,9 , 14,9 , 113,6 , 10,17 , 37,5 , 8,10 , 567,50 , 617,78 , 695,27 , 567,50 , 617,78 , 695,27 , 310,28 , 338,58 , 396,15 , 411,28 , 338,58 , 396,15 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {77,75,68}, 11,3 , 198,54 , 13,5 , 4,0 , 51,5 , 64,18 , 2, 1, 1, 6, 7 }, // Albanian/Latin/Macedonia
- { 6, 7, 257, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 14,9 , 14,9 , 113,6 , 10,17 , 37,5 , 8,10 , 567,50 , 617,78 , 695,27 , 567,50 , 617,78 , 695,27 , 310,28 , 338,58 , 396,15 , 411,28 , 338,58 , 396,15 , 7,11 , 7,10 , 54,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 252,21 , 13,5 , 4,0 , 51,5 , 82,6 , 2, 1, 1, 6, 7 }, // Albanian/Latin/Kosovo
- { 7, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 23,6 , 23,6 , 29,9 , 38,8 , 119,10 , 63,17 , 18,7 , 25,12 , 722,46 , 768,61 , 829,24 , 722,46 , 768,61 , 829,24 , 439,27 , 466,28 , 494,14 , 439,27 , 466,28 , 494,14 , 18,3 , 17,4 , 58,3 , 61,23 , 22,23 , {69,84,66}, 15,2 , 273,34 , 4,4 , 4,0 , 88,4 , 92,5 , 2, 1, 7, 6, 7 }, // Amharic/Ethiopic/Ethiopia
- { 8, 1, 64, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {69,71,80}, 17,5 , 307,81 , 13,5 , 4,0 , 97,7 , 104,3 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Egypt
- { 8, 1, 3, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 952,71 , 952,71 , 1023,24 , 952,71 , 952,71 , 1023,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {68,90,68}, 22,5 , 388,102 , 13,5 , 4,0 , 97,7 , 107,7 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Algeria
- { 8, 1, 17, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {66,72,68}, 27,5 , 490,91 , 13,5 , 4,0 , 97,7 , 114,7 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Bahrain
- { 8, 1, 42, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {88,65,70}, 32,4 , 581,112 , 13,5 , 4,0 , 97,7 , 121,4 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Chad
- { 8, 1, 48, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 37,5 , 8,10 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {75,77,70}, 36,2 , 693,105 , 13,5 , 4,0 , 97,7 , 125,9 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Comoros
- { 8, 1, 59, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {68,74,70}, 38,3 , 798,84 , 13,5 , 4,0 , 97,7 , 134,6 , 0, 0, 6, 6, 7 }, // Arabic/Arabic/Djibouti
- { 8, 1, 67, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {69,82,78}, 41,3 , 882,91 , 13,5 , 4,0 , 97,7 , 140,7 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Eritrea
- { 8, 1, 103, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 1047,92 , 1047,92 , 1139,24 , 1163,92 , 1047,92 , 1139,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {73,81,68}, 44,5 , 973,84 , 13,5 , 4,0 , 97,7 , 147,6 , 0, 0, 6, 5, 6 }, // Arabic/Arabic/Iraq
- { 8, 1, 105, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 55,4 , 59,9 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {73,76,83}, 49,1 , 1057,133 , 13,5 , 4,0 , 97,7 , 153,7 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/Israel
- { 8, 1, 109, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 1047,92 , 1047,92 , 1139,24 , 1047,92 , 1047,92 , 1139,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {74,79,68}, 50,5 , 1190,84 , 13,5 , 4,0 , 97,7 , 160,6 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Jordan
- { 8, 1, 115, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {75,87,68}, 55,5 , 1274,84 , 13,5 , 4,0 , 97,7 , 166,6 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Kuwait
- { 8, 1, 119, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 1047,92 , 1047,92 , 1139,24 , 1047,92 , 1047,92 , 1139,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {76,66,80}, 60,5 , 1358,84 , 13,5 , 4,0 , 97,7 , 172,5 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Lebanon
- { 8, 1, 122, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {76,89,68}, 65,5 , 1442,88 , 13,5 , 4,0 , 97,7 , 177,5 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Libya
- { 8, 1, 136, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 1255,72 , 1255,72 , 1327,24 , 1255,72 , 1255,72 , 1327,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {77,82,85}, 70,4 , 1530,112 , 13,5 , 4,0 , 97,7 , 182,9 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Mauritania
- { 8, 1, 145, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 37,5 , 8,10 , 1351,70 , 1351,70 , 1421,24 , 1351,70 , 1351,70 , 1421,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {77,65,68}, 74,5 , 1642,87 , 13,5 , 4,0 , 97,7 , 191,6 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Morocco
- { 8, 1, 162, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {79,77,82}, 79,5 , 1729,77 , 13,5 , 4,0 , 97,7 , 197,5 , 3, 0, 6, 5, 6 }, // Arabic/Arabic/Oman
- { 8, 1, 165, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 1047,92 , 1047,92 , 1139,24 , 1047,92 , 1047,92 , 1139,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {73,76,83}, 49,1 , 1057,133 , 13,5 , 4,0 , 97,7 , 202,18 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Palestinian Territories
- { 8, 1, 175, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {81,65,82}, 84,5 , 1806,70 , 13,5 , 4,0 , 97,7 , 220,3 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Qatar
- { 8, 1, 186, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,65,82}, 89,5 , 1876,77 , 13,5 , 4,0 , 97,7 , 223,24 , 2, 1, 7, 5, 6 }, // Arabic/Arabic/Saudi Arabia
- { 8, 1, 194, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,79,83}, 94,1 , 1953,77 , 13,5 , 4,0 , 97,7 , 247,7 , 0, 0, 1, 6, 7 }, // Arabic/Arabic/Somalia
- { 8, 1, 201, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,68,71}, 95,4 , 2030,91 , 13,5 , 4,0 , 97,7 , 254,7 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/Sudan
- { 8, 1, 207, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 1047,92 , 1047,92 , 1139,24 , 1047,92 , 1047,92 , 1139,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,89,80}, 99,5 , 2121,77 , 13,5 , 4,0 , 97,7 , 261,5 , 0, 0, 6, 5, 6 }, // Arabic/Arabic/Syria
- { 8, 1, 216, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 952,71 , 952,71 , 1023,24 , 952,71 , 952,71 , 1023,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {84,78,68}, 104,5 , 2198,95 , 13,5 , 4,0 , 97,7 , 266,4 , 3, 0, 1, 6, 7 }, // Arabic/Arabic/Tunisia
- { 8, 1, 223, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {65,69,68}, 109,5 , 2293,91 , 13,5 , 4,0 , 97,7 , 270,24 , 2, 1, 6, 5, 6 }, // Arabic/Arabic/United Arab Emirates
- { 8, 1, 236, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {77,65,68}, 74,5 , 1642,87 , 13,5 , 4,0 , 97,7 , 294,15 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/Western Sahara
- { 8, 1, 237, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {89,69,82}, 114,5 , 2384,70 , 13,5 , 4,0 , 97,7 , 309,5 , 0, 0, 7, 5, 6 }, // Arabic/Arabic/Yemen
- { 8, 1, 254, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {83,83,80}, 119,1 , 2454,132 , 13,5 , 4,0 , 97,7 , 314,12 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/South Sudan
- { 8, 1, 260, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 52,7 , 59,6 , 129,10 , 139,17 , 18,7 , 25,12 , 853,75 , 853,75 , 928,24 , 853,75 , 853,75 , 928,24 , 508,52 , 508,52 , 560,14 , 508,52 , 508,52 , 560,14 , 21,1 , 21,1 , 84,4 , 88,47 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 13,5 , 4,0 , 326,23 , 349,6 , 2, 1, 1, 6, 7 }, // Arabic/Arabic/World
- { 9, 10, 11, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 65,7 , 65,7 , 156,8 , 164,20 , 37,5 , 8,10 , 1445,48 , 1493,94 , 1587,24 , 1445,48 , 1611,106 , 1587,24 , 574,28 , 602,62 , 664,14 , 574,28 , 602,62 , 664,14 , 0,2 , 0,2 , 135,6 , 141,17 , 22,23 , {65,77,68}, 120,1 , 2586,46 , 13,5 , 4,0 , 355,7 , 362,8 , 2, 0, 1, 6, 7 }, // Armenian/Armenian/Armenia
- { 10, 11, 100, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 72,9 , 72,9 , 184,8 , 192,18 , 68,7 , 75,12 , 1717,64 , 1781,89 , 1870,24 , 1717,64 , 1781,89 , 1870,24 , 678,32 , 710,58 , 768,14 , 678,32 , 710,58 , 768,14 , 22,9 , 22,7 , 158,4 , 162,37 , 22,23 , {73,78,82}, 121,1 , 2632,43 , 8,5 , 4,0 , 370,7 , 377,4 , 2, 1, 7, 7, 7 }, // Assamese/Bengali/India
- { 12, 7, 15, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 81,8 , 81,8 , 156,8 , 210,17 , 37,5 , 8,10 , 1894,48 , 1942,77 , 158,27 , 1894,48 , 2019,77 , 158,27 , 782,27 , 809,67 , 99,14 , 782,27 , 809,67 , 99,14 , 0,2 , 0,2 , 199,4 , 5,17 , 22,23 , {65,90,78}, 122,1 , 2675,58 , 13,5 , 4,0 , 381,10 , 391,10 , 2, 1, 1, 6, 7 }, // Azerbaijani/Latin/Azerbaijan
- { 12, 1, 102, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 5 }, // Azerbaijani/Arabic/Iran
- { 12, 2, 15, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 156,8 , 210,17 , 37,5 , 8,10 , 2096,48 , 2144,77 , 158,27 , 2096,48 , 2221,77 , 158,27 , 876,27 , 903,67 , 99,14 , 876,27 , 903,67 , 99,14 , 31,2 , 29,2 , 45,4 , 5,17 , 22,23 , {65,90,78}, 122,1 , 2733,12 , 13,5 , 4,0 , 401,10 , 411,10 , 2, 1, 1, 6, 7 }, // Azerbaijani/Cyrillic/Azerbaijan
- { 13, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Bashkir/Cyrillic/Russia
- { 14, 7, 197, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8220, 8221, 0,6 , 0,6 , 89,9 , 89,9 , 227,6 , 233,36 , 37,5 , 87,12 , 2298,60 , 2358,93 , 2451,24 , 2298,60 , 2358,93 , 2451,24 , 970,28 , 998,68 , 1066,14 , 970,28 , 998,68 , 1066,14 , 0,2 , 0,2 , 203,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 2745,20 , 13,5 , 4,0 , 421,7 , 428,8 , 2, 1, 1, 6, 7 }, // Basque/Latin/Spain
- { 15, 11, 18, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 98,9 , 98,9 , 269,6 , 192,18 , 18,7 , 25,12 , 2475,90 , 2475,90 , 2565,33 , 2598,77 , 2475,90 , 2565,33 , 1080,37 , 1117,58 , 1175,18 , 1080,37 , 1117,58 , 1175,18 , 0,2 , 0,2 , 158,4 , 5,17 , 22,23 , {66,68,84}, 124,1 , 2765,49 , 0,4 , 4,0 , 436,5 , 441,8 , 2, 1, 7, 6, 7 }, // Bengali/Bengali/Bangladesh
- { 15, 11, 100, 46, 44, 59, 37, 2534, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 98,9 , 98,9 , 269,6 , 192,18 , 18,7 , 25,12 , 2475,90 , 2475,90 , 2565,33 , 2598,77 , 2475,90 , 2565,33 , 1080,37 , 1117,58 , 1175,18 , 1080,37 , 1117,58 , 1175,18 , 0,2 , 0,2 , 158,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 2814,43 , 0,4 , 4,0 , 436,5 , 449,4 , 2, 1, 7, 7, 7 }, // Bengali/Bengali/India
- { 16, 31, 25, 46, 44, 59, 37, 3872, 45, 43, 101, 8220, 8221, 8216, 8217, 107,9 , 107,9 , 107,9 , 107,9 , 53,10 , 275,30 , 99,22 , 121,27 , 2675,63 , 2738,191 , 2929,27 , 2956,27 , 2983,132 , 3115,27 , 1193,34 , 1227,79 , 1306,27 , 1193,34 , 1227,79 , 1306,27 , 33,5 , 31,6 , 45,4 , 5,17 , 22,23 , {66,84,78}, 125,3 , 2857,15 , 4,4 , 4,0 , 453,6 , 459,5 , 2, 1, 7, 6, 7 }, // Dzongkha/Tibetan/Bhutan
- { 19, 7, 74, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 171, 187, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 97,16 , 37,5 , 8,10 , 3142,63 , 3205,78 , 3283,36 , 3142,63 , 3205,78 , 3283,36 , 1333,33 , 1366,43 , 1409,18 , 1333,33 , 1366,43 , 1409,18 , 38,4 , 37,4 , 210,7 , 217,17 , 22,23 , {69,85,82}, 14,1 , 2872,36 , 13,5 , 4,0 , 464,9 , 473,5 , 2, 1, 1, 6, 7 }, // Breton/Latin/France
- { 20, 2, 33, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 305,12 , 317,22 , 148,9 , 157,14 , 3319,49 , 3368,82 , 3450,24 , 3319,49 , 3368,82 , 3450,24 , 1427,21 , 1448,55 , 1503,14 , 1427,21 , 1448,55 , 1503,14 , 42,6 , 41,6 , 234,7 , 5,17 , 22,23 , {66,71,78}, 128,3 , 2908,47 , 13,5 , 4,0 , 478,9 , 487,8 , 2, 1, 1, 6, 7 }, // Bulgarian/Cyrillic/Bulgaria
- { 21, 25, 147, 46, 44, 4170, 37, 4160, 45, 43, 101, 8220, 8221, 8216, 8217, 123,5 , 123,5 , 128,10 , 128,10 , 339,8 , 347,18 , 171,6 , 177,10 , 3474,43 , 3517,88 , 3605,24 , 3474,43 , 3517,88 , 3605,24 , 1517,54 , 1517,54 , 1571,14 , 1517,54 , 1517,54 , 1571,14 , 48,5 , 47,3 , 241,5 , 5,17 , 22,23 , {77,77,75}, 131,1 , 2955,29 , 13,5 , 4,0 , 495,6 , 495,6 , 0, 0, 7, 6, 7 }, // Burmese/Myanmar/Myanmar
- { 22, 2, 20, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 138,7 , 138,7 , 365,7 , 317,22 , 37,5 , 187,11 , 3629,48 , 3677,95 , 3772,24 , 3796,48 , 3844,98 , 3772,24 , 1585,21 , 1606,56 , 1662,14 , 1585,21 , 1606,56 , 1662,14 , 0,2 , 0,2 , 246,5 , 251,17 , 22,23 , {66,89,78}, 0,2 , 2984,89 , 13,5 , 4,0 , 501,10 , 511,8 , 2, 0, 1, 6, 7 }, // Belarusian/Cyrillic/Belarus
- { 23, 20, 36, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 145,9 , 154,9 , 269,6 , 97,16 , 18,7 , 25,12 , 3942,71 , 3942,71 , 4013,24 , 3942,71 , 3942,71 , 4013,24 , 1676,40 , 1716,46 , 1762,14 , 1676,40 , 1776,47 , 1762,14 , 0,2 , 0,2 , 268,2 , 5,17 , 22,23 , {75,72,82}, 132,1 , 3073,29 , 0,4 , 4,0 , 519,5 , 524,7 , 2, 1, 7, 6, 7 }, // Khmer/Khmer/Cambodia
- { 24, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 163,7 , 163,7 , 269,6 , 372,22 , 55,4 , 59,9 , 4037,60 , 4097,82 , 4179,36 , 4215,93 , 4308,115 , 4179,36 , 1823,28 , 1851,60 , 1911,21 , 1823,28 , 1851,60 , 1911,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 531,6 , 537,7 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Spain
- { 24, 7, 5, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 163,7 , 163,7 , 269,6 , 372,22 , 55,4 , 59,9 , 4037,60 , 4097,82 , 4179,36 , 4215,93 , 4308,115 , 4179,36 , 1823,28 , 1851,60 , 1911,21 , 1823,28 , 1851,60 , 1911,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 531,6 , 544,7 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Andorra
- { 24, 7, 74, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 163,7 , 163,7 , 269,6 , 372,22 , 55,4 , 59,9 , 4037,60 , 4097,82 , 4179,36 , 4215,93 , 4308,115 , 4179,36 , 1823,28 , 1851,60 , 1911,21 , 1823,28 , 1851,60 , 1911,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 531,6 , 551,6 , 2, 1, 1, 6, 7 }, // Catalan/Latin/France
- { 24, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 163,7 , 163,7 , 269,6 , 372,22 , 55,4 , 59,9 , 4037,60 , 4097,82 , 4179,36 , 4215,93 , 4308,115 , 4179,36 , 1823,28 , 1851,60 , 1911,21 , 1823,28 , 1851,60 , 1911,21 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 531,6 , 557,6 , 2, 1, 1, 6, 7 }, // Catalan/Latin/Italy
- { 25, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 170,5 , 170,5 , 175,5 , 175,5 , 394,8 , 402,13 , 198,6 , 204,11 , 4423,39 , 4462,38 , 158,27 , 4423,39 , 4462,38 , 158,27 , 1932,21 , 1953,28 , 1981,14 , 1932,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 270,2 , 272,21 , 22,23 , {67,78,89}, 133,1 , 3122,13 , 4,4 , 4,0 , 563,4 , 567,2 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/China
- { 25, 5, 97, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 170,5 , 170,5 , 175,5 , 175,5 , 269,6 , 402,13 , 198,6 , 204,11 , 4423,39 , 4462,38 , 158,27 , 4423,39 , 4462,38 , 158,27 , 1932,21 , 1953,28 , 1981,14 , 1932,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 270,2 , 272,21 , 22,23 , {72,75,68}, 6,1 , 3135,11 , 4,4 , 4,0 , 563,4 , 569,9 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/Hong Kong
- { 25, 5, 126, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 170,5 , 170,5 , 175,5 , 175,5 , 269,6 , 402,13 , 198,6 , 204,11 , 4423,39 , 4462,38 , 158,27 , 4423,39 , 4462,38 , 158,27 , 1932,21 , 1953,28 , 1981,14 , 1932,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 270,2 , 272,21 , 22,23 , {77,79,80}, 134,4 , 3146,13 , 4,4 , 4,0 , 563,4 , 578,9 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/Macau
- { 25, 5, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 170,5 , 170,5 , 175,5 , 175,5 , 27,8 , 402,13 , 198,6 , 204,11 , 4423,39 , 4462,38 , 158,27 , 4423,39 , 4462,38 , 158,27 , 1932,21 , 1953,28 , 1981,14 , 1932,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 270,2 , 272,21 , 22,23 , {83,71,68}, 6,1 , 3159,15 , 4,4 , 4,0 , 563,4 , 587,3 , 2, 1, 7, 6, 7 }, // Chinese/Simplified Han/Singapore
- { 25, 6, 97, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 170,5 , 170,5 , 180,5 , 180,5 , 415,8 , 402,13 , 198,6 , 215,13 , 4423,39 , 4423,39 , 158,27 , 4423,39 , 4423,39 , 158,27 , 1995,21 , 1953,28 , 1981,14 , 1995,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 293,3 , 5,17 , 22,23 , {72,75,68}, 6,1 , 3135,11 , 18,5 , 4,0 , 590,4 , 594,9 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/Hong Kong
- { 25, 6, 126, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 170,5 , 170,5 , 180,5 , 180,5 , 415,8 , 402,13 , 198,6 , 215,13 , 4423,39 , 4423,39 , 158,27 , 4423,39 , 4423,39 , 158,27 , 1995,21 , 1953,28 , 1981,14 , 1995,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 293,3 , 5,17 , 22,23 , {77,79,80}, 134,4 , 3174,13 , 18,5 , 4,0 , 590,4 , 603,9 , 2, 1, 7, 6, 7 }, // Chinese/Traditional Han/Macau
- { 25, 6, 208, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 170,5 , 170,5 , 175,5 , 175,5 , 394,8 , 423,14 , 198,6 , 215,13 , 4423,39 , 4423,39 , 158,27 , 4423,39 , 4423,39 , 158,27 , 1995,21 , 1953,28 , 1981,14 , 1995,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {84,87,68}, 6,1 , 3187,13 , 13,5 , 4,0 , 590,4 , 612,2 , 2, 0, 7, 6, 7 }, // Chinese/Traditional Han/Taiwan
- { 26, 7, 74, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Corsican/Latin/France
- { 27, 7, 54, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 163,7 , 163,7 , 437,13 , 450,19 , 37,5 , 87,12 , 4500,49 , 4549,94 , 4643,39 , 4500,49 , 4682,98 , 4643,39 , 2016,28 , 2044,58 , 2102,14 , 2016,28 , 2044,58 , 2116,14 , 0,2 , 0,2 , 296,7 , 5,17 , 22,23 , {72,82,75}, 138,2 , 3200,60 , 13,5 , 4,0 , 614,8 , 622,8 , 2, 1, 1, 6, 7 }, // Croatian/Latin/Croatia
- { 27, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 163,7 , 163,7 , 469,9 , 450,19 , 37,5 , 87,12 , 4500,49 , 4549,94 , 4643,39 , 4500,49 , 4682,98 , 4643,39 , 2016,28 , 2044,58 , 2116,14 , 2016,28 , 2044,58 , 2116,14 , 0,2 , 0,2 , 296,7 , 5,17 , 22,23 , {66,65,77}, 140,2 , 3260,85 , 13,5 , 4,0 , 614,8 , 630,19 , 2, 1, 1, 6, 7 }, // Croatian/Latin/Bosnia And Herzegowina
- { 28, 7, 57, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 185,7 , 185,7 , 156,8 , 478,17 , 55,4 , 59,9 , 4780,48 , 4828,82 , 158,27 , 4780,48 , 4910,84 , 158,27 , 2130,21 , 2151,49 , 2200,14 , 2130,21 , 2151,49 , 2200,14 , 60,4 , 57,4 , 303,5 , 5,17 , 22,23 , {67,90,75}, 142,2 , 3345,68 , 13,5 , 4,0 , 649,7 , 656,5 , 2, 0, 1, 6, 7 }, // Czech/Latin/Czech Republic
- { 29, 7, 58, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 495,10 , 505,23 , 228,5 , 233,10 , 4994,59 , 5053,84 , 134,24 , 4994,59 , 5053,84 , 134,24 , 2214,28 , 2242,51 , 2293,14 , 2307,35 , 2242,51 , 2293,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {68,75,75}, 144,3 , 3413,42 , 13,5 , 4,0 , 661,5 , 666,7 , 2, 0, 1, 6, 7 }, // Danish/Latin/Denmark
- { 29, 7, 86, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 495,10 , 505,23 , 228,5 , 233,10 , 4994,59 , 5053,84 , 134,24 , 4994,59 , 5053,84 , 134,24 , 2214,28 , 2242,51 , 2293,14 , 2307,35 , 2242,51 , 2293,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {68,75,75}, 144,3 , 3413,42 , 13,5 , 4,0 , 661,5 , 673,8 , 2, 0, 1, 6, 7 }, // Danish/Latin/Greenland
- { 30, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3455,19 , 8,5 , 23,6 , 681,10 , 691,9 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Netherlands
- { 30, 7, 12, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,87,71}, 147,4 , 3474,55 , 8,5 , 23,6 , 681,10 , 700,5 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Aruba
- { 30, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 538,9 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3455,19 , 8,5 , 23,6 , 681,10 , 705,6 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Belgium
- { 30, 7, 152, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,78,71}, 151,4 , 3529,97 , 8,5 , 23,6 , 681,10 , 711,7 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Cura Sao
- { 30, 7, 202, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {83,82,68}, 6,1 , 3626,58 , 8,5 , 23,6 , 681,10 , 718,8 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Suriname
- { 30, 7, 255, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3684,61 , 8,5 , 23,6 , 681,10 , 726,19 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Bonaire
- { 30, 7, 256, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 6,8 , 6,8 , 528,10 , 97,16 , 37,5 , 8,10 , 5137,59 , 5196,88 , 134,24 , 5137,59 , 5196,88 , 134,24 , 2342,21 , 2363,59 , 2422,14 , 2342,21 , 2363,59 , 2422,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {65,78,71}, 151,4 , 3529,97 , 8,5 , 23,6 , 681,10 , 745,12 , 2, 1, 1, 6, 7 }, // Dutch/Latin/Sint Maarten
- { 31, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 757,16 , 773,13 , 2, 1, 7, 6, 7 }, // English/Latin/United States
- { 31, 3, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 155,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // English/Deseret/United States
- { 31, 7, 4, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 793,14 , 2, 1, 7, 6, 7 }, // English/Latin/American Samoa
- { 31, 7, 7, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 807,8 , 2, 1, 1, 6, 7 }, // English/Latin/Anguilla
- { 31, 7, 9, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 815,17 , 2, 1, 7, 6, 7 }, // English/Latin/Antigua And Barbuda
- { 31, 7, 13, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 210,9 , 210,9 , 269,6 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 2436,25 , 0,28 , 28,57 , 2436,25 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 832,18 , 850,9 , 2, 1, 7, 6, 7 }, // English/Latin/Australia
- { 31, 7, 14, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 8,5 , 4,0 , 786,7 , 859,7 , 2, 1, 1, 6, 7 }, // English/Latin/Austria
- { 31, 7, 16, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,83,68}, 6,1 , 3930,53 , 4,4 , 4,0 , 786,7 , 866,7 , 2, 1, 7, 6, 7 }, // English/Latin/Bahamas
- { 31, 7, 19, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,66,68}, 6,1 , 3983,56 , 4,4 , 4,0 , 786,7 , 873,8 , 2, 1, 1, 6, 7 }, // English/Latin/Barbados
- { 31, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 27,8 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 786,7 , 881,7 , 2, 1, 1, 6, 7 }, // English/Latin/Belgium
- { 31, 7, 22, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 27,8 , 553,18 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,90,68}, 6,1 , 4039,47 , 4,4 , 4,0 , 786,7 , 888,6 , 2, 1, 7, 6, 7 }, // English/Latin/Belize
- { 31, 7, 24, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,77,68}, 6,1 , 4086,53 , 4,4 , 4,0 , 786,7 , 894,7 , 2, 1, 1, 6, 7 }, // English/Latin/Bermuda
- { 31, 7, 28, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 27,8 , 553,18 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {66,87,80}, 158,1 , 4139,50 , 4,4 , 4,0 , 786,7 , 901,8 , 2, 1, 7, 6, 7 }, // English/Latin/Botswana
- { 31, 7, 31, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 909,30 , 2, 1, 1, 6, 7 }, // English/Latin/British Indian Ocean Territory
- { 31, 7, 35, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {66,73,70}, 159,3 , 4189,53 , 4,4 , 4,0 , 786,7 , 939,7 , 0, 0, 1, 6, 7 }, // English/Latin/Burundi
- { 31, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 4242,83 , 4,4 , 4,0 , 786,7 , 946,8 , 0, 0, 1, 6, 7 }, // English/Latin/Cameroon
- { 31, 7, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 53,10 , 35,18 , 18,7 , 25,12 , 5284,59 , 48,86 , 134,24 , 5284,59 , 48,86 , 134,24 , 2461,35 , 28,57 , 85,14 , 2461,35 , 28,57 , 85,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {67,65,68}, 6,1 , 4325,53 , 4,4 , 4,0 , 954,16 , 970,6 , 2, 0, 7, 6, 7 }, // English/Latin/Canada
- { 31, 7, 40, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {75,89,68}, 6,1 , 4378,71 , 4,4 , 4,0 , 786,7 , 976,14 , 2, 1, 1, 6, 7 }, // English/Latin/Cayman Islands
- { 31, 7, 45, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 786,7 , 990,16 , 2, 1, 1, 6, 7 }, // English/Latin/Christmas Island
- { 31, 7, 46, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 786,7 , 1006,23 , 2, 1, 1, 6, 7 }, // English/Latin/Cocos Islands
- { 31, 7, 51, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 786,7 , 1029,12 , 2, 1, 1, 6, 7 }, // English/Latin/Cook Islands
- { 31, 7, 56, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 4,4 , 4,0 , 786,7 , 1041,6 , 2, 1, 1, 6, 7 }, // English/Latin/Cyprus
- { 31, 7, 58, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 228,5 , 233,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {68,75,75}, 144,3 , 4511,44 , 13,5 , 4,0 , 786,7 , 1047,7 , 2, 0, 1, 6, 7 }, // English/Latin/Denmark
- { 31, 7, 60, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 1054,8 , 2, 1, 7, 6, 7 }, // English/Latin/Dominica
- { 31, 7, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,82,78}, 41,3 , 4555,50 , 4,4 , 4,0 , 786,7 , 1062,7 , 2, 1, 1, 6, 7 }, // English/Latin/Eritrea
- { 31, 7, 70, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {70,75,80}, 119,1 , 4605,74 , 4,4 , 4,0 , 786,7 , 1069,16 , 2, 1, 1, 6, 7 }, // English/Latin/Falkland Islands
- { 31, 7, 72, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {70,74,68}, 6,1 , 4679,47 , 4,4 , 4,0 , 786,7 , 1085,4 , 2, 1, 1, 6, 7 }, // English/Latin/Fiji
- { 31, 7, 73, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 243,4 , 247,9 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 786,7 , 1089,7 , 2, 1, 1, 6, 7 }, // English/Latin/Finland
- { 31, 7, 75, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 4726,32 , 4,4 , 4,0 , 786,7 , 1096,8 , 2, 1, 1, 6, 7 }, // English/Latin/Guernsey
- { 31, 7, 80, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,77,68}, 162,1 , 4758,50 , 4,4 , 4,0 , 786,7 , 1104,6 , 2, 1, 1, 6, 7 }, // English/Latin/Gambia
- { 31, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 786,7 , 1110,7 , 2, 1, 1, 6, 7 }, // English/Latin/Germany
- { 31, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,72,83}, 163,3 , 4808,47 , 4,4 , 4,0 , 786,7 , 1117,5 , 2, 1, 1, 6, 7 }, // English/Latin/Ghana
- { 31, 7, 84, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,73,80}, 119,1 , 4855,53 , 4,4 , 4,0 , 786,7 , 1122,9 , 2, 1, 1, 6, 7 }, // English/Latin/Gibraltar
- { 31, 7, 87, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 1131,7 , 2, 1, 1, 6, 7 }, // English/Latin/Grenada
- { 31, 7, 89, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 1138,4 , 2, 1, 7, 6, 7 }, // English/Latin/Guam
- { 31, 7, 93, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,89,68}, 6,1 , 4908,56 , 4,4 , 4,0 , 786,7 , 1142,6 , 2, 0, 1, 6, 7 }, // English/Latin/Guyana
- { 31, 7, 97, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 415,8 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {72,75,68}, 166,3 , 4964,56 , 4,4 , 4,0 , 786,7 , 1148,19 , 2, 1, 7, 6, 7 }, // English/Latin/Hong Kong
- { 31, 7, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 27,8 , 192,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {73,78,82}, 121,1 , 5020,44 , 8,5 , 4,0 , 786,7 , 1167,5 , 2, 1, 7, 7, 7 }, // English/Latin/India
- { 31, 7, 104, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 97,16 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 4,4 , 4,0 , 786,7 , 1172,7 , 2, 1, 1, 6, 7 }, // English/Latin/Ireland
- { 31, 7, 105, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 55,4 , 59,9 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {73,76,83}, 49,1 , 5064,62 , 4,4 , 4,0 , 786,7 , 1179,6 , 2, 1, 7, 5, 6 }, // English/Latin/Israel
- { 31, 7, 107, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 269,6 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {74,77,68}, 6,1 , 5126,53 , 4,4 , 4,0 , 786,7 , 1185,7 , 2, 1, 7, 6, 7 }, // English/Latin/Jamaica
- { 31, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {75,69,83}, 2,3 , 5179,53 , 4,4 , 4,0 , 786,7 , 1192,5 , 2, 1, 7, 6, 7 }, // English/Latin/Kenya
- { 31, 7, 112, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 786,7 , 1197,8 , 2, 1, 1, 6, 7 }, // English/Latin/Kiribati
- { 31, 7, 120, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 5232,61 , 4,4 , 4,0 , 786,7 , 1205,7 , 2, 1, 1, 6, 7 }, // English/Latin/Lesotho
- { 31, 7, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {76,82,68}, 6,1 , 5293,53 , 4,4 , 4,0 , 786,7 , 1212,7 , 2, 1, 1, 6, 7 }, // English/Latin/Liberia
- { 31, 7, 126, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,79,80}, 134,4 , 5346,53 , 4,4 , 4,0 , 786,7 , 1219,15 , 2, 1, 7, 6, 7 }, // English/Latin/Macau
- { 31, 7, 128, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,71,65}, 169,2 , 5399,54 , 4,4 , 4,0 , 786,7 , 1234,10 , 0, 0, 1, 6, 7 }, // English/Latin/Madagascar
- { 31, 7, 129, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,87,75}, 171,2 , 5453,53 , 4,4 , 4,0 , 786,7 , 1244,6 , 2, 1, 1, 6, 7 }, // English/Latin/Malawi
- { 31, 7, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,89,82}, 173,2 , 5506,59 , 4,4 , 4,0 , 786,7 , 1250,8 , 2, 1, 1, 6, 7 }, // English/Latin/Malaysia
- { 31, 7, 133, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 4,4 , 4,0 , 786,7 , 1258,5 , 2, 1, 7, 6, 7 }, // English/Latin/Malta
- { 31, 7, 134, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 1263,16 , 2, 1, 7, 6, 7 }, // English/Latin/Marshall Islands
- { 31, 7, 137, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {77,85,82}, 175,2 , 5565,53 , 4,4 , 4,0 , 786,7 , 1279,9 , 2, 0, 1, 6, 7 }, // English/Latin/Mauritius
- { 31, 7, 140, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 1288,10 , 2, 1, 1, 6, 7 }, // English/Latin/Micronesia
- { 31, 7, 144, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 1298,10 , 2, 1, 1, 6, 7 }, // English/Latin/Montserrat
- { 31, 7, 148, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,65,68}, 6,1 , 5618,53 , 4,4 , 4,0 , 786,7 , 1308,7 , 2, 1, 1, 6, 7 }, // English/Latin/Namibia
- { 31, 7, 149, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 786,7 , 1315,5 , 2, 1, 1, 6, 7 }, // English/Latin/Nauru
- { 31, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 8,5 , 23,6 , 786,7 , 1320,11 , 2, 1, 1, 6, 7 }, // English/Latin/Netherlands
- { 31, 7, 154, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 571,7 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 786,7 , 1331,11 , 2, 1, 1, 6, 7 }, // English/Latin/New Zealand
- { 31, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,71,78}, 177,1 , 5671,50 , 4,4 , 4,0 , 786,7 , 1342,7 , 2, 1, 1, 6, 7 }, // English/Latin/Nigeria
- { 31, 7, 158, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 786,7 , 1349,4 , 2, 1, 1, 6, 7 }, // English/Latin/Niue
- { 31, 7, 159, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 786,7 , 1353,14 , 2, 1, 1, 6, 7 }, // English/Latin/Norfolk Island
- { 31, 7, 160, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 1367,24 , 2, 1, 1, 6, 7 }, // English/Latin/Northern Mariana Islands
- { 31, 7, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {80,75,82}, 175,2 , 5721,53 , 4,4 , 4,0 , 786,7 , 1391,8 , 2, 0, 7, 6, 7 }, // English/Latin/Pakistan
- { 31, 7, 164, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 1399,5 , 2, 1, 1, 6, 7 }, // English/Latin/Palau
- { 31, 7, 167, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {80,71,75}, 131,1 , 5774,73 , 4,4 , 4,0 , 786,7 , 1404,16 , 2, 1, 1, 6, 7 }, // English/Latin/Papua New Guinea
- { 31, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {80,72,80}, 178,1 , 5847,53 , 4,4 , 4,0 , 786,7 , 1420,11 , 2, 1, 7, 6, 7 }, // English/Latin/Philippines
- { 31, 7, 171, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 786,7 , 1431,16 , 2, 1, 1, 6, 7 }, // English/Latin/Pitcairn
- { 31, 7, 174, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 1447,11 , 2, 1, 7, 6, 7 }, // English/Latin/Puerto Rico
- { 31, 7, 179, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {82,87,70}, 179,2 , 5900,47 , 4,4 , 4,0 , 786,7 , 1458,6 , 0, 0, 1, 6, 7 }, // English/Latin/Rwanda
- { 31, 7, 180, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 1464,17 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Kitts And Nevis
- { 31, 7, 181, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 1481,9 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Lucia
- { 31, 7, 182, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {88,67,68}, 6,1 , 3780,71 , 4,4 , 4,0 , 786,7 , 1490,24 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Vincent And The Grenadines
- { 31, 7, 183, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {87,83,84}, 181,3 , 5947,40 , 4,4 , 4,0 , 786,7 , 1514,5 , 2, 1, 7, 6, 7 }, // English/Latin/Samoa
- { 31, 7, 188, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,67,82}, 184,2 , 5987,59 , 4,4 , 4,0 , 786,7 , 1519,10 , 2, 1, 1, 6, 7 }, // English/Latin/Seychelles
- { 31, 7, 189, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,76,76}, 186,2 , 6046,68 , 4,4 , 4,0 , 786,7 , 1529,12 , 0, 0, 1, 6, 7 }, // English/Latin/Sierra Leone
- { 31, 7, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 269,6 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,71,68}, 6,1 , 6114,56 , 4,4 , 4,0 , 786,7 , 1541,9 , 2, 1, 7, 6, 7 }, // English/Latin/Singapore
- { 31, 7, 192, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 29,7 , 786,7 , 1550,8 , 2, 1, 1, 6, 7 }, // English/Latin/Slovenia
- { 31, 7, 193, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,66,68}, 6,1 , 6170,74 , 4,4 , 4,0 , 786,7 , 1558,15 , 2, 1, 1, 6, 7 }, // English/Latin/Solomon Islands
- { 31, 7, 195, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 578,10 , 553,18 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 5232,61 , 4,4 , 4,0 , 786,7 , 1573,12 , 2, 1, 7, 6, 7 }, // English/Latin/South Africa
- { 31, 7, 199, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,72,80}, 119,1 , 6244,56 , 4,4 , 4,0 , 786,7 , 1585,10 , 2, 1, 1, 6, 7 }, // English/Latin/Saint Helena
- { 31, 7, 201, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,68,71}, 0,0 , 6300,50 , 4,4 , 4,0 , 786,7 , 1595,5 , 2, 1, 6, 5, 6 }, // English/Latin/Sudan
- { 31, 7, 204, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,90,76}, 188,1 , 6350,53 , 4,4 , 4,0 , 786,7 , 1600,8 , 2, 1, 1, 6, 7 }, // English/Latin/Swaziland
- { 31, 7, 205, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 53,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,69,75}, 189,2 , 6403,47 , 13,5 , 4,0 , 786,7 , 1608,6 , 2, 0, 1, 6, 7 }, // English/Latin/Sweden
- { 31, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {67,72,70}, 0,0 , 6450,41 , 8,5 , 36,5 , 786,7 , 1614,11 , 2, 0, 1, 6, 7 }, // English/Latin/Switzerland
- { 31, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {84,90,83}, 191,3 , 6491,62 , 4,4 , 4,0 , 786,7 , 1625,8 , 2, 0, 1, 6, 7 }, // English/Latin/Tanzania
- { 31, 7, 213, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {78,90,68}, 6,1 , 4449,62 , 4,4 , 4,0 , 786,7 , 1633,7 , 2, 1, 1, 6, 7 }, // English/Latin/Tokelau
- { 31, 7, 214, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {84,79,80}, 194,2 , 6553,49 , 4,4 , 4,0 , 786,7 , 1640,5 , 2, 1, 1, 6, 7 }, // English/Latin/Tonga
- { 31, 7, 215, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {84,84,68}, 6,1 , 6602,80 , 4,4 , 4,0 , 786,7 , 1645,17 , 2, 1, 7, 6, 7 }, // English/Latin/Trinidad And Tobago
- { 31, 7, 219, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 1662,22 , 2, 1, 1, 6, 7 }, // English/Latin/Turks And Caicos Islands
- { 31, 7, 220, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,85,68}, 6,1 , 3851,59 , 4,4 , 4,0 , 786,7 , 1684,6 , 2, 1, 1, 6, 7 }, // English/Latin/Tuvalu
- { 31, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,71,88}, 196,3 , 6682,56 , 4,4 , 4,0 , 786,7 , 1690,6 , 0, 0, 1, 6, 7 }, // English/Latin/Uganda
- { 31, 7, 223, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {65,69,68}, 199,3 , 6738,55 , 4,4 , 4,0 , 786,7 , 1696,20 , 2, 1, 6, 5, 6 }, // English/Latin/United Arab Emirates
- { 31, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 210,9 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 6793,47 , 4,4 , 4,0 , 1716,15 , 1731,14 , 2, 1, 1, 6, 7 }, // English/Latin/United Kingdom
- { 31, 7, 226, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 1745,21 , 2, 1, 7, 6, 7 }, // English/Latin/United States Minor Outlying Islands
- { 31, 7, 229, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {86,85,86}, 202,2 , 6840,44 , 4,4 , 4,0 , 786,7 , 1766,7 , 0, 0, 1, 6, 7 }, // English/Latin/Vanuatu
- { 31, 7, 233, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 1773,22 , 2, 1, 1, 6, 7 }, // English/Latin/British Virgin Islands
- { 31, 7, 234, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 547,6 , 35,18 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 3745,35 , 4,4 , 4,0 , 786,7 , 1795,19 , 2, 1, 7, 6, 7 }, // English/Latin/United States Virgin Islands
- { 31, 7, 239, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {90,77,87}, 131,1 , 6884,50 , 4,4 , 4,0 , 786,7 , 1814,6 , 2, 1, 1, 6, 7 }, // English/Latin/Zambia
- { 31, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 415,8 , 553,18 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 1820,8 , 2, 1, 7, 6, 7 }, // English/Latin/Zimbabwe
- { 31, 7, 249, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 3745,35 , 4,4 , 4,0 , 786,7 , 1828,12 , 2, 1, 1, 6, 7 }, // English/Latin/Diego Garcia
- { 31, 7, 251, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 4726,32 , 4,4 , 4,0 , 786,7 , 1840,11 , 2, 1, 1, 6, 7 }, // English/Latin/Isle Of Man
- { 31, 7, 252, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {71,66,80}, 119,1 , 4726,32 , 4,4 , 4,0 , 786,7 , 1851,6 , 2, 1, 1, 6, 7 }, // English/Latin/Jersey
- { 31, 7, 254, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {83,83,80}, 119,1 , 6934,68 , 4,4 , 4,0 , 786,7 , 1857,11 , 2, 1, 1, 6, 7 }, // English/Latin/South Sudan
- { 31, 7, 256, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {65,78,71}, 151,4 , 7002,95 , 4,4 , 4,0 , 786,7 , 1868,12 , 2, 1, 1, 6, 7 }, // English/Latin/Sint Maarten
- { 31, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 4,4 , 4,0 , 786,7 , 1880,5 , 2, 1, 1, 6, 7 }, // English/Latin/World
- { 31, 7, 261, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 200,10 , 210,9 , 119,10 , 10,17 , 37,5 , 8,10 , 0,48 , 48,86 , 134,24 , 0,48 , 48,86 , 134,24 , 0,28 , 28,57 , 85,14 , 0,28 , 28,57 , 85,14 , 68,2 , 65,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 13,5 , 4,0 , 786,7 , 1885,6 , 2, 1, 1, 6, 7 }, // English/Latin/Europe
- { 32, 7, 260, 44, 160, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 219,9 , 219,9 , 588,8 , 596,26 , 37,5 , 256,25 , 5343,48 , 5391,91 , 134,24 , 5343,48 , 5391,91 , 134,24 , 2496,21 , 2517,51 , 2568,14 , 2496,21 , 2517,51 , 2568,14 , 70,3 , 67,3 , 308,6 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 41,6 , 4,0 , 1891,9 , 1900,5 , 2, 1, 1, 6, 7 }, // Esperanto/Latin/World
- { 33, 7, 68, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 228,8 , 228,8 , 156,8 , 622,18 , 37,5 , 8,10 , 5482,59 , 5541,91 , 5632,24 , 5482,59 , 5541,91 , 5632,24 , 2582,14 , 2596,63 , 2582,14 , 2582,14 , 2596,63 , 2582,14 , 0,2 , 0,2 , 314,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 7097,20 , 13,5 , 4,0 , 1905,5 , 1910,5 , 2, 1, 1, 6, 7 }, // Estonian/Latin/Estonia
- { 34, 7, 71, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 156,8 , 622,18 , 37,5 , 8,10 , 5656,48 , 5704,83 , 134,24 , 5787,59 , 5704,83 , 134,24 , 2659,28 , 2687,74 , 2761,14 , 2775,35 , 2687,74 , 2761,14 , 0,2 , 0,2 , 320,3 , 5,17 , 22,23 , {68,75,75}, 189,2 , 7117,43 , 13,5 , 4,0 , 1915,8 , 1923,7 , 2, 0, 1, 6, 7 }, // Faroese/Latin/Faroe Islands
- { 34, 7, 58, 44, 46, 59, 37, 48, 8722, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 156,8 , 622,18 , 37,5 , 8,10 , 5656,48 , 5704,83 , 134,24 , 5787,59 , 5704,83 , 134,24 , 2659,28 , 2687,74 , 2761,14 , 2775,35 , 2687,74 , 2761,14 , 0,2 , 0,2 , 320,3 , 5,17 , 22,23 , {68,75,75}, 144,3 , 7117,43 , 13,5 , 4,0 , 1915,8 , 666,7 , 2, 0, 1, 6, 7 }, // Faroese/Latin/Denmark
- { 36, 7, 73, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 228,8 , 228,8 , 640,8 , 478,17 , 243,4 , 247,9 , 5846,69 , 5915,105 , 6020,24 , 6044,93 , 6137,129 , 6020,24 , 2810,21 , 2831,67 , 2898,14 , 2810,21 , 2912,81 , 2898,14 , 73,3 , 70,3 , 323,5 , 328,17 , 345,23 , {69,85,82}, 14,1 , 7160,20 , 13,5 , 4,0 , 1930,5 , 1935,5 , 2, 1, 1, 6, 7 }, // Finnish/Latin/Finland
- { 37, 7, 74, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 1948,6 , 2, 1, 1, 6, 7 }, // French/Latin/France
- { 37, 7, 3, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {68,90,68}, 204,2 , 7180,51 , 13,5 , 4,0 , 1940,8 , 1954,7 , 2, 1, 6, 5, 6 }, // French/Latin/Algeria
- { 37, 7, 21, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 571,7 , 97,16 , 37,5 , 281,23 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 1961,8 , 2, 1, 1, 6, 7 }, // French/Latin/Belgium
- { 37, 7, 23, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 1969,5 , 0, 0, 1, 6, 7 }, // French/Latin/Benin
- { 37, 7, 34, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 1974,12 , 0, 0, 1, 6, 7 }, // French/Latin/Burkina Faso
- { 37, 7, 35, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {66,73,70}, 159,3 , 7290,53 , 13,5 , 4,0 , 1940,8 , 939,7 , 0, 0, 1, 6, 7 }, // French/Latin/Burundi
- { 37, 7, 37, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 76,5 , 73,4 , 368,6 , 374,17 , 391,23 , {88,65,70}, 32,4 , 7343,56 , 13,5 , 4,0 , 1940,8 , 1986,8 , 0, 0, 1, 6, 7 }, // French/Latin/Cameroon
- { 37, 7, 38, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8221, 8220, 0,6 , 0,6 , 236,8 , 236,8 , 588,8 , 97,16 , 304,9 , 313,24 , 6414,64 , 6329,85 , 134,24 , 6414,64 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 64,4 , 61,4 , 368,6 , 374,17 , 391,23 , {67,65,68}, 6,1 , 7399,54 , 47,6 , 4,0 , 1994,17 , 970,6 , 2, 0, 7, 6, 7 }, // French/Latin/Canada
- { 37, 7, 41, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,65,70}, 32,4 , 7343,56 , 13,5 , 4,0 , 1940,8 , 2011,25 , 0, 0, 1, 6, 7 }, // French/Latin/Central African Republic
- { 37, 7, 42, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,65,70}, 32,4 , 7343,56 , 13,5 , 4,0 , 1940,8 , 2036,5 , 0, 0, 1, 6, 7 }, // French/Latin/Chad
- { 37, 7, 48, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {75,77,70}, 36,2 , 7453,51 , 13,5 , 4,0 , 1940,8 , 2041,7 , 0, 0, 1, 6, 7 }, // French/Latin/Comoros
- { 37, 7, 49, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {67,68,70}, 209,2 , 7504,53 , 13,5 , 4,0 , 1940,8 , 2048,14 , 2, 1, 1, 6, 7 }, // French/Latin/Congo Kinshasa
- { 37, 7, 50, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,65,70}, 32,4 , 7343,56 , 13,5 , 4,0 , 1940,8 , 2062,17 , 0, 0, 1, 6, 7 }, // French/Latin/Congo Brazzaville
- { 37, 7, 53, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 2079,13 , 0, 0, 1, 6, 7 }, // French/Latin/Ivory Coast
- { 37, 7, 59, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {68,74,70}, 38,3 , 7557,57 , 13,5 , 4,0 , 1940,8 , 2092,8 , 0, 0, 6, 6, 7 }, // French/Latin/Djibouti
- { 37, 7, 66, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,65,70}, 32,4 , 7343,56 , 13,5 , 4,0 , 1940,8 , 2100,18 , 0, 0, 1, 6, 7 }, // French/Latin/Equatorial Guinea
- { 37, 7, 76, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2118,16 , 2, 1, 1, 6, 7 }, // French/Latin/French Guiana
- { 37, 7, 77, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,80,70}, 211,4 , 7614,35 , 13,5 , 4,0 , 1940,8 , 2134,19 , 0, 0, 1, 6, 7 }, // French/Latin/French Polynesia
- { 37, 7, 79, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,65,70}, 32,4 , 7343,56 , 13,5 , 4,0 , 1940,8 , 2153,5 , 0, 0, 1, 6, 7 }, // French/Latin/Gabon
- { 37, 7, 88, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2158,10 , 2, 1, 1, 6, 7 }, // French/Latin/Guadeloupe
- { 37, 7, 91, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {71,78,70}, 215,2 , 7649,48 , 13,5 , 4,0 , 1940,8 , 2168,6 , 0, 0, 1, 6, 7 }, // French/Latin/Guinea
- { 37, 7, 94, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {72,84,71}, 217,1 , 7697,57 , 13,5 , 4,0 , 1940,8 , 2174,5 , 2, 1, 1, 6, 7 }, // French/Latin/Haiti
- { 37, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2179,10 , 2, 1, 1, 6, 7 }, // French/Latin/Luxembourg
- { 37, 7, 128, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {77,71,65}, 169,2 , 7754,54 , 13,5 , 4,0 , 1940,8 , 1234,10 , 0, 0, 1, 6, 7 }, // French/Latin/Madagascar
- { 37, 7, 132, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 2189,4 , 0, 0, 1, 6, 7 }, // French/Latin/Mali
- { 37, 7, 135, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2193,10 , 2, 1, 1, 6, 7 }, // French/Latin/Martinique
- { 37, 7, 136, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {77,82,85}, 218,2 , 7808,66 , 13,5 , 4,0 , 1940,8 , 2203,10 , 2, 1, 1, 6, 7 }, // French/Latin/Mauritania
- { 37, 7, 137, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {77,85,82}, 175,2 , 7874,63 , 13,5 , 4,0 , 1940,8 , 2213,7 , 2, 0, 1, 6, 7 }, // French/Latin/Mauritius
- { 37, 7, 138, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2220,7 , 2, 1, 1, 6, 7 }, // French/Latin/Mayotte
- { 37, 7, 142, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2227,6 , 2, 1, 1, 6, 7 }, // French/Latin/Monaco
- { 37, 7, 145, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6478,61 , 6329,85 , 134,24 , 6478,61 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 64,4 , 61,4 , 368,6 , 374,17 , 391,23 , {77,65,68}, 0,0 , 7937,54 , 13,5 , 4,0 , 1940,8 , 2233,5 , 2, 1, 1, 6, 7 }, // French/Latin/Morocco
- { 37, 7, 153, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,80,70}, 211,4 , 7614,35 , 13,5 , 4,0 , 1940,8 , 2238,18 , 0, 0, 1, 6, 7 }, // French/Latin/New Caledonia
- { 37, 7, 156, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 2256,5 , 0, 0, 1, 6, 7 }, // French/Latin/Niger
- { 37, 7, 176, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2261,10 , 2, 1, 1, 6, 7 }, // French/Latin/Reunion
- { 37, 7, 179, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {82,87,70}, 179,2 , 7991,50 , 13,5 , 4,0 , 1940,8 , 1458,6 , 0, 0, 1, 6, 7 }, // French/Latin/Rwanda
- { 37, 7, 187, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 2271,7 , 0, 0, 1, 6, 7 }, // French/Latin/Senegal
- { 37, 7, 188, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {83,67,82}, 184,2 , 8041,71 , 13,5 , 4,0 , 1940,8 , 1519,10 , 2, 1, 1, 6, 7 }, // French/Latin/Seychelles
- { 37, 7, 200, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2278,24 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Pierre And Miquelon
- { 37, 7, 206, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 236,8 , 236,8 , 156,8 , 10,17 , 37,5 , 337,14 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {67,72,70}, 0,0 , 8112,45 , 13,5 , 4,0 , 2302,15 , 2317,6 , 2, 0, 1, 6, 7 }, // French/Latin/Switzerland
- { 37, 7, 207, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {83,89,80}, 220,2 , 8157,51 , 13,5 , 4,0 , 1940,8 , 2323,5 , 0, 0, 6, 5, 6 }, // French/Latin/Syria
- { 37, 7, 212, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,79,70}, 206,3 , 7231,59 , 13,5 , 4,0 , 1940,8 , 2328,4 , 0, 0, 1, 6, 7 }, // French/Latin/Togo
- { 37, 7, 216, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {84,78,68}, 222,2 , 8208,51 , 13,5 , 4,0 , 1940,8 , 2332,7 , 3, 0, 1, 6, 7 }, // French/Latin/Tunisia
- { 37, 7, 229, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 18,7 , 25,12 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {86,85,86}, 202,2 , 8259,51 , 13,5 , 4,0 , 1940,8 , 1766,7 , 0, 0, 1, 6, 7 }, // French/Latin/Vanuatu
- { 37, 7, 235, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {88,80,70}, 211,4 , 7614,35 , 13,5 , 4,0 , 1940,8 , 2339,16 , 0, 0, 1, 6, 7 }, // French/Latin/Wallis And Futuna Islands
- { 37, 7, 244, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2355,16 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Barthelemy
- { 37, 7, 245, 44, 8239, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 236,8 , 236,8 , 119,10 , 97,16 , 37,5 , 8,10 , 6266,63 , 6329,85 , 134,24 , 6266,63 , 6329,85 , 134,24 , 2993,35 , 3028,52 , 3080,14 , 2993,35 , 3028,52 , 3080,14 , 0,2 , 0,2 , 368,6 , 374,17 , 391,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 1940,8 , 2371,12 , 2, 1, 1, 6, 7 }, // French/Latin/Saint Martin
- { 38, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 6,8 , 6,8 , 339,8 , 97,16 , 37,5 , 8,10 , 6539,48 , 6587,95 , 134,24 , 6539,48 , 6587,95 , 134,24 , 3094,21 , 3115,54 , 85,14 , 3094,21 , 3115,54 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3455,19 , 8,5 , 53,6 , 2383,5 , 2388,8 , 2, 1, 1, 6, 7 }, // Western Frisian/Latin/Netherlands
- { 39, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 244,10 , 244,10 , 119,10 , 648,21 , 37,5 , 8,10 , 6682,61 , 6743,142 , 6885,24 , 6682,61 , 6909,167 , 6885,24 , 3169,28 , 3197,69 , 3266,14 , 3169,28 , 3197,69 , 3266,14 , 81,1 , 77,1 , 414,6 , 5,17 , 22,23 , {71,66,80}, 119,1 , 8310,86 , 4,4 , 4,0 , 2396,8 , 2404,22 , 2, 1, 1, 6, 7 }, // Gaelic/Latin/United Kingdom
- { 40, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 7076,60 , 7136,87 , 7223,24 , 7247,60 , 7307,87 , 7394,36 , 3280,35 , 3315,49 , 3364,14 , 3378,35 , 3413,49 , 3462,21 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3910,20 , 13,5 , 4,0 , 2426,6 , 2432,6 , 2, 1, 1, 6, 7 }, // Galician/Latin/Spain
- { 41, 15, 81, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 171, 187, 0,6 , 0,6 , 261,8 , 261,8 , 156,8 , 696,19 , 37,5 , 8,10 , 7430,48 , 7478,99 , 7577,24 , 7430,48 , 7478,99 , 7577,24 , 3483,28 , 3511,62 , 3573,14 , 3483,28 , 3511,62 , 3573,14 , 0,2 , 0,2 , 420,5 , 425,37 , 22,23 , {71,69,76}, 224,1 , 8396,43 , 13,5 , 4,0 , 2438,7 , 2445,10 , 2, 1, 1, 6, 7 }, // Georgian/Georgian/Georgia
- { 42, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 7649,83 , 134,24 , 7732,60 , 7649,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 13,5 , 4,0 , 2455,7 , 2462,11 , 2, 1, 1, 6, 7 }, // German/Latin/Germany
- { 42, 7, 14, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7792,48 , 7840,83 , 134,24 , 7923,59 , 7840,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 8,5 , 4,0 , 2473,24 , 2497,10 , 2, 1, 1, 6, 7 }, // German/Latin/Austria
- { 42, 7, 21, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 7649,83 , 134,24 , 7732,60 , 7649,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 13,5 , 4,0 , 2455,7 , 2507,7 , 2, 1, 1, 6, 7 }, // German/Latin/Belgium
- { 42, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7792,48 , 7840,83 , 134,24 , 7923,59 , 7840,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 13,5 , 4,0 , 2455,7 , 2514,7 , 2, 1, 1, 6, 7 }, // German/Latin/Italy
- { 42, 7, 123, 46, 8217, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 7649,83 , 134,24 , 7732,60 , 7649,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {67,72,70}, 0,0 , 8458,58 , 8,5 , 4,0 , 2455,7 , 2521,13 , 2, 0, 1, 6, 7 }, // German/Latin/Liechtenstein
- { 42, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 7649,83 , 134,24 , 7732,60 , 7649,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 13,5 , 4,0 , 2455,7 , 2534,9 , 2, 1, 1, 6, 7 }, // German/Latin/Luxembourg
- { 42, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 7649,83 , 134,24 , 7732,60 , 7649,83 , 134,24 , 3587,21 , 3608,60 , 3668,14 , 3682,28 , 3608,60 , 3668,14 , 0,2 , 0,2 , 462,5 , 5,17 , 22,23 , {67,72,70}, 225,3 , 8458,58 , 8,5 , 36,5 , 2543,21 , 2564,7 , 2, 0, 1, 6, 7 }, // German/Latin/Switzerland
- { 43, 16, 85, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 278,9 , 278,9 , 269,6 , 10,17 , 18,7 , 25,12 , 7982,50 , 8032,115 , 8147,24 , 8171,50 , 8221,115 , 8147,24 , 3710,28 , 3738,55 , 3793,14 , 3710,28 , 3738,55 , 3793,14 , 82,4 , 78,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8516,19 , 13,5 , 4,0 , 2571,8 , 2579,6 , 2, 1, 1, 6, 7 }, // Greek/Greek/Greece
- { 43, 16, 56, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 278,9 , 278,9 , 269,6 , 10,17 , 18,7 , 25,12 , 7982,50 , 8032,115 , 8147,24 , 8171,50 , 8221,115 , 8147,24 , 3710,28 , 3738,55 , 3793,14 , 3710,28 , 3738,55 , 3793,14 , 82,4 , 78,4 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8516,19 , 13,5 , 4,0 , 2571,8 , 2585,6 , 2, 1, 1, 6, 7 }, // Greek/Greek/Cyprus
- { 44, 7, 86, 44, 46, 59, 37, 48, 8722, 43, 101, 187, 171, 8250, 8249, 0,6 , 0,6 , 287,11 , 287,11 , 53,10 , 80,17 , 228,5 , 233,10 , 8336,48 , 8384,96 , 134,24 , 8336,48 , 8384,96 , 134,24 , 3807,28 , 3835,98 , 3933,14 , 3807,28 , 3835,98 , 3933,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {68,75,75}, 144,3 , 8535,62 , 4,4 , 59,5 , 2591,11 , 2602,16 , 2, 0, 1, 6, 7 }, // Greenlandic/Latin/Greenland
- { 45, 7, 168, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,89,71}, 228,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 7, 6, 7 }, // Guarani/Latin/Paraguay
- { 46, 17, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 298,9 , 298,9 , 269,6 , 192,18 , 351,8 , 359,13 , 8480,67 , 8547,87 , 8634,31 , 8480,67 , 8547,87 , 8634,31 , 3947,32 , 3979,53 , 4032,19 , 3947,32 , 3979,53 , 4032,19 , 0,2 , 0,2 , 467,4 , 471,19 , 22,23 , {73,78,82}, 121,1 , 8597,46 , 4,4 , 4,0 , 2618,7 , 2625,4 , 2, 1, 7, 7, 7 }, // Gujarati/Gujarati/India
- { 47, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 307,8 , 307,8 , 269,6 , 715,17 , 37,5 , 8,10 , 8665,48 , 8713,85 , 8798,24 , 8665,48 , 8713,85 , 8798,24 , 4051,28 , 4079,52 , 4131,14 , 4051,28 , 4079,52 , 4131,14 , 86,6 , 82,5 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 8643,12 , 8,5 , 4,0 , 2629,5 , 2634,8 , 2, 1, 1, 6, 7 }, // Hausa/Latin/Nigeria
- { 47, 1, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Hausa/Arabic/Nigeria
- { 47, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 307,8 , 307,8 , 269,6 , 715,17 , 18,7 , 25,12 , 8665,48 , 8713,85 , 8798,24 , 8665,48 , 8713,85 , 8798,24 , 4051,28 , 4079,52 , 4131,14 , 4051,28 , 4079,52 , 4131,14 , 86,6 , 82,5 , 45,4 , 5,17 , 22,23 , {71,72,83}, 163,3 , 0,7 , 8,5 , 4,0 , 2629,5 , 2642,4 , 2, 1, 1, 6, 7 }, // Hausa/Latin/Ghana
- { 47, 7, 156, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 307,8 , 307,8 , 269,6 , 715,17 , 37,5 , 8,10 , 8665,48 , 8713,85 , 8798,24 , 8665,48 , 8713,85 , 8798,24 , 4051,28 , 4079,52 , 4131,14 , 4051,28 , 4079,52 , 4131,14 , 86,6 , 82,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 8655,36 , 8,5 , 4,0 , 2629,5 , 2646,5 , 0, 0, 1, 6, 7 }, // Hausa/Latin/Niger
- { 48, 18, 105, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 315,6 , 315,6 , 640,8 , 732,18 , 55,4 , 59,9 , 8822,58 , 8880,72 , 158,27 , 8822,58 , 8880,72 , 158,27 , 4145,46 , 4191,65 , 4256,21 , 4145,46 , 4191,65 , 4256,21 , 92,6 , 87,5 , 490,4 , 5,17 , 22,23 , {73,76,83}, 49,1 , 8691,54 , 64,6 , 70,8 , 2651,5 , 2656,5 , 2, 1, 7, 5, 6 }, // Hebrew/Hebrew/Israel
- { 49, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 321,9 , 330,8 , 269,6 , 10,17 , 18,7 , 25,12 , 8952,59 , 9011,73 , 9084,30 , 8952,59 , 9011,73 , 9084,30 , 4277,32 , 4309,53 , 4362,19 , 4277,32 , 4309,53 , 4362,19 , 68,2 , 65,2 , 494,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 8745,42 , 4,4 , 4,0 , 2661,6 , 2667,4 , 2, 1, 7, 7, 7 }, // Hindi/Devanagari/India
- { 50, 7, 98, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 187, 171, 0,6 , 0,6 , 338,8 , 338,8 , 750,13 , 763,19 , 55,4 , 59,9 , 9114,64 , 9178,98 , 9276,25 , 9114,64 , 9178,98 , 9276,25 , 4381,19 , 4400,52 , 4452,17 , 4381,19 , 4400,52 , 4452,17 , 98,3 , 92,3 , 498,4 , 5,17 , 22,23 , {72,85,70}, 229,2 , 8787,46 , 13,5 , 4,0 , 2671,6 , 2677,12 , 2, 0, 1, 6, 7 }, // Hungarian/Latin/Hungary
- { 51, 7, 99, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 192,8 , 192,8 , 640,8 , 622,18 , 37,5 , 8,10 , 9301,59 , 9360,82 , 9442,24 , 9301,59 , 9360,82 , 9442,24 , 4469,35 , 4504,81 , 4585,14 , 4469,35 , 4504,81 , 4585,14 , 101,4 , 95,4 , 502,4 , 5,17 , 22,23 , {73,83,75}, 189,2 , 8833,49 , 13,5 , 4,0 , 2689,8 , 2697,6 , 0, 0, 1, 6, 7 }, // Icelandic/Latin/Iceland
- { 52, 7, 101, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 346,10 , 356,9 , 27,8 , 553,18 , 228,5 , 233,10 , 9466,48 , 9514,87 , 134,24 , 9466,48 , 9514,87 , 134,24 , 4599,28 , 4627,43 , 4670,14 , 4599,28 , 4627,43 , 4670,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,68,82}, 231,2 , 8882,39 , 4,4 , 4,0 , 2703,9 , 2703,9 , 2, 0, 7, 6, 7 }, // Indonesian/Latin/Indonesia
- { 53, 7, 260, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 528,10 , 782,26 , 37,5 , 8,10 , 9601,48 , 9649,93 , 158,27 , 9601,48 , 9649,93 , 9742,24 , 4684,28 , 4712,57 , 4769,14 , 4684,28 , 4712,57 , 4769,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 2712,11 , 2723,5 , 2, 1, 1, 6, 7 }, // Interlingua/Latin/World
- { 55, 44, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,65,68}, 233,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Inuktitut/Canadian Aboriginal/Canada
- { 55, 7, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,65,68}, 233,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Inuktitut/Latin/Canada
- { 57, 7, 104, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 365,11 , 244,10 , 119,10 , 97,16 , 37,5 , 8,10 , 9766,62 , 9828,107 , 9935,24 , 9766,62 , 9828,107 , 9935,24 , 4783,37 , 4820,75 , 4895,14 , 4783,37 , 4820,75 , 4895,14 , 105,4 , 99,4 , 506,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8921,31 , 4,4 , 4,0 , 2728,7 , 2735,4 , 2, 1, 1, 6, 7 }, // Irish/Latin/Ireland
- { 58, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 97,16 , 37,5 , 8,10 , 9959,48 , 10007,94 , 10101,24 , 9959,48 , 10007,94 , 10101,24 , 4909,28 , 4937,57 , 4994,14 , 4909,28 , 4937,57 , 4994,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8952,19 , 13,5 , 4,0 , 2739,8 , 2747,6 , 2, 1, 1, 6, 7 }, // Italian/Latin/Italy
- { 58, 7, 184, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 97,16 , 37,5 , 8,10 , 9959,48 , 10007,94 , 10101,24 , 9959,48 , 10007,94 , 10101,24 , 4909,28 , 4937,57 , 4994,14 , 4909,28 , 4937,57 , 4994,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8952,19 , 13,5 , 4,0 , 2739,8 , 2753,10 , 2, 1, 1, 6, 7 }, // Italian/Latin/San Marino
- { 58, 7, 206, 46, 8217, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 254,7 , 254,7 , 156,8 , 10,17 , 37,5 , 8,10 , 9959,48 , 10007,94 , 10101,24 , 9959,48 , 10007,94 , 10101,24 , 4909,28 , 4937,57 , 4994,14 , 4909,28 , 4937,57 , 4994,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 0,0 , 8971,53 , 8,5 , 36,5 , 2739,8 , 2763,8 , 2, 0, 1, 6, 7 }, // Italian/Latin/Switzerland
- { 58, 7, 230, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 97,16 , 37,5 , 8,10 , 9959,48 , 10007,94 , 10101,24 , 9959,48 , 10007,94 , 10101,24 , 4909,28 , 4937,57 , 4994,14 , 4909,28 , 4937,57 , 4994,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8952,19 , 13,5 , 4,0 , 2739,8 , 2771,18 , 2, 1, 1, 6, 7 }, // Italian/Latin/Vatican City State
- { 59, 19, 108, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 170,5 , 170,5 , 170,5 , 170,5 , 578,10 , 402,13 , 55,4 , 372,10 , 4423,39 , 4423,39 , 158,27 , 4423,39 , 4423,39 , 158,27 , 5008,14 , 5022,28 , 5008,14 , 5008,14 , 5022,28 , 5008,14 , 109,2 , 103,2 , 512,3 , 5,17 , 22,23 , {74,80,89}, 133,1 , 9024,11 , 4,4 , 4,0 , 2789,3 , 2792,2 , 0, 0, 7, 6, 7 }, // Japanese/Japanese/Japan
- { 60, 7, 101, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 376,10 , 386,9 , 528,10 , 10,17 , 37,5 , 8,10 , 10125,48 , 9514,87 , 134,24 , 10125,48 , 9514,87 , 134,24 , 5050,28 , 5078,41 , 5119,14 , 5050,28 , 5078,41 , 5119,14 , 111,4 , 105,5 , 515,4 , 5,17 , 22,23 , {73,68,82}, 231,2 , 8882,39 , 8,5 , 4,0 , 2794,4 , 2798,9 , 2, 0, 7, 6, 7 }, // Javanese/Latin/Indonesia
- { 61, 21, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 395,12 , 407,11 , 269,6 , 35,18 , 351,8 , 359,13 , 10173,63 , 10236,87 , 10323,31 , 10354,69 , 10236,87 , 10323,31 , 5133,33 , 5166,54 , 5220,20 , 5133,33 , 5166,54 , 5220,20 , 115,9 , 110,7 , 519,8 , 527,35 , 22,23 , {73,78,82}, 121,1 , 9035,49 , 4,4 , 4,0 , 2807,5 , 2812,4 , 2, 1, 7, 7, 7 }, // Kannada/Kannada/India
- { 62, 1, 100, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 547,6 , 35,18 , 18,7 , 25,12 , 10423,72 , 10423,72 , 10495,24 , 10423,72 , 10423,72 , 10495,24 , 5240,50 , 5290,52 , 5342,14 , 5240,50 , 5290,52 , 5342,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 9084,23 , 8,5 , 4,0 , 2816,5 , 2821,9 , 2, 1, 7, 7, 7 }, // Kashmiri/Arabic/India
- { 63, 2, 110, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 418,10 , 156,8 , 808,22 , 37,5 , 8,10 , 10519,60 , 10579,83 , 10662,24 , 10519,60 , 10686,83 , 10662,24 , 5356,21 , 5377,56 , 5433,14 , 5356,21 , 5377,56 , 5433,14 , 0,2 , 0,2 , 562,4 , 566,17 , 583,23 , {75,90,84}, 236,1 , 9107,58 , 13,5 , 4,0 , 2830,10 , 2840,9 , 2, 1, 1, 6, 7 }, // Kazakh/Cyrillic/Kazakhstan
- { 64, 7, 179, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 10769,60 , 10829,101 , 158,27 , 10769,60 , 10829,101 , 158,27 , 5447,35 , 5482,84 , 85,14 , 5447,35 , 5482,84 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,87,70}, 179,2 , 0,7 , 8,5 , 4,0 , 2849,11 , 2860,8 , 0, 0, 1, 6, 7 }, // Kinyarwanda/Latin/Rwanda
- { 65, 2, 116, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 428,10 , 428,10 , 269,6 , 830,23 , 37,5 , 8,10 , 10930,48 , 10978,80 , 11058,24 , 11082,59 , 11141,80 , 11058,24 , 5566,38 , 5604,57 , 5661,14 , 5566,38 , 5604,57 , 5661,14 , 124,5 , 117,14 , 562,4 , 606,18 , 22,23 , {75,71,83}, 237,3 , 9165,52 , 13,5 , 4,0 , 2868,8 , 2876,10 , 2, 1, 1, 6, 7 }, // Kirghiz/Cyrillic/Kyrgyzstan
- { 66, 22, 114, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 438,7 , 438,7 , 853,9 , 862,16 , 382,7 , 389,13 , 11221,39 , 11221,39 , 11221,39 , 11221,39 , 11221,39 , 11221,39 , 5675,14 , 5689,28 , 5675,14 , 5675,14 , 5689,28 , 5675,14 , 129,2 , 131,2 , 624,3 , 5,17 , 22,23 , {75,82,87}, 240,1 , 9217,19 , 4,4 , 4,0 , 2886,3 , 2889,4 , 0, 0, 7, 6, 7 }, // Korean/Korean/South Korea
- { 66, 22, 113, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 438,7 , 438,7 , 853,9 , 862,16 , 382,7 , 389,13 , 11221,39 , 11221,39 , 11221,39 , 11221,39 , 11221,39 , 11221,39 , 5675,14 , 5689,28 , 5675,14 , 5675,14 , 5689,28 , 5675,14 , 129,2 , 131,2 , 624,3 , 5,17 , 22,23 , {75,80,87}, 240,1 , 9236,39 , 4,4 , 4,0 , 2886,3 , 2893,11 , 0, 0, 1, 6, 7 }, // Korean/Korean/North Korea
- { 67, 7, 217, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 445,7 , 445,7 , 53,10 , 63,17 , 37,5 , 8,10 , 11260,48 , 11308,88 , 11396,24 , 11260,48 , 11420,101 , 11396,24 , 5717,20 , 5737,42 , 5779,14 , 5717,20 , 5737,42 , 5779,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {84,82,89}, 241,1 , 0,7 , 13,5 , 4,0 , 2904,5 , 2909,7 , 2, 1, 1, 6, 7 }, // Kurdish/Latin/Turkey
- { 68, 7, 35, 44, 46, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 11521,60 , 11581,106 , 158,27 , 11521,60 , 11581,106 , 158,27 , 5793,34 , 5827,89 , 85,14 , 5793,34 , 5827,89 , 85,14 , 131,5 , 133,5 , 45,4 , 5,17 , 22,23 , {66,73,70}, 159,3 , 9275,27 , 0,4 , 4,0 , 2916,8 , 2924,8 , 0, 0, 1, 6, 7 }, // Rundi/Latin/Burundi
- { 69, 23, 117, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 452,9 , 415,8 , 878,19 , 55,4 , 402,24 , 11687,61 , 11748,75 , 158,27 , 11687,61 , 11748,75 , 158,27 , 5916,36 , 5952,57 , 6009,17 , 5916,36 , 5952,57 , 6009,17 , 136,8 , 138,8 , 45,4 , 5,17 , 22,23 , {76,65,75}, 242,1 , 9302,21 , 4,4 , 36,5 , 2932,3 , 2932,3 , 0, 0, 7, 6, 7 }, // Lao/Lao/Laos
- { 71, 7, 118, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 461,8 , 461,8 , 156,8 , 897,26 , 37,5 , 8,10 , 11823,65 , 11888,101 , 134,24 , 11823,65 , 11888,101 , 134,24 , 6026,51 , 6077,72 , 6149,14 , 6163,51 , 6214,72 , 6149,14 , 144,14 , 146,11 , 627,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9323,23 , 13,5 , 4,0 , 2935,8 , 2943,7 , 2, 1, 1, 6, 7 }, // Latvian/Latin/Latvia
- { 72, 7, 49, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 469,9 , 469,9 , 415,8 , 97,16 , 37,5 , 8,10 , 11989,48 , 12037,203 , 12240,24 , 11989,48 , 12037,203 , 12240,24 , 6286,28 , 6314,100 , 6414,14 , 6286,28 , 6314,100 , 6414,14 , 158,8 , 157,6 , 45,4 , 5,17 , 22,23 , {67,68,70}, 209,2 , 9346,23 , 13,5 , 4,0 , 2950,7 , 2957,30 , 2, 1, 1, 6, 7 }, // Lingala/Latin/Congo Kinshasa
- { 72, 7, 6, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 469,9 , 469,9 , 415,8 , 97,16 , 37,5 , 8,10 , 11989,48 , 12037,203 , 12240,24 , 11989,48 , 12037,203 , 12240,24 , 6286,28 , 6314,100 , 6414,14 , 6286,28 , 6314,100 , 6414,14 , 158,8 , 157,6 , 45,4 , 5,17 , 22,23 , {65,79,65}, 243,2 , 9369,23 , 13,5 , 4,0 , 2950,7 , 2987,6 , 2, 1, 1, 6, 7 }, // Lingala/Latin/Angola
- { 72, 7, 41, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 469,9 , 469,9 , 415,8 , 97,16 , 37,5 , 8,10 , 11989,48 , 12037,203 , 12240,24 , 11989,48 , 12037,203 , 12240,24 , 6286,28 , 6314,100 , 6414,14 , 6286,28 , 6314,100 , 6414,14 , 158,8 , 157,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 9392,23 , 13,5 , 4,0 , 2950,7 , 2993,26 , 0, 0, 1, 6, 7 }, // Lingala/Latin/Central African Republic
- { 72, 7, 50, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 469,9 , 469,9 , 415,8 , 97,16 , 37,5 , 8,10 , 11989,48 , 12037,203 , 12240,24 , 11989,48 , 12037,203 , 12240,24 , 6286,28 , 6314,100 , 6414,14 , 6286,28 , 6314,100 , 6414,14 , 158,8 , 157,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 9392,23 , 13,5 , 4,0 , 2950,7 , 3019,5 , 0, 0, 1, 6, 7 }, // Lingala/Latin/Congo Brazzaville
- { 73, 7, 124, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 478,8 , 478,8 , 53,10 , 923,27 , 37,5 , 8,10 , 12264,70 , 12334,96 , 12430,24 , 12264,70 , 12454,98 , 12430,24 , 6428,21 , 6449,89 , 6538,14 , 6428,21 , 6449,89 , 6538,14 , 166,9 , 163,6 , 632,6 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9415,30 , 13,5 , 4,0 , 3024,8 , 3032,7 , 2, 1, 1, 6, 7 }, // Lithuanian/Latin/Lithuania
- { 74, 2, 127, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 116,7 , 116,7 , 950,7 , 553,18 , 37,5 , 8,10 , 12552,61 , 12613,85 , 12698,24 , 12552,61 , 12613,85 , 12698,24 , 6552,35 , 6587,54 , 1503,14 , 6641,34 , 6587,54 , 1503,14 , 175,10 , 169,8 , 638,5 , 5,17 , 22,23 , {77,75,68}, 245,3 , 9445,56 , 13,5 , 4,0 , 3039,10 , 3049,18 , 2, 1, 1, 6, 7 }, // Macedonian/Cyrillic/Macedonia
- { 75, 7, 128, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 97,16 , 37,5 , 8,10 , 12722,48 , 12770,92 , 134,24 , 12722,48 , 12770,92 , 134,24 , 6675,34 , 6709,60 , 6769,14 , 6675,34 , 6709,60 , 6769,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,71,65}, 169,2 , 9501,13 , 8,5 , 4,0 , 3067,8 , 3075,12 , 0, 0, 1, 6, 7 }, // Malagasy/Latin/Madagascar
- { 76, 7, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 356,9 , 356,9 , 571,7 , 10,17 , 18,7 , 25,12 , 12862,48 , 12910,82 , 12992,24 , 12862,48 , 12910,82 , 12992,24 , 6783,28 , 6811,43 , 6854,14 , 6783,28 , 6811,43 , 6854,14 , 185,2 , 177,3 , 643,4 , 5,17 , 22,23 , {77,89,82}, 173,2 , 9514,39 , 4,4 , 4,0 , 3087,6 , 1250,8 , 2, 1, 1, 6, 7 }, // Malay/Latin/Malaysia
- { 76, 1, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,89,82}, 173,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Malay/Arabic/Malaysia
- { 76, 7, 32, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 356,9 , 356,9 , 571,7 , 957,12 , 18,7 , 25,12 , 12862,48 , 12910,82 , 12992,24 , 12862,48 , 12910,82 , 12992,24 , 6783,28 , 6811,43 , 6854,14 , 6783,28 , 6811,43 , 6854,14 , 185,2 , 177,3 , 643,4 , 5,17 , 22,23 , {66,78,68}, 6,1 , 9553,31 , 8,5 , 4,0 , 3087,6 , 3093,6 , 2, 1, 1, 6, 7 }, // Malay/Latin/Brunei
- { 76, 7, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 356,9 , 356,9 , 571,7 , 10,17 , 18,7 , 25,12 , 12862,48 , 12910,82 , 12992,24 , 12862,48 , 12910,82 , 12992,24 , 6783,28 , 6811,43 , 6854,14 , 6783,28 , 6811,43 , 6854,14 , 185,2 , 177,3 , 643,4 , 5,17 , 22,23 , {83,71,68}, 6,1 , 9584,37 , 4,4 , 4,0 , 3087,6 , 3099,9 , 2, 1, 7, 6, 7 }, // Malay/Latin/Singapore
- { 77, 24, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 486,13 , 499,12 , 269,6 , 969,18 , 18,7 , 25,12 , 13016,62 , 13078,88 , 13166,32 , 13016,62 , 13078,88 , 13166,32 , 6868,41 , 6909,77 , 6986,22 , 6868,41 , 7008,76 , 7084,21 , 0,2 , 0,2 , 647,6 , 653,27 , 22,23 , {73,78,82}, 121,1 , 9621,40 , 4,4 , 4,0 , 3108,6 , 3114,6 , 2, 1, 7, 7, 7 }, // Malayalam/Malayalam/India
- { 78, 7, 133, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 511,8 , 519,7 , 119,10 , 987,23 , 37,5 , 8,10 , 13198,48 , 13246,86 , 13332,36 , 13198,48 , 13246,86 , 13368,24 , 7105,28 , 7133,63 , 7196,21 , 7105,28 , 7133,63 , 7217,20 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 9661,27 , 4,4 , 4,0 , 3120,5 , 1258,5 , 2, 1, 7, 6, 7 }, // Maltese/Latin/Malta
- { 79, 7, 154, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 426,4 , 25,12 , 13392,59 , 13451,133 , 13584,24 , 13392,59 , 13451,133 , 13584,24 , 7237,27 , 7264,47 , 7311,14 , 7237,27 , 7264,47 , 7311,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,90,68}, 6,1 , 9688,41 , 8,5 , 4,0 , 3125,5 , 3130,8 , 2, 1, 1, 6, 7 }, // Maori/Latin/New Zealand
- { 80, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 526,9 , 526,9 , 269,6 , 192,18 , 18,7 , 25,12 , 13608,66 , 13674,86 , 13760,32 , 13608,66 , 13674,86 , 13760,32 , 7325,32 , 7357,53 , 4362,19 , 7325,32 , 7357,53 , 4362,19 , 187,5 , 180,4 , 494,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 9729,43 , 4,4 , 4,0 , 3138,5 , 2667,4 , 2, 1, 7, 7, 7 }, // Marathi/Devanagari/India
- { 82, 2, 143, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1010,10 , 1020,16 , 37,5 , 87,12 , 13792,99 , 13891,192 , 14083,38 , 13792,99 , 14121,192 , 14083,38 , 7410,21 , 7431,43 , 7410,21 , 7410,21 , 7474,43 , 7410,21 , 192,4 , 184,4 , 562,4 , 680,17 , 22,23 , {77,78,84}, 248,1 , 9772,25 , 8,5 , 4,0 , 3143,6 , 3149,6 , 2, 0, 1, 6, 7 }, // Mongolian/Cyrillic/Mongolia
- { 82, 8, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 249,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Mongolian/Mongolian/China
- { 84, 13, 150, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 535,5 , 0,6 , 540,7 , 540,7 , 227,6 , 63,17 , 37,5 , 8,10 , 14313,85 , 14313,85 , 14398,53 , 14313,85 , 14313,85 , 14451,52 , 7517,33 , 7550,54 , 7604,18 , 7517,33 , 7550,54 , 7604,18 , 196,9 , 188,7 , 494,4 , 697,19 , 22,23 , {78,80,82}, 252,4 , 9797,49 , 8,5 , 4,0 , 3155,6 , 3161,5 , 2, 1, 7, 6, 7 }, // Nepali/Devanagari/Nepal
- { 84, 13, 100, 46, 44, 59, 37, 2406, 45, 43, 101, 8220, 8221, 8216, 8217, 535,5 , 0,6 , 540,7 , 540,7 , 227,6 , 63,17 , 18,7 , 25,12 , 14313,85 , 14313,85 , 14398,53 , 14313,85 , 14313,85 , 14451,52 , 7517,33 , 7550,54 , 7604,18 , 7517,33 , 7550,54 , 7604,18 , 196,9 , 188,7 , 494,4 , 697,19 , 22,23 , {73,78,82}, 121,1 , 9846,49 , 8,5 , 4,0 , 3155,6 , 2667,4 , 2, 1, 7, 7, 7 }, // Nepali/Devanagari/India
- { 85, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 495,10 , 478,17 , 228,5 , 233,10 , 5656,48 , 14503,83 , 134,24 , 5787,59 , 14503,83 , 134,24 , 2307,35 , 2242,51 , 2293,14 , 2307,35 , 2242,51 , 2293,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {78,79,75}, 189,2 , 9895,44 , 8,5 , 4,0 , 3166,12 , 3178,5 , 2, 0, 1, 6, 7 }, // Norwegian Bokmal/Latin/Norway
- { 85, 7, 203, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 495,10 , 478,17 , 228,5 , 233,10 , 5656,48 , 14503,83 , 134,24 , 5787,59 , 14503,83 , 134,24 , 2307,35 , 2242,51 , 2293,14 , 2307,35 , 2242,51 , 2293,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {78,79,75}, 189,2 , 9895,44 , 8,5 , 4,0 , 3166,12 , 3183,21 , 2, 0, 1, 6, 7 }, // Norwegian Bokmal/Latin/Svalbard And Jan Mayen Islands
- { 86, 7, 74, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Occitan/Latin/France
- { 87, 26, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 547,8 , 555,7 , 547,6 , 35,18 , 18,7 , 25,12 , 14586,86 , 14586,86 , 14672,32 , 14586,86 , 14586,86 , 14672,32 , 7622,33 , 7655,54 , 7709,18 , 7622,33 , 7655,54 , 7709,18 , 0,2 , 0,2 , 716,5 , 5,17 , 22,23 , {73,78,82}, 121,1 , 9939,43 , 4,4 , 4,0 , 3204,5 , 3209,4 , 2, 1, 7, 7, 7 }, // Oriya/Oriya/India
- { 88, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 46,6 , 46,6 , 562,9 , 571,8 , 394,8 , 1036,20 , 55,4 , 430,11 , 14704,68 , 14772,69 , 158,27 , 14841,69 , 14841,69 , 14910,24 , 7727,39 , 7727,39 , 85,14 , 7727,39 , 7727,39 , 85,14 , 205,4 , 195,4 , 721,5 , 5,17 , 22,23 , {65,70,78}, 256,1 , 9982,25 , 13,5 , 4,0 , 3213,4 , 3217,9 , 0, 0, 6, 4, 5 }, // Pashto/Arabic/Afghanistan
- { 88, 1, 163, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 46,6 , 46,6 , 562,9 , 571,8 , 394,8 , 1036,20 , 18,7 , 25,12 , 14704,68 , 14772,69 , 158,27 , 14841,69 , 14841,69 , 14910,24 , 7727,39 , 7727,39 , 85,14 , 7727,39 , 7727,39 , 85,14 , 205,4 , 195,4 , 721,5 , 5,17 , 22,23 , {80,75,82}, 175,2 , 10007,52 , 13,5 , 4,0 , 3213,4 , 3226,7 , 2, 0, 7, 6, 7 }, // Pashto/Arabic/Pakistan
- { 89, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 579,7 , 579,7 , 586,8 , 594,7 , 394,8 , 97,16 , 55,4 , 430,11 , 14934,70 , 14934,70 , 15004,24 , 15028,74 , 15028,74 , 15004,24 , 7766,49 , 7766,49 , 7815,14 , 7766,49 , 7766,49 , 7815,14 , 209,9 , 199,8 , 726,4 , 730,44 , 22,23 , {73,82,82}, 257,4 , 10059,37 , 78,5 , 4,0 , 3233,5 , 3238,5 , 0, 0, 6, 5, 5 }, // Persian/Arabic/Iran
- { 89, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 579,7 , 579,7 , 586,8 , 594,7 , 394,8 , 97,16 , 55,4 , 430,11 , 15102,68 , 15102,68 , 14910,24 , 15170,62 , 15102,68 , 14910,24 , 7766,49 , 7766,49 , 7815,14 , 7766,49 , 7766,49 , 7815,14 , 209,9 , 199,8 , 726,4 , 730,44 , 22,23 , {65,70,78}, 256,1 , 10096,55 , 8,5 , 4,0 , 3243,3 , 3217,9 , 0, 0, 6, 4, 5 }, // Persian/Arabic/Afghanistan
- { 90, 7, 172, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 163,7 , 163,7 , 495,10 , 10,17 , 37,5 , 8,10 , 15232,48 , 15280,97 , 15377,24 , 15232,48 , 15401,99 , 15500,24 , 7829,34 , 7863,59 , 7922,14 , 7829,34 , 7863,59 , 7936,14 , 0,2 , 0,2 , 303,5 , 5,17 , 22,23 , {80,76,78}, 261,2 , 10151,77 , 13,5 , 4,0 , 3246,6 , 3252,6 , 2, 1, 1, 6, 7 }, // Polish/Latin/Poland
- { 91, 7, 30, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 254,7 , 254,7 , 119,10 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 7950,28 , 7978,79 , 8057,14 , 7950,28 , 7978,79 , 8057,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {66,82,76}, 263,2 , 10228,54 , 8,5 , 4,0 , 3258,9 , 3267,6 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Brazil
- { 91, 7, 6, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {65,79,65}, 243,2 , 10282,54 , 13,5 , 4,0 , 3258,9 , 3273,6 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Angola
- { 91, 7, 39, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {67,86,69}, 265,1 , 10336,69 , 13,5 , 4,0 , 3258,9 , 3279,10 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Cape Verde
- { 91, 7, 62, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {85,83,68}, 155,3 , 10405,81 , 13,5 , 4,0 , 3258,9 , 3289,11 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/East Timor
- { 91, 7, 66, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 10486,59 , 13,5 , 4,0 , 3258,9 , 3300,16 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/Equatorial Guinea
- { 91, 7, 92, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {88,79,70}, 206,3 , 10545,62 , 13,5 , 4,0 , 3258,9 , 3316,12 , 0, 0, 1, 6, 7 }, // Portuguese/Latin/Guinea Bissau
- { 91, 7, 125, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3258,9 , 3328,10 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Luxembourg
- { 91, 7, 126, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 18,7 , 25,12 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {77,79,80}, 134,4 , 10607,53 , 13,5 , 4,0 , 3258,9 , 3338,19 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Macau
- { 91, 7, 146, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {77,90,78}, 266,3 , 10660,66 , 13,5 , 4,0 , 3258,9 , 3357,10 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Mozambique
- { 91, 7, 173, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3367,17 , 3384,8 , 2, 1, 7, 6, 7 }, // Portuguese/Latin/Portugal
- { 91, 7, 185, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {83,84,78}, 269,2 , 10726,92 , 13,5 , 4,0 , 3258,9 , 3392,19 , 2, 1, 1, 6, 7 }, // Portuguese/Latin/Sao Tome And Principe
- { 91, 7, 206, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 669,27 , 37,5 , 8,10 , 15524,48 , 15572,89 , 134,24 , 15524,48 , 15572,89 , 134,24 , 8071,49 , 7978,79 , 8057,14 , 8071,49 , 7978,79 , 8057,14 , 218,8 , 207,8 , 0,5 , 5,17 , 22,23 , {67,72,70}, 225,3 , 10818,45 , 13,5 , 4,0 , 3258,9 , 3411,5 , 2, 0, 1, 6, 7 }, // Portuguese/Latin/Switzerland
- { 92, 4, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 601,9 , 601,9 , 269,6 , 10,17 , 18,7 , 25,12 , 15661,50 , 15711,68 , 15779,28 , 15661,50 , 15711,68 , 15779,28 , 8120,36 , 8156,57 , 8213,23 , 8120,36 , 8156,57 , 8213,23 , 226,6 , 215,6 , 774,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 10863,39 , 4,4 , 4,0 , 3416,6 , 3422,4 , 2, 1, 7, 7, 7 }, // Punjabi/Gurmukhi/India
- { 92, 1, 163, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 553,18 , 18,7 , 25,12 , 15807,67 , 15807,67 , 158,27 , 15807,67 , 15807,67 , 158,27 , 8236,37 , 8236,37 , 85,14 , 8236,37 , 8236,37 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 271,1 , 10902,13 , 41,6 , 4,0 , 3426,6 , 3226,7 , 2, 0, 7, 6, 7 }, // Punjabi/Arabic/Pakistan
- { 93, 7, 169, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 192,18 , 37,5 , 8,10 , 15874,48 , 15922,88 , 158,27 , 15874,48 , 15922,88 , 158,27 , 8273,28 , 8301,53 , 8354,14 , 8273,28 , 8301,53 , 8354,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {80,69,78}, 272,2 , 0,7 , 8,5 , 4,0 , 3432,8 , 3440,4 , 2, 1, 7, 6, 7 }, // Quechua/Latin/Peru
- { 93, 7, 26, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 192,18 , 37,5 , 8,10 , 15874,48 , 15922,88 , 158,27 , 15874,48 , 15922,88 , 158,27 , 8273,28 , 8301,53 , 8354,14 , 8273,28 , 8301,53 , 8354,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {66,79,66}, 274,2 , 0,7 , 8,5 , 4,0 , 3432,8 , 3444,7 , 2, 1, 1, 6, 7 }, // Quechua/Latin/Bolivia
- { 93, 7, 63, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 192,18 , 37,5 , 8,10 , 15874,48 , 15922,88 , 158,27 , 15874,48 , 15922,88 , 158,27 , 8273,28 , 8301,53 , 8354,14 , 8273,28 , 8301,53 , 8354,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 8,5 , 4,0 , 3432,8 , 3451,7 , 2, 1, 1, 6, 7 }, // Quechua/Latin/Ecuador
- { 94, 7, 206, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 339,8 , 1056,28 , 37,5 , 8,10 , 16010,67 , 16077,92 , 16169,24 , 16010,67 , 16077,92 , 16169,24 , 8368,23 , 8391,56 , 8447,14 , 8368,23 , 8391,56 , 8447,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 225,3 , 10915,46 , 13,5 , 4,0 , 3458,9 , 3467,6 , 2, 0, 1, 6, 7 }, // Romansh/Latin/Switzerland
- { 95, 7, 177, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 610,8 , 610,8 , 495,10 , 10,17 , 37,5 , 8,10 , 16193,60 , 16253,98 , 16351,24 , 16193,60 , 16253,98 , 16351,24 , 8461,34 , 8495,48 , 3080,14 , 8461,34 , 8495,48 , 3080,14 , 64,4 , 61,4 , 778,4 , 5,17 , 22,23 , {82,79,78}, 276,3 , 10961,57 , 13,5 , 4,0 , 3473,6 , 3479,7 , 2, 1, 1, 6, 7 }, // Romanian/Latin/Romania
- { 95, 7, 141, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 610,8 , 610,8 , 495,10 , 10,17 , 37,5 , 8,10 , 16193,60 , 16253,98 , 16351,24 , 16193,60 , 16253,98 , 16351,24 , 8543,28 , 8495,48 , 8571,16 , 8543,28 , 8495,48 , 8571,16 , 64,4 , 61,4 , 778,4 , 5,17 , 22,23 , {77,68,76}, 279,1 , 11018,69 , 13,5 , 4,0 , 3473,6 , 3486,17 , 2, 1, 1, 6, 7 }, // Romanian/Latin/Moldova
- { 96, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 495,10 , 317,22 , 37,5 , 8,10 , 16375,62 , 11141,80 , 11058,24 , 16437,62 , 16499,82 , 11058,24 , 8587,21 , 8608,62 , 8670,14 , 8587,21 , 8608,62 , 8587,21 , 0,2 , 0,2 , 246,5 , 680,17 , 22,23 , {82,85,66}, 123,1 , 11087,89 , 13,5 , 4,0 , 3503,7 , 3510,6 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Russia
- { 96, 2, 20, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 495,10 , 317,22 , 37,5 , 8,10 , 16375,62 , 11141,80 , 11058,24 , 16437,62 , 16499,82 , 11058,24 , 8587,21 , 8608,62 , 8670,14 , 8587,21 , 8608,62 , 8587,21 , 0,2 , 0,2 , 246,5 , 680,17 , 22,23 , {66,89,78}, 0,2 , 11176,94 , 13,5 , 4,0 , 3503,7 , 511,8 , 2, 0, 1, 6, 7 }, // Russian/Cyrillic/Belarus
- { 96, 2, 110, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 495,10 , 317,22 , 37,5 , 8,10 , 16375,62 , 11141,80 , 11058,24 , 16437,62 , 16499,82 , 11058,24 , 8587,21 , 8608,62 , 8670,14 , 8587,21 , 8608,62 , 8587,21 , 0,2 , 0,2 , 246,5 , 680,17 , 22,23 , {75,90,84}, 236,1 , 11270,83 , 13,5 , 4,0 , 3503,7 , 3516,9 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Kazakhstan
- { 96, 2, 116, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 495,10 , 317,22 , 37,5 , 8,10 , 16375,62 , 11141,80 , 11058,24 , 16437,62 , 16499,82 , 11058,24 , 8587,21 , 8608,62 , 8670,14 , 8587,21 , 8608,62 , 8587,21 , 0,2 , 0,2 , 246,5 , 680,17 , 22,23 , {75,71,83}, 237,3 , 11353,82 , 13,5 , 4,0 , 3503,7 , 3525,8 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Kyrgyzstan
- { 96, 2, 141, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 495,10 , 317,22 , 37,5 , 8,10 , 16375,62 , 11141,80 , 11058,24 , 16437,62 , 16499,82 , 11058,24 , 8587,21 , 8608,62 , 8670,14 , 8587,21 , 8608,62 , 8587,21 , 0,2 , 0,2 , 246,5 , 680,17 , 22,23 , {77,68,76}, 279,1 , 11435,79 , 13,5 , 4,0 , 3503,7 , 3533,7 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Moldova
- { 96, 2, 222, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 116,7 , 116,7 , 495,10 , 317,22 , 37,5 , 8,10 , 16375,62 , 11141,80 , 11058,24 , 16437,62 , 16499,82 , 11058,24 , 8587,21 , 8608,62 , 8670,14 , 8587,21 , 8608,62 , 8587,21 , 0,2 , 0,2 , 246,5 , 680,17 , 22,23 , {85,65,72}, 280,1 , 11514,92 , 13,5 , 4,0 , 3503,7 , 3540,7 , 2, 1, 1, 6, 7 }, // Russian/Cyrillic/Ukraine
- { 98, 7, 41, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 16581,48 , 16629,91 , 16720,24 , 16581,48 , 16629,91 , 16720,24 , 8684,28 , 8712,66 , 8778,14 , 8684,28 , 8712,66 , 8778,14 , 232,2 , 221,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 11606,25 , 4,4 , 36,5 , 3547,5 , 3552,22 , 0, 0, 1, 6, 7 }, // Sango/Latin/Central African Republic
- { 99, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 7, 7 }, // Sanskrit/Devanagari/India
- { 100, 2, 243, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 116,7 , 116,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 16744,48 , 16792,81 , 12698,24 , 16744,48 , 16792,81 , 12698,24 , 8792,28 , 8820,52 , 8872,14 , 8792,28 , 8820,52 , 8872,14 , 234,9 , 223,8 , 782,7 , 5,17 , 22,23 , {82,83,68}, 0,0 , 11631,58 , 13,5 , 4,0 , 3574,6 , 3580,6 , 0, 0, 1, 6, 7 }, // Serbian/Cyrillic/Serbia
- { 100, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 163,7 , 163,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 16873,50 , 16923,81 , 9742,24 , 17004,48 , 16923,81 , 9742,24 , 8886,26 , 8912,57 , 2102,14 , 8886,26 , 8912,57 , 2102,14 , 243,11 , 231,8 , 296,7 , 5,17 , 22,23 , {66,65,77}, 140,2 , 11689,174 , 13,5 , 4,0 , 3586,6 , 630,19 , 2, 1, 1, 6, 7 }, // Serbian/Latin/Bosnia And Herzegowina
- { 100, 7, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 163,7 , 163,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 17052,58 , 16923,81 , 9742,24 , 17052,58 , 16923,81 , 9742,24 , 8969,33 , 8912,57 , 2102,14 , 8969,33 , 8912,57 , 2102,14 , 243,11 , 231,8 , 296,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 11863,23 , 13,5 , 4,0 , 3586,6 , 3592,9 , 2, 1, 1, 6, 7 }, // Serbian/Latin/Montenegro
- { 100, 7, 243, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 163,7 , 163,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 17004,48 , 16923,81 , 9742,24 , 17004,48 , 16923,81 , 9742,24 , 9002,28 , 9030,54 , 2102,14 , 9002,28 , 9030,54 , 2102,14 , 254,9 , 231,8 , 296,7 , 5,17 , 22,23 , {82,83,68}, 0,0 , 11886,58 , 13,5 , 4,0 , 3586,6 , 3601,6 , 0, 0, 1, 6, 7 }, // Serbian/Latin/Serbia
- { 100, 2, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 116,7 , 116,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 17110,50 , 16792,81 , 12698,24 , 16744,48 , 16792,81 , 12698,24 , 9084,26 , 9110,55 , 8872,14 , 9084,26 , 9110,55 , 8872,14 , 263,11 , 223,8 , 782,7 , 5,17 , 22,23 , {66,65,77}, 281,2 , 11944,174 , 13,5 , 4,0 , 3574,6 , 3607,19 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/Bosnia And Herzegowina
- { 100, 2, 242, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 116,7 , 116,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 17110,50 , 16792,81 , 12698,24 , 17110,50 , 16792,81 , 12698,24 , 8792,28 , 9110,55 , 8872,14 , 8792,28 , 9110,55 , 8872,14 , 263,11 , 223,8 , 782,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12118,23 , 13,5 , 4,0 , 3574,6 , 3626,9 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/Montenegro
- { 100, 2, 257, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 116,7 , 116,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 17110,50 , 16792,81 , 12698,24 , 17110,50 , 16792,81 , 12698,24 , 8792,28 , 8820,52 , 8872,14 , 8792,28 , 8820,52 , 8872,14 , 234,9 , 223,8 , 782,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12118,23 , 13,5 , 4,0 , 3574,6 , 3635,6 , 2, 1, 1, 6, 7 }, // Serbian/Cyrillic/Kosovo
- { 100, 7, 257, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8216, 8216, 0,6 , 0,6 , 163,7 , 163,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 17052,58 , 16923,81 , 9742,24 , 17052,58 , 16923,81 , 9742,24 , 8969,33 , 9030,54 , 2102,14 , 8969,33 , 9030,54 , 2102,14 , 254,9 , 231,8 , 296,7 , 5,17 , 22,23 , {69,85,82}, 14,1 , 11863,23 , 13,5 , 4,0 , 3586,6 , 3641,6 , 2, 1, 1, 6, 7 }, // Serbian/Latin/Kosovo
- { 101, 2, 81, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 618,9 , 618,9 , 156,8 , 1111,23 , 37,5 , 8,10 , 17160,63 , 17223,82 , 11058,24 , 17305,60 , 17365,86 , 11058,24 , 9165,28 , 9193,61 , 9254,14 , 9268,28 , 9296,61 , 9254,14 , 274,15 , 239,15 , 45,4 , 5,17 , 22,23 , {71,69,76}, 224,1 , 12141,17 , 8,5 , 4,0 , 3647,4 , 3651,11 , 2, 1, 1, 6, 7 }, // Ossetic/Cyrillic/Georgia
- { 101, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 618,9 , 618,9 , 156,8 , 1111,23 , 37,5 , 8,10 , 17160,63 , 17223,82 , 11058,24 , 17305,60 , 17365,86 , 11058,24 , 9165,28 , 9193,61 , 9254,14 , 9268,28 , 9296,61 , 9254,14 , 274,15 , 239,15 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 12158,17 , 8,5 , 4,0 , 3647,4 , 3662,6 , 2, 1, 1, 6, 7 }, // Ossetic/Cyrillic/Russia
- { 102, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Southern Sotho/Latin/South Africa
- { 103, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Tswana/Latin/South Africa
- { 104, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 17451,48 , 17499,100 , 17599,24 , 17451,48 , 17499,100 , 17599,24 , 9357,28 , 9385,55 , 9440,14 , 9357,28 , 9385,55 , 9440,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 155,3 , 12175,22 , 4,4 , 4,0 , 3668,8 , 1820,8 , 2, 1, 7, 6, 7 }, // Shona/Latin/Zimbabwe
- { 105, 1, 163, 1643, 1644, 1563, 37, 1632, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 627,8 , 635,7 , 53,10 , 63,17 , 18,7 , 25,12 , 17623,72 , 17623,72 , 134,24 , 17623,72 , 17623,72 , 134,24 , 9454,35 , 9454,35 , 9489,31 , 9454,35 , 9454,35 , 9489,31 , 289,11 , 254,11 , 789,6 , 795,61 , 22,23 , {80,75,82}, 175,2 , 12197,43 , 8,5 , 4,0 , 3676,4 , 3680,7 , 2, 0, 7, 6, 7 }, // Sindhi/Arabic/Pakistan
- { 106, 32, 198, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 642,9 , 651,8 , 53,10 , 63,17 , 228,5 , 233,10 , 17695,59 , 17754,96 , 17850,32 , 17882,61 , 17754,96 , 17850,32 , 9520,39 , 9559,62 , 9621,19 , 9520,39 , 9559,62 , 9621,19 , 300,5 , 265,4 , 856,5 , 861,42 , 22,23 , {76,75,82}, 283,3 , 12240,58 , 4,4 , 4,0 , 3687,5 , 3692,11 , 2, 1, 1, 6, 7 }, // Sinhala/Sinhala/Sri Lanka
- { 107, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Swati/Latin/South Africa
- { 108, 7, 191, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 185,7 , 659,7 , 1134,10 , 478,17 , 55,4 , 59,9 , 17943,48 , 17991,82 , 9742,24 , 17943,48 , 18073,89 , 9742,24 , 9640,21 , 9661,52 , 9713,14 , 9640,21 , 9661,52 , 9713,14 , 0,2 , 0,2 , 303,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12298,26 , 13,5 , 4,0 , 3703,10 , 3713,9 , 2, 1, 1, 6, 7 }, // Slovak/Latin/Slovakia
- { 109, 7, 192, 44, 46, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 666,8 , 666,8 , 1144,9 , 1153,19 , 37,5 , 8,10 , 18162,59 , 18221,86 , 9742,24 , 18162,59 , 18221,86 , 9742,24 , 9727,35 , 9762,52 , 9814,14 , 9727,35 , 9762,52 , 9814,14 , 60,4 , 269,4 , 54,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 12324,28 , 13,5 , 4,0 , 3722,11 , 3733,9 , 2, 1, 1, 6, 7 }, // Slovenian/Latin/Slovenia
- { 110, 7, 194, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 674,9 , 674,9 , 27,8 , 1172,19 , 18,7 , 25,12 , 18307,48 , 18355,92 , 18447,24 , 18307,48 , 18471,189 , 18447,24 , 9828,32 , 9860,47 , 9907,15 , 9828,32 , 9860,47 , 9907,15 , 305,2 , 273,2 , 903,6 , 909,17 , 22,23 , {83,79,83}, 94,1 , 12352,27 , 4,4 , 4,0 , 3742,8 , 3750,10 , 0, 0, 1, 6, 7 }, // Somali/Latin/Somalia
- { 110, 7, 59, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 674,9 , 674,9 , 27,8 , 1172,19 , 18,7 , 25,12 , 18307,48 , 18355,92 , 18447,24 , 18307,48 , 18471,189 , 18447,24 , 9828,32 , 9860,47 , 9907,15 , 9828,32 , 9860,47 , 9907,15 , 305,2 , 273,2 , 903,6 , 909,17 , 22,23 , {68,74,70}, 38,3 , 12379,50 , 4,4 , 4,0 , 3742,8 , 3760,7 , 0, 0, 6, 6, 7 }, // Somali/Latin/Djibouti
- { 110, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 674,9 , 674,9 , 27,8 , 1172,19 , 18,7 , 25,12 , 18307,48 , 18355,92 , 18447,24 , 18307,48 , 18471,189 , 18447,24 , 9828,32 , 9860,47 , 9907,15 , 9828,32 , 9860,47 , 9907,15 , 305,2 , 273,2 , 903,6 , 909,17 , 22,23 , {69,84,66}, 0,2 , 12429,52 , 4,4 , 4,0 , 3742,8 , 3767,8 , 2, 1, 7, 6, 7 }, // Somali/Latin/Ethiopia
- { 110, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 674,9 , 674,9 , 27,8 , 1172,19 , 37,5 , 8,10 , 18307,48 , 18355,92 , 18447,24 , 18307,48 , 18471,189 , 18447,24 , 9828,32 , 9860,47 , 9907,15 , 9828,32 , 9860,47 , 9907,15 , 305,2 , 273,2 , 903,6 , 909,17 , 22,23 , {75,69,83}, 2,3 , 12481,52 , 4,4 , 4,0 , 3742,8 , 1192,5 , 2, 1, 7, 6, 7 }, // Somali/Latin/Kenya
- { 111, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 55,4 , 430,11 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 8354,14 , 9922,35 , 9957,53 , 8354,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3775,17 , 2432,6 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Spain
- { 111, 7, 10, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 3080,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {65,82,83}, 6,1 , 12533,51 , 8,5 , 4,0 , 3792,7 , 3799,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Argentina
- { 111, 7, 22, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {66,90,68}, 6,1 , 12584,52 , 4,4 , 4,0 , 3792,7 , 3808,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Belize
- { 111, 7, 26, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {66,79,66}, 274,2 , 12636,35 , 4,4 , 4,0 , 3792,7 , 3444,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Bolivia
- { 111, 7, 30, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {66,82,76}, 263,2 , 12671,52 , 4,4 , 4,0 , 3792,7 , 3267,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Brazil
- { 111, 7, 43, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 339,8 , 669,27 , 37,5 , 8,10 , 18660,61 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,76,80}, 6,1 , 12723,45 , 4,4 , 36,5 , 3792,7 , 3814,5 , 0, 0, 1, 6, 7 }, // Spanish/Latin/Chile
- { 111, 7, 47, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 571,7 , 669,27 , 18,7 , 25,12 , 18660,61 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 4769,14 , 9922,35 , 9957,53 , 3080,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,79,80}, 6,1 , 12768,54 , 8,5 , 4,0 , 3792,7 , 3819,8 , 2, 0, 7, 6, 7 }, // Spanish/Latin/Colombia
- { 111, 7, 52, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {67,82,67}, 286,1 , 12822,67 , 4,4 , 4,0 , 3792,7 , 3827,10 , 2, 0, 1, 6, 7 }, // Spanish/Latin/Costa Rica
- { 111, 7, 55, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {67,85,80}, 6,1 , 12889,42 , 4,4 , 4,0 , 3792,7 , 3837,4 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Cuba
- { 111, 7, 61, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 18,7 , 25,12 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 3080,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {68,79,80}, 287,3 , 12931,54 , 4,4 , 83,6 , 3792,7 , 3841,20 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Dominican Republic
- { 111, 7, 63, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12985,70 , 4,4 , 36,5 , 3792,7 , 3451,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Ecuador
- { 111, 7, 65, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12985,70 , 4,4 , 4,0 , 3792,7 , 3861,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/El Salvador
- { 111, 7, 66, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 55,4 , 430,11 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 8354,14 , 9922,35 , 9957,53 , 8354,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {88,65,70}, 32,4 , 13055,92 , 4,4 , 4,0 , 3792,7 , 3872,17 , 0, 0, 1, 6, 7 }, // Spanish/Latin/Equatorial Guinea
- { 111, 7, 90, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 571,7 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {71,84,81}, 290,1 , 13147,30 , 18,5 , 4,0 , 3792,7 , 3889,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Guatemala
- { 111, 7, 96, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 1191,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {72,78,76}, 279,1 , 13177,60 , 4,4 , 4,0 , 3792,7 , 3898,8 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Honduras
- { 111, 7, 139, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 27,8 , 669,27 , 55,4 , 59,9 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 3080,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {77,88,78}, 6,1 , 13237,48 , 47,6 , 4,0 , 3906,17 , 3923,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Mexico
- { 111, 7, 155, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {78,73,79}, 291,2 , 13285,69 , 4,4 , 4,0 , 3792,7 , 3929,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Nicaragua
- { 111, 7, 166, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 1218,8 , 669,27 , 18,7 , 25,12 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,65,66}, 293,3 , 13354,54 , 4,4 , 4,0 , 3792,7 , 3938,6 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Panama
- { 111, 7, 168, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,89,71}, 296,3 , 13408,61 , 8,5 , 23,6 , 3792,7 , 3944,8 , 0, 0, 7, 6, 7 }, // Spanish/Latin/Paraguay
- { 111, 7, 169, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 571,7 , 669,27 , 37,5 , 8,10 , 18894,60 , 15922,88 , 18810,24 , 18954,60 , 19014,88 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,69,78}, 272,2 , 13469,43 , 8,5 , 4,0 , 3792,7 , 3440,4 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Peru
- { 111, 7, 170, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 18,7 , 25,12 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 8354,14 , 9922,35 , 9957,53 , 8354,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {80,72,80}, 178,1 , 13512,48 , 13,5 , 4,0 , 3792,7 , 3952,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Philippines
- { 111, 7, 174, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 1218,8 , 669,27 , 18,7 , 25,12 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12985,70 , 4,4 , 4,0 , 3792,7 , 1447,11 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Puerto Rico
- { 111, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 415,8 , 669,27 , 18,7 , 25,12 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 3080,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,83,68}, 6,1 , 12985,70 , 89,7 , 4,0 , 3792,7 , 3961,14 , 2, 1, 7, 6, 7 }, // Spanish/Latin/United States
- { 111, 7, 227, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18894,60 , 15922,88 , 18810,24 , 18954,60 , 19014,88 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {85,89,85}, 6,1 , 13560,48 , 8,5 , 4,0 , 3792,7 , 3975,7 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Uruguay
- { 111, 7, 231, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 18,7 , 25,12 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {86,69,83}, 299,4 , 13608,58 , 4,4 , 36,5 , 3792,7 , 3982,9 , 2, 1, 7, 6, 7 }, // Spanish/Latin/Venezuela
- { 111, 7, 238, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 55,4 , 430,11 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 8354,14 , 9922,35 , 9957,53 , 8354,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3792,7 , 3991,8 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Canary Islands
- { 111, 7, 246, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 37,5 , 8,10 , 18834,60 , 18721,89 , 18810,24 , 18834,60 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 3080,14 , 9922,35 , 9957,53 , 4769,14 , 64,4 , 61,4 , 0,5 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 4,4 , 4,0 , 3999,23 , 4022,13 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Latin America
- { 111, 7, 250, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 669,27 , 55,4 , 430,11 , 18660,61 , 18721,89 , 18810,24 , 18660,61 , 18721,89 , 18810,24 , 9922,35 , 9957,53 , 8354,14 , 9922,35 , 9957,53 , 8354,14 , 53,5 , 50,5 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 3792,7 , 4035,15 , 2, 1, 1, 6, 7 }, // Spanish/Latin/Ceuta And Melilla
- { 113, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 690,8 , 690,8 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 19150,84 , 134,24 , 19102,48 , 19150,84 , 134,24 , 10010,60 , 10010,60 , 85,14 , 10010,60 , 10010,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {84,90,83}, 191,3 , 13666,67 , 8,5 , 4,0 , 4050,9 , 1625,8 , 2, 0, 1, 6, 7 }, // Swahili/Latin/Tanzania
- { 113, 7, 49, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 690,8 , 690,8 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 19150,84 , 134,24 , 19102,48 , 19150,84 , 134,24 , 10010,60 , 10010,60 , 85,14 , 10010,60 , 10010,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {67,68,70}, 209,2 , 13733,55 , 8,5 , 4,0 , 4050,9 , 4059,32 , 2, 1, 1, 6, 7 }, // Swahili/Latin/Congo Kinshasa
- { 113, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 690,8 , 690,8 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 19150,84 , 134,24 , 19102,48 , 19150,84 , 134,24 , 10010,60 , 10010,60 , 85,14 , 10010,60 , 10010,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {75,69,83}, 2,3 , 13788,58 , 8,5 , 4,0 , 4050,9 , 1192,5 , 2, 1, 7, 6, 7 }, // Swahili/Latin/Kenya
- { 113, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 690,8 , 690,8 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 19150,84 , 134,24 , 19102,48 , 19150,84 , 134,24 , 10010,60 , 10010,60 , 85,14 , 10010,60 , 10010,60 , 85,14 , 0,2 , 0,2 , 627,5 , 926,51 , 22,23 , {85,71,88}, 196,3 , 13846,61 , 8,5 , 4,0 , 4050,9 , 1690,6 , 0, 0, 1, 6, 7 }, // Swahili/Latin/Uganda
- { 114, 7, 205, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 698,9 , 698,9 , 53,10 , 97,16 , 228,5 , 441,16 , 19234,59 , 19293,86 , 134,24 , 19234,59 , 19293,86 , 134,24 , 10070,29 , 10099,50 , 2293,14 , 10070,29 , 10099,50 , 2293,14 , 307,2 , 275,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 189,2 , 13907,45 , 13,5 , 4,0 , 4091,7 , 4098,7 , 2, 0, 1, 6, 7 }, // Swedish/Latin/Sweden
- { 114, 7, 73, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 698,9 , 698,9 , 528,10 , 97,16 , 228,5 , 441,16 , 19234,59 , 19293,86 , 134,24 , 19234,59 , 19293,86 , 134,24 , 10070,29 , 10099,50 , 2293,14 , 10070,29 , 10099,50 , 2293,14 , 307,2 , 275,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8952,19 , 13,5 , 4,0 , 4091,7 , 1089,7 , 2, 1, 1, 6, 7 }, // Swedish/Latin/Finland
- { 114, 7, 248, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 698,9 , 698,9 , 53,10 , 97,16 , 228,5 , 441,16 , 19234,59 , 19293,86 , 134,24 , 19234,59 , 19293,86 , 134,24 , 10070,29 , 10099,50 , 2293,14 , 10070,29 , 10099,50 , 2293,14 , 307,2 , 275,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8952,19 , 13,5 , 4,0 , 4091,7 , 4105,5 , 2, 1, 1, 6, 7 }, // Swedish/Latin/Aland Islands
- { 115, 7, 106, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Sardinian/Latin/Italy
- { 116, 2, 209, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 553,18 , 37,5 , 8,10 , 10930,48 , 19379,71 , 11058,24 , 10930,48 , 19379,71 , 11058,24 , 10149,28 , 10177,55 , 10232,14 , 10149,28 , 10177,55 , 10232,14 , 309,7 , 277,7 , 45,4 , 5,17 , 22,23 , {84,74,83}, 303,4 , 13952,19 , 13,5 , 4,0 , 4110,6 , 4116,10 , 2, 1, 1, 6, 7 }, // Tajik/Cyrillic/Tajikistan
- { 117, 27, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 707,13 , 707,13 , 269,6 , 192,18 , 382,7 , 457,12 , 19450,58 , 19508,86 , 19594,31 , 19450,58 , 19508,86 , 19594,31 , 10246,39 , 10285,49 , 10334,20 , 10246,39 , 10285,49 , 10334,20 , 316,8 , 284,8 , 977,7 , 5,17 , 22,23 , {73,78,82}, 121,1 , 13971,49 , 8,5 , 4,0 , 4126,5 , 4131,7 , 2, 1, 7, 7, 7 }, // Tamil/Tamil/India
- { 117, 27, 130, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 707,13 , 707,13 , 269,6 , 192,18 , 382,7 , 457,12 , 19450,58 , 19508,86 , 19594,31 , 19450,58 , 19508,86 , 19594,31 , 10246,39 , 10285,49 , 10334,20 , 10246,39 , 10285,49 , 10334,20 , 316,8 , 284,8 , 977,7 , 5,17 , 22,23 , {77,89,82}, 173,2 , 14020,61 , 8,5 , 4,0 , 4126,5 , 4138,7 , 2, 1, 1, 6, 7 }, // Tamil/Tamil/Malaysia
- { 117, 27, 190, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 707,13 , 707,13 , 269,6 , 192,18 , 382,7 , 457,12 , 19450,58 , 19508,86 , 19594,31 , 19450,58 , 19508,86 , 19594,31 , 10246,39 , 10285,49 , 10334,20 , 10246,39 , 10285,49 , 10334,20 , 316,8 , 284,8 , 977,7 , 5,17 , 22,23 , {83,71,68}, 6,1 , 14081,61 , 8,5 , 4,0 , 4126,5 , 4145,11 , 2, 1, 7, 6, 7 }, // Tamil/Tamil/Singapore
- { 117, 27, 198, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 707,13 , 707,13 , 269,6 , 192,18 , 37,5 , 8,10 , 19450,58 , 19508,86 , 19594,31 , 19450,58 , 19508,86 , 19594,31 , 10246,39 , 10285,49 , 10334,20 , 10246,39 , 10285,49 , 10334,20 , 316,8 , 284,8 , 977,7 , 5,17 , 22,23 , {76,75,82}, 307,3 , 14142,49 , 8,5 , 4,0 , 4126,5 , 4156,6 , 2, 1, 1, 6, 7 }, // Tamil/Tamil/Sri Lanka
- { 118, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 720,9 , 720,9 , 495,10 , 1226,23 , 55,4 , 59,9 , 19625,62 , 19687,81 , 158,27 , 19625,62 , 19687,81 , 158,27 , 10354,36 , 10390,56 , 10446,14 , 10354,36 , 10390,56 , 10446,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 14191,21 , 0,4 , 4,0 , 4162,5 , 3510,6 , 2, 1, 1, 6, 7 }, // Tatar/Cyrillic/Russia
- { 119, 28, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 729,11 , 729,11 , 339,8 , 1249,18 , 18,7 , 25,12 , 19768,62 , 19830,86 , 19916,31 , 19768,62 , 19830,86 , 19916,31 , 10460,32 , 10492,60 , 10552,18 , 10460,32 , 10492,60 , 10552,18 , 0,2 , 0,2 , 984,7 , 991,29 , 22,23 , {73,78,82}, 121,1 , 14212,26 , 4,4 , 4,0 , 4167,6 , 4173,8 , 2, 1, 7, 7, 7 }, // Telugu/Telugu/India
- { 120, 30, 211, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 123,5 , 123,5 , 740,8 , 748,7 , 269,6 , 1267,19 , 37,5 , 469,28 , 19947,63 , 20010,98 , 19947,63 , 19947,63 , 20010,98 , 19947,63 , 10570,23 , 10593,68 , 10661,16 , 10570,23 , 10593,68 , 10661,16 , 324,10 , 292,10 , 1020,4 , 5,17 , 22,23 , {84,72,66}, 310,1 , 14238,16 , 4,4 , 4,0 , 4181,3 , 4181,3 , 2, 1, 7, 6, 7 }, // Thai/Thai/Thailand
- { 121, 31, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1286,23 , 18,7 , 25,12 , 2675,63 , 20108,159 , 158,27 , 2675,63 , 20267,147 , 158,27 , 10677,51 , 10728,79 , 10807,27 , 10677,51 , 10728,79 , 10807,27 , 334,7 , 302,8 , 45,4 , 5,17 , 22,23 , {67,78,89}, 311,1 , 14254,13 , 8,5 , 4,0 , 4184,8 , 4192,6 , 2, 1, 7, 6, 7 }, // Tibetan/Tibetan/China
- { 121, 31, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1286,23 , 18,7 , 25,12 , 2675,63 , 20108,159 , 158,27 , 2675,63 , 20267,147 , 158,27 , 10677,51 , 10728,79 , 10807,27 , 10677,51 , 10728,79 , 10807,27 , 334,7 , 302,8 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 14267,19 , 8,5 , 4,0 , 4184,8 , 4198,7 , 2, 1, 7, 7, 7 }, // Tibetan/Tibetan/India
- { 122, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 1309,23 , 18,7 , 25,12 , 20414,36 , 20450,54 , 20504,24 , 20414,36 , 20450,54 , 20504,24 , 10834,21 , 10855,29 , 10884,14 , 10834,21 , 10855,29 , 10898,14 , 341,7 , 310,7 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,2 , 14286,16 , 4,4 , 4,0 , 4205,4 , 92,5 , 2, 1, 7, 6, 7 }, // Tigrinya/Ethiopic/Ethiopia
- { 122, 14, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 1309,23 , 18,7 , 25,12 , 20414,36 , 20450,54 , 20504,24 , 20414,36 , 20450,54 , 20504,24 , 10834,21 , 10855,29 , 10898,14 , 10834,21 , 10855,29 , 10898,14 , 341,7 , 310,7 , 45,4 , 5,17 , 22,23 , {69,82,78}, 41,3 , 0,7 , 4,4 , 4,0 , 4205,4 , 4209,4 , 2, 1, 1, 6, 7 }, // Tigrinya/Ethiopic/Eritrea
- { 123, 7, 214, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 755,8 , 755,8 , 755,8 , 755,8 , 269,6 , 97,16 , 18,7 , 25,12 , 20528,51 , 20579,87 , 20666,24 , 20528,51 , 20579,87 , 20666,24 , 10912,29 , 10941,60 , 11001,14 , 10912,29 , 10941,60 , 11001,14 , 348,10 , 317,6 , 1024,5 , 1029,59 , 1088,65 , {84,79,80}, 194,2 , 14302,41 , 13,5 , 4,0 , 4213,13 , 1640,5 , 2, 1, 1, 6, 7 }, // Tongan/Latin/Tonga
- { 124, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Tsonga/Latin/South Africa
- { 125, 7, 217, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 763,8 , 763,8 , 1332,9 , 1341,16 , 37,5 , 8,10 , 20690,48 , 20738,75 , 20813,24 , 20690,48 , 20738,75 , 20813,24 , 11015,28 , 11043,54 , 11097,14 , 11015,28 , 11043,54 , 11097,14 , 358,2 , 323,2 , 199,4 , 5,17 , 22,23 , {84,82,89}, 241,1 , 14343,40 , 4,4 , 4,0 , 4226,6 , 4232,7 , 2, 1, 1, 6, 7 }, // Turkish/Latin/Turkey
- { 125, 7, 56, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 763,8 , 763,8 , 1332,9 , 1341,16 , 18,7 , 25,12 , 20690,48 , 20738,75 , 20813,24 , 20690,48 , 20738,75 , 20813,24 , 11015,28 , 11043,54 , 11097,14 , 11015,28 , 11043,54 , 11097,14 , 358,2 , 323,2 , 199,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 4,4 , 4,0 , 4226,6 , 4239,6 , 2, 1, 1, 6, 7 }, // Turkish/Latin/Cyprus
- { 126, 7, 218, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8220, 8221, 0,6 , 0,6 , 771,8 , 771,8 , 495,10 , 1341,16 , 37,5 , 8,10 , 20837,50 , 20887,77 , 20964,24 , 20988,51 , 21039,77 , 20964,24 , 11111,28 , 11139,54 , 11193,14 , 11207,28 , 11235,54 , 11193,14 , 360,13 , 325,14 , 1153,4 , 5,17 , 22,23 , {84,77,84}, 312,3 , 14383,49 , 13,5 , 4,0 , 4245,12 , 4257,12 , 2, 1, 1, 6, 7 }, // Turkmen/Latin/Turkmenistan
- { 128, 1, 44, 46, 44, 59, 37, 48, 45, 43, 101, 187, 171, 8250, 8249, 0,6 , 0,6 , 200,10 , 210,9 , 53,10 , 1357,17 , 18,7 , 25,12 , 21116,84 , 21116,84 , 158,27 , 21116,84 , 21116,84 , 158,27 , 11289,21 , 11310,55 , 11365,14 , 11289,21 , 11310,55 , 11365,14 , 373,12 , 339,12 , 45,4 , 5,17 , 22,23 , {67,78,89}, 133,1 , 14432,40 , 4,4 , 4,0 , 4269,8 , 4277,5 , 2, 1, 7, 6, 7 }, // Uighur/Arabic/China
- { 129, 2, 222, 44, 160, 59, 37, 48, 45, 43, 1077, 171, 187, 8222, 8220, 0,6 , 0,6 , 138,7 , 138,7 , 156,8 , 1374,22 , 37,5 , 8,10 , 21200,48 , 21248,95 , 21343,24 , 21367,67 , 21434,87 , 21521,24 , 1427,21 , 11379,56 , 11435,14 , 1427,21 , 11379,56 , 11435,14 , 385,2 , 351,2 , 1157,5 , 680,17 , 22,23 , {85,65,72}, 280,1 , 14472,49 , 13,5 , 4,0 , 4282,10 , 4292,7 , 2, 1, 1, 6, 7 }, // Ukrainian/Cyrillic/Ukraine
- { 130, 1, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 779,10 , 789,9 , 269,6 , 1396,18 , 18,7 , 25,12 , 21545,68 , 21545,68 , 134,24 , 21545,68 , 21545,68 , 134,24 , 11449,36 , 11449,36 , 85,14 , 11449,36 , 11449,36 , 85,14 , 0,2 , 0,2 , 1162,4 , 1166,20 , 22,23 , {80,75,82}, 175,2 , 14521,49 , 4,4 , 4,0 , 4299,4 , 3226,7 , 2, 0, 7, 6, 7 }, // Urdu/Arabic/Pakistan
- { 130, 1, 100, 1643, 1644, 59, 37, 1776, 45, 43, 101, 8221, 8220, 8217, 8216, 46,6 , 46,6 , 798,6 , 798,6 , 269,6 , 1396,18 , 18,7 , 25,12 , 21545,68 , 21545,68 , 134,24 , 21545,68 , 21545,68 , 134,24 , 11449,36 , 11449,36 , 85,14 , 11449,36 , 11449,36 , 85,14 , 0,2 , 0,2 , 1162,4 , 1166,20 , 22,23 , {73,78,82}, 121,1 , 14570,42 , 8,5 , 4,0 , 4299,4 , 4303,5 , 2, 1, 7, 7, 7 }, // Urdu/Arabic/India
- { 131, 7, 228, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8217, 8216, 0,6 , 0,6 , 804,8 , 804,8 , 27,8 , 1414,18 , 37,5 , 430,11 , 21613,48 , 21661,75 , 21736,24 , 21760,48 , 21808,75 , 21736,24 , 11485,32 , 11517,61 , 11578,14 , 11485,32 , 11517,61 , 11578,14 , 387,2 , 353,2 , 199,4 , 5,17 , 22,23 , {85,90,83}, 315,4 , 14612,58 , 13,5 , 4,0 , 4308,6 , 4314,11 , 2, 0, 1, 6, 7 }, // Uzbek/Latin/Uzbekistan
- { 131, 1, 1, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 394,8 , 1432,33 , 55,4 , 430,11 , 21883,47 , 15102,68 , 158,27 , 21883,47 , 15102,68 , 158,27 , 11592,21 , 7766,49 , 85,14 , 11592,21 , 7766,49 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {65,70,78}, 256,1 , 14670,13 , 13,5 , 4,0 , 4325,6 , 3217,9 , 0, 0, 6, 4, 5 }, // Uzbek/Arabic/Afghanistan
- { 131, 2, 228, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 696,19 , 37,5 , 87,12 , 21930,48 , 21978,71 , 11058,24 , 21930,48 , 21978,71 , 11058,24 , 11613,28 , 11641,53 , 11694,14 , 11613,28 , 11641,53 , 11694,14 , 389,2 , 355,2 , 45,4 , 5,17 , 22,23 , {85,90,83}, 319,3 , 14683,49 , 13,5 , 4,0 , 4331,7 , 4338,10 , 2, 0, 1, 6, 7 }, // Uzbek/Cyrillic/Uzbekistan
- { 132, 7, 232, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 812,8 , 812,8 , 119,10 , 192,18 , 37,5 , 8,10 , 22049,75 , 22124,99 , 158,27 , 22223,75 , 22298,99 , 158,27 , 11708,33 , 11741,55 , 11796,21 , 11708,33 , 11741,55 , 11796,21 , 391,2 , 357,2 , 45,4 , 5,17 , 22,23 , {86,78,68}, 322,1 , 14732,33 , 13,5 , 4,0 , 4348,10 , 4358,8 , 0, 0, 1, 6, 7 }, // Vietnamese/Latin/Vietnam
- { 133, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1465,23 , 37,5 , 8,10 , 22397,48 , 22445,74 , 22519,24 , 22543,48 , 22445,74 , 22519,24 , 11817,21 , 11838,43 , 11881,14 , 11895,28 , 11838,43 , 11881,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 4366,7 , 0,0 , 2, 1, 1, 6, 7 }, // Volapuk/Latin/World
- { 134, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 820,11 , 831,10 , 27,8 , 10,17 , 37,5 , 8,10 , 22591,52 , 22643,87 , 22730,26 , 22756,59 , 22643,87 , 22730,26 , 11923,29 , 11952,77 , 12029,15 , 12044,30 , 11952,77 , 12029,15 , 393,2 , 359,2 , 1186,7 , 5,17 , 22,23 , {71,66,80}, 119,1 , 14765,92 , 4,4 , 4,0 , 4373,7 , 4380,16 , 2, 1, 1, 6, 7 }, // Welsh/Latin/United Kingdom
- { 135, 7, 187, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 528,10 , 1488,17 , 37,5 , 8,10 , 22815,47 , 22862,84 , 158,27 , 22815,47 , 22862,84 , 158,27 , 12074,28 , 12102,50 , 12074,28 , 12074,28 , 12102,50 , 12074,28 , 395,3 , 361,3 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 14857,65 , 8,5 , 4,0 , 4396,5 , 4401,8 , 0, 0, 1, 6, 7 }, // Wolof/Latin/Senegal
- { 136, 7, 195, 46, 160, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 22946,48 , 22994,91 , 158,27 , 22946,48 , 22994,91 , 158,27 , 12152,28 , 12180,61 , 85,14 , 12152,28 , 12180,61 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 14922,79 , 4,4 , 4,0 , 4409,8 , 4417,15 , 2, 1, 7, 6, 7 }, // Xhosa/Latin/South Africa
- { 137, 18, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 841,9 , 841,9 , 27,8 , 1505,19 , 37,5 , 8,10 , 23085,58 , 23143,92 , 158,27 , 23143,92 , 23143,92 , 158,27 , 12241,54 , 12241,54 , 85,14 , 12241,54 , 12241,54 , 85,14 , 398,11 , 364,10 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 41,6 , 4,0 , 4432,6 , 4438,5 , 2, 1, 1, 6, 7 }, // Yiddish/Hebrew/World
- { 138, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 1524,16 , 497,3 , 8,10 , 23235,40 , 23275,73 , 23348,27 , 23375,55 , 23430,121 , 23348,27 , 12295,33 , 12328,44 , 12372,14 , 12295,33 , 12386,69 , 12372,14 , 409,5 , 374,5 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 15001,35 , 4,4 , 4,0 , 4443,10 , 4453,19 , 2, 1, 1, 6, 7 }, // Yoruba/Latin/Nigeria
- { 138, 7, 23, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 1524,16 , 497,3 , 8,10 , 23551,41 , 23592,74 , 23666,27 , 23693,56 , 23749,134 , 23666,27 , 12455,33 , 12488,44 , 12532,14 , 12455,33 , 12546,69 , 12532,14 , 414,5 , 379,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 15036,34 , 4,4 , 4,0 , 4443,10 , 4472,16 , 0, 0, 1, 6, 7 }, // Yoruba/Latin/Benin
- { 140, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 850,9 , 859,8 , 547,6 , 35,18 , 37,5 , 8,10 , 23883,48 , 23931,91 , 134,24 , 23883,48 , 23931,91 , 24022,24 , 12615,28 , 12643,74 , 12717,14 , 12615,28 , 12643,74 , 12717,14 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {90,65,82}, 5,1 , 15070,67 , 4,4 , 4,0 , 4488,7 , 4495,17 , 2, 1, 7, 6, 7 }, // Zulu/Latin/South Africa
- { 141, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 192,8 , 192,8 , 495,10 , 478,17 , 37,5 , 441,16 , 5656,48 , 14503,83 , 134,24 , 24046,59 , 14503,83 , 134,24 , 12731,28 , 12759,51 , 2293,14 , 12810,28 , 12759,51 , 2293,14 , 419,9 , 384,11 , 45,4 , 5,17 , 22,23 , {78,79,75}, 189,2 , 9895,44 , 13,5 , 4,0 , 4512,7 , 4519,5 , 2, 0, 1, 6, 7 }, // Norwegian Nynorsk/Latin/Norway
- { 142, 7, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8221, 8216, 8217, 0,6 , 0,6 , 163,7 , 163,7 , 1540,11 , 450,19 , 37,5 , 8,10 , 8336,48 , 24105,83 , 9742,24 , 8336,48 , 24105,83 , 9742,24 , 2016,28 , 2044,58 , 2102,14 , 2016,28 , 2044,58 , 2116,14 , 428,10 , 395,7 , 296,7 , 5,17 , 22,23 , {66,65,77}, 140,2 , 15137,170 , 13,5 , 4,0 , 4524,8 , 630,19 , 2, 1, 1, 6, 7 }, // Bosnian/Latin/Bosnia And Herzegowina
- { 142, 2, 27, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 116,7 , 116,7 , 1084,7 , 1091,20 , 37,5 , 8,10 , 24188,48 , 24236,83 , 12698,24 , 24188,48 , 24236,83 , 12698,24 , 12838,28 , 12866,56 , 8872,14 , 12838,28 , 12866,56 , 8872,14 , 234,9 , 402,7 , 45,4 , 5,17 , 22,23 , {66,65,77}, 281,2 , 15307,151 , 13,5 , 4,0 , 4532,8 , 3607,19 , 2, 1, 1, 6, 7 }, // Bosnian/Cyrillic/Bosnia And Herzegowina
- { 143, 29, 131, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,86,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 5, 6, 7 }, // Divehi/Thaana/Maldives
- { 144, 7, 251, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 80,17 , 37,5 , 8,10 , 24319,102 , 24421,140 , 158,27 , 24319,102 , 24421,140 , 158,27 , 12922,30 , 12952,57 , 85,14 , 12922,30 , 12952,57 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {71,66,80}, 119,1 , 0,7 , 4,4 , 4,0 , 4540,5 , 4545,12 , 2, 1, 1, 6, 7 }, // Manx/Latin/Isle Of Man
- { 145, 7, 224, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 97,16 , 37,5 , 8,10 , 24561,46 , 24607,130 , 158,27 , 24561,46 , 24607,130 , 158,27 , 13009,28 , 13037,61 , 85,14 , 13009,28 , 13037,61 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {71,66,80}, 119,1 , 0,7 , 4,4 , 4,0 , 4557,8 , 4565,14 , 2, 1, 1, 6, 7 }, // Cornish/Latin/United Kingdom
- { 146, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1551,8 , 1559,18 , 18,7 , 25,12 , 24737,48 , 24785,192 , 158,27 , 24737,48 , 24785,192 , 158,27 , 13098,28 , 13126,49 , 13175,14 , 13098,28 , 13126,49 , 13175,14 , 438,2 , 409,2 , 45,4 , 5,17 , 22,23 , {71,72,83}, 163,3 , 15458,17 , 4,4 , 4,0 , 4579,4 , 4583,5 , 2, 1, 1, 6, 7 }, // Akan/Latin/Ghana
- { 147, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 1577,6 , 97,16 , 18,7 , 25,12 , 24977,88 , 24977,88 , 158,27 , 24977,88 , 24977,88 , 158,27 , 13189,49 , 13189,49 , 13238,20 , 13189,49 , 13189,49 , 13238,20 , 187,5 , 411,5 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 15475,13 , 8,5 , 4,0 , 4588,6 , 2667,4 , 2, 1, 7, 7, 7 }, // Konkani/Devanagari/India
- { 148, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,72,83}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Ga/Latin/Ghana
- { 149, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 867,9 , 690,8 , 269,6 , 10,17 , 37,5 , 8,10 , 25065,48 , 25113,87 , 25200,24 , 25065,48 , 25113,87 , 25200,24 , 13258,33 , 13291,58 , 85,14 , 13258,33 , 13291,58 , 85,14 , 440,7 , 416,7 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 15488,12 , 4,4 , 4,0 , 4594,10 , 4604,8 , 2, 1, 1, 6, 7 }, // Igbo/Latin/Nigeria
- { 150, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 25224,48 , 25272,189 , 25461,24 , 25224,48 , 25272,189 , 25461,24 , 13349,28 , 13377,74 , 13451,14 , 13349,28 , 13377,74 , 13451,14 , 447,9 , 423,7 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15500,23 , 4,4 , 4,0 , 4612,7 , 1192,5 , 2, 1, 7, 6, 7 }, // Kamba/Latin/Kenya
- { 151, 33, 103, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,81,68}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 6 }, // Syriac/Syriac/Iraq
- { 152, 14, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,82,78}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Blin/Ethiopic/Eritrea
- { 153, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Geez/Ethiopic/Ethiopia
- { 155, 7, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Sidamo/Latin/Ethiopia
- { 156, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Atsam/Latin/Nigeria
- { 157, 14, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,82,78}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Tigre/Ethiopic/Eritrea
- { 158, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Jju/Latin/Nigeria
- { 159, 7, 106, 44, 46, 59, 37, 48, 45, 43, 101, 8216, 8217, 8220, 8221, 0,6 , 0,6 , 254,7 , 254,7 , 27,8 , 1583,27 , 37,5 , 8,10 , 25485,48 , 25533,77 , 25610,24 , 25485,48 , 25533,77 , 25610,24 , 13465,28 , 13493,50 , 3080,14 , 13465,28 , 13493,50 , 3080,14 , 456,2 , 430,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 8,5 , 4,0 , 4619,6 , 4625,6 , 2, 1, 1, 6, 7 }, // Friulian/Latin/Italy
- { 160, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Venda/Latin/South Africa
- { 161, 7, 83, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 876,11 , 887,10 , 547,6 , 1610,23 , 500,12 , 512,17 , 25634,48 , 25682,87 , 25769,24 , 25634,48 , 25682,87 , 25769,24 , 13543,28 , 13571,44 , 13615,14 , 13543,28 , 13571,44 , 13615,14 , 458,3 , 432,5 , 45,4 , 5,17 , 22,23 , {71,72,83}, 163,3 , 15523,37 , 4,4 , 4,0 , 4631,6 , 4637,12 , 2, 1, 1, 6, 7 }, // Ewe/Latin/Ghana
- { 161, 7, 212, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 876,11 , 887,10 , 547,6 , 1610,23 , 37,5 , 8,10 , 25634,48 , 25682,87 , 25769,24 , 25634,48 , 25682,87 , 25769,24 , 13543,28 , 13571,44 , 13615,14 , 13543,28 , 13571,44 , 13615,14 , 458,3 , 432,5 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 15560,106 , 4,4 , 4,0 , 4631,6 , 4649,11 , 0, 0, 1, 6, 7 }, // Ewe/Latin/Togo
- { 162, 14, 69, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,84,66}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Walamo/Ethiopic/Ethiopia
- { 163, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 269,6 , 10,17 , 18,7 , 25,12 , 25793,59 , 25852,95 , 158,27 , 25793,59 , 25852,95 , 158,27 , 13629,21 , 13650,57 , 85,14 , 13629,21 , 13650,57 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 4,4 , 4,0 , 4660,14 , 4674,19 , 2, 1, 7, 6, 7 }, // Hawaiian/Latin/United States
- { 164, 7, 157, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Tyap/Latin/Nigeria
- { 165, 7, 129, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,87,75}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Nyanja/Latin/Malawi
- { 166, 7, 170, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 897,9 , 906,8 , 547,6 , 35,18 , 18,7 , 25,12 , 25947,48 , 25995,88 , 26083,38 , 25947,48 , 25995,88 , 25947,48 , 13707,28 , 13735,55 , 13707,28 , 13707,28 , 13735,55 , 13707,28 , 0,2 , 0,2 , 0,5 , 5,17 , 22,23 , {80,72,80}, 178,1 , 15666,58 , 4,4 , 4,0 , 4693,8 , 4701,9 , 2, 1, 7, 6, 7 }, // Filipino/Latin/Philippines
- { 167, 7, 206, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 26121,86 , 134,24 , 7601,48 , 26121,86 , 134,24 , 13790,28 , 13818,63 , 3668,14 , 13790,28 , 13818,63 , 3668,14 , 461,12 , 437,11 , 45,4 , 5,17 , 22,23 , {67,72,70}, 225,3 , 15724,55 , 13,5 , 4,0 , 4710,16 , 4726,7 , 2, 0, 1, 6, 7 }, // Swiss German/Latin/Switzerland
- { 167, 7, 74, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 26121,86 , 134,24 , 7601,48 , 26121,86 , 134,24 , 13790,28 , 13818,63 , 3668,14 , 13790,28 , 13818,63 , 3668,14 , 461,12 , 437,11 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 13,5 , 4,0 , 4710,16 , 4733,10 , 2, 1, 1, 6, 7 }, // Swiss German/Latin/France
- { 167, 7, 123, 46, 8217, 59, 37, 48, 8722, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 269,9 , 269,9 , 156,8 , 622,18 , 37,5 , 8,10 , 7601,48 , 26121,86 , 134,24 , 7601,48 , 26121,86 , 134,24 , 13790,28 , 13818,63 , 3668,14 , 13790,28 , 13818,63 , 3668,14 , 461,12 , 437,11 , 45,4 , 5,17 , 22,23 , {67,72,70}, 225,3 , 15724,55 , 13,5 , 4,0 , 4710,16 , 4743,13 , 2, 0, 1, 6, 7 }, // Swiss German/Latin/Liechtenstein
- { 168, 34, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 26207,38 , 26207,38 , 158,27 , 26207,38 , 26207,38 , 158,27 , 13881,21 , 13902,28 , 13930,14 , 13881,21 , 13902,28 , 13930,14 , 473,2 , 448,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 311,1 , 0,7 , 8,5 , 4,0 , 4756,3 , 4759,2 , 2, 1, 7, 6, 7 }, // Sichuan Yi/Yi/China
- { 169, 7, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Kpelle/Latin/Liberia
- { 170, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 461,8 , 461,8 , 365,7 , 1633,23 , 529,10 , 539,19 , 26245,59 , 26304,85 , 134,24 , 26245,59 , 26304,85 , 134,24 , 13944,28 , 13972,65 , 3668,14 , 13944,28 , 13972,65 , 3668,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15779,15 , 13,5 , 4,0 , 4761,14 , 4775,11 , 2, 1, 1, 6, 7 }, // Low German/Latin/Germany
- { 170, 7, 151, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 461,8 , 461,8 , 365,7 , 1633,23 , 529,10 , 539,19 , 26245,59 , 26304,85 , 134,24 , 26245,59 , 26304,85 , 134,24 , 13944,28 , 13972,65 , 3668,14 , 13944,28 , 13972,65 , 3668,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15779,15 , 13,5 , 4,0 , 4761,14 , 4786,12 , 2, 1, 1, 6, 7 }, // Low German/Latin/Netherlands
- { 171, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // South Ndebele/Latin/South Africa
- { 172, 7, 195, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {90,65,82}, 5,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Northern Sotho/Latin/South Africa
- { 173, 7, 161, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 228,8 , 228,8 , 53,10 , 63,17 , 37,5 , 8,10 , 26389,59 , 26448,145 , 26593,24 , 26389,59 , 26448,145 , 26593,24 , 14037,33 , 14070,75 , 14145,14 , 14037,33 , 14070,75 , 14145,14 , 475,11 , 450,13 , 45,4 , 5,17 , 22,23 , {78,79,75}, 189,2 , 15794,63 , 13,5 , 4,0 , 4798,15 , 4813,5 , 2, 0, 1, 6, 7 }, // Northern Sami/Latin/Norway
- { 173, 7, 73, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 228,8 , 228,8 , 495,10 , 97,16 , 37,5 , 8,10 , 26617,60 , 26448,145 , 26593,24 , 26617,60 , 26448,145 , 26593,24 , 14159,21 , 14180,70 , 14250,14 , 14159,21 , 14180,70 , 14250,14 , 486,2 , 463,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 15857,23 , 13,5 , 4,0 , 4798,15 , 4818,6 , 2, 1, 1, 6, 7 }, // Northern Sami/Latin/Finland
- { 173, 7, 205, 44, 160, 59, 37, 48, 8722, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 228,8 , 228,8 , 53,10 , 63,17 , 37,5 , 8,10 , 26389,59 , 26448,145 , 26593,24 , 26389,59 , 26448,145 , 26593,24 , 14037,33 , 14070,75 , 14145,14 , 14037,33 , 14070,75 , 14145,14 , 475,11 , 450,13 , 45,4 , 5,17 , 22,23 , {83,69,75}, 189,2 , 15880,63 , 13,5 , 4,0 , 4798,15 , 4824,6 , 2, 0, 1, 6, 7 }, // Northern Sami/Latin/Sweden
- { 174, 7, 208, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {84,87,68}, 323,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Taroko/Latin/Taiwan
- { 175, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 26677,48 , 26725,88 , 26813,24 , 26677,48 , 26725,88 , 26813,24 , 14264,28 , 14292,62 , 14354,14 , 14264,28 , 14292,62 , 14354,14 , 488,6 , 465,3 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15943,24 , 4,4 , 4,0 , 4830,8 , 1192,5 , 2, 1, 7, 6, 7 }, // Gusii/Latin/Kenya
- { 176, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 26837,48 , 26885,221 , 27106,24 , 26837,48 , 26885,221 , 27106,24 , 14368,28 , 14396,105 , 14501,14 , 14368,28 , 14396,105 , 14501,14 , 494,10 , 468,10 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15943,24 , 4,4 , 4,0 , 4838,7 , 1192,5 , 2, 1, 7, 6, 7 }, // Taita/Latin/Kenya
- { 177, 7, 187, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 15967,26 , 13,5 , 4,0 , 4845,6 , 4401,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Senegal
- { 177, 7, 34, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 15967,26 , 13,5 , 4,0 , 4845,6 , 4851,14 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Burkina Faso
- { 177, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 15993,25 , 13,5 , 4,0 , 4845,6 , 4865,8 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Cameroon
- { 177, 7, 80, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {71,77,68}, 162,1 , 16018,20 , 13,5 , 4,0 , 4845,6 , 4873,6 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Gambia
- { 177, 7, 83, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {71,72,83}, 163,3 , 0,7 , 13,5 , 4,0 , 4845,6 , 4879,5 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Ghana
- { 177, 7, 91, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {71,78,70}, 215,2 , 0,7 , 13,5 , 4,0 , 4845,6 , 4884,4 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Guinea
- { 177, 7, 92, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 15967,26 , 13,5 , 4,0 , 4845,6 , 4888,12 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Guinea Bissau
- { 177, 7, 121, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 16038,23 , 13,5 , 4,0 , 4845,6 , 4900,9 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Liberia
- { 177, 7, 136, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {77,82,85}, 218,2 , 16061,22 , 13,5 , 4,0 , 4845,6 , 4909,8 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Mauritania
- { 177, 7, 156, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 15967,26 , 13,5 , 4,0 , 4845,6 , 4917,6 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Niger
- { 177, 7, 157, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {78,71,78}, 177,1 , 16083,23 , 13,5 , 4,0 , 4845,6 , 4923,9 , 2, 1, 1, 6, 7 }, // Fulah/Latin/Nigeria
- { 177, 7, 189, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 18,7 , 25,12 , 27130,48 , 27178,77 , 27255,24 , 27130,48 , 27178,77 , 27255,24 , 14515,28 , 14543,59 , 14602,14 , 14515,28 , 14543,59 , 14602,14 , 504,6 , 478,7 , 45,4 , 5,17 , 22,23 , {83,76,76}, 186,2 , 16106,25 , 13,5 , 4,0 , 4845,6 , 4932,11 , 0, 0, 1, 6, 7 }, // Fulah/Latin/Sierra Leone
- { 177, 134, 91, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,78,70}, 215,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Fulah/Adlam/Guinea
- { 178, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 27279,48 , 27327,185 , 27512,24 , 27279,48 , 27327,185 , 27512,24 , 14616,28 , 14644,63 , 14707,14 , 14616,28 , 14644,63 , 14707,14 , 510,6 , 485,8 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16131,23 , 4,4 , 4,0 , 4943,6 , 1192,5 , 2, 1, 7, 6, 7 }, // Kikuyu/Latin/Kenya
- { 179, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 27536,48 , 27584,173 , 27757,24 , 27536,48 , 27584,173 , 27757,24 , 14721,28 , 14749,105 , 14854,14 , 14721,28 , 14749,105 , 14854,14 , 516,7 , 493,5 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16154,25 , 4,4 , 4,0 , 4949,8 , 1192,5 , 2, 1, 7, 6, 7 }, // Samburu/Latin/Kenya
- { 180, 7, 146, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 669,27 , 37,5 , 8,10 , 27781,48 , 27829,88 , 134,24 , 27781,48 , 27829,88 , 134,24 , 14868,28 , 14896,55 , 14951,14 , 14868,28 , 14896,55 , 14951,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,90,78}, 266,3 , 16179,28 , 0,4 , 4,0 , 4957,4 , 3357,10 , 2, 1, 7, 6, 7 }, // Sena/Latin/Mozambique
- { 181, 7, 240, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 27917,52 , 27969,112 , 28081,24 , 27917,52 , 27969,112 , 28081,24 , 14965,28 , 14993,50 , 15043,14 , 14965,28 , 14993,50 , 15043,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 155,3 , 16207,24 , 4,4 , 4,0 , 4961,10 , 1820,8 , 2, 1, 7, 6, 7 }, // North Ndebele/Latin/Zimbabwe
- { 182, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 28105,39 , 28144,194 , 28338,24 , 28105,39 , 28144,194 , 28338,24 , 15057,29 , 15086,65 , 15151,14 , 15057,29 , 15086,65 , 15151,14 , 523,8 , 498,7 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16231,25 , 4,4 , 4,0 , 4971,9 , 1625,8 , 2, 0, 1, 6, 7 }, // Rombo/Latin/Tanzania
- { 183, 9, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 28362,48 , 28410,81 , 28491,24 , 28362,48 , 28410,81 , 28491,24 , 15165,30 , 15195,47 , 85,14 , 15165,30 , 15195,47 , 85,14 , 531,6 , 505,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16256,21 , 0,4 , 4,0 , 4980,7 , 4987,6 , 2, 1, 1, 6, 7 }, // Tachelhit/Tifinagh/Morocco
- { 183, 7, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 28515,48 , 28563,81 , 28644,24 , 28515,48 , 28563,81 , 28644,24 , 15242,30 , 15272,48 , 85,14 , 15242,30 , 15272,48 , 85,14 , 537,6 , 513,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16277,21 , 0,4 , 4,0 , 4993,10 , 5003,6 , 2, 1, 1, 6, 7 }, // Tachelhit/Latin/Morocco
- { 184, 7, 3, 44, 160, 59, 37, 48, 45, 43, 122, 171, 187, 8220, 8221, 0,6 , 0,6 , 914,12 , 926,11 , 415,8 , 97,16 , 18,7 , 25,12 , 28668,48 , 28716,82 , 28798,24 , 28822,48 , 28870,84 , 28954,24 , 15320,28 , 15348,34 , 15382,14 , 15396,30 , 15426,51 , 15477,14 , 543,7 , 521,9 , 1193,7 , 1200,21 , 22,23 , {68,90,68}, 204,2 , 16298,53 , 0,4 , 4,0 , 5009,9 , 5018,8 , 2, 1, 6, 5, 6 }, // Kabyle/Latin/Algeria
- { 185, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 28978,48 , 29026,152 , 134,24 , 28978,48 , 29026,152 , 134,24 , 15491,28 , 15519,74 , 15593,14 , 15491,28 , 15519,74 , 15593,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 196,3 , 16351,26 , 4,4 , 4,0 , 5026,10 , 1690,6 , 0, 0, 1, 6, 7 }, // Nyankole/Latin/Uganda
- { 186, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 29178,48 , 29226,254 , 29480,24 , 29178,48 , 29226,254 , 29480,24 , 15607,28 , 15635,82 , 15717,14 , 15607,28 , 15635,82 , 15717,14 , 550,7 , 530,7 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16377,29 , 0,4 , 4,0 , 5036,6 , 5042,10 , 2, 0, 1, 6, 7 }, // Bena/Latin/Tanzania
- { 187, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 29504,87 , 134,24 , 19102,48 , 29504,87 , 134,24 , 15731,28 , 15759,62 , 15821,14 , 15731,28 , 15759,62 , 15821,14 , 557,5 , 537,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16406,27 , 4,4 , 4,0 , 5052,8 , 1625,8 , 2, 0, 1, 6, 7 }, // Vunjo/Latin/Tanzania
- { 188, 7, 132, 46, 44, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 29591,47 , 29638,92 , 29730,24 , 29591,47 , 29638,92 , 29730,24 , 15835,28 , 15863,44 , 15907,14 , 15835,28 , 15863,44 , 15907,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 16433,24 , 4,4 , 4,0 , 5060,9 , 2189,4 , 0, 0, 1, 6, 7 }, // Bambara/Latin/Mali
- { 188, 75, 132, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Bambara/Nko/Mali
- { 189, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 29754,48 , 29802,207 , 30009,24 , 29754,48 , 29802,207 , 30009,24 , 15921,28 , 15949,64 , 16013,14 , 15921,28 , 15949,64 , 16013,14 , 562,2 , 546,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15943,24 , 4,4 , 4,0 , 5069,6 , 1192,5 , 2, 1, 7, 6, 7 }, // Embu/Latin/Kenya
- { 190, 12, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 937,9 , 946,8 , 547,6 , 35,18 , 18,7 , 25,12 , 30033,36 , 30069,58 , 30127,24 , 30033,36 , 30069,58 , 30127,24 , 16027,28 , 16055,49 , 16104,14 , 16027,28 , 16055,49 , 16104,14 , 564,3 , 548,6 , 1221,6 , 5,17 , 22,23 , {85,83,68}, 6,1 , 16457,25 , 4,4 , 4,0 , 5075,3 , 5078,15 , 2, 1, 7, 6, 7 }, // Cherokee/Cherokee/United States
- { 191, 7, 137, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 30151,47 , 30198,68 , 30266,24 , 30151,47 , 30198,68 , 30266,24 , 16118,27 , 16145,48 , 16193,14 , 16118,27 , 16145,48 , 16193,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {77,85,82}, 175,2 , 16482,21 , 41,6 , 4,0 , 5093,14 , 5107,5 , 2, 0, 1, 6, 7 }, // Morisyen/Latin/Mauritius
- { 192, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 30290,264 , 134,24 , 19102,48 , 30290,264 , 134,24 , 16207,28 , 16235,133 , 15151,14 , 16207,28 , 16235,133 , 15151,14 , 567,4 , 554,5 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16406,27 , 4,4 , 4,0 , 5112,10 , 1625,8 , 2, 0, 1, 6, 7 }, // Makonde/Latin/Tanzania
- { 193, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8221, 8221, 8217, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 30554,83 , 30637,111 , 30748,24 , 30554,83 , 30637,111 , 30748,24 , 16368,36 , 16404,63 , 16467,14 , 16368,36 , 16404,63 , 16467,14 , 571,3 , 559,3 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16503,29 , 41,6 , 4,0 , 5122,8 , 5130,9 , 2, 0, 1, 6, 7 }, // Langi/Latin/Tanzania
- { 194, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 30772,48 , 30820,97 , 134,24 , 30772,48 , 30820,97 , 134,24 , 16481,28 , 16509,66 , 16575,14 , 16481,28 , 16509,66 , 16575,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 196,3 , 16532,26 , 0,4 , 4,0 , 5139,7 , 5146,7 , 0, 0, 1, 6, 7 }, // Ganda/Latin/Uganda
- { 195, 7, 239, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 30917,48 , 30965,83 , 31048,24 , 30917,48 , 30965,83 , 31048,24 , 16589,80 , 16589,80 , 85,14 , 16589,80 , 16589,80 , 85,14 , 574,8 , 562,7 , 45,4 , 5,17 , 22,23 , {90,77,87}, 131,1 , 0,7 , 4,4 , 4,0 , 5153,9 , 1814,6 , 2, 1, 1, 6, 7 }, // Bemba/Latin/Zambia
- { 196, 7, 39, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 163,7 , 163,7 , 415,8 , 1656,27 , 37,5 , 8,10 , 31072,48 , 31120,85 , 134,24 , 31072,48 , 31120,85 , 134,24 , 16669,28 , 16697,73 , 16770,14 , 16669,28 , 16784,73 , 16770,14 , 68,2 , 65,2 , 45,4 , 5,17 , 22,23 , {67,86,69}, 265,1 , 16558,43 , 13,5 , 4,0 , 5162,12 , 5174,10 , 2, 1, 1, 6, 7 }, // Kabuverdianu/Latin/Cape Verde
- { 197, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 31205,48 , 31253,86 , 31339,24 , 31205,48 , 31253,86 , 31339,24 , 16857,28 , 16885,51 , 16936,14 , 16857,28 , 16885,51 , 16936,14 , 582,2 , 569,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 15943,24 , 4,4 , 4,0 , 5184,6 , 1192,5 , 2, 1, 7, 6, 7 }, // Meru/Latin/Kenya
- { 198, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 31363,49 , 31412,121 , 31533,24 , 31363,49 , 31412,121 , 31533,24 , 16950,28 , 16978,53 , 17031,14 , 16950,28 , 16978,53 , 17031,14 , 584,6 , 571,10 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16601,26 , 4,4 , 4,0 , 5190,8 , 5198,12 , 2, 1, 7, 6, 7 }, // Kalenjin/Latin/Kenya
- { 199, 7, 148, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 0,48 , 31557,136 , 134,24 , 0,48 , 31557,136 , 134,24 , 17045,23 , 17068,92 , 17160,14 , 17045,23 , 17068,92 , 17160,14 , 590,7 , 581,5 , 45,4 , 5,17 , 22,23 , {78,65,68}, 6,1 , 16627,22 , 4,4 , 4,0 , 5210,13 , 5223,8 , 2, 1, 1, 6, 7 }, // Nama/Latin/Namibia
- { 200, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 29504,87 , 134,24 , 19102,48 , 29504,87 , 134,24 , 15731,28 , 15759,62 , 15821,14 , 15731,28 , 15759,62 , 15821,14 , 557,5 , 537,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16406,27 , 4,4 , 4,0 , 5231,9 , 1625,8 , 2, 0, 1, 6, 7 }, // Machame/Latin/Tanzania
- { 201, 7, 82, 44, 160, 59, 37, 48, 8722, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 461,8 , 461,8 , 1134,10 , 1683,23 , 37,5 , 8,10 , 31693,59 , 31752,87 , 12992,24 , 31839,48 , 31752,87 , 12992,24 , 17174,28 , 17202,72 , 3668,14 , 17174,28 , 17202,72 , 3668,14 , 597,16 , 586,16 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 16649,11 , 13,5 , 4,0 , 5240,6 , 5246,11 , 2, 1, 1, 6, 7 }, // Colognian/Latin/Germany
- { 202, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 31887,51 , 31938,132 , 158,27 , 31887,51 , 31938,132 , 158,27 , 15731,28 , 17274,58 , 15151,14 , 15731,28 , 17274,58 , 15151,14 , 613,9 , 602,6 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16660,25 , 4,4 , 4,0 , 5257,3 , 1192,5 , 2, 1, 7, 6, 7 }, // Masai/Latin/Kenya
- { 202, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 31887,51 , 31938,132 , 158,27 , 31887,51 , 31938,132 , 158,27 , 15731,28 , 17274,58 , 15151,14 , 15731,28 , 17274,58 , 15151,14 , 613,9 , 602,6 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16685,28 , 4,4 , 4,0 , 5257,3 , 5260,8 , 2, 0, 1, 6, 7 }, // Masai/Latin/Tanzania
- { 203, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 30772,48 , 30820,97 , 134,24 , 30772,48 , 30820,97 , 134,24 , 17332,35 , 17367,65 , 17432,14 , 17332,35 , 17367,65 , 17432,14 , 622,6 , 608,6 , 45,4 , 5,17 , 22,23 , {85,71,88}, 196,3 , 16532,26 , 13,5 , 4,0 , 5268,7 , 5146,7 , 0, 0, 1, 6, 7 }, // Soga/Latin/Uganda
- { 204, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 32070,48 , 19150,84 , 134,24 , 32070,48 , 19150,84 , 134,24 , 17446,21 , 17467,75 , 85,14 , 17446,21 , 17467,75 , 85,14 , 64,4 , 61,4 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16713,23 , 4,4 , 96,6 , 5275,7 , 1192,5 , 2, 1, 7, 6, 7 }, // Luyia/Latin/Kenya
- { 205, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 32118,48 , 19150,84 , 134,24 , 32118,48 , 19150,84 , 134,24 , 17542,28 , 10010,60 , 15821,14 , 17542,28 , 10010,60 , 15821,14 , 628,9 , 614,8 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16736,28 , 13,5 , 4,0 , 5282,6 , 5288,8 , 2, 0, 1, 6, 7 }, // Asu/Latin/Tanzania
- { 206, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 32166,48 , 32214,94 , 32308,24 , 32166,48 , 32214,94 , 32308,24 , 17570,28 , 17598,69 , 17667,14 , 17570,28 , 17598,69 , 17667,14 , 637,9 , 622,6 , 45,4 , 5,17 , 22,23 , {85,71,88}, 196,3 , 16764,28 , 4,4 , 4,0 , 5296,6 , 1690,6 , 0, 0, 1, 6, 7 }, // Teso/Latin/Uganda
- { 206, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 32166,48 , 32214,94 , 32308,24 , 32166,48 , 32214,94 , 32308,24 , 17570,28 , 17598,69 , 17667,14 , 17570,28 , 17598,69 , 17667,14 , 637,9 , 622,6 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16792,27 , 4,4 , 4,0 , 5296,6 , 5302,5 , 2, 1, 7, 6, 7 }, // Teso/Latin/Kenya
- { 207, 7, 67, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,82,78}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Saho/Latin/Eritrea
- { 208, 7, 132, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 32332,46 , 32378,88 , 32466,24 , 32332,46 , 32378,88 , 32466,24 , 17681,28 , 17709,53 , 17762,14 , 17681,28 , 17709,53 , 17762,14 , 646,6 , 628,6 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 16819,23 , 0,4 , 4,0 , 5307,11 , 5318,5 , 0, 0, 1, 6, 7 }, // Koyra Chiini/Latin/Mali
- { 209, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 29504,87 , 134,24 , 19102,48 , 29504,87 , 134,24 , 15731,28 , 15759,62 , 15821,14 , 15731,28 , 15759,62 , 15821,14 , 557,5 , 537,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16406,27 , 0,4 , 4,0 , 5323,6 , 1625,8 , 2, 0, 1, 6, 7 }, // Rwa/Latin/Tanzania
- { 210, 7, 111, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 32490,48 , 32538,186 , 32724,24 , 32490,48 , 32538,186 , 32724,24 , 17776,28 , 17804,69 , 17873,14 , 17776,28 , 17804,69 , 17873,14 , 652,2 , 634,2 , 45,4 , 5,17 , 22,23 , {75,69,83}, 2,3 , 16842,23 , 0,4 , 4,0 , 5329,6 , 1192,5 , 2, 1, 7, 6, 7 }, // Luo/Latin/Kenya
- { 211, 7, 221, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 28978,48 , 29026,152 , 134,24 , 28978,48 , 29026,152 , 134,24 , 15491,28 , 15519,74 , 15593,14 , 15491,28 , 15519,74 , 15593,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,71,88}, 196,3 , 16351,26 , 4,4 , 4,0 , 5335,6 , 1690,6 , 0, 0, 1, 6, 7 }, // Chiga/Latin/Uganda
- { 212, 7, 145, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 32748,48 , 32796,86 , 32882,24 , 32748,48 , 32796,86 , 32882,24 , 17887,28 , 17915,48 , 17963,14 , 17887,28 , 17915,48 , 17963,14 , 654,9 , 636,10 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16865,22 , 13,5 , 4,0 , 5341,17 , 5358,6 , 2, 1, 1, 6, 7 }, // Central Morocco Tamazight/Latin/Morocco
- { 213, 7, 132, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 32332,46 , 32378,88 , 32466,24 , 32332,46 , 32378,88 , 32466,24 , 17977,28 , 18005,54 , 17762,14 , 17977,28 , 18005,54 , 17762,14 , 646,6 , 628,6 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 16819,23 , 0,4 , 4,0 , 5364,15 , 5318,5 , 0, 0, 1, 6, 7 }, // Koyraboro Senni/Latin/Mali
- { 214, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 19102,48 , 32906,84 , 134,24 , 19102,48 , 32906,84 , 134,24 , 18059,28 , 18087,63 , 18150,14 , 18059,28 , 18087,63 , 18150,14 , 663,5 , 646,8 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 16887,27 , 0,4 , 4,0 , 5379,9 , 1625,8 , 2, 0, 1, 6, 7 }, // Shambala/Latin/Tanzania
- { 215, 13, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 547,6 , 35,18 , 18,7 , 25,12 , 32990,88 , 32990,88 , 33078,31 , 32990,88 , 32990,88 , 33078,31 , 18164,33 , 18197,54 , 18251,19 , 18164,33 , 18197,54 , 18251,19 , 668,3 , 654,6 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 16914,10 , 8,5 , 4,0 , 5388,4 , 2667,4 , 2, 1, 7, 7, 7 }, // Bodo/Devanagari/India
- { 218, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 21930,48 , 11141,80 , 11058,24 , 21930,48 , 11141,80 , 11058,24 , 18270,25 , 18295,45 , 18340,17 , 18270,25 , 18295,45 , 18270,25 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 16924,43 , 13,5 , 4,0 , 5392,7 , 5399,5 , 2, 1, 1, 6, 7 }, // Chechen/Cyrillic/Russia
- { 219, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 954,8 , 954,8 , 1010,10 , 1706,23 , 37,5 , 8,10 , 33109,65 , 33174,117 , 33291,30 , 33109,65 , 33321,117 , 33291,30 , 18357,37 , 18394,68 , 11435,14 , 18357,37 , 18394,68 , 11435,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 16967,44 , 13,5 , 4,0 , 5404,19 , 5423,7 , 2, 1, 1, 6, 7 }, // Church/Cyrillic/Russia
- { 220, 2, 178, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {82,85,66}, 123,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Chuvash/Cyrillic/Russia
- { 230, 7, 49, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 33438,49 , 33487,99 , 33586,24 , 33438,49 , 33487,99 , 33586,24 , 18462,28 , 18490,50 , 18540,14 , 18462,28 , 18490,50 , 18540,14 , 671,5 , 660,6 , 45,4 , 5,17 , 22,23 , {67,68,70}, 209,2 , 17011,24 , 0,4 , 4,0 , 5430,8 , 5438,16 , 2, 1, 1, 6, 7 }, // Luba Katanga/Latin/Congo Kinshasa
- { 231, 7, 125, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 962,10 , 962,10 , 156,8 , 622,18 , 37,5 , 8,10 , 33610,48 , 33658,85 , 134,24 , 33743,59 , 33658,85 , 134,24 , 18554,28 , 18582,65 , 3668,14 , 18647,35 , 18582,65 , 3668,14 , 676,5 , 666,8 , 462,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 8439,19 , 13,5 , 4,0 , 5454,14 , 5468,10 , 2, 1, 1, 6, 7 }, // Luxembourgish/Latin/Luxembourg
- { 236, 7, 21, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Walloon/Latin/Belgium
- { 237, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 8218, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 33802,48 , 33850,195 , 34045,24 , 33802,48 , 33850,195 , 34045,24 , 18682,28 , 18710,72 , 18782,14 , 18682,28 , 18710,72 , 18782,14 , 681,3 , 674,3 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17035,21 , 0,4 , 4,0 , 5478,5 , 5483,7 , 0, 0, 1, 6, 7 }, // Aghem/Latin/Cameroon
- { 238, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 34069,48 , 34117,90 , 34207,24 , 34069,48 , 34117,90 , 34207,24 , 18796,28 , 18824,70 , 18894,14 , 18796,28 , 18824,70 , 18894,14 , 684,10 , 677,9 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17056,22 , 13,5 , 4,0 , 5490,5 , 5495,8 , 0, 0, 1, 6, 7 }, // Basaa/Latin/Cameroon
- { 239, 7, 156, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 32332,46 , 32378,88 , 32466,24 , 32332,46 , 32378,88 , 32466,24 , 17977,28 , 18908,53 , 18961,14 , 17977,28 , 18908,53 , 18961,14 , 694,8 , 686,10 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 16819,23 , 0,4 , 4,0 , 5503,10 , 5513,5 , 0, 0, 1, 6, 7 }, // Zarma/Latin/Niger
- { 240, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 34231,49 , 34280,99 , 34379,24 , 34231,49 , 34280,99 , 34379,24 , 18975,28 , 19003,45 , 19048,14 , 18975,28 , 19003,45 , 19048,14 , 702,5 , 696,6 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5518,5 , 1986,8 , 0, 0, 1, 6, 7 }, // Duala/Latin/Cameroon
- { 241, 7, 187, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 34403,36 , 34439,82 , 34521,24 , 34403,36 , 34439,82 , 34521,24 , 19062,28 , 19090,50 , 19140,14 , 19062,28 , 19090,50 , 19140,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 17078,23 , 13,5 , 4,0 , 5523,5 , 5528,7 , 0, 0, 1, 6, 7 }, // Jola Fonyi/Latin/Senegal
- { 242, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 34545,50 , 34595,141 , 34736,24 , 34545,50 , 34595,141 , 34736,24 , 19154,30 , 19184,85 , 19269,14 , 19154,30 , 19184,85 , 19269,14 , 707,7 , 702,9 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17101,23 , 13,5 , 4,0 , 5535,6 , 5541,7 , 0, 0, 1, 6, 7 }, // Ewondo/Latin/Cameroon
- { 243, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 34760,39 , 34799,191 , 158,27 , 34760,39 , 34799,191 , 158,27 , 19283,29 , 19312,45 , 19357,14 , 19283,29 , 19312,45 , 19357,14 , 714,6 , 711,7 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17124,11 , 13,5 , 4,0 , 5548,5 , 5553,7 , 0, 0, 1, 6, 7 }, // Bafia/Latin/Cameroon
- { 244, 7, 146, 44, 46, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 34990,48 , 35038,213 , 35251,24 , 34990,48 , 35038,213 , 35251,24 , 19371,28 , 19399,59 , 19458,14 , 19371,28 , 19399,59 , 19458,14 , 720,8 , 718,10 , 45,4 , 5,17 , 22,23 , {77,90,78}, 266,3 , 0,7 , 41,6 , 4,0 , 5560,5 , 5565,10 , 2, 1, 7, 6, 7 }, // Makhuwa Meetto/Latin/Mozambique
- { 245, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 35275,48 , 35323,139 , 35462,24 , 35275,48 , 35323,139 , 35462,24 , 19472,28 , 19500,74 , 19574,14 , 19472,28 , 19500,74 , 19574,14 , 728,5 , 728,5 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17135,17 , 4,4 , 4,0 , 5575,6 , 5581,7 , 0, 0, 1, 6, 7 }, // Mundang/Latin/Cameroon
- { 246, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8221, 171, 187, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 35486,51 , 35537,143 , 158,27 , 35486,51 , 35537,143 , 158,27 , 19588,30 , 19618,89 , 19707,14 , 19588,30 , 19618,89 , 19707,14 , 733,4 , 733,4 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17152,20 , 13,5 , 4,0 , 5588,6 , 5594,7 , 0, 0, 1, 6, 7 }, // Kwasio/Latin/Cameroon
- { 247, 7, 254, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 538,9 , 97,16 , 18,7 , 558,12 , 35680,54 , 35734,96 , 35830,24 , 35680,54 , 35734,96 , 35830,24 , 19721,38 , 19759,79 , 19838,14 , 19721,38 , 19759,79 , 19838,14 , 737,2 , 737,2 , 45,4 , 5,17 , 22,23 , {83,83,80}, 119,1 , 0,7 , 4,4 , 4,0 , 5601,9 , 0,0 , 2, 1, 1, 6, 7 }, // Nuer/Latin/South Sudan
- { 248, 2, 178, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8220, 0,6 , 0,6 , 972,11 , 972,11 , 227,6 , 1729,30 , 37,5 , 8,10 , 35854,50 , 35904,116 , 36020,24 , 35854,50 , 36044,121 , 36020,24 , 19852,21 , 19873,71 , 19944,14 , 19852,21 , 19873,71 , 19944,14 , 739,2 , 739,2 , 1227,5 , 1232,17 , 22,23 , {82,85,66}, 123,1 , 17172,47 , 13,5 , 4,0 , 5610,9 , 5619,9 , 2, 1, 1, 6, 7 }, // Sakha/Cyrillic/Russia
- { 249, 7, 210, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 37,5 , 8,10 , 36165,48 , 36213,117 , 158,27 , 36165,48 , 36213,117 , 158,27 , 19958,28 , 19986,60 , 20046,14 , 19958,28 , 19986,60 , 20046,14 , 741,9 , 741,9 , 45,4 , 5,17 , 22,23 , {84,90,83}, 191,3 , 17219,25 , 0,4 , 4,0 , 5628,9 , 5637,9 , 2, 0, 1, 6, 7 }, // Sangu/Latin/Tanzania
- { 251, 7, 156, 46, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 32332,46 , 32378,88 , 32466,24 , 32332,46 , 32378,88 , 32466,24 , 17977,28 , 18005,54 , 17762,14 , 17977,28 , 18005,54 , 17762,14 , 694,8 , 686,10 , 45,4 , 5,17 , 22,23 , {88,79,70}, 206,3 , 16819,23 , 0,4 , 4,0 , 5646,13 , 5513,5 , 0, 0, 1, 6, 7 }, // Tasawaq/Latin/Niger
- { 252, 35, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 36330,38 , 36368,61 , 158,27 , 36330,38 , 36368,61 , 158,27 , 20060,30 , 20060,30 , 85,14 , 20060,30 , 20060,30 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 17244,15 , 4,4 , 4,0 , 5659,2 , 5661,4 , 2, 1, 1, 6, 7 }, // Vai/Vai/Liberia
- { 252, 7, 121, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 119,10 , 10,17 , 18,7 , 25,12 , 36429,81 , 36429,81 , 158,27 , 36429,81 , 36429,81 , 158,27 , 20090,48 , 20090,48 , 85,14 , 20090,48 , 20090,48 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {76,82,68}, 6,1 , 17259,20 , 4,4 , 4,0 , 5665,3 , 5668,8 , 2, 1, 1, 6, 7 }, // Vai/Latin/Liberia
- { 253, 7, 206, 44, 8217, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 269,9 , 269,9 , 53,10 , 622,18 , 37,5 , 8,10 , 36510,48 , 36558,99 , 36657,24 , 36510,48 , 36558,99 , 36657,24 , 20138,28 , 20166,53 , 20219,14 , 20138,28 , 20166,53 , 20219,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,72,70}, 0,0 , 0,7 , 41,6 , 4,0 , 5676,6 , 5682,6 , 2, 0, 1, 6, 7 }, // Walser/Latin/Switzerland
- { 254, 7, 37, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 171, 187, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 36681,51 , 36732,191 , 158,27 , 36681,51 , 36732,191 , 158,27 , 20233,21 , 20254,71 , 20325,14 , 20233,21 , 20254,71 , 20325,14 , 750,8 , 750,8 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 13,5 , 4,0 , 5688,6 , 5694,7 , 0, 0, 1, 6, 7 }, // Yangben/Latin/Cameroon
- { 256, 7, 197, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 683,7 , 683,7 , 269,6 , 372,22 , 37,5 , 8,10 , 36923,48 , 36971,85 , 37056,24 , 37080,48 , 37128,117 , 37056,24 , 20339,28 , 20367,54 , 3364,14 , 20339,28 , 20367,54 , 3364,14 , 758,12 , 758,11 , 0,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 3102,20 , 13,5 , 4,0 , 5701,9 , 2432,6 , 2, 1, 1, 6, 7 }, // Asturian/Latin/Spain
- { 257, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 983,11 , 983,11 , 994,16 , 1010,9 , 53,10 , 1559,18 , 37,5 , 8,10 , 37245,174 , 37245,174 , 158,27 , 37245,174 , 37245,174 , 158,27 , 20421,60 , 20421,60 , 20481,25 , 20421,60 , 20421,60 , 20481,25 , 770,8 , 769,13 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17279,12 , 8,5 , 4,0 , 5710,5 , 5715,7 , 0, 0, 1, 6, 7 }, // Ngomba/Latin/Cameroon
- { 258, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 1759,10 , 80,17 , 37,5 , 8,10 , 37419,102 , 37419,102 , 158,27 , 37419,102 , 37419,102 , 158,27 , 20506,54 , 20506,54 , 20560,21 , 20506,54 , 20506,54 , 20560,21 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17291,16 , 41,6 , 4,0 , 5722,4 , 5726,7 , 0, 0, 1, 6, 7 }, // Kako/Latin/Cameroon
- { 259, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 1559,18 , 37,5 , 8,10 , 37521,137 , 37658,142 , 37800,36 , 37521,137 , 37658,142 , 37800,36 , 20581,49 , 20581,49 , 20630,21 , 20581,49 , 20581,49 , 20630,21 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17307,12 , 8,5 , 4,0 , 5733,5 , 5738,7 , 0, 0, 1, 6, 7 }, // Meta/Latin/Cameroon
- { 260, 7, 37, 44, 46, 59, 37, 48, 45, 43, 101, 171, 187, 8220, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 27,8 , 1769,32 , 37,5 , 8,10 , 37836,165 , 37836,165 , 158,27 , 37836,165 , 37836,165 , 158,27 , 20651,111 , 20651,111 , 85,14 , 20651,111 , 20651,111 , 85,14 , 778,9 , 782,8 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 17319,16 , 8,5 , 4,0 , 5745,16 , 5761,7 , 0, 0, 1, 6, 7 }, // Ngiemboon/Latin/Cameroon
- { 290, 11, 100, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,78,82}, 121,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 7, 7 }, // Manipuri/Bengali/India
- { 309, 100, 232, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {86,78,68}, 322,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Tai Dam/Tai Viet/Vietnam
- { 312, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Akoose/Latin/Cameroon
- { 313, 7, 225, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 547,6 , 35,18 , 18,7 , 25,12 , 38001,180 , 38001,180 , 158,27 , 38001,180 , 38001,180 , 158,27 , 20762,87 , 20762,87 , 85,14 , 20762,87 , 20762,87 , 20849,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {85,83,68}, 6,1 , 0,7 , 41,6 , 4,0 , 5768,12 , 5780,22 , 2, 1, 7, 6, 7 }, // Lakota/Latin/United States
- { 314, 9, 145, 44, 160, 59, 37, 48, 45, 43, 101, 171, 187, 8222, 8221, 0,6 , 0,6 , 0,6 , 0,6 , 415,8 , 97,16 , 37,5 , 8,10 , 28362,48 , 28410,81 , 28491,24 , 28362,48 , 28410,81 , 28491,24 , 15165,30 , 20863,48 , 85,14 , 15165,30 , 20863,48 , 85,14 , 531,6 , 505,8 , 45,4 , 5,17 , 22,23 , {77,65,68}, 0,0 , 16256,21 , 0,4 , 4,0 , 5802,8 , 4987,6 , 2, 1, 1, 6, 7 }, // Standard Moroccan Tamazight/Tifinagh/Morocco
- { 315, 7, 43, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,76,80}, 6,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Mapuche/Latin/Chile
- { 316, 1, 103, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 38181,105 , 38181,105 , 38286,24 , 38181,105 , 38181,105 , 38286,24 , 20911,58 , 20911,58 , 20969,14 , 20911,58 , 20911,58 , 20969,14 , 787,3 , 790,3 , 45,4 , 5,17 , 22,23 , {73,81,68}, 44,5 , 17335,20 , 13,5 , 4,0 , 5810,14 , 5824,5 , 0, 0, 6, 5, 6 }, // Central Kurdish/Arabic/Iraq
- { 316, 1, 102, 1643, 1644, 1563, 1642, 1632, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 38181,105 , 38181,105 , 38286,24 , 38181,105 , 38181,105 , 38286,24 , 20911,58 , 20911,58 , 20969,14 , 20911,58 , 20911,58 , 20969,14 , 787,3 , 790,3 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 17355,19 , 13,5 , 4,0 , 5810,14 , 5829,5 , 0, 0, 6, 5, 5 }, // Central Kurdish/Arabic/Iran
- { 317, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 185,7 , 185,7 , 113,6 , 622,18 , 55,4 , 59,9 , 38310,48 , 38358,85 , 9742,24 , 38443,60 , 38503,93 , 9742,24 , 20983,28 , 21011,53 , 21064,14 , 20983,28 , 21011,53 , 21064,14 , 790,9 , 793,10 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 17374,27 , 13,5 , 4,0 , 5834,14 , 5848,6 , 2, 1, 1, 6, 7 }, // Lower Sorbian/Latin/Germany
- { 318, 7, 82, 44, 46, 59, 37, 48, 45, 43, 101, 8222, 8220, 8218, 8216, 0,6 , 0,6 , 185,7 , 185,7 , 113,6 , 622,18 , 570,12 , 59,9 , 38596,48 , 38644,86 , 9742,24 , 38730,60 , 38790,93 , 9742,24 , 21078,28 , 21106,53 , 21159,14 , 21078,28 , 21106,53 , 21159,14 , 790,9 , 803,9 , 1249,5 , 5,17 , 22,23 , {69,85,82}, 14,1 , 17401,29 , 13,5 , 4,0 , 5854,15 , 5869,6 , 2, 1, 1, 6, 7 }, // Upper Sorbian/Latin/Germany
- { 319, 7, 37, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {88,65,70}, 32,4 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Kenyang/Latin/Cameroon
- { 320, 7, 38, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {67,65,68}, 233,3 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Mohawk/Latin/Canada
- { 321, 75, 91, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,78,70}, 215,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 1, 6, 7 }, // Nko/Nko/Guinea
- { 322, 7, 260, 44, 160, 59, 37, 48, 45, 43, 101, 8222, 8220, 8222, 8220, 0,6 , 0,6 , 1019,8 , 1019,8 , 156,8 , 1801,27 , 37,5 , 8,10 , 38883,48 , 38931,91 , 39022,24 , 38883,48 , 38931,91 , 39022,24 , 21173,28 , 21201,69 , 21270,14 , 21173,28 , 21201,69 , 21270,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 13,5 , 4,0 , 5875,9 , 5884,6 , 2, 1, 1, 6, 7 }, // Prussian/Latin/World
- { 323, 7, 90, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {71,84,81}, 290,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Kiche/Latin/Guatemala
- { 324, 7, 205, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 189,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 1, 6, 7 }, // Southern Sami/Latin/Sweden
- { 325, 7, 205, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {83,69,75}, 189,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 1, 6, 7 }, // Lule Sami/Latin/Sweden
- { 326, 7, 73, 44, 160, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 640,8 , 1828,18 , 243,4 , 247,9 , 39046,77 , 39123,140 , 39263,25 , 39046,77 , 39123,140 , 39263,25 , 21284,28 , 21312,70 , 85,14 , 21284,28 , 21382,73 , 21455,14 , 799,3 , 812,3 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 17430,11 , 13,5 , 4,0 , 5890,11 , 5901,5 , 2, 1, 1, 6, 7 }, // Inari Sami/Latin/Finland
- { 327, 7, 73, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Skolt Sami/Latin/Finland
- { 328, 7, 13, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {65,85,68}, 326,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 7, 6, 7 }, // Warlpiri/Latin/Australia
- { 346, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 171, 187, 8249, 8250, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 14934,70 , 14934,70 , 158,27 , 14934,70 , 14934,70 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 726,4 , 1254,39 , 22,23 , {73,82,82}, 328,3 , 17441,27 , 8,5 , 4,0 , 5906,7 , 3238,5 , 0, 0, 6, 5, 5 }, // Mazanderani/Arabic/Iran
- { 349, 1, 102, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 39288,77 , 39288,77 , 158,27 , 39288,77 , 39288,77 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 5913,11 , 0,0 , 0, 0, 6, 5, 5 }, // Northern Luri/Arabic/Iran
- { 349, 1, 103, 1643, 1644, 1563, 1642, 1776, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 18,7 , 25,12 , 39288,77 , 39288,77 , 158,27 , 39288,77 , 39288,77 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,81,68}, 44,5 , 0,7 , 8,5 , 4,0 , 5913,11 , 0,0 , 0, 0, 6, 5, 6 }, // Northern Luri/Arabic/Iraq
- { 357, 6, 97, 46, 44, 59, 37, 48, 45, 43, 101, 12300, 12301, 12302, 12303, 170,5 , 170,5 , 1027,5 , 1027,5 , 394,8 , 423,14 , 198,6 , 215,13 , 4423,39 , 4423,39 , 158,27 , 4423,39 , 4423,39 , 158,27 , 1953,28 , 1953,28 , 1981,14 , 1953,28 , 1953,28 , 1981,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {72,75,68}, 166,3 , 17468,11 , 4,4 , 4,0 , 5924,2 , 5926,14 , 2, 1, 7, 6, 7 }, // Cantonese/Traditional Han/Hong Kong
- { 357, 5, 44, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 170,5 , 170,5 , 1027,5 , 1027,5 , 394,8 , 402,13 , 198,6 , 204,11 , 4423,39 , 4462,38 , 158,27 , 4423,39 , 4462,38 , 158,27 , 1932,21 , 1953,28 , 1981,14 , 1932,21 , 1953,28 , 1981,14 , 58,2 , 55,2 , 45,4 , 5,17 , 22,23 , {67,78,89}, 133,1 , 3122,13 , 4,4 , 4,0 , 5940,2 , 5942,7 , 2, 1, 7, 6, 7 }, // Cantonese/Simplified Han/China
- { 360, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Ido/Latin/World
- { 361, 7, 260, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {0,0,0}, 0,0 , 2586,0 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Lojban/Latin/World
- { 362, 7, 106, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {69,85,82}, 14,1 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 1, 1, 6, 7 }, // Sicilian/Latin/Italy
- { 363, 1, 102, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {73,82,82}, 0,0 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 0, 0, 6, 5, 5 }, // Southern Kurdish/Arabic/Iran
- { 364, 1, 163, 46, 44, 59, 37, 48, 45, 43, 101, 8220, 8221, 8216, 8217, 0,6 , 0,6 , 0,6 , 0,6 , 53,10 , 63,17 , 37,5 , 8,10 , 368,48 , 368,48 , 158,27 , 368,48 , 368,48 , 158,27 , 0,28 , 0,28 , 85,14 , 0,28 , 0,28 , 85,14 , 0,2 , 0,2 , 45,4 , 5,17 , 22,23 , {80,75,82}, 175,2 , 0,7 , 8,5 , 4,0 , 0,0 , 0,0 , 2, 0, 7, 6, 7 }, // Western Balochi/Arabic/Pakistan
- { 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 } // trailing 0s
-};
-
-static const ushort list_pattern_part_data[] = {
-0x25, 0x31, 0x2c, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x64, 0x68, 0x65,
-0x20, 0x25, 0x32, 0x25, 0x31, 0x1363, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x12a5, 0x1293, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x12a5, 0x1293, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x648, 0x25, 0x32, 0x25,
-0x31, 0x20, 0x648, 0x25, 0x32, 0x25, 0x31, 0x20, 0x587, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x986, 0x9f0, 0x9c1, 0x20, 0x25,
-0x32, 0x25, 0x31, 0x20, 0x76, 0x259, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65, 0x74, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x98f, 0x9ac, 0x982, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xf51, 0xf44, 0xf0b, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x438,
-0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x25, 0x32, 0x25, 0x31, 0x1014, 0x103e, 0x1004, 0x1037, 0x103a, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x456, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x1793, 0x17b7, 0x1784, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x1793, 0x17b7, 0x1784,
-0x200b, 0x25, 0x32, 0x25, 0x31, 0x20, 0x69, 0x20, 0x25, 0x32, 0x25, 0x31, 0x3001, 0x25, 0x32, 0x25, 0x31, 0x548c, 0x25, 0x32,
-0x25, 0x31, 0x53ca, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6f, 0x67, 0x20, 0x25, 0x32,
-0x25, 0x31, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x25, 0x32, 0x25,
-0x31, 0x20, 0x6b, 0x61, 0x6a, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6a, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65,
-0x74, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x67, 0x75, 0x73, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x65, 0x20, 0x25,
-0x32, 0x25, 0x31, 0x20, 0x10d3, 0x10d0, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x75, 0x6e, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x3ba, 0x3b1, 0x3b9, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x61, 0x6d, 0x6d, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0xa85, 0xaa8, 0xac7, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x64, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x5d5, 0x25,
-0x32, 0x25, 0x31, 0x2c, 0x20, 0x914, 0x930, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x914, 0x930, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0xe9, 0x73, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x64, 0x61, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x64,
-0x61, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x61, 0x67, 0x75, 0x73, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20,
-0x6c, 0x61, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6c, 0x61, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0xcae,
-0xca4, 0xccd, 0xca4, 0xcc1, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xcae, 0xca4, 0xccd, 0xca4, 0xcc1, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x436, 0x4d9, 0x43d, 0x435, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x436, 0x430, 0x43d, 0x430, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0xbc0f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xfb, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xec1, 0xea5, 0xeb0, 0x20, 0x25,
-0x32, 0x25, 0x31, 0x20, 0x75, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6d, 0x70, 0xe9, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x69, 0x72, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x25, 0x32, 0x20, 0xd0e, 0xd28, 0xd4d, 0xd28, 0xd3f, 0xd35, 0x25,
-0x31, 0x20, 0xd15, 0xd42, 0xd1f, 0xd3e, 0xd24, 0xd46, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x75, 0x20, 0x25, 0x32, 0x25,
-0x31, 0x20, 0x75, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x906, 0x923, 0x93f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x25, 0x32,
-0x25, 0x31, 0x20, 0x930, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0xb13, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xb13, 0x20,
-0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x627, 0x648, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x627, 0x648, 0x20, 0x25, 0x32, 0x25,
-0x31, 0x60c, 0x200f, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x648, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x648, 0x20, 0x25,
-0x32, 0x25, 0x31, 0x20, 0xa05, 0xa24, 0xa47, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x219, 0x69, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x4d5, 0x43c, 0x4d5, 0x20, 0x25, 0x32, 0x25, 0x31, 0x60c, 0x20, 0x6fd, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6fd, 0x20,
-0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0xdc3, 0xdc4, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xdc3, 0xdc4, 0x20, 0x25, 0x32, 0x25,
-0x31, 0x20, 0x61, 0xa0, 0x25, 0x32, 0x25, 0x31, 0x20, 0x69, 0x6e, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x69, 0x79, 0x6f,
-0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x79, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6e, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31,
-0x20, 0x6f, 0x63, 0x68, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xbae, 0xbb1, 0xbcd, 0xbb1, 0xbc1, 0xbae, 0xbcd, 0x20, 0x25, 0x32,
-0x25, 0x31, 0x20, 0x4bb, 0x4d9, 0x43c, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0xc2e, 0xc30, 0xc3f, 0xc2f, 0xc41, 0x20, 0x25, 0x32,
-0x25, 0x31, 0x20, 0xe41, 0xe25, 0xe30, 0x25, 0x32, 0x25, 0x31, 0xe41, 0xe25, 0xe30, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6d, 0x6f,
-0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x76, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x77, 0x65, 0x20, 0x25, 0x32, 0x25,
-0x31, 0x60c, 0x20, 0x627, 0x648, 0x631, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x627, 0x648, 0x631, 0x20, 0x25, 0x32, 0x25, 0x32,
-0x60c, 0x20, 0x25, 0x31, 0x25, 0x31, 0x20, 0x76, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x76, 0xe0, 0x20, 0x25, 0x32,
-0x25, 0x31, 0x2c, 0x20, 0x61, 0x28, 0x63, 0x29, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x28, 0x63, 0x29, 0x20, 0x25,
-0x32, 0x25, 0x31, 0x20, 0x5d0, 0x5d5, 0x5df, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x6e, 0x65, 0x2d, 0x25, 0x32, 0x25,
-0x31, 0x20, 0x6e, 0x65, 0x2d, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x6e, 0x61, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20,
-0x6b, 0x70, 0x6c, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x6b, 0x70, 0x6c, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c,
-0x20, 0x61, 0x74, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x74, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x61, 0x6b,
-0x6b, 0x65, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x6b, 0x6b, 0x65, 0x64, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c,
-0x20, 0x13a0, 0x13b4, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x13a0, 0x13b4, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x438, 0x486, 0x20,
-0x25, 0x32, 0x25, 0x31, 0x20, 0x61, 0x28, 0x6e, 0x29, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x443, 0x43e, 0x43d, 0x43d, 0x430,
-0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x14b, 0x301, 0x67, 0x25b, 0x20, 0x25, 0x32, 0x25, 0x31, 0x2c, 0x20, 0x1e3f, 0x62,
-0x25b, 0x6e, 0x20, 0x14b, 0x301, 0x67, 0x25b, 0x20, 0x25, 0x32, 0x25, 0x31, 0x20, 0x70, 0x254, 0x70, 0x20, 0x25, 0x32, 0x25,
-0x31, 0x20, 0x62, 0x65, 0x20, 0x25, 0x32, 0x25, 0x31, 0x540c, 0x25, 0x32
-};
-
-static const ushort date_format_data[] = {
-0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d,
-0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c,
-0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2d, 0x4d, 0x4d,
-0x2d, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64,
-0x64, 0x64, 0x64, 0x64, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64,
-0x64, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x64,
-0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x64, 0x200f, 0x2f, 0x4d, 0x200f, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x64,
-0x64, 0x64, 0x64, 0x60c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2e, 0x4d,
-0x4d, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x569, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2c, 0x20,
-0x64, 0x64, 0x64, 0x64, 0x64, 0x2d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20,
-0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79,
-0x79, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x2f, 0x4d, 0x2f, 0x64, 0x79, 0x79, 0x79, 0x79, 0x28, 0x27, 0x65,
-0x27, 0x29, 0x27, 0x6b, 0x6f, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x27, 0x72, 0x65, 0x6e, 0x27, 0x20, 0x64, 0x28, 0x27,
-0x61, 0x27, 0x29, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2f, 0x4d, 0x2f, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c,
-0x20, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf63, 0xf7c, 0xf0b, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0xf5a,
-0xf7a, 0xf66, 0xf0b, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x20, 0x27, 0x433, 0x27, 0x2e, 0x64, 0x64, 0x64,
-0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x433, 0x27, 0x2e, 0x64,
-0x64, 0x2d, 0x4d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x104a, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x104a,
-0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20,
-0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2f, 0x4d,
-0x2f, 0x64, 0x79, 0x79, 0x79, 0x79, 0x5e74, 0x4d, 0x6708, 0x64, 0x65e5, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2f, 0x4d, 0x2f, 0x79,
-0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x5e74, 0x4d, 0x6708, 0x64, 0x65e5, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2e,
-0x20, 0x4d, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x2e, 0x20, 0x4d,
-0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x2e, 0x20, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x2e, 0x64, 0x64,
-0x64, 0x64, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2e, 0x4d, 0x4d,
-0x2e, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x27, 0x64, 0x65, 0x6e, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d,
-0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x2d, 0x4d, 0x4d, 0x2d, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2f,
-0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79, 0x4d, 0x2f, 0x64, 0x2f, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64,
-0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2f, 0x4d, 0x4d, 0x2f, 0x79, 0x79, 0x79, 0x79,
-0x79, 0x79, 0x2f, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 0x79, 0x79, 0x2d, 0x4d, 0x4d, 0x2d, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
-0x2c, 0x20, 0x64, 0x2d, 0x27, 0x61, 0x27, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79,
-0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79,
-0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x27, 0x6d, 0x68, 0x27, 0x20,
-0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x27, 0x64, 0x65,
-0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64,
-0x2c, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20,
-0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20,
-0x5d1, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x20, 0x4d, 0x4d, 0x2e, 0x20,
-0x64, 0x64, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x2e, 0x2c, 0x20, 0x64, 0x64,
-0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x20, 0x27, 0x6c, 0x65, 0x27, 0x20, 0x64, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x4d,
-0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x436, 0x27, 0x2e, 0x20, 0x64, 0x20,
-0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x79, 0x79, 0x2d, 0x27, 0x436, 0x27, 0x2e, 0x2c,
-0x20, 0x64, 0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x2e, 0x20, 0x4d, 0x2e, 0x20,
-0x64, 0x2e, 0x79, 0x79, 0x79, 0x79, 0xb144, 0x20, 0x4d, 0xc6d4, 0x20, 0x64, 0xc77c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
-0x64, 0x64, 0x20, 0xe97, 0xeb5, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64,
-0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x20, 0x27, 0x67, 0x61, 0x64, 0x61, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d,
-0x4d, 0x4d, 0x4d, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x6d, 0x27, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x20,
-0x27, 0x64, 0x27, 0x2e, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x64, 0x64, 0x20,
-0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20,
-0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x27, 0x74, 0x61, 0x27, 0x2019,
-0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x4d, 0x4d, 0x2e, 0x64, 0x64,
-0x79, 0x79, 0x79, 0x79, 0x2e, 0x4d, 0x4d, 0x2e, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64,
-0x20, 0x62f, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x62f, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64,
-0x2c, 0x20, 0x27, 0x69, 0x6c, 0x73, 0x27, 0x20, 0x64, 0x20, 0x27, 0x64, 0x61, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20,
-0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x4d, 0x2e, 0x79, 0x79, 0x2e, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x2e,
-0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d,
-0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x430, 0x437, 0x27, 0x64, 0x2e, 0x20, 0x4d, 0x2e, 0x20,
-0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64,
-0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x4d, 0x4d,
-0x4d, 0x4d, 0x20, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x64, 0x64, 0x20, 0x27,
-0x64, 0x65, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x65, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x4d, 0x4d,
-0x2f, 0x64, 0x64, 0x2f, 0x79, 0x79, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27,
-0x435, 0x43b, 0x27, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79,
-0x79, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0xe17, 0xe35, 0xe48, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d,
-0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0xf60, 0xf72, 0xf0b, 0xf5a, 0xf7a,
-0xf66, 0xf0b, 0x64, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x1363, 0x20, 0x64, 0x64, 0x20, 0x4d, 0x4d,
-0x4d, 0x4d, 0x20, 0x1218, 0x12d3, 0x120d, 0x1272, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x2e, 0x4d, 0x4d, 0x2e, 0x79, 0x79, 0x79,
-0x79, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x64, 0x64, 0x64, 0x64, 0x79, 0x79, 0x79,
-0x79, 0x20, 0x64, 0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x60c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20,
-0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x440, 0x27, 0x2e, 0x64, 0x64, 0x64, 0x64,
-0x60c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x60c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20,
-0x64, 0x2d, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x79, 0x20, 0x646, 0x686, 0x6cc,
-0x20, 0x6cc, 0x6cc, 0x644, 0x20, 0x64, 0x20, 0x646, 0x686, 0x6cc, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x64, 0x64, 0x64,
-0x20, 0x6a9, 0x648, 0x646, 0x6cc, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x27, 0x61, 0x27, 0x20, 0x27, 0x64,
-0x27, 0x2e, 0x20, 0x64, 0x27, 0x69, 0x64, 0x27, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x2c,
-0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x5d8, 0x5df, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20,
-0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79,
-0x64, 0x2e, 0x20, 0x4d, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x79, 0x79, 0x2f, 0x4d, 0x4d, 0x2f, 0x64, 0x64, 0x64,
-0x64, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x64, 0x64, 0x2d, 0x4d,
-0x2d, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x64, 0x20, 0x27, 0x64, 0x69, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20,
-0x27, 0x64, 0x61, 0x6c, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d,
-0x20, 0x64, 0x20, 0x27, 0x6c, 0x69, 0x61, 0x27, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x27,
-0x64, 0x65, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64,
-0x2c, 0x20, 0x64, 0x20, 0x27, 0x64, 0x69, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27, 0x64, 0x69, 0x27, 0x20, 0x79,
-0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x27, 0x64, 0xe4, 0x27, 0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d,
-0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x27,
-0x43b, 0x27, 0x2e, 0x20, 0x79, 0x79, 0x79, 0x79, 0x2e, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x441, 0x44b, 0x43b, 0x27, 0x20,
-0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64, 0x20, 0x27, 0x43a, 0x4af, 0x43d, 0x44d, 0x27, 0x2c, 0x20, 0x64, 0x64, 0x64, 0x64, 0x64,
-0x64, 0x2f, 0x4d, 0x4d, 0x20, 0x79, 0x79, 0x79, 0x79, 0x64, 0x64, 0x64, 0x64, 0x20, 0x2c, 0x20, 0x27, 0x6c, 0x79, 0x25b,
-0x27, 0x30c, 0x2bc, 0x20, 0x64, 0x20, 0x27, 0x6e, 0x61, 0x27, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x2c, 0x20, 0x79, 0x79, 0x79,
-0x79, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x79, 0x79, 0x79, 0x79, 0x20, 0x27, 0x6d, 0x65, 0x74, 0x74, 0x61, 0x73, 0x27,
-0x20, 0x64, 0x2e, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x64, 0x64, 0x64, 0x64, 0x2c, 0x20, 0x4d, 0x4d, 0x4d, 0x4d, 0x20, 0x64,
-0x2e, 0x20, 0x79, 0x79, 0x79, 0x79
-};
-
-static const ushort time_format_data[] = {
-0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x68, 0x3a,
-0x6d, 0x6d, 0x20, 0x41, 0x50, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x20, 0x74, 0x48, 0x48, 0x3a,
-0x6d, 0x6d, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x2c, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x6d, 0x48,
-0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x41, 0x50, 0x20, 0x68, 0x2e, 0x6d, 0x6d, 0x41, 0x50, 0x20, 0x68, 0x2e,
-0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x28, 0x74, 0x29, 0xf46,
-0xf74, 0xf0b, 0xf5a, 0xf7c, 0xf51, 0xf0b, 0x20, 0x68, 0x20, 0xf66, 0xf90, 0xf62, 0xf0b, 0xf58, 0xf0b, 0x20, 0x6d, 0x6d, 0x20, 0x41,
-0x50, 0xf46, 0xf74, 0xf0b, 0xf5a, 0xf7c, 0xf51, 0xf0b, 0x20, 0x68, 0x20, 0xf66, 0xf90, 0xf62, 0xf0b, 0xf58, 0xf0b, 0x20, 0x6d, 0x6d,
-0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x20, 0x74, 0x48, 0x3a, 0x6d, 0x6d, 0x20, 0x27, 0x447, 0x27, 0x2e, 0x48, 0x3a, 0x6d,
-0x6d, 0x3a, 0x73, 0x73, 0x20, 0x27, 0x447, 0x27, 0x2e, 0x20, 0x74, 0x42, 0x20, 0x48, 0x3a, 0x6d, 0x6d, 0x74, 0x20, 0x48,
-0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x2c, 0x20, 0x74, 0x41, 0x50,
-0x68, 0x3a, 0x6d, 0x6d, 0x74, 0x20, 0x41, 0x50, 0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x41, 0x50, 0x68, 0x3a, 0x6d,
-0x6d, 0x3a, 0x73, 0x73, 0x20, 0x5b, 0x74, 0x5d, 0x48, 0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x48, 0x2e, 0x6d, 0x6d, 0x2e, 0x73,
-0x73, 0x20, 0x74, 0x48, 0x2e, 0x6d, 0x6d, 0x48, 0x2e, 0x6d, 0x6d, 0x2e, 0x73, 0x73, 0x20, 0x74, 0x48, 0x2d, 0x27, 0x61,
-0x27, 0x20, 0x27, 0x68, 0x6f, 0x72, 0x6f, 0x27, 0x20, 0x27, 0x6b, 0x61, 0x6a, 0x27, 0x20, 0x6d, 0x3a, 0x73, 0x73, 0x20,
-0x74, 0x48, 0x20, 0x27, 0x68, 0x27, 0x20, 0x6d, 0x6d, 0x20, 0x27, 0x6d, 0x69, 0x6e, 0x27, 0x20, 0x73, 0x73, 0x20, 0x27,
-0x73, 0x27, 0x20, 0x74, 0x48, 0x48, 0x20, 0x27, 0x68, 0x27, 0x20, 0x6d, 0x6d, 0x48, 0x48, 0x20, 0x27, 0x68, 0x27, 0x20,
-0x6d, 0x6d, 0x20, 0x27, 0x6d, 0x69, 0x6e, 0x27, 0x20, 0x73, 0x73, 0x20, 0x27, 0x73, 0x27, 0x20, 0x74, 0x48, 0x48, 0x2e,
-0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x27, 0x68, 0x27, 0x20, 0x74, 0x68, 0x68, 0x3a, 0x6d, 0x6d, 0x20, 0x41, 0x50, 0x68,
-0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x20, 0x74, 0x48, 0x6642, 0x6d, 0x6d, 0x5206, 0x73, 0x73, 0x79d2,
-0x20, 0x74, 0x41, 0x50, 0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x41, 0x50, 0x20, 0x68, 0xc2dc, 0x20, 0x6d, 0xbd84, 0x20, 0x73, 0xcd08,
-0x20, 0x74, 0x48, 0x20, 0xec2, 0xea1, 0xe87, 0x20, 0x6d, 0x20, 0xe99, 0xeb2, 0xe97, 0xeb5, 0x20, 0x73, 0x73, 0x20, 0xea7, 0xeb4,
-0xe99, 0xeb2, 0xe97, 0xeb5, 0x20, 0x74, 0x68, 0x3a, 0x6d, 0x6d, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x28, 0x74,
-0x29, 0x27, 0x6b, 0x6c, 0x27, 0x2e, 0x20, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x41, 0x50, 0x20,
-0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x48, 0x20, 0xe19, 0xe32, 0xe2c, 0xe34, 0xe01, 0xe32, 0x20, 0x6d, 0x6d,
-0x20, 0xe19, 0xe32, 0xe17, 0xe35, 0x20, 0x73, 0x73, 0x20, 0xe27, 0xe34, 0xe19, 0xe32, 0xe17, 0xe35, 0x20, 0x74, 0x48, 0x3a, 0x6d,
-0x41, 0x50, 0x20, 0x27, 0x67, 0x61, 0x27, 0x20, 0x68, 0x3a, 0x6d, 0x6d, 0x41, 0x50, 0x20, 0x27, 0x67, 0x61, 0x27, 0x20,
-0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x74, 0x27, 0x4b, 0x6c, 0x27, 0x2e, 0x20, 0x48, 0x2e, 0x6d, 0x6d, 0x27,
-0x4b, 0x6c, 0x6f, 0x63, 0x6b, 0x27, 0x20, 0x48, 0x2e, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x28, 0x74, 0x29, 0x74, 0x20,
-0x68, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x41, 0x50, 0x48, 0x3a, 0x6d, 0x6d, 0x20, 0x27, 0x68, 0x6f, 0x64, 0x17a,
-0x27, 0x2e
-};
-
-static const ushort months_data[] = {
-0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b,
-0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x63, 0x74, 0x3b,
-0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x63, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x79, 0x3b, 0x46, 0x65, 0x62, 0x72,
-0x75, 0x61, 0x72, 0x79, 0x3b, 0x4d, 0x61, 0x72, 0x63, 0x68, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79,
-0x3b, 0x4a, 0x75, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6c, 0x79, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65,
-0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x63, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65,
-0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b,
-0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x31, 0x3b,
-0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x38, 0x3b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31,
-0x31, 0x3b, 0x31, 0x32, 0x3b, 0x41, 0x6d, 0x61, 0x3b, 0x47, 0x75, 0x72, 0x3b, 0x42, 0x69, 0x74, 0x3b, 0x45, 0x6c, 0x62,
-0x3b, 0x43, 0x61, 0x6d, 0x3b, 0x57, 0x61, 0x78, 0x3b, 0x41, 0x64, 0x6f, 0x3b, 0x48, 0x61, 0x67, 0x3b, 0x46, 0x75, 0x6c,
-0x3b, 0x4f, 0x6e, 0x6b, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x4d, 0x75, 0x64, 0x3b, 0x41, 0x6d, 0x61, 0x6a, 0x6a, 0x69, 0x69,
-0x3b, 0x47, 0x75, 0x72, 0x61, 0x61, 0x6e, 0x64, 0x68, 0x61, 0x6c, 0x61, 0x3b, 0x42, 0x69, 0x74, 0x6f, 0x6f, 0x74, 0x65,
-0x65, 0x73, 0x73, 0x61, 0x3b, 0x45, 0x6c, 0x62, 0x61, 0x3b, 0x43, 0x61, 0x61, 0x6d, 0x73, 0x61, 0x3b, 0x57, 0x61, 0x78,
-0x61, 0x62, 0x61, 0x6a, 0x6a, 0x69, 0x69, 0x3b, 0x41, 0x64, 0x6f, 0x6f, 0x6c, 0x65, 0x65, 0x73, 0x73, 0x61, 0x3b, 0x48,
-0x61, 0x67, 0x61, 0x79, 0x79, 0x61, 0x3b, 0x46, 0x75, 0x75, 0x6c, 0x62, 0x61, 0x6e, 0x61, 0x3b, 0x4f, 0x6e, 0x6b, 0x6f,
-0x6c, 0x6f, 0x6c, 0x65, 0x65, 0x73, 0x73, 0x61, 0x3b, 0x53, 0x61, 0x64, 0x61, 0x61, 0x73, 0x61, 0x3b, 0x4d, 0x75, 0x64,
-0x64, 0x65, 0x65, 0x3b, 0x41, 0x3b, 0x47, 0x3b, 0x42, 0x3b, 0x45, 0x3b, 0x43, 0x3b, 0x57, 0x3b, 0x41, 0x3b, 0x48, 0x3b,
-0x46, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x4d, 0x30, 0x31, 0x3b, 0x4d, 0x30, 0x32, 0x3b, 0x4d, 0x30, 0x33, 0x3b,
-0x4d, 0x30, 0x34, 0x3b, 0x4d, 0x30, 0x35, 0x3b, 0x4d, 0x30, 0x36, 0x3b, 0x4d, 0x30, 0x37, 0x3b, 0x4d, 0x30, 0x38, 0x3b,
-0x4d, 0x30, 0x39, 0x3b, 0x4d, 0x31, 0x30, 0x3b, 0x4d, 0x31, 0x31, 0x3b, 0x4d, 0x31, 0x32, 0x3b, 0x4a, 0x61, 0x6e, 0x2e,
-0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x72, 0x74, 0x2e, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x65, 0x69, 0x3b,
-0x4a, 0x75, 0x6e, 0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b,
-0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x73, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61,
-0x72, 0x69, 0x65, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x65, 0x3b, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x3b,
-0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x65, 0x3b, 0x4a, 0x75, 0x6c, 0x69,
-0x65, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72,
-0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65,
-0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x73, 0x68, 0x6b, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x70,
-0x72, 0x69, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x71, 0x65, 0x72, 0x3b, 0x6b, 0x6f, 0x72, 0x72, 0x3b, 0x67, 0x75, 0x73, 0x68,
-0x3b, 0x73, 0x68, 0x74, 0x3b, 0x74, 0x65, 0x74, 0x3b, 0x6e, 0xeb, 0x6e, 0x3b, 0x64, 0x68, 0x6a, 0x3b, 0x6a, 0x61, 0x6e,
-0x61, 0x72, 0x3b, 0x73, 0x68, 0x6b, 0x75, 0x72, 0x74, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x70, 0x72, 0x69, 0x6c, 0x6c,
-0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x71, 0x65, 0x72, 0x73, 0x68, 0x6f, 0x72, 0x3b, 0x6b, 0x6f, 0x72, 0x72, 0x69, 0x6b, 0x3b,
-0x67, 0x75, 0x73, 0x68, 0x74, 0x3b, 0x73, 0x68, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x3b, 0x74, 0x65, 0x74, 0x6f, 0x72, 0x3b,
-0x6e, 0xeb, 0x6e, 0x74, 0x6f, 0x72, 0x3b, 0x64, 0x68, 0x6a, 0x65, 0x74, 0x6f, 0x72, 0x3b, 0x6a, 0x3b, 0x73, 0x68, 0x3b,
-0x6d, 0x3b, 0x70, 0x3b, 0x6d, 0x3b, 0x71, 0x3b, 0x6b, 0x3b, 0x67, 0x3b, 0x73, 0x68, 0x3b, 0x74, 0x3b, 0x6e, 0x3b, 0x64,
-0x68, 0x3b, 0x1303, 0x1295, 0x12e9, 0x3b, 0x134c, 0x1265, 0x1229, 0x3b, 0x121b, 0x122d, 0x127d, 0x3b, 0x12a4, 0x1355, 0x122a, 0x3b, 0x121c, 0x12ed,
-0x3b, 0x1301, 0x1295, 0x3b, 0x1301, 0x120b, 0x12ed, 0x3b, 0x12a6, 0x1308, 0x1235, 0x3b, 0x1234, 0x1355, 0x1274, 0x3b, 0x12a6, 0x12ad, 0x1276, 0x3b,
-0x1296, 0x126c, 0x121d, 0x3b, 0x12f2, 0x1234, 0x121d, 0x3b, 0x1303, 0x1295, 0x12e9, 0x12c8, 0x122a, 0x3b, 0x134c, 0x1265, 0x1229, 0x12c8, 0x122a, 0x3b,
-0x121b, 0x122d, 0x127d, 0x3b, 0x12a4, 0x1355, 0x122a, 0x120d, 0x3b, 0x121c, 0x12ed, 0x3b, 0x1301, 0x1295, 0x3b, 0x1301, 0x120b, 0x12ed, 0x3b, 0x12a6,
-0x1308, 0x1235, 0x1275, 0x3b, 0x1234, 0x1355, 0x1274, 0x121d, 0x1260, 0x122d, 0x3b, 0x12a6, 0x12ad, 0x1276, 0x1260, 0x122d, 0x3b, 0x1296, 0x126c, 0x121d,
-0x1260, 0x122d, 0x3b, 0x12f2, 0x1234, 0x121d, 0x1260, 0x122d, 0x3b, 0x1303, 0x3b, 0x134c, 0x3b, 0x121b, 0x3b, 0x12a4, 0x3b, 0x121c, 0x3b, 0x1301,
-0x3b, 0x1301, 0x3b, 0x12a6, 0x3b, 0x1234, 0x3b, 0x12a6, 0x3b, 0x1296, 0x3b, 0x12f2, 0x3b, 0x64a, 0x646, 0x627, 0x64a, 0x631, 0x3b, 0x641,
-0x628, 0x631, 0x627, 0x64a, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x623, 0x628, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a,
-0x648, 0x3b, 0x64a, 0x648, 0x646, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x644, 0x64a, 0x648, 0x3b, 0x623, 0x63a, 0x633, 0x637, 0x633, 0x3b,
-0x633, 0x628, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x641, 0x645, 0x628, 0x631,
-0x3b, 0x62f, 0x64a, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x64a, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x623, 0x3b, 0x648, 0x3b, 0x646, 0x3b,
-0x644, 0x3b, 0x63a, 0x3b, 0x633, 0x3b, 0x643, 0x3b, 0x628, 0x3b, 0x62f, 0x3b, 0x62c, 0x627, 0x646, 0x641, 0x64a, 0x3b, 0x641, 0x64a,
-0x641, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x623, 0x641, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x3b, 0x62c,
-0x648, 0x627, 0x646, 0x3b, 0x62c, 0x648, 0x64a, 0x644, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x62a, 0x3b, 0x633, 0x628, 0x62a, 0x645, 0x628,
-0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x641, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x64a, 0x633, 0x645,
-0x628, 0x631, 0x3b, 0x62c, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x623, 0x3b, 0x645, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x623, 0x3b, 0x633,
-0x3b, 0x623, 0x3b, 0x646, 0x3b, 0x62f, 0x3b, 0x643, 0x627, 0x646, 0x648, 0x646, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x64a, 0x3b,
-0x634, 0x628, 0x627, 0x637, 0x3b, 0x622, 0x630, 0x627, 0x631, 0x3b, 0x646, 0x64a, 0x633, 0x627, 0x646, 0x3b, 0x623, 0x64a, 0x627, 0x631,
-0x3b, 0x62d, 0x632, 0x64a, 0x631, 0x627, 0x646, 0x3b, 0x62a, 0x645, 0x648, 0x632, 0x3b, 0x622, 0x628, 0x3b, 0x623, 0x64a, 0x644, 0x648,
-0x644, 0x3b, 0x62a, 0x634, 0x631, 0x64a, 0x646, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x64a, 0x646, 0x20,
-0x627, 0x644, 0x62b, 0x627, 0x646, 0x64a, 0x3b, 0x643, 0x627, 0x646, 0x648, 0x646, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x643,
-0x3b, 0x634, 0x3b, 0x622, 0x3b, 0x646, 0x3b, 0x623, 0x3b, 0x62d, 0x3b, 0x62a, 0x3b, 0x622, 0x3b, 0x623, 0x3b, 0x62a, 0x3b, 0x62a,
-0x3b, 0x643, 0x3b, 0x643, 0x627, 0x646, 0x648, 0x646, 0x20, 0x627, 0x644, 0x62b, 0x627, 0x646, 0x64a, 0x3b, 0x634, 0x628, 0x627, 0x637,
-0x3b, 0x622, 0x630, 0x627, 0x631, 0x3b, 0x646, 0x64a, 0x633, 0x627, 0x646, 0x3b, 0x623, 0x64a, 0x627, 0x631, 0x3b, 0x62d, 0x632, 0x64a,
-0x631, 0x627, 0x646, 0x3b, 0x62a, 0x645, 0x648, 0x632, 0x3b, 0x622, 0x628, 0x3b, 0x623, 0x64a, 0x644, 0x648, 0x644, 0x3b, 0x62a, 0x634,
-0x631, 0x64a, 0x646, 0xa0, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x64a, 0x646, 0x20, 0x627, 0x644, 0x62b, 0x627,
-0x646, 0x64a, 0x3b, 0x643, 0x627, 0x646, 0x648, 0x646, 0x20, 0x627, 0x644, 0x623, 0x648, 0x644, 0x3b, 0x64a, 0x646, 0x627, 0x64a, 0x631,
-0x3b, 0x641, 0x628, 0x631, 0x627, 0x64a, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x625, 0x628, 0x631, 0x64a, 0x644, 0x3b, 0x645,
-0x627, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x646, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x644, 0x64a, 0x648, 0x3b, 0x623, 0x63a, 0x634, 0x62a,
-0x3b, 0x634, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x641, 0x645, 0x628, 0x631,
-0x3b, 0x62f, 0x62c, 0x645, 0x628, 0x631, 0x3b, 0x64a, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x625, 0x3b, 0x648, 0x3b, 0x646, 0x3b, 0x644,
-0x3b, 0x63a, 0x3b, 0x634, 0x3b, 0x643, 0x3b, 0x628, 0x3b, 0x62f, 0x3b, 0x64a, 0x646, 0x627, 0x64a, 0x631, 0x3b, 0x641, 0x628, 0x631,
-0x627, 0x64a, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x623, 0x628, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x627, 0x64a, 0x3b, 0x64a,
-0x648, 0x646, 0x64a, 0x648, 0x3b, 0x64a, 0x648, 0x644, 0x64a, 0x648, 0x632, 0x3b, 0x63a, 0x634, 0x62a, 0x3b, 0x634, 0x62a, 0x646, 0x628,
-0x631, 0x3b, 0x623, 0x643, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x646, 0x628, 0x631, 0x3b, 0x62f, 0x62c, 0x646, 0x628, 0x631,
-0x3b, 0x64a, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x623, 0x3b, 0x645, 0x3b, 0x646, 0x3b, 0x644, 0x3b, 0x63a, 0x3b, 0x634, 0x3b, 0x643,
-0x3b, 0x628, 0x3b, 0x62f, 0x3b, 0x570, 0x576, 0x57e, 0x3b, 0x583, 0x57f, 0x57e, 0x3b, 0x574, 0x580, 0x57f, 0x3b, 0x561, 0x57a, 0x580,
-0x3b, 0x574, 0x575, 0x57d, 0x3b, 0x570, 0x576, 0x57d, 0x3b, 0x570, 0x56c, 0x57d, 0x3b, 0x585, 0x563, 0x57d, 0x3b, 0x57d, 0x565, 0x57a,
-0x3b, 0x570, 0x578, 0x56f, 0x3b, 0x576, 0x578, 0x575, 0x3b, 0x564, 0x565, 0x56f, 0x3b, 0x570, 0x578, 0x582, 0x576, 0x57e, 0x561, 0x580,
-0x3b, 0x583, 0x565, 0x57f, 0x580, 0x57e, 0x561, 0x580, 0x3b, 0x574, 0x561, 0x580, 0x57f, 0x3b, 0x561, 0x57a, 0x580, 0x56b, 0x56c, 0x3b,
-0x574, 0x561, 0x575, 0x56b, 0x57d, 0x3b, 0x570, 0x578, 0x582, 0x576, 0x56b, 0x57d, 0x3b, 0x570, 0x578, 0x582, 0x56c, 0x56b, 0x57d, 0x3b,
-0x585, 0x563, 0x578, 0x57d, 0x57f, 0x578, 0x57d, 0x3b, 0x57d, 0x565, 0x57a, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x570, 0x578,
-0x56f, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x576, 0x578, 0x575, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x564, 0x565, 0x56f,
-0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x3b, 0x540, 0x3b, 0x553, 0x3b, 0x544, 0x3b, 0x531, 0x3b, 0x544, 0x3b, 0x540, 0x3b, 0x540,
-0x3b, 0x555, 0x3b, 0x54d, 0x3b, 0x540, 0x3b, 0x546, 0x3b, 0x534, 0x3b, 0x570, 0x578, 0x582, 0x576, 0x57e, 0x561, 0x580, 0x56b, 0x3b,
-0x583, 0x565, 0x57f, 0x580, 0x57e, 0x561, 0x580, 0x56b, 0x3b, 0x574, 0x561, 0x580, 0x57f, 0x56b, 0x3b, 0x561, 0x57a, 0x580, 0x56b, 0x56c,
-0x56b, 0x3b, 0x574, 0x561, 0x575, 0x56b, 0x57d, 0x56b, 0x3b, 0x570, 0x578, 0x582, 0x576, 0x56b, 0x57d, 0x56b, 0x3b, 0x570, 0x578, 0x582,
-0x56c, 0x56b, 0x57d, 0x56b, 0x3b, 0x585, 0x563, 0x578, 0x57d, 0x57f, 0x578, 0x57d, 0x56b, 0x3b, 0x57d, 0x565, 0x57a, 0x57f, 0x565, 0x574,
-0x562, 0x565, 0x580, 0x56b, 0x3b, 0x570, 0x578, 0x56f, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x56b, 0x3b, 0x576, 0x578, 0x575, 0x565,
-0x574, 0x562, 0x565, 0x580, 0x56b, 0x3b, 0x564, 0x565, 0x56f, 0x57f, 0x565, 0x574, 0x562, 0x565, 0x580, 0x56b, 0x3b, 0x99c, 0x9be, 0x9a8,
-0x9c1, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x9cd, 0x9f0, 0x9c1, 0x3b, 0x9ae, 0x9be, 0x9f0, 0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9f0, 0x9bf,
-0x9b2, 0x3b, 0x9ae, 0x9c7, 0x2019, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x3b, 0x99b,
-0x9c7, 0x9aa, 0x9cd, 0x9a4, 0x9c7, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x3b, 0x9a8, 0x9f1, 0x9c7, 0x3b, 0x9a1, 0x9bf, 0x99a, 0x9c7,
-0x3b, 0x99c, 0x9be, 0x9a8, 0x9c1, 0x9f1, 0x9be, 0x9f0, 0x9c0, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x9cd, 0x9f0, 0x9c1, 0x9f1, 0x9be, 0x9f0, 0x9c0,
-0x3b, 0x9ae, 0x9be, 0x9f0, 0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9f0, 0x9bf, 0x9b2, 0x3b, 0x9ae, 0x9c7, 0x2019, 0x3b, 0x99c, 0x9c1,
-0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x9b7, 0x9cd, 0x99f, 0x3b, 0x99b, 0x9c7, 0x9aa, 0x9cd, 0x9a4, 0x9c7,
-0x9ae, 0x9cd, 0x9ac, 0x9f0, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x9ac, 0x9f0, 0x3b, 0x9a8, 0x9f1, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9f0,
-0x3b, 0x9a1, 0x9bf, 0x99a, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9f0, 0x3b, 0x99c, 0x3b, 0x9ab, 0x3b, 0x9ae, 0x3b, 0x98f, 0x3b, 0x9ae, 0x3b,
-0x99c, 0x3b, 0x99c, 0x3b, 0x986, 0x3b, 0x99b, 0x3b, 0x985, 0x3b, 0x9a8, 0x3b, 0x9a1, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65,
-0x76, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x69, 0x79, 0x6e, 0x3b, 0x69, 0x79,
-0x6c, 0x3b, 0x61, 0x76, 0x71, 0x3b, 0x73, 0x65, 0x6e, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x79, 0x3b, 0x64, 0x65,
-0x6b, 0x3b, 0x59, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x76, 0x72, 0x61, 0x6c, 0x3b, 0x4d, 0x61, 0x72, 0x74,
-0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x130, 0x79, 0x75, 0x6e, 0x3b, 0x130, 0x79, 0x75, 0x6c,
-0x3b, 0x41, 0x76, 0x71, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x6e, 0x74, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x4f, 0x6b, 0x74,
-0x79, 0x61, 0x62, 0x72, 0x3b, 0x4e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x44, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0x79,
-0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x76, 0x72, 0x61, 0x6c, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70,
-0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x69, 0x79, 0x75, 0x6e, 0x3b, 0x69, 0x79, 0x75, 0x6c, 0x3b, 0x61, 0x76,
-0x71, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x6e, 0x74, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x79, 0x61, 0x62,
-0x72, 0x3b, 0x6e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x64, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0x458, 0x430, 0x43d, 0x3b,
-0x444, 0x435, 0x432, 0x3b, 0x43c, 0x430, 0x440, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x458, 0x43d, 0x3b,
-0x438, 0x458, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435, 0x43d, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x458, 0x3b,
-0x434, 0x435, 0x43a, 0x3b, 0x408, 0x430, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x41c, 0x430,
-0x440, 0x442, 0x3b, 0x410, 0x43f, 0x440, 0x435, 0x43b, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x458, 0x443, 0x43d, 0x3b, 0x418, 0x458,
-0x443, 0x43b, 0x3b, 0x410, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x41e,
-0x43a, 0x442, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x41d, 0x43e, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431, 0x440,
-0x3b, 0x458, 0x430, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b,
-0x430, 0x43f, 0x440, 0x435, 0x43b, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x458, 0x443, 0x43d, 0x3b, 0x438, 0x458, 0x443, 0x43b, 0x3b,
-0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x458,
-0x430, 0x431, 0x440, 0x3b, 0x43d, 0x43e, 0x458, 0x430, 0x431, 0x440, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0x75, 0x72,
-0x74, 0x2e, 0x3b, 0x6f, 0x74, 0x73, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x69, 0x2e, 0x3b, 0x6d, 0x61,
-0x69, 0x2e, 0x3b, 0x65, 0x6b, 0x61, 0x2e, 0x3b, 0x75, 0x7a, 0x74, 0x2e, 0x3b, 0x61, 0x62, 0x75, 0x2e, 0x3b, 0x69, 0x72,
-0x61, 0x2e, 0x3b, 0x75, 0x72, 0x72, 0x2e, 0x3b, 0x61, 0x7a, 0x61, 0x2e, 0x3b, 0x61, 0x62, 0x65, 0x2e, 0x3b, 0x75, 0x72,
-0x74, 0x61, 0x72, 0x72, 0x69, 0x6c, 0x61, 0x3b, 0x6f, 0x74, 0x73, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x74,
-0x78, 0x6f, 0x61, 0x3b, 0x61, 0x70, 0x69, 0x72, 0x69, 0x6c, 0x61, 0x3b, 0x6d, 0x61, 0x69, 0x61, 0x74, 0x7a, 0x61, 0x3b,
-0x65, 0x6b, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x75, 0x7a, 0x74, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x61, 0x62, 0x75, 0x7a, 0x74,
-0x75, 0x61, 0x3b, 0x69, 0x72, 0x61, 0x69, 0x6c, 0x61, 0x3b, 0x75, 0x72, 0x72, 0x69, 0x61, 0x3b, 0x61, 0x7a, 0x61, 0x72,
-0x6f, 0x61, 0x3b, 0x61, 0x62, 0x65, 0x6e, 0x64, 0x75, 0x61, 0x3b, 0x55, 0x3b, 0x4f, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d,
-0x3b, 0x45, 0x3b, 0x55, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x55, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x99c, 0x9be, 0x9a8, 0x9c1, 0x9af,
-0x9bc, 0x9be, 0x9b0, 0x9c0, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x9cd, 0x9b0, 0x9c1, 0x9af, 0x9bc, 0x9be, 0x9b0, 0x9c0, 0x3b, 0x9ae, 0x9be, 0x9b0,
-0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9b0, 0x9bf, 0x9b2, 0x3b, 0x9ae, 0x9c7, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2,
-0x9be, 0x987, 0x3b, 0x986, 0x997, 0x9b8, 0x9cd, 0x99f, 0x3b, 0x9b8, 0x9c7, 0x9aa, 0x9cd, 0x99f, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b,
-0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x9ac, 0x9b0, 0x3b, 0x9a8, 0x9ad, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x9a1, 0x9bf, 0x9b8, 0x9c7,
-0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x99c, 0x9be, 0x3b, 0x9ab, 0x9c7, 0x3b, 0x9ae, 0x9be, 0x3b, 0x98f, 0x3b, 0x9ae, 0x9c7, 0x3b, 0x99c,
-0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x3b, 0x986, 0x3b, 0x9b8, 0x9c7, 0x3b, 0x985, 0x3b, 0x9a8, 0x3b, 0x9a1, 0x9bf, 0x3b, 0x99c, 0x9be,
-0x9a8, 0x9c1, 0x3b, 0x9ab, 0x9c7, 0x9ac, 0x3b, 0x9ae, 0x9be, 0x9b0, 0x9cd, 0x99a, 0x3b, 0x98f, 0x9aa, 0x9cd, 0x9b0, 0x9bf, 0x9b2, 0x3b,
-0x9ae, 0x9c7, 0x3b, 0x99c, 0x9c1, 0x9a8, 0x3b, 0x99c, 0x9c1, 0x9b2, 0x9be, 0x987, 0x3b, 0x986, 0x997, 0x9b8, 0x9cd, 0x99f, 0x3b, 0x9b8,
-0x9c7, 0x9aa, 0x9cd, 0x99f, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x985, 0x995, 0x9cd, 0x99f, 0x9cb, 0x9ac, 0x9b0, 0x3b, 0x9a8, 0x9ad,
-0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0x9a1, 0x9bf, 0x9b8, 0x9c7, 0x9ae, 0x9cd, 0x9ac, 0x9b0, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0x3b,
-0xf5f, 0xfb3, 0xf0b, 0xf22, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf23, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf24, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf25, 0x3b,
-0xf5f, 0xfb3, 0xf0b, 0xf26, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf27, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf28, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf29, 0x3b,
-0xf5f, 0xfb3, 0xf0b, 0xf21, 0xf20, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0xf21, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf21, 0xf22, 0x3b, 0xf66, 0xfa4,
-0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf44, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf42,
-0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf66, 0xf74, 0xf58, 0xf0b,
-0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54, 0x3b, 0xf66, 0xfa4, 0xfb1,
-0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf51,
-0xfb2, 0xf74, 0xf42, 0xf0b, 0xf54, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54,
-0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf62, 0xf92, 0xfb1, 0xf51, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66,
-0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf42, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f,
-0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74,
-0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xfb1, 0xf72, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74,
-0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf21, 0x3b, 0xf22, 0x3b, 0xf23, 0x3b, 0xf24, 0x3b, 0xf25, 0x3b, 0xf26,
-0x3b, 0xf27, 0x3b, 0xf28, 0x3b, 0xf29, 0x3b, 0xf21, 0xf20, 0x3b, 0xf21, 0xf21, 0x3b, 0xf21, 0xf22, 0x3b, 0xf21, 0x3b, 0xf22, 0x3b,
-0xf23, 0x3b, 0xf24, 0x3b, 0xf25, 0x3b, 0xf26, 0x3b, 0xf27, 0x3b, 0xf28, 0x3b, 0xf29, 0x3b, 0xf21, 0xf20, 0x3b, 0xf21, 0xf21, 0x3b,
-0x31, 0x32, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf44, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54,
-0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf42, 0xf66, 0xf74, 0xf58, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b,
-0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xfb2, 0xf74, 0xf42, 0xf0b,
-0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf62, 0xf92, 0xfb1,
-0xf51, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf51, 0xf42, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45,
-0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b,
-0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf21, 0x3b, 0xf22, 0x3b, 0xf23,
-0x3b, 0x34, 0x3b, 0xf25, 0x3b, 0xf26, 0x3b, 0xf27, 0x3b, 0xf28, 0x3b, 0x39, 0x3b, 0xf21, 0xf20, 0x3b, 0xf21, 0xf21, 0x3b, 0xf21,
-0xf22, 0x3b, 0x47, 0x65, 0x6e, 0x2e, 0x3b, 0x43, 0x2bc, 0x68, 0x77, 0x65, 0x2e, 0x3b, 0x4d, 0x65, 0x75, 0x72, 0x2e, 0x3b,
-0x45, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x65, 0x3b, 0x4d, 0x65, 0x7a, 0x68, 0x2e, 0x3b, 0x47, 0x6f, 0x75, 0x65, 0x2e,
-0x3b, 0x45, 0x6f, 0x73, 0x74, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x2e, 0x3b, 0x48, 0x65, 0x72, 0x65, 0x3b, 0x44, 0x75, 0x3b,
-0x4b, 0x7a, 0x75, 0x2e, 0x3b, 0x47, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x3b, 0x43, 0x2bc, 0x68, 0x77, 0x65, 0x76, 0x72, 0x65,
-0x72, 0x3b, 0x4d, 0x65, 0x75, 0x72, 0x7a, 0x68, 0x3b, 0x45, 0x62, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0x65, 0x3b, 0x4d,
-0x65, 0x7a, 0x68, 0x65, 0x76, 0x65, 0x6e, 0x3b, 0x47, 0x6f, 0x75, 0x65, 0x72, 0x65, 0x3b, 0x45, 0x6f, 0x73, 0x74, 0x3b,
-0x47, 0x77, 0x65, 0x6e, 0x67, 0x6f, 0x6c, 0x6f, 0x3b, 0x48, 0x65, 0x72, 0x65, 0x3b, 0x44, 0x75, 0x3b, 0x4b, 0x65, 0x72,
-0x7a, 0x75, 0x3b, 0x30, 0x31, 0x3b, 0x30, 0x32, 0x3b, 0x30, 0x33, 0x3b, 0x30, 0x34, 0x3b, 0x30, 0x35, 0x3b, 0x30, 0x36,
-0x3b, 0x30, 0x37, 0x3b, 0x30, 0x38, 0x3b, 0x30, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31, 0x32, 0x3b, 0x44f,
-0x43d, 0x443, 0x3b, 0x444, 0x435, 0x432, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x439, 0x3b,
-0x44e, 0x43d, 0x438, 0x3b, 0x44e, 0x43b, 0x438, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435, 0x43f, 0x3b, 0x43e, 0x43a, 0x442, 0x3b,
-0x43d, 0x43e, 0x435, 0x3b, 0x434, 0x435, 0x43a, 0x3b, 0x44f, 0x43d, 0x443, 0x430, 0x440, 0x438, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x443,
-0x430, 0x440, 0x438, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x438, 0x43b, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x44e,
-0x43d, 0x438, 0x3b, 0x44e, 0x43b, 0x438, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x43c,
-0x432, 0x440, 0x438, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x43d, 0x43e, 0x435, 0x43c, 0x432, 0x440, 0x438,
-0x3b, 0x434, 0x435, 0x43a, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x44f, 0x3b, 0x444, 0x3b, 0x43c, 0x3b, 0x430, 0x3b, 0x43c, 0x3b,
-0x44e, 0x3b, 0x44e, 0x3b, 0x430, 0x3b, 0x441, 0x3b, 0x43e, 0x3b, 0x43d, 0x3b, 0x434, 0x3b, 0x1007, 0x1014, 0x103a, 0x3b, 0x1016, 0x1031,
-0x3b, 0x1019, 0x1010, 0x103a, 0x3b, 0x1027, 0x3b, 0x1019, 0x1031, 0x3b, 0x1007, 0x103d, 0x1014, 0x103a, 0x3b, 0x1007, 0x1030, 0x3b, 0x1029, 0x3b,
-0x1005, 0x1000, 0x103a, 0x3b, 0x1021, 0x1031, 0x102c, 0x1000, 0x103a, 0x3b, 0x1014, 0x102d, 0x102f, 0x3b, 0x1012, 0x102e, 0x3b, 0x1007, 0x1014, 0x103a,
-0x1014, 0x101d, 0x102b, 0x101b, 0x102e, 0x3b, 0x1016, 0x1031, 0x1016, 0x1031, 0x102c, 0x103a, 0x101d, 0x102b, 0x101b, 0x102e, 0x3b, 0x1019, 0x1010, 0x103a,
-0x3b, 0x1027, 0x1015, 0x103c, 0x102e, 0x3b, 0x1019, 0x1031, 0x3b, 0x1007, 0x103d, 0x1014, 0x103a, 0x3b, 0x1007, 0x1030, 0x101c, 0x102d, 0x102f, 0x1004,
-0x103a, 0x3b, 0x1029, 0x1002, 0x102f, 0x1010, 0x103a, 0x3b, 0x1005, 0x1000, 0x103a, 0x1010, 0x1004, 0x103a, 0x1018, 0x102c, 0x3b, 0x1021, 0x1031, 0x102c,
-0x1000, 0x103a, 0x1010, 0x102d, 0x102f, 0x1018, 0x102c, 0x3b, 0x1014, 0x102d, 0x102f, 0x101d, 0x1004, 0x103a, 0x1018, 0x102c, 0x3b, 0x1012, 0x102e, 0x1007,
-0x1004, 0x103a, 0x1018, 0x102c, 0x3b, 0x1007, 0x3b, 0x1016, 0x3b, 0x1019, 0x3b, 0x1027, 0x3b, 0x1019, 0x3b, 0x1007, 0x3b, 0x1007, 0x3b, 0x1029,
-0x3b, 0x1005, 0x3b, 0x1021, 0x3b, 0x1014, 0x3b, 0x1012, 0x3b, 0x441, 0x442, 0x443, 0x3b, 0x43b, 0x44e, 0x442, 0x3b, 0x441, 0x430, 0x43a,
-0x3b, 0x43a, 0x440, 0x430, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x447, 0x44d, 0x440, 0x3b, 0x43b, 0x456, 0x43f, 0x3b, 0x436, 0x43d, 0x456,
-0x3b, 0x432, 0x435, 0x440, 0x3b, 0x43a, 0x430, 0x441, 0x3b, 0x43b, 0x456, 0x441, 0x3b, 0x441, 0x43d, 0x435, 0x3b, 0x441, 0x442, 0x443,
-0x434, 0x437, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x44e, 0x442, 0x44b, 0x3b, 0x441, 0x430, 0x43a, 0x430, 0x432, 0x456, 0x43a, 0x3b, 0x43a,
-0x440, 0x430, 0x441, 0x430, 0x432, 0x456, 0x43a, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x447, 0x44d, 0x440, 0x432, 0x435, 0x43d, 0x44c, 0x3b,
-0x43b, 0x456, 0x43f, 0x435, 0x43d, 0x44c, 0x3b, 0x436, 0x43d, 0x456, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x432, 0x435, 0x440, 0x430, 0x441,
-0x435, 0x43d, 0x44c, 0x3b, 0x43a, 0x430, 0x441, 0x442, 0x440, 0x44b, 0x447, 0x43d, 0x456, 0x43a, 0x3b, 0x43b, 0x456, 0x441, 0x442, 0x430,
-0x43f, 0x430, 0x434, 0x3b, 0x441, 0x43d, 0x435, 0x436, 0x430, 0x43d, 0x44c, 0x3b, 0x441, 0x3b, 0x43b, 0x3b, 0x441, 0x3b, 0x43a, 0x3b,
-0x43c, 0x3b, 0x447, 0x3b, 0x43b, 0x3b, 0x436, 0x3b, 0x432, 0x3b, 0x43a, 0x3b, 0x43b, 0x3b, 0x441, 0x3b, 0x441, 0x442, 0x443, 0x3b,
-0x43b, 0x44e, 0x442, 0x3b, 0x441, 0x430, 0x43a, 0x3b, 0x43a, 0x440, 0x430, 0x3b, 0x43c, 0x430, 0x44f, 0x3b, 0x447, 0x44d, 0x440, 0x3b,
-0x43b, 0x456, 0x43f, 0x3b, 0x436, 0x43d, 0x456, 0x3b, 0x432, 0x435, 0x440, 0x3b, 0x43a, 0x430, 0x441, 0x3b, 0x43b, 0x456, 0x441, 0x3b,
-0x441, 0x43d, 0x435, 0x3b, 0x441, 0x442, 0x443, 0x434, 0x437, 0x435, 0x43d, 0x44f, 0x3b, 0x43b, 0x44e, 0x442, 0x430, 0x433, 0x430, 0x3b,
-0x441, 0x430, 0x43a, 0x430, 0x432, 0x456, 0x43a, 0x430, 0x3b, 0x43a, 0x440, 0x430, 0x441, 0x430, 0x432, 0x456, 0x43a, 0x430, 0x3b, 0x43c,
-0x430, 0x44f, 0x3b, 0x447, 0x44d, 0x440, 0x432, 0x435, 0x43d, 0x44f, 0x3b, 0x43b, 0x456, 0x43f, 0x435, 0x43d, 0x44f, 0x3b, 0x436, 0x43d,
-0x456, 0x45e, 0x43d, 0x44f, 0x3b, 0x432, 0x435, 0x440, 0x430, 0x441, 0x43d, 0x44f, 0x3b, 0x43a, 0x430, 0x441, 0x442, 0x440, 0x44b, 0x447,
-0x43d, 0x456, 0x43a, 0x430, 0x3b, 0x43b, 0x456, 0x441, 0x442, 0x430, 0x43f, 0x430, 0x434, 0x430, 0x3b, 0x441, 0x43d, 0x435, 0x436, 0x43d,
-0x44f, 0x3b, 0x1798, 0x1780, 0x179a, 0x17b6, 0x3b, 0x1780, 0x17bb, 0x1798, 0x17d2, 0x1797, 0x17c8, 0x3b, 0x1798, 0x17b8, 0x1793, 0x17b6, 0x3b, 0x1798,
-0x17c1, 0x179f, 0x17b6, 0x3b, 0x17a7, 0x179f, 0x1797, 0x17b6, 0x3b, 0x1798, 0x17b7, 0x1790, 0x17bb, 0x1793, 0x17b6, 0x3b, 0x1780, 0x1780, 0x17d2, 0x1780,
-0x178a, 0x17b6, 0x3b, 0x179f, 0x17b8, 0x17a0, 0x17b6, 0x3b, 0x1780, 0x1789, 0x17d2, 0x1789, 0x17b6, 0x3b, 0x178f, 0x17bb, 0x179b, 0x17b6, 0x3b, 0x179c,
-0x17b7, 0x1785, 0x17d2, 0x1786, 0x17b7, 0x1780, 0x17b6, 0x3b, 0x1792, 0x17d2, 0x1793, 0x17bc, 0x3b, 0x1798, 0x3b, 0x1780, 0x3b, 0x1798, 0x3b, 0x1798,
-0x3b, 0x17a7, 0x3b, 0x1798, 0x3b, 0x1780, 0x3b, 0x179f, 0x3b, 0x1780, 0x3b, 0x178f, 0x3b, 0x179c, 0x3b, 0x1792, 0x3b, 0x67, 0x65, 0x6e,
-0x2e, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0xe7, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61,
-0x69, 0x67, 0x3b, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x74,
-0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x67, 0x65, 0x6e,
-0x65, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0xe7, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c,
-0x3b, 0x6d, 0x61, 0x69, 0x67, 0x3b, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x6c, 0x3b, 0x61, 0x67,
-0x6f, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65,
-0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x47,
-0x4e, 0x3b, 0x46, 0x42, 0x3b, 0x4d, 0xc7, 0x3b, 0x41, 0x42, 0x3b, 0x4d, 0x47, 0x3b, 0x4a, 0x4e, 0x3b, 0x4a, 0x4c, 0x3b,
-0x41, 0x47, 0x3b, 0x53, 0x54, 0x3b, 0x4f, 0x43, 0x3b, 0x4e, 0x56, 0x3b, 0x44, 0x53, 0x3b, 0x64, 0x65, 0x20, 0x67, 0x65,
-0x6e, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x66, 0x65, 0x62, 0x72, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x72, 0xe7, 0x3b,
-0x64, 0x2019, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x69, 0x67, 0x3b, 0x64, 0x65, 0x20, 0x6a, 0x75,
-0x6e, 0x79, 0x3b, 0x64, 0x65, 0x20, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x64, 0x2019, 0x61, 0x67, 0x2e, 0x3b, 0x64, 0x65, 0x20,
-0x73, 0x65, 0x74, 0x2e, 0x3b, 0x64, 0x2019, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x6e, 0x6f, 0x76, 0x2e, 0x3b,
-0x64, 0x65, 0x20, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x20,
-0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x72, 0xe7, 0x3b, 0x64, 0x2019, 0x61, 0x62, 0x72,
-0x69, 0x6c, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x69, 0x67, 0x3b, 0x64, 0x65, 0x20, 0x6a, 0x75, 0x6e, 0x79, 0x3b, 0x64,
-0x65, 0x20, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x6c, 0x3b, 0x64, 0x2019, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x3b, 0x64, 0x65, 0x20,
-0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x2019, 0x6f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x64,
-0x65, 0x20, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x65, 0x20, 0x64, 0x65, 0x73, 0x65, 0x6d, 0x62,
-0x72, 0x65, 0x3b, 0x31, 0x6708, 0x3b, 0x32, 0x6708, 0x3b, 0x33, 0x6708, 0x3b, 0x34, 0x6708, 0x3b, 0x35, 0x6708, 0x3b, 0x36, 0x6708,
-0x3b, 0x37, 0x6708, 0x3b, 0x38, 0x6708, 0x3b, 0x39, 0x6708, 0x3b, 0x31, 0x30, 0x6708, 0x3b, 0x31, 0x31, 0x6708, 0x3b, 0x31, 0x32,
-0x6708, 0x3b, 0x4e00, 0x6708, 0x3b, 0x4e8c, 0x6708, 0x3b, 0x4e09, 0x6708, 0x3b, 0x56db, 0x6708, 0x3b, 0x4e94, 0x6708, 0x3b, 0x516d, 0x6708, 0x3b,
-0x4e03, 0x6708, 0x3b, 0x516b, 0x6708, 0x3b, 0x4e5d, 0x6708, 0x3b, 0x5341, 0x6708, 0x3b, 0x5341, 0x4e00, 0x6708, 0x3b, 0x5341, 0x4e8c, 0x6708, 0x3b,
-0x73, 0x69, 0x6a, 0x3b, 0x76, 0x65, 0x6c, 0x6a, 0x3b, 0x6f, 0x17e, 0x75, 0x3b, 0x74, 0x72, 0x61, 0x3b, 0x73, 0x76, 0x69,
-0x3b, 0x6c, 0x69, 0x70, 0x3b, 0x73, 0x72, 0x70, 0x3b, 0x6b, 0x6f, 0x6c, 0x3b, 0x72, 0x75, 0x6a, 0x3b, 0x6c, 0x69, 0x73,
-0x3b, 0x73, 0x74, 0x75, 0x3b, 0x70, 0x72, 0x6f, 0x3b, 0x73, 0x69, 0x6a, 0x65, 0x10d, 0x61, 0x6e, 0x6a, 0x3b, 0x76, 0x65,
-0x6c, 0x6a, 0x61, 0x10d, 0x61, 0x3b, 0x6f, 0x17e, 0x75, 0x6a, 0x61, 0x6b, 0x3b, 0x74, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x6a,
-0x3b, 0x73, 0x76, 0x69, 0x62, 0x61, 0x6e, 0x6a, 0x3b, 0x6c, 0x69, 0x70, 0x61, 0x6e, 0x6a, 0x3b, 0x73, 0x72, 0x70, 0x61,
-0x6e, 0x6a, 0x3b, 0x6b, 0x6f, 0x6c, 0x6f, 0x76, 0x6f, 0x7a, 0x3b, 0x72, 0x75, 0x6a, 0x61, 0x6e, 0x3b, 0x6c, 0x69, 0x73,
-0x74, 0x6f, 0x70, 0x61, 0x64, 0x3b, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x69, 0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e,
-0x61, 0x63, 0x3b, 0x31, 0x2e, 0x3b, 0x32, 0x2e, 0x3b, 0x33, 0x2e, 0x3b, 0x34, 0x2e, 0x3b, 0x35, 0x2e, 0x3b, 0x36, 0x2e,
-0x3b, 0x37, 0x2e, 0x3b, 0x38, 0x2e, 0x3b, 0x39, 0x2e, 0x3b, 0x31, 0x30, 0x2e, 0x3b, 0x31, 0x31, 0x2e, 0x3b, 0x31, 0x32,
-0x2e, 0x3b, 0x73, 0x69, 0x6a, 0x65, 0x10d, 0x6e, 0x6a, 0x61, 0x3b, 0x76, 0x65, 0x6c, 0x6a, 0x61, 0x10d, 0x65, 0x3b, 0x6f,
-0x17e, 0x75, 0x6a, 0x6b, 0x61, 0x3b, 0x74, 0x72, 0x61, 0x76, 0x6e, 0x6a, 0x61, 0x3b, 0x73, 0x76, 0x69, 0x62, 0x6e, 0x6a,
-0x61, 0x3b, 0x6c, 0x69, 0x70, 0x6e, 0x6a, 0x61, 0x3b, 0x73, 0x72, 0x70, 0x6e, 0x6a, 0x61, 0x3b, 0x6b, 0x6f, 0x6c, 0x6f,
-0x76, 0x6f, 0x7a, 0x61, 0x3b, 0x72, 0x75, 0x6a, 0x6e, 0x61, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x61,
-0x3b, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x6f, 0x67, 0x61, 0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e, 0x63, 0x61, 0x3b,
-0x6c, 0x65, 0x64, 0x3b, 0xfa, 0x6e, 0x6f, 0x3b, 0x62, 0x159, 0x65, 0x3b, 0x64, 0x75, 0x62, 0x3b, 0x6b, 0x76, 0x11b, 0x3b,
-0x10d, 0x76, 0x6e, 0x3b, 0x10d, 0x76, 0x63, 0x3b, 0x73, 0x72, 0x70, 0x3b, 0x7a, 0xe1, 0x159, 0x3b, 0x159, 0xed, 0x6a, 0x3b,
-0x6c, 0x69, 0x73, 0x3b, 0x70, 0x72, 0x6f, 0x3b, 0x6c, 0x65, 0x64, 0x65, 0x6e, 0x3b, 0xfa, 0x6e, 0x6f, 0x72, 0x3b, 0x62,
-0x159, 0x65, 0x7a, 0x65, 0x6e, 0x3b, 0x64, 0x75, 0x62, 0x65, 0x6e, 0x3b, 0x6b, 0x76, 0x11b, 0x74, 0x65, 0x6e, 0x3b, 0x10d,
-0x65, 0x72, 0x76, 0x65, 0x6e, 0x3b, 0x10d, 0x65, 0x72, 0x76, 0x65, 0x6e, 0x65, 0x63, 0x3b, 0x73, 0x72, 0x70, 0x65, 0x6e,
-0x3b, 0x7a, 0xe1, 0x159, 0xed, 0x3b, 0x159, 0xed, 0x6a, 0x65, 0x6e, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64,
-0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e, 0x65, 0x63, 0x3b, 0x6c, 0x65, 0x64, 0x6e, 0x61, 0x3b, 0xfa, 0x6e, 0x6f, 0x72,
-0x61, 0x3b, 0x62, 0x159, 0x65, 0x7a, 0x6e, 0x61, 0x3b, 0x64, 0x75, 0x62, 0x6e, 0x61, 0x3b, 0x6b, 0x76, 0x11b, 0x74, 0x6e,
-0x61, 0x3b, 0x10d, 0x65, 0x72, 0x76, 0x6e, 0x61, 0x3b, 0x10d, 0x65, 0x72, 0x76, 0x65, 0x6e, 0x63, 0x65, 0x3b, 0x73, 0x72,
-0x70, 0x6e, 0x61, 0x3b, 0x7a, 0xe1, 0x159, 0xed, 0x3b, 0x159, 0xed, 0x6a, 0x6e, 0x61, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f,
-0x70, 0x61, 0x64, 0x75, 0x3b, 0x70, 0x72, 0x6f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66,
-0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75,
-0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b,
-0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b,
-0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b,
-0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74,
-0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e,
-0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e,
-0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x72, 0x74, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x65, 0x69,
-0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e,
-0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75,
-0x61, 0x72, 0x69, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x6d, 0x61, 0x61, 0x72, 0x74, 0x3b, 0x61,
-0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x65, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61,
-0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b,
-0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d,
-0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x41,
-0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x41, 0x75,
-0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x63, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65,
-0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d,
-0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x16d, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f,
-0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x6f, 0x3b, 0x66,
-0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x6f, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x6f,
-0x3b, 0x6d, 0x61, 0x6a, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x16d,
-0x67, 0x75, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6f, 0x6b, 0x74, 0x6f,
-0x62, 0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72,
-0x6f, 0x3b, 0x6a, 0x61, 0x61, 0x6e, 0x3b, 0x76, 0x65, 0x65, 0x62, 0x72, 0x3b, 0x6d, 0xe4, 0x72, 0x74, 0x73, 0x3b, 0x61,
-0x70, 0x72, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6c, 0x69, 0x3b, 0x61,
-0x75, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x74, 0x73,
-0x3b, 0x6a, 0x61, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x76, 0x65, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0xe4,
-0x72, 0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x75, 0x6e, 0x69,
-0x3b, 0x6a, 0x75, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d,
-0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65,
-0x72, 0x3b, 0x64, 0x65, 0x74, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x56, 0x3b, 0x4d, 0x3b, 0x41, 0x3b,
-0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6a, 0x61, 0x6e, 0x3b,
-0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x3b,
-0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b,
-0x64, 0x65, 0x73, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d,
-0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0xed, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a,
-0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72,
-0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65,
-0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72,
-0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e,
-0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e,
-0x3b, 0x64, 0x65, 0x73, 0x2e, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69, 0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x3b, 0x6d, 0x61,
-0x61, 0x6c, 0x69, 0x73, 0x3b, 0x68, 0x75, 0x68, 0x74, 0x69, 0x3b, 0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x3b, 0x6b, 0x65, 0x73,
-0xe4, 0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x3b, 0x65, 0x6c, 0x6f, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x3b, 0x6c, 0x6f, 0x6b,
-0x61, 0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x3b, 0x6a, 0x6f, 0x75, 0x6c, 0x75, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69,
-0x6b, 0x75, 0x75, 0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x6b, 0x75, 0x75, 0x3b, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x6b,
-0x75, 0x75, 0x3b, 0x68, 0x75, 0x68, 0x74, 0x69, 0x6b, 0x75, 0x75, 0x3b, 0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x6b, 0x75, 0x75,
-0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x6b, 0x75, 0x75, 0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x6b, 0x75, 0x75, 0x3b, 0x65, 0x6c,
-0x6f, 0x6b, 0x75, 0x75, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x6b, 0x75, 0x75, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x6b, 0x75, 0x75,
-0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x6b, 0x75, 0x75, 0x3b, 0x6a, 0x6f, 0x75, 0x6c, 0x75, 0x6b, 0x75, 0x75, 0x3b,
-0x54, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x48, 0x3b, 0x45, 0x3b, 0x53, 0x3b, 0x4c, 0x3b,
-0x4d, 0x3b, 0x4a, 0x3b, 0x74, 0x61, 0x6d, 0x6d, 0x69, 0x6b, 0x2e, 0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x6b, 0x2e, 0x3b,
-0x6d, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x6b, 0x2e, 0x3b, 0x68, 0x75, 0x68, 0x74, 0x69, 0x6b, 0x2e, 0x3b, 0x74, 0x6f, 0x75,
-0x6b, 0x6f, 0x6b, 0x2e, 0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x6b, 0x2e, 0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x6b, 0x2e, 0x3b,
-0x65, 0x6c, 0x6f, 0x6b, 0x2e, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x6b, 0x2e, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x6b, 0x2e, 0x3b,
-0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x6b, 0x2e, 0x3b, 0x6a, 0x6f, 0x75, 0x6c, 0x75, 0x6b, 0x2e, 0x3b, 0x74, 0x61, 0x6d,
-0x6d, 0x69, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x68, 0x65, 0x6c, 0x6d, 0x69, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6d,
-0x61, 0x61, 0x6c, 0x69, 0x73, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x68, 0x75, 0x68, 0x74, 0x69, 0x6b, 0x75, 0x75, 0x74,
-0x61, 0x3b, 0x74, 0x6f, 0x75, 0x6b, 0x6f, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6b, 0x65, 0x73, 0xe4, 0x6b, 0x75, 0x75,
-0x74, 0x61, 0x3b, 0x68, 0x65, 0x69, 0x6e, 0xe4, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x65, 0x6c, 0x6f, 0x6b, 0x75, 0x75,
-0x74, 0x61, 0x3b, 0x73, 0x79, 0x79, 0x73, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6c, 0x6f, 0x6b, 0x61, 0x6b, 0x75, 0x75,
-0x74, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x72, 0x61, 0x73, 0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6a, 0x6f, 0x75, 0x6c, 0x75,
-0x6b, 0x75, 0x75, 0x74, 0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x2e, 0x3b, 0x66, 0xe9, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61,
-0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x69, 0x6e, 0x3b, 0x6a, 0x75, 0x69,
-0x6c, 0x2e, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e,
-0x6f, 0x76, 0x2e, 0x3b, 0x64, 0xe9, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x69, 0x65, 0x72, 0x3b, 0x66, 0xe9, 0x76,
-0x72, 0x69, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b,
-0x6a, 0x75, 0x69, 0x6e, 0x3b, 0x6a, 0x75, 0x69, 0x6c, 0x6c, 0x65, 0x74, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65,
-0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x74, 0x6f, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65,
-0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0xe9, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x2e, 0x3b,
-0x66, 0xe9, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b,
-0x6a, 0x75, 0x69, 0x6e, 0x3b, 0x6a, 0x75, 0x69, 0x6c, 0x6c, 0x2e, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65, 0x70,
-0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0xe9, 0x63, 0x2e, 0x3b, 0x6a, 0x61,
-0x6e, 0x2e, 0x3b, 0x66, 0xe9, 0x76, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61,
-0x69, 0x3b, 0x6a, 0x75, 0x69, 0x2e, 0x3b, 0x6a, 0x75, 0x69, 0x6c, 0x2e, 0x3b, 0x61, 0x6f, 0xfb, 0x74, 0x3b, 0x73, 0x65,
-0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0xe9, 0x63, 0x2e, 0x3b, 0x4a,
-0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a,
-0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e,
-0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x6e, 0x65, 0x77, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x46, 0x65,
-0x62, 0x72, 0x65, 0x77, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c,
-0x3b, 0x4d, 0x61, 0x61, 0x69, 0x65, 0x3b, 0x4a, 0x75, 0x6e, 0x79, 0x3b, 0x4a, 0x75, 0x6c, 0x79, 0x3b, 0x41, 0x75, 0x67,
-0x75, 0x73, 0x74, 0x75, 0x73, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x69, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f,
-0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x69, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x73, 0x69, 0x6d, 0x62, 0x65,
-0x72, 0x3b, 0x46, 0x61, 0x6f, 0x69, 0x3b, 0x47, 0x65, 0x61, 0x72, 0x72, 0x3b, 0x4d, 0xe0, 0x72, 0x74, 0x3b, 0x47, 0x69,
-0x62, 0x6c, 0x3b, 0x43, 0xe8, 0x69, 0x74, 0x3b, 0xd2, 0x67, 0x6d, 0x68, 0x3b, 0x49, 0x75, 0x63, 0x68, 0x3b, 0x4c, 0xf9,
-0x6e, 0x61, 0x3b, 0x53, 0x75, 0x6c, 0x74, 0x3b, 0x44, 0xe0, 0x6d, 0x68, 0x3b, 0x53, 0x61, 0x6d, 0x68, 0x3b, 0x44, 0xf9,
-0x62, 0x68, 0x3b, 0x41, 0x6d, 0x20, 0x46, 0x61, 0x6f, 0x69, 0x6c, 0x6c, 0x65, 0x61, 0x63, 0x68, 0x3b, 0x41, 0x6e, 0x20,
-0x47, 0x65, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x3b, 0x41, 0x6d, 0x20, 0x4d, 0xe0, 0x72, 0x74, 0x3b, 0x41, 0x6e, 0x20, 0x47,
-0x69, 0x62, 0x6c, 0x65, 0x61, 0x6e, 0x3b, 0x41, 0x6e, 0x20, 0x43, 0xe8, 0x69, 0x74, 0x65, 0x61, 0x6e, 0x3b, 0x41, 0x6e,
-0x20, 0x74, 0x2d, 0xd2, 0x67, 0x6d, 0x68, 0x69, 0x6f, 0x73, 0x3b, 0x41, 0x6e, 0x20, 0x74, 0x2d, 0x49, 0x75, 0x63, 0x68,
-0x61, 0x72, 0x3b, 0x41, 0x6e, 0x20, 0x4c, 0xf9, 0x6e, 0x61, 0x73, 0x74, 0x61, 0x6c, 0x3b, 0x41, 0x6e, 0x20, 0x74, 0x2d,
-0x53, 0x75, 0x6c, 0x74, 0x61, 0x69, 0x6e, 0x3b, 0x41, 0x6e, 0x20, 0x44, 0xe0, 0x6d, 0x68, 0x61, 0x69, 0x72, 0x3b, 0x41,
-0x6e, 0x20, 0x74, 0x2d, 0x53, 0x61, 0x6d, 0x68, 0x61, 0x69, 0x6e, 0x3b, 0x41, 0x6e, 0x20, 0x44, 0xf9, 0x62, 0x68, 0x6c,
-0x61, 0x63, 0x68, 0x64, 0x3b, 0x46, 0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x43, 0x3b, 0xd2, 0x3b, 0x49, 0x3b, 0x4c,
-0x3b, 0x53, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x44, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x46, 0x68, 0x61, 0x6f, 0x69, 0x6c,
-0x6c, 0x65, 0x61, 0x63, 0x68, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x47, 0x68, 0x65, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x3b,
-0x64, 0x68, 0x65, 0x6e, 0x20, 0x4d, 0x68, 0xe0, 0x72, 0x74, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x47, 0x68, 0x69, 0x62,
-0x6c, 0x65, 0x61, 0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x43, 0x68, 0xe8, 0x69, 0x74, 0x65, 0x61, 0x6e, 0x3b, 0x64,
-0x68, 0x65, 0x6e, 0x20, 0xd2, 0x67, 0x6d, 0x68, 0x69, 0x6f, 0x73, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x49, 0x75, 0x63,
-0x68, 0x61, 0x72, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x4c, 0xf9, 0x6e, 0x61, 0x73, 0x74, 0x61, 0x6c, 0x3b, 0x64, 0x68,
-0x65, 0x6e, 0x20, 0x74, 0x2d, 0x53, 0x75, 0x6c, 0x74, 0x61, 0x69, 0x6e, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x44, 0xe0,
-0x6d, 0x68, 0x61, 0x69, 0x72, 0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x2d, 0x53, 0x61, 0x6d, 0x68, 0x61, 0x69, 0x6e,
-0x3b, 0x64, 0x68, 0x65, 0x6e, 0x20, 0x44, 0xf9, 0x62, 0x68, 0x6c, 0x61, 0x63, 0x68, 0x64, 0x3b, 0x58, 0x61, 0x6e, 0x2e,
-0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x41, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x6f,
-0x3b, 0x58, 0x75, 0xf1, 0x6f, 0x3b, 0x58, 0x75, 0x6c, 0x2e, 0x3b, 0x41, 0x67, 0x6f, 0x2e, 0x3b, 0x53, 0x65, 0x74, 0x2e,
-0x3b, 0x4f, 0x75, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x63, 0x2e, 0x3b, 0x58, 0x61, 0x6e, 0x65,
-0x69, 0x72, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x41,
-0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x6f, 0x3b, 0x58, 0x75, 0xf1, 0x6f, 0x3b, 0x58, 0x75, 0x6c, 0x6c, 0x6f,
-0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x4f, 0x75, 0x74,
-0x75, 0x62, 0x72, 0x6f, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62,
-0x72, 0x6f, 0x3b, 0x58, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x58, 0x3b, 0x58, 0x3b, 0x41, 0x3b, 0x53,
-0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x78, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72,
-0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x6f, 0x3b, 0x78, 0x75, 0xf1, 0x6f, 0x3b, 0x78, 0x75, 0x6c,
-0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65, 0x74, 0x2e, 0x3b, 0x6f, 0x75, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76,
-0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x78, 0x61, 0x6e, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65,
-0x69, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x6f,
-0x3b, 0x78, 0x75, 0xf1, 0x6f, 0x3b, 0x78, 0x75, 0x6c, 0x6c, 0x6f, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73,
-0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x76, 0x65,
-0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x78, 0x2e, 0x3b, 0x66, 0x2e, 0x3b,
-0x6d, 0x2e, 0x3b, 0x61, 0x2e, 0x3b, 0x6d, 0x2e, 0x3b, 0x78, 0x2e, 0x3b, 0x78, 0x2e, 0x3b, 0x61, 0x2e, 0x3b, 0x73, 0x2e,
-0x3b, 0x6f, 0x2e, 0x3b, 0x6e, 0x2e, 0x3b, 0x64, 0x2e, 0x3b, 0x10d8, 0x10d0, 0x10dc, 0x3b, 0x10d7, 0x10d4, 0x10d1, 0x3b, 0x10db, 0x10d0,
-0x10e0, 0x3b, 0x10d0, 0x10de, 0x10e0, 0x3b, 0x10db, 0x10d0, 0x10d8, 0x3b, 0x10d8, 0x10d5, 0x10dc, 0x3b, 0x10d8, 0x10d5, 0x10da, 0x3b, 0x10d0, 0x10d2,
-0x10d5, 0x3b, 0x10e1, 0x10d4, 0x10e5, 0x3b, 0x10dd, 0x10e5, 0x10e2, 0x3b, 0x10dc, 0x10dd, 0x10d4, 0x3b, 0x10d3, 0x10d4, 0x10d9, 0x3b, 0x10d8, 0x10d0,
-0x10dc, 0x10d5, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x10d7, 0x10d4, 0x10d1, 0x10d4, 0x10e0, 0x10d5, 0x10d0, 0x10da, 0x10d8, 0x3b, 0x10db, 0x10d0, 0x10e0, 0x10e2,
-0x10d8, 0x3b, 0x10d0, 0x10de, 0x10e0, 0x10d8, 0x10da, 0x10d8, 0x3b, 0x10db, 0x10d0, 0x10d8, 0x10e1, 0x10d8, 0x3b, 0x10d8, 0x10d5, 0x10dc, 0x10d8, 0x10e1,
-0x10d8, 0x3b, 0x10d8, 0x10d5, 0x10da, 0x10d8, 0x10e1, 0x10d8, 0x3b, 0x10d0, 0x10d2, 0x10d5, 0x10d8, 0x10e1, 0x10e2, 0x10dd, 0x3b, 0x10e1, 0x10d4, 0x10e5,
-0x10e2, 0x10d4, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10dd, 0x10e5, 0x10e2, 0x10dd, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10dc, 0x10dd,
-0x10d4, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10d3, 0x10d4, 0x10d9, 0x10d4, 0x10db, 0x10d1, 0x10d4, 0x10e0, 0x10d8, 0x3b, 0x10d8, 0x3b, 0x10d7,
-0x3b, 0x10db, 0x3b, 0x10d0, 0x3b, 0x10db, 0x3b, 0x10d8, 0x3b, 0x10d8, 0x3b, 0x10d0, 0x3b, 0x10e1, 0x3b, 0x10dd, 0x3b, 0x10dc, 0x3b, 0x10d3,
-0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0xe4, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69,
-0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74,
-0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72,
-0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a,
-0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74,
-0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62,
-0x2e, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69,
-0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x4f, 0x6b, 0x74,
-0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e, 0x3b, 0x4a, 0xe4, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b,
-0x4d, 0xe4, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b,
-0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b,
-0x4a, 0xe4, 0x6e, 0x6e, 0x65, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b,
-0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b,
-0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74,
-0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x4a, 0xe4, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70,
-0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67,
-0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a,
-0x2e, 0x3b, 0x399, 0x3b1, 0x3bd, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3b, 0x39c, 0x3ac, 0x3c1, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3b, 0x39c, 0x3ac,
-0x3b9, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bd, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bb, 0x3b, 0x391, 0x3cd, 0x3b3, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3b,
-0x39f, 0x3ba, 0x3c4, 0x3b, 0x39d, 0x3bf, 0x3ad, 0x3b, 0x394, 0x3b5, 0x3ba, 0x3b, 0x399, 0x3b1, 0x3bd, 0x3bf, 0x3c5, 0x3ac, 0x3c1, 0x3b9,
-0x3bf, 0x3c2, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3c1, 0x3bf, 0x3c5, 0x3ac, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39c, 0x3ac, 0x3c1, 0x3c4, 0x3b9,
-0x3bf, 0x3c2, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3af, 0x3bb, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39c, 0x3ac, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x399, 0x3bf,
-0x3cd, 0x3bd, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x399, 0x3bf, 0x3cd, 0x3bb, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x391, 0x3cd, 0x3b3, 0x3bf, 0x3c5, 0x3c3,
-0x3c4, 0x3bf, 0x3c2, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3c4, 0x3ad, 0x3bc, 0x3b2, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39f, 0x3ba, 0x3c4, 0x3ce,
-0x3b2, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x39d, 0x3bf, 0x3ad, 0x3bc, 0x3b2, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x394, 0x3b5, 0x3ba, 0x3ad,
-0x3bc, 0x3b2, 0x3c1, 0x3b9, 0x3bf, 0x3c2, 0x3b, 0x399, 0x3b, 0x3a6, 0x3b, 0x39c, 0x3b, 0x391, 0x3b, 0x39c, 0x3b, 0x399, 0x3b, 0x399,
-0x3b, 0x391, 0x3b, 0x3a3, 0x3b, 0x39f, 0x3b, 0x39d, 0x3b, 0x394, 0x3b, 0x399, 0x3b1, 0x3bd, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3b, 0x39c,
-0x3b1, 0x3c1, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3b, 0x39c, 0x3b1, 0x390, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bd, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bb,
-0x3b, 0x391, 0x3c5, 0x3b3, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3b, 0x39f, 0x3ba, 0x3c4, 0x3b, 0x39d, 0x3bf, 0x3b5, 0x3b, 0x394, 0x3b5, 0x3ba,
-0x3b, 0x399, 0x3b1, 0x3bd, 0x3bf, 0x3c5, 0x3b1, 0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x3a6, 0x3b5, 0x3b2, 0x3c1, 0x3bf, 0x3c5, 0x3b1, 0x3c1,
-0x3af, 0x3bf, 0x3c5, 0x3b, 0x39c, 0x3b1, 0x3c1, 0x3c4, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x391, 0x3c0, 0x3c1, 0x3b9, 0x3bb, 0x3af, 0x3bf, 0x3c5,
-0x3b, 0x39c, 0x3b1, 0x390, 0x3bf, 0x3c5, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bd, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x399, 0x3bf, 0x3c5, 0x3bb, 0x3af,
-0x3bf, 0x3c5, 0x3b, 0x391, 0x3c5, 0x3b3, 0x3bf, 0x3cd, 0x3c3, 0x3c4, 0x3bf, 0x3c5, 0x3b, 0x3a3, 0x3b5, 0x3c0, 0x3c4, 0x3b5, 0x3bc, 0x3b2,
-0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x39f, 0x3ba, 0x3c4, 0x3c9, 0x3b2, 0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x39d, 0x3bf, 0x3b5, 0x3bc, 0x3b2,
-0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x394, 0x3b5, 0x3ba, 0x3b5, 0x3bc, 0x3b2, 0x3c1, 0x3af, 0x3bf, 0x3c5, 0x3b, 0x6a, 0x61, 0x6e, 0x3b,
-0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b,
-0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b,
-0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69,
-0x3b, 0x6d, 0x61, 0x72, 0x74, 0x73, 0x69, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x69, 0x3b, 0x6d, 0x61, 0x6a, 0x69, 0x3b,
-0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x75, 0x73, 0x69, 0x3b,
-0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x69, 0x3b,
-0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x69, 0x3b,
-0xa9c, 0xabe, 0xaa8, 0xacd, 0xaaf, 0xac1, 0x3b, 0xaab, 0xac7, 0xaac, 0xacd, 0xab0, 0xac1, 0x3b, 0xaae, 0xabe, 0xab0, 0xacd, 0xa9a, 0x3b,
-0xa8f, 0xaaa, 0xacd, 0xab0, 0xabf, 0xab2, 0x3b, 0xaae, 0xac7, 0x3b, 0xa9c, 0xac2, 0xaa8, 0x3b, 0xa9c, 0xac1, 0xab2, 0xabe, 0xa88, 0x3b,
-0xa91, 0xa97, 0xab8, 0xacd, 0xa9f, 0x3b, 0xab8, 0xaaa, 0xacd, 0xa9f, 0xac7, 0x3b, 0xa91, 0xa95, 0xacd, 0xa9f, 0xacb, 0x3b, 0xaa8, 0xab5,
-0xac7, 0x3b, 0xaa1, 0xabf, 0xab8, 0xac7, 0x3b, 0xa9c, 0xabe, 0xaa8, 0xacd, 0xaaf, 0xac1, 0xa86, 0xab0, 0xac0, 0x3b, 0xaab, 0xac7, 0xaac,
-0xacd, 0xab0, 0xac1, 0xa86, 0xab0, 0xac0, 0x3b, 0xaae, 0xabe, 0xab0, 0xacd, 0xa9a, 0x3b, 0xa8f, 0xaaa, 0xacd, 0xab0, 0xabf, 0xab2, 0x3b,
-0xaae, 0xac7, 0x3b, 0xa9c, 0xac2, 0xaa8, 0x3b, 0xa9c, 0xac1, 0xab2, 0xabe, 0xa88, 0x3b, 0xa91, 0xa97, 0xab8, 0xacd, 0xa9f, 0x3b, 0xab8,
-0xaaa, 0xacd, 0xa9f, 0xac7, 0xaae, 0xacd, 0xaac, 0xab0, 0x3b, 0xa91, 0xa95, 0xacd, 0xa9f, 0xacb, 0xaac, 0xab0, 0x3b, 0xaa8, 0xab5, 0xac7,
-0xaae, 0xacd, 0xaac, 0xab0, 0x3b, 0xaa1, 0xabf, 0xab8, 0xac7, 0xaae, 0xacd, 0xaac, 0xab0, 0x3b, 0xa9c, 0xabe, 0x3b, 0xaab, 0xac7, 0x3b,
-0xaae, 0xabe, 0x3b, 0xa8f, 0x3b, 0xaae, 0xac7, 0x3b, 0xa9c, 0xac2, 0x3b, 0xa9c, 0xac1, 0x3b, 0xa91, 0x3b, 0xab8, 0x3b, 0xa91, 0x3b,
-0xaa8, 0x3b, 0xaa1, 0xabf, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x61, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x66, 0x69,
-0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e, 0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x75, 0x3b, 0x53, 0x61, 0x74,
-0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x75, 0x77, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x61, 0x69, 0x72, 0x75,
-0x3b, 0x46, 0x61, 0x62, 0x75, 0x72, 0x61, 0x69, 0x72, 0x75, 0x3b, 0x4d, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x41, 0x66, 0x69,
-0x72, 0x69, 0x6c, 0x75, 0x3b, 0x4d, 0x61, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6e, 0x69, 0x3b, 0x59, 0x75, 0x6c, 0x69, 0x3b,
-0x41, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x53, 0x61, 0x74, 0x75, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62,
-0x61, 0x3b, 0x4e, 0x75, 0x77, 0x61, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x61, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x3b,
-0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b,
-0x44, 0x3b, 0x5d9, 0x5e0, 0x5d5, 0x5f3, 0x3b, 0x5e4, 0x5d1, 0x5e8, 0x5f3, 0x3b, 0x5de, 0x5e8, 0x5e5, 0x3b, 0x5d0, 0x5e4, 0x5e8, 0x5f3,
-0x3b, 0x5de, 0x5d0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9, 0x3b, 0x5d0, 0x5d5, 0x5d2, 0x5f3, 0x3b,
-0x5e1, 0x5e4, 0x5d8, 0x5f3, 0x3b, 0x5d0, 0x5d5, 0x5e7, 0x5f3, 0x3b, 0x5e0, 0x5d5, 0x5d1, 0x5f3, 0x3b, 0x5d3, 0x5e6, 0x5de, 0x5f3, 0x3b,
-0x5d9, 0x5e0, 0x5d5, 0x5d0, 0x5e8, 0x3b, 0x5e4, 0x5d1, 0x5e8, 0x5d5, 0x5d0, 0x5e8, 0x3b, 0x5de, 0x5e8, 0x5e5, 0x3b, 0x5d0, 0x5e4, 0x5e8,
-0x5d9, 0x5dc, 0x3b, 0x5de, 0x5d0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9, 0x3b, 0x5d0, 0x5d5, 0x5d2,
-0x5d5, 0x5e1, 0x5d8, 0x3b, 0x5e1, 0x5e4, 0x5d8, 0x5de, 0x5d1, 0x5e8, 0x3b, 0x5d0, 0x5d5, 0x5e7, 0x5d8, 0x5d5, 0x5d1, 0x5e8, 0x3b, 0x5e0,
-0x5d5, 0x5d1, 0x5de, 0x5d1, 0x5e8, 0x3b, 0x5d3, 0x5e6, 0x5de, 0x5d1, 0x5e8, 0x3b, 0x91c, 0x928, 0x970, 0x3b, 0x92b, 0x93c, 0x930, 0x970,
-0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x948, 0x932, 0x3b, 0x92e, 0x908, 0x3b, 0x91c, 0x942, 0x928,
-0x3b, 0x91c, 0x941, 0x932, 0x970, 0x3b, 0x905, 0x917, 0x970, 0x3b, 0x938, 0x93f, 0x924, 0x970, 0x3b, 0x905, 0x915, 0x94d, 0x924, 0x942,
-0x970, 0x3b, 0x928, 0x935, 0x970, 0x3b, 0x926, 0x93f, 0x938, 0x970, 0x3b, 0x91c, 0x928, 0x935, 0x930, 0x940, 0x3b, 0x92b, 0x93c, 0x930,
-0x935, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x948, 0x932, 0x3b, 0x92e, 0x908, 0x3b,
-0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x93e, 0x908, 0x3b, 0x905, 0x917, 0x938, 0x94d, 0x924, 0x3b, 0x938, 0x93f, 0x924, 0x902,
-0x92c, 0x930, 0x3b, 0x905, 0x915, 0x94d, 0x924, 0x942, 0x92c, 0x930, 0x3b, 0x928, 0x935, 0x902, 0x92c, 0x930, 0x3b, 0x926, 0x93f, 0x938,
-0x902, 0x92c, 0x930, 0x3b, 0x91c, 0x3b, 0x92b, 0x93c, 0x3b, 0x92e, 0x93e, 0x3b, 0x905, 0x3b, 0x92e, 0x3b, 0x91c, 0x942, 0x3b, 0x91c,
-0x941, 0x3b, 0x905, 0x3b, 0x938, 0x93f, 0x3b, 0x905, 0x3b, 0x928, 0x3b, 0x926, 0x93f, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66,
-0x65, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0xe1, 0x72, 0x63, 0x2e, 0x3b, 0xe1, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0xe1, 0x6a, 0x2e,
-0x3b, 0x6a, 0xfa, 0x6e, 0x2e, 0x3b, 0x6a, 0xfa, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x7a, 0x65, 0x70,
-0x74, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61,
-0x6e, 0x75, 0xe1, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0xe1, 0x72, 0x3b, 0x6d, 0xe1, 0x72, 0x63, 0x69, 0x75, 0x73,
-0x3b, 0xe1, 0x70, 0x72, 0x69, 0x6c, 0x69, 0x73, 0x3b, 0x6d, 0xe1, 0x6a, 0x75, 0x73, 0x3b, 0x6a, 0xfa, 0x6e, 0x69, 0x75,
-0x73, 0x3b, 0x6a, 0xfa, 0x6c, 0x69, 0x75, 0x73, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x7a, 0x74, 0x75, 0x73, 0x3b, 0x73,
-0x7a, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0xf3, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f,
-0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b,
-0x4d, 0x3b, 0xc1, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x7a, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44,
-0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e,
-0x3b, 0x6d, 0x61, 0xed, 0x3b, 0x6a, 0xfa, 0x6e, 0x2e, 0x3b, 0x6a, 0xfa, 0x6c, 0x2e, 0x3b, 0xe1, 0x67, 0xfa, 0x2e, 0x3b,
-0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0xf3, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x73, 0x2e, 0x3b,
-0x6a, 0x61, 0x6e, 0xfa, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0xfa, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b,
-0x61, 0x70, 0x72, 0xed, 0x6c, 0x3b, 0x6d, 0x61, 0xed, 0x3b, 0x6a, 0xfa, 0x6e, 0xed, 0x3b, 0x6a, 0xfa, 0x6c, 0xed, 0x3b,
-0xe1, 0x67, 0xfa, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0xf3,
-0x62, 0x65, 0x72, 0x3b, 0x6e, 0xf3, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x65,
-0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0xc1, 0x3b, 0x53, 0x3b,
-0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70,
-0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x75, 0x3b, 0x53, 0x65,
-0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72,
-0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x72, 0x65, 0x74, 0x3b, 0x41, 0x70, 0x72,
-0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x67, 0x75,
-0x73, 0x74, 0x75, 0x73, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62,
-0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72,
-0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x69,
-0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x63, 0x74,
-0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x6f, 0x3b, 0x66, 0x65,
-0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x6f, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c,
-0x3b, 0x6d, 0x61, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x75,
-0x67, 0x75, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x74, 0x6f,
-0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72,
-0x65, 0x3b, 0x6a, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x6a, 0x3b, 0x61, 0x3b, 0x73, 0x3b,
-0x6f, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x45, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x61, 0x62, 0x68, 0x3b, 0x4d, 0xe1, 0x72, 0x74,
-0x61, 0x3b, 0x41, 0x69, 0x62, 0x3b, 0x42, 0x65, 0x61, 0x6c, 0x3b, 0x4d, 0x65, 0x69, 0x74, 0x68, 0x3b, 0x49, 0xfa, 0x69,
-0x6c, 0x3b, 0x4c, 0xfa, 0x6e, 0x3b, 0x4d, 0x46, 0xf3, 0x6d, 0x68, 0x3b, 0x44, 0x46, 0xf3, 0x6d, 0x68, 0x3b, 0x53, 0x61,
-0x6d, 0x68, 0x3b, 0x4e, 0x6f, 0x6c, 0x6c, 0x3b, 0x45, 0x61, 0x6e, 0xe1, 0x69, 0x72, 0x3b, 0x46, 0x65, 0x61, 0x62, 0x68,
-0x72, 0x61, 0x3b, 0x4d, 0xe1, 0x72, 0x74, 0x61, 0x3b, 0x41, 0x69, 0x62, 0x72, 0x65, 0xe1, 0x6e, 0x3b, 0x42, 0x65, 0x61,
-0x6c, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x3b, 0x4d, 0x65, 0x69, 0x74, 0x68, 0x65, 0x61, 0x6d, 0x68, 0x3b, 0x49, 0xfa, 0x69,
-0x6c, 0x3b, 0x4c, 0xfa, 0x6e, 0x61, 0x73, 0x61, 0x3b, 0x4d, 0x65, 0xe1, 0x6e, 0x20, 0x46, 0xf3, 0x6d, 0x68, 0x61, 0x69,
-0x72, 0x3b, 0x44, 0x65, 0x69, 0x72, 0x65, 0x61, 0x64, 0x68, 0x20, 0x46, 0xf3, 0x6d, 0x68, 0x61, 0x69, 0x72, 0x3b, 0x53,
-0x61, 0x6d, 0x68, 0x61, 0x69, 0x6e, 0x3b, 0x4e, 0x6f, 0x6c, 0x6c, 0x61, 0x69, 0x67, 0x3b, 0x45, 0x3b, 0x46, 0x3b, 0x4d,
-0x3b, 0x41, 0x3b, 0x42, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x67,
-0x65, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x67, 0x3b, 0x67,
-0x69, 0x75, 0x3b, 0x6c, 0x75, 0x67, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x3b, 0x6f, 0x74, 0x74, 0x3b, 0x6e,
-0x6f, 0x76, 0x3b, 0x64, 0x69, 0x63, 0x3b, 0x67, 0x65, 0x6e, 0x6e, 0x61, 0x69, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x62, 0x72,
-0x61, 0x69, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x65, 0x3b, 0x6d, 0x61, 0x67,
-0x67, 0x69, 0x6f, 0x3b, 0x67, 0x69, 0x75, 0x67, 0x6e, 0x6f, 0x3b, 0x6c, 0x75, 0x67, 0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x67,
-0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x74, 0x74, 0x6f, 0x62,
-0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x69, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x65,
-0x3b, 0x47, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x4c, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f,
-0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72,
-0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x74, 0x3b, 0x53, 0x65, 0x70,
-0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0xc9c, 0xca8, 0x3b, 0xcab, 0xcc6, 0xcac, 0xccd,
-0xcb0, 0x3b, 0xcae, 0xcbe, 0xcb0, 0xccd, 0xc9a, 0xccd, 0x3b, 0xc8f, 0xcaa, 0xccd, 0xcb0, 0xcbf, 0x3b, 0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2,
-0xca8, 0xccd, 0x3b, 0xc9c, 0xcc1, 0xcb2, 0xcc8, 0x3b, 0xc86, 0xc97, 0x3b, 0xcb8, 0xcc6, 0xcaa, 0xccd, 0xc9f, 0xcc6, 0xc82, 0x3b, 0xc85,
-0xc95, 0xccd, 0xc9f, 0xccb, 0x3b, 0xca8, 0xcb5, 0xcc6, 0xc82, 0x3b, 0xca1, 0xcbf, 0xcb8, 0xcc6, 0xc82, 0x3b, 0xc9c, 0xca8, 0xcb5, 0xcb0,
-0xcbf, 0x3b, 0xcab, 0xcc6, 0xcac, 0xccd, 0xcb0, 0xcb5, 0xcb0, 0xcbf, 0x3b, 0xcae, 0xcbe, 0xcb0, 0xccd, 0xc9a, 0xccd, 0x3b, 0xc8f, 0xcaa,
-0xccd, 0xcb0, 0xcbf, 0xcb2, 0xccd, 0x3b, 0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2, 0xca8, 0xccd, 0x3b, 0xc9c, 0xcc1, 0xcb2, 0xcc8, 0x3b, 0xc86,
-0xc97, 0xcb8, 0xccd, 0xc9f, 0xccd, 0x3b, 0xcb8, 0xcc6, 0xcaa, 0xccd, 0xc9f, 0xcc6, 0xc82, 0xcac, 0xcb0, 0xccd, 0x3b, 0xc85, 0xc95, 0xccd,
-0xc9f, 0xccb, 0xcac, 0xcb0, 0xccd, 0x3b, 0xca8, 0xcb5, 0xcc6, 0xc82, 0xcac, 0xcb0, 0xccd, 0x3b, 0xca1, 0xcbf, 0xcb8, 0xcc6, 0xc82, 0xcac,
-0xcb0, 0xccd, 0x3b, 0xc9c, 0x3b, 0xcab, 0xcc6, 0x3b, 0xcae, 0xcbe, 0x3b, 0xc8f, 0x3b, 0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2, 0x3b, 0xc9c,
-0xcc1, 0x3b, 0xc86, 0x3b, 0xcb8, 0xcc6, 0x3b, 0xc85, 0x3b, 0xca8, 0x3b, 0xca1, 0xcbf, 0x3b, 0xc9c, 0xca8, 0xcb5, 0xcb0, 0xcbf, 0x3b,
-0xcab, 0xcc6, 0xcac, 0xccd, 0xcb0, 0xcb5, 0xcb0, 0xcbf, 0x3b, 0xcae, 0xcbe, 0xcb0, 0xccd, 0xc9a, 0xccd, 0x3b, 0xc8f, 0xcaa, 0xccd, 0xcb0,
-0xcbf, 0x3b, 0xcae, 0xcc7, 0x3b, 0xc9c, 0xcc2, 0xca8, 0xccd, 0x3b, 0xc9c, 0xcc1, 0xcb2, 0xcc8, 0x3b, 0xc86, 0xc97, 0x3b, 0xcb8, 0xcc6,
-0xcaa, 0xccd, 0xc9f, 0xcc6, 0xc82, 0x3b, 0xc85, 0xc95, 0xccd, 0xc9f, 0xccb, 0x3b, 0xca8, 0xcb5, 0xcc6, 0xc82, 0x3b, 0xca1, 0xcbf, 0xcb8,
-0xcc6, 0xc82, 0x3b, 0x62c, 0x646, 0x624, 0x631, 0x6cc, 0x3b, 0x641, 0x631, 0x624, 0x631, 0x6cc, 0x3b, 0x645, 0x627, 0x631, 0x655, 0x686,
-0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cc, 0x654, 0x3b, 0x62c, 0x648, 0x657, 0x646, 0x3b, 0x62c, 0x648, 0x657, 0x644,
-0x627, 0x6cc, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x657,
-0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x3b, 0x641, 0x3b, 0x645,
-0x3b, 0x627, 0x3b, 0x645, 0x3b, 0x62c, 0x3b, 0x62c, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x633, 0x3b, 0x627, 0x3b, 0x646, 0x3b, 0x49b,
-0x430, 0x4a3, 0x2e, 0x3b, 0x430, 0x49b, 0x43f, 0x2e, 0x3b, 0x43d, 0x430, 0x443, 0x2e, 0x3b, 0x441, 0x4d9, 0x443, 0x2e, 0x3b, 0x43c,
-0x430, 0x43c, 0x2e, 0x3b, 0x43c, 0x430, 0x443, 0x2e, 0x3b, 0x448, 0x456, 0x43b, 0x2e, 0x3b, 0x442, 0x430, 0x43c, 0x2e, 0x3b, 0x49b,
-0x44b, 0x440, 0x2e, 0x3b, 0x49b, 0x430, 0x437, 0x2e, 0x3b, 0x49b, 0x430, 0x440, 0x2e, 0x3b, 0x436, 0x435, 0x43b, 0x2e, 0x3b, 0x49a,
-0x430, 0x4a3, 0x442, 0x430, 0x440, 0x3b, 0x410, 0x49b, 0x43f, 0x430, 0x43d, 0x3b, 0x41d, 0x430, 0x443, 0x440, 0x44b, 0x437, 0x3b, 0x421,
-0x4d9, 0x443, 0x456, 0x440, 0x3b, 0x41c, 0x430, 0x43c, 0x44b, 0x440, 0x3b, 0x41c, 0x430, 0x443, 0x441, 0x44b, 0x43c, 0x3b, 0x428, 0x456,
-0x43b, 0x434, 0x435, 0x3b, 0x422, 0x430, 0x43c, 0x44b, 0x437, 0x3b, 0x49a, 0x44b, 0x440, 0x43a, 0x4af, 0x439, 0x435, 0x43a, 0x3b, 0x49a,
-0x430, 0x437, 0x430, 0x43d, 0x3b, 0x49a, 0x430, 0x440, 0x430, 0x448, 0x430, 0x3b, 0x416, 0x435, 0x43b, 0x442, 0x43e, 0x49b, 0x441, 0x430,
-0x43d, 0x3b, 0x49a, 0x3b, 0x410, 0x3b, 0x41d, 0x3b, 0x421, 0x3b, 0x41c, 0x3b, 0x41c, 0x3b, 0x428, 0x3b, 0x422, 0x3b, 0x49a, 0x3b,
-0x49a, 0x3b, 0x49a, 0x3b, 0x416, 0x3b, 0x49b, 0x430, 0x4a3, 0x442, 0x430, 0x440, 0x3b, 0x430, 0x49b, 0x43f, 0x430, 0x43d, 0x3b, 0x43d,
-0x430, 0x443, 0x440, 0x44b, 0x437, 0x3b, 0x441, 0x4d9, 0x443, 0x456, 0x440, 0x3b, 0x43c, 0x430, 0x43c, 0x44b, 0x440, 0x3b, 0x43c, 0x430,
-0x443, 0x441, 0x44b, 0x43c, 0x3b, 0x448, 0x456, 0x43b, 0x434, 0x435, 0x3b, 0x442, 0x430, 0x43c, 0x44b, 0x437, 0x3b, 0x49b, 0x44b, 0x440,
-0x43a, 0x4af, 0x439, 0x435, 0x43a, 0x3b, 0x49b, 0x430, 0x437, 0x430, 0x43d, 0x3b, 0x49b, 0x430, 0x440, 0x430, 0x448, 0x430, 0x3b, 0x436,
-0x435, 0x43b, 0x442, 0x43e, 0x49b, 0x441, 0x430, 0x43d, 0x3b, 0x6d, 0x75, 0x74, 0x2e, 0x3b, 0x67, 0x61, 0x73, 0x2e, 0x3b, 0x77,
-0x65, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x74, 0x2e, 0x3b, 0x67, 0x69, 0x63, 0x2e, 0x3b, 0x6b, 0x61, 0x6d, 0x2e, 0x3b, 0x6e,
-0x79, 0x61, 0x2e, 0x3b, 0x6b, 0x61, 0x6e, 0x2e, 0x3b, 0x6e, 0x7a, 0x65, 0x2e, 0x3b, 0x75, 0x6b, 0x77, 0x2e, 0x3b, 0x75,
-0x67, 0x75, 0x2e, 0x3b, 0x75, 0x6b, 0x75, 0x2e, 0x3b, 0x4d, 0x75, 0x74, 0x61, 0x72, 0x61, 0x6d, 0x61, 0x3b, 0x47, 0x61,
-0x73, 0x68, 0x79, 0x61, 0x6e, 0x74, 0x61, 0x72, 0x65, 0x3b, 0x57, 0x65, 0x72, 0x75, 0x72, 0x77, 0x65, 0x3b, 0x4d, 0x61,
-0x74, 0x61, 0x3b, 0x47, 0x69, 0x63, 0x75, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x3b, 0x4b, 0x61, 0x6d, 0x65, 0x6e, 0x61, 0x3b,
-0x4e, 0x79, 0x61, 0x6b, 0x61, 0x6e, 0x67, 0x61, 0x3b, 0x4b, 0x61, 0x6e, 0x61, 0x6d, 0x61, 0x3b, 0x4e, 0x7a, 0x65, 0x6c,
-0x69, 0x3b, 0x55, 0x6b, 0x77, 0x61, 0x6b, 0x69, 0x72, 0x61, 0x3b, 0x55, 0x67, 0x75, 0x73, 0x68, 0x79, 0x69, 0x6e, 0x67,
-0x6f, 0x3b, 0x55, 0x6b, 0x75, 0x62, 0x6f, 0x7a, 0x61, 0x3b, 0x42f, 0x43d, 0x432, 0x3b, 0x424, 0x435, 0x432, 0x3b, 0x41c, 0x430,
-0x440, 0x3b, 0x410, 0x43f, 0x440, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x3b, 0x418, 0x44e, 0x43b, 0x3b, 0x410, 0x432,
-0x433, 0x3b, 0x421, 0x435, 0x43d, 0x3b, 0x41e, 0x43a, 0x442, 0x3b, 0x41d, 0x43e, 0x44f, 0x3b, 0x414, 0x435, 0x43a, 0x3b, 0x42f, 0x43d,
-0x432, 0x430, 0x440, 0x44c, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44c, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x3b, 0x410, 0x43f,
-0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x44c, 0x3b, 0x418, 0x44e, 0x43b, 0x44c, 0x3b, 0x410,
-0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x41e, 0x43a, 0x442, 0x44f, 0x431,
-0x440, 0x44c, 0x3b, 0x41d, 0x43e, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44c, 0x3b, 0x42f, 0x3b,
-0x424, 0x3b, 0x41c, 0x3b, 0x410, 0x3b, 0x41c, 0x3b, 0x418, 0x3b, 0x418, 0x3b, 0x410, 0x3b, 0x421, 0x3b, 0x41e, 0x3b, 0x41d, 0x3b,
-0x414, 0x3b, 0x44f, 0x43d, 0x432, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440,
-0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x2e, 0x3b, 0x438, 0x44e, 0x43b, 0x2e, 0x3b, 0x430, 0x432, 0x433, 0x2e,
-0x3b, 0x441, 0x435, 0x43d, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e,
-0x3b, 0x44f, 0x43d, 0x432, 0x430, 0x440, 0x44c, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44c, 0x3b, 0x43c, 0x430, 0x440, 0x442,
-0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x44c, 0x3b, 0x438, 0x44e, 0x43b,
-0x44c, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43e, 0x43a,
-0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44c,
-0x3b, 0x31, 0xc6d4, 0x3b, 0x32, 0xc6d4, 0x3b, 0x33, 0xc6d4, 0x3b, 0x34, 0xc6d4, 0x3b, 0x35, 0xc6d4, 0x3b, 0x36, 0xc6d4, 0x3b, 0x37,
-0xc6d4, 0x3b, 0x38, 0xc6d4, 0x3b, 0x39, 0xc6d4, 0x3b, 0x31, 0x30, 0xc6d4, 0x3b, 0x31, 0x31, 0xc6d4, 0x3b, 0x31, 0x32, 0xc6d4, 0x3b,
-0x72, 0xea, 0x62, 0x3b, 0x72, 0x65, 0x15f, 0x3b, 0x61, 0x64, 0x61, 0x3b, 0x61, 0x76, 0x72, 0x3b, 0x67, 0x75, 0x6c, 0x3b,
-0x70, 0xfb, 0x15f, 0x3b, 0x74, 0xee, 0x72, 0x3b, 0x67, 0x65, 0x6c, 0x3b, 0x72, 0x65, 0x7a, 0x3b, 0x6b, 0x65, 0x77, 0x3b,
-0x73, 0x65, 0x72, 0x3b, 0x62, 0x65, 0x72, 0x3b, 0x72, 0xea, 0x62, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x3b, 0x72, 0x65, 0x15f,
-0x65, 0x6d, 0xee, 0x3b, 0x61, 0x64, 0x61, 0x72, 0x3b, 0x61, 0x76, 0x72, 0xea, 0x6c, 0x3b, 0x67, 0x75, 0x6c, 0x61, 0x6e,
-0x3b, 0x70, 0xfb, 0x15f, 0x70, 0x65, 0x72, 0x3b, 0x74, 0xee, 0x72, 0x6d, 0x65, 0x68, 0x3b, 0x67, 0x65, 0x6c, 0x61, 0x77,
-0xea, 0x6a, 0x3b, 0x72, 0x65, 0x7a, 0x62, 0x65, 0x72, 0x3b, 0x6b, 0x65, 0x77, 0xe7, 0xea, 0x72, 0x3b, 0x73, 0x65, 0x72,
-0x6d, 0x61, 0x77, 0x65, 0x7a, 0x3b, 0x62, 0x65, 0x72, 0x66, 0x61, 0x6e, 0x62, 0x61, 0x72, 0x3b, 0x52, 0x3b, 0x52, 0x3b,
-0x41, 0x3b, 0x41, 0x3b, 0x47, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x47, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x42, 0x3b,
-0x72, 0xea, 0x62, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0xea, 0x3b, 0x72, 0x65, 0x15f, 0x65, 0x6d, 0x69, 0x79, 0xea, 0x3b, 0x61,
-0x64, 0x61, 0x72, 0xea, 0x3b, 0x61, 0x76, 0x72, 0xea, 0x6c, 0xea, 0x3b, 0x67, 0x75, 0x6c, 0x61, 0x6e, 0xea, 0x3b, 0x70,
-0xfb, 0x15f, 0x70, 0x65, 0x72, 0xea, 0x3b, 0x74, 0xee, 0x72, 0x6d, 0x65, 0x68, 0xea, 0x3b, 0x67, 0x65, 0x6c, 0x61, 0x77,
-0xea, 0x6a, 0xea, 0x3b, 0x72, 0x65, 0x7a, 0x62, 0x65, 0x72, 0xea, 0x3b, 0x6b, 0x65, 0x77, 0xe7, 0xea, 0x72, 0xea, 0x3b,
-0x73, 0x65, 0x72, 0x6d, 0x61, 0x77, 0x65, 0x7a, 0xea, 0x3b, 0x62, 0x65, 0x72, 0x66, 0x61, 0x6e, 0x62, 0x61, 0x72, 0xea,
-0x3b, 0x4d, 0x75, 0x74, 0x2e, 0x3b, 0x47, 0x61, 0x73, 0x2e, 0x3b, 0x57, 0x65, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x74, 0x2e,
-0x3b, 0x47, 0x69, 0x63, 0x2e, 0x3b, 0x4b, 0x61, 0x6d, 0x2e, 0x3b, 0x4e, 0x79, 0x61, 0x2e, 0x3b, 0x4b, 0x61, 0x6e, 0x2e,
-0x3b, 0x4e, 0x7a, 0x65, 0x2e, 0x3b, 0x55, 0x6b, 0x77, 0x2e, 0x3b, 0x55, 0x67, 0x75, 0x2e, 0x3b, 0x55, 0x6b, 0x75, 0x2e,
-0x3b, 0x4e, 0x7a, 0x65, 0x72, 0x6f, 0x3b, 0x52, 0x75, 0x68, 0x75, 0x68, 0x75, 0x6d, 0x61, 0x3b, 0x4e, 0x74, 0x77, 0x61,
-0x72, 0x61, 0x6e, 0x74, 0x65, 0x3b, 0x4e, 0x64, 0x61, 0x6d, 0x75, 0x6b, 0x69, 0x7a, 0x61, 0x3b, 0x52, 0x75, 0x73, 0x61,
-0x6d, 0x61, 0x3b, 0x52, 0x75, 0x68, 0x65, 0x73, 0x68, 0x69, 0x3b, 0x4d, 0x75, 0x6b, 0x61, 0x6b, 0x61, 0x72, 0x6f, 0x3b,
-0x4e, 0x79, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x61, 0x72, 0x6f, 0x3b, 0x4e, 0x79, 0x61, 0x6b, 0x61, 0x6e, 0x67, 0x61, 0x3b,
-0x47, 0x69, 0x74, 0x75, 0x67, 0x75, 0x74, 0x75, 0x3b, 0x4d, 0x75, 0x6e, 0x79, 0x6f, 0x6e, 0x79, 0x6f, 0x3b, 0x4b, 0x69,
-0x67, 0x61, 0x72, 0x61, 0x6d, 0x61, 0x3b, 0xea1, 0x2e, 0xe81, 0x2e, 0x3b, 0xe81, 0x2e, 0xe9e, 0x2e, 0x3b, 0xea1, 0x2e, 0xe99,
-0x2e, 0x3b, 0xea1, 0x2e, 0xeaa, 0x2e, 0x3b, 0xe9e, 0x2e, 0xe9e, 0x2e, 0x3b, 0xea1, 0xeb4, 0x2e, 0xe96, 0x2e, 0x3b, 0xe81, 0x2e,
-0xea5, 0x2e, 0x3b, 0xeaa, 0x2e, 0xeab, 0x2e, 0x3b, 0xe81, 0x2e, 0xe8d, 0x2e, 0x3b, 0xe95, 0x2e, 0xea5, 0x2e, 0x3b, 0xe9e, 0x2e,
-0xe88, 0x2e, 0x3b, 0xe97, 0x2e, 0xea7, 0x2e, 0x3b, 0xea1, 0xeb1, 0xe87, 0xe81, 0xead, 0xe99, 0x3b, 0xe81, 0xeb8, 0xea1, 0xe9e, 0xeb2,
-0x3b, 0xea1, 0xeb5, 0xe99, 0xeb2, 0x3b, 0xec0, 0xea1, 0xeaa, 0xeb2, 0x3b, 0xe9e, 0xeb6, 0xe94, 0xeaa, 0xeb0, 0xe9e, 0xeb2, 0x3b, 0xea1,
-0xeb4, 0xe96, 0xeb8, 0xe99, 0xeb2, 0x3b, 0xe81, 0xecd, 0xea5, 0xeb0, 0xe81, 0xebb, 0xe94, 0x3b, 0xeaa, 0xeb4, 0xe87, 0xeab, 0xeb2, 0x3b,
-0xe81, 0xeb1, 0xe99, 0xe8d, 0xeb2, 0x3b, 0xe95, 0xeb8, 0xea5, 0xeb2, 0x3b, 0xe9e, 0xeb0, 0xe88, 0xeb4, 0xe81, 0x3b, 0xe97, 0xeb1, 0xe99,
-0xea7, 0xeb2, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x73,
-0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x6a, 0x73, 0x3b, 0x6a, 0x16b, 0x6e, 0x2e, 0x3b, 0x6a, 0x16b, 0x6c,
-0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f,
-0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x76, 0x101, 0x72, 0x69, 0x73, 0x3b, 0x66, 0x65, 0x62,
-0x72, 0x75, 0x101, 0x72, 0x69, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x12b, 0x6c, 0x69, 0x73,
-0x3b, 0x6d, 0x61, 0x69, 0x6a, 0x73, 0x3b, 0x6a, 0x16b, 0x6e, 0x69, 0x6a, 0x73, 0x3b, 0x6a, 0x16b, 0x6c, 0x69, 0x6a, 0x73,
-0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x73, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 0x3b,
-0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x64,
-0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x73, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x62, 0x6c, 0x3b, 0x6d, 0x73, 0x69,
-0x3b, 0x61, 0x70, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79, 0x75, 0x6c, 0x3b, 0x61, 0x67, 0x74,
-0x3b, 0x73, 0x74, 0x62, 0x3b, 0x254, 0x74, 0x62, 0x3b, 0x6e, 0x76, 0x62, 0x3b, 0x64, 0x73, 0x62, 0x3b, 0x73, 0xe1, 0x6e,
-0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x79, 0x61, 0x6d, 0x62, 0x6f, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61,
-0x20, 0x6d, 0xed, 0x62, 0x61, 0x6c, 0xe9, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x73,
-0xe1, 0x74, 0x6f, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x6e, 0x65, 0x69, 0x3b, 0x73,
-0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x74, 0xe1, 0x6e, 0x6f, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1,
-0x20, 0x79, 0x61, 0x20, 0x6d, 0x6f, 0x74, 0xf3, 0x62, 0xe1, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20,
-0x6e, 0x73, 0x61, 0x6d, 0x62, 0x6f, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6d, 0x77, 0x61, 0x6d,
-0x62, 0x65, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x6c, 0x69, 0x62, 0x77, 0x61, 0x3b, 0x73, 0xe1,
-0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61, 0x20, 0x7a, 0xf3, 0x6d, 0x69, 0x3b, 0x73, 0xe1, 0x6e, 0x7a, 0xe1, 0x20, 0x79, 0x61,
-0x20, 0x7a, 0xf3, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x254, 0x30c, 0x6b, 0x254, 0x301, 0x3b, 0x73, 0xe1, 0x6e, 0x7a,
-0xe1, 0x20, 0x79, 0x61, 0x20, 0x7a, 0xf3, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0xed, 0x62, 0x61, 0x6c, 0xe9, 0x3b,
-0x79, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x79, 0x3b, 0x79, 0x3b, 0x61, 0x3b, 0x73, 0x3b, 0x254, 0x3b,
-0x6e, 0x3b, 0x64, 0x3b, 0x73, 0x61, 0x75, 0x73, 0x2e, 0x3b, 0x76, 0x61, 0x73, 0x2e, 0x3b, 0x6b, 0x6f, 0x76, 0x2e, 0x3b,
-0x62, 0x61, 0x6c, 0x2e, 0x3b, 0x67, 0x65, 0x67, 0x2e, 0x3b, 0x62, 0x69, 0x72, 0x17e, 0x2e, 0x3b, 0x6c, 0x69, 0x65, 0x70,
-0x2e, 0x3b, 0x72, 0x75, 0x67, 0x70, 0x2e, 0x3b, 0x72, 0x75, 0x67, 0x73, 0x2e, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x2e, 0x3b,
-0x6c, 0x61, 0x70, 0x6b, 0x72, 0x2e, 0x3b, 0x67, 0x72, 0x75, 0x6f, 0x64, 0x2e, 0x3b, 0x73, 0x61, 0x75, 0x73, 0x69, 0x73,
-0x3b, 0x76, 0x61, 0x73, 0x61, 0x72, 0x69, 0x73, 0x3b, 0x6b, 0x6f, 0x76, 0x61, 0x73, 0x3b, 0x62, 0x61, 0x6c, 0x61, 0x6e,
-0x64, 0x69, 0x73, 0x3b, 0x67, 0x65, 0x67, 0x75, 0x17e, 0x117, 0x3b, 0x62, 0x69, 0x72, 0x17e, 0x65, 0x6c, 0x69, 0x73, 0x3b,
-0x6c, 0x69, 0x65, 0x70, 0x61, 0x3b, 0x72, 0x75, 0x67, 0x70, 0x6a, 0x16b, 0x74, 0x69, 0x73, 0x3b, 0x72, 0x75, 0x67, 0x73,
-0x117, 0x6a, 0x69, 0x73, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x69, 0x73, 0x3b, 0x6c, 0x61, 0x70, 0x6b, 0x72, 0x69, 0x74, 0x69,
-0x73, 0x3b, 0x67, 0x72, 0x75, 0x6f, 0x64, 0x69, 0x73, 0x3b, 0x53, 0x3b, 0x56, 0x3b, 0x4b, 0x3b, 0x42, 0x3b, 0x47, 0x3b,
-0x42, 0x3b, 0x4c, 0x3b, 0x52, 0x3b, 0x52, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x47, 0x3b, 0x73, 0x61, 0x75, 0x73, 0x69, 0x6f,
-0x3b, 0x76, 0x61, 0x73, 0x61, 0x72, 0x69, 0x6f, 0x3b, 0x6b, 0x6f, 0x76, 0x6f, 0x3b, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x64,
-0x17e, 0x69, 0x6f, 0x3b, 0x67, 0x65, 0x67, 0x75, 0x17e, 0x117, 0x73, 0x3b, 0x62, 0x69, 0x72, 0x17e, 0x65, 0x6c, 0x69, 0x6f,
-0x3b, 0x6c, 0x69, 0x65, 0x70, 0x6f, 0x73, 0x3b, 0x72, 0x75, 0x67, 0x70, 0x6a, 0x16b, 0x10d, 0x69, 0x6f, 0x3b, 0x72, 0x75,
-0x67, 0x73, 0x117, 0x6a, 0x6f, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x69, 0x6f, 0x3b, 0x6c, 0x61, 0x70, 0x6b, 0x72, 0x69, 0x10d,
-0x69, 0x6f, 0x3b, 0x67, 0x72, 0x75, 0x6f, 0x64, 0x17e, 0x69, 0x6f, 0x3b, 0x458, 0x430, 0x43d, 0x2e, 0x3b, 0x444, 0x435, 0x432,
-0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x2e,
-0x3b, 0x458, 0x443, 0x43b, 0x2e, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x2e, 0x3b, 0x43e, 0x43a, 0x442,
-0x2e, 0x3b, 0x43d, 0x43e, 0x435, 0x43c, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x458, 0x430, 0x43d, 0x443, 0x430, 0x440, 0x438,
-0x3b, 0x444, 0x435, 0x432, 0x440, 0x443, 0x430, 0x440, 0x438, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x438, 0x43b,
-0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x438, 0x3b, 0x458, 0x443, 0x43b, 0x438, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441,
-0x442, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x43c, 0x432, 0x440, 0x438,
-0x3b, 0x43d, 0x43e, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x434, 0x435, 0x43a, 0x435, 0x43c, 0x432, 0x440, 0x438, 0x3b, 0x458, 0x3b,
-0x444, 0x3b, 0x43c, 0x3b, 0x430, 0x3b, 0x43c, 0x3b, 0x458, 0x3b, 0x458, 0x3b, 0x430, 0x3b, 0x441, 0x3b, 0x43e, 0x3b, 0x43d, 0x3b,
-0x434, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65,
-0x79, 0x3b, 0x4a, 0x6f, 0x6e, 0x3b, 0x4a, 0x6f, 0x6c, 0x3b, 0x41, 0x6f, 0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b,
-0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x6f, 0x61, 0x72, 0x79, 0x3b, 0x46, 0x65,
-0x62, 0x72, 0x6f, 0x61, 0x72, 0x79, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x73, 0x61, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x79,
-0x3b, 0x4d, 0x65, 0x79, 0x3b, 0x4a, 0x6f, 0x6e, 0x61, 0x3b, 0x4a, 0x6f, 0x6c, 0x61, 0x79, 0x3b, 0x41, 0x6f, 0x67, 0x6f,
-0x73, 0x69, 0x74, 0x72, 0x61, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x61, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f,
-0x62, 0x72, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x61, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x61, 0x6d, 0x62, 0x72,
-0x61, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65,
-0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x4f, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b,
-0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65,
-0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x69,
-0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x4f, 0x67, 0x6f, 0x73, 0x3b, 0x53, 0x65, 0x70, 0x74,
-0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b,
-0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0xd1c, 0xd28, 0xd41, 0x3b,
-0xd2b, 0xd46, 0xd2c, 0xd4d, 0xd30, 0xd41, 0x3b, 0xd2e, 0xd3e, 0xd7c, 0x3b, 0xd0f, 0xd2a, 0xd4d, 0xd30, 0xd3f, 0x3b, 0xd2e, 0xd47, 0xd2f,
-0xd4d, 0x3b, 0xd1c, 0xd42, 0xd7a, 0x3b, 0xd1c, 0xd42, 0xd32, 0xd48, 0x3b, 0xd13, 0xd17, 0x3b, 0xd38, 0xd46, 0xd2a, 0xd4d, 0xd31, 0xd4d,
-0xd31, 0xd02, 0x3b, 0xd12, 0xd15, 0xd4d, 0xd1f, 0xd4b, 0x3b, 0xd28, 0xd35, 0xd02, 0x3b, 0xd21, 0xd3f, 0xd38, 0xd02, 0x3b, 0xd1c, 0xd28,
-0xd41, 0xd35, 0xd30, 0xd3f, 0x3b, 0xd2b, 0xd46, 0xd2c, 0xd4d, 0xd30, 0xd41, 0xd35, 0xd30, 0xd3f, 0x3b, 0xd2e, 0xd3e, 0xd7c, 0xd1a, 0xd4d,
-0xd1a, 0xd4d, 0x3b, 0xd0f, 0xd2a, 0xd4d, 0xd30, 0xd3f, 0xd7d, 0x3b, 0xd2e, 0xd47, 0xd2f, 0xd4d, 0x3b, 0xd1c, 0xd42, 0xd7a, 0x3b, 0xd1c,
-0xd42, 0xd32, 0xd48, 0x3b, 0xd13, 0xd17, 0xd38, 0xd4d, 0xd31, 0xd4d, 0xd31, 0xd4d, 0x3b, 0xd38, 0xd46, 0xd2a, 0xd4d, 0xd31, 0xd4d, 0xd31,
-0xd02, 0xd2c, 0xd7c, 0x3b, 0xd12, 0xd15, 0xd4d, 0x200c, 0xd1f, 0xd4b, 0xd2c, 0xd7c, 0x3b, 0xd28, 0xd35, 0xd02, 0xd2c, 0xd7c, 0x3b, 0xd21,
-0xd3f, 0xd38, 0xd02, 0xd2c, 0xd7c, 0x3b, 0xd1c, 0x3b, 0xd2b, 0xd46, 0x3b, 0xd2e, 0xd3e, 0x3b, 0xd0f, 0x3b, 0xd2e, 0xd46, 0x3b, 0xd1c,
-0xd42, 0xd7a, 0x3b, 0xd1c, 0xd42, 0x3b, 0xd13, 0x3b, 0xd38, 0xd46, 0x3b, 0xd12, 0x3b, 0xd28, 0x3b, 0xd21, 0xd3f, 0x3b, 0x4a, 0x61,
-0x6e, 0x3b, 0x46, 0x72, 0x61, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x6a, 0x3b, 0x120, 0x75,
-0x6e, 0x3b, 0x4c, 0x75, 0x6c, 0x3b, 0x41, 0x77, 0x77, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x74, 0x74, 0x3b, 0x4e, 0x6f,
-0x76, 0x3b, 0x44, 0x69, 0x10b, 0x3b, 0x4a, 0x61, 0x6e, 0x6e, 0x61, 0x72, 0x3b, 0x46, 0x72, 0x61, 0x72, 0x3b, 0x4d, 0x61,
-0x72, 0x7a, 0x75, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x6a, 0x6a, 0x75, 0x3b, 0x120, 0x75, 0x6e, 0x6a,
-0x75, 0x3b, 0x4c, 0x75, 0x6c, 0x6a, 0x75, 0x3b, 0x41, 0x77, 0x77, 0x69, 0x73, 0x73, 0x75, 0x3b, 0x53, 0x65, 0x74, 0x74,
-0x65, 0x6d, 0x62, 0x72, 0x75, 0x3b, 0x4f, 0x74, 0x74, 0x75, 0x62, 0x72, 0x75, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
-0x72, 0x75, 0x3b, 0x44, 0x69, 0x10b, 0x65, 0x6d, 0x62, 0x72, 0x75, 0x3b, 0x4a, 0x6e, 0x3b, 0x46, 0x72, 0x3b, 0x4d, 0x7a,
-0x3b, 0x41, 0x70, 0x3b, 0x4d, 0x6a, 0x3b, 0x120, 0x6e, 0x3b, 0x4c, 0x6a, 0x3b, 0x41, 0x77, 0x3b, 0x53, 0x74, 0x3b, 0x4f,
-0x62, 0x3b, 0x4e, 0x76, 0x3b, 0x44, 0x10b, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x120, 0x3b,
-0x4c, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4b, 0x6f, 0x68, 0x69, 0x3b, 0x48, 0x75, 0x69,
-0x3b, 0x50, 0x6f, 0x75, 0x3b, 0x50, 0x61, 0x65, 0x3b, 0x48, 0x61, 0x72, 0x61, 0x3b, 0x50, 0x69, 0x70, 0x69, 0x3b, 0x48,
-0x14d, 0x6e, 0x67, 0x6f, 0x3b, 0x48, 0x65, 0x72, 0x65, 0x3b, 0x4d, 0x61, 0x68, 0x75, 0x3b, 0x4e, 0x75, 0x6b, 0x75, 0x3b,
-0x52, 0x61, 0x6e, 0x67, 0x69, 0x3b, 0x48, 0x61, 0x6b, 0x69, 0x3b, 0x4b, 0x6f, 0x68, 0x69, 0x74, 0x101, 0x74, 0x65, 0x61,
-0x3b, 0x48, 0x75, 0x69, 0x74, 0x61, 0x6e, 0x67, 0x75, 0x72, 0x75, 0x3b, 0x50, 0x6f, 0x75, 0x74, 0x16b, 0x74, 0x65, 0x72,
-0x61, 0x6e, 0x67, 0x69, 0x3b, 0x50, 0x61, 0x65, 0x6e, 0x67, 0x61, 0x77, 0x68, 0x101, 0x77, 0x68, 0x101, 0x3b, 0x48, 0x61,
-0x72, 0x61, 0x74, 0x75, 0x61, 0x3b, 0x50, 0x69, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x48, 0x14d, 0x6e, 0x67, 0x6f, 0x6e, 0x67,
-0x6f, 0x69, 0x3b, 0x48, 0x65, 0x72, 0x65, 0x74, 0x75, 0x72, 0x69, 0x6b, 0x14d, 0x6b, 0x101, 0x3b, 0x4d, 0x61, 0x68, 0x75,
-0x72, 0x75, 0x3b, 0x57, 0x68, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x61, 0x2d, 0x101, 0x2d, 0x6e, 0x75, 0x6b, 0x75, 0x3b, 0x57,
-0x68, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x61, 0x2d, 0x101, 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x69, 0x3b, 0x48, 0x61, 0x6b, 0x69,
-0x68, 0x65, 0x61, 0x3b, 0x4b, 0x3b, 0x48, 0x3b, 0x50, 0x3b, 0x50, 0x3b, 0x48, 0x3b, 0x50, 0x3b, 0x48, 0x3b, 0x48, 0x3b,
-0x4d, 0x3b, 0x4e, 0x3b, 0x52, 0x3b, 0x48, 0x3b, 0x91c, 0x93e, 0x928, 0x947, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930, 0x941, 0x3b,
-0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x90f, 0x92a, 0x94d, 0x930, 0x93f, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c,
-0x941, 0x932, 0x948, 0x3b, 0x911, 0x917, 0x3b, 0x938, 0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x3b, 0x911, 0x915, 0x94d, 0x91f, 0x94b, 0x3b,
-0x928, 0x94b, 0x935, 0x94d, 0x939, 0x947, 0x902, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x902, 0x3b, 0x91c, 0x93e, 0x928, 0x947, 0x935, 0x93e,
-0x930, 0x940, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b,
-0x90f, 0x92a, 0x94d, 0x930, 0x93f, 0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x948, 0x3b, 0x911,
-0x917, 0x938, 0x94d, 0x91f, 0x3b, 0x938, 0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x911, 0x915, 0x94d, 0x91f, 0x94b, 0x92c,
-0x930, 0x3b, 0x928, 0x94b, 0x935, 0x94d, 0x939, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x902, 0x92c, 0x930, 0x3b,
-0x91c, 0x93e, 0x3b, 0x92b, 0x947, 0x3b, 0x92e, 0x93e, 0x3b, 0x90f, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x942, 0x3b, 0x91c, 0x941, 0x3b,
-0x911, 0x3b, 0x938, 0x3b, 0x911, 0x3b, 0x928, 0x94b, 0x3b, 0x921, 0x93f, 0x3b, 0x31, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b,
-0x32, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x33, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x34, 0x2d, 0x440, 0x20,
-0x441, 0x430, 0x440, 0x3b, 0x35, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x36, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b,
-0x37, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x38, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x39, 0x2d, 0x440, 0x20,
-0x441, 0x430, 0x440, 0x3b, 0x31, 0x30, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x31, 0x31, 0x2d, 0x440, 0x20, 0x441, 0x430,
-0x440, 0x3b, 0x31, 0x32, 0x2d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x41d, 0x44d, 0x433, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440,
-0x20, 0x441, 0x430, 0x440, 0x3b, 0x425, 0x43e, 0x451, 0x440, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b,
-0x413, 0x443, 0x440, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x414, 0x4e9, 0x440, 0x4e9,
-0x432, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x422, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430,
-0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x417, 0x443, 0x440, 0x433, 0x430, 0x430, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441,
-0x430, 0x440, 0x3b, 0x414, 0x43e, 0x43b, 0x43e, 0x43e, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x41d,
-0x430, 0x439, 0x43c, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x415, 0x441, 0x434, 0x4af, 0x433, 0x44d,
-0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x410, 0x440, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430,
-0x440, 0x3b, 0x410, 0x440, 0x432, 0x430, 0x43d, 0x20, 0x43d, 0x44d, 0x433, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430,
-0x440, 0x3b, 0x410, 0x440, 0x432, 0x430, 0x43d, 0x20, 0x445, 0x43e, 0x451, 0x440, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441,
-0x430, 0x440, 0x3b, 0x49, 0x3b, 0x49, 0x49, 0x3b, 0x49, 0x49, 0x49, 0x3b, 0x49, 0x56, 0x3b, 0x56, 0x3b, 0x56, 0x49, 0x3b,
-0x56, 0x49, 0x49, 0x3b, 0x56, 0x49, 0x49, 0x49, 0x3b, 0x49, 0x58, 0x3b, 0x58, 0x3b, 0x58, 0x49, 0x3b, 0x58, 0x49, 0x49,
-0x3b, 0x43d, 0x44d, 0x433, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x445, 0x43e, 0x451, 0x440, 0x434,
-0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x433, 0x443, 0x440, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430,
-0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x434, 0x4e9, 0x440, 0x4e9, 0x432, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430,
-0x440, 0x3b, 0x442, 0x430, 0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x437, 0x443, 0x440, 0x433,
-0x430, 0x430, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x434, 0x43e, 0x43b, 0x43e, 0x43e, 0x434, 0x443,
-0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x43d, 0x430, 0x439, 0x43c, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20,
-0x441, 0x430, 0x440, 0x3b, 0x435, 0x441, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x430, 0x440, 0x430,
-0x432, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x430, 0x440, 0x432, 0x430, 0x43d, 0x20, 0x43d, 0x44d,
-0x433, 0x434, 0x4af, 0x433, 0x44d, 0x44d, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x430, 0x440, 0x432, 0x430, 0x43d, 0x20, 0x445, 0x43e,
-0x451, 0x440, 0x434, 0x443, 0x433, 0x430, 0x430, 0x440, 0x20, 0x441, 0x430, 0x440, 0x3b, 0x91c, 0x928, 0x935, 0x930, 0x940, 0x3b, 0x92b,
-0x947, 0x92c, 0x94d, 0x930, 0x941, 0x905, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x93f,
-0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x93e, 0x908, 0x3b, 0x905, 0x917, 0x938, 0x94d, 0x91f,
-0x3b, 0x938, 0x947, 0x92a, 0x94d, 0x91f, 0x947, 0x92e, 0x94d, 0x92c, 0x930, 0x3b, 0x905, 0x915, 0x94d, 0x91f, 0x94b, 0x92c, 0x930, 0x3b,
-0x928, 0x94b, 0x92d, 0x947, 0x92e, 0x94d, 0x92c, 0x930, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x92e, 0x94d, 0x92c, 0x930, 0x3b, 0x91c, 0x928,
-0x3b, 0x92b, 0x947, 0x947, 0x92c, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x3b, 0x92e, 0x947, 0x3b,
-0x91c, 0x941, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x3b, 0x905, 0x917, 0x3b, 0x938, 0x947, 0x92a, 0x3b, 0x905, 0x915, 0x94d, 0x91f, 0x94b,
-0x3b, 0x928, 0x94b, 0x92d, 0x947, 0x3b, 0x921, 0x93f, 0x938, 0x947, 0x3b, 0x91c, 0x928, 0x3b, 0x92b, 0x947, 0x92c, 0x3b, 0x92e, 0x93e,
-0x930, 0x94d, 0x91a, 0x3b, 0x905, 0x92a, 0x94d, 0x930, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x3b,
-0x905, 0x917, 0x3b, 0x938, 0x947, 0x92a, 0x3b, 0x905, 0x915, 0x94d, 0x91f, 0x94b, 0x3b, 0x928, 0x94b, 0x92d, 0x947, 0x3b, 0x921, 0x93f,
-0x938, 0x947, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61,
-0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75,
-0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b,
-0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x73,
-0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0xb1c, 0xb3e, 0xb28, 0xb41, 0xb06, 0xb30, 0xb40, 0x3b, 0xb2b, 0xb47, 0xb2c, 0xb43, 0xb06, 0xb30,
-0xb40, 0x3b, 0xb2e, 0xb3e, 0xb30, 0xb4d, 0xb1a, 0xb4d, 0xb1a, 0x3b, 0xb05, 0xb2a, 0xb4d, 0xb30, 0xb47, 0xb32, 0x3b, 0xb2e, 0xb07, 0x3b,
-0xb1c, 0xb41, 0xb28, 0x3b, 0xb1c, 0xb41, 0xb32, 0xb3e, 0xb07, 0x3b, 0xb05, 0xb17, 0xb37, 0xb4d, 0xb1f, 0x3b, 0xb38, 0xb47, 0xb2a, 0xb4d,
-0xb1f, 0xb47, 0xb2e, 0xb4d, 0xb2c, 0xb30, 0x3b, 0xb05, 0xb15, 0xb4d, 0xb1f, 0xb4b, 0xb2c, 0xb30, 0x3b, 0xb28, 0xb2d, 0xb47, 0xb2e, 0xb4d,
-0xb2c, 0xb30, 0x3b, 0xb21, 0xb3f, 0xb38, 0xb47, 0xb2e, 0xb4d, 0xb2c, 0xb30, 0x3b, 0xb1c, 0xb3e, 0x3b, 0xb2b, 0xb47, 0x3b, 0xb2e, 0xb3e,
-0x3b, 0xb05, 0x3b, 0xb2e, 0xb07, 0x3b, 0xb1c, 0xb41, 0x3b, 0xb1c, 0xb41, 0x3b, 0xb05, 0x3b, 0xb38, 0xb47, 0x3b, 0xb05, 0x3b, 0xb28,
-0x3b, 0xb21, 0xb3f, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631,
-0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cd, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x6cc,
-0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b,
-0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x6d0,
-0x628, 0x631, 0x648, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cd, 0x3b,
-0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628,
-0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631,
-0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627,
-0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cd, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x6cc, 0x3b, 0x627, 0x6af,
-0x633, 0x62a, 0x3b, 0x633, 0x6d0, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648,
-0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x627, 0x3b, 0x645, 0x3b,
-0x62c, 0x3b, 0x62c, 0x3b, 0x627, 0x3b, 0x633, 0x3b, 0x627, 0x3b, 0x646, 0x3b, 0x62f, 0x3b, 0x698, 0x627, 0x646, 0x648, 0x6cc, 0x647,
-0x3b, 0x641, 0x648, 0x631, 0x6cc, 0x647, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x622, 0x648, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x647,
-0x3b, 0x698, 0x648, 0x626, 0x646, 0x3b, 0x698, 0x648, 0x626, 0x6cc, 0x647, 0x3b, 0x627, 0x648, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x627,
-0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x627, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x627,
-0x645, 0x628, 0x631, 0x3b, 0x698, 0x3b, 0x641, 0x3b, 0x645, 0x3b, 0x622, 0x3b, 0x645, 0x3b, 0x698, 0x3b, 0x698, 0x3b, 0x627, 0x3b,
-0x633, 0x3b, 0x627, 0x3b, 0x646, 0x3b, 0x62f, 0x3b, 0x698, 0x627, 0x646, 0x648, 0x6cc, 0x647, 0x654, 0x3b, 0x641, 0x648, 0x631, 0x6cc,
-0x647, 0x654, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x622, 0x648, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x647, 0x654, 0x3b, 0x698, 0x648,
-0x626, 0x646, 0x3b, 0x698, 0x648, 0x626, 0x6cc, 0x647, 0x654, 0x3b, 0x627, 0x648, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x627, 0x645, 0x628,
-0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x628, 0x631, 0x3b, 0x646, 0x648, 0x627, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x627, 0x645, 0x628,
-0x631, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x6cc, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631, 0x6cc, 0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b,
-0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627, 0x6cc, 0x3b, 0x627,
-0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631, 0x3b, 0x646, 0x648,
-0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x62c, 0x646, 0x648, 0x3b, 0x641, 0x628, 0x631, 0x648, 0x631, 0x6cc,
-0x3b, 0x645, 0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c,
-0x648, 0x644, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x67e, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628,
-0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x3b, 0x73, 0x74, 0x79, 0x3b, 0x6c, 0x75, 0x74, 0x3b,
-0x6d, 0x61, 0x72, 0x3b, 0x6b, 0x77, 0x69, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x63, 0x7a, 0x65, 0x3b, 0x6c, 0x69, 0x70, 0x3b,
-0x73, 0x69, 0x65, 0x3b, 0x77, 0x72, 0x7a, 0x3b, 0x70, 0x61, 0x17a, 0x3b, 0x6c, 0x69, 0x73, 0x3b, 0x67, 0x72, 0x75, 0x3b,
-0x73, 0x74, 0x79, 0x63, 0x7a, 0x65, 0x144, 0x3b, 0x6c, 0x75, 0x74, 0x79, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x65, 0x63, 0x3b,
-0x6b, 0x77, 0x69, 0x65, 0x63, 0x69, 0x65, 0x144, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x63, 0x7a, 0x65, 0x72, 0x77, 0x69, 0x65,
-0x63, 0x3b, 0x6c, 0x69, 0x70, 0x69, 0x65, 0x63, 0x3b, 0x73, 0x69, 0x65, 0x72, 0x70, 0x69, 0x65, 0x144, 0x3b, 0x77, 0x72,
-0x7a, 0x65, 0x73, 0x69, 0x65, 0x144, 0x3b, 0x70, 0x61, 0x17a, 0x64, 0x7a, 0x69, 0x65, 0x72, 0x6e, 0x69, 0x6b, 0x3b, 0x6c,
-0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x3b, 0x67, 0x72, 0x75, 0x64, 0x7a, 0x69, 0x65, 0x144, 0x3b, 0x53, 0x3b, 0x4c,
-0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x43, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x57, 0x3b, 0x50, 0x3b, 0x4c, 0x3b, 0x47,
-0x3b, 0x73, 0x74, 0x79, 0x63, 0x7a, 0x6e, 0x69, 0x61, 0x3b, 0x6c, 0x75, 0x74, 0x65, 0x67, 0x6f, 0x3b, 0x6d, 0x61, 0x72,
-0x63, 0x61, 0x3b, 0x6b, 0x77, 0x69, 0x65, 0x74, 0x6e, 0x69, 0x61, 0x3b, 0x6d, 0x61, 0x6a, 0x61, 0x3b, 0x63, 0x7a, 0x65,
-0x72, 0x77, 0x63, 0x61, 0x3b, 0x6c, 0x69, 0x70, 0x63, 0x61, 0x3b, 0x73, 0x69, 0x65, 0x72, 0x70, 0x6e, 0x69, 0x61, 0x3b,
-0x77, 0x72, 0x7a, 0x65, 0x15b, 0x6e, 0x69, 0x61, 0x3b, 0x70, 0x61, 0x17a, 0x64, 0x7a, 0x69, 0x65, 0x72, 0x6e, 0x69, 0x6b,
-0x61, 0x3b, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x70, 0x61, 0x64, 0x61, 0x3b, 0x67, 0x72, 0x75, 0x64, 0x6e, 0x69, 0x61, 0x3b,
-0x73, 0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x63, 0x3b, 0x6c, 0x3b, 0x73, 0x3b, 0x77, 0x3b, 0x70, 0x3b,
-0x6c, 0x3b, 0x67, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x76, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x62, 0x72, 0x3b,
-0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x3b,
-0x6f, 0x75, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x7a, 0x3b, 0x6a, 0x61, 0x6e, 0x65, 0x69, 0x72, 0x6f, 0x3b,
-0x66, 0x65, 0x76, 0x65, 0x72, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0xe7, 0x6f, 0x3b, 0x61, 0x62, 0x72, 0x69,
-0x6c, 0x3b, 0x6d, 0x61, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x68, 0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x68, 0x6f, 0x3b, 0x61,
-0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x6f, 0x75, 0x74, 0x75, 0x62,
-0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x64, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x72, 0x6f,
-0x3b, 0xa1c, 0xa28, 0x3b, 0xa2b, 0xa3c, 0xa30, 0x3b, 0xa2e, 0xa3e, 0xa30, 0xa1a, 0x3b, 0xa05, 0xa2a, 0xa4d, 0xa30, 0xa48, 0x3b, 0xa2e,
-0xa08, 0x3b, 0xa1c, 0xa42, 0xa28, 0x3b, 0xa1c, 0xa41, 0xa32, 0xa3e, 0x3b, 0xa05, 0xa17, 0x3b, 0xa38, 0xa24, 0xa70, 0x3b, 0xa05, 0xa15,
-0xa24, 0xa42, 0x3b, 0xa28, 0xa35, 0xa70, 0x3b, 0xa26, 0xa38, 0xa70, 0x3b, 0xa1c, 0xa28, 0xa35, 0xa30, 0xa40, 0x3b, 0xa2b, 0xa3c, 0xa30,
-0xa35, 0xa30, 0xa40, 0x3b, 0xa2e, 0xa3e, 0xa30, 0xa1a, 0x3b, 0xa05, 0xa2a, 0xa4d, 0xa30, 0xa48, 0xa32, 0x3b, 0xa2e, 0xa08, 0x3b, 0xa1c,
-0xa42, 0xa28, 0x3b, 0xa1c, 0xa41, 0xa32, 0xa3e, 0xa08, 0x3b, 0xa05, 0xa17, 0xa38, 0xa24, 0x3b, 0xa38, 0xa24, 0xa70, 0xa2c, 0xa30, 0x3b,
-0xa05, 0xa15, 0xa24, 0xa42, 0xa2c, 0xa30, 0x3b, 0xa28, 0xa35, 0xa70, 0xa2c, 0xa30, 0x3b, 0xa26, 0xa38, 0xa70, 0xa2c, 0xa30, 0x3b, 0xa1c,
-0x3b, 0xa2b, 0xa3c, 0x3b, 0xa2e, 0xa3e, 0x3b, 0xa05, 0x3b, 0xa2e, 0x3b, 0xa1c, 0xa42, 0x3b, 0xa1c, 0xa41, 0x3b, 0xa05, 0x3b, 0xa38,
-0x3b, 0xa05, 0x3b, 0xa28, 0x3b, 0xa26, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x6cc, 0x3b, 0x641, 0x631, 0x648, 0x631, 0x6cc, 0x3b, 0x645,
-0x627, 0x631, 0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x626, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644,
-0x627, 0x626, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628,
-0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x45, 0x6e, 0x65, 0x3b, 0x46, 0x65,
-0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75,
-0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x63, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69,
-0x63, 0x3b, 0x45, 0x6e, 0x65, 0x72, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x7a,
-0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x6f, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x4a,
-0x75, 0x6c, 0x69, 0x6f, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72,
-0x65, 0x3b, 0x4f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x4e, 0x6f, 0x76, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b,
-0x44, 0x69, 0x63, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x73, 0x63, 0x68, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x61, 0x76,
-0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x74, 0x67, 0x3b, 0x7a, 0x65,
-0x72, 0x63, 0x6c, 0x2e, 0x3b, 0x66, 0x61, 0x6e, 0x2e, 0x3b, 0x61, 0x76, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x74,
-0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x73, 0x63, 0x68,
-0x61, 0x6e, 0x65, 0x72, 0x3b, 0x66, 0x61, 0x76, 0x72, 0x65, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76, 0x72,
-0x69, 0x67, 0x6c, 0x3b, 0x6d, 0x61, 0x74, 0x67, 0x3b, 0x7a, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x64, 0x75, 0x72, 0x3b, 0x66,
-0x61, 0x6e, 0x61, 0x64, 0x75, 0x72, 0x3b, 0x61, 0x76, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x6f, 0x63, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b,
-0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x53, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x5a,
-0x3b, 0x46, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x69, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65,
-0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x69, 0x75, 0x6e,
-0x2e, 0x3b, 0x69, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63,
-0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x69, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69,
-0x65, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x65, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x65, 0x3b, 0x61,
-0x70, 0x72, 0x69, 0x6c, 0x69, 0x65, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x69, 0x75, 0x6e, 0x69, 0x65, 0x3b, 0x69, 0x75, 0x6c,
-0x69, 0x65, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x65,
-0x3b, 0x6f, 0x63, 0x74, 0x6f, 0x6d, 0x62, 0x72, 0x69, 0x65, 0x3b, 0x6e, 0x6f, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x65,
-0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x69, 0x65, 0x3b, 0x49, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d,
-0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x44f, 0x43d, 0x432, 0x2e, 0x3b,
-0x444, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x3b,
-0x438, 0x44e, 0x43d, 0x44c, 0x3b, 0x438, 0x44e, 0x43b, 0x44c, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x2e,
-0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x44f, 0x43d, 0x432,
-0x2e, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e, 0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430,
-0x44f, 0x3b, 0x438, 0x44e, 0x43d, 0x2e, 0x3b, 0x438, 0x44e, 0x43b, 0x2e, 0x3b, 0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d,
-0x442, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x44f,
-0x43d, 0x432, 0x430, 0x440, 0x44f, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44f, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x430, 0x3b,
-0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44f, 0x3b, 0x43c, 0x430, 0x44f, 0x3b, 0x438, 0x44e, 0x43d, 0x44f, 0x3b, 0x438, 0x44e, 0x43b, 0x44f,
-0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x430, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44f, 0x3b, 0x43e, 0x43a,
-0x442, 0x44f, 0x431, 0x440, 0x44f, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x44f, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44f,
-0x3b, 0x4e, 0x79, 0x65, 0x3b, 0x46, 0x75, 0x6c, 0x3b, 0x4d, 0x62, 0xe4, 0x3b, 0x4e, 0x67, 0x75, 0x3b, 0x42, 0xea, 0x6c,
-0x3b, 0x46, 0xf6, 0x6e, 0x3b, 0x4c, 0x65, 0x6e, 0x3b, 0x4b, 0xfc, 0x6b, 0x3b, 0x4d, 0x76, 0x75, 0x3b, 0x4e, 0x67, 0x62,
-0x3b, 0x4e, 0x61, 0x62, 0x3b, 0x4b, 0x61, 0x6b, 0x3b, 0x4e, 0x79, 0x65, 0x6e, 0x79, 0x65, 0x3b, 0x46, 0x75, 0x6c, 0x75,
-0x6e, 0x64, 0xef, 0x67, 0x69, 0x3b, 0x4d, 0x62, 0xe4, 0x6e, 0x67, 0xfc, 0x3b, 0x4e, 0x67, 0x75, 0x62, 0xf9, 0x65, 0x3b,
-0x42, 0xea, 0x6c, 0xe4, 0x77, 0xfc, 0x3b, 0x46, 0xf6, 0x6e, 0x64, 0x6f, 0x3b, 0x4c, 0x65, 0x6e, 0x67, 0x75, 0x61, 0x3b,
-0x4b, 0xfc, 0x6b, 0xfc, 0x72, 0xfc, 0x3b, 0x4d, 0x76, 0x75, 0x6b, 0x61, 0x3b, 0x4e, 0x67, 0x62, 0x65, 0x72, 0x65, 0x72,
-0x65, 0x3b, 0x4e, 0x61, 0x62, 0xe4, 0x6e, 0x64, 0xfc, 0x72, 0x75, 0x3b, 0x4b, 0x61, 0x6b, 0x61, 0x75, 0x6b, 0x61, 0x3b,
-0x4e, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x42, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b,
-0x4e, 0x3b, 0x4b, 0x3b, 0x458, 0x430, 0x43d, 0x3b, 0x444, 0x435, 0x431, 0x3b, 0x43c, 0x430, 0x440, 0x3b, 0x430, 0x43f, 0x440, 0x3b,
-0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x3b, 0x441, 0x435, 0x43f, 0x3b,
-0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x432, 0x3b, 0x434, 0x435, 0x446, 0x3b, 0x458, 0x430, 0x43d, 0x443, 0x430, 0x440, 0x3b, 0x444,
-0x435, 0x431, 0x440, 0x443, 0x430, 0x440, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x438, 0x43b, 0x3b, 0x43c, 0x430,
-0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43f,
-0x442, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x431, 0x430, 0x440, 0x3b, 0x43d, 0x43e, 0x432, 0x435, 0x43c,
-0x431, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x446, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62,
-0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75,
-0x6c, 0x3b, 0x61, 0x76, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64,
-0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61,
-0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c,
-0x3b, 0x61, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x6f, 0x6b,
-0x74, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d,
-0x62, 0x61, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b,
-0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b,
-0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62,
-0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b,
-0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b,
-0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x458, 0x430, 0x43d, 0x3b, 0x444, 0x435, 0x431, 0x3b, 0x43c, 0x430,
-0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430,
-0x432, 0x433, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x432, 0x3b, 0x434, 0x435, 0x446, 0x3b,
-0x42f, 0x43d, 0x432, 0x2e, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x2e, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x2e, 0x3b, 0x410, 0x43f, 0x440,
-0x2e, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x44c, 0x3b, 0x418, 0x44e, 0x43b, 0x44c, 0x3b, 0x410, 0x432, 0x433, 0x2e,
-0x3b, 0x421, 0x435, 0x43d, 0x442, 0x2e, 0x3b, 0x41e, 0x43a, 0x442, 0x2e, 0x3b, 0x41d, 0x43e, 0x44f, 0x431, 0x2e, 0x3b, 0x414, 0x435,
-0x43a, 0x2e, 0x3b, 0x42f, 0x43d, 0x432, 0x430, 0x440, 0x44c, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44c, 0x3b, 0x41c, 0x430,
-0x440, 0x442, 0x44a, 0x438, 0x3b, 0x410, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x44c,
-0x3b, 0x418, 0x44e, 0x43b, 0x44c, 0x3b, 0x410, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440,
-0x44c, 0x3b, 0x41e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x41d, 0x43e, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x414, 0x435, 0x43a,
-0x430, 0x431, 0x440, 0x44c, 0x3b, 0x44f, 0x43d, 0x432, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e, 0x3b,
-0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x44b, 0x3b, 0x438, 0x44e, 0x43d, 0x44b, 0x3b, 0x438, 0x44e, 0x43b, 0x44b, 0x3b,
-0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x2e, 0x3b,
-0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x44f, 0x43d, 0x432, 0x430, 0x440, 0x44b, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x44b, 0x3b,
-0x43c, 0x430, 0x440, 0x442, 0x44a, 0x438, 0x439, 0x44b, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44b, 0x3b, 0x43c, 0x430, 0x439, 0x44b,
-0x3b, 0x438, 0x44e, 0x43d, 0x44b, 0x3b, 0x438, 0x44e, 0x43b, 0x44b, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x44b, 0x3b, 0x441,
-0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x44b, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44b, 0x3b, 0x43d, 0x43e, 0x44f, 0x431,
-0x440, 0x44b, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44b, 0x3b, 0x4e, 0x64, 0x69, 0x3b, 0x4b, 0x75, 0x6b, 0x3b, 0x4b,
-0x75, 0x72, 0x3b, 0x4b, 0x75, 0x62, 0x3b, 0x43, 0x68, 0x76, 0x3b, 0x43, 0x68, 0x6b, 0x3b, 0x43, 0x68, 0x67, 0x3b, 0x4e,
-0x79, 0x61, 0x3b, 0x47, 0x75, 0x6e, 0x3b, 0x47, 0x75, 0x6d, 0x3b, 0x4d, 0x62, 0x75, 0x3b, 0x5a, 0x76, 0x69, 0x3b, 0x4e,
-0x64, 0x69, 0x72, 0x61, 0x3b, 0x4b, 0x75, 0x6b, 0x61, 0x64, 0x7a, 0x69, 0x3b, 0x4b, 0x75, 0x72, 0x75, 0x6d, 0x65, 0x3b,
-0x4b, 0x75, 0x62, 0x76, 0x75, 0x6d, 0x62, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x76, 0x61, 0x62, 0x76, 0x75, 0x3b, 0x43, 0x68,
-0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x6b, 0x75, 0x6e, 0x67, 0x75, 0x72, 0x75, 0x3b, 0x4e, 0x79, 0x61,
-0x6d, 0x61, 0x76, 0x68, 0x75, 0x76, 0x68, 0x75, 0x3b, 0x47, 0x75, 0x6e, 0x79, 0x61, 0x6e, 0x61, 0x3b, 0x47, 0x75, 0x6d,
-0x69, 0x67, 0x75, 0x72, 0x75, 0x3b, 0x4d, 0x62, 0x75, 0x64, 0x7a, 0x69, 0x3b, 0x5a, 0x76, 0x69, 0x74, 0x61, 0x3b, 0x4e,
-0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x4e, 0x3b, 0x47, 0x3b, 0x47, 0x3b, 0x4d,
-0x3b, 0x5a, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x64a, 0x3b, 0x641, 0x64a, 0x628, 0x631, 0x648, 0x631, 0x64a, 0x3b, 0x645, 0x627, 0x631,
-0x686, 0x3b, 0x627, 0x67e, 0x631, 0x64a, 0x644, 0x3b, 0x645, 0x626, 0x64a, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627,
-0x621, 0x650, 0x3b, 0x622, 0x6af, 0x633, 0x67d, 0x3b, 0x633, 0x64a, 0x67e, 0x67d, 0x645, 0x628, 0x631, 0x3b, 0x622, 0x6aa, 0x67d, 0x648,
-0x628, 0x631, 0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x68a, 0x633, 0x645, 0x628, 0x631, 0x3b, 0xda2, 0xdb1, 0x3b, 0xdb4, 0xdd9,
-0xdb6, 0x3b, 0xdb8, 0xdcf, 0xdbb, 0xdca, 0x3b, 0xd85, 0xdb4, 0xdca, 0x200d, 0xdbb, 0xdda, 0xdbd, 0xdca, 0x3b, 0xdb8, 0xdd0, 0xdba, 0xdd2,
-0x3b, 0xda2, 0xdd6, 0xdb1, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdbd, 0xdd2, 0x3b, 0xd85, 0xd9c, 0xddd, 0x3b, 0xdc3, 0xdd0, 0xdb4, 0xdca, 0x3b,
-0xd94, 0xd9a, 0xdca, 0x3b, 0xdb1, 0xddc, 0xdc0, 0xdd0, 0x3b, 0xdaf, 0xdd9, 0xdc3, 0xdd0, 0x3b, 0xda2, 0xdb1, 0xdc0, 0xdcf, 0xdbb, 0xdd2,
-0x3b, 0xdb4, 0xdd9, 0xdb6, 0xdbb, 0xdc0, 0xdcf, 0xdbb, 0xdd2, 0x3b, 0xdb8, 0xdcf, 0xdbb, 0xdca, 0xdad, 0xdd4, 0x3b, 0xd85, 0xdb4, 0xdca,
-0x200d, 0xdbb, 0xdda, 0xdbd, 0xdca, 0x3b, 0xdb8, 0xdd0, 0xdba, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdb1, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdbd, 0xdd2,
-0x3b, 0xd85, 0xd9c, 0xddd, 0xdc3, 0xdca, 0xdad, 0xdd4, 0x3b, 0xdc3, 0xdd0, 0xdb4, 0xdca, 0xdad, 0xdd0, 0xdb8, 0xdca, 0xdb6, 0xdbb, 0xdca,
-0x3b, 0xd94, 0xd9a, 0xdca, 0xdad, 0xddd, 0xdb6, 0xdbb, 0xdca, 0x3b, 0xdb1, 0xddc, 0xdc0, 0xdd0, 0xdb8, 0xdca, 0xdb6, 0xdbb, 0xdca, 0x3b,
-0xdaf, 0xdd9, 0xdc3, 0xdd0, 0xdb8, 0xdca, 0xdb6, 0xdbb, 0xdca, 0x3b, 0xda2, 0x3b, 0xdb4, 0xdd9, 0x3b, 0xdb8, 0xdcf, 0x3b, 0xd85, 0x3b,
-0xdb8, 0xdd0, 0x3b, 0xda2, 0xdd6, 0x3b, 0xda2, 0xdd6, 0x3b, 0xd85, 0x3b, 0xdc3, 0xdd0, 0x3b, 0xd94, 0x3b, 0xdb1, 0xdd9, 0x3b, 0xdaf,
-0xdd9, 0x3b, 0xda2, 0xdb1, 0x3b, 0xdb4, 0xdd9, 0xdb6, 0x3b, 0xdb8, 0xdcf, 0xdbb, 0xdca, 0xdad, 0xdd4, 0x3b, 0xd85, 0xdb4, 0xdca, 0x200d,
-0xdbb, 0xdda, 0xdbd, 0xdca, 0x3b, 0xdb8, 0xdd0, 0xdba, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdb1, 0xdd2, 0x3b, 0xda2, 0xdd6, 0xdbd, 0xdd2, 0x3b,
-0xd85, 0xd9c, 0xddd, 0x3b, 0xdc3, 0xdd0, 0xdb4, 0xdca, 0x3b, 0xd94, 0xd9a, 0xdca, 0x3b, 0xdb1, 0xddc, 0xdc0, 0xdd0, 0x3b, 0xdaf, 0xdd9,
-0xdc3, 0xdd0, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d,
-0xe1, 0x6a, 0x3b, 0x6a, 0xfa, 0x6e, 0x3b, 0x6a, 0xfa, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f,
-0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0xe1, 0x72, 0x3b, 0x66, 0x65,
-0x62, 0x72, 0x75, 0xe1, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x65, 0x63, 0x3b, 0x61, 0x70, 0x72, 0xed, 0x6c, 0x3b, 0x6d, 0xe1,
-0x6a, 0x3b, 0x6a, 0xfa, 0x6e, 0x3b, 0x6a, 0xfa, 0x6c, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70,
-0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0xf3, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d,
-0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0xe1, 0x72, 0x61,
-0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0xe1, 0x72, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x63, 0x61, 0x3b, 0x61, 0x70, 0x72, 0xed,
-0x6c, 0x61, 0x3b, 0x6d, 0xe1, 0x6a, 0x61, 0x3b, 0x6a, 0xfa, 0x6e, 0x61, 0x3b, 0x6a, 0xfa, 0x6c, 0x61, 0x3b, 0x61, 0x75,
-0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6f, 0x6b, 0x74, 0xf3,
-0x62, 0x72, 0x61, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72,
-0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72,
-0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x76, 0x67, 0x2e,
-0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e,
-0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x61, 0x72, 0x65,
-0x63, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a, 0x3b, 0x6a, 0x75,
-0x6c, 0x69, 0x6a, 0x3b, 0x61, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72,
-0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65,
-0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41,
-0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4c, 0x75, 0x6c, 0x3b, 0x4f, 0x67, 0x73, 0x3b, 0x53,
-0x65, 0x62, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x66, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x6e, 0x61,
-0x61, 0x79, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x61, 0x61, 0x79, 0x6f, 0x3b, 0x4d, 0x61, 0x61, 0x72, 0x73, 0x6f, 0x3b,
-0x41, 0x62, 0x72, 0x69, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x75, 0x6e, 0x3b, 0x4c, 0x75, 0x75, 0x6c,
-0x69, 0x79, 0x6f, 0x3b, 0x4f, 0x67, 0x6f, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x62, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b,
-0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x66, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x44, 0x65,
-0x73, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4c,
-0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x4b, 0x6f, 0x6f,
-0x62, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x4c, 0x61, 0x62, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69,
-0x73, 0x68, 0x61, 0x20, 0x53, 0x61, 0x64, 0x64, 0x65, 0x78, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20,
-0x41, 0x66, 0x72, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53, 0x68, 0x61, 0x6e, 0x61, 0x61, 0x64,
-0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x4c, 0x69, 0x78, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20,
-0x54, 0x6f, 0x64, 0x6f, 0x62, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53, 0x69, 0x64, 0x65, 0x65,
-0x64, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x53, 0x61, 0x67, 0x61, 0x61, 0x6c, 0x61, 0x61, 0x64,
-0x3b, 0x42, 0x69, 0x73, 0x68, 0x61, 0x20, 0x54, 0x6f, 0x62, 0x6e, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73, 0x68, 0x61,
-0x20, 0x4b, 0x6f, 0x77, 0x20, 0x69, 0x79, 0x6f, 0x20, 0x54, 0x6f, 0x62, 0x6e, 0x61, 0x61, 0x64, 0x3b, 0x42, 0x69, 0x73,
-0x68, 0x61, 0x20, 0x4c, 0x61, 0x62, 0x61, 0x20, 0x69, 0x79, 0x6f, 0x20, 0x54, 0x6f, 0x62, 0x6e, 0x61, 0x61, 0x64, 0x3b,
-0x65, 0x6e, 0x65, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b,
-0x6d, 0x61, 0x79, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b,
-0x73, 0x65, 0x70, 0x74, 0x2e, 0x3b, 0x6f, 0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x69, 0x63, 0x2e,
-0x3b, 0x65, 0x6e, 0x65, 0x72, 0x6f, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f,
-0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x6a, 0x75,
-0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72,
-0x65, 0x3b, 0x6f, 0x63, 0x74, 0x75, 0x62, 0x72, 0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b,
-0x64, 0x69, 0x63, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x45, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b,
-0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x65, 0x6e, 0x65, 0x2e, 0x3b, 0x66,
-0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x79, 0x2e, 0x3b, 0x6a,
-0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f,
-0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x69, 0x63, 0x2e, 0x3b, 0x45, 0x6e, 0x65, 0x2e, 0x3b, 0x46,
-0x65, 0x62, 0x2e, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x41, 0x62, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x79, 0x2e, 0x3b, 0x4a,
-0x75, 0x6e, 0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x41, 0x67, 0x6f, 0x2e, 0x3b, 0x53, 0x65, 0x74, 0x2e, 0x3b, 0x4f,
-0x63, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x69, 0x63, 0x2e, 0x3b, 0x65, 0x6e, 0x65, 0x2e, 0x3b, 0x66,
-0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x61, 0x62, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x79, 0x2e, 0x3b, 0x6a,
-0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x67, 0x6f, 0x2e, 0x3b, 0x73, 0x65, 0x74, 0x2e, 0x3b, 0x6f,
-0x63, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x69, 0x63, 0x2e, 0x3b, 0x65, 0x6e, 0x65, 0x72, 0x6f, 0x3b,
-0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x6f, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b,
-0x6d, 0x61, 0x79, 0x6f, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6f, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6f, 0x3b, 0x61, 0x67, 0x6f,
-0x73, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x74, 0x75, 0x62, 0x72,
-0x65, 0x3b, 0x6e, 0x6f, 0x76, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x69, 0x63, 0x69, 0x65, 0x6d, 0x62, 0x72,
-0x65, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65,
-0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b,
-0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65,
-0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x69, 0x3b,
-0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74,
-0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f,
-0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66,
-0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75,
-0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b,
-0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69,
-0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c,
-0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73,
-0x74, 0x69, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72,
-0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x42f,
-0x43d, 0x432, 0x430, 0x440, 0x3b, 0x424, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x41c, 0x430, 0x440, 0x442, 0x3b, 0x410, 0x43f, 0x440,
-0x435, 0x43b, 0x3b, 0x41c, 0x430, 0x439, 0x3b, 0x418, 0x44e, 0x43d, 0x3b, 0x418, 0x44e, 0x43b, 0x3b, 0x410, 0x432, 0x433, 0x443, 0x441,
-0x442, 0x3b, 0x421, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x3b, 0x41e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x3b, 0x41d, 0x43e, 0x44f,
-0x431, 0x440, 0x3b, 0x414, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0xb9c, 0xba9, 0x2e, 0x3b, 0xbaa, 0xbbf, 0xbaa, 0xbcd, 0x2e, 0x3b,
-0xbae, 0xbbe, 0xbb0, 0xbcd, 0x2e, 0x3b, 0xb8f, 0xbaa, 0xbcd, 0x2e, 0x3b, 0xbae, 0xbc7, 0x3b, 0xb9c, 0xbc2, 0xba9, 0xbcd, 0x3b, 0xb9c,
-0xbc2, 0xbb2, 0xbc8, 0x3b, 0xb86, 0xb95, 0x2e, 0x3b, 0xb9a, 0xbc6, 0xbaa, 0xbcd, 0x2e, 0x3b, 0xb85, 0xb95, 0xbcd, 0x2e, 0x3b, 0xba8,
-0xbb5, 0x2e, 0x3b, 0xb9f, 0xbbf, 0xb9a, 0x2e, 0x3b, 0xb9c, 0xba9, 0xbb5, 0xbb0, 0xbbf, 0x3b, 0xbaa, 0xbbf, 0xbaa, 0xbcd, 0xbb0, 0xbb5,
-0xbb0, 0xbbf, 0x3b, 0xbae, 0xbbe, 0xbb0, 0xbcd, 0xb9a, 0xbcd, 0x3b, 0xb8f, 0xbaa, 0xbcd, 0xbb0, 0xbb2, 0xbcd, 0x3b, 0xbae, 0xbc7, 0x3b,
-0xb9c, 0xbc2, 0xba9, 0xbcd, 0x3b, 0xb9c, 0xbc2, 0xbb2, 0xbc8, 0x3b, 0xb86, 0xb95, 0xbb8, 0xbcd, 0xb9f, 0xbcd, 0x3b, 0xb9a, 0xbc6, 0xbaa,
-0xbcd, 0xb9f, 0xbae, 0xbcd, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xb85, 0xb95, 0xbcd, 0xb9f, 0xbcb, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xba8, 0xbb5, 0xbae,
-0xbcd, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xb9f, 0xbbf, 0xb9a, 0xbae, 0xbcd, 0xbaa, 0xbb0, 0xbcd, 0x3b, 0xb9c, 0x3b, 0xbaa, 0xbbf, 0x3b, 0xbae,
-0xbbe, 0x3b, 0xb8f, 0x3b, 0xbae, 0xbc7, 0x3b, 0xb9c, 0xbc2, 0x3b, 0xb9c, 0xbc2, 0x3b, 0xb86, 0x3b, 0xb9a, 0xbc6, 0x3b, 0xb85, 0x3b,
-0xba8, 0x3b, 0xb9f, 0xbbf, 0x3b, 0x433, 0x44b, 0x439, 0x43d, 0x2e, 0x3b, 0x444, 0x435, 0x432, 0x2e, 0x3b, 0x43c, 0x430, 0x440, 0x2e,
-0x3b, 0x430, 0x43f, 0x440, 0x2e, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x44c, 0x3b, 0x438, 0x44e, 0x43b, 0x44c, 0x3b,
-0x430, 0x432, 0x433, 0x2e, 0x3b, 0x441, 0x435, 0x43d, 0x442, 0x2e, 0x3b, 0x43e, 0x43a, 0x442, 0x2e, 0x3b, 0x43d, 0x43e, 0x44f, 0x431,
-0x2e, 0x3b, 0x434, 0x435, 0x43a, 0x2e, 0x3b, 0x433, 0x44b, 0x439, 0x43d, 0x432, 0x430, 0x440, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430,
-0x43b, 0x44c, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x435, 0x43b, 0x44c, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438,
-0x44e, 0x43d, 0x44c, 0x3b, 0x438, 0x44e, 0x43b, 0x44c, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442, 0x3b, 0x441, 0x435, 0x43d, 0x442,
-0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x44c, 0x3b, 0x43d, 0x43e, 0x44f, 0x431, 0x440, 0x44c, 0x3b,
-0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x44c, 0x3b, 0xc1c, 0xc28, 0x3b, 0xc2b, 0xc3f, 0xc2c, 0xc4d, 0xc30, 0x3b, 0xc2e, 0xc3e, 0xc30,
-0xc4d, 0xc1a, 0xc3f, 0x3b, 0xc0f, 0xc2a, 0xc4d, 0xc30, 0xc3f, 0x3b, 0xc2e, 0xc47, 0x3b, 0xc1c, 0xc42, 0xc28, 0xc4d, 0x3b, 0xc1c, 0xc41,
-0xc32, 0xc48, 0x3b, 0xc06, 0xc17, 0x3b, 0xc38, 0xc46, 0xc2a, 0xc4d, 0xc1f, 0xc46, 0xc02, 0x3b, 0xc05, 0xc15, 0xc4d, 0xc1f, 0xc4b, 0x3b,
-0xc28, 0xc35, 0xc02, 0x3b, 0xc21, 0xc3f, 0xc38, 0xc46, 0xc02, 0x3b, 0xc1c, 0xc28, 0xc35, 0xc30, 0xc3f, 0x3b, 0xc2b, 0xc3f, 0xc2c, 0xc4d,
-0xc30, 0xc35, 0xc30, 0xc3f, 0x3b, 0xc2e, 0xc3e, 0xc30, 0xc4d, 0xc1a, 0xc3f, 0x3b, 0xc0f, 0xc2a, 0xc4d, 0xc30, 0xc3f, 0xc32, 0xc4d, 0x3b,
-0xc2e, 0xc47, 0x3b, 0xc1c, 0xc42, 0xc28, 0xc4d, 0x3b, 0xc1c, 0xc41, 0xc32, 0xc48, 0x3b, 0xc06, 0xc17, 0xc38, 0xc4d, 0xc1f, 0xc41, 0x3b,
-0xc38, 0xc46, 0xc2a, 0xc4d, 0xc1f, 0xc46, 0xc02, 0xc2c, 0xc30, 0xc4d, 0x3b, 0xc05, 0xc15, 0xc4d, 0xc1f, 0xc4b, 0xc2c, 0xc30, 0xc4d, 0x3b,
-0xc28, 0xc35, 0xc02, 0xc2c, 0xc30, 0xc4d, 0x3b, 0xc21, 0xc3f, 0xc38, 0xc46, 0xc02, 0xc2c, 0xc30, 0xc4d, 0x3b, 0xc1c, 0x3b, 0xc2b, 0xc3f,
-0x3b, 0xc2e, 0xc3e, 0x3b, 0xc0f, 0x3b, 0xc2e, 0xc47, 0x3b, 0xc1c, 0xc42, 0x3b, 0xc1c, 0xc41, 0x3b, 0xc06, 0x3b, 0xc38, 0xc46, 0x3b,
-0xc05, 0x3b, 0xc28, 0x3b, 0xc21, 0xc3f, 0x3b, 0xe21, 0x2e, 0xe04, 0x2e, 0x3b, 0xe01, 0x2e, 0xe1e, 0x2e, 0x3b, 0xe21, 0xe35, 0x2e,
-0xe04, 0x2e, 0x3b, 0xe40, 0xe21, 0x2e, 0xe22, 0x2e, 0x3b, 0xe1e, 0x2e, 0xe04, 0x2e, 0x3b, 0xe21, 0xe34, 0x2e, 0xe22, 0x2e, 0x3b,
-0xe01, 0x2e, 0xe04, 0x2e, 0x3b, 0xe2a, 0x2e, 0xe04, 0x2e, 0x3b, 0xe01, 0x2e, 0xe22, 0x2e, 0x3b, 0xe15, 0x2e, 0xe04, 0x2e, 0x3b,
-0xe1e, 0x2e, 0xe22, 0x2e, 0x3b, 0xe18, 0x2e, 0xe04, 0x2e, 0x3b, 0xe21, 0xe01, 0xe23, 0xe32, 0xe04, 0xe21, 0x3b, 0xe01, 0xe38, 0xe21,
-0xe20, 0xe32, 0xe1e, 0xe31, 0xe19, 0xe18, 0xe4c, 0x3b, 0xe21, 0xe35, 0xe19, 0xe32, 0xe04, 0xe21, 0x3b, 0xe40, 0xe21, 0xe29, 0xe32, 0xe22,
-0xe19, 0x3b, 0xe1e, 0xe24, 0xe29, 0xe20, 0xe32, 0xe04, 0xe21, 0x3b, 0xe21, 0xe34, 0xe16, 0xe38, 0xe19, 0xe32, 0xe22, 0xe19, 0x3b, 0xe01,
-0xe23, 0xe01, 0xe0e, 0xe32, 0xe04, 0xe21, 0x3b, 0xe2a, 0xe34, 0xe07, 0xe2b, 0xe32, 0xe04, 0xe21, 0x3b, 0xe01, 0xe31, 0xe19, 0xe22, 0xe32,
-0xe22, 0xe19, 0x3b, 0xe15, 0xe38, 0xe25, 0xe32, 0xe04, 0xe21, 0x3b, 0xe1e, 0xe24, 0xe28, 0xe08, 0xe34, 0xe01, 0xe32, 0xe22, 0xe19, 0x3b,
-0xe18, 0xe31, 0xe19, 0xe27, 0xe32, 0xe04, 0xe21, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf44, 0xf0b, 0xf54, 0xf7c, 0xf0b, 0x3b,
-0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf42, 0xf66,
-0xf74, 0xf58, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3,
-0xf0b, 0xf56, 0xf0b, 0xf63, 0xf94, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xfb2, 0xf74, 0xf42, 0xf0b, 0xf54,
-0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b,
-0xf56, 0xf62, 0xf92, 0xfb1, 0xf51, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf42, 0xf74, 0xf0b, 0xf54, 0xf0b,
-0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45,
-0xf74, 0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42,
-0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf44, 0xf0b, 0xf54, 0xf7c, 0x3b, 0xf5f, 0xfb3,
-0xf0b, 0xf56, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf42, 0xf66, 0xf74, 0xf58, 0xf0b,
-0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf5e, 0xf72, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf63, 0xf94,
-0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xfb2, 0xf74, 0xf42, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b,
-0xf56, 0xf51, 0xf74, 0xf53, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf62, 0xf92, 0xfb1, 0xf51, 0xf0b, 0xf54, 0x3b,
-0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf51, 0xf42, 0xf74, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b,
-0xf54, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf45, 0xf72, 0xf42, 0xf0b, 0xf54, 0x3b, 0xf5f, 0xfb3,
-0xf0b, 0xf56, 0xf0b, 0xf56, 0xf45, 0xf74, 0xf0b, 0xf42, 0xf49, 0xf72, 0xf66, 0xf0b, 0xf54, 0x3b, 0x1325, 0x122a, 0x3b, 0x1208, 0x12ab, 0x3b,
-0x1218, 0x130b, 0x3b, 0x121a, 0x12eb, 0x3b, 0x130d, 0x1295, 0x3b, 0x1230, 0x1290, 0x3b, 0x1213, 0x121d, 0x3b, 0x1290, 0x1213, 0x3b, 0x1218, 0x1235,
-0x3b, 0x1325, 0x1245, 0x3b, 0x1215, 0x12f3, 0x3b, 0x1273, 0x1215, 0x3b, 0x1325, 0x122a, 0x3b, 0x1208, 0x12ab, 0x1272, 0x1275, 0x3b, 0x1218, 0x130b,
-0x1262, 0x1275, 0x3b, 0x121a, 0x12eb, 0x12dd, 0x12eb, 0x3b, 0x130d, 0x1295, 0x1266, 0x1275, 0x3b, 0x1230, 0x1290, 0x3b, 0x1213, 0x121d, 0x1208, 0x3b,
-0x1290, 0x1213, 0x1230, 0x3b, 0x1218, 0x1235, 0x12a8, 0x1228, 0x121d, 0x3b, 0x1325, 0x1245, 0x121d, 0x1272, 0x3b, 0x1215, 0x12f3, 0x122d, 0x3b, 0x1273,
-0x1215, 0x1233, 0x1235, 0x3b, 0x1325, 0x3b, 0x1208, 0x3b, 0x1218, 0x3b, 0x121a, 0x3b, 0x130d, 0x3b, 0x1230, 0x3b, 0x1213, 0x3b, 0x1290, 0x3b,
-0x1218, 0x3b, 0x1325, 0x3b, 0x1215, 0x3b, 0x1273, 0x3b, 0x53, 0x101, 0x6e, 0x3b, 0x46, 0x113, 0x70, 0x3b, 0x4d, 0x61, 0x2bb, 0x61,
-0x3b, 0x2bb, 0x45, 0x70, 0x65, 0x3b, 0x4d, 0x113, 0x3b, 0x53, 0x75, 0x6e, 0x3b, 0x53, 0x69, 0x75, 0x3b, 0x2bb, 0x41, 0x6f,
-0x6b, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x2bb, 0x4f, 0x6b, 0x61, 0x3b, 0x4e, 0x14d, 0x76, 0x3b, 0x54, 0x12b, 0x73, 0x3b, 0x53,
-0x101, 0x6e, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x46, 0x113, 0x70, 0x75, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x61, 0x2bb, 0x61, 0x73,
-0x69, 0x3b, 0x2bb, 0x45, 0x70, 0x65, 0x6c, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x113, 0x3b, 0x53, 0x75, 0x6e, 0x65, 0x3b, 0x53,
-0x69, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x2bb, 0x41, 0x6f, 0x6b, 0x6f, 0x73, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x69, 0x74, 0x65,
-0x6d, 0x61, 0x3b, 0x2bb, 0x4f, 0x6b, 0x61, 0x74, 0x6f, 0x70, 0x61, 0x3b, 0x4e, 0x14d, 0x76, 0x65, 0x6d, 0x61, 0x3b, 0x54,
-0x12b, 0x73, 0x65, 0x6d, 0x61, 0x3b, 0x53, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x53, 0x3b,
-0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4f, 0x63, 0x61, 0x3b, 0x15e, 0x75, 0x62, 0x3b, 0x4d, 0x61,
-0x72, 0x3b, 0x4e, 0x69, 0x73, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x48, 0x61, 0x7a, 0x3b, 0x54, 0x65, 0x6d, 0x3b, 0x41, 0x11f,
-0x75, 0x3b, 0x45, 0x79, 0x6c, 0x3b, 0x45, 0x6b, 0x69, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x41, 0x72, 0x61, 0x3b, 0x4f, 0x63,
-0x61, 0x6b, 0x3b, 0x15e, 0x75, 0x62, 0x61, 0x74, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x3b, 0x4e, 0x69, 0x73, 0x61, 0x6e, 0x3b,
-0x4d, 0x61, 0x79, 0x131, 0x73, 0x3b, 0x48, 0x61, 0x7a, 0x69, 0x72, 0x61, 0x6e, 0x3b, 0x54, 0x65, 0x6d, 0x6d, 0x75, 0x7a,
-0x3b, 0x41, 0x11f, 0x75, 0x73, 0x74, 0x6f, 0x73, 0x3b, 0x45, 0x79, 0x6c, 0xfc, 0x6c, 0x3b, 0x45, 0x6b, 0x69, 0x6d, 0x3b,
-0x4b, 0x61, 0x73, 0x131, 0x6d, 0x3b, 0x41, 0x72, 0x61, 0x6c, 0x131, 0x6b, 0x3b, 0x4f, 0x3b, 0x15e, 0x3b, 0x4d, 0x3b, 0x4e,
-0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x45, 0x3b, 0x45, 0x3b, 0x4b, 0x3b, 0x41, 0x3b, 0xdd, 0x61, 0x6e,
-0x3b, 0x46, 0x65, 0x77, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0xfd, 0x3b, 0x49, 0xfd, 0x75,
-0x6e, 0x3b, 0x49, 0xfd, 0x75, 0x6c, 0x3b, 0x41, 0x77, 0x67, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e,
-0x6f, 0xfd, 0x3b, 0x44, 0x65, 0x6b, 0x3b, 0xdd, 0x61, 0x6e, 0x77, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x77, 0x72, 0x61, 0x6c,
-0x3b, 0x4d, 0x61, 0x72, 0x74, 0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0xfd, 0x3b, 0x49, 0xfd, 0x75, 0x6e,
-0x3b, 0x49, 0xfd, 0x75, 0x6c, 0x3b, 0x41, 0x77, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x6e, 0x74, 0xfd, 0x61, 0x62,
-0x72, 0x3b, 0x4f, 0x6b, 0x74, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x4e, 0x6f, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x44, 0x65, 0x6b,
-0x61, 0x62, 0x72, 0x3b, 0xdd, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b,
-0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0xfd, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x77, 0x3b, 0x6d, 0x61, 0x72, 0x74,
-0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0xfd, 0x3b, 0x69, 0xfd, 0x75, 0x6e, 0x3b, 0x69, 0xfd, 0x75, 0x6c, 0x3b, 0x61,
-0x77, 0x67, 0x3b, 0x73, 0x65, 0x6e, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0xfd, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0xfd,
-0x61, 0x6e, 0x77, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x77, 0x72, 0x61, 0x6c, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70,
-0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x61, 0xfd, 0x3b, 0x69, 0xfd, 0x75, 0x6e, 0x3b, 0x69, 0xfd, 0x75, 0x6c, 0x3b, 0x61, 0x77,
-0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x6e, 0x74, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0xfd, 0x61, 0x62,
-0x72, 0x3b, 0x6e, 0x6f, 0xfd, 0x61, 0x62, 0x72, 0x3b, 0x64, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0x64a, 0x627, 0x646, 0x6cb,
-0x627, 0x631, 0x3b, 0x641, 0x6d0, 0x6cb, 0x631, 0x627, 0x644, 0x3b, 0x645, 0x627, 0x631, 0x62a, 0x3b, 0x626, 0x627, 0x67e, 0x631, 0x6d0,
-0x644, 0x3b, 0x645, 0x627, 0x64a, 0x3b, 0x626, 0x649, 0x64a, 0x6c7, 0x646, 0x3b, 0x626, 0x649, 0x64a, 0x6c7, 0x644, 0x3b, 0x626, 0x627,
-0x6cb, 0x63a, 0x6c7, 0x633, 0x62a, 0x3b, 0x633, 0x6d0, 0x646, 0x62a, 0x6d5, 0x628, 0x649, 0x631, 0x3b, 0x626, 0x6c6, 0x643, 0x62a, 0x6d5,
-0x628, 0x649, 0x631, 0x3b, 0x646, 0x648, 0x64a, 0x627, 0x628, 0x649, 0x631, 0x3b, 0x62f, 0x6d0, 0x643, 0x627, 0x628, 0x649, 0x631, 0x3b,
-0x441, 0x456, 0x447, 0x3b, 0x43b, 0x44e, 0x442, 0x3b, 0x431, 0x435, 0x440, 0x3b, 0x43a, 0x432, 0x456, 0x3b, 0x442, 0x440, 0x430, 0x3b,
-0x447, 0x435, 0x440, 0x3b, 0x43b, 0x438, 0x43f, 0x3b, 0x441, 0x435, 0x440, 0x3b, 0x432, 0x435, 0x440, 0x3b, 0x436, 0x43e, 0x432, 0x3b,
-0x43b, 0x438, 0x441, 0x3b, 0x433, 0x440, 0x443, 0x3b, 0x441, 0x456, 0x447, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x44e, 0x442, 0x438, 0x439,
-0x3b, 0x431, 0x435, 0x440, 0x435, 0x437, 0x435, 0x43d, 0x44c, 0x3b, 0x43a, 0x432, 0x456, 0x442, 0x435, 0x43d, 0x44c, 0x3b, 0x442, 0x440,
-0x430, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x447, 0x435, 0x440, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x438, 0x43f, 0x435, 0x43d, 0x44c,
-0x3b, 0x441, 0x435, 0x440, 0x43f, 0x435, 0x43d, 0x44c, 0x3b, 0x432, 0x435, 0x440, 0x435, 0x441, 0x435, 0x43d, 0x44c, 0x3b, 0x436, 0x43e,
-0x432, 0x442, 0x435, 0x43d, 0x44c, 0x3b, 0x43b, 0x438, 0x441, 0x442, 0x43e, 0x43f, 0x430, 0x434, 0x3b, 0x433, 0x440, 0x443, 0x434, 0x435,
-0x43d, 0x44c, 0x3b, 0x421, 0x3b, 0x41b, 0x3b, 0x411, 0x3b, 0x41a, 0x3b, 0x422, 0x3b, 0x427, 0x3b, 0x41b, 0x3b, 0x421, 0x3b, 0x412,
-0x3b, 0x416, 0x3b, 0x41b, 0x3b, 0x413, 0x3b, 0x441, 0x456, 0x447, 0x2e, 0x3b, 0x43b, 0x44e, 0x442, 0x2e, 0x3b, 0x431, 0x435, 0x440,
-0x2e, 0x3b, 0x43a, 0x432, 0x456, 0x442, 0x2e, 0x3b, 0x442, 0x440, 0x430, 0x432, 0x2e, 0x3b, 0x447, 0x435, 0x440, 0x432, 0x2e, 0x3b,
-0x43b, 0x438, 0x43f, 0x2e, 0x3b, 0x441, 0x435, 0x440, 0x43f, 0x2e, 0x3b, 0x432, 0x435, 0x440, 0x2e, 0x3b, 0x436, 0x43e, 0x432, 0x442,
-0x2e, 0x3b, 0x43b, 0x438, 0x441, 0x442, 0x2e, 0x3b, 0x433, 0x440, 0x443, 0x434, 0x2e, 0x3b, 0x441, 0x456, 0x447, 0x43d, 0x44f, 0x3b,
-0x43b, 0x44e, 0x442, 0x43e, 0x433, 0x43e, 0x3b, 0x431, 0x435, 0x440, 0x435, 0x437, 0x43d, 0x44f, 0x3b, 0x43a, 0x432, 0x456, 0x442, 0x43d,
-0x44f, 0x3b, 0x442, 0x440, 0x430, 0x432, 0x43d, 0x44f, 0x3b, 0x447, 0x435, 0x440, 0x432, 0x43d, 0x44f, 0x3b, 0x43b, 0x438, 0x43f, 0x43d,
-0x44f, 0x3b, 0x441, 0x435, 0x440, 0x43f, 0x43d, 0x44f, 0x3b, 0x432, 0x435, 0x440, 0x435, 0x441, 0x43d, 0x44f, 0x3b, 0x436, 0x43e, 0x432,
-0x442, 0x43d, 0x44f, 0x3b, 0x43b, 0x438, 0x441, 0x442, 0x43e, 0x43f, 0x430, 0x434, 0x430, 0x3b, 0x433, 0x440, 0x443, 0x434, 0x43d, 0x44f,
-0x3b, 0x441, 0x3b, 0x43b, 0x3b, 0x431, 0x3b, 0x43a, 0x3b, 0x442, 0x3b, 0x447, 0x3b, 0x43b, 0x3b, 0x441, 0x3b, 0x432, 0x3b, 0x436,
-0x3b, 0x43b, 0x3b, 0x433, 0x3b, 0x62c, 0x646, 0x648, 0x631, 0x6cc, 0x3b, 0x641, 0x631, 0x648, 0x631, 0x6cc, 0x3b, 0x645, 0x627, 0x631,
-0x686, 0x3b, 0x627, 0x67e, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x626, 0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x627,
-0x626, 0x6cc, 0x3b, 0x627, 0x6af, 0x633, 0x62a, 0x3b, 0x633, 0x62a, 0x645, 0x628, 0x631, 0x3b, 0x627, 0x6a9, 0x62a, 0x648, 0x628, 0x631,
-0x3b, 0x646, 0x648, 0x645, 0x628, 0x631, 0x3b, 0x62f, 0x633, 0x645, 0x628, 0x631, 0x3b, 0x59, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x76,
-0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x49, 0x79, 0x6e, 0x3b, 0x49, 0x79, 0x6c,
-0x3b, 0x41, 0x76, 0x67, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x79, 0x3b, 0x44, 0x65, 0x6b,
-0x3b, 0x59, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x76, 0x72, 0x61, 0x6c, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x3b,
-0x41, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x49, 0x79, 0x75, 0x6e, 0x3b, 0x49, 0x79, 0x75, 0x6c, 0x3b,
-0x41, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x6e, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x61, 0x62,
-0x72, 0x3b, 0x4e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x44, 0x65, 0x6b, 0x61, 0x62, 0x72, 0x3b, 0x59, 0x3b, 0x46, 0x3b,
-0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b,
-0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x76, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b,
-0x69, 0x79, 0x6e, 0x3b, 0x69, 0x79, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x3b, 0x73, 0x65, 0x6e, 0x3b, 0x6f, 0x6b, 0x74, 0x3b,
-0x6e, 0x6f, 0x79, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x79, 0x61, 0x6e, 0x76, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x76, 0x72, 0x61,
-0x6c, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x69, 0x79, 0x75,
-0x6e, 0x3b, 0x69, 0x79, 0x75, 0x6c, 0x3b, 0x61, 0x76, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x62,
-0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x61, 0x62, 0x72, 0x3b, 0x6e, 0x6f, 0x79, 0x61, 0x62, 0x72, 0x3b, 0x64, 0x65, 0x6b, 0x61,
-0x62, 0x72, 0x3b, 0x62c, 0x646, 0x648, 0x3b, 0x641, 0x628, 0x631, 0x3b, 0x645, 0x627, 0x631, 0x3b, 0x627, 0x67e, 0x631, 0x3b, 0x645,
-0x6cc, 0x3b, 0x62c, 0x648, 0x646, 0x3b, 0x62c, 0x648, 0x644, 0x3b, 0x627, 0x6af, 0x633, 0x3b, 0x633, 0x67e, 0x62a, 0x3b, 0x627, 0x6a9,
-0x62a, 0x3b, 0x646, 0x648, 0x645, 0x3b, 0x62f, 0x633, 0x645, 0x3b, 0x44f, 0x43d, 0x432, 0x3b, 0x444, 0x435, 0x432, 0x3b, 0x43c, 0x430,
-0x440, 0x3b, 0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x3b, 0x438, 0x44e, 0x43b, 0x3b, 0x430, 0x432,
-0x433, 0x3b, 0x441, 0x435, 0x43d, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x44f, 0x3b, 0x434, 0x435, 0x43a, 0x3b, 0x44f, 0x43d,
-0x432, 0x430, 0x440, 0x3b, 0x444, 0x435, 0x432, 0x440, 0x430, 0x43b, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x435,
-0x43b, 0x3b, 0x43c, 0x430, 0x439, 0x3b, 0x438, 0x44e, 0x43d, 0x3b, 0x438, 0x44e, 0x43b, 0x3b, 0x430, 0x432, 0x433, 0x443, 0x441, 0x442,
-0x3b, 0x441, 0x435, 0x43d, 0x442, 0x44f, 0x431, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x44f, 0x431, 0x440, 0x3b, 0x43d, 0x43e, 0x44f, 0x431,
-0x440, 0x3b, 0x434, 0x435, 0x43a, 0x430, 0x431, 0x440, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x32,
-0x3b, 0x54, 0x68, 0x67, 0x20, 0x33, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x34, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x35, 0x3b, 0x54,
-0x68, 0x67, 0x20, 0x36, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x37, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x38, 0x3b, 0x54, 0x68, 0x67,
-0x20, 0x39, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x30, 0x3b, 0x54, 0x68, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x54, 0x68, 0x67,
-0x20, 0x31, 0x32, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x32, 0x3b,
-0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x33, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x34, 0x3b, 0x54, 0x68, 0xe1, 0x6e,
-0x67, 0x20, 0x35, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x36, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x37, 0x3b,
-0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x38, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x39, 0x3b, 0x54, 0x68, 0xe1, 0x6e,
-0x67, 0x20, 0x31, 0x30, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x54, 0x68, 0xe1, 0x6e, 0x67, 0x20,
-0x31, 0x32, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x31, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x32, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x33,
-0x3b, 0x74, 0x68, 0x67, 0x20, 0x34, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x35, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x36, 0x3b, 0x74,
-0x68, 0x67, 0x20, 0x37, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x38, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x39, 0x3b, 0x74, 0x68, 0x67,
-0x20, 0x31, 0x30, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x74, 0x68, 0x67, 0x20, 0x31, 0x32, 0x3b, 0x74, 0x68,
-0xe1, 0x6e, 0x67, 0x20, 0x31, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x32, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20,
-0x33, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x34, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x35, 0x3b, 0x74, 0x68,
-0xe1, 0x6e, 0x67, 0x20, 0x36, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x37, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20,
-0x38, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x39, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x30, 0x3b, 0x74,
-0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x31, 0x3b, 0x74, 0x68, 0xe1, 0x6e, 0x67, 0x20, 0x31, 0x32, 0x3b, 0x79, 0x61, 0x6e,
-0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0xe4, 0x7a, 0x3b, 0x70, 0x72, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x79, 0x75, 0x6e,
-0x3b, 0x79, 0x75, 0x6c, 0x3b, 0x67, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x3b, 0x74, 0x6f, 0x62, 0x3b, 0x6e, 0x6f, 0x76,
-0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x79, 0x61, 0x6e, 0x75, 0x6c, 0x3b, 0x66, 0x65, 0x62, 0x75, 0x6c, 0x3b, 0x6d, 0xe4, 0x7a,
-0x75, 0x6c, 0x3b, 0x70, 0x72, 0x69, 0x6c, 0x75, 0x6c, 0x3b, 0x6d, 0x61, 0x79, 0x75, 0x6c, 0x3b, 0x79, 0x75, 0x6e, 0x75,
-0x6c, 0x3b, 0x79, 0x75, 0x6c, 0x75, 0x6c, 0x3b, 0x67, 0x75, 0x73, 0x74, 0x75, 0x6c, 0x3b, 0x73, 0x65, 0x74, 0x75, 0x6c,
-0x3b, 0x74, 0x6f, 0x62, 0x75, 0x6c, 0x3b, 0x6e, 0x6f, 0x76, 0x75, 0x6c, 0x3b, 0x64, 0x65, 0x6b, 0x75, 0x6c, 0x3b, 0x59,
-0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4e,
-0x3b, 0x44, 0x3b, 0x79, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0xe4, 0x7a, 0x3b, 0x70, 0x72, 0x6c, 0x3b, 0x6d,
-0x61, 0x79, 0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79, 0x75, 0x6c, 0x3b, 0x67, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x74, 0x3b, 0x74,
-0x6f, 0x6e, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x6b, 0x3b, 0x49, 0x6f, 0x6e, 0x3b, 0x43, 0x68, 0x77, 0x3b, 0x4d,
-0x61, 0x77, 0x3b, 0x45, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4d, 0x65, 0x68, 0x3b, 0x47, 0x6f, 0x72, 0x3b, 0x41,
-0x77, 0x73, 0x74, 0x3b, 0x4d, 0x65, 0x64, 0x69, 0x3b, 0x48, 0x79, 0x64, 0x3b, 0x54, 0x61, 0x63, 0x68, 0x3b, 0x52, 0x68,
-0x61, 0x67, 0x3b, 0x49, 0x6f, 0x6e, 0x61, 0x77, 0x72, 0x3b, 0x43, 0x68, 0x77, 0x65, 0x66, 0x72, 0x6f, 0x72, 0x3b, 0x4d,
-0x61, 0x77, 0x72, 0x74, 0x68, 0x3b, 0x45, 0x62, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4d, 0x65, 0x68,
-0x65, 0x66, 0x69, 0x6e, 0x3b, 0x47, 0x6f, 0x72, 0x66, 0x66, 0x65, 0x6e, 0x6e, 0x61, 0x66, 0x3b, 0x41, 0x77, 0x73, 0x74,
-0x3b, 0x4d, 0x65, 0x64, 0x69, 0x3b, 0x48, 0x79, 0x64, 0x72, 0x65, 0x66, 0x3b, 0x54, 0x61, 0x63, 0x68, 0x77, 0x65, 0x64,
-0x64, 0x3b, 0x52, 0x68, 0x61, 0x67, 0x66, 0x79, 0x72, 0x3b, 0x49, 0x3b, 0x43, 0x68, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d,
-0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x52, 0x68, 0x3b, 0x49, 0x6f, 0x6e, 0x3b,
-0x43, 0x68, 0x77, 0x65, 0x66, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x45, 0x62, 0x72, 0x69, 0x6c, 0x6c, 0x3b, 0x4d, 0x61, 0x69,
-0x3b, 0x4d, 0x65, 0x68, 0x3b, 0x47, 0x6f, 0x72, 0x66, 0x66, 0x3b, 0x41, 0x77, 0x73, 0x74, 0x3b, 0x4d, 0x65, 0x64, 0x69,
-0x3b, 0x48, 0x79, 0x64, 0x3b, 0x54, 0x61, 0x63, 0x68, 0x3b, 0x52, 0x68, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x3b, 0x46,
-0x65, 0x77, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x77, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x53, 0x75, 0x77, 0x3b, 0x53,
-0x75, 0x6c, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0xe0, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x77, 0x3b, 0x44, 0x65,
-0x73, 0x3b, 0x53, 0x61, 0x6d, 0x77, 0x69, 0x79, 0x65, 0x65, 0x3b, 0x46, 0x65, 0x77, 0x72, 0x69, 0x79, 0x65, 0x65, 0x3b,
-0x4d, 0x61, 0x72, 0x73, 0x3b, 0x41, 0x77, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x53, 0x75, 0x77, 0x65, 0x3b,
-0x53, 0x75, 0x6c, 0x65, 0x74, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0xe0, 0x74, 0x74, 0x75, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4f,
-0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x77, 0xe0, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x44, 0x65, 0x73,
-0xe0, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x74, 0x3b, 0x45, 0x70,
-0x72, 0x3b, 0x4d, 0x65, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x61, 0x3b, 0x53, 0x65,
-0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x79, 0x75, 0x77,
-0x61, 0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x77, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x74, 0x73, 0x68, 0x69,
-0x3b, 0x45, 0x70, 0x72, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75,
-0x6c, 0x61, 0x79, 0x69, 0x3b, 0x41, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61,
-0x3b, 0x4f, 0x6b, 0x74, 0x68, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73,
-0x65, 0x6d, 0x62, 0x61, 0x3b, 0x5d9, 0x5d0, 0x5b7, 0x5e0, 0x3b, 0x5e4, 0x5bf, 0x5e2, 0x5d1, 0x3b, 0x5de, 0x5e2, 0x5e8, 0x5e5, 0x3b,
-0x5d0, 0x5b7, 0x5e4, 0x5bc, 0x5e8, 0x3b, 0x5de, 0x5d9, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9, 0x3b,
-0x5d0, 0x5d5, 0x5d9, 0x5d2, 0x3b, 0x5e1, 0x5e2, 0x5e4, 0x5bc, 0x3b, 0x5d0, 0x5e7, 0x5d8, 0x3b, 0x5e0, 0x5d0, 0x5d5, 0x5d5, 0x3b, 0x5d3,
-0x5e2, 0x5e6, 0x3b, 0x5d9, 0x5d0, 0x5b7, 0x5e0, 0x5d5, 0x5d0, 0x5b7, 0x5e8, 0x3b, 0x5e4, 0x5bf, 0x5e2, 0x5d1, 0x5e8, 0x5d5, 0x5d0, 0x5b7,
-0x5e8, 0x3b, 0x5de, 0x5e2, 0x5e8, 0x5e5, 0x3b, 0x5d0, 0x5b7, 0x5e4, 0x5bc, 0x5e8, 0x5d9, 0x5dc, 0x3b, 0x5de, 0x5d9, 0x5d9, 0x3b, 0x5d9,
-0x5d5, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dc, 0x5d9, 0x3b, 0x5d0, 0x5d5, 0x5d9, 0x5d2, 0x5d5, 0x5e1, 0x5d8, 0x3b, 0x5e1, 0x5e2, 0x5e4,
-0x5bc, 0x5d8, 0x5e2, 0x5de, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x5d0, 0x5e7, 0x5d8, 0x5d0, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x5e0, 0x5d0, 0x5d5, 0x5d5,
-0x5e2, 0x5de, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x5d3, 0x5e2, 0x5e6, 0x5e2, 0x5de, 0x5d1, 0x5e2, 0x5e8, 0x3b, 0x1e62, 0x1eb9, 0x301, 0x3b, 0xc8,
-0x72, 0x3b, 0x1eb8, 0x72, 0x3b, 0xcc, 0x67, 0x3b, 0x1eb8, 0x300, 0x62, 0x3b, 0xd2, 0x6b, 0x3b, 0x41, 0x67, 0x3b, 0xd2, 0x67,
-0x3b, 0x4f, 0x77, 0x3b, 0x1ecc, 0x300, 0x77, 0x3b, 0x42, 0xe9, 0x3b, 0x1ecc, 0x300, 0x70, 0x3b, 0x1e62, 0x1eb9, 0x301, 0x72, 0x1eb9,
-0x301, 0x3b, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x1eb8, 0x72, 0x1eb9, 0x300, 0x6e, 0xe0, 0x3b, 0xcc, 0x67, 0x62, 0xe9, 0x3b,
-0x1eb8, 0x300, 0x62, 0x69, 0x62, 0x69, 0x3b, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x41, 0x67, 0x1eb9, 0x6d, 0x1ecd, 0x3b, 0xd2,
-0x67, 0xfa, 0x6e, 0x3b, 0x4f, 0x77, 0x65, 0x77, 0x65, 0x3b, 0x1ecc, 0x300, 0x77, 0xe0, 0x72, 0xe0, 0x3b, 0x42, 0xe9, 0x6c,
-0xfa, 0x3b, 0x1ecc, 0x300, 0x70, 0x1eb9, 0x300, 0x3b, 0x53, 0x3b, 0xc8, 0x3b, 0x1eb8, 0x3b, 0xcc, 0x3b, 0x1eb8, 0x300, 0x3b, 0xd2,
-0x3b, 0x41, 0x3b, 0xd2, 0x3b, 0x4f, 0x3b, 0x1ecc, 0x300, 0x3b, 0x42, 0x3b, 0x1ecc, 0x300, 0x3b, 0x1e62, 0x1eb9, 0x301, 0x72, 0x3b,
-0xc8, 0x72, 0xe8, 0x6c, 0x3b, 0x1eb8, 0x72, 0x1eb9, 0x300, 0x6e, 0x3b, 0xcc, 0x67, 0x62, 0x3b, 0x1eb8, 0x300, 0x62, 0x69, 0x3b,
-0xd2, 0x6b, 0xfa, 0x3b, 0x41, 0x67, 0x1eb9, 0x3b, 0xd2, 0x67, 0xfa, 0x3b, 0x4f, 0x77, 0x65, 0x3b, 0x1ecc, 0x300, 0x77, 0xe0,
-0x3b, 0x42, 0xe9, 0x6c, 0x3b, 0x1ecc, 0x300, 0x70, 0x1eb9, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1e62, 0x1eb9, 0x301, 0x72, 0x1eb9, 0x301,
-0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1eb8, 0x72, 0x1eb9, 0x300, 0x6e,
-0xe0, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xcc, 0x67, 0x62, 0xe9, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1eb8, 0x300, 0x62, 0x69, 0x62,
-0x69, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x41, 0x67, 0x1eb9, 0x6d,
-0x1ecd, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0xd2, 0x67, 0xfa, 0x6e, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x4f, 0x77, 0x65, 0x77, 0x65,
-0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1ecc, 0x300, 0x77, 0xe0, 0x72, 0xe0, 0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x42, 0xe9, 0x6c, 0xfa,
-0x3b, 0x4f, 0x1e63, 0xf9, 0x20, 0x1ecc, 0x300, 0x70, 0x1eb9, 0x300, 0x3b, 0x53, 0x68, 0x25b, 0x301, 0x3b, 0xc8, 0x72, 0x3b, 0x190,
-0x72, 0x3b, 0xcc, 0x67, 0x3b, 0x190, 0x300, 0x62, 0x3b, 0xd2, 0x6b, 0x3b, 0x41, 0x67, 0x3b, 0xd2, 0x67, 0x3b, 0x4f, 0x77,
-0x3b, 0x186, 0x300, 0x77, 0x3b, 0x42, 0xe9, 0x3b, 0x186, 0x300, 0x70, 0x3b, 0x53, 0x68, 0x25b, 0x301, 0x72, 0x25b, 0x301, 0x3b,
-0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x190, 0x72, 0x25b, 0x300, 0x6e, 0xe0, 0x3b, 0xcc, 0x67, 0x62, 0xe9, 0x3b, 0x190, 0x300,
-0x62, 0x69, 0x62, 0x69, 0x3b, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x41, 0x67, 0x25b, 0x6d, 0x254, 0x3b, 0xd2, 0x67, 0xfa,
-0x6e, 0x3b, 0x4f, 0x77, 0x65, 0x77, 0x65, 0x3b, 0x186, 0x300, 0x77, 0xe0, 0x72, 0xe0, 0x3b, 0x42, 0xe9, 0x6c, 0xfa, 0x3b,
-0x186, 0x300, 0x70, 0x25b, 0x300, 0x3b, 0x53, 0x3b, 0xc8, 0x3b, 0x190, 0x3b, 0xcc, 0x3b, 0x190, 0x300, 0x3b, 0xd2, 0x3b, 0x41,
-0x3b, 0xd2, 0x3b, 0x4f, 0x3b, 0x186, 0x300, 0x3b, 0x42, 0x3b, 0x186, 0x300, 0x3b, 0x53, 0x68, 0x25b, 0x301, 0x72, 0x3b, 0xc8,
-0x72, 0xe8, 0x6c, 0x3b, 0x190, 0x72, 0x25b, 0x300, 0x6e, 0x3b, 0xcc, 0x67, 0x62, 0x3b, 0x190, 0x300, 0x62, 0x69, 0x3b, 0xd2,
-0x6b, 0xfa, 0x3b, 0x41, 0x67, 0x25b, 0x3b, 0xd2, 0x67, 0xfa, 0x3b, 0x4f, 0x77, 0x65, 0x3b, 0x186, 0x300, 0x77, 0xe0, 0x3b,
-0x42, 0xe9, 0x6c, 0x3b, 0x186, 0x300, 0x70, 0x25b, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x53, 0x68, 0x25b, 0x301, 0x72, 0x25b,
-0x301, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xc8, 0x72, 0xe8, 0x6c, 0xe8, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x190, 0x72,
-0x25b, 0x300, 0x6e, 0xe0, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xcc, 0x67, 0x62, 0xe9, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20,
-0x190, 0x300, 0x62, 0x69, 0x62, 0x69, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xd2, 0x6b, 0xfa, 0x64, 0x75, 0x3b, 0x4f, 0x73,
-0x68, 0xf9, 0x20, 0x41, 0x67, 0x25b, 0x6d, 0x254, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0xd2, 0x67, 0xfa, 0x6e, 0x3b, 0x4f,
-0x73, 0x68, 0xf9, 0x20, 0x4f, 0x77, 0x65, 0x77, 0x65, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x186, 0x300, 0x77, 0xe0, 0x72,
-0xe0, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x42, 0xe9, 0x6c, 0xfa, 0x3b, 0x4f, 0x73, 0x68, 0xf9, 0x20, 0x186, 0x300, 0x70,
-0x25b, 0x300, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x73, 0x3b, 0x45, 0x70, 0x68, 0x3b, 0x4d,
-0x65, 0x79, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x61, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f,
-0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x77, 0x61, 0x72, 0x69, 0x3b,
-0x46, 0x65, 0x62, 0x72, 0x75, 0x77, 0x61, 0x72, 0x69, 0x3b, 0x4d, 0x61, 0x73, 0x68, 0x69, 0x3b, 0x45, 0x70, 0x68, 0x72,
-0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x79, 0x69,
-0x3b, 0x41, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x68, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b,
-0x74, 0x68, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62,
-0x61, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x53, 0x3b,
-0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x73,
-0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x69, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x3b,
-0x61, 0x75, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x76, 0x2e, 0x3b,
-0x64, 0x65, 0x73, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b,
-0x6d, 0x61, 0x72, 0x74, 0x3b, 0x61, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x3b,
-0x6a, 0x75, 0x6c, 0x69, 0x3b, 0x61, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61,
-0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x72, 0x3b, 0x6e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x64,
-0x65, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x458, 0x430, 0x43d, 0x3b, 0x444, 0x435, 0x431, 0x3b, 0x43c, 0x430, 0x440, 0x3b,
-0x430, 0x43f, 0x440, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x3b, 0x458, 0x443, 0x43b, 0x3b, 0x430, 0x443, 0x433, 0x3b,
-0x441, 0x435, 0x43f, 0x3b, 0x43e, 0x43a, 0x442, 0x3b, 0x43d, 0x43e, 0x432, 0x3b, 0x434, 0x435, 0x446, 0x3b, 0x458, 0x430, 0x43d, 0x443,
-0x430, 0x440, 0x3b, 0x444, 0x435, 0x431, 0x440, 0x443, 0x430, 0x440, 0x3b, 0x43c, 0x430, 0x440, 0x442, 0x3b, 0x430, 0x43f, 0x440, 0x438,
-0x43b, 0x3b, 0x43c, 0x430, 0x458, 0x3b, 0x458, 0x443, 0x43d, 0x438, 0x3b, 0x458, 0x443, 0x43b, 0x438, 0x3b, 0x430, 0x443, 0x433, 0x443,
-0x441, 0x442, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x43e, 0x43a, 0x442, 0x43e, 0x431, 0x430, 0x440,
-0x3b, 0x43d, 0x43e, 0x432, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x434, 0x435, 0x446, 0x435, 0x43c, 0x431, 0x430, 0x440, 0x3b, 0x4a,
-0x2d, 0x67, 0x75, 0x65, 0x72, 0x3b, 0x54, 0x2d, 0x61, 0x72, 0x72, 0x65, 0x65, 0x3b, 0x4d, 0x61, 0x79, 0x72, 0x6e, 0x74,
-0x3b, 0x41, 0x76, 0x72, 0x72, 0x69, 0x6c, 0x3b, 0x42, 0x6f, 0x61, 0x6c, 0x64, 0x79, 0x6e, 0x3b, 0x4d, 0x2d, 0x73, 0x6f,
-0x75, 0x72, 0x65, 0x65, 0x3b, 0x4a, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x65, 0x65, 0x3b, 0x4c, 0x75, 0x61, 0x6e, 0x69, 0x73,
-0x74, 0x79, 0x6e, 0x3b, 0x4d, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69, 0x72, 0x3b, 0x4a, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69,
-0x72, 0x3b, 0x4d, 0x2d, 0x48, 0x6f, 0x75, 0x6e, 0x65, 0x79, 0x3b, 0x4d, 0x2d, 0x4e, 0x6f, 0x6c, 0x6c, 0x69, 0x63, 0x6b,
-0x3b, 0x4a, 0x65, 0x72, 0x72, 0x65, 0x79, 0x2d, 0x67, 0x65, 0x75, 0x72, 0x65, 0x65, 0x3b, 0x54, 0x6f, 0x73, 0x68, 0x69,
-0x61, 0x67, 0x68, 0x74, 0x2d, 0x61, 0x72, 0x72, 0x65, 0x65, 0x3b, 0x4d, 0x61, 0x79, 0x72, 0x6e, 0x74, 0x3b, 0x41, 0x76,
-0x65, 0x72, 0x69, 0x6c, 0x3b, 0x42, 0x6f, 0x61, 0x6c, 0x64, 0x79, 0x6e, 0x3b, 0x4d, 0x65, 0x61, 0x6e, 0x2d, 0x73, 0x6f,
-0x75, 0x72, 0x65, 0x65, 0x3b, 0x4a, 0x65, 0x72, 0x72, 0x65, 0x79, 0x2d, 0x73, 0x6f, 0x75, 0x72, 0x65, 0x65, 0x3b, 0x4c,
-0x75, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x79, 0x6e, 0x3b, 0x4d, 0x65, 0x61, 0x6e, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69, 0x72,
-0x3b, 0x4a, 0x65, 0x72, 0x72, 0x65, 0x79, 0x2d, 0x66, 0x6f, 0x75, 0x79, 0x69, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x20, 0x48,
-0x6f, 0x75, 0x6e, 0x65, 0x79, 0x3b, 0x4d, 0x65, 0x65, 0x20, 0x6e, 0x79, 0x20, 0x4e, 0x6f, 0x6c, 0x6c, 0x69, 0x63, 0x6b,
-0x3b, 0x47, 0x65, 0x6e, 0x3b, 0x48, 0x77, 0x65, 0x3b, 0x4d, 0x65, 0x75, 0x3b, 0x45, 0x62, 0x72, 0x3b, 0x4d, 0x65, 0x3b,
-0x4d, 0x65, 0x74, 0x3b, 0x47, 0x6f, 0x72, 0x3b, 0x45, 0x73, 0x74, 0x3b, 0x47, 0x77, 0x6e, 0x3b, 0x48, 0x65, 0x64, 0x3b,
-0x44, 0x75, 0x3b, 0x4b, 0x65, 0x76, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x47, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x3b, 0x6d, 0x69,
-0x73, 0x20, 0x48, 0x77, 0x65, 0x76, 0x72, 0x65, 0x72, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x4d, 0x65, 0x75, 0x72, 0x74, 0x68,
-0x3b, 0x6d, 0x69, 0x73, 0x20, 0x45, 0x62, 0x72, 0x65, 0x6c, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x4d, 0x65, 0x3b, 0x6d, 0x69,
-0x73, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x65, 0x76, 0x65, 0x6e, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x47, 0x6f, 0x72, 0x74, 0x68,
-0x65, 0x72, 0x65, 0x6e, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x45, 0x73, 0x74, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x47, 0x77, 0x79,
-0x6e, 0x6e, 0x67, 0x61, 0x6c, 0x61, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x48, 0x65, 0x64, 0x72, 0x61, 0x3b, 0x6d, 0x69, 0x73,
-0x20, 0x44, 0x75, 0x3b, 0x6d, 0x69, 0x73, 0x20, 0x4b, 0x65, 0x76, 0x61, 0x72, 0x64, 0x68, 0x75, 0x3b, 0x53, 0x2d, 0x186,
-0x3b, 0x4b, 0x2d, 0x186, 0x3b, 0x45, 0x2d, 0x186, 0x3b, 0x45, 0x2d, 0x4f, 0x3b, 0x45, 0x2d, 0x4b, 0x3b, 0x4f, 0x2d, 0x41,
-0x3b, 0x41, 0x2d, 0x4b, 0x3b, 0x44, 0x2d, 0x186, 0x3b, 0x46, 0x2d, 0x190, 0x3b, 0x186, 0x2d, 0x41, 0x3b, 0x186, 0x2d, 0x4f,
-0x3b, 0x4d, 0x2d, 0x186, 0x3b, 0x53, 0x61, 0x6e, 0x64, 0x61, 0x2d, 0x186, 0x70, 0x25b, 0x70, 0x254, 0x6e, 0x3b, 0x4b, 0x77,
-0x61, 0x6b, 0x77, 0x61, 0x72, 0x2d, 0x186, 0x67, 0x79, 0x65, 0x66, 0x75, 0x6f, 0x3b, 0x45, 0x62, 0x254, 0x77, 0x2d, 0x186,
-0x62, 0x65, 0x6e, 0x65, 0x6d, 0x3b, 0x45, 0x62, 0x254, 0x62, 0x69, 0x72, 0x61, 0x2d, 0x4f, 0x66, 0x6f, 0x72, 0x69, 0x73,
-0x75, 0x6f, 0x3b, 0x45, 0x73, 0x75, 0x73, 0x6f, 0x77, 0x20, 0x41, 0x6b, 0x65, 0x74, 0x73, 0x65, 0x61, 0x62, 0x61, 0x2d,
-0x4b, 0x254, 0x74, 0x254, 0x6e, 0x69, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x62, 0x69, 0x72, 0x61, 0x64, 0x65, 0x2d, 0x41, 0x79,
-0x25b, 0x77, 0x6f, 0x68, 0x6f, 0x6d, 0x75, 0x6d, 0x75, 0x3b, 0x41, 0x79, 0x25b, 0x77, 0x6f, 0x68, 0x6f, 0x2d, 0x4b, 0x69,
-0x74, 0x61, 0x77, 0x6f, 0x6e, 0x73, 0x61, 0x3b, 0x44, 0x69, 0x66, 0x75, 0x75, 0x2d, 0x186, 0x73, 0x61, 0x6e, 0x64, 0x61,
-0x61, 0x3b, 0x46, 0x61, 0x6e, 0x6b, 0x77, 0x61, 0x2d, 0x190, 0x62, 0x254, 0x3b, 0x186, 0x62, 0x25b, 0x73, 0x25b, 0x2d, 0x41,
-0x68, 0x69, 0x6e, 0x69, 0x6d, 0x65, 0x3b, 0x186, 0x62, 0x65, 0x72, 0x25b, 0x66, 0x25b, 0x77, 0x2d, 0x4f, 0x62, 0x75, 0x62,
-0x75, 0x6f, 0x3b, 0x4d, 0x75, 0x6d, 0x75, 0x2d, 0x186, 0x70, 0x25b, 0x6e, 0x69, 0x6d, 0x62, 0x61, 0x3b, 0x91c, 0x93e, 0x928,
-0x947, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92b, 0x947, 0x92c, 0x94d, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930,
-0x94d, 0x91a, 0x3b, 0x90f, 0x92a, 0x94d, 0x930, 0x93f, 0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x942, 0x928, 0x3b, 0x91c, 0x941, 0x932,
-0x93e, 0x92f, 0x3b, 0x906, 0x917, 0x94b, 0x938, 0x94d, 0x924, 0x3b, 0x938, 0x92a, 0x94d, 0x91f, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x911,
-0x915, 0x94d, 0x91f, 0x94b, 0x92c, 0x930, 0x3b, 0x928, 0x94b, 0x935, 0x94d, 0x939, 0x947, 0x902, 0x92c, 0x930, 0x3b, 0x921, 0x93f, 0x938,
-0x947, 0x902, 0x92c, 0x930, 0x3b, 0x4a, 0x65, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x61, 0x3b, 0x45, 0x70, 0x72,
-0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x75, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x1ecc, 0x67, 0x1ecd, 0x3b, 0x53, 0x65, 0x70,
-0x3b, 0x1ecc, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x65, 0x6e, 0x1ee5, 0x77, 0x61, 0x72,
-0x1ecb, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x1ee5, 0x77, 0x61, 0x72, 0x1ecb, 0x3b, 0x4d, 0x61, 0x61, 0x63, 0x68, 0x1ecb, 0x3b, 0x45,
-0x70, 0x72, 0x65, 0x65, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x1ecb,
-0x3b, 0x1ecc, 0x67, 0x1ecd, 0x1ecd, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x1ecc, 0x6b, 0x74,
-0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b,
-0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x1ecc, 0x3b, 0x53, 0x3b, 0x1ecc, 0x3b,
-0x4e, 0x3b, 0x44, 0x3b, 0x4d, 0x62, 0x65, 0x3b, 0x4b, 0x65, 0x6c, 0x3b, 0x4b, 0x74, 0x169, 0x3b, 0x4b, 0x61, 0x6e, 0x3b,
-0x4b, 0x74, 0x6e, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x4d, 0x6f, 0x6f, 0x3b, 0x4e, 0x79, 0x61, 0x3b, 0x4b, 0x6e, 0x64, 0x3b,
-0x128, 0x6b, 0x75, 0x3b, 0x128, 0x6b, 0x6d, 0x3b, 0x128, 0x6b, 0x6c, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20,
-0x6d, 0x62, 0x65, 0x65, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65, 0x6c, 0x129, 0x3b, 0x4d, 0x77,
-0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61,
-0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x6e, 0x6f,
-0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x74, 0x68, 0x61, 0x74, 0x169, 0x3b, 0x4d,
-0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x75, 0x6f, 0x6e, 0x7a, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77,
-0x61, 0x20, 0x6e, 0x79, 0x61, 0x61, 0x6e, 0x79, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65,
-0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x129, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x77,
-0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x129, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x129, 0x6d, 0x77, 0x65, 0x3b,
-0x4d, 0x77, 0x61, 0x69, 0x20, 0x77, 0x61, 0x20, 0x129, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x69, 0x6c, 0x129,
-0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4b, 0x3b, 0x128,
-0x3b, 0x128, 0x3b, 0x128, 0x3b, 0x5a, 0x65, 0x6e, 0x3b, 0x46, 0x65, 0x76, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x76, 0x72,
-0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x67, 0x3b, 0x4c, 0x75, 0x69, 0x3b, 0x41, 0x76, 0x6f, 0x3b, 0x53, 0x65, 0x74,
-0x3b, 0x4f, 0x74, 0x75, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x69, 0x63, 0x3b, 0x5a, 0x65, 0x6e, 0xe2, 0x72, 0x3b, 0x46,
-0x65, 0x76, 0x72, 0xe2, 0x72, 0x3b, 0x4d, 0x61, 0x72, 0xe7, 0x3b, 0x41, 0x76, 0x72, 0xee, 0x6c, 0x3b, 0x4d, 0x61, 0x69,
-0x3b, 0x4a, 0x75, 0x67, 0x6e, 0x3b, 0x4c, 0x75, 0x69, 0x3b, 0x41, 0x76, 0x6f, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x74, 0x65,
-0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4f, 0x74, 0x75, 0x62, 0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72,
-0x3b, 0x44, 0x69, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x5a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b,
-0x4a, 0x3b, 0x4c, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x64, 0x7a, 0x76, 0x3b, 0x64, 0x7a,
-0x64, 0x3b, 0x74, 0x65, 0x64, 0x3b, 0x61, 0x66, 0x254, 0x3b, 0x64, 0x61, 0x6d, 0x3b, 0x6d, 0x61, 0x73, 0x3b, 0x73, 0x69,
-0x61, 0x3b, 0x64, 0x65, 0x61, 0x3b, 0x61, 0x6e, 0x79, 0x3b, 0x6b, 0x65, 0x6c, 0x3b, 0x61, 0x64, 0x65, 0x3b, 0x64, 0x7a,
-0x6d, 0x3b, 0x64, 0x7a, 0x6f, 0x76, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x64, 0x7a, 0x65, 0x3b, 0x74, 0x65, 0x64, 0x6f, 0x78,
-0x65, 0x3b, 0x61, 0x66, 0x254, 0x66, 0x129, 0x65, 0x3b, 0x64, 0x61, 0x6d, 0x61, 0x3b, 0x6d, 0x61, 0x73, 0x61, 0x3b, 0x73,
-0x69, 0x61, 0x6d, 0x6c, 0x254, 0x6d, 0x3b, 0x64, 0x65, 0x61, 0x73, 0x69, 0x61, 0x6d, 0x69, 0x6d, 0x65, 0x3b, 0x61, 0x6e,
-0x79, 0x254, 0x6e, 0x79, 0x254, 0x3b, 0x6b, 0x65, 0x6c, 0x65, 0x3b, 0x61, 0x64, 0x65, 0x25b, 0x6d, 0x65, 0x6b, 0x70, 0x254,
-0x78, 0x65, 0x3b, 0x64, 0x7a, 0x6f, 0x6d, 0x65, 0x3b, 0x64, 0x3b, 0x64, 0x3b, 0x74, 0x3b, 0x61, 0x3b, 0x64, 0x3b, 0x6d,
-0x3b, 0x73, 0x3b, 0x64, 0x3b, 0x61, 0x3b, 0x6b, 0x3b, 0x61, 0x3b, 0x64, 0x3b, 0x49, 0x61, 0x6e, 0x2e, 0x3b, 0x50, 0x65,
-0x70, 0x2e, 0x3b, 0x4d, 0x61, 0x6c, 0x2e, 0x3b, 0x2bb, 0x41, 0x70, 0x2e, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x49, 0x75, 0x6e,
-0x2e, 0x3b, 0x49, 0x75, 0x6c, 0x2e, 0x3b, 0x2bb, 0x41, 0x75, 0x2e, 0x3b, 0x4b, 0x65, 0x70, 0x2e, 0x3b, 0x2bb, 0x4f, 0x6b,
-0x2e, 0x3b, 0x4e, 0x6f, 0x77, 0x2e, 0x3b, 0x4b, 0x65, 0x6b, 0x2e, 0x3b, 0x49, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x69, 0x3b,
-0x50, 0x65, 0x70, 0x65, 0x6c, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x6b, 0x69, 0x3b, 0x2bb, 0x41, 0x70,
-0x65, 0x6c, 0x69, 0x6c, 0x61, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x49, 0x75, 0x6e, 0x65, 0x3b, 0x49, 0x75, 0x6c, 0x61, 0x69,
-0x3b, 0x2bb, 0x41, 0x75, 0x6b, 0x61, 0x6b, 0x65, 0x3b, 0x4b, 0x65, 0x70, 0x61, 0x6b, 0x65, 0x6d, 0x61, 0x70, 0x61, 0x3b,
-0x2bb, 0x4f, 0x6b, 0x61, 0x6b, 0x6f, 0x70, 0x61, 0x3b, 0x4e, 0x6f, 0x77, 0x65, 0x6d, 0x61, 0x70, 0x61, 0x3b, 0x4b, 0x65,
-0x6b, 0x65, 0x6d, 0x61, 0x70, 0x61, 0x3b, 0x45, 0x6e, 0x65, 0x3b, 0x50, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41,
-0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x48, 0x75, 0x6e, 0x3b, 0x48, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53,
-0x65, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x62, 0x3b, 0x44, 0x69, 0x73, 0x3b, 0x45, 0x6e, 0x65, 0x72, 0x6f,
-0x3b, 0x50, 0x65, 0x62, 0x72, 0x65, 0x72, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c,
-0x3b, 0x4d, 0x61, 0x79, 0x6f, 0x3b, 0x48, 0x75, 0x6e, 0x79, 0x6f, 0x3b, 0x48, 0x75, 0x6c, 0x79, 0x6f, 0x3b, 0x41, 0x67,
-0x6f, 0x73, 0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x79, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x4f, 0x6b, 0x74, 0x75, 0x62,
-0x72, 0x65, 0x3b, 0x4e, 0x6f, 0x62, 0x79, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x44, 0x69, 0x73, 0x79, 0x65, 0x6d, 0x62,
-0x72, 0x65, 0x3b, 0x45, 0x3b, 0x50, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x48, 0x75, 0x6e, 0x3b, 0x48, 0x75, 0x6c,
-0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x62, 0x3b, 0x44, 0x69, 0x73,
-0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x72, 0x7a,
-0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69,
-0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x63, 0x68, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b,
-0x4f, 0x6b, 0x74, 0x6f, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65,
-0x7a, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0xa2cd, 0xa1aa, 0x3b, 0xa44d, 0xa1aa, 0x3b, 0xa315, 0xa1aa, 0x3b, 0xa1d6, 0xa1aa, 0x3b, 0xa26c,
-0xa1aa, 0x3b, 0xa0d8, 0xa1aa, 0x3b, 0xa3c3, 0xa1aa, 0x3b, 0xa246, 0xa1aa, 0x3b, 0xa22c, 0xa1aa, 0x3b, 0xa2b0, 0xa1aa, 0x3b, 0xa2b0, 0xa2aa, 0xa1aa,
-0x3b, 0xa2b0, 0xa44b, 0xa1aa, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b,
-0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41,
-0x75, 0x67, 0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44,
-0x65, 0x7a, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x61, 0x72,
-0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x69,
-0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x76, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b,
-0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x111, 0x111, 0x6a, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x3b, 0x6e,
-0x6a, 0x75, 0x6b, 0x3b, 0x63, 0x75, 0x6f, 0x3b, 0x6d, 0x69, 0x65, 0x73, 0x3b, 0x67, 0x65, 0x61, 0x73, 0x3b, 0x73, 0x75,
-0x6f, 0x69, 0x3b, 0x62, 0x6f, 0x72, 0x67, 0x3b, 0x10d, 0x61, 0x6b, 0x10d, 0x3b, 0x67, 0x6f, 0x6c, 0x67, 0x3b, 0x73, 0x6b,
-0xe1, 0x62, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x3b, 0x6f, 0x111, 0x111, 0x61, 0x6a, 0x61, 0x67, 0x65, 0x6d, 0xe1, 0x6e, 0x6e,
-0x75, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x76, 0x61, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x6e, 0x6a, 0x75, 0x6b, 0x10d, 0x61,
-0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x63, 0x75, 0x6f, 0x14b, 0x6f, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x6d, 0x69, 0x65,
-0x73, 0x73, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x67, 0x65, 0x61, 0x73, 0x73, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75,
-0x3b, 0x73, 0x75, 0x6f, 0x69, 0x64, 0x6e, 0x65, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x62, 0x6f, 0x72, 0x67, 0x65, 0x6d,
-0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x10d, 0x61, 0x6b, 0x10d, 0x61, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x67, 0x6f, 0x6c, 0x67,
-0x67, 0x6f, 0x74, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x73, 0x6b, 0xe1, 0x62, 0x6d, 0x61, 0x6d, 0xe1, 0x6e, 0x6e, 0x75,
-0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x6c, 0x61, 0x6d, 0xe1, 0x6e, 0x6e, 0x75, 0x3b, 0x4f, 0x3b, 0x47, 0x3b, 0x4e, 0x3b, 0x43,
-0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x10c, 0x3b, 0x47, 0x3b, 0x53, 0x3b, 0x4a, 0x3b, 0x6f, 0x111, 0x111,
-0x6a, 0x3b, 0x67, 0x75, 0x6f, 0x76, 0x3b, 0x6e, 0x6a, 0x75, 0x6b, 0x3b, 0x63, 0x75, 0x6f, 0x14b, 0x3b, 0x6d, 0x69, 0x65,
-0x73, 0x3b, 0x67, 0x65, 0x61, 0x73, 0x3b, 0x73, 0x75, 0x6f, 0x69, 0x3b, 0x62, 0x6f, 0x72, 0x67, 0x3b, 0x10d, 0x61, 0x6b,
-0x10d, 0x3b, 0x67, 0x6f, 0x6c, 0x67, 0x3b, 0x73, 0x6b, 0xe1, 0x62, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x3b, 0x43, 0x61, 0x6e,
-0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e,
-0x3b, 0x43, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x62,
-0x3b, 0x44, 0x69, 0x73, 0x3b, 0x43, 0x68, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x75, 0x72, 0x61,
-0x72, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70, 0x69, 0x72, 0x69, 0x72, 0x69, 0x3b, 0x4d, 0x65, 0x69,
-0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x43, 0x68, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x69, 0x3b,
-0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x69, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x62,
-0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x43, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41,
-0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x43, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x49, 0x6d, 0x62,
-0x3b, 0x4b, 0x61, 0x77, 0x3b, 0x4b, 0x61, 0x64, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x4b, 0x61, 0x72,
-0x3b, 0x4d, 0x66, 0x75, 0x3b, 0x57, 0x75, 0x6e, 0x3b, 0x49, 0x6b, 0x65, 0x3b, 0x49, 0x6b, 0x75, 0x3b, 0x49, 0x6d, 0x77,
-0x3b, 0x49, 0x77, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x69, 0x6d, 0x62, 0x69, 0x72,
-0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x77, 0x69, 0x3b, 0x4d, 0x6f, 0x72,
-0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x64, 0x61, 0x64, 0x75, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67,
-0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b,
-0x61, 0x73, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x72, 0x61,
-0x6e, 0x64, 0x61, 0x64, 0x75, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x6d, 0x66, 0x75, 0x6e,
-0x67, 0x61, 0x64, 0x65, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x77, 0x75, 0x6e, 0x79, 0x61,
-0x6e, 0x79, 0x61, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x65, 0x6e, 0x64, 0x61,
-0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x6f, 0x72,
-0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x69, 0x6d, 0x77, 0x65,
-0x72, 0x69, 0x3b, 0x4d, 0x6f, 0x72, 0x69, 0x20, 0x67, 0x68, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e,
-0x61, 0x20, 0x69, 0x77, 0x69, 0x3b, 0x49, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b,
-0x57, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x73, 0x69, 0x69, 0x3b, 0x63, 0x6f, 0x6c, 0x3b, 0x6d, 0x62,
-0x6f, 0x3b, 0x73, 0x65, 0x65, 0x3b, 0x64, 0x75, 0x75, 0x3b, 0x6b, 0x6f, 0x72, 0x3b, 0x6d, 0x6f, 0x72, 0x3b, 0x6a, 0x75,
-0x6b, 0x3b, 0x73, 0x6c, 0x74, 0x3b, 0x79, 0x61, 0x72, 0x3b, 0x6a, 0x6f, 0x6c, 0x3b, 0x62, 0x6f, 0x77, 0x3b, 0x73, 0x69,
-0x69, 0x6c, 0x6f, 0x3b, 0x63, 0x6f, 0x6c, 0x74, 0x65, 0x3b, 0x6d, 0x62, 0x6f, 0x6f, 0x79, 0x3b, 0x73, 0x65, 0x65, 0x257,
-0x74, 0x6f, 0x3b, 0x64, 0x75, 0x75, 0x6a, 0x61, 0x6c, 0x3b, 0x6b, 0x6f, 0x72, 0x73, 0x65, 0x3b, 0x6d, 0x6f, 0x72, 0x73,
-0x6f, 0x3b, 0x6a, 0x75, 0x6b, 0x6f, 0x3b, 0x73, 0x69, 0x69, 0x6c, 0x74, 0x6f, 0x3b, 0x79, 0x61, 0x72, 0x6b, 0x6f, 0x6d,
-0x61, 0x61, 0x3b, 0x6a, 0x6f, 0x6c, 0x61, 0x6c, 0x3b, 0x62, 0x6f, 0x77, 0x74, 0x65, 0x3b, 0x73, 0x3b, 0x63, 0x3b, 0x6d,
-0x3b, 0x73, 0x3b, 0x64, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x73, 0x3b, 0x79, 0x3b, 0x6a, 0x3b, 0x62, 0x3b, 0x4a,
-0x45, 0x4e, 0x3b, 0x57, 0x4b, 0x52, 0x3b, 0x57, 0x47, 0x54, 0x3b, 0x57, 0x4b, 0x4e, 0x3b, 0x57, 0x54, 0x4e, 0x3b, 0x57,
-0x54, 0x44, 0x3b, 0x57, 0x4d, 0x4a, 0x3b, 0x57, 0x4e, 0x4e, 0x3b, 0x57, 0x4b, 0x44, 0x3b, 0x57, 0x49, 0x4b, 0x3b, 0x57,
-0x4d, 0x57, 0x3b, 0x44, 0x49, 0x54, 0x3b, 0x4e, 0x6a, 0x65, 0x6e, 0x75, 0x61, 0x72, 0x129, 0x3b, 0x4d, 0x77, 0x65, 0x72,
-0x65, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65, 0x72, 0x129, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x67,
-0x61, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b,
-0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x72,
-0x65, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65,
-0x20, 0x77, 0x61, 0x20, 0x6d, 0x169, 0x67, 0x77, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77,
-0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x65,
-0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x3b, 0x4d,
-0x77, 0x65, 0x72, 0x65, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x169, 0x6d, 0x77,
-0x65, 0x3b, 0x4e, 0x64, 0x69, 0x74, 0x68, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x4b, 0x3b,
-0x47, 0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x44, 0x3b, 0x4f, 0x62, 0x6f, 0x3b,
-0x57, 0x61, 0x61, 0x3b, 0x4f, 0x6b, 0x75, 0x3b, 0x4f, 0x6e, 0x67, 0x3b, 0x49, 0x6d, 0x65, 0x3b, 0x49, 0x6c, 0x65, 0x3b,
-0x53, 0x61, 0x70, 0x3b, 0x49, 0x73, 0x69, 0x3b, 0x53, 0x61, 0x61, 0x3b, 0x54, 0x6f, 0x6d, 0x3b, 0x54, 0x6f, 0x62, 0x3b,
-0x54, 0x6f, 0x77, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x6f, 0x62, 0x6f, 0x3b, 0x4c, 0x61, 0x70, 0x61,
-0x20, 0x6c, 0x65, 0x20, 0x77, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x6f, 0x6b,
-0x75, 0x6e, 0x69, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x6f, 0x6e, 0x67, 0x2019, 0x77, 0x61, 0x6e, 0x3b,
-0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x69, 0x6d, 0x65, 0x74, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65,
-0x20, 0x69, 0x6c, 0x65, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x73, 0x61, 0x70, 0x61, 0x3b, 0x4c, 0x61,
-0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x69, 0x65, 0x74, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20,
-0x73, 0x61, 0x61, 0x6c, 0x3b, 0x4c, 0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x3b, 0x4c,
-0x61, 0x70, 0x61, 0x20, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6f, 0x3b, 0x4c, 0x61, 0x70,
-0x61, 0x20, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x77, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x4f, 0x3b, 0x57,
-0x3b, 0x4f, 0x3b, 0x4f, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x54,
-0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x76, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x69,
-0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75, 0x67, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x74, 0x75,
-0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x63, 0x3b, 0x4a, 0x61, 0x6e, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x46, 0x65, 0x76,
-0x72, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x4d, 0x61, 0x72, 0x63, 0x6f, 0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61,
-0x69, 0x6f, 0x3b, 0x4a, 0x75, 0x6e, 0x68, 0x6f, 0x3b, 0x4a, 0x75, 0x6c, 0x68, 0x6f, 0x3b, 0x41, 0x75, 0x67, 0x75, 0x73,
-0x74, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x4f, 0x74, 0x75, 0x62, 0x72, 0x6f, 0x3b, 0x4e,
-0x6f, 0x76, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x6f, 0x3b, 0x5a, 0x69, 0x62,
-0x3b, 0x4e, 0x68, 0x6c, 0x6f, 0x3b, 0x4d, 0x62, 0x69, 0x3b, 0x4d, 0x61, 0x62, 0x3b, 0x4e, 0x6b, 0x77, 0x3b, 0x4e, 0x68,
-0x6c, 0x61, 0x3b, 0x4e, 0x74, 0x75, 0x3b, 0x4e, 0x63, 0x77, 0x3b, 0x4d, 0x70, 0x61, 0x6e, 0x3b, 0x4d, 0x66, 0x75, 0x3b,
-0x4c, 0x77, 0x65, 0x3b, 0x4d, 0x70, 0x61, 0x6c, 0x3b, 0x5a, 0x69, 0x62, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x6c, 0x61, 0x3b,
-0x4e, 0x68, 0x6c, 0x6f, 0x6c, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x4d, 0x62, 0x69, 0x6d, 0x62, 0x69, 0x74, 0x68, 0x6f, 0x3b,
-0x4d, 0x61, 0x62, 0x61, 0x73, 0x61, 0x3b, 0x4e, 0x6b, 0x77, 0x65, 0x6e, 0x6b, 0x77, 0x65, 0x7a, 0x69, 0x3b, 0x4e, 0x68,
-0x6c, 0x61, 0x6e, 0x67, 0x75, 0x6c, 0x61, 0x3b, 0x4e, 0x74, 0x75, 0x6c, 0x69, 0x6b, 0x61, 0x7a, 0x69, 0x3b, 0x4e, 0x63,
-0x77, 0x61, 0x62, 0x61, 0x6b, 0x61, 0x7a, 0x69, 0x3b, 0x4d, 0x70, 0x61, 0x6e, 0x64, 0x75, 0x6c, 0x61, 0x3b, 0x4d, 0x66,
-0x75, 0x6d, 0x66, 0x75, 0x3b, 0x4c, 0x77, 0x65, 0x7a, 0x69, 0x3b, 0x4d, 0x70, 0x61, 0x6c, 0x61, 0x6b, 0x61, 0x7a, 0x69,
-0x3b, 0x5a, 0x3b, 0x4e, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4d, 0x3b, 0x4d,
-0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x31, 0x3b, 0x4d, 0x32, 0x3b, 0x4d, 0x33, 0x3b, 0x4d, 0x34, 0x3b, 0x4d, 0x35, 0x3b,
-0x4d, 0x36, 0x3b, 0x4d, 0x37, 0x3b, 0x4d, 0x38, 0x3b, 0x4d, 0x39, 0x3b, 0x4d, 0x31, 0x30, 0x3b, 0x4d, 0x31, 0x31, 0x3b,
-0x4d, 0x31, 0x32, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x3b,
-0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69,
-0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20,
-0x6b, 0x61, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x74, 0x61, 0x6e, 0x75, 0x3b,
-0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x73, 0x69, 0x74, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20,
-0x77, 0x61, 0x20, 0x73, 0x61, 0x62, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6e, 0x61, 0x6e,
-0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x74, 0x69, 0x73, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72,
-0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20,
-0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20,
-0x77, 0x61, 0x20, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x4b, 0x3b,
-0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x49, 0x3b, 0x49, 0x3b,
-0x49, 0x3b, 0x2d49, 0x2d4f, 0x2d4f, 0x3b, 0x2d31, 0x2d55, 0x2d30, 0x3b, 0x2d4e, 0x2d30, 0x2d55, 0x3b, 0x2d49, 0x2d31, 0x2d54, 0x3b, 0x2d4e, 0x2d30,
-0x2d62, 0x3b, 0x2d62, 0x2d53, 0x2d4f, 0x3b, 0x2d62, 0x2d53, 0x2d4d, 0x3b, 0x2d56, 0x2d53, 0x2d5b, 0x3b, 0x2d5b, 0x2d53, 0x2d5c, 0x3b, 0x2d3d, 0x2d5c,
-0x2d53, 0x3b, 0x2d4f, 0x2d53, 0x2d61, 0x3b, 0x2d37, 0x2d53, 0x2d4a, 0x3b, 0x2d49, 0x2d4f, 0x2d4f, 0x2d30, 0x2d62, 0x2d54, 0x3b, 0x2d31, 0x2d55, 0x2d30,
-0x2d62, 0x2d55, 0x3b, 0x2d4e, 0x2d30, 0x2d55, 0x2d5a, 0x3b, 0x2d49, 0x2d31, 0x2d54, 0x2d49, 0x2d54, 0x3b, 0x2d4e, 0x2d30, 0x2d62, 0x2d62, 0x2d53, 0x3b,
-0x2d62, 0x2d53, 0x2d4f, 0x2d62, 0x2d53, 0x3b, 0x2d62, 0x2d53, 0x2d4d, 0x2d62, 0x2d53, 0x2d63, 0x3b, 0x2d56, 0x2d53, 0x2d5b, 0x2d5c, 0x3b, 0x2d5b, 0x2d53,
-0x2d5c, 0x2d30, 0x2d4f, 0x2d31, 0x2d49, 0x2d54, 0x3b, 0x2d3d, 0x2d5c, 0x2d53, 0x2d31, 0x2d54, 0x3b, 0x2d4f, 0x2d53, 0x2d61, 0x2d30, 0x2d4f, 0x2d31, 0x2d49,
-0x2d54, 0x3b, 0x2d37, 0x2d53, 0x2d4a, 0x2d30, 0x2d4f, 0x2d31, 0x2d49, 0x2d54, 0x3b, 0x2d49, 0x3b, 0x2d31, 0x3b, 0x2d4e, 0x3b, 0x2d49, 0x3b, 0x2d4e,
-0x3b, 0x2d62, 0x3b, 0x2d62, 0x3b, 0x2d56, 0x3b, 0x2d5b, 0x3b, 0x2d3d, 0x3b, 0x2d4f, 0x3b, 0x2d37, 0x3b, 0x69, 0x6e, 0x6e, 0x3b, 0x62,
-0x1e5b, 0x61, 0x3b, 0x6d, 0x61, 0x1e5b, 0x3b, 0x69, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x79, 0x75, 0x6e, 0x3b, 0x79,
-0x75, 0x6c, 0x3b, 0x263, 0x75, 0x63, 0x3b, 0x63, 0x75, 0x74, 0x3b, 0x6b, 0x74, 0x75, 0x3b, 0x6e, 0x75, 0x77, 0x3b, 0x64,
-0x75, 0x6a, 0x3b, 0x69, 0x6e, 0x6e, 0x61, 0x79, 0x72, 0x3b, 0x62, 0x1e5b, 0x61, 0x79, 0x1e5b, 0x3b, 0x6d, 0x61, 0x1e5b, 0x1e63,
-0x3b, 0x69, 0x62, 0x72, 0x69, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x79, 0x75, 0x3b, 0x79, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x79,
-0x75, 0x6c, 0x79, 0x75, 0x7a, 0x3b, 0x263, 0x75, 0x63, 0x74, 0x3b, 0x63, 0x75, 0x74, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b,
-0x6b, 0x74, 0x75, 0x62, 0x72, 0x3b, 0x6e, 0x75, 0x77, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x64, 0x75, 0x6a, 0x61, 0x6e,
-0x62, 0x69, 0x72, 0x3b, 0x69, 0x3b, 0x62, 0x3b, 0x6d, 0x3b, 0x69, 0x3b, 0x6d, 0x3b, 0x79, 0x3b, 0x79, 0x3b, 0x263, 0x3b,
-0x63, 0x3b, 0x6b, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x59, 0x65, 0x6e, 0x3b, 0x46, 0x75, 0x72, 0x3b, 0x4d, 0x65, 0x263, 0x3b,
-0x59, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e, 0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x194, 0x75, 0x63, 0x3b,
-0x43, 0x74, 0x65, 0x3b, 0x54, 0x75, 0x62, 0x3b, 0x57, 0x61, 0x6d, 0x3b, 0x44, 0x75, 0x6a, 0x3b, 0x59, 0x65, 0x6e, 0x6e,
-0x61, 0x79, 0x65, 0x72, 0x3b, 0x46, 0x75, 0x1e5b, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x263, 0x72, 0x65, 0x73, 0x3b, 0x59, 0x65,
-0x62, 0x72, 0x69, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6c,
-0x79, 0x75, 0x3b, 0x194, 0x75, 0x63, 0x74, 0x3b, 0x43, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x54, 0x75, 0x62, 0x65,
-0x1e5b, 0x3b, 0x57, 0x61, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x44, 0x75, 0x1e7, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x59, 0x3b,
-0x46, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x194, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x4e, 0x3b,
-0x44, 0x3b, 0x59, 0x65, 0x6e, 0x3b, 0x46, 0x75, 0x72, 0x3b, 0x4d, 0x65, 0x263, 0x3b, 0x59, 0x65, 0x62, 0x3b, 0x4d, 0x61,
-0x79, 0x3b, 0x59, 0x75, 0x6e, 0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x194, 0x75, 0x63, 0x3b, 0x43, 0x74, 0x65, 0x3b, 0x54, 0x75,
-0x62, 0x3b, 0x4e, 0x75, 0x6e, 0x3b, 0x44, 0x75, 0x1e7, 0x3b, 0x59, 0x65, 0x6e, 0x6e, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x46,
-0x75, 0x1e5b, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x263, 0x72, 0x65, 0x73, 0x3b, 0x59, 0x65, 0x62, 0x72, 0x69, 0x72, 0x3b, 0x4d,
-0x61, 0x79, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6c, 0x79, 0x75, 0x3b, 0x194, 0x75, 0x63,
-0x74, 0x3b, 0x43, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x54, 0x75, 0x62, 0x65, 0x1e5b, 0x3b, 0x4e, 0x75, 0x6e, 0x65,
-0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x44, 0x75, 0x1e7, 0x65, 0x6d, 0x62, 0x65, 0x1e5b, 0x3b, 0x59, 0x3b, 0x46, 0x3b, 0x194, 0x3b,
-0x42, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4c, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x52, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x4b, 0x42,
-0x5a, 0x3b, 0x4b, 0x42, 0x52, 0x3b, 0x4b, 0x53, 0x54, 0x3b, 0x4b, 0x4b, 0x4e, 0x3b, 0x4b, 0x54, 0x4e, 0x3b, 0x4b, 0x4d,
-0x4b, 0x3b, 0x4b, 0x4d, 0x53, 0x3b, 0x4b, 0x4d, 0x4e, 0x3b, 0x4b, 0x4d, 0x57, 0x3b, 0x4b, 0x4b, 0x4d, 0x3b, 0x4b, 0x4e,
-0x4b, 0x3b, 0x4b, 0x4e, 0x42, 0x3b, 0x4f, 0x6b, 0x77, 0x6f, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x4f, 0x6b,
-0x77, 0x61, 0x6b, 0x61, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6b, 0x61, 0x73, 0x68, 0x61, 0x74, 0x75,
-0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6b, 0x61, 0x74, 0x61, 0x61, 0x6e,
-0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x75,
-0x73, 0x68, 0x61, 0x6e, 0x6a, 0x75, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x75, 0x6e, 0x61, 0x61, 0x6e, 0x61, 0x3b, 0x4f,
-0x6b, 0x77, 0x61, 0x6d, 0x77, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b,
-0x4f, 0x6b, 0x77, 0x61, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6b, 0x75, 0x6d, 0x77, 0x65, 0x3b, 0x4f,
-0x6b, 0x77, 0x61, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x69, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x48, 0x75,
-0x74, 0x3b, 0x56, 0x69, 0x6c, 0x3b, 0x44, 0x61, 0x74, 0x3b, 0x54, 0x61, 0x69, 0x3b, 0x48, 0x61, 0x6e, 0x3b, 0x53, 0x69,
-0x74, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4e, 0x61, 0x6e, 0x3b, 0x54, 0x69, 0x73, 0x3b, 0x4b, 0x75, 0x6d, 0x3b, 0x4b, 0x6d,
-0x6a, 0x3b, 0x4b, 0x6d, 0x62, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20,
-0x68, 0x75, 0x74, 0x61, 0x6c, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61,
-0x20, 0x77, 0x75, 0x76, 0x69, 0x6c, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77,
-0x61, 0x20, 0x77, 0x75, 0x64, 0x61, 0x74, 0x75, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67,
-0x77, 0x61, 0x20, 0x77, 0x75, 0x74, 0x61, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67,
-0x77, 0x61, 0x20, 0x77, 0x75, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20,
-0x67, 0x77, 0x61, 0x20, 0x73, 0x69, 0x74, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67,
-0x77, 0x61, 0x20, 0x73, 0x61, 0x62, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77,
-0x61, 0x20, 0x6e, 0x61, 0x6e, 0x65, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61,
-0x20, 0x74, 0x69, 0x73, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20,
-0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a, 0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x6b,
-0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x6a, 0x61, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x77, 0x65, 0x64, 0x7a,
-0x69, 0x20, 0x67, 0x77, 0x61, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x62, 0x69, 0x6c, 0x69, 0x3b,
-0x48, 0x3b, 0x56, 0x3b, 0x44, 0x3b, 0x54, 0x3b, 0x48, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4b, 0x3b,
-0x4b, 0x3b, 0x4b, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x69,
-0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x79, 0x69, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a,
-0x75, 0x6e, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x79, 0x61, 0x69, 0x3b, 0x41, 0x67, 0x75, 0x73, 0x74, 0x69, 0x3b, 0x53,
-0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d,
-0x62, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x7a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d,
-0x61, 0x72, 0x3b, 0x61, 0x77, 0x69, 0x3b, 0x6d, 0x25b, 0x3b, 0x7a, 0x75, 0x77, 0x3b, 0x7a, 0x75, 0x6c, 0x3b, 0x75, 0x74,
-0x69, 0x3b, 0x73, 0x25b, 0x74, 0x3b, 0x254, 0x6b, 0x75, 0x3b, 0x6e, 0x6f, 0x77, 0x3b, 0x64, 0x65, 0x73, 0x3b, 0x7a, 0x61,
-0x6e, 0x77, 0x75, 0x79, 0x65, 0x3b, 0x66, 0x65, 0x62, 0x75, 0x72, 0x75, 0x79, 0x65, 0x3b, 0x6d, 0x61, 0x72, 0x69, 0x73,
-0x69, 0x3b, 0x61, 0x77, 0x69, 0x72, 0x69, 0x6c, 0x69, 0x3b, 0x6d, 0x25b, 0x3b, 0x7a, 0x75, 0x77, 0x25b, 0x6e, 0x3b, 0x7a,
-0x75, 0x6c, 0x75, 0x79, 0x65, 0x3b, 0x75, 0x74, 0x69, 0x3b, 0x73, 0x25b, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x75, 0x3b,
-0x254, 0x6b, 0x75, 0x74, 0x254, 0x62, 0x75, 0x72, 0x75, 0x3b, 0x6e, 0x6f, 0x77, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x75, 0x3b,
-0x64, 0x65, 0x73, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x75, 0x3b, 0x5a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b,
-0x5a, 0x3b, 0x5a, 0x3b, 0x55, 0x3b, 0x53, 0x3b, 0x186, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4d, 0x62, 0x65, 0x3b, 0x4b, 0x61,
-0x69, 0x3b, 0x4b, 0x61, 0x74, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x47, 0x61, 0x74, 0x3b, 0x47, 0x61, 0x6e, 0x3b, 0x4d, 0x75,
-0x67, 0x3b, 0x4b, 0x6e, 0x6e, 0x3b, 0x4b, 0x65, 0x6e, 0x3b, 0x49, 0x6b, 0x75, 0x3b, 0x49, 0x6d, 0x77, 0x3b, 0x49, 0x67,
-0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x62, 0x65, 0x72, 0x65, 0x3b, 0x4d, 0x77, 0x65,
-0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x129, 0x72, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61,
-0x20, 0x6b, 0x61, 0x74, 0x68, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61,
-0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4d,
-0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x74, 0x61, 0x74, 0x169, 0x3b, 0x4d, 0x77,
-0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x6d, 0x169, 0x67, 0x77, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72,
-0x69, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x6e, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61,
-0x20, 0x6b, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d,
-0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x20, 0x6e, 0x61, 0x20,
-0x169, 0x6d, 0x77, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x61, 0x20, 0x69, 0x6b, 0x169, 0x6d, 0x69, 0x20,
-0x6e, 0x61, 0x20, 0x4b, 0x61, 0x129, 0x72, 0x129, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x47, 0x3b, 0x47,
-0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x13a4, 0x13c3, 0x3b, 0x13a7, 0x13a6, 0x3b, 0x13a0,
-0x13c5, 0x3b, 0x13a7, 0x13ec, 0x3b, 0x13a0, 0x13c2, 0x3b, 0x13d5, 0x13ad, 0x3b, 0x13ab, 0x13f0, 0x3b, 0x13a6, 0x13b6, 0x3b, 0x13da, 0x13b5, 0x3b,
-0x13da, 0x13c2, 0x3b, 0x13c5, 0x13d3, 0x3b, 0x13a5, 0x13cd, 0x3b, 0x13a4, 0x13c3, 0x13b8, 0x13d4, 0x13c5, 0x3b, 0x13a7, 0x13a6, 0x13b5, 0x3b, 0x13a0,
-0x13c5, 0x13f1, 0x3b, 0x13a7, 0x13ec, 0x13c2, 0x3b, 0x13a0, 0x13c2, 0x13cd, 0x13ac, 0x13d8, 0x3b, 0x13d5, 0x13ad, 0x13b7, 0x13f1, 0x3b, 0x13ab, 0x13f0,
-0x13c9, 0x13c2, 0x3b, 0x13a6, 0x13b6, 0x13c2, 0x3b, 0x13da, 0x13b5, 0x13cd, 0x13d7, 0x3b, 0x13da, 0x13c2, 0x13c5, 0x13d7, 0x3b, 0x13c5, 0x13d3, 0x13d5,
-0x13c6, 0x3b, 0x13a5, 0x13cd, 0x13a9, 0x13f1, 0x3b, 0x13a4, 0x3b, 0x13a7, 0x3b, 0x13a0, 0x3b, 0x13a7, 0x3b, 0x13a0, 0x3b, 0x13d5, 0x3b, 0x13ab,
-0x3b, 0x13a6, 0x3b, 0x13da, 0x3b, 0x13da, 0x3b, 0x13c5, 0x3b, 0x13a5, 0x3b, 0x7a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x76, 0x3b, 0x6d,
-0x61, 0x72, 0x3b, 0x61, 0x76, 0x72, 0x3b, 0x6d, 0x65, 0x3b, 0x7a, 0x69, 0x6e, 0x3b, 0x7a, 0x69, 0x6c, 0x3b, 0x6f, 0x75,
-0x74, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x76, 0x3b, 0x64, 0x65, 0x73, 0x3b, 0x7a, 0x61,
-0x6e, 0x76, 0x69, 0x65, 0x3b, 0x66, 0x65, 0x76, 0x72, 0x69, 0x79, 0x65, 0x3b, 0x6d, 0x61, 0x72, 0x73, 0x3b, 0x61, 0x76,
-0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x65, 0x3b, 0x7a, 0x69, 0x6e, 0x3b, 0x7a, 0x69, 0x6c, 0x79, 0x65, 0x3b, 0x6f, 0x75, 0x74,
-0x3b, 0x73, 0x65, 0x70, 0x74, 0x61, 0x6d, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x3b, 0x6e, 0x6f, 0x76, 0x61, 0x6d, 0x3b,
-0x64, 0x65, 0x73, 0x61, 0x6d, 0x3b, 0x7a, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x7a, 0x3b, 0x7a, 0x3b,
-0x6f, 0x3b, 0x73, 0x3b, 0x6f, 0x3b, 0x6e, 0x3b, 0x64, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x4e, 0x74, 0x61, 0x6e,
-0x64, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x77, 0x65,
-0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x54, 0x61, 0x74, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20,
-0x4e, 0x63, 0x68, 0x65, 0x63, 0x68, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79,
-0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20,
-0x6e, 0x61, 0x20, 0x55, 0x6d, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61,
-0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4d, 0x69, 0x76, 0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77,
-0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4d, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4d,
-0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x63,
-0x68, 0x65, 0x63, 0x68, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e,
-0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61,
-0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61,
-0x20, 0x55, 0x3b, 0x4d, 0x77, 0x65, 0x64, 0x69, 0x20, 0x77, 0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e,
-0x61, 0x20, 0x4e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x4d, 0x3b, 0x46, 0xfa, 0x6e, 0x67, 0x61, 0x74,
-0x268, 0x3b, 0x4e, 0x61, 0x61, 0x6e, 0x268, 0x3b, 0x4b, 0x65, 0x65, 0x6e, 0x64, 0x61, 0x3b, 0x49, 0x6b, 0xfa, 0x6d, 0x69,
-0x3b, 0x49, 0x6e, 0x79, 0x61, 0x6d, 0x62, 0x61, 0x6c, 0x61, 0x3b, 0x49, 0x64, 0x77, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x4d,
-0x289, 0x289, 0x6e, 0x63, 0x68, 0x268, 0x3b, 0x56, 0x268, 0x268, 0x72, 0x268, 0x3b, 0x53, 0x61, 0x61, 0x74, 0x289, 0x3b, 0x49,
-0x6e, 0x79, 0x69, 0x3b, 0x53, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0x53, 0x61, 0x73, 0x61, 0x74, 0x289, 0x3b, 0x4b, 0x289, 0x66,
-0xfa, 0x6e, 0x67, 0x61, 0x74, 0x268, 0x3b, 0x4b, 0x289, 0x6e, 0x61, 0x61, 0x6e, 0x268, 0x3b, 0x4b, 0x289, 0x6b, 0x65, 0x65,
-0x6e, 0x64, 0x61, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x6e, 0x79, 0x61,
-0x6d, 0x62, 0xe1, 0x6c, 0x61, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x64, 0x77, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x4b, 0x289, 0x6d,
-0x289, 0x289, 0x6e, 0x63, 0x68, 0x268, 0x3b, 0x4b, 0x289, 0x76, 0x268, 0x268, 0x72, 0x268, 0x3b, 0x4b, 0x289, 0x73, 0x61, 0x61,
-0x74, 0x289, 0x3b, 0x4b, 0x77, 0x69, 0x69, 0x6e, 0x79, 0x69, 0x3b, 0x4b, 0x289, 0x73, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0x4b,
-0x289, 0x73, 0x61, 0x73, 0x61, 0x74, 0x289, 0x3b, 0x46, 0x3b, 0x4e, 0x3b, 0x4b, 0x3b, 0x49, 0x3b, 0x49, 0x3b, 0x49, 0x3b,
-0x4d, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b,
-0x4d, 0x61, 0x72, 0x3b, 0x41, 0x70, 0x75, 0x3b, 0x4d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x75, 0x3b, 0x4a, 0x75, 0x6c, 0x3b,
-0x41, 0x67, 0x75, 0x3b, 0x53, 0x65, 0x62, 0x3b, 0x4f, 0x6b, 0x69, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b,
-0x4a, 0x61, 0x6e, 0x77, 0x61, 0x6c, 0x69, 0x79, 0x6f, 0x3b, 0x46, 0x65, 0x62, 0x77, 0x61, 0x6c, 0x69, 0x79, 0x6f, 0x3b,
-0x4d, 0x61, 0x72, 0x69, 0x73, 0x69, 0x3b, 0x41, 0x70, 0x75, 0x6c, 0x69, 0x3b, 0x4d, 0x61, 0x61, 0x79, 0x69, 0x3b, 0x4a,
-0x75, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x61, 0x79, 0x69, 0x3b, 0x41, 0x67, 0x75, 0x73, 0x69, 0x74, 0x6f,
-0x3b, 0x53, 0x65, 0x62, 0x75, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x69, 0x74, 0x6f, 0x62, 0x62, 0x61,
-0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x61, 0x6e,
-0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x45, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e,
-0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x4f, 0x67, 0x61, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76,
-0x3b, 0x44, 0x69, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72,
-0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x45, 0x70, 0x72, 0x65, 0x6f, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75,
-0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x4f, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74,
-0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b,
-0x44, 0x69, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b,
-0x4a, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b,
-0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b,
-0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f, 0x74, 0x75, 0x3b, 0x4e, 0x75, 0x76, 0x3b, 0x44, 0x69, 0x7a, 0x3b,
-0x4a, 0x61, 0x6e, 0x65, 0x72, 0x75, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x65, 0x72, 0x75, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x75,
-0x3b, 0x41, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x61, 0x69, 0x75, 0x3b, 0x4a, 0x75, 0x6e, 0x68, 0x75, 0x3b, 0x4a, 0x75,
-0x6c, 0x68, 0x75, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x75, 0x3b, 0x53, 0x65, 0x74, 0x65, 0x6e, 0x62, 0x72, 0x75, 0x3b,
-0x4f, 0x74, 0x75, 0x62, 0x72, 0x75, 0x3b, 0x4e, 0x75, 0x76, 0x65, 0x6e, 0x62, 0x72, 0x75, 0x3b, 0x44, 0x69, 0x7a, 0x65,
-0x6e, 0x62, 0x72, 0x75, 0x3b, 0x4a, 0x41, 0x4e, 0x3b, 0x46, 0x45, 0x42, 0x3b, 0x4d, 0x41, 0x43, 0x3b, 0x128, 0x50, 0x55,
-0x3b, 0x4d, 0x128, 0x128, 0x3b, 0x4e, 0x4a, 0x55, 0x3b, 0x4e, 0x4a, 0x52, 0x3b, 0x41, 0x47, 0x41, 0x3b, 0x53, 0x50, 0x54,
-0x3b, 0x4f, 0x4b, 0x54, 0x3b, 0x4e, 0x4f, 0x56, 0x3b, 0x44, 0x45, 0x43, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x129,
-0x3b, 0x46, 0x65, 0x62, 0x75, 0x72, 0x75, 0x61, 0x72, 0x129, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x128, 0x70, 0x75,
-0x72, 0x169, 0x3b, 0x4d, 0x129, 0x129, 0x3b, 0x4e, 0x6a, 0x75, 0x6e, 0x69, 0x3b, 0x4e, 0x6a, 0x75, 0x72, 0x61, 0x129, 0x3b,
-0x41, 0x67, 0x61, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x169,
-0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x44, 0x69, 0x63, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4a,
-0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x128, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e,
-0x3b, 0x44, 0x3b, 0x4d, 0x75, 0x6c, 0x3b, 0x4e, 0x67, 0x61, 0x74, 0x3b, 0x54, 0x61, 0x61, 0x3b, 0x49, 0x77, 0x6f, 0x3b,
-0x4d, 0x61, 0x6d, 0x3b, 0x50, 0x61, 0x61, 0x3b, 0x4e, 0x67, 0x65, 0x3b, 0x52, 0x6f, 0x6f, 0x3b, 0x42, 0x75, 0x72, 0x3b,
-0x45, 0x70, 0x65, 0x3b, 0x4b, 0x70, 0x74, 0x3b, 0x4b, 0x70, 0x61, 0x3b, 0x4d, 0x75, 0x6c, 0x67, 0x75, 0x6c, 0x3b, 0x4e,
-0x67, 0x2019, 0x61, 0x74, 0x79, 0x61, 0x61, 0x74, 0x6f, 0x3b, 0x4b, 0x69, 0x70, 0x74, 0x61, 0x61, 0x6d, 0x6f, 0x3b, 0x49,
-0x77, 0x6f, 0x6f, 0x74, 0x6b, 0x75, 0x75, 0x74, 0x3b, 0x4d, 0x61, 0x6d, 0x75, 0x75, 0x74, 0x3b, 0x50, 0x61, 0x61, 0x67,
-0x69, 0x3b, 0x4e, 0x67, 0x2019, 0x65, 0x69, 0x79, 0x65, 0x65, 0x74, 0x3b, 0x52, 0x6f, 0x6f, 0x70, 0x74, 0x75, 0x69, 0x3b,
-0x42, 0x75, 0x72, 0x65, 0x65, 0x74, 0x3b, 0x45, 0x70, 0x65, 0x65, 0x73, 0x6f, 0x3b, 0x4b, 0x69, 0x70, 0x73, 0x75, 0x75,
-0x6e, 0x64, 0x65, 0x20, 0x6e, 0x65, 0x20, 0x74, 0x61, 0x61, 0x69, 0x3b, 0x4b, 0x69, 0x70, 0x73, 0x75, 0x75, 0x6e, 0x64,
-0x65, 0x20, 0x6e, 0x65, 0x62, 0x6f, 0x20, 0x61, 0x65, 0x6e, 0x67, 0x2019, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x49,
-0x3b, 0x4d, 0x3b, 0x50, 0x3b, 0x4e, 0x3b, 0x52, 0x3b, 0x42, 0x3b, 0x45, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x1c3, 0x4b, 0x68,
-0x61, 0x6e, 0x6e, 0x69, 0x3b, 0x1c3, 0x4b, 0x68, 0x61, 0x6e, 0x1c0, 0x67, 0xf4, 0x61, 0x62, 0x3b, 0x1c0, 0x4b, 0x68, 0x75,
-0x75, 0x1c1, 0x6b, 0x68, 0xe2, 0x62, 0x3b, 0x1c3, 0x48, 0xf4, 0x61, 0x1c2, 0x6b, 0x68, 0x61, 0x69, 0x62, 0x3b, 0x1c3, 0x4b,
-0x68, 0x61, 0x69, 0x74, 0x73, 0xe2, 0x62, 0x3b, 0x47, 0x61, 0x6d, 0x61, 0x1c0, 0x61, 0x65, 0x62, 0x3b, 0x1c2, 0x4b, 0x68,
-0x6f, 0x65, 0x73, 0x61, 0x6f, 0x62, 0x3b, 0x41, 0x6f, 0x1c1, 0x6b, 0x68, 0x75, 0x75, 0x6d, 0xfb, 0x1c1, 0x6b, 0x68, 0xe2,
-0x62, 0x3b, 0x54, 0x61, 0x72, 0x61, 0x1c0, 0x6b, 0x68, 0x75, 0x75, 0x6d, 0xfb, 0x1c1, 0x6b, 0x68, 0xe2, 0x62, 0x3b, 0x1c2,
-0x4e, 0xfb, 0x1c1, 0x6e, 0xe2, 0x69, 0x73, 0x65, 0x62, 0x3b, 0x1c0, 0x48, 0x6f, 0x6f, 0x1c2, 0x67, 0x61, 0x65, 0x62, 0x3b,
-0x48, 0xf4, 0x61, 0x73, 0x6f, 0x72, 0x65, 0x1c1, 0x6b, 0x68, 0xe2, 0x62, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0xe4,
-0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x7a, 0x2e, 0x3b, 0x41, 0x70, 0x72, 0x2e, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x6e,
-0x2e, 0x3b, 0x4a, 0x75, 0x6c, 0x2e, 0x3b, 0x4f, 0x75, 0x6a, 0x2e, 0x3b, 0x53, 0xe4, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74,
-0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a, 0x2e, 0x3b, 0x4a, 0x61, 0x6e, 0x6e, 0x65, 0x77, 0x61, 0x3b,
-0x46, 0xe4, 0x62, 0x72, 0x6f, 0x77, 0x61, 0x3b, 0x4d, 0xe4, 0xe4, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x65, 0x6c, 0x6c, 0x3b,
-0x4d, 0x61, 0x69, 0x3b, 0x4a, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x75, 0x6c, 0x69, 0x3b, 0x4f, 0x75, 0x6a, 0x6f,
-0xdf, 0x3b, 0x53, 0x65, 0x70, 0x74, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x68, 0x62, 0x65, 0x72,
-0x3b, 0x4e, 0x6f, 0x76, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0xe4, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4a,
-0x61, 0x6e, 0x3b, 0x46, 0xe4, 0x62, 0x3b, 0x4d, 0xe4, 0x7a, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x61, 0x69, 0x3b, 0x4a,
-0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x4f, 0x75, 0x6a, 0x3b, 0x53, 0xe4, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e,
-0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x44, 0x61, 0x6c, 0x3b, 0x41, 0x72, 0xe1, 0x3b, 0x186, 0x25b, 0x6e, 0x3b, 0x44,
-0x6f, 0x79, 0x3b, 0x4c, 0xe9, 0x70, 0x3b, 0x52, 0x6f, 0x6b, 0x3b, 0x53, 0xe1, 0x73, 0x3b, 0x42, 0x254, 0x301, 0x72, 0x3b,
-0x4b, 0xfa, 0x73, 0x3b, 0x47, 0xed, 0x73, 0x3b, 0x53, 0x68, 0x289, 0x301, 0x3b, 0x4e, 0x74, 0x289, 0x301, 0x3b, 0x4f, 0x6c,
-0x61, 0x64, 0x61, 0x6c, 0x289, 0x301, 0x3b, 0x41, 0x72, 0xe1, 0x74, 0x3b, 0x186, 0x25b, 0x6e, 0x268, 0x301, 0x254, 0x268, 0x14b,
-0x254, 0x6b, 0x3b, 0x4f, 0x6c, 0x6f, 0x64, 0x6f, 0x79, 0xed, 0xf3, 0x72, 0xed, 0xea, 0x20, 0x69, 0x6e, 0x6b, 0xf3, 0x6b,
-0xfa, 0xe2, 0x3b, 0x4f, 0x6c, 0x6f, 0x69, 0x6c, 0xe9, 0x70, 0x16b, 0x6e, 0x79, 0x12b, 0x113, 0x20, 0x69, 0x6e, 0x6b, 0xf3,
-0x6b, 0xfa, 0xe2, 0x3b, 0x4b, 0xfa, 0x6a, 0xfa, 0x254, 0x72, 0x254, 0x6b, 0x3b, 0x4d, 0xf3, 0x72, 0x75, 0x73, 0xe1, 0x73,
-0x69, 0x6e, 0x3b, 0x186, 0x6c, 0x254, 0x301, 0x268, 0x301, 0x62, 0x254, 0x301, 0x72, 0xe1, 0x72, 0x25b, 0x3b, 0x4b, 0xfa, 0x73,
-0x68, 0xee, 0x6e, 0x3b, 0x4f, 0x6c, 0x67, 0xed, 0x73, 0x61, 0x6e, 0x3b, 0x50, 0x289, 0x73, 0x68, 0x289, 0x301, 0x6b, 0x61,
-0x3b, 0x4e, 0x74, 0x289, 0x301, 0x14b, 0x289, 0x301, 0x73, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61,
-0x72, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67,
-0x6f, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x73, 0x3b, 0x4a, 0x61,
-0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x63, 0x3b, 0x41, 0x70, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x4a, 0x75,
-0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f,
-0x76, 0x3b, 0x44, 0x65, 0x63, 0x3b, 0x52, 0x61, 0x72, 0x3b, 0x4d, 0x75, 0x6b, 0x3b, 0x4b, 0x77, 0x61, 0x3b, 0x44, 0x75,
-0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x6f, 0x64, 0x3b, 0x4a, 0x6f, 0x6c, 0x3b, 0x50, 0x65, 0x64, 0x3b, 0x53, 0x6f,
-0x6b, 0x3b, 0x54, 0x69, 0x62, 0x3b, 0x4c, 0x61, 0x62, 0x3b, 0x50, 0x6f, 0x6f, 0x3b, 0x4f, 0x72, 0x61, 0x72, 0x61, 0x3b,
-0x4f, 0x6d, 0x75, 0x6b, 0x3b, 0x4f, 0x6b, 0x77, 0x61, 0x6d, 0x67, 0x2019, 0x3b, 0x4f, 0x64, 0x75, 0x6e, 0x67, 0x2019, 0x65,
-0x6c, 0x3b, 0x4f, 0x6d, 0x61, 0x72, 0x75, 0x6b, 0x3b, 0x4f, 0x6d, 0x6f, 0x64, 0x6f, 0x6b, 0x2019, 0x6b, 0x69, 0x6e, 0x67,
-0x2019, 0x6f, 0x6c, 0x3b, 0x4f, 0x6a, 0x6f, 0x6c, 0x61, 0x3b, 0x4f, 0x70, 0x65, 0x64, 0x65, 0x6c, 0x3b, 0x4f, 0x73, 0x6f,
-0x6b, 0x6f, 0x73, 0x6f, 0x6b, 0x6f, 0x6d, 0x61, 0x3b, 0x4f, 0x74, 0x69, 0x62, 0x61, 0x72, 0x3b, 0x4f, 0x6c, 0x61, 0x62,
-0x6f, 0x72, 0x3b, 0x4f, 0x70, 0x6f, 0x6f, 0x3b, 0x52, 0x3b, 0x4d, 0x3b, 0x4b, 0x3b, 0x44, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b,
-0x4a, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x50, 0x3b, 0x17d, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x65, 0x3b,
-0x4d, 0x61, 0x72, 0x3b, 0x41, 0x77, 0x69, 0x3b, 0x4d, 0x65, 0x3b, 0x17d, 0x75, 0x77, 0x3b, 0x17d, 0x75, 0x79, 0x3b, 0x55,
-0x74, 0x3b, 0x53, 0x65, 0x6b, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x6f, 0x3b, 0x44, 0x65, 0x65, 0x3b, 0x17d, 0x61,
-0x6e, 0x77, 0x69, 0x79, 0x65, 0x3b, 0x46, 0x65, 0x65, 0x77, 0x69, 0x72, 0x69, 0x79, 0x65, 0x3b, 0x4d, 0x61, 0x72, 0x73,
-0x69, 0x3b, 0x41, 0x77, 0x69, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x3b, 0x17d, 0x75, 0x77, 0x65, 0x14b, 0x3b, 0x17d, 0x75,
-0x79, 0x79, 0x65, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x6b, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x3b, 0x4f, 0x6b, 0x74,
-0x6f, 0x6f, 0x62, 0x75, 0x72, 0x3b, 0x4e, 0x6f, 0x6f, 0x77, 0x61, 0x6e, 0x62, 0x75, 0x72, 0x3b, 0x44, 0x65, 0x65, 0x73,
-0x61, 0x6e, 0x62, 0x75, 0x72, 0x3b, 0x17d, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x17d, 0x3b, 0x17d, 0x3b,
-0x55, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x44, 0x41, 0x43, 0x3b, 0x44, 0x41, 0x52, 0x3b, 0x44, 0x41,
-0x44, 0x3b, 0x44, 0x41, 0x4e, 0x3b, 0x44, 0x41, 0x48, 0x3b, 0x44, 0x41, 0x55, 0x3b, 0x44, 0x41, 0x4f, 0x3b, 0x44, 0x41,
-0x42, 0x3b, 0x44, 0x4f, 0x43, 0x3b, 0x44, 0x41, 0x50, 0x3b, 0x44, 0x47, 0x49, 0x3b, 0x44, 0x41, 0x47, 0x3b, 0x44, 0x77,
-0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x63, 0x68, 0x69, 0x65, 0x6c, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72,
-0x20, 0x41, 0x72, 0x69, 0x79, 0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x64, 0x65, 0x6b, 0x3b,
-0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x6e, 0x67, 0x2019, 0x77, 0x65, 0x6e, 0x3b, 0x44, 0x77, 0x65, 0x20,
-0x6d, 0x61, 0x72, 0x20, 0x41, 0x62, 0x69, 0x63, 0x68, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x75,
-0x63, 0x68, 0x69, 0x65, 0x6c, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x62, 0x69, 0x72, 0x69, 0x79,
-0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x62, 0x6f, 0x72, 0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20,
-0x6d, 0x61, 0x72, 0x20, 0x4f, 0x63, 0x68, 0x69, 0x6b, 0x6f, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41,
-0x70, 0x61, 0x72, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x67, 0x69, 0x20, 0x61, 0x63, 0x68, 0x69, 0x65,
-0x6c, 0x3b, 0x44, 0x77, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x41, 0x70, 0x61, 0x72, 0x20, 0x67, 0x69, 0x20, 0x61, 0x72,
-0x69, 0x79, 0x6f, 0x3b, 0x43, 0x3b, 0x52, 0x3b, 0x44, 0x3b, 0x4e, 0x3b, 0x42, 0x3b, 0x55, 0x3b, 0x42, 0x3b, 0x42, 0x3b,
-0x43, 0x3b, 0x50, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x59, 0x65, 0x6e, 0x3b, 0x59, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b,
-0x49, 0x62, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x3b, 0x59, 0x75, 0x6e, 0x3b, 0x59, 0x75, 0x6c, 0x3b, 0x194, 0x75, 0x63, 0x3b,
-0x43, 0x75, 0x74, 0x3b, 0x4b, 0x1e6d, 0x75, 0x3b, 0x4e, 0x77, 0x61, 0x3b, 0x44, 0x75, 0x6a, 0x3b, 0x59, 0x65, 0x6e, 0x6e,
-0x61, 0x79, 0x65, 0x72, 0x3b, 0x59, 0x65, 0x62, 0x72, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x49,
-0x62, 0x72, 0x69, 0x72, 0x3b, 0x4d, 0x61, 0x79, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6e, 0x79, 0x75, 0x3b, 0x59, 0x75, 0x6c,
-0x79, 0x75, 0x7a, 0x3b, 0x194, 0x75, 0x63, 0x74, 0x3b, 0x43, 0x75, 0x74, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x4b, 0x1e6d,
-0x75, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x77, 0x61, 0x6e, 0x62, 0x69, 0x72, 0x3b, 0x44, 0x75, 0x6a, 0x61, 0x6e, 0x62, 0x69,
-0x72, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x4d, 0x3b, 0x49, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x59, 0x3b, 0x194, 0x3b, 0x43, 0x3b,
-0x4b, 0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x69, 0x3b, 0x46, 0x65, 0x62, 0x6c, 0x75, 0x61,
-0x6c, 0x69, 0x3b, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x3b, 0x41, 0x70, 0x6c, 0x69, 0x6c, 0x69, 0x3b, 0x4d, 0x65, 0x69, 0x3b,
-0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x61, 0x69, 0x3b, 0x41, 0x67, 0x6f, 0x73, 0x74, 0x69, 0x3b, 0x53, 0x65,
-0x70, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x61, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62,
-0x61, 0x3b, 0x44, 0x65, 0x73, 0x65, 0x6d, 0x62, 0x61, 0x3b, 0x91c, 0x93e, 0x928, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92b,
-0x947, 0x92c, 0x94d, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x940, 0x3b, 0x92e, 0x93e, 0x930, 0x94d, 0x938, 0x3b, 0x90f, 0x92b, 0x94d, 0x930,
-0x93f, 0x932, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x928, 0x3b, 0x91c, 0x941, 0x932, 0x93e, 0x907, 0x3b, 0x906, 0x917, 0x938, 0x94d,
-0x925, 0x3b, 0x938, 0x947, 0x92c, 0x925, 0x947, 0x91c, 0x94d, 0x92c, 0x93c, 0x930, 0x3b, 0x905, 0x916, 0x925, 0x92c, 0x930, 0x3b, 0x928,
-0x92c, 0x947, 0x91c, 0x94d, 0x92c, 0x93c, 0x930, 0x3b, 0x926, 0x93f, 0x938, 0x947, 0x91c, 0x94d, 0x92c, 0x93c, 0x930, 0x3b, 0x91c, 0x3b,
-0x92b, 0x947, 0x3b, 0x92e, 0x93e, 0x3b, 0x90f, 0x3b, 0x92e, 0x947, 0x3b, 0x91c, 0x941, 0x3b, 0x91c, 0x941, 0x3b, 0x906, 0x3b, 0x938,
-0x947, 0x3b, 0x905, 0x3b, 0x928, 0x3b, 0x926, 0x93f, 0x3b, 0x456, 0x486, 0x430, 0x2de9, 0x487, 0x3b, 0x444, 0x435, 0x2de1, 0x487, 0x3b,
-0x43c, 0x430, 0x2dec, 0x487, 0x3b, 0x430, 0x486, 0x43f, 0x2dec, 0x487, 0x3b, 0x43c, 0x430, 0xa675, 0x3b, 0x456, 0x486, 0xa64b, 0x2de9, 0x487,
-0x3b, 0x456, 0x486, 0xa64b, 0x2de7, 0x487, 0x3b, 0x430, 0x486, 0x301, 0x475, 0x2de2, 0x487, 0x3b, 0x441, 0x435, 0x2deb, 0x487, 0x3b, 0x47b,
-0x486, 0x43a, 0x2dee, 0x3b, 0x43d, 0x43e, 0x435, 0x2de8, 0x3b, 0x434, 0x435, 0x2de6, 0x487, 0x3b, 0x456, 0x486, 0x430, 0x43d, 0x43d, 0xa64b,
-0x430, 0x301, 0x440, 0x457, 0x439, 0x3b, 0x444, 0x435, 0x432, 0x440, 0xa64b, 0x430, 0x301, 0x440, 0x457, 0x439, 0x3b, 0x43c, 0x430, 0x301,
-0x440, 0x442, 0x44a, 0x3b, 0x430, 0x486, 0x43f, 0x440, 0x456, 0x301, 0x43b, 0x43b, 0x457, 0x439, 0x3b, 0x43c, 0x430, 0x301, 0x457, 0x439,
-0x3b, 0x456, 0x486, 0xa64b, 0x301, 0x43d, 0x457, 0x439, 0x3b, 0x456, 0x486, 0xa64b, 0x301, 0x43b, 0x457, 0x439, 0x3b, 0x430, 0x486, 0x301,
-0x475, 0x433, 0xa64b, 0x441, 0x442, 0x44a, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x439, 0x3b, 0x47b,
-0x486, 0x43a, 0x442, 0x461, 0x301, 0x432, 0x440, 0x457, 0x439, 0x3b, 0x43d, 0x43e, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x439, 0x3b,
-0x434, 0x435, 0x43a, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x439, 0x3b, 0x406, 0x486, 0x3b, 0x424, 0x3b, 0x41c, 0x3b, 0x410, 0x486,
-0x3b, 0x41c, 0x3b, 0x406, 0x486, 0x3b, 0x406, 0x486, 0x3b, 0x410, 0x486, 0x3b, 0x421, 0x3b, 0x47a, 0x486, 0x3b, 0x41d, 0x3b, 0x414,
-0x3b, 0x456, 0x486, 0x430, 0x43d, 0x43d, 0xa64b, 0x430, 0x301, 0x440, 0x457, 0x430, 0x3b, 0x444, 0x435, 0x432, 0x440, 0xa64b, 0x430, 0x301,
-0x440, 0x457, 0x430, 0x3b, 0x43c, 0x430, 0x301, 0x440, 0x442, 0x430, 0x3b, 0x430, 0x486, 0x43f, 0x440, 0x456, 0x301, 0x43b, 0x43b, 0x457,
-0x430, 0x3b, 0x43c, 0x430, 0x301, 0x457, 0x430, 0x3b, 0x456, 0x486, 0xa64b, 0x301, 0x43d, 0x457, 0x430, 0x3b, 0x456, 0x486, 0xa64b, 0x301,
-0x43b, 0x457, 0x430, 0x3b, 0x430, 0x486, 0x301, 0x475, 0x433, 0xa64b, 0x441, 0x442, 0x430, 0x3b, 0x441, 0x435, 0x43f, 0x442, 0x435, 0x301,
-0x43c, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x47b, 0x486, 0x43a, 0x442, 0x461, 0x301, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x43d, 0x43e, 0x435,
-0x301, 0x43c, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x434, 0x435, 0x43a, 0x435, 0x301, 0x43c, 0x432, 0x440, 0x457, 0x430, 0x3b, 0x43, 0x69,
-0x6f, 0x3b, 0x4c, 0x75, 0x69, 0x3b, 0x4c, 0x75, 0x73, 0x3b, 0x4d, 0x75, 0x75, 0x3b, 0x4c, 0x75, 0x6d, 0x3b, 0x4c, 0x75,
-0x66, 0x3b, 0x4b, 0x61, 0x62, 0x3b, 0x4c, 0x75, 0x73, 0x68, 0x3b, 0x4c, 0x75, 0x74, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4b,
-0x61, 0x73, 0x3b, 0x43, 0x69, 0x73, 0x3b, 0x43, 0x69, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x4c, 0xf9, 0x69, 0x73, 0x68, 0x69,
-0x3b, 0x4c, 0x75, 0x73, 0xf2, 0x6c, 0x6f, 0x3b, 0x4d, 0xf9, 0x75, 0x79, 0xe0, 0x3b, 0x4c, 0x75, 0x6d, 0xf9, 0x6e, 0x67,
-0xf9, 0x6c, 0xf9, 0x3b, 0x4c, 0x75, 0x66, 0x75, 0x69, 0x6d, 0x69, 0x3b, 0x4b, 0x61, 0x62, 0xe0, 0x6c, 0xe0, 0x73, 0x68,
-0xec, 0x70, 0xf9, 0x3b, 0x4c, 0xf9, 0x73, 0x68, 0xec, 0x6b, 0xe0, 0x3b, 0x4c, 0x75, 0x74, 0x6f, 0x6e, 0x67, 0x6f, 0x6c,
-0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x67, 0xf9, 0x64, 0x69, 0x3b, 0x4b, 0x61, 0x73, 0x77, 0xe8, 0x6b, 0xe8, 0x73, 0xe8, 0x3b,
-0x43, 0x69, 0x73, 0x77, 0xe0, 0x3b, 0x43, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b,
-0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b, 0x43, 0x3b, 0x4a, 0x61, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0xe4,
-0x65, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x6e, 0x3b, 0x4a, 0x75, 0x6c, 0x3b, 0x41, 0x75,
-0x67, 0x3b, 0x53, 0x65, 0x70, 0x3b, 0x4f, 0x6b, 0x74, 0x3b, 0x4e, 0x6f, 0x76, 0x3b, 0x44, 0x65, 0x7a, 0x3b, 0x4a, 0x61,
-0x6e, 0x75, 0x61, 0x72, 0x3b, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x4d, 0xe4, 0x65, 0x72, 0x7a, 0x3b, 0x41,
-0x62, 0x72, 0xeb, 0x6c, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b,
-0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x4f, 0x6b, 0x74,
-0x6f, 0x62, 0x65, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x4a, 0x61, 0x6e, 0x2e, 0x3b, 0x46, 0x65, 0x62, 0x2e, 0x3b, 0x4d, 0xe4, 0x65, 0x2e, 0x3b, 0x41, 0x62,
-0x72, 0x2e, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x4a, 0x75, 0x6e, 0x69, 0x3b, 0x4a, 0x75, 0x6c, 0x69, 0x3b, 0x41, 0x75, 0x67,
-0x2e, 0x3b, 0x53, 0x65, 0x70, 0x2e, 0x3b, 0x4f, 0x6b, 0x74, 0x2e, 0x3b, 0x4e, 0x6f, 0x76, 0x2e, 0x3b, 0x44, 0x65, 0x7a,
-0x2e, 0x3b, 0x6e, 0xf9, 0x6d, 0x3b, 0x6b, 0x268, 0x7a, 0x3b, 0x74, 0x268, 0x64, 0x3b, 0x74, 0x61, 0x61, 0x3b, 0x73, 0x65,
-0x65, 0x3b, 0x6e, 0x7a, 0x75, 0x3b, 0x64, 0x75, 0x6d, 0x3b, 0x66, 0x254, 0x65, 0x3b, 0x64, 0x7a, 0x75, 0x3b, 0x6c, 0x254,
-0x6d, 0x3b, 0x6b, 0x61, 0x61, 0x3b, 0x66, 0x77, 0x6f, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x6e, 0xf9,
-0x6d, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x6b, 0x197, 0x300, 0x7a, 0xf9, 0x294, 0x3b, 0x6e, 0x64, 0x7a,
-0x254, 0x300, 0x14b, 0x254, 0x300, 0x74, 0x197, 0x300, 0x64, 0x289, 0x300, 0x67, 0x68, 0xe0, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300,
-0x14b, 0x254, 0x300, 0x74, 0x1ce, 0x61, 0x66, 0x289, 0x304, 0x67, 0x68, 0x101, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0xe8,
-0x73, 0xe8, 0x65, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x6e, 0x7a, 0xf9, 0x67, 0x68, 0xf2, 0x3b, 0x6e,
-0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x64, 0xf9, 0x6d, 0x6c, 0x6f, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254,
-0x300, 0x6b, 0x77, 0xee, 0x66, 0x254, 0x300, 0x65, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300, 0x74, 0x197, 0x300,
-0x66, 0x289, 0x300, 0x67, 0x68, 0xe0, 0x64, 0x7a, 0x75, 0x67, 0x68, 0xf9, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254,
-0x300, 0x67, 0x68, 0x1d4, 0x75, 0x77, 0x65, 0x6c, 0x254, 0x300, 0x6d, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0x254, 0x300,
-0x63, 0x68, 0x77, 0x61, 0x294, 0xe0, 0x6b, 0x61, 0x61, 0x20, 0x77, 0x6f, 0x3b, 0x6e, 0x64, 0x7a, 0x254, 0x300, 0x14b, 0xe8,
-0x66, 0x77, 0xf2, 0x6f, 0x3b, 0x6e, 0x3b, 0x6b, 0x3b, 0x74, 0x3b, 0x74, 0x3b, 0x73, 0x3b, 0x7a, 0x3b, 0x6b, 0x3b, 0x66,
-0x3b, 0x64, 0x3b, 0x6c, 0x3b, 0x63, 0x3b, 0x66, 0x3b, 0x6b, 0x254, 0x6e, 0x3b, 0x6d, 0x61, 0x63, 0x3b, 0x6d, 0x61, 0x74,
-0x3b, 0x6d, 0x74, 0x6f, 0x3b, 0x6d, 0x70, 0x75, 0x3b, 0x68, 0x69, 0x6c, 0x3b, 0x6e, 0x6a, 0x65, 0x3b, 0x68, 0x69, 0x6b,
-0x3b, 0x64, 0x69, 0x70, 0x3b, 0x62, 0x69, 0x6f, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x6c, 0x69, 0x253, 0x3b, 0x4b, 0x254, 0x6e,
-0x64, 0x254, 0x14b, 0x3b, 0x4d, 0xe0, 0x63, 0x25b, 0x302, 0x6c, 0x3b, 0x4d, 0xe0, 0x74, 0xf9, 0x6d, 0x62, 0x3b, 0x4d, 0xe0,
-0x74, 0x6f, 0x70, 0x3b, 0x4d, 0x300, 0x70, 0x75, 0x79, 0x25b, 0x3b, 0x48, 0xec, 0x6c, 0xf2, 0x6e, 0x64, 0x25b, 0x300, 0x3b,
-0x4e, 0x6a, 0xe8, 0x62, 0xe0, 0x3b, 0x48, 0xec, 0x6b, 0x61, 0x14b, 0x3b, 0x44, 0xec, 0x70, 0x254, 0x300, 0x73, 0x3b, 0x42,
-0xec, 0xf2, 0xf4, 0x6d, 0x3b, 0x4d, 0xe0, 0x79, 0x25b, 0x73, 0xe8, 0x70, 0x3b, 0x4c, 0xec, 0x62, 0x75, 0x79, 0x20, 0x6c,
-0x69, 0x20, 0x144, 0x79, 0xe8, 0x65, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x68, 0x3b, 0x6e,
-0x3b, 0x68, 0x3b, 0x64, 0x3b, 0x62, 0x3b, 0x6d, 0x3b, 0x6c, 0x3b, 0x64, 0x69, 0x3b, 0x14b, 0x67, 0x254, 0x6e, 0x3b, 0x73,
-0x254, 0x14b, 0x3b, 0x64, 0x69, 0x253, 0x3b, 0x65, 0x6d, 0x69, 0x3b, 0x65, 0x73, 0x254, 0x3b, 0x6d, 0x61, 0x64, 0x3b, 0x64,
-0x69, 0x14b, 0x3b, 0x6e, 0x79, 0x25b, 0x74, 0x3b, 0x6d, 0x61, 0x79, 0x3b, 0x74, 0x69, 0x6e, 0x3b, 0x65, 0x6c, 0xe1, 0x3b,
-0x64, 0x69, 0x6d, 0x254, 0x301, 0x64, 0x69, 0x3b, 0x14b, 0x67, 0x254, 0x6e, 0x64, 0x25b, 0x3b, 0x73, 0x254, 0x14b, 0x25b, 0x3b,
-0x64, 0x69, 0x253, 0xe1, 0x253, 0xe1, 0x3b, 0x65, 0x6d, 0x69, 0x61, 0x73, 0x65, 0x6c, 0x65, 0x3b, 0x65, 0x73, 0x254, 0x70,
-0x25b, 0x73, 0x254, 0x70, 0x25b, 0x3b, 0x6d, 0x61, 0x64, 0x69, 0x253, 0x25b, 0x301, 0x64, 0xed, 0x253, 0x25b, 0x301, 0x3b, 0x64,
-0x69, 0x14b, 0x67, 0x69, 0x6e, 0x64, 0x69, 0x3b, 0x6e, 0x79, 0x25b, 0x74, 0x25b, 0x6b, 0x69, 0x3b, 0x6d, 0x61, 0x79, 0xe9,
-0x73, 0x25b, 0x301, 0x3b, 0x74, 0x69, 0x6e, 0xed, 0x6e, 0xed, 0x3b, 0x65, 0x6c, 0xe1, 0x14b, 0x67, 0x25b, 0x301, 0x3b, 0x64,
-0x3b, 0x14b, 0x3b, 0x73, 0x3b, 0x64, 0x3b, 0x65, 0x3b, 0x65, 0x3b, 0x6d, 0x3b, 0x64, 0x3b, 0x6e, 0x3b, 0x6d, 0x3b, 0x74,
-0x3b, 0x65, 0x3b, 0x53, 0x61, 0x3b, 0x46, 0x65, 0x3b, 0x4d, 0x61, 0x3b, 0x41, 0x62, 0x3b, 0x4d, 0x65, 0x3b, 0x53, 0x75,
-0x3b, 0x53, 0xfa, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x3b, 0x4f, 0x6b, 0x3b, 0x4e, 0x6f, 0x3b, 0x44, 0x65, 0x3b, 0x53,
-0x61, 0x6e, 0x76, 0x69, 0x65, 0x3b, 0x46, 0xe9, 0x62, 0x69, 0x72, 0x69, 0x65, 0x3b, 0x4d, 0x61, 0x72, 0x73, 0x3b, 0x41,
-0x62, 0x75, 0x72, 0x69, 0x6c, 0x3b, 0x4d, 0x65, 0x65, 0x3b, 0x53, 0x75, 0x65, 0x14b, 0x3b, 0x53, 0xfa, 0x75, 0x79, 0x65,
-0x65, 0x3b, 0x55, 0x74, 0x3b, 0x53, 0x65, 0x74, 0x74, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x4f, 0x6b, 0x74, 0x6f, 0x62,
-0x61, 0x72, 0x3b, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x61, 0x72, 0x3b, 0x44, 0x69, 0x73, 0x61, 0x6d, 0x62, 0x61, 0x72,
-0x3b, 0x53, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x55, 0x3b, 0x53, 0x3b, 0x4f,
-0x3b, 0x4e, 0x3b, 0x44, 0x3b, 0x6e, 0x67, 0x6f, 0x3b, 0x6e, 0x67, 0x62, 0x3b, 0x6e, 0x67, 0x6c, 0x3b, 0x6e, 0x67, 0x6e,
-0x3b, 0x6e, 0x67, 0x74, 0x3b, 0x6e, 0x67, 0x73, 0x3b, 0x6e, 0x67, 0x7a, 0x3b, 0x6e, 0x67, 0x6d, 0x3b, 0x6e, 0x67, 0x65,
-0x3b, 0x6e, 0x67, 0x61, 0x3b, 0x6e, 0x67, 0x61, 0x64, 0x3b, 0x6e, 0x67, 0x61, 0x62, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20,
-0x6f, 0x73, 0xfa, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x62, 0x25b, 0x30c, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x6c, 0xe1,
-0x6c, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x6e, 0x79, 0x69, 0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x74,
-0xe1, 0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x73, 0x61, 0x6d, 0x259, 0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e,
-0x20, 0x7a, 0x61, 0x6d, 0x67, 0x62, 0xe1, 0x6c, 0x61, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x6d, 0x77, 0x6f, 0x6d, 0x3b,
-0x6e, 0x67, 0x254, 0x6e, 0x20, 0x65, 0x62, 0x75, 0x6c, 0xfa, 0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x61, 0x77, 0xf3, 0x6d,
-0x3b, 0x6e, 0x67, 0x254, 0x6e, 0x20, 0x61, 0x77, 0xf3, 0x6d, 0x20, 0x61, 0x69, 0x20, 0x64, 0x7a, 0x69, 0xe1, 0x3b, 0x6e,
-0x67, 0x254, 0x6e, 0x20, 0x61, 0x77, 0xf3, 0x6d, 0x20, 0x61, 0x69, 0x20, 0x62, 0x25b, 0x30c, 0x3b, 0x6f, 0x3b, 0x62, 0x3b,
-0x6c, 0x3b, 0x6e, 0x3b, 0x74, 0x3b, 0x73, 0x3b, 0x7a, 0x3b, 0x6d, 0x3b, 0x65, 0x3b, 0x61, 0x3b, 0x64, 0x3b, 0x62, 0x3b,
-0x14b, 0x31, 0x3b, 0x14b, 0x32, 0x3b, 0x14b, 0x33, 0x3b, 0x14b, 0x34, 0x3b, 0x14b, 0x35, 0x3b, 0x14b, 0x36, 0x3b, 0x14b, 0x37,
-0x3b, 0x14b, 0x38, 0x3b, 0x14b, 0x39, 0x3b, 0x14b, 0x31, 0x30, 0x3b, 0x14b, 0x31, 0x31, 0x3b, 0x14b, 0x31, 0x32, 0x3b, 0x14b,
-0x77, 0xed, 0xed, 0x20, 0x61, 0x20, 0x6e, 0x74, 0x254, 0x301, 0x6e, 0x74, 0x254, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61,
-0x6b, 0x1dd, 0x20, 0x62, 0x25b, 0x301, 0x25b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x72, 0xe1, 0xe1,
-0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x6e, 0x69, 0x6e, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61,
-0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x6e, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61,
-0x66, 0x254, 0x6b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x62, 0x25b, 0x25b, 0x3b,
-0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x72, 0x61, 0x61, 0x3b, 0x14b, 0x77, 0xed, 0xed,
-0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x74, 0xe1, 0x61, 0x6e, 0x69, 0x6e, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd,
-0x20, 0x6e, 0x74, 0x25b, 0x6b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x6e, 0x74, 0x25b, 0x6b, 0x20,
-0x64, 0x69, 0x20, 0x62, 0x254, 0x301, 0x6b, 0x3b, 0x14b, 0x77, 0xed, 0xed, 0x20, 0x61, 0x6b, 0x1dd, 0x20, 0x6e, 0x74, 0x25b,
-0x6b, 0x20, 0x64, 0x69, 0x20, 0x62, 0x25b, 0x301, 0x25b, 0x3b, 0x4b, 0x77, 0x61, 0x3b, 0x55, 0x6e, 0x61, 0x3b, 0x52, 0x61,
-0x72, 0x3b, 0x43, 0x68, 0x65, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x4d, 0x6f, 0x63, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4e, 0x61,
-0x6e, 0x3b, 0x54, 0x69, 0x73, 0x3b, 0x4b, 0x75, 0x6d, 0x3b, 0x4d, 0x6f, 0x6a, 0x3b, 0x59, 0x65, 0x6c, 0x3b, 0x4d, 0x77,
-0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20,
-0x77, 0x6f, 0x20, 0x75, 0x6e, 0x61, 0x79, 0x65, 0x6c, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20,
-0x75, 0x6e, 0x65, 0x72, 0x61, 0x72, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x75, 0x6e, 0x65,
-0x63, 0x68, 0x65, 0x73, 0x68, 0x65, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x75, 0x6e, 0x65, 0x74,
-0x68, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x75, 0x20,
-0x6e, 0x61, 0x20, 0x6d, 0x6f, 0x63, 0x68, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x73, 0x61,
-0x62, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x6e, 0x61, 0x6e, 0x65, 0x3b, 0x4d, 0x77, 0x65,
-0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x74, 0x69, 0x73, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20,
-0x6b, 0x75, 0x6d, 0x69, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x6b, 0x75, 0x6d, 0x69, 0x20, 0x6e,
-0x61, 0x20, 0x6d, 0x6f, 0x6a, 0x61, 0x3b, 0x4d, 0x77, 0x65, 0x72, 0x69, 0x20, 0x77, 0x6f, 0x20, 0x6b, 0x75, 0x6d, 0x69,
-0x20, 0x6e, 0x61, 0x20, 0x79, 0x65, 0x6c, 0x2019, 0x6c, 0x69, 0x3b, 0x4b, 0x3b, 0x55, 0x3b, 0x52, 0x3b, 0x43, 0x3b, 0x54,
-0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x59, 0x3b, 0x46, 0x4c, 0x4f, 0x3b, 0x43,
-0x4c, 0x41, 0x3b, 0x43, 0x4b, 0x49, 0x3b, 0x46, 0x4d, 0x46, 0x3b, 0x4d, 0x41, 0x44, 0x3b, 0x4d, 0x42, 0x49, 0x3b, 0x4d,
-0x4c, 0x49, 0x3b, 0x4d, 0x41, 0x4d, 0x3b, 0x46, 0x44, 0x45, 0x3b, 0x46, 0x4d, 0x55, 0x3b, 0x46, 0x47, 0x57, 0x3b, 0x46,
-0x59, 0x55, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x4c, 0x6f, 0x6f, 0x3b, 0x43, 0x6f, 0x6b, 0x63, 0x77, 0x61, 0x6b, 0x6c, 0x61,
-0x14b, 0x6e, 0x65, 0x3b, 0x43, 0x6f, 0x6b, 0x63, 0x77, 0x61, 0x6b, 0x6c, 0x69, 0x69, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x4d,
-0x61, 0x72, 0x66, 0x6f, 0x6f, 0x3b, 0x4d, 0x61, 0x64, 0x1dd, 0x1dd, 0x75, 0x75, 0x74, 0x1dd, 0x62, 0x69, 0x6a, 0x61, 0x14b,
-0x3b, 0x4d, 0x61, 0x6d, 0x1dd, 0x14b, 0x67, 0x77, 0xe3, 0x61, 0x66, 0x61, 0x68, 0x62, 0x69, 0x69, 0x3b, 0x4d, 0x61, 0x6d,
-0x1dd, 0x14b, 0x67, 0x77, 0xe3, 0x61, 0x6c, 0x69, 0x69, 0x3b, 0x4d, 0x61, 0x64, 0x1dd, 0x6d, 0x62, 0x69, 0x69, 0x3b, 0x46,
-0x129, 0x69, 0x20, 0x44, 0x1dd, 0x253, 0x6c, 0x69, 0x69, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x4d, 0x75, 0x6e, 0x64, 0x61, 0x14b,
-0x3b, 0x46, 0x129, 0x69, 0x20, 0x47, 0x77, 0x61, 0x68, 0x6c, 0x6c, 0x65, 0x3b, 0x46, 0x129, 0x69, 0x20, 0x59, 0x75, 0x72,
-0x75, 0x3b, 0x4f, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x46, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x45, 0x3b,
-0x55, 0x3b, 0x57, 0x3b, 0x59, 0x3b, 0x6e, 0x67, 0x31, 0x3b, 0x6e, 0x67, 0x32, 0x3b, 0x6e, 0x67, 0x33, 0x3b, 0x6e, 0x67,
-0x34, 0x3b, 0x6e, 0x67, 0x35, 0x3b, 0x6e, 0x67, 0x36, 0x3b, 0x6e, 0x67, 0x37, 0x3b, 0x6e, 0x67, 0x38, 0x3b, 0x6e, 0x67,
-0x39, 0x3b, 0x6e, 0x67, 0x31, 0x30, 0x3b, 0x6e, 0x67, 0x31, 0x31, 0x3b, 0x6b, 0x72, 0x69, 0x73, 0x3b, 0x6e, 0x67, 0x77,
-0x25b, 0x6e, 0x20, 0x6d, 0x61, 0x74, 0xe1, 0x68, 0x72, 0x61, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x6d, 0x62,
-0x61, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x6c, 0x61, 0x6c, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144,
-0x6e, 0x61, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x144, 0x74, 0x61, 0x6e, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20,
-0x144, 0x74, 0x75, 0xf3, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x68, 0x25b, 0x6d, 0x62, 0x75, 0x25b, 0x72, 0xed, 0x3b,
-0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x6c, 0x254, 0x6d, 0x62, 0x69, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x72, 0x25b,
-0x62, 0x76, 0x75, 0xe2, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e, 0x20, 0x77, 0x75, 0x6d, 0x3b, 0x6e, 0x67, 0x77, 0x25b, 0x6e,
-0x20, 0x77, 0x75, 0x6d, 0x20, 0x6e, 0x61, 0x76, 0x1d4, 0x72, 0x3b, 0x6b, 0x72, 0xed, 0x73, 0x69, 0x6d, 0x69, 0x6e, 0x3b,
-0x54, 0x69, 0x6f, 0x70, 0x3b, 0x50, 0x25b, 0x74, 0x3b, 0x44, 0x75, 0x254, 0x331, 0x254, 0x331, 0x3b, 0x47, 0x75, 0x61, 0x6b,
-0x3b, 0x44, 0x75, 0xe4, 0x3b, 0x4b, 0x6f, 0x72, 0x3b, 0x50, 0x61, 0x79, 0x3b, 0x54, 0x68, 0x6f, 0x6f, 0x3b, 0x54, 0x25b,
-0x25b, 0x3b, 0x4c, 0x61, 0x61, 0x3b, 0x4b, 0x75, 0x72, 0x3b, 0x54, 0x69, 0x64, 0x3b, 0x54, 0x69, 0x6f, 0x70, 0x20, 0x74,
-0x68, 0x61, 0x72, 0x20, 0x70, 0x25b, 0x74, 0x3b, 0x50, 0x25b, 0x74, 0x3b, 0x44, 0x75, 0x254, 0x331, 0x254, 0x331, 0x14b, 0x3b,
-0x47, 0x75, 0x61, 0x6b, 0x3b, 0x44, 0x75, 0xe4, 0x74, 0x3b, 0x4b, 0x6f, 0x72, 0x6e, 0x79, 0x6f, 0x6f, 0x74, 0x3b, 0x50,
-0x61, 0x79, 0x20, 0x79, 0x69, 0x65, 0x331, 0x74, 0x6e, 0x69, 0x3b, 0x54, 0x68, 0x6f, 0x331, 0x6f, 0x331, 0x72, 0x3b, 0x54,
-0x25b, 0x25b, 0x72, 0x3b, 0x4c, 0x61, 0x61, 0x74, 0x68, 0x3b, 0x4b, 0x75, 0x72, 0x3b, 0x54, 0x69, 0x6f, 0x331, 0x70, 0x20,
-0x69, 0x6e, 0x20, 0x64, 0x69, 0x331, 0x69, 0x331, 0x74, 0x3b, 0x54, 0x3b, 0x50, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x44, 0x3b,
-0x4b, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x422, 0x43e, 0x445, 0x441, 0x3b, 0x41e,
-0x43b, 0x443, 0x43d, 0x3b, 0x41a, 0x43b, 0x43d, 0x3b, 0x41c, 0x441, 0x443, 0x3b, 0x42b, 0x430, 0x43c, 0x3b, 0x411, 0x44d, 0x441, 0x3b,
-0x41e, 0x442, 0x439, 0x3b, 0x410, 0x442, 0x440, 0x3b, 0x411, 0x43b, 0x495, 0x3b, 0x410, 0x43b, 0x442, 0x3b, 0x421, 0x44d, 0x442, 0x3b,
-0x410, 0x445, 0x441, 0x3b, 0x442, 0x43e, 0x445, 0x441, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x3b, 0x43e, 0x43b, 0x443, 0x43d, 0x43d, 0x44c,
-0x443, 0x3b, 0x43a, 0x443, 0x43b, 0x443, 0x43d, 0x20, 0x442, 0x443, 0x442, 0x430, 0x440, 0x3b, 0x43c, 0x443, 0x443, 0x441, 0x20, 0x443,
-0x441, 0x442, 0x430, 0x440, 0x3b, 0x44b, 0x430, 0x43c, 0x20, 0x44b, 0x439, 0x430, 0x3b, 0x431, 0x44d, 0x441, 0x20, 0x44b, 0x439, 0x430,
-0x3b, 0x43e, 0x442, 0x20, 0x44b, 0x439, 0x430, 0x3b, 0x430, 0x442, 0x44b, 0x440, 0x434, 0x44c, 0x44b, 0x445, 0x20, 0x44b, 0x439, 0x430,
-0x3b, 0x431, 0x430, 0x43b, 0x430, 0x495, 0x430, 0x43d, 0x20, 0x44b, 0x439, 0x430, 0x3b, 0x430, 0x43b, 0x442, 0x44b, 0x43d, 0x43d, 0x44c,
-0x44b, 0x3b, 0x441, 0x44d, 0x442, 0x438, 0x43d, 0x43d, 0x44c, 0x438, 0x3b, 0x430, 0x445, 0x441, 0x44b, 0x43d, 0x43d, 0x44c, 0x44b, 0x3b,
-0x422, 0x3b, 0x41e, 0x3b, 0x41a, 0x3b, 0x41c, 0x3b, 0x42b, 0x3b, 0x411, 0x3b, 0x41e, 0x3b, 0x410, 0x3b, 0x411, 0x3b, 0x410, 0x3b,
-0x421, 0x3b, 0x410, 0x3b, 0x422, 0x43e, 0x445, 0x441, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x3b, 0x41e, 0x43b, 0x443, 0x43d, 0x43d, 0x44c,
-0x443, 0x3b, 0x41a, 0x443, 0x43b, 0x443, 0x43d, 0x20, 0x442, 0x443, 0x442, 0x430, 0x440, 0x3b, 0x41c, 0x443, 0x443, 0x441, 0x20, 0x443,
-0x441, 0x442, 0x430, 0x440, 0x3b, 0x42b, 0x430, 0x43c, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x411, 0x44d, 0x441, 0x20, 0x44b, 0x439,
-0x44b, 0x43d, 0x3b, 0x41e, 0x442, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x410, 0x442, 0x44b, 0x440, 0x434, 0x44c, 0x44b, 0x445, 0x20,
-0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x411, 0x430, 0x43b, 0x430, 0x495, 0x430, 0x43d, 0x20, 0x44b, 0x439, 0x44b, 0x43d, 0x3b, 0x410, 0x43b,
-0x442, 0x44b, 0x43d, 0x43d, 0x44c, 0x44b, 0x3b, 0x421, 0x44d, 0x442, 0x438, 0x43d, 0x43d, 0x44c, 0x438, 0x3b, 0x430, 0x445, 0x441, 0x44b,
-0x43d, 0x43d, 0x44c, 0x44b, 0x3b, 0x4d, 0x75, 0x70, 0x3b, 0x4d, 0x77, 0x69, 0x3b, 0x4d, 0x73, 0x68, 0x3b, 0x4d, 0x75, 0x6e,
-0x3b, 0x4d, 0x61, 0x67, 0x3b, 0x4d, 0x75, 0x6a, 0x3b, 0x4d, 0x73, 0x70, 0x3b, 0x4d, 0x70, 0x67, 0x3b, 0x4d, 0x79, 0x65,
-0x3b, 0x4d, 0x6f, 0x6b, 0x3b, 0x4d, 0x75, 0x73, 0x3b, 0x4d, 0x75, 0x68, 0x3b, 0x4d, 0x75, 0x70, 0x61, 0x6c, 0x61, 0x6e,
-0x67, 0x75, 0x6c, 0x77, 0x61, 0x3b, 0x4d, 0x77, 0x69, 0x74, 0x6f, 0x70, 0x65, 0x3b, 0x4d, 0x75, 0x73, 0x68, 0x65, 0x6e,
-0x64, 0x65, 0x3b, 0x4d, 0x75, 0x6e, 0x79, 0x69, 0x3b, 0x4d, 0x75, 0x73, 0x68, 0x65, 0x6e, 0x64, 0x65, 0x20, 0x4d, 0x61,
-0x67, 0x61, 0x6c, 0x69, 0x3b, 0x4d, 0x75, 0x6a, 0x69, 0x6d, 0x62, 0x69, 0x3b, 0x4d, 0x75, 0x73, 0x68, 0x69, 0x70, 0x65,
-0x70, 0x6f, 0x3b, 0x4d, 0x75, 0x70, 0x75, 0x67, 0x75, 0x74, 0x6f, 0x3b, 0x4d, 0x75, 0x6e, 0x79, 0x65, 0x6e, 0x73, 0x65,
-0x3b, 0x4d, 0x6f, 0x6b, 0x68, 0x75, 0x3b, 0x4d, 0x75, 0x73, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x64, 0x65, 0x6d, 0x62, 0x77,
-0x65, 0x3b, 0x4d, 0x75, 0x68, 0x61, 0x61, 0x6e, 0x6f, 0x3b, 0xa5a8, 0xa595, 0xa51e, 0x3b, 0xa552, 0xa561, 0x3b, 0xa57e, 0xa5ba, 0x3b,
-0xa5a2, 0xa595, 0x3b, 0xa591, 0xa571, 0x3b, 0xa5b1, 0xa60b, 0x3b, 0xa5b1, 0xa55e, 0x3b, 0xa5db, 0xa515, 0x3b, 0xa562, 0xa54c, 0x3b, 0xa56d, 0xa583,
-0x3b, 0xa51e, 0xa60b, 0x3b, 0xa5a8, 0xa595, 0xa5cf, 0x3b, 0xa5a8, 0xa595, 0x20, 0xa56a, 0xa574, 0x20, 0xa51e, 0xa500, 0xa56e, 0xa54a, 0x3b, 0xa552,
-0xa561, 0xa59d, 0xa595, 0x3b, 0xa57e, 0xa5ba, 0x3b, 0xa5a2, 0xa595, 0x3b, 0xa591, 0xa571, 0x3b, 0xa5b1, 0xa60b, 0x3b, 0xa5b1, 0xa55e, 0xa524, 0x3b,
-0xa5db, 0xa515, 0x3b, 0xa562, 0xa54c, 0x3b, 0xa56d, 0xa583, 0x3b, 0xa51e, 0xa60b, 0xa554, 0xa57f, 0x20, 0xa578, 0xa583, 0xa5cf, 0x3b, 0xa5a8, 0xa595,
-0x20, 0xa56a, 0xa574, 0x20, 0xa5cf, 0xa5ba, 0xa56e, 0xa54a, 0x3b, 0x6c, 0x75, 0x75, 0x6b, 0x61, 0x6f, 0x20, 0x6b, 0x65, 0x6d, 0xe3,
-0x3b, 0x253, 0x61, 0x6e, 0x64, 0x61, 0x253, 0x75, 0x3b, 0x76, 0x254, 0x254, 0x3b, 0x66, 0x75, 0x6c, 0x75, 0x3b, 0x67, 0x6f,
-0x6f, 0x3b, 0x36, 0x3b, 0x37, 0x3b, 0x6b, 0x254, 0x6e, 0x64, 0x65, 0x3b, 0x73, 0x61, 0x61, 0x68, 0x3b, 0x67, 0x61, 0x6c,
-0x6f, 0x3b, 0x6b, 0x65, 0x6e, 0x70, 0x6b, 0x61, 0x74, 0x6f, 0x20, 0x253, 0x6f, 0x6c, 0x6f, 0x6c, 0x254, 0x3b, 0x6c, 0x75,
-0x75, 0x6b, 0x61, 0x6f, 0x20, 0x6c, 0x254, 0x6d, 0x61, 0x3b, 0x4a, 0x65, 0x6e, 0x3b, 0x48, 0x6f, 0x72, 0x3b, 0x4d, 0xe4,
-0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d, 0x65, 0x69, 0x3b, 0x42, 0x72, 0xe1, 0x3b, 0x48, 0x65, 0x69, 0x3b, 0xd6, 0x69,
-0x67, 0x3b, 0x48, 0x65, 0x72, 0x3b, 0x57, 0xed, 0x6d, 0x3b, 0x57, 0x69, 0x6e, 0x3b, 0x43, 0x68, 0x72, 0x3b, 0x4a, 0x65,
-0x6e, 0x6e, 0x65, 0x72, 0x3b, 0x48, 0x6f, 0x72, 0x6e, 0x69, 0x67, 0x3b, 0x4d, 0xe4, 0x72, 0x7a, 0x65, 0x3b, 0x41, 0x62,
-0x72, 0x69, 0x6c, 0x6c, 0x65, 0x3b, 0x4d, 0x65, 0x69, 0x6a, 0x65, 0x3b, 0x42, 0x72, 0xe1, 0x10d, 0x65, 0x74, 0x3b, 0x48,
-0x65, 0x69, 0x77, 0x65, 0x74, 0x3b, 0xd6, 0x69, 0x67, 0x161, 0x74, 0x65, 0x3b, 0x48, 0x65, 0x72, 0x62, 0x161, 0x74, 0x6d,
-0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x57, 0xed, 0x6d, 0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x57, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d,
-0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x43, 0x68, 0x72, 0x69, 0x161, 0x74, 0x6d, 0xe1, 0x6e, 0x65, 0x74, 0x3b, 0x4a, 0x3b, 0x48,
-0x3b, 0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x42, 0x3b, 0x48, 0x3b, 0xd6, 0x3b, 0x48, 0x3b, 0x57, 0x3b, 0x57, 0x3b, 0x43,
-0x3b, 0x6f, 0x2e, 0x31, 0x3b, 0x6f, 0x2e, 0x32, 0x3b, 0x6f, 0x2e, 0x33, 0x3b, 0x6f, 0x2e, 0x34, 0x3b, 0x6f, 0x2e, 0x35,
-0x3b, 0x6f, 0x2e, 0x36, 0x3b, 0x6f, 0x2e, 0x37, 0x3b, 0x6f, 0x2e, 0x38, 0x3b, 0x6f, 0x2e, 0x39, 0x3b, 0x6f, 0x2e, 0x31,
-0x30, 0x3b, 0x6f, 0x2e, 0x31, 0x31, 0x3b, 0x6f, 0x2e, 0x31, 0x32, 0x3b, 0x70, 0x69, 0x6b, 0xed, 0x74, 0xed, 0x6b, 0xed,
-0x74, 0x69, 0x65, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0xed, 0x20, 0xfa, 0x20, 0x6b, 0x75, 0x74, 0xfa, 0x61, 0x6e, 0x3b, 0x73,
-0x69, 0x25b, 0x79, 0x25b, 0x301, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe1, 0x6e, 0x64, 0xed, 0x25b,
-0x3b, 0x254, 0x6e, 0x73, 0xfa, 0x6d, 0x62, 0x254, 0x6c, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe1,
-0x74, 0xe1, 0x74, 0xfa, 0x25b, 0x3b, 0x6d, 0x65, 0x73, 0x69, 0x14b, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20,
-0x6b, 0xe9, 0x6e, 0x69, 0x65, 0x3b, 0x65, 0x6e, 0x73, 0x69, 0x6c, 0x2c, 0x20, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20,
-0x6b, 0xe1, 0x74, 0xe1, 0x6e, 0x75, 0x25b, 0x3b, 0x254, 0x73, 0x254, 0x6e, 0x3b, 0x65, 0x66, 0x75, 0x74, 0x65, 0x3b, 0x70,
-0x69, 0x73, 0x75, 0x79, 0xfa, 0x3b, 0x69, 0x6d, 0x25b, 0x14b, 0x20, 0x69, 0x20, 0x70, 0x75, 0x254, 0x73, 0x3b, 0x69, 0x6d,
-0x25b, 0x14b, 0x20, 0x69, 0x20, 0x70, 0x75, 0x74, 0xfa, 0x6b, 0x2c, 0x6f, 0xf3, 0x6c, 0x69, 0x20, 0xfa, 0x20, 0x6b, 0xe1,
-0x74, 0xed, 0x25b, 0x3b, 0x6d, 0x61, 0x6b, 0x61, 0x6e, 0x64, 0x69, 0x6b, 0x25b, 0x3b, 0x70, 0x69, 0x6c, 0x254, 0x6e, 0x64,
-0x254, 0x301, 0x3b, 0x58, 0x69, 0x6e, 0x3b, 0x46, 0x65, 0x62, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x41, 0x62, 0x72, 0x3b, 0x4d,
-0x61, 0x79, 0x3b, 0x58, 0x75, 0x6e, 0x3b, 0x58, 0x6e, 0x74, 0x3b, 0x41, 0x67, 0x6f, 0x3b, 0x53, 0x65, 0x74, 0x3b, 0x4f,
-0x63, 0x68, 0x3b, 0x50, 0x61, 0x79, 0x3b, 0x41, 0x76, 0x69, 0x3b, 0x78, 0x69, 0x6e, 0x65, 0x72, 0x75, 0x3b, 0x66, 0x65,
-0x62, 0x72, 0x65, 0x72, 0x75, 0x3b, 0x6d, 0x61, 0x72, 0x7a, 0x75, 0x3b, 0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x6d, 0x61,
-0x79, 0x75, 0x3b, 0x78, 0x75, 0x6e, 0x75, 0x3b, 0x78, 0x75, 0x6e, 0x65, 0x74, 0x75, 0x3b, 0x61, 0x67, 0x6f, 0x73, 0x74,
-0x75, 0x3b, 0x73, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x6f, 0x63, 0x68, 0x6f, 0x62, 0x72, 0x65, 0x3b,
-0x70, 0x61, 0x79, 0x61, 0x72, 0x65, 0x73, 0x3b, 0x61, 0x76, 0x69, 0x65, 0x6e, 0x74, 0x75, 0x3b, 0x58, 0x3b, 0x46, 0x3b,
-0x4d, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x58, 0x3b, 0x58, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x4f, 0x3b, 0x50, 0x3b, 0x41, 0x3b,
-0x78, 0x69, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x61, 0x62, 0x72, 0x3b, 0x6d, 0x61, 0x79, 0x3b,
-0x78, 0x75, 0x6e, 0x3b, 0x78, 0x6e, 0x74, 0x3b, 0x61, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x74, 0x3b, 0x6f, 0x63, 0x68, 0x3b,
-0x70, 0x61, 0x79, 0x3b, 0x61, 0x76, 0x69, 0x3b, 0x64, 0x65, 0x20, 0x78, 0x69, 0x6e, 0x65, 0x72, 0x75, 0x3b, 0x64, 0x65,
-0x20, 0x66, 0x65, 0x62, 0x72, 0x65, 0x72, 0x75, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x7a, 0x75, 0x3b, 0x64, 0x2019,
-0x61, 0x62, 0x72, 0x69, 0x6c, 0x3b, 0x64, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x75, 0x3b, 0x64, 0x65, 0x20, 0x78, 0x75, 0x6e,
-0x75, 0x3b, 0x64, 0x65, 0x20, 0x78, 0x75, 0x6e, 0x65, 0x74, 0x75, 0x3b, 0x64, 0x2019, 0x61, 0x67, 0x6f, 0x73, 0x74, 0x75,
-0x3b, 0x64, 0x65, 0x20, 0x73, 0x65, 0x74, 0x69, 0x65, 0x6d, 0x62, 0x72, 0x65, 0x3b, 0x64, 0x2019, 0x6f, 0x63, 0x68, 0x6f,
-0x62, 0x72, 0x65, 0x3b, 0x64, 0x65, 0x20, 0x70, 0x61, 0x79, 0x61, 0x72, 0x65, 0x73, 0x3b, 0x64, 0x2019, 0x61, 0x76, 0x69,
-0x65, 0x6e, 0x74, 0x75, 0x3b, 0x4e, 0x64, 0x75, 0x14b, 0x6d, 0x62, 0x69, 0x20, 0x53, 0x61, 0x14b, 0x3b, 0x50, 0x25b, 0x73,
-0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x70, 0xe1, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x74, 0xe1,
-0x74, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e, 0x25b, 0x301, 0x6b, 0x77, 0x61, 0x3b, 0x50, 0x25b,
-0x73, 0x61, 0x14b, 0x20, 0x50, 0x61, 0x74, 0x61, 0x61, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e,
-0x25b, 0x301, 0x6e, 0x74, 0xfa, 0x6b, 0xfa, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x53, 0x61, 0x61, 0x6d, 0x62, 0xe1,
-0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e, 0x25b, 0x301, 0x66, 0x254, 0x6d, 0x3b, 0x50, 0x25b, 0x73,
-0x61, 0x14b, 0x20, 0x50, 0x25b, 0x301, 0x6e, 0x25b, 0x301, 0x70, 0x66, 0xfa, 0xa78b, 0xfa, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b,
-0x20, 0x4e, 0x25b, 0x67, 0x25b, 0x301, 0x6d, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x4e, 0x74, 0x73, 0x254, 0x30c, 0x70,
-0x6d, 0x254, 0x301, 0x3b, 0x50, 0x25b, 0x73, 0x61, 0x14b, 0x20, 0x4e, 0x74, 0x73, 0x254, 0x30c, 0x70, 0x70, 0xe1, 0x3b, 0x70,
-0x61, 0x6d, 0x62, 0x61, 0x3b, 0x77, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x6d, 0x62, 0x69, 0x79, 0x254, 0x20, 0x6d, 0x25b, 0x6e,
-0x64, 0x6f, 0x14b, 0x67, 0x254, 0x3b, 0x4e, 0x79, 0x254, 0x6c, 0x254, 0x6d, 0x62, 0x254, 0x14b, 0x67, 0x254, 0x3b, 0x4d, 0x254,
-0x6e, 0x254, 0x20, 0x14b, 0x67, 0x62, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x4e, 0x79, 0x61, 0x14b, 0x67, 0x77, 0x25b, 0x20, 0x14b,
-0x67, 0x62, 0x61, 0x6e, 0x6a, 0x61, 0x3b, 0x6b, 0x75, 0x14b, 0x67, 0x77, 0x25b, 0x3b, 0x66, 0x25b, 0x3b, 0x6e, 0x6a, 0x61,
-0x70, 0x69, 0x3b, 0x6e, 0x79, 0x75, 0x6b, 0x75, 0x6c, 0x3b, 0x31, 0x31, 0x3b, 0x253, 0x75, 0x6c, 0x253, 0x75, 0x73, 0x25b,
-0x3b, 0x6d, 0x62, 0x65, 0x67, 0x74, 0x75, 0x67, 0x3b, 0x69, 0x6d, 0x65, 0x67, 0x20, 0xe0, 0x62, 0xf9, 0x62, 0xec, 0x3b,
-0x69, 0x6d, 0x65, 0x67, 0x20, 0x6d, 0x62, 0x259, 0x14b, 0x63, 0x68, 0x75, 0x62, 0x69, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20,
-0x6e, 0x67, 0x77, 0x259, 0x300, 0x74, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x66, 0x6f, 0x67, 0x3b, 0x69, 0x6d, 0x259, 0x67,
-0x20, 0x69, 0x63, 0x68, 0x69, 0x69, 0x62, 0x254, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0xe0, 0x64, 0xf9, 0x6d, 0x62,
-0x259, 0x300, 0x14b, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x69, 0x63, 0x68, 0x69, 0x6b, 0x61, 0x3b, 0x69, 0x6d, 0x259, 0x67,
-0x20, 0x6b, 0x75, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x74, 0xe8, 0x73, 0x69, 0x2bc, 0x65, 0x3b, 0x69, 0x6d, 0x259,
-0x67, 0x20, 0x7a, 0xf2, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6b, 0x72, 0x69, 0x7a, 0x6d, 0x65, 0x64, 0x3b, 0x69, 0x6d,
-0x259, 0x67, 0x20, 0x6d, 0x62, 0x65, 0x67, 0x74, 0x75, 0x67, 0x3b, 0x69, 0x6d, 0x65, 0x67, 0x20, 0xe0, 0x62, 0xf9, 0x62,
-0xec, 0x3b, 0x69, 0x6d, 0x65, 0x67, 0x20, 0x6d, 0x62, 0x259, 0x14b, 0x63, 0x68, 0x75, 0x62, 0x69, 0x3b, 0x69, 0x6d, 0x259,
-0x67, 0x20, 0x6e, 0x67, 0x77, 0x259, 0x300, 0x74, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x66, 0x6f, 0x67, 0x3b, 0x69, 0x6d,
-0x259, 0x67, 0x20, 0x69, 0x63, 0x68, 0x69, 0x69, 0x62, 0x254, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0xe0, 0x64, 0xf9,
-0x6d, 0x62, 0x259, 0x300, 0x14b, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x69, 0x63, 0x68, 0x69, 0x6b, 0x61, 0x3b, 0x69, 0x6d,
-0x259, 0x67, 0x20, 0x6b, 0x75, 0x64, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x74, 0xe8, 0x73, 0x69, 0x2bc, 0x65, 0x3b, 0x69,
-0x6d, 0x259, 0x67, 0x20, 0x7a, 0xf2, 0x3b, 0x69, 0x6d, 0x259, 0x67, 0x20, 0x6b, 0x72, 0x69, 0x7a, 0x6d, 0x65, 0x64, 0x3b,
-0x4d, 0x31, 0x3b, 0x41, 0x32, 0x3b, 0x4d, 0x33, 0x3b, 0x4e, 0x34, 0x3b, 0x46, 0x35, 0x3b, 0x49, 0x36, 0x3b, 0x41, 0x37,
-0x3b, 0x49, 0x38, 0x3b, 0x4b, 0x39, 0x3b, 0x31, 0x30, 0x3b, 0x31, 0x31, 0x3b, 0x31, 0x32, 0x3b, 0x73, 0x61, 0x14b, 0x20,
-0x74, 0x73, 0x65, 0x74, 0x73, 0x25b, 0x300, 0x25b, 0x20, 0x6c, 0xf9, 0x6d, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6b, 0xe0, 0x67,
-0x20, 0x6e, 0x67, 0x77, 0xf3, 0x14b, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6c, 0x65, 0x70, 0x79, 0xe8, 0x20, 0x73, 0x68, 0xfa,
-0x6d, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x63, 0xff, 0xf3, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x74, 0x73, 0x25b, 0x300, 0x25b, 0x20,
-0x63, 0xff, 0xf3, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6e, 0x6a, 0xff, 0x6f, 0x6c, 0xe1, 0x2bc, 0x3b, 0x73, 0x61, 0x14b, 0x20,
-0x74, 0x79, 0x25b, 0x300, 0x62, 0x20, 0x74, 0x79, 0x25b, 0x300, 0x62, 0x20, 0x6d, 0x62, 0x289, 0x300, 0x14b, 0x3b, 0x73, 0x61,
-0x14b, 0x20, 0x6d, 0x62, 0x289, 0x300, 0x14b, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6e, 0x67, 0x77, 0x254, 0x300, 0x2bc, 0x20, 0x6d,
-0x62, 0xff, 0x25b, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x74, 0xe0, 0x14b, 0x61, 0x20, 0x74, 0x73, 0x65, 0x74, 0x73, 0xe1, 0x2bc,
-0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6d, 0x65, 0x6a, 0x77, 0x6f, 0x14b, 0xf3, 0x3b, 0x73, 0x61, 0x14b, 0x20, 0x6c, 0xf9, 0x6d,
-0x3b, 0x57, 0x69, 0xf3, 0x74, 0x68, 0x65, 0x21f, 0x69, 0x6b, 0x61, 0x20, 0x57, 0xed, 0x3b, 0x54, 0x68, 0x69, 0x79, 0xf3,
-0x21f, 0x65, 0x79, 0x75, 0x14b, 0x6b, 0x61, 0x20, 0x57, 0xed, 0x3b, 0x49, 0x161, 0x74, 0xe1, 0x77, 0x69, 0x10d, 0x68, 0x61,
-0x79, 0x61, 0x7a, 0x61, 0x14b, 0x20, 0x57, 0xed, 0x3b, 0x50, 0x21f, 0x65, 0x17e, 0xed, 0x74, 0x21f, 0x6f, 0x20, 0x57, 0xed,
-0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x77, 0xe1, 0x70, 0x65, 0x74, 0x21f, 0x6f, 0x20, 0x57, 0xed, 0x3b, 0x57, 0xed, 0x70, 0x61,
-0x7a, 0x75, 0x6b, 0x21f, 0x61, 0x2d, 0x77, 0x61, 0x161, 0x74, 0xe9, 0x20, 0x57, 0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x70,
-0x21f, 0xe1, 0x73, 0x61, 0x70, 0x61, 0x20, 0x57, 0xed, 0x3b, 0x57, 0x61, 0x73, 0xfa, 0x74, 0x21f, 0x75, 0x14b, 0x20, 0x57,
-0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b, 0x77, 0xe1, 0x70, 0x65, 0x1e7, 0x69, 0x20, 0x57, 0xed, 0x3b, 0x10c, 0x68, 0x61, 0x14b,
-0x77, 0xe1, 0x70, 0x65, 0x2d, 0x6b, 0x61, 0x73, 0x6e, 0xe1, 0x20, 0x57, 0xed, 0x3b, 0x57, 0x61, 0x6e, 0xed, 0x79, 0x65,
-0x74, 0x75, 0x20, 0x57, 0xed, 0x3b, 0x54, 0x21f, 0x61, 0x68, 0xe9, 0x6b, 0x61, 0x70, 0x161, 0x75, 0x14b, 0x20, 0x57, 0xed,
-0x3b, 0x6a9, 0x627, 0x646, 0x648, 0x648, 0x646, 0x6cc, 0x20, 0x62f, 0x648, 0x648, 0x6d5, 0x645, 0x3b, 0x634, 0x648, 0x628, 0x627, 0x62a,
-0x3b, 0x626, 0x627, 0x632, 0x627, 0x631, 0x3b, 0x646, 0x6cc, 0x633, 0x627, 0x646, 0x3b, 0x626, 0x627, 0x6cc, 0x627, 0x631, 0x3b, 0x62d,
-0x648, 0x632, 0x6d5, 0x6cc, 0x631, 0x627, 0x646, 0x3b, 0x62a, 0x6d5, 0x645, 0x648, 0x648, 0x632, 0x3b, 0x626, 0x627, 0x628, 0x3b, 0x626,
-0x6d5, 0x6cc, 0x644, 0x648, 0x648, 0x644, 0x3b, 0x62a, 0x634, 0x631, 0x6cc, 0x646, 0x6cc, 0x20, 0x6cc, 0x6d5, 0x6a9, 0x6d5, 0x645, 0x3b,
-0x62a, 0x634, 0x631, 0x6cc, 0x646, 0x6cc, 0x20, 0x62f, 0x648, 0x648, 0x6d5, 0x645, 0x3b, 0x6a9, 0x627, 0x646, 0x648, 0x646, 0x6cc, 0x20,
-0x6cc, 0x6d5, 0x6a9, 0x6d5, 0x645, 0x3b, 0x6a9, 0x3b, 0x634, 0x3b, 0x626, 0x3b, 0x646, 0x3b, 0x626, 0x3b, 0x62d, 0x3b, 0x62a, 0x3b,
-0x626, 0x3b, 0x626, 0x3b, 0x62a, 0x3b, 0x62a, 0x3b, 0x6a9, 0x3b, 0x6a, 0x61, 0x6e, 0x3b, 0x66, 0x65, 0x62, 0x3b, 0x6d, 0x11b,
-0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b, 0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x77,
-0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x77, 0x3b, 0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61,
-0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d, 0x11b, 0x72, 0x63, 0x3b, 0x61, 0x70,
-0x72, 0x79, 0x6c, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x3b,
-0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74,
-0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62,
-0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b, 0x6d, 0x11b, 0x72, 0x2e, 0x3b, 0x61, 0x70,
-0x72, 0x2e, 0x3b, 0x6d, 0x61, 0x6a, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b, 0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x77,
-0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b, 0x6e, 0x6f, 0x77, 0x2e, 0x3b, 0x64, 0x65,
-0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x61, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x61, 0x3b,
-0x6d, 0x11b, 0x72, 0x63, 0x61, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c, 0x61, 0x3b, 0x6d, 0x61, 0x6a, 0x61, 0x3b, 0x6a, 0x75,
-0x6e, 0x69, 0x6a, 0x61, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x61, 0x3b, 0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b,
-0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x72, 0x61, 0x3b, 0x6e, 0x6f,
-0x77, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6a, 0x61, 0x6e, 0x3b,
-0x66, 0x65, 0x62, 0x3b, 0x6d, 0x11b, 0x72, 0x3b, 0x61, 0x70, 0x72, 0x3b, 0x6d, 0x65, 0x6a, 0x3b, 0x6a, 0x75, 0x6e, 0x3b,
-0x6a, 0x75, 0x6c, 0x3b, 0x61, 0x77, 0x67, 0x3b, 0x73, 0x65, 0x70, 0x3b, 0x6f, 0x6b, 0x74, 0x3b, 0x6e, 0x6f, 0x77, 0x3b,
-0x64, 0x65, 0x63, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x3b, 0x66, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x3b, 0x6d,
-0x11b, 0x72, 0x63, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c, 0x3b, 0x6d, 0x65, 0x6a, 0x61, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a,
-0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x3b, 0x61, 0x77, 0x67, 0x75, 0x73, 0x74, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d,
-0x62, 0x65, 0x72, 0x3b, 0x6f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62, 0x65, 0x72,
-0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x3b, 0x6a, 0x61, 0x6e, 0x2e, 0x3b, 0x66, 0x65, 0x62, 0x2e, 0x3b,
-0x6d, 0x11b, 0x72, 0x2e, 0x3b, 0x61, 0x70, 0x72, 0x2e, 0x3b, 0x6d, 0x65, 0x6a, 0x2e, 0x3b, 0x6a, 0x75, 0x6e, 0x2e, 0x3b,
-0x6a, 0x75, 0x6c, 0x2e, 0x3b, 0x61, 0x77, 0x67, 0x2e, 0x3b, 0x73, 0x65, 0x70, 0x2e, 0x3b, 0x6f, 0x6b, 0x74, 0x2e, 0x3b,
-0x6e, 0x6f, 0x77, 0x2e, 0x3b, 0x64, 0x65, 0x63, 0x2e, 0x3b, 0x6a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x61, 0x3b, 0x66, 0x65,
-0x62, 0x72, 0x75, 0x61, 0x72, 0x61, 0x3b, 0x6d, 0x11b, 0x72, 0x63, 0x61, 0x3b, 0x61, 0x70, 0x72, 0x79, 0x6c, 0x61, 0x3b,
-0x6d, 0x65, 0x6a, 0x65, 0x3b, 0x6a, 0x75, 0x6e, 0x69, 0x6a, 0x61, 0x3b, 0x6a, 0x75, 0x6c, 0x69, 0x6a, 0x61, 0x3b, 0x61,
-0x77, 0x67, 0x75, 0x73, 0x74, 0x61, 0x3b, 0x73, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x6f, 0x6b, 0x74,
-0x6f, 0x62, 0x72, 0x61, 0x3b, 0x6e, 0x6f, 0x77, 0x65, 0x6d, 0x62, 0x72, 0x61, 0x3b, 0x64, 0x65, 0x63, 0x65, 0x6d, 0x62,
-0x72, 0x61, 0x3b, 0x72, 0x61, 0x67, 0x3b, 0x77, 0x61, 0x73, 0x3b, 0x70, 0x16b, 0x6c, 0x3b, 0x73, 0x61, 0x6b, 0x3b, 0x7a,
-0x61, 0x6c, 0x3b, 0x73, 0x12b, 0x6d, 0x3b, 0x6c, 0x12b, 0x70, 0x3b, 0x64, 0x61, 0x67, 0x3b, 0x73, 0x69, 0x6c, 0x3b, 0x73,
-0x70, 0x61, 0x3b, 0x6c, 0x61, 0x70, 0x3b, 0x73, 0x61, 0x6c, 0x3b, 0x72, 0x61, 0x67, 0x73, 0x3b, 0x77, 0x61, 0x73, 0x73,
-0x61, 0x72, 0x69, 0x6e, 0x73, 0x3b, 0x70, 0x16b, 0x6c, 0x69, 0x73, 0x3b, 0x73, 0x61, 0x6b, 0x6b, 0x69, 0x73, 0x3b, 0x7a,
-0x61, 0x6c, 0x6c, 0x61, 0x77, 0x73, 0x3b, 0x73, 0x12b, 0x6d, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x6c, 0x12b, 0x70, 0x61, 0x3b,
-0x64, 0x61, 0x67, 0x67, 0x69, 0x73, 0x3b, 0x73, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x73, 0x3b, 0x73, 0x70, 0x61, 0x6c, 0x6c,
-0x69, 0x6e, 0x73, 0x3b, 0x6c, 0x61, 0x70, 0x6b, 0x72, 0x16b, 0x74, 0x69, 0x73, 0x3b, 0x73, 0x61, 0x6c, 0x6c, 0x61, 0x77,
-0x73, 0x3b, 0x52, 0x3b, 0x57, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x5a, 0x3b, 0x53, 0x3b, 0x4c, 0x3b, 0x44, 0x3b, 0x53, 0x3b,
-0x53, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x75, 0x111, 0x69, 0x76, 0x3b, 0x6b, 0x75, 0x6f, 0x76, 0xe2, 0x3b, 0x6e, 0x6a, 0x75,
-0x68, 0x10d, 0xe2, 0x3b, 0x63, 0x75, 0xe1, 0x14b, 0x75, 0x69, 0x3b, 0x76, 0x79, 0x65, 0x73, 0x69, 0x3b, 0x6b, 0x65, 0x73,
-0x69, 0x3b, 0x73, 0x79, 0x65, 0x69, 0x6e, 0x69, 0x3b, 0x70, 0x6f, 0x72, 0x67, 0x65, 0x3b, 0x10d, 0x6f, 0x68, 0x10d, 0xe2,
-0x3b, 0x72, 0x6f, 0x6f, 0x76, 0x76, 0xe2, 0x64, 0x3b, 0x73, 0x6b, 0x61, 0x6d, 0x6d, 0xe2, 0x3b, 0x6a, 0x75, 0x6f, 0x76,
-0x6c, 0xe2, 0x3b, 0x75, 0x111, 0x111, 0xe2, 0x69, 0x76, 0x65, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x6b, 0x75, 0x6f, 0x76,
-0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x6e, 0x6a, 0x75, 0x68, 0x10d, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x63,
-0x75, 0xe1, 0x14b, 0x75, 0x69, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x76, 0x79, 0x65, 0x73, 0x69, 0x6d, 0xe1, 0xe1, 0x6e,
-0x75, 0x3b, 0x6b, 0x65, 0x73, 0x69, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x73, 0x79, 0x65, 0x69, 0x6e, 0x69, 0x6d, 0xe1,
-0xe1, 0x6e, 0x75, 0x3b, 0x70, 0x6f, 0x72, 0x67, 0x65, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x10d, 0x6f, 0x68, 0x10d, 0xe2,
-0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x72, 0x6f, 0x6f, 0x76, 0x76, 0xe2, 0x64, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x73,
-0x6b, 0x61, 0x6d, 0x6d, 0xe2, 0x6d, 0xe1, 0xe1, 0x6e, 0x75, 0x3b, 0x6a, 0x75, 0x6f, 0x76, 0x6c, 0xe2, 0x6d, 0xe1, 0xe1,
-0x6e, 0x75, 0x3b, 0x55, 0x3b, 0x4b, 0x3b, 0x4e, 0x4a, 0x3b, 0x43, 0x3b, 0x56, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x50, 0x3b,
-0x10c, 0x3b, 0x52, 0x3b, 0x53, 0x3b, 0x4a, 0x3b, 0x62c, 0x627, 0x646, 0x6a4, 0x6cc, 0x6d5, 0x3b, 0x641, 0x626, 0x6a4, 0x631, 0x6cc,
-0x6d5, 0x3b, 0x645, 0x627, 0x631, 0x633, 0x3b, 0x622, 0x6a4, 0x631, 0x6cc, 0x644, 0x3b, 0x645, 0x626, 0x6cc, 0x3b, 0x62c, 0x648, 0x659,
-0x623, 0x646, 0x3b, 0x62c, 0x648, 0x659, 0x644, 0x627, 0x3b, 0x622, 0x6af, 0x648, 0x633, 0x62a, 0x3b, 0x633, 0x626, 0x67e, 0x62a, 0x627,
-0x645, 0x631, 0x3b, 0x626, 0x648, 0x6a9, 0x62a, 0x648, 0x6a4, 0x631, 0x3b, 0x646, 0x648, 0x6a4, 0x627, 0x645, 0x631, 0x3b, 0x62f, 0x626,
-0x633, 0x627, 0x645, 0x631, 0x3b
-};
-
-static const ushort days_data[] = {
-0x53, 0x75, 0x6e, 0x3b, 0x4d, 0x6f, 0x6e, 0x3b, 0x54, 0x75, 0x65, 0x3b, 0x57, 0x65, 0x64, 0x3b, 0x54, 0x68, 0x75, 0x3b,
-0x46, 0x72, 0x69, 0x3b, 0x53, 0x61, 0x74, 0x3b, 0x53, 0x75, 0x6e, 0x64, 0x61, 0x79, 0x3b, 0x4d, 0x6f, 0x6e, 0x64, 0x61,
-0x79, 0x3b, 0x54, 0x75, 0x65, 0x73, 0x64, 0x61, 0x79, 0x3b, 0x57, 0x65, 0x64, 0x6e, 0x65, 0x73, 0x64, 0x61, 0x79, 0x3b,
-0x54, 0x68, 0x75, 0x72, 0x73, 0x64, 0x61, 0x79, 0x3b, 0x46, 0x72, 0x69, 0x64, 0x61, 0x79, 0x3b, 0x53, 0x61, 0x74, 0x75,
-0x72, 0x64, 0x61, 0x79, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x57, 0x3b, 0x54, 0x3b, 0x46, 0x3b, 0x53, 0x3b, 0x37,
-0x3b, 0x31, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36, 0x3b, 0x44, 0x69, 0x6c, 0x3b, 0x57, 0x69, 0x78,
-0x3b, 0x51, 0x69, 0x62, 0x3b, 0x52, 0x6f, 0x62, 0x3b, 0x4b, 0x61, 0x6d, 0x3b, 0x4a, 0x69, 0x6d, 0x3b, 0x53, 0x61, 0x6e,
-0x3b, 0x44, 0x69, 0x6c, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x57, 0x69, 0x69, 0x78, 0x61, 0x74, 0x61, 0x3b, 0x51, 0x69, 0x62,
-0x78, 0x61, 0x74, 0x61, 0x3b, 0x52, 0x6f, 0x6f, 0x62, 0x69, 0x69, 0x3b, 0x4b, 0x61, 0x6d, 0x69, 0x69, 0x73, 0x61, 0x3b,
-0x4a, 0x69, 0x6d, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x53, 0x61, 0x6e, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x44, 0x3b, 0x57, 0x3b,
-0x51, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x53, 0x6f, 0x2e, 0x3b, 0x4d, 0x61, 0x2e, 0x3b, 0x44, 0x69,
-0x2e, 0x3b, 0x57, 0x6f, 0x2e, 0x3b, 0x44, 0x6f, 0x2e, 0x3b, 0x56, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0x6f,
-0x6e, 0x64, 0x61, 0x67, 0x3b, 0x4d, 0x61, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x44, 0x69, 0x6e, 0x73, 0x64, 0x61, 0x67,
-0x3b, 0x57, 0x6f, 0x65, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x44, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x64, 0x61, 0x67, 0x3b,
-0x56, 0x72, 0x79, 0x64, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x74, 0x65, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x53, 0x3b, 0x4d, 0x3b,
-0x44, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x64, 0x69, 0x65, 0x3b, 0x68, 0xeb, 0x6e, 0x3b, 0x6d, 0x61,
-0x72, 0x3b, 0x6d, 0xeb, 0x72, 0x3b, 0x65, 0x6e, 0x6a, 0x3b, 0x70, 0x72, 0x65, 0x3b, 0x73, 0x68, 0x74, 0x3b, 0x65, 0x20,
-0x64, 0x69, 0x65, 0x6c, 0x3b, 0x65, 0x20, 0x68, 0xeb, 0x6e, 0xeb, 0x3b, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x74, 0xeb, 0x3b,
-0x65, 0x20, 0x6d, 0xeb, 0x72, 0x6b, 0x75, 0x72, 0xeb, 0x3b, 0x65, 0x20, 0x65, 0x6e, 0x6a, 0x74, 0x65, 0x3b, 0x65, 0x20,
-0x70, 0x72, 0x65, 0x6d, 0x74, 0x65, 0x3b, 0x65, 0x20, 0x73, 0x68, 0x74, 0x75, 0x6e, 0xeb, 0x3b, 0x64, 0x3b, 0x68, 0x3b,
-0x6d, 0x3b, 0x6d, 0x3b, 0x65, 0x3b, 0x70, 0x3b, 0x73, 0x68, 0x3b, 0x44, 0x69, 0x65, 0x3b, 0x48, 0xeb, 0x6e, 0x3b, 0x4d,
-0x61, 0x72, 0x3b, 0x4d, 0xeb, 0x72, 0x3b, 0x45, 0x6e, 0x6a, 0x3b, 0x50, 0x72, 0x65, 0x3b, 0x53, 0x68, 0x74, 0x3b, 0x12a5,
-0x1211, 0x12f5, 0x3b, 0x1230, 0x129e, 0x3b, 0x121b, 0x12ad, 0x1230, 0x3b, 0x1228, 0x1261, 0x12d5, 0x3b, 0x1210, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d,
-0x1265, 0x3b, 0x1245, 0x12f3, 0x121c, 0x3b, 0x12a5, 0x1211, 0x12f5, 0x3b, 0x1230, 0x129e, 0x3b, 0x121b, 0x12ad, 0x1230, 0x129e, 0x3b, 0x1228, 0x1261,
-0x12d5, 0x3b, 0x1210, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d, 0x1265, 0x3b, 0x1245, 0x12f3, 0x121c, 0x3b, 0x12a5, 0x3b, 0x1230, 0x3b, 0x121b, 0x3b,
-0x1228, 0x3b, 0x1210, 0x3b, 0x12d3, 0x3b, 0x1245, 0x3b, 0x627, 0x644, 0x623, 0x62d, 0x62f, 0x3b, 0x627, 0x644, 0x627, 0x62b, 0x646, 0x64a,
-0x646, 0x3b, 0x627, 0x644, 0x62b, 0x644, 0x627, 0x62b, 0x627, 0x621, 0x3b, 0x627, 0x644, 0x623, 0x631, 0x628, 0x639, 0x627, 0x621, 0x3b,
-0x627, 0x644, 0x62e, 0x645, 0x64a, 0x633, 0x3b, 0x627, 0x644, 0x62c, 0x645, 0x639, 0x629, 0x3b, 0x627, 0x644, 0x633, 0x628, 0x62a, 0x3b,
-0x62d, 0x3b, 0x646, 0x3b, 0x62b, 0x3b, 0x631, 0x3b, 0x62e, 0x3b, 0x62c, 0x3b, 0x633, 0x3b, 0x56f, 0x56b, 0x580, 0x3b, 0x565, 0x580,
-0x56f, 0x3b, 0x565, 0x580, 0x584, 0x3b, 0x579, 0x580, 0x584, 0x3b, 0x570, 0x576, 0x563, 0x3b, 0x578, 0x582, 0x580, 0x3b, 0x577, 0x562,
-0x569, 0x3b, 0x56f, 0x56b, 0x580, 0x561, 0x56f, 0x56b, 0x3b, 0x565, 0x580, 0x56f, 0x578, 0x582, 0x577, 0x561, 0x562, 0x569, 0x56b, 0x3b,
-0x565, 0x580, 0x565, 0x584, 0x577, 0x561, 0x562, 0x569, 0x56b, 0x3b, 0x579, 0x578, 0x580, 0x565, 0x584, 0x577, 0x561, 0x562, 0x569, 0x56b,
-0x3b, 0x570, 0x56b, 0x576, 0x563, 0x577, 0x561, 0x562, 0x569, 0x56b, 0x3b, 0x578, 0x582, 0x580, 0x562, 0x561, 0x569, 0x3b, 0x577, 0x561,
-0x562, 0x561, 0x569, 0x3b, 0x53f, 0x3b, 0x535, 0x3b, 0x535, 0x3b, 0x549, 0x3b, 0x540, 0x3b, 0x548, 0x3b, 0x547, 0x3b, 0x9a6, 0x9c7,
-0x993, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x3b,
-0x9b6, 0x9c1, 0x995, 0x9cd, 0x9f0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x3b, 0x9a6, 0x9c7, 0x993, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b8, 0x9cb, 0x9ae,
-0x9ac, 0x9be, 0x9f0, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x9ac, 0x9be, 0x9f0, 0x3b,
-0x9ac, 0x9c3, 0x9b9, 0x9b8, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9f0, 0x9ac, 0x9be, 0x9f0,
-0x3b, 0x9b6, 0x9a8, 0x9bf, 0x9ac, 0x9be, 0x9f0, 0x3b, 0x9a6, 0x3b, 0x9b8, 0x3b, 0x9ae, 0x3b, 0x9ac, 0x3b, 0x9ac, 0x3b, 0x9b6, 0x3b,
-0x9b6, 0x3b, 0x42, 0x2e, 0x3b, 0x42, 0x2e, 0x45, 0x2e, 0x3b, 0xc7, 0x2e, 0x41, 0x2e, 0x3b, 0xc7, 0x2e, 0x3b, 0x43, 0x2e,
-0x41, 0x2e, 0x3b, 0x43, 0x2e, 0x3b, 0x15e, 0x2e, 0x3b, 0x62, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x62, 0x61, 0x7a, 0x61, 0x72,
-0x20, 0x65, 0x72, 0x74, 0x259, 0x73, 0x69, 0x3b, 0xe7, 0x259, 0x72, 0x15f, 0x259, 0x6e, 0x62, 0x259, 0x20, 0x61, 0x78, 0x15f,
-0x61, 0x6d, 0x131, 0x3b, 0xe7, 0x259, 0x72, 0x15f, 0x259, 0x6e, 0x62, 0x259, 0x3b, 0x63, 0xfc, 0x6d, 0x259, 0x20, 0x61, 0x78,
-0x15f, 0x61, 0x6d, 0x131, 0x3b, 0x63, 0xfc, 0x6d, 0x259, 0x3b, 0x15f, 0x259, 0x6e, 0x62, 0x259, 0x3b, 0x411, 0x2e, 0x3b, 0x411,
-0x2e, 0x415, 0x2e, 0x3b, 0x427, 0x2e, 0x410, 0x2e, 0x3b, 0x427, 0x2e, 0x3b, 0x4b8, 0x2e, 0x410, 0x2e, 0x3b, 0x4b8, 0x2e, 0x3b,
-0x428, 0x2e, 0x3b, 0x431, 0x430, 0x437, 0x430, 0x440, 0x3b, 0x431, 0x430, 0x437, 0x430, 0x440, 0x20, 0x435, 0x440, 0x442, 0x4d9, 0x441,
-0x438, 0x3b, 0x447, 0x4d9, 0x440, 0x448, 0x4d9, 0x43d, 0x431, 0x4d9, 0x20, 0x430, 0x445, 0x448, 0x430, 0x43c, 0x44b, 0x3b, 0x447, 0x4d9,
-0x440, 0x448, 0x4d9, 0x43d, 0x431, 0x4d9, 0x3b, 0x4b9, 0x4af, 0x43c, 0x4d9, 0x20, 0x430, 0x445, 0x448, 0x430, 0x43c, 0x44b, 0x3b, 0x4b9,
-0x4af, 0x43c, 0x4d9, 0x3b, 0x448, 0x4d9, 0x43d, 0x431, 0x4d9, 0x3b, 0x69, 0x67, 0x2e, 0x3b, 0x61, 0x6c, 0x2e, 0x3b, 0x61, 0x72,
-0x2e, 0x3b, 0x61, 0x7a, 0x2e, 0x3b, 0x6f, 0x67, 0x2e, 0x3b, 0x6f, 0x72, 0x2e, 0x3b, 0x6c, 0x72, 0x2e, 0x3b, 0x69, 0x67,
-0x61, 0x6e, 0x64, 0x65, 0x61, 0x3b, 0x61, 0x73, 0x74, 0x65, 0x6c, 0x65, 0x68, 0x65, 0x6e, 0x61, 0x3b, 0x61, 0x73, 0x74,
-0x65, 0x61, 0x72, 0x74, 0x65, 0x61, 0x3b, 0x61, 0x73, 0x74, 0x65, 0x61, 0x7a, 0x6b, 0x65, 0x6e, 0x61, 0x3b, 0x6f, 0x73,
-0x74, 0x65, 0x67, 0x75, 0x6e, 0x61, 0x3b, 0x6f, 0x73, 0x74, 0x69, 0x72, 0x61, 0x6c, 0x61, 0x3b, 0x6c, 0x61, 0x72, 0x75,
-0x6e, 0x62, 0x61, 0x74, 0x61, 0x3b, 0x49, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x4f, 0x3b, 0x4f, 0x3b, 0x4c, 0x3b,
-0x9b0, 0x9ac, 0x9bf, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x3b, 0x9ac, 0x9c1, 0x9a7, 0x3b, 0x9ac, 0x9c3,
-0x9b9, 0x9b8, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 0x3b, 0x9b6, 0x9c1, 0x995, 0x9cd, 0x9b0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x3b, 0x9b0, 0x9ac, 0x9bf,
-0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b8, 0x9cb, 0x9ae, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ae, 0x999, 0x9cd, 0x997, 0x9b2, 0x9ac, 0x9be, 0x9b0, 0x3b,
-0x9ac, 0x9c1, 0x9a7, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9ac, 0x9c3, 0x9b9, 0x9b8, 0x9cd, 0x9aa, 0x9a4, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b6,
-0x9c1, 0x995, 0x9cd, 0x9b0, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b6, 0x9a8, 0x9bf, 0x9ac, 0x9be, 0x9b0, 0x3b, 0x9b0, 0x3b, 0x9b8, 0x9cb, 0x3b,
-0x9ae, 0x3b, 0x9ac, 0x9c1, 0x3b, 0x9ac, 0x9c3, 0x3b, 0x9b6, 0x9c1, 0x3b, 0x9b6, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0x3b, 0xf58, 0xf72, 0xf62,
-0xf0b, 0x3b, 0xf63, 0xfb7, 0xf42, 0xf0b, 0x3b, 0xf55, 0xf74, 0xf62, 0xf0b, 0x3b, 0xf66, 0xf44, 0xf66, 0xf0b, 0x3b, 0xf66, 0xfa4, 0xf7a,
-0xf53, 0xf0b, 0x3b, 0xf49, 0xf72, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60,
-0xf0b, 0xf58, 0xf72, 0xf42, 0xf0b, 0xf51, 0xf58, 0xf62, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf63, 0xfb7, 0xf42, 0xf0b, 0xf54, 0xf0b,
-0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf55, 0xf74, 0xf62, 0xf0b, 0xf56, 0xf74, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf54, 0xf0b, 0xf66,
-0xf44, 0xf66, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b,
-0xf49, 0xf72, 0xf0b, 0xf58, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0x3b, 0xf58, 0xf72, 0xf62, 0x3b, 0xf63, 0xfb7, 0xf42, 0x3b, 0xf55, 0xf74, 0xf62,
-0x3b, 0xf66, 0xf44, 0xfb6, 0x3b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0x3b, 0xf49, 0xf72, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x75, 0x6e,
-0x3b, 0x4d, 0x65, 0x75, 0x2e, 0x3b, 0x4d, 0x65, 0x72, 0x2e, 0x3b, 0x59, 0x61, 0x6f, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x2e,
-0x3b, 0x53, 0x61, 0x64, 0x2e, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x65, 0x75, 0x72, 0x7a, 0x68,
-0x3b, 0x4d, 0x65, 0x72, 0x63, 0x2bc, 0x68, 0x65, 0x72, 0x3b, 0x59, 0x61, 0x6f, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x65,
-0x72, 0x3b, 0x53, 0x61, 0x64, 0x6f, 0x72, 0x6e, 0x3b, 0x53, 0x75, 0x3b, 0x4c, 0x3b, 0x4d, 0x7a, 0x3b, 0x4d, 0x63, 0x3b,
-0x59, 0x3b, 0x47, 0x3b, 0x53, 0x61, 0x3b, 0x43d, 0x434, 0x3b, 0x43f, 0x43d, 0x3b, 0x432, 0x442, 0x3b, 0x441, 0x440, 0x3b, 0x447,
-0x442, 0x3b, 0x43f, 0x442, 0x3b, 0x441, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x435, 0x43b, 0x44f, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434,
-0x435, 0x43b, 0x43d, 0x438, 0x43a, 0x3b, 0x432, 0x442, 0x43e, 0x440, 0x43d, 0x438, 0x43a, 0x3b, 0x441, 0x440, 0x44f, 0x434, 0x430, 0x3b,
-0x447, 0x435, 0x442, 0x432, 0x44a, 0x440, 0x442, 0x44a, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x44a, 0x43a, 0x3b, 0x441, 0x44a, 0x431, 0x43e,
-0x442, 0x430, 0x3b, 0x43d, 0x3b, 0x43f, 0x3b, 0x432, 0x3b, 0x441, 0x3b, 0x447, 0x3b, 0x43f, 0x3b, 0x441, 0x3b, 0x1010, 0x1014, 0x1004,
-0x103a, 0x1039, 0x1002, 0x1014, 0x103d, 0x1031, 0x3b, 0x1010, 0x1014, 0x1004, 0x103a, 0x1039, 0x101c, 0x102c, 0x3b, 0x1021, 0x1004, 0x103a, 0x1039, 0x1002,
-0x102b, 0x3b, 0x1017, 0x102f, 0x1012, 0x1039, 0x1013, 0x101f, 0x1030, 0x1038, 0x3b, 0x1000, 0x103c, 0x102c, 0x101e, 0x1015, 0x1010, 0x1031, 0x1038, 0x3b,
-0x101e, 0x1031, 0x102c, 0x1000, 0x103c, 0x102c, 0x3b, 0x1005, 0x1014, 0x1031, 0x3b, 0x1010, 0x3b, 0x1010, 0x3b, 0x1021, 0x3b, 0x1017, 0x3b, 0x1000,
-0x3b, 0x101e, 0x3b, 0x1005, 0x3b, 0x43d, 0x434, 0x3b, 0x43f, 0x43d, 0x3b, 0x430, 0x45e, 0x3b, 0x441, 0x440, 0x3b, 0x447, 0x446, 0x3b,
-0x43f, 0x442, 0x3b, 0x441, 0x431, 0x3b, 0x43d, 0x44f, 0x434, 0x437, 0x435, 0x43b, 0x44f, 0x3b, 0x43f, 0x430, 0x43d, 0x44f, 0x434, 0x437,
-0x435, 0x43b, 0x430, 0x43a, 0x3b, 0x430, 0x45e, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b, 0x441, 0x435, 0x440, 0x430, 0x434, 0x430, 0x3b,
-0x447, 0x430, 0x446, 0x432, 0x435, 0x440, 0x3b, 0x43f, 0x44f, 0x442, 0x43d, 0x456, 0x446, 0x430, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442,
-0x430, 0x3b, 0x43d, 0x3b, 0x43f, 0x3b, 0x430, 0x3b, 0x441, 0x3b, 0x447, 0x3b, 0x43f, 0x3b, 0x441, 0x3b, 0x17a2, 0x17b6, 0x1791, 0x17b7,
-0x178f, 0x17d2, 0x1799, 0x3b, 0x1785, 0x1793, 0x17d2, 0x1791, 0x3b, 0x17a2, 0x1784, 0x17d2, 0x1782, 0x17b6, 0x179a, 0x3b, 0x1796, 0x17bb, 0x1792, 0x3b,
-0x1796, 0x17d2, 0x179a, 0x17a0, 0x3b, 0x179f, 0x17bb, 0x1780, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17c5, 0x179a, 0x17cd, 0x3b, 0x17a2, 0x17b6, 0x1791, 0x17b7,
-0x178f, 0x17d2, 0x1799, 0x3b, 0x1785, 0x1793, 0x17d2, 0x1791, 0x3b, 0x17a2, 0x1784, 0x17d2, 0x1782, 0x17b6, 0x179a, 0x3b, 0x1796, 0x17bb, 0x1792, 0x3b,
-0x1796, 0x17d2, 0x179a, 0x17a0, 0x179f, 0x17d2, 0x1794, 0x178f, 0x17b7, 0x17cd, 0x3b, 0x179f, 0x17bb, 0x1780, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17c5, 0x179a,
-0x17cd, 0x3b, 0x17a2, 0x3b, 0x1785, 0x3b, 0x17a2, 0x3b, 0x1796, 0x3b, 0x1796, 0x3b, 0x179f, 0x3b, 0x179f, 0x3b, 0x17a2, 0x17b6, 0x1791, 0x17b7,
-0x178f, 0x17d2, 0x1799, 0x3b, 0x1785, 0x17d0, 0x1793, 0x17d2, 0x1791, 0x3b, 0x17a2, 0x1784, 0x17d2, 0x1782, 0x17b6, 0x179a, 0x3b, 0x1796, 0x17bb, 0x1792,
-0x3b, 0x1796, 0x17d2, 0x179a, 0x17a0, 0x179f, 0x17d2, 0x1794, 0x178f, 0x17b7, 0x17cd, 0x3b, 0x179f, 0x17bb, 0x1780, 0x17d2, 0x179a, 0x3b, 0x179f, 0x17c5,
-0x179a, 0x17cd, 0x3b, 0x64, 0x67, 0x2e, 0x3b, 0x64, 0x6c, 0x2e, 0x3b, 0x64, 0x74, 0x2e, 0x3b, 0x64, 0x63, 0x2e, 0x3b, 0x64,
-0x6a, 0x2e, 0x3b, 0x64, 0x76, 0x2e, 0x3b, 0x64, 0x73, 0x2e, 0x3b, 0x64, 0x69, 0x75, 0x6d, 0x65, 0x6e, 0x67, 0x65, 0x3b,
-0x64, 0x69, 0x6c, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x64, 0x69, 0x6d, 0x61, 0x72, 0x74, 0x73, 0x3b, 0x64, 0x69, 0x6d, 0x65,
-0x63, 0x72, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x6a, 0x6f, 0x75, 0x73, 0x3b, 0x64, 0x69, 0x76, 0x65, 0x6e, 0x64, 0x72, 0x65,
-0x73, 0x3b, 0x64, 0x69, 0x73, 0x73, 0x61, 0x62, 0x74, 0x65, 0x3b, 0x64, 0x67, 0x3b, 0x64, 0x6c, 0x3b, 0x64, 0x74, 0x3b,
-0x64, 0x63, 0x3b, 0x64, 0x6a, 0x3b, 0x64, 0x76, 0x3b, 0x64, 0x73, 0x3b, 0x5468, 0x65e5, 0x3b, 0x5468, 0x4e00, 0x3b, 0x5468, 0x4e8c,
-0x3b, 0x5468, 0x4e09, 0x3b, 0x5468, 0x56db, 0x3b, 0x5468, 0x4e94, 0x3b, 0x5468, 0x516d, 0x3b, 0x661f, 0x671f, 0x65e5, 0x3b, 0x661f, 0x671f, 0x4e00,
-0x3b, 0x661f, 0x671f, 0x4e8c, 0x3b, 0x661f, 0x671f, 0x4e09, 0x3b, 0x661f, 0x671f, 0x56db, 0x3b, 0x661f, 0x671f, 0x4e94, 0x3b, 0x661f, 0x671f, 0x516d,
-0x3b, 0x65e5, 0x3b, 0x4e00, 0x3b, 0x4e8c, 0x3b, 0x4e09, 0x3b, 0x56db, 0x3b, 0x4e94, 0x3b, 0x516d, 0x3b, 0x9031, 0x65e5, 0x3b, 0x9031, 0x4e00,
-0x3b, 0x9031, 0x4e8c, 0x3b, 0x9031, 0x4e09, 0x3b, 0x9031, 0x56db, 0x3b, 0x9031, 0x4e94, 0x3b, 0x9031, 0x516d, 0x3b, 0x6e, 0x65, 0x64, 0x3b,
-0x70, 0x6f, 0x6e, 0x3b, 0x75, 0x74, 0x6f, 0x3b, 0x73, 0x72, 0x69, 0x3b, 0x10d, 0x65, 0x74, 0x3b, 0x70, 0x65, 0x74, 0x3b,
-0x73, 0x75, 0x62, 0x3b, 0x6e, 0x65, 0x64, 0x6a, 0x65, 0x6c, 0x6a, 0x61, 0x3b, 0x70, 0x6f, 0x6e, 0x65, 0x64, 0x6a, 0x65,
-0x6c, 0x6a, 0x61, 0x6b, 0x3b, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x6b, 0x3b, 0x73, 0x72, 0x69, 0x6a, 0x65, 0x64, 0x61, 0x3b,
-0x10d, 0x65, 0x74, 0x76, 0x72, 0x74, 0x61, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x61, 0x6b, 0x3b, 0x73, 0x75, 0x62, 0x6f, 0x74,
-0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x75, 0x3b, 0x73, 0x3b, 0x10d, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x4e, 0x3b, 0x50, 0x3b,
-0x55, 0x3b, 0x53, 0x3b, 0x10c, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x6e, 0x65, 0x3b, 0x70, 0x6f, 0x3b, 0xfa, 0x74, 0x3b, 0x73,
-0x74, 0x3b, 0x10d, 0x74, 0x3b, 0x70, 0xe1, 0x3b, 0x73, 0x6f, 0x3b, 0x6e, 0x65, 0x64, 0x11b, 0x6c, 0x65, 0x3b, 0x70, 0x6f,
-0x6e, 0x64, 0x11b, 0x6c, 0xed, 0x3b, 0xfa, 0x74, 0x65, 0x72, 0xfd, 0x3b, 0x73, 0x74, 0x159, 0x65, 0x64, 0x61, 0x3b, 0x10d,
-0x74, 0x76, 0x72, 0x74, 0x65, 0x6b, 0x3b, 0x70, 0xe1, 0x74, 0x65, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b,
-0x4e, 0x3b, 0x50, 0x3b, 0xda, 0x3b, 0x53, 0x3b, 0x10c, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x73, 0xf8, 0x6e, 0x3b, 0x6d, 0x61,
-0x6e, 0x3b, 0x74, 0x69, 0x72, 0x3b, 0x6f, 0x6e, 0x73, 0x3b, 0x74, 0x6f, 0x72, 0x3b, 0x66, 0x72, 0x65, 0x3b, 0x6c, 0xf8,
-0x72, 0x3b, 0x73, 0xf8, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x69, 0x72, 0x73,
-0x64, 0x61, 0x67, 0x3b, 0x6f, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x66,
-0x72, 0x65, 0x64, 0x61, 0x67, 0x3b, 0x6c, 0xf8, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x4f,
-0x3b, 0x54, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x73, 0xf8, 0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x6e, 0x2e, 0x3b, 0x74, 0x69, 0x72,
-0x2e, 0x3b, 0x6f, 0x6e, 0x73, 0x2e, 0x3b, 0x74, 0x6f, 0x72, 0x2e, 0x3b, 0x66, 0x72, 0x65, 0x2e, 0x3b, 0x6c, 0xf8, 0x72,
-0x2e, 0x3b, 0x7a, 0x6f, 0x3b, 0x6d, 0x61, 0x3b, 0x64, 0x69, 0x3b, 0x77, 0x6f, 0x3b, 0x64, 0x6f, 0x3b, 0x76, 0x72, 0x3b,
-0x7a, 0x61, 0x3b, 0x7a, 0x6f, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0x61, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x64, 0x69,
-0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x77, 0x6f, 0x65, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x64, 0x6f, 0x6e, 0x64, 0x65,
-0x72, 0x64, 0x61, 0x67, 0x3b, 0x76, 0x72, 0x69, 0x6a, 0x64, 0x61, 0x67, 0x3b, 0x7a, 0x61, 0x74, 0x65, 0x72, 0x64, 0x61,
-0x67, 0x3b, 0x5a, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x56, 0x3b, 0x5a, 0x3b, 0x53, 0x75, 0x2e, 0x3b,
-0x4d, 0x2e, 0x3b, 0x54, 0x75, 0x2e, 0x3b, 0x57, 0x2e, 0x3b, 0x54, 0x68, 0x2e, 0x3b, 0x46, 0x2e, 0x3b, 0x53, 0x61, 0x2e,
-0x3b, 0x53, 0x75, 0x6e, 0x2e, 0x3b, 0x4d, 0x6f, 0x6e, 0x2e, 0x3b, 0x54, 0x75, 0x65, 0x2e, 0x3b, 0x57, 0x65, 0x64, 0x2e,
-0x3b, 0x54, 0x68, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x69, 0x2e, 0x3b, 0x53, 0x61, 0x74, 0x2e, 0x3b, 0x64, 0x69, 0x3b, 0x6c,
-0x75, 0x3b, 0x6d, 0x61, 0x3b, 0x6d, 0x65, 0x3b, 0x135, 0x61, 0x3b, 0x76, 0x65, 0x3b, 0x73, 0x61, 0x3b, 0x64, 0x69, 0x6d,
-0x61, 0x6e, 0x109, 0x6f, 0x3b, 0x6c, 0x75, 0x6e, 0x64, 0x6f, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x6f, 0x3b, 0x6d, 0x65, 0x72,
-0x6b, 0x72, 0x65, 0x64, 0x6f, 0x3b, 0x135, 0x61, 0x16d, 0x64, 0x6f, 0x3b, 0x76, 0x65, 0x6e, 0x64, 0x72, 0x65, 0x64, 0x6f,
-0x3b, 0x73, 0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x134, 0x3b, 0x56, 0x3b,
-0x53, 0x3b, 0x50, 0x3b, 0x45, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x52, 0x3b, 0x4c, 0x3b, 0x70, 0xfc, 0x68, 0x61,
-0x70, 0xe4, 0x65, 0x76, 0x3b, 0x65, 0x73, 0x6d, 0x61, 0x73, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x74, 0x65, 0x69, 0x73, 0x69,
-0x70, 0xe4, 0x65, 0x76, 0x3b, 0x6b, 0x6f, 0x6c, 0x6d, 0x61, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x6e, 0x65, 0x6c, 0x6a, 0x61,
-0x70, 0xe4, 0x65, 0x76, 0x3b, 0x72, 0x65, 0x65, 0x64, 0x65, 0x3b, 0x6c, 0x61, 0x75, 0x70, 0xe4, 0x65, 0x76, 0x3b, 0x73,
-0x75, 0x6e, 0x3b, 0x6d, 0xe1, 0x6e, 0x3b, 0x74, 0xfd, 0x73, 0x3b, 0x6d, 0x69, 0x6b, 0x3b, 0x68, 0xf3, 0x73, 0x3b, 0x66,
-0x72, 0xed, 0x3b, 0x6c, 0x65, 0x79, 0x3b, 0x73, 0x75, 0x6e, 0x6e, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6d, 0xe1,
-0x6e, 0x61, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x74, 0xfd, 0x73, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6d, 0x69, 0x6b,
-0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x68, 0xf3, 0x73, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x66, 0x72, 0xed, 0x67,
-0x67, 0x6a, 0x61, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6c, 0x65, 0x79, 0x67, 0x61, 0x72, 0x64, 0x61, 0x67, 0x75, 0x72,
-0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x73, 0x75, 0x6e, 0x2e, 0x3b,
-0x6d, 0xe1, 0x6e, 0x2e, 0x3b, 0x74, 0xfd, 0x73, 0x2e, 0x3b, 0x6d, 0x69, 0x6b, 0x2e, 0x3b, 0x68, 0xf3, 0x73, 0x2e, 0x3b,
-0x66, 0x72, 0xed, 0x2e, 0x3b, 0x6c, 0x65, 0x79, 0x2e, 0x3b, 0x73, 0x75, 0x3b, 0x6d, 0x61, 0x3b, 0x74, 0x69, 0x3b, 0x6b,
-0x65, 0x3b, 0x74, 0x6f, 0x3b, 0x70, 0x65, 0x3b, 0x6c, 0x61, 0x3b, 0x73, 0x75, 0x6e, 0x6e, 0x75, 0x6e, 0x74, 0x61, 0x69,
-0x3b, 0x6d, 0x61, 0x61, 0x6e, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x3b, 0x74, 0x69, 0x69, 0x73, 0x74, 0x61, 0x69, 0x3b, 0x6b,
-0x65, 0x73, 0x6b, 0x69, 0x76, 0x69, 0x69, 0x6b, 0x6b, 0x6f, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x74, 0x61, 0x69, 0x3b, 0x70,
-0x65, 0x72, 0x6a, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x3b, 0x6c, 0x61, 0x75, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x3b, 0x53, 0x3b,
-0x4d, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x50, 0x3b, 0x4c, 0x3b, 0x73, 0x75, 0x6e, 0x6e, 0x75, 0x6e, 0x74, 0x61,
-0x69, 0x6e, 0x61, 0x3b, 0x6d, 0x61, 0x61, 0x6e, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x74, 0x69, 0x69, 0x73,
-0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x6b, 0x65, 0x73, 0x6b, 0x69, 0x76, 0x69, 0x69, 0x6b, 0x6b, 0x6f, 0x6e, 0x61, 0x3b,
-0x74, 0x6f, 0x72, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x70, 0x65, 0x72, 0x6a, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x6e,
-0x61, 0x3b, 0x6c, 0x61, 0x75, 0x61, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x61, 0x3b, 0x64, 0x69, 0x6d, 0x2e, 0x3b, 0x6c, 0x75,
-0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d, 0x65, 0x72, 0x2e, 0x3b, 0x6a, 0x65, 0x75, 0x2e, 0x3b, 0x76, 0x65,
-0x6e, 0x2e, 0x3b, 0x73, 0x61, 0x6d, 0x2e, 0x3b, 0x64, 0x69, 0x6d, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x3b, 0x6c, 0x75, 0x6e,
-0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x69, 0x3b, 0x6d, 0x65, 0x72, 0x63, 0x72, 0x65, 0x64, 0x69, 0x3b, 0x6a, 0x65,
-0x75, 0x64, 0x69, 0x3b, 0x76, 0x65, 0x6e, 0x64, 0x72, 0x65, 0x64, 0x69, 0x3b, 0x73, 0x61, 0x6d, 0x65, 0x64, 0x69, 0x3b,
-0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x73, 0x69, 0x3b, 0x6d, 0x6f, 0x3b,
-0x74, 0x69, 0x3b, 0x77, 0x6f, 0x3b, 0x74, 0x6f, 0x3b, 0x66, 0x72, 0x3b, 0x73, 0x6f, 0x3b, 0x73, 0x6e, 0x65, 0x69, 0x6e,
-0x3b, 0x6d, 0x6f, 0x61, 0x6e, 0x64, 0x65, 0x69, 0x3b, 0x74, 0x69, 0x69, 0x73, 0x64, 0x65, 0x69, 0x3b, 0x77, 0x6f, 0x61,
-0x6e, 0x73, 0x64, 0x65, 0x69, 0x3b, 0x74, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x73, 0x64, 0x65, 0x69, 0x3b, 0x66, 0x72, 0x65,
-0x65, 0x64, 0x3b, 0x73, 0x6e, 0x65, 0x6f, 0x6e, 0x3b, 0x44, 0x69, 0x44, 0x3b, 0x44, 0x69, 0x4c, 0x3b, 0x44, 0x69, 0x4d,
-0x3b, 0x44, 0x69, 0x43, 0x3b, 0x44, 0x69, 0x61, 0x3b, 0x44, 0x69, 0x68, 0x3b, 0x44, 0x69, 0x53, 0x3b, 0x44, 0x69, 0x44,
-0xf2, 0x6d, 0x68, 0x6e, 0x61, 0x69, 0x63, 0x68, 0x3b, 0x44, 0x69, 0x4c, 0x75, 0x61, 0x69, 0x6e, 0x3b, 0x44, 0x69, 0x4d,
-0xe0, 0x69, 0x72, 0x74, 0x3b, 0x44, 0x69, 0x43, 0x69, 0x61, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x44, 0x69, 0x61, 0x72, 0x44,
-0x61, 0x6f, 0x69, 0x6e, 0x3b, 0x44, 0x69, 0x68, 0x41, 0x6f, 0x69, 0x6e, 0x65, 0x3b, 0x44, 0x69, 0x53, 0x61, 0x74, 0x68,
-0x61, 0x69, 0x72, 0x6e, 0x65, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x43, 0x3b, 0x41, 0x3b, 0x48, 0x3b, 0x53, 0x3b,
-0x44, 0x6f, 0x6d, 0x2e, 0x3b, 0x4c, 0x75, 0x6e, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x2e, 0x3b, 0x4d, 0xe9, 0x72, 0x2e, 0x3b,
-0x58, 0x6f, 0x76, 0x2e, 0x3b, 0x56, 0x65, 0x6e, 0x2e, 0x3b, 0x53, 0xe1, 0x62, 0x2e, 0x3b, 0x44, 0x6f, 0x6d, 0x69, 0x6e,
-0x67, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x4d, 0xe9, 0x72, 0x63, 0x6f,
-0x72, 0x65, 0x73, 0x3b, 0x58, 0x6f, 0x76, 0x65, 0x73, 0x3b, 0x56, 0x65, 0x6e, 0x72, 0x65, 0x73, 0x3b, 0x53, 0xe1, 0x62,
-0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x58, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x64, 0x6f,
-0x6d, 0x2e, 0x3b, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d, 0xe9, 0x72, 0x2e, 0x3b, 0x78, 0x6f,
-0x76, 0x2e, 0x3b, 0x76, 0x65, 0x6e, 0x2e, 0x3b, 0x73, 0xe1, 0x62, 0x2e, 0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f,
-0x3b, 0x6c, 0x75, 0x6e, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x6d, 0xe9, 0x72, 0x63, 0x6f, 0x72, 0x65,
-0x73, 0x3b, 0x78, 0x6f, 0x76, 0x65, 0x73, 0x3b, 0x76, 0x65, 0x6e, 0x72, 0x65, 0x73, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64,
-0x6f, 0x3b, 0x64, 0x2e, 0x3b, 0x6c, 0x2e, 0x3b, 0x6d, 0x2e, 0x3b, 0x6d, 0x2e, 0x3b, 0x78, 0x2e, 0x3b, 0x76, 0x2e, 0x3b,
-0x73, 0x2e, 0x3b, 0x10d9, 0x10d5, 0x10d8, 0x3b, 0x10dd, 0x10e0, 0x10e8, 0x3b, 0x10e1, 0x10d0, 0x10db, 0x3b, 0x10dd, 0x10d7, 0x10ee, 0x3b, 0x10ee,
-0x10e3, 0x10d7, 0x3b, 0x10de, 0x10d0, 0x10e0, 0x3b, 0x10e8, 0x10d0, 0x10d1, 0x3b, 0x10d9, 0x10d5, 0x10d8, 0x10e0, 0x10d0, 0x3b, 0x10dd, 0x10e0, 0x10e8,
-0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10e1, 0x10d0, 0x10db, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10dd, 0x10d7, 0x10ee, 0x10e8,
-0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10ee, 0x10e3, 0x10d7, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10de, 0x10d0, 0x10e0, 0x10d0,
-0x10e1, 0x10d9, 0x10d4, 0x10d5, 0x10d8, 0x3b, 0x10e8, 0x10d0, 0x10d1, 0x10d0, 0x10d7, 0x10d8, 0x3b, 0x10d9, 0x3b, 0x10dd, 0x3b, 0x10e1, 0x3b, 0x10dd,
-0x3b, 0x10ee, 0x3b, 0x10de, 0x3b, 0x10e8, 0x3b, 0x53, 0x6f, 0x3b, 0x4d, 0x6f, 0x3b, 0x44, 0x69, 0x3b, 0x4d, 0x69, 0x3b, 0x44,
-0x6f, 0x3b, 0x46, 0x72, 0x3b, 0x53, 0x61, 0x3b, 0x53, 0x6f, 0x6e, 0x6e, 0x74, 0x61, 0x67, 0x3b, 0x4d, 0x6f, 0x6e, 0x74,
-0x61, 0x67, 0x3b, 0x44, 0x69, 0x65, 0x6e, 0x73, 0x74, 0x61, 0x67, 0x3b, 0x4d, 0x69, 0x74, 0x74, 0x77, 0x6f, 0x63, 0x68,
-0x3b, 0x44, 0x6f, 0x6e, 0x6e, 0x65, 0x72, 0x73, 0x74, 0x61, 0x67, 0x3b, 0x46, 0x72, 0x65, 0x69, 0x74, 0x61, 0x67, 0x3b,
-0x53, 0x61, 0x6d, 0x73, 0x74, 0x61, 0x67, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x46, 0x3b,
-0x53, 0x3b, 0x53, 0x6f, 0x2e, 0x3b, 0x4d, 0x6f, 0x2e, 0x3b, 0x44, 0x69, 0x2e, 0x3b, 0x4d, 0x69, 0x2e, 0x3b, 0x44, 0x6f,
-0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x39a, 0x3c5, 0x3c1, 0x3b, 0x394, 0x3b5, 0x3c5, 0x3b, 0x3a4, 0x3c1,
-0x3af, 0x3b, 0x3a4, 0x3b5, 0x3c4, 0x3b, 0x3a0, 0x3ad, 0x3bc, 0x3b, 0x3a0, 0x3b1, 0x3c1, 0x3b, 0x3a3, 0x3ac, 0x3b2, 0x3b, 0x39a, 0x3c5,
-0x3c1, 0x3b9, 0x3b1, 0x3ba, 0x3ae, 0x3b, 0x394, 0x3b5, 0x3c5, 0x3c4, 0x3ad, 0x3c1, 0x3b1, 0x3b, 0x3a4, 0x3c1, 0x3af, 0x3c4, 0x3b7, 0x3b,
-0x3a4, 0x3b5, 0x3c4, 0x3ac, 0x3c1, 0x3c4, 0x3b7, 0x3b, 0x3a0, 0x3ad, 0x3bc, 0x3c0, 0x3c4, 0x3b7, 0x3b, 0x3a0, 0x3b1, 0x3c1, 0x3b1, 0x3c3,
-0x3ba, 0x3b5, 0x3c5, 0x3ae, 0x3b, 0x3a3, 0x3ac, 0x3b2, 0x3b2, 0x3b1, 0x3c4, 0x3bf, 0x3b, 0x39a, 0x3b, 0x394, 0x3b, 0x3a4, 0x3b, 0x3a4,
-0x3b, 0x3a0, 0x3b, 0x3a0, 0x3b, 0x3a3, 0x3b, 0x73, 0x61, 0x70, 0x3b, 0x61, 0x74, 0x61, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x70,
-0x69, 0x6e, 0x3b, 0x73, 0x69, 0x73, 0x3b, 0x74, 0x61, 0x6c, 0x3b, 0x61, 0x72, 0x66, 0x3b, 0x73, 0x61, 0x70, 0x61, 0x61,
-0x74, 0x3b, 0x61, 0x74, 0x61, 0x61, 0x73, 0x69, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x6d, 0x61, 0x72,
-0x6c, 0x75, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x70, 0x69, 0x6e, 0x67, 0x61, 0x73, 0x75, 0x6e, 0x6e,
-0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x73, 0x69, 0x73, 0x61, 0x6d, 0x61, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65,
-0x71, 0x3b, 0x74, 0x61, 0x6c, 0x6c, 0x69, 0x6d, 0x61, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x61, 0x72,
-0x66, 0x69, 0x6e, 0x69, 0x6e, 0x6e, 0x67, 0x6f, 0x72, 0x6e, 0x65, 0x71, 0x3b, 0x53, 0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x50,
-0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0xab0, 0xab5, 0xabf, 0x3b, 0xab8, 0xacb, 0xaae, 0x3b, 0xaae, 0xa82, 0xa97, 0xab3, 0x3b,
-0xaac, 0xac1, 0xaa7, 0x3b, 0xa97, 0xac1, 0xab0, 0xac1, 0x3b, 0xab6, 0xac1, 0xa95, 0xacd, 0xab0, 0x3b, 0xab6, 0xaa8, 0xabf, 0x3b, 0xab0,
-0xab5, 0xabf, 0xab5, 0xabe, 0xab0, 0x3b, 0xab8, 0xacb, 0xaae, 0xab5, 0xabe, 0xab0, 0x3b, 0xaae, 0xa82, 0xa97, 0xab3, 0xab5, 0xabe, 0xab0,
-0x3b, 0xaac, 0xac1, 0xaa7, 0xab5, 0xabe, 0xab0, 0x3b, 0xa97, 0xac1, 0xab0, 0xac1, 0xab5, 0xabe, 0xab0, 0x3b, 0xab6, 0xac1, 0xa95, 0xacd,
-0xab0, 0xab5, 0xabe, 0xab0, 0x3b, 0xab6, 0xaa8, 0xabf, 0xab5, 0xabe, 0xab0, 0x3b, 0xab0, 0x3b, 0xab8, 0xacb, 0x3b, 0xaae, 0xa82, 0x3b,
-0xaac, 0xac1, 0x3b, 0xa97, 0xac1, 0x3b, 0xab6, 0xac1, 0x3b, 0xab6, 0x3b, 0x4c, 0x61, 0x68, 0x3b, 0x4c, 0x69, 0x74, 0x3b, 0x54,
-0x61, 0x6c, 0x3b, 0x4c, 0x61, 0x72, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x41, 0x73, 0x61, 0x3b, 0x4c,
-0x61, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x4c, 0x69, 0x74, 0x69, 0x6e, 0x69, 0x6e, 0x3b, 0x54, 0x61, 0x6c, 0x61, 0x74, 0x61,
-0x3b, 0x4c, 0x61, 0x72, 0x61, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x4a, 0x75, 0x6d, 0x6d,
-0x61, 0x2bc, 0x61, 0x3b, 0x41, 0x73, 0x61, 0x62, 0x61, 0x72, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x41,
-0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d0, 0x5f3, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d1, 0x5f3, 0x3b, 0x5d9,
-0x5d5, 0x5dd, 0x20, 0x5d2, 0x5f3, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d3, 0x5f3, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d4, 0x5f3, 0x3b,
-0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d5, 0x5f3, 0x3b, 0x5e9, 0x5d1, 0x5ea, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e8, 0x5d0, 0x5e9, 0x5d5, 0x5df,
-0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e9, 0x5e0, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e9, 0x5dc, 0x5d9, 0x5e9, 0x5d9, 0x3b, 0x5d9,
-0x5d5, 0x5dd, 0x20, 0x5e8, 0x5d1, 0x5d9, 0x5e2, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5d7, 0x5de, 0x5d9, 0x5e9, 0x5d9, 0x3b, 0x5d9,
-0x5d5, 0x5dd, 0x20, 0x5e9, 0x5d9, 0x5e9, 0x5d9, 0x3b, 0x5d9, 0x5d5, 0x5dd, 0x20, 0x5e9, 0x5d1, 0x5ea, 0x3b, 0x5d0, 0x5f3, 0x3b, 0x5d1,
-0x5f3, 0x3b, 0x5d2, 0x5f3, 0x3b, 0x5d3, 0x5f3, 0x3b, 0x5d4, 0x5f3, 0x3b, 0x5d5, 0x5f3, 0x3b, 0x5e9, 0x5f3, 0x3b, 0x930, 0x935, 0x93f,
-0x3b, 0x938, 0x94b, 0x92e, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x3b, 0x92c, 0x941, 0x927, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x3b, 0x936,
-0x941, 0x915, 0x94d, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x3b, 0x930, 0x935, 0x93f, 0x935, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x935,
-0x93e, 0x930, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x935, 0x93e, 0x930, 0x3b, 0x92c, 0x941, 0x927, 0x935, 0x93e, 0x930, 0x3b, 0x917, 0x941,
-0x930, 0x941, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x935, 0x93e,
-0x930, 0x3b, 0x930, 0x3b, 0x938, 0x94b, 0x3b, 0x92e, 0x902, 0x3b, 0x92c, 0x941, 0x3b, 0x917, 0x941, 0x3b, 0x936, 0x941, 0x3b, 0x936,
-0x3b, 0x56, 0x3b, 0x48, 0x3b, 0x4b, 0x3b, 0x53, 0x7a, 0x65, 0x3b, 0x43, 0x73, 0x3b, 0x50, 0x3b, 0x53, 0x7a, 0x6f, 0x3b,
-0x76, 0x61, 0x73, 0xe1, 0x72, 0x6e, 0x61, 0x70, 0x3b, 0x68, 0xe9, 0x74, 0x66, 0x151, 0x3b, 0x6b, 0x65, 0x64, 0x64, 0x3b,
-0x73, 0x7a, 0x65, 0x72, 0x64, 0x61, 0x3b, 0x63, 0x73, 0xfc, 0x74, 0xf6, 0x72, 0x74, 0xf6, 0x6b, 0x3b, 0x70, 0xe9, 0x6e,
-0x74, 0x65, 0x6b, 0x3b, 0x73, 0x7a, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x3b, 0x56, 0x3b, 0x48, 0x3b, 0x4b, 0x3b, 0x53, 0x7a,
-0x3b, 0x43, 0x73, 0x3b, 0x50, 0x3b, 0x53, 0x7a, 0x3b, 0x73, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0xe1, 0x6e, 0x2e, 0x3b, 0xfe,
-0x72, 0x69, 0x2e, 0x3b, 0x6d, 0x69, 0xf0, 0x2e, 0x3b, 0x66, 0x69, 0x6d, 0x2e, 0x3b, 0x66, 0xf6, 0x73, 0x2e, 0x3b, 0x6c,
-0x61, 0x75, 0x2e, 0x3b, 0x73, 0x75, 0x6e, 0x6e, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6d, 0xe1, 0x6e, 0x75, 0x64,
-0x61, 0x67, 0x75, 0x72, 0x3b, 0xfe, 0x72, 0x69, 0xf0, 0x6a, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6d, 0x69, 0xf0,
-0x76, 0x69, 0x6b, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x66, 0x69, 0x6d, 0x6d, 0x74, 0x75, 0x64, 0x61, 0x67, 0x75,
-0x72, 0x3b, 0x66, 0xf6, 0x73, 0x74, 0x75, 0x64, 0x61, 0x67, 0x75, 0x72, 0x3b, 0x6c, 0x61, 0x75, 0x67, 0x61, 0x72, 0x64,
-0x61, 0x67, 0x75, 0x72, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0xde, 0x3b, 0x4d, 0x3b, 0x46, 0x3b, 0x46, 0x3b, 0x4c, 0x3b, 0x4d,
-0x69, 0x6e, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x3b, 0x4b, 0x61, 0x6d, 0x3b, 0x4a,
-0x75, 0x6d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4d, 0x69, 0x6e, 0x67, 0x67, 0x75, 0x3b, 0x53, 0x65, 0x6e, 0x69, 0x6e, 0x3b,
-0x53, 0x65, 0x6c, 0x61, 0x73, 0x61, 0x3b, 0x52, 0x61, 0x62, 0x75, 0x3b, 0x4b, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x4a, 0x75,
-0x6d, 0x61, 0x74, 0x3b, 0x53, 0x61, 0x62, 0x74, 0x75, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x52, 0x3b, 0x4b, 0x3b,
-0x4a, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x3b, 0x6c, 0x75, 0x6e, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x72, 0x3b,
-0x6a, 0x6f, 0x76, 0x3b, 0x76, 0x65, 0x6e, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x61,
-0x3b, 0x6c, 0x75, 0x6e, 0x65, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x64, 0x69, 0x3b, 0x6d, 0x65, 0x72, 0x63,
-0x75, 0x72, 0x69, 0x64, 0x69, 0x3b, 0x6a, 0x6f, 0x76, 0x65, 0x64, 0x69, 0x3b, 0x76, 0x65, 0x6e, 0x65, 0x72, 0x64, 0x69,
-0x3b, 0x73, 0x61, 0x62, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x64, 0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x76,
-0x3b, 0x73, 0x3b, 0x44, 0x6f, 0x6d, 0x68, 0x3b, 0x4c, 0x75, 0x61, 0x6e, 0x3b, 0x4d, 0xe1, 0x69, 0x72, 0x74, 0x3b, 0x43,
-0xe9, 0x61, 0x64, 0x3b, 0x44, 0xe9, 0x61, 0x72, 0x3b, 0x41, 0x6f, 0x69, 0x6e, 0x65, 0x3b, 0x53, 0x61, 0x74, 0x68, 0x3b,
-0x44, 0xe9, 0x20, 0x44, 0x6f, 0x6d, 0x68, 0x6e, 0x61, 0x69, 0x67, 0x68, 0x3b, 0x44, 0xe9, 0x20, 0x4c, 0x75, 0x61, 0x69,
-0x6e, 0x3b, 0x44, 0xe9, 0x20, 0x4d, 0xe1, 0x69, 0x72, 0x74, 0x3b, 0x44, 0xe9, 0x20, 0x43, 0xe9, 0x61, 0x64, 0x61, 0x6f,
-0x69, 0x6e, 0x3b, 0x44, 0xe9, 0x61, 0x72, 0x64, 0x61, 0x6f, 0x69, 0x6e, 0x3b, 0x44, 0xe9, 0x20, 0x68, 0x41, 0x6f, 0x69,
-0x6e, 0x65, 0x3b, 0x44, 0xe9, 0x20, 0x53, 0x61, 0x74, 0x68, 0x61, 0x69, 0x72, 0x6e, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d,
-0x3b, 0x43, 0x3b, 0x44, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x3b, 0x6c, 0x75, 0x6e, 0x3b, 0x6d, 0x61, 0x72,
-0x3b, 0x6d, 0x65, 0x72, 0x3b, 0x67, 0x69, 0x6f, 0x3b, 0x76, 0x65, 0x6e, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64, 0x6f, 0x6d,
-0x65, 0x6e, 0x69, 0x63, 0x61, 0x3b, 0x6c, 0x75, 0x6e, 0x65, 0x64, 0xec, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x64, 0xec,
-0x3b, 0x6d, 0x65, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x64, 0xec, 0x3b, 0x67, 0x69, 0x6f, 0x76, 0x65, 0x64, 0xec, 0x3b, 0x76,
-0x65, 0x6e, 0x65, 0x72, 0x64, 0xec, 0x3b, 0x73, 0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b,
-0x4d, 0x3b, 0x47, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x65e5, 0x3b, 0x6708, 0x3b, 0x706b, 0x3b, 0x6c34, 0x3b, 0x6728, 0x3b, 0x91d1, 0x3b,
-0x571f, 0x3b, 0x65e5, 0x66dc, 0x65e5, 0x3b, 0x6708, 0x66dc, 0x65e5, 0x3b, 0x706b, 0x66dc, 0x65e5, 0x3b, 0x6c34, 0x66dc, 0x65e5, 0x3b, 0x6728, 0x66dc,
-0x65e5, 0x3b, 0x91d1, 0x66dc, 0x65e5, 0x3b, 0x571f, 0x66dc, 0x65e5, 0x3b, 0x41, 0x68, 0x64, 0x3b, 0x53, 0x65, 0x6e, 0x3b, 0x53, 0x65,
-0x6c, 0x3b, 0x52, 0x61, 0x62, 0x3b, 0x4b, 0x61, 0x6d, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x41, 0x68,
-0x61, 0x64, 0x3b, 0x53, 0x65, 0x6e, 0x69, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x61, 0x73, 0x61, 0x3b, 0x52, 0x61, 0x62, 0x75,
-0x3b, 0x4b, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x3b, 0x53, 0x61, 0x62, 0x74, 0x75, 0x3b, 0x41,
-0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0xcad, 0xcbe, 0xca8, 0xcc1, 0x3b, 0xcb8, 0xccb,
-0xcae, 0x3b, 0xcae, 0xc82, 0xc97, 0xcb3, 0x3b, 0xcac, 0xcc1, 0xca7, 0x3b, 0xc97, 0xcc1, 0xcb0, 0xcc1, 0x3b, 0xcb6, 0xcc1, 0xc95, 0xccd,
-0xcb0, 0x3b, 0xcb6, 0xca8, 0xcbf, 0x3b, 0xcad, 0xcbe, 0xca8, 0xcc1, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcb8, 0xccb, 0xcae, 0xcb5, 0xcbe, 0xcb0,
-0x3b, 0xcae, 0xc82, 0xc97, 0xcb3, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcac, 0xcc1, 0xca7, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xc97, 0xcc1, 0xcb0, 0xcc1,
-0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcb6, 0xcc1, 0xc95, 0xccd, 0xcb0, 0xcb5, 0xcbe, 0xcb0, 0x3b, 0xcb6, 0xca8, 0xcbf, 0xcb5, 0xcbe, 0xcb0, 0x3b,
-0xcad, 0xcbe, 0x3b, 0xcb8, 0xccb, 0x3b, 0xcae, 0xc82, 0x3b, 0xcac, 0xcc1, 0x3b, 0xc97, 0xcc1, 0x3b, 0xcb6, 0xcc1, 0x3b, 0xcb6, 0x3b,
-0x622, 0x62a, 0x6be, 0x648, 0x627, 0x631, 0x3b, 0x698, 0x654, 0x646, 0x62f, 0x655, 0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x6c6, 0x645,
-0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x631, 0x620, 0x633, 0x648, 0x627, 0x631, 0x3b, 0x62c,
-0x64f, 0x645, 0x6c1, 0x3b, 0x628, 0x679, 0x648, 0x627, 0x631, 0x3b, 0x627, 0x64e, 0x62a, 0x6be, 0x648, 0x627, 0x631, 0x3b, 0x698, 0x654,
-0x646, 0x62f, 0x631, 0x655, 0x631, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x6c6, 0x645, 0x648, 0x627, 0x631, 0x3b, 0x628, 0x648, 0x62f, 0x648,
-0x627, 0x631, 0x3b, 0x628, 0x631, 0x620, 0x633, 0x648, 0x627, 0x631, 0x3b, 0x62c, 0x64f, 0x645, 0x6c1, 0x3b, 0x628, 0x679, 0x648, 0x627,
-0x631, 0x3b, 0x627, 0x3b, 0x698, 0x3b, 0x628, 0x3b, 0x628, 0x3b, 0x628, 0x3b, 0x62c, 0x3b, 0x628, 0x3b, 0x436, 0x441, 0x3b, 0x434,
-0x441, 0x3b, 0x441, 0x441, 0x3b, 0x441, 0x440, 0x3b, 0x431, 0x441, 0x3b, 0x436, 0x43c, 0x3b, 0x441, 0x431, 0x3b, 0x436, 0x435, 0x43a,
-0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x434, 0x4af, 0x439, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x441, 0x435, 0x439, 0x441, 0x435,
-0x43d, 0x431, 0x456, 0x3b, 0x441, 0x4d9, 0x440, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x431, 0x435, 0x439, 0x441, 0x435, 0x43d, 0x431,
-0x456, 0x3b, 0x436, 0x4b1, 0x43c, 0x430, 0x3b, 0x441, 0x435, 0x43d, 0x431, 0x456, 0x3b, 0x416, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x421,
-0x3b, 0x411, 0x3b, 0x416, 0x3b, 0x421, 0x3b, 0x63, 0x79, 0x75, 0x2e, 0x3b, 0x6d, 0x62, 0x65, 0x2e, 0x3b, 0x6b, 0x61, 0x62,
-0x2e, 0x3b, 0x67, 0x74, 0x75, 0x2e, 0x3b, 0x6b, 0x61, 0x6e, 0x2e, 0x3b, 0x67, 0x6e, 0x75, 0x2e, 0x3b, 0x67, 0x6e, 0x64,
-0x2e, 0x3b, 0x4b, 0x75, 0x20, 0x63, 0x79, 0x75, 0x6d, 0x77, 0x65, 0x72, 0x75, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x6d,
-0x62, 0x65, 0x72, 0x65, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4b, 0x75, 0x77,
-0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x65, 0x3b, 0x4b,
-0x75, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x4b, 0x75, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61,
-0x6e, 0x64, 0x61, 0x74, 0x75, 0x3b, 0x436, 0x435, 0x43a, 0x2e, 0x3b, 0x434, 0x4af, 0x439, 0x2e, 0x3b, 0x448, 0x435, 0x439, 0x448,
-0x2e, 0x3b, 0x448, 0x430, 0x440, 0x448, 0x2e, 0x3b, 0x431, 0x435, 0x439, 0x448, 0x2e, 0x3b, 0x436, 0x443, 0x43c, 0x430, 0x3b, 0x438,
-0x448, 0x43c, 0x2e, 0x3b, 0x436, 0x435, 0x43a, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x434, 0x4af, 0x439, 0x448, 0x4e9, 0x43c, 0x431,
-0x4af, 0x3b, 0x448, 0x435, 0x439, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x448, 0x430, 0x440, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b,
-0x431, 0x435, 0x439, 0x448, 0x435, 0x43c, 0x431, 0x438, 0x3b, 0x436, 0x443, 0x43c, 0x430, 0x3b, 0x438, 0x448, 0x435, 0x43c, 0x431, 0x438,
-0x3b, 0x416, 0x3b, 0x414, 0x3b, 0x428, 0x3b, 0x428, 0x3b, 0x411, 0x3b, 0x416, 0x3b, 0x418, 0x3b, 0xc77c, 0x3b, 0xc6d4, 0x3b, 0xd654,
-0x3b, 0xc218, 0x3b, 0xbaa9, 0x3b, 0xae08, 0x3b, 0xd1a0, 0x3b, 0xc77c, 0xc694, 0xc77c, 0x3b, 0xc6d4, 0xc694, 0xc77c, 0x3b, 0xd654, 0xc694, 0xc77c,
-0x3b, 0xc218, 0xc694, 0xc77c, 0x3b, 0xbaa9, 0xc694, 0xc77c, 0x3b, 0xae08, 0xc694, 0xc77c, 0x3b, 0xd1a0, 0xc694, 0xc77c, 0x3b, 0x79, 0x15f, 0x3b,
-0x64, 0x15f, 0x3b, 0x73, 0x15f, 0x3b, 0xe7, 0x15f, 0x3b, 0x70, 0x15f, 0x3b, 0xee, 0x6e, 0x3b, 0x15f, 0x3b, 0x79, 0x65, 0x6b,
-0x15f, 0x65, 0x6d, 0x3b, 0x64, 0x75, 0x15f, 0x65, 0x6d, 0x3b, 0x73, 0xea, 0x15f, 0x65, 0x6d, 0x3b, 0xe7, 0x61, 0x72, 0x15f,
-0x65, 0x6d, 0x3b, 0x70, 0xea, 0x6e, 0x63, 0x15f, 0x65, 0x6d, 0x3b, 0xee, 0x6e, 0x3b, 0x15f, 0x65, 0x6d, 0xee, 0x3b, 0x59,
-0x3b, 0x44, 0x3b, 0x53, 0x3b, 0xc7, 0x3b, 0x50, 0x3b, 0xce, 0x3b, 0x15e, 0x3b, 0x63, 0x75, 0x2e, 0x3b, 0x6d, 0x62, 0x65,
-0x2e, 0x3b, 0x6b, 0x61, 0x62, 0x2e, 0x3b, 0x67, 0x74, 0x75, 0x2e, 0x3b, 0x6b, 0x61, 0x6e, 0x2e, 0x3b, 0x67, 0x6e, 0x75,
-0x2e, 0x3b, 0x67, 0x6e, 0x64, 0x2e, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x2019, 0x69, 0x6e, 0x64, 0x77, 0x69, 0x3b, 0x4b, 0x75,
-0x20, 0x77, 0x61, 0x20, 0x6d, 0x62, 0x65, 0x72, 0x65, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x6b, 0x61, 0x62, 0x69,
-0x72, 0x69, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4b, 0x75, 0x20, 0x77,
-0x61, 0x20, 0x6b, 0x61, 0x6e, 0x65, 0x3b, 0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x75, 0x3b,
-0x4b, 0x75, 0x20, 0x77, 0x61, 0x20, 0x67, 0x61, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x74, 0x75, 0x3b, 0xead, 0xeb2, 0xe97, 0xeb4,
-0xe94, 0x3b, 0xe88, 0xeb1, 0xe99, 0x3b, 0xead, 0xeb1, 0xe87, 0xe84, 0xeb2, 0xe99, 0x3b, 0xe9e, 0xeb8, 0xe94, 0x3b, 0xe9e, 0xeb0, 0xeab,
-0xeb1, 0xe94, 0x3b, 0xeaa, 0xeb8, 0xe81, 0x3b, 0xec0, 0xeaa, 0xebb, 0xeb2, 0x3b, 0xea7, 0xeb1, 0xe99, 0xead, 0xeb2, 0xe97, 0xeb4, 0xe94,
-0x3b, 0xea7, 0xeb1, 0xe99, 0xe88, 0xeb1, 0xe99, 0x3b, 0xea7, 0xeb1, 0xe99, 0xead, 0xeb1, 0xe87, 0xe84, 0xeb2, 0xe99, 0x3b, 0xea7, 0xeb1,
-0xe99, 0xe9e, 0xeb8, 0xe94, 0x3b, 0xea7, 0xeb1, 0xe99, 0xe9e, 0xeb0, 0xeab, 0xeb1, 0xe94, 0x3b, 0xea7, 0xeb1, 0xe99, 0xeaa, 0xeb8, 0xe81,
-0x3b, 0xea7, 0xeb1, 0xe99, 0xec0, 0xeaa, 0xebb, 0xeb2, 0x3b, 0xead, 0xeb2, 0x3b, 0xe88, 0x3b, 0xead, 0x3b, 0xe9e, 0x3b, 0xe9e, 0xeab,
-0x3b, 0xeaa, 0xeb8, 0x3b, 0xeaa, 0x3b, 0x53, 0x76, 0x113, 0x74, 0x64, 0x2e, 0x3b, 0x50, 0x69, 0x72, 0x6d, 0x64, 0x2e, 0x3b,
-0x4f, 0x74, 0x72, 0x64, 0x2e, 0x3b, 0x54, 0x72, 0x65, 0x161, 0x64, 0x2e, 0x3b, 0x43, 0x65, 0x74, 0x75, 0x72, 0x74, 0x64,
-0x2e, 0x3b, 0x50, 0x69, 0x65, 0x6b, 0x74, 0x64, 0x2e, 0x3b, 0x53, 0x65, 0x73, 0x74, 0x64, 0x2e, 0x3b, 0x53, 0x76, 0x113,
-0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x50, 0x69, 0x72, 0x6d, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x4f, 0x74, 0x72,
-0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x54, 0x72, 0x65, 0x161, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x43, 0x65, 0x74, 0x75,
-0x72, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x50, 0x69, 0x65, 0x6b, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x53,
-0x65, 0x73, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x53, 0x3b, 0x50, 0x3b, 0x4f, 0x3b, 0x54, 0x3b, 0x43, 0x3b, 0x50,
-0x3b, 0x53, 0x3b, 0x73, 0x76, 0x113, 0x74, 0x64, 0x2e, 0x3b, 0x70, 0x69, 0x72, 0x6d, 0x64, 0x2e, 0x3b, 0x6f, 0x74, 0x72,
-0x64, 0x2e, 0x3b, 0x74, 0x72, 0x65, 0x161, 0x64, 0x2e, 0x3b, 0x63, 0x65, 0x74, 0x75, 0x72, 0x74, 0x64, 0x2e, 0x3b, 0x70,
-0x69, 0x65, 0x6b, 0x74, 0x64, 0x2e, 0x3b, 0x73, 0x65, 0x73, 0x74, 0x64, 0x2e, 0x3b, 0x73, 0x76, 0x113, 0x74, 0x64, 0x69,
-0x65, 0x6e, 0x61, 0x3b, 0x70, 0x69, 0x72, 0x6d, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x6f, 0x74, 0x72, 0x64, 0x69, 0x65,
-0x6e, 0x61, 0x3b, 0x74, 0x72, 0x65, 0x161, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x63, 0x65, 0x74, 0x75, 0x72, 0x74, 0x64,
-0x69, 0x65, 0x6e, 0x61, 0x3b, 0x70, 0x69, 0x65, 0x6b, 0x74, 0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x73, 0x65, 0x73, 0x74,
-0x64, 0x69, 0x65, 0x6e, 0x61, 0x3b, 0x65, 0x79, 0x65, 0x3b, 0x79, 0x62, 0x6f, 0x3b, 0x6d, 0x62, 0x6c, 0x3b, 0x6d, 0x73,
-0x74, 0x3b, 0x6d, 0x69, 0x6e, 0x3b, 0x6d, 0x74, 0x6e, 0x3b, 0x6d, 0x70, 0x73, 0x3b, 0x65, 0x79, 0x65, 0x6e, 0x67, 0x61,
-0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254, 0x20, 0x6d, 0x77, 0x61, 0x20, 0x79, 0x61, 0x6d, 0x62, 0x6f, 0x3b, 0x6d, 0x6f,
-0x6b, 0x254, 0x6c, 0x254, 0x20, 0x6d, 0x77, 0x61, 0x20, 0x6d, 0xed, 0x62, 0x61, 0x6c, 0xe9, 0x3b, 0x6d, 0x6f, 0x6b, 0x254,
-0x6c, 0x254, 0x20, 0x6d, 0x77, 0x61, 0x20, 0x6d, 0xed, 0x73, 0xe1, 0x74, 0x6f, 0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254,
-0x20, 0x79, 0x61, 0x20, 0x6d, 0xed, 0x6e, 0xe9, 0x69, 0x3b, 0x6d, 0x6f, 0x6b, 0x254, 0x6c, 0x254, 0x20, 0x79, 0x61, 0x20,
-0x6d, 0xed, 0x74, 0xe1, 0x6e, 0x6f, 0x3b, 0x6d, 0x70, 0x254, 0x301, 0x73, 0x254, 0x3b, 0x65, 0x3b, 0x79, 0x3b, 0x6d, 0x3b,
-0x6d, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x70, 0x3b, 0x73, 0x6b, 0x3b, 0x70, 0x72, 0x3b, 0x61, 0x6e, 0x3b, 0x74, 0x72, 0x3b,
-0x6b, 0x74, 0x3b, 0x70, 0x6e, 0x3b, 0x161, 0x74, 0x3b, 0x73, 0x65, 0x6b, 0x6d, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73,
-0x3b, 0x70, 0x69, 0x72, 0x6d, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x61, 0x6e, 0x74, 0x72, 0x61, 0x64, 0x69,
-0x65, 0x6e, 0x69, 0x73, 0x3b, 0x74, 0x72, 0x65, 0x10d, 0x69, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x6b, 0x65,
-0x74, 0x76, 0x69, 0x72, 0x74, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x70, 0x65, 0x6e, 0x6b, 0x74, 0x61, 0x64,
-0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x161, 0x65, 0x161, 0x74, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x69, 0x73, 0x3b, 0x53, 0x3b,
-0x50, 0x3b, 0x41, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x50, 0x3b, 0x160, 0x3b, 0x43d, 0x435, 0x434, 0x2e, 0x3b, 0x43f, 0x43e, 0x43d,
-0x2e, 0x3b, 0x432, 0x442, 0x43e, 0x2e, 0x3b, 0x441, 0x440, 0x435, 0x2e, 0x3b, 0x447, 0x435, 0x442, 0x2e, 0x3b, 0x43f, 0x435, 0x442,
-0x2e, 0x3b, 0x441, 0x430, 0x431, 0x2e, 0x3b, 0x43d, 0x435, 0x434, 0x435, 0x43b, 0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x435,
-0x43b, 0x43d, 0x438, 0x43a, 0x3b, 0x432, 0x442, 0x43e, 0x440, 0x43d, 0x438, 0x43a, 0x3b, 0x441, 0x440, 0x435, 0x434, 0x430, 0x3b, 0x447,
-0x435, 0x442, 0x432, 0x440, 0x442, 0x43e, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x43e, 0x43a, 0x3b, 0x441, 0x430, 0x431, 0x43e, 0x442, 0x430,
-0x3b, 0x43d, 0x435, 0x434, 0x2e, 0x3b, 0x43f, 0x43e, 0x43d, 0x2e, 0x3b, 0x432, 0x442, 0x2e, 0x3b, 0x441, 0x440, 0x435, 0x2e, 0x3b,
-0x447, 0x435, 0x442, 0x2e, 0x3b, 0x43f, 0x435, 0x442, 0x2e, 0x3b, 0x441, 0x430, 0x431, 0x2e, 0x3b, 0x41, 0x6c, 0x61, 0x68, 0x3b,
-0x41, 0x6c, 0x61, 0x74, 0x73, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x3b, 0x41, 0x6c, 0x61, 0x6b, 0x3b,
-0x5a, 0x6f, 0x6d, 0x3b, 0x41, 0x73, 0x61, 0x62, 0x3b, 0x41, 0x6c, 0x61, 0x68, 0x61, 0x64, 0x79, 0x3b, 0x41, 0x6c, 0x61,
-0x74, 0x73, 0x69, 0x6e, 0x61, 0x69, 0x6e, 0x79, 0x3b, 0x54, 0x61, 0x6c, 0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72,
-0x6f, 0x62, 0x69, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x6b, 0x61, 0x6d, 0x69, 0x73, 0x79, 0x3b, 0x5a, 0x6f, 0x6d, 0x61, 0x3b,
-0x41, 0x73, 0x61, 0x62, 0x6f, 0x74, 0x73, 0x79, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x5a,
-0x3b, 0x41, 0x3b, 0x41, 0x68, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x3b, 0x52, 0x61, 0x62, 0x3b, 0x4b,
-0x68, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x41, 0x68, 0x61, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x69,
-0x6e, 0x3b, 0x53, 0x65, 0x6c, 0x61, 0x73, 0x61, 0x3b, 0x52, 0x61, 0x62, 0x75, 0x3b, 0x4b, 0x68, 0x61, 0x6d, 0x69, 0x73,
-0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x74, 0x3b, 0x53, 0x61, 0x62, 0x74, 0x75, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x53, 0x3b,
-0x52, 0x3b, 0x4b, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0xd1e, 0xd3e, 0xd2f, 0xd7c, 0x3b, 0xd24, 0xd3f, 0xd19, 0xd4d, 0xd15, 0xd7e, 0x3b,
-0xd1a, 0xd4a, 0xd35, 0xd4d, 0xd35, 0x3b, 0xd2c, 0xd41, 0xd27, 0xd7b, 0x3b, 0xd35, 0xd4d, 0xd2f, 0xd3e, 0xd34, 0xd02, 0x3b, 0xd35, 0xd46,
-0xd33, 0xd4d, 0xd33, 0xd3f, 0x3b, 0xd36, 0xd28, 0xd3f, 0x3b, 0xd1e, 0xd3e, 0xd2f, 0xd31, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd24,
-0xd3f, 0xd19, 0xd4d, 0xd15, 0xd33, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1a, 0xd4a, 0xd35, 0xd4d, 0xd35, 0xd3e, 0xd34, 0xd4d, 0x200c,
-0xd1a, 0x3b, 0xd2c, 0xd41, 0xd27, 0xd28, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd35, 0xd4d, 0xd2f, 0xd3e, 0xd34, 0xd3e, 0xd34, 0xd4d,
-0x200c, 0xd1a, 0x3b, 0xd35, 0xd46, 0xd33, 0xd4d, 0xd33, 0xd3f, 0xd2f, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd36, 0xd28, 0xd3f, 0xd2f,
-0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1e, 0xd3e, 0x3b, 0xd24, 0xd3f, 0x3b, 0xd1a, 0xd4a, 0x3b, 0xd2c, 0xd41, 0x3b, 0xd35, 0xd4d,
-0xd2f, 0xd3e, 0x3b, 0xd35, 0xd46, 0x3b, 0xd36, 0x3b, 0xd1e, 0xd3e, 0xd2f, 0xd31, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd24, 0xd3f,
-0xd19, 0xd4d, 0xd15, 0xd33, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1a, 0xd4a, 0xd35, 0xd4d, 0xd35, 0xd3e, 0xd34, 0xd4d, 0xd1a, 0x3b,
-0xd2c, 0xd41, 0xd27, 0xd28, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd35, 0xd4d, 0xd2f, 0xd3e, 0xd34, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a,
-0x3b, 0xd35, 0xd46, 0xd33, 0xd4d, 0xd33, 0xd3f, 0xd2f, 0xd3e, 0xd34, 0xd4d, 0x200c, 0xd1a, 0x3b, 0xd36, 0xd28, 0xd3f, 0xd2f, 0xd3e, 0xd34,
-0xd4d, 0x200c, 0xd1a, 0x3b, 0xd1e, 0x3b, 0xd24, 0xd3f, 0x3b, 0xd1a, 0xd4a, 0x3b, 0xd2c, 0xd41, 0x3b, 0xd35, 0xd4d, 0xd2f, 0xd3e, 0x3b,
-0xd35, 0xd46, 0x3b, 0xd36, 0x3b, 0x126, 0x61, 0x64, 0x3b, 0x54, 0x6e, 0x65, 0x3b, 0x54, 0x6c, 0x69, 0x3b, 0x45, 0x72, 0x62,
-0x3b, 0x126, 0x61, 0x6d, 0x3b, 0x120, 0x69, 0x6d, 0x3b, 0x53, 0x69, 0x62, 0x3b, 0x49, 0x6c, 0x2d, 0x126, 0x61, 0x64, 0x64,
-0x3b, 0x49, 0x74, 0x2d, 0x54, 0x6e, 0x65, 0x6a, 0x6e, 0x3b, 0x49, 0x74, 0x2d, 0x54, 0x6c, 0x69, 0x65, 0x74, 0x61, 0x3b,
-0x4c, 0x2d, 0x45, 0x72, 0x62, 0x67, 0x127, 0x61, 0x3b, 0x49, 0x6c, 0x2d, 0x126, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0x49, 0x6c,
-0x2d, 0x120, 0x69, 0x6d, 0x67, 0x127, 0x61, 0x3b, 0x49, 0x73, 0x2d, 0x53, 0x69, 0x62, 0x74, 0x3b, 0x126, 0x64, 0x3b, 0x54,
-0x6e, 0x3b, 0x54, 0x6c, 0x3b, 0x45, 0x72, 0x3b, 0x126, 0x6d, 0x3b, 0x120, 0x6d, 0x3b, 0x53, 0x62, 0x3b, 0x126, 0x64, 0x3b,
-0x54, 0x3b, 0x54, 0x6c, 0x3b, 0x45, 0x72, 0x3b, 0x126, 0x6d, 0x3b, 0x120, 0x6d, 0x3b, 0x53, 0x62, 0x3b, 0x54, 0x61, 0x70,
-0x3b, 0x48, 0x69, 0x6e, 0x3b, 0x54, 0x16b, 0x3b, 0x41, 0x70, 0x61, 0x3b, 0x50, 0x61, 0x72, 0x3b, 0x4d, 0x65, 0x72, 0x3b,
-0x48, 0x6f, 0x72, 0x3b, 0x52, 0x101, 0x74, 0x61, 0x70, 0x75, 0x3b, 0x52, 0x101, 0x68, 0x69, 0x6e, 0x61, 0x3b, 0x52, 0x101,
-0x74, 0x16b, 0x3b, 0x52, 0x101, 0x61, 0x70, 0x61, 0x3b, 0x52, 0x101, 0x70, 0x61, 0x72, 0x65, 0x3b, 0x52, 0x101, 0x6d, 0x65,
-0x72, 0x65, 0x3b, 0x52, 0x101, 0x68, 0x6f, 0x72, 0x6f, 0x69, 0x3b, 0x54, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x50,
-0x3b, 0x4d, 0x3b, 0x48, 0x3b, 0x930, 0x935, 0x93f, 0x3b, 0x938, 0x94b, 0x92e, 0x3b, 0x92e, 0x902, 0x917, 0x933, 0x3b, 0x92c, 0x941,
-0x927, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x3b, 0x930, 0x935, 0x93f,
-0x935, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x935, 0x93e, 0x930, 0x3b, 0x92e, 0x902, 0x917, 0x933, 0x935, 0x93e, 0x930, 0x3b, 0x92c,
-0x941, 0x927, 0x935, 0x93e, 0x930, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x935, 0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x935,
-0x93e, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x935, 0x93e, 0x930, 0x3b, 0x41d, 0x44f, 0x3b, 0x414, 0x430, 0x3b, 0x41c, 0x44f, 0x3b, 0x41b,
-0x445, 0x3b, 0x41f, 0x4af, 0x3b, 0x411, 0x430, 0x3b, 0x411, 0x44f, 0x3b, 0x41d, 0x44f, 0x43c, 0x3b, 0x414, 0x430, 0x432, 0x430, 0x430,
-0x3b, 0x41c, 0x44f, 0x433, 0x43c, 0x430, 0x440, 0x3b, 0x41b, 0x445, 0x430, 0x433, 0x432, 0x430, 0x3b, 0x41f, 0x4af, 0x440, 0x44d, 0x432,
-0x3b, 0x411, 0x430, 0x430, 0x441, 0x430, 0x43d, 0x3b, 0x411, 0x44f, 0x43c, 0x431, 0x430, 0x3b, 0x43d, 0x44f, 0x43c, 0x3b, 0x434, 0x430,
-0x432, 0x430, 0x430, 0x3b, 0x43c, 0x44f, 0x433, 0x43c, 0x430, 0x440, 0x3b, 0x43b, 0x445, 0x430, 0x433, 0x432, 0x430, 0x3b, 0x43f, 0x4af,
-0x440, 0x44d, 0x432, 0x3b, 0x431, 0x430, 0x430, 0x441, 0x430, 0x43d, 0x3b, 0x431, 0x44f, 0x43c, 0x431, 0x430, 0x3b, 0x906, 0x907, 0x924,
-0x3b, 0x938, 0x94b, 0x92e, 0x3b, 0x92e, 0x919, 0x94d, 0x917, 0x932, 0x3b, 0x92c, 0x941, 0x927, 0x3b, 0x92c, 0x93f, 0x939, 0x93f, 0x3b,
-0x936, 0x941, 0x915, 0x94d, 0x930, 0x3b, 0x936, 0x928, 0x93f, 0x3b, 0x906, 0x907, 0x924, 0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e,
-0x92c, 0x93e, 0x930, 0x3b, 0x92e, 0x919, 0x94d, 0x917, 0x932, 0x92c, 0x93e, 0x930, 0x3b, 0x92c, 0x941, 0x927, 0x92c, 0x93e, 0x930, 0x3b,
-0x92c, 0x93f, 0x939, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x92c, 0x93e, 0x930, 0x3b, 0x936, 0x928, 0x93f,
-0x92c, 0x93e, 0x930, 0x3b, 0x906, 0x3b, 0x938, 0x94b, 0x3b, 0x92e, 0x3b, 0x92c, 0x941, 0x3b, 0x92c, 0x93f, 0x3b, 0x936, 0x941, 0x3b,
-0x936, 0x3b, 0xb30, 0xb2c, 0xb3f, 0x3b, 0xb38, 0xb4b, 0xb2e, 0x3b, 0xb2e, 0xb19, 0xb4d, 0xb17, 0xb33, 0x3b, 0xb2c, 0xb41, 0xb27, 0x3b,
-0xb17, 0xb41, 0xb30, 0xb41, 0x3b, 0xb36, 0xb41, 0xb15, 0xb4d, 0xb30, 0x3b, 0xb36, 0xb28, 0xb3f, 0x3b, 0xb30, 0xb2c, 0xb3f, 0xb2c, 0xb3e,
-0xb30, 0x3b, 0xb38, 0xb4b, 0xb2e, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb2e, 0xb19, 0xb4d, 0xb17, 0xb33, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb2c, 0xb41,
-0xb27, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb17, 0xb41, 0xb30, 0xb41, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb36, 0xb41, 0xb15, 0xb4d, 0xb30, 0xb2c, 0xb3e,
-0xb30, 0x3b, 0xb36, 0xb28, 0xb3f, 0xb2c, 0xb3e, 0xb30, 0x3b, 0xb30, 0x3b, 0xb38, 0xb4b, 0x3b, 0xb2e, 0x3b, 0xb2c, 0xb41, 0x3b, 0xb17,
-0xb41, 0x3b, 0xb36, 0xb41, 0x3b, 0xb36, 0x3b, 0x64a, 0x648, 0x646, 0x6cd, 0x3b, 0x62f, 0x648, 0x646, 0x6cd, 0x3b, 0x62f, 0x631, 0x6d0,
-0x646, 0x6cd, 0x3b, 0x685, 0x644, 0x631, 0x646, 0x6cd, 0x3b, 0x67e, 0x64a, 0x646, 0x681, 0x646, 0x6cd, 0x3b, 0x62c, 0x645, 0x639, 0x647,
-0x3b, 0x627, 0x648, 0x646, 0x6cd, 0x3b, 0x6cc, 0x6a9, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x62f, 0x648, 0x634, 0x646, 0x628, 0x647, 0x3b,
-0x633, 0x647, 0x200c, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x686, 0x647, 0x627, 0x631, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x67e, 0x646, 0x62c,
-0x634, 0x646, 0x628, 0x647, 0x3b, 0x62c, 0x645, 0x639, 0x647, 0x3b, 0x634, 0x646, 0x628, 0x647, 0x3b, 0x6cc, 0x3b, 0x62f, 0x3b, 0x633,
-0x3b, 0x686, 0x3b, 0x67e, 0x3b, 0x62c, 0x3b, 0x634, 0x3b, 0x6e, 0x69, 0x65, 0x64, 0x7a, 0x2e, 0x3b, 0x70, 0x6f, 0x6e, 0x2e,
-0x3b, 0x77, 0x74, 0x2e, 0x3b, 0x15b, 0x72, 0x2e, 0x3b, 0x63, 0x7a, 0x77, 0x2e, 0x3b, 0x70, 0x74, 0x2e, 0x3b, 0x73, 0x6f,
-0x62, 0x2e, 0x3b, 0x6e, 0x69, 0x65, 0x64, 0x7a, 0x69, 0x65, 0x6c, 0x61, 0x3b, 0x70, 0x6f, 0x6e, 0x69, 0x65, 0x64, 0x7a,
-0x69, 0x61, 0x142, 0x65, 0x6b, 0x3b, 0x77, 0x74, 0x6f, 0x72, 0x65, 0x6b, 0x3b, 0x15b, 0x72, 0x6f, 0x64, 0x61, 0x3b, 0x63,
-0x7a, 0x77, 0x61, 0x72, 0x74, 0x65, 0x6b, 0x3b, 0x70, 0x69, 0x105, 0x74, 0x65, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74,
-0x61, 0x3b, 0x4e, 0x3b, 0x50, 0x3b, 0x57, 0x3b, 0x15a, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x53, 0x3b, 0x6e, 0x3b, 0x70, 0x3b,
-0x77, 0x3b, 0x15b, 0x3b, 0x63, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x64, 0x6f, 0x6d, 0x3b, 0x73, 0x65, 0x67, 0x3b, 0x74, 0x65,
-0x72, 0x3b, 0x71, 0x75, 0x61, 0x3b, 0x71, 0x75, 0x69, 0x3b, 0x73, 0x65, 0x78, 0x3b, 0x73, 0xe1, 0x62, 0x3b, 0x64, 0x6f,
-0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x73, 0x65, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b,
-0x74, 0x65, 0x72, 0xe7, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b, 0x71, 0x75, 0x61, 0x72, 0x74, 0x61, 0x2d, 0x66,
-0x65, 0x69, 0x72, 0x61, 0x3b, 0x71, 0x75, 0x69, 0x6e, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b, 0x73, 0x65,
-0x78, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x69, 0x72, 0x61, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x53,
-0x3b, 0x54, 0x3b, 0x51, 0x3b, 0x51, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x73,
-0x65, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x3b, 0x74, 0x65, 0x72, 0xe7, 0x61, 0x3b, 0x71, 0x75, 0x61, 0x72, 0x74, 0x61, 0x3b,
-0x71, 0x75, 0x69, 0x6e, 0x74, 0x61, 0x3b, 0x73, 0x65, 0x78, 0x74, 0x61, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b,
-0xa10, 0xa24, 0x3b, 0xa38, 0xa4b, 0xa2e, 0x3b, 0xa2e, 0xa70, 0xa17, 0xa32, 0x3b, 0xa2c, 0xa41, 0xa71, 0xa27, 0x3b, 0xa35, 0xa40, 0xa30,
-0x3b, 0xa38, 0xa3c, 0xa41, 0xa71, 0xa15, 0xa30, 0x3b, 0xa38, 0xa3c, 0xa28, 0xa3f, 0xa71, 0xa1a, 0xa30, 0x3b, 0xa10, 0xa24, 0xa35, 0xa3e,
-0xa30, 0x3b, 0xa38, 0xa4b, 0xa2e, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa2e, 0xa70, 0xa17, 0xa32, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa2c, 0xa41, 0xa71,
-0xa27, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa35, 0xa40, 0xa30, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa38, 0xa3c, 0xa41, 0xa71, 0xa15, 0xa30, 0xa35, 0xa3e,
-0xa30, 0x3b, 0xa38, 0xa3c, 0xa28, 0xa3f, 0xa71, 0xa1a, 0xa30, 0xa35, 0xa3e, 0xa30, 0x3b, 0xa10, 0x3b, 0xa38, 0xa4b, 0x3b, 0xa2e, 0xa70,
-0x3b, 0xa2c, 0xa41, 0xa71, 0x3b, 0xa35, 0xa40, 0x3b, 0xa38, 0xa3c, 0xa41, 0xa71, 0x3b, 0xa38, 0xa3c, 0x3b, 0x627, 0x62a, 0x648, 0x627,
-0x631, 0x3b, 0x67e, 0x6cc, 0x631, 0x3b, 0x645, 0x646, 0x6af, 0x644, 0x3b, 0x628, 0x64f, 0x62f, 0x6be, 0x3b, 0x62c, 0x645, 0x639, 0x631,
-0x627, 0x62a, 0x3b, 0x62c, 0x645, 0x639, 0x6c1, 0x3b, 0x6c1, 0x641, 0x62a, 0x6c1, 0x3b, 0x44, 0x6f, 0x6d, 0x3b, 0x4c, 0x75, 0x6e,
-0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x69, 0xe9, 0x3b, 0x4a, 0x75, 0x65, 0x3b, 0x56, 0x69, 0x65, 0x3b, 0x53, 0x61, 0x62,
-0x3b, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x65, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65,
-0x73, 0x3b, 0x4d, 0x69, 0xe9, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x4a, 0x75, 0x65, 0x76, 0x65, 0x73, 0x3b, 0x56,
-0x69, 0x65, 0x72, 0x6e, 0x65, 0x73, 0x3b, 0x53, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b,
-0x58, 0x3b, 0x4a, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x64, 0x75, 0x3b, 0x67, 0x6c, 0x69, 0x3b, 0x6d, 0x61, 0x3b, 0x6d, 0x65,
-0x3b, 0x67, 0x69, 0x65, 0x3b, 0x76, 0x65, 0x3b, 0x73, 0x6f, 0x3b, 0x64, 0x75, 0x6d, 0x65, 0x6e, 0x67, 0x69, 0x61, 0x3b,
-0x67, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x73, 0x64, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x64, 0x69, 0x3b, 0x6d, 0x65, 0x73, 0x65,
-0x6d, 0x6e, 0x61, 0x3b, 0x67, 0x69, 0x65, 0x76, 0x67, 0x69, 0x61, 0x3b, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x64, 0x69,
-0x3b, 0x73, 0x6f, 0x6e, 0x64, 0x61, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x56, 0x3b, 0x53,
-0x3b, 0x64, 0x75, 0x6d, 0x2e, 0x3b, 0x6c, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d, 0x69, 0x65, 0x2e,
-0x3b, 0x6a, 0x6f, 0x69, 0x3b, 0x76, 0x69, 0x6e, 0x2e, 0x3b, 0x73, 0xe2, 0x6d, 0x2e, 0x3b, 0x64, 0x75, 0x6d, 0x69, 0x6e,
-0x69, 0x63, 0x103, 0x3b, 0x6c, 0x75, 0x6e, 0x69, 0x3b, 0x6d, 0x61, 0x72, 0x21b, 0x69, 0x3b, 0x6d, 0x69, 0x65, 0x72, 0x63,
-0x75, 0x72, 0x69, 0x3b, 0x6a, 0x6f, 0x69, 0x3b, 0x76, 0x69, 0x6e, 0x65, 0x72, 0x69, 0x3b, 0x73, 0xe2, 0x6d, 0x62, 0x103,
-0x74, 0x103, 0x3b, 0x44, 0x75, 0x6d, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d, 0x69, 0x65, 0x3b, 0x4a,
-0x6f, 0x69, 0x3b, 0x56, 0x69, 0x6e, 0x3b, 0x53, 0xe2, 0x6d, 0x3b, 0x44, 0x3b, 0x4c, 0x3b, 0x4d, 0x61, 0x3b, 0x4d, 0x69,
-0x3b, 0x4a, 0x3b, 0x56, 0x3b, 0x53, 0x3b, 0x432, 0x441, 0x3b, 0x43f, 0x43d, 0x3b, 0x432, 0x442, 0x3b, 0x441, 0x440, 0x3b, 0x447,
-0x442, 0x3b, 0x43f, 0x442, 0x3b, 0x441, 0x431, 0x3b, 0x432, 0x43e, 0x441, 0x43a, 0x440, 0x435, 0x441, 0x435, 0x43d, 0x44c, 0x435, 0x3b,
-0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x435, 0x43b, 0x44c, 0x43d, 0x438, 0x43a, 0x3b, 0x432, 0x442, 0x43e, 0x440, 0x43d, 0x438, 0x43a, 0x3b,
-0x441, 0x440, 0x435, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x435, 0x440, 0x433, 0x3b, 0x43f, 0x44f, 0x442, 0x43d, 0x438, 0x446,
-0x430, 0x3b, 0x441, 0x443, 0x431, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x412, 0x3b, 0x41f, 0x3b, 0x412, 0x3b, 0x421, 0x3b, 0x427, 0x3b,
-0x41f, 0x3b, 0x421, 0x3b, 0x42, 0x6b, 0x31, 0x3b, 0x42, 0x6b, 0x32, 0x3b, 0x42, 0x6b, 0x33, 0x3b, 0x42, 0x6b, 0x34, 0x3b,
-0x42, 0x6b, 0x35, 0x3b, 0x4c, 0xe2, 0x70, 0x3b, 0x4c, 0xe2, 0x79, 0x3b, 0x42, 0x69, 0x6b, 0x75, 0x61, 0x2d, 0xf4, 0x6b,
-0x6f, 0x3b, 0x42, 0xef, 0x6b, 0x75, 0x61, 0x2d, 0xfb, 0x73, 0x65, 0x3b, 0x42, 0xef, 0x6b, 0x75, 0x61, 0x2d, 0x70, 0x74,
-0xe2, 0x3b, 0x42, 0xef, 0x6b, 0x75, 0x61, 0x2d, 0x75, 0x73, 0xef, 0xf6, 0x3b, 0x42, 0xef, 0x6b, 0x75, 0x61, 0x2d, 0x6f,
-0x6b, 0xfc, 0x3b, 0x4c, 0xe2, 0x70, 0xf4, 0x73, 0xf6, 0x3b, 0x4c, 0xe2, 0x79, 0x65, 0x6e, 0x67, 0x61, 0x3b, 0x4b, 0x3b,
-0x53, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x50, 0x3b, 0x59, 0x3b, 0x43d, 0x435, 0x434, 0x3b, 0x43f, 0x43e, 0x43d, 0x3b,
-0x443, 0x442, 0x43e, 0x3b, 0x441, 0x440, 0x435, 0x3b, 0x447, 0x435, 0x442, 0x3b, 0x43f, 0x435, 0x442, 0x3b, 0x441, 0x443, 0x431, 0x3b,
-0x43d, 0x435, 0x434, 0x435, 0x459, 0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x435, 0x459, 0x430, 0x43a, 0x3b, 0x443, 0x442, 0x43e,
-0x440, 0x430, 0x43a, 0x3b, 0x441, 0x440, 0x435, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x430, 0x43a, 0x3b, 0x43f,
-0x435, 0x442, 0x430, 0x43a, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x43d, 0x3b, 0x43f, 0x3b, 0x443, 0x3b, 0x441, 0x3b,
-0x447, 0x3b, 0x43f, 0x3b, 0x441, 0x3b, 0x6e, 0x65, 0x64, 0x3b, 0x70, 0x6f, 0x6e, 0x3b, 0x75, 0x74, 0x3b, 0x73, 0x72, 0x3b,
-0x10d, 0x65, 0x74, 0x3b, 0x70, 0x65, 0x74, 0x3b, 0x73, 0x75, 0x62, 0x3b, 0x6e, 0x65, 0x64, 0x6a, 0x65, 0x6c, 0x6a, 0x61,
-0x3b, 0x70, 0x6f, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x6b, 0x3b, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x6b, 0x3b, 0x73,
-0x72, 0x69, 0x6a, 0x65, 0x64, 0x61, 0x3b, 0x10d, 0x65, 0x74, 0x76, 0x72, 0x74, 0x61, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x61,
-0x6b, 0x3b, 0x73, 0x75, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x65, 0x64, 0x2e, 0x3b, 0x70, 0x6f, 0x6e, 0x2e, 0x3b, 0x75,
-0x74, 0x2e, 0x3b, 0x73, 0x72, 0x2e, 0x3b, 0x10d, 0x65, 0x74, 0x2e, 0x3b, 0x70, 0x65, 0x74, 0x2e, 0x3b, 0x73, 0x75, 0x62,
-0x2e, 0x3b, 0x6e, 0x65, 0x64, 0x3b, 0x70, 0x6f, 0x6e, 0x3b, 0x75, 0x74, 0x6f, 0x3b, 0x73, 0x72, 0x65, 0x3b, 0x10d, 0x65,
-0x74, 0x3b, 0x70, 0x65, 0x74, 0x3b, 0x73, 0x75, 0x62, 0x3b, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x3b, 0x70, 0x6f,
-0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x6b, 0x3b, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x6b, 0x3b, 0x73, 0x72, 0x65, 0x64,
-0x61, 0x3b, 0x10d, 0x65, 0x74, 0x76, 0x72, 0x74, 0x61, 0x6b, 0x3b, 0x70, 0x65, 0x74, 0x61, 0x6b, 0x3b, 0x73, 0x75, 0x62,
-0x6f, 0x74, 0x61, 0x3b, 0x43d, 0x435, 0x434, 0x3b, 0x43f, 0x43e, 0x43d, 0x3b, 0x443, 0x442, 0x3b, 0x441, 0x440, 0x3b, 0x447, 0x435,
-0x442, 0x3b, 0x43f, 0x435, 0x442, 0x3b, 0x441, 0x443, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x458, 0x435, 0x459, 0x430, 0x3b, 0x43f, 0x43e,
-0x43d, 0x435, 0x434, 0x435, 0x459, 0x430, 0x43a, 0x3b, 0x443, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b, 0x441, 0x440, 0x438, 0x458, 0x435,
-0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x430, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x430, 0x43a, 0x3b, 0x441, 0x443,
-0x431, 0x43e, 0x442, 0x430, 0x3b, 0x425, 0x446, 0x431, 0x3b, 0x41a, 0x440, 0x441, 0x3b, 0x414, 0x446, 0x433, 0x3b, 0x4d4, 0x440, 0x442,
-0x3b, 0x426, 0x43f, 0x440, 0x3b, 0x41c, 0x440, 0x431, 0x3b, 0x421, 0x431, 0x442, 0x3b, 0x425, 0x443, 0x44b, 0x446, 0x430, 0x443, 0x431,
-0x43e, 0x43d, 0x3b, 0x41a, 0x44a, 0x443, 0x44b, 0x440, 0x438, 0x441, 0x4d5, 0x440, 0x3b, 0x414, 0x44b, 0x446, 0x446, 0x4d5, 0x433, 0x3b,
-0x4d4, 0x440, 0x442, 0x44b, 0x446, 0x446, 0x4d5, 0x433, 0x3b, 0x426, 0x44b, 0x43f, 0x43f, 0x4d5, 0x440, 0x4d5, 0x43c, 0x3b, 0x41c, 0x430,
-0x439, 0x440, 0x4d5, 0x43c, 0x431, 0x43e, 0x43d, 0x3b, 0x421, 0x430, 0x431, 0x430, 0x442, 0x3b, 0x425, 0x3b, 0x41a, 0x3b, 0x414, 0x3b,
-0x4d4, 0x3b, 0x426, 0x3b, 0x41c, 0x3b, 0x421, 0x3b, 0x445, 0x446, 0x431, 0x3b, 0x43a, 0x440, 0x441, 0x3b, 0x434, 0x446, 0x433, 0x3b,
-0x4d5, 0x440, 0x442, 0x3b, 0x446, 0x43f, 0x440, 0x3b, 0x43c, 0x440, 0x431, 0x3b, 0x441, 0x431, 0x442, 0x3b, 0x445, 0x443, 0x44b, 0x446,
-0x430, 0x443, 0x431, 0x43e, 0x43d, 0x3b, 0x43a, 0x44a, 0x443, 0x44b, 0x440, 0x438, 0x441, 0x4d5, 0x440, 0x3b, 0x434, 0x44b, 0x446, 0x446,
-0x4d5, 0x433, 0x3b, 0x4d5, 0x440, 0x442, 0x44b, 0x446, 0x446, 0x4d5, 0x433, 0x3b, 0x446, 0x44b, 0x43f, 0x43f, 0x4d5, 0x440, 0x4d5, 0x43c,
-0x3b, 0x43c, 0x430, 0x439, 0x440, 0x4d5, 0x43c, 0x431, 0x43e, 0x43d, 0x3b, 0x441, 0x430, 0x431, 0x430, 0x442, 0x3b, 0x53, 0x76, 0x6f,
-0x3b, 0x4d, 0x75, 0x76, 0x3b, 0x43, 0x68, 0x70, 0x3b, 0x43, 0x68, 0x74, 0x3b, 0x43, 0x68, 0x6e, 0x3b, 0x43, 0x68, 0x73,
-0x3b, 0x4d, 0x75, 0x67, 0x3b, 0x53, 0x76, 0x6f, 0x6e, 0x64, 0x6f, 0x3b, 0x4d, 0x75, 0x76, 0x68, 0x75, 0x72, 0x6f, 0x3b,
-0x43, 0x68, 0x69, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x43, 0x68, 0x69, 0x6e,
-0x61, 0x3b, 0x43, 0x68, 0x69, 0x73, 0x68, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x75, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x61, 0x3b,
-0x53, 0x3b, 0x4d, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x4d, 0x3b, 0x622, 0x686, 0x631, 0x3b, 0x633, 0x648,
-0x645, 0x631, 0x3b, 0x627, 0x6b1, 0x627, 0x631, 0x648, 0x3b, 0x627, 0x631, 0x628, 0x639, 0x3b, 0x62e, 0x645, 0x64a, 0x633, 0x3b, 0x62c,
-0x645, 0x639, 0x648, 0x3b, 0x687, 0x646, 0x687, 0x631, 0x3b, 0x622, 0x686, 0x631, 0x3b, 0x633, 0x648, 0x3b, 0x627, 0x6b1, 0x627, 0x631,
-0x648, 0x3b, 0x627, 0x631, 0x628, 0x639, 0x3b, 0x62e, 0x645, 0x3b, 0x62c, 0x645, 0x639, 0x648, 0x3b, 0x687, 0x646, 0x687, 0x631, 0x3b,
-0xd89, 0xdbb, 0xdd2, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdb3, 0xdd4, 0xdaf, 0xdcf, 0x3b, 0xd85, 0xd9f, 0xdc4, 0x3b, 0xdb6, 0xdaf, 0xdcf, 0xdaf,
-0xdcf, 0x3b, 0xdb6, 0xdca, 0x200d, 0xdbb, 0xdc4, 0xdc3, 0xdca, 0x3b, 0xdc3, 0xdd2, 0xd9a, 0xdd4, 0x3b, 0xdc3, 0xdd9, 0xdb1, 0x3b, 0xd89,
-0xdbb, 0xdd2, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdb3, 0xdd4, 0xdaf, 0xdcf, 0x3b, 0xd85, 0xd9f, 0xdc4, 0xdbb, 0xdd4, 0xdc0, 0xdcf, 0xdaf, 0xdcf,
-0x3b, 0xdb6, 0xdaf, 0xdcf, 0xdaf, 0xdcf, 0x3b, 0xdb6, 0xdca, 0x200d, 0xdbb, 0xdc4, 0xdc3, 0xdca, 0xdb4, 0xdad, 0xdd2, 0xdb1, 0xdca, 0xdaf,
-0xdcf, 0x3b, 0xdc3, 0xdd2, 0xd9a, 0xdd4, 0xdbb, 0xdcf, 0xdaf, 0xdcf, 0x3b, 0xdc3, 0xdd9, 0xdb1, 0xdc3, 0xdd4, 0xdbb, 0xdcf, 0xdaf, 0xdcf,
-0x3b, 0xd89, 0x3b, 0xdc3, 0x3b, 0xd85, 0x3b, 0xdb6, 0x3b, 0xdb6, 0xdca, 0x200d, 0xdbb, 0x3b, 0xdc3, 0xdd2, 0x3b, 0xdc3, 0xdd9, 0x3b,
-0x6e, 0x65, 0x3b, 0x70, 0x6f, 0x3b, 0x75, 0x74, 0x3b, 0x73, 0x74, 0x3b, 0x161, 0x74, 0x3b, 0x70, 0x69, 0x3b, 0x73, 0x6f,
-0x3b, 0x6e, 0x65, 0x64, 0x65, 0x13e, 0x61, 0x3b, 0x70, 0x6f, 0x6e, 0x64, 0x65, 0x6c, 0x6f, 0x6b, 0x3b, 0x75, 0x74, 0x6f,
-0x72, 0x6f, 0x6b, 0x3b, 0x73, 0x74, 0x72, 0x65, 0x64, 0x61, 0x3b, 0x161, 0x74, 0x76, 0x72, 0x74, 0x6f, 0x6b, 0x3b, 0x70,
-0x69, 0x61, 0x74, 0x6f, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x75, 0x3b, 0x73,
-0x3b, 0x161, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x6e, 0x65, 0x64, 0x2e, 0x3b, 0x70, 0x6f, 0x6e, 0x2e, 0x3b, 0x74, 0x6f, 0x72,
-0x2e, 0x3b, 0x73, 0x72, 0x65, 0x2e, 0x3b, 0x10d, 0x65, 0x74, 0x2e, 0x3b, 0x70, 0x65, 0x74, 0x2e, 0x3b, 0x73, 0x6f, 0x62,
-0x2e, 0x3b, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x61, 0x3b, 0x70, 0x6f, 0x6e, 0x65, 0x64, 0x65, 0x6c, 0x6a, 0x65, 0x6b,
-0x3b, 0x74, 0x6f, 0x72, 0x65, 0x6b, 0x3b, 0x73, 0x72, 0x65, 0x64, 0x61, 0x3b, 0x10d, 0x65, 0x74, 0x72, 0x74, 0x65, 0x6b,
-0x3b, 0x70, 0x65, 0x74, 0x65, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x74, 0x3b,
-0x73, 0x3b, 0x10d, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x41, 0x78, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x3b, 0x53, 0x6c, 0x73, 0x61,
-0x3b, 0x41, 0x72, 0x62, 0x63, 0x3b, 0x4b, 0x68, 0x6d, 0x73, 0x3b, 0x4a, 0x6d, 0x63, 0x3b, 0x53, 0x62, 0x74, 0x69, 0x3b,
-0x41, 0x78, 0x61, 0x64, 0x3b, 0x49, 0x73, 0x6e, 0x69, 0x69, 0x6e, 0x3b, 0x53, 0x61, 0x6c, 0x61, 0x61, 0x73, 0x61, 0x3b,
-0x41, 0x72, 0x62, 0x61, 0x63, 0x61, 0x3b, 0x4b, 0x68, 0x61, 0x6d, 0x69, 0x69, 0x73, 0x3b, 0x4a, 0x69, 0x6d, 0x63, 0x65,
-0x3b, 0x53, 0x61, 0x62, 0x74, 0x69, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x41, 0x3b, 0x4b, 0x68, 0x3b, 0x4a, 0x3b,
-0x53, 0x3b, 0x64, 0x6f, 0x6d, 0x2e, 0x3b, 0x6c, 0x75, 0x6e, 0x2e, 0x3b, 0x6d, 0x61, 0x72, 0x2e, 0x3b, 0x6d, 0x69, 0xe9,
-0x2e, 0x3b, 0x6a, 0x75, 0x65, 0x2e, 0x3b, 0x76, 0x69, 0x65, 0x2e, 0x3b, 0x73, 0xe1, 0x62, 0x2e, 0x3b, 0x64, 0x6f, 0x6d,
-0x69, 0x6e, 0x67, 0x6f, 0x3b, 0x6c, 0x75, 0x6e, 0x65, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x6d, 0x69,
-0xe9, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x6a, 0x75, 0x65, 0x76, 0x65, 0x73, 0x3b, 0x76, 0x69, 0x65, 0x72, 0x6e,
-0x65, 0x73, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c, 0x69, 0x3b, 0x4a,
-0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61,
-0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61,
-0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x73, 0xf6, 0x6e, 0x3b, 0x6d, 0xe5, 0x6e, 0x3b, 0x74, 0x69,
-0x73, 0x3b, 0x6f, 0x6e, 0x73, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x3b, 0x66, 0x72, 0x65, 0x3b, 0x6c, 0xf6, 0x72, 0x3b, 0x73,
-0xf6, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0xe5, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x69, 0x73, 0x64, 0x61, 0x67, 0x3b,
-0x6f, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x66, 0x72, 0x65, 0x64, 0x61,
-0x67, 0x3b, 0x6c, 0xf6, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x42f, 0x448, 0x431, 0x3b, 0x414, 0x448, 0x431, 0x3b, 0x421, 0x448, 0x431,
-0x3b, 0x427, 0x448, 0x431, 0x3b, 0x41f, 0x448, 0x431, 0x3b, 0x4b6, 0x43c, 0x44a, 0x3b, 0x428, 0x43d, 0x431, 0x3b, 0x42f, 0x43a, 0x448,
-0x430, 0x43d, 0x431, 0x435, 0x3b, 0x414, 0x443, 0x448, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x421, 0x435, 0x448, 0x430, 0x43d, 0x431, 0x435,
-0x3b, 0x427, 0x43e, 0x440, 0x448, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x41f, 0x430, 0x43d, 0x4b7, 0x448, 0x430, 0x43d, 0x431, 0x435, 0x3b,
-0x4b6, 0x443, 0x43c, 0x44a, 0x430, 0x3b, 0x428, 0x430, 0x43d, 0x431, 0x435, 0x3b, 0x42f, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x427, 0x3b,
-0x41f, 0x3b, 0x4b6, 0x3b, 0x428, 0x3b, 0xb9e, 0xbbe, 0xbaf, 0xbbf, 0x2e, 0x3b, 0xba4, 0xbbf, 0xb99, 0xbcd, 0x2e, 0x3b, 0xb9a, 0xbc6,
-0xbb5, 0xbcd, 0x2e, 0x3b, 0xbaa, 0xbc1, 0xba4, 0x2e, 0x3b, 0xbb5, 0xbbf, 0xbaf, 0xbbe, 0x2e, 0x3b, 0xbb5, 0xbc6, 0xbb3, 0xbcd, 0x2e,
-0x3b, 0xb9a, 0xba9, 0xbbf, 0x3b, 0xb9e, 0xbbe, 0xbaf, 0xbbf, 0xbb1, 0xbc1, 0x3b, 0xba4, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbb3, 0xbcd, 0x3b,
-0xb9a, 0xbc6, 0xbb5, 0xbcd, 0xbb5, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0xbaa, 0xbc1, 0xba4, 0xba9, 0xbcd, 0x3b, 0xbb5, 0xbbf, 0xbaf, 0xbbe, 0xbb4,
-0xba9, 0xbcd, 0x3b, 0xbb5, 0xbc6, 0xbb3, 0xbcd, 0xbb3, 0xbbf, 0x3b, 0xb9a, 0xba9, 0xbbf, 0x3b, 0xb9e, 0xbbe, 0x3b, 0xba4, 0xbbf, 0x3b,
-0xb9a, 0xbc6, 0x3b, 0xbaa, 0xbc1, 0x3b, 0xbb5, 0xbbf, 0x3b, 0xbb5, 0xbc6, 0x3b, 0xb9a, 0x3b, 0x44f, 0x43a, 0x448, 0x2e, 0x3b, 0x434,
-0x4af, 0x448, 0x2e, 0x3b, 0x441, 0x438, 0x448, 0x2e, 0x3b, 0x447, 0x4d9, 0x440, 0x2e, 0x3b, 0x43f, 0x4d9, 0x43d, 0x497, 0x2e, 0x3b,
-0x497, 0x43e, 0x43c, 0x2e, 0x3b, 0x448, 0x438, 0x43c, 0x2e, 0x3b, 0x44f, 0x43a, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x434, 0x4af,
-0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x441, 0x438, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x447, 0x4d9, 0x440, 0x448, 0x4d9, 0x43c,
-0x431, 0x435, 0x3b, 0x43f, 0x4d9, 0x43d, 0x497, 0x435, 0x448, 0x4d9, 0x43c, 0x431, 0x435, 0x3b, 0x497, 0x43e, 0x43c, 0x433, 0x430, 0x3b,
-0x448, 0x438, 0x43c, 0x431, 0x4d9, 0x3b, 0x42f, 0x3b, 0x414, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x496, 0x3b, 0x428, 0x3b,
-0xc06, 0xc26, 0xc3f, 0x3b, 0xc38, 0xc4b, 0xc2e, 0x3b, 0xc2e, 0xc02, 0xc17, 0xc33, 0x3b, 0xc2c, 0xc41, 0xc27, 0x3b, 0xc17, 0xc41, 0xc30,
-0xc41, 0x3b, 0xc36, 0xc41, 0xc15, 0xc4d, 0xc30, 0x3b, 0xc36, 0xc28, 0xc3f, 0x3b, 0xc06, 0xc26, 0xc3f, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b,
-0xc38, 0xc4b, 0xc2e, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc2e, 0xc02, 0xc17, 0xc33, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc2c, 0xc41, 0xc27,
-0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc17, 0xc41, 0xc30, 0xc41, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc36, 0xc41, 0xc15, 0xc4d, 0xc30, 0xc35,
-0xc3e, 0xc30, 0xc02, 0x3b, 0xc36, 0xc28, 0xc3f, 0xc35, 0xc3e, 0xc30, 0xc02, 0x3b, 0xc06, 0x3b, 0xc38, 0xc4b, 0x3b, 0xc2e, 0x3b, 0xc2c,
-0xc41, 0x3b, 0xc17, 0xc41, 0x3b, 0xc36, 0xc41, 0x3b, 0xc36, 0x3b, 0xe2d, 0xe32, 0x2e, 0x3b, 0xe08, 0x2e, 0x3b, 0xe2d, 0x2e, 0x3b,
-0xe1e, 0x2e, 0x3b, 0xe1e, 0xe24, 0x2e, 0x3b, 0xe28, 0x2e, 0x3b, 0xe2a, 0x2e, 0x3b, 0xe27, 0xe31, 0xe19, 0xe2d, 0xe32, 0xe17, 0xe34,
-0xe15, 0xe22, 0xe4c, 0x3b, 0xe27, 0xe31, 0xe19, 0xe08, 0xe31, 0xe19, 0xe17, 0xe23, 0xe4c, 0x3b, 0xe27, 0xe31, 0xe19, 0xe2d, 0xe31, 0xe07,
-0xe04, 0xe32, 0xe23, 0x3b, 0xe27, 0xe31, 0xe19, 0xe1e, 0xe38, 0xe18, 0x3b, 0xe27, 0xe31, 0xe19, 0xe1e, 0xe24, 0xe2b, 0xe31, 0xe2a, 0xe1a,
-0xe14, 0xe35, 0x3b, 0xe27, 0xe31, 0xe19, 0xe28, 0xe38, 0xe01, 0xe23, 0xe4c, 0x3b, 0xe27, 0xe31, 0xe19, 0xe40, 0xe2a, 0xe32, 0xe23, 0xe4c,
-0x3b, 0xe2d, 0xe32, 0x3b, 0xe08, 0x3b, 0xe2d, 0x3b, 0xe1e, 0x3b, 0xe1e, 0xe24, 0x3b, 0xe28, 0x3b, 0xe2a, 0x3b, 0xf49, 0xf72, 0xf0b,
-0xf58, 0xf0b, 0x3b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0x3b, 0xf58, 0xf72, 0xf42, 0xf0b, 0xf51, 0xf58, 0xf62, 0xf0b, 0x3b, 0xf63, 0xfb7,
-0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf55, 0xf74, 0xf62, 0xf0b, 0xf56, 0xf74, 0xf0b, 0x3b, 0xf54, 0xf0b, 0xf66, 0xf44, 0xf66, 0xf0b, 0x3b,
-0xf66, 0xfa4, 0xf7a, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf49, 0xf72, 0xf0b, 0xf58, 0xf0b, 0x3b, 0xf42, 0xf5f,
-0xf60, 0xf0b, 0xf5f, 0xfb3, 0xf0b, 0xf56, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf58, 0xf72, 0xf42, 0xf0b, 0xf51, 0xf58, 0xf62, 0xf0b,
-0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf63, 0xfb7, 0xf42, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf55, 0xf74, 0xf62, 0xf0b,
-0xf56, 0xf74, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf54, 0xf0b, 0xf66, 0xf44, 0xf66, 0xf0b, 0x3b, 0xf42, 0xf5f, 0xf60, 0xf0b, 0xf66,
-0xfa4, 0xf7a, 0xf53, 0xf0b, 0xf54, 0xf0b, 0x3b, 0xf49, 0xf72, 0x3b, 0xf5f, 0xfb3, 0x3b, 0xf58, 0xf72, 0xf42, 0x3b, 0xf63, 0xfb7, 0xf42,
-0x3b, 0xf55, 0xf74, 0xf62, 0x3b, 0xf66, 0xf44, 0xf66, 0x3b, 0xf66, 0xfa4, 0xf7a, 0xf53, 0x3b, 0x1230, 0x1295, 0x3b, 0x1230, 0x1291, 0x3b,
-0x1230, 0x1209, 0x3b, 0x1228, 0x1261, 0x3b, 0x1213, 0x1219, 0x3b, 0x12d3, 0x122d, 0x3b, 0x1240, 0x12f3, 0x3b, 0x1230, 0x1295, 0x1260, 0x1275, 0x3b,
-0x1230, 0x1291, 0x12ed, 0x3b, 0x1220, 0x1209, 0x1235, 0x3b, 0x1228, 0x1261, 0x12d5, 0x3b, 0x1283, 0x1219, 0x1235, 0x3b, 0x12d3, 0x122d, 0x1262, 0x3b,
-0x1240, 0x12f3, 0x121d, 0x3b, 0x1230, 0x3b, 0x1230, 0x3b, 0x1220, 0x3b, 0x1228, 0x3b, 0x1213, 0x3b, 0x12d3, 0x3b, 0x1240, 0x3b, 0x1230, 0x3b,
-0x1230, 0x3b, 0x1230, 0x3b, 0x1228, 0x3b, 0x1213, 0x3b, 0x12d3, 0x3b, 0x1240, 0x3b, 0x53, 0x101, 0x70, 0x3b, 0x4d, 0x14d, 0x6e, 0x3b,
-0x54, 0x16b, 0x73, 0x3b, 0x50, 0x75, 0x6c, 0x3b, 0x54, 0x75, 0x2bb, 0x61, 0x3b, 0x46, 0x61, 0x6c, 0x3b, 0x54, 0x6f, 0x6b,
-0x3b, 0x53, 0x101, 0x70, 0x61, 0x74, 0x65, 0x3b, 0x4d, 0x14d, 0x6e, 0x69, 0x74, 0x65, 0x3b, 0x54, 0x16b, 0x73, 0x69, 0x74,
-0x65, 0x3b, 0x50, 0x75, 0x6c, 0x65, 0x6c, 0x75, 0x6c, 0x75, 0x3b, 0x54, 0x75, 0x2bb, 0x61, 0x70, 0x75, 0x6c, 0x65, 0x6c,
-0x75, 0x6c, 0x75, 0x3b, 0x46, 0x61, 0x6c, 0x61, 0x69, 0x74, 0x65, 0x3b, 0x54, 0x6f, 0x6b, 0x6f, 0x6e, 0x61, 0x6b, 0x69,
-0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x46, 0x3b, 0x54, 0x3b, 0x50, 0x61, 0x7a, 0x3b, 0x50,
-0x7a, 0x74, 0x3b, 0x53, 0x61, 0x6c, 0x3b, 0xc7, 0x61, 0x72, 0x3b, 0x50, 0x65, 0x72, 0x3b, 0x43, 0x75, 0x6d, 0x3b, 0x43,
-0x6d, 0x74, 0x3b, 0x50, 0x61, 0x7a, 0x61, 0x72, 0x3b, 0x50, 0x61, 0x7a, 0x61, 0x72, 0x74, 0x65, 0x73, 0x69, 0x3b, 0x53,
-0x61, 0x6c, 0x131, 0x3b, 0xc7, 0x61, 0x72, 0x15f, 0x61, 0x6d, 0x62, 0x61, 0x3b, 0x50, 0x65, 0x72, 0x15f, 0x65, 0x6d, 0x62,
-0x65, 0x3b, 0x43, 0x75, 0x6d, 0x61, 0x3b, 0x43, 0x75, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x69, 0x3b, 0x50, 0x3b, 0x50,
-0x3b, 0x53, 0x3b, 0xc7, 0x3b, 0x50, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0xdd, 0x65, 0x6b, 0x3b, 0x44, 0x75, 0x15f, 0x3b, 0x53,
-0x69, 0x15f, 0x3b, 0xc7, 0x61, 0x72, 0x3b, 0x50, 0x65, 0x6e, 0x3b, 0x41, 0x6e, 0x6e, 0x3b, 0x15e, 0x65, 0x6e, 0x3b, 0xdd,
-0x65, 0x6b, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x44, 0x75, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x53, 0x69, 0x15f, 0x65,
-0x6e, 0x62, 0x65, 0x3b, 0xc7, 0x61, 0x72, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x50, 0x65, 0x6e, 0x15f, 0x65, 0x6e, 0x62,
-0x65, 0x3b, 0x41, 0x6e, 0x6e, 0x61, 0x3b, 0x15e, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0xdd, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0xc7,
-0x3b, 0x50, 0x3b, 0x41, 0x3b, 0x15e, 0x3b, 0xfd, 0x65, 0x6b, 0x3b, 0x64, 0x75, 0x15f, 0x3b, 0x73, 0x69, 0x15f, 0x3b, 0xe7,
-0x61, 0x72, 0x3b, 0x70, 0x65, 0x6e, 0x3b, 0x61, 0x6e, 0x6e, 0x3b, 0x15f, 0x65, 0x6e, 0x3b, 0xfd, 0x65, 0x6b, 0x15f, 0x65,
-0x6e, 0x62, 0x65, 0x3b, 0x64, 0x75, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x73, 0x69, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b,
-0xe7, 0x61, 0x72, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x70, 0x65, 0x6e, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x61, 0x6e,
-0x6e, 0x61, 0x3b, 0x15f, 0x65, 0x6e, 0x62, 0x65, 0x3b, 0x64a, 0x6d5, 0x3b, 0x62f, 0x6c8, 0x3b, 0x633, 0x6d5, 0x3b, 0x686, 0x627,
-0x3b, 0x67e, 0x6d5, 0x3b, 0x62c, 0x6c8, 0x3b, 0x634, 0x6d5, 0x3b, 0x64a, 0x6d5, 0x643, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x62f,
-0x6c8, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x633, 0x6d5, 0x64a, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x686, 0x627, 0x631, 0x634,
-0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x67e, 0x6d5, 0x64a, 0x634, 0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x62c, 0x6c8, 0x645, 0x6d5, 0x3b, 0x634,
-0x6d5, 0x646, 0x628, 0x6d5, 0x3b, 0x64a, 0x3b, 0x62f, 0x3b, 0x633, 0x3b, 0x686, 0x3b, 0x67e, 0x3b, 0x62c, 0x3b, 0x634, 0x3b, 0x43d,
-0x435, 0x434, 0x456, 0x43b, 0x44f, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x456, 0x43b, 0x43e, 0x43a, 0x3b, 0x432, 0x456, 0x432, 0x442,
-0x43e, 0x440, 0x43e, 0x43a, 0x3b, 0x441, 0x435, 0x440, 0x435, 0x434, 0x430, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x435, 0x440, 0x3b, 0x43f,
-0x2bc, 0x44f, 0x442, 0x43d, 0x438, 0x446, 0x44f, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442, 0x430, 0x3b, 0x41d, 0x3b, 0x41f, 0x3b, 0x412,
-0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x41f, 0x3b, 0x421, 0x3b, 0x627, 0x62a, 0x648, 0x627, 0x631, 0x3b, 0x67e, 0x6cc, 0x631, 0x3b, 0x645,
-0x646, 0x6af, 0x644, 0x3b, 0x628, 0x62f, 0x6be, 0x3b, 0x62c, 0x645, 0x639, 0x631, 0x627, 0x62a, 0x3b, 0x62c, 0x645, 0x639, 0x6c1, 0x3b,
-0x6c1, 0x641, 0x62a, 0x6c1, 0x3b, 0x59, 0x61, 0x6b, 0x3b, 0x44, 0x75, 0x73, 0x68, 0x3b, 0x53, 0x65, 0x73, 0x68, 0x3b, 0x43,
-0x68, 0x6f, 0x72, 0x3b, 0x50, 0x61, 0x79, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x53, 0x68, 0x61, 0x6e, 0x3b, 0x79, 0x61, 0x6b,
-0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x64, 0x75, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x73, 0x65, 0x73, 0x68,
-0x61, 0x6e, 0x62, 0x61, 0x3b, 0x63, 0x68, 0x6f, 0x72, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x70, 0x61, 0x79, 0x73,
-0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x73, 0x68, 0x61, 0x6e, 0x62, 0x61, 0x3b, 0x59, 0x3b,
-0x44, 0x3b, 0x53, 0x3b, 0x43, 0x3b, 0x50, 0x3b, 0x4a, 0x3b, 0x53, 0x3b, 0x6cc, 0x2e, 0x3b, 0x62f, 0x2e, 0x3b, 0x633, 0x2e,
-0x3b, 0x686, 0x2e, 0x3b, 0x67e, 0x2e, 0x3b, 0x62c, 0x2e, 0x3b, 0x634, 0x2e, 0x3b, 0x44f, 0x43a, 0x448, 0x3b, 0x434, 0x443, 0x448,
-0x3b, 0x441, 0x435, 0x448, 0x3b, 0x447, 0x43e, 0x440, 0x3b, 0x43f, 0x430, 0x439, 0x3b, 0x436, 0x443, 0x43c, 0x3b, 0x448, 0x430, 0x43d,
-0x3b, 0x44f, 0x43a, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x434, 0x443, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x441, 0x435, 0x448,
-0x430, 0x43d, 0x431, 0x430, 0x3b, 0x447, 0x43e, 0x440, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x43f, 0x430, 0x439, 0x448, 0x430, 0x43d,
-0x431, 0x430, 0x3b, 0x436, 0x443, 0x43c, 0x430, 0x3b, 0x448, 0x430, 0x43d, 0x431, 0x430, 0x3b, 0x42f, 0x3b, 0x414, 0x3b, 0x421, 0x3b,
-0x427, 0x3b, 0x41f, 0x3b, 0x416, 0x3b, 0x428, 0x3b, 0x43, 0x4e, 0x3b, 0x54, 0x68, 0x20, 0x32, 0x3b, 0x54, 0x68, 0x20, 0x33,
-0x3b, 0x54, 0x68, 0x20, 0x34, 0x3b, 0x54, 0x68, 0x20, 0x35, 0x3b, 0x54, 0x68, 0x20, 0x36, 0x3b, 0x54, 0x68, 0x20, 0x37,
-0x3b, 0x43, 0x68, 0x1ee7, 0x20, 0x4e, 0x68, 0x1ead, 0x74, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x48, 0x61, 0x69, 0x3b, 0x54, 0x68,
-0x1ee9, 0x20, 0x42, 0x61, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x54, 0x1b0, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x4e, 0x103, 0x6d, 0x3b,
-0x54, 0x68, 0x1ee9, 0x20, 0x53, 0xe1, 0x75, 0x3b, 0x54, 0x68, 0x1ee9, 0x20, 0x42, 0x1ea3, 0x79, 0x3b, 0x43, 0x4e, 0x3b, 0x54,
-0x32, 0x3b, 0x54, 0x33, 0x3b, 0x54, 0x34, 0x3b, 0x54, 0x35, 0x3b, 0x54, 0x36, 0x3b, 0x54, 0x37, 0x3b, 0x53, 0x75, 0x3b,
-0x4d, 0x75, 0x3b, 0x54, 0x75, 0x3b, 0x56, 0x65, 0x3b, 0x44, 0xf6, 0x3b, 0x46, 0x72, 0x3b, 0x5a, 0xe4, 0x3b, 0x73, 0x75,
-0x64, 0x65, 0x6c, 0x3b, 0x6d, 0x75, 0x64, 0x65, 0x6c, 0x3b, 0x74, 0x75, 0x64, 0x65, 0x6c, 0x3b, 0x76, 0x65, 0x64, 0x65,
-0x6c, 0x3b, 0x64, 0xf6, 0x64, 0x65, 0x6c, 0x3b, 0x66, 0x72, 0x69, 0x64, 0x65, 0x6c, 0x3b, 0x7a, 0xe4, 0x64, 0x65, 0x6c,
-0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x54, 0x3b, 0x56, 0x3b, 0x44, 0x3b, 0x46, 0x3b, 0x5a, 0x3b, 0x73, 0x75, 0x2e, 0x3b, 0x6d,
-0x75, 0x2e, 0x3b, 0x74, 0x75, 0x2e, 0x3b, 0x76, 0x65, 0x2e, 0x3b, 0x64, 0xf6, 0x2e, 0x3b, 0x66, 0x72, 0x2e, 0x3b, 0x7a,
-0xe4, 0x2e, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x6c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x4d, 0x65, 0x72, 0x3b,
-0x49, 0x61, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x53, 0x75, 0x6c,
-0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x4c, 0x6c, 0x75, 0x6e, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x4d, 0x61, 0x77, 0x72,
-0x74, 0x68, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x4d, 0x65, 0x72, 0x63, 0x68, 0x65, 0x72, 0x3b, 0x44, 0x79, 0x64, 0x64,
-0x20, 0x49, 0x61, 0x75, 0x3b, 0x44, 0x79, 0x64, 0x64, 0x20, 0x47, 0x77, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x44, 0x79, 0x64,
-0x64, 0x20, 0x53, 0x61, 0x64, 0x77, 0x72, 0x6e, 0x3b, 0x53, 0x3b, 0x4c, 0x6c, 0x3b, 0x4d, 0x3b, 0x4d, 0x3b, 0x49, 0x3b,
-0x47, 0x3b, 0x53, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x6c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x77, 0x3b, 0x4d, 0x65, 0x72,
-0x3b, 0x49, 0x61, 0x75, 0x3b, 0x47, 0x77, 0x65, 0x6e, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x44, 0x69, 0x62, 0x3b, 0x41, 0x6c,
-0x74, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0xc0, 0x6c, 0x61, 0x3b, 0x41, 0x6c, 0x78, 0x3b, 0xc0, 0x6a, 0x6a, 0x3b, 0x41, 0x73,
-0x65, 0x3b, 0x44, 0x69, 0x62, 0xe9, 0x65, 0x72, 0x3b, 0x41, 0x6c, 0x74, 0x69, 0x6e, 0x65, 0x3b, 0x54, 0x61, 0x6c, 0x61,
-0x61, 0x74, 0x61, 0x3b, 0xc0, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x78, 0x61, 0x6d, 0x69, 0x73, 0x3b, 0xc0,
-0x6a, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x65, 0x65, 0x72, 0x3b, 0x43, 0x61, 0x77, 0x3b, 0x4d, 0x76, 0x75, 0x3b,
-0x42, 0x69, 0x6e, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x53, 0x69, 0x6e, 0x3b, 0x48, 0x6c, 0x61, 0x3b, 0x4d, 0x67, 0x71, 0x3b,
-0x43, 0x61, 0x77, 0x65, 0x3b, 0x4d, 0x76, 0x75, 0x6c, 0x6f, 0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x62, 0x69, 0x6e, 0x69,
-0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x74, 0x68, 0x61, 0x74, 0x68, 0x75, 0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x6e, 0x65,
-0x3b, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x68, 0x6c, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x67, 0x71, 0x69, 0x62, 0x65, 0x6c, 0x6f,
-0x3b, 0x5d6, 0x5d5, 0x5e0, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5de, 0x5d0, 0x5b8, 0x5e0, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5d3, 0x5d9, 0x5e0, 0x5e1,
-0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5de, 0x5d9, 0x5d8, 0x5d5, 0x5d5, 0x5d0, 0x5da, 0x3b, 0x5d3, 0x5d0, 0x5e0, 0x5e2, 0x5e8, 0x5e9, 0x5d8, 0x5d9,
-0x5e7, 0x3b, 0x5e4, 0x5bf, 0x5e8, 0x5f2, 0x5b7, 0x5d8, 0x5d9, 0x5e7, 0x3b, 0x5e9, 0x5d1, 0x5ea, 0x3b, 0xc0, 0xec, 0x6b, 0x3b, 0x41,
-0x6a, 0x3b, 0xcc, 0x73, 0x1eb9, 0x301, 0x67, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x72, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x62, 0x3b,
-0x1eb8, 0x74, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x3b, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x41, 0x6a, 0xe9, 0x3b, 0xcc, 0x73, 0x1eb9,
-0x301, 0x67, 0x75, 0x6e, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x72, 0xfa, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x62, 0x1ecd, 0x3b, 0x1eb8,
-0x74, 0xec, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x1eb9, 0x301, 0x74, 0x61, 0x3b, 0xc0, 0x3b, 0x41, 0x3b, 0xcc, 0x3b, 0x1ecc, 0x3b,
-0x1ecc, 0x3b, 0x1eb8, 0x3b, 0xc0, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301,
-0x20, 0x41, 0x6a, 0xe9, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0xcc, 0x73, 0x1eb9, 0x301, 0x67, 0x75, 0x6e, 0x3b, 0x1ecc, 0x6a,
-0x1ecd, 0x301, 0x72, 0xfa, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x62, 0x1ecd, 0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0x1eb8, 0x74, 0xec,
-0x3b, 0x1ecc, 0x6a, 0x1ecd, 0x301, 0x20, 0xc0, 0x62, 0xe1, 0x6d, 0x1eb9, 0x301, 0x74, 0x61, 0x3b, 0xc0, 0xec, 0x6b, 0x3b, 0x41,
-0x6a, 0x3b, 0xcc, 0x73, 0x25b, 0x301, 0x67, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x72, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x62, 0x3b,
-0x190, 0x74, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x3b, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x41, 0x6a, 0xe9, 0x3b, 0xcc, 0x73, 0x25b,
-0x301, 0x67, 0x75, 0x6e, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x72, 0xfa, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x62, 0x254, 0x3b, 0x190,
-0x74, 0xec, 0x3b, 0xc0, 0x62, 0xe1, 0x6d, 0x25b, 0x301, 0x74, 0x61, 0x3b, 0xc0, 0x3b, 0x41, 0x3b, 0xcc, 0x3b, 0x186, 0x3b,
-0x186, 0x3b, 0x190, 0x3b, 0xc0, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0xc0, 0xec, 0x6b, 0xfa, 0x3b, 0x186, 0x6a, 0x254, 0x301,
-0x20, 0x41, 0x6a, 0xe9, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0xcc, 0x73, 0x25b, 0x301, 0x67, 0x75, 0x6e, 0x3b, 0x186, 0x6a,
-0x254, 0x301, 0x72, 0xfa, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x62, 0x254, 0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0x190, 0x74, 0xec,
-0x3b, 0x186, 0x6a, 0x254, 0x301, 0x20, 0xc0, 0x62, 0xe1, 0x6d, 0x25b, 0x301, 0x74, 0x61, 0x3b, 0x53, 0x6f, 0x6e, 0x3b, 0x4d,
-0x73, 0x6f, 0x3b, 0x42, 0x69, 0x6c, 0x3b, 0x54, 0x68, 0x61, 0x3b, 0x53, 0x69, 0x6e, 0x3b, 0x48, 0x6c, 0x61, 0x3b, 0x4d,
-0x67, 0x71, 0x3b, 0x49, 0x53, 0x6f, 0x6e, 0x74, 0x6f, 0x3b, 0x55, 0x4d, 0x73, 0x6f, 0x6d, 0x62, 0x75, 0x6c, 0x75, 0x6b,
-0x6f, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x74,
-0x68, 0x61, 0x74, 0x68, 0x75, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73, 0x69, 0x6e, 0x65, 0x3b, 0x55, 0x4c, 0x77, 0x65, 0x73,
-0x69, 0x68, 0x6c, 0x61, 0x6e, 0x75, 0x3b, 0x55, 0x4d, 0x67, 0x71, 0x69, 0x62, 0x65, 0x6c, 0x6f, 0x3b, 0x53, 0x3b, 0x4d,
-0x3b, 0x42, 0x3b, 0x54, 0x3b, 0x53, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x73, 0xf8, 0x6e, 0x3b, 0x6d, 0xe5, 0x6e, 0x3b, 0x74,
-0x79, 0x73, 0x3b, 0x6f, 0x6e, 0x73, 0x3b, 0x74, 0x6f, 0x72, 0x3b, 0x66, 0x72, 0x65, 0x3b, 0x6c, 0x61, 0x75, 0x3b, 0x73,
-0xf8, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x6d, 0xe5, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x79, 0x73, 0x64, 0x61, 0x67, 0x3b,
-0x6f, 0x6e, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x74, 0x6f, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x66, 0x72, 0x65, 0x64, 0x61,
-0x67, 0x3b, 0x6c, 0x61, 0x75, 0x72, 0x64, 0x61, 0x67, 0x3b, 0x73, 0xf8, 0x2e, 0x3b, 0x6d, 0xe5, 0x2e, 0x3b, 0x74, 0x79,
-0x2e, 0x3b, 0x6f, 0x6e, 0x2e, 0x3b, 0x74, 0x6f, 0x2e, 0x3b, 0x66, 0x72, 0x2e, 0x3b, 0x6c, 0x61, 0x2e, 0x3b, 0x43d, 0x435,
-0x434, 0x3b, 0x43f, 0x43e, 0x43d, 0x3b, 0x443, 0x442, 0x43e, 0x3b, 0x441, 0x440, 0x438, 0x3b, 0x447, 0x435, 0x442, 0x3b, 0x43f, 0x435,
-0x442, 0x3b, 0x441, 0x443, 0x431, 0x3b, 0x43d, 0x435, 0x434, 0x458, 0x435, 0x459, 0x430, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x458,
-0x435, 0x459, 0x430, 0x43a, 0x3b, 0x443, 0x442, 0x43e, 0x440, 0x430, 0x43a, 0x3b, 0x441, 0x440, 0x438, 0x458, 0x435, 0x434, 0x430, 0x3b,
-0x447, 0x435, 0x442, 0x432, 0x440, 0x442, 0x430, 0x43a, 0x3b, 0x43f, 0x435, 0x442, 0x430, 0x43a, 0x3b, 0x441, 0x443, 0x431, 0x43e, 0x442,
-0x430, 0x3b, 0x4a, 0x65, 0x64, 0x3b, 0x4a, 0x65, 0x6c, 0x3b, 0x4a, 0x65, 0x6d, 0x3b, 0x4a, 0x65, 0x72, 0x63, 0x3b, 0x4a,
-0x65, 0x72, 0x64, 0x3b, 0x4a, 0x65, 0x68, 0x3b, 0x4a, 0x65, 0x73, 0x3b, 0x4a, 0x65, 0x64, 0x6f, 0x6f, 0x6e, 0x65, 0x65,
-0x3b, 0x4a, 0x65, 0x6c, 0x68, 0x65, 0x69, 0x6e, 0x3b, 0x4a, 0x65, 0x6d, 0x61, 0x79, 0x72, 0x74, 0x3b, 0x4a, 0x65, 0x72,
-0x63, 0x65, 0x61, 0x6e, 0x3b, 0x4a, 0x65, 0x72, 0x64, 0x65, 0x69, 0x6e, 0x3b, 0x4a, 0x65, 0x68, 0x65, 0x69, 0x6e, 0x65,
-0x79, 0x3b, 0x4a, 0x65, 0x73, 0x61, 0x72, 0x6e, 0x3b, 0x53, 0x75, 0x6c, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x74, 0x68,
-0x3b, 0x4d, 0x68, 0x72, 0x3b, 0x59, 0x6f, 0x77, 0x3b, 0x47, 0x77, 0x65, 0x3b, 0x53, 0x61, 0x64, 0x3b, 0x64, 0x79, 0x20,
-0x53, 0x75, 0x6c, 0x3b, 0x64, 0x79, 0x20, 0x4c, 0x75, 0x6e, 0x3b, 0x64, 0x79, 0x20, 0x4d, 0x65, 0x75, 0x72, 0x74, 0x68,
-0x3b, 0x64, 0x79, 0x20, 0x4d, 0x65, 0x72, 0x68, 0x65, 0x72, 0x3b, 0x64, 0x79, 0x20, 0x59, 0x6f, 0x77, 0x3b, 0x64, 0x79,
-0x20, 0x47, 0x77, 0x65, 0x6e, 0x65, 0x72, 0x3b, 0x64, 0x79, 0x20, 0x53, 0x61, 0x64, 0x6f, 0x72, 0x6e, 0x3b, 0x4b, 0x77,
-0x65, 0x3b, 0x44, 0x77, 0x6f, 0x3b, 0x42, 0x65, 0x6e, 0x3b, 0x57, 0x75, 0x6b, 0x3b, 0x59, 0x61, 0x77, 0x3b, 0x46, 0x69,
-0x61, 0x3b, 0x4d, 0x65, 0x6d, 0x3b, 0x4b, 0x77, 0x65, 0x73, 0x69, 0x64, 0x61, 0x3b, 0x44, 0x77, 0x6f, 0x77, 0x64, 0x61,
-0x3b, 0x42, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x3b, 0x57, 0x75, 0x6b, 0x75, 0x64, 0x61, 0x3b, 0x59, 0x61, 0x77, 0x64, 0x61,
-0x3b, 0x46, 0x69, 0x64, 0x61, 0x3b, 0x4d, 0x65, 0x6d, 0x65, 0x6e, 0x65, 0x64, 0x61, 0x3b, 0x4b, 0x3b, 0x44, 0x3b, 0x42,
-0x3b, 0x57, 0x3b, 0x59, 0x3b, 0x46, 0x3b, 0x4d, 0x3b, 0x906, 0x92f, 0x924, 0x93e, 0x930, 0x3b, 0x938, 0x94b, 0x92e, 0x93e, 0x930,
-0x3b, 0x92e, 0x902, 0x917, 0x933, 0x93e, 0x930, 0x3b, 0x92c, 0x941, 0x927, 0x935, 0x93e, 0x930, 0x3b, 0x917, 0x941, 0x930, 0x941, 0x935,
-0x93e, 0x930, 0x3b, 0x936, 0x941, 0x915, 0x94d, 0x930, 0x93e, 0x930, 0x3b, 0x936, 0x947, 0x928, 0x935, 0x93e, 0x930, 0x3b, 0x906, 0x3b,
-0x938, 0x94b, 0x3b, 0x92e, 0x902, 0x3b, 0x92c, 0x941, 0x3b, 0x917, 0x941, 0x3b, 0x936, 0x941, 0x3b, 0x936, 0x947, 0x3b, 0x1ee4, 0x6b,
-0x61, 0x3b, 0x4d, 0x1ecd, 0x6e, 0x3b, 0x54, 0x69, 0x75, 0x3b, 0x57, 0x65, 0x6e, 0x3b, 0x54, 0x1ecd, 0x1ecd, 0x3b, 0x46, 0x72,
-0x61, 0x1ecb, 0x3b, 0x53, 0x61, 0x74, 0x1ecd, 0x64, 0x65, 0x65, 0x3b, 0x1ee4, 0x62, 0x1ecd, 0x63, 0x68, 0x1ecb, 0x20, 0x1ee4, 0x6b,
-0x61, 0x3b, 0x4d, 0x1ecd, 0x6e, 0x64, 0x65, 0x3b, 0x54, 0x69, 0x75, 0x7a, 0x64, 0x65, 0x65, 0x3b, 0x57, 0x65, 0x6e, 0x65,
-0x7a, 0x64, 0x65, 0x65, 0x3b, 0x54, 0x1ecd, 0x1ecd, 0x7a, 0x64, 0x65, 0x65, 0x3b, 0x46, 0x72, 0x61, 0x1ecb, 0x64, 0x65, 0x65,
-0x3b, 0x53, 0x61, 0x74, 0x1ecd, 0x64, 0x65, 0x65, 0x3b, 0x57, 0x6b, 0x79, 0x3b, 0x57, 0x6b, 0x77, 0x3b, 0x57, 0x6b, 0x6c,
-0x3b, 0x57, 0x74, 0x169, 0x3b, 0x57, 0x6b, 0x6e, 0x3b, 0x57, 0x74, 0x6e, 0x3b, 0x57, 0x74, 0x68, 0x3b, 0x57, 0x61, 0x20,
-0x6b, 0x79, 0x75, 0x6d, 0x77, 0x61, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x77, 0x61, 0x6d, 0x62, 0x129, 0x6c, 0x129, 0x6c, 0x79,
-0x61, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x65, 0x6c, 0x129, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x74, 0x169, 0x3b,
-0x57, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x57, 0x61, 0x20, 0x6b, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x57, 0x61,
-0x20, 0x74, 0x68, 0x61, 0x6e, 0x74, 0x68, 0x61, 0x74, 0x169, 0x3b, 0x59, 0x3b, 0x57, 0x3b, 0x45, 0x3b, 0x41, 0x3b, 0x41,
-0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x64, 0x6f, 0x6d, 0x3b, 0x6c, 0x75, 0x6e, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x69, 0x65,
-0x3b, 0x6a, 0x6f, 0x69, 0x3b, 0x76, 0x69, 0x6e, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64, 0x6f, 0x6d, 0x65, 0x6e, 0x69, 0x65,
-0x3b, 0x6c, 0x75, 0x6e, 0x69, 0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x61, 0x72, 0x73, 0x3b, 0x6d, 0x69, 0x65, 0x72, 0x63,
-0x75, 0x73, 0x3b, 0x6a, 0x6f, 0x69, 0x62, 0x65, 0x3b, 0x76, 0x69, 0x6e, 0x61, 0x72, 0x73, 0x3b, 0x73, 0x61, 0x62, 0x69,
-0x64, 0x65, 0x3b, 0x6b, 0x254, 0x73, 0x3b, 0x64, 0x7a, 0x6f, 0x3b, 0x62, 0x6c, 0x61, 0x3b, 0x6b, 0x75, 0x256, 0x3b, 0x79,
-0x61, 0x77, 0x3b, 0x66, 0x69, 0x256, 0x3b, 0x6d, 0x65, 0x6d, 0x3b, 0x6b, 0x254, 0x73, 0x69, 0x256, 0x61, 0x3b, 0x64, 0x7a,
-0x6f, 0x256, 0x61, 0x3b, 0x62, 0x6c, 0x61, 0x256, 0x61, 0x3b, 0x6b, 0x75, 0x256, 0x61, 0x3b, 0x79, 0x61, 0x77, 0x6f, 0x256,
-0x61, 0x3b, 0x66, 0x69, 0x256, 0x61, 0x3b, 0x6d, 0x65, 0x6d, 0x6c, 0x65, 0x256, 0x61, 0x3b, 0x6b, 0x3b, 0x64, 0x3b, 0x62,
-0x3b, 0x6b, 0x3b, 0x79, 0x3b, 0x66, 0x3b, 0x6d, 0x3b, 0x4c, 0x50, 0x3b, 0x50, 0x31, 0x3b, 0x50, 0x32, 0x3b, 0x50, 0x33,
-0x3b, 0x50, 0x34, 0x3b, 0x50, 0x35, 0x3b, 0x50, 0x36, 0x3b, 0x4c, 0x101, 0x70, 0x75, 0x6c, 0x65, 0x3b, 0x50, 0x6f, 0x2bb,
-0x61, 0x6b, 0x61, 0x68, 0x69, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6c, 0x75, 0x61, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6b, 0x6f,
-0x6c, 0x75, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x68, 0x101, 0x3b, 0x50, 0x6f, 0x2bb, 0x61, 0x6c, 0x69, 0x6d, 0x61, 0x3b, 0x50,
-0x6f, 0x2bb, 0x61, 0x6f, 0x6e, 0x6f, 0x3b, 0x4c, 0x69, 0x6e, 0x3b, 0x4c, 0x75, 0x6e, 0x3b, 0x4d, 0x61, 0x72, 0x3b, 0x4d,
-0x69, 0x79, 0x3b, 0x48, 0x75, 0x77, 0x3b, 0x42, 0x69, 0x79, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4c, 0x69, 0x6e, 0x67, 0x67,
-0x6f, 0x3b, 0x4c, 0x75, 0x6e, 0x65, 0x73, 0x3b, 0x4d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x4d, 0x69, 0x79, 0x65, 0x72,
-0x6b, 0x75, 0x6c, 0x65, 0x73, 0x3b, 0x48, 0x75, 0x77, 0x65, 0x62, 0x65, 0x73, 0x3b, 0x42, 0x69, 0x79, 0x65, 0x72, 0x6e,
-0x65, 0x73, 0x3b, 0x53, 0x61, 0x62, 0x61, 0x64, 0x6f, 0x3b, 0x53, 0x75, 0x2e, 0x3b, 0x4d, 0xe4, 0x2e, 0x3b, 0x5a, 0x69,
-0x2e, 0x3b, 0x4d, 0x69, 0x2e, 0x3b, 0x44, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0x75,
-0x6e, 0x6e, 0x74, 0x69, 0x67, 0x3b, 0x4d, 0xe4, 0xe4, 0x6e, 0x74, 0x69, 0x67, 0x3b, 0x5a, 0x69, 0x69, 0x73, 0x63, 0x68,
-0x74, 0x69, 0x67, 0x3b, 0x4d, 0x69, 0x74, 0x74, 0x77, 0x75, 0x63, 0x68, 0x3b, 0x44, 0x75, 0x6e, 0x73, 0x63, 0x68, 0x74,
-0x69, 0x67, 0x3b, 0x46, 0x72, 0x69, 0x69, 0x74, 0x69, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x73, 0x63, 0x68, 0x74, 0x69, 0x67,
-0x3b, 0xa46d, 0xa18f, 0x3b, 0xa18f, 0xa2cd, 0x3b, 0xa18f, 0xa44d, 0x3b, 0xa18f, 0xa315, 0x3b, 0xa18f, 0xa1d6, 0x3b, 0xa18f, 0xa26c, 0x3b, 0xa18f,
-0xa0d8, 0x3b, 0xa46d, 0xa18f, 0xa44d, 0x3b, 0xa18f, 0xa282, 0xa2cd, 0x3b, 0xa18f, 0xa282, 0xa44d, 0x3b, 0xa18f, 0xa282, 0xa315, 0x3b, 0xa18f, 0xa282,
-0xa1d6, 0x3b, 0xa18f, 0xa282, 0xa26c, 0x3b, 0xa18f, 0xa282, 0xa0d8, 0x3b, 0xa18f, 0x3b, 0xa2cd, 0x3b, 0xa44d, 0x3b, 0xa315, 0x3b, 0xa1d6, 0x3b,
-0xa26c, 0x3b, 0xa0d8, 0x3b, 0x53, 0xfc, 0x2e, 0x3b, 0x4d, 0x61, 0x2e, 0x3b, 0x44, 0x69, 0x2e, 0x3b, 0x4d, 0x69, 0x2e, 0x3b,
-0x44, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61, 0x2e, 0x3b, 0x53, 0xfc, 0x6e, 0x6e, 0x64, 0x61, 0x67, 0x3b,
-0x4d, 0x61, 0x61, 0x6e, 0x64, 0x61, 0x67, 0x3b, 0x44, 0x69, 0x6e, 0x67, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x4d, 0x69, 0x64,
-0x64, 0x65, 0x77, 0x65, 0x6b, 0x65, 0x6e, 0x3b, 0x44, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x61, 0x67, 0x3b, 0x46,
-0x72, 0x65, 0x65, 0x64, 0x61, 0x67, 0x3b, 0x53, 0xfc, 0x6e, 0x6e, 0x61, 0x76, 0x65, 0x6e, 0x64, 0x3b, 0x73, 0x6f, 0x74,
-0x6e, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x3b, 0x6d, 0x61, 0x14b, 0x3b, 0x67, 0x61, 0x73, 0x6b, 0x3b, 0x64, 0x75, 0x6f, 0x72,
-0x3b, 0x62, 0x65, 0x61, 0x72, 0x3b, 0x6c, 0xe1, 0x76, 0x3b, 0x73, 0x6f, 0x74, 0x6e, 0x61, 0x62, 0x65, 0x61, 0x69, 0x76,
-0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x73, 0xe1, 0x72, 0x67, 0x61, 0x3b, 0x6d, 0x61, 0x14b, 0x14b, 0x65, 0x62, 0xe1, 0x72,
-0x67, 0x61, 0x3b, 0x67, 0x61, 0x73, 0x6b, 0x61, 0x76, 0x61, 0x68, 0x6b, 0x6b, 0x75, 0x3b, 0x64, 0x75, 0x6f, 0x72, 0x61,
-0x73, 0x64, 0x61, 0x74, 0x3b, 0x62, 0x65, 0x61, 0x72, 0x6a, 0x61, 0x64, 0x61, 0x74, 0x3b, 0x6c, 0xe1, 0x76, 0x76, 0x61,
-0x72, 0x64, 0x61, 0x74, 0x3b, 0x53, 0x3b, 0x56, 0x3b, 0x4d, 0x3b, 0x47, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x4c, 0x3b, 0x73,
-0x6f, 0x3b, 0x6d, 0xe1, 0x3b, 0x64, 0x69, 0x3b, 0x67, 0x61, 0x3b, 0x64, 0x75, 0x3b, 0x62, 0x65, 0x3b, 0x6c, 0xe1, 0x3b,
-0x73, 0x6f, 0x74, 0x6e, 0x61, 0x62, 0x65, 0x61, 0x69, 0x76, 0x69, 0x3b, 0x6d, 0xe1, 0x6e, 0x6e, 0x6f, 0x64, 0x61, 0x74,
-0x3b, 0x64, 0x69, 0x73, 0x64, 0x61, 0x74, 0x3b, 0x67, 0x61, 0x73, 0x6b, 0x61, 0x76, 0x61, 0x68, 0x6b, 0x6b, 0x75, 0x3b,
-0x64, 0x75, 0x6f, 0x72, 0x61, 0x73, 0x74, 0x61, 0x74, 0x3b, 0x62, 0x65, 0x61, 0x72, 0x6a, 0x61, 0x64, 0x61, 0x74, 0x3b,
-0x6c, 0xe1, 0x76, 0x76, 0x6f, 0x72, 0x64, 0x61, 0x74, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x44, 0x3b, 0x47, 0x3b, 0x44, 0x3b,
-0x42, 0x3b, 0x4c, 0x3b, 0x43, 0x70, 0x72, 0x3b, 0x43, 0x74, 0x74, 0x3b, 0x43, 0x6d, 0x6e, 0x3b, 0x43, 0x6d, 0x74, 0x3b,
-0x41, 0x72, 0x73, 0x3b, 0x49, 0x63, 0x6d, 0x3b, 0x45, 0x73, 0x74, 0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x72,
-0x69, 0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x6f, 0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61, 0x69, 0x6e, 0x65,
-0x3b, 0x43, 0x68, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x72, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49,
-0x63, 0x68, 0x75, 0x6d, 0x61, 0x3b, 0x45, 0x73, 0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x43, 0x3b, 0x43, 0x3b, 0x43, 0x3b,
-0x43, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x45, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x4a, 0x69, 0x6d, 0x3b, 0x4b, 0x61, 0x77, 0x3b,
-0x4b, 0x61, 0x64, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x4b, 0x61, 0x73, 0x3b, 0x4e, 0x67, 0x75, 0x3b, 0x49, 0x74, 0x75, 0x6b,
-0x75, 0x20, 0x6a, 0x61, 0x20, 0x6a, 0x75, 0x6d, 0x77, 0x61, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20,
-0x6a, 0x69, 0x6d, 0x77, 0x65, 0x72, 0x69, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6b, 0x61, 0x77,
-0x69, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6b, 0x61, 0x64, 0x61, 0x64, 0x75, 0x3b, 0x4b, 0x75,
-0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x20, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4b, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x61,
-0x20, 0x6b, 0x61, 0x73, 0x61, 0x6e, 0x75, 0x3b, 0x4b, 0x69, 0x66, 0x75, 0x6c, 0x61, 0x20, 0x6e, 0x67, 0x75, 0x77, 0x6f,
-0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x64, 0x65, 0x77, 0x3b, 0x61,
-0x61, 0x253, 0x3b, 0x6d, 0x61, 0x77, 0x3b, 0x6e, 0x6a, 0x65, 0x3b, 0x6e, 0x61, 0x61, 0x3b, 0x6d, 0x77, 0x64, 0x3b, 0x68,
-0x62, 0x69, 0x3b, 0x64, 0x65, 0x77, 0x6f, 0x3b, 0x61, 0x61, 0x253, 0x6e, 0x64, 0x65, 0x3b, 0x6d, 0x61, 0x77, 0x62, 0x61,
-0x61, 0x72, 0x65, 0x3b, 0x6e, 0x6a, 0x65, 0x73, 0x6c, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x6e, 0x61, 0x61, 0x73, 0x61, 0x61,
-0x6e, 0x64, 0x65, 0x3b, 0x6d, 0x61, 0x77, 0x6e, 0x64, 0x65, 0x3b, 0x68, 0x6f, 0x6f, 0x72, 0x65, 0x2d, 0x62, 0x69, 0x69,
-0x72, 0x3b, 0x64, 0x3b, 0x61, 0x3b, 0x6d, 0x3b, 0x6e, 0x3b, 0x6e, 0x3b, 0x6d, 0x3b, 0x68, 0x3b, 0x4b, 0x4d, 0x41, 0x3b,
-0x4e, 0x54, 0x54, 0x3b, 0x4e, 0x4d, 0x4e, 0x3b, 0x4e, 0x4d, 0x54, 0x3b, 0x41, 0x52, 0x54, 0x3b, 0x4e, 0x4d, 0x41, 0x3b,
-0x4e, 0x4d, 0x4d, 0x3b, 0x4b, 0x69, 0x75, 0x6d, 0x69, 0x61, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x169,
-0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x69, 0x6e, 0x65, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x61, 0x3b,
-0x41, 0x72, 0x61, 0x6d, 0x69, 0x74, 0x68, 0x69, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4e, 0x6a, 0x75, 0x6d,
-0x61, 0x6d, 0x6f, 0x74, 0x68, 0x69, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x41, 0x3b, 0x4e, 0x3b, 0x4e,
-0x3b, 0x41, 0x72, 0x65, 0x3b, 0x4b, 0x75, 0x6e, 0x3b, 0x4f, 0x6e, 0x67, 0x3b, 0x49, 0x6e, 0x65, 0x3b, 0x49, 0x6c, 0x65,
-0x3b, 0x53, 0x61, 0x70, 0x3b, 0x4b, 0x77, 0x65, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x61,
-0x72, 0x65, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x6b, 0x75, 0x6e, 0x69, 0x3b, 0x4d, 0x64,
-0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x6f, 0x6e, 0x67, 0x2019, 0x77, 0x61, 0x6e, 0x3b, 0x4d, 0x64, 0x65, 0x72,
-0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x69, 0x6e, 0x65, 0x74, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65,
-0x20, 0x69, 0x6c, 0x65, 0x3b, 0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x73, 0x61, 0x70, 0x61, 0x3b,
-0x4d, 0x64, 0x65, 0x72, 0x6f, 0x74, 0x20, 0x65, 0x65, 0x20, 0x6b, 0x77, 0x65, 0x3b, 0x41, 0x3b, 0x4b, 0x3b, 0x4f, 0x3b,
-0x49, 0x3b, 0x49, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x44, 0x69, 0x6d, 0x3b, 0x50, 0x6f, 0x73, 0x3b, 0x50, 0x69, 0x72, 0x3b,
-0x54, 0x61, 0x74, 0x3b, 0x4e, 0x61, 0x69, 0x3b, 0x53, 0x68, 0x61, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x44, 0x69, 0x6d, 0x69,
-0x6e, 0x67, 0x75, 0x3b, 0x43, 0x68, 0x69, 0x70, 0x6f, 0x73, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x70, 0x69, 0x72, 0x69, 0x3b,
-0x43, 0x68, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x69, 0x3b, 0x43, 0x68, 0x69, 0x73, 0x68,
-0x61, 0x6e, 0x75, 0x3b, 0x53, 0x61, 0x62, 0x75, 0x64, 0x75, 0x3b, 0x44, 0x3b, 0x50, 0x3b, 0x43, 0x3b, 0x54, 0x3b, 0x4e,
-0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x6f, 0x6e, 0x3b, 0x4d, 0x76, 0x75, 0x3b, 0x53, 0x69, 0x62, 0x3b, 0x53, 0x69, 0x74,
-0x3b, 0x53, 0x69, 0x6e, 0x3b, 0x53, 0x69, 0x68, 0x3b, 0x4d, 0x67, 0x71, 0x3b, 0x53, 0x6f, 0x6e, 0x74, 0x6f, 0x3b, 0x4d,
-0x76, 0x75, 0x6c, 0x6f, 0x3b, 0x53, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x53, 0x69, 0x74, 0x68, 0x61, 0x74, 0x68, 0x75,
-0x3b, 0x53, 0x69, 0x6e, 0x65, 0x3b, 0x53, 0x69, 0x68, 0x6c, 0x61, 0x6e, 0x75, 0x3b, 0x4d, 0x67, 0x71, 0x69, 0x62, 0x65,
-0x6c, 0x6f, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x4d, 0x3b, 0x49, 0x6a, 0x70,
-0x3b, 0x49, 0x6a, 0x74, 0x3b, 0x49, 0x6a, 0x6e, 0x3b, 0x49, 0x6a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a,
-0x75, 0x3b, 0x49, 0x6a, 0x6d, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d,
-0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61,
-0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61,
-0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x36,
-0x3b, 0x37, 0x3b, 0x31, 0x3b, 0x2d30, 0x2d59, 0x2d30, 0x3b, 0x2d30, 0x2d62, 0x2d4f, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x3b, 0x2d30, 0x2d3d, 0x2d55,
-0x3b, 0x2d30, 0x2d3d, 0x2d61, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4e, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d39, 0x3b, 0x2d30, 0x2d59, 0x2d30, 0x2d4e, 0x2d30,
-0x2d59, 0x3b, 0x2d30, 0x2d62, 0x2d4f, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4f, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d55, 0x2d30, 0x2d59,
-0x3b, 0x2d30, 0x2d3d, 0x2d61, 0x2d30, 0x2d59, 0x3b, 0x2d59, 0x2d49, 0x2d4e, 0x2d61, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d39, 0x2d62, 0x2d30,
-0x2d59, 0x3b, 0x61, 0x73, 0x61, 0x3b, 0x61, 0x79, 0x6e, 0x3b, 0x61, 0x73, 0x69, 0x3b, 0x61, 0x6b, 0x1e5b, 0x3b, 0x61, 0x6b,
-0x77, 0x3b, 0x61, 0x73, 0x69, 0x6d, 0x3b, 0x61, 0x73, 0x69, 0x1e0d, 0x3b, 0x61, 0x73, 0x61, 0x6d, 0x61, 0x73, 0x3b, 0x61,
-0x79, 0x6e, 0x61, 0x73, 0x3b, 0x61, 0x73, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x61, 0x6b, 0x1e5b, 0x61, 0x73, 0x3b, 0x61, 0x6b,
-0x77, 0x61, 0x73, 0x3b, 0x61, 0x73, 0x69, 0x6d, 0x77, 0x61, 0x73, 0x3b, 0x61, 0x73, 0x69, 0x1e0d, 0x79, 0x61, 0x73, 0x3b,
-0x41, 0x63, 0x65, 0x3b, 0x41, 0x72, 0x69, 0x3b, 0x41, 0x72, 0x61, 0x3b, 0x41, 0x68, 0x61, 0x3b, 0x41, 0x6d, 0x68, 0x3b,
-0x53, 0x65, 0x6d, 0x3b, 0x53, 0x65, 0x64, 0x3b, 0x41, 0x63, 0x65, 0x72, 0x3b, 0x41, 0x72, 0x69, 0x6d, 0x3b, 0x41, 0x72,
-0x61, 0x6d, 0x3b, 0x41, 0x68, 0x61, 0x64, 0x3b, 0x41, 0x6d, 0x68, 0x61, 0x64, 0x3b, 0x53, 0x65, 0x6d, 0x3b, 0x53, 0x65,
-0x64, 0x3b, 0x59, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x53, 0x3b, 0x59, 0x61, 0x6e, 0x3b,
-0x53, 0x61, 0x6e, 0x3b, 0x4b, 0x72, 0x61, 0x1e0d, 0x3b, 0x4b, 0x75, 0x1e93, 0x3b, 0x53, 0x61, 0x6d, 0x3b, 0x53, 0x1e0d, 0x69,
-0x73, 0x3b, 0x53, 0x61, 0x79, 0x3b, 0x59, 0x61, 0x6e, 0x61, 0x73, 0x73, 0x3b, 0x53, 0x61, 0x6e, 0x61, 0x73, 0x73, 0x3b,
-0x4b, 0x72, 0x61, 0x1e0d, 0x61, 0x73, 0x73, 0x3b, 0x4b, 0x75, 0x1e93, 0x61, 0x73, 0x73, 0x3b, 0x53, 0x61, 0x6d, 0x61, 0x73,
-0x73, 0x3b, 0x53, 0x1e0d, 0x69, 0x73, 0x61, 0x73, 0x73, 0x3b, 0x53, 0x61, 0x79, 0x61, 0x73, 0x73, 0x3b, 0x43, 0x3b, 0x52,
-0x3b, 0x41, 0x3b, 0x48, 0x3b, 0x4d, 0x3b, 0x53, 0x3b, 0x44, 0x3b, 0x53, 0x41, 0x4e, 0x3b, 0x4f, 0x52, 0x4b, 0x3b, 0x4f,
-0x4b, 0x42, 0x3b, 0x4f, 0x4b, 0x53, 0x3b, 0x4f, 0x4b, 0x4e, 0x3b, 0x4f, 0x4b, 0x54, 0x3b, 0x4f, 0x4d, 0x4b, 0x3b, 0x53,
-0x61, 0x6e, 0x64, 0x65, 0x3b, 0x4f, 0x72, 0x77, 0x6f, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x7a, 0x61, 0x3b, 0x4f, 0x72, 0x77,
-0x61, 0x6b, 0x61, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61, 0x73, 0x68, 0x61, 0x74, 0x75, 0x3b,
-0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61, 0x6e, 0x61, 0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6b, 0x61, 0x74, 0x61, 0x61, 0x6e, 0x6f,
-0x3b, 0x4f, 0x72, 0x77, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x53, 0x3b, 0x4b, 0x3b, 0x52, 0x3b, 0x53,
-0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x4d, 0x3b, 0x4d, 0x75, 0x6c, 0x3b, 0x56, 0x69, 0x6c, 0x3b, 0x48, 0x69, 0x76, 0x3b, 0x48,
-0x69, 0x64, 0x3b, 0x48, 0x69, 0x74, 0x3b, 0x48, 0x69, 0x68, 0x3b, 0x4c, 0x65, 0x6d, 0x3b, 0x70, 0x61, 0x20, 0x6d, 0x75,
-0x6c, 0x75, 0x6e, 0x67, 0x75, 0x3b, 0x70, 0x61, 0x20, 0x73, 0x68, 0x61, 0x68, 0x75, 0x76, 0x69, 0x6c, 0x75, 0x68, 0x61,
-0x3b, 0x70, 0x61, 0x20, 0x68, 0x69, 0x76, 0x69, 0x6c, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x68, 0x69, 0x64, 0x61, 0x74, 0x75,
-0x3b, 0x70, 0x61, 0x20, 0x68, 0x69, 0x74, 0x61, 0x79, 0x69, 0x3b, 0x70, 0x61, 0x20, 0x68, 0x69, 0x68, 0x61, 0x6e, 0x75,
-0x3b, 0x70, 0x61, 0x20, 0x73, 0x68, 0x61, 0x68, 0x75, 0x6c, 0x65, 0x6d, 0x62, 0x65, 0x6c, 0x61, 0x3b, 0x4d, 0x3b, 0x4a,
-0x3b, 0x48, 0x3b, 0x48, 0x3b, 0x48, 0x3b, 0x57, 0x3b, 0x4a, 0x3b, 0x4a, 0x70, 0x69, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a,
-0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x4a,
-0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c, 0x79, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x75, 0x3b, 0x4a,
-0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x75, 0x3b, 0x41, 0x6c, 0x68, 0x61,
-0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69,
-0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4a, 0x3b, 0x6b, 0x61, 0x72, 0x3b, 0x6e,
-0x74, 0x25b, 0x3b, 0x74, 0x61, 0x72, 0x3b, 0x61, 0x72, 0x61, 0x3b, 0x61, 0x6c, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x3b, 0x73,
-0x69, 0x62, 0x3b, 0x6b, 0x61, 0x72, 0x69, 0x3b, 0x6e, 0x74, 0x25b, 0x6e, 0x25b, 0x3b, 0x74, 0x61, 0x72, 0x61, 0x74, 0x61,
-0x3b, 0x61, 0x72, 0x61, 0x62, 0x61, 0x3b, 0x61, 0x6c, 0x61, 0x6d, 0x69, 0x73, 0x61, 0x3b, 0x6a, 0x75, 0x6d, 0x61, 0x3b,
-0x73, 0x69, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x4a, 0x3b, 0x53,
-0x3b, 0x4b, 0x6d, 0x61, 0x3b, 0x54, 0x61, 0x74, 0x3b, 0x49, 0x6e, 0x65, 0x3b, 0x54, 0x61, 0x6e, 0x3b, 0x41, 0x72, 0x6d,
-0x3b, 0x4d, 0x61, 0x61, 0x3b, 0x4e, 0x4d, 0x4d, 0x3b, 0x4b, 0x69, 0x75, 0x6d, 0x69, 0x61, 0x3b, 0x4e, 0x6a, 0x75, 0x6d,
-0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x69, 0x6e, 0x65, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61,
-0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x72, 0x61, 0x6d, 0x69, 0x74, 0x68, 0x69, 0x3b, 0x4e, 0x6a, 0x75, 0x6d, 0x61, 0x61,
-0x3b, 0x4e, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x74, 0x68, 0x69, 0x69, 0x3b, 0x4b, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e,
-0x3b, 0x41, 0x3b, 0x4d, 0x3b, 0x4e, 0x3b, 0x13c6, 0x13cd, 0x13ac, 0x3b, 0x13c9, 0x13c5, 0x13af, 0x3b, 0x13d4, 0x13b5, 0x13c1, 0x3b, 0x13e6,
-0x13a2, 0x13c1, 0x3b, 0x13c5, 0x13a9, 0x13c1, 0x3b, 0x13e7, 0x13be, 0x13a9, 0x3b, 0x13c8, 0x13d5, 0x13be, 0x3b, 0x13a4, 0x13be, 0x13d9, 0x13d3, 0x13c6,
-0x13cd, 0x13ac, 0x3b, 0x13a4, 0x13be, 0x13d9, 0x13d3, 0x13c9, 0x13c5, 0x13af, 0x3b, 0x13d4, 0x13b5, 0x13c1, 0x13a2, 0x13a6, 0x3b, 0x13e6, 0x13a2, 0x13c1,
-0x13a2, 0x13a6, 0x3b, 0x13c5, 0x13a9, 0x13c1, 0x13a2, 0x13a6, 0x3b, 0x13e7, 0x13be, 0x13a9, 0x13b6, 0x13cd, 0x13d7, 0x3b, 0x13a4, 0x13be, 0x13d9, 0x13d3,
-0x13c8, 0x13d5, 0x13be, 0x3b, 0x13c6, 0x3b, 0x13c9, 0x3b, 0x13d4, 0x3b, 0x13e6, 0x3b, 0x13c5, 0x3b, 0x13e7, 0x3b, 0x13a4, 0x3b, 0x64, 0x69,
-0x6d, 0x3b, 0x6c, 0x69, 0x6e, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x65, 0x72, 0x3b, 0x7a, 0x65, 0x3b, 0x76, 0x61, 0x6e,
-0x3b, 0x73, 0x61, 0x6d, 0x3b, 0x64, 0x69, 0x6d, 0x61, 0x6e, 0x73, 0x3b, 0x6c, 0x69, 0x6e, 0x64, 0x69, 0x3b, 0x6d, 0x61,
-0x72, 0x64, 0x69, 0x3b, 0x6d, 0x65, 0x72, 0x6b, 0x72, 0x65, 0x64, 0x69, 0x3b, 0x7a, 0x65, 0x64, 0x69, 0x3b, 0x76, 0x61,
-0x6e, 0x64, 0x72, 0x65, 0x64, 0x69, 0x3b, 0x73, 0x61, 0x6d, 0x64, 0x69, 0x3b, 0x64, 0x3b, 0x6c, 0x3b, 0x6d, 0x3b, 0x6d,
-0x3b, 0x7a, 0x3b, 0x76, 0x3b, 0x73, 0x3b, 0x4c, 0x6c, 0x32, 0x3b, 0x4c, 0x6c, 0x33, 0x3b, 0x4c, 0x6c, 0x34, 0x3b, 0x4c,
-0x6c, 0x35, 0x3b, 0x4c, 0x6c, 0x36, 0x3b, 0x4c, 0x6c, 0x37, 0x3b, 0x4c, 0x6c, 0x31, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76,
-0x61, 0x20, 0x6c, 0x79, 0x61, 0x70, 0x69, 0x6c, 0x69, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61,
-0x74, 0x61, 0x74, 0x75, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x63,
-0x68, 0x69, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x3b,
-0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x6e, 0x79, 0x61, 0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20,
-0x6c, 0x69, 0x6e, 0x6a, 0x69, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20, 0x6c, 0x79, 0x61, 0x6e, 0x6e, 0x79, 0x61,
-0x6e, 0x6f, 0x20, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x76, 0x69, 0x6c, 0x69, 0x3b, 0x4c, 0x69, 0x64, 0x75, 0x76, 0x61, 0x20,
-0x6c, 0x69, 0x74, 0x61, 0x6e, 0x64, 0x69, 0x3b, 0x50, 0xed, 0x69, 0x6c, 0x69, 0x3b, 0x54, 0xe1, 0x61, 0x74, 0x75, 0x3b,
-0xcd, 0x6e, 0x65, 0x3b, 0x54, 0xe1, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a, 0x6d, 0x3b, 0x4d, 0xf3,
-0x6f, 0x73, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0xed, 0x69, 0x72, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0xe1,
-0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0xed, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0xe1, 0x61, 0x6e, 0x6f,
-0x3b, 0x41, 0x6c, 0x61, 0x6d, 0xed, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0xe1, 0x61, 0x3b, 0x4a, 0x75, 0x6d,
-0x61, 0x6d, 0xf3, 0x6f, 0x73, 0x69, 0x3b, 0x50, 0x3b, 0x54, 0x3b, 0x45, 0x3b, 0x4f, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4d,
-0x3b, 0x53, 0x61, 0x62, 0x3b, 0x42, 0x61, 0x6c, 0x3b, 0x4c, 0x77, 0x32, 0x3b, 0x4c, 0x77, 0x33, 0x3b, 0x4c, 0x77, 0x34,
-0x3b, 0x4c, 0x77, 0x35, 0x3b, 0x4c, 0x77, 0x36, 0x3b, 0x53, 0x61, 0x62, 0x62, 0x69, 0x69, 0x74, 0x69, 0x3b, 0x42, 0x61,
-0x6c, 0x61, 0x7a, 0x61, 0x3b, 0x4c, 0x77, 0x61, 0x6b, 0x75, 0x62, 0x69, 0x72, 0x69, 0x3b, 0x4c, 0x77, 0x61, 0x6b, 0x75,
-0x73, 0x61, 0x74, 0x75, 0x3b, 0x4c, 0x77, 0x61, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x4c, 0x77, 0x61, 0x6b, 0x75, 0x74, 0x61,
-0x61, 0x6e, 0x6f, 0x3b, 0x4c, 0x77, 0x61, 0x6d, 0x75, 0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x4c,
-0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x50, 0x61, 0x20, 0x4d, 0x75, 0x6c, 0x75, 0x6e, 0x67, 0x75, 0x3b,
-0x50, 0x61, 0x6c, 0x69, 0x63, 0x68, 0x69, 0x6d, 0x6f, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68, 0x69, 0x62, 0x75, 0x6c,
-0x69, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68, 0x69, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68,
-0x69, 0x6e, 0x65, 0x3b, 0x50, 0x61, 0x6c, 0x69, 0x63, 0x68, 0x69, 0x73, 0x61, 0x6e, 0x6f, 0x3b, 0x50, 0x61, 0x63, 0x68,
-0x69, 0x62, 0x65, 0x6c, 0x75, 0x73, 0x68, 0x69, 0x3b, 0x64, 0x75, 0x6d, 0x3b, 0x73, 0x69, 0x67, 0x3b, 0x74, 0x65, 0x72,
-0x3b, 0x6b, 0x75, 0x61, 0x3b, 0x6b, 0x69, 0x6e, 0x3b, 0x73, 0x65, 0x73, 0x3b, 0x73, 0x61, 0x62, 0x3b, 0x64, 0x75, 0x6d,
-0x69, 0x6e, 0x67, 0x75, 0x3b, 0x73, 0x69, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x74, 0x65,
-0x72, 0x73, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x6b, 0x75, 0x61, 0x72, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61,
-0x3b, 0x6b, 0x69, 0x6e, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x73, 0x65, 0x73, 0x74, 0x61, 0x2d, 0x66, 0x65,
-0x72, 0x61, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x75, 0x3b, 0x44, 0x3b, 0x53, 0x3b, 0x54, 0x3b, 0x4b, 0x3b, 0x4b, 0x3b,
-0x53, 0x3b, 0x53, 0x3b, 0x64, 0x75, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x73, 0x69, 0x67, 0x75, 0x6e, 0x64, 0x61, 0x2d,
-0x66, 0x65, 0x72, 0x61, 0x3b, 0x74, 0x65, 0x72, 0x73, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x6b, 0x75, 0x61, 0x72,
-0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x6b, 0x69, 0x6e, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x73,
-0x65, 0x73, 0x74, 0x61, 0x2d, 0x66, 0x65, 0x72, 0x61, 0x3b, 0x73, 0x61, 0x62, 0x61, 0x64, 0x75, 0x3b, 0x4b, 0x49, 0x55,
-0x3b, 0x4d, 0x52, 0x41, 0x3b, 0x57, 0x41, 0x49, 0x3b, 0x57, 0x45, 0x54, 0x3b, 0x57, 0x45, 0x4e, 0x3b, 0x57, 0x54, 0x4e,
-0x3b, 0x4a, 0x55, 0x4d, 0x3b, 0x4b, 0x69, 0x75, 0x6d, 0x69, 0x61, 0x3b, 0x4d, 0x75, 0x72, 0x61, 0x6d, 0x75, 0x6b, 0x6f,
-0x3b, 0x57, 0x61, 0x69, 0x72, 0x69, 0x3b, 0x57, 0x65, 0x74, 0x68, 0x61, 0x74, 0x75, 0x3b, 0x57, 0x65, 0x6e, 0x61, 0x3b,
-0x57, 0x65, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b,
-0x57, 0x3b, 0x57, 0x3b, 0x57, 0x3b, 0x57, 0x3b, 0x4a, 0x3b, 0x4b, 0x74, 0x73, 0x3b, 0x4b, 0x6f, 0x74, 0x3b, 0x4b, 0x6f,
-0x6f, 0x3b, 0x4b, 0x6f, 0x73, 0x3b, 0x4b, 0x6f, 0x61, 0x3b, 0x4b, 0x6f, 0x6d, 0x3b, 0x4b, 0x6f, 0x6c, 0x3b, 0x4b, 0x6f,
-0x74, 0x69, 0x73, 0x61, 0x70, 0x3b, 0x4b, 0x6f, 0x74, 0x61, 0x61, 0x69, 0x3b, 0x4b, 0x6f, 0x61, 0x65, 0x6e, 0x67, 0x2019,
-0x3b, 0x4b, 0x6f, 0x73, 0x6f, 0x6d, 0x6f, 0x6b, 0x3b, 0x4b, 0x6f, 0x61, 0x6e, 0x67, 0x2019, 0x77, 0x61, 0x6e, 0x3b, 0x4b,
-0x6f, 0x6d, 0x75, 0x75, 0x74, 0x3b, 0x4b, 0x6f, 0x6c, 0x6f, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4f, 0x3b, 0x53, 0x3b, 0x41,
-0x3b, 0x4d, 0x3b, 0x4c, 0x3b, 0x53, 0x6f, 0x6e, 0x3b, 0x4d, 0x61, 0x3b, 0x44, 0x65, 0x3b, 0x57, 0x75, 0x3b, 0x44, 0x6f,
-0x3b, 0x46, 0x72, 0x3b, 0x53, 0x61, 0x74, 0x3b, 0x53, 0x6f, 0x6e, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b,
-0x4d, 0x61, 0x6e, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x44, 0x65, 0x6e, 0x73, 0x74, 0x61, 0x78, 0x74,
-0x73, 0x65, 0x65, 0x73, 0x3b, 0x57, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x44, 0x6f,
-0x6e, 0x64, 0x65, 0x72, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x46, 0x72, 0x61, 0x69, 0x74, 0x61, 0x78,
-0x74, 0x73, 0x65, 0x65, 0x73, 0x3b, 0x53, 0x61, 0x74, 0x65, 0x72, 0x74, 0x61, 0x78, 0x74, 0x73, 0x65, 0x65, 0x73, 0x3b,
-0x53, 0x3b, 0x4d, 0x3b, 0x45, 0x3b, 0x57, 0x3b, 0x44, 0x3b, 0x46, 0x3b, 0x41, 0x3b, 0x53, 0x75, 0x2e, 0x3b, 0x4d, 0x6f,
-0x2e, 0x3b, 0x44, 0x69, 0x2e, 0x3b, 0x4d, 0x65, 0x2e, 0x3b, 0x44, 0x75, 0x2e, 0x3b, 0x46, 0x72, 0x2e, 0x3b, 0x53, 0x61,
-0x2e, 0x3b, 0x53, 0x75, 0x6e, 0x6e, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x4d, 0x6f, 0x68, 0x6e, 0x64, 0x61, 0x61, 0x63,
-0x68, 0x3b, 0x44, 0x69, 0x6e, 0x6e, 0x73, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x4d, 0x65, 0x74, 0x77, 0x6f, 0x63, 0x68,
-0x3b, 0x44, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x73, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x46, 0x72, 0x69, 0x69, 0x64, 0x61,
-0x61, 0x63, 0x68, 0x3b, 0x53, 0x61, 0x6d, 0x73, 0x64, 0x61, 0x61, 0x63, 0x68, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0xed,
-0x6c, 0xed, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0xe1, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x65, 0x3b, 0x4a,
-0x75, 0x6d, 0x61, 0x74, 0xe1, 0x6e, 0x254, 0x3b, 0x41, 0x6c, 0x61, 0xe1, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x4a, 0x75, 0x6d,
-0xe1, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0xf3, 0x73, 0x69, 0x3b, 0x53, 0x61, 0x62, 0x69, 0x3b, 0x42, 0x61, 0x6c,
-0x61, 0x3b, 0x4b, 0x75, 0x62, 0x69, 0x3b, 0x4b, 0x75, 0x73, 0x61, 0x3b, 0x4b, 0x75, 0x6e, 0x61, 0x3b, 0x4b, 0x75, 0x74,
-0x61, 0x3b, 0x4d, 0x75, 0x6b, 0x61, 0x3b, 0x53, 0x61, 0x62, 0x69, 0x69, 0x74, 0x69, 0x3b, 0x42, 0x61, 0x6c, 0x61, 0x7a,
-0x61, 0x3b, 0x4f, 0x77, 0x6f, 0x6b, 0x75, 0x62, 0x69, 0x6c, 0x69, 0x3b, 0x4f, 0x77, 0x6f, 0x6b, 0x75, 0x73, 0x61, 0x74,
-0x75, 0x3b, 0x4f, 0x6c, 0x6f, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x4f, 0x6c, 0x6f, 0x6b, 0x75, 0x74, 0x61, 0x61, 0x6e, 0x75,
-0x3b, 0x4f, 0x6c, 0x6f, 0x6d, 0x75, 0x6b, 0x61, 0x61, 0x67, 0x61, 0x3b, 0x53, 0x3b, 0x42, 0x3b, 0x42, 0x3b, 0x53, 0x3b,
-0x4b, 0x3b, 0x4b, 0x3b, 0x4d, 0x3b, 0x4a, 0x32, 0x3b, 0x4a, 0x33, 0x3b, 0x4a, 0x34, 0x3b, 0x4a, 0x35, 0x3b, 0x41, 0x6c,
-0x3b, 0x49, 0x6a, 0x3b, 0x4a, 0x31, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x72, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61,
-0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e,
-0x6f, 0x3b, 0x4d, 0x75, 0x72, 0x77, 0x61, 0x20, 0x77, 0x61, 0x20, 0x4b, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4d, 0x75, 0x72,
-0x77, 0x61, 0x20, 0x77, 0x61, 0x20, 0x4b, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73,
-0x69, 0x3b, 0x4a, 0x70, 0x69, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a, 0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c,
-0x68, 0x3b, 0x49, 0x6a, 0x6d, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x3b, 0x42, 0x61, 0x72, 0x3b, 0x41, 0x61,
-0x72, 0x3b, 0x55, 0x6e, 0x69, 0x3b, 0x55, 0x6e, 0x67, 0x3b, 0x4b, 0x61, 0x6e, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4e, 0x61,
-0x6b, 0x61, 0x65, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x65, 0x62, 0x61, 0x72, 0x61, 0x73, 0x61, 0x3b,
-0x4e, 0x61, 0x6b, 0x61, 0x61, 0x72, 0x65, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x75, 0x6e, 0x69, 0x3b, 0x4e, 0x61, 0x6b, 0x61,
-0x75, 0x6e, 0x67, 0x2019, 0x6f, 0x6e, 0x3b, 0x4e, 0x61, 0x6b, 0x61, 0x6b, 0x61, 0x6e, 0x79, 0x3b, 0x4e, 0x61, 0x6b, 0x61,
-0x73, 0x61, 0x62, 0x69, 0x74, 0x69, 0x3b, 0x4a, 0x3b, 0x42, 0x3b, 0x41, 0x3b, 0x55, 0x3b, 0x55, 0x3b, 0x4b, 0x3b, 0x53,
-0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x41, 0x74, 0x69, 0x3b, 0x41, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x3b, 0x41, 0x6c, 0x6d,
-0x3b, 0x41, 0x6c, 0x6a, 0x3b, 0x41, 0x73, 0x73, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x41, 0x74, 0x69, 0x6e,
-0x69, 0x3b, 0x41, 0x74, 0x61, 0x6c, 0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68,
-0x61, 0x6d, 0x69, 0x69, 0x73, 0x61, 0x3b, 0x41, 0x6c, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x73, 0x61, 0x62, 0x64,
-0x75, 0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x4c, 0x3b, 0x53, 0x3b, 0x4a, 0x4d, 0x50, 0x3b,
-0x57, 0x55, 0x54, 0x3b, 0x54, 0x41, 0x52, 0x3b, 0x54, 0x41, 0x44, 0x3b, 0x54, 0x41, 0x4e, 0x3b, 0x54, 0x41, 0x42, 0x3b,
-0x4e, 0x47, 0x53, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x70, 0x69, 0x6c, 0x3b, 0x57, 0x75, 0x6f, 0x6b, 0x20, 0x54, 0x69, 0x63,
-0x68, 0x3b, 0x54, 0x69, 0x63, 0x68, 0x20, 0x41, 0x72, 0x69, 0x79, 0x6f, 0x3b, 0x54, 0x69, 0x63, 0x68, 0x20, 0x41, 0x64,
-0x65, 0x6b, 0x3b, 0x54, 0x69, 0x63, 0x68, 0x20, 0x41, 0x6e, 0x67, 0x2019, 0x77, 0x65, 0x6e, 0x3b, 0x54, 0x69, 0x63, 0x68,
-0x20, 0x41, 0x62, 0x69, 0x63, 0x68, 0x3b, 0x4e, 0x67, 0x65, 0x73, 0x6f, 0x3b, 0x4a, 0x3b, 0x57, 0x3b, 0x54, 0x3b, 0x54,
-0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4e, 0x3b, 0x41, 0x73, 0x61, 0x3b, 0x41, 0x79, 0x6e, 0x3b, 0x41, 0x73, 0x6e, 0x3b, 0x41,
-0x6b, 0x72, 0x3b, 0x41, 0x6b, 0x77, 0x3b, 0x41, 0x73, 0x6d, 0x3b, 0x41, 0x73, 0x1e0d, 0x3b, 0x41, 0x73, 0x61, 0x6d, 0x61,
-0x73, 0x3b, 0x41, 0x79, 0x6e, 0x61, 0x73, 0x3b, 0x41, 0x73, 0x69, 0x6e, 0x61, 0x73, 0x3b, 0x41, 0x6b, 0x72, 0x61, 0x73,
-0x3b, 0x41, 0x6b, 0x77, 0x61, 0x73, 0x3b, 0x41, 0x73, 0x69, 0x6d, 0x77, 0x61, 0x73, 0x3b, 0x41, 0x73, 0x69, 0x1e0d, 0x79,
-0x61, 0x73, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x6c, 0x68,
-0x3b, 0x41, 0x74, 0x69, 0x3b, 0x41, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x3b, 0x41, 0x6c, 0x6d, 0x3b, 0x41, 0x6c, 0x7a,
-0x3b, 0x41, 0x73, 0x69, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x41, 0x74, 0x69, 0x6e, 0x6e, 0x69, 0x3b, 0x41,
-0x74, 0x61, 0x6c, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d,
-0x69, 0x69, 0x73, 0x61, 0x3b, 0x41, 0x6c, 0x7a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x69, 0x62, 0x74, 0x69, 0x3b, 0x4a,
-0x70, 0x69, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a, 0x6d, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49,
-0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x70, 0x69, 0x69, 0x3b, 0x4a, 0x75, 0x6d, 0x61,
-0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x61, 0x74,
-0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b,
-0x4a, 0x75, 0x6d, 0x61, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x32, 0x3b, 0x33, 0x3b, 0x34, 0x3b, 0x35, 0x3b, 0x41, 0x3b,
-0x49, 0x3b, 0x31, 0x3b, 0x930, 0x92c, 0x93f, 0x3b, 0x938, 0x92e, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x3b, 0x92c, 0x941, 0x926, 0x3b,
-0x92c, 0x93f, 0x938, 0x925, 0x93f, 0x3b, 0x938, 0x941, 0x916, 0x941, 0x930, 0x3b, 0x938, 0x941, 0x928, 0x93f, 0x3b, 0x930, 0x92c, 0x93f,
-0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x92e, 0x92c, 0x93e, 0x930, 0x3b, 0x92e, 0x902, 0x917, 0x932, 0x92c, 0x93e, 0x930, 0x3b, 0x92c, 0x941,
-0x926, 0x92c, 0x93e, 0x930, 0x3b, 0x92c, 0x93f, 0x938, 0x925, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x938, 0x941, 0x916, 0x941, 0x930, 0x92c,
-0x93e, 0x930, 0x3b, 0x938, 0x941, 0x928, 0x93f, 0x92c, 0x93e, 0x930, 0x3b, 0x930, 0x3b, 0x938, 0x3b, 0x92e, 0x902, 0x3b, 0x92c, 0x941,
-0x3b, 0x92c, 0x93f, 0x3b, 0x938, 0x941, 0x3b, 0x938, 0x941, 0x3b, 0x43a, 0x4c0, 0x438, 0x3b, 0x43e, 0x440, 0x3b, 0x448, 0x438, 0x3b,
-0x43a, 0x445, 0x430, 0x3b, 0x435, 0x430, 0x3b, 0x43f, 0x4c0, 0x435, 0x3b, 0x448, 0x443, 0x43e, 0x3b, 0x43a, 0x4c0, 0x438, 0x440, 0x430,
-0x3b, 0x43e, 0x440, 0x448, 0x43e, 0x442, 0x3b, 0x448, 0x438, 0x43d, 0x430, 0x440, 0x430, 0x3b, 0x43a, 0x445, 0x430, 0x430, 0x440, 0x430,
-0x3b, 0x435, 0x430, 0x440, 0x430, 0x3b, 0x43f, 0x4c0, 0x435, 0x440, 0x430, 0x441, 0x43a, 0x430, 0x3b, 0x448, 0x443, 0x43e, 0x442, 0x3b,
-0x43a, 0x4c0, 0x3b, 0x43e, 0x3b, 0x448, 0x3b, 0x43a, 0x445, 0x3b, 0x435, 0x3b, 0x43f, 0x4c0, 0x3b, 0x448, 0x3b, 0x43d, 0x434, 0x2de7,
-0x487, 0x467, 0x3b, 0x43f, 0x43d, 0x2de3, 0x435, 0x3b, 0x432, 0x442, 0x43e, 0x2dec, 0x487, 0x3b, 0x441, 0x440, 0x2de3, 0x435, 0x3b, 0x447,
-0x435, 0x2de6, 0x487, 0x3b, 0x43f, 0x467, 0x2de6, 0x487, 0x3b, 0x441, 0xa64b, 0x2de0, 0x487, 0x3b, 0x43d, 0x435, 0x434, 0x463, 0x301, 0x43b,
-0x467, 0x3b, 0x43f, 0x43e, 0x43d, 0x435, 0x434, 0x463, 0x301, 0x43b, 0x44c, 0x43d, 0x438, 0x43a, 0x44a, 0x3b, 0x432, 0x442, 0x43e, 0x301,
-0x440, 0x43d, 0x438, 0x43a, 0x44a, 0x3b, 0x441, 0x440, 0x435, 0x434, 0x430, 0x300, 0x3b, 0x447, 0x435, 0x442, 0x432, 0x435, 0x440, 0x442,
-0x43e, 0x301, 0x43a, 0x44a, 0x3b, 0x43f, 0x467, 0x442, 0x43e, 0x301, 0x43a, 0x44a, 0x3b, 0x441, 0xa64b, 0x431, 0x431, 0x461, 0x301, 0x442,
-0x430, 0x3b, 0x4c, 0x75, 0x6d, 0x3b, 0x4e, 0x6b, 0x6f, 0x3b, 0x4e, 0x64, 0x79, 0x3b, 0x4e, 0x64, 0x67, 0x3b, 0x4e, 0x6a,
-0x77, 0x3b, 0x4e, 0x67, 0x76, 0x3b, 0x4c, 0x75, 0x62, 0x3b, 0x4c, 0x75, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x4e, 0x6b,
-0x6f, 0x64, 0x79, 0x61, 0x3b, 0x4e, 0x64, 0xe0, 0x61, 0x79, 0xe0, 0x3b, 0x4e, 0x64, 0x61, 0x6e, 0x67, 0xf9, 0x3b, 0x4e,
-0x6a, 0xf2, 0x77, 0x61, 0x3b, 0x4e, 0x67, 0xf2, 0x76, 0x79, 0x61, 0x3b, 0x4c, 0x75, 0x62, 0x69, 0x6e, 0x67, 0x75, 0x3b,
-0x4c, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4e, 0x3b, 0x4c, 0x3b, 0x53, 0x6f, 0x6e, 0x3b, 0x4d, 0xe9,
-0x69, 0x3b, 0x44, 0xeb, 0x6e, 0x3b, 0x4d, 0xeb, 0x74, 0x3b, 0x44, 0x6f, 0x6e, 0x3b, 0x46, 0x72, 0x65, 0x3b, 0x53, 0x61,
-0x6d, 0x3b, 0x53, 0x6f, 0x6e, 0x6e, 0x64, 0x65, 0x67, 0x3b, 0x4d, 0xe9, 0x69, 0x6e, 0x64, 0x65, 0x67, 0x3b, 0x44, 0xeb,
-0x6e, 0x73, 0x63, 0x68, 0x64, 0x65, 0x67, 0x3b, 0x4d, 0xeb, 0x74, 0x74, 0x77, 0x6f, 0x63, 0x68, 0x3b, 0x44, 0x6f, 0x6e,
-0x6e, 0x65, 0x73, 0x63, 0x68, 0x64, 0x65, 0x67, 0x3b, 0x46, 0x72, 0x65, 0x69, 0x64, 0x65, 0x67, 0x3b, 0x53, 0x61, 0x6d,
-0x73, 0x63, 0x68, 0x64, 0x65, 0x67, 0x3b, 0x53, 0x6f, 0x6e, 0x2e, 0x3b, 0x4d, 0xe9, 0x69, 0x2e, 0x3b, 0x44, 0xeb, 0x6e,
-0x2e, 0x3b, 0x4d, 0xeb, 0x74, 0x2e, 0x3b, 0x44, 0x6f, 0x6e, 0x2e, 0x3b, 0x46, 0x72, 0x65, 0x2e, 0x3b, 0x53, 0x61, 0x6d,
-0x2e, 0x3b, 0x6e, 0x74, 0x73, 0x3b, 0x6b, 0x70, 0x61, 0x3b, 0x67, 0x68, 0x254, 0x3b, 0x74, 0x254, 0x6d, 0x3b, 0x75, 0x6d,
-0x65, 0x3b, 0x67, 0x68, 0x268, 0x3b, 0x64, 0x7a, 0x6b, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x6e, 0x74, 0x73, 0x268, 0x3b, 0x74,
-0x73, 0x75, 0x294, 0x75, 0x6b, 0x70, 0xe0, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x67, 0x68, 0x254, 0x65, 0x3b, 0x74, 0x73,
-0x75, 0x294, 0x75, 0x74, 0x254, 0x300, 0x6d, 0x6c, 0xf2, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x75, 0x6d, 0xe8, 0x3b, 0x74, 0x73,
-0x75, 0x294, 0x75, 0x67, 0x68, 0x268, 0x302, 0x6d, 0x3b, 0x74, 0x73, 0x75, 0x294, 0x6e, 0x64, 0x7a, 0x268, 0x6b, 0x254, 0x294,
-0x254, 0x3b, 0x6e, 0x3b, 0x6b, 0x3b, 0x67, 0x3b, 0x74, 0x3b, 0x75, 0x3b, 0x67, 0x3b, 0x64, 0x3b, 0x6e, 0x254, 0x79, 0x3b,
-0x6e, 0x6a, 0x61, 0x3b, 0x75, 0x75, 0x6d, 0x3b, 0x14b, 0x67, 0x65, 0x3b, 0x6d, 0x62, 0x254, 0x3b, 0x6b, 0x254, 0x254, 0x3b,
-0x6a, 0x6f, 0x6e, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6e, 0x254, 0x302, 0x79, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6e,
-0x6a, 0x61, 0x14b, 0x67, 0x75, 0x6d, 0x62, 0x61, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0xfb, 0x6d, 0x3b, 0x14b, 0x67, 0x77,
-0xe0, 0x20, 0x14b, 0x67, 0xea, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6d, 0x62, 0x254, 0x6b, 0x3b, 0x14b, 0x67, 0x77, 0xe0,
-0x20, 0x6b, 0x254, 0x254, 0x3b, 0x14b, 0x67, 0x77, 0xe0, 0x20, 0x6a, 0xf4, 0x6e, 0x3b, 0x6e, 0x3b, 0x6e, 0x3b, 0x75, 0x3b,
-0x14b, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b, 0x6a, 0x3b, 0x41, 0x6c, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x41, 0x74, 0x69, 0x6e, 0x6e,
-0x69, 0x3b, 0x41, 0x74, 0x61, 0x6c, 0x61, 0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x3b, 0x41, 0x6c,
-0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x41, 0x6c, 0x7a, 0x75, 0x6d, 0x61, 0x3b, 0x41, 0x73, 0x69, 0x62, 0x74, 0x69,
-0x3b, 0x48, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x4c, 0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x53, 0x3b, 0xe9, 0x74, 0x3b, 0x6d, 0x254,
-0x301, 0x73, 0x3b, 0x6b, 0x77, 0x61, 0x3b, 0x6d, 0x75, 0x6b, 0x3b, 0x14b, 0x67, 0x69, 0x3b, 0x257, 0xf3, 0x6e, 0x3b, 0x65,
-0x73, 0x61, 0x3b, 0xe9, 0x74, 0x69, 0x3b, 0x6d, 0x254, 0x301, 0x73, 0xfa, 0x3b, 0x6b, 0x77, 0x61, 0x73, 0xfa, 0x3b, 0x6d,
-0x75, 0x6b, 0x254, 0x301, 0x73, 0xfa, 0x3b, 0x14b, 0x67, 0x69, 0x73, 0xfa, 0x3b, 0x257, 0xf3, 0x6e, 0x25b, 0x73, 0xfa, 0x3b,
-0x65, 0x73, 0x61, 0x253, 0x61, 0x73, 0xfa, 0x3b, 0x65, 0x3b, 0x6d, 0x3b, 0x6b, 0x3b, 0x6d, 0x3b, 0x14b, 0x3b, 0x257, 0x3b,
-0x65, 0x3b, 0x44, 0x69, 0x6d, 0x3b, 0x54, 0x65, 0x6e, 0x3b, 0x54, 0x61, 0x6c, 0x3b, 0x41, 0x6c, 0x61, 0x3b, 0x41, 0x72,
-0x61, 0x3b, 0x41, 0x72, 0x6a, 0x3b, 0x53, 0x69, 0x62, 0x3b, 0x44, 0x69, 0x6d, 0x61, 0x73, 0x3b, 0x54, 0x65, 0x6e, 0x65,
-0x14b, 0x3b, 0x54, 0x61, 0x6c, 0x61, 0x74, 0x61, 0x3b, 0x41, 0x6c, 0x61, 0x72, 0x62, 0x61, 0x79, 0x3b, 0x41, 0x72, 0x61,
-0x6d, 0x69, 0x73, 0x61, 0x79, 0x3b, 0x41, 0x72, 0x6a, 0x75, 0x6d, 0x61, 0x3b, 0x53, 0x69, 0x62, 0x69, 0x74, 0x69, 0x3b,
-0x44, 0x3b, 0x54, 0x3b, 0x54, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x41, 0x3b, 0x53, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x3b, 0x6d,
-0x254, 0x301, 0x6e, 0x3b, 0x73, 0x6d, 0x62, 0x3b, 0x73, 0x6d, 0x6c, 0x3b, 0x73, 0x6d, 0x6e, 0x3b, 0x66, 0xfa, 0x6c, 0x3b,
-0x73, 0xe9, 0x72, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x3b, 0x6d, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x3b, 0x73, 0x254,
-0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x259, 0x6c, 0xfa, 0x20, 0x6d, 0x259, 0x301, 0x62, 0x25b, 0x30c, 0x3b, 0x73, 0x254, 0x301,
-0x6e, 0x64, 0x254, 0x20, 0x6d, 0x259, 0x6c, 0xfa, 0x20, 0x6d, 0x259, 0x301, 0x6c, 0x25b, 0x301, 0x3b, 0x73, 0x254, 0x301, 0x6e,
-0x64, 0x254, 0x20, 0x6d, 0x259, 0x6c, 0xfa, 0x20, 0x6d, 0x259, 0x301, 0x6e, 0x79, 0x69, 0x3b, 0x66, 0xfa, 0x6c, 0x61, 0x64,
-0xe9, 0x3b, 0x73, 0xe9, 0x72, 0x61, 0x64, 0xe9, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x66,
-0x3b, 0x73, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x3b, 0x6c, 0x1dd, 0x6e, 0x3b, 0x6d, 0x61, 0x61, 0x3b, 0x6d, 0x25b, 0x6b, 0x3b,
-0x6a, 0x1dd, 0x1dd, 0x3b, 0x6a, 0xfa, 0x6d, 0x3b, 0x73, 0x61, 0x6d, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x1dd, 0x3b, 0x6c,
-0x1dd, 0x6e, 0x64, 0xed, 0x3b, 0x6d, 0x61, 0x61, 0x64, 0xed, 0x3b, 0x6d, 0x25b, 0x6b, 0x72, 0x25b, 0x64, 0xed, 0x3b, 0x6a,
-0x1dd, 0x1dd, 0x64, 0xed, 0x3b, 0x6a, 0xfa, 0x6d, 0x62, 0xe1, 0x3b, 0x73, 0x61, 0x6d, 0x64, 0xed, 0x3b, 0x73, 0x3b, 0x6c,
-0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x6a, 0x3b, 0x6a, 0x3b, 0x73, 0x3b, 0x53, 0x61, 0x62, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a,
-0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x72, 0x61, 0x3b, 0x49, 0x6a, 0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x53,
-0x61, 0x62, 0x61, 0x74, 0x6f, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e,
-0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b, 0x41, 0x72, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x73,
-0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x53, 0x3b,
-0x4a, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4a, 0x3b, 0x43, 0x79, 0x61, 0x3b, 0x43, 0x6c, 0x61, 0x3b,
-0x43, 0x7a, 0x69, 0x3b, 0x43, 0x6b, 0x6f, 0x3b, 0x43, 0x6b, 0x61, 0x3b, 0x43, 0x67, 0x61, 0x3b, 0x43, 0x7a, 0x65, 0x3b,
-0x43, 0x6f, 0x6d, 0x2019, 0x79, 0x61, 0x6b, 0x6b, 0x65, 0x3b, 0x43, 0x6f, 0x6d, 0x6c, 0x61, 0x61, 0x257, 0x69, 0x69, 0x3b,
-0x43, 0x6f, 0x6d, 0x7a, 0x79, 0x69, 0x69, 0x257, 0x69, 0x69, 0x3b, 0x43, 0x6f, 0x6d, 0x6b, 0x6f, 0x6c, 0x6c, 0x65, 0x3b,
-0x43, 0x6f, 0x6d, 0x6b, 0x61, 0x6c, 0x64, 0x1dd, 0x253, 0x6c, 0x69, 0x69, 0x3b, 0x43, 0x6f, 0x6d, 0x67, 0x61, 0x69, 0x73,
-0x75, 0x75, 0x3b, 0x43, 0x6f, 0x6d, 0x7a, 0x79, 0x65, 0x253, 0x73, 0x75, 0x75, 0x3b, 0x59, 0x3b, 0x4c, 0x3b, 0x5a, 0x3b,
-0x4f, 0x3b, 0x41, 0x3b, 0x47, 0x3b, 0x45, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x3b, 0x6d, 0x254, 0x301, 0x6e, 0x3b, 0x73, 0x6d,
-0x62, 0x3b, 0x73, 0x6d, 0x6c, 0x3b, 0x73, 0x6d, 0x6e, 0x3b, 0x6d, 0x62, 0x73, 0x3b, 0x73, 0x61, 0x73, 0x3b, 0x73, 0x254,
-0x301, 0x6e, 0x64, 0x254, 0x3b, 0x6d, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d,
-0x61, 0x66, 0xfa, 0x20, 0x6d, 0xe1, 0x62, 0x61, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x61, 0x66, 0xfa,
-0x20, 0x6d, 0xe1, 0x6c, 0x61, 0x6c, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x254, 0x20, 0x6d, 0x61, 0x66, 0xfa, 0x20, 0x6d,
-0xe1, 0x6e, 0x61, 0x3b, 0x6d, 0x61, 0x62, 0xe1, 0x67, 0xe1, 0x20, 0x6d, 0xe1, 0x20, 0x73, 0x75, 0x6b, 0x75, 0x6c, 0x3b,
-0x73, 0xe1, 0x73, 0x61, 0x64, 0x69, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x73,
-0x3b, 0x43, 0xe4, 0x14b, 0x3b, 0x4a, 0x69, 0x65, 0x63, 0x3b, 0x52, 0x25b, 0x77, 0x3b, 0x44, 0x69, 0x254, 0x331, 0x6b, 0x3b,
-0x14a, 0x75, 0x61, 0x61, 0x6e, 0x3b, 0x44, 0x68, 0x69, 0x65, 0x65, 0x63, 0x3b, 0x42, 0xe4, 0x6b, 0x25b, 0x6c, 0x3b, 0x43,
-0xe4, 0x14b, 0x20, 0x6b, 0x75, 0x254, 0x74, 0x68, 0x3b, 0x4a, 0x69, 0x65, 0x63, 0x20, 0x6c, 0x61, 0x331, 0x74, 0x3b, 0x52,
-0x25b, 0x77, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x44, 0x69, 0x254, 0x331, 0x6b, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69,
-0x3b, 0x14a, 0x75, 0x61, 0x61, 0x6e, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x44, 0x68, 0x69, 0x65, 0x65, 0x63, 0x20,
-0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x42, 0xe4, 0x6b, 0x25b, 0x6c, 0x20, 0x6c, 0xe4, 0x74, 0x6e, 0x69, 0x3b, 0x43, 0x3b,
-0x4a, 0x3b, 0x52, 0x3b, 0x44, 0x3b, 0x14a, 0x3b, 0x44, 0x3b, 0x42, 0x3b, 0x431, 0x441, 0x3b, 0x431, 0x43d, 0x3b, 0x43e, 0x43f,
-0x3b, 0x441, 0x44d, 0x3b, 0x447, 0x43f, 0x3b, 0x431, 0x44d, 0x3b, 0x441, 0x431, 0x3b, 0x431, 0x430, 0x441, 0x43a, 0x44b, 0x4bb, 0x44b,
-0x430, 0x43d, 0x43d, 0x44c, 0x430, 0x3b, 0x431, 0x44d, 0x43d, 0x438, 0x434, 0x438, 0x44d, 0x43d, 0x43d, 0x44c, 0x438, 0x43a, 0x3b, 0x43e,
-0x43f, 0x442, 0x443, 0x43e, 0x440, 0x443, 0x43d, 0x43d, 0x44c, 0x443, 0x43a, 0x3b, 0x441, 0x44d, 0x440, 0x44d, 0x434, 0x44d, 0x3b, 0x447,
-0x44d, 0x43f, 0x43f, 0x438, 0x44d, 0x440, 0x3b, 0x411, 0x44d, 0x44d, 0x442, 0x438, 0x4a5, 0x441, 0x44d, 0x3b, 0x441, 0x443, 0x431, 0x443,
-0x43e, 0x442, 0x430, 0x3b, 0x411, 0x3b, 0x411, 0x3b, 0x41e, 0x3b, 0x421, 0x3b, 0x427, 0x3b, 0x411, 0x3b, 0x421, 0x3b, 0x4d, 0x75,
-0x6c, 0x3b, 0x4a, 0x74, 0x74, 0x3b, 0x4a, 0x6e, 0x6e, 0x3b, 0x4a, 0x74, 0x6e, 0x3b, 0x41, 0x6c, 0x68, 0x3b, 0x49, 0x6a,
-0x75, 0x3b, 0x4a, 0x6d, 0x6f, 0x3b, 0x4d, 0x75, 0x6c, 0x75, 0x6e, 0x67, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61,
-0x74, 0x75, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x3b, 0x4a, 0x75, 0x6d, 0x61, 0x74, 0x61, 0x6e, 0x6f, 0x3b,
-0x41, 0x6c, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x73, 0x69, 0x3b, 0x49, 0x6a, 0x75, 0x6d, 0x61, 0x61, 0x3b, 0x4a, 0x75, 0x6d,
-0x61, 0x6d, 0x6f, 0x73, 0x69, 0x3b, 0x4d, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x4a, 0x3b, 0x41, 0x3b, 0x49, 0x3b, 0x4a, 0x3b,
-0xa55e, 0xa54c, 0xa535, 0x3b, 0xa5f3, 0xa5e1, 0xa609, 0x3b, 0xa55a, 0xa55e, 0xa55a, 0x3b, 0xa549, 0xa55e, 0xa552, 0x3b, 0xa549, 0xa524, 0xa546, 0xa562,
-0x3b, 0xa549, 0xa524, 0xa540, 0xa56e, 0x3b, 0xa53b, 0xa52c, 0xa533, 0x3b, 0x6c, 0x61, 0x68, 0x61, 0x64, 0x69, 0x3b, 0x74, 0x25b, 0x25b,
-0x6e, 0x25b, 0x25b, 0x3b, 0x74, 0x61, 0x6c, 0x61, 0x74, 0x61, 0x3b, 0x61, 0x6c, 0x61, 0x62, 0x61, 0x3b, 0x61, 0x69, 0x6d,
-0x69, 0x73, 0x61, 0x3b, 0x61, 0x69, 0x6a, 0x69, 0x6d, 0x61, 0x3b, 0x73, 0x69, 0x253, 0x69, 0x74, 0x69, 0x3b, 0x53, 0x75,
-0x6e, 0x3b, 0x4d, 0xe4, 0x6e, 0x3b, 0x5a, 0x69, 0x161, 0x3b, 0x4d, 0x69, 0x74, 0x3b, 0x46, 0x72, 0xf3, 0x3b, 0x46, 0x72,
-0x69, 0x3b, 0x53, 0x61, 0x6d, 0x3b, 0x53, 0x75, 0x6e, 0x6e, 0x74, 0x61, 0x67, 0x3b, 0x4d, 0xe4, 0x6e, 0x74, 0x61, 0x67,
-0x3b, 0x5a, 0x69, 0x161, 0x74, 0x61, 0x67, 0x3b, 0x4d, 0x69, 0x74, 0x74, 0x77, 0x75, 0x10d, 0x3b, 0x46, 0x72, 0xf3, 0x6e,
-0x74, 0x61, 0x67, 0x3b, 0x46, 0x72, 0x69, 0x74, 0x61, 0x67, 0x3b, 0x53, 0x61, 0x6d, 0x161, 0x74, 0x61, 0x67, 0x3b, 0x53,
-0x3b, 0x4d, 0x3b, 0x5a, 0x3b, 0x4d, 0x3b, 0x46, 0x3b, 0x46, 0x3b, 0x53, 0x3b, 0x73, 0x64, 0x3b, 0x6d, 0x64, 0x3b, 0x6d,
-0x77, 0x3b, 0x65, 0x74, 0x3b, 0x6b, 0x6c, 0x3b, 0x66, 0x6c, 0x3b, 0x73, 0x73, 0x3b, 0x73, 0x254, 0x301, 0x6e, 0x64, 0x69,
-0x25b, 0x3b, 0x6d, 0xf3, 0x6e, 0x64, 0x69, 0x65, 0x3b, 0x6d, 0x75, 0xe1, 0x6e, 0x79, 0xe1, 0x14b, 0x6d, 0xf3, 0x6e, 0x64,
-0x69, 0x65, 0x3b, 0x6d, 0x65, 0x74, 0xfa, 0x6b, 0x70, 0xed, 0xe1, 0x70, 0x25b, 0x3b, 0x6b, 0xfa, 0x70, 0xe9, 0x6c, 0x69,
-0x6d, 0x65, 0x74, 0xfa, 0x6b, 0x70, 0x69, 0x61, 0x70, 0x25b, 0x3b, 0x66, 0x65, 0x6c, 0xe9, 0x74, 0x65, 0x3b, 0x73, 0xe9,
-0x73, 0x65, 0x6c, 0xe9, 0x3b, 0x73, 0x3b, 0x6d, 0x3b, 0x6d, 0x3b, 0x65, 0x3b, 0x6b, 0x3b, 0x66, 0x3b, 0x73, 0x3b, 0x64,
-0x6f, 0x6d, 0x3b, 0x6c, 0x6c, 0x75, 0x3b, 0x6d, 0x61, 0x72, 0x3b, 0x6d, 0x69, 0xe9, 0x3b, 0x78, 0x75, 0x65, 0x3b, 0x76,
-0x69, 0x65, 0x3b, 0x73, 0xe1, 0x62, 0x3b, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x75, 0x3b, 0x6c, 0x6c, 0x75, 0x6e, 0x65,
-0x73, 0x3b, 0x6d, 0x61, 0x72, 0x74, 0x65, 0x73, 0x3b, 0x6d, 0x69, 0xe9, 0x72, 0x63, 0x6f, 0x6c, 0x65, 0x73, 0x3b, 0x78,
-0x75, 0x65, 0x76, 0x65, 0x73, 0x3b, 0x76, 0x69, 0x65, 0x6e, 0x72, 0x65, 0x73, 0x3b, 0x73, 0xe1, 0x62, 0x61, 0x64, 0x75,
-0x3b, 0x53, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x3b, 0x4d, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x3b, 0xc1, 0x70, 0x74, 0x61, 0x20,
-0x4d, 0x254, 0x301, 0x6e, 0x64, 0x69, 0x3b, 0x57, 0x25b, 0x301, 0x6e, 0x25b, 0x73, 0x25b, 0x64, 0x25b, 0x3b, 0x54, 0x254, 0x301,
-0x73, 0x25b, 0x64, 0x25b, 0x3b, 0x46, 0x25b, 0x6c, 0xe2, 0x79, 0x25b, 0x64, 0x25b, 0x3b, 0x53, 0xe1, 0x73, 0x69, 0x64, 0x25b,
-0x3b, 0x53, 0x254, 0x301, 0x3b, 0x4d, 0x254, 0x301, 0x3b, 0xc1, 0x4d, 0x3b, 0x57, 0x25b, 0x301, 0x3b, 0x54, 0x254, 0x301, 0x3b,
-0x46, 0x25b, 0x3b, 0x53, 0xe1, 0x3b, 0x73, 0x254, 0x6e, 0x64, 0x69, 0x3b, 0x6c, 0x75, 0x6e, 0x64, 0x69, 0x3b, 0x6d, 0x61,
-0x72, 0x64, 0x69, 0x3b, 0x6d, 0x25b, 0x72, 0x6b, 0x25b, 0x72, 0x25b, 0x64, 0x69, 0x3b, 0x79, 0x65, 0x64, 0x69, 0x3b, 0x76,
-0x61, 0x14b, 0x64, 0x25b, 0x72, 0x25b, 0x64, 0x69, 0x3b, 0x6d, 0x254, 0x6e, 0x254, 0x20, 0x73, 0x254, 0x6e, 0x64, 0x69, 0x3b,
-0x73, 0x6f, 0x3b, 0x6c, 0x75, 0x3b, 0x6d, 0x61, 0x3b, 0x6d, 0x25b, 0x3b, 0x79, 0x65, 0x3b, 0x76, 0x61, 0x3b, 0x6d, 0x73,
-0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x31, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x32, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20,
-0x33, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x34, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x35, 0x3b, 0x41, 0x6e, 0x65, 0x67,
-0x20, 0x36, 0x3b, 0x41, 0x6e, 0x65, 0x67, 0x20, 0x37, 0x3b, 0x41, 0x31, 0x3b, 0x41, 0x32, 0x3b, 0x41, 0x33, 0x3b, 0x41,
-0x34, 0x3b, 0x41, 0x35, 0x3b, 0x41, 0x36, 0x3b, 0x41, 0x37, 0x3b, 0x6c, 0x79, 0x25b, 0x2bc, 0x25b, 0x301, 0x20, 0x73, 0x1e85,
-0xed, 0x14b, 0x74, 0xe8, 0x3b, 0x6d, 0x76, 0x66, 0xf2, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0x62, 0x254, 0x301,
-0x254, 0x6e, 0x74, 0xe8, 0x20, 0x6d, 0x76, 0x66, 0xf2, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x74, 0x73, 0xe8, 0x74,
-0x73, 0x25b, 0x300, 0x25b, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0x62, 0x254, 0x301, 0x254, 0x6e, 0x74, 0xe8, 0x20,
-0x74, 0x73, 0x65, 0x74, 0x73, 0x25b, 0x300, 0x25b, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0x76, 0x66, 0xf2, 0x20,
-0x6d, 0xe0, 0x67, 0x61, 0x20, 0x6c, 0x79, 0x25b, 0x30c, 0x2bc, 0x3b, 0x6d, 0xe0, 0x67, 0x61, 0x20, 0x6c, 0x79, 0x25b, 0x30c,
-0x2bc, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x77, 0x61, 0x6b, 0x21f, 0x61, 0x14b, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74,
-0x75, 0x77, 0x61, 0x14b, 0x17e, 0x69, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x6e, 0x75, 0x14b, 0x70, 0x61, 0x3b, 0x41,
-0x14b, 0x70, 0xe9, 0x74, 0x75, 0x79, 0x61, 0x6d, 0x6e, 0x69, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x74, 0x6f, 0x70,
-0x61, 0x3b, 0x41, 0x14b, 0x70, 0xe9, 0x74, 0x75, 0x7a, 0x61, 0x70, 0x74, 0x61, 0x14b, 0x3b, 0x4f, 0x77, 0xe1, 0x14b, 0x67,
-0x79, 0x75, 0x17e, 0x61, 0x17e, 0x61, 0x70, 0x69, 0x3b, 0x41, 0x3b, 0x57, 0x3b, 0x4e, 0x3b, 0x59, 0x3b, 0x54, 0x3b, 0x5a,
-0x3b, 0x4f, 0x3b, 0x2d30, 0x2d59, 0x2d30, 0x2d4e, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d62, 0x2d4f, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4f,
-0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d55, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d3d, 0x2d61, 0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d4e, 0x2d61,
-0x2d30, 0x2d59, 0x3b, 0x2d30, 0x2d59, 0x2d49, 0x2d39, 0x2d62, 0x2d30, 0x2d59, 0x3b, 0x6cc, 0x6d5, 0x6a9, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b,
-0x62f, 0x648, 0x648, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x633, 0x6ce, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x686, 0x648, 0x627,
-0x631, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x67e, 0x6ce, 0x646, 0x62c, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x6be, 0x6d5, 0x6cc,
-0x646, 0x6cc, 0x3b, 0x634, 0x6d5, 0x645, 0x645, 0x6d5, 0x3b, 0x6cc, 0x3b, 0x62f, 0x3b, 0x633, 0x3b, 0x686, 0x3b, 0x67e, 0x3b, 0x6be,
-0x3b, 0x634, 0x3b, 0x6e, 0x6a, 0x65, 0x3b, 0x70, 0xf3, 0x6e, 0x3b, 0x77, 0x61, 0x142, 0x3b, 0x73, 0x72, 0x6a, 0x3b, 0x73,
-0x74, 0x77, 0x3b, 0x70, 0x11b, 0x74, 0x3b, 0x73, 0x6f, 0x62, 0x3b, 0x6e, 0x6a, 0x65, 0x17a, 0x65, 0x6c, 0x61, 0x3b, 0x70,
-0xf3, 0x6e, 0x6a, 0x65, 0x17a, 0x65, 0x6c, 0x65, 0x3b, 0x77, 0x61, 0x142, 0x74, 0x6f, 0x72, 0x61, 0x3b, 0x73, 0x72, 0x6a,
-0x6f, 0x64, 0x61, 0x3b, 0x73, 0x74, 0x77, 0xf3, 0x72, 0x74, 0x6b, 0x3b, 0x70, 0x11b, 0x74, 0x6b, 0x3b, 0x73, 0x6f, 0x62,
-0x6f, 0x74, 0x61, 0x3b, 0x6e, 0x3b, 0x70, 0x3b, 0x77, 0x3b, 0x73, 0x3b, 0x73, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x6e, 0x6a,
-0x65, 0x3b, 0x70, 0xf3, 0x6e, 0x3b, 0x77, 0x75, 0x74, 0x3b, 0x73, 0x72, 0x6a, 0x3b, 0x161, 0x74, 0x77, 0x3b, 0x70, 0x6a,
-0x61, 0x3b, 0x73, 0x6f, 0x62, 0x3b, 0x6e, 0x6a, 0x65, 0x64, 0x17a, 0x65, 0x6c, 0x61, 0x3b, 0x70, 0xf3, 0x6e, 0x64, 0x17a,
-0x65, 0x6c, 0x61, 0x3b, 0x77, 0x75, 0x74, 0x6f, 0x72, 0x61, 0x3b, 0x73, 0x72, 0x6a, 0x65, 0x64, 0x61, 0x3b, 0x161, 0x74,
-0x77, 0xf3, 0x72, 0x74, 0x6b, 0x3b, 0x70, 0x6a, 0x61, 0x74, 0x6b, 0x3b, 0x73, 0x6f, 0x62, 0x6f, 0x74, 0x61, 0x3b, 0x6e,
-0x3b, 0x70, 0x3b, 0x77, 0x3b, 0x73, 0x3b, 0x161, 0x3b, 0x70, 0x3b, 0x73, 0x3b, 0x6e, 0x61, 0x64, 0x3b, 0x70, 0x61, 0x6e,
-0x3b, 0x77, 0x69, 0x73, 0x3b, 0x70, 0x75, 0x73, 0x3b, 0x6b, 0x65, 0x74, 0x3b, 0x70, 0x113, 0x6e, 0x3b, 0x73, 0x61, 0x62,
-0x3b, 0x6e, 0x61, 0x64, 0x12b, 0x6c, 0x69, 0x3b, 0x70, 0x61, 0x6e, 0x61, 0x64, 0x12b, 0x6c, 0x69, 0x3b, 0x77, 0x69, 0x73,
-0x61, 0x73, 0x12b, 0x64, 0x69, 0x73, 0x3b, 0x70, 0x75, 0x73, 0x73, 0x69, 0x73, 0x61, 0x77, 0x61, 0x69, 0x74, 0x69, 0x3b,
-0x6b, 0x65, 0x74, 0x77, 0x69, 0x72, 0x74, 0x69, 0x6b, 0x73, 0x3b, 0x70, 0x113, 0x6e, 0x74, 0x6e, 0x69, 0x6b, 0x73, 0x3b,
-0x73, 0x61, 0x62, 0x61, 0x74, 0x74, 0x69, 0x6b, 0x61, 0x3b, 0x4e, 0x3b, 0x50, 0x3b, 0x57, 0x3b, 0x50, 0x3b, 0x4b, 0x3b,
-0x50, 0x3b, 0x53, 0x3b, 0x70, 0x61, 0x73, 0x3b, 0x76, 0x75, 0x6f, 0x3b, 0x6d, 0x61, 0x6a, 0x3b, 0x6b, 0x6f, 0x73, 0x3b,
-0x74, 0x75, 0x6f, 0x3b, 0x76, 0xe1, 0x73, 0x3b, 0x6c, 0xe1, 0x76, 0x3b, 0x70, 0x61, 0x73, 0x65, 0x70, 0x65, 0x69, 0x76,
-0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x73, 0x61, 0x72, 0x67, 0xe2, 0x3b, 0x6d, 0x61, 0x6a, 0x65, 0x62, 0x61, 0x72, 0x67,
-0xe2, 0x3b, 0x6b, 0x6f, 0x73, 0x6b, 0x6f, 0x6b, 0x6b, 0x6f, 0x3b, 0x74, 0x75, 0x6f, 0x72, 0xe2, 0x73, 0x74, 0xe2, 0x68,
-0x3b, 0x76, 0xe1, 0x73, 0x74, 0x75, 0x70, 0x70, 0x65, 0x69, 0x76, 0x69, 0x3b, 0x6c, 0xe1, 0x76, 0x75, 0x72, 0x64, 0xe2,
-0x68, 0x3b, 0x70, 0x61, 0x73, 0x65, 0x70, 0x65, 0x65, 0x69, 0x76, 0x69, 0x3b, 0x76, 0x75, 0x6f, 0x73, 0x73, 0x61, 0x61,
-0x72, 0x67, 0xe2, 0x3b, 0x6d, 0x61, 0x6a, 0x65, 0x62, 0x61, 0x61, 0x72, 0x67, 0xe2, 0x3b, 0x6b, 0x6f, 0x73, 0x6b, 0x6f,
-0x68, 0x6f, 0x3b, 0x74, 0x75, 0x6f, 0x72, 0xe2, 0x73, 0x74, 0x75, 0x76, 0x3b, 0x76, 0xe1, 0x73, 0x74, 0x75, 0x70, 0x70,
-0x65, 0x65, 0x69, 0x76, 0x69, 0x3b, 0x6c, 0xe1, 0x76, 0x75, 0x72, 0x64, 0x75, 0x76, 0x3b, 0x70, 0x3b, 0x56, 0x3b, 0x4d,
-0x3b, 0x4b, 0x3b, 0x54, 0x3b, 0x56, 0x3b, 0x4c, 0x3b
-};
-
-static const ushort byte_unit_data[] = {
-0x62, 0x79, 0x74, 0x65, 0x73, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b,
-0x45, 0x42, 0x4b, 0x69, 0x42, 0x3b, 0x4d, 0x69, 0x42, 0x3b, 0x47, 0x69, 0x42, 0x3b, 0x54, 0x69, 0x42, 0x3b, 0x50, 0x69,
-0x42, 0x3b, 0x45, 0x69, 0x42, 0x62, 0x79, 0x74, 0x65, 0x67, 0x72, 0x65, 0x70, 0x65, 0x62, 0x61, 0x6a, 0x74, 0x1263, 0x12ed,
-0x1275, 0x12aa, 0x1263, 0x3b, 0x121c, 0x130b, 0x1263, 0x12ed, 0x1275, 0x3b, 0x130a, 0x1263, 0x3b, 0x1274, 0x122b, 0x1263, 0x12ed, 0x1275, 0x3b, 0x1354,
-0x1263, 0x3b, 0x45, 0x42, 0x628, 0x627, 0x64a, 0x62a, 0x643, 0x64a, 0x644, 0x648, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x645, 0x64a, 0x63a,
-0x627, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x63a, 0x64a, 0x63a, 0x627, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x62a, 0x64a, 0x631, 0x627, 0x628,
-0x627, 0x64a, 0x62a, 0x3b, 0x628, 0x64a, 0x62a, 0x627, 0x628, 0x627, 0x64a, 0x62a, 0x3b, 0x45, 0x42, 0x562, 0x561, 0x575, 0x569, 0x565,
-0x580, 0x56f, 0x532, 0x3b, 0x544, 0x532, 0x3b, 0x533, 0x532, 0x3b, 0x54f, 0x532, 0x3b, 0x54a, 0x532, 0x3b, 0x45, 0x42, 0x9ac, 0x9be,
-0x987, 0x99f, 0x995, 0x9bf, 0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x9ae, 0x9c7, 0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x997, 0x9bf,
-0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x99f, 0x9c7, 0x983, 0x20, 0x9ac, 0x9be, 0x983, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x62,
-0x61, 0x79, 0x74, 0x62, 0x79, 0x74, 0x65, 0x2d, 0x61, 0x6b, 0x6f, 0x6b, 0x74, 0x65, 0x64, 0x6f, 0xf9, 0x6b, 0x6f, 0x3b,
-0x4d, 0x6f, 0x3b, 0x47, 0x6f, 0x3b, 0x54, 0x6f, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x431, 0x430, 0x439, 0x442, 0x43e, 0x432,
-0x435, 0x1018, 0x102d, 0x102f, 0x1000, 0x103a, 0x431, 0x430, 0x439, 0x442, 0x44b, 0x41a, 0x411, 0x3b, 0x41c, 0x411, 0x3b, 0x413, 0x411, 0x3b,
-0x422, 0x411, 0x3b, 0x41f, 0x411, 0x3b, 0x45, 0x42, 0x1794, 0x17c3, 0x5b57, 0x8282, 0x5343, 0x5b57, 0x8282, 0x3b, 0x5146, 0x5b57, 0x8282, 0x3b,
-0x5409, 0x5b57, 0x8282, 0x3b, 0x592a, 0x5b57, 0x8282, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x4f4d, 0x5143, 0x7d44, 0x62, 0x61, 0x6a, 0x74,
-0x6f, 0x76, 0x69, 0x62, 0x61, 0x6a, 0x74, 0x79, 0x62, 0x61, 0x6a, 0x74, 0x6f, 0x6a, 0x62, 0x61, 0x69, 0x64, 0x69, 0x64,
-0x62, 0xfd, 0x74, 0x74, 0x61, 0x76, 0x75, 0x74, 0x6b, 0x74, 0x3b, 0x4d, 0x74, 0x3b, 0x47, 0x74, 0x3b, 0x54, 0x74, 0x3b,
-0x50, 0x74, 0x3b, 0x45, 0x74, 0x4b, 0x69, 0x74, 0x3b, 0x4d, 0x69, 0x74, 0x3b, 0x47, 0x69, 0x74, 0x3b, 0x54, 0x69, 0x74,
-0x3b, 0x50, 0x69, 0x74, 0x3b, 0x45, 0x69, 0x74, 0x6f, 0x63, 0x74, 0x65, 0x74, 0x73, 0x6b, 0x6f, 0x3b, 0x4d, 0x6f, 0x3b,
-0x47, 0x6f, 0x3b, 0x54, 0x6f, 0x3b, 0x50, 0x6f, 0x3b, 0x45, 0x6f, 0x4b, 0x69, 0x6f, 0x3b, 0x4d, 0x69, 0x6f, 0x3b, 0x47,
-0x69, 0x6f, 0x3b, 0x54, 0x69, 0x6f, 0x3b, 0x50, 0x69, 0x6f, 0x3b, 0x45, 0x69, 0x6f, 0x62, 0x61, 0x69, 0x64, 0x68, 0x74,
-0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x10d9, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10db, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10d2,
-0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10e2, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b, 0x10de, 0x10d1, 0x10d0, 0x10d8, 0x10e2, 0x10d8, 0x3b,
-0x45, 0x42, 0x42, 0x79, 0x74, 0x65, 0x73, 0xaac, 0xabe, 0xa87, 0xa9f, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b,
-0x54, 0x42, 0x3b, 0xaaa, 0xac0, 0xaac, 0xac0, 0x3b, 0x45, 0x42, 0x5d1, 0x5d9, 0x5d9, 0x5d8, 0x92c, 0x93e, 0x907, 0x91f, 0x62, 0xe1,
-0x6a, 0x74, 0x62, 0xe6, 0x74, 0x69, 0x62, 0x65, 0x61, 0x72, 0x74, 0x61, 0x30d0, 0x30a4, 0x30c8, 0x62, 0x69, 0x74, 0x65, 0xcac,
-0xcc8, 0xc9f, 0xccd, 0x200c, 0xc97, 0xcb3, 0xcc1, 0xc95, 0xcbf, 0x2e, 0xcac, 0xcc8, 0x2e, 0x3b, 0xcae, 0xcc6, 0x2e, 0xcac, 0xcc8, 0x2e,
-0x3b, 0xc97, 0xcbf, 0x2e, 0xcac, 0xcc8, 0x2e, 0x3b, 0xc9f, 0xcc6, 0x2e, 0xcac, 0xcc8, 0x2e, 0x3b, 0xcaa, 0xcc6, 0xcac, 0xcc8, 0x3b,
-0x45, 0x42, 0x431, 0x430, 0x439, 0x442, 0x43a, 0x411, 0x3b, 0x4d, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x54, 0x411, 0x3b, 0x41f, 0x411,
-0x3b, 0x45, 0x411, 0x4b, 0x69, 0x411, 0x3b, 0x4d, 0x69, 0x411, 0x3b, 0x47, 0x69, 0x411, 0x3b, 0x54, 0x69, 0x411, 0x3b, 0x50,
-0x69, 0x411, 0x3b, 0x45, 0x69, 0x411, 0x43a, 0x411, 0x3b, 0x41c, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x422, 0x411, 0x3b, 0x41f, 0x442,
-0x431, 0x3b, 0x45, 0x42, 0xbc14, 0xc774, 0xd2b8, 0x62, 0x61, 0x69, 0x74, 0x69, 0x62, 0x61, 0x69, 0x74, 0x61, 0x69, 0x431, 0x430,
-0x458, 0x442, 0x438, 0x62, 0x61, 0x69, 0x74, 0xd2c, 0xd48, 0xd31, 0xd4d, 0xd31, 0xd4d, 0xd15, 0xd46, 0xd2c, 0xd3f, 0x3b, 0xd0e, 0xd02,
-0xd2c, 0xd3f, 0x3b, 0xd1c, 0xd3f, 0xd2c, 0xd3f, 0x3b, 0xd1f, 0xd3f, 0xd2c, 0xd3f, 0x3b, 0xd2a, 0xd3f, 0xd2c, 0xd3f, 0x3b, 0x45, 0x42,
-0x43a, 0x411, 0x3b, 0x41c, 0x411, 0x3b, 0x413, 0x411, 0x3b, 0x422, 0x411, 0x3b, 0x41f, 0x411, 0x3b, 0x45, 0x42, 0x6b, 0x42, 0x3b,
-0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x92a, 0x93f, 0x91f, 0x93e, 0x3b, 0x45, 0x42, 0xb2c, 0xb3e, 0xb07, 0xb1f,
-0xb4d, 0x628, 0x627, 0x64a, 0x67c, 0x633, 0x628, 0x627, 0x6cc, 0x62a, 0x6a9, 0x6cc, 0x644, 0x648, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x645,
-0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x6af, 0x6cc, 0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x62a, 0x631, 0x627, 0x628,
-0x627, 0x6cc, 0x62a, 0x3b, 0x67e, 0x62a, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x45, 0x42, 0xa2c, 0xa3e, 0xa07, 0xa1f, 0x62, 0x79,
-0x21b, 0x69, 0x431, 0x430, 0x458, 0x442, 0x43e, 0x432, 0x438, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x632, 0x6aa, 0x644, 0x648, 0x20, 0x628,
-0x627, 0x626, 0x64a, 0x67d, 0x632, 0x3b, 0x645, 0x64a, 0x6af, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x632, 0x3b, 0x6af, 0x64a,
-0x6af, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x632, 0x3b, 0x67d, 0x64a, 0x631, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d,
-0x632, 0x3b, 0x67e, 0x64a, 0x631, 0x627, 0x20, 0x628, 0x627, 0x626, 0x64a, 0x67d, 0x633, 0x3b, 0x45, 0x42, 0xdb6, 0xdba, 0xdd2, 0xda7,
-0xdca, 0xd9a, 0xdd2, 0xdb6, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xdb8, 0xdd9, 0xdb6, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xd9c, 0xdd2, 0xdb6,
-0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xda7, 0xdd9, 0xdb6, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0xdb4, 0xdd9, 0xdb6, 0x20, 0x7b, 0x30, 0x7d,
-0x3b, 0x45, 0x42, 0x62, 0x65, 0x79, 0x74, 0x69, 0x73, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42,
-0x3b, 0x42, 0x42, 0x3b, 0x45, 0x42, 0x6b, 0x69, 0x6c, 0x6f, 0x62, 0x61, 0x69, 0x74, 0x69, 0x20, 0x7b, 0x30, 0x7d, 0x3b,
-0x4d, 0x42, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x47, 0x42, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x74, 0x65, 0x72, 0x61, 0x62, 0x61,
-0x69, 0x74, 0x69, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x50, 0x42, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x45, 0x42, 0xbaa, 0xbc8, 0xb9f,
-0xbcd, 0xb95, 0xbb3, 0xbcd, 0xc2c, 0xc48, 0xc1f, 0xc4d, 0x200c, 0xc32, 0xc41, 0xc15, 0xc47, 0xc2c, 0xc40, 0x3b, 0xc0e, 0xc2e, 0xc4d, 0x200c,
-0xc2c, 0xc3f, 0x3b, 0xc1c, 0xc40, 0xc2c, 0xc40, 0x3b, 0xc1f, 0xc40, 0xc2c, 0xc40, 0x3b, 0xc2a, 0xc40, 0xc2c, 0xc40, 0x3b, 0x45, 0x42,
-0xe44, 0xe1a, 0xe15, 0xe4c, 0x70, 0x61, 0x69, 0x74, 0x69, 0x6b, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x4d,
-0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x47, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x54,
-0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x50, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x45,
-0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x4b, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x4d,
-0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x47, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d,
-0x3b, 0x54, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x3b, 0x50, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b,
-0x30, 0x7d, 0x3b, 0x45, 0x69, 0x42, 0x20, 0x2bb, 0x65, 0x20, 0x7b, 0x30, 0x7d, 0x62, 0x61, 0xfd, 0x74, 0x431, 0x430, 0x439,
-0x442, 0x438, 0x628, 0x627, 0x626, 0x679, 0x6b, 0x42, 0x3b, 0x4d, 0x42, 0x3b, 0x47, 0x42, 0x3b, 0x54, 0x42, 0x3b, 0x67e, 0x6cc,
-0x20, 0x628, 0x6cc, 0x3b, 0x45, 0x42, 0x62, 0x65, 0x69, 0x74, 0x69, 0x61, 0x75, 0x61, 0x1e6d, 0x61, 0x6d, 0x1e0d, 0x61, 0x6e,
-0x6b, 0x41, 0x1e6c, 0x3b, 0x4d, 0x41, 0x1e6c, 0x3b, 0x47, 0x41, 0x1e6c, 0x3b, 0x54, 0x41, 0x1e6c, 0x3b, 0x50, 0x42, 0x3b, 0x45,
-0x42, 0x13d7, 0x13d3, 0x13cd, 0x13a6, 0x13b5, 0x13a9, 0x431, 0x430, 0x430, 0x439, 0x442, 0x43a, 0x411, 0x3b, 0x41c, 0x411, 0x3b, 0x47, 0x42,
-0x3b, 0x54, 0x42, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42, 0x62, 0x79, 0x74, 0x65, 0x79, 0x6a9, 0x6cc, 0x644, 0x648, 0x628, 0x627,
-0x6cc, 0x62a, 0x3b, 0x645, 0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x6af, 0x6cc, 0x6af, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b,
-0x62a, 0x631, 0x627, 0x628, 0x627, 0x6cc, 0x62a, 0x3b, 0x50, 0x42, 0x3b, 0x45, 0x42
-};
-
-static const ushort am_data[] = {
-0x41, 0x4d, 0x57, 0x44, 0x76, 0x6d, 0x2e, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x64, 0x69, 0x74, 0x65, 0x73, 0x1325, 0x12cb,
-0x1275, 0x635, 0x9aa, 0x9c2, 0x9f0, 0x9cd, 0x9ac, 0x9be, 0x9b9, 0x9cd, 0x9a8, 0x410, 0x41c, 0xf66, 0xf94, 0xf0b, 0xf46, 0xf0b, 0x41, 0x2e,
-0x4d, 0x2e, 0x43f, 0x440, 0x2e, 0x43e, 0x431, 0x2e, 0x1014, 0x1036, 0x1014, 0x1000, 0x103a, 0x61, 0x2e, 0xa0, 0x6d, 0x2e, 0x4e0a, 0x5348,
-0x64, 0x6f, 0x70, 0x2e, 0x61, 0x2e, 0x6d, 0x2e, 0x61, 0x6d, 0x61, 0x74, 0x6d, 0x61, 0x70, 0x2e, 0x6d, 0x61, 0x74, 0x69,
-0x6e, 0x6d, 0x3c0, 0x2e, 0x3bc, 0x2e, 0x53, 0x61, 0x66, 0x69, 0x79, 0x61, 0x5dc, 0x5e4, 0x5e0, 0x5d4, 0x5f4, 0x5e6, 0x64, 0x65,
-0x2e, 0x66, 0x2e, 0x68, 0x2e, 0x72, 0x2e, 0x6e, 0x2e, 0x5348, 0x524d, 0x49, 0x73, 0x75, 0x6b, 0xcaa, 0xcc2, 0xcb0, 0xccd, 0xcb5,
-0xcbe, 0xcb9, 0xccd, 0xca8, 0x442, 0x430, 0x4a3, 0x43a, 0x44b, 0xc624, 0xc804, 0x5a, 0x2e, 0x4d, 0x55, 0x2e, 0xe81, 0xec8, 0xead, 0xe99,
-0xe97, 0xec8, 0xebd, 0xe87, 0x70, 0x72, 0x69, 0x65, 0x6b, 0x161, 0x70, 0x75, 0x73, 0x64, 0x69, 0x65, 0x6e, 0x101, 0x6e, 0x74,
-0x254, 0x301, 0x6e, 0x67, 0x254, 0x301, 0x70, 0x72, 0x69, 0x65, 0x161, 0x70, 0x69, 0x65, 0x74, 0x43f, 0x440, 0x435, 0x442, 0x43f,
-0x43b, 0x430, 0x434, 0x43d, 0x435, 0x50, 0x47, 0x92e, 0x2e, 0x92a, 0x942, 0x2e, 0x4af, 0x2e, 0x4e9, 0x2e, 0x92a, 0x942, 0x930, 0x94d,
-0x935, 0x93e, 0x939, 0x94d, 0x928, 0x63a, 0x2e, 0x645, 0x2e, 0x642, 0x628, 0x644, 0x200c, 0x627, 0x632, 0x638, 0x647, 0x631, 0x64, 0x61,
-0x20, 0x6d, 0x61, 0x6e, 0x68, 0xe3, 0xa2a, 0xa42, 0x2e, 0xa26, 0xa41, 0x2e, 0x4e, 0x44, 0x43f, 0x440, 0x435, 0x20, 0x43f, 0x43e,
-0x434, 0x43d, 0x435, 0x70, 0x72, 0x69, 0x6a, 0x65, 0x20, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x70, 0x72, 0x65, 0x20, 0x70, 0x6f,
-0x64, 0x6e, 0x65, 0x43f, 0x440, 0x438, 0x458, 0x435, 0x20, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x4d5, 0x43c, 0x431, 0x438, 0x441, 0x431,
-0x43e, 0x43d, 0x44b, 0x20, 0x440, 0x430, 0x437, 0x43c, 0x4d5, 0x635, 0x628, 0x62d, 0x60c, 0x20, 0x645, 0x646, 0x62c, 0x647, 0x646, 0x62f,
-0xdb4, 0xdd9, 0x2e, 0xdc0, 0x2e, 0x47, 0x48, 0x66, 0x6d, 0x43f, 0x435, 0x2e, 0xa0, 0x447, 0x43e, 0x2e, 0xbae, 0xbc1, 0xbb1, 0xbcd,
-0xbaa, 0xb95, 0xbb2, 0xbcd, 0xe01, 0xe48, 0xe2d, 0xe19, 0xe40, 0xe17, 0xe35, 0xe48, 0xe22, 0xe07, 0xf66, 0xf94, 0xf0b, 0xf51, 0xfb2, 0xf7c,
-0xf0b, 0x1295, 0x1309, 0x1206, 0x20, 0x1230, 0x12d3, 0x1270, 0x68, 0x65, 0x6e, 0x67, 0x69, 0x68, 0x65, 0x6e, 0x67, 0x69, 0xd6, 0xd6,
-0x67, 0xfc, 0x6e, 0x6f, 0x72, 0x74, 0x61, 0x64, 0x61, 0x6e, 0x20, 0xf6, 0x148, 0x686, 0x6c8, 0x634, 0x62a, 0x649, 0x646, 0x20,
-0x628, 0x6c7, 0x631, 0x6c7, 0x646, 0x434, 0x43f, 0x54, 0x4f, 0x422, 0x41e, 0x53, 0x41, 0x79, 0x62, 0x53, 0x75, 0x62, 0x5e4, 0x5bf,
-0x5d0, 0x5b7, 0x5e8, 0x5de, 0x5d9, 0x5d8, 0x5d0, 0x5b8, 0x5d2, 0xc0, 0xe1, 0x72, 0x1ecd, 0x300, 0xc0, 0xe1, 0x72, 0x254, 0x300, 0x66,
-0x6f, 0x72, 0x6d, 0x69, 0x64, 0x64, 0x61, 0x67, 0x70, 0x72, 0x69, 0x6a, 0x65, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x41, 0x4e,
-0x4e, 0x2019, 0x1ee5, 0x74, 0x1ee5, 0x74, 0x1ee5, 0x128, 0x79, 0x61, 0x6b, 0x77, 0x61, 0x6b, 0x79, 0x61, 0x61, 0x2e, 0x14b, 0x64,
-0x69, 0x61, 0x6d, 0x20, 0x56, 0x6f, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x61, 0x67, 0xa3b8, 0xa111, 0x69, 0x111, 0x69, 0x74, 0x62,
-0x65, 0x61, 0x69, 0x76, 0x65, 0x74, 0x69, 0x62, 0x4d, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x4c, 0x75, 0x6d, 0x61, 0x20, 0x6c,
-0x77, 0x61, 0x20, 0x4b, 0x73, 0x75, 0x62, 0x61, 0x6b, 0x61, 0x4b, 0x69, 0x72, 0x6f, 0x6b, 0x6f, 0x54, 0x65, 0x73, 0x69,
-0x72, 0x61, 0x6e, 0x6b, 0x61, 0x6e, 0x67, 0x2019, 0x61, 0x6d, 0x61, 0x2d5c, 0x2d49, 0x2d3c, 0x2d30, 0x2d61, 0x2d5c, 0x74, 0x69, 0x66,
-0x61, 0x77, 0x74, 0x6e, 0x20, 0x74, 0x75, 0x66, 0x61, 0x74, 0x70, 0x61, 0x6d, 0x69, 0x6c, 0x61, 0x75, 0x75, 0x74, 0x75,
-0x6b, 0x6f, 0x4b, 0x49, 0x13cc, 0x13be, 0x13b4, 0x4d, 0x75, 0x68, 0x69, 0x54, 0x4f, 0x4f, 0x75, 0x6c, 0x75, 0x63, 0x68, 0x65,
-0x6c, 0x6f, 0x52, 0x168, 0x6b, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x1c1, 0x67, 0x6f, 0x61, 0x67, 0x61, 0x73, 0x55, 0x68, 0x72,
-0x20, 0x76, 0xf6, 0x72, 0x6d, 0x69, 0x64, 0x64, 0x61, 0x61, 0x63, 0x68, 0x73, 0x190, 0x6e, 0x6b, 0x61, 0x6b, 0x25b, 0x6e,
-0x79, 0xe1, 0x4d, 0x75, 0x6e, 0x6b, 0x79, 0x6f, 0x69, 0x63, 0x68, 0x65, 0x68, 0x65, 0x61, 0x76, 0x6f, 0x54, 0x61, 0x70,
-0x61, 0x72, 0x61, 0x63, 0x68, 0x75, 0x41, 0x64, 0x64, 0x75, 0x68, 0x61, 0x4f, 0x44, 0x5a, 0x64, 0x61, 0x74, 0x20, 0x61,
-0x7a, 0x61, 0x6c, 0x6d, 0x61, 0x6b, 0x65, 0x6f, 0x92b, 0x941, 0x902, 0x44, 0x69, 0x6e, 0x64, 0x61, 0x6d, 0x6f, 0x69, 0x65,
-0x73, 0x61, 0x2e, 0x67, 0x49, 0x20, 0x62, 0x69, 0x6b, 0x25b, 0x302, 0x67, 0x6c, 0xe0, 0x53, 0x75, 0x62, 0x62, 0x61, 0x61,
-0x68, 0x69, 0x69, 0x64, 0x69, 0x253, 0x61, 0x6b, 0xed, 0x6b, 0xed, 0x72, 0xed, 0x67, 0x73, 0xe1, 0x72, 0xfa, 0x77, 0xe1,
-0x77, 0x69, 0x63, 0x68, 0x69, 0x73, 0x68, 0x75, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6d, 0x61, 0x6e, 0xe1, 0x52, 0x57, 0x42d,
-0x418, 0x4c, 0x77, 0x61, 0x6d, 0x69, 0x6c, 0x61, 0x77, 0x75, 0x6b, 0x69, 0x25b, 0x6d, 0x25b, 0x301, 0x25b, 0x6d, 0x64, 0x65,
-0x20, 0x6c, 0x61, 0x20, 0x6d, 0x61, 0xf1, 0x61, 0x6e, 0x61, 0x6d, 0x62, 0x61, 0xa78c, 0x6d, 0x62, 0x61, 0xa78c, 0x6d, 0x62,
-0x61, 0x2bc, 0xe1, 0x6d, 0x62, 0x61, 0x2bc, 0x628, 0x2e, 0x646, 0x64, 0x6f, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x61, 0x69,
-0x70, 0x2e
-};
-
-static const ushort pm_data[] = {
-0x50, 0x4d, 0x57, 0x42, 0x6e, 0x6d, 0x2e, 0x65, 0x20, 0x70, 0x61, 0x73, 0x64, 0x69, 0x74, 0x65, 0x73, 0x12a8, 0x1230, 0x12d3,
-0x1275, 0x645, 0x985, 0x9aa, 0x9f0, 0x9be, 0x9b9, 0x9cd, 0x9a8, 0x41f, 0x41c, 0xf55, 0xfb1, 0xf72, 0xf0b, 0xf46, 0xf0b, 0x47, 0x2e, 0x4d,
-0x2e, 0x441, 0x43b, 0x2e, 0x43e, 0x431, 0x2e, 0x100a, 0x1014, 0x1031, 0x70, 0x2e, 0xa0, 0x6d, 0x2e, 0x4e0b, 0x5348, 0x6f, 0x64, 0x70,
-0x2e, 0x70, 0x2e, 0x6d, 0x2e, 0x70, 0x6d, 0x70, 0x74, 0x6d, 0x69, 0x70, 0x2e, 0x73, 0x6f, 0x69, 0x72, 0x66, 0x3bc, 0x2e,
-0x3bc, 0x2e, 0x59, 0x61, 0x6d, 0x6d, 0x61, 0x5d0, 0x5d7, 0x5d4, 0x5f4, 0x5e6, 0x64, 0x75, 0x2e, 0x65, 0x2e, 0x68, 0x2e, 0x69,
-0x2e, 0x6e, 0x2e, 0x5348, 0x5f8c, 0x57, 0x65, 0x6e, 0x67, 0x69, 0xc85, 0xcaa, 0xcb0, 0xcbe, 0xcb9, 0xccd, 0xca8, 0x442, 0x4af, 0x448,
-0x442, 0x4e9, 0x43d, 0x20, 0x43a, 0x438, 0x439, 0x438, 0x43d, 0x43a, 0x438, 0xc624, 0xd6c4, 0x5a, 0x2e, 0x4d, 0x57, 0x2e, 0xeab, 0xebc,
-0xeb1, 0xe87, 0xe97, 0xec8, 0xebd, 0xe87, 0x70, 0x113, 0x63, 0x70, 0x75, 0x73, 0x64, 0x69, 0x65, 0x6e, 0x101, 0x6d, 0x70, 0xf3,
-0x6b, 0x77, 0x61, 0x70, 0x6f, 0x70, 0x69, 0x65, 0x74, 0x43f, 0x43e, 0x43f, 0x43b, 0x430, 0x434, 0x43d, 0x435, 0x50, 0x54, 0x47,
-0x92e, 0x2e, 0x909, 0x2e, 0x4af, 0x2e, 0x445, 0x2e, 0x905, 0x92a, 0x930, 0x93e, 0x939, 0x94d, 0x928, 0x63a, 0x2e, 0x648, 0x2e, 0x628,
-0x639, 0x62f, 0x627, 0x632, 0x638, 0x647, 0x631, 0x64, 0x61, 0x20, 0x74, 0x61, 0x72, 0x64, 0x65, 0xa2c, 0xa3e, 0x2e, 0xa26, 0xa41,
-0x2e, 0x4c, 0x4b, 0x43f, 0x43e, 0x20, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x70, 0x6f, 0x20, 0x70, 0x6f, 0x64, 0x6e, 0x65, 0x4d5,
-0x43c, 0x431, 0x438, 0x441, 0x431, 0x43e, 0x43d, 0x44b, 0x20, 0x444, 0x4d5, 0x441, 0x442, 0x4d5, 0x645, 0x646, 0x62c, 0x647, 0x646, 0x62f,
-0x60c, 0x20, 0x634, 0x627, 0x645, 0xdb4, 0x2e, 0xdc0, 0x2e, 0x70, 0x6f, 0x70, 0x2e, 0x47, 0x44, 0x65, 0x6d, 0x43f, 0x430, 0x2e,
-0xa0, 0x447, 0x43e, 0x2e, 0xbaa, 0xbbf, 0xbb1, 0xbcd, 0xbaa, 0xb95, 0xbb2, 0xbcd, 0xe2b, 0xe25, 0xe31, 0xe07, 0xe40, 0xe17, 0xe35, 0xe48,
-0xe22, 0xe07, 0xf55, 0xfb1, 0xf72, 0xf0b, 0xf51, 0xfb2, 0xf7c, 0xf0b, 0x12f5, 0x1215, 0x122d, 0x20, 0x1230, 0x12d3, 0x1275, 0x65, 0x66, 0x69,
-0x61, 0x66, 0x69, 0xd6, 0x53, 0x67, 0xfc, 0x6e, 0x6f, 0x72, 0x74, 0x61, 0x64, 0x61, 0x6e, 0x20, 0x73, 0x6f, 0x148, 0x686,
-0x6c8, 0x634, 0x62a, 0x649, 0x646, 0x20, 0x643, 0x6d0, 0x64a, 0x649, 0x646, 0x43f, 0x43f, 0x54, 0x4b, 0x422, 0x41a, 0x43, 0x48, 0x79,
-0x68, 0x4e, 0x67, 0x6f, 0x5e0, 0x5d0, 0x5b8, 0x5db, 0x5de, 0x5d9, 0x5d8, 0x5d0, 0x5b8, 0x5d2, 0x1ecc, 0x300, 0x73, 0xe1, 0x6e, 0x186,
-0x300, 0x73, 0xe1, 0x6e, 0x65, 0x74, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x64, 0x64, 0x61, 0x67, 0x70, 0x6f, 0x70, 0x6f, 0x64,
-0x6e, 0x65, 0x43f, 0x43e, 0x43f, 0x43e, 0x434, 0x43d, 0x435, 0x45, 0x57, 0x92e, 0x2e, 0x928, 0x902, 0x2e, 0x4e, 0x2019, 0x61, 0x62,
-0x61, 0x6c, 0x69, 0x128, 0x79, 0x61, 0x77, 0x129, 0x6f, 0x6f, 0x70, 0x2e, 0x263, 0x65, 0x74, 0x72, 0x254, 0x61, 0x6d, 0x20,
-0x4e, 0x61, 0x6d, 0x69, 0x74, 0x74, 0x61, 0x67, 0xa06f, 0xa2d2, 0x65, 0x61, 0x68, 0x6b, 0x65, 0x74, 0x62, 0x65, 0x61, 0x69,
-0x76, 0x65, 0x74, 0x65, 0x62, 0x4d, 0x6f, 0x67, 0x6c, 0x75, 0x6d, 0x61, 0x20, 0x6c, 0x77, 0x61, 0x20, 0x70, 0x6b, 0x69,
-0x6b, 0x69, 0x69, 0x257, 0x65, 0x48, 0x77, 0x61, 0x129, 0x2d, 0x69, 0x6e, 0x129, 0x54, 0x65, 0x69, 0x70, 0x61, 0x6b, 0x69,
-0x6e, 0x67, 0x6f, 0x74, 0x6f, 0x2d5c, 0x2d30, 0x2d37, 0x2d33, 0x2d33, 0x2d6f, 0x2d30, 0x2d5c, 0x74, 0x61, 0x64, 0x67, 0x67, 0x2b7, 0x61,
-0x74, 0x6e, 0x20, 0x74, 0x6d, 0x65, 0x64, 0x64, 0x69, 0x74, 0x70, 0x61, 0x6d, 0x75, 0x6e, 0x79, 0x69, 0x6b, 0x79, 0x69,
-0x75, 0x6b, 0x6f, 0x6e, 0x79, 0x69, 0x55, 0x54, 0x13d2, 0x13af, 0x13f1, 0x13a2, 0x13d7, 0x13e2, 0x43, 0x68, 0x69, 0x6c, 0x6f, 0x4d,
-0x55, 0x55, 0x61, 0x6b, 0x61, 0x73, 0x75, 0x62, 0x61, 0x168, 0x47, 0x6b, 0x6f, 0x6f, 0x73, 0x6b, 0x6f, 0x6c, 0x69, 0x6e,
-0x79, 0x1c3, 0x75, 0x69, 0x61, 0x73, 0x55, 0x68, 0x72, 0x20, 0x6e, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x61, 0x63,
-0x68, 0x73, 0x190, 0x6e, 0x64, 0xe1, 0x6d, 0xe2, 0x45, 0x69, 0x67, 0x75, 0x6c, 0x6f, 0x69, 0x63, 0x68, 0x61, 0x6d, 0x74,
-0x68, 0x69, 0x45, 0x62, 0x6f, 0x6e, 0x67, 0x69, 0x41, 0x6c, 0x75, 0x75, 0x6c, 0x61, 0x4f, 0x54, 0x1e0c, 0x65, 0x66, 0x66,
-0x69, 0x72, 0x20, 0x61, 0x7a, 0x61, 0x6e, 0x79, 0x69, 0x61, 0x67, 0x68, 0x75, 0x6f, 0x92c, 0x947, 0x932, 0x93e, 0x938, 0x947,
-0x44, 0x69, 0x6c, 0x6f, 0x6c, 0x6f, 0x6e, 0x6f, 0x6d, 0xeb, 0x74, 0x74, 0x65, 0x73, 0x61, 0x2e, 0x6b, 0x49, 0x20, 0x253,
-0x75, 0x67, 0x61, 0x6a, 0x254, 0x70, 0x5a, 0x61, 0x61, 0x72, 0x69, 0x6b, 0x61, 0x79, 0x20, 0x62, 0x65, 0x62, 0x79, 0xe1,
-0x6d, 0x75, 0x6e, 0x67, 0x259, 0x67, 0xf3, 0x67, 0x259, 0x6c, 0x65, 0x63, 0x25b, 0x25b, 0x301, 0x6e, 0x6b, 0x6f, 0x6d, 0x63,
-0x68, 0x6f, 0x63, 0x68, 0x69, 0x6c, 0x2019, 0x6c, 0x6c, 0x69, 0x6c, 0x6c, 0x69, 0x6b, 0x75, 0x67, 0xfa, 0x54, 0x14a, 0x42d,
-0x41a, 0x50, 0x61, 0x73, 0x68, 0x61, 0x6d, 0x69, 0x68, 0x65, 0x6b, 0x69, 0x73, 0x25b, 0x301, 0x6e, 0x64, 0x25b, 0x64, 0x65,
-0x20, 0x6c, 0x61, 0x20, 0x74, 0x61, 0x72, 0x64, 0x65, 0x14b, 0x6b, 0x61, 0x20, 0x6d, 0x62, 0x254, 0x301, 0x74, 0x20, 0x6e,
-0x6a, 0x69, 0x6e, 0x63, 0x77, 0xf2, 0x6e, 0x7a, 0xe9, 0x6d, 0x62f, 0x2e, 0x646, 0x77, 0xf3, 0x74, 0x70, 0x6f, 0x142, 0x64,
-0x6e, 0x6a, 0x61, 0x70, 0x6f, 0x70, 0x6f, 0x142, 0x64, 0x6e, 0x6a, 0x75, 0x65, 0x70, 0x2e
-};
-
-static const ushort currency_symbol_data[] = {
-0x42, 0x72, 0x4b, 0x73, 0x68, 0x52, 0x24, 0x4c, 0x65, 0x6b, 0xeb, 0x64, 0x65, 0x6e, 0x20ac, 0x1265, 0x122d, 0x62c, 0x2e, 0x645,
-0x2e, 0x200f, 0x62f, 0x2e, 0x62c, 0x2e, 0x200f, 0x62f, 0x2e, 0x628, 0x2e, 0x200f, 0x46, 0x43, 0x46, 0x41, 0x43, 0x46, 0x46, 0x64,
-0x6a, 0x4e, 0x66, 0x6b, 0x62f, 0x2e, 0x639, 0x2e, 0x200f, 0x20aa, 0x62f, 0x2e, 0x623, 0x2e, 0x200f, 0x62f, 0x2e, 0x643, 0x2e, 0x200f,
-0x644, 0x2e, 0x644, 0x2e, 0x200f, 0x62f, 0x2e, 0x644, 0x2e, 0x200f, 0x623, 0x2e, 0x645, 0x2e, 0x62f, 0x2e, 0x645, 0x2e, 0x200f, 0x631,
-0x2e, 0x639, 0x2e, 0x200f, 0x631, 0x2e, 0x642, 0x2e, 0x200f, 0x631, 0x2e, 0x633, 0x2e, 0x200f, 0x53, 0x62c, 0x2e, 0x633, 0x2e, 0x644,
-0x2e, 0x633, 0x2e, 0x200f, 0x62f, 0x2e, 0x62a, 0x2e, 0x200f, 0x62f, 0x2e, 0x625, 0x2e, 0x200f, 0x631, 0x2e, 0x64a, 0x2e, 0x200f, 0xa3,
-0x58f, 0x20b9, 0x20bc, 0x20bd, 0x9f3, 0x4e, 0x75, 0x2e, 0x43b, 0x432, 0x2e, 0x4b, 0x17db, 0xffe5, 0x4d, 0x4f, 0x50, 0x24, 0x6b, 0x6e,
-0x4b, 0x4d, 0x4b, 0x10d, 0x6b, 0x72, 0x2e, 0x41, 0x66, 0x6c, 0x2e, 0x4e, 0x41, 0x66, 0x2e, 0x55, 0x53, 0x24, 0x50, 0x46,
-0x42, 0x75, 0x44, 0x47, 0x48, 0x20b5, 0x48, 0x4b, 0x24, 0x41, 0x72, 0x4d, 0x4b, 0x52, 0x4d, 0x52, 0x73, 0x20a6, 0x20b1, 0x52,
-0x46, 0x57, 0x53, 0x24, 0x53, 0x52, 0x4c, 0x65, 0x45, 0x6b, 0x72, 0x54, 0x53, 0x68, 0x54, 0x24, 0x55, 0x53, 0x68, 0x41,
-0x45, 0x44, 0x56, 0x54, 0x44, 0x41, 0x43, 0x46, 0x41, 0x46, 0x43, 0x46, 0x43, 0x46, 0x50, 0x46, 0x47, 0x47, 0x55, 0x4d,
-0x4c, 0x53, 0x44, 0x54, 0x20be, 0x43, 0x48, 0x46, 0x20b2, 0x46, 0x74, 0x52, 0x70, 0x43, 0x41, 0x24, 0x20b8, 0x441, 0x43e, 0x43c,
-0x20a9, 0x20ba, 0x20ad, 0x4b, 0x7a, 0x434, 0x435, 0x43d, 0x20ae, 0x43, 0x4e, 0xa5, 0x928, 0x947, 0x930, 0x942, 0x60b, 0x631, 0x6cc, 0x627,
-0x644, 0x7a, 0x142, 0x52, 0x24, 0x200b, 0x4d, 0x54, 0x6e, 0x44, 0x62, 0x631, 0x53, 0x2f, 0x42, 0x73, 0x6c, 0x65, 0x69, 0x4c,
-0x20b4, 0x41a, 0x41c, 0xdbb, 0xdd4, 0x2e, 0x20a1, 0x52, 0x44, 0x24, 0x51, 0x43, 0x24, 0x42, 0x2f, 0x2e, 0x47, 0x73, 0x2e, 0x42,
-0x73, 0x2e, 0x53, 0x441, 0x43e, 0x43c, 0x2e, 0x52, 0x73, 0x2e, 0xe3f, 0xa5, 0x54, 0x4d, 0x54, 0x73, 0x6f, 0x2bb, 0x6d, 0x441,
-0x45e, 0x43c, 0x20ab, 0x4e, 0x54, 0x24, 0x41, 0x24, 0x49, 0x52, 0x52
-};
-
-static const ushort currency_display_name_data[] = {
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x74, 0x6f, 0x6f, 0x70, 0x68, 0x69, 0x79, 0x61, 0x61, 0x20, 0x42, 0x69,
-0x72, 0x72, 0x69, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66, 0x72, 0x69,
-0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66,
-0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x69,
-0x64, 0x2d, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x4e, 0x61,
-0x6d, 0x69, 0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69,
-0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69,
-0x62, 0x69, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x4c, 0x65, 0x6b, 0x75, 0x20, 0x73, 0x68,
-0x71, 0x69, 0x70, 0x74, 0x61, 0x72, 0x3b, 0x3b, 0x6c, 0x65, 0x6b, 0x20, 0x73, 0x68, 0x71, 0x69, 0x70, 0x74, 0x61, 0x72,
-0x3b, 0x3b, 0x3b, 0x3b, 0x6c, 0x65, 0x6b, 0xeb, 0x20, 0x73, 0x68, 0x71, 0x69, 0x70, 0x74, 0x61, 0x72, 0x3b, 0x44, 0x65,
-0x6e, 0x61, 0x72, 0x69, 0x20, 0x6d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x61, 0x73, 0x3b, 0x3b, 0x64, 0x65, 0x6e, 0x61,
-0x72, 0x20, 0x6d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x61, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x65, 0x6e, 0x61, 0x72,
-0xeb, 0x20, 0x6d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x61, 0x73, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x6a, 0x61, 0x3b, 0x3b,
-0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x12e8, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x20,
-0x1265, 0x122d, 0x3b, 0x3b, 0x12e8, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x20, 0x1265, 0x122d, 0x3b, 0x3b, 0x3b, 0x3b, 0x12e8, 0x12a2, 0x1275,
-0x12ee, 0x1335, 0x12eb, 0x20, 0x1265, 0x122d, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62c, 0x646, 0x64a,
-0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62c, 0x646, 0x64a,
-0x647, 0x627, 0x646, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x627, 0x62a, 0x20, 0x645, 0x635,
-0x631, 0x64a, 0x629, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x64b, 0x627, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x64b, 0x627, 0x3b, 0x62c, 0x646,
-0x64a, 0x647, 0x20, 0x645, 0x635, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a,
-0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
-0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x646, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631,
-0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x629, 0x3b,
-0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x64b, 0x627, 0x3b, 0x62f, 0x64a, 0x646,
-0x627, 0x631, 0x20, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a,
-0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627,
-0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646,
-0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631,
-0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x628, 0x62d, 0x631, 0x64a, 0x646, 0x64a,
-0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646,
-0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633,
-0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641,
-0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a,
-0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646,
-0x643, 0x20, 0x648, 0x633, 0x637, 0x20, 0x623, 0x641, 0x631, 0x64a, 0x642, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632,
-0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642,
-0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631,
-0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632,
-0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642,
-0x645, 0x631, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x3b, 0x641, 0x631,
-0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a,
-0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c,
-0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631,
-0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a, 0x3b, 0x641, 0x631, 0x646, 0x643, 0x20, 0x62c, 0x64a, 0x628, 0x648, 0x62a,
-0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627,
-0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a,
-0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20,
-0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b,
-0x646, 0x627, 0x643, 0x641, 0x627, 0x20, 0x623, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639,
-0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646,
-0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a,
-0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639,
-0x631, 0x627, 0x642, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x639, 0x631, 0x627, 0x642, 0x64a, 0x3b, 0x634, 0x64a, 0x643,
-0x644, 0x20, 0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644,
-0x20, 0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20,
-0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625,
-0x633, 0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625, 0x633,
-0x631, 0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625, 0x633, 0x631,
-0x627, 0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x634, 0x64a, 0x643, 0x644, 0x20, 0x625, 0x633, 0x631, 0x627,
-0x626, 0x64a, 0x644, 0x64a, 0x20, 0x62c, 0x62f, 0x64a, 0x62f, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646,
-0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
-0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a,
-0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646,
-0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x623, 0x631, 0x62f, 0x646, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
-0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a,
-0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a,
-0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20,
-0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x643, 0x648, 0x64a, 0x62a, 0x64a, 0x3b, 0x62c, 0x646,
-0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646,
-0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644,
-0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646,
-0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x644, 0x628, 0x646, 0x627, 0x646,
-0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x644,
-0x64a, 0x628, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631,
-0x627, 0x646, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x644, 0x64a,
-0x628, 0x64a, 0x629, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x64b, 0x627, 0x3b, 0x62f,
-0x64a, 0x646, 0x627, 0x631, 0x20, 0x644, 0x64a, 0x628, 0x64a, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a,
-0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a,
-0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648,
-0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20,
-0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a,
-0x62a, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x623, 0x648, 0x642, 0x64a, 0x629, 0x20, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a,
-0x629, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x645, 0x63a,
-0x631, 0x628, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x627,
-0x646, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x631, 0x627, 0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628,
-0x64a, 0x629, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x64b, 0x627, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x64b, 0x627, 0x3b, 0x62f, 0x631,
-0x647, 0x645, 0x20, 0x645, 0x63a, 0x631, 0x628, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b,
-0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646,
-0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645,
-0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20,
-0x639, 0x645, 0x627, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
-0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
-0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
-0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x642, 0x637, 0x631, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644,
-0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a,
-0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b,
-0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f,
-0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645,
-0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635,
-0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646,
-0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634, 0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x634,
-0x644, 0x646, 0x20, 0x635, 0x648, 0x645, 0x627, 0x644, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646,
-0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633,
-0x648, 0x62f, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x3b, 0x62c, 0x646,
-0x64a, 0x647, 0x627, 0x62a, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x629, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x64b, 0x627, 0x20,
-0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a, 0x64b, 0x627, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x64a,
-0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631,
-0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633,
-0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629,
-0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x644, 0x64a, 0x631, 0x629, 0x20, 0x633, 0x648, 0x631, 0x64a, 0x629, 0x3b, 0x62f, 0x64a,
-0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633,
-0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627,
-0x646, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x627, 0x646, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x62a, 0x648,
-0x646, 0x633, 0x64a, 0x629, 0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x64b, 0x627, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x64b, 0x627,
-0x3b, 0x62f, 0x64a, 0x646, 0x627, 0x631, 0x20, 0x62a, 0x648, 0x646, 0x633, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645,
-0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f,
-0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627,
-0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631,
-0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x64a, 0x3b, 0x62f, 0x631, 0x647, 0x645, 0x20, 0x625, 0x645, 0x627, 0x631,
-0x627, 0x62a, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a,
-0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a,
-0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a,
-0x645, 0x646, 0x64a, 0x3b, 0x631, 0x64a, 0x627, 0x644, 0x20, 0x64a, 0x645, 0x646, 0x64a, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c,
-0x646, 0x648, 0x628, 0x20, 0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c, 0x646, 0x648,
-0x628, 0x20, 0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
-0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x627, 0x646, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
-0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x627, 0x62a, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
-0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x64b, 0x627, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20,
-0x627, 0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x62c, 0x646, 0x64a, 0x647, 0x20, 0x62c, 0x646, 0x648, 0x628, 0x20, 0x627, 0x644,
-0x633, 0x648, 0x62f, 0x627, 0x646, 0x3b, 0x570, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b,
-0x3b, 0x570, 0x561, 0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b, 0x3b, 0x3b, 0x3b, 0x570, 0x561,
-0x575, 0x56f, 0x561, 0x56f, 0x561, 0x576, 0x20, 0x564, 0x580, 0x561, 0x574, 0x3b, 0x9ad, 0x9be, 0x9f0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20,
-0x9f0, 0x9c1, 0x9aa, 0x9c0, 0x3b, 0x3b, 0x9ad, 0x9be, 0x9f0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9f0, 0x9c1, 0x9aa, 0x9c0, 0x3b, 0x3b,
-0x3b, 0x3b, 0x9ad, 0x9be, 0x9f0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9f0, 0x9c1, 0x9aa, 0x9c0, 0x3b, 0x41, 0x7a, 0x259, 0x72, 0x62,
-0x61, 0x79, 0x63, 0x61, 0x6e, 0x20, 0x4d, 0x61, 0x6e, 0x61, 0x74, 0x131, 0x3b, 0x3b, 0x41, 0x7a, 0x259, 0x72, 0x62, 0x61,
-0x79, 0x63, 0x61, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x74, 0x131, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x7a, 0x259, 0x72, 0x62,
-0x61, 0x79, 0x63, 0x61, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x74, 0x131, 0x3b, 0x43c, 0x430, 0x43d, 0x430, 0x442, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x61, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
-0x65, 0x75, 0x72, 0x6f, 0x3b, 0x9ac, 0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9c0, 0x20, 0x99f, 0x9be, 0x995, 0x9be, 0x3b,
-0x3b, 0x9ac, 0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9c0, 0x20, 0x99f, 0x9be, 0x995, 0x9be, 0x3b, 0x3b, 0x3b, 0x3b, 0x9ac,
-0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9c0, 0x20, 0x99f, 0x9be, 0x995, 0x9be, 0x3b, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0x9c0, 0x9af,
-0x9bc, 0x20, 0x9b0, 0x9c1, 0x9aa, 0x9bf, 0x3b, 0x3b, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9b0, 0x9c1, 0x9aa, 0x9bf,
-0x3b, 0x3b, 0x3b, 0x3b, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0x9c0, 0x9af, 0x9bc, 0x20, 0x9b0, 0x9c1, 0x9aa, 0x9bf, 0x3b, 0xf51, 0xf44, 0xf74,
-0xf63, 0xf0b, 0xf40, 0xfb2, 0xf58, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75,
-0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x61, 0x20, 0x65, 0x75, 0x72, 0x6f, 0x69,
-0x6f, 0xf9, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x411, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x20, 0x43b, 0x435,
-0x432, 0x3b, 0x3b, 0x431, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x20, 0x43b, 0x435, 0x432, 0x3b, 0x3b, 0x3b, 0x3b,
-0x431, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x20, 0x43b, 0x435, 0x432, 0x430, 0x3b, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019,
-0x102c, 0x20, 0x1000, 0x103b, 0x1015, 0x103a, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019, 0x102c, 0x20, 0x1000,
-0x103b, 0x1015, 0x103a, 0x3b, 0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x20, 0x440, 0x443, 0x431, 0x435, 0x43b, 0x44c,
-0x3b, 0x3b, 0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x20, 0x440, 0x443, 0x431, 0x435, 0x43b, 0x44c, 0x3b, 0x3b,
-0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x44f, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x456, 0x3b, 0x431, 0x435, 0x43b,
-0x430, 0x440, 0x443, 0x441, 0x43a, 0x456, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x451, 0x45e, 0x3b, 0x431, 0x435, 0x43b, 0x430, 0x440,
-0x443, 0x441, 0x43a, 0x430, 0x433, 0x430, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x179a, 0x17c0, 0x179b, 0x200b, 0x1780, 0x1798, 0x17d2,
-0x1796, 0x17bb, 0x1787, 0x17b6, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x179a, 0x17c0, 0x179b, 0x200b, 0x1780, 0x1798, 0x17d2, 0x1796, 0x17bb, 0x1787,
-0x17b6, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f,
-0x73, 0x3b, 0x4eba, 0x6c11, 0x5e01, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4eba, 0x6c11, 0x5e01, 0x3b, 0x6e2f, 0x5143, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x6e2f, 0x5143, 0x3b, 0x6fb3, 0x95e8, 0x5e01, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x6fb3, 0x95e8, 0x5143, 0x3b, 0x65b0,
-0x52a0, 0x5761, 0x5143, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65b0, 0x52a0, 0x5761, 0x5143, 0x3b, 0x6fb3, 0x9580, 0x5143, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x6fb3, 0x9580, 0x5143, 0x3b, 0x65b0, 0x53f0, 0x5e63, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65b0, 0x53f0, 0x5e63, 0x3b,
-0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x61, 0x20, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x68, 0x72, 0x76, 0x61, 0x74,
-0x73, 0x6b, 0x61, 0x20, 0x6b, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x65, 0x20, 0x6b,
-0x75, 0x6e, 0x65, 0x3b, 0x3b, 0x68, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x69, 0x68, 0x20, 0x6b, 0x75, 0x6e, 0x61, 0x3b,
-0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b,
-0x3b, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61,
-0x3b, 0x3b, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b,
-0x65, 0x3b, 0x3b, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x69, 0x68, 0x20, 0x6d, 0x61,
-0x72, 0x61, 0x6b, 0x61, 0x3b, 0x10d, 0x65, 0x73, 0x6b, 0xe1, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x10d,
-0x65, 0x73, 0x6b, 0xe1, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x61, 0x3b, 0x3b, 0x10d, 0x65, 0x73, 0x6b, 0xe9, 0x20, 0x6b,
-0x6f, 0x72, 0x75, 0x6e, 0x79, 0x3b, 0x10d, 0x65, 0x73, 0x6b, 0xe9, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x79, 0x3b, 0x10d,
-0x65, 0x73, 0x6b, 0xfd, 0x63, 0x68, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x6e, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x20, 0x6b,
-0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b,
-0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x65, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b,
-0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x41, 0x72, 0x75, 0x62, 0x61, 0x61,
-0x6e, 0x73, 0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x3b, 0x41, 0x72, 0x75, 0x62, 0x61, 0x61, 0x6e, 0x73,
-0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x72, 0x75, 0x62, 0x61, 0x61, 0x6e, 0x73,
-0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x2d,
-0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b,
-0x3b, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x2d, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x69, 0x61,
-0x61, 0x6e, 0x73, 0x65, 0x20, 0x67, 0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x65, 0x64, 0x65, 0x72,
-0x6c, 0x61, 0x6e, 0x64, 0x73, 0x2d, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x67,
-0x75, 0x6c, 0x64, 0x65, 0x6e, 0x3b, 0x53, 0x75, 0x72, 0x69, 0x6e, 0x61, 0x61, 0x6d, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c,
-0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x53, 0x75, 0x72, 0x69, 0x6e, 0x61, 0x61, 0x6d, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x72, 0x69, 0x6e, 0x61, 0x61, 0x6d, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c,
-0x6c, 0x61, 0x72, 0x3b, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x3b, 0x3b, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x65, 0x20, 0x64, 0x6f,
-0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x55, 0x53, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x64,
-0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b,
-0x45, 0x61, 0x73, 0x74, 0x20, 0x43, 0x61, 0x72, 0x69, 0x62, 0x62, 0x65, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
-0x72, 0x3b, 0x3b, 0x45, 0x61, 0x73, 0x74, 0x20, 0x43, 0x61, 0x72, 0x69, 0x62, 0x62, 0x65, 0x61, 0x6e, 0x20, 0x64, 0x6f,
-0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x61, 0x73, 0x74, 0x20, 0x43, 0x61, 0x72, 0x69, 0x62, 0x62, 0x65,
-0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
-0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x6e,
-0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
-0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f,
-0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x73, 0x3b, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x61, 0x6e, 0x20, 0x44,
-0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61,
-0x72, 0x73, 0x3b, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b,
-0x3b, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b,
-0x3b, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x42,
-0x65, 0x6c, 0x69, 0x7a, 0x65, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65,
-0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x20, 0x64, 0x6f,
-0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
-0x72, 0x3b, 0x3b, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b,
-0x3b, 0x3b, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x42,
-0x6f, 0x74, 0x73, 0x77, 0x61, 0x6e, 0x61, 0x6e, 0x20, 0x50, 0x75, 0x6c, 0x61, 0x3b, 0x3b, 0x42, 0x6f, 0x74, 0x73, 0x77,
-0x61, 0x6e, 0x61, 0x6e, 0x20, 0x70, 0x75, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x6f, 0x74, 0x73, 0x77, 0x61, 0x6e,
-0x61, 0x6e, 0x20, 0x70, 0x75, 0x6c, 0x61, 0x73, 0x3b, 0x42, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x46,
-0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x42, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x66, 0x72, 0x61, 0x6e,
-0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63,
-0x73, 0x3b, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72,
-0x69, 0x63, 0x61, 0x6e, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x65,
-0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72,
-0x61, 0x6e, 0x63, 0x73, 0x3b, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72,
-0x3b, 0x3b, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b,
-0x3b, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x43, 0x61,
-0x79, 0x6d, 0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b,
-0x3b, 0x43, 0x61, 0x79, 0x6d, 0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x61, 0x79, 0x6d, 0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73,
-0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61, 0x6e, 0x64,
-0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61, 0x6e, 0x64,
-0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61,
-0x6e, 0x64, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x44, 0x61, 0x6e, 0x69, 0x73, 0x68, 0x20, 0x4b, 0x72,
-0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x44, 0x61, 0x6e, 0x69, 0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b,
-0x3b, 0x44, 0x61, 0x6e, 0x69, 0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x45, 0x72, 0x69, 0x74, 0x72,
-0x65, 0x61, 0x6e, 0x20, 0x4e, 0x61, 0x6b, 0x66, 0x61, 0x3b, 0x3b, 0x45, 0x72, 0x69, 0x74, 0x72, 0x65, 0x61, 0x6e, 0x20,
-0x6e, 0x61, 0x6b, 0x66, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x72, 0x69, 0x74, 0x72, 0x65, 0x61, 0x6e, 0x20, 0x6e, 0x61,
-0x6b, 0x66, 0x61, 0x73, 0x3b, 0x46, 0x61, 0x6c, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64,
-0x73, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x46, 0x61, 0x6c, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x49, 0x73,
-0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x61, 0x6c, 0x6b, 0x6c,
-0x61, 0x6e, 0x64, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x46,
-0x69, 0x6a, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x46, 0x69, 0x6a, 0x69, 0x61, 0x6e,
-0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x69, 0x6a, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f,
-0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x55, 0x4b, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x55, 0x4b, 0x20, 0x70,
-0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x4b, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x47, 0x61,
-0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x3b, 0x3b, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x61,
-0x6e, 0x20, 0x64, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20,
-0x64, 0x61, 0x6c, 0x61, 0x73, 0x69, 0x73, 0x3b, 0x47, 0x68, 0x61, 0x6e, 0x61, 0x69, 0x61, 0x6e, 0x20, 0x43, 0x65, 0x64,
-0x69, 0x3b, 0x3b, 0x47, 0x68, 0x61, 0x6e, 0x61, 0x69, 0x61, 0x6e, 0x20, 0x63, 0x65, 0x64, 0x69, 0x3b, 0x3b, 0x3b, 0x3b,
-0x47, 0x68, 0x61, 0x6e, 0x61, 0x69, 0x61, 0x6e, 0x20, 0x63, 0x65, 0x64, 0x69, 0x73, 0x3b, 0x47, 0x69, 0x62, 0x72, 0x61,
-0x6c, 0x74, 0x61, 0x72, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61,
-0x72, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61, 0x72,
-0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x65, 0x73, 0x65, 0x20, 0x44, 0x6f,
-0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x73, 0x3b, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72,
-0x3b, 0x3b, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b,
-0x3b, 0x3b, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b,
-0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x52, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e,
-0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x75, 0x70,
-0x65, 0x65, 0x73, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x53, 0x68, 0x65, 0x6b,
-0x65, 0x6c, 0x3b, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x68, 0x65, 0x6b,
-0x65, 0x6c, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x69, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x68,
-0x65, 0x6b, 0x65, 0x6c, 0x73, 0x3b, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
-0x72, 0x3b, 0x3b, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b,
-0x3b, 0x3b, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4b,
-0x65, 0x6e, 0x79, 0x61, 0x6e, 0x20, 0x53, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x4b, 0x65, 0x6e, 0x79,
-0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x3b, 0x3b, 0x4b, 0x65, 0x6e, 0x79, 0x61,
-0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66,
-0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66,
-0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20,
-0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x3b, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61,
-0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x64,
-0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f,
-0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4d, 0x61, 0x63, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x50, 0x61, 0x74, 0x61, 0x63,
-0x61, 0x3b, 0x3b, 0x4d, 0x61, 0x63, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x61, 0x74, 0x61, 0x63, 0x61, 0x3b, 0x3b,
-0x3b, 0x3b, 0x4d, 0x61, 0x63, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x61, 0x74, 0x61, 0x63, 0x61, 0x73, 0x3b, 0x4d,
-0x61, 0x6c, 0x61, 0x67, 0x61, 0x73, 0x79, 0x20, 0x41, 0x72, 0x69, 0x61, 0x72, 0x79, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61,
-0x67, 0x61, 0x73, 0x79, 0x20, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x67,
-0x61, 0x73, 0x79, 0x20, 0x61, 0x72, 0x69, 0x61, 0x72, 0x69, 0x65, 0x73, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x61,
-0x6e, 0x20, 0x4b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x61, 0x6e, 0x20, 0x6b,
-0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x61, 0x6e, 0x20, 0x6b, 0x77,
-0x61, 0x63, 0x68, 0x61, 0x73, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x52, 0x69, 0x6e, 0x67,
-0x67, 0x69, 0x74, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x69, 0x6e, 0x67, 0x67,
-0x69, 0x74, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x69, 0x6e, 0x67,
-0x67, 0x69, 0x74, 0x73, 0x3b, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x52, 0x75, 0x70, 0x65, 0x65,
-0x3b, 0x3b, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b,
-0x3b, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x61, 0x6e, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x73, 0x3b, 0x4e, 0x61,
-0x6d, 0x69, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69, 0x62,
-0x69, 0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69,
-0x61, 0x6e, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20,
-0x4e, 0x61, 0x69, 0x72, 0x61, 0x3b, 0x3b, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x6e, 0x61, 0x69, 0x72,
-0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x6e, 0x61, 0x69, 0x72, 0x61, 0x73,
-0x3b, 0x50, 0x61, 0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x69, 0x20, 0x52, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x50, 0x61,
-0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x69, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x6b,
-0x69, 0x73, 0x74, 0x61, 0x6e, 0x69, 0x20, 0x72, 0x75, 0x70, 0x65, 0x65, 0x73, 0x3b, 0x50, 0x61, 0x70, 0x75, 0x61, 0x20,
-0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x6e, 0x20, 0x4b, 0x69, 0x6e, 0x61, 0x3b, 0x3b, 0x50, 0x61,
-0x70, 0x75, 0x61, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x6e, 0x20, 0x6b, 0x69, 0x6e, 0x61,
-0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x70, 0x75, 0x61, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61,
-0x6e, 0x20, 0x6b, 0x69, 0x6e, 0x61, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x50, 0x69,
-0x73, 0x6f, 0x3b, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x69, 0x73, 0x6f, 0x3b,
-0x3b, 0x3b, 0x3b, 0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x20, 0x70, 0x69, 0x73, 0x6f, 0x73, 0x3b,
-0x52, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x52, 0x77, 0x61, 0x6e, 0x64,
-0x61, 0x6e, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20,
-0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x3b, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x6e, 0x20, 0x54, 0x61, 0x6c, 0x61, 0x3b, 0x3b,
-0x53, 0x61, 0x6d, 0x6f, 0x61, 0x6e, 0x20, 0x74, 0x61, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x61, 0x6d, 0x6f, 0x61,
-0x6e, 0x20, 0x74, 0x61, 0x6c, 0x61, 0x3b, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x69, 0x73, 0x20, 0x52,
-0x75, 0x70, 0x65, 0x65, 0x3b, 0x3b, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x69, 0x73, 0x20, 0x72, 0x75,
-0x70, 0x65, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x69, 0x73, 0x20, 0x72,
-0x75, 0x70, 0x65, 0x65, 0x73, 0x3b, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65, 0x61, 0x6e,
-0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c, 0x65, 0x6f, 0x6e, 0x65,
-0x61, 0x6e, 0x20, 0x6c, 0x65, 0x6f, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c,
-0x65, 0x6f, 0x6e, 0x65, 0x61, 0x6e, 0x20, 0x6c, 0x65, 0x6f, 0x6e, 0x65, 0x73, 0x3b, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70,
-0x6f, 0x72, 0x65, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72,
-0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72,
-0x65, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x73, 0x3b, 0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x49, 0x73,
-0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f,
-0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b,
-0x53, 0x6f, 0x6c, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x73, 0x3b, 0x53, 0x74, 0x2e, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64,
-0x3b, 0x3b, 0x53, 0x74, 0x2e, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b,
-0x3b, 0x3b, 0x53, 0x74, 0x2e, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b,
-0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x75, 0x64, 0x61,
-0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x65,
-0x73, 0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x20, 0x4c, 0x69, 0x6c, 0x61,
-0x6e, 0x67, 0x65, 0x6e, 0x69, 0x3b, 0x3b, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x20, 0x6c, 0x69, 0x6c, 0x61, 0x6e, 0x67, 0x65,
-0x6e, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x77, 0x61, 0x7a, 0x69, 0x20, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x6e, 0x67, 0x65,
-0x6e, 0x69, 0x3b, 0x53, 0x77, 0x65, 0x64, 0x69, 0x73, 0x68, 0x20, 0x4b, 0x72, 0x6f, 0x6e, 0x61, 0x3b, 0x3b, 0x53, 0x77,
-0x65, 0x64, 0x69, 0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x77, 0x65, 0x64, 0x69,
-0x73, 0x68, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x6f, 0x72, 0x3b, 0x53, 0x77, 0x69, 0x73, 0x73, 0x20, 0x46, 0x72, 0x61, 0x6e,
-0x63, 0x3b, 0x3b, 0x53, 0x77, 0x69, 0x73, 0x73, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x77,
-0x69, 0x73, 0x73, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x3b, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x6e,
-0x20, 0x53, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x6e,
-0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69,
-0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x3b, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x20,
-0x50, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61, 0x3b, 0x3b, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x20, 0x70, 0x61, 0x2bb, 0x61,
-0x6e, 0x67, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x6e, 0x20, 0x70, 0x61, 0x2bb, 0x61, 0x6e, 0x67,
-0x61, 0x3b, 0x54, 0x72, 0x69, 0x6e, 0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x20,
-0x44, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x54, 0x72, 0x69, 0x6e, 0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54,
-0x6f, 0x62, 0x61, 0x67, 0x6f, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0x72, 0x69, 0x6e,
-0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61, 0x67, 0x6f, 0x20, 0x64, 0x6f, 0x6c, 0x6c, 0x61, 0x72,
-0x73, 0x3b, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20, 0x53, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b,
-0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x3b, 0x3b, 0x3b, 0x3b,
-0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x6e, 0x20, 0x73, 0x68, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x3b, 0x55, 0x6e,
-0x69, 0x74, 0x65, 0x64, 0x20, 0x41, 0x72, 0x61, 0x62, 0x20, 0x45, 0x6d, 0x69, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x44,
-0x69, 0x72, 0x68, 0x61, 0x6d, 0x3b, 0x3b, 0x55, 0x41, 0x45, 0x20, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x3b, 0x3b, 0x3b,
-0x3b, 0x55, 0x41, 0x45, 0x20, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x73, 0x3b, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68,
-0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x70, 0x6f, 0x75, 0x6e,
-0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x3b,
-0x56, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x20, 0x56, 0x61, 0x74, 0x75, 0x3b, 0x3b, 0x56, 0x61, 0x6e, 0x75, 0x61, 0x74,
-0x75, 0x20, 0x76, 0x61, 0x74, 0x75, 0x3b, 0x3b, 0x3b, 0x3b, 0x56, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x20, 0x76, 0x61,
-0x74, 0x75, 0x73, 0x3b, 0x5a, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x4b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b,
-0x5a, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x6b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x5a, 0x61,
-0x6d, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x6b, 0x77, 0x61, 0x63, 0x68, 0x61, 0x73, 0x3b, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20,
-0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x50, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x53, 0x6f, 0x75, 0x74,
-0x68, 0x20, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b,
-0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x65, 0x73, 0x65, 0x20, 0x70, 0x6f, 0x75, 0x6e, 0x64,
-0x73, 0x3b, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c,
-0x65, 0x61, 0x6e, 0x20, 0x47, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x3b, 0x3b, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6c,
-0x61, 0x6e, 0x64, 0x73, 0x20, 0x41, 0x6e, 0x74, 0x69, 0x6c, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x67, 0x75, 0x69, 0x6c, 0x64,
-0x65, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x41, 0x6e,
-0x74, 0x69, 0x6c, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x67, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x3b, 0x65, 0x75, 0x72,
-0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x74, 0x3b, 0x64, 0x6f, 0x6e,
-0x73, 0x6b, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x61, 0x3b, 0x3b, 0x64, 0x6f, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0xf3, 0x6e,
-0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x61, 0x72, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x75, 0x72, 0x3b,
-0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x61, 0x3b,
-0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x61, 0x6c, 0x67, 0xe9, 0x72, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x64, 0x69, 0x6e, 0x61,
-0x72, 0x20, 0x61, 0x6c, 0x67, 0xe9, 0x72, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x73,
-0x20, 0x61, 0x6c, 0x67, 0xe9, 0x72, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41,
-0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20,
-0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x62, 0x75, 0x72, 0x75,
-0x6e, 0x64, 0x61, 0x69, 0x73, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x61,
-0x69, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x61,
-0x69, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b,
-0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b,
-0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x64,
-0x6f, 0x6c, 0x6c, 0x61, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x64, 0x6f, 0x6c, 0x6c,
-0x61, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x6f, 0x6c, 0x6c, 0x61,
-0x72, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63,
-0x6f, 0x6d, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6d, 0x6f, 0x72,
-0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6f, 0x72, 0x69,
-0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x69, 0x73, 0x3b,
-0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x63, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x69, 0x73, 0x3b, 0x3b, 0x3b, 0x3b,
-0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x69, 0x73, 0x3b, 0x66, 0x72, 0x61,
-0x6e, 0x63, 0x20, 0x64, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63,
-0x20, 0x64, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63,
-0x73, 0x20, 0x64, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20,
-0x43, 0x46, 0x50, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x50, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72,
-0x61, 0x6e, 0x63, 0x73, 0x20, 0x43, 0x46, 0x50, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x67, 0x75, 0x69, 0x6e, 0xe9,
-0x65, 0x6e, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x67, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x6e, 0x3b, 0x3b, 0x3b,
-0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x67, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x6e, 0x73, 0x3b, 0x67, 0x6f, 0x75,
-0x72, 0x64, 0x65, 0x20, 0x68, 0x61, 0xef, 0x74, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x67, 0x6f, 0x75, 0x72, 0x64,
-0x65, 0x20, 0x68, 0x61, 0xef, 0x74, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x6f, 0x75, 0x72, 0x64,
-0x65, 0x73, 0x20, 0x68, 0x61, 0xef, 0x74, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x3b, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79,
-0x20, 0x6d, 0x61, 0x6c, 0x67, 0x61, 0x63, 0x68, 0x65, 0x3b, 0x3b, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x20, 0x6d, 0x61,
-0x6c, 0x67, 0x61, 0x63, 0x68, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x61, 0x72, 0x69, 0x61, 0x72, 0x79, 0x73, 0x20, 0x6d, 0x61,
-0x6c, 0x67, 0x61, 0x63, 0x68, 0x65, 0x73, 0x3b, 0x6f, 0x75, 0x67, 0x75, 0x69, 0x79, 0x61, 0x20, 0x6d, 0x61, 0x75, 0x72,
-0x69, 0x74, 0x61, 0x6e, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x6f, 0x75, 0x67, 0x75, 0x69, 0x79, 0x61, 0x20, 0x6d, 0x61, 0x75,
-0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x6f, 0x75, 0x67, 0x75, 0x69, 0x79, 0x61, 0x73,
-0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65,
-0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65,
-0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70,
-0x69, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x75, 0x72, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x72,
-0x68, 0x61, 0x6d, 0x20, 0x6d, 0x61, 0x72, 0x6f, 0x63, 0x61, 0x69, 0x6e, 0x3b, 0x3b, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d,
-0x20, 0x6d, 0x61, 0x72, 0x6f, 0x63, 0x61, 0x69, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x69, 0x72, 0x68, 0x61, 0x6d, 0x73,
-0x20, 0x6d, 0x61, 0x72, 0x6f, 0x63, 0x61, 0x69, 0x6e, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x72, 0x77, 0x61,
-0x6e, 0x64, 0x61, 0x69, 0x73, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x69,
-0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x69, 0x73,
-0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x20, 0x64, 0x65, 0x73, 0x20, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c,
-0x65, 0x73, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x20, 0x64, 0x65, 0x73, 0x20, 0x53, 0x65, 0x79, 0x63, 0x68,
-0x65, 0x6c, 0x6c, 0x65, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x65, 0x73, 0x20, 0x64, 0x65, 0x73,
-0x20, 0x53, 0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x75,
-0x69, 0x73, 0x73, 0x65, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x3b, 0x3b,
-0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x73, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x73, 0x3b, 0x6c, 0x69, 0x76,
-0x72, 0x65, 0x20, 0x73, 0x79, 0x72, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x6c, 0x69, 0x76, 0x72, 0x65, 0x20, 0x73,
-0x79, 0x72, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x6c, 0x69, 0x76, 0x72, 0x65, 0x73, 0x20, 0x73, 0x79,
-0x72, 0x69, 0x65, 0x6e, 0x6e, 0x65, 0x73, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x74, 0x75, 0x6e, 0x69, 0x73, 0x69,
-0x65, 0x6e, 0x3b, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x20, 0x74, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x3b, 0x3b,
-0x3b, 0x3b, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x73, 0x20, 0x74, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x73, 0x3b, 0x76,
-0x61, 0x74, 0x75, 0x20, 0x76, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x61, 0x6e, 0x3b, 0x3b, 0x76, 0x61, 0x74, 0x75, 0x20,
-0x76, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x61, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x76, 0x61, 0x74, 0x75, 0x73, 0x20, 0x76,
-0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x61, 0x6e, 0x73, 0x3b, 0x50, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61,
-0x6e, 0x6e, 0x61, 0x63, 0x68, 0x3b, 0x3b, 0x70, 0x68, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e,
-0x61, 0x63, 0x68, 0x3b, 0x70, 0x68, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68,
-0x3b, 0x70, 0x75, 0x69, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x68, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68, 0x3b, 0x3b,
-0x70, 0x75, 0x6e, 0x6e, 0x64, 0x20, 0x53, 0x61, 0x73, 0x61, 0x6e, 0x6e, 0x61, 0x63, 0x68, 0x3b, 0x10e5, 0x10d0, 0x10e0, 0x10d7,
-0x10e3, 0x10da, 0x10d8, 0x20, 0x10da, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x3b, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8, 0x20, 0x10da, 0x10d0,
-0x10e0, 0x10d8, 0x3b, 0x3b, 0x3b, 0x3b, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8, 0x20, 0x10da, 0x10d0, 0x10e0, 0x10d8, 0x3b, 0x45,
-0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x53, 0x63,
-0x68, 0x77, 0x65, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x3b, 0x3b, 0x53, 0x63, 0x68,
-0x77, 0x65, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x63,
-0x68, 0x77, 0x65, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x3b, 0x395, 0x3c5, 0x3c1, 0x3ce,
-0x3b, 0x3b, 0x3b5, 0x3c5, 0x3c1, 0x3ce, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b5, 0x3c5, 0x3c1, 0x3ce, 0x3b, 0x64, 0x61, 0x6e, 0x6d, 0x61,
-0x72, 0x6b, 0x69, 0x6d, 0x75, 0x74, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x3b, 0x64, 0x61, 0x6e, 0x73,
-0x6b, 0x69, 0x6e, 0x75, 0x74, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x61, 0x6e,
-0x6d, 0x61, 0x72, 0x6b, 0x69, 0x6d, 0x75, 0x74, 0x20, 0x6b, 0x6f, 0x72, 0x75, 0x75, 0x6e, 0x69, 0x3b, 0xaad, 0xabe, 0xab0,
-0xaa4, 0xac0, 0xaaf, 0x20, 0xab0, 0xac2, 0xaaa, 0xabf, 0xaaf, 0xabe, 0x3b, 0x3b, 0xaad, 0xabe, 0xab0, 0xaa4, 0xac0, 0xaaf, 0x20, 0xab0,
-0xac2, 0xaaa, 0xabf, 0xaaf, 0xabe, 0x3b, 0x3b, 0x3b, 0x3b, 0xaad, 0xabe, 0xab0, 0xaa4, 0xac0, 0xaaf, 0x20, 0xab0, 0xac2, 0xaaa, 0xabf,
-0xaaf, 0xabe, 0x3b, 0x4e, 0x61, 0x69, 0x72, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4b, 0x75, 0x257, 0x69, 0x6e,
-0x20, 0x53, 0x65, 0x66, 0x61, 0x20, 0x6e, 0x61, 0x20, 0x41, 0x66, 0x69, 0x72, 0x6b, 0x61, 0x20, 0x54, 0x61, 0x20, 0x59,
-0x61, 0x6d, 0x6d, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x5e9, 0x5e7, 0x5dc, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x3b, 0x3b,
-0x5e9, 0x5e7, 0x5dc, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x3b, 0x5e9, 0x5e7, 0x5dc, 0x5d9, 0x5dd, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x5d9, 0x5dd, 0x3b,
-0x3b, 0x5e9, 0x5e7, 0x5dc, 0x5d9, 0x5dd, 0x20, 0x5d7, 0x5d3, 0x5e9, 0x5d9, 0x5dd, 0x3b, 0x5e9, 0x5e7, 0x5dc, 0x5d9, 0x5dd, 0x20, 0x5d7,
-0x5d3, 0x5e9, 0x5d9, 0x5dd, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x92d,
-0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940,
-0x92f, 0x20, 0x930, 0x942, 0x92a, 0x90f, 0x3b, 0x6d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x69, 0x6e, 0x74,
-0x3b, 0x3b, 0x6d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x69, 0x6e, 0x74, 0x3b, 0x3b, 0x3b, 0x3b, 0x6d,
-0x61, 0x67, 0x79, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x69, 0x6e, 0x74, 0x3b, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b,
-0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x61, 0x3b, 0x3b, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0xf3, 0x6e,
-0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0x72, 0x20, 0x6b, 0x72, 0xf3, 0x6e, 0x75,
-0x72, 0x3b, 0x52, 0x75, 0x70, 0x69, 0x61, 0x68, 0x20, 0x49, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x75, 0x70, 0x69, 0x61, 0x68, 0x20, 0x49, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61,
-0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72,
-0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75,
-0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x76,
-0x69, 0x7a, 0x7a, 0x65, 0x72, 0x6f, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a,
-0x65, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x69, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a,
-0x65, 0x72, 0x69, 0x3b, 0x65e5, 0x672c, 0x5186, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x5186, 0x3b, 0xcad, 0xcbe, 0xcb0, 0xca4, 0xcc0,
-0xcaf, 0x20, 0xcb0, 0xcc2, 0xcaa, 0xcbe, 0xcaf, 0xcbf, 0x3b, 0x3b, 0xcad, 0xcbe, 0xcb0, 0xca4, 0xcc0, 0xcaf, 0x20, 0xcb0, 0xcc2, 0xcaa,
-0xcbe, 0xcaf, 0xcbf, 0x3b, 0x3b, 0x3b, 0x3b, 0xcad, 0xcbe, 0xcb0, 0xca4, 0xcc0, 0xcaf, 0x20, 0xcb0, 0xcc2, 0xcaa, 0xcbe, 0xcaf, 0xcbf,
-0xc97, 0xcb3, 0xcc1, 0x3b, 0x6c1, 0x650, 0x646, 0x62f, 0x64f, 0x633, 0x62a, 0x672, 0x646, 0x6cd, 0x20, 0x631, 0x6c4, 0x67e, 0x64e, 0x6d2,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x442, 0x435, 0x4a3,
-0x433, 0x435, 0x441, 0x456, 0x3b, 0x3b, 0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x442, 0x435, 0x4a3, 0x433,
-0x435, 0x441, 0x456, 0x3b, 0x3b, 0x3b, 0x3b, 0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x442, 0x435, 0x4a3,
-0x433, 0x435, 0x441, 0x456, 0x3b, 0x41a, 0x44b, 0x440, 0x433, 0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x443,
-0x3b, 0x3b, 0x41a, 0x44b, 0x440, 0x433, 0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x443, 0x3b, 0x3b, 0x3b,
-0x3b, 0x41a, 0x44b, 0x440, 0x433, 0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x443, 0x3b, 0xb300, 0xd55c, 0xbbfc,
-0xad6d, 0x20, 0xc6d0, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xb300, 0xd55c, 0xbbfc, 0xad6d, 0x20, 0xc6d0, 0x3b, 0xc870, 0xc120, 0x20, 0xbbfc,
-0xc8fc, 0xc8fc, 0xc758, 0x20, 0xc778, 0xbbfc, 0x20, 0xacf5, 0xd654, 0xad6d, 0x20, 0xc6d0, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xc870, 0xc120,
-0x20, 0xbbfc, 0xc8fc, 0xc8fc, 0xc758, 0x20, 0xc778, 0xbbfc, 0x20, 0xacf5, 0xd654, 0xad6d, 0x20, 0xc6d0, 0x3b, 0x49, 0x66, 0x61, 0x72, 0x61,
-0x6e, 0x67, 0x61, 0x20, 0x72, 0x79, 0x2019, 0x55, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0xea5, 0xeb2, 0xea7, 0x20, 0xe81, 0xeb5, 0xe9a, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xea5, 0xeb2, 0xea7, 0x20, 0xe81,
-0xeb5, 0xe9a, 0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x3b, 0x3b,
-0x3b, 0x65, 0x69, 0x72, 0x6f, 0x3b, 0x46, 0x61, 0x6c, 0xe1, 0x6e, 0x67, 0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e,
-0x67, 0xf3, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x79, 0x61, 0x20, 0x41,
-0x6e, 0x67, 0xf3, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x61, 0x6c, 0xe1, 0x6e, 0x67, 0x61, 0x20,
-0x43, 0x46, 0x41, 0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x61, 0x73,
-0x3b, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x73, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x69, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b,
-0x65, 0x75, 0x72, 0x173, 0x3b, 0x41c, 0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x435, 0x43d, 0x430,
-0x440, 0x3b, 0x3b, 0x41c, 0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x435, 0x43d, 0x430, 0x440, 0x3b,
-0x3b, 0x3b, 0x3b, 0x41c, 0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x435, 0x43d, 0x430, 0x440, 0x438,
-0x3b, 0x41, 0x72, 0x69, 0x61, 0x72, 0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x69, 0x6e, 0x67, 0x67, 0x69,
-0x74, 0x20, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x69, 0x6e, 0x67,
-0x67, 0x69, 0x74, 0x20, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x72, 0x20, 0x42,
-0x72, 0x75, 0x6e, 0x65, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x72, 0x20, 0x42, 0x72, 0x75,
-0x6e, 0x65, 0x69, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x72, 0x20, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x75, 0x72, 0x61, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x72, 0x20, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x75, 0x72, 0x61,
-0x3b, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f, 0xd7b, 0x20, 0xd30, 0xd42, 0xd2a, 0x3b, 0x3b, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f,
-0xd7b, 0x20, 0xd30, 0xd42, 0xd2a, 0x3b, 0x3b, 0x3b, 0x3b, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f, 0xd7b, 0x20, 0xd30, 0xd42, 0xd2a,
-0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x65, 0x77,
-0x72, 0x6f, 0x3b, 0x65, 0x77, 0x72, 0x6f, 0x3b, 0x54, 0x101, 0x72, 0x61, 0x20, 0x6f, 0x20, 0x41, 0x6f, 0x74, 0x65, 0x61,
-0x72, 0x6f, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x67, 0x101, 0x20, 0x74, 0x101, 0x72, 0x61, 0x20, 0x6f, 0x20,
-0x41, 0x6f, 0x74, 0x65, 0x61, 0x72, 0x6f, 0x61, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f,
-0x93e, 0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b, 0x92d,
-0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x941, 0x92a, 0x92f, 0x947, 0x3b, 0x442, 0x4e9, 0x433, 0x440, 0x4e9, 0x433, 0x3b, 0x3b,
-0x442, 0x4e9, 0x433, 0x440, 0x4e9, 0x433, 0x3b, 0x3b, 0x3b, 0x3b, 0x442, 0x4e9, 0x433, 0x440, 0x4e9, 0x433, 0x3b, 0x928, 0x947, 0x92a,
-0x93e, 0x932, 0x940, 0x20, 0x930, 0x942, 0x92a, 0x948, 0x92f, 0x93e, 0x901, 0x3b, 0x3b, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x940, 0x20,
-0x930, 0x942, 0x92a, 0x948, 0x92f, 0x93e, 0x901, 0x3b, 0x3b, 0x3b, 0x3b, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x940, 0x20, 0x930, 0x942,
-0x92a, 0x948, 0x92f, 0x93e, 0x901, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x942, 0x92a, 0x93f, 0x901, 0x92f, 0x93e,
-0x3b, 0x3b, 0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x942, 0x92a, 0x93f, 0x901, 0x92f, 0x93e, 0x3b, 0x3b, 0x3b, 0x3b,
-0x92d, 0x93e, 0x930, 0x924, 0x940, 0x92f, 0x20, 0x930, 0x942, 0x92a, 0x93f, 0x901, 0x92f, 0x93e, 0x3b, 0x6e, 0x6f, 0x72, 0x73, 0x6b,
-0x65, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0x3b, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e,
-0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x65, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x65, 0x72, 0x3b, 0xb2d,
-0xb3e, 0xb30, 0xb24, 0xb40, 0xb5f, 0x20, 0xb1f, 0xb19, 0xb4d, 0xb15, 0xb3e, 0x3b, 0x3b, 0xb2d, 0xb3e, 0xb30, 0xb24, 0xb40, 0xb5f, 0x20,
-0xb1f, 0xb19, 0xb4d, 0xb15, 0xb3e, 0x3b, 0x3b, 0x3b, 0x3b, 0xb2d, 0xb3e, 0xb30, 0xb24, 0xb40, 0xb5f, 0x20, 0xb1f, 0xb19, 0xb4d, 0xb15,
-0xb3e, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b, 0x3b, 0x3b, 0x3b,
-0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cd, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cd, 0x20, 0x6a9, 0x644, 0x62f, 0x627,
-0x631, 0x647, 0x3b, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cd, 0x20, 0x6a9, 0x644, 0x62f, 0x627, 0x631, 0x647, 0x3b,
-0x3b, 0x3b, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cd, 0x20, 0x6a9, 0x644, 0x62f, 0x627, 0x631, 0x6d2, 0x3b, 0x631,
-0x6cc, 0x627, 0x644, 0x20, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x3b, 0x3b, 0x631, 0x6cc, 0x627, 0x644, 0x20, 0x627, 0x6cc, 0x631, 0x627,
-0x646, 0x3b, 0x3b, 0x3b, 0x3b, 0x631, 0x6cc, 0x627, 0x644, 0x20, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x3b, 0x627, 0x641, 0x63a, 0x627,
-0x646, 0x6cc, 0x20, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633, 0x62a, 0x627, 0x646, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc,
-0x20, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633, 0x62a, 0x627, 0x646, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc,
-0x20, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x633, 0x62a, 0x627, 0x646, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x79, 0x20, 0x70, 0x6f, 0x6c,
-0x73, 0x6b, 0x69, 0x3b, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x79, 0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x3b, 0x3b, 0x7a,
-0x142, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x65, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x79, 0x63, 0x68,
-0x20, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x63, 0x68, 0x3b, 0x7a, 0x142, 0x6f, 0x74, 0x65, 0x67, 0x6f, 0x20, 0x70, 0x6f,
-0x6c, 0x73, 0x6b, 0x69, 0x65, 0x67, 0x6f, 0x3b, 0x52, 0x65, 0x61, 0x6c, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65,
-0x69, 0x72, 0x6f, 0x3b, 0x3b, 0x52, 0x65, 0x61, 0x6c, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0x69, 0x72, 0x6f,
-0x3b, 0x3b, 0x3b, 0x3b, 0x52, 0x65, 0x61, 0x69, 0x73, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0x69, 0x72, 0x6f,
-0x73, 0x3b, 0x6b, 0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x6b,
-0x77, 0x61, 0x6e, 0x7a, 0x61, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x6b, 0x77,
-0x61, 0x6e, 0x7a, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x65, 0x73, 0x63, 0x75,
-0x64, 0x6f, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x65, 0x73,
-0x63, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b,
-0x3b, 0x3b, 0x65, 0x73, 0x63, 0x75, 0x64, 0x6f, 0x73, 0x20, 0x63, 0x61, 0x62, 0x6f, 0x2d, 0x76, 0x65, 0x72, 0x64, 0x69,
-0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x73, 0x20, 0x45, 0x73, 0x74, 0x61, 0x64,
-0x6f, 0x73, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x73,
-0x20, 0x45, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x73, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x64,
-0xf3, 0x6c, 0x61, 0x72, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x73, 0x20, 0x45, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x73, 0x20, 0x55,
-0x6e, 0x69, 0x64, 0x6f, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45,
-0x41, 0x43, 0x29, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41,
-0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42,
-0x45, 0x41, 0x43, 0x29, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45,
-0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x43, 0x45,
-0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28,
-0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x50, 0x61, 0x74, 0x61, 0x63, 0x61, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x61, 0x63,
-0x61, 0x75, 0x3b, 0x3b, 0x50, 0x61, 0x74, 0x61, 0x63, 0x61, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x61, 0x63, 0x61, 0x75, 0x3b,
-0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x74, 0x61, 0x63, 0x61, 0x73, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x61, 0x63, 0x61, 0x75, 0x3b,
-0x6d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b,
-0x3b, 0x6d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x63, 0x61, 0x6e, 0x6f,
-0x3b, 0x3b, 0x3b, 0x3b, 0x6d, 0x65, 0x74, 0x69, 0x63, 0x61, 0x69, 0x73, 0x20, 0x6d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69,
-0x63, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0x6f, 0x62, 0x72, 0x61, 0x20, 0x64, 0x65, 0x20, 0x53, 0xe3, 0x6f, 0x20, 0x54,
-0x6f, 0x6d, 0xe9, 0x20, 0x65, 0x20, 0x50, 0x72, 0xed, 0x6e, 0x63, 0x69, 0x70, 0x65, 0x3b, 0x3b, 0x64, 0x6f, 0x62, 0x72,
-0x61, 0x20, 0x64, 0x65, 0x20, 0x53, 0xe3, 0x6f, 0x20, 0x54, 0x6f, 0x6d, 0xe9, 0x20, 0x65, 0x20, 0x50, 0x72, 0xed, 0x6e,
-0x63, 0x69, 0x70, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0x6f, 0x62, 0x72, 0x61, 0x73, 0x20, 0x64, 0x65, 0x20, 0x53, 0xe3,
-0x6f, 0x20, 0x54, 0x6f, 0x6d, 0xe9, 0x20, 0x65, 0x20, 0x50, 0x72, 0xed, 0x6e, 0x63, 0x69, 0x70, 0x65, 0x3b, 0x66, 0x72,
-0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73, 0x75, 0xed, 0xe7, 0x6f, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x73,
-0x75, 0xed, 0xe7, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x73, 0x20, 0x73, 0x75, 0xed, 0xe7,
-0x6f, 0x73, 0x3b, 0xa2d, 0xa3e, 0xa30, 0xa24, 0xa40, 0x20, 0xa30, 0xa41, 0xa2a, 0xa07, 0xa06, 0x3b, 0x3b, 0xa2d, 0xa3e, 0xa30, 0xa24,
-0xa40, 0x20, 0xa30, 0xa41, 0xa2a, 0xa07, 0xa06, 0x3b, 0x3b, 0x3b, 0x3b, 0xa2d, 0xa3e, 0xa30, 0xa24, 0xa40, 0x20, 0xa30, 0xa41, 0xa2a,
-0xa0f, 0x3b, 0x631, 0x648, 0x67e, 0x626, 0x6cc, 0x6c1, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63,
-0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x76, 0x69, 0x7a,
-0x7a, 0x65, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x73, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72,
-0x3b, 0x6c, 0x65, 0x75, 0x20, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65, 0x75, 0x20, 0x72,
-0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x219,
-0x74, 0x69, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x65, 0x219, 0x74, 0x69, 0x3b, 0x6c, 0x65,
-0x75, 0x20, 0x6d, 0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65, 0x75, 0x20, 0x6d,
-0x6f, 0x6c, 0x64, 0x6f, 0x76, 0x65, 0x6e, 0x65, 0x73, 0x63, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x6d, 0x6f, 0x6c, 0x64,
-0x6f, 0x76, 0x65, 0x6e, 0x65, 0x219, 0x74, 0x69, 0x3b, 0x3b, 0x6c, 0x65, 0x69, 0x20, 0x6d, 0x6f, 0x6c, 0x64, 0x6f, 0x76,
-0x65, 0x6e, 0x65, 0x219, 0x74, 0x69, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440, 0x443,
-0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440, 0x443, 0x431, 0x43b,
-0x44c, 0x3b, 0x3b, 0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b,
-0x440, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x435, 0x439, 0x3b, 0x440, 0x43e,
-0x441, 0x441, 0x438, 0x439, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x431, 0x435, 0x43b, 0x43e,
-0x440, 0x443, 0x441, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x431, 0x435, 0x43b, 0x43e, 0x440,
-0x443, 0x441, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x431, 0x435, 0x43b, 0x43e, 0x440, 0x443,
-0x441, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x431, 0x435, 0x43b, 0x43e, 0x440, 0x443, 0x441, 0x441,
-0x43a, 0x438, 0x445, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x435, 0x439, 0x3b, 0x431, 0x435, 0x43b, 0x43e, 0x440, 0x443, 0x441, 0x441, 0x43a,
-0x43e, 0x433, 0x43e, 0x20, 0x440, 0x443, 0x431, 0x43b, 0x44f, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x439, 0x20,
-0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x442, 0x435, 0x43d,
-0x433, 0x435, 0x3b, 0x3b, 0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b,
-0x43a, 0x430, 0x437, 0x430, 0x445, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x43a, 0x430, 0x437, 0x430,
-0x445, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x442, 0x435, 0x43d, 0x433, 0x435, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441,
-0x43a, 0x438, 0x439, 0x20, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x438, 0x439, 0x20,
-0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x441, 0x43e, 0x43c, 0x430,
-0x3b, 0x43a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x441, 0x43e, 0x43c, 0x43e, 0x432, 0x3b, 0x43a, 0x438,
-0x440, 0x433, 0x438, 0x437, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x441, 0x43e, 0x43c, 0x430, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430,
-0x432, 0x441, 0x43a, 0x438, 0x439, 0x20, 0x43b, 0x435, 0x439, 0x3b, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x438,
-0x439, 0x20, 0x43b, 0x435, 0x439, 0x3b, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x43b, 0x435,
-0x44f, 0x3b, 0x43c, 0x43e, 0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x438, 0x445, 0x20, 0x43b, 0x435, 0x435, 0x432, 0x3b, 0x43c, 0x43e,
-0x43b, 0x434, 0x430, 0x432, 0x441, 0x43a, 0x43e, 0x433, 0x43e, 0x20, 0x43b, 0x435, 0x44f, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d,
-0x441, 0x43a, 0x430, 0x44f, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x430, 0x3b, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x441,
-0x43a, 0x430, 0x44f, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x430, 0x3b, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x441, 0x43a,
-0x438, 0x435, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44b, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x441, 0x43a, 0x438, 0x445,
-0x20, 0x433, 0x440, 0x438, 0x432, 0x435, 0x43d, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x441, 0x43a, 0x43e, 0x439, 0x20, 0x433,
-0x440, 0x438, 0x432, 0x43d, 0x44b, 0x3b, 0x66, 0x61, 0x72, 0xe2, 0x6e, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42,
-0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x421, 0x440, 0x43f, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x438,
-0x43d, 0x430, 0x440, 0x3b, 0x3b, 0x441, 0x440, 0x43f, 0x441, 0x43a, 0x438, 0x20, 0x434, 0x438, 0x43d, 0x430, 0x440, 0x3b, 0x3b, 0x441,
-0x440, 0x43f, 0x441, 0x43a, 0x430, 0x20, 0x434, 0x438, 0x43d, 0x430, 0x440, 0x430, 0x3b, 0x3b, 0x441, 0x440, 0x43f, 0x441, 0x43a, 0x438,
-0x445, 0x20, 0x434, 0x438, 0x43d, 0x430, 0x440, 0x430, 0x3b, 0x42, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x2d, 0x68, 0x65,
-0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62,
-0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f,
-0x2d, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72,
-0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e,
-0x73, 0x6b, 0x6f, 0x2d, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x65, 0x20, 0x6b, 0x6f, 0x6e,
-0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x3b, 0x3b, 0x62, 0x6f,
-0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x2d, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x69, 0x68,
-0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x69, 0x68, 0x20, 0x6d, 0x61, 0x72, 0x61,
-0x6b, 0x61, 0x3b, 0x45, 0x76, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x61, 0x3b,
-0x3b, 0x65, 0x76, 0x72, 0x61, 0x3b, 0x53, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x20, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x3b, 0x3b,
-0x73, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x20, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x3b, 0x3b, 0x73, 0x72, 0x70, 0x73, 0x6b, 0x61,
-0x20, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x61, 0x3b, 0x3b, 0x73, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x68, 0x20, 0x64, 0x69, 0x6e,
-0x61, 0x72, 0x61, 0x3b, 0x411, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e,
-0x432, 0x430, 0x447, 0x43a, 0x430, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x430, 0x20,
-0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446,
-0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x430, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b,
-0x43d, 0x430, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445,
-0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x435, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438,
-0x431, 0x438, 0x43b, 0x43d, 0x435, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x65, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a,
-0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x438, 0x445, 0x20, 0x43a, 0x43e, 0x43d, 0x432,
-0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x438, 0x445, 0x20, 0x43c, 0x430, 0x440, 0x430, 0x43a, 0x430, 0x3b, 0x415, 0x432,
-0x440, 0x43e, 0x3b, 0x3b, 0x435, 0x432, 0x440, 0x43e, 0x3b, 0x3b, 0x435, 0x432, 0x440, 0x430, 0x3b, 0x3b, 0x435, 0x432, 0x440, 0x430,
-0x3b, 0x41b, 0x430, 0x440, 0x3b, 0x3b, 0x43b, 0x430, 0x440, 0x3b, 0x3b, 0x3b, 0x3b, 0x43b, 0x430, 0x440, 0x44b, 0x3b, 0x421, 0x43e,
-0x43c, 0x3b, 0x3b, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x3b, 0x3b, 0x441, 0x43e, 0x43c, 0x44b, 0x3b, 0x44, 0x6f, 0x72, 0x61, 0x20,
-0x72, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x67e, 0x627, 0x6aa,
-0x633, 0x62a, 0x627, 0x646, 0x64a, 0x20, 0x631, 0x67e, 0x64a, 0x3b, 0x3b, 0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627, 0x646, 0x64a, 0x20,
-0x631, 0x67e, 0x64a, 0x3b, 0x3b, 0x3b, 0x3b, 0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627, 0x646, 0x64a, 0x20, 0x631, 0x67e, 0x64a, 0x3b,
-0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0x20, 0xdbb, 0xdd4, 0xdb4, 0xdd2, 0xdba, 0xdbd, 0x3b, 0x3b, 0xdc1,
-0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0x20, 0xdbb, 0xdd4, 0xdb4, 0xdd2, 0xdba, 0xdbd, 0x3b, 0x3b, 0x3b, 0x3b,
-0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82, 0xd9a, 0xdcf, 0x20, 0xdbb, 0xdd4, 0xdb4, 0xdd2, 0xdba, 0xdbd, 0x3b, 0x65, 0x75,
-0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0xe1, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x3b,
-0x65, 0x75, 0x72, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x3b, 0x65, 0x76, 0x72, 0x61, 0x3b,
-0x65, 0x76, 0x72, 0x69, 0x3b, 0x3b, 0x65, 0x76, 0x72, 0x6f, 0x76, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x6b,
-0x61, 0x20, 0x53, 0x6f, 0x6f, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46,
-0x61, 0x72, 0x61, 0x6e, 0x20, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x6b,
-0x61, 0x20, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x6b, 0x61,
-0x20, 0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x3b, 0x42, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74, 0x6f, 0x6f, 0x62,
-0x62, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x62, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74, 0x6f, 0x6f, 0x62, 0x62, 0x69, 0x79,
-0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x69, 0x72, 0x74, 0x61, 0x20, 0x49, 0x74, 0x6f, 0x6f, 0x62, 0x62, 0x69, 0x79, 0x61,
-0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x6b, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x73, 0x68,
-0x69, 0x6c, 0x69, 0x6e, 0x67, 0x6b, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69,
-0x6c, 0x69, 0x6e, 0x67, 0x6b, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x61, 0x72,
-0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x61, 0x72, 0x67, 0x65, 0x6e, 0x74,
-0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x61, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69,
-0x6e, 0x6f, 0x73, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x63, 0x65, 0xf1, 0x6f, 0x3b, 0x3b,
-0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x63, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0xf3,
-0x6c, 0x61, 0x72, 0x65, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x63, 0x65, 0xf1, 0x6f, 0x73, 0x3b, 0x62, 0x6f, 0x6c, 0x69,
-0x76, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b,
-0x62, 0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x72, 0x65, 0x61, 0x6c, 0x20, 0x62, 0x72, 0x61, 0x73,
-0x69, 0x6c, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x72, 0x65, 0x61, 0x6c, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0xf1,
-0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x72, 0x65, 0x61, 0x6c, 0x65, 0x73, 0x20, 0x62, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x65, 0xf1,
-0x6f, 0x73, 0x3b, 0x50, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x68, 0x69, 0x6c, 0x65, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73,
-0x6f, 0x20, 0x63, 0x68, 0x69, 0x6c, 0x65, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x63,
-0x68, 0x69, 0x6c, 0x65, 0x6e, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69,
-0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x6f,
-0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69, 0x61, 0x6e, 0x6f,
-0x73, 0x3b, 0x63, 0x6f, 0x6c, 0xf3, 0x6e, 0x20, 0x63, 0x6f, 0x73, 0x74, 0x61, 0x72, 0x72, 0x69, 0x63, 0x65, 0x6e, 0x73,
-0x65, 0x3b, 0x3b, 0x63, 0x6f, 0x6c, 0xf3, 0x6e, 0x20, 0x63, 0x6f, 0x73, 0x74, 0x61, 0x72, 0x72, 0x69, 0x63, 0x65, 0x6e,
-0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x63, 0x6f, 0x6c, 0x6f, 0x6e, 0x65, 0x73, 0x20, 0x63, 0x6f, 0x73, 0x74, 0x61, 0x72,
-0x72, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x75, 0x62, 0x61, 0x6e, 0x6f,
-0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x63, 0x75, 0x62, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73,
-0x6f, 0x73, 0x20, 0x63, 0x75, 0x62, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x64, 0x6f, 0x6d, 0x69,
-0x6e, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63,
-0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x64, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63,
-0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x65, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x75, 0x6e, 0x69,
-0x64, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x20, 0x65, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x75,
-0x6e, 0x69, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x64, 0xf3, 0x6c, 0x61, 0x72, 0x65, 0x73, 0x20, 0x65,
-0x73, 0x74, 0x61, 0x64, 0x6f, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63,
-0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x64, 0x65, 0x20, 0xc1, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x43, 0x65, 0x6e, 0x74,
-0x72, 0x61, 0x6c, 0x3b, 0x3b, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x43, 0x46, 0x41, 0x20, 0x64, 0x65, 0x20, 0xc1,
-0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0x61,
-0x6e, 0x63, 0x6f, 0x73, 0x20, 0x43, 0x46, 0x41, 0x20, 0x64, 0x65, 0x20, 0xc1, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x43,
-0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x3b, 0x71, 0x75, 0x65, 0x74, 0x7a, 0x61, 0x6c, 0x3b, 0x3b, 0x71, 0x75, 0x65, 0x74,
-0x7a, 0x61, 0x6c, 0x3b, 0x3b, 0x3b, 0x3b, 0x71, 0x75, 0x65, 0x74, 0x7a, 0x61, 0x6c, 0x65, 0x73, 0x3b, 0x6c, 0x65, 0x6d,
-0x70, 0x69, 0x72, 0x61, 0x20, 0x68, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x6c, 0x65, 0x6d, 0x70,
-0x69, 0x72, 0x61, 0x20, 0x68, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x6c, 0x65, 0x6d,
-0x70, 0x69, 0x72, 0x61, 0x73, 0x20, 0x68, 0x6f, 0x6e, 0x64, 0x75, 0x72, 0x65, 0xf1, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73,
-0x6f, 0x20, 0x6d, 0x65, 0x78, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x6d, 0x65, 0x78,
-0x69, 0x63, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x6d, 0x65, 0x78, 0x69, 0x63,
-0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x63, 0xf3, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x20, 0x6e, 0x69, 0x63, 0x61, 0x72, 0x61, 0x67,
-0xfc, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x63, 0xf3, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x20, 0x6e, 0x69, 0x63, 0x61, 0x72,
-0x61, 0x67, 0xfc, 0x65, 0x6e, 0x73, 0x65, 0x3b, 0x3b, 0x3b, 0x3b, 0x63, 0xf3, 0x72, 0x64, 0x6f, 0x62, 0x61, 0x73, 0x20,
-0x6e, 0x69, 0x63, 0x61, 0x72, 0x61, 0x67, 0xfc, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x3b, 0x62, 0x61, 0x6c, 0x62, 0x6f, 0x61,
-0x20, 0x70, 0x61, 0x6e, 0x61, 0x6d, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x62, 0x61, 0x6c, 0x62, 0x6f, 0x61, 0x20, 0x70, 0x61,
-0x6e, 0x61, 0x6d, 0x65, 0xf1, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x61, 0x6c, 0x62, 0x6f, 0x61, 0x73, 0x20, 0x70, 0x61,
-0x6e, 0x61, 0x6d, 0x65, 0xf1, 0x6f, 0x73, 0x3b, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0xed, 0x20, 0x70, 0x61, 0x72, 0x61,
-0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0xed, 0x20, 0x70, 0x61, 0x72, 0x61, 0x67,
-0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0xed, 0x65, 0x73, 0x20, 0x70, 0x61,
-0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x73, 0x3b, 0x73, 0x6f, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f,
-0x3b, 0x3b, 0x73, 0x6f, 0x6c, 0x20, 0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x6f, 0x6c,
-0x65, 0x73, 0x20, 0x70, 0x65, 0x72, 0x75, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x66, 0x69, 0x6c,
-0x69, 0x70, 0x69, 0x6e, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x6f,
-0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x6f, 0x73, 0x3b,
-0x70, 0x65, 0x73, 0x6f, 0x20, 0x75, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x20,
-0x75, 0x72, 0x75, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x65, 0x73, 0x6f, 0x73, 0x20, 0x75, 0x72,
-0x75, 0x67, 0x75, 0x61, 0x79, 0x6f, 0x73, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x20, 0x73, 0x6f, 0x62, 0x65,
-0x72, 0x61, 0x6e, 0x6f, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x20, 0x73, 0x6f, 0x62, 0x65, 0x72, 0x61,
-0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x62, 0x6f, 0x6c, 0xed, 0x76, 0x61, 0x72, 0x65, 0x73, 0x20, 0x73, 0x6f, 0x62, 0x65,
-0x72, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61,
-0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20,
-0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69,
-0x20, 0x7a, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x46, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x61,
-0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x79,
-0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x61, 0x72, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x7a,
-0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20,
-0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b,
-0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x7a, 0x61, 0x20,
-0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x55, 0x67,
-0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x55, 0x67,
-0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x7a, 0x61, 0x20,
-0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x61, 0x3b,
-0x3b, 0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x76, 0x65,
-0x6e, 0x73, 0x6b, 0x61, 0x20, 0x6b, 0x72, 0x6f, 0x6e, 0x6f, 0x72, 0x3b, 0x421, 0x43e, 0x43c, 0x43e, 0x43d, 0x4e3, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x421, 0x43e, 0x43c, 0x43e, 0x43d, 0x4e3, 0x3b, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0x20, 0xbb0, 0xbc2,
-0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0x3b, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b,
-0x3b, 0x3b, 0x3b, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0xb95, 0xbb3, 0xbcd, 0x3b,
-0xbae, 0xbb2, 0xbc7, 0xbb7, 0xbbf, 0xbaf, 0xba9, 0xbcd, 0x20, 0xbb0, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbbf, 0xb9f, 0xbcd, 0x3b, 0x3b, 0xbae,
-0xbb2, 0xbc7, 0xbb7, 0xbbf, 0xbaf, 0xba9, 0xbcd, 0x20, 0xbb0, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbbf, 0xb9f, 0xbcd, 0x3b, 0x3b, 0x3b, 0x3b,
-0xbae, 0xbb2, 0xbc7, 0xbb7, 0xbbf, 0xbaf, 0xba9, 0xbcd, 0x20, 0xbb0, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbbf, 0xb9f, 0xbcd, 0xb95, 0xbb3, 0xbcd,
-0x3b, 0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0x20, 0xb9f, 0xbbe, 0xbb2, 0xbb0, 0xbcd, 0x3b, 0x3b,
-0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0x20, 0xb9f, 0xbbe, 0xbb2, 0xbb0, 0xbcd, 0x3b, 0x3b, 0x3b,
-0x3b, 0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0x20, 0xb9f, 0xbbe, 0xbb2, 0xbb0, 0xbcd, 0xb95, 0xbb3,
-0xbcd, 0x3b, 0xb87, 0xbb2, 0xb99, 0xbcd, 0xb95, 0xbc8, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0x3b, 0xb87, 0xbb2, 0xb99,
-0xbcd, 0xb95, 0xbc8, 0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0x3b, 0x3b, 0x3b, 0x3b, 0xb87, 0xbb2, 0xb99, 0xbcd, 0xb95, 0xbc8,
-0x20, 0xbb0, 0xbc2, 0xbaa, 0xbbe, 0xbaf, 0xbcd, 0xb95, 0xbb3, 0xbcd, 0x3b, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x44f, 0x20, 0x441, 0x443,
-0x43c, 0x44b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x441, 0x443, 0x43c, 0x3b, 0xc30, 0xc42, 0xc2a, 0xc3e, 0xc2f, 0xc3f, 0x3b, 0x3b,
-0xc30, 0xc42, 0xc2a, 0xc3e, 0xc2f, 0xc3f, 0x3b, 0x3b, 0x3b, 0x3b, 0xc30, 0xc42, 0xc2a, 0xc3e, 0xc2f, 0xc32, 0xc41, 0x3b, 0xe1a, 0xe32,
-0xe17, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xe1a, 0xe32, 0xe17, 0xe44, 0xe17, 0xe22, 0x3b, 0xf61, 0xf74, 0xf0b, 0xf68, 0xf53, 0xf0b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0xf62, 0xf92, 0xfb1, 0xf0b, 0xf42, 0xf62, 0xf0b, 0xf66, 0xf92, 0xf7c, 0xf62, 0xf0b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x12e8, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x20, 0x1265, 0x122d, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x50, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x66, 0x61, 0x6b, 0x61, 0x74, 0x6f, 0x6e, 0x67, 0x61, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x50, 0x61, 0x2bb, 0x61, 0x6e, 0x67, 0x61, 0x20, 0x66, 0x61, 0x6b, 0x61, 0x74, 0x6f, 0x6e,
-0x67, 0x61, 0x3b, 0x54, 0xfc, 0x72, 0x6b, 0x20, 0x4c, 0x69, 0x72, 0x61, 0x73, 0x131, 0x3b, 0x3b, 0x54, 0xfc, 0x72, 0x6b,
-0x20, 0x6c, 0x69, 0x72, 0x61, 0x73, 0x131, 0x3b, 0x3b, 0x3b, 0x3b, 0x54, 0xfc, 0x72, 0x6b, 0x20, 0x6c, 0x69, 0x72, 0x61,
-0x73, 0x131, 0x3b, 0x54, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x64, 0x79, 0x3b, 0x3b, 0x74,
-0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x64, 0x79, 0x3b, 0x3b, 0x3b, 0x3b, 0x74, 0xfc, 0x72,
-0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x64, 0x79, 0x3b, 0x62c, 0x6c7, 0x6ad, 0x6af, 0x648, 0x20, 0x64a, 0x6c8,
-0x6d5, 0x646, 0x649, 0x3b, 0x3b, 0x62c, 0x6c7, 0x6ad, 0x6af, 0x648, 0x20, 0x64a, 0x6c8, 0x6d5, 0x646, 0x649, 0x3b, 0x3b, 0x3b, 0x3b,
-0x62c, 0x6c7, 0x6ad, 0x6af, 0x648, 0x20, 0x64a, 0x6c8, 0x6d5, 0x646, 0x649, 0x3b, 0x443, 0x43a, 0x440, 0x430, 0x457, 0x43d, 0x441, 0x44c,
-0x43a, 0x430, 0x20, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44f, 0x3b, 0x3b, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x44f, 0x3b, 0x3b, 0x433,
-0x440, 0x438, 0x432, 0x43d, 0x456, 0x3b, 0x433, 0x440, 0x438, 0x432, 0x435, 0x43d, 0x44c, 0x3b, 0x433, 0x440, 0x438, 0x432, 0x43d, 0x456,
-0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x3b, 0x67e, 0x627, 0x6a9,
-0x633, 0x62a, 0x627, 0x646, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x3b, 0x3b, 0x3b, 0x67e, 0x627, 0x6a9, 0x633, 0x62a,
-0x627, 0x646, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6cc, 0x20, 0x631, 0x648, 0x67e,
-0x6cc, 0x6c1, 0x3b, 0x3b, 0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6cc, 0x6c1, 0x3b, 0x3b, 0x3b, 0x3b,
-0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6cc, 0x20, 0x631, 0x648, 0x67e, 0x6d2, 0x3b, 0x4f, 0x2018, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73,
-0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2018, 0x6d, 0x69, 0x3b, 0x3b, 0x4f, 0x2018, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73, 0x74,
-0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2018, 0x6d, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x4f, 0x2018, 0x7a, 0x62, 0x65, 0x6b, 0x69, 0x73,
-0x74, 0x6f, 0x6e, 0x20, 0x73, 0x6f, 0x2018, 0x6d, 0x69, 0x3b, 0x627, 0x641, 0x63a, 0x627, 0x646, 0x6cc, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x40e, 0x437, 0x431, 0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x20, 0x441, 0x45e, 0x43c, 0x3b, 0x3b, 0x40e,
-0x437, 0x431, 0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x20, 0x441, 0x45e, 0x43c, 0x3b, 0x3b, 0x3b, 0x3b, 0x40e, 0x437, 0x431,
-0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x20, 0x441, 0x45e, 0x43c, 0x3b, 0x110, 0x1ed3, 0x6e, 0x67, 0x20, 0x56, 0x69, 0x1ec7,
-0x74, 0x20, 0x4e, 0x61, 0x6d, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x110, 0x1ed3, 0x6e, 0x67, 0x20, 0x56, 0x69, 0x1ec7, 0x74,
-0x20, 0x4e, 0x61, 0x6d, 0x3b, 0x50, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x70, 0x75,
-0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x62, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64,
-0x61, 0x69, 0x6e, 0x3b, 0x62, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x70, 0x75, 0x6e,
-0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x70, 0x68, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64,
-0x61, 0x69, 0x6e, 0x3b, 0x70, 0x75, 0x6e, 0x74, 0x20, 0x50, 0x72, 0x79, 0x64, 0x61, 0x69, 0x6e, 0x3b, 0x46, 0x72, 0x61,
-0x6e, 0x63, 0x20, 0x43, 0x46, 0x41, 0x20, 0x62, 0x75, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x20, 0x53, 0x6f, 0x77, 0x77,
-0x75, 0x2d, 0x6a, 0x61, 0x6e, 0x74, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x79, 0x75, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x20, 0x53, 0x6f, 0x77, 0x77, 0x75, 0x2d, 0x6a, 0x61, 0x6e,
-0x74, 0x3b, 0x69, 0x52, 0x61, 0x6e, 0x64, 0x69, 0x20, 0x79, 0x61, 0x73, 0x65, 0x4d, 0x7a, 0x61, 0x6e, 0x7a, 0x69, 0x20,
-0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x69, 0x52, 0x61, 0x6e, 0x64, 0x69, 0x20, 0x59, 0x61, 0x73, 0x65, 0x4d,
-0x7a, 0x61, 0x6e, 0x7a, 0x69, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x69, 0x52, 0x61, 0x6e,
-0x64, 0x69, 0x20, 0x79, 0x61, 0x73, 0x65, 0x4d, 0x7a, 0x61, 0x6e, 0x7a, 0x69, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61,
-0x3b, 0x4e, 0xe1, 0xec, 0x72, 0xe0, 0x20, 0x74, 0x69, 0x20, 0x4f, 0x72, 0xed, 0x6c, 0x1eb9, 0x300, 0x2d, 0xe8, 0x64, 0xe8,
-0x20, 0x4e, 0xe0, 0xec, 0x6a, 0xed, 0x72, 0xed, 0xe0, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x61, 0x72, 0x61,
-0x6e, 0x73, 0x69, 0x20, 0x74, 0x69, 0x20, 0x4f, 0x72, 0xed, 0x6c, 0x25b, 0x301, 0xe8, 0x64, 0x65, 0x20, 0x42, 0x49, 0x4b,
-0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x69, 0x2d, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66,
-0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x69, 0x2d, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20,
-0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x3b, 0x3b, 0x3b, 0x69, 0x2d, 0x53, 0x6f,
-0x75, 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x52, 0x61, 0x6e, 0x64, 0x3b, 0x42, 0x6f, 0x73,
-0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20, 0x6b, 0x6f,
-0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b, 0x3b, 0x62,
-0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b, 0x61, 0x20,
-0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x61, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x3b,
-0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61, 0x10d, 0x6b,
-0x65, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b,
-0x65, 0x3b, 0x3b, 0x62, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x6f, 0x68, 0x65, 0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x61,
-0x10d, 0x6b, 0x69, 0x68, 0x20, 0x6b, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x6e, 0x69, 0x68, 0x20,
-0x6d, 0x61, 0x72, 0x61, 0x6b, 0x61, 0x3b, 0x41a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x430,
-0x20, 0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d, 0x445, 0x435, 0x440,
-0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x430, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442, 0x438, 0x431, 0x438,
-0x43b, 0x43d, 0x430, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x430, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x43e, 0x2d,
-0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x435, 0x20, 0x43a, 0x43e, 0x43d, 0x432, 0x435, 0x440, 0x442,
-0x438, 0x431, 0x438, 0x43b, 0x43d, 0x435, 0x20, 0x43c, 0x430, 0x440, 0x43a, 0x3b, 0x3b, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a,
-0x43e, 0x2d, 0x445, 0x435, 0x440, 0x446, 0x435, 0x433, 0x43e, 0x432, 0x430, 0x447, 0x43a, 0x438, 0x445, 0x20, 0x43a, 0x43e, 0x43d, 0x432,
-0x435, 0x440, 0x442, 0x438, 0x431, 0x438, 0x43b, 0x43d, 0x438, 0x445, 0x20, 0x43c, 0x430, 0x440, 0x430, 0x43a, 0x430, 0x3b, 0x47, 0x68,
-0x61, 0x6e, 0x61, 0x20, 0x53, 0x69, 0x64, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x4e, 0x52, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x4e, 0x52, 0x3b, 0x4e, 0x61, 0x1ecb, 0x72, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x53, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x67, 0x68, 0x61, 0x6e, 0x61, 0x20, 0x73, 0x69, 0x256, 0x69, 0x3b, 0x3b, 0x67, 0x68, 0x61, 0x6e, 0x61,
-0x20, 0x73, 0x69, 0x256, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x67, 0x68, 0x61, 0x6e, 0x61, 0x20, 0x73, 0x69, 0x256, 0x69, 0x3b,
-0x263, 0x65, 0x74, 0x6f, 0x256, 0x6f, 0x66, 0x65, 0x20, 0x61, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x67, 0x61, 0x20, 0x43, 0x46,
-0x41, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x263, 0x65, 0x74, 0x6f, 0x256,
-0x6f, 0x66, 0x65, 0x20, 0x61, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61,
-0x6e, 0x63, 0x20, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x263, 0x65, 0x74, 0x6f, 0x256, 0x6f, 0x66, 0x65,
-0x20, 0x61, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x67, 0x61, 0x20, 0x43, 0x46, 0x41, 0x20, 0x66, 0x72, 0x61, 0x6e, 0x63, 0x20,
-0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x50, 0x69, 0x73, 0x6f, 0x20, 0x6e, 0x67, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69,
-0x6e, 0x61, 0x73, 0x3b, 0x3b, 0x70, 0x69, 0x73, 0x6f, 0x20, 0x6e, 0x67, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e,
-0x61, 0x73, 0x3b, 0x3b, 0x3b, 0x3b, 0x70, 0x69, 0x73, 0x6f, 0x20, 0x6e, 0x67, 0x20, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69,
-0x6e, 0x61, 0x73, 0x3b, 0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65,
-0x3b, 0x3b, 0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x3b, 0x3b,
-0x3b, 0x3b, 0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x3b, 0x45,
-0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61,
-0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x3b, 0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75,
-0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b,
-0x3b, 0x3b, 0x6e, 0x6f, 0x72, 0x67, 0x67, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x65, 0x75, 0x72,
-0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b,
-0x72, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x3b, 0x72, 0x75, 0x6f, 0x167,
-0x167, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x72, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x20, 0x6b, 0x72,
-0x75, 0x76, 0x64, 0x6e, 0x6f, 0x3b, 0x3b, 0x3b, 0x72, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x20, 0x6b, 0x72, 0x75, 0x76, 0x64,
-0x6e, 0x6f, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x62, 0x75, 0x75, 0x257, 0x75, 0x20, 0x53, 0x65, 0x65, 0x66, 0x61, 0x61,
-0x20, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d, 0x62, 0x75, 0x75, 0x257, 0x69, 0x20,
-0x53, 0x65, 0x65, 0x66, 0x61, 0x61, 0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x61,
-0x6c, 0x61, 0x73, 0x69, 0x20, 0x47, 0x61, 0x6d, 0x6d, 0x62, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x6f,
-0x6c, 0x61, 0x61, 0x72, 0x20, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x55, 0x67, 0x69, 0x79, 0x79, 0x61, 0x20, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x79, 0x72, 0x61, 0x61, 0x20, 0x4e, 0x69, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4c, 0x65, 0x77, 0x6f, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x61, 0x61, 0x20, 0x4c,
-0x69, 0x79, 0x6f, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79,
-0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x6a, 0x69, 0x6c, 0x69, 0x6e,
-0x67, 0x69, 0x20, 0x65, 0x65, 0x6c, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4d,
-0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x65, 0x20, 0x4d, 0x6f, 0xe7, 0x61, 0x6d, 0x62, 0x69, 0x71, 0x75, 0x65,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x6f, 0x6c, 0x61, 0x20, 0x79, 0x61, 0x73, 0x65, 0x20, 0x41, 0x6d, 0x65,
-0x6c, 0x69, 0x6b, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x68, 0x65, 0x6c, 0x65, 0x72, 0x69, 0x20, 0x73, 0x61,
-0x20, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x2d30, 0x2d37, 0x2d54, 0x2d49,
-0x2d4e, 0x20, 0x2d4f, 0x20, 0x2d4d, 0x2d4e, 0x2d56, 0x2d54, 0x2d49, 0x2d31, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x61, 0x64, 0x72,
-0x69, 0x6d, 0x20, 0x6e, 0x20, 0x6c, 0x6d, 0x263, 0x72, 0x69, 0x62, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x64,
-0x69, 0x6e, 0x61, 0x72, 0x20, 0x41, 0x7a, 0x7a, 0x61, 0x79, 0x72, 0x69, 0x3b, 0x3b, 0x41, 0x64, 0x69, 0x6e, 0x61, 0x72,
-0x20, 0x6e, 0x20, 0x5a, 0x7a, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x64, 0x69, 0x6e, 0x61, 0x72, 0x65,
-0x6e, 0x20, 0x6e, 0x20, 0x5a, 0x7a, 0x61, 0x79, 0x65, 0x72, 0x3b, 0x45, 0x73, 0x68, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x69,
-0x20, 0x79, 0x61, 0x20, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x68, 0x69,
-0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x48, 0x75, 0x74, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61,
-0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x65, 0x66, 0x61, 0x20, 0x46, 0x72,
-0x61, 0x14b, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x53, 0x20,
-0x13a0, 0x13d5, 0x13b3, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x13a0, 0x13d5, 0x13b3, 0x3b, 0x3b, 0x3b, 0x3b, 0x55, 0x53, 0x20, 0x13a0, 0x13d5,
-0x13b3, 0x3b, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x20, 0x6d, 0x6f, 0x72, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x53, 0x68, 0x69, 0x6c, 0xed, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61, 0x61, 0x6e,
-0x73, 0x61, 0x6e, 0xed, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20,
-0x65, 0x79, 0x61, 0x20, 0x59, 0x75, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x6b,
-0x75, 0x64, 0x75, 0x20, 0x4b, 0x61, 0x62, 0x75, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x75, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x53, 0x6b, 0x75, 0x64, 0x75, 0x20, 0x4b, 0x61, 0x62, 0x75, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x75,
-0x3b, 0x53, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x74, 0x61, 0x62, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x20, 0x44, 0x6f, 0x6c, 0x6c, 0x61,
-0x72, 0x69, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x45, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x49, 0x72, 0x6f, 0x70, 0x69, 0x79, 0x69, 0x61, 0x6e, 0xed, 0x20, 0x65, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x49, 0x72, 0x6f, 0x70, 0x69, 0x79, 0x69, 0x61, 0x6e, 0xed, 0x20, 0x65, 0x20, 0x54, 0x61,
-0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x53, 0x69, 0x72, 0x69, 0x6e, 0x6a, 0x69,
-0x20, 0x79, 0x61, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c,
-0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x64, 0x68, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x6e, 0x67, 0x6f, 0x2019, 0x6f, 0x74, 0x6f, 0x6c, 0x20, 0x6c, 0x6f, 0x6b, 0x2019, 0x20, 0x55,
-0x67, 0x61, 0x6e, 0x64, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x41, 0x6e, 0x67, 0x6f, 0x2019, 0x6f, 0x74, 0x6f,
-0x6c, 0x20, 0x6c, 0x6f, 0x6b, 0x2019, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x43,
-0x46, 0x41, 0x20, 0x46, 0x72, 0x61, 0x14b, 0x20, 0x28, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x53, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x61, 0x72, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x44, 0x65, 0x72, 0x68, 0x65, 0x6d, 0x20, 0x55, 0x6d, 0x65, 0x1e5b, 0x1e5b, 0x75, 0x6b, 0x69,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x69, 0x20, 0x79, 0x61, 0x20, 0x54,
-0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x930, 0x93e, 0x902, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x420, 0x43e, 0x441,
-0x441, 0x438, 0x439, 0x43d, 0x20, 0x441, 0x43e, 0x43c, 0x3b, 0x3b, 0x3b, 0x3b, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x439, 0x43d, 0x20,
-0x441, 0x43e, 0x44c, 0x43c, 0x430, 0x448, 0x3b, 0x440, 0x461, 0x441, 0x441, 0x456, 0x301, 0x439, 0x441, 0x43a, 0x457, 0x439, 0x20, 0x440,
-0xa64b, 0x301, 0x431, 0x43b, 0x44c, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x440, 0x461, 0x441, 0x441, 0x456, 0x301, 0x439, 0x441, 0x43a,
-0x430, 0x433, 0x461, 0x20, 0x440, 0xa64b, 0x431, 0x43b, 0x467, 0x300, 0x3b, 0x4e, 0x66, 0x61, 0x6c, 0x61, 0x6e, 0x67, 0x61, 0x20,
-0x77, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x75, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x43, 0x46, 0x41, 0x20, 0x46,
-0xe0, 0x6c, 0xe2, 0x14b, 0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x1ce, 0x14b,
-0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x65,
-0x65, 0x66, 0x61, 0x20, 0x79, 0x61, 0x74, 0x69, 0x20, 0x42, 0x43, 0x45, 0x41, 0x4f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x46, 0x259, 0x6c, 0xe1, 0x14b, 0x20, 0x43, 0x46, 0x41, 0x20, 0x28, 0x42, 0x45, 0x41, 0x43, 0x29, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0x66, 0x72, 0xe1, 0x14b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x6f, 0x6c, 0x61, 0x69,
-0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x14b, 0x20, 0x43, 0x46, 0x41,
-0x20, 0x42, 0x45, 0x41, 0x43, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x410, 0x440, 0x430, 0x441, 0x441, 0x44b, 0x44b, 0x439,
-0x430, 0x20, 0x441, 0x43e, 0x43b, 0x43a, 0x443, 0x43e, 0x431, 0x430, 0x439, 0x430, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x410, 0x440,
-0x430, 0x441, 0x441, 0x44b, 0x44b, 0x439, 0x430, 0x20, 0x441, 0x43e, 0x43b, 0x43a, 0x443, 0x43e, 0x431, 0x430, 0x439, 0x430, 0x3b, 0x49,
-0x68, 0x65, 0x6c, 0x61, 0x20, 0x79, 0x61, 0x20, 0x54, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x79, 0x61, 0x3b, 0x3b, 0x3b,
-0x3b, 0x3b, 0x3b, 0x3b, 0xa55e, 0xa524, 0xa52b, 0xa569, 0x20, 0xa55c, 0xa55e, 0xa54c, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x4c,
-0x61, 0x69, 0x62, 0x68, 0x69, 0x79, 0x61, 0x20, 0x44, 0x61, 0x6c, 0x61, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46,
-0x25b, 0x6c, 0xe2, 0x14b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x20, 0x43, 0x46, 0x41,
-0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x73, 0x68, 0x69, 0x72, 0xe8, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x66,
-0x65, 0x6c, 0xe1, 0x14b, 0x20, 0x43, 0x46, 0x41, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x62f, 0x6cc, 0x646, 0x627, 0x631,
-0x6cc, 0x20, 0x639, 0x6ce, 0x631, 0x627, 0x642, 0x6cc, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x695, 0x6cc, 0x627, 0x6b5, 0x6cc,
-0x20, 0x626, 0x6ce, 0x631, 0x627, 0x646, 0x6cc, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b,
-0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f,
-0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x65, 0x75, 0x72, 0x61, 0x6a, 0x3b, 0x65, 0x75,
-0x72, 0x61, 0x3b, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x77, 0x3b, 0x65, 0x75, 0x72, 0x6f, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b,
-0x3b, 0x627, 0x6cc, 0x631, 0x627, 0x646, 0x20, 0x631, 0x6cc, 0x627, 0x644, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x627, 0x6cc, 0x631,
-0x627, 0x646, 0x20, 0x631, 0x6cc, 0x627, 0x644, 0x3b, 0x6e2f, 0x5e63, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x3b, 0x6e2f, 0x5e63, 0x3b
-};
-
-static const ushort currency_format_data[] = {
-0x25, 0x31, 0x25, 0x32, 0x25, 0x32, 0x25, 0x31, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x25, 0x32,
-0x25, 0x31, 0x4b, 0x25, 0x32, 0xa0, 0x2d, 0x25, 0x31, 0x28, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x29, 0x25, 0x32, 0x2d, 0x25,
-0x31, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x4b, 0x25, 0x31, 0xa0, 0x6b, 0x25, 0x32, 0x25, 0x32, 0xa0, 0x25, 0x31, 0x2d, 0x25,
-0x32, 0x2212, 0x25, 0x31, 0x200f, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x200f, 0x200e, 0x2d, 0x25, 0x31, 0xa0, 0x25, 0x32, 0x200e, 0x25,
-0x32, 0x25, 0x31, 0x28, 0x25, 0x32, 0x25, 0x31, 0x29, 0x25, 0x31, 0xa0, 0x4b, 0xa0, 0x25, 0x32, 0x25, 0x32, 0x2d, 0xa0,
-0x25, 0x31
-};
-
-static const ushort endonyms_data[] = {
-0x4f, 0x72, 0x6f, 0x6d, 0x6f, 0x6f, 0x49, 0x74, 0x6f, 0x6f, 0x70, 0x68, 0x69, 0x79, 0x61, 0x61, 0x4b, 0x65, 0x65, 0x6e,
-0x69, 0x79, 0x61, 0x61, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x61, 0x6e, 0x73, 0x53, 0x75, 0x69, 0x64, 0x2d, 0x41, 0x66,
-0x72, 0x69, 0x6b, 0x61, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0xeb, 0x73, 0x68, 0x71, 0x69, 0x70, 0x53, 0x68, 0x71, 0x69,
-0x70, 0xeb, 0x72, 0x69, 0x4d, 0x61, 0x71, 0x65, 0x64, 0x6f, 0x6e, 0x69, 0x61, 0x20, 0x65, 0x20, 0x56, 0x65, 0x72, 0x69,
-0x75, 0x74, 0x4b, 0x6f, 0x73, 0x6f, 0x76, 0xeb, 0x12a0, 0x121b, 0x122d, 0x129b, 0x12a2, 0x1275, 0x12ee, 0x1335, 0x12eb, 0x627, 0x644, 0x639,
-0x631, 0x628, 0x64a, 0x629, 0x645, 0x635, 0x631, 0x627, 0x644, 0x62c, 0x632, 0x627, 0x626, 0x631, 0x627, 0x644, 0x628, 0x62d, 0x631, 0x64a,
-0x646, 0x62a, 0x634, 0x627, 0x62f, 0x62c, 0x632, 0x631, 0x20, 0x627, 0x644, 0x642, 0x645, 0x631, 0x62c, 0x64a, 0x628, 0x648, 0x62a, 0x64a,
-0x625, 0x631, 0x64a, 0x62a, 0x631, 0x64a, 0x627, 0x627, 0x644, 0x639, 0x631, 0x627, 0x642, 0x625, 0x633, 0x631, 0x627, 0x626, 0x64a, 0x644,
-0x627, 0x644, 0x623, 0x631, 0x62f, 0x646, 0x627, 0x644, 0x643, 0x648, 0x64a, 0x62a, 0x644, 0x628, 0x646, 0x627, 0x646, 0x644, 0x64a, 0x628,
-0x64a, 0x627, 0x645, 0x648, 0x631, 0x64a, 0x62a, 0x627, 0x646, 0x64a, 0x627, 0x627, 0x644, 0x645, 0x63a, 0x631, 0x628, 0x639, 0x64f, 0x645,
-0x627, 0x646, 0x627, 0x644, 0x623, 0x631, 0x627, 0x636, 0x64a, 0x20, 0x627, 0x644, 0x641, 0x644, 0x633, 0x637, 0x64a, 0x646, 0x64a, 0x629,
-0x642, 0x637, 0x631, 0x627, 0x644, 0x645, 0x645, 0x644, 0x643, 0x629, 0x20, 0x627, 0x644, 0x639, 0x631, 0x628, 0x64a, 0x629, 0x20, 0x627,
-0x644, 0x633, 0x639, 0x648, 0x62f, 0x64a, 0x629, 0x627, 0x644, 0x635, 0x648, 0x645, 0x627, 0x644, 0x627, 0x644, 0x633, 0x648, 0x62f, 0x627,
-0x646, 0x633, 0x648, 0x631, 0x64a, 0x627, 0x62a, 0x648, 0x646, 0x633, 0x627, 0x644, 0x625, 0x645, 0x627, 0x631, 0x627, 0x62a, 0x20, 0x627,
-0x644, 0x639, 0x631, 0x628, 0x64a, 0x629, 0x20, 0x627, 0x644, 0x645, 0x62a, 0x62d, 0x62f, 0x629, 0x627, 0x644, 0x635, 0x62d, 0x631, 0x627,
-0x621, 0x20, 0x627, 0x644, 0x63a, 0x631, 0x628, 0x64a, 0x629, 0x627, 0x644, 0x64a, 0x645, 0x646, 0x62c, 0x646, 0x648, 0x628, 0x20, 0x627,
-0x644, 0x633, 0x648, 0x62f, 0x627, 0x646, 0x627, 0x644, 0x639, 0x631, 0x628, 0x64a, 0x629, 0x20, 0x627, 0x644, 0x631, 0x633, 0x645, 0x64a,
-0x629, 0x20, 0x627, 0x644, 0x62d, 0x62f, 0x64a, 0x62b, 0x629, 0x627, 0x644, 0x639, 0x627, 0x644, 0x645, 0x570, 0x561, 0x575, 0x565, 0x580,
-0x565, 0x576, 0x540, 0x561, 0x575, 0x561, 0x57d, 0x57f, 0x561, 0x576, 0x985, 0x9b8, 0x9ae, 0x9c0, 0x9af, 0x9bc, 0x9be, 0x9ad, 0x9be, 0x9f0,
-0x9a4, 0x61, 0x7a, 0x259, 0x72, 0x62, 0x61, 0x79, 0x63, 0x61, 0x6e, 0x41, 0x7a, 0x259, 0x72, 0x62, 0x61, 0x79, 0x63, 0x61,
-0x6e, 0x430, 0x437, 0x4d9, 0x440, 0x431, 0x430, 0x458, 0x4b9, 0x430, 0x43d, 0x410, 0x437, 0x4d9, 0x440, 0x431, 0x430, 0x458, 0x4b9, 0x430,
-0x43d, 0x65, 0x75, 0x73, 0x6b, 0x61, 0x72, 0x61, 0x45, 0x73, 0x70, 0x61, 0x69, 0x6e, 0x69, 0x61, 0x9ac, 0x9be, 0x982, 0x9b2,
-0x9be, 0x9ac, 0x9be, 0x982, 0x9b2, 0x9be, 0x9a6, 0x9c7, 0x9b6, 0x9ad, 0x9be, 0x9b0, 0x9a4, 0xf62, 0xfab, 0xf7c, 0xf44, 0xf0b, 0xf41, 0xf60,
-0xf56, 0xfb2, 0xf74, 0xf42, 0x62, 0x72, 0x65, 0x7a, 0x68, 0x6f, 0x6e, 0x65, 0x67, 0x46, 0x72, 0x61, 0xf1, 0x73, 0x431, 0x44a,
-0x43b, 0x433, 0x430, 0x440, 0x441, 0x43a, 0x438, 0x411, 0x44a, 0x43b, 0x433, 0x430, 0x440, 0x438, 0x44f, 0x1019, 0x103c, 0x1014, 0x103a, 0x1019,
-0x102c, 0x431, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x43a, 0x430, 0x44f, 0x411, 0x435, 0x43b, 0x430, 0x440, 0x443, 0x441, 0x44c, 0x1781,
-0x17d2, 0x1798, 0x17c2, 0x179a, 0x1780, 0x1798, 0x17d2, 0x1796, 0x17bb, 0x1787, 0x17b6, 0x63, 0x61, 0x74, 0x61, 0x6c, 0xe0, 0x45, 0x73, 0x70,
-0x61, 0x6e, 0x79, 0x61, 0x41, 0x6e, 0x64, 0x6f, 0x72, 0x72, 0x61, 0x46, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x49, 0x74, 0xe0,
-0x6c, 0x69, 0x61, 0x7b80, 0x4f53, 0x4e2d, 0x6587, 0x4e2d, 0x56fd, 0x4e2d, 0x56fd, 0x9999, 0x6e2f, 0x7279, 0x522b, 0x884c, 0x653f, 0x533a, 0x4e2d, 0x56fd,
-0x6fb3, 0x95e8, 0x7279, 0x522b, 0x884c, 0x653f, 0x533a, 0x65b0, 0x52a0, 0x5761, 0x7e41, 0x9ad4, 0x4e2d, 0x6587, 0x4e2d, 0x570b, 0x9999, 0x6e2f, 0x7279, 0x5225,
-0x884c, 0x653f, 0x5340, 0x4e2d, 0x570b, 0x6fb3, 0x9580, 0x7279, 0x5225, 0x884c, 0x653f, 0x5340, 0x53f0, 0x7063, 0x68, 0x72, 0x76, 0x61, 0x74, 0x73,
-0x6b, 0x69, 0x48, 0x72, 0x76, 0x61, 0x74, 0x73, 0x6b, 0x61, 0x42, 0x6f, 0x73, 0x6e, 0x61, 0x20, 0x69, 0x20, 0x48, 0x65,
-0x72, 0x63, 0x65, 0x67, 0x6f, 0x76, 0x69, 0x6e, 0x61, 0x10d, 0x65, 0x161, 0x74, 0x69, 0x6e, 0x61, 0x10c, 0x65, 0x73, 0x6b,
-0x6f, 0x64, 0x61, 0x6e, 0x73, 0x6b, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x47, 0x72, 0xf8, 0x6e, 0x6c, 0x61, 0x6e,
-0x64, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64,
-0x41, 0x72, 0x75, 0x62, 0x61, 0x42, 0x65, 0x6c, 0x67, 0x69, 0xeb, 0x43, 0x75, 0x72, 0x61, 0xe7, 0x61, 0x6f, 0x53, 0x75,
-0x72, 0x69, 0x6e, 0x61, 0x6d, 0x65, 0x43, 0x61, 0x72, 0x69, 0x62, 0x69, 0x73, 0x63, 0x68, 0x20, 0x4e, 0x65, 0x64, 0x65,
-0x72, 0x6c, 0x61, 0x6e, 0x64, 0x53, 0x69, 0x6e, 0x74, 0x2d, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x65, 0x6e, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x6e, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20,
-0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x6e, 0x20, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x41, 0x6e, 0x67, 0x75, 0x69, 0x6c, 0x6c, 0x61, 0x41, 0x6e, 0x74, 0x69, 0x67,
-0x75, 0x61, 0x20, 0x26, 0x20, 0x42, 0x61, 0x72, 0x62, 0x75, 0x64, 0x61, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69,
-0x61, 0x6e, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x41,
-0x75, 0x73, 0x74, 0x72, 0x69, 0x61, 0x42, 0x61, 0x68, 0x61, 0x6d, 0x61, 0x73, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x6f,
-0x73, 0x42, 0x65, 0x6c, 0x67, 0x69, 0x75, 0x6d, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64,
-0x61, 0x42, 0x6f, 0x74, 0x73, 0x77, 0x61, 0x6e, 0x61, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68, 0x20, 0x49, 0x6e, 0x64,
-0x69, 0x61, 0x6e, 0x20, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x20, 0x54, 0x65, 0x72, 0x72, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42,
-0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x6f, 0x6f, 0x6e, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x69,
-0x61, 0x6e, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x43, 0x61, 0x79, 0x6d,
-0x61, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x43, 0x68, 0x72, 0x69, 0x73, 0x74, 0x6d, 0x61, 0x73, 0x20,
-0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x43, 0x6f, 0x63, 0x6f, 0x73, 0x20, 0x28, 0x4b, 0x65, 0x65, 0x6c, 0x69, 0x6e, 0x67,
-0x29, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x43, 0x6f, 0x6f, 0x6b, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64,
-0x73, 0x43, 0x79, 0x70, 0x72, 0x75, 0x73, 0x44, 0x65, 0x6e, 0x6d, 0x61, 0x72, 0x6b, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x69,
-0x63, 0x61, 0x45, 0x72, 0x69, 0x74, 0x72, 0x65, 0x61, 0x46, 0x61, 0x6c, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x49, 0x73,
-0x6c, 0x61, 0x6e, 0x64, 0x73, 0x46, 0x69, 0x6a, 0x69, 0x46, 0x69, 0x6e, 0x6c, 0x61, 0x6e, 0x64, 0x47, 0x75, 0x65, 0x72,
-0x6e, 0x73, 0x65, 0x79, 0x47, 0x61, 0x6d, 0x62, 0x69, 0x61, 0x47, 0x65, 0x72, 0x6d, 0x61, 0x6e, 0x79, 0x47, 0x68, 0x61,
-0x6e, 0x61, 0x47, 0x69, 0x62, 0x72, 0x61, 0x6c, 0x74, 0x61, 0x72, 0x47, 0x72, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x47, 0x75,
-0x61, 0x6d, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x48, 0x6f, 0x6e, 0x67, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x20, 0x53, 0x41,
-0x52, 0x20, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x49, 0x72, 0x65, 0x6c, 0x61, 0x6e, 0x64, 0x49,
-0x73, 0x72, 0x61, 0x65, 0x6c, 0x4a, 0x61, 0x6d, 0x61, 0x69, 0x63, 0x61, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x4b, 0x69, 0x72,
-0x69, 0x62, 0x61, 0x74, 0x69, 0x4c, 0x65, 0x73, 0x6f, 0x74, 0x68, 0x6f, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x61, 0x4d,
-0x61, 0x63, 0x61, 0x6f, 0x20, 0x53, 0x41, 0x52, 0x20, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x4d, 0x61, 0x64, 0x61, 0x67, 0x61,
-0x73, 0x63, 0x61, 0x72, 0x4d, 0x61, 0x6c, 0x61, 0x77, 0x69, 0x4d, 0x61, 0x6c, 0x61, 0x79, 0x73, 0x69, 0x61, 0x4d, 0x61,
-0x6c, 0x74, 0x61, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x6c, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x4d,
-0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x4d, 0x6f,
-0x6e, 0x74, 0x73, 0x65, 0x72, 0x72, 0x61, 0x74, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x4e, 0x61, 0x75, 0x72, 0x75,
-0x4e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65, 0x61, 0x6c, 0x61,
-0x6e, 0x64, 0x4e, 0x69, 0x67, 0x65, 0x72, 0x69, 0x61, 0x4e, 0x69, 0x75, 0x65, 0x4e, 0x6f, 0x72, 0x66, 0x6f, 0x6c, 0x6b,
-0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x65, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x72, 0x69,
-0x61, 0x6e, 0x61, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x50, 0x61, 0x6b, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x50,
-0x61, 0x6c, 0x61, 0x75, 0x50, 0x61, 0x70, 0x75, 0x61, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61,
-0x50, 0x68, 0x69, 0x6c, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x65, 0x73, 0x50, 0x69, 0x74, 0x63, 0x61, 0x69, 0x72, 0x6e, 0x20,
-0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x52, 0x69, 0x63, 0x6f, 0x52, 0x77,
-0x61, 0x6e, 0x64, 0x61, 0x53, 0x74, 0x2e, 0x20, 0x4b, 0x69, 0x74, 0x74, 0x73, 0x20, 0x26, 0x20, 0x4e, 0x65, 0x76, 0x69,
-0x73, 0x53, 0x74, 0x2e, 0x20, 0x4c, 0x75, 0x63, 0x69, 0x61, 0x53, 0x74, 0x2e, 0x20, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e,
-0x74, 0x20, 0x26, 0x20, 0x47, 0x72, 0x65, 0x6e, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x53, 0x61, 0x6d, 0x6f, 0x61, 0x53,
-0x65, 0x79, 0x63, 0x68, 0x65, 0x6c, 0x6c, 0x65, 0x73, 0x53, 0x69, 0x65, 0x72, 0x72, 0x61, 0x20, 0x4c, 0x65, 0x6f, 0x6e,
-0x65, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x69, 0x61, 0x53, 0x6f,
-0x6c, 0x6f, 0x6d, 0x6f, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41,
-0x66, 0x72, 0x69, 0x63, 0x61, 0x53, 0x74, 0x2e, 0x20, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x53, 0x75, 0x64, 0x61, 0x6e,
-0x45, 0x73, 0x77, 0x61, 0x74, 0x69, 0x6e, 0x69, 0x53, 0x77, 0x65, 0x64, 0x65, 0x6e, 0x53, 0x77, 0x69, 0x74, 0x7a, 0x65,
-0x72, 0x6c, 0x61, 0x6e, 0x64, 0x54, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x54, 0x6f, 0x6b, 0x65, 0x6c, 0x61, 0x75,
-0x54, 0x6f, 0x6e, 0x67, 0x61, 0x54, 0x72, 0x69, 0x6e, 0x69, 0x64, 0x61, 0x64, 0x20, 0x26, 0x20, 0x54, 0x6f, 0x62, 0x61,
-0x67, 0x6f, 0x54, 0x75, 0x72, 0x6b, 0x73, 0x20, 0x26, 0x20, 0x43, 0x61, 0x69, 0x63, 0x6f, 0x73, 0x20, 0x49, 0x73, 0x6c,
-0x61, 0x6e, 0x64, 0x73, 0x54, 0x75, 0x76, 0x61, 0x6c, 0x75, 0x55, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x55, 0x6e, 0x69, 0x74,
-0x65, 0x64, 0x20, 0x41, 0x72, 0x61, 0x62, 0x20, 0x45, 0x6d, 0x69, 0x72, 0x61, 0x74, 0x65, 0x73, 0x42, 0x72, 0x69, 0x74,
-0x69, 0x73, 0x68, 0x20, 0x45, 0x6e, 0x67, 0x6c, 0x69, 0x73, 0x68, 0x55, 0x6e, 0x69, 0x74, 0x65, 0x64, 0x20, 0x4b, 0x69,
-0x6e, 0x67, 0x64, 0x6f, 0x6d, 0x55, 0x2e, 0x53, 0x2e, 0x20, 0x4f, 0x75, 0x74, 0x6c, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x49,
-0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x56, 0x61, 0x6e, 0x75, 0x61, 0x74, 0x75, 0x42, 0x72, 0x69, 0x74, 0x69, 0x73, 0x68,
-0x20, 0x56, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x55, 0x2e, 0x53, 0x2e, 0x20,
-0x56, 0x69, 0x72, 0x67, 0x69, 0x6e, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x5a, 0x61, 0x6d, 0x62, 0x69, 0x61,
-0x5a, 0x69, 0x6d, 0x62, 0x61, 0x62, 0x77, 0x65, 0x44, 0x69, 0x65, 0x67, 0x6f, 0x20, 0x47, 0x61, 0x72, 0x63, 0x69, 0x61,
-0x49, 0x73, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x4d, 0x61, 0x6e, 0x4a, 0x65, 0x72, 0x73, 0x65, 0x79, 0x53, 0x6f, 0x75,
-0x74, 0x68, 0x20, 0x53, 0x75, 0x64, 0x61, 0x6e, 0x53, 0x69, 0x6e, 0x74, 0x20, 0x4d, 0x61, 0x61, 0x72, 0x74, 0x65, 0x6e,
-0x57, 0x6f, 0x72, 0x6c, 0x64, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x65, 0x73, 0x70, 0x65, 0x72, 0x61, 0x6e, 0x74, 0x6f,
-0x4d, 0x6f, 0x6e, 0x64, 0x6f, 0x65, 0x65, 0x73, 0x74, 0x69, 0x45, 0x65, 0x73, 0x74, 0x69, 0x66, 0xf8, 0x72, 0x6f, 0x79,
-0x73, 0x6b, 0x74, 0x46, 0xf8, 0x72, 0x6f, 0x79, 0x61, 0x72, 0x73, 0x75, 0x6f, 0x6d, 0x69, 0x53, 0x75, 0x6f, 0x6d, 0x69,
-0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x41, 0x6c, 0x67, 0xe9, 0x72, 0x69,
-0x65, 0x42, 0x65, 0x6c, 0x67, 0x69, 0x71, 0x75, 0x65, 0x42, 0xe9, 0x6e, 0x69, 0x6e, 0x42, 0x75, 0x72, 0x6b, 0x69, 0x6e,
-0x61, 0x20, 0x46, 0x61, 0x73, 0x6f, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x6f, 0x75, 0x6e, 0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61,
-0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x52, 0xe9, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x71, 0x75,
-0x65, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x66, 0x72, 0x69, 0x63, 0x61, 0x69, 0x6e, 0x65, 0x54, 0x63, 0x68, 0x61,
-0x64, 0x43, 0x6f, 0x6d, 0x6f, 0x72, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x67, 0x6f, 0x2d, 0x4b, 0x69, 0x6e, 0x73, 0x68, 0x61,
-0x73, 0x61, 0x43, 0x6f, 0x6e, 0x67, 0x6f, 0x2d, 0x42, 0x72, 0x61, 0x7a, 0x7a, 0x61, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x43,
-0xf4, 0x74, 0x65, 0x20, 0x64, 0x2019, 0x49, 0x76, 0x6f, 0x69, 0x72, 0x65, 0x44, 0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69,
-0x47, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x20, 0xe9, 0x71, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x61, 0x6c, 0x65, 0x47, 0x75,
-0x79, 0x61, 0x6e, 0x65, 0x20, 0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x65, 0x50, 0x6f, 0x6c, 0x79, 0x6e, 0xe9,
-0x73, 0x69, 0x65, 0x20, 0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x65, 0x47, 0x61, 0x62, 0x6f, 0x6e, 0x47, 0x75,
-0x61, 0x64, 0x65, 0x6c, 0x6f, 0x75, 0x70, 0x65, 0x47, 0x75, 0x69, 0x6e, 0xe9, 0x65, 0x48, 0x61, 0xef, 0x74, 0x69, 0x4c,
-0x75, 0x78, 0x65, 0x6d, 0x62, 0x6f, 0x75, 0x72, 0x67, 0x4d, 0x61, 0x6c, 0x69, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x69,
-0x71, 0x75, 0x65, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x65, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x63, 0x65,
-0x4d, 0x61, 0x79, 0x6f, 0x74, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x61, 0x63, 0x6f, 0x4d, 0x61, 0x72, 0x6f, 0x63, 0x4e, 0x6f,
-0x75, 0x76, 0x65, 0x6c, 0x6c, 0x65, 0x2d, 0x43, 0x61, 0x6c, 0xe9, 0x64, 0x6f, 0x6e, 0x69, 0x65, 0x4e, 0x69, 0x67, 0x65,
-0x72, 0x4c, 0x61, 0x20, 0x52, 0xe9, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x53, 0xe9, 0x6e, 0xe9, 0x67, 0x61, 0x6c, 0x53, 0x61,
-0x69, 0x6e, 0x74, 0x2d, 0x50, 0x69, 0x65, 0x72, 0x72, 0x65, 0x2d, 0x65, 0x74, 0x2d, 0x4d, 0x69, 0x71, 0x75, 0x65, 0x6c,
-0x6f, 0x6e, 0x66, 0x72, 0x61, 0x6e, 0xe7, 0x61, 0x69, 0x73, 0x20, 0x73, 0x75, 0x69, 0x73, 0x73, 0x65, 0x53, 0x75, 0x69,
-0x73, 0x73, 0x65, 0x53, 0x79, 0x72, 0x69, 0x65, 0x54, 0x6f, 0x67, 0x6f, 0x54, 0x75, 0x6e, 0x69, 0x73, 0x69, 0x65, 0x57,
-0x61, 0x6c, 0x6c, 0x69, 0x73, 0x2d, 0x65, 0x74, 0x2d, 0x46, 0x75, 0x74, 0x75, 0x6e, 0x61, 0x53, 0x61, 0x69, 0x6e, 0x74,
-0x2d, 0x42, 0x61, 0x72, 0x74, 0x68, 0xe9, 0x6c, 0x65, 0x6d, 0x79, 0x53, 0x61, 0x69, 0x6e, 0x74, 0x2d, 0x4d, 0x61, 0x72,
-0x74, 0x69, 0x6e, 0x46, 0x72, 0x79, 0x73, 0x6b, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0xe2, 0x6e, 0x47, 0xe0, 0x69, 0x64,
-0x68, 0x6c, 0x69, 0x67, 0x41, 0x6e, 0x20, 0x52, 0xec, 0x6f, 0x67, 0x68, 0x61, 0x63, 0x68, 0x64, 0x20, 0x41, 0x6f, 0x6e,
-0x61, 0x69, 0x63, 0x68, 0x74, 0x65, 0x67, 0x61, 0x6c, 0x65, 0x67, 0x6f, 0x45, 0x73, 0x70, 0x61, 0xf1, 0x61, 0x10e5, 0x10d0,
-0x10e0, 0x10d7, 0x10e3, 0x10da, 0x10d8, 0x10e1, 0x10d0, 0x10e5, 0x10d0, 0x10e0, 0x10d7, 0x10d5, 0x10d4, 0x10da, 0x10dd, 0x44, 0x65, 0x75, 0x74, 0x73,
-0x63, 0x68, 0x44, 0x65, 0x75, 0x74, 0x73, 0x63, 0x68, 0x6c, 0x61, 0x6e, 0x64, 0xd6, 0x73, 0x74, 0x65, 0x72, 0x72, 0x65,
-0x69, 0x63, 0x68, 0x69, 0x73, 0x63, 0x68, 0x65, 0x73, 0x20, 0x44, 0x65, 0x75, 0x74, 0x73, 0x63, 0x68, 0xd6, 0x73, 0x74,
-0x65, 0x72, 0x72, 0x65, 0x69, 0x63, 0x68, 0x42, 0x65, 0x6c, 0x67, 0x69, 0x65, 0x6e, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x65,
-0x6e, 0x4c, 0x69, 0x65, 0x63, 0x68, 0x74, 0x65, 0x6e, 0x73, 0x74, 0x65, 0x69, 0x6e, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62,
-0x75, 0x72, 0x67, 0x53, 0x63, 0x68, 0x77, 0x65, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x48, 0x6f, 0x63, 0x68, 0x64, 0x65, 0x75,
-0x74, 0x73, 0x63, 0x68, 0x53, 0x63, 0x68, 0x77, 0x65, 0x69, 0x7a, 0x395, 0x3bb, 0x3bb, 0x3b7, 0x3bd, 0x3b9, 0x3ba, 0x3ac, 0x395,
-0x3bb, 0x3bb, 0x3ac, 0x3b4, 0x3b1, 0x39a, 0x3cd, 0x3c0, 0x3c1, 0x3bf, 0x3c2, 0x6b, 0x61, 0x6c, 0x61, 0x61, 0x6c, 0x6c, 0x69, 0x73,
-0x75, 0x74, 0x4b, 0x61, 0x6c, 0x61, 0x61, 0x6c, 0x6c, 0x69, 0x74, 0x20, 0x4e, 0x75, 0x6e, 0x61, 0x61, 0x74, 0xa97, 0xac1,
-0xa9c, 0xab0, 0xabe, 0xaa4, 0xac0, 0xaad, 0xabe, 0xab0, 0xaa4, 0x48, 0x61, 0x75, 0x73, 0x61, 0x4e, 0x61, 0x6a, 0x65, 0x72, 0x69,
-0x79, 0x61, 0x47, 0x61, 0x6e, 0x61, 0x4e, 0x69, 0x6a, 0x61, 0x72, 0x5e2, 0x5d1, 0x5e8, 0x5d9, 0x5ea, 0x5d9, 0x5e9, 0x5e8, 0x5d0,
-0x5dc, 0x939, 0x93f, 0x928, 0x94d, 0x926, 0x940, 0x92d, 0x93e, 0x930, 0x924, 0x6d, 0x61, 0x67, 0x79, 0x61, 0x72, 0x4d, 0x61, 0x67,
-0x79, 0x61, 0x72, 0x6f, 0x72, 0x73, 0x7a, 0xe1, 0x67, 0xed, 0x73, 0x6c, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0xcd, 0x73, 0x6c,
-0x61, 0x6e, 0x64, 0x49, 0x6e, 0x64, 0x6f, 0x6e, 0x65, 0x73, 0x69, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x69, 0x6e,
-0x67, 0x75, 0x61, 0x4d, 0x75, 0x6e, 0x64, 0x6f, 0x47, 0x61, 0x65, 0x69, 0x6c, 0x67, 0x65, 0xc9, 0x69, 0x72, 0x65, 0x69,
-0x74, 0x61, 0x6c, 0x69, 0x61, 0x6e, 0x6f, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x61, 0x53, 0x61, 0x6e, 0x20, 0x4d, 0x61, 0x72,
-0x69, 0x6e, 0x6f, 0x53, 0x76, 0x69, 0x7a, 0x7a, 0x65, 0x72, 0x61, 0x43, 0x69, 0x74, 0x74, 0xe0, 0x20, 0x64, 0x65, 0x6c,
-0x20, 0x56, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6e, 0x6f, 0x65e5, 0x672c, 0x8a9e, 0x65e5, 0x672c, 0x4a, 0x61, 0x77, 0x61, 0x49, 0x6e,
-0x64, 0x6f, 0x6e, 0xe9, 0x73, 0x69, 0x61, 0xc95, 0xca8, 0xccd, 0xca8, 0xca1, 0xcad, 0xcbe, 0xcb0, 0xca4, 0x6a9, 0x672, 0x634, 0x64f,
-0x631, 0x6c1, 0x650, 0x646, 0x62f, 0x648, 0x633, 0x62a, 0x627, 0x646, 0x49b, 0x430, 0x437, 0x430, 0x49b, 0x20, 0x442, 0x456, 0x43b, 0x456,
-0x49a, 0x430, 0x437, 0x430, 0x49b, 0x441, 0x442, 0x430, 0x43d, 0x4b, 0x69, 0x6e, 0x79, 0x61, 0x72, 0x77, 0x61, 0x6e, 0x64, 0x61,
-0x55, 0x20, 0x52, 0x77, 0x61, 0x6e, 0x64, 0x61, 0x43a, 0x44b, 0x440, 0x433, 0x44b, 0x437, 0x447, 0x430, 0x41a, 0x44b, 0x440, 0x433,
-0x44b, 0x437, 0x441, 0x442, 0x430, 0x43d, 0xd55c, 0xad6d, 0xc5b4, 0xb300, 0xd55c, 0xbbfc, 0xad6d, 0xc870, 0xc120, 0xbbfc, 0xc8fc, 0xc8fc, 0xc758, 0xc778,
-0xbbfc, 0xacf5, 0xd654, 0xad6d, 0x6b, 0x75, 0x72, 0x64, 0xee, 0x54, 0x69, 0x72, 0x6b, 0x69, 0x79, 0x65, 0x49, 0x6b, 0x69, 0x72,
-0x75, 0x6e, 0x64, 0x69, 0x55, 0x62, 0x75, 0x72, 0x75, 0x6e, 0x64, 0x69, 0xea5, 0xeb2, 0xea7, 0x6c, 0x61, 0x74, 0x76, 0x69,
-0x65, 0x161, 0x75, 0x4c, 0x61, 0x74, 0x76, 0x69, 0x6a, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0xe1, 0x6c, 0x61, 0x52, 0x65, 0x70,
-0x75, 0x62, 0x6c, 0xed, 0x6b, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0xf3, 0x20, 0x44, 0x65, 0x6d, 0x6f,
-0x6b, 0x72, 0x61, 0x74, 0xed, 0x6b, 0x69, 0x41, 0x6e, 0x67, 0xf3, 0x6c, 0x61, 0x52, 0x65, 0x70, 0x69, 0x62, 0x69, 0x6b,
-0x69, 0x20, 0x79, 0x61, 0x20, 0x41, 0x66, 0x72, 0xed, 0x6b, 0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0xe1, 0x74, 0x69, 0x4b,
-0x6f, 0x6e, 0x67, 0x6f, 0x6c, 0x69, 0x65, 0x74, 0x75, 0x76, 0x69, 0x173, 0x4c, 0x69, 0x65, 0x74, 0x75, 0x76, 0x61, 0x43c,
-0x430, 0x43a, 0x435, 0x434, 0x43e, 0x43d, 0x441, 0x43a, 0x438, 0x421, 0x435, 0x432, 0x435, 0x440, 0x43d, 0x430, 0x20, 0x41c, 0x430, 0x43a,
-0x435, 0x434, 0x43e, 0x43d, 0x438, 0x458, 0x430, 0x4d, 0x61, 0x6c, 0x61, 0x67, 0x61, 0x73, 0x79, 0x4d, 0x61, 0x64, 0x61, 0x67,
-0x61, 0x73, 0x69, 0x6b, 0x61, 0x72, 0x61, 0x4d, 0x65, 0x6c, 0x61, 0x79, 0x75, 0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x53,
-0x69, 0x6e, 0x67, 0x61, 0x70, 0x75, 0x72, 0x61, 0xd2e, 0xd32, 0xd2f, 0xd3e, 0xd33, 0xd02, 0xd07, 0xd28, 0xd4d, 0xd24, 0xd4d, 0xd2f,
-0x4d, 0x61, 0x6c, 0x74, 0x69, 0x4d, 0x101, 0x6f, 0x72, 0x69, 0x41, 0x6f, 0x74, 0x65, 0x61, 0x72, 0x6f, 0x61, 0x92e, 0x930,
-0x93e, 0x920, 0x940, 0x43c, 0x43e, 0x43d, 0x433, 0x43e, 0x43b, 0x41c, 0x43e, 0x43d, 0x433, 0x43e, 0x43b, 0x928, 0x947, 0x92a, 0x93e, 0x932,
-0x940, 0x928, 0x947, 0x92a, 0x93e, 0x932, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x20, 0x62, 0x6f, 0x6b, 0x6d, 0xe5, 0x6c, 0x4e, 0x6f,
-0x72, 0x67, 0x65, 0x53, 0x76, 0x61, 0x6c, 0x62, 0x61, 0x72, 0x64, 0x20, 0x6f, 0x67, 0x20, 0x4a, 0x61, 0x6e, 0x20, 0x4d,
-0x61, 0x79, 0x65, 0x6e, 0xb13, 0xb21, 0xb3c, 0xb3f, 0xb06, 0xb2d, 0xb3e, 0xb30, 0xb24, 0x67e, 0x69a, 0x62a, 0x648, 0x627, 0x641, 0x63a,
-0x627, 0x646, 0x633, 0x62a, 0x627, 0x646, 0x67e, 0x627, 0x6a9, 0x633, 0x62a, 0x627, 0x646, 0x641, 0x627, 0x631, 0x633, 0x6cc, 0x627, 0x6cc,
-0x631, 0x627, 0x646, 0x62f, 0x631, 0x6cc, 0x70, 0x6f, 0x6c, 0x73, 0x6b, 0x69, 0x50, 0x6f, 0x6c, 0x73, 0x6b, 0x61, 0x70, 0x6f,
-0x72, 0x74, 0x75, 0x67, 0x75, 0xea, 0x73, 0x42, 0x72, 0x61, 0x73, 0x69, 0x6c, 0x41, 0x6e, 0x67, 0x6f, 0x6c, 0x61, 0x43,
-0x61, 0x62, 0x6f, 0x20, 0x56, 0x65, 0x72, 0x64, 0x65, 0x54, 0x69, 0x6d, 0x6f, 0x72, 0x2d, 0x4c, 0x65, 0x73, 0x74, 0x65,
-0x47, 0x75, 0x69, 0x6e, 0xe9, 0x20, 0x45, 0x71, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x61, 0x6c, 0x47, 0x75, 0x69, 0x6e,
-0xe9, 0x2d, 0x42, 0x69, 0x73, 0x73, 0x61, 0x75, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62, 0x75, 0x72, 0x67, 0x6f, 0x4d, 0x61,
-0x63, 0x61, 0x75, 0x2c, 0x20, 0x52, 0x41, 0x45, 0x20, 0x64, 0x61, 0x20, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x4d, 0x6f, 0xe7,
-0x61, 0x6d, 0x62, 0x69, 0x71, 0x75, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x75, 0x67, 0x75, 0xea, 0x73, 0x20, 0x65, 0x75, 0x72,
-0x6f, 0x70, 0x65, 0x75, 0x50, 0x6f, 0x72, 0x74, 0x75, 0x67, 0x61, 0x6c, 0x53, 0xe3, 0x6f, 0x20, 0x54, 0x6f, 0x6d, 0xe9,
-0x20, 0x65, 0x20, 0x50, 0x72, 0xed, 0x6e, 0x63, 0x69, 0x70, 0x65, 0x53, 0x75, 0xed, 0xe7, 0x61, 0xa2a, 0xa70, 0xa1c, 0xa3e,
-0xa2c, 0xa40, 0xa2d, 0xa3e, 0xa30, 0xa24, 0x67e, 0x646, 0x62c, 0x627, 0x628, 0x6cc, 0x52, 0x75, 0x6e, 0x61, 0x73, 0x69, 0x6d, 0x69,
-0x50, 0x65, 0x72, 0xfa, 0x42, 0x6f, 0x6c, 0x69, 0x76, 0x69, 0x61, 0x45, 0x63, 0x75, 0x61, 0x64, 0x6f, 0x72, 0x72, 0x75,
-0x6d, 0x61, 0x6e, 0x74, 0x73, 0x63, 0x68, 0x53, 0x76, 0x69, 0x7a, 0x72, 0x61, 0x72, 0x6f, 0x6d, 0xe2, 0x6e, 0x103, 0x52,
-0x6f, 0x6d, 0xe2, 0x6e, 0x69, 0x61, 0x52, 0x65, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x20, 0x4d, 0x6f, 0x6c, 0x64,
-0x6f, 0x76, 0x61, 0x440, 0x443, 0x441, 0x441, 0x43a, 0x438, 0x439, 0x420, 0x43e, 0x441, 0x441, 0x438, 0x44f, 0x41a, 0x430, 0x437, 0x430,
-0x445, 0x441, 0x442, 0x430, 0x43d, 0x41a, 0x438, 0x440, 0x433, 0x438, 0x437, 0x438, 0x44f, 0x41c, 0x43e, 0x43b, 0x434, 0x43e, 0x432, 0x430,
-0x423, 0x43a, 0x440, 0x430, 0x438, 0x43d, 0x430, 0x53, 0xe4, 0x6e, 0x67, 0xf6, 0x4b, 0xf6, 0x64, 0xf6, 0x72, 0xf6, 0x73, 0xea,
-0x73, 0x65, 0x20, 0x74, 0xee, 0x20, 0x42, 0xea, 0x61, 0x66, 0x72, 0xee, 0x6b, 0x61, 0x441, 0x440, 0x43f, 0x441, 0x43a, 0x438,
-0x421, 0x440, 0x431, 0x438, 0x458, 0x430, 0x73, 0x72, 0x70, 0x73, 0x6b, 0x69, 0x43, 0x72, 0x6e, 0x61, 0x20, 0x47, 0x6f, 0x72,
-0x61, 0x53, 0x72, 0x62, 0x69, 0x6a, 0x61, 0x411, 0x43e, 0x441, 0x43d, 0x430, 0x20, 0x438, 0x20, 0x425, 0x435, 0x440, 0x446, 0x435,
-0x433, 0x43e, 0x432, 0x438, 0x43d, 0x430, 0x426, 0x440, 0x43d, 0x430, 0x20, 0x413, 0x43e, 0x440, 0x430, 0x41a, 0x43e, 0x441, 0x43e, 0x432,
-0x43e, 0x4b, 0x6f, 0x73, 0x6f, 0x76, 0x6f, 0x438, 0x440, 0x43e, 0x43d, 0x413, 0x443, 0x44b, 0x440, 0x434, 0x437, 0x44b, 0x441, 0x442,
-0x43e, 0x43d, 0x423, 0x4d5, 0x440, 0x4d5, 0x441, 0x435, 0x63, 0x68, 0x69, 0x53, 0x68, 0x6f, 0x6e, 0x61, 0x633, 0x646, 0x68c, 0x64a,
-0x67e, 0x627, 0x6aa, 0x633, 0x62a, 0x627, 0x646, 0xdc3, 0xdd2, 0xd82, 0xdc4, 0xdbd, 0xdc1, 0xdca, 0x200d, 0xdbb, 0xdd3, 0x20, 0xdbd, 0xd82,
-0xd9a, 0xdcf, 0xdc0, 0x73, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x10d, 0x69, 0x6e, 0x61, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x73,
-0x6b, 0x6f, 0x73, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x161, 0x10d, 0x69, 0x6e, 0x61, 0x53, 0x6c, 0x6f, 0x76, 0x65, 0x6e, 0x69,
-0x6a, 0x61, 0x53, 0x6f, 0x6f, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x53, 0x6f, 0x6f, 0x6d, 0x61, 0x61, 0x6c, 0x69, 0x79, 0x61,
-0x4a, 0x61, 0x62, 0x75, 0x75, 0x74, 0x69, 0x49, 0x74, 0x6f, 0x6f, 0x62, 0x69, 0x79, 0x61, 0x65, 0x73, 0x70, 0x61, 0xf1,
-0x6f, 0x6c, 0x20, 0x64, 0x65, 0x20, 0x45, 0x73, 0x70, 0x61, 0xf1, 0x61, 0x65, 0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c, 0x41,
-0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x42, 0x65, 0x6c, 0x69, 0x63, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x65, 0x43,
-0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x69, 0x61, 0x43, 0x6f, 0x73, 0x74, 0x61, 0x20, 0x52, 0x69, 0x63, 0x61, 0x43, 0x75, 0x62,
-0x61, 0x52, 0x65, 0x70, 0xfa, 0x62, 0x6c, 0x69, 0x63, 0x61, 0x20, 0x44, 0x6f, 0x6d, 0x69, 0x6e, 0x69, 0x63, 0x61, 0x6e,
-0x61, 0x45, 0x6c, 0x20, 0x53, 0x61, 0x6c, 0x76, 0x61, 0x64, 0x6f, 0x72, 0x47, 0x75, 0x69, 0x6e, 0x65, 0x61, 0x20, 0x45,
-0x63, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x61, 0x6c, 0x47, 0x75, 0x61, 0x74, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x48, 0x6f,
-0x6e, 0x64, 0x75, 0x72, 0x61, 0x73, 0x65, 0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x20, 0x4d, 0xe9, 0x78,
-0x69, 0x63, 0x6f, 0x4d, 0xe9, 0x78, 0x69, 0x63, 0x6f, 0x4e, 0x69, 0x63, 0x61, 0x72, 0x61, 0x67, 0x75, 0x61, 0x50, 0x61,
-0x6e, 0x61, 0x6d, 0xe1, 0x50, 0x61, 0x72, 0x61, 0x67, 0x75, 0x61, 0x79, 0x46, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x61,
-0x73, 0x45, 0x73, 0x74, 0x61, 0x64, 0x6f, 0x73, 0x20, 0x55, 0x6e, 0x69, 0x64, 0x6f, 0x73, 0x55, 0x72, 0x75, 0x67, 0x75,
-0x61, 0x79, 0x56, 0x65, 0x6e, 0x65, 0x7a, 0x75, 0x65, 0x6c, 0x61, 0x43, 0x61, 0x6e, 0x61, 0x72, 0x69, 0x61, 0x73, 0x65,
-0x73, 0x70, 0x61, 0xf1, 0x6f, 0x6c, 0x20, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x6f, 0x61, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x6e, 0x6f, 0x4c, 0x61, 0x74, 0x69, 0x6e, 0x6f, 0x61, 0x6d, 0xe9, 0x72, 0x69, 0x63, 0x61, 0x43, 0x65, 0x75, 0x74, 0x61,
-0x20, 0x79, 0x20, 0x4d, 0x65, 0x6c, 0x69, 0x6c, 0x6c, 0x61, 0x4b, 0x69, 0x73, 0x77, 0x61, 0x68, 0x69, 0x6c, 0x69, 0x4a,
-0x61, 0x6d, 0x68, 0x75, 0x72, 0x69, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x69, 0x64, 0x65, 0x6d, 0x6f, 0x6b, 0x72, 0x61, 0x73,
-0x69, 0x61, 0x20, 0x79, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x6f, 0x73, 0x76, 0x65, 0x6e, 0x73, 0x6b, 0x61, 0x53, 0x76,
-0x65, 0x72, 0x69, 0x67, 0x65, 0xc5, 0x6c, 0x61, 0x6e, 0x64, 0x442, 0x43e, 0x4b7, 0x438, 0x43a, 0x4e3, 0x422, 0x43e, 0x4b7, 0x438,
-0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0xba4, 0xbae, 0xbbf, 0xbb4, 0xbcd, 0xb87, 0xba8, 0xbcd, 0xba4, 0xbbf, 0xbaf, 0xbbe, 0xbae, 0xbb2,
-0xbc7, 0xb9a, 0xbbf, 0xbaf, 0xbbe, 0xb9a, 0xbbf, 0xb99, 0xbcd, 0xb95, 0xbaa, 0xbcd, 0xbaa, 0xbc2, 0xbb0, 0xbcd, 0xb87, 0xbb2, 0xb99, 0xbcd,
-0xb95, 0xbc8, 0x442, 0x430, 0x442, 0x430, 0x440, 0xc24, 0xc46, 0xc32, 0xc41, 0xc17, 0xc41, 0xc2d, 0xc3e, 0xc30, 0xc24, 0xc26, 0xc47, 0xc36,
-0xc02, 0xe44, 0xe17, 0xe22, 0xf56, 0xf7c, 0xf51, 0xf0b, 0xf66, 0xf90, 0xf51, 0xf0b, 0xf62, 0xf92, 0xfb1, 0xf0b, 0xf53, 0xf42, 0xf62, 0xf92,
-0xfb1, 0xf0b, 0xf42, 0xf62, 0xf0b, 0x1275, 0x130d, 0x122d, 0x129b, 0x12a4, 0x122d, 0x1275, 0x122b, 0x6c, 0x65, 0x61, 0x20, 0x66, 0x61, 0x6b,
-0x61, 0x74, 0x6f, 0x6e, 0x67, 0x61, 0x54, 0xfc, 0x72, 0x6b, 0xe7, 0x65, 0x54, 0xfc, 0x72, 0x6b, 0x69, 0x79, 0x65, 0x4b,
-0x131, 0x62, 0x72, 0x131, 0x73, 0x74, 0xfc, 0x72, 0x6b, 0x6d, 0x65, 0x6e, 0x20, 0x64, 0x69, 0x6c, 0x69, 0x54, 0xfc, 0x72,
-0x6b, 0x6d, 0x65, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x626, 0x6c7, 0x64a, 0x63a, 0x6c7, 0x631, 0x686, 0x6d5, 0x62c, 0x6c7, 0x6ad,
-0x6af, 0x648, 0x443, 0x43a, 0x440, 0x430, 0x457, 0x43d, 0x441, 0x44c, 0x43a, 0x430, 0x423, 0x43a, 0x440, 0x430, 0x457, 0x43d, 0x430, 0x627,
-0x631, 0x62f, 0x648, 0x628, 0x6be, 0x627, 0x631, 0x62a, 0x6f, 0x2018, 0x7a, 0x62, 0x65, 0x6b, 0x4f, 0x2bb, 0x7a, 0x62, 0x65, 0x6b,
-0x69, 0x73, 0x74, 0x6f, 0x6e, 0x627, 0x648, 0x632, 0x628, 0x6cc, 0x6a9, 0x45e, 0x437, 0x431, 0x435, 0x43a, 0x447, 0x430, 0x40e, 0x437,
-0x431, 0x435, 0x43a, 0x438, 0x441, 0x442, 0x43e, 0x43d, 0x54, 0x69, 0x1ebf, 0x6e, 0x67, 0x20, 0x56, 0x69, 0x1ec7, 0x74, 0x56, 0x69,
-0x1ec7, 0x74, 0x20, 0x4e, 0x61, 0x6d, 0x56, 0x6f, 0x6c, 0x61, 0x70, 0xfc, 0x6b, 0x43, 0x79, 0x6d, 0x72, 0x61, 0x65, 0x67,
-0x59, 0x20, 0x44, 0x65, 0x79, 0x72, 0x6e, 0x61, 0x73, 0x20, 0x55, 0x6e, 0x65, 0x64, 0x69, 0x67, 0x57, 0x6f, 0x6c, 0x6f,
-0x66, 0x53, 0x65, 0x6e, 0x65, 0x67, 0x61, 0x61, 0x6c, 0x69, 0x73, 0x69, 0x58, 0x68, 0x6f, 0x73, 0x61, 0x65, 0x4d, 0x7a,
-0x61, 0x6e, 0x74, 0x73, 0x69, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x5d9, 0x5d9, 0x5b4, 0x5d3, 0x5d9, 0x5e9, 0x5d5, 0x5d5,
-0x5e2, 0x5dc, 0x5d8, 0xc8, 0x64, 0xe8, 0x20, 0x59, 0x6f, 0x72, 0xf9, 0x62, 0xe1, 0x4f, 0x72, 0x69, 0x6c, 0x1eb9, 0x300, 0x2d,
-0xe8, 0x64, 0xe8, 0x20, 0x4e, 0xe0, 0xec, 0x6a, 0xed, 0x72, 0xed, 0xe0, 0x4f, 0x72, 0xed, 0x6c, 0x25b, 0x301, 0xe8, 0x64,
-0x65, 0x20, 0x42, 0x25b, 0x300, 0x6e, 0x25b, 0x300, 0x69, 0x73, 0x69, 0x5a, 0x75, 0x6c, 0x75, 0x69, 0x4e, 0x69, 0x6e, 0x67,
-0x69, 0x7a, 0x69, 0x6d, 0x75, 0x20, 0x41, 0x66, 0x72, 0x69, 0x6b, 0x61, 0x6e, 0x79, 0x6e, 0x6f, 0x72, 0x73, 0x6b, 0x4e,
-0x6f, 0x72, 0x65, 0x67, 0x62, 0x6f, 0x73, 0x61, 0x6e, 0x73, 0x6b, 0x69, 0x431, 0x43e, 0x441, 0x430, 0x43d, 0x441, 0x43a, 0x438,
-0x47, 0x61, 0x65, 0x6c, 0x67, 0x45, 0x6c, 0x6c, 0x61, 0x6e, 0x20, 0x56, 0x61, 0x6e, 0x6e, 0x69, 0x6e, 0x6b, 0x65, 0x72,
-0x6e, 0x65, 0x77, 0x65, 0x6b, 0x52, 0x79, 0x77, 0x76, 0x61, 0x6e, 0x65, 0x74, 0x68, 0x20, 0x55, 0x6e, 0x79, 0x73, 0x41,
-0x6b, 0x61, 0x6e, 0x47, 0x61, 0x61, 0x6e, 0x61, 0x915, 0x94b, 0x902, 0x915, 0x923, 0x940, 0x41, 0x73, 0x1ee5, 0x73, 0x1ee5, 0x20,
-0x49, 0x67, 0x62, 0x6f, 0x4e, 0x61, 0x1ecb, 0x6a, 0x1ecb, 0x72, 0x1ecb, 0x61, 0x4b, 0x69, 0x6b, 0x61, 0x6d, 0x62, 0x61, 0x66,
-0x75, 0x72, 0x6c, 0x61, 0x6e, 0x49, 0x74, 0x61, 0x6c, 0x69, 0x65, 0x45, 0x28b, 0x65, 0x67, 0x62, 0x65, 0x47, 0x68, 0x61,
-0x6e, 0x61, 0x20, 0x6e, 0x75, 0x74, 0x6f, 0x6d, 0x65, 0x54, 0x6f, 0x67, 0x6f, 0x20, 0x6e, 0x75, 0x74, 0x6f, 0x6d, 0x65,
-0x2bb, 0x14c, 0x6c, 0x65, 0x6c, 0x6f, 0x20, 0x48, 0x61, 0x77, 0x61, 0x69, 0x2bb, 0x69, 0x2bb, 0x41, 0x6d, 0x65, 0x6c, 0x69,
-0x6b, 0x61, 0x20, 0x48, 0x75, 0x69, 0x20, 0x50, 0x16b, 0x20, 0x2bb, 0x49, 0x61, 0x46, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e,
-0x6f, 0x50, 0x69, 0x6c, 0x69, 0x70, 0x69, 0x6e, 0x61, 0x73, 0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x65, 0x72, 0x74,
-0xfc, 0xfc, 0x74, 0x73, 0x63, 0x68, 0x53, 0x63, 0x68, 0x77, 0x69, 0x69, 0x7a, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x72, 0x69,
-0x69, 0x63, 0x68, 0x4c, 0x69, 0xe4, 0x63, 0x68, 0x74, 0x65, 0x73, 0x63, 0x68, 0x74, 0xe4, 0x69, 0xa188, 0xa320, 0xa259, 0xa34f,
-0xa1e9, 0x4e, 0x65, 0x64, 0x64, 0x65, 0x72, 0x73, 0x61, 0x73, 0x73, 0x2019, 0x73, 0x63, 0x68, 0x44, 0xfc, 0xfc, 0x74, 0x73,
-0x63, 0x68, 0x6c, 0x61, 0x6e, 0x64, 0x4e, 0x65, 0x64, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x6e, 0x64, 0x61,
-0x76, 0x76, 0x69, 0x73, 0xe1, 0x6d, 0x65, 0x67, 0x69, 0x65, 0x6c, 0x6c, 0x61, 0x4e, 0x6f, 0x72, 0x67, 0x61, 0x53, 0x75,
-0x6f, 0x70, 0x6d, 0x61, 0x52, 0x75, 0x6f, 0x167, 0x167, 0x61, 0x45, 0x6b, 0x65, 0x67, 0x75, 0x73, 0x69, 0x69, 0x4b, 0x69,
-0x74, 0x61, 0x69, 0x74, 0x61, 0x50, 0x75, 0x6c, 0x61, 0x61, 0x72, 0x42, 0x75, 0x72, 0x6b, 0x69, 0x62, 0x61, 0x61, 0x20,
-0x46, 0x61, 0x61, 0x73, 0x6f, 0x4b, 0x61, 0x6d, 0x65, 0x72, 0x75, 0x75, 0x6e, 0x47, 0x61, 0x6d, 0x6d, 0x62, 0x69, 0x47,
-0x61, 0x6e, 0x61, 0x61, 0x47, 0x69, 0x6e, 0x65, 0x47, 0x69, 0x6e, 0x65, 0x2d, 0x42, 0x69, 0x73, 0x61, 0x61, 0x77, 0x6f,
-0x4c, 0x69, 0x62, 0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x4d, 0x75, 0x72, 0x69, 0x74, 0x61, 0x6e, 0x69, 0x4e, 0x69, 0x6a,
-0x65, 0x65, 0x72, 0x4e, 0x69, 0x6a, 0x65, 0x72, 0x69, 0x79, 0x61, 0x61, 0x53, 0x65, 0x72, 0x61, 0x61, 0x20, 0x6c, 0x69,
-0x79, 0x6f, 0x6e, 0x47, 0x69, 0x6b, 0x75, 0x79, 0x75, 0x4b, 0x69, 0x73, 0x61, 0x6d, 0x70, 0x75, 0x72, 0x73, 0x65, 0x6e,
-0x61, 0x69, 0x73, 0x69, 0x4e, 0x64, 0x65, 0x62, 0x65, 0x6c, 0x65, 0x4b, 0x69, 0x68, 0x6f, 0x72, 0x6f, 0x6d, 0x62, 0x6f,
-0x2d5c, 0x2d30, 0x2d5b, 0x2d4d, 0x2d43, 0x2d49, 0x2d5c, 0x2d4d, 0x2d4e, 0x2d56, 0x2d54, 0x2d49, 0x2d31, 0x54, 0x61, 0x73, 0x68, 0x65, 0x6c, 0x1e25,
-0x69, 0x79, 0x74, 0x6c, 0x6d, 0x263, 0x72, 0x69, 0x62, 0x54, 0x61, 0x71, 0x62, 0x61, 0x79, 0x6c, 0x69, 0x74, 0x4c, 0x65,
-0x7a, 0x7a, 0x61, 0x79, 0x65, 0x72, 0x52, 0x75, 0x6e, 0x79, 0x61, 0x6e, 0x6b, 0x6f, 0x72, 0x65, 0x48, 0x69, 0x62, 0x65,
-0x6e, 0x61, 0x48, 0x75, 0x74, 0x61, 0x6e, 0x7a, 0x61, 0x6e, 0x69, 0x61, 0x4b, 0x79, 0x69, 0x76, 0x75, 0x6e, 0x6a, 0x6f,
-0x62, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x6b, 0x61, 0x6e, 0x4b, 0x129, 0x65, 0x6d, 0x62, 0x75, 0x13e3, 0x13b3, 0x13a9, 0x13cc, 0x13ca,
-0x20, 0x13a2, 0x13f3, 0x13be, 0x13b5, 0x13cd, 0x13d4, 0x13c5, 0x20, 0x13cd, 0x13a6, 0x13da, 0x13a9, 0x6b, 0x72, 0x65, 0x6f, 0x6c, 0x20, 0x6d,
-0x6f, 0x72, 0x69, 0x73, 0x69, 0x65, 0x6e, 0x4d, 0x6f, 0x72, 0x69, 0x73, 0x43, 0x68, 0x69, 0x6d, 0x61, 0x6b, 0x6f, 0x6e,
-0x64, 0x65, 0x4b, 0x268, 0x6c, 0x61, 0x61, 0x6e, 0x67, 0x69, 0x54, 0x61, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0xed, 0x61, 0x4c,
-0x75, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x59, 0x75, 0x67, 0x61, 0x6e, 0x64, 0x61, 0x49, 0x63, 0x68, 0x69, 0x62, 0x65, 0x6d,
-0x62, 0x61, 0x6b, 0x61, 0x62, 0x75, 0x76, 0x65, 0x72, 0x64, 0x69, 0x61, 0x6e, 0x75, 0x4b, 0x61, 0x62, 0x75, 0x20, 0x56,
-0x65, 0x72, 0x64, 0x69, 0x4b, 0x129, 0x6d, 0x129, 0x72, 0x169, 0x4b, 0x61, 0x6c, 0x65, 0x6e, 0x6a, 0x69, 0x6e, 0x45, 0x6d,
-0x65, 0x74, 0x61, 0x62, 0x20, 0x4b, 0x65, 0x6e, 0x79, 0x61, 0x4b, 0x68, 0x6f, 0x65, 0x6b, 0x68, 0x6f, 0x65, 0x67, 0x6f,
-0x77, 0x61, 0x62, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x62, 0x4b, 0x69, 0x6d, 0x61, 0x63, 0x68, 0x61, 0x6d, 0x65,
-0x4b, 0xf6, 0x6c, 0x73, 0x63, 0x68, 0x44, 0x6f, 0xfc, 0x74, 0x73, 0x63, 0x68, 0x6c, 0x61, 0x6e, 0x64, 0x4d, 0x61, 0x61,
-0x54, 0x61, 0x6e, 0x73, 0x61, 0x6e, 0x69, 0x61, 0x4f, 0x6c, 0x75, 0x73, 0x6f, 0x67, 0x61, 0x4c, 0x75, 0x6c, 0x75, 0x68,
-0x69, 0x61, 0x4b, 0x69, 0x70, 0x61, 0x72, 0x65, 0x54, 0x61, 0x64, 0x68, 0x61, 0x6e, 0x69, 0x61, 0x4b, 0x69, 0x74, 0x65,
-0x73, 0x6f, 0x4b, 0x65, 0x6e, 0x69, 0x61, 0x4b, 0x6f, 0x79, 0x72, 0x61, 0x20, 0x63, 0x69, 0x69, 0x6e, 0x69, 0x4d, 0x61,
-0x61, 0x6c, 0x69, 0x4b, 0x69, 0x72, 0x75, 0x77, 0x61, 0x44, 0x68, 0x6f, 0x6c, 0x75, 0x6f, 0x52, 0x75, 0x6b, 0x69, 0x67,
-0x61, 0x54, 0x61, 0x6d, 0x61, 0x7a, 0x69, 0x263, 0x74, 0x20, 0x6e, 0x20, 0x6c, 0x61, 0x1e6d, 0x6c, 0x61, 0x1e63, 0x4d, 0x65,
-0x1e5b, 0x1e5b, 0x75, 0x6b, 0x4b, 0x6f, 0x79, 0x72, 0x61, 0x62, 0x6f, 0x72, 0x6f, 0x20, 0x73, 0x65, 0x6e, 0x6e, 0x69, 0x4b,
-0x69, 0x73, 0x68, 0x61, 0x6d, 0x62, 0x61, 0x61, 0x92c, 0x921, 0x93c, 0x94b, 0x43d, 0x43e, 0x445, 0x447, 0x438, 0x439, 0x43d, 0x420,
-0x43e, 0x441, 0x441, 0x438, 0x446, 0x435, 0x440, 0x43a, 0x43e, 0x432, 0x43d, 0x43e, 0x441, 0x43b, 0x43e, 0x432, 0x435, 0x301, 0x43d, 0x441,
-0x43a, 0x457, 0x439, 0x440, 0x461, 0x441, 0x441, 0x456, 0x301, 0x430, 0x54, 0x73, 0x68, 0x69, 0x6c, 0x75, 0x62, 0x61, 0x44, 0x69,
-0x74, 0x75, 0x6e, 0x67, 0x61, 0x20, 0x77, 0x61, 0x20, 0x4b, 0x6f, 0x6e, 0x67, 0x75, 0x4c, 0xeb, 0x74, 0x7a, 0x65, 0x62,
-0x75, 0x65, 0x72, 0x67, 0x65, 0x73, 0x63, 0x68, 0x4c, 0xeb, 0x74, 0x7a, 0x65, 0x62, 0x75, 0x65, 0x72, 0x67, 0x41, 0x67,
-0x68, 0x65, 0x6d, 0x4b, 0xe0, 0x6d, 0xe0, 0x6c, 0xfb, 0x14b, 0x181, 0xe0, 0x73, 0xe0, 0x61, 0x4b, 0xe0, 0x6d, 0x25b, 0x300,
-0x72, 0xfb, 0x6e, 0x5a, 0x61, 0x72, 0x6d, 0x61, 0x63, 0x69, 0x69, 0x6e, 0x65, 0x4e, 0x69, 0x17e, 0x65, 0x72, 0x64, 0x75,
-0xe1, 0x6c, 0xe1, 0x6a, 0x6f, 0x6f, 0x6c, 0x61, 0x53, 0x65, 0x6e, 0x65, 0x67, 0x61, 0x6c, 0x65, 0x77, 0x6f, 0x6e, 0x64,
-0x6f, 0x4b, 0x61, 0x6d, 0x259, 0x72, 0xfa, 0x6e, 0x72, 0x69, 0x6b, 0x70, 0x61, 0x6b, 0x61, 0x6d, 0x25b, 0x72, 0xfa, 0x6e,
-0x4d, 0x61, 0x6b, 0x75, 0x61, 0x55, 0x6d, 0x6f, 0x7a, 0x61, 0x6d, 0x62, 0x69, 0x6b, 0x69, 0x4d, 0x55, 0x4e, 0x44, 0x41,
-0x14a, 0x6b, 0x61, 0x6d, 0x65, 0x72, 0x75, 0x14b, 0x4b, 0x77, 0x61, 0x73, 0x69, 0x6f, 0x4b, 0x61, 0x6d, 0x65, 0x72, 0x75,
-0x6e, 0x54, 0x68, 0x6f, 0x6b, 0x20, 0x4e, 0x61, 0x74, 0x68, 0x441, 0x430, 0x445, 0x430, 0x20, 0x442, 0x44b, 0x43b, 0x430, 0x410,
-0x440, 0x430, 0x441, 0x441, 0x44b, 0x44b, 0x439, 0x430, 0x49, 0x73, 0x68, 0x69, 0x73, 0x61, 0x6e, 0x67, 0x75, 0x54, 0x61, 0x6e,
-0x73, 0x61, 0x6e, 0x69, 0x79, 0x61, 0x54, 0x61, 0x73, 0x61, 0x77, 0x61, 0x71, 0x20, 0x73, 0x65, 0x6e, 0x6e, 0x69, 0xa559,
-0xa524, 0xa55e, 0xa524, 0xa52b, 0xa569, 0x56, 0x61, 0x69, 0x4c, 0x61, 0x69, 0x62, 0x68, 0x69, 0x79, 0x61, 0x57, 0x61, 0x6c, 0x73,
-0x65, 0x72, 0x53, 0x63, 0x68, 0x77, 0x69, 0x7a, 0x6e, 0x75, 0x61, 0x73, 0x75, 0x65, 0x4b, 0x65, 0x6d, 0x65, 0x6c, 0xfa,
-0x6e, 0x61, 0x73, 0x74, 0x75, 0x72, 0x69, 0x61, 0x6e, 0x75, 0x4e, 0x64, 0x61, 0xa78c, 0x61, 0x4b, 0x61, 0x6d, 0x25b, 0x6c,
-0xfb, 0x6e, 0x6b, 0x61, 0x6b, 0x254, 0x4b, 0x61, 0x6d, 0x25b, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x74, 0x61, 0x2bc, 0x4b, 0x61,
-0x6d, 0x61, 0x6c, 0x75, 0x6e, 0x53, 0x68, 0x77, 0xf3, 0x14b, 0xf2, 0x20, 0x6e, 0x67, 0x69, 0x65, 0x6d, 0x62, 0x254, 0x254,
-0x6e, 0x4b, 0xe0, 0x6d, 0x61, 0x6c, 0xfb, 0x6d, 0x4c, 0x61, 0x6b, 0x21f, 0xf3, 0x6c, 0x2bc, 0x69, 0x79, 0x61, 0x70, 0x69,
-0x4d, 0xed, 0x6c, 0x61, 0x68, 0x61, 0x14b, 0x73, 0x6b, 0x61, 0x20, 0x54, 0x21f, 0x61, 0x6d, 0xe1, 0x6b, 0x21f, 0x6f, 0x10d,
-0x68, 0x65, 0x2d5c, 0x2d30, 0x2d4e, 0x2d30, 0x2d63, 0x2d49, 0x2d56, 0x2d5c, 0x6a9, 0x648, 0x631, 0x62f, 0x6cc, 0x6cc, 0x20, 0x646, 0x627, 0x648,
-0x6d5, 0x646, 0x62f, 0x6cc, 0x639, 0x6ce, 0x631, 0x627, 0x642, 0x626, 0x6ce, 0x631, 0x627, 0x646, 0x64, 0x6f, 0x6c, 0x6e, 0x6f, 0x73,
-0x65, 0x72, 0x62, 0x161, 0x107, 0x69, 0x6e, 0x61, 0x4e, 0x69, 0x6d, 0x73, 0x6b, 0x61, 0x68, 0x6f, 0x72, 0x6e, 0x6a, 0x6f,
-0x73, 0x65, 0x72, 0x62, 0x161, 0x107, 0x69, 0x6e, 0x61, 0x4e, 0x11b, 0x6d, 0x73, 0x6b, 0x61, 0x70, 0x72, 0x16b, 0x73, 0x69,
-0x73, 0x6b, 0x61, 0x6e, 0x73, 0x77, 0x12b, 0x74, 0x61, 0x69, 0x61, 0x6e, 0x61, 0x72, 0xe2, 0x161, 0x6b, 0x69, 0x65, 0x6c,
-0xe2, 0x53, 0x75, 0x6f, 0x6d, 0xe2, 0x645, 0x627, 0x632, 0x631, 0x648, 0x646, 0x6cc, 0x644, 0x6ca, 0x631, 0x6cc, 0x20, 0x634, 0x648,
-0x645, 0x627, 0x644, 0x6cc, 0x7cb5, 0x8a9e, 0x4e2d, 0x83ef, 0x4eba, 0x6c11, 0x5171, 0x548c, 0x570b, 0x9999, 0x6e2f, 0x7279, 0x5225, 0x884c, 0x653f, 0x5340,
-0x7ca4, 0x8bed, 0x4e2d, 0x534e, 0x4eba, 0x6c11, 0x5171, 0x548c, 0x56fd
-};
-
-static const char language_name_list[] =
-"Default\0"
-"C\0"
-"Abkhazian\0"
-"Oromo\0"
-"Afar\0"
-"Afrikaans\0"
-"Albanian\0"
-"Amharic\0"
-"Arabic\0"
-"Armenian\0"
-"Assamese\0"
-"Aymara\0"
-"Azerbaijani\0"
-"Bashkir\0"
-"Basque\0"
-"Bengali\0"
-"Dzongkha\0"
-"Bihari\0"
-"Bislama\0"
-"Breton\0"
-"Bulgarian\0"
-"Burmese\0"
-"Belarusian\0"
-"Khmer\0"
-"Catalan\0"
-"Chinese\0"
-"Corsican\0"
-"Croatian\0"
-"Czech\0"
-"Danish\0"
-"Dutch\0"
-"English\0"
-"Esperanto\0"
-"Estonian\0"
-"Faroese\0"
-"Fijian\0"
-"Finnish\0"
-"French\0"
-"Western Frisian\0"
-"Gaelic\0"
-"Galician\0"
-"Georgian\0"
-"German\0"
-"Greek\0"
-"Greenlandic\0"
-"Guarani\0"
-"Gujarati\0"
-"Hausa\0"
-"Hebrew\0"
-"Hindi\0"
-"Hungarian\0"
-"Icelandic\0"
-"Indonesian\0"
-"Interlingua\0"
-"Interlingue\0"
-"Inuktitut\0"
-"Inupiak\0"
-"Irish\0"
-"Italian\0"
-"Japanese\0"
-"Javanese\0"
-"Kannada\0"
-"Kashmiri\0"
-"Kazakh\0"
-"Kinyarwanda\0"
-"Kirghiz\0"
-"Korean\0"
-"Kurdish\0"
-"Rundi\0"
-"Lao\0"
-"Latin\0"
-"Latvian\0"
-"Lingala\0"
-"Lithuanian\0"
-"Macedonian\0"
-"Malagasy\0"
-"Malay\0"
-"Malayalam\0"
-"Maltese\0"
-"Maori\0"
-"Marathi\0"
-"Marshallese\0"
-"Mongolian\0"
-"Nauru\0"
-"Nepali\0"
-"Norwegian Bokmal\0"
-"Occitan\0"
-"Oriya\0"
-"Pashto\0"
-"Persian\0"
-"Polish\0"
-"Portuguese\0"
-"Punjabi\0"
-"Quechua\0"
-"Romansh\0"
-"Romanian\0"
-"Russian\0"
-"Samoan\0"
-"Sango\0"
-"Sanskrit\0"
-"Serbian\0"
-"Ossetic\0"
-"Southern Sotho\0"
-"Tswana\0"
-"Shona\0"
-"Sindhi\0"
-"Sinhala\0"
-"Swati\0"
-"Slovak\0"
-"Slovenian\0"
-"Somali\0"
-"Spanish\0"
-"Sundanese\0"
-"Swahili\0"
-"Swedish\0"
-"Sardinian\0"
-"Tajik\0"
-"Tamil\0"
-"Tatar\0"
-"Telugu\0"
-"Thai\0"
-"Tibetan\0"
-"Tigrinya\0"
-"Tongan\0"
-"Tsonga\0"
-"Turkish\0"
-"Turkmen\0"
-"Tahitian\0"
-"Uighur\0"
-"Ukrainian\0"
-"Urdu\0"
-"Uzbek\0"
-"Vietnamese\0"
-"Volapuk\0"
-"Welsh\0"
-"Wolof\0"
-"Xhosa\0"
-"Yiddish\0"
-"Yoruba\0"
-"Zhuang\0"
-"Zulu\0"
-"Norwegian Nynorsk\0"
-"Bosnian\0"
-"Divehi\0"
-"Manx\0"
-"Cornish\0"
-"Akan\0"
-"Konkani\0"
-"Ga\0"
-"Igbo\0"
-"Kamba\0"
-"Syriac\0"
-"Blin\0"
-"Geez\0"
-"Koro\0"
-"Sidamo\0"
-"Atsam\0"
-"Tigre\0"
-"Jju\0"
-"Friulian\0"
-"Venda\0"
-"Ewe\0"
-"Walamo\0"
-"Hawaiian\0"
-"Tyap\0"
-"Nyanja\0"
-"Filipino\0"
-"Swiss German\0"
-"Sichuan Yi\0"
-"Kpelle\0"
-"Low German\0"
-"South Ndebele\0"
-"Northern Sotho\0"
-"Northern Sami\0"
-"Taroko\0"
-"Gusii\0"
-"Taita\0"
-"Fulah\0"
-"Kikuyu\0"
-"Samburu\0"
-"Sena\0"
-"North Ndebele\0"
-"Rombo\0"
-"Tachelhit\0"
-"Kabyle\0"
-"Nyankole\0"
-"Bena\0"
-"Vunjo\0"
-"Bambara\0"
-"Embu\0"
-"Cherokee\0"
-"Morisyen\0"
-"Makonde\0"
-"Langi\0"
-"Ganda\0"
-"Bemba\0"
-"Kabuverdianu\0"
-"Meru\0"
-"Kalenjin\0"
-"Nama\0"
-"Machame\0"
-"Colognian\0"
-"Masai\0"
-"Soga\0"
-"Luyia\0"
-"Asu\0"
-"Teso\0"
-"Saho\0"
-"Koyra Chiini\0"
-"Rwa\0"
-"Luo\0"
-"Chiga\0"
-"Central Morocco Tamazight\0"
-"Koyraboro Senni\0"
-"Shambala\0"
-"Bodo\0"
-"Avaric\0"
-"Chamorro\0"
-"Chechen\0"
-"Church\0"
-"Chuvash\0"
-"Cree\0"
-"Haitian\0"
-"Herero\0"
-"Hiri Motu\0"
-"Kanuri\0"
-"Komi\0"
-"Kongo\0"
-"Kwanyama\0"
-"Limburgish\0"
-"Luba Katanga\0"
-"Luxembourgish\0"
-"Navaho\0"
-"Ndonga\0"
-"Ojibwa\0"
-"Pali\0"
-"Walloon\0"
-"Aghem\0"
-"Basaa\0"
-"Zarma\0"
-"Duala\0"
-"Jola Fonyi\0"
-"Ewondo\0"
-"Bafia\0"
-"Makhuwa Meetto\0"
-"Mundang\0"
-"Kwasio\0"
-"Nuer\0"
-"Sakha\0"
-"Sangu\0"
-"Congo Swahili\0"
-"Tasawaq\0"
-"Vai\0"
-"Walser\0"
-"Yangben\0"
-"Avestan\0"
-"Asturian\0"
-"Ngomba\0"
-"Kako\0"
-"Meta\0"
-"Ngiemboon\0"
-"Aragonese\0"
-"Akkadian\0"
-"Ancient Egyptian\0"
-"Ancient Greek\0"
-"Aramaic\0"
-"Balinese\0"
-"Bamun\0"
-"Batak Toba\0"
-"Buginese\0"
-"Buhid\0"
-"Carian\0"
-"Chakma\0"
-"Classical Mandaic\0"
-"Coptic\0"
-"Dogri\0"
-"Eastern Cham\0"
-"Eastern Kayah\0"
-"Etruscan\0"
-"Gothic\0"
-"Hanunoo\0"
-"Ingush\0"
-"Large Flowery Miao\0"
-"Lepcha\0"
-"Limbu\0"
-"Lisu\0"
-"Lu\0"
-"Lycian\0"
-"Lydian\0"
-"Mandingo\0"
-"Manipuri\0"
-"Meroitic\0"
-"Northern Thai\0"
-"Old Irish\0"
-"Old Norse\0"
-"Old Persian\0"
-"Old Turkish\0"
-"Pahlavi\0"
-"Parthian\0"
-"Phoenician\0"
-"Prakrit Language\0"
-"Rejang\0"
-"Sabaean\0"
-"Samaritan\0"
-"Santali\0"
-"Saurashtra\0"
-"Sora\0"
-"Sylheti\0"
-"Tagbanwa\0"
-"Tai Dam\0"
-"Tai Nua\0"
-"Ugaritic\0"
-"Akoose\0"
-"Lakota\0"
-"Standard Moroccan Tamazight\0"
-"Mapuche\0"
-"Central Kurdish\0"
-"Lower Sorbian\0"
-"Upper Sorbian\0"
-"Kenyang\0"
-"Mohawk\0"
-"Nko\0"
-"Prussian\0"
-"Kiche\0"
-"Southern Sami\0"
-"Lule Sami\0"
-"Inari Sami\0"
-"Skolt Sami\0"
-"Warlpiri\0"
-"Manichaean Middle Persian\0"
-"Mende\0"
-"Ancient North Arabian\0"
-"Linear A\0"
-"Hmong Njua\0"
-"Ho\0"
-"Lezghian\0"
-"Bassa\0"
-"Mono\0"
-"Tedim Chin\0"
-"Maithili\0"
-"Ahom\0"
-"American Sign Language\0"
-"Ardhamagadhi Prakrit\0"
-"Bhojpuri\0"
-"Hieroglyphic Luwian\0"
-"Literary Chinese\0"
-"Mazanderani\0"
-"Mru\0"
-"Newari\0"
-"Northern Luri\0"
-"Palauan\0"
-"Papiamento\0"
-"Saraiki\0"
-"Tokelau\0"
-"Tok Pisin\0"
-"Tuvalu\0"
-"Uncoded Languages\0"
-"Cantonese\0"
-"Osage\0"
-"Tangut\0"
-"Ido\0"
-"Lojban\0"
-"Sicilian\0"
-"Southern Kurdish\0"
-"Western Balochi\0"
-;
-
-static const quint16 language_name_index[] = {
- 0, // AnyLanguage
- 8, // C
- 10, // Abkhazian
- 20, // Oromo
- 26, // Afar
- 31, // Afrikaans
- 41, // Albanian
- 50, // Amharic
- 58, // Arabic
- 65, // Armenian
- 74, // Assamese
- 83, // Aymara
- 90, // Azerbaijani
- 102, // Bashkir
- 110, // Basque
- 117, // Bengali
- 125, // Dzongkha
- 134, // Bihari
- 141, // Bislama
- 149, // Breton
- 156, // Bulgarian
- 166, // Burmese
- 174, // Belarusian
- 185, // Khmer
- 191, // Catalan
- 199, // Chinese
- 207, // Corsican
- 216, // Croatian
- 225, // Czech
- 231, // Danish
- 238, // Dutch
- 244, // English
- 252, // Esperanto
- 262, // Estonian
- 271, // Faroese
- 279, // Fijian
- 286, // Finnish
- 294, // French
- 301, // Western Frisian
- 317, // Gaelic
- 324, // Galician
- 333, // Georgian
- 342, // German
- 349, // Greek
- 355, // Greenlandic
- 367, // Guarani
- 375, // Gujarati
- 384, // Hausa
- 390, // Hebrew
- 397, // Hindi
- 403, // Hungarian
- 413, // Icelandic
- 423, // Indonesian
- 434, // Interlingua
- 446, // Interlingue
- 458, // Inuktitut
- 468, // Inupiak
- 476, // Irish
- 482, // Italian
- 490, // Japanese
- 499, // Javanese
- 508, // Kannada
- 516, // Kashmiri
- 525, // Kazakh
- 532, // Kinyarwanda
- 544, // Kirghiz
- 552, // Korean
- 559, // Kurdish
- 567, // Rundi
- 573, // Lao
- 577, // Latin
- 583, // Latvian
- 591, // Lingala
- 599, // Lithuanian
- 610, // Macedonian
- 621, // Malagasy
- 630, // Malay
- 636, // Malayalam
- 646, // Maltese
- 654, // Maori
- 660, // Marathi
- 668, // Marshallese
- 680, // Mongolian
- 690, // Nauru
- 696, // Nepali
- 703, // Norwegian Bokmal
- 720, // Occitan
- 728, // Oriya
- 734, // Pashto
- 741, // Persian
- 749, // Polish
- 756, // Portuguese
- 767, // Punjabi
- 775, // Quechua
- 783, // Romansh
- 791, // Romanian
- 800, // Russian
- 808, // Samoan
- 815, // Sango
- 821, // Sanskrit
- 830, // Serbian
- 838, // Ossetic
- 846, // Southern Sotho
- 861, // Tswana
- 868, // Shona
- 874, // Sindhi
- 881, // Sinhala
- 889, // Swati
- 895, // Slovak
- 902, // Slovenian
- 912, // Somali
- 919, // Spanish
- 927, // Sundanese
- 937, // Swahili
- 945, // Swedish
- 953, // Sardinian
- 963, // Tajik
- 969, // Tamil
- 975, // Tatar
- 981, // Telugu
- 988, // Thai
- 993, // Tibetan
- 1001, // Tigrinya
- 1010, // Tongan
- 1017, // Tsonga
- 1024, // Turkish
- 1032, // Turkmen
- 1040, // Tahitian
- 1049, // Uighur
- 1056, // Ukrainian
- 1066, // Urdu
- 1071, // Uzbek
- 1077, // Vietnamese
- 1088, // Volapuk
- 1096, // Welsh
- 1102, // Wolof
- 1108, // Xhosa
- 1114, // Yiddish
- 1122, // Yoruba
- 1129, // Zhuang
- 1136, // Zulu
- 1141, // Norwegian Nynorsk
- 1159, // Bosnian
- 1167, // Divehi
- 1174, // Manx
- 1179, // Cornish
- 1187, // Akan
- 1192, // Konkani
- 1200, // Ga
- 1203, // Igbo
- 1208, // Kamba
- 1214, // Syriac
- 1221, // Blin
- 1226, // Geez
- 1231, // Koro
- 1236, // Sidamo
- 1243, // Atsam
- 1249, // Tigre
- 1255, // Jju
- 1259, // Friulian
- 1268, // Venda
- 1274, // Ewe
- 1278, // Walamo
- 1285, // Hawaiian
- 1294, // Tyap
- 1299, // Nyanja
- 1306, // Filipino
- 1315, // Swiss German
- 1328, // Sichuan Yi
- 1339, // Kpelle
- 1346, // Low German
- 1357, // South Ndebele
- 1371, // Northern Sotho
- 1386, // Northern Sami
- 1400, // Taroko
- 1407, // Gusii
- 1413, // Taita
- 1419, // Fulah
- 1425, // Kikuyu
- 1432, // Samburu
- 1440, // Sena
- 1445, // North Ndebele
- 1459, // Rombo
- 1465, // Tachelhit
- 1475, // Kabyle
- 1482, // Nyankole
- 1491, // Bena
- 1496, // Vunjo
- 1502, // Bambara
- 1510, // Embu
- 1515, // Cherokee
- 1524, // Morisyen
- 1533, // Makonde
- 1541, // Langi
- 1547, // Ganda
- 1553, // Bemba
- 1559, // Kabuverdianu
- 1572, // Meru
- 1577, // Kalenjin
- 1586, // Nama
- 1591, // Machame
- 1599, // Colognian
- 1609, // Masai
- 1615, // Soga
- 1620, // Luyia
- 1626, // Asu
- 1630, // Teso
- 1635, // Saho
- 1640, // Koyra Chiini
- 1653, // Rwa
- 1657, // Luo
- 1661, // Chiga
- 1667, // Central Morocco Tamazight
- 1693, // Koyraboro Senni
- 1709, // Shambala
- 1718, // Bodo
- 1723, // Avaric
- 1730, // Chamorro
- 1739, // Chechen
- 1747, // Church
- 1754, // Chuvash
- 1762, // Cree
- 1767, // Haitian
- 1775, // Herero
- 1782, // Hiri Motu
- 1792, // Kanuri
- 1799, // Komi
- 1804, // Kongo
- 1810, // Kwanyama
- 1819, // Limburgish
- 1830, // Luba Katanga
- 1843, // Luxembourgish
- 1857, // Navaho
- 1864, // Ndonga
- 1871, // Ojibwa
- 1878, // Pali
- 1883, // Walloon
- 1891, // Aghem
- 1897, // Basaa
- 1903, // Zarma
- 1909, // Duala
- 1915, // Jola Fonyi
- 1926, // Ewondo
- 1933, // Bafia
- 1939, // Makhuwa Meetto
- 1954, // Mundang
- 1962, // Kwasio
- 1969, // Nuer
- 1974, // Sakha
- 1980, // Sangu
- 1986, // Congo Swahili
- 2000, // Tasawaq
- 2008, // Vai
- 2012, // Walser
- 2019, // Yangben
- 2027, // Avestan
- 2035, // Asturian
- 2044, // Ngomba
- 2051, // Kako
- 2056, // Meta
- 2061, // Ngiemboon
- 2071, // Aragonese
- 2081, // Akkadian
- 2090, // Ancient Egyptian
- 2107, // Ancient Greek
- 2121, // Aramaic
- 2129, // Balinese
- 2138, // Bamun
- 2144, // Batak Toba
- 2155, // Buginese
- 2164, // Buhid
- 2170, // Carian
- 2177, // Chakma
- 2184, // Classical Mandaic
- 2202, // Coptic
- 2209, // Dogri
- 2215, // Eastern Cham
- 2228, // Eastern Kayah
- 2242, // Etruscan
- 2251, // Gothic
- 2258, // Hanunoo
- 2266, // Ingush
- 2273, // Large Flowery Miao
- 2292, // Lepcha
- 2299, // Limbu
- 2305, // Lisu
- 2310, // Lu
- 2313, // Lycian
- 2320, // Lydian
- 2327, // Mandingo
- 2336, // Manipuri
- 2345, // Meroitic
- 2354, // Northern Thai
- 2368, // Old Irish
- 2378, // Old Norse
- 2388, // Old Persian
- 2400, // Old Turkish
- 2412, // Pahlavi
- 2420, // Parthian
- 2429, // Phoenician
- 2440, // Prakrit Language
- 2457, // Rejang
- 2464, // Sabaean
- 2472, // Samaritan
- 2482, // Santali
- 2490, // Saurashtra
- 2501, // Sora
- 2506, // Sylheti
- 2514, // Tagbanwa
- 2523, // Tai Dam
- 2531, // Tai Nua
- 2539, // Ugaritic
- 2548, // Akoose
- 2555, // Lakota
- 2562, // Standard Moroccan Tamazight
- 2590, // Mapuche
- 2598, // Central Kurdish
- 2614, // Lower Sorbian
- 2628, // Upper Sorbian
- 2642, // Kenyang
- 2650, // Mohawk
- 2657, // Nko
- 2661, // Prussian
- 2670, // Kiche
- 2676, // Southern Sami
- 2690, // Lule Sami
- 2700, // Inari Sami
- 2711, // Skolt Sami
- 2722, // Warlpiri
- 2731, // Manichaean Middle Persian
- 2757, // Mende
- 2763, // Ancient North Arabian
- 2785, // Linear A
- 2794, // Hmong Njua
- 2805, // Ho
- 2808, // Lezghian
- 2817, // Bassa
- 2823, // Mono
- 2828, // Tedim Chin
- 2839, // Maithili
- 2848, // Ahom
- 2853, // American Sign Language
- 2876, // Ardhamagadhi Prakrit
- 2897, // Bhojpuri
- 2906, // Hieroglyphic Luwian
- 2926, // Literary Chinese
- 2943, // Mazanderani
- 2955, // Mru
- 2959, // Newari
- 2966, // Northern Luri
- 2980, // Palauan
- 2988, // Papiamento
- 2999, // Saraiki
- 3007, // Tokelau
- 3015, // Tok Pisin
- 3025, // Tuvalu
- 3032, // Uncoded Languages
- 3050, // Cantonese
- 3060, // Osage
- 3066, // Tangut
- 3073, // Ido
- 3077, // Lojban
- 3084, // Sicilian
- 3093, // Southern Kurdish
- 3110, // Western Balochi
-};
-
-static const char script_name_list[] =
-"Default\0"
-"Arabic\0"
-"Cyrillic\0"
-"Deseret\0"
-"Gurmukhi\0"
-"Simplified Han\0"
-"Traditional Han\0"
-"Latin\0"
-"Mongolian\0"
-"Tifinagh\0"
-"Armenian\0"
-"Bengali\0"
-"Cherokee\0"
-"Devanagari\0"
-"Ethiopic\0"
-"Georgian\0"
-"Greek\0"
-"Gujarati\0"
-"Hebrew\0"
-"Japanese\0"
-"Khmer\0"
-"Kannada\0"
-"Korean\0"
-"Lao\0"
-"Malayalam\0"
-"Myanmar\0"
-"Oriya\0"
-"Tamil\0"
-"Telugu\0"
-"Thaana\0"
-"Thai\0"
-"Tibetan\0"
-"Sinhala\0"
-"Syriac\0"
-"Yi\0"
-"Vai\0"
-"Avestan\0"
-"Balinese\0"
-"Bamum\0"
-"Batak\0"
-"Bopomofo\0"
-"Brahmi\0"
-"Buginese\0"
-"Buhid\0"
-"Canadian Aboriginal\0"
-"Carian\0"
-"Chakma\0"
-"Cham\0"
-"Coptic\0"
-"Cypriot\0"
-"Egyptian Hieroglyphs\0"
-"Fraser\0"
-"Glagolitic\0"
-"Gothic\0"
-"Han\0"
-"Hangul\0"
-"Hanunoo\0"
-"Imperial Aramaic\0"
-"Inscriptional Pahlavi\0"
-"Inscriptional Parthian\0"
-"Javanese\0"
-"Kaithi\0"
-"Katakana\0"
-"Kayah Li\0"
-"Kharoshthi\0"
-"Lanna\0"
-"Lepcha\0"
-"Limbu\0"
-"Linear B\0"
-"Lycian\0"
-"Lydian\0"
-"Mandaean\0"
-"Meitei Mayek\0"
-"Meroitic\0"
-"Meroitic Cursive\0"
-"Nko\0"
-"New Tai Lue\0"
-"Ogham\0"
-"Ol Chiki\0"
-"Old Italic\0"
-"Old Persian\0"
-"Old South Arabian\0"
-"Orkhon\0"
-"Osmanya\0"
-"Phags Pa\0"
-"Phoenician\0"
-"Pollard Phonetic\0"
-"Rejang\0"
-"Runic\0"
-"Samaritan\0"
-"Saurashtra\0"
-"Sharada\0"
-"Shavian\0"
-"Sora Sompeng\0"
-"Cuneiform\0"
-"Sundanese\0"
-"Syloti Nagri\0"
-"Tagalog\0"
-"Tagbanwa\0"
-"Tai Le\0"
-"Tai Viet\0"
-"Takri\0"
-"Ugaritic\0"
-"Braille\0"
-"Hiragana\0"
-"Caucasian Albanian\0"
-"Bassa Vah\0"
-"Duployan\0"
-"Elbasan\0"
-"Grantha\0"
-"Pahawh Hmong\0"
-"Khojki\0"
-"Linear A\0"
-"Mahajani\0"
-"Manichaean\0"
-"Mende Kikakui\0"
-"Modi\0"
-"Mro\0"
-"Old North Arabian\0"
-"Nabataean\0"
-"Palmyrene\0"
-"Pau Cin Hau\0"
-"Old Permic\0"
-"Psalter Pahlavi\0"
-"Siddham\0"
-"Khudawadi\0"
-"Tirhuta\0"
-"Varang Kshiti\0"
-"Ahom\0"
-"Anatolian Hieroglyphs\0"
-"Hatran\0"
-"Multani\0"
-"Old Hungarian\0"
-"Sign Writing\0"
-"Adlam\0"
-"Bhaiksuki\0"
-"Marchen\0"
-"Newa\0"
-"Osage\0"
-"Tangut\0"
-"Han with Bopomofo\0"
-"Jamo\0"
-;
-
-static const quint16 script_name_index[] = {
- 0, // AnyScript
- 8, // Arabic
- 15, // Cyrillic
- 24, // Deseret
- 32, // Gurmukhi
- 41, // Simplified Han
- 56, // Traditional Han
- 72, // Latin
- 78, // Mongolian
- 88, // Tifinagh
- 97, // Armenian
- 106, // Bengali
- 114, // Cherokee
- 123, // Devanagari
- 134, // Ethiopic
- 143, // Georgian
- 152, // Greek
- 158, // Gujarati
- 167, // Hebrew
- 174, // Japanese
- 183, // Khmer
- 189, // Kannada
- 197, // Korean
- 204, // Lao
- 208, // Malayalam
- 218, // Myanmar
- 226, // Oriya
- 232, // Tamil
- 238, // Telugu
- 245, // Thaana
- 252, // Thai
- 257, // Tibetan
- 265, // Sinhala
- 273, // Syriac
- 280, // Yi
- 283, // Vai
- 287, // Avestan
- 295, // Balinese
- 304, // Bamum
- 310, // Batak
- 316, // Bopomofo
- 325, // Brahmi
- 332, // Buginese
- 341, // Buhid
- 347, // Canadian Aboriginal
- 367, // Carian
- 374, // Chakma
- 381, // Cham
- 386, // Coptic
- 393, // Cypriot
- 401, // Egyptian Hieroglyphs
- 422, // Fraser
- 429, // Glagolitic
- 440, // Gothic
- 447, // Han
- 451, // Hangul
- 458, // Hanunoo
- 466, // Imperial Aramaic
- 483, // Inscriptional Pahlavi
- 505, // Inscriptional Parthian
- 528, // Javanese
- 537, // Kaithi
- 544, // Katakana
- 553, // Kayah Li
- 562, // Kharoshthi
- 573, // Lanna
- 579, // Lepcha
- 586, // Limbu
- 592, // Linear B
- 601, // Lycian
- 608, // Lydian
- 615, // Mandaean
- 624, // Meitei Mayek
- 637, // Meroitic
- 646, // Meroitic Cursive
- 663, // Nko
- 667, // New Tai Lue
- 679, // Ogham
- 685, // Ol Chiki
- 694, // Old Italic
- 705, // Old Persian
- 717, // Old South Arabian
- 735, // Orkhon
- 742, // Osmanya
- 750, // Phags Pa
- 759, // Phoenician
- 770, // Pollard Phonetic
- 787, // Rejang
- 794, // Runic
- 800, // Samaritan
- 810, // Saurashtra
- 821, // Sharada
- 829, // Shavian
- 837, // Sora Sompeng
- 850, // Cuneiform
- 860, // Sundanese
- 870, // Syloti Nagri
- 883, // Tagalog
- 891, // Tagbanwa
- 900, // Tai Le
- 907, // Tai Viet
- 916, // Takri
- 922, // Ugaritic
- 931, // Braille
- 939, // Hiragana
- 948, // Caucasian Albanian
- 967, // Bassa Vah
- 977, // Duployan
- 986, // Elbasan
- 994, // Grantha
- 1002, // Pahawh Hmong
- 1015, // Khojki
- 1022, // Linear A
- 1031, // Mahajani
- 1040, // Manichaean
- 1051, // Mende Kikakui
- 1065, // Modi
- 1070, // Mro
- 1074, // Old North Arabian
- 1092, // Nabataean
- 1102, // Palmyrene
- 1112, // Pau Cin Hau
- 1124, // Old Permic
- 1135, // Psalter Pahlavi
- 1151, // Siddham
- 1159, // Khudawadi
- 1169, // Tirhuta
- 1177, // Varang Kshiti
- 1191, // Ahom
- 1196, // Anatolian Hieroglyphs
- 1218, // Hatran
- 1225, // Multani
- 1233, // Old Hungarian
- 1247, // Sign Writing
- 1260, // Adlam
- 1266, // Bhaiksuki
- 1276, // Marchen
- 1284, // Newa
- 1289, // Osage
- 1295, // Tangut
- 1302, // Han with Bopomofo
- 1320, // Jamo
-};
-
-static const char country_name_list[] =
-"Default\0"
-"Afghanistan\0"
-"Albania\0"
-"Algeria\0"
-"American Samoa\0"
-"Andorra\0"
-"Angola\0"
-"Anguilla\0"
-"Antarctica\0"
-"Antigua And Barbuda\0"
-"Argentina\0"
-"Armenia\0"
-"Aruba\0"
-"Australia\0"
-"Austria\0"
-"Azerbaijan\0"
-"Bahamas\0"
-"Bahrain\0"
-"Bangladesh\0"
-"Barbados\0"
-"Belarus\0"
-"Belgium\0"
-"Belize\0"
-"Benin\0"
-"Bermuda\0"
-"Bhutan\0"
-"Bolivia\0"
-"Bosnia And Herzegowina\0"
-"Botswana\0"
-"Bouvet Island\0"
-"Brazil\0"
-"British Indian Ocean Territory\0"
-"Brunei\0"
-"Bulgaria\0"
-"Burkina Faso\0"
-"Burundi\0"
-"Cambodia\0"
-"Cameroon\0"
-"Canada\0"
-"Cape Verde\0"
-"Cayman Islands\0"
-"Central African Republic\0"
-"Chad\0"
-"Chile\0"
-"China\0"
-"Christmas Island\0"
-"Cocos Islands\0"
-"Colombia\0"
-"Comoros\0"
-"Congo Kinshasa\0"
-"Congo Brazzaville\0"
-"Cook Islands\0"
-"Costa Rica\0"
-"Ivory Coast\0"
-"Croatia\0"
-"Cuba\0"
-"Cyprus\0"
-"Czech Republic\0"
-"Denmark\0"
-"Djibouti\0"
-"Dominica\0"
-"Dominican Republic\0"
-"East Timor\0"
-"Ecuador\0"
-"Egypt\0"
-"El Salvador\0"
-"Equatorial Guinea\0"
-"Eritrea\0"
-"Estonia\0"
-"Ethiopia\0"
-"Falkland Islands\0"
-"Faroe Islands\0"
-"Fiji\0"
-"Finland\0"
-"France\0"
-"Guernsey\0"
-"French Guiana\0"
-"French Polynesia\0"
-"French Southern Territories\0"
-"Gabon\0"
-"Gambia\0"
-"Georgia\0"
-"Germany\0"
-"Ghana\0"
-"Gibraltar\0"
-"Greece\0"
-"Greenland\0"
-"Grenada\0"
-"Guadeloupe\0"
-"Guam\0"
-"Guatemala\0"
-"Guinea\0"
-"Guinea Bissau\0"
-"Guyana\0"
-"Haiti\0"
-"Heard And McDonald Islands\0"
-"Honduras\0"
-"Hong Kong\0"
-"Hungary\0"
-"Iceland\0"
-"India\0"
-"Indonesia\0"
-"Iran\0"
-"Iraq\0"
-"Ireland\0"
-"Israel\0"
-"Italy\0"
-"Jamaica\0"
-"Japan\0"
-"Jordan\0"
-"Kazakhstan\0"
-"Kenya\0"
-"Kiribati\0"
-"North Korea\0"
-"South Korea\0"
-"Kuwait\0"
-"Kyrgyzstan\0"
-"Laos\0"
-"Latvia\0"
-"Lebanon\0"
-"Lesotho\0"
-"Liberia\0"
-"Libya\0"
-"Liechtenstein\0"
-"Lithuania\0"
-"Luxembourg\0"
-"Macau\0"
-"Macedonia\0"
-"Madagascar\0"
-"Malawi\0"
-"Malaysia\0"
-"Maldives\0"
-"Mali\0"
-"Malta\0"
-"Marshall Islands\0"
-"Martinique\0"
-"Mauritania\0"
-"Mauritius\0"
-"Mayotte\0"
-"Mexico\0"
-"Micronesia\0"
-"Moldova\0"
-"Monaco\0"
-"Mongolia\0"
-"Montserrat\0"
-"Morocco\0"
-"Mozambique\0"
-"Myanmar\0"
-"Namibia\0"
-"Nauru\0"
-"Nepal\0"
-"Netherlands\0"
-"Cura Sao\0"
-"New Caledonia\0"
-"New Zealand\0"
-"Nicaragua\0"
-"Niger\0"
-"Nigeria\0"
-"Niue\0"
-"Norfolk Island\0"
-"Northern Mariana Islands\0"
-"Norway\0"
-"Oman\0"
-"Pakistan\0"
-"Palau\0"
-"Palestinian Territories\0"
-"Panama\0"
-"Papua New Guinea\0"
-"Paraguay\0"
-"Peru\0"
-"Philippines\0"
-"Pitcairn\0"
-"Poland\0"
-"Portugal\0"
-"Puerto Rico\0"
-"Qatar\0"
-"Reunion\0"
-"Romania\0"
-"Russia\0"
-"Rwanda\0"
-"Saint Kitts And Nevis\0"
-"Saint Lucia\0"
-"Saint Vincent And The Grenadines\0"
-"Samoa\0"
-"San Marino\0"
-"Sao Tome And Principe\0"
-"Saudi Arabia\0"
-"Senegal\0"
-"Seychelles\0"
-"Sierra Leone\0"
-"Singapore\0"
-"Slovakia\0"
-"Slovenia\0"
-"Solomon Islands\0"
-"Somalia\0"
-"South Africa\0"
-"South Georgia And The South Sandwich Islands\0"
-"Spain\0"
-"Sri Lanka\0"
-"Saint Helena\0"
-"Saint Pierre And Miquelon\0"
-"Sudan\0"
-"Suriname\0"
-"Svalbard And Jan Mayen Islands\0"
-"Swaziland\0"
-"Sweden\0"
-"Switzerland\0"
-"Syria\0"
-"Taiwan\0"
-"Tajikistan\0"
-"Tanzania\0"
-"Thailand\0"
-"Togo\0"
-"Tokelau\0"
-"Tonga\0"
-"Trinidad And Tobago\0"
-"Tunisia\0"
-"Turkey\0"
-"Turkmenistan\0"
-"Turks And Caicos Islands\0"
-"Tuvalu\0"
-"Uganda\0"
-"Ukraine\0"
-"United Arab Emirates\0"
-"United Kingdom\0"
-"United States\0"
-"United States Minor Outlying Islands\0"
-"Uruguay\0"
-"Uzbekistan\0"
-"Vanuatu\0"
-"Vatican City State\0"
-"Venezuela\0"
-"Vietnam\0"
-"British Virgin Islands\0"
-"United States Virgin Islands\0"
-"Wallis And Futuna Islands\0"
-"Western Sahara\0"
-"Yemen\0"
-"Canary Islands\0"
-"Zambia\0"
-"Zimbabwe\0"
-"Clipperton Island\0"
-"Montenegro\0"
-"Serbia\0"
-"Saint Barthelemy\0"
-"Saint Martin\0"
-"Latin America\0"
-"Ascension Island\0"
-"Aland Islands\0"
-"Diego Garcia\0"
-"Ceuta And Melilla\0"
-"Isle Of Man\0"
-"Jersey\0"
-"Tristan Da Cunha\0"
-"South Sudan\0"
-"Bonaire\0"
-"Sint Maarten\0"
-"Kosovo\0"
-"European Union\0"
-"Outlying Oceania\0"
-"World\0"
-"Europe\0"
-;
-
-static const quint16 country_name_index[] = {
- 0, // AnyCountry
- 8, // Afghanistan
- 20, // Albania
- 28, // Algeria
- 36, // American Samoa
- 51, // Andorra
- 59, // Angola
- 66, // Anguilla
- 75, // Antarctica
- 86, // Antigua And Barbuda
- 106, // Argentina
- 116, // Armenia
- 124, // Aruba
- 130, // Australia
- 140, // Austria
- 148, // Azerbaijan
- 159, // Bahamas
- 167, // Bahrain
- 175, // Bangladesh
- 186, // Barbados
- 195, // Belarus
- 203, // Belgium
- 211, // Belize
- 218, // Benin
- 224, // Bermuda
- 232, // Bhutan
- 239, // Bolivia
- 247, // Bosnia And Herzegowina
- 270, // Botswana
- 279, // Bouvet Island
- 293, // Brazil
- 300, // British Indian Ocean Territory
- 331, // Brunei
- 338, // Bulgaria
- 347, // Burkina Faso
- 360, // Burundi
- 368, // Cambodia
- 377, // Cameroon
- 386, // Canada
- 393, // Cape Verde
- 404, // Cayman Islands
- 419, // Central African Republic
- 444, // Chad
- 449, // Chile
- 455, // China
- 461, // Christmas Island
- 478, // Cocos Islands
- 492, // Colombia
- 501, // Comoros
- 509, // Congo Kinshasa
- 524, // Congo Brazzaville
- 542, // Cook Islands
- 555, // Costa Rica
- 566, // Ivory Coast
- 578, // Croatia
- 586, // Cuba
- 591, // Cyprus
- 598, // Czech Republic
- 613, // Denmark
- 621, // Djibouti
- 630, // Dominica
- 639, // Dominican Republic
- 658, // East Timor
- 669, // Ecuador
- 677, // Egypt
- 683, // El Salvador
- 695, // Equatorial Guinea
- 713, // Eritrea
- 721, // Estonia
- 729, // Ethiopia
- 738, // Falkland Islands
- 755, // Faroe Islands
- 769, // Fiji
- 774, // Finland
- 782, // France
- 789, // Guernsey
- 798, // French Guiana
- 812, // French Polynesia
- 829, // French Southern Territories
- 857, // Gabon
- 863, // Gambia
- 870, // Georgia
- 878, // Germany
- 886, // Ghana
- 892, // Gibraltar
- 902, // Greece
- 909, // Greenland
- 919, // Grenada
- 927, // Guadeloupe
- 938, // Guam
- 943, // Guatemala
- 953, // Guinea
- 960, // Guinea Bissau
- 974, // Guyana
- 981, // Haiti
- 987, // Heard And McDonald Islands
- 1014, // Honduras
- 1023, // Hong Kong
- 1033, // Hungary
- 1041, // Iceland
- 1049, // India
- 1055, // Indonesia
- 1065, // Iran
- 1070, // Iraq
- 1075, // Ireland
- 1083, // Israel
- 1090, // Italy
- 1096, // Jamaica
- 1104, // Japan
- 1110, // Jordan
- 1117, // Kazakhstan
- 1128, // Kenya
- 1134, // Kiribati
- 1143, // North Korea
- 1155, // South Korea
- 1167, // Kuwait
- 1174, // Kyrgyzstan
- 1185, // Laos
- 1190, // Latvia
- 1197, // Lebanon
- 1205, // Lesotho
- 1213, // Liberia
- 1221, // Libya
- 1227, // Liechtenstein
- 1241, // Lithuania
- 1251, // Luxembourg
- 1262, // Macau
- 1268, // Macedonia
- 1278, // Madagascar
- 1289, // Malawi
- 1296, // Malaysia
- 1305, // Maldives
- 1314, // Mali
- 1319, // Malta
- 1325, // Marshall Islands
- 1342, // Martinique
- 1353, // Mauritania
- 1364, // Mauritius
- 1374, // Mayotte
- 1382, // Mexico
- 1389, // Micronesia
- 1400, // Moldova
- 1408, // Monaco
- 1415, // Mongolia
- 1424, // Montserrat
- 1435, // Morocco
- 1443, // Mozambique
- 1454, // Myanmar
- 1462, // Namibia
- 1470, // Nauru
- 1476, // Nepal
- 1482, // Netherlands
- 1494, // Cura Sao
- 1503, // New Caledonia
- 1517, // New Zealand
- 1529, // Nicaragua
- 1539, // Niger
- 1545, // Nigeria
- 1553, // Niue
- 1558, // Norfolk Island
- 1573, // Northern Mariana Islands
- 1598, // Norway
- 1605, // Oman
- 1610, // Pakistan
- 1619, // Palau
- 1625, // Palestinian Territories
- 1649, // Panama
- 1656, // Papua New Guinea
- 1673, // Paraguay
- 1682, // Peru
- 1687, // Philippines
- 1699, // Pitcairn
- 1708, // Poland
- 1715, // Portugal
- 1724, // Puerto Rico
- 1736, // Qatar
- 1742, // Reunion
- 1750, // Romania
- 1758, // Russia
- 1765, // Rwanda
- 1772, // Saint Kitts And Nevis
- 1794, // Saint Lucia
- 1806, // Saint Vincent And The Grenadines
- 1839, // Samoa
- 1845, // San Marino
- 1856, // Sao Tome And Principe
- 1878, // Saudi Arabia
- 1891, // Senegal
- 1899, // Seychelles
- 1910, // Sierra Leone
- 1923, // Singapore
- 1933, // Slovakia
- 1942, // Slovenia
- 1951, // Solomon Islands
- 1967, // Somalia
- 1975, // South Africa
- 1988, // South Georgia And The South Sandwich Islands
- 2033, // Spain
- 2039, // Sri Lanka
- 2049, // Saint Helena
- 2062, // Saint Pierre And Miquelon
- 2088, // Sudan
- 2094, // Suriname
- 2103, // Svalbard And Jan Mayen Islands
- 2134, // Swaziland
- 2144, // Sweden
- 2151, // Switzerland
- 2163, // Syria
- 2169, // Taiwan
- 2176, // Tajikistan
- 2187, // Tanzania
- 2196, // Thailand
- 2205, // Togo
- 2210, // Tokelau
- 2218, // Tonga
- 2224, // Trinidad And Tobago
- 2244, // Tunisia
- 2252, // Turkey
- 2259, // Turkmenistan
- 2272, // Turks And Caicos Islands
- 2297, // Tuvalu
- 2304, // Uganda
- 2311, // Ukraine
- 2319, // United Arab Emirates
- 2340, // United Kingdom
- 2355, // United States
- 2369, // United States Minor Outlying Islands
- 2406, // Uruguay
- 2414, // Uzbekistan
- 2425, // Vanuatu
- 2433, // Vatican City State
- 2452, // Venezuela
- 2462, // Vietnam
- 2470, // British Virgin Islands
- 2493, // United States Virgin Islands
- 2522, // Wallis And Futuna Islands
- 2548, // Western Sahara
- 2563, // Yemen
- 2569, // Canary Islands
- 2584, // Zambia
- 2591, // Zimbabwe
- 2600, // Clipperton Island
- 2618, // Montenegro
- 2629, // Serbia
- 2636, // Saint Barthelemy
- 2653, // Saint Martin
- 2666, // Latin America
- 2680, // Ascension Island
- 2697, // Aland Islands
- 2711, // Diego Garcia
- 2724, // Ceuta And Melilla
- 2742, // Isle Of Man
- 2754, // Jersey
- 2761, // Tristan Da Cunha
- 2778, // South Sudan
- 2790, // Bonaire
- 2798, // Sint Maarten
- 2811, // Kosovo
- 2818, // European Union
- 2833, // Outlying Oceania
- 2850, // World
- 2856, // Europe
-};
-
-static const unsigned char language_code_list[] =
-" \0" // AnyLanguage
-" \0" // C
-"ab\0" // Abkhazian
-"om\0" // Oromo
-"aa\0" // Afar
-"af\0" // Afrikaans
-"sq\0" // Albanian
-"am\0" // Amharic
-"ar\0" // Arabic
-"hy\0" // Armenian
-"as\0" // Assamese
-"ay\0" // Aymara
-"az\0" // Azerbaijani
-"ba\0" // Bashkir
-"eu\0" // Basque
-"bn\0" // Bengali
-"dz\0" // Dzongkha
-"bh\0" // Bihari
-"bi\0" // Bislama
-"br\0" // Breton
-"bg\0" // Bulgarian
-"my\0" // Burmese
-"be\0" // Belarusian
-"km\0" // Khmer
-"ca\0" // Catalan
-"zh\0" // Chinese
-"co\0" // Corsican
-"hr\0" // Croatian
-"cs\0" // Czech
-"da\0" // Danish
-"nl\0" // Dutch
-"en\0" // English
-"eo\0" // Esperanto
-"et\0" // Estonian
-"fo\0" // Faroese
-"fj\0" // Fijian
-"fi\0" // Finnish
-"fr\0" // French
-"fy\0" // Western Frisian
-"gd\0" // Gaelic
-"gl\0" // Galician
-"ka\0" // Georgian
-"de\0" // German
-"el\0" // Greek
-"kl\0" // Greenlandic
-"gn\0" // Guarani
-"gu\0" // Gujarati
-"ha\0" // Hausa
-"he\0" // Hebrew
-"hi\0" // Hindi
-"hu\0" // Hungarian
-"is\0" // Icelandic
-"id\0" // Indonesian
-"ia\0" // Interlingua
-"ie\0" // Interlingue
-"iu\0" // Inuktitut
-"ik\0" // Inupiak
-"ga\0" // Irish
-"it\0" // Italian
-"ja\0" // Japanese
-"jv\0" // Javanese
-"kn\0" // Kannada
-"ks\0" // Kashmiri
-"kk\0" // Kazakh
-"rw\0" // Kinyarwanda
-"ky\0" // Kirghiz
-"ko\0" // Korean
-"ku\0" // Kurdish
-"rn\0" // Rundi
-"lo\0" // Lao
-"la\0" // Latin
-"lv\0" // Latvian
-"ln\0" // Lingala
-"lt\0" // Lithuanian
-"mk\0" // Macedonian
-"mg\0" // Malagasy
-"ms\0" // Malay
-"ml\0" // Malayalam
-"mt\0" // Maltese
-"mi\0" // Maori
-"mr\0" // Marathi
-"mh\0" // Marshallese
-"mn\0" // Mongolian
-"na\0" // Nauru
-"ne\0" // Nepali
-"nb\0" // Norwegian Bokmal
-"oc\0" // Occitan
-"or\0" // Oriya
-"ps\0" // Pashto
-"fa\0" // Persian
-"pl\0" // Polish
-"pt\0" // Portuguese
-"pa\0" // Punjabi
-"qu\0" // Quechua
-"rm\0" // Romansh
-"ro\0" // Romanian
-"ru\0" // Russian
-"sm\0" // Samoan
-"sg\0" // Sango
-"sa\0" // Sanskrit
-"sr\0" // Serbian
-"os\0" // Ossetic
-"st\0" // Southern Sotho
-"tn\0" // Tswana
-"sn\0" // Shona
-"sd\0" // Sindhi
-"si\0" // Sinhala
-"ss\0" // Swati
-"sk\0" // Slovak
-"sl\0" // Slovenian
-"so\0" // Somali
-"es\0" // Spanish
-"su\0" // Sundanese
-"sw\0" // Swahili
-"sv\0" // Swedish
-"sc\0" // Sardinian
-"tg\0" // Tajik
-"ta\0" // Tamil
-"tt\0" // Tatar
-"te\0" // Telugu
-"th\0" // Thai
-"bo\0" // Tibetan
-"ti\0" // Tigrinya
-"to\0" // Tongan
-"ts\0" // Tsonga
-"tr\0" // Turkish
-"tk\0" // Turkmen
-"ty\0" // Tahitian
-"ug\0" // Uighur
-"uk\0" // Ukrainian
-"ur\0" // Urdu
-"uz\0" // Uzbek
-"vi\0" // Vietnamese
-"vo\0" // Volapuk
-"cy\0" // Welsh
-"wo\0" // Wolof
-"xh\0" // Xhosa
-"yi\0" // Yiddish
-"yo\0" // Yoruba
-"za\0" // Zhuang
-"zu\0" // Zulu
-"nn\0" // Norwegian Nynorsk
-"bs\0" // Bosnian
-"dv\0" // Divehi
-"gv\0" // Manx
-"kw\0" // Cornish
-"ak\0" // Akan
-"kok" // Konkani
-"gaa" // Ga
-"ig\0" // Igbo
-"kam" // Kamba
-"syr" // Syriac
-"byn" // Blin
-"gez" // Geez
-"kfo" // Koro
-"sid" // Sidamo
-"cch" // Atsam
-"tig" // Tigre
-"kaj" // Jju
-"fur" // Friulian
-"ve\0" // Venda
-"ee\0" // Ewe
-"wal" // Walamo
-"haw" // Hawaiian
-"kcg" // Tyap
-"ny\0" // Nyanja
-"fil" // Filipino
-"gsw" // Swiss German
-"ii\0" // Sichuan Yi
-"kpe" // Kpelle
-"nds" // Low German
-"nr\0" // South Ndebele
-"nso" // Northern Sotho
-"se\0" // Northern Sami
-"trv" // Taroko
-"guz" // Gusii
-"dav" // Taita
-"ff\0" // Fulah
-"ki\0" // Kikuyu
-"saq" // Samburu
-"seh" // Sena
-"nd\0" // North Ndebele
-"rof" // Rombo
-"shi" // Tachelhit
-"kab" // Kabyle
-"nyn" // Nyankole
-"bez" // Bena
-"vun" // Vunjo
-"bm\0" // Bambara
-"ebu" // Embu
-"chr" // Cherokee
-"mfe" // Morisyen
-"kde" // Makonde
-"lag" // Langi
-"lg\0" // Ganda
-"bem" // Bemba
-"kea" // Kabuverdianu
-"mer" // Meru
-"kln" // Kalenjin
-"naq" // Nama
-"jmc" // Machame
-"ksh" // Colognian
-"mas" // Masai
-"xog" // Soga
-"luy" // Luyia
-"asa" // Asu
-"teo" // Teso
-"ssy" // Saho
-"khq" // Koyra Chiini
-"rwk" // Rwa
-"luo" // Luo
-"cgg" // Chiga
-"tzm" // Central Morocco Tamazight
-"ses" // Koyraboro Senni
-"ksb" // Shambala
-"brx" // Bodo
-"av\0" // Avaric
-"ch\0" // Chamorro
-"ce\0" // Chechen
-"cu\0" // Church
-"cv\0" // Chuvash
-"cr\0" // Cree
-"ht\0" // Haitian
-"hz\0" // Herero
-"ho\0" // Hiri Motu
-"kr\0" // Kanuri
-"kv\0" // Komi
-"kg\0" // Kongo
-"kj\0" // Kwanyama
-"li\0" // Limburgish
-"lu\0" // Luba Katanga
-"lb\0" // Luxembourgish
-"nv\0" // Navaho
-"ng\0" // Ndonga
-"oj\0" // Ojibwa
-"pi\0" // Pali
-"wa\0" // Walloon
-"agq" // Aghem
-"bas" // Basaa
-"dje" // Zarma
-"dua" // Duala
-"dyo" // Jola Fonyi
-"ewo" // Ewondo
-"ksf" // Bafia
-"mgh" // Makhuwa Meetto
-"mua" // Mundang
-"nmg" // Kwasio
-"nus" // Nuer
-"sah" // Sakha
-"sbp" // Sangu
-"swc" // Congo Swahili
-"twq" // Tasawaq
-"vai" // Vai
-"wae" // Walser
-"yav" // Yangben
-"ae\0" // Avestan
-"ast" // Asturian
-"jgo" // Ngomba
-"kkj" // Kako
-"mgo" // Meta
-"nnh" // Ngiemboon
-"an\0" // Aragonese
-"akk" // Akkadian
-"egy" // Ancient Egyptian
-"grc" // Ancient Greek
-"arc" // Aramaic
-"ban" // Balinese
-"bax" // Bamun
-"bbc" // Batak Toba
-"bug" // Buginese
-"bku" // Buhid
-"xcr" // Carian
-"ccp" // Chakma
-"myz" // Classical Mandaic
-"cop" // Coptic
-"doi" // Dogri
-"cjm" // Eastern Cham
-"eky" // Eastern Kayah
-"ett" // Etruscan
-"got" // Gothic
-"hnn" // Hanunoo
-"inh" // Ingush
-"hmd" // Large Flowery Miao
-"lep" // Lepcha
-"lif" // Limbu
-"lis" // Lisu
-"khb" // Lu
-"xlc" // Lycian
-"xld" // Lydian
-"man" // Mandingo
-"mni" // Manipuri
-"xmr" // Meroitic
-"nod" // Northern Thai
-"sga" // Old Irish
-"non" // Old Norse
-"peo" // Old Persian
-"otk" // Old Turkish
-"pal" // Pahlavi
-"xpr" // Parthian
-"phn" // Phoenician
-"pra" // Prakrit Language
-"rej" // Rejang
-"xsa" // Sabaean
-"smp" // Samaritan
-"sat" // Santali
-"saz" // Saurashtra
-"srb" // Sora
-"syl" // Sylheti
-"tbw" // Tagbanwa
-"blt" // Tai Dam
-"tdd" // Tai Nua
-"uga" // Ugaritic
-"bss" // Akoose
-"lkt" // Lakota
-"zgh" // Standard Moroccan Tamazight
-"arn" // Mapuche
-"ckb" // Central Kurdish
-"dsb" // Lower Sorbian
-"hsb" // Upper Sorbian
-"ken" // Kenyang
-"moh" // Mohawk
-"nqo" // Nko
-"prg" // Prussian
-"quc" // Kiche
-"sma" // Southern Sami
-"smj" // Lule Sami
-"smn" // Inari Sami
-"sms" // Skolt Sami
-"wbp" // Warlpiri
-"xmn" // Manichaean Middle Persian
-"men" // Mende
-"xna" // Ancient North Arabian
-"lab" // Linear A
-"hnj" // Hmong Njua
-"hoc" // Ho
-"lez" // Lezghian
-"bsq" // Bassa
-"mru" // Mono
-"ctd" // Tedim Chin
-"mai" // Maithili
-"aho" // Ahom
-"ase" // American Sign Language
-"pka" // Ardhamagadhi Prakrit
-"bho" // Bhojpuri
-"hlu" // Hieroglyphic Luwian
-"lzh" // Literary Chinese
-"mzn" // Mazanderani
-"mro" // Mru
-"new" // Newari
-"lrc" // Northern Luri
-"pau" // Palauan
-"pap" // Papiamento
-"skr" // Saraiki
-"tkl" // Tokelau
-"tpi" // Tok Pisin
-"tvl" // Tuvalu
-"mis" // Uncoded Languages
-"yue" // Cantonese
-"osa" // Osage
-"txg" // Tangut
-"io\0" // Ido
-"jbo" // Lojban
-"scn" // Sicilian
-"sdh" // Southern Kurdish
-"bgn" // Western Balochi
-;
-
-static const unsigned char script_code_list[] =
-"Zzzz" // AnyScript
-"Arab" // Arabic
-"Cyrl" // Cyrillic
-"Dsrt" // Deseret
-"Guru" // Gurmukhi
-"Hans" // Simplified Han
-"Hant" // Traditional Han
-"Latn" // Latin
-"Mong" // Mongolian
-"Tfng" // Tifinagh
-"Armn" // Armenian
-"Beng" // Bengali
-"Cher" // Cherokee
-"Deva" // Devanagari
-"Ethi" // Ethiopic
-"Geor" // Georgian
-"Grek" // Greek
-"Gujr" // Gujarati
-"Hebr" // Hebrew
-"Jpan" // Japanese
-"Khmr" // Khmer
-"Knda" // Kannada
-"Kore" // Korean
-"Laoo" // Lao
-"Mlym" // Malayalam
-"Mymr" // Myanmar
-"Orya" // Oriya
-"Taml" // Tamil
-"Telu" // Telugu
-"Thaa" // Thaana
-"Thai" // Thai
-"Tibt" // Tibetan
-"Sinh" // Sinhala
-"Syrc" // Syriac
-"Yiii" // Yi
-"Vaii" // Vai
-"Avst" // Avestan
-"Bali" // Balinese
-"Bamu" // Bamum
-"Batk" // Batak
-"Bopo" // Bopomofo
-"Brah" // Brahmi
-"Bugi" // Buginese
-"Buhd" // Buhid
-"Cans" // Canadian Aboriginal
-"Cari" // Carian
-"Cakm" // Chakma
-"Cham" // Cham
-"Copt" // Coptic
-"Cprt" // Cypriot
-"Egyp" // Egyptian Hieroglyphs
-"Lisu" // Fraser
-"Glag" // Glagolitic
-"Goth" // Gothic
-"Hani" // Han
-"Hang" // Hangul
-"Hano" // Hanunoo
-"Armi" // Imperial Aramaic
-"Phli" // Inscriptional Pahlavi
-"Prti" // Inscriptional Parthian
-"Java" // Javanese
-"Kthi" // Kaithi
-"Kana" // Katakana
-"Kali" // Kayah Li
-"Khar" // Kharoshthi
-"Lana" // Lanna
-"Lepc" // Lepcha
-"Limb" // Limbu
-"Linb" // Linear B
-"Lyci" // Lycian
-"Lydi" // Lydian
-"Mand" // Mandaean
-"Mtei" // Meitei Mayek
-"Mero" // Meroitic
-"Merc" // Meroitic Cursive
-"Nkoo" // Nko
-"Talu" // New Tai Lue
-"Ogam" // Ogham
-"Olck" // Ol Chiki
-"Ital" // Old Italic
-"Xpeo" // Old Persian
-"Sarb" // Old South Arabian
-"Orkh" // Orkhon
-"Osma" // Osmanya
-"Phag" // Phags Pa
-"Phnx" // Phoenician
-"Plrd" // Pollard Phonetic
-"Rjng" // Rejang
-"Runr" // Runic
-"Samr" // Samaritan
-"Saur" // Saurashtra
-"Shrd" // Sharada
-"Shaw" // Shavian
-"Sora" // Sora Sompeng
-"Xsux" // Cuneiform
-"Sund" // Sundanese
-"Sylo" // Syloti Nagri
-"Tglg" // Tagalog
-"Tagb" // Tagbanwa
-"Tale" // Tai Le
-"Tavt" // Tai Viet
-"Takr" // Takri
-"Ugar" // Ugaritic
-"Brai" // Braille
-"Hira" // Hiragana
-"Aghb" // Caucasian Albanian
-"Bass" // Bassa Vah
-"Dupl" // Duployan
-"Elba" // Elbasan
-"Gran" // Grantha
-"Hmng" // Pahawh Hmong
-"Khoj" // Khojki
-"Lina" // Linear A
-"Mahj" // Mahajani
-"Mani" // Manichaean
-"Mend" // Mende Kikakui
-"Modi" // Modi
-"Mroo" // Mro
-"Narb" // Old North Arabian
-"Nbat" // Nabataean
-"Palm" // Palmyrene
-"Pauc" // Pau Cin Hau
-"Perm" // Old Permic
-"Phlp" // Psalter Pahlavi
-"Sidd" // Siddham
-"Sind" // Khudawadi
-"Tirh" // Tirhuta
-"Wara" // Varang Kshiti
-"Ahom" // Ahom
-"Hluw" // Anatolian Hieroglyphs
-"Hatr" // Hatran
-"Mult" // Multani
-"Hung" // Old Hungarian
-"Sgnw" // Sign Writing
-"Adlm" // Adlam
-"Bhks" // Bhaiksuki
-"Marc" // Marchen
-"Newa" // Newa
-"Osge" // Osage
-"Tang" // Tangut
-"Hanb" // Han with Bopomofo
-"Jamo" // Jamo
-;
-static const unsigned char country_code_list[] =
-"ZZ\0" // AnyCountry
-"AF\0" // Afghanistan
-"AL\0" // Albania
-"DZ\0" // Algeria
-"AS\0" // American Samoa
-"AD\0" // Andorra
-"AO\0" // Angola
-"AI\0" // Anguilla
-"AQ\0" // Antarctica
-"AG\0" // Antigua And Barbuda
-"AR\0" // Argentina
-"AM\0" // Armenia
-"AW\0" // Aruba
-"AU\0" // Australia
-"AT\0" // Austria
-"AZ\0" // Azerbaijan
-"BS\0" // Bahamas
-"BH\0" // Bahrain
-"BD\0" // Bangladesh
-"BB\0" // Barbados
-"BY\0" // Belarus
-"BE\0" // Belgium
-"BZ\0" // Belize
-"BJ\0" // Benin
-"BM\0" // Bermuda
-"BT\0" // Bhutan
-"BO\0" // Bolivia
-"BA\0" // Bosnia And Herzegowina
-"BW\0" // Botswana
-"BV\0" // Bouvet Island
-"BR\0" // Brazil
-"IO\0" // British Indian Ocean Territory
-"BN\0" // Brunei
-"BG\0" // Bulgaria
-"BF\0" // Burkina Faso
-"BI\0" // Burundi
-"KH\0" // Cambodia
-"CM\0" // Cameroon
-"CA\0" // Canada
-"CV\0" // Cape Verde
-"KY\0" // Cayman Islands
-"CF\0" // Central African Republic
-"TD\0" // Chad
-"CL\0" // Chile
-"CN\0" // China
-"CX\0" // Christmas Island
-"CC\0" // Cocos Islands
-"CO\0" // Colombia
-"KM\0" // Comoros
-"CD\0" // Congo Kinshasa
-"CG\0" // Congo Brazzaville
-"CK\0" // Cook Islands
-"CR\0" // Costa Rica
-"CI\0" // Ivory Coast
-"HR\0" // Croatia
-"CU\0" // Cuba
-"CY\0" // Cyprus
-"CZ\0" // Czech Republic
-"DK\0" // Denmark
-"DJ\0" // Djibouti
-"DM\0" // Dominica
-"DO\0" // Dominican Republic
-"TL\0" // East Timor
-"EC\0" // Ecuador
-"EG\0" // Egypt
-"SV\0" // El Salvador
-"GQ\0" // Equatorial Guinea
-"ER\0" // Eritrea
-"EE\0" // Estonia
-"ET\0" // Ethiopia
-"FK\0" // Falkland Islands
-"FO\0" // Faroe Islands
-"FJ\0" // Fiji
-"FI\0" // Finland
-"FR\0" // France
-"GG\0" // Guernsey
-"GF\0" // French Guiana
-"PF\0" // French Polynesia
-"TF\0" // French Southern Territories
-"GA\0" // Gabon
-"GM\0" // Gambia
-"GE\0" // Georgia
-"DE\0" // Germany
-"GH\0" // Ghana
-"GI\0" // Gibraltar
-"GR\0" // Greece
-"GL\0" // Greenland
-"GD\0" // Grenada
-"GP\0" // Guadeloupe
-"GU\0" // Guam
-"GT\0" // Guatemala
-"GN\0" // Guinea
-"GW\0" // Guinea Bissau
-"GY\0" // Guyana
-"HT\0" // Haiti
-"HM\0" // Heard And McDonald Islands
-"HN\0" // Honduras
-"HK\0" // Hong Kong
-"HU\0" // Hungary
-"IS\0" // Iceland
-"IN\0" // India
-"ID\0" // Indonesia
-"IR\0" // Iran
-"IQ\0" // Iraq
-"IE\0" // Ireland
-"IL\0" // Israel
-"IT\0" // Italy
-"JM\0" // Jamaica
-"JP\0" // Japan
-"JO\0" // Jordan
-"KZ\0" // Kazakhstan
-"KE\0" // Kenya
-"KI\0" // Kiribati
-"KP\0" // North Korea
-"KR\0" // South Korea
-"KW\0" // Kuwait
-"KG\0" // Kyrgyzstan
-"LA\0" // Laos
-"LV\0" // Latvia
-"LB\0" // Lebanon
-"LS\0" // Lesotho
-"LR\0" // Liberia
-"LY\0" // Libya
-"LI\0" // Liechtenstein
-"LT\0" // Lithuania
-"LU\0" // Luxembourg
-"MO\0" // Macau
-"MK\0" // Macedonia
-"MG\0" // Madagascar
-"MW\0" // Malawi
-"MY\0" // Malaysia
-"MV\0" // Maldives
-"ML\0" // Mali
-"MT\0" // Malta
-"MH\0" // Marshall Islands
-"MQ\0" // Martinique
-"MR\0" // Mauritania
-"MU\0" // Mauritius
-"YT\0" // Mayotte
-"MX\0" // Mexico
-"FM\0" // Micronesia
-"MD\0" // Moldova
-"MC\0" // Monaco
-"MN\0" // Mongolia
-"MS\0" // Montserrat
-"MA\0" // Morocco
-"MZ\0" // Mozambique
-"MM\0" // Myanmar
-"NA\0" // Namibia
-"NR\0" // Nauru
-"NP\0" // Nepal
-"NL\0" // Netherlands
-"CW\0" // Cura Sao
-"NC\0" // New Caledonia
-"NZ\0" // New Zealand
-"NI\0" // Nicaragua
-"NE\0" // Niger
-"NG\0" // Nigeria
-"NU\0" // Niue
-"NF\0" // Norfolk Island
-"MP\0" // Northern Mariana Islands
-"NO\0" // Norway
-"OM\0" // Oman
-"PK\0" // Pakistan
-"PW\0" // Palau
-"PS\0" // Palestinian Territories
-"PA\0" // Panama
-"PG\0" // Papua New Guinea
-"PY\0" // Paraguay
-"PE\0" // Peru
-"PH\0" // Philippines
-"PN\0" // Pitcairn
-"PL\0" // Poland
-"PT\0" // Portugal
-"PR\0" // Puerto Rico
-"QA\0" // Qatar
-"RE\0" // Reunion
-"RO\0" // Romania
-"RU\0" // Russia
-"RW\0" // Rwanda
-"KN\0" // Saint Kitts And Nevis
-"LC\0" // Saint Lucia
-"VC\0" // Saint Vincent And The Grenadines
-"WS\0" // Samoa
-"SM\0" // San Marino
-"ST\0" // Sao Tome And Principe
-"SA\0" // Saudi Arabia
-"SN\0" // Senegal
-"SC\0" // Seychelles
-"SL\0" // Sierra Leone
-"SG\0" // Singapore
-"SK\0" // Slovakia
-"SI\0" // Slovenia
-"SB\0" // Solomon Islands
-"SO\0" // Somalia
-"ZA\0" // South Africa
-"GS\0" // South Georgia And The South Sandwich Islands
-"ES\0" // Spain
-"LK\0" // Sri Lanka
-"SH\0" // Saint Helena
-"PM\0" // Saint Pierre And Miquelon
-"SD\0" // Sudan
-"SR\0" // Suriname
-"SJ\0" // Svalbard And Jan Mayen Islands
-"SZ\0" // Swaziland
-"SE\0" // Sweden
-"CH\0" // Switzerland
-"SY\0" // Syria
-"TW\0" // Taiwan
-"TJ\0" // Tajikistan
-"TZ\0" // Tanzania
-"TH\0" // Thailand
-"TG\0" // Togo
-"TK\0" // Tokelau
-"TO\0" // Tonga
-"TT\0" // Trinidad And Tobago
-"TN\0" // Tunisia
-"TR\0" // Turkey
-"TM\0" // Turkmenistan
-"TC\0" // Turks And Caicos Islands
-"TV\0" // Tuvalu
-"UG\0" // Uganda
-"UA\0" // Ukraine
-"AE\0" // United Arab Emirates
-"GB\0" // United Kingdom
-"US\0" // United States
-"UM\0" // United States Minor Outlying Islands
-"UY\0" // Uruguay
-"UZ\0" // Uzbekistan
-"VU\0" // Vanuatu
-"VA\0" // Vatican City State
-"VE\0" // Venezuela
-"VN\0" // Vietnam
-"VG\0" // British Virgin Islands
-"VI\0" // United States Virgin Islands
-"WF\0" // Wallis And Futuna Islands
-"EH\0" // Western Sahara
-"YE\0" // Yemen
-"IC\0" // Canary Islands
-"ZM\0" // Zambia
-"ZW\0" // Zimbabwe
-"CP\0" // Clipperton Island
-"ME\0" // Montenegro
-"RS\0" // Serbia
-"BL\0" // Saint Barthelemy
-"MF\0" // Saint Martin
-"419" // Latin America
-"AC\0" // Ascension Island
-"AX\0" // Aland Islands
-"DG\0" // Diego Garcia
-"EA\0" // Ceuta And Melilla
-"IM\0" // Isle Of Man
-"JE\0" // Jersey
-"TA\0" // Tristan Da Cunha
-"SS\0" // South Sudan
-"BQ\0" // Bonaire
-"SX\0" // Sint Maarten
-"XK\0" // Kosovo
-"EU\0" // European Union
-"QO\0" // Outlying Oceania
-"001" // World
-"150" // Europe
-;
-
-// GENERATED PART ENDS HERE
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index 5f7275c5f8..a0ec372f9a 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
-const QMapDataBase QMapDataBase::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, { 0, 0, 0 }, 0 };
+const QMapDataBase QMapDataBase::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, { 0, nullptr, nullptr }, nullptr };
const QMapNodeBase *QMapNodeBase::nextNode() const
{
@@ -92,7 +92,7 @@ void QMapDataBase::rotateLeft(QMapNodeBase *x)
QMapNodeBase *&root = header.left;
QMapNodeBase *y = x->right;
x->right = y->left;
- if (y->left != 0)
+ if (y->left != nullptr)
y->left->setParent(x);
y->setParent(x->parent());
if (x == root)
@@ -111,7 +111,7 @@ void QMapDataBase::rotateRight(QMapNodeBase *x)
QMapNodeBase *&root = header.left;
QMapNodeBase *y = x->left;
x->left = y->right;
- if (y->right != 0)
+ if (y->right != nullptr)
y->right->setParent(x);
y->setParent(x->parent());
if (x == root)
@@ -173,7 +173,7 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
QMapNodeBase *y = z;
QMapNodeBase *x;
QMapNodeBase *x_parent;
- if (y->left == 0) {
+ if (y->left == nullptr) {
x = y->right;
if (y == mostLeftNode) {
if (x)
@@ -182,11 +182,11 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
mostLeftNode = y->parent();
}
} else {
- if (y->right == 0) {
+ if (y->right == nullptr) {
x = y->left;
} else {
y = y->right;
- while (y->left != 0)
+ while (y->left != nullptr)
y = y->left;
x = y->right;
}
@@ -228,7 +228,7 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
z->parent()->right = x;
}
if (y->color() != QMapNodeBase::Red) {
- while (x != root && (x == 0 || x->color() == QMapNodeBase::Black)) {
+ while (x != root && (x == nullptr || x->color() == QMapNodeBase::Black)) {
if (x == x_parent->left) {
QMapNodeBase *w = x_parent->right;
if (w->color() == QMapNodeBase::Red) {
@@ -237,13 +237,13 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
rotateLeft(x_parent);
w = x_parent->right;
}
- if ((w->left == 0 || w->left->color() == QMapNodeBase::Black) &&
- (w->right == 0 || w->right->color() == QMapNodeBase::Black)) {
+ if ((w->left == nullptr || w->left->color() == QMapNodeBase::Black) &&
+ (w->right == nullptr || w->right->color() == QMapNodeBase::Black)) {
w->setColor(QMapNodeBase::Red);
x = x_parent;
x_parent = x_parent->parent();
} else {
- if (w->right == 0 || w->right->color() == QMapNodeBase::Black) {
+ if (w->right == nullptr || w->right->color() == QMapNodeBase::Black) {
if (w->left)
w->left->setColor(QMapNodeBase::Black);
w->setColor(QMapNodeBase::Red);
@@ -265,13 +265,13 @@ void QMapDataBase::freeNodeAndRebalance(QMapNodeBase *z)
rotateRight(x_parent);
w = x_parent->left;
}
- if ((w->right == 0 || w->right->color() == QMapNodeBase::Black) &&
- (w->left == 0 || w->left->color() == QMapNodeBase::Black)) {
+ if ((w->right == nullptr || w->right->color() == QMapNodeBase::Black) &&
+ (w->left == nullptr|| w->left->color() == QMapNodeBase::Black)) {
w->setColor(QMapNodeBase::Red);
x = x_parent;
x_parent = x_parent->parent();
} else {
- if (w->left == 0 || w->left->color() == QMapNodeBase::Black) {
+ if (w->left == nullptr || w->left->color() == QMapNodeBase::Black) {
if (w->right)
w->right->setColor(QMapNodeBase::Black);
w->setColor(QMapNodeBase::Red);
@@ -363,8 +363,8 @@ QMapDataBase *QMapDataBase::createData()
d->size = 0;
d->header.p = 0;
- d->header.left = 0;
- d->header.right = 0;
+ d->header.left = nullptr;
+ d->header.right = nullptr;
d->mostLeftNode = &(d->header);
return d;
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 1cf9299e26..18c681581f 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -49,13 +49,10 @@
#include <QtCore/qdebug.h>
#endif
-#include <map>
-#include <new>
#include <functional>
-
-#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
-#endif
+#include <map>
+#include <new>
QT_BEGIN_NAMESPACE
@@ -100,10 +97,10 @@ struct Q_CORE_EXPORT QMapNodeBase
template <typename T>
static typename std::enable_if<QTypeInfo<T>::isComplex>::type
- callDestructorIfNecessary(T &t) Q_DECL_NOTHROW { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning
+ callDestructorIfNecessary(T &t) noexcept { Q_UNUSED(t); t.~T(); } // Q_UNUSED: silence MSVC unused 't' warning
template <typename T>
static typename std::enable_if<!QTypeInfo<T>::isComplex>::type
- callDestructorIfNecessary(T &) Q_DECL_NOTHROW {}
+ callDestructorIfNecessary(T &) noexcept {}
};
template <class Key, class T>
@@ -142,7 +139,7 @@ private:
rightNode()->destroySubTree();
}
- QMapNode() Q_DECL_EQ_DELETE;
+ QMapNode() = delete;
Q_DISABLE_COPY(QMapNode)
};
@@ -325,32 +322,28 @@ class QMap
QMapData<Key, T> *d;
public:
- inline QMap() Q_DECL_NOTHROW : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ inline QMap() noexcept : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
inline QMap(std::initializer_list<std::pair<Key,T> > list)
: d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null)))
{
for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it)
insert(it->first, it->second);
}
-#endif
QMap(const QMap<Key, T> &other);
inline ~QMap() { if (!d->ref.deref()) d->destroy(); }
QMap<Key, T> &operator=(const QMap<Key, T> &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QMap(QMap<Key, T> &&other) Q_DECL_NOTHROW
+ inline QMap(QMap<Key, T> &&other) noexcept
: d(other.d)
{
other.d = static_cast<QMapData<Key, T> *>(
const_cast<QMapDataBase *>(&QMapDataBase::shared_null));
}
- inline QMap<Key, T> &operator=(QMap<Key, T> &&other) Q_DECL_NOTHROW
+ inline QMap<Key, T> &operator=(QMap<Key, T> &&other) noexcept
{ QMap moved(std::move(other)); swap(moved); return *this; }
-#endif
- inline void swap(QMap<Key, T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ inline void swap(QMap<Key, T> &other) noexcept { qSwap(d, other.d); }
explicit QMap(const typename std::map<Key, T> &other);
std::map<Key, T> toStdMap() const;
@@ -1187,19 +1180,15 @@ template <class Key, class T>
class QMultiMap : public QMap<Key, T>
{
public:
- QMultiMap() Q_DECL_NOTHROW {}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ QMultiMap() noexcept {}
inline QMultiMap(std::initializer_list<std::pair<Key,T> > list)
{
for (typename std::initializer_list<std::pair<Key,T> >::const_iterator it = list.begin(); it != list.end(); ++it)
insert(it->first, it->second);
}
-#endif
QMultiMap(const QMap<Key, T> &other) : QMap<Key, T>(other) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- QMultiMap(QMap<Key, T> &&other) Q_DECL_NOTHROW : QMap<Key, T>(std::move(other)) {}
-#endif
- void swap(QMultiMap<Key, T> &other) Q_DECL_NOTHROW { QMap<Key, T>::swap(other); }
+ QMultiMap(QMap<Key, T> &&other) noexcept : QMap<Key, T>(std::move(other)) {}
+ void swap(QMultiMap<Key, T> &other) noexcept { QMap<Key, T>::swap(other); }
inline typename QMap<Key, T>::iterator replace(const Key &key, const T &value)
{ return QMap<Key, T>::insert(key, value); }
diff --git a/src/corelib/tools/qmargins.h b/src/corelib/tools/qmargins.h
index 0c73235d26..447037daaa 100644
--- a/src/corelib/tools/qmargins.h
+++ b/src/corelib/tools/qmargins.h
@@ -51,28 +51,28 @@ QT_BEGIN_NAMESPACE
class QMargins
{
public:
- Q_DECL_CONSTEXPR QMargins() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QMargins(int left, int top, int right, int bottom) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR int left() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR int top() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR int right() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR int bottom() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR void setLeft(int left) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setTop(int top) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setRight(int right) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setBottom(int bottom) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(const QMargins &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(const QMargins &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(int) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(int) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(int) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QMargins() noexcept;
+ Q_DECL_CONSTEXPR QMargins(int left, int top, int right, int bottom) noexcept;
+
+ Q_DECL_CONSTEXPR bool isNull() const noexcept;
+
+ Q_DECL_CONSTEXPR int left() const noexcept;
+ Q_DECL_CONSTEXPR int top() const noexcept;
+ Q_DECL_CONSTEXPR int right() const noexcept;
+ Q_DECL_CONSTEXPR int bottom() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR void setLeft(int left) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setTop(int top) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setRight(int right) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setBottom(int bottom) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(const QMargins &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(const QMargins &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator+=(int) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator-=(int) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(int) noexcept;
Q_DECL_RELAXED_CONSTEXPR QMargins &operator/=(int);
- Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(qreal) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR QMargins &operator*=(qreal) noexcept;
Q_DECL_RELAXED_CONSTEXPR QMargins &operator/=(qreal);
private:
@@ -81,8 +81,8 @@ private:
int m_right;
int m_bottom;
- friend Q_DECL_CONSTEXPR inline bool operator==(const QMargins &, const QMargins &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &, const QMargins &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QMargins &, const QMargins &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &, const QMargins &) noexcept;
};
Q_DECLARE_TYPEINFO(QMargins, Q_MOVABLE_TYPE);
@@ -99,40 +99,40 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QMargins &);
QMargins inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QMargins::QMargins() Q_DECL_NOTHROW : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
+Q_DECL_CONSTEXPR inline QMargins::QMargins() noexcept : m_left(0), m_top(0), m_right(0), m_bottom(0) {}
-Q_DECL_CONSTEXPR inline QMargins::QMargins(int aleft, int atop, int aright, int abottom) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins::QMargins(int aleft, int atop, int aright, int abottom) noexcept
: m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
-Q_DECL_CONSTEXPR inline bool QMargins::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QMargins::isNull() const noexcept
{ return m_left==0 && m_top==0 && m_right==0 && m_bottom==0; }
-Q_DECL_CONSTEXPR inline int QMargins::left() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::left() const noexcept
{ return m_left; }
-Q_DECL_CONSTEXPR inline int QMargins::top() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::top() const noexcept
{ return m_top; }
-Q_DECL_CONSTEXPR inline int QMargins::right() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::right() const noexcept
{ return m_right; }
-Q_DECL_CONSTEXPR inline int QMargins::bottom() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QMargins::bottom() const noexcept
{ return m_bottom; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setLeft(int aleft) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setLeft(int aleft) noexcept
{ m_left = aleft; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setTop(int atop) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setTop(int atop) noexcept
{ m_top = atop; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setRight(int aright) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setRight(int aright) noexcept
{ m_right = aright; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setBottom(int abottom) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMargins::setBottom(int abottom) noexcept
{ m_bottom = abottom; }
-Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2) noexcept
{
return
m1.m_left == m2.m_left &&
@@ -141,7 +141,7 @@ Q_DECL_CONSTEXPR inline bool operator==(const QMargins &m1, const QMargins &m2)
m1.m_bottom == m2.m_bottom;
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2) noexcept
{
return
m1.m_left != m2.m_left ||
@@ -150,55 +150,55 @@ Q_DECL_CONSTEXPR inline bool operator!=(const QMargins &m1, const QMargins &m2)
m1.m_bottom != m2.m_bottom;
}
-Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &m1, const QMargins &m2) noexcept
{
return QMargins(m1.left() + m2.left(), m1.top() + m2.top(),
m1.right() + m2.right(), m1.bottom() + m2.bottom());
}
-Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &m1, const QMargins &m2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &m1, const QMargins &m2) noexcept
{
return QMargins(m1.left() - m2.left(), m1.top() - m2.top(),
m1.right() - m2.right(), m1.bottom() - m2.bottom());
}
-Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &lhs, int rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &lhs, int rhs) noexcept
{
return QMargins(lhs.left() + rhs, lhs.top() + rhs,
lhs.right() + rhs, lhs.bottom() + rhs);
}
-Q_DECL_CONSTEXPR inline QMargins operator+(int lhs, const QMargins &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(int lhs, const QMargins &rhs) noexcept
{
return QMargins(rhs.left() + lhs, rhs.top() + lhs,
rhs.right() + lhs, rhs.bottom() + lhs);
}
-Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &lhs, int rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &lhs, int rhs) noexcept
{
return QMargins(lhs.left() - rhs, lhs.top() - rhs,
lhs.right() - rhs, lhs.bottom() - rhs);
}
-Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, int factor) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, int factor) noexcept
{
return QMargins(margins.left() * factor, margins.top() * factor,
margins.right() * factor, margins.bottom() * factor);
}
-Q_DECL_CONSTEXPR inline QMargins operator*(int factor, const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(int factor, const QMargins &margins) noexcept
{
return QMargins(margins.left() * factor, margins.top() * factor,
margins.right() * factor, margins.bottom() * factor);
}
-Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, qreal factor) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(const QMargins &margins, qreal factor) noexcept
{
return QMargins(qRound(margins.left() * factor), qRound(margins.top() * factor),
qRound(margins.right() * factor), qRound(margins.bottom() * factor));
}
-Q_DECL_CONSTEXPR inline QMargins operator*(qreal factor, const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator*(qreal factor, const QMargins &margins) noexcept
{
return QMargins(qRound(margins.left() * factor), qRound(margins.top() * factor),
qRound(margins.right() * factor), qRound(margins.bottom() * factor));
@@ -216,17 +216,17 @@ Q_DECL_CONSTEXPR inline QMargins operator/(const QMargins &margins, qreal diviso
qRound(margins.right() / divisor), qRound(margins.bottom() / divisor));
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(const QMargins &margins) noexcept
{
return *this = *this + margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(const QMargins &margins) noexcept
{
return *this = *this - margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(int margin) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(int margin) noexcept
{
m_left += margin;
m_top += margin;
@@ -235,7 +235,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator+=(int margin) Q_DEC
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(int margin) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(int margin) noexcept
{
m_left -= margin;
m_top -= margin;
@@ -244,7 +244,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator-=(int margin) Q_DEC
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(int factor) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(int factor) noexcept
{
return *this = *this * factor;
}
@@ -254,7 +254,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator/=(int divisor)
return *this = *this / divisor;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(qreal factor) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator*=(qreal factor) noexcept
{
return *this = *this * factor;
}
@@ -264,12 +264,12 @@ Q_DECL_RELAXED_CONSTEXPR inline QMargins &QMargins::operator/=(qreal divisor)
return *this = *this / divisor;
}
-Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator+(const QMargins &margins) noexcept
{
return margins;
}
-Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins operator-(const QMargins &margins) noexcept
{
return QMargins(-margins.left(), -margins.top(), -margins.right(), -margins.bottom());
}
@@ -285,30 +285,30 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QMargins &);
class QMarginsF
{
public:
- Q_DECL_CONSTEXPR QMarginsF() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QMarginsF(qreal left, qreal top, qreal right, qreal bottom) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QMarginsF(const QMargins &margins) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR bool isNull() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR qreal left() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR qreal top() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR qreal right() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR qreal bottom() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR void setLeft(qreal left) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setTop(qreal top) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setRight(qreal right) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR void setBottom(qreal bottom) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(const QMarginsF &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(const QMarginsF &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(qreal addend) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(qreal subtrahend) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator*=(qreal factor) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QMarginsF() noexcept;
+ Q_DECL_CONSTEXPR QMarginsF(qreal left, qreal top, qreal right, qreal bottom) noexcept;
+ Q_DECL_CONSTEXPR QMarginsF(const QMargins &margins) noexcept;
+
+ Q_DECL_CONSTEXPR bool isNull() const noexcept;
+
+ Q_DECL_CONSTEXPR qreal left() const noexcept;
+ Q_DECL_CONSTEXPR qreal top() const noexcept;
+ Q_DECL_CONSTEXPR qreal right() const noexcept;
+ Q_DECL_CONSTEXPR qreal bottom() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR void setLeft(qreal left) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setTop(qreal top) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setRight(qreal right) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR void setBottom(qreal bottom) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(const QMarginsF &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(const QMarginsF &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator+=(qreal addend) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator-=(qreal subtrahend) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator*=(qreal factor) noexcept;
Q_DECL_RELAXED_CONSTEXPR QMarginsF &operator/=(qreal divisor);
- Q_DECL_CONSTEXPR inline QMargins toMargins() const Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR inline QMargins toMargins() const noexcept;
private:
qreal m_left;
@@ -332,44 +332,44 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QMarginsF &);
QMarginsF inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF() Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF() noexcept
: m_left(0), m_top(0), m_right(0), m_bottom(0) {}
-Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(qreal aleft, qreal atop, qreal aright, qreal abottom) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(qreal aleft, qreal atop, qreal aright, qreal abottom) noexcept
: m_left(aleft), m_top(atop), m_right(aright), m_bottom(abottom) {}
-Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF::QMarginsF(const QMargins &margins) noexcept
: m_left(margins.left()), m_top(margins.top()), m_right(margins.right()), m_bottom(margins.bottom()) {}
-Q_DECL_CONSTEXPR inline bool QMarginsF::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QMarginsF::isNull() const noexcept
{ return qFuzzyIsNull(m_left) && qFuzzyIsNull(m_top) && qFuzzyIsNull(m_right) && qFuzzyIsNull(m_bottom); }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::left() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::left() const noexcept
{ return m_left; }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::top() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::top() const noexcept
{ return m_top; }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::right() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::right() const noexcept
{ return m_right; }
-Q_DECL_CONSTEXPR inline qreal QMarginsF::bottom() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QMarginsF::bottom() const noexcept
{ return m_bottom; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setLeft(qreal aleft) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setLeft(qreal aleft) noexcept
{ m_left = aleft; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setTop(qreal atop) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setTop(qreal atop) noexcept
{ m_top = atop; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setRight(qreal aright) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setRight(qreal aright) noexcept
{ m_right = aright; }
-Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setBottom(qreal abottom) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QMarginsF::setBottom(qreal abottom) noexcept
{ m_bottom = abottom; }
-Q_DECL_CONSTEXPR inline bool operator==(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return qFuzzyCompare(lhs.left(), rhs.left())
&& qFuzzyCompare(lhs.top(), rhs.top())
@@ -377,48 +377,48 @@ Q_DECL_CONSTEXPR inline bool operator==(const QMarginsF &lhs, const QMarginsF &r
&& qFuzzyCompare(lhs.bottom(), rhs.bottom());
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return !operator==(lhs, rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(lhs.left() + rhs.left(), lhs.top() + rhs.top(),
lhs.right() + rhs.right(), lhs.bottom() + rhs.bottom());
}
-Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(lhs.left() - rhs.left(), lhs.top() - rhs.top(),
lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom());
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, qreal rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &lhs, qreal rhs) noexcept
{
return QMarginsF(lhs.left() + rhs, lhs.top() + rhs,
lhs.right() + rhs, lhs.bottom() + rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(qreal lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(qreal lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(rhs.left() + lhs, rhs.top() + lhs,
rhs.right() + lhs, rhs.bottom() + lhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, qreal rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &lhs, qreal rhs) noexcept
{
return QMarginsF(lhs.left() - rhs, lhs.top() - rhs,
lhs.right() - rhs, lhs.bottom() - rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator*(const QMarginsF &lhs, qreal rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator*(const QMarginsF &lhs, qreal rhs) noexcept
{
return QMarginsF(lhs.left() * rhs, lhs.top() * rhs,
lhs.right() * rhs, lhs.bottom() * rhs);
}
-Q_DECL_CONSTEXPR inline QMarginsF operator*(qreal lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator*(qreal lhs, const QMarginsF &rhs) noexcept
{
return QMarginsF(rhs.left() * lhs, rhs.top() * lhs,
rhs.right() * lhs, rhs.bottom() * lhs);
@@ -430,17 +430,17 @@ Q_DECL_CONSTEXPR inline QMarginsF operator/(const QMarginsF &lhs, qreal divisor)
lhs.right() / divisor, lhs.bottom() / divisor);
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(const QMarginsF &margins) noexcept
{
return *this = *this + margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(const QMarginsF &margins) noexcept
{
return *this = *this - margins;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(qreal addend) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(qreal addend) noexcept
{
m_left += addend;
m_top += addend;
@@ -449,7 +449,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator+=(qreal addend) Q
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(qreal subtrahend) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(qreal subtrahend) noexcept
{
m_left -= subtrahend;
m_top -= subtrahend;
@@ -458,7 +458,7 @@ Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator-=(qreal subtrahen
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator*=(qreal factor) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator*=(qreal factor) noexcept
{
return *this = *this * factor;
}
@@ -468,17 +468,17 @@ Q_DECL_RELAXED_CONSTEXPR inline QMarginsF &QMarginsF::operator/=(qreal divisor)
return *this = *this / divisor;
}
-Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator+(const QMarginsF &margins) noexcept
{
return margins;
}
-Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMarginsF operator-(const QMarginsF &margins) noexcept
{
return QMarginsF(-margins.left(), -margins.top(), -margins.right(), -margins.bottom());
}
-Q_DECL_CONSTEXPR inline QMargins QMarginsF::toMargins() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QMargins QMarginsF::toMargins() const noexcept
{
return QMargins(qRound(m_left), qRound(m_top), qRound(m_right), qRound(m_bottom));
}
diff --git a/src/corelib/tools/qpair.h b/src/corelib/tools/qpair.h
index 94977fc826..9ebf88bc8f 100644
--- a/src/corelib/tools/qpair.h
+++ b/src/corelib/tools/qpair.h
@@ -52,41 +52,39 @@ struct QPair
typedef T2 second_type;
Q_DECL_CONSTEXPR QPair()
- Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_default_constructible<T1>::value &&
+ noexcept((std::is_nothrow_default_constructible<T1>::value &&
std::is_nothrow_default_constructible<T2>::value))
: first(), second() {}
Q_DECL_CONSTEXPR QPair(const T1 &t1, const T2 &t2)
- Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_copy_constructible<T1>::value &&
+ noexcept((std::is_nothrow_copy_constructible<T1>::value &&
std::is_nothrow_copy_constructible<T2>::value))
: first(t1), second(t2) {}
// compiler-generated copy/move ctor/assignment operators are fine!
template <typename TT1, typename TT2>
Q_DECL_CONSTEXPR QPair(const QPair<TT1, TT2> &p)
- Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_constructible<T1, TT1&>::value &&
+ noexcept((std::is_nothrow_constructible<T1, TT1&>::value &&
std::is_nothrow_constructible<T2, TT2&>::value))
: first(p.first), second(p.second) {}
template <typename TT1, typename TT2>
Q_DECL_RELAXED_CONSTEXPR QPair &operator=(const QPair<TT1, TT2> &p)
- Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_assignable<T1, TT1&>::value &&
+ noexcept((std::is_nothrow_assignable<T1, TT1&>::value &&
std::is_nothrow_assignable<T2, TT2&>::value))
{ first = p.first; second = p.second; return *this; }
-#ifdef Q_COMPILER_RVALUE_REFS
template <typename TT1, typename TT2>
Q_DECL_CONSTEXPR QPair(QPair<TT1, TT2> &&p)
- Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_constructible<T1, TT1>::value &&
+ noexcept((std::is_nothrow_constructible<T1, TT1>::value &&
std::is_nothrow_constructible<T2, TT2>::value))
// can't use std::move here as it's not constexpr in C++11:
: first(static_cast<TT1 &&>(p.first)), second(static_cast<TT2 &&>(p.second)) {}
template <typename TT1, typename TT2>
Q_DECL_RELAXED_CONSTEXPR QPair &operator=(QPair<TT1, TT2> &&p)
- Q_DECL_NOEXCEPT_EXPR((std::is_nothrow_assignable<T1, TT1>::value &&
+ noexcept((std::is_nothrow_assignable<T1, TT1>::value &&
std::is_nothrow_assignable<T2, TT2>::value))
{ first = std::move(p.first); second = std::move(p.second); return *this; }
-#endif
Q_DECL_RELAXED_CONSTEXPR void swap(QPair &other)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qSwap(other.first, other.first)) && noexcept(qSwap(other.second, other.second)))
+ noexcept(noexcept(qSwap(other.first, other.first)) && noexcept(qSwap(other.second, other.second)))
{
// use qSwap() to pick up ADL swaps automatically:
qSwap(first, other.first);
@@ -97,8 +95,13 @@ struct QPair
T2 second;
};
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+template<class T1, class T2>
+QPair(T1, T2) -> QPair<T1, T2>;
+#endif
+
template <typename T1, typename T2>
-void swap(QPair<T1, T2> &lhs, QPair<T1, T2> &rhs) Q_DECL_NOEXCEPT_EXPR(noexcept(lhs.swap(rhs)))
+void swap(QPair<T1, T2> &lhs, QPair<T1, T2> &rhs) noexcept(noexcept(lhs.swap(rhs)))
{ lhs.swap(rhs); }
// mark QPair<T1,T2> as complex/movable/primitive depending on the
@@ -108,45 +111,45 @@ class QTypeInfo<QPair<T1, T2> > : public QTypeInfoMerger<QPair<T1, T2>, T1, T2>
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator==(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(p1.first == p2.first && p1.second == p2.second))
+ noexcept(noexcept(p1.first == p2.first && p1.second == p2.second))
{ return p1.first == p2.first && p1.second == p2.second; }
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator!=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(!(p1 == p2)))
+ noexcept(noexcept(!(p1 == p2)))
{ return !(p1 == p2); }
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator<(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second)))
+ noexcept(noexcept(p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second)))
{
return p1.first < p2.first || (!(p2.first < p1.first) && p1.second < p2.second);
}
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator>(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(p2 < p1))
+ noexcept(noexcept(p2 < p1))
{
return p2 < p1;
}
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator<=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(!(p2 < p1)))
+ noexcept(noexcept(!(p2 < p1)))
{
return !(p2 < p1);
}
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_INLINE_TEMPLATE bool operator>=(const QPair<T1, T2> &p1, const QPair<T1, T2> &p2)
- Q_DECL_NOEXCEPT_EXPR(noexcept(!(p1 < p2)))
+ noexcept(noexcept(!(p1 < p2)))
{
return !(p1 < p2);
}
template <class T1, class T2>
Q_DECL_CONSTEXPR Q_OUTOFLINE_TEMPLATE QPair<T1, T2> qMakePair(const T1 &x, const T2 &y)
- Q_DECL_NOEXCEPT_EXPR(noexcept(QPair<T1, T2>(x, y)))
+ noexcept(noexcept(QPair<T1, T2>(x, y)))
{
return QPair<T1, T2>(x, y);
}
diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc
index 59e6931995..65576ef2e6 100644
--- a/src/corelib/tools/qpair.qdoc
+++ b/src/corelib/tools/qpair.qdoc
@@ -28,6 +28,7 @@
/*!
\class QPair
\inmodule QtCore
+ \reentrant
\brief The QPair class is a template class that stores a pair of items.
\ingroup tools
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp
index e98eaac4fc..432fb33297 100644
--- a/src/corelib/tools/qpoint.cpp
+++ b/src/corelib/tools/qpoint.cpp
@@ -138,6 +138,17 @@ QT_BEGIN_NAMESPACE
\sa y(), setX()
*/
+/*!
+ \fn QPoint::transposed() const
+ \since 5.14
+
+ Returns a point with x and y coordinates exchanged:
+ \code
+ QPoint{1, 2}.transposed() // {2, 1}
+ \endcode
+
+ \sa x(), y(), setX(), setY()
+*/
/*!
\fn int &QPoint::rx()
@@ -583,6 +594,18 @@ QDebug operator<<(QDebug dbg, const QPointF &p)
*/
/*!
+ \fn QPointF::transposed() const
+ \since 5.14
+
+ Returns a point with x and y coordinates exchanged:
+ \code
+ QPointF{1.0, 2.0}.transposed() // {2.0, 1.0}
+ \endcode
+
+ \sa x(), y(), setX(), setY()
+*/
+
+/*!
\fn qreal& QPointF::rx()
Returns a reference to the x coordinate of this point.
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index d7323f7707..fe952f95da 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -64,6 +64,8 @@ public:
Q_DECL_CONSTEXPR inline int manhattanLength() const;
+ Q_DECL_CONSTEXPR QPoint transposed() const noexcept { return {yp, xp}; }
+
Q_DECL_RELAXED_CONSTEXPR inline int &rx();
Q_DECL_RELAXED_CONSTEXPR inline int &ry();
@@ -94,7 +96,7 @@ public:
friend Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &, qreal);
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT CGPoint toCGPoint() const noexcept;
#endif
private:
@@ -232,6 +234,8 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void setX(qreal x);
Q_DECL_RELAXED_CONSTEXPR inline void setY(qreal y);
+ Q_DECL_CONSTEXPR QPointF transposed() const noexcept { return {yp, xp}; }
+
Q_DECL_RELAXED_CONSTEXPR inline qreal &rx();
Q_DECL_RELAXED_CONSTEXPR inline qreal &ry();
@@ -256,8 +260,8 @@ public:
Q_DECL_CONSTEXPR QPoint toPoint() const;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT static QPointF fromCGPoint(CGPoint point) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT static QPointF fromCGPoint(CGPoint point) noexcept;
+ Q_REQUIRED_RESULT CGPoint toCGPoint() const noexcept;
#endif
private:
diff --git a/src/corelib/tools/qqueue.h b/src/corelib/tools/qqueue.h
index b55f210577..d5a60ada56 100644
--- a/src/corelib/tools/qqueue.h
+++ b/src/corelib/tools/qqueue.h
@@ -50,11 +50,11 @@ class QQueue : public QList<T>
{
public:
// compiler-generated special member functions are fine!
- inline void swap(QQueue<T> &other) Q_DECL_NOTHROW { QList<T>::swap(other); } // prevent QList<->QQueue swaps
+ inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QQueue swaps
#ifndef Q_QDOC
// bring in QList::swap(int, int). We cannot say using QList<T>::swap,
// because we don't want to make swap(QList&) available.
- inline void swap(int i, int j) { QList<T>::swap(i, j); }
+ Q_DECL_DEPRECATED inline void swap(int i, int j) { QList<T>::swapItemsAt(i, j); }
#endif
inline void enqueue(const T &t) { QList<T>::append(t); }
inline T dequeue() { return QList<T>::takeFirst(); }
diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp
index c8301e2590..cd20102a2b 100644
--- a/src/corelib/tools/qrect.cpp
+++ b/src/corelib/tools/qrect.cpp
@@ -300,7 +300,7 @@ QT_BEGIN_NAMESPACE
\sa isValid(), isEmpty()
*/
-QRect QRect::normalized() const Q_DECL_NOTHROW
+QRect QRect::normalized() const noexcept
{
QRect r;
if (x2 < x1 - 1) { // swap bad x values
@@ -820,7 +820,7 @@ QRect QRect::normalized() const Q_DECL_NOTHROW
\sa intersects()
*/
-bool QRect::contains(const QPoint &p, bool proper) const Q_DECL_NOTHROW
+bool QRect::contains(const QPoint &p, bool proper) const noexcept
{
int l, r;
if (x2 < x1 - 1) {
@@ -884,7 +884,7 @@ bool QRect::contains(const QPoint &p, bool proper) const Q_DECL_NOTHROW
rectangle (not on the edge).
*/
-bool QRect::contains(const QRect &r, bool proper) const Q_DECL_NOTHROW
+bool QRect::contains(const QRect &r, bool proper) const noexcept
{
if (isNull() || r.isNull())
return false;
@@ -962,7 +962,7 @@ bool QRect::contains(const QRect &r, bool proper) const Q_DECL_NOTHROW
\sa operator|=(), united()
*/
-QRect QRect::operator|(const QRect &r) const Q_DECL_NOTHROW
+QRect QRect::operator|(const QRect &r) const noexcept
{
if (isNull())
return r;
@@ -1033,7 +1033,7 @@ QRect QRect::operator|(const QRect &r) const Q_DECL_NOTHROW
\sa operator&=(), intersected()
*/
-QRect QRect::operator&(const QRect &r) const Q_DECL_NOTHROW
+QRect QRect::operator&(const QRect &r) const noexcept
{
if (isNull() || r.isNull())
return QRect();
@@ -1112,7 +1112,7 @@ QRect QRect::operator&(const QRect &r) const Q_DECL_NOTHROW
\sa contains()
*/
-bool QRect::intersects(const QRect &r) const Q_DECL_NOTHROW
+bool QRect::intersects(const QRect &r) const noexcept
{
if (isNull() || r.isNull())
return false;
@@ -1540,7 +1540,7 @@ QDebug operator<<(QDebug dbg, const QRect &r)
\sa isValid(), isEmpty()
*/
-QRectF QRectF::normalized() const Q_DECL_NOTHROW
+QRectF QRectF::normalized() const noexcept
{
QRectF r = *this;
if (r.w < 0) {
@@ -1964,7 +1964,7 @@ QRectF QRectF::normalized() const Q_DECL_NOTHROW
\sa intersects()
*/
-bool QRectF::contains(const QPointF &p) const Q_DECL_NOTHROW
+bool QRectF::contains(const QPointF &p) const noexcept
{
qreal l = xp;
qreal r = xp;
@@ -2010,7 +2010,7 @@ bool QRectF::contains(const QPointF &p) const Q_DECL_NOTHROW
otherwise returns \c false.
*/
-bool QRectF::contains(const QRectF &r) const Q_DECL_NOTHROW
+bool QRectF::contains(const QRectF &r) const noexcept
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2148,7 +2148,7 @@ bool QRectF::contains(const QRectF &r) const Q_DECL_NOTHROW
\sa united(), operator|=()
*/
-QRectF QRectF::operator|(const QRectF &r) const Q_DECL_NOTHROW
+QRectF QRectF::operator|(const QRectF &r) const noexcept
{
if (isNull())
return r;
@@ -2217,7 +2217,7 @@ QRectF QRectF::operator|(const QRectF &r) const Q_DECL_NOTHROW
\sa operator&=(), intersected()
*/
-QRectF QRectF::operator&(const QRectF &r) const Q_DECL_NOTHROW
+QRectF QRectF::operator&(const QRectF &r) const noexcept
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2302,7 +2302,7 @@ QRectF QRectF::operator&(const QRectF &r) const Q_DECL_NOTHROW
\sa contains()
*/
-bool QRectF::intersects(const QRectF &r) const Q_DECL_NOTHROW
+bool QRectF::intersects(const QRectF &r) const noexcept
{
qreal l1 = xp;
qreal r1 = xp;
@@ -2369,7 +2369,7 @@ bool QRectF::intersects(const QRectF &r) const Q_DECL_NOTHROW
\sa toRect()
*/
-QRect QRectF::toAlignedRect() const Q_DECL_NOTHROW
+QRect QRectF::toAlignedRect() const noexcept
{
int xmin = int(qFloor(xp));
int xmax = int(qCeil(xp + w));
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index 3b40055b5a..7aa2312f38 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -57,104 +57,104 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QRect
{
public:
- Q_DECL_CONSTEXPR QRect() Q_DECL_NOTHROW : x1(0), y1(0), x2(-1), y2(-1) {}
- Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QPoint &bottomright) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QSize &size) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRect(int left, int top, int width, int height) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline int left() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int top() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int right() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int bottom() const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QRect normalized() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline int x() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int y() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setLeft(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTop(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setRight(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottom(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setX(int x) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setY(int y) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPoint &p) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QPoint topLeft() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint bottomRight() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint topRight() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint bottomLeft() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QPoint center() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTop(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveRight(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(int pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPoint &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPoint &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void translate(int dx, int dy) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPoint &p) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect transposed() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(int x, int t) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPoint &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setRect(int x, int y, int w, int h) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QRect() noexcept : x1(0), y1(0), x2(-1), y2(-1) {}
+ Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QPoint &bottomright) noexcept;
+ Q_DECL_CONSTEXPR QRect(const QPoint &topleft, const QSize &size) noexcept;
+ Q_DECL_CONSTEXPR QRect(int left, int top, int width, int height) noexcept;
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+
+ Q_DECL_CONSTEXPR inline int left() const noexcept;
+ Q_DECL_CONSTEXPR inline int top() const noexcept;
+ Q_DECL_CONSTEXPR inline int right() const noexcept;
+ Q_DECL_CONSTEXPR inline int bottom() const noexcept;
+ Q_REQUIRED_RESULT QRect normalized() const noexcept;
+
+ Q_DECL_CONSTEXPR inline int x() const noexcept;
+ Q_DECL_CONSTEXPR inline int y() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setLeft(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTop(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setRight(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottom(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setX(int x) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setY(int y) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPoint &p) noexcept;
+
+ Q_DECL_CONSTEXPR inline QPoint topLeft() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint bottomRight() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint topRight() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint bottomLeft() const noexcept;
+ Q_DECL_CONSTEXPR inline QPoint center() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTop(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveRight(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(int pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPoint &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPoint &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(int dx, int dy) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPoint &p) noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect transposed() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(int x, int t) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPoint &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setRect(int x, int y, int w, int h) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getRect(int *x, int *y, int *w, int *h) const;
- Q_DECL_RELAXED_CONSTEXPR inline void setCoords(int x1, int y1, int x2, int y2) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void setCoords(int x1, int y1, int x2, int y2) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
- Q_DECL_RELAXED_CONSTEXPR inline void adjust(int x1, int y1, int x2, int y2) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QSize size() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSize &s) Q_DECL_NOTHROW;
-
- QRect operator|(const QRect &r) const Q_DECL_NOTHROW;
- QRect operator&(const QRect &r) const Q_DECL_NOTHROW;
- inline QRect& operator|=(const QRect &r) Q_DECL_NOTHROW;
- inline QRect& operator&=(const QRect &r) Q_DECL_NOTHROW;
-
- bool contains(const QRect &r, bool proper = false) const Q_DECL_NOTHROW;
- bool contains(const QPoint &p, bool proper=false) const Q_DECL_NOTHROW;
- inline bool contains(int x, int y) const Q_DECL_NOTHROW;
- inline bool contains(int x, int y, bool proper) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRect united(const QRect &other) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRect intersected(const QRect &other) const Q_DECL_NOTHROW;
- bool intersects(const QRect &r) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QRect marginsAdded(const QMargins &margins) const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QRect marginsRemoved(const QMargins &margins) const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRect &operator+=(const QMargins &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRect &operator-=(const QMargins &margins) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void adjust(int x1, int y1, int x2, int y2) noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QSize size() const noexcept;
+ Q_DECL_CONSTEXPR inline int width() const noexcept;
+ Q_DECL_CONSTEXPR inline int height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSize &s) noexcept;
+
+ QRect operator|(const QRect &r) const noexcept;
+ QRect operator&(const QRect &r) const noexcept;
+ inline QRect& operator|=(const QRect &r) noexcept;
+ inline QRect& operator&=(const QRect &r) noexcept;
+
+ bool contains(const QRect &r, bool proper = false) const noexcept;
+ bool contains(const QPoint &p, bool proper=false) const noexcept;
+ inline bool contains(int x, int y) const noexcept;
+ inline bool contains(int x, int y, bool proper) const noexcept;
+ Q_REQUIRED_RESULT inline QRect united(const QRect &other) const noexcept;
+ Q_REQUIRED_RESULT inline QRect intersected(const QRect &other) const noexcept;
+ bool intersects(const QRect &r) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QRect marginsAdded(const QMargins &margins) const noexcept;
+ Q_DECL_CONSTEXPR inline QRect marginsRemoved(const QMargins &margins) const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRect &operator+=(const QMargins &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRect &operator-=(const QMargins &margins) noexcept;
#if QT_DEPRECATED_SINCE(5, 0)
- Q_REQUIRED_RESULT QT_DEPRECATED QRect unite(const QRect &r) const Q_DECL_NOTHROW { return united(r); }
- Q_REQUIRED_RESULT QT_DEPRECATED QRect intersect(const QRect &r) const Q_DECL_NOTHROW { return intersected(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRect unite(const QRect &r) const noexcept { return united(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRect intersect(const QRect &r) const noexcept { return intersected(r); }
#endif
- friend Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT CGRect toCGRect() const noexcept;
#endif
private:
@@ -165,8 +165,8 @@ private:
};
Q_DECLARE_TYPEINFO(QRect, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) Q_DECL_NOTHROW;
-Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) Q_DECL_NOTHROW;
+Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) noexcept;
+Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) noexcept;
/*****************************************************************************
@@ -181,97 +181,97 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRect &);
QRect inline member functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QRect::QRect(int aleft, int atop, int awidth, int aheight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect::QRect(int aleft, int atop, int awidth, int aheight) noexcept
: x1(aleft), y1(atop), x2(aleft + awidth - 1), y2(atop + aheight - 1) {}
-Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight) noexcept
: x1(atopLeft.x()), y1(atopLeft.y()), x2(abottomRight.x()), y2(abottomRight.y()) {}
-Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QSize &asize) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect::QRect(const QPoint &atopLeft, const QSize &asize) noexcept
: x1(atopLeft.x()), y1(atopLeft.y()), x2(atopLeft.x()+asize.width() - 1), y2(atopLeft.y()+asize.height() - 1) {}
-Q_DECL_CONSTEXPR inline bool QRect::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRect::isNull() const noexcept
{ return x2 == x1 - 1 && y2 == y1 - 1; }
-Q_DECL_CONSTEXPR inline bool QRect::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRect::isEmpty() const noexcept
{ return x1 > x2 || y1 > y2; }
-Q_DECL_CONSTEXPR inline bool QRect::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRect::isValid() const noexcept
{ return x1 <= x2 && y1 <= y2; }
-Q_DECL_CONSTEXPR inline int QRect::left() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::left() const noexcept
{ return x1; }
-Q_DECL_CONSTEXPR inline int QRect::top() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::top() const noexcept
{ return y1; }
-Q_DECL_CONSTEXPR inline int QRect::right() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::right() const noexcept
{ return x2; }
-Q_DECL_CONSTEXPR inline int QRect::bottom() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::bottom() const noexcept
{ return y2; }
-Q_DECL_CONSTEXPR inline int QRect::x() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::x() const noexcept
{ return x1; }
-Q_DECL_CONSTEXPR inline int QRect::y() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::y() const noexcept
{ return y1; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setLeft(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setLeft(int pos) noexcept
{ x1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTop(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTop(int pos) noexcept
{ y1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRight(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRight(int pos) noexcept
{ x2 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottom(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottom(int pos) noexcept
{ y2 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopLeft(const QPoint &p) noexcept
{ x1 = p.x(); y1 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomRight(const QPoint &p) noexcept
{ x2 = p.x(); y2 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setTopRight(const QPoint &p) noexcept
{ x2 = p.x(); y1 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setBottomLeft(const QPoint &p) noexcept
{ x1 = p.x(); y2 = p.y(); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setX(int ax) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setX(int ax) noexcept
{ x1 = ax; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setY(int ay) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setY(int ay) noexcept
{ y1 = ay; }
-Q_DECL_CONSTEXPR inline QPoint QRect::topLeft() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::topLeft() const noexcept
{ return QPoint(x1, y1); }
-Q_DECL_CONSTEXPR inline QPoint QRect::bottomRight() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::bottomRight() const noexcept
{ return QPoint(x2, y2); }
-Q_DECL_CONSTEXPR inline QPoint QRect::topRight() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::topRight() const noexcept
{ return QPoint(x2, y1); }
-Q_DECL_CONSTEXPR inline QPoint QRect::bottomLeft() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::bottomLeft() const noexcept
{ return QPoint(x1, y2); }
-Q_DECL_CONSTEXPR inline QPoint QRect::center() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPoint QRect::center() const noexcept
{ return QPoint(int((qint64(x1)+x2)/2), int((qint64(y1)+y2)/2)); } // cast avoids overflow on addition
-Q_DECL_CONSTEXPR inline int QRect::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::width() const noexcept
{ return x2 - x1 + 1; }
-Q_DECL_CONSTEXPR inline int QRect::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QRect::height() const noexcept
{ return y2 - y1 + 1; }
-Q_DECL_CONSTEXPR inline QSize QRect::size() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QRect::size() const noexcept
{ return QSize(width(), height()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(int dx, int dy) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(int dx, int dy) noexcept
{
x1 += dx;
y1 += dy;
@@ -279,7 +279,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(int dx, int dy) Q_DECL_NOT
y2 += dy;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(const QPoint &p) noexcept
{
x1 += p.x();
y1 += p.y();
@@ -287,16 +287,16 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::translate(const QPoint &p) Q_DECL_NO
y2 += p.y();
}
-Q_DECL_CONSTEXPR inline QRect QRect::translated(int dx, int dy) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::translated(int dx, int dy) const noexcept
{ return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
-Q_DECL_CONSTEXPR inline QRect QRect::translated(const QPoint &p) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::translated(const QPoint &p) const noexcept
{ return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
-Q_DECL_CONSTEXPR inline QRect QRect::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::transposed() const noexcept
{ return QRect(topLeft(), size().transposed()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(int ax, int ay) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(int ax, int ay) noexcept
{
x2 += ax - x1;
y2 += ay - y1;
@@ -304,7 +304,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(int ax, int ay) Q_DECL_NOTHRO
y1 = ay;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(const QPoint &p) noexcept
{
x2 += p.x() - x1;
y2 += p.y() - y1;
@@ -312,49 +312,49 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTo(const QPoint &p) Q_DECL_NOTHR
y1 = p.y();
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveLeft(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveLeft(int pos) noexcept
{ x2 += (pos - x1); x1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTop(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTop(int pos) noexcept
{ y2 += (pos - y1); y1 = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveRight(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveRight(int pos) noexcept
{
x1 += (pos - x2);
x2 = pos;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottom(int pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottom(int pos) noexcept
{
y1 += (pos - y2);
y2 = pos;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopLeft(const QPoint &p) noexcept
{
moveLeft(p.x());
moveTop(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomRight(const QPoint &p) noexcept
{
moveRight(p.x());
moveBottom(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopRight(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveTopRight(const QPoint &p) noexcept
{
moveRight(p.x());
moveTop(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomLeft(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveBottomLeft(const QPoint &p) noexcept
{
moveLeft(p.x());
moveBottom(p.y());
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveCenter(const QPoint &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::moveCenter(const QPoint &p) noexcept
{
int w = x2 - x1;
int h = y2 - y1;
@@ -372,7 +372,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::getRect(int *ax, int *ay, int *aw, i
*ah = y2 - y1 + 1;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRect(int ax, int ay, int aw, int ah) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setRect(int ax, int ay, int aw, int ah) noexcept
{
x1 = ax;
y1 = ay;
@@ -388,7 +388,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::getCoords(int *xp1, int *yp1, int *x
*yp2 = y2;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2) noexcept
{
x1 = xp1;
y1 = yp1;
@@ -396,10 +396,10 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::setCoords(int xp1, int yp1, int xp2,
y2 = yp2;
}
-Q_DECL_CONSTEXPR inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const noexcept
{ return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2) noexcept
{
x1 += dx1;
y1 += dy1;
@@ -407,97 +407,97 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRect::adjust(int dx1, int dy1, int dx2, in
y2 += dy2;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setWidth(int w) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setWidth(int w) noexcept
{ x2 = (x1 + w - 1); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setHeight(int h) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setHeight(int h) noexcept
{ y2 = (y1 + h - 1); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRect::setSize(const QSize &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRect::setSize(const QSize &s) noexcept
{
x2 = (s.width() + x1 - 1);
y2 = (s.height() + y1 - 1);
}
-inline bool QRect::contains(int ax, int ay, bool aproper) const Q_DECL_NOTHROW
+inline bool QRect::contains(int ax, int ay, bool aproper) const noexcept
{
return contains(QPoint(ax, ay), aproper);
}
-inline bool QRect::contains(int ax, int ay) const Q_DECL_NOTHROW
+inline bool QRect::contains(int ax, int ay) const noexcept
{
return contains(QPoint(ax, ay), false);
}
-inline QRect& QRect::operator|=(const QRect &r) Q_DECL_NOTHROW
+inline QRect& QRect::operator|=(const QRect &r) noexcept
{
*this = *this | r;
return *this;
}
-inline QRect& QRect::operator&=(const QRect &r) Q_DECL_NOTHROW
+inline QRect& QRect::operator&=(const QRect &r) noexcept
{
*this = *this & r;
return *this;
}
-inline QRect QRect::intersected(const QRect &other) const Q_DECL_NOTHROW
+inline QRect QRect::intersected(const QRect &other) const noexcept
{
return *this & other;
}
-inline QRect QRect::united(const QRect &r) const Q_DECL_NOTHROW
+inline QRect QRect::united(const QRect &r) const noexcept
{
return *this | r;
}
-Q_DECL_CONSTEXPR inline bool operator==(const QRect &r1, const QRect &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QRect &r1, const QRect &r2) noexcept
{
return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QRect &r1, const QRect &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QRect &r1, const QRect &r2) noexcept
{
return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
}
-Q_DECL_CONSTEXPR inline QRect operator+(const QRect &rectangle, const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect operator+(const QRect &rectangle, const QMargins &margins) noexcept
{
return QRect(QPoint(rectangle.left() - margins.left(), rectangle.top() - margins.top()),
QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect operator+(const QMargins &margins, const QRect &rectangle) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect operator+(const QMargins &margins, const QRect &rectangle) noexcept
{
return QRect(QPoint(rectangle.left() - margins.left(), rectangle.top() - margins.top()),
QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect operator-(const QRect &lhs, const QMargins &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect operator-(const QRect &lhs, const QMargins &rhs) noexcept
{
return QRect(QPoint(lhs.left() + rhs.left(), lhs.top() + rhs.top()),
QPoint(lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect QRect::marginsAdded(const QMargins &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::marginsAdded(const QMargins &margins) const noexcept
{
return QRect(QPoint(x1 - margins.left(), y1 - margins.top()),
QPoint(x2 + margins.right(), y2 + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRect QRect::marginsRemoved(const QMargins &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRect::marginsRemoved(const QMargins &margins) const noexcept
{
return QRect(QPoint(x1 + margins.left(), y1 + margins.top()),
QPoint(x2 - margins.right(), y2 - margins.bottom()));
}
-Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator+=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator+=(const QMargins &margins) noexcept
{
*this = marginsAdded(margins);
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator-=(const QMargins &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRect &QRect::operator-=(const QMargins &margins) noexcept
{
*this = marginsRemoved(margins);
return *this;
@@ -511,110 +511,110 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QRect &);
class Q_CORE_EXPORT QRectF
{
public:
- Q_DECL_CONSTEXPR QRectF() Q_DECL_NOTHROW : xp(0.), yp(0.), w(0.), h(0.) {}
- Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QSizeF &size) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QPointF &bottomRight) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRectF(qreal left, qreal top, qreal width, qreal height) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QRectF(const QRect &rect) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QRectF normalized() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline qreal left() const Q_DECL_NOTHROW { return xp; }
- Q_DECL_CONSTEXPR inline qreal top() const Q_DECL_NOTHROW { return yp; }
- Q_DECL_CONSTEXPR inline qreal right() const Q_DECL_NOTHROW { return xp + w; }
- Q_DECL_CONSTEXPR inline qreal bottom() const Q_DECL_NOTHROW { return yp + h; }
-
- Q_DECL_CONSTEXPR inline qreal x() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal y() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setLeft(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTop(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setRight(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottom(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setX(qreal pos) Q_DECL_NOTHROW { setLeft(pos); }
- Q_DECL_RELAXED_CONSTEXPR inline void setY(qreal pos) Q_DECL_NOTHROW { setTop(pos); }
-
- Q_DECL_CONSTEXPR inline QPointF topLeft() const Q_DECL_NOTHROW { return QPointF(xp, yp); }
- Q_DECL_CONSTEXPR inline QPointF bottomRight() const Q_DECL_NOTHROW { return QPointF(xp+w, yp+h); }
- Q_DECL_CONSTEXPR inline QPointF topRight() const Q_DECL_NOTHROW { return QPointF(xp+w, yp); }
- Q_DECL_CONSTEXPR inline QPointF bottomLeft() const Q_DECL_NOTHROW { return QPointF(xp, yp+h); }
- Q_DECL_CONSTEXPR inline QPointF center() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTop(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveRight(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(qreal pos) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPointF &p) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void translate(qreal dx, qreal dy) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF transposed() const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(qreal x, qreal y) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPointF &p) Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline void setRect(qreal x, qreal y, qreal w, qreal h) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QRectF() noexcept : xp(0.), yp(0.), w(0.), h(0.) {}
+ Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QSizeF &size) noexcept;
+ Q_DECL_CONSTEXPR QRectF(const QPointF &topleft, const QPointF &bottomRight) noexcept;
+ Q_DECL_CONSTEXPR QRectF(qreal left, qreal top, qreal width, qreal height) noexcept;
+ Q_DECL_CONSTEXPR QRectF(const QRect &rect) noexcept;
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+ Q_REQUIRED_RESULT QRectF normalized() const noexcept;
+
+ Q_DECL_CONSTEXPR inline qreal left() const noexcept { return xp; }
+ Q_DECL_CONSTEXPR inline qreal top() const noexcept { return yp; }
+ Q_DECL_CONSTEXPR inline qreal right() const noexcept { return xp + w; }
+ Q_DECL_CONSTEXPR inline qreal bottom() const noexcept { return yp + h; }
+
+ Q_DECL_CONSTEXPR inline qreal x() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal y() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setLeft(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTop(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setRight(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottom(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setX(qreal pos) noexcept { setLeft(pos); }
+ Q_DECL_RELAXED_CONSTEXPR inline void setY(qreal pos) noexcept { setTop(pos); }
+
+ Q_DECL_CONSTEXPR inline QPointF topLeft() const noexcept { return QPointF(xp, yp); }
+ Q_DECL_CONSTEXPR inline QPointF bottomRight() const noexcept { return QPointF(xp+w, yp+h); }
+ Q_DECL_CONSTEXPR inline QPointF topRight() const noexcept { return QPointF(xp+w, yp); }
+ Q_DECL_CONSTEXPR inline QPointF bottomLeft() const noexcept { return QPointF(xp, yp+h); }
+ Q_DECL_CONSTEXPR inline QPointF center() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopLeft(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setTopRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setBottomLeft(const QPointF &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveLeft(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTop(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveRight(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottom(qreal pos) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopLeft(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTopRight(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveBottomLeft(const QPointF &p) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveCenter(const QPointF &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(qreal dx, qreal dy) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPointF &p) noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF transposed() const noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(qreal x, qreal y) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPointF &p) noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline void setRect(qreal x, qreal y, qreal w, qreal h) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const;
- Q_DECL_RELAXED_CONSTEXPR inline void setCoords(qreal x1, qreal y1, qreal x2, qreal y2) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void setCoords(qreal x1, qreal y1, qreal x2, qreal y2) noexcept;
Q_DECL_RELAXED_CONSTEXPR inline void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
- Q_DECL_RELAXED_CONSTEXPR inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QSizeF size() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSizeF &s) Q_DECL_NOTHROW;
-
- QRectF operator|(const QRectF &r) const Q_DECL_NOTHROW;
- QRectF operator&(const QRectF &r) const Q_DECL_NOTHROW;
- inline QRectF& operator|=(const QRectF &r) Q_DECL_NOTHROW;
- inline QRectF& operator&=(const QRectF &r) Q_DECL_NOTHROW;
-
- bool contains(const QRectF &r) const Q_DECL_NOTHROW;
- bool contains(const QPointF &p) const Q_DECL_NOTHROW;
- inline bool contains(qreal x, qreal y) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRectF united(const QRectF &other) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT inline QRectF intersected(const QRectF &other) const Q_DECL_NOTHROW;
- bool intersects(const QRectF &r) const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline QRectF marginsAdded(const QMarginsF &margins) const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline QRectF marginsRemoved(const QMarginsF &margins) const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator+=(const QMarginsF &margins) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator-=(const QMarginsF &margins) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QSizeF size() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal width() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setSize(const QSizeF &s) noexcept;
+
+ QRectF operator|(const QRectF &r) const noexcept;
+ QRectF operator&(const QRectF &r) const noexcept;
+ inline QRectF& operator|=(const QRectF &r) noexcept;
+ inline QRectF& operator&=(const QRectF &r) noexcept;
+
+ bool contains(const QRectF &r) const noexcept;
+ bool contains(const QPointF &p) const noexcept;
+ inline bool contains(qreal x, qreal y) const noexcept;
+ Q_REQUIRED_RESULT inline QRectF united(const QRectF &other) const noexcept;
+ Q_REQUIRED_RESULT inline QRectF intersected(const QRectF &other) const noexcept;
+ bool intersects(const QRectF &r) const noexcept;
+
+ Q_DECL_CONSTEXPR inline QRectF marginsAdded(const QMarginsF &margins) const noexcept;
+ Q_DECL_CONSTEXPR inline QRectF marginsRemoved(const QMarginsF &margins) const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator+=(const QMarginsF &margins) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator-=(const QMarginsF &margins) noexcept;
#if QT_DEPRECATED_SINCE(5, 0)
- Q_REQUIRED_RESULT QT_DEPRECATED QRectF unite(const QRectF &r) const Q_DECL_NOTHROW { return united(r); }
- Q_REQUIRED_RESULT QT_DEPRECATED QRectF intersect(const QRectF &r) const Q_DECL_NOTHROW { return intersected(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRectF unite(const QRectF &r) const noexcept { return united(r); }
+ Q_REQUIRED_RESULT QT_DEPRECATED QRectF intersect(const QRectF &r) const noexcept { return intersected(r); }
#endif
- friend Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) noexcept;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect toRect() const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QRect toAlignedRect() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect toRect() const noexcept;
+ Q_REQUIRED_RESULT QRect toAlignedRect() const noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT static QRectF fromCGRect(CGRect rect) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT static QRectF fromCGRect(CGRect rect) noexcept;
+ Q_REQUIRED_RESULT CGRect toCGRect() const noexcept;
#endif
private:
@@ -625,8 +625,8 @@ private:
};
Q_DECLARE_TYPEINFO(QRectF, Q_MOVABLE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
-Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) Q_DECL_NOTHROW;
+Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) noexcept;
+Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) noexcept;
/*****************************************************************************
@@ -641,23 +641,23 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRectF &);
QRectF inline member functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight) noexcept
: xp(aleft), yp(atop), w(awidth), h(aheight)
{
}
-Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize) noexcept
: xp(atopLeft.x()), yp(atopLeft.y()), w(asize.width()), h(asize.height())
{
}
-Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight) noexcept
: xp(atopLeft.x()), yp(atopLeft.y()), w(abottomRight.x() - atopLeft.x()), h(abottomRight.y() - atopLeft.y())
{
}
-Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF::QRectF(const QRect &r) noexcept
: xp(r.x()), yp(r.y()), w(r.width()), h(r.height())
{
}
@@ -666,117 +666,117 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wfloat-equal")
QT_WARNING_DISABLE_GCC("-Wfloat-equal")
-Q_DECL_CONSTEXPR inline bool QRectF::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRectF::isNull() const noexcept
{ return w == 0. && h == 0.; }
-Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRectF::isEmpty() const noexcept
{ return w <= 0. || h <= 0.; }
QT_WARNING_POP
-Q_DECL_CONSTEXPR inline bool QRectF::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QRectF::isValid() const noexcept
{ return w > 0. && h > 0.; }
-Q_DECL_CONSTEXPR inline qreal QRectF::x() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::x() const noexcept
{ return xp; }
-Q_DECL_CONSTEXPR inline qreal QRectF::y() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::y() const noexcept
{ return yp; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setLeft(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setLeft(qreal pos) noexcept
{ qreal diff = pos - xp; xp += diff; w -= diff; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRight(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRight(qreal pos) noexcept
{ w = pos - xp; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTop(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTop(qreal pos) noexcept
{ qreal diff = pos - yp; yp += diff; h -= diff; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottom(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottom(qreal pos) noexcept
{ h = pos - yp; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopLeft(const QPointF &p) noexcept
{ setLeft(p.x()); setTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setTopRight(const QPointF &p) noexcept
{ setRight(p.x()); setTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomLeft(const QPointF &p) noexcept
{ setLeft(p.x()); setBottom(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setBottomRight(const QPointF &p) noexcept
{ setRight(p.x()); setBottom(p.y()); }
-Q_DECL_CONSTEXPR inline QPointF QRectF::center() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QPointF QRectF::center() const noexcept
{ return QPointF(xp + w/2, yp + h/2); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveLeft(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveLeft(qreal pos) noexcept
{ xp = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTop(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTop(qreal pos) noexcept
{ yp = pos; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveRight(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveRight(qreal pos) noexcept
{ xp = pos - w; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottom(qreal pos) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottom(qreal pos) noexcept
{ yp = pos - h; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopLeft(const QPointF &p) noexcept
{ moveLeft(p.x()); moveTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTopRight(const QPointF &p) noexcept
{ moveRight(p.x()); moveTop(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomLeft(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomLeft(const QPointF &p) noexcept
{ moveLeft(p.x()); moveBottom(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomRight(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveBottomRight(const QPointF &p) noexcept
{ moveRight(p.x()); moveBottom(p.y()); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveCenter(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveCenter(const QPointF &p) noexcept
{ xp = p.x() - w/2; yp = p.y() - h/2; }
-Q_DECL_CONSTEXPR inline qreal QRectF::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::width() const noexcept
{ return w; }
-Q_DECL_CONSTEXPR inline qreal QRectF::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QRectF::height() const noexcept
{ return h; }
-Q_DECL_CONSTEXPR inline QSizeF QRectF::size() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QRectF::size() const noexcept
{ return QSizeF(w, h); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(qreal dx, qreal dy) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(qreal dx, qreal dy) noexcept
{
xp += dx;
yp += dy;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::translate(const QPointF &p) noexcept
{
xp += p.x();
yp += p.y();
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(qreal ax, qreal ay) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(qreal ax, qreal ay) noexcept
{
xp = ax;
yp = ay;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(const QPointF &p) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::moveTo(const QPointF &p) noexcept
{
xp = p.x();
yp = p.y();
}
-Q_DECL_CONSTEXPR inline QRectF QRectF::translated(qreal dx, qreal dy) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::translated(qreal dx, qreal dy) const noexcept
{ return QRectF(xp + dx, yp + dy, w, h); }
-Q_DECL_CONSTEXPR inline QRectF QRectF::translated(const QPointF &p) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::translated(const QPointF &p) const noexcept
{ return QRectF(xp + p.x(), yp + p.y(), w, h); }
-Q_DECL_CONSTEXPR inline QRectF QRectF::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::transposed() const noexcept
{ return QRectF(topLeft(), size().transposed()); }
Q_DECL_RELAXED_CONSTEXPR inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
@@ -787,7 +787,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRectF::getRect(qreal *ax, qreal *ay, qreal
*aah = this->h;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah) noexcept
{
this->xp = ax;
this->yp = ay;
@@ -803,7 +803,7 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRectF::getCoords(qreal *xp1, qreal *yp1, q
*yp2 = yp + h;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2) noexcept
{
xp = xp1;
yp = yp1;
@@ -811,105 +811,105 @@ Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setCoords(qreal xp1, qreal yp1, qre
h = yp2 - yp1;
}
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2) noexcept
{ xp += xp1; yp += yp1; w += xp2 - xp1; h += yp2 - yp1; }
-Q_DECL_CONSTEXPR inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const noexcept
{ return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1); }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setWidth(qreal aw) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setWidth(qreal aw) noexcept
{ this->w = aw; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setHeight(qreal ah) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setHeight(qreal ah) noexcept
{ this->h = ah; }
-Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setSize(const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QRectF::setSize(const QSizeF &s) noexcept
{
w = s.width();
h = s.height();
}
-inline bool QRectF::contains(qreal ax, qreal ay) const Q_DECL_NOTHROW
+inline bool QRectF::contains(qreal ax, qreal ay) const noexcept
{
return contains(QPointF(ax, ay));
}
-inline QRectF& QRectF::operator|=(const QRectF &r) Q_DECL_NOTHROW
+inline QRectF& QRectF::operator|=(const QRectF &r) noexcept
{
*this = *this | r;
return *this;
}
-inline QRectF& QRectF::operator&=(const QRectF &r) Q_DECL_NOTHROW
+inline QRectF& QRectF::operator&=(const QRectF &r) noexcept
{
*this = *this & r;
return *this;
}
-inline QRectF QRectF::intersected(const QRectF &r) const Q_DECL_NOTHROW
+inline QRectF QRectF::intersected(const QRectF &r) const noexcept
{
return *this & r;
}
-inline QRectF QRectF::united(const QRectF &r) const Q_DECL_NOTHROW
+inline QRectF QRectF::united(const QRectF &r) const noexcept
{
return *this | r;
}
-Q_DECL_CONSTEXPR inline bool operator==(const QRectF &r1, const QRectF &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QRectF &r1, const QRectF &r2) noexcept
{
return qFuzzyCompare(r1.xp, r2.xp) && qFuzzyCompare(r1.yp, r2.yp)
&& qFuzzyCompare(r1.w, r2.w) && qFuzzyCompare(r1.h, r2.h);
}
-Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &r1, const QRectF &r2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &r1, const QRectF &r2) noexcept
{
return !qFuzzyCompare(r1.xp, r2.xp) || !qFuzzyCompare(r1.yp, r2.yp)
|| !qFuzzyCompare(r1.w, r2.w) || !qFuzzyCompare(r1.h, r2.h);
}
-Q_DECL_CONSTEXPR inline QRect QRectF::toRect() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRect QRectF::toRect() const noexcept
{
return QRect(QPoint(qRound(xp), qRound(yp)), QPoint(qRound(xp + w) - 1, qRound(yp + h) - 1));
}
-Q_DECL_CONSTEXPR inline QRectF operator+(const QRectF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF operator+(const QRectF &lhs, const QMarginsF &rhs) noexcept
{
return QRectF(QPointF(lhs.left() - rhs.left(), lhs.top() - rhs.top()),
QSizeF(lhs.width() + rhs.left() + rhs.right(), lhs.height() + rhs.top() + rhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF operator+(const QMarginsF &lhs, const QRectF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF operator+(const QMarginsF &lhs, const QRectF &rhs) noexcept
{
return QRectF(QPointF(rhs.left() - lhs.left(), rhs.top() - lhs.top()),
QSizeF(rhs.width() + lhs.left() + lhs.right(), rhs.height() + lhs.top() + lhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF operator-(const QRectF &lhs, const QMarginsF &rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF operator-(const QRectF &lhs, const QMarginsF &rhs) noexcept
{
return QRectF(QPointF(lhs.left() + rhs.left(), lhs.top() + rhs.top()),
QSizeF(lhs.width() - rhs.left() - rhs.right(), lhs.height() - rhs.top() - rhs.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF QRectF::marginsAdded(const QMarginsF &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::marginsAdded(const QMarginsF &margins) const noexcept
{
return QRectF(QPointF(xp - margins.left(), yp - margins.top()),
QSizeF(w + margins.left() + margins.right(), h + margins.top() + margins.bottom()));
}
-Q_DECL_CONSTEXPR inline QRectF QRectF::marginsRemoved(const QMarginsF &margins) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QRectF QRectF::marginsRemoved(const QMarginsF &margins) const noexcept
{
return QRectF(QPointF(xp + margins.left(), yp + margins.top()),
QSizeF(w - margins.left() - margins.right(), h - margins.top() - margins.bottom()));
}
-Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator+=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator+=(const QMarginsF &margins) noexcept
{
*this = marginsAdded(margins);
return *this;
}
-Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator-=(const QMarginsF &margins) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QRectF &QRectF::operator-=(const QMarginsF &margins) noexcept
{
*this = marginsRemoved(margins);
return *this;
diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h
index 9586c3a79a..2e5388ad9a 100644
--- a/src/corelib/tools/qrefcount.h
+++ b/src/corelib/tools/qrefcount.h
@@ -51,8 +51,8 @@ namespace QtPrivate
class RefCount
{
public:
- inline bool ref() Q_DECL_NOTHROW {
- int count = atomic.load();
+ inline bool ref() noexcept {
+ int count = atomic.loadRelaxed();
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
@@ -62,8 +62,8 @@ public:
return true;
}
- inline bool deref() Q_DECL_NOTHROW {
- int count = atomic.load();
+ inline bool deref() noexcept {
+ int count = atomic.loadRelaxed();
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
@@ -74,7 +74,7 @@ public:
}
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
- bool setSharable(bool sharable) Q_DECL_NOTHROW
+ bool setSharable(bool sharable) noexcept
{
Q_ASSERT(!isShared());
if (sharable)
@@ -83,27 +83,27 @@ public:
return atomic.testAndSetRelaxed(1, 0);
}
- bool isSharable() const Q_DECL_NOTHROW
+ bool isSharable() const noexcept
{
// Sharable === Shared ownership.
- return atomic.load() != 0;
+ return atomic.loadRelaxed() != 0;
}
#endif
- bool isStatic() const Q_DECL_NOTHROW
+ bool isStatic() const noexcept
{
// Persistent object, never deleted
- return atomic.load() == -1;
+ return atomic.loadRelaxed() == -1;
}
- bool isShared() const Q_DECL_NOTHROW
+ bool isShared() const noexcept
{
- int count = atomic.load();
+ int count = atomic.loadRelaxed();
return (count != 1) && (count != 0);
}
- void initializeOwned() Q_DECL_NOTHROW { atomic.store(1); }
- void initializeUnsharable() Q_DECL_NOTHROW { atomic.store(0); }
+ void initializeOwned() noexcept { atomic.storeRelaxed(1); }
+ void initializeUnsharable() noexcept { atomic.storeRelaxed(0); }
QBasicAtomicInt atomic;
};
diff --git a/src/corelib/tools/qringbuffer.cpp b/src/corelib/tools/qringbuffer.cpp
index 59650ed2f7..311058a776 100644
--- a/src/corelib/tools/qringbuffer.cpp
+++ b/src/corelib/tools/qringbuffer.cpp
@@ -59,7 +59,7 @@ void QRingChunk::detach()
const int chunkSize = size();
QByteArray x(chunkSize, Qt::Uninitialized);
::memcpy(x.data(), chunk.constData() + headOffset, chunkSize);
- chunk = qMove(x);
+ chunk = std::move(x);
headOffset = 0;
tailOffset = chunkSize;
}
@@ -105,7 +105,7 @@ const char *QRingBuffer::readPointerAtPosition(qint64 pos, qint64 &length) const
}
length = 0;
- return 0;
+ return nullptr;
}
void QRingBuffer::free(qint64 bytes)
diff --git a/src/corelib/tools/qringbuffer_p.h b/src/corelib/tools/qringbuffer_p.h
index 76ab4a5b62..838cb31697 100644
--- a/src/corelib/tools/qringbuffer_p.h
+++ b/src/corelib/tools/qringbuffer_p.h
@@ -65,11 +65,11 @@ class QRingChunk
{
public:
// initialization and cleanup
- inline QRingChunk() Q_DECL_NOTHROW :
+ inline QRingChunk() noexcept :
headOffset(0), tailOffset(0)
{
}
- inline QRingChunk(const QRingChunk &other) Q_DECL_NOTHROW :
+ inline QRingChunk(const QRingChunk &other) noexcept :
chunk(other.chunk), headOffset(other.headOffset), tailOffset(other.tailOffset)
{
}
@@ -77,30 +77,30 @@ public:
chunk(alloc, Qt::Uninitialized), headOffset(0), tailOffset(0)
{
}
- explicit inline QRingChunk(const QByteArray &qba) Q_DECL_NOTHROW :
+ explicit inline QRingChunk(const QByteArray &qba) noexcept :
chunk(qba), headOffset(0), tailOffset(qba.size())
{
}
- inline QRingChunk &operator=(const QRingChunk &other) Q_DECL_NOTHROW
+ inline QRingChunk &operator=(const QRingChunk &other) noexcept
{
chunk = other.chunk;
headOffset = other.headOffset;
tailOffset = other.tailOffset;
return *this;
}
- inline QRingChunk(QRingChunk &&other) Q_DECL_NOTHROW :
+ inline QRingChunk(QRingChunk &&other) noexcept :
chunk(other.chunk), headOffset(other.headOffset), tailOffset(other.tailOffset)
{
other.headOffset = other.tailOffset = 0;
}
- inline QRingChunk &operator=(QRingChunk &&other) Q_DECL_NOTHROW
+ inline QRingChunk &operator=(QRingChunk &&other) noexcept
{
swap(other);
return *this;
}
- inline void swap(QRingChunk &other) Q_DECL_NOTHROW
+ inline void swap(QRingChunk &other) noexcept
{
chunk.swap(other.chunk);
qSwap(headOffset, other.headOffset);
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index 2a4083466b..af0c0ed336 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -97,7 +97,7 @@ class QScopedPointer
{
typedef T *QScopedPointer:: *RestrictedBool;
public:
- explicit QScopedPointer(T *p = nullptr) Q_DECL_NOTHROW : d(p)
+ explicit QScopedPointer(T *p = nullptr) noexcept : d(p)
{
}
@@ -113,12 +113,12 @@ public:
return *d;
}
- T *operator->() const Q_DECL_NOTHROW
+ T *operator->() const noexcept
{
return d;
}
- bool operator!() const Q_DECL_NOTHROW
+ bool operator!() const noexcept
{
return !d;
}
@@ -129,28 +129,28 @@ public:
return isNull() ? nullptr : &QScopedPointer::d;
}
#else
- operator RestrictedBool() const Q_DECL_NOTHROW
+ operator RestrictedBool() const noexcept
{
return isNull() ? nullptr : &QScopedPointer::d;
}
#endif
- T *data() const Q_DECL_NOTHROW
+ T *data() const noexcept
{
return d;
}
- T *get() const Q_DECL_NOTHROW
+ T *get() const noexcept
{
return d;
}
- bool isNull() const Q_DECL_NOTHROW
+ bool isNull() const noexcept
{
return !d;
}
- void reset(T *other = nullptr) Q_DECL_NOEXCEPT_EXPR(noexcept(Cleanup::cleanup(std::declval<T *>())))
+ void reset(T *other = nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval<T *>())))
{
if (d == other)
return;
@@ -159,14 +159,14 @@ public:
Cleanup::cleanup(oldD);
}
- T *take() Q_DECL_NOTHROW
+ T *take() noexcept
{
T *oldD = d;
d = nullptr;
return oldD;
}
- void swap(QScopedPointer<T, Cleanup> &other) Q_DECL_NOTHROW
+ void swap(QScopedPointer<T, Cleanup> &other) noexcept
{
qSwap(d, other.d);
}
@@ -181,43 +181,43 @@ private:
};
template <class T, class Cleanup>
-inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return lhs.data() == rhs.data();
}
template <class T, class Cleanup>
-inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return lhs.data() != rhs.data();
}
template <class T, class Cleanup>
-inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator==(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) noexcept
{
return lhs.isNull();
}
template <class T, class Cleanup>
-inline bool operator==(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator==(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return rhs.isNull();
}
template <class T, class Cleanup>
-inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator!=(const QScopedPointer<T, Cleanup> &lhs, std::nullptr_t) noexcept
{
return !lhs.isNull();
}
template <class T, class Cleanup>
-inline bool operator!=(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(std::nullptr_t, const QScopedPointer<T, Cleanup> &rhs) noexcept
{
return !rhs.isNull();
}
template <class T, class Cleanup>
-inline void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) Q_DECL_NOTHROW
+inline void swap(QScopedPointer<T, Cleanup> &p1, QScopedPointer<T, Cleanup> &p2) noexcept
{ p1.swap(p2); }
template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
@@ -244,7 +244,7 @@ public:
return this->d[i];
}
- void swap(QScopedArrayPointer &other) Q_DECL_NOTHROW // prevent QScopedPointer <->QScopedArrayPointer swaps
+ void swap(QScopedArrayPointer &other) noexcept // prevent QScopedPointer <->QScopedArrayPointer swaps
{ QScopedPointer<T, Cleanup>::swap(other); }
private:
@@ -263,7 +263,7 @@ private:
};
template <typename T, typename Cleanup>
-inline void swap(QScopedArrayPointer<T, Cleanup> &lhs, QScopedArrayPointer<T, Cleanup> &rhs) Q_DECL_NOTHROW
+inline void swap(QScopedArrayPointer<T, Cleanup> &lhs, QScopedArrayPointer<T, Cleanup> &rhs) noexcept
{ lhs.swap(rhs); }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qscopedvaluerollback.h b/src/corelib/tools/qscopedvaluerollback.h
index 5f76269388..f904b8dfcb 100644
--- a/src/corelib/tools/qscopedvaluerollback.h
+++ b/src/corelib/tools/qscopedvaluerollback.h
@@ -48,20 +48,20 @@ template <typename T>
class QScopedValueRollback
{
public:
- explicit QScopedValueRollback(T &var) :
- varRef(var), oldValue(var)
+ explicit QScopedValueRollback(T &var)
+ : varRef(var), oldValue(var)
{
}
- explicit QScopedValueRollback(T &var, T value) :
- varRef(var), oldValue(var)
+ explicit QScopedValueRollback(T &var, T value)
+ : varRef(var), oldValue(std::move(var))
{
- varRef = qMove(value);
+ varRef = std::move(value);
}
~QScopedValueRollback()
{
- varRef = qMove(oldValue);
+ varRef = std::move(oldValue);
}
void commit()
@@ -70,7 +70,7 @@ public:
}
private:
- T& varRef;
+ T &varRef;
T oldValue;
Q_DISABLE_COPY(QScopedValueRollback)
diff --git a/src/corelib/tools/qscopeguard.h b/src/corelib/tools/qscopeguard.h
index 31100fcabb..45c3f93da4 100644
--- a/src/corelib/tools/qscopeguard.h
+++ b/src/corelib/tools/qscopeguard.h
@@ -50,14 +50,19 @@ template <typename F> class QScopeGuard;
template <typename F> QScopeGuard<F> qScopeGuard(F f);
template <typename F>
-class QScopeGuard
+class
+#if QT_HAS_CPP_ATTRIBUTE(nodiscard)
+// Q_REQUIRED_RESULT can be defined as __warn_unused_result__ or as [[nodiscard]]
+// but the 1st one has some limitations for example can be placed only on functions.
+Q_REQUIRED_RESULT
+#endif
+QScopeGuard
{
public:
- QScopeGuard(QScopeGuard &&other) Q_DECL_NOEXCEPT
+ QScopeGuard(QScopeGuard &&other) noexcept
: m_func(std::move(other.m_func))
- , m_invoke(other.m_invoke)
+ , m_invoke(qExchange(other.m_invoke, false))
{
- other.dismiss();
}
~QScopeGuard()
@@ -66,13 +71,13 @@ public:
m_func();
}
- void dismiss() Q_DECL_NOEXCEPT
+ void dismiss() noexcept
{
m_invoke = false;
}
private:
- explicit QScopeGuard(F f) Q_DECL_NOEXCEPT
+ explicit QScopeGuard(F &&f) noexcept
: m_func(std::move(f))
{
}
@@ -86,6 +91,9 @@ private:
template <typename F>
+#if QT_HAS_CPP_ATTRIBUTE(nodiscard)
+Q_REQUIRED_RESULT
+#endif
QScopeGuard<F> qScopeGuard(F f)
{
return QScopeGuard<F>(std::move(f));
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index 6640c8486d..2e72832185 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -41,10 +41,9 @@
#define QSET_H
#include <QtCore/qhash.h>
-#ifdef Q_COMPILER_INITIALIZER_LISTS
-#include <initializer_list>
-#endif
+#include <QtCore/qcontainertools_impl.h>
+#include <initializer_list>
#include <iterator>
QT_BEGIN_NAMESPACE
@@ -56,19 +55,21 @@ class QSet
typedef QHash<T, QHashDummyValue> Hash;
public:
- inline QSet() Q_DECL_NOTHROW {}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ inline QSet() noexcept {}
inline QSet(std::initializer_list<T> list)
+ : QSet(list.begin(), list.end()) {}
+ template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
+ inline QSet(InputIterator first, InputIterator last)
{
- reserve(int(list.size()));
- for (typename std::initializer_list<T>::const_iterator it = list.begin(); it != list.end(); ++it)
- insert(*it);
+ QtPrivate::reserveIfForwardIterator(this, first, last);
+ for (; first != last; ++first)
+ insert(*first);
}
-#endif
+
// compiler-generated copy/move ctor/assignment operators are fine!
// compiler-generated destructor is fine!
- inline void swap(QSet<T> &other) Q_DECL_NOTHROW { q_hash.swap(other.q_hash); }
+ inline void swap(QSet<T> &other) noexcept { q_hash.swap(other.q_hash); }
inline bool operator==(const QSet<T> &other) const
{ return q_hash == other.q_hash; }
@@ -176,20 +177,20 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
inline iterator begin() { return q_hash.begin(); }
- inline const_iterator begin() const Q_DECL_NOTHROW { return q_hash.begin(); }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return q_hash.begin(); }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return q_hash.constBegin(); }
+ inline const_iterator begin() const noexcept { return q_hash.begin(); }
+ inline const_iterator cbegin() const noexcept { return q_hash.begin(); }
+ inline const_iterator constBegin() const noexcept { return q_hash.constBegin(); }
inline iterator end() { return q_hash.end(); }
- inline const_iterator end() const Q_DECL_NOTHROW { return q_hash.end(); }
- inline const_iterator cend() const Q_DECL_NOTHROW { return q_hash.end(); }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return q_hash.constEnd(); }
+ inline const_iterator end() const noexcept { return q_hash.end(); }
+ inline const_iterator cend() const noexcept { return q_hash.end(); }
+ inline const_iterator constEnd() const noexcept { return q_hash.constEnd(); }
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator erase(iterator i)
{ return erase(m2c(i)); }
@@ -244,30 +245,40 @@ public:
inline QSet<T> operator-(const QSet<T> &other) const
{ QSet<T> result = *this; result -= other; return result; }
- QList<T> toList() const;
- inline QList<T> values() const { return toList(); }
-
+ QList<T> values() const;
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ Q_DECL_DEPRECATED_X("Use values() instead.")
+ QList<T> toList() const { return values(); }
+ Q_DECL_DEPRECATED_X("Use QSet<T>(list.begin(), list.end()) instead.")
static QSet<T> fromList(const QList<T> &list);
+#endif
private:
Hash q_hash;
- static const_iterator m2c(iterator it) Q_DECL_NOTHROW
+ static const_iterator m2c(iterator it) noexcept
{ return const_iterator(typename Hash::const_iterator(it.i.i)); }
bool isValidIterator(const iterator &i) const
{
return q_hash.isValidIterator(reinterpret_cast<const typename Hash::iterator&>(i));
}
- bool isValidIterator(const const_iterator &i) const Q_DECL_NOTHROW
+ bool isValidIterator(const const_iterator &i) const noexcept
{
return q_hash.isValidIterator(reinterpret_cast<const typename Hash::const_iterator&>(i));
}
};
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+template <typename InputIterator,
+ typename ValueType = typename std::iterator_traits<InputIterator>::value_type,
+ QtPrivate::IfIsInputIterator<InputIterator> = true>
+QSet(InputIterator, InputIterator) -> QSet<ValueType>;
+#endif
+
template <typename T>
uint qHash(const QSet<T> &key, uint seed = 0)
-Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed)))
+noexcept(noexcept(qHashRangeCommutative(key.begin(), key.end(), seed)))
{
return qHashRangeCommutative(key.begin(), key.end(), seed);
}
@@ -280,11 +291,9 @@ Q_INLINE_TEMPLATE void QSet<T>::reserve(int asize) { q_hash.reserve(asize); }
template <class T>
Q_INLINE_TEMPLATE QSet<T> &QSet<T>::unite(const QSet<T> &other)
{
- QSet<T> copy(other);
- typename QSet<T>::const_iterator i = copy.constEnd();
- while (i != copy.constBegin()) {
- --i;
- insert(*i);
+ if (!q_hash.isSharedWith(other.q_hash)) {
+ for (const T &e : other)
+ insert(e);
}
return *this;
}
@@ -302,11 +311,9 @@ Q_INLINE_TEMPLATE QSet<T> &QSet<T>::intersect(const QSet<T> &other)
copy2 = *this;
*this = copy1;
}
- typename QSet<T>::const_iterator i = copy1.constEnd();
- while (i != copy1.constBegin()) {
- --i;
- if (!copy2.contains(*i))
- remove(*i);
+ for (const auto &e : qAsConst(copy1)) {
+ if (!copy2.contains(e))
+ remove(e);
}
return *this;
}
@@ -342,14 +349,11 @@ Q_INLINE_TEMPLATE bool QSet<T>::intersects(const QSet<T> &other) const
template <class T>
Q_INLINE_TEMPLATE QSet<T> &QSet<T>::subtract(const QSet<T> &other)
{
- if (&other == this) {
+ if (q_hash.isSharedWith(other.q_hash)) {
clear();
} else {
- auto i = other.constEnd();
- while (i != other.constBegin()) {
- --i;
- remove(*i);
- }
+ for (const auto &e : other)
+ remove(e);
}
return *this;
}
@@ -367,7 +371,7 @@ Q_INLINE_TEMPLATE bool QSet<T>::contains(const QSet<T> &other) const
}
template <typename T>
-Q_OUTOFLINE_TEMPLATE QList<T> QSet<T>::toList() const
+Q_OUTOFLINE_TEMPLATE QList<T> QSet<T>::values() const
{
QList<T> result;
result.reserve(size());
@@ -379,6 +383,7 @@ Q_OUTOFLINE_TEMPLATE QList<T> QSet<T>::toList() const
return result;
}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
template <typename T>
Q_OUTOFLINE_TEMPLATE QSet<T> QList<T>::toSet() const
{
@@ -400,9 +405,11 @@ QList<T> QList<T>::fromSet(const QSet<T> &set)
{
return set.toList();
}
+#endif
Q_DECLARE_SEQUENTIAL_ITERATOR(Set)
+#if !defined(QT_NO_JAVA_STYLE_ITERATORS)
template <typename T>
class QMutableSetIterator
{
@@ -434,6 +441,7 @@ public:
{ while (c->constBegin() != i) if (*(n = --i) == t) return true;
n = c->end(); return false; }
};
+#endif // QT_NO_JAVA_STYLE_ITERATORS
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index 48863f2399..78854be0de 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -108,9 +108,17 @@
Constructs a set with a copy of each of the elements in the
initializer list \a list.
+*/
+
+/*! \fn template <class T> template<typename InputIterator> QSet<T>::QSet(InputIterator first, InputIterator last)
+ \since 5.14
+
+ Constructs a set with the contents in the iterator range [\a first, \a last).
+
+ The value type of \c InputIterator must be convertible to \c T.
- This function is only available if the program is being
- compiled in C++11 mode.
+ \note If the range [\a first, \a last) contains duplicate elements,
+ the first one is retained.
*/
/*!
@@ -993,6 +1001,8 @@
\snippet code/doc_src_qset.cpp 13
+ \include containers-range-constructor.qdocinc
+
\sa fromList(), QList::fromSet()
*/
@@ -1003,6 +1013,8 @@
This is the same as toList().
+ \include containers-range-constructor.qdocinc
+
\sa fromList(), QList::fromSet()
*/
@@ -1018,6 +1030,8 @@
\snippet code/doc_src_qset.cpp 14
+ \include containers-range-constructor.qdocinc
+
\sa toList(), QList::toSet()
*/
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 6930cb96a5..f123f8e7b9 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -52,17 +52,21 @@ QT_BEGIN_NAMESPACE
template <class T> class QSharedDataPointer;
-class Q_CORE_EXPORT QSharedData
+class
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+Q_CORE_EXPORT
+#endif
+QSharedData
{
public:
mutable QAtomicInt ref;
- inline QSharedData() : ref(0) { }
- inline QSharedData(const QSharedData &) : ref(0) { }
+ inline QSharedData() noexcept : ref(0) { }
+ inline QSharedData(const QSharedData &) noexcept : ref(0) { }
-private:
// using the assignment operator would lead to corruption in the ref-counting
- QSharedData &operator=(const QSharedData &);
+ QSharedData &operator=(const QSharedData &) = delete;
+ ~QSharedData() = default;
};
template <class T> class QSharedDataPointer
@@ -71,7 +75,7 @@ public:
typedef T Type;
typedef T *pointer;
- inline void detach() { if (d && d->ref.load() != 1) detach_helper(); }
+ inline void detach() { if (d && d->ref.loadRelaxed() != 1) detach_helper(); }
inline T &operator*() { detach(); return *d; }
inline const T &operator*() const { return *d; }
inline T *operator->() { detach(); return d; }
@@ -88,7 +92,7 @@ public:
inline QSharedDataPointer() { d = nullptr; }
inline ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; }
- explicit QSharedDataPointer(T *data) Q_DECL_NOTHROW;
+ explicit QSharedDataPointer(T *data) noexcept;
inline QSharedDataPointer(const QSharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
inline QSharedDataPointer<T> & operator=(const QSharedDataPointer<T> &o) {
if (o.d != d) {
@@ -112,19 +116,17 @@ public:
}
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
- QSharedDataPointer(QSharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; }
- inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) Q_DECL_NOTHROW
+ QSharedDataPointer(QSharedDataPointer &&o) noexcept : d(o.d) { o.d = nullptr; }
+ inline QSharedDataPointer<T> &operator=(QSharedDataPointer<T> &&other) noexcept
{
QSharedDataPointer moved(std::move(other));
swap(moved);
return *this;
}
-#endif
inline bool operator!() const { return !d; }
- inline void swap(QSharedDataPointer &other) Q_DECL_NOTHROW
+ inline void swap(QSharedDataPointer &other) noexcept
{ qSwap(d, other.d); }
protected:
@@ -161,7 +163,7 @@ public:
inline const T *constData() const { return d; }
inline T *take() { T *x = d; d = nullptr; return x; }
- inline void detach() { if (d && d->ref.load() != 1) detach_helper(); }
+ inline void detach() { if (d && d->ref.loadRelaxed() != 1) detach_helper(); }
inline void reset()
{
@@ -181,7 +183,7 @@ public:
inline QExplicitlySharedDataPointer() { d = nullptr; }
inline ~QExplicitlySharedDataPointer() { if (d && !d->ref.deref()) delete d; }
- explicit QExplicitlySharedDataPointer(T *data) Q_DECL_NOTHROW;
+ explicit QExplicitlySharedDataPointer(T *data) noexcept;
inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
template<class X>
@@ -218,19 +220,17 @@ public:
}
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) Q_DECL_NOTHROW : d(o.d) { o.d = nullptr; }
- inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) Q_DECL_NOTHROW
+ inline QExplicitlySharedDataPointer(QExplicitlySharedDataPointer &&o) noexcept : d(o.d) { o.d = nullptr; }
+ inline QExplicitlySharedDataPointer<T> &operator=(QExplicitlySharedDataPointer<T> &&other) noexcept
{
QExplicitlySharedDataPointer moved(std::move(other));
swap(moved);
return *this;
}
-#endif
inline bool operator!() const { return !d; }
- inline void swap(QExplicitlySharedDataPointer &other) Q_DECL_NOTHROW
+ inline void swap(QExplicitlySharedDataPointer &other) noexcept
{ qSwap(d, other.d); }
protected:
@@ -243,7 +243,7 @@ private:
};
template <class T>
-Q_INLINE_TEMPLATE QSharedDataPointer<T>::QSharedDataPointer(T *adata) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE QSharedDataPointer<T>::QSharedDataPointer(T *adata) noexcept
: d(adata)
{ if (d) d->ref.ref(); }
@@ -280,7 +280,7 @@ Q_OUTOFLINE_TEMPLATE void QExplicitlySharedDataPointer<T>::detach_helper()
}
template <class T>
-Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE QExplicitlySharedDataPointer<T>::QExplicitlySharedDataPointer(T *adata) noexcept
: d(adata)
{ if (d) d->ref.ref(); }
@@ -297,32 +297,20 @@ template <class T> inline bool operator==(const QExplicitlySharedDataPointer<T>
}
template <class T>
-Q_INLINE_TEMPLATE void qSwap(QSharedDataPointer<T> &p1, QSharedDataPointer<T> &p2)
+Q_INLINE_TEMPLATE void swap(QSharedDataPointer<T> &p1, QSharedDataPointer<T> &p2)
{ p1.swap(p2); }
template <class T>
-Q_INLINE_TEMPLATE void qSwap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2)
+Q_INLINE_TEMPLATE void swap(QExplicitlySharedDataPointer<T> &p1, QExplicitlySharedDataPointer<T> &p2)
{ p1.swap(p2); }
-QT_END_NAMESPACE
-namespace std {
- template <class T>
- Q_INLINE_TEMPLATE void swap(QT_PREPEND_NAMESPACE(QSharedDataPointer)<T> &p1, QT_PREPEND_NAMESPACE(QSharedDataPointer)<T> &p2)
- { p1.swap(p2); }
-
- template <class T>
- Q_INLINE_TEMPLATE void swap(QT_PREPEND_NAMESPACE(QExplicitlySharedDataPointer)<T> &p1, QT_PREPEND_NAMESPACE(QExplicitlySharedDataPointer)<T> &p2)
- { p1.swap(p2); }
-}
-QT_BEGIN_NAMESPACE
-
template <class T>
-Q_INLINE_TEMPLATE uint qHash(const QSharedDataPointer<T> &ptr, uint seed = 0) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE uint qHash(const QSharedDataPointer<T> &ptr, uint seed = 0) noexcept
{
return qHash(ptr.data(), seed);
}
template <class T>
-Q_INLINE_TEMPLATE uint qHash(const QExplicitlySharedDataPointer<T> &ptr, uint seed = 0) Q_DECL_NOTHROW
+Q_INLINE_TEMPLATE uint qHash(const QExplicitlySharedDataPointer<T> &ptr, uint seed = 0) noexcept
{
return qHash(ptr.data(), seed);
}
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 39a71a4393..f185d2f23f 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -343,12 +343,6 @@
if you obtain a non-null object, you may use the pointer. See
QWeakPointer::toStrongRef() for an example.
- QWeakPointer also provides the QWeakPointer::data() method that returns
- the tracked pointer without ensuring that it remains valid. This function
- is provided if you can guarantee by external means that the object will
- not get deleted (or if you only need the pointer value) and the cost of
- creating a QSharedPointer using toStrongRef() is too high.
-
\omit
\section1 QWeakPointer internals
@@ -853,6 +847,7 @@
/*!
\fn template <class T> T *QWeakPointer<T>::data() const
\since 4.6
+ \obsolete Use toStrongRef() instead, and data() on the returned QSharedPointer.
Returns the value of the pointer being tracked by this QWeakPointer,
\b without ensuring that it cannot get deleted. To have that guarantee,
@@ -1271,6 +1266,57 @@
*/
/*!
+ \fn template <class X, class T> std::shared_ptr<X> qSharedPointerObjectCast(const std::shared_ptr<T> &src)
+ \relates QSharedPointer
+ \since 5.14
+
+ Returns a shared pointer to the pointer held by \a src, using a
+ \l qobject_cast() to type \tt X to obtain an internal pointer of the
+ appropriate type. If the \tt qobject_cast fails, the object
+ returned will be null.
+
+ Note that \tt X must have the same cv-qualifiers (\tt const and
+ \tt volatile) that \tt T has, or the code will fail to
+ compile. Use const_pointer_cast to cast away the constness.
+*/
+
+/*!
+ \fn template <class X, class T> std::shared_ptr<X> qobject_pointer_cast(const std::shared_ptr<T> &src)
+ \relates QSharedPointer
+ \since 5.14
+
+ Same as qSharedPointerObjectCast(). This function is provided for STL
+ compatibility.
+*/
+
+/*!
+ \fn template <class X, class T> std::shared_ptr<X> qSharedPointerObjectCast(std::shared_ptr<T> &&src)
+ \relates QSharedPointer
+ \since 5.14
+
+ Returns a shared pointer to the pointer held by \a src, using a
+ \l qobject_cast() to type \tt X to obtain an internal pointer of the
+ appropriate type.
+
+ If the \tt qobject_cast succeeds, the function will return a valid shared
+ pointer, and \a src is reset to null. If the \tt qobject_cast fails, the
+ object returned will be null, and \a src will not be modified.
+
+ Note that \tt X must have the same cv-qualifiers (\tt const and
+ \tt volatile) that \tt T has, or the code will fail to
+ compile. Use const_pointer_cast to cast away the constness.
+*/
+
+/*!
+ \fn template <class X, class T> std::shared_ptr<X> qobject_pointer_cast(std::shared_ptr<T> &&src)
+ \relates QSharedPointer
+ \since 5.14
+
+ Same as qSharedPointerObjectCast(). This function is provided for STL
+ compatibility.
+*/
+
+/*!
\fn template <class X> template <class T> QSharedPointer<X> qSharedPointerObjectCast(const QWeakPointer<T> &src)
\relates QSharedPointer
\relates QWeakPointer
@@ -1334,7 +1380,7 @@ void QtSharedPointer::ExternalRefCountData::setQObjectShared(const QObject *, bo
*/
void QtSharedPointer::ExternalRefCountData::checkQObjectShared(const QObject *)
{
- if (strongref.load() < 0)
+ if (strongref.loadRelaxed() < 0)
qWarning("QSharedPointer: cannot create a QSharedPointer from a QObject-tracking QWeakPointer");
}
@@ -1344,7 +1390,7 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
QObjectPrivate *d = QObjectPrivate::get(const_cast<QObject *>(obj));
Q_ASSERT_X(!d->wasDeleted, "QWeakPointer", "Detected QWeakPointer creation in a QObject being deleted");
- ExternalRefCountData *that = d->sharedRefcount.load();
+ ExternalRefCountData *that = d->sharedRefcount.loadRelaxed();
if (that) {
that->weakref.ref();
return that;
@@ -1352,8 +1398,8 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
// we can create the refcount data because it doesn't exist
ExternalRefCountData *x = new ExternalRefCountData(Qt::Uninitialized);
- x->strongref.store(-1);
- x->weakref.store(2); // the QWeakPointer that called us plus the QObject itself
+ x->strongref.storeRelaxed(-1);
+ x->weakref.storeRelaxed(2); // the QWeakPointer that called us plus the QObject itself
ExternalRefCountData *ret;
if (d->sharedRefcount.testAndSetOrdered(nullptr, x, ret)) { // ought to be release+acquire; this is acq_rel+acquire
@@ -1361,7 +1407,7 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge
} else {
// ~ExternalRefCountData has a Q_ASSERT, so we use this trick to
// only execute this if Q_ASSERTs are enabled
- Q_ASSERT((x->weakref.store(0), true));
+ Q_ASSERT((x->weakref.storeRelaxed(0), true));
delete x;
ret->weakref.ref();
}
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index a2c5f990fc..5d47369687 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -48,6 +48,8 @@
# include <QtCore/qsharedpointer_impl.h>
#else
+#include <memory> // for std::shared_ptr
+
QT_BEGIN_NAMESPACE
@@ -167,6 +169,10 @@ template <class X, class T> QSharedPointer<X> qSharedPointerConstCast(const QSha
template <class X, class T> QSharedPointer<X> qSharedPointerConstCast(const QWeakPointer<T> &src);
template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(const QSharedPointer<T> &src);
template <class X, class T> QSharedPointer<X> qSharedPointerObjectCast(const QWeakPointer<T> &src);
+template <typename X, class T> std::shared_ptr<X> qobject_pointer_cast(const std::shared_ptr<T> &src);
+template <typename X, class T> std::shared_ptr<X> qobject_pointer_cast(std::shared_ptr<T> &&src);
+template <typename X, class T> std::shared_ptr<X> qSharedPointerObjectCast(const std::shared_ptr<T> &src);
+template <typename X, class T> std::shared_ptr<X> qSharedPointerObjectCast(std::shared_ptr<T> &&src);
template <class X, class T> QWeakPointer<X> qWeakPointerCast(const QWeakPointer<T> &src);
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index f2158436fd..362d57fb9a 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -67,6 +67,8 @@ QT_END_NAMESPACE
#endif
#include <QtCore/qhashfunctions.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
//
@@ -90,6 +92,10 @@ template <class X, class T>
QSharedPointer<X> qSharedPointerObjectCast(const QSharedPointer<T> &ptr);
#endif
+namespace QtPrivate {
+struct EnableInternalData;
+}
+
namespace QtSharedPointer {
template <class T> class ExternalRefCount;
@@ -133,11 +139,11 @@ namespace QtSharedPointer {
inline ExternalRefCountData(DestroyerFn d)
: destroyer(d)
{
- strongref.store(1);
- weakref.store(1);
+ strongref.storeRelaxed(1);
+ weakref.storeRelaxed(1);
}
inline ExternalRefCountData(Qt::Initialization) { }
- ~ExternalRefCountData() { Q_ASSERT(!weakref.load()); Q_ASSERT(strongref.load() <= 0); }
+ ~ExternalRefCountData() { Q_ASSERT(!weakref.loadRelaxed()); Q_ASSERT(strongref.loadRelaxed() <= 0); }
void destroy() { destroyer(this); }
@@ -218,8 +224,8 @@ namespace QtSharedPointer {
}
private:
// prevent construction
- ExternalRefCountWithCustomDeleter() Q_DECL_EQ_DELETE;
- ~ExternalRefCountWithCustomDeleter() Q_DECL_EQ_DELETE;
+ ExternalRefCountWithCustomDeleter() = delete;
+ ~ExternalRefCountWithCustomDeleter() = delete;
Q_DISABLE_COPY(ExternalRefCountWithCustomDeleter)
};
@@ -263,8 +269,8 @@ namespace QtSharedPointer {
private:
// prevent construction
- ExternalRefCountWithContiguousData() Q_DECL_EQ_DELETE;
- ~ExternalRefCountWithContiguousData() Q_DECL_EQ_DELETE;
+ ExternalRefCountWithContiguousData() = delete;
+ ~ExternalRefCountWithContiguousData() = delete;
Q_DISABLE_COPY(ExternalRefCountWithContiguousData)
};
@@ -291,18 +297,18 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- T *data() const Q_DECL_NOTHROW { return value; }
- T *get() const Q_DECL_NOTHROW { return value; }
- bool isNull() const Q_DECL_NOTHROW { return !data(); }
- operator RestrictedBool() const Q_DECL_NOTHROW { return isNull() ? nullptr : &QSharedPointer::value; }
- bool operator !() const Q_DECL_NOTHROW { return isNull(); }
+ T *data() const noexcept { return value; }
+ T *get() const noexcept { return value; }
+ bool isNull() const noexcept { return !data(); }
+ operator RestrictedBool() const noexcept { return isNull() ? nullptr : &QSharedPointer::value; }
+ bool operator !() const noexcept { return isNull(); }
T &operator*() const { return *data(); }
- T *operator->() const Q_DECL_NOTHROW { return data(); }
+ T *operator->() const noexcept { return data(); }
- Q_DECL_CONSTEXPR QSharedPointer() Q_DECL_NOTHROW : value(nullptr), d(nullptr) { }
+ Q_DECL_CONSTEXPR QSharedPointer() noexcept : value(nullptr), d(nullptr) { }
~QSharedPointer() { deref(); }
- Q_DECL_CONSTEXPR QSharedPointer(std::nullptr_t) Q_DECL_NOTHROW : value(nullptr), d(nullptr) { }
+ Q_DECL_CONSTEXPR QSharedPointer(std::nullptr_t) noexcept : value(nullptr), d(nullptr) { }
template <class X, IfCompatible<X> = true>
inline explicit QSharedPointer(X *ptr) : value(ptr) // noexcept
@@ -315,22 +321,21 @@ public:
template <typename Deleter>
QSharedPointer(std::nullptr_t, Deleter) : value(nullptr), d(nullptr) { }
- QSharedPointer(const QSharedPointer &other) Q_DECL_NOTHROW : value(other.value), d(other.d)
+ QSharedPointer(const QSharedPointer &other) noexcept : value(other.value), d(other.d)
{ if (d) ref(); }
- QSharedPointer &operator=(const QSharedPointer &other) Q_DECL_NOTHROW
+ QSharedPointer &operator=(const QSharedPointer &other) noexcept
{
QSharedPointer copy(other);
swap(copy);
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
- QSharedPointer(QSharedPointer &&other) Q_DECL_NOTHROW
+ QSharedPointer(QSharedPointer &&other) noexcept
: value(other.value), d(other.d)
{
other.d = nullptr;
other.value = nullptr;
}
- QSharedPointer &operator=(QSharedPointer &&other) Q_DECL_NOTHROW
+ QSharedPointer &operator=(QSharedPointer &&other) noexcept
{
QSharedPointer moved(std::move(other));
swap(moved);
@@ -338,7 +343,7 @@ public:
}
template <class X, IfCompatible<X> = true>
- QSharedPointer(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ QSharedPointer(QSharedPointer<X> &&other) noexcept
: value(other.value), d(other.d)
{
other.d = nullptr;
@@ -346,17 +351,15 @@ public:
}
template <class X, IfCompatible<X> = true>
- QSharedPointer &operator=(QSharedPointer<X> &&other) Q_DECL_NOTHROW
+ QSharedPointer &operator=(QSharedPointer<X> &&other) noexcept
{
QSharedPointer moved(std::move(other));
swap(moved);
return *this;
}
-#endif
-
template <class X, IfCompatible<X> = true>
- QSharedPointer(const QSharedPointer<X> &other) Q_DECL_NOTHROW : value(other.value), d(other.d)
+ QSharedPointer(const QSharedPointer<X> &other) noexcept : value(other.value), d(other.d)
{ if (d) ref(); }
template <class X, IfCompatible<X> = true>
@@ -375,7 +378,7 @@ public:
inline QSharedPointer<T> &operator=(const QWeakPointer<X> &other)
{ internalSet(other.d, other.value); return *this; }
- inline void swap(QSharedPointer &other)
+ inline void swap(QSharedPointer &other) noexcept
{ this->internalSwap(other); }
inline void reset() { clear(); }
@@ -444,9 +447,9 @@ public:
private:
explicit QSharedPointer(Qt::Initialization) {}
- void deref() Q_DECL_NOTHROW
+ void deref() noexcept
{ deref(d); }
- static void deref(Data *dd) Q_DECL_NOTHROW
+ static void deref(Data *dd) noexcept
{
if (!dd) return;
if (!dd->strongref.deref()) {
@@ -487,7 +490,7 @@ private:
enableSharedFromThis(ptr);
}
- void internalSwap(QSharedPointer &other) Q_DECL_NOTHROW
+ void internalSwap(QSharedPointer &other) noexcept
{
qSwap(d, other.d);
qSwap(this->value, other.value);
@@ -500,19 +503,19 @@ public:
template <class X> friend class QWeakPointer;
template <class X, class Y> friend QSharedPointer<X> QtSharedPointer::copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src);
#endif
- void ref() const Q_DECL_NOTHROW { d->weakref.ref(); d->strongref.ref(); }
+ void ref() const noexcept { d->weakref.ref(); d->strongref.ref(); }
inline void internalSet(Data *o, T *actual)
{
if (o) {
// increase the strongref, but never up from zero
// or less (-1 is used by QWeakPointer on untracked QObject)
- int tmp = o->strongref.load();
+ int tmp = o->strongref.loadRelaxed();
while (tmp > 0) {
// try to increment from "tmp" to "tmp + 1"
if (o->strongref.testAndSetRelaxed(tmp, tmp + 1))
break; // succeeded
- tmp = o->strongref.load(); // failed, try again
+ tmp = o->strongref.loadRelaxed(); // failed, try again
}
if (tmp > 0) {
@@ -525,7 +528,7 @@ public:
qSwap(d, o);
qSwap(this->value, actual);
- if (!d || d->strongref.load() == 0)
+ if (!d || d->strongref.loadRelaxed() == 0)
this->value = nullptr;
// dereference saved data
@@ -553,12 +556,16 @@ public:
typedef const value_type &const_reference;
typedef qptrdiff difference_type;
- bool isNull() const Q_DECL_NOTHROW { return d == nullptr || d->strongref.load() == 0 || value == nullptr; }
- operator RestrictedBool() const Q_DECL_NOTHROW { return isNull() ? nullptr : &QWeakPointer::value; }
- bool operator !() const Q_DECL_NOTHROW { return isNull(); }
- T *data() const Q_DECL_NOTHROW { return d == nullptr || d->strongref.load() == 0 ? nullptr : value; }
+ bool isNull() const noexcept { return d == nullptr || d->strongref.loadRelaxed() == 0 || value == nullptr; }
+ operator RestrictedBool() const noexcept { return isNull() ? nullptr : &QWeakPointer::value; }
+ bool operator !() const noexcept { return isNull(); }
- inline QWeakPointer() Q_DECL_NOTHROW : d(nullptr), value(nullptr) { }
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("Use toStrongRef() instead, and data() on the returned QSharedPointer")
+ T *data() const noexcept { return internalData(); }
+#endif
+
+ inline QWeakPointer() noexcept : d(nullptr), value(nullptr) { }
inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
#ifndef QT_NO_QOBJECT
@@ -576,26 +583,24 @@ public:
{ return *this = QWeakPointer(ptr); }
#endif
- QWeakPointer(const QWeakPointer &other) Q_DECL_NOTHROW : d(other.d), value(other.value)
+ QWeakPointer(const QWeakPointer &other) noexcept : d(other.d), value(other.value)
{ if (d) d->weakref.ref(); }
-#ifdef Q_COMPILER_RVALUE_REFS
- QWeakPointer(QWeakPointer &&other) Q_DECL_NOTHROW
+ QWeakPointer(QWeakPointer &&other) noexcept
: d(other.d), value(other.value)
{
other.d = nullptr;
other.value = nullptr;
}
- QWeakPointer &operator=(QWeakPointer &&other) Q_DECL_NOTHROW
+ QWeakPointer &operator=(QWeakPointer &&other) noexcept
{ QWeakPointer moved(std::move(other)); swap(moved); return *this; }
-#endif
- QWeakPointer &operator=(const QWeakPointer &other) Q_DECL_NOTHROW
+ QWeakPointer &operator=(const QWeakPointer &other) noexcept
{
QWeakPointer copy(other);
swap(copy);
return *this;
}
- void swap(QWeakPointer &other) Q_DECL_NOTHROW
+ void swap(QWeakPointer &other) noexcept
{
qSwap(this->d, other.d);
qSwap(this->value, other.value);
@@ -623,11 +628,11 @@ public:
}
template <class X>
- bool operator==(const QWeakPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator==(const QWeakPointer<X> &o) const noexcept
{ return d == o.d && value == static_cast<const T *>(o.value); }
template <class X>
- bool operator!=(const QWeakPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator!=(const QWeakPointer<X> &o) const noexcept
{ return !(*this == o); }
template <class X, IfCompatible<X> = true>
@@ -642,11 +647,11 @@ public:
}
template <class X>
- bool operator==(const QSharedPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator==(const QSharedPointer<X> &o) const noexcept
{ return d == o.d; }
template <class X>
- bool operator!=(const QSharedPointer<X> &o) const Q_DECL_NOTHROW
+ bool operator!=(const QSharedPointer<X> &o) const noexcept
{ return !(*this == o); }
inline void clear() { *this = QWeakPointer(); }
@@ -660,7 +665,7 @@ public:
#endif
private:
-
+ friend struct QtPrivate::EnableInternalData;
#if defined(Q_NO_TEMPLATE_FRIENDS)
public:
#else
@@ -689,19 +694,33 @@ public:
value = actual;
}
+ // ### Qt 6: remove users of this API; no one should ever access
+ // a weak pointer's data but the weak pointer itself
+ inline T *internalData() const noexcept
+ {
+ return d == nullptr || d->strongref.loadRelaxed() == 0 ? nullptr : value;
+ }
+
Data *d;
T *value;
};
+namespace QtPrivate {
+struct EnableInternalData {
+ template <typename T>
+ static T *internalData(const QWeakPointer<T> &p) noexcept { return p.internalData(); }
+};
+// hack to delay name lookup to instantiation time by making
+// EnableInternalData a dependent name:
+template <typename T>
+struct EnableInternalDataWrap : EnableInternalData {};
+}
+
template <class T>
class QEnableSharedFromThis
{
protected:
-#ifdef Q_COMPILER_DEFAULT_MEMBERS
QEnableSharedFromThis() = default;
-#else
- Q_DECL_CONSTEXPR QEnableSharedFromThis() {}
-#endif
QEnableSharedFromThis(const QEnableSharedFromThis &) {}
QEnableSharedFromThis &operator=(const QEnableSharedFromThis &) { return *this; }
@@ -728,92 +747,92 @@ public:
// operator== and operator!=
//
template <class T, class X>
-bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator==(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return ptr1.data() == ptr2.data();
}
template <class T, class X>
-bool operator!=(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator!=(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return ptr1.data() != ptr2.data();
}
template <class T, class X>
-bool operator==(const QSharedPointer<T> &ptr1, const X *ptr2) Q_DECL_NOTHROW
+bool operator==(const QSharedPointer<T> &ptr1, const X *ptr2) noexcept
{
return ptr1.data() == ptr2;
}
template <class T, class X>
-bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator==(const T *ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return ptr1 == ptr2.data();
}
template <class T, class X>
-bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2) Q_DECL_NOTHROW
+bool operator!=(const QSharedPointer<T> &ptr1, const X *ptr2) noexcept
{
return !(ptr1 == ptr2);
}
template <class T, class X>
-bool operator!=(const T *ptr1, const QSharedPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator!=(const T *ptr1, const QSharedPointer<X> &ptr2) noexcept
{
return !(ptr2 == ptr1);
}
template <class T, class X>
-bool operator==(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator==(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) noexcept
{
return ptr2 == ptr1;
}
template <class T, class X>
-bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) Q_DECL_NOTHROW
+bool operator!=(const QSharedPointer<T> &ptr1, const QWeakPointer<X> &ptr2) noexcept
{
return ptr2 != ptr1;
}
template<class T>
-inline bool operator==(const QSharedPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator==(const QSharedPointer<T> &lhs, std::nullptr_t) noexcept
{
return lhs.isNull();
}
template<class T>
-inline bool operator!=(const QSharedPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator!=(const QSharedPointer<T> &lhs, std::nullptr_t) noexcept
{
return !lhs.isNull();
}
template<class T>
-inline bool operator==(std::nullptr_t, const QSharedPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator==(std::nullptr_t, const QSharedPointer<T> &rhs) noexcept
{
return rhs.isNull();
}
template<class T>
-inline bool operator!=(std::nullptr_t, const QSharedPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(std::nullptr_t, const QSharedPointer<T> &rhs) noexcept
{
return !rhs.isNull();
}
template<class T>
-inline bool operator==(const QWeakPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator==(const QWeakPointer<T> &lhs, std::nullptr_t) noexcept
{
return lhs.isNull();
}
template<class T>
-inline bool operator!=(const QWeakPointer<T> &lhs, std::nullptr_t) Q_DECL_NOTHROW
+inline bool operator!=(const QWeakPointer<T> &lhs, std::nullptr_t) noexcept
{
return !lhs.isNull();
}
template<class T>
-inline bool operator==(std::nullptr_t, const QWeakPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator==(std::nullptr_t, const QWeakPointer<T> &rhs) noexcept
{
return rhs.isNull();
}
template<class T>
-inline bool operator!=(std::nullptr_t, const QWeakPointer<T> &rhs) Q_DECL_NOTHROW
+inline bool operator!=(std::nullptr_t, const QWeakPointer<T> &rhs) noexcept
{
return !rhs.isNull();
}
@@ -876,18 +895,12 @@ Q_INLINE_TEMPLATE QWeakPointer<T> QSharedPointer<T>::toWeakRef() const
}
template <class T>
-inline void qSwap(QSharedPointer<T> &p1, QSharedPointer<T> &p2)
-{
- p1.swap(p2);
-}
+inline void swap(QSharedPointer<T> &p1, QSharedPointer<T> &p2) noexcept
+{ p1.swap(p2); }
-QT_END_NAMESPACE
-namespace std {
- template <class T>
- inline void swap(QT_PREPEND_NAMESPACE(QSharedPointer)<T> &p1, QT_PREPEND_NAMESPACE(QSharedPointer)<T> &p2)
- { p1.swap(p2); }
-}
-QT_BEGIN_NAMESPACE
+template <class T>
+inline void swap(QWeakPointer<T> &p1, QWeakPointer<T> &p2) noexcept
+{ p1.swap(p2); }
namespace QtSharedPointer {
// helper functions:
@@ -972,11 +985,13 @@ qobject_cast(const QWeakPointer<T> &src)
return qSharedPointerObjectCast<typename QtSharedPointer::RemovePointer<X>::Type, T>(src);
}
+/// ### Qt 6: make this use toStrongRef() (once support for storing
+/// non-managed QObjects in QWeakPointer is removed)
template<typename T>
QWeakPointer<typename std::enable_if<QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value, T>::type>
qWeakPointerFromVariant(const QVariant &variant)
{
- return QWeakPointer<T>(qobject_cast<T*>(QtSharedPointer::weakPointerFromVariant_internal(variant).data()));
+ return QWeakPointer<T>(qobject_cast<T*>(QtPrivate::EnableInternalData::internalData(QtSharedPointer::weakPointerFromVariant_internal(variant))));
}
template<typename T>
QSharedPointer<typename std::enable_if<QtPrivate::IsPointerToTypeDerivedFromQObject<T*>::Value, T>::type>
@@ -985,6 +1000,46 @@ qSharedPointerFromVariant(const QVariant &variant)
return qSharedPointerObjectCast<T>(QtSharedPointer::sharedPointerFromVariant_internal(variant));
}
+// std::shared_ptr helpers
+
+template <typename X, class T>
+std::shared_ptr<X> qobject_pointer_cast(const std::shared_ptr<T> &src)
+{
+ using element_type = typename std::shared_ptr<X>::element_type;
+ return std::shared_ptr<X>(src, qobject_cast<element_type *>(src.get()));
+}
+
+template <typename X, class T>
+std::shared_ptr<X> qobject_pointer_cast(std::shared_ptr<T> &&src)
+{
+ using element_type = typename std::shared_ptr<X>::element_type;
+ auto castResult = qobject_cast<element_type *>(src.get());
+ if (castResult) {
+ auto result = std::shared_ptr<X>(std::move(src), castResult);
+#if __cplusplus <= 201703L
+ // C++2a's move aliasing constructor will leave src empty.
+ // Before C++2a we don't really know if the compiler has support for it.
+ // The move aliasing constructor is the resolution for LWG2996,
+ // which does not impose a feature-testing macro. So: clear src.
+ src.reset();
+#endif
+ return result;
+ }
+ return std::shared_ptr<X>();
+}
+
+template <typename X, class T>
+std::shared_ptr<X> qSharedPointerObjectCast(const std::shared_ptr<T> &src)
+{
+ return qobject_pointer_cast<X>(src);
+}
+
+template <typename X, class T>
+std::shared_ptr<X> qSharedPointerObjectCast(std::shared_ptr<T> &&src)
+{
+ return qobject_pointer_cast<X>(std::move(src));
+}
+
#endif
template<typename T> Q_DECLARE_TYPEINFO_BODY(QWeakPointer<T>, Q_MOVABLE_TYPE);
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 09c276c4e0..fb9b5996f6 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -595,9 +595,9 @@ quint64 qDetectCpuFeatures()
features_string + features_indices[qCountTrailingZeroBits(missing)]);
}
- qt_cpu_features[0].store(f | quint32(QSimdInitialized));
+ qt_cpu_features[0].storeRelaxed(f | quint32(QSimdInitialized));
#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
- qt_cpu_features[1].store(f >> 32);
+ qt_cpu_features[1].storeRelaxed(f >> 32);
#endif
return f;
}
@@ -630,7 +630,7 @@ void qDumpCPUFeatures()
# define _rdrandXX_step _rdrand32_step
# endif
-QT_FUNCTION_TARGET(RDRND) qsizetype qRandomCpu(void *buffer, qsizetype count) Q_DECL_NOTHROW
+QT_FUNCTION_TARGET(RDRND) qsizetype qRandomCpu(void *buffer, qsizetype count) noexcept
{
unsigned *ptr = reinterpret_cast<unsigned *>(buffer);
unsigned *end = ptr + count;
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 397b0f55a6..26e98c4542 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -347,9 +347,9 @@ extern Q_CORE_EXPORT QBasicAtomicInteger<unsigned> qt_cpu_features[2];
Q_CORE_EXPORT quint64 qDetectCpuFeatures();
#if defined(Q_PROCESSOR_X86) && QT_COMPILER_SUPPORTS_HERE(RDRND) && !defined(QT_BOOTSTRAPPED)
-Q_CORE_EXPORT qsizetype qRandomCpu(void *, qsizetype) Q_DECL_NOTHROW;
+Q_CORE_EXPORT qsizetype qRandomCpu(void *, qsizetype) noexcept;
#else
-static inline qsizetype qRandomCpu(void *, qsizetype) Q_DECL_NOTHROW
+static inline qsizetype qRandomCpu(void *, qsizetype) noexcept
{
return 0;
}
@@ -357,9 +357,9 @@ static inline qsizetype qRandomCpu(void *, qsizetype) Q_DECL_NOTHROW
static inline quint64 qCpuFeatures()
{
- quint64 features = qt_cpu_features[0].load();
+ quint64 features = qt_cpu_features[0].loadRelaxed();
#ifndef Q_ATOMIC_INT64_IS_SUPPORTED
- features |= quint64(qt_cpu_features[1].load()) << 32;
+ features |= quint64(qt_cpu_features[1].loadRelaxed()) << 32;
#endif
if (Q_UNLIKELY(features == 0)) {
features = qDetectCpuFeatures();
diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp
index 3e97947ad2..2cbaae117d 100644
--- a/src/corelib/tools/qsize.cpp
+++ b/src/corelib/tools/qsize.cpp
@@ -163,7 +163,7 @@ QT_BEGIN_NAMESPACE
\sa setWidth(), setHeight(), transposed()
*/
-void QSize::transpose() Q_DECL_NOTHROW
+void QSize::transpose() noexcept
{
qSwap(wd, ht);
}
@@ -222,7 +222,7 @@ void QSize::transpose() Q_DECL_NOTHROW
Return a size scaled to a rectangle with the given size \a s,
according to the specified \a mode.
*/
-QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept
{
if (mode == Qt::IgnoreAspectRatio || wd == 0 || ht == 0) {
return s;
@@ -390,7 +390,25 @@ QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHR
\sa expandedTo(), scale()
*/
+/*!
+ \fn QSize QSize::grownBy(QMargins margins) const
+ \fn QSizeF QSizeF::grownBy(QMarginsF margins) const
+ \since 5.14
+
+ Returns the size that results from growing this size by \a margins.
+
+ \sa shrunkBy()
+*/
+/*!
+ \fn QSize QSize::shrunkBy(QMargins margins) const
+ \fn QSizeF QSizeF::shrunkBy(QMarginsF margins) const
+ \since 5.14
+
+ Returns the size that results from shrinking this size by \a margins.
+
+ \sa grownBy()
+*/
/*****************************************************************************
QSize stream functions
@@ -594,7 +612,7 @@ QDebug operator<<(QDebug dbg, const QSize &s)
\sa setWidth(), setHeight(), transposed()
*/
-void QSizeF::transpose() Q_DECL_NOTHROW
+void QSizeF::transpose() noexcept
{
qSwap(wd, ht);
}
@@ -653,7 +671,7 @@ void QSizeF::transpose() Q_DECL_NOTHROW
Returns a size scaled to a rectangle with the given size \a s,
according to the specified \a mode.
*/
-QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept
{
if (mode == Qt::IgnoreAspectRatio || qIsNull(wd) || qIsNull(ht)) {
return s;
diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h
index bb29dca7c4..06de1cd63f 100644
--- a/src/corelib/tools/qsize.h
+++ b/src/corelib/tools/qsize.h
@@ -41,6 +41,7 @@
#define QSIZE_H
#include <QtCore/qnamespace.h>
+#include <QtCore/qmargins.h>
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
struct CGSize;
@@ -52,46 +53,51 @@ QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QSize
{
public:
- Q_DECL_CONSTEXPR QSize() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QSize(int w, int h) Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline int width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline int height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) Q_DECL_NOTHROW;
- void transpose() Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize transposed() const Q_DECL_NOTHROW;
-
- inline void scale(int w, int h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- inline void scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSize scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline int &rwidth() Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline int &rheight() Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline QSize &operator+=(const QSize &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSize &operator-=(const QSize &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSize &operator*=(qreal c) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QSize() noexcept;
+ Q_DECL_CONSTEXPR QSize(int w, int h) noexcept;
+
+ Q_DECL_CONSTEXPR inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+
+ Q_DECL_CONSTEXPR inline int width() const noexcept;
+ Q_DECL_CONSTEXPR inline int height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) noexcept;
+ void transpose() noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize transposed() const noexcept;
+
+ inline void scale(int w, int h, Qt::AspectRatioMode mode) noexcept;
+ inline void scale(const QSize &s, Qt::AspectRatioMode mode) noexcept;
+ Q_REQUIRED_RESULT QSize scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept;
+ Q_REQUIRED_RESULT QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QSize grownBy(QMargins m) const noexcept
+ { return {width() + m.left() + m.right(), height() + m.top() + m.bottom()}; }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QSize shrunkBy(QMargins m) const noexcept
+ { return {width() - m.left() - m.right(), height() - m.top() - m.bottom()}; }
+
+ Q_DECL_RELAXED_CONSTEXPR inline int &rwidth() noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline int &rheight() noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline QSize &operator+=(const QSize &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSize &operator-=(const QSize &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSize &operator*=(qreal c) noexcept;
inline QSize &operator/=(qreal c);
- friend inline Q_DECL_CONSTEXPR bool operator==(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR bool operator!=(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator+(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator-(const QSize &, const QSize &) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator*(const QSize &, qreal) Q_DECL_NOTHROW;
- friend inline Q_DECL_CONSTEXPR const QSize operator*(qreal, const QSize &) Q_DECL_NOTHROW;
+ friend inline Q_DECL_CONSTEXPR bool operator==(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR bool operator!=(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator+(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator-(const QSize &, const QSize &) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator*(const QSize &, qreal) noexcept;
+ friend inline Q_DECL_CONSTEXPR const QSize operator*(qreal, const QSize &) noexcept;
friend inline const QSize operator/(const QSize &, qreal);
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT CGSize toCGSize() const noexcept;
#endif
private:
@@ -114,74 +120,74 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &);
QSize inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QSize::QSize() Q_DECL_NOTHROW : wd(-1), ht(-1) {}
+Q_DECL_CONSTEXPR inline QSize::QSize() noexcept : wd(-1), ht(-1) {}
-Q_DECL_CONSTEXPR inline QSize::QSize(int w, int h) Q_DECL_NOTHROW : wd(w), ht(h) {}
+Q_DECL_CONSTEXPR inline QSize::QSize(int w, int h) noexcept : wd(w), ht(h) {}
-Q_DECL_CONSTEXPR inline bool QSize::isNull() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSize::isNull() const noexcept
{ return wd==0 && ht==0; }
-Q_DECL_CONSTEXPR inline bool QSize::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSize::isEmpty() const noexcept
{ return wd<1 || ht<1; }
-Q_DECL_CONSTEXPR inline bool QSize::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSize::isValid() const noexcept
{ return wd>=0 && ht>=0; }
-Q_DECL_CONSTEXPR inline int QSize::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QSize::width() const noexcept
{ return wd; }
-Q_DECL_CONSTEXPR inline int QSize::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int QSize::height() const noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSize::setWidth(int w) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSize::setWidth(int w) noexcept
{ wd = w; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSize::setHeight(int h) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSize::setHeight(int h) noexcept
{ ht = h; }
-Q_DECL_CONSTEXPR inline QSize QSize::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSize::transposed() const noexcept
{ return QSize(ht, wd); }
-inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode) noexcept
{ scale(QSize(w, h), mode); }
-inline void QSize::scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSize::scale(const QSize &s, Qt::AspectRatioMode mode) noexcept
{ *this = scaled(s, mode); }
-inline QSize QSize::scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+inline QSize QSize::scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept
{ return scaled(QSize(w, h), mode); }
-Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rwidth() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rwidth() noexcept
{ return wd; }
-Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rheight() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline int &QSize::rheight() noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator+=(const QSize &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator+=(const QSize &s) noexcept
{ wd+=s.wd; ht+=s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator-=(const QSize &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator-=(const QSize &s) noexcept
{ wd-=s.wd; ht-=s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator*=(qreal c) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSize &QSize::operator*=(qreal c) noexcept
{ wd = qRound(wd*c); ht = qRound(ht*c); return *this; }
-Q_DECL_CONSTEXPR inline bool operator==(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QSize &s1, const QSize &s2) noexcept
{ return s1.wd == s2.wd && s1.ht == s2.ht; }
-Q_DECL_CONSTEXPR inline bool operator!=(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QSize &s1, const QSize &s2) noexcept
{ return s1.wd != s2.wd || s1.ht != s2.ht; }
-Q_DECL_CONSTEXPR inline const QSize operator+(const QSize & s1, const QSize & s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator+(const QSize & s1, const QSize & s2) noexcept
{ return QSize(s1.wd+s2.wd, s1.ht+s2.ht); }
-Q_DECL_CONSTEXPR inline const QSize operator-(const QSize &s1, const QSize &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator-(const QSize &s1, const QSize &s2) noexcept
{ return QSize(s1.wd-s2.wd, s1.ht-s2.ht); }
-Q_DECL_CONSTEXPR inline const QSize operator*(const QSize &s, qreal c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator*(const QSize &s, qreal c) noexcept
{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
-Q_DECL_CONSTEXPR inline const QSize operator*(qreal c, const QSize &s) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSize operator*(qreal c, const QSize &s) noexcept
{ return QSize(qRound(s.wd*c), qRound(s.ht*c)); }
inline QSize &QSize::operator/=(qreal c)
@@ -197,12 +203,12 @@ inline const QSize operator/(const QSize &s, qreal c)
return QSize(qRound(s.wd/c), qRound(s.ht/c));
}
-Q_DECL_CONSTEXPR inline QSize QSize::expandedTo(const QSize & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSize::expandedTo(const QSize & otherSize) const noexcept
{
return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
-Q_DECL_CONSTEXPR inline QSize QSize::boundedTo(const QSize & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSize::boundedTo(const QSize & otherSize) const noexcept
{
return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
@@ -215,50 +221,55 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QSize &);
class Q_CORE_EXPORT QSizeF
{
public:
- Q_DECL_CONSTEXPR QSizeF() Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QSizeF(const QSize &sz) Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR QSizeF(qreal w, qreal h) Q_DECL_NOTHROW;
-
- inline bool isNull() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW;
-
- Q_DECL_CONSTEXPR inline qreal width() const Q_DECL_NOTHROW;
- Q_DECL_CONSTEXPR inline qreal height() const Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) Q_DECL_NOTHROW;
- void transpose() Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF transposed() const Q_DECL_NOTHROW;
-
- inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW;
-
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline qreal &rwidth() Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline qreal &rheight() Q_DECL_NOTHROW;
-
- Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator+=(const QSizeF &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator-=(const QSizeF &) Q_DECL_NOTHROW;
- Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator*=(qreal c) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QSizeF() noexcept;
+ Q_DECL_CONSTEXPR QSizeF(const QSize &sz) noexcept;
+ Q_DECL_CONSTEXPR QSizeF(qreal w, qreal h) noexcept;
+
+ inline bool isNull() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isEmpty() const noexcept;
+ Q_DECL_CONSTEXPR inline bool isValid() const noexcept;
+
+ Q_DECL_CONSTEXPR inline qreal width() const noexcept;
+ Q_DECL_CONSTEXPR inline qreal height() const noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) noexcept;
+ void transpose() noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF transposed() const noexcept;
+
+ inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept;
+ inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) noexcept;
+ Q_REQUIRED_RESULT QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept;
+ Q_REQUIRED_RESULT QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const noexcept;
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const noexcept;
+
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QSizeF grownBy(QMarginsF m) const noexcept
+ { return {width() + m.left() + m.right(), height() + m.top() + m.bottom()}; }
+ Q_REQUIRED_RESULT Q_DECL_CONSTEXPR QSizeF shrunkBy(QMarginsF m) const noexcept
+ { return {width() - m.left() - m.right(), height() - m.top() - m.bottom()}; }
+
+ Q_DECL_RELAXED_CONSTEXPR inline qreal &rwidth() noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline qreal &rheight() noexcept;
+
+ Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator+=(const QSizeF &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator-=(const QSizeF &) noexcept;
+ Q_DECL_RELAXED_CONSTEXPR inline QSizeF &operator*=(qreal c) noexcept;
inline QSizeF &operator/=(qreal c);
- friend Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &, const QSizeF &) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &, qreal) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal, const QSizeF &) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &, const QSizeF &) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &, qreal) noexcept;
+ friend Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal, const QSizeF &) noexcept;
friend inline const QSizeF operator/(const QSizeF &, qreal);
- Q_DECL_CONSTEXPR inline QSize toSize() const Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR inline QSize toSize() const noexcept;
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
- Q_REQUIRED_RESULT static QSizeF fromCGSize(CGSize size) Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT static QSizeF fromCGSize(CGSize size) noexcept;
+ Q_REQUIRED_RESULT CGSize toCGSize() const noexcept;
#endif
private:
@@ -282,76 +293,76 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &);
QSizeF inline functions
*****************************************************************************/
-Q_DECL_CONSTEXPR inline QSizeF::QSizeF() Q_DECL_NOTHROW : wd(-1.), ht(-1.) {}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF() noexcept : wd(-1.), ht(-1.) {}
-Q_DECL_CONSTEXPR inline QSizeF::QSizeF(const QSize &sz) Q_DECL_NOTHROW : wd(sz.width()), ht(sz.height()) {}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF(const QSize &sz) noexcept : wd(sz.width()), ht(sz.height()) {}
-Q_DECL_CONSTEXPR inline QSizeF::QSizeF(qreal w, qreal h) Q_DECL_NOTHROW : wd(w), ht(h) {}
+Q_DECL_CONSTEXPR inline QSizeF::QSizeF(qreal w, qreal h) noexcept : wd(w), ht(h) {}
-inline bool QSizeF::isNull() const Q_DECL_NOTHROW
+inline bool QSizeF::isNull() const noexcept
{ return qIsNull(wd) && qIsNull(ht); }
-Q_DECL_CONSTEXPR inline bool QSizeF::isEmpty() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSizeF::isEmpty() const noexcept
{ return wd <= 0. || ht <= 0.; }
-Q_DECL_CONSTEXPR inline bool QSizeF::isValid() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool QSizeF::isValid() const noexcept
{ return wd >= 0. && ht >= 0.; }
-Q_DECL_CONSTEXPR inline qreal QSizeF::width() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QSizeF::width() const noexcept
{ return wd; }
-Q_DECL_CONSTEXPR inline qreal QSizeF::height() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline qreal QSizeF::height() const noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setWidth(qreal w) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setWidth(qreal w) noexcept
{ wd = w; }
-Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setHeight(qreal h) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline void QSizeF::setHeight(qreal h) noexcept
{ ht = h; }
-Q_DECL_CONSTEXPR inline QSizeF QSizeF::transposed() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::transposed() const noexcept
{ return QSizeF(ht, wd); }
-inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept
{ scale(QSizeF(w, h), mode); }
-inline void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW
+inline void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) noexcept
{ *this = scaled(s, mode); }
-inline QSizeF QSizeF::scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW
+inline QSizeF QSizeF::scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept
{ return scaled(QSizeF(w, h), mode); }
-Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rwidth() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rwidth() noexcept
{ return wd; }
-Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rheight() Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline qreal &QSizeF::rheight() noexcept
{ return ht; }
-Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator+=(const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator+=(const QSizeF &s) noexcept
{ wd += s.wd; ht += s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator-=(const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator-=(const QSizeF &s) noexcept
{ wd -= s.wd; ht -= s.ht; return *this; }
-Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator*=(qreal c) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline QSizeF &QSizeF::operator*=(qreal c) noexcept
{ wd *= c; ht *= c; return *this; }
-Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &s1, const QSizeF &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(const QSizeF &s1, const QSizeF &s2) noexcept
{ return qFuzzyCompare(s1.wd, s2.wd) && qFuzzyCompare(s1.ht, s2.ht); }
-Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &s1, const QSizeF &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(const QSizeF &s1, const QSizeF &s2) noexcept
{ return !qFuzzyCompare(s1.wd, s2.wd) || !qFuzzyCompare(s1.ht, s2.ht); }
-Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator+(const QSizeF & s1, const QSizeF & s2) noexcept
{ return QSizeF(s1.wd+s2.wd, s1.ht+s2.ht); }
-Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator-(const QSizeF &s1, const QSizeF &s2) noexcept
{ return QSizeF(s1.wd-s2.wd, s1.ht-s2.ht); }
-Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &s, qreal c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator*(const QSizeF &s, qreal c) noexcept
{ return QSizeF(s.wd*c, s.ht*c); }
-Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal c, const QSizeF &s) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline const QSizeF operator*(qreal c, const QSizeF &s) noexcept
{ return QSizeF(s.wd*c, s.ht*c); }
inline QSizeF &QSizeF::operator/=(qreal c)
@@ -367,17 +378,17 @@ inline const QSizeF operator/(const QSizeF &s, qreal c)
return QSizeF(s.wd/c, s.ht/c);
}
-Q_DECL_CONSTEXPR inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::expandedTo(const QSizeF & otherSize) const noexcept
{
return QSizeF(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
}
-Q_DECL_CONSTEXPR inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSizeF QSizeF::boundedTo(const QSizeF & otherSize) const noexcept
{
return QSizeF(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
}
-Q_DECL_CONSTEXPR inline QSize QSizeF::toSize() const Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline QSize QSizeF::toSize() const noexcept
{
return QSize(qRound(wd), qRound(ht));
}
diff --git a/src/corelib/tools/qstack.h b/src/corelib/tools/qstack.h
index bf04935b50..e59212aa2a 100644
--- a/src/corelib/tools/qstack.h
+++ b/src/corelib/tools/qstack.h
@@ -50,7 +50,7 @@ class QStack : public QVector<T>
{
public:
// compiler-generated special member functions are fine!
- inline void swap(QStack<T> &other) Q_DECL_NOTHROW { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
+ inline void swap(QStack<T> &other) noexcept { QVector<T>::swap(other); } // prevent QVector<->QStack swaps
inline void push(const T &t) { QVector<T>::append(t); }
T pop();
T &top();
diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp
index fa6c45aa11..0b11e7c77b 100644
--- a/src/corelib/tools/qtimeline.cpp
+++ b/src/corelib/tools/qtimeline.cpp
@@ -526,29 +526,24 @@ QTimeLine::CurveShape QTimeLine::curveShape() const
return EaseInOutCurve;
}
-void QTimeLine::setCurveShape(CurveShape shape)
+static QEasingCurve::Type convert(QTimeLine::CurveShape shape)
{
switch (shape) {
- default:
- case EaseInOutCurve:
- setEasingCurve(QEasingCurve(QEasingCurve::InOutSine));
- break;
- case EaseInCurve:
- setEasingCurve(QEasingCurve(QEasingCurve::InCurve));
- break;
- case EaseOutCurve:
- setEasingCurve(QEasingCurve(QEasingCurve::OutCurve));
- break;
- case LinearCurve:
- setEasingCurve(QEasingCurve(QEasingCurve::Linear));
- break;
- case SineCurve:
- setEasingCurve(QEasingCurve(QEasingCurve::SineCurve));
- break;
- case CosineCurve:
- setEasingCurve(QEasingCurve(QEasingCurve::CosineCurve));
- break;
+#define CASE(x, y) case QTimeLine::x: return QEasingCurve::y
+ CASE(EaseInOutCurve, InOutSine);
+ CASE(EaseInCurve, InCurve);
+ CASE(EaseOutCurve, OutCurve);
+ CASE(LinearCurve, Linear);
+ CASE(SineCurve, SineCurve);
+ CASE(CosineCurve, CosineCurve);
+#undef CASE
}
+ Q_UNREACHABLE();
+}
+
+void QTimeLine::setCurveShape(CurveShape shape)
+{
+ setEasingCurve(convert(shape));
}
/*!
diff --git a/src/corelib/tools/qtimeline.h b/src/corelib/tools/qtimeline.h
index d9982bdb58..9a60cd679f 100644
--- a/src/corelib/tools/qtimeline.h
+++ b/src/corelib/tools/qtimeline.h
@@ -40,6 +40,10 @@
#ifndef QTIMELINE_H
#define QTIMELINE_H
+#include <QtCore/qglobal.h>
+
+QT_REQUIRE_CONFIG(easingcurve);
+
#include <QtCore/qeasingcurve.h>
#include <QtCore/qobject.h>
diff --git a/src/corelib/tools/qtimezoneprivate_data_p.h b/src/corelib/tools/qtimezoneprivate_data_p.h
deleted file mode 100644
index 69b9417f19..0000000000
--- a/src/corelib/tools/qtimezoneprivate_data_p.h
+++ /dev/null
@@ -1,1154 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 John Layt <jlayt@kde.org>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QTIMEZONEPRIVATE_DATA_P_H
-#define QTIMEZONEPRIVATE_DATA_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of internal files. This header file may change from version to version
-// without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/private/qglobal_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*
- Windows Zone ID support, included in default base class build so can be used on all platforms,
- e.g. an app running on Linux may need to communicate with a Windows Outlook server. These
- tables can also be used to look-up Region Codes and UTC Offsets on platforms that don't directly
- support them., e.g. Mac does not support availableTimeZones() filtering by region or offset.
-
- Another data table is provided for generic UTC+00:00 format time zones to be used as a
- fall-back if no system time zones are available (QT_NO_SYSTEMLOCALE is set) or for QDateTimes
- with a QT:Spec of OffsetFromUTC
-
- These tables are automatically adapted from the CLDR supplemental/windowsZones.xml data file
- using a script in qtbase/util/local_database. Please do not edit this data directly. In the
- future if ICU is made a hard dependency then the ICU resource can be used directly and this
- table removed
-*/
-
-struct QZoneData {
- quint16 windowsIdKey; // Windows ID Key
- quint16 country; // Country of IANA ID's, AnyCountry means No Country
- quint16 ianaIdIndex; // All IANA ID's for the Windows ID and Country, space separated
-};
-
-struct QWindowsData {
- quint16 windowsIdKey; // Windows ID Key
- quint16 windowsIdIndex; // Windows ID Literal
- quint16 ianaIdIndex; // Default IANA ID for the Windows ID
- qint32 offsetFromUtc; // Standard Time Offset from UTC, used for quick look-ups
-};
-
-struct QUtcData {
- quint16 ianaIdIndex; // IANA ID's
- qint32 offsetFromUtc; // Offset form UTC is seconds
-};
-
-/*
- COPYRIGHT AND PERMISSION NOTICE
-
- Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under
- the Terms of Use in http://www.unicode.org/copyright.html.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of the Unicode data files and any associated documentation (the "Data
- Files") or Unicode software and any associated documentation (the "Software")
- to deal in the Data Files or Software without restriction, including without
- limitation the rights to use, copy, modify, merge, publish, distribute, and/or
- sell copies of the Data Files or Software, and to permit persons to whom the
- Data Files or Software are furnished to do so, provided that (a) the above
- copyright notice(s) and this permission notice appear with all copies of the
- Data Files or Software, (b) both the above copyright notice(s) and this
- permission notice appear in associated documentation, and (c) there is clear
- notice in each modified Data File or in the Software as well as in the
- documentation associated with the Data File(s) or Software that the data or
- software has been modified.
-*/
-
-// GENERATED PART STARTS HERE
-
-/*
- This part of the file was generated on 2017-05-23 from the
- Common Locale Data Repository v29 supplemental/windowsZones.xml file $Revision: 12348 $
-
- http://www.unicode.org/cldr/
-
- Do not edit this code: run cldr2qtimezone.py on updated (or
- edited) CLDR data; see qtbase/util/local_database/.
-*/
-
-// Windows ID Key, Country Enum, IANA ID Index
-static const QZoneData zoneDataTable[] = {
- { 22, 57, 0 }, // Central Europe Standard Time / CzechRepublic
- { 69, 139, 14 }, // Pacific Standard Time / Mexico
- { 53, 188, 51 }, // Mauritius Standard Time / Seychelles
- { 50, 122, 63 }, // Libya Standard Time / Libya
- { 79, 38, 78 }, // SA Western Standard Time / Canada
- { 83, 35, 99 }, // South Africa Standard Time / Burundi
- { 102, 205, 116 }, // W. Europe Standard Time / Sweden
- { 89, 213, 133 }, // Tonga Standard Time / Tokelau
- { 77, 76, 149 }, // SA Eastern Standard Time / FrenchGuiana
- { 79, 215, 165 }, // SA Western Standard Time / TrinidadAndTobago
- { 69, 38, 187 }, // Pacific Standard Time / Canada
- { 97, 0, 239 }, // UTC+12 / AnyCountry
- { 19, 65, 250 }, // Central America Standard Time / ElSalvador
- { 82, 101, 270 }, // Singapore Standard Time / Indonesia
- { 37, 248, 284 }, // FLE Standard Time / AlandIslands
- { 16, 0, 301 }, // Cape Verde Standard Time / AnyCountry
- { 97, 220, 311 }, // UTC+12 / Tuvalu
- { 79, 182, 328 }, // SA Western Standard Time / SaintVincentAndTheGrenadines
- { 83, 179, 347 }, // South Africa Standard Time / Rwanda
- { 102, 125, 361 }, // W. Europe Standard Time / Luxembourg
- { 41, 34, 379 }, // Greenwich Standard Time / BurkinaFaso
- { 20, 116, 398 }, // Central Asia Standard Time / Kyrgyzstan
- { 101, 216, 411 }, // W. Central Africa Standard Time / Tunisia
- { 101, 79, 424 }, // W. Central Africa Standard Time / Gabon
- { 19, 96, 442 }, // Central America Standard Time / Honduras
- { 81, 36, 462 }, // SE Asia Standard Time / Cambodia
- { 82, 170, 478 }, // Singapore Standard Time / Philippines
- { 101, 41, 490 }, // W. Central Africa Standard Time / CentralAfricanRepublic
- { 5, 103, 504 }, // Arabic Standard Time / Iraq
- { 72, 21, 517 }, // Romance Standard Time / Belgium
- { 74, 178, 533 }, // Russia Time Zone 10 / Russia
- { 20, 44, 552 }, // Central Asia Standard Time / China
- { 3, 17, 564 }, // Arab Standard Time / Bahrain
- { 88, 62, 577 }, // Tokyo Standard Time / EastTimor
- { 37, 68, 587 }, // FLE Standard Time / Estonia
- { 41, 136, 602 }, // Greenwich Standard Time / Mauritania
- { 83, 49, 620 }, // South Africa Standard Time / CongoKinshasa
- { 72, 74, 638 }, // Romance Standard Time / France
- { 35, 178, 651 }, // Ekaterinburg Standard Time / Russia
- { 32, 16, 670 }, // Eastern Standard Time / Bahamas
- { 94, 30, 685 }, // UTC-02 / Brazil
- { 12, 30, 701 }, // Bahia Standard Time / Brazil
- { 82, 0, 715 }, // Singapore Standard Time / AnyCountry
- { 29, 201, 725 }, // E. Africa Standard Time / Sudan
- { 24, 229, 741 }, // Central Pacific Standard Time / Vanuatu
- { 55, 227, 755 }, // Montevideo Standard Time / Uruguay
- { 79, 233, 774 }, // SA Western Standard Time / BritishVirginIslands
- { 29, 221, 790 }, // E. Africa Standard Time / Uganda
- { 101, 6, 805 }, // W. Central Africa Standard Time / Angola
- { 68, 141, 819 }, // E. Europe Standard Time / Moldova
- { 51, 112, 835 }, // Line Islands Standard Time / Kiribati
- { 89, 0, 854 }, // Tonga Standard Time / AnyCountry
- { 79, 61, 865 }, // SA Western Standard Time / DominicanRepublic
- { 39, 75, 887 }, // GMT Standard Time / Guernsey
- { 37, 222, 903 }, // FLE Standard Time / Ukraine
- { 83, 28, 949 }, // South Africa Standard Time / Botswana
- { 82, 130, 965 }, // Singapore Standard Time / Malaysia
- { 95, 4, 996 }, // UTC-11 / AmericanSamoa
- { 41, 189, 1014 }, // Greenwich Standard Time / SierraLeone
- { 29, 194, 1030 }, // E. Africa Standard Time / Somalia
- { 94, 196, 1047 }, // UTC-02 / SouthGeorgiaAndTheSouthSandwichIslands
- { 96, 0, 1070 }, // UTC / AnyCountry
- { 101, 37, 1078 }, // W. Central Africa Standard Time / Cameroon
- { 13, 25, 1092 }, // Bangladesh Standard Time / Bhutan
- { 102, 151, 1105 }, // W. Europe Standard Time / Netherlands
- { 37, 118, 1122 }, // FLE Standard Time / Latvia
- { 29, 48, 1134 }, // E. Africa Standard Time / Comoros
- { 60, 178, 1148 }, // N. Central Asia Standard Time / Russia
- { 81, 117, 1175 }, // SE Asia Standard Time / Laos
- { 22, 242, 1190 }, // Central Europe Standard Time / Montenegro
- { 37, 33, 1207 }, // FLE Standard Time / Bulgaria
- { 11, 173, 1220 }, // Azores Standard Time / Portugal
- { 97, 149, 1236 }, // UTC+12 / Nauru
- { 83, 146, 1250 }, // South Africa Standard Time / Mozambique
- { 102, 82, 1264 }, // W. Europe Standard Time / Germany
- { 79, 255, 1294 }, // SA Western Standard Time / Bonaire
- { 24, 153, 1313 }, // Central Pacific Standard Time / NewCaledonia
- { 45, 102, 1328 }, // Iran Standard Time / Iran
- { 13, 18, 1340 }, // Bangladesh Standard Time / Bangladesh
- { 69, 225, 1351 }, // Pacific Standard Time / UnitedStates
- { 102, 142, 1371 }, // W. Europe Standard Time / Monaco
- { 29, 128, 1385 }, // E. Africa Standard Time / Madagascar
- { 65, 178, 1405 }, // North Asia East Standard Time / Russia
- { 20, 8, 1418 }, // Central Asia Standard Time / Antarctica
- { 22, 2, 1436 }, // Central Europe Standard Time / Albania
- { 79, 87, 1450 }, // SA Western Standard Time / Grenada
- { 81, 0, 1466 }, // SE Asia Standard Time / AnyCountry
- { 39, 173, 1476 }, // GMT Standard Time / Portugal
- { 103, 228, 1507 }, // West Asia Standard Time / Uzbekistan
- { 58, 139, 1536 }, // Mountain Standard Time / Mexico
- { 83, 129, 1552 }, // South Africa Standard Time / Malawi
- { 78, 107, 1568 }, // SA Pacific Standard Time / Jamaica
- { 41, 91, 1584 }, // Greenwich Standard Time / Guinea
- { 101, 49, 1599 }, // W. Central Africa Standard Time / CongoKinshasa
- { 43, 226, 1615 }, // Hawaiian Standard Time / UnitedStatesMinorOutlyingIslands
- { 77, 8, 1632 }, // SA Eastern Standard Time / Antarctica
- { 97, 235, 1651 }, // UTC+12 / WallisAndFutunaIslands
- { 81, 232, 1666 }, // SE Asia Standard Time / Vietnam
- { 34, 64, 1678 }, // Egypt Standard Time / Egypt
- { 102, 106, 1691 }, // W. Europe Standard Time / Italy
- { 79, 256, 1703 }, // SA Western Standard Time / SintMaarten
- { 59, 147, 1725 }, // Myanmar Standard Time / Myanmar
- { 78, 166, 1738 }, // SA Pacific Standard Time / Panama
- { 56, 236, 1753 }, // Morocco Standard Time / WesternSahara
- { 24, 193, 1769 }, // Central Pacific Standard Time / SolomonIslands
- { 48, 178, 1789 }, // Kaliningrad Standard Time / Russia
- { 47, 109, 1808 }, // Jordan Standard Time / Jordan
- { 42, 177, 1819 }, // GTB Standard Time / Romania
- { 41, 92, 1836 }, // Greenwich Standard Time / GuineaBissau
- { 102, 184, 1850 }, // W. Europe Standard Time / SanMarino
- { 103, 209, 1868 }, // West Asia Standard Time / Tajikistan
- { 75, 178, 1882 }, // Russia Time Zone 11 / Russia
- { 101, 157, 1909 }, // W. Central Africa Standard Time / Nigeria
- { 79, 152, 1922 }, // SA Western Standard Time / CuraSao
- { 57, 139, 1938 }, // Mountain Standard Time (Mexico) / Mexico
- { 4, 162, 1973 }, // Arabian Standard Time / Oman
- { 78, 169, 1985 }, // SA Pacific Standard Time / Peru
- { 102, 206, 1998 }, // W. Europe Standard Time / Switzerland
- { 41, 99, 2012 }, // Greenwich Standard Time / Iceland
- { 33, 139, 2031 }, // Eastern Standard Time (Mexico) / Mexico
- { 58, 225, 2046 }, // Mountain Standard Time / UnitedStates
- { 100, 8, 2075 }, // W. Australia Standard Time / Antarctica
- { 79, 30, 2092 }, // SA Western Standard Time / Brazil
- { 101, 23, 2145 }, // W. Central Africa Standard Time / Benin
- { 78, 43, 2163 }, // SA Pacific Standard Time / Chile
- { 104, 0, 2178 }, // West Pacific Standard Time / AnyCountry
- { 79, 181, 2189 }, // SA Western Standard Time / SaintLucia
- { 27, 126, 2206 }, // China Standard Time / Macau
- { 101, 66, 2217 }, // W. Central Africa Standard Time / EquatorialGuinea
- { 43, 51, 2231 }, // Hawaiian Standard Time / CookIslands
- { 41, 80, 2249 }, // Greenwich Standard Time / Gambia
- { 51, 0, 2263 }, // Line Islands Standard Time / AnyCountry
- { 52, 178, 2274 }, // Magadan Standard Time / Russia
- { 22, 191, 2287 }, // Central Europe Standard Time / Slovakia
- { 102, 5, 2305 }, // W. Europe Standard Time / Andorra
- { 81, 211, 2320 }, // SE Asia Standard Time / Thailand
- { 103, 0, 2333 }, // West Asia Standard Time / AnyCountry
- { 24, 167, 2343 }, // Central Pacific Standard Time / PapuaNewGuinea
- { 102, 230, 2364 }, // W. Europe Standard Time / VaticanCityState
- { 58, 38, 2379 }, // Mountain Standard Time / Canada
- { 77, 202, 2453 }, // SA Eastern Standard Time / Suriname
- { 9, 13, 2472 }, // AUS Eastern Standard Time / Australia
- { 29, 210, 2509 }, // E. Africa Standard Time / Tanzania
- { 58, 0, 2530 }, // Mountain Standard Time / AnyCountry
- { 83, 120, 2538 }, // South Africa Standard Time / Lesotho
- { 97, 134, 2552 }, // UTC+12 / MarshallIslands
- { 29, 111, 2585 }, // E. Africa Standard Time / Kenya
- { 103, 218, 2600 }, // West Asia Standard Time / Turkmenistan
- { 27, 97, 2614 }, // China Standard Time / HongKong
- { 29, 0, 2629 }, // E. Africa Standard Time / AnyCountry
- { 19, 22, 2639 }, // Central America Standard Time / Belize
- { 31, 30, 2654 }, // E. South America Standard Time / Brazil
- { 72, 197, 2672 }, // Romance Standard Time / Spain
- { 81, 101, 2699 }, // SE Asia Standard Time / Indonesia
- { 88, 0, 2727 }, // Tokyo Standard Time / AnyCountry
- { 2, 225, 2737 }, // Alaskan Standard Time / UnitedStates
- { 72, 58, 2832 }, // Romance Standard Time / Denmark
- { 63, 8, 2850 }, // New Zealand Standard Time / Antarctica
- { 3, 175, 2869 }, // Arab Standard Time / Qatar
- { 79, 245, 2880 }, // SA Western Standard Time / Saint Martin
- { 79, 19, 2896 }, // SA Western Standard Time / Barbados
- { 97, 226, 2913 }, // UTC+12 / UnitedStatesMinorOutlyingIslands
- { 37, 73, 2926 }, // FLE Standard Time / Finland
- { 29, 138, 2942 }, // E. Africa Standard Time / Mayotte
- { 39, 71, 2957 }, // GMT Standard Time / FaroeIslands
- { 78, 38, 2973 }, // SA Pacific Standard Time / Canada
- { 43, 0, 2995 }, // Hawaiian Standard Time / AnyCountry
- { 23, 27, 3006 }, // Central European Standard Time / BosniaAndHerzegowina
- { 38, 81, 3022 }, // Georgian Standard Time / Georgia
- { 95, 0, 3035 }, // UTC-11 / AnyCountry
- { 24, 13, 3046 }, // Central Pacific Standard Time / Australia
- { 104, 167, 3067 }, // West Pacific Standard Time / PapuaNewGuinea
- { 71, 168, 3088 }, // Paraguay Standard Time / Paraguay
- { 43, 77, 3105 }, // Hawaiian Standard Time / FrenchPolynesia
- { 41, 212, 3120 }, // Greenwich Standard Time / Togo
- { 39, 197, 3132 }, // GMT Standard Time / Spain
- { 83, 195, 3148 }, // South Africa Standard Time / SouthAfrica
- { 18, 13, 3168 }, // Cen. Australia Standard Time / Australia
- { 104, 160, 3209 }, // West Pacific Standard Time / NorthernMarianaIslands
- { 77, 70, 3224 }, // SA Eastern Standard Time / FalklandIslands
- { 42, 56, 3241 }, // GTB Standard Time / Cyprus
- { 4, 223, 3254 }, // Arabian Standard Time / UnitedArabEmirates
- { 103, 78, 3265 }, // West Asia Standard Time / FrenchSouthernTerritories
- { 101, 42, 3282 }, // W. Central Africa Standard Time / Chad
- { 23, 127, 3298 }, // Central European Standard Time / Macedonia
- { 3, 237, 3312 }, // Arab Standard Time / Yemen
- { 80, 183, 3322 }, // Samoa Standard Time / Samoa
- { 43, 225, 3335 }, // Hawaiian Standard Time / UnitedStates
- { 28, 0, 3352 }, // Dateline Standard Time / AnyCountry
- { 93, 139, 3363 }, // US Mountain Standard Time / Mexico
- { 64, 38, 3382 }, // Newfoundland Standard Time / Canada
- { 63, 154, 3399 }, // New Zealand Standard Time / NewZealand
- { 76, 178, 3416 }, // Russian Standard Time / Russia
- { 82, 190, 3465 }, // Singapore Standard Time / Singapore
- { 1, 1, 3480 }, // Afghanistan Standard Time / Afghanistan
- { 102, 133, 3491 }, // W. Europe Standard Time / Malta
- { 79, 12, 3504 }, // SA Western Standard Time / Aruba
- { 25, 139, 3518 }, // Central Standard Time (Mexico) / Mexico
- { 39, 251, 3594 }, // GMT Standard Time / IsleOfMan
- { 102, 123, 3613 }, // W. Europe Standard Time / Liechtenstein
- { 77, 30, 3626 }, // SA Eastern Standard Time / Brazil
- { 49, 114, 3723 }, // Korea Standard Time / SouthKorea
- { 79, 88, 3734 }, // SA Western Standard Time / Guadeloupe
- { 94, 0, 3753 }, // UTC-02 / AnyCountry
- { 59, 46, 3763 }, // Myanmar Standard Time / CocosIslands
- { 102, 203, 3776 }, // W. Europe Standard Time / SvalbardAndJanMayenIslands
- { 29, 69, 3796 }, // E. Africa Standard Time / Ethiopia
- { 73, 178, 3815 }, // Russia Time Zone 3 / Russia
- { 83, 240, 3829 }, // South Africa Standard Time / Zimbabwe
- { 100, 13, 3843 }, // W. Australia Standard Time / Australia
- { 101, 0, 3859 }, // W. Central Africa Standard Time / AnyCountry
- { 32, 55, 3869 }, // Eastern Standard Time / Cuba
- { 56, 145, 3884 }, // Morocco Standard Time / Morocco
- { 17, 11, 3902 }, // Caucasus Standard Time / Armenia
- { 7, 24, 3915 }, // Atlantic Standard Time / Bermuda
- { 86, 208, 3932 }, // Taipei Standard Time / Taiwan
- { 20, 0, 3944 }, // Central Asia Standard Time / AnyCountry
- { 40, 86, 3954 }, // Greenland Standard Time / Greenland
- { 23, 172, 3970 }, // Central European Standard Time / Poland
- { 89, 214, 3984 }, // Tonga Standard Time / Tonga
- { 20, 110, 4002 }, // Central Asia Standard Time / Kazakhstan
- { 81, 8, 4029 }, // SE Asia Standard Time / Antarctica
- { 54, 119, 4046 }, // Middle East Standard Time / Lebanon
- { 19, 90, 4058 }, // Central America Standard Time / Guatemala
- { 70, 163, 4076 }, // Pakistan Standard Time / Pakistan
- { 41, 83, 4089 }, // Greenwich Standard Time / Ghana
- { 79, 174, 4102 }, // SA Western Standard Time / PuertoRico
- { 79, 26, 4122 }, // SA Western Standard Time / Bolivia
- { 32, 225, 4137 }, // Eastern Standard Time / UnitedStates
- { 85, 207, 4294 }, // Syria Standard Time / Syria
- { 97, 112, 4308 }, // UTC+12 / Kiribati
- { 79, 0, 4323 }, // SA Western Standard Time / AnyCountry
- { 78, 47, 4333 }, // SA Pacific Standard Time / Colombia
- { 16, 39, 4348 }, // Cape Verde Standard Time / CapeVerde
- { 8, 13, 4368 }, // AUS Central Standard Time / Australia
- { 106, 113, 4385 }, // North Korea Standard Time / NorthKorea
- { 10, 15, 4400 }, // Azerbaijan Standard Time / Azerbaijan
- { 102, 84, 4410 }, // W. Europe Standard Time / Gibraltar
- { 46, 105, 4427 }, // Israel Standard Time / Israel
- { 22, 192, 4442 }, // Central Europe Standard Time / Slovenia
- { 24, 159, 4459 }, // Central Pacific Standard Time / NorfolkIsland
- { 82, 32, 4475 }, // Singapore Standard Time / Brunei
- { 101, 50, 4487 }, // W. Central Africa Standard Time / CongoBrazzaville
- { 62, 150, 4506 }, // Nepal Standard Time / Nepal
- { 44, 100, 4520 }, // India Standard Time / India
- { 79, 9, 4534 }, // SA Western Standard Time / AntiguaAndBarbuda
- { 39, 252, 4550 }, // GMT Standard Time / Jersey
- { 79, 144, 4564 }, // SA Western Standard Time / Montserrat
- { 93, 0, 4583 }, // US Mountain Standard Time / AnyCountry
- { 79, 93, 4593 }, // SA Western Standard Time / Guyana
- { 41, 187, 4608 }, // Greenwich Standard Time / Senegal
- { 102, 161, 4621 }, // W. Europe Standard Time / Norway
- { 42, 85, 4633 }, // GTB Standard Time / Greece
- { 3, 115, 4647 }, // Arab Standard Time / Kuwait
- { 24, 140, 4659 }, // Central Pacific Standard Time / Micronesia
- { 19, 52, 4689 }, // Central America Standard Time / CostaRica
- { 79, 60, 4708 }, // SA Western Standard Time / Dominica
- { 83, 204, 4725 }, // South Africa Standard Time / Swaziland
- { 79, 135, 4740 }, // SA Western Standard Time / Martinique
- { 53, 176, 4759 }, // Mauritius Standard Time / Reunion
- { 19, 0, 4774 }, // Central America Standard Time / AnyCountry
- { 90, 217, 4784 }, // Turkey Standard Time / Turkey
- { 66, 178, 4800 }, // North Asia Standard Time / Russia
- { 41, 53, 4835 }, // Greenwich Standard Time / IvoryCoast
- { 78, 30, 4850 }, // SA Pacific Standard Time / Brazil
- { 26, 0, 4886 }, // Central Standard Time / AnyCountry
- { 93, 225, 4894 }, // US Mountain Standard Time / UnitedStates
- { 15, 38, 4910 }, // Canada Central Standard Time / Canada
- { 78, 0, 4947 }, // SA Pacific Standard Time / AnyCountry
- { 103, 8, 4957 }, // West Asia Standard Time / Antarctica
- { 103, 131, 4975 }, // West Asia Standard Time / Maldives
- { 22, 243, 4991 }, // Central Europe Standard Time / Serbia
- { 29, 67, 5007 }, // E. Africa Standard Time / Eritrea
- { 93, 38, 5021 }, // US Mountain Standard Time / Canada
- { 22, 98, 5078 }, // Central Europe Standard Time / Hungary
- { 61, 148, 5094 }, // Namibia Standard Time / Namibia
- { 88, 101, 5110 }, // Tokyo Standard Time / Indonesia
- { 30, 13, 5124 }, // E. Australia Standard Time / Australia
- { 4, 0, 5162 }, // Arabian Standard Time / AnyCountry
- { 98, 231, 5172 }, // Venezuela Standard Time / Venezuela
- { 29, 8, 5188 }, // E. Africa Standard Time / Antarctica
- { 23, 54, 5205 }, // Central European Standard Time / Croatia
- { 6, 10, 5219 }, // Argentina Standard Time / Argentina
- { 67, 8, 5492 }, // Pacific SA Standard Time / Antarctica
- { 32, 38, 5510 }, // Eastern Standard Time / Canada
- { 41, 132, 5615 }, // Greenwich Standard Time / Mali
- { 3, 186, 5629 }, // Arab Standard Time / SaudiArabia
- { 104, 140, 5641 }, // West Pacific Standard Time / Micronesia
- { 88, 108, 5654 }, // Tokyo Standard Time / Japan
- { 89, 112, 5665 }, // Tonga Standard Time / Kiribati
- { 39, 224, 5683 }, // GMT Standard Time / UnitedKingdom
- { 92, 225, 5697 }, // US Eastern Standard Time / UnitedStates
- { 84, 198, 5764 }, // Sri Lanka Standard Time / SriLanka
- { 26, 38, 5777 }, // Central Standard Time / Canada
- { 29, 59, 5852 }, // E. Africa Standard Time / Djibouti
- { 7, 38, 5868 }, // Atlantic Standard Time / Canada
- { 41, 185, 5936 }, // Greenwich Standard Time / SaoTomeAndPrincipe
- { 79, 234, 5952 }, // SA Western Standard Time / UnitedStatesVirginIslands
- { 83, 239, 5970 }, // South Africa Standard Time / Zambia
- { 32, 94, 5984 }, // Eastern Standard Time / Haiti
- { 101, 156, 6007 }, // W. Central Africa Standard Time / Niger
- { 77, 0, 6021 }, // SA Eastern Standard Time / AnyCountry
- { 101, 3, 6031 }, // W. Central Africa Standard Time / Algeria
- { 78, 63, 6046 }, // SA Pacific Standard Time / Ecuador
- { 20, 31, 6064 }, // Central Asia Standard Time / BritishIndianOceanTerritory
- { 27, 44, 6078 }, // China Standard Time / China
- { 21, 30, 6092 }, // Central Brazilian Standard Time / Brazil
- { 95, 226, 6128 }, // UTC-11 / UnitedStatesMinorOutlyingIslands
- { 32, 0, 6143 }, // Eastern Standard Time / AnyCountry
- { 81, 45, 6151 }, // SE Asia Standard Time / ChristmasIsland
- { 19, 63, 6168 }, // Central America Standard Time / Ecuador
- { 79, 7, 6186 }, // SA Western Standard Time / Anguilla
- { 78, 40, 6203 }, // SA Pacific Standard Time / CaymanIslands
- { 79, 180, 6218 }, // SA Western Standard Time / SaintKittsAndNevis
- { 67, 43, 6235 }, // Pacific SA Standard Time / Chile
- { 88, 164, 6252 }, // Tokyo Standard Time / Palau
- { 105, 178, 6266 }, // Yakutsk Standard Time / Russia
- { 37, 124, 6304 }, // FLE Standard Time / Lithuania
- { 41, 121, 6319 }, // Greenwich Standard Time / Liberia
- { 104, 89, 6335 }, // West Pacific Standard Time / Guam
- { 96, 86, 6348 }, // UTC / Greenland
- { 36, 72, 6369 }, // Fiji Standard Time / Fiji
- { 19, 155, 6382 }, // Central America Standard Time / Nicaragua
- { 11, 86, 6398 }, // Azores Standard Time / Greenland
- { 79, 244, 6419 }, // SA Western Standard Time / Saint Barthelemy
- { 69, 0, 6441 }, // Pacific Standard Time / AnyCountry
- { 79, 219, 6449 }, // SA Western Standard Time / TurksAndCaicosIslands
- { 103, 110, 6468 }, // West Asia Standard Time / Kazakhstan
- { 26, 225, 6501 }, // Central Standard Time / UnitedStates
- { 26, 139, 6669 }, // Central Standard Time / Mexico
- { 7, 86, 6687 }, // Atlantic Standard Time / Greenland
- { 24, 0, 6701 }, // Central Pacific Standard Time / AnyCountry
- { 41, 199, 6712 }, // Greenwich Standard Time / SaintHelena
- { 95, 158, 6731 }, // UTC-11 / Niue
- { 53, 137, 6744 }, // Mauritius Standard Time / Mauritius
- { 91, 143, 6761 }, // Ulaanbaatar Standard Time / Mongolia
- { 83, 0, 6794 }, // South Africa Standard Time / AnyCountry
- { 14, 20, 6804 }, // Belarus Standard Time / Belarus
- { 29, 254, 6817 }, // E. Africa Standard Time / SouthSudan
- { 87, 13, 6829 }, // Tasmania Standard Time / Australia
- { 99, 178, 6863 }, // Vladivostok Standard Time / Russia
- { 104, 8, 6908 }, // West Pacific Standard Time / Antarctica
- { 39, 104, 6934 }, // GMT Standard Time / Ireland
- { 102, 14, 6948 }, // W. Europe Standard Time / Austria
- { 0, 0, 0 } // Trailing zeroes
-};
-
-// Windows ID Key, Windows ID Index, IANA ID Index, UTC Offset
-static const QWindowsData windowsDataTable[] = {
- { 1, 0, 3480, 16200 }, // Afghanistan Standard Time
- { 2, 26, 6962,-32400 }, // Alaskan Standard Time
- { 3, 48, 5629, 10800 }, // Arab Standard Time
- { 4, 67, 3254, 14400 }, // Arabian Standard Time
- { 5, 89, 504, 10800 }, // Arabic Standard Time
- { 6, 110, 6980,-10800 }, // Argentina Standard Time
- { 7, 134, 7001,-14400 }, // Atlantic Standard Time
- { 8, 157, 4368, 34200 }, // AUS Central Standard Time
- { 9, 183, 7017, 36000 }, // AUS Eastern Standard Time
- { 10, 209, 4400, 14400 }, // Azerbaijan Standard Time
- { 11, 234, 1220, -3600 }, // Azores Standard Time
- { 12, 255, 701,-10800 }, // Bahia Standard Time
- { 13, 275, 1340, 21600 }, // Bangladesh Standard Time
- { 14, 300, 6804, 10800 }, // Belarus Standard Time
- { 15, 322, 7034,-21600 }, // Canada Central Standard Time
- { 16, 351, 4348, -3600 }, // Cape Verde Standard Time
- { 17, 376, 3902, 14400 }, // Caucasus Standard Time
- { 18, 399, 7049, 34200 }, // Cen. Australia Standard Time
- { 19, 428, 4058,-21600 }, // Central America Standard Time
- { 20, 458, 7068, 21600 }, // Central Asia Standard Time
- { 21, 485, 7080,-14400 }, // Central Brazilian Standard Time
- { 22, 517, 5078, 3600 }, // Central Europe Standard Time
- { 23, 546, 3970, 3600 }, // Central European Standard Time
- { 24, 577, 1769, 39600 }, // Central Pacific Standard Time
- { 25, 607, 7095,-21600 }, // Central Standard Time (Mexico)
- { 26, 638, 7115,-21600 }, // Central Standard Time
- { 27, 660, 6078, 28800 }, // China Standard Time
- { 28, 680, 3352,-43200 }, // Dateline Standard Time
- { 29, 703, 2585, 10800 }, // E. Africa Standard Time
- { 30, 727, 7131, 36000 }, // E. Australia Standard Time
- { 31, 754, 2654,-10800 }, // E. South America Standard Time
- { 32, 785, 7150,-18000 }, // Eastern Standard Time
- { 33, 807, 2031,-18000 }, // Eastern Standard Time (Mexico)
- { 34, 838, 1678, 7200 }, // Egypt Standard Time
- { 35, 858, 651, 18000 }, // Ekaterinburg Standard Time
- { 36, 885, 6369, 43200 }, // Fiji Standard Time
- { 37, 904, 7167, 7200 }, // FLE Standard Time
- { 38, 922, 3022, 14400 }, // Georgian Standard Time
- { 39, 945, 5683, 0 }, // GMT Standard Time
- { 40, 963, 3954,-10800 }, // Greenland Standard Time
- { 41, 987, 2012, 0 }, // Greenwich Standard Time
- { 42, 1011, 1819, 7200 }, // GTB Standard Time
- { 43, 1029, 3335,-36000 }, // Hawaiian Standard Time
- { 44, 1052, 4520, 19800 }, // India Standard Time
- { 45, 1072, 1328, 12600 }, // Iran Standard Time
- { 46, 1091, 4427, 7200 }, // Israel Standard Time
- { 47, 1112, 1808, 7200 }, // Jordan Standard Time
- { 48, 1133, 1789, 7200 }, // Kaliningrad Standard Time
- { 49, 1159, 3723, 32400 }, // Korea Standard Time
- { 50, 1179, 63, 7200 }, // Libya Standard Time
- { 51, 1199, 835, 50400 }, // Line Islands Standard Time
- { 52, 1226, 2274, 36000 }, // Magadan Standard Time
- { 53, 1248, 6744, 14400 }, // Mauritius Standard Time
- { 54, 1272, 4046, 7200 }, // Middle East Standard Time
- { 55, 1298, 755,-10800 }, // Montevideo Standard Time
- { 56, 1323, 3884, 0 }, // Morocco Standard Time
- { 57, 1345, 7179,-25200 }, // Mountain Standard Time (Mexico)
- { 58, 1377, 7197,-25200 }, // Mountain Standard Time
- { 59, 1400, 1725, 23400 }, // Myanmar Standard Time
- { 60, 1422, 7212, 21600 }, // N. Central Asia Standard Time
- { 61, 1452, 5094, 3600 }, // Namibia Standard Time
- { 62, 1474, 4506, 20700 }, // Nepal Standard Time
- { 63, 1494, 3399, 43200 }, // New Zealand Standard Time
- { 64, 1520, 3382,-12600 }, // Newfoundland Standard Time
- { 65, 1547, 1405, 28800 }, // North Asia East Standard Time
- { 66, 1577, 7229, 25200 }, // North Asia Standard Time
- { 67, 1602, 6235,-10800 }, // Pacific SA Standard Time
- { 68, 1627, 819, 7200 }, // E. Europe Standard Time
- { 69, 1651, 1351,-28800 }, // Pacific Standard Time
- { 70, 1673, 4076, 18000 }, // Pakistan Standard Time
- { 71, 1696, 3088,-14400 }, // Paraguay Standard Time
- { 72, 1719, 638, 3600 }, // Romance Standard Time
- { 73, 1741, 3815, 14400 }, // Russia Time Zone 3
- { 74, 1760, 533, 39600 }, // Russia Time Zone 10
- { 75, 1780, 7246, 43200 }, // Russia Time Zone 11
- { 76, 1800, 7261, 10800 }, // Russian Standard Time
- { 77, 1822, 149,-10800 }, // SA Eastern Standard Time
- { 78, 1847, 4333,-18000 }, // SA Pacific Standard Time
- { 79, 1872, 4122,-14400 }, // SA Western Standard Time
- { 80, 1897, 3322, 46800 }, // Samoa Standard Time
- { 81, 1917, 2320, 25200 }, // SE Asia Standard Time
- { 82, 1939, 3465, 28800 }, // Singapore Standard Time
- { 83, 1963, 3148, 7200 }, // South Africa Standard Time
- { 84, 1990, 5764, 19800 }, // Sri Lanka Standard Time
- { 85, 2014, 4294, 7200 }, // Syria Standard Time
- { 86, 2034, 3932, 28800 }, // Taipei Standard Time
- { 87, 2055, 7275, 36000 }, // Tasmania Standard Time
- { 88, 2078, 5654, 32400 }, // Tokyo Standard Time
- { 89, 2098, 3984, 46800 }, // Tonga Standard Time
- { 90, 2118, 4784, 7200 }, // Turkey Standard Time
- { 91, 2139, 7292, 28800 }, // Ulaanbaatar Standard Time
- { 92, 2165, 7309,-18000 }, // US Eastern Standard Time
- { 93, 2190, 4894,-25200 }, // US Mountain Standard Time
- { 94, 2216, 3753, -7200 }, // UTC-02
- { 95, 2223, 3035,-39600 }, // UTC-11
- { 96, 2230, 1070, 0 }, // UTC
- { 97, 2234, 239, 43200 }, // UTC+12
- { 98, 2241, 5172,-16200 }, // Venezuela Standard Time
- { 99, 2265, 7330, 36000 }, // Vladivostok Standard Time
- { 100, 2291, 3843, 28800 }, // W. Australia Standard Time
- { 101, 2318, 1909, 3600 }, // W. Central Africa Standard Time
- { 102, 2350, 7347, 3600 }, // W. Europe Standard Time
- { 103, 2374, 7361, 18000 }, // West Asia Standard Time
- { 104, 2398, 3067, 36000 }, // West Pacific Standard Time
- { 105, 2425, 7375, 32400 }, // Yakutsk Standard Time
- { 106, 2447, 4385, 30600 }, // North Korea Standard Time
- { 0, 0, 0, 0 } // Trailing zeroes
-};
-
-// IANA ID Index, UTC Offset
-static const QUtcData utcDataTable[] = {
- { 7388, 0 }, // UTC
- { 7392,-50400 }, // UTC-14:00
- { 7402,-46800 }, // UTC-13:00
- { 7412,-43200 }, // UTC-12:00
- { 7422,-39600 }, // UTC-11:00
- { 7432,-36000 }, // UTC-10:00
- { 7442,-32400 }, // UTC-09:00
- { 7452,-28800 }, // UTC-08:00
- { 7462,-25200 }, // UTC-07:00
- { 7472,-21600 }, // UTC-06:00
- { 7482,-18000 }, // UTC-05:00
- { 7492,-16200 }, // UTC-04:30
- { 7502,-14400 }, // UTC-04:00
- { 7512,-12600 }, // UTC-03:30
- { 7522,-10800 }, // UTC-03:00
- { 7532, -7200 }, // UTC-02:00
- { 7542, -3600 }, // UTC-01:00
- { 7552, 0 }, // UTC-00:00
- { 7562, 0 }, // UTC+00:00
- { 7572, 3600 }, // UTC+01:00
- { 7582, 7200 }, // UTC+02:00
- { 7592, 10800 }, // UTC+03:00
- { 7602, 12600 }, // UTC+03:30
- { 7612, 14400 }, // UTC+04:00
- { 7622, 16200 }, // UTC+04:30
- { 7632, 18000 }, // UTC+05:00
- { 7642, 19800 }, // UTC+05:30
- { 7652, 20700 }, // UTC+05:45
- { 7662, 21600 }, // UTC+06:00
- { 7672, 23400 }, // UTC+06:30
- { 7682, 25200 }, // UTC+07:00
- { 7692, 28800 }, // UTC+08:00
- { 7702, 32400 }, // UTC+09:00
- { 7712, 34200 }, // UTC+09:30
- { 7722, 36000 }, // UTC+10:00
- { 7732, 39600 }, // UTC+11:00
- { 7742, 43200 }, // UTC+12:00
- { 7752, 46800 }, // UTC+13:00
- { 7762, 50400 }, // UTC+14:00
- { 7772, 30600 }, // UTC+08:30
- { 0, 0 } // Trailing zeroes
-};
-
-static const char windowsIdData[] = {
-0x41, 0x66, 0x67, 0x68, 0x61, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
-0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x6c, 0x61, 0x73, 0x6b, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
-0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x61, 0x62, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x61, 0x62, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
-0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x61, 0x62, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e,
-0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74,
-0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x55, 0x53,
-0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
-0x6d, 0x65, 0x0, 0x41, 0x55, 0x53, 0x20, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
-0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x7a, 0x65, 0x72, 0x62, 0x61, 0x69, 0x6a, 0x61, 0x6e, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x41, 0x7a, 0x6f, 0x72, 0x65, 0x73,
-0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x42, 0x61, 0x68, 0x69, 0x61,
-0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x42, 0x61, 0x6e, 0x67, 0x6c,
-0x61, 0x64, 0x65, 0x73, 0x68, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
-0x42, 0x65, 0x6c, 0x61, 0x72, 0x75, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
-0x65, 0x0, 0x43, 0x61, 0x6e, 0x61, 0x64, 0x61, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61,
-0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x61, 0x70, 0x65, 0x20, 0x56, 0x65, 0x72, 0x64,
-0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x61, 0x75, 0x63,
-0x61, 0x73, 0x75, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43,
-0x65, 0x6e, 0x2e, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
-0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65,
-0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x42, 0x72, 0x61, 0x7a, 0x69, 0x6c, 0x69,
-0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e,
-0x74, 0x72, 0x61, 0x6c, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
-0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
-0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e,
-0x74, 0x72, 0x61, 0x6c, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
-0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x29, 0x0, 0x43, 0x65,
-0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
-0x43, 0x68, 0x69, 0x6e, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
-0x44, 0x61, 0x74, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
-0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x53, 0x6f, 0x75,
-0x74, 0x68, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
-0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x29, 0x0, 0x45, 0x67,
-0x79, 0x70, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x6b,
-0x61, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x62, 0x75, 0x72, 0x67, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x46, 0x69, 0x6a, 0x69, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54,
-0x69, 0x6d, 0x65, 0x0, 0x46, 0x4c, 0x45, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
-0x65, 0x0, 0x47, 0x65, 0x6f, 0x72, 0x67, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x4d, 0x54, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
-0x6d, 0x65, 0x0, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x77, 0x69, 0x63, 0x68, 0x20, 0x53, 0x74, 0x61,
-0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x47, 0x54, 0x42, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64,
-0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x48, 0x61, 0x77, 0x61, 0x69, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74,
-0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x20, 0x53, 0x74,
-0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x49, 0x72, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61,
-0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x49, 0x73, 0x72, 0x61, 0x65, 0x6c, 0x20, 0x53, 0x74,
-0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4a, 0x6f, 0x72, 0x64, 0x61, 0x6e, 0x20, 0x53,
-0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4b, 0x61, 0x6c, 0x69, 0x6e, 0x69, 0x6e,
-0x67, 0x72, 0x61, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4b,
-0x6f, 0x72, 0x65, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4c,
-0x69, 0x62, 0x79, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4c,
-0x69, 0x6e, 0x65, 0x20, 0x49, 0x73, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64,
-0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x61, 0x67, 0x61, 0x64, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
-0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73, 0x20, 0x53, 0x74,
-0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x20, 0x45,
-0x61, 0x73, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x6f,
-0x6e, 0x74, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
-0x6d, 0x65, 0x0, 0x4d, 0x6f, 0x72, 0x6f, 0x63, 0x63, 0x6f, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61,
-0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x28, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x29, 0x0, 0x4d, 0x6f, 0x75,
-0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
-0x4d, 0x79, 0x61, 0x6e, 0x6d, 0x61, 0x72, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
-0x65, 0x0, 0x4e, 0x2e, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74,
-0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x61, 0x6d, 0x69, 0x62, 0x69, 0x61, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x65, 0x70, 0x61, 0x6c, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x65, 0x77, 0x20, 0x5a, 0x65,
-0x61, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0,
-0x4e, 0x65, 0x77, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x6c, 0x61, 0x6e, 0x64, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x45, 0x61,
-0x73, 0x74, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x6f, 0x72,
-0x74, 0x68, 0x20, 0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
-0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x41, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x45, 0x2e, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x20, 0x53, 0x74, 0x61,
-0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53,
-0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x6b, 0x69, 0x73, 0x74, 0x61,
-0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x50, 0x61, 0x72, 0x61,
-0x67, 0x75, 0x61, 0x79, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x52,
-0x6f, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65,
-0x0, 0x52, 0x75, 0x73, 0x73, 0x69, 0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x5a, 0x6f, 0x6e, 0x65, 0x20, 0x33, 0x0,
-0x52, 0x75, 0x73, 0x73, 0x69, 0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x5a, 0x6f, 0x6e, 0x65, 0x20, 0x31, 0x30, 0x0,
-0x52, 0x75, 0x73, 0x73, 0x69, 0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x20, 0x5a, 0x6f, 0x6e, 0x65, 0x20, 0x31, 0x31, 0x0,
-0x52, 0x75, 0x73, 0x73, 0x69, 0x61, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d,
-0x65, 0x0, 0x53, 0x41, 0x20, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x41, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x74,
-0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x41, 0x20, 0x57, 0x65, 0x73, 0x74, 0x65,
-0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x61, 0x6d,
-0x6f, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x45, 0x20,
-0x41, 0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53,
-0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69,
-0x6d, 0x65, 0x0, 0x53, 0x6f, 0x75, 0x74, 0x68, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e,
-0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x72, 0x69, 0x20, 0x4c, 0x61, 0x6e, 0x6b, 0x61, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x53, 0x79, 0x72, 0x69, 0x61, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x61, 0x69, 0x70, 0x65, 0x69,
-0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x61, 0x73, 0x6d, 0x61,
-0x6e, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x6f,
-0x6b, 0x79, 0x6f, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x6f,
-0x6e, 0x67, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x54, 0x75,
-0x72, 0x6b, 0x65, 0x79, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x55,
-0x6c, 0x61, 0x61, 0x6e, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x55, 0x53, 0x20, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e,
-0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x55, 0x53, 0x20, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x61, 0x69,
-0x6e, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x55, 0x54, 0x43, 0x2d,
-0x30, 0x32, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x31, 0x0, 0x55, 0x54, 0x43, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x32,
-0x0, 0x56, 0x65, 0x6e, 0x65, 0x7a, 0x75, 0x65, 0x6c, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x56, 0x6c, 0x61, 0x64, 0x69, 0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x20, 0x53, 0x74, 0x61,
-0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61,
-0x6c, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e,
-0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e,
-0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x2e, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x20,
-0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x65, 0x73, 0x74, 0x20, 0x41,
-0x73, 0x69, 0x61, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x57, 0x65,
-0x73, 0x74, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20,
-0x54, 0x69, 0x6d, 0x65, 0x0, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x20, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,
-0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x20, 0x4b, 0x6f, 0x72, 0x65, 0x61, 0x20, 0x53,
-0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x0
-};
-
-static const char ianaIdData[] = {
-0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x50, 0x72, 0x61, 0x67, 0x75, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x54, 0x69, 0x6a, 0x75, 0x61, 0x6e, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61,
-0x6e, 0x74, 0x61, 0x5f, 0x49, 0x73, 0x61, 0x62, 0x65, 0x6c, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61,
-0x68, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x72, 0x69, 0x70, 0x6f, 0x6c, 0x69, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6c, 0x61, 0x6e, 0x63, 0x2d, 0x53, 0x61, 0x62, 0x6c, 0x6f, 0x6e, 0x0, 0x41,
-0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x6a, 0x75, 0x6d, 0x62, 0x75, 0x72, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f,
-0x70, 0x65, 0x2f, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x6d, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
-0x2f, 0x46, 0x61, 0x6b, 0x61, 0x6f, 0x66, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x79,
-0x65, 0x6e, 0x6e, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x5f, 0x6f, 0x66,
-0x5f, 0x53, 0x70, 0x61, 0x69, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x56, 0x61, 0x6e, 0x63, 0x6f,
-0x75, 0x76, 0x65, 0x72, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x77, 0x73, 0x6f, 0x6e, 0x20,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x57, 0x68, 0x69, 0x74, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x0, 0x45,
-0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x32, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x6c,
-0x5f, 0x53, 0x61, 0x6c, 0x76, 0x61, 0x64, 0x6f, 0x72, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x6b, 0x61, 0x73,
-0x73, 0x61, 0x72, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61, 0x72, 0x69, 0x65, 0x68, 0x61, 0x6d, 0x6e,
-0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x31, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x46,
-0x75, 0x6e, 0x61, 0x66, 0x75, 0x74, 0x69, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x56,
-0x69, 0x6e, 0x63, 0x65, 0x6e, 0x74, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x69, 0x67, 0x61, 0x6c, 0x69,
-0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x75, 0x78, 0x65, 0x6d, 0x62, 0x6f, 0x75, 0x72, 0x67, 0x0, 0x41,
-0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4f, 0x75, 0x61, 0x67, 0x61, 0x64, 0x6f, 0x75, 0x67, 0x6f, 0x75, 0x0, 0x41, 0x73,
-0x69, 0x61, 0x2f, 0x42, 0x69, 0x73, 0x68, 0x6b, 0x65, 0x6b, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x75,
-0x6e, 0x69, 0x73, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x69, 0x62, 0x72, 0x65, 0x76, 0x69, 0x6c, 0x6c,
-0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x65, 0x67, 0x75, 0x63, 0x69, 0x67, 0x61, 0x6c, 0x70,
-0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x68, 0x6e, 0x6f, 0x6d, 0x5f, 0x50, 0x65, 0x6e, 0x68, 0x0, 0x41, 0x73,
-0x69, 0x61, 0x2f, 0x4d, 0x61, 0x6e, 0x69, 0x6c, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x6e,
-0x67, 0x75, 0x69, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x67, 0x68, 0x64, 0x61, 0x64, 0x0, 0x45, 0x75, 0x72,
-0x6f, 0x70, 0x65, 0x2f, 0x42, 0x72, 0x75, 0x73, 0x73, 0x65, 0x6c, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x72,
-0x65, 0x64, 0x6e, 0x65, 0x6b, 0x6f, 0x6c, 0x79, 0x6d, 0x73, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x72, 0x75,
-0x6d, 0x71, 0x69, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x72, 0x61, 0x69, 0x6e, 0x0, 0x41, 0x73, 0x69,
-0x61, 0x2f, 0x44, 0x69, 0x6c, 0x69, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x54, 0x61, 0x6c, 0x6c, 0x69, 0x6e,
-0x6e, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x75, 0x61, 0x6b, 0x63, 0x68, 0x6f, 0x74, 0x74, 0x0,
-0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x62, 0x75, 0x6d, 0x62, 0x61, 0x73, 0x68, 0x69, 0x0, 0x45, 0x75,
-0x72, 0x6f, 0x70, 0x65, 0x2f, 0x50, 0x61, 0x72, 0x69, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x59, 0x65, 0x6b, 0x61,
-0x74, 0x65, 0x72, 0x69, 0x6e, 0x62, 0x75, 0x72, 0x67, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x61,
-0x73, 0x73, 0x61, 0x75, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x6f, 0x6e, 0x68, 0x61,
-0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x69, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47,
-0x4d, 0x54, 0x2d, 0x38, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x68, 0x61, 0x72, 0x74, 0x6f, 0x75, 0x6d,
-0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x66, 0x61, 0x74, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x65, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x54, 0x6f, 0x72, 0x74, 0x6f, 0x6c, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x61, 0x6d,
-0x70, 0x61, 0x6c, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x61, 0x6e, 0x64, 0x61, 0x0, 0x45,
-0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x43, 0x68, 0x69, 0x73, 0x69, 0x6e, 0x61, 0x75, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
-0x69, 0x63, 0x2f, 0x4b, 0x69, 0x72, 0x69, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
-0x54, 0x2d, 0x31, 0x33, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x6f, 0x5f, 0x44,
-0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x47, 0x75, 0x65, 0x72, 0x6e, 0x73,
-0x65, 0x79, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x69, 0x65, 0x76, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70,
-0x65, 0x2f, 0x55, 0x7a, 0x68, 0x67, 0x6f, 0x72, 0x6f, 0x64, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x5a, 0x61,
-0x70, 0x6f, 0x72, 0x6f, 0x7a, 0x68, 0x79, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x61, 0x62, 0x6f,
-0x72, 0x6f, 0x6e, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75, 0x61, 0x6c, 0x61, 0x5f, 0x4c, 0x75, 0x6d, 0x70,
-0x75, 0x72, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x0, 0x50, 0x61, 0x63, 0x69,
-0x66, 0x69, 0x63, 0x2f, 0x50, 0x61, 0x67, 0x6f, 0x5f, 0x50, 0x61, 0x67, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x46, 0x72, 0x65, 0x65, 0x74, 0x6f, 0x77, 0x6e, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x67,
-0x61, 0x64, 0x69, 0x73, 0x68, 0x75, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x53, 0x6f, 0x75, 0x74,
-0x68, 0x5f, 0x47, 0x65, 0x6f, 0x72, 0x67, 0x69, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x0, 0x41, 0x66,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6f, 0x75, 0x61, 0x6c, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x68, 0x69,
-0x6d, 0x70, 0x68, 0x75, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x6d, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61,
-0x6d, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x52, 0x69, 0x67, 0x61, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e,
-0x2f, 0x43, 0x6f, 0x6d, 0x6f, 0x72, 0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x6f, 0x76, 0x6f, 0x73, 0x69, 0x62,
-0x69, 0x72, 0x73, 0x6b, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4f, 0x6d, 0x73, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f,
-0x56, 0x69, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6e, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x50, 0x6f, 0x64,
-0x67, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x6f, 0x66, 0x69, 0x61, 0x0,
-0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x41, 0x7a, 0x6f, 0x72, 0x65, 0x73, 0x0, 0x50, 0x61, 0x63, 0x69,
-0x66, 0x69, 0x63, 0x2f, 0x4e, 0x61, 0x75, 0x72, 0x75, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x70,
-0x75, 0x74, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x20, 0x45, 0x75,
-0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x65, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x4b, 0x72, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x69, 0x6a, 0x6b, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
-0x2f, 0x4e, 0x6f, 0x75, 0x6d, 0x65, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x65, 0x68, 0x72, 0x61, 0x6e, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x68, 0x61, 0x6b, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c,
-0x6f, 0x73, 0x5f, 0x41, 0x6e, 0x67, 0x65, 0x6c, 0x65, 0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x6f,
-0x6e, 0x61, 0x63, 0x6f, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x41, 0x6e, 0x74, 0x61, 0x6e, 0x61, 0x6e, 0x61,
-0x72, 0x69, 0x76, 0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x49, 0x72, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x0, 0x41, 0x6e,
-0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x56, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x0, 0x45, 0x75, 0x72, 0x6f,
-0x70, 0x65, 0x2f, 0x54, 0x69, 0x72, 0x61, 0x6e, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x72,
-0x65, 0x6e, 0x61, 0x64, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x37, 0x0, 0x45, 0x75, 0x72, 0x6f,
-0x70, 0x65, 0x2f, 0x4c, 0x69, 0x73, 0x62, 0x6f, 0x6e, 0x20, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x4d,
-0x61, 0x64, 0x65, 0x69, 0x72, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x73, 0x68, 0x6b, 0x65, 0x6e, 0x74,
-0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x6d, 0x61, 0x72, 0x6b, 0x61, 0x6e, 0x64, 0x0, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4f, 0x6a, 0x69, 0x6e, 0x61, 0x67, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42,
-0x6c, 0x61, 0x6e, 0x74, 0x79, 0x72, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x61, 0x6d, 0x61,
-0x69, 0x63, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x6e, 0x61, 0x6b, 0x72, 0x79, 0x0, 0x41,
-0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x69, 0x6e, 0x73, 0x68, 0x61, 0x73, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
-0x69, 0x63, 0x2f, 0x4a, 0x6f, 0x68, 0x6e, 0x73, 0x74, 0x6f, 0x6e, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69,
-0x63, 0x61, 0x2f, 0x52, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x57,
-0x61, 0x6c, 0x6c, 0x69, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x69, 0x67, 0x6f, 0x6e, 0x0, 0x41, 0x66,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x69, 0x72, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x52, 0x6f,
-0x6d, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x50, 0x72, 0x69,
-0x6e, 0x63, 0x65, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x52, 0x61, 0x6e, 0x67, 0x6f, 0x6f, 0x6e, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x61, 0x6e, 0x61, 0x6d, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f,
-0x45, 0x6c, 0x5f, 0x41, 0x61, 0x69, 0x75, 0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x75, 0x61,
-0x64, 0x61, 0x6c, 0x63, 0x61, 0x6e, 0x61, 0x6c, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x61, 0x6c, 0x69,
-0x6e, 0x69, 0x6e, 0x67, 0x72, 0x61, 0x64, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6d, 0x6d, 0x61, 0x6e, 0x0, 0x45,
-0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x63, 0x68, 0x61, 0x72, 0x65, 0x73, 0x74, 0x0, 0x41, 0x66, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x42, 0x69, 0x73, 0x73, 0x61, 0x75, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x6e,
-0x5f, 0x4d, 0x61, 0x72, 0x69, 0x6e, 0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44, 0x75, 0x73, 0x68, 0x61, 0x6e, 0x62,
-0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x6d, 0x63, 0x68, 0x61, 0x74, 0x6b, 0x61, 0x20, 0x41, 0x73, 0x69,
-0x61, 0x2f, 0x41, 0x6e, 0x61, 0x64, 0x79, 0x72, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x61, 0x67, 0x6f,
-0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x75, 0x72, 0x61, 0x63, 0x61, 0x6f, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x68, 0x75, 0x61, 0x68, 0x75, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x7a, 0x61, 0x74, 0x6c, 0x61, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x75,
-0x73, 0x63, 0x61, 0x74, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x69, 0x6d, 0x61, 0x0, 0x45, 0x75,
-0x72, 0x6f, 0x70, 0x65, 0x2f, 0x5a, 0x75, 0x72, 0x69, 0x63, 0x68, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63,
-0x2f, 0x52, 0x65, 0x79, 0x6b, 0x6a, 0x61, 0x76, 0x69, 0x6b, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43,
-0x61, 0x6e, 0x63, 0x75, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x65, 0x6e, 0x76, 0x65, 0x72,
-0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f, 0x69, 0x73, 0x65, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72,
-0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x73, 0x65, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
-0x4d, 0x61, 0x6e, 0x61, 0x75, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x6f, 0x61, 0x5f, 0x56,
-0x69, 0x73, 0x74, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x6f, 0x5f, 0x56,
-0x65, 0x6c, 0x68, 0x6f, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x6f, 0x2d, 0x4e, 0x6f,
-0x76, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x61, 0x73, 0x74, 0x65, 0x72, 0x0, 0x45, 0x74,
-0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x30, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f,
-0x4c, 0x75, 0x63, 0x69, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x61, 0x75, 0x0, 0x41, 0x66, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x6c, 0x61, 0x62, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x52,
-0x61, 0x72, 0x6f, 0x74, 0x6f, 0x6e, 0x67, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x6e, 0x6a,
-0x75, 0x6c, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x34, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4d,
-0x61, 0x67, 0x61, 0x64, 0x61, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x72, 0x61, 0x74, 0x69, 0x73,
-0x6c, 0x61, 0x76, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x41, 0x6e, 0x64, 0x6f, 0x72, 0x72, 0x61, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x6e, 0x67, 0x6b, 0x6f, 0x6b, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54,
-0x2d, 0x35, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x42, 0x6f, 0x75, 0x67, 0x61, 0x69, 0x6e, 0x76, 0x69,
-0x6c, 0x6c, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6e, 0x0, 0x41,
-0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x64, 0x6d, 0x6f, 0x6e, 0x74, 0x6f, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x6d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x75, 0x76, 0x69, 0x6b, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6b, 0x6e, 0x69, 0x66, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x61, 0x72, 0x69, 0x62, 0x6f, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69,
-0x61, 0x2f, 0x53, 0x79, 0x64, 0x6e, 0x65, 0x79, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4d,
-0x65, 0x6c, 0x62, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x72, 0x5f,
-0x65, 0x73, 0x5f, 0x53, 0x61, 0x6c, 0x61, 0x61, 0x6d, 0x0, 0x4d, 0x53, 0x54, 0x37, 0x4d, 0x44, 0x54, 0x0, 0x41, 0x66,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x73, 0x65, 0x72, 0x75, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f,
-0x4d, 0x61, 0x6a, 0x75, 0x72, 0x6f, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4b, 0x77, 0x61, 0x6a, 0x61,
-0x6c, 0x65, 0x69, 0x6e, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x61, 0x69, 0x72, 0x6f, 0x62, 0x69, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x73, 0x68, 0x67, 0x61, 0x62, 0x61, 0x74, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x48,
-0x6f, 0x6e, 0x67, 0x5f, 0x4b, 0x6f, 0x6e, 0x67, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x33, 0x0, 0x41,
-0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x65, 0x6c, 0x69, 0x7a, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x53, 0x61, 0x6f, 0x5f, 0x50, 0x61, 0x75, 0x6c, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d,
-0x61, 0x64, 0x72, 0x69, 0x64, 0x20, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x65, 0x75, 0x74, 0x61, 0x0, 0x41,
-0x73, 0x69, 0x61, 0x2f, 0x4a, 0x61, 0x6b, 0x61, 0x72, 0x74, 0x61, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x6f, 0x6e,
-0x74, 0x69, 0x61, 0x6e, 0x61, 0x6b, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x39, 0x0, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x4a, 0x75, 0x6e, 0x65, 0x61, 0x75, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65,
-0x74, 0x6c, 0x61, 0x6b, 0x61, 0x74, 0x6c, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x6d,
-0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x69, 0x74, 0x6b, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x61, 0x74, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x43,
-0x6f, 0x70, 0x65, 0x6e, 0x68, 0x61, 0x67, 0x65, 0x6e, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61,
-0x2f, 0x4d, 0x63, 0x4d, 0x75, 0x72, 0x64, 0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x51, 0x61, 0x74, 0x61, 0x72, 0x0,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x69, 0x67, 0x6f, 0x74, 0x0, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x72, 0x62, 0x61, 0x64, 0x6f, 0x73, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63,
-0x2f, 0x57, 0x61, 0x6b, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x48, 0x65, 0x6c, 0x73, 0x69, 0x6e, 0x6b,
-0x69, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x79, 0x6f, 0x74, 0x74, 0x65, 0x0, 0x41, 0x74, 0x6c,
-0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x46, 0x61, 0x65, 0x72, 0x6f, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x43, 0x6f, 0x72, 0x61, 0x6c, 0x5f, 0x48, 0x61, 0x72, 0x62, 0x6f, 0x75, 0x72, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47,
-0x4d, 0x54, 0x2b, 0x31, 0x30, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x61, 0x72, 0x61, 0x6a, 0x65, 0x76,
-0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x62, 0x69, 0x6c, 0x69, 0x73, 0x69, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47,
-0x4d, 0x54, 0x2b, 0x31, 0x31, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x63,
-0x71, 0x75, 0x61, 0x72, 0x69, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x5f,
-0x4d, 0x6f, 0x72, 0x65, 0x73, 0x62, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x73, 0x75, 0x6e,
-0x63, 0x69, 0x6f, 0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x61, 0x68, 0x69, 0x74, 0x69, 0x0,
-0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x6d, 0x65, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63,
-0x2f, 0x43, 0x61, 0x6e, 0x61, 0x72, 0x79, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x6f, 0x68, 0x61, 0x6e,
-0x6e, 0x65, 0x73, 0x62, 0x75, 0x72, 0x67, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x41, 0x64,
-0x65, 0x6c, 0x61, 0x69, 0x64, 0x65, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x42, 0x72, 0x6f,
-0x6b, 0x65, 0x6e, 0x5f, 0x48, 0x69, 0x6c, 0x6c, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x53, 0x61, 0x69,
-0x70, 0x61, 0x6e, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x53, 0x74, 0x61, 0x6e, 0x6c, 0x65, 0x79,
-0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x69, 0x63, 0x6f, 0x73, 0x69, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44,
-0x75, 0x62, 0x61, 0x69, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4b, 0x65, 0x72, 0x67, 0x75, 0x65, 0x6c, 0x65,
-0x6e, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x64, 0x6a, 0x61, 0x6d, 0x65, 0x6e, 0x61, 0x0, 0x45, 0x75,
-0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x6b, 0x6f, 0x70, 0x6a, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x64, 0x65,
-0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x41, 0x70, 0x69, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
-0x69, 0x63, 0x2f, 0x48, 0x6f, 0x6e, 0x6f, 0x6c, 0x75, 0x6c, 0x75, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b,
-0x31, 0x32, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x65, 0x72, 0x6d, 0x6f, 0x73, 0x69, 0x6c, 0x6c,
-0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x4a, 0x6f, 0x68, 0x6e, 0x73, 0x0, 0x50,
-0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x41, 0x75, 0x63, 0x6b, 0x6c, 0x61, 0x6e, 0x64, 0x0, 0x45, 0x75, 0x72, 0x6f,
-0x70, 0x65, 0x2f, 0x4d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x53, 0x69, 0x6d,
-0x66, 0x65, 0x72, 0x6f, 0x70, 0x6f, 0x6c, 0x20, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x6f, 0x6c, 0x67, 0x6f,
-0x67, 0x72, 0x61, 0x64, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x69, 0x6e, 0x67, 0x61, 0x70, 0x6f, 0x72, 0x65, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x62, 0x75, 0x6c, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x61,
-0x6c, 0x74, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x75, 0x62, 0x61, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x61, 0x68, 0x69, 0x61, 0x5f, 0x42, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x61, 0x73,
-0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x72, 0x69, 0x64, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x65, 0x79, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
-0x2f, 0x49, 0x73, 0x6c, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x4d, 0x61, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
-0x56, 0x61, 0x64, 0x75, 0x7a, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x46, 0x6f, 0x72, 0x74, 0x61, 0x6c,
-0x65, 0x7a, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x61, 0x67, 0x75, 0x61, 0x69, 0x6e,
-0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x65, 0x6c, 0x65, 0x6d, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x63, 0x65, 0x69, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52,
-0x65, 0x63, 0x69, 0x66, 0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x61, 0x72,
-0x65, 0x6d, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x65, 0x6f, 0x75, 0x6c, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x47, 0x75, 0x61, 0x64, 0x65, 0x6c, 0x6f, 0x75, 0x70, 0x65, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54,
-0x2b, 0x32, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x6f, 0x63, 0x6f, 0x73, 0x0, 0x41, 0x72, 0x63, 0x74,
-0x69, 0x63, 0x2f, 0x4c, 0x6f, 0x6e, 0x67, 0x79, 0x65, 0x61, 0x72, 0x62, 0x79, 0x65, 0x6e, 0x0, 0x41, 0x66, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x41, 0x64, 0x64, 0x69, 0x73, 0x5f, 0x41, 0x62, 0x61, 0x62, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70,
-0x65, 0x2f, 0x53, 0x61, 0x6d, 0x61, 0x72, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x72, 0x61,
-0x72, 0x65, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x50, 0x65, 0x72, 0x74, 0x68, 0x0, 0x45,
-0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x76,
-0x61, 0x6e, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x73, 0x61, 0x62, 0x6c, 0x61, 0x6e, 0x63,
-0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x59, 0x65, 0x72, 0x65, 0x76, 0x61, 0x6e, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e,
-0x74, 0x69, 0x63, 0x2f, 0x42, 0x65, 0x72, 0x6d, 0x75, 0x64, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x69,
-0x70, 0x65, 0x69, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x36, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x47, 0x6f, 0x64, 0x74, 0x68, 0x61, 0x62, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x57, 0x61, 0x72,
-0x73, 0x61, 0x77, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x6f, 0x6e, 0x67, 0x61, 0x74, 0x61, 0x70,
-0x75, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6c, 0x6d, 0x61, 0x74, 0x79, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x51,
-0x79, 0x7a, 0x79, 0x6c, 0x6f, 0x72, 0x64, 0x61, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f,
-0x44, 0x61, 0x76, 0x69, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x65, 0x69, 0x72, 0x75, 0x74, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x61, 0x74, 0x65, 0x6d, 0x61, 0x6c, 0x61, 0x0, 0x41, 0x73, 0x69, 0x61,
-0x2f, 0x4b, 0x61, 0x72, 0x61, 0x63, 0x68, 0x69, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x63, 0x63, 0x72,
-0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x75, 0x65, 0x72, 0x74, 0x6f, 0x5f, 0x52, 0x69, 0x63,
-0x6f, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x61, 0x5f, 0x50, 0x61, 0x7a, 0x0, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x65, 0x77, 0x5f, 0x59, 0x6f, 0x72, 0x6b, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x44, 0x65, 0x74, 0x72, 0x6f, 0x69, 0x74, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e,
-0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x50, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x20, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x56, 0x69, 0x6e, 0x63, 0x65, 0x6e, 0x6e,
-0x65, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x57,
-0x69, 0x6e, 0x61, 0x6d, 0x61, 0x63, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4b, 0x65, 0x6e, 0x74, 0x75,
-0x63, 0x6b, 0x79, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x69, 0x63, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x4c, 0x6f, 0x75, 0x69, 0x73, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x44,
-0x61, 0x6d, 0x61, 0x73, 0x63, 0x75, 0x73, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x61, 0x72, 0x61,
-0x77, 0x61, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x34, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x42, 0x6f, 0x67, 0x6f, 0x74, 0x61, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x2f, 0x43, 0x61, 0x70,
-0x65, 0x5f, 0x56, 0x65, 0x72, 0x64, 0x65, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x44, 0x61,
-0x72, 0x77, 0x69, 0x6e, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x50, 0x79, 0x6f, 0x6e, 0x67, 0x79, 0x61, 0x6e, 0x67, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x42, 0x61, 0x6b, 0x75, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x47, 0x69, 0x62,
-0x72, 0x61, 0x6c, 0x74, 0x61, 0x72, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x65, 0x72, 0x75, 0x73, 0x61, 0x6c, 0x65,
-0x6d, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x6a, 0x75, 0x62, 0x6c, 0x6a, 0x61, 0x6e, 0x61, 0x0, 0x50,
-0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e, 0x6f, 0x72, 0x66, 0x6f, 0x6c, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f,
-0x42, 0x72, 0x75, 0x6e, 0x65, 0x69, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x72, 0x61, 0x7a, 0x7a, 0x61,
-0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x74, 0x6d, 0x61, 0x6e, 0x64, 0x75, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x74, 0x74, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x41, 0x6e, 0x74, 0x69, 0x67, 0x75, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4a, 0x65, 0x72,
-0x73, 0x65, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x73, 0x65, 0x72, 0x72,
-0x61, 0x74, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x37, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x47, 0x75, 0x79, 0x61, 0x6e, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x6b, 0x61, 0x72,
-0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4f, 0x73, 0x6c, 0x6f, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f,
-0x41, 0x74, 0x68, 0x65, 0x6e, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x75, 0x77, 0x61, 0x69, 0x74, 0x0, 0x50,
-0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x50, 0x6f, 0x6e, 0x61, 0x70, 0x65, 0x20, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69,
-0x63, 0x2f, 0x4b, 0x6f, 0x73, 0x72, 0x61, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x73,
-0x74, 0x61, 0x5f, 0x52, 0x69, 0x63, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x6f, 0x6d, 0x69,
-0x6e, 0x69, 0x63, 0x61, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x62, 0x61, 0x62, 0x61, 0x6e, 0x65, 0x0,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x0, 0x49,
-0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x52, 0x65, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
-0x54, 0x2b, 0x36, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x49, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x0,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x72, 0x61, 0x73, 0x6e, 0x6f, 0x79, 0x61, 0x72, 0x73, 0x6b, 0x20, 0x41, 0x73, 0x69,
-0x61, 0x2f, 0x4e, 0x6f, 0x76, 0x6f, 0x6b, 0x75, 0x7a, 0x6e, 0x65, 0x74, 0x73, 0x6b, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x41, 0x62, 0x69, 0x64, 0x6a, 0x61, 0x6e, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x69,
-0x6f, 0x5f, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x45, 0x69, 0x72,
-0x75, 0x6e, 0x65, 0x70, 0x65, 0x0, 0x43, 0x53, 0x54, 0x36, 0x43, 0x44, 0x54, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x50, 0x68, 0x6f, 0x65, 0x6e, 0x69, 0x78, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x52, 0x65,
-0x67, 0x69, 0x6e, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x43,
-0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x35, 0x0, 0x41, 0x6e, 0x74,
-0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x77, 0x73, 0x6f, 0x6e, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61,
-0x6e, 0x2f, 0x4d, 0x61, 0x6c, 0x64, 0x69, 0x76, 0x65, 0x73, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x65,
-0x6c, 0x67, 0x72, 0x61, 0x64, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x73, 0x6d, 0x65, 0x72, 0x61,
-0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x77, 0x73, 0x6f, 0x6e, 0x5f, 0x43, 0x72, 0x65, 0x65,
-0x6b, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x6e, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x46, 0x6f, 0x72, 0x74, 0x5f, 0x4e, 0x65, 0x6c, 0x73, 0x6f, 0x6e, 0x0, 0x45, 0x75,
-0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x75, 0x64, 0x61, 0x70, 0x65, 0x73, 0x74, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61,
-0x2f, 0x57, 0x69, 0x6e, 0x64, 0x68, 0x6f, 0x65, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4a, 0x61, 0x79, 0x61, 0x70,
-0x75, 0x72, 0x61, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x42, 0x72, 0x69, 0x73, 0x62, 0x61,
-0x6e, 0x65, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x4c, 0x69, 0x6e, 0x64, 0x65, 0x6d, 0x61,
-0x6e, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x34, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
-0x43, 0x61, 0x72, 0x61, 0x63, 0x61, 0x73, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x53,
-0x79, 0x6f, 0x77, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x5a, 0x61, 0x67, 0x72, 0x65, 0x62, 0x0, 0x41,
-0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x65, 0x6e, 0x6f, 0x73, 0x5f, 0x41, 0x69, 0x72, 0x65, 0x73, 0x20,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x4c, 0x61,
-0x5f, 0x52, 0x69, 0x6f, 0x6a, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e,
-0x74, 0x69, 0x6e, 0x61, 0x2f, 0x52, 0x69, 0x6f, 0x5f, 0x47, 0x61, 0x6c, 0x6c, 0x65, 0x67, 0x6f, 0x73, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6c, 0x74,
-0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f,
-0x53, 0x61, 0x6e, 0x5f, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67,
-0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x5f, 0x4c, 0x75, 0x69, 0x73, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f, 0x54, 0x75, 0x63, 0x75, 0x6d, 0x61,
-0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x72, 0x67, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x61, 0x2f,
-0x55, 0x73, 0x68, 0x75, 0x61, 0x69, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x74, 0x61,
-0x6d, 0x61, 0x72, 0x63, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x6f, 0x72, 0x64, 0x6f, 0x62,
-0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4a, 0x75, 0x6a, 0x75, 0x79, 0x20, 0x41, 0x6d, 0x65, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x6e, 0x64, 0x6f, 0x7a, 0x61, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69,
-0x63, 0x61, 0x2f, 0x50, 0x61, 0x6c, 0x6d, 0x65, 0x72, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x6f,
-0x72, 0x6f, 0x6e, 0x74, 0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x71, 0x61, 0x6c, 0x75, 0x69,
-0x74, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x74, 0x72, 0x65, 0x61, 0x6c, 0x20, 0x41,
-0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x69, 0x70, 0x69, 0x67, 0x6f, 0x6e, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x50, 0x61, 0x6e, 0x67, 0x6e, 0x69, 0x72, 0x74, 0x75, 0x6e, 0x67, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x54, 0x68, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x42, 0x61, 0x79, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x42, 0x61, 0x6d, 0x61, 0x6b, 0x6f, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x52, 0x69, 0x79, 0x61, 0x64, 0x68,
-0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x54, 0x72, 0x75, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54,
-0x6f, 0x6b, 0x79, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x45, 0x6e, 0x64, 0x65, 0x72, 0x62, 0x75,
-0x72, 0x79, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x0, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x70, 0x6f, 0x6c, 0x69, 0x73, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x4d, 0x61, 0x72, 0x65, 0x6e, 0x67,
-0x6f, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x56, 0x65,
-0x76, 0x61, 0x79, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x43, 0x6f, 0x6c, 0x6f, 0x6d, 0x62, 0x6f, 0x0, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x57, 0x69, 0x6e, 0x6e, 0x69, 0x70, 0x65, 0x67, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x52, 0x61, 0x69, 0x6e, 0x79, 0x5f, 0x52, 0x69, 0x76, 0x65, 0x72, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x52, 0x61, 0x6e, 0x6b, 0x69, 0x6e, 0x5f, 0x49, 0x6e, 0x6c, 0x65, 0x74, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44,
-0x6a, 0x69, 0x62, 0x6f, 0x75, 0x74, 0x69, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x6c, 0x69,
-0x66, 0x61, 0x78, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x6c, 0x61, 0x63, 0x65, 0x5f, 0x42, 0x61,
-0x79, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x6f, 0x6f, 0x73, 0x65, 0x5f, 0x42, 0x61, 0x79, 0x20,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x63, 0x74, 0x6f, 0x6e, 0x0, 0x41, 0x66, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x53, 0x61, 0x6f, 0x5f, 0x54, 0x6f, 0x6d, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
-0x53, 0x74, 0x5f, 0x54, 0x68, 0x6f, 0x6d, 0x61, 0x73, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4c, 0x75, 0x73,
-0x61, 0x6b, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x50, 0x6f, 0x72, 0x74, 0x2d, 0x61, 0x75, 0x2d,
-0x50, 0x72, 0x69, 0x6e, 0x63, 0x65, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x69, 0x61, 0x6d, 0x65, 0x79,
-0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2b, 0x33, 0x0, 0x41, 0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6c,
-0x67, 0x69, 0x65, 0x72, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x75, 0x61, 0x79, 0x61, 0x71,
-0x75, 0x69, 0x6c, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x68, 0x61, 0x67, 0x6f, 0x73, 0x0, 0x41, 0x73,
-0x69, 0x61, 0x2f, 0x53, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f,
-0x43, 0x75, 0x69, 0x61, 0x62, 0x61, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x6d, 0x70, 0x6f,
-0x5f, 0x47, 0x72, 0x61, 0x6e, 0x64, 0x65, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4d, 0x69, 0x64, 0x77,
-0x61, 0x79, 0x0, 0x45, 0x53, 0x54, 0x35, 0x45, 0x44, 0x54, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x43, 0x68,
-0x72, 0x69, 0x73, 0x74, 0x6d, 0x61, 0x73, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x47, 0x61, 0x6c, 0x61,
-0x70, 0x61, 0x67, 0x6f, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x67, 0x75, 0x69, 0x6c,
-0x6c, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x61, 0x79, 0x6d, 0x61, 0x6e, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x4b, 0x69, 0x74, 0x74, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x53, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x67, 0x6f, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f,
-0x50, 0x61, 0x6c, 0x61, 0x75, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x59, 0x61, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x20, 0x41,
-0x73, 0x69, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x74, 0x61, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x68, 0x61, 0x6e, 0x64,
-0x79, 0x67, 0x61, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x69, 0x6c, 0x6e, 0x69, 0x75, 0x73, 0x0, 0x41,
-0x66, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x6f, 0x6e, 0x72, 0x6f, 0x76, 0x69, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66,
-0x69, 0x63, 0x2f, 0x47, 0x75, 0x61, 0x6d, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x61, 0x6e, 0x6d,
-0x61, 0x72, 0x6b, 0x73, 0x68, 0x61, 0x76, 0x6e, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x46, 0x69, 0x6a,
-0x69, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x75, 0x61, 0x0, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x62, 0x79, 0x73, 0x75, 0x6e, 0x64, 0x0, 0x41,
-0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x53, 0x74, 0x5f, 0x42, 0x61, 0x72, 0x74, 0x68, 0x65, 0x6c, 0x65, 0x6d, 0x79,
-0x0, 0x50, 0x53, 0x54, 0x38, 0x50, 0x44, 0x54, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x47, 0x72, 0x61,
-0x6e, 0x64, 0x5f, 0x54, 0x75, 0x72, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4f, 0x72, 0x61, 0x6c, 0x20, 0x41, 0x73,
-0x69, 0x61, 0x2f, 0x41, 0x71, 0x74, 0x61, 0x75, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x71, 0x74, 0x6f, 0x62, 0x65,
-0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x63, 0x61, 0x67, 0x6f, 0x20, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x4b, 0x6e, 0x6f, 0x78, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x61, 0x2f, 0x54, 0x65, 0x6c, 0x6c, 0x5f, 0x43,
-0x69, 0x74, 0x79, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x6e, 0x65,
-0x65, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f,
-0x74, 0x61, 0x2f, 0x42, 0x65, 0x75, 0x6c, 0x61, 0x68, 0x20, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f,
-0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f, 0x74, 0x61, 0x2f, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x41, 0x6d,
-0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x6f, 0x72, 0x74, 0x68, 0x5f, 0x44, 0x61, 0x6b, 0x6f, 0x74, 0x61, 0x2f, 0x4e,
-0x65, 0x77, 0x5f, 0x53, 0x61, 0x6c, 0x65, 0x6d, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4d, 0x61, 0x74,
-0x61, 0x6d, 0x6f, 0x72, 0x6f, 0x73, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x54, 0x68, 0x75, 0x6c, 0x65,
-0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d, 0x54, 0x2d, 0x31, 0x31, 0x0, 0x41, 0x74, 0x6c, 0x61, 0x6e, 0x74, 0x69, 0x63,
-0x2f, 0x53, 0x74, 0x5f, 0x48, 0x65, 0x6c, 0x65, 0x6e, 0x61, 0x0, 0x50, 0x61, 0x63, 0x69, 0x66, 0x69, 0x63, 0x2f, 0x4e,
-0x69, 0x75, 0x65, 0x0, 0x49, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x2f, 0x4d, 0x61, 0x75, 0x72, 0x69, 0x74, 0x69, 0x75, 0x73,
-0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x6c, 0x61, 0x61, 0x6e, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, 0x20, 0x41, 0x73,
-0x69, 0x61, 0x2f, 0x43, 0x68, 0x6f, 0x69, 0x62, 0x61, 0x6c, 0x73, 0x61, 0x6e, 0x0, 0x45, 0x74, 0x63, 0x2f, 0x47, 0x4d,
-0x54, 0x2d, 0x32, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x69, 0x6e, 0x73, 0x6b, 0x0, 0x41, 0x66, 0x72,
-0x69, 0x63, 0x61, 0x2f, 0x4a, 0x75, 0x62, 0x61, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x48,
-0x6f, 0x62, 0x61, 0x72, 0x74, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x43, 0x75, 0x72, 0x72,
-0x69, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x56, 0x6c, 0x61, 0x64, 0x69, 0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x20,
-0x41, 0x73, 0x69, 0x61, 0x2f, 0x53, 0x61, 0x6b, 0x68, 0x61, 0x6c, 0x69, 0x6e, 0x20, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55,
-0x73, 0x74, 0x2d, 0x4e, 0x65, 0x72, 0x61, 0x0, 0x41, 0x6e, 0x74, 0x61, 0x72, 0x63, 0x74, 0x69, 0x63, 0x61, 0x2f, 0x44,
-0x75, 0x6d, 0x6f, 0x6e, 0x74, 0x44, 0x55, 0x72, 0x76, 0x69, 0x6c, 0x6c, 0x65, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65,
-0x2f, 0x44, 0x75, 0x62, 0x6c, 0x69, 0x6e, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x56, 0x69, 0x65, 0x6e, 0x6e,
-0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x0,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x42, 0x75, 0x65, 0x6e, 0x6f, 0x73, 0x5f, 0x41, 0x69, 0x72, 0x65, 0x73,
-0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x48, 0x61, 0x6c, 0x69, 0x66, 0x61, 0x78, 0x0, 0x41, 0x75, 0x73,
-0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x53, 0x79, 0x64, 0x6e, 0x65, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63,
-0x61, 0x2f, 0x52, 0x65, 0x67, 0x69, 0x6e, 0x61, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61, 0x2f, 0x41,
-0x64, 0x65, 0x6c, 0x61, 0x69, 0x64, 0x65, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x41, 0x6c, 0x6d, 0x61, 0x74, 0x79, 0x0,
-0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x75, 0x69, 0x61, 0x62, 0x61, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x4d, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x5f, 0x43, 0x69, 0x74, 0x79, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69,
-0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x63, 0x61, 0x67, 0x6f, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c, 0x69, 0x61,
-0x2f, 0x42, 0x72, 0x69, 0x73, 0x62, 0x61, 0x6e, 0x65, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x4e, 0x65,
-0x77, 0x5f, 0x59, 0x6f, 0x72, 0x6b, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4b, 0x69, 0x65, 0x76, 0x0, 0x41,
-0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x43, 0x68, 0x69, 0x68, 0x75, 0x61, 0x68, 0x75, 0x61, 0x0, 0x41, 0x6d, 0x65,
-0x72, 0x69, 0x63, 0x61, 0x2f, 0x44, 0x65, 0x6e, 0x76, 0x65, 0x72, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4e, 0x6f, 0x76,
-0x6f, 0x73, 0x69, 0x62, 0x69, 0x72, 0x73, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x72, 0x61, 0x73, 0x6e, 0x6f,
-0x79, 0x61, 0x72, 0x73, 0x6b, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x4b, 0x61, 0x6d, 0x63, 0x68, 0x61, 0x74, 0x6b, 0x61,
-0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x4d, 0x6f, 0x73, 0x63, 0x6f, 0x77, 0x0, 0x41, 0x75, 0x73, 0x74, 0x72,
-0x61, 0x6c, 0x69, 0x61, 0x2f, 0x48, 0x6f, 0x62, 0x61, 0x72, 0x74, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x55, 0x6c, 0x61,
-0x61, 0x6e, 0x62, 0x61, 0x61, 0x74, 0x61, 0x72, 0x0, 0x41, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x61, 0x2f, 0x49, 0x6e, 0x64,
-0x69, 0x61, 0x6e, 0x61, 0x70, 0x6f, 0x6c, 0x69, 0x73, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x56, 0x6c, 0x61, 0x64, 0x69,
-0x76, 0x6f, 0x73, 0x74, 0x6f, 0x6b, 0x0, 0x45, 0x75, 0x72, 0x6f, 0x70, 0x65, 0x2f, 0x42, 0x65, 0x72, 0x6c, 0x69, 0x6e,
-0x0, 0x41, 0x73, 0x69, 0x61, 0x2f, 0x54, 0x61, 0x73, 0x68, 0x6b, 0x65, 0x6e, 0x74, 0x0, 0x41, 0x73, 0x69, 0x61, 0x2f,
-0x59, 0x61, 0x6b, 0x75, 0x74, 0x73, 0x6b, 0x0, 0x55, 0x54, 0x43, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x34, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x33, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x32, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x31, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x31, 0x30, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x39, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x38, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x37, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x36, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x35, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x34, 0x3a, 0x33,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x34, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x33, 0x3a, 0x33,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x33, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x32, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x31, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2d, 0x30, 0x30, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x31, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x32, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x33, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x33, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x34, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x34, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x35, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x35, 0x3a, 0x33, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x35, 0x3a, 0x34,
-0x35, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x36, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x36, 0x3a, 0x33,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x37, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x38, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x39, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x39, 0x3a, 0x33,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x30, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x31, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x32, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x33, 0x3a, 0x30,
-0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x31, 0x34, 0x3a, 0x30, 0x30, 0x0, 0x55, 0x54, 0x43, 0x2b, 0x30, 0x38, 0x3a, 0x33,
-0x30, 0x0
-};
-// GENERATED PART ENDS HERE
-
-QT_END_NAMESPACE
-
-#endif // QTIMEZONEPRIVATE_DATA_P_H
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h
index 17d2ab852a..d48318b474 100644
--- a/src/corelib/tools/qtools_p.h
+++ b/src/corelib/tools/qtools_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -57,17 +57,17 @@
QT_BEGIN_NAMESPACE
namespace QtMiscUtils {
-Q_DECL_CONSTEXPR inline char toHexUpper(uint value) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline char toHexUpper(uint value) noexcept
{
return "0123456789ABCDEF"[value & 0xF];
}
-Q_DECL_CONSTEXPR inline char toHexLower(uint value) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline char toHexLower(uint value) noexcept
{
return "0123456789abcdef"[value & 0xF];
}
-Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int fromHex(uint c) noexcept
{
return ((c >= '0') && (c <= '9')) ? int(c - '0') :
((c >= 'A') && (c <= 'F')) ? int(c - 'A' + 10) :
@@ -75,12 +75,12 @@ Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
/* otherwise */ -1;
}
-Q_DECL_CONSTEXPR inline char toOct(uint value) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline char toOct(uint value) noexcept
{
return '0' + char(value & 0x7);
}
-Q_DECL_CONSTEXPR inline int fromOct(uint c) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline int fromOct(uint c) noexcept
{
return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
}
@@ -96,11 +96,11 @@ struct CalculateGrowingBlockSizeResult {
size_t elementCount;
};
-// implemented in qbytearray.cpp
+// Implemented in qarraydata.cpp:
size_t Q_CORE_EXPORT Q_DECL_CONST_FUNCTION
-qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) Q_DECL_NOTHROW;
+qCalculateBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) noexcept;
CalculateGrowingBlockSizeResult Q_CORE_EXPORT Q_DECL_CONST_FUNCTION
-qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) Q_DECL_NOTHROW ;
+qCalculateGrowingBlockSize(size_t elementCount, size_t elementSize, size_t headerSize = 0) noexcept ;
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index ef3a9884bf..6be695e317 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -43,15 +43,15 @@
#include <QtCore/qcontainerfwd.h>
#include <QtCore/qglobal.h>
#include <QtCore/qalgorithms.h>
+#include <QtCore/qcontainertools_impl.h>
+#include <QtCore/qhashfunctions.h>
-#include <new>
-#include <string.h>
-#include <stdlib.h>
#include <algorithm>
-#ifdef Q_COMPILER_INITIALIZER_LISTS
#include <initializer_list>
-#endif
#include <iterator>
+#include <new>
+#include <string.h>
+#include <stdlib.h>
QT_BEGIN_NAMESPACE
@@ -61,7 +61,9 @@ template<class T, int Prealloc>
class QVarLengthArray
{
public:
- inline explicit QVarLengthArray(int size = 0);
+ QVarLengthArray() : QVarLengthArray(0) {}
+
+ inline explicit QVarLengthArray(int size);
inline QVarLengthArray(const QVarLengthArray<T, Prealloc> &other)
: a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
@@ -69,14 +71,18 @@ public:
append(other.constData(), other.size());
}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QVarLengthArray(std::initializer_list<T> args)
- : a(Prealloc), s(0), ptr(reinterpret_cast<T *>(array))
+ : QVarLengthArray(args.begin(), args.end())
{
- if (args.size())
- append(args.begin(), int(args.size()));
}
-#endif
+
+ template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
+ inline QVarLengthArray(InputIterator first, InputIterator last)
+ : QVarLengthArray()
+ {
+ QtPrivate::reserveIfForwardIterator(this, first, last);
+ std::copy(first, last, std::back_inserter(*this));
+ }
inline ~QVarLengthArray() {
if (QTypeInfo<T>::isComplex) {
@@ -96,7 +102,6 @@ public:
return *this;
}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QVarLengthArray<T, Prealloc> &operator=(std::initializer_list<T> list)
{
resize(int(list.size())); // ### q6sizetype
@@ -104,11 +109,12 @@ public:
QT_MAKE_CHECKED_ARRAY_ITERATOR(this->begin(), this->size()));
return *this;
}
-#endif
inline void removeLast() {
Q_ASSERT(s > 0);
- realloc(s - 1, a);
+ if (QTypeInfo<T>::isComplex)
+ ptr[s - 1].~T();
+ --s;
}
inline int size() const { return s; }
inline int count() const { return s; }
@@ -259,6 +265,13 @@ private:
}
};
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+template <typename InputIterator,
+ typename ValueType = typename std::iterator_traits<InputIterator>::value_type,
+ QtPrivate::IfIsInputIterator<InputIterator> = true>
+QVarLengthArray(InputIterator, InputIterator) -> QVarLengthArray<ValueType>;
+#endif
+
template <class T, int Prealloc>
Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize)
: s(asize) {
@@ -570,7 +583,7 @@ bool operator!=(const QVarLengthArray<T, Prealloc1> &l, const QVarLengthArray<T,
template <typename T, int Prealloc1, int Prealloc2>
bool operator<(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
+ noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
rhs.begin(), rhs.end())))
{
return std::lexicographical_compare(lhs.begin(), lhs.end(),
@@ -579,25 +592,32 @@ bool operator<(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T
template <typename T, int Prealloc1, int Prealloc2>
inline bool operator>(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return rhs < lhs;
}
template <typename T, int Prealloc1, int Prealloc2>
inline bool operator<=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return !(lhs > rhs);
}
template <typename T, int Prealloc1, int Prealloc2>
inline bool operator>=(const QVarLengthArray<T, Prealloc1> &lhs, const QVarLengthArray<T, Prealloc2> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return !(lhs < rhs);
}
+template <typename T, int Prealloc>
+uint qHash(const QVarLengthArray<T, Prealloc> &key, uint seed = 0)
+ noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
+{
+ return qHashRange(key.cbegin(), key.cend(), seed);
+}
+
QT_END_NAMESPACE
#endif // QVARLENGTHARRAY_H
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index bc8df82517..e5ba47b8ef 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -110,6 +110,14 @@
lists.
*/
+/*! \fn template<class T, int Prealloc> template<typename InputIterator> QVarLengthArray<T, Prealloc>::QVarLengthArray(InputIterator first, InputIterator last)
+ \since 5.14
+
+ Constructs an array with the contents in the iterator range [\a first, \a last).
+
+ The value type of \c InputIterator must be convertible to \c T.
+*/
+
/*! \fn template<class T, int Prealloc> QVarLengthArray<T, Prealloc>::~QVarLengthArray()
@@ -895,3 +903,11 @@
\sa indexOf(), lastIndexOf()
*/
+/*!
+ template <typename T, int Prealloc> uint qHash(const QVarLengthArray<T, Prealloc> &key, uint seed = 0)
+ \relates QVarLengthArray
+ \since 5.14
+
+ Returns the hash value for \a key, using \a seed to seed the
+ calculation.
+*/
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 57cf6e51ce..62fbdb4a2a 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -45,14 +45,15 @@
#include <QtCore/qrefcount.h>
#include <QtCore/qarraydata.h>
#include <QtCore/qhashfunctions.h>
+#include <QtCore/qcontainertools_impl.h>
#include <iterator>
+#include <initializer_list>
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <vector>
+#endif
#include <stdlib.h>
#include <string.h>
-#ifdef Q_COMPILER_INITIALIZER_LISTS
-#include <initializer_list>
-#endif
#include <algorithm>
@@ -65,21 +66,22 @@ class QVector
Data *d;
public:
- inline QVector() Q_DECL_NOTHROW : d(Data::sharedNull()) { }
+ inline QVector() noexcept : d(Data::sharedNull()) { }
explicit QVector(int size);
QVector(int size, const T &t);
inline QVector(const QVector<T> &v);
inline ~QVector() { if (!d->ref.deref()) freeData(d); }
QVector<T> &operator=(const QVector<T> &v);
-#if defined(Q_COMPILER_RVALUE_REFS) || defined(Q_CLANG_QDOC)
- QVector(QVector<T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); }
- QVector<T> &operator=(QVector<T> &&other) Q_DECL_NOTHROW
+ QVector(QVector<T> &&other) noexcept : d(other.d) { other.d = Data::sharedNull(); }
+ QVector<T> &operator=(QVector<T> &&other) noexcept
{ QVector moved(std::move(other)); swap(moved); return *this; }
-#endif
- void swap(QVector<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
-#ifdef Q_COMPILER_INITIALIZER_LISTS
+ void swap(QVector<T> &other) noexcept { qSwap(d, other.d); }
inline QVector(std::initializer_list<T> args);
-#endif
+ QVector<T> &operator=(std::initializer_list<T> args);
+ template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
+ inline QVector(InputIterator first, InputIterator last);
+ explicit QVector(QArrayDataPointerRef<T> ref) noexcept : d(ref.ptr) {}
+
bool operator==(const QVector<T> &v) const;
inline bool operator!=(const QVector<T> &v) const { return !(*this == v); }
@@ -138,9 +140,7 @@ public:
T &operator[](int i);
const T &operator[](int i) const;
void append(const T &t);
-#if defined(Q_COMPILER_RVALUE_REFS) || defined(Q_CLANG_QDOC)
void append(T &&t);
-#endif
inline void append(const QVector<T> &l) { *this += l; }
void prepend(T &&t);
void prepend(const T &t);
@@ -208,29 +208,29 @@ public:
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
#if !defined(QT_STRICT_ITERATORS) || defined(Q_CLANG_QDOC)
inline iterator begin() { detach(); return d->begin(); }
- inline const_iterator begin() const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator cbegin() const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator constBegin() const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator begin() const noexcept { return d->constBegin(); }
+ inline const_iterator cbegin() const noexcept { return d->constBegin(); }
+ inline const_iterator constBegin() const noexcept { return d->constBegin(); }
inline iterator end() { detach(); return d->end(); }
- inline const_iterator end() const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator cend() const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator constEnd() const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator end() const noexcept { return d->constEnd(); }
+ inline const_iterator cend() const noexcept { return d->constEnd(); }
+ inline const_iterator constEnd() const noexcept { return d->constEnd(); }
#else
inline iterator begin(iterator = iterator()) { detach(); return d->begin(); }
- inline const_iterator begin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator cbegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
- inline const_iterator constBegin(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constBegin(); }
+ inline const_iterator begin(const_iterator = const_iterator()) const noexcept { return d->constBegin(); }
+ inline const_iterator cbegin(const_iterator = const_iterator()) const noexcept { return d->constBegin(); }
+ inline const_iterator constBegin(const_iterator = const_iterator()) const noexcept { return d->constBegin(); }
inline iterator end(iterator = iterator()) { detach(); return d->end(); }
- inline const_iterator end(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator cend(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
- inline const_iterator constEnd(const_iterator = const_iterator()) const Q_DECL_NOTHROW { return d->constEnd(); }
+ inline const_iterator end(const_iterator = const_iterator()) const noexcept { return d->constEnd(); }
+ inline const_iterator cend(const_iterator = const_iterator()) const noexcept { return d->constEnd(); }
+ inline const_iterator constEnd(const_iterator = const_iterator()) const noexcept { return d->constEnd(); }
#endif
reverse_iterator rbegin() { return reverse_iterator(end()); }
reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crend() const noexcept { return const_reverse_iterator(begin()); }
iterator insert(iterator before, int n, const T &x);
inline iterator insert(iterator before, const T &x) { return insert(before, 1, x); }
inline iterator insert(iterator before, T &&x);
@@ -252,6 +252,13 @@ public:
T value(int i) const;
T value(int i, const T &defaultValue) const;
+ void swapItemsAt(int i, int j) {
+ Q_ASSERT_X(i >= 0 && i < size() && j >= 0 && j < size(),
+ "QVector<T>::swap", "index out of range");
+ detach();
+ qSwap(d->begin()[i], d->begin()[j]);
+ }
+
// STL compatibility
typedef T value_type;
typedef value_type* pointer;
@@ -263,10 +270,8 @@ public:
typedef const_iterator ConstIterator;
typedef int size_type;
inline void push_back(const T &t) { append(t); }
-#if defined(Q_COMPILER_RVALUE_REFS) || defined(Q_CLANG_QDOC)
void push_back(T &&t) { append(std::move(t)); }
void push_front(T &&t) { prepend(std::move(t)); }
-#endif
inline void push_front(const T &t) { prepend(t); }
void pop_back() { removeLast(); }
void pop_front() { removeFirst(); }
@@ -293,14 +298,17 @@ public:
inline QVector<T> &operator<<(T &&t)
{ append(std::move(t)); return *this; }
- QList<T> toList() const;
-
static QVector<T> fromList(const QList<T> &list);
+ QList<T> toList() const;
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ Q_DECL_DEPRECATED_X("Use QVector<T>(vector.begin(), vector.end()) instead.")
static inline QVector<T> fromStdVector(const std::vector<T> &vector)
- { QVector<T> tmp; tmp.reserve(int(vector.size())); std::copy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
+ { return QVector<T>(vector.begin(), vector.end()); }
+ Q_DECL_DEPRECATED_X("Use std::vector<T>(vector.begin(), vector.end()) instead.")
inline std::vector<T> toStdVector() const
{ return std::vector<T>(d->begin(), d->end()); }
+#endif
private:
// ### Qt6: remove methods, they are unused
void reallocData(const int size, const int alloc, QArrayData::AllocationOptions options = QArrayData::Default);
@@ -318,6 +326,13 @@ private:
class AlignmentDummy { Data header; T array[1]; };
};
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+template <typename InputIterator,
+ typename ValueType = typename std::iterator_traits<InputIterator>::value_type,
+ QtPrivate::IfIsInputIterator<InputIterator> = true>
+QVector(InputIterator, InputIterator) -> QVector<ValueType>;
+#endif
+
#ifdef Q_CC_MSVC
// behavior change: an object of POD type constructed with an initializer of the form ()
// will be default-initialized
@@ -522,11 +537,10 @@ QVector<T>::QVector(int asize, const T &t)
}
}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
-# if defined(Q_CC_MSVC)
+#if defined(Q_CC_MSVC)
QT_WARNING_PUSH
QT_WARNING_DISABLE_MSVC(4127) // conditional expression is constant
-# endif // Q_CC_MSVC
+#endif // Q_CC_MSVC
template <typename T>
QVector<T>::QVector(std::initializer_list<T> args)
@@ -542,10 +556,27 @@ QVector<T>::QVector(std::initializer_list<T> args)
d = Data::sharedNull();
}
}
-# if defined(Q_CC_MSVC)
+
+template <typename T>
+QVector<T> &QVector<T>::operator=(std::initializer_list<T> args)
+{
+ QVector<T> tmp(args);
+ tmp.swap(*this);
+ return *this;
+}
+
+#if defined(Q_CC_MSVC)
QT_WARNING_POP
-# endif // Q_CC_MSVC
-#endif // Q_COMPILER_INITALIZER_LISTS
+#endif // Q_CC_MSVC
+
+template <typename T>
+template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator>>
+QVector<T>::QVector(InputIterator first, InputIterator last)
+ : QVector()
+{
+ QtPrivate::reserveIfForwardIterator(this, first, last);
+ std::copy(first, last, std::back_inserter(*this));
+}
template <typename T>
void QVector<T>::freeData(Data *x)
@@ -763,9 +794,9 @@ void QVector<T>::append(const T &t)
realloc(isTooSmall ? d->size + 1 : d->alloc, opt);
if (QTypeInfo<T>::isComplex)
- new (d->end()) T(qMove(copy));
+ new (d->end()) T(std::move(copy));
else
- *d->end() = qMove(copy);
+ *d->end() = std::move(copy);
} else {
if (QTypeInfo<T>::isComplex)
@@ -776,7 +807,6 @@ void QVector<T>::append(const T &t)
++d->size;
}
-#ifdef Q_COMPILER_RVALUE_REFS
template <typename T>
void QVector<T>::append(T &&t)
{
@@ -790,7 +820,6 @@ void QVector<T>::append(T &&t)
++d->size;
}
-#endif
template <typename T>
void QVector<T>::removeLast()
@@ -1052,14 +1081,14 @@ Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR(Vector)
template <typename T>
uint qHash(const QVector<T> &key, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
+ noexcept(noexcept(qHashRange(key.cbegin(), key.cend(), seed)))
{
return qHashRange(key.cbegin(), key.cend(), seed);
}
template <typename T>
bool operator<(const QVector<T> &lhs, const QVector<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
+ noexcept(noexcept(std::lexicographical_compare(lhs.begin(), lhs.end(),
rhs.begin(), rhs.end())))
{
return std::lexicographical_compare(lhs.begin(), lhs.end(),
@@ -1068,21 +1097,21 @@ bool operator<(const QVector<T> &lhs, const QVector<T> &rhs)
template <typename T>
inline bool operator>(const QVector<T> &lhs, const QVector<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return rhs < lhs;
}
template <typename T>
inline bool operator<=(const QVector<T> &lhs, const QVector<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return !(lhs > rhs);
}
template <typename T>
inline bool operator>=(const QVector<T> &lhs, const QVector<T> &rhs)
- Q_DECL_NOEXCEPT_EXPR(noexcept(lhs < rhs))
+ noexcept(noexcept(lhs < rhs))
{
return !(lhs < rhs);
}
@@ -1104,6 +1133,24 @@ extern template class Q_CORE_EXPORT QVector<QPoint>;
QVector<uint> QStringView::toUcs4() const { return QtPrivate::convertToUcs4(*this); }
+QVector<QStringRef> QString::splitRef(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+{ return splitRef(sep, _sb(behavior), cs); }
+QVector<QStringRef> QString::splitRef(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+{ return splitRef(sep, _sb(behavior), cs); }
+#ifndef QT_NO_REGEXP
+QVector<QStringRef> QString::splitRef(const QRegExp &sep, Qt::SplitBehavior behavior) const
+{ return splitRef(sep, _sb(behavior)); }
+#endif
+#if QT_CONFIG(regularexpression)
+QVector<QStringRef> QString::splitRef(const QRegularExpression &sep, Qt::SplitBehavior behavior) const
+{ return splitRef(sep, _sb(behavior)); }
+#endif
+QVector<QStringRef> QStringRef::split(const QString &sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+{ return split(sep, QString::_sb(behavior), cs); }
+QVector<QStringRef> QStringRef::split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const
+{ return split(sep, QString::_sb(behavior), cs); }
+
+
QT_END_NAMESPACE
#endif // QVECTOR_H
diff --git a/src/corelib/tools/qvector.qdoc b/src/corelib/tools/qvector.qdoc
index ad5821e73b..116d962411 100644
--- a/src/corelib/tools/qvector.qdoc
+++ b/src/corelib/tools/qvector.qdoc
@@ -261,6 +261,18 @@
lists.
*/
+/*! \fn template <typename T> template<typename InputIterator> QVector<T>::QVector(InputIterator first, InputIterator last)
+ \since 5.14
+
+ Constructs a vector with the contents in the iterator range [\a first, \a last).
+
+ The value type of \c InputIterator must be convertible to \c T.
+*/
+
+/*!
+ \fn template <typename T> QVector<T>::QVector(QArrayDataPointerRef<T> ref)
+ \internal
+*/
/*! \fn template <typename T> QVector<T>::~QVector()
@@ -281,6 +293,17 @@
\since 5.2
*/
+/*!
+ \fn template <typename T> QVector<T> &QVector<T>::operator=(std::initializer_list<T> args)
+
+ Assigns the collection of values in \a args to this QVector instance.
+
+ This operator is only enabled if the compiler supports C++11 initializer
+ lists.
+
+ \since 5.14
+*/
+
/*! \fn template <typename T> void QVector<T>::swap(QVector<T> &other)
\since 4.8
@@ -288,6 +311,16 @@
never fails.
*/
+/*! \fn template <typename T> void QVector<T>::swapItemsAt(int i, int j)
+ \since 5.14
+
+ Exchange the item at index position \a i with the item at index
+ position \a j. This function assumes that both \a i and \a j are
+ at least 0 but less than size(). To avoid failure, test that both
+ \a i and \a j are at least 0 and less than size().
+*/
+
+
/*! \fn template <typename T> bool QVector<T>::operator==(const QVector<T> &other) const
Returns \c true if \a other is equal to this vector; otherwise
@@ -1326,6 +1359,8 @@
\snippet code/src_corelib_tools_qvector.cpp 14
+ \include containers-range-constructor.qdocinc
+
\sa fromList(), QList::fromVector()
*/
@@ -1337,6 +1372,8 @@
\snippet code/src_corelib_tools_qvector.cpp 15
+ \include containers-range-constructor.qdocinc
+
\sa toList(), QList::toVector()
*/
@@ -1349,6 +1386,8 @@
\snippet code/src_corelib_tools_qvector.cpp 16
+ \include containers-range-constructor.qdocinc
+
\sa toStdVector(), QList::fromStdList()
*/
@@ -1359,6 +1398,8 @@
\snippet code/src_corelib_tools_qvector.cpp 17
+ \include containers-range-constructor.qdocinc
+
\sa fromStdVector(), QList::toStdList()
*/
diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp
index b96e48252e..58e3c15560 100644
--- a/src/corelib/tools/qversionnumber.cpp
+++ b/src/corelib/tools/qversionnumber.cpp
@@ -235,7 +235,7 @@ QVersionNumber QVersionNumber::normalized() const
\sa commonPrefix()
*/
-bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW
+bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const noexcept
{
if (segmentCount() > other.segmentCount())
return false;
@@ -259,7 +259,7 @@ bool QVersionNumber::isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHRO
\snippet qversionnumber/main.cpp 1
*/
-int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW
+int QVersionNumber::compare(const QVersionNumber &v1, const QVersionNumber &v2) noexcept
{
int commonlen;
@@ -482,7 +482,7 @@ QVersionNumber QVersionNumber::fromString(QLatin1String string, int *suffixIndex
if (suffixIndex)
*suffixIndex = int(lastGoodEnd - string.begin());
- return QVersionNumber(qMove(seg));
+ return QVersionNumber(std::move(seg));
}
void QVersionNumber::SegmentStorage::setVector(int len, int maj, int min, int mic)
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h
index 1bfb4aab39..d43b86ba51 100644
--- a/src/corelib/tools/qversionnumber.h
+++ b/src/corelib/tools/qversionnumber.h
@@ -87,7 +87,7 @@ class QVersionNumber
};
// set the InlineSegmentMarker and set length to zero
- SegmentStorage() Q_DECL_NOTHROW : dummy(1) {}
+ SegmentStorage() noexcept : dummy(1) {}
SegmentStorage(const QVector<int> &seg)
{
@@ -119,14 +119,13 @@ class QVersionNumber
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
- SegmentStorage(SegmentStorage &&other) Q_DECL_NOTHROW
+ SegmentStorage(SegmentStorage &&other) noexcept
: dummy(other.dummy)
{
other.dummy = 1;
}
- SegmentStorage &operator=(SegmentStorage &&other) Q_DECL_NOTHROW
+ SegmentStorage &operator=(SegmentStorage &&other) noexcept
{
qSwap(dummy, other.dummy);
return *this;
@@ -139,8 +138,6 @@ class QVersionNumber
else
pointer_segments = new QVector<int>(std::move(seg));
}
-#endif
-#ifdef Q_COMPILER_INITIALIZER_LISTS
SegmentStorage(std::initializer_list<int> args)
{
if (dataFitsInline(args.begin(), int(args.size()))) {
@@ -149,14 +146,13 @@ class QVersionNumber
pointer_segments = new QVector<int>(args);
}
}
-#endif
~SegmentStorage() { if (isUsingPointer()) delete pointer_segments; }
- bool isUsingPointer() const Q_DECL_NOTHROW
+ bool isUsingPointer() const noexcept
{ return (inline_segments[InlineSegmentMarker] & 1) == 0; }
- int size() const Q_DECL_NOTHROW
+ int size() const noexcept
{ return isUsingPointer() ? pointer_segments->size() : (inline_segments[InlineSegmentMarker] >> 1); }
void setInlineSize(int len)
@@ -218,7 +214,7 @@ class QVersionNumber
} m_segments;
public:
- inline QVersionNumber() Q_DECL_NOTHROW
+ inline QVersionNumber() noexcept
: m_segments()
{}
inline explicit QVersionNumber(const QVector<int> &seg)
@@ -227,17 +223,13 @@ public:
// compiler-generated copy/move ctor/assignment operators and the destructor are ok
-#ifdef Q_COMPILER_RVALUE_REFS
explicit QVersionNumber(QVector<int> &&seg)
: m_segments(std::move(seg))
{}
-#endif
-#ifdef Q_COMPILER_INITIALIZER_LISTS
inline QVersionNumber(std::initializer_list<int> args)
: m_segments(args)
{}
-#endif
inline explicit QVersionNumber(int maj)
{ m_segments.setSegments(1, maj); }
@@ -248,34 +240,34 @@ public:
inline explicit QVersionNumber(int maj, int min, int mic)
{ m_segments.setSegments(3, maj, min, mic); }
- Q_REQUIRED_RESULT inline bool isNull() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool isNull() const noexcept
{ return segmentCount() == 0; }
- Q_REQUIRED_RESULT inline bool isNormalized() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline bool isNormalized() const noexcept
{ return isNull() || segmentAt(segmentCount() - 1) != 0; }
- Q_REQUIRED_RESULT inline int majorVersion() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int majorVersion() const noexcept
{ return segmentAt(0); }
- Q_REQUIRED_RESULT inline int minorVersion() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int minorVersion() const noexcept
{ return segmentAt(1); }
- Q_REQUIRED_RESULT inline int microVersion() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int microVersion() const noexcept
{ return segmentAt(2); }
Q_REQUIRED_RESULT Q_CORE_EXPORT QVersionNumber normalized() const;
Q_REQUIRED_RESULT Q_CORE_EXPORT QVector<int> segments() const;
- Q_REQUIRED_RESULT inline int segmentAt(int index) const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int segmentAt(int index) const noexcept
{ return (m_segments.size() > index) ? m_segments.at(index) : 0; }
- Q_REQUIRED_RESULT inline int segmentCount() const Q_DECL_NOTHROW
+ Q_REQUIRED_RESULT inline int segmentCount() const noexcept
{ return m_segments.size(); }
- Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const noexcept;
- Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) noexcept;
Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2);
@@ -299,22 +291,22 @@ Q_DECLARE_TYPEINFO(QVersionNumber, Q_MOVABLE_TYPE);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QVersionNumber &version);
#endif
-Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) > 0; }
-Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) >= 0; }
-Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) < 0; }
-Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) <= 0; }
-Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) == 0; }
-Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW
+Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept
{ return QVersionNumber::compare(lhs, rhs) != 0; }
QT_END_NAMESPACE
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 995bab694e..40c84157cd 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -8,21 +8,10 @@ HEADERS += \
tools/qarraydataops.h \
tools/qarraydatapointer.h \
tools/qbitarray.h \
- tools/qbytearray.h \
- tools/qbytearray_p.h \
- tools/qbytearraylist.h \
- tools/qbytearraymatcher.h \
- tools/qbytedata_p.h \
tools/qcache.h \
- tools/qchar.h \
- tools/qcollator.h \
- tools/qcollator_p.h \
tools/qcontainerfwd.h \
+ tools/qcontainertools_impl.h \
tools/qcryptographichash.h \
- tools/qdatetime.h \
- tools/qdatetime_p.h \
- tools/qdoublescanprint_p.h \
- tools/qeasingcurve.h \
tools/qfreelist_p.h \
tools/qhash.h \
tools/qhashfunctions.h \
@@ -30,10 +19,6 @@ HEADERS += \
tools/qline.h \
tools/qlinkedlist.h \
tools/qlist.h \
- tools/qlocale.h \
- tools/qlocale_p.h \
- tools/qlocale_tools_p.h \
- tools/qlocale_data_p.h \
tools/qmakearray_p.h \
tools/qmap.h \
tools/qmargins.h \
@@ -44,7 +29,6 @@ HEADERS += \
tools/qpoint.h \
tools/qqueue.h \
tools/qrect.h \
- tools/qregexp.h \
tools/qringbuffer_p.h \
tools/qrefcount.h \
tools/qscopeguard.h \
@@ -58,20 +42,7 @@ HEADERS += \
tools/qsimd_p.h \
tools/qsize.h \
tools/qstack.h \
- tools/qstring.h \
- tools/qstringalgorithms.h \
- tools/qstringalgorithms_p.h \
- tools/qstringbuilder.h \
- tools/qstringiterator_p.h \
- tools/qstringlist.h \
- tools/qstringliteral.h \
- tools/qstringmatcher.h \
- tools/qstringview.h \
- tools/qtextboundaryfinder.h \
- tools/qtimeline.h \
tools/qtools_p.h \
- tools/qunicodetables_p.h \
- tools/qunicodetools_p.h \
tools/qvarlengtharray.h \
tools/qvector.h \
tools/qversionnumber.h
@@ -80,59 +51,29 @@ HEADERS += \
SOURCES += \
tools/qarraydata.cpp \
tools/qbitarray.cpp \
- tools/qbytearray.cpp \
- tools/qbytearraylist.cpp \
- tools/qbytearraymatcher.cpp \
- tools/qcollator.cpp \
tools/qcryptographichash.cpp \
- tools/qdatetime.cpp \
- tools/qeasingcurve.cpp \
tools/qfreelist.cpp \
tools/qhash.cpp \
tools/qline.cpp \
tools/qlinkedlist.cpp \
tools/qlist.cpp \
- tools/qlocale.cpp \
- tools/qlocale_tools.cpp \
tools/qpoint.cpp \
tools/qmap.cpp \
tools/qmargins.cpp \
tools/qmessageauthenticationcode.cpp \
tools/qcontiguouscache.cpp \
tools/qrect.cpp \
- tools/qregexp.cpp \
tools/qrefcount.cpp \
tools/qringbuffer.cpp \
tools/qshareddata.cpp \
tools/qsharedpointer.cpp \
tools/qsimd.cpp \
tools/qsize.cpp \
- tools/qstring.cpp \
- tools/qstringbuilder.cpp \
- tools/qstringlist.cpp \
- tools/qstringview.cpp \
- tools/qtextboundaryfinder.cpp \
- tools/qtimeline.cpp \
- tools/qunicodetools.cpp \
- tools/qvsnprintf.cpp \
tools/qversionnumber.cpp
-NO_PCH_SOURCES = tools/qstring_compat.cpp
msvc: NO_PCH_SOURCES += tools/qvector_msvc.cpp
false: SOURCES += $$NO_PCH_SOURCES # Hack for QtCreator
-!nacl:mac: {
- SOURCES += tools/qlocale_mac.mm
-}
-else:unix {
- SOURCES += tools/qlocale_unix.cpp
-}
-else:win32 {
- SOURCES += tools/qlocale_win.cpp
-} else:integrity {
- SOURCES += tools/qlocale_unix.cpp
-}
-
qtConfig(system-zlib) {
include($$PWD/../../3rdparty/zlib_dependency.pri)
} else {
@@ -140,54 +81,6 @@ qtConfig(system-zlib) {
include($$PWD/../../3rdparty/zlib.pri)
}
-qtConfig(icu) {
- QMAKE_USE_PRIVATE += icu
-
- SOURCES += tools/qlocale_icu.cpp \
- tools/qcollator_icu.cpp
-} else: win32 {
- SOURCES += tools/qcollator_win.cpp
-} else: macx {
- SOURCES += tools/qcollator_macx.cpp
-} else {
- SOURCES += tools/qcollator_posix.cpp
-}
-
-qtConfig(timezone) {
- HEADERS += \
- tools/qtimezone.h \
- tools/qtimezoneprivate_p.h \
- tools/qtimezoneprivate_data_p.h
- SOURCES += \
- tools/qtimezone.cpp \
- tools/qtimezoneprivate.cpp
- !nacl:darwin: {
- SOURCES += tools/qtimezoneprivate_mac.mm
- } else: android:!android-embedded: {
- SOURCES += tools/qtimezoneprivate_android.cpp
- } else: unix: {
- SOURCES += tools/qtimezoneprivate_tz.cpp
- qtConfig(icu): SOURCES += tools/qtimezoneprivate_icu.cpp
- } else: qtConfig(icu): {
- SOURCES += tools/qtimezoneprivate_icu.cpp
- } else: win32: {
- SOURCES += tools/qtimezoneprivate_win.cpp
- }
-}
-
-qtConfig(datetimeparser) {
- HEADERS += tools/qdatetimeparser_p.h
- SOURCES += tools/qdatetimeparser.cpp
-}
-
-qtConfig(regularexpression) {
- QMAKE_USE_PRIVATE += pcre2
-
- HEADERS += \
- tools/qregularexpression.h
- SOURCES += tools/qregularexpression.cpp
-}
-
qtConfig(commandlineparser) {
HEADERS += \
tools/qcommandlineoption.h \
@@ -197,19 +90,6 @@ qtConfig(commandlineparser) {
tools/qcommandlineparser.cpp
}
-INCLUDEPATH += ../3rdparty/harfbuzz/src
-HEADERS += ../3rdparty/harfbuzz/src/harfbuzz.h
-SOURCES += ../3rdparty/harfbuzz/src/harfbuzz-buffer.c \
- ../3rdparty/harfbuzz/src/harfbuzz-gdef.c \
- ../3rdparty/harfbuzz/src/harfbuzz-gsub.c \
- ../3rdparty/harfbuzz/src/harfbuzz-gpos.c \
- ../3rdparty/harfbuzz/src/harfbuzz-impl.c \
- ../3rdparty/harfbuzz/src/harfbuzz-open.c \
- ../3rdparty/harfbuzz/src/harfbuzz-stream.c \
- ../3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp \
- tools/qharfbuzz.cpp
-HEADERS += tools/qharfbuzz_p.h
-
INCLUDEPATH += ../3rdparty/md5 \
../3rdparty/md4 \
../3rdparty/sha3
@@ -220,11 +100,20 @@ qtConfig(system-doubleconversion) {
include($$PWD/../../3rdparty/double-conversion/double-conversion.pri)
}
+qtConfig(easingcurve) {
+ HEADERS += \
+ tools/qeasingcurve.h \
+ tools/qtimeline.h
+
+ SOURCES += \
+ tools/qeasingcurve.cpp \
+ tools/qtimeline.cpp
+}
+
# Note: libm should be present by default becaue this is C++
unix:!macx-icc:!vxworks:!haiku:!integrity:!wasm: LIBS_PRIVATE += -lm
TR_EXCLUDE += ../3rdparty/*
# MIPS DSP
-MIPS_DSP_ASM += tools/qstring_mips_dsp_asm.S
MIPS_DSP_HEADERS += ../gui/painting/qt_mips_asm_dsp_p.h
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
index 920a04315d..2cfd7e086c 100644
--- a/src/dbus/dbus.pro
+++ b/src/dbus/dbus.pro
@@ -9,11 +9,11 @@ qtConfig(dbus-linked) {
}
win32 {
- LIBS_PRIVATE += \
- -lws2_32 \
- -ladvapi32 \
- -lnetapi32 \
- -luser32
+ QMAKE_USE_PRIVATE += \
+ advapi32 \
+ netapi32 \
+ user32 \
+ ws2_32
}
DEFINES += QT_NO_FOREACH
diff --git a/src/dbus/doc/snippets/code/src_qdbus_qdbusargument.cpp b/src/dbus/doc/snippets/code/src_qdbus_qdbusargument.cpp
index be72220153..b64ea5cf21 100644
--- a/src/dbus/doc/snippets/code/src_qdbus_qdbusargument.cpp
+++ b/src/dbus/doc/snippets/code/src_qdbus_qdbusargument.cpp
@@ -186,7 +186,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, MyDictionary &myd
argument.beginMap();
mydict.clear();
- while ( !argMap.atEnd() ) {
+ while ( !argument.atEnd() ) {
int key;
MyValue value;
argument.beginMapEntry();
diff --git a/src/dbus/qdbus_symbols.cpp b/src/dbus/qdbus_symbols.cpp
index f22696639d..1e2cbf6da6 100644
--- a/src/dbus/qdbus_symbols.cpp
+++ b/src/dbus/qdbus_symbols.cpp
@@ -41,6 +41,7 @@
#include <QtCore/qglobal.h>
#if QT_CONFIG(library)
#include <QtCore/qlibrary.h>
+#include <QtCore/private/qlocking_p.h>
#endif
#include <QtCore/qmutex.h>
@@ -80,7 +81,7 @@ bool qdbus_loadLibDBus()
static bool triedToLoadLibrary = false;
static QBasicMutex mutex;
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QLibrary *&lib = qdbus_libdbus;
if (triedToLoadLibrary)
@@ -99,15 +100,15 @@ bool qdbus_loadLibDBus()
};
lib->unload();
- for (uint i = 0; i < sizeof(majorversions) / sizeof(majorversions[0]); ++i) {
- for (uint j = 0; j < sizeof(baseNames) / sizeof(baseNames[0]); ++j) {
+ for (const int majorversion : majorversions) {
+ for (const QString &baseName : baseNames) {
#ifdef Q_OS_WIN
QString suffix;
- if (majorversions[i] != -1)
- suffix = QString::number(- majorversions[i]); // negative so it prepends the dash
- lib->setFileName(baseNames[j] + suffix);
+ if (majorversion != -1)
+ suffix = QString::number(- majorversion); // negative so it prepends the dash
+ lib->setFileName(baseName + suffix);
#else
- lib->setFileNameAndVersion(baseNames[j], majorversions[i]);
+ lib->setFileNameAndVersion(baseName, majorversion);
#endif
if (lib->load() && lib->resolve("dbus_connection_open_private"))
return true;
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp
index 148bd54147..87de784fc0 100644
--- a/src/dbus/qdbusabstractinterface.cpp
+++ b/src/dbus/qdbusabstractinterface.cpp
@@ -66,11 +66,11 @@ namespace {
// of to QDBusAbstractInterface::customEvent.
// See solution in Patch Set 1 of this change in the Qt Gerrit servers.
// (https://codereview.qt-project.org/#/c/126384/1)
-class DisconnectRelayEvent : public QMetaCallEvent
+class DisconnectRelayEvent : public QAbstractMetaCallEvent
{
public:
DisconnectRelayEvent(QObject *sender, const QMetaMethod &m)
- : QMetaCallEvent(0, 0, nullptr, sender, m.methodIndex())
+ : QAbstractMetaCallEvent(sender, m.methodIndex())
{}
void placeMetaCall(QObject *object) override
@@ -164,7 +164,7 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu
"used to read property %s.%s",
mp.typeName(), qPrintable(interface), mp.name());
lastError = QDBusError(QDBusError::Failed,
- QString::fromLatin1("Unregistered type %1 cannot be handled")
+ QLatin1String("Unregistered type %1 cannot be handled")
.arg(QLatin1String(mp.typeName())));
return false;
}
@@ -185,7 +185,7 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu
if (reply.signature() != QLatin1String("v")) {
QString errmsg = QLatin1String("Invalid signature `%1' in return from call to "
DBUS_INTERFACE_PROPERTIES);
- lastError = QDBusError(QDBusError::InvalidSignature, qMove(errmsg).arg(reply.signature()));
+ lastError = QDBusError(QDBusError::InvalidSignature, std::move(errmsg).arg(reply.signature()));
return false;
}
@@ -220,15 +220,15 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu
}
// there was an error...
- QString errmsg = QLatin1String("Unexpected `%1' (%2) when retrieving property `%3.%4' "
- "(expected type `%5' (%6))");
+ const auto errmsg = QLatin1String("Unexpected `%1' (%2) when retrieving property `%3.%4' "
+ "(expected type `%5' (%6))");
lastError = QDBusError(QDBusError::InvalidSignature,
- errmsg.arg(QString::fromLatin1(foundType),
- QString::fromLatin1(foundSignature),
+ errmsg.arg(QLatin1String(foundType),
+ QLatin1String(foundSignature),
interface,
- QString::fromUtf8(mp.name()),
- QString::fromLatin1(mp.typeName()),
- QString::fromLatin1(expectedSignature)));
+ QLatin1String(mp.name()),
+ QLatin1String(mp.typeName()),
+ QLatin1String(expectedSignature)));
return false;
}
@@ -691,18 +691,20 @@ void QDBusAbstractInterface::internalPropSet(const char *propname, const QVarian
}
/*!
- Calls the method \a method on this interface and passes the parameters to this function to the
- method.
+ \fn QDBusAbstractInterface::call(const QString &message)
+ \internal
+*/
+
+/*!
+ \fn QDBusAbstractInterface::call(const QString &message, Args&&...args)
+
+ Calls the method \a method on this interface and passes \a args to the method.
+ All \a args must be convertible to QVariant.
The parameters to \c call are passed on to the remote function via D-Bus as input
arguments. Output arguments are returned in the QDBusMessage reply. If the reply is an error
reply, lastError() will also be set to the contents of the error message.
- This function can be used with up to 8 parameters, passed in arguments \a arg1, \a arg2,
- \a arg3, \a arg4, \a arg5, \a arg6, \a arg7 and \a arg8. If you need more than 8
- parameters or if you have a variable number of parameters to be passed, use
- callWithArgumentList().
-
It can be used the following way:
\snippet code/src_qdbus_qdbusabstractinterface.cpp 0
@@ -710,6 +712,19 @@ void QDBusAbstractInterface::internalPropSet(const char *propname, const QVarian
This example illustrates function calling with 0, 1 and 2 parameters and illustrates different
parameter types passed in each (the first call to \c "ProcessWorkUnicode" will contain one
Unicode string, the second call to \c "ProcessWork" will contain one string and one byte array).
+
+ \note Before Qt 5.14, this function accepted a maximum of just eight (8) arguments.
+
+ \sa callWithArgumentList()
+*/
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/*!
+ \internal
+
+ This function exists for binary compatibility with Qt versions < 5.14.
+ Programs recompiled against Qt 5.14 will use the variadic template function
+ instead.
*/
QDBusMessage QDBusAbstractInterface::call(const QString &method, const QVariant &arg1,
const QVariant &arg2,
@@ -722,27 +737,44 @@ QDBusMessage QDBusAbstractInterface::call(const QString &method, const QVariant
{
return call(QDBus::AutoDetect, method, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
}
+#endif
+
+/*!
+ \fn QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &message)
+ \internal
+*/
/*!
+ \fn QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &message, Args&&...args)
+
\overload
- Calls the method \a method on this interface and passes the
- parameters to this function to the method. If \a mode is \c
- NoWaitForReply, then this function will return immediately after
+ Calls the method \a method on this interface and passes \a args to the method.
+ All \a args must be convertible to QVariant.
+
+ If \a mode is \c NoWaitForReply, then this function will return immediately after
placing the call, without waiting for a reply from the remote
method. Otherwise, \a mode indicates whether this function should
activate the Qt Event Loop while waiting for the reply to arrive.
- This function can be used with up to 8 parameters, passed in arguments \a arg1, \a arg2,
- \a arg3, \a arg4, \a arg5, \a arg6, \a arg7 and \a arg8. If you need more than 8
- parameters or if you have a variable number of parameters to be passed, use
- callWithArgumentList().
-
If this function reenters the Qt event loop in order to wait for the
reply, it will exclude user input. During the wait, it may deliver
signals and other method calls to your application. Therefore, it
must be prepared to handle a reentrancy whenever a call is placed
with call().
+
+ \note Before Qt 5.14, this function accepted a maximum of just eight (8) arguments.
+
+ \sa callWithArgumentList()
+*/
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/*!
+ \internal
+
+ This function exists for binary compatibility with Qt versions < 5.14.
+ Programs recompiled against Qt 5.14 will use the variadic template function
+ instead.
*/
QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &method,
const QVariant &arg1,
@@ -787,22 +819,23 @@ QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &m
return callWithArgumentList(mode, method, argList);
}
+#endif // Qt 5
+/*!
+ \fn QDBusAbstractInterface::asyncCall(const QString &message)
+ \internal
+*/
/*!
- \since 4.5
- Calls the method \a method on this interface and passes the parameters to this function to the
- method.
+ \fn QDBusAbstractInterface::asyncCall(const QString &message, Args&&...args)
+
+ Calls the method \a method on this interface and passes \a args to the method.
+ All \a args must be convertible to QVariant.
The parameters to \c call are passed on to the remote function via D-Bus as input
arguments. The returned QDBusPendingCall object can be used to find out information about
the reply.
- This function can be used with up to 8 parameters, passed in arguments \a arg1, \a arg2,
- \a arg3, \a arg4, \a arg5, \a arg6, \a arg7 and \a arg8. If you need more than 8
- parameters or if you have a variable number of parameters to be passed, use
- asyncCallWithArgumentList().
-
It can be used the following way:
\snippet code/src_qdbus_qdbusabstractinterface.cpp 1
@@ -810,6 +843,19 @@ QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &m
This example illustrates function calling with 0, 1 and 2 parameters and illustrates different
parameter types passed in each (the first call to \c "ProcessWorkUnicode" will contain one
Unicode string, the second call to \c "ProcessWork" will contain one string and one byte array).
+
+ \note Before Qt 5.14, this function accepted a maximum of just eight (8) arguments.
+
+ \sa asyncCallWithArgumentList()
+*/
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+/*!
+ \internal
+
+ This function exists for binary compatibility with Qt versions < 5.14.
+ Programs recompiled against Qt 5.14 will use the variadic template function
+ instead.
*/
QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, const QVariant &arg1,
const QVariant &arg2,
@@ -853,6 +899,7 @@ QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, const
return asyncCallWithArgumentList(method, argList);
}
+#endif // Qt 5
/*!
\internal
@@ -865,6 +912,24 @@ QDBusMessage QDBusAbstractInterface::internalConstCall(QDBus::CallMode mode,
return const_cast<QDBusAbstractInterface*>(this)->callWithArgumentList(mode, method, args);
}
+QDBusMessage QDBusAbstractInterface::doCall(QDBus::CallMode mode, const QString &method, const QVariant *args, size_t numArgs)
+{
+ QList<QVariant> list;
+ list.reserve(int(numArgs));
+ for (size_t i = 0; i < numArgs; ++i)
+ list.append(args[i]);
+ return callWithArgumentList(mode, method, list);
+}
+
+QDBusPendingCall QDBusAbstractInterface::doAsyncCall(const QString &method, const QVariant *args, size_t numArgs)
+{
+ QList<QVariant> list;
+ list.reserve(int(numArgs));
+ for (size_t i = 0; i < numArgs; ++i)
+ list.append(args[i]);
+ return asyncCallWithArgumentList(method, list);
+}
+
QT_END_NAMESPACE
#endif // QT_NO_DBUS
diff --git a/src/dbus/qdbusabstractinterface.h b/src/dbus/qdbusabstractinterface.h
index d6b0870787..4f4c7430a5 100644
--- a/src/dbus/qdbusabstractinterface.h
+++ b/src/dbus/qdbusabstractinterface.h
@@ -49,6 +49,7 @@
#include <QtDBus/qdbusmessage.h>
#include <QtDBus/qdbusextratypes.h>
#include <QtDBus/qdbusconnection.h>
+#include <QtDBus/qdbuspendingcall.h>
#ifdef interface
#undef interface
@@ -98,26 +99,52 @@ public:
void setTimeout(int timeout);
int timeout() const;
+ QDBusMessage call(const QString &method)
+ {
+ return doCall(QDBus::AutoDetect, method, nullptr, 0);
+ }
+
+ template <typename...Args>
+ QDBusMessage call(const QString &method, Args &&...args)
+ {
+ const QVariant variants[] = { QVariant(std::forward<Args>(args))... };
+ return doCall(QDBus::AutoDetect, method, variants, sizeof...(args));
+ }
+
+ QDBusMessage call(QDBus::CallMode mode, const QString &method)
+ {
+ return doCall(mode, method, nullptr, 0);
+ }
+
+ template <typename...Args>
+ QDBusMessage call(QDBus::CallMode mode, const QString &method, Args &&...args)
+ {
+ const QVariant variants[] = { QVariant(std::forward<Args>(args))... };
+ return doCall(mode, method, variants, sizeof...(args));
+ }
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QDBusMessage call(const QString &method,
- const QVariant &arg1 = QVariant(),
- const QVariant &arg2 = QVariant(),
- const QVariant &arg3 = QVariant(),
- const QVariant &arg4 = QVariant(),
- const QVariant &arg5 = QVariant(),
- const QVariant &arg6 = QVariant(),
- const QVariant &arg7 = QVariant(),
- const QVariant &arg8 = QVariant());
+ const QVariant &arg1,
+ const QVariant &arg2,
+ const QVariant &arg3,
+ const QVariant &arg4,
+ const QVariant &arg5,
+ const QVariant &arg6,
+ const QVariant &arg7,
+ const QVariant &arg8);
QDBusMessage call(QDBus::CallMode mode,
const QString &method,
- const QVariant &arg1 = QVariant(),
- const QVariant &arg2 = QVariant(),
- const QVariant &arg3 = QVariant(),
- const QVariant &arg4 = QVariant(),
- const QVariant &arg5 = QVariant(),
- const QVariant &arg6 = QVariant(),
- const QVariant &arg7 = QVariant(),
- const QVariant &arg8 = QVariant());
+ const QVariant &arg1,
+ const QVariant &arg2,
+ const QVariant &arg3,
+ const QVariant &arg4,
+ const QVariant &arg5,
+ const QVariant &arg6,
+ const QVariant &arg7,
+ const QVariant &arg8);
+#endif // Qt 5
QDBusMessage callWithArgumentList(QDBus::CallMode mode,
const QString &method,
@@ -130,15 +157,30 @@ public:
const QList<QVariant> &args,
QObject *receiver, const char *member);
+ QDBusPendingCall asyncCall(const QString &method)
+ {
+ return doAsyncCall(method, nullptr, 0);
+ }
+
+ template <typename...Args>
+ QDBusPendingCall asyncCall(const QString &method, Args&&...args)
+ {
+ const QVariant variants[] = { QVariant(std::forward<Args>(args))... };
+ return doAsyncCall(method, variants, sizeof...(args));
+ }
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QDBusPendingCall asyncCall(const QString &method,
- const QVariant &arg1 = QVariant(),
- const QVariant &arg2 = QVariant(),
- const QVariant &arg3 = QVariant(),
- const QVariant &arg4 = QVariant(),
- const QVariant &arg5 = QVariant(),
- const QVariant &arg6 = QVariant(),
- const QVariant &arg7 = QVariant(),
- const QVariant &arg8 = QVariant());
+ const QVariant &arg1,
+ const QVariant &arg2,
+ const QVariant &arg3,
+ const QVariant &arg4,
+ const QVariant &arg5,
+ const QVariant &arg6,
+ const QVariant &arg7,
+ const QVariant &arg8);
+#endif // Qt 5
+
QDBusPendingCall asyncCallWithArgumentList(const QString &method,
const QList<QVariant> &args);
@@ -156,6 +198,10 @@ protected:
const QList<QVariant> &args = QList<QVariant>()) const;
private:
+ QDBusMessage doCall(QDBus::CallMode mode, const QString &method, const QVariant *args, size_t numArgs);
+ QDBusPendingCall doAsyncCall(const QString &method, const QVariant *args, size_t numArgs);
+
+private:
Q_DECLARE_PRIVATE(QDBusAbstractInterface)
Q_PRIVATE_SLOT(d_func(), void _q_serviceOwnerChanged(QString,QString,QString))
};
diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp
index 2d1373006d..764bc24165 100644
--- a/src/dbus/qdbusargument.cpp
+++ b/src/dbus/qdbusargument.cpp
@@ -111,7 +111,7 @@ bool QDBusArgumentPrivate::checkWrite(QDBusArgumentPrivate *&d)
if (!d->marshaller()->ok)
return false;
- if (d->message && d->ref.load() != 1) {
+ if (d->message && d->ref.loadRelaxed() != 1) {
QDBusMarshaller *dd = new QDBusMarshaller(d->capabilities);
dd->message = q_dbus_message_copy(d->message);
q_dbus_message_iter_init_append(dd->message, &dd->iterator);
@@ -152,7 +152,7 @@ bool QDBusArgumentPrivate::checkReadAndDetach(QDBusArgumentPrivate *&d)
if (!checkRead(d))
return false; // don't bother
- if (d->ref.load() == 1)
+ if (d->ref.loadRelaxed() == 1)
return true; // no need to detach
QDBusDemarshaller *dd = new QDBusDemarshaller(d->capabilities);
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 94a89a4e08..b7cd4c8989 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -76,14 +76,12 @@ public:
QDBusArgument();
QDBusArgument(const QDBusArgument &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDBusArgument(QDBusArgument &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
- QDBusArgument &operator=(QDBusArgument &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDBusArgument(QDBusArgument &&other) noexcept : d(other.d) { other.d = nullptr; }
+ QDBusArgument &operator=(QDBusArgument &&other) noexcept { swap(other); return *this; }
QDBusArgument &operator=(const QDBusArgument &other);
~QDBusArgument();
- void swap(QDBusArgument &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDBusArgument &other) noexcept { qSwap(d, other.d); }
// used for marshalling (Qt -> D-BUS)
QDBusArgument &operator<<(uchar arg);
diff --git a/src/dbus/qdbusargument_p.h b/src/dbus/qdbusargument_p.h
index b678b9606f..3553d3d151 100644
--- a/src/dbus/qdbusargument_p.h
+++ b/src/dbus/qdbusargument_p.h
@@ -71,7 +71,7 @@ class QDBusArgumentPrivate
{
public:
inline QDBusArgumentPrivate(int flags = 0)
- : message(0), ref(1), capabilities(flags)
+ : message(nullptr), ref(1), capabilities(flags)
{ }
virtual ~QDBusArgumentPrivate();
@@ -104,7 +104,7 @@ public:
class QDBusMarshaller: public QDBusArgumentPrivate
{
public:
- QDBusMarshaller(int flags) : QDBusArgumentPrivate(flags), parent(0), ba(0), closeCode(0), ok(true), skipSignature(false)
+ QDBusMarshaller(int flags) : QDBusArgumentPrivate(flags), parent(nullptr), ba(nullptr), closeCode(0), ok(true), skipSignature(false)
{ direction = Marshalling; }
~QDBusMarshaller();
@@ -161,7 +161,7 @@ private:
class QDBusDemarshaller: public QDBusArgumentPrivate
{
public:
- inline QDBusDemarshaller(int flags) : QDBusArgumentPrivate(flags), parent(0)
+ inline QDBusDemarshaller(int flags) : QDBusArgumentPrivate(flags), parent(nullptr)
{ direction = Demarshalling; }
~QDBusDemarshaller();
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 296d5b369f..d6f3230fd2 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -47,6 +47,7 @@
#include <qvector.h>
#include <qtimer.h>
#include <qthread.h>
+#include <QtCore/private/qlocking_p.h>
#include "qdbusconnectioninterface.h"
#include "qdbuserror.h"
@@ -106,7 +107,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::busConnection(QDBusConnection::B
// (the event loop will resume delivery)
bool suspendedDelivery = qApp && qApp->thread() == QThread::currentThread();
- QMutexLocker lock(&defaultBusMutex);
+ const auto locker = qt_scoped_lock(defaultBusMutex);
if (defaultBuses[type])
return defaultBuses[type];
@@ -178,7 +179,7 @@ void QDBusConnectionManager::run()
exec();
// cleanup:
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
for (QHash<QString, QDBusConnectionPrivate *>::const_iterator it = connectionHash.constBegin();
it != connectionHash.constEnd(); ++it) {
QDBusConnectionPrivate *d = it.value();
@@ -240,7 +241,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::connectToPeer(const QString &add
void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::ConnectionRequestData *data)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
const QString &name = *data->name;
QDBusConnectionPrivate *&d = data->result;
@@ -428,7 +429,7 @@ QDBusConnection::QDBusConnection(const QString &name)
if (name.isEmpty() || _q_manager.isDestroyed()) {
d = 0;
} else {
- QMutexLocker locker(&_q_manager()->mutex);
+ const auto locker = qt_scoped_lock(_q_manager()->mutex);
d = _q_manager()->connection(name);
if (d)
d->ref.ref();
@@ -537,7 +538,7 @@ QDBusConnection QDBusConnection::connectToPeer(const QString &address,
void QDBusConnection::disconnectFromBus(const QString &name)
{
if (_q_manager()) {
- QMutexLocker locker(&_q_manager()->mutex);
+ const auto locker = qt_scoped_lock(_q_manager()->mutex);
QDBusConnectionPrivate *d = _q_manager()->connection(name);
if (d && d->mode != QDBusConnectionPrivate::ClientMode)
return;
@@ -558,7 +559,7 @@ void QDBusConnection::disconnectFromBus(const QString &name)
void QDBusConnection::disconnectFromPeer(const QString &name)
{
if (_q_manager()) {
- QMutexLocker locker(&_q_manager()->mutex);
+ const auto locker = qt_scoped_lock(_q_manager()->mutex);
QDBusConnectionPrivate *d = _q_manager()->connection(name);
if (d && d->mode != QDBusConnectionPrivate::PeerMode)
return;
diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h
index 3711981f78..368f811602 100644
--- a/src/dbus/qdbusconnection.h
+++ b/src/dbus/qdbusconnection.h
@@ -131,14 +131,12 @@ public:
explicit QDBusConnection(const QString &name);
QDBusConnection(const QDBusConnection &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDBusConnection(QDBusConnection &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
- QDBusConnection &operator=(QDBusConnection &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDBusConnection(QDBusConnection &&other) noexcept : d(other.d) { other.d = nullptr; }
+ QDBusConnection &operator=(QDBusConnection &&other) noexcept { swap(other); return *this; }
QDBusConnection &operator=(const QDBusConnection &other);
~QDBusConnection();
- void swap(QDBusConnection &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDBusConnection &other) noexcept { qSwap(d, other.d); }
bool isConnected() const;
QString baseService() const;
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index 7769b9ea71..da67a6c5d4 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -115,7 +115,7 @@ public:
struct Watcher
{
- Watcher(): watch(0), read(0), write(0) {}
+ Watcher(): watch(nullptr), read(nullptr), write(nullptr) {}
DBusWatch *watch;
QSocketNotifier *read;
QSocketNotifier *write;
@@ -132,7 +132,7 @@ public:
struct SignalHook
{
- inline SignalHook() : obj(0), midx(-1) { }
+ inline SignalHook() : obj(nullptr), midx(-1) { }
QString service, path, signature;
QObject* obj;
int midx;
@@ -150,9 +150,9 @@ public:
{
typedef QVector<ObjectTreeNode> DataList;
- inline ObjectTreeNode() : obj(0), flags(0) { }
+ inline ObjectTreeNode() : obj(nullptr), flags(0) { }
inline ObjectTreeNode(const QString &n) // intentionally implicit
- : name(n), obj(0), flags(0) { }
+ : name(n), obj(nullptr), flags(0) { }
inline bool operator<(const QString &other) const
{ return name < other; }
inline bool operator<(const QStringRef &other) const
@@ -194,7 +194,7 @@ public:
public:
// public methods are entry points from other objects
- explicit QDBusConnectionPrivate(QObject *parent = 0);
+ explicit QDBusConnectionPrivate(QObject *parent = nullptr);
~QDBusConnectionPrivate();
void createBusService();
diff --git a/src/dbus/qdbusconnectioninterface.cpp b/src/dbus/qdbusconnectioninterface.cpp
index ebb3803489..a2335a1795 100644
--- a/src/dbus/qdbusconnectioninterface.cpp
+++ b/src/dbus/qdbusconnectioninterface.cpp
@@ -199,6 +199,18 @@ QDBusReply<QStringList> QDBusConnectionInterface::registeredServiceNames() const
}
/*!
+ \property QDBusConnectionInterface::activatableServiceNames
+ \brief holds the activatable service names
+ \since 5.14
+
+ Lists all names that can be activated on the bus.
+*/
+QDBusReply<QStringList> QDBusConnectionInterface::activatableServiceNames() const
+{
+ return internalConstCall(QDBus::AutoDetect, QLatin1String("ListActivatableNames"));
+}
+
+/*!
Returns \c true if the service name \a serviceName has is currently
registered.
*/
diff --git a/src/dbus/qdbusconnectioninterface.h b/src/dbus/qdbusconnectioninterface.h
index c7b1573722..d19e116c53 100644
--- a/src/dbus/qdbusconnectioninterface.h
+++ b/src/dbus/qdbusconnectioninterface.h
@@ -68,6 +68,7 @@ class Q_DBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface
~QDBusConnectionInterface();
Q_PROPERTY(QDBusReply<QStringList> registeredServiceNames READ registeredServiceNames)
+ Q_PROPERTY(QDBusReply<QStringList> activatableServiceNames READ activatableServiceNames)
public:
enum ServiceQueueOptions {
@@ -90,6 +91,7 @@ public:
public Q_SLOTS:
QDBusReply<QStringList> registeredServiceNames() const;
+ QDBusReply<QStringList> activatableServiceNames() const;
QDBusReply<bool> isServiceRegistered(const QString &serviceName) const;
QDBusReply<QString> serviceOwner(const QString &name) const;
QDBusReply<bool> unregisterService(const QString &serviceName);
diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h
index c264f62b7d..312bac71de 100644
--- a/src/dbus/qdbuserror.h
+++ b/src/dbus/qdbuserror.h
@@ -41,6 +41,7 @@
#define QDBUSERROR_H
#include <QtDBus/qtdbusglobal.h>
+#include <QtCore/qobjectdefs.h>
#include <QtCore/qstring.h>
#ifndef QT_NO_DBUS
@@ -54,6 +55,7 @@ class QDBusMessage;
class Q_DBUS_EXPORT QDBusError
{
+ Q_GADGET
public:
enum ErrorType {
NoError = 0,
@@ -90,6 +92,7 @@ public:
LastErrorType = InvalidMember
#endif
};
+ Q_ENUM(ErrorType)
QDBusError();
#ifndef QT_BOOTSTRAPPED
@@ -98,18 +101,16 @@ public:
#endif
QDBusError(ErrorType error, const QString &message);
QDBusError(const QDBusError &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDBusError(QDBusError &&other) Q_DECL_NOTHROW
+ QDBusError(QDBusError &&other) noexcept
: code(other.code), msg(std::move(other.msg)), nm(std::move(other.nm))
{}
- QDBusError &operator=(QDBusError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDBusError &operator=(QDBusError &&other) noexcept { swap(other); return *this; }
QDBusError &operator=(const QDBusError &other);
#ifndef QT_BOOTSTRAPPED
QDBusError &operator=(const QDBusMessage &msg);
#endif
- void swap(QDBusError &other) Q_DECL_NOTHROW
+ void swap(QDBusError &other) noexcept
{
qSwap(code, other.code);
qSwap(msg, other.msg);
diff --git a/src/dbus/qdbusextratypes.cpp b/src/dbus/qdbusextratypes.cpp
index a0b121a1a3..06fbd6062e 100644
--- a/src/dbus/qdbusextratypes.cpp
+++ b/src/dbus/qdbusextratypes.cpp
@@ -167,6 +167,14 @@ void QDBusSignature::doCheck()
*/
/*!
+ \since 5.14
+
+ Implicit cast to QVariant. Equivalent to calling
+ QVariant::fromValue() with this object as argument.
+*/
+QDBusObjectPath::operator QVariant() const { return QVariant::fromValue(*this); }
+
+/*!
\class QDBusSignature
\inmodule QtDBus
\since 4.2
diff --git a/src/dbus/qdbusextratypes.h b/src/dbus/qdbusextratypes.h
index 12961e2702..6bb12ffe49 100644
--- a/src/dbus/qdbusextratypes.h
+++ b/src/dbus/qdbusextratypes.h
@@ -54,29 +54,28 @@
QT_BEGIN_NAMESPACE
-
class Q_DBUS_EXPORT QDBusObjectPath
{
QString m_path;
public:
- QDBusObjectPath() Q_DECL_NOTHROW : m_path() {}
+ QDBusObjectPath() noexcept : m_path() {}
// compiler-generated copy/move constructor/assignment operators are ok!
// compiler-generated destructor is ok!
inline explicit QDBusObjectPath(const char *path);
inline explicit QDBusObjectPath(QLatin1String path);
inline explicit QDBusObjectPath(const QString &path);
-#ifdef Q_COMPILER_RVALUE_REFS
explicit QDBusObjectPath(QString &&p) : m_path(std::move(p)) { doCheck(); }
-#endif
- void swap(QDBusObjectPath &other) Q_DECL_NOTHROW { qSwap(m_path, other.m_path); }
+ void swap(QDBusObjectPath &other) noexcept { qSwap(m_path, other.m_path); }
inline void setPath(const QString &path);
inline QString path() const
{ return m_path; }
+ operator QVariant() const;
+
private:
void doCheck();
};
@@ -114,18 +113,16 @@ class Q_DBUS_EXPORT QDBusSignature
{
QString m_signature;
public:
- QDBusSignature() Q_DECL_NOTHROW : m_signature() {}
+ QDBusSignature() noexcept : m_signature() {}
// compiler-generated copy/move constructor/assignment operators are ok!
// compiler-generated destructor is ok!
inline explicit QDBusSignature(const char *signature);
inline explicit QDBusSignature(QLatin1String signature);
inline explicit QDBusSignature(const QString &signature);
-#ifdef Q_COMPILER_RVALUE_REFS
explicit QDBusSignature(QString &&sig) : m_signature(std::move(sig)) { doCheck(); }
-#endif
- void swap(QDBusSignature &other) Q_DECL_NOTHROW { qSwap(m_signature, other.m_signature); }
+ void swap(QDBusSignature &other) noexcept { qSwap(m_signature, other.m_signature); }
inline void setSignature(const QString &signature);
@@ -168,16 +165,14 @@ class QDBusVariant
{
QVariant m_variant;
public:
- QDBusVariant() Q_DECL_NOTHROW : m_variant() {}
+ QDBusVariant() noexcept : m_variant() {}
// compiler-generated copy/move constructor/assignment operators are ok!
// compiler-generated destructor is ok!
inline explicit QDBusVariant(const QVariant &variant);
-#ifdef Q_COMPILER_RVALUE_REFS
- explicit QDBusVariant(QVariant &&v) Q_DECL_NOTHROW : m_variant(std::move(v)) {}
-#endif
+ explicit QDBusVariant(QVariant &&v) noexcept : m_variant(std::move(v)) {}
- void swap(QDBusVariant &other) Q_DECL_NOTHROW { qSwap(m_variant, other.m_variant); }
+ void swap(QDBusVariant &other) noexcept { qSwap(m_variant, other.m_variant); }
inline void setVariant(const QVariant &variant);
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 1125480447..4c27a93382 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -49,6 +49,7 @@
#include <qstringlist.h>
#include <qtimer.h>
#include <qthread.h>
+#include <private/qlocking_p.h>
#include "qdbusargument.h"
#include "qdbusconnection_p.h"
@@ -304,7 +305,7 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v
q_dbus_connection_set_allow_anonymous(connection, true);
QDBusConnectionPrivate *newConnection = new QDBusConnectionPrivate(serverConnection->parent());
- QMutexLocker locker(&QDBusConnectionManager::instance()->mutex);
+ const auto locker = qt_scoped_lock(QDBusConnectionManager::instance()->mutex);
QDBusConnectionManager::instance()->setConnection(QLatin1String("QDBusServer-") + QString::number(reinterpret_cast<qulonglong>(newConnection), 16), newConnection);
serverConnection->serverConnectionNames << newConnection->name;
@@ -340,8 +341,9 @@ static QByteArray buildMatchRule(const QString &service,
const QString &objectPath, const QString &interface,
const QString &member, const QDBusConnectionPrivate::ArgMatchRules &argMatch, const QString & /*signature*/)
{
- QString result = QLatin1String("type='signal',");
- QString keyValue = QLatin1String("%1='%2',");
+ QString result;
+ result += QLatin1String("type='signal',");
+ const auto keyValue = QLatin1String("%1='%2',");
if (!service.isEmpty())
result += keyValue.arg(QLatin1String("sender"), service);
@@ -354,13 +356,13 @@ static QByteArray buildMatchRule(const QString &service,
// add the argument string-matching now
if (!argMatch.args.isEmpty()) {
- keyValue = QLatin1String("arg%1='%2',");
+ const QString keyValue = QLatin1String("arg%1='%2',");
for (int i = 0; i < argMatch.args.count(); ++i)
if (!argMatch.args.at(i).isNull())
result += keyValue.arg(i).arg(argMatch.args.at(i));
}
if (!argMatch.arg0namespace.isEmpty()) {
- result += QStringLiteral("arg0namespace='%1',").arg(argMatch.arg0namespace);
+ result += QLatin1String("arg0namespace='%1',").arg(argMatch.arg0namespace);
}
result.chop(1); // remove ending comma
@@ -534,7 +536,7 @@ qDBusSignalFilter(DBusConnection *connection, DBusMessage *message, void *data)
bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
{
- if (!ref.load())
+ if (!ref.loadRelaxed())
return false;
// local message are always delivered, regardless of filtering
@@ -1077,7 +1079,7 @@ QDBusConnectionPrivate::~QDBusConnectionPrivate()
if (lastMode == ClientMode || lastMode == PeerMode) {
// the bus service object holds a reference back to us;
// we need to destroy it before we finish destroying ourselves
- Q_ASSERT(ref.load() == 0);
+ Q_ASSERT(ref.loadRelaxed() == 0);
QObject *obj = (QObject *)busService;
if (obj) {
disconnect(obj, nullptr, this, nullptr);
@@ -1196,7 +1198,7 @@ void QDBusConnectionPrivate::doDispatch()
PendingMessageList::Iterator end = pendingMessages.end();
for ( ; it != end; ++it) {
qDBusDebug() << this << "dequeueing message" << *it;
- handleMessage(qMove(*it));
+ handleMessage(std::move(*it));
}
pendingMessages.clear();
}
@@ -1330,8 +1332,6 @@ bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hoo
hook.midx = findSlot(receiver, normalizedName, hook.params);
}
if (hook.midx < minMIdx) {
- if (hook.midx == -1)
- {}
return false;
}
@@ -1371,19 +1371,19 @@ void QDBusConnectionPrivate::sendError(const QDBusMessage &msg, QDBusError::Erro
if (msg.interface().isEmpty())
interfaceMsg = QLatin1String("any interface");
else
- interfaceMsg = QString::fromLatin1("interface '%1'").arg(msg.interface());
+ interfaceMsg = QLatin1String("interface '%1'").arg(msg.interface());
send(msg.createErrorReply(code,
- QString::fromLatin1("No such method '%1' in %2 at object path '%3' "
- "(signature '%4')")
+ QLatin1String("No such method '%1' in %2 at object path '%3' "
+ "(signature '%4')")
.arg(msg.member(), interfaceMsg, msg.path(), msg.signature())));
} else if (code == QDBusError::UnknownInterface) {
send(msg.createErrorReply(QDBusError::UnknownInterface,
- QString::fromLatin1("No such interface '%1' at object path '%2'")
+ QLatin1String("No such interface '%1' at object path '%2'")
.arg(msg.interface(), msg.path())));
} else if (code == QDBusError::UnknownObject) {
send(msg.createErrorReply(QDBusError::UnknownObject,
- QString::fromLatin1("No such object path '%1'").arg(msg.path())));
+ QLatin1String("No such object path '%1'").arg(msg.path())));
}
}
@@ -1553,8 +1553,8 @@ void QDBusConnectionPrivate::handleObjectCall(const QDBusMessage &msg)
objThread = result.obj->thread();
if (!objThread) {
send(msg.createErrorReply(QDBusError::InternalError,
- QString::fromLatin1("Object '%1' (at path '%2')"
- " has no thread. Cannot deliver message.")
+ QLatin1String("Object '%1' (at path '%2')"
+ " has no thread. Cannot deliver message.")
.arg(result.obj->objectName(), msg.path())));
return;
}
@@ -1863,7 +1863,7 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
{
QDBusConnectionPrivate *connection = const_cast<QDBusConnectionPrivate *>(call->connection);
- QMutexLocker locker(&call->mutex);
+ auto locker = qt_unique_lock(call->mutex);
connection->pendingCalls.removeOne(call);
@@ -1980,7 +1980,7 @@ public:
#endif
static bool initializedAmounts = false;
static QBasicMutex initializeMutex;
- QMutexLocker locker(&initializeMutex);
+ auto locker = qt_unique_lock(initializeMutex);
if (!initializedAmounts) {
int tmp = 0;
@@ -2084,7 +2084,7 @@ QDBusMessage QDBusConnectionPrivate::sendWithReplyLocal(const QDBusMessage &mess
if (interface.isEmpty())
interface = QLatin1String("<no-interface>");
return QDBusMessage::createError(QDBusError::InternalError,
- QString::fromLatin1("Internal error trying to call %1.%2 at %3 (signature '%4'")
+ QLatin1String("Internal error trying to call %1.%2 at %3 (signature '%4'")
.arg(interface, message.member(),
message.path(), message.signature()));
}
@@ -2128,11 +2128,11 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
if ((receiver && returnMethod) || errorMethod) {
// no one waiting, will delete pcall in processFinishedCall()
- pcall->ref.store(1);
+ pcall->ref.storeRelaxed(1);
} else {
// set double ref to prevent race between processFinishedCall() and ref counting
// by QDBusPendingCall::QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
- pcall->ref.store(2);
+ pcall->ref.storeRelaxed(2);
}
if (isLoopback) {
diff --git a/src/dbus/qdbusintegrator_p.h b/src/dbus/qdbusintegrator_p.h
index 3cd029a933..87db910d25 100644
--- a/src/dbus/qdbusintegrator_p.h
+++ b/src/dbus/qdbusintegrator_p.h
@@ -86,7 +86,7 @@ struct QDBusSlotCache
int slotIdx;
QVector<int> metaTypes;
- void swap(Data &other) Q_DECL_NOTHROW
+ void swap(Data &other) noexcept
{
qSwap(flags, other.flags);
qSwap(slotIdx, other.slotIdx);
@@ -96,41 +96,42 @@ struct QDBusSlotCache
typedef QMultiHash<QString, Data> Hash;
Hash hash;
- void swap(QDBusSlotCache &other) Q_DECL_NOTHROW { qSwap(hash, other.hash); }
+ void swap(QDBusSlotCache &other) noexcept { qSwap(hash, other.hash); }
};
Q_DECLARE_SHARED(QDBusSlotCache::Data)
Q_DECLARE_SHARED(QDBusSlotCache)
-class QDBusCallDeliveryEvent: public QMetaCallEvent
+class QDBusCallDeliveryEvent: public QAbstractMetaCallEvent
{
public:
QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender,
const QDBusMessage &msg, const QVector<int> &types, int f = 0)
- : QMetaCallEvent(0, id, 0, sender, -1), connection(c), message(msg), metaTypes(types), flags(f)
+ : QAbstractMetaCallEvent(sender, -1), connection(c), message(msg), metaTypes(types), id(id), flags(f)
{ }
void placeMetaCall(QObject *object) override
{
- QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id());
+ QDBusConnectionPrivate::d(connection)->deliverCall(object, flags, message, metaTypes, id);
}
private:
QDBusConnection connection; // just for refcounting
QDBusMessage message;
QVector<int> metaTypes;
+ int id;
int flags;
};
-class QDBusActivateObjectEvent: public QMetaCallEvent
+class QDBusActivateObjectEvent: public QAbstractMetaCallEvent
{
public:
QDBusActivateObjectEvent(const QDBusConnection &c, QObject *sender,
const QDBusConnectionPrivate::ObjectTreeNode &n,
- int p, const QDBusMessage &m, QSemaphore *s = 0)
- : QMetaCallEvent(0, ushort(-1), 0, sender, -1, 0, 0, 0, s), connection(c), node(n),
+ int p, const QDBusMessage &m, QSemaphore *s = nullptr)
+ : QAbstractMetaCallEvent(sender, -1, s), connection(c), node(n),
pathStartPos(p), message(m), handled(false)
{ }
- ~QDBusActivateObjectEvent();
+ ~QDBusActivateObjectEvent() override;
void placeMetaCall(QObject *) override;
@@ -142,15 +143,15 @@ private:
bool handled;
};
-class QDBusSpyCallEvent : public QMetaCallEvent
+class QDBusSpyCallEvent : public QAbstractMetaCallEvent
{
public:
typedef void (*Hook)(const QDBusMessage&);
QDBusSpyCallEvent(QDBusConnectionPrivate *cp, const QDBusConnection &c, const QDBusMessage &msg,
const Hook *hooks, int count)
- : QMetaCallEvent(0, 0, nullptr, cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count)
+ : QAbstractMetaCallEvent(cp, 0), conn(c), msg(msg), hooks(hooks), hookCount(count)
{}
- ~QDBusSpyCallEvent();
+ ~QDBusSpyCallEvent() override;
void placeMetaCall(QObject *) override;
static inline void invokeSpyHooks(const QDBusMessage &msg, const Hook *hooks, int hookCount);
diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp
index 0ef5061b5f..edee4fc1e5 100644
--- a/src/dbus/qdbusinternalfilters.cpp
+++ b/src/dbus/qdbusinternalfilters.cpp
@@ -203,7 +203,7 @@ QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node
static inline QDBusMessage interfaceNotFoundError(const QDBusMessage &msg, const QString &interface_name)
{
return msg.createErrorReply(QDBusError::UnknownInterface,
- QString::fromLatin1("Interface %1 was not found in object %2")
+ QLatin1String("Interface %1 was not found in object %2")
.arg(interface_name, msg.path()));
}
@@ -211,10 +211,10 @@ static inline QDBusMessage
propertyNotFoundError(const QDBusMessage &msg, const QString &interface_name, const QByteArray &property_name)
{
return msg.createErrorReply(QDBusError::UnknownProperty,
- QString::fromLatin1("Property %1%2%3 was not found in object %4")
+ QLatin1String("Property %1%2%3 was not found in object %4")
.arg(interface_name,
- QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
- QString::fromLatin1(property_name),
+ QLatin1String(interface_name.isEmpty() ? "" : "."),
+ QLatin1String(property_name),
msg.path()));
}
@@ -302,16 +302,16 @@ static QDBusMessage propertyWriteReply(const QDBusMessage &msg, const QString &i
return propertyNotFoundError(msg, interface_name, property_name);
case PropertyTypeMismatch:
return msg.createErrorReply(QDBusError::InvalidArgs,
- QString::fromLatin1("Invalid arguments for writing to property %1%2%3")
+ QLatin1String("Invalid arguments for writing to property %1%2%3")
.arg(interface_name,
- QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
- QString::fromLatin1(property_name)));
+ QLatin1String(interface_name.isEmpty() ? "" : "."),
+ QLatin1String(property_name)));
case PropertyReadOnly:
return msg.createErrorReply(QDBusError::PropertyReadOnly,
- QString::fromLatin1("Property %1%2%3 is read-only")
+ QLatin1String("Property %1%2%3 is read-only")
.arg(interface_name,
- QString::fromLatin1(interface_name.isEmpty() ? "" : "."),
- QString::fromLatin1(property_name)));
+ QLatin1String(interface_name.isEmpty() ? "" : "."),
+ QLatin1String(property_name)));
case PropertyWriteFailed:
return msg.createErrorReply(QDBusError::InternalError,
QString::fromLatin1("Internal error"));
diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp
index 4ea6cefff6..8e0b3e4598 100644
--- a/src/dbus/qdbusmarshaller.cpp
+++ b/src/dbus/qdbusmarshaller.cpp
@@ -211,7 +211,7 @@ inline bool QDBusMarshaller::append(const QDBusVariant &arg)
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
QMetaType::typeName(id), id);
- error(QString::fromLatin1("Unregistered type %1 passed in arguments")
+ error(QLatin1String("Unregistered type %1 passed in arguments")
.arg(QLatin1String(QMetaType::typeName(id))));
return false;
}
@@ -253,7 +253,7 @@ inline QDBusMarshaller *QDBusMarshaller::beginArray(int id)
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
QMetaType::typeName(id), id);
- error(QString::fromLatin1("Unregistered type %1 passed in arguments")
+ error(QLatin1String("Unregistered type %1 passed in arguments")
.arg(QLatin1String(QMetaType::typeName(id))));
return this;
}
@@ -268,14 +268,14 @@ inline QDBusMarshaller *QDBusMarshaller::beginMap(int kid, int vid)
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
QMetaType::typeName(kid), kid);
- error(QString::fromLatin1("Unregistered type %1 passed in arguments")
+ error(QLatin1String("Unregistered type %1 passed in arguments")
.arg(QLatin1String(QMetaType::typeName(kid))));
return this;
}
if (ksignature[1] != 0 || !QDBusUtil::isValidBasicType(*ksignature)) {
qWarning("QDBusMarshaller: type '%s' (%d) cannot be used as the key type in a D-BUS map.",
QMetaType::typeName(kid), kid);
- error(QString::fromLatin1("Type %1 passed in arguments cannot be used as a key in a map")
+ error(QLatin1String("Type %1 passed in arguments cannot be used as a key in a map")
.arg(QLatin1String(QMetaType::typeName(kid))));
return this;
}
@@ -286,7 +286,7 @@ inline QDBusMarshaller *QDBusMarshaller::beginMap(int kid, int vid)
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
typeName, vid);
- error(QString::fromLatin1("Unregistered type %1 passed in arguments")
+ error(QLatin1String("Unregistered type %1 passed in arguments")
.arg(QLatin1String(typeName)));
return this;
}
@@ -417,7 +417,7 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg)
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
QMetaType::typeName(id), id);
- error(QString::fromLatin1("Unregistered type %1 passed in arguments")
+ error(QLatin1String("Unregistered type %1 passed in arguments")
.arg(QLatin1String(QMetaType::typeName(id))));
return false;
}
diff --git a/src/dbus/qdbusmessage.h b/src/dbus/qdbusmessage.h
index 23e04045d8..41845317c4 100644
--- a/src/dbus/qdbusmessage.h
+++ b/src/dbus/qdbusmessage.h
@@ -68,13 +68,11 @@ public:
QDBusMessage();
QDBusMessage(const QDBusMessage &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDBusMessage &operator=(QDBusMessage &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDBusMessage &operator=(QDBusMessage &&other) noexcept { swap(other); return *this; }
QDBusMessage &operator=(const QDBusMessage &other);
~QDBusMessage();
- void swap(QDBusMessage &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); }
+ void swap(QDBusMessage &other) noexcept { qSwap(d_ptr, other.d_ptr); }
static QDBusMessage createSignal(const QString &path, const QString &interface,
const QString &name);
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index c4296f5c55..806cf7b415 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -649,7 +649,7 @@ QDBusMetaObject *QDBusMetaObject::createMetaObject(const QString &interface, con
// mark as an error
error = QDBusError(QDBusError::UnknownInterface,
- QString::fromLatin1("Interface '%1' was not found")
+ QLatin1String("Interface '%1' was not found")
.arg(interface));
return 0;
}
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 0729a3cbbb..58ce4f8930 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -93,7 +93,7 @@ void QDBusMetaTypeId::init()
// reentrancy is not a problem since everything else is locked on their own
// set the guard variable at the end
- if (!initialized.load()) {
+ if (!initialized.loadRelaxed()) {
// register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
(void)message();
(void)argument();
@@ -145,7 +145,7 @@ void QDBusMetaTypeId::init()
qDBusRegisterMetaType<QVector<QDBusUnixFileDescriptor> >();
#endif
- initialized.store(true);
+ initialized.storeRelaxed(true);
}
}
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index 4d0131afff..8e604d5a77 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -47,6 +47,7 @@
#include "qcoreapplication.h"
#include "qcoreevent.h"
#include <private/qobject_p.h>
+#include <private/qlocking_p.h>
#ifndef QT_NO_DBUS
@@ -221,8 +222,8 @@ void QDBusPendingCallPrivate::checkReceivedSignature()
// can't use startsWith here because a null string doesn't start or end with an empty string
if (replyMessage.signature().indexOf(expectedReplySignature) != 0) {
- QString errorMsg = QLatin1String("Unexpected reply signature: got \"%1\", "
- "expected \"%2\"");
+ const auto errorMsg = QLatin1String("Unexpected reply signature: got \"%1\", "
+ "expected \"%2\"");
replyMessage = QDBusMessage::createError(
QDBusError::InvalidSignature,
errorMsg.arg(replyMessage.signature(), expectedReplySignature));
@@ -232,7 +233,7 @@ void QDBusPendingCallPrivate::checkReceivedSignature()
void QDBusPendingCallPrivate::waitForFinished()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (replyMessage.type() != QDBusMessage::InvalidMessage)
return; // already finished
@@ -330,7 +331,7 @@ bool QDBusPendingCall::isFinished() const
if (!d)
return true; // considered finished
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage.type() != QDBusMessage::InvalidMessage;
}
@@ -352,7 +353,7 @@ bool QDBusPendingCall::isValid() const
{
if (!d)
return false;
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage.type() == QDBusMessage::ReplyMessage;
}
@@ -369,7 +370,7 @@ bool QDBusPendingCall::isError() const
{
if (!d)
return true; // considered finished and an error
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage.type() == QDBusMessage::ErrorMessage;
}
@@ -384,7 +385,7 @@ bool QDBusPendingCall::isError() const
QDBusError QDBusPendingCall::error() const
{
if (d) {
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return QDBusError(d->replyMessage);
}
@@ -409,7 +410,7 @@ QDBusMessage QDBusPendingCall::reply() const
{
if (!d)
return QDBusMessage::createError(error());
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
return d->replyMessage;
}
@@ -473,7 +474,7 @@ QDBusPendingCall QDBusPendingCall::fromCompletedCall(const QDBusMessage &msg)
msg.type() == QDBusMessage::ReplyMessage) {
d = new QDBusPendingCallPrivate(QDBusMessage(), 0);
d->replyMessage = msg;
- d->ref.store(1);
+ d->ref.storeRelaxed(1);
}
return QDBusPendingCall(d);
@@ -503,7 +504,7 @@ QDBusPendingCallWatcher::QDBusPendingCallWatcher(const QDBusPendingCall &call, Q
: QObject(*new QDBusPendingCallWatcherPrivate, parent), QDBusPendingCall(call)
{
if (d) { // QDBusPendingCall::d
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
if (!d->watcherHelper) {
d->watcherHelper = new QDBusPendingCallWatcherHelper;
if (d->replyMessage.type() != QDBusMessage::InvalidMessage) {
diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h
index 24b1d6a7ca..dd99346301 100644
--- a/src/dbus/qdbuspendingcall.h
+++ b/src/dbus/qdbuspendingcall.h
@@ -60,12 +60,10 @@ class Q_DBUS_EXPORT QDBusPendingCall
public:
QDBusPendingCall(const QDBusPendingCall &other);
~QDBusPendingCall();
-#ifdef Q_COMPILER_RVALUE_REFS
- QDBusPendingCall &operator=(QDBusPendingCall &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDBusPendingCall &operator=(QDBusPendingCall &&other) noexcept { swap(other); return *this; }
QDBusPendingCall &operator=(const QDBusPendingCall &other);
- void swap(QDBusPendingCall &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDBusPendingCall &other) noexcept { qSwap(d, other.d); }
#ifndef Q_CLANG_QDOC
// pretend that they aren't here
diff --git a/src/dbus/qdbuspendingcall_p.h b/src/dbus/qdbuspendingcall_p.h
index 10f189ae43..e1f6240f3e 100644
--- a/src/dbus/qdbuspendingcall_p.h
+++ b/src/dbus/qdbuspendingcall_p.h
@@ -99,7 +99,7 @@ public:
// }
QDBusPendingCallPrivate(const QDBusMessage &sent, QDBusConnectionPrivate *connection)
- : sentMessage(sent), connection(connection), watcherHelper(0), pending(0)
+ : sentMessage(sent), connection(connection), watcherHelper(nullptr), pending(nullptr)
{ }
~QDBusPendingCallPrivate();
bool setReplyCallback(QObject *target, const char *member);
diff --git a/src/dbus/qdbuspendingreply.cpp b/src/dbus/qdbuspendingreply.cpp
index 6aec571563..ec49bafb60 100644
--- a/src/dbus/qdbuspendingreply.cpp
+++ b/src/dbus/qdbuspendingreply.cpp
@@ -42,6 +42,8 @@
#include "qdbuspendingcall_p.h"
#include "qdbusmetatype.h"
+#include <QtCore/private/qlocking_p.h>
+
#ifndef QT_NO_DBUS
/*!
@@ -277,7 +279,7 @@ QVariant QDBusPendingReplyData::argumentAt(int index) const
void QDBusPendingReplyData::setMetaTypes(int count, const int *types)
{
Q_ASSERT(d);
- QMutexLocker locker(&d->mutex);
+ const auto locker = qt_scoped_lock(d->mutex);
d->setMetaTypes(count, types);
d->checkReceivedSignature();
}
diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h
index bc5cd92c84..1d7e60ad7f 100644
--- a/src/dbus/qdbuspendingreply.h
+++ b/src/dbus/qdbuspendingreply.h
@@ -156,7 +156,7 @@ public:
{
Q_STATIC_ASSERT_X(Index >= 0 && Index < Count, "Index out of bounds");
typedef typename Select<Index>::Type ResultType;
- return qdbus_cast<ResultType>(argumentAt(Index), 0);
+ return qdbus_cast<ResultType>(argumentAt(Index), nullptr);
}
#endif
diff --git a/src/dbus/qdbusreply.cpp b/src/dbus/qdbusreply.cpp
index 6abfaf174c..cf1a70508c 100644
--- a/src/dbus/qdbusreply.cpp
+++ b/src/dbus/qdbusreply.cpp
@@ -228,14 +228,14 @@ void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data
receivedSignature = "<empty signature>";
QString errorMsg;
if (receivedType) {
- errorMsg = QString::fromLatin1("Unexpected reply signature: got \"%1\" (%4), "
+ errorMsg = QLatin1String("Unexpected reply signature: got \"%1\" (%4), "
"expected \"%2\" (%3)")
.arg(QLatin1String(receivedSignature),
QLatin1String(expectedSignature),
QLatin1String(data.typeName()),
QLatin1String(receivedType));
} else {
- errorMsg = QString::fromLatin1("Unexpected reply signature: got \"%1\", "
+ errorMsg = QLatin1String("Unexpected reply signature: got \"%1\", "
"expected \"%2\" (%3)")
.arg(QLatin1String(receivedSignature),
QLatin1String(expectedSignature),
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
index 3ac5c794e1..eccffc3d3e 100644
--- a/src/dbus/qdbusserver.cpp
+++ b/src/dbus/qdbusserver.cpp
@@ -43,6 +43,8 @@
#include "qdbusconnectionmanager_p.h"
#include "qdbusutil_p.h"
+#include <QtCore/private/qlocking_p.h>
+
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -121,7 +123,7 @@ QDBusServer::~QDBusServer()
locker.unlock();
}
d->serverObject = nullptr;
- d->ref.store(0);
+ d->ref.storeRelaxed(0);
d->deleteLater();
}
diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp
index 459cfc6c66..73d1db2680 100644
--- a/src/dbus/qdbusunixfiledescriptor.cpp
+++ b/src/dbus/qdbusunixfiledescriptor.cpp
@@ -208,7 +208,7 @@ QDBusUnixFileDescriptor::~QDBusUnixFileDescriptor()
*/
bool QDBusUnixFileDescriptor::isValid() const
{
- return d ? d->fd.load() != -1 : false;
+ return d ? d->fd.loadRelaxed() != -1 : false;
}
/*!
@@ -226,7 +226,7 @@ bool QDBusUnixFileDescriptor::isValid() const
*/
int QDBusUnixFileDescriptor::fileDescriptor() const
{
- return d ? d->fd.load() : -1;
+ return d ? d->fd.loadRelaxed() : -1;
}
// actual implementation
@@ -283,12 +283,12 @@ void QDBusUnixFileDescriptor::giveFileDescriptor(int fileDescriptor)
else
d = new QDBusUnixFileDescriptorPrivate;
- const int fdl = d->fd.load();
+ const int fdl = d->fd.loadRelaxed();
if (fdl != -1)
qt_safe_close(fdl);
if (fileDescriptor != -1)
- d->fd.store(fileDescriptor);
+ d->fd.storeRelaxed(fileDescriptor);
}
/*!
@@ -309,7 +309,7 @@ int QDBusUnixFileDescriptor::takeFileDescriptor()
QDBusUnixFileDescriptorPrivate::~QDBusUnixFileDescriptorPrivate()
{
- const int fdl = fd.load();
+ const int fdl = fd.loadRelaxed();
if (fdl != -1)
qt_safe_close(fdl);
}
diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h
index ed3209ceda..fcd73b2ec5 100644
--- a/src/dbus/qdbusunixfiledescriptor.h
+++ b/src/dbus/qdbusunixfiledescriptor.h
@@ -46,9 +46,7 @@
#ifndef QT_NO_DBUS
-#ifdef Q_COMPILER_RVALUE_REFS
-# include <utility>
-#endif
+#include <utility>
QT_BEGIN_NAMESPACE
@@ -61,13 +59,11 @@ public:
QDBusUnixFileDescriptor();
explicit QDBusUnixFileDescriptor(int fileDescriptor);
QDBusUnixFileDescriptor(const QDBusUnixFileDescriptor &other);
-#if defined(Q_COMPILER_RVALUE_REFS)
- QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDBusUnixFileDescriptor &operator=(QDBusUnixFileDescriptor &&other) noexcept { swap(other); return *this; }
QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other);
~QDBusUnixFileDescriptor();
- void swap(QDBusUnixFileDescriptor &other) Q_DECL_NOTHROW
+ void swap(QDBusUnixFileDescriptor &other) noexcept
{ qSwap(d, other.d); }
bool isValid() const;
diff --git a/src/dbus/qdbusutil_p.h b/src/dbus/qdbusutil_p.h
index 2f187687b8..0814cc8050 100644
--- a/src/dbus/qdbusutil_p.h
+++ b/src/dbus/qdbusutil_p.h
@@ -106,7 +106,7 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
return false;
}
if (isValidInterfaceName(name)) return true;
- *error = QDBusError(QDBusError::InvalidInterface, QString::fromLatin1("Invalid interface class: %1").arg(name));
+ *error = QDBusError(QDBusError::InvalidInterface, QLatin1String("Invalid interface class: %1").arg(name));
return false;
}
@@ -118,7 +118,7 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
return false;
}
if (isValidBusName(name)) return true;
- *error = QDBusError(QDBusError::InvalidService, QString::fromLatin1("Invalid service name: %1").arg(name));
+ *error = QDBusError(QDBusError::InvalidService, QLatin1String("Invalid service name: %1").arg(name));
return false;
}
@@ -130,11 +130,11 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
return false;
}
if (isValidObjectPath(path)) return true;
- *error = QDBusError(QDBusError::InvalidObjectPath, QString::fromLatin1("Invalid object path: %1").arg(path));
+ *error = QDBusError(QDBusError::InvalidObjectPath, QLatin1String("Invalid object path: %1").arg(path));
return false;
}
- inline bool checkMemberName(const QString &name, AllowEmptyFlag empty, QDBusError *error, const char *nameType = 0)
+ inline bool checkMemberName(const QString &name, AllowEmptyFlag empty, QDBusError *error, const char *nameType = nullptr)
{
if (!nameType) nameType = "member";
if (name.isEmpty()) {
@@ -143,8 +143,8 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
return false;
}
if (isValidMemberName(name)) return true;
- *error = QDBusError(QDBusError::InvalidMember, QString::fromLatin1("Invalid %1 name: %2")
- .arg(QString::fromLatin1(nameType), name));
+ *error = QDBusError(QDBusError::InvalidMember, QLatin1String("Invalid %1 name: %2")
+ .arg(QLatin1String(nameType), name));
return false;
}
@@ -156,7 +156,7 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
return false;
}
if (isValidErrorName(name)) return true;
- *error = QDBusError(QDBusError::InvalidInterface, QString::fromLatin1("Invalid error name: %1").arg(name));
+ *error = QDBusError(QDBusError::InvalidInterface, QLatin1String("Invalid error name: %1").arg(name));
return false;
}
diff --git a/src/dbus/qdbusxmlgenerator.cpp b/src/dbus/qdbusxmlgenerator.cpp
index e3c503aa0f..c6b3b90508 100644
--- a/src/dbus/qdbusxmlgenerator.cpp
+++ b/src/dbus/qdbusxmlgenerator.cpp
@@ -108,14 +108,14 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
if (!signature)
continue;
- retval += QString::fromLatin1(" <property name=\"%1\" type=\"%2\" access=\"%3\"")
+ retval += QLatin1String(" <property name=\"%1\" type=\"%2\" access=\"%3\"")
.arg(QLatin1String(mp.name()),
QLatin1String(signature),
accessAsString(mp.isReadable(), mp.isWritable()));
if (QDBusMetaType::signatureToType(signature) == QVariant::Invalid) {
const char *typeName = QMetaType::typeName(typeId);
- retval += QString::fromLatin1(">\n <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"%3\"/>\n </property>\n")
+ retval += QLatin1String(">\n <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"%3\"/>\n </property>\n")
.arg(typeNameToXml(typeName));
} else {
retval += QLatin1String("/>\n");
@@ -157,12 +157,12 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
if (typeId != QMetaType::UnknownType && typeId != QMetaType::Void) {
const char *typeName = QDBusMetaType::typeToSignature(typeId);
if (typeName) {
- xml += QString::fromLatin1(" <arg type=\"%1\" direction=\"out\"/>\n")
+ xml += QLatin1String(" <arg type=\"%1\" direction=\"out\"/>\n")
.arg(typeNameToXml(typeName));
// do we need to describe this argument?
if (QDBusMetaType::signatureToType(typeName) == QVariant::Invalid)
- xml += QString::fromLatin1(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"%1\"/>\n")
+ xml += QLatin1String(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"%1\"/>\n")
.arg(typeNameToXml(QMetaType::typeName(typeId)));
} else {
qWarning() << "Unsupported return type" << typeId << QMetaType::typeName(typeId) << "in method" << mm.name();
@@ -199,7 +199,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
QString name;
if (!names.at(j - 1).isEmpty())
- name = QString::fromLatin1("name=\"%1\" ").arg(QLatin1String(names.at(j - 1)));
+ name = QLatin1String("name=\"%1\" ").arg(QLatin1String(names.at(j - 1)));
bool isOutput = isSignal || j > inputCount;
@@ -233,7 +233,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
" value=\"true\"/>\n");
retval += xml;
- retval += QString::fromLatin1(" </%1>\n")
+ retval += QLatin1String(" </%1>\n")
.arg(isSignal ? QLatin1String("signal") : QLatin1String("method"));
}
@@ -256,7 +256,7 @@ QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo,
if (xml.isEmpty())
return QString(); // don't add an empty interface
- return QString::fromLatin1(" <interface name=\"%1\">\n%2 </interface>\n")
+ return QLatin1String(" <interface name=\"%1\">\n%2 </interface>\n")
.arg(interface, xml);
}
#if 0
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index bdec9e973a..db47a3abc1 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -1859,7 +1859,7 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAccessibleInterface *iface)
return d;
}
d.nospace();
- d << "QAccessibleInterface(" << hex << (const void *) iface << dec;
+ d << "QAccessibleInterface(" << Qt::hex << (const void *) iface << Qt::dec;
if (iface->isValid()) {
d << " name=" << iface->text(QAccessible::Name) << ' ';
d << "role=" << qAccessibleRoleString(iface->role()) << ' ';
@@ -1898,7 +1898,7 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev)
QDebugStateSaver saver(d);
d.nospace() << "QAccessibleEvent(";
if (ev.object()) {
- d.nospace() << "object=" << hex << ev.object() << dec;
+ d.nospace() << "object=" << Qt::hex << ev.object() << Qt::dec;
d.nospace() << "child=" << ev.child();
} else {
d.nospace() << "no object, uniqueId=" << ev.uniqueId();
diff --git a/src/gui/accessible/qaccessiblecache_p.h b/src/gui/accessible/qaccessiblecache_p.h
index a976277c1d..cf1ed04f35 100644
--- a/src/gui/accessible/qaccessiblecache_p.h
+++ b/src/gui/accessible/qaccessiblecache_p.h
@@ -73,7 +73,7 @@ public:
QAccessibleInterface *interfaceForId(QAccessible::Id id) const;
QAccessible::Id idForInterface(QAccessibleInterface *iface) const;
QAccessible::Id insert(QObject *object, QAccessibleInterface *iface) const;
- void deleteInterface(QAccessible::Id id, QObject *obj = 0);
+ void deleteInterface(QAccessible::Id id, QObject *obj = nullptr);
#ifdef Q_OS_MAC
QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *elementForId(QAccessible::Id axid) const;
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 6280b4dfa2..19312d245d 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -1,7 +1,7 @@
{
"module": "gui",
"depends": [
- "core",
+ "core-private",
"network"
],
"testDir": "../../config.tests",
@@ -28,9 +28,9 @@
"lgmon": "boolean",
"libinput": "boolean",
"libjpeg": { "type": "enum", "values": [ "no", "qt", "system" ] },
+ "libmd4c": { "type": "enum", "values": [ "no", "qt", "system" ] },
"libpng": { "type": "enum", "values": [ "no", "qt", "system" ] },
"linuxfb": "boolean",
- "mirclient": "boolean",
"mtdev": "boolean",
"opengl": { "type": "optionalString", "values": [ "no", "yes", "desktop", "es2", "dynamic" ] },
"opengl-es-2": { "type": "void", "name": "opengl", "value": "es2" },
@@ -61,6 +61,7 @@
"export": "",
"headers": ["bcm_host.h"],
"sources": [
+ { "type": "pkgConfig", "args": "bcm_host" },
{ "type": "makeSpec", "spec": "BCM_HOST" }
]
},
@@ -377,6 +378,17 @@
"-ljpeg"
]
},
+ "libmd4c": {
+ "label": "libmd4c",
+ "test": {
+ "main": "md_parse(\"hello\", 5, nullptr, nullptr);"
+ },
+ "headers": "md4c.h",
+ "sources": [
+ { "type": "pkgConfig", "args": "md4c" },
+ { "libs": "-lmd4c" }
+ ]
+ },
"libpng": {
"label": "libpng",
"test": {
@@ -395,20 +407,6 @@
{ "lib": "zlib", "condition": "features.system-zlib" }
]
},
- "mirclient": {
- "label": "Mir client libraries",
- "test": {
- "tail": "static void surfaceCreateCallback(MirSurface*, void*) {}",
- "main": [
- "u_application_lifecycle_delegate_new();",
- "mir_surface_create(0, surfaceCreateCallback, 0);"
- ]
- },
- "headers": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ],
- "sources": [
- { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" }
- ]
- },
"mtdev": {
"label": "mtdev",
"test": {
@@ -491,7 +489,7 @@
"tslib": {
"label": "tslib",
"test": {
- "main": "ts_open(\"foo\", 0);"
+ "main": "ts_setup(nullptr, 0);"
},
"headers": "tslib.h",
"sources": [
@@ -1297,13 +1295,6 @@
],
"output": [ "privateFeature" ]
},
- "mirclient": {
- "label": "Mir client",
- "section": "Platform plugins",
- "autoDetect": false,
- "condition": "libs.mirclient && features.xkbcommon",
- "output": [ "privateFeature" ]
- },
"mtdev": {
"label": "mtdev",
"condition": "libs.mtdev",
@@ -1367,9 +1358,14 @@
"condition": "features.opengl-desktop || features.opengl-dynamic || features.opengles2",
"output": [ "publicFeature", "feature" ]
},
+ "vkgen": {
+ "label": "vkgen",
+ "condition": "features.xmlstreamreader",
+ "output": [ "privateFeature" ]
+ },
"vulkan": {
"label": "Vulkan",
- "condition": "libs.vulkan",
+ "condition": "features.vkgen && libs.vulkan",
"output": [ "publicFeature" ]
},
"openvg": {
@@ -1379,7 +1375,7 @@
},
"egl": {
"label": "EGL",
- "condition": "(features.opengl || features.openvg) && (features.angle || libs.egl)",
+ "condition": "(features.opengl || features.openvg) && (features.angle || libs.egl) && (features.dlopen || !config.unix || config.integrity)",
"output": [ "privateFeature", "feature" ]
},
"egl_x11": {
@@ -1555,6 +1551,7 @@
},
"xcb-native-painting": {
"label": "Native painting (experimental)",
+ "autoDetect": false,
"emitIf": "features.xcb",
"condition": "features.xcb-xlib && features.fontconfig && libs.xrender",
"output": [ "privateFeature" ]
@@ -1605,6 +1602,28 @@
"section": "Kernel",
"output": [ "publicFeature", "feature" ]
},
+ "textmarkdownreader": {
+ "label": "MarkdownReader",
+ "disable": "input.libmd4c == 'no'",
+ "enable": "input.libmd4c == 'system' || input.libmd4c == 'qt' || input.libmd4c == 'yes'",
+ "purpose": "Provides a Markdown (CommonMark and GitHub) reader",
+ "section": "Kernel",
+ "output": [ "publicFeature" ]
+ },
+ "system-textmarkdownreader": {
+ "label": " Using system libmd4c",
+ "disable": "input.libmd4c == 'qt'",
+ "enable": "input.libmd4c == 'system'",
+ "section": "Kernel",
+ "condition": "libs.libmd4c",
+ "output": [ "publicFeature" ]
+ },
+ "textmarkdownwriter": {
+ "label": "MarkdownWriter",
+ "purpose": "Provides a Markdown (CommonMark) writer",
+ "section": "Kernel",
+ "output": [ "publicFeature" ]
+ },
"textodfwriter": {
"label": "OdfWriter",
"purpose": "Provides an ODF writer.",
@@ -1647,7 +1666,7 @@
"label": "QClipboard",
"purpose": "Provides cut and paste operations.",
"section": "Kernel",
- "condition": "!config.integrity && !config.qnx",
+ "condition": "!config.integrity && !config.qnx && !config.rtems",
"output": [ "publicFeature", "feature" ]
},
"wheelevent": {
@@ -1791,7 +1810,7 @@
"label": "Multi process",
"purpose": "Provides support for detecting the desktop environment, launching external processes and opening URLs.",
"section": "Utilities",
- "condition": "!config.integrity",
+ "condition": "!config.integrity && !config.rtems",
"output": [ "privateFeature" ]
},
"whatsthis": {
@@ -1799,6 +1818,12 @@
"purpose": "Supports displaying \"What's this\" help.",
"section": "Widget Support",
"output": [ "publicFeature", "feature" ]
+ },
+ "raster-64bit": {
+ "label": "QPainter - 64 bit raster",
+ "purpose": "Internal painting support for 64 bit (16 bpc) rasterization.",
+ "section": "Painting",
+ "output": [ "privateFeature" ]
}
},
@@ -1830,7 +1855,7 @@ or may depend on your system and XQuartz setup."
},
{
"type": "warning",
- "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient",
+ "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb",
"message": "No QPA platform plugin enabled! This will
produce a Qt that cannot run GUI applications.
See \"Platform backends\" in the output of --help."
@@ -1877,6 +1902,12 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"gif", "ico", "jpeg", "system-jpeg", "png", "system-png"
]
},
+ {
+ "section": "Text formats",
+ "entries": [
+ "texthtmlparser", "cssparser", "textodfwriter", "textmarkdownreader", "system-textmarkdownreader", "textmarkdownwriter"
+ ]
+ },
"egl",
"openvg",
{
@@ -1938,7 +1969,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
"eglfs_openwfd", "eglfs_viv", "eglfs_viv_wl", "eglfs_rcar", "eglfs_egldevice", "eglfs_gbm", "eglfs_vsp2", "eglfs_mali", "eglfs_brcm", "eglfs_x11"
]
},
- "linuxfb", "vnc", "mirclient",
+ "linuxfb", "vnc",
{
"type": "feature",
"condition": "config.integrity",
diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf
index 049b9ef179..76dd6d7ea1 100644
--- a/src/gui/doc/qtgui.qdocconf
+++ b/src/gui/doc/qtgui.qdocconf
@@ -67,3 +67,6 @@ navigation.cppclassespage = "Qt GUI C++ Classes"
# Ignore warnings about undocumented enum values for the QGradient presets
spurious += "Undocumented enum item '.*' in QGradient::Preset"
+
+# \svgcolor {#ffdead}
+macro.svgcolor.HTML = "<div style=\"padding:10px;color:#fff;background:\1;\"></div>"
diff --git a/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp b/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp
index bf864ce48d..236d6952e6 100644
--- a/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp
+++ b/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp
@@ -114,7 +114,7 @@ void MainWindow::insertCalendar()
int year = date.year(), month = date.month();
for (int weekDay = 1; weekDay <= 7; ++weekDay) {
- cursor.insertText(QString("%1 ").arg(QDate::shortDayName(weekDay), 3),
+ cursor.insertText(QString("%1 ").arg(QLocale::system().dayName(weekDay), 3),
boldFormat);
}
diff --git a/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp b/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp
index a5801da67e..849f0e957f 100644
--- a/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp
+++ b/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp
@@ -117,7 +117,7 @@ void MainWindow::insertCalendar()
int year = date.year(), month = date.month();
for (int weekDay = 1; weekDay <= 7; ++weekDay) {
- cursor.insertText(QString("%1 ").arg(QDate::shortDayName(weekDay), 3),
+ cursor.insertText(QString("%1 ").arg(QLocale::system().dayName(weekDay), 3),
boldFormat);
}
diff --git a/src/gui/doc/snippets/textdocumentendsnippet.cpp b/src/gui/doc/snippets/textdocumentendsnippet.cpp
index c8de501838..cb7abd5ca7 100644
--- a/src/gui/doc/snippets/textdocumentendsnippet.cpp
+++ b/src/gui/doc/snippets/textdocumentendsnippet.cpp
@@ -59,7 +59,7 @@ int main(int argv, char **args)
//! [0]
for (QTextBlock it = doc->begin(); it != doc->end(); it = it.next())
- cout << it.text().toStdString() << endl;
+ cout << it.text().toStdString() << Qt::endl;
//! [0]
return 0;
diff --git a/src/gui/doc/src/includes/qt-colors.qdocinc b/src/gui/doc/src/includes/qt-colors.qdocinc
new file mode 100644
index 0000000000..4c082323b6
--- /dev/null
+++ b/src/gui/doc/src/includes/qt-colors.qdocinc
@@ -0,0 +1,86 @@
+\table
+\header
+ \li Name
+ \li Hex
+ \li Color
+\row
+ \li Color0
+ \li #000000
+ \li \svgcolor {#000000}
+\row
+ \li Color1
+ \li #ffffff
+ \li \svgcolor {#ffffff}
+\row
+ \li Black
+ \li #000000
+ \li \svgcolor {#000000}
+\row
+ \li White
+ \li #ffffff
+ \li \svgcolor {#ffffff}
+\row
+ \li DarkGray
+ \li #808080
+ \li \svgcolor {#808080}
+\row
+ \li Gray
+ \li #a0a0a4
+ \li \svgcolor {#a0a0a4}
+\row
+ \li LightGray
+ \li #c0c0c0
+ \li \svgcolor {#c0c0c0}
+\row
+ \li Red
+ \li #ff0000
+ \li \svgcolor {#ff0000}
+\row
+ \li Green
+ \li #00ff00
+ \li \svgcolor {#00ff00}
+\row
+ \li Blue
+ \li #0000ff
+ \li \svgcolor {#0000ff}
+\row
+ \li Cyan
+ \li #00ffff
+ \li \svgcolor {#00ffff}
+\row
+ \li Magenta
+ \li #ff00ff
+ \li \svgcolor {#ff00ff}
+\row
+ \li Yellow
+ \li #ffff00
+ \li \svgcolor {#ffff00}
+\row
+ \li DarkRed
+ \li #800000
+ \li \svgcolor {#800000}
+\row
+ \li DarkGreen
+ \li #008000
+ \li \svgcolor {#008000}
+\row
+ \li DarkBlue
+ \li #000080
+ \li \svgcolor {#000080}
+\row
+ \li DarkCyan
+ \li #008080
+ \li \svgcolor {#008080}
+\row
+ \li DarkMagenta
+ \li #800080
+ \li \svgcolor {#800080}
+\row
+ \li DarkYellow
+ \li #808000
+ \li \svgcolor {#808000}
+\row
+ \li Transparent
+ \li #00000000
+ \li (transparent)
+\endtable
diff --git a/src/gui/doc/src/includes/svg-colors.qdocinc b/src/gui/doc/src/includes/svg-colors.qdocinc
new file mode 100644
index 0000000000..4e5fb56d5e
--- /dev/null
+++ b/src/gui/doc/src/includes/svg-colors.qdocinc
@@ -0,0 +1,594 @@
+\table
+\header
+ \li Name
+ \li Hex
+ \li Color
+\row
+ \li aliceblue
+ \li #f0f8ff
+ \li \svgcolor {#f0f8ff}
+\row
+ \li antiquewhite
+ \li #faebd7
+ \li \svgcolor {#faebd7}
+\row
+ \li aqua
+ \li #00ffff
+ \li \svgcolor {#00ffff}
+\row
+ \li aquamarine
+ \li #7fffd4
+ \li \svgcolor {#7fffd4}
+\row
+ \li azure
+ \li #f0ffff
+ \li \svgcolor {#f0ffff}
+\row
+ \li beige
+ \li #f5f5dc
+ \li \svgcolor {#f5f5dc}
+\row
+ \li bisque
+ \li #ffe4c4
+ \li \svgcolor {#ffe4c4}
+\row
+ \li black
+ \li #000000
+ \li \svgcolor {#000000}
+\row
+ \li blanchedalmond
+ \li #ffebcd
+ \li \svgcolor {#ffebcd}
+\row
+ \li blue
+ \li #0000ff
+ \li \svgcolor {#0000ff}
+\row
+ \li blueviolet
+ \li #8a2be2
+ \li \svgcolor {#8a2be2}
+\row
+ \li brown
+ \li #a52a2a
+ \li \svgcolor {#a52a2a}
+\row
+ \li burlywood
+ \li #deb887
+ \li \svgcolor {#deb887}
+\row
+ \li cadetblue
+ \li #5f9ea0
+ \li \svgcolor {#5f9ea0}
+\row
+ \li chartreuse
+ \li #7fff00
+ \li \svgcolor {#7fff00}
+\row
+ \li chocolate
+ \li #d2691e
+ \li \svgcolor {#d2691e}
+\row
+ \li coral
+ \li #ff7f50
+ \li \svgcolor {#ff7f50}
+\row
+ \li cornflowerblue
+ \li #6495ed
+ \li \svgcolor {#6495ed}
+\row
+ \li cornsilk
+ \li #fff8dc
+ \li \svgcolor {#fff8dc}
+\row
+ \li crimson
+ \li #dc143c
+ \li \svgcolor {#dc143c}
+\row
+ \li cyan
+ \li #00ffff
+ \li \svgcolor {#00ffff}
+\row
+ \li darkblue
+ \li #00008b
+ \li \svgcolor {#00008b}
+\row
+ \li darkcyan
+ \li #008b8b
+ \li \svgcolor {#008b8b}
+\row
+ \li darkgoldenrod
+ \li #b8860b
+ \li \svgcolor {#b8860b}
+\row
+ \li darkgray
+ \li #a9a9a9
+ \li \svgcolor {#a9a9a9}
+\row
+ \li darkgreen
+ \li #006400
+ \li \svgcolor {#006400}
+\row
+ \li darkgrey
+ \li #a9a9a9
+ \li \svgcolor {#a9a9a9}
+\row
+ \li darkkhaki
+ \li #bdb76b
+ \li \svgcolor {#bdb76b}
+\row
+ \li darkmagenta
+ \li #8b008b
+ \li \svgcolor {#8b008b}
+\row
+ \li darkolivegreen
+ \li #556b2f
+ \li \svgcolor {#556b2f}
+\row
+ \li darkorange
+ \li #ff8c00
+ \li \svgcolor {#ff8c00}
+\row
+ \li darkorchid
+ \li #9932cc
+ \li \svgcolor {#9932cc}
+\row
+ \li darkred
+ \li #8b0000
+ \li \svgcolor {#8b0000}
+\row
+ \li darksalmon
+ \li #e9967a
+ \li \svgcolor {#e9967a}
+\row
+ \li darkseagreen
+ \li #8fbc8f
+ \li \svgcolor {#8fbc8f}
+\row
+ \li darkslateblue
+ \li #483d8b
+ \li \svgcolor {#483d8b}
+\row
+ \li darkslategray
+ \li #2f4f4f
+ \li \svgcolor {#2f4f4f}
+\row
+ \li darkslategrey
+ \li #2f4f4f
+ \li \svgcolor {#2f4f4f}
+\row
+ \li darkturquoise
+ \li #00ced1
+ \li \svgcolor {#00ced1}
+\row
+ \li darkviolet
+ \li #9400d3
+ \li \svgcolor {#9400d3}
+\row
+ \li deeppink
+ \li #ff1493
+ \li \svgcolor {#ff1493}
+\row
+ \li deepskyblue
+ \li #00bfff
+ \li \svgcolor {#00bfff}
+\row
+ \li dimgray
+ \li #696969
+ \li \svgcolor {#696969}
+\row
+ \li dimgrey
+ \li #696969
+ \li \svgcolor {#696969}
+\row
+ \li dodgerblue
+ \li #1e90ff
+ \li \svgcolor {#1e90ff}
+\row
+ \li firebrick
+ \li #b22222
+ \li \svgcolor {#b22222}
+\row
+ \li floralwhite
+ \li #fffaf0
+ \li \svgcolor {#fffaf0}
+\row
+ \li forestgreen
+ \li #228b22
+ \li \svgcolor {#228b22}
+\row
+ \li fuchsia
+ \li #ff00ff
+ \li \svgcolor {#ff00ff}
+\row
+ \li gainsboro
+ \li #dcdcdc
+ \li \svgcolor {#dcdcdc}
+\row
+ \li ghostwhite
+ \li #f8f8ff
+ \li \svgcolor {#f8f8ff}
+\row
+ \li gold
+ \li #ffd700
+ \li \svgcolor {#ffd700}
+\row
+ \li goldenrod
+ \li #daa520
+ \li \svgcolor {#daa520}
+\row
+ \li gray
+ \li #808080
+ \li \svgcolor {#808080}
+\row
+ \li grey
+ \li #808080
+ \li \svgcolor {#808080}
+\row
+ \li green
+ \li #008000
+ \li \svgcolor {#008000}
+\row
+ \li greenyellow
+ \li #adff2f
+ \li \svgcolor {#adff2f}
+\row
+ \li honeydew
+ \li #f0fff0
+ \li \svgcolor {#f0fff0}
+\row
+ \li hotpink
+ \li #ff69b4
+ \li \svgcolor {#ff69b4}
+\row
+ \li indianred
+ \li #cd5c5c
+ \li \svgcolor {#cd5c5c}
+\row
+ \li indigo
+ \li #4b0082
+ \li \svgcolor {#4b0082}
+\row
+ \li ivory
+ \li #fffff0
+ \li \svgcolor {#fffff0}
+\row
+ \li khaki
+ \li #f0e68c
+ \li \svgcolor {#f0e68c}
+\row
+ \li lavender
+ \li #e6e6fa
+ \li \svgcolor {#e6e6fa}
+\row
+ \li lavenderblush
+ \li #fff0f5
+ \li \svgcolor {#fff0f5}
+\row
+ \li lawngreen
+ \li #7cfc00
+ \li \svgcolor {#7cfc00}
+\row
+ \li lemonchiffon
+ \li #fffacd
+ \li \svgcolor {#fffacd}
+\row
+ \li lightblue
+ \li #add8e6
+ \li \svgcolor {#add8e6}
+\row
+ \li lightcoral
+ \li #f08080
+ \li \svgcolor {#f08080}
+\row
+ \li lightcyan
+ \li #e0ffff
+ \li \svgcolor {#e0ffff}
+\row
+ \li lightgoldenrodyellow
+ \li #fafad2
+ \li \svgcolor {#fafad2}
+\row
+ \li lightgray
+ \li #d3d3d3
+ \li \svgcolor {#d3d3d3}
+\row
+ \li lightgreen
+ \li #90ee90
+ \li \svgcolor {#90ee90}
+\row
+ \li lightgrey
+ \li #d3d3d3
+ \li \svgcolor {#d3d3d3}
+\row
+ \li lightpink
+ \li #ffb6c1
+ \li \svgcolor {#ffb6c1}
+\row
+ \li lightsalmon
+ \li #ffa07a
+ \li \svgcolor {#ffa07a}
+\row
+ \li lightseagreen
+ \li #20b2aa
+ \li \svgcolor {#20b2aa}
+\row
+ \li lightskyblue
+ \li #87cefa
+ \li \svgcolor {#87cefa}
+\row
+ \li lightslategray
+ \li #778899
+ \li \svgcolor {#778899}
+\row
+ \li lightslategrey
+ \li #778899
+ \li \svgcolor {#778899}
+\row
+ \li lightsteelblue
+ \li #b0c4de
+ \li \svgcolor {#b0c4de}
+\row
+ \li lightyellow
+ \li #ffffe0
+ \li \svgcolor {#ffffe0}
+\row
+ \li lime
+ \li #00ff00
+ \li \svgcolor {#00ff00}
+\row
+ \li limegreen
+ \li #32cd32
+ \li \svgcolor {#32cd32}
+\row
+ \li linen
+ \li #faf0e6
+ \li \svgcolor {#faf0e6}
+\row
+ \li magenta
+ \li #ff00ff
+ \li \svgcolor {#ff00ff}
+\row
+ \li maroon
+ \li #800000
+ \li \svgcolor {#800000}
+\row
+ \li mediumaquamarine
+ \li #66cdaa
+ \li \svgcolor {#66cdaa}
+\row
+ \li mediumblue
+ \li #0000cd
+ \li \svgcolor {#0000cd}
+\row
+ \li mediumorchid
+ \li #ba55d3
+ \li \svgcolor {#ba55d3}
+\row
+ \li mediumpurple
+ \li #9370db
+ \li \svgcolor {#9370db}
+\row
+ \li mediumseagreen
+ \li #3cb371
+ \li \svgcolor {#3cb371}
+\row
+ \li mediumslateblue
+ \li #7b68ee
+ \li \svgcolor {#7b68ee}
+\row
+ \li mediumspringgreen
+ \li #00fa9a
+ \li \svgcolor {#00fa9a}
+\row
+ \li mediumturquoise
+ \li #48d1cc
+ \li \svgcolor {#48d1cc}
+\row
+ \li mediumvioletred
+ \li #c71585
+ \li \svgcolor {#c71585}
+\row
+ \li midnightblue
+ \li #191970
+ \li \svgcolor {#191970}
+\row
+ \li mintcream
+ \li #f5fffa
+ \li \svgcolor {#f5fffa}
+\row
+ \li mistyrose
+ \li #ffe4e1
+ \li \svgcolor {#ffe4e1}
+\row
+ \li moccasin
+ \li #ffe4b5
+ \li \svgcolor {#ffe4b5}
+\row
+ \li navajowhite
+ \li #ffdead
+ \li \svgcolor {#ffdead}
+\row
+ \li navy
+ \li #000080
+ \li \svgcolor {#000080}
+\row
+ \li oldlace
+ \li #fdf5e6
+ \li \svgcolor {#fdf5e6}
+\row
+ \li olive
+ \li #808000
+ \li \svgcolor {#808000}
+\row
+ \li olivedrab
+ \li #6b8e23
+ \li \svgcolor {#6b8e23}
+\row
+ \li orange
+ \li #ffa500
+ \li \svgcolor {#ffa500}
+\row
+ \li orangered
+ \li #ff4500
+ \li \svgcolor {#ff4500}
+\row
+ \li orchid
+ \li #da70d6
+ \li \svgcolor {#da70d6}
+\row
+ \li palegoldenrod
+ \li #eee8aa
+ \li \svgcolor {#eee8aa}
+\row
+ \li palegreen
+ \li #98fb98
+ \li \svgcolor {#98fb98}
+\row
+ \li paleturquoise
+ \li #afeeee
+ \li \svgcolor {#afeeee}
+\row
+ \li palevioletred
+ \li #db7093
+ \li \svgcolor {#db7093}
+\row
+ \li papayawhip
+ \li #ffefd5
+ \li \svgcolor {#ffefd5}
+\row
+ \li peachpuff
+ \li #ffdab9
+ \li \svgcolor {#ffdab9}
+\row
+ \li peru
+ \li #cd853f
+ \li \svgcolor {#cd853f}
+\row
+ \li pink
+ \li #ffc0cb
+ \li \svgcolor {#ffc0cb}
+\row
+ \li plum
+ \li #dda0dd
+ \li \svgcolor {#dda0dd}
+\row
+ \li powderblue
+ \li #b0e0e6
+ \li \svgcolor {#b0e0e6}
+\row
+ \li purple
+ \li #800080
+ \li \svgcolor {#800080}
+\row
+ \li red
+ \li #ff0000
+ \li \svgcolor {#ff0000}
+\row
+ \li rosybrown
+ \li #bc8f8f
+ \li \svgcolor {#bc8f8f}
+\row
+ \li royalblue
+ \li #4169e1
+ \li \svgcolor {#4169e1}
+\row
+ \li saddlebrown
+ \li #8b4513
+ \li \svgcolor {#8b4513}
+\row
+ \li salmon
+ \li #fa8072
+ \li \svgcolor {#fa8072}
+\row
+ \li sandybrown
+ \li #f4a460
+ \li \svgcolor {#f4a460}
+\row
+ \li seagreen
+ \li #2e8b57
+ \li \svgcolor {#2e8b57}
+\row
+ \li seashell
+ \li #fff5ee
+ \li \svgcolor {#fff5ee}
+\row
+ \li sienna
+ \li #a0522d
+ \li \svgcolor {#a0522d}
+\row
+ \li silver
+ \li #c0c0c0
+ \li \svgcolor {#c0c0c0}
+\row
+ \li skyblue
+ \li #87ceeb
+ \li \svgcolor {#87ceeb}
+\row
+ \li slateblue
+ \li #6a5acd
+ \li \svgcolor {#6a5acd}
+\row
+ \li slategray
+ \li #708090
+ \li \svgcolor {#708090}
+\row
+ \li slategrey
+ \li #708090
+ \li \svgcolor {#708090}
+\row
+ \li snow
+ \li #fffafa
+ \li \svgcolor {#fffafa}
+\row
+ \li springgreen
+ \li #00ff7f
+ \li \svgcolor {#00ff7f}
+\row
+ \li steelblue
+ \li #4682b4
+ \li \svgcolor {#4682b4}
+\row
+ \li tan
+ \li #d2b48c
+ \li \svgcolor {#d2b48c}
+\row
+ \li teal
+ \li #008080
+ \li \svgcolor {#008080}
+\row
+ \li thistle
+ \li #d8bfd8
+ \li \svgcolor {#d8bfd8}
+\row
+ \li tomato
+ \li #ff6347
+ \li \svgcolor {#ff6347}
+\row
+ \li turquoise
+ \li #40e0d0
+ \li \svgcolor {#40e0d0}
+\row
+ \li violet
+ \li #ee82ee
+ \li \svgcolor {#ee82ee}
+\row
+ \li wheat
+ \li #f5deb3
+ \li \svgcolor {#f5deb3}
+\row
+ \li white
+ \li #ffffff
+ \li \svgcolor {#ffffff}
+\row
+ \li whitesmoke
+ \li #f5f5f5
+ \li \svgcolor {#f5f5f5}
+\row
+ \li yellow
+ \li #ffff00
+ \li \svgcolor {#ffff00}
+\row
+ \li yellowgreen
+ \li #9acd32
+ \li \svgcolor {#9acd32}
+\endtable
diff --git a/src/gui/doc/src/richtext.qdoc b/src/gui/doc/src/richtext.qdoc
index a8ba076e3d..24fd4240b3 100644
--- a/src/gui/doc/src/richtext.qdoc
+++ b/src/gui/doc/src/richtext.qdoc
@@ -1175,12 +1175,75 @@
\row \li \c vertical-align
\li baseline | sub | super | middle | top | bottom
\li Vertical text alignment. For vertical alignment in text table cells only middle, top, and bottom apply.
+ \row \li \c border-collapse
+ \li collapse | separate
+ \li Border Collapse mode for text tables. If set to collapse, cell-spacing will not be applied.
\row \li \c border-color
\li <color>
- \li Border color for text tables.
+ \li Border color for text tables and table cells.
+ \row \li \c border-top-color
+ \li <color>
+ \li Top border color for table cells.
+ \row \li \c border-bottom-color
+ \li <color>
+ \li Bottom border color for table cells.
+ \row \li \c border-left-color
+ \li <color>
+ \li Left border color for table cells.
+ \row \li \c border-right-color
+ \li <color>
+ \li Right border color for table cells.
\row \li \c border-style
\li none | dotted | dashed | dot-dash | dot-dot-dash | solid | double | groove | ridge | inset | outset
- \li Border style for text tables.
+ \li Border style for text tables and table cells.
+ \row \li \c border-top-style
+ \li <color>
+ \li Top border style for table cells.
+ \row \li \c border-bottom-style
+ \li <color>
+ \li Bottom border style for table cells.
+ \row \li \c border-left-style
+ \li <color>
+ \li Left border style for table cells.
+ \row \li \c border-right-style
+ \li <color>
+ \li Right border style for table cells.
+ \row \li \c border-width
+ \li <width>px
+ \li Width of table or cell border
+ \row \li \c border-top-width
+ \li <length>px
+ \li Top border width for table cells.
+ \row \li \c border-bottom-width
+ \li <length>px
+ \li Bottom border width for table cells.
+ \row \li \c border-left-width
+ \li <length>px
+ \li Left border width for table cells.
+ \row \li \c border-right-width
+ \li <length>px
+ \li Right border width for table cells.
+ \row \li \c border-top
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting top border width, style and color
+ \row \li \c border-bottom
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting bottom border width, style and color
+ \row \li \c border-left
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting left border width, style and color
+ \row \li \c border-right
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting right border width, style and color
+ \row \li \c border-top
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting top border width, style and color
+ \row \li \c border-bottom
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting bottom border width, style and color
+ \row \li \c border
+ \li <width>px <border-style> <border-color>
+ \li Shorthand for setting all four border's width, style and color
\row \li \c background
\li [ <'background-color'> || <'background-image'> ]
\li Background shorthand property
@@ -1190,7 +1253,7 @@
\row \li \c page-break-after
\li [ auto | always ]
\li Make it possible to enforce a page break after the paragraph/table
- \row \li float
+ \row \li \c float
\li [ left | right | none ]
\li Specifies where an image or a text will be placed in another element. Note that the \c float property is
only supported for tables and images.
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index edf8124081..45c8c05162 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -49,6 +49,7 @@ qtConfig(animation): include(animation/animation.pri)
include(itemmodels/itemmodels.pri)
include(vulkan/vulkan.pri)
include(platform/platform.pri)
+include(rhi/rhi.pri)
QMAKE_LIBS += $$QMAKE_LIBS_GUI
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 70fccbc378..3b2ced3f58 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -82,7 +82,18 @@ qtConfig(png) {
}
# SIMD
-SSSE3_SOURCES += image/qimage_ssse3.cpp
-NEON_SOURCES += image/qimage_neon.cpp
-MIPS_DSPR2_SOURCES += image/qimage_mips_dspr2.cpp
-MIPS_DSPR2_ASM += image/qimage_mips_dspr2_asm.S
+!android {
+ SSSE3_SOURCES += image/qimage_ssse3.cpp
+ NEON_SOURCES += image/qimage_neon.cpp
+ MIPS_DSPR2_SOURCES += image/qimage_mips_dspr2.cpp
+ MIPS_DSPR2_ASM += image/qimage_mips_dspr2_asm.S
+} else {
+ # see https://developer.android.com/ndk/guides/abis
+ arm64-v8a {
+ SOURCES += image/qimage_neon.cpp
+ }
+ x86 | x86_64 {
+ DEFINES += QT_COMPILER_SUPPORTS_SSE2 QT_COMPILER_SUPPORTS_SSE3 QT_COMPILER_SUPPORTS_SSSE3
+ SOURCES += image/qimage_ssse3.cpp
+ }
+}
diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h
index f7895bb1e0..3cc360f670 100644
--- a/src/gui/image/qbitmap.h
+++ b/src/gui/image/qbitmap.h
@@ -61,7 +61,7 @@ public:
QBitmap(const QBitmap &other) : QPixmap(other) {}
// QBitmap(QBitmap &&other) : QPixmap(std::move(other)) {} // QPixmap doesn't, yet, have a move ctor
QBitmap &operator=(const QBitmap &other) { QPixmap::operator=(other); return *this; }
- QBitmap &operator=(QBitmap &&other) Q_DECL_NOTHROW { QPixmap::operator=(std::move(other)); return *this; }
+ QBitmap &operator=(QBitmap &&other) noexcept { QPixmap::operator=(std::move(other)); return *this; }
~QBitmap();
#endif
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 80fa65daac..df8220a0c6 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -663,7 +663,7 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
/*!
Constructs a null icon.
*/
-QIcon::QIcon() Q_DECL_NOEXCEPT
+QIcon::QIcon() noexcept
: d(0)
{
}
@@ -987,7 +987,7 @@ bool QIcon::isNull() const
*/
bool QIcon::isDetached() const
{
- return !d || d->ref.load() == 1;
+ return !d || d->ref.loadRelaxed() == 1;
}
/*! \internal
@@ -1000,7 +1000,7 @@ void QIcon::detach()
delete d;
d = 0;
return;
- } else if (d->ref.load() != 1) {
+ } else if (d->ref.loadRelaxed() != 1) {
QIconPrivate *x = new QIconPrivate(d->engine->clone());
if (!d->ref.deref())
delete d;
@@ -1496,7 +1496,7 @@ QDebug operator<<(QDebug dbg, const QIcon &i)
if (!i.name().isEmpty())
dbg << i.name() << ',';
dbg << "availableSizes[normal,Off]=" << i.availableSizes()
- << ",cacheKey=" << showbase << hex << i.cacheKey() << dec << noshowbase;
+ << ",cacheKey=" << Qt::showbase << Qt::hex << i.cacheKey() << Qt::dec << Qt::noshowbase;
}
dbg << ')';
return dbg;
diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h
index 8870950982..735a3e134d 100644
--- a/src/gui/image/qicon.h
+++ b/src/gui/image/qicon.h
@@ -58,23 +58,19 @@ public:
enum Mode { Normal, Disabled, Active, Selected };
enum State { On, Off };
- QIcon() Q_DECL_NOEXCEPT;
+ QIcon() noexcept;
QIcon(const QPixmap &pixmap);
QIcon(const QIcon &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QIcon(QIcon &&other) Q_DECL_NOEXCEPT
+ QIcon(QIcon &&other) noexcept
: d(other.d)
{ other.d = nullptr; }
-#endif
explicit QIcon(const QString &fileName); // file or resource name
explicit QIcon(QIconEngine *engine);
~QIcon();
QIcon &operator=(const QIcon &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QIcon &operator=(QIcon &&other) Q_DECL_NOEXCEPT
+ inline QIcon &operator=(QIcon &&other) noexcept
{ swap(other); return *this; }
-#endif
- inline void swap(QIcon &other) Q_DECL_NOEXCEPT
+ inline void swap(QIcon &other) noexcept
{ qSwap(d, other.d); }
operator QVariant() const;
diff --git a/src/gui/image/qiconengine.h b/src/gui/image/qiconengine.h
index 0c5b51dc71..89fed5ccda 100644
--- a/src/gui/image/qiconengine.h
+++ b/src/gui/image/qiconengine.h
@@ -94,7 +94,7 @@ public:
virtual void virtual_hook(int id, void *data);
private:
- QIconEngine &operator=(const QIconEngine &other) Q_DECL_EQ_DELETE;
+ QIconEngine &operator=(const QIconEngine &other) = delete;
};
#if QT_DEPRECATED_SINCE(5, 0)
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index f23debd931..d8ed0829af 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -38,8 +38,10 @@
****************************************************************************/
#include "qimage.h"
-#include "qdatastream.h"
+
#include "qbuffer.h"
+#include "qdatastream.h"
+#include "qcolortransform.h"
#include "qmap.h"
#include "qmatrix.h"
#include "qtransform.h"
@@ -54,6 +56,7 @@
#include <stdlib.h>
#include <limits.h>
#include <qpa/qplatformpixmap.h>
+#include <private/qcolortransform_p.h>
#include <private/qdrawhelper_p.h>
#include <private/qmemrotate_p.h>
#include <private/qimagescale_p.h>
@@ -284,6 +287,7 @@ bool QImageData::checkForAlphaPixels() const
case QImage::Format_RGB555:
case QImage::Format_RGB666:
case QImage::Format_RGB888:
+ case QImage::Format_BGR888:
case QImage::Format_RGBX8888:
case QImage::Format_BGR30:
case QImage::Format_RGB30:
@@ -717,6 +721,7 @@ bool QImageData::checkForAlphaPixels() const
\value Format_RGBA64 The image is stored using a 64-bit halfword-ordered RGBA format (16-16-16-16). (added in Qt 5.12)
\value Format_RGBA64_Premultiplied The image is stored using a premultiplied 64-bit halfword-ordered
RGBA format (16-16-16-16). (added in Qt 5.12)
+ \value Format_BGR888 The image is stored using a 24-bit BGR format. (added in Qt 5.14)
\note Drawing into a QImage with QImage::Format_Indexed8 is not
supported.
@@ -738,7 +743,7 @@ bool QImageData::checkForAlphaPixels() const
\sa isNull()
*/
-QImage::QImage() Q_DECL_NOEXCEPT
+QImage::QImage() noexcept
: QPaintDevice()
{
d = 0;
@@ -1079,10 +1084,10 @@ QImage::operator QVariant() const
void QImage::detach()
{
if (d) {
- if (d->is_cached && d->ref.load() == 1)
+ if (d->is_cached && d->ref.loadRelaxed() == 1)
QImagePixmapCleanupHooks::executeImageHooks(cacheKey());
- if (d->ref.load() != 1 || d->ro_data)
+ if (d->ref.loadRelaxed() != 1 || d->ro_data)
*this = copy();
if (d)
@@ -1103,6 +1108,7 @@ static void copyMetadata(QImageData *dst, const QImageData *src)
// Doesn't copy colortable and alpha_clut, or offset.
copyPhysicalMetadata(dst, src);
dst->text = src->text;
+ dst->colorSpace = src->colorSpace;
}
static void copyMetadata(QImage *dst, const QImage &src)
@@ -1392,7 +1398,7 @@ void QImage::setColorTable(const QVector<QRgb> colors)
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
d->colortable = colors;
#else
- d->colortable = qMove(const_cast<QVector<QRgb>&>(colors));
+ d->colortable = std::move(const_cast<QVector<QRgb>&>(colors));
#endif
d->has_alpha_clut = false;
for (int i = 0; i < d->colortable.size(); ++i) {
@@ -2054,27 +2060,6 @@ QImage::Format QImage::format() const
\sa {Image Formats}
*/
-static bool highColorPrecision(QImage::Format format)
-{
- // Formats with higher color precision than ARGB32_Premultiplied.
- switch (format) {
- case QImage::Format_ARGB32:
- case QImage::Format_RGBA8888:
- case QImage::Format_BGR30:
- case QImage::Format_RGB30:
- case QImage::Format_A2BGR30_Premultiplied:
- case QImage::Format_A2RGB30_Premultiplied:
- case QImage::Format_RGBX64:
- case QImage::Format_RGBA64:
- case QImage::Format_RGBA64_Premultiplied:
- case QImage::Format_Grayscale16:
- return true;
- default:
- break;
- }
- return false;
-}
-
/*!
\internal
*/
@@ -2086,9 +2071,11 @@ QImage QImage::convertToFormat_helper(Format format, Qt::ImageConversionFlags fl
if (format == Format_Invalid || d->format == Format_Invalid)
return QImage();
+ const QPixelLayout *destLayout = &qPixelLayouts[format];
Image_Converter converter = qimage_converter_map[d->format][format];
if (!converter && format > QImage::Format_Indexed8 && d->format > QImage::Format_Indexed8) {
- if (highColorPrecision(format) && highColorPrecision(d->format)) {
+ if (qt_highColorPrecision(d->format, !destLayout->hasAlphaChannel)
+ && qt_highColorPrecision(format, !hasAlphaChannel())) {
converter = convert_generic_to_rgb64;
} else
converter = convert_generic;
@@ -3364,7 +3351,7 @@ void QImage::mirrored_inplace(bool horizontal, bool vertical)
\sa {QImage#Image Transformations}{Image Transformations}
*/
-inline void rgbSwapped_generic(int width, int height, const QImage *src, QImage *dst, const QPixelLayout* layout)
+static inline void rgbSwapped_generic(int width, int height, const QImage *src, QImage *dst, const QPixelLayout* layout)
{
const RbSwapFunc func = layout->rbSwap;
if (!func) {
@@ -4139,11 +4126,11 @@ QPaintEngine *QImage::paintEngine() const
if (!d->paintEngine) {
QPaintDevice *paintDevice = const_cast<QImage *>(this);
- QPaintEngine *paintEngine = 0;
QPlatformIntegration *platformIntegration = QGuiApplicationPrivate::platformIntegration();
if (platformIntegration)
- paintEngine = platformIntegration->createImagePaintEngine(paintDevice);
- d->paintEngine = paintEngine ? paintEngine : new QRasterPaintEngine(paintDevice);
+ d->paintEngine = platformIntegration->createImagePaintEngine(paintDevice);
+ if (!d->paintEngine)
+ d->paintEngine = new QRasterPaintEngine(paintDevice);
}
return d->paintEngine;
@@ -4418,7 +4405,7 @@ qint64 QImage::cacheKey() const
bool QImage::isDetached() const
{
- return d && d->ref.load() == 1;
+ return d && d->ref.loadRelaxed() == 1;
}
@@ -4686,12 +4673,14 @@ QImage QImage::smoothScaled(int w, int h) const {
case QImage::Format_RGBX8888:
#endif
case QImage::Format_RGBA8888_Premultiplied:
+#if QT_CONFIG(raster_64bit)
case QImage::Format_RGBX64:
case QImage::Format_RGBA64_Premultiplied:
break;
case QImage::Format_RGBA64:
src = src.convertToFormat(QImage::Format_RGBA64_Premultiplied);
break;
+#endif
default:
if (src.hasAlphaChannel())
src = src.convertToFormat(QImage::Format_ARGB32_Premultiplied);
@@ -4949,13 +4938,139 @@ QTransform QImage::trueMatrix(const QTransform &matrix, int w, int h)
return matrix * QTransform().translate(-delta.x(), -delta.y());
}
+/*!
+ \since 5.14
+
+ Sets the image color space to \a colorSpace without performing any conversions on image data.
+
+ \sa colorSpace()
+*/
+void QImage::setColorSpace(const QColorSpace &colorSpace)
+{
+ if (!d)
+ return;
+ if (d->colorSpace == colorSpace)
+ return;
+ if (!isDetached()) // Detach only if shared, not for read-only data.
+ detach();
+ d->colorSpace = colorSpace;
+}
+
+/*!
+ \since 5.14
+
+ Converts the image to \a colorSpace.
+
+ If the image has no valid color space, the method does nothing.
+
+ \sa convertedToColorSpace(), setColorSpace()
+*/
+void QImage::convertToColorSpace(const QColorSpace &colorSpace)
+{
+ if (!d)
+ return;
+ if (!d->colorSpace.isValid())
+ return;
+ if (!colorSpace.isValid()) {
+ qWarning() << "QImage::convertToColorSpace: Output colorspace is not valid";
+ return;
+ }
+ detach();
+ applyColorTransform(d->colorSpace.transformationToColorSpace(colorSpace));
+ d->colorSpace = colorSpace;
+}
+
+/*!
+ \since 5.14
+
+ Returns the image converted to \a colorSpace.
+
+ If the image has no valid color space, a null QImage is returned.
+
+ \sa convertToColorSpace()
+*/
+QImage QImage::convertedToColorSpace(const QColorSpace &colorSpace) const
+{
+ if (!d || !d->colorSpace.isValid() || !colorSpace.isValid())
+ return QImage();
+ QImage image = copy();
+ image.convertToColorSpace(colorSpace);
+ return image;
+}
+
+/*!
+ \since 5.14
+
+ Returns the color space of the image if a color space is defined.
+*/
+QColorSpace QImage::colorSpace() const
+{
+ if (!d)
+ return QColorSpace();
+ return d->colorSpace;
+}
+
+/*!
+ \since 5.14
+
+ Applies the color transformation \a transform to all pixels in the image.
+*/
+void QImage::applyColorTransform(const QColorTransform &transform)
+{
+ QImage::Format oldFormat = format();
+ if (depth() > 32) {
+ if (format() != QImage::Format_RGBX64 && format() != QImage::Format_RGBA64
+ && format() != QImage::Format_RGBA64_Premultiplied)
+ *this = std::move(*this).convertToFormat(QImage::Format_RGBA64);
+ } else if (format() != QImage::Format_ARGB32 && format() != QImage::Format_RGB32
+ && format() != QImage::Format_ARGB32_Premultiplied) {
+ if (hasAlphaChannel())
+ *this = std::move(*this).convertToFormat(QImage::Format_ARGB32);
+ else
+ *this = std::move(*this).convertToFormat(QImage::Format_RGB32);
+ }
+
+ QColorTransformPrivate::TransformFlags flags = QColorTransformPrivate::Unpremultiplied;
+ switch (format()) {
+ case Format_ARGB32_Premultiplied:
+ case Format_RGBA64_Premultiplied:
+ flags = QColorTransformPrivate::Premultiplied;
+ break;
+ case Format_RGB32:
+ case Format_RGBX64:
+ flags = QColorTransformPrivate::InputOpaque;
+ break;
+ case Format_ARGB32:
+ case Format_RGBA64:
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+
+ if (depth() > 32) {
+ for (int i = 0; i < height(); ++i) {
+ QRgba64 *scanline = reinterpret_cast<QRgba64 *>(scanLine(i));
+ transform.d->apply(scanline, scanline, width(), flags);
+ }
+ } else {
+ for (int i = 0; i < height(); ++i) {
+ QRgb *scanline = reinterpret_cast<QRgb *>(scanLine(i));
+ transform.d->apply(scanline, scanline, width(), flags);
+ }
+ }
+
+ if (oldFormat != format())
+ *this = std::move(*this).convertToFormat(oldFormat);
+}
+
+
bool QImageData::convertInPlace(QImage::Format newFormat, Qt::ImageConversionFlags flags)
{
if (format == newFormat)
return true;
// No in-place conversion if we have to detach
- if (ref.load() > 1 || !own_data)
+ if (ref.loadRelaxed() > 1 || !own_data)
return false;
InPlace_Image_Converter converter = qimage_inplace_converter_map[format][newFormat];
@@ -5418,13 +5533,26 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = {
/*PREMULTIPLIED*/ QPixelFormat::NotPremultiplied,
/*INTERPRETATION*/ QPixelFormat::UnsignedShort,
/*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),
+ //QImage::Format_BGR888:
+ QPixelFormat(QPixelFormat::BGR,
+ /*RED*/ 8,
+ /*GREEN*/ 8,
+ /*BLUE*/ 8,
+ /*FOURTH*/ 0,
+ /*FIFTH*/ 0,
+ /*ALPHA*/ 0,
+ /*ALPHA USAGE*/ QPixelFormat::IgnoresAlpha,
+ /*ALPHA POSITION*/ QPixelFormat::AtBeginning,
+ /*PREMULTIPLIED*/ QPixelFormat::NotPremultiplied,
+ /*INTERPRETATION*/ QPixelFormat::UnsignedByte,
+ /*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),
};
Q_STATIC_ASSERT(sizeof(pixelformats) / sizeof(*pixelformats) == QImage::NImageFormats);
/*!
Returns the QImage::Format as a QPixelFormat
*/
-QPixelFormat QImage::pixelFormat() const Q_DECL_NOTHROW
+QPixelFormat QImage::pixelFormat() const noexcept
{
return toPixelFormat(format());
}
@@ -5432,7 +5560,7 @@ QPixelFormat QImage::pixelFormat() const Q_DECL_NOTHROW
/*!
Converts \a format into a QPixelFormat
*/
-QPixelFormat QImage::toPixelFormat(QImage::Format format) Q_DECL_NOTHROW
+QPixelFormat QImage::toPixelFormat(QImage::Format format) noexcept
{
Q_ASSERT(static_cast<int>(format) < NImageFormats);
return pixelformats[format];
@@ -5441,7 +5569,7 @@ QPixelFormat QImage::toPixelFormat(QImage::Format format) Q_DECL_NOTHROW
/*!
Converts \a format into a QImage::Format
*/
-QImage::Format QImage::toImageFormat(QPixelFormat format) Q_DECL_NOTHROW
+QImage::Format QImage::toImageFormat(QPixelFormat format) noexcept
{
for (int i = 0; i < NImageFormats; i++) {
if (format == pixelformats[i])
@@ -5457,7 +5585,7 @@ Q_GUI_EXPORT void qt_imageTransform(QImage &src, QImageIOHandler::Transformation
if (orient == QImageIOHandler::TransformationRotate270) {
src = rotated270(src);
} else {
- src = qMove(src).mirrored(orient & QImageIOHandler::TransformationMirror,
+ src = std::move(src).mirrored(orient & QImageIOHandler::TransformationMirror,
orient & QImageIOHandler::TransformationFlip);
if (orient & QImageIOHandler::TransformationRotate90)
src = rotated90(src);
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 8335e117f2..7544ccca05 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -61,9 +61,11 @@ Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(CGImage);
QT_BEGIN_NAMESPACE
+class QColorSpace;
+class QColorTransform;
class QIODevice;
-class QStringList;
class QMatrix;
+class QStringList;
class QTransform;
class QVariant;
template <class T> class QList;
@@ -129,13 +131,14 @@ public:
Format_RGBA64,
Format_RGBA64_Premultiplied,
Format_Grayscale16,
+ Format_BGR888,
#ifndef Q_QDOC
NImageFormats
#endif
};
Q_ENUM(Format)
- QImage() Q_DECL_NOEXCEPT;
+ QImage() noexcept;
QImage(const QSize &size, Format format);
QImage(int width, int height, Format format);
QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
@@ -149,19 +152,15 @@ public:
explicit QImage(const QString &fileName, const char *format = nullptr);
QImage(const QImage &);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QImage(QImage &&other) Q_DECL_NOEXCEPT
+ inline QImage(QImage &&other) noexcept
: QPaintDevice(), d(nullptr)
{ qSwap(d, other.d); }
-#endif
~QImage();
QImage &operator=(const QImage &);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QImage &operator=(QImage &&other) Q_DECL_NOEXCEPT
+ inline QImage &operator=(QImage &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QImage &other) Q_DECL_NOEXCEPT
+ inline void swap(QImage &other) noexcept
{ qSwap(d, other.d); }
bool isNull() const;
@@ -289,17 +288,23 @@ public:
QImage mirrored(bool horizontally = false, bool vertically = true) const &
{ return mirrored_helper(horizontally, vertically); }
QImage &&mirrored(bool horizontally = false, bool vertically = true) &&
- { mirrored_inplace(horizontally, vertically); return qMove(*this); }
+ { mirrored_inplace(horizontally, vertically); return std::move(*this); }
QImage rgbSwapped() const &
{ return rgbSwapped_helper(); }
QImage &&rgbSwapped() &&
- { rgbSwapped_inplace(); return qMove(*this); }
+ { rgbSwapped_inplace(); return std::move(*this); }
#else
QImage mirrored(bool horizontally = false, bool vertically = true) const;
QImage rgbSwapped() const;
#endif
void invertPixels(InvertMode = InvertRgb);
+ QColorSpace colorSpace() const;
+ QImage convertedToColorSpace(const QColorSpace &) const;
+ void convertToColorSpace(const QColorSpace &);
+ void setColorSpace(const QColorSpace &);
+
+ void applyColorTransform(const QColorTransform &transform);
bool load(QIODevice *device, const char* format);
bool load(const QString &fileName, const char *format = nullptr);
@@ -333,9 +338,9 @@ public:
QString text(const QString &key = QString()) const;
void setText(const QString &key, const QString &value);
- QPixelFormat pixelFormat() const Q_DECL_NOTHROW;
- static QPixelFormat toPixelFormat(QImage::Format format) Q_DECL_NOTHROW;
- static QImage::Format toImageFormat(QPixelFormat format) Q_DECL_NOTHROW;
+ QPixelFormat pixelFormat() const noexcept;
+ static QPixelFormat toPixelFormat(QImage::Format format) noexcept;
+ static QImage::Format toImageFormat(QPixelFormat format) noexcept;
// Platform specific conversion functions
#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp
index 82ffb8af8b..97a5f89e68 100644
--- a/src/gui/image/qimage_conversions.cpp
+++ b/src/gui/image/qimage_conversions.cpp
@@ -39,7 +39,7 @@
#include <private/qdrawhelper_p.h>
#include <private/qguiapplication_p.h>
-#include <private/qcolorprofile_p.h>
+#include <private/qcolortrclut_p.h>
#include <private/qendian_p.h>
#include <private/qsimd_p.h>
#include <private/qimage_p.h>
@@ -100,7 +100,7 @@ const uchar *qt_get_bitflip_array()
void qGamma_correct_back_to_linear_cs(QImage *image)
{
- const QColorProfile *cp = QGuiApplicationPrivate::instance()->colorProfileForA32Text();
+ const QColorTrcLut *cp = QGuiApplicationPrivate::instance()->colorProfileForA32Text();
if (!cp)
return;
// gamma correct the pixels back to linear color space...
@@ -260,10 +260,17 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im
if (data->depth != qt_depthForFormat(dst_format))
return false;
- uint buf[BufferSize];
- uint *buffer = buf;
const QPixelLayout *srcLayout = &qPixelLayouts[data->format];
const QPixelLayout *destLayout = &qPixelLayouts[dst_format];
+
+ // The precision here is only ARGB32PM so don't convert between higher accuracy
+ // formats (assert instead when we have a convert_generic_over_rgb64_inplace).
+ if (qt_highColorPrecision(data->format, !destLayout->hasAlphaChannel)
+ && qt_highColorPrecision(dst_format, !srcLayout->hasAlphaChannel))
+ return false;
+
+ uint buf[BufferSize];
+ uint *buffer = buf;
uchar *srcData = data->data;
Q_ASSERT(srcLayout->bpp == destLayout->bpp);
@@ -429,8 +436,8 @@ typedef void (QT_FASTCALL *Rgb888ToRgbConverter)(quint32 *dst, const uchar *src,
template <bool rgbx>
static void convert_RGB888_to_RGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
{
- Q_ASSERT(src->format == QImage::Format_RGB888);
- if (rgbx)
+ Q_ASSERT(src->format == QImage::Format_RGB888 || src->format == QImage::Format_BGR888);
+ if (rgbx ^ (src->format == QImage::Format_BGR888))
Q_ASSERT(dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied);
else
Q_ASSERT(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied);
@@ -564,13 +571,75 @@ static bool convert_RGBA_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFl
return true;
}
+static void convert_rgbswap_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
+{
+ Q_ASSERT(src->width == dest->width);
+ Q_ASSERT(src->height == dest->height);
+
+ const RbSwapFunc func = qPixelLayouts[src->format].rbSwap;
+ Q_ASSERT(func);
+
+ const qsizetype sbpl = src->bytes_per_line;
+ const qsizetype dbpl = dest->bytes_per_line;
+ const uchar *src_data = src->data;
+ uchar *dest_data = dest->data;
+
+ for (int i = 0; i < src->height; ++i) {
+ func(dest_data, src_data, src->width);
+
+ src_data += sbpl;
+ dest_data += dbpl;
+ }
+}
+
+static bool convert_rgbswap_generic_inplace(QImageData *data, Qt::ImageConversionFlags)
+{
+ const RbSwapFunc func = qPixelLayouts[data->format].rbSwap;
+ Q_ASSERT(func);
+
+ const qsizetype bpl = data->bytes_per_line;
+ uchar *line_data = data->data;
+
+ for (int i = 0; i < data->height; ++i) {
+ func(line_data, line_data, data->width);
+ line_data += bpl;
+ }
+
+ switch (data->format) {
+ case QImage::Format_RGB888:
+ data->format = QImage::Format_BGR888;
+ break;
+ case QImage::Format_BGR888:
+ data->format = QImage::Format_RGB888;
+ break;
+ case QImage::Format_BGR30:
+ data->format = QImage::Format_RGB30;
+ break;
+ case QImage::Format_A2BGR30_Premultiplied:
+ data->format = QImage::Format_A2RGB30_Premultiplied;
+ break;
+ case QImage::Format_RGB30:
+ data->format = QImage::Format_BGR30;
+ break;
+ case QImage::Format_A2RGB30_Premultiplied:
+ data->format = QImage::Format_A2BGR30_Premultiplied;
+ break;
+ default:
+ Q_UNREACHABLE();
+ data->format = QImage::Format_Invalid;
+ return false;
+ }
+ return true;
+}
+
template<QtPixelOrder PixelOrder, bool RGBA>
-static void convert_RGB_to_RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
+static void convert_ARGB_to_A2RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
{
- Q_ASSERT(RGBA || src->format == QImage::Format_RGB32 || src->format == QImage::Format_ARGB32);
- Q_ASSERT(!RGBA || src->format == QImage::Format_RGBX8888 || src->format == QImage::Format_RGBA8888);
- Q_ASSERT(dest->format == QImage::Format_BGR30 || dest->format == QImage::Format_RGB30);
+ Q_ASSERT(RGBA || src->format == QImage::Format_ARGB32);
+ Q_ASSERT(!RGBA || src->format == QImage::Format_RGBA8888);
+ Q_ASSERT(dest->format == QImage::Format_A2BGR30_Premultiplied
+ || dest->format == QImage::Format_A2RGB30_Premultiplied);
Q_ASSERT(src->width == dest->width);
Q_ASSERT(src->height == dest->height);
@@ -585,7 +654,9 @@ static void convert_RGB_to_RGB30(QImageData *dest, const QImageData *src, Qt::Im
QRgb c = *src_data;
if (RGBA)
c = RGBA2ARGB(c);
- *dest_data = qConvertRgb32ToRgb30<PixelOrder>(c);
+ const uint alpha = (qAlpha(c) >> 6) * 85;
+ c = BYTE_MUL(c, alpha);
+ *dest_data = (qConvertRgb32ToRgb30<PixelOrder>(c) & 0x3fffffff) | (alpha << 30);
++src_data;
++dest_data;
}
@@ -595,10 +666,10 @@ static void convert_RGB_to_RGB30(QImageData *dest, const QImageData *src, Qt::Im
}
template<QtPixelOrder PixelOrder, bool RGBA>
-static bool convert_RGB_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)
+static bool convert_ARGB_to_A2RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)
{
- Q_ASSERT(RGBA || (data->format == QImage::Format_RGB32 || data->format == QImage::Format_ARGB32));
- Q_ASSERT(!RGBA || (data->format == QImage::Format_RGBX8888 || data->format == QImage::Format_RGBA8888));
+ Q_ASSERT(RGBA || data->format == QImage::Format_ARGB32);
+ Q_ASSERT(!RGBA || data->format == QImage::Format_RGBA8888);
const int pad = (data->bytes_per_line >> 2) - data->width;
QRgb *rgb_data = (QRgb *) data->data;
@@ -609,13 +680,16 @@ static bool convert_RGB_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFl
QRgb c = *rgb_data;
if (RGBA)
c = RGBA2ARGB(c);
- *rgb_data = qConvertRgb32ToRgb30<PixelOrder>(c);
+ const uint alpha = (qAlpha(c) >> 6) * 85;
+ c = BYTE_MUL(c, alpha);
+ *rgb_data = (qConvertRgb32ToRgb30<PixelOrder>(c) & 0x3fffffff) | (alpha << 30);
++rgb_data;
}
rgb_data += pad;
}
- data->format = (PixelOrder == PixelOrderRGB) ? QImage::Format_RGB30 : QImage::Format_BGR30;
+ data->format = (PixelOrder == PixelOrderRGB) ? QImage::Format_A2RGB30_Premultiplied
+ : QImage::Format_A2BGR30_Premultiplied;
return true;
}
@@ -693,74 +767,10 @@ static bool convert_A2RGB30_PM_to_RGB30_inplace(QImageData *data, Qt::ImageConve
return true;
}
-static void convert_BGR30_to_RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
-{
- Q_ASSERT(src->format == QImage::Format_RGB30 || src->format == QImage::Format_BGR30 ||
- src->format == QImage::Format_A2RGB30_Premultiplied || src->format == QImage::Format_A2BGR30_Premultiplied);
- Q_ASSERT(dest->format == QImage::Format_RGB30 || dest->format == QImage::Format_BGR30 ||
- dest->format == QImage::Format_A2RGB30_Premultiplied || dest->format == QImage::Format_A2BGR30_Premultiplied);
- Q_ASSERT(src->width == dest->width);
- Q_ASSERT(src->height == dest->height);
-
- const int src_pad = (src->bytes_per_line >> 2) - src->width;
- const int dest_pad = (dest->bytes_per_line >> 2) - dest->width;
- const quint32 *src_data = (quint32 *) src->data;
- quint32 *dest_data = (quint32 *) dest->data;
-
- for (int i = 0; i < src->height; ++i) {
- const quint32 *end = src_data + src->width;
- while (src_data < end) {
- *dest_data = qRgbSwapRgb30(*src_data);
- ++src_data;
- ++dest_data;
- }
- src_data += src_pad;
- dest_data += dest_pad;
- }
-}
-
-static bool convert_BGR30_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)
-{
- Q_ASSERT(data->format == QImage::Format_RGB30 || data->format == QImage::Format_BGR30 ||
- data->format == QImage::Format_A2RGB30_Premultiplied || data->format == QImage::Format_A2BGR30_Premultiplied);
-
- const int pad = (data->bytes_per_line >> 2) - data->width;
- uint *rgb_data = (uint *) data->data;
-
- for (int i = 0; i < data->height; ++i) {
- const uint *end = rgb_data + data->width;
- while (rgb_data < end) {
- *rgb_data = qRgbSwapRgb30(*rgb_data);
- ++rgb_data;
- }
- rgb_data += pad;
- }
-
- switch (data->format) {
- case QImage::Format_BGR30:
- data->format = QImage::Format_RGB30;
- break;
- case QImage::Format_A2BGR30_Premultiplied:
- data->format = QImage::Format_A2RGB30_Premultiplied;
- break;
- case QImage::Format_RGB30:
- data->format = QImage::Format_BGR30;
- break;
- case QImage::Format_A2RGB30_Premultiplied:
- data->format = QImage::Format_A2BGR30_Premultiplied;
- break;
- default:
- Q_UNREACHABLE();
- data->format = QImage::Format_Invalid;
- return false;
- }
- return true;
-}
-
static bool convert_BGR30_to_A2RGB30_inplace(QImageData *data, Qt::ImageConversionFlags flags)
{
Q_ASSERT(data->format == QImage::Format_RGB30 || data->format == QImage::Format_BGR30);
- if (!convert_BGR30_to_RGB30_inplace(data, flags))
+ if (!convert_rgbswap_generic_inplace(data, flags))
return false;
if (data->format == QImage::Format_RGB30)
@@ -2265,7 +2275,7 @@ static bool convert_Grayscale8_to_Indexed8_inplace(QImageData *data, Qt::ImageCo
Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormats] =
{
{
- 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,
@@ -2286,7 +2296,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_Mono
{
@@ -2308,7 +2318,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_MonoLSB
{
@@ -2333,7 +2343,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0, 0, 0, 0, 0,
convert_Indexed8_to_Alpha8,
convert_Indexed8_to_Grayscale8,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_Indexed8
{
@@ -2356,12 +2366,12 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
0,
- convert_RGB_to_RGB30<PixelOrderBGR, false>,
0,
- convert_RGB_to_RGB30<PixelOrderRGB, false>,
+ 0,
+ 0,
0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_RGB32
{
@@ -2384,14 +2394,14 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_ARGB_to_RGBx,
convert_ARGB_to_RGBA,
0,
- convert_RGB_to_RGB30<PixelOrderBGR, false>,
0,
- convert_RGB_to_RGB30<PixelOrderRGB, false>,
+ convert_ARGB_to_A2RGB30<PixelOrderBGR, false>,
0,
+ convert_ARGB_to_A2RGB30<PixelOrderRGB, false>,
0, 0,
0,
convert_ARGB32_to_RGBA64<false>,
- 0, 0
+ 0, 0, 0
}, // Format_ARGB32
{
@@ -2416,7 +2426,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_ARGB_to_RGBA,
0, 0, 0, 0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_ARGB32_Premultiplied
{
@@ -2438,7 +2448,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_RGB16
{
@@ -2460,7 +2470,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_ARGB8565_Premultiplied
{
@@ -2482,7 +2492,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_RGB666
{
@@ -2504,7 +2514,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_ARGB6666_Premultiplied
{
@@ -2526,7 +2536,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_RGB555
{
@@ -2548,7 +2558,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_ARGB8555_Premultiplied
{
@@ -2565,13 +2575,14 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
0,
- 0,
+ 0, // self
0,
0,
convert_RGB888_to_RGB<true>,
convert_RGB888_to_RGB<true>,
convert_RGB888_to_RGB<true>,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ convert_rgbswap_generic,
}, // Format_RGB888
{
@@ -2593,7 +2604,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_RGB444
{
@@ -2614,7 +2625,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_ARGB4444_Premultiplied
{
0,
@@ -2636,12 +2647,12 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
convert_passthrough,
convert_passthrough,
- convert_RGB_to_RGB30<PixelOrderBGR, true>,
0,
- convert_RGB_to_RGB30<PixelOrderRGB, true>,
+ 0,
+ 0,
0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_RGBX8888
{
0,
@@ -2663,14 +2674,14 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
mask_alpha_converter_RGBx,
0,
0,
- convert_RGB_to_RGB30<PixelOrderBGR, true>,
0,
- convert_RGB_to_RGB30<PixelOrderRGB, true>,
+ convert_ARGB_to_A2RGB30<PixelOrderBGR, true>,
0,
+ convert_ARGB_to_A2RGB30<PixelOrderRGB, true>,
0, 0,
0,
convert_ARGB32_to_RGBA64<true>,
- 0, 0
+ 0, 0, 0
}, // Format_RGBA8888
{
@@ -2692,7 +2703,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}, // Format_RGBA8888_Premultiplied
{
@@ -2717,10 +2728,10 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
convert_passthrough,
- convert_BGR30_to_RGB30,
- convert_BGR30_to_RGB30,
+ convert_rgbswap_generic,
+ convert_rgbswap_generic,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_BGR30
{
0,
@@ -2745,9 +2756,9 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_A2RGB30_PM_to_RGB30<false>,
0,
convert_A2RGB30_PM_to_RGB30<true>,
- convert_BGR30_to_RGB30,
+ convert_rgbswap_generic,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_A2BGR30_Premultiplied
{
0,
@@ -2769,11 +2780,11 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
0,
- convert_BGR30_to_RGB30,
- convert_BGR30_to_RGB30,
+ convert_rgbswap_generic,
+ convert_rgbswap_generic,
0,
convert_passthrough,
- 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0
}, // Format_RGB30
{
0,
@@ -2796,11 +2807,11 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_A2RGB30_PM_to_ARGB<PixelOrderRGB, true>,
0,
convert_A2RGB30_PM_to_RGB30<true>,
- convert_BGR30_to_RGB30,
+ convert_rgbswap_generic,
convert_A2RGB30_PM_to_RGB30<false>,
0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_A2RGB30_Premultiplied
{
0,
@@ -2820,7 +2831,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
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
}, // Format_Alpha8
{
0,
@@ -2840,14 +2851,15 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
0,
0,
0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}, // Format_Grayscale8
{
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, // self
convert_passthrough,
convert_passthrough,
- convert_RGBA64_to_gray16
+ convert_RGBA64_to_gray16,
+ 0
}, // Format_RGBX64
{
0,
@@ -2874,6 +2886,7 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_RGBA64_to_RGBx64,
0, // self
convert_RGBA64_to_RGBA64PM,
+ 0,
0
}, // Format_RGBA64
{
@@ -2901,7 +2914,8 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_RGBA64PM_to_RGBA64<true>,
convert_RGBA64PM_to_RGBA64<false>,
0, // self
- convert_RGBA64_to_gray16
+ convert_RGBA64_to_gray16,
+ 0
}, // Format_RGBA64_Premultiplied
{
0,
@@ -2931,20 +2945,46 @@ Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormat
convert_gray16_to_RGBA64,
convert_gray16_to_RGBA64,
convert_gray16_to_RGBA64,
- 0 // self
+ 0, // self
+ 0
}, // Format_Grayscale16
+ {
+ 0,
+ 0,
+ 0,
+ 0,
+ 0, 0, 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ convert_rgbswap_generic,
+ 0,
+ 0,
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
+ convert_RGB888_to_RGB<false>,
+ convert_RGB888_to_RGB<false>,
+ convert_RGB888_to_RGB<false>,
+#else
+ 0, 0, 0,
+#endif
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, // self
+ }, // Format_BGR888
};
InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QImage::NImageFormats] =
{
{
- 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, 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
}, // Format_Mono
{
- 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
}, // Format_MonoLSB
{
0,
@@ -2968,7 +3008,7 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0, 0, 0, 0, 0,
convert_Indexed8_to_Alpha8_inplace,
convert_Indexed8_to_Grayscale8_inplace,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_Indexed8
{
0,
@@ -2990,12 +3030,12 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0,
0,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderBGR, false>,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderRGB, false>,
+ 0,
+ 0,
0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_RGB32
{
0,
@@ -3017,12 +3057,12 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
convert_ARGB_to_RGBA_inplace<QImage::Format_RGBX8888>,
convert_ARGB_to_RGBA_inplace<QImage::Format_RGBA8888>,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderBGR, false>,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderRGB, false>,
+ convert_ARGB_to_A2RGB30_inplace<PixelOrderBGR, false>,
0,
+ convert_ARGB_to_A2RGB30_inplace<PixelOrderRGB, false>,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_ARGB32
{
0,
@@ -3046,34 +3086,35 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
convert_ARGB_to_RGBA_inplace<QImage::Format_RGBA8888_Premultiplied>,
0, 0, 0, 0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_ARGB32_Premultiplied
{
- 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
}, // Format_RGB16
{
- 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
}, // Format_ARGB8565_Premultiplied
{
- 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
}, // Format_RGB666
{
- 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
}, // Format_ARGB6666_Premultiplied
{
- 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
}, // Format_RGB555
{
- 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
}, // Format_ARGB8555_Premultiplied
{
- 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,
+ convert_rgbswap_generic_inplace
}, // Format_RGB888
{
- 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
}, // Format_RGB444
{
- 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
}, // Format_ARGB4444_Premultiplied
{
0,
@@ -3095,12 +3136,12 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0,
convert_passthrough_inplace<QImage::Format_RGBA8888>,
convert_passthrough_inplace<QImage::Format_RGBA8888_Premultiplied>,
- convert_RGB_to_RGB30_inplace<PixelOrderBGR, true>,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderRGB, true>,
+ 0,
+ 0,
0,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_RGBX8888
{
0,
@@ -3122,12 +3163,12 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
mask_alpha_converter_rgbx_inplace,
0,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderBGR, true>,
0,
- convert_RGB_to_RGB30_inplace<PixelOrderRGB, true>,
+ convert_ARGB_to_A2RGB30_inplace<PixelOrderBGR, true>,
0,
+ convert_ARGB_to_A2RGB30_inplace<PixelOrderRGB, true>,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_RGBA8888
{
0,
@@ -3149,7 +3190,7 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0,
0,
0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}, // Format_RGBA8888_Premultiplied
{
0,
@@ -3173,10 +3214,10 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0,
0, // self
convert_passthrough_inplace<QImage::Format_A2BGR30_Premultiplied>,
- convert_BGR30_to_RGB30_inplace,
+ convert_rgbswap_generic_inplace,
convert_BGR30_to_A2RGB30_inplace,
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_BGR30
{
0,
@@ -3201,8 +3242,8 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
convert_A2RGB30_PM_to_RGB30_inplace<false>,
0, // self
convert_A2RGB30_PM_to_RGB30_inplace<true>,
- convert_BGR30_to_RGB30_inplace,
- 0, 0, 0, 0, 0, 0
+ convert_rgbswap_generic_inplace,
+ 0, 0, 0, 0, 0, 0, 0
}, // Format_A2BGR30_Premultiplied
{
0,
@@ -3224,11 +3265,11 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0,
0,
0,
- convert_BGR30_to_RGB30_inplace,
+ convert_rgbswap_generic_inplace,
convert_BGR30_to_A2RGB30_inplace,
0, // self
convert_passthrough_inplace<QImage::Format_A2RGB30_Premultiplied>,
- 0, 0, 0, 0, 0, 0
+ 0, 0, 0, 0, 0, 0, 0
}, // Format_RGB30
{
0,
@@ -3251,11 +3292,11 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderRGB, true>,
0,
convert_A2RGB30_PM_to_RGB30_inplace<true>,
- convert_BGR30_to_RGB30_inplace,
+ convert_rgbswap_generic_inplace,
convert_A2RGB30_PM_to_RGB30_inplace<false>,
0, // self
0, 0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_A2RGB30_Premultiplied
{
0,
@@ -3280,7 +3321,7 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0, 0, 0, 0,
0, // self
0,
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_Alpha8
{
0,
@@ -3305,32 +3346,37 @@ InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QIma
0, 0, 0, 0,
0,
0, // self
- 0, 0, 0, 0
+ 0, 0, 0, 0, 0
}, // Format_Grayscale8
{
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, // self
convert_passthrough_inplace<QImage::Format_RGBA64>,
convert_passthrough_inplace<QImage::Format_RGBA64_Premultiplied>,
- 0
+ 0, 0
}, // Format_RGBX64
{
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,
convert_RGBA64_to_RGBx64_inplace,
0, // self
convert_RGBA64_to_RGBA64PM_inplace,
- 0
+ 0, 0
}, // Format_RGBA64
{
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,
convert_RGBA64PM_to_RGBA64_inplace<true>,
convert_RGBA64PM_to_RGBA64_inplace<false>,
0, // self
- 0
+ 0, 0
}, // Format_RGBA64_Premultiplied
{
- 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
}, // Format_Grayscale16
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ convert_rgbswap_generic_inplace,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }, // Format_BGR888
};
static void qInitImageConversions()
@@ -3341,6 +3387,9 @@ static void qInitImageConversions()
qimage_converter_map[QImage::Format_RGB888][QImage::Format_RGB32] = convert_RGB888_to_RGB32_ssse3;
qimage_converter_map[QImage::Format_RGB888][QImage::Format_ARGB32] = convert_RGB888_to_RGB32_ssse3;
qimage_converter_map[QImage::Format_RGB888][QImage::Format_ARGB32_Premultiplied] = convert_RGB888_to_RGB32_ssse3;
+ qimage_converter_map[QImage::Format_BGR888][QImage::Format_RGBX8888] = convert_RGB888_to_RGB32_ssse3;
+ qimage_converter_map[QImage::Format_BGR888][QImage::Format_RGBA8888] = convert_RGB888_to_RGB32_ssse3;
+ qimage_converter_map[QImage::Format_BGR888][QImage::Format_RGBA8888_Premultiplied] = convert_RGB888_to_RGB32_ssse3;
}
#endif
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index d88ad2d1d2..0930955f5a 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -51,7 +51,9 @@
// We mean it.
//
+#include <QtGui/qcolorspace.h>
#include <QtGui/private/qtguiglobal_p.h>
+#include <QtGui/qimage.h>
#include <QtCore/private/qnumeric_p.h>
#include <QMap>
@@ -65,7 +67,7 @@ struct Q_GUI_EXPORT QImageData { // internal image data
QImageData();
~QImageData();
static QImageData *create(const QSize &size, QImage::Format format);
- static QImageData *create(uchar *data, int w, int h, int bpl, QImage::Format format, bool readOnly, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0);
+ static QImageData *create(uchar *data, int w, int h, int bpl, QImage::Format format, bool readOnly, QImageCleanupFunction cleanupFunction = nullptr, void *cleanupInfo = nullptr);
QAtomicInt ref;
@@ -106,6 +108,8 @@ struct Q_GUI_EXPORT QImageData { // internal image data
QPaintEngine *paintEngine;
+ QColorSpace colorSpace;
+
struct ImageSizeParameters {
qsizetype bytesPerLine;
qsizetype totalSize;
@@ -203,6 +207,7 @@ inline int qt_depthForFormat(QImage::Format format)
case QImage::Format_ARGB8565_Premultiplied:
case QImage::Format_ARGB8555_Premultiplied:
case QImage::Format_RGB888:
+ case QImage::Format_BGR888:
depth = 24;
break;
case QImage::Format_RGBX64:
@@ -271,6 +276,29 @@ inline QImage::Format qt_alphaVersion(QImage::Format format)
return QImage::Format_ARGB32_Premultiplied;
}
+inline bool qt_highColorPrecision(QImage::Format format, bool opaque = false)
+{
+ // Formats with higher color precision than ARGB32_Premultiplied.
+ switch (format) {
+ case QImage::Format_ARGB32:
+ case QImage::Format_RGBA8888:
+ return !opaque;
+ case QImage::Format_BGR30:
+ case QImage::Format_RGB30:
+ case QImage::Format_A2BGR30_Premultiplied:
+ case QImage::Format_A2RGB30_Premultiplied:
+ case QImage::Format_RGBX64:
+ case QImage::Format_RGBA64:
+ case QImage::Format_RGBA64_Premultiplied:
+ case QImage::Format_Grayscale16:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+
inline QImage::Format qt_maybeAlphaVersionWithSameDepth(QImage::Format format)
{
const QImage::Format toFormat = qt_alphaVersion(format);
diff --git a/src/gui/image/qimage_ssse3.cpp b/src/gui/image/qimage_ssse3.cpp
index 9cdfba20e3..fb81a1a6c3 100644
--- a/src/gui/image/qimage_ssse3.cpp
+++ b/src/gui/image/qimage_ssse3.cpp
@@ -121,8 +121,11 @@ Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_ssse3(quint32 *dst, con
void convert_RGB888_to_RGB32_ssse3(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
{
- Q_ASSERT(src->format == QImage::Format_RGB888);
- Q_ASSERT(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied);
+ Q_ASSERT(src->format == QImage::Format_RGB888 || src->format == QImage::Format_BGR888);
+ if (src->format == QImage::Format_BGR888)
+ Q_ASSERT(dest->format == QImage::Format_RGBX8888 || dest->format == QImage::Format_RGBA8888 || dest->format == QImage::Format_RGBA8888_Premultiplied);
+ else
+ Q_ASSERT(dest->format == QImage::Format_RGB32 || dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_ARGB32_Premultiplied);
Q_ASSERT(src->width == dest->width);
Q_ASSERT(src->height == dest->height);
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 360cc16319..dff24b449a 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -150,7 +150,7 @@
// factory loader
#include <qcoreapplication.h>
#include <private/qfactoryloader_p.h>
-#include <QMutexLocker>
+#include <QtCore/private/qlocking_p.h>
// for qt_getImageText
#include <private/qimage_p.h>
@@ -186,8 +186,8 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
QByteArray suffix;
#ifndef QT_NO_IMAGEFORMATPLUGIN
- static QMutex mutex;
- QMutexLocker locker(&mutex);
+ static QBasicMutex mutex;
+ const auto locker = qt_scoped_lock(mutex);
typedef QMultiMap<int, QString> PluginKeyMap;
@@ -197,7 +197,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
#ifdef QIMAGEREADER_DEBUG
qDebug() << "QImageReader::createReadHandler( device =" << (void *)device << ", format =" << format << "),"
- << keyMap.size() << "plugins available: " << keyMap.values();
+ << keyMap.uniqueKeys().size() << "plugins available: " << keyMap;
#endif
int suffixPluginIndex = -1;
@@ -325,6 +325,29 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
#endif
}
+ if (handler && device && !suffix.isEmpty()) {
+ Q_ASSERT(qobject_cast<QFile *>(device));
+ // We have a file claiming to be of a recognized format. Now confirm that
+ // the handler also recognizes the file contents.
+ const qint64 pos = device->pos();
+ handler->setDevice(device);
+ if (!form.isEmpty())
+ handler->setFormat(form);
+ bool canRead = handler->canRead();
+ device->seek(pos);
+ if (canRead) {
+ // ok, we're done.
+ return handler;
+ }
+#ifdef QIMAGEREADER_DEBUG
+ qDebug() << "QImageReader::createReadHandler: the" << suffix << "handler can not read this file";
+#endif
+ // File may still be valid, just with wrong suffix, so fall back to
+ // finding a handler based on contents, below.
+ delete handler;
+ handler = nullptr;
+ }
+
#ifndef QT_NO_IMAGEFORMATPLUGIN
if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) {
// check if any of our plugins recognize the file from its contents.
@@ -336,7 +359,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
if (plugin && plugin->capabilities(device, QByteArray()) & QImageIOPlugin::CanRead) {
handler = plugin->create(device, testFormat);
#ifdef QIMAGEREADER_DEBUG
- qDebug() << "QImageReader::createReadHandler: the" << keyMap.keys().at(i) << "plugin can read this data";
+ qDebug() << "QImageReader::createReadHandler: the" << keyMap.value(i) << "plugin can read this data";
#endif
break;
}
@@ -1115,8 +1138,10 @@ bool QImageReader::autoTransform() const
case QImageReaderPrivate::DoNotApplyTransform:
return false;
case QImageReaderPrivate::UsePluginDefault:
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (d->initHandler())
return d->handler->supportsOption(QImageIOHandler::TransformedByDefault);
+#endif
Q_FALLTHROUGH();
default:
break;
diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp
index f03c8836df..25fce050a1 100644
--- a/src/gui/image/qmovie.cpp
+++ b/src/gui/image/qmovie.cpp
@@ -175,11 +175,12 @@
#include "qmovie.h"
#include "qglobal.h"
+#include "qelapsedtimer.h"
#include "qimage.h"
#include "qimagereader.h"
#include "qpixmap.h"
#include "qrect.h"
-#include "qdatetime.h"
+#include "qelapsedtimer.h"
#include "qtimer.h"
#include "qpair.h"
#include "qmap.h"
@@ -206,8 +207,8 @@ public:
: pixmap(QPixmap()), delay(QMOVIE_INVALID_DELAY), endMark(false)
{ }
- inline QFrameInfo(const QPixmap &pixmap, int delay)
- : pixmap(pixmap), delay(delay), endMark(false)
+ inline QFrameInfo(QPixmap &&pixmap, int delay)
+ : pixmap(std::move(pixmap)), delay(delay), endMark(false)
{ }
inline bool isValid()
@@ -221,6 +222,7 @@ public:
static inline QFrameInfo endMarker()
{ return QFrameInfo(true); }
};
+Q_DECLARE_TYPEINFO(QFrameInfo, Q_MOVABLE_TYPE);
class QMoviePrivate : public QObjectPrivate
{
@@ -379,9 +381,7 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber)
}
if (frameNumber > greatestFrameNumber)
greatestFrameNumber = frameNumber;
- QPixmap aPixmap = QPixmap::fromImage(std::move(anImage));
- int aDelay = reader->nextImageDelay();
- return QFrameInfo(aPixmap, aDelay);
+ return QFrameInfo(QPixmap::fromImage(std::move(anImage)), reader->nextImageDelay());
} else if (frameNumber != 0) {
// We've read all frames now. Return an end marker
haveReadAll = true;
@@ -405,9 +405,7 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber)
return QFrameInfo(); // Invalid
}
greatestFrameNumber = i;
- QPixmap aPixmap = QPixmap::fromImage(std::move(anImage));
- int aDelay = reader->nextImageDelay();
- QFrameInfo info(aPixmap, aDelay);
+ QFrameInfo info(QPixmap::fromImage(std::move(anImage)), reader->nextImageDelay());
// Cache it!
frameMap.insert(i, info);
if (i == frameNumber) {
@@ -437,7 +435,7 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber)
*/
bool QMoviePrivate::next()
{
- QTime time;
+ QElapsedTimer time;
time.start();
QFrameInfo info = infoForFrame(nextFrameNumber);
if (!info.isValid())
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index bba36b09cd..978a07b9f9 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -54,8 +54,10 @@
#include "qpainter.h"
#include "qpainterpath.h"
#include "qpixmap.h"
+#include "qregexp.h"
#include "qregion.h"
#include "qdebug.h"
+#include <QtCore/private/qlocking_p.h>
#include <algorithm>
@@ -234,7 +236,7 @@ void QPicture::detach()
bool QPicture::isDetached() const
{
- return d_func()->ref.load() == 1;
+ return d_func()->ref.loadRelaxed() == 1;
}
/*!
@@ -1426,7 +1428,7 @@ void qt_init_picture_plugins()
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
static QBasicMutex mutex;
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
static QFactoryLoader loader(QPictureFormatInterface_iid,
QStringLiteral("/pictureformats"));
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index ec7b4bd7e3..189e57b9a3 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -78,11 +78,9 @@ public:
void setBoundingRect(const QRect &r);
QPicture& operator=(const QPicture &p);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QPicture &operator=(QPicture &&other) Q_DECL_NOEXCEPT
+ inline QPicture &operator=(QPicture &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
-#endif
- inline void swap(QPicture &other) Q_DECL_NOEXCEPT
+ inline void swap(QPicture &other) noexcept
{ d_ptr.swap(other.d_ptr); }
void detach();
bool isDetached() const;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 5b4d218603..b6e41f16a5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -262,7 +262,7 @@ QPixmap::QPixmap(const char * const xpm[])
QPixmap::~QPixmap()
{
- Q_ASSERT(!data || data->ref.load() >= 1); // Catch if ref-counting changes again
+ Q_ASSERT(!data || data->ref.loadRelaxed() >= 1); // Catch if ref-counting changes again
}
/*!
@@ -910,7 +910,7 @@ void QPixmap::fill(const QColor &color)
return;
}
- if (data->ref.load() == 1) {
+ if (data->ref.loadRelaxed() == 1) {
// detach() will also remove this pixmap from caches, so
// it has to be called even when ref == 1.
detach();
@@ -1053,7 +1053,7 @@ QDataStream &operator>>(QDataStream &stream, QPixmap &pixmap)
bool QPixmap::isDetached() const
{
- return data && data->ref.load() == 1;
+ return data && data->ref.loadRelaxed() == 1;
}
/*!
@@ -1523,10 +1523,10 @@ void QPixmap::detach()
rasterData->image.detach();
}
- if (data->is_cached && data->ref.load() == 1)
+ if (data->is_cached && data->ref.loadRelaxed() == 1)
QImagePixmapCleanupHooks::executePlatformPixmapModificationHooks(data.data());
- if (data->ref.load() != 1) {
+ if (data->ref.loadRelaxed() != 1) {
*this = copy();
}
++data->detach_no;
@@ -1689,7 +1689,7 @@ QDebug operator<<(QDebug dbg, const QPixmap &r)
} else {
dbg << r.size() << ",depth=" << r.depth()
<< ",devicePixelRatio=" << r.devicePixelRatio()
- << ",cacheKey=" << showbase << hex << r.cacheKey() << dec << noshowbase;
+ << ",cacheKey=" << Qt::showbase << Qt::hex << r.cacheKey() << Qt::dec << Qt::noshowbase;
}
dbg << ')';
return dbg;
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 13c81f18d0..8c1395857e 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -73,11 +73,9 @@ public:
~QPixmap();
QPixmap &operator=(const QPixmap &);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QPixmap &operator=(QPixmap &&other) Q_DECL_NOEXCEPT
+ inline QPixmap &operator=(QPixmap &&other) noexcept
{ qSwap(data, other.data); return *this; }
-#endif
- inline void swap(QPixmap &other) Q_DECL_NOEXCEPT
+ inline void swap(QPixmap &other) noexcept
{ qSwap(data, other.data); }
operator QVariant() const;
@@ -139,12 +137,10 @@ public:
QImage toImage() const;
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor);
static QPixmap fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags = Qt::AutoColor);
-#ifdef Q_COMPILER_RVALUE_REFS
static QPixmap fromImage(QImage &&image, Qt::ImageConversionFlags flags = Qt::AutoColor)
{
return fromImageInPlace(image, flags);
}
-#endif
bool load(const QString& fileName, const char *format = nullptr, Qt::ImageConversionFlags flags = Qt::AutoColor);
bool loadFromData(const uchar *buf, uint len, const char* format = nullptr, Qt::ImageConversionFlags flags = Qt::AutoColor);
diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp
index 3a2db74098..8aad77b991 100644
--- a/src/gui/image/qpixmap_win.cpp
+++ b/src/gui/image/qpixmap_win.cpp
@@ -281,6 +281,7 @@ Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapForm
}
break;
case QImage::Format_RGB888:
+ case QImage::Format_BGR888:
compression = BI_RGB;
bitCount = 24u;
break;
@@ -368,7 +369,7 @@ static QImage::Format imageFromWinHBITMAP_Format(const BITMAPINFOHEADER &header,
? QImage::Format_RGB32 : QImage::Format_ARGB32_Premultiplied;
break;
case 24:
- result = QImage::Format_RGB888;
+ result = QImage::Format_BGR888;
break;
case 16:
result = QImage::Format_RGB555;
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index f6684eac7d..483d6d79a2 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -189,7 +189,7 @@ bool QPixmapCache::Key::operator ==(const Key &key) const
Otherwise, if pixmap was flushed, the key is no longer valid.
\since 5.7
*/
-bool QPixmapCache::Key::isValid() const Q_DECL_NOTHROW
+bool QPixmapCache::Key::isValid() const noexcept
{
return d && d->isValid;
}
diff --git a/src/gui/image/qpixmapcache.h b/src/gui/image/qpixmapcache.h
index 12d05b00f3..55af35a5d9 100644
--- a/src/gui/image/qpixmapcache.h
+++ b/src/gui/image/qpixmapcache.h
@@ -55,18 +55,16 @@ public:
public:
Key();
Key(const Key &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- Key(Key &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
- Key &operator =(Key &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ Key(Key &&other) noexcept : d(other.d) { other.d = nullptr; }
+ Key &operator =(Key &&other) noexcept { swap(other); return *this; }
~Key();
bool operator ==(const Key &key) const;
inline bool operator !=(const Key &key) const
{ return !operator==(key); }
Key &operator =(const Key &other);
- void swap(Key &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
- bool isValid() const Q_DECL_NOTHROW;
+ void swap(Key &other) noexcept { qSwap(d, other.d); }
+ bool isValid() const noexcept;
private:
KeyData *d;
diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h
index 3c57367514..ab8e2b7558 100644
--- a/src/gui/image/qpixmapcache_p.h
+++ b/src/gui/image/qpixmapcache_p.h
@@ -87,7 +87,7 @@ public:
&& !d->image.d->paintEngine->isActive())
{
delete d->image.d->paintEngine;
- d->image.d->paintEngine = 0;
+ d->image.d->paintEngine = nullptr;
}
}
}
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index f1b25f07a7..4ab45337b0 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -42,6 +42,7 @@
#ifndef QT_NO_IMAGEFORMAT_PNG
#include <qcoreapplication.h>
+#include <qdebug.h>
#include <qiodevice.h>
#include <qimage.h>
#include <qlist.h>
@@ -50,6 +51,9 @@
#include <private/qimage_p.h> // for qt_getImageText
+#include <qcolorspace.h>
+#include <private/qcolorspace_p.h>
+
#include <png.h>
#include <pngconf.h>
@@ -96,9 +100,16 @@ public:
ReadingEnd,
Error
};
+ // Defines the order of how the various ways of setting colorspace overrides eachother:
+ enum ColorSpaceState {
+ Undefined = 0,
+ GammaChrm = 1, // gAMA+cHRM chunks
+ Srgb = 2, // sRGB chunk
+ Icc = 3 // iCCP chunk
+ };
QPngHandlerPrivate(QPngHandler *qq)
- : gamma(0.0), fileGamma(0.0), quality(50), compression(50), png_ptr(0), info_ptr(0), end_info(0), state(Ready), q(qq)
+ : gamma(0.0), fileGamma(0.0), quality(50), compression(50), colorSpaceState(Undefined), png_ptr(0), info_ptr(0), end_info(0), state(Ready), q(qq)
{ }
float gamma;
@@ -108,6 +119,8 @@ public:
QString description;
QSize scaledSize;
QStringList readTexts;
+ QColorSpace colorSpace;
+ ColorSpaceState colorSpaceState;
png_struct *png_ptr;
png_info *info_ptr;
@@ -226,11 +239,8 @@ void qpiw_flush_fn(png_structp /* png_ptr */)
}
static
-void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scaledSize, bool *doScaledRead, float screen_gamma=0.0, float file_gamma=0.0)
+void setup_qt(QImage& image, png_structp png_ptr, png_infop info_ptr, QSize scaledSize, bool *doScaledRead)
{
- if (screen_gamma != 0.0 && file_gamma != 0.0)
- png_set_gamma(png_ptr, 1.0f / screen_gamma, file_gamma);
-
png_uint_32 width = 0;
png_uint_32 height = 0;
int bit_depth = 0;
@@ -585,10 +595,63 @@ bool QPngHandlerPrivate::readPngHeader()
readPngTexts(info_ptr);
+#ifdef PNG_iCCP_SUPPORTED
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_iCCP)) {
+ png_charp name = nullptr;
+ int compressionType = 0;
+#if (PNG_LIBPNG_VER < 10500)
+ png_charp profileData = nullptr;
+#else
+ png_bytep profileData = nullptr;
+#endif
+ png_uint_32 profLen;
+ png_get_iCCP(png_ptr, info_ptr, &name, &compressionType, &profileData, &profLen);
+ colorSpace = QColorSpace::fromIccProfile(QByteArray::fromRawData((const char *)profileData, profLen));
+ if (!colorSpace.isValid()) {
+ qWarning() << "QPngHandler: Failed to parse ICC profile";
+ } else {
+ QColorSpacePrivate *csD = QColorSpacePrivate::getWritable(colorSpace);
+ if (csD->description.isEmpty())
+ csD->description = QString::fromLatin1((const char *)name);
+ colorSpaceState = Icc;
+ }
+ }
+#endif
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_sRGB)) {
+ int rendering_intent = -1;
+ png_get_sRGB(png_ptr, info_ptr, &rendering_intent);
+ // We don't actually care about the rendering_intent, just that it is valid
+ if (rendering_intent >= 0 && rendering_intent <= 3 && colorSpaceState <= Srgb) {
+ colorSpace = QColorSpace::SRgb;
+ colorSpaceState = Srgb;
+ }
+ }
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA)) {
double file_gamma = 0.0;
png_get_gAMA(png_ptr, info_ptr, &file_gamma);
fileGamma = file_gamma;
+ if (fileGamma > 0.0f && colorSpaceState <= GammaChrm) {
+ QColorSpacePrimaries primaries;
+ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_cHRM)) {
+ double white_x, white_y, red_x, red_y;
+ double green_x, green_y, blue_x, blue_y;
+ png_get_cHRM(png_ptr, info_ptr,
+ &white_x, &white_y, &red_x, &red_y,
+ &green_x, &green_y, &blue_x, &blue_y);
+ primaries.whitePoint = QPointF(white_x, white_y);
+ primaries.redPoint = QPointF(red_x, red_y);
+ primaries.greenPoint = QPointF(green_x, green_y);
+ primaries.bluePoint = QPointF(blue_x, blue_y);
+ }
+ if (primaries.areValid()) {
+ colorSpace = QColorSpace(primaries.whitePoint, primaries.redPoint, primaries.greenPoint, primaries.bluePoint,
+ QColorSpace::TransferFunction::Gamma, fileGamma);
+ } else {
+ colorSpace = QColorSpace(QColorSpace::Primaries::SRgb,
+ QColorSpace::TransferFunction::Gamma, fileGamma);
+ }
+ colorSpaceState = GammaChrm;
+ }
}
state = ReadHeader;
@@ -613,8 +676,16 @@ bool QPngHandlerPrivate::readPngImage(QImage *outImage)
return false;
}
+ if (gamma != 0.0 && fileGamma != 0.0) {
+ // This configuration forces gamma correction and
+ // thus changes the output colorspace
+ png_set_gamma(png_ptr, 1.0f / gamma, fileGamma);
+ colorSpace = colorSpace.withTransferFunction(QColorSpace::TransferFunction::Gamma, 1.0f / gamma);
+ colorSpaceState = GammaChrm;
+ }
+
bool doScaledRead = false;
- setup_qt(*outImage, png_ptr, info_ptr, scaledSize, &doScaledRead, gamma, fileGamma);
+ setup_qt(*outImage, png_ptr, info_ptr, scaledSize, &doScaledRead);
if (outImage->isNull()) {
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
@@ -683,6 +754,9 @@ bool QPngHandlerPrivate::readPngImage(QImage *outImage)
if (scaledSize.isValid() && outImage->size() != scaledSize)
*outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ if (colorSpaceState > Undefined && colorSpace.isValid())
+ outImage->setColorSpace(colorSpace);
+
return true;
}
@@ -902,6 +976,26 @@ bool QPNGImageWriter::writeImage(const QImage& image, volatile int compression_i
bpc, // per channel
color_type, 0, 0, 0); // sets #channels
+#ifdef PNG_iCCP_SUPPORTED
+ if (image.colorSpace().isValid()) {
+ QColorSpace cs = image.colorSpace();
+ // Support the old gamma making it override transferfunction.
+ if (gamma != 0.0 && !qFuzzyCompare(cs.gamma(), 1.0f / gamma))
+ cs = cs.withTransferFunction(QColorSpace::TransferFunction::Gamma, 1.0f / gamma);
+ QByteArray iccProfileName = QColorSpacePrivate::get(cs)->description.toLatin1();
+ if (iccProfileName.isEmpty())
+ iccProfileName = QByteArrayLiteral("Custom");
+ QByteArray iccProfile = cs.iccProfile();
+ png_set_iCCP(png_ptr, info_ptr,
+ #if PNG_LIBPNG_VER < 10500
+ iccProfileName.data(), PNG_COMPRESSION_TYPE_BASE, iccProfile.data(),
+ #else
+ iccProfileName.constData(), PNG_COMPRESSION_TYPE_BASE,
+ (png_const_bytep)iccProfile.constData(),
+ #endif
+ iccProfile.length());
+ } else
+#endif
if (gamma != 0.0) {
png_set_gAMA(png_ptr, info_ptr, 1.0/gamma);
}
@@ -985,6 +1079,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, volatile int compression_i
if (color_type == PNG_COLOR_TYPE_RGB) {
switch (image.format()) {
case QImage::Format_RGB888:
+ case QImage::Format_BGR888:
break;
case QImage::Format_RGBX8888:
case QImage::Format_RGBX64:
@@ -1037,6 +1132,7 @@ bool QPNGImageWriter::writeImage(const QImage& image, volatile int compression_i
case QImage::Format_RGB32:
case QImage::Format_ARGB32:
case QImage::Format_RGB888:
+ case QImage::Format_BGR888:
case QImage::Format_RGBX8888:
case QImage::Format_RGBA8888:
case QImage::Format_RGBX64:
diff --git a/src/gui/image/qppmhandler_p.h b/src/gui/image/qppmhandler_p.h
index f3c9d0f139..2f3811b759 100644
--- a/src/gui/image/qppmhandler_p.h
+++ b/src/gui/image/qppmhandler_p.h
@@ -71,7 +71,7 @@ public:
QByteArray name() const override;
#endif
- static bool canRead(QIODevice *device, QByteArray *subType = 0);
+ static bool canRead(QIODevice *device, QByteArray *subType = nullptr);
QVariant option(ImageOption option) const override;
void setOption(ImageOption option, const QVariant &value) override;
diff --git a/src/gui/image/qxbmhandler.cpp b/src/gui/image/qxbmhandler.cpp
index 65a5b63bc7..3cd15b3e4d 100644
--- a/src/gui/image/qxbmhandler.cpp
+++ b/src/gui/image/qxbmhandler.cpp
@@ -44,6 +44,7 @@
#include <qimage.h>
#include <qiodevice.h>
+#include <qregexp.h>
#include <qvariant.h>
#include <stdio.h>
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index a32dfda96d..cf105b250a 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -45,6 +45,7 @@
#include <qbytearraymatcher.h>
#include <qimage.h>
#include <qmap.h>
+#include <qregexp.h>
#include <qtextstream.h>
#include <qvariant.h>
@@ -1124,53 +1125,45 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
break;
}
- QString line;
-
// write header
QTextStream s(device);
- s << "/* XPM */" << endl
- << "static char *" << fbname(fileName) << "[]={" << endl
+ s << "/* XPM */" << Qt::endl
+ << "static char *" << fbname(fileName) << "[]={" << Qt::endl
<< '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"';
// write palette
QMap<QRgb, int>::Iterator c = colorMap.begin();
while (c != colorMap.end()) {
QRgb color = c.key();
- if (image.format() != QImage::Format_RGB32 && !qAlpha(color))
- line = QString::asprintf("\"%s c None\"",
- xpm_color_name(cpp, *c));
- else
- line = QString::asprintf("\"%s c #%02x%02x%02x\"",
- xpm_color_name(cpp, *c),
- qRed(color),
- qGreen(color),
- qBlue(color));
+ const QString line = image.format() != QImage::Format_RGB32 && !qAlpha(color)
+ ? QString::asprintf("\"%s c None\"", xpm_color_name(cpp, *c))
+ : QString::asprintf("\"%s c #%02x%02x%02x\"", xpm_color_name(cpp, *c),
+ qRed(color), qGreen(color), qBlue(color));
++c;
- s << ',' << endl << line;
+ s << ',' << Qt::endl << line;
}
// write pixels, limit to 4 characters per pixel
- line.truncate(cpp*w);
+ QByteArray line;
for(y=0; y<h; y++) {
+ line.clear();
const QRgb *yp = reinterpret_cast<const QRgb *>(image.constScanLine(y));
- int cc = 0;
for(x=0; x<w; x++) {
int color = (int)(*(yp + x));
const QByteArray chars(xpm_color_name(cpp, colorMap[color]));
- line[cc++] = QLatin1Char(chars[0]);
+ line.append(chars[0]);
if (cpp > 1) {
- line[cc++] = QLatin1Char(chars[1]);
+ line.append(chars[1]);
if (cpp > 2) {
- line[cc++] = QLatin1Char(chars[2]);
- if (cpp > 3) {
- line[cc++] = QLatin1Char(chars[3]);
- }
+ line.append(chars[2]);
+ if (cpp > 3)
+ line.append(chars[3]);
}
}
}
- s << ',' << endl << '\"' << line << '\"';
+ s << ',' << Qt::endl << '\"' << line << '\"';
}
- s << "};" << endl;
+ s << "};" << Qt::endl;
return (s.status() == QTextStream::Ok);
}
diff --git a/src/gui/itemmodels/qstandarditemmodel_p.h b/src/gui/itemmodels/qstandarditemmodel_p.h
index 23d2938bc4..97c2e6f01b 100644
--- a/src/gui/itemmodels/qstandarditemmodel_p.h
+++ b/src/gui/itemmodels/qstandarditemmodel_p.h
@@ -109,11 +109,11 @@ class QStandardItemPrivate
Q_DECLARE_PUBLIC(QStandardItem)
public:
inline QStandardItemPrivate()
- : model(0),
- parent(0),
+ : model(nullptr),
+ parent(nullptr),
rows(0),
columns(0),
- q_ptr(0),
+ q_ptr(nullptr),
lastKnownIndex(-1)
{ }
@@ -220,10 +220,10 @@ public:
if (!index.isValid())
return root.data();
if (index.model() != q)
- return 0;
+ return nullptr;
QStandardItem *parent = static_cast<QStandardItem*>(index.internalPointer());
- if (parent == 0)
- return 0;
+ if (parent == nullptr)
+ return nullptr;
return parent->child(index.row(), index.column());
}
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index 1f137fc46f..9c80f1e2cc 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -21,7 +21,7 @@ HEADERS += \
kernel/qplatforminputcontextplugin_p.h \
kernel/qplatformintegrationfactory_p.h \
kernel/qplatformintegrationplugin.h \
- kernel/qplatformtheme.h\
+ kernel/qplatformtheme.h \
kernel/qplatformtheme_p.h \
kernel/qplatformthemefactory_p.h \
kernel/qplatformthemeplugin.h \
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index 9e4787589f..1ba8760a9d 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -494,7 +494,7 @@ QCursor::QCursor(Qt::CursorShape shape)
\sa operator!=(const QCursor &lhs, const QCursor &rhs)
*/
-bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW
+bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept
{
if (lhs.d == rhs.d)
return true; // Copy or same shape
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index d62ee7a053..7966e35840 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -86,13 +86,11 @@ public:
QCursor(const QCursor &cursor);
~QCursor();
QCursor &operator=(const QCursor &cursor);
-#ifdef Q_COMPILER_RVALUE_REFS
- QCursor(QCursor &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
- inline QCursor &operator=(QCursor &&other) Q_DECL_NOTHROW
+ QCursor(QCursor &&other) noexcept : d(other.d) { other.d = nullptr; }
+ inline QCursor &operator=(QCursor &&other) noexcept
{ swap(other); return *this; }
-#endif
- void swap(QCursor &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QCursor &other) noexcept { qSwap(d, other.d); }
operator QVariant() const;
@@ -112,13 +110,13 @@ public:
inline static void setPos(QScreen *screen, const QPoint &p) { setPos(screen, p.x(), p.y()); }
private:
- friend Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept;
QCursorData *d;
};
Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QCursor)
-Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW;
-inline bool operator!=(const QCursor &lhs, const QCursor &rhs) Q_DECL_NOTHROW { return !(lhs == rhs); }
+Q_GUI_EXPORT bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept;
+inline bool operator!=(const QCursor &lhs, const QCursor &rhs) noexcept { return !(lhs == rhs); }
/*****************************************************************************
QCursor stream functions
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index f095fbf7a0..abb30986a5 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -73,9 +73,9 @@ class QDragPrivate : public QObjectPrivate
{
public:
QDragPrivate()
- : source(0)
- , target(0)
- , data(0)
+ : source(nullptr)
+ , target(nullptr)
+ , data(nullptr)
{ }
QObject *source;
QObject *target;
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index e7a320f3a4..2b28052dd5 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -535,13 +535,6 @@ Qt::MouseEventFlags QMouseEvent::flags() const
*/
/*!
- \fn QPointF QMouseEvent::posF() const
- \obsolete
-
- Use localPos() instead.
-*/
-
-/*!
\class QHoverEvent
\ingroup events
\inmodule QtGui
@@ -750,35 +743,21 @@ QHoverEvent::~QHoverEvent()
\l inverted always returns false.
*/
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
\fn Qt::Orientation QWheelEvent::orientation() const
\obsolete
- Returns the wheel's orientation.
-
Use angleDelta() instead.
*/
+#endif
+#if QT_CONFIG(wheelevent)
+#if QT_DEPRECATED_SINCE(5, 15)
/*!
\obsolete
- Constructs a wheel event object.
-
- Use the constructor taking \e angleDelta and \e pixelDelta QPoints instead.
-
- The position, \a pos, is the location of the mouse cursor within
- the widget. The globalPos() is initialized to QCursor::pos()
- which is usually, but not always, correct.
- Use the other constructor if you need to specify the global
- position explicitly.
-
- The \a buttons describe the state of the mouse buttons at the time
- of the event, \a delta contains the rotation distance,
- \a modifiers holds the keyboard modifier flags at the time of the
- event, and \a orient holds the wheel's orientation.
-
- \sa pos(), pixelDelta(), angleDelta()
+ This constructor has been deprecated.
*/
-#if QT_CONFIG(wheelevent)
QWheelEvent::QWheelEvent(const QPointF &pos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient)
@@ -793,26 +772,8 @@ QWheelEvent::QWheelEvent(const QPointF &pos, int delta,
}
/*!
- \internal
-*/
-QWheelEvent::~QWheelEvent()
-{
-}
-
-/*!
\obsolete
- Constructs a wheel event object.
-
- Use the constructor taking \e angleDelta and \e pixelDelta QPoints instead.
-
- The \a pos provides the location of the mouse cursor
- within the widget. The position in global coordinates is specified
- by \a globalPos. \a delta contains the rotation distance, \a modifiers
- holds the keyboard modifier flags at the time of the event, and
- \a orient holds the wheel's orientation.
-
-
- \sa pos(), pixelDelta(), angleDelta()
+ This constructor has been deprecated.
*/
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
@@ -827,133 +788,51 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta
}
/*!
- Constructs a wheel event object.
-
- The \a pos provides the location of the mouse cursor
- within the window. The position in global coordinates is specified
- by \a globalPos.
-
- \a pixelDelta contains the scrolling distance in pixels on screen, while
- \a angleDelta contains the wheel rotation distance. \a pixelDelta is
- optional and can be null.
-
- The mouse and keyboard states at the time of the event are specified by
- \a buttons and \a modifiers.
-
- For backwards compatibility, the event can also hold monodirectional wheel
- event data: \a qt4Delta specifies the rotation, and \a qt4Orientation the
- direction.
-
- The phase() is initialized to Qt::ScrollUpdate. Use the other constructor
- to specify the phase explicitly.
-
- \sa posF(), globalPosF(), angleDelta(), pixelDelta()
+ \obsolete
+ This constructor has been deprecated.
*/
-
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, qt4Delta, qt4Orientation,
buttons, modifiers, Qt::NoScrollPhase)
{}
+QT_WARNING_POP
/*!
- Constructs a wheel event object.
-
- The \a pos provides the location of the mouse cursor
- within the window. The position in global coordinates is specified
- by \a globalPos.
-
- \a pixelDelta contains the scrolling distance in pixels on screen, while
- \a angleDelta contains the wheel rotation distance. \a pixelDelta is
- optional and can be null.
-
- The mouse and keyboard states at the time of the event are specified by
- \a buttons and \a modifiers.
-
- For backwards compatibility, the event can also hold monodirectional wheel
- event data: \a qt4Delta specifies the rotation, and \a qt4Orientation the
- direction.
-
- The scrolling phase of the event is specified by \a phase.
-
- \sa posF(), globalPosF(), angleDelta(), pixelDelta(), phase()
+ \obsolete
+ This constructor has been deprecated.
*/
-
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase)
: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, qt4Delta, qt4Orientation,
buttons, modifiers, phase, Qt::MouseEventNotSynthesized)
{}
+QT_WARNING_POP
/*!
- Constructs a wheel event object.
-
- The \a pos provides the location of the mouse cursor within the window. The
- position in global coordinates is specified by \a globalPos.
-
- \a pixelDelta contains the scrolling distance in pixels on screen, while
- \a angleDelta contains the wheel rotation distance. \a pixelDelta is
- optional and can be null.
-
- The mouse and keyboard states at the time of the event are specified by
- \a buttons and \a modifiers.
-
- For backwards compatibility, the event can also hold monodirectional wheel
- event data: \a qt4Delta specifies the rotation, and \a qt4Orientation the
- direction.
-
- The scrolling phase of the event is specified by \a phase.
-
- If the wheel event comes from a physical mouse wheel, \a source is set to
- Qt::MouseEventNotSynthesized. If it comes from a gesture detected by the
- operating system, or from a non-mouse hardware device, such that \a pixelDelta is
- directly related to finger movement, \a source is set to Qt::MouseEventSynthesizedBySystem.
- If it comes from Qt, source would be set to Qt::MouseEventSynthesizedByQt.
-
- \sa posF(), globalPosF(), angleDelta(), pixelDelta(), phase()
+ \obsolete
+ This constructor has been deprecated.
*/
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source)
: QWheelEvent(pos, globalPos, pixelDelta, angleDelta, qt4Delta, qt4Orientation,
buttons, modifiers, phase, source, false)
{}
+QT_WARNING_POP
/*!
- Constructs a wheel event object.
-
- The \a pos provides the location of the mouse cursor
- within the window. The position in global coordinates is specified
- by \a globalPos.
-
- \a pixelDelta contains the scrolling distance in pixels on screen, while
- \a angleDelta contains the wheel rotation distance. \a pixelDelta is
- optional and can be null.
-
- The mouse and keyboard states at the time of the event are specified by
- \a buttons and \a modifiers.
-
- For backwards compatibility, the event can also hold monodirectional wheel
- event data: \a qt4Delta specifies the rotation, and \a qt4Orientation the
- direction.
-
- The scrolling phase of the event is specified by \a phase.
-
- If the wheel event comes from a physical mouse wheel, \a source is set to
- Qt::MouseEventNotSynthesized. If it comes from a gesture detected by the
- operating system, or from a non-mouse hardware device, such that \a
- pixelDelta is directly related to finger movement, \a source is set to
- Qt::MouseEventSynthesizedBySystem. If it comes from Qt, source would be set
- to Qt::MouseEventSynthesizedByQt.
-
- If the system is configured to invert the delta values delivered with the
- event (such as natural scrolling of the touchpad on OS X), \a inverted
- should be \c true. Otherwise, \a inverted is \c false
-
- \sa posF(), globalPosF(), angleDelta(), pixelDelta(), phase()
+ \obsolete
+ This constructor has been deprecated.
*/
QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
@@ -962,6 +841,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
angleD(angleDelta), qt4D(qt4Delta), qt4O(qt4Orientation), mouseState(buttons), src(source),
invertedScrolling(inverted), ph(phase)
{}
+#endif // QT_DEPRECATED_SINCE(5, 15)
/*!
Constructs a wheel event object.
@@ -990,7 +870,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
event (such as natural scrolling of the touchpad on macOS), \a inverted
should be \c true. Otherwise, \a inverted is \c false
- \sa posF(), globalPosF(), angleDelta(), pixelDelta(), phase()
+ \sa position(), globalPosition(), angleDelta(), pixelDelta(), phase(), inverted(), source()
*/
QWheelEvent::QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
@@ -1002,6 +882,12 @@ QWheelEvent::QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoi
qt4D = (qt4O == Qt::Horizontal ? angleDelta.x() : angleDelta.y());
}
+/*!
+ \internal
+*/
+QWheelEvent::~QWheelEvent()
+{
+}
#endif // QT_CONFIG(wheelevent)
/*!
@@ -1053,6 +939,31 @@ QWheelEvent::QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoi
*/
/*!
+ \fn QPoint QWheelEvent::position() const
+
+ Returns the position of the mouse cursor relative to the widget
+ that received the event.
+
+ If you move your widgets around in response to mouse events,
+ use globalPosition() instead of this function.
+
+ \sa globalPosition()
+*/
+
+/*!
+ \fn QPoint QWheelEvent::globalPosition() const
+
+ Returns the global position of the mouse pointer \e{at the time
+ of the event}. This is important on asynchronous window systems
+ such as X11; whenever you move your widgets around in response to
+ mouse events, globalPosition() can differ a lot from the current
+ cursor position returned by QCursor::pos().
+
+ \sa position()
+*/
+
+#if QT_DEPRECATED_SINCE(5, 15)
+/*!
\fn int QWheelEvent::delta() const
\obsolete
@@ -1061,88 +972,61 @@ QWheelEvent::QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoi
/*!
\fn QPoint QWheelEvent::pos() const
+ \obsolete
- Returns the position of the mouse cursor relative to the widget
- that received the event.
-
- If you move your widgets around in response to mouse events,
- use globalPos() instead of this function.
-
- \sa x(), y(), globalPos()
+ This function has been deprecated, use position() instead.
*/
/*!
\fn int QWheelEvent::x() const
+ \obsolete
- Returns the x position of the mouse cursor, relative to the
- widget that received the event.
-
- \sa y(), pos()
+ This function has been deprecated, use position() instead.
*/
/*!
\fn int QWheelEvent::y() const
+ \obsolete
- Returns the y position of the mouse cursor, relative to the
- widget that received the event.
-
- \sa x(), pos()
+ This function has been deprecated, use position() instead.
*/
/*!
\fn QPoint QWheelEvent::globalPos() const
+ \obsolete
- Returns the global position of the mouse pointer \e{at the time
- of the event}. This is important on asynchronous window systems
- such as X11; whenever you move your widgets around in response to
- mouse events, globalPos() can differ a lot from the current
- cursor position returned by QCursor::pos().
-
- \sa globalX(), globalY()
+ This function has been deprecated, use globalPosition() instead.
*/
/*!
\fn int QWheelEvent::globalX() const
+ \obsolete
- Returns the global x position of the mouse cursor at the time of
- the event.
-
- \sa globalY(), globalPos()
+ This function has been deprecated, use globalPosition() instead.
*/
/*!
\fn int QWheelEvent::globalY() const
+ \obsolete
- Returns the global y position of the mouse cursor at the time of
- the event.
-
- \sa globalX(), globalPos()
+ This function has been deprecated, use globalPosition() instead.
*/
/*!
\fn const QPointF &QWheelEvent::posF() const
+ \obsolete
- Returns the position of the mouse cursor relative to the widget
- that received the event.
-
- If you move your widgets around in response to mouse events,
- use globalPosF() instead of this function.
-
- \sa globalPosF()
+ This function has been deprecated, use position() instead.
*/
/*!
\fn const QPointF &QWheelEvent::globalPosF() const
+ \obsolete
- Returns the global position of the mouse pointer \e{at the time
- of the event}. This is important on asynchronous window systems
- such as X11; whenever you move your widgets around in response to
- mouse events, globalPosF() can differ a lot from the current
- cursor position returned by QCursor::pos().
-
- \sa posF()
+ This function has been deprecated, use globalPosition() instead.
*/
+#endif
/*!
\fn Qt::ScrollPhase QWheelEvent::phase() const
@@ -1246,16 +1130,6 @@ QKeyEvent::~QKeyEvent()
}
/*!
- \fn QKeyEvent *QKeyEvent::createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString& text, bool autorep, ushort count)
- \internal
-*/
-
-/*!
- \fn bool QKeyEvent::hasExtendedInfo() const
- \internal
-*/
-
-/*!
\fn quint32 QKeyEvent::nativeScanCode() const
\since 4.2
@@ -2683,7 +2557,7 @@ Qt::MouseButtons QTabletEvent::buttons() const
globalPos() can differ significantly from the current position
QCursor::pos().
- \sa globalX(), globalY(), hiResGlobalPos()
+ \sa globalX(), globalY()
*/
/*!
@@ -2728,15 +2602,6 @@ Qt::MouseButtons QTabletEvent::buttons() const
*/
/*!
- \fn const QPointF &QTabletEvent::hiResGlobalPos() const
-
- The high precision coordinates delivered from the tablet expressed.
- Sub pixeling information is in the fractional part of the QPointF.
-
- \sa globalPos(), hiResGlobalX(), hiResGlobalY()
-*/
-
-/*!
\fn qreal &QTabletEvent::hiResGlobalX() const
The high precision x position of the tablet device.
@@ -2818,10 +2683,10 @@ Qt::MouseButtons QTabletEvent::buttons() const
\sa Qt::NativeGestureType, QGestureEvent
*/
+#if QT_DEPRECATED_SINCE(5, 10)
/*!
\deprecated The QTouchDevice parameter is now required
*/
-#if QT_DEPRECATED_SINCE(5, 10)
QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPointF &localPos, const QPointF &windowPos,
const QPointF &screenPos, qreal realValue, ulong sequenceId, quint64 intValue)
: QInputEvent(QEvent::NativeGesture), mGestureType(type),
@@ -3764,13 +3629,13 @@ static inline void formatTouchEvent(QDebug d, const QTouchEvent &t)
static void formatUnicodeString(QDebug d, const QString &s)
{
- d << '"' << hex;
+ d << '"' << Qt::hex;
for (int i = 0; i < s.size(); ++i) {
if (i)
d << ',';
d << "U+" << s.at(i).unicode();
}
- d << dec << '"';
+ d << Qt::dec << '"';
}
static inline void formatInputMethodEvent(QDebug d, const QInputMethodEvent *e)
@@ -3807,8 +3672,8 @@ static inline void formatInputMethodQueryEvent(QDebug d, const QInputMethodQuery
QDebugStateSaver saver(d);
d.noquote();
const Qt::InputMethodQueries queries = e->queries();
- d << "QInputMethodQueryEvent(queries=" << showbase << hex << int(queries)
- << noshowbase << dec << ", {";
+ d << "QInputMethodQueryEvent(queries=" << Qt::showbase << Qt::hex << int(queries)
+ << Qt::noshowbase << Qt::dec << ", {";
for (unsigned mask = 1; mask <= Qt::ImInputItemClipRectangle; mask<<=1) {
if (queries & mask) {
const Qt::InputMethodQuery query = static_cast<Qt::InputMethodQuery>(mask);
@@ -4001,7 +3866,7 @@ QDebug operator<<(QDebug dbg, const QTouchEvent::TouchPoint &tp)
{
QDebugStateSaver saver(dbg);
dbg.nospace();
- dbg << "TouchPoint(" << hex << tp.id() << dec << " (";
+ dbg << "TouchPoint(" << Qt::hex << tp.id() << Qt::dec << " (";
QtDebugUtils::formatQPoint(dbg, tp.pos());
dbg << ") ";
QtDebugUtils::formatQEnum(dbg, tp.state());
@@ -4072,10 +3937,15 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
case QEvent::Wheel: {
const QWheelEvent *we = static_cast<const QWheelEvent *>(e);
dbg << "QWheelEvent(" << we->phase();
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED // delta() and orientation()
if (!we->pixelDelta().isNull() || !we->angleDelta().isNull())
dbg << ", pixelDelta=" << we->pixelDelta() << ", angleDelta=" << we->angleDelta();
+#if QT_DEPRECATED_SINCE(5, 14)
else if (int qt4Delta = we->delta())
dbg << ", delta=" << qt4Delta << ", orientation=" << we->orientation();
+#endif
+QT_WARNING_POP
dbg << ')';
}
break;
@@ -4432,18 +4302,6 @@ QWindowStateChangeEvent::~QWindowStateChangeEvent()
QGraphicsItem::acceptTouchEvents()
*/
-/*! \enum QTouchEvent::DeviceType
- \obsolete
-
- This enum represents the type of device that generated a QTouchEvent.
-
- This enum has been deprecated. Use QTouchDevice::DeviceType instead.
- \omitvalue TouchPad
- \omitvalue TouchScreen
-
- \sa QTouchDevice::DeviceType, QTouchDevice::type(), QTouchEvent::device()
-*/
-
/*!
Constructs a QTouchEvent with the given \a eventType, \a device, and
\a touchPoints. The \a touchPointStates and \a modifiers
@@ -4483,16 +4341,6 @@ QTouchEvent::~QTouchEvent()
This is typically a QWidget or a QQuickItem. May be 0 when no specific target is available.
*/
-/*! \fn QTouchEvent::DeviceType QTouchEvent::deviceType() const
- \obsolete
-
- Returns the touch device Type, which is of type \l {QTouchEvent::DeviceType} {DeviceType}.
-
- This function has been deprecated. Use QTouchDevice::type() instead.
-
- \sa QTouchDevice::type(), QTouchEvent::device()
-*/
-
/*! \fn QTouchEvent::TouchPoint::TouchPoint(TouchPoint &&other)
Move-constructs a TouchPoint instance, making it point to the same
@@ -4921,7 +4769,7 @@ QVector<QPointF> QTouchEvent::TouchPoint::rawScreenPositions() const
/*! \internal */
void QTouchEvent::TouchPoint::setId(int id)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->id = id;
}
@@ -4929,7 +4777,7 @@ void QTouchEvent::TouchPoint::setId(int id)
/*! \internal */
void QTouchEvent::TouchPoint::setUniqueId(qint64 uid)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->uniqueId = QPointingDeviceUniqueId::fromNumericId(uid);
}
@@ -4937,7 +4785,7 @@ void QTouchEvent::TouchPoint::setUniqueId(qint64 uid)
/*! \internal */
void QTouchEvent::TouchPoint::setState(Qt::TouchPointStates state)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->state = state;
}
@@ -4945,7 +4793,7 @@ void QTouchEvent::TouchPoint::setState(Qt::TouchPointStates state)
/*! \internal */
void QTouchEvent::TouchPoint::setPos(const QPointF &pos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->pos = pos;
}
@@ -4953,7 +4801,7 @@ void QTouchEvent::TouchPoint::setPos(const QPointF &pos)
/*! \internal */
void QTouchEvent::TouchPoint::setScenePos(const QPointF &scenePos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->scenePos = scenePos;
}
@@ -4961,7 +4809,7 @@ void QTouchEvent::TouchPoint::setScenePos(const QPointF &scenePos)
/*! \internal */
void QTouchEvent::TouchPoint::setScreenPos(const QPointF &screenPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->screenPos = screenPos;
}
@@ -4969,7 +4817,7 @@ void QTouchEvent::TouchPoint::setScreenPos(const QPointF &screenPos)
/*! \internal */
void QTouchEvent::TouchPoint::setNormalizedPos(const QPointF &normalizedPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->normalizedPos = normalizedPos;
}
@@ -4977,7 +4825,7 @@ void QTouchEvent::TouchPoint::setNormalizedPos(const QPointF &normalizedPos)
/*! \internal */
void QTouchEvent::TouchPoint::setStartPos(const QPointF &startPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->startPos = startPos;
}
@@ -4985,7 +4833,7 @@ void QTouchEvent::TouchPoint::setStartPos(const QPointF &startPos)
/*! \internal */
void QTouchEvent::TouchPoint::setStartScenePos(const QPointF &startScenePos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->startScenePos = startScenePos;
}
@@ -4993,7 +4841,7 @@ void QTouchEvent::TouchPoint::setStartScenePos(const QPointF &startScenePos)
/*! \internal */
void QTouchEvent::TouchPoint::setStartScreenPos(const QPointF &startScreenPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->startScreenPos = startScreenPos;
}
@@ -5001,7 +4849,7 @@ void QTouchEvent::TouchPoint::setStartScreenPos(const QPointF &startScreenPos)
/*! \internal */
void QTouchEvent::TouchPoint::setStartNormalizedPos(const QPointF &startNormalizedPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->startNormalizedPos = startNormalizedPos;
}
@@ -5009,7 +4857,7 @@ void QTouchEvent::TouchPoint::setStartNormalizedPos(const QPointF &startNormaliz
/*! \internal */
void QTouchEvent::TouchPoint::setLastPos(const QPointF &lastPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->lastPos = lastPos;
}
@@ -5017,7 +4865,7 @@ void QTouchEvent::TouchPoint::setLastPos(const QPointF &lastPos)
/*! \internal */
void QTouchEvent::TouchPoint::setLastScenePos(const QPointF &lastScenePos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->lastScenePos = lastScenePos;
}
@@ -5025,7 +4873,7 @@ void QTouchEvent::TouchPoint::setLastScenePos(const QPointF &lastScenePos)
/*! \internal */
void QTouchEvent::TouchPoint::setLastScreenPos(const QPointF &lastScreenPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->lastScreenPos = lastScreenPos;
}
@@ -5033,7 +4881,7 @@ void QTouchEvent::TouchPoint::setLastScreenPos(const QPointF &lastScreenPos)
/*! \internal */
void QTouchEvent::TouchPoint::setLastNormalizedPos(const QPointF &lastNormalizedPos)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->lastNormalizedPos = lastNormalizedPos;
}
@@ -5044,7 +4892,7 @@ void QTouchEvent::TouchPoint::setLastNormalizedPos(const QPointF &lastNormalized
*/
void QTouchEvent::TouchPoint::setRect(const QRectF &rect)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->pos = rect.center();
d->ellipseDiameters = rect.size();
@@ -5055,7 +4903,7 @@ void QTouchEvent::TouchPoint::setRect(const QRectF &rect)
*/
void QTouchEvent::TouchPoint::setSceneRect(const QRectF &sceneRect)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->scenePos = sceneRect.center();
d->ellipseDiameters = sceneRect.size();
@@ -5066,7 +4914,7 @@ void QTouchEvent::TouchPoint::setSceneRect(const QRectF &sceneRect)
*/
void QTouchEvent::TouchPoint::setScreenRect(const QRectF &screenRect)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->screenPos = screenRect.center();
d->ellipseDiameters = screenRect.size();
@@ -5075,7 +4923,7 @@ void QTouchEvent::TouchPoint::setScreenRect(const QRectF &screenRect)
/*! \internal */
void QTouchEvent::TouchPoint::setPressure(qreal pressure)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->pressure = pressure;
}
@@ -5083,7 +4931,7 @@ void QTouchEvent::TouchPoint::setPressure(qreal pressure)
/*! \internal */
void QTouchEvent::TouchPoint::setRotation(qreal angle)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->rotation = angle;
}
@@ -5091,7 +4939,7 @@ void QTouchEvent::TouchPoint::setRotation(qreal angle)
/*! \internal */
void QTouchEvent::TouchPoint::setEllipseDiameters(const QSizeF &dia)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->ellipseDiameters = dia;
}
@@ -5099,7 +4947,7 @@ void QTouchEvent::TouchPoint::setEllipseDiameters(const QSizeF &dia)
/*! \internal */
void QTouchEvent::TouchPoint::setVelocity(const QVector2D &v)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->velocity = v;
}
@@ -5107,7 +4955,7 @@ void QTouchEvent::TouchPoint::setVelocity(const QVector2D &v)
/*! \internal */
void QTouchEvent::TouchPoint::setRawScreenPositions(const QVector<QPointF> &positions)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->rawScreenPositions = positions;
}
@@ -5117,7 +4965,7 @@ void QTouchEvent::TouchPoint::setRawScreenPositions(const QVector<QPointF> &posi
*/
void QTouchEvent::TouchPoint::setFlags(InfoFlags flags)
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d = d->detach();
d->flags = flags;
}
@@ -5320,7 +5168,7 @@ QScrollEvent::ScrollState QScrollEvent::scrollState() const
/*!
Creates a new QScreenOrientationChangeEvent
- \a orientation is the new orientation of the screen.
+ \a screenOrientation is the new orientation of the \a screen.
*/
QScreenOrientationChangeEvent::QScreenOrientationChangeEvent(QScreen *screen, Qt::ScreenOrientation screenOrientation)
: QEvent(QEvent::OrientationChange), m_screen(screen), m_orientation(screenOrientation)
@@ -5426,7 +5274,7 @@ QPointingDeviceUniqueId QPointingDeviceUniqueId::fromNumericId(qint64 id)
\sa isValid()
*/
-qint64 QPointingDeviceUniqueId::numericId() const Q_DECL_NOTHROW
+qint64 QPointingDeviceUniqueId::numericId() const noexcept
{
return m_numericId;
}
@@ -5438,7 +5286,7 @@ qint64 QPointingDeviceUniqueId::numericId() const Q_DECL_NOTHROW
Returns whether the two unique pointer IDs \a lhs and \a rhs identify the same pointer
(\c true) or not (\c false).
*/
-bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW
+bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
{
return lhs.numericId() == rhs.numericId();
}
@@ -5458,7 +5306,7 @@ bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL
Returns the hash value for \a key, using \a seed to seed the calculation.
*/
-uint qHash(QPointingDeviceUniqueId key, uint seed) Q_DECL_NOTHROW
+uint qHash(QPointingDeviceUniqueId key, uint seed) noexcept
{
return qHash(key.numericId(), seed);
}
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 0a8a1925e7..f363ece48b 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -175,24 +175,34 @@ class Q_GUI_EXPORT QWheelEvent : public QInputEvent
public:
enum { DefaultDeltasPerStep = 120 };
+#if QT_DEPRECATED_SINCE(5, 15)
+ // Actually deprecated since 5.0, in docs
+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient = Qt::Vertical);
+ // Actually deprecated since 5.0, in docs
+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF& globalPos, int delta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers,
Qt::Orientation orient = Qt::Vertical);
+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF& globalPos,
QPoint pixelDelta, QPoint angleDelta, int qt4Delta, Qt::Orientation qt4Orientation,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase);
+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta,
int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source);
+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted")
QWheelEvent(const QPointF &pos, const QPointF &globalPos, QPoint pixelDelta, QPoint angleDelta,
int qt4Delta, Qt::Orientation qt4Orientation, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase, Qt::MouseEventSource source, bool inverted);
+#endif
QWheelEvent(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta,
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Qt::ScrollPhase phase,
@@ -203,19 +213,35 @@ public:
inline QPoint pixelDelta() const { return pixelD; }
inline QPoint angleDelta() const { return angleD; }
+#if QT_DEPRECATED_SINCE(5, 15)
+ // Actually deprecated since 5.0, in docs
+ QT_DEPRECATED_VERSION_X_5_15("Use angleDelta()")
inline int delta() const { return qt4D; }
+ // Actually deprecated since 5.0, in docs
+ QT_DEPRECATED_VERSION_X_5_15("Use angleDelta()")
inline Qt::Orientation orientation() const { return qt4O; }
-
#ifndef QT_NO_INTEGER_EVENT_COORDINATES
+ QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline QPoint pos() const { return p.toPoint(); }
+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline QPoint globalPos() const { return g.toPoint(); }
+ QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline int x() const { return int(p.x()); }
+ QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline int y() const { return int(p.y()); }
+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline int globalX() const { return int(g.x()); }
+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline int globalY() const { return int(g.y()); }
#endif
+ QT_DEPRECATED_VERSION_X_5_15("Use position()")
inline const QPointF &posF() const { return p; }
+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()")
inline const QPointF &globalPosF() const { return g; }
+#endif // QT_DEPRECATED_SINCE(5, 15)
+
+ inline QPointF position() const { return p; }
+ inline QPointF globalPosition() const { return g; }
inline Qt::MouseButtons buttons() const { return mouseState; }
@@ -231,7 +257,7 @@ protected:
QPoint angleD;
int qt4D = 0;
Qt::Orientation qt4O = Qt::Vertical;
- Qt::MouseButtons mouseState;
+ Qt::MouseButtons mouseState = Qt::NoButton;
uint _unused_ : 2; // Kept for binary compatibility
uint src: 2;
bool invertedScrolling : 1;
@@ -549,7 +575,7 @@ public:
};
class Attribute {
public:
- Attribute(AttributeType typ, int s, int l, QVariant val) : type(typ), start(s), length(l), value(qMove(val)) {}
+ Attribute(AttributeType typ, int s, int l, QVariant val) : type(typ), start(s), length(l), value(std::move(val)) {}
Attribute(AttributeType typ, int s, int l) : type(typ), start(s), length(l), value() {}
AttributeType type;
@@ -811,14 +837,14 @@ class Q_GUI_EXPORT QPointingDeviceUniqueId
Q_PROPERTY(qint64 numericId READ numericId CONSTANT)
public:
Q_ALWAYS_INLINE
- Q_DECL_CONSTEXPR QPointingDeviceUniqueId() Q_DECL_NOTHROW : m_numericId(-1) {}
+ Q_DECL_CONSTEXPR QPointingDeviceUniqueId() noexcept : m_numericId(-1) {}
// compiler-generated copy/move ctor/assignment operators are ok!
// compiler-generated dtor is ok!
static QPointingDeviceUniqueId fromNumericId(qint64 id);
- Q_ALWAYS_INLINE Q_DECL_CONSTEXPR bool isValid() const Q_DECL_NOTHROW { return m_numericId != -1; }
- qint64 numericId() const Q_DECL_NOTHROW;
+ Q_ALWAYS_INLINE Q_DECL_CONSTEXPR bool isValid() const noexcept { return m_numericId != -1; }
+ qint64 numericId() const noexcept;
private:
// TODO: for TUIO 2, or any other type of complex token ID, an internal
@@ -836,10 +862,10 @@ template <> class QList<QPointingDeviceUniqueId> {}; // to prevent instantiation
#pragma qt_sync_resume_processing
#endif
-Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW;
-inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) Q_DECL_NOTHROW
+Q_GUI_EXPORT bool operator==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept;
+inline bool operator!=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
{ return !operator==(lhs, rhs); }
-Q_GUI_EXPORT uint qHash(QPointingDeviceUniqueId key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(QPointingDeviceUniqueId key, uint seed = 0) noexcept;
@@ -862,19 +888,17 @@ public:
explicit TouchPoint(int id = -1);
TouchPoint(const TouchPoint &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- TouchPoint(TouchPoint &&other) Q_DECL_NOEXCEPT
+ TouchPoint(TouchPoint &&other) noexcept
: d(nullptr)
{ qSwap(d, other.d); }
- TouchPoint &operator=(TouchPoint &&other) Q_DECL_NOEXCEPT
+ TouchPoint &operator=(TouchPoint &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
~TouchPoint();
TouchPoint &operator=(const TouchPoint &other)
{ if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
- void swap(TouchPoint &other) Q_DECL_NOEXCEPT
+ void swap(TouchPoint &other) noexcept
{ qSwap(d, other.d); }
int id() const;
@@ -942,6 +966,8 @@ public:
friend class QGuiApplicationPrivate;
friend class QApplication;
friend class QApplicationPrivate;
+ friend class QQuickPointerTouchEvent;
+ friend class QQuickMultiPointTouchArea;
};
#if QT_DEPRECATED_SINCE(5, 0)
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h
index 7df4a1e25b..b7645496f8 100644
--- a/src/gui/kernel/qevent_p.h
+++ b/src/gui/kernel/qevent_p.h
@@ -67,13 +67,14 @@ public:
state(Qt::TouchPointReleased),
pressure(-1),
rotation(0),
- ellipseDiameters(0, 0)
+ ellipseDiameters(0, 0),
+ stationaryWithModifiedProperty(false)
{ }
inline QTouchEventTouchPointPrivate *detach()
{
QTouchEventTouchPointPrivate *d = new QTouchEventTouchPointPrivate(*this);
- d->ref.store(1);
+ d->ref.storeRelaxed(1);
if (!this->ref.deref())
delete this;
return d;
@@ -91,6 +92,7 @@ public:
QSizeF ellipseDiameters;
QVector2D velocity;
QTouchEvent::TouchPoint::InfoFlags flags;
+ bool stationaryWithModifiedProperty : 1;
QVector<QPointF> rawScreenPositions;
};
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 3c85dbe097..54f3996b6e 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -58,6 +58,7 @@
#include <QtCore/private/qabstracteventdispatcher_p.h>
#include <QtCore/qmutex.h>
#include <QtCore/private/qthread_p.h>
+#include <QtCore/private/qlocking_p.h>
#include <QtCore/qdir.h>
#include <QtCore/qlibraryinfo.h>
#include <QtCore/qnumeric.h>
@@ -68,7 +69,7 @@
#include <qpalette.h>
#include <qscreen.h>
#include "qsessionmanager.h"
-#include <private/qcolorprofile_p.h>
+#include <private/qcolortrclut_p.h>
#include <private/qscreen_p.h>
#include <QtGui/qgenericpluginfactory.h>
@@ -146,6 +147,8 @@ QString QGuiApplicationPrivate::styleOverride;
Qt::ApplicationState QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive;
+Qt::HighDpiScaleFactorRoundingPolicy QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy =
+ Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor;
bool QGuiApplicationPrivate::highDpiScalingUpdated = false;
QPointer<QWindow> QGuiApplicationPrivate::currentDragWindow;
@@ -687,6 +690,8 @@ QGuiApplication::~QGuiApplication()
QGuiApplicationPrivate::lastCursorPosition = {qInf(), qInf()};
QGuiApplicationPrivate::currentMousePressWindow = QGuiApplicationPrivate::currentMouseWindow = nullptr;
QGuiApplicationPrivate::applicationState = Qt::ApplicationInactive;
+ QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy =
+ Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor;
QGuiApplicationPrivate::highDpiScalingUpdated = false;
QGuiApplicationPrivate::currentDragWindow = nullptr;
QGuiApplicationPrivate::tabletDevicePoints.clear();
@@ -1306,6 +1311,60 @@ static void init_plugins(const QList<QByteArray> &pluginList)
}
}
+#if QT_CONFIG(commandlineparser)
+void QGuiApplicationPrivate::addQtOptions(QList<QCommandLineOption> *options)
+{
+ QCoreApplicationPrivate::addQtOptions(options);
+
+#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
+ const QByteArray sessionType = qgetenv("XDG_SESSION_TYPE");
+ const bool x11 = sessionType == "x11";
+ // Technically the x11 aliases are only available if platformName is "xcb", but we can't know that here.
+#else
+ const bool x11 = false;
+#endif
+
+ options->append(QCommandLineOption(QStringLiteral("platform"),
+ QGuiApplication::tr("QPA plugin. See QGuiApplication documentation for available options for each plugin."), QStringLiteral("platformName[:options]")));
+ options->append(QCommandLineOption(QStringLiteral("platformpluginpath"),
+ QGuiApplication::tr("Path to the platform plugins."), QStringLiteral("path")));
+ options->append(QCommandLineOption(QStringLiteral("platformtheme"),
+ QGuiApplication::tr("Platform theme."), QStringLiteral("theme")));
+ options->append(QCommandLineOption(QStringLiteral("plugin"),
+ QGuiApplication::tr("Additional plugins to load, can be specified multiple times."), QStringLiteral("plugin")));
+ options->append(QCommandLineOption(QStringLiteral("qwindowgeometry"),
+ QGuiApplication::tr("Window geometry for the main window, using the X11-syntax, like 100x100+50+50."), QStringLiteral("geometry")));
+ options->append(QCommandLineOption(QStringLiteral("qwindowicon"),
+ QGuiApplication::tr("Default window icon."), QStringLiteral("icon")));
+ options->append(QCommandLineOption(QStringLiteral("qwindowtitle"),
+ QGuiApplication::tr("Title of the first window."), QStringLiteral("title")));
+ options->append(QCommandLineOption(QStringLiteral("reverse"),
+ QGuiApplication::tr("Sets the application's layout direction to Qt::RightToLeft (debugging helper).")));
+ options->append(QCommandLineOption(QStringLiteral("session"),
+ QGuiApplication::tr("Restores the application from an earlier session."), QStringLiteral("session")));
+
+ if (x11) {
+ options->append(QCommandLineOption(QStringLiteral("display"),
+ QGuiApplication::tr("Display name, overrides $DISPLAY."), QStringLiteral("display")));
+ options->append(QCommandLineOption(QStringLiteral("name"),
+ QGuiApplication::tr("Instance name according to ICCCM 4.1.2.5."), QStringLiteral("name")));
+ options->append(QCommandLineOption(QStringLiteral("nograb"),
+ QGuiApplication::tr("Disable mouse grabbing (useful in debuggers).")));
+ options->append(QCommandLineOption(QStringLiteral("dograb"),
+ QGuiApplication::tr("Force mouse grabbing (even when running in a debugger).")));
+ options->append(QCommandLineOption(QStringLiteral("visual"),
+ QGuiApplication::tr("ID of the X11 Visual to use."), QStringLiteral("id")));
+ // Not using the "QStringList names" solution for those aliases, because it makes the first column too wide
+ options->append(QCommandLineOption(QStringLiteral("geometry"),
+ QGuiApplication::tr("Alias for --windowgeometry."), QStringLiteral("geometry")));
+ options->append(QCommandLineOption(QStringLiteral("icon"),
+ QGuiApplication::tr("Alias for --windowicon."), QStringLiteral("icon")));
+ options->append(QCommandLineOption(QStringLiteral("title"),
+ QGuiApplication::tr("Alias for --windowtitle."), QStringLiteral("title")));
+ }
+}
+#endif // QT_CONFIG(commandlineparser)
+
void QGuiApplicationPrivate::createPlatformIntegration()
{
QHighDpiScaling::initHighDpiScaling();
@@ -1648,8 +1707,6 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
platform_theme = 0;
delete platform_integration;
platform_integration = 0;
- delete m_a8ColorProfile.load();
- delete m_a32ColorProfile.load();
window_list.clear();
screen_list.clear();
@@ -1806,7 +1863,20 @@ bool QGuiApplication::event(QEvent *e)
{
if(e->type() == QEvent::LanguageChange) {
setLayoutDirection(qt_detectRTLLanguage()?Qt::RightToLeft:Qt::LeftToRight);
+ } else if (e->type() == QEvent::Quit) {
+ // Close open windows. This is done in order to deliver de-expose
+ // events while the event loop is still running.
+ for (QWindow *topLevelWindow : QGuiApplication::topLevelWindows()) {
+ // Already closed windows will not have a platform window, skip those
+ if (!topLevelWindow->handle())
+ continue;
+ if (!topLevelWindow->close()) {
+ e->ignore();
+ return true;
+ }
+ }
}
+
return QCoreApplication::event(e);
}
@@ -1832,7 +1902,11 @@ bool QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow *window,
return platformWindow->windowEvent(event);
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result)
+#endif
{
return window->nativeEvent(eventType, message, result);
}
@@ -1879,6 +1953,9 @@ void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePriv
QWindowSystemInterfacePrivate::ApplicationStateChangedEvent * changeEvent = static_cast<QWindowSystemInterfacePrivate::ApplicationStateChangedEvent *>(e);
QGuiApplicationPrivate::setApplicationState(changeEvent->newState, changeEvent->forcePropagate); }
break;
+ case QWindowSystemInterfacePrivate::ApplicationTermination:
+ QGuiApplicationPrivate::processApplicationTermination(e);
+ break;
case QWindowSystemInterfacePrivate::FlushEvents: {
QWindowSystemInterfacePrivate::FlushEventsEvent *flushEventsEvent = static_cast<QWindowSystemInterfacePrivate::FlushEventsEvent *>(e);
QWindowSystemInterface::deferredFlushWindowSystemEvents(flushEventsEvent->flags); }
@@ -2183,8 +2260,16 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
return;
}
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation,
mouse_buttons, e->modifiers, e->phase, e->source, e->inverted);
+QT_WARNING_POP
+#else
+ QWheelEvent ev(localPoint, globalPoint, e->pixelDelta, e->angleDelta,
+ mouse_buttons, e->modifiers, e->phase, e->inverted, e->source);
+#endif
ev.setTimestamp(e->timestamp);
QGuiApplication::sendSpontaneousEvent(window, &ev);
#else
@@ -2458,9 +2543,8 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl
QCloseEvent event;
QGuiApplication::sendSpontaneousEvent(e->window.data(), &event);
- if (e->accepted) {
- *(e->accepted) = event.isAccepted();
- }
+
+ e->eventAccepted = event.isAccepted();
}
void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e)
@@ -2777,10 +2861,12 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (touchPoint.state() == Qt::TouchPointStationary) {
if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) {
touchInfo.touchPoint.setVelocity(touchPoint.velocity());
+ touchPoint.d->stationaryWithModifiedProperty = true;
stationaryTouchPointChangedProperty = true;
}
if (!qFuzzyCompare(touchInfo.touchPoint.pressure(), touchPoint.pressure())) {
touchInfo.touchPoint.setPressure(touchPoint.pressure());
+ touchPoint.d->stationaryWithModifiedProperty = true;
stationaryTouchPointChangedProperty = true;
}
} else {
@@ -3240,7 +3326,7 @@ void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window)
QFont QGuiApplication::font()
{
Q_ASSERT_X(QGuiApplicationPrivate::self, "QGuiApplication::font()", "no QGuiApplication instance");
- QMutexLocker locker(&applicationFontMutex);
+ const auto locker = qt_scoped_lock(applicationFontMutex);
initFontUnlocked();
return *QGuiApplicationPrivate::app_font;
}
@@ -3252,7 +3338,7 @@ QFont QGuiApplication::font()
*/
void QGuiApplication::setFont(const QFont &font)
{
- QMutexLocker locker(&applicationFontMutex);
+ auto locker = qt_unique_lock(applicationFontMutex);
const bool emitChange = !QGuiApplicationPrivate::app_font
|| (*QGuiApplicationPrivate::app_font != font);
if (!QGuiApplicationPrivate::app_font)
@@ -3419,6 +3505,13 @@ bool QGuiApplicationPrivate::tryCloseRemainingWindows(QWindowList processedWindo
return true;
}
+void QGuiApplicationPrivate::processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *windowSystemEvent)
+{
+ QEvent event(QEvent::Quit);
+ QGuiApplication::sendSpontaneousEvent(QGuiApplication::instance(), &event);
+ windowSystemEvent->eventAccepted = event.isAccepted();
+}
+
/*!
\since 5.2
\fn Qt::ApplicationState QGuiApplication::applicationState()
@@ -3437,6 +3530,46 @@ Qt::ApplicationState QGuiApplication::applicationState()
}
/*!
+ \since 5.14
+
+ Sets the high-DPI scale factor rounding policy for the application. The
+ \a policy decides how non-integer scale factors (such as Windows 150%) are
+ handled, for applications that have AA_EnableHighDpiScaling enabled.
+
+ The two principal options are whether fractional scale factors should
+ be rounded to an integer or not. Keeping the scale factor as-is will
+ make the user interface size match the OS setting exactly, but may cause
+ painting errors, for example with the Windows style.
+
+ If rounding is wanted, then which type of rounding should be decided
+ next. Mathematically correct rounding is supported but may not give
+ the best visual results: Consider if you want to render 1.5x as 1x
+ ("small UI") or as 2x ("large UI"). See the Qt::HighDpiScaleFactorRoundingPolicy
+ enum for a complete list of all options.
+
+ This function must be called before creating the application object,
+ and can be overridden by setting the QT_SCALE_FACTOR_ROUNDING_POLICY
+ environment variable. The QGuiApplication::highDpiScaleFactorRoundingPolicy()
+ accessor will reflect the environment, if set.
+
+ The default value is Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor.
+*/
+void QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy)
+{
+ QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy = policy;
+}
+
+/*!
+ \since 5.14
+
+ Returns the high-DPI scale factor rounding policy.
+*/
+Qt::HighDpiScaleFactorRoundingPolicy QGuiApplication::highDpiScaleFactorRoundingPolicy()
+{
+ return QGuiApplicationPrivate::highDpiScaleFactorRoundingPolicy;
+}
+
+/*!
\since 5.2
\fn void QGuiApplication::applicationStateChanged(Qt::ApplicationState state)
@@ -3976,7 +4109,7 @@ void QGuiApplicationPrivate::notifyThemeChanged()
sendApplicationPaletteChange();
}
if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
- QMutexLocker locker(&applicationFontMutex);
+ const auto locker = qt_scoped_lock(applicationFontMutex);
clearFontUnlocked();
initFontUnlocked();
}
@@ -4000,32 +4133,26 @@ void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag)
}
#endif
-const QColorProfile *QGuiApplicationPrivate::colorProfileForA8Text()
+const QColorTrcLut *QGuiApplicationPrivate::colorProfileForA8Text()
{
#ifdef Q_OS_WIN
- QColorProfile *result = m_a8ColorProfile.load();
- if (!result){
- QColorProfile *cs = QColorProfile::fromGamma(2.31); // This is a hard-coded thing for Windows text rendering
- if (!m_a8ColorProfile.testAndSetRelease(0, cs))
- delete cs;
- result = m_a8ColorProfile.load();
+ if (!m_a8ColorProfile){
+ QColorTrcLut *cs = QColorTrcLut::fromGamma(2.31); // This is a hard-coded thing for Windows text rendering
+ m_a8ColorProfile.reset(cs);
}
- return result;
+ return m_a8ColorProfile.get();
#else
return colorProfileForA32Text();
#endif
}
-const QColorProfile *QGuiApplicationPrivate::colorProfileForA32Text()
+const QColorTrcLut *QGuiApplicationPrivate::colorProfileForA32Text()
{
- QColorProfile *result = m_a32ColorProfile.load();
- if (!result){
- QColorProfile *cs = QColorProfile::fromGamma(fontSmoothingGamma);
- if (!m_a32ColorProfile.testAndSetRelease(0, cs))
- delete cs;
- result = m_a32ColorProfile.load();
+ if (!m_a32ColorProfile) {
+ QColorTrcLut *cs = QColorTrcLut::fromGamma(fontSmoothingGamma);
+ m_a32ColorProfile.reset(cs);
}
- return result;
+ return m_a32ColorProfile.get();
}
void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object)
diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h
index 5ea72fa0f6..fc74c5299a 100644
--- a/src/gui/kernel/qguiapplication.h
+++ b/src/gui/kernel/qguiapplication.h
@@ -156,6 +156,9 @@ public:
static Qt::ApplicationState applicationState();
+ static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy);
+ static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy();
+
static int exec();
bool notify(QObject *, QEvent *) override;
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 714c72ac08..26f65b2f16 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -55,6 +55,7 @@
#include <QtGui/qguiapplication.h>
#include <QtCore/QPointF>
+#include <QtCore/QSharedPointer>
#include <QtCore/private/qcoreapplication_p.h>
#include <QtCore/private/qthread_p.h>
@@ -66,7 +67,7 @@
QT_BEGIN_NAMESPACE
-class QColorProfile;
+class QColorTrcLut;
class QPlatformIntegration;
class QPlatformTheme;
class QPlatformDragQtResponse;
@@ -91,6 +92,9 @@ public:
virtual void notifyLayoutDirectionChange();
virtual void notifyActiveWindowChange(QWindow *previous);
+#if QT_CONFIG(commandlineparser)
+ void addQtOptions(QList<QCommandLineOption> *options) override;
+#endif
virtual bool shouldQuit() override;
bool shouldQuitInternal(const QWindowList &processedWindows);
@@ -112,9 +116,9 @@ public:
static QAbstractEventDispatcher *qt_qpa_core_dispatcher()
{
if (QCoreApplication::instance())
- return QCoreApplication::instance()->d_func()->threadData->eventDispatcher.load();
+ return QCoreApplication::instance()->d_func()->threadData->eventDispatcher.loadRelaxed();
else
- return 0;
+ return nullptr;
}
static void processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent *e);
@@ -137,6 +141,8 @@ public:
static void processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e);
+ static void processApplicationTermination(QWindowSystemInterfacePrivate::WindowSystemEvent *e);
+
static void updateFilteredScreenOrientation(QScreen *screen);
static void reportScreenOrientationChange(QScreen *screen);
static void processScreenOrientationChange(QWindowSystemInterfacePrivate::ScreenOrientationEvent *e);
@@ -171,7 +177,11 @@ public:
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ static bool processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result);
+#else
static bool processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result);
+#endif
static bool sendQWindowEventToQPlatformWindow(QWindow *window, QEvent *event);
@@ -204,7 +214,7 @@ public:
static void showModalWindow(QWindow *window);
static void hideModalWindow(QWindow *window);
static void updateBlockedStatus(QWindow *window);
- virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const;
+ virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = nullptr) const;
virtual bool popupActive() { return false; }
static ulong mousePressTime;
@@ -215,6 +225,7 @@ public:
static QWindow *currentMouseWindow;
static QWindow *currentMousePressWindow;
static Qt::ApplicationState applicationState;
+ static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy;
static bool highDpiScalingUpdated;
static QPointer<QWindow> currentDragWindow;
@@ -298,8 +309,8 @@ public:
static QInputDeviceManager *inputDeviceManager();
- const QColorProfile *colorProfileForA8Text();
- const QColorProfile *colorProfileForA32Text();
+ const QColorTrcLut *colorProfileForA8Text();
+ const QColorTrcLut *colorProfileForA32Text();
// hook reimplemented in QApplication to apply the QStyle function on the QIcon
virtual QPixmap applyQIconStyleHelper(QIcon::Mode, const QPixmap &basePixmap) const { return basePixmap; }
@@ -326,8 +337,8 @@ private:
static QGuiApplicationPrivate *self;
static QTouchDevice *m_fakeTouchDevice;
static int m_fakeMouseSourcePointId;
- QAtomicPointer<QColorProfile> m_a8ColorProfile;
- QAtomicPointer<QColorProfile> m_a32ColorProfile;
+ QSharedPointer<QColorTrcLut> m_a8ColorProfile;
+ QSharedPointer<QColorTrcLut> m_a32ColorProfile;
bool ownGlobalShareContext;
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index 090217187e..edca8d9423 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -68,7 +68,6 @@
#include "qdebug.h"
#include "qmap.h"
#include "qdatetime.h"
-#include "qeasingcurve.h"
#include "qlist.h"
#include "qstring.h"
#include "qstringlist.h"
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 8189eebedd..0782a49481 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -46,6 +46,9 @@
#include <private/qguiapplication_p.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qmetaobject.h>
+
+#include <algorithm>
QT_BEGIN_NAMESPACE
@@ -53,9 +56,29 @@ Q_LOGGING_CATEGORY(lcScaling, "qt.scaling");
#ifndef QT_NO_HIGHDPISCALING
static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO";
+static const char legacyAutoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR";
+
+static const char enableHighDpiScalingEnvVar[] = "QT_ENABLE_HIGHDPI_SCALING";
static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR";
-static const char autoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR";
static const char screenFactorsEnvVar[] = "QT_SCREEN_SCALE_FACTORS";
+static const char scaleFactorRoundingPolicyEnvVar[] = "QT_SCALE_FACTOR_ROUNDING_POLICY";
+static const char dpiAdjustmentPolicyEnvVar[] = "QT_DPI_ADJUSTMENT_POLICY";
+static const char usePhysicalDpiEnvVar[] = "QT_USE_PHYSICAL_DPI";
+
+// Per-screen scale factors for named screens set with QT_SCREEN_SCALE_FACTORS
+// are stored here. Use a global hash to keep the factor across screen
+// disconnect/connect cycles where the screen object may be deleted.
+typedef QHash<QString, qreal> QScreenScaleFactorHash;
+Q_GLOBAL_STATIC(QScreenScaleFactorHash, qNamedScreenScaleFactors);
+
+// Reads and interprets the given environment variable as a bool,
+// returns the default value if not set.
+static bool qEnvironmentVariableAsBool(const char *name, bool defaultValue)
+{
+ bool ok = false;
+ int value = qEnvironmentVariableIntValue(name, &ok);
+ return ok ? value > 0 : defaultValue;
+}
static inline qreal initialGlobalScaleFactor()
{
@@ -63,23 +86,30 @@ static inline qreal initialGlobalScaleFactor()
qreal result = 1;
if (qEnvironmentVariableIsSet(scaleFactorEnvVar)) {
bool ok;
- const qreal f = qgetenv(scaleFactorEnvVar).toDouble(&ok);
+ const qreal f = qEnvironmentVariable(scaleFactorEnvVar).toDouble(&ok);
if (ok && f > 0) {
qCDebug(lcScaling) << "Apply " << scaleFactorEnvVar << f;
result = f;
}
} else {
+ // Check for deprecated environment variables.
if (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)) {
qWarning("Warning: %s is deprecated. Instead use:\n"
" %s to enable platform plugin controlled per-screen factors.\n"
- " %s to set per-screen factors.\n"
+ " %s to set per-screen DPI.\n"
" %s to set the application global scale factor.",
- legacyDevicePixelEnvVar, autoScreenEnvVar, screenFactorsEnvVar, scaleFactorEnvVar);
+ legacyDevicePixelEnvVar, legacyAutoScreenEnvVar, screenFactorsEnvVar, scaleFactorEnvVar);
int dpr = qEnvironmentVariableIntValue(legacyDevicePixelEnvVar);
if (dpr > 0)
result = dpr;
}
+
+ if (qEnvironmentVariableIsSet(legacyAutoScreenEnvVar)) {
+ qWarning("Warning: %s is deprecated. Instead use:\n"
+ " %s to enable platform plugin controlled per-screen factors.",
+ legacyAutoScreenEnvVar, enableHighDpiScalingEnvVar);
+ }
}
return result;
}
@@ -226,7 +256,6 @@ bool QHighDpiScaling::m_usePixelDensity = false; // use scale factor from platfo
bool QHighDpiScaling::m_pixelDensityScalingActive = false; // pixel density scale factor > 1
bool QHighDpiScaling::m_globalScalingActive = false; // global scale factor is active
bool QHighDpiScaling::m_screenFactorSet = false; // QHighDpiScaling::setScreenFactor has been used
-QDpi QHighDpiScaling::m_logicalDpi = QDpi(-1,-1); // The scaled logical DPI of the primary screen
/*
Initializes the QHighDpiScaling global variables. Called before the
@@ -238,16 +267,215 @@ static inline bool usePixelDensity()
// Determine if we should set a scale factor based on the pixel density
// reported by the platform plugin. There are several enablers and several
// disablers. A single disable may veto all other enablers.
+
+ // First, check of there is an explicit disable.
if (QCoreApplication::testAttribute(Qt::AA_DisableHighDpiScaling))
return false;
bool screenEnvValueOk;
- const int screenEnvValue = qEnvironmentVariableIntValue(autoScreenEnvVar, &screenEnvValueOk);
+ const int screenEnvValue = qEnvironmentVariableIntValue(legacyAutoScreenEnvVar, &screenEnvValueOk);
if (screenEnvValueOk && screenEnvValue < 1)
return false;
+ bool enableEnvValueOk;
+ const int enableEnvValue = qEnvironmentVariableIntValue(enableHighDpiScalingEnvVar, &enableEnvValueOk);
+ if (enableEnvValueOk && enableEnvValue < 1)
+ return false;
+
+ // Then return if there was an enable.
return QCoreApplication::testAttribute(Qt::AA_EnableHighDpiScaling)
|| (screenEnvValueOk && screenEnvValue > 0)
- || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar) &&
- qgetenv(legacyDevicePixelEnvVar).compare("auto", Qt::CaseInsensitive) == 0);
+ || (enableEnvValueOk && enableEnvValue > 0)
+ || (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)
+ && qEnvironmentVariable(legacyDevicePixelEnvVar).compare(QLatin1String("auto"), Qt::CaseInsensitive) == 0);
+}
+
+qreal QHighDpiScaling::rawScaleFactor(const QPlatformScreen *screen)
+{
+ // Determine if physical DPI should be used
+ static const bool usePhysicalDpi = qEnvironmentVariableAsBool(usePhysicalDpiEnvVar, false);
+
+ // Calculate scale factor beased on platform screen DPI values
+ qreal factor;
+ QDpi platformBaseDpi = screen->logicalBaseDpi();
+ if (usePhysicalDpi) {
+ qreal platformPhysicalDpi = screen->screen()->physicalDotsPerInch();
+ factor = qreal(platformPhysicalDpi) / qreal(platformBaseDpi.first);
+ } else {
+ const QDpi platformLogicalDpi = QPlatformScreen::overrideDpi(screen->logicalDpi());
+ factor = qreal(platformLogicalDpi.first) / qreal(platformBaseDpi.first);
+ }
+
+ return factor;
+}
+
+template <class EnumType>
+struct EnumLookup
+{
+ const char *name;
+ EnumType value;
+};
+
+template <class EnumType>
+static bool operator==(const EnumLookup<EnumType> &e1, const EnumLookup<EnumType> &e2)
+{
+ return qstricmp(e1.name, e2.name) == 0;
+}
+
+template <class EnumType>
+static QByteArray joinEnumValues(const EnumLookup<EnumType> *i1, const EnumLookup<EnumType> *i2)
+{
+ QByteArray result;
+ for (; i1 < i2; ++i1) {
+ if (!result.isEmpty())
+ result += QByteArrayLiteral(", ");
+ result += i1->name;
+ }
+ return result;
+}
+
+using ScaleFactorRoundingPolicyLookup = EnumLookup<Qt::HighDpiScaleFactorRoundingPolicy>;
+
+static const ScaleFactorRoundingPolicyLookup scaleFactorRoundingPolicyLookup[] =
+{
+ {"Round", Qt::HighDpiScaleFactorRoundingPolicy::Round},
+ {"Ceil", Qt::HighDpiScaleFactorRoundingPolicy::Ceil},
+ {"Floor", Qt::HighDpiScaleFactorRoundingPolicy::Floor},
+ {"RoundPreferFloor", Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor},
+ {"PassThrough", Qt::HighDpiScaleFactorRoundingPolicy::PassThrough}
+};
+
+static Qt::HighDpiScaleFactorRoundingPolicy
+ lookupScaleFactorRoundingPolicy(const QByteArray &v)
+{
+ auto end = std::end(scaleFactorRoundingPolicyLookup);
+ auto it = std::find(std::begin(scaleFactorRoundingPolicyLookup), end,
+ ScaleFactorRoundingPolicyLookup{v.constData(), Qt::HighDpiScaleFactorRoundingPolicy::Unset});
+ return it != end ? it->value : Qt::HighDpiScaleFactorRoundingPolicy::Unset;
+}
+
+using DpiAdjustmentPolicyLookup = EnumLookup<QHighDpiScaling::DpiAdjustmentPolicy>;
+
+static const DpiAdjustmentPolicyLookup dpiAdjustmentPolicyLookup[] =
+{
+ {"AdjustDpi", QHighDpiScaling::DpiAdjustmentPolicy::Enabled},
+ {"DontAdjustDpi", QHighDpiScaling::DpiAdjustmentPolicy::Disabled},
+ {"AdjustUpOnly", QHighDpiScaling::DpiAdjustmentPolicy::UpOnly}
+};
+
+static QHighDpiScaling::DpiAdjustmentPolicy
+ lookupDpiAdjustmentPolicy(const QByteArray &v)
+{
+ auto end = std::end(dpiAdjustmentPolicyLookup);
+ auto it = std::find(std::begin(dpiAdjustmentPolicyLookup), end,
+ DpiAdjustmentPolicyLookup{v.constData(), QHighDpiScaling::DpiAdjustmentPolicy::Unset});
+ return it != end ? it->value : QHighDpiScaling::DpiAdjustmentPolicy::Unset;
+}
+
+qreal QHighDpiScaling::roundScaleFactor(qreal rawFactor)
+{
+ // Apply scale factor rounding policy. Using mathematically correct rounding
+ // may not give the most desirable visual results, especially for
+ // critical fractions like .5. In general, rounding down results in visual
+ // sizes that are smaller than the ideal size, and opposite for rounding up.
+ // Rounding down is then preferable since "small UI" is a more acceptable
+ // high-DPI experience than "large UI".
+ static auto scaleFactorRoundingPolicy = Qt::HighDpiScaleFactorRoundingPolicy::Unset;
+
+ // Determine rounding policy
+ if (scaleFactorRoundingPolicy == Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
+ // Check environment
+ if (qEnvironmentVariableIsSet(scaleFactorRoundingPolicyEnvVar)) {
+ QByteArray policyText = qgetenv(scaleFactorRoundingPolicyEnvVar);
+ auto policyEnumValue = lookupScaleFactorRoundingPolicy(policyText);
+ if (policyEnumValue != Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
+ scaleFactorRoundingPolicy = policyEnumValue;
+ } else {
+ auto values = joinEnumValues(std::begin(scaleFactorRoundingPolicyLookup),
+ std::end(scaleFactorRoundingPolicyLookup));
+ qWarning("Unknown scale factor rounding policy: %s. Supported values are: %s.",
+ policyText.constData(), values.constData());
+ }
+ }
+
+ // Check application object if no environment value was set.
+ if (scaleFactorRoundingPolicy == Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
+ scaleFactorRoundingPolicy = QGuiApplication::highDpiScaleFactorRoundingPolicy();
+ } else {
+ // Make application setting reflect environment
+ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(scaleFactorRoundingPolicy);
+ }
+ }
+
+ // Apply rounding policy.
+ qreal roundedFactor = rawFactor;
+ switch (scaleFactorRoundingPolicy) {
+ case Qt::HighDpiScaleFactorRoundingPolicy::Round:
+ roundedFactor = qRound(rawFactor);
+ break;
+ case Qt::HighDpiScaleFactorRoundingPolicy::Ceil:
+ roundedFactor = qCeil(rawFactor);
+ break;
+ case Qt::HighDpiScaleFactorRoundingPolicy::Floor:
+ roundedFactor = qFloor(rawFactor);
+ break;
+ case Qt::HighDpiScaleFactorRoundingPolicy::RoundPreferFloor:
+ // Round up for .75 and higher. This favors "small UI" over "large UI".
+ roundedFactor = rawFactor - qFloor(rawFactor) < 0.75
+ ? qFloor(rawFactor) : qCeil(rawFactor);
+ break;
+ case Qt::HighDpiScaleFactorRoundingPolicy::PassThrough:
+ case Qt::HighDpiScaleFactorRoundingPolicy::Unset:
+ break;
+ }
+
+ // Don't round down to to zero; clamp the minimum (rounded) factor to 1.
+ // This is not a common case but can happen if a display reports a very
+ // low DPI.
+ if (scaleFactorRoundingPolicy != Qt::HighDpiScaleFactorRoundingPolicy::PassThrough)
+ roundedFactor = qMax(roundedFactor, qreal(1));
+
+ return roundedFactor;
+}
+
+QDpi QHighDpiScaling::effectiveLogicalDpi(const QPlatformScreen *screen, qreal rawFactor, qreal roundedFactor)
+{
+ // Apply DPI adjustment policy, if needed. If enabled this will change the
+ // reported logical DPI to account for the difference between the rounded
+ // scale factor and the actual scale factor. The effect is that text size
+ // will be correct for the screen dpi, but may be (slightly) out of sync
+ // with the rest of the UI. The amount of out-of-synch-ness depends on how
+ // well user code handles a non-standard DPI values, but since the
+ // adjustment is small (typically +/- 48 max) this might be OK.
+ static auto dpiAdjustmentPolicy = DpiAdjustmentPolicy::Unset;
+
+ // Determine adjustment policy.
+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Unset) {
+ if (qEnvironmentVariableIsSet(dpiAdjustmentPolicyEnvVar)) {
+ QByteArray policyText = qgetenv(dpiAdjustmentPolicyEnvVar);
+ auto policyEnumValue = lookupDpiAdjustmentPolicy(policyText);
+ if (policyEnumValue != DpiAdjustmentPolicy::Unset) {
+ dpiAdjustmentPolicy = policyEnumValue;
+ } else {
+ auto values = joinEnumValues(std::begin(dpiAdjustmentPolicyLookup),
+ std::end(dpiAdjustmentPolicyLookup));
+ qWarning("Unknown DPI adjustment policy: %s. Supported values are: %s.",
+ policyText.constData(), values.constData());
+ }
+ }
+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Unset)
+ dpiAdjustmentPolicy = DpiAdjustmentPolicy::UpOnly;
+ }
+
+ // Apply adjustment policy.
+ const QDpi baseDpi = screen->logicalBaseDpi();
+ const qreal dpiAdjustmentFactor = rawFactor / roundedFactor;
+
+ // Return the base DPI for cases where there is no adjustment
+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::Disabled)
+ return baseDpi;
+ if (dpiAdjustmentPolicy == DpiAdjustmentPolicy::UpOnly && dpiAdjustmentFactor < 1)
+ return baseDpi;
+
+ return QDpi(baseDpi.first * dpiAdjustmentFactor, baseDpi.second * dpiAdjustmentFactor);
}
void QHighDpiScaling::initHighDpiScaling()
@@ -260,8 +488,6 @@ void QHighDpiScaling::initHighDpiScaling()
m_pixelDensityScalingActive = false; //set in updateHighDpiScaling below
- // we update m_active in updateHighDpiScaling, but while we create the
- // screens, we have to assume that m_usePixelDensity implies scaling
m_active = m_globalScalingActive || m_usePixelDensity;
}
@@ -281,22 +507,21 @@ void QHighDpiScaling::updateHighDpiScaling()
}
if (qEnvironmentVariableIsSet(screenFactorsEnvVar)) {
int i = 0;
- const auto specs = qgetenv(screenFactorsEnvVar).split(';');
- for (const QByteArray &spec : specs) {
- QScreen *screen = 0;
- int equalsPos = spec.lastIndexOf('=');
- double factor = 0;
+ const QString spec = qEnvironmentVariable(screenFactorsEnvVar);
+ const auto specs = spec.splitRef(QLatin1Char(';'));
+ for (const QStringRef &spec : specs) {
+ int equalsPos = spec.lastIndexOf(QLatin1Char('='));
+ qreal factor = 0;
if (equalsPos > 0) {
// support "name=factor"
- QByteArray name = spec.mid(0, equalsPos);
- QByteArray f = spec.mid(equalsPos + 1);
bool ok;
- factor = f.toDouble(&ok);
- if (ok) {
+ const auto name = spec.left(equalsPos);
+ factor = spec.mid(equalsPos + 1).toDouble(&ok);
+ if (ok && factor > 0 ) {
const auto screens = QGuiApplication::screens();
for (QScreen *s : screens) {
- if (s->name() == QString::fromLocal8Bit(name)) {
- screen = s;
+ if (s->name() == name) {
+ setScreenFactor(s, factor);
break;
}
}
@@ -305,23 +530,15 @@ void QHighDpiScaling::updateHighDpiScaling()
// listing screens in order
bool ok;
factor = spec.toDouble(&ok);
- if (ok && i < QGuiApplication::screens().count())
- screen = QGuiApplication::screens().at(i);
+ if (ok && factor > 0 && i < QGuiApplication::screens().count()) {
+ QScreen *screen = QGuiApplication::screens().at(i);
+ setScreenFactor(screen, factor);
+ }
}
- if (screen)
- setScreenFactor(screen, factor);
++i;
}
}
- m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
-
- QScreen *primaryScreen = QGuiApplication::primaryScreen();
- if (!primaryScreen)
- return;
- QPlatformScreen *platformScreen = primaryScreen->handle();
- qreal sf = screenSubfactor(platformScreen);
- QDpi primaryDpi = platformScreen->logicalDpi();
- m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf);
+ m_active = m_globalScalingActive || m_screenFactorSet || m_usePixelDensity;
}
/*
@@ -353,7 +570,14 @@ void QHighDpiScaling::setScreenFactor(QScreen *screen, qreal factor)
m_screenFactorSet = true;
m_active = true;
}
- screen->setProperty(scaleFactorProperty, QVariant(factor));
+
+ // Prefer associating the factor with screen name over the object
+ // since the screen object may be deleted on screen disconnects.
+ const QString name = screen->name();
+ if (name.isEmpty())
+ screen->setProperty(scaleFactorProperty, QVariant(factor));
+ else
+ qNamedScreenScaleFactors()->insert(name, factor);
// hack to force re-evaluation of screen geometry
if (screen->handle())
@@ -420,36 +644,53 @@ QPoint QHighDpiScaling::mapPositionFromGlobal(const QPoint &pos, const QPoint &w
qreal QHighDpiScaling::screenSubfactor(const QPlatformScreen *screen)
{
- qreal factor = qreal(1.0);
- if (screen) {
- if (m_usePixelDensity) {
- qreal pixelDensity = screen->pixelDensity();
-
- // Pixel density reported by the screen is sometimes not precise enough,
- // so recalculate it: divide px (physical pixels) by dp (device-independent pixels)
- // for both width and height, and then use the average if it is different from
- // the one initially reported by the screen
- QRect screenGeometry = screen->geometry();
- qreal wFactor = qreal(screenGeometry.width()) / qRound(screenGeometry.width() / pixelDensity);
- qreal hFactor = qreal(screenGeometry.height()) / qRound(screenGeometry.height() / pixelDensity);
- qreal averageDensity = (wFactor + hFactor) / 2;
- if (!qFuzzyCompare(pixelDensity, averageDensity))
- pixelDensity = averageDensity;
-
- factor *= pixelDensity;
+ auto factor = qreal(1.0);
+ if (!screen)
+ return factor;
+
+ // Unlike the other code where factors are combined by multiplication,
+ // factors from QT_SCREEN_SCALE_FACTORS takes precedence over the factor
+ // computed from platform plugin DPI. The rationale is that the user is
+ // setting the factor to override erroneous DPI values.
+ bool screenPropertyUsed = false;
+ if (m_screenFactorSet) {
+ // Check if there is a factor set on the screen object or associated
+ // with the screen name. These are mutually exclusive, so checking
+ // order is not significant.
+ if (auto qScreen = screen->screen()) {
+ auto screenFactor = qScreen->property(scaleFactorProperty).toReal(&screenPropertyUsed);
+ if (screenPropertyUsed)
+ factor = screenFactor;
}
- if (m_screenFactorSet) {
- QVariant screenFactor = screen->screen()->property(scaleFactorProperty);
- if (screenFactor.isValid())
- factor *= screenFactor.toReal();
+
+ if (!screenPropertyUsed) {
+ auto byNameIt = qNamedScreenScaleFactors()->constFind(screen->name());
+ if ((screenPropertyUsed = byNameIt != qNamedScreenScaleFactors()->cend()))
+ factor = *byNameIt;
}
}
+
+ if (!screenPropertyUsed && m_usePixelDensity)
+ factor = roundScaleFactor(rawScaleFactor(screen));
+
return factor;
}
-QDpi QHighDpiScaling::logicalDpi()
+QDpi QHighDpiScaling::logicalDpi(const QScreen *screen)
{
- return m_logicalDpi;
+ // (Note: m_active test is performed at call site.)
+ if (!screen || !screen->handle())
+ return QDpi(96, 96);
+
+ if (!m_usePixelDensity) {
+ const qreal screenScaleFactor = screenSubfactor(screen->handle());
+ const QDpi dpi = QPlatformScreen::overrideDpi(screen->handle()->logicalDpi());
+ return QDpi{ dpi.first / screenScaleFactor, dpi.second / screenScaleFactor };
+ }
+
+ const qreal scaleFactor = rawScaleFactor(screen->handle());
+ const qreal roundedScaleFactor = roundScaleFactor(scaleFactor);
+ return effectiveLogicalDpi(screen->handle(), scaleFactor, roundedScaleFactor);
}
QHighDpiScaling::ScaleAndOrigin QHighDpiScaling::scaleAndOrigin(const QPlatformScreen *platformScreen, QPoint *nativePosition)
diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
index c43641b8c9..f58944a7d2 100644
--- a/src/gui/kernel/qhighdpiscaling_p.h
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -72,11 +72,27 @@ typedef QPair<qreal, qreal> QDpi;
#ifndef QT_NO_HIGHDPISCALING
class Q_GUI_EXPORT QHighDpiScaling {
+ Q_GADGET
public:
+ enum class DpiAdjustmentPolicy {
+ Unset,
+ Enabled,
+ Disabled,
+ UpOnly
+ };
+ Q_ENUM(DpiAdjustmentPolicy)
+
+ QHighDpiScaling() = delete;
+ ~QHighDpiScaling() = delete;
+ QHighDpiScaling(const QHighDpiScaling &) = delete;
+ QHighDpiScaling &operator=(const QHighDpiScaling &) = delete;
+ QHighDpiScaling(QHighDpiScaling &&) = delete;
+ QHighDpiScaling &operator=(QHighDpiScaling &&) = delete;
+
static void initHighDpiScaling();
static void updateHighDpiScaling();
static void setGlobalFactor(qreal factor);
- static void setScreenFactor(QScreen *window, qreal factor);
+ static void setScreenFactor(QScreen *screen, qreal factor);
static bool isActive() { return m_active; }
@@ -98,9 +114,12 @@ public:
static QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *platformScreen);
static QPoint mapPositionToGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window);
static QPoint mapPositionFromGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window);
- static QDpi logicalDpi();
+ static QDpi logicalDpi(const QScreen *screen);
private:
+ static qreal rawScaleFactor(const QPlatformScreen *screen);
+ static qreal roundScaleFactor(qreal rawFactor);
+ static QDpi effectiveLogicalDpi(const QPlatformScreen *screen, qreal rawFactor, qreal roundedFactor);
static qreal screenSubfactor(const QPlatformScreen *screen);
static qreal m_factor;
@@ -292,6 +311,8 @@ public:
static inline QPoint origin(const QPlatformScreen *) { return QPoint(); }
static inline QPoint mapPositionFromNative(const QPoint &pos, const QPlatformScreen *) { return pos; }
static inline QPoint mapPositionToNative(const QPoint &pos, const QPlatformScreen *) { return pos; }
+ static inline QPoint mapPositionToGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window) { return pos; }
+ static inline QPoint mapPositionFromGlobal(const QPoint &pos, const QPoint &windowGlobalPosition, const QWindow *window) { return pos; }
static inline QDpi logicalDpi() { return QDpi(-1,-1); }
};
diff --git a/src/gui/kernel/qinputdevicemanager.cpp b/src/gui/kernel/qinputdevicemanager.cpp
index 6e4e5a9c93..11442407e1 100644
--- a/src/gui/kernel/qinputdevicemanager.cpp
+++ b/src/gui/kernel/qinputdevicemanager.cpp
@@ -75,13 +75,13 @@ int QInputDeviceManager::deviceCount(DeviceType type) const
int QInputDeviceManagerPrivate::deviceCount(QInputDeviceManager::DeviceType type) const
{
- return m_deviceCount.value(type);
+ return m_deviceCount[type];
}
void QInputDeviceManagerPrivate::setDeviceCount(QInputDeviceManager::DeviceType type, int count)
{
Q_Q(QInputDeviceManager);
- if (m_deviceCount.value(type) != count) {
+ if (m_deviceCount[type] != count) {
m_deviceCount[type] = count;
emit q->deviceListChanged(type);
}
diff --git a/src/gui/kernel/qinputdevicemanager_p.h b/src/gui/kernel/qinputdevicemanager_p.h
index 74494d712b..1d20b102e3 100644
--- a/src/gui/kernel/qinputdevicemanager_p.h
+++ b/src/gui/kernel/qinputdevicemanager_p.h
@@ -69,7 +69,9 @@ public:
DeviceTypePointer,
DeviceTypeKeyboard,
DeviceTypeTouch,
- DeviceTypeTablet
+ DeviceTypeTablet,
+
+ NumDeviceTypes
};
QInputDeviceManager(QObject *parent = nullptr);
diff --git a/src/gui/kernel/qinputdevicemanager_p_p.h b/src/gui/kernel/qinputdevicemanager_p_p.h
index 0a91252fbc..871f9315c3 100644
--- a/src/gui/kernel/qinputdevicemanager_p_p.h
+++ b/src/gui/kernel/qinputdevicemanager_p_p.h
@@ -52,10 +52,11 @@
//
#include <QtGui/private/qtguiglobal_p.h>
-#include <QtCore/qmap.h>
#include <private/qobject_p.h>
#include "qinputdevicemanager_p.h"
+#include <array>
+
QT_BEGIN_NAMESPACE
class Q_GUI_EXPORT QInputDeviceManagerPrivate : public QObjectPrivate
@@ -68,7 +69,7 @@ public:
int deviceCount(QInputDeviceManager::DeviceType type) const;
void setDeviceCount(QInputDeviceManager::DeviceType type, int count);
- QMap<QInputDeviceManager::DeviceType, int> m_deviceCount;
+ std::array<int, QInputDeviceManager::NumDeviceTypes> m_deviceCount;
Qt::KeyboardModifiers keyboardModifiers;
};
diff --git a/src/gui/kernel/qinputmethod_p.h b/src/gui/kernel/qinputmethod_p.h
index 0c2b739d92..5657edeb4e 100644
--- a/src/gui/kernel/qinputmethod_p.h
+++ b/src/gui/kernel/qinputmethod_p.h
@@ -67,7 +67,7 @@ class QInputMethodPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QInputMethod)
public:
- inline QInputMethodPrivate() : testContext(0)
+ inline QInputMethodPrivate() : testContext(nullptr)
{}
QPlatformInputContext *platformInputContext() const
{
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 74bf6e6b47..e1244e1006 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -46,9 +46,6 @@
#include "qdebug.h"
#include <QtCore/qhashfunctions.h>
-#ifndef QT_NO_REGEXP
-# include "qregexp.h"
-#endif
#ifndef QT_NO_DATASTREAM
# include "qdatastream.h"
#endif
@@ -495,6 +492,8 @@ static const struct {
{ Qt::Key_LaunchD, QT_TRANSLATE_NOOP("QShortcut", "Launch (D)") },
{ Qt::Key_LaunchE, QT_TRANSLATE_NOOP("QShortcut", "Launch (E)") },
{ Qt::Key_LaunchF, QT_TRANSLATE_NOOP("QShortcut", "Launch (F)") },
+ { Qt::Key_LaunchG, QT_TRANSLATE_NOOP("QShortcut", "Launch (G)") },
+ { Qt::Key_LaunchH, QT_TRANSLATE_NOOP("QShortcut", "Launch (H)") },
{ Qt::Key_MonBrightnessUp, QT_TRANSLATE_NOOP("QShortcut", "Monitor Brightness Up") },
{ Qt::Key_MonBrightnessDown, QT_TRANSLATE_NOOP("QShortcut", "Monitor Brightness Down") },
{ Qt::Key_KeyboardLightOnOff, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Light On/Off") },
@@ -521,9 +520,11 @@ static const struct {
{ Qt::Key_Book, QT_TRANSLATE_NOOP("QShortcut", "Book") },
{ Qt::Key_CD, QT_TRANSLATE_NOOP("QShortcut", "CD") },
{ Qt::Key_Calculator, QT_TRANSLATE_NOOP("QShortcut", "Calculator") },
+ { Qt::Key_Calendar, QT_TRANSLATE_NOOP("QShortcut", "Calendar") },
{ Qt::Key_Clear, QT_TRANSLATE_NOOP("QShortcut", "Clear") },
{ Qt::Key_ClearGrab, QT_TRANSLATE_NOOP("QShortcut", "Clear Grab") },
{ Qt::Key_Close, QT_TRANSLATE_NOOP("QShortcut", "Close") },
+ { Qt::Key_ContrastAdjust, QT_TRANSLATE_NOOP("QShortcut", "Adjust contrast") },
{ Qt::Key_Copy, QT_TRANSLATE_NOOP("QShortcut", "Copy") },
{ Qt::Key_Cut, QT_TRANSLATE_NOOP("QShortcut", "Cut") },
{ Qt::Key_Display, QT_TRANSLATE_NOOP("QShortcut", "Display") },
@@ -537,6 +538,7 @@ static const struct {
{ Qt::Key_LogOff, QT_TRANSLATE_NOOP("QShortcut", "Logoff") },
{ Qt::Key_Market, QT_TRANSLATE_NOOP("QShortcut", "Market") },
{ Qt::Key_Meeting, QT_TRANSLATE_NOOP("QShortcut", "Meeting") },
+ { Qt::Key_Memo, QT_TRANSLATE_NOOP("QShortcut", "Memo") },
{ Qt::Key_MenuKB, QT_TRANSLATE_NOOP("QShortcut", "Keyboard Menu") },
{ Qt::Key_MenuPB, QT_TRANSLATE_NOOP("QShortcut", "Menu PB") },
{ Qt::Key_MySites, QT_TRANSLATE_NOOP("QShortcut", "My Sites") },
@@ -557,6 +559,7 @@ static const struct {
{ Qt::Key_Support, QT_TRANSLATE_NOOP("QShortcut", "Support") },
{ Qt::Key_TaskPane, QT_TRANSLATE_NOOP("QShortcut", "Task Panel") },
{ Qt::Key_Terminal, QT_TRANSLATE_NOOP("QShortcut", "Terminal") },
+ { Qt::Key_ToDoList, QT_TRANSLATE_NOOP("QShortcut", "To-do list") },
{ Qt::Key_Tools, QT_TRANSLATE_NOOP("QShortcut", "Tools") },
{ Qt::Key_Travel, QT_TRANSLATE_NOOP("QShortcut", "Travel") },
{ Qt::Key_Video, QT_TRANSLATE_NOOP("QShortcut", "Video") },
@@ -1466,7 +1469,7 @@ bool QKeySequence::operator==(const QKeySequence &other) const
Calculates the hash value of \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QKeySequence &key, uint seed) noexcept
{
return qHashRange(key.d->key, key.d->key + QKeySequencePrivate::MaxKeyCount, seed);
}
@@ -1521,7 +1524,7 @@ bool QKeySequence::operator< (const QKeySequence &other) const
*/
bool QKeySequence::isDetached() const
{
- return d->ref.load() == 1;
+ return d->ref.loadRelaxed() == 1;
}
/*!
diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h
index 65f3a93d9c..3dcbbe5941 100644
--- a/src/gui/kernel/qkeysequence.h
+++ b/src/gui/kernel/qkeysequence.h
@@ -66,7 +66,7 @@ void qt_set_sequence_auto_mnemonic(bool b);
class QVariant;
class QKeySequencePrivate;
-Q_GUI_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QKeySequence &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT Q_DECL_PURE_FUNCTION uint qHash(const QKeySequence &key, uint seed = 0) noexcept;
class Q_GUI_EXPORT QKeySequence
{
@@ -186,10 +186,8 @@ public:
operator QVariant() const;
int operator[](uint i) const;
QKeySequence &operator=(const QKeySequence &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QKeySequence &operator=(QKeySequence &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
- void swap(QKeySequence &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ QKeySequence &operator=(QKeySequence &&other) noexcept { swap(other); return *this; }
+ void swap(QKeySequence &other) noexcept { qSwap(d, other.d); }
bool operator==(const QKeySequence &other) const;
inline bool operator!= (const QKeySequence &other) const
@@ -214,7 +212,7 @@ private:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
- friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) noexcept;
friend class QShortcutMap;
friend class QShortcut;
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 3d9f1309c9..638eb1d12f 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -45,6 +45,7 @@
#include <QtCore/QThreadStorage>
#include <QtCore/QThread>
+#include <QtCore/private/qlocking_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qopengl_p.h>
@@ -1442,7 +1443,7 @@ QOpenGLContextGroup *QOpenGLContextGroup::currentContextGroup()
void QOpenGLContextGroupPrivate::addContext(QOpenGLContext *ctx)
{
- QMutexLocker locker(&m_mutex);
+ const auto locker = qt_scoped_lock(m_mutex);
m_refs.ref();
m_shares << ctx;
}
@@ -1454,7 +1455,7 @@ void QOpenGLContextGroupPrivate::removeContext(QOpenGLContext *ctx)
bool deleteObject = false;
{
- QMutexLocker locker(&m_mutex);
+ const auto locker = qt_scoped_lock(m_mutex);
m_shares.removeOne(ctx);
if (ctx == m_context && !m_shares.isEmpty())
@@ -1502,7 +1503,7 @@ void QOpenGLContextGroupPrivate::cleanup()
void QOpenGLContextGroupPrivate::deletePendingResources(QOpenGLContext *ctx)
{
- QMutexLocker locker(&m_mutex);
+ const auto locker = qt_scoped_lock(m_mutex);
const QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
m_pendingDeletion.clear();
@@ -1543,7 +1544,7 @@ void QOpenGLContextGroupPrivate::deletePendingResources(QOpenGLContext *ctx)
QOpenGLSharedResource::QOpenGLSharedResource(QOpenGLContextGroup *group)
: m_group(group)
{
- QMutexLocker locker(&m_group->d_func()->m_mutex);
+ const auto locker = qt_scoped_lock(m_group->d_func()->m_mutex);
m_group->d_func()->m_sharedResources << this;
}
@@ -1559,7 +1560,7 @@ void QOpenGLSharedResource::free()
return;
}
- QMutexLocker locker(&m_group->d_func()->m_mutex);
+ const auto locker = qt_scoped_lock(m_group->d_func()->m_mutex);
m_group->d_func()->m_sharedResources.removeOne(this);
m_group->d_func()->m_pendingDeletion << this;
@@ -1607,8 +1608,7 @@ void QOpenGLSharedResourceGuard::freeResource(QOpenGLContext *context)
QOpenGLMultiGroupSharedResource instance.
*/
QOpenGLMultiGroupSharedResource::QOpenGLMultiGroupSharedResource()
- : active(0),
- m_mutex(QMutex::Recursive)
+ : active(0)
{
#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
qDebug("Creating context group resource object %p.", this);
@@ -1631,7 +1631,7 @@ QOpenGLMultiGroupSharedResource::~QOpenGLMultiGroupSharedResource()
active.deref();
}
#ifndef QT_NO_DEBUG
- if (active.load() != 0) {
+ if (active.loadRelaxed() != 0) {
qWarning("QtGui: Resources are still available at program shutdown.\n"
" This is possibly caused by a leaked QOpenGLWidget, \n"
" QOpenGLFramebufferObject or QOpenGLPixelBuffer.");
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index 2849d0c58e..833cfb20c3 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -131,8 +131,7 @@ class Q_GUI_EXPORT QOpenGLContextGroupPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QOpenGLContextGroup)
public:
QOpenGLContextGroupPrivate()
- : m_context(0)
- , m_mutex(QMutex::Recursive)
+ : m_context(nullptr)
, m_refs(0)
{
}
@@ -147,7 +146,7 @@ public:
QOpenGLContext *m_context;
QList<QOpenGLContext *> m_shares;
- QMutex m_mutex;
+ QRecursiveMutex m_mutex;
QHash<QOpenGLMultiGroupSharedResource *, QOpenGLSharedResource *> m_resources;
QAtomicInt m_refs;
@@ -186,7 +185,7 @@ public:
private:
QAtomicInt active;
QList<QOpenGLContextGroup *> m_groups;
- QMutex m_mutex;
+ QRecursiveMutex m_mutex;
};
class QPaintEngineEx;
@@ -198,20 +197,20 @@ class Q_GUI_EXPORT QOpenGLContextPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QOpenGLContext)
public:
QOpenGLContextPrivate()
- : qGLContextHandle(0)
- , qGLContextDeleteFunction(0)
- , platformGLContext(0)
- , shareContext(0)
- , shareGroup(0)
- , screen(0)
- , surface(0)
- , functions(0)
- , textureFunctions(0)
+ : qGLContextHandle(nullptr)
+ , qGLContextDeleteFunction(nullptr)
+ , platformGLContext(nullptr)
+ , shareContext(nullptr)
+ , shareGroup(nullptr)
+ , screen(nullptr)
+ , surface(nullptr)
+ , functions(nullptr)
+ , textureFunctions(nullptr)
, max_texture_size(-1)
, workaround_brokenFBOReadBack(false)
, workaround_brokenTexSubImage(false)
, workaround_missingPrecisionQualifiers(false)
- , active_engine(0)
+ , active_engine(nullptr)
, qgl_current_fbo_invalid(false)
, qgl_current_fbo(nullptr)
, defaultFboRedirect(0)
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 193fd9590d..61dccd77ac 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -830,7 +830,7 @@ bool QPalette::isBrushSet(ColorGroup cg, ColorRole cr) const
*/
void QPalette::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QPalettePrivate *x = new QPalettePrivate;
for(int grp = 0; grp < (int)NColorGroups; grp++) {
for(int role = 0; role < (int)NColorRoles; role++)
@@ -1209,7 +1209,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p)
QDebugStateSaver saver(dbg);
QDebug nospace = dbg.nospace();
const uint mask = p.resolve();
- nospace << "QPalette(resolve=" << hex << showbase << mask << ',';
+ nospace << "QPalette(resolve=" << Qt::hex << Qt::showbase << mask << ',';
for (int role = 0; role < (int)QPalette::NColorRoles; ++role) {
if (mask & (1<<role)) {
if (role)
@@ -1225,7 +1225,7 @@ QDebug operator<<(QDebug dbg, const QPalette &p)
nospace << ']';
}
}
- nospace << ')' << noshowbase << dec;
+ nospace << ')' << Qt::noshowbase << Qt::dec;
return dbg;
}
#endif
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index e931e01480..d3a840d9ad 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -67,18 +67,16 @@ public:
QPalette(const QPalette &palette);
~QPalette();
QPalette &operator=(const QPalette &palette);
-#ifdef Q_COMPILER_RVALUE_REFS
- QPalette(QPalette &&other) Q_DECL_NOTHROW
+ QPalette(QPalette &&other) noexcept
: d(other.d), data(other.data)
{ other.d = nullptr; }
- inline QPalette &operator=(QPalette &&other) Q_DECL_NOEXCEPT
+ inline QPalette &operator=(QPalette &&other) noexcept
{
for_faster_swapping_dont_use = other.for_faster_swapping_dont_use;
qSwap(d, other.d); return *this;
}
-#endif
- void swap(QPalette &other) Q_DECL_NOEXCEPT
+ void swap(QPalette &other) noexcept
{
qSwap(d, other.d);
qSwap(for_faster_swapping_dont_use, other.for_faster_swapping_dont_use);
diff --git a/src/gui/kernel/qpixelformat.h b/src/gui/kernel/qpixelformat.h
index 6b2d6a6ac7..a041a39fc1 100644
--- a/src/gui/kernel/qpixelformat.h
+++ b/src/gui/kernel/qpixelformat.h
@@ -95,7 +95,7 @@ class QPixelFormat
Q_STATIC_ASSERT(uint(TotalFieldWidthByWidths) == uint(TotalFieldWidthByOffsets));
Q_STATIC_ASSERT(uint(TotalFieldWidthByWidths) == 8 * sizeof(quint64));
- Q_DECL_CONSTEXPR inline uchar get(Field offset, FieldWidth width) const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR inline uchar get(Field offset, FieldWidth width) const noexcept
{ return uchar((data >> uint(offset)) & ((Q_UINT64_C(1) << uint(width)) - Q_UINT64_C(1))); }
Q_DECL_CONSTEXPR static inline quint64 set(Field offset, FieldWidth width, uchar value)
{ return (quint64(value) & ((Q_UINT64_C(1) << uint(width)) - Q_UINT64_C(1))) << uint(offset); }
@@ -160,7 +160,7 @@ public:
CurrentSystemEndian
};
- Q_DECL_CONSTEXPR inline QPixelFormat() Q_DECL_NOTHROW : data(0) {}
+ Q_DECL_CONSTEXPR inline QPixelFormat() noexcept : data(0) {}
Q_DECL_CONSTEXPR inline QPixelFormat(ColorModel colorModel,
uchar firstSize,
uchar secondSize,
@@ -173,47 +173,47 @@ public:
AlphaPremultiplied premultiplied,
TypeInterpretation typeInterpretation,
ByteOrder byteOrder = CurrentSystemEndian,
- uchar subEnum = 0) Q_DECL_NOTHROW;
+ uchar subEnum = 0) noexcept;
- Q_DECL_CONSTEXPR inline ColorModel colorModel() const Q_DECL_NOTHROW { return ColorModel(get(ModelField, ModelFieldWidth)); }
- Q_DECL_CONSTEXPR inline uchar channelCount() const Q_DECL_NOTHROW { return (get(FirstField, FirstFieldWidth) > 0) +
+ Q_DECL_CONSTEXPR inline ColorModel colorModel() const noexcept { return ColorModel(get(ModelField, ModelFieldWidth)); }
+ Q_DECL_CONSTEXPR inline uchar channelCount() const noexcept { return (get(FirstField, FirstFieldWidth) > 0) +
(get(SecondField, SecondFieldWidth) > 0) +
(get(ThirdField, ThirdFieldWidth) > 0) +
(get(FourthField, FourthFieldWidth) > 0) +
(get(FifthField, FifthFieldWidth) > 0) +
(get(AlphaField, AlphaFieldWidth) > 0); }
- Q_DECL_CONSTEXPR inline uchar redSize() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar greenSize() const Q_DECL_NOTHROW { return get(SecondField, SecondFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar blueSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar redSize() const noexcept { return get(FirstField, FirstFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar greenSize() const noexcept { return get(SecondField, SecondFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar blueSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar cyanSize() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar magentaSize() const Q_DECL_NOTHROW { return get(SecondField, SecondFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar yellowSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar blackSize() const Q_DECL_NOTHROW { return get(FourthField, FourthFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar cyanSize() const noexcept { return get(FirstField, FirstFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar magentaSize() const noexcept { return get(SecondField, SecondFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar yellowSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar blackSize() const noexcept { return get(FourthField, FourthFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar hueSize() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar saturationSize() const Q_DECL_NOTHROW { return get(SecondField, SecondFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar lightnessSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar brightnessSize() const Q_DECL_NOTHROW { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar hueSize() const noexcept { return get(FirstField, FirstFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar saturationSize() const noexcept { return get(SecondField, SecondFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar lightnessSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar brightnessSize() const noexcept { return get(ThirdField, ThirdFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar alphaSize() const Q_DECL_NOTHROW { return get(AlphaField, AlphaFieldWidth); }
+ Q_DECL_CONSTEXPR inline uchar alphaSize() const noexcept { return get(AlphaField, AlphaFieldWidth); }
- Q_DECL_CONSTEXPR inline uchar bitsPerPixel() const Q_DECL_NOTHROW { return get(FirstField, FirstFieldWidth) +
+ Q_DECL_CONSTEXPR inline uchar bitsPerPixel() const noexcept { return get(FirstField, FirstFieldWidth) +
get(SecondField, SecondFieldWidth) +
get(ThirdField, ThirdFieldWidth) +
get(FourthField, FourthFieldWidth) +
get(FifthField, FifthFieldWidth) +
get(AlphaField, AlphaFieldWidth); }
- Q_DECL_CONSTEXPR inline AlphaUsage alphaUsage() const Q_DECL_NOTHROW { return AlphaUsage(get(AlphaUsageField, AlphaUsageFieldWidth)); }
- Q_DECL_CONSTEXPR inline AlphaPosition alphaPosition() const Q_DECL_NOTHROW { return AlphaPosition(get(AlphaPositionField, AlphaPositionFieldWidth)); }
- Q_DECL_CONSTEXPR inline AlphaPremultiplied premultiplied() const Q_DECL_NOTHROW { return AlphaPremultiplied(get(PremulField, PremulFieldWidth)); }
- Q_DECL_CONSTEXPR inline TypeInterpretation typeInterpretation() const Q_DECL_NOTHROW { return TypeInterpretation(get(TypeInterpretationField, TypeInterpretationFieldWidth)); }
- Q_DECL_CONSTEXPR inline ByteOrder byteOrder() const Q_DECL_NOTHROW { return ByteOrder(get(ByteOrderField, ByteOrderFieldWidth)); }
+ Q_DECL_CONSTEXPR inline AlphaUsage alphaUsage() const noexcept { return AlphaUsage(get(AlphaUsageField, AlphaUsageFieldWidth)); }
+ Q_DECL_CONSTEXPR inline AlphaPosition alphaPosition() const noexcept { return AlphaPosition(get(AlphaPositionField, AlphaPositionFieldWidth)); }
+ Q_DECL_CONSTEXPR inline AlphaPremultiplied premultiplied() const noexcept { return AlphaPremultiplied(get(PremulField, PremulFieldWidth)); }
+ Q_DECL_CONSTEXPR inline TypeInterpretation typeInterpretation() const noexcept { return TypeInterpretation(get(TypeInterpretationField, TypeInterpretationFieldWidth)); }
+ Q_DECL_CONSTEXPR inline ByteOrder byteOrder() const noexcept { return ByteOrder(get(ByteOrderField, ByteOrderFieldWidth)); }
- Q_DECL_CONSTEXPR inline YUVLayout yuvLayout() const Q_DECL_NOTHROW { return YUVLayout(get(SubEnumField, SubEnumFieldWidth)); }
- Q_DECL_CONSTEXPR inline uchar subEnum() const Q_DECL_NOTHROW { return get(SubEnumField, SubEnumFieldWidth); }
+ Q_DECL_CONSTEXPR inline YUVLayout yuvLayout() const noexcept { return YUVLayout(get(SubEnumField, SubEnumFieldWidth)); }
+ Q_DECL_CONSTEXPR inline uchar subEnum() const noexcept { return get(SubEnumField, SubEnumFieldWidth); }
private:
Q_DECL_CONSTEXPR static inline ByteOrder resolveByteOrder(ByteOrder bo)
@@ -255,7 +255,7 @@ QPixelFormat::QPixelFormat(ColorModel mdl,
AlphaPremultiplied premult,
TypeInterpretation typeInterp,
ByteOrder b_order,
- uchar s_enum) Q_DECL_NOTHROW
+ uchar s_enum) noexcept
: data(set(ModelField, ModelFieldWidth, uchar(mdl)) |
set(FirstField, FirstFieldWidth, firstSize) |
set(SecondField, SecondFieldWidth, secondSize) |
@@ -280,7 +280,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatRgba(uchar red,
QPixelFormat::AlphaUsage usage,
QPixelFormat::AlphaPosition position,
QPixelFormat::AlphaPremultiplied pmul=QPixelFormat::NotPremultiplied,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::RGB,
red,
@@ -296,7 +296,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatRgba(uchar red,
}
Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatGrayscale(uchar channelSize,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::Grayscale,
channelSize,
@@ -312,7 +312,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatGrayscale(uchar channelSize,
}
Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatAlpha(uchar channelSize,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::Alpha,
0,
@@ -331,7 +331,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatCmyk(uchar channelSize,
uchar alfa=0,
QPixelFormat::AlphaUsage usage=QPixelFormat::IgnoresAlpha,
QPixelFormat::AlphaPosition position=QPixelFormat::AtBeginning,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::UnsignedInteger) noexcept
{
return QPixelFormat(QPixelFormat::CMYK,
channelSize,
@@ -350,7 +350,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatHsl(uchar channelSize,
uchar alfa=0,
QPixelFormat::AlphaUsage usage=QPixelFormat::IgnoresAlpha,
QPixelFormat::AlphaPosition position=QPixelFormat::AtBeginning,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) noexcept
{
return QPixelFormat(QPixelFormat::HSL,
channelSize,
@@ -369,7 +369,7 @@ Q_DECL_CONSTEXPR inline QPixelFormat qPixelFormatHsv(uchar channelSize,
uchar alfa=0,
QPixelFormat::AlphaUsage usage=QPixelFormat::IgnoresAlpha,
QPixelFormat::AlphaPosition position=QPixelFormat::AtBeginning,
- QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) Q_DECL_NOTHROW
+ QPixelFormat::TypeInterpretation typeInt=QPixelFormat::FloatingPoint) noexcept
{
return QPixelFormat(QPixelFormat::HSV,
channelSize,
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index d14d575056..4bee153489 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -41,7 +41,9 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QVariant>
+#if QT_CONFIG(regularexpression)
#include <QtCore/QRegularExpression>
+#endif
#include <QtCore/QSharedData>
#if QT_CONFIG(settings)
#include <QtCore/QSettings>
@@ -786,6 +788,7 @@ const char QPlatformFileDialogHelper::filterRegExp[] =
// Makes a list of filters from a normal filter string "Image Files (*.png *.jpg)"
QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter)
{
+#if QT_CONFIG(regularexpression)
QRegularExpression regexp(QString::fromLatin1(filterRegExp));
Q_ASSERT(regexp.isValid());
QString f = filter;
@@ -794,6 +797,9 @@ QStringList QPlatformFileDialogHelper::cleanFilterList(const QString &filter)
if (match.hasMatch())
f = match.captured(2);
return f.split(QLatin1Char(' '), QString::SkipEmptyParts);
+#else
+ return QStringList();
+#endif
}
// Message dialog
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index f09bec12da..ba800a696f 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -318,7 +318,9 @@ public:
ShowDirsOnly = 0x00000001,
DontResolveSymlinks = 0x00000002,
DontConfirmOverwrite = 0x00000004,
- DontUseSheet = 0x00000008,
+#if QT_DEPRECATED_SINCE(5, 14)
+ DontUseSheet Q_DECL_ENUMERATOR_DEPRECATED = 0x00000008,
+#endif
DontUseNativeDialog = 0x00000010,
ReadOnly = 0x00000020,
HideNameFilterDetails = 0x00000040,
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index a3594042ce..d9f349555a 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -115,7 +115,7 @@ public:
virtual QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const;
virtual QPlatformWindow *createPlatformWindow(QWindow *window) const = 0;
- virtual QPlatformWindow *createForeignWindow(QWindow *, WId) const { return 0; }
+ virtual QPlatformWindow *createForeignWindow(QWindow *, WId) const { return nullptr; }
virtual QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const = 0;
#ifndef QT_NO_OPENGL
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const;
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 9c5876550a..f3213bf5ea 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -193,6 +193,28 @@ QDpi QPlatformScreen::logicalDpi() const
25.4 * s.height() / ps.height());
}
+// Helper function for accessing the platform screen logical dpi
+// which accounts for QT_FONT_DPI.
+QPair<qreal, qreal> QPlatformScreen::overrideDpi(const QPair<qreal, qreal> &in)
+{
+ static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI");
+ return overrideDpi > 0 ? QDpi(overrideDpi, overrideDpi) : in;
+}
+
+/*!
+ Reimplement to return the base logical DPI for the platform. This
+ DPI value should correspond to a standard-DPI (1x) display. The
+ default implementation returns 96.
+
+ QtGui will use this value (together with logicalDpi) to compute
+ the scale factor when high-DPI scaling is enabled:
+ factor = logicalDPI / baseDPI
+*/
+QDpi QPlatformScreen::logicalBaseDpi() const
+{
+ return QDpi(96, 96);
+}
+
/*!
Reimplement this function in subclass to return the device pixel ratio
for the screen. This is the ratio between physical pixels and the
diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h
index b9ecc80320..d7378aed51 100644
--- a/src/gui/kernel/qplatformscreen.h
+++ b/src/gui/kernel/qplatformscreen.h
@@ -115,6 +115,7 @@ public:
virtual QSizeF physicalSize() const;
virtual QDpi logicalDpi() const;
+ virtual QDpi logicalBaseDpi() const;
virtual qreal devicePixelRatio() const;
virtual qreal pixelDensity() const;
@@ -160,6 +161,8 @@ public:
// The platform screen's geometry in device independent coordinates
QRect deviceIndependentGeometry() const;
+ static QDpi overrideDpi(const QDpi &in);
+
protected:
void resizeMaximizedWindows();
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h
index 54c8c70025..356c4ea3ea 100644
--- a/src/gui/kernel/qplatformtheme.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -309,7 +309,7 @@ public:
virtual QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const;
virtual QIcon fileIcon(const QFileInfo &fileInfo,
- QPlatformTheme::IconOptions iconOptions = 0) const;
+ QPlatformTheme::IconOptions iconOptions = nullptr) const;
virtual QIconEngine *createIconEngine(const QString &iconName) const;
#ifndef QT_NO_SHORTCUT
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 4e95751397..65accc9f68 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -348,9 +348,7 @@ void QPlatformWindow::setWindowIcon(const QIcon &icon) { Q_UNUSED(icon); }
*/
bool QPlatformWindow::close()
{
- bool accepted = false;
- QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(window(), &accepted);
- return accepted;
+ return QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(window());
}
/*!
@@ -696,9 +694,12 @@ static QSize fixInitialSize(QSize size, const QWindow *w,
However if the given window already has geometry which the application has
initialized, it takes priority.
*/
-QRect QPlatformWindow::initialGeometry(const QWindow *w,
- const QRect &initialGeometry, int defaultWidth, int defaultHeight)
+QRect QPlatformWindow::initialGeometry(const QWindow *w, const QRect &initialGeometry,
+ int defaultWidth, int defaultHeight,
+ const QScreen **resultingScreenReturn)
{
+ if (resultingScreenReturn)
+ *resultingScreenReturn = w->screen();
if (!w->isTopLevel()) {
const qreal factor = QHighDpiScaling::factor(w);
const QSize size = fixInitialSize(QHighDpi::fromNative(initialGeometry.size(), factor),
@@ -714,6 +715,8 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w,
: QGuiApplication::screenAt(initialGeometry.center());
if (!screen)
return initialGeometry;
+ if (resultingScreenReturn)
+ *resultingScreenReturn = screen;
// initialGeometry refers to window's screen
QRect rect(QHighDpi::fromNativePixels(initialGeometry, w));
if (wp->resizeAutomatic)
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 4d48cc2f13..b6aeb3a86a 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -63,6 +63,7 @@ QT_BEGIN_NAMESPACE
class QPlatformScreen;
class QPlatformWindowPrivate;
+class QScreen;
class QWindow;
class QIcon;
class QRegion;
@@ -142,8 +143,9 @@ public:
virtual void invalidateSurface();
- static QRect initialGeometry(const QWindow *w,
- const QRect &initialGeometry, int defaultWidth, int defaultHeight);
+ static QRect initialGeometry(const QWindow *w, const QRect &initialGeometry,
+ int defaultWidth, int defaultHeight,
+ const QScreen **resultingScreenReturn = nullptr);
virtual void requestUpdate();
bool hasPendingUpdateRequest() const;
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index 952023dd1b..7adf3db1b8 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -84,8 +84,11 @@ void QScreenPrivate::setPlatformScreen(QPlatformScreen *screen)
platformScreen->d_func()->screen = q;
orientation = platformScreen->orientation();
geometry = platformScreen->deviceIndependentGeometry();
- availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(), QHighDpiScaling::factor(platformScreen), geometry.topLeft());
- logicalDpi = platformScreen->logicalDpi();
+ availableGeometry = QHighDpi::fromNative(platformScreen->availableGeometry(),
+ QHighDpiScaling::factor(platformScreen), geometry.topLeft());
+
+ logicalDpi = QPlatformScreen::overrideDpi(platformScreen->logicalDpi());
+
refreshRate = platformScreen->refreshRate();
// safeguard ourselves against buggy platform behavior...
if (refreshRate < 1.0)
@@ -285,7 +288,7 @@ qreal QScreen::logicalDotsPerInchX() const
{
Q_D(const QScreen);
if (QHighDpiScaling::isActive())
- return QHighDpiScaling::logicalDpi().first;
+ return QHighDpiScaling::logicalDpi(this).first;
return d->logicalDpi.first;
}
@@ -301,7 +304,7 @@ qreal QScreen::logicalDotsPerInchY() const
{
Q_D(const QScreen);
if (QHighDpiScaling::isActive())
- return QHighDpiScaling::logicalDpi().second;
+ return QHighDpiScaling::logicalDpi(this).second;
return d->logicalDpi.second;
}
@@ -320,7 +323,7 @@ qreal QScreen::logicalDotsPerInchY() const
qreal QScreen::logicalDotsPerInch() const
{
Q_D(const QScreen);
- QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi() : d->logicalDpi;
+ QDpi dpi = QHighDpiScaling::isActive() ? QHighDpiScaling::logicalDpi(this) : d->logicalDpi;
return (dpi.first + dpi.second) * qreal(0.5);
}
@@ -768,7 +771,7 @@ QPixmap QScreen::grabWindow(WId window, int x, int y, int width, int height)
static inline void formatRect(QDebug &debug, const QRect r)
{
debug << r.width() << 'x' << r.height()
- << forcesign << r.x() << r.y() << noforcesign;
+ << Qt::forcesign << r.x() << r.y() << Qt::noforcesign;
}
Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QScreen *screen)
diff --git a/src/gui/kernel/qscreen_p.h b/src/gui/kernel/qscreen_p.h
index f31658355b..e5988ff829 100644
--- a/src/gui/kernel/qscreen_p.h
+++ b/src/gui/kernel/qscreen_p.h
@@ -64,12 +64,6 @@ class QScreenPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QScreen)
public:
- QScreenPrivate()
- : platformScreen(0)
- , orientationUpdateMask(0)
- {
- }
-
void setPlatformScreen(QPlatformScreen *screen);
void updateHighDpi()
{
@@ -79,16 +73,16 @@ public:
void updatePrimaryOrientation();
- QPlatformScreen *platformScreen;
+ QPlatformScreen *platformScreen = nullptr;
Qt::ScreenOrientations orientationUpdateMask;
- Qt::ScreenOrientation orientation;
- Qt::ScreenOrientation filteredOrientation;
- Qt::ScreenOrientation primaryOrientation;
+ Qt::ScreenOrientation orientation = Qt::PrimaryOrientation;
+ Qt::ScreenOrientation filteredOrientation = Qt::PrimaryOrientation;
+ Qt::ScreenOrientation primaryOrientation = Qt::LandscapeOrientation;
QRect geometry;
QRect availableGeometry;
- QDpi logicalDpi;
- qreal refreshRate;
+ QDpi logicalDpi = {96, 96};
+ qreal refreshRate = 60;
};
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qsessionmanager.cpp b/src/gui/kernel/qsessionmanager.cpp
index 493a321c74..e5e9c624b2 100644
--- a/src/gui/kernel/qsessionmanager.cpp
+++ b/src/gui/kernel/qsessionmanager.cpp
@@ -123,7 +123,11 @@ QSessionManagerPrivate::QSessionManagerPrivate(const QString &id,
const QString &key)
: QObjectPrivate()
{
- platformSessionManager = QGuiApplicationPrivate::platformIntegration()->createPlatformSessionManager(id, key);
+ if (qApp->testAttribute(Qt::AA_DisableSessionManager)) {
+ platformSessionManager = new QPlatformSessionManager(id, key);
+ } else {
+ platformSessionManager = QGuiApplicationPrivate::platformIntegration()->createPlatformSessionManager(id, key);
+ }
Q_ASSERT_X(platformSessionManager, "Platform session management",
"No platform session management, should use the default implementation");
}
diff --git a/src/gui/kernel/qshapedpixmapdndwindow_p.h b/src/gui/kernel/qshapedpixmapdndwindow_p.h
index d9a6ea4888..5089be7284 100644
--- a/src/gui/kernel/qshapedpixmapdndwindow_p.h
+++ b/src/gui/kernel/qshapedpixmapdndwindow_p.h
@@ -63,7 +63,7 @@ class QShapedPixmapWindow : public QRasterWindow
{
Q_OBJECT
public:
- explicit QShapedPixmapWindow(QScreen *screen = 0);
+ explicit QShapedPixmapWindow(QScreen *screen = nullptr);
~QShapedPixmapWindow();
void setUseCompositing(bool on) { m_useCompositing = on; }
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index bd409c124f..d3070a3d1a 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -48,7 +48,6 @@
#include "qpoint.h"
#include "qbuffer.h"
#include "qimage.h"
-#include "qregexp.h"
#include "qdir.h"
#include "qimagereader.h"
#include "qimagewriter.h"
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index 9b5b7a6f1e..732ede90d0 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -65,6 +65,20 @@ static inline QVariant themeableHint(QPlatformTheme::ThemeHint th,
return QGuiApplicationPrivate::platformIntegration()->styleHint(ih);
}
+static inline QVariant themeableHint(QPlatformTheme::ThemeHint th)
+{
+ if (!QCoreApplication::instance()) {
+ qWarning("Must construct a QGuiApplication before accessing a platform theme hint.");
+ return QVariant();
+ }
+ if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
+ const QVariant themeHint = theme->themeHint(th);
+ if (themeHint.isValid())
+ return themeHint;
+ }
+ return QPlatformTheme::defaultThemeHint(th);
+}
+
class QStyleHintsPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QStyleHints)
@@ -80,6 +94,8 @@ public:
int m_showShortcutsInContextMenus = -1;
int m_wheelScrollLines = -1;
int m_mouseQuickSelectionThreshold = -1;
+ int m_mouseDoubleClickDistance = -1;
+ int m_touchDoubleTapDistance = -1;
};
/*!
@@ -133,6 +149,34 @@ int QStyleHints::mouseDoubleClickInterval() const
}
/*!
+ \property QStyleHints::mouseDoubleClickDistance
+ \brief the maximum distance, in pixels, that the mouse can be moved between
+ two consecutive mouse clicks and still have it detected as a double-click
+ \since 5.14
+*/
+int QStyleHints::mouseDoubleClickDistance() const
+{
+ Q_D(const QStyleHints);
+ return d->m_mouseDoubleClickDistance >= 0 ?
+ d->m_mouseDoubleClickDistance :
+ themeableHint(QPlatformTheme::MouseDoubleClickDistance).toInt();
+}
+
+/*!
+ \property QStyleHints::touchDoubleTapDistance
+ \brief the maximum distance, in pixels, that a finger can be moved between
+ two consecutive taps and still have it detected as a double-tap
+ \since 5.14
+*/
+int QStyleHints::touchDoubleTapDistance() const
+{
+ Q_D(const QStyleHints);
+ return d->m_touchDoubleTapDistance >= 0 ?
+ d->m_touchDoubleTapDistance :
+ themeableHint(QPlatformTheme::TouchDoubleTapDistance).toInt();
+}
+
+/*!
Sets the \a mousePressAndHoldInterval.
\internal
\sa mousePressAndHoldInterval()
diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h
index 9091db9624..30d8fdc64d 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -74,10 +74,14 @@ class Q_GUI_EXPORT QStyleHints : public QObject
Q_PROPERTY(bool useHoverEffects READ useHoverEffects WRITE setUseHoverEffects NOTIFY useHoverEffectsChanged FINAL)
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines NOTIFY wheelScrollLinesChanged FINAL)
Q_PROPERTY(int mouseQuickSelectionThreshold READ mouseQuickSelectionThreshold WRITE setMouseQuickSelectionThreshold NOTIFY mouseQuickSelectionThresholdChanged FINAL)
+ Q_PROPERTY(int mouseDoubleClickDistance READ mouseDoubleClickDistance STORED false CONSTANT FINAL)
+ Q_PROPERTY(int touchDoubleTapDistance READ touchDoubleTapDistance STORED false CONSTANT FINAL)
public:
void setMouseDoubleClickInterval(int mouseDoubleClickInterval);
int mouseDoubleClickInterval() const;
+ int mouseDoubleClickDistance() const;
+ int touchDoubleTapDistance() const;
void setMousePressAndHoldInterval(int mousePressAndHoldInterval);
int mousePressAndHoldInterval() const;
void setStartDragDistance(int startDragDistance);
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 4e2bcad50f..238886220b 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -246,7 +246,7 @@ QSurfaceFormat::QSurfaceFormat(QSurfaceFormat::FormatOptions options) :
*/
void QSurfaceFormat::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QSurfaceFormatPrivate *newd = new QSurfaceFormatPrivate(d);
if (!d->ref.deref())
delete d;
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp
index 511e92566e..8293fddc59 100644
--- a/src/gui/kernel/qtouchdevice.cpp
+++ b/src/gui/kernel/qtouchdevice.cpp
@@ -44,6 +44,7 @@
#include <QCoreApplication>
#include <private/qdebug_p.h>
+#include <private/qlocking_p.h>
QT_BEGIN_NAMESPACE
@@ -201,15 +202,20 @@ void QTouchDevice::setName(const QString &name)
d->name = name;
}
-typedef QList<const QTouchDevice *> TouchDevices;
-Q_GLOBAL_STATIC(TouchDevices, deviceList)
static QBasicMutex devicesMutex;
-static void cleanupDevicesList()
+struct TouchDevices {
+ TouchDevices();
+ QList<const QTouchDevice *> list;
+};
+Q_GLOBAL_STATIC(TouchDevices, deviceList)
+
+TouchDevices::TouchDevices()
{
- QMutexLocker lock(&devicesMutex);
- qDeleteAll(*deviceList());
- deviceList()->clear();
+ qAddPostRoutine([]{
+ const auto locker = qt_scoped_lock(devicesMutex);
+ qDeleteAll(qExchange(deviceList->list, {}));
+ });
}
/*!
@@ -222,8 +228,8 @@ static void cleanupDevicesList()
*/
QList<const QTouchDevice *> QTouchDevice::devices()
{
- QMutexLocker lock(&devicesMutex);
- return *deviceList();
+ const auto locker = qt_scoped_lock(devicesMutex);
+ return deviceList->list;
}
/*!
@@ -231,14 +237,14 @@ QList<const QTouchDevice *> QTouchDevice::devices()
*/
bool QTouchDevicePrivate::isRegistered(const QTouchDevice *dev)
{
- QMutexLocker locker(&devicesMutex);
- return deviceList()->contains(dev);
+ const auto locker = qt_scoped_lock(devicesMutex);
+ return deviceList->list.contains(dev);
}
const QTouchDevice *QTouchDevicePrivate::deviceById(quint8 id)
{
- QMutexLocker locker(&devicesMutex);
- for (const QTouchDevice *dev : *deviceList())
+ const auto locker = qt_scoped_lock(devicesMutex);
+ for (const QTouchDevice *dev : qAsConst(deviceList->list))
if (QTouchDevicePrivate::get(const_cast<QTouchDevice *>(dev))->id == id)
return dev;
return nullptr;
@@ -249,10 +255,8 @@ const QTouchDevice *QTouchDevicePrivate::deviceById(quint8 id)
*/
void QTouchDevicePrivate::registerDevice(const QTouchDevice *dev)
{
- QMutexLocker lock(&devicesMutex);
- if (deviceList()->isEmpty())
- qAddPostRoutine(cleanupDevicesList);
- deviceList()->append(dev);
+ const auto locker = qt_scoped_lock(devicesMutex);
+ deviceList->list.append(dev);
}
/*!
@@ -260,10 +264,8 @@ void QTouchDevicePrivate::registerDevice(const QTouchDevice *dev)
*/
void QTouchDevicePrivate::unregisterDevice(const QTouchDevice *dev)
{
- QMutexLocker lock(&devicesMutex);
- bool wasRemoved = deviceList()->removeOne(dev);
- if (wasRemoved && deviceList()->isEmpty())
- qRemovePostRoutine(cleanupDevicesList);
+ const auto locker = qt_scoped_lock(devicesMutex);
+ deviceList->list.removeOne(dev);
}
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index ed516c0eed..b71a0c54aa 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2535,7 +2535,12 @@ void QWindow::tabletEvent(QTabletEvent *ev)
Should return true only if the event was handled.
*/
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QWindow::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *result)
+#endif
{
Q_UNUSED(eventType);
Q_UNUSED(message);
@@ -2844,13 +2849,13 @@ QDebug operator<<(QDebug debug, const QWindow *window)
if (window->isTopLevel())
debug << ", toplevel";
debug << ", " << geometry.width() << 'x' << geometry.height()
- << forcesign << geometry.x() << geometry.y() << noforcesign;
+ << Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign;
const QMargins margins = window->frameMargins();
if (!margins.isNull())
debug << ", margins=" << margins;
debug << ", devicePixelRatio=" << window->devicePixelRatio();
if (const QPlatformWindow *platformWindow = window->handle())
- debug << ", winId=0x" << hex << platformWindow->winId() << dec;
+ debug << ", winId=0x" << Qt::hex << platformWindow->winId() << Qt::dec;
if (const QScreen *screen = window->screen())
debug << ", on " << screen->name();
}
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 1be3c845fe..5ee1d00f5b 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -364,7 +364,11 @@ protected:
#if QT_CONFIG(tabletevent)
virtual void tabletEvent(QTabletEvent *);
#endif
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
+#else
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
+#endif
QWindow(QWindowPrivate &dd, QWindow *parent);
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index 5367d93e84..5a7ec518fd 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -77,50 +77,15 @@ public:
QWindowPrivate()
: QObjectPrivate()
- , surfaceType(QWindow::RasterSurface)
- , windowFlags(Qt::Window)
- , parentWindow(0)
- , platformWindow(0)
- , visible(false)
- , visibilityOnDestroy(false)
- , exposed(false)
- , windowState(Qt::WindowNoState)
- , visibility(QWindow::Hidden)
- , resizeEventPending(true)
- , receivedExpose(false)
- , positionPolicy(WindowFrameExclusive)
- , positionAutomatic(true)
- , resizeAutomatic(true)
- , contentOrientation(Qt::PrimaryOrientation)
- , opacity(qreal(1.0))
- , minimumSize(0, 0)
- , maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX)
- , modality(Qt::NonModal)
- , blockedByModalWindow(false)
- , updateRequestPending(false)
- , transientParent(0)
- , topLevelScreen(0)
-#ifndef QT_NO_CURSOR
- , cursor(Qt::ArrowCursor)
- , hasCursor(false)
-#endif
- , compositing(false)
-#if QT_CONFIG(vulkan)
- , vulkanInstance(nullptr)
-#endif
{
isWindow = true;
}
- ~QWindowPrivate()
- {
- }
-
void init(QScreen *targetScreen = nullptr);
void maybeQuitOnLastWindowClosed();
#ifndef QT_NO_CURSOR
- void setCursor(const QCursor *c = 0);
+ void setCursor(const QCursor *c = nullptr);
bool applyCursor();
#endif
@@ -164,57 +129,60 @@ public:
static Qt::WindowState effectiveState(Qt::WindowStates);
- QWindow::SurfaceType surfaceType;
- Qt::WindowFlags windowFlags;
- QWindow *parentWindow;
- QPlatformWindow *platformWindow;
- bool visible;
- bool visibilityOnDestroy;
- bool exposed;
+ // ### Qt6: unused
+ virtual bool allowClickThrough(const QPoint &) const { return true; }
+
+ QWindow::SurfaceType surfaceType = QWindow::RasterSurface;
+ Qt::WindowFlags windowFlags = Qt::Window;
+ QWindow *parentWindow = nullptr;
+ QPlatformWindow *platformWindow = nullptr;
+ bool visible= false;
+ bool visibilityOnDestroy = false;
+ bool exposed = false;
QSurfaceFormat requestedFormat;
QString windowTitle;
QString windowFilePath;
QIcon windowIcon;
QRect geometry;
- Qt::WindowStates windowState;
- QWindow::Visibility visibility;
- bool resizeEventPending;
- bool receivedExpose;
- PositionPolicy positionPolicy;
- bool positionAutomatic;
+ Qt::WindowStates windowState = Qt::WindowNoState;
+ QWindow::Visibility visibility = QWindow::Hidden;
+ bool resizeEventPending = true;
+ bool receivedExpose = false;
+ PositionPolicy positionPolicy = WindowFrameExclusive;
+ bool positionAutomatic = true;
// resizeAutomatic suppresses resizing by QPlatformWindow::initialGeometry().
// It also indicates that width/height=0 is acceptable (for example, for
// the QRollEffect widget) and is thus not cleared in setGeometry().
// An alternative approach might be using -1,-1 as a default size.
- bool resizeAutomatic;
- Qt::ScreenOrientation contentOrientation;
- qreal opacity;
+ bool resizeAutomatic = true;
+ Qt::ScreenOrientation contentOrientation = Qt::PrimaryOrientation;
+ qreal opacity= 1;
QRegion mask;
- QSize minimumSize;
- QSize maximumSize;
+ QSize minimumSize = {0, 0};
+ QSize maximumSize = {QWINDOWSIZE_MAX, QWINDOWSIZE_MAX};
QSize baseSize;
QSize sizeIncrement;
- Qt::WindowModality modality;
- bool blockedByModalWindow;
+ Qt::WindowModality modality = Qt::NonModal;
+ bool blockedByModalWindow = false;
- bool updateRequestPending;
+ bool updateRequestPending = false;
bool transientParentPropertySet = false;
QPointer<QWindow> transientParent;
QPointer<QScreen> topLevelScreen;
#ifndef QT_NO_CURSOR
- QCursor cursor;
- bool hasCursor;
+ QCursor cursor = {Qt::ArrowCursor};
+ bool hasCursor = false;
#endif
- bool compositing;
+ bool compositing = false;
QElapsedTimer lastComposeTime;
#if QT_CONFIG(vulkan)
- QVulkanInstance *vulkanInstance;
+ QVulkanInstance *vulkanInstance = nullptr;
#endif
};
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index 759671fbd7..ba04f8701d 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -285,6 +285,12 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleApplicationStateChanged, Qt::Application
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
+QT_DEFINE_QPA_EVENT_HANDLER(bool, handleApplicationTermination)
+{
+ auto *e = new QWindowSystemInterfacePrivate::WindowSystemEvent(QWindowSystemInterfacePrivate::ApplicationTermination);
+ return QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
+}
+
QWindowSystemInterfacePrivate::GeometryChangeEvent::GeometryChangeEvent(QWindow *window, const QRect &newGeometry)
: WindowSystemEvent(GeometryChange)
, window(window)
@@ -340,13 +346,11 @@ QT_DEFINE_QPA_EVENT_HANDLER(void, handleExposeEvent, QWindow *window, const QReg
QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
}
-QT_DEFINE_QPA_EVENT_HANDLER(void, handleCloseEvent, QWindow *window, bool *accepted)
+QT_DEFINE_QPA_EVENT_HANDLER(bool, handleCloseEvent, QWindow *window)
{
- if (window) {
- QWindowSystemInterfacePrivate::CloseEvent *e =
- new QWindowSystemInterfacePrivate::CloseEvent(window, accepted);
- QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(e);
- }
+ Q_ASSERT(window);
+ auto *event = new QWindowSystemInterfacePrivate::CloseEvent(window);
+ return QWindowSystemInterfacePrivate::handleWindowSystemEvent<Delivery>(event);
}
/*!
@@ -619,6 +623,7 @@ bool QWindowSystemInterface::isTouchDeviceRegistered(const QTouchDevice *device)
static int g_nextPointId = 1;
// map from device-independent point id (arbitrary) to "Qt point" ids
+QMutex QWindowSystemInterfacePrivate::pointIdMapMutex;
typedef QMap<quint64, int> PointIdMap;
Q_GLOBAL_STATIC(PointIdMap, g_pointIdMap)
@@ -636,6 +641,8 @@ Q_GLOBAL_STATIC(PointIdMap, g_pointIdMap)
*/
static int acquireCombinedPointId(quint8 deviceId, int pointId)
{
+ QMutexLocker locker(&QWindowSystemInterfacePrivate::pointIdMapMutex);
+
quint64 combinedId64 = (quint64(deviceId) << 32) + pointId;
auto it = g_pointIdMap->constFind(combinedId64);
int uid;
@@ -695,6 +702,8 @@ QList<QTouchEvent::TouchPoint>
}
if (states == Qt::TouchPointReleased) {
+ QMutexLocker locker(&QWindowSystemInterfacePrivate::pointIdMapMutex);
+
// All points on deviceId have been released.
// Remove all points associated with that device from g_pointIdMap.
// (On other devices, some touchpoints might still be pressed.
@@ -714,6 +723,7 @@ QList<QTouchEvent::TouchPoint>
void QWindowSystemInterfacePrivate::clearPointIdMap()
{
+ QMutexLocker locker(&QWindowSystemInterfacePrivate::pointIdMapMutex);
g_pointIdMap->clear();
g_nextPointId = 1;
}
@@ -818,7 +828,8 @@ void QWindowSystemInterface::handleScreenAdded(QPlatformScreen *ps, bool isPrima
*/
void QWindowSystemInterface::handleScreenRemoved(QPlatformScreen *platformScreen)
{
- // Important to keep this order since the QSceen doesn't own the platform screen
+ // Important to keep this order since the QSceen doesn't own the platform screen.
+ // The QScreen destructor will take care changing the primary screen, so no need here.
delete platformScreen->screen();
delete platformScreen;
}
@@ -857,8 +868,8 @@ void QWindowSystemInterface::handleScreenGeometryChange(QScreen *screen, const Q
void QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QScreen *screen, qreal dpiX, qreal dpiY)
{
- QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent *e =
- new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, dpiX, dpiY); // ### tja
+ const QDpi effectiveDpi = QPlatformScreen::overrideDpi(QDpi{dpiX, dpiY});
+ auto e = new QWindowSystemInterfacePrivate::ScreenLogicalDotsPerInchEvent(screen, effectiveDpi.first, effectiveDpi.second);
QWindowSystemInterfacePrivate::handleWindowSystemEvent(e);
}
@@ -924,7 +935,11 @@ QPlatformDropQtResponse QWindowSystemInterface::handleDrop(QWindow *window, cons
\note This function can only be called from the GUI thread.
*/
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QWindowSystemInterface::handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QWindowSystemInterface::handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result)
+#endif
{
return QGuiApplicationPrivate::processNativeEvent(window, eventType, message, result);
}
@@ -1111,7 +1126,7 @@ bool QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ProcessEventsFl
} else {
sendWindowSystemEvents(flags);
}
- return QWindowSystemInterfacePrivate::eventAccepted.load() > 0;
+ return QWindowSystemInterfacePrivate::eventAccepted.loadRelaxed() > 0;
}
void QWindowSystemInterface::deferredFlushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags)
@@ -1152,7 +1167,7 @@ bool QWindowSystemInterface::sendWindowSystemEvents(QEventLoop::ProcessEventsFla
// (excluding flush events). This state can then be
// returned by flushWindowSystemEvents().
if (event->type != QWindowSystemInterfacePrivate::FlushEvents)
- QWindowSystemInterfacePrivate::eventAccepted.store(event->eventAccepted);
+ QWindowSystemInterfacePrivate::eventAccepted.storeRelaxed(event->eventAccepted);
delete event;
}
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index bf98c33a1a..d5a4ad30d8 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -194,7 +194,7 @@ public:
static void handleExposeEvent(QWindow *window, const QRegion &region);
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
- static void handleCloseEvent(QWindow *window, bool *accepted = nullptr);
+ static bool handleCloseEvent(QWindow *window);
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
static void handleEnterEvent(QWindow *window, const QPointF &local = QPointF(), const QPointF& global = QPointF());
@@ -215,6 +215,9 @@ public:
template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
static void handleApplicationStateChanged(Qt::ApplicationState newState, bool forcePropagate = false);
+ template<typename Delivery = QWindowSystemInterface::DefaultDelivery>
+ static bool handleApplicationTermination();
+
#if QT_CONFIG(draganddrop)
#if QT_DEPRECATED_SINCE(5, 11)
QT_DEPRECATED static QPlatformDragQtResponse handleDrag(QWindow *window, const QMimeData *dropData,
@@ -230,7 +233,11 @@ public:
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers);
#endif // QT_CONFIG(draganddrop)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ static bool handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result);
+#else
static bool handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result);
+#endif
// Changes to the screen
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary = false);
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index 6c818a9030..6e4bce607e 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -99,7 +99,8 @@ public:
ApplicationStateChanged = 0x19,
FlushEvents = 0x20,
WindowScreenChanged = 0x21,
- SafeAreaMarginsChanged = 0x22
+ SafeAreaMarginsChanged = 0x22,
+ ApplicationTermination = 0x23
};
class WindowSystemEvent {
@@ -123,11 +124,10 @@ public:
class CloseEvent : public WindowSystemEvent {
public:
- explicit CloseEvent(QWindow *w, bool *a = 0)
- : WindowSystemEvent(Close), window(w), accepted(a)
+ explicit CloseEvent(QWindow *w)
+ : WindowSystemEvent(Close), window(w)
{ }
QPointer<QWindow> window;
- bool *accepted;
};
class GeometryChangeEvent : public WindowSystemEvent {
@@ -398,7 +398,7 @@ public:
class TabletEnterProximityEvent : public InputEvent {
public:
TabletEnterProximityEvent(ulong time, int device, int pointerType, qint64 uid)
- : InputEvent(0, time, TabletEnterProximity, Qt::NoModifier),
+ : InputEvent(nullptr, time, TabletEnterProximity, Qt::NoModifier),
device(device), pointerType(pointerType), uid(uid) { }
int device;
int pointerType;
@@ -408,7 +408,7 @@ public:
class TabletLeaveProximityEvent : public InputEvent {
public:
TabletLeaveProximityEvent(ulong time, int device, int pointerType, qint64 uid)
- : InputEvent(0, time, TabletLeaveProximity, Qt::NoModifier),
+ : InputEvent(nullptr, time, TabletLeaveProximity, Qt::NoModifier),
device(device), pointerType(pointerType), uid(uid) { }
int device;
int pointerType;
@@ -474,7 +474,7 @@ public:
for (int i = 0; i < impl.size(); ++i)
if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent))
return impl.takeAt(i);
- return 0;
+ return nullptr;
}
bool nonUserInputEventsQueued()
{
@@ -495,7 +495,7 @@ public:
if (impl.at(i)->type == t)
return impl.at(i);
}
- return 0;
+ return nullptr;
}
void remove(const WindowSystemEvent *e)
{
@@ -529,6 +529,7 @@ public:
static QWaitCondition eventsFlushed;
static QMutex flushEventMutex;
+ static QMutex pointIdMapMutex;
static QAtomicInt eventAccepted;
static QList<QTouchEvent::TouchPoint>
diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h
index 6a2a9e5bae..692c29c996 100644
--- a/src/gui/math3d/qgenericmatrix.h
+++ b/src/gui/math3d/qgenericmatrix.h
@@ -351,11 +351,11 @@ QDebug operator<<(QDebug dbg, const QGenericMatrix<N, M, T> &m)
QDebugStateSaver saver(dbg);
dbg.nospace() << "QGenericMatrix<" << N << ", " << M
<< ", " << QTypeInfo<T>::name()
- << ">(" << endl << qSetFieldWidth(10);
+ << ">(" << Qt::endl << qSetFieldWidth(10);
for (int row = 0; row < M; ++row) {
for (int col = 0; col < N; ++col)
dbg << m(row, col);
- dbg << endl;
+ dbg << Qt::endl;
}
dbg << qSetFieldWidth(0) << ')';
return dbg;
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index 045fa210c4..ad4cdfdbf4 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -2037,12 +2037,12 @@ QDebug operator<<(QDebug dbg, const QMatrix4x4 &m)
}
// Output in row-major order because it is more human-readable.
- dbg.nospace() << "QMatrix4x4(type:" << bits.constData() << endl
+ dbg.nospace() << "QMatrix4x4(type:" << bits.constData() << Qt::endl
<< qSetFieldWidth(10)
- << m(0, 0) << m(0, 1) << m(0, 2) << m(0, 3) << endl
- << m(1, 0) << m(1, 1) << m(1, 2) << m(1, 3) << endl
- << m(2, 0) << m(2, 1) << m(2, 2) << m(2, 3) << endl
- << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) << endl
+ << m(0, 0) << m(0, 1) << m(0, 2) << m(0, 3) << Qt::endl
+ << m(1, 0) << m(1, 1) << m(1, 2) << m(1, 3) << Qt::endl
+ << m(2, 0) << m(2, 1) << m(2, 2) << m(2, 3) << Qt::endl
+ << m(3, 0) << m(3, 1) << m(3, 2) << m(3, 3) << Qt::endl
<< qSetFieldWidth(0) << ')';
return dbg;
}
diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp
index 2b1e57a4bb..667d16317f 100644
--- a/src/gui/opengl/qopengl.cpp
+++ b/src/gui/opengl/qopengl.cpp
@@ -80,7 +80,7 @@ QOpenGLExtensionMatcher::QOpenGLExtensionMatcher()
if (extensionStr) {
QByteArray ba(extensionStr);
QList<QByteArray> extensions = ba.split(' ');
- m_extensions = extensions.toSet();
+ m_extensions = QSet<QByteArray>(extensions.constBegin(), extensions.constEnd());
} else {
#ifdef QT_OPENGL_3
// clear error state
@@ -136,7 +136,7 @@ QDebug operator<<(QDebug d, const QOpenGLConfig::Gpu &g)
d.nospace();
d << "Gpu(";
if (g.isValid()) {
- d << "vendor=" << hex << showbase <<g.vendorId << ", device=" << g.deviceId
+ d << "vendor=" << Qt::hex << Qt::showbase <<g.vendorId << ", device=" << g.deviceId
<< "version=" << g.driverVersion;
} else {
d << 0;
diff --git a/src/gui/opengl/qopengldebug.cpp b/src/gui/opengl/qopengldebug.cpp
index 9f1bb76869..462a4fdb3b 100644
--- a/src/gui/opengl/qopengldebug.cpp
+++ b/src/gui/opengl/qopengldebug.cpp
@@ -1807,7 +1807,7 @@ QList<QOpenGLDebugMessage> QOpenGLDebugLogger::loggedMessages() const
\note Message texts are encoded in UTF-8 when they get passed to OpenGL, so
their size in bytes does not usually match the amount of UTF-16 code units,
- as returned f.i. by QString::length(). (It does if the message contains
+ as returned, for instance, by QString::length(). (It does if the message contains
7-bit ASCII only data, which is typical for debug messages.)
*/
qint64 QOpenGLDebugLogger::maximumMessageLength() const
diff --git a/src/gui/opengl/qopengldebug.h b/src/gui/opengl/qopengldebug.h
index 556ec175e1..7363985d60 100644
--- a/src/gui/opengl/qopengldebug.h
+++ b/src/gui/opengl/qopengldebug.h
@@ -110,12 +110,10 @@ public:
QOpenGLDebugMessage(const QOpenGLDebugMessage &debugMessage);
QOpenGLDebugMessage &operator=(const QOpenGLDebugMessage &debugMessage);
-#ifdef Q_COMPILER_RVALUE_REFS
- QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QOpenGLDebugMessage &operator=(QOpenGLDebugMessage &&other) noexcept { swap(other); return *this; }
~QOpenGLDebugMessage();
- void swap(QOpenGLDebugMessage &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QOpenGLDebugMessage &other) noexcept { qSwap(d, other.d); }
Source source() const;
Type type() const;
diff --git a/src/gui/opengl/qopenglengineshadermanager_p.h b/src/gui/opengl/qopenglengineshadermanager_p.h
index d43788d777..14c79f5de3 100644
--- a/src/gui/opengl/qopenglengineshadermanager_p.h
+++ b/src/gui/opengl/qopenglengineshadermanager_p.h
@@ -370,7 +370,7 @@ private:
class QOpenGLEngineShaderProg
{
public:
- QOpenGLEngineShaderProg() : program(0) {}
+ QOpenGLEngineShaderProg() : program(nullptr) {}
~QOpenGLEngineShaderProg() {
if (program)
diff --git a/src/gui/opengl/qopengles2ext.h b/src/gui/opengl/qopengles2ext.h
index 8ff50a924e..8517e24267 100644
--- a/src/gui/opengl/qopengles2ext.h
+++ b/src/gui/opengl/qopengles2ext.h
@@ -1,5 +1,5 @@
-#ifndef __gl2ext_h_
-#define __gl2ext_h_ 1
+#ifndef __gles2_gl2ext_h_
+#define __gles2_gl2ext_h_ 1
#if 0
#pragma qt_no_master_include
@@ -25,7 +25,7 @@ typedef struct __GLsync *GLsync;
#endif
/*
-** Copyright (c) 2013-2017 The Khronos Group Inc.
+** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -57,7 +57,7 @@ typedef struct __GLsync *GLsync;
#define GL_APIENTRYP GL_APIENTRY*
#endif
-/* Generated on date 20170331 */
+/* Generated on date 20190228 */
/* Generated C header for:
* API: gles2
@@ -178,6 +178,16 @@ GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params);
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
#endif /* GL_KHR_no_error */
+#ifndef GL_KHR_parallel_shader_compile
+#define GL_KHR_parallel_shader_compile 1
+#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
+#define GL_COMPLETION_STATUS_KHR 0x91B1
+typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count);
+#endif
+#endif /* GL_KHR_parallel_shader_compile */
+
#ifndef GL_KHR_robust_buffer_access_behavior
#define GL_KHR_robust_buffer_access_behavior 1
#endif /* GL_KHR_robust_buffer_access_behavior */
@@ -343,12 +353,12 @@ GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexOES (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
#endif
#endif /* GL_OES_draw_elements_base_vertex */
@@ -810,6 +820,22 @@ GL_APICALL void GL_APIENTRY glGetFloati_vOES (GLenum target, GLuint index, GLflo
#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
#endif /* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_framebuffer_multisample_advanced
+#define GL_AMD_framebuffer_multisample_advanced 1
+#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2
+#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3
+#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4
+#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5
+#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6
+#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_AMD_framebuffer_multisample_advanced */
+
#ifndef GL_AMD_performance_monitor
#define GL_AMD_performance_monitor 1
#define GL_COUNTER_TYPE_AMD 0x8BC0
@@ -1070,6 +1096,20 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_SHADER_BINARY_DMP 0x9250
#endif /* GL_DMP_shader_binary */
+#ifndef GL_EXT_EGL_image_array
+#define GL_EXT_EGL_image_array 1
+#endif /* GL_EXT_EGL_image_array */
+
+#ifndef GL_EXT_EGL_image_storage
+#define GL_EXT_EGL_image_storage 1
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#endif
+#endif /* GL_EXT_EGL_image_storage */
+
#ifndef GL_EXT_YUV_target
#define GL_EXT_YUV_target 1
#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7
@@ -1141,6 +1181,20 @@ GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level,
#endif
#endif /* GL_EXT_clear_texture */
+#ifndef GL_EXT_clip_control
+#define GL_EXT_clip_control 1
+#define GL_LOWER_LEFT_EXT 0x8CA1
+#define GL_UPPER_LEFT_EXT 0x8CA2
+#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E
+#define GL_ZERO_TO_ONE_EXT 0x935F
+#define GL_CLIP_ORIGIN_EXT 0x935C
+#define GL_CLIP_DEPTH_MODE_EXT 0x935D
+typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth);
+#endif
+#endif /* GL_EXT_clip_control */
+
#ifndef GL_EXT_clip_cull_distance
#define GL_EXT_clip_cull_distance 1
#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32
@@ -1211,6 +1265,11 @@ GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
#endif
#endif /* GL_EXT_debug_marker */
+#ifndef GL_EXT_depth_clamp
+#define GL_EXT_depth_clamp 1
+#define GL_DEPTH_CLAMP_EXT 0x864F
+#endif /* GL_EXT_depth_clamp */
+
#ifndef GL_EXT_discard_framebuffer
#define GL_EXT_discard_framebuffer 1
#define GL_COLOR_EXT 0x1800
@@ -1326,12 +1385,10 @@ GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
#endif
#endif /* GL_EXT_draw_elements_base_vertex */
@@ -1355,6 +1412,17 @@ GL_APICALL void GL_APIENTRY glDrawTransformFeedbackInstancedEXT (GLenum mode, GL
#endif
#endif /* GL_EXT_draw_transform_feedback */
+#ifndef GL_EXT_external_buffer
+#define GL_EXT_external_buffer 1
+typedef void *GLeglClientBufferEXT;
+typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+#endif
+#endif /* GL_EXT_external_buffer */
+
#ifndef GL_EXT_float_blend
#define GL_EXT_float_blend 1
#endif /* GL_EXT_float_blend */
@@ -1433,6 +1501,85 @@ GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr
#endif
#endif /* GL_EXT_map_buffer_range */
+#ifndef GL_EXT_memory_object
+#define GL_EXT_memory_object 1
+#define GL_TEXTURE_TILING_EXT 0x9580
+#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581
+#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B
+#define GL_NUM_TILING_TYPES_EXT 0x9582
+#define GL_TILING_TYPES_EXT 0x9583
+#define GL_OPTIMAL_TILING_EXT 0x9584
+#define GL_LINEAR_TILING_EXT 0x9585
+#define GL_NUM_DEVICE_UUIDS_EXT 0x9596
+#define GL_DEVICE_UUID_EXT 0x9597
+#define GL_DRIVER_UUID_EXT 0x9598
+#define GL_UUID_SIZE_EXT 16
+typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data);
+typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data);
+typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects);
+typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject);
+typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects);
+typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data);
+GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data);
+GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects);
+GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXT (GLuint memoryObject);
+GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects);
+GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params);
+GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
+#endif
+#endif /* GL_EXT_memory_object */
+
+#ifndef GL_EXT_memory_object_fd
+#define GL_EXT_memory_object_fd 1
+#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586
+typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+#endif
+#endif /* GL_EXT_memory_object_fd */
+
+#ifndef GL_EXT_memory_object_win32
+#define GL_EXT_memory_object_win32 1
+#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587
+#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588
+#define GL_DEVICE_LUID_EXT 0x9599
+#define GL_DEVICE_NODE_MASK_EXT 0x959A
+#define GL_LUID_SIZE_EXT 8
+#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589
+#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A
+#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B
+#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C
+typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
+typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
+GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
+#endif
+#endif /* GL_EXT_memory_object_win32 */
+
#ifndef GL_EXT_multi_draw_arrays
#define GL_EXT_multi_draw_arrays 1
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
@@ -1598,6 +1745,55 @@ GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location,
#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
#endif /* GL_EXT_sRGB_write_control */
+#ifndef GL_EXT_semaphore
+#define GL_EXT_semaphore 1
+#define GL_LAYOUT_GENERAL_EXT 0x958D
+#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E
+#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
+#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
+#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591
+#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592
+#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593
+#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530
+#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531
+typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores);
+typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores);
+typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore);
+typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params);
+typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params);
+typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
+typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores);
+GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores);
+GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXT (GLuint semaphore);
+GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params);
+GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params);
+GL_APICALL void GL_APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
+GL_APICALL void GL_APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
+#endif
+#endif /* GL_EXT_semaphore */
+
+#ifndef GL_EXT_semaphore_fd
+#define GL_EXT_semaphore_fd 1
+typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd);
+#endif
+#endif /* GL_EXT_semaphore_fd */
+
+#ifndef GL_EXT_semaphore_win32
+#define GL_EXT_semaphore_win32 1
+#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594
+#define GL_D3D12_FENCE_VALUE_EXT 0x9595
+typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle);
+typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle);
+GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name);
+#endif
+#endif /* GL_EXT_semaphore_win32 */
+
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#define GL_ACTIVE_PROGRAM_EXT 0x8259
@@ -1703,6 +1899,14 @@ GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLin
#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
#endif /* GL_EXT_shader_framebuffer_fetch */
+#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent
+#define GL_EXT_shader_framebuffer_fetch_non_coherent 1
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void);
+#endif
+#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */
+
#ifndef GL_EXT_shader_group_vote
#define GL_EXT_shader_group_vote 1
#endif /* GL_EXT_shader_group_vote */
@@ -1890,18 +2094,42 @@ GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalf
#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69
#endif /* GL_EXT_texture_compression_astc_decode_mode */
+#ifndef GL_EXT_texture_compression_bptc
+#define GL_EXT_texture_compression_bptc 1
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F
+#endif /* GL_EXT_texture_compression_bptc */
+
#ifndef GL_EXT_texture_compression_dxt1
#define GL_EXT_texture_compression_dxt1 1
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif /* GL_EXT_texture_compression_dxt1 */
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif /* GL_EXT_texture_compression_rgtc */
+
#ifndef GL_EXT_texture_compression_s3tc
#define GL_EXT_texture_compression_s3tc 1
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#endif /* GL_EXT_texture_compression_s3tc */
+#ifndef GL_EXT_texture_compression_s3tc_srgb
+#define GL_EXT_texture_compression_s3tc_srgb 1
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif /* GL_EXT_texture_compression_s3tc_srgb */
+
#ifndef GL_EXT_texture_cube_map_array
#define GL_EXT_texture_cube_map_array 1
#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009
@@ -1923,12 +2151,24 @@ GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalf
#ifndef GL_EXT_texture_filter_minmax
#define GL_EXT_texture_filter_minmax 1
+#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366
+#define GL_WEIGHTED_AVERAGE_EXT 0x9367
#endif /* GL_EXT_texture_filter_minmax */
#ifndef GL_EXT_texture_format_BGRA8888
#define GL_EXT_texture_format_BGRA8888 1
#endif /* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_sRGB_override
+#define GL_EXT_texture_format_sRGB_override 1
+#define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF
+#endif /* GL_EXT_texture_format_sRGB_override */
+
+#ifndef GL_EXT_texture_mirror_clamp_to_edge
+#define GL_EXT_texture_mirror_clamp_to_edge 1
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
+#endif /* GL_EXT_texture_mirror_clamp_to_edge */
+
#ifndef GL_EXT_texture_norm16
#define GL_EXT_texture_norm16 1
#define GL_R16_EXT 0x822A
@@ -1938,6 +2178,10 @@ GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalf
#define GL_RGB16_SNORM_EXT 0x8F9A
#endif /* GL_EXT_texture_norm16 */
+#ifndef GL_EXT_texture_query_lod
+#define GL_EXT_texture_query_lod 1
+#endif /* GL_EXT_texture_query_lod */
+
#ifndef GL_EXT_texture_rg
#define GL_EXT_texture_rg 1
#define GL_RED_EXT 0x1903
@@ -2019,6 +2263,16 @@ GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLu
#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4
#endif /* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_win32_keyed_mutex
+#define GL_EXT_win32_keyed_mutex 1
+typedef GLboolean (GL_APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout);
+typedef GLboolean (GL_APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLboolean GL_APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout);
+GL_APICALL GLboolean GL_APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key);
+#endif
+#endif /* GL_EXT_win32_keyed_mutex */
+
#ifndef GL_EXT_window_rectangles
#define GL_EXT_window_rectangles 1
#define GL_INCLUSIVE_EXT 0x8F10
@@ -2121,6 +2375,11 @@ GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target,
#define GL_CUBIC_MIPMAP_LINEAR_IMG 0x913B
#endif /* GL_IMG_texture_filter_cubic */
+#ifndef GL_INTEL_blackhole_render
+#define GL_INTEL_blackhole_render 1
+#define GL_BLACKHOLE_RENDER_INTEL 0x83FC
+#endif /* GL_INTEL_blackhole_render */
+
#ifndef GL_INTEL_conservative_rasterization
#define GL_INTEL_conservative_rasterization 1
#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
@@ -2163,7 +2422,7 @@ typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
#ifdef GL_GLEXT_PROTOTYPES
@@ -2174,12 +2433,22 @@ GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
#endif
#endif /* GL_INTEL_performance_query */
+#ifndef GL_MESA_framebuffer_flip_y
+#define GL_MESA_framebuffer_flip_y 1
+#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB
+#endif /* GL_MESA_framebuffer_flip_y */
+
+#ifndef GL_MESA_program_binary_formats
+#define GL_MESA_program_binary_formats 1
+#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F
+#endif /* GL_MESA_program_binary_formats */
+
#ifndef GL_MESA_shader_integer_functions
#define GL_MESA_shader_integer_functions 1
#endif /* GL_MESA_shader_integer_functions */
@@ -2284,6 +2553,27 @@ GL_APICALL void GL_APIENTRY glBlendBarrierNV (void);
#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
#endif /* GL_NV_blend_equation_advanced_coherent */
+#ifndef GL_NV_blend_minmax_factor
+#define GL_NV_blend_minmax_factor 1
+#define GL_FACTOR_MIN_AMD 0x901C
+#define GL_FACTOR_MAX_AMD 0x901D
+#endif /* GL_NV_blend_minmax_factor */
+
+#ifndef GL_NV_clip_space_w_scaling
+#define GL_NV_clip_space_w_scaling 1
+#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C
+#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D
+#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E
+typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+#endif
+#endif /* GL_NV_clip_space_w_scaling */
+
+#ifndef GL_NV_compute_shader_derivatives
+#define GL_NV_compute_shader_derivatives 1
+#endif /* GL_NV_compute_shader_derivatives */
+
#ifndef GL_NV_conditional_render
#define GL_NV_conditional_render 1
#define GL_QUERY_WAIT_NV 0x8E13
@@ -2310,6 +2600,11 @@ GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybit
#endif
#endif /* GL_NV_conservative_raster */
+#ifndef GL_NV_conservative_raster_pre_snap
+#define GL_NV_conservative_raster_pre_snap 1
+#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550
+#endif /* GL_NV_conservative_raster_pre_snap */
+
#ifndef GL_NV_conservative_raster_pre_snap_triangles
#define GL_NV_conservative_raster_pre_snap_triangles 1
#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D
@@ -2655,6 +2950,34 @@ GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum
#endif
#endif /* GL_NV_internalformat_sample_query */
+#ifndef GL_NV_memory_attachment
+#define GL_NV_memory_attachment 1
+#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4
+#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5
+#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6
+#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7
+#define GL_MEMORY_ATTACHABLE_NV 0x95A8
+#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9
+#define GL_DETACHED_TEXTURES_NV 0x95AA
+#define GL_DETACHED_BUFFERS_NV 0x95AB
+#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC
+#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD
+typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
+typedef void (GL_APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname);
+typedef void (GL_APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset);
+typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
+GL_APICALL void GL_APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname);
+GL_APICALL void GL_APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset);
+GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset);
+#endif
+#endif /* GL_NV_memory_attachment */
+
#ifndef GL_NV_non_square_matrices
#define GL_NV_non_square_matrices 1
#define GL_FLOAT_MAT2x3_NV 0x8B65
@@ -2681,6 +3004,7 @@ GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei coun
#ifndef GL_NV_path_rendering
#define GL_NV_path_rendering 1
+typedef double GLdouble;
#define GL_PATH_FORMAT_SVG_NV 0x9070
#define GL_PATH_FORMAT_PS_NV 0x9071
#define GL_STANDARD_FONT_NAME_NV 0x9072
@@ -2891,6 +3215,25 @@ typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathNa
typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range);
GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
@@ -2949,6 +3292,25 @@ GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLe
GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
#endif
#endif /* GL_NV_path_rendering */
@@ -2957,6 +3319,14 @@ GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum pro
#define GL_SHARED_EDGE_NV 0xC0
#endif /* GL_NV_path_rendering_shared_edge */
+#ifndef GL_NV_pixel_buffer_object
+#define GL_NV_pixel_buffer_object 1
+#define GL_PIXEL_PACK_BUFFER_NV 0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF
+#endif /* GL_NV_pixel_buffer_object */
+
#ifndef GL_NV_polygon_mode
#define GL_NV_polygon_mode 1
#define GL_POLYGON_MODE_NV 0x0B40
@@ -3034,6 +3404,18 @@ GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void);
#define GL_NV_sample_mask_override_coverage 1
#endif /* GL_NV_sample_mask_override_coverage */
+#ifndef GL_NV_scissor_exclusive
+#define GL_NV_scissor_exclusive 1
+#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555
+#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556
+typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v);
+#endif
+#endif /* GL_NV_scissor_exclusive */
+
#ifndef GL_NV_shader_atomic_fp16_vector
#define GL_NV_shader_atomic_fp16_vector 1
#endif /* GL_NV_shader_atomic_fp16_vector */
@@ -3052,6 +3434,10 @@ GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void);
#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5
#endif /* GL_NV_shadow_samplers_cube */
+#ifndef GL_NV_stereo_view_rendering
+#define GL_NV_stereo_view_rendering 1
+#endif /* GL_NV_stereo_view_rendering */
+
#ifndef GL_NV_texture_border_clamp
#define GL_NV_texture_border_clamp 1
#define GL_TEXTURE_BORDER_COLOR_NV 0x1004
@@ -3148,6 +3534,10 @@ GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum
#endif
#endif /* GL_OVR_multiview_multisampled_render_to_texture */
+#ifndef GL_QCOM_YUV_texture_gather
+#define GL_QCOM_YUV_texture_gather 1
+#endif /* GL_QCOM_YUV_texture_gather */
+
#ifndef GL_QCOM_alpha_test
#define GL_QCOM_alpha_test 1
#define GL_ALPHA_TEST_QCOM 0x0BC0
@@ -3245,6 +3635,38 @@ GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebu
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
#endif /* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent
+#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1
+#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void);
+#endif
+#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */
+
+#ifndef GL_QCOM_shader_framebuffer_fetch_rate
+#define GL_QCOM_shader_framebuffer_fetch_rate 1
+#endif /* GL_QCOM_shader_framebuffer_fetch_rate */
+
+#ifndef GL_QCOM_texture_foveated
+#define GL_QCOM_texture_foveated 1
+#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB
+#define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC
+#define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD
+#define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE
+#define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF
+typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#endif
+#endif /* GL_QCOM_texture_foveated */
+
+#ifndef GL_QCOM_texture_foveated_subsampled_layout
+#define GL_QCOM_texture_foveated_subsampled_layout 1
+#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004
+#define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1
+#endif /* GL_QCOM_texture_foveated_subsampled_layout */
+
#ifndef GL_QCOM_tiled_rendering
#define GL_QCOM_tiled_rendering 1
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
diff --git a/src/gui/opengl/qopenglext.h b/src/gui/opengl/qopenglext.h
index 63873476e4..e3f9205619 100644
--- a/src/gui/opengl/qopenglext.h
+++ b/src/gui/opengl/qopenglext.h
@@ -12,7 +12,7 @@ extern "C" {
#endif
/*
-** Copyright (c) 2013-2017 The Khronos Group Inc.
+** Copyright (c) 2013-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -57,7 +57,7 @@ extern "C" {
#define GLAPI extern
#endif
-#define GL_GLEXT_VERSION 20170325
+#define GL_GLEXT_VERSION 20190228
/* Generated C header for:
* API: gl
@@ -359,15 +359,17 @@ GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m);
#define GL_TEXTURE_FILTER_CONTROL 0x8500
#define GL_DEPTH_TEXTURE_MODE 0x884B
#define GL_COMPARE_R_TO_TEXTURE 0x884E
-#define GL_FUNC_ADD 0x8006
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
+#define GL_BLEND_COLOR 0x8005
+#define GL_BLEND_EQUATION 0x8009
#define GL_CONSTANT_COLOR 0x8001
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_MIN 0x8007
+#define GL_MAX 0x8008
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount);
@@ -2872,6 +2874,42 @@ GLAPI void APIENTRY glTextureBarrier (void);
#endif
#endif /* GL_VERSION_4_5 */
+#ifndef GL_VERSION_4_6
+#define GL_VERSION_4_6 1
+#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551
+#define GL_SPIR_V_BINARY 0x9552
+#define GL_PARAMETER_BUFFER 0x80EE
+#define GL_PARAMETER_BUFFER_BINDING 0x80EF
+#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008
+#define GL_VERTICES_SUBMITTED 0x82EE
+#define GL_PRIMITIVES_SUBMITTED 0x82EF
+#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0
+#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1
+#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2
+#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3
+#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4
+#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5
+#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6
+#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7
+#define GL_POLYGON_OFFSET_CLAMP 0x8E1B
+#define GL_SPIR_V_EXTENSIONS 0x9553
+#define GL_NUM_SPIR_V_EXTENSIONS 0x9554
+#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF
+#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC
+#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED
+typedef void (APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glSpecializeShader (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue);
+GLAPI void APIENTRY glMultiDrawArraysIndirectCount (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirectCount (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+GLAPI void APIENTRY glPolygonOffsetClamp (GLfloat factor, GLfloat units, GLfloat clamp);
+#endif
+#endif /* GL_VERSION_4_6 */
+
#ifndef GL_ARB_ES2_compatibility
#define GL_ARB_ES2_compatibility 1
#endif /* GL_ARB_ES2_compatibility */
@@ -3475,8 +3513,6 @@ typedef unsigned short GLhalfARB;
#ifndef GL_ARB_imaging
#define GL_ARB_imaging 1
-#define GL_BLEND_COLOR 0x8005
-#define GL_BLEND_EQUATION 0x8009
#define GL_CONVOLUTION_1D 0x8010
#define GL_CONVOLUTION_2D 0x8011
#define GL_SEPARABLE_2D 0x8012
@@ -3613,11 +3649,11 @@ GLAPI void APIENTRY glResetMinmax (GLenum target);
#define GL_ARB_indirect_parameters 1
#define GL_PARAMETER_BUFFER_ARB 0x80EE
#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF
-typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
#endif
#endif /* GL_ARB_indirect_parameters */
@@ -3637,6 +3673,25 @@ GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor);
#ifndef GL_ARB_internalformat_query2
#define GL_ARB_internalformat_query2 1
#define GL_SRGB_DECODE_ARB 0x8299
+#define GL_VIEW_CLASS_EAC_R11 0x9383
+#define GL_VIEW_CLASS_EAC_RG11 0x9384
+#define GL_VIEW_CLASS_ETC2_RGB 0x9385
+#define GL_VIEW_CLASS_ETC2_RGBA 0x9386
+#define GL_VIEW_CLASS_ETC2_EAC_RGBA 0x9387
+#define GL_VIEW_CLASS_ASTC_4x4_RGBA 0x9388
+#define GL_VIEW_CLASS_ASTC_5x4_RGBA 0x9389
+#define GL_VIEW_CLASS_ASTC_5x5_RGBA 0x938A
+#define GL_VIEW_CLASS_ASTC_6x5_RGBA 0x938B
+#define GL_VIEW_CLASS_ASTC_6x6_RGBA 0x938C
+#define GL_VIEW_CLASS_ASTC_8x5_RGBA 0x938D
+#define GL_VIEW_CLASS_ASTC_8x6_RGBA 0x938E
+#define GL_VIEW_CLASS_ASTC_8x8_RGBA 0x938F
+#define GL_VIEW_CLASS_ASTC_10x5_RGBA 0x9390
+#define GL_VIEW_CLASS_ASTC_10x6_RGBA 0x9391
+#define GL_VIEW_CLASS_ASTC_10x8_RGBA 0x9392
+#define GL_VIEW_CLASS_ASTC_10x10_RGBA 0x9393
+#define GL_VIEW_CLASS_ASTC_12x10_RGBA 0x9394
+#define GL_VIEW_CLASS_ASTC_12x12_RGBA 0x9395
#endif /* GL_ARB_internalformat_query2 */
#ifndef GL_ARB_invalidate_subdata
@@ -3894,6 +3949,10 @@ GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params);
#define GL_COORD_REPLACE_ARB 0x8862
#endif /* GL_ARB_point_sprite */
+#ifndef GL_ARB_polygon_offset_clamp
+#define GL_ARB_polygon_offset_clamp 1
+#endif /* GL_ARB_polygon_offset_clamp */
+
#ifndef GL_ARB_post_depth_coverage
#define GL_ARB_post_depth_coverage 1
#endif /* GL_ARB_post_depth_coverage */
@@ -4292,6 +4351,10 @@ GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xo
#define GL_ARB_sparse_texture_clamp 1
#endif /* GL_ARB_sparse_texture_clamp */
+#ifndef GL_ARB_spirv_extensions
+#define GL_ARB_spirv_extensions 1
+#endif /* GL_ARB_spirv_extensions */
+
#ifndef GL_ARB_stencil_texturing
#define GL_ARB_stencil_texturing 1
#endif /* GL_ARB_stencil_texturing */
@@ -4444,6 +4507,10 @@ GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void
#define GL_DOT3_RGBA_ARB 0x86AF
#endif /* GL_ARB_texture_env_dot3 */
+#ifndef GL_ARB_texture_filter_anisotropic
+#define GL_ARB_texture_filter_anisotropic 1
+#endif /* GL_ARB_texture_filter_anisotropic */
+
#ifndef GL_ARB_texture_filter_minmax
#define GL_ARB_texture_filter_minmax 1
#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366
@@ -4949,6 +5016,16 @@ GLAPI void APIENTRY glBlendBarrierKHR (void);
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
#endif /* GL_KHR_no_error */
+#ifndef GL_KHR_parallel_shader_compile
+#define GL_KHR_parallel_shader_compile 1
+#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
+#define GL_COMPLETION_STATUS_KHR 0x91B1
+typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count);
+#endif
+#endif /* GL_KHR_parallel_shader_compile */
+
#ifndef GL_KHR_robust_buffer_access_behavior
#define GL_KHR_robust_buffer_access_behavior 1
#endif /* GL_KHR_robust_buffer_access_behavior */
@@ -5389,6 +5466,22 @@ GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRG
#endif
#endif /* GL_AMD_draw_buffers_blend */
+#ifndef GL_AMD_framebuffer_multisample_advanced
+#define GL_AMD_framebuffer_multisample_advanced 1
+#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2
+#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3
+#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4
+#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5
+#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6
+#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7
+typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+#endif /* GL_AMD_framebuffer_multisample_advanced */
+
#ifndef GL_AMD_framebuffer_sample_positions
#define GL_AMD_framebuffer_sample_positions 1
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
@@ -5428,6 +5521,10 @@ GLAPI void APIENTRY glGetNamedFramebufferParameterfvAMD (GLuint framebuffer, GLe
#define GL_FLOAT16_MAT4x3_AMD 0x91CD
#endif /* GL_AMD_gpu_shader_half_float */
+#ifndef GL_AMD_gpu_shader_int16
+#define GL_AMD_gpu_shader_int16 1
+#endif /* GL_AMD_gpu_shader_int16 */
+
#ifndef GL_AMD_gpu_shader_int64
#define GL_AMD_gpu_shader_int64 1
typedef int64_t GLint64EXT;
@@ -5649,6 +5746,14 @@ GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLf
#define GL_AMD_shader_explicit_vertex_parameter 1
#endif /* GL_AMD_shader_explicit_vertex_parameter */
+#ifndef GL_AMD_shader_gpu_shader_half_float_fetch
+#define GL_AMD_shader_gpu_shader_half_float_fetch 1
+#endif /* GL_AMD_shader_gpu_shader_half_float_fetch */
+
+#ifndef GL_AMD_shader_image_load_store_lod
+#define GL_AMD_shader_image_load_store_lod 1
+#endif /* GL_AMD_shader_image_load_store_lod */
+
#ifndef GL_AMD_shader_stencil_export
#define GL_AMD_shader_stencil_export 1
#endif /* GL_AMD_shader_stencil_export */
@@ -5688,6 +5793,10 @@ GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value);
#endif
#endif /* GL_AMD_stencil_operation_extended */
+#ifndef GL_AMD_texture_gather_bias_lod
+#define GL_AMD_texture_gather_bias_lod 1
+#endif /* GL_AMD_texture_gather_bias_lod */
+
#ifndef GL_AMD_texture_texture4
#define GL_AMD_texture_texture4 1
#endif /* GL_AMD_texture_texture4 */
@@ -6388,6 +6497,17 @@ GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param);
#define GL_422_REV_AVERAGE_EXT 0x80CF
#endif /* GL_EXT_422_pixels */
+#ifndef GL_EXT_EGL_image_storage
+#define GL_EXT_EGL_image_storage 1
+typedef void *GLeglImageOES;
+typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#endif
+#endif /* GL_EXT_EGL_image_storage */
+
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#define GL_ABGR_EXT 0x8000
@@ -7239,6 +7359,17 @@ GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint en
#endif
#endif /* GL_EXT_draw_range_elements */
+#ifndef GL_EXT_external_buffer
+#define GL_EXT_external_buffer 1
+typedef void *GLeglClientBufferEXT;
+typedef void (APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+GLAPI void APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags);
+#endif
+#endif /* GL_EXT_external_buffer */
+
#ifndef GL_EXT_fog_coord
#define GL_EXT_fog_coord 1
#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
@@ -7582,6 +7713,89 @@ GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode);
#endif
#endif /* GL_EXT_light_texture */
+#ifndef GL_EXT_memory_object
+#define GL_EXT_memory_object 1
+#define GL_TEXTURE_TILING_EXT 0x9580
+#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581
+#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B
+#define GL_NUM_TILING_TYPES_EXT 0x9582
+#define GL_TILING_TYPES_EXT 0x9583
+#define GL_OPTIMAL_TILING_EXT 0x9584
+#define GL_LINEAR_TILING_EXT 0x9585
+#define GL_NUM_DEVICE_UUIDS_EXT 0x9596
+#define GL_DEVICE_UUID_EXT 0x9597
+#define GL_DRIVER_UUID_EXT 0x9598
+#define GL_UUID_SIZE_EXT 16
+typedef void (APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data);
+typedef void (APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data);
+typedef void (APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects);
+typedef GLboolean (APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject);
+typedef void (APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects);
+typedef void (APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params);
+typedef void (APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data);
+GLAPI void APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data);
+GLAPI void APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects);
+GLAPI GLboolean APIENTRY glIsMemoryObjectEXT (GLuint memoryObject);
+GLAPI void APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects);
+GLAPI void APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params);
+GLAPI void APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params);
+GLAPI void APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTexStorageMem1DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTextureStorageMem1DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset);
+#endif
+#endif /* GL_EXT_memory_object */
+
+#ifndef GL_EXT_memory_object_fd
+#define GL_EXT_memory_object_fd 1
+#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586
+typedef void (APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd);
+#endif
+#endif /* GL_EXT_memory_object_fd */
+
+#ifndef GL_EXT_memory_object_win32
+#define GL_EXT_memory_object_win32 1
+#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587
+#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588
+#define GL_DEVICE_LUID_EXT 0x9599
+#define GL_DEVICE_NODE_MASK_EXT 0x959A
+#define GL_LUID_SIZE_EXT 8
+#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589
+#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A
+#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B
+#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C
+typedef void (APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
+typedef void (APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle);
+GLAPI void APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name);
+#endif
+#endif /* GL_EXT_memory_object_win32 */
+
#ifndef GL_EXT_misc_attribute
#define GL_EXT_misc_attribute 1
#endif /* GL_EXT_misc_attribute */
@@ -7823,6 +8037,55 @@ GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei
#endif
#endif /* GL_EXT_secondary_color */
+#ifndef GL_EXT_semaphore
+#define GL_EXT_semaphore 1
+#define GL_LAYOUT_GENERAL_EXT 0x958D
+#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E
+#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
+#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
+#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591
+#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592
+#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593
+#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530
+#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531
+typedef void (APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores);
+typedef void (APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores);
+typedef GLboolean (APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore);
+typedef void (APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params);
+typedef void (APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params);
+typedef void (APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
+typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores);
+GLAPI void APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores);
+GLAPI GLboolean APIENTRY glIsSemaphoreEXT (GLuint semaphore);
+GLAPI void APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params);
+GLAPI void APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params);
+GLAPI void APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
+GLAPI void APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
+#endif
+#endif /* GL_EXT_semaphore */
+
+#ifndef GL_EXT_semaphore_fd
+#define GL_EXT_semaphore_fd 1
+typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd);
+#endif
+#endif /* GL_EXT_semaphore_fd */
+
+#ifndef GL_EXT_semaphore_win32
+#define GL_EXT_semaphore_win32 1
+#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594
+#define GL_D3D12_FENCE_VALUE_EXT 0x9595
+typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle);
+typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle);
+GLAPI void APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name);
+#endif
+#endif /* GL_EXT_semaphore_win32 */
+
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
@@ -7843,6 +8106,19 @@ GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *strin
#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
#endif /* GL_EXT_separate_specular_color */
+#ifndef GL_EXT_shader_framebuffer_fetch
+#define GL_EXT_shader_framebuffer_fetch 1
+#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
+#endif /* GL_EXT_shader_framebuffer_fetch */
+
+#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent
+#define GL_EXT_shader_framebuffer_fetch_non_coherent 1
+typedef void (APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void);
+#endif
+#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */
+
#ifndef GL_EXT_shader_image_load_formatted
#define GL_EXT_shader_image_load_formatted 1
#endif /* GL_EXT_shader_image_load_formatted */
@@ -8143,6 +8419,8 @@ GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint
#ifndef GL_EXT_texture_filter_minmax
#define GL_EXT_texture_filter_minmax 1
+#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366
+#define GL_WEIGHTED_AVERAGE_EXT 0x9367
#endif /* GL_EXT_texture_filter_minmax */
#ifndef GL_EXT_texture_integer
@@ -8277,6 +8555,11 @@ GLAPI void APIENTRY glTextureNormalEXT (GLenum mode);
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
#endif /* GL_EXT_texture_sRGB */
+#ifndef GL_EXT_texture_sRGB_R8
+#define GL_EXT_texture_sRGB_R8 1
+#define GL_SR8_EXT 0x8FBD
+#endif /* GL_EXT_texture_sRGB_R8 */
+
#ifndef GL_EXT_texture_sRGB_decode
#define GL_EXT_texture_sRGB_decode 1
#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
@@ -8689,6 +8972,16 @@ GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei s
#endif
#endif /* GL_EXT_vertex_weighting */
+#ifndef GL_EXT_win32_keyed_mutex
+#define GL_EXT_win32_keyed_mutex 1
+typedef GLboolean (APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout);
+typedef GLboolean (APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLboolean APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout);
+GLAPI GLboolean APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key);
+#endif
+#endif /* GL_EXT_win32_keyed_mutex */
+
#ifndef GL_EXT_window_rectangles
#define GL_EXT_window_rectangles 1
#define GL_INCLUSIVE_EXT 0x8F10
@@ -8880,6 +9173,11 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG
#define GL_INTERLACE_READ_INGR 0x8568
#endif /* GL_INGR_interlace_read */
+#ifndef GL_INTEL_blackhole_render
+#define GL_INTEL_blackhole_render 1
+#define GL_BLACKHOLE_RENDER_INTEL 0x83FC
+#endif /* GL_INTEL_blackhole_render */
+
#ifndef GL_INTEL_conservative_rasterization
#define GL_INTEL_conservative_rasterization 1
#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
@@ -8961,7 +9259,7 @@ typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
#ifdef GL_GLEXT_PROTOTYPES
@@ -8972,7 +9270,7 @@ GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
#endif
@@ -8993,6 +9291,11 @@ GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLen
#define GL_PACK_INVERT_MESA 0x8758
#endif /* GL_MESA_pack_invert */
+#ifndef GL_MESA_program_binary_formats
+#define GL_MESA_program_binary_formats 1
+#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F
+#endif /* GL_MESA_program_binary_formats */
+
#ifndef GL_MESA_resize_buffers
#define GL_MESA_resize_buffers 1
typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void);
@@ -9005,6 +9308,13 @@ GLAPI void APIENTRY glResizeBuffersMESA (void);
#define GL_MESA_shader_integer_functions 1
#endif /* GL_MESA_shader_integer_functions */
+#ifndef GL_MESA_tile_raster_order
+#define GL_MESA_tile_raster_order 1
+#define GL_TILE_RASTER_ORDER_FIXED_MESA 0x8BB8
+#define GL_TILE_RASTER_ORDER_INCREASING_X_MESA 0x8BB9
+#define GL_TILE_RASTER_ORDER_INCREASING_Y_MESA 0x8BBA
+#endif /* GL_MESA_tile_raster_order */
+
#ifndef GL_MESA_window_pos
#define GL_MESA_window_pos 1
typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
@@ -9231,6 +9541,10 @@ GLAPI void APIENTRY glBlendBarrierNV (void);
#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
#endif /* GL_NV_blend_equation_advanced_coherent */
+#ifndef GL_NV_blend_minmax_factor
+#define GL_NV_blend_minmax_factor 1
+#endif /* GL_NV_blend_minmax_factor */
+
#ifndef GL_NV_blend_square
#define GL_NV_blend_square 1
#endif /* GL_NV_blend_square */
@@ -9311,6 +9625,10 @@ GLAPI void APIENTRY glCallCommandListNV (GLuint list);
#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC
#endif /* GL_NV_compute_program5 */
+#ifndef GL_NV_compute_shader_derivatives
+#define GL_NV_compute_shader_derivatives 1
+#endif /* GL_NV_compute_shader_derivatives */
+
#ifndef GL_NV_conditional_render
#define GL_NV_conditional_render 1
#define GL_QUERY_WAIT_NV 0x8E13
@@ -9348,6 +9666,11 @@ GLAPI void APIENTRY glConservativeRasterParameterfNV (GLenum pname, GLfloat valu
#endif
#endif /* GL_NV_conservative_raster_dilate */
+#ifndef GL_NV_conservative_raster_pre_snap
+#define GL_NV_conservative_raster_pre_snap 1
+#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550
+#endif /* GL_NV_conservative_raster_pre_snap */
+
#ifndef GL_NV_conservative_raster_pre_snap_triangles
#define GL_NV_conservative_raster_pre_snap_triangles 1
#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D
@@ -9359,6 +9682,10 @@ GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param)
#endif
#endif /* GL_NV_conservative_raster_pre_snap_triangles */
+#ifndef GL_NV_conservative_raster_underestimation
+#define GL_NV_conservative_raster_underestimation 1
+#endif /* GL_NV_conservative_raster_underestimation */
+
#ifndef GL_NV_copy_depth_to_color
#define GL_NV_copy_depth_to_color 1
#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
@@ -9600,6 +9927,10 @@ GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, cons
#define GL_NV_fragment_program_option 1
#endif /* GL_NV_fragment_program_option */
+#ifndef GL_NV_fragment_shader_barycentric
+#define GL_NV_fragment_shader_barycentric 1
+#endif /* GL_NV_fragment_shader_barycentric */
+
#ifndef GL_NV_fragment_shader_interlock
#define GL_NV_fragment_shader_interlock 1
#endif /* GL_NV_fragment_shader_interlock */
@@ -9667,7 +9998,7 @@ GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachmen
#define GL_PER_GPU_STORAGE_NV 0x9548
#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549
typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask);
-typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
@@ -9680,7 +10011,7 @@ typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLu
typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask);
-GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
@@ -9884,6 +10215,96 @@ GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum interna
#define GL_MAX_SPOT_EXPONENT_NV 0x8505
#endif /* GL_NV_light_max_exponent */
+#ifndef GL_NV_memory_attachment
+#define GL_NV_memory_attachment 1
+#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4
+#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5
+#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6
+#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7
+#define GL_MEMORY_ATTACHABLE_NV 0x95A8
+#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9
+#define GL_DETACHED_TEXTURES_NV 0x95AA
+#define GL_DETACHED_BUFFERS_NV 0x95AB
+#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC
+#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD
+typedef void (APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
+typedef void (APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname);
+typedef void (APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset);
+typedef void (APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params);
+GLAPI void APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname);
+GLAPI void APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset);
+GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset);
+#endif
+#endif /* GL_NV_memory_attachment */
+
+#ifndef GL_NV_mesh_shader
+#define GL_NV_mesh_shader 1
+#define GL_MESH_SHADER_NV 0x9559
+#define GL_TASK_SHADER_NV 0x955A
+#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60
+#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61
+#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62
+#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63
+#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64
+#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65
+#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66
+#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67
+#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68
+#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69
+#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A
+#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B
+#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C
+#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D
+#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E
+#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F
+#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2
+#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3
+#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536
+#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537
+#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538
+#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539
+#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A
+#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D
+#define GL_MAX_MESH_VIEWS_NV 0x9557
+#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF
+#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543
+#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B
+#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C
+#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E
+#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F
+#define GL_MESH_VERTICES_OUT_NV 0x9579
+#define GL_MESH_PRIMITIVES_OUT_NV 0x957A
+#define GL_MESH_OUTPUT_TYPE_NV 0x957B
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E
+#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F
+#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0
+#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1
+#define GL_MESH_SUBROUTINE_NV 0x957C
+#define GL_TASK_SUBROUTINE_NV 0x957D
+#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E
+#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F
+#define GL_MESH_SHADER_BIT_NV 0x00000040
+#define GL_TASK_SHADER_BIT_NV 0x00000080
+typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count);
+typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect);
+typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride);
+typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count);
+GLAPI void APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect);
+GLAPI void APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride);
+GLAPI void APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+#endif
+#endif /* GL_NV_mesh_shader */
+
#ifndef GL_NV_multisample_coverage
#define GL_NV_multisample_coverage 1
#endif /* GL_NV_multisample_coverage */
@@ -10311,6 +10732,32 @@ GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index);
#endif
#endif /* GL_NV_primitive_restart */
+#ifndef GL_NV_query_resource
+#define GL_NV_query_resource 1
+#define GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV 0x9540
+#define GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV 0x9542
+#define GL_QUERY_RESOURCE_SYS_RESERVED_NV 0x9544
+#define GL_QUERY_RESOURCE_TEXTURE_NV 0x9545
+#define GL_QUERY_RESOURCE_RENDERBUFFER_NV 0x9546
+#define GL_QUERY_RESOURCE_BUFFEROBJECT_NV 0x9547
+typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint bufSize, GLint *buffer);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint bufSize, GLint *buffer);
+#endif
+#endif /* GL_NV_query_resource */
+
+#ifndef GL_NV_query_resource_tag
+#define GL_NV_query_resource_tag 1
+typedef void (APIENTRYP PFNGLGENQUERYRESOURCETAGNVPROC) (GLsizei n, GLint *tagIds);
+typedef void (APIENTRYP PFNGLDELETEQUERYRESOURCETAGNVPROC) (GLsizei n, const GLint *tagIds);
+typedef void (APIENTRYP PFNGLQUERYRESOURCETAGNVPROC) (GLint tagId, const GLchar *tagString);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGenQueryResourceTagNV (GLsizei n, GLint *tagIds);
+GLAPI void APIENTRY glDeleteQueryResourceTagNV (GLsizei n, const GLint *tagIds);
+GLAPI void APIENTRY glQueryResourceTagNV (GLint tagId, const GLchar *tagString);
+#endif
+#endif /* GL_NV_query_resource_tag */
+
#ifndef GL_NV_register_combiners
#define GL_NV_register_combiners 1
#define GL_REGISTER_COMBINERS_NV 0x8522
@@ -10403,6 +10850,11 @@ GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname,
#endif
#endif /* GL_NV_register_combiners2 */
+#ifndef GL_NV_representative_fragment_test
+#define GL_NV_representative_fragment_test 1
+#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F
+#endif /* GL_NV_representative_fragment_test */
+
#ifndef GL_NV_robustness_video_memory_purge
#define GL_NV_robustness_video_memory_purge 1
#define GL_PURGED_CONTEXT_RESET_NV 0x92BB
@@ -10432,6 +10884,18 @@ GLAPI void APIENTRY glResolveDepthValuesNV (void);
#define GL_NV_sample_mask_override_coverage 1
#endif /* GL_NV_sample_mask_override_coverage */
+#ifndef GL_NV_scissor_exclusive
+#define GL_NV_scissor_exclusive 1
+#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555
+#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556
+typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height);
+GLAPI void APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v);
+#endif
+#endif /* GL_NV_scissor_exclusive */
+
#ifndef GL_NV_shader_atomic_counters
#define GL_NV_shader_atomic_counters 1
#endif /* GL_NV_shader_atomic_counters */
@@ -10496,6 +10960,10 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_storage_buffer_object 1
#endif /* GL_NV_shader_storage_buffer_object */
+#ifndef GL_NV_shader_texture_footprint
+#define GL_NV_shader_texture_footprint 1
+#endif /* GL_NV_shader_texture_footprint */
+
#ifndef GL_NV_shader_thread_group
#define GL_NV_shader_thread_group 1
#define GL_WARP_SIZE_NV 0x9339
@@ -10507,6 +10975,47 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_thread_shuffle 1
#endif /* GL_NV_shader_thread_shuffle */
+#ifndef GL_NV_shading_rate_image
+#define GL_NV_shading_rate_image 1
+#define GL_SHADING_RATE_IMAGE_NV 0x9563
+#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564
+#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565
+#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566
+#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567
+#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568
+#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569
+#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A
+#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B
+#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C
+#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D
+#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E
+#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F
+#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B
+#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C
+#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D
+#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E
+#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F
+#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE
+#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF
+#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0
+typedef void (APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture);
+typedef void (APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate);
+typedef void (APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location);
+typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize);
+typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
+typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order);
+typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glBindShadingRateImageNV (GLuint texture);
+GLAPI void APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate);
+GLAPI void APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location);
+GLAPI void APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize);
+GLAPI void APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates);
+GLAPI void APIENTRY glShadingRateSampleOrderNV (GLenum order);
+GLAPI void APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations);
+#endif
+#endif /* GL_NV_shading_rate_image */
+
#ifndef GL_NV_stereo_view_rendering
#define GL_NV_stereo_view_rendering 1
#endif /* GL_NV_stereo_view_rendering */
@@ -10587,6 +11096,10 @@ GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenu
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
#endif /* GL_NV_texture_rectangle */
+#ifndef GL_NV_texture_rectangle_compressed
+#define GL_NV_texture_rectangle_compressed 1
+#endif /* GL_NV_texture_rectangle_compressed */
+
#ifndef GL_NV_texture_shader
#define GL_NV_texture_shader 1
#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
@@ -10813,6 +11326,14 @@ GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSur
#endif
#endif /* GL_NV_vdpau_interop */
+#ifndef GL_NV_vdpau_interop2
+#define GL_NV_vdpau_interop2 1
+typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure);
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure);
+#endif
+#endif /* GL_NV_vdpau_interop2 */
+
#ifndef GL_NV_vertex_array_range
#define GL_NV_vertex_array_range 1
#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h
index af8ee8201d..137f1e831f 100644
--- a/src/gui/opengl/qopenglextensions_p.h
+++ b/src/gui/opengl/qopenglextensions_p.h
@@ -107,7 +107,7 @@ public:
QOpenGLExtensionsPrivate *d() const;
private:
- static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; }
+ static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != nullptr; }
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLExtensions::OpenGLExtensions)
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp
index e7631b09ce..5d30891565 100644
--- a/src/gui/opengl/qopenglframebufferobject.cpp
+++ b/src/gui/opengl/qopenglframebufferobject.cpp
@@ -183,7 +183,7 @@ QT_BEGIN_NAMESPACE
*/
void QOpenGLFramebufferObjectFormat::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QOpenGLFramebufferObjectFormatPrivate *newd
= new QOpenGLFramebufferObjectFormatPrivate(d);
if (!d->ref.deref())
diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/gui/opengl/qopenglframebufferobject_p.h
index 778a38b823..644bb6c59b 100644
--- a/src/gui/opengl/qopenglframebufferobject_p.h
+++ b/src/gui/opengl/qopenglframebufferobject_p.h
@@ -109,8 +109,8 @@ public:
class QOpenGLFramebufferObjectPrivate
{
public:
- QOpenGLFramebufferObjectPrivate() : fbo_guard(0), depth_buffer_guard(0)
- , stencil_buffer_guard(0)
+ QOpenGLFramebufferObjectPrivate() : fbo_guard(nullptr), depth_buffer_guard(nullptr)
+ , stencil_buffer_guard(nullptr)
, valid(false) {}
~QOpenGLFramebufferObjectPrivate() {}
@@ -135,9 +135,9 @@ public:
QOpenGLExtensions funcs;
struct ColorAttachment {
- ColorAttachment() : internalFormat(0), guard(0) { }
+ ColorAttachment() : internalFormat(0), guard(nullptr) { }
ColorAttachment(const QSize &size, GLenum internalFormat)
- : size(size), internalFormat(internalFormat), guard(0) { }
+ : size(size), internalFormat(internalFormat), guard(nullptr) { }
QSize size;
GLenum internalFormat;
QOpenGLSharedResourceGuard *guard;
diff --git a/src/gui/opengl/qopenglfunctions_1_0.cpp b/src/gui/opengl/qopenglfunctions_1_0.cpp
index 4235c9a339..f017c68fd9 100644
--- a/src/gui/opengl/qopenglfunctions_1_0.cpp
+++ b/src/gui/opengl/qopenglfunctions_1_0.cpp
@@ -76,11 +76,11 @@ QOpenGLFunctions_1_0::~QOpenGLFunctions_1_0()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_1_1.cpp b/src/gui/opengl/qopenglfunctions_1_1.cpp
index 7d09bb40c1..a819d499f8 100644
--- a/src/gui/opengl/qopenglfunctions_1_1.cpp
+++ b/src/gui/opengl/qopenglfunctions_1_1.cpp
@@ -78,19 +78,19 @@ QOpenGLFunctions_1_1::~QOpenGLFunctions_1_1()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_1_2.cpp b/src/gui/opengl/qopenglfunctions_1_2.cpp
index 94a9d64660..61db2b4e0f 100644
--- a/src/gui/opengl/qopenglfunctions_1_2.cpp
+++ b/src/gui/opengl/qopenglfunctions_1_2.cpp
@@ -80,27 +80,27 @@ QOpenGLFunctions_1_2::~QOpenGLFunctions_1_2()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_1_3.cpp b/src/gui/opengl/qopenglfunctions_1_3.cpp
index 972ef9ff70..acc223ea74 100644
--- a/src/gui/opengl/qopenglfunctions_1_3.cpp
+++ b/src/gui/opengl/qopenglfunctions_1_3.cpp
@@ -82,35 +82,35 @@ QOpenGLFunctions_1_3::~QOpenGLFunctions_1_3()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_1_4.cpp b/src/gui/opengl/qopenglfunctions_1_4.cpp
index 4b78253301..8e2349dc08 100644
--- a/src/gui/opengl/qopenglfunctions_1_4.cpp
+++ b/src/gui/opengl/qopenglfunctions_1_4.cpp
@@ -84,43 +84,43 @@ QOpenGLFunctions_1_4::~QOpenGLFunctions_1_4()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_1_5.cpp b/src/gui/opengl/qopenglfunctions_1_5.cpp
index 2a0820d0cb..cd81cf8b35 100644
--- a/src/gui/opengl/qopenglfunctions_1_5.cpp
+++ b/src/gui/opengl/qopenglfunctions_1_5.cpp
@@ -85,47 +85,47 @@ QOpenGLFunctions_1_5::~QOpenGLFunctions_1_5()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_2_0.cpp b/src/gui/opengl/qopenglfunctions_2_0.cpp
index 212723aa00..97a8c72fa6 100644
--- a/src/gui/opengl/qopenglfunctions_2_0.cpp
+++ b/src/gui/opengl/qopenglfunctions_2_0.cpp
@@ -87,51 +87,51 @@ QOpenGLFunctions_2_0::~QOpenGLFunctions_2_0()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_2_1.cpp b/src/gui/opengl/qopenglfunctions_2_1.cpp
index b8b255014c..00bdc1bbba 100644
--- a/src/gui/opengl/qopenglfunctions_2_1.cpp
+++ b/src/gui/opengl/qopenglfunctions_2_1.cpp
@@ -88,55 +88,55 @@ QOpenGLFunctions_2_1::~QOpenGLFunctions_2_1()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_3_0.cpp b/src/gui/opengl/qopenglfunctions_3_0.cpp
index 4972c03b1e..2c239dba1f 100644
--- a/src/gui/opengl/qopenglfunctions_3_0.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_0.cpp
@@ -90,59 +90,59 @@ QOpenGLFunctions_3_0::~QOpenGLFunctions_3_0()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_3_1.cpp b/src/gui/opengl/qopenglfunctions_3_1.cpp
index 9328f5ca89..f62f555c8e 100644
--- a/src/gui/opengl/qopenglfunctions_3_1.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_1.cpp
@@ -84,43 +84,43 @@ QOpenGLFunctions_3_1::~QOpenGLFunctions_3_1()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp b/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
index 709f65edf8..ba7be2d893 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_2_compatibility.cpp
@@ -92,67 +92,67 @@ QOpenGLFunctions_3_2_Compatibility::~QOpenGLFunctions_3_2_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_3_2_core.cpp b/src/gui/opengl/qopenglfunctions_3_2_core.cpp
index 02c0c78b01..4c1e3eb3da 100644
--- a/src/gui/opengl/qopenglfunctions_3_2_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_2_core.cpp
@@ -85,47 +85,47 @@ QOpenGLFunctions_3_2_Core::~QOpenGLFunctions_3_2_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp b/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
index b034391c86..c750c6e0cc 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp
@@ -93,75 +93,75 @@ QOpenGLFunctions_3_3_Compatibility::~QOpenGLFunctions_3_3_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_3_3_core.cpp b/src/gui/opengl/qopenglfunctions_3_3_core.cpp
index 7779d92b6a..5723509e32 100644
--- a/src/gui/opengl/qopenglfunctions_3_3_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_3_3_core.cpp
@@ -86,51 +86,51 @@ QOpenGLFunctions_3_3_Core::~QOpenGLFunctions_3_3_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
index 4fe4526efc..6ae7643eb5 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_0_compatibility.cpp
@@ -94,79 +94,79 @@ QOpenGLFunctions_4_0_Compatibility::~QOpenGLFunctions_4_0_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_0_core.cpp b/src/gui/opengl/qopenglfunctions_4_0_core.cpp
index 4e4e8cc547..cd4fdb8b2b 100644
--- a/src/gui/opengl/qopenglfunctions_4_0_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_0_core.cpp
@@ -87,55 +87,55 @@ QOpenGLFunctions_4_0_Core::~QOpenGLFunctions_4_0_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
index 41ecb4672a..d104c74bc2 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_1_compatibility.cpp
@@ -95,83 +95,83 @@ QOpenGLFunctions_4_1_Compatibility::~QOpenGLFunctions_4_1_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_1_core.cpp b/src/gui/opengl/qopenglfunctions_4_1_core.cpp
index 5a1e1eb42f..7527aba620 100644
--- a/src/gui/opengl/qopenglfunctions_4_1_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_1_core.cpp
@@ -88,59 +88,59 @@ QOpenGLFunctions_4_1_Core::~QOpenGLFunctions_4_1_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
index fcc049c67b..a5b1b37495 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_2_compatibility.cpp
@@ -96,87 +96,87 @@ QOpenGLFunctions_4_2_Compatibility::~QOpenGLFunctions_4_2_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_2_core.cpp b/src/gui/opengl/qopenglfunctions_4_2_core.cpp
index fdfb4db455..1381236926 100644
--- a/src/gui/opengl/qopenglfunctions_4_2_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_2_core.cpp
@@ -89,63 +89,63 @@ QOpenGLFunctions_4_2_Core::~QOpenGLFunctions_4_2_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
index 131ebc810f..5c0c711d1c 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_3_compatibility.cpp
@@ -97,91 +97,91 @@ QOpenGLFunctions_4_3_Compatibility::~QOpenGLFunctions_4_3_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_4_3_Core) {
d_4_3_Core->refs.deref();
- Q_ASSERT(d_4_3_Core->refs.load());
+ Q_ASSERT(d_4_3_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_3_core.cpp b/src/gui/opengl/qopenglfunctions_4_3_core.cpp
index 95e2d7bc43..34460b841e 100644
--- a/src/gui/opengl/qopenglfunctions_4_3_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_3_core.cpp
@@ -90,67 +90,67 @@ QOpenGLFunctions_4_3_Core::~QOpenGLFunctions_4_3_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_4_3_Core) {
d_4_3_Core->refs.deref();
- Q_ASSERT(d_4_3_Core->refs.load());
+ Q_ASSERT(d_4_3_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp
index 5c7170b8fa..907994a3c4 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_4_compatibility.cpp
@@ -97,95 +97,95 @@ QOpenGLFunctions_4_4_Compatibility::~QOpenGLFunctions_4_4_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_4_3_Core) {
d_4_3_Core->refs.deref();
- Q_ASSERT(d_4_3_Core->refs.load());
+ Q_ASSERT(d_4_3_Core->refs.loadRelaxed());
}
if (d_4_4_Core) {
d_4_4_Core->refs.deref();
- Q_ASSERT(d_4_4_Core->refs.load());
+ Q_ASSERT(d_4_4_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_4_core.cpp b/src/gui/opengl/qopenglfunctions_4_4_core.cpp
index 54833f9058..76c0323f6d 100644
--- a/src/gui/opengl/qopenglfunctions_4_4_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_4_core.cpp
@@ -91,71 +91,71 @@ QOpenGLFunctions_4_4_Core::~QOpenGLFunctions_4_4_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_4_3_Core) {
d_4_3_Core->refs.deref();
- Q_ASSERT(d_4_3_Core->refs.load());
+ Q_ASSERT(d_4_3_Core->refs.loadRelaxed());
}
if (d_4_4_Core) {
d_4_4_Core->refs.deref();
- Q_ASSERT(d_4_4_Core->refs.load());
+ Q_ASSERT(d_4_4_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp b/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp
index f9d2bb9ceb..c415bb06ff 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp
@@ -99,103 +99,103 @@ QOpenGLFunctions_4_5_Compatibility::~QOpenGLFunctions_4_5_Compatibility()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_4_3_Core) {
d_4_3_Core->refs.deref();
- Q_ASSERT(d_4_3_Core->refs.load());
+ Q_ASSERT(d_4_3_Core->refs.loadRelaxed());
}
if (d_4_4_Core) {
d_4_4_Core->refs.deref();
- Q_ASSERT(d_4_4_Core->refs.load());
+ Q_ASSERT(d_4_4_Core->refs.loadRelaxed());
}
if (d_4_5_Core) {
d_4_5_Core->refs.deref();
- Q_ASSERT(d_4_5_Core->refs.load());
+ Q_ASSERT(d_4_5_Core->refs.loadRelaxed());
}
if (d_1_0_Deprecated) {
d_1_0_Deprecated->refs.deref();
- Q_ASSERT(d_1_0_Deprecated->refs.load());
+ Q_ASSERT(d_1_0_Deprecated->refs.loadRelaxed());
}
if (d_1_1_Deprecated) {
d_1_1_Deprecated->refs.deref();
- Q_ASSERT(d_1_1_Deprecated->refs.load());
+ Q_ASSERT(d_1_1_Deprecated->refs.loadRelaxed());
}
if (d_1_2_Deprecated) {
d_1_2_Deprecated->refs.deref();
- Q_ASSERT(d_1_2_Deprecated->refs.load());
+ Q_ASSERT(d_1_2_Deprecated->refs.loadRelaxed());
}
if (d_1_3_Deprecated) {
d_1_3_Deprecated->refs.deref();
- Q_ASSERT(d_1_3_Deprecated->refs.load());
+ Q_ASSERT(d_1_3_Deprecated->refs.loadRelaxed());
}
if (d_1_4_Deprecated) {
d_1_4_Deprecated->refs.deref();
- Q_ASSERT(d_1_4_Deprecated->refs.load());
+ Q_ASSERT(d_1_4_Deprecated->refs.loadRelaxed());
}
if (d_3_3_Deprecated) {
d_3_3_Deprecated->refs.deref();
- Q_ASSERT(d_3_3_Deprecated->refs.load());
+ Q_ASSERT(d_3_3_Deprecated->refs.loadRelaxed());
}
if (d_4_5_Deprecated) {
d_4_5_Deprecated->refs.deref();
- Q_ASSERT(d_4_5_Deprecated->refs.load());
+ Q_ASSERT(d_4_5_Deprecated->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglfunctions_4_5_core.cpp b/src/gui/opengl/qopenglfunctions_4_5_core.cpp
index a47ebb9ee9..4dfac3579c 100644
--- a/src/gui/opengl/qopenglfunctions_4_5_core.cpp
+++ b/src/gui/opengl/qopenglfunctions_4_5_core.cpp
@@ -92,75 +92,75 @@ QOpenGLFunctions_4_5_Core::~QOpenGLFunctions_4_5_Core()
{
if (d_1_0_Core) {
d_1_0_Core->refs.deref();
- Q_ASSERT(d_1_0_Core->refs.load());
+ Q_ASSERT(d_1_0_Core->refs.loadRelaxed());
}
if (d_1_1_Core) {
d_1_1_Core->refs.deref();
- Q_ASSERT(d_1_1_Core->refs.load());
+ Q_ASSERT(d_1_1_Core->refs.loadRelaxed());
}
if (d_1_2_Core) {
d_1_2_Core->refs.deref();
- Q_ASSERT(d_1_2_Core->refs.load());
+ Q_ASSERT(d_1_2_Core->refs.loadRelaxed());
}
if (d_1_3_Core) {
d_1_3_Core->refs.deref();
- Q_ASSERT(d_1_3_Core->refs.load());
+ Q_ASSERT(d_1_3_Core->refs.loadRelaxed());
}
if (d_1_4_Core) {
d_1_4_Core->refs.deref();
- Q_ASSERT(d_1_4_Core->refs.load());
+ Q_ASSERT(d_1_4_Core->refs.loadRelaxed());
}
if (d_1_5_Core) {
d_1_5_Core->refs.deref();
- Q_ASSERT(d_1_5_Core->refs.load());
+ Q_ASSERT(d_1_5_Core->refs.loadRelaxed());
}
if (d_2_0_Core) {
d_2_0_Core->refs.deref();
- Q_ASSERT(d_2_0_Core->refs.load());
+ Q_ASSERT(d_2_0_Core->refs.loadRelaxed());
}
if (d_2_1_Core) {
d_2_1_Core->refs.deref();
- Q_ASSERT(d_2_1_Core->refs.load());
+ Q_ASSERT(d_2_1_Core->refs.loadRelaxed());
}
if (d_3_0_Core) {
d_3_0_Core->refs.deref();
- Q_ASSERT(d_3_0_Core->refs.load());
+ Q_ASSERT(d_3_0_Core->refs.loadRelaxed());
}
if (d_3_1_Core) {
d_3_1_Core->refs.deref();
- Q_ASSERT(d_3_1_Core->refs.load());
+ Q_ASSERT(d_3_1_Core->refs.loadRelaxed());
}
if (d_3_2_Core) {
d_3_2_Core->refs.deref();
- Q_ASSERT(d_3_2_Core->refs.load());
+ Q_ASSERT(d_3_2_Core->refs.loadRelaxed());
}
if (d_3_3_Core) {
d_3_3_Core->refs.deref();
- Q_ASSERT(d_3_3_Core->refs.load());
+ Q_ASSERT(d_3_3_Core->refs.loadRelaxed());
}
if (d_4_0_Core) {
d_4_0_Core->refs.deref();
- Q_ASSERT(d_4_0_Core->refs.load());
+ Q_ASSERT(d_4_0_Core->refs.loadRelaxed());
}
if (d_4_1_Core) {
d_4_1_Core->refs.deref();
- Q_ASSERT(d_4_1_Core->refs.load());
+ Q_ASSERT(d_4_1_Core->refs.loadRelaxed());
}
if (d_4_2_Core) {
d_4_2_Core->refs.deref();
- Q_ASSERT(d_4_2_Core->refs.load());
+ Q_ASSERT(d_4_2_Core->refs.loadRelaxed());
}
if (d_4_3_Core) {
d_4_3_Core->refs.deref();
- Q_ASSERT(d_4_3_Core->refs.load());
+ Q_ASSERT(d_4_3_Core->refs.loadRelaxed());
}
if (d_4_4_Core) {
d_4_4_Core->refs.deref();
- Q_ASSERT(d_4_4_Core->refs.load());
+ Q_ASSERT(d_4_4_Core->refs.loadRelaxed());
}
if (d_4_5_Core) {
d_4_5_Core->refs.deref();
- Q_ASSERT(d_4_5_Core->refs.load());
+ Q_ASSERT(d_4_5_Core->refs.loadRelaxed());
}
}
diff --git a/src/gui/opengl/qopenglgradientcache_p.h b/src/gui/opengl/qopenglgradientcache_p.h
index cbdbbb0c54..1d34223bdd 100644
--- a/src/gui/opengl/qopenglgradientcache_p.h
+++ b/src/gui/opengl/qopenglgradientcache_p.h
@@ -66,7 +66,7 @@ class QOpenGL2GradientCache : public QOpenGLSharedResource
struct CacheInfo
{
inline CacheInfo(QGradientStops s, qreal op, QGradient::InterpolationMode mode) :
- stops(qMove(s)), opacity(op), interpolationMode(mode) {}
+ stops(std::move(s)), opacity(op), interpolationMode(mode) {}
GLuint texId;
QGradientStops stops;
diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp
index 042b9ebd79..47394999c6 100644
--- a/src/gui/opengl/qopenglpaintengine.cpp
+++ b/src/gui/opengl/qopenglpaintengine.cpp
@@ -1474,11 +1474,17 @@ void QOpenGL2PaintEngineEx::renderHintsChanged()
#ifndef QT_OPENGL_ES_2
if (!QOpenGLContext::currentContext()->isOpenGLES()) {
Q_D(QOpenGL2PaintEngineEx);
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
if ((state()->renderHints & QPainter::Antialiasing)
- || (state()->renderHints & QPainter::HighQualityAntialiasing))
+#if QT_DEPRECATED_SINCE(5, 14)
+ || (state()->renderHints & QPainter::HighQualityAntialiasing)
+#endif
+ )
d->funcs.glEnable(GL_MULTISAMPLE);
else
d->funcs.glDisable(GL_MULTISAMPLE);
+QT_WARNING_POP
}
#endif // QT_OPENGL_ES_2
diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h
index 15ac240b89..81f17572b2 100644
--- a/src/gui/opengl/qopenglpaintengine_p.h
+++ b/src/gui/opengl/qopenglpaintengine_p.h
@@ -187,9 +187,9 @@ public:
QOpenGL2PaintEngineExPrivate(QOpenGL2PaintEngineEx *q_ptr) :
q(q_ptr),
- shaderManager(0),
+ shaderManager(nullptr),
width(0), height(0),
- ctx(0),
+ ctx(nullptr),
useSystemClip(true),
elementIndicesVBOId(0),
opacityArray(0),
@@ -361,9 +361,9 @@ void QOpenGL2PaintEngineExPrivate::uploadData(unsigned int arrayIndex, const GLf
opacityBuffer.allocate(data, count * sizeof(float));
}
if (arrayIndex == QT_OPACITY_ATTR)
- funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, 0);
+ funcs.glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, nullptr);
else
- funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, 0);
+ funcs.glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
} else {
// If we already uploaded the data we don't have to do it again
if (data == vertexAttribPointers[arrayIndex])
diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/gui/opengl/qopenglpixeltransferoptions.h
index 2fc52b82d8..195543ae90 100644
--- a/src/gui/opengl/qopenglpixeltransferoptions.h
+++ b/src/gui/opengl/qopenglpixeltransferoptions.h
@@ -55,14 +55,12 @@ class Q_GUI_EXPORT QOpenGLPixelTransferOptions
public:
QOpenGLPixelTransferOptions();
QOpenGLPixelTransferOptions(const QOpenGLPixelTransferOptions &);
-#ifdef Q_COMPILER_RVALUE_REFS
- QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other) Q_DECL_NOTHROW
+ QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other) noexcept
{ swap(other); return *this; }
-#endif
QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
~QOpenGLPixelTransferOptions();
- void swap(QOpenGLPixelTransferOptions &other) Q_DECL_NOTHROW
+ void swap(QOpenGLPixelTransferOptions &other) noexcept
{ data.swap(other.data); }
void setAlignment(int alignment);
diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp
index c3fb375a20..72bdacf43f 100644
--- a/src/gui/opengl/qopenglprogrambinarycache.cpp
+++ b/src/gui/opengl/qopenglprogrambinarycache.cpp
@@ -44,7 +44,9 @@
#include <QStandardPaths>
#include <QDir>
#include <QSaveFile>
+#include <QCoreApplication>
#include <QLoggingCategory>
+#include <QCryptographicHash>
#ifdef Q_OS_UNIX
#include <sys/mman.h>
@@ -53,7 +55,7 @@
QT_BEGIN_NAMESPACE
-Q_DECLARE_LOGGING_CATEGORY(DBG_SHADER_CACHE)
+Q_LOGGING_CATEGORY(lcOpenGLProgramDiskCache, "qt.opengl.diskcache")
#ifndef GL_CONTEXT_LOST
#define GL_CONTEXT_LOST 0x0507
@@ -63,6 +65,10 @@ Q_DECLARE_LOGGING_CATEGORY(DBG_SHADER_CACHE)
#define GL_PROGRAM_BINARY_LENGTH 0x8741
#endif
+#ifndef GL_NUM_PROGRAM_BINARY_FORMATS
+#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
+#endif
+
const quint32 BINSHADER_MAGIC = 0x5174;
const quint32 BINSHADER_VERSION = 0x3;
const quint32 BINSHADER_QTVERSION = QT_VERSION;
@@ -94,6 +100,15 @@ GLEnvInfo::GLEnvInfo()
glversion = QByteArray(version);
}
+QByteArray QOpenGLProgramBinaryCache::ProgramDesc::cacheKey() const
+{
+ QCryptographicHash keyBuilder(QCryptographicHash::Sha1);
+ for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : shaders)
+ keyBuilder.addData(shader.source);
+
+ return keyBuilder.result().toHex();
+}
+
static inline bool qt_ensureWritableDir(const QString &name)
{
QDir::root().mkpath(name);
@@ -113,7 +128,7 @@ QOpenGLProgramBinaryCache::QOpenGLProgramBinaryCache()
m_cacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + subPath;
m_cacheWritable = qt_ensureWritableDir(m_cacheDir);
}
- qCDebug(DBG_SHADER_CACHE, "Cache location '%s' writable = %d", qPrintable(m_cacheDir), m_cacheWritable);
+ qCDebug(lcOpenGLProgramDiskCache, "Cache location '%s' writable = %d", qPrintable(m_cacheDir), m_cacheWritable);
}
QString QOpenGLProgramBinaryCache::cacheFileName(const QByteArray &cacheKey) const
@@ -144,24 +159,24 @@ static inline QByteArray readStr(const uchar **p)
bool QOpenGLProgramBinaryCache::verifyHeader(const QByteArray &buf) const
{
if (buf.size() < BASE_HEADER_SIZE) {
- qCDebug(DBG_SHADER_CACHE, "Cached size too small");
+ qCDebug(lcOpenGLProgramDiskCache, "Cached size too small");
return false;
}
const uchar *p = reinterpret_cast<const uchar *>(buf.constData());
if (readUInt(&p) != BINSHADER_MAGIC) {
- qCDebug(DBG_SHADER_CACHE, "Magic does not match");
+ qCDebug(lcOpenGLProgramDiskCache, "Magic does not match");
return false;
}
if (readUInt(&p) != BINSHADER_VERSION) {
- qCDebug(DBG_SHADER_CACHE, "Version does not match");
+ qCDebug(lcOpenGLProgramDiskCache, "Version does not match");
return false;
}
if (readUInt(&p) != BINSHADER_QTVERSION) {
- qCDebug(DBG_SHADER_CACHE, "Qt version does not match");
+ qCDebug(lcOpenGLProgramDiskCache, "Qt version does not match");
return false;
}
if (readUInt(&p) != sizeof(quintptr)) {
- qCDebug(DBG_SHADER_CACHE, "Architecture does not match");
+ qCDebug(lcOpenGLProgramDiskCache, "Architecture does not match");
return false;
}
return true;
@@ -186,7 +201,7 @@ bool QOpenGLProgramBinaryCache::setProgramBinary(uint programId, uint blobFormat
GLenum err = funcs->glGetError();
if (err != GL_NO_ERROR) {
- qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary failed to load for program %u, size %d, "
"format 0x%x, err = 0x%x",
programId, blobSize, blobFormat, err);
return false;
@@ -194,13 +209,13 @@ bool QOpenGLProgramBinaryCache::setProgramBinary(uint programId, uint blobFormat
GLint linkStatus = 0;
funcs->glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus);
if (linkStatus != GL_TRUE) {
- qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary failed to load for program %u, size %d, "
"format 0x%x, linkStatus = 0x%x, err = 0x%x",
programId, blobSize, blobFormat, linkStatus, err);
return false;
}
- qCDebug(DBG_SHADER_CACHE, "Program binary set for program %u, size %d, format 0x%x, err = 0x%x",
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary set for program %u, size %d, format 0x%x, err = 0x%x",
programId, blobSize, blobFormat, err);
return true;
}
@@ -308,19 +323,19 @@ bool QOpenGLProgramBinaryCache::load(const QByteArray &cacheKey, uint programId)
if (vendor != info.glvendor) {
// readStr returns non-null terminated strings just pointing to inside
// 'p' so must print these via the stream qCDebug and not constData().
- qCDebug(DBG_SHADER_CACHE) << "GL_VENDOR does not match" << vendor << info.glvendor;
+ qCDebug(lcOpenGLProgramDiskCache) << "GL_VENDOR does not match" << vendor << info.glvendor;
undertaker.setActive();
return false;
}
QByteArray renderer = readStr(&p);
if (renderer != info.glrenderer) {
- qCDebug(DBG_SHADER_CACHE) << "GL_RENDERER does not match" << renderer << info.glrenderer;
+ qCDebug(lcOpenGLProgramDiskCache) << "GL_RENDERER does not match" << renderer << info.glrenderer;
undertaker.setActive();
return false;
}
QByteArray version = readStr(&p);
if (version != info.glversion) {
- qCDebug(DBG_SHADER_CACHE) << "GL_VERSION does not match" << version << info.glversion;
+ qCDebug(lcOpenGLProgramDiskCache) << "GL_VERSION does not match" << version << info.glversion;
undertaker.setActive();
return false;
}
@@ -373,7 +388,7 @@ void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId)
const int totalSize = headerSize + paddingSize + blobSize;
- qCDebug(DBG_SHADER_CACHE, "Program binary is %d bytes, err = 0x%x, total %d", blobSize, funcs->glGetError(), totalSize);
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary is %d bytes, err = 0x%x, total %d", blobSize, funcs->glGetError(), totalSize);
if (!blobSize)
return;
@@ -407,19 +422,25 @@ void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId)
#endif
funcs->glGetProgramBinary(programId, blobSize, &outSize, &blobFormat, p);
if (blobSize != outSize) {
- qCDebug(DBG_SHADER_CACHE, "glGetProgramBinary returned size %d instead of %d", outSize, blobSize);
+ qCDebug(lcOpenGLProgramDiskCache, "glGetProgramBinary returned size %d instead of %d", outSize, blobSize);
return;
}
writeUInt(&blobFormatPtr, blobFormat);
+#if QT_CONFIG(temporaryfile)
QSaveFile f(cacheFileName(cacheKey));
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
f.write(blob);
if (!f.commit())
- qCDebug(DBG_SHADER_CACHE, "Failed to write %s to shader cache", qPrintable(f.fileName()));
+#else
+ QFile f(cacheFileName(cacheKey));
+ if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ if (f.write(blob) < blob.length())
+#endif
+ qCDebug(lcOpenGLProgramDiskCache, "Failed to write %s to shader cache", qPrintable(f.fileName()));
} else {
- qCDebug(DBG_SHADER_CACHE, "Failed to create %s in shader cache", qPrintable(f.fileName()));
+ qCDebug(lcOpenGLProgramDiskCache, "Failed to create %s in shader cache", qPrintable(f.fileName()));
}
}
@@ -436,4 +457,45 @@ void QOpenGLProgramBinaryCache::initializeProgramBinaryOES(QOpenGLContext *conte
}
#endif
+QOpenGLProgramBinarySupportCheck::QOpenGLProgramBinarySupportCheck(QOpenGLContext *context)
+ : QOpenGLSharedResource(context->shareGroup()),
+ m_supported(false)
+{
+ if (QCoreApplication::testAttribute(Qt::AA_DisableShaderDiskCache)) {
+ qCDebug(lcOpenGLProgramDiskCache, "Shader cache disabled via app attribute");
+ return;
+ }
+ if (qEnvironmentVariableIntValue("QT_DISABLE_SHADER_DISK_CACHE")) {
+ qCDebug(lcOpenGLProgramDiskCache, "Shader cache disabled via env var");
+ return;
+ }
+
+ QOpenGLContext *ctx = QOpenGLContext::currentContext();
+ if (ctx) {
+ if (ctx->isOpenGLES()) {
+ qCDebug(lcOpenGLProgramDiskCache, "OpenGL ES v%d context", ctx->format().majorVersion());
+ if (ctx->format().majorVersion() >= 3) {
+ m_supported = true;
+ } else {
+ const bool hasExt = ctx->hasExtension("GL_OES_get_program_binary");
+ qCDebug(lcOpenGLProgramDiskCache, "GL_OES_get_program_binary support = %d", hasExt);
+ if (hasExt)
+ m_supported = true;
+ }
+ } else {
+ const bool hasExt = ctx->hasExtension("GL_ARB_get_program_binary");
+ qCDebug(lcOpenGLProgramDiskCache, "GL_ARB_get_program_binary support = %d", hasExt);
+ if (hasExt)
+ m_supported = true;
+ }
+ if (m_supported) {
+ GLint fmtCount = 0;
+ ctx->functions()->glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &fmtCount);
+ qCDebug(lcOpenGLProgramDiskCache, "Supported binary format count = %d", fmtCount);
+ m_supported = fmtCount > 0;
+ }
+ }
+ qCDebug(lcOpenGLProgramDiskCache, "Shader cache supported = %d", m_supported);
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/opengl/qopenglprogrambinarycache_p.h b/src/gui/opengl/qopenglprogrambinarycache_p.h
index e181a6ab81..f1cf24cd87 100644
--- a/src/gui/opengl/qopenglprogrambinarycache_p.h
+++ b/src/gui/opengl/qopenglprogrambinarycache_p.h
@@ -52,25 +52,31 @@
//
#include <QtGui/qtguiglobal.h>
-#include <QtGui/qopenglshaderprogram.h>
#include <QtCore/qcache.h>
#include <QtCore/qmutex.h>
+#include <QtGui/private/qopenglcontext_p.h>
+#include <QtGui/private/qshader_p.h>
QT_BEGIN_NAMESPACE
+// These classes are also used by the OpenGL backend of QRhi. They must
+// therefore stay independent from QOpenGLShader(Program). Must rely only on
+// QOpenGLContext/Functions.
+
class QOpenGLProgramBinaryCache
{
public:
struct ShaderDesc {
ShaderDesc() { }
- ShaderDesc(QOpenGLShader::ShaderType type, const QByteArray &source = QByteArray())
- : type(type), source(source)
+ ShaderDesc(QShader::Stage stage, const QByteArray &source = QByteArray())
+ : stage(stage), source(source)
{ }
- QOpenGLShader::ShaderType type;
+ QShader::Stage stage;
QByteArray source;
};
struct ProgramDesc {
QVector<ShaderDesc> shaders;
+ QByteArray cacheKey() const;
};
QOpenGLProgramBinaryCache();
@@ -103,6 +109,36 @@ private:
QMutex m_mutex;
};
+// While unlikely, one application can in theory use contexts with different versions
+// or profiles. Therefore any version- or extension-specific checks must be done on a
+// per-context basis, not just once per process. QOpenGLSharedResource enables this,
+// although it's once-per-sharing-context-group, not per-context. Still, this should
+// be good enough in practice.
+class QOpenGLProgramBinarySupportCheck : public QOpenGLSharedResource
+{
+public:
+ QOpenGLProgramBinarySupportCheck(QOpenGLContext *context);
+ void invalidateResource() override { }
+ void freeResource(QOpenGLContext *) override { }
+
+ bool isSupported() const { return m_supported; }
+
+private:
+ bool m_supported;
+};
+
+class QOpenGLProgramBinarySupportCheckWrapper
+{
+public:
+ QOpenGLProgramBinarySupportCheck *get(QOpenGLContext *context)
+ {
+ return m_resource.value<QOpenGLProgramBinarySupportCheck>(context);
+ }
+
+private:
+ QOpenGLMultiGroupSharedResource m_resource;
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/gui/opengl/qopenglqueryhelper_p.h b/src/gui/opengl/qopenglqueryhelper_p.h
index 60dbf9c743..ad91ca9f96 100644
--- a/src/gui/opengl/qopenglqueryhelper_p.h
+++ b/src/gui/opengl/qopenglqueryhelper_p.h
@@ -65,18 +65,18 @@ class QOpenGLQueryHelper
{
public:
QOpenGLQueryHelper(QOpenGLContext *context)
- : GetQueryObjectuiv(0),
- GetQueryObjectiv(0),
- GetQueryiv(0),
- EndQuery(0),
- BeginQuery(0),
- IsQuery(0),
- DeleteQueries(0),
- GenQueries(0),
- GetInteger64v(0),
- GetQueryObjectui64v(0),
- GetQueryObjecti64v(0),
- QueryCounter(0)
+ : GetQueryObjectuiv(nullptr),
+ GetQueryObjectiv(nullptr),
+ GetQueryiv(nullptr),
+ EndQuery(nullptr),
+ BeginQuery(nullptr),
+ IsQuery(nullptr),
+ DeleteQueries(nullptr),
+ GenQueries(nullptr),
+ GetInteger64v(nullptr),
+ GetQueryObjectui64v(nullptr),
+ GetQueryObjecti64v(nullptr),
+ QueryCounter(nullptr)
{
Q_ASSERT(context);
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index 3c7bd4f90d..4986ca573d 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -47,8 +47,6 @@
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qvector.h>
#include <QtCore/qloggingcategory.h>
-#include <QtCore/qcryptographichash.h>
-#include <QtCore/qcoreapplication.h>
#include <QtGui/qtransform.h>
#include <QtGui/QColor>
#include <QtGui/QSurfaceFormat>
@@ -179,7 +177,7 @@ QT_BEGIN_NAMESPACE
(requires OpenGL >= 4.3 or OpenGL ES >= 3.1).
*/
-Q_LOGGING_CATEGORY(DBG_SHADER_CACHE, "qt.opengl.diskcache")
+Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache)
// For GLES 3.1/3.2
#ifndef GL_GEOMETRY_SHADER
@@ -210,10 +208,6 @@ Q_LOGGING_CATEGORY(DBG_SHADER_CACHE, "qt.opengl.diskcache")
#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
#endif
-#ifndef GL_NUM_PROGRAM_BINARY_FORMATS
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#endif
-
#ifndef QT_OPENGL_ES_2
static inline bool isFormatGLES(const QSurfaceFormat &f)
{
@@ -1081,6 +1075,44 @@ bool QOpenGLShaderProgram::addCacheableShaderFromSourceCode(QOpenGLShader::Shade
return addCacheableShaderFromSourceCode(type, QByteArray(source));
}
+static inline QShader::Stage qt_shaderTypeToStage(QOpenGLShader::ShaderType type)
+{
+ switch (type) {
+ case QOpenGLShader::Vertex:
+ return QShader::VertexStage;
+ case QOpenGLShader::Fragment:
+ return QShader::FragmentStage;
+ case QOpenGLShader::Geometry:
+ return QShader::GeometryStage;
+ case QOpenGLShader::TessellationControl:
+ return QShader::TessellationControlStage;
+ case QOpenGLShader::TessellationEvaluation:
+ return QShader::TessellationEvaluationStage;
+ case QOpenGLShader::Compute:
+ return QShader::ComputeStage;
+ }
+ return QShader::VertexStage;
+}
+
+static inline QOpenGLShader::ShaderType qt_shaderStageToType(QShader::Stage stage)
+{
+ switch (stage) {
+ case QShader::VertexStage:
+ return QOpenGLShader::Vertex;
+ case QShader::TessellationControlStage:
+ return QOpenGLShader::TessellationControl;
+ case QShader::TessellationEvaluationStage:
+ return QOpenGLShader::TessellationEvaluation;
+ case QShader::GeometryStage:
+ return QOpenGLShader::Geometry;
+ case QShader::FragmentStage:
+ return QOpenGLShader::Fragment;
+ case QShader::ComputeStage:
+ return QOpenGLShader::Compute;
+ }
+ return QOpenGLShader::Vertex;
+}
+
/*!
\overload
@@ -1109,7 +1141,7 @@ bool QOpenGLShaderProgram::addCacheableShaderFromSourceCode(QOpenGLShader::Shade
if (d->isCacheDisabled())
return addShaderFromSourceCode(type, source);
- d->binaryProgram.shaders.append(QOpenGLProgramBinaryCache::ShaderDesc(type, source));
+ d->binaryProgram.shaders.append(QOpenGLProgramBinaryCache::ShaderDesc(qt_shaderTypeToStage(type), source));
return true;
}
@@ -1166,7 +1198,7 @@ bool QOpenGLShaderProgram::addCacheableShaderFromSourceFile(QOpenGLShader::Shade
if (d->isCacheDisabled())
return addShaderFromSourceFile(type, fileName);
- QOpenGLProgramBinaryCache::ShaderDesc shader(type);
+ QOpenGLProgramBinaryCache::ShaderDesc shader(qt_shaderTypeToStage(type));
// NB! It could be tempting to defer reading the file contents and just
// hash the filename as the cache key, perhaps combined with last-modified
// timestamp checks. However, this would raise a number of issues (no
@@ -3720,77 +3752,6 @@ bool QOpenGLShader::hasOpenGLShaders(ShaderType type, QOpenGLContext *context)
return true;
}
-// While unlikely, one application can in theory use contexts with different versions
-// or profiles. Therefore any version- or extension-specific checks must be done on a
-// per-context basis, not just once per process. QOpenGLSharedResource enables this,
-// although it's once-per-sharing-context-group, not per-context. Still, this should
-// be good enough in practice.
-class QOpenGLProgramBinarySupportCheck : public QOpenGLSharedResource
-{
-public:
- QOpenGLProgramBinarySupportCheck(QOpenGLContext *context);
- void invalidateResource() override { }
- void freeResource(QOpenGLContext *) override { }
-
- bool isSupported() const { return m_supported; }
-
-private:
- bool m_supported;
-};
-
-QOpenGLProgramBinarySupportCheck::QOpenGLProgramBinarySupportCheck(QOpenGLContext *context)
- : QOpenGLSharedResource(context->shareGroup()),
- m_supported(false)
-{
- if (QCoreApplication::testAttribute(Qt::AA_DisableShaderDiskCache)) {
- qCDebug(DBG_SHADER_CACHE, "Shader cache disabled via app attribute");
- return;
- }
- if (qEnvironmentVariableIntValue("QT_DISABLE_SHADER_DISK_CACHE")) {
- qCDebug(DBG_SHADER_CACHE, "Shader cache disabled via env var");
- return;
- }
-
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- if (ctx) {
- if (ctx->isOpenGLES()) {
- qCDebug(DBG_SHADER_CACHE, "OpenGL ES v%d context", ctx->format().majorVersion());
- if (ctx->format().majorVersion() >= 3) {
- m_supported = true;
- } else {
- const bool hasExt = ctx->hasExtension("GL_OES_get_program_binary");
- qCDebug(DBG_SHADER_CACHE, "GL_OES_get_program_binary support = %d", hasExt);
- if (hasExt)
- m_supported = true;
- }
- } else {
- const bool hasExt = ctx->hasExtension("GL_ARB_get_program_binary");
- qCDebug(DBG_SHADER_CACHE, "GL_ARB_get_program_binary support = %d", hasExt);
- if (hasExt)
- m_supported = true;
- }
- if (m_supported) {
- GLint fmtCount = 0;
- ctx->functions()->glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &fmtCount);
- qCDebug(DBG_SHADER_CACHE, "Supported binary format count = %d", fmtCount);
- m_supported = fmtCount > 0;
- }
- }
- qCDebug(DBG_SHADER_CACHE, "Shader cache supported = %d", m_supported);
-}
-
-class QOpenGLProgramBinarySupportCheckWrapper
-{
-public:
- QOpenGLProgramBinarySupportCheck *get(QOpenGLContext *context)
- {
- return m_resource.value<QOpenGLProgramBinarySupportCheck>(context);
- }
-
-private:
- QOpenGLMultiGroupSharedResource m_resource;
-};
-
bool QOpenGLShaderProgramPrivate::isCacheDisabled() const
{
static QOpenGLProgramBinarySupportCheckWrapper binSupportCheck;
@@ -3801,7 +3762,7 @@ bool QOpenGLShaderProgramPrivate::compileCacheable()
{
Q_Q(QOpenGLShaderProgram);
for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : qAsConst(binaryProgram.shaders)) {
- QScopedPointer<QOpenGLShader> s(new QOpenGLShader(shader.type, q));
+ QScopedPointer<QOpenGLShader> s(new QOpenGLShader(qt_shaderStageToType(shader.stage), q));
if (!s->compileSourceCode(shader.source)) {
log = s->log();
return false;
@@ -3819,24 +3780,20 @@ bool QOpenGLShaderProgramPrivate::linkBinary()
Q_Q(QOpenGLShaderProgram);
- QCryptographicHash keyBuilder(QCryptographicHash::Sha1);
- for (const QOpenGLProgramBinaryCache::ShaderDesc &shader : qAsConst(binaryProgram.shaders))
- keyBuilder.addData(shader.source);
-
- const QByteArray cacheKey = keyBuilder.result().toHex();
- if (DBG_SHADER_CACHE().isEnabled(QtDebugMsg))
- qCDebug(DBG_SHADER_CACHE, "program with %d shaders, cache key %s",
+ const QByteArray cacheKey = binaryProgram.cacheKey();
+ if (lcOpenGLProgramDiskCache().isEnabled(QtDebugMsg))
+ qCDebug(lcOpenGLProgramDiskCache, "program with %d shaders, cache key %s",
binaryProgram.shaders.count(), cacheKey.constData());
bool needsCompile = true;
if (binCache.load(cacheKey, q->programId())) {
- qCDebug(DBG_SHADER_CACHE, "Program binary received from cache");
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary received from cache");
needsCompile = false;
}
bool needsSave = false;
if (needsCompile) {
- qCDebug(DBG_SHADER_CACHE, "Program binary not in cache, compiling");
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary not in cache, compiling");
if (compileCacheable())
needsSave = true;
else
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index e04a00e592..61a6202017 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -1467,6 +1467,122 @@ void QOpenGLTexturePrivate::setData(int mipLevel, int layer, int layerCount, QOp
}
}
+void QOpenGLTexturePrivate::setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth,
+ int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
+ QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ switch (target) {
+ case QOpenGLTexture::Target1D:
+ Q_UNUSED(layer);
+ Q_UNUSED(cubeFace);
+ Q_UNUSED(layerCount);
+ Q_UNUSED(yOffset);
+ Q_UNUSED(zOffset);
+ Q_UNUSED(height);
+ Q_UNUSED(depth);
+ texFuncs->glTextureSubImage1D(textureId, target, bindingTarget, mipLevel,
+ xOffset, width,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::Target1DArray:
+ Q_UNUSED(cubeFace);
+ Q_UNUSED(yOffset);
+ Q_UNUSED(zOffset);
+ Q_UNUSED(height);
+ Q_UNUSED(depth);
+ texFuncs->glTextureSubImage2D(textureId, target, bindingTarget, mipLevel,
+ xOffset, layer,
+ width,
+ layerCount,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::Target2D:
+ Q_UNUSED(layer);
+ Q_UNUSED(cubeFace);
+ Q_UNUSED(layerCount);
+ Q_UNUSED(zOffset);
+ Q_UNUSED(depth);
+ texFuncs->glTextureSubImage2D(textureId, target, bindingTarget, mipLevel,
+ xOffset, yOffset,
+ width, height,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::Target2DArray:
+ Q_UNUSED(cubeFace);
+ Q_UNUSED(zOffset);
+ Q_UNUSED(depth);
+ texFuncs->glTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
+ xOffset, yOffset, layer,
+ width, height, layerCount,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::Target3D:
+ Q_UNUSED(cubeFace);
+ Q_UNUSED(layerCount);
+ texFuncs->glTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
+ xOffset, yOffset, zOffset,
+ width, height, depth,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::TargetCubeMap:
+ Q_UNUSED(layer);
+ Q_UNUSED(layerCount);
+ Q_UNUSED(zOffset);
+ Q_UNUSED(depth);
+ texFuncs->glTextureSubImage2D(textureId, cubeFace, bindingTarget, mipLevel,
+ xOffset, yOffset,
+ width, height,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::TargetCubeMapArray: {
+ Q_UNUSED(zOffset);
+ Q_UNUSED(depth);
+ int faceIndex = cubeFace - QOpenGLTexture::CubeMapPositiveX;
+ int layerFace = 6 * layer + faceIndex;
+ texFuncs->glTextureSubImage3D(textureId, target, bindingTarget, mipLevel,
+ xOffset, yOffset, layerFace,
+ width, height,
+ layerCount,
+ sourceFormat, sourceType, data, options);
+ break;
+ }
+
+ case QOpenGLTexture::TargetRectangle:
+ Q_UNUSED(mipLevel);
+ Q_UNUSED(layer);
+ Q_UNUSED(cubeFace);
+ Q_UNUSED(layerCount);
+ Q_UNUSED(zOffset);
+ Q_UNUSED(depth);
+ texFuncs->glTextureSubImage2D(textureId, target, bindingTarget, 0,
+ xOffset, yOffset,
+ width, height,
+ sourceFormat, sourceType, data, options);
+ break;
+
+ case QOpenGLTexture::Target2DMultisample:
+ case QOpenGLTexture::Target2DMultisampleArray:
+ case QOpenGLTexture::TargetBuffer:
+ // We don't upload pixel data for these targets
+ qWarning("QOpenGLTexture::setData(): Texture target does not support pixel data upload");
+ break;
+ }
+
+ // If requested perform automatic mip map generation
+ if (mipLevel == 0 && autoGenerateMipMaps && mipLevels > 1) {
+ Q_Q(QOpenGLTexture);
+ q->generateMipMaps();
+ }
+}
+
+
void QOpenGLTexturePrivate::setCompressedData(int mipLevel, int layer, int layerCount,
QOpenGLTexture::CubeMapFace cubeFace,
int dataSize, const void *data,
@@ -3380,6 +3496,153 @@ void QOpenGLTexture::setData(PixelFormat sourceFormat, PixelType sourceType,
d->setData(0, 0, 1, QOpenGLTexture::CubeMapPositiveX, sourceFormat, sourceType, data, options);
}
+/*!
+ \since 5.14
+ \overload
+
+ This overload is to be used to update a part of the texture. Parameters \a
+ xOffset, \a yOffset, \a zOffset specify the texel offsets within the
+ texture. Parameters \a width, \a height and \a depth specify the dimensions
+ of the sub image.
+
+ The structure of the pixel data pointed to by \a data is specified by \a
+ sourceFormat and \a sourceType. The pixel data upload can optionally be
+ controlled by \a options.
+*/
+void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ Q_D(QOpenGLTexture);
+ Q_ASSERT(d->textureId);
+ d->setData(xOffset, yOffset, zOffset,
+ width, height, depth,
+ 0, 0, 1,
+ QOpenGLTexture::CubeMapPositiveX, sourceFormat,
+ sourceType, data, options);
+}
+
+/*!
+ \since 5.14
+ \overload
+
+ This overload is to be used to update a part of the texture. Parameters \a
+ xOffset, \a yOffset, \a zOffset specify the texel offsets within the
+ texture. Parameters \a width, \a height and \a depth specify the dimensions
+ of the sub image. The mip map level the sub image we want to
+ update is specified with \a mipLevel.
+
+ The structure of the pixel data pointed to by \a data is specified by \a
+ sourceFormat and \a sourceType. The pixel data upload can optionally be
+ controlled by \a options.
+*/
+void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ Q_D(QOpenGLTexture);
+ Q_ASSERT(d->textureId);
+ d->setData(xOffset, yOffset, zOffset,
+ width, height, depth,
+ mipLevel, 0, 1,
+ QOpenGLTexture::CubeMapPositiveX, sourceFormat,
+ sourceType, data, options);
+}
+
+/*!
+ \since 5.14
+ \overload
+
+ This overload is to be used to update a part of the texture. Parameters \a
+ xOffset, \a yOffset, \a zOffset specify the texel offsets within the
+ texture. Parameters \a width, \a height and \a depth specify the dimensions
+ of the sub image. The mip map level and layerof the sub image we want to
+ update are specified with \a mipLevel and \a layer.
+
+ The structure of the pixel data pointed to by \a data is specified by \a
+ sourceFormat and \a sourceType. The pixel data upload can optionally be
+ controlled by \a options.
+*/
+void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel, int layer,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ Q_D(QOpenGLTexture);
+ Q_ASSERT(d->textureId);
+ d->setData(xOffset, yOffset, zOffset,
+ width, height, depth,
+ mipLevel, layer, 1,
+ QOpenGLTexture::CubeMapPositiveX, sourceFormat,
+ sourceType, data, options);
+}
+
+/*!
+ \since 5.14
+ \overload
+
+ This overload is to be used to update a part of the texture. Parameters \a
+ xOffset, \a yOffset, \a zOffset specify the texel offsets within the
+ texture. Parameters \a width, \a height and \a depth specify the dimensions
+ of the sub image.The mip map level, layer and cube map face of the sub
+ image we want to update are specified with \a mipLevel, \a layer and \a
+ face.
+
+ The structure of the pixel data pointed to by \a data is specified by \a
+ sourceFormat and \a sourceType. The pixel data upload can optionally be
+ controlled by \a options.
+*/
+void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel, int layer,
+ CubeMapFace face,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ Q_D(QOpenGLTexture);
+ Q_ASSERT(d->textureId);
+ d->setData(xOffset, yOffset, zOffset,
+ width, height, depth,
+ mipLevel, layer, 1,
+ face, sourceFormat,
+ sourceType, data, options);
+}
+
+/*!
+ \since 5.14
+ \overload
+
+ This overload is to be used to update a part of the texture. Parameters \a
+ xOffset, \a yOffset, \a zOffset specify the texel offsets within the
+ texture. Parameters \a width, \a height and \a depth specify the dimensions
+ of the sub image.The mip map level, starting layer, cube map face and
+ number of layers of the sub image we want to update are specified with \a
+ mipLevel, \a layer, \a face and \a layerCount.
+
+ The structure of the pixel data pointed to by \a data is specified by \a
+ sourceFormat and \a sourceType. The pixel data upload can optionally be
+ controlled by \a options.
+*/
+void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel, int layer,
+ CubeMapFace face, int layerCount,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options)
+{
+ Q_D(QOpenGLTexture);
+ Q_ASSERT(d->textureId);
+ d->setData(xOffset, yOffset, zOffset,
+ width, height, depth,
+ mipLevel, layer, layerCount,
+ face, sourceFormat,
+ sourceType, data, options);
+}
+
#if QT_DEPRECATED_SINCE(5, 3)
/*!
\obsolete
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index c0c5283374..7d984babc8 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -485,6 +485,32 @@ public:
void setData(PixelFormat sourceFormat, PixelType sourceType,
const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
+ void setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
+ void setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth, int mipLevel,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
+ void setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel, int layer,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
+ void setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel, int layer,
+ CubeMapFace cubeFace,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
+ void setData(int xOffset, int yOffset, int zOffset,
+ int width, int height, int depth,
+ int mipLevel, int layer,
+ CubeMapFace cubeFace, int layerCount,
+ PixelFormat sourceFormat, PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options = nullptr);
+
// Compressed data upload
// ### Qt 6: remove the non-const void * overloads
#if QT_DEPRECATED_SINCE(5, 3)
diff --git a/src/gui/opengl/qopengltexture_p.h b/src/gui/opengl/qopengltexture_p.h
index f7694f77bc..9f3457ad0a 100644
--- a/src/gui/opengl/qopengltexture_p.h
+++ b/src/gui/opengl/qopengltexture_p.h
@@ -101,6 +101,10 @@ public:
void setData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType,
const void *data, const QOpenGLPixelTransferOptions * const options);
+ void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth,
+ int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
+ QOpenGLTexture::PixelFormat sourceFormat, QOpenGLTexture::PixelType sourceType,
+ const void *data, const QOpenGLPixelTransferOptions * const options);
void setCompressedData(int mipLevel, int layer, int layerCount, QOpenGLTexture::CubeMapFace cubeFace,
int dataSize, const void *data,
const QOpenGLPixelTransferOptions * const options);
diff --git a/src/gui/opengl/qopengltextureglyphcache_p.h b/src/gui/opengl/qopengltextureglyphcache_p.h
index 38c9aede7d..4bea4a463a 100644
--- a/src/gui/opengl/qopengltextureglyphcache_p.h
+++ b/src/gui/opengl/qopengltextureglyphcache_p.h
@@ -139,7 +139,7 @@ public:
inline void setPaintEnginePrivate(QOpenGL2PaintEngineExPrivate *p) { pex = p; }
- inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : 0; }
+ inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : nullptr; }
inline int serialNumber() const { return m_serialNumber; }
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index 00f6f9e5aa..62d0125daf 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -167,7 +167,7 @@ public:
inline void glTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
- const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = 0)
+ const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -181,7 +181,7 @@ public:
inline void glTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height, GLenum format, GLenum type,
- const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = 0)
+ const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -195,7 +195,7 @@ public:
inline void glTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset,
GLsizei width, GLenum format, GLenum type,
- const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = 0)
+ const GLvoid *pixels, const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -222,7 +222,7 @@ public:
inline void glCompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLint xoffset, GLsizei width,
GLenum format, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -238,7 +238,7 @@ public:
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -254,7 +254,7 @@ public:
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -269,7 +269,7 @@ public:
inline void glCompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width,
GLint border, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
@@ -284,7 +284,7 @@ public:
inline void glCompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height,
GLint border, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
@@ -300,7 +300,7 @@ public:
inline void glCompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLsizei imageSize, const GLvoid *bits,
- const QOpenGLPixelTransferOptions * const options = 0)
+ const QOpenGLPixelTransferOptions * const options = nullptr)
{
if (options) {
QOpenGLPixelTransferOptions oldOptions = savePixelUploadOptions();
diff --git a/src/gui/opengl/qopengltextureuploader.cpp b/src/gui/opengl/qopengltextureuploader.cpp
index d9d5403cf3..9e393bc47a 100644
--- a/src/gui/opengl/qopengltextureuploader.cpp
+++ b/src/gui/opengl/qopengltextureuploader.cpp
@@ -65,6 +65,10 @@
#define GL_RGBA16 0x805B
#endif
+#ifndef GL_BGR
+#define GL_BGR 0x80E0
+#endif
+
#ifndef GL_BGRA
#define GL_BGRA 0x80E1
#endif
@@ -202,6 +206,20 @@ qsizetype QOpenGLTextureUploader::textureImage(GLenum target, const QImage &imag
pixelType = GL_UNSIGNED_BYTE;
targetFormat = QImage::Format_RGB888;
break;
+ case QImage::Format_BGR888:
+ if (isOpenGL12orBetter) {
+ externalFormat = GL_BGR;
+ internalFormat = GL_RGB;
+ pixelType = GL_UNSIGNED_BYTE;
+ targetFormat = QImage::Format_BGR888;
+ } else if (funcs->hasOpenGLExtension(QOpenGLExtensions::TextureSwizzle)) {
+ funcs->glTexParameteri(target, GL_TEXTURE_SWIZZLE_B, GL_RED);
+ funcs->glTexParameteri(target, GL_TEXTURE_SWIZZLE_R, GL_BLUE);
+ externalFormat = internalFormat = GL_RGB;
+ pixelType = GL_UNSIGNED_BYTE;
+ targetFormat = QImage::Format_BGR888;
+ }
+ break;
case QImage::Format_RGBX8888:
case QImage::Format_RGBA8888:
case QImage::Format_RGBA8888_Premultiplied:
diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h
index 99c8565fbc..4835ea4871 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/gui/opengl/qopenglversionfunctions.h
@@ -103,7 +103,7 @@ struct QOpenGLVersionStatus
OpenGLStatus status;
};
-inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0) noexcept
{
return qHash(static_cast<int>(v.status * 1000)
+ v.version.first * 100 + v.version.second * 10, seed);
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index a90abed4c0..fcf6488edd 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -8,7 +8,15 @@ HEADERS += \
painting/qbrush.h \
painting/qcolor.h \
painting/qcolor_p.h \
- painting/qcolorprofile_p.h \
+ painting/qcolormatrix_p.h \
+ painting/qcolorspace.h \
+ painting/qcolorspace_p.h \
+ painting/qcolortransferfunction_p.h \
+ painting/qcolortransfertable_p.h \
+ painting/qcolortransform.h \
+ painting/qcolortransform_p.h \
+ painting/qcolortrc_p.h \
+ painting/qcolortrclut_p.h \
painting/qcosmeticstroker_p.h \
painting/qdatabuffer_p.h \
painting/qdrawhelper_p.h \
@@ -17,6 +25,7 @@ HEADERS += \
painting/qemulationpaintengine_p.h \
painting/qfixed_p.h \
painting/qgrayraster_p.h \
+ painting/qicc_p.h \
painting/qmatrix.h \
painting/qmemrotate_p.h \
painting/qoutlinemapper_p.h \
@@ -64,12 +73,15 @@ SOURCES += \
painting/qblittable.cpp \
painting/qbrush.cpp \
painting/qcolor.cpp \
- painting/qcolorprofile.cpp \
+ painting/qcolorspace.cpp \
+ painting/qcolortransform.cpp \
+ painting/qcolortrclut.cpp \
painting/qcompositionfunctions.cpp \
painting/qcosmeticstroker.cpp \
painting/qdrawhelper.cpp \
painting/qemulationpaintengine.cpp \
painting/qgrayraster.c \
+ painting/qicc.cpp \
painting/qimagescale.cpp \
painting/qmatrix.cpp \
painting/qmemrotate.cpp \
@@ -123,23 +135,41 @@ gcc:equals(QT_GCC_MAJOR_VERSION, 5) {
NO_PCH_SOURCES += painting/qdrawhelper.cpp
}
-SSE2_SOURCES += painting/qdrawhelper_sse2.cpp
-SSSE3_SOURCES += painting/qdrawhelper_ssse3.cpp
-SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \
- painting/qimagescale_sse4.cpp
-ARCH_HASWELL_SOURCES += painting/qdrawhelper_avx2.cpp
+!android {
+ SSE2_SOURCES += painting/qdrawhelper_sse2.cpp
+ SSSE3_SOURCES += painting/qdrawhelper_ssse3.cpp
+ SSE4_1_SOURCES += painting/qdrawhelper_sse4.cpp \
+ painting/qimagescale_sse4.cpp
+ ARCH_HASWELL_SOURCES += painting/qdrawhelper_avx2.cpp
-NEON_SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp
-NEON_HEADERS += painting/qdrawhelper_neon_p.h
+ NEON_SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp
+ NEON_HEADERS += painting/qdrawhelper_neon_p.h
+}
!uikit:!win32:contains(QT_ARCH, "arm"): CONFIG += no_clang_integrated_as
-!uikit:!win32:!integrity:!contains(QT_ARCH, "arm64") {
+!android:!uikit:!win32:!integrity:!contains(QT_ARCH, "arm64") {
NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
DEFINES += ENABLE_PIXMAN_DRAWHELPERS
}
-MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
-MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
-MIPS_DSP_ASM += painting/qdrawhelper_mips_dsp_asm.S
-MIPS_DSPR2_ASM += painting/qdrawhelper_mips_dspr2_asm.S
+!android {
+ MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
+ MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
+ MIPS_DSP_ASM += painting/qdrawhelper_mips_dsp_asm.S
+ MIPS_DSPR2_ASM += painting/qdrawhelper_mips_dspr2_asm.S
+} else {
+ # see https://developer.android.com/ndk/guides/abis
+ x86 | x86_64 {
+ DEFINES += QT_COMPILER_SUPPORTS_SSE2 QT_COMPILER_SUPPORTS_SSE3 QT_COMPILER_SUPPORTS_SSSE3
+ SOURCES += painting/qdrawhelper_sse2.cpp painting/qdrawhelper_ssse3.cpp
+ }
+ x86_64 {
+ DEFINES += QT_COMPILER_SUPPORTS_SSE4_1 QT_COMPILER_SUPPORTS_SSE4_2
+ SOURCES += painting/qdrawhelper_sse4.cpp painting/qimagescale_sse4.cpp
+ }
+ arm64-v8a {
+ SOURCES += painting/qdrawhelper_neon.cpp painting/qimagescale_neon.cpp
+ HEADERS += painting/qdrawhelper_neon_p.h
+ }
+}
include($$PWD/../../3rdparty/zlib_dependency.pri)
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 65e6063fe4..7622262da9 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -47,6 +47,8 @@
#include <private/qnumeric_p.h>
+#include <tuple> // for std::tie()
+
QT_BEGIN_NAMESPACE
//#define QDEBUG_BEZIER
@@ -54,24 +56,6 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QBezier QBezier::fromPoints(const QPointF &p1, const QPointF &p2,
- const QPointF &p3, const QPointF &p4)
-{
- QBezier b;
- b.x1 = p1.x();
- b.y1 = p1.y();
- b.x2 = p2.x();
- b.y2 = p2.y();
- b.x3 = p3.x();
- b.y3 = p3.y();
- b.x4 = p4.x();
- b.y4 = p4.y();
- return b;
-}
-
-/*!
- \internal
-*/
QPolygonF QBezier::toPolygon(qreal bezier_flattening_threshold) const
{
// flattening is done by splitting the bezier until we can replace the segment by a straight
@@ -145,7 +129,7 @@ void QBezier::addToPolygon(QPolygonF *polygon, qreal bezier_flattening_threshold
--top;
} else {
// split, second half of the polygon goes lower into the stack
- b->split(b+1, b);
+ std::tie(b[1], b[0]) = b->split();
levels[top + 1] = --levels[top];
++top;
}
@@ -181,7 +165,7 @@ void QBezier::addToPolygon(QDataBuffer<QPointF> &polygon, qreal bezier_flattenin
--top;
} else {
// split, second half of the polygon goes lower into the stack
- b->split(b+1, b);
+ std::tie(b[1], b[0]) = b->split();
levels[top + 1] = --levels[top];
++top;
}
@@ -436,7 +420,7 @@ redo:
o += 2;
--b;
} else {
- b->split(b+1, b);
+ std::tie(b[1], b[0]) = b->split();
++b;
}
}
@@ -478,8 +462,6 @@ qreal QBezier::length(qreal error) const
void QBezier::addIfClose(qreal *length, qreal error) const
{
- QBezier left, right; /* bez poly splits */
-
qreal len = qreal(0.0); /* arc length */
qreal chord; /* chord length */
@@ -490,9 +472,9 @@ void QBezier::addIfClose(qreal *length, qreal error) const
chord = QLineF(QPointF(x1, y1),QPointF(x4, y4)).length();
if((len-chord) > error) {
- split(&left, &right); /* split in two */
- left.addIfClose(length, error); /* try left side */
- right.addIfClose(length, error); /* try right side */
+ const auto halves = split(); /* split in two */
+ halves.first.addIfClose(length, error); /* try left side */
+ halves.second.addIfClose(length, error); /* try right side */
return;
}
diff --git a/src/gui/painting/qbezier_p.h b/src/gui/painting/qbezier_p.h
index f8a91e9ef3..1c49f82416 100644
--- a/src/gui/painting/qbezier_p.h
+++ b/src/gui/painting/qbezier_p.h
@@ -69,7 +69,8 @@ class Q_GUI_EXPORT QBezier
{
public:
static QBezier fromPoints(const QPointF &p1, const QPointF &p2,
- const QPointF &p3, const QPointF &p4);
+ const QPointF &p3, const QPointF &p4)
+ { return {p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y(), p4.x(), p4.y()}; }
static void coefficients(qreal t, qreal &a, qreal &b, qreal &c, qreal &d);
@@ -106,7 +107,7 @@ public:
inline QLineF endTangent() const;
inline void parameterSplitLeft(qreal t, QBezier *left);
- inline void split(QBezier *firstHalf, QBezier *secondHalf) const;
+ inline std::pair<QBezier, QBezier> split() const;
int shifted(QBezier *curveSegments, int maxSegmets,
qreal offset, float threshold) const;
@@ -222,28 +223,21 @@ inline QPointF QBezier::secondDerivedAt(qreal t) const
a * y1 + b * y2 + c * y3 + d * y4);
}
-inline void QBezier::split(QBezier *firstHalf, QBezier *secondHalf) const
+std::pair<QBezier, QBezier> QBezier::split() const
{
- Q_ASSERT(firstHalf);
- Q_ASSERT(secondHalf);
-
- qreal c = (x2 + x3)*.5;
- firstHalf->x2 = (x1 + x2)*.5;
- secondHalf->x3 = (x3 + x4)*.5;
- firstHalf->x1 = x1;
- secondHalf->x4 = x4;
- firstHalf->x3 = (firstHalf->x2 + c)*.5;
- secondHalf->x2 = (secondHalf->x3 + c)*.5;
- firstHalf->x4 = secondHalf->x1 = (firstHalf->x3 + secondHalf->x2)*.5;
-
- c = (y2 + y3)/2;
- firstHalf->y2 = (y1 + y2)*.5;
- secondHalf->y3 = (y3 + y4)*.5;
- firstHalf->y1 = y1;
- secondHalf->y4 = y4;
- firstHalf->y3 = (firstHalf->y2 + c)*.5;
- secondHalf->y2 = (secondHalf->y3 + c)*.5;
- firstHalf->y4 = secondHalf->y1 = (firstHalf->y3 + secondHalf->y2)*.5;
+ const auto mid = [](QPointF lhs, QPointF rhs) { return (lhs + rhs) * .5; };
+
+ const QPointF mid_12 = mid(pt1(), pt2());
+ const QPointF mid_23 = mid(pt2(), pt3());
+ const QPointF mid_34 = mid(pt3(), pt4());
+ const QPointF mid_12_23 = mid(mid_12, mid_23);
+ const QPointF mid_23_34 = mid(mid_23, mid_34);
+ const QPointF mid_12_23__23_34 = mid(mid_12_23, mid_23_34);
+
+ return {
+ fromPoints(pt1(), mid_12, mid_12_23, mid_12_23__23_34),
+ fromPoints(mid_12_23__23_34, mid_23_34, mid_34, pt4()),
+ };
}
inline void QBezier::parameterSplitLeft(qreal t, QBezier *left)
diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h
index 5ea78cdde2..080da98ec4 100644
--- a/src/gui/painting/qblendfunctions_p.h
+++ b/src/gui/painting/qblendfunctions_p.h
@@ -71,10 +71,10 @@ void qt_scale_image_16bit(uchar *destPixels, int dbpl,
const int ix = 0x00010000 * sx;
const int iy = 0x00010000 * sy;
-// qDebug() << "scale:" << endl
-// << " - target" << targetRect << endl
-// << " - source" << srcRect << endl
-// << " - clip" << clip << endl
+// qDebug() << "scale:" << Qt::endl
+// << " - target" << targetRect << Qt::endl
+// << " - source" << srcRect << Qt::endl
+// << " - clip" << clip << Qt::endl
// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
QRect tr = targetRect.normalized().toRect();
@@ -162,10 +162,10 @@ template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl,
const int ix = 0x00010000 * sx;
const int iy = 0x00010000 * sy;
-// qDebug() << "scale:" << endl
-// << " - target" << targetRect << endl
-// << " - source" << srcRect << endl
-// << " - clip" << clip << endl
+// qDebug() << "scale:" << Qt::endl
+// << " - target" << targetRect << Qt::endl
+// << " - source" << srcRect << Qt::endl
+// << " - clip" << clip << Qt::endl
// << " - sx=" << sx << " sy=" << sy << " ix=" << ix << " iy=" << iy;
QRect tr = targetRect.normalized().toRect();
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index f56be55325..abb3268dfa 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -352,7 +352,7 @@ public:
QBrushData *brush;
QNullBrushData() : brush(new QBrushData)
{
- brush->ref.store(1);
+ brush->ref.storeRelaxed(1);
brush->style = Qt::BrushStyle(0);
brush->color = Qt::black;
}
@@ -411,7 +411,7 @@ void QBrush::init(const QColor &color, Qt::BrushStyle style)
d.reset(new QBrushData);
break;
}
- d->ref.store(1);
+ d->ref.storeRelaxed(1);
d->style = style;
d->color = color;
}
@@ -585,7 +585,7 @@ static Q_DECL_CONSTEXPR inline bool use_same_brushdata(Qt::BrushStyle lhs, Qt::B
void QBrush::detach(Qt::BrushStyle newStyle)
{
- if (use_same_brushdata(newStyle, d->style) && d->ref.load() == 1) {
+ if (use_same_brushdata(newStyle, d->style) && d->ref.loadRelaxed() == 1) {
d->style = newStyle;
return;
}
@@ -625,7 +625,7 @@ void QBrush::detach(Qt::BrushStyle newStyle)
x.reset(new QBrushData);
break;
}
- x->ref.store(1); // must be first lest the QBrushDataPointerDeleter turns into a no-op
+ x->ref.storeRelaxed(1); // must be first lest the QBrushDataPointerDeleter turns into a no-op
x->style = newStyle;
x->color = d->color;
x->transform = d->transform;
@@ -1140,11 +1140,11 @@ QDataStream &operator>>(QDataStream &s, QBrush &b)
if (s.version() >= QDataStream::Qt_5_5) {
QImage img;
s >> img;
- b.setTextureImage(qMove(img));
+ b.setTextureImage(std::move(img));
} else {
QPixmap pm;
s >> pm;
- b.setTexture(qMove(pm));
+ b.setTexture(std::move(pm));
}
} else if (style == Qt::LinearGradientPattern
|| style == Qt::RadialGradientPattern
@@ -1385,22 +1385,29 @@ QGradient::QGradient(Preset preset)
setCoordinateMode(ObjectMode);
setSpread(PadSpread);
- const QJsonValue start = presetData[QLatin1Literal("start")];
- const QJsonValue end = presetData[QLatin1Literal("end")];
- m_data.linear.x1 = start[QLatin1Literal("x")].toDouble();
- m_data.linear.y1 = start[QLatin1Literal("y")].toDouble();
- m_data.linear.x2 = end[QLatin1Literal("x")].toDouble();
- m_data.linear.y2 = end[QLatin1Literal("y")].toDouble();
+ const QJsonValue start = presetData[QLatin1String("start")];
+ const QJsonValue end = presetData[QLatin1String("end")];
+ m_data.linear.x1 = start[QLatin1String("x")].toDouble();
+ m_data.linear.y1 = start[QLatin1String("y")].toDouble();
+ m_data.linear.x2 = end[QLatin1String("x")].toDouble();
+ m_data.linear.y2 = end[QLatin1String("y")].toDouble();
for (const QJsonValue &stop : presetData[QLatin1String("stops")].toArray()) {
- setColorAt(stop[QLatin1Literal("position")].toDouble(),
- QColor(QRgb(stop[QLatin1Literal("color")].toInt())));
+ setColorAt(stop[QLatin1String("position")].toDouble(),
+ QColor(QRgb(stop[QLatin1String("color")].toInt())));
}
cachedPresets.insert(preset, *this);
}
}
+/*!
+ \internal
+*/
+QGradient::~QGradient()
+{
+}
+
QT_END_NAMESPACE
static void initGradientPresets() { Q_INIT_RESOURCE(qmake_webgradients); }
Q_CONSTRUCTOR_FUNCTION(initGradientPresets);
@@ -1785,6 +1792,12 @@ QLinearGradient::QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, q
{
}
+/*!
+ \internal
+*/
+QLinearGradient::~QLinearGradient()
+{
+}
/*!
Returns the start point of this linear gradient in logical coordinates.
@@ -2056,6 +2069,13 @@ QRadialGradient::QRadialGradient(qreal cx, qreal cy, qreal centerRadius, qreal f
}
/*!
+ \internal
+*/
+QRadialGradient::~QRadialGradient()
+{
+}
+
+/*!
Returns the center of this radial gradient in logical coordinates.
\sa QGradient::stops()
@@ -2301,6 +2321,13 @@ QConicalGradient::QConicalGradient(qreal cx, qreal cy, qreal angle)
{
}
+/*!
+ \internal
+*/
+QConicalGradient::~QConicalGradient()
+{
+}
+
/*!
Constructs a conical with center at (0, 0) starting the
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h
index aee51c526d..6a4ffab1c5 100644
--- a/src/gui/painting/qbrush.h
+++ b/src/gui/painting/qbrush.h
@@ -79,11 +79,9 @@ public:
~QBrush();
QBrush &operator=(const QBrush &brush);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QBrush &operator=(QBrush &&other) Q_DECL_NOEXCEPT
+ inline QBrush &operator=(QBrush &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QBrush &other) Q_DECL_NOEXCEPT
+ inline void swap(QBrush &other) noexcept
{ qSwap(d, other.d); }
operator QVariant() const;
@@ -161,7 +159,7 @@ inline Qt::BrushStyle QBrush::style() const { return d->style; }
inline const QColor &QBrush::color() const { return d->color; }
inline const QMatrix &QBrush::matrix() const { return d->transform.toAffine(); }
inline QTransform QBrush::transform() const { return d->transform; }
-inline bool QBrush::isDetached() const { return d->ref.load() == 1; }
+inline bool QBrush::isDetached() const { return d->ref.loadRelaxed() == 1; }
/*******************************************************************************
@@ -373,11 +371,14 @@ public:
GagarinView = 178,
FabledSunset = 179,
PerfectBlue = 180,
+
+ NumPresets
};
Q_ENUM(Preset)
QGradient();
QGradient(Preset);
+ ~QGradient();
Type type() const { return m_type; }
@@ -431,6 +432,7 @@ public:
QLinearGradient();
QLinearGradient(const QPointF &start, const QPointF &finalStop);
QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop);
+ ~QLinearGradient();
QPointF start() const;
void setStart(const QPointF &start);
@@ -455,6 +457,8 @@ public:
QRadialGradient(const QPointF &center, qreal centerRadius, const QPointF &focalPoint, qreal focalRadius);
QRadialGradient(qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius);
+ ~QRadialGradient();
+
QPointF center() const;
void setCenter(const QPointF &center);
inline void setCenter(qreal x, qreal y) { setCenter(QPointF(x, y)); }
@@ -480,6 +484,7 @@ public:
QConicalGradient();
QConicalGradient(const QPointF &center, qreal startAngle);
QConicalGradient(qreal cx, qreal cy, qreal startAngle);
+ ~QConicalGradient();
QPointF center() const;
void setCenter(const QPointF &center);
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index 07202f5b1c..8780cce223 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -39,6 +39,7 @@
#include "qcolor.h"
#include "qcolor_p.h"
+#include "qfloat16.h"
#include "qnamespace.h"
#include "qdatastream.h"
#include "qvariant.h"
@@ -146,6 +147,7 @@ static bool get_hex_rgb(const QChar *str, size_t len, QRgba64 *rgb)
#endif
#define rgb(r,g,b) (0xff000000 | (r << 16) | (g << 8) | b)
+// keep this is in sync with QColorConstants
static const struct RGBData {
const char name[21];
uint value;
@@ -474,25 +476,43 @@ static QStringList get_colornames()
\section1 Predefined Colors
- There are 20 predefined QColors described by the Qt::GlobalColor enum,
- including black, white, primary and secondary colors, darker versions
- of these colors and three shades of gray. QColor also recognizes a
- variety of color names; the static colorNames() function returns a
- QStringList color names that QColor knows about.
+ There are 20 predefined QColor objects in the \c{QColorConstants}
+ namespace, including black, white, primary and secondary colors,
+ darker versions of these colors, and three shades of gray.
+ Furthermore, the \c{QColorConstants::Svg} namespace defines QColor
+ objects for the standard \l{https://www.w3.org/TR/SVG11/types.html#ColorKeywords}{SVG color keyword names}.
\image qt-colors.png Qt Colors
- Additionally, the Qt::color0, Qt::color1 and Qt::transparent colors
- are used for special purposes.
+ The \c{QColorConstants::Color0}, \c{QColorConstants::Color1} and
+ \c{QColorConstants::Transparent} colors are used for special
+ purposes.
- Qt::color0 (zero pixel value) and Qt::color1 (non-zero pixel value)
- are special colors for drawing in QBitmaps. Painting with Qt::color0
- sets the bitmap bits to 0 (transparent; i.e., background), and painting
- with Qt::color1 sets the bits to 1 (opaque; i.e., foreground).
+ \c{QColorConstants::Color0} (zero pixel value) and
+ \c{QColorConstants::Color1} (non-zero pixel value) are special
+ colors for drawing in QBitmaps. Painting with
+ \c{QColorConstants::Color0} sets the bitmap bits to 0 (transparent;
+ i.e., background), and painting with c{QColorConstants::Color1}
+ sets the bits to 1 (opaque; i.e., foreground).
- Qt::transparent is used to indicate a transparent pixel. When painting
- with this value, a pixel value will be used that is appropriate for the
- underlying pixel format in use.
+ \c{QColorConstants::Transparent} is used to indicate a transparent
+ pixel. When painting with this value, a pixel value will be used
+ that is appropriate for the underlying pixel format in use.
+
+ For historical reasons, the 20 predefined colors are also available
+ in the Qt::GlobalColor enumeration.
+
+ Finally, QColor recognizes a variety of color names (as strings);
+ the static colorNames() function returns a QStringList color names
+ that QColor knows about.
+
+ \section1 The Extended RGB Color Model
+
+ The extended RGB color model, also known as the scRGB color space,
+ is the same the RGB color model except it allows values under 0.0,
+ and over 1.0. This makes it possible to represent colors that would
+ otherwise be outside the range of the RGB colorspace but still use
+ the same values for colors inside the RGB colorspace.
\section1 The HSV Color Model
@@ -577,7 +597,7 @@ static QStringList get_colornames()
alpha-channel to feature \l {QColor#Alpha-Blended
Drawing}{alpha-blended drawing}.
- \sa QPalette, QBrush
+ \sa QPalette, QBrush, QColorConstants
*/
#define QCOLOR_INT_RANGE_CHECK(fn, var) \
@@ -603,12 +623,13 @@ static QStringList get_colornames()
/*!
\enum QColor::Spec
- The type of color specified, either RGB, HSV, CMYK or HSL.
+ The type of color specified, either RGB, extended RGB, HSV, CMYK or HSL.
\value Rgb
\value Hsv
\value Cmyk
\value Hsl
+ \value ExtendedRgb
\value Invalid
\sa spec(), convertTo()
@@ -653,7 +674,7 @@ static QStringList get_colornames()
\sa isValid(), {QColor#Predefined Colors}{Predefined Colors}
*/
-QColor::QColor(Qt::GlobalColor color) Q_DECL_NOTHROW
+QColor::QColor(Qt::GlobalColor color) noexcept
{
#define QRGB(r, g, b) \
QRgb(((0xffu << 24) | ((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff)))
@@ -728,7 +749,7 @@ QColor::QColor(Qt::GlobalColor color) Q_DECL_NOTHROW
\sa fromRgb(), isValid()
*/
-QColor::QColor(QRgb color) Q_DECL_NOTHROW
+QColor::QColor(QRgb color) noexcept
{
cspec = Rgb;
ct.argb.alpha = 0xffff;
@@ -746,7 +767,7 @@ QColor::QColor(QRgb color) Q_DECL_NOTHROW
\sa fromRgba64()
*/
-QColor::QColor(QRgba64 rgba64) Q_DECL_NOTHROW
+QColor::QColor(QRgba64 rgba64) noexcept
{
setRgba64(rgba64);
}
@@ -760,7 +781,7 @@ QColor::QColor(QRgba64 rgba64) Q_DECL_NOTHROW
becomes a valid color by accident.
*/
-QColor::QColor(Spec spec) Q_DECL_NOTHROW
+QColor::QColor(Spec spec) noexcept
{
switch (spec) {
case Invalid:
@@ -778,6 +799,10 @@ QColor::QColor(Spec spec) Q_DECL_NOTHROW
case Hsl:
setHsl(0, 0, 0, 0);
break;
+ case ExtendedRgb:
+ cspec = spec;
+ setRgbF(0, 0, 0, 0);
+ break;
}
}
@@ -872,7 +897,8 @@ QString QColor::name(NameFormat format) const
\li #AARRGGBB (Since 5.2)
\li #RRRGGGBBB
\li #RRRRGGGGBBBB
- \li A name from the list of colors defined in the list of \l{http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG color keyword names}
+ \li A name from the list of colors defined in the list of
+ \l{https://www.w3.org/TR/SVG11/types.html#ColorKeywords}{SVG color keyword names}
provided by the World Wide Web Consortium; for example, "steelblue" or "gainsboro".
These color names work on all platforms. Note that these color names are \e not the
same as defined by the Qt::GlobalColor enums, e.g. "green" and Qt::green does not
@@ -933,7 +959,7 @@ bool QColor::isValidColor(const QString &name)
\overload
\since 5.10
*/
-bool QColor::isValidColor(QStringView name) Q_DECL_NOTHROW
+bool QColor::isValidColor(QStringView name) noexcept
{
return name.size() && QColor().setColorFromString(name);
}
@@ -942,7 +968,7 @@ bool QColor::isValidColor(QStringView name) Q_DECL_NOTHROW
\overload
\since 5.8
*/
-bool QColor::isValidColor(QLatin1String name) Q_DECL_NOTHROW
+bool QColor::isValidColor(QLatin1String name) noexcept
{
return name.size() && QColor().setColorFromString(name);
}
@@ -1211,6 +1237,17 @@ void QColor::setHsl(int h, int s, int l, int a)
ct.ahsl.pad = 0;
}
+static inline qfloat16 &castF16(quint16 &v)
+{
+ // this works because qfloat16 internally is a quint16
+ return *reinterpret_cast<qfloat16 *>(&v);
+}
+
+static inline const qfloat16 &castF16(const quint16 &v)
+{
+ return *reinterpret_cast<const qfloat16 *>(&v);
+}
+
/*!
Sets the contents pointed to by \a r, \a g, \a b, and \a a, to the red,
green, blue, and alpha-channel (transparency) components of the color's
@@ -1226,18 +1263,27 @@ void QColor::getRgbF(qreal *r, qreal *g, qreal *b, qreal *a) const
if (!r || !g || !b)
return;
- if (cspec != Invalid && cspec != Rgb) {
+ if (cspec == Invalid)
+ return;
+
+ if (cspec != Rgb && cspec != ExtendedRgb) {
toRgb().getRgbF(r, g, b, a);
return;
}
- *r = ct.argb.red / qreal(USHRT_MAX);
- *g = ct.argb.green / qreal(USHRT_MAX);
- *b = ct.argb.blue / qreal(USHRT_MAX);
-
- if (a)
- *a = ct.argb.alpha / qreal(USHRT_MAX);
-
+ if (cspec == Rgb) {
+ *r = ct.argb.red / qreal(USHRT_MAX);
+ *g = ct.argb.green / qreal(USHRT_MAX);
+ *b = ct.argb.blue / qreal(USHRT_MAX);
+ if (a)
+ *a = ct.argb.alpha / qreal(USHRT_MAX);
+ } else {
+ *r = castF16(ct.argbExtended.redF16);
+ *g = castF16(ct.argbExtended.greenF16);
+ *b = castF16(ct.argbExtended.blueF16);
+ if (a)
+ *a = castF16(ct.argbExtended.alphaF16);
+ }
}
/*!
@@ -1274,26 +1320,35 @@ void QColor::getRgb(int *r, int *g, int *b, int *a) const
Sets the color channels of this color to \a r (red), \a g (green),
\a b (blue) and \a a (alpha, transparency).
- All values must be in the range 0.0-1.0.
+ The alpha value must be in the range 0.0-1.0.
+ If any of the other values are outside the range of 0.0-1.0 the
+ color model will be set as \c ExtendedRgb.
\sa rgb(), getRgbF(), setRgb()
*/
void QColor::setRgbF(qreal r, qreal g, qreal b, qreal a)
{
- if (r < qreal(0.0) || r > qreal(1.0)
- || g < qreal(0.0) || g > qreal(1.0)
- || b < qreal(0.0) || b > qreal(1.0)
- || a < qreal(0.0) || a > qreal(1.0)) {
- qWarning("QColor::setRgbF: RGB parameters out of range");
+ if (a < qreal(0.0) || a > qreal(1.0)) {
+ qWarning("QColor::setRgbF: Alpha parameter is out of range");
invalidate();
return;
}
-
+ if (r < qreal(0.0) || r > qreal(1.0) ||
+ g < qreal(0.0) || g > qreal(1.0) ||
+ b < qreal(0.0) || b > qreal(1.0) || cspec == ExtendedRgb) {
+ cspec = ExtendedRgb;
+ castF16(ct.argbExtended.redF16) = qfloat16(r);
+ castF16(ct.argbExtended.greenF16) = qfloat16(g);
+ castF16(ct.argbExtended.blueF16) = qfloat16(b);
+ castF16(ct.argbExtended.alphaF16) = qfloat16(a);
+ ct.argbExtended.pad = 0;
+ return;
+ }
cspec = Rgb;
- ct.argb.alpha = qRound(a * USHRT_MAX);
ct.argb.red = qRound(r * USHRT_MAX);
ct.argb.green = qRound(g * USHRT_MAX);
ct.argb.blue = qRound(b * USHRT_MAX);
+ ct.argb.alpha = qRound(a * USHRT_MAX);
ct.argb.pad = 0;
}
@@ -1306,7 +1361,7 @@ void QColor::setRgbF(qreal r, qreal g, qreal b, qreal a)
*/
void QColor::setRgb(int r, int g, int b, int a)
{
- if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) {
+ if (!isRgbaValid(r, g, b, a)) {
qWarning("QColor::setRgb: RGB parameters out of range");
invalidate();
return;
@@ -1330,7 +1385,7 @@ void QColor::setRgb(int r, int g, int b, int a)
\sa setRgba(), rgb(), rgba64()
*/
-QRgb QColor::rgba() const Q_DECL_NOTHROW
+QRgb QColor::rgba() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().rgba();
@@ -1342,7 +1397,7 @@ QRgb QColor::rgba() const Q_DECL_NOTHROW
\sa rgba(), rgb(), setRgba64()
*/
-void QColor::setRgba(QRgb rgba) Q_DECL_NOTHROW
+void QColor::setRgba(QRgb rgba) noexcept
{
cspec = Rgb;
ct.argb.alpha = qAlpha(rgba) * 0x101;
@@ -1362,7 +1417,7 @@ void QColor::setRgba(QRgb rgba) Q_DECL_NOTHROW
\sa setRgba64(), rgba(), rgb()
*/
-QRgba64 QColor::rgba64() const Q_DECL_NOTHROW
+QRgba64 QColor::rgba64() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().rgba64();
@@ -1376,7 +1431,7 @@ QRgba64 QColor::rgba64() const Q_DECL_NOTHROW
\sa setRgba(), rgba64()
*/
-void QColor::setRgba64(QRgba64 rgba) Q_DECL_NOTHROW
+void QColor::setRgba64(QRgba64 rgba) noexcept
{
cspec = Rgb;
ct.argb.alpha = rgba.alpha();
@@ -1393,7 +1448,7 @@ void QColor::setRgba64(QRgba64 rgba) Q_DECL_NOTHROW
\sa getRgb(), rgba()
*/
-QRgb QColor::rgb() const Q_DECL_NOTHROW
+QRgb QColor::rgb() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().rgb();
@@ -1405,7 +1460,7 @@ QRgb QColor::rgb() const Q_DECL_NOTHROW
Sets the RGB value to \a rgb. The alpha value is set to opaque.
*/
-void QColor::setRgb(QRgb rgb) Q_DECL_NOTHROW
+void QColor::setRgb(QRgb rgb) noexcept
{
cspec = Rgb;
ct.argb.alpha = 0xffff;
@@ -1420,8 +1475,12 @@ void QColor::setRgb(QRgb rgb) Q_DECL_NOTHROW
\sa setAlpha(), alphaF(), {QColor#Alpha-Blended Drawing}{Alpha-Blended Drawing}
*/
-int QColor::alpha() const Q_DECL_NOTHROW
-{ return ct.argb.alpha >> 8; }
+int QColor::alpha() const noexcept
+{
+ if (cspec == ExtendedRgb)
+ return qRound(qreal(castF16(ct.argbExtended.alphaF16)) * 255);
+ return ct.argb.alpha >> 8;
+}
/*!
@@ -1434,6 +1493,11 @@ int QColor::alpha() const Q_DECL_NOTHROW
void QColor::setAlpha(int alpha)
{
QCOLOR_INT_RANGE_CHECK("QColor::setAlpha", alpha);
+ if (cspec == ExtendedRgb) {
+ constexpr qreal f = qreal(1.0) / 255;
+ castF16(ct.argbExtended.alphaF16) = alpha * f;
+ return;
+ }
ct.argb.alpha = alpha * 0x101;
}
@@ -1442,8 +1506,12 @@ void QColor::setAlpha(int alpha)
\sa setAlphaF(), alpha(), {QColor#Alpha-Blended Drawing}{Alpha-Blended Drawing}
*/
-qreal QColor::alphaF() const Q_DECL_NOTHROW
-{ return ct.argb.alpha / qreal(USHRT_MAX); }
+qreal QColor::alphaF() const noexcept
+{
+ if (cspec == ExtendedRgb)
+ return castF16(ct.argbExtended.alphaF16);
+ return ct.argb.alpha / qreal(USHRT_MAX);
+}
/*!
Sets the alpha of this color to \a alpha. qreal alpha is specified in the
@@ -1455,6 +1523,10 @@ qreal QColor::alphaF() const Q_DECL_NOTHROW
void QColor::setAlphaF(qreal alpha)
{
QCOLOR_REAL_RANGE_CHECK("QColor::setAlphaF", alpha);
+ if (cspec == ExtendedRgb) {
+ castF16(ct.argbExtended.alphaF16) = alpha;
+ return;
+ }
qreal tmp = alpha * USHRT_MAX;
ct.argb.alpha = qRound(tmp);
}
@@ -1465,7 +1537,7 @@ void QColor::setAlphaF(qreal alpha)
\sa setRed(), redF(), getRgb()
*/
-int QColor::red() const Q_DECL_NOTHROW
+int QColor::red() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().red();
@@ -1492,7 +1564,7 @@ void QColor::setRed(int red)
\sa setGreen(), greenF(), getRgb()
*/
-int QColor::green() const Q_DECL_NOTHROW
+int QColor::green() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().green();
@@ -1520,7 +1592,7 @@ void QColor::setGreen(int green)
\sa setBlue(), blueF(), getRgb()
*/
-int QColor::blue() const Q_DECL_NOTHROW
+int QColor::blue() const noexcept
{
if (cspec != Invalid && cspec != Rgb)
return toRgb().blue();
@@ -1548,27 +1620,31 @@ void QColor::setBlue(int blue)
\sa setRedF(), red(), getRgbF()
*/
-qreal QColor::redF() const Q_DECL_NOTHROW
+qreal QColor::redF() const noexcept
{
- if (cspec != Invalid && cspec != Rgb)
- return toRgb().redF();
- return ct.argb.red / qreal(USHRT_MAX);
+ if (cspec == Rgb || cspec == Invalid)
+ return ct.argb.red / qreal(USHRT_MAX);
+ if (cspec == ExtendedRgb)
+ return castF16(ct.argbExtended.redF16);
+
+ return toRgb().redF();
}
/*!
- Sets the red color component of this color to \a red. Float components
- are specified in the range 0.0-1.0.
+ Sets the red color component of this color to \a red. If \a red lies outside
+ the 0.0-1.0 range, the color model will be changed to \c ExtendedRgb.
\sa redF(), red(), setRgbF()
*/
void QColor::setRedF(qreal red)
{
- QCOLOR_REAL_RANGE_CHECK("QColor::setRedF", red);
- if (cspec != Rgb)
- setRgbF(red, greenF(), blueF(), alphaF());
- else
+ if (cspec == Rgb && red >= qreal(0.0) && red <= qreal(1.0))
ct.argb.red = qRound(red * USHRT_MAX);
+ else if (cspec == ExtendedRgb)
+ castF16(ct.argbExtended.redF16) = red;
+ else
+ setRgbF(red, greenF(), blueF(), alphaF());
}
/*!
@@ -1576,27 +1652,31 @@ void QColor::setRedF(qreal red)
\sa setGreenF(), green(), getRgbF()
*/
-qreal QColor::greenF() const Q_DECL_NOTHROW
+qreal QColor::greenF() const noexcept
{
- if (cspec != Invalid && cspec != Rgb)
- return toRgb().greenF();
- return ct.argb.green / qreal(USHRT_MAX);
+ if (cspec == Rgb || cspec == Invalid)
+ return ct.argb.green / qreal(USHRT_MAX);
+ if (cspec == ExtendedRgb)
+ return castF16(ct.argbExtended.greenF16);
+
+ return toRgb().greenF();
}
/*!
- Sets the green color component of this color to \a green. Float components
- are specified in the range 0.0-1.0.
+ Sets the green color component of this color to \a green. If \a green lies outside
+ the 0.0-1.0 range, the color model will be changed to \c ExtendedRgb.
\sa greenF(), green(), setRgbF()
*/
void QColor::setGreenF(qreal green)
{
- QCOLOR_REAL_RANGE_CHECK("QColor::setGreenF", green);
- if (cspec != Rgb)
- setRgbF(redF(), green, blueF(), alphaF());
- else
+ if (cspec == Rgb && green >= qreal(0.0) && green <= qreal(1.0))
ct.argb.green = qRound(green * USHRT_MAX);
+ else if (cspec == ExtendedRgb)
+ castF16(ct.argbExtended.greenF16) = green;
+ else
+ setRgbF(redF(), green, blueF(), alphaF());
}
/*!
@@ -1604,26 +1684,29 @@ void QColor::setGreenF(qreal green)
\sa setBlueF(), blue(), getRgbF()
*/
-qreal QColor::blueF() const Q_DECL_NOTHROW
+qreal QColor::blueF() const noexcept
{
- if (cspec != Invalid && cspec != Rgb)
- return toRgb().blueF();
- return ct.argb.blue / qreal(USHRT_MAX);
+ if (cspec == Rgb || cspec == Invalid)
+ return ct.argb.blue / qreal(USHRT_MAX);
+ if (cspec == ExtendedRgb)
+ return castF16(ct.argbExtended.blueF16);
+
+ return toRgb().blueF();
}
/*!
- Sets the blue color component of this color to \a blue. Float components
- are specified in the range 0.0-1.0.
-
+ Sets the blue color component of this color to \a blue. If \a blue lies outside
+ the 0.0-1.0 range, the color model will be changed to \c ExtendedRgb.
\sa blueF(), blue(), setRgbF()
*/
void QColor::setBlueF(qreal blue)
{
- QCOLOR_REAL_RANGE_CHECK("QColor::setBlueF", blue);
- if (cspec != Rgb)
- setRgbF(redF(), greenF(), blue, alphaF());
- else
+ if (cspec == Rgb && blue >= qreal(0.0) && blue <= qreal(1.0))
ct.argb.blue = qRound(blue * USHRT_MAX);
+ else if (cspec == ExtendedRgb)
+ castF16(ct.argbExtended.blueF16) = blue;
+ else
+ setRgbF(redF(), greenF(), blue, alphaF());
}
/*!
@@ -1634,7 +1717,7 @@ void QColor::setBlueF(qreal blue)
\sa hsvHue(), hslHue(), hueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::hue() const Q_DECL_NOTHROW
+int QColor::hue() const noexcept
{
return hsvHue();
}
@@ -1644,7 +1727,7 @@ int QColor::hue() const Q_DECL_NOTHROW
\sa hueF(), hslHue(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::hsvHue() const Q_DECL_NOTHROW
+int QColor::hsvHue() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().hue();
@@ -1660,7 +1743,7 @@ int QColor::hsvHue() const Q_DECL_NOTHROW
Model}
*/
-int QColor::saturation() const Q_DECL_NOTHROW
+int QColor::saturation() const noexcept
{
return hsvSaturation();
}
@@ -1670,7 +1753,7 @@ int QColor::saturation() const Q_DECL_NOTHROW
\sa saturationF(), hslSaturation(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::hsvSaturation() const Q_DECL_NOTHROW
+int QColor::hsvSaturation() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().saturation();
@@ -1682,7 +1765,7 @@ int QColor::hsvSaturation() const Q_DECL_NOTHROW
\sa valueF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-int QColor::value() const Q_DECL_NOTHROW
+int QColor::value() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().value();
@@ -1696,7 +1779,7 @@ int QColor::value() const Q_DECL_NOTHROW
\sa hsvHueF(), hslHueF(), hue(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-qreal QColor::hueF() const Q_DECL_NOTHROW
+qreal QColor::hueF() const noexcept
{
return hsvHueF();
}
@@ -1707,7 +1790,7 @@ qreal QColor::hueF() const Q_DECL_NOTHROW
\sa hue(), hslHueF(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color
Model}
*/
-qreal QColor::hsvHueF() const Q_DECL_NOTHROW
+qreal QColor::hsvHueF() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().hueF();
@@ -1722,7 +1805,7 @@ qreal QColor::hsvHueF() const Q_DECL_NOTHROW
\sa hsvSaturationF(), hslSaturationF(), saturation(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color
Model}
*/
-qreal QColor::saturationF() const Q_DECL_NOTHROW
+qreal QColor::saturationF() const noexcept
{
return hsvSaturationF();
}
@@ -1732,7 +1815,7 @@ qreal QColor::saturationF() const Q_DECL_NOTHROW
\sa saturation(), hslSaturationF(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-qreal QColor::hsvSaturationF() const Q_DECL_NOTHROW
+qreal QColor::hsvSaturationF() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().saturationF();
@@ -1744,7 +1827,7 @@ qreal QColor::hsvSaturationF() const Q_DECL_NOTHROW
\sa value(), getHsvF(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-qreal QColor::valueF() const Q_DECL_NOTHROW
+qreal QColor::valueF() const noexcept
{
if (cspec != Invalid && cspec != Hsv)
return toHsv().valueF();
@@ -1758,7 +1841,7 @@ qreal QColor::valueF() const Q_DECL_NOTHROW
\sa hslHueF(), hsvHue(), getHsl(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-int QColor::hslHue() const Q_DECL_NOTHROW
+int QColor::hslHue() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslHue();
@@ -1772,7 +1855,7 @@ int QColor::hslHue() const Q_DECL_NOTHROW
\sa hslSaturationF(), hsvSaturation(), getHsl(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-int QColor::hslSaturation() const Q_DECL_NOTHROW
+int QColor::hslSaturation() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslSaturation();
@@ -1786,7 +1869,7 @@ int QColor::hslSaturation() const Q_DECL_NOTHROW
\sa lightnessF(), getHsl()
*/
-int QColor::lightness() const Q_DECL_NOTHROW
+int QColor::lightness() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().lightness();
@@ -1800,7 +1883,7 @@ int QColor::lightness() const Q_DECL_NOTHROW
\sa hslHue(), hsvHueF(), getHslF()
*/
-qreal QColor::hslHueF() const Q_DECL_NOTHROW
+qreal QColor::hslHueF() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslHueF();
@@ -1814,7 +1897,7 @@ qreal QColor::hslHueF() const Q_DECL_NOTHROW
\sa hslSaturation(), hsvSaturationF(), getHslF(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-qreal QColor::hslSaturationF() const Q_DECL_NOTHROW
+qreal QColor::hslSaturationF() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().hslSaturationF();
@@ -1828,7 +1911,7 @@ qreal QColor::hslSaturationF() const Q_DECL_NOTHROW
\sa value(), getHslF()
*/
-qreal QColor::lightnessF() const Q_DECL_NOTHROW
+qreal QColor::lightnessF() const noexcept
{
if (cspec != Invalid && cspec != Hsl)
return toHsl().lightnessF();
@@ -1840,7 +1923,7 @@ qreal QColor::lightnessF() const Q_DECL_NOTHROW
\sa cyanF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::cyan() const Q_DECL_NOTHROW
+int QColor::cyan() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().cyan();
@@ -1852,7 +1935,7 @@ int QColor::cyan() const Q_DECL_NOTHROW
\sa magentaF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::magenta() const Q_DECL_NOTHROW
+int QColor::magenta() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().magenta();
@@ -1864,7 +1947,7 @@ int QColor::magenta() const Q_DECL_NOTHROW
\sa yellowF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::yellow() const Q_DECL_NOTHROW
+int QColor::yellow() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().yellow();
@@ -1877,7 +1960,7 @@ int QColor::yellow() const Q_DECL_NOTHROW
\sa blackF(), getCmyk(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-int QColor::black() const Q_DECL_NOTHROW
+int QColor::black() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().black();
@@ -1889,7 +1972,7 @@ int QColor::black() const Q_DECL_NOTHROW
\sa cyan(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::cyanF() const Q_DECL_NOTHROW
+qreal QColor::cyanF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().cyanF();
@@ -1901,7 +1984,7 @@ qreal QColor::cyanF() const Q_DECL_NOTHROW
\sa magenta(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::magentaF() const Q_DECL_NOTHROW
+qreal QColor::magentaF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().magentaF();
@@ -1913,7 +1996,7 @@ qreal QColor::magentaF() const Q_DECL_NOTHROW
\sa yellow(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::yellowF() const Q_DECL_NOTHROW
+qreal QColor::yellowF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().yellowF();
@@ -1925,7 +2008,7 @@ qreal QColor::yellowF() const Q_DECL_NOTHROW
\sa black(), getCmykF(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-qreal QColor::blackF() const Q_DECL_NOTHROW
+qreal QColor::blackF() const noexcept
{
if (cspec != Invalid && cspec != Cmyk)
return toCmyk().blackF();
@@ -1933,18 +2016,43 @@ qreal QColor::blackF() const Q_DECL_NOTHROW
}
/*!
+ Create and returns an extended RGB QColor based on this color.
+ \since 5.14
+
+ \sa toRgb, convertTo()
+*/
+QColor QColor::toExtendedRgb() const noexcept
+{
+ if (!isValid() || cspec == ExtendedRgb)
+ return *this;
+ if (cspec != Rgb)
+ return toRgb().toExtendedRgb();
+
+ constexpr qreal f = qreal(1.0) / USHRT_MAX;
+ QColor color;
+ color.cspec = ExtendedRgb;
+ castF16(color.ct.argbExtended.alphaF16) = qfloat16(ct.argb.alpha * f);
+ castF16(color.ct.argbExtended.redF16) = qfloat16(ct.argb.red * f);
+ castF16(color.ct.argbExtended.greenF16) = qfloat16(ct.argb.green * f);
+ castF16(color.ct.argbExtended.blueF16) = qfloat16(ct.argb.blue * f);
+ color.ct.argbExtended.pad = 0;
+ return color;
+}
+
+/*!
Create and returns an RGB QColor based on this color.
\sa fromRgb(), convertTo(), isValid()
*/
-QColor QColor::toRgb() const Q_DECL_NOTHROW
+QColor QColor::toRgb() const noexcept
{
if (!isValid() || cspec == Rgb)
return *this;
QColor color;
color.cspec = Rgb;
- color.ct.argb.alpha = ct.argb.alpha;
+ if (cspec != ExtendedRgb)
+ color.ct.argb.alpha = ct.argb.alpha;
color.ct.argb.pad = 0;
switch (cspec) {
@@ -2066,6 +2174,12 @@ QColor QColor::toRgb() const Q_DECL_NOTHROW
color.ct.argb.blue = qRound((qreal(1.0) - (y * (qreal(1.0) - k) + k)) * USHRT_MAX);
break;
}
+ case ExtendedRgb:
+ color.ct.argb.alpha = qRound(USHRT_MAX * qreal(castF16(ct.argbExtended.alphaF16)));
+ color.ct.argb.red = qRound(USHRT_MAX * qBound(qreal(0.0), qreal(castF16(ct.argbExtended.redF16)), qreal(1.0)));
+ color.ct.argb.green = qRound(USHRT_MAX * qBound(qreal(0.0), qreal(castF16(ct.argbExtended.greenF16)), qreal(1.0)));
+ color.ct.argb.blue = qRound(USHRT_MAX * qBound(qreal(0.0), qreal(castF16(ct.argbExtended.blueF16)), qreal(1.0)));
+ break;
default:
break;
}
@@ -2083,7 +2197,7 @@ QColor QColor::toRgb() const Q_DECL_NOTHROW
\sa fromHsv(), convertTo(), isValid(), {QColor#The HSV Color Model}{The HSV Color Model}
*/
-QColor QColor::toHsv() const Q_DECL_NOTHROW
+QColor QColor::toHsv() const noexcept
{
if (!isValid() || cspec == Hsv)
return *this;
@@ -2134,7 +2248,7 @@ QColor QColor::toHsv() const Q_DECL_NOTHROW
\sa fromHsl(), convertTo(), isValid(), {QColor#The HSL Color Model}{The HSL Color Model}
*/
-QColor QColor::toHsl() const Q_DECL_NOTHROW
+QColor QColor::toHsl() const noexcept
{
if (!isValid() || cspec == Hsl)
return *this;
@@ -2190,7 +2304,7 @@ QColor QColor::toHsl() const Q_DECL_NOTHROW
\sa fromCmyk(), convertTo(), isValid(), {QColor#The CMYK Color Model}{The CMYK Color Model}
*/
-QColor QColor::toCmyk() const Q_DECL_NOTHROW
+QColor QColor::toCmyk() const noexcept
{
if (!isValid() || cspec == Cmyk)
return *this;
@@ -2231,13 +2345,15 @@ QColor QColor::toCmyk() const Q_DECL_NOTHROW
return color;
}
-QColor QColor::convertTo(QColor::Spec colorSpec) const Q_DECL_NOTHROW
+QColor QColor::convertTo(QColor::Spec colorSpec) const noexcept
{
if (colorSpec == cspec)
return *this;
switch (colorSpec) {
case Rgb:
return toRgb();
+ case ExtendedRgb:
+ return toExtendedRgb();
case Hsv:
return toHsv();
case Cmyk:
@@ -2262,7 +2378,7 @@ QColor QColor::convertTo(QColor::Spec colorSpec) const Q_DECL_NOTHROW
\sa fromRgba(), fromRgbF(), toRgb(), isValid()
*/
-QColor QColor::fromRgb(QRgb rgb) Q_DECL_NOTHROW
+QColor QColor::fromRgb(QRgb rgb) noexcept
{
return fromRgb(qRed(rgb), qGreen(rgb), qBlue(rgb));
}
@@ -2278,7 +2394,7 @@ QColor QColor::fromRgb(QRgb rgb) Q_DECL_NOTHROW
\sa fromRgb(), fromRgba64(), isValid()
*/
-QColor QColor::fromRgba(QRgb rgba) Q_DECL_NOTHROW
+QColor QColor::fromRgba(QRgb rgba) noexcept
{
return fromRgb(qRed(rgba), qGreen(rgba), qBlue(rgba), qAlpha(rgba));
}
@@ -2294,10 +2410,7 @@ QColor QColor::fromRgba(QRgb rgba) Q_DECL_NOTHROW
*/
QColor QColor::fromRgb(int r, int g, int b, int a)
{
- if (r < 0 || r > 255
- || g < 0 || g > 255
- || b < 0 || b > 255
- || a < 0 || a > 255) {
+ if (!isRgbaValid(r, g, b, a)) {
qWarning("QColor::fromRgb: RGB parameters out of range");
return QColor();
}
@@ -2317,20 +2430,32 @@ QColor QColor::fromRgb(int r, int g, int b, int a)
color values, \a r (red), \a g (green), \a b (blue), and \a a
(alpha-channel, i.e. transparency).
- All the values must be in the range 0.0-1.0.
+ The alpha value must be in the range 0.0-1.0.
+ If any of the other values are outside the range of 0.0-1.0 the
+ color model will be set as \c ExtendedRgb.
\sa fromRgb(), fromRgba64(), toRgb(), isValid()
*/
QColor QColor::fromRgbF(qreal r, qreal g, qreal b, qreal a)
{
- if (r < qreal(0.0) || r > qreal(1.0)
- || g < qreal(0.0) || g > qreal(1.0)
- || b < qreal(0.0) || b > qreal(1.0)
- || a < qreal(0.0) || a > qreal(1.0)) {
- qWarning("QColor::fromRgbF: RGB parameters out of range");
+ if (a < qreal(0.0) || a > qreal(1.0)) {
+ qWarning("QColor::fromRgbF: Alpha parameter out of range");
return QColor();
}
+ if (r < qreal(0.0) || r > qreal(1.0)
+ || g < qreal(0.0) || g > qreal(1.0)
+ || b < qreal(0.0) || b > qreal(1.0)) {
+ QColor color;
+ color.cspec = ExtendedRgb;
+ castF16(color.ct.argbExtended.alphaF16) = qfloat16(a);
+ castF16(color.ct.argbExtended.redF16) = qfloat16(r);
+ castF16(color.ct.argbExtended.greenF16) = qfloat16(g);
+ castF16(color.ct.argbExtended.blueF16) = qfloat16(b);
+ color.ct.argbExtended.pad = 0;
+ return color;
+ }
+
QColor color;
color.cspec = Rgb;
color.ct.argb.alpha = qRound(a * USHRT_MAX);
@@ -2351,7 +2476,7 @@ QColor QColor::fromRgbF(qreal r, qreal g, qreal b, qreal a)
\sa fromRgb(), fromRgbF(), toRgb(), isValid()
*/
-QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a) Q_DECL_NOTHROW
+QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a) noexcept
{
QColor color;
color.setRgba64(qRgba64(r, g, b, a));
@@ -2366,7 +2491,7 @@ QColor QColor::fromRgba64(ushort r, ushort g, ushort b, ushort a) Q_DECL_NOTHROW
\sa fromRgb(), fromRgbF(), toRgb(), isValid()
*/
-QColor QColor::fromRgba64(QRgba64 rgba64) Q_DECL_NOTHROW
+QColor QColor::fromRgba64(QRgba64 rgba64) noexcept
{
QColor color;
color.setRgba64(rgba64);
@@ -2714,7 +2839,7 @@ QColor QColor::fromCmykF(qreal c, qreal m, qreal y, qreal k, qreal a)
\sa darker(), isValid()
*/
-QColor QColor::lighter(int factor) const Q_DECL_NOTHROW
+QColor QColor::lighter(int factor) const noexcept
{
if (factor <= 0) // invalid lightness factor
return *this;
@@ -2759,7 +2884,7 @@ QColor QColor::lighter(int factor) const Q_DECL_NOTHROW
\sa lighter(), isValid()
*/
-QColor QColor::darker(int factor) const Q_DECL_NOTHROW
+QColor QColor::darker(int factor) const noexcept
{
if (factor <= 0) // invalid darkness factor
return *this;
@@ -2779,7 +2904,7 @@ QColor QColor::darker(int factor) const Q_DECL_NOTHROW
Use lighter(\a factor) instead.
*/
-QColor QColor::light(int factor) const Q_DECL_NOTHROW
+QColor QColor::light(int factor) const noexcept
{
return lighter(factor);
}
@@ -2789,7 +2914,7 @@ QColor QColor::light(int factor) const Q_DECL_NOTHROW
Use darker(\a factor) instead.
*/
-QColor QColor::dark(int factor) const Q_DECL_NOTHROW
+QColor QColor::dark(int factor) const noexcept
{
return darker(factor);
}
@@ -2799,7 +2924,7 @@ QColor QColor::dark(int factor) const Q_DECL_NOTHROW
/*!
Assigns a copy of \a color to this color, and returns a reference to it.
*/
-QColor &QColor::operator=(const QColor &color) Q_DECL_NOTHROW
+QColor &QColor::operator=(const QColor &color) noexcept
{
cspec = color.cspec;
ct.argb = color.ct.argb;
@@ -2810,7 +2935,7 @@ QColor &QColor::operator=(const QColor &color) Q_DECL_NOTHROW
/*! \overload
Assigns a copy of \a color and returns a reference to this color.
*/
-QColor &QColor::operator=(Qt::GlobalColor color) Q_DECL_NOTHROW
+QColor &QColor::operator=(Qt::GlobalColor color) noexcept
{
return operator=(QColor(color));
}
@@ -2819,7 +2944,7 @@ QColor &QColor::operator=(Qt::GlobalColor color) Q_DECL_NOTHROW
Returns \c true if this color has the same RGB and alpha values as \a color;
otherwise returns \c false.
*/
-bool QColor::operator==(const QColor &color) const Q_DECL_NOTHROW
+bool QColor::operator==(const QColor &color) const noexcept
{
if (cspec == Hsl && cspec == color.cspec) {
return (ct.argb.alpha == color.ct.argb.alpha
@@ -2846,7 +2971,7 @@ bool QColor::operator==(const QColor &color) const Q_DECL_NOTHROW
Returns \c true if this color has a different RGB and alpha values from
\a color; otherwise returns \c false.
*/
-bool QColor::operator!=(const QColor &color) const Q_DECL_NOTHROW
+bool QColor::operator!=(const QColor &color) const noexcept
{ return !operator==(color); }
@@ -2863,7 +2988,7 @@ QColor::operator QVariant() const
Marks the color as invalid and sets all components to zero (alpha is set
to fully opaque for compatibility with Qt 3).
*/
-void QColor::invalidate() Q_DECL_NOTHROW
+void QColor::invalidate() noexcept
{
cspec = Invalid;
ct.argb.alpha = USHRT_MAX;
@@ -2885,6 +3010,8 @@ QDebug operator<<(QDebug dbg, const QColor &c)
dbg.nospace() << "QColor(Invalid)";
else if (c.spec() == QColor::Rgb)
dbg.nospace() << "QColor(ARGB " << c.alphaF() << ", " << c.redF() << ", " << c.greenF() << ", " << c.blueF() << ')';
+ else if (c.spec() == QColor::ExtendedRgb)
+ dbg.nospace() << "QColor(Ext. ARGB " << c.alphaF() << ", " << c.redF() << ", " << c.greenF() << ", " << c.blueF() << ')';
else if (c.spec() == QColor::Hsv)
dbg.nospace() << "QColor(AHSV " << c.alphaF() << ", " << c.hueF() << ", " << c.saturationF() << ", " << c.valueF() << ')';
else if (c.spec() == QColor::Cmyk)
@@ -3134,4 +3261,41 @@ const uint qt_inv_premul_factor[256] = {
\sa QColor::rgb(), QColor::rgba()
*/
+/*!
+ \namespace QColorConstants
+ \inmodule QtGui
+
+ \brief The QColorConstants namespace contains QColor predefined constants.
+
+ These constants are usable everywhere a QColor object is expected:
+
+ \code
+ painter.setBrush(QColorConstants::Svg::lightblue);
+ \endcode
+
+ Their usage is much cheaper than e.g. passing a string to QColor's constructor,
+ as they don't require any parsing of the string, and always result in a valid
+ QColor object:
+
+ \badcode
+ object.setColor(QColor("lightblue")); // expensive
+ \endcode
+
+ \section1 Qt Colors
+
+ The following colors are defined in the \c{QColorConstants} namespace:
+
+ \include qt-colors.qdocinc
+
+ \section1 SVG Colors
+
+ The following table lists the available
+ \l {http://www.w3.org/TR/SVG/types.html#ColorKeywords}{SVG colors}.
+ They are available in the \c{QColorConstants::Svg} inner namespace.
+
+ \include svg-colors.qdocinc
+
+ \sa QColor, Qt::GlobalColor
+*/
+
QT_END_NAMESPACE
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index 4822612cf8..f0d7dd23ad 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -64,35 +64,43 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);
class Q_GUI_EXPORT QColor
{
public:
- enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl };
+ enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl, ExtendedRgb };
enum NameFormat { HexRgb, HexArgb };
- inline QColor() Q_DECL_NOTHROW;
- QColor(Qt::GlobalColor color) Q_DECL_NOTHROW;
- inline QColor(int r, int g, int b, int a = 255);
- QColor(QRgb rgb) Q_DECL_NOTHROW;
- QColor(QRgba64 rgba64) Q_DECL_NOTHROW;
+ Q_DECL_CONSTEXPR QColor() noexcept
+ : cspec(Invalid), ct(USHRT_MAX, 0, 0, 0, 0) {}
+ QColor(Qt::GlobalColor color) noexcept;
+ Q_DECL_CONSTEXPR QColor(int r, int g, int b, int a = 255) noexcept
+ : cspec(isRgbaValid(r, g, b, a) ? Rgb : Invalid),
+ ct(cspec == Rgb ? a * 0x0101 : 0,
+ cspec == Rgb ? r * 0x0101 : 0,
+ cspec == Rgb ? g * 0x0101 : 0,
+ cspec == Rgb ? b * 0x0101 : 0,
+ 0) {}
+ QColor(QRgb rgb) noexcept;
+ QColor(QRgba64 rgba64) noexcept;
#if QT_STRINGVIEW_LEVEL < 2
inline QColor(const QString& name);
#endif
explicit inline QColor(QStringView name);
inline QColor(const char *aname) : QColor(QLatin1String(aname)) {}
inline QColor(QLatin1String name);
- QColor(Spec spec) Q_DECL_NOTHROW;
+ QColor(Spec spec) noexcept;
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- inline QColor(const QColor &color) Q_DECL_NOTHROW; // ### Qt 6: remove all of these, the trivial ones are fine.
-# ifdef Q_COMPILER_RVALUE_REFS
- QColor(QColor &&other) Q_DECL_NOTHROW : cspec(other.cspec), ct(other.ct) {}
- QColor &operator=(QColor &&other) Q_DECL_NOTHROW
+ // ### Qt 6: remove all of these, the trivial ones are fine.
+ Q_DECL_CONSTEXPR QColor(const QColor &color) noexcept
+ : cspec(color.cspec), ct(color.ct)
+ {}
+ Q_DECL_CONSTEXPR QColor(QColor &&other) noexcept : cspec(other.cspec), ct(other.ct) {}
+ QColor &operator=(QColor &&other) noexcept
{ cspec = other.cspec; ct = other.ct; return *this; }
-# endif
- QColor &operator=(const QColor &) Q_DECL_NOTHROW;
+ QColor &operator=(const QColor &) noexcept;
#endif // Qt < 6
- QColor &operator=(Qt::GlobalColor color) Q_DECL_NOTHROW;
+ QColor &operator=(Qt::GlobalColor color) noexcept;
- bool isValid() const Q_DECL_NOTHROW;
+ bool isValid() const noexcept;
// ### Qt 6: merge overloads
QString name() const;
@@ -106,25 +114,25 @@ public:
static QStringList colorNames();
- inline Spec spec() const Q_DECL_NOTHROW
+ inline Spec spec() const noexcept
{ return cspec; }
- int alpha() const Q_DECL_NOTHROW;
+ int alpha() const noexcept;
void setAlpha(int alpha);
- qreal alphaF() const Q_DECL_NOTHROW;
+ qreal alphaF() const noexcept;
void setAlphaF(qreal alpha);
- int red() const Q_DECL_NOTHROW;
- int green() const Q_DECL_NOTHROW;
- int blue() const Q_DECL_NOTHROW;
+ int red() const noexcept;
+ int green() const noexcept;
+ int blue() const noexcept;
void setRed(int red);
void setGreen(int green);
void setBlue(int blue);
- qreal redF() const Q_DECL_NOTHROW;
- qreal greenF() const Q_DECL_NOTHROW;
- qreal blueF() const Q_DECL_NOTHROW;
+ qreal redF() const noexcept;
+ qreal greenF() const noexcept;
+ qreal blueF() const noexcept;
void setRedF(qreal red);
void setGreenF(qreal green);
void setBlueF(qreal blue);
@@ -135,26 +143,26 @@ public:
void getRgbF(qreal *r, qreal *g, qreal *b, qreal *a = nullptr) const;
void setRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
- QRgba64 rgba64() const Q_DECL_NOTHROW;
- void setRgba64(QRgba64 rgba) Q_DECL_NOTHROW;
+ QRgba64 rgba64() const noexcept;
+ void setRgba64(QRgba64 rgba) noexcept;
- QRgb rgba() const Q_DECL_NOTHROW;
- void setRgba(QRgb rgba) Q_DECL_NOTHROW;
+ QRgb rgba() const noexcept;
+ void setRgba(QRgb rgba) noexcept;
- QRgb rgb() const Q_DECL_NOTHROW;
- void setRgb(QRgb rgb) Q_DECL_NOTHROW;
+ QRgb rgb() const noexcept;
+ void setRgb(QRgb rgb) noexcept;
- int hue() const Q_DECL_NOTHROW; // 0 <= hue < 360
- int saturation() const Q_DECL_NOTHROW;
- int hsvHue() const Q_DECL_NOTHROW; // 0 <= hue < 360
- int hsvSaturation() const Q_DECL_NOTHROW;
- int value() const Q_DECL_NOTHROW;
+ int hue() const noexcept; // 0 <= hue < 360
+ int saturation() const noexcept;
+ int hsvHue() const noexcept; // 0 <= hue < 360
+ int hsvSaturation() const noexcept;
+ int value() const noexcept;
- qreal hueF() const Q_DECL_NOTHROW; // 0.0 <= hueF < 360.0
- qreal saturationF() const Q_DECL_NOTHROW;
- qreal hsvHueF() const Q_DECL_NOTHROW; // 0.0 <= hueF < 360.0
- qreal hsvSaturationF() const Q_DECL_NOTHROW;
- qreal valueF() const Q_DECL_NOTHROW;
+ qreal hueF() const noexcept; // 0.0 <= hueF < 360.0
+ qreal saturationF() const noexcept;
+ qreal hsvHueF() const noexcept; // 0.0 <= hueF < 360.0
+ qreal hsvSaturationF() const noexcept;
+ qreal valueF() const noexcept;
void getHsv(int *h, int *s, int *v, int *a = nullptr) const;
void setHsv(int h, int s, int v, int a = 255);
@@ -162,15 +170,15 @@ public:
void getHsvF(qreal *h, qreal *s, qreal *v, qreal *a = nullptr) const;
void setHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
- int cyan() const Q_DECL_NOTHROW;
- int magenta() const Q_DECL_NOTHROW;
- int yellow() const Q_DECL_NOTHROW;
- int black() const Q_DECL_NOTHROW;
+ int cyan() const noexcept;
+ int magenta() const noexcept;
+ int yellow() const noexcept;
+ int black() const noexcept;
- qreal cyanF() const Q_DECL_NOTHROW;
- qreal magentaF() const Q_DECL_NOTHROW;
- qreal yellowF() const Q_DECL_NOTHROW;
- qreal blackF() const Q_DECL_NOTHROW;
+ qreal cyanF() const noexcept;
+ qreal magentaF() const noexcept;
+ qreal yellowF() const noexcept;
+ qreal blackF() const noexcept;
void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr); // ### Qt 6: remove
void getCmyk(int *c, int *m, int *y, int *k, int *a = nullptr) const;
@@ -180,13 +188,13 @@ public:
void getCmykF(qreal *c, qreal *m, qreal *y, qreal *k, qreal *a = nullptr) const;
void setCmykF(qreal c, qreal m, qreal y, qreal k, qreal a = 1.0);
- int hslHue() const Q_DECL_NOTHROW; // 0 <= hue < 360
- int hslSaturation() const Q_DECL_NOTHROW;
- int lightness() const Q_DECL_NOTHROW;
+ int hslHue() const noexcept; // 0 <= hue < 360
+ int hslSaturation() const noexcept;
+ int lightness() const noexcept;
- qreal hslHueF() const Q_DECL_NOTHROW; // 0.0 <= hueF < 360.0
- qreal hslSaturationF() const Q_DECL_NOTHROW;
- qreal lightnessF() const Q_DECL_NOTHROW;
+ qreal hslHueF() const noexcept; // 0.0 <= hueF < 360.0
+ qreal hslSaturationF() const noexcept;
+ qreal lightnessF() const noexcept;
void getHsl(int *h, int *s, int *l, int *a = nullptr) const;
void setHsl(int h, int s, int l, int a = 255);
@@ -194,21 +202,22 @@ public:
void getHslF(qreal *h, qreal *s, qreal *l, qreal *a = nullptr) const;
void setHslF(qreal h, qreal s, qreal l, qreal a = 1.0);
- QColor toRgb() const Q_DECL_NOTHROW;
- QColor toHsv() const Q_DECL_NOTHROW;
- QColor toCmyk() const Q_DECL_NOTHROW;
- QColor toHsl() const Q_DECL_NOTHROW;
+ QColor toRgb() const noexcept;
+ QColor toHsv() const noexcept;
+ QColor toCmyk() const noexcept;
+ QColor toHsl() const noexcept;
+ QColor toExtendedRgb() const noexcept;
- Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor convertTo(Spec colorSpec) const noexcept;
- static QColor fromRgb(QRgb rgb) Q_DECL_NOTHROW;
- static QColor fromRgba(QRgb rgba) Q_DECL_NOTHROW;
+ static QColor fromRgb(QRgb rgb) noexcept;
+ static QColor fromRgba(QRgb rgba) noexcept;
static QColor fromRgb(int r, int g, int b, int a = 255);
static QColor fromRgbF(qreal r, qreal g, qreal b, qreal a = 1.0);
- static QColor fromRgba64(ushort r, ushort g, ushort b, ushort a = USHRT_MAX) Q_DECL_NOTHROW;
- static QColor fromRgba64(QRgba64 rgba) Q_DECL_NOTHROW;
+ static QColor fromRgba64(ushort r, ushort g, ushort b, ushort a = USHRT_MAX) noexcept;
+ static QColor fromRgba64(QRgba64 rgba) noexcept;
static QColor fromHsv(int h, int s, int v, int a = 255);
static QColor fromHsvF(qreal h, qreal s, qreal v, qreal a = 1.0);
@@ -221,32 +230,42 @@ public:
#if QT_DEPRECATED_SINCE(5, 13)
QT_DEPRECATED_X("Use QColor::lighter() instead")
- Q_REQUIRED_RESULT QColor light(int f = 150) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor light(int f = 150) const noexcept;
QT_DEPRECATED_X("Use QColor::darker() instead")
- Q_REQUIRED_RESULT QColor dark(int f = 200) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor dark(int f = 200) const noexcept;
#endif
- Q_REQUIRED_RESULT QColor lighter(int f = 150) const Q_DECL_NOTHROW;
- Q_REQUIRED_RESULT QColor darker(int f = 200) const Q_DECL_NOTHROW;
+ Q_REQUIRED_RESULT QColor lighter(int f = 150) const noexcept;
+ Q_REQUIRED_RESULT QColor darker(int f = 200) const noexcept;
- bool operator==(const QColor &c) const Q_DECL_NOTHROW;
- bool operator!=(const QColor &c) const Q_DECL_NOTHROW;
+ bool operator==(const QColor &c) const noexcept;
+ bool operator!=(const QColor &c) const noexcept;
operator QVariant() const;
#if QT_STRINGVIEW_LEVEL < 2
static bool isValidColor(const QString &name);
#endif
- static bool isValidColor(QStringView) Q_DECL_NOTHROW;
- static bool isValidColor(QLatin1String) Q_DECL_NOTHROW;
+ static bool isValidColor(QStringView) noexcept;
+ static bool isValidColor(QLatin1String) noexcept;
private:
- void invalidate() Q_DECL_NOTHROW;
+ void invalidate() noexcept;
template <typename String>
bool setColorFromString(String name);
+ static Q_DECL_CONSTEXPR bool isRgbaValid(int r, int g, int b, int a = 255) noexcept Q_DECL_CONST_FUNCTION
+ {
+ return uint(r) <= 255 && uint(g) <= 255 && uint(b) <= 255 && uint(a) <= 255;
+ }
+
Spec cspec;
- union {
+ union CT {
+#ifdef Q_COMPILER_UNIFORM_INIT
+ CT() {} // doesn't init anything, thus can't be constexpr
+ Q_DECL_CONSTEXPR explicit CT(ushort a1, ushort a2, ushort a3, ushort a4, ushort a5) noexcept
+ : array{a1, a2, a3, a4, a5} {}
+#endif
struct {
ushort alpha;
ushort red;
@@ -275,6 +294,13 @@ private:
ushort lightness;
ushort pad;
} ahsl;
+ struct {
+ ushort alphaF16;
+ ushort redF16;
+ ushort greenF16;
+ ushort blueF16;
+ ushort pad;
+ } argbExtended;
ushort array[5];
} ct;
@@ -283,15 +309,15 @@ private:
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColor &);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);
#endif
+
+#ifdef Q_COMPILER_UNIFORM_INIT
+public: // can't give friendship to a namespace, so it needs to be public
+ Q_DECL_CONSTEXPR explicit QColor(Spec spec, ushort a1, ushort a2, ushort a3, ushort a4, ushort a5=0) noexcept
+ : cspec(spec), ct(a1, a2, a3, a4, a5) {}
+#endif // Q_COMPILER_UNIFORM_INIT
};
Q_DECLARE_TYPEINFO(QColor, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE);
-inline QColor::QColor() Q_DECL_NOTHROW
-{ invalidate(); }
-
-inline QColor::QColor(int r, int g, int b, int a)
-{ setRgb(r, g, b, a); }
-
inline QColor::QColor(QLatin1String aname)
{ setNamedColor(aname); }
@@ -303,15 +329,190 @@ inline QColor::QColor(const QString& aname)
{ setNamedColor(aname); }
#endif
-#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
-inline QColor::QColor(const QColor &acolor) Q_DECL_NOTHROW
- : cspec(acolor.cspec)
-{ ct.argb = acolor.ct.argb; }
-#endif
-
-inline bool QColor::isValid() const Q_DECL_NOTHROW
+inline bool QColor::isValid() const noexcept
{ return cspec != Invalid; }
+// define these namespaces even if the contents are ifdef'd out
+namespace QColorConstants
+{
+namespace Svg {}
+
+#if defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT)
+ // Qt::GlobalColor names
+ constexpr Q_DECL_UNUSED QColor Color0 {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor Color1 {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor Black {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor White {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkGray {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor Gray {QColor::Rgb, 0xff * 0x101, 0xa0 * 0x101, 0xa0 * 0x101, 0xa4 * 0x101};
+ constexpr Q_DECL_UNUSED QColor LightGray {QColor::Rgb, 0xff * 0x101, 0xc0 * 0x101, 0xc0 * 0x101, 0xc0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor Red {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor Green {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor Blue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor Cyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor Magenta {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor Yellow {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkRed {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkGreen {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkBlue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkCyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkMagenta {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor DarkYellow {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor Transparent {QColor::Rgb, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+
+ // SVG names supported by QColor (see qcolor.cpp).
+namespace Svg {
+ constexpr Q_DECL_UNUSED QColor aliceblue {QColor::Rgb, 0xff * 0x101, 0xf0 * 0x101, 0xf8 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor antiquewhite {QColor::Rgb, 0xff * 0x101, 0xfa * 0x101, 0xeb * 0x101, 0xd7 * 0x101};
+ constexpr Q_DECL_UNUSED QColor aqua {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor aquamarine {QColor::Rgb, 0xff * 0x101, 0x7f * 0x101, 0xff * 0x101, 0xd4 * 0x101};
+ constexpr Q_DECL_UNUSED QColor azure {QColor::Rgb, 0xff * 0x101, 0xf0 * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor beige {QColor::Rgb, 0xff * 0x101, 0xf5 * 0x101, 0xf5 * 0x101, 0xdc * 0x101};
+ constexpr Q_DECL_UNUSED QColor bisque {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xe4 * 0x101, 0xc4 * 0x101};
+ constexpr Q_DECL_UNUSED QColor black {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor blanchedalmond {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xeb * 0x101, 0xcd * 0x101};
+ constexpr Q_DECL_UNUSED QColor blue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor blueviolet {QColor::Rgb, 0xff * 0x101, 0x8a * 0x101, 0x2b * 0x101, 0xe2 * 0x101};
+ constexpr Q_DECL_UNUSED QColor brown {QColor::Rgb, 0xff * 0x101, 0xa5 * 0x101, 0x2a * 0x101, 0x2a * 0x101};
+ constexpr Q_DECL_UNUSED QColor burlywood {QColor::Rgb, 0xff * 0x101, 0xde * 0x101, 0xb8 * 0x101, 0x87 * 0x101};
+ constexpr Q_DECL_UNUSED QColor cadetblue {QColor::Rgb, 0xff * 0x101, 0x5f * 0x101, 0x9e * 0x101, 0xa0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor chartreuse {QColor::Rgb, 0xff * 0x101, 0x7f * 0x101, 0xff * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor chocolate {QColor::Rgb, 0xff * 0x101, 0xd2 * 0x101, 0x69 * 0x101, 0x1e * 0x101};
+ constexpr Q_DECL_UNUSED QColor coral {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x7f * 0x101, 0x50 * 0x101};
+ constexpr Q_DECL_UNUSED QColor cornflowerblue {QColor::Rgb, 0xff * 0x101, 0x64 * 0x101, 0x95 * 0x101, 0xed * 0x101};
+ constexpr Q_DECL_UNUSED QColor cornsilk {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xf8 * 0x101, 0xdc * 0x101};
+ constexpr Q_DECL_UNUSED QColor crimson {QColor::Rgb, 0xff * 0x101, 0xdc * 0x101, 0x14 * 0x101, 0x3c * 0x101};
+ constexpr Q_DECL_UNUSED QColor cyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkblue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x8b * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkcyan {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x8b * 0x101, 0x8b * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkgoldenrod {QColor::Rgb, 0xff * 0x101, 0xb8 * 0x101, 0x86 * 0x101, 0x0b * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkgray {QColor::Rgb, 0xff * 0x101, 0xa9 * 0x101, 0xa9 * 0x101, 0xa9 * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkgreen {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x64 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkgrey {QColor::Rgb, 0xff * 0x101, 0xa9 * 0x101, 0xa9 * 0x101, 0xa9 * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkkhaki {QColor::Rgb, 0xff * 0x101, 0xbd * 0x101, 0xb7 * 0x101, 0x6b * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkmagenta {QColor::Rgb, 0xff * 0x101, 0x8b * 0x101, 0x00 * 0x101, 0x8b * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkolivegreen {QColor::Rgb, 0xff * 0x101, 0x55 * 0x101, 0x6b * 0x101, 0x2f * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkorange {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x8c * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkorchid {QColor::Rgb, 0xff * 0x101, 0x99 * 0x101, 0x32 * 0x101, 0xcc * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkred {QColor::Rgb, 0xff * 0x101, 0x8b * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor darksalmon {QColor::Rgb, 0xff * 0x101, 0xe9 * 0x101, 0x96 * 0x101, 0x7a * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkseagreen {QColor::Rgb, 0xff * 0x101, 0x8f * 0x101, 0xbc * 0x101, 0x8f * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkslateblue {QColor::Rgb, 0xff * 0x101, 0x48 * 0x101, 0x3d * 0x101, 0x8b * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkslategray {QColor::Rgb, 0xff * 0x101, 0x2f * 0x101, 0x4f * 0x101, 0x4f * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkslategrey {QColor::Rgb, 0xff * 0x101, 0x2f * 0x101, 0x4f * 0x101, 0x4f * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkturquoise {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xce * 0x101, 0xd1 * 0x101};
+ constexpr Q_DECL_UNUSED QColor darkviolet {QColor::Rgb, 0xff * 0x101, 0x94 * 0x101, 0x00 * 0x101, 0xd3 * 0x101};
+ constexpr Q_DECL_UNUSED QColor deeppink {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x14 * 0x101, 0x93 * 0x101};
+ constexpr Q_DECL_UNUSED QColor deepskyblue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xbf * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor dimgray {QColor::Rgb, 0xff * 0x101, 0x69 * 0x101, 0x69 * 0x101, 0x69 * 0x101};
+ constexpr Q_DECL_UNUSED QColor dimgrey {QColor::Rgb, 0xff * 0x101, 0x69 * 0x101, 0x69 * 0x101, 0x69 * 0x101};
+ constexpr Q_DECL_UNUSED QColor dodgerblue {QColor::Rgb, 0xff * 0x101, 0x1e * 0x101, 0x90 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor firebrick {QColor::Rgb, 0xff * 0x101, 0xb2 * 0x101, 0x22 * 0x101, 0x22 * 0x101};
+ constexpr Q_DECL_UNUSED QColor floralwhite {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xfa * 0x101, 0xf0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor forestgreen {QColor::Rgb, 0xff * 0x101, 0x22 * 0x101, 0x8b * 0x101, 0x22 * 0x101};
+ constexpr Q_DECL_UNUSED QColor fuchsia {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor gainsboro {QColor::Rgb, 0xff * 0x101, 0xdc * 0x101, 0xdc * 0x101, 0xdc * 0x101};
+ constexpr Q_DECL_UNUSED QColor ghostwhite {QColor::Rgb, 0xff * 0x101, 0xf8 * 0x101, 0xf8 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor gold {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xd7 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor goldenrod {QColor::Rgb, 0xff * 0x101, 0xda * 0x101, 0xa5 * 0x101, 0x20 * 0x101};
+ constexpr Q_DECL_UNUSED QColor gray {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor green {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor greenyellow {QColor::Rgb, 0xff * 0x101, 0xad * 0x101, 0xff * 0x101, 0x2f * 0x101};
+ constexpr Q_DECL_UNUSED QColor grey {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor honeydew {QColor::Rgb, 0xff * 0x101, 0xf0 * 0x101, 0xff * 0x101, 0xf0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor hotpink {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x69 * 0x101, 0xb4 * 0x101};
+ constexpr Q_DECL_UNUSED QColor indianred {QColor::Rgb, 0xff * 0x101, 0xcd * 0x101, 0x5c * 0x101, 0x5c * 0x101};
+ constexpr Q_DECL_UNUSED QColor indigo {QColor::Rgb, 0xff * 0x101, 0x4b * 0x101, 0x00 * 0x101, 0x82 * 0x101};
+ constexpr Q_DECL_UNUSED QColor ivory {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xf0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor khaki {QColor::Rgb, 0xff * 0x101, 0xf0 * 0x101, 0xe6 * 0x101, 0x8c * 0x101};
+ constexpr Q_DECL_UNUSED QColor lavender {QColor::Rgb, 0xff * 0x101, 0xe6 * 0x101, 0xe6 * 0x101, 0xfa * 0x101};
+ constexpr Q_DECL_UNUSED QColor lavenderblush {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xf0 * 0x101, 0xf5 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lawngreen {QColor::Rgb, 0xff * 0x101, 0x7c * 0x101, 0xfc * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lemonchiffon {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xfa * 0x101, 0xcd * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightblue {QColor::Rgb, 0xff * 0x101, 0xad * 0x101, 0xd8 * 0x101, 0xe6 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightcoral {QColor::Rgb, 0xff * 0x101, 0xf0 * 0x101, 0x80 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightcyan {QColor::Rgb, 0xff * 0x101, 0xe0 * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightgoldenrodyellow {QColor::Rgb, 0xff * 0x101, 0xfa * 0x101, 0xfa * 0x101, 0xd2 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightgray {QColor::Rgb, 0xff * 0x101, 0xd3 * 0x101, 0xd3 * 0x101, 0xd3 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightgreen {QColor::Rgb, 0xff * 0x101, 0x90 * 0x101, 0xee * 0x101, 0x90 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightgrey {QColor::Rgb, 0xff * 0x101, 0xd3 * 0x101, 0xd3 * 0x101, 0xd3 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightpink {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xb6 * 0x101, 0xc1 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightsalmon {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xa0 * 0x101, 0x7a * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightseagreen {QColor::Rgb, 0xff * 0x101, 0x20 * 0x101, 0xb2 * 0x101, 0xaa * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightskyblue {QColor::Rgb, 0xff * 0x101, 0x87 * 0x101, 0xce * 0x101, 0xfa * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightslategray {QColor::Rgb, 0xff * 0x101, 0x77 * 0x101, 0x88 * 0x101, 0x99 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightslategrey {QColor::Rgb, 0xff * 0x101, 0x77 * 0x101, 0x88 * 0x101, 0x99 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightsteelblue {QColor::Rgb, 0xff * 0x101, 0xb0 * 0x101, 0xc4 * 0x101, 0xde * 0x101};
+ constexpr Q_DECL_UNUSED QColor lightyellow {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xe0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor lime {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor limegreen {QColor::Rgb, 0xff * 0x101, 0x32 * 0x101, 0xcd * 0x101, 0x32 * 0x101};
+ constexpr Q_DECL_UNUSED QColor linen {QColor::Rgb, 0xff * 0x101, 0xfa * 0x101, 0xf0 * 0x101, 0xe6 * 0x101};
+ constexpr Q_DECL_UNUSED QColor magenta {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor maroon {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumaquamarine {QColor::Rgb, 0xff * 0x101, 0x66 * 0x101, 0xcd * 0x101, 0xaa * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumblue {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0xcd * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumorchid {QColor::Rgb, 0xff * 0x101, 0xba * 0x101, 0x55 * 0x101, 0xd3 * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumpurple {QColor::Rgb, 0xff * 0x101, 0x93 * 0x101, 0x70 * 0x101, 0xdb * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumseagreen {QColor::Rgb, 0xff * 0x101, 0x3c * 0x101, 0xb3 * 0x101, 0x71 * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumslateblue {QColor::Rgb, 0xff * 0x101, 0x7b * 0x101, 0x68 * 0x101, 0xee * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumspringgreen {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xfa * 0x101, 0x9a * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumturquoise {QColor::Rgb, 0xff * 0x101, 0x48 * 0x101, 0xd1 * 0x101, 0xcc * 0x101};
+ constexpr Q_DECL_UNUSED QColor mediumvioletred {QColor::Rgb, 0xff * 0x101, 0xc7 * 0x101, 0x15 * 0x101, 0x85 * 0x101};
+ constexpr Q_DECL_UNUSED QColor midnightblue {QColor::Rgb, 0xff * 0x101, 0x19 * 0x101, 0x19 * 0x101, 0x70 * 0x101};
+ constexpr Q_DECL_UNUSED QColor mintcream {QColor::Rgb, 0xff * 0x101, 0xf5 * 0x101, 0xff * 0x101, 0xfa * 0x101};
+ constexpr Q_DECL_UNUSED QColor mistyrose {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xe4 * 0x101, 0xe1 * 0x101};
+ constexpr Q_DECL_UNUSED QColor moccasin {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xe4 * 0x101, 0xb5 * 0x101};
+ constexpr Q_DECL_UNUSED QColor navajowhite {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xde * 0x101, 0xad * 0x101};
+ constexpr Q_DECL_UNUSED QColor navy {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor oldlace {QColor::Rgb, 0xff * 0x101, 0xfd * 0x101, 0xf5 * 0x101, 0xe6 * 0x101};
+ constexpr Q_DECL_UNUSED QColor olive {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x80 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor olivedrab {QColor::Rgb, 0xff * 0x101, 0x6b * 0x101, 0x8e * 0x101, 0x23 * 0x101};
+ constexpr Q_DECL_UNUSED QColor orange {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xa5 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor orangered {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x45 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor orchid {QColor::Rgb, 0xff * 0x101, 0xda * 0x101, 0x70 * 0x101, 0xd6 * 0x101};
+ constexpr Q_DECL_UNUSED QColor palegoldenrod {QColor::Rgb, 0xff * 0x101, 0xee * 0x101, 0xe8 * 0x101, 0xaa * 0x101};
+ constexpr Q_DECL_UNUSED QColor palegreen {QColor::Rgb, 0xff * 0x101, 0x98 * 0x101, 0xfb * 0x101, 0x98 * 0x101};
+ constexpr Q_DECL_UNUSED QColor paleturquoise {QColor::Rgb, 0xff * 0x101, 0xaf * 0x101, 0xee * 0x101, 0xee * 0x101};
+ constexpr Q_DECL_UNUSED QColor palevioletred {QColor::Rgb, 0xff * 0x101, 0xdb * 0x101, 0x70 * 0x101, 0x93 * 0x101};
+ constexpr Q_DECL_UNUSED QColor papayawhip {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xef * 0x101, 0xd5 * 0x101};
+ constexpr Q_DECL_UNUSED QColor peachpuff {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xda * 0x101, 0xb9 * 0x101};
+ constexpr Q_DECL_UNUSED QColor peru {QColor::Rgb, 0xff * 0x101, 0xcd * 0x101, 0x85 * 0x101, 0x3f * 0x101};
+ constexpr Q_DECL_UNUSED QColor pink {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xc0 * 0x101, 0xcb * 0x101};
+ constexpr Q_DECL_UNUSED QColor plum {QColor::Rgb, 0xff * 0x101, 0xdd * 0x101, 0xa0 * 0x101, 0xdd * 0x101};
+ constexpr Q_DECL_UNUSED QColor powderblue {QColor::Rgb, 0xff * 0x101, 0xb0 * 0x101, 0xe0 * 0x101, 0xe6 * 0x101};
+ constexpr Q_DECL_UNUSED QColor purple {QColor::Rgb, 0xff * 0x101, 0x80 * 0x101, 0x00 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor red {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor rosybrown {QColor::Rgb, 0xff * 0x101, 0xbc * 0x101, 0x8f * 0x101, 0x8f * 0x101};
+ constexpr Q_DECL_UNUSED QColor royalblue {QColor::Rgb, 0xff * 0x101, 0x41 * 0x101, 0x69 * 0x101, 0xe1 * 0x101};
+ constexpr Q_DECL_UNUSED QColor saddlebrown {QColor::Rgb, 0xff * 0x101, 0x8b * 0x101, 0x45 * 0x101, 0x13 * 0x101};
+ constexpr Q_DECL_UNUSED QColor salmon {QColor::Rgb, 0xff * 0x101, 0xfa * 0x101, 0x80 * 0x101, 0x72 * 0x101};
+ constexpr Q_DECL_UNUSED QColor sandybrown {QColor::Rgb, 0xff * 0x101, 0xf4 * 0x101, 0xa4 * 0x101, 0x60 * 0x101};
+ constexpr Q_DECL_UNUSED QColor seagreen {QColor::Rgb, 0xff * 0x101, 0x2e * 0x101, 0x8b * 0x101, 0x57 * 0x101};
+ constexpr Q_DECL_UNUSED QColor seashell {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xf5 * 0x101, 0xee * 0x101};
+ constexpr Q_DECL_UNUSED QColor sienna {QColor::Rgb, 0xff * 0x101, 0xa0 * 0x101, 0x52 * 0x101, 0x2d * 0x101};
+ constexpr Q_DECL_UNUSED QColor silver {QColor::Rgb, 0xff * 0x101, 0xc0 * 0x101, 0xc0 * 0x101, 0xc0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor skyblue {QColor::Rgb, 0xff * 0x101, 0x87 * 0x101, 0xce * 0x101, 0xeb * 0x101};
+ constexpr Q_DECL_UNUSED QColor slateblue {QColor::Rgb, 0xff * 0x101, 0x6a * 0x101, 0x5a * 0x101, 0xcd * 0x101};
+ constexpr Q_DECL_UNUSED QColor slategray {QColor::Rgb, 0xff * 0x101, 0x70 * 0x101, 0x80 * 0x101, 0x90 * 0x101};
+ constexpr Q_DECL_UNUSED QColor slategrey {QColor::Rgb, 0xff * 0x101, 0x70 * 0x101, 0x80 * 0x101, 0x90 * 0x101};
+ constexpr Q_DECL_UNUSED QColor snow {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xfa * 0x101, 0xfa * 0x101};
+ constexpr Q_DECL_UNUSED QColor springgreen {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0xff * 0x101, 0x7f * 0x101};
+ constexpr Q_DECL_UNUSED QColor steelblue {QColor::Rgb, 0xff * 0x101, 0x46 * 0x101, 0x82 * 0x101, 0xb4 * 0x101};
+ constexpr Q_DECL_UNUSED QColor tan {QColor::Rgb, 0xff * 0x101, 0xd2 * 0x101, 0xb4 * 0x101, 0x8c * 0x101};
+ constexpr Q_DECL_UNUSED QColor teal {QColor::Rgb, 0xff * 0x101, 0x00 * 0x101, 0x80 * 0x101, 0x80 * 0x101};
+ constexpr Q_DECL_UNUSED QColor thistle {QColor::Rgb, 0xff * 0x101, 0xd8 * 0x101, 0xbf * 0x101, 0xd8 * 0x101};
+ constexpr Q_DECL_UNUSED QColor tomato {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0x63 * 0x101, 0x47 * 0x101};
+ constexpr Q_DECL_UNUSED QColor turquoise {QColor::Rgb, 0xff * 0x101, 0x40 * 0x101, 0xe0 * 0x101, 0xd0 * 0x101};
+ constexpr Q_DECL_UNUSED QColor violet {QColor::Rgb, 0xff * 0x101, 0xee * 0x101, 0x82 * 0x101, 0xee * 0x101};
+ constexpr Q_DECL_UNUSED QColor wheat {QColor::Rgb, 0xff * 0x101, 0xf5 * 0x101, 0xde * 0x101, 0xb3 * 0x101};
+ constexpr Q_DECL_UNUSED QColor white {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101};
+ constexpr Q_DECL_UNUSED QColor whitesmoke {QColor::Rgb, 0xff * 0x101, 0xf5 * 0x101, 0xf5 * 0x101, 0xf5 * 0x101};
+ constexpr Q_DECL_UNUSED QColor yellow {QColor::Rgb, 0xff * 0x101, 0xff * 0x101, 0xff * 0x101, 0x00 * 0x101};
+ constexpr Q_DECL_UNUSED QColor yellowgreen {QColor::Rgb, 0xff * 0x101, 0x9a * 0x101, 0xcd * 0x101, 0x32 * 0x101};
+} // namespace Svg
+#endif // Q_COMPILER_CONSTEXPR && Q_COMPILER_UNIFORM_INIT
+} // namespace QColorLiterals
+
QT_END_NAMESPACE
#endif // QCOLOR_H
diff --git a/src/gui/painting/qcolormatrix_p.h b/src/gui/painting/qcolormatrix_p.h
new file mode 100644
index 0000000000..edb2d32258
--- /dev/null
+++ b/src/gui/painting/qcolormatrix_p.h
@@ -0,0 +1,237 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORMATRIX_H
+#define QCOLORMATRIX_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/qtguiglobal.h>
+#include <QtCore/qpoint.h>
+#include <cmath>
+
+QT_BEGIN_NAMESPACE
+
+// An abstract 3 value color
+class QColorVector
+{
+public:
+ QColorVector() = default;
+ Q_DECL_CONSTEXPR QColorVector(float x, float y, float z) : x(x), y(y), z(z) { }
+ explicit Q_DECL_CONSTEXPR QColorVector(const QPointF &chr) // from XY chromaticity
+ : x(chr.x() / chr.y())
+ , y(1.0f)
+ , z((1.0 - chr.x() - chr.y()) / chr.y())
+ { }
+ float x = 0.0f; // X, x or red
+ float y = 0.0f; // Y, y or green
+ float z = 0.0f; // Z, Y or blue
+ float _unused = 0.0f;
+
+ friend inline bool operator==(const QColorVector &v1, const QColorVector &v2);
+ friend inline bool operator!=(const QColorVector &v1, const QColorVector &v2);
+ bool isNull() const
+ {
+ return !x && !y && !z;
+ }
+
+ static bool isValidChromaticity(const QPointF &chr)
+ {
+ if (chr.x() < qreal(0.0) || chr.x() > qreal(1.0))
+ return false;
+ if (chr.y() <= qreal(0.0) || chr.y() > qreal(1.0))
+ return false;
+ if (chr.x() + chr.y() > qreal(1.0))
+ return false;
+ return true;
+ }
+
+ // Common whitepoints:
+ static Q_DECL_CONSTEXPR QPointF D50Chromaticity() { return QPointF(0.34567, 0.35850); }
+ static Q_DECL_CONSTEXPR QPointF D65Chromaticity() { return QPointF(0.31271, 0.32902); }
+ static Q_DECL_CONSTEXPR QColorVector D50() { return QColorVector(D50Chromaticity()); }
+ static Q_DECL_CONSTEXPR QColorVector D65() { return QColorVector(D65Chromaticity()); }
+};
+
+inline bool operator==(const QColorVector &v1, const QColorVector &v2)
+{
+ return (std::abs(v1.x - v2.x) < (1.0f / 2048.0f))
+ && (std::abs(v1.y - v2.y) < (1.0f / 2048.0f))
+ && (std::abs(v1.z - v2.z) < (1.0f / 2048.0f));
+}
+
+inline bool operator!=(const QColorVector &v1, const QColorVector &v2)
+{
+ return !(v1 == v2);
+}
+
+
+// A matrix mapping 3 value colors.
+// Not using QMatrix because only floats are needed and performance is critical.
+class QColorMatrix
+{
+public:
+ // We are storing the matrix transposed as that is more convenient:
+ QColorVector r;
+ QColorVector g;
+ QColorVector b;
+
+ friend inline bool operator==(const QColorMatrix &m1, const QColorMatrix &m2);
+ friend inline bool operator!=(const QColorMatrix &m1, const QColorMatrix &m2);
+
+ bool isNull() const
+ {
+ return r.isNull() && g.isNull() && b.isNull();
+ }
+ bool isValid() const
+ {
+ // A color matrix must be invertible
+ float det = r.x * (b.z * g.y - g.z * b.y) -
+ r.y * (b.z * g.x - g.z * b.x) +
+ r.z * (b.y * g.x - g.y * b.x);
+ return !qFuzzyIsNull(det);
+ }
+
+ QColorMatrix inverted() const
+ {
+ float det = r.x * (b.z * g.y - g.z * b.y) -
+ r.y * (b.z * g.x - g.z * b.x) +
+ r.z * (b.y * g.x - g.y * b.x);
+ det = 1.0f / det;
+ QColorMatrix inv;
+ inv.r.x = (g.y * b.z - b.y * g.z) * det;
+ inv.r.y = (b.y * r.z - r.y * b.z) * det;
+ inv.r.z = (r.y * g.z - g.y * r.z) * det;
+ inv.g.x = (b.x * g.z - g.x * b.z) * det;
+ inv.g.y = (r.x * b.z - b.x * r.z) * det;
+ inv.g.z = (g.x * r.z - r.x * g.z) * det;
+ inv.b.x = (g.x * b.y - b.x * g.y) * det;
+ inv.b.y = (b.x * r.y - r.x * b.y) * det;
+ inv.b.z = (r.x * g.y - g.x * r.y) * det;
+ return inv;
+ }
+ QColorMatrix operator*(const QColorMatrix &o) const
+ {
+ QColorMatrix comb;
+ comb.r.x = r.x * o.r.x + g.x * o.r.y + b.x * o.r.z;
+ comb.g.x = r.x * o.g.x + g.x * o.g.y + b.x * o.g.z;
+ comb.b.x = r.x * o.b.x + g.x * o.b.y + b.x * o.b.z;
+
+ comb.r.y = r.y * o.r.x + g.y * o.r.y + b.y * o.r.z;
+ comb.g.y = r.y * o.g.x + g.y * o.g.y + b.y * o.g.z;
+ comb.b.y = r.y * o.b.x + g.y * o.b.y + b.y * o.b.z;
+
+ comb.r.z = r.z * o.r.x + g.z * o.r.y + b.z * o.r.z;
+ comb.g.z = r.z * o.g.x + g.z * o.g.y + b.z * o.g.z;
+ comb.b.z = r.z * o.b.x + g.z * o.b.y + b.z * o.b.z;
+ return comb;
+
+ }
+ QColorVector map(const QColorVector &c) const
+ {
+ return QColorVector { c.x * r.x + c.y * g.x + c.z * b.x,
+ c.x * r.y + c.y * g.y + c.z * b.y,
+ c.x * r.z + c.y * g.z + c.z * b.z };
+ }
+ QColorMatrix transposed() const
+ {
+ return QColorMatrix { { r.x, g.x, b.x },
+ { r.y, g.y, b.y },
+ { r.z, g.z, b.z } };
+ }
+
+ static QColorMatrix identity()
+ {
+ return { { 1.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }, { 0.0f, 0.0f, 1.0f } };
+ }
+ static QColorMatrix fromScale(QColorVector v)
+ {
+ return QColorMatrix { { v.x, 0.0f, 0.0f },
+ { 0.0f, v.y, 0.0f },
+ { 0.0f, 0.0f, v.z } };
+ }
+ // These are used to recognize matrices from ICC profiles:
+ static QColorMatrix toXyzFromSRgb()
+ {
+ return QColorMatrix { { 0.4360217452f, 0.2224751115f, 0.0139281144f },
+ { 0.3851087987f, 0.7169067264f, 0.0971015394f },
+ { 0.1430812478f, 0.0606181994f, 0.7141585946f } };
+ }
+ static QColorMatrix toXyzFromAdobeRgb()
+ {
+ return QColorMatrix { { 0.6097189188f, 0.3111021519f, 0.0194766335f },
+ { 0.2052682191f, 0.6256770492f, 0.0608891509f },
+ { 0.1492247432f, 0.0632209629f, 0.7448224425f } };
+ }
+ static QColorMatrix toXyzFromDciP3D65()
+ {
+ return QColorMatrix { { 0.5150973201f, 0.2411795557f, -0.0010491034f },
+ { 0.2919696569f, 0.6922441125f, 0.0418830328f },
+ { 0.1571449190f, 0.0665764511f, 0.7843542695f } };
+ }
+ static QColorMatrix toXyzFromProPhotoRgb()
+ {
+ return QColorMatrix { { 0.7976672649f, 0.2880374491f, 0.0000000000f },
+ { 0.1351922452f, 0.7118769884f, 0.0000000000f },
+ { 0.0313525312f, 0.0000856627f, 0.8251883388f } };
+ }
+};
+
+inline bool operator==(const QColorMatrix &m1, const QColorMatrix &m2)
+{
+ return (m1.r == m2.r) && (m1.g == m2.g) && (m1.b == m2.b);
+}
+
+inline bool operator!=(const QColorMatrix &m1, const QColorMatrix &m2)
+{
+ return !(m1 == m2);
+}
+
+QT_END_NAMESPACE
+
+#endif // QCOLORMATRIX_P_H
diff --git a/src/gui/painting/qcolorspace.cpp b/src/gui/painting/qcolorspace.cpp
new file mode 100644
index 0000000000..937bb505c9
--- /dev/null
+++ b/src/gui/painting/qcolorspace.cpp
@@ -0,0 +1,796 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qcolorspace.h"
+#include "qcolorspace_p.h"
+
+#include "qcolortransform.h"
+#include "qcolormatrix_p.h"
+#include "qcolortransferfunction_p.h"
+#include "qcolortransform_p.h"
+#include "qicc_p.h"
+
+#include <qmath.h>
+#include <qtransform.h>
+
+#include <qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QBasicMutex QColorSpacePrivate::s_lutWriteLock;
+
+QColorSpacePrimaries::QColorSpacePrimaries(QColorSpace::Primaries primaries)
+{
+ switch (primaries) {
+ case QColorSpace::Primaries::SRgb:
+ redPoint = QPointF(0.640, 0.330);
+ greenPoint = QPointF(0.300, 0.600);
+ bluePoint = QPointF(0.150, 0.060);
+ whitePoint = QColorVector::D65Chromaticity();
+ break;
+ case QColorSpace::Primaries::DciP3D65:
+ redPoint = QPointF(0.680, 0.320);
+ greenPoint = QPointF(0.265, 0.690);
+ bluePoint = QPointF(0.150, 0.060);
+ whitePoint = QColorVector::D65Chromaticity();
+ break;
+ case QColorSpace::Primaries::AdobeRgb:
+ redPoint = QPointF(0.640, 0.330);
+ greenPoint = QPointF(0.210, 0.710);
+ bluePoint = QPointF(0.150, 0.060);
+ whitePoint = QColorVector::D65Chromaticity();
+ break;
+ case QColorSpace::Primaries::ProPhotoRgb:
+ redPoint = QPointF(0.7347, 0.2653);
+ greenPoint = QPointF(0.1596, 0.8404);
+ bluePoint = QPointF(0.0366, 0.0001);
+ whitePoint = QColorVector::D50Chromaticity();
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+}
+
+bool QColorSpacePrimaries::areValid() const
+{
+ if (!QColorVector::isValidChromaticity(redPoint))
+ return false;
+ if (!QColorVector::isValidChromaticity(greenPoint))
+ return false;
+ if (!QColorVector::isValidChromaticity(bluePoint))
+ return false;
+ if (!QColorVector::isValidChromaticity(whitePoint))
+ return false;
+ return true;
+}
+
+QColorMatrix QColorSpacePrimaries::toXyzMatrix() const
+{
+ // This converts to XYZ in some undefined scale.
+ QColorMatrix toXyz = { QColorVector(redPoint),
+ QColorVector(greenPoint),
+ QColorVector(bluePoint) };
+
+ // Since the white point should be (1.0, 1.0, 1.0) in the
+ // input, we can figure out the scale by using the
+ // inverse conversion on the white point.
+ QColorVector wXyz(whitePoint);
+ QColorVector whiteScale = toXyz.inverted().map(wXyz);
+
+ // Now we have scaled conversion to XYZ relative to the given whitepoint
+ toXyz = toXyz * QColorMatrix::fromScale(whiteScale);
+
+ // But we want a conversion to XYZ relative to D50
+ QColorVector wXyzD50 = QColorVector::D50();
+
+ if (wXyz != wXyzD50) {
+ // Do chromatic adaptation to map our white point to XYZ D50.
+
+ // The Bradford method chromatic adaptation matrix:
+ QColorMatrix abrad = { { 0.8951f, -0.7502f, 0.0389f },
+ { 0.2664f, 1.7135f, -0.0685f },
+ { -0.1614f, 0.0367f, 1.0296f } };
+ QColorMatrix abradinv = { { 0.9869929f, 0.4323053f, -0.0085287f },
+ { -0.1470543f, 0.5183603f, 0.0400428f },
+ { 0.1599627f, 0.0492912f, 0.9684867f } };
+
+ QColorVector srcCone = abrad.map(wXyz);
+ QColorVector dstCone = abrad.map(wXyzD50);
+
+ QColorMatrix wToD50 = { { dstCone.x / srcCone.x, 0, 0 },
+ { 0, dstCone.y / srcCone.y, 0 },
+ { 0, 0, dstCone.z / srcCone.z } };
+
+
+ QColorMatrix chromaticAdaptation = abradinv * (wToD50 * abrad);
+ toXyz = chromaticAdaptation * toXyz;
+ }
+
+ return toXyz;
+}
+
+QColorSpacePrivate::QColorSpacePrivate()
+{
+}
+
+QColorSpacePrivate::QColorSpacePrivate(QColorSpace::NamedColorSpace namedColorSpace)
+ : namedColorSpace(namedColorSpace)
+{
+ switch (namedColorSpace) {
+ case QColorSpace::SRgb:
+ primaries = QColorSpace::Primaries::SRgb;
+ transferFunction = QColorSpace::TransferFunction::SRgb;
+ description = QStringLiteral("sRGB");
+ break;
+ case QColorSpace::SRgbLinear:
+ primaries = QColorSpace::Primaries::SRgb;
+ transferFunction = QColorSpace::TransferFunction::Linear;
+ description = QStringLiteral("Linear sRGB");
+ break;
+ case QColorSpace::AdobeRgb:
+ primaries = QColorSpace::Primaries::AdobeRgb;
+ transferFunction = QColorSpace::TransferFunction::Gamma;
+ gamma = 2.19921875f; // Not quite 2.2, see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
+ description = QStringLiteral("Adobe RGB");
+ break;
+ case QColorSpace::DisplayP3:
+ primaries = QColorSpace::Primaries::DciP3D65;
+ transferFunction = QColorSpace::TransferFunction::SRgb;
+ description = QStringLiteral("Display P3");
+ break;
+ case QColorSpace::ProPhotoRgb:
+ primaries = QColorSpace::Primaries::ProPhotoRgb;
+ transferFunction = QColorSpace::TransferFunction::ProPhotoRgb;
+ description = QStringLiteral("ProPhoto RGB");
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+ initialize();
+}
+
+QColorSpacePrivate::QColorSpacePrivate(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma)
+ : primaries(primaries)
+ , transferFunction(fun)
+ , gamma(gamma)
+{
+ identifyColorSpace();
+ initialize();
+}
+
+QColorSpacePrivate::QColorSpacePrivate(const QColorSpacePrimaries &primaries,
+ QColorSpace::TransferFunction fun,
+ float gamma)
+ : primaries(QColorSpace::Primaries::Custom)
+ , transferFunction(fun)
+ , gamma(gamma)
+{
+ Q_ASSERT(primaries.areValid());
+ toXyz = primaries.toXyzMatrix();
+ whitePoint = QColorVector(primaries.whitePoint);
+ identifyColorSpace();
+ setTransferFunction();
+}
+
+void QColorSpacePrivate::identifyColorSpace()
+{
+ switch (primaries) {
+ case QColorSpace::Primaries::SRgb:
+ if (transferFunction == QColorSpace::TransferFunction::SRgb) {
+ namedColorSpace = QColorSpace::SRgb;
+ if (description.isEmpty())
+ description = QStringLiteral("sRGB");
+ return;
+ }
+ if (transferFunction == QColorSpace::TransferFunction::Linear) {
+ namedColorSpace = QColorSpace::SRgbLinear;
+ if (description.isEmpty())
+ description = QStringLiteral("Linear sRGB");
+ return;
+ }
+ break;
+ case QColorSpace::Primaries::AdobeRgb:
+ if (transferFunction == QColorSpace::TransferFunction::Gamma) {
+ if (qAbs(gamma - 2.19921875f) < (1/1024.0f)) {
+ namedColorSpace = QColorSpace::AdobeRgb;
+ if (description.isEmpty())
+ description = QStringLiteral("Adobe RGB");
+ return;
+ }
+ }
+ break;
+ case QColorSpace::Primaries::DciP3D65:
+ if (transferFunction == QColorSpace::TransferFunction::SRgb) {
+ namedColorSpace = QColorSpace::DisplayP3;
+ if (description.isEmpty())
+ description = QStringLiteral("Display P3");
+ return;
+ }
+ break;
+ case QColorSpace::Primaries::ProPhotoRgb:
+ if (transferFunction == QColorSpace::TransferFunction::ProPhotoRgb) {
+ namedColorSpace = QColorSpace::ProPhotoRgb;
+ if (description.isEmpty())
+ description = QStringLiteral("ProPhoto RGB");
+ return;
+ }
+ if (transferFunction == QColorSpace::TransferFunction::Gamma) {
+ // ProPhoto RGB's curve is effectively gamma 1.8 for 8bit precision.
+ if (qAbs(gamma - 1.8f) < (1/1024.0f)) {
+ namedColorSpace = QColorSpace::ProPhotoRgb;
+ if (description.isEmpty())
+ description = QStringLiteral("ProPhoto RGB");
+ return;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ namedColorSpace = Unknown;
+}
+
+void QColorSpacePrivate::initialize()
+{
+ setToXyzMatrix();
+ setTransferFunction();
+}
+
+void QColorSpacePrivate::setToXyzMatrix()
+{
+ if (primaries == QColorSpace::Primaries::Custom) {
+ toXyz = QColorMatrix();
+ whitePoint = QColorVector::D50();
+ return;
+ }
+ QColorSpacePrimaries colorSpacePrimaries(primaries);
+ toXyz = colorSpacePrimaries.toXyzMatrix();
+ whitePoint = QColorVector(colorSpacePrimaries.whitePoint);
+}
+
+void QColorSpacePrivate::setTransferFunction()
+{
+ switch (transferFunction) {
+ case QColorSpace::TransferFunction::Linear:
+ trc[0].m_type = QColorTrc::Type::Function;
+ trc[0].m_fun = QColorTransferFunction();
+ if (qFuzzyIsNull(gamma))
+ gamma = 1.0f;
+ break;
+ case QColorSpace::TransferFunction::Gamma:
+ trc[0].m_type = QColorTrc::Type::Function;
+ trc[0].m_fun = QColorTransferFunction::fromGamma(gamma);
+ break;
+ case QColorSpace::TransferFunction::SRgb:
+ trc[0].m_type = QColorTrc::Type::Function;
+ trc[0].m_fun = QColorTransferFunction::fromSRgb();
+ if (qFuzzyIsNull(gamma))
+ gamma = 2.31f;
+ break;
+ case QColorSpace::TransferFunction::ProPhotoRgb:
+ trc[0].m_type = QColorTrc::Type::Function;
+ trc[0].m_fun = QColorTransferFunction::fromProPhotoRgb();
+ if (qFuzzyIsNull(gamma))
+ gamma = 1.8f;
+ break;
+ case QColorSpace::TransferFunction::Custom:
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ trc[1] = trc[0];
+ trc[2] = trc[0];
+}
+
+QColorTransform QColorSpacePrivate::transformationToColorSpace(const QColorSpacePrivate *out) const
+{
+ Q_ASSERT(out);
+ QColorTransform combined;
+ auto ptr = new QColorTransformPrivate;
+ combined.d = ptr;
+ combined.d->ref.ref();
+ ptr->colorSpaceIn = this;
+ ptr->colorSpaceOut = out;
+ ptr->colorMatrix = out->toXyz.inverted() * toXyz;
+ return combined;
+}
+
+/*!
+ \class QColorSpace
+ \brief The QColorSpace class provides a color space abstraction.
+ \since 5.14
+
+ \ingroup painting
+ \ingroup appearance
+ \inmodule QtGui
+
+ Color values can be interpreted in different ways, and based on the interpretation
+ can live in different spaces. We call this \e {color spaces}.
+
+ QColorSpace provides access to creating several predefined color spaces and
+ can generate QColorTransforms for converting colors from one color space to
+ another.
+
+ QColorSpace can also represent color spaces defined by ICC profiles or embedded
+ in images, that do not otherwise fit the predefined color spaces.
+
+ A color space can generally speaking be conceived as a combination of set of primary
+ colors and a transfer function. The primaries defines the axes of the color space, and
+ the transfer function how values are mapped on the axes.
+ The primaries are defined by three primary colors that represent exactly how red, green,
+ and blue look in this particular color space, and a white color that represents where
+ and how bright pure white is. The range of colors expressable by the primary colors is
+ called the gamut, and a color space that can represent a wider range of colors is also
+ known as a wide-gamut color space.
+
+ The transfer function or gamma curve determines how each component in the
+ color space is encoded. These are used because human perception does not operate
+ linearly, and the transfer functions try to ensure that colors will seem evenly
+ spaced to human eyes.
+*/
+
+
+/*!
+ \enum QColorSpace::NamedColorSpace
+
+ Predefined color spaces.
+
+ \value SRgb The sRGB color space, which Qt operates in by default. It is a close approximation
+ of how most classic monitors operate, and a mode most software and hardware support.
+ \l{http://www.color.org/chardata/rgb/srgb.xalter}{ICC registration of sRGB}.
+ \value SRgbLinear The sRGB color space with linear gamma. Useful for gamma-corrected blending.
+ \value AdobeRgb The Adobe RGB color space is a classic wide-gamut color space, using a gamma of 2.2.
+ \l{http://www.color.org/chardata/rgb/adobergb.xalter}{ICC registration of Adobe RGB (1998)}
+ \value DisplayP3 A color-space using the primaries of DCI-P3, but with the whitepoint and transfer
+ function of sRGB. Common in modern wide-gamut screens.
+ \l{http://www.color.org/chardata/rgb/DCIP3.xalter}{ICC registration of DCI-P3}
+ \value ProPhotoRgb The Pro Photo RGB color space, also known as ROMM RGB is a very wide gamut color space.
+ \l{http://www.color.org/chardata/rgb/rommrgb.xalter}{ICC registration of ROMM RGB}
+*/
+
+/*!
+ \enum QColorSpace::Primaries
+
+ Predefined sets of primary colors.
+
+ \value Custom The primaries are undefined or does not match any predefined sets.
+ \value SRgb The sRGB primaries
+ \value AdobeRgb The Adobe RGB primaries
+ \value DciP3D65 The DCI-P3 primaries with the D65 whitepoint
+ \value ProPhotoRgb The ProPhoto RGB primaries with the D50 whitepoint
+*/
+
+/*!
+ \enum QColorSpace::TransferFunction
+
+ Predefined transfer functions or gamma curves.
+
+ \value Custom The custom or null transfer function
+ \value Linear The linear transfer functions
+ \value Gamma A transfer function that is a real gamma curve based on the value of gamma()
+ \value SRgb The sRGB transfer function, composed of linear and gamma parts
+ \value ProPhotoRgb The ProPhoto RGB transfer function, composed of linear and gamma parts
+*/
+
+/*!
+ Creates a new colorspace object that represents an undefined and invalid colorspace.
+ */
+QColorSpace::QColorSpace()
+{
+}
+
+/*!
+ Creates a new colorspace object that represents a \a namedColorSpace.
+ */
+QColorSpace::QColorSpace(NamedColorSpace namedColorSpace)
+{
+ static QColorSpacePrivate *predefinedColorspacePrivates[QColorSpace::ProPhotoRgb + 1];
+ if (!predefinedColorspacePrivates[namedColorSpace]) {
+ predefinedColorspacePrivates[namedColorSpace] = new QColorSpacePrivate(namedColorSpace);
+ predefinedColorspacePrivates[namedColorSpace]->ref.ref();
+ }
+ d_ptr = predefinedColorspacePrivates[namedColorSpace];
+ d_ptr->ref.ref();
+ Q_ASSERT(isValid());
+}
+
+/*!
+ Creates a custom color space with the primaries \a primaries, using the transfer function \a fun and
+ optionally \a gamma.
+ */
+QColorSpace::QColorSpace(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma)
+ : d_ptr(new QColorSpacePrivate(primaries, fun, gamma))
+{
+ d_ptr->ref.ref();
+}
+
+/*!
+ Creates a custom color space with the primaries \a primaries, using a gamma transfer function of
+ \a gamma.
+ */
+QColorSpace::QColorSpace(QColorSpace::Primaries primaries, float gamma)
+ : d_ptr(new QColorSpacePrivate(primaries, TransferFunction::Gamma, gamma))
+{
+ d_ptr->ref.ref();
+}
+
+/*!
+ Creates a custom colorspace with a primaries based on the chromaticities of the primary colors \a whitePoint,
+ \a redPoint, \a greenPoint and \a bluePoint, and using the transfer function \a fun and optionally \a gamma.
+ */
+QColorSpace::QColorSpace(const QPointF &whitePoint, const QPointF &redPoint,
+ const QPointF &greenPoint, const QPointF &bluePoint,
+ QColorSpace::TransferFunction fun, float gamma)
+{
+ QColorSpacePrimaries primaries(whitePoint, redPoint, greenPoint, bluePoint);
+ if (!primaries.areValid()) {
+ qWarning() << "QColorSpace attempted constructed from invalid primaries:" << whitePoint << redPoint << greenPoint << bluePoint;
+ d_ptr = nullptr;
+ return;
+ }
+ d_ptr = new QColorSpacePrivate(primaries, fun, gamma);
+ d_ptr->ref.ref();
+}
+
+QColorSpace::~QColorSpace()
+{
+ if (d_ptr && !d_ptr->ref.deref())
+ delete d_ptr;
+}
+
+QColorSpace::QColorSpace(const QColorSpace &colorSpace)
+ : d_ptr(colorSpace.d_ptr)
+{
+ if (d_ptr)
+ d_ptr->ref.ref();
+}
+
+QColorSpace &QColorSpace::operator=(const QColorSpace &colorSpace)
+{
+ QColorSpacePrivate *oldD = d_ptr;
+ d_ptr = colorSpace.d_ptr;
+ if (d_ptr)
+ d_ptr->ref.ref();
+ if (oldD && !oldD->ref.deref())
+ delete oldD;
+ return *this;
+}
+
+/*! \fn void QColorSpace::swap(QColorSpace &other)
+
+ Swaps color space \a other with this color space. This operation is very fast and
+ never fails.
+*/
+
+/*!
+ Returns the predefined primaries of the color space
+ or \c primaries::Custom if it doesn't match any of them.
+*/
+QColorSpace::Primaries QColorSpace::primaries() const noexcept
+{
+ if (Q_UNLIKELY(!d_ptr))
+ return QColorSpace::Primaries::Custom;
+ return d_ptr->primaries;
+}
+
+/*!
+ Returns the predefined transfer function of the color space
+ or \c TransferFunction::Custom if it doesn't match any of them.
+
+ \sa gamma(), setTransferFunction(), withTransferFunction()
+*/
+QColorSpace::TransferFunction QColorSpace::transferFunction() const noexcept
+{
+ if (Q_UNLIKELY(!d_ptr))
+ return QColorSpace::TransferFunction::Custom;
+ return d_ptr->transferFunction;
+}
+
+/*!
+ Returns the gamma value of color spaces with \c TransferFunction::Gamma,
+ an approximate gamma value for other predefined color spaces, or
+ 0.0 if no approximate gamma is known.
+
+ \sa transferFunction()
+*/
+float QColorSpace::gamma() const noexcept
+{
+ if (Q_UNLIKELY(!d_ptr))
+ return 0.0f;
+ return d_ptr->gamma;
+}
+
+/*!
+ Sets the transfer function to \a transferFunction and \a gamma.
+
+ \sa transferFunction(), gamma(), withTransferFunction()
+*/
+void QColorSpace::setTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma)
+{
+ if (!isValid() || transferFunction == QColorSpace::TransferFunction::Custom)
+ return;
+ if (d_ptr->transferFunction == transferFunction && d_ptr->gamma == gamma)
+ return;
+ QColorSpacePrivate::getWritable(*this); // detach
+ d_ptr->description.clear();
+ d_ptr->transferFunction = transferFunction;
+ d_ptr->gamma = gamma;
+ d_ptr->identifyColorSpace();
+ d_ptr->setTransferFunction();
+}
+
+/*!
+ Returns a copy of this color space, except using the transfer function
+ \a transferFunction and \a gamma.
+
+ \sa transferFunction(), gamma(), setTransferFunction()
+*/
+QColorSpace QColorSpace::withTransferFunction(QColorSpace::TransferFunction transferFunction, float gamma) const
+{
+ if (!isValid() || transferFunction == QColorSpace::TransferFunction::Custom)
+ return *this;
+ if (d_ptr->transferFunction == transferFunction && d_ptr->gamma == gamma)
+ return *this;
+ QColorSpace out(*this);
+ out.setTransferFunction(transferFunction, gamma);
+ return out;
+}
+
+/*!
+ Sets the primaries to those of the \a primariesId set.
+
+ \sa primaries()
+*/
+void QColorSpace::setPrimaries(QColorSpace::Primaries primariesId)
+{
+ if (!isValid() || primariesId == QColorSpace::Primaries::Custom)
+ return;
+ if (d_ptr->primaries == primariesId)
+ return;
+ QColorSpacePrivate::getWritable(*this); // detach
+ d_ptr->description.clear();
+ d_ptr->primaries = primariesId;
+ d_ptr->identifyColorSpace();
+ d_ptr->setToXyzMatrix();
+}
+
+/*!
+ Set primaries to the chromaticities of \a whitePoint, \a redPoint, \a greenPoint
+ and \a bluePoint.
+
+ \sa primaries()
+*/
+void QColorSpace::setPrimaries(const QPointF &whitePoint, const QPointF &redPoint,
+ const QPointF &greenPoint, const QPointF &bluePoint)
+{
+ if (!isValid())
+ return;
+ QColorSpacePrimaries primaries(whitePoint, redPoint, greenPoint, bluePoint);
+ if (!primaries.areValid())
+ return;
+ QColorMatrix toXyz = primaries.toXyzMatrix();
+ if (QColorVector(primaries.whitePoint) == d_ptr->whitePoint && toXyz == d_ptr->toXyz)
+ return;
+ QColorSpacePrivate::getWritable(*this); // detach
+ d_ptr->description.clear();
+ d_ptr->primaries = QColorSpace::Primaries::Custom;
+ d_ptr->toXyz = toXyz;
+ d_ptr->whitePoint = QColorVector(primaries.whitePoint);
+ d_ptr->identifyColorSpace();
+}
+
+/*!
+ Returns an ICC profile representing the color space.
+
+ If the color space was generated from an ICC profile, that profile
+ is returned, otherwise one is generated.
+
+ \note Even invalid color spaces may return the ICC profile if they
+ were generated from one, to allow applications to implement wider
+ support themselves.
+
+ \sa fromIccProfile()
+*/
+QByteArray QColorSpace::iccProfile() const
+{
+ if (Q_UNLIKELY(!d_ptr))
+ return QByteArray();
+ if (!d_ptr->iccProfile.isEmpty())
+ return d_ptr->iccProfile;
+ if (!isValid())
+ return QByteArray();
+ return QIcc::toIccProfile(*this);
+}
+
+/*!
+ Creates a QColorSpace from ICC profile \a iccProfile.
+
+ \note Not all ICC profiles are supported. QColorSpace only supports
+ RGB-XYZ ICC profiles that are three-component matrix-based.
+
+ If the ICC profile is not supported an invalid QColorSpace is returned
+ where you can still read the original ICC profile using iccProfile().
+
+ \sa iccProfile()
+*/
+QColorSpace QColorSpace::fromIccProfile(const QByteArray &iccProfile)
+{
+ QColorSpace colorSpace;
+ if (QIcc::fromIccProfile(iccProfile, &colorSpace))
+ return colorSpace;
+ QColorSpacePrivate *d = QColorSpacePrivate::getWritable(colorSpace);
+ d->iccProfile = iccProfile;
+ return colorSpace;
+}
+
+/*!
+ Returns \c true if the color space is valid.
+*/
+bool QColorSpace::isValid() const noexcept
+{
+ return d_ptr
+ && d_ptr->toXyz.isValid()
+ && d_ptr->trc[0].isValid() && d_ptr->trc[1].isValid() && d_ptr->trc[2].isValid();
+}
+
+/*!
+ \relates QColorSpace
+ Returns \c true if colorspace \a colorSpace1 is equal to colorspace \a colorSpace2;
+ otherwise returns \c false
+*/
+bool operator==(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2)
+{
+ if (colorSpace1.d_ptr == colorSpace2.d_ptr)
+ return true;
+ if (!colorSpace1.d_ptr || !colorSpace2.d_ptr)
+ return false;
+
+ if (colorSpace1.d_ptr->namedColorSpace && colorSpace2.d_ptr->namedColorSpace)
+ return colorSpace1.d_ptr->namedColorSpace == colorSpace2.d_ptr->namedColorSpace;
+
+ const bool valid1 = colorSpace1.isValid();
+ const bool valid2 = colorSpace2.isValid();
+ if (!valid1 && !valid2)
+ return colorSpace1.d_ptr->iccProfile == colorSpace2.d_ptr->iccProfile;
+ else if (!valid1 || !valid2)
+ return false;
+
+ // At this point one or both color spaces are unknown but valid, and must be compared in detail instead
+
+ if (colorSpace1.primaries() != QColorSpace::Primaries::Custom && colorSpace2.primaries() != QColorSpace::Primaries::Custom) {
+ if (colorSpace1.primaries() != colorSpace2.primaries())
+ return false;
+ } else {
+ if (colorSpace1.d_ptr->toXyz != colorSpace2.d_ptr->toXyz)
+ return false;
+ }
+
+ if (colorSpace1.transferFunction() != QColorSpace::TransferFunction::Custom &&
+ colorSpace2.transferFunction() != QColorSpace::TransferFunction::Custom) {
+ if (colorSpace1.transferFunction() != colorSpace2.transferFunction())
+ return false;
+ if (colorSpace1.transferFunction() == QColorSpace::TransferFunction::Gamma)
+ return (qAbs(colorSpace1.gamma() - colorSpace2.gamma()) <= (1.0f / 512.0f));
+ return true;
+ }
+
+ if (colorSpace1.d_ptr->trc[0] != colorSpace2.d_ptr->trc[0] ||
+ colorSpace1.d_ptr->trc[1] != colorSpace2.d_ptr->trc[1] ||
+ colorSpace1.d_ptr->trc[2] != colorSpace2.d_ptr->trc[2])
+ return false;
+
+ return true;
+}
+
+/*!
+ \fn bool operator!=(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2)
+ \relates QColorSpace
+
+ Returns \c true if colorspace \a colorSpace1 is not equal to colorspace \a colorSpace2;
+ otherwise returns \c false
+*/
+
+/*!
+ Generates and returns a color space transformation from this color space to
+ \a colorspace.
+*/
+QColorTransform QColorSpace::transformationToColorSpace(const QColorSpace &colorspace) const
+{
+ if (!isValid() || !colorspace.isValid())
+ return QColorTransform();
+
+ return d_ptr->transformationToColorSpace(colorspace.d_ptr);
+}
+
+/*****************************************************************************
+ QColorSpace stream functions
+ *****************************************************************************/
+#if !defined(QT_NO_DATASTREAM)
+/*!
+ \fn QDataStream &operator<<(QDataStream &stream, const QColorSpace &colorSpace)
+ \relates QColorSpace
+
+ Writes the given \a colorSpace to the given \a stream as an ICC profile.
+
+ \sa QColorSpace::iccProfile(), {Serializing Qt Data Types}
+*/
+
+QDataStream &operator<<(QDataStream &s, const QColorSpace &image)
+{
+ s << image.iccProfile();
+ return s;
+}
+
+/*!
+ \fn QDataStream &operator>>(QDataStream &stream, QColorSpace &colorSpace)
+ \relates QColorSpace
+
+ Reads a color space from the given \a stream and stores it in the given
+ \a colorSpace.
+
+ \sa QColorSpace::fromIccProfile(), {Serializing Qt Data Types}
+*/
+
+QDataStream &operator>>(QDataStream &s, QColorSpace &colorSpace)
+{
+ QByteArray iccProfile;
+ s >> iccProfile;
+ colorSpace = QColorSpace::fromIccProfile(iccProfile);
+ return s;
+}
+#endif // QT_NO_DATASTREAM
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QColorSpace &colorSpace)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace();
+ dbg << "QColorSpace(";
+ if (colorSpace.d_ptr->namedColorSpace)
+ dbg << colorSpace.d_ptr->namedColorSpace << ", ";
+ dbg << colorSpace.primaries() << ", " << colorSpace.transferFunction();
+ dbg << ", gamma=" << colorSpace.gamma();
+ dbg << ')';
+ return dbg;
+}
+#endif
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qcolorspace.h b/src/gui/painting/qcolorspace.h
new file mode 100644
index 0000000000..e6bc62d58a
--- /dev/null
+++ b/src/gui/painting/qcolorspace.h
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORSPACE_H
+#define QCOLORSPACE_H
+
+#include <QtGui/qtguiglobal.h>
+#include <QtGui/qcolortransform.h>
+#include <QtCore/qobjectdefs.h>
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class QColorSpacePrivate;
+class QPointF;
+
+class Q_GUI_EXPORT QColorSpace
+{
+ Q_GADGET
+public:
+ enum NamedColorSpace {
+ SRgb = 1,
+ SRgbLinear,
+ AdobeRgb,
+ DisplayP3,
+ ProPhotoRgb
+ };
+ Q_ENUM(NamedColorSpace)
+ enum class Primaries {
+ Custom = 0,
+ SRgb,
+ AdobeRgb,
+ DciP3D65,
+ ProPhotoRgb
+ };
+ Q_ENUM(Primaries)
+ enum class TransferFunction {
+ Custom = 0,
+ Linear,
+ Gamma,
+ SRgb,
+ ProPhotoRgb
+ };
+ Q_ENUM(TransferFunction)
+
+ QColorSpace();
+ QColorSpace(NamedColorSpace namedColorSpace);
+ QColorSpace(Primaries primaries, TransferFunction fun, float gamma = 0.0f);
+ QColorSpace(Primaries primaries, float gamma);
+ QColorSpace(const QPointF &whitePoint, const QPointF &redPoint,
+ const QPointF &greenPoint, const QPointF &bluePoint,
+ TransferFunction fun, float gamma = 0.0f);
+ ~QColorSpace();
+
+ QColorSpace(const QColorSpace &colorSpace);
+ QColorSpace &operator=(const QColorSpace &colorSpace);
+
+ QColorSpace(QColorSpace &&colorSpace) noexcept
+ : d_ptr(qExchange(colorSpace.d_ptr, nullptr))
+ { }
+ QColorSpace &operator=(QColorSpace &&colorSpace) noexcept
+ {
+ // Make the deallocation of this->d_ptr happen in ~QColorSpace()
+ QColorSpace(std::move(colorSpace)).swap(*this);
+ return *this;
+ }
+
+ void swap(QColorSpace &colorSpace) noexcept
+ { qSwap(d_ptr, colorSpace.d_ptr); }
+
+ Primaries primaries() const noexcept;
+ TransferFunction transferFunction() const noexcept;
+ float gamma() const noexcept;
+
+ void setTransferFunction(TransferFunction transferFunction, float gamma = 0.0f);
+ QColorSpace withTransferFunction(TransferFunction transferFunction, float gamma = 0.0f) const;
+
+ void setPrimaries(Primaries primariesId);
+ void setPrimaries(const QPointF &whitePoint, const QPointF &redPoint,
+ const QPointF &greenPoint, const QPointF &bluePoint);
+
+ bool isValid() const noexcept;
+
+ friend Q_GUI_EXPORT bool operator==(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
+ friend inline bool operator!=(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
+
+ static QColorSpace fromIccProfile(const QByteArray &iccProfile);
+ QByteArray iccProfile() const;
+
+ QColorTransform transformationToColorSpace(const QColorSpace &colorspace) const;
+
+
+private:
+ Q_DECLARE_PRIVATE(QColorSpace)
+ QColorSpacePrivate *d_ptr = nullptr;
+
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QColorSpace &colorSpace);
+#endif
+};
+
+bool Q_GUI_EXPORT operator==(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2);
+inline bool operator!=(const QColorSpace &colorSpace1, const QColorSpace &colorSpace2)
+{
+ return !(colorSpace1 == colorSpace2);
+}
+
+Q_DECLARE_SHARED(QColorSpace)
+
+// QColorSpace stream functions
+#if !defined(QT_NO_DATASTREAM)
+Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColorSpace &);
+Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColorSpace &);
+#endif
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QColorSpace &);
+#endif
+
+QT_END_NAMESPACE
+
+#endif // QCOLORSPACE_P_H
diff --git a/src/gui/painting/qcolorspace_p.h b/src/gui/painting/qcolorspace_p.h
new file mode 100644
index 0000000000..e7add19ed3
--- /dev/null
+++ b/src/gui/painting/qcolorspace_p.h
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORSPACE_P_H
+#define QCOLORSPACE_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 "qcolorspace.h"
+#include "qcolormatrix_p.h"
+#include "qcolortrc_p.h"
+#include "qcolortrclut_p.h"
+
+#include <QtCore/qmutex.h>
+#include <QtCore/qpoint.h>
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class Q_AUTOTEST_EXPORT QColorSpacePrimaries
+{
+public:
+ QColorSpacePrimaries() = default;
+ QColorSpacePrimaries(QColorSpace::Primaries primaries);
+ QColorSpacePrimaries(QPointF whitePoint,
+ QPointF redPoint,
+ QPointF greenPoint,
+ QPointF bluePoint)
+ : whitePoint(whitePoint)
+ , redPoint(redPoint)
+ , greenPoint(greenPoint)
+ , bluePoint(bluePoint)
+ { }
+
+ QColorMatrix toXyzMatrix() const;
+ bool areValid() const;
+
+ QPointF whitePoint;
+ QPointF redPoint;
+ QPointF greenPoint;
+ QPointF bluePoint;
+};
+
+class QColorSpacePrivate : public QSharedData
+{
+public:
+ QColorSpacePrivate();
+ QColorSpacePrivate(QColorSpace::NamedColorSpace namedColorSpace);
+ QColorSpacePrivate(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma);
+ QColorSpacePrivate(const QColorSpacePrimaries &primaries, QColorSpace::TransferFunction fun, float gamma);
+ QColorSpacePrivate(const QColorSpacePrivate &other) = default;
+
+ // named different from get to avoid accidental detachs
+ static QColorSpacePrivate *getWritable(QColorSpace &colorSpace)
+ {
+ if (!colorSpace.d_ptr) {
+ colorSpace.d_ptr = new QColorSpacePrivate;
+ colorSpace.d_ptr->ref.ref();
+ } else if (colorSpace.d_ptr->ref.loadRelaxed() != 1) {
+ colorSpace.d_ptr->ref.deref();
+ colorSpace.d_ptr = new QColorSpacePrivate(*colorSpace.d_ptr);
+ colorSpace.d_ptr->ref.ref();
+ }
+ Q_ASSERT(colorSpace.d_ptr->ref.loadRelaxed() == 1);
+ return colorSpace.d_ptr;
+ }
+
+ static const QColorSpacePrivate *get(const QColorSpace &colorSpace)
+ {
+ return colorSpace.d_ptr;
+ }
+
+ void initialize();
+ void setToXyzMatrix();
+ void setTransferFunction();
+ void identifyColorSpace();
+ QColorTransform transformationToColorSpace(const QColorSpacePrivate *out) const;
+
+ static constexpr QColorSpace::NamedColorSpace Unknown = QColorSpace::NamedColorSpace(0);
+ QColorSpace::NamedColorSpace namedColorSpace = Unknown;
+
+ QColorSpace::Primaries primaries = QColorSpace::Primaries::Custom;
+ QColorSpace::TransferFunction transferFunction = QColorSpace::TransferFunction::Custom;
+ float gamma = 0.0f;
+ QColorVector whitePoint;
+
+ QColorTrc trc[3];
+ QColorMatrix toXyz;
+
+ QString description;
+ QByteArray iccProfile;
+
+ static QBasicMutex s_lutWriteLock;
+ struct LUT {
+ LUT() = default;
+ ~LUT() = default;
+ LUT(const LUT &other)
+ {
+ if (other.generated.loadAcquire()) {
+ table[0] = other.table[0];
+ table[1] = other.table[1];
+ table[2] = other.table[2];
+ generated.storeRelaxed(1);
+ }
+ }
+ QSharedPointer<QColorTrcLut> &operator[](int i) { return table[i]; }
+ const QSharedPointer<QColorTrcLut> &operator[](int i) const { return table[i]; }
+ QSharedPointer<QColorTrcLut> table[3];
+ QAtomicInt generated;
+ } mutable lut;
+};
+
+QT_END_NAMESPACE
+
+#endif // QCOLORSPACE_P_H
diff --git a/src/gui/painting/qcolortransferfunction_p.h b/src/gui/painting/qcolortransferfunction_p.h
new file mode 100644
index 0000000000..0575dbd888
--- /dev/null
+++ b/src/gui/painting/qcolortransferfunction_p.h
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORTRANSFERFUNCTION_P_H
+#define QCOLORTRANSFERFUNCTION_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/private/qtguiglobal_p.h>
+
+#include <cmath>
+
+QT_BEGIN_NAMESPACE
+
+// Defines a ICC parametric curve type 4
+class Q_GUI_EXPORT QColorTransferFunction
+{
+public:
+ QColorTransferFunction() noexcept
+ : m_a(1.0f), m_b(0.0f), m_c(1.0f), m_d(0.0f), m_e(0.0f), m_f(0.0f), m_g(1.0f), m_flags(0)
+ { }
+ QColorTransferFunction(float a, float b, float c, float d, float e, float f, float g) noexcept
+ : m_a(a), m_b(b), m_c(c), m_d(d), m_e(e), m_f(f), m_g(g), m_flags(0)
+ { }
+
+ bool isGamma() const
+ {
+ updateHints();
+ return m_flags & quint32(Hints::IsGamma);
+ }
+ bool isLinear() const
+ {
+ updateHints();
+ return m_flags & quint32(Hints::IsLinear);
+ }
+ bool isSRgb() const
+ {
+ updateHints();
+ return m_flags & quint32(Hints::IsSRgb);
+ }
+
+ float apply(float x) const
+ {
+ if (x < m_d)
+ return m_c * x + m_f;
+ else
+ return std::pow(m_a * x + m_b, m_g) + m_e;
+ }
+
+ QColorTransferFunction inverted() const
+ {
+ float a, b, c, d, e, f, g;
+
+ d = m_c * m_d + m_f;
+
+ if (!qFuzzyIsNull(m_c)) {
+ c = 1.0f / m_c;
+ f = -m_f / m_c;
+ } else {
+ c = 0.0f;
+ f = 0.0f;
+ }
+
+ if (!qFuzzyIsNull(m_a) && !qFuzzyIsNull(m_g)) {
+ a = std::pow(1.0f / m_a, m_g);
+ b = -a * m_e;
+ e = -m_b / m_a;
+ g = 1.0f / m_g;
+ } else {
+ a = 0.0f;
+ b = 0.0f;
+ e = 1.0f;
+ g = 1.0f;
+ }
+
+ return QColorTransferFunction(a, b, c, d, e, f, g);
+ }
+
+ // A few predefined curves:
+ static QColorTransferFunction fromGamma(float gamma)
+ {
+ return QColorTransferFunction(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, gamma);
+ }
+ static QColorTransferFunction fromSRgb()
+ {
+ return QColorTransferFunction(1.0f / 1.055f, 0.055f / 1.055f, 1.0f / 12.92f, 0.04045f, 0.0f, 0.0f, 2.4f);
+ }
+ static QColorTransferFunction fromProPhotoRgb()
+ {
+ return QColorTransferFunction(1.0f, 0.0f, 1.0f / 16.0f, 16.0f / 512.0f, 0.0f, 0.0f, 1.8f);
+ }
+ bool matches(const QColorTransferFunction &o) const
+ {
+ return paramCompare(m_a, o.m_a) && paramCompare(m_b, o.m_b)
+ && paramCompare(m_c, o.m_c) && paramCompare(m_d, o.m_d)
+ && paramCompare(m_e, o.m_e) && paramCompare(m_f, o.m_f)
+ && paramCompare(m_g, o.m_g);
+ }
+ friend inline bool operator==(const QColorTransferFunction &f1, const QColorTransferFunction &f2);
+ friend inline bool operator!=(const QColorTransferFunction &f1, const QColorTransferFunction &f2);
+
+ float m_a;
+ float m_b;
+ float m_c;
+ float m_d;
+ float m_e;
+ float m_f;
+ float m_g;
+
+private:
+ static inline bool paramCompare(float p1, float p2)
+ {
+ // Much fuzzier than fuzzy compare.
+ // It tries match parameters that has been passed through a 8.8
+ // fixed point form.
+ return (qAbs(p1 - p2) <= (1.0f / 512.0f));
+ }
+
+ void updateHints() const
+ {
+ if (m_flags & quint32(Hints::Calculated))
+ return;
+ // We do not consider the case with m_d = 1.0f linear or simple,
+ // since it wouldn't be linear for applyExtended().
+ bool simple = paramCompare(m_a, 1.0f) && paramCompare(m_b, 0.0f)
+ && paramCompare(m_d, 0.0f)
+ && paramCompare(m_e, 0.0f);
+ if (simple) {
+ m_flags |= quint32(Hints::IsGamma);
+ if (qFuzzyCompare(m_g, 1.0f))
+ m_flags |= quint32(Hints::IsLinear);
+ } else {
+ if (*this == fromSRgb())
+ m_flags |= quint32(Hints::IsSRgb);
+ }
+ m_flags |= quint32(Hints::Calculated);
+ }
+ enum class Hints : quint32 {
+ Calculated = 1,
+ IsGamma = 2,
+ IsLinear = 4,
+ IsSRgb = 8
+ };
+ mutable quint32 m_flags;
+};
+
+inline bool operator==(const QColorTransferFunction &f1, const QColorTransferFunction &f2)
+{
+ return f1.matches(f2);
+}
+inline bool operator!=(const QColorTransferFunction &f1, const QColorTransferFunction &f2)
+{
+ return !f1.matches(f2);
+}
+
+QT_END_NAMESPACE
+
+#endif // QCOLORTRANSFERFUNCTION_P_H
diff --git a/src/gui/painting/qcolortransfertable_p.h b/src/gui/painting/qcolortransfertable_p.h
new file mode 100644
index 0000000000..c8b2f7bd92
--- /dev/null
+++ b/src/gui/painting/qcolortransfertable_p.h
@@ -0,0 +1,245 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORTRANSFERTABLE_P_H
+#define QCOLORTRANSFERTABLE_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/private/qtguiglobal_p.h>
+#include "qcolortransferfunction_p.h"
+
+#include <QVector>
+#include <cmath>
+
+QT_BEGIN_NAMESPACE
+
+// Defines either an ICC TRC 'curve' or a lut8/lut16 A or B table
+class Q_GUI_EXPORT QColorTransferTable
+{
+public:
+ QColorTransferTable() noexcept
+ : m_tableSize(0)
+ { }
+ QColorTransferTable(uint32_t size, const QVector<uint8_t> &table) noexcept
+ : m_tableSize(size)
+ , m_table8(table)
+ { }
+ QColorTransferTable(uint32_t size, const QVector<uint16_t> &table) noexcept
+ : m_tableSize(size)
+ , m_table16(table)
+ { }
+
+ bool isValid() const
+ {
+ if (m_tableSize < 2)
+ return false;
+
+#if !defined(QT_NO_DEBUG)
+ // The table must describe an injective curve:
+ if (!m_table8.isEmpty()) {
+ uint8_t val = 0;
+ for (uint i = 0; i < m_tableSize; ++i) {
+ Q_ASSERT(m_table8[i] >= val);
+ val = m_table8[i];
+ }
+ }
+ if (!m_table16.isEmpty()) {
+ uint16_t val = 0;
+ for (uint i = 0; i < m_tableSize; ++i) {
+ Q_ASSERT(m_table16[i] >= val);
+ val = m_table16[i];
+ }
+ }
+#endif
+ return !m_table8.isEmpty() || !m_table16.isEmpty();
+ }
+
+ float apply(float x) const
+ {
+ x = std::min(std::max(x, 0.0f), 1.0f);
+ x *= m_tableSize - 1;
+ uint32_t lo = (int)std::floor(x);
+ uint32_t hi = std::min(lo + 1, m_tableSize);
+ float frac = x - lo;
+ if (!m_table16.isEmpty())
+ return (m_table16[lo] * (1.0f - frac) + m_table16[hi] * frac) * (1.0f/65535.0f);
+ if (!m_table8.isEmpty())
+ return (m_table8[lo] * (1.0f - frac) + m_table8[hi] * frac) * (1.0f/255.0f);
+ return x;
+ }
+
+ // Apply inverse, optimized by giving a previous result a value < x.
+ float applyInverse(float x, float resultLargerThan = 0.0f) const
+ {
+ Q_ASSERT(resultLargerThan >= 0.0f && resultLargerThan <= 1.0f);
+ if (x <= 0.0f)
+ return 0.0f;
+ if (x >= 1.0f)
+ return 1.0f;
+ if (!m_table16.isEmpty()) {
+ float v = x * 65535.0f;
+ uint i = std::floor(resultLargerThan * (m_tableSize - 1)) + 1;
+ for ( ; i < m_tableSize; ++i) {
+ if (m_table16[i] > v)
+ break;
+ }
+ if (i >= m_tableSize - 1)
+ return 1.0f;
+ float y1 = m_table16[i - 1];
+ float y2 = m_table16[i];
+ Q_ASSERT(x >= y1 && x < y2);
+ float fr = (v - y1) / (y2 - y1);
+ return (i + fr) * (1.0f / (m_tableSize - 1));
+
+ }
+ if (!m_table8.isEmpty()) {
+ float v = x * 255.0f;
+ uint i = std::floor(resultLargerThan * (m_tableSize - 1)) + 1;
+ for ( ; i < m_tableSize; ++i) {
+ if (m_table8[i] > v)
+ break;
+ }
+ if (i >= m_tableSize - 1)
+ return 1.0f;
+ float y1 = m_table8[i - 1];
+ float y2 = m_table8[i];
+ Q_ASSERT(x >= y1 && x < y2);
+ float fr = (v - y1) / (y2 - y1);
+ return (i + fr) * (1.0f / (m_tableSize - 1));
+ }
+ return x;
+ }
+
+ bool asColorTransferFunction(QColorTransferFunction *transferFn)
+ {
+ Q_ASSERT(isValid());
+ Q_ASSERT(transferFn);
+ if (!m_table8.isEmpty() && (m_table8[0] != 0 || m_table8[m_tableSize - 1] != 255))
+ return false;
+ if (!m_table16.isEmpty() && (m_table16[0] != 0 || m_table16[m_tableSize - 1] != 65535))
+ return false;
+ if (m_tableSize == 2) {
+ *transferFn = QColorTransferFunction(); // Linear
+ return true;
+ }
+ // The following heuristics are based on those from Skia:
+ if (m_tableSize == 26 && !m_table16.isEmpty()) {
+ // code.facebook.com/posts/411525055626587/under-the-hood-improving-facebook-photos
+ if (m_table16[6] != 3062)
+ return false;
+ if (m_table16[12] != 12824)
+ return false;
+ if (m_table16[18] != 31237)
+ return false;
+ *transferFn = QColorTransferFunction::fromSRgb();
+ return true;
+ }
+ if (m_tableSize == 1024 && !m_table16.isEmpty()) {
+ // HP and Canon sRGB gamma tables:
+ if (m_table16[257] != 3366)
+ return false;
+ if (m_table16[513] != 14116)
+ return false;
+ if (m_table16[768] != 34318)
+ return false;
+ *transferFn = QColorTransferFunction::fromSRgb();
+ return true;
+ }
+ if (m_tableSize == 4096 && !m_table16.isEmpty()) {
+ // Nikon, Epson, and lcms2 sRGB gamma tables:
+ if (m_table16[515] != 960)
+ return false;
+ if (m_table16[1025] != 3342)
+ return false;
+ if (m_table16[2051] != 14079)
+ return false;
+ *transferFn = QColorTransferFunction::fromSRgb();
+ return true;
+ }
+ return false;
+ }
+ friend inline bool operator!=(const QColorTransferTable &t1, const QColorTransferTable &t2);
+ friend inline bool operator==(const QColorTransferTable &t1, const QColorTransferTable &t2);
+
+ uint32_t m_tableSize;
+ QVector<uint8_t> m_table8;
+ QVector<uint16_t> m_table16;
+};
+
+inline bool operator!=(const QColorTransferTable &t1, const QColorTransferTable &t2)
+{
+ if (t1.m_tableSize != t2.m_tableSize)
+ return true;
+ if (t1.m_table8.isEmpty() != t2.m_table8.isEmpty())
+ return true;
+ if (t1.m_table16.isEmpty() != t2.m_table16.isEmpty())
+ return true;
+ if (!t1.m_table8.isEmpty()) {
+ for (quint32 i = 0; i < t1.m_tableSize; ++i) {
+ if (t1.m_table8[i] != t2.m_table8[i])
+ return true;
+ }
+ }
+ if (!t1.m_table16.isEmpty()) {
+ for (quint32 i = 0; i < t1.m_tableSize; ++i) {
+ if (t1.m_table16[i] != t2.m_table16[i])
+ return true;
+ }
+ }
+ return false;
+}
+
+inline bool operator==(const QColorTransferTable &t1, const QColorTransferTable &t2)
+{
+ return !(t1 != t2);
+}
+
+QT_END_NAMESPACE
+
+#endif // QCOLORTRANSFERTABLE_P_H
diff --git a/src/gui/painting/qcolortransform.cpp b/src/gui/painting/qcolortransform.cpp
new file mode 100644
index 0000000000..10ccefed74
--- /dev/null
+++ b/src/gui/painting/qcolortransform.cpp
@@ -0,0 +1,720 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qcolortransform.h"
+#include "qcolortransform_p.h"
+
+#include "qcolormatrix_p.h"
+#include "qcolorspace_p.h"
+#include "qcolortrc_p.h"
+#include "qcolortrclut_p.h"
+
+#include <QtCore/qatomic.h>
+#include <QtCore/qmath.h>
+#include <QtGui/qcolor.h>
+#include <QtGui/qtransform.h>
+#include <QtCore/private/qsimd_p.h>
+
+#include <qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+QColorTrcLut *lutFromTrc(const QColorTrc &trc)
+{
+ if (trc.m_type == QColorTrc::Type::Table)
+ return QColorTrcLut::fromTransferTable(trc.m_table);
+ if (trc.m_type == QColorTrc::Type::Function)
+ return QColorTrcLut::fromTransferFunction(trc.m_fun);
+ qWarning() << "TRC uninitialized";
+ return nullptr;
+}
+
+void QColorTransformPrivate::updateLutsIn() const
+{
+ if (colorSpaceIn->lut.generated.loadAcquire())
+ return;
+ QMutexLocker lock(&QColorSpacePrivate::s_lutWriteLock);
+ if (colorSpaceIn->lut.generated.loadRelaxed())
+ return;
+
+ for (int i = 0; i < 3; ++i) {
+ if (!colorSpaceIn->trc[i].isValid())
+ return;
+ }
+
+ if (colorSpaceIn->trc[0] == colorSpaceIn->trc[1] && colorSpaceIn->trc[0] == colorSpaceIn->trc[2]) {
+ colorSpaceIn->lut[0].reset(lutFromTrc(colorSpaceIn->trc[0]));
+ colorSpaceIn->lut[1] = colorSpaceIn->lut[0];
+ colorSpaceIn->lut[2] = colorSpaceIn->lut[0];
+ } else {
+ for (int i = 0; i < 3; ++i)
+ colorSpaceIn->lut[i].reset(lutFromTrc(colorSpaceIn->trc[i]));
+ }
+
+ colorSpaceIn->lut.generated.storeRelease(1);
+}
+
+void QColorTransformPrivate::updateLutsOut() const
+{
+ if (colorSpaceOut->lut.generated.loadAcquire())
+ return;
+ QMutexLocker lock(&QColorSpacePrivate::s_lutWriteLock);
+ if (colorSpaceOut->lut.generated.loadRelaxed())
+ return;
+ for (int i = 0; i < 3; ++i) {
+ if (!colorSpaceOut->trc[i].isValid())
+ return;
+ }
+
+ if (colorSpaceOut->trc[0] == colorSpaceOut->trc[1] && colorSpaceOut->trc[0] == colorSpaceOut->trc[2]) {
+ colorSpaceOut->lut[0].reset(lutFromTrc(colorSpaceOut->trc[0]));
+ colorSpaceOut->lut[1] = colorSpaceOut->lut[0];
+ colorSpaceOut->lut[2] = colorSpaceOut->lut[0];
+ } else {
+ for (int i = 0; i < 3; ++i)
+ colorSpaceOut->lut[i].reset(lutFromTrc(colorSpaceOut->trc[i]));
+ }
+
+ colorSpaceOut->lut.generated.storeRelease(1);
+}
+
+/*!
+ \class QColorTransform
+ \brief The QColorTransform class is a transformation between color spaces.
+ \since 5.14
+
+ \ingroup painting
+ \ingroup appearance
+ \inmodule QtGui
+
+ QColorTransform is an instantiation of a transformation between color spaces.
+ It can be applied on color and pixels to convert them from one color space to
+ another.
+
+ Setting up a QColorTransform takes some preprocessing, so keeping around
+ QColorTransforms that you need often is recommended, instead of generating
+ them on the fly.
+*/
+
+
+QColorTransform::QColorTransform(const QColorTransform &colorTransform) noexcept
+ : d(colorTransform.d)
+{
+ if (d)
+ d->ref.ref();
+}
+
+
+QColorTransform::~QColorTransform()
+{
+ if (d && !d->ref.deref())
+ delete d;
+}
+
+/*!
+ Applies the color transformation on the QRgb value \a argb.
+
+ The input should be opaque or unpremultiplied.
+*/
+QRgb QColorTransform::map(QRgb argb) const
+{
+ if (!d)
+ return argb;
+ constexpr float f = 1.0f / 255.0f;
+ QColorVector c = { qRed(argb) * f, qGreen(argb) * f, qBlue(argb) * f };
+ c.x = d->colorSpaceIn->trc[0].apply(c.x);
+ c.y = d->colorSpaceIn->trc[1].apply(c.y);
+ c.z = d->colorSpaceIn->trc[2].apply(c.z);
+ c = d->colorMatrix.map(c);
+ c.x = std::max(0.0f, std::min(1.0f, c.x));
+ c.y = std::max(0.0f, std::min(1.0f, c.y));
+ c.z = std::max(0.0f, std::min(1.0f, c.z));
+ if (d->colorSpaceOut->lut.generated.loadAcquire()) {
+ c.x = d->colorSpaceOut->lut[0]->fromLinear(c.x);
+ c.y = d->colorSpaceOut->lut[1]->fromLinear(c.y);
+ c.z = d->colorSpaceOut->lut[2]->fromLinear(c.z);
+ } else {
+ c.x = d->colorSpaceOut->trc[0].applyInverse(c.x);
+ c.y = d->colorSpaceOut->trc[1].applyInverse(c.y);
+ c.z = d->colorSpaceOut->trc[2].applyInverse(c.z);
+ }
+
+ return qRgba(c.x * 255 + 0.5f, c.y * 255 + 0.5f, c.z * 255 + 0.5f, qAlpha(argb));
+}
+
+/*!
+ Applies the color transformation on the QRgba64 value \a rgba64.
+
+ The input should be opaque or unpremultiplied.
+*/
+QRgba64 QColorTransform::map(QRgba64 rgba64) const
+{
+ if (!d)
+ return rgba64;
+ constexpr float f = 1.0f / 65535.0f;
+ QColorVector c = { rgba64.red() * f, rgba64.green() * f, rgba64.blue() * f };
+ c.x = d->colorSpaceIn->trc[0].apply(c.x);
+ c.y = d->colorSpaceIn->trc[1].apply(c.y);
+ c.z = d->colorSpaceIn->trc[2].apply(c.z);
+ c = d->colorMatrix.map(c);
+ c.x = std::max(0.0f, std::min(1.0f, c.x));
+ c.y = std::max(0.0f, std::min(1.0f, c.y));
+ c.z = std::max(0.0f, std::min(1.0f, c.z));
+ if (d->colorSpaceOut->lut.generated.loadAcquire()) {
+ c.x = d->colorSpaceOut->lut[0]->fromLinear(c.x);
+ c.y = d->colorSpaceOut->lut[1]->fromLinear(c.y);
+ c.z = d->colorSpaceOut->lut[2]->fromLinear(c.z);
+ } else {
+ c.x = d->colorSpaceOut->trc[0].applyInverse(c.x);
+ c.y = d->colorSpaceOut->trc[1].applyInverse(c.y);
+ c.z = d->colorSpaceOut->trc[2].applyInverse(c.z);
+ }
+
+ return QRgba64::fromRgba64(c.x * 65535, c.y * 65535, c.z * 65535, rgba64.alpha());
+}
+
+/*!
+ Applies the color transformation on the QColor value \a color.
+
+*/
+QColor QColorTransform::map(const QColor &color) const
+{
+ if (!d)
+ return color;
+ QColor clr = color;
+ if (color.spec() != QColor::ExtendedRgb || color.spec() != QColor::Rgb)
+ clr = clr.toRgb();
+
+ QColorVector c = { (float)clr.redF(), (float)clr.greenF(), (float)clr.blueF() };
+ if (clr.spec() == QColor::ExtendedRgb) {
+ c.x = d->colorSpaceIn->trc[0].applyExtended(c.x);
+ c.y = d->colorSpaceIn->trc[1].applyExtended(c.y);
+ c.z = d->colorSpaceIn->trc[2].applyExtended(c.z);
+ } else {
+ c.x = d->colorSpaceIn->trc[0].apply(c.x);
+ c.y = d->colorSpaceIn->trc[1].apply(c.y);
+ c.z = d->colorSpaceIn->trc[2].apply(c.z);
+ }
+ c = d->colorMatrix.map(c);
+ bool inGamut = c.x >= 0.0f && c.x <= 1.0f && c.y >= 0.0f && c.y <= 1.0f && c.z >= 0.0f && c.z <= 1.0f;
+ if (inGamut) {
+ if (d->colorSpaceOut->lut.generated.loadAcquire()) {
+ c.x = d->colorSpaceOut->lut[0]->fromLinear(c.x);
+ c.y = d->colorSpaceOut->lut[1]->fromLinear(c.y);
+ c.z = d->colorSpaceOut->lut[2]->fromLinear(c.z);
+ } else {
+ c.x = d->colorSpaceOut->trc[0].applyInverse(c.x);
+ c.y = d->colorSpaceOut->trc[1].applyInverse(c.y);
+ c.z = d->colorSpaceOut->trc[2].applyInverse(c.z);
+ }
+ } else {
+ c.x = d->colorSpaceOut->trc[0].applyInverseExtended(c.x);
+ c.y = d->colorSpaceOut->trc[1].applyInverseExtended(c.y);
+ c.z = d->colorSpaceOut->trc[2].applyInverseExtended(c.z);
+ }
+ QColor out;
+ out.setRgbF(c.x, c.y, c.z, color.alphaF());
+ return out;
+}
+
+// Optimized sub-routines for fast block based conversion:
+
+static void applyMatrix(QColorVector *buffer, const qsizetype len, const QColorMatrix &colorMatrix)
+{
+#if defined(__SSE2__)
+ const __m128 minV = _mm_set1_ps(0.0f);
+ const __m128 maxV = _mm_set1_ps(1.0f);
+ const __m128 xMat = _mm_loadu_ps(&colorMatrix.r.x);
+ const __m128 yMat = _mm_loadu_ps(&colorMatrix.g.x);
+ const __m128 zMat = _mm_loadu_ps(&colorMatrix.b.x);
+ for (qsizetype j = 0; j < len; ++j) {
+ __m128 c = _mm_loadu_ps(&buffer[j].x);
+ __m128 cx = _mm_shuffle_ps(c, c, _MM_SHUFFLE(0, 0, 0, 0));
+ __m128 cy = _mm_shuffle_ps(c, c, _MM_SHUFFLE(1, 1, 1, 1));
+ __m128 cz = _mm_shuffle_ps(c, c, _MM_SHUFFLE(2, 2, 2, 2));
+ cx = _mm_mul_ps(cx, xMat);
+ cy = _mm_mul_ps(cy, yMat);
+ cz = _mm_mul_ps(cz, zMat);
+ cx = _mm_add_ps(cx, cy);
+ cx = _mm_add_ps(cx, cz);
+ // Clamp:
+ cx = _mm_min_ps(cx, maxV);
+ cx = _mm_max_ps(cx, minV);
+ _mm_storeu_ps(&buffer[j].x, cx);
+ }
+#else
+ for (int j = 0; j < len; ++j) {
+ const QColorVector cv = colorMatrix.map(buffer[j]);
+ buffer[j].x = std::max(0.0f, std::min(1.0f, cv.x));
+ buffer[j].y = std::max(0.0f, std::min(1.0f, cv.y));
+ buffer[j].z = std::max(0.0f, std::min(1.0f, cv.z));
+ }
+#endif
+}
+
+template<typename T>
+static void loadPremultiplied(QColorVector *buffer, const T *src, const qsizetype len, const QColorTransformPrivate *d_ptr);
+template<typename T>
+static void loadUnpremultiplied(QColorVector *buffer, const T *src, const qsizetype len, const QColorTransformPrivate *d_ptr);
+
+#if defined(__SSE2__)
+// Load to [0-alpha] in 4x32 SIMD
+template<typename T>
+static inline void loadP(const T &p, __m128i &v);
+
+template<>
+inline void loadP<QRgb>(const QRgb &p, __m128i &v)
+{
+ v = _mm_cvtsi32_si128(p);
+#if defined(__SSE4_1__)
+ v = _mm_cvtepu8_epi32(v);
+#else
+ v = _mm_unpacklo_epi8(v, _mm_setzero_si128());
+ v = _mm_unpacklo_epi16(v, _mm_setzero_si128());
+#endif
+}
+
+template<>
+inline void loadP<QRgba64>(const QRgba64 &p, __m128i &v)
+{
+ v = _mm_loadl_epi64((const __m128i *)&p);
+#if defined(__SSE4_1__)
+ v = _mm_cvtepu16_epi32(v);
+#else
+ v = _mm_unpacklo_epi16(v, _mm_setzero_si128());
+#endif
+ // Shuffle to ARGB as the template below expects it
+ v = _mm_shuffle_epi32(v, _MM_SHUFFLE(3, 0, 1, 2));
+}
+
+template<typename T>
+static void loadPremultiplied(QColorVector *buffer, const T *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
+{
+ const __m128 v4080 = _mm_set1_ps(4080.f);
+ const __m128 iFF00 = _mm_set1_ps(1.0f / (255 * 256));
+ for (qsizetype i = 0; i < len; ++i) {
+ __m128i v;
+ loadP<T>(src[i], v);
+ __m128 vf = _mm_cvtepi32_ps(v);
+ // Approximate 1/a:
+ __m128 va = _mm_shuffle_ps(vf, vf, _MM_SHUFFLE(3, 3, 3, 3));
+ __m128 via = _mm_rcp_ps(va);
+ via = _mm_sub_ps(_mm_add_ps(via, via), _mm_mul_ps(via, _mm_mul_ps(via, va)));
+ // v * (1/a)
+ vf = _mm_mul_ps(vf, via);
+
+ // Handle zero alpha
+ __m128 vAlphaMask = _mm_cmpeq_ps(va, _mm_set1_ps(0.0f));
+ vf = _mm_andnot_ps(vAlphaMask, vf);
+
+ // LUT
+ v = _mm_cvtps_epi32(_mm_mul_ps(vf, v4080));
+ const int ridx = _mm_extract_epi16(v, 4);
+ const int gidx = _mm_extract_epi16(v, 2);
+ const int bidx = _mm_extract_epi16(v, 0);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceIn->lut[0]->m_toLinear[ridx], 0);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceIn->lut[1]->m_toLinear[gidx], 2);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceIn->lut[2]->m_toLinear[bidx], 4);
+ vf = _mm_mul_ps(_mm_cvtepi32_ps(v), iFF00);
+
+ _mm_storeu_ps(&buffer[i].x, vf);
+ }
+}
+
+// Load to [0-4080] in 4x32 SIMD
+template<typename T>
+static inline void loadPU(const T &p, __m128i &v);
+
+template<>
+inline void loadPU<QRgb>(const QRgb &p, __m128i &v)
+{
+ v = _mm_cvtsi32_si128(p);
+#if defined(__SSE4_1__)
+ v = _mm_cvtepu8_epi32(v);
+#else
+ v = _mm_unpacklo_epi8(v, _mm_setzero_si128());
+ v = _mm_unpacklo_epi16(v, _mm_setzero_si128());
+#endif
+ v = _mm_slli_epi32(v, 4);
+}
+
+template<>
+inline void loadPU<QRgba64>(const QRgba64 &p, __m128i &v)
+{
+ v = _mm_loadl_epi64((const __m128i *)&p);
+ v = _mm_sub_epi16(v, _mm_srli_epi16(v, 8));
+#if defined(__SSE4_1__)
+ v = _mm_cvtepu16_epi32(v);
+#else
+ v = _mm_unpacklo_epi16(v, _mm_setzero_si128());
+#endif
+ v = _mm_srli_epi32(v, 4);
+ // Shuffle to ARGB as the template below expects it
+ v = _mm_shuffle_epi32(v, _MM_SHUFFLE(3, 0, 1, 2));
+}
+
+template<typename T>
+void loadUnpremultiplied(QColorVector *buffer, const T *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
+{
+ const __m128 iFF00 = _mm_set1_ps(1.0f / (255 * 256));
+ for (qsizetype i = 0; i < len; ++i) {
+ __m128i v;
+ loadPU<T>(src[i], v);
+ const int ridx = _mm_extract_epi16(v, 4);
+ const int gidx = _mm_extract_epi16(v, 2);
+ const int bidx = _mm_extract_epi16(v, 0);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceIn->lut[0]->m_toLinear[ridx], 0);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceIn->lut[1]->m_toLinear[gidx], 2);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceIn->lut[2]->m_toLinear[bidx], 4);
+ __m128 vf = _mm_mul_ps(_mm_cvtepi32_ps(v), iFF00);
+ _mm_storeu_ps(&buffer[i].x, vf);
+ }
+}
+
+#else
+template<>
+void loadPremultiplied<QRgb>(QColorVector *buffer, const QRgb *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
+{
+ for (qsizetype i = 0; i < len; ++i) {
+ const uint p = src[i];
+ const int a = qAlpha(p);
+ if (a) {
+ const float ia = 4080.0f / a;
+ const int ridx = int(qRed(p) * ia + 0.5f);
+ const int gidx = int(qGreen(p) * ia + 0.5f);
+ const int bidx = int(qBlue(p) * ia + 0.5f);
+ buffer[i].x = d_ptr->colorSpaceIn->lut[0]->m_toLinear[ridx] * (1.0f / (255 * 256));
+ buffer[i].y = d_ptr->colorSpaceIn->lut[1]->m_toLinear[gidx] * (1.0f / (255 * 256));
+ buffer[i].z = d_ptr->colorSpaceIn->lut[2]->m_toLinear[bidx] * (1.0f / (255 * 256));
+ } else {
+ buffer[i].x = buffer[i].y = buffer[i].z = 0.0f;
+ }
+ }
+}
+
+template<>
+void loadPremultiplied<QRgba64>(QColorVector *buffer, const QRgba64 *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
+{
+ for (qsizetype i = 0; i < len; ++i) {
+ const QRgba64 &p = src[i];
+ const int a = p.alpha();
+ if (a) {
+ const float ia = 4080.0f / a;
+ const int ridx = int(p.red() * ia + 0.5f);
+ const int gidx = int(p.green() * ia + 0.5f);
+ const int bidx = int(p.blue() * ia + 0.5f);
+ buffer[i].x = d_ptr->colorSpaceIn->lut[0]->m_toLinear[ridx] * (1.0f / (255 * 256));
+ buffer[i].y = d_ptr->colorSpaceIn->lut[1]->m_toLinear[gidx] * (1.0f / (255 * 256));
+ buffer[i].z = d_ptr->colorSpaceIn->lut[2]->m_toLinear[bidx] * (1.0f / (255 * 256));
+ } else {
+ buffer[i].x = buffer[i].y = buffer[i].z = 0.0f;
+ }
+ }
+}
+
+template<>
+void loadUnpremultiplied<QRgb>(QColorVector *buffer, const QRgb *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
+{
+ for (qsizetype i = 0; i < len; ++i) {
+ const uint p = src[i];
+ buffer[i].x = d_ptr->colorSpaceIn->lut[0]->u8ToLinearF32(qRed(p));
+ buffer[i].y = d_ptr->colorSpaceIn->lut[1]->u8ToLinearF32(qGreen(p));
+ buffer[i].z = d_ptr->colorSpaceIn->lut[2]->u8ToLinearF32(qBlue(p));
+ }
+}
+
+template<>
+void loadUnpremultiplied<QRgba64>(QColorVector *buffer, const QRgba64 *src, const qsizetype len, const QColorTransformPrivate *d_ptr)
+{
+ for (qsizetype i = 0; i < len; ++i) {
+ const QRgba64 &p = src[i];
+ buffer[i].x = d_ptr->colorSpaceIn->lut[0]->u16ToLinearF32(p.red());
+ buffer[i].y = d_ptr->colorSpaceIn->lut[1]->u16ToLinearF32(p.green());
+ buffer[i].z = d_ptr->colorSpaceIn->lut[2]->u16ToLinearF32(p.blue());
+ }
+}
+#endif
+
+static void storePremultiplied(QRgb *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len,
+ const QColorTransformPrivate *d_ptr)
+{
+#if defined(__SSE2__)
+ const __m128 v4080 = _mm_set1_ps(4080.f);
+ const __m128 iFF00 = _mm_set1_ps(1.0f / (255 * 256));
+ for (qsizetype i = 0; i < len; ++i) {
+ const int a = qAlpha(src[i]);
+ __m128 vf = _mm_loadu_ps(&buffer[i].x);
+ __m128i v = _mm_cvtps_epi32(_mm_mul_ps(vf, v4080));
+ __m128 va = _mm_set1_ps(a);
+ va = _mm_mul_ps(va, iFF00);
+ const int ridx = _mm_extract_epi16(v, 0);
+ const int gidx = _mm_extract_epi16(v, 2);
+ const int bidx = _mm_extract_epi16(v, 4);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[0]->m_fromLinear[ridx], 4);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[1]->m_fromLinear[gidx], 2);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[2]->m_fromLinear[bidx], 0);
+ vf = _mm_cvtepi32_ps(v);
+ vf = _mm_mul_ps(vf, va);
+ v = _mm_cvtps_epi32(vf);
+ v = _mm_packs_epi32(v, v);
+ v = _mm_insert_epi16(v, a, 3);
+ v = _mm_packus_epi16(v, v);
+ dst[i] = _mm_cvtsi128_si32(v);
+ }
+#else
+ for (qsizetype i = 0; i < len; ++i) {
+ const int a = qAlpha(src[i]);
+ const float fa = a / (255.0f * 256.0f);
+ const float r = d_ptr->colorSpaceOut->lut[0]->m_fromLinear[int(buffer[i].x * 4080.0f + 0.5f)];
+ const float g = d_ptr->colorSpaceOut->lut[1]->m_fromLinear[int(buffer[i].y * 4080.0f + 0.5f)];
+ const float b = d_ptr->colorSpaceOut->lut[2]->m_fromLinear[int(buffer[i].z * 4080.0f + 0.5f)];
+ dst[i] = qRgba(r * fa + 0.5f, g * fa + 0.5f, b * fa + 0.5f, a);
+ }
+#endif
+}
+
+static void storeUnpremultiplied(QRgb *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len,
+ const QColorTransformPrivate *d_ptr)
+{
+#if defined(__SSE2__)
+ const __m128 v4080 = _mm_set1_ps(4080.f);
+ for (qsizetype i = 0; i < len; ++i) {
+ const int a = qAlpha(src[i]);
+ __m128 vf = _mm_loadu_ps(&buffer[i].x);
+ __m128i v = _mm_cvtps_epi32(_mm_mul_ps(vf, v4080));
+ const int ridx = _mm_extract_epi16(v, 0);
+ const int gidx = _mm_extract_epi16(v, 2);
+ const int bidx = _mm_extract_epi16(v, 4);
+ v = _mm_setzero_si128();
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[0]->m_fromLinear[ridx], 2);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[1]->m_fromLinear[gidx], 1);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[2]->m_fromLinear[bidx], 0);
+ v = _mm_add_epi16(v, _mm_set1_epi16(0x80));
+ v = _mm_srli_epi16(v, 8);
+ v = _mm_insert_epi16(v, a, 3);
+ v = _mm_packus_epi16(v, v);
+ dst[i] = _mm_cvtsi128_si32(v);
+ }
+#else
+ for (qsizetype i = 0; i < len; ++i) {
+ const int r = d_ptr->colorSpaceOut->lut[0]->u8FromLinearF32(buffer[i].x);
+ const int g = d_ptr->colorSpaceOut->lut[1]->u8FromLinearF32(buffer[i].y);
+ const int b = d_ptr->colorSpaceOut->lut[2]->u8FromLinearF32(buffer[i].z);
+ dst[i] = (src[i] & 0xff000000) | (r << 16) | (g << 8) | (b << 0);
+ }
+#endif
+}
+
+static void storeOpaque(QRgb *dst, const QRgb *src, const QColorVector *buffer, const qsizetype len,
+ const QColorTransformPrivate *d_ptr)
+{
+ Q_UNUSED(src);
+#if defined(__SSE2__)
+ const __m128 v4080 = _mm_set1_ps(4080.f);
+ for (qsizetype i = 0; i < len; ++i) {
+ __m128 vf = _mm_loadu_ps(&buffer[i].x);
+ __m128i v = _mm_cvtps_epi32(_mm_mul_ps(vf, v4080));
+ const int ridx = _mm_extract_epi16(v, 0);
+ const int gidx = _mm_extract_epi16(v, 2);
+ const int bidx = _mm_extract_epi16(v, 4);
+ v = _mm_setzero_si128();
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[0]->m_fromLinear[ridx], 2);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[1]->m_fromLinear[gidx], 1);
+ v = _mm_insert_epi16(v, d_ptr->colorSpaceOut->lut[2]->m_fromLinear[bidx], 0);
+ v = _mm_add_epi16(v, _mm_set1_epi16(0x80));
+ v = _mm_srli_epi16(v, 8);
+ v = _mm_insert_epi16(v, 255, 3);
+ v = _mm_packus_epi16(v, v);
+ dst[i] = _mm_cvtsi128_si32(v);
+ }
+#else
+ for (qsizetype i = 0; i < len; ++i) {
+ const int r = d_ptr->colorSpaceOut->lut[0]->u8FromLinearF32(buffer[i].x);
+ const int g = d_ptr->colorSpaceOut->lut[1]->u8FromLinearF32(buffer[i].y);
+ const int b = d_ptr->colorSpaceOut->lut[2]->u8FromLinearF32(buffer[i].z);
+ dst[i] = 0xff000000 | (r << 16) | (g << 8) | (b << 0);
+ }
+#endif
+}
+
+static void storePremultiplied(QRgba64 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len,
+ const QColorTransformPrivate *d_ptr)
+{
+ for (qsizetype i = 0; i < len; ++i) {
+ const int a = src[i].alpha();
+ const float fa = a / (255.0f * 256.0f);
+ const float r = d_ptr->colorSpaceOut->lut[0]->m_fromLinear[int(buffer[i].x * 4080.0f + 0.5f)];
+ const float g = d_ptr->colorSpaceOut->lut[1]->m_fromLinear[int(buffer[i].y * 4080.0f + 0.5f)];
+ const float b = d_ptr->colorSpaceOut->lut[2]->m_fromLinear[int(buffer[i].z * 4080.0f + 0.5f)];
+ dst[i] = qRgba64(r * fa + 0.5f, g * fa + 0.5f, b * fa + 0.5f, a);
+ }
+}
+
+static void storeUnpremultiplied(QRgba64 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len,
+ const QColorTransformPrivate *d_ptr)
+{
+ for (qsizetype i = 0; i < len; ++i) {
+ const int r = d_ptr->colorSpaceOut->lut[0]->u16FromLinearF32(buffer[i].x);
+ const int g = d_ptr->colorSpaceOut->lut[1]->u16FromLinearF32(buffer[i].y);
+ const int b = d_ptr->colorSpaceOut->lut[2]->u16FromLinearF32(buffer[i].z);
+ dst[i] = qRgba64(r, g, b, src[i].alpha());
+ }
+}
+
+static void storeOpaque(QRgba64 *dst, const QRgba64 *src, const QColorVector *buffer, const qsizetype len,
+ const QColorTransformPrivate *d_ptr)
+{
+ Q_UNUSED(src);
+ for (qsizetype i = 0; i < len; ++i) {
+ const int r = d_ptr->colorSpaceOut->lut[0]->u16FromLinearF32(buffer[i].x);
+ const int g = d_ptr->colorSpaceOut->lut[1]->u16FromLinearF32(buffer[i].y);
+ const int b = d_ptr->colorSpaceOut->lut[2]->u16FromLinearF32(buffer[i].z);
+ dst[i] = qRgba64(r, g, b, 0xFFFF);
+ }
+}
+
+static constexpr qsizetype WorkBlockSize = 256;
+
+template <typename T, int Count = 1>
+class QUninitialized
+{
+public:
+ operator T*() { return reinterpret_cast<T *>(this); }
+private:
+ alignas(T) char data[sizeof(T) * Count];
+};
+
+template<typename T>
+void QColorTransformPrivate::apply(T *dst, const T *src, qsizetype count, TransformFlags flags) const
+{
+ if (!colorMatrix.isValid())
+ return;
+
+ updateLutsIn();
+ updateLutsOut();
+
+ bool doApplyMatrix = (colorMatrix != QColorMatrix::identity());
+
+ QUninitialized<QColorVector, WorkBlockSize> buffer;
+
+ qsizetype i = 0;
+ while (i < count) {
+ const qsizetype len = qMin(count - i, WorkBlockSize);
+ if (flags & InputPremultiplied)
+ loadPremultiplied(buffer, src + i, len, this);
+ else
+ loadUnpremultiplied(buffer, src + i, len, this);
+
+ if (doApplyMatrix)
+ applyMatrix(buffer, len, colorMatrix);
+
+ if (flags & InputOpaque)
+ storeOpaque(dst + i, src + i, buffer, len, this);
+ else if (flags & OutputPremultiplied)
+ storePremultiplied(dst + i, src + i, buffer, len, this);
+ else
+ storeUnpremultiplied(dst + i, src + i, buffer, len, this);
+
+ i += len;
+ }
+}
+
+/*!
+ \internal
+ \enum QColorTransformPrivate::TransformFlag
+
+ Defines how the transform is to be applied.
+
+ \value Unpremultiplied The input and output should both be unpremultiplied.
+ \value InputOpaque The input is guaranteed to be opaque.
+ \value InputPremultiplied The input is premultiplied.
+ \value OutputPremultiplied The output should be premultiplied.
+ \value Premultiplied Both input and output should both be premultiplied.
+*/
+
+/*!
+ \internal
+ Prepares a color transformation for fast application. You do not need to
+ call this explicitly as it will be called implicitly on the first transforms, but
+ if you want predictable performance on the first transforms, you can perform it
+ in advance.
+
+ \sa QColorTransform::map(), apply()
+*/
+void QColorTransformPrivate::prepare()
+{
+ updateLutsIn();
+ updateLutsOut();
+}
+
+/*!
+ \internal
+ Applies the color transformation on \a count QRgb pixels starting from
+ \a src and stores the result in \a dst.
+
+ Thread-safe if prepare() has been called first.
+
+ Assumes unpremultiplied data by default. Set \a flags to change defaults.
+
+ \sa prepare()
+*/
+void QColorTransformPrivate::apply(QRgb *dst, const QRgb *src, qsizetype count, TransformFlags flags) const
+{
+ apply<QRgb>(dst, src, count, flags);
+}
+
+/*!
+ \internal
+ Applies the color transformation on \a count QRgba64 pixels starting from
+ \a src and stores the result in \a dst.
+
+ Thread-safe if prepare() has been called first.
+
+ Assumes unpremultiplied data by default. Set \a flags to change defaults.
+
+ \sa prepare()
+*/
+void QColorTransformPrivate::apply(QRgba64 *dst, const QRgba64 *src, qsizetype count, TransformFlags flags) const
+{
+ apply<QRgba64>(dst, src, count, flags);
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/gui/painting/qcolortransform.h b/src/gui/painting/qcolortransform.h
new file mode 100644
index 0000000000..94b6b3a385
--- /dev/null
+++ b/src/gui/painting/qcolortransform.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORTRANSFORM_H
+#define QCOLORTRANSFORM_H
+
+#include <QtGui/qtguiglobal.h>
+#include <QtGui/qrgb.h>
+
+QT_BEGIN_NAMESPACE
+
+class QColor;
+class QRgba64;
+class QColorSpacePrivate;
+class QColorTransformPrivate;
+
+class QColorTransform
+{
+public:
+ QColorTransform() noexcept : d(nullptr) { }
+ Q_GUI_EXPORT ~QColorTransform();
+ Q_GUI_EXPORT QColorTransform(const QColorTransform &colorTransform) noexcept;
+ QColorTransform(QColorTransform &&colorTransform) noexcept
+ : d{qExchange(colorTransform.d, nullptr)}
+ { }
+ QColorTransform &operator=(const QColorTransform &other) noexcept
+ {
+ QColorTransform{other}.swap(*this);
+ return *this;
+ }
+ QColorTransform &operator=(QColorTransform &&other) noexcept
+ {
+ QColorTransform{std::move(other)}.swap(*this);
+ return *this;
+ }
+
+ void swap(QColorTransform &other) noexcept { qSwap(d, other.d); }
+
+ Q_GUI_EXPORT QRgb map(QRgb argb) const;
+ Q_GUI_EXPORT QRgba64 map(QRgba64 rgba64) const;
+ Q_GUI_EXPORT QColor map(const QColor &color) const;
+
+private:
+ friend class QColorSpace;
+ friend class QColorSpacePrivate;
+ friend class QImage;
+
+ const QColorTransformPrivate *d;
+};
+
+Q_DECLARE_SHARED(QColorTransform)
+
+QT_END_NAMESPACE
+
+#endif // QCOLORTRANSFORM_H
diff --git a/src/gui/painting/qcolortransform_p.h b/src/gui/painting/qcolortransform_p.h
new file mode 100644
index 0000000000..5d7116248d
--- /dev/null
+++ b/src/gui/painting/qcolortransform_p.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORTRANSFORM_P_H
+#define QCOLORTRANSFORM_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 "qcolormatrix_p.h"
+#include "qcolorspace_p.h"
+
+#include <QtCore/qshareddata.h>
+
+QT_BEGIN_NAMESPACE
+
+class QColorTransformPrivate : public QSharedData
+{
+public:
+ QColorMatrix colorMatrix;
+ QExplicitlySharedDataPointer<const QColorSpacePrivate> colorSpaceIn;
+ QExplicitlySharedDataPointer<const QColorSpacePrivate> colorSpaceOut;
+
+ void updateLutsIn() const;
+ void updateLutsOut() const;
+ bool simpleGammaCorrection() const;
+
+ void prepare();
+ enum TransformFlag {
+ Unpremultiplied = 0,
+ InputOpaque = 1,
+ InputPremultiplied = 2,
+ OutputPremultiplied = 4,
+ Premultiplied = (InputPremultiplied | OutputPremultiplied)
+ };
+ Q_DECLARE_FLAGS(TransformFlags, TransformFlag)
+
+ void apply(QRgb *dst, const QRgb *src, qsizetype count, TransformFlags flags = Unpremultiplied) const;
+ void apply(QRgba64 *dst, const QRgba64 *src, qsizetype count, TransformFlags flags = Unpremultiplied) const;
+
+ template<typename T>
+ void apply(T *dst, const T *src, qsizetype count, TransformFlags flags) const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QCOLORTRANSFORM_P_H
diff --git a/src/gui/painting/qcolortrc_p.h b/src/gui/painting/qcolortrc_p.h
new file mode 100644
index 0000000000..3ef9d442fc
--- /dev/null
+++ b/src/gui/painting/qcolortrc_p.h
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QCOLORTRC_P_H
+#define QCOLORTRC_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/private/qtguiglobal_p.h>
+#include "qcolortransferfunction_p.h"
+#include "qcolortransfertable_p.h"
+
+QT_BEGIN_NAMESPACE
+
+
+// Defines an ICC TRC (Tone Reproduction Curve)
+class Q_GUI_EXPORT QColorTrc
+{
+public:
+ QColorTrc() noexcept : m_type(Type::Uninitialized)
+ { }
+ QColorTrc(const QColorTransferFunction &fun) : m_type(Type::Function), m_fun(fun)
+ { }
+ QColorTrc(const QColorTransferTable &table) : m_type(Type::Table), m_table(table)
+ { }
+
+ enum class Type {
+ Uninitialized,
+ Function,
+ Table
+ };
+
+ bool isLinear() const
+ {
+ return m_type == Type::Uninitialized || (m_type == Type::Function && m_fun.isLinear());
+ }
+ bool isValid() const
+ {
+ return m_type != Type::Uninitialized;
+ }
+ float apply(float x) const
+ {
+ if (m_type == Type::Table)
+ return m_table.apply(x);
+ if (m_type == Type::Function)
+ return m_fun.apply(x);
+ return x;
+ }
+ float applyExtended(float x) const
+ {
+ if (x >= 0.0f && x <= 1.0f)
+ return apply(x);
+ if (m_type == Type::Function)
+ return std::copysign(m_fun.apply(std::abs(x)), x);
+ if (m_type == Type::Table)
+ return x < 0.0f ? 0.0f : 1.0f;
+ return x;
+ }
+ float applyInverse(float x) const
+ {
+ if (m_type == Type::Table)
+ return m_table.applyInverse(x);
+ if (m_type == Type::Function)
+ return m_fun.inverted().apply(x);
+ return x;
+ }
+ float applyInverseExtended(float x) const
+ {
+ if (x >= 0.0f && x <= 1.0f)
+ return applyInverse(x);
+ if (m_type == Type::Function)
+ return std::copysign(applyInverse(x), x);
+ if (m_type == Type::Table)
+ return x < 0.0f ? 0.0f : 1.0f;
+ return x;
+ }
+
+ friend inline bool operator!=(const QColorTrc &o1, const QColorTrc &o2);
+ friend inline bool operator==(const QColorTrc &o1, const QColorTrc &o2);
+
+ Type m_type;
+ QColorTransferFunction m_fun;
+ QColorTransferTable m_table;
+};
+
+inline bool operator!=(const QColorTrc &o1, const QColorTrc &o2)
+{
+ if (o1.m_type != o2.m_type)
+ return true;
+ if (o1.m_type == QColorTrc::Type::Function)
+ return o1.m_fun != o2.m_fun;
+ if (o1.m_type == QColorTrc::Type::Table)
+ return o1.m_table != o2.m_table;
+ return false;
+}
+inline bool operator==(const QColorTrc &o1, const QColorTrc &o2)
+{
+ return !(o1 != o2);
+}
+
+QT_END_NAMESPACE
+
+#endif // QCOLORTRC
diff --git a/src/gui/painting/qcolorprofile.cpp b/src/gui/painting/qcolortrclut.cpp
index 3b7b0a248b..268d7252b4 100644
--- a/src/gui/painting/qcolorprofile.cpp
+++ b/src/gui/painting/qcolortrclut.cpp
@@ -37,14 +37,16 @@
**
****************************************************************************/
-#include "qcolorprofile_p.h"
+#include "qcolortrclut_p.h"
+#include "qcolortransferfunction_p.h"
+#include "qcolortransfertable_p.h"
#include <qmath.h>
QT_BEGIN_NAMESPACE
-QColorProfile *QColorProfile::fromGamma(qreal gamma)
+QColorTrcLut *QColorTrcLut::fromGamma(qreal gamma)
{
- QColorProfile *cp = new QColorProfile;
+ QColorTrcLut *cp = new QColorTrcLut;
for (int i = 0; i <= (255 * 16); ++i) {
cp->m_toLinear[i] = ushort(qRound(qPow(i / qreal(255 * 16), gamma) * (255 * 256)));
@@ -54,31 +56,28 @@ QColorProfile *QColorProfile::fromGamma(qreal gamma)
return cp;
}
-static qreal srgbToLinear(qreal v)
+QColorTrcLut *QColorTrcLut::fromTransferFunction(const QColorTransferFunction &fun)
{
- const qreal a = 0.055;
- if (v <= qreal(0.04045))
- return v / qreal(12.92);
- else
- return qPow((v + a) / (qreal(1) + a), qreal(2.4));
-}
+ QColorTrcLut *cp = new QColorTrcLut;
+ QColorTransferFunction inv = fun.inverted();
-static qreal linearToSrgb(qreal v)
-{
- const qreal a = 0.055;
- if (v <= qreal(0.0031308))
- return v * qreal(12.92);
- else
- return (qreal(1) + a) * qPow(v, qreal(1.0 / 2.4)) - a;
+ for (int i = 0; i <= (255 * 16); ++i) {
+ cp->m_toLinear[i] = ushort(qRound(fun.apply(i / qreal(255 * 16)) * (255 * 256)));
+ cp->m_fromLinear[i] = ushort(qRound(inv.apply(i / qreal(255 * 16)) * (255 * 256)));
+ }
+
+ return cp;
}
-QColorProfile *QColorProfile::fromSRgb()
+QColorTrcLut *QColorTrcLut::fromTransferTable(const QColorTransferTable &table)
{
- QColorProfile *cp = new QColorProfile;
+ QColorTrcLut *cp = new QColorTrcLut;
+ float minInverse = 0.0f;
for (int i = 0; i <= (255 * 16); ++i) {
- cp->m_toLinear[i] = ushort(qRound(srgbToLinear(i / qreal(255 * 16)) * (255 * 256)));
- cp->m_fromLinear[i] = ushort(qRound(linearToSrgb(i / qreal(255 * 16)) * (255 * 256)));
+ cp->m_toLinear[i] = ushort(qBound(0, qRound(table.apply(i / qreal(255 * 16)) * (255 * 256)), 65280));
+ minInverse = table.applyInverse(i / qreal(255 * 16), minInverse);
+ cp->m_fromLinear[i] = ushort(qBound(0, qRound(minInverse * (255 * 256)), 65280));
}
return cp;
diff --git a/src/gui/painting/qcolorprofile_p.h b/src/gui/painting/qcolortrclut_p.h
index 425e9abace..76a6a60803 100644
--- a/src/gui/painting/qcolorprofile_p.h
+++ b/src/gui/painting/qcolortrclut_p.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QCOLORPROFILE_P_H
-#define QCOLORPROFILE_P_H
+#ifndef QCOLORTRCLUT_P_H
+#define QCOLORTRCLUT_P_H
//
// W A R N I N G
@@ -52,21 +52,29 @@
//
#include <QtGui/private/qtguiglobal_p.h>
+#include <QtCore/qsharedpointer.h>
#include <QtGui/qrgb.h>
#include <QtGui/qrgba64.h>
+#include <cmath>
+
#if defined(__SSE2__)
#include <emmintrin.h>
#elif defined(__ARM_NEON__) || defined(__ARM_NEON)
#include <arm_neon.h>
#endif
+
QT_BEGIN_NAMESPACE
-class Q_GUI_EXPORT QColorProfile
+class QColorTransferFunction;
+class QColorTransferTable;
+
+class Q_GUI_EXPORT QColorTrcLut : public QEnableSharedFromThis<QColorTrcLut>
{
public:
- static QColorProfile *fromGamma(qreal gamma);
- static QColorProfile *fromSRgb();
+ static QColorTrcLut *fromGamma(qreal gamma);
+ static QColorTrcLut *fromTransferFunction(const QColorTransferFunction &transfn);
+ static QColorTrcLut *fromTransferTable(const QColorTransferTable &transTable);
// The following methods all convert opaque or unpremultiplied colors:
@@ -121,6 +129,25 @@ public:
return convertWithTable(rgb64, m_toLinear);
}
+ float u8ToLinearF32(int c) const
+ {
+ ushort v = m_toLinear[c << 4];
+ return v * (1.0f / (255*256));
+ }
+
+ float u16ToLinearF32(int c) const
+ {
+ c -= (c >> 8);
+ ushort v = m_toLinear[c >> 4];
+ return v * (1.0f / (255*256));
+ }
+
+ float toLinear(float f) const
+ {
+ ushort v = m_toLinear[(int)(f * (255 * 16) + 0.5f)];
+ return v * (1.0f / (255*256));
+ }
+
QRgb fromLinear64(QRgba64 rgb64) const
{
#if defined(__SSE2__)
@@ -176,8 +203,31 @@ public:
return convertWithTable(rgb64, m_fromLinear);
}
+ int u8FromLinearF32(float f) const
+ {
+ ushort v = m_fromLinear[(int)(f * (255 * 16) + 0.5f)];
+ return (v + 0x80) >> 8;
+ }
+ int u16FromLinearF32(float f) const
+ {
+ ushort v = m_fromLinear[(int)(f * (255 * 16) + 0.5f)];
+ return v + (v >> 8);
+ }
+ float fromLinear(float f) const
+ {
+ ushort v = m_fromLinear[(int)(f * (255 * 16) + 0.5f)];
+ return v * (1.0f / (255*256));
+ }
+
+ // We translate to 0-65280 (255*256) instead to 0-65535 to make simple
+ // shifting an accurate conversion.
+ // We translate from 0-4080 (255*16) for the same speed up, and to keep
+ // the tables small enough to fit in most inner caches.
+ ushort m_toLinear[(255 * 16) + 1]; // [0-4080] -> [0-65280]
+ ushort m_fromLinear[(255 * 16) + 1]; // [0-4080] -> [0-65280]
+
private:
- QColorProfile() { }
+ QColorTrcLut() { }
Q_ALWAYS_INLINE static QRgb convertWithTable(QRgb rgb32, const ushort *table)
{
@@ -230,16 +280,8 @@ private:
return QRgba64::fromRgba64(r, g, b, rgb64.alpha());
#endif
}
-
- // We translate to 0-65280 (255*256) instead to 0-65535 to make simple
- // shifting an accurate conversion.
- // We translate from 0-4080 (255*16) for the same speed up, and to keep
- // the tables small enough to fit in most inner caches.
- ushort m_toLinear[(255 * 16) + 1]; // [0-4080] -> [0-65280]
- ushort m_fromLinear[(255 * 16) + 1]; // [0-4080] -> [0-65280]
-
};
QT_END_NAMESPACE
-#endif // QCOLORPROFILE_P_H
+#endif // QCOLORTRCLUT_P_H
diff --git a/src/gui/painting/qcompositionfunctions.cpp b/src/gui/painting/qcompositionfunctions.cpp
index 0ce4cfb297..ced213e36d 100644
--- a/src/gui/painting/qcompositionfunctions.cpp
+++ b/src/gui/painting/qcompositionfunctions.cpp
@@ -137,6 +137,7 @@ struct Rgba64OperationsBase
{ ::memcpy(dest, src, len * sizeof(Type)); }
};
+#if QT_CONFIG(raster_64bit)
const Rgba64OperationsBase::Type Rgba64OperationsBase::clear = QRgba64::fromRgba64(0);
struct Rgba64OperationsC : public Rgba64OperationsBase
@@ -309,10 +310,8 @@ struct Rgba64OperationsNEON : public Rgba64OperationsBase
return interpolate65535(x, a1, y, a2);
}
};
-
#endif
-typedef Argb32OperationsC Argb32Operations;
#if defined(__SSE2__)
typedef Rgba64OperationsSSE2 Rgba64Operations;
#elif defined(__ARM_NEON__)
@@ -320,6 +319,9 @@ typedef Rgba64OperationsNEON Rgba64Operations;
#else
typedef Rgba64OperationsC Rgba64Operations;
#endif
+#endif // QT_CONFIG(raster_64bit)
+
+typedef Argb32OperationsC Argb32Operations;
/*
result = 0
@@ -343,20 +345,23 @@ void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_
comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
}
-void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest, int length, QRgba64, uint const_alpha)
+void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
{
- comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
+ comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
}
-void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest, int length, QRgba64, uint const_alpha)
{
- comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
+ comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
}
void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest, const QRgba64 *, int length, uint const_alpha)
{
comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
}
+#endif
+
/*
result = s
@@ -399,36 +404,40 @@ void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint
comp_func_solid_Source_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_Source_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_Source_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_Source_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_Source_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_Source_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)
{
}
-void QT_FASTCALL comp_func_solid_Destination_rgb64(QRgba64 *, int, QRgba64, uint)
+void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
{
}
-void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_Destination_rgb64(QRgba64 *, int, QRgba64, uint)
{
}
void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *, const QRgba64 *, int, uint)
{
}
+#endif
/*
result = s + d * sia
@@ -483,20 +492,22 @@ void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color,
comp_func_solid_SourceOver_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_SourceOver_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_SourceOver_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_SourceOver_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_SourceOver_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_SourceOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_SourceOver_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = d + s * dia
@@ -542,20 +553,22 @@ void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint co
comp_func_solid_DestinationOver_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_DestinationOver_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_DestinationOver_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_DestinationOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_DestinationOver_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_DestinationOver_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_DestinationOver_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = s * da
@@ -606,20 +619,22 @@ void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, ui
comp_func_solid_SourceIn_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_SourceIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_SourceIn_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_SourceIn_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_SourceIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_SourceIn_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_SourceIn_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_SourceIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_SourceIn_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = d * sa
@@ -665,20 +680,22 @@ void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint colo
comp_func_solid_DestinationIn_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_DestinationIn_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_DestinationIn_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_DestinationIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_DestinationIn_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_DestinationIn_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_DestinationIn_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = s * dia
@@ -727,20 +744,22 @@ void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, u
comp_func_solid_SourceOut_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_SourceOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_SourceOut_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_SourceOut_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_SourceOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_SourceOut_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_SourceOut_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_SourceOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_SourceOut_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = d * sia
@@ -786,20 +805,22 @@ void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint col
comp_func_solid_DestinationOut_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_DestinationOut_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_DestinationOut_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_DestinationOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_DestinationOut_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_DestinationOut_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_DestinationOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_DestinationOut_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = s*da + d*sia
@@ -845,20 +866,22 @@ void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color,
comp_func_solid_SourceAtop_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_SourceAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_SourceAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_SourceAtop_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_SourceAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_SourceAtop_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_SourceAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_SourceAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_SourceAtop_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = d*sa + s*dia
@@ -909,20 +932,22 @@ void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint co
comp_func_solid_DestinationAtop_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_DestinationAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_DestinationAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_DestinationAtop_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_DestinationAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_DestinationAtop_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_DestinationAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_DestinationAtop_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
result = d*sia + s*dia
@@ -969,20 +994,22 @@ void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint co
comp_func_solid_XOR_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_XOR(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_XOR_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_XOR_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_XOR(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_XOR_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_XOR_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_XOR_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
struct QFullCoverage {
inline void store(uint *dest, const uint src) const
@@ -1078,20 +1105,22 @@ void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint c
comp_func_solid_Plus_template<Argb32Operations>(dest, length, color, const_alpha);
}
-void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+void QT_FASTCALL comp_func_Plus(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
- comp_func_solid_Plus_template<Rgba64Operations>(dest, length, color, const_alpha);
+ comp_func_Plus_template<Argb32Operations>(dest, src, length, const_alpha);
}
-void QT_FASTCALL comp_func_Plus(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
- comp_func_Plus_template<Argb32Operations>(dest, src, length, const_alpha);
+ comp_func_solid_Plus_template<Rgba64Operations>(dest, length, color, const_alpha);
}
void QT_FASTCALL comp_func_Plus_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
comp_func_Plus_template<Rgba64Operations>(dest, src, length, const_alpha);
}
+#endif
/*
Dca' = Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1101,11 +1130,6 @@ static inline int multiply_op(int dst, int src, int da, int sa)
return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa));
}
-static inline uint multiply_op_rgb64(uint dst, uint src, uint da, uint sa)
-{
- return qt_div_65535(src * dst + src * (65535 - da) + dst * (65535 - sa));
-}
-
template <typename T>
static inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1129,6 +1153,20 @@ static inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint co
}
}
+void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint multiply_op_rgb64(uint dst, uint src, uint da, uint sa)
+{
+ return qt_div_65535(src * dst + src * (65535 - da) + dst * (65535 - sa));
+}
+
template <typename T>
static inline void comp_func_solid_Multiply_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -1152,14 +1190,6 @@ static inline void comp_func_solid_Multiply_impl(QRgba64 *dest, int length, QRgb
}
}
-void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Multiply_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1167,6 +1197,7 @@ void QT_FASTCALL comp_func_solid_Multiply_rgb64(QRgba64 *dest, int length, QRgba
else
comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Multiply_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -1189,6 +1220,15 @@ static inline void comp_func_Multiply_impl(uint *Q_DECL_RESTRICT dest, const uin
}
}
+void QT_FASTCALL comp_func_Multiply(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Multiply_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Multiply_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1210,14 +1250,6 @@ static inline void comp_func_Multiply_impl(QRgba64 *Q_DECL_RESTRICT dest, const
}
}
-void QT_FASTCALL comp_func_Multiply(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Multiply_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Multiply_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1225,6 +1257,7 @@ void QT_FASTCALL comp_func_Multiply_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const Q
else
comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
Dca' = (Sca.Da + Dca.Sa - Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1253,6 +1286,15 @@ static inline void comp_func_solid_Screen_impl(uint *dest, int length, uint colo
}
}
+void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_solid_Screen_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -1276,14 +1318,6 @@ static inline void comp_func_solid_Screen_impl(QRgba64 *dest, int length, QRgba6
}
}
-void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Screen_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1291,6 +1325,7 @@ void QT_FASTCALL comp_func_solid_Screen_rgb64(QRgba64 *dest, int length, QRgba64
else
comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Screen_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -1313,6 +1348,15 @@ static inline void comp_func_Screen_impl(uint *Q_DECL_RESTRICT dest, const uint
}
}
+void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Screen_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Screen_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1334,14 +1378,6 @@ static inline void comp_func_Screen_impl(QRgba64 *Q_DECL_RESTRICT dest, const QR
}
}
-void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Screen_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Screen_rgb64(QRgba64 *dest, const QRgba64 *src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1349,6 +1385,7 @@ void QT_FASTCALL comp_func_Screen_rgb64(QRgba64 *dest, const QRgba64 *src, int l
else
comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
if 2.Dca < Da
@@ -1365,15 +1402,6 @@ static inline int overlay_op(int dst, int src, int da, int sa)
return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp);
}
-static inline uint overlay_op_rgb64(uint dst, uint src, uint da, uint sa)
-{
- const uint temp = src * (65535 - da) + dst * (65535 - sa);
- if (2 * dst < da)
- return qt_div_65535(2 * src * dst + temp);
- else
- return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
-}
-
template <typename T>
static inline void comp_func_solid_Overlay_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1397,6 +1425,24 @@ static inline void comp_func_solid_Overlay_impl(uint *dest, int length, uint col
}
}
+void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint overlay_op_rgb64(uint dst, uint src, uint da, uint sa)
+{
+ const uint temp = src * (65535 - da) + dst * (65535 - sa);
+ if (2 * dst < da)
+ return qt_div_65535(2 * src * dst + temp);
+ else
+ return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
+}
+
template <typename T>
static inline void comp_func_solid_Overlay_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -1420,14 +1466,6 @@ static inline void comp_func_solid_Overlay_impl(QRgba64 *dest, int length, QRgba
}
}
-void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Overlay_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1435,6 +1473,7 @@ void QT_FASTCALL comp_func_solid_Overlay_rgb64(QRgba64 *dest, int length, QRgba6
else
comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Overlay_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -1457,6 +1496,15 @@ static inline void comp_func_Overlay_impl(uint *Q_DECL_RESTRICT dest, const uint
}
}
+void QT_FASTCALL comp_func_Overlay(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Overlay_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Overlay_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1478,14 +1526,6 @@ static inline void comp_func_Overlay_impl(QRgba64 *Q_DECL_RESTRICT dest, const Q
}
}
-void QT_FASTCALL comp_func_Overlay(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Overlay_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Overlay_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1493,6 +1533,7 @@ void QT_FASTCALL comp_func_Overlay_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QR
else
comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
Dca' = min(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1503,11 +1544,6 @@ static inline int darken_op(int dst, int src, int da, int sa)
return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
}
-static inline uint darken_op_rgb64(uint dst, uint src, uint da, uint sa)
-{
- return qt_div_65535(qMin(src * da, dst * sa) + src * (65535 - da) + dst * (65535 - sa));
-}
-
template <typename T>
static inline void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1531,6 +1567,20 @@ static inline void comp_func_solid_Darken_impl(uint *dest, int length, uint colo
}
}
+void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint darken_op_rgb64(uint dst, uint src, uint da, uint sa)
+{
+ return qt_div_65535(qMin(src * da, dst * sa) + src * (65535 - da) + dst * (65535 - sa));
+}
+
template <typename T>
static inline void comp_func_solid_Darken_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -1554,14 +1604,6 @@ static inline void comp_func_solid_Darken_impl(QRgba64 *dest, int length, QRgba6
}
}
-void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Darken_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1569,6 +1611,7 @@ void QT_FASTCALL comp_func_solid_Darken_rgb64(QRgba64 *dest, int length, QRgba64
else
comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Darken_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -1591,6 +1634,15 @@ static inline void comp_func_Darken_impl(uint *Q_DECL_RESTRICT dest, const uint
}
}
+void QT_FASTCALL comp_func_Darken(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Darken_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Darken_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1612,14 +1664,6 @@ static inline void comp_func_Darken_impl(QRgba64 *Q_DECL_RESTRICT dest, const QR
}
}
-void QT_FASTCALL comp_func_Darken(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Darken_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Darken_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1627,6 +1671,7 @@ void QT_FASTCALL comp_func_Darken_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRg
else
comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
Dca' = max(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -1637,11 +1682,6 @@ static inline int lighten_op(int dst, int src, int da, int sa)
return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
}
-static inline uint lighten_op_rgb64(uint dst, uint src, uint da, uint sa)
-{
- return qt_div_65535(qMax(src * da, dst * sa) + src * (65535 - da) + dst * (65535 - sa));
-}
-
template <typename T>
static inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1665,6 +1705,21 @@ static inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint col
}
}
+void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+
+#if QT_CONFIG(raster_64bit)
+static inline uint lighten_op_rgb64(uint dst, uint src, uint da, uint sa)
+{
+ return qt_div_65535(qMax(src * da, dst * sa) + src * (65535 - da) + dst * (65535 - sa));
+}
+
template <typename T>
static inline void comp_func_solid_Lighten_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -1688,14 +1743,6 @@ static inline void comp_func_solid_Lighten_impl(QRgba64 *dest, int length, QRgba
}
}
-void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Lighten_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1703,6 +1750,7 @@ void QT_FASTCALL comp_func_solid_Lighten_rgb64(QRgba64 *dest, int length, QRgba6
else
comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Lighten_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -1725,6 +1773,15 @@ static inline void comp_func_Lighten_impl(uint *Q_DECL_RESTRICT dest, const uint
}
}
+void QT_FASTCALL comp_func_Lighten(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Lighten_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Lighten_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1746,14 +1803,6 @@ static inline void comp_func_Lighten_impl(QRgba64 *Q_DECL_RESTRICT dest, const Q
}
}
-void QT_FASTCALL comp_func_Lighten(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Lighten_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Lighten_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1761,6 +1810,7 @@ void QT_FASTCALL comp_func_Lighten_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QR
else
comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
if Sca.Da + Dca.Sa > Sa.Da
@@ -1785,21 +1835,6 @@ static inline int color_dodge_op(int dst, int src, int da, int sa)
return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp);
}
-static inline uint color_dodge_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
-{
- const qint64 sa_da = sa * da;
- const qint64 dst_sa = dst * sa;
- const qint64 src_da = src * da;
-
- const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
- if (src_da + dst_sa > sa_da)
- return qt_div_65535(sa_da + temp);
- else if (src == sa || sa == 0)
- return qt_div_65535(temp);
- else
- return qt_div_65535(65535 * dst_sa / (65535 - 65535 * src / sa) + temp);
-}
-
template <typename T>
static inline void comp_func_solid_ColorDodge_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1823,6 +1858,30 @@ static inline void comp_func_solid_ColorDodge_impl(uint *dest, int length, uint
}
}
+void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint color_dodge_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
+{
+ const qint64 sa_da = sa * da;
+ const qint64 dst_sa = dst * sa;
+ const qint64 src_da = src * da;
+
+ const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
+ if (src_da + dst_sa > sa_da)
+ return qt_div_65535(sa_da + temp);
+ else if (src == sa || sa == 0)
+ return qt_div_65535(temp);
+ else
+ return qt_div_65535(65535 * dst_sa / (65535 - 65535 * src / sa) + temp);
+}
+
template <typename T>
static inline void comp_func_solid_ColorDodge_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -1846,14 +1905,6 @@ static inline void comp_func_solid_ColorDodge_impl(QRgba64 *dest, int length, QR
}
}
-void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_ColorDodge_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -1861,6 +1912,7 @@ void QT_FASTCALL comp_func_solid_ColorDodge_rgb64(QRgba64 *dest, int length, QRg
else
comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_ColorDodge_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -1883,6 +1935,15 @@ static inline void comp_func_ColorDodge_impl(uint *Q_DECL_RESTRICT dest, const u
}
}
+void QT_FASTCALL comp_func_ColorDodge(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_ColorDodge_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -1904,14 +1965,6 @@ static inline void comp_func_ColorDodge_impl(QRgba64 *Q_DECL_RESTRICT dest, cons
}
}
-void QT_FASTCALL comp_func_ColorDodge(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
- else
- comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_ColorDodge_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -1919,6 +1972,7 @@ void QT_FASTCALL comp_func_ColorDodge_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
else
comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
if Sca.Da + Dca.Sa < Sa.Da
@@ -1943,21 +1997,6 @@ static inline int color_burn_op(int dst, int src, int da, int sa)
return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
}
-static inline uint color_burn_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
-{
- const qint64 src_da = src * da;
- const qint64 dst_sa = dst * sa;
- const qint64 sa_da = sa * da;
-
- const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
-
- if (src_da + dst_sa < sa_da)
- return qt_div_65535(temp);
- else if (src == 0)
- return qt_div_65535(dst_sa + temp);
- return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
-}
-
template <typename T>
static inline void comp_func_solid_ColorBurn_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -1981,6 +2020,30 @@ static inline void comp_func_solid_ColorBurn_impl(uint *dest, int length, uint c
}
}
+void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint color_burn_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
+{
+ const qint64 src_da = src * da;
+ const qint64 dst_sa = dst * sa;
+ const qint64 sa_da = sa * da;
+
+ const qint64 temp = src * (65535 - da) + dst * (65535 - sa);
+
+ if (src_da + dst_sa < sa_da)
+ return qt_div_65535(temp);
+ else if (src == 0)
+ return qt_div_65535(dst_sa + temp);
+ return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
+}
+
template <typename T>
static inline void comp_func_solid_ColorBurn_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -2004,14 +2067,6 @@ static inline void comp_func_solid_ColorBurn_impl(QRgba64 *dest, int length, QRg
}
}
-void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_ColorBurn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -2019,6 +2074,7 @@ void QT_FASTCALL comp_func_solid_ColorBurn_rgb64(QRgba64 *dest, int length, QRgb
else
comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_ColorBurn_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -2041,6 +2097,15 @@ static inline void comp_func_ColorBurn_impl(uint *Q_DECL_RESTRICT dest, const ui
}
}
+void QT_FASTCALL comp_func_ColorBurn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_ColorBurn_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -2062,14 +2127,6 @@ static inline void comp_func_ColorBurn_impl(QRgba64 *Q_DECL_RESTRICT dest, const
}
}
-void QT_FASTCALL comp_func_ColorBurn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
- else
- comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_ColorBurn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -2077,6 +2134,7 @@ void QT_FASTCALL comp_func_ColorBurn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
else
comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
if 2.Sca < Sa
@@ -2094,16 +2152,6 @@ static inline uint hardlight_op(int dst, int src, int da, int sa)
return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp);
}
-static inline uint hardlight_op_rgb64(uint dst, uint src, uint da, uint sa)
-{
- const uint temp = src * (65535 - da) + dst * (65535 - sa);
-
- if (2 * src < sa)
- return qt_div_65535(2 * src * dst + temp);
- else
- return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
-}
-
template <typename T>
static inline void comp_func_solid_HardLight_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -2127,6 +2175,25 @@ static inline void comp_func_solid_HardLight_impl(uint *dest, int length, uint c
}
}
+void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint hardlight_op_rgb64(uint dst, uint src, uint da, uint sa)
+{
+ const uint temp = src * (65535 - da) + dst * (65535 - sa);
+
+ if (2 * src < sa)
+ return qt_div_65535(2 * src * dst + temp);
+ else
+ return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
+}
+
template <typename T>
static inline void comp_func_solid_HardLight_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -2150,14 +2217,6 @@ static inline void comp_func_solid_HardLight_impl(QRgba64 *dest, int length, QRg
}
}
-void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_HardLight_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -2165,6 +2224,7 @@ void QT_FASTCALL comp_func_solid_HardLight_rgb64(QRgba64 *dest, int length, QRgb
else
comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_HardLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -2187,6 +2247,15 @@ static inline void comp_func_HardLight_impl(uint *Q_DECL_RESTRICT dest, const ui
}
}
+void QT_FASTCALL comp_func_HardLight(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_HardLight_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_HardLight_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -2208,14 +2277,6 @@ static inline void comp_func_HardLight_impl(QRgba64 *Q_DECL_RESTRICT dest, const
}
}
-void QT_FASTCALL comp_func_HardLight(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_HardLight_impl(dest, src, length, QFullCoverage());
- else
- comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_HardLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -2223,6 +2284,7 @@ void QT_FASTCALL comp_func_HardLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
else
comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
if 2.Sca <= Sa
@@ -2247,22 +2309,6 @@ static inline int soft_light_op(int dst, int src, int da, int sa)
}
}
-static inline uint soft_light_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
-{
- const qint64 src2 = src << 1;
- const qint64 dst_np = da != 0 ? (65535 * dst) / da : 0;
- const qint64 temp = (src * (65535 - da) + dst * (65535 - sa)) * 65535;
- const qint64 factor = qint64(65535) * 65535;
-
- if (src2 < sa)
- return (dst * (sa * 65535 + (src2 - sa) * (65535 - dst_np)) + temp) / factor;
- else if (4 * dst <= da)
- return (dst * sa * 65535 + da * (src2 - sa) * ((((16 * dst_np - 12 * 65535) * dst_np + 3 * factor) * dst_np) / factor) + temp) / factor;
- else {
- return (dst * sa * 65535 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 65535))) - dst_np) + temp) / factor;
- }
-}
-
template <typename T>
static inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -2286,6 +2332,23 @@ static inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint c
}
}
+#if QT_CONFIG(raster_64bit)
+static inline uint soft_light_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
+{
+ const qint64 src2 = src << 1;
+ const qint64 dst_np = da != 0 ? (65535 * dst) / da : 0;
+ const qint64 temp = (src * (65535 - da) + dst * (65535 - sa)) * 65535;
+ const qint64 factor = qint64(65535) * 65535;
+
+ if (src2 < sa)
+ return (dst * (sa * 65535 + (src2 - sa) * (65535 - dst_np)) + temp) / factor;
+ else if (4 * dst <= da)
+ return (dst * sa * 65535 + da * (src2 - sa) * ((((16 * dst_np - 12 * 65535) * dst_np + 3 * factor) * dst_np) / factor) + temp) / factor;
+ else {
+ return (dst * sa * 65535 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 65535))) - dst_np) + temp) / factor;
+ }
+}
+
template <typename T>
static inline void comp_func_solid_SoftLight_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -2308,6 +2371,7 @@ static inline void comp_func_solid_SoftLight_impl(QRgba64 *dest, int length, QRg
coverage.store(&dest[i], qRgba64(r, g, b, a));
}
}
+#endif
void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha)
{
@@ -2317,14 +2381,6 @@ void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, u
comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
}
-void QT_FASTCALL comp_func_solid_SoftLight_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
template <typename T>
static inline void comp_func_SoftLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -2346,6 +2402,23 @@ static inline void comp_func_SoftLight_impl(uint *Q_DECL_RESTRICT dest, const ui
}
}
+void QT_FASTCALL comp_func_SoftLight(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+void QT_FASTCALL comp_func_solid_SoftLight_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
template <typename T>
static inline void comp_func_SoftLight_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -2367,14 +2440,6 @@ static inline void comp_func_SoftLight_impl(QRgba64 *Q_DECL_RESTRICT dest, const
}
}
-void QT_FASTCALL comp_func_SoftLight(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
- else
- comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_SoftLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -2382,6 +2447,7 @@ void QT_FASTCALL comp_func_SoftLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
else
comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
Dca' = abs(Dca.Sa - Sca.Da) + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -2392,11 +2458,6 @@ static inline int difference_op(int dst, int src, int da, int sa)
return src + dst - qt_div_255(2 * qMin(src * da, dst * sa));
}
-static inline uint difference_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
-{
- return src + dst - qt_div_65535(2 * qMin(src * da, dst * sa));
-}
-
template <typename T>
static inline void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage)
{
@@ -2420,6 +2481,20 @@ static inline void comp_func_solid_Difference_impl(uint *dest, int length, uint
}
}
+void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
+static inline uint difference_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
+{
+ return src + dst - qt_div_65535(2 * qMin(src * da, dst * sa));
+}
+
template <typename T>
static inline void comp_func_solid_Difference_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -2443,14 +2518,6 @@ static inline void comp_func_solid_Difference_impl(QRgba64 *dest, int length, QR
}
}
-void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Difference_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -2458,6 +2525,7 @@ void QT_FASTCALL comp_func_solid_Difference_rgb64(QRgba64 *dest, int length, QRg
else
comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Difference_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -2480,6 +2548,15 @@ static inline void comp_func_Difference_impl(uint *Q_DECL_RESTRICT dest, const u
}
}
+void QT_FASTCALL comp_func_Difference(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Difference_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Difference_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -2501,14 +2578,6 @@ static inline void comp_func_Difference_impl(QRgba64 *Q_DECL_RESTRICT dest, cons
}
}
-void QT_FASTCALL comp_func_Difference(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Difference_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Difference_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -2516,6 +2585,7 @@ void QT_FASTCALL comp_func_Difference_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
else
comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
/*
Dca' = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)
@@ -2543,6 +2613,15 @@ static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(uint *dest, int le
}
}
+void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
+ else
+ comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba64 *dest, int length, QRgba64 color, const T &coverage)
{
@@ -2567,14 +2646,6 @@ static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba64 *dest, int
}
-void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
- else
- comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_solid_Exclusion_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)
{
if (const_alpha == 255)
@@ -2582,6 +2653,7 @@ void QT_FASTCALL comp_func_solid_Exclusion_rgb64(QRgba64 *dest, int length, QRgb
else
comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
}
+#endif
template <typename T>
static inline void comp_func_Exclusion_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
@@ -2604,6 +2676,15 @@ static inline void comp_func_Exclusion_impl(uint *Q_DECL_RESTRICT dest, const ui
}
}
+void QT_FASTCALL comp_func_Exclusion(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
+{
+ if (const_alpha == 255)
+ comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
+ else
+ comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
+}
+
+#if QT_CONFIG(raster_64bit)
template <typename T>
static inline void comp_func_Exclusion_impl(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, const T &coverage)
{
@@ -2625,14 +2706,6 @@ static inline void comp_func_Exclusion_impl(QRgba64 *Q_DECL_RESTRICT dest, const
}
}
-void QT_FASTCALL comp_func_Exclusion(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)
-{
- if (const_alpha == 255)
- comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
- else
- comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
-}
-
void QT_FASTCALL comp_func_Exclusion_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)
{
if (const_alpha == 255)
@@ -2640,6 +2713,7 @@ void QT_FASTCALL comp_func_Exclusion_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
else
comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
}
+#endif
void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,
int length,
@@ -2989,6 +3063,7 @@ CompositionFunctionSolid qt_functionForModeSolid_C[] = {
};
CompositionFunctionSolid64 qt_functionForModeSolid64_C[] = {
+#if QT_CONFIG(raster_64bit)
comp_func_solid_SourceOver_rgb64,
comp_func_solid_DestinationOver_rgb64,
comp_func_solid_Clear_rgb64,
@@ -3013,6 +3088,10 @@ CompositionFunctionSolid64 qt_functionForModeSolid64_C[] = {
comp_func_solid_SoftLight_rgb64,
comp_func_solid_Difference_rgb64,
comp_func_solid_Exclusion_rgb64,
+#else
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+#endif
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
@@ -3059,6 +3138,7 @@ CompositionFunction qt_functionForMode_C[] = {
};
CompositionFunction64 qt_functionForMode64_C[] = {
+#if QT_CONFIG(raster_64bit)
comp_func_SourceOver_rgb64,
comp_func_DestinationOver_rgb64,
comp_func_Clear_rgb64,
@@ -3083,6 +3163,10 @@ CompositionFunction64 qt_functionForMode64_C[] = {
comp_func_SoftLight_rgb64,
comp_func_Difference_rgb64,
comp_func_Exclusion_rgb64,
+#else
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+#endif
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index 082ddee30f..8571b0476a 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -98,8 +98,8 @@ public:
: state(s),
deviceRect(dr_unclipped),
clip(dr),
- pattern(0),
- reversePattern(0),
+ pattern(nullptr),
+ reversePattern(nullptr),
patternSize(0),
patternLength(0),
patternOffset(0),
diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h
index 28d5f6d6c5..181d19da0b 100644
--- a/src/gui/painting/qdatabuffer_p.h
+++ b/src/gui/painting/qdatabuffer_p.h
@@ -69,7 +69,7 @@ public:
buffer = (Type*) malloc(capacity * sizeof(Type));
Q_CHECK_PTR(buffer);
} else {
- buffer = 0;
+ buffer = nullptr;
}
siz = 0;
}
@@ -128,7 +128,7 @@ public:
Q_CHECK_PTR(buffer);
} else {
free(buffer);
- buffer = 0;
+ buffer = nullptr;
}
}
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 533ad39b86..e8d129d047 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -43,7 +43,7 @@
#include <qstylehints.h>
#include <qguiapplication.h>
#include <qatomic.h>
-#include <private/qcolorprofile_p.h>
+#include <private/qcolortrclut_p.h>
#include <private/qdrawhelper_p.h>
#include <private/qpaintengine_raster_p.h>
#include <private/qpainter_p.h>
@@ -88,6 +88,7 @@ template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB444>() { return 4; }
template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB555>() { return 5; }
template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB666>() { return 6; }
template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_RGB888>() { return 8; }
+template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_BGR888>() { return 8; }
template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }
template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; }
template<> Q_DECL_CONSTEXPR uint redWidth<QImage::Format_ARGB8565_Premultiplied>() { return 5; }
@@ -101,6 +102,7 @@ template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB444>() { return 8;
template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB555>() { return 10; }
template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB666>() { return 12; }
template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_RGB888>() { return 16; }
+template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_BGR888>() { return 0; }
template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB4444_Premultiplied>() { return 8; }
template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB8555_Premultiplied>() { return 18; }
template<> Q_DECL_CONSTEXPR uint redShift<QImage::Format_ARGB8565_Premultiplied>() { return 19; }
@@ -119,6 +121,7 @@ template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB444>() { return 4;
template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB555>() { return 5; }
template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB666>() { return 6; }
template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_RGB888>() { return 8; }
+template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_BGR888>() { return 8; }
template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }
template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; }
template<> Q_DECL_CONSTEXPR uint greenWidth<QImage::Format_ARGB8565_Premultiplied>() { return 6; }
@@ -132,6 +135,7 @@ template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB444>() { return 4;
template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB555>() { return 5; }
template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB666>() { return 6; }
template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_RGB888>() { return 8; }
+template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_BGR888>() { return 8; }
template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB4444_Premultiplied>() { return 4; }
template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB8555_Premultiplied>() { return 13; }
template<> Q_DECL_CONSTEXPR uint greenShift<QImage::Format_ARGB8565_Premultiplied>() { return 13; }
@@ -150,6 +154,7 @@ template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB444>() { return 4;
template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB555>() { return 5; }
template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB666>() { return 6; }
template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_RGB888>() { return 8; }
+template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_BGR888>() { return 8; }
template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }
template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB8555_Premultiplied>() { return 5; }
template<> Q_DECL_CONSTEXPR uint blueWidth<QImage::Format_ARGB8565_Premultiplied>() { return 5; }
@@ -163,6 +168,7 @@ template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB444>() { return 0;
template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB555>() { return 0; }
template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB666>() { return 0; }
template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_RGB888>() { return 0; }
+template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_BGR888>() { return 16; }
template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB4444_Premultiplied>() { return 0; }
template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB8555_Premultiplied>() { return 8; }
template<> Q_DECL_CONSTEXPR uint blueShift<QImage::Format_ARGB8565_Premultiplied>() { return 8; }
@@ -181,6 +187,7 @@ template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB444>() { return 0;
template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB555>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB666>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_RGB888>() { return 0; }
+template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_BGR888>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB4444_Premultiplied>() { return 4; }
template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB8555_Premultiplied>() { return 8; }
template<> Q_DECL_CONSTEXPR uint alphaWidth<QImage::Format_ARGB8565_Premultiplied>() { return 8; }
@@ -194,6 +201,7 @@ template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB444>() { return 0;
template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB555>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB666>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_RGB888>() { return 0; }
+template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_BGR888>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB4444_Premultiplied>() { return 12; }
template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB8555_Premultiplied>() { return 0; }
template<> Q_DECL_CONSTEXPR uint alphaShift<QImage::Format_ARGB8565_Premultiplied>() { return 0; }
@@ -214,6 +222,7 @@ template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB444>() { r
template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB555>() { return QPixelLayout::BPP16; }
template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB666>() { return QPixelLayout::BPP24; }
template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_RGB888>() { return QPixelLayout::BPP24; }
+template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_BGR888>() { return QPixelLayout::BPP24; }
template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB4444_Premultiplied>() { return QPixelLayout::BPP16; }
template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB8555_Premultiplied>() { return QPixelLayout::BPP24; }
template<> constexpr QPixelLayout::BPP bitsPerPixel<QImage::Format_ARGB8565_Premultiplied>() { return QPixelLayout::BPP24; }
@@ -660,8 +669,7 @@ static void QT_FASTCALL rbSwap_rgb30(uchar *d, const uchar *s, int count)
{
const uint *src = reinterpret_cast<const uint *>(s);
uint *dest = reinterpret_cast<uint *>(d);
- for (int i = 0; i < count; ++i)
- dest[i] = qRgbSwapRgb30(src[i]);
+ UNALIASED_CONVERSION_LOOP(dest, src, count, qRgbSwapRgb30);
}
template<QImage::Format Format> Q_DECL_CONSTEXPR static inline QPixelLayout pixelLayoutRGB()
@@ -1117,6 +1125,7 @@ static const QRgba64 *QT_FASTCALL fetchARGB32PMToRGBA64PM(QRgba64 *buffer, const
return convertARGB32PMToRGBA64PM(buffer, reinterpret_cast<const uint *>(src) + index, count, nullptr, nullptr);
}
+#if QT_CONFIG(raster_64bit)
static void convertRGBA64ToRGBA64PM(QRgba64 *buffer, int count)
{
for (int i = 0; i < count; ++i)
@@ -1126,6 +1135,7 @@ static void convertRGBA64ToRGBA64PM(QRgba64 *buffer, int count)
static void convertRGBA64PMToRGBA64PM(QRgba64 *, int)
{
}
+#endif
static const QRgba64 *QT_FASTCALL fetchRGBA64ToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
const QVector<QRgb> *, QDitherInfo *)
@@ -1526,7 +1536,8 @@ QPixelLayout qPixelLayouts[QImage::NImageFormats] = {
{ false, false, QPixelLayout::BPP16, nullptr,
convertGrayscale16ToRGB32, convertGrayscale16ToRGBA64,
fetchGrayscale16ToRGB32, fetchGrayscale16ToRGBA64,
- storeGrayscale16FromARGB32PM, storeGrayscale16FromRGB32 } // Format_Grayscale16
+ storeGrayscale16FromARGB32PM, storeGrayscale16FromRGB32 }, // Format_Grayscale16
+ pixelLayoutRGB<QImage::Format_BGR888>(),
};
Q_STATIC_ASSERT(sizeof(qPixelLayouts) / sizeof(*qPixelLayouts) == QImage::NImageFormats);
@@ -1641,7 +1652,8 @@ ConvertAndStorePixelsFunc64 qStoreFromRGBA64PM[QImage::NImageFormats] = {
storeRGBX64FromRGBA64PM,
storeRGBA64FromRGBA64PM,
storeRGBA64PMFromRGBA64PM,
- storeGray16FromRGBA64PM
+ storeGray16FromRGBA64PM,
+ storeGenericFromRGBA64PM<QImage::Format_BGR888>,
};
/*
@@ -1699,22 +1711,6 @@ static uint *QT_FASTCALL destFetchUndefined(uint *buffer, QRasterBuffer *, int,
return buffer;
}
-static QRgba64 *QT_FASTCALL destFetch64(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
-{
- const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];
- return const_cast<QRgba64 *>(layout->fetchToRGBA64PM(buffer, rasterBuffer->scanLine(y), x, length, nullptr, nullptr));
-}
-
-static QRgba64 * QT_FASTCALL destFetchRGB64(QRgba64 *, QRasterBuffer *rasterBuffer, int x, int y, int)
-{
- return (QRgba64 *)rasterBuffer->scanLine(y) + x;
-}
-
-static QRgba64 * QT_FASTCALL destFetch64Undefined(QRgba64 *buffer, QRasterBuffer *, int, int, int)
-{
- return buffer;
-}
-
static DestFetchProc destFetchProc[QImage::NImageFormats] =
{
0, // Format_Invalid
@@ -1746,8 +1742,26 @@ static DestFetchProc destFetchProc[QImage::NImageFormats] =
destFetch, // Format_RGBA64
destFetch, // Format_RGBA64_Premultiplied
destFetch, // Format_Grayscale16
+ destFetch, // Format_BGR888
};
+#if QT_CONFIG(raster_64bit)
+static QRgba64 *QT_FASTCALL destFetch64(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
+{
+ const QPixelLayout *layout = &qPixelLayouts[rasterBuffer->format];
+ return const_cast<QRgba64 *>(layout->fetchToRGBA64PM(buffer, rasterBuffer->scanLine(y), x, length, nullptr, nullptr));
+}
+
+static QRgba64 * QT_FASTCALL destFetchRGB64(QRgba64 *, QRasterBuffer *rasterBuffer, int x, int y, int)
+{
+ return (QRgba64 *)rasterBuffer->scanLine(y) + x;
+}
+
+static QRgba64 * QT_FASTCALL destFetch64Undefined(QRgba64 *buffer, QRasterBuffer *, int, int, int)
+{
+ return buffer;
+}
+
static DestFetchProc64 destFetchProc64[QImage::NImageFormats] =
{
0, // Format_Invalid
@@ -1779,7 +1793,9 @@ static DestFetchProc64 destFetchProc64[QImage::NImageFormats] =
destFetch64, // Format_RGBA64
destFetchRGB64, // Format_RGBA64_Premultiplied
destFetch64, // Format_Grayscale16
+ destFetch64, // Format_BGR888
};
+#endif
/*
Returns the color in the mono destination color table
@@ -1887,21 +1903,6 @@ static void QT_FASTCALL destStore(QRasterBuffer *rasterBuffer, int x, int y, con
store(dest, buffer, x, length, nullptr, nullptr);
}
-static void QT_FASTCALL destStore64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
-{
- auto store = qStoreFromRGBA64PM[rasterBuffer->format];
- uchar *dest = rasterBuffer->scanLine(y);
- store(dest, buffer, x, length, nullptr, nullptr);
-}
-
-static void QT_FASTCALL destStore64RGBA64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
-{
- QRgba64 *dest = reinterpret_cast<QRgba64*>(rasterBuffer->scanLine(y)) + x;
- for (int i = 0; i < length; ++i) {
- dest[i] = buffer[i].unpremultiplied();
- }
-}
-
static DestStoreProc destStoreProc[QImage::NImageFormats] =
{
0, // Format_Invalid
@@ -1933,8 +1934,25 @@ static DestStoreProc destStoreProc[QImage::NImageFormats] =
destStore, // Format_RGBA64
destStore, // Format_RGBA64_Premultiplied
destStore, // Format_Grayscale16
+ destStore, // Format_BGR888
};
+#if QT_CONFIG(raster_64bit)
+static void QT_FASTCALL destStore64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
+{
+ auto store = qStoreFromRGBA64PM[rasterBuffer->format];
+ uchar *dest = rasterBuffer->scanLine(y);
+ store(dest, buffer, x, length, nullptr, nullptr);
+}
+
+static void QT_FASTCALL destStore64RGBA64(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
+{
+ QRgba64 *dest = reinterpret_cast<QRgba64*>(rasterBuffer->scanLine(y)) + x;
+ for (int i = 0; i < length; ++i) {
+ dest[i] = buffer[i].unpremultiplied();
+ }
+}
+
static DestStoreProc64 destStoreProc64[QImage::NImageFormats] =
{
0, // Format_Invalid
@@ -1966,7 +1984,9 @@ static DestStoreProc64 destStoreProc64[QImage::NImageFormats] =
destStore64RGBA64, // Format_RGBA64
0, // Format_RGBA64_Premultiplied
destStore64, // Format_Grayscale16
+ destStore64, // Format_BGR888
};
+#endif
/*
Source fetches
@@ -2017,6 +2037,7 @@ static const uint *QT_FASTCALL fetchUntransformedRGB16(uint *buffer, const Opera
return buffer;
}
+#if QT_CONFIG(raster_64bit)
static const QRgba64 *QT_FASTCALL fetchUntransformed64(QRgba64 *buffer, const Operator *,
const QSpanData *data, int y, int x, int length)
{
@@ -2030,6 +2051,7 @@ static const QRgba64 *QT_FASTCALL fetchUntransformedRGBA64PM(QRgba64 *, const Op
const uchar *scanLine = data->texture.scanLine(y);
return reinterpret_cast<const QRgba64 *>(scanLine) + x;
}
+#endif
template<TextureBlendType blendType>
inline void fetchTransformed_pixelBounds(int max, int l1, int l2, int &v)
@@ -2237,6 +2259,7 @@ static const uint *QT_FASTCALL fetchTransformed(uint *buffer, const Operator *,
return buffer;
}
+#if QT_CONFIG(raster_64bit)
template<TextureBlendType blendType> /* either BlendTransformed or BlendTransformedTiled */
static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Operator *, const QSpanData *data,
int y, int x, int length)
@@ -2257,6 +2280,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Oper
convertRGBA64ToRGBA64PM(buffer, length);
return buffer;
}
+#endif
/** \internal
interpolate 4 argb pixels with the distx and disty factor.
@@ -3558,6 +3582,7 @@ static const uint *QT_FASTCALL fetchTransformedBilinear(uint *buffer, const Oper
return buffer;
}
+#if QT_CONFIG(raster_64bit)
template<TextureBlendType blendType>
static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64_uint32(QRgba64 *buffer, const QSpanData *data,
int y, int x, int length)
@@ -3878,6 +3903,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
return fetchTransformedBilinear64_uint64<blendType>(buffer, data, y, x, length);
return fetchTransformedBilinear64_uint32<blendType>(buffer, data, y, x, length);
}
+#endif
// FetchUntransformed can have more specialized methods added depending on SIMD features.
static SourceFetchProc sourceFetchUntransformed[QImage::NImageFormats] = {
@@ -3910,6 +3936,7 @@ static SourceFetchProc sourceFetchUntransformed[QImage::NImageFormats] = {
fetchUntransformed, // RGBA64
fetchUntransformed, // RGBA64_Premultiplied
fetchUntransformed, // Grayscale16
+ fetchUntransformed, // BGR888
};
static const SourceFetchProc sourceFetchGeneric[NBlendTypes] = {
@@ -3948,6 +3975,20 @@ static SourceFetchProc sourceFetchAny32[NBlendTypes] = {
fetchTransformedBilinear<BlendTransformedBilinearTiled, QPixelLayout::BPP32> // TransformedBilinearTiled
};
+static inline SourceFetchProc getSourceFetch(TextureBlendType blendType, QImage::Format format)
+{
+ if (format == QImage::Format_RGB32 || format == QImage::Format_ARGB32_Premultiplied)
+ return sourceFetchARGB32PM[blendType];
+ if (blendType == BlendUntransformed || blendType == BlendTiled)
+ return sourceFetchUntransformed[format];
+ if (qPixelLayouts[format].bpp == QPixelLayout::BPP16)
+ return sourceFetchAny16[blendType];
+ if (qPixelLayouts[format].bpp == QPixelLayout::BPP32)
+ return sourceFetchAny32[blendType];
+ return sourceFetchGeneric[blendType];
+}
+
+#if QT_CONFIG(raster_64bit)
static const SourceFetchProc64 sourceFetchGeneric64[NBlendTypes] = {
fetchUntransformed64, // Untransformed
fetchUntransformed64, // Tiled
@@ -3966,25 +4007,13 @@ static const SourceFetchProc64 sourceFetchRGBA64PM[NBlendTypes] = {
fetchTransformedBilinear64<BlendTransformedBilinearTiled> // BilinearTiled
};
-static inline SourceFetchProc getSourceFetch(TextureBlendType blendType, QImage::Format format)
-{
- if (format == QImage::Format_RGB32 || format == QImage::Format_ARGB32_Premultiplied)
- return sourceFetchARGB32PM[blendType];
- if (blendType == BlendUntransformed || blendType == BlendTiled)
- return sourceFetchUntransformed[format];
- if (qPixelLayouts[format].bpp == QPixelLayout::BPP16)
- return sourceFetchAny16[blendType];
- if (qPixelLayouts[format].bpp == QPixelLayout::BPP32)
- return sourceFetchAny32[blendType];
- return sourceFetchGeneric[blendType];
-}
-
static inline SourceFetchProc64 getSourceFetch64(TextureBlendType blendType, QImage::Format format)
{
if (format == QImage::Format_RGBX64 || format == QImage::Format_RGBA64_Premultiplied)
return sourceFetchRGBA64PM[blendType];
return sourceFetchGeneric64[blendType];
}
+#endif
#define FIXPT_BITS 8
@@ -3996,11 +4025,13 @@ static uint qt_gradient_pixel_fixed(const QGradientData *data, int fixed_pos)
return data->colorTable32[qt_gradient_clamp(data, ipos)];
}
+#if QT_CONFIG(raster_64bit)
static const QRgba64& qt_gradient_pixel64_fixed(const QGradientData *data, int fixed_pos)
{
int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
return data->colorTable64[qt_gradient_clamp(data, ipos)];
}
+#endif
static void QT_FASTCALL getLinearGradientValues(LinearGradientValues *v, const QSpanData *data)
{
@@ -4034,6 +4065,7 @@ public:
}
};
+#if QT_CONFIG(raster_64bit)
class GradientBase64
{
public:
@@ -4052,6 +4084,7 @@ public:
qt_memfill64((quint64*)buffer, fill, length);
}
};
+#endif
template<class GradientBase, typename BlendType>
static inline const BlendType * QT_FASTCALL qt_fetch_linear_gradient_template(
@@ -4129,11 +4162,13 @@ static const uint * QT_FASTCALL qt_fetch_linear_gradient(uint *buffer, const Ope
return qt_fetch_linear_gradient_template<GradientBase32, uint>(buffer, op, data, y, x, length);
}
+#if QT_CONFIG(raster_64bit)
static const QRgba64 * QT_FASTCALL qt_fetch_linear_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length)
{
return qt_fetch_linear_gradient_template<GradientBase64, QRgba64>(buffer, op, data, y, x, length);
}
+#endif
static void QT_FASTCALL getRadialGradientValues(RadialGradientValues *v, const QSpanData *data)
{
@@ -4195,11 +4230,13 @@ const uint * QT_FASTCALL qt_fetch_radial_gradient_plain(uint *buffer, const Oper
static SourceFetchProc qt_fetch_radial_gradient = qt_fetch_radial_gradient_plain;
+#if QT_CONFIG(raster_64bit)
const QRgba64 * QT_FASTCALL qt_fetch_radial_gradient_rgb64(QRgba64 *buffer, const Operator *op, const QSpanData *data,
int y, int x, int length)
{
return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBase64>, QRgba64>(buffer, op, data, y, x, length);
}
+#endif
template <class GradientBase, typename BlendType>
static inline const BlendType * QT_FASTCALL qt_fetch_conical_gradient_template(
@@ -4258,23 +4295,29 @@ static const uint * QT_FASTCALL qt_fetch_conical_gradient(uint *buffer, const Op
return qt_fetch_conical_gradient_template<GradientBase32, uint>(buffer, data, y, x, length);
}
+#if QT_CONFIG(raster_64bit)
static const QRgba64 * QT_FASTCALL qt_fetch_conical_gradient_rgb64(QRgba64 *buffer, const Operator *, const QSpanData *data,
int y, int x, int length)
{
return qt_fetch_conical_gradient_template<GradientBase64, QRgba64>(buffer, data, y, x, length);
}
+#endif
extern CompositionFunctionSolid qt_functionForModeSolid_C[];
extern CompositionFunctionSolid64 qt_functionForModeSolid64_C[];
static const CompositionFunctionSolid *functionForModeSolid = qt_functionForModeSolid_C;
+#if QT_CONFIG(raster_64bit)
static const CompositionFunctionSolid64 *functionForModeSolid64 = qt_functionForModeSolid64_C;
+#endif
extern CompositionFunction qt_functionForMode_C[];
extern CompositionFunction64 qt_functionForMode64_C[];
static const CompositionFunction *functionForMode = qt_functionForMode_C;
+#if QT_CONFIG(raster_64bit)
static const CompositionFunction64 *functionForMode64 = qt_functionForMode64_C;
+#endif
static TextureBlendType getBlendType(const QSpanData *data)
{
@@ -4306,41 +4349,58 @@ static inline Operator getOperator(const QSpanData *data, const QSpan *spans, in
case QSpanData::Solid:
solidSource = data->solidColor.isOpaque();
op.srcFetch = 0;
+#if QT_CONFIG(raster_64bit)
op.srcFetch64 = 0;
+#endif
break;
case QSpanData::LinearGradient:
solidSource = !data->gradient.alphaColor;
getLinearGradientValues(&op.linear, data);
op.srcFetch = qt_fetch_linear_gradient;
+#if QT_CONFIG(raster_64bit)
op.srcFetch64 = qt_fetch_linear_gradient_rgb64;
+#endif
break;
case QSpanData::RadialGradient:
solidSource = !data->gradient.alphaColor;
getRadialGradientValues(&op.radial, data);
op.srcFetch = qt_fetch_radial_gradient;
+#if QT_CONFIG(raster_64bit)
op.srcFetch64 = qt_fetch_radial_gradient_rgb64;
+#endif
break;
case QSpanData::ConicalGradient:
solidSource = !data->gradient.alphaColor;
op.srcFetch = qt_fetch_conical_gradient;
+#if QT_CONFIG(raster_64bit)
op.srcFetch64 = qt_fetch_conical_gradient_rgb64;
+#endif
break;
case QSpanData::Texture:
solidSource = !data->texture.hasAlpha;
op.srcFetch = getSourceFetch(getBlendType(data), data->texture.format);
+#if QT_CONFIG(raster_64bit)
op.srcFetch64 = getSourceFetch64(getBlendType(data), data->texture.format);;
+#endif
break;
default:
Q_UNREACHABLE();
break;
}
+#if !QT_CONFIG(raster_64bit)
+ op.srcFetch64 = 0;
+#endif
op.mode = data->rasterBuffer->compositionMode;
if (op.mode == QPainter::CompositionMode_SourceOver && solidSource)
op.mode = QPainter::CompositionMode_Source;
op.destFetch = destFetchProc[data->rasterBuffer->format];
+#if QT_CONFIG(raster_64bit)
op.destFetch64 = destFetchProc64[data->rasterBuffer->format];
+#else
+ op.destFetch64 = 0;
+#endif
if (op.mode == QPainter::CompositionMode_Source &&
(data->type != QSpanData::Texture || data->texture.const_alpha == 256)) {
const QSpan *lastSpan = spans + spanCount;
@@ -4357,18 +4417,25 @@ static inline Operator getOperator(const QSpanData *data, const QSpan *spans, in
// But don't clear passthrough destFetch as they are just as fast and save destStore.
if (op.destFetch != destFetchARGB32P)
op.destFetch = destFetchUndefined;
+#if QT_CONFIG(raster_64bit)
if (op.destFetch64 != destFetchRGB64)
op.destFetch64 = destFetch64Undefined;
+#endif
}
}
op.destStore = destStoreProc[data->rasterBuffer->format];
- op.destStore64 = destStoreProc64[data->rasterBuffer->format];
-
op.funcSolid = functionForModeSolid[op.mode];
- op.funcSolid64 = functionForModeSolid64[op.mode];
op.func = functionForMode[op.mode];
+#if QT_CONFIG(raster_64bit)
+ op.destStore64 = destStoreProc64[data->rasterBuffer->format];
+ op.funcSolid64 = functionForModeSolid64[op.mode];
op.func64 = functionForMode64[op.mode];
+#else
+ op.destStore64 = 0;
+ op.funcSolid64 = 0;
+ op.func64 = 0;
+#endif
return op;
}
@@ -4475,6 +4542,7 @@ static void blend_color_argb(int count, const QSpan *spans, void *userData)
void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
{
+#if QT_CONFIG(raster_64bit)
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
Operator op = getOperator(data, nullptr, 0);
if (!op.funcSolid64) {
@@ -4509,6 +4577,9 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
}
++spans;
}
+#else
+ blend_color_generic(count, spans, userData);
+#endif
}
static void blend_color_rgb16(int count, const QSpan *spans, void *userData)
@@ -4689,6 +4760,7 @@ public:
}
};
+#if QT_CONFIG(raster_64bit)
class BlendSrcGenericRGB64 : public QBlendBase<QRgba64>
{
public:
@@ -4719,6 +4791,7 @@ public:
op.destStore64(data->rasterBuffer, x, y, dest, len);
}
};
+#endif
static void blend_src_generic(int count, const QSpan *spans, void *userData)
{
@@ -4727,6 +4800,7 @@ static void blend_src_generic(int count, const QSpan *spans, void *userData)
handleSpans(count, spans, data, blend);
}
+#if QT_CONFIG(raster_64bit)
static void blend_src_generic_rgb64(int count, const QSpan *spans, void *userData)
{
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
@@ -4740,6 +4814,7 @@ static void blend_src_generic_rgb64(int count, const QSpan *spans, void *userDat
handleSpans(count, spans, data, blend32);
}
}
+#endif
static void blend_untransformed_generic(int count, const QSpan *spans, void *userData)
{
@@ -4787,6 +4862,7 @@ static void blend_untransformed_generic(int count, const QSpan *spans, void *use
}
}
+#if QT_CONFIG(raster_64bit)
static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, void *userData)
{
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
@@ -4836,6 +4912,7 @@ static void blend_untransformed_generic_rgb64(int count, const QSpan *spans, voi
}
}
}
+#endif
static void blend_untransformed_argb(int count, const QSpan *spans, void *userData)
{
@@ -5036,6 +5113,7 @@ static void blend_tiled_generic(int count, const QSpan *spans, void *userData)
}
}
+#if QT_CONFIG(raster_64bit)
static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userData)
{
QSpanData *data = reinterpret_cast<QSpanData *>(userData);
@@ -5131,6 +5209,7 @@ static void blend_tiled_generic_rgb64(int count, const QSpan *spans, void *userD
++spans;
}
}
+#endif
static void blend_tiled_argb(int count, const QSpan *spans, void *userData)
{
@@ -5307,6 +5386,7 @@ static const ProcessSpans processTextureSpansGeneric[NBlendTypes] = {
blend_src_generic // TransformedBilinearTiled
};
+#if QT_CONFIG(raster_64bit)
static const ProcessSpans processTextureSpansGeneric64[NBlendTypes] = {
blend_untransformed_generic_rgb64, // Untransformed
blend_tiled_generic_rgb64, // Tiled
@@ -5315,6 +5395,7 @@ static const ProcessSpans processTextureSpansGeneric64[NBlendTypes] = {
blend_src_generic_rgb64, // TransformedBilinear
blend_src_generic_rgb64 // TransformedBilinearTiled
};
+#endif
void qBlendTexture(int count, const QSpan *spans, void *userData)
{
@@ -5328,6 +5409,7 @@ void qBlendTexture(int count, const QSpan *spans, void *userData)
case QImage::Format_RGB16:
proc = processTextureSpansRGB16[blendType];
break;
+#if QT_CONFIG(raster_64bit)
#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
case QImage::Format_ARGB32:
case QImage::Format_RGBA8888:
@@ -5342,6 +5424,7 @@ void qBlendTexture(int count, const QSpan *spans, void *userData)
case QImage::Format_Grayscale16:
proc = processTextureSpansGeneric64[blendType];
break;
+#endif // QT_CONFIG(raster_64bit)
case QImage::Format_Invalid:
Q_UNREACHABLE();
return;
@@ -5409,7 +5492,11 @@ static void blend_vertical_gradient(int count, const QSpan *spans, void *userDat
while (count--) {
int y = spans->y;
+#if QT_CONFIG(raster_64bit)
data->solidColor = qt_gradient_pixel64_fixed(&data->gradient, yinc * y + off);
+#else
+ data->solidColor = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off));
+#endif
blend_color(1, spans, userData);
++spans;
}
@@ -5432,6 +5519,7 @@ void qBlendGradient(int count, const QSpan *spans, void *userData)
if (isVerticalGradient)
return blend_vertical_gradient_argb(count, spans, userData);
return blend_src_generic(count, spans, userData);
+#if QT_CONFIG(raster_64bit)
#if defined(__SSE2__) || defined(__ARM_NEON__) || (Q_PROCESSOR_WORDSIZE == 8)
case QImage::Format_ARGB32:
case QImage::Format_RGBA8888:
@@ -5446,6 +5534,7 @@ void qBlendGradient(int count, const QSpan *spans, void *userData)
if (isVerticalGradient)
return blend_vertical_gradient<blend_color_generic_rgb64>(count, spans, userData);
return blend_src_generic_rgb64(count, spans, userData);
+#endif // QT_CONFIG(raster_64bit)
case QImage::Format_Invalid:
break;
default:
@@ -5555,29 +5644,77 @@ inline static void qt_bitmapblit_quint16(QRasterBuffer *rasterBuffer,
map, mapWidth, mapHeight, mapStride);
}
-static inline void alphamapblend_generic(int coverage, QRgba64 *dest, int x, const QRgba64 &srcLinear, const QRgba64 &src, const QColorProfile *colorProfile)
+static inline void grayBlendPixel(quint32 *dst, int coverage, QRgba64 srcLinear, const QColorTrcLut *colorProfile)
+{
+ // Do a gammacorrected gray alphablend...
+ const QRgba64 dstLinear = colorProfile ? colorProfile->toLinear64(*dst) : QRgba64::fromArgb32(*dst);
+
+ QRgba64 blend = interpolate255(srcLinear, coverage, dstLinear, 255 - coverage);
+
+ *dst = colorProfile ? colorProfile->fromLinear64(blend) : toArgb32(blend);
+}
+
+static inline void alphamapblend_argb32(quint32 *dst, int coverage, QRgba64 srcLinear, quint32 src, const QColorTrcLut *colorProfile)
{
if (coverage == 0) {
// nothing
- } else if (coverage == 255) {
- dest[x] = src;
+ } else if (coverage == 255 || !colorProfile) {
+ blend_pixel(*dst, src, coverage);
+ } else if (*dst < 0xff000000) {
+ // Give up and do a naive gray alphablend. Needed to deal with ARGB32 and invalid ARGB32_premultiplied, see QTBUG-60571
+ blend_pixel(*dst, src, coverage);
+ } else if (src >= 0xff000000) {
+ grayBlendPixel(dst, coverage, srcLinear, colorProfile);
} else {
- QRgba64 dstColor = dest[x];
- if (colorProfile) {
- if (dstColor.isOpaque())
- dstColor = colorProfile->toLinear(dstColor);
- else if (!dstColor.isTransparent())
- dstColor = colorProfile->toLinear(dstColor.unpremultiplied()).premultiplied();
- }
+ // First do naive blend with text-color
+ QRgb s = *dst;
+ blend_pixel(s, src);
+ // Then gamma-corrected blend with glyph shape
+ QRgba64 s64 = colorProfile ? colorProfile->toLinear64(s) : QRgba64::fromArgb32(s);
+ grayBlendPixel(dst, coverage, s64, colorProfile);
+ }
+}
- dstColor = interpolate255(srcLinear, coverage, dstColor, 255 - coverage);
- if (colorProfile) {
- if (dstColor.isOpaque())
- dstColor = colorProfile->fromLinear(dstColor);
- else if (!dstColor.isTransparent())
- dstColor = colorProfile->fromLinear(dstColor.unpremultiplied()).premultiplied();
- }
- dest[x] = dstColor;
+#if QT_CONFIG(raster_64bit)
+
+static inline void grayBlendPixel(QRgba64 &dst, int coverage, QRgba64 srcLinear, const QColorTrcLut *colorProfile)
+{
+ // Do a gammacorrected gray alphablend...
+ QRgba64 dstColor = dst;
+ if (colorProfile) {
+ if (dstColor.isOpaque())
+ dstColor = colorProfile->toLinear(dstColor);
+ else if (!dstColor.isTransparent())
+ dstColor = colorProfile->toLinear(dstColor.unpremultiplied()).premultiplied();
+ }
+
+ blend_pixel(dstColor, srcLinear, coverage);
+
+ if (colorProfile) {
+ if (dstColor.isOpaque())
+ dstColor = colorProfile->fromLinear(dstColor);
+ else if (!dstColor.isTransparent())
+ dstColor = colorProfile->fromLinear(dstColor.unpremultiplied()).premultiplied();
+ }
+ dst = dstColor;
+}
+
+static inline void alphamapblend_generic(int coverage, QRgba64 *dest, int x, const QRgba64 &srcLinear, const QRgba64 &src, const QColorTrcLut *colorProfile)
+{
+ if (coverage == 0) {
+ // nothing
+ } else if (coverage == 255) {
+ blend_pixel(dest[x], src);
+ } else if (src.isOpaque()) {
+ grayBlendPixel(dest[x], coverage, srcLinear, colorProfile);
+ } else {
+ // First do naive blend with text-color
+ QRgba64 s = dest[x];
+ blend_pixel(s, src);
+ // Then gamma-corrected blend with glyph shape
+ if (colorProfile)
+ s = colorProfile->toLinear(s);
+ grayBlendPixel(dest[x], coverage, s, colorProfile);
}
}
@@ -5590,18 +5727,14 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
if (color.isTransparent())
return;
- const QColorProfile *colorProfile = nullptr;
+ const QColorTrcLut *colorProfile = nullptr;
if (useGammaCorrection)
colorProfile = QGuiApplicationPrivate::instance()->colorProfileForA8Text();
QRgba64 srcColor = color;
- if (colorProfile) {
- if (color.isOpaque())
- srcColor = colorProfile->toLinear(srcColor);
- else
- srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
- }
+ if (colorProfile && color.isOpaque())
+ srcColor = colorProfile->toLinear(srcColor);
alignas(8) QRgba64 buffer[BufferSize];
const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format];
@@ -5656,6 +5789,81 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
} // for (yp -> bottom)
}
}
+#else
+static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer,
+ int x, int y, const QRgba64 &color,
+ const uchar *map,
+ int mapWidth, int mapHeight, int mapStride,
+ const QClipData *clip, bool useGammaCorrection)
+{
+ if (color.isTransparent())
+ return;
+
+ const quint32 c = color.toArgb32();
+
+ const QColorTrcLut *colorProfile = nullptr;
+
+ if (useGammaCorrection)
+ colorProfile = QGuiApplicationPrivate::instance()->colorProfileForA8Text();
+
+ QRgba64 srcColor = color;
+ if (colorProfile && color.isOpaque())
+ srcColor = colorProfile->toLinear(srcColor);
+
+ quint32 buffer[BufferSize];
+ const DestFetchProc destFetch = destFetchProc[rasterBuffer->format];
+ const DestStoreProc destStore = destStoreProc[rasterBuffer->format];
+
+ if (!clip) {
+ for (int ly = 0; ly < mapHeight; ++ly) {
+ int i = x;
+ int length = mapWidth;
+ while (length > 0) {
+ int l = qMin(BufferSize, length);
+ quint32 *dest = destFetch(buffer, rasterBuffer, i, y + ly, l);
+ for (int j=0; j < l; ++j) {
+ const int coverage = map[j + (i - x)];
+ alphamapblend_argb32(dest + j, coverage, srcColor, c, colorProfile);
+ }
+ if (destStore)
+ destStore(rasterBuffer, i, y + ly, dest, l);
+ length -= l;
+ i += l;
+ }
+ map += mapStride;
+ }
+ } else {
+ int bottom = qMin(y + mapHeight, rasterBuffer->height());
+
+ int top = qMax(y, 0);
+ map += (top - y) * mapStride;
+
+ const_cast<QClipData *>(clip)->initialize();
+ for (int yp = top; yp<bottom; ++yp) {
+ const QClipData::ClipLine &line = clip->m_clipLines[yp];
+
+ for (int i=0; i<line.count; ++i) {
+ const QSpan &clip = line.spans[i];
+
+ int start = qMax<int>(x, clip.x);
+ int end = qMin<int>(x + mapWidth, clip.x + clip.len);
+ if (end <= start)
+ continue;
+ Q_ASSERT(end - start <= BufferSize);
+ quint32 *dest = destFetch(buffer, rasterBuffer, start, clip.y, end - start);
+
+ for (int xp=start; xp<end; ++xp) {
+ const int coverage = map[xp - x];
+ alphamapblend_argb32(dest + xp - x, coverage, srcColor, color, colorProfile);
+ }
+ if (destStore)
+ destStore(rasterBuffer, start, clip.y, dest, end - start);
+ } // for (i -> line.count)
+ map += mapStride;
+ } // for (yp -> bottom)
+ }
+}
+#endif
static inline void alphamapblend_quint16(int coverage, quint16 *dest, int x, const quint16 srcColor)
{
@@ -5675,7 +5883,7 @@ void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer,
int mapWidth, int mapHeight, int mapStride,
const QClipData *clip, bool useGammaCorrection)
{
- if (useGammaCorrection) {
+ if (useGammaCorrection || !color.isOpaque()) {
qt_alphamapblit_generic(rasterBuffer, x, y, color, map, mapWidth, mapHeight, mapStride, clip, useGammaCorrection);
return;
}
@@ -5716,44 +5924,6 @@ void qt_alphamapblit_quint16(QRasterBuffer *rasterBuffer,
}
}
-static inline void rgbBlendPixel(quint32 *dst, int coverage, QRgba64 slinear, const QColorProfile *colorProfile)
-{
- // Do a gammacorrected RGB alphablend...
- const QRgba64 dlinear = colorProfile ? colorProfile->toLinear64(*dst) : QRgba64::fromArgb32(*dst);
-
- QRgba64 blend = rgbBlend(dlinear, slinear, coverage);
-
- *dst = colorProfile ? colorProfile->fromLinear64(blend) : toArgb32(blend);
-}
-
-static inline void grayBlendPixel(quint32 *dst, int coverage, QRgba64 srcLinear, const QColorProfile *colorProfile)
-{
- // Do a gammacorrected gray alphablend...
- const QRgba64 dstLinear = colorProfile ? colorProfile->toLinear64(*dst) : QRgba64::fromArgb32(*dst);
-
- QRgba64 blend = interpolate255(srcLinear, coverage, dstLinear, 255 - coverage);
-
- *dst = colorProfile ? colorProfile->fromLinear64(blend) : toArgb32(blend);
-}
-
-static inline void alphamapblend_argb32(quint32 *dst, int coverage, QRgba64 srcLinear, quint32 src, const QColorProfile *colorProfile)
-{
- if (coverage == 0) {
- // nothing
- } else if (coverage == 255) {
- *dst = src;
- } else if (!colorProfile) {
- *dst = INTERPOLATE_PIXEL_255(src, coverage, *dst, 255 - coverage);
- } else {
- if (*dst >= 0xff000000) {
- grayBlendPixel(dst, coverage, srcLinear, colorProfile);
- } else {
- // Give up and do a naive gray alphablend. Needed to deal with ARGB32 and invalid ARGB32_premultiplied, see QTBUG-60571
- *dst = INTERPOLATE_PIXEL_255(src, coverage, *dst, 255 - coverage);
- }
- }
-}
-
static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,
int x, int y, const QRgba64 &color,
const uchar *map,
@@ -5766,18 +5936,14 @@ static void qt_alphamapblit_argb32(QRasterBuffer *rasterBuffer,
if (color.isTransparent())
return;
- const QColorProfile *colorProfile = nullptr;
+ const QColorTrcLut *colorProfile = nullptr;
if (useGammaCorrection)
colorProfile = QGuiApplicationPrivate::instance()->colorProfileForA8Text();
QRgba64 srcColor = color;
- if (colorProfile) {
- if (color.isOpaque())
- srcColor = colorProfile->toLinear(srcColor);
- else
- srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
- }
+ if (colorProfile && color.isOpaque())
+ srcColor = colorProfile->toLinear(srcColor);
if (!clip) {
quint32 *dest = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x;
@@ -5822,6 +5988,16 @@ static inline int qRgbAvg(QRgb rgb)
return (qRed(rgb) * 5 + qGreen(rgb) * 6 + qBlue(rgb) * 5) / 16;
}
+static inline void rgbBlendPixel(quint32 *dst, int coverage, QRgba64 slinear, const QColorTrcLut *colorProfile)
+{
+ // Do a gammacorrected RGB alphablend...
+ const QRgba64 dlinear = colorProfile ? colorProfile->toLinear64(*dst) : QRgba64::fromArgb32(*dst);
+
+ QRgba64 blend = rgbBlend(dlinear, slinear, coverage);
+
+ *dst = colorProfile ? colorProfile->fromLinear64(blend) : toArgb32(blend);
+}
+
static inline QRgb rgbBlend(QRgb d, QRgb s, uint rgbAlpha)
{
#if defined(__SSE2__)
@@ -5862,42 +6038,59 @@ static inline QRgb rgbBlend(QRgb d, QRgb s, uint rgbAlpha)
#endif
}
-static inline void alphargbblend_generic(uint coverage, QRgba64 *dest, int x, const QRgba64 &srcLinear, const QRgba64 &src, const QColorProfile *colorProfile)
+static inline void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba64 &srcLinear, quint32 src, const QColorTrcLut *colorProfile)
{
if (coverage == 0xff000000) {
// nothing
- } else if (coverage == 0xffffffff) {
- dest[x] = src;
+ } else if (coverage == 0xffffffff && qAlpha(src) == 255) {
+ blend_pixel(*dst, src);
+ } else if (*dst < 0xff000000) {
+ // Give up and do a naive gray alphablend. Needed to deal with ARGB32 and invalid ARGB32_premultiplied, see QTBUG-60571
+ blend_pixel(*dst, src, qRgbAvg(coverage));
+ } else if (!colorProfile) {
+ *dst = rgbBlend(*dst, src, coverage);
+ } else if (srcLinear.isOpaque()) {
+ rgbBlendPixel(dst, coverage, srcLinear, colorProfile);
} else {
- QRgba64 dstColor = dest[x];
- if (dstColor.isOpaque()) {
- if (colorProfile)
- dstColor = colorProfile->toLinear(dstColor);
- dstColor = rgbBlend(dstColor, srcLinear, coverage);
- if (colorProfile)
- dstColor = colorProfile->fromLinear(dstColor);
- dest[x] = dstColor;
- } else {
- // Do a gray alphablend.
- alphamapblend_generic(qRgbAvg(coverage), dest, x, srcLinear, src, colorProfile);
- }
+ // First do naive blend with text-color
+ QRgb s = *dst;
+ blend_pixel(s, src);
+ // Then gamma-corrected blend with glyph shape
+ QRgba64 s64 = colorProfile ? colorProfile->toLinear64(s) : QRgba64::fromArgb32(s);
+ rgbBlendPixel(dst, coverage, s64, colorProfile);
}
}
-static inline void alphargbblend_argb32(quint32 *dst, uint coverage, const QRgba64 &srcLinear, quint32 src, const QColorProfile *colorProfile)
+#if QT_CONFIG(raster_64bit)
+static inline void rgbBlendPixel(QRgba64 &dst, int coverage, QRgba64 slinear, const QColorTrcLut *colorProfile)
+{
+ // Do a gammacorrected RGB alphablend...
+ const QRgba64 dlinear = colorProfile ? colorProfile->toLinear64(dst) : dst;
+
+ QRgba64 blend = rgbBlend(dlinear, slinear, coverage);
+
+ dst = colorProfile ? colorProfile->fromLinear(blend) : blend;
+}
+
+static inline void alphargbblend_generic(uint coverage, QRgba64 *dest, int x, const QRgba64 &srcLinear, const QRgba64 &src, const QColorTrcLut *colorProfile)
{
if (coverage == 0xff000000) {
// nothing
} else if (coverage == 0xffffffff) {
- *dst = src;
- } else if (*dst < 0xff000000) {
- // Give up and do a naive gray alphablend. Needed to deal with ARGB32 and invalid ARGB32_premultiplied, see QTBUG-60571
- const int a = qRgbAvg(coverage);
- *dst = INTERPOLATE_PIXEL_255(src, a, *dst, 255 - a);
- } else if (!colorProfile) {
- *dst = rgbBlend(*dst, src, coverage);
- } else {
- rgbBlendPixel(dst, coverage, srcLinear, colorProfile);
+ blend_pixel(dest[x], src);
+ } else if (!dest[x].isOpaque()) {
+ // Do a gray alphablend.
+ alphamapblend_generic(qRgbAvg(coverage), dest, x, srcLinear, src, colorProfile);
+ } else if (src.isOpaque()) {
+ rgbBlendPixel(dest[x], coverage, srcLinear, colorProfile);
+ } else {
+ // First do naive blend with text-color
+ QRgba64 s = dest[x];
+ blend_pixel(s, src);
+ // Then gamma-corrected blend with glyph shape
+ if (colorProfile)
+ s = colorProfile->toLinear(s);
+ rgbBlendPixel(dest[x], coverage, s, colorProfile);
}
}
@@ -5909,18 +6102,14 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
if (color.isTransparent())
return;
- const QColorProfile *colorProfile = nullptr;
+ const QColorTrcLut *colorProfile = nullptr;
if (useGammaCorrection)
colorProfile = QGuiApplicationPrivate::instance()->colorProfileForA32Text();
QRgba64 srcColor = color;
- if (colorProfile) {
- if (color.isOpaque())
- srcColor = colorProfile->toLinear(srcColor);
- else
- srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
- }
+ if (colorProfile && color.isOpaque())
+ srcColor = colorProfile->toLinear(srcColor);
alignas(8) QRgba64 buffer[BufferSize];
const DestFetchProc64 destFetch64 = destFetchProc64[rasterBuffer->format];
@@ -5975,6 +6164,80 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
} // for (yp -> bottom)
}
}
+#else
+static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer,
+ int x, int y, const QRgba64 &color,
+ const uint *src, int mapWidth, int mapHeight, int srcStride,
+ const QClipData *clip, bool useGammaCorrection)
+{
+ if (color.isTransparent())
+ return;
+
+ const quint32 c = color.toArgb32();
+
+ const QColorTrcLut *colorProfile = nullptr;
+
+ if (useGammaCorrection)
+ colorProfile = QGuiApplicationPrivate::instance()->colorProfileForA32Text();
+
+ QRgba64 srcColor = color;
+ if (colorProfile && color.isOpaque())
+ srcColor = colorProfile->toLinear(srcColor);
+
+ quint32 buffer[BufferSize];
+ const DestFetchProc destFetch = destFetchProc[rasterBuffer->format];
+ const DestStoreProc destStore = destStoreProc[rasterBuffer->format];
+
+ if (!clip) {
+ for (int ly = 0; ly < mapHeight; ++ly) {
+ int i = x;
+ int length = mapWidth;
+ while (length > 0) {
+ int l = qMin(BufferSize, length);
+ quint32 *dest = destFetch(buffer, rasterBuffer, i, y + ly, l);
+ for (int j=0; j < l; ++j) {
+ const uint coverage = src[j + (i - x)];
+ alphargbblend_argb32(dest + j, coverage, srcColor, c, colorProfile);
+ }
+ if (destStore)
+ destStore(rasterBuffer, i, y + ly, dest, l);
+ length -= l;
+ i += l;
+ }
+ src += srcStride;
+ }
+ } else {
+ int bottom = qMin(y + mapHeight, rasterBuffer->height());
+
+ int top = qMax(y, 0);
+ src += (top - y) * srcStride;
+
+ const_cast<QClipData *>(clip)->initialize();
+ for (int yp = top; yp<bottom; ++yp) {
+ const QClipData::ClipLine &line = clip->m_clipLines[yp];
+
+ for (int i=0; i<line.count; ++i) {
+ const QSpan &clip = line.spans[i];
+
+ int start = qMax<int>(x, clip.x);
+ int end = qMin<int>(x + mapWidth, clip.x + clip.len);
+ if (end <= start)
+ continue;
+ Q_ASSERT(end - start <= BufferSize);
+ quint32 *dest = destFetch(buffer, rasterBuffer, start, clip.y, end - start);
+
+ for (int xp=start; xp<end; ++xp) {
+ const uint coverage = src[xp - x];
+ alphargbblend_argb32(dest + xp - start, coverage, srcColor, c, colorProfile);
+ }
+ if (destStore)
+ destStore(rasterBuffer, start, clip.y, dest, end - start);
+ } // for (i -> line.count)
+ src += srcStride;
+ } // for (yp -> bottom)
+ }
+}
+#endif
static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer,
int x, int y, const QRgba64 &color,
@@ -5986,18 +6249,14 @@ static void qt_alphargbblit_argb32(QRasterBuffer *rasterBuffer,
const quint32 c = color.toArgb32();
- const QColorProfile *colorProfile = nullptr;
+ const QColorTrcLut *colorProfile = nullptr;
if (useGammaCorrection)
colorProfile = QGuiApplicationPrivate::instance()->colorProfileForA32Text();
QRgba64 srcColor = color;
- if (colorProfile) {
- if (color.isOpaque())
- srcColor = colorProfile->toLinear(srcColor);
- else
- srcColor = colorProfile->toLinear(srcColor.unpremultiplied()).premultiplied();
- }
+ if (colorProfile && color.isOpaque())
+ srcColor = colorProfile->toLinear(srcColor);
if (!clip) {
quint32 *dst = reinterpret_cast<quint32*>(rasterBuffer->scanLine(y)) + x;
@@ -6354,6 +6613,14 @@ DrawHelper qDrawHelper[QImage::NImageFormats] =
qt_alphargbblit_generic,
qt_rectfill_quint16
},
+ // Format_BGR888
+ {
+ blend_color_generic,
+ 0,
+ qt_alphamapblit_generic,
+ qt_alphargbblit_generic,
+ qt_rectfill_quint24
+ },
};
#if !defined(__SSE2__)
@@ -6515,6 +6782,9 @@ static void qInitDrawhelperFunctions()
qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_ssse3;
sourceFetchUntransformed[QImage::Format_RGB888] = qt_fetchUntransformed_888_ssse3;
+ extern void QT_FASTCALL rbSwap_888_ssse3(uchar *dst, const uchar *src, int count);
+ qPixelLayouts[QImage::Format_RGB888].rbSwap = rbSwap_888_ssse3;
+ qPixelLayouts[QImage::Format_BGR888].rbSwap = rbSwap_888_ssse3;
}
#endif // SSSE3
@@ -6565,8 +6835,10 @@ static void qInitDrawhelperFunctions()
qPixelLayouts[QImage::Format_A2RGB30_Premultiplied].storeFromARGB32PM = storeA2RGB30PMFromARGB32PM_sse4<PixelOrderRGB>;
qStoreFromRGBA64PM[QImage::Format_ARGB32] = storeARGB32FromRGBA64PM_sse4;
qStoreFromRGBA64PM[QImage::Format_RGBA8888] = storeRGBA8888FromRGBA64PM_sse4;
+#if QT_CONFIG(raster_64bit)
destStoreProc64[QImage::Format_ARGB32] = destStore64ARGB32_sse4;
destStoreProc64[QImage::Format_RGBA8888] = destStore64RGBA8888_sse4;
+#endif
}
#endif
@@ -6590,18 +6862,19 @@ static void qInitDrawhelperFunctions()
qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32_avx2;
extern void QT_FASTCALL comp_func_Source_avx2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);
- extern void QT_FASTCALL comp_func_Source_rgb64_avx2(QRgba64 *destPixels, const QRgba64 *srcPixels, int length, uint const_alpha);
extern void QT_FASTCALL comp_func_SourceOver_avx2(uint *destPixels, const uint *srcPixels, int length, uint const_alpha);
- extern void QT_FASTCALL comp_func_SourceOver_rgb64_avx2(QRgba64 *destPixels, const QRgba64 *srcPixels, int length, uint const_alpha);
extern void QT_FASTCALL comp_func_solid_SourceOver_avx2(uint *destPixels, int length, uint color, uint const_alpha);
- extern void QT_FASTCALL comp_func_solid_SourceOver_rgb64_avx2(QRgba64 *destPixels, int length, QRgba64 color, uint const_alpha);
-
qt_functionForMode_C[QPainter::CompositionMode_Source] = comp_func_Source_avx2;
- qt_functionForMode64_C[QPainter::CompositionMode_Source] = comp_func_Source_rgb64_avx2;
qt_functionForMode_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_avx2;
- qt_functionForMode64_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_rgb64_avx2;
qt_functionForModeSolid_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_avx2;
+#if QT_CONFIG(raster_64bit)
+ extern void QT_FASTCALL comp_func_Source_rgb64_avx2(QRgba64 *destPixels, const QRgba64 *srcPixels, int length, uint const_alpha);
+ extern void QT_FASTCALL comp_func_SourceOver_rgb64_avx2(QRgba64 *destPixels, const QRgba64 *srcPixels, int length, uint const_alpha);
+ extern void QT_FASTCALL comp_func_solid_SourceOver_rgb64_avx2(QRgba64 *destPixels, int length, QRgba64 color, uint const_alpha);
+ qt_functionForMode64_C[QPainter::CompositionMode_Source] = comp_func_Source_rgb64_avx2;
+ qt_functionForMode64_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_rgb64_avx2;
qt_functionForModeSolid64_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_rgb64_avx2;
+#endif
extern void QT_FASTCALL fetchTransformedBilinearARGB32PM_simple_scale_helper_avx2(uint *b, uint *end, const QTextureData &image,
int &fx, int &fy, int fdx, int /*fdy*/);
@@ -6625,6 +6898,7 @@ static void qInitDrawhelperFunctions()
qPixelLayouts[QImage::Format_RGBA8888].fetchToARGB32PM = fetchRGBA8888ToARGB32PM_avx2;
qPixelLayouts[QImage::Format_RGBA8888].convertToARGB32PM = convertRGBA8888ToARGB32PM_avx2;
+#if QT_CONFIG(raster_64bit)
extern const QRgba64 * QT_FASTCALL convertARGB32ToRGBA64PM_avx2(QRgba64 *, const uint *, int, const QVector<QRgb> *, QDitherInfo *);
extern const QRgba64 * QT_FASTCALL convertRGBA8888ToRGBA64PM_avx2(QRgba64 *, const uint *, int count, const QVector<QRgb> *, QDitherInfo *);
extern const QRgba64 *QT_FASTCALL fetchARGB32ToRGBA64PM_avx2(QRgba64 *, const uchar *, int, int, const QVector<QRgb> *, QDitherInfo *);
@@ -6633,6 +6907,7 @@ static void qInitDrawhelperFunctions()
qPixelLayouts[QImage::Format_RGBX8888].convertToRGBA64PM = convertRGBA8888ToRGBA64PM_avx2;
qPixelLayouts[QImage::Format_ARGB32].fetchToRGBA64PM = fetchARGB32ToRGBA64PM_avx2;
qPixelLayouts[QImage::Format_RGBX8888].fetchToRGBA64PM = fetchRGBA8888ToRGBA64PM_avx2;
+#endif
}
#endif
diff --git a/src/gui/painting/qdrawhelper_avx2.cpp b/src/gui/painting/qdrawhelper_avx2.cpp
index 2b3cc9b226..fb50cb6a50 100644
--- a/src/gui/painting/qdrawhelper_avx2.cpp
+++ b/src/gui/painting/qdrawhelper_avx2.cpp
@@ -396,6 +396,7 @@ void QT_FASTCALL comp_func_SourceOver_avx2(uint *destPixels, const uint *srcPixe
BLEND_SOURCE_OVER_ARGB32_WITH_CONST_ALPHA_AVX2(dst, src, length, const_alpha);
}
+#if QT_CONFIG(raster_64bit)
void QT_FASTCALL comp_func_SourceOver_rgb64_avx2(QRgba64 *dst, const QRgba64 *src, int length, uint const_alpha)
{
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
@@ -453,6 +454,7 @@ void QT_FASTCALL comp_func_SourceOver_rgb64_avx2(QRgba64 *dst, const QRgba64 *sr
blend_pixel(dst[x], src[x], const_alpha);
}
}
+#endif
void QT_FASTCALL comp_func_Source_avx2(uint *dst, const uint *src, int length, uint const_alpha)
{
@@ -485,6 +487,7 @@ void QT_FASTCALL comp_func_Source_avx2(uint *dst, const uint *src, int length, u
}
}
+#if QT_CONFIG(raster_64bit)
void QT_FASTCALL comp_func_Source_rgb64_avx2(QRgba64 *dst, const QRgba64 *src, int length, uint const_alpha)
{
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
@@ -517,6 +520,7 @@ void QT_FASTCALL comp_func_Source_rgb64_avx2(QRgba64 *dst, const QRgba64 *src, i
dst[x] = interpolate65535(src[x], ca, dst[x], cia);
}
}
+#endif
void QT_FASTCALL comp_func_solid_SourceOver_avx2(uint *destPixels, int length, uint color, uint const_alpha)
{
@@ -549,6 +553,7 @@ void QT_FASTCALL comp_func_solid_SourceOver_avx2(uint *destPixels, int length, u
}
}
+#if QT_CONFIG(raster_64bit)
void QT_FASTCALL comp_func_solid_SourceOver_rgb64_avx2(QRgba64 *destPixels, int length, QRgba64 color, uint const_alpha)
{
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
@@ -579,6 +584,7 @@ void QT_FASTCALL comp_func_solid_SourceOver_rgb64_avx2(QRgba64 *destPixels, int
destPixels[x] = color + multiplyAlpha65535(destPixels[x], minusAlphaOfColor);
}
}
+#endif
#define interpolate_4_pixels_16_avx2(tlr1, tlr2, blr1, blr2, distx, disty, colorMask, v_256, b) \
{ \
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index 37108949d6..dd42b96d79 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -296,7 +296,9 @@ struct QGradientData
#define GRADIENT_STOPTABLE_SIZE 1024
#define GRADIENT_STOPTABLE_SIZE_SHIFT 10
+#if QT_CONFIG(raster_64bit)
const QRgba64 *colorTable64; //[GRADIENT_STOPTABLE_SIZE];
+#endif
const QRgb *colorTable32; //[GRADIENT_STOPTABLE_SIZE];
uint alphaColor : 1;
@@ -328,7 +330,7 @@ struct QTextureData
struct QSpanData
{
- QSpanData() : tempImage(0) {}
+ QSpanData() : tempImage(nullptr) {}
~QSpanData() { delete tempImage; }
QRasterBuffer *rasterBuffer;
@@ -402,11 +404,13 @@ static inline uint qt_gradient_pixel(const QGradientData *data, qreal pos)
return data->colorTable32[qt_gradient_clamp(data, ipos)];
}
+#if QT_CONFIG(raster_64bit)
static inline const QRgba64& qt_gradient_pixel64(const QGradientData *data, qreal pos)
{
int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5));
return data->colorTable64[qt_gradient_clamp(data, ipos)];
}
+#endif
static inline qreal qRadialDeterminant(qreal a, qreal b, qreal c)
{
@@ -667,6 +671,8 @@ static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src)
static Q_ALWAYS_INLINE void blend_pixel(quint32 &dst, const quint32 src, const int const_alpha)
{
+ if (const_alpha == 255)
+ return blend_pixel(dst, src);
if (src != 0) {
const quint32 s = BYTE_MUL(src, const_alpha);
dst = s + BYTE_MUL(dst, qAlpha(~s));
diff --git a/src/gui/painting/qdrawhelper_sse4.cpp b/src/gui/painting/qdrawhelper_sse4.cpp
index e387026972..68d887ae6d 100644
--- a/src/gui/painting/qdrawhelper_sse4.cpp
+++ b/src/gui/painting/qdrawhelper_sse4.cpp
@@ -417,6 +417,7 @@ void QT_FASTCALL storeA2RGB30PMFromARGB32PM_sse4(uchar *dest, const uint *src, i
d[i] = qConvertArgb32ToA2rgb30_sse4<PixelOrder>(src[i]);
}
+#if QT_CONFIG(raster_64bit)
void QT_FASTCALL destStore64ARGB32_sse4(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length)
{
uint *dest = (uint*)rasterBuffer->scanLine(y) + x;
@@ -428,6 +429,7 @@ void QT_FASTCALL destStore64RGBA8888_sse4(QRasterBuffer *rasterBuffer, int x, in
uint *dest = (uint*)rasterBuffer->scanLine(y) + x;
convertARGBFromRGBA64PM_sse4<true>(dest, buffer, length);
}
+#endif
void QT_FASTCALL storeARGB32FromRGBA64PM_sse4(uchar *dest, const QRgba64 *src, int index, int count,
const QVector<QRgb> *, QDitherInfo *)
diff --git a/src/gui/painting/qdrawhelper_ssse3.cpp b/src/gui/painting/qdrawhelper_ssse3.cpp
index 35d61c3e6c..14d7047bb6 100644
--- a/src/gui/painting/qdrawhelper_ssse3.cpp
+++ b/src/gui/painting/qdrawhelper_ssse3.cpp
@@ -40,7 +40,7 @@
#include <private/qdrawhelper_x86_p.h>
-#ifdef QT_COMPILER_SUPPORTS_SSSE3
+#if defined(QT_COMPILER_SUPPORTS_SSSE3)
#include <private/qdrawingprimitive_sse2_p.h>
@@ -254,6 +254,49 @@ void qt_memfill24_ssse3(quint24 *dest, quint24 color, qsizetype count)
}
}
+void QT_FASTCALL rbSwap_888_ssse3(uchar *dst, const uchar *src, int count)
+{
+ int i = 0;
+
+ const static __m128i shuffleMask1 = _mm_setr_epi8(2, 1, 0, 5, 4, 3, 8, 7, 6, 11, 10, 9, 14, 13, 12, /*!!*/15);
+ const static __m128i shuffleMask2 = _mm_setr_epi8(0, /*!!*/1, 4, 3, 2, 7, 6, 5, 10, 9, 8, 13, 12, 11, /*!!*/14, 15);
+ const static __m128i shuffleMask3 = _mm_setr_epi8(/*!!*/0, 3, 2, 1, 6, 5, 4, 9, 8, 7, 12, 11, 10, 15, 14, 13);
+
+ for (; i + 15 < count; i += 16) {
+ __m128i s1 = _mm_loadu_si128((const __m128i *)src);
+ __m128i s2 = _mm_loadu_si128((const __m128i *)(src + 16));
+ __m128i s3 = _mm_loadu_si128((const __m128i *)(src + 32));
+ s1 = _mm_shuffle_epi8(s1, shuffleMask1);
+ s2 = _mm_shuffle_epi8(s2, shuffleMask2);
+ s3 = _mm_shuffle_epi8(s3, shuffleMask3);
+ _mm_storeu_si128((__m128i *)dst, s1);
+ _mm_storeu_si128((__m128i *)(dst + 16), s2);
+ _mm_storeu_si128((__m128i *)(dst + 32), s3);
+
+ // Now fix the last four misplaced values
+ std::swap(dst[15], dst[17]);
+ std::swap(dst[30], dst[32]);
+
+ src += 48;
+ dst += 48;
+ }
+
+ if (src != dst) {
+ SIMD_EPILOGUE(i, count, 15) {
+ dst[0] = src[2];
+ dst[1] = src[1];
+ dst[2] = src[0];
+ dst += 3;
+ src += 3;
+ }
+ } else {
+ SIMD_EPILOGUE(i, count, 15) {
+ std::swap(dst[0], dst[2]);
+ dst += 3;
+ }
+ }
+}
+
QT_END_NAMESPACE
#endif // QT_COMPILER_SUPPORTS_SSSE3
diff --git a/src/gui/painting/qicc.cpp b/src/gui/painting/qicc.cpp
new file mode 100644
index 0000000000..18f212f8e9
--- /dev/null
+++ b/src/gui/painting/qicc.cpp
@@ -0,0 +1,776 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qicc_p.h"
+
+#include <qbuffer.h>
+#include <qbytearray.h>
+#include <qdatastream.h>
+#include <qendian.h>
+#include <qloggingcategory.h>
+#include <qstring.h>
+
+#include "qcolorspace_p.h"
+#include "qcolortrc_p.h"
+
+QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcIcc, "qt.gui.icc")
+
+struct ICCProfileHeader
+{
+ quint32_be profileSize;
+
+ quint32_be preferredCmmType;
+
+ quint32_be profileVersion;
+ quint32_be profileClass;
+ quint32_be inputColorSpace;
+ quint32_be pcs;
+ quint32_be datetime[3];
+ quint32_be signature;
+ quint32_be platformSignature;
+ quint32_be flags;
+ quint32_be deviceManufacturer;
+ quint32_be deviceModel;
+ quint32_be deviceAttributes[2];
+
+ quint32_be renderingIntent;
+ qint32_be illuminantXyz[3];
+
+ quint32_be creatorSignature;
+ quint32_be profileId[4];
+
+ quint32_be reserved[7];
+
+// Technically after the header, but easier to include here:
+ quint32_be tagCount;
+};
+
+constexpr quint32 IccTag(uchar a, uchar b, uchar c, uchar d)
+{
+ return (a << 24) | (b << 16) | (c << 8) | d;
+}
+
+enum class ProfileClass : quint32 {
+ Input = IccTag('s', 'c', 'r', 'n'),
+ Display = IccTag('m', 'n', 't', 'r'),
+ // Not supported:
+ Output = IccTag('p', 'r', 't', 'r'),
+ ColorSpace = IccTag('s', 'p', 'a', 'c'),
+};
+
+enum class Tag : quint32 {
+ acsp = IccTag('a', 'c', 's', 'p'),
+ RGB_ = IccTag('R', 'G', 'B', ' '),
+ XYZ_ = IccTag('X', 'Y', 'Z', ' '),
+ rXYZ = IccTag('r', 'X', 'Y', 'Z'),
+ gXYZ = IccTag('g', 'X', 'Y', 'Z'),
+ bXYZ = IccTag('b', 'X', 'Y', 'Z'),
+ rTRC = IccTag('r', 'T', 'R', 'C'),
+ gTRC = IccTag('g', 'T', 'R', 'C'),
+ bTRC = IccTag('b', 'T', 'R', 'C'),
+ A2B0 = IccTag('A', '2', 'B', '0'),
+ A2B1 = IccTag('A', '2', 'B', '1'),
+ B2A0 = IccTag('B', '2', 'A', '0'),
+ B2A1 = IccTag('B', '2', 'A', '1'),
+ desc = IccTag('d', 'e', 's', 'c'),
+ text = IccTag('t', 'e', 'x', 't'),
+ cprt = IccTag('c', 'p', 'r', 't'),
+ curv = IccTag('c', 'u', 'r', 'v'),
+ para = IccTag('p', 'a', 'r', 'a'),
+ wtpt = IccTag('w', 't', 'p', 't'),
+ bkpt = IccTag('b', 'k', 'p', 't'),
+ mft1 = IccTag('m', 'f', 't', '1'),
+ mft2 = IccTag('m', 'f', 't', '2'),
+ mluc = IccTag('m', 'l', 'u', 'c'),
+ mAB_ = IccTag('m', 'A', 'B', ' '),
+ mBA_ = IccTag('m', 'B', 'A', ' '),
+ chad = IccTag('c', 'h', 'a', 'd'),
+ sf32 = IccTag('s', 'f', '3', '2'),
+
+ // Apple extensions for ICCv2:
+ aarg = IccTag('a', 'a', 'r', 'g'),
+ aagg = IccTag('a', 'a', 'g', 'g'),
+ aabg = IccTag('a', 'a', 'b', 'g'),
+};
+
+inline uint qHash(const Tag &key, uint seed = 0)
+{
+ return qHash(quint32(key), seed);
+}
+
+namespace QIcc {
+
+struct TagTableEntry
+{
+ quint32_be signature;
+ quint32_be offset;
+ quint32_be size;
+};
+
+struct GenericTagData {
+ quint32_be type;
+ quint32_be null;
+};
+
+struct XYZTagData : GenericTagData {
+ qint32_be fixedX;
+ qint32_be fixedY;
+ qint32_be fixedZ;
+};
+
+struct CurvTagData : GenericTagData {
+ quint32_be valueCount;
+ quint16_be value[1];
+};
+
+struct ParaTagData : GenericTagData {
+ quint16_be curveType;
+ quint16_be null2;
+ quint32_be parameter[1];
+};
+
+struct DescTagData : GenericTagData {
+ quint32_be asciiDescriptionLength;
+ char asciiDescription[1];
+ // .. we ignore the rest
+};
+
+struct MlucTagRecord {
+ quint16_be languageCode;
+ quint16_be countryCode;
+ quint32_be size;
+ quint32_be offset;
+};
+
+struct MlucTagData : GenericTagData {
+ quint32_be recordCount;
+ quint32_be recordSize; // = sizeof(MlucTagRecord)
+ MlucTagRecord records[1];
+};
+
+// For both mAB and mBA
+struct mABTagData : GenericTagData {
+ quint8 inputChannels;
+ quint8 outputChannels;
+ quint8 padding[2];
+ quint32_be bCurvesOffset;
+ quint32_be matrixOffset;
+ quint32_be mCurvesOffset;
+ quint32_be clutOffset;
+ quint32_be aCurvesOffset;
+};
+
+struct Sf32TagData : GenericTagData {
+ quint32_be value[1];
+};
+
+static int toFixedS1516(float x)
+{
+ return int(x * 65536.0f + 0.5f);
+}
+
+static float fromFixedS1516(int x)
+{
+ return x * (1.0f / 65536.0f);
+}
+
+static bool isValidIccProfile(const ICCProfileHeader &header)
+{
+ if (header.signature != uint(Tag::acsp)) {
+ qCWarning(lcIcc, "Failed ICC signature test");
+ return false;
+ }
+
+ // Don't overflow 32bit integers:
+ if (header.tagCount >= INT32_MAX / sizeof(TagTableEntry))
+ return false;
+ if (header.profileSize - sizeof(ICCProfileHeader) < header.tagCount * sizeof(TagTableEntry)) {
+ qCWarning(lcIcc, "Failed basic size sanity");
+ return false;
+ }
+
+ if (header.profileClass != uint(ProfileClass::Input)
+ && header.profileClass != uint(ProfileClass::Display)) {
+ qCWarning(lcIcc, "Unsupported ICC profile class %x", quint32(header.profileClass));
+ return false;
+ }
+ if (header.inputColorSpace != 0x52474220 /* 'RGB '*/) {
+ qCWarning(lcIcc, "Unsupported ICC input color space %x", quint32(header.inputColorSpace));
+ return false;
+ }
+ if (header.pcs != 0x58595a20 /* 'XYZ '*/) {
+ // ### support PCSLAB
+ qCWarning(lcIcc, "Unsupported ICC profile connection space %x", quint32(header.pcs));
+ return false;
+ }
+
+ QColorVector illuminant;
+ illuminant.x = fromFixedS1516(header.illuminantXyz[0]);
+ illuminant.y = fromFixedS1516(header.illuminantXyz[1]);
+ illuminant.z = fromFixedS1516(header.illuminantXyz[2]);
+ if (illuminant != QColorVector::D50()) {
+ qCWarning(lcIcc, "Invalid ICC illuminant");
+ return false;
+ }
+
+ return true;
+}
+
+static int writeColorTrc(QDataStream &stream, const QColorTrc &trc)
+{
+ if (trc.isLinear()) {
+ stream << uint(Tag::curv) << uint(0);
+ stream << uint(0);
+ return 12;
+ }
+
+ if (trc.m_type == QColorTrc::Type::Function) {
+ const QColorTransferFunction &fun = trc.m_fun;
+ stream << uint(Tag::para) << uint(0);
+ if (fun.isGamma()) {
+ stream << ushort(0) << ushort(0);
+ stream << toFixedS1516(fun.m_g);
+ return 12 + 4;
+ }
+ bool type3 = qFuzzyIsNull(fun.m_e) && qFuzzyIsNull(fun.m_f);
+ stream << ushort(type3 ? 3 : 4) << ushort(0);
+ stream << toFixedS1516(fun.m_g);
+ stream << toFixedS1516(fun.m_a);
+ stream << toFixedS1516(fun.m_b);
+ stream << toFixedS1516(fun.m_c);
+ stream << toFixedS1516(fun.m_d);
+ if (type3)
+ return 12 + 5 * 4;
+ stream << toFixedS1516(fun.m_e);
+ stream << toFixedS1516(fun.m_f);
+ return 12 + 7 * 4;
+ }
+
+ Q_ASSERT(trc.m_type == QColorTrc::Type::Table);
+ stream << uint(Tag::curv) << uint(0);
+ stream << uint(trc.m_table.m_tableSize);
+ if (!trc.m_table.m_table16.isEmpty()) {
+ for (uint i = 0; i < trc.m_table.m_tableSize; ++i) {
+ stream << ushort(trc.m_table.m_table16[i]);
+ }
+ } else {
+ for (uint i = 0; i < trc.m_table.m_tableSize; ++i) {
+ stream << ushort(trc.m_table.m_table8[i] * 257U);
+ }
+ }
+ return 12 + 2 * trc.m_table.m_tableSize;
+}
+
+QByteArray toIccProfile(const QColorSpace &space)
+{
+ if (!space.isValid())
+ return QByteArray();
+
+ const QColorSpacePrivate *spaceDPtr = QColorSpacePrivate::get(space);
+
+ constexpr int tagCount = 9;
+ constexpr uint profileDataOffset = 128 + 4 + 12 * tagCount;
+ constexpr uint variableTagTableOffsets = 128 + 4 + 12 * 5;
+ uint currentOffset = 0;
+ uint rTrcOffset, gTrcOffset, bTrcOffset;
+ uint rTrcSize, gTrcSize, bTrcSize;
+ uint descOffset, descSize;
+
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+ QDataStream stream(&buffer);
+
+ // Profile header:
+ stream << uint(0); // Size, we will update this later
+ stream << uint(0);
+ stream << uint(0x02400000); // Version 2.4 (note we use 'para' from version 4)
+ stream << uint(ProfileClass::Display);
+ stream << uint(Tag::RGB_);
+ stream << uint(Tag::XYZ_);
+ stream << uint(0) << uint(0) << uint(0);
+ stream << uint(Tag::acsp);
+ stream << uint(0) << uint(0) << uint(0);
+ stream << uint(0) << uint(0) << uint(0);
+ stream << uint(1); // Rendering intent
+ stream << uint(0x0000f6d6); // D50 X
+ stream << uint(0x00010000); // D50 Y
+ stream << uint(0x0000d32d); // D50 Z
+ stream << IccTag('Q','t', QT_VERSION_MAJOR, QT_VERSION_MINOR);
+ stream << uint(0) << uint(0) << uint(0) << uint(0);
+ stream << uint(0) << uint(0) << uint(0) << uint(0) << uint(0) << uint(0) << uint(0);
+
+ // Tag table:
+ stream << uint(tagCount);
+ stream << uint(Tag::rXYZ) << uint(profileDataOffset + 00) << uint(20);
+ stream << uint(Tag::gXYZ) << uint(profileDataOffset + 20) << uint(20);
+ stream << uint(Tag::bXYZ) << uint(profileDataOffset + 40) << uint(20);
+ stream << uint(Tag::wtpt) << uint(profileDataOffset + 60) << uint(20);
+ stream << uint(Tag::cprt) << uint(profileDataOffset + 80) << uint(12);
+ // From here the offset and size will be updated later:
+ stream << uint(Tag::rTRC) << uint(0) << uint(0);
+ stream << uint(Tag::gTRC) << uint(0) << uint(0);
+ stream << uint(Tag::bTRC) << uint(0) << uint(0);
+ stream << uint(Tag::desc) << uint(0) << uint(0);
+ // TODO: consider adding 'chad' tag (required in ICC >=4 when we have non-D50 whitepoint)
+ currentOffset = profileDataOffset;
+
+ // Tag data:
+ stream << uint(Tag::XYZ_) << uint(0);
+ stream << toFixedS1516(spaceDPtr->toXyz.r.x);
+ stream << toFixedS1516(spaceDPtr->toXyz.r.y);
+ stream << toFixedS1516(spaceDPtr->toXyz.r.z);
+ stream << uint(Tag::XYZ_) << uint(0);
+ stream << toFixedS1516(spaceDPtr->toXyz.g.x);
+ stream << toFixedS1516(spaceDPtr->toXyz.g.y);
+ stream << toFixedS1516(spaceDPtr->toXyz.g.z);
+ stream << uint(Tag::XYZ_) << uint(0);
+ stream << toFixedS1516(spaceDPtr->toXyz.b.x);
+ stream << toFixedS1516(spaceDPtr->toXyz.b.y);
+ stream << toFixedS1516(spaceDPtr->toXyz.b.z);
+ stream << uint(Tag::XYZ_) << uint(0);
+ stream << toFixedS1516(spaceDPtr->whitePoint.x);
+ stream << toFixedS1516(spaceDPtr->whitePoint.y);
+ stream << toFixedS1516(spaceDPtr->whitePoint.z);
+ stream << uint(Tag::text) << uint(0);
+ stream << uint(IccTag('N', '/', 'A', '\0'));
+ currentOffset += 92;
+
+ // From now on the data is variable sized:
+ rTrcOffset = currentOffset;
+ rTrcSize = writeColorTrc(stream, spaceDPtr->trc[0]);
+ currentOffset += rTrcSize;
+ if (spaceDPtr->trc[0] == spaceDPtr->trc[1]) {
+ gTrcOffset = rTrcOffset;
+ gTrcSize = rTrcSize;
+ } else {
+ gTrcOffset = currentOffset;
+ gTrcSize = writeColorTrc(stream, spaceDPtr->trc[1]);
+ currentOffset += gTrcSize;
+ }
+ if (spaceDPtr->trc[0] == spaceDPtr->trc[2]) {
+ bTrcOffset = rTrcOffset;
+ bTrcSize = rTrcSize;
+ } else {
+ bTrcOffset = currentOffset;
+ bTrcSize = writeColorTrc(stream, spaceDPtr->trc[2]);
+ currentOffset += bTrcSize;
+ }
+
+ descOffset = currentOffset;
+ QByteArray description = spaceDPtr->description.toUtf8();
+ stream << uint(Tag::desc) << uint(0);
+ stream << uint(description.size() + 1);
+ stream.writeRawData(description.constData(), description.size() + 1);
+ stream << uint(0) << uint(0);
+ stream << ushort(0) << uchar(0);
+ QByteArray macdesc(67, '\0');
+ stream.writeRawData(macdesc.constData(), 67);
+ descSize = 90 + description.size() + 1;
+ currentOffset += descSize;
+
+ buffer.close();
+ QByteArray iccProfile = buffer.buffer();
+ // Now write final size
+ *(quint32_be *)iccProfile.data() = iccProfile.size();
+ // And the final indices and sizes of variable size tags:
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 4) = rTrcOffset;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 8) = rTrcSize;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 12 + 4) = gTrcOffset;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 12 + 8) = gTrcSize;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 2 * 12 + 4) = bTrcOffset;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 2 * 12 + 8) = bTrcSize;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 3 * 12 + 4) = descOffset;
+ *(quint32_be *)(iccProfile.data() + variableTagTableOffsets + 3 * 12 + 8) = descSize;
+
+#if !defined(QT_NO_DEBUG) || defined(QT_FORCE_ASSERTS)
+ const ICCProfileHeader *iccHeader = (const ICCProfileHeader *)iccProfile.constData();
+ Q_ASSERT(qsizetype(iccHeader->profileSize) == qsizetype(iccProfile.size()));
+ Q_ASSERT(isValidIccProfile(*iccHeader));
+#endif
+
+ return iccProfile;
+}
+
+struct TagEntry {
+ quint32 offset;
+ quint32 size;
+};
+
+bool parseXyzData(const QByteArray &data, const TagEntry &tagEntry, QColorVector &colorVector)
+{
+ if (tagEntry.size < sizeof(XYZTagData)) {
+ qCWarning(lcIcc) << "Undersized XYZ tag";
+ return false;
+ }
+ const XYZTagData *xyz = reinterpret_cast<const XYZTagData *>(data.constData() + tagEntry.offset);
+ if (xyz->type != quint32(Tag::XYZ_)) {
+ qCWarning(lcIcc) << "Bad XYZ content type";
+ return false;
+ }
+ const float x = fromFixedS1516(xyz->fixedX);
+ const float y = fromFixedS1516(xyz->fixedY);
+ const float z = fromFixedS1516(xyz->fixedZ);
+
+ colorVector = QColorVector(x, y, z);
+ return true;
+}
+
+bool parseTRC(const QByteArray &data, const TagEntry &tagEntry, QColorTrc &gamma)
+{
+ const GenericTagData *trcData = reinterpret_cast<const GenericTagData *>(data.constData() + tagEntry.offset);
+ if (trcData->type == quint32(Tag::curv)) {
+ const CurvTagData *curv = static_cast<const CurvTagData *>(trcData);
+ if (curv->valueCount > (1 << 16))
+ return false;
+ if (tagEntry.size - 12 < 2 * curv->valueCount)
+ return false;
+ if (curv->valueCount == 0) {
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction(); // Linear
+ } else if (curv->valueCount == 1) {
+ float g = curv->value[0] * (1.0f / 256.0f);
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction::fromGamma(g);
+ } else {
+ QVector<quint16> tabl;
+ tabl.resize(curv->valueCount);
+ for (uint i = 0; i < curv->valueCount; ++i)
+ tabl[i] = curv->value[i];
+ QColorTransferTable table = QColorTransferTable(curv->valueCount, std::move(tabl));
+ QColorTransferFunction curve;
+ if (!table.asColorTransferFunction(&curve)) {
+ gamma.m_type = QColorTrc::Type::Table;
+ gamma.m_table = table;
+ } else {
+ qCDebug(lcIcc) << "Detected curv table as function";
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = curve;
+ }
+ }
+ return true;
+ }
+ if (trcData->type == quint32(Tag::para)) {
+ if (tagEntry.size < sizeof(ParaTagData))
+ return false;
+ const ParaTagData *para = static_cast<const ParaTagData *>(trcData);
+ switch (para->curveType) {
+ case 0: {
+ float g = fromFixedS1516(para->parameter[0]);
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction::fromGamma(g);
+ break;
+ }
+ case 1: {
+ if (tagEntry.size < sizeof(ParaTagData) + 2 * 4)
+ return false;
+ float g = fromFixedS1516(para->parameter[0]);
+ float a = fromFixedS1516(para->parameter[1]);
+ float b = fromFixedS1516(para->parameter[2]);
+ float d = -b / a;
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction(a, b, 0.0f, d, 0.0f, 0.0f, g);
+ break;
+ }
+ case 2: {
+ if (tagEntry.size < sizeof(ParaTagData) + 3 * 4)
+ return false;
+ float g = fromFixedS1516(para->parameter[0]);
+ float a = fromFixedS1516(para->parameter[1]);
+ float b = fromFixedS1516(para->parameter[2]);
+ float c = fromFixedS1516(para->parameter[3]);
+ float d = -b / a;
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction(a, b, 0.0f, d, c, c, g);
+ break;
+ }
+ case 3: {
+ if (tagEntry.size < sizeof(ParaTagData) + 4 * 4)
+ return false;
+ float g = fromFixedS1516(para->parameter[0]);
+ float a = fromFixedS1516(para->parameter[1]);
+ float b = fromFixedS1516(para->parameter[2]);
+ float c = fromFixedS1516(para->parameter[3]);
+ float d = fromFixedS1516(para->parameter[4]);
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction(a, b, c, d, 0.0f, 0.0f, g);
+ break;
+ }
+ case 4: {
+ if (tagEntry.size < sizeof(ParaTagData) + 6 * 4)
+ return false;
+ float g = fromFixedS1516(para->parameter[0]);
+ float a = fromFixedS1516(para->parameter[1]);
+ float b = fromFixedS1516(para->parameter[2]);
+ float c = fromFixedS1516(para->parameter[3]);
+ float d = fromFixedS1516(para->parameter[4]);
+ float e = fromFixedS1516(para->parameter[5]);
+ float f = fromFixedS1516(para->parameter[6]);
+ gamma.m_type = QColorTrc::Type::Function;
+ gamma.m_fun = QColorTransferFunction(a, b, c, d, e, f, g);
+ break;
+ }
+ default:
+ qCWarning(lcIcc) << "Unknown para type" << uint(para->curveType);
+ return false;
+ }
+ return true;
+ }
+ qCWarning(lcIcc) << "Invalid TRC data type";
+ return false;
+}
+
+bool parseDesc(const QByteArray &data, const TagEntry &tagEntry, QString &descName)
+{
+ const GenericTagData *tag = (const GenericTagData *)(data.constData() + tagEntry.offset);
+
+ // Either 'desc' (ICCv2) or 'mluc' (ICCv4)
+ if (tag->type == quint32(Tag::desc)) {
+ if (tagEntry.size < sizeof(DescTagData))
+ return false;
+ const DescTagData *desc = (const DescTagData *)(data.constData() + tagEntry.offset);
+ const quint32 len = desc->asciiDescriptionLength;
+ if (len < 1)
+ return false;
+ if (tagEntry.size - 12 < len)
+ return false;
+ if (desc->asciiDescription[len - 1] != '\0')
+ return false;
+ descName = QString::fromLatin1(desc->asciiDescription, len - 1);
+ return true;
+ }
+ if (tag->type != quint32(Tag::mluc))
+ return false;
+
+ if (tagEntry.size < sizeof(MlucTagData))
+ return false;
+ const MlucTagData *mluc = (const MlucTagData *)(data.constData() + tagEntry.offset);
+ if (mluc->recordCount < 1)
+ return false;
+ if (mluc->recordSize < 12)
+ return false;
+ // We just use the primary record regardless of language or country.
+ const quint32 stringOffset = mluc->records[0].offset;
+ const quint32 stringSize = mluc->records[0].size;
+ if (tagEntry.size < stringOffset || tagEntry.size - stringOffset < stringSize )
+ return false;
+ if ((stringSize | stringOffset) & 1)
+ return false;
+ quint32 stringLen = stringSize / 2;
+ const ushort *unicodeString = (const ushort *)(data.constData() + tagEntry.offset + stringOffset);
+ // The given length shouldn't include 0-termination, but might.
+ if (stringLen > 1 && unicodeString[stringLen - 1] == 0)
+ --stringLen;
+ QVarLengthArray<quint16> utf16hostendian(stringLen);
+ qFromBigEndian<ushort>(unicodeString, stringLen, utf16hostendian.data());
+ descName = QString::fromUtf16(utf16hostendian.data(), stringLen);
+ return true;
+}
+
+bool fromIccProfile(const QByteArray &data, QColorSpace *colorSpace)
+{
+ if (data.size() < qsizetype(sizeof(ICCProfileHeader))) {
+ qCWarning(lcIcc) << "fromIccProfile: failed size sanity 1";
+ return false;
+ }
+ const ICCProfileHeader *header = (const ICCProfileHeader *)data.constData();
+ if (!isValidIccProfile(*header)) {
+ qCWarning(lcIcc) << "fromIccProfile: failed general sanity check";
+ return false;
+ }
+ if (qsizetype(header->profileSize) > data.size()) {
+ qCWarning(lcIcc) << "fromIccProfile: failed size sanity 2";
+ return false;
+ }
+
+ // Read tag index
+ const TagTableEntry *tagTable = (const TagTableEntry *)(data.constData() + sizeof(ICCProfileHeader));
+ const qsizetype offsetToData = sizeof(ICCProfileHeader) + header->tagCount * sizeof(TagTableEntry);
+ if (offsetToData > data.size()) {
+ qCWarning(lcIcc) << "fromIccProfile: failed index size sanity";
+ return false;
+ }
+
+ QHash<Tag, TagEntry> tagIndex;
+ for (uint i = 0; i < header->tagCount; ++i) {
+ // Sanity check tag sizes and offsets:
+ if (qsizetype(tagTable[i].offset) < offsetToData) {
+ qCWarning(lcIcc) << "fromIccProfile: failed tag offset sanity 1";
+ return false;
+ }
+ // Checked separately from (+ size) to handle overflow.
+ if (tagTable[i].offset > header->profileSize) {
+ qCWarning(lcIcc) << "fromIccProfile: failed tag offset sanity 2";
+ return false;
+ }
+ if (tagTable[i].size < 12) {
+ qCWarning(lcIcc) << "fromIccProfile: failed minimal tag size sanity";
+ return false;
+ }
+ if (tagTable[i].size > header->profileSize - tagTable[i].offset) {
+ qCWarning(lcIcc) << "fromIccProfile: failed tag offset + size sanity";
+ return false;
+ }
+ if (tagTable[i].offset & 0x03) {
+ qCWarning(lcIcc) << "fromIccProfile: invalid tag offset alignment";
+ return false;
+ }
+// printf("'%4s' %d %d\n", (const char *)&tagTable[i].signature,
+// quint32(tagTable[i].offset),
+// quint32(tagTable[i].size));
+ tagIndex.insert(Tag(quint32(tagTable[i].signature)), { tagTable[i].offset, tagTable[i].size });
+ }
+
+ // Check the profile is three-component matrix based (what we currently support):
+ if (!tagIndex.contains(Tag::rXYZ) || !tagIndex.contains(Tag::gXYZ) || !tagIndex.contains(Tag::bXYZ) ||
+ !tagIndex.contains(Tag::rTRC) || !tagIndex.contains(Tag::gTRC) || !tagIndex.contains(Tag::bTRC) ||
+ !tagIndex.contains(Tag::wtpt)) {
+ qCWarning(lcIcc) << "fromIccProfile: Unsupported ICC profile - not three component matrix based";
+ return false;
+ }
+
+ QColorSpacePrivate *colorspaceDPtr = QColorSpacePrivate::getWritable(*colorSpace);
+
+ // Parse XYZ tags
+ if (!parseXyzData(data, tagIndex[Tag::rXYZ], colorspaceDPtr->toXyz.r))
+ return false;
+ if (!parseXyzData(data, tagIndex[Tag::gXYZ], colorspaceDPtr->toXyz.g))
+ return false;
+ if (!parseXyzData(data, tagIndex[Tag::bXYZ], colorspaceDPtr->toXyz.b))
+ return false;
+ if (!parseXyzData(data, tagIndex[Tag::wtpt], colorspaceDPtr->whitePoint))
+ return false;
+
+ colorspaceDPtr->primaries = QColorSpace::Primaries::Custom;
+ if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromSRgb()) {
+ qCDebug(lcIcc) << "fromIccProfile: sRGB primaries detected";
+ colorspaceDPtr->primaries = QColorSpace::Primaries::SRgb;
+ } else if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromAdobeRgb()) {
+ qCDebug(lcIcc) << "fromIccProfile: Adobe RGB primaries detected";
+ colorspaceDPtr->primaries = QColorSpace::Primaries::AdobeRgb;
+ } else if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromDciP3D65()) {
+ qCDebug(lcIcc) << "fromIccProfile: DCI-P3 D65 primaries detected";
+ colorspaceDPtr->primaries = QColorSpace::Primaries::DciP3D65;
+ }
+ if (colorspaceDPtr->toXyz == QColorMatrix::toXyzFromProPhotoRgb()) {
+ qCDebug(lcIcc) << "fromIccProfile: ProPhoto RGB primaries detected";
+ colorspaceDPtr->primaries = QColorSpace::Primaries::ProPhotoRgb;
+ }
+ // Reset the matrix to our canonical values:
+ if (colorspaceDPtr->primaries != QColorSpace::Primaries::Custom)
+ colorspaceDPtr->setToXyzMatrix();
+
+ // Parse TRC tags
+ TagEntry rTrc;
+ TagEntry gTrc;
+ TagEntry bTrc;
+ if (tagIndex.contains(Tag::aarg) && tagIndex.contains(Tag::aagg) && tagIndex.contains(Tag::aabg)) {
+ // Apple extension for parametric version of TRCs in ICCv2:
+ rTrc = tagIndex[Tag::aarg];
+ gTrc = tagIndex[Tag::aagg];
+ bTrc = tagIndex[Tag::aabg];
+ } else {
+ rTrc = tagIndex[Tag::rTRC];
+ gTrc = tagIndex[Tag::gTRC];
+ bTrc = tagIndex[Tag::bTRC];
+ }
+
+ QColorTrc rCurve;
+ QColorTrc gCurve;
+ QColorTrc bCurve;
+ if (!parseTRC(data, rTrc, rCurve)) {
+ qCWarning(lcIcc) << "fromIccProfile: Invalid rTRC";
+ return false;
+ }
+ if (!parseTRC(data, gTrc, gCurve)) {
+ qCWarning(lcIcc) << "fromIccProfile: Invalid gTRC";
+ return false;
+ }
+ if (!parseTRC(data, bTrc, bCurve)) {
+ qCWarning(lcIcc) << "fromIccProfile: Invalid bTRC";
+ return false;
+ }
+ if (rCurve == gCurve && gCurve == bCurve && rCurve.m_type == QColorTrc::Type::Function) {
+ if (rCurve.m_fun.isLinear()) {
+ qCDebug(lcIcc) << "fromIccProfile: Linear gamma detected";
+ colorspaceDPtr->trc[0] = QColorTransferFunction();
+ colorspaceDPtr->transferFunction = QColorSpace::TransferFunction::Linear;
+ colorspaceDPtr->gamma = 1.0f;
+ } else if (rCurve.m_fun.isGamma()) {
+ qCDebug(lcIcc) << "fromIccProfile: Simple gamma detected";
+ colorspaceDPtr->trc[0] = QColorTransferFunction::fromGamma(rCurve.m_fun.m_g);
+ colorspaceDPtr->transferFunction = QColorSpace::TransferFunction::Gamma;
+ colorspaceDPtr->gamma = rCurve.m_fun.m_g;
+ } else if (rCurve.m_fun.isSRgb()) {
+ qCDebug(lcIcc) << "fromIccProfile: sRGB gamma detected";
+ colorspaceDPtr->trc[0] = QColorTransferFunction::fromSRgb();
+ colorspaceDPtr->transferFunction = QColorSpace::TransferFunction::SRgb;
+ } else {
+ colorspaceDPtr->trc[0] = rCurve;
+ colorspaceDPtr->transferFunction = QColorSpace::TransferFunction::Custom;
+ }
+
+ colorspaceDPtr->trc[1] = colorspaceDPtr->trc[0];
+ colorspaceDPtr->trc[2] = colorspaceDPtr->trc[0];
+ } else {
+ colorspaceDPtr->trc[0] = rCurve;
+ colorspaceDPtr->trc[1] = gCurve;
+ colorspaceDPtr->trc[2] = bCurve;
+ colorspaceDPtr->transferFunction = QColorSpace::TransferFunction::Custom;
+ }
+
+ if (tagIndex.contains(Tag::desc)) {
+ if (!parseDesc(data, tagIndex[Tag::desc], colorspaceDPtr->description))
+ qCWarning(lcIcc) << "fromIccProfile: Failed to parse description";
+ else
+ qCDebug(lcIcc) << "fromIccProfile: Description" << colorspaceDPtr->description;
+ }
+
+ colorspaceDPtr->identifyColorSpace();
+ if (colorspaceDPtr->namedColorSpace)
+ qCDebug(lcIcc) << "fromIccProfile: Named colorspace detected: " << QColorSpace::NamedColorSpace(colorspaceDPtr->namedColorSpace);
+
+ colorspaceDPtr->iccProfile = data;
+
+ return true;
+}
+
+} // namespace QIcc
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/mirclient/qmirclientappstatecontroller.h b/src/gui/painting/qicc_p.h
index b3aa0022d9..2a4658b84b 100644
--- a/src/plugins/platforms/mirclient/qmirclientappstatecontroller.h
+++ b/src/gui/painting/qicc_p.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,26 +37,34 @@
**
****************************************************************************/
+#ifndef QICC_P_H
+#define QICC_P_H
-#ifndef QMIRCLIENTAPPSTATECONTROLLER_H
-#define QMIRCLIENTAPPSTATECONTROLLER_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 <QTimer>
+#include <QtCore/qbytearray.h>
+#include <QtGui/qtguiglobal.h>
-class QMirClientAppStateController
-{
-public:
- QMirClientAppStateController();
+QT_BEGIN_NAMESPACE
- void setSuspended();
- void setResumed();
+class QColorSpace;
- void setWindowFocused(bool focused);
+namespace QIcc {
-private:
- bool m_suspended;
- bool m_lastActive;
- QTimer m_inactiveTimer;
-};
+bool fromIccProfile(const QByteArray &data, QColorSpace *colorSpace);
+QByteArray toIccProfile(const QColorSpace &space);
-#endif // QMIRCLIENTAPPSTATECONTROLLER_H
+}
+
+QT_END_NAMESPACE
+
+#endif // QICC_P_H
diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp
index 8a5274bd37..0d7205b483 100644
--- a/src/gui/painting/qimagescale.cpp
+++ b/src/gui/painting/qimagescale.cpp
@@ -528,6 +528,7 @@ static void qt_qimageScaleAARGBA_down_xy(QImageScaleInfo *isi, unsigned int *des
}
}
+#if QT_CONFIG(raster_64bit)
static void qt_qimageScaleRgba64_up_x_down_y(QImageScaleInfo *isi, QRgba64 *dest,
int dw, int dh, int dow, int sow);
@@ -728,6 +729,7 @@ static void qt_qimageScaleRgba64_down_xy(QImageScaleInfo *isi, QRgba64 *dest,
}
}
}
+#endif
static void qt_qimageScaleAARGB_up_x_down_y(QImageScaleInfo *isi, unsigned int *dest,
int dw, int dh, int dow, int sow);
@@ -945,10 +947,13 @@ QImage qSmoothScaleImage(const QImage &src, int dw, int dh)
return QImage();
}
+#if QT_CONFIG(raster_64bit)
if (src.depth() > 32)
qt_qimageScaleRgba64(scaleinfo, (QRgba64 *)buffer.scanLine(0),
dw, dh, dw, src.bytesPerLine() / 8);
- else if (src.hasAlphaChannel())
+ else
+#endif
+ if (src.hasAlphaChannel())
qt_qimageScaleAARGBA(scaleinfo, (unsigned int *)buffer.scanLine(0),
dw, dh, dw, src.bytesPerLine() / 4);
else
diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp
index 24b33243da..b1f01332b6 100644
--- a/src/gui/painting/qmatrix.cpp
+++ b/src/gui/painting/qmatrix.cpp
@@ -248,7 +248,7 @@ QMatrix::QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy)
/*!
Constructs a matrix that is a copy of the given \a matrix.
*/
-QMatrix::QMatrix(const QMatrix &matrix) Q_DECL_NOTHROW
+QMatrix::QMatrix(const QMatrix &matrix) noexcept
: _m11(matrix._m11)
, _m12(matrix._m12)
, _m21(matrix._m21)
@@ -989,7 +989,7 @@ bool QMatrix::operator==(const QMatrix &m) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QMatrix &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QMatrix &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.m11());
@@ -1068,7 +1068,7 @@ QMatrix QMatrix::operator *(const QMatrix &m) const
/*!
Assigns the given \a matrix's values to this matrix.
*/
-QMatrix &QMatrix::operator=(const QMatrix &matrix) Q_DECL_NOTHROW
+QMatrix &QMatrix::operator=(const QMatrix &matrix) noexcept
{
_m11 = matrix._m11;
_m12 = matrix._m12;
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index d8a4fcfb1c..a167260ade 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -64,12 +64,12 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// ### Qt 6: remove; the compiler-generated ones are fine!
- QMatrix &operator=(QMatrix &&other) Q_DECL_NOTHROW // = default
+ QMatrix &operator=(QMatrix &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); return *this; }
- QMatrix &operator=(const QMatrix &) Q_DECL_NOTHROW; // = default
- QMatrix(QMatrix &&other) Q_DECL_NOTHROW // = default
+ QMatrix &operator=(const QMatrix &) noexcept; // = default
+ QMatrix(QMatrix &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); }
- QMatrix(const QMatrix &other) Q_DECL_NOTHROW; // = default
+ QMatrix(const QMatrix &other) noexcept; // = default
#endif
void setMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
@@ -140,7 +140,7 @@ private:
};
Q_DECLARE_TYPEINFO(QMatrix, Q_MOVABLE_TYPE);
-Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QMatrix &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QMatrix &key, uint seed = 0) noexcept;
// mathematical semantics
inline QPoint operator*(const QPoint &p, const QMatrix &m)
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index b2d02182c3..2074f98069 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -42,6 +42,7 @@
#include "qbezier_p.h"
#include "qmath.h"
#include "qpainterpath_p.h"
+#include "qscopedvaluerollback.h"
#include <stdlib.h>
@@ -354,7 +355,7 @@ void QOutlineMapper::clipElements(const QPointF *elements,
// instead of going through convenience functionallity, but since
// this part of code hardly every used, it shouldn't matter.
- m_in_clip_elements = true;
+ QScopedValueRollback<bool> in_clip_elements(m_in_clip_elements, true);
QPainterPath path;
@@ -397,8 +398,6 @@ void QOutlineMapper::clipElements(const QPointF *elements,
convertPath(clippedPath);
m_transform = oldTransform;
}
-
- m_in_clip_elements = false;
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h
index 71999fbdee..04a68797c2 100644
--- a/src/gui/painting/qoutlinemapper_p.h
+++ b/src/gui/painting/qoutlinemapper_p.h
@@ -180,13 +180,13 @@ public:
QT_FT_Outline *outline() {
if (m_valid)
return &m_outline;
- return 0;
+ return nullptr;
}
QT_FT_Outline *convertPath(const QPainterPath &path);
QT_FT_Outline *convertPath(const QVectorPath &path);
- inline QPainterPath::ElementType *elementTypes() const { return m_element_types.size() == 0 ? 0 : m_element_types.data(); }
+ inline QPainterPath::ElementType *elementTypes() const { return m_element_types.size() == 0 ? nullptr : m_element_types.data(); }
public:
QDataBuffer<QPainterPath::ElementType> m_element_types;
diff --git a/src/gui/painting/qpagedpaintdevice.cpp b/src/gui/painting/qpagedpaintdevice.cpp
index 0c2123f9a6..3fdd0206b7 100644
--- a/src/gui/painting/qpagedpaintdevice.cpp
+++ b/src/gui/painting/qpagedpaintdevice.cpp
@@ -42,6 +42,7 @@
QT_BEGIN_NAMESPACE
+// ### Qt 6: remove when the deprecated constructor is removed
class QDummyPagedPaintDevicePrivate : public QPagedPaintDevicePrivate
{
bool setPageLayout(const QPageLayout &newPageLayout) override
diff --git a/src/gui/painting/qpagedpaintdevice.h b/src/gui/painting/qpagedpaintdevice.h
index 1c37c17fa3..21e23e0eb4 100644
--- a/src/gui/painting/qpagedpaintdevice.h
+++ b/src/gui/painting/qpagedpaintdevice.h
@@ -213,6 +213,7 @@ public:
Envelope10 = Comm10E
};
+ // keep in sync with QPdfEngine::PdfVersion!
enum PdfVersion { PdfVersion_1_4, PdfVersion_A1b, PdfVersion_1_6 };
// ### Qt6 Make these virtual
diff --git a/src/gui/painting/qpagelayout.h b/src/gui/painting/qpagelayout.h
index b41689d33b..7ee0ce7a76 100644
--- a/src/gui/painting/qpagelayout.h
+++ b/src/gui/painting/qpagelayout.h
@@ -82,13 +82,11 @@ public:
const QMarginsF &margins, Unit units = Point,
const QMarginsF &minMargins = QMarginsF(0, 0, 0, 0));
QPageLayout(const QPageLayout &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QPageLayout &operator=(QPageLayout &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QPageLayout &operator=(QPageLayout &&other) noexcept { swap(other); return *this; }
QPageLayout &operator=(const QPageLayout &other);
~QPageLayout();
- void swap(QPageLayout &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QPageLayout &other) noexcept { qSwap(d, other.d); }
friend Q_GUI_EXPORT bool operator==(const QPageLayout &lhs, const QPageLayout &rhs);
bool isEquivalentTo(const QPageLayout &other) const;
diff --git a/src/gui/painting/qpagesize.cpp b/src/gui/painting/qpagesize.cpp
index a1c9f6e417..c98ca8a1fb 100644
--- a/src/gui/painting/qpagesize.cpp
+++ b/src/gui/painting/qpagesize.cpp
@@ -222,8 +222,6 @@ static const int qt_windowsConversion[][2] = {
{DMPAPER_PENV_10_ROTATED, DMPAPER_PENV_10} // Is = DMPAPER_LAST, use as loop terminator
};
-static const int windowsConversionCount = int(sizeof(qt_windowsConversion) / sizeof(qt_windowsConversion[0]));
-
// Standard sizes data
struct StandardPageSize {
QPageSize::PageSizeId id;
@@ -423,9 +421,9 @@ static QPageSize::PageSizeId qt_idForWindowsID(int windowsId, QSize *match = 0)
if (windowsId <= DMPAPER_NONE || windowsId > DMPAPER_LAST)
return QPageSize::Custom;
// Check if one of the unsupported values, convert to valid value if is
- for (int i = 0; i < windowsConversionCount; ++i) {
- if (qt_windowsConversion[i][0] == windowsId) {
- windowsId = qt_windowsConversion[i][1];
+ for (const auto &it : qt_windowsConversion) {
+ if (it[0] == windowsId) {
+ windowsId = it[1];
break;
}
}
diff --git a/src/gui/painting/qpagesize.h b/src/gui/painting/qpagesize.h
index 82054824b4..133274760f 100644
--- a/src/gui/painting/qpagesize.h
+++ b/src/gui/painting/qpagesize.h
@@ -236,14 +236,12 @@ public:
const QString &name = QString(),
SizeMatchPolicy matchPolicy = FuzzyMatch);
QPageSize(const QPageSize &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QPageSize &operator=(QPageSize &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QPageSize &operator=(QPageSize &&other) noexcept { swap(other); return *this; }
QPageSize &operator=(const QPageSize &other);
~QPageSize();
- void swap(QPageSize &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QPageSize &other) noexcept { qSwap(d, other.d); }
friend Q_GUI_EXPORT bool operator==(const QPageSize &lhs, const QPageSize &rhs);
bool isEquivalentTo(const QPageSize &other) const;
diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp
index faaa316085..0ddfba6ee9 100644
--- a/src/gui/painting/qpaintdevice.cpp
+++ b/src/gui/painting/qpaintdevice.cpp
@@ -41,7 +41,7 @@
QT_BEGIN_NAMESPACE
-QPaintDevice::QPaintDevice() Q_DECL_NOEXCEPT
+QPaintDevice::QPaintDevice() noexcept
{
reserved = 0;
painters = 0;
diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h
index 9458b4ba9a..5f8dad205d 100644
--- a/src/gui/painting/qpaintdevice.h
+++ b/src/gui/painting/qpaintdevice.h
@@ -90,7 +90,7 @@ public:
static inline qreal devicePixelRatioFScale() { return 0x10000; }
protected:
- QPaintDevice() Q_DECL_NOEXCEPT;
+ QPaintDevice() noexcept;
virtual int metric(PaintDeviceMetric metric) const;
virtual void initPainter(QPainter *painter) const;
virtual QPaintDevice *redirected(QPoint *offset) const;
diff --git a/src/gui/painting/qpaintengine_p.h b/src/gui/painting/qpaintengine_p.h
index 8ac3fcff5c..40b9474165 100644
--- a/src/gui/painting/qpaintengine_p.h
+++ b/src/gui/painting/qpaintengine_p.h
@@ -65,7 +65,7 @@ class Q_GUI_EXPORT QPaintEnginePrivate
{
Q_DECLARE_PUBLIC(QPaintEngine)
public:
- QPaintEnginePrivate() : pdev(0), q_ptr(0), currentClipDevice(0), hasSystemTransform(0),
+ QPaintEnginePrivate() : pdev(nullptr), q_ptr(nullptr), currentClipDevice(nullptr), hasSystemTransform(0),
hasSystemViewport(0) {}
virtual ~QPaintEnginePrivate();
@@ -138,8 +138,8 @@ public:
static QPaintEnginePrivate *get(QPaintEngine *paintEngine) { return paintEngine->d_func(); }
- virtual QPaintEngine *aggregateEngine() { return 0; }
- virtual Qt::HANDLE nativeHandle() { return 0; }
+ virtual QPaintEngine *aggregateEngine() { return nullptr; }
+ virtual Qt::HANDLE nativeHandle() { return nullptr; }
};
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 5bdf3299c9..40c822076b 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -555,35 +555,6 @@ bool QRasterPaintEngine::end()
/*!
\internal
*/
-void QRasterPaintEngine::releaseBuffer()
-{
- Q_D(QRasterPaintEngine);
- d->rasterBuffer.reset(new QRasterBuffer);
-}
-
-/*!
- \internal
-*/
-QSize QRasterPaintEngine::size() const
-{
- Q_D(const QRasterPaintEngine);
- return QSize(d->rasterBuffer->width(), d->rasterBuffer->height());
-}
-
-/*!
- \internal
-*/
-#ifndef QT_NO_DEBUG
-void QRasterPaintEngine::saveBuffer(const QString &s) const
-{
- Q_D(const QRasterPaintEngine);
- d->rasterBuffer->bufferImage().save(s, "PNG");
-}
-#endif
-
-/*!
- \internal
-*/
void QRasterPaintEngine::updateMatrix(const QTransform &matrix)
{
QRasterPaintEngineState *s = state();
@@ -871,8 +842,8 @@ void QRasterPaintEngine::updateRasterState()
const QPainter::CompositionMode mode = s->composition_mode;
s->flags.fast_text = (s->penData.type == QSpanData::Solid)
&& s->intOpacity == 256
- && (mode == QPainter::CompositionMode_Source
- || (mode == QPainter::CompositionMode_SourceOver
+ && (mode == QPainter::CompositionMode_SourceOver
+ || (mode == QPainter::CompositionMode_Source
&& s->penData.solidColor.isOpaque()));
}
@@ -927,13 +898,20 @@ void QRasterPaintEngine::renderHintsChanged()
QRasterPaintEngineState *s = state();
#ifdef QT_DEBUG_DRAW
- qDebug() << "QRasterPaintEngine::renderHintsChanged()" << hex << s->renderHints;
+ qDebug() << "QRasterPaintEngine::renderHintsChanged()" << Qt::hex << s->renderHints;
#endif
bool was_aa = s->flags.antialiased;
bool was_bilinear = s->flags.bilinear;
- s->flags.antialiased = bool(s->renderHints & (QPainter::Antialiasing | QPainter::HighQualityAntialiasing));
+ s->flags.antialiased = bool(s->renderHints & QPainter::Antialiasing);
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
+ if (s->renderHints & QPainter::HighQualityAntialiasing)
+ s->flags.antialiased = true;
+QT_WARNING_POP
+#endif
s->flags.bilinear = bool(s->renderHints & QPainter::SmoothPixmapTransform);
s->flags.legacy_rounding = !bool(s->renderHints & QPainter::Antialiasing) && bool(s->renderHints & QPainter::Qt4CompatiblePainting);
@@ -1341,7 +1319,7 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
QPaintEngineEx::clip(rect, op);
return;
- } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(rect), op)) {
+ } else if (!setClipRectInDeviceCoords(s->matrix.mapRect(QRectF(rect)).toRect(), op)) {
QPaintEngineEx::clip(rect, op);
return;
}
@@ -1774,7 +1752,7 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
QRectF rf = path.controlPointRect();
qDebug() << "QRasterPaintEngine::fill(): "
<< "size=" << path.elementCount()
- << ", hints=" << hex << path.hints()
+ << ", hints=" << Qt::hex << path.hints()
<< rf << brush;
#endif
@@ -2239,7 +2217,7 @@ void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img)
const QClipData *clip = d->clip();
QPointF pt(p.x() + s->matrix.dx(), p.y() + s->matrix.dy());
- if (d->canUseImageBlitting(d->rasterBuffer->compositionMode, img)) {
+ if (d->canUseImageBlitting(d->rasterBuffer->compositionMode, img, pt, img.rect())) {
if (!clip) {
d->blitImage(pt, img, d->deviceRect);
return;
@@ -2310,7 +2288,12 @@ namespace {
return NoRotation;
}
- inline bool isPixelAligned(const QRectF &rect) {
+ inline bool isPixelAligned(const QPointF &pt)
+ {
+ return QPointF(pt.toPoint()) == pt;
+ }
+ inline bool isPixelAligned(const QRectF &rect)
+ {
return QRectF(rect.toRect()) == rect;
}
}
@@ -2378,17 +2361,12 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
const QClipData *clip = d->clip();
- if (s->matrix.type() > QTransform::TxTranslate
+ if (s->matrix.type() == QTransform::TxRotate
&& !stretch_sr
&& (!clip || clip->hasRectClip)
&& s->intOpacity == 256
&& (d->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver
- || d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source)
- && d->rasterBuffer->format == img.format()
- && (d->rasterBuffer->format == QImage::Format_RGB16
- || d->rasterBuffer->format == QImage::Format_RGB32
- || (d->rasterBuffer->format == QImage::Format_ARGB32_Premultiplied
- && d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source)))
+ || d->rasterBuffer->compositionMode == QPainter::CompositionMode_Source))
{
RotationType rotationType = qRotationType(s->matrix);
const QPixelLayout::BPP plBpp = qPixelLayouts[d->rasterBuffer->format].bpp;
@@ -2396,9 +2374,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
if (rotationType != NoRotation && qMemRotateFunctions[plBpp][rotationType] && img.rect().contains(sr.toAlignedRect())) {
QRectF transformedTargetRect = s->matrix.mapRect(r);
- if ((!(s->renderHints & QPainter::SmoothPixmapTransform) && !(s->renderHints & QPainter::Antialiasing))
- || (isPixelAligned(transformedTargetRect) && isPixelAligned(sr)))
- {
+ if (d->canUseImageBlitting(d->rasterBuffer->compositionMode, img, transformedTargetRect.topRight(), sr)) {
QRect clippedTransformedTargetRect = transformedTargetRect.toRect().intersected(clip ? clip->clipRect : d->deviceRect);
if (clippedTransformedTargetRect.isNull())
return;
@@ -2532,8 +2508,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
fillPath(path, &d->image_filler_xform);
s->matrix = m;
} else {
- if (d->canUseImageBlitting(d->rasterBuffer->compositionMode, img)) {
- QPointF pt(r.x() + s->matrix.dx(), r.y() + s->matrix.dy());
+ QPointF pt(r.x() + s->matrix.dx(), r.y() + s->matrix.dy());
+ if (d->canUseImageBlitting(d->rasterBuffer->compositionMode, img, pt, sr)) {
if (!clip) {
d->blitImage(pt, img, d->deviceRect, sr.toRect());
return;
@@ -2544,7 +2520,6 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
} else if (d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) {
SrcOverBlendFunc func = qBlendFunctions[d->rasterBuffer->format][img.format()];
if (func) {
- QPointF pt(r.x() + s->matrix.dx(), r.y() + s->matrix.dy());
if (!clip) {
d->drawImage(pt, img, func, d->deviceRect, s->intOpacity, sr.toRect());
return;
@@ -3779,12 +3754,22 @@ bool QRasterPaintEnginePrivate::canUseFastImageBlending(QPainter::CompositionMod
&& !image.hasAlphaChannel()));
}
-bool QRasterPaintEnginePrivate::canUseImageBlitting(QPainter::CompositionMode mode, const QImage &image) const
+bool QRasterPaintEnginePrivate::canUseImageBlitting(QPainter::CompositionMode mode, const QImage &image, const QPointF &pt, const QRectF &sr) const
{
Q_Q(const QRasterPaintEngine);
+
+ if (!(mode == QPainter::CompositionMode_Source
+ || (mode == QPainter::CompositionMode_SourceOver
+ && !image.hasAlphaChannel())))
+ return false;
+
const QRasterPaintEngineState *s = q->state();
+ Q_ASSERT(s->matrix.type() <= QTransform::TxTranslate || s->matrix.type() == QTransform::TxRotate);
- if (!s->flags.fast_images || s->intOpacity != 256 || qt_depthForFormat(rasterBuffer->format) < 8)
+ if (s->intOpacity != 256
+ || image.depth() < 8
+ || ((s->renderHints & (QPainter::SmoothPixmapTransform | QPainter::Antialiasing))
+ && (!isPixelAligned(pt) || !isPixelAligned(sr))))
return false;
QImage::Format dFormat = rasterBuffer->format;
@@ -3792,18 +3777,13 @@ bool QRasterPaintEnginePrivate::canUseImageBlitting(QPainter::CompositionMode mo
// Formats must match or source format must be a subset of destination format
if (dFormat != sFormat && image.pixelFormat().alphaUsage() == QPixelFormat::IgnoresAlpha) {
if ((sFormat == QImage::Format_RGB32 && dFormat == QImage::Format_ARGB32)
- || (sFormat == QImage::Format_RGBX8888 && dFormat == QImage::Format_RGBA8888))
+ || (sFormat == QImage::Format_RGBX8888 && dFormat == QImage::Format_RGBA8888)
+ || (sFormat == QImage::Format_RGBX64 && dFormat == QImage::Format_RGBA64))
sFormat = dFormat;
else
sFormat = qt_maybeAlphaVersionWithSameDepth(sFormat); // this returns premul formats
}
- if (dFormat != sFormat)
- return false;
-
- return s->matrix.type() <= QTransform::TxTranslate
- && (mode == QPainter::CompositionMode_Source
- || (mode == QPainter::CompositionMode_SourceOver
- && !image.hasAlphaChannel()));
+ return (dFormat == sFormat);
}
QImage QRasterBuffer::colorizeBitmap(const QImage &image, const QColor &color)
@@ -3860,11 +3840,6 @@ QImage::Format QRasterBuffer::prepare(QImage *image)
return format;
}
-void QRasterBuffer::resetBuffer(int val)
-{
- memset(m_buffer, val, m_height*bytes_per_line);
-}
-
QClipData::QClipData(int height)
{
clipSpanHeight = height;
@@ -4291,55 +4266,13 @@ static void qt_span_clip(int count, const QSpan *spans, void *userData)
}
}
-#ifndef QT_NO_DEBUG
-QImage QRasterBuffer::bufferImage() const
-{
- QImage image(m_width, m_height, QImage::Format_ARGB32_Premultiplied);
-
- for (int y = 0; y < m_height; ++y) {
- uint *span = (uint *)const_cast<QRasterBuffer *>(this)->scanLine(y);
-
- for (int x=0; x<m_width; ++x) {
- uint argb = span[x];
- image.setPixel(x, y, argb);
- }
- }
- return image;
-}
-#endif
-
-
-void QRasterBuffer::flushToARGBImage(QImage *target) const
-{
- int w = qMin(m_width, target->width());
- int h = qMin(m_height, target->height());
-
- for (int y=0; y<h; ++y) {
- uint *sourceLine = (uint *)const_cast<QRasterBuffer *>(this)->scanLine(y);
- QRgb *dest = (QRgb *) target->scanLine(y);
- for (int x=0; x<w; ++x) {
- QRgb pixel = sourceLine[x];
- int alpha = qAlpha(pixel);
- if (!alpha) {
- dest[x] = 0;
- } else {
- dest[x] = (alpha << 24)
- | ((255*qRed(pixel)/alpha) << 16)
- | ((255*qGreen(pixel)/alpha) << 8)
- | ((255*qBlue(pixel)/alpha) << 0);
- }
- }
- }
-}
-
-
class QGradientCache
{
public:
struct CacheInfo : QSpanData::Pinnable
{
inline CacheInfo(QGradientStops s, int op, QGradient::InterpolationMode mode) :
- stops(qMove(s)), opacity(op), interpolationMode(mode) {}
+ stops(std::move(s)), opacity(op), interpolationMode(mode) {}
QRgba64 buffer64[GRADIENT_STOPTABLE_SIZE];
QRgb buffer32[GRADIENT_STOPTABLE_SIZE];
QGradientStops stops;
@@ -4382,7 +4315,7 @@ protected:
QSharedPointer<const CacheInfo> addCacheElement(quint64 hash_val, const QGradient &gradient, int opacity) {
if (cache.size() == maxCacheSize()) {
// may remove more than 1, but OK
- cache.erase(cache.begin() + QRandomGenerator::global()->bounded(maxCacheSize()));
+ cache.erase(std::next(cache.begin(), QRandomGenerator::global()->bounded(maxCacheSize())));
}
auto cache_entry = QSharedPointer<CacheInfo>::create(gradient.stops(), opacity, gradient.interpolationMode());
generateGradientColorTable(gradient, cache_entry->buffer64, paletteSize(), opacity);
@@ -4626,7 +4559,9 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
auto cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
gradient.colorTable32 = cacheInfo->buffer32;
+#if QT_CONFIG(raster_64bit)
gradient.colorTable64 = cacheInfo->buffer64;
+#endif
cachedGradient = std::move(cacheInfo);
gradient.spread = g->spread();
@@ -4648,7 +4583,9 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
auto cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
gradient.colorTable32 = cacheInfo->buffer32;
+#if QT_CONFIG(raster_64bit)
gradient.colorTable64 = cacheInfo->buffer64;
+#endif
cachedGradient = std::move(cacheInfo);
gradient.spread = g->spread();
@@ -4674,7 +4611,9 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
auto cacheInfo = qt_gradient_cache()->getBuffer(*g, alpha);
gradient.colorTable32 = cacheInfo->buffer32;
+#if QT_CONFIG(raster_64bit)
gradient.colorTable64 = cacheInfo->buffer64;
+#endif
cachedGradient = std::move(cacheInfo);
gradient.spread = QGradient::RepeatSpread;
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h
index 5d527207a4..089aadc3f7 100644
--- a/src/gui/painting/qpaintengine_raster_p.h
+++ b/src/gui/painting/qpaintengine_raster_p.h
@@ -208,15 +208,6 @@ public:
ClipType clipType() const;
QRect clipBoundingRect() const;
- void releaseBuffer();
-
- QSize size() const;
-
-#ifndef QT_NO_DEBUG
- void saveBuffer(const QString &s) const;
-#endif
-
-
#ifdef Q_OS_WIN
void setDC(HDC hdc);
HDC getDC() const;
@@ -315,7 +306,7 @@ public:
void recalculateFastImages();
bool canUseFastImageBlending(QPainter::CompositionMode mode, const QImage &image) const;
- bool canUseImageBlitting(QPainter::CompositionMode mode, const QImage &image) const;
+ bool canUseImageBlitting(QPainter::CompositionMode mode, const QImage &image, const QPointF &pt, const QRectF &sr) const;
QPaintDevice *device;
QScopedPointer<QOutlineMapper> outlineMapper;
@@ -435,27 +426,16 @@ inline void QClipData::appendSpans(const QSpan *s, int num)
class QRasterBuffer
{
public:
- QRasterBuffer() : m_width(0), m_height(0), m_buffer(0) { init(); }
+ QRasterBuffer() : m_width(0), m_height(0), m_buffer(nullptr) { init(); }
~QRasterBuffer();
void init();
QImage::Format prepare(QImage *image);
- QImage::Format prepare(QPixmap *pix);
- void prepare(int w, int h);
- void prepareBuffer(int w, int h);
-
- void resetBuffer(int val=0);
uchar *scanLine(int y) { Q_ASSERT(y>=0); Q_ASSERT(y<m_height); return m_buffer + y * qsizetype(bytes_per_line); }
-#ifndef QT_NO_DEBUG
- QImage bufferImage() const;
-#endif
-
- void flushToARGBImage(QImage *image) const;
-
int width() const { return m_width; }
int height() const { return m_height; }
int bytesPerLine() const { return bytes_per_line; }
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 22d3fb3001..8314e8bc8a 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -140,7 +140,7 @@ QDebug Q_GUI_EXPORT &operator<<(QDebug &s, const QVectorPath &path)
QDebugStateSaver saver(s);
QRectF rf = path.controlPointRect();
s << "QVectorPath(size:" << path.elementCount()
- << " hints:" << hex << path.hints()
+ << " hints:" << Qt::hex << path.hints()
<< rf << ')';
return s;
}
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index f9e9563f10..3ce54c20be 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -283,7 +283,7 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev)
Q_ASSERT(q->d_ptr->state);
// Now initialize the painter with correct widget properties.
- q->initFrom(pdev);
+ q->d_ptr->initFrom(pdev);
QPoint offset;
pdev->redirected(&offset);
offset += q->d_ptr->engine->coordinateOffset();
@@ -1560,22 +1560,28 @@ void QPainter::initFrom(const QPaintDevice *device)
{
Q_ASSERT_X(device, "QPainter::initFrom(const QPaintDevice *device)", "QPaintDevice cannot be 0");
Q_D(QPainter);
- if (!d->engine) {
+ d->initFrom(device);
+}
+#endif
+
+void QPainterPrivate::initFrom(const QPaintDevice *device)
+{
+ if (!engine) {
qWarning("QPainter::initFrom: Painter not active, aborted");
return;
}
- device->initPainter(this);
+ Q_Q(QPainter);
+ device->initPainter(q);
- if (d->extended) {
- d->extended->penChanged();
- } else if (d->engine) {
- d->engine->setDirty(QPaintEngine::DirtyPen);
- d->engine->setDirty(QPaintEngine::DirtyBrush);
- d->engine->setDirty(QPaintEngine::DirtyFont);
+ if (extended) {
+ extended->penChanged();
+ } else if (engine) {
+ engine->setDirty(QPaintEngine::DirtyPen);
+ engine->setDirty(QPaintEngine::DirtyBrush);
+ engine->setDirty(QPaintEngine::DirtyFont);
}
}
-#endif
/*!
Saves the current painter state (pushes the state onto a stack). A
@@ -1843,7 +1849,7 @@ bool QPainter::begin(QPaintDevice *pd)
// Copy painter properties from original paint device,
// required for QPixmap::grabWidget()
if (d->original_device->devType() == QInternal::Widget) {
- initFrom(d->original_device);
+ d->initFrom(d->original_device);
} else {
d->state->layoutDirection = Qt::LayoutDirectionAuto;
// make sure we have a font compatible with the paintdevice
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 843f24e3e1..3394da63c7 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -89,8 +89,10 @@ public:
Antialiasing = 0x01,
TextAntialiasing = 0x02,
SmoothPixmapTransform = 0x04,
- HighQualityAntialiasing = 0x08,
- NonCosmeticDefaultPen = 0x10,
+#if QT_DEPRECATED_SINCE(5, 14)
+ HighQualityAntialiasing Q_DECL_ENUMERATOR_DEPRECATED_X("Use Antialiasing instead") = 0x08,
+ NonCosmeticDefaultPen Q_DECL_ENUMERATOR_DEPRECATED_X("Default pen is non-cosmetic now") = 0x10,
+#endif
Qt4CompatiblePainting = 0x20,
LosslessImageRendering = 0x40,
};
diff --git a/src/gui/painting/qpainter_p.h b/src/gui/painting/qpainter_p.h
index 930180e9fa..29d4880eb9 100644
--- a/src/gui/painting/qpainter_p.h
+++ b/src/gui/painting/qpainter_p.h
@@ -54,6 +54,8 @@
#include <QtCore/qvarlengtharray.h>
#include <QtGui/private/qtguiglobal_p.h>
#include "QtGui/qbrush.h"
+#include "QtGui/qcolorspace.h"
+#include "QtGui/qcolortransform.h"
#include "QtGui/qfont.h"
#include "QtGui/qpen.h"
#include "QtGui/qregion.h"
@@ -191,9 +193,9 @@ class QPainterPrivate
Q_DECLARE_PUBLIC(QPainter)
public:
QPainterPrivate(QPainter *painter)
- : q_ptr(painter), d_ptrs(0), state(0), dummyState(0), txinv(0), inDestructor(false), d_ptrs_size(0),
- refcount(1), device(0), original_device(0), helper_device(0), engine(0), emulationEngine(0),
- extended(0)
+ : q_ptr(painter), d_ptrs(nullptr), state(nullptr), dummyState(nullptr), txinv(0), inDestructor(false), d_ptrs_size(0),
+ refcount(1), device(nullptr), original_device(nullptr), helper_device(nullptr), engine(nullptr), emulationEngine(nullptr),
+ extended(nullptr)
{
}
@@ -254,6 +256,7 @@ public:
QTransform hidpiScaleTransform() const;
static bool attachPainterPrivate(QPainter *q, QPaintDevice *pdev);
void detachPainterPrivate(QPainter *q);
+ void initFrom(const QPaintDevice *device);
QPaintDevice *device;
QPaintDevice *original_device;
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 8516d73537..1fb37ece56 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -93,7 +93,7 @@ struct QPainterPathPrivateDeleter
{
static inline void cleanup(QPainterPathPrivate *d)
{
- // note - we must up-cast to QPainterPathData since QPainterPathPrivate
+ // note - we must downcast to QPainterPathData since QPainterPathPrivate
// has a non-virtual destructor!
if (d && !d->ref.deref())
delete static_cast<QPainterPathData *>(d);
@@ -545,7 +545,7 @@ void QPainterPath::setElementPositionAt(int i, qreal x, qreal y)
/*!
Constructs an empty QPainterPath object.
*/
-QPainterPath::QPainterPath() Q_DECL_NOEXCEPT
+QPainterPath::QPainterPath() noexcept
: d_ptr(0)
{
}
@@ -578,7 +578,7 @@ QPainterPath::QPainterPath(const QPointF &startPoint)
void QPainterPath::detach()
{
- if (d_ptr->ref.load() != 1)
+ if (d_ptr->ref.loadRelaxed() != 1)
detach_helper();
setDirty(true);
}
@@ -1855,10 +1855,9 @@ 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, depth + 1);
- qt_painterpath_isect_curve(second_half, pt, winding, depth + 1);
+ const auto halves = bezier.split();
+ qt_painterpath_isect_curve(halves.first, pt, winding, depth + 1);
+ qt_painterpath_isect_curve(halves.second, pt, winding, depth + 1);
}
}
@@ -2013,10 +2012,9 @@ static bool qt_isect_curve_horizontal(const QBezier &bezier, qreal y, qreal x1,
if (depth == 32 || (bounds.width() < lower_bound && bounds.height() < lower_bound))
return true;
- QBezier first_half, second_half;
- bezier.split(&first_half, &second_half);
- if (qt_isect_curve_horizontal(first_half, y, x1, x2, depth + 1)
- || qt_isect_curve_horizontal(second_half, y, x1, x2, depth + 1))
+ const auto halves = bezier.split();
+ if (qt_isect_curve_horizontal(halves.first, y, x1, x2, depth + 1)
+ || qt_isect_curve_horizontal(halves.second, y, x1, x2, depth + 1))
return true;
}
return false;
@@ -2032,10 +2030,9 @@ static bool qt_isect_curve_vertical(const QBezier &bezier, qreal x, qreal y1, qr
if (depth == 32 || (bounds.width() < lower_bound && bounds.height() < lower_bound))
return true;
- QBezier first_half, second_half;
- bezier.split(&first_half, &second_half);
- if (qt_isect_curve_vertical(first_half, x, y1, y2, depth + 1)
- || qt_isect_curve_vertical(second_half, x, y1, y2, depth + 1))
+ const auto halves = bezier.split();
+ if (qt_isect_curve_vertical(halves.first, x, y1, y2, depth + 1)
+ || qt_isect_curve_vertical(halves.second, x, y1, y2, depth + 1))
return true;
}
return false;
@@ -3520,8 +3517,7 @@ void QPainterPath::setDirty(bool dirty)
{
d_func()->dirtyBounds = dirty;
d_func()->dirtyControlBounds = dirty;
- delete d_func()->pathConverter;
- d_func()->pathConverter = 0;
+ d_func()->pathConverter.reset();
d_func()->convex = false;
}
@@ -3597,10 +3593,10 @@ void QPainterPath::computeControlPointRect() const
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug s, const QPainterPath &p)
{
- s.nospace() << "QPainterPath: Element count=" << p.elementCount() << endl;
+ s.nospace() << "QPainterPath: Element count=" << p.elementCount() << Qt::endl;
const char *types[] = {"MoveTo", "LineTo", "CurveTo", "CurveToData"};
for (int i=0; i<p.elementCount(); ++i) {
- s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << endl;
+ s.nospace() << " -> " << types[p.elementAt(i).type] << "(x=" << p.elementAt(i).x << ", y=" << p.elementAt(i).y << ')' << Qt::endl;
}
return s;
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h
index a69a192767..ed5be667b7 100644
--- a/src/gui/painting/qpainterpath.h
+++ b/src/gui/painting/qpainterpath.h
@@ -88,17 +88,15 @@ public:
inline bool operator!=(const Element &e) const { return !operator==(e); }
};
- QPainterPath() Q_DECL_NOEXCEPT;
+ QPainterPath() noexcept;
explicit QPainterPath(const QPointF &startPoint);
QPainterPath(const QPainterPath &other);
QPainterPath &operator=(const QPainterPath &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QPainterPath &operator=(QPainterPath &&other) Q_DECL_NOEXCEPT
+ inline QPainterPath &operator=(QPainterPath &&other) noexcept
{ qSwap(d_ptr, other.d_ptr); return *this; }
-#endif
~QPainterPath();
- inline void swap(QPainterPath &other) Q_DECL_NOEXCEPT { d_ptr.swap(other.d_ptr); }
+ inline void swap(QPainterPath &other) noexcept { d_ptr.swap(other.d_ptr); }
void clear();
void reserve(int size);
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index 567f155210..a420e0b3d9 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -62,8 +62,11 @@
#include <private/qvectorpath_p.h>
#include <private/qstroker_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
+// ### Qt 6: merge with QPainterPathData
class QPainterPathPrivate
{
public:
@@ -80,7 +83,19 @@ public:
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &);
#endif
- QPainterPathPrivate() : ref(1) {}
+ QPainterPathPrivate() noexcept
+ : ref(1)
+ {
+ }
+
+ QPainterPathPrivate(const QPainterPathPrivate &other) noexcept
+ : ref(1),
+ elements(other.elements)
+ {
+ }
+
+ QPainterPathPrivate &operator=(const QPainterPathPrivate &) = delete;
+ ~QPainterPathPrivate() = default;
private:
QAtomicInt ref;
@@ -166,30 +181,30 @@ public:
QPainterPathData() :
cStart(0),
fillRule(Qt::OddEvenFill),
+ require_moveTo(false),
dirtyBounds(false),
dirtyControlBounds(false),
- pathConverter(0)
+ convex(false),
+ pathConverter(nullptr)
{
- require_moveTo = false;
- convex = false;
}
QPainterPathData(const QPainterPathData &other) :
- QPainterPathPrivate(), cStart(other.cStart), fillRule(other.fillRule),
+ QPainterPathPrivate(other),
+ cStart(other.cStart),
+ fillRule(other.fillRule),
bounds(other.bounds),
controlBounds(other.controlBounds),
+ require_moveTo(false),
dirtyBounds(other.dirtyBounds),
dirtyControlBounds(other.dirtyControlBounds),
convex(other.convex),
- pathConverter(0)
+ pathConverter(nullptr)
{
- require_moveTo = false;
- elements = other.elements;
}
- ~QPainterPathData() {
- delete pathConverter;
- }
+ QPainterPathData &operator=(const QPainterPathData &) = delete;
+ ~QPainterPathData() = default;
inline bool isClosed() const;
inline void close();
@@ -198,7 +213,7 @@ public:
const QVectorPath &vectorPath() {
if (!pathConverter)
- pathConverter = new QVectorPathConverter(elements, fillRule, convex);
+ pathConverter.reset(new QVectorPathConverter(elements, fillRule, convex));
return pathConverter->path;
}
@@ -213,7 +228,7 @@ public:
uint dirtyControlBounds : 1;
uint convex : 1;
- QVectorPathConverter *pathConverter;
+ std::unique_ptr<QVectorPathConverter> pathConverter;
};
@@ -266,7 +281,7 @@ inline bool QPainterPathData::isClosed() const
inline void QPainterPathData::close()
{
- Q_ASSERT(ref.load() == 1);
+ Q_ASSERT(ref.loadRelaxed() == 1);
require_moveTo = true;
const QPainterPath::Element &first = elements.at(cStart);
QPainterPath::Element &last = elements.last();
@@ -293,7 +308,7 @@ inline void QPainterPathData::maybeMoveTo()
inline void QPainterPathData::clear()
{
- Q_ASSERT(ref.load() == 1);
+ Q_ASSERT(ref.loadRelaxed() == 1);
elements.clear();
@@ -307,8 +322,7 @@ inline void QPainterPathData::clear()
dirtyControlBounds = false;
convex = false;
- delete pathConverter;
- pathConverter = nullptr;
+ pathConverter.reset();
}
#define KAPPA qreal(0.5522847498)
diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h
index c25a479807..9444a87b71 100644
--- a/src/gui/painting/qpathclipper_p.h
+++ b/src/gui/painting/qpathclipper_p.h
@@ -82,7 +82,7 @@ public:
bool intersect();
bool contains();
- static bool pathToRect(const QPainterPath &path, QRectF *rect = 0);
+ static bool pathToRect(const QPainterPath &path, QRectF *rect = nullptr);
static QPainterPath intersect(const QPainterPath &path, const QRectF &rect);
private:
@@ -394,7 +394,7 @@ inline const QPathSegments::Intersection *QPathSegments::intersectionAt(int inde
{
const int intersection = m_segments.at(index).intersection;
if (intersection < 0)
- return 0;
+ return nullptr;
else
return &m_intersections.at(intersection);
}
@@ -428,12 +428,12 @@ inline int QWingedEdge::edgeCount() const
inline QPathEdge *QWingedEdge::edge(int edge)
{
- return edge < 0 ? 0 : &m_edges.at(edge);
+ return edge < 0 ? nullptr : &m_edges.at(edge);
}
inline const QPathEdge *QWingedEdge::edge(int edge) const
{
- return edge < 0 ? 0 : &m_edges.at(edge);
+ return edge < 0 ? nullptr : &m_edges.at(edge);
}
inline int QWingedEdge::vertexCount() const
@@ -449,12 +449,12 @@ inline int QWingedEdge::addVertex(const QPointF &p)
inline QPathVertex *QWingedEdge::vertex(int vertex)
{
- return vertex < 0 ? 0 : &m_vertices.at(vertex);
+ return vertex < 0 ? nullptr : &m_vertices.at(vertex);
}
inline const QPathVertex *QWingedEdge::vertex(int vertex) const
{
- return vertex < 0 ? 0 : &m_vertices.at(vertex);
+ return vertex < 0 ? nullptr : &m_vertices.at(vertex);
}
inline QPathEdge::Traversal QWingedEdge::flip(QPathEdge::Traversal traversal)
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 6bdc82a8e9..f560e1f0f0 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1570,12 +1570,14 @@ void QPdfEnginePrivate::writeHeader()
{
addXrefEntry(0,false);
- static const QHash<QPdfEngine::PdfVersion, const char *> mapping {
- {QPdfEngine::Version_1_4, "1.4"},
- {QPdfEngine::Version_A1b, "1.4"},
- {QPdfEngine::Version_1_6, "1.6"}
+ // Keep in sync with QPdfEngine::PdfVersion!
+ static const char mapping[][4] = {
+ "1.4", // Version_1_4
+ "1.4", // Version_A1b
+ "1.6", // Version_1_6
};
- const char *verStr = mapping.value(pdfVersion, "1.4");
+ static const size_t numMappings = sizeof mapping / sizeof *mapping;
+ const char *verStr = mapping[size_t(pdfVersion) < numMappings ? pdfVersion : 0];
xprintf("%%PDF-%s\n", verStr);
xprintf("%%\303\242\303\243\n");
@@ -1671,19 +1673,19 @@ int QPdfEnginePrivate::writeXmpMetaData()
const QDateTime now = QDateTime::currentDateTime();
const QDate date = now.date();
const QTime time = now.time();
-
- QString timeStr;
- timeStr.sprintf("%d-%02d-%02dT%02d:%02d:%02d", date.year(), date.month(), date.day(),
- time.hour(), time.minute(), time.second());
+ const QString timeStr =
+ QString::asprintf("%d-%02d-%02dT%02d:%02d:%02d",
+ date.year(), date.month(), date.day(),
+ time.hour(), time.minute(), time.second());
const int offset = now.offsetFromUtc();
const int hours = (offset / 60) / 60;
const int mins = (offset / 60) % 60;
QString tzStr;
if (offset < 0)
- tzStr.sprintf("-%02d:%02d", -hours, -mins);
+ tzStr = QString::asprintf("-%02d:%02d", -hours, -mins);
else if (offset > 0)
- tzStr.sprintf("+%02d:%02d", hours , mins);
+ tzStr = QString::asprintf("+%02d:%02d", hours , mins);
else
tzStr = QLatin1String("Z");
diff --git a/src/gui/painting/qpdf_p.h b/src/gui/painting/qpdf_p.h
index e337c61f64..89e549614a 100644
--- a/src/gui/painting/qpdf_p.h
+++ b/src/gui/painting/qpdf_p.h
@@ -168,6 +168,7 @@ class Q_GUI_EXPORT QPdfEngine : public QPaintEngine
Q_DECLARE_PRIVATE(QPdfEngine)
friend class QPdfWriter;
public:
+ // keep in sync with QPagedPaintDevice::PdfVersion and QPdfEnginePrivate::writeHeader()::mapping!
enum PdfVersion
{
Version_1_4,
diff --git a/src/gui/painting/qpdfwriter.cpp b/src/gui/painting/qpdfwriter.cpp
index 258939a763..bf7e2d3dca 100644
--- a/src/gui/painting/qpdfwriter.cpp
+++ b/src/gui/painting/qpdfwriter.cpp
@@ -170,17 +170,11 @@ void QPdfWriter::setPdfVersion(PdfVersion version)
{
Q_D(QPdfWriter);
- static const QHash<QPdfWriter::PdfVersion, QPdfEngine::PdfVersion> engineMapping {
- {QPdfWriter::PdfVersion_1_4, QPdfEngine::Version_1_4},
- {QPdfWriter::PdfVersion_A1b, QPdfEngine::Version_A1b},
- {QPdfWriter::PdfVersion_1_6, QPdfEngine::Version_1_6}
- };
-
if (d->pdfVersion == version)
return;
d->pdfVersion = version;
- d->engine->setPdfVersion(engineMapping.value(version, QPdfEngine::Version_1_4));
+ d->engine->setPdfVersion(static_cast<QPdfEngine::PdfVersion>(static_cast<int>(version)));
}
/*!
@@ -379,6 +373,9 @@ int QPdfWriter::resolution() const
*/
#endif
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
\reimp
@@ -404,6 +401,8 @@ void QPdfWriter::setPageSizeMM(const QSizeF &size)
{
setPageSize(QPageSize(size, QPageSize::Millimeter));
}
+QT_WARNING_POP
+#endif
/*!
\internal
@@ -427,6 +426,9 @@ bool QPdfWriter::newPage()
}
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
\reimp
@@ -438,6 +440,8 @@ void QPdfWriter::setMargins(const Margins &m)
{
setPageMargins(QMarginsF(m.left, m.top, m.right, m.bottom), QPageLayout::Millimeter);
}
+QT_WARNING_POP
+#endif
QT_END_NAMESPACE
diff --git a/src/gui/painting/qpdfwriter.h b/src/gui/painting/qpdfwriter.h
index b260805b2b..668081e008 100644
--- a/src/gui/painting/qpdfwriter.h
+++ b/src/gui/painting/qpdfwriter.h
@@ -86,10 +86,14 @@ public:
using QPagedPaintDevice::setPageSize;
#endif
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("Use setPageSize(QPageSize(id)) instead")
void setPageSize(PageSize size) override;
+ QT_DEPRECATED_X("Use setPageSize(QPageSize(size, QPageSize::Millimeter)) instead")
void setPageSizeMM(const QSizeF &size) override;
-
+ QT_DEPRECATED_X("Use setPageMargins(QMarginsF(l, t, r, b), QPageLayout::Millimeter) instead")
void setMargins(const Margins &m) override;
+#endif
protected:
QPaintEngine *paintEngine() const override;
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index 778c770b82..dc6e3e04d0 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -322,7 +322,7 @@ QPen::QPen(const QBrush &brush, qreal width, Qt::PenStyle s, Qt::PenCapStyle c,
Constructs a pen that is a copy of the given \a pen.
*/
-QPen::QPen(const QPen &p) Q_DECL_NOTHROW
+QPen::QPen(const QPen &p) noexcept
{
d = p.d;
if (d)
@@ -363,13 +363,13 @@ QPen::~QPen()
void QPen::detach()
{
- if (d->ref.load() == 1)
+ if (d->ref.loadRelaxed() == 1)
return;
QPenData *x = new QPenData(*static_cast<QPenData *>(d));
if (!d->ref.deref())
delete d;
- x->ref.store(1);
+ x->ref.storeRelaxed(1);
d = x;
}
@@ -381,7 +381,7 @@ void QPen::detach()
this pen.
*/
-QPen &QPen::operator=(const QPen &p) Q_DECL_NOTHROW
+QPen &QPen::operator=(const QPen &p) noexcept
{
QPen(p).swap(*this);
return *this;
@@ -885,7 +885,7 @@ bool QPen::operator==(const QPen &p) const
bool QPen::isDetached()
{
- return d->ref.load() == 1;
+ return d->ref.loadRelaxed() == 1;
}
diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h
index 03abfb3d7d..10b11d1d85 100644
--- a/src/gui/painting/qpen.h
+++ b/src/gui/painting/qpen.h
@@ -65,18 +65,16 @@ public:
QPen(const QColor &color);
QPen(const QBrush &brush, qreal width, Qt::PenStyle s = Qt::SolidLine,
Qt::PenCapStyle c = Qt::SquareCap, Qt::PenJoinStyle j = Qt::BevelJoin);
- QPen(const QPen &pen) Q_DECL_NOTHROW;
+ QPen(const QPen &pen) noexcept;
~QPen();
- QPen &operator=(const QPen &pen) Q_DECL_NOTHROW;
-#ifdef Q_COMPILER_RVALUE_REFS
- QPen(QPen &&other) Q_DECL_NOTHROW
+ QPen &operator=(const QPen &pen) noexcept;
+ QPen(QPen &&other) noexcept
: d(other.d) { other.d = nullptr; }
- QPen &operator=(QPen &&other) Q_DECL_NOTHROW
+ QPen &operator=(QPen &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- void swap(QPen &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QPen &other) noexcept { qSwap(d, other.d); }
Qt::PenStyle style() const;
void setStyle(Qt::PenStyle);
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index c71d82546a..45e90bd99b 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -338,7 +338,16 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
}
}
- if (!d_ptr->context->makeCurrent(window)) {
+ bool current = d_ptr->context->makeCurrent(window);
+
+ if (!current && !d_ptr->context->isValid()) {
+ delete d_ptr->blitter;
+ d_ptr->blitter = nullptr;
+ d_ptr->textureId = 0;
+ current = d_ptr->context->create() && d_ptr->context->makeCurrent(window);
+ }
+
+ if (!current) {
qCWarning(lcQpaBackingStore, "composeAndFlush: makeCurrent() failed");
return;
}
@@ -446,14 +455,22 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
d_ptr->blitter->setRedBlueSwizzle(false);
}
- // There is no way to tell if the OpenGL-rendered content is premultiplied or not.
- // For compatibility, assume that it is not, and use normal alpha blend always.
- if (d_ptr->premultiplied)
- funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
-
// Textures for renderToTexture widgets that have WA_AlwaysStackOnTop set.
+ bool blendIsPremultiplied = d_ptr->premultiplied;
for (int i = 0; i < textures->count(); ++i) {
- if (textures->flags(i).testFlag(QPlatformTextureList::StacksOnTop))
+ const QPlatformTextureList::Flags flags = textures->flags(i);
+ if (flags.testFlag(QPlatformTextureList::NeedsPremultipliedAlphaBlending)) {
+ if (!blendIsPremultiplied) {
+ funcs->glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
+ blendIsPremultiplied = true;
+ }
+ } else {
+ if (blendIsPremultiplied) {
+ funcs->glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
+ blendIsPremultiplied = false;
+ }
+ }
+ if (flags.testFlag(QPlatformTextureList::StacksOnTop))
blitTextureForWidget(textures, i, window, deviceWindowRect, d_ptr->blitter, offset, canUseSrgb);
}
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index de5ba964dc..4f08b0092f 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -81,11 +81,12 @@ class Q_GUI_EXPORT QPlatformTextureList : public QObject
public:
enum Flag {
StacksOnTop = 0x01,
- TextureIsSrgb = 0x02
+ TextureIsSrgb = 0x02,
+ NeedsPremultipliedAlphaBlending = 0x04
};
Q_DECLARE_FLAGS(Flags, Flag)
- explicit QPlatformTextureList(QObject *parent = 0);
+ explicit QPlatformTextureList(QObject *parent = nullptr);
~QPlatformTextureList();
int count() const;
@@ -99,7 +100,7 @@ public:
bool isLocked() const;
void appendTexture(void *source, GLuint textureId, const QRect &geometry,
- const QRect &clipRect = QRect(), Flags flags = 0);
+ const QRect &clipRect = QRect(), Flags flags = nullptr);
void clear();
Q_SIGNALS:
diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h
index 8e74a499fd..93fab55aa1 100644
--- a/src/gui/painting/qpolygon.h
+++ b/src/gui/painting/qpolygon.h
@@ -60,18 +60,14 @@ public:
inline ~QPolygon() {}
inline explicit QPolygon(int size);
inline /*implicit*/ QPolygon(const QVector<QPoint> &v) : QVector<QPoint>(v) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- /*implicit*/ QPolygon(QVector<QPoint> &&v) Q_DECL_NOTHROW : QVector<QPoint>(std::move(v)) {}
-#endif
+ /*implicit*/ QPolygon(QVector<QPoint> &&v) noexcept : QVector<QPoint>(std::move(v)) {}
QPolygon(const QRect &r, bool closed=false);
QPolygon(int nPoints, const int *points);
QPolygon(const QPolygon &other) : QVector<QPoint>(other) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- QPolygon(QPolygon &&other) Q_DECL_NOTHROW : QVector<QPoint>(std::move(other)) {}
- QPolygon &operator=(QPolygon &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QPolygon(QPolygon &&other) noexcept : QVector<QPoint>(std::move(other)) {}
+ QPolygon &operator=(QPolygon &&other) noexcept { swap(other); return *this; }
QPolygon &operator=(const QPolygon &other) { QVector<QPoint>::operator=(other); return *this; }
- void swap(QPolygon &other) Q_DECL_NOTHROW { QVector<QPoint>::swap(other); } // prevent QVector<QPoint><->QPolygon swaps
+ void swap(QPolygon &other) noexcept { QVector<QPoint>::swap(other); } // prevent QVector<QPoint><->QPolygon swaps
operator QVariant() const;
@@ -145,16 +141,12 @@ public:
inline ~QPolygonF() {}
inline explicit QPolygonF(int size);
inline /*implicit*/ QPolygonF(const QVector<QPointF> &v) : QVector<QPointF>(v) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- /* implicit */ QPolygonF(QVector<QPointF> &&v) Q_DECL_NOTHROW : QVector<QPointF>(std::move(v)) {}
-#endif
+ /* implicit */ QPolygonF(QVector<QPointF> &&v) noexcept : QVector<QPointF>(std::move(v)) {}
QPolygonF(const QRectF &r);
/*implicit*/ QPolygonF(const QPolygon &a);
inline QPolygonF(const QPolygonF &a) : QVector<QPointF>(a) {}
-#ifdef Q_COMPILER_RVALUE_REFS
- QPolygonF(QPolygonF &&other) Q_DECL_NOTHROW : QVector<QPointF>(std::move(other)) {}
- QPolygonF &operator=(QPolygonF &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QPolygonF(QPolygonF &&other) noexcept : QVector<QPointF>(std::move(other)) {}
+ QPolygonF &operator=(QPolygonF &&other) noexcept { swap(other); return *this; }
QPolygonF &operator=(const QPolygonF &other) { QVector<QPointF>::operator=(other); return *this; }
inline void swap(QPolygonF &other) { QVector<QPointF>::swap(other); } // prevent QVector<QPointF><->QPolygonF swaps
diff --git a/src/gui/painting/qrbtree_p.h b/src/gui/painting/qrbtree_p.h
index d3ee23a91c..42e88889a1 100644
--- a/src/gui/painting/qrbtree_p.h
+++ b/src/gui/painting/qrbtree_p.h
@@ -60,7 +60,7 @@ struct QRBTree
{
struct Node
{
- inline Node() : parent(0), left(0), right(0), red(true) { }
+ inline Node() : parent(nullptr), left(nullptr), right(nullptr), red(true) { }
inline ~Node() {if (left) delete left; if (right) delete right;}
T data;
Node *parent;
@@ -69,7 +69,7 @@ struct QRBTree
bool red;
};
- inline QRBTree() : root(0), freeList(0) { }
+ inline QRBTree() : root(nullptr), freeList(nullptr) { }
inline ~QRBTree();
inline void clear();
@@ -120,7 +120,7 @@ inline QRBTree<T>::~QRBTree()
while (freeList) {
// Avoid recursively calling the destructor, as this list may become large.
Node *next = freeList->right;
- freeList->right = 0;
+ freeList->right = nullptr;
delete freeList;
freeList = next;
}
@@ -131,7 +131,7 @@ inline void QRBTree<T>::clear()
{
if (root)
delete root;
- root = 0;
+ root = nullptr;
}
template <class T>
@@ -359,7 +359,7 @@ void QRBTree<T>::detach(Node *node) // call this before removing a node.
ref = child;
if (child)
child->parent = node->parent;
- node->left = node->right = node->parent = 0;
+ node->left = node->right = node->parent = nullptr;
}
// 'node' must be black. rebalance will reduce the depth of black nodes by one in the sibling tree.
@@ -513,7 +513,7 @@ inline void QRBTree<T>::deleteNode(Node *&node)
detach(node);
node->right = freeList;
freeList = node;
- node = 0;
+ node = nullptr;
}
template <class T>
@@ -522,7 +522,7 @@ inline typename QRBTree<T>::Node *QRBTree<T>::newNode()
if (freeList) {
Node *node = freeList;
freeList = freeList->right;
- node->parent = node->left = node->right = 0;
+ node->parent = node->left = node->right = nullptr;
node->red = true;
return node;
}
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 69d48fcc58..82f5be2b65 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -1233,10 +1233,10 @@ struct QRegionPrivate {
}
}
- const QRect *begin() const Q_DECL_NOTHROW
+ const QRect *begin() const noexcept
{ return numRects == 1 ? &extents : rects.data(); } // avoid vectorize()
- const QRect *end() const Q_DECL_NOTHROW
+ const QRect *end() const noexcept
{ return begin() + numRects; }
inline void append(const QRect *r);
@@ -4267,7 +4267,7 @@ QRegion QRegion::xored(const QRegion &r) const
}
}
-QRect QRegion::boundingRect() const Q_DECL_NOTHROW
+QRect QRegion::boundingRect() const noexcept
{
if (isEmpty())
return QRect();
@@ -4325,12 +4325,12 @@ QVector<QRect> QRegion::rects() const
}
#endif
-QRegion::const_iterator QRegion::begin() const Q_DECL_NOTHROW
+QRegion::const_iterator QRegion::begin() const noexcept
{
return d->qt_rgn ? d->qt_rgn->begin() : nullptr;
}
-QRegion::const_iterator QRegion::end() const Q_DECL_NOTHROW
+QRegion::const_iterator QRegion::end() const noexcept
{
return d->qt_rgn ? d->qt_rgn->end() : nullptr;
}
@@ -4367,7 +4367,7 @@ void QRegion::setRects(const QRect *rects, int num)
}
}
-int QRegion::rectCount() const Q_DECL_NOTHROW
+int QRegion::rectCount() const noexcept
{
return (d->qt_rgn ? d->qt_rgn->numRects : 0);
}
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 9fe6ed5675..54de916198 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -69,30 +69,28 @@ public:
QRegion(const QRect &r, RegionType t = Rectangle);
QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill);
QRegion(const QRegion &region);
- QRegion(QRegion &&other) Q_DECL_NOTHROW
+ QRegion(QRegion &&other) noexcept
: d(other.d) { other.d = const_cast<QRegionData*>(&shared_empty); }
QRegion(const QBitmap &bitmap);
~QRegion();
QRegion &operator=(const QRegion &);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QRegion &operator=(QRegion &&other) Q_DECL_NOEXCEPT
+ inline QRegion &operator=(QRegion &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- inline void swap(QRegion &other) Q_DECL_NOEXCEPT { qSwap(d, other.d); }
+ inline void swap(QRegion &other) noexcept { qSwap(d, other.d); }
bool isEmpty() const;
bool isNull() const;
typedef const QRect *const_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- const_iterator begin() const Q_DECL_NOTHROW;
- const_iterator cbegin() const Q_DECL_NOTHROW { return begin(); }
- const_iterator end() const Q_DECL_NOTHROW;
- const_iterator cend() const Q_DECL_NOTHROW { return end(); }
- const_reverse_iterator rbegin() const Q_DECL_NOTHROW { return const_reverse_iterator(end()); }
- const_reverse_iterator crbegin() const Q_DECL_NOTHROW { return rbegin(); }
- const_reverse_iterator rend() const Q_DECL_NOTHROW { return const_reverse_iterator(begin()); }
- const_reverse_iterator crend() const Q_DECL_NOTHROW { return rend(); }
+ const_iterator begin() const noexcept;
+ const_iterator cbegin() const noexcept { return begin(); }
+ const_iterator end() const noexcept;
+ const_iterator cend() const noexcept { return end(); }
+ const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); }
+ const_reverse_iterator crbegin() const noexcept { return rbegin(); }
+ const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); }
+ const_reverse_iterator crend() const noexcept { return rend(); }
bool contains(const QPoint &p) const;
bool contains(const QRect &r) const;
@@ -121,13 +119,13 @@ public:
bool intersects(const QRegion &r) const;
bool intersects(const QRect &r) const;
- QRect boundingRect() const Q_DECL_NOTHROW;
+ QRect boundingRect() const noexcept;
#if QT_DEPRECATED_SINCE(5, 11)
QT_DEPRECATED_X("Use begin()/end() instead")
QVector<QRect> rects() const;
#endif
void setRects(const QRect *rect, int num);
- int rectCount() const Q_DECL_NOTHROW;
+ int rectCount() const noexcept;
#ifdef Q_COMPILER_MANGLES_RETURN_TYPE
// ### Qt 6: remove these, they're kept for MSVC compat
const QRegion operator|(const QRegion &r) const;
diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h
index ca879de27c..d145dbfbea 100644
--- a/src/gui/painting/qrgba64_p.h
+++ b/src/gui/painting/qrgba64_p.h
@@ -284,6 +284,8 @@ static Q_ALWAYS_INLINE void blend_pixel(QRgba64 &dst, QRgba64 src)
static Q_ALWAYS_INLINE void blend_pixel(QRgba64 &dst, QRgba64 src, const int const_alpha)
{
+ if (const_alpha == 255)
+ return blend_pixel(dst, src);
if (!src.isTransparent()) {
src = multiplyAlpha255(src, const_alpha);
dst = src + multiplyAlpha65535(dst, 65535 - src.alpha());
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index 90c06788e1..271d3ba6bf 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -173,15 +173,12 @@ template <class Iterator> bool qt_stroke_side(Iterator *it, QStroker *stroker,
bool capFirst, QLineF *startTangent);
/*******************************************************************************
- * QLineF::angle gives us the smalles angle between two lines. Here we
- * want to identify the line's angle direction on the unit circle.
+ * QLineF::angleTo gives us the angle between two lines with respecting the direction.
+ * Here we want to identify the line's angle direction on the unit circle.
*/
static inline qreal adapted_angle_on_x(const QLineF &line)
{
- qreal angle = line.angle(QLineF(0, 0, 1, 0));
- if (line.dy() > 0)
- angle = 360 - angle;
- return angle;
+ return QLineF(0, 0, 1, 0).angleTo(line);
}
QStrokerOps::QStrokerOps()
@@ -459,7 +456,7 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine
QLineF prevLine(qt_fixed_to_real(m_back2X), qt_fixed_to_real(m_back2Y),
qt_fixed_to_real(m_back1X), qt_fixed_to_real(m_back1Y));
QPointF isect;
- QLineF::IntersectType type = prevLine.intersect(nextLine, &isect);
+ QLineF::IntersectionType type = prevLine.intersects(nextLine, &isect);
if (join == FlatJoin) {
QLineF shortCut(prevLine.p2(), nextLine.p1());
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 06fa4bf95e..7a3dd04965 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -73,7 +73,7 @@ int QTextureGlyphCache::calculateSubPixelPositionCount(glyph_t glyph) const
if (path.isEmpty())
break;
- images[numImages++] = qMove(img);
+ images[numImages++] = std::move(img);
} else {
bool found = false;
for (int j = 0; j < numImages; ++j) {
@@ -83,7 +83,7 @@ int QTextureGlyphCache::calculateSubPixelPositionCount(glyph_t glyph) const
}
}
if (!found)
- images[numImages++] = qMove(img);
+ images[numImages++] = std::move(img);
}
}
@@ -285,6 +285,8 @@ QImageTextureGlyphCache::~QImageTextureGlyphCache()
void QImageTextureGlyphCache::resizeTextureData(int width, int height)
{
m_image = m_image.copy(0, 0, width, height);
+ // Regions not part of the copy are initialized to 0, and that is just what
+ // we need.
}
void QImageTextureGlyphCache::createTextureData(int width, int height)
@@ -305,6 +307,12 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
default:
Q_UNREACHABLE();
}
+
+ // Regions not touched by the glyphs must be initialized to 0. (such
+ // locations may in fact be sampled with styled (shifted) text materials)
+ // When resizing, the QImage copy() does this implicitly but the initial
+ // contents must be zeroed out explicitly here.
+ m_image.fill(0);
}
void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subPixelPosition)
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h
index c105e89e50..b6fc7230a8 100644
--- a/src/gui/painting/qtextureglyphcache_p.h
+++ b/src/gui/painting/qtextureglyphcache_p.h
@@ -75,7 +75,7 @@ class Q_GUI_EXPORT QTextureGlyphCache : public QFontEngineGlyphCache
{
public:
QTextureGlyphCache(QFontEngine::GlyphFormat format, const QTransform &matrix, const QColor &color = QColor())
- : QFontEngineGlyphCache(format, matrix, color), m_current_fontengine(0),
+ : QFontEngineGlyphCache(format, matrix, color), m_current_fontengine(nullptr),
m_w(0), m_h(0), m_cx(0), m_cy(0), m_currentRowHeight(0)
{ }
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 816514a695..d75b66c50b 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -265,7 +265,9 @@ QTransform::QTransform()
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxNone)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, d(nullptr)
+#endif
{
}
@@ -284,7 +286,9 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h13,
, m_13(h13), m_23(h23), m_33(h33)
, m_type(TxNone)
, m_dirty(TxProject)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, d(nullptr)
+#endif
{
}
@@ -301,7 +305,9 @@ QTransform::QTransform(qreal h11, qreal h12, qreal h21,
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxShear)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, d(nullptr)
+#endif
{
}
@@ -317,7 +323,9 @@ QTransform::QTransform(const QMatrix &mtx)
m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxShear)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, d(nullptr)
+#endif
{
}
@@ -795,7 +803,7 @@ bool QTransform::operator==(const QTransform &o) const
Returns the hash value for \a key, using
\a seed to seed the calculation.
*/
-uint qHash(const QTransform &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QTransform &key, uint seed) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.m11());
@@ -1021,7 +1029,7 @@ QTransform QTransform::operator*(const QTransform &m) const
/*!
Assigns the given \a matrix's values to this matrix.
*/
-QTransform & QTransform::operator=(const QTransform &matrix) Q_DECL_NOTHROW
+QTransform & QTransform::operator=(const QTransform &matrix) noexcept
{
affine._m11 = matrix.affine._m11;
affine._m12 = matrix.affine._m12;
@@ -1521,12 +1529,12 @@ QRegion QTransform::map(const QRegion &r) const
QRegion res;
if (m11() < 0 || m22() < 0) {
for (const QRect &rect : r)
- res += mapRect(rect);
+ res += mapRect(QRectF(rect)).toRect();
} else {
QVarLengthArray<QRect, 32> rects;
rects.reserve(r.rectCount());
for (const QRect &rect : r) {
- QRect nr = mapRect(rect);
+ QRect nr = mapRect(QRectF(rect)).toRect();
if (!nr.isEmpty())
rects.append(nr);
}
diff --git a/src/gui/painting/qtransform.h b/src/gui/painting/qtransform.h
index 1e322d435a..b220770144 100644
--- a/src/gui/painting/qtransform.h
+++ b/src/gui/painting/qtransform.h
@@ -77,13 +77,13 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// ### Qt 6: remove; the compiler-generated ones are fine!
- QTransform &operator=(QTransform &&other) Q_DECL_NOTHROW // = default
+ QTransform &operator=(QTransform &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QTransform)); return *this; }
- QTransform &operator=(const QTransform &) Q_DECL_NOTHROW; // = default
- QTransform(QTransform &&other) Q_DECL_NOTHROW // = default
+ QTransform &operator=(const QTransform &) noexcept; // = default
+ QTransform(QTransform &&other) noexcept // = default
: affine(Qt::Uninitialized)
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QTransform)); }
- QTransform(const QTransform &other) Q_DECL_NOTHROW // = default
+ QTransform(const QTransform &other) noexcept // = default
: affine(Qt::Uninitialized)
{ memcpy(static_cast<void *>(this), static_cast<const void *>(&other), sizeof(QTransform)); }
#endif
@@ -176,7 +176,9 @@ private:
, m_13(h13), m_23(h23), m_33(h33)
, m_type(TxNone)
, m_dirty(TxProject)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, d(nullptr)
+#endif
{
}
inline QTransform(bool)
@@ -184,7 +186,9 @@ private:
, m_13(0), m_23(0), m_33(1)
, m_type(TxNone)
, m_dirty(TxNone)
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
, d(nullptr)
+#endif
{
}
inline TransformationType inline_type() const;
@@ -202,7 +206,7 @@ private:
};
Q_DECLARE_TYPEINFO(QTransform, Q_MOVABLE_TYPE);
-Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QTransform &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT Q_DECL_CONST_FUNCTION uint qHash(const QTransform &key, uint seed = 0) noexcept;
/******* inlines *****/
inline QTransform::TransformationType QTransform::inline_type() const
diff --git a/src/gui/painting/qtriangulator_p.h b/src/gui/painting/qtriangulator_p.h
index 0abf87308a..177e5e66ed 100644
--- a/src/gui/painting/qtriangulator_p.h
+++ b/src/gui/painting/qtriangulator_p.h
@@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
-class Q_GUI_EXPORT QVertexIndexVector
+class QVertexIndexVector
{
public:
enum Type {
@@ -93,19 +93,6 @@ public:
return indices16.size();
}
- QVertexIndexVector() = default;
- QVertexIndexVector(const QVertexIndexVector &) = default;
- inline QVertexIndexVector &operator = (const QVertexIndexVector &other)
- {
- if (t == UnsignedInt)
- indices32 = other.indices32;
- else
- indices16 = other.indices16;
-
- t = other.t;
- return *this;
- }
-
private:
Type t;
@@ -113,23 +100,15 @@ private:
QVector<quint16> indices16;
};
-struct Q_GUI_EXPORT QTriangleSet
+struct QTriangleSet
{
- inline QTriangleSet() { }
- inline QTriangleSet(const QTriangleSet &other) : vertices(other.vertices), indices(other.indices) { }
- QTriangleSet &operator = (const QTriangleSet &other) {vertices = other.vertices; indices = other.indices; return *this;}
-
// The vertices of a triangle are given by: (x[i[n]], y[i[n]]), (x[j[n]], y[j[n]]), (x[k[n]], y[k[n]]), n = 0, 1, ...
QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...]
QVertexIndexVector indices; // [i[0], j[0], k[0], i[1], j[1], k[1], i[2], ...]
};
-struct Q_GUI_EXPORT QPolylineSet
+struct QPolylineSet
{
- inline QPolylineSet() { }
- inline QPolylineSet(const QPolylineSet &other) : vertices(other.vertices), indices(other.indices) { }
- QPolylineSet &operator = (const QPolylineSet &other) {vertices = other.vertices; indices = other.indices; return *this;}
-
QVector<qreal> vertices; // [x[0], y[0], x[1], y[1], x[2], ...]
QVertexIndexVector indices; // End of polyline is marked with -1.
};
diff --git a/src/gui/painting/qvectorpath_p.h b/src/gui/painting/qvectorpath_p.h
index 1b649a5d2a..df5772d4cc 100644
--- a/src/gui/painting/qvectorpath_p.h
+++ b/src/gui/painting/qvectorpath_p.h
@@ -106,7 +106,7 @@ public:
// ### Falcon: introduca a struct XY for points so lars is not so confused...
QVectorPath(const qreal *points,
int count,
- const QPainterPath::ElementType *elements = 0,
+ const QPainterPath::ElementType *elements = nullptr,
uint hints = ArbitraryShapeHint)
: m_elements(elements),
m_points(points),
@@ -128,12 +128,12 @@ public:
inline bool hasExplicitOpen() const { return m_hints & ExplicitOpen; }
inline bool hasWindingFill() const { return m_hints & WindingFill; }
- inline void makeCacheable() const { m_hints |= ShouldUseCacheHint; m_cache = 0; }
+ inline void makeCacheable() const { m_hints |= ShouldUseCacheHint; m_cache = nullptr; }
inline uint hints() const { return m_hints; }
inline const QPainterPath::ElementType *elements() const { return m_elements; }
inline const qreal *points() const { return m_points; }
- inline bool isEmpty() const { return m_points == 0; }
+ inline bool isEmpty() const { return m_points == nullptr; }
inline int elementCount() const { return m_count; }
inline const QPainterPath convertToPainterPath() const;
@@ -165,7 +165,7 @@ public:
return e;
e = e->next;
}
- return 0;
+ return nullptr;
}
template <typename T> static inline bool isRect(const T *pts, int elementCount) {
diff --git a/src/gui/platform/wasm/qwasmlocalfileaccess.cpp b/src/gui/platform/wasm/qwasmlocalfileaccess.cpp
index 83f9415c69..85c894a74a 100644
--- a/src/gui/platform/wasm/qwasmlocalfileaccess.cpp
+++ b/src/gui/platform/wasm/qwasmlocalfileaccess.cpp
@@ -164,6 +164,43 @@ void openFile(const std::string &accept,
openFiles(accept, FileSelectMode::SingleFile, fileDialogClosedWithInt, acceptFile, fileDataReady);
}
+void saveFile(const char *content, size_t size, const std::string &fileNameHint)
+{
+ // Save a file by creating programatically clicking a download
+ // link to an object url to a Blob containing the file content.
+ // File content is copied once, so that the passed in content
+ // buffer can be released as soon as this function returns - we
+ // don't know for how long the browser will retain the TypedArray
+ // view used to create the Blob.
+
+ emscripten::val document = emscripten::val::global("document");
+ emscripten::val window = emscripten::val::global("window");
+
+ emscripten::val fileContentView = emscripten::val(emscripten::typed_memory_view(size, content));
+ emscripten::val fileContentCopy = emscripten::val::global("ArrayBuffer").new_(size);
+ emscripten::val fileContentCopyView = emscripten::val::global("Uint8Array").new_(fileContentCopy);
+ fileContentCopyView.call<void>("set", fileContentView);
+
+ emscripten::val contentArray = emscripten::val::array();
+ contentArray.call<void>("push", fileContentCopyView);
+ emscripten::val type = emscripten::val::object();
+ type.set("type","application/octet-stream");
+ emscripten::val contentBlob = emscripten::val::global("Blob").new_(contentArray, type);
+
+ emscripten::val contentUrl = window["URL"].call<emscripten::val>("createObjectURL", contentBlob);
+ emscripten::val contentLink = document.call<emscripten::val>("createElement", std::string("a"));
+ contentLink.set("href", contentUrl);
+ contentLink.set("download", fileNameHint);
+ contentLink.set("style", "display:none");
+
+ emscripten::val body = document["body"];
+ body.call<void>("appendChild", contentLink);
+ contentLink.call<void>("click");
+ body.call<void>("removeChild", contentLink);
+
+ window["URL"].call<emscripten::val>("revokeObjectURL", contentUrl);
+}
+
} // namespace QWasmLocalFileAccess
QT_END_NAMESPACE
diff --git a/src/gui/platform/wasm/qwasmlocalfileaccess_p.h b/src/gui/platform/wasm/qwasmlocalfileaccess_p.h
index 794db8d9b2..ccd88570c8 100644
--- a/src/gui/platform/wasm/qwasmlocalfileaccess_p.h
+++ b/src/gui/platform/wasm/qwasmlocalfileaccess_p.h
@@ -71,6 +71,8 @@ void openFile(const std::string &accept,
const std::function<char *(uint64_t size, const std::string name)> &acceptFile,
const std::function<void()> &fileDataReady);
+void saveFile(const char *content, size_t size, const std::string &fileNameHint);
+
} // namespace QWasmLocalFileAccess
QT_END_NAMESPACE
diff --git a/src/gui/rhi/cs_tdr_p.h b/src/gui/rhi/cs_tdr_p.h
new file mode 100644
index 0000000000..620a4a101d
--- /dev/null
+++ b/src/gui/rhi/cs_tdr_p.h
@@ -0,0 +1,225 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CS_TDR_P_H
+#define CS_TDR_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 <QtCore/qglobal.h>
+
+#ifdef Q_OS_WIN
+
+#include <qt_windows.h>
+
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 10.1
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ConstantBuffer
+// {
+//
+// uint zero; // Offset: 0 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim HLSL Bind Count
+// ------------------------------ ---------- ------- ----------- -------------- ------
+// uav UAV uint buf u0 1
+// ConstantBuffer cbuffer NA NA cb0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// no Input
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// no Output
+cs_5_0
+dcl_globalFlags refactoringAllowed
+dcl_constantbuffer CB0[1], immediateIndexed
+dcl_uav_typed_buffer (uint,uint,uint,uint) u0
+dcl_input vThreadID.x
+dcl_thread_group 256, 1, 1
+loop
+ breakc_nz cb0[0].x
+ store_uav_typed u0.xyzw, vThreadID.xxxx, cb0[0].xxxx
+endloop
+ret
+// Approximately 5 instruction slots used
+#endif
+
+const BYTE g_killDeviceByTimingOut[] =
+{
+ 68, 88, 66, 67, 217, 62,
+ 220, 38, 136, 51, 86, 245,
+ 161, 96, 18, 35, 141, 17,
+ 26, 13, 1, 0, 0, 0,
+ 164, 2, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 100, 1, 0, 0, 116, 1,
+ 0, 0, 132, 1, 0, 0,
+ 8, 2, 0, 0, 82, 68,
+ 69, 70, 40, 1, 0, 0,
+ 1, 0, 0, 0, 144, 0,
+ 0, 0, 2, 0, 0, 0,
+ 60, 0, 0, 0, 0, 5,
+ 83, 67, 0, 1, 0, 0,
+ 0, 1, 0, 0, 82, 68,
+ 49, 49, 60, 0, 0, 0,
+ 24, 0, 0, 0, 32, 0,
+ 0, 0, 40, 0, 0, 0,
+ 36, 0, 0, 0, 12, 0,
+ 0, 0, 0, 0, 0, 0,
+ 124, 0, 0, 0, 4, 0,
+ 0, 0, 4, 0, 0, 0,
+ 1, 0, 0, 0, 255, 255,
+ 255, 255, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 128, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 117, 97,
+ 118, 0, 67, 111, 110, 115,
+ 116, 97, 110, 116, 66, 117,
+ 102, 102, 101, 114, 0, 171,
+ 128, 0, 0, 0, 1, 0,
+ 0, 0, 168, 0, 0, 0,
+ 16, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 208, 0, 0, 0, 0, 0,
+ 0, 0, 4, 0, 0, 0,
+ 2, 0, 0, 0, 220, 0,
+ 0, 0, 0, 0, 0, 0,
+ 255, 255, 255, 255, 0, 0,
+ 0, 0, 255, 255, 255, 255,
+ 0, 0, 0, 0, 122, 101,
+ 114, 111, 0, 100, 119, 111,
+ 114, 100, 0, 171, 0, 0,
+ 19, 0, 1, 0, 1, 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,
+ 213, 0, 0, 0, 77, 105,
+ 99, 114, 111, 115, 111, 102,
+ 116, 32, 40, 82, 41, 32,
+ 72, 76, 83, 76, 32, 83,
+ 104, 97, 100, 101, 114, 32,
+ 67, 111, 109, 112, 105, 108,
+ 101, 114, 32, 49, 48, 46,
+ 49, 0, 73, 83, 71, 78,
+ 8, 0, 0, 0, 0, 0,
+ 0, 0, 8, 0, 0, 0,
+ 79, 83, 71, 78, 8, 0,
+ 0, 0, 0, 0, 0, 0,
+ 8, 0, 0, 0, 83, 72,
+ 69, 88, 124, 0, 0, 0,
+ 80, 0, 5, 0, 31, 0,
+ 0, 0, 106, 8, 0, 1,
+ 89, 0, 0, 4, 70, 142,
+ 32, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 156, 8,
+ 0, 4, 0, 224, 17, 0,
+ 0, 0, 0, 0, 68, 68,
+ 0, 0, 95, 0, 0, 2,
+ 18, 0, 2, 0, 155, 0,
+ 0, 4, 0, 1, 0, 0,
+ 1, 0, 0, 0, 1, 0,
+ 0, 0, 48, 0, 0, 1,
+ 3, 0, 4, 4, 10, 128,
+ 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 164, 0,
+ 0, 7, 242, 224, 17, 0,
+ 0, 0, 0, 0, 6, 0,
+ 2, 0, 6, 128, 32, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 22, 0, 0, 1,
+ 62, 0, 0, 1, 83, 84,
+ 65, 84, 148, 0, 0, 0,
+ 5, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 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,
+ 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,
+ 1, 0, 0, 0
+};
+
+#endif // Q_OS_WIN
+
+#endif // CS_TDR_P_H
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
new file mode 100644
index 0000000000..8ef98d2e42
--- /dev/null
+++ b/src/gui/rhi/qrhi.cpp
@@ -0,0 +1,5709 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhi_p_p.h"
+#include <qmath.h>
+#include <QLoggingCategory>
+
+#include "qrhinull_p_p.h"
+#ifndef QT_NO_OPENGL
+#include "qrhigles2_p_p.h"
+#endif
+#if QT_CONFIG(vulkan)
+#include "qrhivulkan_p_p.h"
+#endif
+#ifdef Q_OS_WIN
+#include "qrhid3d11_p_p.h"
+#endif
+//#ifdef Q_OS_DARWIN
+#ifdef Q_OS_MACOS
+#include "qrhimetal_p_p.h"
+#endif
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(QRHI_LOG_INFO, "qt.rhi.general")
+
+/*!
+ \class QRhi
+ \internal
+ \inmodule QtGui
+
+ \brief Accelerated 2D/3D graphics API abstraction.
+
+ The Qt Rendering Hardware Interface is an abstraction for hardware accelerated
+ graphics APIs, such as, \l{https://www.khronos.org/opengl/}{OpenGL},
+ \l{https://www.khronos.org/opengles/}{OpenGL ES},
+ \l{https://docs.microsoft.com/en-us/windows/desktop/direct3d}{Direct3D},
+ \l{https://developer.apple.com/metal/}{Metal}, and
+ \l{https://www.khronos.org/vulkan/}{Vulkan}.
+
+ Some of the main design goals are:
+
+ \list
+
+ \li Simple, minimal, understandable, extensible. Follow the proven path of the
+ Qt Quick scenegraph.
+
+ \li Aim to be a product - and in the bigger picture, part of a product (Qt) -
+ that is usable out of the box both by internal (such as, Qt Quick) and,
+ eventually, external users.
+
+ \li Not a complete 1:1 wrapper for any of the underlying APIs. The feature set
+ is tuned towards the needs of Qt's 2D and 3D offering (QPainter, Qt Quick, Qt
+ 3D Studio). Iterate and evolve in a sustainable manner.
+
+ \li Intrinsically cross-platform, without reinventing: abstracting
+ cross-platform aspects of certain APIs (such as, OpenGL context creation and
+ windowing system interfaces, Vulkan instance and surface management) is not in
+ scope here. These are delegated to the existing QtGui facilities (QWindow,
+ QOpenGLContext, QVulkanInstance) and its backing QPA architecture.
+
+ \endlist
+
+ Each QRhi instance is backed by a backend for a specific graphics API. The
+ selection of the backend is a run time choice and is up to the application
+ or library that creates the QRhi instance. Some backends are available on
+ multiple platforms (OpenGL, Vulkan, Null), while APIs specific to a given
+ platform are only available when running on the platform in question (Metal
+ on macOS/iOS/tvOS, Direct3D on Windows).
+
+ The available backends currently are:
+
+ \list
+
+ \li OpenGL 2.1 or OpenGL ES 2.0 or newer. Some extensions are utilized when
+ present, for example to enable multisample framebuffers.
+
+ \li Direct3D 11.1
+
+ \li Metal
+
+ \li Vulkan 1.0, optionally with some extensions that are part of Vulkan 1.1
+
+ \li Null - A "dummy" backend that issues no graphics calls at all.
+
+ \endlist
+
+ In order to allow shader code to be written once in Qt applications and
+ libraries, all shaders are expected to be written in a single language
+ which is then compiled into SPIR-V. Versions for various shading language
+ are then generated from that, together with reflection information (inputs,
+ outputs, shader resources). This is then packed into easily and efficiently
+ serializable QShader instances. The compilers and tools to generate such
+ shaders are not part of QRhi, but the core classes for using such shaders,
+ QShader and QShaderDescription, are.
+
+ \section2 Design Fundamentals
+
+ A QRhi cannot be instantiated directly. Instead, use the create()
+ function. Delete the QRhi instance normally to release the graphics device.
+
+ \section3 Resources
+
+ Instances of classes deriving from QRhiResource, such as, QRhiBuffer,
+ QRhiTexture, etc., encapsulate zero, one, or more native graphics
+ resources. Instances of such classes are always created via the \c new
+ functions of the QRhi, such as, newBuffer(), newTexture(),
+ newTextureRenderTarget(), newSwapChain().
+
+ \badcode
+ vbuf = rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+ if (!vbuf->build()) { error }
+ ...
+ delete vbuf;
+ \endcode
+
+ \list
+
+ \li The returned value from both create() and functions like newBuffer() is
+ owned by the caller.
+
+ \li Just creating a QRhiResource subclass never allocates or initializes any
+ native resources. That is only done when calling the \c build function of a
+ subclass, for example, QRhiBuffer::build() or QRhiTexture::build().
+
+ \li The exception is
+ QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor() and
+ QRhiSwapChain::newCompatibleRenderPassDescriptor(). There is no \c build
+ operation for these and the returned object is immediately active.
+
+ \li The resource objects themselves are treated as immutable: once a
+ resource is built, changing any parameters via the setters, such as,
+ QRhiTexture::setPixelSize(), has no effect, unless the underlying native
+ resource is released and \c build is called again. See more about resource
+ reuse in the sections below.
+
+ \li The underlying native resources are scheduled for releasing by the
+ QRhiResource destructor, or by calling QRhiResource::release(). Backends
+ often queue release requests and defer executing them to an unspecified
+ time, this is hidden from the applications. This way applications do not
+ have to worry about releasing native resources that may still be in use by
+ an in-flight frame.
+
+ \li Note that this does not mean that a QRhiResource can freely be
+ destroyed or release()'d within a frame (that is, in a
+ \l{QRhiCommandBuffer::beginFrame()}{beginFrame()} -
+ \l{QRhiCommandBuffer::endFrame()}{endFrame()} section). As a general rule,
+ all referenced QRhiResource objects must stay unchanged until the frame is
+ submitted by calling \l{QRhiCommandBuffer::endFrame()}{endFrame()}. To ease
+ this, QRhiResource::releaseAndDestroyLater() is provided as a convenience.
+
+ \endlist
+
+ \section3 Command buffers and deferred command execution
+
+ Regardless of the design and capabilities of the underlying graphics API,
+ all QRhi backends implement some level of command buffers. No
+ QRhiCommandBuffer function issues any native bind or draw command (such as,
+ \c glDrawElements) directly. Commands are always recorded in a queue,
+ either native or provided by the QRhi backend. The command buffer is
+ submitted, and so execution starts only upon QRhi::endFrame() or
+ QRhi::finish().
+
+ The deferred nature has consequences for some types of objects. For example,
+ writing to a dynamic buffer multiple times within a frame, in case such
+ buffers are backed by host-visible memory, will result in making the
+ results of all writes are visible to all draw calls in the command buffer
+ of the frame, regardless of when the dynamic buffer update was recorded
+ relative to a draw call.
+
+ Furthermore, instances of QRhiResource subclasses must be treated immutable
+ within a frame in which they are referenced in any way. Create or rebuild
+ all resources upfront, before starting to record commands for the next
+ frame. Reusing a QRhiResource instance within a frame (by rebuilding it and
+ then referencing it again in the same \c{beginFrame - endFrame} section)
+ should be avoided as it may lead to unexpected results, depending on the
+ backend.
+
+ As a general rule, all referenced QRhiResource objects must stay valid and
+ unmodified until the frame is submitted by calling
+ \l{QRhiCommandBuffer::endFrame()}{endFrame()}. On the other hand, calling
+ \l{QRhiResource::release()}{release()} or destroying the QRhiResource are
+ always safe once the frame is submitted, regardless of the status of the
+ underlying native resources (which may still be in use by the GPU - but
+ that is taken care of internally).
+
+ Unlike APIs like OpenGL, upload and copy type of commands cannot be mixed
+ with draw commands. The typical renderer will involve a sequence similar to
+ the following: \c{(re)build resources} - \c{begin frame} - \c{record
+ uploads and copies} - \c{start renderpass} - \c{record draw calls} - \c{end
+ renderpass} - \c{end frame}. Recording copy type of operations happens via
+ QRhiResourceUpdateBatch. Such operations are committed typically on
+ \l{QRhiCommandBuffer::beginPass()}{beginPass()}.
+
+ When working with legacy rendering engines designed for OpenGL, the
+ migration to QRhi often involves redesigning from having a single \c render
+ step (that performs copies and uploads, clears buffers, and issues draw
+ calls, all mixed together) to a clearly separated, two phase \c prepare -
+ \c render setup where the \c render step only starts a renderpass and
+ records draw calls, while all resource creation and queuing of updates,
+ uploads and copies happens beforehand, in the \c prepare step.
+
+ QRhi does not at the moment allow freely creating and submitting command
+ buffers. This may be lifted in the future to some extent, in particular if
+ compute support is introduced, but the model of well defined
+ \c{frame-start} and \c{frame-end} points, combined with a dedicated,
+ "frame" command buffer, where \c{frame-end} implies presenting, is going to
+ remain the primary way of operating since this is what fits Qt's various UI
+ technologies best.
+
+ \section3 Threading
+
+ A QRhi instance and the associated resources can be created and used on any
+ thread but all usage must be limited to that one single thread. When
+ rendering to multiple QWindows in an application, having a dedicated thread
+ and QRhi instance for each window is often advisable, as this can eliminate
+ issues with unexpected throttling caused by presenting to multiple windows.
+ Conceptually that is then the same as how Qt Quick scene graph's threaded
+ render loop operates when working directly with OpenGL: one thread for each
+ window, one QOpenGLContext for each thread. When moving onto QRhi,
+ QOpenGLContext is replaced by QRhi, making the migration straightforward.
+
+ When it comes to externally created native objects, such as OpenGL contexts
+ passed in via QRhiGles2NativeHandles, it is up to the application to ensure
+ they are not misused by other threads.
+
+ Resources are not shareable between QRhi instances. This is an intentional
+ choice since QRhi hides most queue, command buffer, and resource
+ synchronization related tasks, and provides no API for them. Safe and
+ efficient concurrent use of graphics resources from multiple threads is
+ tied to those concepts, however, and is thus a topic that is currently out
+ of scope, but may be introduced in the future.
+
+ \note The Metal backend requires that an autorelease pool is available on
+ the rendering thread, ideally wrapping each iteration of the render loop.
+ This needs no action from the users of QRhi when rendering on the main
+ (gui) thread, but becomes important when a separate, dedicated render
+ thread is used.
+
+ \section3 Resource synchronization
+
+ QRhi does not expose APIs for resource barriers or image layout
+ transitions. Such synchronization is done implicitly by the backends, where
+ applicable (for example, Vulkan), by tracking resource usage as necessary.
+ Buffer and image barriers are inserted before render or compute passes
+ transparently to the application.
+
+ \note Resources within a render or compute pass are expected to be bound to
+ a single usage during that pass. For example, a buffer can be used as
+ vertex, index, uniform, or storage buffer, but not a combination of them
+ within a single pass. However, it is perfectly fine to use a buffer as a
+ storage buffer in a compute pass, and then as a vertex buffer in a render
+ pass, for example, assuming the buffer declared both usages upon creation.
+
+ \note Textures have this rule relaxed in certain cases, because using two
+ subresources (typically two different mip levels) of the same texture for
+ different access (one for load, one for store) is supported even within the
+ same pass.
+
+ \section3 Resource reuse
+
+ From the user's point of view a QRhiResource is reusable immediately after
+ calling QRhiResource::release(). With the exception of swapchains, calling
+ \c build() on an already built object does an implicit \c release(). This
+ provides a handy shortcut to reuse a QRhiResource instance with different
+ parameters, with a new native graphics object underneath.
+
+ The importance of reusing the same object lies in the fact that some
+ objects reference other objects: for example, a QRhiShaderResourceBindings
+ can reference QRhiBuffer, QRhiTexture, and QRhiSampler instances. If in a
+ later frame one of these buffers need to be resized or a sampler parameter
+ needs changing, destroying and creating a whole new QRhiBuffer or
+ QRhiSampler would invalidate all references to the old instance. By just
+ changing the appropriate parameters via QRhiBuffer::setSize() or similar
+ and then calling QRhiBuffer::build(), everything works as expected and
+ there is no need to touch the QRhiShaderResourceBindings at all, even
+ though there is a good chance that under the hood the QRhiBuffer is now
+ backed by a whole new native buffer.
+
+ \badcode
+ ubuf = rhi->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 256);
+ ubuf->build();
+
+ srb = rhi->newShaderResourceBindings()
+ srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, ubuf)
+ });
+ srb->build();
+
+ ...
+
+ // now in a later frame we need to grow the buffer to a larger size
+ ubuf->setSize(512);
+ ubuf->build(); // same as ubuf->release(); ubuf->build();
+
+ // that's it, srb needs no changes whatsoever
+ \endcode
+
+ \section3 Pooled objects
+
+ In addition to resources, there are pooled objects as well, such as,
+ QRhiResourceUpdateBatch. An instance is retrieved via a \c next function,
+ such as, nextResourceUpdateBatch(). The caller does not own the returned
+ instance in this case. The only valid way of operating here is calling
+ functions on the QRhiResourceUpdateBatch and then passing it to
+ QRhiCommandBuffer::beginPass() or QRhiCommandBuffer::endPass(). These
+ functions take care of returning the batch to the pool. Alternatively, a
+ batch can be "canceled" and returned to the pool without processing by
+ calling QRhiResourceUpdateBatch::release().
+
+ A typical pattern is thus:
+
+ \badcode
+ QRhiResourceUpdateBatch *resUpdates = rhi->nextResourceUpdateBatch();
+ ...
+ resUpdates->updateDynamicBuffer(ubuf, 0, 64, mvp.constData());
+ if (!image.isNull()) {
+ resUpdates->uploadTexture(texture, image);
+ image = QImage();
+ }
+ ...
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ cb->beginPass(swapchain->currentFrameRenderTarget(), clearCol, clearDs, resUpdates);
+ \endcode
+
+ \section3 Swapchain specifics
+
+ QRhiSwapChain features some special semantics due to the peculiar nature of
+ swapchains.
+
+ \list
+
+ \li It has no \c build but rather a QRhiSwapChain::buildOrResize().
+ Repeatedly calling this function is \b not the same as calling
+ QRhiSwapChain::release() followed by QRhiSwapChain::buildOrResize(). This
+ is because swapchains often have ways to handle the case where buffers need
+ to be resized in a manner that is more efficient than a brute force
+ destroying and recreating from scratch.
+
+ \li An active QRhiSwapChain must be released by calling
+ \l{QRhiSwapChain::release()}{release()}, or by destroying the object, before
+ the QWindow's underlying QPlatformWindow, and so the associated native
+ window object, is destroyed. It should not be postponed because releasing
+ the swapchain may become problematic (and with some APIs, like Vulkan, is
+ explicitly disallowed) when the native window is not around anymore, for
+ example because the QPlatformWindow got destroyed upon getting a
+ QWindow::close(). Therefore, releasing the swapchain must happen whenever
+ the targeted QWindow sends the
+ QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed event. If the event does
+ not arrive before the destruction of the QWindow - this can happen when
+ using QCoreApplication::quit() -, then check QWindow::handle() after the
+ event loop exits and invoke the swapchain release when non-null (meaning
+ the underlying native window is still around).
+
+ \endlist
+
+ \section3 Ownership
+
+ The general rule is no ownership transfer. Creating a QRhi with an already
+ existing graphics device does not mean the QRhi takes ownership of the
+ device object. Similarly, ownership is not given away when a device or
+ texture object is "exported" via QRhi::nativeHandles() or
+ QRhiTexture::nativeHandles(). Most importantly, passing pointers in structs
+ and via setters does not transfer ownership.
+
+ \section2 Troubleshooting
+
+ Errors are printed to the output via qWarning(). Additional debug messages
+ can be enabled via the following logging categories. Messages from these
+ categories are not printed by default unless explicitly enabled via
+ QRhi::EnableProfiling or the facilities of QLoggingCategory (such as, the
+ \c QT_LOGGING_RULES environment variable).
+
+ \list
+ \li \c{qt.rhi.general}
+ \endlist
+
+ It is strongly advised to inspect the output with the logging categories
+ (\c{qt.rhi.*}) enabled whenever a QRhi-based application is not behaving as
+ expected.
+ */
+
+/*!
+ \enum QRhi::Implementation
+ Describes which graphics API-specific backend gets used by a QRhi instance.
+
+ \value Null
+ \value Vulkan
+ \value OpenGLES2
+ \value D3D11
+ \value Metal
+ */
+
+/*!
+ \enum QRhi::Flag
+ Describes what special features to enable.
+
+ \value EnableProfiling Enables gathering timing (CPU, GPU) and resource
+ (QRhiBuffer, QRhiTexture, etc.) information and additional metadata. See
+ QRhiProfiler. Avoid enabling in production builds as it may involve a
+ performance penalty. Also enables debug messages from the \c{qt.rhi.*}
+ logging categories.
+
+ \value EnableDebugMarkers Enables debug marker groups. Without this frame
+ debugging features like making debug groups and custom resource name
+ visible in external GPU debugging tools will not be available and functions
+ like QRhiCommandBuffer::debugMarkBegin() will become a no-op. Avoid
+ enabling in production builds as it may involve a performance penalty.
+
+ \value PreferSoftwareRenderer Indicates that backends should prefer
+ choosing an adapter or physical device that renders in software on the CPU.
+ For example, with Direct3D there is typically a "Basic Render Driver"
+ adapter available with \c{DXGI_ADAPTER_FLAG_SOFTWARE}. Setting this flag
+ requests the backend to choose that adapter over any other, as long as no
+ specific adapter was forced by other backend-specific means. With Vulkan
+ this maps to preferring physical devices with
+ \c{VK_PHYSICAL_DEVICE_TYPE_CPU}. When not available, or when it is not
+ possible to decide if an adapter/device is software-based, this flag is
+ ignored. It may also be ignored with graphics APIs that have no concept and
+ means of enumerating adapters/devices.
+ */
+
+/*!
+ \enum QRhi::FrameOpResult
+ Describes the result of operations that can have a soft failure.
+
+ \value FrameOpSuccess Success
+
+ \value FrameOpError Unspecified error
+
+ \value FrameOpSwapChainOutOfDate The swapchain is in an inconsistent state
+ internally. This can be recoverable by attempting to repeat the operation
+ (such as, beginFrame()) later.
+
+ \value FrameOpDeviceLost The graphics device was lost. This can be
+ recoverable by attempting to repeat the operation (such as, beginFrame())
+ after releasing and reinitializing all objects backed by native graphics
+ resources. See isDeviceLost().
+ */
+
+/*!
+ \enum QRhi::Feature
+ Flag values to indicate what features are supported by the backend currently in use.
+
+ \value MultisampleTexture Indicates that textures with a sample count larger
+ than 1 are supported.
+
+ \value MultisampleRenderBuffer Indicates that renderbuffers with a sample
+ count larger than 1 are supported.
+
+ \value DebugMarkers Indicates that debug marker groups (and so
+ QRhiCommandBuffer::debugMarkBegin()) are supported.
+
+ \value Timestamps Indicates that command buffer timestamps are supported.
+ Relevant for QRhiProfiler::gpuFrameTimes().
+
+ \value Instancing Indicates that instanced drawing is supported.
+
+ \value CustomInstanceStepRate Indicates that instance step rates other than
+ 1 are supported.
+
+ \value PrimitiveRestart Indicates that restarting the assembly of
+ primitives when encountering an index value of 0xFFFF
+ (\l{QRhiCommandBuffer::IndexUInt16}{IndexUInt16}) or 0xFFFFFFFF
+ (\l{QRhiCommandBuffer::IndexUInt32}{IndexUInt32}) is enabled, for certain
+ primitive topologies at least. QRhi will try to enable this with all
+ backends, but in some cases it will not be supported. Dynamically
+ controlling primitive restart is not possible since with some APIs
+ primitive restart with a fixed index is always on. Applications must assume
+ that whenever this feature is reported as supported, the above mentioned
+ index values \c may be treated specially, depending on the topology. The
+ only two topologies where primitive restart is guaranteed to behave
+ identically across backends, as long as this feature is reported as
+ supported, are \l{QRhiGraphicsPipeline::LineStrip}{LineStrip} and
+ \l{QRhiGraphicsPipeline::TriangleStrip}{TriangleStrip}.
+
+ \value NonDynamicUniformBuffers Indicates that creating buffers with the
+ usage \l{QRhiBuffer::UniformBuffer}{UniformBuffer} and the types
+ \l{QRhiBuffer::Immutable}{Immutable} or \l{QRhiBuffer::Static}{Static} is
+ supported. When reported as unsupported, uniform (constant) buffers must be
+ created as \l{QRhiBuffer::Dynamic}{Dynamic}. (which is recommended
+ regardless)
+
+ \value NonFourAlignedEffectiveIndexBufferOffset Indicates that effective
+ index buffer offsets (\c{indexOffset + firstIndex * indexComponentSize})
+ that are not 4 byte aligned are supported. When not supported, attempting
+ to issue a \l{QRhiCommandBuffer::drawIndexed()}{drawIndexed()} with a
+ non-aligned effective offset may lead to unspecified behavior.
+
+ \value NPOTTextureRepeat Indicates that the
+ \l{QRhiSampler::Repeat}{Repeat} wrap mode and mipmap filtering modes are
+ supported for textures with a non-power-of-two size. In practice this can
+ only be false with OpenGL ES 2.0 implementations without
+ \c{GL_OES_texture_npot}.
+
+ \value RedOrAlpha8IsRed Indicates that the
+ \l{QRhiTexture::RED_OR_ALPHA8}{RED_OR_ALPHA8} format maps to a one
+ component 8-bit \c red format. This is the case for all backends except
+ OpenGL, where \c{GL_ALPHA}, a one component 8-bit \c alpha format, is used
+ instead. This is relevant for shader code that samples from the texture.
+
+ \value ElementIndexUint Indicates that 32-bit unsigned integer elements are
+ supported in the index buffer. In practice this is true everywhere except
+ when running on plain OpenGL ES 2.0 implementations without the necessary
+ extension. When false, only 16-bit unsigned elements are supported in the
+ index buffer.
+
+ \value Compute Indicates that compute shaders, image load/store, and
+ storage buffers are supported.
+
+ \value WideLines Indicates that lines with a width other than 1 are
+ supported. When reported as not supported, the line width set on the
+ graphics pipeline state is ignored. This can always be false with some
+ backends (D3D11, Metal). With Vulkan, the value depends on the
+ implementation.
+
+ \value VertexShaderPointSize Indicates that the size of rasterized points
+ set via \c{gl_PointSize} in the vertex shader is taken into account. When
+ reported as not supported, drawing points with a size other than 1 is not
+ supported. Setting \c{gl_PointSize} in the shader is still valid then, but
+ is ignored. (for example, when generating HLSL, the assignment is silently
+ dropped from the generated code) Note that some APIs (Metal, Vulkan)
+ require the point size to be set in the shader explicitly whenever drawing
+ points, even when the size is 1, as they do not automatically default to 1.
+
+ \value BaseVertex Indicates that \l{QRhiCommandBuffer::drawIndexed()}{drawIndexed()}
+ supports the \c vertexOffset argument. When reported as not supported, the
+ vertexOffset value in an indexed draw is ignored.
+
+ \value BaseInstance Indicates that instanced draw commands support the \c
+ firstInstance argument. When reported as not supported, the firstInstance
+ value is ignored and the instance ID starts from 0.
+
+ \value TriangleFanTopology Indicates that QRhiGraphicsPipeline::setTopology()
+ supports QRhiGraphicsPipeline::TriangleFan.
+
+ \value ReadBackNonUniformBuffer Indicates that
+ \l{QRhiResourceUpdateBatch::readBackBuffer()}{reading buffer contents} is
+ supported for QRhiBuffer instances with a usage different than
+ UniformBuffer. While this is supported in the majority of cases, it will be
+ unsupported with OpenGL ES older than 3.0.
+
+ \value ReadBackNonBaseMipLevel Indicates that specifying a mip level other
+ than 0 is supported when reading back texture contents. When not supported,
+ specifying a non-zero level in QRhiReadbackDescription leads to returning
+ an all-zero image. In practice this feature will be unsupported with OpenGL
+ ES 2.0, while it will likely be supported everywhere else.
+ */
+
+/*!
+ \enum QRhi::BeginFrameFlag
+ Flag values for QRhi::beginFrame()
+
+ \value ExternalContentsInPass Specifies that one or more render or compute
+ passes in this frame will call QRhiCommandBuffer::beginExternal(). Some
+ backends, Vulkan in particular, will fail if this flag is not set and
+ beginExternal() is still called.
+ */
+
+/*!
+ \enum QRhi::EndFrameFlag
+ Flag values for QRhi::endFrame()
+
+ \value SkipPresent Specifies that no present command is to be queued or no
+ swapBuffers call is to be made. This way no image is presented. Generating
+ multiple frames with all having this flag set is not recommended (except,
+ for example, for benchmarking purposes - but keep in mind that backends may
+ behave differently when it comes to waiting for command completion without
+ presenting so the results are not comparable between them)
+ */
+
+/*!
+ \enum QRhi::ResourceLimit
+ Describes the resource limit to query.
+
+ \value TextureSizeMin Minimum texture width and height. This is typically
+ 1. The minimum texture size is handled gracefully, meaning attempting to
+ create a texture with an empty size will instead create a texture with the
+ minimum size.
+
+ \value TextureSizeMax Maximum texture width and height. This depends on the
+ graphics API and sometimes the platform or implementation as well.
+ Typically the value is in the range 4096 - 16384. Attempting to create
+ textures larger than this is expected to fail.
+
+ \value MaxColorAttachments The maximum number of color attachments for a
+ QRhiTextureRenderTarget, in case multiple render targets are supported. When
+ MRT is not supported, the value is 1. Otherwise this is typically 8, but
+ watch out for the fact that OpenGL only mandates 4 as the minimum, and that
+ is what some OpenGL ES implementations provide.
+
+ \value FramesInFlight The number of frames the backend may keep "in
+ flight". The value has no relevance, and is unspecified, with backends like
+ OpenGL and Direct3D 11. With backends like Vulkan or Metal, it is the
+ responsibility of QRhi to block whenever starting a new frame and finding
+ the CPU is already \c{N - 1} frames ahead of the GPU (because the command
+ buffer submitted in frame no. \c{current} - \c{N} has not yet completed).
+ The value N is what is returned from here, and is typically 2. This can be
+ relevant to applications that integrate rendering done directly with the
+ graphics API, as such rendering code may want to perform double (if the
+ value is 2) buffering for resources, such as, buffers, similarly to the
+ QRhi backends themselves. The current frame slot index (a value running 0,
+ 1, .., N-1, then wrapping around) is retrievable from
+ QRhi::currentFrameSlot().
+ */
+
+/*!
+ \class QRhiInitParams
+ \internal
+ \inmodule QtGui
+ \brief Base class for backend-specific initialization parameters.
+
+ Contains fields that are relevant to all backends.
+ */
+
+/*!
+ \class QRhiDepthStencilClearValue
+ \internal
+ \inmodule QtGui
+ \brief Specifies clear values for a depth or stencil buffer.
+ */
+
+/*!
+ \fn QRhiDepthStencilClearValue::QRhiDepthStencilClearValue()
+
+ Constructs a depth/stencil clear value with depth clear value 1.0f and
+ stencil clear value 0.
+ */
+
+/*!
+ Constructs a depth/stencil clear value with depth clear value \a d and
+ stencil clear value \a s.
+ */
+QRhiDepthStencilClearValue::QRhiDepthStencilClearValue(float d, quint32 s)
+ : m_d(d),
+ m_s(s)
+{
+}
+
+/*!
+ \return \c true if the values in the two QRhiDepthStencilClearValue objects
+ \a a and \a b are equal.
+
+ \relates QRhiDepthStencilClearValue
+ */
+bool operator==(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) Q_DECL_NOTHROW
+{
+ return a.depthClearValue() == b.depthClearValue()
+ && a.stencilClearValue() == b.stencilClearValue();
+}
+
+/*!
+ \return \c false if the values in the two QRhiDepthStencilClearValue
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiDepthStencilClearValue
+*/
+bool operator!=(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiDepthStencilClearValue
+ */
+uint qHash(const QRhiDepthStencilClearValue &v, uint seed) Q_DECL_NOTHROW
+{
+ return seed * (uint(qFloor(qreal(v.depthClearValue()) * 100)) + v.stencilClearValue());
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiDepthStencilClearValue &v)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QRhiDepthStencilClearValue(depth-clear=" << v.depthClearValue()
+ << " stencil-clear=" << v.stencilClearValue()
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiViewport
+ \internal
+ \inmodule QtGui
+ \brief Specifies a viewport rectangle.
+
+ Used with QRhiCommandBuffer::setViewport().
+
+ QRhi assumes OpenGL-style viewport coordinates, meaning x and y are
+ bottom-left. Negative width or height are not allowed.
+
+ Typical usage is like the following:
+
+ \badcode
+ const QSize outputSizeInPixels = swapchain->currentPixelSize();
+ const QRhiViewport viewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height());
+ cb->beginPass(swapchain->currentFrameRenderTarget(), { 0, 0, 0, 1 }, { 1, 0 });
+ cb->setGraphicsPipeline(ps);
+ cb->setViewport(viewport);
+ ...
+ \endcode
+
+ \sa QRhiCommandBuffer::setViewport(), QRhi::clipSpaceCorrMatrix(), QRhiScissor
+ */
+
+/*!
+ \fn QRhiViewport::QRhiViewport()
+
+ Constructs a viewport description with an empty rectangle and a depth range
+ of 0.0f - 1.0f.
+
+ \sa QRhi::clipSpaceCorrMatrix()
+ */
+
+/*!
+ Constructs a viewport description with the rectangle specified by \a x, \a
+ y, \a w, \a h and the depth range \a minDepth and \a maxDepth.
+
+ \note \a x and \a y are assumed to be the bottom-left position. \a w and \a
+ h should not be negative, the viewport will be ignored by
+ QRhiCommandBuffer::setViewport() otherwise.
+
+ \sa QRhi::clipSpaceCorrMatrix()
+ */
+QRhiViewport::QRhiViewport(float x, float y, float w, float h, float minDepth, float maxDepth)
+ : m_rect { { x, y, w, h } },
+ m_minDepth(minDepth),
+ m_maxDepth(maxDepth)
+{
+}
+
+/*!
+ \return \c true if the values in the two QRhiViewport objects
+ \a a and \a b are equal.
+
+ \relates QRhiViewport
+ */
+bool operator==(const QRhiViewport &a, const QRhiViewport &b) Q_DECL_NOTHROW
+{
+ return a.viewport() == b.viewport()
+ && a.minDepth() == b.minDepth()
+ && a.maxDepth() == b.maxDepth();
+}
+
+/*!
+ \return \c false if the values in the two QRhiViewport
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiViewport
+*/
+bool operator!=(const QRhiViewport &a, const QRhiViewport &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiViewport
+ */
+uint qHash(const QRhiViewport &v, uint seed) Q_DECL_NOTHROW
+{
+ const std::array<float, 4> r = v.viewport();
+ return seed + uint(r[0]) + uint(r[1]) + uint(r[2]) + uint(r[3])
+ + uint(qFloor(qreal(v.minDepth()) * 100)) + uint(qFloor(qreal(v.maxDepth()) * 100));
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiViewport &v)
+{
+ QDebugStateSaver saver(dbg);
+ const std::array<float, 4> r = v.viewport();
+ dbg.nospace() << "QRhiViewport(bottom-left-x=" << r[0]
+ << " bottom-left-y=" << r[1]
+ << " width=" << r[2]
+ << " height=" << r[3]
+ << " minDepth=" << v.minDepth()
+ << " maxDepth=" << v.maxDepth()
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiScissor
+ \internal
+ \inmodule QtGui
+ \brief Specifies a scissor rectangle.
+
+ Used with QRhiCommandBuffer::setScissor(). Setting a scissor rectangle is
+ only possible with a QRhiGraphicsPipeline that has
+ QRhiGraphicsPipeline::UsesScissor set.
+
+ QRhi assumes OpenGL-style scissor coordinates, meaning x and y are
+ bottom-left. Negative width or height are not allowed. However, apart from
+ that, the flexible OpenGL semantics apply: negative x and y, partially out
+ of bounds rectangles, etc. will be handled gracefully, clamping as
+ appropriate. Therefore, any rendering logic targeting OpenGL can feed
+ scissor rectangles into QRhiScissor as-is, without any adaptation.
+
+ \sa QRhiCommandBuffer::setScissor(), QRhiViewport
+ */
+
+/*!
+ \fn QRhiScissor::QRhiScissor()
+
+ Constructs an empty scissor.
+ */
+
+/*!
+ Constructs a scissor with the rectangle specified by \a x, \a y, \a w, and
+ \a h.
+
+ \note \a x and \a y are assumed to be the bottom-left position. Negative \a w
+ or \a h are not allowed, such scissor rectangles will be ignored by
+ QRhiCommandBuffer. Other than that, the flexible OpenGL semantics apply:
+ negative x and y, partially out of bounds rectangles, etc. will be handled
+ gracefully, clamping as appropriate.
+ */
+QRhiScissor::QRhiScissor(int x, int y, int w, int h)
+ : m_rect { { x, y, w, h } }
+{
+}
+
+/*!
+ \return \c true if the values in the two QRhiScissor objects
+ \a a and \a b are equal.
+
+ \relates QRhiScissor
+ */
+bool operator==(const QRhiScissor &a, const QRhiScissor &b) Q_DECL_NOTHROW
+{
+ return a.scissor() == b.scissor();
+}
+
+/*!
+ \return \c false if the values in the two QRhiScissor
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiScissor
+*/
+bool operator!=(const QRhiScissor &a, const QRhiScissor &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiScissor
+ */
+uint qHash(const QRhiScissor &v, uint seed) Q_DECL_NOTHROW
+{
+ const std::array<int, 4> r = v.scissor();
+ return seed + uint(r[0]) + uint(r[1]) + uint(r[2]) + uint(r[3]);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiScissor &s)
+{
+ QDebugStateSaver saver(dbg);
+ const std::array<int, 4> r = s.scissor();
+ dbg.nospace() << "QRhiScissor(bottom-left-x=" << r[0]
+ << " bottom-left-y=" << r[1]
+ << " width=" << r[2]
+ << " height=" << r[3]
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiVertexInputBinding
+ \internal
+ \inmodule QtGui
+ \brief Describes a vertex input binding.
+
+ Specifies the stride (in bytes, must be a multiple of 4), the
+ classification and optionally the instance step rate.
+
+ As an example, assume a vertex shader with the following inputs:
+
+ \badcode
+ layout(location = 0) in vec4 position;
+ layout(location = 1) in vec2 texcoord;
+ \endcode
+
+ Now let's assume also that 3 component vertex positions \c{(x, y, z)} and 2
+ component texture coordinates \c{(u, v)} are provided in a non-interleaved
+ format in a buffer (or separate buffers even). Definining two bindings
+ could then be done like this:
+
+ \badcode
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ \endcode
+
+ Only the stride is interesting here since instancing is not used. The
+ binding number is given by the index of the QRhiVertexInputBinding
+ element in the bindings vector of the QRhiVertexInputLayout.
+
+ Once a graphics pipeline with this vertex input layout is bound, the vertex
+ inputs could be set up like the following for drawing a cube with 36
+ vertices, assuming we have a single buffer with first the positions and
+ then the texture coordinates:
+
+ \badcode
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { cubeBuf, 0 },
+ { cubeBuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ \endcode
+
+ Note how the index defined by \c {startBinding + i}, where \c i is the
+ index in the second argument of
+ \l{QRhiCommandBuffer::setVertexInput()}{setVertexInput()}, matches the
+ index of the corresponding entry in the \c bindings vector of the
+ QRhiVertexInputLayout.
+
+ \note the stride must always be a multiple of 4.
+
+ \sa QRhiCommandBuffer::setVertexInput()
+ */
+
+/*!
+ \enum QRhiVertexInputBinding::Classification
+ Describes the input data classification.
+
+ \value PerVertex Data is per-vertex
+ \value PerInstance Data is per-instance
+ */
+
+/*!
+ \fn QRhiVertexInputBinding::QRhiVertexInputBinding()
+
+ Constructs a default vertex input binding description.
+ */
+
+/*!
+ Constructs a vertex input binding description with the specified \a stride,
+ classification \a cls, and instance step rate \a stepRate.
+
+ \note \a stepRate other than 1 is only supported when
+ QRhi::CustomInstanceStepRate is reported to be supported.
+ */
+QRhiVertexInputBinding::QRhiVertexInputBinding(quint32 stride, Classification cls, int stepRate)
+ : m_stride(stride),
+ m_classification(cls),
+ m_instanceStepRate(stepRate)
+{
+}
+
+/*!
+ \return \c true if the values in the two QRhiVertexInputBinding objects
+ \a a and \a b are equal.
+
+ \relates QRhiVertexInputBinding
+ */
+bool operator==(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) Q_DECL_NOTHROW
+{
+ return a.stride() == b.stride()
+ && a.classification() == b.classification()
+ && a.instanceStepRate() == b.instanceStepRate();
+}
+
+/*!
+ \return \c false if the values in the two QRhiVertexInputBinding
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiVertexInputBinding
+*/
+bool operator!=(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiVertexInputBinding
+ */
+uint qHash(const QRhiVertexInputBinding &v, uint seed) Q_DECL_NOTHROW
+{
+ return seed + v.stride() + v.classification();
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiVertexInputBinding &b)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QRhiVertexInputBinding(stride=" << b.stride()
+ << " cls=" << b.classification()
+ << " step-rate=" << b.instanceStepRate()
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiVertexInputAttribute
+ \internal
+ \inmodule QtGui
+ \brief Describes a single vertex input element.
+
+ The members specify the binding number, location, format, and offset for a
+ single vertex input element.
+
+ \note For HLSL it is assumed that the vertex shader uses
+ \c{TEXCOORD<location>} as the semantic for each input. Hence no separate
+ semantic name and index.
+
+ As an example, assume a vertex shader with the following inputs:
+
+ \badcode
+ layout(location = 0) in vec4 position;
+ layout(location = 1) in vec2 texcoord;
+ \endcode
+
+ Now let's assume that we have 3 component vertex positions \c{(x, y, z)}
+ and 2 component texture coordinates \c{(u, v)} are provided in a
+ non-interleaved format in a buffer (or separate buffers even). Once two
+ bindings are defined, the attributes could be specified as:
+
+ \badcode
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+ \endcode
+
+ Once a graphics pipeline with this vertex input layout is bound, the vertex
+ inputs could be set up like the following for drawing a cube with 36
+ vertices, assuming we have a single buffer with first the positions and
+ then the texture coordinates:
+
+ \badcode
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { cubeBuf, 0 },
+ { cubeBuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ \endcode
+
+ When working with interleaved data, there will typically be just one
+ binding, with multiple attributes referring to that same buffer binding
+ point:
+
+ \badcode
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 3 * sizeof(float) }
+ });
+ \endcode
+
+ and then:
+
+ \badcode
+ const QRhiCommandBuffer::VertexInput vbufBinding(interleavedCubeBuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ \endcode
+
+ \sa QRhiCommandBuffer::setVertexInput()
+ */
+
+/*!
+ \enum QRhiVertexInputAttribute::Format
+ Specifies the type of the element data.
+
+ \value Float4 Four component float vector
+ \value Float3 Three component float vector
+ \value Float2 Two component float vector
+ \value Float Float
+ \value UNormByte4 Four component normalized unsigned byte vector
+ \value UNormByte2 Two component normalized unsigned byte vector
+ \value UNormByte Normalized unsigned byte
+ */
+
+/*!
+ \fn QRhiVertexInputAttribute::QRhiVertexInputAttribute()
+
+ Constructs a default vertex input attribute description.
+ */
+
+/*!
+ Constructs a vertex input attribute description with the specified \a
+ binding number, \a location, \a format, and \a offset.
+ */
+QRhiVertexInputAttribute::QRhiVertexInputAttribute(int binding, int location, Format format, quint32 offset)
+ : m_binding(binding),
+ m_location(location),
+ m_format(format),
+ m_offset(offset)
+{
+}
+
+/*!
+ \return \c true if the values in the two QRhiVertexInputAttribute objects
+ \a a and \a b are equal.
+
+ \relates QRhiVertexInputAttribute
+ */
+bool operator==(const QRhiVertexInputAttribute &a, const QRhiVertexInputAttribute &b) Q_DECL_NOTHROW
+{
+ return a.binding() == b.binding()
+ && a.location() == b.location()
+ && a.format() == b.format()
+ && a.offset() == b.offset();
+}
+
+/*!
+ \return \c false if the values in the two QRhiVertexInputAttribute
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiVertexInputAttribute
+*/
+bool operator!=(const QRhiVertexInputAttribute &a, const QRhiVertexInputAttribute &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiVertexInputAttribute
+ */
+uint qHash(const QRhiVertexInputAttribute &v, uint seed) Q_DECL_NOTHROW
+{
+ return seed + uint(v.binding()) + uint(v.location()) + uint(v.format()) + v.offset();
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiVertexInputAttribute &a)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QRhiVertexInputAttribute(binding=" << a.binding()
+ << " location=" << a.location()
+ << " format=" << a.format()
+ << " offset=" << a.offset()
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiVertexInputLayout
+ \internal
+ \inmodule QtGui
+ \brief Describes the layout of vertex inputs consumed by a vertex shader.
+
+ The vertex input layout is defined by the collections of
+ QRhiVertexInputBinding and QRhiVertexInputAttribute.
+ */
+
+/*!
+ \fn QRhiVertexInputLayout::QRhiVertexInputLayout()
+
+ Constructs an empty vertex input layout description.
+ */
+
+/*!
+ \return \c true if the values in the two QRhiVertexInputLayout objects
+ \a a and \a b are equal.
+
+ \relates QRhiVertexInputLayout
+ */
+bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) Q_DECL_NOTHROW
+{
+ return a.m_bindings == b.m_bindings && a.m_attributes == b.m_attributes;
+}
+
+/*!
+ \return \c false if the values in the two QRhiVertexInputLayout
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiVertexInputLayout
+*/
+bool operator!=(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiVertexInputLayout
+ */
+uint qHash(const QRhiVertexInputLayout &v, uint seed) Q_DECL_NOTHROW
+{
+ return qHash(v.m_bindings, seed) + qHash(v.m_attributes, seed);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+template<typename T, int N>
+QDebug operator<<(QDebug dbg, const QVarLengthArray<T, N> &vla)
+{
+ return QtPrivate::printSequentialContainer(dbg, "VLA", vla);
+}
+
+QDebug operator<<(QDebug dbg, const QRhiVertexInputLayout &v)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QRhiVertexInputLayout(bindings=" << v.m_bindings
+ << " attributes=" << v.m_attributes
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiShaderStage
+ \internal
+ \inmodule QtGui
+ \brief Specifies the type and the shader code for a shader stage in the pipeline.
+ */
+
+/*!
+ \enum QRhiShaderStage::Type
+ Specifies the type of the shader stage.
+
+ \value Vertex Vertex stage
+ \value Fragment Fragment (pixel) stage
+ \value Compute Compute stage (this may not always be supported at run time)
+ */
+
+/*!
+ \fn QRhiShaderStage::QRhiShaderStage()
+
+ Constructs a shader stage description for the vertex stage with an empty
+ QShader.
+ */
+
+/*!
+ Constructs a shader stage description with the \a type of the stage and the
+ \a shader.
+
+ The shader variant \a v defaults to QShader::StandardShader. A
+ QShader contains multiple source and binary versions of a shader.
+ In addition, it can also contain variants of the shader with slightly
+ modified code. \a v can then be used to select the desired variant.
+ */
+QRhiShaderStage::QRhiShaderStage(Type type, const QShader &shader, QShader::Variant v)
+ : m_type(type),
+ m_shader(shader),
+ m_shaderVariant(v)
+{
+}
+
+/*!
+ \return \c true if the values in the two QRhiShaderStage objects
+ \a a and \a b are equal.
+
+ \relates QRhiShaderStage
+ */
+bool operator==(const QRhiShaderStage &a, const QRhiShaderStage &b) Q_DECL_NOTHROW
+{
+ return a.type() == b.type()
+ && a.shader() == b.shader()
+ && a.shaderVariant() == b.shaderVariant();
+}
+
+/*!
+ \return \c false if the values in the two QRhiShaderStage
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiShaderStage
+*/
+bool operator!=(const QRhiShaderStage &a, const QRhiShaderStage &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a v, using \a seed to seed the calculation.
+
+ \relates QRhiShaderStage
+ */
+uint qHash(const QRhiShaderStage &v, uint seed) Q_DECL_NOTHROW
+{
+ return v.type() + qHash(v.shader(), seed) + v.shaderVariant();
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiShaderStage &s)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QRhiShaderStage(type=" << s.type()
+ << " shader=" << s.shader()
+ << " variant=" << s.shaderVariant()
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiColorAttachment
+ \internal
+ \inmodule QtGui
+ \brief Describes the a single color attachment of a render target.
+
+ A color attachment is either a QRhiTexture or a QRhiRenderBuffer. The
+ former, when texture() is set, is used in most cases.
+
+ \note texture() and renderBuffer() cannot be both set (be non-null at the
+ same time).
+
+ Setting renderBuffer instead is recommended only when multisampling is
+ needed. Relying on QRhi::MultisampleRenderBuffer is a better choice than
+ QRhi::MultisampleTexture in practice since the former is available in more
+ run time configurations (e.g. when running on OpenGL ES 3.0 which has no
+ support for multisample textures, but does support multisample
+ renderbuffers).
+
+ When targeting a non-multisample texture, the layer() and level()
+ indicate the targeted layer (face index \c{0-5} for cubemaps) and mip
+ level.
+
+ When texture() or renderBuffer() is multisample, resolveTexture() can be
+ set optionally. When set, samples are resolved automatically into that
+ (non-multisample) texture at the end of the render pass. When rendering
+ into a multisample renderbuffers, this is the only way to get resolved,
+ non-multisample content out of them. Multisample textures allow sampling in
+ shaders so for them this is just one option.
+
+ \note when resolving is enabled, the multisample data may not be written
+ out at all. This means that the multisample texture() must not be used
+ afterwards with shaders for sampling when resolveTexture() is set.
+ */
+
+/*!
+ \fn QRhiColorAttachment::QRhiColorAttachment()
+
+ Constructs an empty color attachment description.
+ */
+
+/*!
+ Constructs a color attachment description that specifies \a texture as the
+ associated color buffer.
+ */
+QRhiColorAttachment::QRhiColorAttachment(QRhiTexture *texture)
+ : m_texture(texture)
+{
+}
+
+/*!
+ Constructs a color attachment description that specifies \a renderBuffer as
+ the associated color buffer.
+ */
+QRhiColorAttachment::QRhiColorAttachment(QRhiRenderBuffer *renderBuffer)
+ : m_renderBuffer(renderBuffer)
+{
+}
+
+/*!
+ \class QRhiTextureRenderTargetDescription
+ \internal
+ \inmodule QtGui
+ \brief Describes the color and depth or depth/stencil attachments of a render target.
+
+ A texture render target has zero or more textures as color attachments,
+ zero or one renderbuffer as combined depth/stencil buffer or zero or one
+ texture as depth buffer.
+
+ \note depthStencilBuffer() and depthTexture() cannot be both set (cannot be
+ non-null at the same time).
+ */
+
+/*!
+ \fn QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription()
+
+ Constructs an empty texture render target description.
+ */
+
+/*!
+ Constructs a texture render target description with one attachment
+ described by \a colorAttachment.
+ */
+QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment)
+{
+ m_colorAttachments.append(colorAttachment);
+}
+
+/*!
+ Constructs a texture render target description with two attachments, a
+ color attachment described by \a colorAttachment, and a depth/stencil
+ attachment with \a depthStencilBuffer.
+ */
+QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment,
+ QRhiRenderBuffer *depthStencilBuffer)
+ : m_depthStencilBuffer(depthStencilBuffer)
+{
+ m_colorAttachments.append(colorAttachment);
+}
+
+/*!
+ Constructs a texture render target description with two attachments, a
+ color attachment described by \a colorAttachment, and a depth attachment
+ with \a depthTexture.
+
+ \note \a depthTexture must have a suitable format, such as QRhiTexture::D16
+ or QRhiTexture::D32F.
+ */
+QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment,
+ QRhiTexture *depthTexture)
+ : m_depthTexture(depthTexture)
+{
+ m_colorAttachments.append(colorAttachment);
+}
+
+/*!
+ \class QRhiTextureSubresourceUploadDescription
+ \internal
+ \inmodule QtGui
+ \brief Describes the source for one mip level in a layer in a texture upload operation.
+
+ The source content is specified either as a QImage or as a raw blob. The
+ former is only allowed for uncompressed textures with a format that can be
+ mapped to QImage, while the latter is supported for all formats, including
+ floating point and compressed.
+
+ \note image() and data() cannot be both set at the same time.
+
+ destinationTopLeft() specifies the top-left corner of the target
+ rectangle. Defaults to (0, 0).
+
+ An empty sourceSize() (the default) indicates that size is assumed to be
+ the size of the subresource. With QImage-based uploads this implies that
+ the size of the source image() must match the subresource. When providing
+ raw data instead, sufficient number of bytes must be provided in data().
+
+ \note With compressed textures the first upload must always match the
+ subresource size due to graphics API limitations with some backends.
+
+ sourceTopLeft() is supported only for QImage-based uploads, and specifies
+ the top-left corner of the source rectangle.
+
+ \note Setting sourceSize() or sourceTopLeft() may trigger a QImage copy
+ internally, depending on the format and the backend.
+
+ When providing raw data, the stride (row pitch, row length in bytes) of the
+ provided data must be equal to \c{width * pixelSize} where \c pixelSize is
+ the number of bytes used for one pixel, and there must be no additional
+ padding between rows. There is no row start alignment requirement.
+
+ \note The format of the source data must be compatible with the texture
+ format. With many graphics APIs the data is copied as-is into a staging
+ buffer, there is no intermediate format conversion provided by QRhi. This
+ applies to floating point formats as well, with, for example, RGBA16F
+ requiring half floats in the source data.
+ */
+
+/*!
+ \fn QRhiTextureSubresourceUploadDescription::QRhiTextureSubresourceUploadDescription()
+
+ Constructs an empty subresource description.
+
+ \note an empty QRhiTextureSubresourceUploadDescription is not useful on its
+ own and should not be submitted to a QRhiTextureUploadEntry. At minimum
+ image or data must be set first.
+ */
+
+/*!
+ Constructs a mip level description with a \a image.
+
+ The \l{QImage::size()}{size} of \a image must match the size of the mip
+ level. For level 0 that is the \l{QRhiTexture::pixelSize()}{texture size}.
+
+ The bit depth of \a image must be compatible with the
+ \l{QRhiTexture::Format}{texture format}.
+
+ To describe a partial upload, call setSourceSize(), setSourceTopLeft(), or
+ setDestinationTopLeft() afterwards.
+ */
+QRhiTextureSubresourceUploadDescription::QRhiTextureSubresourceUploadDescription(const QImage &image)
+ : m_image(image)
+{
+}
+
+/*!
+ Constructs a mip level description with the image data is specified by \a
+ data and \a size. This is suitable for floating point and compressed
+ formats as well.
+
+ \a data can safely be destroyed or changed once this function returns.
+ */
+QRhiTextureSubresourceUploadDescription::QRhiTextureSubresourceUploadDescription(const void *data, int size)
+ : m_data(reinterpret_cast<const char *>(data), size)
+{
+}
+
+/*!
+ \class QRhiTextureUploadEntry
+ \internal
+ \inmodule QtGui
+ \brief Describes one layer (face for cubemaps) in a texture upload operation.
+ */
+
+/*!
+ \fn QRhiTextureUploadEntry::QRhiTextureUploadEntry()
+
+ Constructs an empty QRhiTextureUploadEntry targeting layer 0 and level 0.
+
+ \note an empty QRhiTextureUploadEntry should not be submitted without
+ setting a QRhiTextureSubresourceUploadDescription via setDescription()
+ first.
+ */
+
+/*!
+ Constructs a QRhiTextureUploadEntry targeting the given \a layer and mip
+ \a level, with the subresource contents described by \a desc.
+ */
+QRhiTextureUploadEntry::QRhiTextureUploadEntry(int layer, int level,
+ const QRhiTextureSubresourceUploadDescription &desc)
+ : m_layer(layer),
+ m_level(level),
+ m_desc(desc)
+{
+}
+
+/*!
+ \class QRhiTextureUploadDescription
+ \internal
+ \inmodule QtGui
+ \brief Describes a texture upload operation.
+
+ Used with QRhiResourceUpdateBatch::uploadTexture(). That function has two
+ variants: one taking a QImage and one taking a
+ QRhiTextureUploadDescription. The former is a convenience version,
+ internally creating a QRhiTextureUploadDescription with a single image
+ targeting level 0 for layer 0. However, when cubemaps, pre-generated mip
+ images, or compressed textures are involved, applications will have to work
+ directly with this class instead.
+
+ QRhiTextureUploadDescription also enables specifying batched uploads, which
+ are useful for example when generating an atlas or glyph cache texture:
+ multiple, partial uploads for the same subresource (meaning the same layer
+ and level) are supported, and can be, depending on the backend and the
+ underlying graphics API, more efficient when batched into the same
+ QRhiTextureUploadDescription as opposed to issuing individual
+ \l{QRhiResourceUpdateBatch::uploadTexture()}{uploadTexture()} commands for
+ each of them.
+
+ \note Cubemaps have one layer for each of the six faces in the order +X,
+ -X, +Y, -Y, +Z, -Z.
+
+ For example, specifying the faces of a cubemap could look like the following:
+
+ \badcode
+ QImage faces[6];
+ ...
+ QVector<QRhiTextureUploadEntry> entries;
+ for (int i = 0; i < 6; ++i)
+ entries.append(QRhiTextureUploadEntry(i, 0, faces[i]));
+ QRhiTextureUploadDescription desc(entries);
+ resourceUpdates->uploadTexture(texture, desc);
+ \endcode
+
+ Another example that specifies mip images for a compressed texture:
+
+ \badcode
+ QRhiTextureUploadDescription desc;
+ const int mipCount = rhi->mipLevelsForSize(compressedTexture->pixelSize());
+ for (int level = 0; level < mipCount; ++level) {
+ const QByteArray compressedDataForLevel = ..
+ desc.append(QRhiTextureUploadEntry(0, level, compressedDataForLevel));
+ }
+ resourceUpdates->uploadTexture(compressedTexture, desc);
+ \endcode
+
+ With partial uploads targeting the same subresource, it is recommended to
+ batch them into a single upload request, whenever possible:
+
+ \badcode
+ QRhiTextureSubresourceUploadDescription subresDesc(image);
+ subresDesc.setSourceSize(QSize(10, 10));
+ subResDesc.setDestinationTopLeft(QPoint(50, 40));
+ QRhiTextureUploadEntry entry(0, 0, subresDesc); // layer 0, level 0
+
+ QRhiTextureSubresourceUploadDescription subresDesc2(image);
+ subresDesc2.setSourceSize(QSize(30, 40));
+ subResDesc2.setDestinationTopLeft(QPoint(100, 200));
+ QRhiTextureUploadEntry entry2(0, 0, subresDesc2); // layer 0, level 0, i.e. same subresource
+
+ QRhiTextureUploadDescription desc({ entry, entry2});
+ resourceUpdates->uploadTexture(texture, desc);
+ \endcode
+ */
+
+/*!
+ \fn QRhiTextureUploadDescription::QRhiTextureUploadDescription()
+
+ Constructs an empty texture upload description.
+ */
+
+/*!
+ Constructs a texture upload description with a single subresource upload
+ described by \a entry.
+ */
+QRhiTextureUploadDescription::QRhiTextureUploadDescription(const QRhiTextureUploadEntry &entry)
+{
+ m_entries.append(entry);
+}
+
+/*!
+ Constructs a texture upload description with the specified \a list of entries.
+
+ \note \a list can also contain multiple QRhiTextureUploadEntry elements
+ with the the same layer and level. This makes sense when those uploads are
+ partial, meaning their subresource description has a source size or image
+ smaller than the subresource dimensions, and can be more efficient than
+ issuing separate uploadTexture()'s.
+ */
+QRhiTextureUploadDescription::QRhiTextureUploadDescription(std::initializer_list<QRhiTextureUploadEntry> list)
+ : m_entries(list)
+{
+}
+
+/*!
+ \class QRhiTextureCopyDescription
+ \internal
+ \inmodule QtGui
+ \brief Describes a texture-to-texture copy operation.
+
+ An empty pixelSize() indicates that the entire subresource is to be copied.
+ A default constructed copy description therefore leads to copying the
+ entire subresource at level 0 of layer 0.
+
+ \note The source texture must be created with
+ QRhiTexture::UsedAsTransferSource.
+
+ \note The source and destination rectangles defined by pixelSize(),
+ sourceTopLeft(), and destinationTopLeft() must fit the source and
+ destination textures, respectively. The behavior is undefined otherwise.
+ */
+
+/*!
+ \fn QRhiTextureCopyDescription::QRhiTextureCopyDescription()
+
+ Constructs an empty texture copy description.
+ */
+
+/*!
+ \class QRhiReadbackDescription
+ \internal
+ \inmodule QtGui
+ \brief Describes a readback (reading back texture contents from possibly GPU-only memory) operation.
+
+ The source of the readback operation is either a QRhiTexture or the
+ current backbuffer of the currently targeted QRhiSwapChain. When
+ texture() is not set, the swapchain is used. Otherwise the specified
+ QRhiTexture is treated as the source.
+
+ \note Textures used in readbacks must be created with
+ QRhiTexture::UsedAsTransferSource.
+
+ \note Swapchains used in readbacks must be created with
+ QRhiSwapChain::UsedAsTransferSource.
+
+ layer() and level() are only applicable when the source is a QRhiTexture.
+
+ \note Multisample textures cannot be read back. Readbacks are supported for
+ multisample swapchain buffers however.
+ */
+
+/*!
+ \fn QRhiReadbackDescription::QRhiReadbackDescription()
+
+ Constructs an empty texture readback description.
+
+ \note The source texture is set to null by default, which is still a valid
+ readback: it specifies that the backbuffer of the current swapchain is to
+ be read back. (current meaning the frame's target swapchain at the time of
+ committing the QRhiResourceUpdateBatch with the
+ \l{QRhiResourceUpdateBatch::readBackTexture()}{texture readback} on it)
+ */
+
+/*!
+ Constructs an texture readback description that specifies that level 0 of
+ layer 0 of \a texture is to be read back.
+
+ \note \a texture can also be null in which case this constructor is
+ identical to the argumentless variant.
+ */
+QRhiReadbackDescription::QRhiReadbackDescription(QRhiTexture *texture)
+ : m_texture(texture)
+{
+}
+
+/*!
+ \class QRhiReadbackResult
+ \internal
+ \inmodule QtGui
+ \brief Describes the results of a potentially asynchronous readback operation.
+
+ When \l completed is set, the function is invoked when the \l data is
+ available. \l format and \l pixelSize are set upon completion together with
+ \l data.
+ */
+
+/*!
+ \class QRhiNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Base class for classes exposing backend-specific collections of native resource objects.
+ */
+
+/*!
+ \class QRhiResource
+ \internal
+ \inmodule QtGui
+ \brief Base class for classes encapsulating native resource objects.
+ */
+
+/*!
+ \fn QRhiResource::Type QRhiResource::resourceType() const
+
+ \return the type of the resource.
+ */
+
+/*!
+ \internal
+ */
+QRhiResource::QRhiResource(QRhiImplementation *rhi)
+ : m_rhi(rhi)
+{
+ m_id = QRhiGlobalObjectIdGenerator::newId();
+}
+
+/*!
+ Destructor.
+
+ Releases (or requests deferred releasing of) the underlying native graphics
+ resources, if there are any.
+
+ \note Resources referenced by commands for the current frame should not be
+ released until the frame is submitted by QRhi::endFrame().
+
+ \sa release()
+ */
+QRhiResource::~QRhiResource()
+{
+ // release() cannot be called here, it being virtual; it is up to the
+ // subclasses to do that.
+}
+
+/*!
+ \fn void QRhiResource::release()
+
+ Releases (or requests deferred releasing of) the underlying native graphics
+ resources. Safe to call multiple times, subsequent invocations will be a
+ no-op then.
+
+ Once release() is called, the QRhiResource instance can be reused, by
+ calling \c build() again. That will then result in creating new native
+ graphics resources underneath.
+
+ \note Resources referenced by commands for the current frame should not be
+ released until the frame is submitted by QRhi::endFrame().
+
+ The QRhiResource destructor also performs the same task, so calling this
+ function is not necessary before destroying a QRhiResource.
+
+ \sa releaseAndDestroyLater()
+ */
+
+/*!
+ When called without a frame being recorded, this function is equivalent to
+ deleting the object. Between a QRhi::beginFrame() and QRhi::endFrame()
+ however the behavior is different: the QRhiResource will not be destroyed
+ until the frame is submitted via QRhi::endFrame(), thus satisfying the QRhi
+ requirement of not altering QRhiResource objects that are referenced by the
+ frame being recorded.
+
+ \sa release()
+ */
+void QRhiResource::releaseAndDestroyLater()
+{
+ m_rhi->addReleaseAndDestroyLater(this);
+}
+
+/*!
+ \return the currently set object name. By default the name is empty.
+ */
+QByteArray QRhiResource::name() const
+{
+ return m_objectName;
+}
+
+/*!
+ Sets a \a name for the object.
+
+ This has two uses: to get descriptive names for the native graphics
+ resources visible in graphics debugging tools, such as
+ \l{https://renderdoc.org/}{RenderDoc} and
+ \l{https://developer.apple.com/xcode/}{XCode}, and in the output stream of
+ QRhiProfiler.
+
+ When it comes to naming native objects by relaying the name via the
+ appropriate graphics API, note that the name is ignored when
+ QRhi::DebugMarkers are not supported, and may, depending on the backend,
+ also be ignored when QRhi::EnableDebugMarkers is not set.
+
+ \note The name may be ignored for objects other than buffers,
+ renderbuffers, and textures, depending on the backend.
+
+ \note The name may be modified. For slotted resources, such as a QRhiBuffer
+ backed by multiple native buffers, QRhi will append a suffix to make the
+ underlying native buffers easily distinguishable from each other.
+ */
+void QRhiResource::setName(const QByteArray &name)
+{
+ m_objectName = name;
+ m_objectName.replace(',', '_'); // cannot contain comma for QRhiProfiler
+}
+
+/*!
+ \return the global, unique identifier of this QRhiResource.
+
+ User code rarely needs to deal with the value directly. It is used
+ internally for tracking and bookkeeping purposes.
+ */
+quint64 QRhiResource::globalResourceId() const
+{
+ return m_id;
+}
+
+/*!
+ \class QRhiBuffer
+ \internal
+ \inmodule QtGui
+ \brief Vertex, index, or uniform (constant) buffer resource.
+ */
+
+/*!
+ \enum QRhiBuffer::Type
+ Specifies storage type of buffer resource.
+
+ \value Immutable Indicates that the data is not expected to change ever
+ after the initial upload. Under the hood such buffer resources are
+ typically placed in device local (GPU) memory (on systems where
+ applicable). Uploading new data is possible, but may be expensive. The
+ upload typically happens by copying to a separate, host visible staging
+ buffer from which a GPU buffer-to-buffer copy is issued into the actual
+ GPU-only buffer.
+
+ \value Static Indicates that the data is expected to change only
+ infrequently. Typically placed in device local (GPU) memory, where
+ applicable. On backends where host visible staging buffers are used for
+ uploading, the staging buffers are kept around for this type, unlike with
+ Immutable, so subsequent uploads do not suffer in performance. Frequent
+ updates, especially updates in consecutive frames, should be avoided.
+
+ \value Dynamic Indicates that the data is expected to change frequently.
+ Not recommended for large buffers. Typically backed by host visible memory
+ in 2 copies in order to allow for changing without stalling the graphics
+ pipeline. The double buffering is managed transparently to the applications
+ and is not exposed in the API here in any form. This is the recommended,
+ and, with some backends, the only possible, type for buffers with
+ UniformBuffer usage.
+ */
+
+/*!
+ \enum QRhiBuffer::UsageFlag
+ Flag values to specify how the buffer is going to be used.
+
+ \value VertexBuffer Vertex buffer. This allows the QRhiBuffer to be used in
+ \l{setVertexInput()}{QRhiCommandBuffer::setVertexInput()}.
+
+ \value IndexBuffer Index buffer. This allows the QRhiBuffer to be used in
+ \l{setVertexInput()}{QRhiCommandBuffer::setVertexInput()}.
+
+ \value UniformBuffer Uniform buffer (also called constant buffer). This
+ allows the QRhiBuffer to be used in combination with
+ \l{UniformBuffer}{QRhiShaderResourceBinding::UniformBuffer}. When
+ \l{QRhi::NonDynamicUniformBuffers}{NonDynamicUniformBuffers} is reported as
+ not supported, this usage can only be combined with the type Dynamic.
+
+ \value StorageBuffer Storage buffer. This allows the QRhiBuffer to be used
+ in combination with \l{BufferLoad}{QRhiShaderResourceBinding::BufferLoad},
+ \l{BufferStore}{QRhiShaderResourceBinding::BufferStore}, or
+ \l{BufferLoadStore}{QRhiShaderResourceBinding::BufferLoadStore}. This usage
+ can only be combined with the types Immutable or Static, and is only
+ available when the \l{QRhi::Compute}{Compute feature} is reported as
+ supported.
+ */
+
+/*!
+ \fn void QRhiBuffer::setSize(int sz)
+
+ Sets the size of the buffer in bytes. The size is normally specified in
+ QRhi::newBuffer() so this function is only used when the size has to be
+ changed. As with other setters, the size only takes effect when calling
+ build(), and for already built buffers this involves releasing the previous
+ native resource and creating new ones under the hood.
+
+ Backends may choose to allocate buffers bigger than \a sz in order to
+ fulfill alignment requirements. This is hidden from the applications and
+ size() will always report the size requested in \a sz.
+ */
+
+/*!
+ \internal
+ */
+QRhiBuffer::QRhiBuffer(QRhiImplementation *rhi, Type type_, UsageFlags usage_, int size_)
+ : QRhiResource(rhi),
+ m_type(type_), m_usage(usage_), m_size(size_)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiBuffer::resourceType() const
+{
+ return Buffer;
+}
+
+/*!
+ \fn bool QRhiBuffer::build()
+
+ Creates the corresponding native graphics resources. If there are already
+ resources present due to an earlier build() with no corresponding
+ release(), then release() is called implicitly first.
+
+ \return \c true when successful, \c false when a graphics operation failed.
+ Regardless of the return value, calling release() is always safe.
+ */
+
+/*!
+ \class QRhiRenderBuffer
+ \internal
+ \inmodule QtGui
+ \brief Renderbuffer resource.
+
+ Renderbuffers cannot be sampled or read but have some benefits over
+ textures in some cases:
+
+ A DepthStencil renderbuffer may be lazily allocated and be backed by
+ transient memory with some APIs. On some platforms this may mean the
+ depth/stencil buffer uses no physical backing at all.
+
+ Color renderbuffers are useful since QRhi::MultisampleRenderBuffer may be
+ supported even when QRhi::MultisampleTexture is not.
+
+ How the renderbuffer is implemented by a backend is not exposed to the
+ applications. In some cases it may be backed by ordinary textures, while in
+ others there may be a different kind of native resource used.
+
+ Renderbuffers that are used as (and are only used as) depth-stencil buffers
+ in combination with a QRhiSwapChain's color buffers should have the
+ UsedWithSwapChainOnly flag set. This serves a double purpose: such buffers,
+ depending on the backend and the underlying APIs, be more efficient, and
+ QRhi provides automatic sizing behavior to match the color buffers, which
+ means calling setPixelSize() and build() are not necessary for such
+ renderbuffers.
+ */
+
+/*!
+ \enum QRhiRenderBuffer::Type
+ Specifies the type of the renderbuffer
+
+ \value DepthStencil Combined depth/stencil
+ \value Color Color
+ */
+
+/*!
+ \enum QRhiRenderBuffer::Flag
+ Flag values for flags() and setFlags()
+
+ \value UsedWithSwapChainOnly For DepthStencil renderbuffers this indicates
+ that the renderbuffer is only used in combination with a QRhiSwapChain, and
+ never in any other way. This provides automatic sizing and resource
+ rebuilding, so calling setPixelSize() or build() is not needed whenever
+ this flag is set. This flag value may also trigger backend-specific
+ behavior, for example with OpenGL, where a separate windowing system
+ interface API is in use (EGL, GLX, etc.), the flag is especially important
+ as it avoids creating any actual renderbuffer resource as there is already
+ a windowing system provided depth/stencil buffer as requested by
+ QSurfaceFormat.
+ */
+
+/*!
+ \internal
+ */
+QRhiRenderBuffer::QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QSize &pixelSize_,
+ int sampleCount_, Flags flags_)
+ : QRhiResource(rhi),
+ m_type(type_), m_pixelSize(pixelSize_), m_sampleCount(sampleCount_), m_flags(flags_)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiRenderBuffer::resourceType() const
+{
+ return RenderBuffer;
+}
+
+/*!
+ \fn bool QRhiRenderBuffer::build()
+
+ Creates the corresponding native graphics resources. If there are already
+ resources present due to an earlier build() with no corresponding
+ release(), then release() is called implicitly first.
+
+ \return \c true when successful, \c false when a graphics operation failed.
+ Regardless of the return value, calling release() is always safe.
+ */
+
+/*!
+ \fn QRhiTexture::Format QRhiRenderBuffer::backingFormat() const
+
+ \internal
+ */
+
+/*!
+ \class QRhiTexture
+ \internal
+ \inmodule QtGui
+ \brief Texture resource.
+ */
+
+/*!
+ \enum QRhiTexture::Flag
+
+ Flag values to specify how the texture is going to be used. Not honoring
+ the flags set before build() and attempting to use the texture in ways that
+ was not declared upfront can lead to unspecified behavior or decreased
+ performance depending on the backend and the underlying graphics API.
+
+ \value RenderTarget The texture going to be used in combination with
+ QRhiTextureRenderTarget.
+
+ \value CubeMap The texture is a cubemap. Such textures have 6 layers, one
+ for each face in the order of +X, -X, +Y, -Y, +Z, -Z. Cubemap textures
+ cannot be multisample.
+
+ \value MipMapped The texture has mipmaps. The appropriate mip count is
+ calculated automatically and can also be retrieved via
+ QRhi::mipLevelsForSize(). The images for the mip levels have to be
+ provided in the texture uploaded or generated via
+ QRhiResourceUpdateBatch::generateMips(). Multisample textures cannot have
+ mipmaps.
+
+ \value sRGB Use an sRGB format.
+
+ \value UsedAsTransferSource The texture is used as the source of a texture
+ copy or readback, meaning the texture is given as the source in
+ QRhiResourceUpdateBatch::copyTexture() or
+ QRhiResourceUpdateBatch::readBackTexture().
+
+ \value UsedWithGenerateMips The texture is going to be used with
+ QRhiResourceUpdateBatch::generateMips().
+
+ \value UsedWithLoadStore The texture is going to be used with image
+ load/store operations, for example, in a compute shader.
+ */
+
+/*!
+ \enum QRhiTexture::Format
+
+ Specifies the texture format. See also QRhi::isTextureFormatSupported() and
+ note that flags() can modify the format when QRhiTexture::sRGB is set.
+
+ \value UnknownFormat Not a valid format. This cannot be passed to setFormat().
+
+ \value RGBA8 Four component, unsigned normalized 8 bit per component. Always supported.
+
+ \value BGRA8 Four component, unsigned normalized 8 bit per component.
+
+ \value R8 One component, unsigned normalized 8 bit.
+
+ \value R16 One component, unsigned normalized 16 bit.
+
+ \value RED_OR_ALPHA8 Either same as R8, or is a similar format with the component swizzled to alpha,
+ depending on \l{QRhi::RedOrAlpha8IsRed}{RedOrAlpha8IsRed}.
+
+ \value RGBA16F Four components, 16-bit float per component.
+
+ \value RGBA32F Four components, 32-bit float per component.
+
+ \value D16 16-bit depth (normalized unsigned integer)
+
+ \value D32F 32-bit depth (32-bit float)
+
+ \value BC1
+ \value BC2
+ \value BC3
+ \value BC4
+ \value BC5
+ \value BC6H
+ \value BC7
+
+ \value ETC2_RGB8
+ \value ETC2_RGB8A1
+ \value ETC2_RGBA8
+
+ \value ASTC_4x4
+ \value ASTC_5x4
+ \value ASTC_5x5
+ \value ASTC_6x5
+ \value ASTC_6x6
+ \value ASTC_8x5
+ \value ASTC_8x6
+ \value ASTC_8x8
+ \value ASTC_10x5
+ \value ASTC_10x6
+ \value ASTC_10x8
+ \value ASTC_10x10
+ \value ASTC_12x10
+ \value ASTC_12x12
+ */
+
+/*!
+ \internal
+ */
+QRhiTexture::QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_,
+ int sampleCount_, Flags flags_)
+ : QRhiResource(rhi),
+ m_format(format_), m_pixelSize(pixelSize_), m_sampleCount(sampleCount_), m_flags(flags_)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiTexture::resourceType() const
+{
+ return Texture;
+}
+
+/*!
+ \fn bool QRhiTexture::build()
+
+ Creates the corresponding native graphics resources. If there are already
+ resources present due to an earlier build() with no corresponding
+ release(), then release() is called implicitly first.
+
+ \return \c true when successful, \c false when a graphics operation failed.
+ Regardless of the return value, calling release() is always safe.
+ */
+
+/*!
+ \return a pointer to a backend-specific QRhiNativeHandles subclass, such as
+ QRhiVulkanTextureNativeHandles. The returned value is null when exposing
+ the underlying native resources is not supported by the backend.
+
+ \sa QRhiVulkanTextureNativeHandles, QRhiD3D11TextureNativeHandles,
+ QRhiMetalTextureNativeHandles, QRhiGles2TextureNativeHandles
+ */
+const QRhiNativeHandles *QRhiTexture::nativeHandles()
+{
+ return nullptr;
+}
+
+/*!
+ Similar to build() except that no new native textures are created. Instead,
+ the texture from \a src is used.
+
+ This allows importing an existing native texture object (which must belong
+ to the same device or sharing context, depending on the graphics API) from
+ an external graphics engine.
+
+ \note format(), pixelSize(), sampleCount(), and flags() must still be set
+ correctly. Passing incorrect sizes and other values to QRhi::newTexture()
+ and then following it with a buildFrom() expecting that the native texture
+ object alone is sufficient to deduce such values is \b wrong and will lead
+ to problems.
+
+ \note QRhiTexture does not take ownership of the texture object. release()
+ does not free the object or any associated memory.
+
+ The opposite of this operation, exposing a QRhiTexture-created native
+ texture object to a foreign engine, is possible via nativeHandles().
+
+ \sa QRhiVulkanTextureNativeHandles, QRhiD3D11TextureNativeHandles,
+ QRhiMetalTextureNativeHandles, QRhiGles2TextureNativeHandles
+ */
+bool QRhiTexture::buildFrom(const QRhiNativeHandles *src)
+{
+ Q_UNUSED(src);
+ return false;
+}
+
+/*!
+ \class QRhiSampler
+ \internal
+ \inmodule QtGui
+ \brief Sampler resource.
+ */
+
+/*!
+ \enum QRhiSampler::Filter
+ Specifies the minification, magnification, or mipmap filtering
+
+ \value None Applicable only for mipmapMode(), indicates no mipmaps to be used
+ \value Nearest
+ \value Linear
+ */
+
+/*!
+ \enum QRhiSampler::AddressMode
+ Specifies the addressing mode
+
+ \value Repeat
+ \value ClampToEdge
+ \value Border
+ \value Mirror
+ \value MirrorOnce
+ */
+
+/*!
+ \enum QRhiSampler::CompareOp
+ Specifies the texture comparison function.
+
+ \value Never (default)
+ \value Less
+ \value Equal
+ \value LessOrEqual
+ \value Greater
+ \value NotEqual
+ \value GreaterOrEqual
+ \value Always
+ */
+
+/*!
+ \internal
+ */
+QRhiSampler::QRhiSampler(QRhiImplementation *rhi,
+ Filter magFilter_, Filter minFilter_, Filter mipmapMode_,
+ AddressMode u_, AddressMode v_)
+ : QRhiResource(rhi),
+ m_magFilter(magFilter_), m_minFilter(minFilter_), m_mipmapMode(mipmapMode_),
+ m_addressU(u_), m_addressV(v_),
+ m_addressW(QRhiSampler::ClampToEdge),
+ m_compareOp(QRhiSampler::Never)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiSampler::resourceType() const
+{
+ return Sampler;
+}
+
+/*!
+ \class QRhiRenderPassDescriptor
+ \internal
+ \inmodule QtGui
+ \brief Render pass resource.
+
+ A render pass, if such a concept exists in the underlying graphics API, is
+ a collection of attachments (color, depth, stencil) and describes how those
+ attachments are used.
+ */
+
+/*!
+ \internal
+ */
+QRhiRenderPassDescriptor::QRhiRenderPassDescriptor(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiRenderPassDescriptor::resourceType() const
+{
+ return RenderPassDescriptor;
+}
+
+/*!
+ \return a pointer to a backend-specific QRhiNativeHandles subclass, such as
+ QRhiVulkanRenderPassNativeHandles. The returned value is null when exposing
+ the underlying native resources is not supported by the backend.
+
+ \sa QRhiVulkanRenderPassNativeHandles
+ */
+const QRhiNativeHandles *QRhiRenderPassDescriptor::nativeHandles()
+{
+ return nullptr;
+}
+
+/*!
+ \class QRhiRenderTarget
+ \internal
+ \inmodule QtGui
+ \brief Represents an onscreen (swapchain) or offscreen (texture) render target.
+ */
+
+/*!
+ \internal
+ */
+QRhiRenderTarget::QRhiRenderTarget(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiRenderTarget::resourceType() const
+{
+ return RenderTarget;
+}
+
+/*!
+ \fn QSize QRhiRenderTarget::pixelSize() const
+
+ \return the size in pixels.
+ */
+
+/*!
+ \fn float QRhiRenderTarget::devicePixelRatio() const
+
+ \return the device pixel ratio. For QRhiTextureRenderTarget this is always
+ 1. For targets retrieved from a QRhiSwapChain the value reflects the
+ \l{QWindow::devicePixelRatio()}{device pixel ratio} of the targeted
+ QWindow.
+ */
+
+/*!
+ \class QRhiTextureRenderTarget
+ \internal
+ \inmodule QtGui
+ \brief Texture render target resource.
+
+ A texture render target allows rendering into one or more textures,
+ optionally with a depth texture or depth/stencil renderbuffer.
+
+ \note Textures used in combination with QRhiTextureRenderTarget must be
+ created with the QRhiTexture::RenderTarget flag.
+
+ The simplest example of creating a render target with a texture as its
+ single color attachment:
+
+ \badcode
+ texture = rhi->newTexture(QRhiTexture::RGBA8, size, 1, QRhiTexture::RenderTarget);
+ texture->build();
+ rt = rhi->newTextureRenderTarget({ texture });
+ rp = rt->newCompatibleRenderPassDescriptor();
+ rt->setRenderPassDescriptor(rt);
+ rt->build();
+ // rt can now be used with beginPass()
+ \endcode
+ */
+
+/*!
+ \enum QRhiTextureRenderTarget::Flag
+
+ Flag values describing the load/store behavior for the render target. The
+ load/store behavior may be baked into native resources under the hood,
+ depending on the backend, and therefore it needs to be known upfront and
+ cannot be changed without rebuilding (and so releasing and creating new
+ native resources).
+
+ \value PreserveColorContents Indicates that the contents of the color
+ attachments is to be loaded when starting a render pass, instead of
+ clearing. This is potentially more expensive, especially on mobile (tiled)
+ GPUs, but allows preserving the existing contents between passes.
+
+ \value PreserveDepthStencilContents Indicates that the contents of the
+ depth texture is to be loaded when starting a render pass, instead
+ clearing. Only applicable when a texture is used as the depth buffer
+ (QRhiTextureRenderTargetDescription::depthTexture() is set) because
+ depth/stencil renderbuffers may not have any physical backing and data may
+ not be written out in the first place.
+ */
+
+/*!
+ \internal
+ */
+QRhiTextureRenderTarget::QRhiTextureRenderTarget(QRhiImplementation *rhi,
+ const QRhiTextureRenderTargetDescription &desc_,
+ Flags flags_)
+ : QRhiRenderTarget(rhi),
+ m_desc(desc_),
+ m_flags(flags_)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiTextureRenderTarget::resourceType() const
+{
+ return TextureRenderTarget;
+}
+
+/*!
+ \fn QRhiRenderPassDescriptor *QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor()
+
+ \return a new QRhiRenderPassDescriptor that is compatible with this render
+ target.
+
+ The returned value is used in two ways: it can be passed to
+ setRenderPassDescriptor() and
+ QRhiGraphicsPipeline::setRenderPassDescriptor(). A render pass descriptor
+ describes the attachments (color, depth/stencil) and the load/store
+ behavior that can be affected by flags(). A QRhiGraphicsPipeline can only
+ be used in combination with a render target that has the same
+ QRhiRenderPassDescriptor set.
+
+ Two QRhiTextureRenderTarget instances can share the same render pass
+ descriptor as long as they have the same number and type of attachments.
+ The associated QRhiTexture or QRhiRenderBuffer instances are not part of
+ the render pass descriptor so those can differ in the two
+ QRhiTextureRenderTarget intances.
+
+ \note resources, such as QRhiTexture instances, referenced in description()
+ must already be built
+
+ \sa build()
+ */
+
+/*!
+ \fn bool QRhiTextureRenderTarget::build()
+
+ Creates the corresponding native graphics resources. If there are already
+ resources present due to an earlier build() with no corresponding
+ release(), then release() is called implicitly first.
+
+ \note renderPassDescriptor() must be set before calling build(). To obtain
+ a QRhiRenderPassDescriptor compatible with the render target, call
+ newCompatibleRenderPassDescriptor() before build() but after setting all
+ other parameters, such as description() and flags(). To save resources,
+ reuse the same QRhiRenderPassDescriptor with multiple
+ QRhiTextureRenderTarget instances, whenever possible. Sharing the same
+ render pass descriptor is only possible when the render targets have the
+ same number and type of attachments (the actual textures can differ) and
+ the same flags.
+
+ \note resources, such as QRhiTexture instances, referenced in description()
+ must already be built
+
+ \return \c true when successful, \c false when a graphics operation failed.
+ Regardless of the return value, calling release() is always safe.
+ */
+
+/*!
+ \class QRhiShaderResourceBindings
+ \internal
+ \inmodule QtGui
+ \brief Encapsulates resources for making buffer, texture, sampler resources visible to shaders.
+
+ A QRhiShaderResourceBindings is a collection of QRhiShaderResourceBinding
+ objects, each of which describe a single binding.
+
+ Take a fragment shader with the following interface:
+
+ \badcode
+ layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ int flip;
+ } ubuf;
+
+ layout(binding = 1) uniform sampler2D tex;
+ \endcode
+
+ To make resources visible to the shader, the following
+ QRhiShaderResourceBindings could be created and then passed to
+ QRhiGraphicsPipeline::setShaderResourceBindings():
+
+ \badcode
+ srb = rhi->newShaderResourceBindings();
+ srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, texture, sampler)
+ });
+ srb->build();
+ ...
+ ps = rhi->newGraphicsPipeline();
+ ...
+ ps->setShaderResourceBindings(srb);
+ ps->build();
+ ...
+ cb->setGraphicsPipeline(ps);
+ cb->setShaderResources(); // binds srb
+ \endcode
+
+ This assumes that \c ubuf is a QRhiBuffer, \c texture is a QRhiTexture,
+ while \a sampler is a QRhiSampler. The example also assumes that the
+ uniform block is present in the vertex shader as well so the same buffer is
+ made visible to the vertex stage too.
+
+ \section3 Advanced usage
+
+ Building on the above example, let's assume that a pass now needs to use
+ the exact same pipeline and shaders with a different texture. Creating a
+ whole separate QRhiGraphicsPipeline just for this would be an overkill.
+ This is why QRhiCommandBuffer::setShaderResources() allows specifying a \a
+ srb argument. As long as the layouts (so the number of bindings and the
+ binding points) match between two QRhiShaderResourceBindings, they can both
+ be used with the same pipeline, assuming the pipeline was built with one of
+ them in the first place.
+
+ \badcode
+ srb2 = rhi->newShaderResourceBindings();
+ ...
+ cb->setGraphicsPipeline(ps);
+ cb->setShaderResources(srb2); // binds srb2
+ \endcode
+ */
+
+/*!
+ \internal
+ */
+QRhiShaderResourceBindings::QRhiShaderResourceBindings(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiShaderResourceBindings::resourceType() const
+{
+ return ShaderResourceBindings;
+}
+
+/*!
+ \return \c true if the layout is compatible with \a other. The layout does
+ not include the actual resource (such as, buffer or texture) and related
+ parameters (such as, offset or size). It does include the binding point,
+ pipeline stage, and resource type, however. The number and order of the
+ bindings must also match in order to be compatible.
+
+ When there is a QRhiGraphicsPipeline created with this
+ QRhiShaderResourceBindings, and the function returns \c true, \a other can
+ then safely be passed to QRhiCommandBuffer::setShaderResources(), and so
+ be used with the pipeline in place of this QRhiShaderResourceBindings.
+
+ This function can be called before build() as well. The bindings must
+ already be set via setBindings() however.
+ */
+bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBindings *other) const
+{
+ const int count = m_bindings.count();
+ if (count != other->m_bindings.count())
+ return false;
+
+ for (int i = 0; i < count; ++i) {
+ if (!m_bindings[i].isLayoutCompatible(other->m_bindings.at(i)))
+ return false;
+ }
+
+ return true;
+}
+
+/*!
+ \class QRhiShaderResourceBinding
+ \internal
+ \inmodule QtGui
+ \brief Describes the shader resource for a single binding point.
+
+ A QRhiShaderResourceBinding cannot be constructed directly. Instead, use
+ the static functions uniformBuffer(), sampledTexture() to get an instance.
+ */
+
+/*!
+ \enum QRhiShaderResourceBinding::Type
+ Specifies type of the shader resource bound to a binding point
+
+ \value UniformBuffer Uniform buffer
+
+ \value SampledTexture Combined image sampler
+
+ \value ImageLoad Image load (with GLSL this maps to doing imageLoad() on a
+ single level - and either one or all layers - of a texture exposed to the
+ shader as an image object)
+
+ \value ImageStore Image store (with GLSL this maps to doing imageStore() or
+ imageAtomic*() on a single level - and either one or all layers - of a
+ texture exposed to the shader as an image object)
+
+ \value ImageLoadStore Image load and store
+
+ \value BufferLoad Storage buffer store (with GLSL this maps to reading from
+ a shader storage buffer)
+
+ \value BufferStore Storage buffer store (with GLSL this maps to writing to
+ a shader storage buffer)
+
+ \value BufferLoadStore Storage buffer load and store
+ */
+
+/*!
+ \enum QRhiShaderResourceBinding::StageFlag
+ Flag values to indicate which stages the shader resource is visible in
+
+ \value VertexStage Vertex stage
+ \value FragmentStage Fragment (pixel) stage
+ \value ComputeStage Compute stage
+ */
+
+/*!
+ \internal
+ */
+QRhiShaderResourceBinding::QRhiShaderResourceBinding()
+{
+ // Zero out everything, including possible padding, because will use
+ // qHashBits on it.
+ memset(&d.u, 0, sizeof(d.u));
+}
+
+/*!
+ \return \c true if the layout is compatible with \a other. The layout does not
+ include the actual resource (such as, buffer or texture) and related
+ parameters (such as, offset or size).
+
+ For example, \c a and \c b below are not equal, but are compatible layout-wise:
+
+ \badcode
+ auto a = QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage, buffer);
+ auto b = QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage, someOtherBuffer, 256);
+ \endcode
+ */
+bool QRhiShaderResourceBinding::isLayoutCompatible(const QRhiShaderResourceBinding &other) const
+{
+ return d.binding == other.d.binding && d.stage == other.d.stage && d.type == other.d.type;
+}
+
+/*!
+ \return a shader resource binding for the given binding number, pipeline
+ stages, and buffer specified by \a binding, \a stage, and \a buf.
+
+ \note \a buf must have been created with QRhiBuffer::UniformBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBuffer(
+ int binding, StageFlags stage, QRhiBuffer *buf)
+{
+ QRhiShaderResourceBinding b;
+ b.d.binding = binding;
+ b.d.stage = stage;
+ b.d.type = UniformBuffer;
+ b.d.u.ubuf.buf = buf;
+ b.d.u.ubuf.offset = 0;
+ b.d.u.ubuf.maybeSize = 0; // entire buffer
+ b.d.u.ubuf.hasDynamicOffset = false;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for the given binding number, pipeline
+ stages, and buffer specified by \a binding, \a stage, and \a buf. This
+ overload binds a region only, as specified by \a offset and \a size.
+
+ \note It is up to the user to ensure the offset is aligned to
+ QRhi::ubufAlignment().
+
+ \note \a size must be greater than 0.
+
+ \note \a buf must have been created with QRhiBuffer::UniformBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBuffer(
+ int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size)
+{
+ Q_ASSERT(size > 0);
+ QRhiShaderResourceBinding b = uniformBuffer(binding, stage, buf);
+ b.d.u.ubuf.offset = offset;
+ b.d.u.ubuf.maybeSize = size;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for the given binding number, pipeline
+ stages, and buffer specified by \a binding, \a stage, and \a buf. The
+ uniform buffer is assumed to have dynamic offset. The dynamic offset can be
+ specified in QRhiCommandBuffer::setShaderResources(), thus allowing using
+ varying offset values without creating new bindings for the buffer. The
+ size of the bound region is specified by \a size. Like with non-dynamic
+ offsets, \c{offset + size} cannot exceed the size of \a buf.
+
+ \note \a buf must have been created with QRhiBuffer::UniformBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBufferWithDynamicOffset(
+ int binding, StageFlags stage, QRhiBuffer *buf, int size)
+{
+ QRhiShaderResourceBinding b = uniformBuffer(binding, stage, buf, 0, size);
+ b.d.u.ubuf.hasDynamicOffset = true;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for the given binding number, pipeline
+ stages, texture, and sampler specified by \a binding, \a stage, \a tex,
+ \a sampler.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::sampledTexture(
+ int binding, StageFlags stage, QRhiTexture *tex, QRhiSampler *sampler)
+{
+ QRhiShaderResourceBinding b;
+ b.d.binding = binding;
+ b.d.stage = stage;
+ b.d.type = SampledTexture;
+ b.d.u.stex.tex = tex;
+ b.d.u.stex.sampler = sampler;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a read-only storage image with the
+ given \a binding number and pipeline \a stage. The image load operations
+ will have access to all layers of the specified \a level. (so if the texture
+ is a cubemap, the shader must use imageCube instead of image2D)
+
+ \note \a tex must have been created with QRhiTexture::UsedWithLoadStore.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::imageLoad(
+ int binding, StageFlags stage, QRhiTexture *tex, int level)
+{
+ QRhiShaderResourceBinding b;
+ b.d.binding = binding;
+ b.d.stage = stage;
+ b.d.type = ImageLoad;
+ b.d.u.simage.tex = tex;
+ b.d.u.simage.level = level;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a write-only storage image with the
+ given \a binding number and pipeline \a stage. The image store operations
+ will have access to all layers of the specified \a level. (so if the texture
+ is a cubemap, the shader must use imageCube instead of image2D)
+
+ \note \a tex must have been created with QRhiTexture::UsedWithLoadStore.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::imageStore(
+ int binding, StageFlags stage, QRhiTexture *tex, int level)
+{
+ QRhiShaderResourceBinding b = imageLoad(binding, stage, tex, level);
+ b.d.type = ImageStore;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a read/write storage image with the
+ given \a binding number and pipeline \a stage. The image load/store operations
+ will have access to all layers of the specified \a level. (so if the texture
+ is a cubemap, the shader must use imageCube instead of image2D)
+
+ \note \a tex must have been created with QRhiTexture::UsedWithLoadStore.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::imageLoadStore(
+ int binding, StageFlags stage, QRhiTexture *tex, int level)
+{
+ QRhiShaderResourceBinding b = imageLoad(binding, stage, tex, level);
+ b.d.type = ImageLoadStore;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a read-only storage buffer with the
+ given \a binding number and pipeline \a stage.
+
+ \note \a buf must have been created with QRhiBuffer::StorageBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::bufferLoad(
+ int binding, StageFlags stage, QRhiBuffer *buf)
+{
+ QRhiShaderResourceBinding b;
+ b.d.binding = binding;
+ b.d.stage = stage;
+ b.d.type = BufferLoad;
+ b.d.u.sbuf.buf = buf;
+ b.d.u.sbuf.offset = 0;
+ b.d.u.sbuf.maybeSize = 0; // entire buffer
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a read-only storage buffer with the
+ given \a binding number and pipeline \a stage. This overload binds a region
+ only, as specified by \a offset and \a size.
+
+ \note \a buf must have been created with QRhiBuffer::StorageBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::bufferLoad(
+ int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size)
+{
+ Q_ASSERT(size > 0);
+ QRhiShaderResourceBinding b = bufferLoad(binding, stage, buf);
+ b.d.u.sbuf.offset = offset;
+ b.d.u.sbuf.maybeSize = size;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a write-only storage buffer with the
+ given \a binding number and pipeline \a stage.
+
+ \note \a buf must have been created with QRhiBuffer::StorageBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::bufferStore(
+ int binding, StageFlags stage, QRhiBuffer *buf)
+{
+ QRhiShaderResourceBinding b = bufferLoad(binding, stage, buf);
+ b.d.type = BufferStore;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a write-only storage buffer with the
+ given \a binding number and pipeline \a stage. This overload binds a region
+ only, as specified by \a offset and \a size.
+
+ \note \a buf must have been created with QRhiBuffer::StorageBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::bufferStore(
+ int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size)
+{
+ Q_ASSERT(size > 0);
+ QRhiShaderResourceBinding b = bufferStore(binding, stage, buf);
+ b.d.u.sbuf.offset = offset;
+ b.d.u.sbuf.maybeSize = size;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a read-write storage buffer with the
+ given \a binding number and pipeline \a stage.
+
+ \note \a buf must have been created with QRhiBuffer::StorageBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::bufferLoadStore(
+ int binding, StageFlags stage, QRhiBuffer *buf)
+{
+ QRhiShaderResourceBinding b = bufferLoad(binding, stage, buf);
+ b.d.type = BufferLoadStore;
+ return b;
+}
+
+/*!
+ \return a shader resource binding for a read-write storage buffer with the
+ given \a binding number and pipeline \a stage. This overload binds a region
+ only, as specified by \a offset and \a size.
+
+ \note \a buf must have been created with QRhiBuffer::StorageBuffer.
+ */
+QRhiShaderResourceBinding QRhiShaderResourceBinding::bufferLoadStore(
+ int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size)
+{
+ Q_ASSERT(size > 0);
+ QRhiShaderResourceBinding b = bufferLoadStore(binding, stage, buf);
+ b.d.u.sbuf.offset = offset;
+ b.d.u.sbuf.maybeSize = size;
+ return b;
+}
+
+/*!
+ \return \c true if the contents of the two QRhiShaderResourceBinding
+ objects \a a and \a b are equal. This includes the resources (buffer,
+ texture) and related parameters (offset, size) as well. To only compare
+ layouts (binding point, pipeline stage, resource type), use
+ \l{QRhiShaderResourceBinding::isLayoutCompatible()}{isLayoutCompatible()}
+ instead.
+
+ \relates QRhiShaderResourceBinding
+ */
+bool operator==(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) Q_DECL_NOTHROW
+{
+ const QRhiShaderResourceBinding::Data *da = a.data();
+ const QRhiShaderResourceBinding::Data *db = b.data();
+
+ if (da == db)
+ return true;
+
+
+ if (da->binding != db->binding
+ || da->stage != db->stage
+ || da->type != db->type)
+ {
+ return false;
+ }
+
+ switch (da->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ if (da->u.ubuf.buf != db->u.ubuf.buf
+ || da->u.ubuf.offset != db->u.ubuf.offset
+ || da->u.ubuf.maybeSize != db->u.ubuf.maybeSize)
+ {
+ return false;
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ if (da->u.stex.tex != db->u.stex.tex
+ || da->u.stex.sampler != db->u.stex.sampler)
+ {
+ return false;
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ if (da->u.simage.tex != db->u.simage.tex
+ || da->u.simage.level != db->u.simage.level)
+ {
+ return false;
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ if (da->u.sbuf.buf != db->u.sbuf.buf
+ || da->u.sbuf.offset != db->u.sbuf.offset
+ || da->u.sbuf.maybeSize != db->u.sbuf.maybeSize)
+ {
+ return false;
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+
+ return true;
+}
+
+/*!
+ \return \c false if all the bindings in the two QRhiShaderResourceBinding
+ objects \a a and \a b are equal; otherwise returns \c true.
+
+ \relates QRhiShaderResourceBinding
+ */
+bool operator!=(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) Q_DECL_NOTHROW
+{
+ return !(a == b);
+}
+
+/*!
+ \return the hash value for \a b, using \a seed to seed the calculation.
+
+ \relates QRhiShaderResourceBinding
+ */
+uint qHash(const QRhiShaderResourceBinding &b, uint seed) Q_DECL_NOTHROW
+{
+ const QRhiShaderResourceBinding::Data *d = b.data();
+ return seed + uint(d->binding) + 10 * uint(d->stage) + 100 * uint(d->type)
+ + qHashBits(&d->u, sizeof(d->u), seed);
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiShaderResourceBinding &b)
+{
+ QDebugStateSaver saver(dbg);
+ const QRhiShaderResourceBinding::Data *d = b.data();
+ dbg.nospace() << "QRhiShaderResourceBinding("
+ << "binding=" << d->binding
+ << " stage=" << d->stage
+ << " type=" << d->type;
+ switch (d->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ dbg.nospace() << " UniformBuffer("
+ << "buffer=" << d->u.ubuf.buf
+ << " offset=" << d->u.ubuf.offset
+ << " maybeSize=" << d->u.ubuf.maybeSize
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ dbg.nospace() << " SampledTexture("
+ << "texture=" << d->u.stex.tex
+ << " sampler=" << d->u.stex.sampler
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ dbg.nospace() << " ImageLoad("
+ << "texture=" << d->u.simage.tex
+ << " level=" << d->u.simage.level
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::ImageStore:
+ dbg.nospace() << " ImageStore("
+ << "texture=" << d->u.simage.tex
+ << " level=" << d->u.simage.level
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ dbg.nospace() << " ImageLoadStore("
+ << "texture=" << d->u.simage.tex
+ << " level=" << d->u.simage.level
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ dbg.nospace() << " BufferLoad("
+ << "buffer=" << d->u.sbuf.buf
+ << " offset=" << d->u.sbuf.offset
+ << " maybeSize=" << d->u.sbuf.maybeSize
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::BufferStore:
+ dbg.nospace() << " BufferStore("
+ << "buffer=" << d->u.sbuf.buf
+ << " offset=" << d->u.sbuf.offset
+ << " maybeSize=" << d->u.sbuf.maybeSize
+ << ')';
+ break;
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ dbg.nospace() << " BufferLoadStore("
+ << "buffer=" << d->u.sbuf.buf
+ << " offset=" << d->u.sbuf.offset
+ << " maybeSize=" << d->u.sbuf.maybeSize
+ << ')';
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ dbg.nospace() << ')';
+ return dbg;
+}
+#endif
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QRhiShaderResourceBindings &srb)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "QRhiShaderResourceBindings("
+ << srb.m_bindings
+ << ')';
+ return dbg;
+}
+#endif
+
+/*!
+ \class QRhiGraphicsPipeline
+ \internal
+ \inmodule QtGui
+ \brief Graphics pipeline state resource.
+
+ \note Setting the shader stages is mandatory. There must be at least one
+ stage, and there must be a vertex stage.
+
+ \note Setting the shader resource bindings is mandatory. The referenced
+ QRhiShaderResourceBindings must already be built by the time build() is
+ called. Associating with a QRhiShaderResourceBindings that has no bindings
+ is also valid, as long as no shader in any stage expects any resources.
+
+ \note Setting the render pass descriptor is mandatory. To obtain a
+ QRhiRenderPassDescriptor that can be passed to setRenderPassDescriptor(),
+ use either QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor() or
+ QRhiSwapChain::newCompatibleRenderPassDescriptor().
+
+ \note Setting the vertex input layout is mandatory.
+
+ \note sampleCount() defaults to 1 and must match the sample count of the
+ render target's color and depth stencil attachments.
+
+ \note The depth test, depth write, and stencil test are disabled by
+ default.
+
+ \note stencilReadMask() and stencilWriteMask() apply to both faces. They
+ both default to 0xFF.
+ */
+
+/*!
+ \fn void QRhiGraphicsPipeline::setTargetBlends(const QVector<TargetBlend> &blends)
+
+ Sets the blend specification for color attachments. Each element in \a
+ blends corresponds to a color attachment of the render target.
+
+ By default no blends are set, which is a shortcut to disabling blending and
+ enabling color write for all four channels.
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::Flag
+
+ Flag values for describing the dynamic state of the pipeline. The viewport is always dynamic.
+
+ \value UsesBlendConstants Indicates that a blend color constant will be set
+ via QRhiCommandBuffer::setBlendConstants()
+
+ \value UsesStencilRef Indicates that a stencil reference value will be set
+ via QRhiCommandBuffer::setStencilRef()
+
+ \value UsesScissor Indicates that a scissor rectangle will be set via
+ QRhiCommandBuffer::setScissor()
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::Topology
+ Specifies the primitive topology
+
+ \value Triangles (default)
+ \value TriangleStrip
+ \value TriangleFan (only available if QRhi::TriangleFanTopology is supported)
+ \value Lines
+ \value LineStrip
+ \value Points
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::CullMode
+ Specifies the culling mode
+
+ \value None No culling (default)
+ \value Front Cull front faces
+ \value Back Cull back faces
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::FrontFace
+ Specifies the front face winding order
+
+ \value CCW Counter clockwise (default)
+ \value CW Clockwise
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::ColorMaskComponent
+ Flag values for specifying the color write mask
+
+ \value R
+ \value G
+ \value B
+ \value A
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::BlendFactor
+ Specifies the blend factor
+
+ \value Zero
+ \value One
+ \value SrcColor
+ \value OneMinusSrcColor
+ \value DstColor
+ \value OneMinusDstColor
+ \value SrcAlpha
+ \value OneMinusSrcAlpha
+ \value DstAlpha
+ \value OneMinusDstAlpha
+ \value ConstantColor
+ \value OneMinusConstantColor
+ \value ConstantAlpha
+ \value OneMinusConstantAlpha
+ \value SrcAlphaSaturate
+ \value Src1Color
+ \value OneMinusSrc1Color
+ \value Src1Alpha
+ \value OneMinusSrc1Alpha
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::BlendOp
+ Specifies the blend operation
+
+ \value Add
+ \value Subtract
+ \value ReverseSubtract
+ \value Min
+ \value Max
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::CompareOp
+ Specifies the depth or stencil comparison function
+
+ \value Never
+ \value Less (default for depth)
+ \value Equal
+ \value LessOrEqual
+ \value Greater
+ \value NotEqual
+ \value GreaterOrEqual
+ \value Always (default for stencil)
+ */
+
+/*!
+ \enum QRhiGraphicsPipeline::StencilOp
+ Specifies the stencil operation
+
+ \value StencilZero
+ \value Keep (default)
+ \value Replace
+ \value IncrementAndClamp
+ \value DecrementAndClamp
+ \value Invert
+ \value IncrementAndWrap
+ \value DecrementAndWrap
+ */
+
+/*!
+ \class QRhiGraphicsPipeline::TargetBlend
+ \internal
+ \inmodule QtGui
+ \brief Describes the blend state for one color attachment.
+
+ Defaults to color write enabled, blending disabled. The blend values are
+ set up for pre-multiplied alpha (One, OneMinusSrcAlpha, One,
+ OneMinusSrcAlpha) by default.
+ */
+
+/*!
+ \class QRhiGraphicsPipeline::StencilOpState
+ \internal
+ \inmodule QtGui
+ \brief Describes the stencil operation state.
+ */
+
+/*!
+ \internal
+ */
+QRhiGraphicsPipeline::QRhiGraphicsPipeline(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiGraphicsPipeline::resourceType() const
+{
+ return GraphicsPipeline;
+}
+
+/*!
+ \fn bool QRhiGraphicsPipeline::build()
+
+ Creates the corresponding native graphics resources. If there are already
+ resources present due to an earlier build() with no corresponding
+ release(), then release() is called implicitly first.
+
+ \return \c true when successful, \c false when a graphics operation failed.
+ Regardless of the return value, calling release() is always safe.
+ */
+
+/*!
+ \fn void QRhiGraphicsPipeline::setDepthTest(bool enable)
+
+ Enables or disables depth testing. Both depth test and the writing out of
+ depth data are disabled by default.
+
+ \sa setDepthWrite()
+ */
+
+/*!
+ \fn void QRhiGraphicsPipeline::setDepthWrite(bool enable)
+
+ Controls the writing out of depth data into the depth buffer. By default
+ this is disabled. Depth write is typically enabled together with the depth
+ test.
+
+ \note Enabling depth write without having depth testing enabled may not
+ lead to the desired result, and should be avoided.
+
+ \sa setDepthTest()
+ */
+
+/*!
+ \class QRhiSwapChain
+ \internal
+ \inmodule QtGui
+ \brief Swapchain resource.
+
+ A swapchain enables presenting rendering results to a surface. A swapchain
+ is typically backed by a set of color buffers. Of these, one is displayed
+ at a time.
+
+ Below is a typical pattern for creating and managing a swapchain and some
+ associated resources in order to render onto a QWindow:
+
+ \badcode
+ void init()
+ {
+ sc = rhi->newSwapChain();
+ ds = rhi->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
+ QSize(), // no need to set the size here due to UsedWithSwapChainOnly
+ 1,
+ QRhiRenderBuffer::UsedWithSwapChainOnly);
+ sc->setWindow(window);
+ sc->setDepthStencil(ds);
+ rp = sc->newCompatibleRenderPassDescriptor();
+ sc->setRenderPassDescriptor(rp);
+ resizeSwapChain();
+ }
+
+ void resizeSwapChain()
+ {
+ hasSwapChain = sc->buildOrResize();
+ }
+
+ void render()
+ {
+ if (!hasSwapChain || notExposed)
+ return;
+
+ if (sc->currentPixelSize() != sc->surfacePixelSize() || newlyExposed) {
+ resizeSwapChain();
+ if (!hasSwapChain)
+ return;
+ newlyExposed = false;
+ }
+
+ rhi->beginFrame(sc);
+ // ...
+ rhi->endFrame(sc);
+ }
+ \endcode
+
+ Avoid relying on QWindow resize events to resize swapchains, especially
+ considering that surface sizes may not always fully match the QWindow
+ reported dimensions. The safe, cross-platform approach is to do the check
+ via surfacePixelSize() whenever starting a new frame.
+
+ Releasing the swapchain must happen while the QWindow and the underlying
+ native window is fully up and running. Building on the previous example:
+
+ \badcode
+ void releaseSwapChain()
+ {
+ if (hasSwapChain) {
+ sc->release();
+ hasSwapChain = false;
+ }
+ }
+
+ // assuming Window is our QWindow subclass
+ bool Window::event(QEvent *e)
+ {
+ switch (e->type()) {
+ case QEvent::UpdateRequest: // for QWindow::requestUpdate()
+ render();
+ break;
+ case QEvent::PlatformSurface:
+ if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
+ releaseSwapChain();
+ break;
+ default:
+ break;
+ }
+ return QWindow::event(e);
+ }
+ \endcode
+
+ Initializing the swapchain and starting to render the first frame cannot
+ start at any time. The safe, cross-platform approach is to rely on expose
+ events. QExposeEvent is a loosely specified event that is sent whenever a
+ window gets mapped, obscured, and resized, depending on the platform.
+
+ \badcode
+ void Window::exposeEvent(QExposeEvent *)
+ {
+ // initialize and start rendering when the window becomes usable for graphics purposes
+ if (isExposed() && !running) {
+ running = true;
+ init();
+ }
+
+ // stop pushing frames when not exposed or size becomes 0
+ if ((!isExposed() || (hasSwapChain && sc->surfacePixelSize().isEmpty())) && running)
+ notExposed = true;
+
+ // continue when exposed again and the surface has a valid size
+ if (isExposed() && running && notExposed && !sc->surfacePixelSize().isEmpty()) {
+ notExposed = false;
+ newlyExposed = true;
+ }
+
+ if (isExposed() && !sc->surfacePixelSize().isEmpty())
+ render();
+ }
+ \endcode
+
+ Once the rendering has started, a simple way to request a new frame is
+ QWindow::requestUpdate(). While on some platforms this is merely a small
+ timer, on others it has a specific implementation: for instance on macOS or
+ iOS it may be backed by
+ \l{https://developer.apple.com/documentation/corevideo/cvdisplaylink?language=objc}{CVDisplayLink}.
+ The example above is already prepared for update requests by handling
+ QEvent::UpdateRequest.
+
+ While acting as a QRhiRenderTarget, QRhiSwapChain also manages a
+ QRhiCommandBuffer. Calling QRhi::endFrame() submits the recorded commands
+ and also enqueues a \c present request. The default behavior is to do this
+ with a swap interval of 1, meaning synchronizing to the display's vertical
+ refresh is enabled. Thus the rendering thread calling beginFrame() and
+ endFrame() will get throttled to vsync. On some backends this can be
+ disabled by passing QRhiSwapChain:NoVSync in flags().
+
+ Multisampling (MSAA) is handled transparently to the applications when
+ requested via setSampleCount(). Where applicable, QRhiSwapChain will take
+ care of creating additional color buffers and issuing a multisample resolve
+ command at the end of a frame. For OpenGL, it is necessary to request the
+ appropriate sample count also via QSurfaceFormat, by calling
+ QSurfaceFormat::setDefaultFormat() before initializing the QRhi.
+ */
+
+/*!
+ \enum QRhiSwapChain::Flag
+ Flag values to describe swapchain properties
+
+ \value SurfaceHasPreMulAlpha Indicates that the target surface has
+ transparency with premultiplied alpha. For example, this is what Qt Quick
+ uses when the alpha channel is enabled on the target QWindow, because the
+ scenegraph rendrerer always outputs fragments with alpha multiplied into
+ the red, green, and blue values. To ensure identical behavior across
+ platforms, always set QSurfaceFormat::alphaBufferSize() to a non-zero value
+ on the target QWindow whenever this flag is set on the swapchain.
+
+ \value SurfaceHasNonPreMulAlpha Indicates the target surface has
+ transparency with non-premultiplied alpha. Be aware that this may not be
+ supported on some systems, if the system compositor always expects content
+ with premultiplied alpha. In that case the behavior with this flag set is
+ expected to be equivalent to SurfaceHasPreMulAlpha.
+
+ \value sRGB Requests to pick an sRGB format for the swapchain and/or its
+ render target views, where applicable. Note that this implies that sRGB
+ framebuffer update and blending will get enabled for all content targeting
+ this swapchain, and opting out is not possible. For OpenGL, set
+ \l{QSurfaceFormat::sRGBColorSpace}{sRGBColorSpace} on the QSurfaceFormat of
+ the QWindow in addition.
+
+ \value UsedAsTransferSource Indicates the the swapchain will be used as the
+ source of a readback in QRhiResourceUpdateBatch::readBackTexture().
+
+ \value NoVSync Requests disabling waiting for vertical sync, also avoiding
+ throttling the rendering thread. The behavior is backend specific and
+ applicable only where it is possible to control this. Some may ignore the
+ request altogether. For OpenGL, try instead setting the swap interval to 0
+ on the QWindow via QSurfaceFormat::setSwapInterval().
+
+ \value MinimalBufferCount Requests creating the swapchain with the minimum
+ number of buffers, which is in practice 2, unless the graphics
+ implementation has a higher minimum number than that. Only applicable with
+ backends where such control is available via the graphics API, for example,
+ Vulkan. By default it is up to the backend to decide what number of buffers
+ it requests (in practice this is almost always either 2 or 3), and it is
+ not the applications' concern. However, on Vulkan for instance the backend
+ will likely prefer the higher number (3), for example to avoid odd
+ performance issues with some Vulkan implementations on mobile devices. It
+ could be that on some platforms it can prove to be beneficial to force the
+ lower buffer count (2), so this flag allows forcing that. Note that all
+ this has no effect on the number of frames kept in flight, so the CPU
+ (QRhi) will still prepare frames at most \c{N - 1} frames ahead of the GPU,
+ even when the swapchain image buffer count larger than \c N. (\c{N} =
+ QRhi::FramesInFlight and typically 2).
+ */
+
+/*!
+ \internal
+ */
+QRhiSwapChain::QRhiSwapChain(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiSwapChain::resourceType() const
+{
+ return SwapChain;
+}
+
+/*!
+ \fn QSize QRhiSwapChain::currentPixelSize() const
+
+ \return the size with which the swapchain was last successfully built. Use
+ this to decide if buildOrResize() needs to be called again: if
+ \c{currentPixelSize() != surfacePixelSize()} then the swapchain needs to be
+ resized.
+
+ \note Typical rendering logic will call this function to get the output
+ size when starting to prepare a new frame, and base dependent calculations
+ (such as, the viewport) on the size returned from this function.
+
+ While in many cases the value is the same as \c{QWindow::size() *
+ QWindow::devicePixelRatio()}, relying on the QWindow-reported size is not
+ guaranteed to be correct on all platforms and graphics API implementations.
+ Using this function is therefore strongly recommended whenever there is a
+ need to identify the dimensions, in pixels, of the output layer or surface.
+
+ This also has the added benefit of avoiding potential data races when QRhi
+ is used on a dedicated rendering thread, because the need to call QWindow
+ functions, that may then access data updated on the main thread, is
+ avoided.
+
+ \sa surfacePixelSize()
+ */
+
+/*!
+ \fn QSize QRhiSwapChain::surfacePixelSize()
+
+ \return The size of the window's associated surface or layer.
+
+ \warning Do not assume this is the same as \c{QWindow::size() *
+ QWindow::devicePixelRatio()}. With some graphics APIs and windowing system
+ interfaces (for example, Vulkan) there is a theoretical possibility for a
+ surface to assume a size different from the associated window. To support
+ these cases, rendering logic must always base size-derived calculations
+ (such as, viewports) on the size reported from QRhiSwapChain, and never on
+ the size queried from QWindow.
+
+ \note Can also be called before buildOrResize(), if at least window() is
+ already set) This in combination with currentPixelSize() allows to detect
+ when a swapchain needs to be resized. However, watch out for the fact that
+ the size of the underlying native object (surface, layer, or similar) is
+ "live", so whenever this function is called, it returns the latest value
+ reported by the underlying implementation, without any atomicity guarantee.
+ Therefore, using this function to determine pixel sizes for graphics
+ resources that are used in a frame is strongly discouraged. Rely on
+ currentPixelSize() instead which returns a size that is atomic and will not
+ change between buildOrResize() invocations.
+
+ \note For depth-stencil buffers used in combination with the swapchain's
+ color buffers, it is strongly recommended to rely on the automatic sizing
+ and rebuilding behavior provided by the
+ QRhiRenderBuffer:UsedWithSwapChainOnly flag. Avoid querying the surface
+ size via this function just to get a size that can be passed to
+ QRhiRenderBuffer::setPixelSize() as that would suffer from the lack of
+ atomicity as described above.
+
+ \sa currentPixelSize()
+ */
+
+/*!
+ \fn QRhiCommandBuffer *QRhiSwapChain::currentFrameCommandBuffer()
+
+ \return a command buffer on which rendering commands can be recorded. Only
+ valid within a QRhi::beginFrame() - QRhi::endFrame() block where
+ beginFrame() was called with this swapchain.
+
+ \note the value must not be cached and reused between frames
+*/
+
+/*!
+ \fn QRhiRenderTarget *QRhiSwapChain::currentFrameRenderTarget()
+
+ \return a render target that can used with beginPass() in order to render
+ the the swapchain's current backbuffer. Only valid within a
+ QRhi::beginFrame() - QRhi::endFrame() block where beginFrame() was called
+ with this swapchain.
+
+ \note the value must not be cached and reused between frames
+ */
+
+/*!
+ \fn bool QRhiSwapChain::buildOrResize()
+
+ Creates the swapchain if not already done and resizes the swapchain buffers
+ to match the current size of the targeted surface. Call this whenever the
+ size of the target surface is different than before.
+
+ \note call release() only when the swapchain needs to be released
+ completely, typically upon
+ QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed. To perform resizing, just
+ call buildOrResize().
+
+ \return \c true when successful, \c false when a graphics operation failed.
+ Regardless of the return value, calling release() is always safe.
+ */
+
+/*!
+ \class QRhiComputePipeline
+ \internal
+ \inmodule QtGui
+ \brief Compute pipeline state resource.
+
+ \note Setting the shader resource bindings is mandatory. The referenced
+ QRhiShaderResourceBindings must already be built by the time build() is
+ called.
+
+ \note Setting the shader is mandatory.
+ */
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiComputePipeline::resourceType() const
+{
+ return ComputePipeline;
+}
+
+/*!
+ \internal
+ */
+QRhiComputePipeline::QRhiComputePipeline(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \class QRhiCommandBuffer
+ \internal
+ \inmodule QtGui
+ \brief Command buffer resource.
+
+ Not creatable by applications at the moment. The only ways to obtain a
+ valid QRhiCommandBuffer are to get it from the targeted swapchain via
+ QRhiSwapChain::currentFrameCommandBuffer(), or, in case of rendering
+ completely offscreen, initializing one via QRhi::beginOffscreenFrame().
+ */
+
+/*!
+ \enum QRhiCommandBuffer::IndexFormat
+ Specifies the index data type
+
+ \value IndexUInt16 Unsigned 16-bit (quint16)
+ \value IndexUInt32 Unsigned 32-bit (quint32)
+ */
+
+/*!
+ \typedef QRhiCommandBuffer::DynamicOffset
+
+ Synonym for QPair<int, quint32>. The first entry is the binding, the second
+ is the offset in the buffer.
+*/
+
+/*!
+ \typedef QRhiCommandBuffer::VertexInput
+
+ Synonym for QPair<QRhiBuffer *, quint32>. The second entry is an offset in
+ the buffer specified by the first.
+*/
+
+/*!
+ \internal
+ */
+QRhiCommandBuffer::QRhiCommandBuffer(QRhiImplementation *rhi)
+ : QRhiResource(rhi)
+{
+}
+
+/*!
+ \return the resource type.
+ */
+QRhiResource::Type QRhiCommandBuffer::resourceType() const
+{
+ return CommandBuffer;
+}
+
+#ifndef QT_NO_DEBUG
+static const char *resourceTypeStr(QRhiResource *res)
+{
+ switch (res->resourceType()) {
+ case QRhiResource::Buffer:
+ return "Buffer";
+ case QRhiResource::Texture:
+ return "Texture";
+ case QRhiResource::Sampler:
+ return "Sampler";
+ case QRhiResource::RenderBuffer:
+ return "RenderBuffer";
+ case QRhiResource::RenderPassDescriptor:
+ return "RenderPassDescriptor";
+ case QRhiResource::RenderTarget:
+ return "RenderTarget";
+ case QRhiResource::TextureRenderTarget:
+ return "TextureRenderTarget";
+ case QRhiResource::ShaderResourceBindings:
+ return "ShaderResourceBindings";
+ case QRhiResource::GraphicsPipeline:
+ return "GraphicsPipeline";
+ case QRhiResource::SwapChain:
+ return "SwapChain";
+ case QRhiResource::ComputePipeline:
+ return "ComputePipeline";
+ case QRhiResource::CommandBuffer:
+ return "CommandBuffer";
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return "";
+}
+#endif
+
+QRhiImplementation::~QRhiImplementation()
+{
+ qDeleteAll(resUpdPool);
+
+ // Be nice and show something about leaked stuff. Though we may not get
+ // this far with some backends where the allocator or the api may check
+ // and freak out for unfreed graphics objects in the derived dtor already.
+#ifndef QT_NO_DEBUG
+ if (!resources.isEmpty()) {
+ qWarning("QRhi %p going down with %d unreleased resources that own native graphics objects. This is not nice.",
+ q, resources.count());
+ for (QRhiResource *res : qAsConst(resources)) {
+ qWarning(" %s resource %p (%s)", resourceTypeStr(res), res, res->m_objectName.constData());
+ res->m_rhi = nullptr;
+ }
+ }
+#endif
+}
+
+bool QRhiImplementation::isCompressedFormat(QRhiTexture::Format format) const
+{
+ return (format >= QRhiTexture::BC1 && format <= QRhiTexture::BC7)
+ || (format >= QRhiTexture::ETC2_RGB8 && format <= QRhiTexture::ETC2_RGBA8)
+ || (format >= QRhiTexture::ASTC_4x4 && format <= QRhiTexture::ASTC_12x12);
+}
+
+void QRhiImplementation::compressedFormatInfo(QRhiTexture::Format format, const QSize &size,
+ quint32 *bpl, quint32 *byteSize,
+ QSize *blockDim) const
+{
+ int xdim = 4;
+ int ydim = 4;
+ quint32 blockSize = 0;
+
+ switch (format) {
+ case QRhiTexture::BC1:
+ blockSize = 8;
+ break;
+ case QRhiTexture::BC2:
+ blockSize = 16;
+ break;
+ case QRhiTexture::BC3:
+ blockSize = 16;
+ break;
+ case QRhiTexture::BC4:
+ blockSize = 8;
+ break;
+ case QRhiTexture::BC5:
+ blockSize = 16;
+ break;
+ case QRhiTexture::BC6H:
+ blockSize = 16;
+ break;
+ case QRhiTexture::BC7:
+ blockSize = 16;
+ break;
+
+ case QRhiTexture::ETC2_RGB8:
+ blockSize = 8;
+ break;
+ case QRhiTexture::ETC2_RGB8A1:
+ blockSize = 8;
+ break;
+ case QRhiTexture::ETC2_RGBA8:
+ blockSize = 16;
+ break;
+
+ case QRhiTexture::ASTC_4x4:
+ blockSize = 16;
+ break;
+ case QRhiTexture::ASTC_5x4:
+ blockSize = 16;
+ xdim = 5;
+ break;
+ case QRhiTexture::ASTC_5x5:
+ blockSize = 16;
+ xdim = ydim = 5;
+ break;
+ case QRhiTexture::ASTC_6x5:
+ blockSize = 16;
+ xdim = 6;
+ ydim = 5;
+ break;
+ case QRhiTexture::ASTC_6x6:
+ blockSize = 16;
+ xdim = ydim = 6;
+ break;
+ case QRhiTexture::ASTC_8x5:
+ blockSize = 16;
+ xdim = 8;
+ ydim = 5;
+ break;
+ case QRhiTexture::ASTC_8x6:
+ blockSize = 16;
+ xdim = 8;
+ ydim = 6;
+ break;
+ case QRhiTexture::ASTC_8x8:
+ blockSize = 16;
+ xdim = ydim = 8;
+ break;
+ case QRhiTexture::ASTC_10x5:
+ blockSize = 16;
+ xdim = 10;
+ ydim = 5;
+ break;
+ case QRhiTexture::ASTC_10x6:
+ blockSize = 16;
+ xdim = 10;
+ ydim = 6;
+ break;
+ case QRhiTexture::ASTC_10x8:
+ blockSize = 16;
+ xdim = 10;
+ ydim = 8;
+ break;
+ case QRhiTexture::ASTC_10x10:
+ blockSize = 16;
+ xdim = ydim = 10;
+ break;
+ case QRhiTexture::ASTC_12x10:
+ blockSize = 16;
+ xdim = 12;
+ ydim = 10;
+ break;
+ case QRhiTexture::ASTC_12x12:
+ blockSize = 16;
+ xdim = ydim = 12;
+ break;
+
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ const quint32 wblocks = uint((size.width() + xdim - 1) / xdim);
+ const quint32 hblocks = uint((size.height() + ydim - 1) / ydim);
+
+ if (bpl)
+ *bpl = wblocks * blockSize;
+ if (byteSize)
+ *byteSize = wblocks * hblocks * blockSize;
+ if (blockDim)
+ *blockDim = QSize(xdim, ydim);
+}
+
+void QRhiImplementation::textureFormatInfo(QRhiTexture::Format format, const QSize &size,
+ quint32 *bpl, quint32 *byteSize) const
+{
+ if (isCompressedFormat(format)) {
+ compressedFormatInfo(format, size, bpl, byteSize, nullptr);
+ return;
+ }
+
+ quint32 bpc = 0;
+ switch (format) {
+ case QRhiTexture::RGBA8:
+ bpc = 4;
+ break;
+ case QRhiTexture::BGRA8:
+ bpc = 4;
+ break;
+ case QRhiTexture::R8:
+ bpc = 1;
+ break;
+ case QRhiTexture::R16:
+ bpc = 2;
+ break;
+ case QRhiTexture::RED_OR_ALPHA8:
+ bpc = 1;
+ break;
+
+ case QRhiTexture::RGBA16F:
+ bpc = 8;
+ break;
+ case QRhiTexture::RGBA32F:
+ bpc = 16;
+ break;
+
+ case QRhiTexture::D16:
+ bpc = 2;
+ break;
+ case QRhiTexture::D32F:
+ bpc = 4;
+ break;
+
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ if (bpl)
+ *bpl = uint(size.width()) * bpc;
+ if (byteSize)
+ *byteSize = uint(size.width() * size.height()) * bpc;
+}
+
+// Approximate because it excludes subresource alignment or multisampling.
+quint32 QRhiImplementation::approxByteSizeForTexture(QRhiTexture::Format format, const QSize &baseSize,
+ int mipCount, int layerCount)
+{
+ quint32 approxSize = 0;
+ for (int level = 0; level < mipCount; ++level) {
+ quint32 byteSize = 0;
+ const QSize size(qFloor(qreal(qMax(1, baseSize.width() >> level))),
+ qFloor(qreal(qMax(1, baseSize.height() >> level))));
+ textureFormatInfo(format, size, nullptr, &byteSize);
+ approxSize += byteSize;
+ }
+ approxSize *= uint(layerCount);
+ return approxSize;
+}
+
+bool QRhiImplementation::sanityCheckGraphicsPipeline(QRhiGraphicsPipeline *ps)
+{
+ if (ps->cbeginShaderStages() == ps->cendShaderStages()) {
+ qWarning("Cannot build a graphics pipeline without any stages");
+ return false;
+ }
+
+ bool hasVertexStage = false;
+ for (auto it = ps->cbeginShaderStages(), itEnd = ps->cendShaderStages(); it != itEnd; ++it) {
+ if (!it->shader().isValid()) {
+ qWarning("Empty shader passed to graphics pipeline");
+ return false;
+ }
+ if (it->type() == QRhiShaderStage::Vertex) {
+ hasVertexStage = true;
+ const QRhiVertexInputLayout inputLayout = ps->vertexInputLayout();
+ if (inputLayout.cbeginAttributes() == inputLayout.cendAttributes()) {
+ qWarning("Vertex stage present without any vertex inputs");
+ return false;
+ }
+ }
+ }
+ if (!hasVertexStage) {
+ qWarning("Cannot build a graphics pipeline without a vertex stage");
+ return false;
+ }
+
+ if (!ps->renderPassDescriptor()) {
+ qWarning("Cannot build a graphics pipeline without a QRhiRenderPassDescriptor");
+ return false;
+ }
+
+ if (!ps->shaderResourceBindings()) {
+ qWarning("Cannot build a graphics pipeline without QRhiShaderResourceBindings");
+ return false;
+ }
+
+ return true;
+}
+
+/*!
+ \internal
+ */
+QRhi::QRhi()
+{
+}
+
+/*!
+ Destructor. Destroys the backend and releases resources.
+ */
+QRhi::~QRhi()
+{
+ if (!d)
+ return;
+
+ qDeleteAll(d->pendingReleaseAndDestroyResources);
+ d->pendingReleaseAndDestroyResources.clear();
+
+ runCleanup();
+
+ d->destroy();
+ delete d;
+}
+
+/*!
+ \return a new QRhi instance with a backend for the graphics API specified by \a impl.
+
+ \a params must point to an instance of one of the backend-specific
+ subclasses of QRhiInitParams, such as, QRhiVulkanInitParams,
+ QRhiMetalInitParams, QRhiD3D11InitParams, QRhiGles2InitParams. See these
+ classes for examples on creating a QRhi.
+
+ \a flags is optional. It is used to enable profile and debug related
+ features that are potentially expensive and should only be used during
+ development.
+ */
+QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRhiNativeHandles *importDevice)
+{
+ QScopedPointer<QRhi> r(new QRhi);
+
+ switch (impl) {
+ case Null:
+ r->d = new QRhiNull(static_cast<QRhiNullInitParams *>(params));
+ break;
+ case Vulkan:
+#if QT_CONFIG(vulkan)
+ r->d = new QRhiVulkan(static_cast<QRhiVulkanInitParams *>(params),
+ static_cast<QRhiVulkanNativeHandles *>(importDevice));
+ break;
+#else
+ Q_UNUSED(importDevice);
+ qWarning("This build of Qt has no Vulkan support");
+ break;
+#endif
+ case OpenGLES2:
+#ifndef QT_NO_OPENGL
+ r->d = new QRhiGles2(static_cast<QRhiGles2InitParams *>(params),
+ static_cast<QRhiGles2NativeHandles *>(importDevice));
+ break;
+#else
+ qWarning("This build of Qt has no OpenGL support");
+ break;
+#endif
+ case D3D11:
+#ifdef Q_OS_WIN
+ r->d = new QRhiD3D11(static_cast<QRhiD3D11InitParams *>(params),
+ static_cast<QRhiD3D11NativeHandles *>(importDevice));
+ break;
+#else
+ qWarning("This platform has no Direct3D 11 support");
+ break;
+#endif
+ case Metal:
+//#ifdef Q_OS_DARWIN
+#ifdef Q_OS_MACOS
+ r->d = new QRhiMetal(static_cast<QRhiMetalInitParams *>(params),
+ static_cast<QRhiMetalNativeHandles *>(importDevice));
+ break;
+#else
+ qWarning("This platform has no Metal support");
+ break;
+#endif
+ default:
+ break;
+ }
+
+ if (r->d) {
+ r->d->q = r.data();
+
+ if (flags.testFlag(EnableProfiling)) {
+ QRhiProfilerPrivate *profD = QRhiProfilerPrivate::get(&r->d->profiler);
+ profD->rhiDWhenEnabled = r->d;
+ const_cast<QLoggingCategory &>(QRHI_LOG_INFO()).setEnabled(QtDebugMsg, true);
+ }
+
+ // Play nice with QSG_INFO since that is still the most commonly used
+ // way to get graphics info printed from Qt Quick apps, and the Quick
+ // scenegraph is our primary user.
+ if (qEnvironmentVariableIsSet("QSG_INFO"))
+ const_cast<QLoggingCategory &>(QRHI_LOG_INFO()).setEnabled(QtDebugMsg, true);
+
+ r->d->debugMarkers = flags.testFlag(EnableDebugMarkers);
+
+ if (r->d->create(flags)) {
+ r->d->implType = impl;
+ r->d->implThread = QThread::currentThread();
+ return r.take();
+ }
+ }
+
+ return nullptr;
+}
+
+/*!
+ \return the backend type for this QRhi.
+ */
+QRhi::Implementation QRhi::backend() const
+{
+ return d->implType;
+}
+
+/*!
+ \return the thread on which the QRhi was \l{QRhi::create()}{initialized}.
+ */
+QThread *QRhi::thread() const
+{
+ return d->implThread;
+}
+
+/*!
+ Registers a \a callback that is invoked either when the QRhi is destroyed,
+ or when runCleanup() is called.
+
+ The callback will run with the graphics resource still available, so this
+ provides an opportunity for the application to cleanly release QRhiResource
+ instances belonging to the QRhi. This is particularly useful for managing
+ the lifetime of resources stored in \c cache type of objects, where the
+ cache holds QRhiResources or objects containing QRhiResources.
+
+ \sa runCleanup(), ~QRhi()
+ */
+void QRhi::addCleanupCallback(const CleanupCallback &callback)
+{
+ d->addCleanupCallback(callback);
+}
+
+/*!
+ Invokes all registered cleanup functions. The list of cleanup callbacks it
+ then cleared. Normally destroying the QRhi does this automatically, but
+ sometimes it can be useful to trigger cleanup in order to release all
+ cached, non-essential resources.
+
+ \sa addCleanupCallback()
+ */
+void QRhi::runCleanup()
+{
+ for (const CleanupCallback &f : qAsConst(d->cleanupCallbacks))
+ f(this);
+
+ d->cleanupCallbacks.clear();
+}
+
+/*!
+ \class QRhiResourceUpdateBatch
+ \internal
+ \inmodule QtGui
+ \brief Records upload and copy type of operations.
+
+ With QRhi it is no longer possible to perform copy type of operations at
+ arbitrary times. Instead, all such operations are recorded into batches
+ that are then passed, most commonly, to QRhiCommandBuffer::beginPass().
+ What then happens under the hood is hidden from the application: the
+ underlying implementations can defer and implement these operations in
+ various different ways.
+
+ A resource update batch owns no graphics resources and does not perform any
+ actual operations on its own. It should rather be viewed as a command
+ buffer for update, upload, and copy type of commands.
+
+ To get an available, empty batch from the pool, call
+ QRhi::nextResourceUpdateBatch().
+ */
+
+/*!
+ \internal
+ */
+QRhiResourceUpdateBatch::QRhiResourceUpdateBatch(QRhiImplementation *rhi)
+ : d(new QRhiResourceUpdateBatchPrivate)
+{
+ d->q = this;
+ d->rhi = rhi;
+}
+
+QRhiResourceUpdateBatch::~QRhiResourceUpdateBatch()
+{
+ delete d;
+}
+
+/*!
+ \return the batch to the pool. This should only be used when the batch is
+ not passed to one of QRhiCommandBuffer::beginPass(),
+ QRhiCommandBuffer::endPass(), or QRhiCommandBuffer::resourceUpdate()
+ because these implicitly call release().
+
+ \note QRhiResourceUpdateBatch instances must never by \c deleted by
+ applications.
+ */
+void QRhiResourceUpdateBatch::release()
+{
+ d->free();
+}
+
+/*!
+ Copies all queued operations from the \a other batch into this one.
+
+ \note \a other is not changed in any way, typically it will still need a
+ release()
+
+ This allows for a convenient pattern where resource updates that are
+ already known during the initialization step are collected into a batch
+ that is then merged into another when starting to first render pass later
+ on:
+
+ \badcode
+ void init()
+ {
+ ...
+ initialUpdates = rhi->nextResourceUpdateBatch();
+ initialUpdates->uploadStaticBuffer(vbuf, vertexData);
+ initialUpdates->uploadStaticBuffer(ibuf, indexData);
+ ...
+ }
+
+ void render()
+ {
+ ...
+ QRhiResourceUpdateBatch *resUpdates = rhi->nextResourceUpdateBatch();
+ if (initialUpdates) {
+ resUpdates->merge(initialUpdates);
+ initialUpdates->release();
+ initialUpdates = nullptr;
+ }
+ resUpdates->updateDynamicBuffer(...);
+ ...
+ cb->beginPass(rt, clearCol, clearDs, resUpdates);
+ }
+ \endcode
+ */
+void QRhiResourceUpdateBatch::merge(QRhiResourceUpdateBatch *other)
+{
+ d->merge(other->d);
+}
+
+/*!
+ Enqueues updating a region of a QRhiBuffer \a buf created with the type
+ QRhiBuffer::Dynamic.
+
+ The region is specified \a offset and \a size. The actual bytes to write
+ are specified by \a data which must have at least \a size bytes available.
+ \a data can safely be destroyed or changed once this function returns.
+
+ \note If host writes are involved, which is the case with
+ updateDynamicBuffer() typically as such buffers are backed by host visible
+ memory with most backends, they may accumulate within a frame. Thus pass 1
+ reading a region changed by a batch passed to pass 2 may see the changes
+ specified in pass 2's update batch.
+
+ \note QRhi transparently manages double buffering in order to prevent
+ stalling the graphics pipeline. The fact that a QRhiBuffer may have
+ multiple native underneath can be safely ignored when using the QRhi and
+ QRhiResourceUpdateBatch.
+ */
+void QRhiResourceUpdateBatch::updateDynamicBuffer(QRhiBuffer *buf, int offset, int size, const void *data)
+{
+ if (size > 0)
+ d->bufferOps.append(QRhiResourceUpdateBatchPrivate::BufferOp::dynamicUpdate(buf, offset, size, data));
+}
+
+/*!
+ Enqueues updating a region of a QRhiBuffer \a buf created with the type
+ QRhiBuffer::Immutable or QRhiBuffer::Static.
+
+ The region is specified \a offset and \a size. The actual bytes to write
+ are specified by \a data which must have at least \a size bytes available.
+ \a data can safely be destroyed or changed once this function returns.
+ */
+void QRhiResourceUpdateBatch::uploadStaticBuffer(QRhiBuffer *buf, int offset, int size, const void *data)
+{
+ if (size > 0)
+ d->bufferOps.append(QRhiResourceUpdateBatchPrivate::BufferOp::staticUpload(buf, offset, size, data));
+}
+
+/*!
+ Enqueues updating the entire QRhiBuffer \a buf created with the type
+ QRhiBuffer::Immutable or QRhiBuffer::Static.
+ */
+void QRhiResourceUpdateBatch::uploadStaticBuffer(QRhiBuffer *buf, const void *data)
+{
+ if (buf->size() > 0)
+ d->bufferOps.append(QRhiResourceUpdateBatchPrivate::BufferOp::staticUpload(buf, 0, 0, data));
+}
+
+/*!
+ Enqueues reading back a region of the QRhiBuffer \a buf. The size of the
+ region is specified by \a size in bytes, \a offset is the offset in bytes
+ to start reading from.
+
+ A readback is asynchronous. \a result contains a callback that is invoked
+ when the operation has completed. The data is provided in
+ QRhiBufferReadbackResult::data. Upon successful completion that QByteArray
+ will have a size equal to \a size. On failure the QByteArray will be empty.
+
+ \note Reading buffers with a usage different than QRhiBuffer::UniformBuffer
+ is supported only when the QRhi::ReadBackNonUniformBuffer feature is
+ reported as supported.
+
+ \a readBackTexture(), QRhi::isFeatureSupported()
+ */
+void QRhiResourceUpdateBatch::readBackBuffer(QRhiBuffer *buf, int offset, int size, QRhiBufferReadbackResult *result)
+{
+ d->bufferOps.append(QRhiResourceUpdateBatchPrivate::BufferOp::read(buf, offset, size, result));
+}
+
+/*!
+ Enqueues uploading the image data for one or more mip levels in one or more
+ layers of the texture \a tex.
+
+ The details of the copy (source QImage or compressed texture data, regions,
+ target layers and levels) are described in \a desc.
+ */
+void QRhiResourceUpdateBatch::uploadTexture(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
+{
+ if (desc.cbeginEntries() != desc.cendEntries())
+ d->textureOps.append(QRhiResourceUpdateBatchPrivate::TextureOp::upload(tex, desc));
+}
+
+/*!
+ Enqueues uploading the image data for mip level 0 of layer 0 of the texture
+ \a tex.
+
+ \a tex must have an uncompressed format. Its format must also be compatible
+ with the QImage::format() of \a image. The source data is given in \a
+ image.
+ */
+void QRhiResourceUpdateBatch::uploadTexture(QRhiTexture *tex, const QImage &image)
+{
+ uploadTexture(tex, QRhiTextureUploadEntry(0, 0, image));
+}
+
+/*!
+ Enqueues a texture-to-texture copy operation from \a src into \a dst as
+ described by \a desc.
+
+ \note The source texture \a src must be created with
+ QRhiTexture::UsedAsTransferSource.
+ */
+void QRhiResourceUpdateBatch::copyTexture(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
+{
+ d->textureOps.append(QRhiResourceUpdateBatchPrivate::TextureOp::copy(dst, src, desc));
+}
+
+/*!
+ Enqueues a texture-to-host copy operation as described by \a rb.
+
+ Normally \a rb will specify a QRhiTexture as the source. However, when the
+ swapchain in the current frame was created with
+ QRhiSwapChain::UsedAsTransferSource, it can also be the source of the
+ readback. For this, leave the texture set to null in \a rb.
+
+ Unlike other operations, the results here need to be processed by the
+ application. Therefore, \a result provides not just the data but also a
+ callback as operations on the batch are asynchronous by nature:
+
+ \badcode
+ beginFrame(sc);
+ beginPass
+ ...
+ QRhiReadbackResult *rbResult = new QRhiReadbackResult;
+ rbResult->completed = [rbResult] {
+ {
+ const QImage::Format fmt = QImage::Format_RGBA8888_Premultiplied; // fits QRhiTexture::RGBA8
+ const uchar *p = reinterpret_cast<const uchar *>(rbResult->data.constData());
+ QImage image(p, rbResult->pixelSize.width(), rbResult->pixelSize.height(), fmt);
+ image.save("result.png");
+ }
+ delete rbResult;
+ };
+ u = nextResourceUpdateBatch();
+ QRhiReadbackDescription rb; // no texture -> uses the current backbuffer of sc
+ u->readBackTexture(rb, rbResult);
+ endPass(u);
+ endFrame(sc);
+ \endcode
+
+ \note The texture must be created with QRhiTexture::UsedAsTransferSource.
+
+ \note Multisample textures cannot be read back.
+
+ \note The readback returns raw byte data, in order to allow the applications
+ to interpret it in any way they see fit. Be aware of the blending settings
+ of rendering code: if the blending is set up to rely on premultiplied alpha,
+ the results of the readback must also be interpreted as Premultiplied.
+
+ \note When interpreting the resulting raw data, be aware that the readback
+ happens with a byte ordered format. A \l{QRhiTexture::RGBA8}{RGBA8} texture
+ maps therefore to byte ordered QImage formats, such as,
+ QImage::Format_RGBA8888.
+ */
+void QRhiResourceUpdateBatch::readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
+{
+ d->textureOps.append(QRhiResourceUpdateBatchPrivate::TextureOp::read(rb, result));
+}
+
+/*!
+ Enqueues a mipmap generation operation for the specified \a layer of texture
+ \a tex.
+
+ \note The texture must be created with QRhiTexture::MipMapped and
+ QRhiTexture::UsedWithGenerateMips.
+ */
+void QRhiResourceUpdateBatch::generateMips(QRhiTexture *tex, int layer)
+{
+ d->textureOps.append(QRhiResourceUpdateBatchPrivate::TextureOp::genMips(tex, layer));
+}
+
+/*!
+ \return an available, empty batch to which copy type of operations can be
+ recorded.
+
+ \note the return value is not owned by the caller and must never be
+ destroyed. Instead, the batch is returned the the pool for reuse by passing
+ it to QRhiCommandBuffer::beginPass(), QRhiCommandBuffer::endPass(), or
+ QRhiCommandBuffer::resourceUpdate(), or by calling
+ QRhiResourceUpdateBatch::release() on it.
+
+ \note Can be called outside beginFrame() - endFrame() as well since a batch
+ instance just collects data on its own, it does not perform any operations.
+ */
+QRhiResourceUpdateBatch *QRhi::nextResourceUpdateBatch()
+{
+ auto nextFreeBatch = [this]() -> QRhiResourceUpdateBatch * {
+ for (int i = 0, ie = d->resUpdPoolMap.count(); i != ie; ++i) {
+ if (!d->resUpdPoolMap.testBit(i)) {
+ d->resUpdPoolMap.setBit(i);
+ QRhiResourceUpdateBatch *u = d->resUpdPool[i];
+ QRhiResourceUpdateBatchPrivate::get(u)->poolIndex = i;
+ return u;
+ }
+ }
+ return nullptr;
+ };
+
+ QRhiResourceUpdateBatch *u = nextFreeBatch();
+ if (!u) {
+ const int oldSize = d->resUpdPool.count();
+ const int newSize = oldSize + 4;
+ d->resUpdPool.resize(newSize);
+ d->resUpdPoolMap.resize(newSize);
+ for (int i = oldSize; i < newSize; ++i)
+ d->resUpdPool[i] = new QRhiResourceUpdateBatch(d);
+ u = nextFreeBatch();
+ Q_ASSERT(u);
+ }
+
+ return u;
+}
+
+void QRhiResourceUpdateBatchPrivate::free()
+{
+ Q_ASSERT(poolIndex >= 0 && rhi->resUpdPool[poolIndex] == q);
+
+ bufferOps.clear();
+ textureOps.clear();
+
+ rhi->resUpdPoolMap.clearBit(poolIndex);
+ poolIndex = -1;
+}
+
+void QRhiResourceUpdateBatchPrivate::merge(QRhiResourceUpdateBatchPrivate *other)
+{
+ bufferOps.reserve(bufferOps.size() + other->bufferOps.size());
+ for (const BufferOp &op : qAsConst(other->bufferOps))
+ bufferOps.append(op);
+
+ textureOps.reserve(textureOps.size() + other->textureOps.size());
+ for (const TextureOp &op : qAsConst(other->textureOps))
+ textureOps.append(op);
+}
+
+/*!
+ Sometimes committing resource updates is necessary without starting a
+ render pass. Not often needed, updates should typically be passed to
+ beginPass (or endPass, in case of readbacks) instead.
+
+ \note Cannot be called inside a pass.
+ */
+void QRhiCommandBuffer::resourceUpdate(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (resourceUpdates)
+ m_rhi->resourceUpdate(this, resourceUpdates);
+}
+
+/*!
+ Records starting a new render pass targeting the render target \a rt.
+
+ \a resourceUpdates, when not null, specifies a resource update batch that
+ is to be committed and then released.
+
+ The color and depth/stencil buffers of the render target are normally
+ cleared. The clear values are specified in \a colorClearValue and \a
+ depthStencilClearValue. The exception is when the render target was created
+ with QRhiTextureRenderTarget::PreserveColorContents and/or
+ QRhiTextureRenderTarget::PreserveDepthStencilContents. The clear values are
+ ignored then.
+
+ \note Enabling preserved color or depth contents leads to decreased
+ performance depending on the underlying hardware. Mobile GPUs with tiled
+ architecture benefit from not having to reload the previous contents into
+ the tile buffer. Similarly, a QRhiTextureRenderTarget with a QRhiTexture as
+ the depth buffer is less efficient than a QRhiRenderBuffer since using a
+ depth texture triggers requiring writing the data out to it, while with
+ renderbuffers this is not needed (as the API does not allow sampling or
+ reading from a renderbuffer).
+
+ \note Do not assume that any state or resource bindings persist between
+ passes.
+
+ \note The QRhiCommandBuffer's \c set and \c draw functions can only be
+ called inside a pass. Also, with the exception of setGraphicsPipeline(),
+ they expect to have a pipeline set already on the command buffer.
+ Unspecified issues may arise otherwise, depending on the backend.
+ */
+void QRhiCommandBuffer::beginPass(QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates)
+{
+ m_rhi->beginPass(this, rt, colorClearValue, depthStencilClearValue, resourceUpdates);
+}
+
+/*!
+ Records ending the current render pass.
+
+ \a resourceUpdates, when not null, specifies a resource update batch that
+ is to be committed and then released.
+ */
+void QRhiCommandBuffer::endPass(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ m_rhi->endPass(this, resourceUpdates);
+}
+
+/*!
+ Records setting a new graphics pipeline \a ps.
+
+ \note This function must be called before recording other \c set or \c draw
+ commands on the command buffer.
+
+ \note QRhi will optimize out unnecessary invocations within a pass, so
+ therefore overoptimizing to avoid calls to this function is not necessary
+ on the applications' side.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::setGraphicsPipeline(QRhiGraphicsPipeline *ps)
+{
+ m_rhi->setGraphicsPipeline(this, ps);
+}
+
+/*!
+ Records binding a set of shader resources, such as, uniform buffers or
+ textures, that are made visible to one or more shader stages.
+
+ \a srb can be null in which case the current graphics or compute pipeline's
+ associated QRhiShaderResourceBindings is used. When \a srb is non-null, it
+ must be
+ \l{QRhiShaderResourceBindings::isLayoutCompatible()}{layout-compatible},
+ meaning the layout (number of bindings, the type and binding number of each
+ binding) must fully match the QRhiShaderResourceBindings that was
+ associated with the pipeline at the time of calling the pipeline's build().
+
+ There are cases when a seemingly unnecessary setShaderResources() call is
+ mandatory: when rebuilding a resource referenced from \a srb, for example
+ changing the size of a QRhiBuffer followed by a QRhiBuffer::build(), this
+ is the place where associated native objects (such as descriptor sets in
+ case of Vulkan) are updated to refer to the current native resources that
+ back the QRhiBuffer, QRhiTexture, QRhiSampler objects referenced from \a
+ srb. In this case setShaderResources() must be called even if \a srb is
+ the same as in the last call.
+
+ \a dynamicOffsets allows specifying buffer offsets for uniform buffers that
+ were associated with \a srb via
+ QRhiShaderResourceBinding::uniformBufferWithDynamicOffset(). This is
+ different from providing the offset in the \a srb itself: dynamic offsets
+ do not require building a new QRhiShaderResourceBindings for every
+ different offset, can avoid writing the underlying descriptors (with
+ backends where applicable), and so they may be more efficient. Each element
+ of \a dynamicOffsets is a \c binding - \c offset pair.
+ \a dynamicOffsetCount specifies the number of elements in \a dynamicOffsets.
+
+ \note All offsets in \a dynamicOffsets must be byte aligned to the value
+ returned from QRhi::ubufAlignment().
+
+ \note QRhi will optimize out unnecessary invocations within a pass (taking
+ the conditions described above into account), so therefore overoptimizing
+ to avoid calls to this function is not necessary on the applications' side.
+
+ \note This function can only be called inside a render or compute pass,
+ meaning between a beginPass() and endPass(), or beginComputePass() and
+ endComputePass().
+ */
+void QRhiCommandBuffer::setShaderResources(QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const DynamicOffset *dynamicOffsets)
+{
+ m_rhi->setShaderResources(this, srb, dynamicOffsetCount, dynamicOffsets);
+}
+
+/*!
+ Records vertex input bindings.
+
+ The index buffer used by subsequent drawIndexed() commands is specified by
+ \a indexBuf, \a indexOffset, and \a indexFormat. \a indexBuf can be set to
+ null when indexed drawing is not needed.
+
+ Vertex buffer bindings are batched. \a startBinding specifies the first
+ binding number. The recorded command then binds each buffer from \a
+ bindings to the binding point \c{startBinding + i} where \c i is the index
+ in \a bindings. Each element in \a bindings specifies a QRhiBuffer and an
+ offset.
+
+ Superfluous vertex input and index changes in the same pass are ignored
+ automatically with most backends and therefore applications do not need to
+ overoptimize to avoid calls to this function.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+
+ As a simple example, take a vertex shader with two inputs:
+
+ \badcode
+ layout(location = 0) in vec4 position;
+ layout(location = 1) in vec3 color;
+ \endcode
+
+ and assume we have the data available in interleaved format, using only 2
+ floats for position (so 5 floats per vertex: x, y, r, g, b). A QRhiGraphicsPipeline for
+ this shader can then be created using the input layout:
+
+ \badcode
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+ \endcode
+
+ Here there is one buffer binding (binding number 0), with two inputs
+ referencing it. When recording the pass, once the pipeline is set, the
+ vertex bindings can be specified simply like the following (using C++11
+ initializer syntax), assuming vbuf is the QRhiBuffer with all the
+ interleaved position+color data:
+
+ \badcode
+ const QRhiCommandBuffer::VertexInput vbufBinding(vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ \endcode
+ */
+void QRhiCommandBuffer::setVertexInput(int startBinding, int bindingCount, const VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ IndexFormat indexFormat)
+{
+ m_rhi->setVertexInput(this, startBinding, bindingCount, bindings, indexBuf, indexOffset, indexFormat);
+}
+
+/*!
+ Records setting the active viewport rectangle specified in \a viewport.
+
+ With backends where the underlying graphics API has scissoring always
+ enabled, this function also sets the scissor to match the viewport whenever
+ the active QRhiGraphicsPipeline does not have
+ \l{QRhiGraphicsPipeline::UsesScissor}{UsesScissor} set.
+
+ \note QRhi assumes OpenGL-style viewport coordinates, meaning x and y are
+ bottom-left.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::setViewport(const QRhiViewport &viewport)
+{
+ m_rhi->setViewport(this, viewport);
+}
+
+/*!
+ Records setting the active scissor rectangle specified in \a scissor.
+
+ This can only be called when the bound pipeline has
+ \l{QRhiGraphicsPipeline::UsesScissor}{UsesScissor} set. When the flag is
+ set on the active pipeline, this function must be called because scissor
+ testing will get enabled and so a scissor rectangle must be provided.
+
+ \note QRhi assumes OpenGL-style viewport coordinates, meaning x and y are
+ bottom-left.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::setScissor(const QRhiScissor &scissor)
+{
+ m_rhi->setScissor(this, scissor);
+}
+
+/*!
+ Records setting the active blend constants to \a c.
+
+ This can only be called when the bound pipeline has
+ QRhiGraphicsPipeline::UsesBlendConstants set.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::setBlendConstants(const QColor &c)
+{
+ m_rhi->setBlendConstants(this, c);
+}
+
+/*!
+ Records setting the active stencil reference value to \a refValue.
+
+ This can only be called when the bound pipeline has
+ QRhiGraphicsPipeline::UsesStencilRef set.
+
+ \note This function can only be called inside a render pass, meaning between
+ a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::setStencilRef(quint32 refValue)
+{
+ m_rhi->setStencilRef(this, refValue);
+}
+
+/*!
+ Records a non-indexed draw.
+
+ The number of vertices is specified in \a vertexCount. For instanced
+ drawing set \a instanceCount to a value other than 1. \a firstVertex is the
+ index of the first vertex to draw. When drawing multiple instances, the
+ first instance ID is specified by \a firstInstance.
+
+ \note \a firstInstance may not be supported, and is ignored when the
+ QRhi::BaseInstance feature is reported as not supported. The first ID is
+ always 0 in that case.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::draw(quint32 vertexCount,
+ quint32 instanceCount,
+ quint32 firstVertex,
+ quint32 firstInstance)
+{
+ m_rhi->draw(this, vertexCount, instanceCount, firstVertex, firstInstance);
+}
+
+/*!
+ Records an indexed draw.
+
+ The number of vertices is specified in \a indexCount. \a firstIndex is the
+ base index. The effective offset in the index buffer is given by
+ \c{indexOffset + firstIndex * n} where \c n is 2 or 4 depending on the
+ index element type. \c indexOffset is specified in setVertexInput().
+
+ \note The effective offset in the index buffer must be 4 byte aligned with
+ some backends (for example, Metal). With these backends the
+ \l{QRhi::NonFourAlignedEffectiveIndexBufferOffset}{NonFourAlignedEffectiveIndexBufferOffset}
+ feature will be reported as not-supported.
+
+ For instanced drawing set \a instanceCount to a value other than 1. When
+ drawing multiple instances, the first instance ID is specified by \a
+ firstInstance.
+
+ \note \a firstInstance may not be supported, and is ignored when the
+ QRhi::BaseInstance feature is reported as not supported. The first ID is
+ always 0 in that case.
+
+ \a vertexOffset (also called \c{base vertex}) is a signed value that is
+ added to the element index before indexing into the vertex buffer. Support
+ for this is not always available, and the value is ignored when the feature
+ QRhi::BaseVertex is reported as unsupported.
+
+ \note This function can only be called inside a render pass, meaning
+ between a beginPass() and endPass() call.
+ */
+void QRhiCommandBuffer::drawIndexed(quint32 indexCount,
+ quint32 instanceCount,
+ quint32 firstIndex,
+ qint32 vertexOffset,
+ quint32 firstInstance)
+{
+ m_rhi->drawIndexed(this, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
+}
+
+/*!
+ Records a named debug group on the command buffer. This is shown in
+ graphics debugging tools such as \l{https://renderdoc.org/}{RenderDoc} and
+ \l{https://developer.apple.com/xcode/}{XCode}. The end of the grouping is
+ indicated by debugMarkEnd().
+
+ \note Ignored when QRhi::DebugMarkers are not supported or
+ QRhi::EnableDebugMarkers is not set.
+
+ \note Can be called anywhere within the frame, both inside and outside of passes.
+ */
+void QRhiCommandBuffer::debugMarkBegin(const QByteArray &name)
+{
+ m_rhi->debugMarkBegin(this, name);
+}
+
+/*!
+ Records the end of a debug group.
+
+ \note Ignored when QRhi::DebugMarkers are not supported or
+ QRhi::EnableDebugMarkers is not set.
+
+ \note Can be called anywhere within the frame, both inside and outside of passes.
+ */
+void QRhiCommandBuffer::debugMarkEnd()
+{
+ m_rhi->debugMarkEnd(this);
+}
+
+/*!
+ Inserts a debug message \a msg into the command stream.
+
+ \note Ignored when QRhi::DebugMarkers are not supported or
+ QRhi::EnableDebugMarkers is not set.
+
+ \note With some backends debugMarkMsg() is only supported inside a pass and
+ is ignored when called outside a pass. With others it is recorded anywhere
+ within the frame.
+ */
+void QRhiCommandBuffer::debugMarkMsg(const QByteArray &msg)
+{
+ m_rhi->debugMarkMsg(this, msg);
+}
+
+/*!
+ Records starting a new compute pass.
+
+ \a resourceUpdates, when not null, specifies a resource update batch that
+ is to be committed and then released.
+
+ \note Do not assume that any state or resource bindings persist between
+ passes.
+
+ \note A compute pass can record setComputePipeline(), setShaderResources(),
+ and dispatch() calls, not graphics ones. General functionality, such as,
+ debug markers and beginExternal() is available both in render and compute
+ passes.
+
+ \note Compute is only available when the \l{QRhi::Compute}{Compute} feature
+ is reported as supported.
+ */
+void QRhiCommandBuffer::beginComputePass(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ m_rhi->beginComputePass(this, resourceUpdates);
+}
+
+/*!
+ Records ending the current compute pass.
+
+ \a resourceUpdates, when not null, specifies a resource update batch that
+ is to be committed and then released.
+ */
+void QRhiCommandBuffer::endComputePass(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ m_rhi->endComputePass(this, resourceUpdates);
+}
+
+/*!
+ Records setting a new compute pipeline \a ps.
+
+ \note This function must be called before recording setShaderResources() or
+ dispatch() commands on the command buffer.
+
+ \note QRhi will optimize out unnecessary invocations within a pass, so
+ therefore overoptimizing to avoid calls to this function is not necessary
+ on the applications' side.
+
+ \note This function can only be called inside a compute pass, meaning
+ between a beginComputePass() and endComputePass() call.
+ */
+void QRhiCommandBuffer::setComputePipeline(QRhiComputePipeline *ps)
+{
+ m_rhi->setComputePipeline(this, ps);
+}
+
+/*!
+ Records dispatching compute work items, with \a x, \a y, and \a z
+ specifying the number of local workgroups in the corresponding dimension.
+
+ \note This function can only be called inside a compute pass, meaning
+ between a beginComputePass() and endComputePass() call.
+ */
+void QRhiCommandBuffer::dispatch(int x, int y, int z)
+{
+ m_rhi->dispatch(this, x, y, z);
+}
+
+/*!
+ \return a pointer to a backend-specific QRhiNativeHandles subclass, such as
+ QRhiVulkanCommandBufferNativeHandles. The returned value is null when
+ exposing the underlying native resources is not supported by, or not
+ applicable to, the backend.
+
+ \sa QRhiVulkanCommandBufferNativeHandles,
+ QRhiMetalCommandBufferNativeHandles, beginExternal(), endExternal()
+ */
+const QRhiNativeHandles *QRhiCommandBuffer::nativeHandles()
+{
+ return m_rhi->nativeHandles(this);
+}
+
+/*!
+ To be called when the application before the application is about to
+ enqueue commands to the current pass' command buffer by calling graphics
+ API functions directly.
+
+ \note This is only available when the intent was declared up front in
+ beginFrame(). Therefore this function must only be called when the frame
+ was started with specifying QRhi::ExternalContentsInPass in the flags
+ passed to QRhi::beginFrame().
+
+ With Vulkan or Metal one can query the native command buffer or encoder
+ objects via nativeHandles() and enqueue commands to them. With OpenGL or
+ Direct3D 11 the (device) context can be retrieved from
+ QRhi::nativeHandles(). However, this must never be done without ensuring
+ the QRhiCommandBuffer's state stays up-to-date. Hence the requirement for
+ wrapping any externally added command recording between beginExternal() and
+ endExternal(). Conceptually this is the same as QPainter's
+ \l{QPainter::beginNativePainting()}{beginNativePainting()} and
+ \l{QPainter::endNativePainting()}{endNativePainting()} functions.
+
+ For OpenGL in particular, this function has an additional task: it makes
+ sure the context is made current on the current thread.
+
+ \note Once beginExternal() is called, no other render pass specific
+ functions (\c set* or \c draw*) must be called on the
+ QRhiCommandBuffer until endExternal().
+
+ \warning Some backends may return a native command buffer object from
+ QRhiCommandBuffer::nativeHandles() that is different from the primary one
+ when inside a beginExternal() - endExternal() block. Therefore it is
+ important to (re)query the native command buffer object after calling
+ beginExternal(). In practical terms this means that with Vulkan for example
+ the externally recorded Vulkan commands are placed onto a secondary command
+ buffer (with VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT).
+ nativeHandles() returns this secondary command buffer when called between
+ begin/endExternal.
+
+ \sa endExternal(), nativeHandles()
+ */
+void QRhiCommandBuffer::beginExternal()
+{
+ m_rhi->beginExternal(this);
+}
+
+/*!
+ To be called once the externally added commands are recorded to the command
+ buffer or context.
+
+ \note All QRhiCommandBuffer state must be assumed as invalid after calling
+ this function. Pipelines, vertex and index buffers, and other state must be
+ set again if more draw calls are recorded after the external commands.
+
+ \sa beginExternal(), nativeHandles()
+ */
+void QRhiCommandBuffer::endExternal()
+{
+ m_rhi->endExternal(this);
+}
+
+/*!
+ \return the value (typically an offset) \a v aligned to the uniform buffer
+ alignment given by by ubufAlignment().
+ */
+int QRhi::ubufAligned(int v) const
+{
+ const int byteAlign = ubufAlignment();
+ return (v + byteAlign - 1) & ~(byteAlign - 1);
+}
+
+/*!
+ \return the number of mip levels for a given \a size.
+ */
+int QRhi::mipLevelsForSize(const QSize &size) const
+{
+ return qFloor(std::log2(qMax(size.width(), size.height()))) + 1;
+}
+
+/*!
+ \return the texture image size for a given \a mipLevel, calculated based on
+ the level 0 size given in \a baseLevelSize.
+ */
+QSize QRhi::sizeForMipLevel(int mipLevel, const QSize &baseLevelSize) const
+{
+ const int w = qMax(1, baseLevelSize.width() >> mipLevel);
+ const int h = qMax(1, baseLevelSize.height() >> mipLevel);
+ return QSize(w, h);
+}
+
+/*!
+ \return \c true if the underlying graphics API has the Y axis pointing up
+ in framebuffers and images.
+
+ In practice this is \c true for OpenGL only.
+ */
+bool QRhi::isYUpInFramebuffer() const
+{
+ return d->isYUpInFramebuffer();
+}
+
+/*!
+ \return \c true if the underlying graphics API has the Y axis pointing up
+ in its normalized device coordinate system.
+
+ In practice this is \c false for Vulkan only.
+
+ \note clipSpaceCorrMatrix() includes the corresponding adjustment (to make
+ Y point up) in its returned matrix.
+ */
+bool QRhi::isYUpInNDC() const
+{
+ return d->isYUpInNDC();
+}
+
+/*!
+ \return \c true if the underlying graphics API uses depth 0 - 1 in clip
+ space.
+
+ In practice this is \c false for OpenGL only.
+
+ \note clipSpaceCorrMatrix() includes the corresponding adjustment in its
+ returned matrix.
+ */
+bool QRhi::isClipDepthZeroToOne() const
+{
+ return d->isClipDepthZeroToOne();
+}
+
+/*!
+ \return a matrix that can be used to allow applications keep using
+ OpenGL-targeted vertex data and perspective projection matrices (such as,
+ the ones generated by QMatrix4x4::perspective()), regardless of the
+ backend. Once \c{this_matrix * mvp} is used instead of just \c mvp, vertex
+ data with Y up and viewports with depth range 0 - 1 can be used without
+ considering what backend and so graphics API is going to be used at run
+ time.
+
+ See
+ \l{https://matthewwellings.com/blog/the-new-vulkan-coordinate-system/}{this
+ page} for a discussion of the topic from Vulkan perspective.
+ */
+QMatrix4x4 QRhi::clipSpaceCorrMatrix() const
+{
+ return d->clipSpaceCorrMatrix();
+}
+
+/*!
+ \return \c true if the specified texture \a format modified by \a flags is
+ supported.
+
+ The query is supported both for uncompressed and compressed formats.
+ */
+bool QRhi::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const
+{
+ return d->isTextureFormatSupported(format, flags);
+}
+
+/*!
+ \return \c true if the specified \a feature is supported
+ */
+bool QRhi::isFeatureSupported(QRhi::Feature feature) const
+{
+ return d->isFeatureSupported(feature);
+}
+
+/*!
+ \return the value for the specified resource \a limit.
+
+ The values are expected to be queried by the backends upon initialization,
+ meaning calling this function is a light operation.
+ */
+int QRhi::resourceLimit(ResourceLimit limit) const
+{
+ return d->resourceLimit(limit);
+}
+
+/*!
+ \return a pointer to the backend-specific collection of native objects
+ for the device, context, and similar concepts used by the backend.
+
+ Cast to QRhiVulkanNativeHandles, QRhiD3D11NativeHandles,
+ QRhiGles2NativeHandles, QRhiMetalNativeHandles as appropriate.
+
+ \note No ownership is transferred, neither for the returned pointer nor for
+ any native objects.
+ */
+const QRhiNativeHandles *QRhi::nativeHandles()
+{
+ return d->nativeHandles();
+}
+
+/*!
+ With OpenGL this makes the OpenGL context current on the current thread.
+ The function has no effect with other backends.
+
+ Calling this function is relevant typically in Qt framework code, when one
+ has to ensure external OpenGL code provided by the application can still
+ run like it did before with direct usage of OpenGL, as long as the QRhi is
+ using the OpenGL backend.
+
+ \return false when failed, similarly to QOpenGLContext::makeCurrent(). When
+ the operation failed, isDeviceLost() can be called to determine if there
+ was a loss of context situation. Such a check is equivalent to checking via
+ QOpenGLContext::isValid().
+
+ \sa QOpenGLContext::makeCurrent(), QOpenGLContext::isValid()
+ */
+bool QRhi::makeThreadLocalNativeContextCurrent()
+{
+ return d->makeThreadLocalNativeContextCurrent();
+}
+
+/*!
+ \return the associated QRhiProfiler instance.
+
+ An instance is always available for each QRhi, but it is not very useful
+ without EnableProfiling because no data is collected without setting the
+ flag upon creation.
+ */
+QRhiProfiler *QRhi::profiler()
+{
+ return &d->profiler;
+}
+
+/*!
+ Attempts to release resources in the backend's caches. This can include both
+ CPU and GPU resources. Only memory and resources that can be recreated
+ automatically are in scope. As an example, if the backend's
+ QRhiGraphicsPipeline implementation maintains a cache of shader compilation
+ results, calling this function leads to emptying that cache, thus
+ potentially freeing up memory and graphics resources.
+
+ Calling this function makes sense in resource constrained environments,
+ where at a certain point there is a need to ensure minimal resource usage,
+ at the expense of performance.
+ */
+void QRhi::releaseCachedResources()
+{
+ d->releaseCachedResources();
+}
+
+/*!
+ \return true if the graphics device was lost.
+
+ The loss of the device is typically detected in beginFrame(), endFrame() or
+ QRhiSwapChain::buildOrResize(), depending on the backend and the underlying
+ native APIs. The most common is endFrame() because that is where presenting
+ happens. With some backends QRhiSwapChain::buildOrResize() can also fail
+ due to a device loss. Therefore this function is provided as a generic way
+ to check if a device loss was detected by a previous operation.
+
+ When the device is lost, no further operations should be done via the QRhi.
+ Rather, all QRhi resources should be released, followed by destroying the
+ QRhi. A new QRhi can then be attempted to be created. If successful, all
+ graphics resources must be reinitialized. If not, try again later,
+ repeatedly.
+
+ While simple applications may decide to not care about device loss,
+ on the commonly used desktop platforms a device loss can happen
+ due to a variety of reasons, including physically disconnecting the
+ graphics adapter, disabling the device or driver, uninstalling or upgrading
+ the graphics driver, or due to errors that lead to a graphics device reset.
+ Some of these can happen under perfectly normal circumstances as well, for
+ example the upgrade of the graphics driver to a newer version is a common
+ task that can happen at any time while a Qt application is running. Users
+ may very well expect applications to be able to survive this, even when the
+ application is actively using an API like OpenGL or Direct3D.
+
+ Qt's own frameworks built on top of QRhi, such as, Qt Quick, can be
+ expected to handle and take appropriate measures when a device loss occurs.
+ If the data for graphics resources, such as textures and buffers, are still
+ available on the CPU side, such an event may not be noticeable on the
+ application level at all since graphics resources can seamlessly be
+ reinitialized then. However, applications and libraries working directly
+ with QRhi are expected to be prepared to check and handle device loss
+ situations themselves.
+
+ \note With OpenGL, applications may need to opt-in to context reset
+ notifications by setting QSurfaceFormat::ResetNotification on the
+ QOpenGLContext. This is typically done by enabling the flag in
+ QRhiGles2InitParams::format. Keep in mind however that some systems may
+ generate context resets situations even when this flag is not set.
+ */
+bool QRhi::isDeviceLost() const
+{
+ return d->isDeviceLost();
+}
+
+/*!
+ \return a new graphics pipeline resource.
+
+ \sa QRhiResource::release()
+ */
+QRhiGraphicsPipeline *QRhi::newGraphicsPipeline()
+{
+ return d->createGraphicsPipeline();
+}
+
+/*!
+ \return a new compute pipeline resource.
+
+ \note Compute is only available when the \l{QRhi::Compute}{Compute} feature
+ is reported as supported.
+
+ \sa QRhiResource::release()
+ */
+QRhiComputePipeline *QRhi::newComputePipeline()
+{
+ return d->createComputePipeline();
+}
+
+/*!
+ \return a new shader resource binding collection resource.
+
+ \sa QRhiResource::release()
+ */
+QRhiShaderResourceBindings *QRhi::newShaderResourceBindings()
+{
+ return d->createShaderResourceBindings();
+}
+
+/*!
+ \return a new buffer with the specified \a type, \a usage, and \a size.
+
+ \note Some \a usage and \a type combinations may not be supported by all
+ backends. See \l{QRhiBuffer::UsageFlag}{UsageFlags} and
+ \l{QRhi::NonDynamicUniformBuffers}{the feature flags}.
+
+ \note Backends may choose to allocate buffers bigger than \a size. This is
+ done transparently to applications, so there are no special restrictions on
+ the value of \a size. QRhiBuffer::size() will always report back the value
+ that was requested in \a size.
+
+ \sa QRhiResource::release()
+ */
+QRhiBuffer *QRhi::newBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size)
+{
+ return d->createBuffer(type, usage, size);
+}
+
+/*!
+ \return a new renderbuffer with the specified \a type, \a pixelSize, \a
+ sampleCount, and \a flags.
+
+ \sa QRhiResource::release()
+ */
+QRhiRenderBuffer *QRhi::newRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags)
+{
+ return d->createRenderBuffer(type, pixelSize, sampleCount, flags);
+}
+
+/*!
+ \return a new texture with the specified \a format, \a pixelSize, \a
+ sampleCount, and \a flags.
+
+ \note \a format specifies the requested internal and external format,
+ meaning the data to be uploaded to the texture will need to be in a
+ compatible format, while the native texture may (but is not guaranteed to,
+ in case of OpenGL at least) use this format internally.
+
+ \sa QRhiResource::release()
+ */
+QRhiTexture *QRhi::newTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags)
+{
+ return d->createTexture(format, pixelSize, sampleCount, flags);
+}
+
+/*!
+ \return a new sampler with the specified magnification filter \a magFilter,
+ minification filter \a minFilter, mipmapping mode \a mipmapMpde, and S/T
+ addressing modes \a u and \a v.
+
+ \sa QRhiResource::release()
+ */
+QRhiSampler *QRhi::newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v)
+{
+ return d->createSampler(magFilter, minFilter, mipmapMode, u, v);
+}
+
+/*!
+ \return a new texture render target with color and depth/stencil
+ attachments given in \a desc, and with the specified \a flags.
+
+ \sa QRhiResource::release()
+ */
+
+QRhiTextureRenderTarget *QRhi::newTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags)
+{
+ return d->createTextureRenderTarget(desc, flags);
+}
+
+/*!
+ \return a new swapchain.
+
+ \sa QRhiResource::release(), QRhiSwapChain::buildOrResize()
+ */
+QRhiSwapChain *QRhi::newSwapChain()
+{
+ return d->createSwapChain();
+}
+
+/*!
+ Starts a new frame targeting the next available buffer of \a swapChain.
+
+ A frame consists of resource updates and one or more render and compute
+ passes.
+
+ \a flags can indicate certain special cases. For example, the fact that
+ QRhiCommandBuffer::beginExternal() will be called within this new frame
+ must be declared up front by setting the ExternalContentsInPass flag.
+
+ The high level pattern of rendering into a QWindow using a swapchain:
+
+ \list
+
+ \li Create a swapchain.
+
+ \li Call QRhiSwapChain::buildOrResize() whenever the surface size is
+ different than before.
+
+ \li Call QRhiSwapChain::release() on
+ QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed.
+
+ \li Then on every frame:
+ \badcode
+ beginFrame(sc);
+ updates = nextResourceUpdateBatch();
+ updates->...
+ QRhiCommandBuffer *cb = sc->currentFrameCommandBuffer();
+ cb->beginPass(sc->currentFrameRenderTarget(), colorClear, dsClear, updates);
+ ...
+ cb->endPass();
+ ... // more passes as necessary
+ endFrame(sc);
+ \endcode
+
+ \endlist
+
+ \return QRhi::FrameOpSuccess on success, or another QRhi::FrameOpResult
+ value on failure. Some of these should be treated as soft, "try again
+ later" type of errors: When QRhi::FrameOpSwapChainOutOfDate is returned,
+ the swapchain is to be resized or updated by calling
+ QRhiSwapChain::buildOrResize(). The application should then attempt to
+ generate a new frame. QRhi::FrameOpDeviceLost means the graphics device is
+ lost but this may also be recoverable by releasing all resources, including
+ the QRhi itself, and then recreating all resources. See isDeviceLost() for
+ further discussion.
+
+ \sa endFrame(), beginOffscreenFrame(), isDeviceLost()
+ */
+QRhi::FrameOpResult QRhi::beginFrame(QRhiSwapChain *swapChain, BeginFrameFlags flags)
+{
+ if (d->inFrame)
+ qWarning("Attempted to call beginFrame() within a still active frame; ignored");
+
+ QRhi::FrameOpResult r = !d->inFrame ? d->beginFrame(swapChain, flags) : FrameOpSuccess;
+ if (r == FrameOpSuccess)
+ d->inFrame = true;
+
+ return r;
+}
+
+/*!
+ Ends, commits, and presents a frame that was started in the last
+ beginFrame() on \a swapChain.
+
+ Double (or triple) buffering is managed internally by the QRhiSwapChain and
+ QRhi.
+
+ \a flags can optionally be used to change the behavior in certain ways.
+ Passing QRhi::SkipPresent skips queuing the Present command or calling
+ swapBuffers.
+
+ \return QRhi::FrameOpSuccess on success, or another QRhi::FrameOpResult
+ value on failure. Some of these should be treated as soft, "try again
+ later" type of errors: When QRhi::FrameOpSwapChainOutOfDate is returned,
+ the swapchain is to be resized or updated by calling
+ QRhiSwapChain::buildOrResize(). The application should then attempt to
+ generate a new frame. QRhi::FrameOpDeviceLost means the graphics device is
+ lost but this may also be recoverable by releasing all resources, including
+ the QRhi itself, and then recreating all resources. See isDeviceLost() for
+ further discussion.
+
+ \sa beginFrame(), isDeviceLost()
+ */
+QRhi::FrameOpResult QRhi::endFrame(QRhiSwapChain *swapChain, EndFrameFlags flags)
+{
+ if (!d->inFrame)
+ qWarning("Attempted to call endFrame() without an active frame; ignored");
+
+ QRhi::FrameOpResult r = d->inFrame ? d->endFrame(swapChain, flags) : FrameOpSuccess;
+ d->inFrame = false;
+ // releaseAndDestroyLater is a high level QRhi concept the backends know
+ // nothing about - handle it here.
+ qDeleteAll(d->pendingReleaseAndDestroyResources);
+ d->pendingReleaseAndDestroyResources.clear();
+
+ return r;
+}
+
+/*!
+ \return true when there is an active frame, meaning there was a
+ beginFrame() (or beginOffscreenFrame()) with no corresponding endFrame()
+ (or endOffscreenFrame()) yet.
+
+ \sa currentFrameSlot(), beginFrame(), endFrame()
+ */
+bool QRhi::isRecordingFrame() const
+{
+ return d->inFrame;
+}
+
+/*!
+ \return the current frame slot index while recording a frame. Unspecified
+ when called outside an active frame (that is, when isRecordingFrame() is \c
+ false).
+
+ With backends like Vulkan or Metal, it is the responsibility of the QRhi
+ backend to block whenever starting a new frame and finding the CPU is
+ already \c{FramesInFlight - 1} frames ahead of the GPU (because the command
+ buffer submitted in frame no. \c{current} - \c{FramesInFlight} has not yet
+ completed).
+
+ Resources that tend to change between frames (such as, the native buffer
+ object backing a QRhiBuffer with type QRhiBuffer::Dynamic) exist in
+ multiple versions, so that each frame, that can be submitted while a
+ previous one is still being processed, works with its own copy, thus
+ avoiding the need to stall the pipeline when preparing the frame. (The
+ contents of a resource that may still be in use in the GPU should not be
+ touched, but simply always waiting for the previous frame to finish would
+ reduce GPU utilization and ultimately, performance and efficiency.)
+
+ Conceptually this is somewhat similar to copy-on-write schemes used by some
+ C++ containers and other types. It may also be similar to what an OpenGL or
+ Direct 3D 11 implementation performs internally for certain type of objects.
+
+ In practice, such double (or tripple) buffering resources is realized in
+ the Vulkan, Metal, and similar QRhi backends by having a fixed number of
+ native resource (such as, VkBuffer) \c slots behind a QRhiResource. That
+ can then be indexed by a frame slot index running 0, 1, ..,
+ FramesInFlight-1, and then wrapping around.
+
+ All this is managed transparently to the users of QRhi. However,
+ applications that integrate rendering done directly with the graphics API
+ may want to perform a similar double or tripple buffering of their own
+ graphics resources. That is then most easily achieved by knowing the values
+ of the maximum number of in-flight frames (retrievable via resourceLimit())
+ and the current frame (slot) index (returned by this function).
+
+ \sa isRecordingFrame(), beginFrame(), endFrame()
+ */
+int QRhi::currentFrameSlot() const
+{
+ return d->currentFrameSlot;
+}
+
+/*!
+ Starts a new offscreen frame. Provides a command buffer suitable for
+ recording rendering commands in \a cb. \a flags is used to indicate
+ certain special cases, just like with beginFrame().
+
+ \note The QRhiCommandBuffer stored to *cb is not owned by the caller.
+
+ Rendering without a swapchain is possible as well. The typical use case is
+ to use it in completely offscreen applications, e.g. to generate image
+ sequences by rendering and reading back without ever showing a window.
+
+ Usage in on-screen applications (so beginFrame, endFrame,
+ beginOffscreenFrame, endOffscreenFrame, beginFrame, ...) is possible too
+ but it does reduce parallelism so it should be done only infrequently.
+
+ Offscreen frames do not let the CPU - potentially - generate another frame
+ while the GPU is still processing the previous one. This has the side
+ effect that if readbacks are scheduled, the results are guaranteed to be
+ available once endOffscreenFrame() returns. That is not the case with
+ frames targeting a swapchain.
+
+ The skeleton of rendering a frame without a swapchain and then reading the
+ frame contents back could look like the following:
+
+ \badcode
+ QRhiReadbackResult rbResult;
+ QRhiCommandBuffer *cb;
+ beginOffscreenFrame(&cb);
+ beginPass
+ ...
+ u = nextResourceUpdateBatch();
+ u->readBackTexture(rb, &rbResult);
+ endPass(u);
+ endOffscreenFrame();
+ // image data available in rbResult
+ \endcode
+
+ \sa endOffscreenFrame(), beginFrame()
+ */
+QRhi::FrameOpResult QRhi::beginOffscreenFrame(QRhiCommandBuffer **cb, BeginFrameFlags flags)
+{
+ if (d->inFrame)
+ qWarning("Attempted to call beginOffscreenFrame() within a still active frame; ignored");
+
+ QRhi::FrameOpResult r = !d->inFrame ? d->beginOffscreenFrame(cb, flags) : FrameOpSuccess;
+ if (r == FrameOpSuccess)
+ d->inFrame = true;
+
+ return r;
+}
+
+/*!
+ Ends and waits for the offscreen frame.
+
+ \sa beginOffscreenFrame()
+ */
+QRhi::FrameOpResult QRhi::endOffscreenFrame(EndFrameFlags flags)
+{
+ if (!d->inFrame)
+ qWarning("Attempted to call endOffscreenFrame() without an active frame; ignored");
+
+ QRhi::FrameOpResult r = d->inFrame ? d->endOffscreenFrame(flags) : FrameOpSuccess;
+ d->inFrame = false;
+ qDeleteAll(d->pendingReleaseAndDestroyResources);
+ d->pendingReleaseAndDestroyResources.clear();
+
+ return r;
+}
+
+/*!
+ Waits for any work on the graphics queue (where applicable) to complete,
+ then executes all deferred operations, like completing readbacks and
+ resource releases. Can be called inside and outside of a frame, but not
+ inside a pass. Inside a frame it implies submitting any work on the
+ command buffer.
+
+ \note Avoid this function. One case where it may be needed is when the
+ results of an enqueued readback in a swapchain-based frame are needed at a
+ fixed given point and so waiting for the results is desired.
+ */
+QRhi::FrameOpResult QRhi::finish()
+{
+ return d->finish();
+}
+
+/*!
+ \return the list of supported sample counts.
+
+ A typical example would be (1, 2, 4, 8).
+
+ With some backend this list of supported values is fixed in advance, while
+ with some others the (physical) device properties indicate what is
+ supported at run time.
+ */
+QVector<int> QRhi::supportedSampleCounts() const
+{
+ return d->supportedSampleCounts();
+}
+
+/*!
+ \return the minimum uniform buffer offset alignment in bytes. This is
+ typically 256.
+
+ Attempting to bind a uniform buffer region with an offset not aligned to
+ this value will lead to failures depending on the backend and the
+ underlying graphics API.
+
+ \sa ubufAligned()
+ */
+int QRhi::ubufAlignment() const
+{
+ return d->ubufAlignment();
+}
+
+static QBasicAtomicInteger<QRhiGlobalObjectIdGenerator::Type> counter = Q_BASIC_ATOMIC_INITIALIZER(0);
+
+QRhiGlobalObjectIdGenerator::Type QRhiGlobalObjectIdGenerator::newId()
+{
+ return counter.fetchAndAddRelaxed(1) + 1;
+}
+
+bool QRhiPassResourceTracker::isEmpty() const
+{
+ return m_buffers.isEmpty() && m_textures.isEmpty();
+}
+
+void QRhiPassResourceTracker::reset()
+{
+ m_buffers.clear();
+ m_textures.clear();
+}
+
+static inline QRhiPassResourceTracker::BufferStage earlierStage(QRhiPassResourceTracker::BufferStage a,
+ QRhiPassResourceTracker::BufferStage b)
+{
+ return QRhiPassResourceTracker::BufferStage(qMin(int(a), int(b)));
+}
+
+void QRhiPassResourceTracker::registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage,
+ const UsageState &state)
+{
+ auto it = m_buffers.find(buf);
+ if (it != m_buffers.end()) {
+ if (it->access != *access) {
+ const QByteArray name = buf->name();
+ qWarning("Buffer %p (%s) used with different accesses within the same pass, this is not allowed.",
+ buf, name.constData());
+ return;
+ }
+ if (it->stage != *stage) {
+ it->stage = earlierStage(it->stage, *stage);
+ *stage = it->stage;
+ }
+ return;
+ }
+
+ Buffer b;
+ b.slot = slot;
+ b.access = *access;
+ b.stage = *stage;
+ b.stateAtPassBegin = state; // first use -> initial state
+ m_buffers.insert(buf, b);
+}
+
+static inline QRhiPassResourceTracker::TextureStage earlierStage(QRhiPassResourceTracker::TextureStage a,
+ QRhiPassResourceTracker::TextureStage b)
+{
+ return QRhiPassResourceTracker::TextureStage(qMin(int(a), int(b)));
+}
+
+static inline bool isImageLoadStore(QRhiPassResourceTracker::TextureAccess access)
+{
+ return access == QRhiPassResourceTracker::TexStorageLoad
+ || access == QRhiPassResourceTracker::TexStorageStore
+ || access == QRhiPassResourceTracker::TexStorageLoadStore;
+}
+
+void QRhiPassResourceTracker::registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage,
+ const UsageState &state)
+{
+ auto it = m_textures.find(tex);
+ if (it != m_textures.end()) {
+ if (it->access != *access) {
+ // Different subresources of a texture may be used for both load
+ // and store in the same pass. (think reading from one mip level
+ // and writing to another one in a compute shader) This we can
+ // handle by treating the entire resource as read-write.
+ if (isImageLoadStore(it->access) && isImageLoadStore(*access)) {
+ it->access = QRhiPassResourceTracker::TexStorageLoadStore;
+ *access = it->access;
+ } else {
+ const QByteArray name = tex->name();
+ qWarning("Texture %p (%s) used with different accesses within the same pass, this is not allowed.",
+ tex, name.constData());
+ }
+ }
+ if (it->stage != *stage) {
+ it->stage = earlierStage(it->stage, *stage);
+ *stage = it->stage;
+ }
+ return;
+ }
+
+ Texture t;
+ t.access = *access;
+ t.stage = *stage;
+ t.stateAtPassBegin = state; // first use -> initial state
+ m_textures.insert(tex, t);
+}
+
+QRhiPassResourceTracker::BufferStage QRhiPassResourceTracker::toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages)
+{
+ // pick the earlier stage (as this is going to be dstAccessMask)
+ if (stages.testFlag(QRhiShaderResourceBinding::VertexStage))
+ return QRhiPassResourceTracker::BufVertexStage;
+ if (stages.testFlag(QRhiShaderResourceBinding::FragmentStage))
+ return QRhiPassResourceTracker::BufFragmentStage;
+ if (stages.testFlag(QRhiShaderResourceBinding::ComputeStage))
+ return QRhiPassResourceTracker::BufComputeStage;
+
+ Q_UNREACHABLE();
+ return QRhiPassResourceTracker::BufVertexStage;
+}
+
+QRhiPassResourceTracker::TextureStage QRhiPassResourceTracker::toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages)
+{
+ // pick the earlier stage (as this is going to be dstAccessMask)
+ if (stages.testFlag(QRhiShaderResourceBinding::VertexStage))
+ return QRhiPassResourceTracker::TexVertexStage;
+ if (stages.testFlag(QRhiShaderResourceBinding::FragmentStage))
+ return QRhiPassResourceTracker::TexFragmentStage;
+ if (stages.testFlag(QRhiShaderResourceBinding::ComputeStage))
+ return QRhiPassResourceTracker::TexComputeStage;
+
+ Q_UNREACHABLE();
+ return QRhiPassResourceTracker::TexVertexStage;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h
new file mode 100644
index 0000000000..907924c788
--- /dev/null
+++ b/src/gui/rhi/qrhi_p.h
@@ -0,0 +1,1555 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHI_H
+#define QRHI_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/qtguiglobal.h>
+#include <QSize>
+#include <QMatrix4x4>
+#include <QVector>
+#include <QVarLengthArray>
+#include <QThread>
+#include <QColor>
+#include <QImage>
+#include <functional>
+#include <array>
+#include <private/qshader_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+class QRhiImplementation;
+class QRhiBuffer;
+class QRhiRenderBuffer;
+class QRhiTexture;
+class QRhiSampler;
+class QRhiCommandBuffer;
+class QRhiResourceUpdateBatch;
+class QRhiResourceUpdateBatchPrivate;
+class QRhiProfiler;
+
+class Q_GUI_EXPORT QRhiDepthStencilClearValue
+{
+public:
+ QRhiDepthStencilClearValue() = default;
+ QRhiDepthStencilClearValue(float d, quint32 s);
+
+ float depthClearValue() const { return m_d; }
+ void setDepthClearValue(float d) { m_d = d; }
+
+ quint32 stencilClearValue() const { return m_s; }
+ void setStencilClearValue(quint32 s) { m_s = s; }
+
+private:
+ float m_d = 1.0f;
+ quint32 m_s = 0;
+};
+
+Q_DECLARE_TYPEINFO(QRhiDepthStencilClearValue, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiDepthStencilClearValue &a, const QRhiDepthStencilClearValue &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiDepthStencilClearValue &v, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiDepthStencilClearValue &);
+#endif
+
+class Q_GUI_EXPORT QRhiViewport
+{
+public:
+ QRhiViewport() = default;
+ QRhiViewport(float x, float y, float w, float h, float minDepth = 0.0f, float maxDepth = 1.0f);
+
+ std::array<float, 4> viewport() const { return m_rect; }
+ void setViewport(float x, float y, float w, float h) {
+ m_rect[0] = x; m_rect[1] = y; m_rect[2] = w; m_rect[3] = h;
+ }
+
+ float minDepth() const { return m_minDepth; }
+ void setMinDepth(float minDepth) { m_minDepth = minDepth; }
+
+ float maxDepth() const { return m_maxDepth; }
+ void setMaxDepth(float maxDepth) { m_maxDepth = maxDepth; }
+
+private:
+ std::array<float, 4> m_rect { { 0.0f, 0.0f, 0.0f, 0.0f } };
+ float m_minDepth = 0.0f;
+ float m_maxDepth = 1.0f;
+};
+
+Q_DECLARE_TYPEINFO(QRhiViewport, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiViewport &a, const QRhiViewport &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiViewport &a, const QRhiViewport &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiViewport &v, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiViewport &);
+#endif
+
+class Q_GUI_EXPORT QRhiScissor
+{
+public:
+ QRhiScissor() = default;
+ QRhiScissor(int x, int y, int w, int h);
+
+ std::array<int, 4> scissor() const { return m_rect; }
+ void setScissor(int x, int y, int w, int h) {
+ m_rect[0] = x; m_rect[1] = y; m_rect[2] = w; m_rect[3] = h;
+ }
+
+private:
+ std::array<int, 4> m_rect { { 0, 0, 0, 0 } };
+};
+
+Q_DECLARE_TYPEINFO(QRhiScissor, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiScissor &a, const QRhiScissor &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiScissor &a, const QRhiScissor &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiScissor &v, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiScissor &);
+#endif
+
+class Q_GUI_EXPORT QRhiVertexInputBinding
+{
+public:
+ enum Classification {
+ PerVertex,
+ PerInstance
+ };
+
+ QRhiVertexInputBinding() = default;
+ QRhiVertexInputBinding(quint32 stride, Classification cls = PerVertex, int stepRate = 1);
+
+ quint32 stride() const { return m_stride; }
+ void setStride(quint32 s) { m_stride = s; }
+
+ Classification classification() const { return m_classification; }
+ void setClassification(Classification c) { m_classification = c; }
+
+ int instanceStepRate() const { return m_instanceStepRate; }
+ void setInstanceStepRate(int rate) { m_instanceStepRate = rate; }
+
+private:
+ quint32 m_stride = 0;
+ Classification m_classification = PerVertex;
+ int m_instanceStepRate = 1;
+};
+
+Q_DECLARE_TYPEINFO(QRhiVertexInputBinding, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiVertexInputBinding &a, const QRhiVertexInputBinding &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiVertexInputBinding &v, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputBinding &);
+#endif
+
+class Q_GUI_EXPORT QRhiVertexInputAttribute
+{
+public:
+ enum Format {
+ Float4,
+ Float3,
+ Float2,
+ Float,
+ UNormByte4,
+ UNormByte2,
+ UNormByte
+ };
+
+ QRhiVertexInputAttribute() = default;
+ QRhiVertexInputAttribute(int binding, int location, Format format, quint32 offset);
+
+ int binding() const { return m_binding; }
+ void setBinding(int b) { m_binding = b; }
+
+ int location() const { return m_location; }
+ void setLocation(int loc) { m_location = loc; }
+
+ Format format() const { return m_format; }
+ void setFormt(Format f) { m_format = f; }
+
+ quint32 offset() const { return m_offset; }
+ void setOffset(quint32 ofs) { m_offset = ofs; }
+
+private:
+ int m_binding = 0;
+ int m_location = 0;
+ Format m_format = Float4;
+ quint32 m_offset = 0;
+};
+
+Q_DECLARE_TYPEINFO(QRhiVertexInputAttribute, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiVertexInputAttribute &a, const QRhiVertexInputAttribute &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiVertexInputAttribute &a, const QRhiVertexInputAttribute &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiVertexInputAttribute &v, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputAttribute &);
+#endif
+
+class Q_GUI_EXPORT QRhiVertexInputLayout
+{
+public:
+ QRhiVertexInputLayout() = default;
+
+ void setBindings(std::initializer_list<QRhiVertexInputBinding> list) { m_bindings = list; }
+ template<typename InputIterator>
+ void setBindings(InputIterator first, InputIterator last)
+ {
+ m_bindings.clear();
+ std::copy(first, last, std::back_inserter(m_bindings));
+ }
+ void setBindings(const QVector<QRhiVertexInputBinding> &bindings) // compat., to be removed
+ {
+ setBindings(bindings.cbegin(), bindings.cend());
+ }
+ const QRhiVertexInputBinding *cbeginBindings() const { return m_bindings.cbegin(); }
+ const QRhiVertexInputBinding *cendBindings() const { return m_bindings.cend(); }
+ const QRhiVertexInputBinding *bindingAt(int index) const { return &m_bindings.at(index); }
+
+ void setAttributes(std::initializer_list<QRhiVertexInputAttribute> list) { m_attributes = list; }
+ template<typename InputIterator>
+ void setAttributes(InputIterator first, InputIterator last)
+ {
+ m_attributes.clear();
+ std::copy(first, last, std::back_inserter(m_attributes));
+ }
+ void setAttributes(const QVector<QRhiVertexInputAttribute> &attributes) // compat., to be removed
+ {
+ setAttributes(attributes.cbegin(), attributes.cend());
+ }
+ const QRhiVertexInputAttribute *cbeginAttributes() const { return m_attributes.cbegin(); }
+ const QRhiVertexInputAttribute *cendAttributes() const { return m_attributes.cend(); }
+
+private:
+ QVarLengthArray<QRhiVertexInputBinding, 8> m_bindings;
+ QVarLengthArray<QRhiVertexInputAttribute, 8> m_attributes;
+
+ friend Q_GUI_EXPORT bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT uint qHash(const QRhiVertexInputLayout &v, uint seed) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputLayout &);
+};
+
+Q_DECLARE_TYPEINFO(QRhiVertexInputLayout, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiVertexInputLayout &a, const QRhiVertexInputLayout &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiVertexInputLayout &v, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiVertexInputLayout &);
+#endif
+
+class Q_GUI_EXPORT QRhiShaderStage
+{
+public:
+ enum Type {
+ Vertex,
+ Fragment,
+ Compute
+ };
+
+ QRhiShaderStage() = default;
+ QRhiShaderStage(Type type, const QShader &shader,
+ QShader::Variant v = QShader::StandardShader);
+
+ Type type() const { return m_type; }
+ void setType(Type t) { m_type = t; }
+
+ QShader shader() const { return m_shader; }
+ void setShader(const QShader &s) { m_shader = s; }
+
+ QShader::Variant shaderVariant() const { return m_shaderVariant; }
+ void setShaderVariant(QShader::Variant v) { m_shaderVariant = v; }
+
+private:
+ Type m_type = Vertex;
+ QShader m_shader;
+ QShader::Variant m_shaderVariant = QShader::StandardShader;
+};
+
+Q_DECLARE_TYPEINFO(QRhiShaderStage, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiShaderStage &a, const QRhiShaderStage &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiShaderStage &a, const QRhiShaderStage &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiShaderStage &s, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderStage &);
+#endif
+
+using QRhiGraphicsShaderStage = QRhiShaderStage;
+
+class Q_GUI_EXPORT QRhiShaderResourceBinding
+{
+public:
+ enum Type {
+ UniformBuffer,
+ SampledTexture,
+ ImageLoad,
+ ImageStore,
+ ImageLoadStore,
+ BufferLoad,
+ BufferStore,
+ BufferLoadStore
+ };
+
+ enum StageFlag {
+ VertexStage = 1 << 0,
+ FragmentStage = 1 << 1,
+ ComputeStage = 1 << 2
+ };
+ Q_DECLARE_FLAGS(StageFlags, StageFlag)
+
+ QRhiShaderResourceBinding();
+
+ bool isLayoutCompatible(const QRhiShaderResourceBinding &other) const;
+
+ static QRhiShaderResourceBinding uniformBuffer(int binding, StageFlags stage, QRhiBuffer *buf);
+ static QRhiShaderResourceBinding uniformBuffer(int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size);
+ static QRhiShaderResourceBinding uniformBufferWithDynamicOffset(int binding, StageFlags stage, QRhiBuffer *buf, int size);
+
+ static QRhiShaderResourceBinding sampledTexture(int binding, StageFlags stage, QRhiTexture *tex, QRhiSampler *sampler);
+
+ static QRhiShaderResourceBinding imageLoad(int binding, StageFlags stage, QRhiTexture *tex, int level);
+ static QRhiShaderResourceBinding imageStore(int binding, StageFlags stage, QRhiTexture *tex, int level);
+ static QRhiShaderResourceBinding imageLoadStore(int binding, StageFlags stage, QRhiTexture *tex, int level);
+
+ static QRhiShaderResourceBinding bufferLoad(int binding, StageFlags stage, QRhiBuffer *buf);
+ static QRhiShaderResourceBinding bufferLoad(int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size);
+ static QRhiShaderResourceBinding bufferStore(int binding, StageFlags stage, QRhiBuffer *buf);
+ static QRhiShaderResourceBinding bufferStore(int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size);
+ static QRhiShaderResourceBinding bufferLoadStore(int binding, StageFlags stage, QRhiBuffer *buf);
+ static QRhiShaderResourceBinding bufferLoadStore(int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size);
+
+ struct Data
+ {
+ int binding;
+ QRhiShaderResourceBinding::StageFlags stage;
+ QRhiShaderResourceBinding::Type type;
+ struct UniformBufferData {
+ QRhiBuffer *buf;
+ int offset;
+ int maybeSize;
+ bool hasDynamicOffset;
+ };
+ struct SampledTextureData {
+ QRhiTexture *tex;
+ QRhiSampler *sampler;
+ };
+ struct StorageImageData {
+ QRhiTexture *tex;
+ int level;
+ };
+ struct StorageBufferData {
+ QRhiBuffer *buf;
+ int offset;
+ int maybeSize;
+ };
+ union {
+ UniformBufferData ubuf;
+ SampledTextureData stex;
+ StorageImageData simage;
+ StorageBufferData sbuf;
+ } u;
+ };
+
+ Data *data() { return &d; }
+ const Data *data() const { return &d; }
+
+private:
+ Data d;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiShaderResourceBinding::StageFlags)
+
+Q_DECLARE_TYPEINFO(QRhiShaderResourceBinding, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator!=(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRhiShaderResourceBinding &b, uint seed = 0) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderResourceBinding &);
+#endif
+
+class Q_GUI_EXPORT QRhiColorAttachment
+{
+public:
+ QRhiColorAttachment() = default;
+ QRhiColorAttachment(QRhiTexture *texture);
+ QRhiColorAttachment(QRhiRenderBuffer *renderBuffer);
+
+ QRhiTexture *texture() const { return m_texture; }
+ void setTexture(QRhiTexture *tex) { m_texture = tex; }
+
+ QRhiRenderBuffer *renderBuffer() const { return m_renderBuffer; }
+ void setRenderBuffer(QRhiRenderBuffer *rb) { m_renderBuffer = rb; }
+
+ int layer() const { return m_layer; }
+ void setLayer(int layer) { m_layer = layer; }
+
+ int level() const { return m_level; }
+ void setLevel(int level) { m_level = level; }
+
+ QRhiTexture *resolveTexture() const { return m_resolveTexture; }
+ void setResolveTexture(QRhiTexture *tex) { m_resolveTexture = tex; }
+
+ int resolveLayer() const { return m_resolveLayer; }
+ void setResolveLayer(int layer) { m_resolveLayer = layer; }
+
+ int resolveLevel() const { return m_resolveLevel; }
+ void setResolveLevel(int level) { m_resolveLevel = level; }
+
+private:
+ QRhiTexture *m_texture = nullptr;
+ QRhiRenderBuffer *m_renderBuffer = nullptr;
+ int m_layer = 0;
+ int m_level = 0;
+ QRhiTexture *m_resolveTexture = nullptr;
+ int m_resolveLayer = 0;
+ int m_resolveLevel = 0;
+};
+
+Q_DECLARE_TYPEINFO(QRhiColorAttachment, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiTextureRenderTargetDescription
+{
+public:
+ QRhiTextureRenderTargetDescription() = default;
+ QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment);
+ QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment, QRhiRenderBuffer *depthStencilBuffer);
+ QRhiTextureRenderTargetDescription(const QRhiColorAttachment &colorAttachment, QRhiTexture *depthTexture);
+
+ void setColorAttachments(std::initializer_list<QRhiColorAttachment> list) { m_colorAttachments = list; }
+ template<typename InputIterator>
+ void setColorAttachments(InputIterator first, InputIterator last)
+ {
+ m_colorAttachments.clear();
+ std::copy(first, last, std::back_inserter(m_colorAttachments));
+ }
+ const QRhiColorAttachment *cbeginColorAttachments() const { return m_colorAttachments.cbegin(); }
+ const QRhiColorAttachment *cendColorAttachments() const { return m_colorAttachments.cend(); }
+ const QRhiColorAttachment *colorAttachmentAt(int index) const { return &m_colorAttachments.at(index); }
+
+ QRhiRenderBuffer *depthStencilBuffer() const { return m_depthStencilBuffer; }
+ void setDepthStencilBuffer(QRhiRenderBuffer *renderBuffer) { m_depthStencilBuffer = renderBuffer; }
+
+ QRhiTexture *depthTexture() const { return m_depthTexture; }
+ void setDepthTexture(QRhiTexture *texture) { m_depthTexture = texture; }
+
+private:
+ QVarLengthArray<QRhiColorAttachment, 8> m_colorAttachments;
+ QRhiRenderBuffer *m_depthStencilBuffer = nullptr;
+ QRhiTexture *m_depthTexture = nullptr;
+};
+
+Q_DECLARE_TYPEINFO(QRhiTextureRenderTargetDescription, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiTextureSubresourceUploadDescription
+{
+public:
+ QRhiTextureSubresourceUploadDescription() = default;
+ QRhiTextureSubresourceUploadDescription(const QImage &image);
+ QRhiTextureSubresourceUploadDescription(const void *data, int size);
+
+ QImage image() const { return m_image; }
+ void setImage(const QImage &image) { m_image = image; }
+
+ QByteArray data() const { return m_data; }
+ void setData(const QByteArray &data) { m_data = data; }
+
+ QPoint destinationTopLeft() const { return m_destinationTopLeft; }
+ void setDestinationTopLeft(const QPoint &p) { m_destinationTopLeft = p; }
+
+ QSize sourceSize() const { return m_sourceSize; }
+ void setSourceSize(const QSize &size) { m_sourceSize = size; }
+
+ QPoint sourceTopLeft() const { return m_sourceTopLeft; }
+ void setSourceTopLeft(const QPoint &p) { m_sourceTopLeft = p; }
+
+private:
+ QImage m_image;
+ QByteArray m_data;
+ QPoint m_destinationTopLeft;
+ QSize m_sourceSize;
+ QPoint m_sourceTopLeft;
+};
+
+Q_DECLARE_TYPEINFO(QRhiTextureSubresourceUploadDescription, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiTextureUploadEntry
+{
+public:
+ QRhiTextureUploadEntry() = default;
+ QRhiTextureUploadEntry(int layer, int level, const QRhiTextureSubresourceUploadDescription &desc);
+
+ int layer() const { return m_layer; }
+ void setLayer(int layer) { m_layer = layer; }
+
+ int level() const { return m_level; }
+ void setLevel(int level) { m_level = level; }
+
+ QRhiTextureSubresourceUploadDescription description() const { return m_desc; }
+ void setDescription(const QRhiTextureSubresourceUploadDescription &desc) { m_desc = desc; }
+
+private:
+ int m_layer = 0;
+ int m_level = 0;
+ QRhiTextureSubresourceUploadDescription m_desc;
+};
+
+Q_DECLARE_TYPEINFO(QRhiTextureUploadEntry, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiTextureUploadDescription
+{
+public:
+ QRhiTextureUploadDescription() = default;
+ QRhiTextureUploadDescription(const QRhiTextureUploadEntry &entry);
+ QRhiTextureUploadDescription(std::initializer_list<QRhiTextureUploadEntry> list);
+ QRhiTextureUploadDescription(const QVector<QRhiTextureUploadEntry> &entries) // compat., to be removed
+ : m_entries(entries.cbegin(), entries.cend())
+ { }
+
+ void setEntries(std::initializer_list<QRhiTextureUploadEntry> list) { m_entries = list; }
+ template<typename InputIterator>
+ void setEntries(InputIterator first, InputIterator last)
+ {
+ m_entries.clear();
+ std::copy(first, last, std::back_inserter(m_entries));
+ }
+ const QRhiTextureUploadEntry *cbeginEntries() const { return m_entries.cbegin(); }
+ const QRhiTextureUploadEntry *cendEntries() const { return m_entries.cend(); }
+
+private:
+ QVarLengthArray<QRhiTextureUploadEntry, 16> m_entries;
+};
+
+Q_DECLARE_TYPEINFO(QRhiTextureUploadDescription, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiTextureCopyDescription
+{
+public:
+ QRhiTextureCopyDescription() = default;
+
+ QSize pixelSize() const { return m_pixelSize; }
+ void setPixelSize(const QSize &sz) { m_pixelSize = sz; }
+
+ int sourceLayer() const { return m_sourceLayer; }
+ void setSourceLayer(int layer) { m_sourceLayer = layer; }
+
+ int sourceLevel() const { return m_sourceLevel; }
+ void setSourceLevel(int level) { m_sourceLevel = level; }
+
+ QPoint sourceTopLeft() const { return m_sourceTopLeft; }
+ void setSourceTopLeft(const QPoint &p) { m_sourceTopLeft = p; }
+
+ int destinationLayer() const { return m_destinationLayer; }
+ void setDestinationLayer(int layer) { m_destinationLayer = layer; }
+
+ int destinationLevel() const { return m_destinationLevel; }
+ void setDestinationLevel(int level) { m_destinationLevel = level; }
+
+ QPoint destinationTopLeft() const { return m_destinationTopLeft; }
+ void setDestinationTopLeft(const QPoint &p) { m_destinationTopLeft = p; }
+
+private:
+ QSize m_pixelSize;
+ int m_sourceLayer = 0;
+ int m_sourceLevel = 0;
+ QPoint m_sourceTopLeft;
+ int m_destinationLayer = 0;
+ int m_destinationLevel = 0;
+ QPoint m_destinationTopLeft;
+};
+
+Q_DECLARE_TYPEINFO(QRhiTextureCopyDescription, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiReadbackDescription
+{
+public:
+ QRhiReadbackDescription() = default;
+ QRhiReadbackDescription(QRhiTexture *texture);
+
+ QRhiTexture *texture() const { return m_texture; }
+ void setTexture(QRhiTexture *tex) { m_texture = tex; }
+
+ int layer() const { return m_layer; }
+ void setLayer(int layer) { m_layer = layer; }
+
+ int level() const { return m_level; }
+ void setLevel(int level) { m_level = level; }
+
+private:
+ QRhiTexture *m_texture = nullptr;
+ int m_layer = 0;
+ int m_level = 0;
+};
+
+Q_DECLARE_TYPEINFO(QRhiReadbackDescription, Q_MOVABLE_TYPE);
+
+struct Q_GUI_EXPORT QRhiNativeHandles
+{
+};
+
+class Q_GUI_EXPORT QRhiResource
+{
+public:
+ enum Type {
+ Buffer,
+ Texture,
+ Sampler,
+ RenderBuffer,
+ RenderPassDescriptor,
+ RenderTarget,
+ TextureRenderTarget,
+ ShaderResourceBindings,
+ GraphicsPipeline,
+ SwapChain,
+ ComputePipeline,
+ CommandBuffer
+ };
+
+ virtual ~QRhiResource();
+
+ virtual Type resourceType() const = 0;
+
+ virtual void release() = 0;
+ void releaseAndDestroyLater();
+
+ QByteArray name() const;
+ void setName(const QByteArray &name);
+
+ quint64 globalResourceId() const;
+
+protected:
+ QRhiResource(QRhiImplementation *rhi);
+ Q_DISABLE_COPY(QRhiResource)
+ friend class QRhiImplementation;
+ QRhiImplementation *m_rhi = nullptr;
+ quint64 m_id;
+ QByteArray m_objectName;
+};
+
+class Q_GUI_EXPORT QRhiBuffer : public QRhiResource
+{
+public:
+ enum Type {
+ Immutable,
+ Static,
+ Dynamic
+ };
+
+ enum UsageFlag {
+ VertexBuffer = 1 << 0,
+ IndexBuffer = 1 << 1,
+ UniformBuffer = 1 << 2,
+ StorageBuffer = 1 << 3
+ };
+ Q_DECLARE_FLAGS(UsageFlags, UsageFlag)
+
+ QRhiResource::Type resourceType() const override;
+
+ Type type() const { return m_type; }
+ void setType(Type t) { m_type = t; }
+
+ UsageFlags usage() const { return m_usage; }
+ void setUsage(UsageFlags u) { m_usage = u; }
+
+ int size() const { return m_size; }
+ void setSize(int sz) { m_size = sz; }
+
+ virtual bool build() = 0;
+
+protected:
+ QRhiBuffer(QRhiImplementation *rhi, Type type_, UsageFlags usage_, int size_);
+ Type m_type;
+ UsageFlags m_usage;
+ int m_size;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiBuffer::UsageFlags)
+
+class Q_GUI_EXPORT QRhiTexture : public QRhiResource
+{
+public:
+ enum Flag {
+ RenderTarget = 1 << 0,
+ CubeMap = 1 << 2,
+ MipMapped = 1 << 3,
+ sRGB = 1 << 4,
+ UsedAsTransferSource = 1 << 5,
+ UsedWithGenerateMips = 1 << 6,
+ UsedWithLoadStore = 1 << 7
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ enum Format {
+ UnknownFormat,
+
+ RGBA8,
+ BGRA8,
+ R8,
+ R16,
+ RED_OR_ALPHA8,
+
+ RGBA16F,
+ RGBA32F,
+
+ D16,
+ D32F,
+
+ BC1,
+ BC2,
+ BC3,
+ BC4,
+ BC5,
+ BC6H,
+ BC7,
+
+ ETC2_RGB8,
+ ETC2_RGB8A1,
+ ETC2_RGBA8,
+
+ ASTC_4x4,
+ ASTC_5x4,
+ ASTC_5x5,
+ ASTC_6x5,
+ ASTC_6x6,
+ ASTC_8x5,
+ ASTC_8x6,
+ ASTC_8x8,
+ ASTC_10x5,
+ ASTC_10x6,
+ ASTC_10x8,
+ ASTC_10x10,
+ ASTC_12x10,
+ ASTC_12x12
+ };
+
+ QRhiResource::Type resourceType() const override;
+
+ Format format() const { return m_format; }
+ void setFormat(Format fmt) { m_format = fmt; }
+
+ QSize pixelSize() const { return m_pixelSize; }
+ void setPixelSize(const QSize &sz) { m_pixelSize = sz; }
+
+ Flags flags() const { return m_flags; }
+ void setFlags(Flags f) { m_flags = f; }
+
+ int sampleCount() const { return m_sampleCount; }
+ void setSampleCount(int s) { m_sampleCount = s; }
+
+ virtual bool build() = 0;
+ virtual const QRhiNativeHandles *nativeHandles();
+ virtual bool buildFrom(const QRhiNativeHandles *src);
+
+protected:
+ QRhiTexture(QRhiImplementation *rhi, Format format_, const QSize &pixelSize_,
+ int sampleCount_, Flags flags_);
+ Format m_format;
+ QSize m_pixelSize;
+ int m_sampleCount;
+ Flags m_flags;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiTexture::Flags)
+
+class Q_GUI_EXPORT QRhiSampler : public QRhiResource
+{
+public:
+ enum Filter {
+ None,
+ Nearest,
+ Linear
+ };
+
+ enum AddressMode {
+ Repeat,
+ ClampToEdge,
+ Border,
+ Mirror,
+ MirrorOnce
+ };
+
+ enum CompareOp {
+ Never,
+ Less,
+ Equal,
+ LessOrEqual,
+ Greater,
+ NotEqual,
+ GreaterOrEqual,
+ Always
+ };
+
+ QRhiResource::Type resourceType() const override;
+
+ Filter magFilter() const { return m_magFilter; }
+ void setMagFilter(Filter f) { m_magFilter = f; }
+
+ Filter minFilter() const { return m_minFilter; }
+ void setMinFilter(Filter f) { m_minFilter = f; }
+
+ Filter mipmapMode() const { return m_mipmapMode; }
+ void setMipmapMode(Filter f) { m_mipmapMode = f; }
+
+ AddressMode addressU() const { return m_addressU; }
+ void setAddressU(AddressMode mode) { m_addressU = mode; }
+
+ AddressMode addressV() const { return m_addressV; }
+ void setAddressV(AddressMode mode) { m_addressV = mode; }
+
+ AddressMode addressW() const { return m_addressW; }
+ void setAddressW(AddressMode mode) { m_addressW = mode; }
+
+ CompareOp textureCompareOp() const { return m_compareOp; }
+ void setTextureCompareOp(CompareOp op) { m_compareOp = op; }
+
+ virtual bool build() = 0;
+
+protected:
+ QRhiSampler(QRhiImplementation *rhi,
+ Filter magFilter_, Filter minFilter_, Filter mipmapMode_,
+ AddressMode u_, AddressMode v_);
+ Filter m_magFilter;
+ Filter m_minFilter;
+ Filter m_mipmapMode;
+ AddressMode m_addressU;
+ AddressMode m_addressV;
+ AddressMode m_addressW;
+ CompareOp m_compareOp;
+};
+
+class Q_GUI_EXPORT QRhiRenderBuffer : public QRhiResource
+{
+public:
+ enum Type {
+ DepthStencil,
+ Color
+ };
+
+ enum Flag {
+ UsedWithSwapChainOnly = 1 << 0
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ QRhiResource::Type resourceType() const override;
+
+ Type type() const { return m_type; }
+ void setType(Type t) { m_type = t; }
+
+ QSize pixelSize() const { return m_pixelSize; }
+ void setPixelSize(const QSize &sz) { m_pixelSize = sz; }
+
+ int sampleCount() const { return m_sampleCount; }
+ void setSampleCount(int s) { m_sampleCount = s; }
+
+ Flags flags() const { return m_flags; }
+ void setFlags(Flags h) { m_flags = h; }
+
+ virtual bool build() = 0;
+
+ virtual QRhiTexture::Format backingFormat() const = 0;
+
+protected:
+ QRhiRenderBuffer(QRhiImplementation *rhi, Type type_, const QSize &pixelSize_,
+ int sampleCount_, Flags flags_);
+ Type m_type;
+ QSize m_pixelSize;
+ int m_sampleCount;
+ Flags m_flags;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiRenderBuffer::Flags)
+
+class Q_GUI_EXPORT QRhiRenderPassDescriptor : public QRhiResource
+{
+public:
+ QRhiResource::Type resourceType() const override;
+
+ virtual const QRhiNativeHandles *nativeHandles();
+
+protected:
+ QRhiRenderPassDescriptor(QRhiImplementation *rhi);
+};
+
+class Q_GUI_EXPORT QRhiRenderTarget : public QRhiResource
+{
+public:
+ QRhiResource::Type resourceType() const override;
+
+ virtual QSize pixelSize() const = 0;
+ virtual float devicePixelRatio() const = 0;
+ virtual int sampleCount() const = 0;
+
+ QRhiRenderPassDescriptor *renderPassDescriptor() const { return m_renderPassDesc; }
+ void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc) { m_renderPassDesc = desc; }
+
+protected:
+ QRhiRenderTarget(QRhiImplementation *rhi);
+ QRhiRenderPassDescriptor *m_renderPassDesc = nullptr;
+};
+
+class Q_GUI_EXPORT QRhiTextureRenderTarget : public QRhiRenderTarget
+{
+public:
+ enum Flag {
+ PreserveColorContents = 1 << 0,
+ PreserveDepthStencilContents = 1 << 1
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ QRhiResource::Type resourceType() const override;
+
+ QRhiTextureRenderTargetDescription description() const { return m_desc; }
+ void setDescription(const QRhiTextureRenderTargetDescription &desc) { m_desc = desc; }
+
+ Flags flags() const { return m_flags; }
+ void setFlags(Flags f) { m_flags = f; }
+
+ virtual QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() = 0;
+
+ virtual bool build() = 0;
+
+protected:
+ QRhiTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc_, Flags flags_);
+ QRhiTextureRenderTargetDescription m_desc;
+ Flags m_flags;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiTextureRenderTarget::Flags)
+
+class Q_GUI_EXPORT QRhiShaderResourceBindings : public QRhiResource
+{
+public:
+ QRhiResource::Type resourceType() const override;
+
+ void setBindings(std::initializer_list<QRhiShaderResourceBinding> list) { m_bindings = list; }
+
+ template<typename InputIterator>
+ void setBindings(InputIterator first, InputIterator last)
+ {
+ m_bindings.clear();
+ std::copy(first, last, std::back_inserter(m_bindings));
+ }
+
+ void setBindings(const QVector<QRhiShaderResourceBinding> &bindings) // compat., to be removed
+ {
+ setBindings(bindings.cbegin(), bindings.cend());
+ }
+
+ const QRhiShaderResourceBinding *cbeginBindings() const { return m_bindings.cbegin(); }
+ const QRhiShaderResourceBinding *cendBindings() const { return m_bindings.cend(); }
+
+ bool isLayoutCompatible(const QRhiShaderResourceBindings *other) const;
+
+ virtual bool build() = 0;
+
+protected:
+ QRhiShaderResourceBindings(QRhiImplementation *rhi);
+ QVarLengthArray<QRhiShaderResourceBinding, 8> m_bindings;
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderResourceBindings &);
+#endif
+};
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderResourceBindings &);
+#endif
+
+class Q_GUI_EXPORT QRhiGraphicsPipeline : public QRhiResource
+{
+public:
+ enum Flag {
+ UsesBlendConstants = 1 << 0,
+ UsesStencilRef = 1 << 1,
+ UsesScissor = 1 << 2
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ enum Topology {
+ Triangles,
+ TriangleStrip,
+ TriangleFan,
+ Lines,
+ LineStrip,
+ Points
+ };
+
+ enum CullMode {
+ None,
+ Front,
+ Back
+ };
+
+ enum FrontFace {
+ CCW,
+ CW
+ };
+
+ enum ColorMaskComponent {
+ R = 1 << 0,
+ G = 1 << 1,
+ B = 1 << 2,
+ A = 1 << 3
+ };
+ Q_DECLARE_FLAGS(ColorMask, ColorMaskComponent)
+
+ enum BlendFactor {
+ Zero,
+ One,
+ SrcColor,
+ OneMinusSrcColor,
+ DstColor,
+ OneMinusDstColor,
+ SrcAlpha,
+ OneMinusSrcAlpha,
+ DstAlpha,
+ OneMinusDstAlpha,
+ ConstantColor,
+ OneMinusConstantColor,
+ ConstantAlpha,
+ OneMinusConstantAlpha,
+ SrcAlphaSaturate,
+ Src1Color,
+ OneMinusSrc1Color,
+ Src1Alpha,
+ OneMinusSrc1Alpha
+ };
+
+ enum BlendOp {
+ Add,
+ Subtract,
+ ReverseSubtract,
+ Min,
+ Max
+ };
+
+ struct TargetBlend {
+ ColorMask colorWrite = ColorMask(0xF); // R | G | B | A
+ bool enable = false;
+ BlendFactor srcColor = One;
+ BlendFactor dstColor = OneMinusSrcAlpha;
+ BlendOp opColor = Add;
+ BlendFactor srcAlpha = One;
+ BlendFactor dstAlpha = OneMinusSrcAlpha;
+ BlendOp opAlpha = Add;
+ };
+
+ enum CompareOp {
+ Never,
+ Less,
+ Equal,
+ LessOrEqual,
+ Greater,
+ NotEqual,
+ GreaterOrEqual,
+ Always
+ };
+
+ enum StencilOp {
+ StencilZero,
+ Keep,
+ Replace,
+ IncrementAndClamp,
+ DecrementAndClamp,
+ Invert,
+ IncrementAndWrap,
+ DecrementAndWrap
+ };
+
+ struct StencilOpState {
+ StencilOp failOp = Keep;
+ StencilOp depthFailOp = Keep;
+ StencilOp passOp = Keep;
+ CompareOp compareOp = Always;
+ };
+
+ QRhiResource::Type resourceType() const override;
+
+ Flags flags() const { return m_flags; }
+ void setFlags(Flags f) { m_flags = f; }
+
+ Topology topology() const { return m_topology; }
+ void setTopology(Topology t) { m_topology = t; }
+
+ CullMode cullMode() const { return m_cullMode; }
+ void setCullMode(CullMode mode) { m_cullMode = mode; }
+
+ FrontFace frontFace() const { return m_frontFace; }
+ void setFrontFace(FrontFace f) { m_frontFace = f; }
+
+ void setTargetBlends(std::initializer_list<TargetBlend> list) { m_targetBlends = list; }
+ template<typename InputIterator>
+ void setTargetBlends(InputIterator first, InputIterator last)
+ {
+ m_targetBlends.clear();
+ std::copy(first, last, std::back_inserter(m_targetBlends));
+ }
+ const TargetBlend *cbeginTargetBlends() const { return m_targetBlends.cbegin(); }
+ const TargetBlend *cendTargetBlends() const { return m_targetBlends.cend(); }
+
+ bool hasDepthTest() const { return m_depthTest; }
+ void setDepthTest(bool enable) { m_depthTest = enable; }
+
+ bool hasDepthWrite() const { return m_depthWrite; }
+ void setDepthWrite(bool enable) { m_depthWrite = enable; }
+
+ CompareOp depthOp() const { return m_depthOp; }
+ void setDepthOp(CompareOp op) { m_depthOp = op; }
+
+ bool hasStencilTest() const { return m_stencilTest; }
+ void setStencilTest(bool enable) { m_stencilTest = enable; }
+
+ StencilOpState stencilFront() const { return m_stencilFront; }
+ void setStencilFront(const StencilOpState &state) { m_stencilFront = state; }
+
+ StencilOpState stencilBack() const { return m_stencilBack; }
+ void setStencilBack(const StencilOpState &state) { m_stencilBack = state; }
+
+ quint32 stencilReadMask() const { return m_stencilReadMask; }
+ void setStencilReadMask(quint32 mask) { m_stencilReadMask = mask; }
+
+ quint32 stencilWriteMask() const { return m_stencilWriteMask; }
+ void setStencilWriteMask(quint32 mask) { m_stencilWriteMask = mask; }
+
+ int sampleCount() const { return m_sampleCount; }
+ void setSampleCount(int s) { m_sampleCount = s; }
+
+ float lineWidth() const { return m_lineWidth; }
+ void setLineWidth(float width) { m_lineWidth = width; }
+
+ void setShaderStages(std::initializer_list<QRhiShaderStage> list) { m_shaderStages = list; }
+ template<typename InputIterator>
+ void setShaderStages(InputIterator first, InputIterator last)
+ {
+ m_shaderStages.clear();
+ std::copy(first, last, std::back_inserter(m_shaderStages));
+ }
+ void setShaderStages(const QVector<QRhiShaderStage> &stages) // compat., to be removed
+ {
+ setShaderStages(stages.cbegin(), stages.cend());
+ }
+ const QRhiShaderStage *cbeginShaderStages() const { return m_shaderStages.cbegin(); }
+ const QRhiShaderStage *cendShaderStages() const { return m_shaderStages.cend(); }
+
+ QRhiVertexInputLayout vertexInputLayout() const { return m_vertexInputLayout; }
+ void setVertexInputLayout(const QRhiVertexInputLayout &layout) { m_vertexInputLayout = layout; }
+
+ QRhiShaderResourceBindings *shaderResourceBindings() const { return m_shaderResourceBindings; }
+ void setShaderResourceBindings(QRhiShaderResourceBindings *srb) { m_shaderResourceBindings = srb; }
+
+ QRhiRenderPassDescriptor *renderPassDescriptor() const { return m_renderPassDesc; }
+ void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc) { m_renderPassDesc = desc; }
+
+ virtual bool build() = 0;
+
+protected:
+ QRhiGraphicsPipeline(QRhiImplementation *rhi);
+ Flags m_flags;
+ Topology m_topology = Triangles;
+ CullMode m_cullMode = None;
+ FrontFace m_frontFace = CCW;
+ QVarLengthArray<TargetBlend, 8> m_targetBlends;
+ bool m_depthTest = false;
+ bool m_depthWrite = false;
+ CompareOp m_depthOp = Less;
+ bool m_stencilTest = false;
+ StencilOpState m_stencilFront;
+ StencilOpState m_stencilBack;
+ quint32 m_stencilReadMask = 0xFF;
+ quint32 m_stencilWriteMask = 0xFF;
+ int m_sampleCount = 1;
+ float m_lineWidth = 1.0f;
+ QVarLengthArray<QRhiShaderStage, 4> m_shaderStages;
+ QRhiVertexInputLayout m_vertexInputLayout;
+ QRhiShaderResourceBindings *m_shaderResourceBindings = nullptr;
+ QRhiRenderPassDescriptor *m_renderPassDesc = nullptr;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::Flags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiGraphicsPipeline::ColorMask)
+Q_DECLARE_TYPEINFO(QRhiGraphicsPipeline::TargetBlend, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QRhiSwapChain : public QRhiResource
+{
+public:
+ enum Flag {
+ SurfaceHasPreMulAlpha = 1 << 0,
+ SurfaceHasNonPreMulAlpha = 1 << 1,
+ sRGB = 1 << 2,
+ UsedAsTransferSource = 1 << 3,
+ NoVSync = 1 << 4,
+ MinimalBufferCount = 1 << 5
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ QRhiResource::Type resourceType() const override;
+
+ QWindow *window() const { return m_window; }
+ void setWindow(QWindow *window) { m_window = window; }
+
+ Flags flags() const { return m_flags; }
+ void setFlags(Flags f) { m_flags = f; }
+
+ QRhiRenderBuffer *depthStencil() const { return m_depthStencil; }
+ void setDepthStencil(QRhiRenderBuffer *ds) { m_depthStencil = ds; }
+
+ int sampleCount() const { return m_sampleCount; }
+ void setSampleCount(int samples) { m_sampleCount = samples; }
+
+ QRhiRenderPassDescriptor *renderPassDescriptor() const { return m_renderPassDesc; }
+ void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc) { m_renderPassDesc = desc; }
+
+ QSize currentPixelSize() const { return m_currentPixelSize; }
+
+ virtual QRhiCommandBuffer *currentFrameCommandBuffer() = 0;
+ virtual QRhiRenderTarget *currentFrameRenderTarget() = 0;
+ virtual QSize surfacePixelSize() = 0;
+ virtual QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() = 0;
+ virtual bool buildOrResize() = 0;
+
+protected:
+ QRhiSwapChain(QRhiImplementation *rhi);
+ QWindow *m_window = nullptr;
+ Flags m_flags;
+ QRhiRenderBuffer *m_depthStencil = nullptr;
+ int m_sampleCount = 1;
+ QRhiRenderPassDescriptor *m_renderPassDesc = nullptr;
+ QSize m_currentPixelSize;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiSwapChain::Flags)
+
+class Q_GUI_EXPORT QRhiComputePipeline : public QRhiResource
+{
+public:
+ QRhiResource::Type resourceType() const override;
+ virtual bool build() = 0;
+
+ QRhiShaderStage shaderStage() const { return m_shaderStage; }
+ void setShaderStage(const QRhiShaderStage &stage) { m_shaderStage = stage; }
+
+ QRhiShaderResourceBindings *shaderResourceBindings() const { return m_shaderResourceBindings; }
+ void setShaderResourceBindings(QRhiShaderResourceBindings *srb) { m_shaderResourceBindings = srb; }
+
+protected:
+ QRhiComputePipeline(QRhiImplementation *rhi);
+ QRhiShaderStage m_shaderStage;
+ QRhiShaderResourceBindings *m_shaderResourceBindings = nullptr;
+};
+
+class Q_GUI_EXPORT QRhiCommandBuffer : public QRhiResource
+{
+public:
+ enum IndexFormat {
+ IndexUInt16,
+ IndexUInt32
+ };
+
+ QRhiResource::Type resourceType() const override;
+
+ void resourceUpdate(QRhiResourceUpdateBatch *resourceUpdates);
+
+ void beginPass(QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates = nullptr);
+ void endPass(QRhiResourceUpdateBatch *resourceUpdates = nullptr);
+
+ void setGraphicsPipeline(QRhiGraphicsPipeline *ps);
+ using DynamicOffset = QPair<int, quint32>; // binding, offset
+ void setShaderResources(QRhiShaderResourceBindings *srb = nullptr,
+ int dynamicOffsetCount = 0,
+ const DynamicOffset *dynamicOffsets = nullptr);
+ using VertexInput = QPair<QRhiBuffer *, quint32>; // buffer, offset
+ void setVertexInput(int startBinding, int bindingCount, const VertexInput *bindings,
+ QRhiBuffer *indexBuf = nullptr, quint32 indexOffset = 0,
+ IndexFormat indexFormat = IndexUInt16);
+
+ void setViewport(const QRhiViewport &viewport);
+ void setScissor(const QRhiScissor &scissor);
+ void setBlendConstants(const QColor &c);
+ void setStencilRef(quint32 refValue);
+
+ void draw(quint32 vertexCount,
+ quint32 instanceCount = 1,
+ quint32 firstVertex = 0,
+ quint32 firstInstance = 0);
+
+ void drawIndexed(quint32 indexCount,
+ quint32 instanceCount = 1,
+ quint32 firstIndex = 0,
+ qint32 vertexOffset = 0,
+ quint32 firstInstance = 0);
+
+ void debugMarkBegin(const QByteArray &name);
+ void debugMarkEnd();
+ void debugMarkMsg(const QByteArray &msg);
+
+ void beginComputePass(QRhiResourceUpdateBatch *resourceUpdates = nullptr);
+ void endComputePass(QRhiResourceUpdateBatch *resourceUpdates = nullptr);
+ void setComputePipeline(QRhiComputePipeline *ps);
+ void dispatch(int x, int y, int z);
+
+ const QRhiNativeHandles *nativeHandles();
+ void beginExternal();
+ void endExternal();
+
+protected:
+ QRhiCommandBuffer(QRhiImplementation *rhi);
+};
+
+struct Q_GUI_EXPORT QRhiReadbackResult
+{
+ std::function<void()> completed = nullptr;
+ QRhiTexture::Format format;
+ QSize pixelSize;
+ QByteArray data;
+}; // non-movable due to the std::function
+
+struct Q_GUI_EXPORT QRhiBufferReadbackResult
+{
+ std::function<void()> completed = nullptr;
+ QByteArray data;
+};
+
+class Q_GUI_EXPORT QRhiResourceUpdateBatch
+{
+public:
+ ~QRhiResourceUpdateBatch();
+
+ void release();
+
+ void merge(QRhiResourceUpdateBatch *other);
+
+ void updateDynamicBuffer(QRhiBuffer *buf, int offset, int size, const void *data);
+ void uploadStaticBuffer(QRhiBuffer *buf, int offset, int size, const void *data);
+ void uploadStaticBuffer(QRhiBuffer *buf, const void *data);
+ void readBackBuffer(QRhiBuffer *buf, int offset, int size, QRhiBufferReadbackResult *result);
+ void uploadTexture(QRhiTexture *tex, const QRhiTextureUploadDescription &desc);
+ void uploadTexture(QRhiTexture *tex, const QImage &image);
+ void copyTexture(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc = QRhiTextureCopyDescription());
+ void readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result);
+ void generateMips(QRhiTexture *tex, int layer = 0);
+
+private:
+ QRhiResourceUpdateBatch(QRhiImplementation *rhi);
+ Q_DISABLE_COPY(QRhiResourceUpdateBatch)
+ QRhiResourceUpdateBatchPrivate *d;
+ friend class QRhiResourceUpdateBatchPrivate;
+ friend class QRhi;
+};
+
+struct Q_GUI_EXPORT QRhiInitParams
+{
+};
+
+class Q_GUI_EXPORT QRhi
+{
+public:
+ enum Implementation {
+ Null,
+ Vulkan,
+ OpenGLES2,
+ D3D11,
+ Metal
+ };
+
+ enum Flag {
+ EnableProfiling = 1 << 0,
+ EnableDebugMarkers = 1 << 1,
+ PreferSoftwareRenderer = 1 << 2
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ enum FrameOpResult {
+ FrameOpSuccess = 0,
+ FrameOpError,
+ FrameOpSwapChainOutOfDate,
+ FrameOpDeviceLost
+ };
+
+ enum Feature {
+ MultisampleTexture = 1,
+ MultisampleRenderBuffer,
+ DebugMarkers,
+ Timestamps,
+ Instancing,
+ CustomInstanceStepRate,
+ PrimitiveRestart,
+ NonDynamicUniformBuffers,
+ NonFourAlignedEffectiveIndexBufferOffset,
+ NPOTTextureRepeat,
+ RedOrAlpha8IsRed,
+ ElementIndexUint,
+ Compute,
+ WideLines,
+ VertexShaderPointSize,
+ BaseVertex,
+ BaseInstance,
+ TriangleFanTopology,
+ ReadBackNonUniformBuffer,
+ ReadBackNonBaseMipLevel
+ };
+
+ enum BeginFrameFlag {
+ ExternalContentsInPass = 0x01
+ };
+ Q_DECLARE_FLAGS(BeginFrameFlags, BeginFrameFlag)
+
+ enum EndFrameFlag {
+ SkipPresent = 1 << 0
+ };
+ Q_DECLARE_FLAGS(EndFrameFlags, EndFrameFlag)
+
+ enum ResourceLimit {
+ TextureSizeMin = 1,
+ TextureSizeMax,
+ MaxColorAttachments,
+ FramesInFlight
+ };
+
+ ~QRhi();
+
+ static QRhi *create(Implementation impl,
+ QRhiInitParams *params,
+ Flags flags = Flags(),
+ QRhiNativeHandles *importDevice = nullptr);
+
+ Implementation backend() const;
+ QThread *thread() const;
+
+ using CleanupCallback = std::function<void(QRhi *)>;
+ void addCleanupCallback(const CleanupCallback &callback);
+ void runCleanup();
+
+ QRhiGraphicsPipeline *newGraphicsPipeline();
+ QRhiComputePipeline *newComputePipeline();
+ QRhiShaderResourceBindings *newShaderResourceBindings();
+
+ QRhiBuffer *newBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size);
+
+ QRhiRenderBuffer *newRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount = 1,
+ QRhiRenderBuffer::Flags flags = QRhiRenderBuffer::Flags());
+
+ QRhiTexture *newTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount = 1,
+ QRhiTexture::Flags flags = QRhiTexture::Flags());
+
+ QRhiSampler *newSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler::AddressMode u, QRhiSampler::AddressMode v);
+
+ QRhiTextureRenderTarget *newTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags = QRhiTextureRenderTarget::Flags());
+
+ QRhiSwapChain *newSwapChain();
+ FrameOpResult beginFrame(QRhiSwapChain *swapChain, BeginFrameFlags flags = BeginFrameFlags());
+ FrameOpResult endFrame(QRhiSwapChain *swapChain, EndFrameFlags flags = EndFrameFlags());
+ bool isRecordingFrame() const;
+ int currentFrameSlot() const;
+
+ FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, BeginFrameFlags flags = BeginFrameFlags());
+ FrameOpResult endOffscreenFrame(EndFrameFlags flags = EndFrameFlags());
+
+ QRhi::FrameOpResult finish();
+
+ QRhiResourceUpdateBatch *nextResourceUpdateBatch();
+
+ QVector<int> supportedSampleCounts() const;
+
+ int ubufAlignment() const;
+ int ubufAligned(int v) const;
+
+ int mipLevelsForSize(const QSize &size) const;
+ QSize sizeForMipLevel(int mipLevel, const QSize &baseLevelSize) const;
+
+ bool isYUpInFramebuffer() const;
+ bool isYUpInNDC() const;
+ bool isClipDepthZeroToOne() const;
+
+ QMatrix4x4 clipSpaceCorrMatrix() const;
+
+ bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags = QRhiTexture::Flags()) const;
+ bool isFeatureSupported(QRhi::Feature feature) const;
+ int resourceLimit(ResourceLimit limit) const;
+
+ const QRhiNativeHandles *nativeHandles();
+ bool makeThreadLocalNativeContextCurrent();
+
+ QRhiProfiler *profiler();
+
+ static const int MAX_LAYERS = 6; // cubemaps only
+ static const int MAX_LEVELS = 16; // a width and/or height of 65536 should be enough for everyone
+
+ void releaseCachedResources();
+
+ bool isDeviceLost() const;
+
+protected:
+ QRhi();
+
+private:
+ Q_DISABLE_COPY(QRhi)
+ QRhiImplementation *d = nullptr;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::Flags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::BeginFrameFlags)
+Q_DECLARE_OPERATORS_FOR_FLAGS(QRhi::EndFrameFlags)
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhi_p_p.h b/src/gui/rhi/qrhi_p_p.h
new file mode 100644
index 0000000000..baffe28202
--- /dev/null
+++ b/src/gui/rhi/qrhi_p_p.h
@@ -0,0 +1,551 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHI_P_H
+#define QRHI_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 "qrhi_p.h"
+#include "qrhiprofiler_p_p.h"
+#include <QBitArray>
+#include <QAtomicInt>
+#include <QLoggingCategory>
+
+QT_BEGIN_NAMESPACE
+
+#define QRHI_RES(t, x) static_cast<t *>(x)
+#define QRHI_RES_RHI(t) t *rhiD = static_cast<t *>(m_rhi)
+#define QRHI_PROF QRhiProfilerPrivate *rhiP = m_rhi->profilerPrivateOrNull()
+#define QRHI_PROF_F(f) for (bool qrhip_enabled = rhiP != nullptr; qrhip_enabled; qrhip_enabled = false) rhiP->f
+
+Q_DECLARE_LOGGING_CATEGORY(QRHI_LOG_INFO)
+
+class QRhiImplementation
+{
+public:
+ virtual ~QRhiImplementation();
+
+ virtual bool create(QRhi::Flags flags) = 0;
+ virtual void destroy() = 0;
+
+ virtual QRhiGraphicsPipeline *createGraphicsPipeline() = 0;
+ virtual QRhiComputePipeline *createComputePipeline() = 0;
+ virtual QRhiShaderResourceBindings *createShaderResourceBindings() = 0;
+ virtual QRhiBuffer *createBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size) = 0;
+ virtual QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags) = 0;
+ virtual QRhiTexture *createTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags) = 0;
+ virtual QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v) = 0;
+
+ virtual QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags) = 0;
+
+ virtual QRhiSwapChain *createSwapChain() = 0;
+ virtual QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) = 0;
+ virtual QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) = 0;
+ virtual QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) = 0;
+ virtual QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) = 0;
+ virtual QRhi::FrameOpResult finish() = 0;
+
+ virtual void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) = 0;
+
+ virtual void beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates) = 0;
+ virtual void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) = 0;
+
+ virtual void setGraphicsPipeline(QRhiCommandBuffer *cb,
+ QRhiGraphicsPipeline *ps) = 0;
+
+ virtual void setShaderResources(QRhiCommandBuffer *cb,
+ QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) = 0;
+
+ virtual void setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ QRhiCommandBuffer::IndexFormat indexFormat) = 0;
+
+ virtual void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) = 0;
+ virtual void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) = 0;
+ virtual void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) = 0;
+ virtual void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) = 0;
+
+ virtual void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) = 0;
+ virtual void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex,
+ qint32 vertexOffset, quint32 firstInstance) = 0;
+
+ virtual void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) = 0;
+ virtual void debugMarkEnd(QRhiCommandBuffer *cb) = 0;
+ virtual void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) = 0;
+
+ virtual void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) = 0;
+ virtual void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) = 0;
+ virtual void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) = 0;
+ virtual void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) = 0;
+
+ virtual const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) = 0;
+ virtual void beginExternal(QRhiCommandBuffer *cb) = 0;
+ virtual void endExternal(QRhiCommandBuffer *cb) = 0;
+
+ virtual QVector<int> supportedSampleCounts() const = 0;
+ virtual int ubufAlignment() const = 0;
+ virtual bool isYUpInFramebuffer() const = 0;
+ virtual bool isYUpInNDC() const = 0;
+ virtual bool isClipDepthZeroToOne() const = 0;
+ virtual QMatrix4x4 clipSpaceCorrMatrix() const = 0;
+ virtual bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const = 0;
+ virtual bool isFeatureSupported(QRhi::Feature feature) const = 0;
+ virtual int resourceLimit(QRhi::ResourceLimit limit) const = 0;
+ virtual const QRhiNativeHandles *nativeHandles() = 0;
+ virtual void sendVMemStatsToProfiler() = 0;
+ virtual bool makeThreadLocalNativeContextCurrent() = 0;
+ virtual void releaseCachedResources() = 0;
+ virtual bool isDeviceLost() const = 0;
+
+ bool isCompressedFormat(QRhiTexture::Format format) const;
+ void compressedFormatInfo(QRhiTexture::Format format, const QSize &size,
+ quint32 *bpl, quint32 *byteSize,
+ QSize *blockDim) const;
+ void textureFormatInfo(QRhiTexture::Format format, const QSize &size,
+ quint32 *bpl, quint32 *byteSize) const;
+ quint32 approxByteSizeForTexture(QRhiTexture::Format format, const QSize &baseSize,
+ int mipCount, int layerCount);
+
+ QRhiProfilerPrivate *profilerPrivateOrNull()
+ {
+ // return null when QRhi::EnableProfiling was not set
+ QRhiProfilerPrivate *p = QRhiProfilerPrivate::get(&profiler);
+ return p->rhiDWhenEnabled ? p : nullptr;
+ }
+
+ // only really care about resources that own native graphics resources underneath
+ void registerResource(QRhiResource *res)
+ {
+ resources.insert(res);
+ }
+
+ void unregisterResource(QRhiResource *res)
+ {
+ resources.remove(res);
+ }
+
+ QSet<QRhiResource *> activeResources() const
+ {
+ return resources;
+ }
+
+ void addReleaseAndDestroyLater(QRhiResource *res)
+ {
+ if (inFrame)
+ pendingReleaseAndDestroyResources.insert(res);
+ else
+ delete res;
+ }
+
+ void addCleanupCallback(const QRhi::CleanupCallback &callback)
+ {
+ cleanupCallbacks.append(callback);
+ }
+
+ bool sanityCheckGraphicsPipeline(QRhiGraphicsPipeline *ps);
+
+ QRhi *q;
+
+ static const int MAX_SHADER_CACHE_ENTRIES = 128;
+
+protected:
+ bool debugMarkers = false;
+ int currentFrameSlot = 0; // for vk, mtl, and similar. unused by gl and d3d11.
+ bool inFrame = false;
+
+private:
+ QRhi::Implementation implType;
+ QThread *implThread;
+ QRhiProfiler profiler;
+ QVarLengthArray<QRhiResourceUpdateBatch *, 4> resUpdPool;
+ QBitArray resUpdPoolMap;
+ QSet<QRhiResource *> resources;
+ QSet<QRhiResource *> pendingReleaseAndDestroyResources;
+ QVector<QRhi::CleanupCallback> cleanupCallbacks;
+
+ friend class QRhi;
+ friend class QRhiResourceUpdateBatchPrivate;
+};
+
+template<typename T, size_t N>
+bool qrhi_toTopLeftRenderTargetRect(const QSize &outputSize, const std::array<T, N> &r,
+ T *x, T *y, T *w, T *h)
+{
+ // x,y are bottom-left in QRhiScissor and QRhiViewport but top-left in
+ // Vulkan/Metal/D3D. Our input is an OpenGL-style scissor rect where both
+ // negative x or y, and partly or completely out of bounds rects are
+ // allowed. The only thing the input here cannot have is a negative width
+ // or height. We must handle all other input gracefully, clamping to a zero
+ // width or height rect in the worst case, and ensuring the resulting rect
+ // is inside the rendertarget's bounds because some APIs' validation/debug
+ // layers are allergic to out of bounds scissor or viewport rects.
+
+ const T outputWidth = outputSize.width();
+ const T outputHeight = outputSize.height();
+ const T inputWidth = r[2];
+ const T inputHeight = r[3];
+
+ if (inputWidth < 0 || inputHeight < 0)
+ return false;
+
+ *x = r[0];
+ *y = outputHeight - (r[1] + inputHeight);
+
+ const T widthOffset = *x < 0 ? -*x : 0;
+ const T heightOffset = *y < 0 ? -*y : 0;
+
+ *x = qBound<T>(0, *x, outputWidth - 1);
+ *y = qBound<T>(0, *y, outputHeight - 1);
+ *w = qMax<T>(0, inputWidth - widthOffset);
+ *h = qMax<T>(0, inputHeight - heightOffset);
+
+ if (*x + *w > outputWidth)
+ *w = qMax<T>(0, outputWidth - *x - 1);
+ if (*y + *h > outputHeight)
+ *h = qMax<T>(0, outputHeight - *y - 1);
+
+ return true;
+}
+
+class QRhiResourceUpdateBatchPrivate
+{
+public:
+ struct BufferOp {
+ enum Type {
+ DynamicUpdate,
+ StaticUpload,
+ Read
+ };
+ Type type;
+ QRhiBuffer *buf;
+ int offset;
+ QByteArray data;
+ int readSize;
+ QRhiBufferReadbackResult *result;
+
+ static BufferOp dynamicUpdate(QRhiBuffer *buf, int offset, int size, const void *data)
+ {
+ BufferOp op;
+ op.type = DynamicUpdate;
+ op.buf = buf;
+ op.offset = offset;
+ op.data = QByteArray(reinterpret_cast<const char *>(data), size ? size : buf->size());
+ return op;
+ }
+
+ static BufferOp staticUpload(QRhiBuffer *buf, int offset, int size, const void *data)
+ {
+ BufferOp op;
+ op.type = StaticUpload;
+ op.buf = buf;
+ op.offset = offset;
+ op.data = QByteArray(reinterpret_cast<const char *>(data), size ? size : buf->size());
+ return op;
+ }
+
+ static BufferOp read(QRhiBuffer *buf, int offset, int size, QRhiBufferReadbackResult *result)
+ {
+ BufferOp op;
+ op.type = Read;
+ op.buf = buf;
+ op.offset = offset;
+ op.readSize = size;
+ op.result = result;
+ return op;
+ }
+ };
+
+ struct TextureOp {
+ enum Type {
+ Upload,
+ Copy,
+ Read,
+ GenMips
+ };
+ Type type;
+ QRhiTexture *dst;
+ // Specifying multiple uploads for a subresource must be supported.
+ // In the backend this can then end up, where applicable, as a
+ // single, batched copy operation with only one set of barriers.
+ // This helps when doing for example glyph cache fills.
+ QVector<QRhiTextureSubresourceUploadDescription> subresDesc[QRhi::MAX_LAYERS][QRhi::MAX_LEVELS];
+ QRhiTexture *src;
+ QRhiTextureCopyDescription desc;
+ QRhiReadbackDescription rb;
+ QRhiReadbackResult *result;
+ int layer;
+
+ static TextureOp upload(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
+ {
+ TextureOp op;
+ op.type = Upload;
+ op.dst = tex;
+ for (auto it = desc.cbeginEntries(), itEnd = desc.cendEntries(); it != itEnd; ++it)
+ op.subresDesc[it->layer()][it->level()].append(it->description());
+ return op;
+ }
+
+ static TextureOp copy(QRhiTexture *dst, QRhiTexture *src, const QRhiTextureCopyDescription &desc)
+ {
+ TextureOp op;
+ op.type = Copy;
+ op.dst = dst;
+ op.src = src;
+ op.desc = desc;
+ return op;
+ }
+
+ static TextureOp read(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
+ {
+ TextureOp op;
+ op.type = Read;
+ op.rb = rb;
+ op.result = result;
+ return op;
+ }
+
+ static TextureOp genMips(QRhiTexture *tex, int layer)
+ {
+ TextureOp op;
+ op.type = GenMips;
+ op.dst = tex;
+ op.layer = layer;
+ return op;
+ }
+ };
+
+ QVarLengthArray<BufferOp, 1024> bufferOps;
+ QVarLengthArray<TextureOp, 256> textureOps;
+
+ QRhiResourceUpdateBatch *q = nullptr;
+ QRhiImplementation *rhi = nullptr;
+ int poolIndex = -1;
+
+ void free();
+ void merge(QRhiResourceUpdateBatchPrivate *other);
+
+ static QRhiResourceUpdateBatchPrivate *get(QRhiResourceUpdateBatch *b) { return b->d; }
+};
+
+Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::BufferOp, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiResourceUpdateBatchPrivate::TextureOp, Q_MOVABLE_TYPE);
+
+template<typename T>
+struct QRhiBatchedBindings
+{
+ void feed(int binding, T resource) { // binding must be strictly increasing
+ if (curBinding == -1 || binding > curBinding + 1) {
+ finish();
+ curBatch.startBinding = binding;
+ curBatch.resources.clear();
+ curBatch.resources.append(resource);
+ } else {
+ Q_ASSERT(binding == curBinding + 1);
+ curBatch.resources.append(resource);
+ }
+ curBinding = binding;
+ }
+
+ void finish() {
+ if (!curBatch.resources.isEmpty())
+ batches.append(curBatch);
+ }
+
+ void clear() {
+ batches.clear();
+ curBatch.resources.clear();
+ curBinding = -1;
+ }
+
+ struct Batch {
+ uint startBinding;
+ QVarLengthArray<T, 4> resources;
+
+ bool operator==(const Batch &other) const
+ {
+ return startBinding == other.startBinding && resources == other.resources;
+ }
+
+ bool operator!=(const Batch &other) const
+ {
+ return !operator==(other);
+ }
+ };
+
+ QVarLengthArray<Batch, 4> batches; // sorted by startBinding
+
+ bool operator==(const QRhiBatchedBindings<T> &other) const
+ {
+ return batches == other.batches;
+ }
+
+ bool operator!=(const QRhiBatchedBindings<T> &other) const
+ {
+ return !operator==(other);
+ }
+
+private:
+ Batch curBatch;
+ int curBinding = -1;
+};
+
+class QRhiGlobalObjectIdGenerator
+{
+public:
+#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
+ using Type = quint64;
+#else
+ using Type = quint32;
+#endif
+ static Type newId();
+};
+
+class QRhiPassResourceTracker
+{
+public:
+ bool isEmpty() const;
+ void reset();
+
+ struct UsageState {
+ int layout;
+ int access;
+ int stage;
+ };
+
+ enum BufferStage {
+ BufVertexInputStage,
+ BufVertexStage,
+ BufFragmentStage,
+ BufComputeStage
+ };
+
+ enum BufferAccess {
+ BufVertexInput,
+ BufIndexRead,
+ BufUniformRead,
+ BufStorageLoad,
+ BufStorageStore,
+ BufStorageLoadStore
+ };
+
+ void registerBuffer(QRhiBuffer *buf, int slot, BufferAccess *access, BufferStage *stage,
+ const UsageState &state);
+
+ enum TextureStage {
+ TexVertexStage,
+ TexFragmentStage,
+ TexColorOutputStage,
+ TexDepthOutputStage,
+ TexComputeStage
+ };
+
+ enum TextureAccess {
+ TexSample,
+ TexColorOutput,
+ TexDepthOutput,
+ TexStorageLoad,
+ TexStorageStore,
+ TexStorageLoadStore
+ };
+
+ void registerTexture(QRhiTexture *tex, TextureAccess *access, TextureStage *stage,
+ const UsageState &state);
+
+ struct Buffer {
+ int slot;
+ BufferAccess access;
+ BufferStage stage;
+ UsageState stateAtPassBegin;
+ };
+
+ using BufferIterator = QHash<QRhiBuffer *, Buffer>::const_iterator;
+ BufferIterator cbeginBuffers() const { return m_buffers.cbegin(); }
+ BufferIterator cendBuffers() const { return m_buffers.cend(); }
+
+ struct Texture {
+ TextureAccess access;
+ TextureStage stage;
+ UsageState stateAtPassBegin;
+ };
+
+ using TextureIterator = QHash<QRhiTexture *, Texture>::const_iterator;
+ TextureIterator cbeginTextures() const { return m_textures.cbegin(); }
+ TextureIterator cendTextures() const { return m_textures.cend(); }
+
+ static BufferStage toPassTrackerBufferStage(QRhiShaderResourceBinding::StageFlags stages);
+ static TextureStage toPassTrackerTextureStage(QRhiShaderResourceBinding::StageFlags stages);
+
+private:
+ QHash<QRhiBuffer *, Buffer> m_buffers;
+ QHash<QRhiTexture *, Texture> m_textures;
+};
+
+Q_DECLARE_TYPEINFO(QRhiPassResourceTracker::Buffer, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiPassResourceTracker::Texture, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
new file mode 100644
index 0000000000..717f3e6d6c
--- /dev/null
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -0,0 +1,4110 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhid3d11_p_p.h"
+#include "qshader_p.h"
+#include "cs_tdr_p.h"
+#include <QWindow>
+#include <QOperatingSystemVersion>
+#include <qmath.h>
+#include <private/qsystemlibrary_p.h>
+
+#include <d3dcompiler.h>
+#include <comdef.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Direct3D 11 backend. Provides a double-buffered flip model (FLIP_DISCARD)
+ swapchain. Textures and "static" buffers are USAGE_DEFAULT, leaving it to
+ UpdateSubResource to upload the data in any way it sees fit. "Dynamic"
+ buffers are USAGE_DYNAMIC and updating is done by mapping with WRITE_DISCARD.
+ (so here QRhiBuffer keeps a copy of the buffer contents and all of it is
+ memcpy'd every time, leaving the rest (juggling with the memory area Map
+ returns) to the driver).
+*/
+
+/*!
+ \class QRhiD3D11InitParams
+ \internal
+ \inmodule QtGui
+ \brief Direct3D 11 specific initialization parameters.
+
+ A D3D11-based QRhi needs no special parameters for initialization. If
+ desired, enableDebugLayer can be set to \c true to enable the Direct3D
+ debug layer. This can be useful during development, but should be avoided
+ in production builds.
+
+ \badcode
+ QRhiD3D11InitParams params;
+ params.enableDebugLayer = true;
+ rhi = QRhi::create(QRhi::D3D11, &params);
+ \endcode
+
+ \note QRhiSwapChain should only be used in combination with QWindow
+ instances that have their surface type set to QSurface::OpenGLSurface.
+ There are currently no Direct3D specifics in the Windows platform support
+ of Qt and therefore there is no separate QSurface type available.
+
+ \section2 Working with existing Direct3D 11 devices
+
+ When interoperating with another graphics engine, it may be necessary to
+ get a QRhi instance that uses the same Direct3D device. This can be
+ achieved by passing a pointer to a QRhiD3D11NativeHandles to
+ QRhi::create(). Both the device and the device context must be set to a
+ non-null value then.
+
+ The QRhi does not take ownership of any of the external objects.
+
+ \note QRhi works with immediate contexts only. Deferred contexts are not
+ used in any way.
+
+ \note Regardless of using an imported or a QRhi-created device context, the
+ \c ID3D11DeviceContext1 interface (Direct3D 11.1) must be supported.
+ Initialization will fail otherwise.
+ */
+
+/*!
+ \class QRhiD3D11NativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the D3D device and device context used by the QRhi.
+
+ \note The class uses \c{void *} as the type since including the COM-based
+ \c{d3d11.h} headers is not acceptable here. The actual types are
+ \c{ID3D11Device *} and \c{ID3D11DeviceContext *}.
+ */
+
+/*!
+ \class QRhiD3D11TextureNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the D3D texture object that is backing a QRhiTexture instance.
+
+ \note The class uses \c{void *} as the type since including the COM-based
+ \c{d3d11.h} headers is not acceptable here. The actual type is
+ \c{ID3D11Texture2D *}.
+ */
+
+// help mingw with its ancient sdk headers
+#ifndef DXGI_ADAPTER_FLAG_SOFTWARE
+#define DXGI_ADAPTER_FLAG_SOFTWARE 2
+#endif
+
+QRhiD3D11::QRhiD3D11(QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *importDevice)
+ : ofr(this),
+ deviceCurse(this)
+{
+ debugLayer = params->enableDebugLayer;
+
+ deviceCurse.framesToActivate = params->framesUntilKillingDeviceViaTdr;
+ deviceCurse.permanent = params->repeatDeviceKill;
+
+ importedDevice = importDevice != nullptr;
+ if (importedDevice) {
+ dev = reinterpret_cast<ID3D11Device *>(importDevice->dev);
+ if (dev) {
+ ID3D11DeviceContext *ctx = reinterpret_cast<ID3D11DeviceContext *>(importDevice->context);
+ if (SUCCEEDED(ctx->QueryInterface(IID_ID3D11DeviceContext1, reinterpret_cast<void **>(&context)))) {
+ // get rid of the ref added by QueryInterface
+ ctx->Release();
+ } else {
+ qWarning("ID3D11DeviceContext1 not supported by context, cannot import");
+ importedDevice = false;
+ }
+ } else {
+ qWarning("No ID3D11Device given, cannot import");
+ importedDevice = false;
+ }
+ }
+}
+
+static QString comErrorMessage(HRESULT hr)
+{
+#ifndef Q_OS_WINRT
+ const _com_error comError(hr);
+#else
+ const _com_error comError(hr, nullptr);
+#endif
+ QString result = QLatin1String("Error 0x") + QString::number(ulong(hr), 16);
+ if (const wchar_t *msg = comError.ErrorMessage())
+ result += QLatin1String(": ") + QString::fromWCharArray(msg);
+ return result;
+}
+
+template <class Int>
+inline Int aligned(Int v, Int byteAlign)
+{
+ return (v + byteAlign - 1) & ~(byteAlign - 1);
+}
+
+static IDXGIFactory1 *createDXGIFactory2()
+{
+ IDXGIFactory1 *result = nullptr;
+ if (QOperatingSystemVersion::current() > QOperatingSystemVersion::Windows7) {
+ using PtrCreateDXGIFactory2 = HRESULT (WINAPI *)(UINT, REFIID, void **);
+ QSystemLibrary dxgilib(QStringLiteral("dxgi"));
+ if (auto createDXGIFactory2 = reinterpret_cast<PtrCreateDXGIFactory2>(dxgilib.resolve("CreateDXGIFactory2"))) {
+ const HRESULT hr = createDXGIFactory2(0, IID_IDXGIFactory2, reinterpret_cast<void **>(&result));
+ if (FAILED(hr)) {
+ qWarning("CreateDXGIFactory2() failed to create DXGI factory: %s", qPrintable(comErrorMessage(hr)));
+ result = nullptr;
+ }
+ } else {
+ qWarning("Unable to resolve CreateDXGIFactory2()");
+ }
+ }
+ return result;
+}
+
+static IDXGIFactory1 *createDXGIFactory1()
+{
+ IDXGIFactory1 *result = nullptr;
+ const HRESULT hr = CreateDXGIFactory1(IID_IDXGIFactory1, reinterpret_cast<void **>(&result));
+ if (FAILED(hr)) {
+ qWarning("CreateDXGIFactory1() failed to create DXGI factory: %s", qPrintable(comErrorMessage(hr)));
+ result = nullptr;
+ }
+ return result;
+}
+
+bool QRhiD3D11::create(QRhi::Flags flags)
+{
+ Q_UNUSED(flags);
+
+ uint devFlags = 0;
+ if (debugLayer)
+ devFlags |= D3D11_CREATE_DEVICE_DEBUG;
+
+ dxgiFactory = createDXGIFactory2();
+ if (dxgiFactory != nullptr) {
+ hasDxgi2 = true;
+ supportsFlipDiscardSwapchain = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10
+ && !qEnvironmentVariableIntValue("QT_D3D_NO_FLIP");
+ } else {
+ dxgiFactory = createDXGIFactory1();
+ hasDxgi2 = false;
+ supportsFlipDiscardSwapchain = false;
+ }
+
+ if (dxgiFactory == nullptr)
+ return false;
+
+ qCDebug(QRHI_LOG_INFO, "DXGI 1.2 = %s, FLIP_DISCARD swapchain supported = %s",
+ hasDxgi2 ? "true" : "false", supportsFlipDiscardSwapchain ? "true" : "false");
+
+ if (!importedDevice) {
+ IDXGIAdapter1 *adapterToUse = nullptr;
+ IDXGIAdapter1 *adapter;
+ int requestedAdapterIndex = -1;
+ if (qEnvironmentVariableIsSet("QT_D3D_ADAPTER_INDEX"))
+ requestedAdapterIndex = qEnvironmentVariableIntValue("QT_D3D_ADAPTER_INDEX");
+
+ if (requestedAdapterIndex < 0 && flags.testFlag(QRhi::PreferSoftwareRenderer)) {
+ for (int adapterIndex = 0; dxgiFactory->EnumAdapters1(UINT(adapterIndex), &adapter) != DXGI_ERROR_NOT_FOUND; ++adapterIndex) {
+ DXGI_ADAPTER_DESC1 desc;
+ adapter->GetDesc1(&desc);
+ adapter->Release();
+ if (desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) {
+ requestedAdapterIndex = adapterIndex;
+ break;
+ }
+ }
+ }
+
+ for (int adapterIndex = 0; dxgiFactory->EnumAdapters1(UINT(adapterIndex), &adapter) != DXGI_ERROR_NOT_FOUND; ++adapterIndex) {
+ DXGI_ADAPTER_DESC1 desc;
+ adapter->GetDesc1(&desc);
+ const QString name = QString::fromUtf16(reinterpret_cast<char16_t *>(desc.Description));
+ qCDebug(QRHI_LOG_INFO, "Adapter %d: '%s' (vendor 0x%X device 0x%X flags 0x%X)",
+ adapterIndex,
+ qPrintable(name),
+ desc.VendorId,
+ desc.DeviceId,
+ desc.Flags);
+ if (!adapterToUse && (requestedAdapterIndex < 0 || requestedAdapterIndex == adapterIndex)) {
+ adapterToUse = adapter;
+ qCDebug(QRHI_LOG_INFO, " using this adapter");
+ } else {
+ adapter->Release();
+ }
+ }
+ if (!adapterToUse) {
+ qWarning("No adapter");
+ return false;
+ }
+
+ ID3D11DeviceContext *ctx = nullptr;
+ HRESULT hr = D3D11CreateDevice(adapterToUse, D3D_DRIVER_TYPE_UNKNOWN, nullptr, devFlags,
+ nullptr, 0, D3D11_SDK_VERSION,
+ &dev, &featureLevel, &ctx);
+ adapterToUse->Release();
+ if (FAILED(hr)) {
+ qWarning("Failed to create D3D11 device and context: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ if (SUCCEEDED(ctx->QueryInterface(IID_ID3D11DeviceContext1, reinterpret_cast<void **>(&context)))) {
+ ctx->Release();
+ } else {
+ qWarning("ID3D11DeviceContext1 not supported");
+ return false;
+ }
+ } else {
+ Q_ASSERT(dev && context);
+ featureLevel = dev->GetFeatureLevel();
+ }
+
+ if (FAILED(context->QueryInterface(IID_ID3DUserDefinedAnnotation, reinterpret_cast<void **>(&annotations))))
+ annotations = nullptr;
+
+ deviceLost = false;
+
+ nativeHandlesStruct.dev = dev;
+ nativeHandlesStruct.context = context;
+
+ if (deviceCurse.framesToActivate > 0)
+ deviceCurse.initResources();
+
+ return true;
+}
+
+void QRhiD3D11::clearShaderCache()
+{
+ for (Shader &s : m_shaderCache)
+ s.s->Release();
+
+ m_shaderCache.clear();
+}
+
+void QRhiD3D11::destroy()
+{
+ finishActiveReadbacks();
+
+ clearShaderCache();
+
+ deviceCurse.releaseResources();
+
+ if (annotations) {
+ annotations->Release();
+ annotations = nullptr;
+ }
+
+ if (!importedDevice) {
+ if (context) {
+ context->Release();
+ context = nullptr;
+ }
+ if (dev) {
+ dev->Release();
+ dev = nullptr;
+ }
+ }
+
+ if (dxgiFactory) {
+ dxgiFactory->Release();
+ dxgiFactory = nullptr;
+ }
+}
+
+void QRhiD3D11::reportLiveObjects(ID3D11Device *device)
+{
+ // this works only when params.enableDebugLayer was true
+ ID3D11Debug *debug;
+ if (SUCCEEDED(device->QueryInterface(IID_ID3D11Debug, reinterpret_cast<void **>(&debug)))) {
+ debug->ReportLiveDeviceObjects(D3D11_RLDO_DETAIL);
+ debug->Release();
+ }
+}
+
+QVector<int> QRhiD3D11::supportedSampleCounts() const
+{
+ return { 1, 2, 4, 8 };
+}
+
+DXGI_SAMPLE_DESC QRhiD3D11::effectiveSampleCount(int sampleCount) const
+{
+ DXGI_SAMPLE_DESC desc;
+ desc.Count = 1;
+ desc.Quality = 0;
+
+ // Stay compatible with QSurfaceFormat and friends where samples == 0 means the same as 1.
+ int s = qBound(1, sampleCount, 64);
+
+ if (!supportedSampleCounts().contains(s)) {
+ qWarning("Attempted to set unsupported sample count %d", sampleCount);
+ return desc;
+ }
+
+ desc.Count = UINT(s);
+ if (s > 1)
+ desc.Quality = UINT(D3D11_STANDARD_MULTISAMPLE_PATTERN);
+ else
+ desc.Quality = 0;
+
+ return desc;
+}
+
+QRhiSwapChain *QRhiD3D11::createSwapChain()
+{
+ return new QD3D11SwapChain(this);
+}
+
+QRhiBuffer *QRhiD3D11::createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
+{
+ return new QD3D11Buffer(this, type, usage, size);
+}
+
+int QRhiD3D11::ubufAlignment() const
+{
+ return 256;
+}
+
+bool QRhiD3D11::isYUpInFramebuffer() const
+{
+ return false;
+}
+
+bool QRhiD3D11::isYUpInNDC() const
+{
+ return true;
+}
+
+bool QRhiD3D11::isClipDepthZeroToOne() const
+{
+ return true;
+}
+
+QMatrix4x4 QRhiD3D11::clipSpaceCorrMatrix() const
+{
+ // Like with Vulkan, but Y is already good.
+
+ static QMatrix4x4 m;
+ if (m.isIdentity()) {
+ // NB the ctor takes row-major
+ m = QMatrix4x4(1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.5f, 0.5f,
+ 0.0f, 0.0f, 0.0f, 1.0f);
+ }
+ return m;
+}
+
+bool QRhiD3D11::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const
+{
+ Q_UNUSED(flags);
+
+ if (format >= QRhiTexture::ETC2_RGB8 && format <= QRhiTexture::ASTC_12x12)
+ return false;
+
+ return true;
+}
+
+bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const
+{
+ switch (feature) {
+ case QRhi::MultisampleTexture:
+ return true;
+ case QRhi::MultisampleRenderBuffer:
+ return true;
+ case QRhi::DebugMarkers:
+ return annotations != nullptr;
+ case QRhi::Timestamps:
+ return true;
+ case QRhi::Instancing:
+ return true;
+ case QRhi::CustomInstanceStepRate:
+ return true;
+ case QRhi::PrimitiveRestart:
+ return true;
+ case QRhi::NonDynamicUniformBuffers:
+ return false; // because UpdateSubresource cannot deal with this
+ case QRhi::NonFourAlignedEffectiveIndexBufferOffset:
+ return true;
+ case QRhi::NPOTTextureRepeat:
+ return true;
+ case QRhi::RedOrAlpha8IsRed:
+ return true;
+ case QRhi::ElementIndexUint:
+ return true;
+ case QRhi::Compute:
+ return true;
+ case QRhi::WideLines:
+ return false;
+ case QRhi::VertexShaderPointSize:
+ return false;
+ case QRhi::BaseVertex:
+ return true;
+ case QRhi::BaseInstance:
+ return true;
+ case QRhi::TriangleFanTopology:
+ return false;
+ case QRhi::ReadBackNonUniformBuffer:
+ return true;
+ case QRhi::ReadBackNonBaseMipLevel:
+ return true;
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+}
+
+int QRhiD3D11::resourceLimit(QRhi::ResourceLimit limit) const
+{
+ switch (limit) {
+ case QRhi::TextureSizeMin:
+ return 1;
+ case QRhi::TextureSizeMax:
+ return D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ case QRhi::MaxColorAttachments:
+ return 8;
+ case QRhi::FramesInFlight:
+ return 2; // dummy
+ default:
+ Q_UNREACHABLE();
+ return 0;
+ }
+}
+
+const QRhiNativeHandles *QRhiD3D11::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+void QRhiD3D11::sendVMemStatsToProfiler()
+{
+ // nothing to do here
+}
+
+bool QRhiD3D11::makeThreadLocalNativeContextCurrent()
+{
+ // not applicable
+ return false;
+}
+
+void QRhiD3D11::releaseCachedResources()
+{
+ clearShaderCache();
+}
+
+bool QRhiD3D11::isDeviceLost() const
+{
+ return deviceLost;
+}
+
+QRhiRenderBuffer *QRhiD3D11::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+{
+ return new QD3D11RenderBuffer(this, type, pixelSize, sampleCount, flags);
+}
+
+QRhiTexture *QRhiD3D11::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
+ int sampleCount, QRhiTexture::Flags flags)
+{
+ return new QD3D11Texture(this, format, pixelSize, sampleCount, flags);
+}
+
+QRhiSampler *QRhiD3D11::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler::AddressMode u, QRhiSampler::AddressMode v)
+{
+ return new QD3D11Sampler(this, magFilter, minFilter, mipmapMode, u, v);
+}
+
+QRhiTextureRenderTarget *QRhiD3D11::createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags)
+{
+ return new QD3D11TextureRenderTarget(this, desc, flags);
+}
+
+QRhiGraphicsPipeline *QRhiD3D11::createGraphicsPipeline()
+{
+ return new QD3D11GraphicsPipeline(this);
+}
+
+QRhiComputePipeline *QRhiD3D11::createComputePipeline()
+{
+ return new QD3D11ComputePipeline(this);
+}
+
+QRhiShaderResourceBindings *QRhiD3D11::createShaderResourceBindings()
+{
+ return new QD3D11ShaderResourceBindings(this);
+}
+
+void QRhiD3D11::setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+ QD3D11GraphicsPipeline *psD = QRHI_RES(QD3D11GraphicsPipeline, ps);
+ const bool pipelineChanged = cbD->currentGraphicsPipeline != ps || cbD->currentPipelineGeneration != psD->generation;
+
+ if (pipelineChanged) {
+ cbD->currentGraphicsPipeline = ps;
+ cbD->currentComputePipeline = nullptr;
+ cbD->currentPipelineGeneration = psD->generation;
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::BindGraphicsPipeline;
+ cmd.args.bindGraphicsPipeline.ps = psD;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiD3D11::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass != QD3D11CommandBuffer::NoPass);
+ QD3D11GraphicsPipeline *gfxPsD = QRHI_RES(QD3D11GraphicsPipeline, cbD->currentGraphicsPipeline);
+ QD3D11ComputePipeline *compPsD = QRHI_RES(QD3D11ComputePipeline, cbD->currentComputePipeline);
+
+ if (!srb) {
+ if (gfxPsD)
+ srb = gfxPsD->m_shaderResourceBindings;
+ else
+ srb = compPsD->m_shaderResourceBindings;
+ }
+
+ QD3D11ShaderResourceBindings *srbD = QRHI_RES(QD3D11ShaderResourceBindings, srb);
+
+ bool hasDynamicOffsetInSrb = false;
+ bool srbUpdate = false;
+ for (int i = 0, ie = srbD->sortedBindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->sortedBindings.at(i).data();
+ QD3D11ShaderResourceBindings::BoundResourceData &bd(srbD->boundResourceData[i]);
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, b->u.ubuf.buf);
+ if (bufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(bufD);
+
+ if (bufD->generation != bd.ubuf.generation || bufD->m_id != bd.ubuf.id) {
+ srbUpdate = true;
+ bd.ubuf.id = bufD->m_id;
+ bd.ubuf.generation = bufD->generation;
+ }
+
+ if (b->u.ubuf.hasDynamicOffset)
+ hasDynamicOffsetInSrb = true;
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, b->u.stex.tex);
+ QD3D11Sampler *samplerD = QRHI_RES(QD3D11Sampler, b->u.stex.sampler);
+ if (texD->generation != bd.stex.texGeneration
+ || texD->m_id != bd.stex.texId
+ || samplerD->generation != bd.stex.samplerGeneration
+ || samplerD->m_id != bd.stex.samplerId)
+ {
+ srbUpdate = true;
+ bd.stex.texId = texD->m_id;
+ bd.stex.texGeneration = texD->generation;
+ bd.stex.samplerId = samplerD->m_id;
+ bd.stex.samplerGeneration = samplerD->generation;
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, b->u.simage.tex);
+ if (texD->generation != bd.simage.generation || texD->m_id != bd.simage.id) {
+ srbUpdate = true;
+ bd.simage.id = texD->m_id;
+ bd.simage.generation = texD->generation;
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, b->u.sbuf.buf);
+ if (bufD->generation != bd.sbuf.generation || bufD->m_id != bd.sbuf.id) {
+ srbUpdate = true;
+ bd.sbuf.id = bufD->m_id;
+ bd.sbuf.generation = bufD->generation;
+ }
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ if (srbUpdate)
+ updateShaderResourceBindings(srbD);
+
+ const bool srbChanged = gfxPsD ? (cbD->currentGraphicsSrb != srb) : (cbD->currentComputeSrb != srb);
+ const bool srbRebuilt = cbD->currentSrbGeneration != srbD->generation;
+
+ if (srbChanged || srbRebuilt || srbUpdate || hasDynamicOffsetInSrb) {
+ if (gfxPsD) {
+ cbD->currentGraphicsSrb = srb;
+ cbD->currentComputeSrb = nullptr;
+ } else {
+ cbD->currentGraphicsSrb = nullptr;
+ cbD->currentComputeSrb = srb;
+ }
+ cbD->currentSrbGeneration = srbD->generation;
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::BindShaderResources;
+ cmd.args.bindShaderResources.srb = srbD;
+ // dynamic offsets have to be applied at the time of executing the bind
+ // operations, not here
+ cmd.args.bindShaderResources.offsetOnlyChange = !srbChanged && !srbRebuilt && !srbUpdate && hasDynamicOffsetInSrb;
+ cmd.args.bindShaderResources.dynamicOffsetCount = 0;
+ if (hasDynamicOffsetInSrb) {
+ if (dynamicOffsetCount < QD3D11CommandBuffer::Command::MAX_UBUF_BINDINGS) {
+ cmd.args.bindShaderResources.dynamicOffsetCount = dynamicOffsetCount;
+ uint *p = cmd.args.bindShaderResources.dynamicOffsetPairs;
+ for (int i = 0; i < dynamicOffsetCount; ++i) {
+ const QRhiCommandBuffer::DynamicOffset &dynOfs(dynamicOffsets[i]);
+ const uint binding = uint(dynOfs.first);
+ Q_ASSERT(aligned(dynOfs.second, quint32(256)) == dynOfs.second);
+ const uint offsetInConstants = dynOfs.second / 16;
+ *p++ = binding;
+ *p++ = offsetInConstants;
+ }
+ } else {
+ qWarning("Too many dynamic offsets (%d, max is %d)",
+ dynamicOffsetCount, QD3D11CommandBuffer::Command::MAX_UBUF_BINDINGS);
+ }
+ }
+
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiD3D11::setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+
+ bool needsBindVBuf = false;
+ for (int i = 0; i < bindingCount; ++i) {
+ const int inputSlot = startBinding + i;
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, bindings[i].first);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::VertexBuffer));
+ if (bufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(bufD);
+
+ if (cbD->currentVertexBuffers[inputSlot] != bufD->buffer
+ || cbD->currentVertexOffsets[inputSlot] != bindings[i].second)
+ {
+ needsBindVBuf = true;
+ cbD->currentVertexBuffers[inputSlot] = bufD->buffer;
+ cbD->currentVertexOffsets[inputSlot] = bindings[i].second;
+ }
+ }
+
+ if (needsBindVBuf) {
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::BindVertexBuffers;
+ cmd.args.bindVertexBuffers.startSlot = startBinding;
+ cmd.args.bindVertexBuffers.slotCount = bindingCount;
+ QD3D11GraphicsPipeline *psD = QRHI_RES(QD3D11GraphicsPipeline, cbD->currentGraphicsPipeline);
+ const QRhiVertexInputLayout &inputLayout(psD->m_vertexInputLayout);
+ const int inputBindingCount = inputLayout.cendBindings() - inputLayout.cbeginBindings();
+ for (int i = 0, ie = qMin(bindingCount, inputBindingCount); i != ie; ++i) {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, bindings[i].first);
+ cmd.args.bindVertexBuffers.buffers[i] = bufD->buffer;
+ cmd.args.bindVertexBuffers.offsets[i] = bindings[i].second;
+ cmd.args.bindVertexBuffers.strides[i] = inputLayout.bindingAt(i)->stride();
+ }
+ cbD->commands.append(cmd);
+ }
+
+ if (indexBuf) {
+ QD3D11Buffer *ibufD = QRHI_RES(QD3D11Buffer, indexBuf);
+ Q_ASSERT(ibufD->m_usage.testFlag(QRhiBuffer::IndexBuffer));
+ if (ibufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(ibufD);
+
+ const DXGI_FORMAT dxgiFormat = indexFormat == QRhiCommandBuffer::IndexUInt16 ? DXGI_FORMAT_R16_UINT
+ : DXGI_FORMAT_R32_UINT;
+ if (cbD->currentIndexBuffer != ibufD->buffer
+ || cbD->currentIndexOffset != indexOffset
+ || cbD->currentIndexFormat != dxgiFormat)
+ {
+ cbD->currentIndexBuffer = ibufD->buffer;
+ cbD->currentIndexOffset = indexOffset;
+ cbD->currentIndexFormat = dxgiFormat;
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::BindIndexBuffer;
+ cmd.args.bindIndexBuffer.buffer = ibufD->buffer;
+ cmd.args.bindIndexBuffer.offset = indexOffset;
+ cmd.args.bindIndexBuffer.format = dxgiFormat;
+ cbD->commands.append(cmd);
+ }
+ }
+}
+
+void QRhiD3D11::setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+ Q_ASSERT(cbD->currentTarget);
+ const QSize outputSize = cbD->currentTarget->pixelSize();
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::Viewport;
+
+ // d3d expects top-left, QRhiViewport is bottom-left
+ float x, y, w, h;
+ if (!qrhi_toTopLeftRenderTargetRect(outputSize, viewport.viewport(), &x, &y, &w, &h))
+ return;
+
+ cmd.args.viewport.x = x;
+ cmd.args.viewport.y = y;
+ cmd.args.viewport.w = w;
+ cmd.args.viewport.h = h;
+ cmd.args.viewport.d0 = viewport.minDepth();
+ cmd.args.viewport.d1 = viewport.maxDepth();
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+ Q_ASSERT(cbD->currentTarget);
+ const QSize outputSize = cbD->currentTarget->pixelSize();
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::Scissor;
+
+ // d3d expects top-left, QRhiScissor is bottom-left
+ int x, y, w, h;
+ if (!qrhi_toTopLeftRenderTargetRect(outputSize, scissor.scissor(), &x, &y, &w, &h))
+ return;
+
+ cmd.args.scissor.x = x;
+ cmd.args.scissor.y = y;
+ cmd.args.scissor.w = w;
+ cmd.args.scissor.h = h;
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::setBlendConstants(QRhiCommandBuffer *cb, const QColor &c)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::BlendConstants;
+ cmd.args.blendConstants.ps = QRHI_RES(QD3D11GraphicsPipeline, cbD->currentGraphicsPipeline);
+ cmd.args.blendConstants.c[0] = float(c.redF());
+ cmd.args.blendConstants.c[1] = float(c.greenF());
+ cmd.args.blendConstants.c[2] = float(c.blueF());
+ cmd.args.blendConstants.c[3] = float(c.alphaF());
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::setStencilRef(QRhiCommandBuffer *cb, quint32 refValue)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::StencilRef;
+ cmd.args.stencilRef.ps = QRHI_RES(QD3D11GraphicsPipeline, cbD->currentGraphicsPipeline);
+ cmd.args.stencilRef.ref = refValue;
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::Draw;
+ cmd.args.draw.ps = QRHI_RES(QD3D11GraphicsPipeline, cbD->currentGraphicsPipeline);
+ cmd.args.draw.vertexCount = vertexCount;
+ cmd.args.draw.instanceCount = instanceCount;
+ cmd.args.draw.firstVertex = firstVertex;
+ cmd.args.draw.firstInstance = firstInstance;
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::DrawIndexed;
+ cmd.args.drawIndexed.ps = QRHI_RES(QD3D11GraphicsPipeline, cbD->currentGraphicsPipeline);
+ cmd.args.drawIndexed.indexCount = indexCount;
+ cmd.args.drawIndexed.instanceCount = instanceCount;
+ cmd.args.drawIndexed.firstIndex = firstIndex;
+ cmd.args.drawIndexed.vertexOffset = vertexOffset;
+ cmd.args.drawIndexed.firstInstance = firstInstance;
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name)
+{
+ if (!debugMarkers || !annotations)
+ return;
+
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::DebugMarkBegin;
+ strncpy(cmd.args.debugMark.s, name.constData(), sizeof(cmd.args.debugMark.s));
+ cmd.args.debugMark.s[sizeof(cmd.args.debugMark.s) - 1] = '\0';
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::debugMarkEnd(QRhiCommandBuffer *cb)
+{
+ if (!debugMarkers || !annotations)
+ return;
+
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::DebugMarkEnd;
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg)
+{
+ if (!debugMarkers || !annotations)
+ return;
+
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::DebugMarkMsg;
+ strncpy(cmd.args.debugMark.s, msg.constData(), sizeof(cmd.args.debugMark.s));
+ cmd.args.debugMark.s[sizeof(cmd.args.debugMark.s) - 1] = '\0';
+ cbD->commands.append(cmd);
+}
+
+const QRhiNativeHandles *QRhiD3D11::nativeHandles(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+ return nullptr;
+}
+
+void QRhiD3D11::beginExternal(QRhiCommandBuffer *cb)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ // no timestampSwapChain, in order to avoid timestamp mess
+ executeCommandBuffer(cbD);
+ cbD->resetCommands();
+}
+
+void QRhiD3D11::endExternal(QRhiCommandBuffer *cb)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->commands.isEmpty());
+ cbD->resetCachedState();
+ if (cbD->currentTarget) { // could be compute, no rendertarget then
+ QD3D11CommandBuffer::Command fbCmd;
+ fbCmd.cmd = QD3D11CommandBuffer::Command::SetRenderTarget;
+ fbCmd.args.setRenderTarget.rt = cbD->currentTarget;
+ cbD->commands.append(fbCmd);
+ }
+}
+
+QRhi::FrameOpResult QRhiD3D11::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+
+ QD3D11SwapChain *swapChainD = QRHI_RES(QD3D11SwapChain, swapChain);
+ contextState.currentSwapChain = swapChainD;
+ const int currentFrameSlot = swapChainD->currentFrameSlot;
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ if (swapChainD->timestampActive[currentFrameSlot]) {
+ ID3D11Query *tsDisjoint = swapChainD->timestampDisjointQuery[currentFrameSlot];
+ const int tsIdx = QD3D11SwapChain::BUFFER_COUNT * currentFrameSlot;
+ ID3D11Query *tsStart = swapChainD->timestampQuery[tsIdx];
+ ID3D11Query *tsEnd = swapChainD->timestampQuery[tsIdx + 1];
+ quint64 timestamps[2];
+ D3D11_QUERY_DATA_TIMESTAMP_DISJOINT dj;
+ bool ok = true;
+ ok &= context->GetData(tsDisjoint, &dj, sizeof(dj), D3D11_ASYNC_GETDATA_DONOTFLUSH) == S_OK;
+ ok &= context->GetData(tsEnd, &timestamps[1], sizeof(quint64), D3D11_ASYNC_GETDATA_DONOTFLUSH) == S_OK;
+ // this above is often not ready, not even in frame_where_recorded+2,
+ // not clear why. so make the whole thing async and do not touch the
+ // queries until they are finally all available in frame this+2 or
+ // this+4 or ...
+ ok &= context->GetData(tsStart, &timestamps[0], sizeof(quint64), D3D11_ASYNC_GETDATA_DONOTFLUSH) == S_OK;
+ if (ok) {
+ if (!dj.Disjoint && dj.Frequency) {
+ const float elapsedMs = (timestamps[1] - timestamps[0]) / float(dj.Frequency) * 1000.0f;
+ // finally got a value, just report it, the profiler cares about min/max/avg anyway
+ QRHI_PROF_F(swapChainFrameGpuTime(swapChain, elapsedMs));
+ }
+ swapChainD->timestampActive[currentFrameSlot] = false;
+ } // else leave timestampActive set to true, will retry in a subsequent beginFrame
+ }
+
+ swapChainD->cb.resetState();
+
+ swapChainD->rt.d.rtv[0] = swapChainD->sampleDesc.Count > 1 ?
+ swapChainD->msaaRtv[currentFrameSlot] : swapChainD->backBufferRtv;
+ swapChainD->rt.d.dsv = swapChainD->ds ? swapChainD->ds->dsv : nullptr;
+
+ QRHI_PROF_F(beginSwapChainFrame(swapChain));
+
+ finishActiveReadbacks();
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiD3D11::endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags)
+{
+ QD3D11SwapChain *swapChainD = QRHI_RES(QD3D11SwapChain, swapChain);
+ Q_ASSERT(contextState.currentSwapChain = swapChainD);
+ const int currentFrameSlot = swapChainD->currentFrameSlot;
+
+ ID3D11Query *tsDisjoint = swapChainD->timestampDisjointQuery[currentFrameSlot];
+ const int tsIdx = QD3D11SwapChain::BUFFER_COUNT * currentFrameSlot;
+ ID3D11Query *tsStart = swapChainD->timestampQuery[tsIdx];
+ ID3D11Query *tsEnd = swapChainD->timestampQuery[tsIdx + 1];
+ const bool recordTimestamps = tsDisjoint && tsStart && tsEnd && !swapChainD->timestampActive[currentFrameSlot];
+
+ // send all commands to the context
+ if (recordTimestamps)
+ executeCommandBuffer(&swapChainD->cb, swapChainD);
+ else
+ executeCommandBuffer(&swapChainD->cb);
+
+ if (swapChainD->sampleDesc.Count > 1) {
+ context->ResolveSubresource(swapChainD->backBufferTex, 0,
+ swapChainD->msaaTex[currentFrameSlot], 0,
+ swapChainD->colorFormat);
+ }
+
+ // this is here because we want to include the time spent on the resolve as well
+ if (recordTimestamps) {
+ context->End(tsEnd);
+ context->End(tsDisjoint);
+ swapChainD->timestampActive[currentFrameSlot] = true;
+ }
+
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ // this must be done before the Present
+ QRHI_PROF_F(endSwapChainFrame(swapChain, swapChainD->frameCount + 1));
+
+ if (!flags.testFlag(QRhi::SkipPresent)) {
+ const UINT presentFlags = 0;
+ HRESULT hr = swapChainD->swapChain->Present(swapChainD->swapInterval, presentFlags);
+ if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET) {
+ qWarning("Device loss detected in Present()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ } else if (FAILED(hr)) {
+ qWarning("Failed to present: %s", qPrintable(comErrorMessage(hr)));
+ return QRhi::FrameOpError;
+ }
+
+ // move on to the next buffer
+ swapChainD->currentFrameSlot = (swapChainD->currentFrameSlot + 1) % QD3D11SwapChain::BUFFER_COUNT;
+ } else {
+ context->Flush();
+ }
+
+ swapChainD->frameCount += 1;
+ contextState.currentSwapChain = nullptr;
+
+ if (deviceCurse.framesToActivate > 0) {
+ deviceCurse.framesLeft -= 1;
+ if (deviceCurse.framesLeft == 0) {
+ deviceCurse.framesLeft = deviceCurse.framesToActivate;
+ if (!deviceCurse.permanent)
+ deviceCurse.framesToActivate = -1;
+
+ deviceCurse.activate();
+ } else if (deviceCurse.framesLeft % 100 == 0) {
+ qDebug("Impending doom: %d frames left", deviceCurse.framesLeft);
+ }
+ }
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiD3D11::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ ofr.active = true;
+
+ ofr.cbWrapper.resetState();
+ *cb = &ofr.cbWrapper;
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiD3D11::endOffscreenFrame(QRhi::EndFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ ofr.active = false;
+
+ executeCommandBuffer(&ofr.cbWrapper);
+
+ finishActiveReadbacks();
+
+ return QRhi::FrameOpSuccess;
+}
+
+static inline DXGI_FORMAT toD3DTextureFormat(QRhiTexture::Format format, QRhiTexture::Flags flags)
+{
+ const bool srgb = flags.testFlag(QRhiTexture::sRGB);
+ switch (format) {
+ case QRhiTexture::RGBA8:
+ return srgb ? DXGI_FORMAT_R8G8B8A8_UNORM_SRGB : DXGI_FORMAT_R8G8B8A8_UNORM;
+ case QRhiTexture::BGRA8:
+ return srgb ? DXGI_FORMAT_B8G8R8A8_UNORM_SRGB : DXGI_FORMAT_B8G8R8A8_UNORM;
+ case QRhiTexture::R8:
+ return DXGI_FORMAT_R8_UNORM;
+ case QRhiTexture::R16:
+ return DXGI_FORMAT_R16_UNORM;
+ case QRhiTexture::RED_OR_ALPHA8:
+ return DXGI_FORMAT_R8_UNORM;
+
+ case QRhiTexture::RGBA16F:
+ return DXGI_FORMAT_R16G16B16A16_FLOAT;
+ case QRhiTexture::RGBA32F:
+ return DXGI_FORMAT_R32G32B32A32_FLOAT;
+
+ case QRhiTexture::D16:
+ return DXGI_FORMAT_R16_TYPELESS;
+ case QRhiTexture::D32F:
+ return DXGI_FORMAT_R32_TYPELESS;
+
+ case QRhiTexture::BC1:
+ return srgb ? DXGI_FORMAT_BC1_UNORM_SRGB : DXGI_FORMAT_BC1_UNORM;
+ case QRhiTexture::BC2:
+ return srgb ? DXGI_FORMAT_BC2_UNORM_SRGB : DXGI_FORMAT_BC2_UNORM;
+ case QRhiTexture::BC3:
+ return srgb ? DXGI_FORMAT_BC3_UNORM_SRGB : DXGI_FORMAT_BC3_UNORM;
+ case QRhiTexture::BC4:
+ return DXGI_FORMAT_BC4_UNORM;
+ case QRhiTexture::BC5:
+ return DXGI_FORMAT_BC5_UNORM;
+ case QRhiTexture::BC6H:
+ return DXGI_FORMAT_BC6H_UF16;
+ case QRhiTexture::BC7:
+ return srgb ? DXGI_FORMAT_BC7_UNORM_SRGB : DXGI_FORMAT_BC7_UNORM;
+
+ case QRhiTexture::ETC2_RGB8:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ETC2_RGB8A1:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ETC2_RGBA8:
+ qWarning("QRhiD3D11 does not support ETC2 textures");
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+
+ case QRhiTexture::ASTC_4x4:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_5x4:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_5x5:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_6x5:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_6x6:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_8x5:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_8x6:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_8x8:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_10x5:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_10x6:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_10x8:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_10x10:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_12x10:
+ Q_FALLTHROUGH();
+ case QRhiTexture::ASTC_12x12:
+ qWarning("QRhiD3D11 does not support ASTC textures");
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+
+ default:
+ Q_UNREACHABLE();
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+ }
+}
+
+static inline QRhiTexture::Format colorTextureFormatFromDxgiFormat(DXGI_FORMAT format, QRhiTexture::Flags *flags)
+{
+ switch (format) {
+ case DXGI_FORMAT_R8G8B8A8_UNORM:
+ return QRhiTexture::RGBA8;
+ case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
+ if (flags)
+ (*flags) |= QRhiTexture::sRGB;
+ return QRhiTexture::RGBA8;
+ case DXGI_FORMAT_B8G8R8A8_UNORM:
+ return QRhiTexture::BGRA8;
+ case DXGI_FORMAT_B8G8R8A8_UNORM_SRGB:
+ if (flags)
+ (*flags) |= QRhiTexture::sRGB;
+ return QRhiTexture::BGRA8;
+ case DXGI_FORMAT_R8_UNORM:
+ return QRhiTexture::R8;
+ case DXGI_FORMAT_R16_UNORM:
+ return QRhiTexture::R16;
+ default: // this cannot assert, must warn and return unknown
+ qWarning("DXGI_FORMAT %d is not a recognized uncompressed color format", format);
+ break;
+ }
+ return QRhiTexture::UnknownFormat;
+}
+
+static inline bool isDepthTextureFormat(QRhiTexture::Format format)
+{
+ switch (format) {
+ case QRhiTexture::Format::D16:
+ Q_FALLTHROUGH();
+ case QRhiTexture::Format::D32F:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+QRhi::FrameOpResult QRhiD3D11::finish()
+{
+ if (inFrame) {
+ if (ofr.active) {
+ Q_ASSERT(!contextState.currentSwapChain);
+ Q_ASSERT(ofr.cbWrapper.recordingPass == QD3D11CommandBuffer::NoPass);
+ executeCommandBuffer(&ofr.cbWrapper);
+ ofr.cbWrapper.resetCommands();
+ } else {
+ Q_ASSERT(contextState.currentSwapChain);
+ Q_ASSERT(contextState.currentSwapChain->cb.recordingPass == QD3D11CommandBuffer::NoPass);
+ executeCommandBuffer(&contextState.currentSwapChain->cb); // no timestampSwapChain, in order to avoid timestamp mess
+ contextState.currentSwapChain->cb.resetCommands();
+ }
+ }
+
+ finishActiveReadbacks();
+
+ return QRhi::FrameOpSuccess;
+}
+
+void QRhiD3D11::enqueueSubresUpload(QD3D11Texture *texD, QD3D11CommandBuffer *cbD,
+ int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc)
+{
+ UINT subres = D3D11CalcSubresource(UINT(level), UINT(layer), texD->mipLevelCount);
+ const QPoint dp = subresDesc.destinationTopLeft();
+ D3D11_BOX box;
+ box.front = 0;
+ // back, right, bottom are exclusive
+ box.back = 1;
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::UpdateSubRes;
+ cmd.args.updateSubRes.dst = texD->tex;
+ cmd.args.updateSubRes.dstSubRes = subres;
+
+ bool cmdValid = true;
+ if (!subresDesc.image().isNull()) {
+ QImage img = subresDesc.image();
+ QSize size = img.size();
+ int bpl = img.bytesPerLine();
+ if (!subresDesc.sourceSize().isEmpty() || !subresDesc.sourceTopLeft().isNull()) {
+ const QPoint sp = subresDesc.sourceTopLeft();
+ if (!subresDesc.sourceSize().isEmpty())
+ size = subresDesc.sourceSize();
+ if (img.depth() == 32) {
+ const int offset = sp.y() * img.bytesPerLine() + sp.x() * 4;
+ cmd.args.updateSubRes.src = cbD->retainImage(img) + offset;
+ } else {
+ img = img.copy(sp.x(), sp.y(), size.width(), size.height());
+ bpl = img.bytesPerLine();
+ cmd.args.updateSubRes.src = cbD->retainImage(img);
+ }
+ } else {
+ cmd.args.updateSubRes.src = cbD->retainImage(img);
+ }
+ box.left = UINT(dp.x());
+ box.top = UINT(dp.y());
+ box.right = UINT(dp.x() + size.width());
+ box.bottom = UINT(dp.y() + size.height());
+ cmd.args.updateSubRes.hasDstBox = true;
+ cmd.args.updateSubRes.dstBox = box;
+ cmd.args.updateSubRes.srcRowPitch = UINT(bpl);
+ } else if (!subresDesc.data().isEmpty() && isCompressedFormat(texD->m_format)) {
+ const QSize size = subresDesc.sourceSize().isEmpty() ? q->sizeForMipLevel(level, texD->m_pixelSize)
+ : subresDesc.sourceSize();
+ quint32 bpl = 0;
+ QSize blockDim;
+ compressedFormatInfo(texD->m_format, size, &bpl, nullptr, &blockDim);
+ // Everything must be a multiple of the block width and
+ // height, so e.g. a mip level of size 2x2 will be 4x4 when it
+ // comes to the actual data.
+ box.left = UINT(aligned(dp.x(), blockDim.width()));
+ box.top = UINT(aligned(dp.y(), blockDim.height()));
+ box.right = UINT(aligned(dp.x() + size.width(), blockDim.width()));
+ box.bottom = UINT(aligned(dp.y() + size.height(), blockDim.height()));
+ cmd.args.updateSubRes.hasDstBox = true;
+ cmd.args.updateSubRes.dstBox = box;
+ cmd.args.updateSubRes.src = cbD->retainData(subresDesc.data());
+ cmd.args.updateSubRes.srcRowPitch = bpl;
+ } else if (!subresDesc.data().isEmpty()) {
+ const QSize size = subresDesc.sourceSize().isEmpty() ? q->sizeForMipLevel(level, texD->m_pixelSize)
+ : subresDesc.sourceSize();
+ quint32 bpl = 0;
+ textureFormatInfo(texD->m_format, size, &bpl, nullptr);
+ box.left = UINT(dp.x());
+ box.top = UINT(dp.y());
+ box.right = UINT(dp.x() + size.width());
+ box.bottom = UINT(dp.y() + size.height());
+ cmd.args.updateSubRes.hasDstBox = true;
+ cmd.args.updateSubRes.dstBox = box;
+ cmd.args.updateSubRes.src = cbD->retainData(subresDesc.data());
+ cmd.args.updateSubRes.srcRowPitch = bpl;
+ } else {
+ qWarning("Invalid texture upload for %p layer=%d mip=%d", texD, layer, level);
+ cmdValid = false;
+ }
+ if (cmdValid)
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates);
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : ud->bufferOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, u.buf);
+ Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
+ memcpy(bufD->dynBuf.data() + u.offset, u.data.constData(), size_t(u.data.size()));
+ bufD->hasPendingDynamicUpdates = true;
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, u.buf);
+ Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic);
+ Q_ASSERT(u.offset + u.data.size() <= bufD->m_size);
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::UpdateSubRes;
+ cmd.args.updateSubRes.dst = bufD->buffer;
+ cmd.args.updateSubRes.dstSubRes = 0;
+ cmd.args.updateSubRes.src = cbD->retainData(u.data);
+ cmd.args.updateSubRes.srcRowPitch = 0;
+ // Specify the region (even when offset is 0 and all data is provided)
+ // since the ID3D11Buffer's size is rounded up to be a multiple of 256
+ // while the data we have has the original size.
+ D3D11_BOX box;
+ box.left = UINT(u.offset);
+ box.top = box.front = 0;
+ box.back = box.bottom = 1;
+ box.right = UINT(u.offset + u.data.size()); // no -1: right, bottom, back are exclusive, see D3D11_BOX doc
+ cmd.args.updateSubRes.hasDstBox = true;
+ cmd.args.updateSubRes.dstBox = box;
+ cbD->commands.append(cmd);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::Read) {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, u.buf);
+ if (bufD->m_type == QRhiBuffer::Dynamic) {
+ u.result->data.resize(u.readSize);
+ memcpy(u.result->data.data(), bufD->dynBuf.constData() + u.offset, size_t(u.readSize));
+ } else {
+ BufferReadback readback;
+ readback.result = u.result;
+ readback.byteSize = u.readSize;
+
+ D3D11_BUFFER_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.ByteWidth = readback.byteSize;
+ desc.Usage = D3D11_USAGE_STAGING;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
+ HRESULT hr = dev->CreateBuffer(&desc, nullptr, &readback.stagingBuf);
+ if (FAILED(hr)) {
+ qWarning("Failed to create buffer: %s", qPrintable(comErrorMessage(hr)));
+ continue;
+ }
+ QRHI_PROF_F(newReadbackBuffer(qint64(qintptr(readback.stagingBuf)), bufD, readback.byteSize));
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::CopySubRes;
+ cmd.args.copySubRes.dst = readback.stagingBuf;
+ cmd.args.copySubRes.dstSubRes = 0;
+ cmd.args.copySubRes.dstX = 0;
+ cmd.args.copySubRes.dstY = 0;
+ cmd.args.copySubRes.src = bufD->buffer;
+ cmd.args.copySubRes.srcSubRes = 0;
+ cmd.args.copySubRes.hasSrcBox = true;
+ D3D11_BOX box;
+ box.left = UINT(u.offset);
+ box.top = box.front = 0;
+ box.back = box.bottom = 1;
+ box.right = UINT(u.offset + u.readSize);
+ cmd.args.copySubRes.srcBox = box;
+ cbD->commands.append(cmd);
+
+ activeBufferReadbacks.append(readback);
+ }
+ if (u.result->completed)
+ u.result->completed();
+ }
+ }
+
+ for (const QRhiResourceUpdateBatchPrivate::TextureOp &u : ud->textureOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Upload) {
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, u.dst);
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ enqueueSubresUpload(texD, cbD, layer, level, subresDesc);
+ }
+ }
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Copy) {
+ Q_ASSERT(u.src && u.dst);
+ QD3D11Texture *srcD = QRHI_RES(QD3D11Texture, u.src);
+ QD3D11Texture *dstD = QRHI_RES(QD3D11Texture, u.dst);
+ UINT srcSubRes = D3D11CalcSubresource(UINT(u.desc.sourceLevel()), UINT(u.desc.sourceLayer()), srcD->mipLevelCount);
+ UINT dstSubRes = D3D11CalcSubresource(UINT(u.desc.destinationLevel()), UINT(u.desc.destinationLayer()), dstD->mipLevelCount);
+ const QPoint dp = u.desc.destinationTopLeft();
+ const QSize mipSize = q->sizeForMipLevel(u.desc.sourceLevel(), srcD->m_pixelSize);
+ const QSize copySize = u.desc.pixelSize().isEmpty() ? mipSize : u.desc.pixelSize();
+ const QPoint sp = u.desc.sourceTopLeft();
+ D3D11_BOX srcBox;
+ srcBox.left = UINT(sp.x());
+ srcBox.top = UINT(sp.y());
+ srcBox.front = 0;
+ // back, right, bottom are exclusive
+ srcBox.right = srcBox.left + UINT(copySize.width());
+ srcBox.bottom = srcBox.top + UINT(copySize.height());
+ srcBox.back = 1;
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::CopySubRes;
+ cmd.args.copySubRes.dst = dstD->tex;
+ cmd.args.copySubRes.dstSubRes = dstSubRes;
+ cmd.args.copySubRes.dstX = UINT(dp.x());
+ cmd.args.copySubRes.dstY = UINT(dp.y());
+ cmd.args.copySubRes.src = srcD->tex;
+ cmd.args.copySubRes.srcSubRes = srcSubRes;
+ cmd.args.copySubRes.hasSrcBox = true;
+ cmd.args.copySubRes.srcBox = srcBox;
+ cbD->commands.append(cmd);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Read) {
+ TextureReadback readback;
+ readback.desc = u.rb;
+ readback.result = u.result;
+
+ ID3D11Resource *src;
+ DXGI_FORMAT dxgiFormat;
+ QSize pixelSize;
+ QRhiTexture::Format format;
+ UINT subres = 0;
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, u.rb.texture());
+ QD3D11SwapChain *swapChainD = nullptr;
+
+ if (texD) {
+ if (texD->sampleDesc.Count > 1) {
+ qWarning("Multisample texture cannot be read back");
+ continue;
+ }
+ src = texD->tex;
+ dxgiFormat = texD->dxgiFormat;
+ pixelSize = q->sizeForMipLevel(u.rb.level(), texD->m_pixelSize);
+ format = texD->m_format;
+ subres = D3D11CalcSubresource(UINT(u.rb.level()), UINT(u.rb.layer()), texD->mipLevelCount);
+ } else {
+ Q_ASSERT(contextState.currentSwapChain);
+ swapChainD = QRHI_RES(QD3D11SwapChain, contextState.currentSwapChain);
+ if (swapChainD->sampleDesc.Count > 1) {
+ // Unlike with textures, reading back a multisample swapchain image
+ // has to be supported. Insert a resolve.
+ QD3D11CommandBuffer::Command rcmd;
+ rcmd.cmd = QD3D11CommandBuffer::Command::ResolveSubRes;
+ rcmd.args.resolveSubRes.dst = swapChainD->backBufferTex;
+ rcmd.args.resolveSubRes.dstSubRes = 0;
+ rcmd.args.resolveSubRes.src = swapChainD->msaaTex[swapChainD->currentFrameSlot];
+ rcmd.args.resolveSubRes.srcSubRes = 0;
+ rcmd.args.resolveSubRes.format = swapChainD->colorFormat;
+ cbD->commands.append(rcmd);
+ }
+ src = swapChainD->backBufferTex;
+ dxgiFormat = swapChainD->colorFormat;
+ pixelSize = swapChainD->pixelSize;
+ format = colorTextureFormatFromDxgiFormat(dxgiFormat, nullptr);
+ if (format == QRhiTexture::UnknownFormat)
+ continue;
+ }
+ quint32 byteSize = 0;
+ quint32 bpl = 0;
+ textureFormatInfo(format, pixelSize, &bpl, &byteSize);
+
+ D3D11_TEXTURE2D_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Width = UINT(pixelSize.width());
+ desc.Height = UINT(pixelSize.height());
+ desc.MipLevels = 1;
+ desc.ArraySize = 1;
+ desc.Format = dxgiFormat;
+ desc.SampleDesc.Count = 1;
+ desc.Usage = D3D11_USAGE_STAGING;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
+ ID3D11Texture2D *stagingTex;
+ HRESULT hr = dev->CreateTexture2D(&desc, nullptr, &stagingTex);
+ if (FAILED(hr)) {
+ qWarning("Failed to create readback staging texture: %s", qPrintable(comErrorMessage(hr)));
+ return;
+ }
+ QRHI_PROF_F(newReadbackBuffer(qint64(qintptr(stagingTex)),
+ texD ? static_cast<QRhiResource *>(texD) : static_cast<QRhiResource *>(swapChainD),
+ byteSize));
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::CopySubRes;
+ cmd.args.copySubRes.dst = stagingTex;
+ cmd.args.copySubRes.dstSubRes = 0;
+ cmd.args.copySubRes.dstX = 0;
+ cmd.args.copySubRes.dstY = 0;
+ cmd.args.copySubRes.src = src;
+ cmd.args.copySubRes.srcSubRes = subres;
+ cmd.args.copySubRes.hasSrcBox = false;
+ cbD->commands.append(cmd);
+
+ readback.stagingTex = stagingTex;
+ readback.byteSize = byteSize;
+ readback.bpl = bpl;
+ readback.pixelSize = pixelSize;
+ readback.format = format;
+
+ activeTextureReadbacks.append(readback);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::GenMips) {
+ Q_ASSERT(u.dst->flags().testFlag(QRhiTexture::UsedWithGenerateMips));
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::GenMip;
+ cmd.args.genMip.srv = QRHI_RES(QD3D11Texture, u.dst)->srv;
+ cbD->commands.append(cmd);
+ }
+ }
+
+ ud->free();
+}
+
+void QRhiD3D11::finishActiveReadbacks()
+{
+ QVarLengthArray<std::function<void()>, 4> completedCallbacks;
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ for (int i = activeTextureReadbacks.count() - 1; i >= 0; --i) {
+ const QRhiD3D11::TextureReadback &readback(activeTextureReadbacks[i]);
+ readback.result->format = readback.format;
+ readback.result->pixelSize = readback.pixelSize;
+
+ D3D11_MAPPED_SUBRESOURCE mp;
+ HRESULT hr = context->Map(readback.stagingTex, 0, D3D11_MAP_READ, 0, &mp);
+ if (SUCCEEDED(hr)) {
+ readback.result->data.resize(int(readback.byteSize));
+ // nothing says the rows are tightly packed in the texture, must take
+ // the stride into account
+ char *dst = readback.result->data.data();
+ char *src = static_cast<char *>(mp.pData);
+ for (int y = 0, h = readback.pixelSize.height(); y != h; ++y) {
+ memcpy(dst, src, readback.bpl);
+ dst += readback.bpl;
+ src += mp.RowPitch;
+ }
+ context->Unmap(readback.stagingTex, 0);
+ } else {
+ qWarning("Failed to map readback staging texture: %s", qPrintable(comErrorMessage(hr)));
+ }
+
+ readback.stagingTex->Release();
+ QRHI_PROF_F(releaseReadbackBuffer(qint64(qintptr(readback.stagingTex))));
+
+ if (readback.result->completed)
+ completedCallbacks.append(readback.result->completed);
+
+ activeTextureReadbacks.removeAt(i);
+ }
+
+ for (int i = activeBufferReadbacks.count() - 1; i >= 0; --i) {
+ const QRhiD3D11::BufferReadback &readback(activeBufferReadbacks[i]);
+
+ D3D11_MAPPED_SUBRESOURCE mp;
+ HRESULT hr = context->Map(readback.stagingBuf, 0, D3D11_MAP_READ, 0, &mp);
+ if (SUCCEEDED(hr)) {
+ readback.result->data.resize(int(readback.byteSize));
+ memcpy(readback.result->data.data(), mp.pData, readback.byteSize);
+ context->Unmap(readback.stagingBuf, 0);
+ } else {
+ qWarning("Failed to map readback staging texture: %s", qPrintable(comErrorMessage(hr)));
+ }
+
+ readback.stagingBuf->Release();
+ QRHI_PROF_F(releaseReadbackBuffer(qint64(qintptr(readback.stagingBuf))));
+
+ if (readback.result->completed)
+ completedCallbacks.append(readback.result->completed);
+
+ activeBufferReadbacks.removeAt(i);
+ }
+
+ for (auto f : completedCallbacks)
+ f();
+}
+
+static inline QD3D11RenderTargetData *rtData(QRhiRenderTarget *rt)
+{
+ switch (rt->resourceType()) {
+ case QRhiResource::RenderTarget:
+ return &QRHI_RES(QD3D11ReferenceRenderTarget, rt)->d;
+ case QRhiResource::TextureRenderTarget:
+ return &QRHI_RES(QD3D11TextureRenderTarget, rt)->d;
+ default:
+ Q_UNREACHABLE();
+ return nullptr;
+ }
+}
+
+void QRhiD3D11::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ Q_ASSERT(QRHI_RES(QD3D11CommandBuffer, cb)->recordingPass == QD3D11CommandBuffer::NoPass);
+
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiD3D11::beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+
+ bool wantsColorClear = true;
+ bool wantsDsClear = true;
+ QD3D11RenderTargetData *rtD = rtData(rt);
+ if (rt->resourceType() == QRhiRenderTarget::TextureRenderTarget) {
+ QD3D11TextureRenderTarget *rtTex = QRHI_RES(QD3D11TextureRenderTarget, rt);
+ wantsColorClear = !rtTex->m_flags.testFlag(QRhiTextureRenderTarget::PreserveColorContents);
+ wantsDsClear = !rtTex->m_flags.testFlag(QRhiTextureRenderTarget::PreserveDepthStencilContents);
+ }
+
+ QD3D11CommandBuffer::Command fbCmd;
+ fbCmd.cmd = QD3D11CommandBuffer::Command::ResetShaderResources;
+ cbD->commands.append(fbCmd);
+ fbCmd.cmd = QD3D11CommandBuffer::Command::SetRenderTarget;
+ fbCmd.args.setRenderTarget.rt = rt;
+ cbD->commands.append(fbCmd);
+
+ QD3D11CommandBuffer::Command clearCmd;
+ clearCmd.cmd = QD3D11CommandBuffer::Command::Clear;
+ clearCmd.args.clear.rt = rt;
+ clearCmd.args.clear.mask = 0;
+ if (rtD->colorAttCount && wantsColorClear)
+ clearCmd.args.clear.mask |= QD3D11CommandBuffer::Command::Color;
+ if (rtD->dsAttCount && wantsDsClear)
+ clearCmd.args.clear.mask |= QD3D11CommandBuffer::Command::Depth | QD3D11CommandBuffer::Command::Stencil;
+
+ clearCmd.args.clear.c[0] = float(colorClearValue.redF());
+ clearCmd.args.clear.c[1] = float(colorClearValue.greenF());
+ clearCmd.args.clear.c[2] = float(colorClearValue.blueF());
+ clearCmd.args.clear.c[3] = float(colorClearValue.alphaF());
+ clearCmd.args.clear.d = depthStencilClearValue.depthClearValue();
+ clearCmd.args.clear.s = depthStencilClearValue.stencilClearValue();
+ cbD->commands.append(clearCmd);
+
+ cbD->recordingPass = QD3D11CommandBuffer::RenderPass;
+ cbD->currentTarget = rt;
+
+ cbD->resetCachedShaderResourceState();
+}
+
+void QRhiD3D11::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::RenderPass);
+
+ if (cbD->currentTarget->resourceType() == QRhiResource::TextureRenderTarget) {
+ QD3D11TextureRenderTarget *rtTex = QRHI_RES(QD3D11TextureRenderTarget, cbD->currentTarget);
+ for (auto it = rtTex->m_desc.cbeginColorAttachments(), itEnd = rtTex->m_desc.cendColorAttachments();
+ it != itEnd; ++it)
+ {
+ const QRhiColorAttachment &colorAtt(*it);
+ if (!colorAtt.resolveTexture())
+ continue;
+
+ QD3D11Texture *dstTexD = QRHI_RES(QD3D11Texture, colorAtt.resolveTexture());
+ QD3D11Texture *srcTexD = QRHI_RES(QD3D11Texture, colorAtt.texture());
+ QD3D11RenderBuffer *srcRbD = QRHI_RES(QD3D11RenderBuffer, colorAtt.renderBuffer());
+ Q_ASSERT(srcTexD || srcRbD);
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::ResolveSubRes;
+ cmd.args.resolveSubRes.dst = dstTexD->tex;
+ cmd.args.resolveSubRes.dstSubRes = D3D11CalcSubresource(UINT(colorAtt.resolveLevel()),
+ UINT(colorAtt.resolveLayer()),
+ dstTexD->mipLevelCount);
+ if (srcTexD) {
+ cmd.args.resolveSubRes.src = srcTexD->tex;
+ if (srcTexD->dxgiFormat != dstTexD->dxgiFormat) {
+ qWarning("Resolve source and destination formats do not match");
+ continue;
+ }
+ if (srcTexD->sampleDesc.Count <= 1) {
+ qWarning("Cannot resolve a non-multisample texture");
+ continue;
+ }
+ if (srcTexD->m_pixelSize != dstTexD->m_pixelSize) {
+ qWarning("Resolve source and destination sizes do not match");
+ continue;
+ }
+ } else {
+ cmd.args.resolveSubRes.src = srcRbD->tex;
+ if (srcRbD->dxgiFormat != dstTexD->dxgiFormat) {
+ qWarning("Resolve source and destination formats do not match");
+ continue;
+ }
+ if (srcRbD->m_pixelSize != dstTexD->m_pixelSize) {
+ qWarning("Resolve source and destination sizes do not match");
+ continue;
+ }
+ }
+ cmd.args.resolveSubRes.srcSubRes = D3D11CalcSubresource(0, UINT(colorAtt.layer()), 1);
+ cmd.args.resolveSubRes.format = dstTexD->dxgiFormat;
+ cbD->commands.append(cmd);
+ }
+ }
+
+ cbD->recordingPass = QD3D11CommandBuffer::NoPass;
+ cbD->currentTarget = nullptr;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiD3D11::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::ResetShaderResources;
+ cbD->commands.append(cmd);
+
+ cbD->recordingPass = QD3D11CommandBuffer::ComputePass;
+
+ cbD->resetCachedShaderResourceState();
+}
+
+void QRhiD3D11::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::ComputePass);
+
+ cbD->recordingPass = QD3D11CommandBuffer::NoPass;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiD3D11::setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::ComputePass);
+ QD3D11ComputePipeline *psD = QRHI_RES(QD3D11ComputePipeline, ps);
+ const bool pipelineChanged = cbD->currentComputePipeline != ps || cbD->currentPipelineGeneration != psD->generation;
+
+ if (pipelineChanged) {
+ cbD->currentGraphicsPipeline = nullptr;
+ cbD->currentComputePipeline = psD;
+ cbD->currentPipelineGeneration = psD->generation;
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::BindComputePipeline;
+ cmd.args.bindComputePipeline.ps = psD;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiD3D11::dispatch(QRhiCommandBuffer *cb, int x, int y, int z)
+{
+ QD3D11CommandBuffer *cbD = QRHI_RES(QD3D11CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QD3D11CommandBuffer::ComputePass);
+
+ QD3D11CommandBuffer::Command cmd;
+ cmd.cmd = QD3D11CommandBuffer::Command::Dispatch;
+ cmd.args.dispatch.x = UINT(x);
+ cmd.args.dispatch.y = UINT(y);
+ cmd.args.dispatch.z = UINT(z);
+ cbD->commands.append(cmd);
+}
+
+void QRhiD3D11::updateShaderResourceBindings(QD3D11ShaderResourceBindings *srbD)
+{
+ srbD->vsubufs.clear();
+ srbD->vsubufoffsets.clear();
+ srbD->vsubufsizes.clear();
+
+ srbD->fsubufs.clear();
+ srbD->fsubufoffsets.clear();
+ srbD->fsubufsizes.clear();
+
+ srbD->csubufs.clear();
+ srbD->csubufoffsets.clear();
+ srbD->csubufsizes.clear();
+
+ srbD->vssamplers.clear();
+ srbD->vsshaderresources.clear();
+
+ srbD->fssamplers.clear();
+ srbD->fsshaderresources.clear();
+
+ srbD->cssamplers.clear();
+ srbD->csshaderresources.clear();
+
+ srbD->csUAVs.clear();
+
+ for (int i = 0, ie = srbD->sortedBindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->sortedBindings.at(i).data();
+ QD3D11ShaderResourceBindings::BoundResourceData &bd(srbD->boundResourceData[i]);
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, b->u.ubuf.buf);
+ Q_ASSERT(aligned(b->u.ubuf.offset, 256) == b->u.ubuf.offset);
+ bd.ubuf.id = bufD->m_id;
+ bd.ubuf.generation = bufD->generation;
+ // dynamic ubuf offsets are not considered here, those are baked in
+ // at a later stage, which is good as vsubufoffsets and friends are
+ // per-srb, not per-setShaderResources call
+ const uint offsetInConstants = uint(b->u.ubuf.offset) / 16;
+ // size must be 16 mult. (in constants, i.e. multiple of 256 bytes).
+ // We can round up if needed since the buffers's actual size
+ // (ByteWidth) is always a multiple of 256.
+ const uint sizeInConstants = uint(aligned(b->u.ubuf.maybeSize ? b->u.ubuf.maybeSize : bufD->m_size, 256) / 16);
+ if (b->stage.testFlag(QRhiShaderResourceBinding::VertexStage)) {
+ srbD->vsubufs.feed(b->binding, bufD->buffer);
+ srbD->vsubufoffsets.feed(b->binding, offsetInConstants);
+ srbD->vsubufsizes.feed(b->binding, sizeInConstants);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::FragmentStage)) {
+ srbD->fsubufs.feed(b->binding, bufD->buffer);
+ srbD->fsubufoffsets.feed(b->binding, offsetInConstants);
+ srbD->fsubufsizes.feed(b->binding, sizeInConstants);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ srbD->csubufs.feed(b->binding, bufD->buffer);
+ srbD->csubufoffsets.feed(b->binding, offsetInConstants);
+ srbD->csubufsizes.feed(b->binding, sizeInConstants);
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ // A sampler with binding N is mapped to a HLSL sampler and texture
+ // with registers sN and tN by SPIRV-Cross.
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, b->u.stex.tex);
+ QD3D11Sampler *samplerD = QRHI_RES(QD3D11Sampler, b->u.stex.sampler);
+ bd.stex.texId = texD->m_id;
+ bd.stex.texGeneration = texD->generation;
+ bd.stex.samplerId = samplerD->m_id;
+ bd.stex.samplerGeneration = samplerD->generation;
+ if (b->stage.testFlag(QRhiShaderResourceBinding::VertexStage)) {
+ srbD->vssamplers.feed(b->binding, samplerD->samplerState);
+ srbD->vsshaderresources.feed(b->binding, texD->srv);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::FragmentStage)) {
+ srbD->fssamplers.feed(b->binding, samplerD->samplerState);
+ srbD->fsshaderresources.feed(b->binding, texD->srv);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ srbD->cssamplers.feed(b->binding, samplerD->samplerState);
+ srbD->csshaderresources.feed(b->binding, texD->srv);
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, b->u.simage.tex);
+ bd.simage.id = texD->m_id;
+ bd.simage.generation = texD->generation;
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ ID3D11UnorderedAccessView *uav = texD->unorderedAccessViewForLevel(b->u.simage.level);
+ if (uav)
+ srbD->csUAVs.feed(b->binding, uav);
+ } else {
+ qWarning("Unordered access only supported at compute stage");
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QD3D11Buffer *bufD = QRHI_RES(QD3D11Buffer, b->u.sbuf.buf);
+ bd.sbuf.id = bufD->m_id;
+ bd.sbuf.generation = bufD->generation;
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ ID3D11UnorderedAccessView *uav = bufD->unorderedAccessView();
+ if (uav)
+ srbD->csUAVs.feed(b->binding, uav);
+ } else {
+ qWarning("Unordered access only supported at compute stage");
+ }
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ srbD->vsubufs.finish();
+ srbD->vsubufoffsets.finish();
+ srbD->vsubufsizes.finish();
+
+ srbD->fsubufs.finish();
+ srbD->fsubufoffsets.finish();
+ srbD->fsubufsizes.finish();
+
+ srbD->csubufs.finish();
+ srbD->csubufoffsets.finish();
+ srbD->csubufsizes.finish();
+
+ srbD->vssamplers.finish();
+ srbD->vsshaderresources.finish();
+
+ srbD->fssamplers.finish();
+ srbD->fsshaderresources.finish();
+
+ srbD->cssamplers.finish();
+ srbD->csshaderresources.finish();
+
+ srbD->csUAVs.finish();
+}
+
+void QRhiD3D11::executeBufferHostWritesForCurrentFrame(QD3D11Buffer *bufD)
+{
+ if (!bufD->hasPendingDynamicUpdates)
+ return;
+
+ Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
+ bufD->hasPendingDynamicUpdates = false;
+ D3D11_MAPPED_SUBRESOURCE mp;
+ HRESULT hr = context->Map(bufD->buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mp);
+ if (SUCCEEDED(hr)) {
+ memcpy(mp.pData, bufD->dynBuf.constData(), size_t(bufD->dynBuf.size()));
+ context->Unmap(bufD->buffer, 0);
+ } else {
+ qWarning("Failed to map buffer: %s", qPrintable(comErrorMessage(hr)));
+ }
+}
+
+static void applyDynamicOffsets(QVarLengthArray<UINT, 4> *offsets,
+ int batchIndex,
+ QRhiBatchedBindings<ID3D11Buffer *> *ubufs,
+ QRhiBatchedBindings<UINT> *ubufoffsets,
+ const uint *dynOfsPairs, int dynOfsPairCount)
+{
+ const int count = ubufs->batches[batchIndex].resources.count();
+ const UINT startBinding = ubufs->batches[batchIndex].startBinding;
+ *offsets = ubufoffsets->batches[batchIndex].resources;
+ for (int b = 0; b < count; ++b) {
+ for (int di = 0; di < dynOfsPairCount; ++di) {
+ const uint binding = dynOfsPairs[2 * di];
+ if (binding == startBinding + UINT(b)) {
+ const uint offsetInConstants = dynOfsPairs[2 * di + 1];
+ (*offsets)[b] = offsetInConstants;
+ break;
+ }
+ }
+ }
+}
+
+void QRhiD3D11::bindShaderResources(QD3D11ShaderResourceBindings *srbD,
+ const uint *dynOfsPairs, int dynOfsPairCount,
+ bool offsetOnlyChange)
+{
+ if (!offsetOnlyChange) {
+ for (const auto &batch : srbD->vssamplers.batches)
+ context->VSSetSamplers(batch.startBinding, UINT(batch.resources.count()), batch.resources.constData());
+
+ for (const auto &batch : srbD->vsshaderresources.batches) {
+ context->VSSetShaderResources(batch.startBinding, UINT(batch.resources.count()), batch.resources.constData());
+ contextState.vsHighestActiveSrvBinding = qMax<int>(contextState.vsHighestActiveSrvBinding,
+ int(batch.startBinding) + batch.resources.count() - 1);
+ }
+
+ for (const auto &batch : srbD->fssamplers.batches)
+ context->PSSetSamplers(batch.startBinding, UINT(batch.resources.count()), batch.resources.constData());
+
+ for (const auto &batch : srbD->fsshaderresources.batches) {
+ context->PSSetShaderResources(batch.startBinding, UINT(batch.resources.count()), batch.resources.constData());
+ contextState.fsHighestActiveSrvBinding = qMax<int>(contextState.fsHighestActiveSrvBinding,
+ int(batch.startBinding) + batch.resources.count() - 1);
+ }
+
+ for (const auto &batch : srbD->cssamplers.batches)
+ context->CSSetSamplers(batch.startBinding, UINT(batch.resources.count()), batch.resources.constData());
+
+ for (const auto &batch : srbD->csshaderresources.batches) {
+ context->CSSetShaderResources(batch.startBinding, UINT(batch.resources.count()), batch.resources.constData());
+ contextState.csHighestActiveSrvBinding = qMax<int>(contextState.csHighestActiveSrvBinding,
+ int(batch.startBinding) + batch.resources.count() - 1);
+ }
+ }
+
+ for (int i = 0, ie = srbD->vsubufs.batches.count(); i != ie; ++i) {
+ if (!dynOfsPairCount) {
+ context->VSSetConstantBuffers1(srbD->vsubufs.batches[i].startBinding,
+ UINT(srbD->vsubufs.batches[i].resources.count()),
+ srbD->vsubufs.batches[i].resources.constData(),
+ srbD->vsubufoffsets.batches[i].resources.constData(),
+ srbD->vsubufsizes.batches[i].resources.constData());
+ } else {
+ QVarLengthArray<UINT, 4> offsets;
+ applyDynamicOffsets(&offsets, i, &srbD->vsubufs, &srbD->vsubufoffsets, dynOfsPairs, dynOfsPairCount);
+ context->VSSetConstantBuffers1(srbD->vsubufs.batches[i].startBinding,
+ UINT(srbD->vsubufs.batches[i].resources.count()),
+ srbD->vsubufs.batches[i].resources.constData(),
+ offsets.constData(),
+ srbD->vsubufsizes.batches[i].resources.constData());
+ }
+ }
+
+ for (int i = 0, ie = srbD->fsubufs.batches.count(); i != ie; ++i) {
+ if (!dynOfsPairCount) {
+ context->PSSetConstantBuffers1(srbD->fsubufs.batches[i].startBinding,
+ UINT(srbD->fsubufs.batches[i].resources.count()),
+ srbD->fsubufs.batches[i].resources.constData(),
+ srbD->fsubufoffsets.batches[i].resources.constData(),
+ srbD->fsubufsizes.batches[i].resources.constData());
+ } else {
+ QVarLengthArray<UINT, 4> offsets;
+ applyDynamicOffsets(&offsets, i, &srbD->fsubufs, &srbD->fsubufoffsets, dynOfsPairs, dynOfsPairCount);
+ context->PSSetConstantBuffers1(srbD->fsubufs.batches[i].startBinding,
+ UINT(srbD->fsubufs.batches[i].resources.count()),
+ srbD->fsubufs.batches[i].resources.constData(),
+ offsets.constData(),
+ srbD->fsubufsizes.batches[i].resources.constData());
+ }
+ }
+
+ for (int i = 0, ie = srbD->csubufs.batches.count(); i != ie; ++i) {
+ if (!dynOfsPairCount) {
+ context->CSSetConstantBuffers1(srbD->csubufs.batches[i].startBinding,
+ UINT(srbD->csubufs.batches[i].resources.count()),
+ srbD->csubufs.batches[i].resources.constData(),
+ srbD->csubufoffsets.batches[i].resources.constData(),
+ srbD->csubufsizes.batches[i].resources.constData());
+ } else {
+ QVarLengthArray<UINT, 4> offsets;
+ applyDynamicOffsets(&offsets, i, &srbD->csubufs, &srbD->csubufoffsets, dynOfsPairs, dynOfsPairCount);
+ context->CSSetConstantBuffers1(srbD->csubufs.batches[i].startBinding,
+ UINT(srbD->csubufs.batches[i].resources.count()),
+ srbD->csubufs.batches[i].resources.constData(),
+ offsets.constData(),
+ srbD->csubufsizes.batches[i].resources.constData());
+ }
+ }
+
+ for (int i = 0, ie = srbD->csUAVs.batches.count(); i != ie; ++i) {
+ const uint startBinding = srbD->csUAVs.batches[i].startBinding;
+ const uint count = uint(srbD->csUAVs.batches[i].resources.count());
+ context->CSSetUnorderedAccessViews(startBinding,
+ count,
+ srbD->csUAVs.batches[i].resources.constData(),
+ nullptr);
+ contextState.csHighestActiveUavBinding = qMax<int>(contextState.csHighestActiveUavBinding,
+ int(startBinding + count - 1));
+ }
+}
+
+void QRhiD3D11::resetShaderResources()
+{
+ // Output cannot be bound on input etc.
+
+ if (contextState.vsHasIndexBufferBound) {
+ context->IASetIndexBuffer(nullptr, DXGI_FORMAT_R16_UINT, 0);
+ contextState.vsHasIndexBufferBound = false;
+ }
+
+ if (contextState.vsHighestActiveVertexBufferBinding >= 0) {
+ const int count = contextState.vsHighestActiveVertexBufferBinding + 1;
+ QVarLengthArray<ID3D11Buffer *, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT> nullbufs(count);
+ for (int i = 0; i < count; ++i)
+ nullbufs[i] = nullptr;
+ QVarLengthArray<UINT, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT> nullstrides(count);
+ for (int i = 0; i < count; ++i)
+ nullstrides[i] = 0;
+ QVarLengthArray<UINT, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT> nulloffsets(count);
+ for (int i = 0; i < count; ++i)
+ nulloffsets[i] = 0;
+ context->IASetVertexBuffers(0, UINT(count), nullbufs.constData(), nullstrides.constData(), nulloffsets.constData());
+ contextState.vsHighestActiveVertexBufferBinding = -1;
+ }
+
+ int nullsrvCount = qMax(contextState.vsHighestActiveSrvBinding, contextState.fsHighestActiveSrvBinding);
+ nullsrvCount = qMax(nullsrvCount, contextState.csHighestActiveSrvBinding);
+ nullsrvCount += 1;
+ if (nullsrvCount > 0) {
+ QVarLengthArray<ID3D11ShaderResourceView *,
+ D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT> nullsrvs(nullsrvCount);
+ for (int i = 0; i < nullsrvs.count(); ++i)
+ nullsrvs[i] = nullptr;
+ if (contextState.vsHighestActiveSrvBinding >= 0) {
+ context->VSSetShaderResources(0, UINT(contextState.vsHighestActiveSrvBinding + 1), nullsrvs.constData());
+ contextState.vsHighestActiveSrvBinding = -1;
+ }
+ if (contextState.fsHighestActiveSrvBinding >= 0) {
+ context->PSSetShaderResources(0, UINT(contextState.fsHighestActiveSrvBinding + 1), nullsrvs.constData());
+ contextState.fsHighestActiveSrvBinding = -1;
+ }
+ if (contextState.csHighestActiveSrvBinding >= 0) {
+ context->CSSetShaderResources(0, UINT(contextState.csHighestActiveSrvBinding + 1), nullsrvs.constData());
+ contextState.csHighestActiveSrvBinding = -1;
+ }
+ }
+
+ if (contextState.csHighestActiveUavBinding >= 0) {
+ const int nulluavCount = contextState.csHighestActiveUavBinding + 1;
+ QVarLengthArray<ID3D11UnorderedAccessView *,
+ D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT> nulluavs(nulluavCount);
+ for (int i = 0; i < nulluavCount; ++i)
+ nulluavs[i] = nullptr;
+ context->CSSetUnorderedAccessViews(0, UINT(nulluavCount), nulluavs.constData(), nullptr);
+ contextState.csHighestActiveUavBinding = -1;
+ }
+}
+
+void QRhiD3D11::executeCommandBuffer(QD3D11CommandBuffer *cbD, QD3D11SwapChain *timestampSwapChain)
+{
+ quint32 stencilRef = 0;
+ float blendConstants[] = { 1, 1, 1, 1 };
+
+ if (timestampSwapChain) {
+ const int currentFrameSlot = timestampSwapChain->currentFrameSlot;
+ ID3D11Query *tsDisjoint = timestampSwapChain->timestampDisjointQuery[currentFrameSlot];
+ const int tsIdx = QD3D11SwapChain::BUFFER_COUNT * currentFrameSlot;
+ ID3D11Query *tsStart = timestampSwapChain->timestampQuery[tsIdx];
+ if (tsDisjoint && tsStart && !timestampSwapChain->timestampActive[currentFrameSlot]) {
+ // The timestamps seem to include vsync time with Present(1), except
+ // when running on a non-primary gpu. This is not ideal. So try working
+ // it around by issuing a semi-fake OMSetRenderTargets early and
+ // writing the first timestamp only afterwards.
+ context->Begin(tsDisjoint);
+ QD3D11RenderTargetData *rtD = rtData(&timestampSwapChain->rt);
+ context->OMSetRenderTargets(UINT(rtD->colorAttCount), rtD->colorAttCount ? rtD->rtv : nullptr, rtD->dsv);
+ context->End(tsStart); // just record a timestamp, no Begin needed
+ }
+ }
+
+ for (const QD3D11CommandBuffer::Command &cmd : qAsConst(cbD->commands)) {
+ switch (cmd.cmd) {
+ case QD3D11CommandBuffer::Command::ResetShaderResources:
+ resetShaderResources();
+ break;
+ case QD3D11CommandBuffer::Command::SetRenderTarget:
+ {
+ QD3D11RenderTargetData *rtD = rtData(cmd.args.setRenderTarget.rt);
+ context->OMSetRenderTargets(UINT(rtD->colorAttCount), rtD->colorAttCount ? rtD->rtv : nullptr, rtD->dsv);
+ }
+ break;
+ case QD3D11CommandBuffer::Command::Clear:
+ {
+ QD3D11RenderTargetData *rtD = rtData(cmd.args.clear.rt);
+ if (cmd.args.clear.mask & QD3D11CommandBuffer::Command::Color) {
+ for (int i = 0; i < rtD->colorAttCount; ++i)
+ context->ClearRenderTargetView(rtD->rtv[i], cmd.args.clear.c);
+ }
+ uint ds = 0;
+ if (cmd.args.clear.mask & QD3D11CommandBuffer::Command::Depth)
+ ds |= D3D11_CLEAR_DEPTH;
+ if (cmd.args.clear.mask & QD3D11CommandBuffer::Command::Stencil)
+ ds |= D3D11_CLEAR_STENCIL;
+ if (ds)
+ context->ClearDepthStencilView(rtD->dsv, ds, cmd.args.clear.d, UINT8(cmd.args.clear.s));
+ }
+ break;
+ case QD3D11CommandBuffer::Command::Viewport:
+ {
+ D3D11_VIEWPORT v;
+ v.TopLeftX = cmd.args.viewport.x;
+ v.TopLeftY = cmd.args.viewport.y;
+ v.Width = cmd.args.viewport.w;
+ v.Height = cmd.args.viewport.h;
+ v.MinDepth = cmd.args.viewport.d0;
+ v.MaxDepth = cmd.args.viewport.d1;
+ context->RSSetViewports(1, &v);
+ }
+ break;
+ case QD3D11CommandBuffer::Command::Scissor:
+ {
+ D3D11_RECT r;
+ r.left = cmd.args.scissor.x;
+ r.top = cmd.args.scissor.y;
+ // right and bottom are exclusive
+ r.right = cmd.args.scissor.x + cmd.args.scissor.w;
+ r.bottom = cmd.args.scissor.y + cmd.args.scissor.h;
+ context->RSSetScissorRects(1, &r);
+ }
+ break;
+ case QD3D11CommandBuffer::Command::BindVertexBuffers:
+ contextState.vsHighestActiveVertexBufferBinding = qMax<int>(
+ contextState.vsHighestActiveVertexBufferBinding,
+ cmd.args.bindVertexBuffers.startSlot + cmd.args.bindVertexBuffers.slotCount - 1);
+ context->IASetVertexBuffers(UINT(cmd.args.bindVertexBuffers.startSlot),
+ UINT(cmd.args.bindVertexBuffers.slotCount),
+ cmd.args.bindVertexBuffers.buffers,
+ cmd.args.bindVertexBuffers.strides,
+ cmd.args.bindVertexBuffers.offsets);
+ break;
+ case QD3D11CommandBuffer::Command::BindIndexBuffer:
+ contextState.vsHasIndexBufferBound = true;
+ context->IASetIndexBuffer(cmd.args.bindIndexBuffer.buffer,
+ cmd.args.bindIndexBuffer.format,
+ cmd.args.bindIndexBuffer.offset);
+ break;
+ case QD3D11CommandBuffer::Command::BindGraphicsPipeline:
+ {
+ QD3D11GraphicsPipeline *psD = cmd.args.bindGraphicsPipeline.ps;
+ context->VSSetShader(psD->vs, nullptr, 0);
+ context->PSSetShader(psD->fs, nullptr, 0);
+ context->IASetPrimitiveTopology(psD->d3dTopology);
+ context->IASetInputLayout(psD->inputLayout);
+ context->OMSetDepthStencilState(psD->dsState, stencilRef);
+ context->OMSetBlendState(psD->blendState, blendConstants, 0xffffffff);
+ context->RSSetState(psD->rastState);
+ }
+ break;
+ case QD3D11CommandBuffer::Command::BindShaderResources:
+ bindShaderResources(cmd.args.bindShaderResources.srb,
+ cmd.args.bindShaderResources.dynamicOffsetPairs,
+ cmd.args.bindShaderResources.dynamicOffsetCount,
+ cmd.args.bindShaderResources.offsetOnlyChange);
+ break;
+ case QD3D11CommandBuffer::Command::StencilRef:
+ stencilRef = cmd.args.stencilRef.ref;
+ context->OMSetDepthStencilState(cmd.args.stencilRef.ps->dsState, stencilRef);
+ break;
+ case QD3D11CommandBuffer::Command::BlendConstants:
+ memcpy(blendConstants, cmd.args.blendConstants.c, 4 * sizeof(float));
+ context->OMSetBlendState(cmd.args.blendConstants.ps->blendState, blendConstants, 0xffffffff);
+ break;
+ case QD3D11CommandBuffer::Command::Draw:
+ if (cmd.args.draw.ps) {
+ if (cmd.args.draw.instanceCount == 1)
+ context->Draw(cmd.args.draw.vertexCount, cmd.args.draw.firstVertex);
+ else
+ context->DrawInstanced(cmd.args.draw.vertexCount, cmd.args.draw.instanceCount,
+ cmd.args.draw.firstVertex, cmd.args.draw.firstInstance);
+ } else {
+ qWarning("No graphics pipeline active for draw; ignored");
+ }
+ break;
+ case QD3D11CommandBuffer::Command::DrawIndexed:
+ if (cmd.args.drawIndexed.ps) {
+ if (cmd.args.drawIndexed.instanceCount == 1)
+ context->DrawIndexed(cmd.args.drawIndexed.indexCount, cmd.args.drawIndexed.firstIndex,
+ cmd.args.drawIndexed.vertexOffset);
+ else
+ context->DrawIndexedInstanced(cmd.args.drawIndexed.indexCount, cmd.args.drawIndexed.instanceCount,
+ cmd.args.drawIndexed.firstIndex, cmd.args.drawIndexed.vertexOffset,
+ cmd.args.drawIndexed.firstInstance);
+ } else {
+ qWarning("No graphics pipeline active for drawIndexed; ignored");
+ }
+ break;
+ case QD3D11CommandBuffer::Command::UpdateSubRes:
+ context->UpdateSubresource(cmd.args.updateSubRes.dst, cmd.args.updateSubRes.dstSubRes,
+ cmd.args.updateSubRes.hasDstBox ? &cmd.args.updateSubRes.dstBox : nullptr,
+ cmd.args.updateSubRes.src, cmd.args.updateSubRes.srcRowPitch, 0);
+ break;
+ case QD3D11CommandBuffer::Command::CopySubRes:
+ context->CopySubresourceRegion(cmd.args.copySubRes.dst, cmd.args.copySubRes.dstSubRes,
+ cmd.args.copySubRes.dstX, cmd.args.copySubRes.dstY, 0,
+ cmd.args.copySubRes.src, cmd.args.copySubRes.srcSubRes,
+ cmd.args.copySubRes.hasSrcBox ? &cmd.args.copySubRes.srcBox : nullptr);
+ break;
+ case QD3D11CommandBuffer::Command::ResolveSubRes:
+ context->ResolveSubresource(cmd.args.resolveSubRes.dst, cmd.args.resolveSubRes.dstSubRes,
+ cmd.args.resolveSubRes.src, cmd.args.resolveSubRes.srcSubRes,
+ cmd.args.resolveSubRes.format);
+ break;
+ case QD3D11CommandBuffer::Command::GenMip:
+ context->GenerateMips(cmd.args.genMip.srv);
+ break;
+ case QD3D11CommandBuffer::Command::DebugMarkBegin:
+ annotations->BeginEvent(reinterpret_cast<LPCWSTR>(QString::fromLatin1(cmd.args.debugMark.s).utf16()));
+ break;
+ case QD3D11CommandBuffer::Command::DebugMarkEnd:
+ annotations->EndEvent();
+ break;
+ case QD3D11CommandBuffer::Command::DebugMarkMsg:
+ annotations->SetMarker(reinterpret_cast<LPCWSTR>(QString::fromLatin1(cmd.args.debugMark.s).utf16()));
+ break;
+ case QD3D11CommandBuffer::Command::BindComputePipeline:
+ context->CSSetShader(cmd.args.bindComputePipeline.ps->cs, nullptr, 0);
+ break;
+ case QD3D11CommandBuffer::Command::Dispatch:
+ context->Dispatch(cmd.args.dispatch.x, cmd.args.dispatch.y, cmd.args.dispatch.z);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+QD3D11Buffer::QD3D11Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size)
+ : QRhiBuffer(rhi, type, usage, size)
+{
+}
+
+QD3D11Buffer::~QD3D11Buffer()
+{
+ release();
+}
+
+void QD3D11Buffer::release()
+{
+ if (!buffer)
+ return;
+
+ dynBuf.clear();
+
+ buffer->Release();
+ buffer = nullptr;
+
+ if (uav) {
+ uav->Release();
+ uav = nullptr;
+ }
+
+ QRHI_RES_RHI(QRhiD3D11);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseBuffer(this));
+ rhiD->unregisterResource(this);
+}
+
+static inline uint toD3DBufferUsage(QRhiBuffer::UsageFlags usage)
+{
+ int u = 0;
+ if (usage.testFlag(QRhiBuffer::VertexBuffer))
+ u |= D3D11_BIND_VERTEX_BUFFER;
+ if (usage.testFlag(QRhiBuffer::IndexBuffer))
+ u |= D3D11_BIND_INDEX_BUFFER;
+ if (usage.testFlag(QRhiBuffer::UniformBuffer))
+ u |= D3D11_BIND_CONSTANT_BUFFER;
+ if (usage.testFlag(QRhiBuffer::StorageBuffer))
+ u |= D3D11_BIND_UNORDERED_ACCESS;
+ return uint(u);
+}
+
+bool QD3D11Buffer::build()
+{
+ if (buffer)
+ release();
+
+ if (m_usage.testFlag(QRhiBuffer::UniformBuffer) && m_type != Dynamic) {
+ qWarning("UniformBuffer must always be combined with Dynamic on D3D11");
+ return false;
+ }
+
+ if (m_usage.testFlag(QRhiBuffer::StorageBuffer) && m_type == Dynamic) {
+ qWarning("StorageBuffer cannot be combined with Dynamic");
+ return false;
+ }
+
+ const int nonZeroSize = m_size <= 0 ? 256 : m_size;
+ const int roundedSize = aligned(nonZeroSize, m_usage.testFlag(QRhiBuffer::UniformBuffer) ? 256 : 4);
+
+ D3D11_BUFFER_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.ByteWidth = UINT(roundedSize);
+ desc.Usage = m_type == Dynamic ? D3D11_USAGE_DYNAMIC : D3D11_USAGE_DEFAULT;
+ desc.BindFlags = toD3DBufferUsage(m_usage);
+ desc.CPUAccessFlags = m_type == Dynamic ? D3D11_CPU_ACCESS_WRITE : 0;
+ desc.MiscFlags = m_usage.testFlag(QRhiBuffer::StorageBuffer) ? D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS : 0;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ HRESULT hr = rhiD->dev->CreateBuffer(&desc, nullptr, &buffer);
+ if (FAILED(hr)) {
+ qWarning("Failed to create buffer: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ if (m_type == Dynamic) {
+ dynBuf.resize(m_size);
+ hasPendingDynamicUpdates = false;
+ }
+
+ if (!m_objectName.isEmpty())
+ buffer->SetPrivateData(WKPDID_D3DDebugObjectName, UINT(m_objectName.size()), m_objectName.constData());
+
+ QRHI_PROF;
+ QRHI_PROF_F(newBuffer(this, quint32(roundedSize), m_type == Dynamic ? 2 : 1, m_type == Dynamic ? 1 : 0));
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+ID3D11UnorderedAccessView *QD3D11Buffer::unorderedAccessView()
+{
+ if (uav)
+ return uav;
+
+ // SPIRV-Cross generated HLSL uses RWByteAddressBuffer
+ D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Format = DXGI_FORMAT_R32_TYPELESS;
+ desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER;
+ desc.Buffer.FirstElement = 0;
+ desc.Buffer.NumElements = UINT(aligned(m_size, 4) / 4);
+ desc.Buffer.Flags = D3D11_BUFFER_UAV_FLAG_RAW;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ HRESULT hr = rhiD->dev->CreateUnorderedAccessView(buffer, &desc, &uav);
+ if (FAILED(hr)) {
+ qWarning("Failed to create UAV: %s", qPrintable(comErrorMessage(hr)));
+ return nullptr;
+ }
+
+ return uav;
+}
+
+QD3D11RenderBuffer::QD3D11RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+ : QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
+{
+}
+
+QD3D11RenderBuffer::~QD3D11RenderBuffer()
+{
+ release();
+}
+
+void QD3D11RenderBuffer::release()
+{
+ if (!tex)
+ return;
+
+ if (dsv) {
+ dsv->Release();
+ dsv = nullptr;
+ }
+
+ if (rtv) {
+ rtv->Release();
+ rtv = nullptr;
+ }
+
+ tex->Release();
+ tex = nullptr;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseRenderBuffer(this));
+ rhiD->unregisterResource(this);
+}
+
+bool QD3D11RenderBuffer::build()
+{
+ if (tex)
+ release();
+
+ if (m_pixelSize.isEmpty())
+ return false;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ sampleDesc = rhiD->effectiveSampleCount(m_sampleCount);
+
+ D3D11_TEXTURE2D_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Width = UINT(m_pixelSize.width());
+ desc.Height = UINT(m_pixelSize.height());
+ desc.MipLevels = 1;
+ desc.ArraySize = 1;
+ desc.SampleDesc = sampleDesc;
+ desc.Usage = D3D11_USAGE_DEFAULT;
+
+ if (m_type == Color) {
+ dxgiFormat = DXGI_FORMAT_R8G8B8A8_UNORM;
+ desc.Format = dxgiFormat;
+ desc.BindFlags = D3D11_BIND_RENDER_TARGET;
+ HRESULT hr = rhiD->dev->CreateTexture2D(&desc, nullptr, &tex);
+ if (FAILED(hr)) {
+ qWarning("Failed to create color renderbuffer: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
+ memset(&rtvDesc, 0, sizeof(rtvDesc));
+ rtvDesc.Format = dxgiFormat;
+ rtvDesc.ViewDimension = desc.SampleDesc.Count > 1 ? D3D11_RTV_DIMENSION_TEXTURE2DMS
+ : D3D11_RTV_DIMENSION_TEXTURE2D;
+ hr = rhiD->dev->CreateRenderTargetView(tex, &rtvDesc, &rtv);
+ if (FAILED(hr)) {
+ qWarning("Failed to create rtv: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ } else if (m_type == DepthStencil) {
+ dxgiFormat = DXGI_FORMAT_D24_UNORM_S8_UINT;
+ desc.Format = dxgiFormat;
+ desc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
+ HRESULT hr = rhiD->dev->CreateTexture2D(&desc, nullptr, &tex);
+ if (FAILED(hr)) {
+ qWarning("Failed to create depth-stencil buffer: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
+ memset(&dsvDesc, 0, sizeof(dsvDesc));
+ dsvDesc.Format = dxgiFormat;
+ dsvDesc.ViewDimension = desc.SampleDesc.Count > 1 ? D3D11_DSV_DIMENSION_TEXTURE2DMS
+ : D3D11_DSV_DIMENSION_TEXTURE2D;
+ hr = rhiD->dev->CreateDepthStencilView(tex, &dsvDesc, &dsv);
+ if (FAILED(hr)) {
+ qWarning("Failed to create dsv: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ } else {
+ return false;
+ }
+
+ if (!m_objectName.isEmpty())
+ tex->SetPrivateData(WKPDID_D3DDebugObjectName, UINT(m_objectName.size()), m_objectName.constData());
+
+ QRHI_PROF;
+ QRHI_PROF_F(newRenderBuffer(this, false, false, int(sampleDesc.Count)));
+
+ rhiD->registerResource(this);
+ return true;
+}
+
+QRhiTexture::Format QD3D11RenderBuffer::backingFormat() const
+{
+ return m_type == Color ? QRhiTexture::RGBA8 : QRhiTexture::UnknownFormat;
+}
+
+QD3D11Texture::QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags)
+ : QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
+{
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i)
+ perLevelViews[i] = nullptr;
+}
+
+QD3D11Texture::~QD3D11Texture()
+{
+ release();
+}
+
+void QD3D11Texture::release()
+{
+ if (!tex)
+ return;
+
+ if (srv) {
+ srv->Release();
+ srv = nullptr;
+ }
+
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i) {
+ if (perLevelViews[i]) {
+ perLevelViews[i]->Release();
+ perLevelViews[i] = nullptr;
+ }
+ }
+
+ if (owns)
+ tex->Release();
+
+ tex = nullptr;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseTexture(this));
+ rhiD->unregisterResource(this);
+}
+
+static inline DXGI_FORMAT toD3DDepthTextureSRVFormat(QRhiTexture::Format format)
+{
+ switch (format) {
+ case QRhiTexture::Format::D16:
+ return DXGI_FORMAT_R16_FLOAT;
+ case QRhiTexture::Format::D32F:
+ return DXGI_FORMAT_R32_FLOAT;
+ default:
+ Q_UNREACHABLE();
+ return DXGI_FORMAT_R32_FLOAT;
+ }
+}
+
+static inline DXGI_FORMAT toD3DDepthTextureDSVFormat(QRhiTexture::Format format)
+{
+ switch (format) {
+ case QRhiTexture::Format::D16:
+ return DXGI_FORMAT_D16_UNORM;
+ case QRhiTexture::Format::D32F:
+ return DXGI_FORMAT_D32_FLOAT;
+ default:
+ Q_UNREACHABLE();
+ return DXGI_FORMAT_D32_FLOAT;
+ }
+}
+
+bool QD3D11Texture::prepareBuild(QSize *adjustedSize)
+{
+ if (tex)
+ release();
+
+ const QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+ const bool isDepth = isDepthTextureFormat(m_format);
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+
+ QRHI_RES_RHI(QRhiD3D11);
+ dxgiFormat = toD3DTextureFormat(m_format, m_flags);
+ mipLevelCount = uint(hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1);
+ sampleDesc = rhiD->effectiveSampleCount(m_sampleCount);
+ if (sampleDesc.Count > 1) {
+ if (isCube) {
+ qWarning("Cubemap texture cannot be multisample");
+ return false;
+ }
+ if (hasMipMaps) {
+ qWarning("Multisample texture cannot have mipmaps");
+ return false;
+ }
+ }
+ if (isDepth && hasMipMaps) {
+ qWarning("Depth texture cannot have mipmaps");
+ return false;
+ }
+
+ if (adjustedSize)
+ *adjustedSize = size;
+
+ return true;
+}
+
+bool QD3D11Texture::finishBuild()
+{
+ QRHI_RES_RHI(QRhiD3D11);
+ const bool isDepth = isDepthTextureFormat(m_format);
+ const bool isCube = m_flags.testFlag(CubeMap);
+
+ D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc;
+ memset(&srvDesc, 0, sizeof(srvDesc));
+ srvDesc.Format = isDepth ? toD3DDepthTextureSRVFormat(m_format) : dxgiFormat;
+ if (isCube) {
+ srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
+ srvDesc.TextureCube.MipLevels = mipLevelCount;
+ } else {
+ if (sampleDesc.Count > 1) {
+ srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DMS;
+ } else {
+ srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
+ srvDesc.Texture2D.MipLevels = mipLevelCount;
+ }
+ }
+
+ HRESULT hr = rhiD->dev->CreateShaderResourceView(tex, &srvDesc, &srv);
+ if (FAILED(hr)) {
+ qWarning("Failed to create srv: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ nativeHandlesStruct.texture = tex;
+
+ generation += 1;
+ return true;
+}
+
+bool QD3D11Texture::build()
+{
+ QSize size;
+ if (!prepareBuild(&size))
+ return false;
+
+ const bool isDepth = isDepthTextureFormat(m_format);
+ const bool isCube = m_flags.testFlag(CubeMap);
+
+ uint bindFlags = D3D11_BIND_SHADER_RESOURCE;
+ uint miscFlags = isCube ? D3D11_RESOURCE_MISC_TEXTURECUBE : 0;
+ if (m_flags.testFlag(RenderTarget)) {
+ if (isDepth)
+ bindFlags |= D3D11_BIND_DEPTH_STENCIL;
+ else
+ bindFlags |= D3D11_BIND_RENDER_TARGET;
+ }
+ if (m_flags.testFlag(UsedWithGenerateMips)) {
+ if (isDepth) {
+ qWarning("Depth texture cannot have mipmaps generated");
+ return false;
+ }
+ bindFlags |= D3D11_BIND_RENDER_TARGET;
+ miscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
+ }
+ if (m_flags.testFlag(UsedWithLoadStore))
+ bindFlags |= D3D11_BIND_UNORDERED_ACCESS;
+
+ D3D11_TEXTURE2D_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Width = UINT(size.width());
+ desc.Height = UINT(size.height());
+ desc.MipLevels = mipLevelCount;
+ desc.ArraySize = isCube ? 6 : 1;
+ desc.Format = dxgiFormat;
+ desc.SampleDesc = sampleDesc;
+ desc.Usage = D3D11_USAGE_DEFAULT;
+ desc.BindFlags = bindFlags;
+ desc.MiscFlags = miscFlags;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ HRESULT hr = rhiD->dev->CreateTexture2D(&desc, nullptr, &tex);
+ if (FAILED(hr)) {
+ qWarning("Failed to create texture: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ if (!finishBuild())
+ return false;
+
+ if (!m_objectName.isEmpty())
+ tex->SetPrivateData(WKPDID_D3DDebugObjectName, UINT(m_objectName.size()), m_objectName.constData());
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, true, int(mipLevelCount), isCube ? 6 : 1, int(sampleDesc.Count)));
+
+ owns = true;
+ rhiD->registerResource(this);
+ return true;
+}
+
+bool QD3D11Texture::buildFrom(const QRhiNativeHandles *src)
+{
+ const QRhiD3D11TextureNativeHandles *h = static_cast<const QRhiD3D11TextureNativeHandles *>(src);
+ if (!h || !h->texture)
+ return false;
+
+ if (!prepareBuild())
+ return false;
+
+ tex = static_cast<ID3D11Texture2D *>(h->texture);
+
+ if (!finishBuild())
+ return false;
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, false, int(mipLevelCount), m_flags.testFlag(CubeMap) ? 6 : 1, int(sampleDesc.Count)));
+
+ owns = false;
+ QRHI_RES_RHI(QRhiD3D11);
+ rhiD->registerResource(this);
+ return true;
+}
+
+const QRhiNativeHandles *QD3D11Texture::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+ID3D11UnorderedAccessView *QD3D11Texture::unorderedAccessViewForLevel(int level)
+{
+ if (perLevelViews[level])
+ return perLevelViews[level];
+
+ const bool isCube = m_flags.testFlag(CubeMap);
+ D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Format = dxgiFormat;
+ if (isCube) {
+ desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2DARRAY;
+ desc.Texture2DArray.MipSlice = UINT(level);
+ desc.Texture2DArray.FirstArraySlice = 0;
+ desc.Texture2DArray.ArraySize = 6;
+ } else {
+ desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;
+ desc.Texture2D.MipSlice = UINT(level);
+ }
+
+ QRHI_RES_RHI(QRhiD3D11);
+ ID3D11UnorderedAccessView *uav = nullptr;
+ HRESULT hr = rhiD->dev->CreateUnorderedAccessView(tex, &desc, &uav);
+ if (FAILED(hr)) {
+ qWarning("Failed to create UAV: %s", qPrintable(comErrorMessage(hr)));
+ return nullptr;
+ }
+
+ perLevelViews[level] = uav;
+ return uav;
+}
+
+QD3D11Sampler::QD3D11Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v)
+ : QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u, v)
+{
+}
+
+QD3D11Sampler::~QD3D11Sampler()
+{
+ release();
+}
+
+void QD3D11Sampler::release()
+{
+ if (!samplerState)
+ return;
+
+ samplerState->Release();
+ samplerState = nullptr;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ rhiD->unregisterResource(this);
+}
+
+static inline D3D11_FILTER toD3DFilter(QRhiSampler::Filter minFilter, QRhiSampler::Filter magFilter, QRhiSampler::Filter mipFilter)
+{
+ if (minFilter == QRhiSampler::Nearest) {
+ if (magFilter == QRhiSampler::Nearest) {
+ if (mipFilter == QRhiSampler::Linear)
+ return D3D11_FILTER_MIN_MAG_POINT_MIP_LINEAR;
+ else
+ return D3D11_FILTER_MIN_MAG_MIP_POINT;
+ } else {
+ if (mipFilter == QRhiSampler::Linear)
+ return D3D11_FILTER_MIN_POINT_MAG_MIP_LINEAR;
+ else
+ return D3D11_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT;
+ }
+ } else {
+ if (magFilter == QRhiSampler::Nearest) {
+ if (mipFilter == QRhiSampler::Linear)
+ return D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR;
+ else
+ return D3D11_FILTER_MIN_LINEAR_MAG_MIP_POINT;
+ } else {
+ if (mipFilter == QRhiSampler::Linear)
+ return D3D11_FILTER_MIN_MAG_MIP_LINEAR;
+ else
+ return D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT;
+ }
+ }
+
+ Q_UNREACHABLE();
+ return D3D11_FILTER_MIN_MAG_MIP_LINEAR;
+}
+
+static inline D3D11_TEXTURE_ADDRESS_MODE toD3DAddressMode(QRhiSampler::AddressMode m)
+{
+ switch (m) {
+ case QRhiSampler::Repeat:
+ return D3D11_TEXTURE_ADDRESS_WRAP;
+ case QRhiSampler::ClampToEdge:
+ return D3D11_TEXTURE_ADDRESS_CLAMP;
+ case QRhiSampler::Border:
+ return D3D11_TEXTURE_ADDRESS_BORDER;
+ case QRhiSampler::Mirror:
+ return D3D11_TEXTURE_ADDRESS_MIRROR;
+ case QRhiSampler::MirrorOnce:
+ return D3D11_TEXTURE_ADDRESS_MIRROR_ONCE;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_TEXTURE_ADDRESS_CLAMP;
+ }
+}
+
+static inline D3D11_COMPARISON_FUNC toD3DTextureComparisonFunc(QRhiSampler::CompareOp op)
+{
+ switch (op) {
+ case QRhiSampler::Never:
+ return D3D11_COMPARISON_NEVER;
+ case QRhiSampler::Less:
+ return D3D11_COMPARISON_LESS;
+ case QRhiSampler::Equal:
+ return D3D11_COMPARISON_EQUAL;
+ case QRhiSampler::LessOrEqual:
+ return D3D11_COMPARISON_LESS_EQUAL;
+ case QRhiSampler::Greater:
+ return D3D11_COMPARISON_GREATER;
+ case QRhiSampler::NotEqual:
+ return D3D11_COMPARISON_NOT_EQUAL;
+ case QRhiSampler::GreaterOrEqual:
+ return D3D11_COMPARISON_GREATER_EQUAL;
+ case QRhiSampler::Always:
+ return D3D11_COMPARISON_ALWAYS;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_COMPARISON_NEVER;
+ }
+}
+
+bool QD3D11Sampler::build()
+{
+ if (samplerState)
+ release();
+
+ D3D11_SAMPLER_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Filter = toD3DFilter(m_minFilter, m_magFilter, m_mipmapMode);
+ if (m_compareOp != Never)
+ desc.Filter = D3D11_FILTER(desc.Filter | 0x80);
+ desc.AddressU = toD3DAddressMode(m_addressU);
+ desc.AddressV = toD3DAddressMode(m_addressV);
+ desc.AddressW = toD3DAddressMode(m_addressW);
+ desc.MaxAnisotropy = 1.0f;
+ desc.ComparisonFunc = toD3DTextureComparisonFunc(m_compareOp);
+ desc.MaxLOD = m_mipmapMode == None ? 0.0f : 1000.0f;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ HRESULT hr = rhiD->dev->CreateSamplerState(&desc, &samplerState);
+ if (FAILED(hr)) {
+ qWarning("Failed to create sampler state: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+// dummy, no Vulkan-style RenderPass+Framebuffer concept here
+QD3D11RenderPassDescriptor::QD3D11RenderPassDescriptor(QRhiImplementation *rhi)
+ : QRhiRenderPassDescriptor(rhi)
+{
+}
+
+QD3D11RenderPassDescriptor::~QD3D11RenderPassDescriptor()
+{
+ release();
+}
+
+void QD3D11RenderPassDescriptor::release()
+{
+ // nothing to do here
+}
+
+QD3D11ReferenceRenderTarget::QD3D11ReferenceRenderTarget(QRhiImplementation *rhi)
+ : QRhiRenderTarget(rhi),
+ d(rhi)
+{
+}
+
+QD3D11ReferenceRenderTarget::~QD3D11ReferenceRenderTarget()
+{
+ release();
+}
+
+void QD3D11ReferenceRenderTarget::release()
+{
+ // nothing to do here
+}
+
+QSize QD3D11ReferenceRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QD3D11ReferenceRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QD3D11ReferenceRenderTarget::sampleCount() const
+{
+ return d.sampleCount;
+}
+
+QD3D11TextureRenderTarget::QD3D11TextureRenderTarget(QRhiImplementation *rhi,
+ const QRhiTextureRenderTargetDescription &desc,
+ Flags flags)
+ : QRhiTextureRenderTarget(rhi, desc, flags),
+ d(rhi)
+{
+ for (int i = 0; i < QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS; ++i) {
+ ownsRtv[i] = false;
+ rtv[i] = nullptr;
+ }
+}
+
+QD3D11TextureRenderTarget::~QD3D11TextureRenderTarget()
+{
+ release();
+}
+
+void QD3D11TextureRenderTarget::release()
+{
+ QRHI_RES_RHI(QRhiD3D11);
+
+ if (!rtv[0] && !dsv)
+ return;
+
+ if (dsv) {
+ if (ownsDsv)
+ dsv->Release();
+ dsv = nullptr;
+ }
+
+ for (int i = 0; i < QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS; ++i) {
+ if (rtv[i]) {
+ if (ownsRtv[i])
+ rtv[i]->Release();
+ rtv[i] = nullptr;
+ }
+ }
+
+ rhiD->unregisterResource(this);
+}
+
+QRhiRenderPassDescriptor *QD3D11TextureRenderTarget::newCompatibleRenderPassDescriptor()
+{
+ return new QD3D11RenderPassDescriptor(m_rhi);
+}
+
+bool QD3D11TextureRenderTarget::build()
+{
+ if (rtv[0] || dsv)
+ release();
+
+ const bool hasColorAttachments = m_desc.cbeginColorAttachments() != m_desc.cendColorAttachments();
+ Q_ASSERT(hasColorAttachments || m_desc.depthTexture());
+ Q_ASSERT(!m_desc.depthStencilBuffer() || !m_desc.depthTexture());
+ const bool hasDepthStencil = m_desc.depthStencilBuffer() || m_desc.depthTexture();
+
+ QRHI_RES_RHI(QRhiD3D11);
+
+ d.colorAttCount = 0;
+ int attIndex = 0;
+ for (auto it = m_desc.cbeginColorAttachments(), itEnd = m_desc.cendColorAttachments(); it != itEnd; ++it, ++attIndex) {
+ d.colorAttCount += 1;
+ const QRhiColorAttachment &colorAtt(*it);
+ QRhiTexture *texture = colorAtt.texture();
+ QRhiRenderBuffer *rb = colorAtt.renderBuffer();
+ Q_ASSERT(texture || rb);
+ if (texture) {
+ QD3D11Texture *texD = QRHI_RES(QD3D11Texture, texture);
+ D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
+ memset(&rtvDesc, 0, sizeof(rtvDesc));
+ rtvDesc.Format = toD3DTextureFormat(texD->format(), texD->flags());
+ if (texD->flags().testFlag(QRhiTexture::CubeMap)) {
+ rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
+ rtvDesc.Texture2DArray.MipSlice = UINT(colorAtt.level());
+ rtvDesc.Texture2DArray.FirstArraySlice = UINT(colorAtt.layer());
+ rtvDesc.Texture2DArray.ArraySize = 1;
+ } else {
+ if (texD->sampleDesc.Count > 1) {
+ rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS;
+ } else {
+ rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
+ rtvDesc.Texture2D.MipSlice = UINT(colorAtt.level());
+ }
+ }
+ HRESULT hr = rhiD->dev->CreateRenderTargetView(texD->tex, &rtvDesc, &rtv[attIndex]);
+ if (FAILED(hr)) {
+ qWarning("Failed to create rtv: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ ownsRtv[attIndex] = true;
+ if (attIndex == 0) {
+ d.pixelSize = texD->pixelSize();
+ d.sampleCount = int(texD->sampleDesc.Count);
+ }
+ } else if (rb) {
+ QD3D11RenderBuffer *rbD = QRHI_RES(QD3D11RenderBuffer, rb);
+ ownsRtv[attIndex] = false;
+ rtv[attIndex] = rbD->rtv;
+ if (attIndex == 0) {
+ d.pixelSize = rbD->pixelSize();
+ d.sampleCount = int(rbD->sampleDesc.Count);
+ }
+ }
+ }
+ d.dpr = 1;
+
+ if (hasDepthStencil) {
+ if (m_desc.depthTexture()) {
+ ownsDsv = true;
+ QD3D11Texture *depthTexD = QRHI_RES(QD3D11Texture, m_desc.depthTexture());
+ D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
+ memset(&dsvDesc, 0, sizeof(dsvDesc));
+ dsvDesc.Format = toD3DDepthTextureDSVFormat(depthTexD->format());
+ dsvDesc.ViewDimension = depthTexD->sampleDesc.Count > 1 ? D3D11_DSV_DIMENSION_TEXTURE2DMS
+ : D3D11_DSV_DIMENSION_TEXTURE2D;
+ HRESULT hr = rhiD->dev->CreateDepthStencilView(depthTexD->tex, &dsvDesc, &dsv);
+ if (FAILED(hr)) {
+ qWarning("Failed to create dsv: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ if (d.colorAttCount == 0) {
+ d.pixelSize = depthTexD->pixelSize();
+ d.sampleCount = int(depthTexD->sampleDesc.Count);
+ }
+ } else {
+ ownsDsv = false;
+ QD3D11RenderBuffer *depthRbD = QRHI_RES(QD3D11RenderBuffer, m_desc.depthStencilBuffer());
+ dsv = depthRbD->dsv;
+ if (d.colorAttCount == 0) {
+ d.pixelSize = m_desc.depthStencilBuffer()->pixelSize();
+ d.sampleCount = int(depthRbD->sampleDesc.Count);
+ }
+ }
+ d.dsAttCount = 1;
+ } else {
+ d.dsAttCount = 0;
+ }
+
+ for (int i = 0; i < QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS; ++i)
+ d.rtv[i] = i < d.colorAttCount ? rtv[i] : nullptr;
+
+ d.dsv = dsv;
+ d.rp = QRHI_RES(QD3D11RenderPassDescriptor, m_renderPassDesc);
+
+ rhiD->registerResource(this);
+ return true;
+}
+
+QSize QD3D11TextureRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QD3D11TextureRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QD3D11TextureRenderTarget::sampleCount() const
+{
+ return d.sampleCount;
+}
+
+QD3D11ShaderResourceBindings::QD3D11ShaderResourceBindings(QRhiImplementation *rhi)
+ : QRhiShaderResourceBindings(rhi)
+{
+}
+
+QD3D11ShaderResourceBindings::~QD3D11ShaderResourceBindings()
+{
+ release();
+}
+
+void QD3D11ShaderResourceBindings::release()
+{
+ sortedBindings.clear();
+}
+
+bool QD3D11ShaderResourceBindings::build()
+{
+ if (!sortedBindings.isEmpty())
+ release();
+
+ std::copy(m_bindings.cbegin(), m_bindings.cend(), std::back_inserter(sortedBindings));
+ std::sort(sortedBindings.begin(), sortedBindings.end(),
+ [](const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)
+ {
+ return a.data()->binding < b.data()->binding;
+ });
+
+ boundResourceData.resize(sortedBindings.count());
+
+ QRHI_RES_RHI(QRhiD3D11);
+ rhiD->updateShaderResourceBindings(this);
+
+ generation += 1;
+ return true;
+}
+
+QD3D11GraphicsPipeline::QD3D11GraphicsPipeline(QRhiImplementation *rhi)
+ : QRhiGraphicsPipeline(rhi)
+{
+}
+
+QD3D11GraphicsPipeline::~QD3D11GraphicsPipeline()
+{
+ release();
+}
+
+void QD3D11GraphicsPipeline::release()
+{
+ QRHI_RES_RHI(QRhiD3D11);
+
+ if (!dsState)
+ return;
+
+ dsState->Release();
+ dsState = nullptr;
+
+ if (blendState) {
+ blendState->Release();
+ blendState = nullptr;
+ }
+
+ if (inputLayout) {
+ inputLayout->Release();
+ inputLayout = nullptr;
+ }
+
+ if (rastState) {
+ rastState->Release();
+ rastState = nullptr;
+ }
+
+ if (vs) {
+ vs->Release();
+ vs = nullptr;
+ }
+
+ if (fs) {
+ fs->Release();
+ fs = nullptr;
+ }
+
+ rhiD->unregisterResource(this);
+}
+
+static inline D3D11_CULL_MODE toD3DCullMode(QRhiGraphicsPipeline::CullMode c)
+{
+ switch (c) {
+ case QRhiGraphicsPipeline::None:
+ return D3D11_CULL_NONE;
+ case QRhiGraphicsPipeline::Front:
+ return D3D11_CULL_FRONT;
+ case QRhiGraphicsPipeline::Back:
+ return D3D11_CULL_BACK;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_CULL_NONE;
+ }
+}
+
+static inline D3D11_COMPARISON_FUNC toD3DCompareOp(QRhiGraphicsPipeline::CompareOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Never:
+ return D3D11_COMPARISON_NEVER;
+ case QRhiGraphicsPipeline::Less:
+ return D3D11_COMPARISON_LESS;
+ case QRhiGraphicsPipeline::Equal:
+ return D3D11_COMPARISON_EQUAL;
+ case QRhiGraphicsPipeline::LessOrEqual:
+ return D3D11_COMPARISON_LESS_EQUAL;
+ case QRhiGraphicsPipeline::Greater:
+ return D3D11_COMPARISON_GREATER;
+ case QRhiGraphicsPipeline::NotEqual:
+ return D3D11_COMPARISON_NOT_EQUAL;
+ case QRhiGraphicsPipeline::GreaterOrEqual:
+ return D3D11_COMPARISON_GREATER_EQUAL;
+ case QRhiGraphicsPipeline::Always:
+ return D3D11_COMPARISON_ALWAYS;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_COMPARISON_ALWAYS;
+ }
+}
+
+static inline D3D11_STENCIL_OP toD3DStencilOp(QRhiGraphicsPipeline::StencilOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::StencilZero:
+ return D3D11_STENCIL_OP_ZERO;
+ case QRhiGraphicsPipeline::Keep:
+ return D3D11_STENCIL_OP_KEEP;
+ case QRhiGraphicsPipeline::Replace:
+ return D3D11_STENCIL_OP_REPLACE;
+ case QRhiGraphicsPipeline::IncrementAndClamp:
+ return D3D11_STENCIL_OP_INCR_SAT;
+ case QRhiGraphicsPipeline::DecrementAndClamp:
+ return D3D11_STENCIL_OP_DECR_SAT;
+ case QRhiGraphicsPipeline::Invert:
+ return D3D11_STENCIL_OP_INVERT;
+ case QRhiGraphicsPipeline::IncrementAndWrap:
+ return D3D11_STENCIL_OP_INCR;
+ case QRhiGraphicsPipeline::DecrementAndWrap:
+ return D3D11_STENCIL_OP_DECR;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_STENCIL_OP_KEEP;
+ }
+}
+
+static inline DXGI_FORMAT toD3DAttributeFormat(QRhiVertexInputAttribute::Format format)
+{
+ switch (format) {
+ case QRhiVertexInputAttribute::Float4:
+ return DXGI_FORMAT_R32G32B32A32_FLOAT;
+ case QRhiVertexInputAttribute::Float3:
+ return DXGI_FORMAT_R32G32B32_FLOAT;
+ case QRhiVertexInputAttribute::Float2:
+ return DXGI_FORMAT_R32G32_FLOAT;
+ case QRhiVertexInputAttribute::Float:
+ return DXGI_FORMAT_R32_FLOAT;
+ case QRhiVertexInputAttribute::UNormByte4:
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+ case QRhiVertexInputAttribute::UNormByte2:
+ return DXGI_FORMAT_R8G8_UNORM;
+ case QRhiVertexInputAttribute::UNormByte:
+ return DXGI_FORMAT_R8_UNORM;
+ default:
+ Q_UNREACHABLE();
+ return DXGI_FORMAT_R32G32B32A32_FLOAT;
+ }
+}
+
+static inline D3D11_PRIMITIVE_TOPOLOGY toD3DTopology(QRhiGraphicsPipeline::Topology t)
+{
+ switch (t) {
+ case QRhiGraphicsPipeline::Triangles:
+ return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
+ case QRhiGraphicsPipeline::TriangleStrip:
+ return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
+ case QRhiGraphicsPipeline::Lines:
+ return D3D11_PRIMITIVE_TOPOLOGY_LINELIST;
+ case QRhiGraphicsPipeline::LineStrip:
+ return D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP;
+ case QRhiGraphicsPipeline::Points:
+ return D3D11_PRIMITIVE_TOPOLOGY_POINTLIST;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
+ }
+}
+
+static inline UINT8 toD3DColorWriteMask(QRhiGraphicsPipeline::ColorMask c)
+{
+ UINT8 f = 0;
+ if (c.testFlag(QRhiGraphicsPipeline::R))
+ f |= D3D11_COLOR_WRITE_ENABLE_RED;
+ if (c.testFlag(QRhiGraphicsPipeline::G))
+ f |= D3D11_COLOR_WRITE_ENABLE_GREEN;
+ if (c.testFlag(QRhiGraphicsPipeline::B))
+ f |= D3D11_COLOR_WRITE_ENABLE_BLUE;
+ if (c.testFlag(QRhiGraphicsPipeline::A))
+ f |= D3D11_COLOR_WRITE_ENABLE_ALPHA;
+ return f;
+}
+
+static inline D3D11_BLEND toD3DBlendFactor(QRhiGraphicsPipeline::BlendFactor f)
+{
+ switch (f) {
+ case QRhiGraphicsPipeline::Zero:
+ return D3D11_BLEND_ZERO;
+ case QRhiGraphicsPipeline::One:
+ return D3D11_BLEND_ONE;
+ case QRhiGraphicsPipeline::SrcColor:
+ return D3D11_BLEND_SRC_COLOR;
+ case QRhiGraphicsPipeline::OneMinusSrcColor:
+ return D3D11_BLEND_INV_SRC_COLOR;
+ case QRhiGraphicsPipeline::DstColor:
+ return D3D11_BLEND_DEST_COLOR;
+ case QRhiGraphicsPipeline::OneMinusDstColor:
+ return D3D11_BLEND_INV_DEST_COLOR;
+ case QRhiGraphicsPipeline::SrcAlpha:
+ return D3D11_BLEND_SRC_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusSrcAlpha:
+ return D3D11_BLEND_INV_SRC_ALPHA;
+ case QRhiGraphicsPipeline::DstAlpha:
+ return D3D11_BLEND_DEST_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusDstAlpha:
+ return D3D11_BLEND_INV_DEST_ALPHA;
+ case QRhiGraphicsPipeline::ConstantColor:
+ Q_FALLTHROUGH();
+ case QRhiGraphicsPipeline::ConstantAlpha:
+ return D3D11_BLEND_BLEND_FACTOR;
+ case QRhiGraphicsPipeline::OneMinusConstantColor:
+ Q_FALLTHROUGH();
+ case QRhiGraphicsPipeline::OneMinusConstantAlpha:
+ return D3D11_BLEND_INV_BLEND_FACTOR;
+ case QRhiGraphicsPipeline::SrcAlphaSaturate:
+ return D3D11_BLEND_SRC_ALPHA_SAT;
+ case QRhiGraphicsPipeline::Src1Color:
+ return D3D11_BLEND_SRC1_COLOR;
+ case QRhiGraphicsPipeline::OneMinusSrc1Color:
+ return D3D11_BLEND_INV_SRC1_COLOR;
+ case QRhiGraphicsPipeline::Src1Alpha:
+ return D3D11_BLEND_SRC1_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusSrc1Alpha:
+ return D3D11_BLEND_INV_SRC1_ALPHA;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_BLEND_ZERO;
+ }
+}
+
+static inline D3D11_BLEND_OP toD3DBlendOp(QRhiGraphicsPipeline::BlendOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Add:
+ return D3D11_BLEND_OP_ADD;
+ case QRhiGraphicsPipeline::Subtract:
+ return D3D11_BLEND_OP_SUBTRACT;
+ case QRhiGraphicsPipeline::ReverseSubtract:
+ return D3D11_BLEND_OP_REV_SUBTRACT;
+ case QRhiGraphicsPipeline::Min:
+ return D3D11_BLEND_OP_MIN;
+ case QRhiGraphicsPipeline::Max:
+ return D3D11_BLEND_OP_MAX;
+ default:
+ Q_UNREACHABLE();
+ return D3D11_BLEND_OP_ADD;
+ }
+}
+
+static pD3DCompile resolveD3DCompile()
+{
+ for (const wchar_t *libraryName : {L"D3DCompiler_47", L"D3DCompiler_43"}) {
+ QSystemLibrary library(libraryName);
+ if (library.load()) {
+ if (auto symbol = library.resolve("D3DCompile"))
+ return reinterpret_cast<pD3DCompile>(symbol);
+ }
+ }
+ return nullptr;
+}
+
+static QByteArray compileHlslShaderSource(const QShader &shader, QShader::Variant shaderVariant, QString *error)
+{
+ QShaderCode dxbc = shader.shader({ QShader::DxbcShader, 50, shaderVariant });
+ if (!dxbc.shader().isEmpty())
+ return dxbc.shader();
+
+ QShaderCode hlslSource = shader.shader({ QShader::HlslShader, 50, shaderVariant });
+ if (hlslSource.shader().isEmpty()) {
+ qWarning() << "No HLSL (shader model 5.0) code found in baked shader" << shader;
+ return QByteArray();
+ }
+
+ const char *target;
+ switch (shader.stage()) {
+ case QShader::VertexStage:
+ target = "vs_5_0";
+ break;
+ case QShader::TessellationControlStage:
+ target = "hs_5_0";
+ break;
+ case QShader::TessellationEvaluationStage:
+ target = "ds_5_0";
+ break;
+ case QShader::GeometryStage:
+ target = "gs_5_0";
+ break;
+ case QShader::FragmentStage:
+ target = "ps_5_0";
+ break;
+ case QShader::ComputeStage:
+ target = "cs_5_0";
+ break;
+ default:
+ Q_UNREACHABLE();
+ return QByteArray();
+ }
+
+ static const pD3DCompile d3dCompile = resolveD3DCompile();
+ if (d3dCompile == nullptr) {
+ qWarning("Unable to resolve function D3DCompile()");
+ return QByteArray();
+ }
+
+ ID3DBlob *bytecode = nullptr;
+ ID3DBlob *errors = nullptr;
+ HRESULT hr = d3dCompile(hlslSource.shader().constData(), SIZE_T(hlslSource.shader().size()),
+ nullptr, nullptr, nullptr,
+ hlslSource.entryPoint().constData(), target, 0, 0, &bytecode, &errors);
+ if (FAILED(hr) || !bytecode) {
+ qWarning("HLSL shader compilation failed: 0x%x", uint(hr));
+ if (errors) {
+ *error = QString::fromUtf8(static_cast<const char *>(errors->GetBufferPointer()),
+ int(errors->GetBufferSize()));
+ errors->Release();
+ }
+ return QByteArray();
+ }
+
+ QByteArray result;
+ result.resize(int(bytecode->GetBufferSize()));
+ memcpy(result.data(), bytecode->GetBufferPointer(), size_t(result.size()));
+ bytecode->Release();
+ return result;
+}
+
+bool QD3D11GraphicsPipeline::build()
+{
+ if (dsState)
+ release();
+
+ QRHI_RES_RHI(QRhiD3D11);
+ if (!rhiD->sanityCheckGraphicsPipeline(this))
+ return false;
+
+ D3D11_RASTERIZER_DESC rastDesc;
+ memset(&rastDesc, 0, sizeof(rastDesc));
+ rastDesc.FillMode = D3D11_FILL_SOLID;
+ rastDesc.CullMode = toD3DCullMode(m_cullMode);
+ rastDesc.FrontCounterClockwise = m_frontFace == CCW;
+ rastDesc.ScissorEnable = m_flags.testFlag(UsesScissor);
+ rastDesc.MultisampleEnable = rhiD->effectiveSampleCount(m_sampleCount).Count > 1;
+ HRESULT hr = rhiD->dev->CreateRasterizerState(&rastDesc, &rastState);
+ if (FAILED(hr)) {
+ qWarning("Failed to create rasterizer state: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ D3D11_DEPTH_STENCIL_DESC dsDesc;
+ memset(&dsDesc, 0, sizeof(dsDesc));
+ dsDesc.DepthEnable = m_depthTest;
+ dsDesc.DepthWriteMask = m_depthWrite ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
+ dsDesc.DepthFunc = toD3DCompareOp(m_depthOp);
+ dsDesc.StencilEnable = m_stencilTest;
+ if (m_stencilTest) {
+ dsDesc.StencilReadMask = UINT8(m_stencilReadMask);
+ dsDesc.StencilWriteMask = UINT8(m_stencilWriteMask);
+ dsDesc.FrontFace.StencilFailOp = toD3DStencilOp(m_stencilFront.failOp);
+ dsDesc.FrontFace.StencilDepthFailOp = toD3DStencilOp(m_stencilFront.depthFailOp);
+ dsDesc.FrontFace.StencilPassOp = toD3DStencilOp(m_stencilFront.passOp);
+ dsDesc.FrontFace.StencilFunc = toD3DCompareOp(m_stencilFront.compareOp);
+ dsDesc.BackFace.StencilFailOp = toD3DStencilOp(m_stencilBack.failOp);
+ dsDesc.BackFace.StencilDepthFailOp = toD3DStencilOp(m_stencilBack.depthFailOp);
+ dsDesc.BackFace.StencilPassOp = toD3DStencilOp(m_stencilBack.passOp);
+ dsDesc.BackFace.StencilFunc = toD3DCompareOp(m_stencilBack.compareOp);
+ }
+ hr = rhiD->dev->CreateDepthStencilState(&dsDesc, &dsState);
+ if (FAILED(hr)) {
+ qWarning("Failed to create depth-stencil state: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ D3D11_BLEND_DESC blendDesc;
+ memset(&blendDesc, 0, sizeof(blendDesc));
+ blendDesc.IndependentBlendEnable = m_targetBlends.count() > 1;
+ for (int i = 0, ie = m_targetBlends.count(); i != ie; ++i) {
+ const QRhiGraphicsPipeline::TargetBlend &b(m_targetBlends[i]);
+ D3D11_RENDER_TARGET_BLEND_DESC blend;
+ memset(&blend, 0, sizeof(blend));
+ blend.BlendEnable = b.enable;
+ blend.SrcBlend = toD3DBlendFactor(b.srcColor);
+ blend.DestBlend = toD3DBlendFactor(b.dstColor);
+ blend.BlendOp = toD3DBlendOp(b.opColor);
+ blend.SrcBlendAlpha = toD3DBlendFactor(b.srcAlpha);
+ blend.DestBlendAlpha = toD3DBlendFactor(b.dstAlpha);
+ blend.BlendOpAlpha = toD3DBlendOp(b.opAlpha);
+ blend.RenderTargetWriteMask = toD3DColorWriteMask(b.colorWrite);
+ blendDesc.RenderTarget[i] = blend;
+ }
+ if (m_targetBlends.isEmpty()) {
+ D3D11_RENDER_TARGET_BLEND_DESC blend;
+ memset(&blend, 0, sizeof(blend));
+ blend.RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+ blendDesc.RenderTarget[0] = blend;
+ }
+ hr = rhiD->dev->CreateBlendState(&blendDesc, &blendState);
+ if (FAILED(hr)) {
+ qWarning("Failed to create blend state: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ QByteArray vsByteCode;
+ for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ auto cacheIt = rhiD->m_shaderCache.constFind(shaderStage);
+ if (cacheIt != rhiD->m_shaderCache.constEnd()) {
+ switch (shaderStage.type()) {
+ case QRhiShaderStage::Vertex:
+ vs = static_cast<ID3D11VertexShader *>(cacheIt->s);
+ vs->AddRef();
+ vsByteCode = cacheIt->bytecode;
+ break;
+ case QRhiShaderStage::Fragment:
+ fs = static_cast<ID3D11PixelShader *>(cacheIt->s);
+ fs->AddRef();
+ break;
+ default:
+ break;
+ }
+ } else {
+ QString error;
+ const QByteArray bytecode = compileHlslShaderSource(shaderStage.shader(), shaderStage.shaderVariant(), &error);
+ if (bytecode.isEmpty()) {
+ qWarning("HLSL shader compilation failed: %s", qPrintable(error));
+ return false;
+ }
+
+ if (rhiD->m_shaderCache.count() >= QRhiD3D11::MAX_SHADER_CACHE_ENTRIES) {
+ // Use the simplest strategy: too many cached shaders -> drop them all.
+ rhiD->clearShaderCache();
+ }
+
+ switch (shaderStage.type()) {
+ case QRhiShaderStage::Vertex:
+ hr = rhiD->dev->CreateVertexShader(bytecode.constData(), SIZE_T(bytecode.size()), nullptr, &vs);
+ if (FAILED(hr)) {
+ qWarning("Failed to create vertex shader: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ vsByteCode = bytecode;
+ rhiD->m_shaderCache.insert(shaderStage, QRhiD3D11::Shader(vs, bytecode));
+ vs->AddRef();
+ break;
+ case QRhiShaderStage::Fragment:
+ hr = rhiD->dev->CreatePixelShader(bytecode.constData(), SIZE_T(bytecode.size()), nullptr, &fs);
+ if (FAILED(hr)) {
+ qWarning("Failed to create pixel shader: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ rhiD->m_shaderCache.insert(shaderStage, QRhiD3D11::Shader(fs, bytecode));
+ fs->AddRef();
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ d3dTopology = toD3DTopology(m_topology);
+
+ if (!vsByteCode.isEmpty()) {
+ QVarLengthArray<D3D11_INPUT_ELEMENT_DESC, 4> inputDescs;
+ for (auto it = m_vertexInputLayout.cbeginAttributes(), itEnd = m_vertexInputLayout.cendAttributes();
+ it != itEnd; ++it)
+ {
+ D3D11_INPUT_ELEMENT_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ // the output from SPIRV-Cross uses TEXCOORD<location> as the semantic
+ desc.SemanticName = "TEXCOORD";
+ desc.SemanticIndex = UINT(it->location());
+ desc.Format = toD3DAttributeFormat(it->format());
+ desc.InputSlot = UINT(it->binding());
+ desc.AlignedByteOffset = it->offset();
+ const QRhiVertexInputBinding *inputBinding = m_vertexInputLayout.bindingAt(it->binding());
+ if (inputBinding->classification() == QRhiVertexInputBinding::PerInstance) {
+ desc.InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA;
+ desc.InstanceDataStepRate = UINT(inputBinding->instanceStepRate());
+ } else {
+ desc.InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
+ }
+ inputDescs.append(desc);
+ }
+ hr = rhiD->dev->CreateInputLayout(inputDescs.constData(), UINT(inputDescs.count()),
+ vsByteCode, SIZE_T(vsByteCode.size()), &inputLayout);
+ if (FAILED(hr)) {
+ qWarning("Failed to create input layout: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ }
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QD3D11ComputePipeline::QD3D11ComputePipeline(QRhiImplementation *rhi)
+ : QRhiComputePipeline(rhi)
+{
+}
+
+QD3D11ComputePipeline::~QD3D11ComputePipeline()
+{
+ release();
+}
+
+void QD3D11ComputePipeline::release()
+{
+ QRHI_RES_RHI(QRhiD3D11);
+
+ if (!cs)
+ return;
+
+ cs->Release();
+ cs = nullptr;
+
+ rhiD->unregisterResource(this);
+}
+
+bool QD3D11ComputePipeline::build()
+{
+ if (cs)
+ release();
+
+ QRHI_RES_RHI(QRhiD3D11);
+
+ auto cacheIt = rhiD->m_shaderCache.constFind(m_shaderStage);
+ if (cacheIt != rhiD->m_shaderCache.constEnd()) {
+ cs = static_cast<ID3D11ComputeShader *>(cacheIt->s);
+ } else {
+ QString error;
+ const QByteArray bytecode = compileHlslShaderSource(m_shaderStage.shader(), m_shaderStage.shaderVariant(), &error);
+ if (bytecode.isEmpty()) {
+ qWarning("HLSL compute shader compilation failed: %s", qPrintable(error));
+ return false;
+ }
+
+ HRESULT hr = rhiD->dev->CreateComputeShader(bytecode.constData(), SIZE_T(bytecode.size()), nullptr, &cs);
+ if (FAILED(hr)) {
+ qWarning("Failed to create compute shader: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ if (rhiD->m_shaderCache.count() >= QRhiD3D11::MAX_SHADER_CACHE_ENTRIES)
+ rhiD->clearShaderCache();
+
+ rhiD->m_shaderCache.insert(m_shaderStage, QRhiD3D11::Shader(cs, bytecode));
+ }
+
+ cs->AddRef();
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QD3D11CommandBuffer::QD3D11CommandBuffer(QRhiImplementation *rhi)
+ : QRhiCommandBuffer(rhi)
+{
+ resetState();
+}
+
+QD3D11CommandBuffer::~QD3D11CommandBuffer()
+{
+ release();
+}
+
+void QD3D11CommandBuffer::release()
+{
+ // nothing to do here
+}
+
+QD3D11SwapChain::QD3D11SwapChain(QRhiImplementation *rhi)
+ : QRhiSwapChain(rhi),
+ rt(rhi),
+ cb(rhi)
+{
+ backBufferTex = nullptr;
+ backBufferRtv = nullptr;
+ for (int i = 0; i < BUFFER_COUNT; ++i) {
+ msaaTex[i] = nullptr;
+ msaaRtv[i] = nullptr;
+ timestampActive[i] = false;
+ timestampDisjointQuery[i] = nullptr;
+ timestampQuery[2 * i] = nullptr;
+ timestampQuery[2 * i + 1] = nullptr;
+ }
+}
+
+QD3D11SwapChain::~QD3D11SwapChain()
+{
+ release();
+}
+
+void QD3D11SwapChain::releaseBuffers()
+{
+ if (backBufferRtv) {
+ backBufferRtv->Release();
+ backBufferRtv = nullptr;
+ }
+ if (backBufferTex) {
+ backBufferTex->Release();
+ backBufferTex = nullptr;
+ }
+ for (int i = 0; i < BUFFER_COUNT; ++i) {
+ if (msaaRtv[i]) {
+ msaaRtv[i]->Release();
+ msaaRtv[i] = nullptr;
+ }
+ if (msaaTex[i]) {
+ msaaTex[i]->Release();
+ msaaTex[i] = nullptr;
+ }
+ }
+}
+
+void QD3D11SwapChain::release()
+{
+ if (!swapChain)
+ return;
+
+ releaseBuffers();
+
+ for (int i = 0; i < BUFFER_COUNT; ++i) {
+ if (timestampDisjointQuery[i]) {
+ timestampDisjointQuery[i]->Release();
+ timestampDisjointQuery[i] = nullptr;
+ }
+ for (int j = 0; j < 2; ++j) {
+ const int idx = BUFFER_COUNT * i + j;
+ if (timestampQuery[idx]) {
+ timestampQuery[idx]->Release();
+ timestampQuery[idx] = nullptr;
+ }
+ }
+ }
+
+ swapChain->Release();
+ swapChain = nullptr;
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseSwapChain(this));
+
+ QRHI_RES_RHI(QRhiD3D11);
+ rhiD->unregisterResource(this);
+}
+
+QRhiCommandBuffer *QD3D11SwapChain::currentFrameCommandBuffer()
+{
+ return &cb;
+}
+
+QRhiRenderTarget *QD3D11SwapChain::currentFrameRenderTarget()
+{
+ return &rt;
+}
+
+QSize QD3D11SwapChain::surfacePixelSize()
+{
+ Q_ASSERT(m_window);
+ return m_window->size() * m_window->devicePixelRatio();
+}
+
+QRhiRenderPassDescriptor *QD3D11SwapChain::newCompatibleRenderPassDescriptor()
+{
+ return new QD3D11RenderPassDescriptor(m_rhi);
+}
+
+bool QD3D11SwapChain::newColorBuffer(const QSize &size, DXGI_FORMAT format, DXGI_SAMPLE_DESC sampleDesc,
+ ID3D11Texture2D **tex, ID3D11RenderTargetView **rtv) const
+{
+ D3D11_TEXTURE2D_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Width = UINT(size.width());
+ desc.Height = UINT(size.height());
+ desc.MipLevels = 1;
+ desc.ArraySize = 1;
+ desc.Format = format;
+ desc.SampleDesc = sampleDesc;
+ desc.Usage = D3D11_USAGE_DEFAULT;
+ desc.BindFlags = D3D11_BIND_RENDER_TARGET;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ HRESULT hr = rhiD->dev->CreateTexture2D(&desc, nullptr, tex);
+ if (FAILED(hr)) {
+ qWarning("Failed to create color buffer texture: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
+ memset(&rtvDesc, 0, sizeof(rtvDesc));
+ rtvDesc.Format = format;
+ rtvDesc.ViewDimension = sampleDesc.Count > 1 ? D3D11_RTV_DIMENSION_TEXTURE2DMS : D3D11_RTV_DIMENSION_TEXTURE2D;
+ hr = rhiD->dev->CreateRenderTargetView(*tex, &rtvDesc, rtv);
+ if (FAILED(hr)) {
+ qWarning("Failed to create color buffer rtv: %s", qPrintable(comErrorMessage(hr)));
+ (*tex)->Release();
+ *tex = nullptr;
+ return false;
+ }
+
+ return true;
+}
+
+bool QD3D11SwapChain::buildOrResize()
+{
+ // Can be called multiple times due to window resizes - that is not the
+ // same as a simple release+build (as with other resources). Just need to
+ // resize the buffers then.
+
+ const bool needsRegistration = !window || window != m_window;
+
+ // except if the window actually changes
+ if (window && window != m_window)
+ release();
+
+ window = m_window;
+ m_currentPixelSize = surfacePixelSize();
+ pixelSize = m_currentPixelSize;
+
+ if (pixelSize.isEmpty())
+ return false;
+
+ colorFormat = DXGI_FORMAT_R8G8B8A8_UNORM;
+ const DXGI_FORMAT srgbAdjustedFormat = m_flags.testFlag(sRGB) ?
+ DXGI_FORMAT_R8G8B8A8_UNORM_SRGB : DXGI_FORMAT_R8G8B8A8_UNORM;
+
+ const UINT swapChainFlags = 0;
+
+ QRHI_RES_RHI(QRhiD3D11);
+ bool useFlipDiscard = rhiD->hasDxgi2 && rhiD->supportsFlipDiscardSwapchain;
+ if (!swapChain) {
+ HWND hwnd = reinterpret_cast<HWND>(window->winId());
+ sampleDesc = rhiD->effectiveSampleCount(m_sampleCount);
+
+ // Take a shortcut for alpha: our QWindow is OpenGLSurface so whatever
+ // the platform plugin does to enable transparency for OpenGL window
+ // will be sufficient for us too on the legacy (DISCARD) path. For
+ // FLIP_DISCARD we'd need to use DirectComposition (create a
+ // IDCompositionDevice/Target/Visual), avoid that for now.
+ if (m_flags.testFlag(SurfaceHasPreMulAlpha) || m_flags.testFlag(SurfaceHasNonPreMulAlpha)) {
+ useFlipDiscard = false;
+ if (window->requestedFormat().alphaBufferSize() <= 0)
+ qWarning("Swapchain says surface has alpha but the window has no alphaBufferSize set. "
+ "This may lead to problems.");
+ }
+
+ HRESULT hr;
+ if (useFlipDiscard) {
+ // We use FLIP_DISCARD which implies a buffer count of 2 (as opposed to the
+ // old DISCARD with back buffer count == 1). This makes no difference for
+ // the rest of the stuff except that automatic MSAA is unsupported and
+ // needs to be implemented via a custom multisample render target and an
+ // explicit resolve.
+
+ DXGI_SWAP_CHAIN_DESC1 desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.Width = UINT(pixelSize.width());
+ desc.Height = UINT(pixelSize.height());
+ desc.Format = colorFormat;
+ desc.SampleDesc.Count = 1;
+ desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ desc.BufferCount = BUFFER_COUNT;
+ desc.Scaling = DXGI_SCALING_STRETCH;
+ desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;
+ // Do not bother with AlphaMode, if won't work unless we go through
+ // DirectComposition. Instead, we just take the other (DISCARD)
+ // path for now when alpha is requested.
+ desc.Flags = swapChainFlags;
+
+ IDXGISwapChain1 *sc1;
+ hr = static_cast<IDXGIFactory2 *>(rhiD->dxgiFactory)->CreateSwapChainForHwnd(rhiD->dev, hwnd, &desc,
+ nullptr, nullptr, &sc1);
+ if (SUCCEEDED(hr))
+ swapChain = sc1;
+ } else {
+ // Windows 7 for instance. Use DISCARD mode. Regardless, keep on
+ // using our manual resolve for symmetry with the FLIP_DISCARD code
+ // path when MSAA is requested.
+
+ DXGI_SWAP_CHAIN_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ desc.BufferDesc.Width = UINT(pixelSize.width());
+ desc.BufferDesc.Height = UINT(pixelSize.height());
+ desc.BufferDesc.RefreshRate.Numerator = 60;
+ desc.BufferDesc.RefreshRate.Denominator = 1;
+ desc.BufferDesc.Format = colorFormat;
+ desc.SampleDesc.Count = 1;
+ desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ desc.BufferCount = 1;
+ desc.OutputWindow = hwnd;
+ desc.Windowed = true;
+ desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
+ desc.Flags = swapChainFlags;
+
+ hr = rhiD->dxgiFactory->CreateSwapChain(rhiD->dev, &desc, &swapChain);
+ }
+ if (FAILED(hr)) {
+ qWarning("Failed to create D3D11 swapchain: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ rhiD->dxgiFactory->MakeWindowAssociation(hwnd, DXGI_MWA_NO_ALT_ENTER);
+ } else {
+ releaseBuffers();
+ const UINT count = useFlipDiscard ? BUFFER_COUNT : 1;
+ HRESULT hr = swapChain->ResizeBuffers(count, UINT(pixelSize.width()), UINT(pixelSize.height()),
+ colorFormat, swapChainFlags);
+ if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET) {
+ qWarning("Device loss detected in ResizeBuffers()");
+ rhiD->deviceLost = true;
+ return false;
+ } else if (FAILED(hr)) {
+ qWarning("Failed to resize D3D11 swapchain: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ }
+
+ // This looks odd (for FLIP_DISCARD, esp. compared with backends for Vulkan
+ // & co.) but the backbuffer is always at index 0, with magic underneath.
+ // Some explanation from
+ // https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-1-4-improvements
+ //
+ // "In Direct3D 11, applications could call GetBuffer( 0, … ) only once.
+ // Every call to Present implicitly changed the resource identity of the
+ // returned interface. Direct3D 12 no longer supports that implicit
+ // resource identity change, due to the CPU overhead required and the
+ // flexible resource descriptor design. As a result, the application must
+ // manually call GetBuffer for every each buffer created with the
+ // swapchain."
+
+ // So just query index 0 once (per resize) and be done with it.
+ HRESULT hr = swapChain->GetBuffer(0, IID_ID3D11Texture2D, reinterpret_cast<void **>(&backBufferTex));
+ if (FAILED(hr)) {
+ qWarning("Failed to query swapchain backbuffer: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+ D3D11_RENDER_TARGET_VIEW_DESC rtvDesc;
+ memset(&rtvDesc, 0, sizeof(rtvDesc));
+ rtvDesc.Format = srgbAdjustedFormat;
+ rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
+ hr = rhiD->dev->CreateRenderTargetView(backBufferTex, &rtvDesc, &backBufferRtv);
+ if (FAILED(hr)) {
+ qWarning("Failed to create rtv for swapchain backbuffer: %s", qPrintable(comErrorMessage(hr)));
+ return false;
+ }
+
+ // Try to reduce stalls by having a dedicated MSAA texture per swapchain buffer.
+ for (int i = 0; i < BUFFER_COUNT; ++i) {
+ if (sampleDesc.Count > 1) {
+ if (!newColorBuffer(pixelSize, srgbAdjustedFormat, sampleDesc, &msaaTex[i], &msaaRtv[i]))
+ return false;
+ }
+ }
+
+ if (m_depthStencil && m_depthStencil->sampleCount() != m_sampleCount) {
+ qWarning("Depth-stencil buffer's sampleCount (%d) does not match color buffers' sample count (%d). Expect problems.",
+ m_depthStencil->sampleCount(), m_sampleCount);
+ }
+ if (m_depthStencil && m_depthStencil->pixelSize() != pixelSize) {
+ if (m_depthStencil->flags().testFlag(QRhiRenderBuffer::UsedWithSwapChainOnly)) {
+ m_depthStencil->setPixelSize(pixelSize);
+ if (!m_depthStencil->build())
+ qWarning("Failed to rebuild swapchain's associated depth-stencil buffer for size %dx%d",
+ pixelSize.width(), pixelSize.height());
+ } else {
+ qWarning("Depth-stencil buffer's size (%dx%d) does not match the surface size (%dx%d). Expect problems.",
+ m_depthStencil->pixelSize().width(), m_depthStencil->pixelSize().height(),
+ pixelSize.width(), pixelSize.height());
+ }
+ }
+
+ currentFrameSlot = 0;
+ frameCount = 0;
+ ds = m_depthStencil ? QRHI_RES(QD3D11RenderBuffer, m_depthStencil) : nullptr;
+ swapInterval = m_flags.testFlag(QRhiSwapChain::NoVSync) ? 0 : 1;
+
+ QD3D11ReferenceRenderTarget *rtD = QRHI_RES(QD3D11ReferenceRenderTarget, &rt);
+ rtD->d.rp = QRHI_RES(QD3D11RenderPassDescriptor, m_renderPassDesc);
+ rtD->d.pixelSize = pixelSize;
+ rtD->d.dpr = float(window->devicePixelRatio());
+ rtD->d.sampleCount = int(sampleDesc.Count);
+ rtD->d.colorAttCount = 1;
+ rtD->d.dsAttCount = m_depthStencil ? 1 : 0;
+
+ QRHI_PROF;
+ QRHI_PROF_F(resizeSwapChain(this, BUFFER_COUNT, sampleDesc.Count > 1 ? BUFFER_COUNT : 0, int(sampleDesc.Count)));
+ if (rhiP) {
+ D3D11_QUERY_DESC queryDesc;
+ memset(&queryDesc, 0, sizeof(queryDesc));
+ for (int i = 0; i < BUFFER_COUNT; ++i) {
+ if (!timestampDisjointQuery[i]) {
+ queryDesc.Query = D3D11_QUERY_TIMESTAMP_DISJOINT;
+ HRESULT hr = rhiD->dev->CreateQuery(&queryDesc, &timestampDisjointQuery[i]);
+ if (FAILED(hr)) {
+ qWarning("Failed to create timestamp disjoint query: %s", qPrintable(comErrorMessage(hr)));
+ break;
+ }
+ }
+ queryDesc.Query = D3D11_QUERY_TIMESTAMP;
+ for (int j = 0; j < 2; ++j) {
+ const int idx = BUFFER_COUNT * i + j; // one pair per buffer (frame)
+ if (!timestampQuery[idx]) {
+ HRESULT hr = rhiD->dev->CreateQuery(&queryDesc, &timestampQuery[idx]);
+ if (FAILED(hr)) {
+ qWarning("Failed to create timestamp query: %s", qPrintable(comErrorMessage(hr)));
+ break;
+ }
+ }
+ }
+ }
+ // timestamp queries are optional so we can go on even if they failed
+ }
+
+ if (needsRegistration)
+ rhiD->registerResource(this);
+
+ return true;
+}
+
+void QRhiD3D11::DeviceCurse::initResources()
+{
+ framesLeft = framesToActivate;
+
+ HRESULT hr = q->dev->CreateComputeShader(g_killDeviceByTimingOut, sizeof(g_killDeviceByTimingOut), nullptr, &cs);
+ if (FAILED(hr)) {
+ qWarning("Failed to create compute shader: %s", qPrintable(comErrorMessage(hr)));
+ return;
+ }
+}
+
+void QRhiD3D11::DeviceCurse::releaseResources()
+{
+ if (cs) {
+ cs->Release();
+ cs = nullptr;
+ }
+}
+
+void QRhiD3D11::DeviceCurse::activate()
+{
+ if (!cs)
+ return;
+
+ qDebug("Activating Curse. Goodbye Cruel World.");
+
+ q->context->CSSetShader(cs, nullptr, 0);
+ q->context->Dispatch(256, 1, 1);
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhid3d11_p.h b/src/gui/rhi/qrhid3d11_p.h
new file mode 100644
index 0000000000..5df1843b1e
--- /dev/null
+++ b/src/gui/rhi/qrhid3d11_p.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHID3D11_H
+#define QRHID3D11_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/qrhi_p.h>
+
+// no d3d includes here, to prevent precompiled header mess (due to this being
+// a public header)
+
+QT_BEGIN_NAMESPACE
+
+struct Q_GUI_EXPORT QRhiD3D11InitParams : public QRhiInitParams
+{
+ bool enableDebugLayer = false;
+
+ int framesUntilKillingDeviceViaTdr = -1;
+ bool repeatDeviceKill = false;
+};
+
+struct Q_GUI_EXPORT QRhiD3D11NativeHandles : public QRhiNativeHandles
+{
+ void *dev = nullptr;
+ void *context = nullptr;
+};
+
+struct Q_GUI_EXPORT QRhiD3D11TextureNativeHandles : public QRhiNativeHandles
+{
+ void *texture = nullptr; // ID3D11Texture2D*
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhid3d11_p_p.h b/src/gui/rhi/qrhid3d11_p_p.h
new file mode 100644
index 0000000000..26de34ae0a
--- /dev/null
+++ b/src/gui/rhi/qrhid3d11_p_p.h
@@ -0,0 +1,725 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHID3D11_P_H
+#define QRHID3D11_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 "qrhid3d11_p.h"
+#include "qrhi_p_p.h"
+#include "qshaderdescription_p.h"
+#include <QWindow>
+
+#include <d3d11_1.h>
+#include <dxgi1_3.h>
+
+QT_BEGIN_NAMESPACE
+
+struct QD3D11Buffer : public QRhiBuffer
+{
+ QD3D11Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
+ ~QD3D11Buffer();
+ void release() override;
+ bool build() override;
+
+ ID3D11UnorderedAccessView *unorderedAccessView();
+
+ ID3D11Buffer *buffer = nullptr;
+ QByteArray dynBuf;
+ bool hasPendingDynamicUpdates = false;
+ ID3D11UnorderedAccessView *uav = nullptr;
+ uint generation = 0;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11RenderBuffer : public QRhiRenderBuffer
+{
+ QD3D11RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags);
+ ~QD3D11RenderBuffer();
+ void release() override;
+ bool build() override;
+ QRhiTexture::Format backingFormat() const override;
+
+ ID3D11Texture2D *tex = nullptr;
+ ID3D11DepthStencilView *dsv = nullptr;
+ ID3D11RenderTargetView *rtv = nullptr;
+ DXGI_FORMAT dxgiFormat;
+ DXGI_SAMPLE_DESC sampleDesc;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11Texture : public QRhiTexture
+{
+ QD3D11Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags);
+ ~QD3D11Texture();
+ void release() override;
+ bool build() override;
+ bool buildFrom(const QRhiNativeHandles *src) override;
+ const QRhiNativeHandles *nativeHandles() override;
+
+ bool prepareBuild(QSize *adjustedSize = nullptr);
+ bool finishBuild();
+ ID3D11UnorderedAccessView *unorderedAccessViewForLevel(int level);
+
+ ID3D11Texture2D *tex = nullptr;
+ bool owns = true;
+ ID3D11ShaderResourceView *srv = nullptr;
+ DXGI_FORMAT dxgiFormat;
+ uint mipLevelCount = 0;
+ DXGI_SAMPLE_DESC sampleDesc;
+ QRhiD3D11TextureNativeHandles nativeHandlesStruct;
+ ID3D11UnorderedAccessView *perLevelViews[QRhi::MAX_LEVELS];
+ uint generation = 0;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11Sampler : public QRhiSampler
+{
+ QD3D11Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v);
+ ~QD3D11Sampler();
+ void release() override;
+ bool build() override;
+
+ ID3D11SamplerState *samplerState = nullptr;
+ uint generation = 0;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11RenderPassDescriptor : public QRhiRenderPassDescriptor
+{
+ QD3D11RenderPassDescriptor(QRhiImplementation *rhi);
+ ~QD3D11RenderPassDescriptor();
+ void release() override;
+};
+
+struct QD3D11RenderTargetData
+{
+ QD3D11RenderTargetData(QRhiImplementation *)
+ {
+ for (int i = 0; i < MAX_COLOR_ATTACHMENTS; ++i)
+ rtv[i] = nullptr;
+ }
+
+ QD3D11RenderPassDescriptor *rp = nullptr;
+ QSize pixelSize;
+ float dpr = 1;
+ int sampleCount = 1;
+ int colorAttCount = 0;
+ int dsAttCount = 0;
+
+ static const int MAX_COLOR_ATTACHMENTS = 8;
+ ID3D11RenderTargetView *rtv[MAX_COLOR_ATTACHMENTS];
+ ID3D11DepthStencilView *dsv = nullptr;
+};
+
+struct QD3D11ReferenceRenderTarget : public QRhiRenderTarget
+{
+ QD3D11ReferenceRenderTarget(QRhiImplementation *rhi);
+ ~QD3D11ReferenceRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QD3D11RenderTargetData d;
+};
+
+struct QD3D11TextureRenderTarget : public QRhiTextureRenderTarget
+{
+ QD3D11TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
+ ~QD3D11TextureRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool build() override;
+
+ QD3D11RenderTargetData d;
+ bool ownsRtv[QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS];
+ ID3D11RenderTargetView *rtv[QD3D11RenderTargetData::MAX_COLOR_ATTACHMENTS];
+ bool ownsDsv = false;
+ ID3D11DepthStencilView *dsv = nullptr;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11ShaderResourceBindings : public QRhiShaderResourceBindings
+{
+ QD3D11ShaderResourceBindings(QRhiImplementation *rhi);
+ ~QD3D11ShaderResourceBindings();
+ void release() override;
+ bool build() override;
+
+ QVarLengthArray<QRhiShaderResourceBinding, 8> sortedBindings;
+ uint generation = 0;
+
+ // Keep track of the generation number of each referenced QRhi* to be able
+ // to detect that the batched bindings are out of date.
+ struct BoundUniformBufferData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundSampledTextureData {
+ quint64 texId;
+ uint texGeneration;
+ quint64 samplerId;
+ uint samplerGeneration;
+ };
+ struct BoundStorageImageData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundStorageBufferData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundResourceData {
+ union {
+ BoundUniformBufferData ubuf;
+ BoundSampledTextureData stex;
+ BoundStorageImageData simage;
+ BoundStorageBufferData sbuf;
+ };
+ };
+ QVarLengthArray<BoundResourceData, 8> boundResourceData;
+
+ QRhiBatchedBindings<ID3D11Buffer *> vsubufs;
+ QRhiBatchedBindings<UINT> vsubufoffsets;
+ QRhiBatchedBindings<UINT> vsubufsizes;
+
+ QRhiBatchedBindings<ID3D11Buffer *> fsubufs;
+ QRhiBatchedBindings<UINT> fsubufoffsets;
+ QRhiBatchedBindings<UINT> fsubufsizes;
+
+ QRhiBatchedBindings<ID3D11Buffer *> csubufs;
+ QRhiBatchedBindings<UINT> csubufoffsets;
+ QRhiBatchedBindings<UINT> csubufsizes;
+
+ QRhiBatchedBindings<ID3D11SamplerState *> vssamplers;
+ QRhiBatchedBindings<ID3D11ShaderResourceView *> vsshaderresources;
+
+ QRhiBatchedBindings<ID3D11SamplerState *> fssamplers;
+ QRhiBatchedBindings<ID3D11ShaderResourceView *> fsshaderresources;
+
+ QRhiBatchedBindings<ID3D11SamplerState *> cssamplers;
+ QRhiBatchedBindings<ID3D11ShaderResourceView *> csshaderresources;
+
+ QRhiBatchedBindings<ID3D11UnorderedAccessView *> csUAVs;
+
+ friend class QRhiD3D11;
+};
+
+Q_DECLARE_TYPEINFO(QD3D11ShaderResourceBindings::BoundResourceData, Q_MOVABLE_TYPE);
+
+struct QD3D11GraphicsPipeline : public QRhiGraphicsPipeline
+{
+ QD3D11GraphicsPipeline(QRhiImplementation *rhi);
+ ~QD3D11GraphicsPipeline();
+ void release() override;
+ bool build() override;
+
+ ID3D11DepthStencilState *dsState = nullptr;
+ ID3D11BlendState *blendState = nullptr;
+ ID3D11VertexShader *vs = nullptr;
+ ID3D11PixelShader *fs = nullptr;
+ ID3D11InputLayout *inputLayout = nullptr;
+ D3D11_PRIMITIVE_TOPOLOGY d3dTopology = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
+ ID3D11RasterizerState *rastState = nullptr;
+ uint generation = 0;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11ComputePipeline : public QRhiComputePipeline
+{
+ QD3D11ComputePipeline(QRhiImplementation *rhi);
+ ~QD3D11ComputePipeline();
+ void release() override;
+ bool build() override;
+
+ ID3D11ComputeShader *cs = nullptr;
+ uint generation = 0;
+ friend class QRhiD3D11;
+};
+
+struct QD3D11SwapChain;
+
+struct QD3D11CommandBuffer : public QRhiCommandBuffer
+{
+ QD3D11CommandBuffer(QRhiImplementation *rhi);
+ ~QD3D11CommandBuffer();
+ void release() override;
+
+ struct Command {
+ enum Cmd {
+ ResetShaderResources,
+ SetRenderTarget,
+ Clear,
+ Viewport,
+ Scissor,
+ BindVertexBuffers,
+ BindIndexBuffer,
+ BindGraphicsPipeline,
+ BindShaderResources,
+ StencilRef,
+ BlendConstants,
+ Draw,
+ DrawIndexed,
+ UpdateSubRes,
+ CopySubRes,
+ ResolveSubRes,
+ GenMip,
+ DebugMarkBegin,
+ DebugMarkEnd,
+ DebugMarkMsg,
+ BindComputePipeline,
+ Dispatch
+ };
+ enum ClearFlag { Color = 1, Depth = 2, Stencil = 4 };
+ Cmd cmd;
+
+ static const int MAX_UBUF_BINDINGS = 32; // should be D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT but 128 is a waste of space for our purposes
+
+ // QRhi*/QD3D11* references should be kept at minimum (so no
+ // QRhiTexture/Buffer/etc. pointers).
+ union {
+ struct {
+ QRhiRenderTarget *rt;
+ } setRenderTarget;
+ struct {
+ QRhiRenderTarget *rt;
+ int mask;
+ float c[4];
+ float d;
+ quint32 s;
+ } clear;
+ struct {
+ float x, y, w, h;
+ float d0, d1;
+ } viewport;
+ struct {
+ int x, y, w, h;
+ } scissor;
+ struct {
+ int startSlot;
+ int slotCount;
+ ID3D11Buffer *buffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ UINT offsets[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ UINT strides[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ } bindVertexBuffers;
+ struct {
+ ID3D11Buffer *buffer;
+ quint32 offset;
+ DXGI_FORMAT format;
+ } bindIndexBuffer;
+ struct {
+ QD3D11GraphicsPipeline *ps;
+ } bindGraphicsPipeline;
+ struct {
+ QD3D11ShaderResourceBindings *srb;
+ bool offsetOnlyChange;
+ int dynamicOffsetCount;
+ uint dynamicOffsetPairs[MAX_UBUF_BINDINGS * 2]; // binding, offsetInConstants
+ } bindShaderResources;
+ struct {
+ QD3D11GraphicsPipeline *ps;
+ quint32 ref;
+ } stencilRef;
+ struct {
+ QD3D11GraphicsPipeline *ps;
+ float c[4];
+ } blendConstants;
+ struct {
+ QD3D11GraphicsPipeline *ps;
+ quint32 vertexCount;
+ quint32 instanceCount;
+ quint32 firstVertex;
+ quint32 firstInstance;
+ } draw;
+ struct {
+ QD3D11GraphicsPipeline *ps;
+ quint32 indexCount;
+ quint32 instanceCount;
+ quint32 firstIndex;
+ qint32 vertexOffset;
+ quint32 firstInstance;
+ } drawIndexed;
+ struct {
+ ID3D11Resource *dst;
+ UINT dstSubRes;
+ bool hasDstBox;
+ D3D11_BOX dstBox;
+ const void *src; // must come from retain*()
+ UINT srcRowPitch;
+ } updateSubRes;
+ struct {
+ ID3D11Resource *dst;
+ UINT dstSubRes;
+ UINT dstX;
+ UINT dstY;
+ ID3D11Resource *src;
+ UINT srcSubRes;
+ bool hasSrcBox;
+ D3D11_BOX srcBox;
+ } copySubRes;
+ struct {
+ ID3D11Resource *dst;
+ UINT dstSubRes;
+ ID3D11Resource *src;
+ UINT srcSubRes;
+ DXGI_FORMAT format;
+ } resolveSubRes;
+ struct {
+ ID3D11ShaderResourceView *srv;
+ } genMip;
+ struct {
+ char s[64];
+ } debugMark;
+ struct {
+ QD3D11ComputePipeline *ps;
+ } bindComputePipeline;
+ struct {
+ UINT x;
+ UINT y;
+ UINT z;
+ } dispatch;
+ } args;
+ };
+
+ enum PassType {
+ NoPass,
+ RenderPass,
+ ComputePass
+ };
+
+ QVector<Command> commands;
+ PassType recordingPass;
+ QRhiRenderTarget *currentTarget;
+ QRhiGraphicsPipeline *currentGraphicsPipeline;
+ QRhiComputePipeline *currentComputePipeline;
+ uint currentPipelineGeneration;
+ QRhiShaderResourceBindings *currentGraphicsSrb;
+ QRhiShaderResourceBindings *currentComputeSrb;
+ uint currentSrbGeneration;
+ ID3D11Buffer *currentIndexBuffer;
+ quint32 currentIndexOffset;
+ DXGI_FORMAT currentIndexFormat;
+ ID3D11Buffer *currentVertexBuffers[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ quint32 currentVertexOffsets[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+
+ QVector<QByteArray> dataRetainPool;
+ QVector<QImage> imageRetainPool;
+
+ // relies heavily on implicit sharing (no copies of the actual data will be made)
+ const uchar *retainData(const QByteArray &data) {
+ dataRetainPool.append(data);
+ return reinterpret_cast<const uchar *>(dataRetainPool.constLast().constData());
+ }
+ const uchar *retainImage(const QImage &image) {
+ imageRetainPool.append(image);
+ return imageRetainPool.constLast().constBits();
+ }
+ void resetCommands() {
+ commands.clear();
+ dataRetainPool.clear();
+ imageRetainPool.clear();
+ }
+ void resetState() {
+ recordingPass = NoPass;
+ currentTarget = nullptr;
+ resetCommands();
+ resetCachedState();
+ }
+ void resetCachedState() {
+ currentGraphicsPipeline = nullptr;
+ currentComputePipeline = nullptr;
+ currentPipelineGeneration = 0;
+ resetCachedShaderResourceState();
+ }
+ void resetCachedShaderResourceState() {
+ currentGraphicsSrb = nullptr;
+ currentComputeSrb = nullptr;
+ currentSrbGeneration = 0;
+ currentIndexBuffer = nullptr;
+ currentIndexOffset = 0;
+ currentIndexFormat = DXGI_FORMAT_R16_UINT;
+ memset(currentVertexBuffers, 0, sizeof(currentVertexBuffers));
+ memset(currentVertexOffsets, 0, sizeof(currentVertexOffsets));
+ }
+};
+
+Q_DECLARE_TYPEINFO(QD3D11CommandBuffer::Command, Q_MOVABLE_TYPE);
+
+struct QD3D11SwapChain : public QRhiSwapChain
+{
+ QD3D11SwapChain(QRhiImplementation *rhi);
+ ~QD3D11SwapChain();
+ void release() override;
+
+ QRhiCommandBuffer *currentFrameCommandBuffer() override;
+ QRhiRenderTarget *currentFrameRenderTarget() override;
+
+ QSize surfacePixelSize() override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool buildOrResize() override;
+
+ void releaseBuffers();
+ bool newColorBuffer(const QSize &size, DXGI_FORMAT format, DXGI_SAMPLE_DESC sampleDesc,
+ ID3D11Texture2D **tex, ID3D11RenderTargetView **rtv) const;
+
+ QWindow *window = nullptr;
+ QSize pixelSize;
+ QD3D11ReferenceRenderTarget rt;
+ QD3D11CommandBuffer cb;
+ DXGI_FORMAT colorFormat;
+ IDXGISwapChain *swapChain = nullptr;
+ static const int BUFFER_COUNT = 2;
+ ID3D11Texture2D *backBufferTex;
+ ID3D11RenderTargetView *backBufferRtv;
+ ID3D11Texture2D *msaaTex[BUFFER_COUNT];
+ ID3D11RenderTargetView *msaaRtv[BUFFER_COUNT];
+ DXGI_SAMPLE_DESC sampleDesc;
+ int currentFrameSlot = 0;
+ int frameCount = 0;
+ QD3D11RenderBuffer *ds = nullptr;
+ bool timestampActive[BUFFER_COUNT];
+ ID3D11Query *timestampDisjointQuery[BUFFER_COUNT];
+ ID3D11Query *timestampQuery[BUFFER_COUNT * 2];
+ UINT swapInterval = 1;
+};
+
+class QRhiD3D11 : public QRhiImplementation
+{
+public:
+ QRhiD3D11(QRhiD3D11InitParams *params, QRhiD3D11NativeHandles *importDevice = nullptr);
+
+ bool create(QRhi::Flags flags) override;
+ void destroy() override;
+
+ QRhiGraphicsPipeline *createGraphicsPipeline() override;
+ QRhiComputePipeline *createComputePipeline() override;
+ QRhiShaderResourceBindings *createShaderResourceBindings() override;
+ QRhiBuffer *createBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size) override;
+ QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags) override;
+ QRhiTexture *createTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags) override;
+ QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v) override;
+
+ QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags) override;
+
+ QRhiSwapChain *createSwapChain() override;
+ QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult finish() override;
+
+ void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void setGraphicsPipeline(QRhiCommandBuffer *cb,
+ QRhiGraphicsPipeline *ps) override;
+
+ void setShaderResources(QRhiCommandBuffer *cb,
+ QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
+
+ void setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ QRhiCommandBuffer::IndexFormat indexFormat) override;
+
+ void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
+ void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
+ void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
+ void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
+
+ void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
+
+ void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex,
+ qint32 vertexOffset, quint32 firstInstance) override;
+
+ void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
+ void debugMarkEnd(QRhiCommandBuffer *cb) override;
+ void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
+
+ void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
+ void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
+
+ const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
+ void beginExternal(QRhiCommandBuffer *cb) override;
+ void endExternal(QRhiCommandBuffer *cb) override;
+
+ QVector<int> supportedSampleCounts() const override;
+ int ubufAlignment() const override;
+ bool isYUpInFramebuffer() const override;
+ bool isYUpInNDC() const override;
+ bool isClipDepthZeroToOne() const override;
+ QMatrix4x4 clipSpaceCorrMatrix() const override;
+ bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
+ bool isFeatureSupported(QRhi::Feature feature) const override;
+ int resourceLimit(QRhi::ResourceLimit limit) const override;
+ const QRhiNativeHandles *nativeHandles() override;
+ void sendVMemStatsToProfiler() override;
+ bool makeThreadLocalNativeContextCurrent() override;
+ void releaseCachedResources() override;
+ bool isDeviceLost() const override;
+
+ void enqueueSubresUpload(QD3D11Texture *texD, QD3D11CommandBuffer *cbD,
+ int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
+ void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
+ void updateShaderResourceBindings(QD3D11ShaderResourceBindings *srbD);
+ void executeBufferHostWritesForCurrentFrame(QD3D11Buffer *bufD);
+ void bindShaderResources(QD3D11ShaderResourceBindings *srbD,
+ const uint *dynOfsPairs, int dynOfsPairCount,
+ bool offsetOnlyChange);
+ void resetShaderResources();
+ void executeCommandBuffer(QD3D11CommandBuffer *cbD, QD3D11SwapChain *timestampSwapChain = nullptr);
+ DXGI_SAMPLE_DESC effectiveSampleCount(int sampleCount) const;
+ void finishActiveReadbacks();
+ void reportLiveObjects(ID3D11Device *device);
+ void clearShaderCache();
+
+ bool debugLayer = false;
+ bool importedDevice = false;
+ ID3D11Device *dev = nullptr;
+ ID3D11DeviceContext1 *context = nullptr;
+ D3D_FEATURE_LEVEL featureLevel;
+ ID3DUserDefinedAnnotation *annotations = nullptr;
+ IDXGIFactory1 *dxgiFactory = nullptr;
+ bool hasDxgi2 = false;
+ bool supportsFlipDiscardSwapchain = false;
+ bool deviceLost = false;
+ QRhiD3D11NativeHandles nativeHandlesStruct;
+
+ struct {
+ int vsHighestActiveVertexBufferBinding = -1;
+ bool vsHasIndexBufferBound = false;
+ int vsHighestActiveSrvBinding = -1;
+ int fsHighestActiveSrvBinding = -1;
+ int csHighestActiveSrvBinding = -1;
+ int csHighestActiveUavBinding = -1;
+ QD3D11SwapChain *currentSwapChain = nullptr;
+ } contextState;
+
+ struct OffscreenFrame {
+ OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
+ bool active = false;
+ QD3D11CommandBuffer cbWrapper;
+ } ofr;
+
+ struct TextureReadback {
+ QRhiReadbackDescription desc;
+ QRhiReadbackResult *result;
+ ID3D11Texture2D *stagingTex;
+ quint32 byteSize;
+ quint32 bpl;
+ QSize pixelSize;
+ QRhiTexture::Format format;
+ };
+ QVector<TextureReadback> activeTextureReadbacks;
+ struct BufferReadback {
+ QRhiBufferReadbackResult *result;
+ quint32 byteSize;
+ ID3D11Buffer *stagingBuf;
+ };
+ QVector<BufferReadback> activeBufferReadbacks;
+
+ struct Shader {
+ Shader() = default;
+ Shader(IUnknown *s, const QByteArray &bytecode) : s(s), bytecode(bytecode) { }
+ IUnknown *s;
+ QByteArray bytecode;
+ };
+ QHash<QRhiShaderStage, Shader> m_shaderCache;
+
+ struct DeviceCurse {
+ DeviceCurse(QRhiD3D11 *impl) : q(impl) { }
+ QRhiD3D11 *q;
+ int framesToActivate = -1;
+ bool permanent = false;
+ int framesLeft = 0;
+ ID3D11ComputeShader *cs = nullptr;
+
+ void initResources();
+ void releaseResources();
+ void activate();
+ } deviceCurse;
+};
+
+Q_DECLARE_TYPEINFO(QRhiD3D11::TextureReadback, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiD3D11::BufferReadback, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
new file mode 100644
index 0000000000..abee843a74
--- /dev/null
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -0,0 +1,3927 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhigles2_p_p.h"
+#include <QWindow>
+#include <QOffscreenSurface>
+#include <QOpenGLContext>
+#include <QtGui/private/qopenglextensions_p.h>
+#include <QtGui/private/qopenglprogrambinarycache_p.h>
+#include <qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ OpenGL backend. Binding vertex attribute locations and decomposing uniform
+ buffers into uniforms are handled transparently to the application via the
+ reflection data (QShaderDescription). Real uniform buffers are never used,
+ regardless of the GLSL version. Textures and buffers feature no special
+ logic, it's all just glTexSubImage2D and glBufferSubData (with "dynamic"
+ buffers set to GL_DYNAMIC_DRAW). The swapchain and the associated
+ renderbuffer for depth-stencil will be dummies since we have no control over
+ the underlying buffers here. While the baseline here is plain GLES 2.0, some
+ modern GL(ES) features like multisample renderbuffers, blits, and compute are
+ used when available. Also functional with core profile contexts.
+*/
+
+/*!
+ \class QRhiGles2InitParams
+ \internal
+ \inmodule QtGui
+ \brief OpenGL specific initialization parameters.
+
+ An OpenGL-based QRhi needs an already created QOffscreenSurface at minimum.
+ Additionally, while optional, it is recommended that the QWindow the first
+ QRhiSwapChain will target is passed in as well.
+
+ \badcode
+ QOffscreenSurface *fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
+ QRhiGles2InitParams params;
+ params.fallbackSurface = fallbackSurface;
+ params.window = window;
+ rhi = QRhi::create(QRhi::OpenGLES2, &params);
+ \endcode
+
+ By default QRhi creates a QOpenGLContext on its own. This approach works
+ well in most cases, included threaded scenarios, where there is a dedicated
+ QRhi for each rendering thread. As there will be a QOpenGLContext for each
+ QRhi, the OpenGL context requirements (a context can only be current on one
+ thread) are satisfied. The implicitly created context is destroyed
+ automatically together with the QRhi.
+
+ The QSurfaceFormat for the context is specified in \l format. The
+ constructor sets this to QSurfaceFormat::defaultFormat() so applications
+ that use QSurfaceFormat::setDefaultFormat() do not need to set the format
+ again.
+
+ \note The depth and stencil buffer sizes are set automatically to 24 and 8
+ when no size was explicitly set for these buffers in \l format. As there
+ are possible adjustments to \l format, applications can use
+ adjustedFormat() to query the effective format that is passed to
+ QOpenGLContext::setFormat() internally.
+
+ A QOffscreenSurface has to be specified in \l fallbackSurface. In order to
+ prevent mistakes in threaded situations, this is never created
+ automatically by the QRhi since, like QWindow, QOffscreenSurface can only
+ be created on the gui/main thread.
+
+ As a convenience, applications can use newFallbackSurface() which creates
+ and returns a QOffscreenSurface that is compatible with the QOpenGLContext
+ that is going to be created by the QRhi afterwards. Note that the ownership
+ of the returned QOffscreenSurface is transferred to the caller and the QRhi
+ will not destroy it.
+
+ \note QRhiSwapChain can only target QWindow instances that have their
+ surface type set to QSurface::OpenGLSurface.
+
+ \note \l window is optional. It is recommended to specify it whenever
+ possible, in order to avoid problems on multi-adapter and multi-screen
+ systems. When \l window is not set, the very first
+ QOpenGLContext::makeCurrent() happens with \l fallbackSurface which may be
+ an invisible window on some platforms (for example, Windows) and that may
+ trigger unexpected problems in some cases.
+
+ \section2 Working with existing OpenGL contexts
+
+ When interoperating with another graphics engine, it may be necessary to
+ get a QRhi instance that uses the same OpenGL context. This can be achieved
+ by passing a pointer to a QRhiGles2NativeHandles to QRhi::create(). The
+ \l{QRhiGles2NativeHandles::context}{context} must be set to a non-null
+ value.
+
+ An alternative approach is to create a QOpenGLContext that
+ \l{QOpenGLContext::setShareContext()}{shares resources} with the other
+ engine's context and passing in that context via QRhiGles2NativeHandles.
+
+ The QRhi does not take ownership of the QOpenGLContext passed in via
+ QRhiGles2NativeHandles.
+ */
+
+/*!
+ \class QRhiGles2NativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the OpenGL context used by the QRhi.
+ */
+
+/*!
+ \class QRhiGles2TextureNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the OpenGL texture object that is backing a QRhiTexture instance.
+ */
+
+#ifndef GL_BGRA
+#define GL_BGRA 0x80E1
+#endif
+
+#ifndef GL_R8
+#define GL_R8 0x8229
+#endif
+
+#ifndef GL_R16
+#define GL_R16 0x822A
+#endif
+
+#ifndef GL_RED
+#define GL_RED 0x1903
+#endif
+
+#ifndef GL_RGBA8
+#define GL_RGBA8 0x8058
+#endif
+
+#ifndef GL_RGBA32F
+#define GL_RGBA32F 0x8814
+#endif
+
+#ifndef GL_RGBA16F
+#define GL_RGBA16F 0x881A
+#endif
+
+#ifndef GL_HALF_FLOAT
+#define GL_HALF_FLOAT 0x140B
+#endif
+
+#ifndef GL_DEPTH_COMPONENT16
+#define GL_DEPTH_COMPONENT16 0x81A5
+#endif
+
+#ifndef GL_DEPTH_COMPONENT24
+#define GL_DEPTH_COMPONENT24 0x81A6
+#endif
+
+#ifndef GL_DEPTH_COMPONENT32F
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#endif
+
+#ifndef GL_STENCIL_INDEX
+#define GL_STENCIL_INDEX 0x1901
+#endif
+
+#ifndef GL_STENCIL_INDEX8
+#define GL_STENCIL_INDEX8 0x8D48
+#endif
+
+#ifndef GL_DEPTH24_STENCIL8
+#define GL_DEPTH24_STENCIL8 0x88F0
+#endif
+
+#ifndef GL_DEPTH_STENCIL_ATTACHMENT
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#endif
+
+#ifndef GL_DEPTH_STENCIL
+#define GL_DEPTH_STENCIL 0x84F9
+#endif
+
+#ifndef GL_PRIMITIVE_RESTART_FIXED_INDEX
+#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
+#endif
+
+#ifndef GL_FRAMEBUFFER_SRGB
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#endif
+
+#ifndef GL_READ_FRAMEBUFFER
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#endif
+
+#ifndef GL_DRAW_FRAMEBUFFER
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#endif
+
+#ifndef GL_MAX_DRAW_BUFFERS
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#endif
+
+#ifndef GL_TEXTURE_COMPARE_MODE
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#endif
+
+#ifndef GL_COMPARE_REF_TO_TEXTURE
+#define GL_COMPARE_REF_TO_TEXTURE 0x884E
+#endif
+
+#ifndef GL_TEXTURE_COMPARE_FUNC
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#endif
+
+#ifndef GL_MAX_SAMPLES
+#define GL_MAX_SAMPLES 0x8D57
+#endif
+
+#ifndef GL_SHADER_STORAGE_BUFFER
+#define GL_SHADER_STORAGE_BUFFER 0x90D2
+#endif
+
+#ifndef GL_READ_ONLY
+#define GL_READ_ONLY 0x88B8
+#endif
+
+#ifndef GL_WRITE_ONLY
+#define GL_WRITE_ONLY 0x88B9
+#endif
+
+#ifndef GL_READ_WRITE
+#define GL_READ_WRITE 0x88BA
+#endif
+
+#ifndef GL_COMPUTE_SHADER
+#define GL_COMPUTE_SHADER 0x91B9
+#endif
+
+#ifndef GL_ALL_BARRIER_BITS
+#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
+#endif
+
+#ifndef GL_VERTEX_PROGRAM_POINT_SIZE
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#endif
+
+#ifndef GL_POINT_SPRITE
+#define GL_POINT_SPRITE 0x8861
+#endif
+
+#ifndef GL_MAP_READ_BIT
+#define GL_MAP_READ_BIT 0x0001
+#endif
+
+Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache)
+
+/*!
+ Constructs a new QRhiGles2InitParams.
+
+ \l format is set to QSurfaceFormat::defaultFormat().
+ */
+QRhiGles2InitParams::QRhiGles2InitParams()
+{
+ format = QSurfaceFormat::defaultFormat();
+}
+
+/*!
+ \return the QSurfaceFormat that will be set on the QOpenGLContext before
+ calling QOpenGLContext::create(). This format is based on \a format, but
+ may be adjusted. Applicable only when QRhi creates the context.
+ Applications are advised to set this format on their QWindow in order to
+ avoid potential BAD_MATCH failures.
+ */
+QSurfaceFormat QRhiGles2InitParams::adjustedFormat(const QSurfaceFormat &format)
+{
+ QSurfaceFormat fmt = format;
+
+ if (fmt.depthBufferSize() == -1)
+ fmt.setDepthBufferSize(24);
+ if (fmt.stencilBufferSize() == -1)
+ fmt.setStencilBufferSize(8);
+
+ return fmt;
+}
+
+/*!
+ \return a new QOffscreenSurface that can be used with a QRhi by passing it
+ via a QRhiGles2InitParams.
+
+ \a format is adjusted as appropriate in order to avoid having problems
+ afterwards due to an incompatible context and surface.
+
+ \note This function must only be called on the gui/main thread.
+
+ \note It is the application's responsibility to destroy the returned
+ QOffscreenSurface on the gui/main thread once the associated QRhi has been
+ destroyed. The QRhi will not destroy the QOffscreenSurface.
+ */
+QOffscreenSurface *QRhiGles2InitParams::newFallbackSurface(const QSurfaceFormat &format)
+{
+ QSurfaceFormat fmt = adjustedFormat(format);
+
+ // To resolve all fields in the format as much as possible, create a context.
+ // This may be heavy, but allows avoiding BAD_MATCH on some systems.
+ QOpenGLContext tempContext;
+ tempContext.setFormat(fmt);
+ if (tempContext.create())
+ fmt = tempContext.format();
+ else
+ qWarning("QRhiGles2: Failed to create temporary context");
+
+ QOffscreenSurface *s = new QOffscreenSurface;
+ s->setFormat(fmt);
+ s->create();
+
+ return s;
+}
+
+QRhiGles2::QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice)
+ : ofr(this)
+{
+ requestedFormat = QRhiGles2InitParams::adjustedFormat(params->format);
+ fallbackSurface = params->fallbackSurface;
+ maybeWindow = params->window; // may be null
+
+ importedContext = importDevice != nullptr;
+ if (importedContext) {
+ ctx = importDevice->context;
+ if (!ctx) {
+ qWarning("No OpenGL context given, cannot import");
+ importedContext = false;
+ }
+ }
+}
+
+bool QRhiGles2::ensureContext(QSurface *surface) const
+{
+ bool nativeWindowGone = false;
+ if (surface && surface->surfaceClass() == QSurface::Window && !surface->surfaceHandle()) {
+ surface = fallbackSurface;
+ nativeWindowGone = true;
+ }
+
+ if (!surface)
+ surface = fallbackSurface;
+
+ if (needsMakeCurrent)
+ needsMakeCurrent = false;
+ else if (!nativeWindowGone && QOpenGLContext::currentContext() == ctx && (surface == fallbackSurface || ctx->surface() == surface))
+ return true;
+
+ if (!ctx->makeCurrent(surface)) {
+ if (ctx->isValid()) {
+ qWarning("QRhiGles2: Failed to make context current. Expect bad things to happen.");
+ } else {
+ qWarning("QRhiGles2: Context is lost.");
+ contextLost = true;
+ }
+ return false;
+ }
+
+ return true;
+}
+
+bool QRhiGles2::create(QRhi::Flags flags)
+{
+ Q_UNUSED(flags);
+ Q_ASSERT(fallbackSurface);
+
+ if (!importedContext) {
+ ctx = new QOpenGLContext;
+ ctx->setFormat(requestedFormat);
+ if (!ctx->create()) {
+ qWarning("QRhiGles2: Failed to create context");
+ delete ctx;
+ ctx = nullptr;
+ return false;
+ }
+ qCDebug(QRHI_LOG_INFO) << "Created OpenGL context" << ctx->format();
+ }
+
+ if (!ensureContext(maybeWindow ? maybeWindow : fallbackSurface)) // see 'window' discussion in QRhiGles2InitParams comments
+ return false;
+
+ f = static_cast<QOpenGLExtensions *>(ctx->extraFunctions());
+
+ const char *vendor = reinterpret_cast<const char *>(f->glGetString(GL_VENDOR));
+ const char *renderer = reinterpret_cast<const char *>(f->glGetString(GL_RENDERER));
+ const char *version = reinterpret_cast<const char *>(f->glGetString(GL_VERSION));
+ if (vendor && renderer && version)
+ qCDebug(QRHI_LOG_INFO, "OpenGL VENDOR: %s RENDERER: %s VERSION: %s", vendor, renderer, version);
+
+ const QSurfaceFormat actualFormat = ctx->format();
+
+ caps.ctxMajor = actualFormat.majorVersion();
+ caps.ctxMinor = actualFormat.minorVersion();
+
+ GLint n = 0;
+ f->glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &n);
+ supportedCompressedFormats.resize(n);
+ if (n > 0)
+ f->glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, supportedCompressedFormats.data());
+
+ f->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &caps.maxTextureSize);
+
+ if (caps.ctxMajor >= 3 || actualFormat.renderableType() == QSurfaceFormat::OpenGL) {
+ f->glGetIntegerv(GL_MAX_DRAW_BUFFERS, &caps.maxDrawBuffers);
+ f->glGetIntegerv(GL_MAX_SAMPLES, &caps.maxSamples);
+ caps.maxSamples = qMax(1, caps.maxSamples);
+ } else {
+ caps.maxDrawBuffers = 1;
+ caps.maxSamples = 1;
+ }
+
+ caps.msaaRenderBuffer = f->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)
+ && f->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit);
+
+ caps.npotTextureFull = f->hasOpenGLFeature(QOpenGLFunctions::NPOTTextures)
+ && f->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat);
+
+ caps.gles = actualFormat.renderableType() == QSurfaceFormat::OpenGLES;
+ if (caps.gles)
+ caps.fixedIndexPrimitiveRestart = caps.ctxMajor >= 3; // ES 3.0
+ else
+ caps.fixedIndexPrimitiveRestart = caps.ctxMajor > 4 || (caps.ctxMajor == 4 && caps.ctxMinor >= 3); // 4.3
+
+ if (caps.fixedIndexPrimitiveRestart)
+ f->glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
+
+ caps.bgraExternalFormat = f->hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat);
+ caps.bgraInternalFormat = caps.bgraExternalFormat && caps.gles;
+ caps.r8Format = f->hasOpenGLFeature(QOpenGLFunctions::TextureRGFormats);
+ caps.r16Format = f->hasOpenGLExtension(QOpenGLExtensions::Sized16Formats);
+ caps.floatFormats = caps.ctxMajor >= 3; // 3.0 or ES 3.0
+ caps.depthTexture = caps.ctxMajor >= 3; // 3.0 or ES 3.0
+ caps.packedDepthStencil = f->hasOpenGLExtension(QOpenGLExtensions::PackedDepthStencil);
+#ifdef Q_OS_WASM
+ caps.needsDepthStencilCombinedAttach = true;
+#else
+ caps.needsDepthStencilCombinedAttach = false;
+#endif
+ caps.srgbCapableDefaultFramebuffer = f->hasOpenGLExtension(QOpenGLExtensions::SRGBFrameBuffer);
+ caps.coreProfile = actualFormat.profile() == QSurfaceFormat::CoreProfile;
+
+ if (caps.gles)
+ caps.uniformBuffers = caps.ctxMajor >= 3; // ES 3.0
+ else
+ caps.uniformBuffers = caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 1); // 3.1
+
+ caps.elementIndexUint = f->hasOpenGLExtension(QOpenGLExtensions::ElementIndexUint);
+ caps.depth24 = f->hasOpenGLExtension(QOpenGLExtensions::Depth24);
+ caps.rgba8Format = f->hasOpenGLExtension(QOpenGLExtensions::Sized8Formats);
+
+ if (caps.gles)
+ caps.instancing = caps.ctxMajor >= 3; // ES 3.0
+ else
+ caps.instancing = caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 3); // 3.3
+
+ caps.baseVertex = caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 2); // 3.2 or ES 3.2
+
+ if (caps.gles)
+ caps.compute = caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 1); // ES 3.1
+ else
+ caps.compute = caps.ctxMajor > 4 || (caps.ctxMajor == 4 && caps.ctxMinor >= 3); // 4.3
+
+ if (caps.gles)
+ caps.textureCompareMode = caps.ctxMajor >= 3; // ES 3.0
+ else
+ caps.textureCompareMode = true;
+
+ // proper as in ES 3.0 (glMapBufferRange), not the old glMapBuffer
+ // extension(s) (which is not in ES 3.0...messy)
+ caps.properMapBuffer = f->hasOpenGLExtension(QOpenGLExtensions::MapBufferRange);
+
+ if (caps.gles)
+ caps.nonBaseLevelFramebufferTexture = caps.ctxMajor >= 3; // ES 3.0
+ else
+ caps.nonBaseLevelFramebufferTexture = true;
+
+ if (!caps.gles) {
+ f->glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+ f->glEnable(GL_POINT_SPRITE);
+ } // else (with gles) these are always on
+
+ nativeHandlesStruct.context = ctx;
+
+ contextLost = false;
+
+ return true;
+}
+
+void QRhiGles2::destroy()
+{
+ if (!f)
+ return;
+
+ ensureContext();
+ executeDeferredReleases();
+
+ if (vao) {
+ f->glDeleteVertexArrays(1, &vao);
+ vao = 0;
+ }
+
+ for (uint shader : m_shaderCache)
+ f->glDeleteShader(shader);
+ m_shaderCache.clear();
+
+ if (!importedContext) {
+ delete ctx;
+ ctx = nullptr;
+ }
+
+ f = nullptr;
+}
+
+void QRhiGles2::executeDeferredReleases()
+{
+ for (int i = releaseQueue.count() - 1; i >= 0; --i) {
+ const QRhiGles2::DeferredReleaseEntry &e(releaseQueue[i]);
+ switch (e.type) {
+ case QRhiGles2::DeferredReleaseEntry::Buffer:
+ f->glDeleteBuffers(1, &e.buffer.buffer);
+ break;
+ case QRhiGles2::DeferredReleaseEntry::Pipeline:
+ f->glDeleteProgram(e.pipeline.program);
+ break;
+ case QRhiGles2::DeferredReleaseEntry::Texture:
+ f->glDeleteTextures(1, &e.texture.texture);
+ break;
+ case QRhiGles2::DeferredReleaseEntry::RenderBuffer:
+ f->glDeleteRenderbuffers(1, &e.renderbuffer.renderbuffer);
+ f->glDeleteRenderbuffers(1, &e.renderbuffer.renderbuffer2);
+ break;
+ case QRhiGles2::DeferredReleaseEntry::TextureRenderTarget:
+ f->glDeleteFramebuffers(1, &e.textureRenderTarget.framebuffer);
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ releaseQueue.removeAt(i);
+ }
+}
+
+QVector<int> QRhiGles2::supportedSampleCounts() const
+{
+ if (supportedSampleCountList.isEmpty()) {
+ // 1, 2, 4, 8, ...
+ for (int i = 1; i <= caps.maxSamples; i *= 2)
+ supportedSampleCountList.append(i);
+ }
+ return supportedSampleCountList;
+}
+
+int QRhiGles2::effectiveSampleCount(int sampleCount) const
+{
+ // Stay compatible with QSurfaceFormat and friends where samples == 0 means the same as 1.
+ const int s = qBound(1, sampleCount, 64);
+ if (!supportedSampleCounts().contains(s)) {
+ qWarning("Attempted to set unsupported sample count %d", sampleCount);
+ return 1;
+ }
+ return s;
+}
+
+QRhiSwapChain *QRhiGles2::createSwapChain()
+{
+ return new QGles2SwapChain(this);
+}
+
+QRhiBuffer *QRhiGles2::createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
+{
+ return new QGles2Buffer(this, type, usage, size);
+}
+
+int QRhiGles2::ubufAlignment() const
+{
+ // No real uniform buffers are used so no need to pretend there is any
+ // alignment requirement.
+ return 1;
+}
+
+bool QRhiGles2::isYUpInFramebuffer() const
+{
+ return true;
+}
+
+bool QRhiGles2::isYUpInNDC() const
+{
+ return true;
+}
+
+bool QRhiGles2::isClipDepthZeroToOne() const
+{
+ return false;
+}
+
+QMatrix4x4 QRhiGles2::clipSpaceCorrMatrix() const
+{
+ return QMatrix4x4(); // identity
+}
+
+static inline GLenum toGlCompressedTextureFormat(QRhiTexture::Format format, QRhiTexture::Flags flags)
+{
+ const bool srgb = flags.testFlag(QRhiTexture::sRGB);
+ switch (format) {
+ case QRhiTexture::BC1:
+ return srgb ? 0x8C4C : 0x83F0;
+ case QRhiTexture::BC3:
+ return srgb ? 0x8C4E : 0x83F2;
+ case QRhiTexture::BC5:
+ return srgb ? 0x8C4F : 0x83F3;
+
+ case QRhiTexture::ETC2_RGB8:
+ return srgb ? 0x9275 : 0x9274;
+ case QRhiTexture::ETC2_RGB8A1:
+ return srgb ? 0x9277 : 0x9276;
+ case QRhiTexture::ETC2_RGBA8:
+ return srgb ? 0x9279 : 0x9278;
+
+ case QRhiTexture::ASTC_4x4:
+ return srgb ? 0x93D0 : 0x93B0;
+ case QRhiTexture::ASTC_5x4:
+ return srgb ? 0x93D1 : 0x93B1;
+ case QRhiTexture::ASTC_5x5:
+ return srgb ? 0x93D2 : 0x93B2;
+ case QRhiTexture::ASTC_6x5:
+ return srgb ? 0x93D3 : 0x93B3;
+ case QRhiTexture::ASTC_6x6:
+ return srgb ? 0x93D4 : 0x93B4;
+ case QRhiTexture::ASTC_8x5:
+ return srgb ? 0x93D5 : 0x93B5;
+ case QRhiTexture::ASTC_8x6:
+ return srgb ? 0x93D6 : 0x93B6;
+ case QRhiTexture::ASTC_8x8:
+ return srgb ? 0x93D7 : 0x93B7;
+ case QRhiTexture::ASTC_10x5:
+ return srgb ? 0x93D8 : 0x93B8;
+ case QRhiTexture::ASTC_10x6:
+ return srgb ? 0x93D9 : 0x93B9;
+ case QRhiTexture::ASTC_10x8:
+ return srgb ? 0x93DA : 0x93BA;
+ case QRhiTexture::ASTC_10x10:
+ return srgb ? 0x93DB : 0x93BB;
+ case QRhiTexture::ASTC_12x10:
+ return srgb ? 0x93DC : 0x93BC;
+ case QRhiTexture::ASTC_12x12:
+ return srgb ? 0x93DD : 0x93BD;
+
+ default:
+ return 0; // this is reachable, just return an invalid format
+ }
+}
+
+bool QRhiGles2::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const
+{
+ if (isCompressedFormat(format))
+ return supportedCompressedFormats.contains(GLint(toGlCompressedTextureFormat(format, flags)));
+
+ switch (format) {
+ case QRhiTexture::D16:
+ Q_FALLTHROUGH();
+ case QRhiTexture::D32F:
+ return caps.depthTexture;
+
+ case QRhiTexture::BGRA8:
+ return caps.bgraExternalFormat;
+
+ case QRhiTexture::R8:
+ return caps.r8Format;
+
+ case QRhiTexture::R16:
+ return caps.r16Format;
+
+ case QRhiTexture::RGBA16F:
+ Q_FALLTHROUGH();
+ case QRhiTexture::RGBA32F:
+ return caps.floatFormats;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
+bool QRhiGles2::isFeatureSupported(QRhi::Feature feature) const
+{
+ switch (feature) {
+ case QRhi::MultisampleTexture:
+ return false;
+ case QRhi::MultisampleRenderBuffer:
+ return caps.msaaRenderBuffer;
+ case QRhi::DebugMarkers:
+ return false;
+ case QRhi::Timestamps:
+ return false;
+ case QRhi::Instancing:
+ return caps.instancing;
+ case QRhi::CustomInstanceStepRate:
+ return false;
+ case QRhi::PrimitiveRestart:
+ return caps.fixedIndexPrimitiveRestart;
+ case QRhi::NonDynamicUniformBuffers:
+ return true;
+ case QRhi::NonFourAlignedEffectiveIndexBufferOffset:
+ return true;
+ case QRhi::NPOTTextureRepeat:
+ return caps.npotTextureFull;
+ case QRhi::RedOrAlpha8IsRed:
+ return caps.coreProfile;
+ case QRhi::ElementIndexUint:
+ return caps.elementIndexUint;
+ case QRhi::Compute:
+ return caps.compute;
+ case QRhi::WideLines:
+ return true;
+ case QRhi::VertexShaderPointSize:
+ return true;
+ case QRhi::BaseVertex:
+ return caps.baseVertex;
+ case QRhi::BaseInstance:
+ return false; // not in ES 3.2, so won't bother
+ case QRhi::TriangleFanTopology:
+ return true;
+ case QRhi::ReadBackNonUniformBuffer:
+ return !caps.gles || caps.properMapBuffer;
+ case QRhi::ReadBackNonBaseMipLevel:
+ return caps.nonBaseLevelFramebufferTexture;
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+}
+
+int QRhiGles2::resourceLimit(QRhi::ResourceLimit limit) const
+{
+ switch (limit) {
+ case QRhi::TextureSizeMin:
+ return 1;
+ case QRhi::TextureSizeMax:
+ return caps.maxTextureSize;
+ case QRhi::MaxColorAttachments:
+ return caps.maxDrawBuffers;
+ case QRhi::FramesInFlight:
+ return 2; // dummy
+ default:
+ Q_UNREACHABLE();
+ return 0;
+ }
+}
+
+const QRhiNativeHandles *QRhiGles2::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+void QRhiGles2::sendVMemStatsToProfiler()
+{
+ // nothing to do here
+}
+
+bool QRhiGles2::makeThreadLocalNativeContextCurrent()
+{
+ if (inFrame && !ofr.active)
+ return ensureContext(currentSwapChain->surface);
+ else
+ return ensureContext();
+}
+
+void QRhiGles2::releaseCachedResources()
+{
+ if (!ensureContext())
+ return;
+
+ for (uint shader : m_shaderCache)
+ f->glDeleteShader(shader);
+
+ m_shaderCache.clear();
+}
+
+bool QRhiGles2::isDeviceLost() const
+{
+ return contextLost;
+}
+
+QRhiRenderBuffer *QRhiGles2::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+{
+ return new QGles2RenderBuffer(this, type, pixelSize, sampleCount, flags);
+}
+
+QRhiTexture *QRhiGles2::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
+ int sampleCount, QRhiTexture::Flags flags)
+{
+ return new QGles2Texture(this, format, pixelSize, sampleCount, flags);
+}
+
+QRhiSampler *QRhiGles2::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler::AddressMode u, QRhiSampler::AddressMode v)
+{
+ return new QGles2Sampler(this, magFilter, minFilter, mipmapMode, u, v);
+}
+
+QRhiTextureRenderTarget *QRhiGles2::createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags)
+{
+ return new QGles2TextureRenderTarget(this, desc, flags);
+}
+
+QRhiGraphicsPipeline *QRhiGles2::createGraphicsPipeline()
+{
+ return new QGles2GraphicsPipeline(this);
+}
+
+QRhiShaderResourceBindings *QRhiGles2::createShaderResourceBindings()
+{
+ return new QGles2ShaderResourceBindings(this);
+}
+
+QRhiComputePipeline *QRhiGles2::createComputePipeline()
+{
+ return new QGles2ComputePipeline(this);
+}
+
+void QRhiGles2::setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+ QGles2GraphicsPipeline *psD = QRHI_RES(QGles2GraphicsPipeline, ps);
+ const bool pipelineChanged = cbD->currentGraphicsPipeline != ps || cbD->currentPipelineGeneration != psD->generation;
+
+ if (pipelineChanged) {
+ cbD->currentGraphicsPipeline = ps;
+ cbD->currentComputePipeline = nullptr;
+ cbD->currentPipelineGeneration = psD->generation;
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BindGraphicsPipeline;
+ cmd.args.bindGraphicsPipeline.ps = ps;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiGles2::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass != QGles2CommandBuffer::NoPass);
+ QGles2GraphicsPipeline *gfxPsD = QRHI_RES(QGles2GraphicsPipeline, cbD->currentGraphicsPipeline);
+ QGles2ComputePipeline *compPsD = QRHI_RES(QGles2ComputePipeline, cbD->currentComputePipeline);
+
+ if (!srb) {
+ if (gfxPsD)
+ srb = gfxPsD->m_shaderResourceBindings;
+ else
+ srb = compPsD->m_shaderResourceBindings;
+ }
+
+ QRhiPassResourceTracker &passResTracker(cbD->passResTrackers[cbD->currentPassResTrackerIndex]);
+ QGles2ShaderResourceBindings *srbD = QRHI_RES(QGles2ShaderResourceBindings, srb);
+ bool hasDynamicOffsetInSrb = false;
+ for (int i = 0, ie = srbD->m_bindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->m_bindings.at(i).data();
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ // no BufUniformRead / AccessUniform because no real uniform buffers are used
+ if (b->u.ubuf.hasDynamicOffset)
+ hasDynamicOffsetInSrb = true;
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ trackedRegisterTexture(&passResTracker,
+ QRHI_RES(QGles2Texture, b->u.stex.tex),
+ QRhiPassResourceTracker::TexSample,
+ QRhiPassResourceTracker::toPassTrackerTextureStage(b->stage));
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, b->u.simage.tex);
+ QRhiPassResourceTracker::TextureAccess access;
+ if (b->type == QRhiShaderResourceBinding::ImageLoad)
+ access = QRhiPassResourceTracker::TexStorageLoad;
+ else if (b->type == QRhiShaderResourceBinding::ImageStore)
+ access = QRhiPassResourceTracker::TexStorageStore;
+ else
+ access = QRhiPassResourceTracker::TexStorageLoadStore;
+ trackedRegisterTexture(&passResTracker, texD, access,
+ QRhiPassResourceTracker::toPassTrackerTextureStage(b->stage));
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, b->u.sbuf.buf);
+ QRhiPassResourceTracker::BufferAccess access;
+ if (b->type == QRhiShaderResourceBinding::BufferLoad)
+ access = QRhiPassResourceTracker::BufStorageLoad;
+ else if (b->type == QRhiShaderResourceBinding::BufferStore)
+ access = QRhiPassResourceTracker::BufStorageStore;
+ else
+ access = QRhiPassResourceTracker::BufStorageLoadStore;
+ trackedRegisterBuffer(&passResTracker, bufD, access,
+ QRhiPassResourceTracker::toPassTrackerBufferStage(b->stage));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ const bool srbChanged = gfxPsD ? (cbD->currentGraphicsSrb != srb) : (cbD->currentComputeSrb != srb);
+ const bool srbRebuilt = cbD->currentSrbGeneration != srbD->generation;
+
+ if (srbChanged || srbRebuilt || hasDynamicOffsetInSrb) {
+ if (gfxPsD) {
+ cbD->currentGraphicsSrb = srb;
+ cbD->currentComputeSrb = nullptr;
+ } else {
+ cbD->currentGraphicsSrb = nullptr;
+ cbD->currentComputeSrb = srb;
+ }
+ cbD->currentSrbGeneration = srbD->generation;
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BindShaderResources;
+ cmd.args.bindShaderResources.maybeGraphicsPs = gfxPsD;
+ cmd.args.bindShaderResources.maybeComputePs = compPsD;
+ cmd.args.bindShaderResources.srb = srb;
+ cmd.args.bindShaderResources.dynamicOffsetCount = 0;
+ if (hasDynamicOffsetInSrb) {
+ if (dynamicOffsetCount < QGles2CommandBuffer::Command::MAX_UBUF_BINDINGS) {
+ cmd.args.bindShaderResources.dynamicOffsetCount = dynamicOffsetCount;
+ uint *p = cmd.args.bindShaderResources.dynamicOffsetPairs;
+ for (int i = 0; i < dynamicOffsetCount; ++i) {
+ const QRhiCommandBuffer::DynamicOffset &dynOfs(dynamicOffsets[i]);
+ *p++ = uint(dynOfs.first);
+ *p++ = dynOfs.second;
+ }
+ } else {
+ qWarning("Too many dynamic offsets (%d, max is %d)",
+ dynamicOffsetCount, QGles2CommandBuffer::Command::MAX_UBUF_BINDINGS);
+ }
+ }
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiGles2::setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+ QRhiPassResourceTracker &passResTracker(cbD->passResTrackers[cbD->currentPassResTrackerIndex]);
+
+ for (int i = 0; i < bindingCount; ++i) {
+ QRhiBuffer *buf = bindings[i].first;
+ quint32 ofs = bindings[i].second;
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, buf);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::VertexBuffer));
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BindVertexBuffer;
+ cmd.args.bindVertexBuffer.ps = cbD->currentGraphicsPipeline;
+ cmd.args.bindVertexBuffer.buffer = bufD->buffer;
+ cmd.args.bindVertexBuffer.offset = ofs;
+ cmd.args.bindVertexBuffer.binding = startBinding + i;
+ cbD->commands.append(cmd);
+
+ trackedRegisterBuffer(&passResTracker, bufD, QRhiPassResourceTracker::BufVertexInput,
+ QRhiPassResourceTracker::BufVertexInputStage);
+ }
+
+ if (indexBuf) {
+ QGles2Buffer *ibufD = QRHI_RES(QGles2Buffer, indexBuf);
+ Q_ASSERT(ibufD->m_usage.testFlag(QRhiBuffer::IndexBuffer));
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BindIndexBuffer;
+ cmd.args.bindIndexBuffer.buffer = ibufD->buffer;
+ cmd.args.bindIndexBuffer.offset = indexOffset;
+ cmd.args.bindIndexBuffer.type = indexFormat == QRhiCommandBuffer::IndexUInt16 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT;
+ cbD->commands.append(cmd);
+
+ trackedRegisterBuffer(&passResTracker, ibufD, QRhiPassResourceTracker::BufIndexRead,
+ QRhiPassResourceTracker::BufVertexInputStage);
+ }
+}
+
+void QRhiGles2::setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::Viewport;
+ const std::array<float, 4> r = viewport.viewport();
+ // A negative width or height is an error. A negative x or y is not.
+ if (r[2] < 0.0f || r[3] < 0.0f)
+ return;
+
+ cmd.args.viewport.x = r[0];
+ cmd.args.viewport.y = r[1];
+ cmd.args.viewport.w = r[2];
+ cmd.args.viewport.h = r[3];
+ cmd.args.viewport.d0 = viewport.minDepth();
+ cmd.args.viewport.d1 = viewport.maxDepth();
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::Scissor;
+ const std::array<int, 4> r = scissor.scissor();
+ // A negative width or height is an error. A negative x or y is not.
+ if (r[2] < 0 || r[3] < 0)
+ return;
+
+ cmd.args.scissor.x = r[0];
+ cmd.args.scissor.y = r[1];
+ cmd.args.scissor.w = r[2];
+ cmd.args.scissor.h = r[3];
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::setBlendConstants(QRhiCommandBuffer *cb, const QColor &c)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BlendConstants;
+ cmd.args.blendConstants.r = float(c.redF());
+ cmd.args.blendConstants.g = float(c.greenF());
+ cmd.args.blendConstants.b = float(c.blueF());
+ cmd.args.blendConstants.a = float(c.alphaF());
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::setStencilRef(QRhiCommandBuffer *cb, quint32 refValue)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::StencilRef;
+ cmd.args.stencilRef.ref = refValue;
+ cmd.args.stencilRef.ps = cbD->currentGraphicsPipeline;
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::Draw;
+ cmd.args.draw.ps = cbD->currentGraphicsPipeline;
+ cmd.args.draw.vertexCount = vertexCount;
+ cmd.args.draw.firstVertex = firstVertex;
+ cmd.args.draw.instanceCount = instanceCount;
+ cmd.args.draw.baseInstance = firstInstance;
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::DrawIndexed;
+ cmd.args.drawIndexed.ps = cbD->currentGraphicsPipeline;
+ cmd.args.drawIndexed.indexCount = indexCount;
+ cmd.args.drawIndexed.firstIndex = firstIndex;
+ cmd.args.drawIndexed.instanceCount = instanceCount;
+ cmd.args.drawIndexed.baseInstance = firstInstance;
+ cmd.args.drawIndexed.baseVertex = vertexOffset;
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name)
+{
+ if (!debugMarkers)
+ return;
+
+ Q_UNUSED(cb);
+ Q_UNUSED(name);
+}
+
+void QRhiGles2::debugMarkEnd(QRhiCommandBuffer *cb)
+{
+ if (!debugMarkers)
+ return;
+
+ Q_UNUSED(cb);
+}
+
+void QRhiGles2::debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg)
+{
+ if (!debugMarkers)
+ return;
+
+ Q_UNUSED(cb);
+ Q_UNUSED(msg);
+}
+
+const QRhiNativeHandles *QRhiGles2::nativeHandles(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+ return nullptr;
+}
+
+static void addBoundaryCommand(QGles2CommandBuffer *cbD, QGles2CommandBuffer::Command::Cmd type)
+{
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = type;
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::beginExternal(QRhiCommandBuffer *cb)
+{
+ if (ofr.active) {
+ Q_ASSERT(!currentSwapChain);
+ if (!ensureContext())
+ return;
+ } else {
+ Q_ASSERT(currentSwapChain);
+ if (!ensureContext(currentSwapChain->surface))
+ return;
+ }
+
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ executeCommandBuffer(cbD);
+ cbD->resetCommands();
+
+ if (vao)
+ f->glBindVertexArray(0);
+}
+
+void QRhiGles2::endExternal(QRhiCommandBuffer *cb)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->commands.isEmpty() && cbD->currentPassResTrackerIndex == -1);
+
+ cbD->resetCachedState();
+
+ if (cbD->recordingPass != QGles2CommandBuffer::NoPass) {
+ // Commands that come after this point need a resource tracker and also
+ // a BarriersForPass command enqueued. (the ones we had from
+ // beginPass() are now gone since beginExternal() processed all that
+ // due to calling executeCommandBuffer()).
+ enqueueBarriersForPass(cbD);
+ }
+
+ addBoundaryCommand(cbD, QGles2CommandBuffer::Command::ResetFrame);
+
+ if (cbD->currentTarget)
+ enqueueBindFramebuffer(cbD->currentTarget, cbD);
+}
+
+QRhi::FrameOpResult QRhiGles2::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+
+ QGles2SwapChain *swapChainD = QRHI_RES(QGles2SwapChain, swapChain);
+ if (!ensureContext(swapChainD->surface))
+ return contextLost ? QRhi::FrameOpDeviceLost : QRhi::FrameOpError;
+
+ currentSwapChain = swapChainD;
+
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ QRHI_PROF_F(beginSwapChainFrame(swapChain));
+
+ executeDeferredReleases();
+ swapChainD->cb.resetState();
+
+ addBoundaryCommand(&swapChainD->cb, QGles2CommandBuffer::Command::BeginFrame);
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiGles2::endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags)
+{
+ QGles2SwapChain *swapChainD = QRHI_RES(QGles2SwapChain, swapChain);
+ Q_ASSERT(currentSwapChain == swapChainD);
+
+ addBoundaryCommand(&swapChainD->cb, QGles2CommandBuffer::Command::EndFrame);
+
+ if (!ensureContext(swapChainD->surface))
+ return contextLost ? QRhi::FrameOpDeviceLost : QRhi::FrameOpError;
+
+ executeCommandBuffer(&swapChainD->cb);
+
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ // this must be done before the swap
+ QRHI_PROF_F(endSwapChainFrame(swapChain, swapChainD->frameCount + 1));
+
+ if (swapChainD->surface && !flags.testFlag(QRhi::SkipPresent)) {
+ ctx->swapBuffers(swapChainD->surface);
+ needsMakeCurrent = true;
+ } else {
+ f->glFlush();
+ }
+
+ swapChainD->frameCount += 1;
+ currentSwapChain = nullptr;
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiGles2::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ if (!ensureContext())
+ return contextLost ? QRhi::FrameOpDeviceLost : QRhi::FrameOpError;
+
+ ofr.active = true;
+
+ executeDeferredReleases();
+ ofr.cbWrapper.resetState();
+
+ addBoundaryCommand(&ofr.cbWrapper, QGles2CommandBuffer::Command::BeginFrame);
+ *cb = &ofr.cbWrapper;
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiGles2::endOffscreenFrame(QRhi::EndFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ Q_ASSERT(ofr.active);
+ ofr.active = false;
+
+ addBoundaryCommand(&ofr.cbWrapper, QGles2CommandBuffer::Command::EndFrame);
+
+ if (!ensureContext())
+ return contextLost ? QRhi::FrameOpDeviceLost : QRhi::FrameOpError;
+
+ executeCommandBuffer(&ofr.cbWrapper);
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiGles2::finish()
+{
+ if (inFrame) {
+ if (ofr.active) {
+ Q_ASSERT(!currentSwapChain);
+ Q_ASSERT(ofr.cbWrapper.recordingPass == QGles2CommandBuffer::NoPass);
+ if (!ensureContext())
+ return contextLost ? QRhi::FrameOpDeviceLost : QRhi::FrameOpError;
+ executeCommandBuffer(&ofr.cbWrapper);
+ ofr.cbWrapper.resetCommands();
+ } else {
+ Q_ASSERT(currentSwapChain);
+ Q_ASSERT(currentSwapChain->cb.recordingPass == QGles2CommandBuffer::NoPass);
+ if (!ensureContext(currentSwapChain->surface))
+ return contextLost ? QRhi::FrameOpDeviceLost : QRhi::FrameOpError;
+ executeCommandBuffer(&currentSwapChain->cb);
+ currentSwapChain->cb.resetCommands();
+ }
+ }
+ return QRhi::FrameOpSuccess;
+}
+
+void QRhiGles2::trackedBufferBarrier(QGles2CommandBuffer *cbD, QGles2Buffer *bufD, QGles2Buffer::Access access)
+{
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::NoPass); // this is for resource updates only
+ const QGles2Buffer::Access prevAccess = bufD->usageState.access;
+ if (access == prevAccess)
+ return;
+
+ if (prevAccess == QGles2Buffer::AccessStorageWrite || prevAccess == QGles2Buffer::AccessStorageReadWrite) {
+ // Generating the minimal barrier set is way too complicated to do
+ // correctly (prevAccess is overwritten so we won't have proper
+ // tracking across multiple passes) so setting all barrier bits will do
+ // for now.
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::Barrier;
+ cmd.args.barrier.barriers = GL_ALL_BARRIER_BITS;
+ cbD->commands.append(cmd);
+ }
+
+ bufD->usageState.access = access;
+}
+
+void QRhiGles2::trackedImageBarrier(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Texture::Access access)
+{
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::NoPass); // this is for resource updates only
+ const QGles2Texture::Access prevAccess = texD->usageState.access;
+ if (access == prevAccess)
+ return;
+
+ if (prevAccess == QGles2Texture::AccessStorageWrite || prevAccess == QGles2Texture::AccessStorageReadWrite) {
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::Barrier;
+ cmd.args.barrier.barriers = GL_ALL_BARRIER_BITS;
+ cbD->commands.append(cmd);
+ }
+
+ texD->usageState.access = access;
+}
+
+void QRhiGles2::enqueueSubresUpload(QGles2Texture *texD, QGles2CommandBuffer *cbD,
+ int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc)
+{
+ trackedImageBarrier(cbD, texD, QGles2Texture::AccessUpdate);
+ const bool isCompressed = isCompressedFormat(texD->m_format);
+ const bool isCubeMap = texD->m_flags.testFlag(QRhiTexture::CubeMap);
+ const GLenum faceTargetBase = isCubeMap ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : texD->target;
+ const QPoint dp = subresDesc.destinationTopLeft();
+ const QByteArray rawData = subresDesc.data();
+ if (!subresDesc.image().isNull()) {
+ QImage img = subresDesc.image();
+ QSize size = img.size();
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::SubImage;
+ if (!subresDesc.sourceSize().isEmpty() || !subresDesc.sourceTopLeft().isNull()) {
+ const QPoint sp = subresDesc.sourceTopLeft();
+ if (!subresDesc.sourceSize().isEmpty())
+ size = subresDesc.sourceSize();
+ img = img.copy(sp.x(), sp.y(), size.width(), size.height());
+ }
+ cmd.args.subImage.target = texD->target;
+ cmd.args.subImage.texture = texD->texture;
+ cmd.args.subImage.faceTarget = faceTargetBase + uint(layer);
+ cmd.args.subImage.level = level;
+ cmd.args.subImage.dx = dp.x();
+ cmd.args.subImage.dy = dp.y();
+ cmd.args.subImage.w = size.width();
+ cmd.args.subImage.h = size.height();
+ cmd.args.subImage.glformat = texD->glformat;
+ cmd.args.subImage.gltype = texD->gltype;
+ cmd.args.subImage.rowStartAlign = 4;
+ cmd.args.subImage.data = cbD->retainImage(img);
+ cbD->commands.append(cmd);
+ } else if (!rawData.isEmpty() && isCompressed) {
+ const QSize size = subresDesc.sourceSize().isEmpty() ? q->sizeForMipLevel(level, texD->m_pixelSize)
+ : subresDesc.sourceSize();
+ if (texD->specified) {
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::CompressedSubImage;
+ cmd.args.compressedSubImage.target = texD->target;
+ cmd.args.compressedSubImage.texture = texD->texture;
+ cmd.args.compressedSubImage.faceTarget = faceTargetBase + uint(layer);
+ cmd.args.compressedSubImage.level = level;
+ cmd.args.compressedSubImage.dx = dp.x();
+ cmd.args.compressedSubImage.dy = dp.y();
+ cmd.args.compressedSubImage.w = size.width();
+ cmd.args.compressedSubImage.h = size.height();
+ cmd.args.compressedSubImage.glintformat = texD->glintformat;
+ cmd.args.compressedSubImage.size = rawData.size();
+ cmd.args.compressedSubImage.data = cbD->retainData(rawData);
+ cbD->commands.append(cmd);
+ } else {
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::CompressedImage;
+ cmd.args.compressedImage.target = texD->target;
+ cmd.args.compressedImage.texture = texD->texture;
+ cmd.args.compressedImage.faceTarget = faceTargetBase + uint(layer);
+ cmd.args.compressedImage.level = level;
+ cmd.args.compressedImage.glintformat = texD->glintformat;
+ cmd.args.compressedImage.w = size.width();
+ cmd.args.compressedImage.h = size.height();
+ cmd.args.compressedImage.size = rawData.size();
+ cmd.args.compressedImage.data = cbD->retainData(rawData);
+ cbD->commands.append(cmd);
+ }
+ } else if (!rawData.isEmpty()) {
+ const QSize size = subresDesc.sourceSize().isEmpty() ? q->sizeForMipLevel(level, texD->m_pixelSize)
+ : subresDesc.sourceSize();
+ quint32 bpl = 0;
+ textureFormatInfo(texD->m_format, size, &bpl, nullptr);
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::SubImage;
+ cmd.args.subImage.target = texD->target;
+ cmd.args.subImage.texture = texD->texture;
+ cmd.args.subImage.faceTarget = faceTargetBase + uint(layer);
+ cmd.args.subImage.level = level;
+ cmd.args.subImage.dx = dp.x();
+ cmd.args.subImage.dy = dp.y();
+ cmd.args.subImage.w = size.width();
+ cmd.args.subImage.h = size.height();
+ cmd.args.subImage.glformat = texD->glformat;
+ cmd.args.subImage.gltype = texD->gltype;
+ // Default unpack alignment (row start aligment
+ // requirement) is 4. QImage guarantees 4 byte aligned
+ // row starts, but our raw data here does not.
+ cmd.args.subImage.rowStartAlign = (bpl & 3) ? 1 : 4;
+ cmd.args.subImage.data = cbD->retainData(rawData);
+ cbD->commands.append(cmd);
+ } else {
+ qWarning("Invalid texture upload for %p layer=%d mip=%d", texD, layer, level);
+ }
+}
+
+void QRhiGles2::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates);
+
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : ud->bufferOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) {
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, u.buf);
+ Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
+ if (bufD->m_usage.testFlag(QRhiBuffer::UniformBuffer)) {
+ memcpy(bufD->ubuf.data() + u.offset, u.data.constData(), size_t(u.data.size()));
+ } else {
+ trackedBufferBarrier(cbD, bufD, QGles2Buffer::AccessUpdate);
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BufferSubData;
+ cmd.args.bufferSubData.target = bufD->targetForDataOps;
+ cmd.args.bufferSubData.buffer = bufD->buffer;
+ cmd.args.bufferSubData.offset = u.offset;
+ cmd.args.bufferSubData.size = u.data.size();
+ cmd.args.bufferSubData.data = cbD->retainData(u.data);
+ cbD->commands.append(cmd);
+ }
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) {
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, u.buf);
+ Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic);
+ Q_ASSERT(u.offset + u.data.size() <= bufD->m_size);
+ if (bufD->m_usage.testFlag(QRhiBuffer::UniformBuffer)) {
+ memcpy(bufD->ubuf.data() + u.offset, u.data.constData(), size_t(u.data.size()));
+ } else {
+ trackedBufferBarrier(cbD, bufD, QGles2Buffer::AccessUpdate);
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BufferSubData;
+ cmd.args.bufferSubData.target = bufD->targetForDataOps;
+ cmd.args.bufferSubData.buffer = bufD->buffer;
+ cmd.args.bufferSubData.offset = u.offset;
+ cmd.args.bufferSubData.size = u.data.size();
+ cmd.args.bufferSubData.data = cbD->retainData(u.data);
+ cbD->commands.append(cmd);
+ }
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::Read) {
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, u.buf);
+ if (bufD->m_usage.testFlag(QRhiBuffer::UniformBuffer)) {
+ u.result->data.resize(u.readSize);
+ memcpy(u.result->data.data(), bufD->ubuf.constData() + u.offset, size_t(u.readSize));
+ if (u.result->completed)
+ u.result->completed();
+ } else {
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::GetBufferSubData;
+ cmd.args.getBufferSubData.result = u.result;
+ cmd.args.getBufferSubData.target = bufD->targetForDataOps;
+ cmd.args.getBufferSubData.buffer = bufD->buffer;
+ cmd.args.getBufferSubData.offset = u.offset;
+ cmd.args.getBufferSubData.size = u.readSize;
+ cbD->commands.append(cmd);
+ }
+ }
+ }
+
+ for (const QRhiResourceUpdateBatchPrivate::TextureOp &u : ud->textureOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Upload) {
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, u.dst);
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ enqueueSubresUpload(texD, cbD, layer, level, subresDesc);
+ }
+ }
+ texD->specified = true;
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Copy) {
+ Q_ASSERT(u.src && u.dst);
+ QGles2Texture *srcD = QRHI_RES(QGles2Texture, u.src);
+ QGles2Texture *dstD = QRHI_RES(QGles2Texture, u.dst);
+
+ trackedImageBarrier(cbD, srcD, QGles2Texture::AccessRead);
+ trackedImageBarrier(cbD, dstD, QGles2Texture::AccessUpdate);
+
+ const QSize mipSize = q->sizeForMipLevel(u.desc.sourceLevel(), srcD->m_pixelSize);
+ const QSize copySize = u.desc.pixelSize().isEmpty() ? mipSize : u.desc.pixelSize();
+ // do not translate coordinates, even if sp is bottom-left from gl's pov
+ const QPoint sp = u.desc.sourceTopLeft();
+ const QPoint dp = u.desc.destinationTopLeft();
+
+ const GLenum srcFaceTargetBase = srcD->m_flags.testFlag(QRhiTexture::CubeMap)
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : srcD->target;
+ const GLenum dstFaceTargetBase = dstD->m_flags.testFlag(QRhiTexture::CubeMap)
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : dstD->target;
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::CopyTex;
+
+ cmd.args.copyTex.srcFaceTarget = srcFaceTargetBase + uint(u.desc.sourceLayer());
+ cmd.args.copyTex.srcTexture = srcD->texture;
+ cmd.args.copyTex.srcLevel = u.desc.sourceLevel();
+ cmd.args.copyTex.srcX = sp.x();
+ cmd.args.copyTex.srcY = sp.y();
+
+ cmd.args.copyTex.dstTarget = dstD->target;
+ cmd.args.copyTex.dstTexture = dstD->texture;
+ cmd.args.copyTex.dstFaceTarget = dstFaceTargetBase + uint(u.desc.destinationLayer());
+ cmd.args.copyTex.dstLevel = u.desc.destinationLevel();
+ cmd.args.copyTex.dstX = dp.x();
+ cmd.args.copyTex.dstY = dp.y();
+
+ cmd.args.copyTex.w = copySize.width();
+ cmd.args.copyTex.h = copySize.height();
+
+ cbD->commands.append(cmd);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Read) {
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::ReadPixels;
+ cmd.args.readPixels.result = u.result;
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, u.rb.texture());
+ if (texD)
+ trackedImageBarrier(cbD, texD, QGles2Texture::AccessRead);
+ cmd.args.readPixels.texture = texD ? texD->texture : 0;
+ if (texD) {
+ const QSize readImageSize = q->sizeForMipLevel(u.rb.level(), texD->m_pixelSize);
+ cmd.args.readPixels.w = readImageSize.width();
+ cmd.args.readPixels.h = readImageSize.height();
+ cmd.args.readPixels.format = texD->m_format;
+ const GLenum faceTargetBase = texD->m_flags.testFlag(QRhiTexture::CubeMap)
+ ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : texD->target;
+ cmd.args.readPixels.readTarget = faceTargetBase + uint(u.rb.layer());
+ cmd.args.readPixels.level = u.rb.level();
+ }
+ cbD->commands.append(cmd);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::GenMips) {
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, u.dst);
+ trackedImageBarrier(cbD, texD, QGles2Texture::AccessFramebuffer);
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::GenMip;
+ cmd.args.genMip.target = texD->target;
+ cmd.args.genMip.texture = texD->texture;
+ cbD->commands.append(cmd);
+ }
+ }
+
+ ud->free();
+}
+
+static inline GLenum toGlTopology(QRhiGraphicsPipeline::Topology t)
+{
+ switch (t) {
+ case QRhiGraphicsPipeline::Triangles:
+ return GL_TRIANGLES;
+ case QRhiGraphicsPipeline::TriangleStrip:
+ return GL_TRIANGLE_STRIP;
+ case QRhiGraphicsPipeline::TriangleFan:
+ return GL_TRIANGLE_FAN;
+ case QRhiGraphicsPipeline::Lines:
+ return GL_LINES;
+ case QRhiGraphicsPipeline::LineStrip:
+ return GL_LINE_STRIP;
+ case QRhiGraphicsPipeline::Points:
+ return GL_POINTS;
+ default:
+ Q_UNREACHABLE();
+ return GL_TRIANGLES;
+ }
+}
+
+static inline GLenum toGlCullMode(QRhiGraphicsPipeline::CullMode c)
+{
+ switch (c) {
+ case QRhiGraphicsPipeline::Front:
+ return GL_FRONT;
+ case QRhiGraphicsPipeline::Back:
+ return GL_BACK;
+ default:
+ Q_UNREACHABLE();
+ return GL_BACK;
+ }
+}
+
+static inline GLenum toGlFrontFace(QRhiGraphicsPipeline::FrontFace f)
+{
+ switch (f) {
+ case QRhiGraphicsPipeline::CCW:
+ return GL_CCW;
+ case QRhiGraphicsPipeline::CW:
+ return GL_CW;
+ default:
+ Q_UNREACHABLE();
+ return GL_CCW;
+ }
+}
+
+static inline GLenum toGlBlendFactor(QRhiGraphicsPipeline::BlendFactor f)
+{
+ switch (f) {
+ case QRhiGraphicsPipeline::Zero:
+ return GL_ZERO;
+ case QRhiGraphicsPipeline::One:
+ return GL_ONE;
+ case QRhiGraphicsPipeline::SrcColor:
+ return GL_SRC_COLOR;
+ case QRhiGraphicsPipeline::OneMinusSrcColor:
+ return GL_ONE_MINUS_SRC_COLOR;
+ case QRhiGraphicsPipeline::DstColor:
+ return GL_DST_COLOR;
+ case QRhiGraphicsPipeline::OneMinusDstColor:
+ return GL_ONE_MINUS_DST_COLOR;
+ case QRhiGraphicsPipeline::SrcAlpha:
+ return GL_SRC_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusSrcAlpha:
+ return GL_ONE_MINUS_SRC_ALPHA;
+ case QRhiGraphicsPipeline::DstAlpha:
+ return GL_DST_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusDstAlpha:
+ return GL_ONE_MINUS_DST_ALPHA;
+ case QRhiGraphicsPipeline::ConstantColor:
+ return GL_CONSTANT_COLOR;
+ case QRhiGraphicsPipeline::OneMinusConstantColor:
+ return GL_ONE_MINUS_CONSTANT_COLOR;
+ case QRhiGraphicsPipeline::ConstantAlpha:
+ return GL_CONSTANT_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusConstantAlpha:
+ return GL_ONE_MINUS_CONSTANT_ALPHA;
+ case QRhiGraphicsPipeline::SrcAlphaSaturate:
+ return GL_SRC_ALPHA_SATURATE;
+ case QRhiGraphicsPipeline::Src1Color:
+ Q_FALLTHROUGH();
+ case QRhiGraphicsPipeline::OneMinusSrc1Color:
+ Q_FALLTHROUGH();
+ case QRhiGraphicsPipeline::Src1Alpha:
+ Q_FALLTHROUGH();
+ case QRhiGraphicsPipeline::OneMinusSrc1Alpha:
+ qWarning("Unsupported blend factor %d", f);
+ return GL_ZERO;
+ default:
+ Q_UNREACHABLE();
+ return GL_ZERO;
+ }
+}
+
+static inline GLenum toGlBlendOp(QRhiGraphicsPipeline::BlendOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Add:
+ return GL_FUNC_ADD;
+ case QRhiGraphicsPipeline::Subtract:
+ return GL_FUNC_SUBTRACT;
+ case QRhiGraphicsPipeline::ReverseSubtract:
+ return GL_FUNC_REVERSE_SUBTRACT;
+ case QRhiGraphicsPipeline::Min:
+ return GL_MIN;
+ case QRhiGraphicsPipeline::Max:
+ return GL_MAX;
+ default:
+ Q_UNREACHABLE();
+ return GL_FUNC_ADD;
+ }
+}
+
+static inline GLenum toGlCompareOp(QRhiGraphicsPipeline::CompareOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Never:
+ return GL_NEVER;
+ case QRhiGraphicsPipeline::Less:
+ return GL_LESS;
+ case QRhiGraphicsPipeline::Equal:
+ return GL_EQUAL;
+ case QRhiGraphicsPipeline::LessOrEqual:
+ return GL_LEQUAL;
+ case QRhiGraphicsPipeline::Greater:
+ return GL_GREATER;
+ case QRhiGraphicsPipeline::NotEqual:
+ return GL_NOTEQUAL;
+ case QRhiGraphicsPipeline::GreaterOrEqual:
+ return GL_GEQUAL;
+ case QRhiGraphicsPipeline::Always:
+ return GL_ALWAYS;
+ default:
+ Q_UNREACHABLE();
+ return GL_ALWAYS;
+ }
+}
+
+static inline GLenum toGlStencilOp(QRhiGraphicsPipeline::StencilOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::StencilZero:
+ return GL_ZERO;
+ case QRhiGraphicsPipeline::Keep:
+ return GL_KEEP;
+ case QRhiGraphicsPipeline::Replace:
+ return GL_REPLACE;
+ case QRhiGraphicsPipeline::IncrementAndClamp:
+ return GL_INCR;
+ case QRhiGraphicsPipeline::DecrementAndClamp:
+ return GL_DECR;
+ case QRhiGraphicsPipeline::Invert:
+ return GL_INVERT;
+ case QRhiGraphicsPipeline::IncrementAndWrap:
+ return GL_INCR_WRAP;
+ case QRhiGraphicsPipeline::DecrementAndWrap:
+ return GL_DECR_WRAP;
+ default:
+ Q_UNREACHABLE();
+ return GL_KEEP;
+ }
+}
+
+static inline GLenum toGlMinFilter(QRhiSampler::Filter f, QRhiSampler::Filter m)
+{
+ switch (f) {
+ case QRhiSampler::Nearest:
+ if (m == QRhiSampler::None)
+ return GL_NEAREST;
+ else
+ return m == QRhiSampler::Nearest ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_LINEAR;
+ case QRhiSampler::Linear:
+ if (m == QRhiSampler::None)
+ return GL_LINEAR;
+ else
+ return m == QRhiSampler::Nearest ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR_MIPMAP_LINEAR;
+ default:
+ Q_UNREACHABLE();
+ return GL_LINEAR;
+ }
+}
+
+static inline GLenum toGlMagFilter(QRhiSampler::Filter f)
+{
+ switch (f) {
+ case QRhiSampler::Nearest:
+ return GL_NEAREST;
+ case QRhiSampler::Linear:
+ return GL_LINEAR;
+ default:
+ Q_UNREACHABLE();
+ return GL_LINEAR;
+ }
+}
+
+static inline GLenum toGlWrapMode(QRhiSampler::AddressMode m)
+{
+ switch (m) {
+ case QRhiSampler::Repeat:
+ return GL_REPEAT;
+ case QRhiSampler::ClampToEdge:
+ return GL_CLAMP_TO_EDGE;
+ case QRhiSampler::Mirror:
+ return GL_MIRRORED_REPEAT;
+ case QRhiSampler::MirrorOnce:
+ Q_FALLTHROUGH();
+ case QRhiSampler::Border:
+ qWarning("Unsupported wrap mode %d", m);
+ return GL_CLAMP_TO_EDGE;
+ default:
+ Q_UNREACHABLE();
+ return GL_CLAMP_TO_EDGE;
+ }
+}
+
+static inline GLenum toGlTextureCompareFunc(QRhiSampler::CompareOp op)
+{
+ switch (op) {
+ case QRhiSampler::Never:
+ return GL_NEVER;
+ case QRhiSampler::Less:
+ return GL_LESS;
+ case QRhiSampler::Equal:
+ return GL_EQUAL;
+ case QRhiSampler::LessOrEqual:
+ return GL_LEQUAL;
+ case QRhiSampler::Greater:
+ return GL_GREATER;
+ case QRhiSampler::NotEqual:
+ return GL_NOTEQUAL;
+ case QRhiSampler::GreaterOrEqual:
+ return GL_GEQUAL;
+ case QRhiSampler::Always:
+ return GL_ALWAYS;
+ default:
+ Q_UNREACHABLE();
+ return GL_NEVER;
+ }
+}
+
+static inline QGles2Buffer::Access toGlAccess(QRhiPassResourceTracker::BufferAccess access)
+{
+ switch (access) {
+ case QRhiPassResourceTracker::BufVertexInput:
+ return QGles2Buffer::AccessVertex;
+ case QRhiPassResourceTracker::BufIndexRead:
+ return QGles2Buffer::AccessIndex;
+ case QRhiPassResourceTracker::BufUniformRead:
+ return QGles2Buffer::AccessUniform;
+ case QRhiPassResourceTracker::BufStorageLoad:
+ return QGles2Buffer::AccessStorageRead;
+ case QRhiPassResourceTracker::BufStorageStore:
+ return QGles2Buffer::AccessStorageWrite;
+ case QRhiPassResourceTracker::BufStorageLoadStore:
+ return QGles2Buffer::AccessStorageReadWrite;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return QGles2Buffer::AccessNone;
+}
+
+static inline QRhiPassResourceTracker::UsageState toPassTrackerUsageState(const QGles2Buffer::UsageState &bufUsage)
+{
+ QRhiPassResourceTracker::UsageState u;
+ u.layout = 0; // N/A
+ u.access = bufUsage.access;
+ u.stage = 0; // N/A
+ return u;
+}
+
+static inline QGles2Texture::Access toGlAccess(QRhiPassResourceTracker::TextureAccess access)
+{
+ switch (access) {
+ case QRhiPassResourceTracker::TexSample:
+ return QGles2Texture::AccessSample;
+ case QRhiPassResourceTracker::TexColorOutput:
+ return QGles2Texture::AccessFramebuffer;
+ case QRhiPassResourceTracker::TexDepthOutput:
+ return QGles2Texture::AccessFramebuffer;
+ case QRhiPassResourceTracker::TexStorageLoad:
+ return QGles2Texture::AccessStorageRead;
+ case QRhiPassResourceTracker::TexStorageStore:
+ return QGles2Texture::AccessStorageWrite;
+ case QRhiPassResourceTracker::TexStorageLoadStore:
+ return QGles2Texture::AccessStorageReadWrite;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return QGles2Texture::AccessNone;
+}
+
+static inline QRhiPassResourceTracker::UsageState toPassTrackerUsageState(const QGles2Texture::UsageState &texUsage)
+{
+ QRhiPassResourceTracker::UsageState u;
+ u.layout = 0; // N/A
+ u.access = texUsage.access;
+ u.stage = 0; // N/A
+ return u;
+}
+
+void QRhiGles2::trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker,
+ QGles2Buffer *bufD,
+ QRhiPassResourceTracker::BufferAccess access,
+ QRhiPassResourceTracker::BufferStage stage)
+{
+ QGles2Buffer::UsageState &u(bufD->usageState);
+ passResTracker->registerBuffer(bufD, 0, &access, &stage, toPassTrackerUsageState(u));
+ u.access = toGlAccess(access);
+}
+
+void QRhiGles2::trackedRegisterTexture(QRhiPassResourceTracker *passResTracker,
+ QGles2Texture *texD,
+ QRhiPassResourceTracker::TextureAccess access,
+ QRhiPassResourceTracker::TextureStage stage)
+{
+ QGles2Texture::UsageState &u(texD->usageState);
+ passResTracker->registerTexture(texD, &access, &stage, toPassTrackerUsageState(u));
+ u.access = toGlAccess(access);
+}
+
+void QRhiGles2::executeCommandBuffer(QRhiCommandBuffer *cb)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ GLenum indexType = GL_UNSIGNED_SHORT;
+ quint32 indexStride = sizeof(quint16);
+ quint32 indexOffset = 0;
+
+ for (const QGles2CommandBuffer::Command &cmd : qAsConst(cbD->commands)) {
+ switch (cmd.cmd) {
+ case QGles2CommandBuffer::Command::BeginFrame:
+ if (caps.coreProfile) {
+ if (!vao)
+ f->glGenVertexArrays(1, &vao);
+ f->glBindVertexArray(vao);
+ }
+ break;
+ case QGles2CommandBuffer::Command::EndFrame:
+ if (vao)
+ f->glBindVertexArray(0);
+ break;
+ case QGles2CommandBuffer::Command::ResetFrame:
+ if (vao)
+ f->glBindVertexArray(vao);
+ break;
+ case QGles2CommandBuffer::Command::Viewport:
+ f->glViewport(GLint(cmd.args.viewport.x), GLint(cmd.args.viewport.y), GLsizei(cmd.args.viewport.w), GLsizei(cmd.args.viewport.h));
+ f->glDepthRangef(cmd.args.viewport.d0, cmd.args.viewport.d1);
+ break;
+ case QGles2CommandBuffer::Command::Scissor:
+ f->glScissor(cmd.args.scissor.x, cmd.args.scissor.y, cmd.args.scissor.w, cmd.args.scissor.h);
+ break;
+ case QGles2CommandBuffer::Command::BlendConstants:
+ f->glBlendColor(cmd.args.blendConstants.r, cmd.args.blendConstants.g, cmd.args.blendConstants.b, cmd.args.blendConstants.a);
+ break;
+ case QGles2CommandBuffer::Command::StencilRef:
+ {
+ QGles2GraphicsPipeline *psD = QRHI_RES(QGles2GraphicsPipeline, cmd.args.stencilRef.ps);
+ if (psD) {
+ f->glStencilFuncSeparate(GL_FRONT, toGlCompareOp(psD->m_stencilFront.compareOp), GLint(cmd.args.stencilRef.ref), psD->m_stencilReadMask);
+ f->glStencilFuncSeparate(GL_BACK, toGlCompareOp(psD->m_stencilBack.compareOp), GLint(cmd.args.stencilRef.ref), psD->m_stencilReadMask);
+ } else {
+ qWarning("No graphics pipeline active for setStencilRef; ignored");
+ }
+ }
+ break;
+ case QGles2CommandBuffer::Command::BindVertexBuffer:
+ {
+ QGles2GraphicsPipeline *psD = QRHI_RES(QGles2GraphicsPipeline, cmd.args.bindVertexBuffer.ps);
+ if (psD) {
+ for (auto it = psD->m_vertexInputLayout.cbeginAttributes(), itEnd = psD->m_vertexInputLayout.cendAttributes();
+ it != itEnd; ++it)
+ {
+ const int bindingIdx = it->binding();
+ if (bindingIdx != cmd.args.bindVertexBuffer.binding)
+ continue;
+
+ // we do not support more than one vertex buffer
+ f->glBindBuffer(GL_ARRAY_BUFFER, cmd.args.bindVertexBuffer.buffer);
+
+ const QRhiVertexInputBinding *inputBinding = psD->m_vertexInputLayout.bindingAt(bindingIdx);
+ const int stride = int(inputBinding->stride());
+ int size = 1;
+ GLenum type = GL_FLOAT;
+ bool normalize = false;
+ switch (it->format()) {
+ case QRhiVertexInputAttribute::Float4:
+ type = GL_FLOAT;
+ size = 4;
+ break;
+ case QRhiVertexInputAttribute::Float3:
+ type = GL_FLOAT;
+ size = 3;
+ break;
+ case QRhiVertexInputAttribute::Float2:
+ type = GL_FLOAT;
+ size = 2;
+ break;
+ case QRhiVertexInputAttribute::Float:
+ type = GL_FLOAT;
+ size = 1;
+ break;
+ case QRhiVertexInputAttribute::UNormByte4:
+ type = GL_UNSIGNED_BYTE;
+ normalize = true;
+ size = 4;
+ break;
+ case QRhiVertexInputAttribute::UNormByte2:
+ type = GL_UNSIGNED_BYTE;
+ normalize = true;
+ size = 2;
+ break;
+ case QRhiVertexInputAttribute::UNormByte:
+ type = GL_UNSIGNED_BYTE;
+ normalize = true;
+ size = 1;
+ break;
+ default:
+ break;
+ }
+
+ const int locationIdx = it->location();
+ quint32 ofs = it->offset() + cmd.args.bindVertexBuffer.offset;
+ f->glVertexAttribPointer(GLuint(locationIdx), size, type, normalize, stride,
+ reinterpret_cast<const GLvoid *>(quintptr(ofs)));
+ f->glEnableVertexAttribArray(GLuint(locationIdx));
+ if (inputBinding->classification() == QRhiVertexInputBinding::PerInstance && caps.instancing)
+ f->glVertexAttribDivisor(GLuint(locationIdx), GLuint(inputBinding->instanceStepRate()));
+ }
+ } else {
+ qWarning("No graphics pipeline active for setVertexInput; ignored");
+ }
+ }
+ break;
+ case QGles2CommandBuffer::Command::BindIndexBuffer:
+ indexType = cmd.args.bindIndexBuffer.type;
+ indexStride = indexType == GL_UNSIGNED_SHORT ? sizeof(quint16) : sizeof(quint32);
+ indexOffset = cmd.args.bindIndexBuffer.offset;
+ f->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cmd.args.bindIndexBuffer.buffer);
+ break;
+ case QGles2CommandBuffer::Command::Draw:
+ {
+ QGles2GraphicsPipeline *psD = QRHI_RES(QGles2GraphicsPipeline, cmd.args.draw.ps);
+ if (psD) {
+ if (cmd.args.draw.instanceCount == 1 || !caps.instancing) {
+ f->glDrawArrays(psD->drawMode, GLint(cmd.args.draw.firstVertex), GLsizei(cmd.args.draw.vertexCount));
+ } else {
+ f->glDrawArraysInstanced(psD->drawMode, GLint(cmd.args.draw.firstVertex), GLsizei(cmd.args.draw.vertexCount),
+ GLsizei(cmd.args.draw.instanceCount));
+ }
+ } else {
+ qWarning("No graphics pipeline active for draw; ignored");
+ }
+ }
+ break;
+ case QGles2CommandBuffer::Command::DrawIndexed:
+ {
+ QGles2GraphicsPipeline *psD = QRHI_RES(QGles2GraphicsPipeline, cmd.args.drawIndexed.ps);
+ if (psD) {
+ const GLvoid *ofs = reinterpret_cast<const GLvoid *>(
+ quintptr(cmd.args.drawIndexed.firstIndex * indexStride + indexOffset));
+ if (cmd.args.drawIndexed.instanceCount == 1 || !caps.instancing) {
+ if (cmd.args.drawIndexed.baseVertex != 0 && caps.baseVertex) {
+ f->glDrawElementsBaseVertex(psD->drawMode,
+ GLsizei(cmd.args.drawIndexed.indexCount),
+ indexType,
+ ofs,
+ cmd.args.drawIndexed.baseVertex);
+ } else {
+ f->glDrawElements(psD->drawMode,
+ GLsizei(cmd.args.drawIndexed.indexCount),
+ indexType,
+ ofs);
+ }
+ } else {
+ if (cmd.args.drawIndexed.baseVertex != 0 && caps.baseVertex) {
+ f->glDrawElementsInstancedBaseVertex(psD->drawMode,
+ GLsizei(cmd.args.drawIndexed.indexCount),
+ indexType,
+ ofs,
+ GLsizei(cmd.args.drawIndexed.instanceCount),
+ cmd.args.drawIndexed.baseVertex);
+ } else {
+ f->glDrawElementsInstanced(psD->drawMode,
+ GLsizei(cmd.args.drawIndexed.indexCount),
+ indexType,
+ ofs,
+ GLsizei(cmd.args.drawIndexed.instanceCount));
+ }
+ }
+ } else {
+ qWarning("No graphics pipeline active for drawIndexed; ignored");
+ }
+ }
+ break;
+ case QGles2CommandBuffer::Command::BindGraphicsPipeline:
+ executeBindGraphicsPipeline(cmd.args.bindGraphicsPipeline.ps);
+ break;
+ case QGles2CommandBuffer::Command::BindShaderResources:
+ bindShaderResources(cmd.args.bindShaderResources.maybeGraphicsPs,
+ cmd.args.bindShaderResources.maybeComputePs,
+ cmd.args.bindShaderResources.srb,
+ cmd.args.bindShaderResources.dynamicOffsetPairs,
+ cmd.args.bindShaderResources.dynamicOffsetCount);
+ break;
+ case QGles2CommandBuffer::Command::BindFramebuffer:
+ if (cmd.args.bindFramebuffer.fbo) {
+ f->glBindFramebuffer(GL_FRAMEBUFFER, cmd.args.bindFramebuffer.fbo);
+ if (caps.maxDrawBuffers > 1) {
+ const int colorAttCount = cmd.args.bindFramebuffer.colorAttCount;
+ QVarLengthArray<GLenum, 8> bufs;
+ for (int i = 0; i < colorAttCount; ++i)
+ bufs.append(GL_COLOR_ATTACHMENT0 + uint(i));
+ f->glDrawBuffers(colorAttCount, bufs.constData());
+ }
+ } else {
+ f->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
+ if (caps.maxDrawBuffers > 1) {
+ GLenum bufs = GL_BACK;
+ f->glDrawBuffers(1, &bufs);
+ }
+ }
+ if (caps.srgbCapableDefaultFramebuffer) {
+ if (cmd.args.bindFramebuffer.srgb)
+ f->glEnable(GL_FRAMEBUFFER_SRGB);
+ else
+ f->glDisable(GL_FRAMEBUFFER_SRGB);
+ }
+ break;
+ case QGles2CommandBuffer::Command::Clear:
+ f->glDisable(GL_SCISSOR_TEST);
+ if (cmd.args.clear.mask & GL_COLOR_BUFFER_BIT) {
+ f->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ f->glClearColor(cmd.args.clear.c[0], cmd.args.clear.c[1], cmd.args.clear.c[2], cmd.args.clear.c[3]);
+ }
+ if (cmd.args.clear.mask & GL_DEPTH_BUFFER_BIT) {
+ f->glDepthMask(GL_TRUE);
+ f->glClearDepthf(cmd.args.clear.d);
+ }
+ if (cmd.args.clear.mask & GL_STENCIL_BUFFER_BIT)
+ f->glClearStencil(GLint(cmd.args.clear.s));
+ f->glClear(cmd.args.clear.mask);
+ break;
+ case QGles2CommandBuffer::Command::BufferSubData:
+ f->glBindBuffer(cmd.args.bufferSubData.target, cmd.args.bufferSubData.buffer);
+ f->glBufferSubData(cmd.args.bufferSubData.target, cmd.args.bufferSubData.offset, cmd.args.bufferSubData.size,
+ cmd.args.bufferSubData.data);
+ break;
+ case QGles2CommandBuffer::Command::GetBufferSubData:
+ {
+ QRhiBufferReadbackResult *result = cmd.args.getBufferSubData.result;
+ f->glBindBuffer(cmd.args.getBufferSubData.target, cmd.args.getBufferSubData.buffer);
+ if (caps.gles) {
+ if (caps.properMapBuffer) {
+ void *p = f->glMapBufferRange(cmd.args.getBufferSubData.target,
+ cmd.args.getBufferSubData.offset,
+ cmd.args.getBufferSubData.size,
+ GL_MAP_READ_BIT);
+ if (p) {
+ result->data.resize(cmd.args.getBufferSubData.size);
+ memcpy(result->data.data(), p, size_t(cmd.args.getBufferSubData.size));
+ f->glUnmapBuffer(cmd.args.getBufferSubData.target);
+ }
+ }
+ } else {
+ result->data.resize(cmd.args.getBufferSubData.size);
+ f->glGetBufferSubData(cmd.args.getBufferSubData.target,
+ cmd.args.getBufferSubData.offset,
+ cmd.args.getBufferSubData.size,
+ result->data.data());
+ }
+ if (result->completed)
+ result->completed();
+ }
+ break;
+ case QGles2CommandBuffer::Command::CopyTex:
+ {
+ GLuint fbo;
+ f->glGenFramebuffers(1, &fbo);
+ f->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+ f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ cmd.args.copyTex.srcFaceTarget, cmd.args.copyTex.srcTexture, cmd.args.copyTex.srcLevel);
+ f->glBindTexture(cmd.args.copyTex.dstTarget, cmd.args.copyTex.dstTexture);
+ f->glCopyTexSubImage2D(cmd.args.copyTex.dstFaceTarget, cmd.args.copyTex.dstLevel,
+ cmd.args.copyTex.dstX, cmd.args.copyTex.dstY,
+ cmd.args.copyTex.srcX, cmd.args.copyTex.srcY,
+ cmd.args.copyTex.w, cmd.args.copyTex.h);
+ f->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
+ f->glDeleteFramebuffers(1, &fbo);
+ }
+ break;
+ case QGles2CommandBuffer::Command::ReadPixels:
+ {
+ QRhiReadbackResult *result = cmd.args.readPixels.result;
+ GLuint tex = cmd.args.readPixels.texture;
+ GLuint fbo = 0;
+ int mipLevel = 0;
+ if (tex) {
+ result->pixelSize = QSize(cmd.args.readPixels.w, cmd.args.readPixels.h);
+ result->format = cmd.args.readPixels.format;
+ mipLevel = cmd.args.readPixels.level;
+ if (mipLevel == 0 || caps.nonBaseLevelFramebufferTexture) {
+ f->glGenFramebuffers(1, &fbo);
+ f->glBindFramebuffer(GL_FRAMEBUFFER, fbo);
+ f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ cmd.args.readPixels.readTarget, cmd.args.readPixels.texture, mipLevel);
+ }
+ } else {
+ result->pixelSize = currentSwapChain->pixelSize;
+ result->format = QRhiTexture::RGBA8;
+ // readPixels handles multisample resolving implicitly
+ }
+ result->data.resize(result->pixelSize.width() * result->pixelSize.height() * 4);
+ if (mipLevel == 0 || caps.nonBaseLevelFramebufferTexture) {
+ // With GLES (2.0?) GL_RGBA is the only mandated readback format, so stick with it.
+ f->glReadPixels(0, 0, result->pixelSize.width(), result->pixelSize.height(),
+ GL_RGBA, GL_UNSIGNED_BYTE,
+ result->data.data());
+ } else {
+ result->data.fill('\0');
+ }
+ if (fbo) {
+ f->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
+ f->glDeleteFramebuffers(1, &fbo);
+ }
+ if (result->completed)
+ result->completed();
+ }
+ break;
+ case QGles2CommandBuffer::Command::SubImage:
+ f->glBindTexture(cmd.args.subImage.target, cmd.args.subImage.texture);
+ if (cmd.args.subImage.rowStartAlign != 4)
+ f->glPixelStorei(GL_UNPACK_ALIGNMENT, cmd.args.subImage.rowStartAlign);
+ f->glTexSubImage2D(cmd.args.subImage.faceTarget, cmd.args.subImage.level,
+ cmd.args.subImage.dx, cmd.args.subImage.dy,
+ cmd.args.subImage.w, cmd.args.subImage.h,
+ cmd.args.subImage.glformat, cmd.args.subImage.gltype,
+ cmd.args.subImage.data);
+ if (cmd.args.subImage.rowStartAlign != 4)
+ f->glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ break;
+ case QGles2CommandBuffer::Command::CompressedImage:
+ f->glBindTexture(cmd.args.compressedImage.target, cmd.args.compressedImage.texture);
+ f->glCompressedTexImage2D(cmd.args.compressedImage.faceTarget, cmd.args.compressedImage.level,
+ cmd.args.compressedImage.glintformat,
+ cmd.args.compressedImage.w, cmd.args.compressedImage.h, 0,
+ cmd.args.compressedImage.size, cmd.args.compressedImage.data);
+ break;
+ case QGles2CommandBuffer::Command::CompressedSubImage:
+ f->glBindTexture(cmd.args.compressedSubImage.target, cmd.args.compressedSubImage.texture);
+ f->glCompressedTexSubImage2D(cmd.args.compressedSubImage.faceTarget, cmd.args.compressedSubImage.level,
+ cmd.args.compressedSubImage.dx, cmd.args.compressedSubImage.dy,
+ cmd.args.compressedSubImage.w, cmd.args.compressedSubImage.h,
+ cmd.args.compressedSubImage.glintformat,
+ cmd.args.compressedSubImage.size, cmd.args.compressedSubImage.data);
+ break;
+ case QGles2CommandBuffer::Command::BlitFromRenderbuffer:
+ {
+ GLuint fbo[2];
+ f->glGenFramebuffers(2, fbo);
+ f->glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo[0]);
+ f->glFramebufferRenderbuffer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+ GL_RENDERBUFFER, cmd.args.blitFromRb.renderbuffer);
+ f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo[1]);
+
+ f->glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, cmd.args.blitFromRb.target,
+ cmd.args.blitFromRb.texture, cmd.args.blitFromRb.dstLevel);
+ f->glBlitFramebuffer(0, 0, cmd.args.blitFromRb.w, cmd.args.blitFromRb.h,
+ 0, 0, cmd.args.blitFromRb.w, cmd.args.blitFromRb.h,
+ GL_COLOR_BUFFER_BIT,
+ GL_LINEAR);
+ f->glBindFramebuffer(GL_FRAMEBUFFER, ctx->defaultFramebufferObject());
+ }
+ break;
+ case QGles2CommandBuffer::Command::GenMip:
+ f->glBindTexture(cmd.args.genMip.target, cmd.args.genMip.texture);
+ f->glGenerateMipmap(cmd.args.genMip.target);
+ break;
+ case QGles2CommandBuffer::Command::BindComputePipeline:
+ {
+ QGles2ComputePipeline *psD = QRHI_RES(QGles2ComputePipeline, cmd.args.bindComputePipeline.ps);
+ f->glUseProgram(psD->program);
+ }
+ break;
+ case QGles2CommandBuffer::Command::Dispatch:
+ f->glDispatchCompute(cmd.args.dispatch.x, cmd.args.dispatch.y, cmd.args.dispatch.z);
+ break;
+ case QGles2CommandBuffer::Command::BarriersForPass:
+ {
+ GLbitfield barriers = 0;
+ QRhiPassResourceTracker &tracker(cbD->passResTrackers[cmd.args.barriersForPass.trackerIndex]);
+ // we only care about after-write, not any other accesses, and
+ // cannot tell if something was written in a shader several passes
+ // ago: now the previously written resource may be used with an
+ // access that was not in the previous passes, result in a missing
+ // barrier in theory. Hence setting all barrier bits whenever
+ // something previously written is used for the first time in a
+ // subsequent pass.
+ for (auto it = tracker.cbeginBuffers(), itEnd = tracker.cendBuffers(); it != itEnd; ++it) {
+ QGles2Buffer::Access accessBeforePass = QGles2Buffer::Access(it->stateAtPassBegin.access);
+ if (accessBeforePass == QGles2Buffer::AccessStorageWrite
+ || accessBeforePass == QGles2Buffer::AccessStorageReadWrite)
+ {
+ barriers |= GL_ALL_BARRIER_BITS;
+ }
+ }
+ for (auto it = tracker.cbeginTextures(), itEnd = tracker.cendTextures(); it != itEnd; ++it) {
+ QGles2Texture::Access accessBeforePass = QGles2Texture::Access(it->stateAtPassBegin.access);
+ if (accessBeforePass == QGles2Texture::AccessStorageWrite
+ || accessBeforePass == QGles2Texture::AccessStorageReadWrite)
+ {
+ barriers |= GL_ALL_BARRIER_BITS;
+ }
+ }
+ if (barriers)
+ f->glMemoryBarrier(barriers);
+ }
+ break;
+ case QGles2CommandBuffer::Command::Barrier:
+ f->glMemoryBarrier(cmd.args.barrier.barriers);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void QRhiGles2::executeBindGraphicsPipeline(QRhiGraphicsPipeline *ps)
+{
+ QGles2GraphicsPipeline *psD = QRHI_RES(QGles2GraphicsPipeline, ps);
+
+ // No state tracking logic as of now. Could introduce something to reduce
+ // the number of gl* calls (when using and changing between multiple
+ // pipelines), but then begin/endExternal() should invalidate the cached
+ // state as appropriate.
+
+ if (psD->m_flags.testFlag(QRhiGraphicsPipeline::UsesScissor))
+ f->glEnable(GL_SCISSOR_TEST);
+ else
+ f->glDisable(GL_SCISSOR_TEST);
+ if (psD->m_cullMode == QRhiGraphicsPipeline::None) {
+ f->glDisable(GL_CULL_FACE);
+ } else {
+ f->glEnable(GL_CULL_FACE);
+ f->glCullFace(toGlCullMode(psD->m_cullMode));
+ }
+ f->glFrontFace(toGlFrontFace(psD->m_frontFace));
+ if (!psD->m_targetBlends.isEmpty()) {
+ const QRhiGraphicsPipeline::TargetBlend &blend(psD->m_targetBlends.first()); // no MRT
+ GLboolean wr = blend.colorWrite.testFlag(QRhiGraphicsPipeline::R);
+ GLboolean wg = blend.colorWrite.testFlag(QRhiGraphicsPipeline::G);
+ GLboolean wb = blend.colorWrite.testFlag(QRhiGraphicsPipeline::B);
+ GLboolean wa = blend.colorWrite.testFlag(QRhiGraphicsPipeline::A);
+ f->glColorMask(wr, wg, wb, wa);
+ if (blend.enable) {
+ f->glEnable(GL_BLEND);
+ f->glBlendFuncSeparate(toGlBlendFactor(blend.srcColor),
+ toGlBlendFactor(blend.dstColor),
+ toGlBlendFactor(blend.srcAlpha),
+ toGlBlendFactor(blend.dstAlpha));
+ f->glBlendEquationSeparate(toGlBlendOp(blend.opColor), toGlBlendOp(blend.opAlpha));
+ } else {
+ f->glDisable(GL_BLEND);
+ }
+ } else {
+ f->glDisable(GL_BLEND);
+ f->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ }
+ if (psD->m_depthTest)
+ f->glEnable(GL_DEPTH_TEST);
+ else
+ f->glDisable(GL_DEPTH_TEST);
+ if (psD->m_depthWrite)
+ f->glDepthMask(GL_TRUE);
+ else
+ f->glDepthMask(GL_FALSE);
+ f->glDepthFunc(toGlCompareOp(psD->m_depthOp));
+ if (psD->m_stencilTest) {
+ f->glEnable(GL_STENCIL_TEST);
+ f->glStencilFuncSeparate(GL_FRONT, toGlCompareOp(psD->m_stencilFront.compareOp), 0, psD->m_stencilReadMask);
+ f->glStencilOpSeparate(GL_FRONT,
+ toGlStencilOp(psD->m_stencilFront.failOp),
+ toGlStencilOp(psD->m_stencilFront.depthFailOp),
+ toGlStencilOp(psD->m_stencilFront.passOp));
+ f->glStencilMaskSeparate(GL_FRONT, psD->m_stencilWriteMask);
+ f->glStencilFuncSeparate(GL_BACK, toGlCompareOp(psD->m_stencilBack.compareOp), 0, psD->m_stencilReadMask);
+ f->glStencilOpSeparate(GL_BACK,
+ toGlStencilOp(psD->m_stencilBack.failOp),
+ toGlStencilOp(psD->m_stencilBack.depthFailOp),
+ toGlStencilOp(psD->m_stencilBack.passOp));
+ f->glStencilMaskSeparate(GL_BACK, psD->m_stencilWriteMask);
+ } else {
+ f->glDisable(GL_STENCIL_TEST);
+ }
+
+ if (psD->topology() == QRhiGraphicsPipeline::Lines || psD->topology() == QRhiGraphicsPipeline::LineStrip)
+ f->glLineWidth(psD->m_lineWidth);
+
+ f->glUseProgram(psD->program);
+}
+
+void QRhiGles2::bindShaderResources(QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
+ QRhiShaderResourceBindings *srb,
+ const uint *dynOfsPairs, int dynOfsCount)
+{
+ QGles2ShaderResourceBindings *srbD = QRHI_RES(QGles2ShaderResourceBindings, srb);
+ int texUnit = 0;
+
+ for (int i = 0, ie = srbD->m_bindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->m_bindings.at(i).data();
+
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ int viewOffset = b->u.ubuf.offset;
+ if (dynOfsCount) {
+ for (int j = 0; j < dynOfsCount; ++j) {
+ if (dynOfsPairs[2 * j] == uint(b->binding)) {
+ viewOffset = int(dynOfsPairs[2 * j + 1]);
+ break;
+ }
+ }
+ }
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, b->u.ubuf.buf);
+ const QByteArray bufView = QByteArray::fromRawData(bufD->ubuf.constData() + viewOffset,
+ b->u.ubuf.maybeSize ? b->u.ubuf.maybeSize : bufD->m_size);
+ QVector<QGles2UniformDescription> &uniforms(maybeGraphicsPs ? QRHI_RES(QGles2GraphicsPipeline, maybeGraphicsPs)->uniforms
+ : QRHI_RES(QGles2ComputePipeline, maybeComputePs)->uniforms);
+ for (QGles2UniformDescription &uniform : uniforms) {
+ if (uniform.binding == b->binding) {
+ // in a uniform buffer everything is at least 4 byte aligned
+ // so this should not cause unaligned reads
+ const void *src = bufView.constData() + uniform.offset;
+
+ switch (uniform.type) {
+ case QShaderDescription::Float:
+ f->glUniform1f(uniform.glslLocation, *reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Vec2:
+ f->glUniform2fv(uniform.glslLocation, 1, reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Vec3:
+ f->glUniform3fv(uniform.glslLocation, 1, reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Vec4:
+ f->glUniform4fv(uniform.glslLocation, 1, reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Mat2:
+ f->glUniformMatrix2fv(uniform.glslLocation, 1, GL_FALSE, reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Mat3:
+ f->glUniformMatrix3fv(uniform.glslLocation, 1, GL_FALSE, reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Mat4:
+ f->glUniformMatrix4fv(uniform.glslLocation, 1, GL_FALSE, reinterpret_cast<const float *>(src));
+ break;
+ case QShaderDescription::Int:
+ f->glUniform1i(uniform.glslLocation, *reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Int2:
+ f->glUniform2iv(uniform.glslLocation, 1, reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Int3:
+ f->glUniform3iv(uniform.glslLocation, 1, reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Int4:
+ f->glUniform4iv(uniform.glslLocation, 1, reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Uint:
+ f->glUniform1ui(uniform.glslLocation, *reinterpret_cast<const quint32 *>(src));
+ break;
+ case QShaderDescription::Uint2:
+ f->glUniform2uiv(uniform.glslLocation, 1, reinterpret_cast<const quint32 *>(src));
+ break;
+ case QShaderDescription::Uint3:
+ f->glUniform3uiv(uniform.glslLocation, 1, reinterpret_cast<const quint32 *>(src));
+ break;
+ case QShaderDescription::Uint4:
+ f->glUniform4uiv(uniform.glslLocation, 1, reinterpret_cast<const quint32 *>(src));
+ break;
+ case QShaderDescription::Bool: // a glsl bool is 4 bytes, like (u)int
+ f->glUniform1i(uniform.glslLocation, *reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Bool2:
+ f->glUniform2iv(uniform.glslLocation, 1, reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Bool3:
+ f->glUniform3iv(uniform.glslLocation, 1, reinterpret_cast<const qint32 *>(src));
+ break;
+ case QShaderDescription::Bool4:
+ f->glUniform4iv(uniform.glslLocation, 1, reinterpret_cast<const qint32 *>(src));
+ break;
+ // ### more types
+ default:
+ break;
+ }
+ }
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, b->u.stex.tex);
+ QGles2Sampler *samplerD = QRHI_RES(QGles2Sampler, b->u.stex.sampler);
+ QVector<QGles2SamplerDescription> &samplers(maybeGraphicsPs ? QRHI_RES(QGles2GraphicsPipeline, maybeGraphicsPs)->samplers
+ : QRHI_RES(QGles2ComputePipeline, maybeComputePs)->samplers);
+
+ for (QGles2SamplerDescription &sampler : samplers) {
+ if (sampler.binding == b->binding) {
+ f->glActiveTexture(GL_TEXTURE0 + uint(texUnit));
+ f->glBindTexture(texD->target, texD->texture);
+
+ if (texD->samplerState != samplerD->d) {
+ f->glTexParameteri(texD->target, GL_TEXTURE_MIN_FILTER, GLint(samplerD->d.glminfilter));
+ f->glTexParameteri(texD->target, GL_TEXTURE_MAG_FILTER, GLint(samplerD->d.glmagfilter));
+ f->glTexParameteri(texD->target, GL_TEXTURE_WRAP_S, GLint(samplerD->d.glwraps));
+ f->glTexParameteri(texD->target, GL_TEXTURE_WRAP_T, GLint(samplerD->d.glwrapt));
+ // 3D textures not supported by GLES 2.0 or by us atm...
+ //f->glTexParameteri(texD->target, GL_TEXTURE_WRAP_R, samplerD->d.glwrapr);
+ if (caps.textureCompareMode) {
+ if (samplerD->d.gltexcomparefunc != GL_NEVER) {
+ f->glTexParameteri(texD->target, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
+ f->glTexParameteri(texD->target, GL_TEXTURE_COMPARE_FUNC, GLint(samplerD->d.gltexcomparefunc));
+ } else {
+ f->glTexParameteri(texD->target, GL_TEXTURE_COMPARE_MODE, GL_NONE);
+ }
+ }
+ texD->samplerState = samplerD->d;
+ }
+
+ f->glUniform1i(sampler.glslLocation, texUnit);
+ ++texUnit;
+ }
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, b->u.simage.tex);
+ const bool layered = texD->m_flags.testFlag(QRhiTexture::CubeMap);
+ GLenum access = GL_READ_WRITE;
+ if (b->type == QRhiShaderResourceBinding::ImageLoad)
+ access = GL_READ_ONLY;
+ else if (b->type == QRhiShaderResourceBinding::ImageStore)
+ access = GL_WRITE_ONLY;
+ f->glBindImageTexture(GLuint(b->binding), texD->texture,
+ b->u.simage.level, layered, 0,
+ access, texD->glsizedintformat);
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, b->u.sbuf.buf);
+ if (b->u.sbuf.offset == 0 && b->u.sbuf.maybeSize == 0)
+ f->glBindBufferBase(GL_SHADER_STORAGE_BUFFER, GLuint(b->binding), bufD->buffer);
+ else
+ f->glBindBufferRange(GL_SHADER_STORAGE_BUFFER, GLuint(b->binding), bufD->buffer,
+ b->u.sbuf.offset, b->u.sbuf.maybeSize ? b->u.sbuf.maybeSize : bufD->m_size);
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ if (texUnit > 1)
+ f->glActiveTexture(GL_TEXTURE0);
+}
+
+void QRhiGles2::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ Q_ASSERT(QRHI_RES(QGles2CommandBuffer, cb)->recordingPass == QGles2CommandBuffer::NoPass);
+
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+QGles2RenderTargetData *QRhiGles2::enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD,
+ bool *wantsColorClear, bool *wantsDsClear)
+{
+ QGles2RenderTargetData *rtD = nullptr;
+ QRhiPassResourceTracker &passResTracker(cbD->passResTrackers[cbD->currentPassResTrackerIndex]);
+
+ QGles2CommandBuffer::Command fbCmd;
+ fbCmd.cmd = QGles2CommandBuffer::Command::BindFramebuffer;
+
+ switch (rt->resourceType()) {
+ case QRhiResource::RenderTarget:
+ rtD = &QRHI_RES(QGles2ReferenceRenderTarget, rt)->d;
+ if (wantsColorClear)
+ *wantsColorClear = true;
+ if (wantsDsClear)
+ *wantsDsClear = true;
+ fbCmd.args.bindFramebuffer.fbo = 0;
+ fbCmd.args.bindFramebuffer.colorAttCount = 1;
+ break;
+ case QRhiResource::TextureRenderTarget:
+ {
+ QGles2TextureRenderTarget *rtTex = QRHI_RES(QGles2TextureRenderTarget, rt);
+ rtD = &rtTex->d;
+ if (wantsColorClear)
+ *wantsColorClear = !rtTex->m_flags.testFlag(QRhiTextureRenderTarget::PreserveColorContents);
+ if (wantsDsClear)
+ *wantsDsClear = !rtTex->m_flags.testFlag(QRhiTextureRenderTarget::PreserveDepthStencilContents);
+ fbCmd.args.bindFramebuffer.fbo = rtTex->framebuffer;
+ fbCmd.args.bindFramebuffer.colorAttCount = rtD->colorAttCount;
+
+ for (auto it = rtTex->m_desc.cbeginColorAttachments(), itEnd = rtTex->m_desc.cendColorAttachments();
+ it != itEnd; ++it)
+ {
+ const QRhiColorAttachment &colorAtt(*it);
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, colorAtt.texture());
+ QGles2Texture *resolveTexD = QRHI_RES(QGles2Texture, colorAtt.resolveTexture());
+ if (texD) {
+ trackedRegisterTexture(&passResTracker, texD,
+ QRhiPassResourceTracker::TexColorOutput,
+ QRhiPassResourceTracker::TexColorOutputStage);
+ }
+ if (resolveTexD) {
+ trackedRegisterTexture(&passResTracker, resolveTexD,
+ QRhiPassResourceTracker::TexColorOutput,
+ QRhiPassResourceTracker::TexColorOutputStage);
+ }
+ // renderbuffers cannot be written in shaders (no image store) so
+ // they do not matter here
+ }
+ if (rtTex->m_desc.depthTexture()) {
+ trackedRegisterTexture(&passResTracker, QRHI_RES(QGles2Texture, rtTex->m_desc.depthTexture()),
+ QRhiPassResourceTracker::TexDepthOutput,
+ QRhiPassResourceTracker::TexDepthOutputStage);
+ }
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ fbCmd.args.bindFramebuffer.srgb = rtD->srgbUpdateAndBlend;
+ cbD->commands.append(fbCmd);
+
+ return rtD;
+}
+
+void QRhiGles2::enqueueBarriersForPass(QGles2CommandBuffer *cbD)
+{
+ cbD->passResTrackers.append(QRhiPassResourceTracker());
+ cbD->currentPassResTrackerIndex = cbD->passResTrackers.count() - 1;
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BarriersForPass;
+ cmd.args.barriersForPass.trackerIndex = cbD->currentPassResTrackerIndex;
+ cbD->commands.append(cmd);
+}
+
+void QRhiGles2::beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+
+ // Get a new resource tracker. Then add a command that will generate
+ // glMemoryBarrier() calls based on that tracker when submitted.
+ enqueueBarriersForPass(cbD);
+
+ bool wantsColorClear, wantsDsClear;
+ QGles2RenderTargetData *rtD = enqueueBindFramebuffer(rt, cbD, &wantsColorClear, &wantsDsClear);
+
+ QGles2CommandBuffer::Command clearCmd;
+ clearCmd.cmd = QGles2CommandBuffer::Command::Clear;
+ clearCmd.args.clear.mask = 0;
+ if (rtD->colorAttCount && wantsColorClear)
+ clearCmd.args.clear.mask |= GL_COLOR_BUFFER_BIT;
+ if (rtD->dsAttCount && wantsDsClear)
+ clearCmd.args.clear.mask |= GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT;
+ clearCmd.args.clear.c[0] = float(colorClearValue.redF());
+ clearCmd.args.clear.c[1] = float(colorClearValue.greenF());
+ clearCmd.args.clear.c[2] = float(colorClearValue.blueF());
+ clearCmd.args.clear.c[3] = float(colorClearValue.alphaF());
+ clearCmd.args.clear.d = depthStencilClearValue.depthClearValue();
+ clearCmd.args.clear.s = depthStencilClearValue.stencilClearValue();
+ cbD->commands.append(clearCmd);
+
+ cbD->recordingPass = QGles2CommandBuffer::RenderPass;
+ cbD->currentTarget = rt;
+
+ cbD->resetCachedState();
+}
+
+void QRhiGles2::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::RenderPass);
+
+ if (cbD->currentTarget->resourceType() == QRhiResource::TextureRenderTarget) {
+ QGles2TextureRenderTarget *rtTex = QRHI_RES(QGles2TextureRenderTarget, cbD->currentTarget);
+ if (rtTex->m_desc.cbeginColorAttachments() != rtTex->m_desc.cendColorAttachments()) {
+ // handle only 1 color attachment and only (msaa) renderbuffer
+ const QRhiColorAttachment &colorAtt(*rtTex->m_desc.cbeginColorAttachments());
+ if (colorAtt.resolveTexture()) {
+ Q_ASSERT(colorAtt.renderBuffer());
+ QGles2RenderBuffer *rbD = QRHI_RES(QGles2RenderBuffer, colorAtt.renderBuffer());
+ const QSize size = colorAtt.resolveTexture()->pixelSize();
+ if (rbD->pixelSize() != size) {
+ qWarning("Resolve source (%dx%d) and target (%dx%d) size does not match",
+ rbD->pixelSize().width(), rbD->pixelSize().height(), size.width(), size.height());
+ }
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BlitFromRenderbuffer;
+ cmd.args.blitFromRb.renderbuffer = rbD->renderbuffer;
+ cmd.args.blitFromRb.w = size.width();
+ cmd.args.blitFromRb.h = size.height();
+ QGles2Texture *colorTexD = QRHI_RES(QGles2Texture, colorAtt.resolveTexture());
+ const GLenum faceTargetBase = colorTexD->m_flags.testFlag(QRhiTexture::CubeMap) ? GL_TEXTURE_CUBE_MAP_POSITIVE_X
+ : colorTexD->target;
+ cmd.args.blitFromRb.target = faceTargetBase + uint(colorAtt.resolveLayer());
+ cmd.args.blitFromRb.texture = colorTexD->texture;
+ cmd.args.blitFromRb.dstLevel = colorAtt.resolveLevel();
+ cbD->commands.append(cmd);
+ }
+ }
+ }
+
+ cbD->recordingPass = QGles2CommandBuffer::NoPass;
+ cbD->currentTarget = nullptr;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiGles2::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+
+ enqueueBarriersForPass(cbD);
+
+ cbD->recordingPass = QGles2CommandBuffer::ComputePass;
+
+ cbD->resetCachedState();
+}
+
+void QRhiGles2::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::ComputePass);
+
+ cbD->recordingPass = QGles2CommandBuffer::NoPass;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiGles2::setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::ComputePass);
+ QGles2ComputePipeline *psD = QRHI_RES(QGles2ComputePipeline, ps);
+ const bool pipelineChanged = cbD->currentComputePipeline != ps || cbD->currentPipelineGeneration != psD->generation;
+
+ if (pipelineChanged) {
+ cbD->currentGraphicsPipeline = nullptr;
+ cbD->currentComputePipeline = ps;
+ cbD->currentPipelineGeneration = psD->generation;
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::BindComputePipeline;
+ cmd.args.bindComputePipeline.ps = ps;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiGles2::dispatch(QRhiCommandBuffer *cb, int x, int y, int z)
+{
+ QGles2CommandBuffer *cbD = QRHI_RES(QGles2CommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QGles2CommandBuffer::ComputePass);
+
+ QGles2CommandBuffer::Command cmd;
+ cmd.cmd = QGles2CommandBuffer::Command::Dispatch;
+ cmd.args.dispatch.x = GLuint(x);
+ cmd.args.dispatch.y = GLuint(y);
+ cmd.args.dispatch.z = GLuint(z);
+ cbD->commands.append(cmd);
+}
+
+static inline GLenum toGlShaderType(QRhiShaderStage::Type type)
+{
+ switch (type) {
+ case QRhiShaderStage::Vertex:
+ return GL_VERTEX_SHADER;
+ case QRhiShaderStage::Fragment:
+ return GL_FRAGMENT_SHADER;
+ case QRhiShaderStage::Compute:
+ return GL_COMPUTE_SHADER;
+ default:
+ Q_UNREACHABLE();
+ return GL_VERTEX_SHADER;
+ }
+}
+
+QByteArray QRhiGles2::shaderSource(const QRhiShaderStage &shaderStage, int *glslVersion)
+{
+ const QShader bakedShader = shaderStage.shader();
+ QVector<int> versionsToTry;
+ QByteArray source;
+ if (caps.gles) {
+ if (caps.ctxMajor > 3 || (caps.ctxMajor == 3 && caps.ctxMinor >= 2)) {
+ versionsToTry << 320 << 310 << 300 << 100;
+ } else if (caps.ctxMajor == 3 && caps.ctxMinor == 1) {
+ versionsToTry << 310 << 300 << 100;
+ } else if (caps.ctxMajor == 3 && caps.ctxMinor == 0) {
+ versionsToTry << 300 << 100;
+ } else {
+ versionsToTry << 100;
+ }
+ for (int v : versionsToTry) {
+ QShaderVersion ver(v, QShaderVersion::GlslEs);
+ source = bakedShader.shader({ QShader::GlslShader, ver, shaderStage.shaderVariant() }).shader();
+ if (!source.isEmpty()) {
+ if (glslVersion)
+ *glslVersion = v;
+ break;
+ }
+ }
+ } else {
+ if (caps.ctxMajor > 4 || (caps.ctxMajor == 4 && caps.ctxMinor >= 6)) {
+ versionsToTry << 460 << 450 << 440 << 430 << 420 << 410 << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 4 && caps.ctxMinor == 5) {
+ versionsToTry << 450 << 440 << 430 << 420 << 410 << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 4 && caps.ctxMinor == 4) {
+ versionsToTry << 440 << 430 << 420 << 410 << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 4 && caps.ctxMinor == 3) {
+ versionsToTry << 430 << 420 << 410 << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 4 && caps.ctxMinor == 2) {
+ versionsToTry << 420 << 410 << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 4 && caps.ctxMinor == 1) {
+ versionsToTry << 410 << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 4 && caps.ctxMinor == 0) {
+ versionsToTry << 400 << 330 << 150;
+ } else if (caps.ctxMajor == 3 && caps.ctxMinor == 3) {
+ versionsToTry << 330 << 150;
+ } else if (caps.ctxMajor == 3 && caps.ctxMinor == 2) {
+ versionsToTry << 150;
+ }
+ if (!caps.coreProfile)
+ versionsToTry << 120;
+ for (int v : versionsToTry) {
+ source = bakedShader.shader({ QShader::GlslShader, v, shaderStage.shaderVariant() }).shader();
+ if (!source.isEmpty()) {
+ if (glslVersion)
+ *glslVersion = v;
+ break;
+ }
+ }
+ }
+ if (source.isEmpty()) {
+ qWarning() << "No GLSL shader code found (versions tried: " << versionsToTry
+ << ") in baked shader" << bakedShader;
+ }
+ return source;
+}
+
+bool QRhiGles2::compileShader(GLuint program, const QRhiShaderStage &shaderStage, int *glslVersion)
+{
+ const QByteArray source = shaderSource(shaderStage, glslVersion);
+ if (source.isEmpty())
+ return false;
+
+ GLuint shader;
+ auto cacheIt = m_shaderCache.constFind(shaderStage);
+ if (cacheIt != m_shaderCache.constEnd()) {
+ shader = *cacheIt;
+ } else {
+ shader = f->glCreateShader(toGlShaderType(shaderStage.type()));
+ const char *srcStr = source.constData();
+ const GLint srcLength = source.count();
+ f->glShaderSource(shader, 1, &srcStr, &srcLength);
+ f->glCompileShader(shader);
+ GLint compiled = 0;
+ f->glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+ if (!compiled) {
+ GLint infoLogLength = 0;
+ f->glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLength);
+ QByteArray log;
+ if (infoLogLength > 1) {
+ GLsizei length = 0;
+ log.resize(infoLogLength);
+ f->glGetShaderInfoLog(shader, infoLogLength, &length, log.data());
+ }
+ qWarning("Failed to compile shader: %s\nSource was:\n%s", log.constData(), source.constData());
+ return false;
+ }
+ if (m_shaderCache.count() >= MAX_SHADER_CACHE_ENTRIES) {
+ // Use the simplest strategy: too many cached shaders -> drop them all.
+ for (uint shader : m_shaderCache)
+ f->glDeleteShader(shader); // does not actually get released yet when attached to a not-yet-released program
+ m_shaderCache.clear();
+ }
+ m_shaderCache.insert(shaderStage, shader);
+ }
+
+ f->glAttachShader(program, shader);
+
+ return true;
+}
+
+bool QRhiGles2::linkProgram(GLuint program)
+{
+ f->glLinkProgram(program);
+ GLint linked = 0;
+ f->glGetProgramiv(program, GL_LINK_STATUS, &linked);
+ if (!linked) {
+ GLint infoLogLength = 0;
+ f->glGetProgramiv(program, GL_INFO_LOG_LENGTH, &infoLogLength);
+ QByteArray log;
+ if (infoLogLength > 1) {
+ GLsizei length = 0;
+ log.resize(infoLogLength);
+ f->glGetProgramInfoLog(program, infoLogLength, &length, log.data());
+ }
+ qWarning("Failed to link shader program: %s", log.constData());
+ return false;
+ }
+ return true;
+}
+
+void QRhiGles2::gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
+ QVector<QGles2UniformDescription> *dst)
+{
+ const QByteArray prefix = ub.structName.toUtf8() + '.';
+ for (const QShaderDescription::BlockVariable &blockMember : ub.members) {
+ // ### no array support for now
+ QGles2UniformDescription uniform;
+ uniform.type = blockMember.type;
+ const QByteArray name = prefix + blockMember.name.toUtf8();
+ uniform.glslLocation = f->glGetUniformLocation(program, name.constData());
+ if (uniform.glslLocation >= 0) {
+ uniform.binding = ub.binding;
+ uniform.offset = uint(blockMember.offset);
+ uniform.size = blockMember.size;
+ dst->append(uniform);
+ }
+ }
+}
+
+void QRhiGles2::gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
+ QVector<QGles2SamplerDescription> *dst)
+{
+ QGles2SamplerDescription sampler;
+ const QByteArray name = v.name.toUtf8();
+ sampler.glslLocation = f->glGetUniformLocation(program, name.constData());
+ if (sampler.glslLocation >= 0) {
+ sampler.binding = v.binding;
+ dst->append(sampler);
+ }
+}
+
+bool QRhiGles2::isProgramBinaryDiskCacheEnabled() const
+{
+ static QOpenGLProgramBinarySupportCheckWrapper checker;
+ return checker.get(ctx)->isSupported();
+}
+
+Q_GLOBAL_STATIC(QOpenGLProgramBinaryCache, qrhi_programBinaryCache);
+
+static inline QShader::Stage toShaderStage(QRhiShaderStage::Type type)
+{
+ switch (type) {
+ case QRhiShaderStage::Vertex:
+ return QShader::VertexStage;
+ case QRhiShaderStage::Fragment:
+ return QShader::FragmentStage;
+ case QRhiShaderStage::Compute:
+ return QShader::ComputeStage;
+ default:
+ Q_UNREACHABLE();
+ return QShader::VertexStage;
+ }
+}
+
+QRhiGles2::DiskCacheResult QRhiGles2::tryLoadFromDiskCache(const QRhiShaderStage *stages, int stageCount,
+ GLuint program, QByteArray *cacheKey)
+{
+ QRhiGles2::DiskCacheResult result = QRhiGles2::DiskCacheMiss;
+ QByteArray diskCacheKey;
+
+ if (isProgramBinaryDiskCacheEnabled()) {
+ QOpenGLProgramBinaryCache::ProgramDesc binaryProgram;
+ for (int i = 0; i < stageCount; ++i) {
+ const QRhiShaderStage &stage(stages[i]);
+ const QByteArray source = shaderSource(stage, nullptr);
+ if (source.isEmpty())
+ return QRhiGles2::DiskCacheError;
+ binaryProgram.shaders.append(QOpenGLProgramBinaryCache::ShaderDesc(toShaderStage(stage.type()), source));
+ }
+
+ diskCacheKey = binaryProgram.cacheKey();
+ if (qrhi_programBinaryCache()->load(diskCacheKey, program)) {
+ qCDebug(lcOpenGLProgramDiskCache, "Program binary received from cache, program %u, key %s",
+ program, diskCacheKey.constData());
+ result = QRhiGles2::DiskCacheHit;
+ }
+ }
+
+ if (cacheKey)
+ *cacheKey = diskCacheKey;
+
+ return result;
+}
+
+void QRhiGles2::trySaveToDiskCache(GLuint program, const QByteArray &cacheKey)
+{
+ if (isProgramBinaryDiskCacheEnabled()) {
+ qCDebug(lcOpenGLProgramDiskCache, "Saving program binary, program %u, key %s",
+ program, cacheKey.constData());
+ qrhi_programBinaryCache()->save(cacheKey, program);
+ }
+}
+
+QGles2Buffer::QGles2Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size)
+ : QRhiBuffer(rhi, type, usage, size)
+{
+}
+
+QGles2Buffer::~QGles2Buffer()
+{
+ release();
+}
+
+void QGles2Buffer::release()
+{
+ if (!buffer)
+ return;
+
+ QRhiGles2::DeferredReleaseEntry e;
+ e.type = QRhiGles2::DeferredReleaseEntry::Buffer;
+
+ e.buffer.buffer = buffer;
+
+ buffer = 0;
+
+ QRHI_RES_RHI(QRhiGles2);
+ rhiD->releaseQueue.append(e);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseBuffer(this));
+ rhiD->unregisterResource(this);
+}
+
+bool QGles2Buffer::build()
+{
+ if (buffer)
+ release();
+
+ QRHI_RES_RHI(QRhiGles2);
+ QRHI_PROF;
+
+ const int nonZeroSize = m_size <= 0 ? 256 : m_size;
+
+ if (m_usage.testFlag(QRhiBuffer::UniformBuffer)) {
+ if (int(m_usage) != QRhiBuffer::UniformBuffer) {
+ qWarning("Uniform buffer: multiple usages specified, this is not supported by the OpenGL backend");
+ return false;
+ }
+ ubuf.resize(nonZeroSize);
+ QRHI_PROF_F(newBuffer(this, uint(nonZeroSize), 0, 1));
+ return true;
+ }
+
+ if (!rhiD->ensureContext())
+ return false;
+
+ targetForDataOps = GL_ARRAY_BUFFER;
+ if (m_usage.testFlag(QRhiBuffer::IndexBuffer))
+ targetForDataOps = GL_ELEMENT_ARRAY_BUFFER;
+ else if (m_usage.testFlag(QRhiBuffer::StorageBuffer))
+ targetForDataOps = GL_SHADER_STORAGE_BUFFER;
+
+ rhiD->f->glGenBuffers(1, &buffer);
+ rhiD->f->glBindBuffer(targetForDataOps, buffer);
+ rhiD->f->glBufferData(targetForDataOps, nonZeroSize, nullptr, m_type == Dynamic ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW);
+
+ usageState.access = AccessNone;
+
+ QRHI_PROF_F(newBuffer(this, uint(nonZeroSize), 1, 0));
+ rhiD->registerResource(this);
+ return true;
+}
+
+QGles2RenderBuffer::QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+ : QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
+{
+}
+
+QGles2RenderBuffer::~QGles2RenderBuffer()
+{
+ release();
+}
+
+void QGles2RenderBuffer::release()
+{
+ if (!renderbuffer)
+ return;
+
+ QRhiGles2::DeferredReleaseEntry e;
+ e.type = QRhiGles2::DeferredReleaseEntry::RenderBuffer;
+
+ e.renderbuffer.renderbuffer = renderbuffer;
+ e.renderbuffer.renderbuffer2 = stencilRenderbuffer;
+
+ renderbuffer = 0;
+ stencilRenderbuffer = 0;
+
+ QRHI_RES_RHI(QRhiGles2);
+ rhiD->releaseQueue.append(e);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseRenderBuffer(this));
+ rhiD->unregisterResource(this);
+}
+
+bool QGles2RenderBuffer::build()
+{
+ if (renderbuffer)
+ release();
+
+ QRHI_RES_RHI(QRhiGles2);
+ QRHI_PROF;
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+
+ if (m_flags.testFlag(UsedWithSwapChainOnly)) {
+ if (m_type == DepthStencil) {
+ QRHI_PROF_F(newRenderBuffer(this, false, true, samples));
+ return true;
+ }
+
+ qWarning("RenderBuffer: UsedWithSwapChainOnly is meaningless in combination with Color");
+ }
+
+ if (!rhiD->ensureContext())
+ return false;
+
+ rhiD->f->glGenRenderbuffers(1, &renderbuffer);
+ rhiD->f->glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
+
+ const QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+
+ switch (m_type) {
+ case QRhiRenderBuffer::DepthStencil:
+ if (rhiD->caps.msaaRenderBuffer && samples > 1) {
+ const GLenum storage = rhiD->caps.needsDepthStencilCombinedAttach ? GL_DEPTH_STENCIL : GL_DEPTH24_STENCIL8;
+ rhiD->f->glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, storage,
+ size.width(), size.height());
+ stencilRenderbuffer = 0;
+ } else if (rhiD->caps.packedDepthStencil || rhiD->caps.needsDepthStencilCombinedAttach) {
+ const GLenum storage = rhiD->caps.needsDepthStencilCombinedAttach ? GL_DEPTH_STENCIL : GL_DEPTH24_STENCIL8;
+ rhiD->f->glRenderbufferStorage(GL_RENDERBUFFER, storage,
+ size.width(), size.height());
+ stencilRenderbuffer = 0;
+ } else {
+ GLenum depthStorage = GL_DEPTH_COMPONENT;
+ if (rhiD->caps.gles) {
+ if (rhiD->caps.depth24)
+ depthStorage = GL_DEPTH_COMPONENT24;
+ else
+ depthStorage = GL_DEPTH_COMPONENT16; // plain ES 2.0 only has this
+ }
+ const GLenum stencilStorage = rhiD->caps.gles ? GL_STENCIL_INDEX8 : GL_STENCIL_INDEX;
+ rhiD->f->glRenderbufferStorage(GL_RENDERBUFFER, depthStorage,
+ size.width(), size.height());
+ rhiD->f->glGenRenderbuffers(1, &stencilRenderbuffer);
+ rhiD->f->glBindRenderbuffer(GL_RENDERBUFFER, stencilRenderbuffer);
+ rhiD->f->glRenderbufferStorage(GL_RENDERBUFFER, stencilStorage,
+ size.width(), size.height());
+ }
+ QRHI_PROF_F(newRenderBuffer(this, false, false, samples));
+ break;
+ case QRhiRenderBuffer::Color:
+ if (rhiD->caps.msaaRenderBuffer && samples > 1)
+ rhiD->f->glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, GL_RGBA8,
+ size.width(), size.height());
+ else
+ rhiD->f->glRenderbufferStorage(GL_RENDERBUFFER, rhiD->caps.rgba8Format ? GL_RGBA8 : GL_RGBA4,
+ size.width(), size.height());
+ QRHI_PROF_F(newRenderBuffer(this, false, false, samples));
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ rhiD->registerResource(this);
+ return true;
+}
+
+QRhiTexture::Format QGles2RenderBuffer::backingFormat() const
+{
+ return m_type == Color ? QRhiTexture::RGBA8 : QRhiTexture::UnknownFormat;
+}
+
+QGles2Texture::QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags)
+ : QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
+{
+}
+
+QGles2Texture::~QGles2Texture()
+{
+ release();
+}
+
+void QGles2Texture::release()
+{
+ if (!texture)
+ return;
+
+ QRhiGles2::DeferredReleaseEntry e;
+ e.type = QRhiGles2::DeferredReleaseEntry::Texture;
+
+ e.texture.texture = texture;
+
+ texture = 0;
+ specified = false;
+ nativeHandlesStruct.texture = 0;
+
+ QRHI_RES_RHI(QRhiGles2);
+ if (owns)
+ rhiD->releaseQueue.append(e);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseTexture(this));
+ rhiD->unregisterResource(this);
+}
+
+bool QGles2Texture::prepareBuild(QSize *adjustedSize)
+{
+ if (texture)
+ release();
+
+ QRHI_RES_RHI(QRhiGles2);
+ if (!rhiD->ensureContext())
+ return false;
+
+ const QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+ const bool isCompressed = rhiD->isCompressedFormat(m_format);
+
+ target = isCube ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D;
+ mipLevelCount = hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1;
+ gltype = GL_UNSIGNED_BYTE;
+
+ if (isCompressed) {
+ if (m_flags.testFlag(UsedWithLoadStore)) {
+ qWarning("Compressed texture cannot be used with image load/store");
+ return false;
+ }
+ glintformat = toGlCompressedTextureFormat(m_format, m_flags);
+ if (!glintformat) {
+ qWarning("Compressed format %d not mappable to GL compressed format", m_format);
+ return false;
+ }
+ glsizedintformat = glintformat;
+ glformat = GL_RGBA;
+ } else {
+ switch (m_format) {
+ case QRhiTexture::RGBA8:
+ glintformat = GL_RGBA;
+ glsizedintformat = rhiD->caps.rgba8Format ? GL_RGBA8 : GL_RGBA;
+ glformat = GL_RGBA;
+ break;
+ case QRhiTexture::BGRA8:
+ glintformat = rhiD->caps.bgraInternalFormat ? GL_BGRA : GL_RGBA;
+ glsizedintformat = rhiD->caps.rgba8Format ? GL_RGBA8 : GL_RGBA;
+ glformat = GL_BGRA;
+ break;
+ case QRhiTexture::R16:
+ glintformat = GL_R16;
+ glsizedintformat = glintformat;
+ glformat = GL_RED;
+ gltype = GL_UNSIGNED_SHORT;
+ break;
+ case QRhiTexture::R8:
+ glintformat = GL_R8;
+ glsizedintformat = glintformat;
+ glformat = GL_RED;
+ break;
+ case QRhiTexture::RED_OR_ALPHA8:
+ glintformat = rhiD->caps.coreProfile ? GL_R8 : GL_ALPHA;
+ glsizedintformat = glintformat;
+ glformat = rhiD->caps.coreProfile ? GL_RED : GL_ALPHA;
+ break;
+ case QRhiTexture::RGBA16F:
+ glintformat = GL_RGBA16F;
+ glsizedintformat = glintformat;
+ glformat = GL_RGBA;
+ gltype = GL_HALF_FLOAT;
+ break;
+ case QRhiTexture::RGBA32F:
+ glintformat = GL_RGBA32F;
+ glsizedintformat = glintformat;
+ glformat = GL_RGBA;
+ gltype = GL_FLOAT;
+ break;
+ case QRhiTexture::D16:
+ glintformat = GL_DEPTH_COMPONENT16;
+ glsizedintformat = glintformat;
+ glformat = GL_DEPTH_COMPONENT;
+ gltype = GL_UNSIGNED_SHORT;
+ break;
+ case QRhiTexture::D32F:
+ glintformat = GL_DEPTH_COMPONENT32F;
+ glsizedintformat = glintformat;
+ glformat = GL_DEPTH_COMPONENT;
+ gltype = GL_FLOAT;
+ break;
+ default:
+ Q_UNREACHABLE();
+ glintformat = GL_RGBA;
+ glsizedintformat = rhiD->caps.rgba8Format ? GL_RGBA8 : GL_RGBA;
+ glformat = GL_RGBA;
+ break;
+ }
+ }
+
+ samplerState = QGles2SamplerData();
+
+ usageState.access = AccessNone;
+
+ if (adjustedSize)
+ *adjustedSize = size;
+
+ return true;
+}
+
+bool QGles2Texture::build()
+{
+ QSize size;
+ if (!prepareBuild(&size))
+ return false;
+
+ QRHI_RES_RHI(QRhiGles2);
+ rhiD->f->glGenTextures(1, &texture);
+
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+ const bool isCompressed = rhiD->isCompressedFormat(m_format);
+ if (!isCompressed) {
+ rhiD->f->glBindTexture(target, texture);
+ if (!m_flags.testFlag(UsedWithLoadStore)) {
+ if (hasMipMaps || isCube) {
+ const GLenum faceTargetBase = isCube ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : target;
+ for (int layer = 0, layerCount = isCube ? 6 : 1; layer != layerCount; ++layer) {
+ for (int level = 0; level != mipLevelCount; ++level) {
+ const QSize mipSize = rhiD->q->sizeForMipLevel(level, size);
+ rhiD->f->glTexImage2D(faceTargetBase + uint(layer), level, GLint(glintformat),
+ mipSize.width(), mipSize.height(), 0,
+ glformat, gltype, nullptr);
+ }
+ }
+ } else {
+ rhiD->f->glTexImage2D(target, 0, GLint(glintformat), size.width(), size.height(),
+ 0, glformat, gltype, nullptr);
+ }
+ } else {
+ // Must be specified with immutable storage functions otherwise
+ // bindImageTexture may fail. Also, the internal format must be a
+ // sized format here.
+ rhiD->f->glTexStorage2D(target, mipLevelCount, glsizedintformat, size.width(), size.height());
+ }
+ specified = true;
+ } else {
+ // Cannot use glCompressedTexImage2D without valid data, so defer.
+ // Compressed textures will not be used as render targets so this is
+ // not an issue.
+ specified = false;
+ }
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, true, mipLevelCount, isCube ? 6 : 1, 1));
+
+ owns = true;
+ nativeHandlesStruct.texture = texture;
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+bool QGles2Texture::buildFrom(const QRhiNativeHandles *src)
+{
+ const QRhiGles2TextureNativeHandles *h = static_cast<const QRhiGles2TextureNativeHandles *>(src);
+ if (!h || !h->texture)
+ return false;
+
+ if (!prepareBuild())
+ return false;
+
+ texture = h->texture;
+ specified = true;
+
+ QRHI_RES_RHI(QRhiGles2);
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, false, mipLevelCount, m_flags.testFlag(CubeMap) ? 6 : 1, 1));
+
+ owns = false;
+ nativeHandlesStruct.texture = texture;
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+const QRhiNativeHandles *QGles2Texture::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+QGles2Sampler::QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v)
+ : QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u, v)
+{
+}
+
+QGles2Sampler::~QGles2Sampler()
+{
+ release();
+}
+
+void QGles2Sampler::release()
+{
+ // nothing to do here
+}
+
+bool QGles2Sampler::build()
+{
+ d.glminfilter = toGlMinFilter(m_minFilter, m_mipmapMode);
+ d.glmagfilter = toGlMagFilter(m_magFilter);
+ d.glwraps = toGlWrapMode(m_addressU);
+ d.glwrapt = toGlWrapMode(m_addressV);
+ d.glwrapr = toGlWrapMode(m_addressW);
+ d.gltexcomparefunc = toGlTextureCompareFunc(m_compareOp);
+
+ generation += 1;
+ return true;
+}
+
+// dummy, no Vulkan-style RenderPass+Framebuffer concept here
+QGles2RenderPassDescriptor::QGles2RenderPassDescriptor(QRhiImplementation *rhi)
+ : QRhiRenderPassDescriptor(rhi)
+{
+}
+
+QGles2RenderPassDescriptor::~QGles2RenderPassDescriptor()
+{
+ release();
+}
+
+void QGles2RenderPassDescriptor::release()
+{
+ // nothing to do here
+}
+
+QGles2ReferenceRenderTarget::QGles2ReferenceRenderTarget(QRhiImplementation *rhi)
+ : QRhiRenderTarget(rhi),
+ d(rhi)
+{
+}
+
+QGles2ReferenceRenderTarget::~QGles2ReferenceRenderTarget()
+{
+ release();
+}
+
+void QGles2ReferenceRenderTarget::release()
+{
+ // nothing to do here
+}
+
+QSize QGles2ReferenceRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QGles2ReferenceRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QGles2ReferenceRenderTarget::sampleCount() const
+{
+ return d.sampleCount;
+}
+
+QGles2TextureRenderTarget::QGles2TextureRenderTarget(QRhiImplementation *rhi,
+ const QRhiTextureRenderTargetDescription &desc,
+ Flags flags)
+ : QRhiTextureRenderTarget(rhi, desc, flags),
+ d(rhi)
+{
+}
+
+QGles2TextureRenderTarget::~QGles2TextureRenderTarget()
+{
+ release();
+}
+
+void QGles2TextureRenderTarget::release()
+{
+ if (!framebuffer)
+ return;
+
+ QRhiGles2::DeferredReleaseEntry e;
+ e.type = QRhiGles2::DeferredReleaseEntry::TextureRenderTarget;
+
+ e.textureRenderTarget.framebuffer = framebuffer;
+
+ framebuffer = 0;
+
+ QRHI_RES_RHI(QRhiGles2);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+QRhiRenderPassDescriptor *QGles2TextureRenderTarget::newCompatibleRenderPassDescriptor()
+{
+ return new QGles2RenderPassDescriptor(m_rhi);
+}
+
+bool QGles2TextureRenderTarget::build()
+{
+ QRHI_RES_RHI(QRhiGles2);
+
+ if (framebuffer)
+ release();
+
+ const bool hasColorAttachments = m_desc.cbeginColorAttachments() != m_desc.cendColorAttachments();
+ Q_ASSERT(hasColorAttachments || m_desc.depthTexture());
+ Q_ASSERT(!m_desc.depthStencilBuffer() || !m_desc.depthTexture());
+ const bool hasDepthStencil = m_desc.depthStencilBuffer() || m_desc.depthTexture();
+
+ if (hasColorAttachments) {
+ const int count = m_desc.cendColorAttachments() - m_desc.cbeginColorAttachments();
+ if (count > rhiD->caps.maxDrawBuffers) {
+ qWarning("QGles2TextureRenderTarget: Too many color attachments (%d, max is %d)",
+ count, rhiD->caps.maxDrawBuffers);
+ }
+ }
+ if (m_desc.depthTexture() && !rhiD->caps.depthTexture)
+ qWarning("QGles2TextureRenderTarget: Depth texture is not supported and will be ignored");
+
+ if (!rhiD->ensureContext())
+ return false;
+
+ rhiD->f->glGenFramebuffers(1, &framebuffer);
+ rhiD->f->glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
+
+ d.colorAttCount = 0;
+ int attIndex = 0;
+ for (auto it = m_desc.cbeginColorAttachments(), itEnd = m_desc.cendColorAttachments(); it != itEnd; ++it, ++attIndex) {
+ d.colorAttCount += 1;
+ const QRhiColorAttachment &colorAtt(*it);
+ QRhiTexture *texture = colorAtt.texture();
+ QRhiRenderBuffer *renderBuffer = colorAtt.renderBuffer();
+ Q_ASSERT(texture || renderBuffer);
+ if (texture) {
+ QGles2Texture *texD = QRHI_RES(QGles2Texture, texture);
+ Q_ASSERT(texD->texture && texD->specified);
+ const GLenum faceTargetBase = texD->flags().testFlag(QRhiTexture::CubeMap) ? GL_TEXTURE_CUBE_MAP_POSITIVE_X : texD->target;
+ rhiD->f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + uint(attIndex), faceTargetBase + uint(colorAtt.layer()),
+ texD->texture, colorAtt.level());
+ if (attIndex == 0) {
+ d.pixelSize = texD->pixelSize();
+ d.sampleCount = 1;
+ }
+ } else if (renderBuffer) {
+ QGles2RenderBuffer *rbD = QRHI_RES(QGles2RenderBuffer, renderBuffer);
+ rhiD->f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + uint(attIndex), GL_RENDERBUFFER, rbD->renderbuffer);
+ if (attIndex == 0) {
+ d.pixelSize = rbD->pixelSize();
+ d.sampleCount = rbD->samples;
+ }
+ }
+ }
+
+ if (hasDepthStencil) {
+ if (m_desc.depthStencilBuffer()) {
+ QGles2RenderBuffer *depthRbD = QRHI_RES(QGles2RenderBuffer, m_desc.depthStencilBuffer());
+ if (rhiD->caps.needsDepthStencilCombinedAttach) {
+ rhiD->f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
+ depthRbD->renderbuffer);
+ } else {
+ rhiD->f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER,
+ depthRbD->renderbuffer);
+ if (depthRbD->stencilRenderbuffer)
+ rhiD->f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
+ depthRbD->stencilRenderbuffer);
+ else // packed
+ rhiD->f->glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
+ depthRbD->renderbuffer);
+ }
+ if (d.colorAttCount == 0) {
+ d.pixelSize = depthRbD->pixelSize();
+ d.sampleCount = depthRbD->samples;
+ }
+ } else {
+ QGles2Texture *depthTexD = QRHI_RES(QGles2Texture, m_desc.depthTexture());
+ rhiD->f->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthTexD->texture, 0);
+ if (d.colorAttCount == 0) {
+ d.pixelSize = depthTexD->pixelSize();
+ d.sampleCount = 1;
+ }
+ }
+ d.dsAttCount = 1;
+ } else {
+ d.dsAttCount = 0;
+ }
+
+ d.dpr = 1;
+ d.rp = QRHI_RES(QGles2RenderPassDescriptor, m_renderPassDesc);
+
+ GLenum status = rhiD->f->glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ if (status != GL_NO_ERROR && status != GL_FRAMEBUFFER_COMPLETE) {
+ qWarning("Framebuffer incomplete: 0x%x", status);
+ return false;
+ }
+
+ rhiD->registerResource(this);
+ return true;
+}
+
+QSize QGles2TextureRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QGles2TextureRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QGles2TextureRenderTarget::sampleCount() const
+{
+ return d.sampleCount;
+}
+
+QGles2ShaderResourceBindings::QGles2ShaderResourceBindings(QRhiImplementation *rhi)
+ : QRhiShaderResourceBindings(rhi)
+{
+}
+
+QGles2ShaderResourceBindings::~QGles2ShaderResourceBindings()
+{
+ release();
+}
+
+void QGles2ShaderResourceBindings::release()
+{
+ // nothing to do here
+}
+
+bool QGles2ShaderResourceBindings::build()
+{
+ generation += 1;
+ return true;
+}
+
+QGles2GraphicsPipeline::QGles2GraphicsPipeline(QRhiImplementation *rhi)
+ : QRhiGraphicsPipeline(rhi)
+{
+}
+
+QGles2GraphicsPipeline::~QGles2GraphicsPipeline()
+{
+ release();
+}
+
+void QGles2GraphicsPipeline::release()
+{
+ if (!program)
+ return;
+
+ QRhiGles2::DeferredReleaseEntry e;
+ e.type = QRhiGles2::DeferredReleaseEntry::Pipeline;
+
+ e.pipeline.program = program;
+
+ program = 0;
+ uniforms.clear();
+ samplers.clear();
+
+ QRHI_RES_RHI(QRhiGles2);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+bool QGles2GraphicsPipeline::build()
+{
+ QRHI_RES_RHI(QRhiGles2);
+
+ if (program)
+ release();
+
+ if (!rhiD->ensureContext())
+ return false;
+
+ if (!rhiD->sanityCheckGraphicsPipeline(this))
+ return false;
+
+ drawMode = toGlTopology(m_topology);
+
+ program = rhiD->f->glCreateProgram();
+
+ QByteArray diskCacheKey;
+ QRhiGles2::DiskCacheResult diskCacheResult = rhiD->tryLoadFromDiskCache(m_shaderStages.constData(),
+ m_shaderStages.count(),
+ program,
+ &diskCacheKey);
+ if (diskCacheResult == QRhiGles2::DiskCacheError)
+ return false;
+
+ const bool needsCompile = diskCacheResult == QRhiGles2::DiskCacheMiss;
+
+ QShaderDescription vsDesc;
+ QShaderDescription fsDesc;
+ for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ const bool isVertex = shaderStage.type() == QRhiShaderStage::Vertex;
+ const bool isFragment = shaderStage.type() == QRhiShaderStage::Fragment;
+ if (isVertex) {
+ if (needsCompile && !rhiD->compileShader(program, shaderStage, nullptr))
+ return false;
+ vsDesc = shaderStage.shader().description();
+ } else if (isFragment) {
+ if (needsCompile && !rhiD->compileShader(program, shaderStage, nullptr))
+ return false;
+ fsDesc = shaderStage.shader().description();
+ }
+ }
+
+ for (auto inVar : vsDesc.inputVariables()) {
+ const QByteArray name = inVar.name.toUtf8();
+ rhiD->f->glBindAttribLocation(program, GLuint(inVar.location), name.constData());
+ }
+
+ if (needsCompile && !rhiD->linkProgram(program))
+ return false;
+
+ if (needsCompile)
+ rhiD->trySaveToDiskCache(program, diskCacheKey);
+
+ for (const QShaderDescription::UniformBlock &ub : vsDesc.uniformBlocks())
+ rhiD->gatherUniforms(program, ub, &uniforms);
+
+ for (const QShaderDescription::UniformBlock &ub : fsDesc.uniformBlocks())
+ rhiD->gatherUniforms(program, ub, &uniforms);
+
+ for (const QShaderDescription::InOutVariable &v : vsDesc.combinedImageSamplers())
+ rhiD->gatherSamplers(program, v, &samplers);
+
+ for (const QShaderDescription::InOutVariable &v : fsDesc.combinedImageSamplers())
+ rhiD->gatherSamplers(program, v, &samplers);
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QGles2ComputePipeline::QGles2ComputePipeline(QRhiImplementation *rhi)
+ : QRhiComputePipeline(rhi)
+{
+}
+
+QGles2ComputePipeline::~QGles2ComputePipeline()
+{
+ release();
+}
+
+void QGles2ComputePipeline::release()
+{
+ if (!program)
+ return;
+
+ QRhiGles2::DeferredReleaseEntry e;
+ e.type = QRhiGles2::DeferredReleaseEntry::Pipeline;
+
+ e.pipeline.program = program;
+
+ program = 0;
+ uniforms.clear();
+ samplers.clear();
+
+ QRHI_RES_RHI(QRhiGles2);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+bool QGles2ComputePipeline::build()
+{
+ QRHI_RES_RHI(QRhiGles2);
+
+ if (program)
+ release();
+
+ if (!rhiD->ensureContext())
+ return false;
+
+ program = rhiD->f->glCreateProgram();
+ QShaderDescription csDesc;
+
+ QByteArray diskCacheKey;
+ QRhiGles2::DiskCacheResult diskCacheResult = rhiD->tryLoadFromDiskCache(&m_shaderStage, 1, program, &diskCacheKey);
+ if (diskCacheResult == QRhiGles2::DiskCacheError)
+ return false;
+
+ const bool needsCompile = diskCacheResult == QRhiGles2::DiskCacheMiss;
+
+ if (needsCompile && !rhiD->compileShader(program, m_shaderStage, nullptr))
+ return false;
+
+ csDesc = m_shaderStage.shader().description();
+
+ if (needsCompile && !rhiD->linkProgram(program))
+ return false;
+
+ if (needsCompile)
+ rhiD->trySaveToDiskCache(program, diskCacheKey);
+
+ for (const QShaderDescription::UniformBlock &ub : csDesc.uniformBlocks())
+ rhiD->gatherUniforms(program, ub, &uniforms);
+ for (const QShaderDescription::InOutVariable &v : csDesc.combinedImageSamplers())
+ rhiD->gatherSamplers(program, v, &samplers);
+
+ // storage images and buffers need no special steps here
+
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QGles2CommandBuffer::QGles2CommandBuffer(QRhiImplementation *rhi)
+ : QRhiCommandBuffer(rhi)
+{
+ resetState();
+}
+
+QGles2CommandBuffer::~QGles2CommandBuffer()
+{
+ release();
+}
+
+void QGles2CommandBuffer::release()
+{
+ // nothing to do here
+}
+
+QGles2SwapChain::QGles2SwapChain(QRhiImplementation *rhi)
+ : QRhiSwapChain(rhi),
+ rt(rhi),
+ cb(rhi)
+{
+}
+
+QGles2SwapChain::~QGles2SwapChain()
+{
+ release();
+}
+
+void QGles2SwapChain::release()
+{
+ QRHI_PROF;
+ QRHI_PROF_F(releaseSwapChain(this));
+}
+
+QRhiCommandBuffer *QGles2SwapChain::currentFrameCommandBuffer()
+{
+ return &cb;
+}
+
+QRhiRenderTarget *QGles2SwapChain::currentFrameRenderTarget()
+{
+ return &rt;
+}
+
+QSize QGles2SwapChain::surfacePixelSize()
+{
+ Q_ASSERT(m_window);
+ return m_window->size() * m_window->devicePixelRatio();
+}
+
+QRhiRenderPassDescriptor *QGles2SwapChain::newCompatibleRenderPassDescriptor()
+{
+ return new QGles2RenderPassDescriptor(m_rhi);
+}
+
+bool QGles2SwapChain::buildOrResize()
+{
+ surface = m_window;
+ m_currentPixelSize = surfacePixelSize();
+ pixelSize = m_currentPixelSize;
+
+ if (m_depthStencil && m_depthStencil->flags().testFlag(QRhiRenderBuffer::UsedWithSwapChainOnly)
+ && m_depthStencil->pixelSize() != pixelSize)
+ {
+ m_depthStencil->setPixelSize(pixelSize);
+ m_depthStencil->build();
+ }
+
+ rt.d.rp = QRHI_RES(QGles2RenderPassDescriptor, m_renderPassDesc);
+ rt.d.pixelSize = pixelSize;
+ rt.d.dpr = float(m_window->devicePixelRatio());
+ rt.d.sampleCount = qBound(1, m_sampleCount, 64);
+ rt.d.colorAttCount = 1;
+ rt.d.dsAttCount = m_depthStencil ? 1 : 0;
+ rt.d.srgbUpdateAndBlend = m_flags.testFlag(QRhiSwapChain::sRGB);
+
+ frameCount = 0;
+
+ QRHI_PROF;
+ // make something up
+ QRHI_PROF_F(resizeSwapChain(this, 2, m_sampleCount > 1 ? 2 : 0, m_sampleCount));
+
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhigles2_p.h b/src/gui/rhi/qrhigles2_p.h
new file mode 100644
index 0000000000..7f7c8b4c40
--- /dev/null
+++ b/src/gui/rhi/qrhigles2_p.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIGLES2_H
+#define QRHIGLES2_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/qrhi_p.h>
+#include <QtGui/qsurfaceformat.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLContext;
+class QOffscreenSurface;
+class QWindow;
+
+struct Q_GUI_EXPORT QRhiGles2InitParams : public QRhiInitParams
+{
+ QRhiGles2InitParams();
+
+ QSurfaceFormat format;
+ QOffscreenSurface *fallbackSurface = nullptr;
+ QWindow *window = nullptr;
+
+ static QOffscreenSurface *newFallbackSurface(const QSurfaceFormat &format = QSurfaceFormat::defaultFormat());
+ static QSurfaceFormat adjustedFormat(const QSurfaceFormat &format = QSurfaceFormat::defaultFormat());
+};
+
+struct Q_GUI_EXPORT QRhiGles2NativeHandles : public QRhiNativeHandles
+{
+ QOpenGLContext *context = nullptr;
+};
+
+struct Q_GUI_EXPORT QRhiGles2TextureNativeHandles : public QRhiNativeHandles
+{
+ uint texture = 0;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h
new file mode 100644
index 0000000000..cc945876e6
--- /dev/null
+++ b/src/gui/rhi/qrhigles2_p_p.h
@@ -0,0 +1,841 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIGLES2_P_H
+#define QRHIGLES2_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 "qrhigles2_p.h"
+#include "qrhi_p_p.h"
+#include "qshaderdescription_p.h"
+#include <qopengl.h>
+#include <QSurface>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLExtensions;
+
+struct QGles2Buffer : public QRhiBuffer
+{
+ QGles2Buffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
+ ~QGles2Buffer();
+ void release() override;
+ bool build() override;
+
+ GLuint buffer = 0;
+ GLenum targetForDataOps;
+ QByteArray ubuf;
+ enum Access {
+ AccessNone,
+ AccessVertex,
+ AccessIndex,
+ AccessUniform,
+ AccessStorageRead,
+ AccessStorageWrite,
+ AccessStorageReadWrite,
+ AccessUpdate
+ };
+ struct UsageState {
+ Access access;
+ };
+ UsageState usageState;
+ friend class QRhiGles2;
+};
+
+struct QGles2RenderBuffer : public QRhiRenderBuffer
+{
+ QGles2RenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags);
+ ~QGles2RenderBuffer();
+ void release() override;
+ bool build() override;
+ QRhiTexture::Format backingFormat() const override;
+
+ GLuint renderbuffer = 0;
+ GLuint stencilRenderbuffer = 0; // when packed depth-stencil not supported
+ int samples;
+ friend class QRhiGles2;
+};
+
+struct QGles2SamplerData
+{
+ GLenum glminfilter = 0;
+ GLenum glmagfilter = 0;
+ GLenum glwraps = 0;
+ GLenum glwrapt = 0;
+ GLenum glwrapr = 0;
+ GLenum gltexcomparefunc = 0;
+};
+
+inline bool operator==(const QGles2SamplerData &a, const QGles2SamplerData &b)
+{
+ return a.glminfilter == b.glminfilter
+ && a.glmagfilter == b.glmagfilter
+ && a.glwraps == b.glwraps
+ && a.glwrapt == b.glwrapt
+ && a.glwrapr == b.glwrapr
+ && a.gltexcomparefunc == b.gltexcomparefunc;
+}
+
+inline bool operator!=(const QGles2SamplerData &a, const QGles2SamplerData &b)
+{
+ return !(a == b);
+}
+
+struct QGles2Texture : public QRhiTexture
+{
+ QGles2Texture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags);
+ ~QGles2Texture();
+ void release() override;
+ bool build() override;
+ bool buildFrom(const QRhiNativeHandles *src) override;
+ const QRhiNativeHandles *nativeHandles() override;
+
+ bool prepareBuild(QSize *adjustedSize = nullptr);
+
+ GLuint texture = 0;
+ bool owns = true;
+ GLenum target;
+ GLenum glintformat;
+ GLenum glsizedintformat;
+ GLenum glformat;
+ GLenum gltype;
+ QGles2SamplerData samplerState;
+ bool specified = false;
+ int mipLevelCount = 0;
+ QRhiGles2TextureNativeHandles nativeHandlesStruct;
+ enum Access {
+ AccessNone,
+ AccessSample,
+ AccessFramebuffer,
+ AccessStorageRead,
+ AccessStorageWrite,
+ AccessStorageReadWrite,
+ AccessUpdate,
+ AccessRead
+ };
+ struct UsageState {
+ Access access;
+ };
+ UsageState usageState;
+
+ uint generation = 0;
+ friend class QRhiGles2;
+};
+
+struct QGles2Sampler : public QRhiSampler
+{
+ QGles2Sampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v);
+ ~QGles2Sampler();
+ void release() override;
+ bool build() override;
+
+ QGles2SamplerData d;
+ uint generation = 0;
+ friend class QRhiGles2;
+};
+
+struct QGles2RenderPassDescriptor : public QRhiRenderPassDescriptor
+{
+ QGles2RenderPassDescriptor(QRhiImplementation *rhi);
+ ~QGles2RenderPassDescriptor();
+ void release() override;
+};
+
+struct QGles2RenderTargetData
+{
+ QGles2RenderTargetData(QRhiImplementation *) { }
+
+ QGles2RenderPassDescriptor *rp = nullptr;
+ QSize pixelSize;
+ float dpr = 1;
+ int sampleCount = 1;
+ int colorAttCount = 0;
+ int dsAttCount = 0;
+ bool srgbUpdateAndBlend = false;
+};
+
+struct QGles2ReferenceRenderTarget : public QRhiRenderTarget
+{
+ QGles2ReferenceRenderTarget(QRhiImplementation *rhi);
+ ~QGles2ReferenceRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QGles2RenderTargetData d;
+};
+
+struct QGles2TextureRenderTarget : public QRhiTextureRenderTarget
+{
+ QGles2TextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
+ ~QGles2TextureRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool build() override;
+
+ QGles2RenderTargetData d;
+ GLuint framebuffer = 0;
+ friend class QRhiGles2;
+};
+
+struct QGles2ShaderResourceBindings : public QRhiShaderResourceBindings
+{
+ QGles2ShaderResourceBindings(QRhiImplementation *rhi);
+ ~QGles2ShaderResourceBindings();
+ void release() override;
+ bool build() override;
+
+ uint generation = 0;
+ friend class QRhiGles2;
+};
+
+struct QGles2UniformDescription
+{
+ QShaderDescription::VariableType type;
+ int glslLocation;
+ int binding;
+ uint offset;
+ int size;
+};
+
+Q_DECLARE_TYPEINFO(QGles2UniformDescription, Q_MOVABLE_TYPE);
+
+struct QGles2SamplerDescription
+{
+ int glslLocation;
+ int binding;
+};
+
+Q_DECLARE_TYPEINFO(QGles2SamplerDescription, Q_MOVABLE_TYPE);
+
+struct QGles2GraphicsPipeline : public QRhiGraphicsPipeline
+{
+ QGles2GraphicsPipeline(QRhiImplementation *rhi);
+ ~QGles2GraphicsPipeline();
+ void release() override;
+ bool build() override;
+
+ GLuint program = 0;
+ GLenum drawMode = GL_TRIANGLES;
+ QVector<QGles2UniformDescription> uniforms;
+ QVector<QGles2SamplerDescription> samplers;
+ uint generation = 0;
+ friend class QRhiGles2;
+};
+
+struct QGles2ComputePipeline : public QRhiComputePipeline
+{
+ QGles2ComputePipeline(QRhiImplementation *rhi);
+ ~QGles2ComputePipeline();
+ void release() override;
+ bool build() override;
+
+ GLuint program = 0;
+ QVector<QGles2UniformDescription> uniforms;
+ QVector<QGles2SamplerDescription> samplers;
+ uint generation = 0;
+ friend class QRhiGles2;
+};
+
+struct QGles2CommandBuffer : public QRhiCommandBuffer
+{
+ QGles2CommandBuffer(QRhiImplementation *rhi);
+ ~QGles2CommandBuffer();
+ void release() override;
+
+ struct Command {
+ enum Cmd {
+ BeginFrame,
+ EndFrame,
+ ResetFrame,
+ Viewport,
+ Scissor,
+ BlendConstants,
+ StencilRef,
+ BindVertexBuffer,
+ BindIndexBuffer,
+ Draw,
+ DrawIndexed,
+ BindGraphicsPipeline,
+ BindShaderResources,
+ BindFramebuffer,
+ Clear,
+ BufferSubData,
+ GetBufferSubData,
+ CopyTex,
+ ReadPixels,
+ SubImage,
+ CompressedImage,
+ CompressedSubImage,
+ BlitFromRenderbuffer,
+ GenMip,
+ BindComputePipeline,
+ Dispatch,
+ BarriersForPass,
+ Barrier
+ };
+ Cmd cmd;
+
+ static const int MAX_UBUF_BINDINGS = 32; // should be more than enough
+
+ // QRhi*/QGles2* references should be kept at minimum (so no
+ // QRhiTexture/Buffer/etc. pointers).
+ union {
+ struct {
+ float x, y, w, h;
+ float d0, d1;
+ } viewport;
+ struct {
+ int x, y, w, h;
+ } scissor;
+ struct {
+ float r, g, b, a;
+ } blendConstants;
+ struct {
+ quint32 ref;
+ QRhiGraphicsPipeline *ps;
+ } stencilRef;
+ struct {
+ QRhiGraphicsPipeline *ps;
+ GLuint buffer;
+ quint32 offset;
+ int binding;
+ } bindVertexBuffer;
+ struct {
+ GLuint buffer;
+ quint32 offset;
+ GLenum type;
+ } bindIndexBuffer;
+ struct {
+ QRhiGraphicsPipeline *ps;
+ quint32 vertexCount;
+ quint32 firstVertex;
+ quint32 instanceCount;
+ quint32 baseInstance;
+ } draw;
+ struct {
+ QRhiGraphicsPipeline *ps;
+ quint32 indexCount;
+ quint32 firstIndex;
+ quint32 instanceCount;
+ quint32 baseInstance;
+ qint32 baseVertex;
+ } drawIndexed;
+ struct {
+ QRhiGraphicsPipeline *ps;
+ } bindGraphicsPipeline;
+ struct {
+ QRhiGraphicsPipeline *maybeGraphicsPs;
+ QRhiComputePipeline *maybeComputePs;
+ QRhiShaderResourceBindings *srb;
+ int dynamicOffsetCount;
+ uint dynamicOffsetPairs[MAX_UBUF_BINDINGS * 2]; // binding, offsetInConstants
+ } bindShaderResources;
+ struct {
+ GLbitfield mask;
+ float c[4];
+ float d;
+ quint32 s;
+ } clear;
+ struct {
+ GLuint fbo;
+ bool srgb;
+ int colorAttCount;
+ } bindFramebuffer;
+ struct {
+ GLenum target;
+ GLuint buffer;
+ int offset;
+ int size;
+ const void *data; // must come from retainData()
+ } bufferSubData;
+ struct {
+ QRhiBufferReadbackResult *result;
+ GLenum target;
+ GLuint buffer;
+ int offset;
+ int size;
+ } getBufferSubData;
+ struct {
+ GLenum srcFaceTarget;
+ GLuint srcTexture;
+ int srcLevel;
+ int srcX;
+ int srcY;
+ GLenum dstTarget;
+ GLuint dstTexture;
+ GLenum dstFaceTarget;
+ int dstLevel;
+ int dstX;
+ int dstY;
+ int w;
+ int h;
+ } copyTex;
+ struct {
+ QRhiReadbackResult *result;
+ GLuint texture;
+ int w;
+ int h;
+ QRhiTexture::Format format;
+ GLenum readTarget;
+ int level;
+ } readPixels;
+ struct {
+ GLenum target;
+ GLuint texture;
+ GLenum faceTarget;
+ int level;
+ int dx;
+ int dy;
+ int w;
+ int h;
+ GLenum glformat;
+ GLenum gltype;
+ int rowStartAlign;
+ const void *data; // must come from retainImage()
+ } subImage;
+ struct {
+ GLenum target;
+ GLuint texture;
+ GLenum faceTarget;
+ int level;
+ GLenum glintformat;
+ int w;
+ int h;
+ int size;
+ const void *data; // must come from retainData()
+ } compressedImage;
+ struct {
+ GLenum target;
+ GLuint texture;
+ GLenum faceTarget;
+ int level;
+ int dx;
+ int dy;
+ int w;
+ int h;
+ GLenum glintformat;
+ int size;
+ const void *data; // must come from retainData()
+ } compressedSubImage;
+ struct {
+ GLuint renderbuffer;
+ int w;
+ int h;
+ GLenum target;
+ GLuint texture;
+ int dstLevel;
+ } blitFromRb;
+ struct {
+ GLenum target;
+ GLuint texture;
+ } genMip;
+ struct {
+ QRhiComputePipeline *ps;
+ } bindComputePipeline;
+ struct {
+ GLuint x;
+ GLuint y;
+ GLuint z;
+ } dispatch;
+ struct {
+ int trackerIndex;
+ } barriersForPass;
+ struct {
+ GLbitfield barriers;
+ } barrier;
+ } args;
+ };
+
+ enum PassType {
+ NoPass,
+ RenderPass,
+ ComputePass
+ };
+
+ QVector<Command> commands;
+ QVarLengthArray<QRhiPassResourceTracker, 8> passResTrackers;
+ int currentPassResTrackerIndex;
+
+ PassType recordingPass;
+ QRhiRenderTarget *currentTarget;
+ QRhiGraphicsPipeline *currentGraphicsPipeline;
+ QRhiComputePipeline *currentComputePipeline;
+ uint currentPipelineGeneration;
+ QRhiShaderResourceBindings *currentGraphicsSrb;
+ QRhiShaderResourceBindings *currentComputeSrb;
+ uint currentSrbGeneration;
+
+ QVector<QByteArray> dataRetainPool;
+ QVector<QImage> imageRetainPool;
+
+ // relies heavily on implicit sharing (no copies of the actual data will be made)
+ const void *retainData(const QByteArray &data) {
+ dataRetainPool.append(data);
+ return dataRetainPool.constLast().constData();
+ }
+ const void *retainImage(const QImage &image) {
+ imageRetainPool.append(image);
+ return imageRetainPool.constLast().constBits();
+ }
+ void resetCommands() {
+ commands.clear();
+ dataRetainPool.clear();
+ imageRetainPool.clear();
+
+ passResTrackers.clear();
+ currentPassResTrackerIndex = -1;
+ }
+ void resetState() {
+ recordingPass = NoPass;
+ currentTarget = nullptr;
+ resetCommands();
+ resetCachedState();
+ }
+ void resetCachedState() {
+ currentGraphicsPipeline = nullptr;
+ currentComputePipeline = nullptr;
+ currentPipelineGeneration = 0;
+ currentGraphicsSrb = nullptr;
+ currentComputeSrb = nullptr;
+ currentSrbGeneration = 0;
+ }
+};
+
+Q_DECLARE_TYPEINFO(QGles2CommandBuffer::Command, Q_MOVABLE_TYPE);
+
+struct QGles2SwapChain : public QRhiSwapChain
+{
+ QGles2SwapChain(QRhiImplementation *rhi);
+ ~QGles2SwapChain();
+ void release() override;
+
+ QRhiCommandBuffer *currentFrameCommandBuffer() override;
+ QRhiRenderTarget *currentFrameRenderTarget() override;
+
+ QSize surfacePixelSize() override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool buildOrResize() override;
+
+ QSurface *surface = nullptr;
+ QSize pixelSize;
+ QGles2ReferenceRenderTarget rt;
+ QGles2CommandBuffer cb;
+ int frameCount = 0;
+};
+
+class QRhiGles2 : public QRhiImplementation
+{
+public:
+ QRhiGles2(QRhiGles2InitParams *params, QRhiGles2NativeHandles *importDevice = nullptr);
+
+ bool create(QRhi::Flags flags) override;
+ void destroy() override;
+
+ QRhiGraphicsPipeline *createGraphicsPipeline() override;
+ QRhiComputePipeline *createComputePipeline() override;
+ QRhiShaderResourceBindings *createShaderResourceBindings() override;
+ QRhiBuffer *createBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size) override;
+ QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags) override;
+ QRhiTexture *createTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags) override;
+ QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v) override;
+
+ QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags) override;
+
+ QRhiSwapChain *createSwapChain() override;
+ QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult finish() override;
+
+ void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void setGraphicsPipeline(QRhiCommandBuffer *cb,
+ QRhiGraphicsPipeline *ps) override;
+
+ void setShaderResources(QRhiCommandBuffer *cb,
+ QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
+
+ void setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ QRhiCommandBuffer::IndexFormat indexFormat) override;
+
+ void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
+ void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
+ void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
+ void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
+
+ void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
+
+ void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex,
+ qint32 vertexOffset, quint32 firstInstance) override;
+
+ void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
+ void debugMarkEnd(QRhiCommandBuffer *cb) override;
+ void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
+
+ void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
+ void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
+
+ const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
+ void beginExternal(QRhiCommandBuffer *cb) override;
+ void endExternal(QRhiCommandBuffer *cb) override;
+
+ QVector<int> supportedSampleCounts() const override;
+ int ubufAlignment() const override;
+ bool isYUpInFramebuffer() const override;
+ bool isYUpInNDC() const override;
+ bool isClipDepthZeroToOne() const override;
+ QMatrix4x4 clipSpaceCorrMatrix() const override;
+ bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
+ bool isFeatureSupported(QRhi::Feature feature) const override;
+ int resourceLimit(QRhi::ResourceLimit limit) const override;
+ const QRhiNativeHandles *nativeHandles() override;
+ void sendVMemStatsToProfiler() override;
+ bool makeThreadLocalNativeContextCurrent() override;
+ void releaseCachedResources() override;
+ bool isDeviceLost() const override;
+
+ bool ensureContext(QSurface *surface = nullptr) const;
+ void executeDeferredReleases();
+ void trackedBufferBarrier(QGles2CommandBuffer *cbD, QGles2Buffer *bufD, QGles2Buffer::Access access);
+ void trackedImageBarrier(QGles2CommandBuffer *cbD, QGles2Texture *texD, QGles2Texture::Access access);
+ void enqueueSubresUpload(QGles2Texture *texD, QGles2CommandBuffer *cbD,
+ int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc);
+ void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
+ void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker,
+ QGles2Buffer *bufD,
+ QRhiPassResourceTracker::BufferAccess access,
+ QRhiPassResourceTracker::BufferStage stage);
+ void trackedRegisterTexture(QRhiPassResourceTracker *passResTracker,
+ QGles2Texture *texD,
+ QRhiPassResourceTracker::TextureAccess access,
+ QRhiPassResourceTracker::TextureStage stage);
+ void executeCommandBuffer(QRhiCommandBuffer *cb);
+ void executeBindGraphicsPipeline(QRhiGraphicsPipeline *ps);
+ void bindShaderResources(QRhiGraphicsPipeline *maybeGraphicsPs, QRhiComputePipeline *maybeComputePs,
+ QRhiShaderResourceBindings *srb,
+ const uint *dynOfsPairs, int dynOfsCount);
+ QGles2RenderTargetData *enqueueBindFramebuffer(QRhiRenderTarget *rt, QGles2CommandBuffer *cbD,
+ bool *wantsColorClear = nullptr, bool *wantsDsClear = nullptr);
+ void enqueueBarriersForPass(QGles2CommandBuffer *cbD);
+ int effectiveSampleCount(int sampleCount) const;
+ QByteArray shaderSource(const QRhiShaderStage &shaderStage, int *glslVersion);
+ bool compileShader(GLuint program, const QRhiShaderStage &shaderStage, int *glslVersion);
+ bool linkProgram(GLuint program);
+ void gatherUniforms(GLuint program, const QShaderDescription::UniformBlock &ub,
+ QVector<QGles2UniformDescription> *dst);
+ void gatherSamplers(GLuint program, const QShaderDescription::InOutVariable &v,
+ QVector<QGles2SamplerDescription> *dst);
+ bool isProgramBinaryDiskCacheEnabled() const;
+
+ enum DiskCacheResult {
+ DiskCacheHit,
+ DiskCacheMiss,
+ DiskCacheError
+ };
+ DiskCacheResult tryLoadFromDiskCache(const QRhiShaderStage *stages, int stageCount,
+ GLuint program, QByteArray *cacheKey);
+ void trySaveToDiskCache(GLuint program, const QByteArray &cacheKey);
+
+ QOpenGLContext *ctx = nullptr;
+ bool importedContext = false;
+ QSurfaceFormat requestedFormat;
+ QSurface *fallbackSurface = nullptr;
+ QWindow *maybeWindow = nullptr;
+ mutable bool needsMakeCurrent = false;
+ QOpenGLExtensions *f = nullptr;
+ uint vao = 0;
+ struct Caps {
+ Caps()
+ : ctxMajor(2),
+ ctxMinor(0),
+ maxTextureSize(2048),
+ maxDrawBuffers(4),
+ msaaRenderBuffer(false),
+ npotTextureFull(true),
+ gles(false),
+ fixedIndexPrimitiveRestart(false),
+ bgraExternalFormat(false),
+ bgraInternalFormat(false),
+ r8Format(false),
+ r16Format(false),
+ floatFormats(false),
+ depthTexture(false),
+ packedDepthStencil(false),
+ needsDepthStencilCombinedAttach(false),
+ srgbCapableDefaultFramebuffer(false),
+ coreProfile(false),
+ uniformBuffers(false),
+ elementIndexUint(false),
+ depth24(false),
+ rgba8Format(false),
+ instancing(false),
+ baseVertex(false),
+ compute(false),
+ textureCompareMode(false),
+ properMapBuffer(false),
+ nonBaseLevelFramebufferTexture(false)
+ { }
+ int ctxMajor;
+ int ctxMinor;
+ int maxTextureSize;
+ int maxDrawBuffers;
+ int maxSamples;
+ // Multisample fb and blit are supported (GLES 3.0 or OpenGL 3.x). Not
+ // the same as multisample textures!
+ uint msaaRenderBuffer : 1;
+ uint npotTextureFull : 1;
+ uint gles : 1;
+ uint fixedIndexPrimitiveRestart : 1;
+ uint bgraExternalFormat : 1;
+ uint bgraInternalFormat : 1;
+ uint r8Format : 1;
+ uint r16Format : 1;
+ uint floatFormats : 1;
+ uint depthTexture : 1;
+ uint packedDepthStencil : 1;
+ uint needsDepthStencilCombinedAttach : 1;
+ uint srgbCapableDefaultFramebuffer : 1;
+ uint coreProfile : 1;
+ uint uniformBuffers : 1;
+ uint elementIndexUint : 1;
+ uint depth24 : 1;
+ uint rgba8Format : 1;
+ uint instancing : 1;
+ uint baseVertex : 1;
+ uint compute : 1;
+ uint textureCompareMode : 1;
+ uint properMapBuffer : 1;
+ uint nonBaseLevelFramebufferTexture : 1;
+ } caps;
+ QGles2SwapChain *currentSwapChain = nullptr;
+ QVector<GLint> supportedCompressedFormats;
+ mutable QVector<int> supportedSampleCountList;
+ QRhiGles2NativeHandles nativeHandlesStruct;
+ mutable bool contextLost = false;
+
+ struct DeferredReleaseEntry {
+ enum Type {
+ Buffer,
+ Pipeline,
+ Texture,
+ RenderBuffer,
+ TextureRenderTarget
+ };
+ Type type;
+ union {
+ struct {
+ GLuint buffer;
+ } buffer;
+ struct {
+ GLuint program;
+ } pipeline;
+ struct {
+ GLuint texture;
+ } texture;
+ struct {
+ GLuint renderbuffer;
+ GLuint renderbuffer2;
+ } renderbuffer;
+ struct {
+ GLuint framebuffer;
+ } textureRenderTarget;
+ };
+ };
+ QVector<DeferredReleaseEntry> releaseQueue;
+
+ struct OffscreenFrame {
+ OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
+ bool active = false;
+ QGles2CommandBuffer cbWrapper;
+ } ofr;
+
+ QHash<QRhiShaderStage, uint> m_shaderCache;
+};
+
+Q_DECLARE_TYPEINFO(QRhiGles2::DeferredReleaseEntry, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
new file mode 100644
index 0000000000..131b2da802
--- /dev/null
+++ b/src/gui/rhi/qrhimetal.mm
@@ -0,0 +1,3731 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhimetal_p_p.h"
+#include <QGuiApplication>
+#include <QWindow>
+#include <qmath.h>
+
+#ifdef Q_OS_MACOS
+#include <AppKit/AppKit.h>
+#endif
+
+#include <Metal/Metal.h>
+#include <QuartzCore/CAMetalLayer.h>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Metal backend. Double buffers and throttles to vsync. "Dynamic" buffers are
+ Shared (host visible) and duplicated (to help having 2 frames in flight),
+ "static" and "immutable" are Managed on macOS and Shared on iOS/tvOS.
+ Textures are Private (device local) and a host visible staging buffer is
+ used to upload data to them. Does not rely on strong objects refs from
+ command buffers but does rely on the automatic resource tracking of the
+ command encoders. Assumes that an autorelease pool (ideally per frame) is
+ available on the thread on which QRhi is used.
+*/
+
+#if __has_feature(objc_arc)
+#error ARC not supported
+#endif
+
+// Note: we expect everything here pass the Metal API validation when running
+// in Debug mode in XCode. Some of the issues that break validation are not
+// obvious and not visible when running outside XCode.
+//
+// An exception is the nextDrawable Called Early blah blah warning, which is
+// plain and simply false.
+
+/*!
+ \class QRhiMetalInitParams
+ \inmodule QtRhi
+ \brief Metal specific initialization parameters.
+
+ A Metal-based QRhi needs no special parameters for initialization.
+
+ \badcode
+ QRhiMetalInitParams params;
+ rhi = QRhi::create(QRhi::Metal, &params);
+ \endcode
+
+ \note Metal API validation cannot be enabled by the application. Instead,
+ run the debug build of the application in XCode. Generating a
+ \c{.xcodeproj} file via \c{qmake -spec macx-xcode} provides a convenient
+ way to enable this.
+
+ \note QRhiSwapChain can only target QWindow instances that have their
+ surface type set to QSurface::MetalSurface.
+
+ \section2 Working with existing Metal devices
+
+ When interoperating with another graphics engine, it may be necessary to
+ get a QRhi instance that uses the same Metal device. This can be achieved
+ by passing a pointer to a QRhiMetalNativeHandles to QRhi::create(). The
+ device must be set to a non-null value then. Optionally, a command queue
+ object can be specified as well.
+
+ The QRhi does not take ownership of any of the external objects.
+ */
+
+/*!
+ \class QRhiMetalNativeHandles
+ \inmodule QtRhi
+ \brief Holds the Metal device used by the QRhi.
+
+ \note The class uses \c{void *} as the type since including the Objective C
+ headers is not acceptable here. The actual types are \c{id<MTLDevice>} and
+ \c{id<MTLCommandQueue>}.
+ */
+
+/*!
+ \class QRhiMetalTextureNativeHandles
+ \inmodule QtRhi
+ \brief Holds the Metal texture object that is backing a QRhiTexture instance.
+
+ \note The class uses \c{void *} as the type since including the Objective C
+ headers is not acceptable here. The actual type is \c{id<MTLTexture>}.
+ */
+
+/*!
+ \class QRhiMetalCommandBufferNativeHandles
+ \inmodule QtRhi
+ \brief Holds the MTLCommandBuffer and MTLRenderCommandEncoder objects that are backing a QRhiCommandBuffer.
+
+ \note The command buffer object is only guaranteed to be valid while
+ recording a frame, that is, between a \l{QRhi::beginFrame()}{beginFrame()}
+ - \l{QRhi::endFrame()}{endFrame()} or
+ \l{QRhi::beginOffscreenFrame()}{beginOffscreenFrame()} -
+ \l{QRhi::endOffsrceenFrame()}{endOffscreenFrame()} pair.
+
+ \note The command encoder is only valid while recording a pass, that is,
+ between \l{QRhiCommandBuffer::beginPass()} -
+ \l{QRhiCommandBuffer::endPass()}.
+ */
+
+struct QMetalShader
+{
+ id<MTLLibrary> lib = nil;
+ id<MTLFunction> func = nil;
+ std::array<uint, 3> localSize;
+ QShader::NativeResourceBindingMap nativeResourceBindingMap;
+
+ void release() {
+ nativeResourceBindingMap.clear();
+ [lib release];
+ lib = nil;
+ [func release];
+ func = nil;
+ }
+};
+
+struct QRhiMetalData
+{
+ QRhiMetalData(QRhiImplementation *rhi) : ofr(rhi) { }
+
+ id<MTLDevice> dev = nil;
+ id<MTLCommandQueue> cmdQueue = nil;
+
+ MTLRenderPassDescriptor *createDefaultRenderPass(bool hasDepthStencil,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ int colorAttCount);
+ id<MTLLibrary> createMetalLib(const QShader &shader, QShader::Variant shaderVariant,
+ QString *error, QByteArray *entryPoint, QShaderKey *activeKey);
+ id<MTLFunction> createMSLShaderFunction(id<MTLLibrary> lib, const QByteArray &entryPoint);
+
+ struct DeferredReleaseEntry {
+ enum Type {
+ Buffer,
+ RenderBuffer,
+ Texture,
+ Sampler,
+ StagingBuffer
+ };
+ Type type;
+ int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
+ union {
+ struct {
+ id<MTLBuffer> buffers[QMTL_FRAMES_IN_FLIGHT];
+ } buffer;
+ struct {
+ id<MTLTexture> texture;
+ } renderbuffer;
+ struct {
+ id<MTLTexture> texture;
+ id<MTLBuffer> stagingBuffers[QMTL_FRAMES_IN_FLIGHT];
+ id<MTLTexture> views[QRhi::MAX_LEVELS];
+ } texture;
+ struct {
+ id<MTLSamplerState> samplerState;
+ } sampler;
+ struct {
+ id<MTLBuffer> buffer;
+ } stagingBuffer;
+ };
+ };
+ QVector<DeferredReleaseEntry> releaseQueue;
+
+ struct OffscreenFrame {
+ OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
+ bool active = false;
+ QMetalCommandBuffer cbWrapper;
+ } ofr;
+
+ struct TextureReadback {
+ int activeFrameSlot = -1;
+ QRhiReadbackDescription desc;
+ QRhiReadbackResult *result;
+ id<MTLBuffer> buf;
+ quint32 bufSize;
+ QSize pixelSize;
+ QRhiTexture::Format format;
+ };
+ QVector<TextureReadback> activeTextureReadbacks;
+
+ API_AVAILABLE(macos(10.13), ios(11.0)) MTLCaptureManager *captureMgr;
+ API_AVAILABLE(macos(10.13), ios(11.0)) id<MTLCaptureScope> captureScope = nil;
+
+ static const int TEXBUF_ALIGN = 256; // probably not accurate
+
+ QHash<QRhiShaderStage, QMetalShader> shaderCache;
+};
+
+Q_DECLARE_TYPEINFO(QRhiMetalData::DeferredReleaseEntry, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiMetalData::TextureReadback, Q_MOVABLE_TYPE);
+
+struct QMetalBufferData
+{
+ bool managed;
+ bool slotted;
+ id<MTLBuffer> buf[QMTL_FRAMES_IN_FLIGHT];
+ QVarLengthArray<QRhiResourceUpdateBatchPrivate::BufferOp, 16> pendingUpdates[QMTL_FRAMES_IN_FLIGHT];
+};
+
+struct QMetalRenderBufferData
+{
+ MTLPixelFormat format;
+ id<MTLTexture> tex = nil;
+};
+
+struct QMetalTextureData
+{
+ QMetalTextureData(QMetalTexture *t) : q(t) { }
+
+ QMetalTexture *q;
+ MTLPixelFormat format;
+ id<MTLTexture> tex = nil;
+ id<MTLBuffer> stagingBuf[QMTL_FRAMES_IN_FLIGHT];
+ bool owns = true;
+ id<MTLTexture> perLevelViews[QRhi::MAX_LEVELS];
+
+ id<MTLTexture> viewForLevel(int level);
+};
+
+struct QMetalSamplerData
+{
+ id<MTLSamplerState> samplerState = nil;
+};
+
+struct QMetalCommandBufferData
+{
+ id<MTLCommandBuffer> cb;
+ id<MTLRenderCommandEncoder> currentRenderPassEncoder;
+ id<MTLComputeCommandEncoder> currentComputePassEncoder;
+ MTLRenderPassDescriptor *currentPassRpDesc;
+ int currentFirstVertexBinding;
+ QRhiBatchedBindings<id<MTLBuffer> > currentVertexInputsBuffers;
+ QRhiBatchedBindings<NSUInteger> currentVertexInputOffsets;
+};
+
+struct QMetalRenderTargetData
+{
+ QSize pixelSize;
+ float dpr = 1;
+ int sampleCount = 1;
+ int colorAttCount = 0;
+ int dsAttCount = 0;
+
+ struct ColorAtt {
+ bool needsDrawableForTex = false;
+ id<MTLTexture> tex = nil;
+ int layer = 0;
+ int level = 0;
+ bool needsDrawableForResolveTex = false;
+ id<MTLTexture> resolveTex = nil;
+ int resolveLayer = 0;
+ int resolveLevel = 0;
+ };
+
+ struct {
+ ColorAtt colorAtt[QMetalRenderPassDescriptor::MAX_COLOR_ATTACHMENTS];
+ id<MTLTexture> dsTex = nil;
+ bool hasStencil = false;
+ bool depthNeedsStore = false;
+ } fb;
+};
+
+struct QMetalGraphicsPipelineData
+{
+ id<MTLRenderPipelineState> ps = nil;
+ id<MTLDepthStencilState> ds = nil;
+ MTLPrimitiveType primitiveType;
+ MTLWinding winding;
+ MTLCullMode cullMode;
+ QMetalShader vs;
+ QMetalShader fs;
+};
+
+struct QMetalComputePipelineData
+{
+ id<MTLComputePipelineState> ps = nil;
+ QMetalShader cs;
+ MTLSize localSize;
+};
+
+struct QMetalSwapChainData
+{
+ CAMetalLayer *layer = nullptr;
+ id<CAMetalDrawable> curDrawable;
+ dispatch_semaphore_t sem[QMTL_FRAMES_IN_FLIGHT];
+ MTLRenderPassDescriptor *rp = nullptr;
+ id<MTLTexture> msaaTex[QMTL_FRAMES_IN_FLIGHT];
+ QRhiTexture::Format rhiColorFormat;
+ MTLPixelFormat colorFormat;
+};
+
+QRhiMetal::QRhiMetal(QRhiMetalInitParams *params, QRhiMetalNativeHandles *importDevice)
+{
+ Q_UNUSED(params);
+
+ d = new QRhiMetalData(this);
+
+ importedDevice = importDevice != nullptr;
+ if (importedDevice) {
+ if (d->dev) {
+ d->dev = (id<MTLDevice>) importDevice->dev;
+ importedCmdQueue = importDevice->cmdQueue != nullptr;
+ if (importedCmdQueue)
+ d->cmdQueue = (id<MTLCommandQueue>) importDevice->cmdQueue;
+ } else {
+ qWarning("No MTLDevice given, cannot import");
+ importedDevice = false;
+ }
+ }
+}
+
+QRhiMetal::~QRhiMetal()
+{
+ delete d;
+}
+
+template <class Int>
+inline Int aligned(Int v, Int byteAlign)
+{
+ return (v + byteAlign - 1) & ~(byteAlign - 1);
+}
+
+bool QRhiMetal::create(QRhi::Flags flags)
+{
+ Q_UNUSED(flags);
+
+ if (importedDevice)
+ [d->dev retain];
+ else
+ d->dev = MTLCreateSystemDefaultDevice();
+
+ if (!d->dev) {
+ qWarning("No MTLDevice");
+ return false;
+ }
+
+ qCDebug(QRHI_LOG_INFO, "Metal device: %s", qPrintable(QString::fromNSString([d->dev name])));
+
+ if (importedCmdQueue)
+ [d->cmdQueue retain];
+ else
+ d->cmdQueue = [d->dev newCommandQueue];
+
+ if (@available(macOS 10.13, iOS 11.0, *)) {
+ d->captureMgr = [MTLCaptureManager sharedCaptureManager];
+ // Have a custom capture scope as well which then shows up in XCode as
+ // an option when capturing, and becomes especially useful when having
+ // multiple windows with multiple QRhis.
+ d->captureScope = [d->captureMgr newCaptureScopeWithCommandQueue: d->cmdQueue];
+ const QString label = QString::asprintf("Qt capture scope for QRhi %p", this);
+ d->captureScope.label = label.toNSString();
+ }
+
+#if defined(Q_OS_MACOS)
+ caps.maxTextureSize = 16384;
+#elif defined(Q_OS_TVOS)
+ if ([d->dev supportsFeatureSet: MTLFeatureSet(30003)]) // MTLFeatureSet_tvOS_GPUFamily2_v1
+ caps.maxTextureSize = 16384;
+ else
+ caps.maxTextureSize = 8192;
+#elif defined(Q_OS_IOS)
+ // welcome to feature set hell
+ if ([d->dev supportsFeatureSet: MTLFeatureSet(16)] // MTLFeatureSet_iOS_GPUFamily5_v1
+ || [d->dev supportsFeatureSet: MTLFeatureSet(11)] // MTLFeatureSet_iOS_GPUFamily4_v1
+ || [d->dev supportsFeatureSet: MTLFeatureSet(4)]) // MTLFeatureSet_iOS_GPUFamily3_v1
+ {
+ caps.maxTextureSize = 16384;
+ } else if ([d->dev supportsFeatureSet: MTLFeatureSet(3)] // MTLFeatureSet_iOS_GPUFamily2_v2
+ || [d->dev supportsFeatureSet: MTLFeatureSet(2)]) // MTLFeatureSet_iOS_GPUFamily1_v2
+ {
+ caps.maxTextureSize = 8192;
+ } else {
+ caps.maxTextureSize = 4096;
+ }
+#endif
+
+ nativeHandlesStruct.dev = d->dev;
+ nativeHandlesStruct.cmdQueue = d->cmdQueue;
+
+ return true;
+}
+
+void QRhiMetal::destroy()
+{
+ executeDeferredReleases(true);
+ finishActiveReadbacks(true);
+
+ for (QMetalShader &s : d->shaderCache)
+ s.release();
+ d->shaderCache.clear();
+
+ if (@available(macOS 10.13, iOS 11.0, *)) {
+ [d->captureScope release];
+ d->captureScope = nil;
+ }
+
+ [d->cmdQueue release];
+ if (!importedCmdQueue)
+ d->cmdQueue = nil;
+
+ [d->dev release];
+ if (!importedDevice)
+ d->dev = nil;
+}
+
+QVector<int> QRhiMetal::supportedSampleCounts() const
+{
+ return { 1, 2, 4, 8 };
+}
+
+int QRhiMetal::effectiveSampleCount(int sampleCount) const
+{
+ // Stay compatible with QSurfaceFormat and friends where samples == 0 means the same as 1.
+ const int s = qBound(1, sampleCount, 64);
+ if (!supportedSampleCounts().contains(s)) {
+ qWarning("Attempted to set unsupported sample count %d", sampleCount);
+ return 1;
+ }
+ return s;
+}
+
+QRhiSwapChain *QRhiMetal::createSwapChain()
+{
+ return new QMetalSwapChain(this);
+}
+
+QRhiBuffer *QRhiMetal::createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
+{
+ return new QMetalBuffer(this, type, usage, size);
+}
+
+int QRhiMetal::ubufAlignment() const
+{
+ return 256;
+}
+
+bool QRhiMetal::isYUpInFramebuffer() const
+{
+ return false;
+}
+
+bool QRhiMetal::isYUpInNDC() const
+{
+ return true;
+}
+
+bool QRhiMetal::isClipDepthZeroToOne() const
+{
+ return true;
+}
+
+QMatrix4x4 QRhiMetal::clipSpaceCorrMatrix() const
+{
+ // depth range 0..1
+ static QMatrix4x4 m;
+ if (m.isIdentity()) {
+ // NB the ctor takes row-major
+ m = QMatrix4x4(1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.5f, 0.5f,
+ 0.0f, 0.0f, 0.0f, 1.0f);
+ }
+ return m;
+}
+
+bool QRhiMetal::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const
+{
+ Q_UNUSED(flags);
+
+#ifdef Q_OS_MACOS
+ if (format >= QRhiTexture::ETC2_RGB8 && format <= QRhiTexture::ETC2_RGBA8)
+ return false;
+ if (format >= QRhiTexture::ASTC_4x4 && format <= QRhiTexture::ASTC_12x12)
+ return false;
+#else
+ if (format >= QRhiTexture::BC1 && format <= QRhiTexture::BC7)
+ return false;
+#endif
+
+ return true;
+}
+
+bool QRhiMetal::isFeatureSupported(QRhi::Feature feature) const
+{
+ switch (feature) {
+ case QRhi::MultisampleTexture:
+ return true;
+ case QRhi::MultisampleRenderBuffer:
+ return true;
+ case QRhi::DebugMarkers:
+ return true;
+ case QRhi::Timestamps:
+ return false;
+ case QRhi::Instancing:
+ return true;
+ case QRhi::CustomInstanceStepRate:
+ return true;
+ case QRhi::PrimitiveRestart:
+ return true;
+ case QRhi::NonDynamicUniformBuffers:
+ return true;
+ case QRhi::NonFourAlignedEffectiveIndexBufferOffset:
+ return false;
+ case QRhi::NPOTTextureRepeat:
+ return true;
+ case QRhi::RedOrAlpha8IsRed:
+ return true;
+ case QRhi::ElementIndexUint:
+ return true;
+ case QRhi::Compute:
+ return true;
+ case QRhi::WideLines:
+ return false;
+ case QRhi::VertexShaderPointSize:
+ return true;
+ case QRhi::BaseVertex:
+ return true;
+ case QRhi::BaseInstance:
+ return true;
+ case QRhi::TriangleFanTopology:
+ return false;
+ case QRhi::ReadBackNonUniformBuffer:
+ return true;
+ case QRhi::ReadBackNonBaseMipLevel:
+ return true;
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+}
+
+int QRhiMetal::resourceLimit(QRhi::ResourceLimit limit) const
+{
+ switch (limit) {
+ case QRhi::TextureSizeMin:
+ return 1;
+ case QRhi::TextureSizeMax:
+ return caps.maxTextureSize;
+ case QRhi::MaxColorAttachments:
+ return 8;
+ case QRhi::FramesInFlight:
+ return QMTL_FRAMES_IN_FLIGHT;
+ default:
+ Q_UNREACHABLE();
+ return 0;
+ }
+}
+
+const QRhiNativeHandles *QRhiMetal::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+void QRhiMetal::sendVMemStatsToProfiler()
+{
+ // nothing to do here
+}
+
+bool QRhiMetal::makeThreadLocalNativeContextCurrent()
+{
+ // not applicable
+ return false;
+}
+
+void QRhiMetal::releaseCachedResources()
+{
+ for (QMetalShader &s : d->shaderCache)
+ s.release();
+
+ d->shaderCache.clear();
+}
+
+bool QRhiMetal::isDeviceLost() const
+{
+ return false;
+}
+
+QRhiRenderBuffer *QRhiMetal::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+{
+ return new QMetalRenderBuffer(this, type, pixelSize, sampleCount, flags);
+}
+
+QRhiTexture *QRhiMetal::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
+ int sampleCount, QRhiTexture::Flags flags)
+{
+ return new QMetalTexture(this, format, pixelSize, sampleCount, flags);
+}
+
+QRhiSampler *QRhiMetal::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler::AddressMode u, QRhiSampler::AddressMode v)
+{
+ return new QMetalSampler(this, magFilter, minFilter, mipmapMode, u, v);
+}
+
+QRhiTextureRenderTarget *QRhiMetal::createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags)
+{
+ return new QMetalTextureRenderTarget(this, desc, flags);
+}
+
+QRhiGraphicsPipeline *QRhiMetal::createGraphicsPipeline()
+{
+ return new QMetalGraphicsPipeline(this);
+}
+
+QRhiComputePipeline *QRhiMetal::createComputePipeline()
+{
+ return new QMetalComputePipeline(this);
+}
+
+QRhiShaderResourceBindings *QRhiMetal::createShaderResourceBindings()
+{
+ return new QMetalShaderResourceBindings(this);
+}
+
+enum class BindingType {
+ Buffer,
+ Texture,
+ Sampler
+};
+
+static inline int mapBinding(int binding,
+ int stageIndex,
+ const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[],
+ BindingType type)
+{
+ const QShader::NativeResourceBindingMap *map = nativeResourceBindingMaps[stageIndex];
+ if (map) {
+ auto it = map->constFind(binding);
+ if (it != map->cend())
+ return type == BindingType::Sampler ? it->second : it->first;
+ }
+ return binding;
+}
+
+void QRhiMetal::enqueueShaderResourceBindings(QMetalShaderResourceBindings *srbD,
+ QMetalCommandBuffer *cbD,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets,
+ bool offsetOnlyChange,
+ const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[SUPPORTED_STAGES])
+{
+ struct {
+ QRhiBatchedBindings<id<MTLBuffer> > buffers;
+ QRhiBatchedBindings<NSUInteger> bufferOffsets;
+ QRhiBatchedBindings<id<MTLTexture> > textures;
+ QRhiBatchedBindings<id<MTLSamplerState> > samplers;
+ } res[SUPPORTED_STAGES];
+ enum { VERTEX = 0, FRAGMENT = 1, COMPUTE = 2 };
+
+ for (const QRhiShaderResourceBinding &binding : qAsConst(srbD->sortedBindings)) {
+ const QRhiShaderResourceBinding::Data *b = binding.data();
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, b->u.ubuf.buf);
+ id<MTLBuffer> mtlbuf = bufD->d->buf[bufD->d->slotted ? currentFrameSlot : 0];
+ uint offset = uint(b->u.ubuf.offset);
+ for (int i = 0; i < dynamicOffsetCount; ++i) {
+ const QRhiCommandBuffer::DynamicOffset &dynOfs(dynamicOffsets[i]);
+ if (dynOfs.first == b->binding) {
+ offset = dynOfs.second;
+ break;
+ }
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::VertexStage)) {
+ res[VERTEX].buffers.feed(mapBinding(b->binding, VERTEX, nativeResourceBindingMaps, BindingType::Buffer), mtlbuf);
+ res[VERTEX].bufferOffsets.feed(b->binding, offset);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::FragmentStage)) {
+ res[FRAGMENT].buffers.feed(mapBinding(b->binding, FRAGMENT, nativeResourceBindingMaps, BindingType::Buffer), mtlbuf);
+ res[FRAGMENT].bufferOffsets.feed(b->binding, offset);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ res[COMPUTE].buffers.feed(mapBinding(b->binding, COMPUTE, nativeResourceBindingMaps, BindingType::Buffer), mtlbuf);
+ res[COMPUTE].bufferOffsets.feed(b->binding, offset);
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, b->u.stex.tex);
+ QMetalSampler *samplerD = QRHI_RES(QMetalSampler, b->u.stex.sampler);
+ if (b->stage.testFlag(QRhiShaderResourceBinding::VertexStage)) {
+ res[VERTEX].textures.feed(mapBinding(b->binding, VERTEX, nativeResourceBindingMaps, BindingType::Texture), texD->d->tex);
+ res[VERTEX].samplers.feed(mapBinding(b->binding, VERTEX, nativeResourceBindingMaps, BindingType::Sampler), samplerD->d->samplerState);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::FragmentStage)) {
+ res[FRAGMENT].textures.feed(mapBinding(b->binding, FRAGMENT, nativeResourceBindingMaps, BindingType::Texture), texD->d->tex);
+ res[FRAGMENT].samplers.feed(mapBinding(b->binding, FRAGMENT, nativeResourceBindingMaps, BindingType::Sampler), samplerD->d->samplerState);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ res[COMPUTE].textures.feed(mapBinding(b->binding, COMPUTE, nativeResourceBindingMaps, BindingType::Texture), texD->d->tex);
+ res[COMPUTE].samplers.feed(mapBinding(b->binding, COMPUTE, nativeResourceBindingMaps, BindingType::Sampler), samplerD->d->samplerState);
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, b->u.simage.tex);
+ id<MTLTexture> t = texD->d->viewForLevel(b->u.simage.level);
+ if (b->stage.testFlag(QRhiShaderResourceBinding::VertexStage))
+ res[VERTEX].textures.feed(mapBinding(b->binding, VERTEX, nativeResourceBindingMaps, BindingType::Texture), t);
+ if (b->stage.testFlag(QRhiShaderResourceBinding::FragmentStage))
+ res[FRAGMENT].textures.feed(mapBinding(b->binding, FRAGMENT, nativeResourceBindingMaps, BindingType::Texture), t);
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage))
+ res[COMPUTE].textures.feed(mapBinding(b->binding, COMPUTE, nativeResourceBindingMaps, BindingType::Texture), t);
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, b->u.sbuf.buf);
+ id<MTLBuffer> mtlbuf = bufD->d->buf[0];
+ uint offset = uint(b->u.sbuf.offset);
+ if (b->stage.testFlag(QRhiShaderResourceBinding::VertexStage)) {
+ res[VERTEX].buffers.feed(mapBinding(b->binding, VERTEX, nativeResourceBindingMaps, BindingType::Buffer), mtlbuf);
+ res[VERTEX].bufferOffsets.feed(b->binding, offset);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::FragmentStage)) {
+ res[FRAGMENT].buffers.feed(mapBinding(b->binding, FRAGMENT, nativeResourceBindingMaps, BindingType::Buffer), mtlbuf);
+ res[FRAGMENT].bufferOffsets.feed(b->binding, offset);
+ }
+ if (b->stage.testFlag(QRhiShaderResourceBinding::ComputeStage)) {
+ res[COMPUTE].buffers.feed(mapBinding(b->binding, COMPUTE, nativeResourceBindingMaps, BindingType::Buffer), mtlbuf);
+ res[COMPUTE].bufferOffsets.feed(b->binding, offset);
+ }
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ for (int stage = 0; stage < SUPPORTED_STAGES; ++stage) {
+ if (cbD->recordingPass != QMetalCommandBuffer::RenderPass && (stage == VERTEX || stage == FRAGMENT))
+ continue;
+ if (cbD->recordingPass != QMetalCommandBuffer::ComputePass && stage == COMPUTE)
+ continue;
+
+ res[stage].buffers.finish();
+ res[stage].bufferOffsets.finish();
+
+ for (int i = 0, ie = res[stage].buffers.batches.count(); i != ie; ++i) {
+ const auto &bufferBatch(res[stage].buffers.batches[i]);
+ const auto &offsetBatch(res[stage].bufferOffsets.batches[i]);
+ switch (stage) {
+ case VERTEX:
+ [cbD->d->currentRenderPassEncoder setVertexBuffers: bufferBatch.resources.constData()
+ offsets: offsetBatch.resources.constData()
+ withRange: NSMakeRange(bufferBatch.startBinding, NSUInteger(bufferBatch.resources.count()))];
+ break;
+ case FRAGMENT:
+ [cbD->d->currentRenderPassEncoder setFragmentBuffers: bufferBatch.resources.constData()
+ offsets: offsetBatch.resources.constData()
+ withRange: NSMakeRange(bufferBatch.startBinding, NSUInteger(bufferBatch.resources.count()))];
+ break;
+ case COMPUTE:
+ [cbD->d->currentComputePassEncoder setBuffers: bufferBatch.resources.constData()
+ offsets: offsetBatch.resources.constData()
+ withRange: NSMakeRange(bufferBatch.startBinding, NSUInteger(bufferBatch.resources.count()))];
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ if (offsetOnlyChange)
+ continue;
+
+ res[stage].textures.finish();
+ res[stage].samplers.finish();
+
+ for (int i = 0, ie = res[stage].textures.batches.count(); i != ie; ++i) {
+ const auto &batch(res[stage].textures.batches[i]);
+ switch (stage) {
+ case VERTEX:
+ [cbD->d->currentRenderPassEncoder setVertexTextures: batch.resources.constData()
+ withRange: NSMakeRange(batch.startBinding, NSUInteger(batch.resources.count()))];
+ break;
+ case FRAGMENT:
+ [cbD->d->currentRenderPassEncoder setFragmentTextures: batch.resources.constData()
+ withRange: NSMakeRange(batch.startBinding, NSUInteger(batch.resources.count()))];
+ break;
+ case COMPUTE:
+ [cbD->d->currentComputePassEncoder setTextures: batch.resources.constData()
+ withRange: NSMakeRange(batch.startBinding, NSUInteger(batch.resources.count()))];
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+ for (int i = 0, ie = res[stage].samplers.batches.count(); i != ie; ++i) {
+ const auto &batch(res[stage].samplers.batches[i]);
+ switch (stage) {
+ case VERTEX:
+ [cbD->d->currentRenderPassEncoder setVertexSamplerStates: batch.resources.constData()
+ withRange: NSMakeRange(batch.startBinding, NSUInteger(batch.resources.count()))];
+ break;
+ case FRAGMENT:
+ [cbD->d->currentRenderPassEncoder setFragmentSamplerStates: batch.resources.constData()
+ withRange: NSMakeRange(batch.startBinding, NSUInteger(batch.resources.count()))];
+ break;
+ case COMPUTE:
+ [cbD->d->currentComputePassEncoder setSamplerStates: batch.resources.constData()
+ withRange: NSMakeRange(batch.startBinding, NSUInteger(batch.resources.count()))];
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+ }
+}
+
+void QRhiMetal::setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+ QMetalGraphicsPipeline *psD = QRHI_RES(QMetalGraphicsPipeline, ps);
+
+ if (cbD->currentGraphicsPipeline != ps || cbD->currentPipelineGeneration != psD->generation) {
+ cbD->currentGraphicsPipeline = ps;
+ cbD->currentComputePipeline = nullptr;
+ cbD->currentPipelineGeneration = psD->generation;
+
+ [cbD->d->currentRenderPassEncoder setRenderPipelineState: psD->d->ps];
+ [cbD->d->currentRenderPassEncoder setDepthStencilState: psD->d->ds];
+
+ if (cbD->currentCullMode == -1 || psD->d->cullMode != uint(cbD->currentCullMode)) {
+ [cbD->d->currentRenderPassEncoder setCullMode: psD->d->cullMode];
+ cbD->currentCullMode = int(psD->d->cullMode);
+ }
+ if (cbD->currentFrontFaceWinding == -1 || psD->d->winding != uint(cbD->currentFrontFaceWinding)) {
+ [cbD->d->currentRenderPassEncoder setFrontFacingWinding: psD->d->winding];
+ cbD->currentFrontFaceWinding = int(psD->d->winding);
+ }
+ }
+
+ psD->lastActiveFrameSlot = currentFrameSlot;
+}
+
+void QRhiMetal::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass != QMetalCommandBuffer::NoPass);
+ QMetalGraphicsPipeline *gfxPsD = QRHI_RES(QMetalGraphicsPipeline, cbD->currentGraphicsPipeline);
+ QMetalComputePipeline *compPsD = QRHI_RES(QMetalComputePipeline, cbD->currentComputePipeline);
+
+ if (!srb) {
+ if (gfxPsD)
+ srb = gfxPsD->m_shaderResourceBindings;
+ else
+ srb = compPsD->m_shaderResourceBindings;
+ }
+
+ QMetalShaderResourceBindings *srbD = QRHI_RES(QMetalShaderResourceBindings, srb);
+ bool hasSlottedResourceInSrb = false;
+ bool hasDynamicOffsetInSrb = false;
+ bool resNeedsRebind = false;
+
+ // do buffer writes, figure out if we need to rebind, and mark as in-use
+ for (int i = 0, ie = srbD->sortedBindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->sortedBindings.at(i).data();
+ QMetalShaderResourceBindings::BoundResourceData &bd(srbD->boundResourceData[i]);
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, b->u.ubuf.buf);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::UniformBuffer));
+ executeBufferHostWritesForCurrentFrame(bufD);
+ if (bufD->d->slotted)
+ hasSlottedResourceInSrb = true;
+ if (b->u.ubuf.hasDynamicOffset)
+ hasDynamicOffsetInSrb = true;
+ if (bufD->generation != bd.ubuf.generation || bufD->m_id != bd.ubuf.id) {
+ resNeedsRebind = true;
+ bd.ubuf.id = bufD->m_id;
+ bd.ubuf.generation = bufD->generation;
+ }
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, b->u.stex.tex);
+ QMetalSampler *samplerD = QRHI_RES(QMetalSampler, b->u.stex.sampler);
+ if (texD->generation != bd.stex.texGeneration
+ || texD->m_id != bd.stex.texId
+ || samplerD->generation != bd.stex.samplerGeneration
+ || samplerD->m_id != bd.stex.samplerId)
+ {
+ resNeedsRebind = true;
+ bd.stex.texId = texD->m_id;
+ bd.stex.texGeneration = texD->generation;
+ bd.stex.samplerId = samplerD->m_id;
+ bd.stex.samplerGeneration = samplerD->generation;
+ }
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ samplerD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, b->u.simage.tex);
+ if (texD->generation != bd.simage.generation || texD->m_id != bd.simage.id) {
+ resNeedsRebind = true;
+ bd.simage.id = texD->m_id;
+ bd.simage.generation = texD->generation;
+ }
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, b->u.sbuf.buf);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::StorageBuffer));
+ executeBufferHostWritesForCurrentFrame(bufD);
+ if (bufD->generation != bd.sbuf.generation || bufD->m_id != bd.sbuf.id) {
+ resNeedsRebind = true;
+ bd.sbuf.id = bufD->m_id;
+ bd.sbuf.generation = bufD->generation;
+ }
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ // make sure the resources for the correct slot get bound
+ const int resSlot = hasSlottedResourceInSrb ? currentFrameSlot : 0;
+ if (hasSlottedResourceInSrb && cbD->currentResSlot != resSlot)
+ resNeedsRebind = true;
+
+ const bool srbChanged = gfxPsD ? (cbD->currentGraphicsSrb != srb) : (cbD->currentComputeSrb != srb);
+ const bool srbRebuilt = cbD->currentSrbGeneration != srbD->generation;
+
+ // dynamic uniform buffer offsets always trigger a rebind
+ if (hasDynamicOffsetInSrb || resNeedsRebind || srbChanged || srbRebuilt) {
+ const QShader::NativeResourceBindingMap *resBindMaps[SUPPORTED_STAGES] = { nullptr, nullptr, nullptr };
+ if (gfxPsD) {
+ cbD->currentGraphicsSrb = srb;
+ cbD->currentComputeSrb = nullptr;
+ resBindMaps[0] = &gfxPsD->d->vs.nativeResourceBindingMap;
+ resBindMaps[1] = &gfxPsD->d->fs.nativeResourceBindingMap;
+ } else {
+ cbD->currentGraphicsSrb = nullptr;
+ cbD->currentComputeSrb = srb;
+ resBindMaps[2] = &compPsD->d->cs.nativeResourceBindingMap;
+ }
+ cbD->currentSrbGeneration = srbD->generation;
+ cbD->currentResSlot = resSlot;
+
+ const bool offsetOnlyChange = hasDynamicOffsetInSrb && !resNeedsRebind && !srbChanged && !srbRebuilt;
+ enqueueShaderResourceBindings(srbD, cbD, dynamicOffsetCount, dynamicOffsets, offsetOnlyChange, resBindMaps);
+ }
+}
+
+void QRhiMetal::setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+
+ QRhiBatchedBindings<id<MTLBuffer> > buffers;
+ QRhiBatchedBindings<NSUInteger> offsets;
+ for (int i = 0; i < bindingCount; ++i) {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, bindings[i].first);
+ executeBufferHostWritesForCurrentFrame(bufD);
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+ id<MTLBuffer> mtlbuf = bufD->d->buf[bufD->d->slotted ? currentFrameSlot : 0];
+ buffers.feed(startBinding + i, mtlbuf);
+ offsets.feed(startBinding + i, bindings[i].second);
+ }
+ buffers.finish();
+ offsets.finish();
+
+ // same binding space for vertex and constant buffers - work it around
+ QRhiShaderResourceBindings *srb = cbD->currentGraphicsSrb;
+ // There's nothing guaranteeing setShaderResources() was called before
+ // setVertexInput()... but whatever srb will get bound will have to be
+ // layout-compatible anyways so maxBinding is the same.
+ if (!srb)
+ srb = cbD->currentGraphicsPipeline->shaderResourceBindings();
+ const int firstVertexBinding = QRHI_RES(QMetalShaderResourceBindings, srb)->maxBinding + 1;
+
+ if (firstVertexBinding != cbD->d->currentFirstVertexBinding
+ || buffers != cbD->d->currentVertexInputsBuffers
+ || offsets != cbD->d->currentVertexInputOffsets)
+ {
+ cbD->d->currentFirstVertexBinding = firstVertexBinding;
+ cbD->d->currentVertexInputsBuffers = buffers;
+ cbD->d->currentVertexInputOffsets = offsets;
+
+ for (int i = 0, ie = buffers.batches.count(); i != ie; ++i) {
+ const auto &bufferBatch(buffers.batches[i]);
+ const auto &offsetBatch(offsets.batches[i]);
+ [cbD->d->currentRenderPassEncoder setVertexBuffers:
+ bufferBatch.resources.constData()
+ offsets: offsetBatch.resources.constData()
+ withRange: NSMakeRange(uint(firstVertexBinding) + bufferBatch.startBinding, NSUInteger(bufferBatch.resources.count()))];
+ }
+ }
+
+ if (indexBuf) {
+ QMetalBuffer *ibufD = QRHI_RES(QMetalBuffer, indexBuf);
+ executeBufferHostWritesForCurrentFrame(ibufD);
+ ibufD->lastActiveFrameSlot = currentFrameSlot;
+ cbD->currentIndexBuffer = indexBuf;
+ cbD->currentIndexOffset = indexOffset;
+ cbD->currentIndexFormat = indexFormat;
+ } else {
+ cbD->currentIndexBuffer = nullptr;
+ }
+}
+
+void QRhiMetal::setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+ const QSize outputSize = cbD->currentTarget->pixelSize();
+
+ // x,y is top-left in MTLViewportRect but bottom-left in QRhiViewport
+ float x, y, w, h;
+ if (!qrhi_toTopLeftRenderTargetRect(outputSize, viewport.viewport(), &x, &y, &w, &h))
+ return;
+
+ MTLViewport vp;
+ vp.originX = double(x);
+ vp.originY = double(y);
+ vp.width = double(w);
+ vp.height = double(h);
+ vp.znear = double(viewport.minDepth());
+ vp.zfar = double(viewport.maxDepth());
+
+ [cbD->d->currentRenderPassEncoder setViewport: vp];
+
+ if (!QRHI_RES(QMetalGraphicsPipeline, cbD->currentGraphicsPipeline)->m_flags.testFlag(QRhiGraphicsPipeline::UsesScissor)) {
+ MTLScissorRect s;
+ s.x = NSUInteger(x);
+ s.y = NSUInteger(y);
+ s.width = NSUInteger(w);
+ s.height = NSUInteger(h);
+ [cbD->d->currentRenderPassEncoder setScissorRect: s];
+ }
+}
+
+void QRhiMetal::setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+ Q_ASSERT(QRHI_RES(QMetalGraphicsPipeline, cbD->currentGraphicsPipeline)->m_flags.testFlag(QRhiGraphicsPipeline::UsesScissor));
+ const QSize outputSize = cbD->currentTarget->pixelSize();
+
+ // x,y is top-left in MTLScissorRect but bottom-left in QRhiScissor
+ int x, y, w, h;
+ if (!qrhi_toTopLeftRenderTargetRect(outputSize, scissor.scissor(), &x, &y, &w, &h))
+ return;
+
+ MTLScissorRect s;
+ s.x = NSUInteger(x);
+ s.y = NSUInteger(y);
+ s.width = NSUInteger(w);
+ s.height = NSUInteger(h);
+
+ [cbD->d->currentRenderPassEncoder setScissorRect: s];
+}
+
+void QRhiMetal::setBlendConstants(QRhiCommandBuffer *cb, const QColor &c)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+
+ [cbD->d->currentRenderPassEncoder setBlendColorRed: float(c.redF())
+ green: float(c.greenF()) blue: float(c.blueF()) alpha: float(c.alphaF())];
+}
+
+void QRhiMetal::setStencilRef(QRhiCommandBuffer *cb, quint32 refValue)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+
+ [cbD->d->currentRenderPassEncoder setStencilReferenceValue: refValue];
+}
+
+void QRhiMetal::draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+
+ [cbD->d->currentRenderPassEncoder drawPrimitives:
+ QRHI_RES(QMetalGraphicsPipeline, cbD->currentGraphicsPipeline)->d->primitiveType
+ vertexStart: firstVertex vertexCount: vertexCount instanceCount: instanceCount baseInstance: firstInstance];
+}
+
+void QRhiMetal::drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+
+ if (!cbD->currentIndexBuffer)
+ return;
+
+ const quint32 indexOffset = cbD->currentIndexOffset + firstIndex * (cbD->currentIndexFormat == QRhiCommandBuffer::IndexUInt16 ? 2 : 4);
+ Q_ASSERT(indexOffset == aligned<quint32>(indexOffset, 4));
+
+ QMetalBuffer *ibufD = QRHI_RES(QMetalBuffer, cbD->currentIndexBuffer);
+ id<MTLBuffer> mtlbuf = ibufD->d->buf[ibufD->d->slotted ? currentFrameSlot : 0];
+
+ [cbD->d->currentRenderPassEncoder drawIndexedPrimitives: QRHI_RES(QMetalGraphicsPipeline, cbD->currentGraphicsPipeline)->d->primitiveType
+ indexCount: indexCount
+ indexType: cbD->currentIndexFormat == QRhiCommandBuffer::IndexUInt16 ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32
+ indexBuffer: mtlbuf
+ indexBufferOffset: indexOffset
+ instanceCount: instanceCount
+ baseVertex: vertexOffset
+ baseInstance: firstInstance];
+}
+
+void QRhiMetal::debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name)
+{
+ if (!debugMarkers)
+ return;
+
+ NSString *str = [NSString stringWithUTF8String: name.constData()];
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ if (cbD->recordingPass != QMetalCommandBuffer::NoPass) {
+ [cbD->d->currentRenderPassEncoder pushDebugGroup: str];
+ } else {
+ if (@available(macOS 10.13, iOS 11.0, *))
+ [cbD->d->cb pushDebugGroup: str];
+ }
+}
+
+void QRhiMetal::debugMarkEnd(QRhiCommandBuffer *cb)
+{
+ if (!debugMarkers)
+ return;
+
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ if (cbD->recordingPass != QMetalCommandBuffer::NoPass) {
+ [cbD->d->currentRenderPassEncoder popDebugGroup];
+ } else {
+ if (@available(macOS 10.13, iOS 11.0, *))
+ [cbD->d->cb popDebugGroup];
+ }
+}
+
+void QRhiMetal::debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg)
+{
+ if (!debugMarkers)
+ return;
+
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ if (cbD->recordingPass != QMetalCommandBuffer::NoPass)
+ [cbD->d->currentRenderPassEncoder insertDebugSignpost: [NSString stringWithUTF8String: msg.constData()]];
+}
+
+const QRhiNativeHandles *QRhiMetal::nativeHandles(QRhiCommandBuffer *cb)
+{
+ return QRHI_RES(QMetalCommandBuffer, cb)->nativeHandles();
+}
+
+void QRhiMetal::beginExternal(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+}
+
+void QRhiMetal::endExternal(QRhiCommandBuffer *cb)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ cbD->resetPerPassCachedState();
+}
+
+QRhi::FrameOpResult QRhiMetal::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+
+ QMetalSwapChain *swapChainD = QRHI_RES(QMetalSwapChain, swapChain);
+
+ // This is a bit messed up since for this swapchain we want to wait for the
+ // commands+present to complete, while for others just for the commands
+ // (for this same frame slot) but not sure how to do that in a sane way so
+ // wait for full cb completion for now.
+ for (QMetalSwapChain *sc : qAsConst(swapchains)) {
+ dispatch_semaphore_t sem = sc->d->sem[swapChainD->currentFrameSlot];
+ dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
+ if (sc != swapChainD)
+ dispatch_semaphore_signal(sem);
+ }
+
+ currentSwapChain = swapChainD;
+ currentFrameSlot = swapChainD->currentFrameSlot;
+ if (swapChainD->ds)
+ swapChainD->ds->lastActiveFrameSlot = currentFrameSlot;
+
+ if (@available(macOS 10.13, iOS 11.0, *))
+ [d->captureScope beginScope];
+
+ // Do not let the command buffer mess with the refcount of objects. We do
+ // have a proper render loop and will manage lifetimes similarly to other
+ // backends (Vulkan).
+ swapChainD->cbWrapper.d->cb = [d->cmdQueue commandBufferWithUnretainedReferences];
+
+ QMetalRenderTargetData::ColorAtt colorAtt;
+ if (swapChainD->samples > 1) {
+ colorAtt.tex = swapChainD->d->msaaTex[currentFrameSlot];
+ colorAtt.needsDrawableForResolveTex = true;
+ } else {
+ colorAtt.needsDrawableForTex = true;
+ }
+
+ swapChainD->rtWrapper.d->fb.colorAtt[0] = colorAtt;
+ swapChainD->rtWrapper.d->fb.dsTex = swapChainD->ds ? swapChainD->ds->d->tex : nil;
+ swapChainD->rtWrapper.d->fb.hasStencil = swapChainD->ds ? true : false;
+ swapChainD->rtWrapper.d->fb.depthNeedsStore = false;
+
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ QRHI_PROF_F(beginSwapChainFrame(swapChain));
+
+ executeDeferredReleases();
+ swapChainD->cbWrapper.resetState();
+ finishActiveReadbacks();
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiMetal::endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags)
+{
+ QMetalSwapChain *swapChainD = QRHI_RES(QMetalSwapChain, swapChain);
+ Q_ASSERT(currentSwapChain == swapChainD);
+
+ const bool needsPresent = !flags.testFlag(QRhi::SkipPresent);
+ if (needsPresent)
+ [swapChainD->cbWrapper.d->cb presentDrawable: swapChainD->d->curDrawable];
+
+ // Must not hold on to the drawable, regardless of needsPresent.
+ // (internally it is autoreleased or something, it seems)
+ swapChainD->d->curDrawable = nil;
+
+ __block int thisFrameSlot = currentFrameSlot;
+ [swapChainD->cbWrapper.d->cb addCompletedHandler: ^(id<MTLCommandBuffer>) {
+ dispatch_semaphore_signal(swapChainD->d->sem[thisFrameSlot]);
+ }];
+
+ [swapChainD->cbWrapper.d->cb commit];
+
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ QRHI_PROF_F(endSwapChainFrame(swapChain, swapChainD->frameCount + 1));
+
+ if (@available(macOS 10.13, iOS 11.0, *))
+ [d->captureScope endScope];
+
+ if (needsPresent)
+ swapChainD->currentFrameSlot = (swapChainD->currentFrameSlot + 1) % QMTL_FRAMES_IN_FLIGHT;
+
+ swapChainD->frameCount += 1;
+ currentSwapChain = nullptr;
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiMetal::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+
+ currentFrameSlot = (currentFrameSlot + 1) % QMTL_FRAMES_IN_FLIGHT;
+ if (swapchains.count() > 1) {
+ for (QMetalSwapChain *sc : qAsConst(swapchains)) {
+ // wait+signal is the general pattern to ensure the commands for a
+ // given frame slot have completed (if sem is 1, we go 0 then 1; if
+ // sem is 0 we go -1, block, completion increments to 0, then us to 1)
+ dispatch_semaphore_t sem = sc->d->sem[currentFrameSlot];
+ dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
+ dispatch_semaphore_signal(sem);
+ }
+ }
+
+ d->ofr.active = true;
+ *cb = &d->ofr.cbWrapper;
+ d->ofr.cbWrapper.d->cb = [d->cmdQueue commandBufferWithUnretainedReferences];
+
+ executeDeferredReleases();
+ d->ofr.cbWrapper.resetState();
+ finishActiveReadbacks();
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiMetal::endOffscreenFrame(QRhi::EndFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ Q_ASSERT(d->ofr.active);
+ d->ofr.active = false;
+
+ [d->ofr.cbWrapper.d->cb commit];
+
+ // offscreen frames wait for completion, unlike swapchain ones
+ [d->ofr.cbWrapper.d->cb waitUntilCompleted];
+
+ finishActiveReadbacks(true);
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiMetal::finish()
+{
+ id<MTLCommandBuffer> cb = nil;
+ QMetalSwapChain *swapChainD = nullptr;
+ if (inFrame) {
+ if (d->ofr.active) {
+ Q_ASSERT(!currentSwapChain);
+ Q_ASSERT(d->ofr.cbWrapper.recordingPass == QMetalCommandBuffer::NoPass);
+ cb = d->ofr.cbWrapper.d->cb;
+ } else {
+ Q_ASSERT(currentSwapChain);
+ swapChainD = currentSwapChain;
+ Q_ASSERT(swapChainD->cbWrapper.recordingPass == QMetalCommandBuffer::NoPass);
+ cb = swapChainD->cbWrapper.d->cb;
+ }
+ }
+
+ for (QMetalSwapChain *sc : qAsConst(swapchains)) {
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ if (currentSwapChain && sc == currentSwapChain && i == currentFrameSlot) {
+ // no wait as this is the thing we're going to be commit below and
+ // beginFrame decremented sem already and going to be signaled by endFrame
+ continue;
+ }
+ dispatch_semaphore_t sem = sc->d->sem[i];
+ dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
+ dispatch_semaphore_signal(sem);
+ }
+ }
+
+ if (cb) {
+ [cb commit];
+ [cb waitUntilCompleted];
+ }
+
+ if (inFrame) {
+ if (d->ofr.active)
+ d->ofr.cbWrapper.d->cb = [d->cmdQueue commandBufferWithUnretainedReferences];
+ else
+ swapChainD->cbWrapper.d->cb = [d->cmdQueue commandBufferWithUnretainedReferences];
+ }
+
+ executeDeferredReleases(true);
+
+ finishActiveReadbacks(true);
+
+ return QRhi::FrameOpSuccess;
+}
+
+MTLRenderPassDescriptor *QRhiMetalData::createDefaultRenderPass(bool hasDepthStencil,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ int colorAttCount)
+{
+ MTLRenderPassDescriptor *rp = [MTLRenderPassDescriptor renderPassDescriptor];
+ MTLClearColor c = MTLClearColorMake(colorClearValue.redF(), colorClearValue.greenF(), colorClearValue.blueF(),
+ colorClearValue.alphaF());
+
+ for (uint i = 0; i < uint(colorAttCount); ++i) {
+ rp.colorAttachments[i].loadAction = MTLLoadActionClear;
+ rp.colorAttachments[i].storeAction = MTLStoreActionStore;
+ rp.colorAttachments[i].clearColor = c;
+ }
+
+ if (hasDepthStencil) {
+ rp.depthAttachment.loadAction = MTLLoadActionClear;
+ rp.depthAttachment.storeAction = MTLStoreActionDontCare;
+ rp.stencilAttachment.loadAction = MTLLoadActionClear;
+ rp.stencilAttachment.storeAction = MTLStoreActionDontCare;
+ rp.depthAttachment.clearDepth = double(depthStencilClearValue.depthClearValue());
+ rp.stencilAttachment.clearStencil = depthStencilClearValue.stencilClearValue();
+ }
+
+ return rp;
+}
+
+qsizetype QRhiMetal::subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const
+{
+ qsizetype size = 0;
+ const qsizetype imageSizeBytes = subresDesc.image().isNull() ?
+ subresDesc.data().size() : subresDesc.image().sizeInBytes();
+ if (imageSizeBytes > 0)
+ size += aligned<qsizetype>(imageSizeBytes, QRhiMetalData::TEXBUF_ALIGN);
+ return size;
+}
+
+void QRhiMetal::enqueueSubresUpload(QMetalTexture *texD, void *mp, void *blitEncPtr,
+ int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc,
+ qsizetype *curOfs)
+{
+ const QPoint dp = subresDesc.destinationTopLeft();
+ const QByteArray rawData = subresDesc.data();
+ QImage img = subresDesc.image();
+ id<MTLBlitCommandEncoder> blitEnc = (id<MTLBlitCommandEncoder>) blitEncPtr;
+
+ if (!img.isNull()) {
+ const qsizetype fullImageSizeBytes = img.sizeInBytes();
+ int w = img.width();
+ int h = img.height();
+ int bpl = img.bytesPerLine();
+ int srcOffset = 0;
+
+ if (!subresDesc.sourceSize().isEmpty() || !subresDesc.sourceTopLeft().isNull()) {
+ const int sx = subresDesc.sourceTopLeft().x();
+ const int sy = subresDesc.sourceTopLeft().y();
+ if (!subresDesc.sourceSize().isEmpty()) {
+ w = subresDesc.sourceSize().width();
+ h = subresDesc.sourceSize().height();
+ }
+ if (img.depth() == 32) {
+ memcpy(reinterpret_cast<char *>(mp) + *curOfs, img.constBits(), size_t(fullImageSizeBytes));
+ srcOffset = sy * bpl + sx * 4;
+ // bpl remains set to the original image's row stride
+ } else {
+ img = img.copy(sx, sy, w, h);
+ bpl = img.bytesPerLine();
+ Q_ASSERT(img.sizeInBytes() <= fullImageSizeBytes);
+ memcpy(reinterpret_cast<char *>(mp) + *curOfs, img.constBits(), size_t(img.sizeInBytes()));
+ }
+ } else {
+ memcpy(reinterpret_cast<char *>(mp) + *curOfs, img.constBits(), size_t(fullImageSizeBytes));
+ }
+
+ [blitEnc copyFromBuffer: texD->d->stagingBuf[currentFrameSlot]
+ sourceOffset: NSUInteger(*curOfs + srcOffset)
+ sourceBytesPerRow: NSUInteger(bpl)
+ sourceBytesPerImage: 0
+ sourceSize: MTLSizeMake(NSUInteger(w), NSUInteger(h), 1)
+ toTexture: texD->d->tex
+ destinationSlice: NSUInteger(layer)
+ destinationLevel: NSUInteger(level)
+ destinationOrigin: MTLOriginMake(NSUInteger(dp.x()), NSUInteger(dp.y()), 0)
+ options: MTLBlitOptionNone];
+
+ *curOfs += aligned<qsizetype>(fullImageSizeBytes, QRhiMetalData::TEXBUF_ALIGN);
+ } else if (!rawData.isEmpty() && isCompressedFormat(texD->m_format)) {
+ const QSize subresSize = q->sizeForMipLevel(level, texD->m_pixelSize);
+ const int subresw = subresSize.width();
+ const int subresh = subresSize.height();
+ int w, h;
+ if (subresDesc.sourceSize().isEmpty()) {
+ w = subresw;
+ h = subresh;
+ } else {
+ w = subresDesc.sourceSize().width();
+ h = subresDesc.sourceSize().height();
+ }
+
+ quint32 bpl = 0;
+ QSize blockDim;
+ compressedFormatInfo(texD->m_format, QSize(w, h), &bpl, nullptr, &blockDim);
+
+ const int dx = aligned(dp.x(), blockDim.width());
+ const int dy = aligned(dp.y(), blockDim.height());
+ if (dx + w != subresw)
+ w = aligned(w, blockDim.width());
+ if (dy + h != subresh)
+ h = aligned(h, blockDim.height());
+
+ memcpy(reinterpret_cast<char *>(mp) + *curOfs, rawData.constData(), size_t(rawData.size()));
+
+ [blitEnc copyFromBuffer: texD->d->stagingBuf[currentFrameSlot]
+ sourceOffset: NSUInteger(*curOfs)
+ sourceBytesPerRow: bpl
+ sourceBytesPerImage: 0
+ sourceSize: MTLSizeMake(NSUInteger(w), NSUInteger(h), 1)
+ toTexture: texD->d->tex
+ destinationSlice: NSUInteger(layer)
+ destinationLevel: NSUInteger(level)
+ destinationOrigin: MTLOriginMake(NSUInteger(dx), NSUInteger(dy), 0)
+ options: MTLBlitOptionNone];
+
+ *curOfs += aligned(rawData.size(), QRhiMetalData::TEXBUF_ALIGN);
+ } else if (!rawData.isEmpty()) {
+ const QSize subresSize = q->sizeForMipLevel(level, texD->m_pixelSize);
+ const int subresw = subresSize.width();
+ const int subresh = subresSize.height();
+ int w, h;
+ if (subresDesc.sourceSize().isEmpty()) {
+ w = subresw;
+ h = subresh;
+ } else {
+ w = subresDesc.sourceSize().width();
+ h = subresDesc.sourceSize().height();
+ }
+
+ quint32 bpl = 0;
+ textureFormatInfo(texD->m_format, QSize(w, h), &bpl, nullptr);
+ memcpy(reinterpret_cast<char *>(mp) + *curOfs, rawData.constData(), size_t(rawData.size()));
+
+ [blitEnc copyFromBuffer: texD->d->stagingBuf[currentFrameSlot]
+ sourceOffset: NSUInteger(*curOfs)
+ sourceBytesPerRow: bpl
+ sourceBytesPerImage: 0
+ sourceSize: MTLSizeMake(NSUInteger(w), NSUInteger(h), 1)
+ toTexture: texD->d->tex
+ destinationSlice: NSUInteger(layer)
+ destinationLevel: NSUInteger(level)
+ destinationOrigin: MTLOriginMake(NSUInteger(dp.x()), NSUInteger(dp.y()), 0)
+ options: MTLBlitOptionNone];
+
+ *curOfs += aligned(rawData.size(), QRhiMetalData::TEXBUF_ALIGN);
+ } else {
+ qWarning("Invalid texture upload for %p layer=%d mip=%d", texD, layer, level);
+ }
+}
+
+void QRhiMetal::enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates);
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : ud->bufferOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, u.buf);
+ Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i)
+ bufD->d->pendingUpdates[i].append(u);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) {
+ // Due to the Metal API the handling of static and dynamic buffers is
+ // basically the same. So go through the same pendingUpdates machinery.
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, u.buf);
+ Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic);
+ Q_ASSERT(u.offset + u.data.size() <= bufD->m_size);
+ for (int i = 0, ie = bufD->d->slotted ? QMTL_FRAMES_IN_FLIGHT : 1; i != ie; ++i)
+ bufD->d->pendingUpdates[i].append(
+ QRhiResourceUpdateBatchPrivate::BufferOp::dynamicUpdate(u.buf, u.offset, u.data.size(), u.data.constData()));
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::Read) {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, u.buf);
+ executeBufferHostWritesForCurrentFrame(bufD);
+ const int idx = bufD->d->slotted ? currentFrameSlot : 0;
+ char *p = reinterpret_cast<char *>([bufD->d->buf[idx] contents]);
+ if (p) {
+ u.result->data.resize(u.readSize);
+ memcpy(u.result->data.data(), p + u.offset, size_t(u.readSize));
+ }
+ if (u.result->completed)
+ u.result->completed();
+ }
+ }
+
+ id<MTLBlitCommandEncoder> blitEnc = nil;
+ auto ensureBlit = [&blitEnc, cbD, this] {
+ if (!blitEnc) {
+ blitEnc = [cbD->d->cb blitCommandEncoder];
+ if (debugMarkers)
+ [blitEnc pushDebugGroup: @"Texture upload/copy"];
+ }
+ };
+
+ for (const QRhiResourceUpdateBatchPrivate::TextureOp &u : ud->textureOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Upload) {
+ QMetalTexture *utexD = QRHI_RES(QMetalTexture, u.dst);
+ qsizetype stagingSize = 0;
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ stagingSize += subresUploadByteSize(subresDesc);
+ }
+ }
+
+ ensureBlit();
+ Q_ASSERT(!utexD->d->stagingBuf[currentFrameSlot]);
+ utexD->d->stagingBuf[currentFrameSlot] = [d->dev newBufferWithLength: NSUInteger(stagingSize)
+ options: MTLResourceStorageModeShared];
+ QRHI_PROF_F(newTextureStagingArea(utexD, currentFrameSlot, quint32(stagingSize)));
+
+ void *mp = [utexD->d->stagingBuf[currentFrameSlot] contents];
+ qsizetype curOfs = 0;
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ enqueueSubresUpload(utexD, mp, blitEnc, layer, level, subresDesc, &curOfs);
+ }
+ }
+
+ utexD->lastActiveFrameSlot = currentFrameSlot;
+
+ QRhiMetalData::DeferredReleaseEntry e;
+ e.type = QRhiMetalData::DeferredReleaseEntry::StagingBuffer;
+ e.lastActiveFrameSlot = currentFrameSlot;
+ e.stagingBuffer.buffer = utexD->d->stagingBuf[currentFrameSlot];
+ utexD->d->stagingBuf[currentFrameSlot] = nil;
+ d->releaseQueue.append(e);
+ QRHI_PROF_F(releaseTextureStagingArea(utexD, currentFrameSlot));
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Copy) {
+ Q_ASSERT(u.src && u.dst);
+ QMetalTexture *srcD = QRHI_RES(QMetalTexture, u.src);
+ QMetalTexture *dstD = QRHI_RES(QMetalTexture, u.dst);
+ const QPoint dp = u.desc.destinationTopLeft();
+ const QSize mipSize = q->sizeForMipLevel(u.desc.sourceLevel(), srcD->m_pixelSize);
+ const QSize copySize = u.desc.pixelSize().isEmpty() ? mipSize : u.desc.pixelSize();
+ const QPoint sp = u.desc.sourceTopLeft();
+
+ ensureBlit();
+ [blitEnc copyFromTexture: srcD->d->tex
+ sourceSlice: NSUInteger(u.desc.sourceLayer())
+ sourceLevel: NSUInteger(u.desc.sourceLevel())
+ sourceOrigin: MTLOriginMake(NSUInteger(sp.x()), NSUInteger(sp.y()), 0)
+ sourceSize: MTLSizeMake(NSUInteger(copySize.width()), NSUInteger(copySize.height()), 1)
+ toTexture: dstD->d->tex
+ destinationSlice: NSUInteger(u.desc.destinationLayer())
+ destinationLevel: NSUInteger(u.desc.destinationLevel())
+ destinationOrigin: MTLOriginMake(NSUInteger(dp.x()), NSUInteger(dp.y()), 0)];
+
+ srcD->lastActiveFrameSlot = dstD->lastActiveFrameSlot = currentFrameSlot;
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Read) {
+ QRhiMetalData::TextureReadback readback;
+ readback.activeFrameSlot = currentFrameSlot;
+ readback.desc = u.rb;
+ readback.result = u.result;
+
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, u.rb.texture());
+ QMetalSwapChain *swapChainD = nullptr;
+ id<MTLTexture> src;
+ QSize srcSize;
+ if (texD) {
+ if (texD->samples > 1) {
+ qWarning("Multisample texture cannot be read back");
+ continue;
+ }
+ readback.pixelSize = q->sizeForMipLevel(u.rb.level(), texD->m_pixelSize);
+ readback.format = texD->m_format;
+ src = texD->d->tex;
+ srcSize = readback.pixelSize;
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ } else {
+ Q_ASSERT(currentSwapChain);
+ swapChainD = QRHI_RES(QMetalSwapChain, currentSwapChain);
+ readback.pixelSize = swapChainD->pixelSize;
+ readback.format = swapChainD->d->rhiColorFormat;
+ // Multisample swapchains need nothing special since resolving
+ // happens when ending a renderpass.
+ const QMetalRenderTargetData::ColorAtt &colorAtt(swapChainD->rtWrapper.d->fb.colorAtt[0]);
+ src = colorAtt.resolveTex ? colorAtt.resolveTex : colorAtt.tex;
+ srcSize = swapChainD->rtWrapper.d->pixelSize;
+ }
+
+ quint32 bpl = 0;
+ textureFormatInfo(readback.format, readback.pixelSize, &bpl, &readback.bufSize);
+ readback.buf = [d->dev newBufferWithLength: readback.bufSize options: MTLResourceStorageModeShared];
+
+ QRHI_PROF_F(newReadbackBuffer(qint64(qintptr(readback.buf)),
+ texD ? static_cast<QRhiResource *>(texD) : static_cast<QRhiResource *>(swapChainD),
+ readback.bufSize));
+
+ ensureBlit();
+ [blitEnc copyFromTexture: src
+ sourceSlice: NSUInteger(u.rb.layer())
+ sourceLevel: NSUInteger(u.rb.level())
+ sourceOrigin: MTLOriginMake(0, 0, 0)
+ sourceSize: MTLSizeMake(NSUInteger(srcSize.width()), NSUInteger(srcSize.height()), 1)
+ toBuffer: readback.buf
+ destinationOffset: 0
+ destinationBytesPerRow: bpl
+ destinationBytesPerImage: 0
+ options: MTLBlitOptionNone];
+
+ d->activeTextureReadbacks.append(readback);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::GenMips) {
+ QMetalTexture *utexD = QRHI_RES(QMetalTexture, u.dst);
+ ensureBlit();
+ [blitEnc generateMipmapsForTexture: utexD->d->tex];
+ utexD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ }
+
+ if (blitEnc) {
+ if (debugMarkers)
+ [blitEnc popDebugGroup];
+ [blitEnc endEncoding];
+ }
+
+ ud->free();
+}
+
+// this handles all types of buffers, not just Dynamic
+void QRhiMetal::executeBufferHostWritesForCurrentFrame(QMetalBuffer *bufD)
+{
+ const int idx = bufD->d->slotted ? currentFrameSlot : 0;
+ if (bufD->d->pendingUpdates[idx].isEmpty())
+ return;
+
+ void *p = [bufD->d->buf[idx] contents];
+ int changeBegin = -1;
+ int changeEnd = -1;
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : qAsConst(bufD->d->pendingUpdates[idx])) {
+ Q_ASSERT(bufD == QRHI_RES(QMetalBuffer, u.buf));
+ memcpy(static_cast<char *>(p) + u.offset, u.data.constData(), size_t(u.data.size()));
+ if (changeBegin == -1 || u.offset < changeBegin)
+ changeBegin = u.offset;
+ if (changeEnd == -1 || u.offset + u.data.size() > changeEnd)
+ changeEnd = u.offset + u.data.size();
+ }
+ if (changeBegin >= 0 && bufD->d->managed)
+ [bufD->d->buf[idx] didModifyRange: NSMakeRange(NSUInteger(changeBegin), NSUInteger(changeEnd - changeBegin))];
+
+ bufD->d->pendingUpdates[idx].clear();
+}
+
+void QRhiMetal::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ Q_ASSERT(QRHI_RES(QMetalCommandBuffer, cb)->recordingPass == QMetalCommandBuffer::NoPass);
+
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiMetal::beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+
+ QMetalRenderTargetData *rtD = nullptr;
+ switch (rt->resourceType()) {
+ case QRhiResource::RenderTarget:
+ rtD = QRHI_RES(QMetalReferenceRenderTarget, rt)->d;
+ cbD->d->currentPassRpDesc = d->createDefaultRenderPass(rtD->dsAttCount, colorClearValue, depthStencilClearValue, rtD->colorAttCount);
+ if (rtD->colorAttCount) {
+ QMetalRenderTargetData::ColorAtt &color0(rtD->fb.colorAtt[0]);
+ if (color0.needsDrawableForTex || color0.needsDrawableForResolveTex) {
+ Q_ASSERT(currentSwapChain);
+ QMetalSwapChain *swapChainD = QRHI_RES(QMetalSwapChain, currentSwapChain);
+ if (!swapChainD->d->curDrawable)
+ swapChainD->d->curDrawable = [swapChainD->d->layer nextDrawable];
+ if (!swapChainD->d->curDrawable) {
+ qWarning("No drawable");
+ return;
+ }
+ id<MTLTexture> scTex = swapChainD->d->curDrawable.texture;
+ if (color0.needsDrawableForTex) {
+ color0.tex = scTex;
+ color0.needsDrawableForTex = false;
+ } else {
+ color0.resolveTex = scTex;
+ color0.needsDrawableForResolveTex = false;
+ }
+ }
+ }
+ break;
+ case QRhiResource::TextureRenderTarget:
+ {
+ QMetalTextureRenderTarget *rtTex = QRHI_RES(QMetalTextureRenderTarget, rt);
+ rtD = rtTex->d;
+ cbD->d->currentPassRpDesc = d->createDefaultRenderPass(rtD->dsAttCount, colorClearValue, depthStencilClearValue, rtD->colorAttCount);
+ if (rtTex->m_flags.testFlag(QRhiTextureRenderTarget::PreserveColorContents)) {
+ for (uint i = 0; i < uint(rtD->colorAttCount); ++i)
+ cbD->d->currentPassRpDesc.colorAttachments[i].loadAction = MTLLoadActionLoad;
+ }
+ if (rtD->dsAttCount && rtTex->m_flags.testFlag(QRhiTextureRenderTarget::PreserveDepthStencilContents)) {
+ cbD->d->currentPassRpDesc.depthAttachment.loadAction = MTLLoadActionLoad;
+ cbD->d->currentPassRpDesc.stencilAttachment.loadAction = MTLLoadActionLoad;
+ }
+ for (auto it = rtTex->m_desc.cbeginColorAttachments(), itEnd = rtTex->m_desc.cendColorAttachments();
+ it != itEnd; ++it)
+ {
+ if (it->texture())
+ QRHI_RES(QMetalTexture, it->texture())->lastActiveFrameSlot = currentFrameSlot;
+ else if (it->renderBuffer())
+ QRHI_RES(QMetalRenderBuffer, it->renderBuffer())->lastActiveFrameSlot = currentFrameSlot;
+ if (it->resolveTexture())
+ QRHI_RES(QMetalTexture, it->resolveTexture())->lastActiveFrameSlot = currentFrameSlot;
+ }
+ if (rtTex->m_desc.depthStencilBuffer())
+ QRHI_RES(QMetalRenderBuffer, rtTex->m_desc.depthStencilBuffer())->lastActiveFrameSlot = currentFrameSlot;
+ if (rtTex->m_desc.depthTexture())
+ QRHI_RES(QMetalTexture, rtTex->m_desc.depthTexture())->lastActiveFrameSlot = currentFrameSlot;
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ for (uint i = 0; i < uint(rtD->colorAttCount); ++i) {
+ cbD->d->currentPassRpDesc.colorAttachments[i].texture = rtD->fb.colorAtt[i].tex;
+ cbD->d->currentPassRpDesc.colorAttachments[i].slice = NSUInteger(rtD->fb.colorAtt[i].layer);
+ cbD->d->currentPassRpDesc.colorAttachments[i].level = NSUInteger(rtD->fb.colorAtt[i].level);
+ if (rtD->fb.colorAtt[i].resolveTex) {
+ cbD->d->currentPassRpDesc.colorAttachments[i].storeAction = MTLStoreActionMultisampleResolve;
+ cbD->d->currentPassRpDesc.colorAttachments[i].resolveTexture = rtD->fb.colorAtt[i].resolveTex;
+ cbD->d->currentPassRpDesc.colorAttachments[i].resolveSlice = NSUInteger(rtD->fb.colorAtt[i].resolveLayer);
+ cbD->d->currentPassRpDesc.colorAttachments[i].resolveLevel = NSUInteger(rtD->fb.colorAtt[i].resolveLevel);
+ }
+ }
+
+ if (rtD->dsAttCount) {
+ Q_ASSERT(rtD->fb.dsTex);
+ cbD->d->currentPassRpDesc.depthAttachment.texture = rtD->fb.dsTex;
+ cbD->d->currentPassRpDesc.stencilAttachment.texture = rtD->fb.hasStencil ? rtD->fb.dsTex : nil;
+ if (rtD->fb.depthNeedsStore) // Depth/Stencil is set to DontCare by default, override if needed
+ cbD->d->currentPassRpDesc.depthAttachment.storeAction = MTLStoreActionStore;
+ }
+
+ cbD->d->currentRenderPassEncoder = [cbD->d->cb renderCommandEncoderWithDescriptor: cbD->d->currentPassRpDesc];
+
+ cbD->resetPerPassState();
+
+ cbD->recordingPass = QMetalCommandBuffer::RenderPass;
+ cbD->currentTarget = rt;
+}
+
+void QRhiMetal::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::RenderPass);
+
+ [cbD->d->currentRenderPassEncoder endEncoding];
+
+ cbD->recordingPass = QMetalCommandBuffer::NoPass;
+ cbD->currentTarget = nullptr;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiMetal::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+
+ cbD->d->currentComputePassEncoder = [cbD->d->cb computeCommandEncoder];
+ cbD->resetPerPassState();
+ cbD->recordingPass = QMetalCommandBuffer::ComputePass;
+}
+
+void QRhiMetal::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::ComputePass);
+
+ [cbD->d->currentComputePassEncoder endEncoding];
+ cbD->recordingPass = QMetalCommandBuffer::NoPass;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cb, resourceUpdates);
+}
+
+void QRhiMetal::setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::ComputePass);
+ QMetalComputePipeline *psD = QRHI_RES(QMetalComputePipeline, ps);
+
+ if (cbD->currentComputePipeline != ps || cbD->currentPipelineGeneration != psD->generation) {
+ cbD->currentGraphicsPipeline = nullptr;
+ cbD->currentComputePipeline = ps;
+ cbD->currentPipelineGeneration = psD->generation;
+
+ [cbD->d->currentComputePassEncoder setComputePipelineState: psD->d->ps];
+ }
+
+ psD->lastActiveFrameSlot = currentFrameSlot;
+}
+
+void QRhiMetal::dispatch(QRhiCommandBuffer *cb, int x, int y, int z)
+{
+ QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::ComputePass);
+ QMetalComputePipeline *psD = QRHI_RES(QMetalComputePipeline, cbD->currentComputePipeline);
+
+ [cbD->d->currentComputePassEncoder dispatchThreadgroups: MTLSizeMake(NSUInteger(x), NSUInteger(y), NSUInteger(z))
+ threadsPerThreadgroup: psD->d->localSize];
+}
+
+static void qrhimtl_releaseBuffer(const QRhiMetalData::DeferredReleaseEntry &e)
+{
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i)
+ [e.buffer.buffers[i] release];
+}
+
+static void qrhimtl_releaseRenderBuffer(const QRhiMetalData::DeferredReleaseEntry &e)
+{
+ [e.renderbuffer.texture release];
+}
+
+static void qrhimtl_releaseTexture(const QRhiMetalData::DeferredReleaseEntry &e)
+{
+ [e.texture.texture release];
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i)
+ [e.texture.stagingBuffers[i] release];
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i)
+ [e.texture.views[i] release];
+}
+
+static void qrhimtl_releaseSampler(const QRhiMetalData::DeferredReleaseEntry &e)
+{
+ [e.sampler.samplerState release];
+}
+
+void QRhiMetal::executeDeferredReleases(bool forced)
+{
+ for (int i = d->releaseQueue.count() - 1; i >= 0; --i) {
+ const QRhiMetalData::DeferredReleaseEntry &e(d->releaseQueue[i]);
+ if (forced || currentFrameSlot == e.lastActiveFrameSlot || e.lastActiveFrameSlot < 0) {
+ switch (e.type) {
+ case QRhiMetalData::DeferredReleaseEntry::Buffer:
+ qrhimtl_releaseBuffer(e);
+ break;
+ case QRhiMetalData::DeferredReleaseEntry::RenderBuffer:
+ qrhimtl_releaseRenderBuffer(e);
+ break;
+ case QRhiMetalData::DeferredReleaseEntry::Texture:
+ qrhimtl_releaseTexture(e);
+ break;
+ case QRhiMetalData::DeferredReleaseEntry::Sampler:
+ qrhimtl_releaseSampler(e);
+ break;
+ case QRhiMetalData::DeferredReleaseEntry::StagingBuffer:
+ [e.stagingBuffer.buffer release];
+ break;
+ default:
+ break;
+ }
+ d->releaseQueue.removeAt(i);
+ }
+ }
+}
+
+void QRhiMetal::finishActiveReadbacks(bool forced)
+{
+ QVarLengthArray<std::function<void()>, 4> completedCallbacks;
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ for (int i = d->activeTextureReadbacks.count() - 1; i >= 0; --i) {
+ const QRhiMetalData::TextureReadback &readback(d->activeTextureReadbacks[i]);
+ if (forced || currentFrameSlot == readback.activeFrameSlot || readback.activeFrameSlot < 0) {
+ readback.result->format = readback.format;
+ readback.result->pixelSize = readback.pixelSize;
+ readback.result->data.resize(int(readback.bufSize));
+ void *p = [readback.buf contents];
+ memcpy(readback.result->data.data(), p, readback.bufSize);
+ [readback.buf release];
+
+ QRHI_PROF_F(releaseReadbackBuffer(qint64(qintptr(readback.buf))));
+
+ if (readback.result->completed)
+ completedCallbacks.append(readback.result->completed);
+
+ d->activeTextureReadbacks.removeAt(i);
+ }
+ }
+
+ for (auto f : completedCallbacks)
+ f();
+}
+
+QMetalBuffer::QMetalBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size)
+ : QRhiBuffer(rhi, type, usage, size),
+ d(new QMetalBufferData)
+{
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i)
+ d->buf[i] = nil;
+}
+
+QMetalBuffer::~QMetalBuffer()
+{
+ release();
+ delete d;
+}
+
+void QMetalBuffer::release()
+{
+ if (!d->buf[0])
+ return;
+
+ QRhiMetalData::DeferredReleaseEntry e;
+ e.type = QRhiMetalData::DeferredReleaseEntry::Buffer;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ e.buffer.buffers[i] = d->buf[i];
+ d->buf[i] = nil;
+ d->pendingUpdates[i].clear();
+ }
+
+ QRHI_RES_RHI(QRhiMetal);
+ rhiD->d->releaseQueue.append(e);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseBuffer(this));
+ rhiD->unregisterResource(this);
+}
+
+bool QMetalBuffer::build()
+{
+ if (d->buf[0])
+ release();
+
+ if (m_usage.testFlag(QRhiBuffer::StorageBuffer) && m_type == Dynamic) {
+ qWarning("StorageBuffer cannot be combined with Dynamic");
+ return false;
+ }
+
+ const uint nonZeroSize = m_size <= 0 ? 256 : uint(m_size);
+ const uint roundedSize = m_usage.testFlag(QRhiBuffer::UniformBuffer) ? aligned<uint>(nonZeroSize, 256) : nonZeroSize;
+
+ d->managed = false;
+ MTLResourceOptions opts = MTLResourceStorageModeShared;
+#ifdef Q_OS_MACOS
+ if (m_type != Dynamic) {
+ opts = MTLResourceStorageModeManaged;
+ d->managed = true;
+ }
+#endif
+
+ // Have QMTL_FRAMES_IN_FLIGHT versions regardless of the type, for now.
+ // This is because writing to a Managed buffer (which is what Immutable and
+ // Static maps to on macOS) is not safe when another frame reading from the
+ // same buffer is still in flight.
+ d->slotted = !m_usage.testFlag(QRhiBuffer::StorageBuffer); // except for SSBOs written in the shader
+
+ QRHI_RES_RHI(QRhiMetal);
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ if (i == 0 || d->slotted) {
+ d->buf[i] = [rhiD->d->dev newBufferWithLength: roundedSize options: opts];
+ if (!m_objectName.isEmpty()) {
+ if (!d->slotted) {
+ d->buf[i].label = [NSString stringWithUTF8String: m_objectName.constData()];
+ } else {
+ const QByteArray name = m_objectName + '/' + QByteArray::number(i);
+ d->buf[i].label = [NSString stringWithUTF8String: name.constData()];
+ }
+ }
+ }
+ }
+
+ QRHI_PROF;
+ QRHI_PROF_F(newBuffer(this, roundedSize, d->slotted ? QMTL_FRAMES_IN_FLIGHT : 1, 0));
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QMetalRenderBuffer::QMetalRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+ : QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags),
+ d(new QMetalRenderBufferData)
+{
+}
+
+QMetalRenderBuffer::~QMetalRenderBuffer()
+{
+ release();
+ delete d;
+}
+
+void QMetalRenderBuffer::release()
+{
+ if (!d->tex)
+ return;
+
+ QRhiMetalData::DeferredReleaseEntry e;
+ e.type = QRhiMetalData::DeferredReleaseEntry::RenderBuffer;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.renderbuffer.texture = d->tex;
+ d->tex = nil;
+
+ QRHI_RES_RHI(QRhiMetal);
+ rhiD->d->releaseQueue.append(e);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseRenderBuffer(this));
+ rhiD->unregisterResource(this);
+}
+
+bool QMetalRenderBuffer::build()
+{
+ if (d->tex)
+ release();
+
+ if (m_pixelSize.isEmpty())
+ return false;
+
+ QRHI_RES_RHI(QRhiMetal);
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+
+ MTLTextureDescriptor *desc = [[MTLTextureDescriptor alloc] init];
+ desc.textureType = samples > 1 ? MTLTextureType2DMultisample : MTLTextureType2D;
+ desc.width = NSUInteger(m_pixelSize.width());
+ desc.height = NSUInteger(m_pixelSize.height());
+ if (samples > 1)
+ desc.sampleCount = NSUInteger(samples);
+ desc.resourceOptions = MTLResourceStorageModePrivate;
+ desc.usage = MTLTextureUsageRenderTarget;
+
+ bool transientBacking = false;
+ switch (m_type) {
+ case DepthStencil:
+#ifdef Q_OS_MACOS
+ desc.storageMode = MTLStorageModePrivate;
+#else
+ desc.storageMode = MTLResourceStorageModeMemoryless;
+ transientBacking = true;
+#endif
+ d->format = rhiD->d->dev.depth24Stencil8PixelFormatSupported
+ ? MTLPixelFormatDepth24Unorm_Stencil8 : MTLPixelFormatDepth32Float_Stencil8;
+ desc.pixelFormat = d->format;
+ break;
+ case Color:
+ desc.storageMode = MTLStorageModePrivate;
+ d->format = MTLPixelFormatRGBA8Unorm;
+ desc.pixelFormat = d->format;
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ d->tex = [rhiD->d->dev newTextureWithDescriptor: desc];
+ [desc release];
+
+ if (!m_objectName.isEmpty())
+ d->tex.label = [NSString stringWithUTF8String: m_objectName.constData()];
+
+ QRHI_PROF;
+ QRHI_PROF_F(newRenderBuffer(this, transientBacking, false, samples));
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QRhiTexture::Format QMetalRenderBuffer::backingFormat() const
+{
+ return m_type == Color ? QRhiTexture::RGBA8 : QRhiTexture::UnknownFormat;
+}
+
+QMetalTexture::QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags)
+ : QRhiTexture(rhi, format, pixelSize, sampleCount, flags),
+ d(new QMetalTextureData(this))
+{
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i)
+ d->stagingBuf[i] = nil;
+
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i)
+ d->perLevelViews[i] = nil;
+}
+
+QMetalTexture::~QMetalTexture()
+{
+ release();
+ delete d;
+}
+
+void QMetalTexture::release()
+{
+ if (!d->tex)
+ return;
+
+ QRhiMetalData::DeferredReleaseEntry e;
+ e.type = QRhiMetalData::DeferredReleaseEntry::Texture;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.texture.texture = d->owns ? d->tex : nil;
+ d->tex = nil;
+ nativeHandlesStruct.texture = nullptr;
+
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ e.texture.stagingBuffers[i] = d->stagingBuf[i];
+ d->stagingBuf[i] = nil;
+ }
+
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i) {
+ e.texture.views[i] = d->perLevelViews[i];
+ d->perLevelViews[i] = nil;
+ }
+
+ QRHI_RES_RHI(QRhiMetal);
+ rhiD->d->releaseQueue.append(e);
+ QRHI_PROF;
+ QRHI_PROF_F(releaseTexture(this));
+ rhiD->unregisterResource(this);
+}
+
+static inline MTLPixelFormat toMetalTextureFormat(QRhiTexture::Format format, QRhiTexture::Flags flags)
+{
+ const bool srgb = flags.testFlag(QRhiTexture::sRGB);
+ switch (format) {
+ case QRhiTexture::RGBA8:
+ return srgb ? MTLPixelFormatRGBA8Unorm_sRGB : MTLPixelFormatRGBA8Unorm;
+ case QRhiTexture::BGRA8:
+ return srgb ? MTLPixelFormatBGRA8Unorm_sRGB : MTLPixelFormatBGRA8Unorm;
+ case QRhiTexture::R8:
+#ifdef Q_OS_MACOS
+ return MTLPixelFormatR8Unorm;
+#else
+ return srgb ? MTLPixelFormatR8Unorm_sRGB : MTLPixelFormatR8Unorm;
+#endif
+ case QRhiTexture::R16:
+ return MTLPixelFormatR16Unorm;
+ case QRhiTexture::RED_OR_ALPHA8:
+ return MTLPixelFormatR8Unorm;
+
+ case QRhiTexture::RGBA16F:
+ return MTLPixelFormatRGBA16Float;
+ case QRhiTexture::RGBA32F:
+ return MTLPixelFormatRGBA32Float;
+
+ case QRhiTexture::D16:
+#ifdef Q_OS_MACOS
+ return MTLPixelFormatDepth16Unorm;
+#else
+ return MTLPixelFormatDepth32Float;
+#endif
+ case QRhiTexture::D32F:
+ return MTLPixelFormatDepth32Float;
+
+#ifdef Q_OS_MACOS
+ case QRhiTexture::BC1:
+ return srgb ? MTLPixelFormatBC1_RGBA_sRGB : MTLPixelFormatBC1_RGBA;
+ case QRhiTexture::BC2:
+ return srgb ? MTLPixelFormatBC2_RGBA_sRGB : MTLPixelFormatBC2_RGBA;
+ case QRhiTexture::BC3:
+ return srgb ? MTLPixelFormatBC3_RGBA_sRGB : MTLPixelFormatBC3_RGBA;
+ case QRhiTexture::BC4:
+ return MTLPixelFormatBC4_RUnorm;
+ case QRhiTexture::BC5:
+ qWarning("QRhiMetal does not support BC5");
+ return MTLPixelFormatRGBA8Unorm;
+ case QRhiTexture::BC6H:
+ return MTLPixelFormatBC6H_RGBUfloat;
+ case QRhiTexture::BC7:
+ return srgb ? MTLPixelFormatBC7_RGBAUnorm_sRGB : MTLPixelFormatBC7_RGBAUnorm;
+#else
+ case QRhiTexture::BC1:
+ case QRhiTexture::BC2:
+ case QRhiTexture::BC3:
+ case QRhiTexture::BC4:
+ case QRhiTexture::BC5:
+ case QRhiTexture::BC6H:
+ case QRhiTexture::BC7:
+ qWarning("QRhiMetal: BCx compression not supported on this platform");
+ return MTLPixelFormatRGBA8Unorm;
+#endif
+
+#ifndef Q_OS_MACOS
+ case QRhiTexture::ETC2_RGB8:
+ return srgb ? MTLPixelFormatETC2_RGB8_sRGB : MTLPixelFormatETC2_RGB8;
+ case QRhiTexture::ETC2_RGB8A1:
+ return srgb ? MTLPixelFormatETC2_RGB8A1_sRGB : MTLPixelFormatETC2_RGB8A1;
+ case QRhiTexture::ETC2_RGBA8:
+ return srgb ? MTLPixelFormatEAC_RGBA8_sRGB : MTLPixelFormatEAC_RGBA8;
+
+ case QRhiTexture::ASTC_4x4:
+ return srgb ? MTLPixelFormatASTC_4x4_sRGB : MTLPixelFormatASTC_4x4_LDR;
+ case QRhiTexture::ASTC_5x4:
+ return srgb ? MTLPixelFormatASTC_5x4_sRGB : MTLPixelFormatASTC_5x4_LDR;
+ case QRhiTexture::ASTC_5x5:
+ return srgb ? MTLPixelFormatASTC_5x5_sRGB : MTLPixelFormatASTC_5x5_LDR;
+ case QRhiTexture::ASTC_6x5:
+ return srgb ? MTLPixelFormatASTC_6x5_sRGB : MTLPixelFormatASTC_6x5_LDR;
+ case QRhiTexture::ASTC_6x6:
+ return srgb ? MTLPixelFormatASTC_6x6_sRGB : MTLPixelFormatASTC_6x6_LDR;
+ case QRhiTexture::ASTC_8x5:
+ return srgb ? MTLPixelFormatASTC_8x5_sRGB : MTLPixelFormatASTC_8x5_LDR;
+ case QRhiTexture::ASTC_8x6:
+ return srgb ? MTLPixelFormatASTC_8x6_sRGB : MTLPixelFormatASTC_8x6_LDR;
+ case QRhiTexture::ASTC_8x8:
+ return srgb ? MTLPixelFormatASTC_8x8_sRGB : MTLPixelFormatASTC_8x8_LDR;
+ case QRhiTexture::ASTC_10x5:
+ return srgb ? MTLPixelFormatASTC_10x5_sRGB : MTLPixelFormatASTC_10x5_LDR;
+ case QRhiTexture::ASTC_10x6:
+ return srgb ? MTLPixelFormatASTC_10x6_sRGB : MTLPixelFormatASTC_10x6_LDR;
+ case QRhiTexture::ASTC_10x8:
+ return srgb ? MTLPixelFormatASTC_10x8_sRGB : MTLPixelFormatASTC_10x8_LDR;
+ case QRhiTexture::ASTC_10x10:
+ return srgb ? MTLPixelFormatASTC_10x10_sRGB : MTLPixelFormatASTC_10x10_LDR;
+ case QRhiTexture::ASTC_12x10:
+ return srgb ? MTLPixelFormatASTC_12x10_sRGB : MTLPixelFormatASTC_12x10_LDR;
+ case QRhiTexture::ASTC_12x12:
+ return srgb ? MTLPixelFormatASTC_12x12_sRGB : MTLPixelFormatASTC_12x12_LDR;
+#else
+ case QRhiTexture::ETC2_RGB8:
+ case QRhiTexture::ETC2_RGB8A1:
+ case QRhiTexture::ETC2_RGBA8:
+ qWarning("QRhiMetal: ETC2 compression not supported on this platform");
+ return MTLPixelFormatRGBA8Unorm;
+
+ case QRhiTexture::ASTC_4x4:
+ case QRhiTexture::ASTC_5x4:
+ case QRhiTexture::ASTC_5x5:
+ case QRhiTexture::ASTC_6x5:
+ case QRhiTexture::ASTC_6x6:
+ case QRhiTexture::ASTC_8x5:
+ case QRhiTexture::ASTC_8x6:
+ case QRhiTexture::ASTC_8x8:
+ case QRhiTexture::ASTC_10x5:
+ case QRhiTexture::ASTC_10x6:
+ case QRhiTexture::ASTC_10x8:
+ case QRhiTexture::ASTC_10x10:
+ case QRhiTexture::ASTC_12x10:
+ case QRhiTexture::ASTC_12x12:
+ qWarning("QRhiMetal: ASTC compression not supported on this platform");
+ return MTLPixelFormatRGBA8Unorm;
+#endif
+
+ default:
+ Q_UNREACHABLE();
+ return MTLPixelFormatRGBA8Unorm;
+ }
+}
+
+bool QMetalTexture::prepareBuild(QSize *adjustedSize)
+{
+ if (d->tex)
+ release();
+
+ const QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+
+ QRHI_RES_RHI(QRhiMetal);
+ d->format = toMetalTextureFormat(m_format, m_flags);
+ mipLevelCount = hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1;
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+ if (samples > 1) {
+ if (isCube) {
+ qWarning("Cubemap texture cannot be multisample");
+ return false;
+ }
+ if (hasMipMaps) {
+ qWarning("Multisample texture cannot have mipmaps");
+ return false;
+ }
+ }
+
+ if (adjustedSize)
+ *adjustedSize = size;
+
+ return true;
+}
+
+bool QMetalTexture::build()
+{
+ QSize size;
+ if (!prepareBuild(&size))
+ return false;
+
+ MTLTextureDescriptor *desc = [[MTLTextureDescriptor alloc] init];
+
+ const bool isCube = m_flags.testFlag(CubeMap);
+ if (isCube)
+ desc.textureType = MTLTextureTypeCube;
+ else
+ desc.textureType = samples > 1 ? MTLTextureType2DMultisample : MTLTextureType2D;
+ desc.pixelFormat = d->format;
+ desc.width = NSUInteger(size.width());
+ desc.height = NSUInteger(size.height());
+ desc.mipmapLevelCount = NSUInteger(mipLevelCount);
+ if (samples > 1)
+ desc.sampleCount = NSUInteger(samples);
+ desc.resourceOptions = MTLResourceStorageModePrivate;
+ desc.storageMode = MTLStorageModePrivate;
+ desc.usage = MTLTextureUsageShaderRead;
+ if (m_flags.testFlag(RenderTarget))
+ desc.usage |= MTLTextureUsageRenderTarget;
+ if (m_flags.testFlag(UsedWithLoadStore))
+ desc.usage |= MTLTextureUsageShaderWrite;
+
+ QRHI_RES_RHI(QRhiMetal);
+ d->tex = [rhiD->d->dev newTextureWithDescriptor: desc];
+ [desc release];
+
+ if (!m_objectName.isEmpty())
+ d->tex.label = [NSString stringWithUTF8String: m_objectName.constData()];
+
+ d->owns = true;
+ nativeHandlesStruct.texture = d->tex;
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, true, mipLevelCount, isCube ? 6 : 1, samples));
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+bool QMetalTexture::buildFrom(const QRhiNativeHandles *src)
+{
+ const QRhiMetalTextureNativeHandles *h = static_cast<const QRhiMetalTextureNativeHandles *>(src);
+ if (!h || !h->texture)
+ return false;
+
+ if (!prepareBuild())
+ return false;
+
+ d->tex = (id<MTLTexture>) h->texture;
+
+ d->owns = false;
+ nativeHandlesStruct.texture = d->tex;
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, false, mipLevelCount, m_flags.testFlag(CubeMap) ? 6 : 1, samples));
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ QRHI_RES_RHI(QRhiMetal);
+ rhiD->registerResource(this);
+ return true;
+}
+
+const QRhiNativeHandles *QMetalTexture::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+id<MTLTexture> QMetalTextureData::viewForLevel(int level)
+{
+ Q_ASSERT(level >= 0 && level < int(q->mipLevelCount));
+ if (perLevelViews[level])
+ return perLevelViews[level];
+
+ const MTLTextureType type = [tex textureType];
+ const bool isCube = q->m_flags.testFlag(QRhiTexture::CubeMap);
+ id<MTLTexture> view = [tex newTextureViewWithPixelFormat: format textureType: type
+ levels: NSMakeRange(NSUInteger(level), 1) slices: NSMakeRange(0, isCube ? 6 : 1)];
+
+ perLevelViews[level] = view;
+ return view;
+}
+
+QMetalSampler::QMetalSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v)
+ : QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u, v),
+ d(new QMetalSamplerData)
+{
+}
+
+QMetalSampler::~QMetalSampler()
+{
+ release();
+ delete d;
+}
+
+void QMetalSampler::release()
+{
+ if (!d->samplerState)
+ return;
+
+ QRhiMetalData::DeferredReleaseEntry e;
+ e.type = QRhiMetalData::DeferredReleaseEntry::Sampler;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.sampler.samplerState = d->samplerState;
+ d->samplerState = nil;
+
+ QRHI_RES_RHI(QRhiMetal);
+ rhiD->d->releaseQueue.append(e);
+ rhiD->unregisterResource(this);
+}
+
+static inline MTLSamplerMinMagFilter toMetalFilter(QRhiSampler::Filter f)
+{
+ switch (f) {
+ case QRhiSampler::Nearest:
+ return MTLSamplerMinMagFilterNearest;
+ case QRhiSampler::Linear:
+ return MTLSamplerMinMagFilterLinear;
+ default:
+ Q_UNREACHABLE();
+ return MTLSamplerMinMagFilterNearest;
+ }
+}
+
+static inline MTLSamplerMipFilter toMetalMipmapMode(QRhiSampler::Filter f)
+{
+ switch (f) {
+ case QRhiSampler::None:
+ return MTLSamplerMipFilterNotMipmapped;
+ case QRhiSampler::Nearest:
+ return MTLSamplerMipFilterNearest;
+ case QRhiSampler::Linear:
+ return MTLSamplerMipFilterLinear;
+ default:
+ Q_UNREACHABLE();
+ return MTLSamplerMipFilterNotMipmapped;
+ }
+}
+
+static inline MTLSamplerAddressMode toMetalAddressMode(QRhiSampler::AddressMode m)
+{
+ switch (m) {
+ case QRhiSampler::Repeat:
+ return MTLSamplerAddressModeRepeat;
+ case QRhiSampler::ClampToEdge:
+ return MTLSamplerAddressModeClampToEdge;
+ case QRhiSampler::Border:
+ return MTLSamplerAddressModeClampToBorderColor;
+ case QRhiSampler::Mirror:
+ return MTLSamplerAddressModeMirrorRepeat;
+ case QRhiSampler::MirrorOnce:
+ return MTLSamplerAddressModeMirrorClampToEdge;
+ default:
+ Q_UNREACHABLE();
+ return MTLSamplerAddressModeClampToEdge;
+ }
+}
+
+static inline MTLCompareFunction toMetalTextureCompareFunction(QRhiSampler::CompareOp op)
+{
+ switch (op) {
+ case QRhiSampler::Never:
+ return MTLCompareFunctionNever;
+ case QRhiSampler::Less:
+ return MTLCompareFunctionLess;
+ case QRhiSampler::Equal:
+ return MTLCompareFunctionEqual;
+ case QRhiSampler::LessOrEqual:
+ return MTLCompareFunctionLessEqual;
+ case QRhiSampler::Greater:
+ return MTLCompareFunctionGreater;
+ case QRhiSampler::NotEqual:
+ return MTLCompareFunctionNotEqual;
+ case QRhiSampler::GreaterOrEqual:
+ return MTLCompareFunctionGreaterEqual;
+ case QRhiSampler::Always:
+ return MTLCompareFunctionAlways;
+ default:
+ Q_UNREACHABLE();
+ return MTLCompareFunctionNever;
+ }
+}
+
+bool QMetalSampler::build()
+{
+ if (d->samplerState)
+ release();
+
+ MTLSamplerDescriptor *desc = [[MTLSamplerDescriptor alloc] init];
+ desc.minFilter = toMetalFilter(m_minFilter);
+ desc.magFilter = toMetalFilter(m_magFilter);
+ desc.mipFilter = toMetalMipmapMode(m_mipmapMode);
+ desc.sAddressMode = toMetalAddressMode(m_addressU);
+ desc.tAddressMode = toMetalAddressMode(m_addressV);
+ desc.rAddressMode = toMetalAddressMode(m_addressW);
+ desc.compareFunction = toMetalTextureCompareFunction(m_compareOp);
+
+ QRHI_RES_RHI(QRhiMetal);
+ d->samplerState = [rhiD->d->dev newSamplerStateWithDescriptor: desc];
+ [desc release];
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+// dummy, no Vulkan-style RenderPass+Framebuffer concept here.
+// We do have MTLRenderPassDescriptor of course, but it will be created on the fly for each pass.
+QMetalRenderPassDescriptor::QMetalRenderPassDescriptor(QRhiImplementation *rhi)
+ : QRhiRenderPassDescriptor(rhi)
+{
+}
+
+QMetalRenderPassDescriptor::~QMetalRenderPassDescriptor()
+{
+ release();
+}
+
+void QMetalRenderPassDescriptor::release()
+{
+ // nothing to do here
+}
+
+QMetalReferenceRenderTarget::QMetalReferenceRenderTarget(QRhiImplementation *rhi)
+ : QRhiRenderTarget(rhi),
+ d(new QMetalRenderTargetData)
+{
+}
+
+QMetalReferenceRenderTarget::~QMetalReferenceRenderTarget()
+{
+ release();
+ delete d;
+}
+
+void QMetalReferenceRenderTarget::release()
+{
+ // nothing to do here
+}
+
+QSize QMetalReferenceRenderTarget::pixelSize() const
+{
+ return d->pixelSize;
+}
+
+float QMetalReferenceRenderTarget::devicePixelRatio() const
+{
+ return d->dpr;
+}
+
+int QMetalReferenceRenderTarget::sampleCount() const
+{
+ return d->sampleCount;
+}
+
+QMetalTextureRenderTarget::QMetalTextureRenderTarget(QRhiImplementation *rhi,
+ const QRhiTextureRenderTargetDescription &desc,
+ Flags flags)
+ : QRhiTextureRenderTarget(rhi, desc, flags),
+ d(new QMetalRenderTargetData)
+{
+}
+
+QMetalTextureRenderTarget::~QMetalTextureRenderTarget()
+{
+ release();
+ delete d;
+}
+
+void QMetalTextureRenderTarget::release()
+{
+ // nothing to do here
+}
+
+QRhiRenderPassDescriptor *QMetalTextureRenderTarget::newCompatibleRenderPassDescriptor()
+{
+ const int colorAttachmentCount = m_desc.cendColorAttachments() - m_desc.cbeginColorAttachments();
+ QMetalRenderPassDescriptor *rpD = new QMetalRenderPassDescriptor(m_rhi);
+ rpD->colorAttachmentCount = colorAttachmentCount;
+ rpD->hasDepthStencil = m_desc.depthStencilBuffer() || m_desc.depthTexture();
+
+ for (int i = 0; i < colorAttachmentCount; ++i) {
+ const QRhiColorAttachment *colorAtt = m_desc.colorAttachmentAt(i);
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, colorAtt->texture());
+ QMetalRenderBuffer *rbD = QRHI_RES(QMetalRenderBuffer, colorAtt->renderBuffer());
+ rpD->colorFormat[i] = int(texD ? texD->d->format : rbD->d->format);
+ }
+
+ if (m_desc.depthTexture())
+ rpD->dsFormat = int(QRHI_RES(QMetalTexture, m_desc.depthTexture())->d->format);
+ else if (m_desc.depthStencilBuffer())
+ rpD->dsFormat = int(QRHI_RES(QMetalRenderBuffer, m_desc.depthStencilBuffer())->d->format);
+
+ return rpD;
+}
+
+bool QMetalTextureRenderTarget::build()
+{
+ const bool hasColorAttachments = m_desc.cbeginColorAttachments() != m_desc.cendColorAttachments();
+ Q_ASSERT(hasColorAttachments || m_desc.depthTexture());
+ Q_ASSERT(!m_desc.depthStencilBuffer() || !m_desc.depthTexture());
+ const bool hasDepthStencil = m_desc.depthStencilBuffer() || m_desc.depthTexture();
+
+ d->colorAttCount = 0;
+ int attIndex = 0;
+ for (auto it = m_desc.cbeginColorAttachments(), itEnd = m_desc.cendColorAttachments(); it != itEnd; ++it, ++attIndex) {
+ d->colorAttCount += 1;
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, it->texture());
+ QMetalRenderBuffer *rbD = QRHI_RES(QMetalRenderBuffer, it->renderBuffer());
+ Q_ASSERT(texD || rbD);
+ id<MTLTexture> dst = nil;
+ if (texD) {
+ dst = texD->d->tex;
+ if (attIndex == 0) {
+ d->pixelSize = texD->pixelSize();
+ d->sampleCount = texD->samples;
+ }
+ } else if (rbD) {
+ dst = rbD->d->tex;
+ if (attIndex == 0) {
+ d->pixelSize = rbD->pixelSize();
+ d->sampleCount = rbD->samples;
+ }
+ }
+ QMetalRenderTargetData::ColorAtt colorAtt;
+ colorAtt.tex = dst;
+ colorAtt.layer = it->layer();
+ colorAtt.level = it->level();
+ QMetalTexture *resTexD = QRHI_RES(QMetalTexture, it->resolveTexture());
+ colorAtt.resolveTex = resTexD ? resTexD->d->tex : nil;
+ colorAtt.resolveLayer = it->resolveLayer();
+ colorAtt.resolveLevel = it->resolveLevel();
+ d->fb.colorAtt[attIndex] = colorAtt;
+ }
+ d->dpr = 1;
+
+ if (hasDepthStencil) {
+ if (m_desc.depthTexture()) {
+ QMetalTexture *depthTexD = QRHI_RES(QMetalTexture, m_desc.depthTexture());
+ d->fb.dsTex = depthTexD->d->tex;
+ d->fb.hasStencil = false;
+ d->fb.depthNeedsStore = true;
+ if (d->colorAttCount == 0) {
+ d->pixelSize = depthTexD->pixelSize();
+ d->sampleCount = depthTexD->samples;
+ }
+ } else {
+ QMetalRenderBuffer *depthRbD = QRHI_RES(QMetalRenderBuffer, m_desc.depthStencilBuffer());
+ d->fb.dsTex = depthRbD->d->tex;
+ d->fb.hasStencil = true;
+ d->fb.depthNeedsStore = false;
+ if (d->colorAttCount == 0) {
+ d->pixelSize = depthRbD->pixelSize();
+ d->sampleCount = depthRbD->samples;
+ }
+ }
+ d->dsAttCount = 1;
+ } else {
+ d->dsAttCount = 0;
+ }
+
+ return true;
+}
+
+QSize QMetalTextureRenderTarget::pixelSize() const
+{
+ return d->pixelSize;
+}
+
+float QMetalTextureRenderTarget::devicePixelRatio() const
+{
+ return d->dpr;
+}
+
+int QMetalTextureRenderTarget::sampleCount() const
+{
+ return d->sampleCount;
+}
+
+QMetalShaderResourceBindings::QMetalShaderResourceBindings(QRhiImplementation *rhi)
+ : QRhiShaderResourceBindings(rhi)
+{
+}
+
+QMetalShaderResourceBindings::~QMetalShaderResourceBindings()
+{
+ release();
+}
+
+void QMetalShaderResourceBindings::release()
+{
+ sortedBindings.clear();
+ maxBinding = -1;
+}
+
+bool QMetalShaderResourceBindings::build()
+{
+ if (!sortedBindings.isEmpty())
+ release();
+
+ std::copy(m_bindings.cbegin(), m_bindings.cend(), std::back_inserter(sortedBindings));
+ std::sort(sortedBindings.begin(), sortedBindings.end(),
+ [](const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)
+ {
+ return a.data()->binding < b.data()->binding;
+ });
+ if (!sortedBindings.isEmpty())
+ maxBinding = sortedBindings.last().data()->binding;
+ else
+ maxBinding = -1;
+
+ boundResourceData.resize(sortedBindings.count());
+
+ for (int i = 0, ie = sortedBindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = sortedBindings.at(i).data();
+ QMetalShaderResourceBindings::BoundResourceData &bd(boundResourceData[i]);
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, b->u.ubuf.buf);
+ bd.ubuf.id = bufD->m_id;
+ bd.ubuf.generation = bufD->generation;
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, b->u.stex.tex);
+ QMetalSampler *samplerD = QRHI_RES(QMetalSampler, b->u.stex.sampler);
+ bd.stex.texId = texD->m_id;
+ bd.stex.texGeneration = texD->generation;
+ bd.stex.samplerId = samplerD->m_id;
+ bd.stex.samplerGeneration = samplerD->generation;
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QMetalTexture *texD = QRHI_RES(QMetalTexture, b->u.simage.tex);
+ bd.simage.id = texD->m_id;
+ bd.simage.generation = texD->generation;
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QMetalBuffer *bufD = QRHI_RES(QMetalBuffer, b->u.sbuf.buf);
+ bd.sbuf.id = bufD->m_id;
+ bd.sbuf.generation = bufD->generation;
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ generation += 1;
+ return true;
+}
+
+QMetalGraphicsPipeline::QMetalGraphicsPipeline(QRhiImplementation *rhi)
+ : QRhiGraphicsPipeline(rhi),
+ d(new QMetalGraphicsPipelineData)
+{
+}
+
+QMetalGraphicsPipeline::~QMetalGraphicsPipeline()
+{
+ release();
+ delete d;
+}
+
+void QMetalGraphicsPipeline::release()
+{
+ QRHI_RES_RHI(QRhiMetal);
+
+ d->vs.release();
+ d->fs.release();
+
+ [d->ds release];
+ d->ds = nil;
+
+ if (!d->ps)
+ return;
+
+ [d->ps release];
+ d->ps = nil;
+
+ rhiD->unregisterResource(this);
+}
+
+static inline MTLVertexFormat toMetalAttributeFormat(QRhiVertexInputAttribute::Format format)
+{
+ switch (format) {
+ case QRhiVertexInputAttribute::Float4:
+ return MTLVertexFormatFloat4;
+ case QRhiVertexInputAttribute::Float3:
+ return MTLVertexFormatFloat3;
+ case QRhiVertexInputAttribute::Float2:
+ return MTLVertexFormatFloat2;
+ case QRhiVertexInputAttribute::Float:
+ return MTLVertexFormatFloat;
+ case QRhiVertexInputAttribute::UNormByte4:
+ return MTLVertexFormatUChar4Normalized;
+ case QRhiVertexInputAttribute::UNormByte2:
+ return MTLVertexFormatUChar2Normalized;
+ case QRhiVertexInputAttribute::UNormByte:
+ if (@available(macOS 10.13, iOS 11.0, *))
+ return MTLVertexFormatUCharNormalized;
+ else
+ Q_UNREACHABLE();
+ default:
+ Q_UNREACHABLE();
+ return MTLVertexFormatFloat4;
+ }
+}
+
+static inline MTLBlendFactor toMetalBlendFactor(QRhiGraphicsPipeline::BlendFactor f)
+{
+ switch (f) {
+ case QRhiGraphicsPipeline::Zero:
+ return MTLBlendFactorZero;
+ case QRhiGraphicsPipeline::One:
+ return MTLBlendFactorOne;
+ case QRhiGraphicsPipeline::SrcColor:
+ return MTLBlendFactorSourceColor;
+ case QRhiGraphicsPipeline::OneMinusSrcColor:
+ return MTLBlendFactorOneMinusSourceColor;
+ case QRhiGraphicsPipeline::DstColor:
+ return MTLBlendFactorDestinationColor;
+ case QRhiGraphicsPipeline::OneMinusDstColor:
+ return MTLBlendFactorOneMinusDestinationColor;
+ case QRhiGraphicsPipeline::SrcAlpha:
+ return MTLBlendFactorSourceAlpha;
+ case QRhiGraphicsPipeline::OneMinusSrcAlpha:
+ return MTLBlendFactorOneMinusSourceAlpha;
+ case QRhiGraphicsPipeline::DstAlpha:
+ return MTLBlendFactorDestinationAlpha;
+ case QRhiGraphicsPipeline::OneMinusDstAlpha:
+ return MTLBlendFactorOneMinusDestinationAlpha;
+ case QRhiGraphicsPipeline::ConstantColor:
+ return MTLBlendFactorBlendColor;
+ case QRhiGraphicsPipeline::ConstantAlpha:
+ return MTLBlendFactorBlendAlpha;
+ case QRhiGraphicsPipeline::OneMinusConstantColor:
+ return MTLBlendFactorOneMinusBlendColor;
+ case QRhiGraphicsPipeline::OneMinusConstantAlpha:
+ return MTLBlendFactorOneMinusBlendAlpha;
+ case QRhiGraphicsPipeline::SrcAlphaSaturate:
+ return MTLBlendFactorSourceAlphaSaturated;
+ case QRhiGraphicsPipeline::Src1Color:
+ return MTLBlendFactorSource1Color;
+ case QRhiGraphicsPipeline::OneMinusSrc1Color:
+ return MTLBlendFactorOneMinusSource1Color;
+ case QRhiGraphicsPipeline::Src1Alpha:
+ return MTLBlendFactorSource1Alpha;
+ case QRhiGraphicsPipeline::OneMinusSrc1Alpha:
+ return MTLBlendFactorOneMinusSource1Alpha;
+ default:
+ Q_UNREACHABLE();
+ return MTLBlendFactorZero;
+ }
+}
+
+static inline MTLBlendOperation toMetalBlendOp(QRhiGraphicsPipeline::BlendOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Add:
+ return MTLBlendOperationAdd;
+ case QRhiGraphicsPipeline::Subtract:
+ return MTLBlendOperationSubtract;
+ case QRhiGraphicsPipeline::ReverseSubtract:
+ return MTLBlendOperationReverseSubtract;
+ case QRhiGraphicsPipeline::Min:
+ return MTLBlendOperationMin;
+ case QRhiGraphicsPipeline::Max:
+ return MTLBlendOperationMax;
+ default:
+ Q_UNREACHABLE();
+ return MTLBlendOperationAdd;
+ }
+}
+
+static inline uint toMetalColorWriteMask(QRhiGraphicsPipeline::ColorMask c)
+{
+ uint f = 0;
+ if (c.testFlag(QRhiGraphicsPipeline::R))
+ f |= MTLColorWriteMaskRed;
+ if (c.testFlag(QRhiGraphicsPipeline::G))
+ f |= MTLColorWriteMaskGreen;
+ if (c.testFlag(QRhiGraphicsPipeline::B))
+ f |= MTLColorWriteMaskBlue;
+ if (c.testFlag(QRhiGraphicsPipeline::A))
+ f |= MTLColorWriteMaskAlpha;
+ return f;
+}
+
+static inline MTLCompareFunction toMetalCompareOp(QRhiGraphicsPipeline::CompareOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Never:
+ return MTLCompareFunctionNever;
+ case QRhiGraphicsPipeline::Less:
+ return MTLCompareFunctionLess;
+ case QRhiGraphicsPipeline::Equal:
+ return MTLCompareFunctionEqual;
+ case QRhiGraphicsPipeline::LessOrEqual:
+ return MTLCompareFunctionLessEqual;
+ case QRhiGraphicsPipeline::Greater:
+ return MTLCompareFunctionGreater;
+ case QRhiGraphicsPipeline::NotEqual:
+ return MTLCompareFunctionNotEqual;
+ case QRhiGraphicsPipeline::GreaterOrEqual:
+ return MTLCompareFunctionGreaterEqual;
+ case QRhiGraphicsPipeline::Always:
+ return MTLCompareFunctionAlways;
+ default:
+ Q_UNREACHABLE();
+ return MTLCompareFunctionAlways;
+ }
+}
+
+static inline MTLStencilOperation toMetalStencilOp(QRhiGraphicsPipeline::StencilOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::StencilZero:
+ return MTLStencilOperationZero;
+ case QRhiGraphicsPipeline::Keep:
+ return MTLStencilOperationKeep;
+ case QRhiGraphicsPipeline::Replace:
+ return MTLStencilOperationReplace;
+ case QRhiGraphicsPipeline::IncrementAndClamp:
+ return MTLStencilOperationIncrementClamp;
+ case QRhiGraphicsPipeline::DecrementAndClamp:
+ return MTLStencilOperationDecrementClamp;
+ case QRhiGraphicsPipeline::Invert:
+ return MTLStencilOperationInvert;
+ case QRhiGraphicsPipeline::IncrementAndWrap:
+ return MTLStencilOperationIncrementWrap;
+ case QRhiGraphicsPipeline::DecrementAndWrap:
+ return MTLStencilOperationDecrementWrap;
+ default:
+ Q_UNREACHABLE();
+ return MTLStencilOperationKeep;
+ }
+}
+
+static inline MTLPrimitiveType toMetalPrimitiveType(QRhiGraphicsPipeline::Topology t)
+{
+ switch (t) {
+ case QRhiGraphicsPipeline::Triangles:
+ return MTLPrimitiveTypeTriangle;
+ case QRhiGraphicsPipeline::TriangleStrip:
+ return MTLPrimitiveTypeTriangleStrip;
+ case QRhiGraphicsPipeline::Lines:
+ return MTLPrimitiveTypeLine;
+ case QRhiGraphicsPipeline::LineStrip:
+ return MTLPrimitiveTypeLineStrip;
+ case QRhiGraphicsPipeline::Points:
+ return MTLPrimitiveTypePoint;
+ default:
+ Q_UNREACHABLE();
+ return MTLPrimitiveTypeTriangle;
+ }
+}
+
+static inline MTLCullMode toMetalCullMode(QRhiGraphicsPipeline::CullMode c)
+{
+ switch (c) {
+ case QRhiGraphicsPipeline::None:
+ return MTLCullModeNone;
+ case QRhiGraphicsPipeline::Front:
+ return MTLCullModeFront;
+ case QRhiGraphicsPipeline::Back:
+ return MTLCullModeBack;
+ default:
+ Q_UNREACHABLE();
+ return MTLCullModeNone;
+ }
+}
+
+id<MTLLibrary> QRhiMetalData::createMetalLib(const QShader &shader, QShader::Variant shaderVariant,
+ QString *error, QByteArray *entryPoint, QShaderKey *activeKey)
+{
+ QShaderKey key = { QShader::MetalLibShader, 12, shaderVariant };
+ QShaderCode mtllib = shader.shader(key);
+ if (!mtllib.shader().isEmpty()) {
+ dispatch_data_t data = dispatch_data_create(mtllib.shader().constData(),
+ size_t(mtllib.shader().size()),
+ dispatch_get_global_queue(0, 0),
+ DISPATCH_DATA_DESTRUCTOR_DEFAULT);
+ NSError *err = nil;
+ id<MTLLibrary> lib = [dev newLibraryWithData: data error: &err];
+ dispatch_release(data);
+ if (!err) {
+ *entryPoint = mtllib.entryPoint();
+ *activeKey = key;
+ return lib;
+ } else {
+ const QString msg = QString::fromNSString(err.localizedDescription);
+ qWarning("Failed to load metallib from baked shader: %s", qPrintable(msg));
+ }
+ }
+
+ key = { QShader::MslShader, 12, shaderVariant };
+ QShaderCode mslSource = shader.shader(key);
+ if (mslSource.shader().isEmpty()) {
+ qWarning() << "No MSL 1.2 code found in baked shader" << shader;
+ return nil;
+ }
+
+ NSString *src = [NSString stringWithUTF8String: mslSource.shader().constData()];
+ MTLCompileOptions *opts = [[MTLCompileOptions alloc] init];
+ opts.languageVersion = MTLLanguageVersion1_2;
+ NSError *err = nil;
+ id<MTLLibrary> lib = [dev newLibraryWithSource: src options: opts error: &err];
+ [opts release];
+ // src is autoreleased
+
+ if (err) {
+ const QString msg = QString::fromNSString(err.localizedDescription);
+ *error = msg;
+ return nil;
+ }
+
+ *entryPoint = mslSource.entryPoint();
+ *activeKey = key;
+ return lib;
+}
+
+id<MTLFunction> QRhiMetalData::createMSLShaderFunction(id<MTLLibrary> lib, const QByteArray &entryPoint)
+{
+ NSString *name = [NSString stringWithUTF8String: entryPoint.constData()];
+ id<MTLFunction> f = [lib newFunctionWithName: name];
+ [name release];
+ return f;
+}
+
+bool QMetalGraphicsPipeline::build()
+{
+ if (d->ps)
+ release();
+
+ QRHI_RES_RHI(QRhiMetal);
+ if (!rhiD->sanityCheckGraphicsPipeline(this))
+ return false;
+
+ // same binding space for vertex and constant buffers - work it around
+ const int firstVertexBinding = QRHI_RES(QMetalShaderResourceBindings, m_shaderResourceBindings)->maxBinding + 1;
+
+ MTLVertexDescriptor *inputLayout = [MTLVertexDescriptor vertexDescriptor];
+ for (auto it = m_vertexInputLayout.cbeginAttributes(), itEnd = m_vertexInputLayout.cendAttributes();
+ it != itEnd; ++it)
+ {
+ const uint loc = uint(it->location());
+ inputLayout.attributes[loc].format = toMetalAttributeFormat(it->format());
+ inputLayout.attributes[loc].offset = NSUInteger(it->offset());
+ inputLayout.attributes[loc].bufferIndex = NSUInteger(firstVertexBinding + it->binding());
+ }
+ int bindingIndex = 0;
+ for (auto it = m_vertexInputLayout.cbeginBindings(), itEnd = m_vertexInputLayout.cendBindings();
+ it != itEnd; ++it, ++bindingIndex)
+ {
+ const uint layoutIdx = uint(firstVertexBinding + bindingIndex);
+ inputLayout.layouts[layoutIdx].stepFunction =
+ it->classification() == QRhiVertexInputBinding::PerInstance
+ ? MTLVertexStepFunctionPerInstance : MTLVertexStepFunctionPerVertex;
+ inputLayout.layouts[layoutIdx].stepRate = NSUInteger(it->instanceStepRate());
+ inputLayout.layouts[layoutIdx].stride = it->stride();
+ }
+
+ MTLRenderPipelineDescriptor *rpDesc = [[MTLRenderPipelineDescriptor alloc] init];
+
+ rpDesc.vertexDescriptor = inputLayout;
+
+ // mutability cannot be determined (slotted buffers could be set as
+ // MTLMutabilityImmutable, but then we potentially need a different
+ // descriptor for each buffer combination as this depends on the actual
+ // buffers not just the resource binding layout) so leave it at the default
+
+ for (const QRhiShaderStage &shaderStage : qAsConst(m_shaderStages)) {
+ auto cacheIt = rhiD->d->shaderCache.constFind(shaderStage);
+ if (cacheIt != rhiD->d->shaderCache.constEnd()) {
+ switch (shaderStage.type()) {
+ case QRhiShaderStage::Vertex:
+ d->vs = *cacheIt;
+ [d->vs.lib retain];
+ [d->vs.func retain];
+ rpDesc.vertexFunction = d->vs.func;
+ break;
+ case QRhiShaderStage::Fragment:
+ d->fs = *cacheIt;
+ [d->fs.lib retain];
+ [d->fs.func retain];
+ rpDesc.fragmentFunction = d->fs.func;
+ break;
+ default:
+ break;
+ }
+ } else {
+ const QShader shader = shaderStage.shader();
+ QString error;
+ QByteArray entryPoint;
+ QShaderKey activeKey;
+ id<MTLLibrary> lib = rhiD->d->createMetalLib(shader, shaderStage.shaderVariant(),
+ &error, &entryPoint, &activeKey);
+ if (!lib) {
+ qWarning("MSL shader compilation failed: %s", qPrintable(error));
+ return false;
+ }
+ id<MTLFunction> func = rhiD->d->createMSLShaderFunction(lib, entryPoint);
+ if (!func) {
+ qWarning("MSL function for entry point %s not found", entryPoint.constData());
+ [lib release];
+ return false;
+ }
+ if (rhiD->d->shaderCache.count() >= QRhiMetal::MAX_SHADER_CACHE_ENTRIES) {
+ // Use the simplest strategy: too many cached shaders -> drop them all.
+ for (QMetalShader &s : rhiD->d->shaderCache)
+ s.release();
+ rhiD->d->shaderCache.clear();
+ }
+ switch (shaderStage.type()) {
+ case QRhiShaderStage::Vertex:
+ d->vs.lib = lib;
+ d->vs.func = func;
+ if (const QShader::NativeResourceBindingMap *map = shader.nativeResourceBindingMap(activeKey))
+ d->vs.nativeResourceBindingMap = *map;
+ rhiD->d->shaderCache.insert(shaderStage, d->vs);
+ [d->vs.lib retain];
+ [d->vs.func retain];
+ rpDesc.vertexFunction = func;
+ break;
+ case QRhiShaderStage::Fragment:
+ d->fs.lib = lib;
+ d->fs.func = func;
+ if (const QShader::NativeResourceBindingMap *map = shader.nativeResourceBindingMap(activeKey))
+ d->fs.nativeResourceBindingMap = *map;
+ rhiD->d->shaderCache.insert(shaderStage, d->fs);
+ [d->fs.lib retain];
+ [d->fs.func retain];
+ rpDesc.fragmentFunction = func;
+ break;
+ default:
+ [func release];
+ [lib release];
+ break;
+ }
+ }
+ }
+
+ QMetalRenderPassDescriptor *rpD = QRHI_RES(QMetalRenderPassDescriptor, m_renderPassDesc);
+
+ if (rpD->colorAttachmentCount) {
+ // defaults when no targetBlends are provided
+ rpDesc.colorAttachments[0].pixelFormat = MTLPixelFormat(rpD->colorFormat[0]);
+ rpDesc.colorAttachments[0].writeMask = MTLColorWriteMaskAll;
+ rpDesc.colorAttachments[0].blendingEnabled = false;
+
+ Q_ASSERT(m_targetBlends.count() == rpD->colorAttachmentCount
+ || (m_targetBlends.isEmpty() && rpD->colorAttachmentCount == 1));
+
+ for (uint i = 0, ie = uint(m_targetBlends.count()); i != ie; ++i) {
+ const QRhiGraphicsPipeline::TargetBlend &b(m_targetBlends[int(i)]);
+ rpDesc.colorAttachments[i].pixelFormat = MTLPixelFormat(rpD->colorFormat[i]);
+ rpDesc.colorAttachments[i].blendingEnabled = b.enable;
+ rpDesc.colorAttachments[i].sourceRGBBlendFactor = toMetalBlendFactor(b.srcColor);
+ rpDesc.colorAttachments[i].destinationRGBBlendFactor = toMetalBlendFactor(b.dstColor);
+ rpDesc.colorAttachments[i].rgbBlendOperation = toMetalBlendOp(b.opColor);
+ rpDesc.colorAttachments[i].sourceAlphaBlendFactor = toMetalBlendFactor(b.srcAlpha);
+ rpDesc.colorAttachments[i].destinationAlphaBlendFactor = toMetalBlendFactor(b.dstAlpha);
+ rpDesc.colorAttachments[i].alphaBlendOperation = toMetalBlendOp(b.opAlpha);
+ rpDesc.colorAttachments[i].writeMask = toMetalColorWriteMask(b.colorWrite);
+ }
+ }
+
+ if (rpD->hasDepthStencil) {
+ // Must only be set when a depth-stencil buffer will actually be bound,
+ // validation blows up otherwise.
+ MTLPixelFormat fmt = MTLPixelFormat(rpD->dsFormat);
+ rpDesc.depthAttachmentPixelFormat = fmt;
+ if (fmt != MTLPixelFormatDepth16Unorm && fmt != MTLPixelFormatDepth32Float)
+ rpDesc.stencilAttachmentPixelFormat = fmt;
+ }
+
+ rpDesc.sampleCount = NSUInteger(rhiD->effectiveSampleCount(m_sampleCount));
+
+ NSError *err = nil;
+ d->ps = [rhiD->d->dev newRenderPipelineStateWithDescriptor: rpDesc error: &err];
+ if (!d->ps) {
+ const QString msg = QString::fromNSString(err.localizedDescription);
+ qWarning("Failed to create render pipeline state: %s", qPrintable(msg));
+ [rpDesc release];
+ return false;
+ }
+ [rpDesc release];
+
+ MTLDepthStencilDescriptor *dsDesc = [[MTLDepthStencilDescriptor alloc] init];
+ dsDesc.depthCompareFunction = m_depthTest ? toMetalCompareOp(m_depthOp) : MTLCompareFunctionAlways;
+ dsDesc.depthWriteEnabled = m_depthWrite;
+ if (m_stencilTest) {
+ dsDesc.frontFaceStencil = [[MTLStencilDescriptor alloc] init];
+ dsDesc.frontFaceStencil.stencilFailureOperation = toMetalStencilOp(m_stencilFront.failOp);
+ dsDesc.frontFaceStencil.depthFailureOperation = toMetalStencilOp(m_stencilFront.depthFailOp);
+ dsDesc.frontFaceStencil.depthStencilPassOperation = toMetalStencilOp(m_stencilFront.passOp);
+ dsDesc.frontFaceStencil.stencilCompareFunction = toMetalCompareOp(m_stencilFront.compareOp);
+ dsDesc.frontFaceStencil.readMask = m_stencilReadMask;
+ dsDesc.frontFaceStencil.writeMask = m_stencilWriteMask;
+
+ dsDesc.backFaceStencil = [[MTLStencilDescriptor alloc] init];
+ dsDesc.backFaceStencil.stencilFailureOperation = toMetalStencilOp(m_stencilBack.failOp);
+ dsDesc.backFaceStencil.depthFailureOperation = toMetalStencilOp(m_stencilBack.depthFailOp);
+ dsDesc.backFaceStencil.depthStencilPassOperation = toMetalStencilOp(m_stencilBack.passOp);
+ dsDesc.backFaceStencil.stencilCompareFunction = toMetalCompareOp(m_stencilBack.compareOp);
+ dsDesc.backFaceStencil.readMask = m_stencilReadMask;
+ dsDesc.backFaceStencil.writeMask = m_stencilWriteMask;
+ }
+
+ d->ds = [rhiD->d->dev newDepthStencilStateWithDescriptor: dsDesc];
+ [dsDesc release];
+
+ d->primitiveType = toMetalPrimitiveType(m_topology);
+ d->winding = m_frontFace == CCW ? MTLWindingCounterClockwise : MTLWindingClockwise;
+ d->cullMode = toMetalCullMode(m_cullMode);
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QMetalComputePipeline::QMetalComputePipeline(QRhiImplementation *rhi)
+ : QRhiComputePipeline(rhi),
+ d(new QMetalComputePipelineData)
+{
+}
+
+QMetalComputePipeline::~QMetalComputePipeline()
+{
+ release();
+ delete d;
+}
+
+void QMetalComputePipeline::release()
+{
+ QRHI_RES_RHI(QRhiMetal);
+
+ d->cs.release();
+
+ if (!d->ps)
+ return;
+
+ [d->ps release];
+ d->ps = nil;
+
+ rhiD->unregisterResource(this);
+}
+
+bool QMetalComputePipeline::build()
+{
+ if (d->ps)
+ release();
+
+ QRHI_RES_RHI(QRhiMetal);
+
+ auto cacheIt = rhiD->d->shaderCache.constFind(m_shaderStage);
+ if (cacheIt != rhiD->d->shaderCache.constEnd()) {
+ d->cs = *cacheIt;
+ } else {
+ const QShader shader = m_shaderStage.shader();
+ QString error;
+ QByteArray entryPoint;
+ QShaderKey activeKey;
+ id<MTLLibrary> lib = rhiD->d->createMetalLib(shader, m_shaderStage.shaderVariant(),
+ &error, &entryPoint, &activeKey);
+ if (!lib) {
+ qWarning("MSL shader compilation failed: %s", qPrintable(error));
+ return false;
+ }
+ id<MTLFunction> func = rhiD->d->createMSLShaderFunction(lib, entryPoint);
+ if (!func) {
+ qWarning("MSL function for entry point %s not found", entryPoint.constData());
+ [lib release];
+ return false;
+ }
+ d->cs.lib = lib;
+ d->cs.func = func;
+ d->cs.localSize = shader.description().computeShaderLocalSize();
+ if (const QShader::NativeResourceBindingMap *map = shader.nativeResourceBindingMap(activeKey))
+ d->cs.nativeResourceBindingMap = *map;
+
+ if (rhiD->d->shaderCache.count() >= QRhiMetal::MAX_SHADER_CACHE_ENTRIES) {
+ for (QMetalShader &s : rhiD->d->shaderCache)
+ s.release();
+ rhiD->d->shaderCache.clear();
+ }
+ rhiD->d->shaderCache.insert(m_shaderStage, d->cs);
+ }
+
+ [d->cs.lib retain];
+ [d->cs.func retain];
+
+ d->localSize = MTLSizeMake(d->cs.localSize[0], d->cs.localSize[1], d->cs.localSize[2]);
+
+ NSError *err = nil;
+ d->ps = [rhiD->d->dev newComputePipelineStateWithFunction: d->cs.func error: &err];
+ if (!d->ps) {
+ const QString msg = QString::fromNSString(err.localizedDescription);
+ qWarning("Failed to create render pipeline state: %s", qPrintable(msg));
+ return false;
+ }
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QMetalCommandBuffer::QMetalCommandBuffer(QRhiImplementation *rhi)
+ : QRhiCommandBuffer(rhi),
+ d(new QMetalCommandBufferData)
+{
+ resetState();
+}
+
+QMetalCommandBuffer::~QMetalCommandBuffer()
+{
+ release();
+ delete d;
+}
+
+void QMetalCommandBuffer::release()
+{
+ // nothing to do here, we do not own the MTL cb object
+}
+
+const QRhiNativeHandles *QMetalCommandBuffer::nativeHandles()
+{
+ nativeHandlesStruct.commandBuffer = d->cb;
+ nativeHandlesStruct.encoder = d->currentRenderPassEncoder;
+ return &nativeHandlesStruct;
+}
+
+void QMetalCommandBuffer::resetState()
+{
+ d->currentRenderPassEncoder = nil;
+ d->currentComputePassEncoder = nil;
+ d->currentPassRpDesc = nil;
+ resetPerPassState();
+}
+
+void QMetalCommandBuffer::resetPerPassState()
+{
+ recordingPass = NoPass;
+ currentTarget = nullptr;
+ resetPerPassCachedState();
+}
+
+void QMetalCommandBuffer::resetPerPassCachedState()
+{
+ currentGraphicsPipeline = nullptr;
+ currentComputePipeline = nullptr;
+ currentPipelineGeneration = 0;
+ currentGraphicsSrb = nullptr;
+ currentComputeSrb = nullptr;
+ currentSrbGeneration = 0;
+ currentResSlot = -1;
+ currentIndexBuffer = nullptr;
+ currentIndexOffset = 0;
+ currentIndexFormat = QRhiCommandBuffer::IndexUInt16;
+ currentCullMode = -1;
+ currentFrontFaceWinding = -1;
+
+ d->currentFirstVertexBinding = -1;
+ d->currentVertexInputsBuffers.clear();
+ d->currentVertexInputOffsets.clear();
+}
+
+QMetalSwapChain::QMetalSwapChain(QRhiImplementation *rhi)
+ : QRhiSwapChain(rhi),
+ rtWrapper(rhi),
+ cbWrapper(rhi),
+ d(new QMetalSwapChainData)
+{
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ d->sem[i] = nullptr;
+ d->msaaTex[i] = nil;
+ }
+}
+
+QMetalSwapChain::~QMetalSwapChain()
+{
+ release();
+ delete d;
+}
+
+void QMetalSwapChain::release()
+{
+ if (!d->layer)
+ return;
+
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ if (d->sem[i]) {
+ // the semaphores cannot be released if they do not have the initial value
+ dispatch_semaphore_wait(d->sem[i], DISPATCH_TIME_FOREVER);
+ dispatch_semaphore_signal(d->sem[i]);
+
+ dispatch_release(d->sem[i]);
+ d->sem[i] = nullptr;
+ }
+ }
+
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ [d->msaaTex[i] release];
+ d->msaaTex[i] = nil;
+ }
+
+ d->layer = nullptr;
+
+ QRHI_RES_RHI(QRhiMetal);
+ rhiD->swapchains.remove(this);
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseSwapChain(this));
+
+ rhiD->unregisterResource(this);
+}
+
+QRhiCommandBuffer *QMetalSwapChain::currentFrameCommandBuffer()
+{
+ return &cbWrapper;
+}
+
+QRhiRenderTarget *QMetalSwapChain::currentFrameRenderTarget()
+{
+ return &rtWrapper;
+}
+
+QSize QMetalSwapChain::surfacePixelSize()
+{
+ Q_ASSERT(m_window);
+ return m_window->size() * m_window->devicePixelRatio();
+}
+
+QRhiRenderPassDescriptor *QMetalSwapChain::newCompatibleRenderPassDescriptor()
+{
+ chooseFormats(); // ensure colorFormat and similar are filled out
+
+ QRHI_RES_RHI(QRhiMetal);
+ QMetalRenderPassDescriptor *rpD = new QMetalRenderPassDescriptor(m_rhi);
+ rpD->colorAttachmentCount = 1;
+ rpD->hasDepthStencil = m_depthStencil != nullptr;
+
+ rpD->colorFormat[0] = int(d->colorFormat);
+
+ // m_depthStencil may not be built yet so cannot rely on computed fields in it
+ rpD->dsFormat = rhiD->d->dev.depth24Stencil8PixelFormatSupported
+ ? MTLPixelFormatDepth24Unorm_Stencil8 : MTLPixelFormatDepth32Float_Stencil8;
+
+ return rpD;
+}
+
+void QMetalSwapChain::chooseFormats()
+{
+ QRHI_RES_RHI(QRhiMetal);
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+ // pick a format that is allowed for CAMetalLayer.pixelFormat
+ d->colorFormat = m_flags.testFlag(sRGB) ? MTLPixelFormatBGRA8Unorm_sRGB : MTLPixelFormatBGRA8Unorm;
+ d->rhiColorFormat = QRhiTexture::BGRA8;
+}
+
+bool QMetalSwapChain::buildOrResize()
+{
+ Q_ASSERT(m_window);
+
+ const bool needsRegistration = !window || window != m_window;
+
+ if (window && window != m_window)
+ release();
+ // else no release(), this is intentional
+
+ QRHI_RES_RHI(QRhiMetal);
+ if (needsRegistration)
+ rhiD->swapchains.insert(this);
+
+ window = m_window;
+
+ if (window->surfaceType() != QSurface::MetalSurface) {
+ qWarning("QMetalSwapChain only supports MetalSurface windows");
+ return false;
+ }
+
+ NSView *view = reinterpret_cast<NSView *>(window->winId());
+ Q_ASSERT(view);
+ d->layer = static_cast<CAMetalLayer *>(view.layer);
+ Q_ASSERT(d->layer);
+
+ chooseFormats();
+ if (d->colorFormat != d->layer.pixelFormat)
+ d->layer.pixelFormat = d->colorFormat;
+
+ if (m_flags.testFlag(UsedAsTransferSource))
+ d->layer.framebufferOnly = NO;
+
+#ifdef Q_OS_MACOS
+ if (m_flags.testFlag(NoVSync)) {
+ if (@available(macOS 10.13, *))
+ d->layer.displaySyncEnabled = NO;
+ }
+#endif
+
+ if (m_flags.testFlag(SurfaceHasPreMulAlpha)) {
+ d->layer.opaque = NO;
+ } else if (m_flags.testFlag(SurfaceHasNonPreMulAlpha)) {
+ // The CoreAnimation compositor is said to expect premultiplied alpha,
+ // so this is then wrong when it comes to the blending operations but
+ // there's nothing we can do. Fortunately Qt Quick always outputs
+ // premultiplied alpha so it is not a problem there.
+ d->layer.opaque = NO;
+ } else {
+ d->layer.opaque = YES;
+ }
+
+ // Now set the layer's drawableSize which will stay set to the same value
+ // until the next buildOrResize(), thus ensuring atomicity with regards to
+ // the drawable size in frames.
+ CGSize layerSize = d->layer.bounds.size;
+ layerSize.width *= d->layer.contentsScale;
+ layerSize.height *= d->layer.contentsScale;
+ d->layer.drawableSize = layerSize;
+
+ m_currentPixelSize = QSizeF::fromCGSize(layerSize).toSize();
+ pixelSize = m_currentPixelSize;
+
+ [d->layer setDevice: rhiD->d->dev];
+
+ d->curDrawable = nil;
+
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ if (!d->sem[i])
+ d->sem[i] = dispatch_semaphore_create(QMTL_FRAMES_IN_FLIGHT - 1);
+ }
+
+ currentFrameSlot = 0;
+ frameCount = 0;
+
+ ds = m_depthStencil ? QRHI_RES(QMetalRenderBuffer, m_depthStencil) : nullptr;
+ if (m_depthStencil && m_depthStencil->sampleCount() != m_sampleCount) {
+ qWarning("Depth-stencil buffer's sampleCount (%d) does not match color buffers' sample count (%d). Expect problems.",
+ m_depthStencil->sampleCount(), m_sampleCount);
+ }
+ if (m_depthStencil && m_depthStencil->pixelSize() != pixelSize) {
+ if (m_depthStencil->flags().testFlag(QRhiRenderBuffer::UsedWithSwapChainOnly)) {
+ m_depthStencil->setPixelSize(pixelSize);
+ if (!m_depthStencil->build())
+ qWarning("Failed to rebuild swapchain's associated depth-stencil buffer for size %dx%d",
+ pixelSize.width(), pixelSize.height());
+ } else {
+ qWarning("Depth-stencil buffer's size (%dx%d) does not match the layer size (%dx%d). Expect problems.",
+ m_depthStencil->pixelSize().width(), m_depthStencil->pixelSize().height(),
+ pixelSize.width(), pixelSize.height());
+ }
+ }
+
+ rtWrapper.d->pixelSize = pixelSize;
+ rtWrapper.d->dpr = float(window->devicePixelRatio());
+ rtWrapper.d->sampleCount = samples;
+ rtWrapper.d->colorAttCount = 1;
+ rtWrapper.d->dsAttCount = ds ? 1 : 0;
+
+ qCDebug(QRHI_LOG_INFO, "got CAMetalLayer, size %dx%d", pixelSize.width(), pixelSize.height());
+
+ if (samples > 1) {
+ MTLTextureDescriptor *desc = [[MTLTextureDescriptor alloc] init];
+ desc.textureType = MTLTextureType2DMultisample;
+ desc.pixelFormat = d->colorFormat;
+ desc.width = NSUInteger(pixelSize.width());
+ desc.height = NSUInteger(pixelSize.height());
+ desc.sampleCount = NSUInteger(samples);
+ desc.resourceOptions = MTLResourceStorageModePrivate;
+ desc.storageMode = MTLStorageModePrivate;
+ desc.usage = MTLTextureUsageRenderTarget;
+ for (int i = 0; i < QMTL_FRAMES_IN_FLIGHT; ++i) {
+ [d->msaaTex[i] release];
+ d->msaaTex[i] = [rhiD->d->dev newTextureWithDescriptor: desc];
+ }
+ [desc release];
+ }
+
+ QRHI_PROF;
+ QRHI_PROF_F(resizeSwapChain(this, QMTL_FRAMES_IN_FLIGHT, samples > 1 ? QMTL_FRAMES_IN_FLIGHT : 0, samples));
+
+ if (needsRegistration)
+ rhiD->registerResource(this);
+
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhimetal_p.h b/src/gui/rhi/qrhimetal_p.h
new file mode 100644
index 0000000000..094801c58c
--- /dev/null
+++ b/src/gui/rhi/qrhimetal_p.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIMETAL_H
+#define QRHIMETAL_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/qrhi_p.h>
+
+// no Metal includes here, the user code may be plain C++
+
+QT_BEGIN_NAMESPACE
+
+struct Q_GUI_EXPORT QRhiMetalInitParams : public QRhiInitParams
+{
+};
+
+struct Q_GUI_EXPORT QRhiMetalNativeHandles : public QRhiNativeHandles
+{
+ void *dev = nullptr; // id<MTLDevice>
+ void *cmdQueue = nullptr; // id<MTLCommandQueue>
+};
+
+struct Q_GUI_EXPORT QRhiMetalTextureNativeHandles : public QRhiNativeHandles
+{
+ void *texture = nullptr; // id<MTLTexture>
+};
+
+struct Q_GUI_EXPORT QRhiMetalCommandBufferNativeHandles : public QRhiNativeHandles
+{
+ void *commandBuffer = nullptr; // id<MTLCommandBuffer>
+ void *encoder = nullptr; // id<MTLRenderCommandEncoder>
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhimetal_p_p.h b/src/gui/rhi/qrhimetal_p_p.h
new file mode 100644
index 0000000000..2be86db5c8
--- /dev/null
+++ b/src/gui/rhi/qrhimetal_p_p.h
@@ -0,0 +1,460 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIMETAL_P_H
+#define QRHIMETAL_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 "qrhimetal_p.h"
+#include "qrhi_p_p.h"
+#include <QWindow>
+
+QT_BEGIN_NAMESPACE
+
+static const int QMTL_FRAMES_IN_FLIGHT = 2;
+
+// have to hide the ObjC stuff, this header cannot contain MTL* at all
+struct QMetalBufferData;
+
+struct QMetalBuffer : public QRhiBuffer
+{
+ QMetalBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
+ ~QMetalBuffer();
+ void release() override;
+ bool build() override;
+
+ QMetalBufferData *d;
+ uint generation = 0;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiMetal;
+ friend struct QMetalShaderResourceBindings;
+};
+
+struct QMetalRenderBufferData;
+
+struct QMetalRenderBuffer : public QRhiRenderBuffer
+{
+ QMetalRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags);
+ ~QMetalRenderBuffer();
+ void release() override;
+ bool build() override;
+ QRhiTexture::Format backingFormat() const override;
+
+ QMetalRenderBufferData *d;
+ int samples = 1;
+ uint generation = 0;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiMetal;
+};
+
+struct QMetalTextureData;
+
+struct QMetalTexture : public QRhiTexture
+{
+ QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags);
+ ~QMetalTexture();
+ void release() override;
+ bool build() override;
+ bool buildFrom(const QRhiNativeHandles *src) override;
+ const QRhiNativeHandles *nativeHandles() override;
+
+ bool prepareBuild(QSize *adjustedSize = nullptr);
+
+ QMetalTextureData *d;
+ QRhiMetalTextureNativeHandles nativeHandlesStruct;
+ int mipLevelCount = 0;
+ int samples = 1;
+ uint generation = 0;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiMetal;
+ friend struct QMetalShaderResourceBindings;
+ friend struct QMetalTextureData;
+};
+
+struct QMetalSamplerData;
+
+struct QMetalSampler : public QRhiSampler
+{
+ QMetalSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v);
+ ~QMetalSampler();
+ void release() override;
+ bool build() override;
+
+ QMetalSamplerData *d;
+ uint generation = 0;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiMetal;
+ friend struct QMetalShaderResourceBindings;
+};
+
+struct QMetalRenderPassDescriptor : public QRhiRenderPassDescriptor
+{
+ QMetalRenderPassDescriptor(QRhiImplementation *rhi);
+ ~QMetalRenderPassDescriptor();
+ void release() override;
+
+ // there is no MTLRenderPassDescriptor here as one will be created for each pass in beginPass()
+
+ // but the things needed for the render pipeline descriptor have to be provided
+ static const int MAX_COLOR_ATTACHMENTS = 8;
+ int colorAttachmentCount = 0;
+ bool hasDepthStencil = false;
+ int colorFormat[MAX_COLOR_ATTACHMENTS];
+ int dsFormat;
+};
+
+struct QMetalRenderTargetData;
+
+struct QMetalReferenceRenderTarget : public QRhiRenderTarget
+{
+ QMetalReferenceRenderTarget(QRhiImplementation *rhi);
+ ~QMetalReferenceRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QMetalRenderTargetData *d;
+};
+
+struct QMetalTextureRenderTarget : public QRhiTextureRenderTarget
+{
+ QMetalTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
+ ~QMetalTextureRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool build() override;
+
+ QMetalRenderTargetData *d;
+ friend class QRhiMetal;
+};
+
+struct QMetalShaderResourceBindings : public QRhiShaderResourceBindings
+{
+ QMetalShaderResourceBindings(QRhiImplementation *rhi);
+ ~QMetalShaderResourceBindings();
+ void release() override;
+ bool build() override;
+
+ QVarLengthArray<QRhiShaderResourceBinding, 8> sortedBindings;
+ int maxBinding = -1;
+
+ struct BoundUniformBufferData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundSampledTextureData {
+ quint64 texId;
+ uint texGeneration;
+ quint64 samplerId;
+ uint samplerGeneration;
+ };
+ struct BoundStorageImageData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundStorageBufferData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundResourceData {
+ union {
+ BoundUniformBufferData ubuf;
+ BoundSampledTextureData stex;
+ BoundStorageImageData simage;
+ BoundStorageBufferData sbuf;
+ };
+ };
+ QVarLengthArray<BoundResourceData, 8> boundResourceData;
+
+ uint generation = 0;
+ friend class QRhiMetal;
+};
+
+struct QMetalGraphicsPipelineData;
+
+struct QMetalGraphicsPipeline : public QRhiGraphicsPipeline
+{
+ QMetalGraphicsPipeline(QRhiImplementation *rhi);
+ ~QMetalGraphicsPipeline();
+ void release() override;
+ bool build() override;
+
+ QMetalGraphicsPipelineData *d;
+ uint generation = 0;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiMetal;
+};
+
+struct QMetalComputePipelineData;
+
+struct QMetalComputePipeline : public QRhiComputePipeline
+{
+ QMetalComputePipeline(QRhiImplementation *rhi);
+ ~QMetalComputePipeline();
+ void release() override;
+ bool build() override;
+
+ QMetalComputePipelineData *d;
+ uint generation = 0;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiMetal;
+};
+
+struct QMetalCommandBufferData;
+struct QMetalSwapChain;
+
+struct QMetalCommandBuffer : public QRhiCommandBuffer
+{
+ QMetalCommandBuffer(QRhiImplementation *rhi);
+ ~QMetalCommandBuffer();
+ void release() override;
+
+ QMetalCommandBufferData *d = nullptr;
+ QRhiMetalCommandBufferNativeHandles nativeHandlesStruct;
+
+ enum PassType {
+ NoPass,
+ RenderPass,
+ ComputePass
+ };
+
+ // per-pass (render or compute command encoder) persistent state
+ PassType recordingPass;
+ QRhiRenderTarget *currentTarget;
+
+ // per-pass (render or compute command encoder) volatile (cached) state
+ QRhiGraphicsPipeline *currentGraphicsPipeline;
+ QRhiComputePipeline *currentComputePipeline;
+ uint currentPipelineGeneration;
+ QRhiShaderResourceBindings *currentGraphicsSrb;
+ QRhiShaderResourceBindings *currentComputeSrb;
+ uint currentSrbGeneration;
+ int currentResSlot;
+ QRhiBuffer *currentIndexBuffer;
+ quint32 currentIndexOffset;
+ QRhiCommandBuffer::IndexFormat currentIndexFormat;
+ int currentCullMode;
+ int currentFrontFaceWinding;
+
+ const QRhiNativeHandles *nativeHandles();
+ void resetState();
+ void resetPerPassState();
+ void resetPerPassCachedState();
+};
+
+struct QMetalSwapChainData;
+
+struct QMetalSwapChain : public QRhiSwapChain
+{
+ QMetalSwapChain(QRhiImplementation *rhi);
+ ~QMetalSwapChain();
+ void release() override;
+
+ QRhiCommandBuffer *currentFrameCommandBuffer() override;
+ QRhiRenderTarget *currentFrameRenderTarget() override;
+ QSize surfacePixelSize() override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+
+ bool buildOrResize() override;
+
+ void chooseFormats();
+
+ QWindow *window = nullptr;
+ QSize pixelSize;
+ int currentFrameSlot = 0; // 0..QMTL_FRAMES_IN_FLIGHT-1
+ int frameCount = 0;
+ int samples = 1;
+ QMetalReferenceRenderTarget rtWrapper;
+ QMetalCommandBuffer cbWrapper;
+ QMetalRenderBuffer *ds = nullptr;
+ QMetalSwapChainData *d = nullptr;
+};
+
+struct QRhiMetalData;
+
+class QRhiMetal : public QRhiImplementation
+{
+public:
+ QRhiMetal(QRhiMetalInitParams *params, QRhiMetalNativeHandles *importDevice = nullptr);
+ ~QRhiMetal();
+
+ bool create(QRhi::Flags flags) override;
+ void destroy() override;
+
+ QRhiGraphicsPipeline *createGraphicsPipeline() override;
+ QRhiComputePipeline *createComputePipeline() override;
+ QRhiShaderResourceBindings *createShaderResourceBindings() override;
+ QRhiBuffer *createBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size) override;
+ QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags) override;
+ QRhiTexture *createTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags) override;
+ QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v) override;
+
+ QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags) override;
+
+ QRhiSwapChain *createSwapChain() override;
+ QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult finish() override;
+
+ void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void setGraphicsPipeline(QRhiCommandBuffer *cb,
+ QRhiGraphicsPipeline *ps) override;
+
+ void setShaderResources(QRhiCommandBuffer *cb,
+ QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
+
+ void setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ QRhiCommandBuffer::IndexFormat indexFormat) override;
+
+ void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
+ void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
+ void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
+ void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
+
+ void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
+
+ void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex,
+ qint32 vertexOffset, quint32 firstInstance) override;
+
+ void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
+ void debugMarkEnd(QRhiCommandBuffer *cb) override;
+ void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
+
+ void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
+ void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
+
+ const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
+ void beginExternal(QRhiCommandBuffer *cb) override;
+ void endExternal(QRhiCommandBuffer *cb) override;
+
+ QVector<int> supportedSampleCounts() const override;
+ int ubufAlignment() const override;
+ bool isYUpInFramebuffer() const override;
+ bool isYUpInNDC() const override;
+ bool isClipDepthZeroToOne() const override;
+ QMatrix4x4 clipSpaceCorrMatrix() const override;
+ bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
+ bool isFeatureSupported(QRhi::Feature feature) const override;
+ int resourceLimit(QRhi::ResourceLimit limit) const override;
+ const QRhiNativeHandles *nativeHandles() override;
+ void sendVMemStatsToProfiler() override;
+ bool makeThreadLocalNativeContextCurrent() override;
+ void releaseCachedResources() override;
+ bool isDeviceLost() const override;
+
+ void executeDeferredReleases(bool forced = false);
+ void finishActiveReadbacks(bool forced = false);
+ qsizetype subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
+ void enqueueSubresUpload(QMetalTexture *texD, void *mp, void *blitEncPtr,
+ int layer, int level, const QRhiTextureSubresourceUploadDescription &subresDesc,
+ qsizetype *curOfs);
+ void enqueueResourceUpdates(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates);
+ void executeBufferHostWritesForCurrentFrame(QMetalBuffer *bufD);
+ static const int SUPPORTED_STAGES = 3;
+ void enqueueShaderResourceBindings(QMetalShaderResourceBindings *srbD,
+ QMetalCommandBuffer *cbD,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets,
+ bool offsetOnlyChange,
+ const QShader::NativeResourceBindingMap *nativeResourceBindingMaps[SUPPORTED_STAGES]);
+ int effectiveSampleCount(int sampleCount) const;
+
+ bool importedDevice = false;
+ bool importedCmdQueue = false;
+ QMetalSwapChain *currentSwapChain = nullptr;
+ QSet<QMetalSwapChain *> swapchains;
+ QRhiMetalNativeHandles nativeHandlesStruct;
+
+ struct {
+ int maxTextureSize = 4096;
+ } caps;
+
+ QRhiMetalData *d = nullptr;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhinull.cpp b/src/gui/rhi/qrhinull.cpp
new file mode 100644
index 0000000000..fe606f971f
--- /dev/null
+++ b/src/gui/rhi/qrhinull.cpp
@@ -0,0 +1,900 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhinull_p_p.h"
+#include <qmath.h>
+#include <QPainter>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QRhiNullInitParams
+ \internal
+ \inmodule QtGui
+ \brief Null backend specific initialization parameters.
+
+ A Null QRhi needs no special parameters for initialization.
+
+ \badcode
+ QRhiNullInitParams params;
+ rhi = QRhi::create(QRhi::Null, &params);
+ \endcode
+
+ The Null backend does not issue any graphics calls and creates no
+ resources. All QRhi operations will succeed as normal so applications can
+ still be run, albeit potentially at an unthrottled speed, depending on
+ their frame rendering strategy. The backend reports resources to
+ QRhiProfiler as usual.
+ */
+
+/*!
+ \class QRhiNullNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Empty.
+ */
+
+/*!
+ \class QRhiNullTextureNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Empty.
+ */
+
+QRhiNull::QRhiNull(QRhiNullInitParams *params)
+ : offscreenCommandBuffer(this)
+{
+ Q_UNUSED(params);
+}
+
+bool QRhiNull::create(QRhi::Flags flags)
+{
+ Q_UNUSED(flags);
+ return true;
+}
+
+void QRhiNull::destroy()
+{
+}
+
+QVector<int> QRhiNull::supportedSampleCounts() const
+{
+ return { 1 };
+}
+
+QRhiSwapChain *QRhiNull::createSwapChain()
+{
+ return new QNullSwapChain(this);
+}
+
+QRhiBuffer *QRhiNull::createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
+{
+ return new QNullBuffer(this, type, usage, size);
+}
+
+int QRhiNull::ubufAlignment() const
+{
+ return 256;
+}
+
+bool QRhiNull::isYUpInFramebuffer() const
+{
+ return false;
+}
+
+bool QRhiNull::isYUpInNDC() const
+{
+ return true;
+}
+
+bool QRhiNull::isClipDepthZeroToOne() const
+{
+ return true;
+}
+
+QMatrix4x4 QRhiNull::clipSpaceCorrMatrix() const
+{
+ return QMatrix4x4(); // identity
+}
+
+bool QRhiNull::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const
+{
+ Q_UNUSED(format);
+ Q_UNUSED(flags);
+ return true;
+}
+
+bool QRhiNull::isFeatureSupported(QRhi::Feature feature) const
+{
+ Q_UNUSED(feature);
+ return true;
+}
+
+int QRhiNull::resourceLimit(QRhi::ResourceLimit limit) const
+{
+ switch (limit) {
+ case QRhi::TextureSizeMin:
+ return 1;
+ case QRhi::TextureSizeMax:
+ return 16384;
+ case QRhi::MaxColorAttachments:
+ return 8;
+ case QRhi::FramesInFlight:
+ return 2; // dummy
+ default:
+ Q_UNREACHABLE();
+ return 0;
+ }
+}
+
+const QRhiNativeHandles *QRhiNull::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+void QRhiNull::sendVMemStatsToProfiler()
+{
+ // nothing to do here
+}
+
+bool QRhiNull::makeThreadLocalNativeContextCurrent()
+{
+ // not applicable
+ return false;
+}
+
+void QRhiNull::releaseCachedResources()
+{
+ // nothing to do here
+}
+
+bool QRhiNull::isDeviceLost() const
+{
+ return false;
+}
+
+QRhiRenderBuffer *QRhiNull::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+{
+ return new QNullRenderBuffer(this, type, pixelSize, sampleCount, flags);
+}
+
+QRhiTexture *QRhiNull::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
+ int sampleCount, QRhiTexture::Flags flags)
+{
+ return new QNullTexture(this, format, pixelSize, sampleCount, flags);
+}
+
+QRhiSampler *QRhiNull::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler::AddressMode u, QRhiSampler::AddressMode v)
+{
+ return new QNullSampler(this, magFilter, minFilter, mipmapMode, u, v);
+}
+
+QRhiTextureRenderTarget *QRhiNull::createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags)
+{
+ return new QNullTextureRenderTarget(this, desc, flags);
+}
+
+QRhiGraphicsPipeline *QRhiNull::createGraphicsPipeline()
+{
+ return new QNullGraphicsPipeline(this);
+}
+
+QRhiComputePipeline *QRhiNull::createComputePipeline()
+{
+ return new QNullComputePipeline(this);
+}
+
+QRhiShaderResourceBindings *QRhiNull::createShaderResourceBindings()
+{
+ return new QNullShaderResourceBindings(this);
+}
+
+void QRhiNull::setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(ps);
+}
+
+void QRhiNull::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(srb);
+ Q_UNUSED(dynamicOffsetCount);
+ Q_UNUSED(dynamicOffsets);
+}
+
+void QRhiNull::setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(startBinding);
+ Q_UNUSED(bindingCount);
+ Q_UNUSED(bindings);
+ Q_UNUSED(indexBuf);
+ Q_UNUSED(indexOffset);
+ Q_UNUSED(indexFormat);
+}
+
+void QRhiNull::setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(viewport);
+}
+
+void QRhiNull::setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(scissor);
+}
+
+void QRhiNull::setBlendConstants(QRhiCommandBuffer *cb, const QColor &c)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(c);
+}
+
+void QRhiNull::setStencilRef(QRhiCommandBuffer *cb, quint32 refValue)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(refValue);
+}
+
+void QRhiNull::draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(vertexCount);
+ Q_UNUSED(instanceCount);
+ Q_UNUSED(firstVertex);
+ Q_UNUSED(firstInstance);
+}
+
+void QRhiNull::drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(indexCount);
+ Q_UNUSED(instanceCount);
+ Q_UNUSED(firstIndex);
+ Q_UNUSED(vertexOffset);
+ Q_UNUSED(firstInstance);
+}
+
+void QRhiNull::debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(name);
+}
+
+void QRhiNull::debugMarkEnd(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+}
+
+void QRhiNull::debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(msg);
+}
+
+void QRhiNull::setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(ps);
+}
+
+void QRhiNull::dispatch(QRhiCommandBuffer *cb, int x, int y, int z)
+{
+ Q_UNUSED(cb);
+ Q_UNUSED(x);
+ Q_UNUSED(y);
+ Q_UNUSED(z);
+}
+
+const QRhiNativeHandles *QRhiNull::nativeHandles(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+ return nullptr;
+}
+
+void QRhiNull::beginExternal(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+}
+
+void QRhiNull::endExternal(QRhiCommandBuffer *cb)
+{
+ Q_UNUSED(cb);
+}
+
+QRhi::FrameOpResult QRhiNull::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ currentSwapChain = swapChain;
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ QRHI_PROF_F(beginSwapChainFrame(swapChain));
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiNull::endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ QNullSwapChain *swapChainD = QRHI_RES(QNullSwapChain, swapChain);
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ QRHI_PROF_F(endSwapChainFrame(swapChain, swapChainD->frameCount + 1));
+ QRHI_PROF_F(swapChainFrameGpuTime(swapChain, 0.000666f));
+ swapChainD->frameCount += 1;
+ currentSwapChain = nullptr;
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiNull::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ *cb = &offscreenCommandBuffer;
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiNull::endOffscreenFrame(QRhi::EndFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiNull::finish()
+{
+ return QRhi::FrameOpSuccess;
+}
+
+void QRhiNull::simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
+{
+ QNullTexture *texD = QRHI_RES(QNullTexture, u.dst);
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level])) {
+ if (!subresDesc.image().isNull()) {
+ const QImage src = subresDesc.image();
+ QPainter painter(&texD->image[layer][level]);
+ const QSize srcSize = subresDesc.sourceSize().isEmpty()
+ ? src.size() : subresDesc.sourceSize();
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.drawImage(subresDesc.destinationTopLeft(), src,
+ QRect(subresDesc.sourceTopLeft(), srcSize));
+ } else if (!subresDesc.data().isEmpty()) {
+ const QSize subresSize = q->sizeForMipLevel(level, texD->pixelSize());
+ int w = subresSize.width();
+ int h = subresSize.height();
+ if (!subresDesc.sourceSize().isEmpty()) {
+ w = subresDesc.sourceSize().width();
+ h = subresDesc.sourceSize().height();
+ }
+ // sourceTopLeft is not supported on this path as per QRhi docs
+ const char *src = subresDesc.data().constData();
+ const int srcBpl = w * 4;
+ const QPoint dstOffset = subresDesc.destinationTopLeft();
+ uchar *dst = texD->image[layer][level].bits();
+ const int dstBpl = texD->image[layer][level].bytesPerLine();
+ for (int y = 0; y < h; ++y) {
+ memcpy(dst + dstOffset.x() * 4 + (y + dstOffset.y()) * dstBpl,
+ src + y * srcBpl,
+ size_t(srcBpl));
+ }
+ }
+ }
+ }
+ }
+}
+
+void QRhiNull::simulateTextureCopy(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
+{
+ QNullTexture *srcD = QRHI_RES(QNullTexture, u.src);
+ QNullTexture *dstD = QRHI_RES(QNullTexture, u.dst);
+ const QImage &srcImage(srcD->image[u.desc.sourceLayer()][u.desc.sourceLevel()]);
+ QImage &dstImage(dstD->image[u.desc.destinationLayer()][u.desc.destinationLevel()]);
+ const QPoint dstPos = u.desc.destinationTopLeft();
+ const QSize size = u.desc.pixelSize().isEmpty() ? srcD->pixelSize() : u.desc.pixelSize();
+ const QPoint srcPos = u.desc.sourceTopLeft();
+
+ QPainter painter(&dstImage);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.drawImage(QRect(dstPos, size), srcImage, QRect(srcPos, size));
+}
+
+void QRhiNull::simulateTextureGenMips(const QRhiResourceUpdateBatchPrivate::TextureOp &u)
+{
+ QNullTexture *texD = QRHI_RES(QNullTexture, u.dst);
+ const QSize baseSize = texD->pixelSize();
+ const int levelCount = q->mipLevelsForSize(baseSize);
+ for (int level = 1; level < levelCount; ++level)
+ texD->image[0][level] = texD->image[0][0].scaled(q->sizeForMipLevel(level, baseSize));
+}
+
+void QRhiNull::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ Q_UNUSED(cb);
+ QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates);
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : ud->bufferOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate
+ || u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload)
+ {
+ QNullBuffer *bufD = QRHI_RES(QNullBuffer, u.buf);
+ memcpy(bufD->data.data() + u.offset, u.data.constData(), size_t(u.data.size()));
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::Read) {
+ QRhiBufferReadbackResult *result = u.result;
+ result->data.resize(u.readSize);
+ QNullBuffer *bufD = QRHI_RES(QNullBuffer, u.buf);
+ memcpy(result->data.data(), bufD->data.constData() + u.offset, size_t(u.readSize));
+ if (result->completed)
+ result->completed();
+ }
+ }
+ for (const QRhiResourceUpdateBatchPrivate::TextureOp &u : ud->textureOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Upload) {
+ if (u.dst->format() == QRhiTexture::RGBA8)
+ simulateTextureUpload(u);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Copy) {
+ if (u.src->format() == QRhiTexture::RGBA8 && u.dst->format() == QRhiTexture::RGBA8)
+ simulateTextureCopy(u);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Read) {
+ QRhiReadbackResult *result = u.result;
+ QNullTexture *texD = QRHI_RES(QNullTexture, u.rb.texture());
+ if (texD) {
+ result->format = texD->format();
+ result->pixelSize = q->sizeForMipLevel(u.rb.level(), texD->pixelSize());
+ } else {
+ Q_ASSERT(currentSwapChain);
+ result->format = QRhiTexture::RGBA8;
+ result->pixelSize = currentSwapChain->currentPixelSize();
+ }
+ quint32 bytesPerLine = 0;
+ quint32 byteSize = 0;
+ textureFormatInfo(result->format, result->pixelSize, &bytesPerLine, &byteSize);
+ if (texD && texD->format() == QRhiTexture::RGBA8) {
+ result->data.resize(int(byteSize));
+ const QImage &src(texD->image[u.rb.layer()][u.rb.level()]);
+ char *dst = result->data.data();
+ for (int y = 0, h = src.height(); y < h; ++y) {
+ memcpy(dst, src.constScanLine(y), bytesPerLine);
+ dst += bytesPerLine;
+ }
+ } else {
+ result->data.fill(0, int(byteSize));
+ }
+ if (result->completed)
+ result->completed();
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::GenMips) {
+ if (u.dst->format() == QRhiTexture::RGBA8)
+ simulateTextureGenMips(u);
+ }
+ }
+ ud->free();
+}
+
+void QRhiNull::beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates)
+{
+ Q_UNUSED(rt);
+ Q_UNUSED(colorClearValue);
+ Q_UNUSED(depthStencilClearValue);
+ if (resourceUpdates)
+ resourceUpdate(cb, resourceUpdates);
+}
+
+void QRhiNull::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (resourceUpdates)
+ resourceUpdate(cb, resourceUpdates);
+}
+
+void QRhiNull::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (resourceUpdates)
+ resourceUpdate(cb, resourceUpdates);
+}
+
+void QRhiNull::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (resourceUpdates)
+ resourceUpdate(cb, resourceUpdates);
+}
+
+QNullBuffer::QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size)
+ : QRhiBuffer(rhi, type, usage, size)
+{
+}
+
+QNullBuffer::~QNullBuffer()
+{
+ release();
+}
+
+void QNullBuffer::release()
+{
+ data.clear();
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseBuffer(this));
+}
+
+bool QNullBuffer::build()
+{
+ data.fill('\0', m_size);
+
+ QRHI_PROF;
+ QRHI_PROF_F(newBuffer(this, uint(m_size), 1, 0));
+ return true;
+}
+
+QNullRenderBuffer::QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+ : QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
+{
+}
+
+QNullRenderBuffer::~QNullRenderBuffer()
+{
+ release();
+}
+
+void QNullRenderBuffer::release()
+{
+ QRHI_PROF;
+ QRHI_PROF_F(releaseRenderBuffer(this));
+}
+
+bool QNullRenderBuffer::build()
+{
+ QRHI_PROF;
+ QRHI_PROF_F(newRenderBuffer(this, false, false, 1));
+ return true;
+}
+
+QRhiTexture::Format QNullRenderBuffer::backingFormat() const
+{
+ return m_type == Color ? QRhiTexture::RGBA8 : QRhiTexture::UnknownFormat;
+}
+
+QNullTexture::QNullTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags)
+ : QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
+{
+}
+
+QNullTexture::~QNullTexture()
+{
+ release();
+}
+
+void QNullTexture::release()
+{
+ QRHI_PROF;
+ QRHI_PROF_F(releaseTexture(this));
+}
+
+bool QNullTexture::build()
+{
+ QRHI_RES_RHI(QRhiNull);
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+ QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+ const int mipLevelCount = hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1;
+ const int layerCount = isCube ? 6 : 1;
+
+ if (m_format == RGBA8) {
+ for (int layer = 0; layer < layerCount; ++layer) {
+ for (int level = 0; level < mipLevelCount; ++level) {
+ image[layer][level] = QImage(rhiD->q->sizeForMipLevel(level, size),
+ QImage::Format_RGBA8888_Premultiplied);
+ image[layer][level].fill(Qt::yellow);
+ }
+ }
+ }
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, true, mipLevelCount, layerCount, 1));
+ return true;
+}
+
+bool QNullTexture::buildFrom(const QRhiNativeHandles *src)
+{
+ Q_UNUSED(src);
+ QRHI_RES_RHI(QRhiNull);
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+ QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+ const int mipLevelCount = hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1;
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, false, mipLevelCount, isCube ? 6 : 1, 1));
+ return true;
+}
+
+const QRhiNativeHandles *QNullTexture::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+QNullSampler::QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v)
+ : QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u, v)
+{
+}
+
+QNullSampler::~QNullSampler()
+{
+ release();
+}
+
+void QNullSampler::release()
+{
+}
+
+bool QNullSampler::build()
+{
+ return true;
+}
+
+QNullRenderPassDescriptor::QNullRenderPassDescriptor(QRhiImplementation *rhi)
+ : QRhiRenderPassDescriptor(rhi)
+{
+}
+
+QNullRenderPassDescriptor::~QNullRenderPassDescriptor()
+{
+ release();
+}
+
+void QNullRenderPassDescriptor::release()
+{
+}
+
+QNullReferenceRenderTarget::QNullReferenceRenderTarget(QRhiImplementation *rhi)
+ : QRhiRenderTarget(rhi),
+ d(rhi)
+{
+}
+
+QNullReferenceRenderTarget::~QNullReferenceRenderTarget()
+{
+ release();
+}
+
+void QNullReferenceRenderTarget::release()
+{
+}
+
+QSize QNullReferenceRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QNullReferenceRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QNullReferenceRenderTarget::sampleCount() const
+{
+ return 1;
+}
+
+QNullTextureRenderTarget::QNullTextureRenderTarget(QRhiImplementation *rhi,
+ const QRhiTextureRenderTargetDescription &desc,
+ Flags flags)
+ : QRhiTextureRenderTarget(rhi, desc, flags),
+ d(rhi)
+{
+}
+
+QNullTextureRenderTarget::~QNullTextureRenderTarget()
+{
+ release();
+}
+
+void QNullTextureRenderTarget::release()
+{
+}
+
+QRhiRenderPassDescriptor *QNullTextureRenderTarget::newCompatibleRenderPassDescriptor()
+{
+ return new QNullRenderPassDescriptor(m_rhi);
+}
+
+bool QNullTextureRenderTarget::build()
+{
+ d.rp = QRHI_RES(QNullRenderPassDescriptor, m_renderPassDesc);
+ if (m_desc.cbeginColorAttachments() != m_desc.cendColorAttachments()) {
+ QRhiTexture *tex = m_desc.cbeginColorAttachments()->texture();
+ QRhiRenderBuffer *rb = m_desc.cbeginColorAttachments()->renderBuffer();
+ d.pixelSize = tex ? tex->pixelSize() : rb->pixelSize();
+ } else if (m_desc.depthStencilBuffer()) {
+ d.pixelSize = m_desc.depthStencilBuffer()->pixelSize();
+ } else if (m_desc.depthTexture()) {
+ d.pixelSize = m_desc.depthTexture()->pixelSize();
+ }
+ return true;
+}
+
+QSize QNullTextureRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QNullTextureRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QNullTextureRenderTarget::sampleCount() const
+{
+ return 1;
+}
+
+QNullShaderResourceBindings::QNullShaderResourceBindings(QRhiImplementation *rhi)
+ : QRhiShaderResourceBindings(rhi)
+{
+}
+
+QNullShaderResourceBindings::~QNullShaderResourceBindings()
+{
+ release();
+}
+
+void QNullShaderResourceBindings::release()
+{
+}
+
+bool QNullShaderResourceBindings::build()
+{
+ return true;
+}
+
+QNullGraphicsPipeline::QNullGraphicsPipeline(QRhiImplementation *rhi)
+ : QRhiGraphicsPipeline(rhi)
+{
+}
+
+QNullGraphicsPipeline::~QNullGraphicsPipeline()
+{
+ release();
+}
+
+void QNullGraphicsPipeline::release()
+{
+}
+
+bool QNullGraphicsPipeline::build()
+{
+ QRHI_RES_RHI(QRhiNull);
+ if (!rhiD->sanityCheckGraphicsPipeline(this))
+ return false;
+
+ return true;
+}
+
+QNullComputePipeline::QNullComputePipeline(QRhiImplementation *rhi)
+ : QRhiComputePipeline(rhi)
+{
+}
+
+QNullComputePipeline::~QNullComputePipeline()
+{
+ release();
+}
+
+void QNullComputePipeline::release()
+{
+}
+
+bool QNullComputePipeline::build()
+{
+ return true;
+}
+
+QNullCommandBuffer::QNullCommandBuffer(QRhiImplementation *rhi)
+ : QRhiCommandBuffer(rhi)
+{
+}
+
+QNullCommandBuffer::~QNullCommandBuffer()
+{
+ release();
+}
+
+void QNullCommandBuffer::release()
+{
+ // nothing to do here
+}
+
+QNullSwapChain::QNullSwapChain(QRhiImplementation *rhi)
+ : QRhiSwapChain(rhi),
+ rt(rhi),
+ cb(rhi)
+{
+}
+
+QNullSwapChain::~QNullSwapChain()
+{
+ release();
+}
+
+void QNullSwapChain::release()
+{
+ QRHI_PROF;
+ QRHI_PROF_F(releaseSwapChain(this));
+}
+
+QRhiCommandBuffer *QNullSwapChain::currentFrameCommandBuffer()
+{
+ return &cb;
+}
+
+QRhiRenderTarget *QNullSwapChain::currentFrameRenderTarget()
+{
+ return &rt;
+}
+
+QSize QNullSwapChain::surfacePixelSize()
+{
+ return QSize(1280, 720);
+}
+
+QRhiRenderPassDescriptor *QNullSwapChain::newCompatibleRenderPassDescriptor()
+{
+ return new QNullRenderPassDescriptor(m_rhi);
+}
+
+bool QNullSwapChain::buildOrResize()
+{
+ m_currentPixelSize = surfacePixelSize();
+ rt.d.rp = QRHI_RES(QNullRenderPassDescriptor, m_renderPassDesc);
+ rt.d.pixelSize = m_currentPixelSize;
+ frameCount = 0;
+ QRHI_PROF;
+ QRHI_PROF_F(resizeSwapChain(this, 1, 0, 1));
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhinull_p.h b/src/gui/rhi/qrhinull_p.h
new file mode 100644
index 0000000000..7d3ce5dbf1
--- /dev/null
+++ b/src/gui/rhi/qrhinull_p.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHINULL_H
+#define QRHINULL_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/qrhi_p.h>
+
+QT_BEGIN_NAMESPACE
+
+struct Q_GUI_EXPORT QRhiNullInitParams : public QRhiInitParams
+{
+};
+
+struct Q_GUI_EXPORT QRhiNullNativeHandles : public QRhiNativeHandles
+{
+};
+
+struct Q_GUI_EXPORT QRhiNullTextureNativeHandles : public QRhiNativeHandles
+{
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhinull_p_p.h b/src/gui/rhi/qrhinull_p_p.h
new file mode 100644
index 0000000000..ce517bfa63
--- /dev/null
+++ b/src/gui/rhi/qrhinull_p_p.h
@@ -0,0 +1,303 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHINULL_P_H
+#define QRHINULL_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 "qrhinull_p.h"
+#include "qrhi_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+struct QNullBuffer : public QRhiBuffer
+{
+ QNullBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
+ ~QNullBuffer();
+ void release() override;
+ bool build() override;
+
+ QByteArray data;
+};
+
+struct QNullRenderBuffer : public QRhiRenderBuffer
+{
+ QNullRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags);
+ ~QNullRenderBuffer();
+ void release() override;
+ bool build() override;
+ QRhiTexture::Format backingFormat() const override;
+};
+
+struct QNullTexture : public QRhiTexture
+{
+ QNullTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags);
+ ~QNullTexture();
+ void release() override;
+ bool build() override;
+ bool buildFrom(const QRhiNativeHandles *src) override;
+ const QRhiNativeHandles *nativeHandles() override;
+
+ QRhiNullTextureNativeHandles nativeHandlesStruct;
+ QImage image[QRhi::MAX_LAYERS][QRhi::MAX_LEVELS];
+};
+
+struct QNullSampler : public QRhiSampler
+{
+ QNullSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v);
+ ~QNullSampler();
+ void release() override;
+ bool build() override;
+};
+
+struct QNullRenderPassDescriptor : public QRhiRenderPassDescriptor
+{
+ QNullRenderPassDescriptor(QRhiImplementation *rhi);
+ ~QNullRenderPassDescriptor();
+ void release() override;
+};
+
+struct QNullRenderTargetData
+{
+ QNullRenderTargetData(QRhiImplementation *) { }
+
+ QNullRenderPassDescriptor *rp = nullptr;
+ QSize pixelSize;
+ float dpr = 1;
+};
+
+struct QNullReferenceRenderTarget : public QRhiRenderTarget
+{
+ QNullReferenceRenderTarget(QRhiImplementation *rhi);
+ ~QNullReferenceRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QNullRenderTargetData d;
+};
+
+struct QNullTextureRenderTarget : public QRhiTextureRenderTarget
+{
+ QNullTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
+ ~QNullTextureRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool build() override;
+
+ QNullRenderTargetData d;
+};
+
+struct QNullShaderResourceBindings : public QRhiShaderResourceBindings
+{
+ QNullShaderResourceBindings(QRhiImplementation *rhi);
+ ~QNullShaderResourceBindings();
+ void release() override;
+ bool build() override;
+};
+
+struct QNullGraphicsPipeline : public QRhiGraphicsPipeline
+{
+ QNullGraphicsPipeline(QRhiImplementation *rhi);
+ ~QNullGraphicsPipeline();
+ void release() override;
+ bool build() override;
+};
+
+struct QNullComputePipeline : public QRhiComputePipeline
+{
+ QNullComputePipeline(QRhiImplementation *rhi);
+ ~QNullComputePipeline();
+ void release() override;
+ bool build() override;
+};
+
+struct QNullCommandBuffer : public QRhiCommandBuffer
+{
+ QNullCommandBuffer(QRhiImplementation *rhi);
+ ~QNullCommandBuffer();
+ void release() override;
+};
+
+struct QNullSwapChain : public QRhiSwapChain
+{
+ QNullSwapChain(QRhiImplementation *rhi);
+ ~QNullSwapChain();
+ void release() override;
+
+ QRhiCommandBuffer *currentFrameCommandBuffer() override;
+ QRhiRenderTarget *currentFrameRenderTarget() override;
+
+ QSize surfacePixelSize() override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool buildOrResize() override;
+
+ QNullReferenceRenderTarget rt;
+ QNullCommandBuffer cb;
+ int frameCount = 0;
+};
+
+class QRhiNull : public QRhiImplementation
+{
+public:
+ QRhiNull(QRhiNullInitParams *params);
+
+ bool create(QRhi::Flags flags) override;
+ void destroy() override;
+
+ QRhiGraphicsPipeline *createGraphicsPipeline() override;
+ QRhiComputePipeline *createComputePipeline() override;
+ QRhiShaderResourceBindings *createShaderResourceBindings() override;
+ QRhiBuffer *createBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size) override;
+ QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags) override;
+ QRhiTexture *createTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags) override;
+ QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v) override;
+
+ QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags) override;
+
+ QRhiSwapChain *createSwapChain() override;
+ QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult finish() override;
+
+ void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void setGraphicsPipeline(QRhiCommandBuffer *cb,
+ QRhiGraphicsPipeline *ps) override;
+
+ void setShaderResources(QRhiCommandBuffer *cb,
+ QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
+
+ void setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ QRhiCommandBuffer::IndexFormat indexFormat) override;
+
+ void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
+ void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
+ void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
+ void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
+
+ void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
+
+ void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex,
+ qint32 vertexOffset, quint32 firstInstance) override;
+
+ void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
+ void debugMarkEnd(QRhiCommandBuffer *cb) override;
+ void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
+
+ void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
+ void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
+
+ const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
+ void beginExternal(QRhiCommandBuffer *cb) override;
+ void endExternal(QRhiCommandBuffer *cb) override;
+
+ QVector<int> supportedSampleCounts() const override;
+ int ubufAlignment() const override;
+ bool isYUpInFramebuffer() const override;
+ bool isYUpInNDC() const override;
+ bool isClipDepthZeroToOne() const override;
+ QMatrix4x4 clipSpaceCorrMatrix() const override;
+ bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
+ bool isFeatureSupported(QRhi::Feature feature) const override;
+ int resourceLimit(QRhi::ResourceLimit limit) const override;
+ const QRhiNativeHandles *nativeHandles() override;
+ void sendVMemStatsToProfiler() override;
+ bool makeThreadLocalNativeContextCurrent() override;
+ void releaseCachedResources() override;
+ bool isDeviceLost() const override;
+
+ void simulateTextureUpload(const QRhiResourceUpdateBatchPrivate::TextureOp &u);
+ void simulateTextureCopy(const QRhiResourceUpdateBatchPrivate::TextureOp &u);
+ void simulateTextureGenMips(const QRhiResourceUpdateBatchPrivate::TextureOp &u);
+
+ QRhiNullNativeHandles nativeHandlesStruct;
+ QRhiSwapChain *currentSwapChain = nullptr;
+ QNullCommandBuffer offscreenCommandBuffer;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhiprofiler.cpp b/src/gui/rhi/qrhiprofiler.cpp
new file mode 100644
index 0000000000..1521c0f36e
--- /dev/null
+++ b/src/gui/rhi/qrhiprofiler.cpp
@@ -0,0 +1,606 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhiprofiler_p_p.h"
+#include "qrhi_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QRhiProfiler
+ \internal
+ \inmodule QtGui
+
+ \brief Collects resource and timing information from an active QRhi.
+
+ A QRhiProfiler is present for each QRhi. Query it via QRhi::profiler(). The
+ profiler is active only when the QRhi was created with
+ QRhi::EnableProfiling. No data is collected otherwise.
+
+ \note GPU timings are only available when QRhi indicates that
+ QRhi::Timestamps is supported.
+
+ Besides collecting data from the QRhi implementations, some additional
+ values are calculated. For example, for textures and similar resources the
+ profiler gives an estimate of the complete amount of memory the resource
+ needs.
+
+ \section2 Output Format
+
+ The output is comma-separated text. Each line has a number of
+ comma-separated entries and each line ends with a comma.
+
+ For example:
+
+ \badcode
+ 1,0,140446057946208,Triangle vbuf,type,0,usage,1,logical_size,84,effective_size,84,backing_gpu_buf_count,1,backing_cpu_buf_count,0,
+ 1,0,140446057947376,Triangle ubuf,type,2,usage,4,logical_size,68,effective_size,256,backing_gpu_buf_count,2,backing_cpu_buf_count,0,
+ 1,1,140446057950416,,type,0,usage,1,logical_size,112,effective_size,112,backing_gpu_buf_count,1,backing_cpu_buf_count,0,
+ 1,1,140446057950544,,type,0,usage,2,logical_size,12,effective_size,12,backing_gpu_buf_count,1,backing_cpu_buf_count,0,
+ 1,1,140446057947440,,type,2,usage,4,logical_size,68,effective_size,256,backing_gpu_buf_count,2,backing_cpu_buf_count,0,
+ 1,1,140446057984784,Cube vbuf (textured),type,0,usage,1,logical_size,720,effective_size,720,backing_gpu_buf_count,1,backing_cpu_buf_count,0,
+ 1,1,140446057982528,Cube ubuf (textured),type,2,usage,4,logical_size,68,effective_size,256,backing_gpu_buf_count,2,backing_cpu_buf_count,0,
+ 7,8,140446058913648,Qt texture,width,256,height,256,format,1,owns_native_resource,1,mip_count,9,layer_count,1,effective_sample_count,1,approx_byte_size,349524,
+ 1,8,140446058795856,Cube vbuf (textured with offscreen),type,0,usage,1,logical_size,720,effective_size,720,backing_gpu_buf_count,1,backing_cpu_buf_count,0,
+ 1,8,140446058947920,Cube ubuf (textured with offscreen),type,2,usage,4,logical_size,68,effective_size,256,backing_gpu_buf_count,2,backing_cpu_buf_count,0,
+ 7,8,140446058794928,Texture for offscreen content,width,512,height,512,format,1,owns_native_resource,1,mip_count,1,layer_count,1,effective_sample_count,1,approx_byte_size,1048576,
+ 1,8,140446058963904,Triangle vbuf,type,0,usage,1,logical_size,84,effective_size,84,backing_gpu_buf_count,1,backing_cpu_buf_count,0,
+ 1,8,140446058964560,Triangle ubuf,type,2,usage,4,logical_size,68,effective_size,256,backing_gpu_buf_count,2,backing_cpu_buf_count,0,
+ 5,9,140446057945392,,type,0,width,1280,height,720,effective_sample_count,1,transient_backing,0,winsys_backing,0,approx_byte_size,3686400,
+ 11,9,140446057944592,,width,1280,height,720,buffer_count,2,msaa_buffer_count,0,effective_sample_count,1,approx_total_byte_size,7372800,
+ 9,9,140446058913648,Qt texture,slot,0,size,262144,
+ 10,9,140446058913648,Qt texture,slot,0,
+ 17,2019,140446057944592,,frames_since_resize,121,min_ms_frame_delta,9,max_ms_frame_delta,33,Favg_ms_frame_delta,16.1167,
+ 18,2019,140446057944592,,frames_since_resize,121,min_ms_frame_build,0,max_ms_frame_build,1,Favg_ms_frame_build,0.00833333,
+ 17,4019,140446057944592,,frames_since_resize,241,min_ms_frame_delta,15,max_ms_frame_delta,17,Favg_ms_frame_delta,16.0583,
+ 18,4019,140446057944592,,frames_since_resize,241,min_ms_frame_build,0,max_ms_frame_build,0,Favg_ms_frame_build,0,
+ 12,5070,140446057944592,,
+ 2,5079,140446057947376,Triangle ubuf,
+ 2,5079,140446057946208,Triangle vbuf,
+ 2,5079,140446057947440,,
+ 2,5079,140446057950544,,
+ 2,5079,140446057950416,,
+ 8,5079,140446058913648,Qt texture,
+ 2,5079,140446057982528,Cube ubuf (textured),
+ 2,5079,140446057984784,Cube vbuf (textured),
+ 2,5079,140446058964560,Triangle ubuf,
+ 2,5079,140446058963904,Triangle vbuf,
+ 8,5079,140446058794928,Texture for offscreen content,
+ 2,5079,140446058947920,Cube ubuf (textured with offscreen),
+ 2,5079,140446058795856,Cube vbuf (textured with offscreen),
+ 6,5079,140446057945392,,
+ \endcode
+
+ Each line starts with \c op, \c timestamp, \c res, \c name where op is a
+ value from StreamOp, timestamp is a recording timestamp in milliseconds
+ (qint64), res is a number (quint64) referring to the QRhiResource the entry
+ refers to, or 0 if not applicable. \c name is the value of
+ QRhiResource::name() and may be empty as well. The \c name will never
+ contain a comma.
+
+ This is followed by any number of \c{key, value} pairs where \c key is an
+ unspecified string and \c value is a number. If \c key starts with \c F, it
+ indicates the value is a float. Otherwise assume that the value is a
+ qint64.
+ */
+
+/*!
+ \enum QRhiProfiler::StreamOp
+ Describes an entry in the profiler's output stream.
+
+ \value NewBuffer A buffer is created
+ \value ReleaseBuffer A buffer is destroyed
+ \value NewBufferStagingArea A staging buffer for buffer upload is created
+ \value ReleaseBufferStagingArea A staging buffer for buffer upload is destroyed
+ \value NewRenderBuffer A renderbuffer is created
+ \value ReleaseRenderBuffer A renderbuffer is destroyed
+ \value NewTexture A texture is created
+ \value ReleaseTexture A texture is destroyed
+ \value NewTextureStagingArea A staging buffer for texture upload is created
+ \value ReleaseTextureStagingArea A staging buffer for texture upload is destroyed
+ \value ResizeSwapChain A swapchain is created or resized
+ \value ReleaseSwapChain A swapchain is destroyed
+ \value NewReadbackBuffer A staging buffer for readback is created
+ \value ReleaseReadbackBuffer A staging buffer for readback is destroyed
+ \value GpuMemAllocStats GPU memory allocator statistics
+ \value GpuFrameTime GPU frame times
+ \value FrameToFrameTime CPU frame-to-frame times
+ \value FrameBuildTime CPU beginFrame-endFrame times
+ */
+
+/*!
+ \class QRhiProfiler::CpuTime
+ \internal
+ \inmodule QtGui
+ \brief Contains CPU-side frame timings.
+
+ Once sufficient number of frames have been rendered, the minimum, maximum,
+ and average values (in milliseconds) from various measurements are made
+ available in this struct queriable from QRhiProfiler::frameToFrameTimes()
+ and QRhiProfiler::frameBuildTimes().
+
+ \sa QRhiProfiler::setFrameTimingWriteInterval()
+ */
+
+/*!
+ \class QRhiProfiler::GpuTime
+ \internal
+ \inmodule QtGui
+ \brief Contains GPU-side frame timings.
+
+ Once sufficient number of frames have been rendered, the minimum, maximum,
+ and average values (in milliseconds) calculated from GPU command buffer
+ timestamps are made available in this struct queriable from
+ QRhiProfiler::gpuFrameTimes().
+
+ \sa QRhiProfiler::setFrameTimingWriteInterval()
+ */
+
+/*!
+ \internal
+ */
+QRhiProfiler::QRhiProfiler()
+ : d(new QRhiProfilerPrivate)
+{
+ d->ts.start();
+}
+
+/*!
+ Destructor.
+ */
+QRhiProfiler::~QRhiProfiler()
+{
+ // Flush because there is a high chance we have writes that were made since
+ // the event loop last ran. (esp. relevant for network devices like QTcpSocket)
+ if (d->outputDevice)
+ d->outputDevice->waitForBytesWritten(1000);
+
+ delete d;
+}
+
+/*!
+ Sets the output \a device.
+
+ \note No output will be generated when QRhi::EnableProfiling was not set.
+ */
+void QRhiProfiler::setDevice(QIODevice *device)
+{
+ d->outputDevice = device;
+}
+
+/*!
+ Requests writing a GpuMemAllocStats entry into the output, when applicable.
+ Backends that do not support this will ignore the request. This is an
+ explicit request since getting the allocator status and statistics may be
+ an expensive operation.
+ */
+void QRhiProfiler::addVMemAllocatorStats()
+{
+ if (d->rhiDWhenEnabled)
+ d->rhiDWhenEnabled->sendVMemStatsToProfiler();
+}
+
+/*!
+ \return the currently set frame timing writeout interval.
+ */
+int QRhiProfiler::frameTimingWriteInterval() const
+{
+ return d->frameTimingWriteInterval;
+}
+
+/*!
+ Sets the number of frames that need to be rendered before the collected CPU
+ and GPU timings are processed (min, max, average are calculated) to \a
+ frameCount.
+
+ The default value is 120.
+ */
+void QRhiProfiler::setFrameTimingWriteInterval(int frameCount)
+{
+ if (frameCount > 0)
+ d->frameTimingWriteInterval = frameCount;
+}
+
+/*!
+ \return min, max, and avg in milliseconds for the time that elapsed between two
+ QRhi::endFrame() calls.
+
+ \note The values are all 0 until at least frameTimingWriteInterval() frames
+ have been rendered.
+ */
+QRhiProfiler::CpuTime QRhiProfiler::frameToFrameTimes(QRhiSwapChain *sc) const
+{
+ auto it = d->swapchains.constFind(sc);
+ if (it != d->swapchains.constEnd())
+ return it->frameToFrameTime;
+
+ return QRhiProfiler::CpuTime();
+}
+
+/*!
+ \return min, max, and avg in milliseconds for the time that elapsed between
+ a QRhi::beginFrame() and QRhi::endFrame().
+
+ \note The values are all 0 until at least frameTimingWriteInterval() frames
+ have been rendered.
+ */
+QRhiProfiler::CpuTime QRhiProfiler::frameBuildTimes(QRhiSwapChain *sc) const
+{
+ auto it = d->swapchains.constFind(sc);
+ if (it != d->swapchains.constEnd())
+ return it->beginToEndFrameTime;
+
+ return QRhiProfiler::CpuTime();
+}
+
+/*!
+ \return min, max, and avg in milliseconds for the GPU time that is spent on
+ one frame.
+
+ \note The values are all 0 until at least frameTimingWriteInterval() frames
+ have been rendered.
+
+ The GPU times should only be compared between runs on the same GPU of the
+ same system with the same backend. Comparing times for different graphics
+ cards or for different backends can give misleading results. The numbers are
+ not meant to be comparable that way.
+
+ \note Some backends have no support for this, and even for those that have,
+ it is not guaranteed that the driver will support it at run time. Support
+ can be checked via QRhi::Timestamps.
+ */
+QRhiProfiler::GpuTime QRhiProfiler::gpuFrameTimes(QRhiSwapChain *sc) const
+{
+ auto it = d->swapchains.constFind(sc);
+ if (it != d->swapchains.constEnd())
+ return it->gpuFrameTime;
+
+ return QRhiProfiler::GpuTime();
+}
+
+void QRhiProfilerPrivate::startEntry(QRhiProfiler::StreamOp op, qint64 timestamp, QRhiResource *res)
+{
+ buf.clear();
+ buf.append(QByteArray::number(op));
+ buf.append(',');
+ buf.append(QByteArray::number(timestamp));
+ buf.append(',');
+ buf.append(QByteArray::number(quint64(quintptr(res))));
+ buf.append(',');
+ if (res)
+ buf.append(res->name());
+ buf.append(',');
+}
+
+void QRhiProfilerPrivate::writeInt(const char *key, qint64 v)
+{
+ Q_ASSERT(key[0] != 'F');
+ buf.append(key);
+ buf.append(',');
+ buf.append(QByteArray::number(v));
+ buf.append(',');
+}
+
+void QRhiProfilerPrivate::writeFloat(const char *key, float f)
+{
+ Q_ASSERT(key[0] == 'F');
+ buf.append(key);
+ buf.append(',');
+ buf.append(QByteArray::number(double(f)));
+ buf.append(',');
+}
+
+void QRhiProfilerPrivate::endEntry()
+{
+ buf.append('\n');
+ outputDevice->write(buf);
+}
+
+void QRhiProfilerPrivate::newBuffer(QRhiBuffer *buf, quint32 realSize, int backingGpuBufCount, int backingCpuBufCount)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::NewBuffer, ts.elapsed(), buf);
+ writeInt("type", buf->type());
+ writeInt("usage", buf->usage());
+ writeInt("logical_size", buf->size());
+ writeInt("effective_size", realSize);
+ writeInt("backing_gpu_buf_count", backingGpuBufCount);
+ writeInt("backing_cpu_buf_count", backingCpuBufCount);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseBuffer(QRhiBuffer *buf)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseBuffer, ts.elapsed(), buf);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::newBufferStagingArea(QRhiBuffer *buf, int slot, quint32 size)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::NewBufferStagingArea, ts.elapsed(), buf);
+ writeInt("slot", slot);
+ writeInt("size", size);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseBufferStagingArea(QRhiBuffer *buf, int slot)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseBufferStagingArea, ts.elapsed(), buf);
+ writeInt("slot", slot);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::newRenderBuffer(QRhiRenderBuffer *rb, bool transientBacking, bool winSysBacking, int sampleCount)
+{
+ if (!outputDevice)
+ return;
+
+ const QRhiRenderBuffer::Type type = rb->type();
+ const QSize sz = rb->pixelSize();
+ // just make up something, ds is likely D24S8 while color is RGBA8 or similar
+ const QRhiTexture::Format assumedFormat = type == QRhiRenderBuffer::DepthStencil ? QRhiTexture::D32F : QRhiTexture::RGBA8;
+ quint32 byteSize = rhiDWhenEnabled->approxByteSizeForTexture(assumedFormat, sz, 1, 1);
+ if (sampleCount > 1)
+ byteSize *= uint(sampleCount);
+
+ startEntry(QRhiProfiler::NewRenderBuffer, ts.elapsed(), rb);
+ writeInt("type", type);
+ writeInt("width", sz.width());
+ writeInt("height", sz.height());
+ writeInt("effective_sample_count", sampleCount);
+ writeInt("transient_backing", transientBacking);
+ writeInt("winsys_backing", winSysBacking);
+ writeInt("approx_byte_size", byteSize);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseRenderBuffer(QRhiRenderBuffer *rb)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseRenderBuffer, ts.elapsed(), rb);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::newTexture(QRhiTexture *tex, bool owns, int mipCount, int layerCount, int sampleCount)
+{
+ if (!outputDevice)
+ return;
+
+ const QRhiTexture::Format format = tex->format();
+ const QSize sz = tex->pixelSize();
+ quint32 byteSize = rhiDWhenEnabled->approxByteSizeForTexture(format, sz, mipCount, layerCount);
+ if (sampleCount > 1)
+ byteSize *= uint(sampleCount);
+
+ startEntry(QRhiProfiler::NewTexture, ts.elapsed(), tex);
+ writeInt("width", sz.width());
+ writeInt("height", sz.height());
+ writeInt("format", format);
+ writeInt("owns_native_resource", owns);
+ writeInt("mip_count", mipCount);
+ writeInt("layer_count", layerCount);
+ writeInt("effective_sample_count", sampleCount);
+ writeInt("approx_byte_size", byteSize);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseTexture(QRhiTexture *tex)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseTexture, ts.elapsed(), tex);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::newTextureStagingArea(QRhiTexture *tex, int slot, quint32 size)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::NewTextureStagingArea, ts.elapsed(), tex);
+ writeInt("slot", slot);
+ writeInt("size", size);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseTextureStagingArea(QRhiTexture *tex, int slot)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseTextureStagingArea, ts.elapsed(), tex);
+ writeInt("slot", slot);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::resizeSwapChain(QRhiSwapChain *sc, int bufferCount, int msaaBufferCount, int sampleCount)
+{
+ if (!outputDevice)
+ return;
+
+ const QSize sz = sc->currentPixelSize();
+ quint32 byteSize = rhiDWhenEnabled->approxByteSizeForTexture(QRhiTexture::BGRA8, sz, 1, 1);
+ byteSize = byteSize * uint(bufferCount) + byteSize * uint(msaaBufferCount) * uint(sampleCount);
+
+ startEntry(QRhiProfiler::ResizeSwapChain, ts.elapsed(), sc);
+ writeInt("width", sz.width());
+ writeInt("height", sz.height());
+ writeInt("buffer_count", bufferCount);
+ writeInt("msaa_buffer_count", msaaBufferCount);
+ writeInt("effective_sample_count", sampleCount);
+ writeInt("approx_total_byte_size", byteSize);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseSwapChain(QRhiSwapChain *sc)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseSwapChain, ts.elapsed(), sc);
+ endEntry();
+}
+
+template<typename T>
+void calcTiming(QVector<T> *vec, T *minDelta, T *maxDelta, float *avgDelta)
+{
+ if (vec->isEmpty())
+ return;
+
+ *minDelta = *maxDelta = 0;
+ float totalDelta = 0;
+ for (T delta : qAsConst(*vec)) {
+ totalDelta += float(delta);
+ if (*minDelta == 0 || delta < *minDelta)
+ *minDelta = delta;
+ if (*maxDelta == 0 || delta > *maxDelta)
+ *maxDelta = delta;
+ }
+ *avgDelta = totalDelta / vec->count();
+
+ vec->clear();
+}
+
+void QRhiProfilerPrivate::beginSwapChainFrame(QRhiSwapChain *sc)
+{
+ Sc &scd(swapchains[sc]);
+ scd.beginToEndTimer.start();
+}
+
+void QRhiProfilerPrivate::endSwapChainFrame(QRhiSwapChain *sc, int frameCount)
+{
+ Sc &scd(swapchains[sc]);
+ if (!scd.frameToFrameRunning) {
+ scd.frameToFrameTimer.start();
+ scd.frameToFrameRunning = true;
+ return;
+ }
+
+ scd.frameToFrameSamples.append(scd.frameToFrameTimer.restart());
+ if (scd.frameToFrameSamples.count() >= frameTimingWriteInterval) {
+ calcTiming(&scd.frameToFrameSamples,
+ &scd.frameToFrameTime.minTime, &scd.frameToFrameTime.maxTime, &scd.frameToFrameTime.avgTime);
+ if (outputDevice) {
+ startEntry(QRhiProfiler::FrameToFrameTime, ts.elapsed(), sc);
+ writeInt("frames_since_resize", frameCount);
+ writeInt("min_ms_frame_delta", scd.frameToFrameTime.minTime);
+ writeInt("max_ms_frame_delta", scd.frameToFrameTime.maxTime);
+ writeFloat("Favg_ms_frame_delta", scd.frameToFrameTime.avgTime);
+ endEntry();
+ }
+ }
+
+ scd.beginToEndSamples.append(scd.beginToEndTimer.elapsed());
+ if (scd.beginToEndSamples.count() >= frameTimingWriteInterval) {
+ calcTiming(&scd.beginToEndSamples,
+ &scd.beginToEndFrameTime.minTime, &scd.beginToEndFrameTime.maxTime, &scd.beginToEndFrameTime.avgTime);
+ if (outputDevice) {
+ startEntry(QRhiProfiler::FrameBuildTime, ts.elapsed(), sc);
+ writeInt("frames_since_resize", frameCount);
+ writeInt("min_ms_frame_build", scd.beginToEndFrameTime.minTime);
+ writeInt("max_ms_frame_build", scd.beginToEndFrameTime.maxTime);
+ writeFloat("Favg_ms_frame_build", scd.beginToEndFrameTime.avgTime);
+ endEntry();
+ }
+ }
+}
+
+void QRhiProfilerPrivate::swapChainFrameGpuTime(QRhiSwapChain *sc, float gpuTime)
+{
+ Sc &scd(swapchains[sc]);
+ scd.gpuFrameSamples.append(gpuTime);
+ if (scd.gpuFrameSamples.count() >= frameTimingWriteInterval) {
+ calcTiming(&scd.gpuFrameSamples,
+ &scd.gpuFrameTime.minTime, &scd.gpuFrameTime.maxTime, &scd.gpuFrameTime.avgTime);
+ if (outputDevice) {
+ startEntry(QRhiProfiler::GpuFrameTime, ts.elapsed(), sc);
+ writeFloat("Fmin_ms_gpu_frame_time", scd.gpuFrameTime.minTime);
+ writeFloat("Fmax_ms_gpu_frame_time", scd.gpuFrameTime.maxTime);
+ writeFloat("Favg_ms_gpu_frame_time", scd.gpuFrameTime.avgTime);
+ endEntry();
+ }
+ }
+}
+
+void QRhiProfilerPrivate::newReadbackBuffer(qint64 id, QRhiResource *src, quint32 size)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::NewReadbackBuffer, ts.elapsed(), src);
+ writeInt("id", id);
+ writeInt("size", size);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::releaseReadbackBuffer(qint64 id)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::ReleaseReadbackBuffer, ts.elapsed(), nullptr);
+ writeInt("id", id);
+ endEntry();
+}
+
+void QRhiProfilerPrivate::vmemStat(uint realAllocCount, uint subAllocCount, quint32 totalSize, quint32 unusedSize)
+{
+ if (!outputDevice)
+ return;
+
+ startEntry(QRhiProfiler::GpuMemAllocStats, ts.elapsed(), nullptr);
+ writeInt("real_alloc_count", realAllocCount);
+ writeInt("sub_alloc_count", subAllocCount);
+ writeInt("total_size", totalSize);
+ writeInt("unused_size", unusedSize);
+ endEntry();
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhiprofiler_p.h b/src/gui/rhi/qrhiprofiler_p.h
new file mode 100644
index 0000000000..89fd0a8798
--- /dev/null
+++ b/src/gui/rhi/qrhiprofiler_p.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIPROFILER_H
+#define QRHIPROFILER_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/qrhi_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QRhiProfilerPrivate;
+class QIODevice;
+
+class Q_GUI_EXPORT QRhiProfiler
+{
+public:
+ enum StreamOp {
+ NewBuffer = 1,
+ ReleaseBuffer,
+ NewBufferStagingArea,
+ ReleaseBufferStagingArea,
+ NewRenderBuffer,
+ ReleaseRenderBuffer,
+ NewTexture,
+ ReleaseTexture,
+ NewTextureStagingArea,
+ ReleaseTextureStagingArea,
+ ResizeSwapChain,
+ ReleaseSwapChain,
+ NewReadbackBuffer,
+ ReleaseReadbackBuffer,
+ GpuMemAllocStats,
+ GpuFrameTime,
+ FrameToFrameTime,
+ FrameBuildTime
+ };
+
+ ~QRhiProfiler();
+
+ void setDevice(QIODevice *device);
+
+ void addVMemAllocatorStats();
+
+ int frameTimingWriteInterval() const;
+ void setFrameTimingWriteInterval(int frameCount);
+
+ struct CpuTime {
+ qint64 minTime = 0;
+ qint64 maxTime = 0;
+ float avgTime = 0;
+ };
+
+ struct GpuTime {
+ float minTime = 0;
+ float maxTime = 0;
+ float avgTime = 0;
+ };
+
+ CpuTime frameToFrameTimes(QRhiSwapChain *sc) const;
+ CpuTime frameBuildTimes(QRhiSwapChain *sc) const; // beginFrame - endFrame
+ GpuTime gpuFrameTimes(QRhiSwapChain *sc) const;
+
+private:
+ Q_DISABLE_COPY(QRhiProfiler)
+ QRhiProfiler();
+ QRhiProfilerPrivate *d;
+ friend class QRhiImplementation;
+ friend class QRhiProfilerPrivate;
+};
+
+Q_DECLARE_TYPEINFO(QRhiProfiler::CpuTime, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiProfiler::GpuTime, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhiprofiler_p_p.h b/src/gui/rhi/qrhiprofiler_p_p.h
new file mode 100644
index 0000000000..7d0f183fb1
--- /dev/null
+++ b/src/gui/rhi/qrhiprofiler_p_p.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIPROFILER_P_H
+#define QRHIPROFILER_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 "qrhiprofiler_p.h"
+#include <QElapsedTimer>
+#include <QHash>
+
+QT_BEGIN_NAMESPACE
+
+class QRhiProfilerPrivate
+{
+public:
+ static QRhiProfilerPrivate *get(QRhiProfiler *p) { return p->d; }
+
+ void newBuffer(QRhiBuffer *buf, quint32 realSize, int backingGpuBufCount, int backingCpuBufCount);
+ void releaseBuffer(QRhiBuffer *buf);
+ void newBufferStagingArea(QRhiBuffer *buf, int slot, quint32 size);
+ void releaseBufferStagingArea(QRhiBuffer *buf, int slot);
+
+ void newRenderBuffer(QRhiRenderBuffer *rb, bool transientBacking, bool winSysBacking, int sampleCount);
+ void releaseRenderBuffer(QRhiRenderBuffer *rb);
+
+ void newTexture(QRhiTexture *tex, bool owns, int mipCount, int layerCount, int sampleCount);
+ void releaseTexture(QRhiTexture *tex);
+ void newTextureStagingArea(QRhiTexture *tex, int slot, quint32 size);
+ void releaseTextureStagingArea(QRhiTexture *tex, int slot);
+
+ void resizeSwapChain(QRhiSwapChain *sc, int bufferCount, int msaaBufferCount, int sampleCount);
+ void releaseSwapChain(QRhiSwapChain *sc);
+
+ void beginSwapChainFrame(QRhiSwapChain *sc);
+ void endSwapChainFrame(QRhiSwapChain *sc, int frameCount);
+ void swapChainFrameGpuTime(QRhiSwapChain *sc, float gpuTimeMs);
+
+ void newReadbackBuffer(qint64 id, QRhiResource *src, quint32 size);
+ void releaseReadbackBuffer(qint64 id);
+
+ void vmemStat(uint realAllocCount, uint subAllocCount, quint32 totalSize, quint32 unusedSize);
+
+ void startEntry(QRhiProfiler::StreamOp op, qint64 timestamp, QRhiResource *res);
+ void writeInt(const char *key, qint64 v);
+ void writeFloat(const char *key, float f);
+ void endEntry();
+
+ QRhiImplementation *rhiDWhenEnabled = nullptr;
+ QIODevice *outputDevice = nullptr;
+ QElapsedTimer ts;
+ QByteArray buf;
+ static const int DEFAULT_FRAME_TIMING_WRITE_INTERVAL = 120; // frames
+ int frameTimingWriteInterval = DEFAULT_FRAME_TIMING_WRITE_INTERVAL;
+ struct Sc {
+ Sc() {
+ frameToFrameSamples.reserve(DEFAULT_FRAME_TIMING_WRITE_INTERVAL);
+ beginToEndSamples.reserve(DEFAULT_FRAME_TIMING_WRITE_INTERVAL);
+ gpuFrameSamples.reserve(DEFAULT_FRAME_TIMING_WRITE_INTERVAL);
+ }
+ QElapsedTimer frameToFrameTimer;
+ bool frameToFrameRunning = false;
+ QElapsedTimer beginToEndTimer;
+ QVector<qint64> frameToFrameSamples;
+ QVector<qint64> beginToEndSamples;
+ QVector<float> gpuFrameSamples;
+ QRhiProfiler::CpuTime frameToFrameTime;
+ QRhiProfiler::CpuTime beginToEndFrameTime;
+ QRhiProfiler::GpuTime gpuFrameTime;
+ };
+ QHash<QRhiSwapChain *, Sc> swapchains;
+};
+
+Q_DECLARE_TYPEINFO(QRhiProfilerPrivate::Sc, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
new file mode 100644
index 0000000000..103fea627a
--- /dev/null
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -0,0 +1,6492 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qrhivulkan_p_p.h"
+#include "qrhivulkanext_p.h"
+
+#define VMA_IMPLEMENTATION
+#define VMA_STATIC_VULKAN_FUNCTIONS 0
+#define VMA_RECORDING_ENABLED 0
+#define VMA_DEDICATED_ALLOCATION 0
+#ifdef QT_DEBUG
+#define VMA_DEBUG_INITIALIZE_ALLOCATIONS 1
+#endif
+#include "vk_mem_alloc.h"
+
+#include <qmath.h>
+#include <QVulkanFunctions>
+#include <QVulkanWindow>
+
+QT_BEGIN_NAMESPACE
+
+/*
+ Vulkan 1.0 backend. Provides a double-buffered swapchain that throttles the
+ rendering thread to vsync. Textures and "static" buffers are device local,
+ and a separate, host visible staging buffer is used to upload data to them.
+ "Dynamic" buffers are in host visible memory and are duplicated (since there
+ can be 2 frames in flight). This is handled transparently to the application.
+
+ Barriers are generated automatically for each render or compute pass, based
+ on the resources that are used in that pass (in QRhiShaderResourceBindings,
+ vertex inputs, etc.). This implies deferring the recording of the command
+ buffer since the barriers have to be placed at the right place (before the
+ pass), and that can only be done once we know all the things the pass does.
+
+ This in turn has implications for integrating external commands
+ (beginExternal() - direct Vulkan calls - endExternal()) because that is
+ incompatible with this approach by nature. Therefore we support another mode
+ of operation, where each render or compute pass uses one or more secondary
+ command buffers (recorded right away), with each beginExternal() leading to
+ closing the current secondary cb, creating a new secondary cb for the
+ external content, and then starting yet another one in endExternal() for
+ whatever comes afterwards in the pass. This way the primary command buffer
+ only has vkCmdExecuteCommand(s) within a renderpass instance
+ (Begin-EndRenderPass). (i.e. our only subpass is then
+ VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS instead of
+ VK_SUBPASS_CONTENTS_INLINE)
+
+ The command buffer management mode is decided on a per frame basis,
+ controlled by the ExternalContentsInPass flag of beginFrame().
+*/
+
+/*!
+ \class QRhiVulkanInitParams
+ \internal
+ \inmodule QtGui
+ \brief Vulkan specific initialization parameters.
+
+ A Vulkan-based QRhi needs at minimum a valid QVulkanInstance. It is up to
+ the user to ensure this is available and initialized. This is typically
+ done in main() similarly to the following:
+
+ \badcode
+ int main(int argc, char **argv)
+ {
+ ...
+
+ QVulkanInstance inst;
+ #ifndef Q_OS_ANDROID
+ inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation");
+ #else
+ inst.setLayers(QByteArrayList()
+ << "VK_LAYER_GOOGLE_threading"
+ << "VK_LAYER_LUNARG_parameter_validation"
+ << "VK_LAYER_LUNARG_object_tracker"
+ << "VK_LAYER_LUNARG_core_validation"
+ << "VK_LAYER_LUNARG_image"
+ << "VK_LAYER_LUNARG_swapchain"
+ << "VK_LAYER_GOOGLE_unique_objects");
+ #endif
+ inst.setExtensions(QByteArrayList()
+ << "VK_KHR_get_physical_device_properties2");
+ if (!inst.create())
+ qFatal("Vulkan not available");
+
+ ...
+ }
+ \endcode
+
+ The example here has two optional aspects: it enables the
+ \l{https://github.com/KhronosGroup/Vulkan-ValidationLayers}{Vulkan
+ validation layers}, when they are available, and also enables the
+ VK_KHR_get_physical_device_properties2 extension (part of Vulkan 1.1), when
+ available. The former is useful during the development phase (remember that
+ QVulkanInstance conveniently redirects messages and warnings to qDebug).
+ Avoid enabling it in production builds, however. The latter is important in
+ order to make QRhi::CustomInstanceStepRate available with Vulkan since
+ VK_EXT_vertex_attribute_divisor (part of Vulkan 1.1) depends on it. It can
+ be omitted when instanced drawing with a non-one step rate is not used.
+
+ Once this is done, a Vulkan-based QRhi can be created by passing the
+ instance and a QWindow with its surface type set to
+ QSurface::VulkanSurface:
+
+ \badcode
+ QRhiVulkanInitParams params;
+ params.inst = vulkanInstance;
+ params.window = window;
+ rhi = QRhi::create(QRhi::Vulkan, &params);
+ \endcode
+
+ The window is optional and can be omitted. This is not recommended however
+ because there is then no way to ensure presenting is supported while
+ choosing a graphics queue.
+
+ \note Even when a window is specified, QRhiSwapChain objects can be created
+ for other windows as well, as long as they all have their
+ QWindow::surfaceType() set to QSurface::VulkanSurface.
+
+ \section2 Working with existing Vulkan devices
+
+ When interoperating with another graphics engine, it may be necessary to
+ get a QRhi instance that uses the same Vulkan device. This can be achieved
+ by passing a pointer to a QRhiVulkanNativeHandles to QRhi::create().
+
+ The physical device and device object must then be set to a non-null value.
+ In addition, either the graphics queue family index or the graphics queue
+ object itself is required. Prefer the former, whenever possible since
+ deducing the index is not possible afterwards. Optionally, an existing
+ command pool object can be specified as well, and, also optionally,
+ vmemAllocator can be used to share the same
+ \l{https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator}{Vulkan
+ memory allocator} between two QRhi instances.
+
+ The QRhi does not take ownership of any of the external objects.
+ */
+
+/*!
+ \class QRhiVulkanNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Collects device, queue, and other Vulkan objects that are used by the QRhi.
+
+ \note Ownership of the Vulkan objects is never transferred.
+ */
+
+/*!
+ \class QRhiVulkanTextureNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the Vulkan image object that is backing a QRhiTexture.
+
+ Importing and exporting Vulkan image objects that back a QRhiTexture when
+ running with the Vulkan backend is supported via this class. Ownership of
+ the Vulkan object is never transferred.
+
+ \note Memory allocation details are not exposed. This is intentional since
+ memory is typically suballocated from a bigger chunk of VkDeviceMemory, and
+ exposing the allocator details is not desirable for now.
+ */
+
+/*!
+ \class QRhiVulkanCommandBufferNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the Vulkan command buffer object that is backing a QRhiCommandBuffer.
+
+ \note The Vulkan command buffer object is only guaranteed to be valid, and
+ in recording state, while recording a frame. That is, between a
+ \l{QRhi::beginFrame()}{beginFrame()} - \l{QRhi::endFrame()}{endFrame()} or
+ \l{QRhi::beginOffscreenFrame()}{beginOffscreenFrame()} -
+ \l{QRhi::endOffsrceenFrame()}{endOffscreenFrame()} pair.
+ */
+
+/*!
+ \class QRhiVulkanRenderPassNativeHandles
+ \internal
+ \inmodule QtGui
+ \brief Holds the Vulkan render pass object backing a QRhiRenderPassDescriptor.
+ */
+
+template <class Int>
+inline Int aligned(Int v, Int byteAlign)
+{
+ return (v + byteAlign - 1) & ~(byteAlign - 1);
+}
+
+static QVulkanInstance *globalVulkanInstance;
+
+static void VKAPI_PTR wrap_vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties)
+{
+ globalVulkanInstance->functions()->vkGetPhysicalDeviceProperties(physicalDevice, pProperties);
+}
+
+static void VKAPI_PTR wrap_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties)
+{
+ globalVulkanInstance->functions()->vkGetPhysicalDeviceMemoryProperties(physicalDevice, pMemoryProperties);
+}
+
+static VkResult VKAPI_PTR wrap_vkAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkAllocateMemory(device, pAllocateInfo, pAllocator, pMemory);
+}
+
+void VKAPI_PTR wrap_vkFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator)
+{
+ globalVulkanInstance->deviceFunctions(device)->vkFreeMemory(device, memory, pAllocator);
+}
+
+VkResult VKAPI_PTR wrap_vkMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkMapMemory(device, memory, offset, size, flags, ppData);
+}
+
+void VKAPI_PTR wrap_vkUnmapMemory(VkDevice device, VkDeviceMemory memory)
+{
+ globalVulkanInstance->deviceFunctions(device)->vkUnmapMemory(device, memory);
+}
+
+VkResult VKAPI_PTR wrap_vkFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkFlushMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
+}
+
+VkResult VKAPI_PTR wrap_vkInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkInvalidateMappedMemoryRanges(device, memoryRangeCount, pMemoryRanges);
+}
+
+VkResult VKAPI_PTR wrap_vkBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkBindBufferMemory(device, buffer, memory, memoryOffset);
+}
+
+VkResult VKAPI_PTR wrap_vkBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkBindImageMemory(device, image, memory, memoryOffset);
+}
+
+void VKAPI_PTR wrap_vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements)
+{
+ globalVulkanInstance->deviceFunctions(device)->vkGetBufferMemoryRequirements(device, buffer, pMemoryRequirements);
+}
+
+void VKAPI_PTR wrap_vkGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements)
+{
+ globalVulkanInstance->deviceFunctions(device)->vkGetImageMemoryRequirements(device, image, pMemoryRequirements);
+}
+
+VkResult VKAPI_PTR wrap_vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkCreateBuffer(device, pCreateInfo, pAllocator, pBuffer);
+}
+
+void VKAPI_PTR wrap_vkDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator)
+{
+ globalVulkanInstance->deviceFunctions(device)->vkDestroyBuffer(device, buffer, pAllocator);
+}
+
+VkResult VKAPI_PTR wrap_vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage)
+{
+ return globalVulkanInstance->deviceFunctions(device)->vkCreateImage(device, pCreateInfo, pAllocator, pImage);
+}
+
+void VKAPI_PTR wrap_vkDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator)
+{
+ globalVulkanInstance->deviceFunctions(device)->vkDestroyImage(device, image, pAllocator);
+}
+
+static inline VmaAllocation toVmaAllocation(QVkAlloc a)
+{
+ return reinterpret_cast<VmaAllocation>(a);
+}
+
+static inline VmaAllocator toVmaAllocator(QVkAllocator a)
+{
+ return reinterpret_cast<VmaAllocator>(a);
+}
+
+QRhiVulkan::QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importDevice)
+ : ofr(this)
+{
+ inst = params->inst;
+ maybeWindow = params->window; // may be null
+
+ importedDevice = importDevice != nullptr;
+ if (importedDevice) {
+ physDev = importDevice->physDev;
+ dev = importDevice->dev;
+ if (physDev && dev) {
+ gfxQueueFamilyIdx = importDevice->gfxQueueFamilyIdx;
+ gfxQueue = importDevice->gfxQueue;
+ if (importDevice->cmdPool) {
+ importedCmdPool = true;
+ cmdPool = importDevice->cmdPool;
+ }
+ if (importDevice->vmemAllocator) {
+ importedAllocator = true;
+ allocator = importDevice->vmemAllocator;
+ }
+ } else {
+ qWarning("No (physical) Vulkan device is given, cannot import");
+ importedDevice = false;
+ }
+ }
+}
+
+static bool qvk_debug_filter(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object,
+ size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage)
+{
+ Q_UNUSED(flags);
+ Q_UNUSED(objectType);
+ Q_UNUSED(object);
+ Q_UNUSED(location);
+ Q_UNUSED(messageCode);
+ Q_UNUSED(pLayerPrefix);
+
+ // Filter out certain misleading validation layer messages, as per
+ // VulkanMemoryAllocator documentation.
+ if (strstr(pMessage, "Mapping an image with layout")
+ && strstr(pMessage, "can result in undefined behavior if this memory is used by the device"))
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool QRhiVulkan::create(QRhi::Flags flags)
+{
+ Q_UNUSED(flags);
+ Q_ASSERT(inst);
+
+ if (!inst->isValid()) {
+ qWarning("Vulkan instance is not valid");
+ return false;
+ }
+
+ globalVulkanInstance = inst; // assume this will not change during the lifetime of the entire application
+
+ f = inst->functions();
+
+ QVector<VkQueueFamilyProperties> queueFamilyProps;
+ auto queryQueueFamilyProps = [this, &queueFamilyProps] {
+ uint32_t queueCount = 0;
+ f->vkGetPhysicalDeviceQueueFamilyProperties(physDev, &queueCount, nullptr);
+ queueFamilyProps.resize(int(queueCount));
+ f->vkGetPhysicalDeviceQueueFamilyProperties(physDev, &queueCount, queueFamilyProps.data());
+ };
+
+ if (!importedDevice) {
+ uint32_t physDevCount = 0;
+ f->vkEnumeratePhysicalDevices(inst->vkInstance(), &physDevCount, nullptr);
+ if (!physDevCount) {
+ qWarning("No physical devices");
+ return false;
+ }
+ QVarLengthArray<VkPhysicalDevice, 4> physDevs(physDevCount);
+ VkResult err = f->vkEnumeratePhysicalDevices(inst->vkInstance(), &physDevCount, physDevs.data());
+ if (err != VK_SUCCESS || !physDevCount) {
+ qWarning("Failed to enumerate physical devices: %d", err);
+ return false;
+ }
+
+ int physDevIndex = -1;
+ int requestedPhysDevIndex = -1;
+ if (qEnvironmentVariableIsSet("QT_VK_PHYSICAL_DEVICE_INDEX"))
+ requestedPhysDevIndex = qEnvironmentVariableIntValue("QT_VK_PHYSICAL_DEVICE_INDEX");
+
+ if (requestedPhysDevIndex < 0 && flags.testFlag(QRhi::PreferSoftwareRenderer)) {
+ for (int i = 0; i < int(physDevCount); ++i) {
+ f->vkGetPhysicalDeviceProperties(physDevs[i], &physDevProperties);
+ if (physDevProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU) {
+ requestedPhysDevIndex = i;
+ break;
+ }
+ }
+ }
+
+ for (int i = 0; i < int(physDevCount); ++i) {
+ f->vkGetPhysicalDeviceProperties(physDevs[i], &physDevProperties);
+ qCDebug(QRHI_LOG_INFO, "Physical device %d: '%s' %d.%d.%d (api %d.%d.%d vendor 0x%X device 0x%X type %d)",
+ i,
+ physDevProperties.deviceName,
+ VK_VERSION_MAJOR(physDevProperties.driverVersion),
+ VK_VERSION_MINOR(physDevProperties.driverVersion),
+ VK_VERSION_PATCH(physDevProperties.driverVersion),
+ VK_VERSION_MAJOR(physDevProperties.apiVersion),
+ VK_VERSION_MINOR(physDevProperties.apiVersion),
+ VK_VERSION_PATCH(physDevProperties.apiVersion),
+ physDevProperties.vendorID,
+ physDevProperties.deviceID,
+ physDevProperties.deviceType);
+ if (physDevIndex < 0 && (requestedPhysDevIndex < 0 || requestedPhysDevIndex == int(i))) {
+ physDevIndex = i;
+ qCDebug(QRHI_LOG_INFO, " using this physical device");
+ }
+ }
+
+ if (physDevIndex < 0) {
+ qWarning("No matching physical device");
+ return false;
+ }
+ physDev = physDevs[physDevIndex];
+
+ queryQueueFamilyProps();
+
+ gfxQueue = VK_NULL_HANDLE;
+
+ // We only support combined graphics+present queues. When it comes to
+ // compute, only combined graphics+compute queue is used, compute gets
+ // disabled otherwise.
+ gfxQueueFamilyIdx = -1;
+ int computelessGfxQueueCandidateIdx = -1;
+ for (int i = 0; i < queueFamilyProps.count(); ++i) {
+ qCDebug(QRHI_LOG_INFO, "queue family %d: flags=0x%x count=%d",
+ i, queueFamilyProps[i].queueFlags, queueFamilyProps[i].queueCount);
+ if (gfxQueueFamilyIdx == -1
+ && (queueFamilyProps[i].queueFlags & VK_QUEUE_GRAPHICS_BIT)
+ && (!maybeWindow || inst->supportsPresent(physDev, uint32_t(i), maybeWindow)))
+ {
+ if (queueFamilyProps[i].queueFlags & VK_QUEUE_COMPUTE_BIT)
+ gfxQueueFamilyIdx = i;
+ else if (computelessGfxQueueCandidateIdx == -1)
+ computelessGfxQueueCandidateIdx = i;
+ }
+ }
+ if (gfxQueueFamilyIdx == -1) {
+ if (computelessGfxQueueCandidateIdx != -1) {
+ gfxQueueFamilyIdx = computelessGfxQueueCandidateIdx;
+ } else {
+ qWarning("No graphics (or no graphics+present) queue family found");
+ return false;
+ }
+ }
+
+ VkDeviceQueueCreateInfo queueInfo[2];
+ const float prio[] = { 0 };
+ memset(queueInfo, 0, sizeof(queueInfo));
+ queueInfo[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
+ queueInfo[0].queueFamilyIndex = uint32_t(gfxQueueFamilyIdx);
+ queueInfo[0].queueCount = 1;
+ queueInfo[0].pQueuePriorities = prio;
+
+ QVector<const char *> devLayers;
+ if (inst->layers().contains("VK_LAYER_LUNARG_standard_validation"))
+ devLayers.append("VK_LAYER_LUNARG_standard_validation");
+
+ uint32_t devExtCount = 0;
+ f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &devExtCount, nullptr);
+ QVector<VkExtensionProperties> devExts(devExtCount);
+ f->vkEnumerateDeviceExtensionProperties(physDev, nullptr, &devExtCount, devExts.data());
+ qCDebug(QRHI_LOG_INFO, "%d device extensions available", devExts.count());
+
+ QVector<const char *> requestedDevExts;
+ requestedDevExts.append("VK_KHR_swapchain");
+
+ debugMarkersAvailable = false;
+ vertexAttribDivisorAvailable = false;
+ for (const VkExtensionProperties &ext : devExts) {
+ if (!strcmp(ext.extensionName, VK_EXT_DEBUG_MARKER_EXTENSION_NAME)) {
+ requestedDevExts.append(VK_EXT_DEBUG_MARKER_EXTENSION_NAME);
+ debugMarkersAvailable = true;
+ } else if (!strcmp(ext.extensionName, VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME)) {
+ if (inst->extensions().contains(QByteArrayLiteral("VK_KHR_get_physical_device_properties2"))) {
+ requestedDevExts.append(VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME);
+ vertexAttribDivisorAvailable = true;
+ }
+ }
+ }
+
+ VkDeviceCreateInfo devInfo;
+ memset(&devInfo, 0, sizeof(devInfo));
+ devInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
+ devInfo.queueCreateInfoCount = 1;
+ devInfo.pQueueCreateInfos = queueInfo;
+ devInfo.enabledLayerCount = uint32_t(devLayers.count());
+ devInfo.ppEnabledLayerNames = devLayers.constData();
+ devInfo.enabledExtensionCount = uint32_t(requestedDevExts.count());
+ devInfo.ppEnabledExtensionNames = requestedDevExts.constData();
+
+ err = f->vkCreateDevice(physDev, &devInfo, nullptr, &dev);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create device: %d", err);
+ return false;
+ }
+ }
+
+ df = inst->deviceFunctions(dev);
+
+ if (!importedCmdPool) {
+ VkCommandPoolCreateInfo poolInfo;
+ memset(&poolInfo, 0, sizeof(poolInfo));
+ poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
+ poolInfo.queueFamilyIndex = uint32_t(gfxQueueFamilyIdx);
+ VkResult err = df->vkCreateCommandPool(dev, &poolInfo, nullptr, &cmdPool);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create command pool: %d", err);
+ return false;
+ }
+ }
+
+ if (gfxQueueFamilyIdx != -1) {
+ if (!gfxQueue)
+ df->vkGetDeviceQueue(dev, uint32_t(gfxQueueFamilyIdx), 0, &gfxQueue);
+
+ if (queueFamilyProps.isEmpty())
+ queryQueueFamilyProps();
+
+ hasCompute = (queueFamilyProps[gfxQueueFamilyIdx].queueFlags & VK_QUEUE_COMPUTE_BIT) != 0;
+ timestampValidBits = queueFamilyProps[gfxQueueFamilyIdx].timestampValidBits;
+ }
+
+ f->vkGetPhysicalDeviceProperties(physDev, &physDevProperties);
+ ubufAlign = physDevProperties.limits.minUniformBufferOffsetAlignment;
+ // helps little with an optimal offset of 1 (on some drivers) when the spec
+ // elsewhere states that the minimum bufferOffset is 4...
+ texbufAlign = qMax<VkDeviceSize>(4, physDevProperties.limits.optimalBufferCopyOffsetAlignment);
+
+ f->vkGetPhysicalDeviceFeatures(physDev, &physDevFeatures);
+ hasWideLines = physDevFeatures.wideLines;
+
+ if (!importedAllocator) {
+ VmaVulkanFunctions afuncs;
+ afuncs.vkGetPhysicalDeviceProperties = wrap_vkGetPhysicalDeviceProperties;
+ afuncs.vkGetPhysicalDeviceMemoryProperties = wrap_vkGetPhysicalDeviceMemoryProperties;
+ afuncs.vkAllocateMemory = wrap_vkAllocateMemory;
+ afuncs.vkFreeMemory = wrap_vkFreeMemory;
+ afuncs.vkMapMemory = wrap_vkMapMemory;
+ afuncs.vkUnmapMemory = wrap_vkUnmapMemory;
+ afuncs.vkFlushMappedMemoryRanges = wrap_vkFlushMappedMemoryRanges;
+ afuncs.vkInvalidateMappedMemoryRanges = wrap_vkInvalidateMappedMemoryRanges;
+ afuncs.vkBindBufferMemory = wrap_vkBindBufferMemory;
+ afuncs.vkBindImageMemory = wrap_vkBindImageMemory;
+ afuncs.vkGetBufferMemoryRequirements = wrap_vkGetBufferMemoryRequirements;
+ afuncs.vkGetImageMemoryRequirements = wrap_vkGetImageMemoryRequirements;
+ afuncs.vkCreateBuffer = wrap_vkCreateBuffer;
+ afuncs.vkDestroyBuffer = wrap_vkDestroyBuffer;
+ afuncs.vkCreateImage = wrap_vkCreateImage;
+ afuncs.vkDestroyImage = wrap_vkDestroyImage;
+
+ VmaAllocatorCreateInfo allocatorInfo;
+ memset(&allocatorInfo, 0, sizeof(allocatorInfo));
+ // A QRhi is supposed to be used from one single thread only. Disable
+ // the allocator's own mutexes. This gives a performance boost.
+ allocatorInfo.flags = VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT;
+ allocatorInfo.physicalDevice = physDev;
+ allocatorInfo.device = dev;
+ allocatorInfo.pVulkanFunctions = &afuncs;
+ VmaAllocator vmaallocator;
+ VkResult err = vmaCreateAllocator(&allocatorInfo, &vmaallocator);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create allocator: %d", err);
+ return false;
+ }
+ allocator = vmaallocator;
+ }
+
+ inst->installDebugOutputFilter(qvk_debug_filter);
+
+ VkDescriptorPool pool;
+ VkResult err = createDescriptorPool(&pool);
+ if (err == VK_SUCCESS)
+ descriptorPools.append(pool);
+ else
+ qWarning("Failed to create initial descriptor pool: %d", err);
+
+ VkQueryPoolCreateInfo timestampQueryPoolInfo;
+ memset(&timestampQueryPoolInfo, 0, sizeof(timestampQueryPoolInfo));
+ timestampQueryPoolInfo.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
+ timestampQueryPoolInfo.queryType = VK_QUERY_TYPE_TIMESTAMP;
+ timestampQueryPoolInfo.queryCount = QVK_MAX_ACTIVE_TIMESTAMP_PAIRS * 2;
+ err = df->vkCreateQueryPool(dev, &timestampQueryPoolInfo, nullptr, &timestampQueryPool);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create timestamp query pool: %d", err);
+ return false;
+ }
+ timestampQueryPoolMap.resize(QVK_MAX_ACTIVE_TIMESTAMP_PAIRS); // 1 bit per pair
+ timestampQueryPoolMap.fill(false);
+
+ if (debugMarkersAvailable) {
+ vkCmdDebugMarkerBegin = reinterpret_cast<PFN_vkCmdDebugMarkerBeginEXT>(f->vkGetDeviceProcAddr(dev, "vkCmdDebugMarkerBeginEXT"));
+ vkCmdDebugMarkerEnd = reinterpret_cast<PFN_vkCmdDebugMarkerEndEXT>(f->vkGetDeviceProcAddr(dev, "vkCmdDebugMarkerEndEXT"));
+ vkCmdDebugMarkerInsert = reinterpret_cast<PFN_vkCmdDebugMarkerInsertEXT>(f->vkGetDeviceProcAddr(dev, "vkCmdDebugMarkerInsertEXT"));
+ vkDebugMarkerSetObjectName = reinterpret_cast<PFN_vkDebugMarkerSetObjectNameEXT>(f->vkGetDeviceProcAddr(dev, "vkDebugMarkerSetObjectNameEXT"));
+ }
+
+ deviceLost = false;
+
+ nativeHandlesStruct.physDev = physDev;
+ nativeHandlesStruct.dev = dev;
+ nativeHandlesStruct.gfxQueueFamilyIdx = gfxQueueFamilyIdx;
+ nativeHandlesStruct.gfxQueue = gfxQueue;
+ nativeHandlesStruct.cmdPool = cmdPool;
+ nativeHandlesStruct.vmemAllocator = allocator;
+
+ return true;
+}
+
+void QRhiVulkan::destroy()
+{
+ if (!df)
+ return;
+
+ if (!deviceLost)
+ df->vkDeviceWaitIdle(dev);
+
+ executeDeferredReleases(true);
+ finishActiveReadbacks(true);
+
+ if (ofr.cmdFence) {
+ df->vkDestroyFence(dev, ofr.cmdFence, nullptr);
+ ofr.cmdFence = VK_NULL_HANDLE;
+ }
+
+ if (ofr.cbWrapper.cb) {
+ df->vkFreeCommandBuffers(dev, cmdPool, 1, &ofr.cbWrapper.cb);
+ ofr.cbWrapper.cb = VK_NULL_HANDLE;
+ }
+
+ if (pipelineCache) {
+ df->vkDestroyPipelineCache(dev, pipelineCache, nullptr);
+ pipelineCache = VK_NULL_HANDLE;
+ }
+
+ for (const DescriptorPoolData &pool : descriptorPools)
+ df->vkDestroyDescriptorPool(dev, pool.pool, nullptr);
+
+ descriptorPools.clear();
+
+ if (timestampQueryPool) {
+ df->vkDestroyQueryPool(dev, timestampQueryPool, nullptr);
+ timestampQueryPool = VK_NULL_HANDLE;
+ }
+
+ if (!importedAllocator && allocator) {
+ vmaDestroyAllocator(toVmaAllocator(allocator));
+ allocator = nullptr;
+ }
+
+ if (!importedCmdPool && cmdPool) {
+ df->vkDestroyCommandPool(dev, cmdPool, nullptr);
+ cmdPool = VK_NULL_HANDLE;
+ }
+
+ if (!importedDevice && dev) {
+ df->vkDestroyDevice(dev, nullptr);
+ inst->resetDeviceFunctions(dev);
+ dev = VK_NULL_HANDLE;
+ }
+
+ f = nullptr;
+ df = nullptr;
+}
+
+VkResult QRhiVulkan::createDescriptorPool(VkDescriptorPool *pool)
+{
+ VkDescriptorPoolSize descPoolSizes[] = {
+ { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, QVK_UNIFORM_BUFFERS_PER_POOL },
+ { VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, QVK_UNIFORM_BUFFERS_PER_POOL },
+ { VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, QVK_COMBINED_IMAGE_SAMPLERS_PER_POOL },
+ { VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, QVK_STORAGE_BUFFERS_PER_POOL },
+ { VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, QVK_STORAGE_IMAGES_PER_POOL }
+ };
+ VkDescriptorPoolCreateInfo descPoolInfo;
+ memset(&descPoolInfo, 0, sizeof(descPoolInfo));
+ descPoolInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
+ // Do not enable vkFreeDescriptorSets - sets are never freed on their own
+ // (good so no trouble with fragmentation), they just deref their pool
+ // which is then reset at some point (or not).
+ descPoolInfo.flags = 0;
+ descPoolInfo.maxSets = QVK_DESC_SETS_PER_POOL;
+ descPoolInfo.poolSizeCount = sizeof(descPoolSizes) / sizeof(descPoolSizes[0]);
+ descPoolInfo.pPoolSizes = descPoolSizes;
+ return df->vkCreateDescriptorPool(dev, &descPoolInfo, nullptr, pool);
+}
+
+bool QRhiVulkan::allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex)
+{
+ auto tryAllocate = [this, allocInfo, result](int poolIndex) {
+ allocInfo->descriptorPool = descriptorPools[poolIndex].pool;
+ VkResult r = df->vkAllocateDescriptorSets(dev, allocInfo, result);
+ if (r == VK_SUCCESS)
+ descriptorPools[poolIndex].refCount += 1;
+ return r;
+ };
+
+ int lastPoolIdx = descriptorPools.count() - 1;
+ for (int i = lastPoolIdx; i >= 0; --i) {
+ if (descriptorPools[i].refCount == 0) {
+ df->vkResetDescriptorPool(dev, descriptorPools[i].pool, 0);
+ descriptorPools[i].allocedDescSets = 0;
+ }
+ if (descriptorPools[i].allocedDescSets + int(allocInfo->descriptorSetCount) <= QVK_DESC_SETS_PER_POOL) {
+ VkResult err = tryAllocate(i);
+ if (err == VK_SUCCESS) {
+ descriptorPools[i].allocedDescSets += allocInfo->descriptorSetCount;
+ *resultPoolIndex = i;
+ return true;
+ }
+ }
+ }
+
+ VkDescriptorPool newPool;
+ VkResult poolErr = createDescriptorPool(&newPool);
+ if (poolErr == VK_SUCCESS) {
+ descriptorPools.append(newPool);
+ lastPoolIdx = descriptorPools.count() - 1;
+ VkResult err = tryAllocate(lastPoolIdx);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to allocate descriptor set from new pool too, giving up: %d", err);
+ return false;
+ }
+ descriptorPools[lastPoolIdx].allocedDescSets += allocInfo->descriptorSetCount;
+ *resultPoolIndex = lastPoolIdx;
+ return true;
+ } else {
+ qWarning("Failed to allocate new descriptor pool: %d", poolErr);
+ return false;
+ }
+}
+
+static inline VkFormat toVkTextureFormat(QRhiTexture::Format format, QRhiTexture::Flags flags)
+{
+ const bool srgb = flags.testFlag(QRhiTexture::sRGB);
+ switch (format) {
+ case QRhiTexture::RGBA8:
+ return srgb ? VK_FORMAT_R8G8B8A8_SRGB : VK_FORMAT_R8G8B8A8_UNORM;
+ case QRhiTexture::BGRA8:
+ return srgb ? VK_FORMAT_B8G8R8A8_SRGB : VK_FORMAT_B8G8R8A8_UNORM;
+ case QRhiTexture::R8:
+ return srgb ? VK_FORMAT_R8_SRGB : VK_FORMAT_R8_UNORM;
+ case QRhiTexture::R16:
+ return VK_FORMAT_R16_UNORM;
+ case QRhiTexture::RED_OR_ALPHA8:
+ return VK_FORMAT_R8_UNORM;
+
+ case QRhiTexture::RGBA16F:
+ return VK_FORMAT_R16G16B16A16_SFLOAT;
+ case QRhiTexture::RGBA32F:
+ return VK_FORMAT_R32G32B32A32_SFLOAT;
+
+ case QRhiTexture::D16:
+ return VK_FORMAT_D16_UNORM;
+ case QRhiTexture::D32F:
+ return VK_FORMAT_D32_SFLOAT;
+
+ case QRhiTexture::BC1:
+ return srgb ? VK_FORMAT_BC1_RGB_SRGB_BLOCK : VK_FORMAT_BC1_RGB_UNORM_BLOCK;
+ case QRhiTexture::BC2:
+ return srgb ? VK_FORMAT_BC2_SRGB_BLOCK : VK_FORMAT_BC2_UNORM_BLOCK;
+ case QRhiTexture::BC3:
+ return srgb ? VK_FORMAT_BC3_SRGB_BLOCK : VK_FORMAT_BC3_UNORM_BLOCK;
+ case QRhiTexture::BC4:
+ return VK_FORMAT_BC4_UNORM_BLOCK;
+ case QRhiTexture::BC5:
+ return VK_FORMAT_BC5_UNORM_BLOCK;
+ case QRhiTexture::BC6H:
+ return VK_FORMAT_BC6H_UFLOAT_BLOCK;
+ case QRhiTexture::BC7:
+ return srgb ? VK_FORMAT_BC7_SRGB_BLOCK : VK_FORMAT_BC7_UNORM_BLOCK;
+
+ case QRhiTexture::ETC2_RGB8:
+ return srgb ? VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK : VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK;
+ case QRhiTexture::ETC2_RGB8A1:
+ return srgb ? VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK : VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK;
+ case QRhiTexture::ETC2_RGBA8:
+ return srgb ? VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK : VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK;
+
+ case QRhiTexture::ASTC_4x4:
+ return srgb ? VK_FORMAT_ASTC_4x4_SRGB_BLOCK : VK_FORMAT_ASTC_4x4_UNORM_BLOCK;
+ case QRhiTexture::ASTC_5x4:
+ return srgb ? VK_FORMAT_ASTC_5x4_SRGB_BLOCK : VK_FORMAT_ASTC_5x4_UNORM_BLOCK;
+ case QRhiTexture::ASTC_5x5:
+ return srgb ? VK_FORMAT_ASTC_5x5_SRGB_BLOCK : VK_FORMAT_ASTC_5x5_UNORM_BLOCK;
+ case QRhiTexture::ASTC_6x5:
+ return srgb ? VK_FORMAT_ASTC_6x5_SRGB_BLOCK : VK_FORMAT_ASTC_6x5_UNORM_BLOCK;
+ case QRhiTexture::ASTC_6x6:
+ return srgb ? VK_FORMAT_ASTC_6x6_SRGB_BLOCK : VK_FORMAT_ASTC_6x6_UNORM_BLOCK;
+ case QRhiTexture::ASTC_8x5:
+ return srgb ? VK_FORMAT_ASTC_8x5_SRGB_BLOCK : VK_FORMAT_ASTC_8x5_UNORM_BLOCK;
+ case QRhiTexture::ASTC_8x6:
+ return srgb ? VK_FORMAT_ASTC_8x6_SRGB_BLOCK : VK_FORMAT_ASTC_8x6_UNORM_BLOCK;
+ case QRhiTexture::ASTC_8x8:
+ return srgb ? VK_FORMAT_ASTC_8x8_SRGB_BLOCK : VK_FORMAT_ASTC_8x8_UNORM_BLOCK;
+ case QRhiTexture::ASTC_10x5:
+ return srgb ? VK_FORMAT_ASTC_10x5_SRGB_BLOCK : VK_FORMAT_ASTC_10x5_UNORM_BLOCK;
+ case QRhiTexture::ASTC_10x6:
+ return srgb ? VK_FORMAT_ASTC_10x6_SRGB_BLOCK : VK_FORMAT_ASTC_10x6_UNORM_BLOCK;
+ case QRhiTexture::ASTC_10x8:
+ return srgb ? VK_FORMAT_ASTC_10x8_SRGB_BLOCK : VK_FORMAT_ASTC_10x8_UNORM_BLOCK;
+ case QRhiTexture::ASTC_10x10:
+ return srgb ? VK_FORMAT_ASTC_10x10_SRGB_BLOCK : VK_FORMAT_ASTC_10x10_UNORM_BLOCK;
+ case QRhiTexture::ASTC_12x10:
+ return srgb ? VK_FORMAT_ASTC_12x10_SRGB_BLOCK : VK_FORMAT_ASTC_12x10_UNORM_BLOCK;
+ case QRhiTexture::ASTC_12x12:
+ return srgb ? VK_FORMAT_ASTC_12x12_SRGB_BLOCK : VK_FORMAT_ASTC_12x12_UNORM_BLOCK;
+
+ default:
+ Q_UNREACHABLE();
+ return VK_FORMAT_R8G8B8A8_UNORM;
+ }
+}
+
+static inline QRhiTexture::Format colorTextureFormatFromVkFormat(VkFormat format, QRhiTexture::Flags *flags)
+{
+ switch (format) {
+ case VK_FORMAT_R8G8B8A8_UNORM:
+ return QRhiTexture::RGBA8;
+ case VK_FORMAT_R8G8B8A8_SRGB:
+ if (flags)
+ (*flags) |= QRhiTexture::sRGB;
+ return QRhiTexture::RGBA8;
+ case VK_FORMAT_B8G8R8A8_UNORM:
+ return QRhiTexture::BGRA8;
+ case VK_FORMAT_B8G8R8A8_SRGB:
+ if (flags)
+ (*flags) |= QRhiTexture::sRGB;
+ return QRhiTexture::BGRA8;
+ case VK_FORMAT_R8_UNORM:
+ return QRhiTexture::R8;
+ case VK_FORMAT_R8_SRGB:
+ if (flags)
+ (*flags) |= QRhiTexture::sRGB;
+ return QRhiTexture::R8;
+ case VK_FORMAT_R16_UNORM:
+ return QRhiTexture::R16;
+ default: // this cannot assert, must warn and return unknown
+ qWarning("VkFormat %d is not a recognized uncompressed color format", format);
+ break;
+ }
+ return QRhiTexture::UnknownFormat;
+}
+
+static inline bool isDepthTextureFormat(QRhiTexture::Format format)
+{
+ switch (format) {
+ case QRhiTexture::Format::D16:
+ Q_FALLTHROUGH();
+ case QRhiTexture::Format::D32F:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+// Transient images ("render buffers") backed by lazily allocated memory are
+// managed manually without going through vk_mem_alloc since it does not offer
+// any support for such images. This should be ok since in practice there
+// should be very few of such images.
+
+uint32_t QRhiVulkan::chooseTransientImageMemType(VkImage img, uint32_t startIndex)
+{
+ VkPhysicalDeviceMemoryProperties physDevMemProps;
+ f->vkGetPhysicalDeviceMemoryProperties(physDev, &physDevMemProps);
+
+ VkMemoryRequirements memReq;
+ df->vkGetImageMemoryRequirements(dev, img, &memReq);
+ uint32_t memTypeIndex = uint32_t(-1);
+
+ if (memReq.memoryTypeBits) {
+ // Find a device local + lazily allocated, or at least device local memtype.
+ const VkMemoryType *memType = physDevMemProps.memoryTypes;
+ bool foundDevLocal = false;
+ for (uint32_t i = startIndex; i < physDevMemProps.memoryTypeCount; ++i) {
+ if (memReq.memoryTypeBits & (1 << i)) {
+ if (memType[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) {
+ if (!foundDevLocal) {
+ foundDevLocal = true;
+ memTypeIndex = i;
+ }
+ if (memType[i].propertyFlags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) {
+ memTypeIndex = i;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return memTypeIndex;
+}
+
+bool QRhiVulkan::createTransientImage(VkFormat format,
+ const QSize &pixelSize,
+ VkImageUsageFlags usage,
+ VkImageAspectFlags aspectMask,
+ VkSampleCountFlagBits samples,
+ VkDeviceMemory *mem,
+ VkImage *images,
+ VkImageView *views,
+ int count)
+{
+ VkMemoryRequirements memReq;
+ VkResult err;
+
+ for (int i = 0; i < count; ++i) {
+ VkImageCreateInfo imgInfo;
+ memset(&imgInfo, 0, sizeof(imgInfo));
+ imgInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
+ imgInfo.imageType = VK_IMAGE_TYPE_2D;
+ imgInfo.format = format;
+ imgInfo.extent.width = uint32_t(pixelSize.width());
+ imgInfo.extent.height = uint32_t(pixelSize.height());
+ imgInfo.extent.depth = 1;
+ imgInfo.mipLevels = imgInfo.arrayLayers = 1;
+ imgInfo.samples = samples;
+ imgInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
+ imgInfo.usage = usage | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT;
+ imgInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+
+ err = df->vkCreateImage(dev, &imgInfo, nullptr, images + i);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create image: %d", err);
+ return false;
+ }
+
+ // Assume the reqs are the same since the images are same in every way.
+ // Still, call GetImageMemReq for every image, in order to prevent the
+ // validation layer from complaining.
+ df->vkGetImageMemoryRequirements(dev, images[i], &memReq);
+ }
+
+ VkMemoryAllocateInfo memInfo;
+ memset(&memInfo, 0, sizeof(memInfo));
+ memInfo.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
+ memInfo.allocationSize = aligned(memReq.size, memReq.alignment) * VkDeviceSize(count);
+
+ uint32_t startIndex = 0;
+ do {
+ memInfo.memoryTypeIndex = chooseTransientImageMemType(images[0], startIndex);
+ if (memInfo.memoryTypeIndex == uint32_t(-1)) {
+ qWarning("No suitable memory type found");
+ return false;
+ }
+ startIndex = memInfo.memoryTypeIndex + 1;
+ err = df->vkAllocateMemory(dev, &memInfo, nullptr, mem);
+ if (err != VK_SUCCESS && err != VK_ERROR_OUT_OF_DEVICE_MEMORY) {
+ qWarning("Failed to allocate image memory: %d", err);
+ return false;
+ }
+ } while (err != VK_SUCCESS);
+
+ VkDeviceSize ofs = 0;
+ for (int i = 0; i < count; ++i) {
+ err = df->vkBindImageMemory(dev, images[i], *mem, ofs);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to bind image memory: %d", err);
+ return false;
+ }
+ ofs += aligned(memReq.size, memReq.alignment);
+
+ VkImageViewCreateInfo imgViewInfo;
+ memset(&imgViewInfo, 0, sizeof(imgViewInfo));
+ imgViewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
+ imgViewInfo.image = images[i];
+ imgViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
+ imgViewInfo.format = format;
+ imgViewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
+ imgViewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
+ imgViewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
+ imgViewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
+ imgViewInfo.subresourceRange.aspectMask = aspectMask;
+ imgViewInfo.subresourceRange.levelCount = imgViewInfo.subresourceRange.layerCount = 1;
+
+ err = df->vkCreateImageView(dev, &imgViewInfo, nullptr, views + i);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create image view: %d", err);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+VkFormat QRhiVulkan::optimalDepthStencilFormat()
+{
+ if (optimalDsFormat != VK_FORMAT_UNDEFINED)
+ return optimalDsFormat;
+
+ const VkFormat dsFormatCandidates[] = {
+ VK_FORMAT_D24_UNORM_S8_UINT,
+ VK_FORMAT_D32_SFLOAT_S8_UINT,
+ VK_FORMAT_D16_UNORM_S8_UINT
+ };
+ const int dsFormatCandidateCount = sizeof(dsFormatCandidates) / sizeof(VkFormat);
+ int dsFormatIdx = 0;
+ while (dsFormatIdx < dsFormatCandidateCount) {
+ optimalDsFormat = dsFormatCandidates[dsFormatIdx];
+ VkFormatProperties fmtProp;
+ f->vkGetPhysicalDeviceFormatProperties(physDev, optimalDsFormat, &fmtProp);
+ if (fmtProp.optimalTilingFeatures & VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)
+ break;
+ ++dsFormatIdx;
+ }
+ if (dsFormatIdx == dsFormatCandidateCount)
+ qWarning("Failed to find an optimal depth-stencil format");
+
+ return optimalDsFormat;
+}
+
+bool QRhiVulkan::createDefaultRenderPass(VkRenderPass *rp, bool hasDepthStencil, VkSampleCountFlagBits samples, VkFormat colorFormat)
+{
+ VkAttachmentDescription attDesc[3];
+ memset(attDesc, 0, sizeof(attDesc));
+
+ // attachment list layout is color (1), ds (0-1), resolve (0-1)
+
+ attDesc[0].format = colorFormat;
+ attDesc[0].samples = samples;
+ attDesc[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc[0].storeOp = samples > VK_SAMPLE_COUNT_1_BIT ? VK_ATTACHMENT_STORE_OP_DONT_CARE : VK_ATTACHMENT_STORE_OP_STORE;
+ attDesc[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+ attDesc[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ attDesc[0].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ attDesc[0].finalLayout = samples > VK_SAMPLE_COUNT_1_BIT ? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+
+ // clear on load + no store + lazy alloc + transient image should play
+ // nicely with tiled GPUs (no physical backing necessary for ds buffer)
+ attDesc[1].format = optimalDepthStencilFormat();
+ attDesc[1].samples = samples;
+ attDesc[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc[1].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ attDesc[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc[1].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ attDesc[1].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ attDesc[1].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+
+ if (samples > VK_SAMPLE_COUNT_1_BIT) {
+ attDesc[2].format = colorFormat;
+ attDesc[2].samples = VK_SAMPLE_COUNT_1_BIT;
+ attDesc[2].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc[2].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
+ attDesc[2].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+ attDesc[2].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ attDesc[2].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ attDesc[2].finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+ }
+
+ VkAttachmentReference colorRef = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+ VkAttachmentReference dsRef = { 1, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL };
+ VkAttachmentReference resolveRef = { 2, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+
+ VkSubpassDescription subpassDesc;
+ memset(&subpassDesc, 0, sizeof(subpassDesc));
+ subpassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
+ subpassDesc.colorAttachmentCount = 1;
+ subpassDesc.pColorAttachments = &colorRef;
+ subpassDesc.pDepthStencilAttachment = hasDepthStencil ? &dsRef : nullptr;
+
+ // Replace the first implicit dep (TOP_OF_PIPE / ALL_COMMANDS) with our own.
+ VkSubpassDependency subpassDep;
+ memset(&subpassDep, 0, sizeof(subpassDep));
+ subpassDep.srcSubpass = VK_SUBPASS_EXTERNAL;
+ subpassDep.dstSubpass = 0;
+ subpassDep.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+ subpassDep.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+ subpassDep.srcAccessMask = 0;
+ subpassDep.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+
+ VkRenderPassCreateInfo rpInfo;
+ memset(&rpInfo, 0, sizeof(rpInfo));
+ rpInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
+ rpInfo.attachmentCount = 1;
+ rpInfo.pAttachments = attDesc;
+ rpInfo.subpassCount = 1;
+ rpInfo.pSubpasses = &subpassDesc;
+ rpInfo.dependencyCount = 1;
+ rpInfo.pDependencies = &subpassDep;
+
+ if (hasDepthStencil)
+ rpInfo.attachmentCount += 1;
+
+ if (samples > VK_SAMPLE_COUNT_1_BIT) {
+ rpInfo.attachmentCount += 1;
+ subpassDesc.pResolveAttachments = &resolveRef;
+ }
+
+ VkResult err = df->vkCreateRenderPass(dev, &rpInfo, nullptr, rp);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create renderpass: %d", err);
+ return false;
+ }
+
+ return true;
+}
+
+bool QRhiVulkan::createOffscreenRenderPass(VkRenderPass *rp,
+ const QRhiColorAttachment *firstColorAttachment,
+ const QRhiColorAttachment *lastColorAttachment,
+ bool preserveColor,
+ bool preserveDs,
+ QRhiRenderBuffer *depthStencilBuffer,
+ QRhiTexture *depthTexture)
+{
+ QVarLengthArray<VkAttachmentDescription, 8> attDescs;
+ QVarLengthArray<VkAttachmentReference, 8> colorRefs;
+ QVarLengthArray<VkAttachmentReference, 8> resolveRefs;
+
+ // attachment list layout is color (0-8), ds (0-1), resolve (0-8)
+
+ for (auto it = firstColorAttachment; it != lastColorAttachment; ++it) {
+ QVkTexture *texD = QRHI_RES(QVkTexture, it->texture());
+ QVkRenderBuffer *rbD = QRHI_RES(QVkRenderBuffer, it->renderBuffer());
+ Q_ASSERT(texD || rbD);
+ const VkFormat vkformat = texD ? texD->vkformat : rbD->vkformat;
+ const VkSampleCountFlagBits samples = texD ? texD->samples : rbD->samples;
+
+ VkAttachmentDescription attDesc;
+ memset(&attDesc, 0, sizeof(attDesc));
+ attDesc.format = vkformat;
+ attDesc.samples = samples;
+ attDesc.loadOp = preserveColor ? VK_ATTACHMENT_LOAD_OP_LOAD : VK_ATTACHMENT_LOAD_OP_CLEAR;
+ attDesc.storeOp = it->resolveTexture() ? VK_ATTACHMENT_STORE_OP_DONT_CARE : VK_ATTACHMENT_STORE_OP_STORE;
+ attDesc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+ attDesc.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ // this has to interact correctly with activateTextureRenderTarget(), hence leaving in COLOR_ATT
+ attDesc.initialLayout = preserveColor ? VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED;
+ attDesc.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+ attDescs.append(attDesc);
+
+ const VkAttachmentReference ref = { uint32_t(attDescs.count() - 1), VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+ colorRefs.append(ref);
+ }
+
+ const bool hasDepthStencil = depthStencilBuffer || depthTexture;
+ if (hasDepthStencil) {
+ const VkFormat dsFormat = depthTexture ? QRHI_RES(QVkTexture, depthTexture)->vkformat
+ : QRHI_RES(QVkRenderBuffer, depthStencilBuffer)->vkformat;
+ const VkSampleCountFlagBits samples = depthTexture ? QRHI_RES(QVkTexture, depthTexture)->samples
+ : QRHI_RES(QVkRenderBuffer, depthStencilBuffer)->samples;
+ const VkAttachmentLoadOp loadOp = preserveDs ? VK_ATTACHMENT_LOAD_OP_LOAD : VK_ATTACHMENT_LOAD_OP_CLEAR;
+ const VkAttachmentStoreOp storeOp = depthTexture ? VK_ATTACHMENT_STORE_OP_STORE : VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ VkAttachmentDescription attDesc;
+ memset(&attDesc, 0, sizeof(attDesc));
+ attDesc.format = dsFormat;
+ attDesc.samples = samples;
+ attDesc.loadOp = loadOp;
+ attDesc.storeOp = storeOp;
+ attDesc.stencilLoadOp = loadOp;
+ attDesc.stencilStoreOp = storeOp;
+ attDesc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ attDesc.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+ attDescs.append(attDesc);
+ }
+ VkAttachmentReference dsRef = { uint32_t(attDescs.count() - 1), VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL };
+
+ for (auto it = firstColorAttachment; it != lastColorAttachment; ++it) {
+ if (it->resolveTexture()) {
+ QVkTexture *rtexD = QRHI_RES(QVkTexture, it->resolveTexture());
+ if (rtexD->samples > VK_SAMPLE_COUNT_1_BIT)
+ qWarning("Resolving into a multisample texture is not supported");
+
+ VkAttachmentDescription attDesc;
+ memset(&attDesc, 0, sizeof(attDesc));
+ attDesc.format = rtexD->vkformat;
+ attDesc.samples = VK_SAMPLE_COUNT_1_BIT;
+ attDesc.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE; // ignored
+ attDesc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
+ attDesc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+ attDesc.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+ attDesc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ attDesc.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+ attDescs.append(attDesc);
+
+ const VkAttachmentReference ref = { uint32_t(attDescs.count() - 1), VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+ resolveRefs.append(ref);
+ } else {
+ const VkAttachmentReference ref = { VK_ATTACHMENT_UNUSED, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
+ resolveRefs.append(ref);
+ }
+ }
+
+ VkSubpassDescription subpassDesc;
+ memset(&subpassDesc, 0, sizeof(subpassDesc));
+ subpassDesc.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
+ subpassDesc.colorAttachmentCount = uint32_t(colorRefs.count());
+ Q_ASSERT(colorRefs.count() == resolveRefs.count());
+ subpassDesc.pColorAttachments = !colorRefs.isEmpty() ? colorRefs.constData() : nullptr;
+ subpassDesc.pDepthStencilAttachment = hasDepthStencil ? &dsRef : nullptr;
+ subpassDesc.pResolveAttachments = !resolveRefs.isEmpty() ? resolveRefs.constData() : nullptr;
+
+ VkRenderPassCreateInfo rpInfo;
+ memset(&rpInfo, 0, sizeof(rpInfo));
+ rpInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
+ rpInfo.attachmentCount = uint32_t(attDescs.count());
+ rpInfo.pAttachments = attDescs.constData();
+ rpInfo.subpassCount = 1;
+ rpInfo.pSubpasses = &subpassDesc;
+ // don't yet know the correct initial/final access and stage stuff for the
+ // implicit deps at this point, so leave it to the resource tracking to
+ // generate barriers
+
+ VkResult err = df->vkCreateRenderPass(dev, &rpInfo, nullptr, rp);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create renderpass: %d", err);
+ return false;
+ }
+
+ return true;
+}
+
+bool QRhiVulkan::recreateSwapChain(QRhiSwapChain *swapChain)
+{
+ QVkSwapChain *swapChainD = QRHI_RES(QVkSwapChain, swapChain);
+ if (swapChainD->pixelSize.isEmpty()) {
+ qWarning("Surface size is 0, cannot create swapchain");
+ return false;
+ }
+
+ df->vkDeviceWaitIdle(dev);
+
+ if (!vkCreateSwapchainKHR) {
+ vkCreateSwapchainKHR = reinterpret_cast<PFN_vkCreateSwapchainKHR>(f->vkGetDeviceProcAddr(dev, "vkCreateSwapchainKHR"));
+ vkDestroySwapchainKHR = reinterpret_cast<PFN_vkDestroySwapchainKHR>(f->vkGetDeviceProcAddr(dev, "vkDestroySwapchainKHR"));
+ vkGetSwapchainImagesKHR = reinterpret_cast<PFN_vkGetSwapchainImagesKHR>(f->vkGetDeviceProcAddr(dev, "vkGetSwapchainImagesKHR"));
+ vkAcquireNextImageKHR = reinterpret_cast<PFN_vkAcquireNextImageKHR>(f->vkGetDeviceProcAddr(dev, "vkAcquireNextImageKHR"));
+ vkQueuePresentKHR = reinterpret_cast<PFN_vkQueuePresentKHR>(f->vkGetDeviceProcAddr(dev, "vkQueuePresentKHR"));
+ if (!vkCreateSwapchainKHR || !vkDestroySwapchainKHR || !vkGetSwapchainImagesKHR || !vkAcquireNextImageKHR || !vkQueuePresentKHR) {
+ qWarning("Swapchain functions not available");
+ return false;
+ }
+ }
+
+ VkSurfaceCapabilitiesKHR surfaceCaps;
+ vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDev, swapChainD->surface, &surfaceCaps);
+ quint32 reqBufferCount;
+ if (swapChainD->m_flags.testFlag(QRhiSwapChain::MinimalBufferCount)) {
+ reqBufferCount = qMax<quint32>(2, surfaceCaps.minImageCount);
+ } else {
+ const quint32 maxBuffers = QVkSwapChain::MAX_BUFFER_COUNT;
+ if (surfaceCaps.maxImageCount)
+ reqBufferCount = qMax(qMin(surfaceCaps.maxImageCount, maxBuffers), surfaceCaps.minImageCount);
+ else
+ reqBufferCount = qMax<quint32>(2, surfaceCaps.minImageCount);
+ }
+
+ VkSurfaceTransformFlagBitsKHR preTransform =
+ (surfaceCaps.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR)
+ ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR
+ : surfaceCaps.currentTransform;
+
+ VkCompositeAlphaFlagBitsKHR compositeAlpha =
+ (surfaceCaps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR)
+ ? VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
+ : VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
+
+ if (swapChainD->m_flags.testFlag(QRhiSwapChain::SurfaceHasPreMulAlpha)
+ && (surfaceCaps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR))
+ {
+ compositeAlpha = VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR;
+ }
+
+ if (swapChainD->m_flags.testFlag(QRhiSwapChain::SurfaceHasNonPreMulAlpha)
+ && (surfaceCaps.supportedCompositeAlpha & VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR))
+ {
+ compositeAlpha = VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR;
+ }
+
+ VkImageUsageFlags usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+ swapChainD->supportsReadback = (surfaceCaps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT);
+ if (swapChainD->supportsReadback && swapChainD->m_flags.testFlag(QRhiSwapChain::UsedAsTransferSource))
+ usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+
+ VkPresentModeKHR presentMode = VK_PRESENT_MODE_FIFO_KHR;
+ if (swapChainD->m_flags.testFlag(QRhiSwapChain::NoVSync)) {
+ if (swapChainD->supportedPresentationModes.contains(VK_PRESENT_MODE_MAILBOX_KHR))
+ presentMode = VK_PRESENT_MODE_MAILBOX_KHR;
+ else if (swapChainD->supportedPresentationModes.contains(VK_PRESENT_MODE_IMMEDIATE_KHR))
+ presentMode = VK_PRESENT_MODE_IMMEDIATE_KHR;
+ }
+
+ // If the surface is different than before, then passing in the old
+ // swapchain associated with the old surface can fail the swapchain
+ // creation. (for example, Android loses the surface when backgrounding and
+ // restoring applications, and it also enforces failing swapchain creation
+ // with VK_ERROR_NATIVE_WINDOW_IN_USE_KHR if the old swapchain is provided)
+ const bool reuseExisting = swapChainD->sc && swapChainD->lastConnectedSurface == swapChainD->surface;
+
+ qCDebug(QRHI_LOG_INFO, "Creating %s swapchain of %u buffers, size %dx%d, presentation mode %d",
+ reuseExisting ? "recycled" : "new",
+ reqBufferCount, swapChainD->pixelSize.width(), swapChainD->pixelSize.height(), presentMode);
+
+ VkSwapchainCreateInfoKHR swapChainInfo;
+ memset(&swapChainInfo, 0, sizeof(swapChainInfo));
+ swapChainInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
+ swapChainInfo.surface = swapChainD->surface;
+ swapChainInfo.minImageCount = reqBufferCount;
+ swapChainInfo.imageFormat = swapChainD->colorFormat;
+ swapChainInfo.imageColorSpace = swapChainD->colorSpace;
+ swapChainInfo.imageExtent = VkExtent2D { uint32_t(swapChainD->pixelSize.width()), uint32_t(swapChainD->pixelSize.height()) };
+ swapChainInfo.imageArrayLayers = 1;
+ swapChainInfo.imageUsage = usage;
+ swapChainInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
+ swapChainInfo.preTransform = preTransform;
+ swapChainInfo.compositeAlpha = compositeAlpha;
+ swapChainInfo.presentMode = presentMode;
+ swapChainInfo.clipped = true;
+ swapChainInfo.oldSwapchain = reuseExisting ? swapChainD->sc : VK_NULL_HANDLE;
+
+ VkSwapchainKHR newSwapChain;
+ VkResult err = vkCreateSwapchainKHR(dev, &swapChainInfo, nullptr, &newSwapChain);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create swapchain: %d", err);
+ return false;
+ }
+
+ if (swapChainD->sc)
+ releaseSwapChainResources(swapChain);
+
+ swapChainD->sc = newSwapChain;
+ swapChainD->lastConnectedSurface = swapChainD->surface;
+
+ quint32 actualSwapChainBufferCount = 0;
+ err = vkGetSwapchainImagesKHR(dev, swapChainD->sc, &actualSwapChainBufferCount, nullptr);
+ if (err != VK_SUCCESS || actualSwapChainBufferCount < 2) {
+ qWarning("Failed to get swapchain images: %d (count=%u)", err, actualSwapChainBufferCount);
+ return false;
+ }
+
+ if (actualSwapChainBufferCount > QVkSwapChain::MAX_BUFFER_COUNT) {
+ qWarning("Too many swapchain buffers (%u)", actualSwapChainBufferCount);
+ return false;
+ }
+ if (actualSwapChainBufferCount != reqBufferCount)
+ qCDebug(QRHI_LOG_INFO, "Actual swapchain buffer count is %u", actualSwapChainBufferCount);
+ swapChainD->bufferCount = int(actualSwapChainBufferCount);
+
+ VkImage swapChainImages[QVkSwapChain::MAX_BUFFER_COUNT];
+ err = vkGetSwapchainImagesKHR(dev, swapChainD->sc, &actualSwapChainBufferCount, swapChainImages);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to get swapchain images: %d", err);
+ return false;
+ }
+
+ VkImage msaaImages[QVkSwapChain::MAX_BUFFER_COUNT];
+ VkImageView msaaViews[QVkSwapChain::MAX_BUFFER_COUNT];
+ if (swapChainD->samples > VK_SAMPLE_COUNT_1_BIT) {
+ if (!createTransientImage(swapChainD->colorFormat,
+ swapChainD->pixelSize,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
+ VK_IMAGE_ASPECT_COLOR_BIT,
+ swapChainD->samples,
+ &swapChainD->msaaImageMem,
+ msaaImages,
+ msaaViews,
+ swapChainD->bufferCount))
+ {
+ qWarning("Failed to create transient image for MSAA color buffer");
+ return false;
+ }
+ }
+
+ VkFenceCreateInfo fenceInfo;
+ memset(&fenceInfo, 0, sizeof(fenceInfo));
+ fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
+ fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT;
+
+ for (int i = 0; i < swapChainD->bufferCount; ++i) {
+ QVkSwapChain::ImageResources &image(swapChainD->imageRes[i]);
+ image.image = swapChainImages[i];
+ if (swapChainD->samples > VK_SAMPLE_COUNT_1_BIT) {
+ image.msaaImage = msaaImages[i];
+ image.msaaImageView = msaaViews[i];
+ }
+
+ VkImageViewCreateInfo imgViewInfo;
+ memset(&imgViewInfo, 0, sizeof(imgViewInfo));
+ imgViewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
+ imgViewInfo.image = swapChainImages[i];
+ imgViewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
+ imgViewInfo.format = swapChainD->colorFormat;
+ imgViewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
+ imgViewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
+ imgViewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
+ imgViewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
+ imgViewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ imgViewInfo.subresourceRange.levelCount = imgViewInfo.subresourceRange.layerCount = 1;
+ err = df->vkCreateImageView(dev, &imgViewInfo, nullptr, &image.imageView);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create swapchain image view %d: %d", i, err);
+ return false;
+ }
+
+ image.lastUse = QVkSwapChain::ImageResources::ScImageUseNone;
+ }
+
+ swapChainD->currentImageIndex = 0;
+
+ VkSemaphoreCreateInfo semInfo;
+ memset(&semInfo, 0, sizeof(semInfo));
+ semInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
+
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ QVkSwapChain::FrameResources &frame(swapChainD->frameRes[i]);
+
+ frame.imageAcquired = false;
+ frame.imageSemWaitable = false;
+
+ df->vkCreateFence(dev, &fenceInfo, nullptr, &frame.imageFence);
+ frame.imageFenceWaitable = true; // fence was created in signaled state
+
+ df->vkCreateSemaphore(dev, &semInfo, nullptr, &frame.imageSem);
+ df->vkCreateSemaphore(dev, &semInfo, nullptr, &frame.drawSem);
+
+ err = df->vkCreateFence(dev, &fenceInfo, nullptr, &frame.cmdFence);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create command buffer fence: %d", err);
+ return false;
+ }
+ frame.cmdFenceWaitable = true; // fence was created in signaled state
+ }
+
+ swapChainD->currentFrameSlot = 0;
+
+ return true;
+}
+
+void QRhiVulkan::releaseSwapChainResources(QRhiSwapChain *swapChain)
+{
+ QVkSwapChain *swapChainD = QRHI_RES(QVkSwapChain, swapChain);
+
+ if (swapChainD->sc == VK_NULL_HANDLE)
+ return;
+
+ if (!deviceLost)
+ df->vkDeviceWaitIdle(dev);
+
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ QVkSwapChain::FrameResources &frame(swapChainD->frameRes[i]);
+ if (frame.cmdFence) {
+ if (frame.cmdFenceWaitable)
+ df->vkWaitForFences(dev, 1, &frame.cmdFence, VK_TRUE, UINT64_MAX);
+ df->vkDestroyFence(dev, frame.cmdFence, nullptr);
+ frame.cmdFence = VK_NULL_HANDLE;
+ frame.cmdFenceWaitable = false;
+ }
+ if (frame.imageFence) {
+ if (frame.imageFenceWaitable)
+ df->vkWaitForFences(dev, 1, &frame.imageFence, VK_TRUE, UINT64_MAX);
+ df->vkDestroyFence(dev, frame.imageFence, nullptr);
+ frame.imageFence = VK_NULL_HANDLE;
+ frame.imageFenceWaitable = false;
+ }
+ if (frame.imageSem) {
+ df->vkDestroySemaphore(dev, frame.imageSem, nullptr);
+ frame.imageSem = VK_NULL_HANDLE;
+ }
+ if (frame.drawSem) {
+ df->vkDestroySemaphore(dev, frame.drawSem, nullptr);
+ frame.drawSem = VK_NULL_HANDLE;
+ }
+ if (frame.cmdBuf) {
+ df->vkFreeCommandBuffers(dev, cmdPool, 1, &frame.cmdBuf);
+ frame.cmdBuf = VK_NULL_HANDLE;
+ }
+ }
+
+ for (int i = 0; i < swapChainD->bufferCount; ++i) {
+ QVkSwapChain::ImageResources &image(swapChainD->imageRes[i]);
+ if (image.fb) {
+ df->vkDestroyFramebuffer(dev, image.fb, nullptr);
+ image.fb = VK_NULL_HANDLE;
+ }
+ if (image.imageView) {
+ df->vkDestroyImageView(dev, image.imageView, nullptr);
+ image.imageView = VK_NULL_HANDLE;
+ }
+ if (image.msaaImageView) {
+ df->vkDestroyImageView(dev, image.msaaImageView, nullptr);
+ image.msaaImageView = VK_NULL_HANDLE;
+ }
+ if (image.msaaImage) {
+ df->vkDestroyImage(dev, image.msaaImage, nullptr);
+ image.msaaImage = VK_NULL_HANDLE;
+ }
+ }
+
+ if (swapChainD->msaaImageMem) {
+ df->vkFreeMemory(dev, swapChainD->msaaImageMem, nullptr);
+ swapChainD->msaaImageMem = VK_NULL_HANDLE;
+ }
+
+ vkDestroySwapchainKHR(dev, swapChainD->sc, nullptr);
+ swapChainD->sc = VK_NULL_HANDLE;
+
+ // NB! surface and similar must remain intact
+}
+
+QRhi::FrameOpResult QRhiVulkan::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags)
+{
+ QVkSwapChain *swapChainD = QRHI_RES(QVkSwapChain, swapChain);
+ QVkSwapChain::FrameResources &frame(swapChainD->frameRes[swapChainD->currentFrameSlot]);
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ if (!frame.imageAcquired) {
+ // Wait if we are too far ahead, i.e. the thread gets throttled based on the presentation rate
+ // (note that we are using FIFO mode -> vsync)
+ if (frame.imageFenceWaitable) {
+ df->vkWaitForFences(dev, 1, &frame.imageFence, VK_TRUE, UINT64_MAX);
+ df->vkResetFences(dev, 1, &frame.imageFence);
+ frame.imageFenceWaitable = false;
+ }
+
+ // move on to next swapchain image
+ VkResult err = vkAcquireNextImageKHR(dev, swapChainD->sc, UINT64_MAX,
+ frame.imageSem, frame.imageFence, &frame.imageIndex);
+ if (err == VK_SUCCESS || err == VK_SUBOPTIMAL_KHR) {
+ swapChainD->currentImageIndex = frame.imageIndex;
+ frame.imageSemWaitable = true;
+ frame.imageAcquired = true;
+ frame.imageFenceWaitable = true;
+ } else if (err == VK_ERROR_OUT_OF_DATE_KHR) {
+ return QRhi::FrameOpSwapChainOutOfDate;
+ } else {
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("Device loss detected in vkAcquireNextImageKHR()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ }
+ qWarning("Failed to acquire next swapchain image: %d", err);
+ return QRhi::FrameOpError;
+ }
+ }
+
+ // Make sure the previous commands for the same image have finished. (note
+ // that this is based on the fence from the command buffer submit, nothing
+ // to do with the Present)
+ //
+ // Do this also for any other swapchain's commands with the same frame slot
+ // While this reduces concurrency, it keeps resource usage safe: swapchain
+ // A starting its frame 0, followed by swapchain B starting its own frame 0
+ // will make B wait for A's frame 0 commands, so if a resource is written
+ // in B's frame or when B checks for pending resource releases, that won't
+ // mess up A's in-flight commands (as they are not in flight anymore).
+ waitCommandCompletion(int(swapChainD->currentFrameSlot));
+
+ // Now is the time to read the timestamps for the previous frame for this slot.
+ if (frame.timestampQueryIndex >= 0) {
+ quint64 timestamp[2] = { 0, 0 };
+ VkResult err = df->vkGetQueryPoolResults(dev, timestampQueryPool, uint32_t(frame.timestampQueryIndex), 2,
+ 2 * sizeof(quint64), timestamp, sizeof(quint64),
+ VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
+ timestampQueryPoolMap.clearBit(frame.timestampQueryIndex / 2);
+ frame.timestampQueryIndex = -1;
+ if (err == VK_SUCCESS) {
+ quint64 mask = 0;
+ for (quint64 i = 0; i < timestampValidBits; i += 8)
+ mask |= 0xFFULL << i;
+ const quint64 ts0 = timestamp[0] & mask;
+ const quint64 ts1 = timestamp[1] & mask;
+ const float nsecsPerTick = physDevProperties.limits.timestampPeriod;
+ if (!qFuzzyIsNull(nsecsPerTick)) {
+ const float elapsedMs = float(ts1 - ts0) * nsecsPerTick / 1000000.0f;
+ // now we have the gpu time for the previous frame for this slot, report it
+ // (does not matter that it is not for this frame)
+ QRHI_PROF_F(swapChainFrameGpuTime(swapChain, elapsedMs));
+ }
+ } else {
+ qWarning("Failed to query timestamp: %d", err);
+ }
+ }
+
+ // build new draw command buffer
+ QRhi::FrameOpResult cbres = startPrimaryCommandBuffer(&frame.cmdBuf);
+ if (cbres != QRhi::FrameOpSuccess)
+ return cbres;
+
+ // when profiling is enabled, pick a free query (pair) from the pool
+ int timestampQueryIdx = -1;
+ if (profilerPrivateOrNull()) {
+ for (int i = 0; i < timestampQueryPoolMap.count(); ++i) {
+ if (!timestampQueryPoolMap.testBit(i)) {
+ timestampQueryPoolMap.setBit(i);
+ timestampQueryIdx = i * 2;
+ break;
+ }
+ }
+ }
+ if (timestampQueryIdx >= 0) {
+ df->vkCmdResetQueryPool(frame.cmdBuf, timestampQueryPool, uint32_t(timestampQueryIdx), 2);
+ // record timestamp at the start of the command buffer
+ df->vkCmdWriteTimestamp(frame.cmdBuf, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+ timestampQueryPool, uint32_t(timestampQueryIdx));
+ frame.timestampQueryIndex = timestampQueryIdx;
+ }
+
+ swapChainD->cbWrapper.cb = frame.cmdBuf;
+ swapChainD->cbWrapper.useSecondaryCb = flags.testFlag(QRhi::ExternalContentsInPass);
+
+ QVkSwapChain::ImageResources &image(swapChainD->imageRes[swapChainD->currentImageIndex]);
+ swapChainD->rtWrapper.d.fb = image.fb;
+
+ currentFrameSlot = int(swapChainD->currentFrameSlot);
+ currentSwapChain = swapChainD;
+ if (swapChainD->ds)
+ swapChainD->ds->lastActiveFrameSlot = currentFrameSlot;
+
+ QRHI_PROF_F(beginSwapChainFrame(swapChain));
+
+ prepareNewFrame(&swapChainD->cbWrapper);
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiVulkan::endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags)
+{
+ QVkSwapChain *swapChainD = QRHI_RES(QVkSwapChain, swapChain);
+ Q_ASSERT(currentSwapChain == swapChainD);
+
+ recordPrimaryCommandBuffer(&swapChainD->cbWrapper);
+
+ QVkSwapChain::FrameResources &frame(swapChainD->frameRes[swapChainD->currentFrameSlot]);
+ QVkSwapChain::ImageResources &image(swapChainD->imageRes[swapChainD->currentImageIndex]);
+
+ if (image.lastUse != QVkSwapChain::ImageResources::ScImageUseRender) {
+ VkImageMemoryBarrier presTrans;
+ memset(&presTrans, 0, sizeof(presTrans));
+ presTrans.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ presTrans.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ presTrans.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+ presTrans.image = image.image;
+ presTrans.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ presTrans.subresourceRange.levelCount = presTrans.subresourceRange.layerCount = 1;
+
+ if (image.lastUse == QVkSwapChain::ImageResources::ScImageUseNone) {
+ // was not used at all (no render pass), just transition from undefined to presentable
+ presTrans.srcAccessMask = 0;
+ presTrans.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ df->vkCmdPipelineBarrier(frame.cmdBuf,
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &presTrans);
+ } else if (image.lastUse == QVkSwapChain::ImageResources::ScImageUseTransferSource) {
+ // was used in a readback as transfer source, go back to presentable layout
+ presTrans.srcAccessMask = VK_ACCESS_TRANSFER_READ_BIT;
+ presTrans.oldLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+ df->vkCmdPipelineBarrier(frame.cmdBuf,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &presTrans);
+ }
+ image.lastUse = QVkSwapChain::ImageResources::ScImageUseRender;
+ }
+
+ // record another timestamp, when enabled
+ if (frame.timestampQueryIndex >= 0) {
+ df->vkCmdWriteTimestamp(frame.cmdBuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
+ timestampQueryPool, uint32_t(frame.timestampQueryIndex + 1));
+ }
+
+ // stop recording and submit to the queue
+ Q_ASSERT(!frame.cmdFenceWaitable);
+ const bool needsPresent = !flags.testFlag(QRhi::SkipPresent);
+ QRhi::FrameOpResult submitres = endAndSubmitPrimaryCommandBuffer(frame.cmdBuf,
+ frame.cmdFence,
+ frame.imageSemWaitable ? &frame.imageSem : nullptr,
+ needsPresent ? &frame.drawSem : nullptr);
+ if (submitres != QRhi::FrameOpSuccess)
+ return submitres;
+
+ frame.imageSemWaitable = false;
+ frame.cmdFenceWaitable = true;
+
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ // this must be done before the Present
+ QRHI_PROF_F(endSwapChainFrame(swapChain, swapChainD->frameCount + 1));
+
+ if (needsPresent) {
+ // add the Present to the queue
+ VkPresentInfoKHR presInfo;
+ memset(&presInfo, 0, sizeof(presInfo));
+ presInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
+ presInfo.swapchainCount = 1;
+ presInfo.pSwapchains = &swapChainD->sc;
+ presInfo.pImageIndices = &swapChainD->currentImageIndex;
+ presInfo.waitSemaphoreCount = 1;
+ presInfo.pWaitSemaphores = &frame.drawSem; // gfxQueueFamilyIdx == presQueueFamilyIdx ? &frame.drawSem : &frame.presTransSem;
+
+ VkResult err = vkQueuePresentKHR(gfxQueue, &presInfo);
+ if (err != VK_SUCCESS) {
+ if (err == VK_ERROR_OUT_OF_DATE_KHR) {
+ return QRhi::FrameOpSwapChainOutOfDate;
+ } else if (err != VK_SUBOPTIMAL_KHR) {
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("Device loss detected in vkQueuePresentKHR()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ }
+ qWarning("Failed to present: %d", err);
+ return QRhi::FrameOpError;
+ }
+ }
+
+ // Do platform-specific WM notification. F.ex. essential on X11 in
+ // order to prevent glitches on resizing the window.
+ inst->presentQueued(swapChainD->window);
+
+ // mark the current swapchain buffer as unused from our side
+ frame.imageAcquired = false;
+ // and move on to the next buffer
+ swapChainD->currentFrameSlot = (swapChainD->currentFrameSlot + 1) % QVK_FRAMES_IN_FLIGHT;
+ }
+
+ swapChainD->frameCount += 1;
+ currentSwapChain = nullptr;
+ return QRhi::FrameOpSuccess;
+}
+
+void QRhiVulkan::prepareNewFrame(QRhiCommandBuffer *cb)
+{
+ // Now is the time to do things for frame N-F, where N is the current one,
+ // F is QVK_FRAMES_IN_FLIGHT, because only here it is guaranteed that that
+ // frame has completed on the GPU (due to the fence wait in beginFrame). To
+ // decide if something is safe to handle now a simple "lastActiveFrameSlot
+ // == currentFrameSlot" is sufficient (remember that e.g. with F==2
+ // currentFrameSlot goes 0, 1, 0, 1, 0, ...)
+ //
+ // With multiple swapchains on the same QRhi things get more convoluted
+ // (and currentFrameSlot strictly alternating is not true anymore) but
+ // beginNonWrapperFrame() solves that by blocking as necessary so the rest
+ // here is safe regardless.
+
+ executeDeferredReleases();
+
+ QRHI_RES(QVkCommandBuffer, cb)->resetState();
+
+ finishActiveReadbacks(); // last, in case the readback-completed callback issues rhi calls
+}
+
+QRhi::FrameOpResult QRhiVulkan::startPrimaryCommandBuffer(VkCommandBuffer *cb)
+{
+ if (*cb) {
+ df->vkFreeCommandBuffers(dev, cmdPool, 1, cb);
+ *cb = VK_NULL_HANDLE;
+ }
+
+ VkCommandBufferAllocateInfo cmdBufInfo;
+ memset(&cmdBufInfo, 0, sizeof(cmdBufInfo));
+ cmdBufInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
+ cmdBufInfo.commandPool = cmdPool;
+ cmdBufInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
+ cmdBufInfo.commandBufferCount = 1;
+
+ VkResult err = df->vkAllocateCommandBuffers(dev, &cmdBufInfo, cb);
+ if (err != VK_SUCCESS) {
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("Device loss detected in vkAllocateCommandBuffers()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ }
+ qWarning("Failed to allocate frame command buffer: %d", err);
+ return QRhi::FrameOpError;
+ }
+
+ VkCommandBufferBeginInfo cmdBufBeginInfo;
+ memset(&cmdBufBeginInfo, 0, sizeof(cmdBufBeginInfo));
+ cmdBufBeginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
+
+ err = df->vkBeginCommandBuffer(*cb, &cmdBufBeginInfo);
+ if (err != VK_SUCCESS) {
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("Device loss detected in vkBeginCommandBuffer()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ }
+ qWarning("Failed to begin frame command buffer: %d", err);
+ return QRhi::FrameOpError;
+ }
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiVulkan::endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
+ VkSemaphore *waitSem, VkSemaphore *signalSem)
+{
+ VkResult err = df->vkEndCommandBuffer(cb);
+ if (err != VK_SUCCESS) {
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("Device loss detected in vkEndCommandBuffer()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ }
+ qWarning("Failed to end frame command buffer: %d", err);
+ return QRhi::FrameOpError;
+ }
+
+ VkSubmitInfo submitInfo;
+ memset(&submitInfo, 0, sizeof(submitInfo));
+ submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
+ submitInfo.commandBufferCount = 1;
+ submitInfo.pCommandBuffers = &cb;
+ if (waitSem) {
+ submitInfo.waitSemaphoreCount = 1;
+ submitInfo.pWaitSemaphores = waitSem;
+ }
+ if (signalSem) {
+ submitInfo.signalSemaphoreCount = 1;
+ submitInfo.pSignalSemaphores = signalSem;
+ }
+ VkPipelineStageFlags psf = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+ submitInfo.pWaitDstStageMask = &psf;
+
+ err = df->vkQueueSubmit(gfxQueue, 1, &submitInfo, cmdFence);
+ if (err != VK_SUCCESS) {
+ if (err == VK_ERROR_DEVICE_LOST) {
+ qWarning("Device loss detected in vkQueueSubmit()");
+ deviceLost = true;
+ return QRhi::FrameOpDeviceLost;
+ }
+ qWarning("Failed to submit to graphics queue: %d", err);
+ return QRhi::FrameOpError;
+ }
+
+ return QRhi::FrameOpSuccess;
+}
+
+void QRhiVulkan::waitCommandCompletion(int frameSlot)
+{
+ for (QVkSwapChain *sc : qAsConst(swapchains)) {
+ QVkSwapChain::FrameResources &frame(sc->frameRes[frameSlot]);
+ if (frame.cmdFenceWaitable) {
+ df->vkWaitForFences(dev, 1, &frame.cmdFence, VK_TRUE, UINT64_MAX);
+ df->vkResetFences(dev, 1, &frame.cmdFence);
+ frame.cmdFenceWaitable = false;
+ }
+ }
+}
+
+QRhi::FrameOpResult QRhiVulkan::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags)
+{
+ QRhi::FrameOpResult cbres = startPrimaryCommandBuffer(&ofr.cbWrapper.cb);
+ if (cbres != QRhi::FrameOpSuccess)
+ return cbres;
+
+ // Switch to the next slot manually. Swapchains do not know about this
+ // which is good. So for example a - unusual but possible - onscreen,
+ // onscreen, offscreen, onscreen, onscreen, onscreen sequence of
+ // begin/endFrame leads to 0, 1, 0, 0, 1, 0. This works because the
+ // offscreen frame is synchronous in the sense that we wait for execution
+ // to complete in endFrame, and so no resources used in that frame are busy
+ // anymore in the next frame.
+ currentFrameSlot = (currentFrameSlot + 1) % QVK_FRAMES_IN_FLIGHT;
+ // except that this gets complicated with multiple swapchains so make sure
+ // any pending commands have finished for the frame slot we are going to use
+ if (swapchains.count() > 1)
+ waitCommandCompletion(currentFrameSlot);
+
+ ofr.cbWrapper.useSecondaryCb = flags.testFlag(QRhi::ExternalContentsInPass);
+
+ prepareNewFrame(&ofr.cbWrapper);
+ ofr.active = true;
+
+ *cb = &ofr.cbWrapper;
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiVulkan::endOffscreenFrame(QRhi::EndFrameFlags flags)
+{
+ Q_UNUSED(flags);
+ Q_ASSERT(ofr.active);
+ ofr.active = false;
+
+ recordPrimaryCommandBuffer(&ofr.cbWrapper);
+
+ if (!ofr.cmdFence) {
+ VkFenceCreateInfo fenceInfo;
+ memset(&fenceInfo, 0, sizeof(fenceInfo));
+ fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
+ VkResult err = df->vkCreateFence(dev, &fenceInfo, nullptr, &ofr.cmdFence);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create command buffer fence: %d", err);
+ return QRhi::FrameOpError;
+ }
+ }
+
+ QRhi::FrameOpResult submitres = endAndSubmitPrimaryCommandBuffer(ofr.cbWrapper.cb, ofr.cmdFence, nullptr, nullptr);
+ if (submitres != QRhi::FrameOpSuccess)
+ return submitres;
+
+ // wait for completion
+ df->vkWaitForFences(dev, 1, &ofr.cmdFence, VK_TRUE, UINT64_MAX);
+ df->vkResetFences(dev, 1, &ofr.cmdFence);
+
+ // Here we know that executing the host-side reads for this (or any
+ // previous) frame is safe since we waited for completion above.
+ finishActiveReadbacks(true);
+
+ return QRhi::FrameOpSuccess;
+}
+
+QRhi::FrameOpResult QRhiVulkan::finish()
+{
+ QVkSwapChain *swapChainD = nullptr;
+ if (inFrame) {
+ // There is either a swapchain or an offscreen frame on-going.
+ // End command recording and submit what we have.
+ VkCommandBuffer cb;
+ if (ofr.active) {
+ Q_ASSERT(!currentSwapChain);
+ Q_ASSERT(ofr.cbWrapper.recordingPass == QVkCommandBuffer::NoPass);
+ recordPrimaryCommandBuffer(&ofr.cbWrapper);
+ ofr.cbWrapper.resetCommands();
+ cb = ofr.cbWrapper.cb;
+ } else {
+ Q_ASSERT(currentSwapChain);
+ Q_ASSERT(currentSwapChain->cbWrapper.recordingPass == QVkCommandBuffer::NoPass);
+ swapChainD = currentSwapChain;
+ recordPrimaryCommandBuffer(&swapChainD->cbWrapper);
+ swapChainD->cbWrapper.resetCommands();
+ cb = swapChainD->cbWrapper.cb;
+ }
+ QRhi::FrameOpResult submitres = endAndSubmitPrimaryCommandBuffer(cb, VK_NULL_HANDLE, nullptr, nullptr);
+ if (submitres != QRhi::FrameOpSuccess)
+ return submitres;
+ }
+
+ df->vkQueueWaitIdle(gfxQueue);
+
+ if (inFrame) {
+ // Allocate and begin recording on a new command buffer.
+ if (ofr.active)
+ startPrimaryCommandBuffer(&ofr.cbWrapper.cb);
+ else
+ startPrimaryCommandBuffer(&swapChainD->frameRes[swapChainD->currentFrameSlot].cmdBuf);
+ }
+
+ executeDeferredReleases(true);
+ finishActiveReadbacks(true);
+
+ return QRhi::FrameOpSuccess;
+}
+
+static inline QRhiPassResourceTracker::UsageState toPassTrackerUsageState(const QVkBuffer::UsageState &bufUsage)
+{
+ QRhiPassResourceTracker::UsageState u;
+ u.layout = 0; // unused with buffers
+ u.access = int(bufUsage.access);
+ u.stage = int(bufUsage.stage);
+ return u;
+}
+
+static inline QRhiPassResourceTracker::UsageState toPassTrackerUsageState(const QVkTexture::UsageState &texUsage)
+{
+ QRhiPassResourceTracker::UsageState u;
+ u.layout = texUsage.layout;
+ u.access = int(texUsage.access);
+ u.stage = int(texUsage.stage);
+ return u;
+}
+
+void QRhiVulkan::activateTextureRenderTarget(QVkCommandBuffer *cbD, QVkTextureRenderTarget *rtD)
+{
+ rtD->lastActiveFrameSlot = currentFrameSlot;
+ rtD->d.rp->lastActiveFrameSlot = currentFrameSlot;
+ QRhiPassResourceTracker &passResTracker(cbD->passResTrackers[cbD->currentPassResTrackerIndex]);
+ for (auto it = rtD->m_desc.cbeginColorAttachments(), itEnd = rtD->m_desc.cendColorAttachments(); it != itEnd; ++it) {
+ QVkTexture *texD = QRHI_RES(QVkTexture, it->texture());
+ QVkTexture *resolveTexD = QRHI_RES(QVkTexture, it->resolveTexture());
+ QVkRenderBuffer *rbD = QRHI_RES(QVkRenderBuffer, it->renderBuffer());
+ if (texD) {
+ trackedRegisterTexture(&passResTracker, texD,
+ QRhiPassResourceTracker::TexColorOutput,
+ QRhiPassResourceTracker::TexColorOutputStage);
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ } else if (rbD) {
+ // Won't register rbD->backingTexture because it cannot be used for
+ // anything in a renderpass, its use makes only sense in
+ // combination with a resolveTexture.
+ rbD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ if (resolveTexD) {
+ trackedRegisterTexture(&passResTracker, resolveTexD,
+ QRhiPassResourceTracker::TexColorOutput,
+ QRhiPassResourceTracker::TexColorOutputStage);
+ resolveTexD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ }
+ if (rtD->m_desc.depthStencilBuffer())
+ QRHI_RES(QVkRenderBuffer, rtD->m_desc.depthStencilBuffer())->lastActiveFrameSlot = currentFrameSlot;
+ if (rtD->m_desc.depthTexture()) {
+ QVkTexture *depthTexD = QRHI_RES(QVkTexture, rtD->m_desc.depthTexture());
+ trackedRegisterTexture(&passResTracker, depthTexD,
+ QRhiPassResourceTracker::TexDepthOutput,
+ QRhiPassResourceTracker::TexDepthOutputStage);
+ depthTexD->lastActiveFrameSlot = currentFrameSlot;
+ }
+}
+
+void QRhiVulkan::resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+
+ enqueueResourceUpdates(cbD, resourceUpdates);
+}
+
+VkCommandBuffer QRhiVulkan::startSecondaryCommandBuffer(QVkRenderTargetData *rtD)
+{
+ VkCommandBuffer secondaryCb;
+
+ VkCommandBufferAllocateInfo cmdBufInfo;
+ memset(&cmdBufInfo, 0, sizeof(cmdBufInfo));
+ cmdBufInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
+ cmdBufInfo.commandPool = cmdPool;
+ cmdBufInfo.level = VK_COMMAND_BUFFER_LEVEL_SECONDARY;
+ cmdBufInfo.commandBufferCount = 1;
+ VkResult err = df->vkAllocateCommandBuffers(dev, &cmdBufInfo, &secondaryCb);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create secondary command buffer: %d", err);
+ return VK_NULL_HANDLE;
+ }
+
+ VkCommandBufferBeginInfo cmdBufBeginInfo;
+ memset(&cmdBufBeginInfo, 0, sizeof(cmdBufBeginInfo));
+ cmdBufBeginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
+ cmdBufBeginInfo.flags = rtD ? VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT : 0;
+ VkCommandBufferInheritanceInfo cmdBufInheritInfo;
+ memset(&cmdBufInheritInfo, 0, sizeof(cmdBufInheritInfo));
+ cmdBufInheritInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO;
+ cmdBufInheritInfo.subpass = 0;
+ if (rtD) {
+ cmdBufInheritInfo.renderPass = rtD->rp->rp;
+ cmdBufInheritInfo.framebuffer = rtD->fb;
+ }
+ cmdBufBeginInfo.pInheritanceInfo = &cmdBufInheritInfo;
+
+ err = df->vkBeginCommandBuffer(secondaryCb, &cmdBufBeginInfo);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to begin secondary command buffer: %d", err);
+ df->vkFreeCommandBuffers(dev, cmdPool, 1, &secondaryCb);
+ return VK_NULL_HANDLE;
+ }
+
+ return secondaryCb;
+}
+
+void QRhiVulkan::endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD)
+{
+ VkResult err = df->vkEndCommandBuffer(cb);
+ if (err != VK_SUCCESS)
+ qWarning("Failed to end secondary command buffer: %d", err);
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::ExecuteSecondary;
+ cmd.args.executeSecondary.cb = cb;
+ cbD->commands.append(cmd);
+
+ deferredReleaseSecondaryCommandBuffer(cb);
+}
+
+void QRhiVulkan::deferredReleaseSecondaryCommandBuffer(VkCommandBuffer cb)
+{
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::CommandBuffer;
+ e.lastActiveFrameSlot = currentFrameSlot;
+ e.commandBuffer.cb = cb;
+ releaseQueue.append(e);
+}
+
+void QRhiVulkan::beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cbD, resourceUpdates);
+
+ // Insert a TransitionPassResources into the command stream, pointing to
+ // the tracker this pass is going to use. That's how we generate the
+ // barriers later during recording the real VkCommandBuffer, right before
+ // the vkCmdBeginRenderPass.
+ enqueueTransitionPassResources(cbD);
+
+ QVkRenderTargetData *rtD = nullptr;
+ switch (rt->resourceType()) {
+ case QRhiResource::RenderTarget:
+ rtD = &QRHI_RES(QVkReferenceRenderTarget, rt)->d;
+ rtD->rp->lastActiveFrameSlot = currentFrameSlot;
+ Q_ASSERT(currentSwapChain);
+ currentSwapChain->imageRes[currentSwapChain->currentImageIndex].lastUse =
+ QVkSwapChain::ImageResources::ScImageUseRender;
+ break;
+ case QRhiResource::TextureRenderTarget:
+ {
+ QVkTextureRenderTarget *rtTex = QRHI_RES(QVkTextureRenderTarget, rt);
+ rtD = &rtTex->d;
+ activateTextureRenderTarget(cbD, rtTex);
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ cbD->recordingPass = QVkCommandBuffer::RenderPass;
+ cbD->currentTarget = rt;
+
+ // No copy operations or image layout transitions allowed after this point
+ // (up until endPass) as we are going to begin the renderpass.
+
+ VkRenderPassBeginInfo rpBeginInfo;
+ memset(&rpBeginInfo, 0, sizeof(rpBeginInfo));
+ rpBeginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
+ rpBeginInfo.renderPass = rtD->rp->rp;
+ rpBeginInfo.framebuffer = rtD->fb;
+ rpBeginInfo.renderArea.extent.width = uint32_t(rtD->pixelSize.width());
+ rpBeginInfo.renderArea.extent.height = uint32_t(rtD->pixelSize.height());
+
+ QVarLengthArray<VkClearValue, 4> cvs;
+ for (int i = 0; i < rtD->colorAttCount; ++i) {
+ VkClearValue cv;
+ cv.color = { { float(colorClearValue.redF()), float(colorClearValue.greenF()), float(colorClearValue.blueF()),
+ float(colorClearValue.alphaF()) } };
+ cvs.append(cv);
+ }
+ for (int i = 0; i < rtD->dsAttCount; ++i) {
+ VkClearValue cv;
+ cv.depthStencil = { depthStencilClearValue.depthClearValue(), depthStencilClearValue.stencilClearValue() };
+ cvs.append(cv);
+ }
+ for (int i = 0; i < rtD->resolveAttCount; ++i) {
+ VkClearValue cv;
+ cv.color = { { float(colorClearValue.redF()), float(colorClearValue.greenF()), float(colorClearValue.blueF()),
+ float(colorClearValue.alphaF()) } };
+ cvs.append(cv);
+ }
+ rpBeginInfo.clearValueCount = uint32_t(cvs.count());
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BeginRenderPass;
+ cmd.args.beginRenderPass.desc = rpBeginInfo;
+ cmd.args.beginRenderPass.clearValueIndex = cbD->pools.clearValue.count();
+ cbD->pools.clearValue.append(cvs.constData(), cvs.count());
+ cbD->commands.append(cmd);
+
+ if (cbD->useSecondaryCb)
+ cbD->secondaryCbs.append(startSecondaryCommandBuffer(rtD));
+}
+
+void QRhiVulkan::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+
+ if (cbD->useSecondaryCb) {
+ VkCommandBuffer secondaryCb = cbD->secondaryCbs.last();
+ cbD->secondaryCbs.removeLast();
+ endAndEnqueueSecondaryCommandBuffer(secondaryCb, cbD);
+ cbD->resetCachedState();
+ }
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::EndRenderPass;
+ cbD->commands.append(cmd);
+
+ cbD->recordingPass = QVkCommandBuffer::NoPass;
+ cbD->currentTarget = nullptr;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cbD, resourceUpdates);
+}
+
+void QRhiVulkan::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cbD, resourceUpdates);
+
+ enqueueTransitionPassResources(cbD);
+
+ cbD->recordingPass = QVkCommandBuffer::ComputePass;
+
+ if (cbD->useSecondaryCb)
+ cbD->secondaryCbs.append(startSecondaryCommandBuffer());
+}
+
+void QRhiVulkan::endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::ComputePass);
+
+ if (cbD->useSecondaryCb) {
+ VkCommandBuffer secondaryCb = cbD->secondaryCbs.last();
+ cbD->secondaryCbs.removeLast();
+ endAndEnqueueSecondaryCommandBuffer(secondaryCb, cbD);
+ cbD->resetCachedState();
+ }
+
+ cbD->recordingPass = QVkCommandBuffer::NoPass;
+
+ if (resourceUpdates)
+ enqueueResourceUpdates(cbD, resourceUpdates);
+}
+
+void QRhiVulkan::setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps)
+{
+ QVkComputePipeline *psD = QRHI_RES(QVkComputePipeline, ps);
+ Q_ASSERT(psD->pipeline);
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::ComputePass);
+
+ if (cbD->currentComputePipeline != ps || cbD->currentPipelineGeneration != psD->generation) {
+ if (cbD->useSecondaryCb) {
+ df->vkCmdBindPipeline(cbD->secondaryCbs.last(), VK_PIPELINE_BIND_POINT_COMPUTE, psD->pipeline);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BindPipeline;
+ cmd.args.bindPipeline.bindPoint = VK_PIPELINE_BIND_POINT_COMPUTE;
+ cmd.args.bindPipeline.pipeline = psD->pipeline;
+ cbD->commands.append(cmd);
+ }
+
+ cbD->currentGraphicsPipeline = nullptr;
+ cbD->currentComputePipeline = ps;
+ cbD->currentPipelineGeneration = psD->generation;
+ }
+
+ psD->lastActiveFrameSlot = currentFrameSlot;
+}
+
+void QRhiVulkan::dispatch(QRhiCommandBuffer *cb, int x, int y, int z)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::ComputePass);
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdDispatch(cbD->secondaryCbs.last(), uint32_t(x), uint32_t(y), uint32_t(z));
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::Dispatch;
+ cmd.args.dispatch.x = x;
+ cmd.args.dispatch.y = y;
+ cmd.args.dispatch.z = z;
+ cbD->commands.append(cmd);
+ }
+}
+
+VkShaderModule QRhiVulkan::createShader(const QByteArray &spirv)
+{
+ VkShaderModuleCreateInfo shaderInfo;
+ memset(&shaderInfo, 0, sizeof(shaderInfo));
+ shaderInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
+ shaderInfo.codeSize = size_t(spirv.size());
+ shaderInfo.pCode = reinterpret_cast<const quint32 *>(spirv.constData());
+ VkShaderModule shaderModule;
+ VkResult err = df->vkCreateShaderModule(dev, &shaderInfo, nullptr, &shaderModule);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create shader module: %d", err);
+ return VK_NULL_HANDLE;
+ }
+ return shaderModule;
+}
+
+bool QRhiVulkan::ensurePipelineCache()
+{
+ if (pipelineCache)
+ return true;
+
+ VkPipelineCacheCreateInfo pipelineCacheInfo;
+ memset(&pipelineCacheInfo, 0, sizeof(pipelineCacheInfo));
+ pipelineCacheInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO;
+ VkResult err = df->vkCreatePipelineCache(dev, &pipelineCacheInfo, nullptr, &pipelineCache);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create pipeline cache: %d", err);
+ return false;
+ }
+ return true;
+}
+
+void QRhiVulkan::updateShaderResourceBindings(QRhiShaderResourceBindings *srb, int descSetIdx)
+{
+ QVkShaderResourceBindings *srbD = QRHI_RES(QVkShaderResourceBindings, srb);
+
+ QVarLengthArray<VkDescriptorBufferInfo, 4> bufferInfos;
+ QVarLengthArray<VkDescriptorImageInfo, 4> imageInfos;
+ QVarLengthArray<VkWriteDescriptorSet, 8> writeInfos;
+
+ const bool updateAll = descSetIdx < 0;
+ int frameSlot = updateAll ? 0 : descSetIdx;
+ while (frameSlot < (updateAll ? QVK_FRAMES_IN_FLIGHT : descSetIdx + 1)) {
+ srbD->boundResourceData[frameSlot].resize(srbD->sortedBindings.count());
+ for (int i = 0, ie = srbD->sortedBindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->sortedBindings.at(i).data();
+ QVkShaderResourceBindings::BoundResourceData &bd(srbD->boundResourceData[frameSlot][i]);
+
+ VkWriteDescriptorSet writeInfo;
+ memset(&writeInfo, 0, sizeof(writeInfo));
+ writeInfo.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
+ writeInfo.dstSet = srbD->descSets[frameSlot];
+ writeInfo.dstBinding = uint32_t(b->binding);
+ writeInfo.descriptorCount = 1;
+
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ writeInfo.descriptorType = b->u.ubuf.hasDynamicOffset ? VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
+ : VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
+ QRhiBuffer *buf = b->u.ubuf.buf;
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, buf);
+ bd.ubuf.id = bufD->m_id;
+ bd.ubuf.generation = bufD->generation;
+ VkDescriptorBufferInfo bufInfo;
+ bufInfo.buffer = bufD->m_type == QRhiBuffer::Dynamic ? bufD->buffers[frameSlot] : bufD->buffers[0];
+ bufInfo.offset = VkDeviceSize(b->u.ubuf.offset);
+ bufInfo.range = VkDeviceSize(b->u.ubuf.maybeSize ? b->u.ubuf.maybeSize : bufD->m_size);
+ // be nice and assert when we know the vulkan device would die a horrible death due to non-aligned reads
+ Q_ASSERT(aligned(bufInfo.offset, ubufAlign) == bufInfo.offset);
+ bufferInfos.append(bufInfo);
+ writeInfo.pBufferInfo = &bufferInfos.last();
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QVkTexture *texD = QRHI_RES(QVkTexture, b->u.stex.tex);
+ QVkSampler *samplerD = QRHI_RES(QVkSampler, b->u.stex.sampler);
+ writeInfo.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
+ bd.stex.texId = texD->m_id;
+ bd.stex.texGeneration = texD->generation;
+ bd.stex.samplerId = samplerD->m_id;
+ bd.stex.samplerGeneration = samplerD->generation;
+ VkDescriptorImageInfo imageInfo;
+ imageInfo.sampler = samplerD->sampler;
+ imageInfo.imageView = texD->imageView;
+ imageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
+ imageInfos.append(imageInfo);
+ writeInfo.pImageInfo = &imageInfos.last();
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QVkTexture *texD = QRHI_RES(QVkTexture, b->u.simage.tex);
+ VkImageView view = texD->imageViewForLevel(b->u.simage.level);
+ if (view) {
+ writeInfo.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
+ bd.simage.id = texD->m_id;
+ bd.simage.generation = texD->generation;
+ VkDescriptorImageInfo imageInfo;
+ imageInfo.sampler = VK_NULL_HANDLE;
+ imageInfo.imageView = view;
+ imageInfo.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
+ imageInfos.append(imageInfo);
+ writeInfo.pImageInfo = &imageInfos.last();
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, b->u.sbuf.buf);
+ writeInfo.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
+ bd.sbuf.id = bufD->m_id;
+ bd.sbuf.generation = bufD->generation;
+ VkDescriptorBufferInfo bufInfo;
+ bufInfo.buffer = bufD->m_type == QRhiBuffer::Dynamic ? bufD->buffers[frameSlot] : bufD->buffers[0];
+ bufInfo.offset = VkDeviceSize(b->u.ubuf.offset);
+ bufInfo.range = VkDeviceSize(b->u.ubuf.maybeSize ? b->u.ubuf.maybeSize : bufD->m_size);
+ bufferInfos.append(bufInfo);
+ writeInfo.pBufferInfo = &bufferInfos.last();
+ }
+ break;
+ default:
+ continue;
+ }
+
+ writeInfos.append(writeInfo);
+ }
+ ++frameSlot;
+ }
+
+ df->vkUpdateDescriptorSets(dev, uint32_t(writeInfos.count()), writeInfos.constData(), 0, nullptr);
+}
+
+static inline bool accessIsWrite(VkAccessFlags access)
+{
+ return (access & VK_ACCESS_SHADER_WRITE_BIT) != 0
+ || (access & VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT) != 0
+ || (access & VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT) != 0
+ || (access & VK_ACCESS_TRANSFER_WRITE_BIT) != 0
+ || (access & VK_ACCESS_HOST_WRITE_BIT) != 0
+ || (access & VK_ACCESS_MEMORY_WRITE_BIT) != 0;
+}
+
+void QRhiVulkan::trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
+ VkAccessFlags access, VkPipelineStageFlags stage)
+{
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+ Q_ASSERT(access && stage);
+ QVkBuffer::UsageState &s(bufD->usageState[slot]);
+ if (!s.stage) {
+ s.access = access;
+ s.stage = stage;
+ return;
+ }
+
+ if (s.access == access && s.stage == stage) {
+ // No need to flood with unnecessary read-after-read barriers.
+ // Write-after-write is a different matter, however.
+ if (!accessIsWrite(access))
+ return;
+ }
+
+ VkBufferMemoryBarrier bufMemBarrier;
+ memset(&bufMemBarrier, 0, sizeof(bufMemBarrier));
+ bufMemBarrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
+ bufMemBarrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ bufMemBarrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ bufMemBarrier.srcAccessMask = s.access;
+ bufMemBarrier.dstAccessMask = access;
+ bufMemBarrier.buffer = bufD->buffers[slot];
+ bufMemBarrier.size = VK_WHOLE_SIZE;
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BufferBarrier;
+ cmd.args.bufferBarrier.srcStageMask = s.stage;
+ cmd.args.bufferBarrier.dstStageMask = stage;
+ cmd.args.bufferBarrier.desc = bufMemBarrier;
+ cbD->commands.append(cmd);
+
+ s.access = access;
+ s.stage = stage;
+}
+
+void QRhiVulkan::trackedImageBarrier(QVkCommandBuffer *cbD, QVkTexture *texD,
+ VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage)
+{
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+ Q_ASSERT(layout && access && stage);
+ QVkTexture::UsageState &s(texD->usageState);
+ if (s.access == access && s.stage == stage && s.layout == layout) {
+ if (!accessIsWrite(access))
+ return;
+ }
+
+ VkImageMemoryBarrier barrier;
+ memset(&barrier, 0, sizeof(barrier));
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.subresourceRange.aspectMask = !isDepthTextureFormat(texD->m_format)
+ ? VK_IMAGE_ASPECT_COLOR_BIT : VK_IMAGE_ASPECT_DEPTH_BIT;
+ barrier.subresourceRange.baseMipLevel = 0;
+ barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
+ barrier.subresourceRange.baseArrayLayer = 0;
+ barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+ barrier.oldLayout = s.layout; // new textures have this set to PREINITIALIZED
+ barrier.newLayout = layout;
+ barrier.srcAccessMask = s.access; // may be 0 but that's fine
+ barrier.dstAccessMask = access;
+ barrier.image = texD->image;
+
+ VkPipelineStageFlags srcStage = s.stage;
+ // stage mask cannot be 0
+ if (!srcStage)
+ srcStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::ImageBarrier;
+ cmd.args.imageBarrier.srcStageMask = srcStage;
+ cmd.args.imageBarrier.dstStageMask = stage;
+ cmd.args.imageBarrier.desc = barrier;
+ cbD->commands.append(cmd);
+
+ s.layout = layout;
+ s.access = access;
+ s.stage = stage;
+}
+
+void QRhiVulkan::subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
+ VkImageLayout oldLayout, VkImageLayout newLayout,
+ VkAccessFlags srcAccess, VkAccessFlags dstAccess,
+ VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
+ int startLayer, int layerCount,
+ int startLevel, int levelCount)
+{
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+ VkImageMemoryBarrier barrier;
+ memset(&barrier, 0, sizeof(barrier));
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ barrier.subresourceRange.baseMipLevel = uint32_t(startLevel);
+ barrier.subresourceRange.levelCount = uint32_t(levelCount);
+ barrier.subresourceRange.baseArrayLayer = uint32_t(startLayer);
+ barrier.subresourceRange.layerCount = uint32_t(layerCount);
+ barrier.oldLayout = oldLayout;
+ barrier.newLayout = newLayout;
+ barrier.srcAccessMask = srcAccess;
+ barrier.dstAccessMask = dstAccess;
+ barrier.image = image;
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::ImageBarrier;
+ cmd.args.imageBarrier.srcStageMask = srcStage;
+ cmd.args.imageBarrier.dstStageMask = dstStage;
+ cmd.args.imageBarrier.desc = barrier;
+ cbD->commands.append(cmd);
+}
+
+VkDeviceSize QRhiVulkan::subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const
+{
+ VkDeviceSize size = 0;
+ const qsizetype imageSizeBytes = subresDesc.image().isNull() ?
+ subresDesc.data().size() : subresDesc.image().sizeInBytes();
+ if (imageSizeBytes > 0)
+ size += aligned(VkDeviceSize(imageSizeBytes), texbufAlign);
+ return size;
+}
+
+void QRhiVulkan::prepareUploadSubres(QVkTexture *texD, int layer, int level,
+ const QRhiTextureSubresourceUploadDescription &subresDesc,
+ size_t *curOfs, void *mp,
+ BufferImageCopyList *copyInfos)
+{
+ qsizetype copySizeBytes = 0;
+ qsizetype imageSizeBytes = 0;
+ const void *src = nullptr;
+
+ VkBufferImageCopy copyInfo;
+ memset(&copyInfo, 0, sizeof(copyInfo));
+ copyInfo.bufferOffset = *curOfs;
+ copyInfo.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ copyInfo.imageSubresource.mipLevel = uint32_t(level);
+ copyInfo.imageSubresource.baseArrayLayer = uint32_t(layer);
+ copyInfo.imageSubresource.layerCount = 1;
+ copyInfo.imageExtent.depth = 1;
+
+ const QByteArray rawData = subresDesc.data();
+ const QPoint dp = subresDesc.destinationTopLeft();
+ QImage image = subresDesc.image();
+ if (!image.isNull()) {
+ copySizeBytes = imageSizeBytes = image.sizeInBytes();
+ QSize size = image.size();
+ src = image.constBits();
+ // Scanlines in QImage are 4 byte aligned so bpl must
+ // be taken into account for bufferRowLength.
+ int bpc = qMax(1, image.depth() / 8);
+ // this is in pixels, not bytes, to make it more complicated...
+ copyInfo.bufferRowLength = uint32_t(image.bytesPerLine() / bpc);
+ if (!subresDesc.sourceSize().isEmpty() || !subresDesc.sourceTopLeft().isNull()) {
+ const int sx = subresDesc.sourceTopLeft().x();
+ const int sy = subresDesc.sourceTopLeft().y();
+ if (!subresDesc.sourceSize().isEmpty())
+ size = subresDesc.sourceSize();
+ if (image.depth() == 32) {
+ // The staging buffer will get the full image
+ // regardless, just adjust the vk
+ // buffer-to-image copy start offset.
+ copyInfo.bufferOffset += VkDeviceSize(sy * image.bytesPerLine() + sx * 4);
+ // bufferRowLength remains set to the original image's width
+ } else {
+ image = image.copy(sx, sy, size.width(), size.height());
+ src = image.constBits();
+ // The staging buffer gets the slice only. The rest of the
+ // space reserved for this mip will be unused.
+ copySizeBytes = image.sizeInBytes();
+ bpc = qMax(1, image.depth() / 8);
+ copyInfo.bufferRowLength = uint32_t(image.bytesPerLine() / bpc);
+ }
+ }
+ copyInfo.imageOffset.x = dp.x();
+ copyInfo.imageOffset.y = dp.y();
+ copyInfo.imageExtent.width = uint32_t(size.width());
+ copyInfo.imageExtent.height = uint32_t(size.height());
+ copyInfos->append(copyInfo);
+ } else if (!rawData.isEmpty() && isCompressedFormat(texD->m_format)) {
+ copySizeBytes = imageSizeBytes = rawData.size();
+ src = rawData.constData();
+ QSize size = q->sizeForMipLevel(level, texD->m_pixelSize);
+ const int subresw = size.width();
+ const int subresh = size.height();
+ if (!subresDesc.sourceSize().isEmpty())
+ size = subresDesc.sourceSize();
+ const int w = size.width();
+ const int h = size.height();
+ QSize blockDim;
+ compressedFormatInfo(texD->m_format, QSize(w, h), nullptr, nullptr, &blockDim);
+ // x and y must be multiples of the block width and height
+ copyInfo.imageOffset.x = aligned(dp.x(), blockDim.width());
+ copyInfo.imageOffset.y = aligned(dp.y(), blockDim.height());
+ // width and height must be multiples of the block width and height
+ // or x + width and y + height must equal the subresource width and height
+ copyInfo.imageExtent.width = uint32_t(dp.x() + w == subresw ? w : aligned(w, blockDim.width()));
+ copyInfo.imageExtent.height = uint32_t(dp.y() + h == subresh ? h : aligned(h, blockDim.height()));
+ copyInfos->append(copyInfo);
+ } else if (!rawData.isEmpty()) {
+ copySizeBytes = imageSizeBytes = rawData.size();
+ src = rawData.constData();
+ QSize size = q->sizeForMipLevel(level, texD->m_pixelSize);
+ if (!subresDesc.sourceSize().isEmpty())
+ size = subresDesc.sourceSize();
+ copyInfo.imageOffset.x = dp.x();
+ copyInfo.imageOffset.y = dp.y();
+ copyInfo.imageExtent.width = uint32_t(size.width());
+ copyInfo.imageExtent.height = uint32_t(size.height());
+ copyInfos->append(copyInfo);
+ } else {
+ qWarning("Invalid texture upload for %p layer=%d mip=%d", texD, layer, level);
+ }
+
+ memcpy(reinterpret_cast<char *>(mp) + *curOfs, src, size_t(copySizeBytes));
+ *curOfs += aligned(VkDeviceSize(imageSizeBytes), texbufAlign);
+}
+
+void QRhiVulkan::enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates)
+{
+ QRhiResourceUpdateBatchPrivate *ud = QRhiResourceUpdateBatchPrivate::get(resourceUpdates);
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : ud->bufferOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::DynamicUpdate) {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
+ Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
+ bufD->pendingDynamicUpdates[i].append(u);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::StaticUpload) {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
+ Q_ASSERT(bufD->m_type != QRhiBuffer::Dynamic);
+ Q_ASSERT(u.offset + u.data.size() <= bufD->m_size);
+
+ if (!bufD->stagingBuffers[currentFrameSlot]) {
+ VkBufferCreateInfo bufferInfo;
+ memset(&bufferInfo, 0, sizeof(bufferInfo));
+ bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ // must cover the entire buffer - this way multiple, partial updates per frame
+ // are supported even when the staging buffer is reused (Static)
+ bufferInfo.size = VkDeviceSize(bufD->m_size);
+ bufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
+
+ VmaAllocationCreateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+ allocInfo.usage = VMA_MEMORY_USAGE_CPU_ONLY;
+
+ VmaAllocation allocation;
+ VkResult err = vmaCreateBuffer(toVmaAllocator(allocator), &bufferInfo, &allocInfo,
+ &bufD->stagingBuffers[currentFrameSlot], &allocation, nullptr);
+ if (err == VK_SUCCESS) {
+ bufD->stagingAllocations[currentFrameSlot] = allocation;
+ QRHI_PROF_F(newBufferStagingArea(bufD, currentFrameSlot, quint32(bufD->m_size)));
+ } else {
+ qWarning("Failed to create staging buffer of size %d: %d", bufD->m_size, err);
+ continue;
+ }
+ }
+
+ void *p = nullptr;
+ VmaAllocation a = toVmaAllocation(bufD->stagingAllocations[currentFrameSlot]);
+ VkResult err = vmaMapMemory(toVmaAllocator(allocator), a, &p);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to map buffer: %d", err);
+ continue;
+ }
+ memcpy(static_cast<uchar *>(p) + u.offset, u.data.constData(), size_t(u.data.size()));
+ vmaUnmapMemory(toVmaAllocator(allocator), a);
+ vmaFlushAllocation(toVmaAllocator(allocator), a, VkDeviceSize(u.offset), VkDeviceSize(u.data.size()));
+
+ trackedBufferBarrier(cbD, bufD, 0,
+ VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+
+ VkBufferCopy copyInfo;
+ memset(&copyInfo, 0, sizeof(copyInfo));
+ copyInfo.srcOffset = VkDeviceSize(u.offset);
+ copyInfo.dstOffset = VkDeviceSize(u.offset);
+ copyInfo.size = VkDeviceSize(u.data.size());
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::CopyBuffer;
+ cmd.args.copyBuffer.src = bufD->stagingBuffers[currentFrameSlot];
+ cmd.args.copyBuffer.dst = bufD->buffers[0];
+ cmd.args.copyBuffer.desc = copyInfo;
+ cbD->commands.append(cmd);
+
+ // Where's the barrier for read-after-write? (assuming the common case
+ // of binding this buffer as vertex/index, or, less likely, as uniform
+ // buffer, in a renderpass later on) That is handled by the pass
+ // resource tracking: the appropriate pipeline barrier will be
+ // generated and recorded right before the renderpass, that binds this
+ // buffer in one of its commands, gets its BeginRenderPass recorded.
+
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+
+ if (bufD->m_type == QRhiBuffer::Immutable) {
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::StagingBuffer;
+ e.lastActiveFrameSlot = currentFrameSlot;
+ e.stagingBuffer.stagingBuffer = bufD->stagingBuffers[currentFrameSlot];
+ e.stagingBuffer.stagingAllocation = bufD->stagingAllocations[currentFrameSlot];
+ bufD->stagingBuffers[currentFrameSlot] = VK_NULL_HANDLE;
+ bufD->stagingAllocations[currentFrameSlot] = nullptr;
+ releaseQueue.append(e);
+ QRHI_PROF_F(releaseBufferStagingArea(bufD, currentFrameSlot));
+ }
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::BufferOp::Read) {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, u.buf);
+ if (bufD->m_type == QRhiBuffer::Dynamic) {
+ executeBufferHostWritesForCurrentFrame(bufD);
+ void *p = nullptr;
+ VmaAllocation a = toVmaAllocation(bufD->allocations[currentFrameSlot]);
+ VkResult err = vmaMapMemory(toVmaAllocator(allocator), a, &p);
+ if (err == VK_SUCCESS) {
+ u.result->data.resize(u.readSize);
+ memcpy(u.result->data.data(), reinterpret_cast<char *>(p) + u.offset, size_t(u.readSize));
+ vmaUnmapMemory(toVmaAllocator(allocator), a);
+ }
+ if (u.result->completed)
+ u.result->completed();
+ } else {
+ // Non-Dynamic buffers may not be host visible, so have to
+ // create a readback buffer, enqueue a copy from
+ // bufD->buffers[0] to this buffer, and then once the command
+ // buffer completes, copy the data out of the host visible
+ // readback buffer. Quite similar to what we do for texture
+ // readbacks.
+ BufferReadback readback;
+ readback.activeFrameSlot = currentFrameSlot;
+ readback.result = u.result;
+ readback.byteSize = u.readSize;
+
+ VkBufferCreateInfo bufferInfo;
+ memset(&bufferInfo, 0, sizeof(bufferInfo));
+ bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ bufferInfo.size = VkDeviceSize(readback.byteSize);
+ bufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+ VmaAllocationCreateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+ allocInfo.usage = VMA_MEMORY_USAGE_GPU_TO_CPU;
+
+ VmaAllocation allocation;
+ VkResult err = vmaCreateBuffer(toVmaAllocator(allocator), &bufferInfo, &allocInfo, &readback.stagingBuf, &allocation, nullptr);
+ if (err == VK_SUCCESS) {
+ readback.stagingAlloc = allocation;
+ QRHI_PROF_F(newReadbackBuffer(qint64(readback.stagingBuf), bufD, uint(readback.byteSize)));
+ } else {
+ qWarning("Failed to create readback buffer of size %u: %d", readback.byteSize, err);
+ continue;
+ }
+
+ trackedBufferBarrier(cbD, bufD, 0, VK_ACCESS_TRANSFER_READ_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+
+ VkBufferCopy copyInfo;
+ memset(&copyInfo, 0, sizeof(copyInfo));
+ copyInfo.srcOffset = VkDeviceSize(u.offset);
+ copyInfo.size = VkDeviceSize(u.readSize);
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::CopyBuffer;
+ cmd.args.copyBuffer.src = bufD->buffers[0];
+ cmd.args.copyBuffer.dst = readback.stagingBuf;
+ cmd.args.copyBuffer.desc = copyInfo;
+ cbD->commands.append(cmd);
+
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+
+ activeBufferReadbacks.append(readback);
+ }
+ }
+ }
+
+ for (const QRhiResourceUpdateBatchPrivate::TextureOp &u : ud->textureOps) {
+ if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Upload) {
+ QVkTexture *utexD = QRHI_RES(QVkTexture, u.dst);
+ // batch into a single staging buffer and a single CopyBufferToImage with multiple copyInfos
+ VkDeviceSize stagingSize = 0;
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(u.subresDesc[layer][level]))
+ stagingSize += subresUploadByteSize(subresDesc);
+ }
+ }
+
+ Q_ASSERT(!utexD->stagingBuffers[currentFrameSlot]);
+ VkBufferCreateInfo bufferInfo;
+ memset(&bufferInfo, 0, sizeof(bufferInfo));
+ bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ bufferInfo.size = stagingSize;
+ bufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
+
+ VmaAllocationCreateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+ allocInfo.usage = VMA_MEMORY_USAGE_CPU_TO_GPU;
+
+ VmaAllocation allocation;
+ VkResult err = vmaCreateBuffer(toVmaAllocator(allocator), &bufferInfo, &allocInfo,
+ &utexD->stagingBuffers[currentFrameSlot], &allocation, nullptr);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create image staging buffer of size %d: %d", int(stagingSize), err);
+ continue;
+ }
+ utexD->stagingAllocations[currentFrameSlot] = allocation;
+ QRHI_PROF_F(newTextureStagingArea(utexD, currentFrameSlot, quint32(stagingSize)));
+
+ BufferImageCopyList copyInfos;
+ size_t curOfs = 0;
+ void *mp = nullptr;
+ VmaAllocation a = toVmaAllocation(utexD->stagingAllocations[currentFrameSlot]);
+ err = vmaMapMemory(toVmaAllocator(allocator), a, &mp);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to map image data: %d", err);
+ continue;
+ }
+
+ for (int layer = 0; layer < QRhi::MAX_LAYERS; ++layer) {
+ for (int level = 0; level < QRhi::MAX_LEVELS; ++level) {
+ const QVector<QRhiTextureSubresourceUploadDescription> &srd(u.subresDesc[layer][level]);
+ if (srd.isEmpty())
+ continue;
+ for (const QRhiTextureSubresourceUploadDescription &subresDesc : qAsConst(srd)) {
+ prepareUploadSubres(utexD, layer, level,
+ subresDesc, &curOfs, mp, &copyInfos);
+ }
+ }
+ }
+ vmaUnmapMemory(toVmaAllocator(allocator), a);
+ vmaFlushAllocation(toVmaAllocator(allocator), a, 0, stagingSize);
+
+ trackedImageBarrier(cbD, utexD, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::CopyBufferToImage;
+ cmd.args.copyBufferToImage.src = utexD->stagingBuffers[currentFrameSlot];
+ cmd.args.copyBufferToImage.dst = utexD->image;
+ cmd.args.copyBufferToImage.dstLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+ cmd.args.copyBufferToImage.count = copyInfos.count();
+ cmd.args.copyBufferToImage.bufferImageCopyIndex = cbD->pools.bufferImageCopy.count();
+ cbD->pools.bufferImageCopy.append(copyInfos.constData(), copyInfos.count());
+ cbD->commands.append(cmd);
+
+ // no reuse of staging, this is intentional
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::StagingBuffer;
+ e.lastActiveFrameSlot = currentFrameSlot;
+ e.stagingBuffer.stagingBuffer = utexD->stagingBuffers[currentFrameSlot];
+ e.stagingBuffer.stagingAllocation = utexD->stagingAllocations[currentFrameSlot];
+ utexD->stagingBuffers[currentFrameSlot] = VK_NULL_HANDLE;
+ utexD->stagingAllocations[currentFrameSlot] = nullptr;
+ releaseQueue.append(e);
+ QRHI_PROF_F(releaseTextureStagingArea(utexD, currentFrameSlot));
+
+ // Similarly to buffers, transitioning away from DST is done later,
+ // when a renderpass using the texture is encountered.
+
+ utexD->lastActiveFrameSlot = currentFrameSlot;
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Copy) {
+ Q_ASSERT(u.src && u.dst);
+ if (u.src == u.dst) {
+ qWarning("Texture copy with matching source and destination is not supported");
+ continue;
+ }
+ QVkTexture *srcD = QRHI_RES(QVkTexture, u.src);
+ QVkTexture *dstD = QRHI_RES(QVkTexture, u.dst);
+
+ VkImageCopy region;
+ memset(&region, 0, sizeof(region));
+
+ region.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ region.srcSubresource.mipLevel = uint32_t(u.desc.sourceLevel());
+ region.srcSubresource.baseArrayLayer = uint32_t(u.desc.sourceLayer());
+ region.srcSubresource.layerCount = 1;
+
+ region.srcOffset.x = u.desc.sourceTopLeft().x();
+ region.srcOffset.y = u.desc.sourceTopLeft().y();
+
+ region.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ region.dstSubresource.mipLevel = uint32_t(u.desc.destinationLevel());
+ region.dstSubresource.baseArrayLayer = uint32_t(u.desc.destinationLayer());
+ region.dstSubresource.layerCount = 1;
+
+ region.dstOffset.x = u.desc.destinationTopLeft().x();
+ region.dstOffset.y = u.desc.destinationTopLeft().y();
+
+ const QSize mipSize = q->sizeForMipLevel(u.desc.sourceLevel(), srcD->m_pixelSize);
+ const QSize copySize = u.desc.pixelSize().isEmpty() ? mipSize : u.desc.pixelSize();
+ region.extent.width = uint32_t(copySize.width());
+ region.extent.height = uint32_t(copySize.height());
+ region.extent.depth = 1;
+
+ trackedImageBarrier(cbD, srcD, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_ACCESS_TRANSFER_READ_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+ trackedImageBarrier(cbD, dstD, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ VK_ACCESS_TRANSFER_WRITE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::CopyImage;
+ cmd.args.copyImage.src = srcD->image;
+ cmd.args.copyImage.srcLayout = srcD->usageState.layout;
+ cmd.args.copyImage.dst = dstD->image;
+ cmd.args.copyImage.dstLayout = dstD->usageState.layout;
+ cmd.args.copyImage.desc = region;
+ cbD->commands.append(cmd);
+
+ srcD->lastActiveFrameSlot = dstD->lastActiveFrameSlot = currentFrameSlot;
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::Read) {
+ TextureReadback readback;
+ readback.activeFrameSlot = currentFrameSlot;
+ readback.desc = u.rb;
+ readback.result = u.result;
+
+ QVkTexture *texD = QRHI_RES(QVkTexture, u.rb.texture());
+ QVkSwapChain *swapChainD = nullptr;
+ if (texD) {
+ if (texD->samples > VK_SAMPLE_COUNT_1_BIT) {
+ qWarning("Multisample texture cannot be read back");
+ continue;
+ }
+ readback.pixelSize = q->sizeForMipLevel(u.rb.level(), texD->m_pixelSize);
+ readback.format = texD->m_format;
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ } else {
+ Q_ASSERT(currentSwapChain);
+ swapChainD = QRHI_RES(QVkSwapChain, currentSwapChain);
+ if (!swapChainD->supportsReadback) {
+ qWarning("Swapchain does not support readback");
+ continue;
+ }
+ readback.pixelSize = swapChainD->pixelSize;
+ readback.format = colorTextureFormatFromVkFormat(swapChainD->colorFormat, nullptr);
+ if (readback.format == QRhiTexture::UnknownFormat)
+ continue;
+
+ // Multisample swapchains need nothing special since resolving
+ // happens when ending a renderpass.
+ }
+ textureFormatInfo(readback.format, readback.pixelSize, nullptr, &readback.byteSize);
+
+ // Create a host visible readback buffer.
+ VkBufferCreateInfo bufferInfo;
+ memset(&bufferInfo, 0, sizeof(bufferInfo));
+ bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ bufferInfo.size = readback.byteSize;
+ bufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+
+ VmaAllocationCreateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+ allocInfo.usage = VMA_MEMORY_USAGE_GPU_TO_CPU;
+
+ VmaAllocation allocation;
+ VkResult err = vmaCreateBuffer(toVmaAllocator(allocator), &bufferInfo, &allocInfo, &readback.stagingBuf, &allocation, nullptr);
+ if (err == VK_SUCCESS) {
+ readback.stagingAlloc = allocation;
+ QRHI_PROF_F(newReadbackBuffer(qint64(readback.stagingBuf),
+ texD ? static_cast<QRhiResource *>(texD) : static_cast<QRhiResource *>(swapChainD),
+ readback.byteSize));
+ } else {
+ qWarning("Failed to create readback buffer of size %u: %d", readback.byteSize, err);
+ continue;
+ }
+
+ // Copy from the (optimal and not host visible) image into the buffer.
+ VkBufferImageCopy copyDesc;
+ memset(&copyDesc, 0, sizeof(copyDesc));
+ copyDesc.bufferOffset = 0;
+ copyDesc.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ copyDesc.imageSubresource.mipLevel = uint32_t(u.rb.level());
+ copyDesc.imageSubresource.baseArrayLayer = uint32_t(u.rb.layer());
+ copyDesc.imageSubresource.layerCount = 1;
+ copyDesc.imageExtent.width = uint32_t(readback.pixelSize.width());
+ copyDesc.imageExtent.height = uint32_t(readback.pixelSize.height());
+ copyDesc.imageExtent.depth = 1;
+
+ if (texD) {
+ trackedImageBarrier(cbD, texD, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_ACCESS_TRANSFER_READ_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT);
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::CopyImageToBuffer;
+ cmd.args.copyImageToBuffer.src = texD->image;
+ cmd.args.copyImageToBuffer.srcLayout = texD->usageState.layout;
+ cmd.args.copyImageToBuffer.dst = readback.stagingBuf;
+ cmd.args.copyImageToBuffer.desc = copyDesc;
+ cbD->commands.append(cmd);
+ } else {
+ // use the swapchain image
+ QVkSwapChain::ImageResources &imageRes(swapChainD->imageRes[swapChainD->currentImageIndex]);
+ VkImage image = imageRes.image;
+ if (imageRes.lastUse != QVkSwapChain::ImageResources::ScImageUseTransferSource) {
+ if (imageRes.lastUse != QVkSwapChain::ImageResources::ScImageUseRender) {
+ qWarning("Attempted to read back undefined swapchain image content, "
+ "results are undefined. (do a render pass first)");
+ }
+ subresourceBarrier(cbD, image,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_ACCESS_MEMORY_READ_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ 0, 1,
+ 0, 1);
+ imageRes.lastUse = QVkSwapChain::ImageResources::ScImageUseTransferSource;
+ }
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::CopyImageToBuffer;
+ cmd.args.copyImageToBuffer.src = image;
+ cmd.args.copyImageToBuffer.srcLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+ cmd.args.copyImageToBuffer.dst = readback.stagingBuf;
+ cmd.args.copyImageToBuffer.desc = copyDesc;
+ cbD->commands.append(cmd);
+ }
+
+ activeTextureReadbacks.append(readback);
+ } else if (u.type == QRhiResourceUpdateBatchPrivate::TextureOp::GenMips) {
+ QVkTexture *utexD = QRHI_RES(QVkTexture, u.dst);
+ Q_ASSERT(utexD->m_flags.testFlag(QRhiTexture::UsedWithGenerateMips));
+ int w = utexD->m_pixelSize.width();
+ int h = utexD->m_pixelSize.height();
+
+ VkImageLayout origLayout = utexD->usageState.layout;
+ VkAccessFlags origAccess = utexD->usageState.access;
+ VkPipelineStageFlags origStage = utexD->usageState.stage;
+ if (!origStage)
+ origStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
+
+ for (int level = 1; level < int(utexD->mipLevelCount); ++level) {
+ if (level == 1) {
+ subresourceBarrier(cbD, utexD->image,
+ origLayout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ origAccess, VK_ACCESS_TRANSFER_READ_BIT,
+ origStage, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ u.layer, 1,
+ level - 1, 1);
+ } else {
+ subresourceBarrier(cbD, utexD->image,
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
+ VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_TRANSFER_READ_BIT,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ u.layer, 1,
+ level - 1, 1);
+ }
+
+ subresourceBarrier(cbD, utexD->image,
+ origLayout, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
+ origAccess, VK_ACCESS_TRANSFER_WRITE_BIT,
+ origStage, VK_PIPELINE_STAGE_TRANSFER_BIT,
+ u.layer, 1,
+ level, 1);
+
+ VkImageBlit region;
+ memset(&region, 0, sizeof(region));
+
+ region.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ region.srcSubresource.mipLevel = uint32_t(level) - 1;
+ region.srcSubresource.baseArrayLayer = uint32_t(u.layer);
+ region.srcSubresource.layerCount = 1;
+
+ region.srcOffsets[1].x = qMax(1, w);
+ region.srcOffsets[1].y = qMax(1, h);
+ region.srcOffsets[1].z = 1;
+
+ region.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ region.dstSubresource.mipLevel = uint32_t(level);
+ region.dstSubresource.baseArrayLayer = uint32_t(u.layer);
+ region.dstSubresource.layerCount = 1;
+
+ region.dstOffsets[1].x = qMax(1, w >> 1);
+ region.dstOffsets[1].y = qMax(1, h >> 1);
+ region.dstOffsets[1].z = 1;
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BlitImage;
+ cmd.args.blitImage.src = utexD->image;
+ cmd.args.blitImage.srcLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL;
+ cmd.args.blitImage.dst = utexD->image;
+ cmd.args.blitImage.dstLayout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;
+ cmd.args.blitImage.filter = VK_FILTER_LINEAR;
+ cmd.args.blitImage.desc = region;
+ cbD->commands.append(cmd);
+
+ w >>= 1;
+ h >>= 1;
+ }
+
+ if (utexD->mipLevelCount > 1) {
+ subresourceBarrier(cbD, utexD->image,
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, origLayout,
+ VK_ACCESS_TRANSFER_READ_BIT, origAccess,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, origStage,
+ u.layer, 1,
+ 0, int(utexD->mipLevelCount) - 1);
+ subresourceBarrier(cbD, utexD->image,
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, origLayout,
+ VK_ACCESS_TRANSFER_WRITE_BIT, origAccess,
+ VK_PIPELINE_STAGE_TRANSFER_BIT, origStage,
+ u.layer, 1,
+ int(utexD->mipLevelCount) - 1, 1);
+ }
+
+ utexD->lastActiveFrameSlot = currentFrameSlot;
+ }
+ }
+
+ ud->free();
+}
+
+void QRhiVulkan::executeBufferHostWritesForCurrentFrame(QVkBuffer *bufD)
+{
+ if (bufD->pendingDynamicUpdates[currentFrameSlot].isEmpty())
+ return;
+
+ Q_ASSERT(bufD->m_type == QRhiBuffer::Dynamic);
+ void *p = nullptr;
+ VmaAllocation a = toVmaAllocation(bufD->allocations[currentFrameSlot]);
+ // The vmaMap/Unmap are basically a no-op when persistently mapped since it
+ // refcounts; this is great because we don't need to care if the allocation
+ // was created as persistently mapped or not.
+ VkResult err = vmaMapMemory(toVmaAllocator(allocator), a, &p);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to map buffer: %d", err);
+ return;
+ }
+ int changeBegin = -1;
+ int changeEnd = -1;
+ for (const QRhiResourceUpdateBatchPrivate::BufferOp &u : qAsConst(bufD->pendingDynamicUpdates[currentFrameSlot])) {
+ Q_ASSERT(bufD == QRHI_RES(QVkBuffer, u.buf));
+ memcpy(static_cast<char *>(p) + u.offset, u.data.constData(), size_t(u.data.size()));
+ if (changeBegin == -1 || u.offset < changeBegin)
+ changeBegin = u.offset;
+ if (changeEnd == -1 || u.offset + u.data.size() > changeEnd)
+ changeEnd = u.offset + u.data.size();
+ }
+ vmaUnmapMemory(toVmaAllocator(allocator), a);
+ if (changeBegin >= 0)
+ vmaFlushAllocation(toVmaAllocator(allocator), a, VkDeviceSize(changeBegin), VkDeviceSize(changeEnd - changeBegin));
+
+ bufD->pendingDynamicUpdates[currentFrameSlot].clear();
+}
+
+static void qrhivk_releaseBuffer(const QRhiVulkan::DeferredReleaseEntry &e, void *allocator)
+{
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ vmaDestroyBuffer(toVmaAllocator(allocator), e.buffer.buffers[i], toVmaAllocation(e.buffer.allocations[i]));
+ vmaDestroyBuffer(toVmaAllocator(allocator), e.buffer.stagingBuffers[i], toVmaAllocation(e.buffer.stagingAllocations[i]));
+ }
+}
+
+static void qrhivk_releaseRenderBuffer(const QRhiVulkan::DeferredReleaseEntry &e, VkDevice dev, QVulkanDeviceFunctions *df)
+{
+ df->vkDestroyImageView(dev, e.renderBuffer.imageView, nullptr);
+ df->vkDestroyImage(dev, e.renderBuffer.image, nullptr);
+ df->vkFreeMemory(dev, e.renderBuffer.memory, nullptr);
+}
+
+static void qrhivk_releaseTexture(const QRhiVulkan::DeferredReleaseEntry &e, VkDevice dev, QVulkanDeviceFunctions *df, void *allocator)
+{
+ df->vkDestroyImageView(dev, e.texture.imageView, nullptr);
+ vmaDestroyImage(toVmaAllocator(allocator), e.texture.image, toVmaAllocation(e.texture.allocation));
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
+ vmaDestroyBuffer(toVmaAllocator(allocator), e.texture.stagingBuffers[i], toVmaAllocation(e.texture.stagingAllocations[i]));
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i) {
+ if (e.texture.extraImageViews[i])
+ df->vkDestroyImageView(dev, e.texture.extraImageViews[i], nullptr);
+ }
+}
+
+static void qrhivk_releaseSampler(const QRhiVulkan::DeferredReleaseEntry &e, VkDevice dev, QVulkanDeviceFunctions *df)
+{
+ df->vkDestroySampler(dev, e.sampler.sampler, nullptr);
+}
+
+void QRhiVulkan::executeDeferredReleases(bool forced)
+{
+ for (int i = releaseQueue.count() - 1; i >= 0; --i) {
+ const QRhiVulkan::DeferredReleaseEntry &e(releaseQueue[i]);
+ if (forced || currentFrameSlot == e.lastActiveFrameSlot || e.lastActiveFrameSlot < 0) {
+ switch (e.type) {
+ case QRhiVulkan::DeferredReleaseEntry::Pipeline:
+ df->vkDestroyPipeline(dev, e.pipelineState.pipeline, nullptr);
+ df->vkDestroyPipelineLayout(dev, e.pipelineState.layout, nullptr);
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::ShaderResourceBindings:
+ df->vkDestroyDescriptorSetLayout(dev, e.shaderResourceBindings.layout, nullptr);
+ if (e.shaderResourceBindings.poolIndex >= 0) {
+ descriptorPools[e.shaderResourceBindings.poolIndex].refCount -= 1;
+ Q_ASSERT(descriptorPools[e.shaderResourceBindings.poolIndex].refCount >= 0);
+ }
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::Buffer:
+ qrhivk_releaseBuffer(e, allocator);
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::RenderBuffer:
+ qrhivk_releaseRenderBuffer(e, dev, df);
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::Texture:
+ qrhivk_releaseTexture(e, dev, df, allocator);
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::Sampler:
+ qrhivk_releaseSampler(e, dev, df);
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::TextureRenderTarget:
+ df->vkDestroyFramebuffer(dev, e.textureRenderTarget.fb, nullptr);
+ for (int att = 0; att < QVkRenderTargetData::MAX_COLOR_ATTACHMENTS; ++att) {
+ df->vkDestroyImageView(dev, e.textureRenderTarget.rtv[att], nullptr);
+ df->vkDestroyImageView(dev, e.textureRenderTarget.resrtv[att], nullptr);
+ }
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::RenderPass:
+ df->vkDestroyRenderPass(dev, e.renderPass.rp, nullptr);
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::StagingBuffer:
+ vmaDestroyBuffer(toVmaAllocator(allocator), e.stagingBuffer.stagingBuffer, toVmaAllocation(e.stagingBuffer.stagingAllocation));
+ break;
+ case QRhiVulkan::DeferredReleaseEntry::CommandBuffer:
+ df->vkFreeCommandBuffers(dev, cmdPool, 1, &e.commandBuffer.cb);
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ releaseQueue.removeAt(i);
+ }
+ }
+}
+
+void QRhiVulkan::finishActiveReadbacks(bool forced)
+{
+ QVarLengthArray<std::function<void()>, 4> completedCallbacks;
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+
+ for (int i = activeTextureReadbacks.count() - 1; i >= 0; --i) {
+ const QRhiVulkan::TextureReadback &readback(activeTextureReadbacks[i]);
+ if (forced || currentFrameSlot == readback.activeFrameSlot || readback.activeFrameSlot < 0) {
+ readback.result->format = readback.format;
+ readback.result->pixelSize = readback.pixelSize;
+ VmaAllocation a = toVmaAllocation(readback.stagingAlloc);
+ void *p = nullptr;
+ VkResult err = vmaMapMemory(toVmaAllocator(allocator), a, &p);
+ if (err == VK_SUCCESS && p) {
+ readback.result->data.resize(int(readback.byteSize));
+ memcpy(readback.result->data.data(), p, readback.byteSize);
+ vmaUnmapMemory(toVmaAllocator(allocator), a);
+ } else {
+ qWarning("Failed to map texture readback buffer of size %u: %d", readback.byteSize, err);
+ }
+
+ vmaDestroyBuffer(toVmaAllocator(allocator), readback.stagingBuf, a);
+ QRHI_PROF_F(releaseReadbackBuffer(qint64(readback.stagingBuf)));
+
+ if (readback.result->completed)
+ completedCallbacks.append(readback.result->completed);
+
+ activeTextureReadbacks.removeAt(i);
+ }
+ }
+
+ for (int i = activeBufferReadbacks.count() - 1; i >= 0; --i) {
+ const QRhiVulkan::BufferReadback &readback(activeBufferReadbacks[i]);
+ if (forced || currentFrameSlot == readback.activeFrameSlot || readback.activeFrameSlot < 0) {
+ VmaAllocation a = toVmaAllocation(readback.stagingAlloc);
+ void *p = nullptr;
+ VkResult err = vmaMapMemory(toVmaAllocator(allocator), a, &p);
+ if (err == VK_SUCCESS && p) {
+ readback.result->data.resize(readback.byteSize);
+ memcpy(readback.result->data.data(), p, size_t(readback.byteSize));
+ vmaUnmapMemory(toVmaAllocator(allocator), a);
+ } else {
+ qWarning("Failed to map buffer readback buffer of size %d: %d", readback.byteSize, err);
+ }
+
+ vmaDestroyBuffer(toVmaAllocator(allocator), readback.stagingBuf, a);
+ QRHI_PROF_F(releaseReadbackBuffer(qint64(readback.stagingBuf)));
+
+ if (readback.result->completed)
+ completedCallbacks.append(readback.result->completed);
+
+ activeBufferReadbacks.removeAt(i);
+ }
+ }
+
+ for (auto f : completedCallbacks)
+ f();
+}
+
+static struct {
+ VkSampleCountFlagBits mask;
+ int count;
+} qvk_sampleCounts[] = {
+ // keep this sorted by 'count'
+ { VK_SAMPLE_COUNT_1_BIT, 1 },
+ { VK_SAMPLE_COUNT_2_BIT, 2 },
+ { VK_SAMPLE_COUNT_4_BIT, 4 },
+ { VK_SAMPLE_COUNT_8_BIT, 8 },
+ { VK_SAMPLE_COUNT_16_BIT, 16 },
+ { VK_SAMPLE_COUNT_32_BIT, 32 },
+ { VK_SAMPLE_COUNT_64_BIT, 64 }
+};
+
+QVector<int> QRhiVulkan::supportedSampleCounts() const
+{
+ const VkPhysicalDeviceLimits *limits = &physDevProperties.limits;
+ VkSampleCountFlags color = limits->framebufferColorSampleCounts;
+ VkSampleCountFlags depth = limits->framebufferDepthSampleCounts;
+ VkSampleCountFlags stencil = limits->framebufferStencilSampleCounts;
+ QVector<int> result;
+
+ for (const auto &qvk_sampleCount : qvk_sampleCounts) {
+ if ((color & qvk_sampleCount.mask)
+ && (depth & qvk_sampleCount.mask)
+ && (stencil & qvk_sampleCount.mask))
+ {
+ result.append(qvk_sampleCount.count);
+ }
+ }
+
+ return result;
+}
+
+VkSampleCountFlagBits QRhiVulkan::effectiveSampleCount(int sampleCount)
+{
+ // Stay compatible with QSurfaceFormat and friends where samples == 0 means the same as 1.
+ sampleCount = qBound(1, sampleCount, 64);
+
+ if (!supportedSampleCounts().contains(sampleCount)) {
+ qWarning("Attempted to set unsupported sample count %d", sampleCount);
+ return VK_SAMPLE_COUNT_1_BIT;
+ }
+
+ for (const auto &qvk_sampleCount : qvk_sampleCounts) {
+ if (qvk_sampleCount.count == sampleCount)
+ return qvk_sampleCount.mask;
+ }
+
+ Q_UNREACHABLE();
+ return VK_SAMPLE_COUNT_1_BIT;
+}
+
+void QRhiVulkan::enqueueTransitionPassResources(QVkCommandBuffer *cbD)
+{
+ cbD->passResTrackers.append(QRhiPassResourceTracker());
+ cbD->currentPassResTrackerIndex = cbD->passResTrackers.count() - 1;
+
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::TransitionPassResources;
+ cmd.args.transitionResources.trackerIndex = cbD->passResTrackers.count() - 1;
+ cbD->commands.append(cmd);
+}
+
+void QRhiVulkan::recordPrimaryCommandBuffer(QVkCommandBuffer *cbD)
+{
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::NoPass);
+
+ for (QVkCommandBuffer::Command &cmd : cbD->commands) {
+ switch (cmd.cmd) {
+ case QVkCommandBuffer::Command::CopyBuffer:
+ df->vkCmdCopyBuffer(cbD->cb, cmd.args.copyBuffer.src, cmd.args.copyBuffer.dst,
+ 1, &cmd.args.copyBuffer.desc);
+ break;
+ case QVkCommandBuffer::Command::CopyBufferToImage:
+ df->vkCmdCopyBufferToImage(cbD->cb, cmd.args.copyBufferToImage.src, cmd.args.copyBufferToImage.dst,
+ cmd.args.copyBufferToImage.dstLayout,
+ uint32_t(cmd.args.copyBufferToImage.count),
+ cbD->pools.bufferImageCopy.constData() + cmd.args.copyBufferToImage.bufferImageCopyIndex);
+ break;
+ case QVkCommandBuffer::Command::CopyImage:
+ df->vkCmdCopyImage(cbD->cb, cmd.args.copyImage.src, cmd.args.copyImage.srcLayout,
+ cmd.args.copyImage.dst, cmd.args.copyImage.dstLayout,
+ 1, &cmd.args.copyImage.desc);
+ break;
+ case QVkCommandBuffer::Command::CopyImageToBuffer:
+ df->vkCmdCopyImageToBuffer(cbD->cb, cmd.args.copyImageToBuffer.src, cmd.args.copyImageToBuffer.srcLayout,
+ cmd.args.copyImageToBuffer.dst,
+ 1, &cmd.args.copyImageToBuffer.desc);
+ break;
+ case QVkCommandBuffer::Command::ImageBarrier:
+ df->vkCmdPipelineBarrier(cbD->cb, cmd.args.imageBarrier.srcStageMask, cmd.args.imageBarrier.dstStageMask,
+ 0, 0, nullptr, 0, nullptr,
+ 1, &cmd.args.imageBarrier.desc);
+ break;
+ case QVkCommandBuffer::Command::BufferBarrier:
+ df->vkCmdPipelineBarrier(cbD->cb, cmd.args.bufferBarrier.srcStageMask, cmd.args.bufferBarrier.dstStageMask,
+ 0, 0, nullptr,
+ 1, &cmd.args.bufferBarrier.desc,
+ 0, nullptr);
+ break;
+ case QVkCommandBuffer::Command::BlitImage:
+ df->vkCmdBlitImage(cbD->cb, cmd.args.blitImage.src, cmd.args.blitImage.srcLayout,
+ cmd.args.blitImage.dst, cmd.args.blitImage.dstLayout,
+ 1, &cmd.args.blitImage.desc,
+ cmd.args.blitImage.filter);
+ break;
+ case QVkCommandBuffer::Command::BeginRenderPass:
+ cmd.args.beginRenderPass.desc.pClearValues = cbD->pools.clearValue.constData() + cmd.args.beginRenderPass.clearValueIndex;
+ df->vkCmdBeginRenderPass(cbD->cb, &cmd.args.beginRenderPass.desc,
+ cbD->useSecondaryCb ? VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS : VK_SUBPASS_CONTENTS_INLINE);
+ break;
+ case QVkCommandBuffer::Command::EndRenderPass:
+ df->vkCmdEndRenderPass(cbD->cb);
+ break;
+ case QVkCommandBuffer::Command::BindPipeline:
+ df->vkCmdBindPipeline(cbD->cb, cmd.args.bindPipeline.bindPoint, cmd.args.bindPipeline.pipeline);
+ break;
+ case QVkCommandBuffer::Command::BindDescriptorSet:
+ {
+ const uint32_t *offsets = nullptr;
+ if (cmd.args.bindDescriptorSet.dynamicOffsetCount > 0)
+ offsets = cbD->pools.dynamicOffset.constData() + cmd.args.bindDescriptorSet.dynamicOffsetIndex;
+ df->vkCmdBindDescriptorSets(cbD->cb, cmd.args.bindDescriptorSet.bindPoint,
+ cmd.args.bindDescriptorSet.pipelineLayout,
+ 0, 1, &cmd.args.bindDescriptorSet.descSet,
+ uint32_t(cmd.args.bindDescriptorSet.dynamicOffsetCount),
+ offsets);
+ }
+ break;
+ case QVkCommandBuffer::Command::BindVertexBuffer:
+ df->vkCmdBindVertexBuffers(cbD->cb, uint32_t(cmd.args.bindVertexBuffer.startBinding),
+ uint32_t(cmd.args.bindVertexBuffer.count),
+ cbD->pools.vertexBuffer.constData() + cmd.args.bindVertexBuffer.vertexBufferIndex,
+ cbD->pools.vertexBufferOffset.constData() + cmd.args.bindVertexBuffer.vertexBufferOffsetIndex);
+ break;
+ case QVkCommandBuffer::Command::BindIndexBuffer:
+ df->vkCmdBindIndexBuffer(cbD->cb, cmd.args.bindIndexBuffer.buf,
+ cmd.args.bindIndexBuffer.ofs, cmd.args.bindIndexBuffer.type);
+ break;
+ case QVkCommandBuffer::Command::SetViewport:
+ df->vkCmdSetViewport(cbD->cb, 0, 1, &cmd.args.setViewport.viewport);
+ break;
+ case QVkCommandBuffer::Command::SetScissor:
+ df->vkCmdSetScissor(cbD->cb, 0, 1, &cmd.args.setScissor.scissor);
+ break;
+ case QVkCommandBuffer::Command::SetBlendConstants:
+ df->vkCmdSetBlendConstants(cbD->cb, cmd.args.setBlendConstants.c);
+ break;
+ case QVkCommandBuffer::Command::SetStencilRef:
+ df->vkCmdSetStencilReference(cbD->cb, VK_STENCIL_FRONT_AND_BACK, cmd.args.setStencilRef.ref);
+ break;
+ case QVkCommandBuffer::Command::Draw:
+ df->vkCmdDraw(cbD->cb, cmd.args.draw.vertexCount, cmd.args.draw.instanceCount,
+ cmd.args.draw.firstVertex, cmd.args.draw.firstInstance);
+ break;
+ case QVkCommandBuffer::Command::DrawIndexed:
+ df->vkCmdDrawIndexed(cbD->cb, cmd.args.drawIndexed.indexCount, cmd.args.drawIndexed.instanceCount,
+ cmd.args.drawIndexed.firstIndex, cmd.args.drawIndexed.vertexOffset,
+ cmd.args.drawIndexed.firstInstance);
+ break;
+ case QVkCommandBuffer::Command::DebugMarkerBegin:
+ cmd.args.debugMarkerBegin.marker.pMarkerName =
+ cbD->pools.debugMarkerData[cmd.args.debugMarkerBegin.markerNameIndex].constData();
+ vkCmdDebugMarkerBegin(cbD->cb, &cmd.args.debugMarkerBegin.marker);
+ break;
+ case QVkCommandBuffer::Command::DebugMarkerEnd:
+ vkCmdDebugMarkerEnd(cbD->cb);
+ break;
+ case QVkCommandBuffer::Command::DebugMarkerInsert:
+ cmd.args.debugMarkerInsert.marker.pMarkerName =
+ cbD->pools.debugMarkerData[cmd.args.debugMarkerInsert.markerNameIndex].constData();
+ vkCmdDebugMarkerInsert(cbD->cb, &cmd.args.debugMarkerInsert.marker);
+ break;
+ case QVkCommandBuffer::Command::TransitionPassResources:
+ recordTransitionPassResources(cbD, cbD->passResTrackers[cmd.args.transitionResources.trackerIndex]);
+ break;
+ case QVkCommandBuffer::Command::Dispatch:
+ df->vkCmdDispatch(cbD->cb, uint32_t(cmd.args.dispatch.x), uint32_t(cmd.args.dispatch.y), uint32_t(cmd.args.dispatch.z));
+ break;
+ case QVkCommandBuffer::Command::ExecuteSecondary:
+ df->vkCmdExecuteCommands(cbD->cb, 1, &cmd.args.executeSecondary.cb);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static inline VkAccessFlags toVkAccess(QRhiPassResourceTracker::BufferAccess access)
+{
+ switch (access) {
+ case QRhiPassResourceTracker::BufVertexInput:
+ return VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT;
+ case QRhiPassResourceTracker::BufIndexRead:
+ return VK_ACCESS_INDEX_READ_BIT;
+ case QRhiPassResourceTracker::BufUniformRead:
+ return VK_ACCESS_UNIFORM_READ_BIT;
+ case QRhiPassResourceTracker::BufStorageLoad:
+ return VK_ACCESS_SHADER_READ_BIT;
+ case QRhiPassResourceTracker::BufStorageStore:
+ return VK_ACCESS_SHADER_WRITE_BIT;
+ case QRhiPassResourceTracker::BufStorageLoadStore:
+ return VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return 0;
+}
+
+static inline VkPipelineStageFlags toVkPipelineStage(QRhiPassResourceTracker::BufferStage stage)
+{
+ switch (stage) {
+ case QRhiPassResourceTracker::BufVertexInputStage:
+ return VK_PIPELINE_STAGE_VERTEX_INPUT_BIT;
+ case QRhiPassResourceTracker::BufVertexStage:
+ return VK_PIPELINE_STAGE_VERTEX_SHADER_BIT;
+ case QRhiPassResourceTracker::BufFragmentStage:
+ return VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
+ case QRhiPassResourceTracker::BufComputeStage:
+ return VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return 0;
+}
+
+static inline QVkBuffer::UsageState toVkBufferUsageState(QRhiPassResourceTracker::UsageState usage)
+{
+ QVkBuffer::UsageState u;
+ u.access = VkAccessFlags(usage.access);
+ u.stage = VkPipelineStageFlags(usage.stage);
+ return u;
+}
+
+static inline VkImageLayout toVkLayout(QRhiPassResourceTracker::TextureAccess access)
+{
+ switch (access) {
+ case QRhiPassResourceTracker::TexSample:
+ return VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
+ case QRhiPassResourceTracker::TexColorOutput:
+ return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+ case QRhiPassResourceTracker::TexDepthOutput:
+ return VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+ case QRhiPassResourceTracker::TexStorageLoad:
+ Q_FALLTHROUGH();
+ case QRhiPassResourceTracker::TexStorageStore:
+ Q_FALLTHROUGH();
+ case QRhiPassResourceTracker::TexStorageLoadStore:
+ return VK_IMAGE_LAYOUT_GENERAL;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return VK_IMAGE_LAYOUT_GENERAL;
+}
+
+static inline VkAccessFlags toVkAccess(QRhiPassResourceTracker::TextureAccess access)
+{
+ switch (access) {
+ case QRhiPassResourceTracker::TexSample:
+ return VK_ACCESS_SHADER_READ_BIT;
+ case QRhiPassResourceTracker::TexColorOutput:
+ return VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+ case QRhiPassResourceTracker::TexDepthOutput:
+ return VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT;
+ case QRhiPassResourceTracker::TexStorageLoad:
+ return VK_ACCESS_SHADER_READ_BIT;
+ case QRhiPassResourceTracker::TexStorageStore:
+ return VK_ACCESS_SHADER_WRITE_BIT;
+ case QRhiPassResourceTracker::TexStorageLoadStore:
+ return VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return 0;
+}
+
+static inline VkPipelineStageFlags toVkPipelineStage(QRhiPassResourceTracker::TextureStage stage)
+{
+ switch (stage) {
+ case QRhiPassResourceTracker::TexVertexStage:
+ return VK_PIPELINE_STAGE_VERTEX_SHADER_BIT;
+ case QRhiPassResourceTracker::TexFragmentStage:
+ return VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
+ case QRhiPassResourceTracker::TexColorOutputStage:
+ return VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+ case QRhiPassResourceTracker::TexDepthOutputStage:
+ return VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT;
+ case QRhiPassResourceTracker::TexComputeStage:
+ return VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ return 0;
+}
+
+static inline QVkTexture::UsageState toVkTextureUsageState(QRhiPassResourceTracker::UsageState usage)
+{
+ QVkTexture::UsageState u;
+ u.layout = VkImageLayout(usage.layout);
+ u.access = VkAccessFlags(usage.access);
+ u.stage = VkPipelineStageFlags(usage.stage);
+ return u;
+}
+
+void QRhiVulkan::trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker,
+ QVkBuffer *bufD,
+ int slot,
+ QRhiPassResourceTracker::BufferAccess access,
+ QRhiPassResourceTracker::BufferStage stage)
+{
+ QVkBuffer::UsageState &u(bufD->usageState[slot]);
+ passResTracker->registerBuffer(bufD, slot, &access, &stage, toPassTrackerUsageState(u));
+ u.access = toVkAccess(access);
+ u.stage = toVkPipelineStage(stage);
+}
+
+void QRhiVulkan::trackedRegisterTexture(QRhiPassResourceTracker *passResTracker,
+ QVkTexture *texD,
+ QRhiPassResourceTracker::TextureAccess access,
+ QRhiPassResourceTracker::TextureStage stage)
+{
+ QVkTexture::UsageState &u(texD->usageState);
+ passResTracker->registerTexture(texD, &access, &stage, toPassTrackerUsageState(u));
+ u.layout = toVkLayout(access);
+ u.access = toVkAccess(access);
+ u.stage = toVkPipelineStage(stage);
+}
+
+void QRhiVulkan::recordTransitionPassResources(QVkCommandBuffer *cbD, const QRhiPassResourceTracker &tracker)
+{
+ if (tracker.isEmpty())
+ return;
+
+ for (auto it = tracker.cbeginBuffers(), itEnd = tracker.cendBuffers(); it != itEnd; ++it) {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, it.key());
+ VkAccessFlags access = toVkAccess(it->access);
+ VkPipelineStageFlags stage = toVkPipelineStage(it->stage);
+ QVkBuffer::UsageState s = toVkBufferUsageState(it->stateAtPassBegin);
+ if (!s.stage)
+ continue;
+ if (s.access == access && s.stage == stage) {
+ if (!accessIsWrite(access))
+ continue;
+ }
+ VkBufferMemoryBarrier bufMemBarrier;
+ memset(&bufMemBarrier, 0, sizeof(bufMemBarrier));
+ bufMemBarrier.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
+ bufMemBarrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ bufMemBarrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
+ bufMemBarrier.srcAccessMask = s.access;
+ bufMemBarrier.dstAccessMask = access;
+ bufMemBarrier.buffer = bufD->buffers[it->slot];
+ bufMemBarrier.size = VK_WHOLE_SIZE;
+ df->vkCmdPipelineBarrier(cbD->cb, s.stage, stage, 0,
+ 0, nullptr,
+ 1, &bufMemBarrier,
+ 0, nullptr);
+ }
+
+ for (auto it = tracker.cbeginTextures(), itEnd = tracker.cendTextures(); it != itEnd; ++it) {
+ QVkTexture *texD = QRHI_RES(QVkTexture, it.key());
+ VkImageLayout layout = toVkLayout(it->access);
+ VkAccessFlags access = toVkAccess(it->access);
+ VkPipelineStageFlags stage = toVkPipelineStage(it->stage);
+ QVkTexture::UsageState s = toVkTextureUsageState(it->stateAtPassBegin);
+ if (s.access == access && s.stage == stage && s.layout == layout) {
+ if (!accessIsWrite(access))
+ continue;
+ }
+ VkImageMemoryBarrier barrier;
+ memset(&barrier, 0, sizeof(barrier));
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
+ barrier.subresourceRange.aspectMask = !isDepthTextureFormat(texD->m_format)
+ ? VK_IMAGE_ASPECT_COLOR_BIT : VK_IMAGE_ASPECT_DEPTH_BIT;
+ barrier.subresourceRange.baseMipLevel = 0;
+ barrier.subresourceRange.levelCount = VK_REMAINING_MIP_LEVELS;
+ barrier.subresourceRange.baseArrayLayer = 0;
+ barrier.subresourceRange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+ barrier.oldLayout = s.layout; // new textures have this set to PREINITIALIZED
+ barrier.newLayout = layout;
+ barrier.srcAccessMask = s.access; // may be 0 but that's fine
+ barrier.dstAccessMask = access;
+ barrier.image = texD->image;
+ VkPipelineStageFlags srcStage = s.stage;
+ // stage mask cannot be 0
+ if (!srcStage)
+ srcStage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
+ df->vkCmdPipelineBarrier(cbD->cb, srcStage, stage, 0,
+ 0, nullptr,
+ 0, nullptr,
+ 1, &barrier);
+ }
+}
+
+QRhiSwapChain *QRhiVulkan::createSwapChain()
+{
+ return new QVkSwapChain(this);
+}
+
+QRhiBuffer *QRhiVulkan::createBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, int size)
+{
+ return new QVkBuffer(this, type, usage, size);
+}
+
+int QRhiVulkan::ubufAlignment() const
+{
+ return int(ubufAlign); // typically 256 (bytes)
+}
+
+bool QRhiVulkan::isYUpInFramebuffer() const
+{
+ return false;
+}
+
+bool QRhiVulkan::isYUpInNDC() const
+{
+ return false;
+}
+
+bool QRhiVulkan::isClipDepthZeroToOne() const
+{
+ return true;
+}
+
+QMatrix4x4 QRhiVulkan::clipSpaceCorrMatrix() const
+{
+ // See https://matthewwellings.com/blog/the-new-vulkan-coordinate-system/
+
+ static QMatrix4x4 m;
+ if (m.isIdentity()) {
+ // NB the ctor takes row-major
+ m = QMatrix4x4(1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, -1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.5f, 0.5f,
+ 0.0f, 0.0f, 0.0f, 1.0f);
+ }
+ return m;
+}
+
+bool QRhiVulkan::isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const
+{
+ // Note that with some SDKs the validation layer gives an odd warning about
+ // BC not being supported, even when our check here succeeds. Not much we
+ // can do about that.
+ if (format >= QRhiTexture::BC1 && format <= QRhiTexture::BC7) {
+ if (!physDevFeatures.textureCompressionBC)
+ return false;
+ }
+
+ if (format >= QRhiTexture::ETC2_RGB8 && format <= QRhiTexture::ETC2_RGBA8) {
+ if (!physDevFeatures.textureCompressionETC2)
+ return false;
+ }
+
+ if (format >= QRhiTexture::ASTC_4x4 && format <= QRhiTexture::ASTC_12x12) {
+ if (!physDevFeatures.textureCompressionASTC_LDR)
+ return false;
+ }
+
+ VkFormat vkformat = toVkTextureFormat(format, flags);
+ VkFormatProperties props;
+ f->vkGetPhysicalDeviceFormatProperties(physDev, vkformat, &props);
+ return (props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) != 0;
+}
+
+bool QRhiVulkan::isFeatureSupported(QRhi::Feature feature) const
+{
+ switch (feature) {
+ case QRhi::MultisampleTexture:
+ return true;
+ case QRhi::MultisampleRenderBuffer:
+ return true;
+ case QRhi::DebugMarkers:
+ return debugMarkersAvailable;
+ case QRhi::Timestamps:
+ return timestampValidBits != 0;
+ case QRhi::Instancing:
+ return true;
+ case QRhi::CustomInstanceStepRate:
+ return vertexAttribDivisorAvailable;
+ case QRhi::PrimitiveRestart:
+ return true;
+ case QRhi::NonDynamicUniformBuffers:
+ return true;
+ case QRhi::NonFourAlignedEffectiveIndexBufferOffset:
+ return true;
+ case QRhi::NPOTTextureRepeat:
+ return true;
+ case QRhi::RedOrAlpha8IsRed:
+ return true;
+ case QRhi::ElementIndexUint:
+ return true;
+ case QRhi::Compute:
+ return hasCompute;
+ case QRhi::WideLines:
+ return hasWideLines;
+ case QRhi::VertexShaderPointSize:
+ return true;
+ case QRhi::BaseVertex:
+ return true;
+ case QRhi::BaseInstance:
+ return true;
+ case QRhi::TriangleFanTopology:
+ return true;
+ case QRhi::ReadBackNonUniformBuffer:
+ return true;
+ case QRhi::ReadBackNonBaseMipLevel:
+ return true;
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+}
+
+int QRhiVulkan::resourceLimit(QRhi::ResourceLimit limit) const
+{
+ switch (limit) {
+ case QRhi::TextureSizeMin:
+ return 1;
+ case QRhi::TextureSizeMax:
+ return int(physDevProperties.limits.maxImageDimension2D);
+ case QRhi::MaxColorAttachments:
+ return int(physDevProperties.limits.maxColorAttachments);
+ case QRhi::FramesInFlight:
+ return QVK_FRAMES_IN_FLIGHT;
+ default:
+ Q_UNREACHABLE();
+ return 0;
+ }
+}
+
+const QRhiNativeHandles *QRhiVulkan::nativeHandles()
+{
+ return &nativeHandlesStruct;
+}
+
+void QRhiVulkan::sendVMemStatsToProfiler()
+{
+ QRhiProfilerPrivate *rhiP = profilerPrivateOrNull();
+ if (!rhiP)
+ return;
+
+ VmaStats stats;
+ vmaCalculateStats(toVmaAllocator(allocator), &stats);
+ QRHI_PROF_F(vmemStat(stats.total.blockCount, stats.total.allocationCount,
+ quint32(stats.total.usedBytes), quint32(stats.total.unusedBytes)));
+}
+
+bool QRhiVulkan::makeThreadLocalNativeContextCurrent()
+{
+ // not applicable
+ return false;
+}
+
+void QRhiVulkan::releaseCachedResources()
+{
+ // nothing to do here
+}
+
+bool QRhiVulkan::isDeviceLost() const
+{
+ return deviceLost;
+}
+
+QRhiRenderBuffer *QRhiVulkan::createRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize,
+ int sampleCount, QRhiRenderBuffer::Flags flags)
+{
+ return new QVkRenderBuffer(this, type, pixelSize, sampleCount, flags);
+}
+
+QRhiTexture *QRhiVulkan::createTexture(QRhiTexture::Format format, const QSize &pixelSize,
+ int sampleCount, QRhiTexture::Flags flags)
+{
+ return new QVkTexture(this, format, pixelSize, sampleCount, flags);
+}
+
+QRhiSampler *QRhiVulkan::createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler::AddressMode u, QRhiSampler::AddressMode v)
+{
+ return new QVkSampler(this, magFilter, minFilter, mipmapMode, u, v);
+}
+
+QRhiTextureRenderTarget *QRhiVulkan::createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags)
+{
+ return new QVkTextureRenderTarget(this, desc, flags);
+}
+
+QRhiGraphicsPipeline *QRhiVulkan::createGraphicsPipeline()
+{
+ return new QVkGraphicsPipeline(this);
+}
+
+QRhiComputePipeline *QRhiVulkan::createComputePipeline()
+{
+ return new QVkComputePipeline(this);
+}
+
+QRhiShaderResourceBindings *QRhiVulkan::createShaderResourceBindings()
+{
+ return new QVkShaderResourceBindings(this);
+}
+
+void QRhiVulkan::setGraphicsPipeline(QRhiCommandBuffer *cb, QRhiGraphicsPipeline *ps)
+{
+ QVkGraphicsPipeline *psD = QRHI_RES(QVkGraphicsPipeline, ps);
+ Q_ASSERT(psD->pipeline);
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+
+ if (cbD->currentGraphicsPipeline != ps || cbD->currentPipelineGeneration != psD->generation) {
+ if (cbD->useSecondaryCb) {
+ df->vkCmdBindPipeline(cbD->secondaryCbs.last(), VK_PIPELINE_BIND_POINT_GRAPHICS, psD->pipeline);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BindPipeline;
+ cmd.args.bindPipeline.bindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
+ cmd.args.bindPipeline.pipeline = psD->pipeline;
+ cbD->commands.append(cmd);
+ }
+
+ cbD->currentGraphicsPipeline = ps;
+ cbD->currentComputePipeline = nullptr;
+ cbD->currentPipelineGeneration = psD->generation;
+ }
+
+ psD->lastActiveFrameSlot = currentFrameSlot;
+}
+
+void QRhiVulkan::setShaderResources(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass != QVkCommandBuffer::NoPass);
+ QVkGraphicsPipeline *gfxPsD = QRHI_RES(QVkGraphicsPipeline, cbD->currentGraphicsPipeline);
+ QVkComputePipeline *compPsD = QRHI_RES(QVkComputePipeline, cbD->currentComputePipeline);
+
+ if (!srb) {
+ if (gfxPsD)
+ srb = gfxPsD->m_shaderResourceBindings;
+ else
+ srb = compPsD->m_shaderResourceBindings;
+ }
+
+ QVkShaderResourceBindings *srbD = QRHI_RES(QVkShaderResourceBindings, srb);
+ bool hasSlottedResourceInSrb = false;
+ bool hasDynamicOffsetInSrb = false;
+
+ for (const QRhiShaderResourceBinding &binding : qAsConst(srbD->sortedBindings)) {
+ const QRhiShaderResourceBinding::Data *b = binding.data();
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ if (QRHI_RES(QVkBuffer, b->u.ubuf.buf)->m_type == QRhiBuffer::Dynamic)
+ hasSlottedResourceInSrb = true;
+ if (b->u.ubuf.hasDynamicOffset)
+ hasDynamicOffsetInSrb = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ const int descSetIdx = hasSlottedResourceInSrb ? currentFrameSlot : 0;
+ bool rewriteDescSet = false;
+
+ // Do host writes and mark referenced shader resources as in-use.
+ // Also prepare to ensure the descriptor set we are going to bind refers to up-to-date Vk objects.
+ for (int i = 0, ie = srbD->sortedBindings.count(); i != ie; ++i) {
+ const QRhiShaderResourceBinding::Data *b = srbD->sortedBindings.at(i).data();
+ QVkShaderResourceBindings::BoundResourceData &bd(srbD->boundResourceData[descSetIdx][i]);
+ QRhiPassResourceTracker &passResTracker(cbD->passResTrackers[cbD->currentPassResTrackerIndex]);
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, b->u.ubuf.buf);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::UniformBuffer));
+
+ if (bufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(bufD);
+
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+ trackedRegisterBuffer(&passResTracker, bufD, bufD->m_type == QRhiBuffer::Dynamic ? currentFrameSlot : 0,
+ QRhiPassResourceTracker::BufUniformRead,
+ QRhiPassResourceTracker::toPassTrackerBufferStage(b->stage));
+
+ // Check both the "local" id (the generation counter) and the
+ // global id. The latter is relevant when a newly allocated
+ // QRhiResource ends up with the same pointer as a previous one.
+ // (and that previous one could have been in an srb...)
+ if (bufD->generation != bd.ubuf.generation || bufD->m_id != bd.ubuf.id) {
+ rewriteDescSet = true;
+ bd.ubuf.id = bufD->m_id;
+ bd.ubuf.generation = bufD->generation;
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::SampledTexture:
+ {
+ QVkTexture *texD = QRHI_RES(QVkTexture, b->u.stex.tex);
+ QVkSampler *samplerD = QRHI_RES(QVkSampler, b->u.stex.sampler);
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ samplerD->lastActiveFrameSlot = currentFrameSlot;
+ trackedRegisterTexture(&passResTracker, texD,
+ QRhiPassResourceTracker::TexSample,
+ QRhiPassResourceTracker::toPassTrackerTextureStage(b->stage));
+
+ if (texD->generation != bd.stex.texGeneration
+ || texD->m_id != bd.stex.texId
+ || samplerD->generation != bd.stex.samplerGeneration
+ || samplerD->m_id != bd.stex.samplerId)
+ {
+ rewriteDescSet = true;
+ bd.stex.texId = texD->m_id;
+ bd.stex.texGeneration = texD->generation;
+ bd.stex.samplerId = samplerD->m_id;
+ bd.stex.samplerGeneration = samplerD->generation;
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ {
+ QVkTexture *texD = QRHI_RES(QVkTexture, b->u.simage.tex);
+ Q_ASSERT(texD->m_flags.testFlag(QRhiTexture::UsedWithLoadStore));
+ texD->lastActiveFrameSlot = currentFrameSlot;
+ QRhiPassResourceTracker::TextureAccess access;
+ if (b->type == QRhiShaderResourceBinding::ImageLoad)
+ access = QRhiPassResourceTracker::TexStorageLoad;
+ else if (b->type == QRhiShaderResourceBinding::ImageStore)
+ access = QRhiPassResourceTracker::TexStorageStore;
+ else
+ access = QRhiPassResourceTracker::TexStorageLoadStore;
+ trackedRegisterTexture(&passResTracker, texD,
+ access,
+ QRhiPassResourceTracker::toPassTrackerTextureStage(b->stage));
+
+ if (texD->generation != bd.simage.generation || texD->m_id != bd.simage.id) {
+ rewriteDescSet = true;
+ bd.simage.id = texD->m_id;
+ bd.simage.generation = texD->generation;
+ }
+ }
+ break;
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, b->u.sbuf.buf);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::StorageBuffer));
+
+ if (bufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(bufD);
+
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+ QRhiPassResourceTracker::BufferAccess access;
+ if (b->type == QRhiShaderResourceBinding::BufferLoad)
+ access = QRhiPassResourceTracker::BufStorageLoad;
+ else if (b->type == QRhiShaderResourceBinding::BufferStore)
+ access = QRhiPassResourceTracker::BufStorageStore;
+ else
+ access = QRhiPassResourceTracker::BufStorageLoadStore;
+ trackedRegisterBuffer(&passResTracker, bufD, bufD->m_type == QRhiBuffer::Dynamic ? currentFrameSlot : 0,
+ access,
+ QRhiPassResourceTracker::toPassTrackerBufferStage(b->stage));
+
+ if (bufD->generation != bd.sbuf.generation || bufD->m_id != bd.sbuf.id) {
+ rewriteDescSet = true;
+ bd.sbuf.id = bufD->m_id;
+ bd.sbuf.generation = bufD->generation;
+ }
+ }
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ // write descriptor sets, if needed
+ if (rewriteDescSet)
+ updateShaderResourceBindings(srb, descSetIdx);
+
+ // make sure the descriptors for the correct slot will get bound.
+ // also, dynamic offsets always need a bind.
+ const bool forceRebind = (hasSlottedResourceInSrb && cbD->currentDescSetSlot != descSetIdx) || hasDynamicOffsetInSrb;
+
+ const bool srbChanged = gfxPsD ? (cbD->currentGraphicsSrb != srb) : (cbD->currentComputeSrb != srb);
+
+ if (forceRebind || rewriteDescSet || srbChanged || cbD->currentSrbGeneration != srbD->generation) {
+ QVarLengthArray<uint32_t, 4> dynOfs;
+ if (hasDynamicOffsetInSrb) {
+ // Filling out dynOfs based on the sorted bindings is important
+ // because dynOfs has to be ordered based on the binding numbers,
+ // and neither srb nor dynamicOffsets has any such ordering
+ // requirement.
+ for (const QRhiShaderResourceBinding &binding : qAsConst(srbD->sortedBindings)) {
+ const QRhiShaderResourceBinding::Data *b = binding.data();
+ if (b->type == QRhiShaderResourceBinding::UniformBuffer && b->u.ubuf.hasDynamicOffset) {
+ uint32_t offset = 0;
+ for (int i = 0; i < dynamicOffsetCount; ++i) {
+ const QRhiCommandBuffer::DynamicOffset &dynOfs(dynamicOffsets[i]);
+ if (dynOfs.first == b->binding) {
+ offset = dynOfs.second;
+ break;
+ }
+ }
+ dynOfs.append(offset); // use 0 if dynamicOffsets did not contain this binding
+ }
+ }
+ }
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdBindDescriptorSets(cbD->secondaryCbs.last(),
+ gfxPsD ? VK_PIPELINE_BIND_POINT_GRAPHICS : VK_PIPELINE_BIND_POINT_COMPUTE,
+ gfxPsD ? gfxPsD->layout : compPsD->layout,
+ 0, 1, &srbD->descSets[descSetIdx],
+ uint32_t(dynOfs.count()),
+ dynOfs.count() ? dynOfs.constData() : nullptr);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BindDescriptorSet;
+ cmd.args.bindDescriptorSet.bindPoint = gfxPsD ? VK_PIPELINE_BIND_POINT_GRAPHICS
+ : VK_PIPELINE_BIND_POINT_COMPUTE;
+ cmd.args.bindDescriptorSet.pipelineLayout = gfxPsD ? gfxPsD->layout : compPsD->layout;
+ cmd.args.bindDescriptorSet.descSet = srbD->descSets[descSetIdx];
+ cmd.args.bindDescriptorSet.dynamicOffsetCount = dynOfs.count();
+ cmd.args.bindDescriptorSet.dynamicOffsetIndex = cbD->pools.dynamicOffset.count();
+ cbD->pools.dynamicOffset.append(dynOfs.constData(), dynOfs.count());
+ cbD->commands.append(cmd);
+ }
+
+ if (gfxPsD) {
+ cbD->currentGraphicsSrb = srb;
+ cbD->currentComputeSrb = nullptr;
+ } else {
+ cbD->currentGraphicsSrb = nullptr;
+ cbD->currentComputeSrb = srb;
+ }
+ cbD->currentSrbGeneration = srbD->generation;
+ cbD->currentDescSetSlot = descSetIdx;
+ }
+
+ srbD->lastActiveFrameSlot = currentFrameSlot;
+}
+
+void QRhiVulkan::setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset, QRhiCommandBuffer::IndexFormat indexFormat)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+ QRhiPassResourceTracker &passResTracker(cbD->passResTrackers[cbD->currentPassResTrackerIndex]);
+
+ bool needsBindVBuf = false;
+ for (int i = 0; i < bindingCount; ++i) {
+ const int inputSlot = startBinding + i;
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, bindings[i].first);
+ Q_ASSERT(bufD->m_usage.testFlag(QRhiBuffer::VertexBuffer));
+ bufD->lastActiveFrameSlot = currentFrameSlot;
+ if (bufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(bufD);
+
+ const VkBuffer vkvertexbuf = bufD->buffers[bufD->m_type == QRhiBuffer::Dynamic ? currentFrameSlot : 0];
+ if (cbD->currentVertexBuffers[inputSlot] != vkvertexbuf
+ || cbD->currentVertexOffsets[inputSlot] != bindings[i].second)
+ {
+ needsBindVBuf = true;
+ cbD->currentVertexBuffers[inputSlot] = vkvertexbuf;
+ cbD->currentVertexOffsets[inputSlot] = bindings[i].second;
+ }
+ }
+
+ if (needsBindVBuf) {
+ QVarLengthArray<VkBuffer, 4> bufs;
+ QVarLengthArray<VkDeviceSize, 4> ofs;
+ for (int i = 0; i < bindingCount; ++i) {
+ QVkBuffer *bufD = QRHI_RES(QVkBuffer, bindings[i].first);
+ const int slot = bufD->m_type == QRhiBuffer::Dynamic ? currentFrameSlot : 0;
+ bufs.append(bufD->buffers[slot]);
+ ofs.append(bindings[i].second);
+ trackedRegisterBuffer(&passResTracker, bufD, slot,
+ QRhiPassResourceTracker::BufVertexInput,
+ QRhiPassResourceTracker::BufVertexInputStage);
+ }
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdBindVertexBuffers(cbD->secondaryCbs.last(), uint32_t(startBinding),
+ uint32_t(bufs.count()), bufs.constData(), ofs.constData());
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BindVertexBuffer;
+ cmd.args.bindVertexBuffer.startBinding = startBinding;
+ cmd.args.bindVertexBuffer.count = bufs.count();
+ cmd.args.bindVertexBuffer.vertexBufferIndex = cbD->pools.vertexBuffer.count();
+ cbD->pools.vertexBuffer.append(bufs.constData(), bufs.count());
+ cmd.args.bindVertexBuffer.vertexBufferOffsetIndex = cbD->pools.vertexBufferOffset.count();
+ cbD->pools.vertexBufferOffset.append(ofs.constData(), ofs.count());
+ cbD->commands.append(cmd);
+ }
+ }
+
+ if (indexBuf) {
+ QVkBuffer *ibufD = QRHI_RES(QVkBuffer, indexBuf);
+ Q_ASSERT(ibufD->m_usage.testFlag(QRhiBuffer::IndexBuffer));
+ ibufD->lastActiveFrameSlot = currentFrameSlot;
+ if (ibufD->m_type == QRhiBuffer::Dynamic)
+ executeBufferHostWritesForCurrentFrame(ibufD);
+
+ const int slot = ibufD->m_type == QRhiBuffer::Dynamic ? currentFrameSlot : 0;
+ const VkBuffer vkindexbuf = ibufD->buffers[slot];
+ const VkIndexType type = indexFormat == QRhiCommandBuffer::IndexUInt16 ? VK_INDEX_TYPE_UINT16
+ : VK_INDEX_TYPE_UINT32;
+
+ if (cbD->currentIndexBuffer != vkindexbuf
+ || cbD->currentIndexOffset != indexOffset
+ || cbD->currentIndexFormat != type)
+ {
+ cbD->currentIndexBuffer = vkindexbuf;
+ cbD->currentIndexOffset = indexOffset;
+ cbD->currentIndexFormat = type;
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdBindIndexBuffer(cbD->secondaryCbs.last(), vkindexbuf, indexOffset, type);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::BindIndexBuffer;
+ cmd.args.bindIndexBuffer.buf = vkindexbuf;
+ cmd.args.bindIndexBuffer.ofs = indexOffset;
+ cmd.args.bindIndexBuffer.type = type;
+ cbD->commands.append(cmd);
+ }
+
+ trackedRegisterBuffer(&passResTracker, ibufD, slot,
+ QRhiPassResourceTracker::BufIndexRead,
+ QRhiPassResourceTracker::BufVertexInputStage);
+ }
+ }
+}
+
+void QRhiVulkan::setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+ const QSize outputSize = cbD->currentTarget->pixelSize();
+
+ // x,y is top-left in VkViewport but bottom-left in QRhiViewport
+ float x, y, w, h;
+ if (!qrhi_toTopLeftRenderTargetRect(outputSize, viewport.viewport(), &x, &y, &w, &h))
+ return;
+
+ QVkCommandBuffer::Command cmd;
+ VkViewport *vp = &cmd.args.setViewport.viewport;
+ vp->x = x;
+ vp->y = y;
+ vp->width = w;
+ vp->height = h;
+ vp->minDepth = viewport.minDepth();
+ vp->maxDepth = viewport.maxDepth();
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdSetViewport(cbD->secondaryCbs.last(), 0, 1, vp);
+ } else {
+ cmd.cmd = QVkCommandBuffer::Command::SetViewport;
+ cbD->commands.append(cmd);
+ }
+
+ if (!QRHI_RES(QVkGraphicsPipeline, cbD->currentGraphicsPipeline)->m_flags.testFlag(QRhiGraphicsPipeline::UsesScissor)) {
+ VkRect2D *s = &cmd.args.setScissor.scissor;
+ s->offset.x = int32_t(x);
+ s->offset.y = int32_t(y);
+ s->extent.width = uint32_t(w);
+ s->extent.height = uint32_t(h);
+ if (cbD->useSecondaryCb) {
+ df->vkCmdSetScissor(cbD->secondaryCbs.last(), 0, 1, s);
+ } else {
+ cmd.cmd = QVkCommandBuffer::Command::SetScissor;
+ cbD->commands.append(cmd);
+ }
+ }
+}
+
+void QRhiVulkan::setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+ Q_ASSERT(QRHI_RES(QVkGraphicsPipeline, cbD->currentGraphicsPipeline)->m_flags.testFlag(QRhiGraphicsPipeline::UsesScissor));
+ const QSize outputSize = cbD->currentTarget->pixelSize();
+
+ // x,y is top-left in VkRect2D but bottom-left in QRhiScissor
+ int x, y, w, h;
+ if (!qrhi_toTopLeftRenderTargetRect(outputSize, scissor.scissor(), &x, &y, &w, &h))
+ return;
+
+ QVkCommandBuffer::Command cmd;
+ VkRect2D *s = &cmd.args.setScissor.scissor;
+ s->offset.x = x;
+ s->offset.y = y;
+ s->extent.width = uint32_t(w);
+ s->extent.height = uint32_t(h);
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdSetScissor(cbD->secondaryCbs.last(), 0, 1, s);
+ } else {
+ cmd.cmd = QVkCommandBuffer::Command::SetScissor;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::setBlendConstants(QRhiCommandBuffer *cb, const QColor &c)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+
+ if (cbD->useSecondaryCb) {
+ float constants[] = { float(c.redF()), float(c.greenF()), float(c.blueF()), float(c.alphaF()) };
+ df->vkCmdSetBlendConstants(cbD->secondaryCbs.last(), constants);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::SetBlendConstants;
+ cmd.args.setBlendConstants.c[0] = float(c.redF());
+ cmd.args.setBlendConstants.c[1] = float(c.greenF());
+ cmd.args.setBlendConstants.c[2] = float(c.blueF());
+ cmd.args.setBlendConstants.c[3] = float(c.alphaF());
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::setStencilRef(QRhiCommandBuffer *cb, quint32 refValue)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdSetStencilReference(cbD->secondaryCbs.last(), VK_STENCIL_FRONT_AND_BACK, refValue);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::SetStencilRef;
+ cmd.args.setStencilRef.ref = refValue;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdDraw(cbD->secondaryCbs.last(), vertexCount, instanceCount, firstVertex, firstInstance);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::Draw;
+ cmd.args.draw.vertexCount = vertexCount;
+ cmd.args.draw.instanceCount = instanceCount;
+ cmd.args.draw.firstVertex = firstVertex;
+ cmd.args.draw.firstInstance = firstInstance;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex, qint32 vertexOffset, quint32 firstInstance)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ Q_ASSERT(cbD->recordingPass == QVkCommandBuffer::RenderPass);
+
+ if (cbD->useSecondaryCb) {
+ df->vkCmdDrawIndexed(cbD->secondaryCbs.last(), indexCount, instanceCount,
+ firstIndex, vertexOffset, firstInstance);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::DrawIndexed;
+ cmd.args.drawIndexed.indexCount = indexCount;
+ cmd.args.drawIndexed.instanceCount = instanceCount;
+ cmd.args.drawIndexed.firstIndex = firstIndex;
+ cmd.args.drawIndexed.vertexOffset = vertexOffset;
+ cmd.args.drawIndexed.firstInstance = firstInstance;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name)
+{
+ if (!debugMarkers || !debugMarkersAvailable)
+ return;
+
+ VkDebugMarkerMarkerInfoEXT marker;
+ memset(&marker, 0, sizeof(marker));
+ marker.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT;
+
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ if (cbD->recordingPass != QVkCommandBuffer::NoPass && cbD->useSecondaryCb) {
+ marker.pMarkerName = name.constData();
+ vkCmdDebugMarkerBegin(cbD->secondaryCbs.last(), &marker);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::DebugMarkerBegin;
+ cmd.args.debugMarkerBegin.marker = marker;
+ cmd.args.debugMarkerBegin.markerNameIndex = cbD->pools.debugMarkerData.count();
+ cbD->pools.debugMarkerData.append(name);
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::debugMarkEnd(QRhiCommandBuffer *cb)
+{
+ if (!debugMarkers || !debugMarkersAvailable)
+ return;
+
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ if (cbD->recordingPass != QVkCommandBuffer::NoPass && cbD->useSecondaryCb) {
+ vkCmdDebugMarkerEnd(cbD->secondaryCbs.last());
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::DebugMarkerEnd;
+ cbD->commands.append(cmd);
+ }
+}
+
+void QRhiVulkan::debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg)
+{
+ if (!debugMarkers || !debugMarkersAvailable)
+ return;
+
+ VkDebugMarkerMarkerInfoEXT marker;
+ memset(&marker, 0, sizeof(marker));
+ marker.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT;
+
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+ if (cbD->recordingPass != QVkCommandBuffer::NoPass && cbD->useSecondaryCb) {
+ marker.pMarkerName = msg.constData();
+ vkCmdDebugMarkerInsert(cbD->secondaryCbs.last(), &marker);
+ } else {
+ QVkCommandBuffer::Command cmd;
+ cmd.cmd = QVkCommandBuffer::Command::DebugMarkerInsert;
+ cmd.args.debugMarkerInsert.marker = marker;
+ cmd.args.debugMarkerInsert.markerNameIndex = cbD->pools.debugMarkerData.count();
+ cbD->pools.debugMarkerData.append(msg);
+ cbD->commands.append(cmd);
+ }
+}
+
+const QRhiNativeHandles *QRhiVulkan::nativeHandles(QRhiCommandBuffer *cb)
+{
+ return QRHI_RES(QVkCommandBuffer, cb)->nativeHandles();
+}
+
+static inline QVkRenderTargetData *maybeRenderTargetData(QVkCommandBuffer *cbD)
+{
+ Q_ASSERT(cbD->currentTarget);
+ QVkRenderTargetData *rtD = nullptr;
+ if (cbD->recordingPass == QVkCommandBuffer::RenderPass) {
+ switch (cbD->currentTarget->resourceType()) {
+ case QRhiResource::RenderTarget:
+ rtD = &QRHI_RES(QVkReferenceRenderTarget, cbD->currentTarget)->d;
+ break;
+ case QRhiResource::TextureRenderTarget:
+ rtD = &QRHI_RES(QVkTextureRenderTarget, cbD->currentTarget)->d;
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+ return rtD;
+}
+
+void QRhiVulkan::beginExternal(QRhiCommandBuffer *cb)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+
+ // When not in a pass, it is simple: record what we have (but do not
+ // submit), the cb can then be used to record more external commands.
+ if (cbD->recordingPass == QVkCommandBuffer::NoPass) {
+ recordPrimaryCommandBuffer(cbD);
+ cbD->resetCommands();
+ return;
+ }
+
+ // Otherwise, inside a pass, have a secondary command buffer (with
+ // RENDER_PASS_CONTINUE). Using the main one is not acceptable since we
+ // cannot just record at this stage, that would mess up the resource
+ // tracking and commands like TransitionPassResources.
+
+ if (cbD->inExternal)
+ return;
+
+ if (!cbD->useSecondaryCb) {
+ qWarning("beginExternal() within a pass is only supported with secondary command buffers. "
+ "This can be enabled by passing QRhi::ExternalContentsInPass to beginFrame().");
+ return;
+ }
+
+ VkCommandBuffer secondaryCb = cbD->secondaryCbs.last();
+ cbD->secondaryCbs.removeLast();
+ endAndEnqueueSecondaryCommandBuffer(secondaryCb, cbD);
+
+ VkCommandBuffer extCb = startSecondaryCommandBuffer(maybeRenderTargetData(cbD));
+ if (extCb) {
+ cbD->secondaryCbs.append(extCb);
+ cbD->inExternal = true;
+ }
+}
+
+void QRhiVulkan::endExternal(QRhiCommandBuffer *cb)
+{
+ QVkCommandBuffer *cbD = QRHI_RES(QVkCommandBuffer, cb);
+
+ if (cbD->recordingPass == QVkCommandBuffer::NoPass) {
+ Q_ASSERT(cbD->commands.isEmpty() && cbD->currentPassResTrackerIndex == -1);
+ } else if (cbD->inExternal) {
+ VkCommandBuffer extCb = cbD->secondaryCbs.last();
+ cbD->secondaryCbs.removeLast();
+ endAndEnqueueSecondaryCommandBuffer(extCb, cbD);
+ cbD->secondaryCbs.append(startSecondaryCommandBuffer(maybeRenderTargetData(cbD)));
+ }
+
+ cbD->resetCachedState();
+}
+
+void QRhiVulkan::setObjectName(uint64_t object, VkDebugReportObjectTypeEXT type, const QByteArray &name, int slot)
+{
+ if (!debugMarkers || !debugMarkersAvailable || name.isEmpty())
+ return;
+
+ VkDebugMarkerObjectNameInfoEXT nameInfo;
+ memset(&nameInfo, 0, sizeof(nameInfo));
+ nameInfo.sType = VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT;
+ nameInfo.objectType = type;
+ nameInfo.object = object;
+ QByteArray decoratedName = name;
+ if (slot >= 0) {
+ decoratedName += '/';
+ decoratedName += QByteArray::number(slot);
+ }
+ nameInfo.pObjectName = decoratedName.constData();
+ vkDebugMarkerSetObjectName(dev, &nameInfo);
+}
+
+static inline VkBufferUsageFlagBits toVkBufferUsage(QRhiBuffer::UsageFlags usage)
+{
+ int u = 0;
+ if (usage.testFlag(QRhiBuffer::VertexBuffer))
+ u |= VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
+ if (usage.testFlag(QRhiBuffer::IndexBuffer))
+ u |= VK_BUFFER_USAGE_INDEX_BUFFER_BIT;
+ if (usage.testFlag(QRhiBuffer::UniformBuffer))
+ u |= VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
+ if (usage.testFlag(QRhiBuffer::StorageBuffer))
+ u |= VK_BUFFER_USAGE_STORAGE_BUFFER_BIT;
+ return VkBufferUsageFlagBits(u);
+}
+
+static inline VkFilter toVkFilter(QRhiSampler::Filter f)
+{
+ switch (f) {
+ case QRhiSampler::Nearest:
+ return VK_FILTER_NEAREST;
+ case QRhiSampler::Linear:
+ return VK_FILTER_LINEAR;
+ default:
+ Q_UNREACHABLE();
+ return VK_FILTER_NEAREST;
+ }
+}
+
+static inline VkSamplerMipmapMode toVkMipmapMode(QRhiSampler::Filter f)
+{
+ switch (f) {
+ case QRhiSampler::None:
+ return VK_SAMPLER_MIPMAP_MODE_NEAREST;
+ case QRhiSampler::Nearest:
+ return VK_SAMPLER_MIPMAP_MODE_NEAREST;
+ case QRhiSampler::Linear:
+ return VK_SAMPLER_MIPMAP_MODE_LINEAR;
+ default:
+ Q_UNREACHABLE();
+ return VK_SAMPLER_MIPMAP_MODE_NEAREST;
+ }
+}
+
+static inline VkSamplerAddressMode toVkAddressMode(QRhiSampler::AddressMode m)
+{
+ switch (m) {
+ case QRhiSampler::Repeat:
+ return VK_SAMPLER_ADDRESS_MODE_REPEAT;
+ case QRhiSampler::ClampToEdge:
+ return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
+ case QRhiSampler::Border:
+ return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER;
+ case QRhiSampler::Mirror:
+ return VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT;
+ case QRhiSampler::MirrorOnce:
+ return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
+ default:
+ Q_UNREACHABLE();
+ return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
+ }
+}
+
+static inline VkShaderStageFlagBits toVkShaderStage(QRhiShaderStage::Type type)
+{
+ switch (type) {
+ case QRhiShaderStage::Vertex:
+ return VK_SHADER_STAGE_VERTEX_BIT;
+ case QRhiShaderStage::Fragment:
+ return VK_SHADER_STAGE_FRAGMENT_BIT;
+ case QRhiShaderStage::Compute:
+ return VK_SHADER_STAGE_COMPUTE_BIT;
+ default:
+ Q_UNREACHABLE();
+ return VK_SHADER_STAGE_VERTEX_BIT;
+ }
+}
+
+static inline VkFormat toVkAttributeFormat(QRhiVertexInputAttribute::Format format)
+{
+ switch (format) {
+ case QRhiVertexInputAttribute::Float4:
+ return VK_FORMAT_R32G32B32A32_SFLOAT;
+ case QRhiVertexInputAttribute::Float3:
+ return VK_FORMAT_R32G32B32_SFLOAT;
+ case QRhiVertexInputAttribute::Float2:
+ return VK_FORMAT_R32G32_SFLOAT;
+ case QRhiVertexInputAttribute::Float:
+ return VK_FORMAT_R32_SFLOAT;
+ case QRhiVertexInputAttribute::UNormByte4:
+ return VK_FORMAT_R8G8B8A8_UNORM;
+ case QRhiVertexInputAttribute::UNormByte2:
+ return VK_FORMAT_R8G8_UNORM;
+ case QRhiVertexInputAttribute::UNormByte:
+ return VK_FORMAT_R8_UNORM;
+ default:
+ Q_UNREACHABLE();
+ return VK_FORMAT_R32G32B32A32_SFLOAT;
+ }
+}
+
+static inline VkPrimitiveTopology toVkTopology(QRhiGraphicsPipeline::Topology t)
+{
+ switch (t) {
+ case QRhiGraphicsPipeline::Triangles:
+ return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ case QRhiGraphicsPipeline::TriangleStrip:
+ return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
+ case QRhiGraphicsPipeline::TriangleFan:
+ return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN;
+ case QRhiGraphicsPipeline::Lines:
+ return VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
+ case QRhiGraphicsPipeline::LineStrip:
+ return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
+ case QRhiGraphicsPipeline::Points:
+ return VK_PRIMITIVE_TOPOLOGY_POINT_LIST;
+ default:
+ Q_UNREACHABLE();
+ return VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
+ }
+}
+
+static inline VkCullModeFlags toVkCullMode(QRhiGraphicsPipeline::CullMode c)
+{
+ switch (c) {
+ case QRhiGraphicsPipeline::None:
+ return VK_CULL_MODE_NONE;
+ case QRhiGraphicsPipeline::Front:
+ return VK_CULL_MODE_FRONT_BIT;
+ case QRhiGraphicsPipeline::Back:
+ return VK_CULL_MODE_BACK_BIT;
+ default:
+ Q_UNREACHABLE();
+ return VK_CULL_MODE_NONE;
+ }
+}
+
+static inline VkFrontFace toVkFrontFace(QRhiGraphicsPipeline::FrontFace f)
+{
+ switch (f) {
+ case QRhiGraphicsPipeline::CCW:
+ return VK_FRONT_FACE_COUNTER_CLOCKWISE;
+ case QRhiGraphicsPipeline::CW:
+ return VK_FRONT_FACE_CLOCKWISE;
+ default:
+ Q_UNREACHABLE();
+ return VK_FRONT_FACE_COUNTER_CLOCKWISE;
+ }
+}
+
+static inline VkColorComponentFlags toVkColorComponents(QRhiGraphicsPipeline::ColorMask c)
+{
+ int f = 0;
+ if (c.testFlag(QRhiGraphicsPipeline::R))
+ f |= VK_COLOR_COMPONENT_R_BIT;
+ if (c.testFlag(QRhiGraphicsPipeline::G))
+ f |= VK_COLOR_COMPONENT_G_BIT;
+ if (c.testFlag(QRhiGraphicsPipeline::B))
+ f |= VK_COLOR_COMPONENT_B_BIT;
+ if (c.testFlag(QRhiGraphicsPipeline::A))
+ f |= VK_COLOR_COMPONENT_A_BIT;
+ return VkColorComponentFlags(f);
+}
+
+static inline VkBlendFactor toVkBlendFactor(QRhiGraphicsPipeline::BlendFactor f)
+{
+ switch (f) {
+ case QRhiGraphicsPipeline::Zero:
+ return VK_BLEND_FACTOR_ZERO;
+ case QRhiGraphicsPipeline::One:
+ return VK_BLEND_FACTOR_ONE;
+ case QRhiGraphicsPipeline::SrcColor:
+ return VK_BLEND_FACTOR_SRC_COLOR;
+ case QRhiGraphicsPipeline::OneMinusSrcColor:
+ return VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR;
+ case QRhiGraphicsPipeline::DstColor:
+ return VK_BLEND_FACTOR_DST_COLOR;
+ case QRhiGraphicsPipeline::OneMinusDstColor:
+ return VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR;
+ case QRhiGraphicsPipeline::SrcAlpha:
+ return VK_BLEND_FACTOR_SRC_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusSrcAlpha:
+ return VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
+ case QRhiGraphicsPipeline::DstAlpha:
+ return VK_BLEND_FACTOR_DST_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusDstAlpha:
+ return VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA;
+ case QRhiGraphicsPipeline::ConstantColor:
+ return VK_BLEND_FACTOR_CONSTANT_COLOR;
+ case QRhiGraphicsPipeline::OneMinusConstantColor:
+ return VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR;
+ case QRhiGraphicsPipeline::ConstantAlpha:
+ return VK_BLEND_FACTOR_CONSTANT_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusConstantAlpha:
+ return VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA;
+ case QRhiGraphicsPipeline::SrcAlphaSaturate:
+ return VK_BLEND_FACTOR_SRC_ALPHA_SATURATE;
+ case QRhiGraphicsPipeline::Src1Color:
+ return VK_BLEND_FACTOR_SRC1_COLOR;
+ case QRhiGraphicsPipeline::OneMinusSrc1Color:
+ return VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR;
+ case QRhiGraphicsPipeline::Src1Alpha:
+ return VK_BLEND_FACTOR_SRC1_ALPHA;
+ case QRhiGraphicsPipeline::OneMinusSrc1Alpha:
+ return VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA;
+ default:
+ Q_UNREACHABLE();
+ return VK_BLEND_FACTOR_ZERO;
+ }
+}
+
+static inline VkBlendOp toVkBlendOp(QRhiGraphicsPipeline::BlendOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Add:
+ return VK_BLEND_OP_ADD;
+ case QRhiGraphicsPipeline::Subtract:
+ return VK_BLEND_OP_SUBTRACT;
+ case QRhiGraphicsPipeline::ReverseSubtract:
+ return VK_BLEND_OP_REVERSE_SUBTRACT;
+ case QRhiGraphicsPipeline::Min:
+ return VK_BLEND_OP_MIN;
+ case QRhiGraphicsPipeline::Max:
+ return VK_BLEND_OP_MAX;
+ default:
+ Q_UNREACHABLE();
+ return VK_BLEND_OP_ADD;
+ }
+}
+
+static inline VkCompareOp toVkCompareOp(QRhiGraphicsPipeline::CompareOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::Never:
+ return VK_COMPARE_OP_NEVER;
+ case QRhiGraphicsPipeline::Less:
+ return VK_COMPARE_OP_LESS;
+ case QRhiGraphicsPipeline::Equal:
+ return VK_COMPARE_OP_EQUAL;
+ case QRhiGraphicsPipeline::LessOrEqual:
+ return VK_COMPARE_OP_LESS_OR_EQUAL;
+ case QRhiGraphicsPipeline::Greater:
+ return VK_COMPARE_OP_GREATER;
+ case QRhiGraphicsPipeline::NotEqual:
+ return VK_COMPARE_OP_NOT_EQUAL;
+ case QRhiGraphicsPipeline::GreaterOrEqual:
+ return VK_COMPARE_OP_GREATER_OR_EQUAL;
+ case QRhiGraphicsPipeline::Always:
+ return VK_COMPARE_OP_ALWAYS;
+ default:
+ Q_UNREACHABLE();
+ return VK_COMPARE_OP_ALWAYS;
+ }
+}
+
+static inline VkStencilOp toVkStencilOp(QRhiGraphicsPipeline::StencilOp op)
+{
+ switch (op) {
+ case QRhiGraphicsPipeline::StencilZero:
+ return VK_STENCIL_OP_ZERO;
+ case QRhiGraphicsPipeline::Keep:
+ return VK_STENCIL_OP_KEEP;
+ case QRhiGraphicsPipeline::Replace:
+ return VK_STENCIL_OP_REPLACE;
+ case QRhiGraphicsPipeline::IncrementAndClamp:
+ return VK_STENCIL_OP_INCREMENT_AND_CLAMP;
+ case QRhiGraphicsPipeline::DecrementAndClamp:
+ return VK_STENCIL_OP_DECREMENT_AND_CLAMP;
+ case QRhiGraphicsPipeline::Invert:
+ return VK_STENCIL_OP_INVERT;
+ case QRhiGraphicsPipeline::IncrementAndWrap:
+ return VK_STENCIL_OP_INCREMENT_AND_WRAP;
+ case QRhiGraphicsPipeline::DecrementAndWrap:
+ return VK_STENCIL_OP_DECREMENT_AND_WRAP;
+ default:
+ Q_UNREACHABLE();
+ return VK_STENCIL_OP_KEEP;
+ }
+}
+
+static inline void fillVkStencilOpState(VkStencilOpState *dst, const QRhiGraphicsPipeline::StencilOpState &src)
+{
+ dst->failOp = toVkStencilOp(src.failOp);
+ dst->passOp = toVkStencilOp(src.passOp);
+ dst->depthFailOp = toVkStencilOp(src.depthFailOp);
+ dst->compareOp = toVkCompareOp(src.compareOp);
+}
+
+static inline VkDescriptorType toVkDescriptorType(const QRhiShaderResourceBinding::Data *b)
+{
+ switch (b->type) {
+ case QRhiShaderResourceBinding::UniformBuffer:
+ return b->u.ubuf.hasDynamicOffset ? VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC
+ : VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
+
+ case QRhiShaderResourceBinding::SampledTexture:
+ return VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
+
+ case QRhiShaderResourceBinding::ImageLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::ImageLoadStore:
+ return VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
+
+ case QRhiShaderResourceBinding::BufferLoad:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferStore:
+ Q_FALLTHROUGH();
+ case QRhiShaderResourceBinding::BufferLoadStore:
+ return VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
+
+ default:
+ Q_UNREACHABLE();
+ return VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
+ }
+}
+
+static inline VkShaderStageFlags toVkShaderStageFlags(QRhiShaderResourceBinding::StageFlags stage)
+{
+ int s = 0;
+ if (stage.testFlag(QRhiShaderResourceBinding::VertexStage))
+ s |= VK_SHADER_STAGE_VERTEX_BIT;
+ if (stage.testFlag(QRhiShaderResourceBinding::FragmentStage))
+ s |= VK_SHADER_STAGE_FRAGMENT_BIT;
+ if (stage.testFlag(QRhiShaderResourceBinding::ComputeStage))
+ s |= VK_SHADER_STAGE_COMPUTE_BIT;
+ return VkShaderStageFlags(s);
+}
+
+static inline VkCompareOp toVkTextureCompareOp(QRhiSampler::CompareOp op)
+{
+ switch (op) {
+ case QRhiSampler::Never:
+ return VK_COMPARE_OP_NEVER;
+ case QRhiSampler::Less:
+ return VK_COMPARE_OP_LESS;
+ case QRhiSampler::Equal:
+ return VK_COMPARE_OP_EQUAL;
+ case QRhiSampler::LessOrEqual:
+ return VK_COMPARE_OP_LESS_OR_EQUAL;
+ case QRhiSampler::Greater:
+ return VK_COMPARE_OP_GREATER;
+ case QRhiSampler::NotEqual:
+ return VK_COMPARE_OP_NOT_EQUAL;
+ case QRhiSampler::GreaterOrEqual:
+ return VK_COMPARE_OP_GREATER_OR_EQUAL;
+ case QRhiSampler::Always:
+ return VK_COMPARE_OP_ALWAYS;
+ default:
+ Q_UNREACHABLE();
+ return VK_COMPARE_OP_NEVER;
+ }
+}
+
+QVkBuffer::QVkBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size)
+ : QRhiBuffer(rhi, type, usage, size)
+{
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ buffers[i] = stagingBuffers[i] = VK_NULL_HANDLE;
+ allocations[i] = stagingAllocations[i] = nullptr;
+ }
+}
+
+QVkBuffer::~QVkBuffer()
+{
+ release();
+}
+
+void QVkBuffer::release()
+{
+ if (!buffers[0])
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::Buffer;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ e.buffer.buffers[i] = buffers[i];
+ e.buffer.allocations[i] = allocations[i];
+ e.buffer.stagingBuffers[i] = stagingBuffers[i];
+ e.buffer.stagingAllocations[i] = stagingAllocations[i];
+
+ buffers[i] = VK_NULL_HANDLE;
+ allocations[i] = nullptr;
+ stagingBuffers[i] = VK_NULL_HANDLE;
+ stagingAllocations[i] = nullptr;
+ pendingDynamicUpdates[i].clear();
+ }
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseBuffer(this));
+
+ rhiD->unregisterResource(this);
+}
+
+bool QVkBuffer::build()
+{
+ if (buffers[0])
+ release();
+
+ if (m_usage.testFlag(QRhiBuffer::StorageBuffer) && m_type == Dynamic) {
+ qWarning("StorageBuffer cannot be combined with Dynamic");
+ return false;
+ }
+
+ const int nonZeroSize = m_size <= 0 ? 256 : m_size;
+
+ VkBufferCreateInfo bufferInfo;
+ memset(&bufferInfo, 0, sizeof(bufferInfo));
+ bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
+ bufferInfo.size = uint32_t(nonZeroSize);
+ bufferInfo.usage = toVkBufferUsage(m_usage);
+
+ VmaAllocationCreateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+
+ if (m_type == Dynamic) {
+#ifndef Q_OS_DARWIN // not for MoltenVK
+ // Keep mapped all the time. Essential f.ex. with some mobile GPUs,
+ // where mapping and unmapping an entire allocation every time updating
+ // a suballocated buffer presents a significant perf. hit.
+ allocInfo.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT;
+#endif
+ // host visible, frequent changes
+ allocInfo.usage = VMA_MEMORY_USAGE_CPU_TO_GPU;
+ } else {
+ allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+ bufferInfo.usage |= VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
+ }
+
+ QRHI_RES_RHI(QRhiVulkan);
+ VkResult err = VK_SUCCESS;
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ buffers[i] = VK_NULL_HANDLE;
+ allocations[i] = nullptr;
+ usageState[i].access = usageState[i].stage = 0;
+ if (i == 0 || m_type == Dynamic) {
+ VmaAllocation allocation;
+ err = vmaCreateBuffer(toVmaAllocator(rhiD->allocator), &bufferInfo, &allocInfo, &buffers[i], &allocation, nullptr);
+ if (err != VK_SUCCESS)
+ break;
+ allocations[i] = allocation;
+ rhiD->setObjectName(uint64_t(buffers[i]), VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, m_objectName,
+ m_type == Dynamic ? i : -1);
+ }
+ }
+
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create buffer: %d", err);
+ return false;
+ }
+
+ QRHI_PROF;
+ QRHI_PROF_F(newBuffer(this, uint(nonZeroSize), m_type != Dynamic ? 1 : QVK_FRAMES_IN_FLIGHT, 0));
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QVkRenderBuffer::QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, Flags flags)
+ : QRhiRenderBuffer(rhi, type, pixelSize, sampleCount, flags)
+{
+}
+
+QVkRenderBuffer::~QVkRenderBuffer()
+{
+ release();
+ delete backingTexture;
+}
+
+void QVkRenderBuffer::release()
+{
+ if (!memory && !backingTexture)
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::RenderBuffer;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.renderBuffer.memory = memory;
+ e.renderBuffer.image = image;
+ e.renderBuffer.imageView = imageView;
+
+ memory = VK_NULL_HANDLE;
+ image = VK_NULL_HANDLE;
+ imageView = VK_NULL_HANDLE;
+
+ if (backingTexture) {
+ Q_ASSERT(backingTexture->lastActiveFrameSlot == -1);
+ backingTexture->lastActiveFrameSlot = e.lastActiveFrameSlot;
+ backingTexture->release();
+ }
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseRenderBuffer(this));
+
+ rhiD->unregisterResource(this);
+}
+
+bool QVkRenderBuffer::build()
+{
+ if (memory || backingTexture)
+ release();
+
+ if (m_pixelSize.isEmpty())
+ return false;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ QRHI_PROF;
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+
+ switch (m_type) {
+ case QRhiRenderBuffer::Color:
+ {
+ if (!backingTexture) {
+ backingTexture = QRHI_RES(QVkTexture, rhiD->createTexture(QRhiTexture::RGBA8,
+ m_pixelSize,
+ m_sampleCount,
+ QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource));
+ } else {
+ backingTexture->setPixelSize(m_pixelSize);
+ backingTexture->setSampleCount(m_sampleCount);
+ }
+ backingTexture->setName(m_objectName);
+ if (!backingTexture->build())
+ return false;
+ vkformat = backingTexture->vkformat;
+ QRHI_PROF_F(newRenderBuffer(this, false, false, samples));
+ }
+ break;
+ case QRhiRenderBuffer::DepthStencil:
+ vkformat = rhiD->optimalDepthStencilFormat();
+ if (!rhiD->createTransientImage(vkformat,
+ m_pixelSize,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
+ VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT,
+ samples,
+ &memory,
+ &image,
+ &imageView,
+ 1))
+ {
+ return false;
+ }
+ rhiD->setObjectName(uint64_t(image), VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, m_objectName);
+ QRHI_PROF_F(newRenderBuffer(this, true, false, samples));
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ lastActiveFrameSlot = -1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QRhiTexture::Format QVkRenderBuffer::backingFormat() const
+{
+ return m_type == Color ? QRhiTexture::RGBA8 : QRhiTexture::UnknownFormat;
+}
+
+QVkTexture::QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags)
+ : QRhiTexture(rhi, format, pixelSize, sampleCount, flags)
+{
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ stagingBuffers[i] = VK_NULL_HANDLE;
+ stagingAllocations[i] = nullptr;
+ }
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i)
+ perLevelImageViews[i] = VK_NULL_HANDLE;
+}
+
+QVkTexture::~QVkTexture()
+{
+ release();
+}
+
+void QVkTexture::release()
+{
+ if (!image)
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::Texture;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.texture.image = owns ? image : VK_NULL_HANDLE;
+ e.texture.imageView = imageView;
+ e.texture.allocation = owns ? imageAlloc : nullptr;
+
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i) {
+ e.texture.stagingBuffers[i] = stagingBuffers[i];
+ e.texture.stagingAllocations[i] = stagingAllocations[i];
+
+ stagingBuffers[i] = VK_NULL_HANDLE;
+ stagingAllocations[i] = nullptr;
+ }
+
+ for (int i = 0; i < QRhi::MAX_LEVELS; ++i) {
+ e.texture.extraImageViews[i] = perLevelImageViews[i];
+ perLevelImageViews[i] = VK_NULL_HANDLE;
+ }
+
+ image = VK_NULL_HANDLE;
+ imageView = VK_NULL_HANDLE;
+ imageAlloc = nullptr;
+ nativeHandlesStruct.image = VK_NULL_HANDLE;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseTexture(this));
+
+ rhiD->unregisterResource(this);
+}
+
+bool QVkTexture::prepareBuild(QSize *adjustedSize)
+{
+ if (image)
+ release();
+
+ QRHI_RES_RHI(QRhiVulkan);
+ vkformat = toVkTextureFormat(m_format, m_flags);
+ VkFormatProperties props;
+ rhiD->f->vkGetPhysicalDeviceFormatProperties(rhiD->physDev, vkformat, &props);
+ const bool canSampleOptimal = (props.optimalTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT);
+ if (!canSampleOptimal) {
+ qWarning("Texture sampling with optimal tiling for format %d not supported", vkformat);
+ return false;
+ }
+
+ const QSize size = m_pixelSize.isEmpty() ? QSize(1, 1) : m_pixelSize;
+ const bool isCube = m_flags.testFlag(CubeMap);
+ const bool hasMipMaps = m_flags.testFlag(MipMapped);
+
+ mipLevelCount = uint(hasMipMaps ? rhiD->q->mipLevelsForSize(size) : 1);
+ const int maxLevels = QRhi::MAX_LEVELS;
+ if (mipLevelCount > maxLevels) {
+ qWarning("Too many mip levels (%d, max is %d), truncating mip chain", mipLevelCount, maxLevels);
+ mipLevelCount = maxLevels;
+ }
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+ if (samples > VK_SAMPLE_COUNT_1_BIT) {
+ if (isCube) {
+ qWarning("Cubemap texture cannot be multisample");
+ return false;
+ }
+ if (hasMipMaps) {
+ qWarning("Multisample texture cannot have mipmaps");
+ return false;
+ }
+ }
+
+ usageState.layout = VK_IMAGE_LAYOUT_PREINITIALIZED;
+ usageState.access = 0;
+ usageState.stage = 0;
+
+ if (adjustedSize)
+ *adjustedSize = size;
+
+ return true;
+}
+
+bool QVkTexture::finishBuild()
+{
+ QRHI_RES_RHI(QRhiVulkan);
+
+ const bool isDepth = isDepthTextureFormat(m_format);
+ const bool isCube = m_flags.testFlag(CubeMap);
+
+ VkImageViewCreateInfo viewInfo;
+ memset(&viewInfo, 0, sizeof(viewInfo));
+ viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
+ viewInfo.image = image;
+ viewInfo.viewType = isCube ? VK_IMAGE_VIEW_TYPE_CUBE : VK_IMAGE_VIEW_TYPE_2D;
+ viewInfo.format = vkformat;
+ viewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
+ viewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
+ viewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
+ viewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
+ viewInfo.subresourceRange.aspectMask = isDepth ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_COLOR_BIT;
+ viewInfo.subresourceRange.levelCount = mipLevelCount;
+ viewInfo.subresourceRange.layerCount = isCube ? 6 : 1;
+
+ VkResult err = rhiD->df->vkCreateImageView(rhiD->dev, &viewInfo, nullptr, &imageView);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create image view: %d", err);
+ return false;
+ }
+
+ nativeHandlesStruct.image = image;
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+
+ return true;
+}
+
+bool QVkTexture::build()
+{
+ QSize size;
+ if (!prepareBuild(&size))
+ return false;
+
+ const bool isRenderTarget = m_flags.testFlag(QRhiTexture::RenderTarget);
+ const bool isDepth = isDepthTextureFormat(m_format);
+ const bool isCube = m_flags.testFlag(CubeMap);
+
+ VkImageCreateInfo imageInfo;
+ memset(&imageInfo, 0, sizeof(imageInfo));
+ imageInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
+ imageInfo.flags = isCube ? VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT : 0;
+ imageInfo.imageType = VK_IMAGE_TYPE_2D;
+ imageInfo.format = vkformat;
+ imageInfo.extent.width = uint32_t(size.width());
+ imageInfo.extent.height = uint32_t(size.height());
+ imageInfo.extent.depth = 1;
+ imageInfo.mipLevels = mipLevelCount;
+ imageInfo.arrayLayers = isCube ? 6 : 1;
+ imageInfo.samples = samples;
+ imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
+ imageInfo.initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED;
+
+ imageInfo.usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
+ if (isRenderTarget) {
+ if (isDepth)
+ imageInfo.usage |= VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
+ else
+ imageInfo.usage |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
+ }
+ if (m_flags.testFlag(QRhiTexture::UsedAsTransferSource))
+ imageInfo.usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ if (m_flags.testFlag(QRhiTexture::UsedWithGenerateMips))
+ imageInfo.usage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+ if (m_flags.testFlag(QRhiTexture::UsedWithLoadStore))
+ imageInfo.usage |= VK_IMAGE_USAGE_STORAGE_BIT;
+
+ VmaAllocationCreateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+ allocInfo.usage = VMA_MEMORY_USAGE_GPU_ONLY;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ VmaAllocation allocation;
+ VkResult err = vmaCreateImage(toVmaAllocator(rhiD->allocator), &imageInfo, &allocInfo, &image, &allocation, nullptr);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create image: %d", err);
+ return false;
+ }
+ imageAlloc = allocation;
+
+ if (!finishBuild())
+ return false;
+
+ rhiD->setObjectName(uint64_t(image), VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, m_objectName);
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, true, int(mipLevelCount), isCube ? 6 : 1, samples));
+
+ owns = true;
+ rhiD->registerResource(this);
+ return true;
+}
+
+bool QVkTexture::buildFrom(const QRhiNativeHandles *src)
+{
+ const QRhiVulkanTextureNativeHandles *h = static_cast<const QRhiVulkanTextureNativeHandles *>(src);
+ if (!h || !h->image)
+ return false;
+
+ if (!prepareBuild())
+ return false;
+
+ image = h->image;
+
+ if (!finishBuild())
+ return false;
+
+ QRHI_PROF;
+ QRHI_PROF_F(newTexture(this, false, int(mipLevelCount), m_flags.testFlag(CubeMap) ? 6 : 1, samples));
+
+ usageState.layout = h->layout;
+
+ owns = false;
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->registerResource(this);
+ return true;
+}
+
+const QRhiNativeHandles *QVkTexture::nativeHandles()
+{
+ nativeHandlesStruct.layout = usageState.layout;
+ return &nativeHandlesStruct;
+}
+
+VkImageView QVkTexture::imageViewForLevel(int level)
+{
+ Q_ASSERT(level >= 0 && level < int(mipLevelCount));
+ if (perLevelImageViews[level] != VK_NULL_HANDLE)
+ return perLevelImageViews[level];
+
+ const bool isDepth = isDepthTextureFormat(m_format);
+ const bool isCube = m_flags.testFlag(CubeMap);
+
+ VkImageViewCreateInfo viewInfo;
+ memset(&viewInfo, 0, sizeof(viewInfo));
+ viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
+ viewInfo.image = image;
+ viewInfo.viewType = isCube ? VK_IMAGE_VIEW_TYPE_CUBE : VK_IMAGE_VIEW_TYPE_2D;
+ viewInfo.format = vkformat;
+ viewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
+ viewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
+ viewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
+ viewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
+ viewInfo.subresourceRange.aspectMask = isDepth ? VK_IMAGE_ASPECT_DEPTH_BIT : VK_IMAGE_ASPECT_COLOR_BIT;
+ viewInfo.subresourceRange.baseMipLevel = uint32_t(level);
+ viewInfo.subresourceRange.levelCount = 1;
+ viewInfo.subresourceRange.baseArrayLayer = 0;
+ viewInfo.subresourceRange.layerCount = isCube ? 6 : 1;
+
+ VkImageView v = VK_NULL_HANDLE;
+ QRHI_RES_RHI(QRhiVulkan);
+ VkResult err = rhiD->df->vkCreateImageView(rhiD->dev, &viewInfo, nullptr, &v);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create image view: %d", err);
+ return VK_NULL_HANDLE;
+ }
+
+ perLevelImageViews[level] = v;
+ return v;
+}
+
+QVkSampler::QVkSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v)
+ : QRhiSampler(rhi, magFilter, minFilter, mipmapMode, u, v)
+{
+}
+
+QVkSampler::~QVkSampler()
+{
+ release();
+}
+
+void QVkSampler::release()
+{
+ if (!sampler)
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::Sampler;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.sampler.sampler = sampler;
+ sampler = VK_NULL_HANDLE;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+ rhiD->unregisterResource(this);
+}
+
+bool QVkSampler::build()
+{
+ if (sampler)
+ release();
+
+ VkSamplerCreateInfo samplerInfo;
+ memset(&samplerInfo, 0, sizeof(samplerInfo));
+ samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
+ samplerInfo.magFilter = toVkFilter(m_magFilter);
+ samplerInfo.minFilter = toVkFilter(m_minFilter);
+ samplerInfo.mipmapMode = toVkMipmapMode(m_mipmapMode);
+ samplerInfo.addressModeU = toVkAddressMode(m_addressU);
+ samplerInfo.addressModeV = toVkAddressMode(m_addressV);
+ samplerInfo.addressModeW = toVkAddressMode(m_addressW);
+ samplerInfo.maxAnisotropy = 1.0f;
+ samplerInfo.compareEnable = m_compareOp != Never;
+ samplerInfo.compareOp = toVkTextureCompareOp(m_compareOp);
+ samplerInfo.maxLod = m_mipmapMode == None ? 0.25f : 1000.0f;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ VkResult err = rhiD->df->vkCreateSampler(rhiD->dev, &samplerInfo, nullptr, &sampler);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create sampler: %d", err);
+ return false;
+ }
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QVkRenderPassDescriptor::QVkRenderPassDescriptor(QRhiImplementation *rhi)
+ : QRhiRenderPassDescriptor(rhi)
+{
+}
+
+QVkRenderPassDescriptor::~QVkRenderPassDescriptor()
+{
+ release();
+}
+
+void QVkRenderPassDescriptor::release()
+{
+ if (!rp)
+ return;
+
+ if (!ownsRp) {
+ rp = VK_NULL_HANDLE;
+ return;
+ }
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::RenderPass;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.renderPass.rp = rp;
+
+ rp = VK_NULL_HANDLE;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+const QRhiNativeHandles *QVkRenderPassDescriptor::nativeHandles()
+{
+ nativeHandlesStruct.renderPass = rp;
+ return &nativeHandlesStruct;
+}
+
+QVkReferenceRenderTarget::QVkReferenceRenderTarget(QRhiImplementation *rhi)
+ : QRhiRenderTarget(rhi)
+{
+}
+
+QVkReferenceRenderTarget::~QVkReferenceRenderTarget()
+{
+ release();
+}
+
+void QVkReferenceRenderTarget::release()
+{
+ // nothing to do here
+}
+
+QSize QVkReferenceRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QVkReferenceRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QVkReferenceRenderTarget::sampleCount() const
+{
+ return d.sampleCount;
+}
+
+QVkTextureRenderTarget::QVkTextureRenderTarget(QRhiImplementation *rhi,
+ const QRhiTextureRenderTargetDescription &desc,
+ Flags flags)
+ : QRhiTextureRenderTarget(rhi, desc, flags)
+{
+ for (int att = 0; att < QVkRenderTargetData::MAX_COLOR_ATTACHMENTS; ++att) {
+ rtv[att] = VK_NULL_HANDLE;
+ resrtv[att] = VK_NULL_HANDLE;
+ }
+}
+
+QVkTextureRenderTarget::~QVkTextureRenderTarget()
+{
+ release();
+}
+
+void QVkTextureRenderTarget::release()
+{
+ if (!d.fb)
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::TextureRenderTarget;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.textureRenderTarget.fb = d.fb;
+ d.fb = VK_NULL_HANDLE;
+
+ for (int att = 0; att < QVkRenderTargetData::MAX_COLOR_ATTACHMENTS; ++att) {
+ e.textureRenderTarget.rtv[att] = rtv[att];
+ e.textureRenderTarget.resrtv[att] = resrtv[att];
+ rtv[att] = VK_NULL_HANDLE;
+ resrtv[att] = VK_NULL_HANDLE;
+ }
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+QRhiRenderPassDescriptor *QVkTextureRenderTarget::newCompatibleRenderPassDescriptor()
+{
+ // not yet built so cannot rely on data computed in build()
+
+ QRHI_RES_RHI(QRhiVulkan);
+ QVkRenderPassDescriptor *rp = new QVkRenderPassDescriptor(m_rhi);
+ if (!rhiD->createOffscreenRenderPass(&rp->rp,
+ m_desc.cbeginColorAttachments(),
+ m_desc.cendColorAttachments(),
+ m_flags.testFlag(QRhiTextureRenderTarget::PreserveColorContents),
+ m_flags.testFlag(QRhiTextureRenderTarget::PreserveDepthStencilContents),
+ m_desc.depthStencilBuffer(),
+ m_desc.depthTexture()))
+ {
+ delete rp;
+ return nullptr;
+ }
+
+ rp->ownsRp = true;
+ rhiD->registerResource(rp);
+ return rp;
+}
+
+bool QVkTextureRenderTarget::build()
+{
+ if (d.fb)
+ release();
+
+ const bool hasColorAttachments = m_desc.cbeginColorAttachments() != m_desc.cendColorAttachments();
+ Q_ASSERT(hasColorAttachments || m_desc.depthTexture());
+ Q_ASSERT(!m_desc.depthStencilBuffer() || !m_desc.depthTexture());
+ const bool hasDepthStencil = m_desc.depthStencilBuffer() || m_desc.depthTexture();
+
+ QRHI_RES_RHI(QRhiVulkan);
+ QVarLengthArray<VkImageView, 8> views;
+
+ d.colorAttCount = 0;
+ int attIndex = 0;
+ for (auto it = m_desc.cbeginColorAttachments(), itEnd = m_desc.cendColorAttachments(); it != itEnd; ++it, ++attIndex) {
+ d.colorAttCount += 1;
+ QVkTexture *texD = QRHI_RES(QVkTexture, it->texture());
+ QVkRenderBuffer *rbD = QRHI_RES(QVkRenderBuffer, it->renderBuffer());
+ Q_ASSERT(texD || rbD);
+ if (texD) {
+ Q_ASSERT(texD->flags().testFlag(QRhiTexture::RenderTarget));
+ VkImageViewCreateInfo viewInfo;
+ memset(&viewInfo, 0, sizeof(viewInfo));
+ viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
+ viewInfo.image = texD->image;
+ viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
+ viewInfo.format = texD->vkformat;
+ viewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
+ viewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
+ viewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
+ viewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
+ viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ viewInfo.subresourceRange.baseMipLevel = uint32_t(it->level());
+ viewInfo.subresourceRange.levelCount = 1;
+ viewInfo.subresourceRange.baseArrayLayer = uint32_t(it->layer());
+ viewInfo.subresourceRange.layerCount = 1;
+ VkResult err = rhiD->df->vkCreateImageView(rhiD->dev, &viewInfo, nullptr, &rtv[attIndex]);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create render target image view: %d", err);
+ return false;
+ }
+ views.append(rtv[attIndex]);
+ if (attIndex == 0) {
+ d.pixelSize = texD->pixelSize();
+ d.sampleCount = texD->samples;
+ }
+ } else if (rbD) {
+ Q_ASSERT(rbD->backingTexture);
+ views.append(rbD->backingTexture->imageView);
+ if (attIndex == 0) {
+ d.pixelSize = rbD->pixelSize();
+ d.sampleCount = rbD->samples;
+ }
+ }
+ }
+ d.dpr = 1;
+
+ if (hasDepthStencil) {
+ if (m_desc.depthTexture()) {
+ QVkTexture *depthTexD = QRHI_RES(QVkTexture, m_desc.depthTexture());
+ views.append(depthTexD->imageView);
+ if (d.colorAttCount == 0) {
+ d.pixelSize = depthTexD->pixelSize();
+ d.sampleCount = depthTexD->samples;
+ }
+ } else {
+ QVkRenderBuffer *depthRbD = QRHI_RES(QVkRenderBuffer, m_desc.depthStencilBuffer());
+ views.append(depthRbD->imageView);
+ if (d.colorAttCount == 0) {
+ d.pixelSize = depthRbD->pixelSize();
+ d.sampleCount = depthRbD->samples;
+ }
+ }
+ d.dsAttCount = 1;
+ } else {
+ d.dsAttCount = 0;
+ }
+
+ d.resolveAttCount = 0;
+ attIndex = 0;
+ for (auto it = m_desc.cbeginColorAttachments(), itEnd = m_desc.cendColorAttachments(); it != itEnd; ++it, ++attIndex) {
+ if (it->resolveTexture()) {
+ QVkTexture *resTexD = QRHI_RES(QVkTexture, it->resolveTexture());
+ Q_ASSERT(resTexD->flags().testFlag(QRhiTexture::RenderTarget));
+ d.resolveAttCount += 1;
+
+ VkImageViewCreateInfo viewInfo;
+ memset(&viewInfo, 0, sizeof(viewInfo));
+ viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
+ viewInfo.image = resTexD->image;
+ viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
+ viewInfo.format = resTexD->vkformat;
+ viewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
+ viewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
+ viewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
+ viewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
+ viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ viewInfo.subresourceRange.baseMipLevel = uint32_t(it->resolveLevel());
+ viewInfo.subresourceRange.levelCount = 1;
+ viewInfo.subresourceRange.baseArrayLayer = uint32_t(it->resolveLayer());
+ viewInfo.subresourceRange.layerCount = 1;
+ VkResult err = rhiD->df->vkCreateImageView(rhiD->dev, &viewInfo, nullptr, &resrtv[attIndex]);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create render target resolve image view: %d", err);
+ return false;
+ }
+ views.append(resrtv[attIndex]);
+ }
+ }
+
+ if (!m_renderPassDesc)
+ qWarning("QVkTextureRenderTarget: No renderpass descriptor set. See newCompatibleRenderPassDescriptor() and setRenderPassDescriptor().");
+
+ d.rp = QRHI_RES(QVkRenderPassDescriptor, m_renderPassDesc);
+ Q_ASSERT(d.rp && d.rp->rp);
+
+ VkFramebufferCreateInfo fbInfo;
+ memset(&fbInfo, 0, sizeof(fbInfo));
+ fbInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
+ fbInfo.renderPass = d.rp->rp;
+ fbInfo.attachmentCount = uint32_t(d.colorAttCount + d.dsAttCount + d.resolveAttCount);
+ fbInfo.pAttachments = views.constData();
+ fbInfo.width = uint32_t(d.pixelSize.width());
+ fbInfo.height = uint32_t(d.pixelSize.height());
+ fbInfo.layers = 1;
+
+ VkResult err = rhiD->df->vkCreateFramebuffer(rhiD->dev, &fbInfo, nullptr, &d.fb);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create framebuffer: %d", err);
+ return false;
+ }
+
+ lastActiveFrameSlot = -1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QSize QVkTextureRenderTarget::pixelSize() const
+{
+ return d.pixelSize;
+}
+
+float QVkTextureRenderTarget::devicePixelRatio() const
+{
+ return d.dpr;
+}
+
+int QVkTextureRenderTarget::sampleCount() const
+{
+ return d.sampleCount;
+}
+
+QVkShaderResourceBindings::QVkShaderResourceBindings(QRhiImplementation *rhi)
+ : QRhiShaderResourceBindings(rhi)
+{
+}
+
+QVkShaderResourceBindings::~QVkShaderResourceBindings()
+{
+ release();
+}
+
+void QVkShaderResourceBindings::release()
+{
+ if (!layout)
+ return;
+
+ sortedBindings.clear();
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::ShaderResourceBindings;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.shaderResourceBindings.poolIndex = poolIndex;
+ e.shaderResourceBindings.layout = layout;
+
+ poolIndex = -1;
+ layout = VK_NULL_HANDLE;
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
+ descSets[i] = VK_NULL_HANDLE;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+bool QVkShaderResourceBindings::build()
+{
+ if (layout)
+ release();
+
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
+ descSets[i] = VK_NULL_HANDLE;
+
+ sortedBindings.clear();
+ std::copy(m_bindings.cbegin(), m_bindings.cend(), std::back_inserter(sortedBindings));
+ std::sort(sortedBindings.begin(), sortedBindings.end(),
+ [](const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b)
+ {
+ return a.data()->binding < b.data()->binding;
+ });
+
+ QVarLengthArray<VkDescriptorSetLayoutBinding, 4> vkbindings;
+ for (const QRhiShaderResourceBinding &binding : qAsConst(sortedBindings)) {
+ const QRhiShaderResourceBinding::Data *b = binding.data();
+ VkDescriptorSetLayoutBinding vkbinding;
+ memset(&vkbinding, 0, sizeof(vkbinding));
+ vkbinding.binding = uint32_t(b->binding);
+ vkbinding.descriptorType = toVkDescriptorType(b);
+ vkbinding.descriptorCount = 1; // no array support yet
+ vkbinding.stageFlags = toVkShaderStageFlags(b->stage);
+ vkbindings.append(vkbinding);
+ }
+
+ VkDescriptorSetLayoutCreateInfo layoutInfo;
+ memset(&layoutInfo, 0, sizeof(layoutInfo));
+ layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
+ layoutInfo.bindingCount = uint32_t(vkbindings.count());
+ layoutInfo.pBindings = vkbindings.constData();
+
+ QRHI_RES_RHI(QRhiVulkan);
+ VkResult err = rhiD->df->vkCreateDescriptorSetLayout(rhiD->dev, &layoutInfo, nullptr, &layout);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create descriptor set layout: %d", err);
+ return false;
+ }
+
+ VkDescriptorSetAllocateInfo allocInfo;
+ memset(&allocInfo, 0, sizeof(allocInfo));
+ allocInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
+ allocInfo.descriptorSetCount = QVK_FRAMES_IN_FLIGHT;
+ VkDescriptorSetLayout layouts[QVK_FRAMES_IN_FLIGHT];
+ for (int i = 0; i < QVK_FRAMES_IN_FLIGHT; ++i)
+ layouts[i] = layout;
+ allocInfo.pSetLayouts = layouts;
+ if (!rhiD->allocateDescriptorSet(&allocInfo, descSets, &poolIndex))
+ return false;
+
+ rhiD->updateShaderResourceBindings(this);
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QVkGraphicsPipeline::QVkGraphicsPipeline(QRhiImplementation *rhi)
+ : QRhiGraphicsPipeline(rhi)
+{
+}
+
+QVkGraphicsPipeline::~QVkGraphicsPipeline()
+{
+ release();
+}
+
+void QVkGraphicsPipeline::release()
+{
+ if (!pipeline && !layout)
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::Pipeline;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.pipelineState.pipeline = pipeline;
+ e.pipelineState.layout = layout;
+
+ pipeline = VK_NULL_HANDLE;
+ layout = VK_NULL_HANDLE;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+bool QVkGraphicsPipeline::build()
+{
+ if (pipeline)
+ release();
+
+ QRHI_RES_RHI(QRhiVulkan);
+ if (!rhiD->sanityCheckGraphicsPipeline(this))
+ return false;
+
+ if (!rhiD->ensurePipelineCache())
+ return false;
+
+ VkPipelineLayoutCreateInfo pipelineLayoutInfo;
+ memset(&pipelineLayoutInfo, 0, sizeof(pipelineLayoutInfo));
+ pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
+ pipelineLayoutInfo.setLayoutCount = 1;
+ QVkShaderResourceBindings *srbD = QRHI_RES(QVkShaderResourceBindings, m_shaderResourceBindings);
+ Q_ASSERT(m_shaderResourceBindings && srbD->layout);
+ pipelineLayoutInfo.pSetLayouts = &srbD->layout;
+ VkResult err = rhiD->df->vkCreatePipelineLayout(rhiD->dev, &pipelineLayoutInfo, nullptr, &layout);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create pipeline layout: %d", err);
+ return false;
+ }
+
+ VkGraphicsPipelineCreateInfo pipelineInfo;
+ memset(&pipelineInfo, 0, sizeof(pipelineInfo));
+ pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
+
+ QVarLengthArray<VkShaderModule, 4> shaders;
+ QVarLengthArray<VkPipelineShaderStageCreateInfo, 4> shaderStageCreateInfos;
+ for (const QRhiShaderStage &shaderStage : m_shaderStages) {
+ const QShader bakedShader = shaderStage.shader();
+ const QShaderCode spirv = bakedShader.shader({ QShader::SpirvShader, 100, shaderStage.shaderVariant() });
+ if (spirv.shader().isEmpty()) {
+ qWarning() << "No SPIR-V 1.0 shader code found in baked shader" << bakedShader;
+ return false;
+ }
+ VkShaderModule shader = rhiD->createShader(spirv.shader());
+ if (shader) {
+ shaders.append(shader);
+ VkPipelineShaderStageCreateInfo shaderInfo;
+ memset(&shaderInfo, 0, sizeof(shaderInfo));
+ shaderInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
+ shaderInfo.stage = toVkShaderStage(shaderStage.type());
+ shaderInfo.module = shader;
+ shaderInfo.pName = spirv.entryPoint().constData();
+ shaderStageCreateInfos.append(shaderInfo);
+ }
+ }
+ pipelineInfo.stageCount = uint32_t(shaderStageCreateInfos.count());
+ pipelineInfo.pStages = shaderStageCreateInfos.constData();
+
+ QVarLengthArray<VkVertexInputBindingDescription, 4> vertexBindings;
+ QVarLengthArray<VkVertexInputBindingDivisorDescriptionEXT> nonOneStepRates;
+ int bindingIndex = 0;
+ for (auto it = m_vertexInputLayout.cbeginBindings(), itEnd = m_vertexInputLayout.cendBindings();
+ it != itEnd; ++it, ++bindingIndex)
+ {
+ VkVertexInputBindingDescription bindingInfo = {
+ uint32_t(bindingIndex),
+ it->stride(),
+ it->classification() == QRhiVertexInputBinding::PerVertex
+ ? VK_VERTEX_INPUT_RATE_VERTEX : VK_VERTEX_INPUT_RATE_INSTANCE
+ };
+ if (it->classification() == QRhiVertexInputBinding::PerInstance && it->instanceStepRate() != 1) {
+ if (rhiD->vertexAttribDivisorAvailable) {
+ nonOneStepRates.append({ uint32_t(bindingIndex), uint32_t(it->instanceStepRate()) });
+ } else {
+ qWarning("QRhiVulkan: Instance step rates other than 1 not supported without "
+ "VK_EXT_vertex_attribute_divisor on the device and "
+ "VK_KHR_get_physical_device_properties2 on the instance");
+ }
+ }
+ vertexBindings.append(bindingInfo);
+ }
+ QVarLengthArray<VkVertexInputAttributeDescription, 4> vertexAttributes;
+ for (auto it = m_vertexInputLayout.cbeginAttributes(), itEnd = m_vertexInputLayout.cendAttributes();
+ it != itEnd; ++it)
+ {
+ VkVertexInputAttributeDescription attributeInfo = {
+ uint32_t(it->location()),
+ uint32_t(it->binding()),
+ toVkAttributeFormat(it->format()),
+ it->offset()
+ };
+ vertexAttributes.append(attributeInfo);
+ }
+ VkPipelineVertexInputStateCreateInfo vertexInputInfo;
+ memset(&vertexInputInfo, 0, sizeof(vertexInputInfo));
+ vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
+ vertexInputInfo.vertexBindingDescriptionCount = uint32_t(vertexBindings.count());
+ vertexInputInfo.pVertexBindingDescriptions = vertexBindings.constData();
+ vertexInputInfo.vertexAttributeDescriptionCount = uint32_t(vertexAttributes.count());
+ vertexInputInfo.pVertexAttributeDescriptions = vertexAttributes.constData();
+ VkPipelineVertexInputDivisorStateCreateInfoEXT divisorInfo;
+ if (!nonOneStepRates.isEmpty()) {
+ memset(&divisorInfo, 0, sizeof(divisorInfo));
+ divisorInfo.sType = VkStructureType(1000190001); // VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT
+ divisorInfo.vertexBindingDivisorCount = uint32_t(nonOneStepRates.count());
+ divisorInfo.pVertexBindingDivisors = nonOneStepRates.constData();
+ vertexInputInfo.pNext = &divisorInfo;
+ }
+ pipelineInfo.pVertexInputState = &vertexInputInfo;
+
+ QVarLengthArray<VkDynamicState, 8> dynEnable;
+ dynEnable << VK_DYNAMIC_STATE_VIEWPORT;
+ dynEnable << VK_DYNAMIC_STATE_SCISSOR; // ignore UsesScissor - Vulkan requires a scissor for the viewport always
+ if (m_flags.testFlag(QRhiGraphicsPipeline::UsesBlendConstants))
+ dynEnable << VK_DYNAMIC_STATE_BLEND_CONSTANTS;
+ if (m_flags.testFlag(QRhiGraphicsPipeline::UsesStencilRef))
+ dynEnable << VK_DYNAMIC_STATE_STENCIL_REFERENCE;
+
+ VkPipelineDynamicStateCreateInfo dynamicInfo;
+ memset(&dynamicInfo, 0, sizeof(dynamicInfo));
+ dynamicInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
+ dynamicInfo.dynamicStateCount = uint32_t(dynEnable.count());
+ dynamicInfo.pDynamicStates = dynEnable.constData();
+ pipelineInfo.pDynamicState = &dynamicInfo;
+
+ VkPipelineViewportStateCreateInfo viewportInfo;
+ memset(&viewportInfo, 0, sizeof(viewportInfo));
+ viewportInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
+ viewportInfo.viewportCount = viewportInfo.scissorCount = 1;
+ pipelineInfo.pViewportState = &viewportInfo;
+
+ VkPipelineInputAssemblyStateCreateInfo inputAsmInfo;
+ memset(&inputAsmInfo, 0, sizeof(inputAsmInfo));
+ inputAsmInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
+ inputAsmInfo.topology = toVkTopology(m_topology);
+ inputAsmInfo.primitiveRestartEnable = (m_topology == TriangleStrip || m_topology == LineStrip);
+ pipelineInfo.pInputAssemblyState = &inputAsmInfo;
+
+ VkPipelineRasterizationStateCreateInfo rastInfo;
+ memset(&rastInfo, 0, sizeof(rastInfo));
+ rastInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
+ rastInfo.cullMode = toVkCullMode(m_cullMode);
+ rastInfo.frontFace = toVkFrontFace(m_frontFace);
+ rastInfo.lineWidth = rhiD->hasWideLines ? m_lineWidth : 1.0f;
+ pipelineInfo.pRasterizationState = &rastInfo;
+
+ VkPipelineMultisampleStateCreateInfo msInfo;
+ memset(&msInfo, 0, sizeof(msInfo));
+ msInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
+ msInfo.rasterizationSamples = rhiD->effectiveSampleCount(m_sampleCount);
+ pipelineInfo.pMultisampleState = &msInfo;
+
+ VkPipelineDepthStencilStateCreateInfo dsInfo;
+ memset(&dsInfo, 0, sizeof(dsInfo));
+ dsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
+ dsInfo.depthTestEnable = m_depthTest;
+ dsInfo.depthWriteEnable = m_depthWrite;
+ dsInfo.depthCompareOp = toVkCompareOp(m_depthOp);
+ dsInfo.stencilTestEnable = m_stencilTest;
+ if (m_stencilTest) {
+ fillVkStencilOpState(&dsInfo.front, m_stencilFront);
+ dsInfo.front.compareMask = m_stencilReadMask;
+ dsInfo.front.writeMask = m_stencilWriteMask;
+ fillVkStencilOpState(&dsInfo.back, m_stencilBack);
+ dsInfo.back.compareMask = m_stencilReadMask;
+ dsInfo.back.writeMask = m_stencilWriteMask;
+ }
+ pipelineInfo.pDepthStencilState = &dsInfo;
+
+ VkPipelineColorBlendStateCreateInfo blendInfo;
+ memset(&blendInfo, 0, sizeof(blendInfo));
+ blendInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
+ QVarLengthArray<VkPipelineColorBlendAttachmentState, 4> vktargetBlends;
+ for (const QRhiGraphicsPipeline::TargetBlend &b : qAsConst(m_targetBlends)) {
+ VkPipelineColorBlendAttachmentState blend;
+ memset(&blend, 0, sizeof(blend));
+ blend.blendEnable = b.enable;
+ blend.srcColorBlendFactor = toVkBlendFactor(b.srcColor);
+ blend.dstColorBlendFactor = toVkBlendFactor(b.dstColor);
+ blend.colorBlendOp = toVkBlendOp(b.opColor);
+ blend.srcAlphaBlendFactor = toVkBlendFactor(b.srcAlpha);
+ blend.dstAlphaBlendFactor = toVkBlendFactor(b.dstAlpha);
+ blend.alphaBlendOp = toVkBlendOp(b.opAlpha);
+ blend.colorWriteMask = toVkColorComponents(b.colorWrite);
+ vktargetBlends.append(blend);
+ }
+ if (vktargetBlends.isEmpty()) {
+ VkPipelineColorBlendAttachmentState blend;
+ memset(&blend, 0, sizeof(blend));
+ blend.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT
+ | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
+ vktargetBlends.append(blend);
+ }
+ blendInfo.attachmentCount = uint32_t(vktargetBlends.count());
+ blendInfo.pAttachments = vktargetBlends.constData();
+ pipelineInfo.pColorBlendState = &blendInfo;
+
+ pipelineInfo.layout = layout;
+
+ Q_ASSERT(m_renderPassDesc && QRHI_RES(const QVkRenderPassDescriptor, m_renderPassDesc)->rp);
+ pipelineInfo.renderPass = QRHI_RES(const QVkRenderPassDescriptor, m_renderPassDesc)->rp;
+
+ err = rhiD->df->vkCreateGraphicsPipelines(rhiD->dev, rhiD->pipelineCache, 1, &pipelineInfo, nullptr, &pipeline);
+
+ for (VkShaderModule shader : shaders)
+ rhiD->df->vkDestroyShaderModule(rhiD->dev, shader, nullptr);
+
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create graphics pipeline: %d", err);
+ return false;
+ }
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QVkComputePipeline::QVkComputePipeline(QRhiImplementation *rhi)
+ : QRhiComputePipeline(rhi)
+{
+}
+
+QVkComputePipeline::~QVkComputePipeline()
+{
+ release();
+}
+
+void QVkComputePipeline::release()
+{
+ if (!pipeline && !layout)
+ return;
+
+ QRhiVulkan::DeferredReleaseEntry e;
+ e.type = QRhiVulkan::DeferredReleaseEntry::Pipeline;
+ e.lastActiveFrameSlot = lastActiveFrameSlot;
+
+ e.pipelineState.pipeline = pipeline;
+ e.pipelineState.layout = layout;
+
+ pipeline = VK_NULL_HANDLE;
+ layout = VK_NULL_HANDLE;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->releaseQueue.append(e);
+
+ rhiD->unregisterResource(this);
+}
+
+bool QVkComputePipeline::build()
+{
+ if (pipeline)
+ release();
+
+ QRHI_RES_RHI(QRhiVulkan);
+ if (!rhiD->ensurePipelineCache())
+ return false;
+
+ VkPipelineLayoutCreateInfo pipelineLayoutInfo;
+ memset(&pipelineLayoutInfo, 0, sizeof(pipelineLayoutInfo));
+ pipelineLayoutInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
+ pipelineLayoutInfo.setLayoutCount = 1;
+ QVkShaderResourceBindings *srbD = QRHI_RES(QVkShaderResourceBindings, m_shaderResourceBindings);
+ Q_ASSERT(m_shaderResourceBindings && srbD->layout);
+ pipelineLayoutInfo.pSetLayouts = &srbD->layout;
+ VkResult err = rhiD->df->vkCreatePipelineLayout(rhiD->dev, &pipelineLayoutInfo, nullptr, &layout);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create pipeline layout: %d", err);
+ return false;
+ }
+
+ VkComputePipelineCreateInfo pipelineInfo;
+ memset(&pipelineInfo, 0, sizeof(pipelineInfo));
+ pipelineInfo.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
+ pipelineInfo.layout = layout;
+
+ if (m_shaderStage.type() != QRhiShaderStage::Compute) {
+ qWarning("Compute pipeline requires a compute shader stage");
+ return false;
+ }
+ const QShader bakedShader = m_shaderStage.shader();
+ const QShaderCode spirv = bakedShader.shader({ QShader::SpirvShader, 100, m_shaderStage.shaderVariant() });
+ if (spirv.shader().isEmpty()) {
+ qWarning() << "No SPIR-V 1.0 shader code found in baked shader" << bakedShader;
+ return false;
+ }
+ if (bakedShader.stage() != QShader::ComputeStage) {
+ qWarning() << bakedShader << "is not a compute shader";
+ return false;
+ }
+ VkShaderModule shader = rhiD->createShader(spirv.shader());
+ VkPipelineShaderStageCreateInfo shaderInfo;
+ memset(&shaderInfo, 0, sizeof(shaderInfo));
+ shaderInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
+ shaderInfo.stage = VK_SHADER_STAGE_COMPUTE_BIT;
+ shaderInfo.module = shader;
+ shaderInfo.pName = spirv.entryPoint().constData();
+ pipelineInfo.stage = shaderInfo;
+
+ err = rhiD->df->vkCreateComputePipelines(rhiD->dev, rhiD->pipelineCache, 1, &pipelineInfo, nullptr, &pipeline);
+ rhiD->df->vkDestroyShaderModule(rhiD->dev, shader, nullptr);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create graphics pipeline: %d", err);
+ return false;
+ }
+
+ lastActiveFrameSlot = -1;
+ generation += 1;
+ rhiD->registerResource(this);
+ return true;
+}
+
+QVkCommandBuffer::QVkCommandBuffer(QRhiImplementation *rhi)
+ : QRhiCommandBuffer(rhi)
+{
+ resetState();
+}
+
+QVkCommandBuffer::~QVkCommandBuffer()
+{
+ release();
+}
+
+void QVkCommandBuffer::release()
+{
+ // nothing to do here, cb is not owned by us
+}
+
+const QRhiNativeHandles *QVkCommandBuffer::nativeHandles()
+{
+ // Ok this is messy but no other way has been devised yet. Outside
+ // begin(Compute)Pass - end(Compute)Pass it is simple - just return the
+ // primary VkCommandBuffer. Inside, however, we need to provide the current
+ // secondary command buffer (typically the one started by beginExternal(),
+ // in case we are between beginExternal - endExternal inside a pass).
+
+ if (useSecondaryCb && !secondaryCbs.isEmpty())
+ nativeHandlesStruct.commandBuffer = secondaryCbs.last();
+ else
+ nativeHandlesStruct.commandBuffer = cb;
+
+ return &nativeHandlesStruct;
+}
+
+QVkSwapChain::QVkSwapChain(QRhiImplementation *rhi)
+ : QRhiSwapChain(rhi),
+ rtWrapper(rhi),
+ cbWrapper(rhi)
+{
+}
+
+QVkSwapChain::~QVkSwapChain()
+{
+ release();
+}
+
+void QVkSwapChain::release()
+{
+ if (sc == VK_NULL_HANDLE)
+ return;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->swapchains.remove(this);
+ rhiD->releaseSwapChainResources(this);
+ surface = lastConnectedSurface = VK_NULL_HANDLE;
+
+ QRHI_PROF;
+ QRHI_PROF_F(releaseSwapChain(this));
+
+ rhiD->unregisterResource(this);
+}
+
+QRhiCommandBuffer *QVkSwapChain::currentFrameCommandBuffer()
+{
+ return &cbWrapper;
+}
+
+QRhiRenderTarget *QVkSwapChain::currentFrameRenderTarget()
+{
+ return &rtWrapper;
+}
+
+QSize QVkSwapChain::surfacePixelSize()
+{
+ if (!ensureSurface())
+ return QSize();
+
+ // The size from the QWindow may not exactly match the surface... so if a
+ // size is reported from the surface, use that.
+ VkSurfaceCapabilitiesKHR surfaceCaps;
+ memset(&surfaceCaps, 0, sizeof(surfaceCaps));
+ QRHI_RES_RHI(QRhiVulkan);
+ rhiD->vkGetPhysicalDeviceSurfaceCapabilitiesKHR(rhiD->physDev, surface, &surfaceCaps);
+ VkExtent2D bufferSize = surfaceCaps.currentExtent;
+ if (bufferSize.width == uint32_t(-1)) {
+ Q_ASSERT(bufferSize.height == uint32_t(-1));
+ return m_window->size() * m_window->devicePixelRatio();
+ }
+ return QSize(int(bufferSize.width), int(bufferSize.height));
+}
+
+QRhiRenderPassDescriptor *QVkSwapChain::newCompatibleRenderPassDescriptor()
+{
+ // not yet built so cannot rely on data computed in buildOrResize()
+
+ if (!ensureSurface()) // make sure sampleCount and colorFormat reflect what was requested
+ return nullptr;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ QVkRenderPassDescriptor *rp = new QVkRenderPassDescriptor(m_rhi);
+ if (!rhiD->createDefaultRenderPass(&rp->rp,
+ m_depthStencil != nullptr,
+ samples,
+ colorFormat))
+ {
+ delete rp;
+ return nullptr;
+ }
+
+ rp->ownsRp = true;
+ rhiD->registerResource(rp);
+ return rp;
+}
+
+static inline bool isSrgbFormat(VkFormat format)
+{
+ switch (format) {
+ case VK_FORMAT_R8_SRGB:
+ Q_FALLTHROUGH();
+ case VK_FORMAT_R8G8_SRGB:
+ Q_FALLTHROUGH();
+ case VK_FORMAT_R8G8B8_SRGB:
+ Q_FALLTHROUGH();
+ case VK_FORMAT_B8G8R8_SRGB:
+ Q_FALLTHROUGH();
+ case VK_FORMAT_R8G8B8A8_SRGB:
+ Q_FALLTHROUGH();
+ case VK_FORMAT_B8G8R8A8_SRGB:
+ Q_FALLTHROUGH();
+ case VK_FORMAT_A8B8G8R8_SRGB_PACK32:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool QVkSwapChain::ensureSurface()
+{
+ // Do nothing when already done, however window may change so check the
+ // surface is still the same. Some of the queries below are very expensive
+ // with some implementations so it is important to do the rest only once
+ // per surface.
+
+ Q_ASSERT(m_window);
+ VkSurfaceKHR surf = QVulkanInstance::surfaceForWindow(m_window);
+ if (!surf) {
+ qWarning("Failed to get surface for window");
+ return false;
+ }
+ if (surface == surf)
+ return true;
+
+ surface = surf;
+
+ QRHI_RES_RHI(QRhiVulkan);
+ if (rhiD->gfxQueueFamilyIdx != -1) {
+ if (!rhiD->inst->supportsPresent(rhiD->physDev, uint32_t(rhiD->gfxQueueFamilyIdx), m_window)) {
+ qWarning("Presenting not supported on this window");
+ return false;
+ }
+ }
+
+ if (!rhiD->vkGetPhysicalDeviceSurfaceCapabilitiesKHR) {
+ rhiD->vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR>(
+ rhiD->inst->getInstanceProcAddr("vkGetPhysicalDeviceSurfaceCapabilitiesKHR"));
+ rhiD->vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceFormatsKHR>(
+ rhiD->inst->getInstanceProcAddr("vkGetPhysicalDeviceSurfaceFormatsKHR"));
+ rhiD->vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfacePresentModesKHR>(
+ rhiD->inst->getInstanceProcAddr("vkGetPhysicalDeviceSurfacePresentModesKHR"));
+ if (!rhiD->vkGetPhysicalDeviceSurfaceCapabilitiesKHR
+ || !rhiD->vkGetPhysicalDeviceSurfaceFormatsKHR
+ || !rhiD->vkGetPhysicalDeviceSurfacePresentModesKHR)
+ {
+ qWarning("Physical device surface queries not available");
+ return false;
+ }
+ }
+
+ quint32 formatCount = 0;
+ rhiD->vkGetPhysicalDeviceSurfaceFormatsKHR(rhiD->physDev, surface, &formatCount, nullptr);
+ QVector<VkSurfaceFormatKHR> formats(formatCount);
+ if (formatCount)
+ rhiD->vkGetPhysicalDeviceSurfaceFormatsKHR(rhiD->physDev, surface, &formatCount, formats.data());
+
+ const bool srgbRequested = m_flags.testFlag(sRGB);
+ for (int i = 0; i < int(formatCount); ++i) {
+ if (formats[i].format != VK_FORMAT_UNDEFINED && srgbRequested == isSrgbFormat(formats[i].format)) {
+ colorFormat = formats[i].format;
+ colorSpace = formats[i].colorSpace;
+ break;
+ }
+ }
+
+ samples = rhiD->effectiveSampleCount(m_sampleCount);
+
+ quint32 presModeCount = 0;
+ rhiD->vkGetPhysicalDeviceSurfacePresentModesKHR(rhiD->physDev, surface, &presModeCount, nullptr);
+ QVector<VkPresentModeKHR> presModes(presModeCount);
+ rhiD->vkGetPhysicalDeviceSurfacePresentModesKHR(rhiD->physDev, surface, &presModeCount, presModes.data());
+ supportedPresentationModes = presModes;
+
+ return true;
+}
+
+bool QVkSwapChain::buildOrResize()
+{
+ QRHI_RES_RHI(QRhiVulkan);
+ const bool needsRegistration = !window || window != m_window;
+
+ // Can be called multiple times due to window resizes - that is not the
+ // same as a simple release+build (as with other resources). Thus no
+ // release() here. See recreateSwapChain().
+
+ // except if the window actually changes
+ if (window && window != m_window)
+ release();
+
+ window = m_window;
+ m_currentPixelSize = surfacePixelSize();
+ pixelSize = m_currentPixelSize;
+
+ if (!rhiD->recreateSwapChain(this)) {
+ qWarning("Failed to create new swapchain");
+ return false;
+ }
+
+ if (needsRegistration)
+ rhiD->swapchains.insert(this);
+
+ if (m_depthStencil && m_depthStencil->sampleCount() != m_sampleCount) {
+ qWarning("Depth-stencil buffer's sampleCount (%d) does not match color buffers' sample count (%d). Expect problems.",
+ m_depthStencil->sampleCount(), m_sampleCount);
+ }
+ if (m_depthStencil && m_depthStencil->pixelSize() != pixelSize) {
+ if (m_depthStencil->flags().testFlag(QRhiRenderBuffer::UsedWithSwapChainOnly)) {
+ m_depthStencil->setPixelSize(pixelSize);
+ if (!m_depthStencil->build())
+ qWarning("Failed to rebuild swapchain's associated depth-stencil buffer for size %dx%d",
+ pixelSize.width(), pixelSize.height());
+ } else {
+ qWarning("Depth-stencil buffer's size (%dx%d) does not match the surface size (%dx%d). Expect problems.",
+ m_depthStencil->pixelSize().width(), m_depthStencil->pixelSize().height(),
+ pixelSize.width(), pixelSize.height());
+ }
+ }
+
+ if (!m_renderPassDesc)
+ qWarning("QVkSwapChain: No renderpass descriptor set. See newCompatibleRenderPassDescriptor() and setRenderPassDescriptor().");
+
+ rtWrapper.d.rp = QRHI_RES(QVkRenderPassDescriptor, m_renderPassDesc);
+ Q_ASSERT(rtWrapper.d.rp && rtWrapper.d.rp->rp);
+
+ rtWrapper.d.pixelSize = pixelSize;
+ rtWrapper.d.dpr = float(window->devicePixelRatio());
+ rtWrapper.d.sampleCount = samples;
+ rtWrapper.d.colorAttCount = 1;
+ if (m_depthStencil) {
+ rtWrapper.d.dsAttCount = 1;
+ ds = QRHI_RES(QVkRenderBuffer, m_depthStencil);
+ } else {
+ rtWrapper.d.dsAttCount = 0;
+ ds = nullptr;
+ }
+ if (samples > VK_SAMPLE_COUNT_1_BIT)
+ rtWrapper.d.resolveAttCount = 1;
+ else
+ rtWrapper.d.resolveAttCount = 0;
+
+ for (int i = 0; i < bufferCount; ++i) {
+ QVkSwapChain::ImageResources &image(imageRes[i]);
+ VkImageView views[3] = { // color, ds, resolve
+ samples > VK_SAMPLE_COUNT_1_BIT ? image.msaaImageView : image.imageView,
+ ds ? ds->imageView : VK_NULL_HANDLE,
+ samples > VK_SAMPLE_COUNT_1_BIT ? image.imageView : VK_NULL_HANDLE
+ };
+
+ VkFramebufferCreateInfo fbInfo;
+ memset(&fbInfo, 0, sizeof(fbInfo));
+ fbInfo.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
+ fbInfo.renderPass = rtWrapper.d.rp->rp;
+ fbInfo.attachmentCount = uint32_t(rtWrapper.d.colorAttCount + rtWrapper.d.dsAttCount + rtWrapper.d.resolveAttCount);
+ fbInfo.pAttachments = views;
+ fbInfo.width = uint32_t(pixelSize.width());
+ fbInfo.height = uint32_t(pixelSize.height());
+ fbInfo.layers = 1;
+
+ VkResult err = rhiD->df->vkCreateFramebuffer(rhiD->dev, &fbInfo, nullptr, &image.fb);
+ if (err != VK_SUCCESS) {
+ qWarning("Failed to create framebuffer: %d", err);
+ return false;
+ }
+ }
+
+ frameCount = 0;
+
+ QRHI_PROF;
+ QRHI_PROF_F(resizeSwapChain(this, QVK_FRAMES_IN_FLIGHT, samples > VK_SAMPLE_COUNT_1_BIT ? QVK_FRAMES_IN_FLIGHT : 0, samples));
+
+ if (needsRegistration)
+ rhiD->registerResource(this);
+
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qrhivulkan_p.h b/src/gui/rhi/qrhivulkan_p.h
new file mode 100644
index 0000000000..ff19c7a54e
--- /dev/null
+++ b/src/gui/rhi/qrhivulkan_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIVULKAN_H
+#define QRHIVULKAN_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/qrhi_p.h>
+#include <QtGui/qvulkaninstance.h> // this is where vulkan.h gets pulled in
+
+QT_BEGIN_NAMESPACE
+
+struct Q_GUI_EXPORT QRhiVulkanInitParams : public QRhiInitParams
+{
+ QVulkanInstance *inst = nullptr;
+ QWindow *window = nullptr;
+};
+
+struct Q_GUI_EXPORT QRhiVulkanNativeHandles : public QRhiNativeHandles
+{
+ VkPhysicalDevice physDev = VK_NULL_HANDLE;
+ VkDevice dev = VK_NULL_HANDLE;
+ int gfxQueueFamilyIdx = -1;
+ VkQueue gfxQueue = VK_NULL_HANDLE;
+ VkCommandPool cmdPool = VK_NULL_HANDLE;
+ void *vmemAllocator = nullptr;
+};
+
+struct Q_GUI_EXPORT QRhiVulkanTextureNativeHandles : public QRhiNativeHandles
+{
+ VkImage image = VK_NULL_HANDLE;
+ VkImageLayout layout = VK_IMAGE_LAYOUT_GENERAL;
+};
+
+struct Q_GUI_EXPORT QRhiVulkanCommandBufferNativeHandles : public QRhiNativeHandles
+{
+ VkCommandBuffer commandBuffer = VK_NULL_HANDLE;
+};
+
+struct Q_GUI_EXPORT QRhiVulkanRenderPassNativeHandles : public QRhiNativeHandles
+{
+ VkRenderPass renderPass = VK_NULL_HANDLE;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhivulkan_p_p.h b/src/gui/rhi/qrhivulkan_p_p.h
new file mode 100644
index 0000000000..d0e1e6758b
--- /dev/null
+++ b/src/gui/rhi/qrhivulkan_p_p.h
@@ -0,0 +1,949 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIVULKAN_P_H
+#define QRHIVULKAN_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 "qrhivulkan_p.h"
+#include "qrhi_p_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QVulkanFunctions;
+class QVulkanDeviceFunctions;
+
+static const int QVK_FRAMES_IN_FLIGHT = 2;
+
+static const int QVK_DESC_SETS_PER_POOL = 128;
+static const int QVK_UNIFORM_BUFFERS_PER_POOL = 256;
+static const int QVK_COMBINED_IMAGE_SAMPLERS_PER_POOL = 256;
+static const int QVK_STORAGE_BUFFERS_PER_POOL = 128;
+static const int QVK_STORAGE_IMAGES_PER_POOL = 128;
+
+static const int QVK_MAX_ACTIVE_TIMESTAMP_PAIRS = 16;
+
+// no vk_mem_alloc.h available here, void* is good enough
+typedef void * QVkAlloc;
+typedef void * QVkAllocator;
+
+struct QVkBuffer : public QRhiBuffer
+{
+ QVkBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
+ ~QVkBuffer();
+ void release() override;
+ bool build() override;
+
+ VkBuffer buffers[QVK_FRAMES_IN_FLIGHT];
+ QVkAlloc allocations[QVK_FRAMES_IN_FLIGHT];
+ QVarLengthArray<QRhiResourceUpdateBatchPrivate::BufferOp, 16> pendingDynamicUpdates[QVK_FRAMES_IN_FLIGHT];
+ VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
+ QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
+ struct UsageState {
+ VkAccessFlags access = 0;
+ VkPipelineStageFlags stage = 0;
+ };
+ UsageState usageState[QVK_FRAMES_IN_FLIGHT];
+ int lastActiveFrameSlot = -1;
+ uint generation = 0;
+ friend class QRhiVulkan;
+};
+
+struct QVkTexture;
+
+struct QVkRenderBuffer : public QRhiRenderBuffer
+{
+ QVkRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
+ int sampleCount, Flags flags);
+ ~QVkRenderBuffer();
+ void release() override;
+ bool build() override;
+ QRhiTexture::Format backingFormat() const override;
+
+ VkDeviceMemory memory = VK_NULL_HANDLE;
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ VkSampleCountFlagBits samples;
+ QVkTexture *backingTexture = nullptr;
+ VkFormat vkformat;
+ int lastActiveFrameSlot = -1;
+ friend class QRhiVulkan;
+};
+
+struct QVkTexture : public QRhiTexture
+{
+ QVkTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
+ int sampleCount, Flags flags);
+ ~QVkTexture();
+ void release() override;
+ bool build() override;
+ bool buildFrom(const QRhiNativeHandles *src) override;
+ const QRhiNativeHandles *nativeHandles() override;
+
+ bool prepareBuild(QSize *adjustedSize = nullptr);
+ bool finishBuild();
+ VkImageView imageViewForLevel(int level);
+
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ QVkAlloc imageAlloc = nullptr;
+ VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
+ QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
+ VkImageView perLevelImageViews[QRhi::MAX_LEVELS];
+ bool owns = true;
+ QRhiVulkanTextureNativeHandles nativeHandlesStruct;
+ struct UsageState {
+ // no tracking of subresource layouts (some operations can keep
+ // subresources in different layouts for some time, but that does not
+ // need to be kept track of)
+ VkImageLayout layout;
+ VkAccessFlags access;
+ VkPipelineStageFlags stage;
+ };
+ UsageState usageState;
+ VkFormat vkformat;
+ uint mipLevelCount = 0;
+ VkSampleCountFlagBits samples;
+ int lastActiveFrameSlot = -1;
+ uint generation = 0;
+ friend class QRhiVulkan;
+};
+
+struct QVkSampler : public QRhiSampler
+{
+ QVkSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
+ AddressMode u, AddressMode v);
+ ~QVkSampler();
+ void release() override;
+ bool build() override;
+
+ VkSampler sampler = VK_NULL_HANDLE;
+ int lastActiveFrameSlot = -1;
+ uint generation = 0;
+ friend class QRhiVulkan;
+};
+
+struct QVkRenderPassDescriptor : public QRhiRenderPassDescriptor
+{
+ QVkRenderPassDescriptor(QRhiImplementation *rhi);
+ ~QVkRenderPassDescriptor();
+ void release() override;
+ const QRhiNativeHandles *nativeHandles() override;
+
+ VkRenderPass rp = VK_NULL_HANDLE;
+ bool ownsRp = false;
+ QRhiVulkanRenderPassNativeHandles nativeHandlesStruct;
+ int lastActiveFrameSlot = -1;
+};
+
+struct QVkRenderTargetData
+{
+ VkFramebuffer fb = VK_NULL_HANDLE;
+ QVkRenderPassDescriptor *rp = nullptr;
+ QSize pixelSize;
+ float dpr = 1;
+ int sampleCount = 1;
+ int colorAttCount = 0;
+ int dsAttCount = 0;
+ int resolveAttCount = 0;
+ static const int MAX_COLOR_ATTACHMENTS = 8;
+};
+
+struct QVkReferenceRenderTarget : public QRhiRenderTarget
+{
+ QVkReferenceRenderTarget(QRhiImplementation *rhi);
+ ~QVkReferenceRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QVkRenderTargetData d;
+};
+
+struct QVkTextureRenderTarget : public QRhiTextureRenderTarget
+{
+ QVkTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags);
+ ~QVkTextureRenderTarget();
+ void release() override;
+
+ QSize pixelSize() const override;
+ float devicePixelRatio() const override;
+ int sampleCount() const override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool build() override;
+
+ QVkRenderTargetData d;
+ VkImageView rtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS];
+ VkImageView resrtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS];
+ int lastActiveFrameSlot = -1;
+ friend class QRhiVulkan;
+};
+
+struct QVkShaderResourceBindings : public QRhiShaderResourceBindings
+{
+ QVkShaderResourceBindings(QRhiImplementation *rhi);
+ ~QVkShaderResourceBindings();
+ void release() override;
+ bool build() override;
+
+ QVarLengthArray<QRhiShaderResourceBinding, 8> sortedBindings;
+ int poolIndex = -1;
+ VkDescriptorSetLayout layout = VK_NULL_HANDLE;
+ VkDescriptorSet descSets[QVK_FRAMES_IN_FLIGHT]; // multiple sets to support dynamic buffers
+ int lastActiveFrameSlot = -1;
+ uint generation = 0;
+
+ // Keep track of the generation number of each referenced QRhi* to be able
+ // to detect that the underlying descriptor set became out of date and they
+ // need to be written again with the up-to-date VkBuffer etc. objects.
+ struct BoundUniformBufferData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundSampledTextureData {
+ quint64 texId;
+ uint texGeneration;
+ quint64 samplerId;
+ uint samplerGeneration;
+ };
+ struct BoundStorageImageData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundStorageBufferData {
+ quint64 id;
+ uint generation;
+ };
+ struct BoundResourceData {
+ union {
+ BoundUniformBufferData ubuf;
+ BoundSampledTextureData stex;
+ BoundStorageImageData simage;
+ BoundStorageBufferData sbuf;
+ };
+ };
+ QVarLengthArray<BoundResourceData, 8> boundResourceData[QVK_FRAMES_IN_FLIGHT];
+
+ friend class QRhiVulkan;
+};
+
+Q_DECLARE_TYPEINFO(QVkShaderResourceBindings::BoundResourceData, Q_MOVABLE_TYPE);
+
+struct QVkGraphicsPipeline : public QRhiGraphicsPipeline
+{
+ QVkGraphicsPipeline(QRhiImplementation *rhi);
+ ~QVkGraphicsPipeline();
+ void release() override;
+ bool build() override;
+
+ VkPipelineLayout layout = VK_NULL_HANDLE;
+ VkPipeline pipeline = VK_NULL_HANDLE;
+ int lastActiveFrameSlot = -1;
+ uint generation = 0;
+ friend class QRhiVulkan;
+};
+
+struct QVkComputePipeline : public QRhiComputePipeline
+{
+ QVkComputePipeline(QRhiImplementation *rhi);
+ ~QVkComputePipeline();
+ void release() override;
+ bool build() override;
+
+ VkPipelineLayout layout = VK_NULL_HANDLE;
+ VkPipeline pipeline = VK_NULL_HANDLE;
+ int lastActiveFrameSlot = -1;
+ uint generation = 0;
+ friend class QRhiVulkan;
+};
+
+struct QVkCommandBuffer : public QRhiCommandBuffer
+{
+ QVkCommandBuffer(QRhiImplementation *rhi);
+ ~QVkCommandBuffer();
+ void release() override;
+
+ const QRhiNativeHandles *nativeHandles();
+
+ VkCommandBuffer cb = VK_NULL_HANDLE; // primary
+ bool useSecondaryCb = false;
+ QRhiVulkanCommandBufferNativeHandles nativeHandlesStruct;
+
+ enum PassType {
+ NoPass,
+ RenderPass,
+ ComputePass
+ };
+
+ void resetState() {
+ recordingPass = NoPass;
+ currentTarget = nullptr;
+
+ secondaryCbs.clear();
+
+ resetCommands();
+ resetCachedState();
+ }
+
+ void resetCachedState() {
+ currentGraphicsPipeline = nullptr;
+ currentComputePipeline = nullptr;
+ currentPipelineGeneration = 0;
+ currentGraphicsSrb = nullptr;
+ currentComputeSrb = nullptr;
+ currentSrbGeneration = 0;
+ currentDescSetSlot = -1;
+ currentIndexBuffer = VK_NULL_HANDLE;
+ currentIndexOffset = 0;
+ currentIndexFormat = VK_INDEX_TYPE_UINT16;
+ memset(currentVertexBuffers, 0, sizeof(currentVertexBuffers));
+ memset(currentVertexOffsets, 0, sizeof(currentVertexOffsets));
+ inExternal = false;
+ }
+
+ PassType recordingPass;
+ QRhiRenderTarget *currentTarget;
+ QRhiGraphicsPipeline *currentGraphicsPipeline;
+ QRhiComputePipeline *currentComputePipeline;
+ uint currentPipelineGeneration;
+ QRhiShaderResourceBindings *currentGraphicsSrb;
+ QRhiShaderResourceBindings *currentComputeSrb;
+ uint currentSrbGeneration;
+ int currentDescSetSlot;
+ VkBuffer currentIndexBuffer;
+ quint32 currentIndexOffset;
+ VkIndexType currentIndexFormat;
+ static const int VERTEX_INPUT_RESOURCE_SLOT_COUNT = 32;
+ VkBuffer currentVertexBuffers[VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ quint32 currentVertexOffsets[VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ QVarLengthArray<VkCommandBuffer, 4> secondaryCbs;
+ bool inExternal;
+
+ struct Command {
+ enum Cmd {
+ CopyBuffer,
+ CopyBufferToImage,
+ CopyImage,
+ CopyImageToBuffer,
+ ImageBarrier,
+ BufferBarrier,
+ BlitImage,
+ BeginRenderPass,
+ EndRenderPass,
+ BindPipeline,
+ BindDescriptorSet,
+ BindVertexBuffer,
+ BindIndexBuffer,
+ SetViewport,
+ SetScissor,
+ SetBlendConstants,
+ SetStencilRef,
+ Draw,
+ DrawIndexed,
+ DebugMarkerBegin,
+ DebugMarkerEnd,
+ DebugMarkerInsert,
+ TransitionPassResources,
+ Dispatch,
+ ExecuteSecondary
+ };
+ Cmd cmd;
+
+ union Args {
+ struct {
+ VkBuffer src;
+ VkBuffer dst;
+ VkBufferCopy desc;
+ } copyBuffer;
+ struct {
+ VkBuffer src;
+ VkImage dst;
+ VkImageLayout dstLayout;
+ int count;
+ int bufferImageCopyIndex;
+ } copyBufferToImage;
+ struct {
+ VkImage src;
+ VkImageLayout srcLayout;
+ VkImage dst;
+ VkImageLayout dstLayout;
+ VkImageCopy desc;
+ } copyImage;
+ struct {
+ VkImage src;
+ VkImageLayout srcLayout;
+ VkBuffer dst;
+ VkBufferImageCopy desc;
+ } copyImageToBuffer;
+ struct {
+ VkPipelineStageFlags srcStageMask;
+ VkPipelineStageFlags dstStageMask;
+ VkImageMemoryBarrier desc;
+ } imageBarrier;
+ struct {
+ VkPipelineStageFlags srcStageMask;
+ VkPipelineStageFlags dstStageMask;
+ VkBufferMemoryBarrier desc;
+ } bufferBarrier;
+ struct {
+ VkImage src;
+ VkImageLayout srcLayout;
+ VkImage dst;
+ VkImageLayout dstLayout;
+ VkFilter filter;
+ VkImageBlit desc;
+ } blitImage;
+ struct {
+ VkRenderPassBeginInfo desc;
+ int clearValueIndex;
+ } beginRenderPass;
+ struct {
+ } endRenderPass;
+ struct {
+ VkPipelineBindPoint bindPoint;
+ VkPipeline pipeline;
+ } bindPipeline;
+ struct {
+ VkPipelineBindPoint bindPoint;
+ VkPipelineLayout pipelineLayout;
+ VkDescriptorSet descSet;
+ int dynamicOffsetCount;
+ int dynamicOffsetIndex;
+ } bindDescriptorSet;
+ struct {
+ int startBinding;
+ int count;
+ int vertexBufferIndex;
+ int vertexBufferOffsetIndex;
+ } bindVertexBuffer;
+ struct {
+ VkBuffer buf;
+ VkDeviceSize ofs;
+ VkIndexType type;
+ } bindIndexBuffer;
+ struct {
+ VkViewport viewport;
+ } setViewport;
+ struct {
+ VkRect2D scissor;
+ } setScissor;
+ struct {
+ float c[4];
+ } setBlendConstants;
+ struct {
+ uint32_t ref;
+ } setStencilRef;
+ struct {
+ uint32_t vertexCount;
+ uint32_t instanceCount;
+ uint32_t firstVertex;
+ uint32_t firstInstance;
+ } draw;
+ struct {
+ uint32_t indexCount;
+ uint32_t instanceCount;
+ uint32_t firstIndex;
+ int32_t vertexOffset;
+ uint32_t firstInstance;
+ } drawIndexed;
+ struct {
+ VkDebugMarkerMarkerInfoEXT marker;
+ int markerNameIndex;
+ } debugMarkerBegin;
+ struct {
+ } debugMarkerEnd;
+ struct {
+ VkDebugMarkerMarkerInfoEXT marker;
+ int markerNameIndex;
+ } debugMarkerInsert;
+ struct {
+ int trackerIndex;
+ } transitionResources;
+ struct {
+ int x, y, z;
+ } dispatch;
+ struct {
+ VkCommandBuffer cb;
+ } executeSecondary;
+ } args;
+ };
+ QVector<Command> commands;
+ QVarLengthArray<QRhiPassResourceTracker, 8> passResTrackers;
+ int currentPassResTrackerIndex;
+
+ void resetCommands() {
+ commands.clear();
+ resetPools();
+
+ passResTrackers.clear();
+ currentPassResTrackerIndex = -1;
+ }
+
+ void resetPools() {
+ pools.clearValue.clear();
+ pools.bufferImageCopy.clear();
+ pools.dynamicOffset.clear();
+ pools.vertexBuffer.clear();
+ pools.vertexBufferOffset.clear();
+ pools.debugMarkerData.clear();
+ }
+
+ struct {
+ QVarLengthArray<VkClearValue, 4> clearValue;
+ QVarLengthArray<VkBufferImageCopy, 16> bufferImageCopy;
+ QVarLengthArray<uint32_t, 4> dynamicOffset;
+ QVarLengthArray<VkBuffer, 4> vertexBuffer;
+ QVarLengthArray<VkDeviceSize, 4> vertexBufferOffset;
+ QVarLengthArray<QByteArray, 4> debugMarkerData;
+ } pools;
+
+ friend class QRhiVulkan;
+};
+
+Q_DECLARE_TYPEINFO(QVkCommandBuffer::Command, Q_MOVABLE_TYPE);
+
+struct QVkSwapChain : public QRhiSwapChain
+{
+ QVkSwapChain(QRhiImplementation *rhi);
+ ~QVkSwapChain();
+ void release() override;
+
+ QRhiCommandBuffer *currentFrameCommandBuffer() override;
+ QRhiRenderTarget *currentFrameRenderTarget() override;
+
+ QSize surfacePixelSize() override;
+
+ QRhiRenderPassDescriptor *newCompatibleRenderPassDescriptor() override;
+ bool buildOrResize() override;
+
+ bool ensureSurface();
+
+ static const quint32 MAX_BUFFER_COUNT = 3;
+
+ QWindow *window = nullptr;
+ QSize pixelSize;
+ bool supportsReadback = false;
+ VkSwapchainKHR sc = VK_NULL_HANDLE;
+ int bufferCount = 0;
+ VkSurfaceKHR surface = VK_NULL_HANDLE;
+ VkSurfaceKHR lastConnectedSurface = VK_NULL_HANDLE;
+ VkFormat colorFormat = VK_FORMAT_B8G8R8A8_UNORM;
+ VkColorSpaceKHR colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;
+ QVkRenderBuffer *ds = nullptr;
+ VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT;
+ QVector<VkPresentModeKHR> supportedPresentationModes;
+ VkDeviceMemory msaaImageMem = VK_NULL_HANDLE;
+ QVkReferenceRenderTarget rtWrapper;
+ QVkCommandBuffer cbWrapper;
+
+ struct ImageResources {
+ VkImage image = VK_NULL_HANDLE;
+ VkImageView imageView = VK_NULL_HANDLE;
+ VkFramebuffer fb = VK_NULL_HANDLE;
+ VkImage msaaImage = VK_NULL_HANDLE;
+ VkImageView msaaImageView = VK_NULL_HANDLE;
+ enum LastUse {
+ ScImageUseNone,
+ ScImageUseRender,
+ ScImageUseTransferSource
+ };
+ LastUse lastUse = ScImageUseNone;
+ } imageRes[MAX_BUFFER_COUNT];
+
+ struct FrameResources {
+ VkFence imageFence = VK_NULL_HANDLE;
+ bool imageFenceWaitable = false;
+ VkSemaphore imageSem = VK_NULL_HANDLE;
+ VkSemaphore drawSem = VK_NULL_HANDLE;
+ bool imageAcquired = false;
+ bool imageSemWaitable = false;
+ quint32 imageIndex = 0;
+ VkCommandBuffer cmdBuf = VK_NULL_HANDLE; // primary
+ VkFence cmdFence = VK_NULL_HANDLE;
+ bool cmdFenceWaitable = false;
+ int timestampQueryIndex = -1;
+ } frameRes[QVK_FRAMES_IN_FLIGHT];
+
+ quint32 currentImageIndex = 0; // index in imageRes
+ quint32 currentFrameSlot = 0; // index in frameRes
+ int frameCount = 0;
+
+ friend class QRhiVulkan;
+};
+
+class QRhiVulkan : public QRhiImplementation
+{
+public:
+ QRhiVulkan(QRhiVulkanInitParams *params, QRhiVulkanNativeHandles *importDevice = nullptr);
+
+ bool create(QRhi::Flags flags) override;
+ void destroy() override;
+
+ QRhiGraphicsPipeline *createGraphicsPipeline() override;
+ QRhiComputePipeline *createComputePipeline() override;
+ QRhiShaderResourceBindings *createShaderResourceBindings() override;
+ QRhiBuffer *createBuffer(QRhiBuffer::Type type,
+ QRhiBuffer::UsageFlags usage,
+ int size) override;
+ QRhiRenderBuffer *createRenderBuffer(QRhiRenderBuffer::Type type,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiRenderBuffer::Flags flags) override;
+ QRhiTexture *createTexture(QRhiTexture::Format format,
+ const QSize &pixelSize,
+ int sampleCount,
+ QRhiTexture::Flags flags) override;
+ QRhiSampler *createSampler(QRhiSampler::Filter magFilter, QRhiSampler::Filter minFilter,
+ QRhiSampler::Filter mipmapMode,
+ QRhiSampler:: AddressMode u, QRhiSampler::AddressMode v) override;
+
+ QRhiTextureRenderTarget *createTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc,
+ QRhiTextureRenderTarget::Flags flags) override;
+
+ QRhiSwapChain *createSwapChain() override;
+ QRhi::FrameOpResult beginFrame(QRhiSwapChain *swapChain, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endFrame(QRhiSwapChain *swapChain, QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi::BeginFrameFlags flags) override;
+ QRhi::FrameOpResult endOffscreenFrame(QRhi::EndFrameFlags flags) override;
+ QRhi::FrameOpResult finish() override;
+
+ void resourceUpdate(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void beginPass(QRhiCommandBuffer *cb,
+ QRhiRenderTarget *rt,
+ const QColor &colorClearValue,
+ const QRhiDepthStencilClearValue &depthStencilClearValue,
+ QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+
+ void setGraphicsPipeline(QRhiCommandBuffer *cb,
+ QRhiGraphicsPipeline *ps) override;
+
+ void setShaderResources(QRhiCommandBuffer *cb,
+ QRhiShaderResourceBindings *srb,
+ int dynamicOffsetCount,
+ const QRhiCommandBuffer::DynamicOffset *dynamicOffsets) override;
+
+ void setVertexInput(QRhiCommandBuffer *cb,
+ int startBinding, int bindingCount, const QRhiCommandBuffer::VertexInput *bindings,
+ QRhiBuffer *indexBuf, quint32 indexOffset,
+ QRhiCommandBuffer::IndexFormat indexFormat) override;
+
+ void setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport) override;
+ void setScissor(QRhiCommandBuffer *cb, const QRhiScissor &scissor) override;
+ void setBlendConstants(QRhiCommandBuffer *cb, const QColor &c) override;
+ void setStencilRef(QRhiCommandBuffer *cb, quint32 refValue) override;
+
+ void draw(QRhiCommandBuffer *cb, quint32 vertexCount,
+ quint32 instanceCount, quint32 firstVertex, quint32 firstInstance) override;
+
+ void drawIndexed(QRhiCommandBuffer *cb, quint32 indexCount,
+ quint32 instanceCount, quint32 firstIndex,
+ qint32 vertexOffset, quint32 firstInstance) override;
+
+ void debugMarkBegin(QRhiCommandBuffer *cb, const QByteArray &name) override;
+ void debugMarkEnd(QRhiCommandBuffer *cb) override;
+ void debugMarkMsg(QRhiCommandBuffer *cb, const QByteArray &msg) override;
+
+ void beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void endComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) override;
+ void setComputePipeline(QRhiCommandBuffer *cb, QRhiComputePipeline *ps) override;
+ void dispatch(QRhiCommandBuffer *cb, int x, int y, int z) override;
+
+ const QRhiNativeHandles *nativeHandles(QRhiCommandBuffer *cb) override;
+ void beginExternal(QRhiCommandBuffer *cb) override;
+ void endExternal(QRhiCommandBuffer *cb) override;
+
+ QVector<int> supportedSampleCounts() const override;
+ int ubufAlignment() const override;
+ bool isYUpInFramebuffer() const override;
+ bool isYUpInNDC() const override;
+ bool isClipDepthZeroToOne() const override;
+ QMatrix4x4 clipSpaceCorrMatrix() const override;
+ bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags) const override;
+ bool isFeatureSupported(QRhi::Feature feature) const override;
+ int resourceLimit(QRhi::ResourceLimit limit) const override;
+ const QRhiNativeHandles *nativeHandles() override;
+ void sendVMemStatsToProfiler() override;
+ bool makeThreadLocalNativeContextCurrent() override;
+ void releaseCachedResources() override;
+ bool isDeviceLost() const override;
+
+ VkResult createDescriptorPool(VkDescriptorPool *pool);
+ bool allocateDescriptorSet(VkDescriptorSetAllocateInfo *allocInfo, VkDescriptorSet *result, int *resultPoolIndex);
+ uint32_t chooseTransientImageMemType(VkImage img, uint32_t startIndex);
+ bool createTransientImage(VkFormat format, const QSize &pixelSize, VkImageUsageFlags usage,
+ VkImageAspectFlags aspectMask, VkSampleCountFlagBits samples,
+ VkDeviceMemory *mem, VkImage *images, VkImageView *views, int count);
+
+ bool recreateSwapChain(QRhiSwapChain *swapChain);
+ void releaseSwapChainResources(QRhiSwapChain *swapChain);
+
+ VkFormat optimalDepthStencilFormat();
+ VkSampleCountFlagBits effectiveSampleCount(int sampleCount);
+ bool createDefaultRenderPass(VkRenderPass *rp,
+ bool hasDepthStencil,
+ VkSampleCountFlagBits samples,
+ VkFormat colorFormat);
+ bool createOffscreenRenderPass(VkRenderPass *rp,
+ const QRhiColorAttachment *firstColorAttachment,
+ const QRhiColorAttachment *lastColorAttachment,
+ bool preserveColor,
+ bool preserveDs,
+ QRhiRenderBuffer *depthStencilBuffer,
+ QRhiTexture *depthTexture);
+ bool ensurePipelineCache();
+ VkShaderModule createShader(const QByteArray &spirv);
+
+ void prepareNewFrame(QRhiCommandBuffer *cb);
+ VkCommandBuffer startSecondaryCommandBuffer(QVkRenderTargetData *rtD = nullptr);
+ void endAndEnqueueSecondaryCommandBuffer(VkCommandBuffer cb, QVkCommandBuffer *cbD);
+ void deferredReleaseSecondaryCommandBuffer(VkCommandBuffer cb);
+ QRhi::FrameOpResult startPrimaryCommandBuffer(VkCommandBuffer *cb);
+ QRhi::FrameOpResult endAndSubmitPrimaryCommandBuffer(VkCommandBuffer cb, VkFence cmdFence,
+ VkSemaphore *waitSem, VkSemaphore *signalSem);
+ void waitCommandCompletion(int frameSlot);
+ VkDeviceSize subresUploadByteSize(const QRhiTextureSubresourceUploadDescription &subresDesc) const;
+ using BufferImageCopyList = QVarLengthArray<VkBufferImageCopy, 16>;
+ void prepareUploadSubres(QVkTexture *texD, int layer, int level,
+ const QRhiTextureSubresourceUploadDescription &subresDesc,
+ size_t *curOfs, void *mp,
+ BufferImageCopyList *copyInfos);
+ void enqueueResourceUpdates(QVkCommandBuffer *cbD, QRhiResourceUpdateBatch *resourceUpdates);
+ void executeBufferHostWritesForCurrentFrame(QVkBuffer *bufD);
+ void enqueueTransitionPassResources(QVkCommandBuffer *cbD);
+ void recordPrimaryCommandBuffer(QVkCommandBuffer *cbD);
+ void trackedRegisterBuffer(QRhiPassResourceTracker *passResTracker,
+ QVkBuffer *bufD,
+ int slot,
+ QRhiPassResourceTracker::BufferAccess access,
+ QRhiPassResourceTracker::BufferStage stage);
+ void trackedRegisterTexture(QRhiPassResourceTracker *passResTracker,
+ QVkTexture *texD,
+ QRhiPassResourceTracker::TextureAccess access,
+ QRhiPassResourceTracker::TextureStage stage);
+ void recordTransitionPassResources(QVkCommandBuffer *cbD, const QRhiPassResourceTracker &tracker);
+ void activateTextureRenderTarget(QVkCommandBuffer *cbD, QVkTextureRenderTarget *rtD);
+ void executeDeferredReleases(bool forced = false);
+ void finishActiveReadbacks(bool forced = false);
+
+ void setObjectName(uint64_t object, VkDebugReportObjectTypeEXT type, const QByteArray &name, int slot = -1);
+ void trackedBufferBarrier(QVkCommandBuffer *cbD, QVkBuffer *bufD, int slot,
+ VkAccessFlags access, VkPipelineStageFlags stage);
+ void trackedImageBarrier(QVkCommandBuffer *cbD, QVkTexture *texD,
+ VkImageLayout layout, VkAccessFlags access, VkPipelineStageFlags stage);
+ void subresourceBarrier(QVkCommandBuffer *cbD, VkImage image,
+ VkImageLayout oldLayout, VkImageLayout newLayout,
+ VkAccessFlags srcAccess, VkAccessFlags dstAccess,
+ VkPipelineStageFlags srcStage, VkPipelineStageFlags dstStage,
+ int startLayer, int layerCount,
+ int startLevel, int levelCount);
+ void updateShaderResourceBindings(QRhiShaderResourceBindings *srb, int descSetIdx = -1);
+
+ QVulkanInstance *inst = nullptr;
+ QWindow *maybeWindow = nullptr;
+ bool importedDevice = false;
+ VkPhysicalDevice physDev = VK_NULL_HANDLE;
+ VkDevice dev = VK_NULL_HANDLE;
+ bool importedCmdPool = false;
+ VkCommandPool cmdPool = VK_NULL_HANDLE;
+ int gfxQueueFamilyIdx = -1;
+ VkQueue gfxQueue = VK_NULL_HANDLE;
+ bool hasCompute = false;
+ quint32 timestampValidBits = 0;
+ bool importedAllocator = false;
+ QVkAllocator allocator = nullptr;
+ QVulkanFunctions *f = nullptr;
+ QVulkanDeviceFunctions *df = nullptr;
+ VkPhysicalDeviceFeatures physDevFeatures;
+ VkPhysicalDeviceProperties physDevProperties;
+ VkDeviceSize ubufAlign;
+ VkDeviceSize texbufAlign;
+ bool hasWideLines = false;
+ bool deviceLost = false;
+
+ bool debugMarkersAvailable = false;
+ bool vertexAttribDivisorAvailable = false;
+ PFN_vkCmdDebugMarkerBeginEXT vkCmdDebugMarkerBegin = nullptr;
+ PFN_vkCmdDebugMarkerEndEXT vkCmdDebugMarkerEnd = nullptr;
+ PFN_vkCmdDebugMarkerInsertEXT vkCmdDebugMarkerInsert = nullptr;
+ PFN_vkDebugMarkerSetObjectNameEXT vkDebugMarkerSetObjectName = nullptr;
+
+ PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR = nullptr;
+ PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
+ PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
+ PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
+ PFN_vkQueuePresentKHR vkQueuePresentKHR;
+ PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR = nullptr;
+ PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
+ PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
+
+ VkPipelineCache pipelineCache = VK_NULL_HANDLE;
+ struct DescriptorPoolData {
+ DescriptorPoolData() { }
+ DescriptorPoolData(VkDescriptorPool pool_)
+ : pool(pool_)
+ { }
+ VkDescriptorPool pool = VK_NULL_HANDLE;
+ int refCount = 0;
+ int allocedDescSets = 0;
+ };
+ QVector<DescriptorPoolData> descriptorPools;
+
+ VkQueryPool timestampQueryPool = VK_NULL_HANDLE;
+ QBitArray timestampQueryPoolMap;
+
+ VkFormat optimalDsFormat = VK_FORMAT_UNDEFINED;
+ QMatrix4x4 clipCorrectMatrix;
+
+ QVkSwapChain *currentSwapChain = nullptr;
+ QSet<QVkSwapChain *> swapchains;
+ QRhiVulkanNativeHandles nativeHandlesStruct;
+
+ struct OffscreenFrame {
+ OffscreenFrame(QRhiImplementation *rhi) : cbWrapper(rhi) { }
+ bool active = false;
+ QVkCommandBuffer cbWrapper;
+ VkFence cmdFence = VK_NULL_HANDLE;
+ } ofr;
+
+ struct TextureReadback {
+ int activeFrameSlot = -1;
+ QRhiReadbackDescription desc;
+ QRhiReadbackResult *result;
+ VkBuffer stagingBuf;
+ QVkAlloc stagingAlloc;
+ quint32 byteSize;
+ QSize pixelSize;
+ QRhiTexture::Format format;
+ };
+ QVector<TextureReadback> activeTextureReadbacks;
+ struct BufferReadback {
+ int activeFrameSlot = -1;
+ QRhiBufferReadbackResult *result;
+ int byteSize;
+ VkBuffer stagingBuf;
+ QVkAlloc stagingAlloc;
+ };
+ QVector<BufferReadback> activeBufferReadbacks;
+
+ struct DeferredReleaseEntry {
+ enum Type {
+ Pipeline,
+ ShaderResourceBindings,
+ Buffer,
+ RenderBuffer,
+ Texture,
+ Sampler,
+ TextureRenderTarget,
+ RenderPass,
+ StagingBuffer,
+ CommandBuffer
+ };
+ Type type;
+ int lastActiveFrameSlot; // -1 if not used otherwise 0..FRAMES_IN_FLIGHT-1
+ union {
+ struct {
+ VkPipeline pipeline;
+ VkPipelineLayout layout;
+ } pipelineState;
+ struct {
+ int poolIndex;
+ VkDescriptorSetLayout layout;
+ } shaderResourceBindings;
+ struct {
+ VkBuffer buffers[QVK_FRAMES_IN_FLIGHT];
+ QVkAlloc allocations[QVK_FRAMES_IN_FLIGHT];
+ VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
+ QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
+ } buffer;
+ struct {
+ VkDeviceMemory memory;
+ VkImage image;
+ VkImageView imageView;
+ } renderBuffer;
+ struct {
+ VkImage image;
+ VkImageView imageView;
+ QVkAlloc allocation;
+ VkBuffer stagingBuffers[QVK_FRAMES_IN_FLIGHT];
+ QVkAlloc stagingAllocations[QVK_FRAMES_IN_FLIGHT];
+ VkImageView extraImageViews[QRhi::MAX_LEVELS];
+ } texture;
+ struct {
+ VkSampler sampler;
+ } sampler;
+ struct {
+ VkFramebuffer fb;
+ VkImageView rtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS];
+ VkImageView resrtv[QVkRenderTargetData::MAX_COLOR_ATTACHMENTS];
+ } textureRenderTarget;
+ struct {
+ VkRenderPass rp;
+ } renderPass;
+ struct {
+ VkBuffer stagingBuffer;
+ QVkAlloc stagingAllocation;
+ } stagingBuffer;
+ struct {
+ VkCommandBuffer cb;
+ } commandBuffer;
+ };
+ };
+ QVector<DeferredReleaseEntry> releaseQueue;
+};
+
+Q_DECLARE_TYPEINFO(QRhiVulkan::DescriptorPoolData, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiVulkan::DeferredReleaseEntry, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiVulkan::TextureReadback, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiVulkan::BufferReadback, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qrhivulkanext_p.h b/src/gui/rhi/qrhivulkanext_p.h
new file mode 100644
index 0000000000..67a63e07e0
--- /dev/null
+++ b/src/gui/rhi/qrhivulkanext_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt RHI module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QRHIVULKANEXT_P_H
+#define QRHIVULKANEXT_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 "qrhivulkan_p.h"
+
+QT_BEGIN_NAMESPACE
+
+#ifndef VK_EXT_vertex_attribute_divisor
+#define VK_EXT_vertex_attribute_divisor 1
+#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_SPEC_VERSION 2
+#define VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME "VK_EXT_vertex_attribute_divisor"
+
+typedef struct VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxVertexAttribDivisor;
+} VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT;
+
+typedef struct VkVertexInputBindingDivisorDescriptionEXT {
+ uint32_t binding;
+ uint32_t divisor;
+} VkVertexInputBindingDivisorDescriptionEXT;
+
+typedef struct VkPipelineVertexInputDivisorStateCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t vertexBindingDivisorCount;
+ const VkVertexInputBindingDivisorDescriptionEXT* pVertexBindingDivisors;
+} VkPipelineVertexInputDivisorStateCreateInfoEXT;
+#endif // VK_EXT_vertex_attribute_divisor
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp
new file mode 100644
index 0000000000..c22b029dc8
--- /dev/null
+++ b/src/gui/rhi/qshader.cpp
@@ -0,0 +1,699 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qshader_p_p.h"
+#include <QDataStream>
+#include <QBuffer>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QShader
+ \internal
+ \inmodule QtGui
+
+ \brief Contains multiple versions of a shader translated to multiple shading languages,
+ together with reflection metadata.
+
+ QShader is the entry point to shader code in the graphics API agnostic
+ Qt world. Instead of using GLSL shader sources, as was the custom with Qt
+ 5.x, new graphics systems with backends for multiple graphics APIs, such
+ as, Vulkan, Metal, Direct3D, and OpenGL, take QShader as their input
+ whenever a shader needs to be specified.
+
+ A QShader instance is empty and thus invalid by default. To get a useful
+ instance, the two typical methods are:
+
+ \list
+
+ \li Generate the contents offline, during build time or earlier, using the
+ \c qsb command line tool. The result is a binary file that is shipped with
+ the application, read via QIODevice::readAll(), and then deserialized via
+ fromSerialized(). For more information, see QShaderBaker.
+
+ \li Generate at run time via QShaderBaker. This is an expensive operation,
+ but allows applications to use user-provided or dynamically generated
+ shader source strings.
+
+ \endlist
+
+ When used together with the Qt Rendering Hardware Interface and its
+ classes, like QRhiGraphicsPipeline, no further action is needed from the
+ application's side as these classes are prepared to consume a QShader
+ whenever a shader needs to be specified for a given stage of the graphics
+ pipeline.
+
+ Alternatively, applications can access
+
+ \list
+
+ \li the source or byte code for any of the shading language versions that
+ are included in the QShader,
+
+ \li the name of the entry point for the shader,
+
+ \li the reflection metadata containing a description of the shader's
+ inputs, outputs and resources like uniform blocks. This is essential when
+ an application or framework needs to discover the inputs of a shader at
+ runtime due to not having advance knowledge of the vertex attributes or the
+ layout of the uniform buffers used by the shader.
+
+ \endlist
+
+ QShader makes no assumption about the shading language that was used
+ as the source for generating the various versions and variants that are
+ included in it.
+
+ QShader uses implicit sharing similarly to many core Qt types, and so
+ can be returned or passed by value. Detach happens implicitly when calling
+ a setter.
+
+ For reference, QRhi expects that a QShader suitable for all its
+ backends contains at least the following:
+
+ \list
+
+ \li SPIR-V 1.0 bytecode suitable for Vulkan 1.0 or newer
+
+ \li GLSL/ES 100 source code suitable for OpenGL ES 2.0 or newer
+
+ \li GLSL 120 source code suitable for OpenGL 2.1
+
+ \li HLSL Shader Model 5.0 source code or the corresponding DXBC bytecode suitable for Direct3D 11
+
+ \li Metal Shading Language 1.2 source code or the corresponding bytecode suitable for Metal
+
+ \endlist
+
+ \sa QShaderBaker
+ */
+
+/*!
+ \enum QShader::Stage
+ Describes the stage of the graphics pipeline the shader is suitable for.
+
+ \value VertexStage Vertex shader
+ \value TessellationControlStage Tessellation control (hull) shader
+ \value TessellationEvaluationStage Tessellation evaluation (domain) shader
+ \value GeometryStage Geometry shader
+ \value FragmentStage Fragment (pixel) shader
+ \value ComputeStage Compute shader
+ */
+
+/*!
+ \class QShaderVersion
+ \internal
+ \inmodule QtGui
+
+ \brief Specifies the shading language version.
+
+ While languages like SPIR-V or the Metal Shading Language use traditional
+ version numbers, shaders for other APIs can use slightly different
+ versioning schemes. All those are mapped to a single version number in
+ here, however. For HLSL, the version refers to the Shader Model version,
+ like 5.0, 5.1, or 6.0. For GLSL an additional flag is needed to choose
+ between GLSL and GLSL/ES.
+
+ Below is a list with the most common examples of shader versions for
+ different graphics APIs:
+
+ \list
+
+ \li Vulkan (SPIR-V): 100
+ \li OpenGL: 120, 330, 440, etc.
+ \li OpenGL ES: 100 with GlslEs, 300 with GlslEs, etc.
+ \li Direct3D: 50, 51, 60
+ \li Metal: 12, 20
+ \endlist
+
+ A default constructed QShaderVersion contains a version of 100 and no
+ flags set.
+ */
+
+/*!
+ \enum QShaderVersion::Flag
+
+ Describes the flags that can be set.
+
+ \value GlslEs Indicates that GLSL/ES is meant in combination with GlslShader
+ */
+
+/*!
+ \class QShaderKey
+ \internal
+ \inmodule QtGui
+
+ \brief Specifies the shading language, the version with flags, and the variant.
+
+ A default constructed QShaderKey has source set to SpirvShader and
+ sourceVersion set to 100. sourceVariant defaults to StandardShader.
+ */
+
+/*!
+ \enum QShader::Source
+ Describes what kind of shader code an entry contains.
+
+ \value SpirvShader SPIR-V
+ \value GlslShader GLSL
+ \value HlslShader HLSL
+ \value DxbcShader Direct3D bytecode (HLSL compiled by \c fxc)
+ \value MslShader Metal Shading Language
+ \value DxilShader Direct3D bytecode (HLSL compiled by \c dxc)
+ \value MetalLibShader Pre-compiled Metal bytecode
+ */
+
+/*!
+ \enum QShader::Variant
+ Describes what kind of shader code an entry contains.
+
+ \value StandardShader The normal, unmodified version of the shader code.
+ \value BatchableVertexShader Vertex shader rewritten to be suitable for Qt Quick scenegraph batching.
+ */
+
+/*!
+ \class QShaderCode
+ \internal
+ \inmodule QtGui
+
+ \brief Contains source or binary code for a shader and additional metadata.
+
+ When shader() is empty after retrieving a QShaderCode instance from
+ QShader, it indicates no shader code was found for the requested key.
+ */
+
+static const int QSB_VERSION = 2;
+static const int QSB_VERSION_WITHOUT_BINDINGS = 1;
+
+/*!
+ Constructs a new, empty (and thus invalid) QShader instance.
+ */
+QShader::QShader()
+ : d(new QShaderPrivate)
+{
+}
+
+/*!
+ \internal
+ */
+void QShader::detach()
+{
+ qAtomicDetach(d);
+}
+
+/*!
+ \internal
+ */
+QShader::QShader(const QShader &other)
+ : d(other.d)
+{
+ d->ref.ref();
+}
+
+/*!
+ \internal
+ */
+QShader &QShader::operator=(const QShader &other)
+{
+ qAtomicAssign(d, other.d);
+ return *this;
+}
+
+/*!
+ Destructor.
+ */
+QShader::~QShader()
+{
+ if (!d->ref.deref())
+ delete d;
+}
+
+/*!
+ \return true if the QShader contains at least one shader version.
+ */
+bool QShader::isValid() const
+{
+ return !d->shaders.isEmpty();
+}
+
+/*!
+ \return the pipeline stage the shader is meant for.
+ */
+QShader::Stage QShader::stage() const
+{
+ return d->stage;
+}
+
+/*!
+ Sets the pipeline \a stage.
+ */
+void QShader::setStage(Stage stage)
+{
+ if (stage != d->stage) {
+ detach();
+ d->stage = stage;
+ }
+}
+
+/*!
+ \return the reflection metadata for the shader.
+ */
+QShaderDescription QShader::description() const
+{
+ return d->desc;
+}
+
+/*!
+ Sets the reflection metadata to \a desc.
+ */
+void QShader::setDescription(const QShaderDescription &desc)
+{
+ detach();
+ d->desc = desc;
+}
+
+/*!
+ \return the list of available shader versions
+ */
+QVector<QShaderKey> QShader::availableShaders() const
+{
+ return d->shaders.keys().toVector();
+}
+
+/*!
+ \return the source or binary code for a given shader version specified by \a key.
+ */
+QShaderCode QShader::shader(const QShaderKey &key) const
+{
+ return d->shaders.value(key);
+}
+
+/*!
+ Stores the source or binary \a shader code for a given shader version specified by \a key.
+ */
+void QShader::setShader(const QShaderKey &key, const QShaderCode &shader)
+{
+ if (d->shaders.value(key) == shader)
+ return;
+
+ detach();
+ d->shaders[key] = shader;
+}
+
+/*!
+ Removes the source or binary shader code for a given \a key.
+ Does nothing when not found.
+ */
+void QShader::removeShader(const QShaderKey &key)
+{
+ auto it = d->shaders.find(key);
+ if (it == d->shaders.end())
+ return;
+
+ detach();
+ d->shaders.erase(it);
+}
+
+static void writeShaderKey(QDataStream *ds, const QShaderKey &k)
+{
+ *ds << k.source();
+ *ds << k.sourceVersion().version();
+ *ds << k.sourceVersion().flags();
+ *ds << k.sourceVariant();
+}
+
+/*!
+ \return a serialized binary version of all the data held by the
+ QShader, suitable for writing to files or other I/O devices.
+
+ \sa fromSerialized()
+ */
+QByteArray QShader::serialized() const
+{
+ QBuffer buf;
+ QDataStream ds(&buf);
+ ds.setVersion(QDataStream::Qt_5_10);
+ if (!buf.open(QIODevice::WriteOnly))
+ return QByteArray();
+
+ ds << QSB_VERSION;
+ ds << d->stage;
+ ds << d->desc.toBinaryJson();
+ ds << d->shaders.count();
+ for (auto it = d->shaders.cbegin(), itEnd = d->shaders.cend(); it != itEnd; ++it) {
+ const QShaderKey &k(it.key());
+ writeShaderKey(&ds, k);
+ const QShaderCode &shader(d->shaders.value(k));
+ ds << shader.shader();
+ ds << shader.entryPoint();
+ }
+ ds << d->bindings.count();
+ for (auto it = d->bindings.cbegin(), itEnd = d->bindings.cend(); it != itEnd; ++it) {
+ const QShaderKey &k(it.key());
+ writeShaderKey(&ds, k);
+ const NativeResourceBindingMap &map(it.value());
+ ds << map.count();
+ for (auto mapIt = map.cbegin(), mapItEnd = map.cend(); mapIt != mapItEnd; ++mapIt) {
+ ds << mapIt.key();
+ ds << mapIt.value().first;
+ ds << mapIt.value().second;
+ }
+ }
+
+ return qCompress(buf.buffer());
+}
+
+static void readShaderKey(QDataStream *ds, QShaderKey *k)
+{
+ int intVal;
+ *ds >> intVal;
+ k->setSource(QShader::Source(intVal));
+ QShaderVersion ver;
+ *ds >> intVal;
+ ver.setVersion(intVal);
+ *ds >> intVal;
+ ver.setFlags(QShaderVersion::Flags(intVal));
+ k->setSourceVersion(ver);
+ *ds >> intVal;
+ k->setSourceVariant(QShader::Variant(intVal));
+}
+
+/*!
+ Creates a new QShader instance from the given \a data.
+
+ \sa serialized()
+ */
+QShader QShader::fromSerialized(const QByteArray &data)
+{
+ QByteArray udata = qUncompress(data);
+ QBuffer buf(&udata);
+ QDataStream ds(&buf);
+ ds.setVersion(QDataStream::Qt_5_10);
+ if (!buf.open(QIODevice::ReadOnly))
+ return QShader();
+
+ QShader bs;
+ QShaderPrivate *d = QShaderPrivate::get(&bs);
+ Q_ASSERT(d->ref.loadRelaxed() == 1); // must be detached
+ int intVal;
+ ds >> intVal;
+ const int qsbVersion = intVal;
+ if (qsbVersion != QSB_VERSION && qsbVersion != QSB_VERSION_WITHOUT_BINDINGS) {
+ qWarning("Attempted to deserialize QShader with unknown version %d.", qsbVersion);
+ return QShader();
+ }
+
+ ds >> intVal;
+ d->stage = Stage(intVal);
+ QByteArray descBin;
+ ds >> descBin;
+ d->desc = QShaderDescription::fromBinaryJson(descBin);
+ int count;
+ ds >> count;
+ for (int i = 0; i < count; ++i) {
+ QShaderKey k;
+ readShaderKey(&ds, &k);
+ QShaderCode shader;
+ QByteArray s;
+ ds >> s;
+ shader.setShader(s);
+ ds >> s;
+ shader.setEntryPoint(s);
+ d->shaders[k] = shader;
+ }
+
+ if (qsbVersion != QSB_VERSION_WITHOUT_BINDINGS) {
+ ds >> count;
+ for (int i = 0; i < count; ++i) {
+ QShaderKey k;
+ readShaderKey(&ds, &k);
+ NativeResourceBindingMap map;
+ int mapSize;
+ ds >> mapSize;
+ for (int b = 0; b < mapSize; ++b) {
+ int binding;
+ ds >> binding;
+ int firstNativeBinding;
+ ds >> firstNativeBinding;
+ int secondNativeBinding;
+ ds >> secondNativeBinding;
+ map.insert(binding, { firstNativeBinding, secondNativeBinding });
+ }
+ d->bindings.insert(k, map);
+ }
+ }
+
+ return bs;
+}
+
+QShaderVersion::QShaderVersion(int v, Flags f)
+ : m_version(v), m_flags(f)
+{
+}
+
+QShaderCode::QShaderCode(const QByteArray &code, const QByteArray &entry)
+ : m_shader(code), m_entryPoint(entry)
+{
+}
+
+QShaderKey::QShaderKey(QShader::Source s,
+ const QShaderVersion &sver,
+ QShader::Variant svar)
+ : m_source(s),
+ m_sourceVersion(sver),
+ m_sourceVariant(svar)
+{
+}
+
+/*!
+ Returns \c true if the two QShader objects \a lhs and \a rhs are equal,
+ meaning they are for the same stage with matching sets of shader source or
+ binary code.
+
+ \relates QShader
+ */
+bool operator==(const QShader &lhs, const QShader &rhs) Q_DECL_NOTHROW
+{
+ return lhs.d->stage == rhs.d->stage
+ && lhs.d->shaders == rhs.d->shaders;
+ // do not bother with desc and bindings, if the shader code is the same, the description must match too
+}
+
+/*!
+ \fn bool operator!=(const QShader &lhs, const QShader &rhs)
+
+ Returns \c false if the values in the two QShader objects \a a and \a b
+ are equal; otherwise returns \c true.
+
+ \relates QShader
+ */
+
+/*!
+ Returns the hash value for \a s, using \a seed to seed the calculation.
+
+ \relates QShader
+ */
+uint qHash(const QShader &s, uint seed) Q_DECL_NOTHROW
+{
+ uint h = s.stage();
+ for (auto it = s.d->shaders.constBegin(), itEnd = s.d->shaders.constEnd(); it != itEnd; ++it)
+ h += qHash(it.key(), seed) + qHash(it.value().shader(), seed);
+ return h;
+}
+
+/*!
+ Returns \c true if the two QShaderVersion objects \a lhs and \a rhs are
+ equal.
+
+ \relates QShaderVersion
+ */
+bool operator==(const QShaderVersion &lhs, const QShaderVersion &rhs) Q_DECL_NOTHROW
+{
+ return lhs.version() == rhs.version() && lhs.flags() == rhs.flags();
+}
+
+/*!
+ \fn bool operator!=(const QShaderVersion &lhs, const QShaderVersion &rhs)
+
+ Returns \c false if the values in the two QShaderVersion objects \a a
+ and \a b are equal; otherwise returns \c true.
+
+ \relates QShaderVersion
+ */
+
+/*!
+ Returns \c true if the two QShaderKey objects \a lhs and \a rhs are equal.
+
+ \relates QShaderKey
+ */
+bool operator==(const QShaderKey &lhs, const QShaderKey &rhs) Q_DECL_NOTHROW
+{
+ return lhs.source() == rhs.source() && lhs.sourceVersion() == rhs.sourceVersion()
+ && lhs.sourceVariant() == rhs.sourceVariant();
+}
+
+/*!
+ \fn bool operator!=(const QShaderKey &lhs, const QShaderKey &rhs)
+
+ Returns \c false if the values in the two QShaderKey objects \a a
+ and \a b are equal; otherwise returns \c true.
+
+ \relates QShaderKey
+ */
+
+/*!
+ Returns the hash value for \a k, using \a seed to seed the calculation.
+
+ \relates QShaderKey
+ */
+uint qHash(const QShaderKey &k, uint seed) Q_DECL_NOTHROW
+{
+ return seed + 10 * k.source() + k.sourceVersion().version() + k.sourceVersion().flags() + k.sourceVariant();
+}
+
+/*!
+ Returns \c true if the two QShaderCode objects \a lhs and \a rhs are equal.
+
+ \relates QShaderCode
+ */
+bool operator==(const QShaderCode &lhs, const QShaderCode &rhs) Q_DECL_NOTHROW
+{
+ return lhs.shader() == rhs.shader() && lhs.entryPoint() == rhs.entryPoint();
+}
+
+/*!
+ \fn bool operator!=(const QShaderCode &lhs, const QShaderCode &rhs)
+
+ Returns \c false if the values in the two QShaderCode objects \a a
+ and \a b are equal; otherwise returns \c true.
+
+ \relates QShaderCode
+ */
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QShader &bs)
+{
+ const QShaderPrivate *d = bs.d;
+ QDebugStateSaver saver(dbg);
+
+ dbg.nospace() << "QShader("
+ << "stage=" << d->stage
+ << " shaders=" << d->shaders.keys()
+ << " desc.isValid=" << d->desc.isValid()
+ << ')';
+
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderKey &k)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "ShaderKey(" << k.source()
+ << " " << k.sourceVersion()
+ << " " << k.sourceVariant() << ")";
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderVersion &v)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "Version(" << v.version() << " " << v.flags() << ")";
+ return dbg;
+}
+#endif // QT_NO_DEBUG_STREAM
+
+/*!
+ \typedef QShader::NativeResourceBindingMap
+
+ Synonym for QHash<int, QPair<int, int>>.
+
+ The resource binding model QRhi assumes is based on SPIR-V. This means that
+ uniform buffers, storage buffers, combined image samplers, and storage
+ images share a common binding point space. The binding numbers in
+ QShaderDescription and QRhiShaderResourceBinding are expected to match the
+ \c binding layout qualifier in the Vulkan-compatible GLSL shader.
+
+ Graphics APIs other than Vulkan may use a resource binding model that is
+ not fully compatible with this. In addition, the generator of the shader
+ code translated from SPIR-V may choose not to take the SPIR-V binding
+ qualifiers into account, for various reasons. (this is the case with the
+ Metal backend of SPIRV-Cross, for example).
+
+ Therefore, a QShader may expose an additional map that describes what the
+ native binding point for a given SPIR-V binding is. The QRhi backends are
+ expected to use this map automatically, as appropriate. The value is a
+ pair, because combined image samplers may map to two native resources (a
+ texture and a sampler) in some shading languages. In that case the second
+ value refers to the sampler.
+*/
+
+/*!
+ \return the native binding map for \a key or null if no extra mapping is
+ available, or is not applicable.
+ */
+const QShader::NativeResourceBindingMap *QShader::nativeResourceBindingMap(const QShaderKey &key) const
+{
+ auto it = d->bindings.constFind(key);
+ if (it == d->bindings.cend())
+ return nullptr;
+
+ return &it.value();
+}
+
+/*!
+ Stores the given native resource binding \a map associated with \a key.
+
+ \sa nativeResourceBindingMap()
+ */
+void QShader::setResourceBindingMap(const QShaderKey &key, const NativeResourceBindingMap &map)
+{
+ detach();
+ d->bindings[key] = map;
+}
+
+/*!
+ Removes the native resource binding map for \a key.
+ */
+void QShader::removeResourceBindingMap(const QShaderKey &key)
+{
+ auto it = d->bindings.find(key);
+ if (it == d->bindings.end())
+ return;
+
+ detach();
+ d->bindings.erase(it);
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qshader_p.h b/src/gui/rhi/qshader_p.h
new file mode 100644
index 0000000000..4b561b6fa9
--- /dev/null
+++ b/src/gui/rhi/qshader_p.h
@@ -0,0 +1,229 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSHADER_P_H
+#define QSHADER_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of a number of Qt sources files. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qtguiglobal.h>
+#include <private/qshaderdescription_p.h>
+
+QT_BEGIN_NAMESPACE
+
+struct QShaderPrivate;
+class QShaderKey;
+
+class Q_GUI_EXPORT QShaderVersion
+{
+public:
+ enum Flag {
+ GlslEs = 0x01
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ QShaderVersion() = default;
+ QShaderVersion(int v, Flags f = Flags());
+
+ int version() const { return m_version; }
+ void setVersion(int v) { m_version = v; }
+
+ Flags flags() const { return m_flags; }
+ void setFlags(Flags f) { m_flags = f; }
+
+private:
+ int m_version = 100;
+ Flags m_flags;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderVersion::Flags)
+Q_DECLARE_TYPEINFO(QShaderVersion, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QShaderCode
+{
+public:
+ QShaderCode() = default;
+ QShaderCode(const QByteArray &code, const QByteArray &entry = QByteArray());
+
+ QByteArray shader() const { return m_shader; }
+ void setShader(const QByteArray &code) { m_shader = code; }
+
+ QByteArray entryPoint() const { return m_entryPoint; }
+ void setEntryPoint(const QByteArray &entry) { m_entryPoint = entry; }
+
+private:
+ QByteArray m_shader;
+ QByteArray m_entryPoint;
+};
+
+Q_DECLARE_TYPEINFO(QShaderCode, Q_MOVABLE_TYPE);
+
+class Q_GUI_EXPORT QShader
+{
+public:
+ enum Stage {
+ VertexStage = 0,
+ TessellationControlStage,
+ TessellationEvaluationStage,
+ GeometryStage,
+ FragmentStage,
+ ComputeStage
+ };
+
+ enum Source {
+ SpirvShader = 0,
+ GlslShader,
+ HlslShader,
+ DxbcShader, // fxc
+ MslShader,
+ DxilShader, // dxc
+ MetalLibShader // xcrun metal + xcrun metallib
+ };
+
+ enum Variant {
+ StandardShader = 0,
+ BatchableVertexShader
+ };
+
+ QShader();
+ QShader(const QShader &other);
+ QShader &operator=(const QShader &other);
+ ~QShader();
+ void detach();
+
+ bool isValid() const;
+
+ Stage stage() const;
+ void setStage(Stage stage);
+
+ QShaderDescription description() const;
+ void setDescription(const QShaderDescription &desc);
+
+ QVector<QShaderKey> availableShaders() const;
+ QShaderCode shader(const QShaderKey &key) const;
+ void setShader(const QShaderKey &key, const QShaderCode &shader);
+ void removeShader(const QShaderKey &key);
+
+ QByteArray serialized() const;
+ static QShader fromSerialized(const QByteArray &data);
+
+ using NativeResourceBindingMap = QHash<int, QPair<int, int> >; // binding -> native_binding[, native_binding]
+ const NativeResourceBindingMap *nativeResourceBindingMap(const QShaderKey &key) const;
+ void setResourceBindingMap(const QShaderKey &key, const NativeResourceBindingMap &map);
+ void removeResourceBindingMap(const QShaderKey &key);
+
+private:
+ QShaderPrivate *d;
+ friend struct QShaderPrivate;
+ friend Q_GUI_EXPORT bool operator==(const QShader &, const QShader &) Q_DECL_NOTHROW;
+ friend Q_GUI_EXPORT uint qHash(const QShader &, uint) Q_DECL_NOTHROW;
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QShader &);
+#endif
+};
+
+class Q_GUI_EXPORT QShaderKey
+{
+public:
+ QShaderKey() = default;
+ QShaderKey(QShader::Source s,
+ const QShaderVersion &sver,
+ QShader::Variant svar = QShader::StandardShader);
+
+ QShader::Source source() const { return m_source; }
+ void setSource(QShader::Source s) { m_source = s; }
+
+ QShaderVersion sourceVersion() const { return m_sourceVersion; }
+ void setSourceVersion(const QShaderVersion &sver) { m_sourceVersion = sver; }
+
+ QShader::Variant sourceVariant() const { return m_sourceVariant; }
+ void setSourceVariant(QShader::Variant svar) { m_sourceVariant = svar; }
+
+private:
+ QShader::Source m_source = QShader::SpirvShader;
+ QShaderVersion m_sourceVersion;
+ QShader::Variant m_sourceVariant = QShader::StandardShader;
+};
+
+Q_DECLARE_TYPEINFO(QShaderKey, Q_MOVABLE_TYPE);
+
+Q_GUI_EXPORT bool operator==(const QShader &lhs, const QShader &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QShader &s, uint seed = 0) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShader &lhs, const QShader &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_GUI_EXPORT bool operator==(const QShaderVersion &lhs, const QShaderVersion &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderKey &lhs, const QShaderKey &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderCode &lhs, const QShaderCode &rhs) Q_DECL_NOTHROW;
+
+inline bool operator!=(const QShaderVersion &lhs, const QShaderVersion &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+inline bool operator!=(const QShaderKey &lhs, const QShaderKey &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+inline bool operator!=(const QShaderCode &lhs, const QShaderCode &rhs) Q_DECL_NOTHROW
+{
+ return !(lhs == rhs);
+}
+
+Q_GUI_EXPORT uint qHash(const QShaderKey &k, uint seed = 0) Q_DECL_NOTHROW;
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShader &);
+Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QShaderKey &k);
+Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QShaderVersion &v);
+#endif
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qshader_p_p.h b/src/gui/rhi/qshader_p_p.h
new file mode 100644
index 0000000000..4535e01491
--- /dev/null
+++ b/src/gui/rhi/qshader_p_p.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSHADER_P_P_H
+#define QSHADER_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of a number of Qt sources files. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qshader_p.h"
+#include <QtCore/QAtomicInt>
+#include <QtCore/QHash>
+#include <QtCore/QDebug>
+
+QT_BEGIN_NAMESPACE
+
+struct Q_GUI_EXPORT QShaderPrivate
+{
+ QShaderPrivate()
+ : ref(1)
+ {
+ }
+
+ QShaderPrivate(const QShaderPrivate *other)
+ : ref(1),
+ stage(other->stage),
+ desc(other->desc),
+ shaders(other->shaders),
+ bindings(other->bindings)
+ {
+ }
+
+ static QShaderPrivate *get(QShader *s) { return s->d; }
+ static const QShaderPrivate *get(const QShader *s) { return s->d; }
+
+ QAtomicInt ref;
+ QShader::Stage stage = QShader::VertexStage;
+ QShaderDescription desc;
+ QHash<QShaderKey, QShaderCode> shaders;
+ QHash<QShaderKey, QShader::NativeResourceBindingMap> bindings;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qshaderdescription.cpp b/src/gui/rhi/qshaderdescription.cpp
new file mode 100644
index 0000000000..179d5f3a07
--- /dev/null
+++ b/src/gui/rhi/qshaderdescription.cpp
@@ -0,0 +1,1122 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qshaderdescription_p_p.h"
+#include <QDebug>
+#include <QJsonObject>
+#include <QJsonArray>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QShaderDescription
+ \internal
+ \inmodule QtGui
+
+ \brief Describes the interface of a shader.
+
+ A shader typically has a set of inputs and outputs. A vertex shader for
+ example has a number of input variables and may use one or more uniform
+ buffers to access data (e.g. a modelview matrix) provided by the
+ application. The shader for the fragment stage receives data from the
+ vertex stage (in a simple setup) and may also rely on data from uniform
+ buffers, images, and samplers.
+
+ When it comes to vertex inputs and the layout of the uniform buffers (what
+ are the names of the members? what is there size, offset, and so on),
+ applications and frameworks may need to discover this dynamically at run
+ time. This is typical when the shader is not built-in but provided by an
+ external entity, like the user.
+
+ Modern and lean graphics APIs may no longer provide a way to query shader
+ reflection information at run time. Therefore, such data is now
+ automatically generated by QShaderBaker and is provided as a
+ QShaderDescription object for each and every QShader.
+
+ \section2 Example
+
+ Take the following vertex shader:
+
+ \badcode
+ #version 440
+
+ layout(location = 0) in vec4 position;
+ layout(location = 1) in vec3 color;
+ layout(location = 0) out vec3 v_color;
+
+ layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ float opacity;
+ } ubuf;
+
+ out gl_PerVertex { vec4 gl_Position; };
+
+ void main()
+ {
+ v_color = color;
+ gl_Position = ubuf.mvp * position;
+ }
+ \endcode
+
+ This shader has two inputs: \c position at location 0 with a type of \c
+ vec4, and \c color at location 1 with a type of \c vec3. It has one output:
+ \c v_color, although this is typically not interesting for applications.
+ What is more important, there is a uniform block at binding 0 with a size
+ of 68 bytes and two members, a 4x4 matrix named \c mvp at offset 0, and a
+ float \c opacity at offset 64.
+
+ All this is described by a QShaderDescription object. QShaderDescription
+ can also be serialized to JSON and binary JSON, and can be deserialized
+ from binary JSON. In practice this is rarely needed since QShader
+ takes care of the associated QShaderDescription automatically, but if the
+ QShaderDescription of the above shader would be written out as JSON, it
+ would look like the following:
+
+ \badcode
+ {
+ "inputs": [
+ {
+ "location": 1,
+ "name": "color",
+ "type": "vec3"
+ },
+ {
+ "location": 0,
+ "name": "position",
+ "type": "vec4"
+ }
+ ],
+ "outputs": [
+ {
+ "location": 0,
+ "name": "v_color",
+ "type": "vec3"
+ }
+ ],
+ "uniformBlocks": [
+ {
+ "binding": 0,
+ "blockName": "buf",
+ "members": [
+ {
+ "matrixStride": 16,
+ "name": "mvp",
+ "offset": 0,
+ "size": 64,
+ "type": "mat4"
+ },
+ {
+ "name": "opacity",
+ "offset": 64,
+ "size": 4,
+ "type": "float"
+ }
+ ],
+ "set": 0,
+ "size": 68,
+ "structName": "ubuf"
+ }
+ ]
+ }
+ \endcode
+
+ The C++ API allows accessing a data structure like the above. For
+ simplicity the inner structs only contain public data members, also
+ considering that their layout is unlikely to change in the future.
+
+ \sa QShaderBaker, QShader
+ */
+
+/*!
+ \enum QShaderDescription::VariableType
+ Represents the type of a variable or block member.
+
+ \value Unknown
+ \value Float
+ \value Vec2
+ \value Vec3
+ \value Vec4
+ \value Mat2
+ \value Mat2x3
+ \value Mat2x4
+ \value Mat3
+ \value Mat3x2
+ \value Mat3x4
+ \value Mat4
+ \value Mat4x2
+ \value Mat4x3
+ \value Int
+ \value Int2
+ \value Int3
+ \value Int4
+ \value Uint
+ \value Uint2
+ \value Uint3
+ \value Uint4
+ \value Bool
+ \value Bool2
+ \value Bool3
+ \value Bool4
+ \value Double
+ \value Double2
+ \value Double3
+ \value Double4
+ \value DMat2
+ \value DMat2x3
+ \value DMat2x4
+ \value DMat3
+ \value DMat3x2
+ \value DMat3x4
+ \value DMat4
+ \value DMat4x2
+ \value DMat4x3
+ \value Sampler1D
+ \value Sampler2D
+ \value Sampler2DMS
+ \value Sampler3D
+ \value SamplerCube
+ \value Sampler1DArray
+ \value Sampler2DArray
+ \value Sampler2DMSArray
+ \value Sampler3DArray
+ \value SamplerCubeArray
+ \value SamplerRect
+ \value SamplerBuffer
+ \value Image1D
+ \value Image2D
+ \value Image2DMS
+ \value Image3D
+ \value ImageCube
+ \value Image1DArray
+ \value Image2DArray
+ \value Image2DMSArray
+ \value Image3DArray
+ \value ImageCubeArray
+ \value ImageRect
+ \value ImageBuffer
+ \value Struct
+ */
+
+/*!
+ \class QShaderDescription::InOutVariable
+ \internal
+ \inmodule QtGui
+
+ \brief Describes an input or output variable in the shader.
+ */
+
+/*!
+ \class QShaderDescription::BlockVariable
+ \internal
+ \inmodule QtGui
+
+ \brief Describes a member of a uniform or push constant block.
+ */
+
+/*!
+ \class QShaderDescription::UniformBlock
+ \internal
+ \inmodule QtGui
+
+ \brief Describes a uniform block.
+
+ \note When translating to shading languages without uniform block support
+ (like GLSL 120 or GLSL/ES 100), uniform blocks are replaced with ordinary
+ uniforms in a struct. The name of the struct, and so the prefix for the
+ uniforms generated from the block members, is given by structName.
+ */
+
+/*!
+ \class QShaderDescription::PushConstantBlock
+ \internal
+ \inmodule QtGui
+
+ \brief Describes a push constant block.
+ */
+
+/*!
+ \class QShaderDescription::StorageBlock
+ \internal
+ \inmodule QtGui
+
+ \brief Describes a shader storage block.
+ */
+
+/*!
+ Constructs a new, empty QShaderDescription.
+
+ \note Being empty implies that isValid() returns \c false for the
+ newly constructed instance.
+ */
+QShaderDescription::QShaderDescription()
+ : d(new QShaderDescriptionPrivate)
+{
+}
+
+/*!
+ \internal
+ */
+void QShaderDescription::detach()
+{
+ qAtomicDetach(d);
+}
+
+/*!
+ \internal
+ */
+QShaderDescription::QShaderDescription(const QShaderDescription &other)
+ : d(other.d)
+{
+ d->ref.ref();
+}
+
+/*!
+ \internal
+ */
+QShaderDescription &QShaderDescription::operator=(const QShaderDescription &other)
+{
+ qAtomicAssign(d, other.d);
+ return *this;
+}
+
+/*!
+ Destructor.
+ */
+QShaderDescription::~QShaderDescription()
+{
+ if (!d->ref.deref())
+ delete d;
+}
+
+/*!
+ \return true if the QShaderDescription contains at least one entry in one of
+ the variable and block lists.
+ */
+bool QShaderDescription::isValid() const
+{
+ return !d->inVars.isEmpty() || !d->outVars.isEmpty()
+ || !d->uniformBlocks.isEmpty() || !d->pushConstantBlocks.isEmpty() || !d->storageBlocks.isEmpty()
+ || !d->combinedImageSamplers.isEmpty() || !d->storageImages.isEmpty();
+}
+
+/*!
+ \return a serialized binary version of the data.
+
+ \sa toJson()
+ */
+QByteArray QShaderDescription::toBinaryJson() const
+{
+ return d->makeDoc().toBinaryData();
+}
+
+/*!
+ \return a serialized JSON text version of the data.
+
+ \note There is no deserialization method provided for JSON text.
+
+ \sa toBinaryJson()
+ */
+QByteArray QShaderDescription::toJson() const
+{
+ return d->makeDoc().toJson();
+}
+
+/*!
+ Deserializes the given binary JSON \a data and returns a new
+ QShaderDescription.
+ */
+QShaderDescription QShaderDescription::fromBinaryJson(const QByteArray &data)
+{
+ QShaderDescription desc;
+ QShaderDescriptionPrivate::get(&desc)->loadDoc(QJsonDocument::fromBinaryData(data));
+ return desc;
+}
+
+/*!
+ \return the list of input variables. This includes vertex inputs (sometimes
+ called attributes) for the vertex stage, and inputs for other stages
+ (sometimes called varyings).
+ */
+QVector<QShaderDescription::InOutVariable> QShaderDescription::inputVariables() const
+{
+ return d->inVars;
+}
+
+/*!
+ \return the list of output variables.
+ */
+QVector<QShaderDescription::InOutVariable> QShaderDescription::outputVariables() const
+{
+ return d->outVars;
+}
+
+/*!
+ \return the list of uniform blocks.
+ */
+QVector<QShaderDescription::UniformBlock> QShaderDescription::uniformBlocks() const
+{
+ return d->uniformBlocks;
+}
+
+/*!
+ \return the list of push constant blocks.
+
+ \note Avoid relying on push constant blocks for shaders that are to be used
+ in combination with the Qt Rendering Hardware Interface since that
+ currently has no support for them.
+ */
+QVector<QShaderDescription::PushConstantBlock> QShaderDescription::pushConstantBlocks() const
+{
+ return d->pushConstantBlocks;
+}
+
+/*!
+ \return the list of shader storage blocks.
+
+ For example, with GLSL/Vulkan shaders as source, the declaration
+
+ \badcode
+ struct Stuff {
+ vec2 a;
+ vec2 b;
+ };
+ layout(std140, binding = 0) buffer StuffSsbo {
+ vec4 whatever;
+ Stuff stuff[];
+ } buf;
+ \endcode
+
+ generates the following: (shown as textual JSON here)
+
+ \badcode
+ "storageBlocks": [ {
+ "binding": 0,
+ "blockName": "StuffSsbo",
+ "instanceName": "buf",
+ "knownSize": 16,
+ "members": [
+ {
+ "name": "whatever",
+ "offset": 0,
+ "size": 16,
+ "type": "vec4"
+ },
+ {
+ "arrayDims": [
+ 0
+ ],
+ "name": "stuff",
+ "offset": 16,
+ "size": 0,
+ "structMembers": [
+ {
+ "name": "a",
+ "offset": 0,
+ "size": 8,
+ "type": "vec2"
+ },
+ {
+ "name": "b",
+ "offset": 8,
+ "size": 8,
+ "type": "vec2"
+ }
+ ],
+ "type": "struct"
+ }
+ ],
+ "set": 0
+ } ]
+ \endcode
+
+ \note The size of the last member in the storage block is undefined. This shows
+ up as \c size 0 and an array dimension of \c{[0]}. The storage block's \c knownSize
+ excludes the size of the last member since that will only be known at run time.
+
+ \note SSBOs are not available with some graphics APIs, such as, OpenGL 2.x or
+ OpenGL ES older than 3.1.
+ */
+QVector<QShaderDescription::StorageBlock> QShaderDescription::storageBlocks() const
+{
+ return d->storageBlocks;
+}
+
+/*!
+ \return the list of combined image samplers
+
+ With GLSL/Vulkan shaders as source a \c{layout(binding = 1) uniform sampler2D tex;}
+ uniform generates the following: (shown as textual JSON here)
+
+ \badcode
+ "combinedImageSamplers": [
+ {
+ "binding": 1,
+ "name": "tex",
+ "set": 0,
+ "type": "sampler2D"
+ }
+ ]
+ \endcode
+
+ This does not mean that other language versions of the shader must also use
+ a combined image sampler, especially considering that the concept may not
+ exist everywhere. For instance, a HLSL version will likely just use a
+ Texture2D and SamplerState object with registers t1 and s1, respectively.
+ */
+QVector<QShaderDescription::InOutVariable> QShaderDescription::combinedImageSamplers() const
+{
+ return d->combinedImageSamplers;
+}
+
+/*!
+ \return the list of image variables.
+
+ These will likely occur in compute shaders. For example,
+ \c{layout (binding = 0, rgba8) uniform readonly image2D inputImage;}
+ generates the following: (shown as textual JSON here)
+
+ \badcode
+ "storageImages": [
+ {
+ "binding": 0,
+ "imageFormat": "rgba8",
+ "name": "inputImage",
+ "set": 0,
+ "type": "image2D"
+ }
+ ]
+ \endcode
+
+ \note Separate image objects are not compatible with some graphics APIs,
+ such as, OpenGL 2.x or OpenGL ES older than 3.1.
+ */
+QVector<QShaderDescription::InOutVariable> QShaderDescription::storageImages() const
+{
+ return d->storageImages;
+}
+
+/*!
+ Returns the local size of a compute shader.
+
+ For example, for a compute shader with the following declaration the
+ function returns { 256, 16, 1}.
+
+ \badcode
+ layout(local_size_x = 256, local_size_y = 16, local_size_z = 1) in;
+ \endcode
+ */
+std::array<uint, 3> QShaderDescription::computeShaderLocalSize() const
+{
+ return d->localSize;
+}
+
+static struct TypeTab {
+ QString k;
+ QShaderDescription::VariableType v;
+} typeTab[] = {
+ { QLatin1String("float"), QShaderDescription::Float },
+ { QLatin1String("vec2"), QShaderDescription::Vec2 },
+ { QLatin1String("vec3"), QShaderDescription::Vec3 },
+ { QLatin1String("vec4"), QShaderDescription::Vec4 },
+ { QLatin1String("mat2"), QShaderDescription::Mat2 },
+ { QLatin1String("mat3"), QShaderDescription::Mat3 },
+ { QLatin1String("mat4"), QShaderDescription::Mat4 },
+
+ { QLatin1String("struct"), QShaderDescription::Struct },
+
+ { QLatin1String("sampler1D"), QShaderDescription::Sampler1D },
+ { QLatin1String("sampler2D"), QShaderDescription::Sampler2D },
+ { QLatin1String("sampler2DMS"), QShaderDescription::Sampler2DMS },
+ { QLatin1String("sampler3D"), QShaderDescription::Sampler3D },
+ { QLatin1String("samplerCube"), QShaderDescription::SamplerCube },
+ { QLatin1String("sampler1DArray"), QShaderDescription::Sampler1DArray },
+ { QLatin1String("sampler2DArray"), QShaderDescription::Sampler2DArray },
+ { QLatin1String("sampler2DMSArray"), QShaderDescription::Sampler2DMSArray },
+ { QLatin1String("sampler3DArray"), QShaderDescription::Sampler3DArray },
+ { QLatin1String("samplerCubeArray"), QShaderDescription::SamplerCubeArray },
+ { QLatin1String("samplerRect"), QShaderDescription::SamplerRect },
+ { QLatin1String("samplerBuffer"), QShaderDescription::SamplerBuffer },
+
+ { QLatin1String("mat2x3"), QShaderDescription::Mat2x3 },
+ { QLatin1String("mat2x4"), QShaderDescription::Mat2x4 },
+ { QLatin1String("mat3x2"), QShaderDescription::Mat3x2 },
+ { QLatin1String("mat3x4"), QShaderDescription::Mat3x4 },
+ { QLatin1String("mat4x2"), QShaderDescription::Mat4x2 },
+ { QLatin1String("mat4x3"), QShaderDescription::Mat4x3 },
+
+ { QLatin1String("int"), QShaderDescription::Int },
+ { QLatin1String("ivec2"), QShaderDescription::Int2 },
+ { QLatin1String("ivec3"), QShaderDescription::Int3 },
+ { QLatin1String("ivec4"), QShaderDescription::Int4 },
+
+ { QLatin1String("uint"), QShaderDescription::Uint },
+ { QLatin1String("uvec2"), QShaderDescription::Uint2 },
+ { QLatin1String("uvec3"), QShaderDescription::Uint3 },
+ { QLatin1String("uvec4"), QShaderDescription::Uint4 },
+
+ { QLatin1String("bool"), QShaderDescription::Bool },
+ { QLatin1String("bvec2"), QShaderDescription::Bool2 },
+ { QLatin1String("bvec3"), QShaderDescription::Bool3 },
+ { QLatin1String("bvec4"), QShaderDescription::Bool4 },
+
+ { QLatin1String("double"), QShaderDescription::Double },
+ { QLatin1String("dvec2"), QShaderDescription::Double2 },
+ { QLatin1String("dvec3"), QShaderDescription::Double3 },
+ { QLatin1String("dvec4"), QShaderDescription::Double4 },
+ { QLatin1String("dmat2"), QShaderDescription::DMat2 },
+ { QLatin1String("dmat3"), QShaderDescription::DMat3 },
+ { QLatin1String("dmat4"), QShaderDescription::DMat4 },
+ { QLatin1String("dmat2x3"), QShaderDescription::DMat2x3 },
+ { QLatin1String("dmat2x4"), QShaderDescription::DMat2x4 },
+ { QLatin1String("dmat3x2"), QShaderDescription::DMat3x2 },
+ { QLatin1String("dmat3x4"), QShaderDescription::DMat3x4 },
+ { QLatin1String("dmat4x2"), QShaderDescription::DMat4x2 },
+ { QLatin1String("dmat4x3"), QShaderDescription::DMat4x3 },
+
+ { QLatin1String("image1D"), QShaderDescription::Image1D },
+ { QLatin1String("image2D"), QShaderDescription::Image2D },
+ { QLatin1String("image2DMS"), QShaderDescription::Image2DMS },
+ { QLatin1String("image3D"), QShaderDescription::Image3D },
+ { QLatin1String("imageCube"), QShaderDescription::ImageCube },
+ { QLatin1String("image1DArray"), QShaderDescription::Image1DArray },
+ { QLatin1String("image2DArray"), QShaderDescription::Image2DArray },
+ { QLatin1String("image2DMSArray"), QShaderDescription::Image2DMSArray },
+ { QLatin1String("image3DArray"), QShaderDescription::Image3DArray },
+ { QLatin1String("imageCubeArray"), QShaderDescription::ImageCubeArray },
+ { QLatin1String("imageRect"), QShaderDescription::ImageRect },
+ { QLatin1String("imageBuffer"), QShaderDescription::ImageBuffer }
+};
+
+static QString typeStr(const QShaderDescription::VariableType &t)
+{
+ for (size_t i = 0; i < sizeof(typeTab) / sizeof(TypeTab); ++i) {
+ if (typeTab[i].v == t)
+ return typeTab[i].k;
+ }
+ return QString();
+}
+
+static QShaderDescription::VariableType mapType(const QString &t)
+{
+ for (size_t i = 0; i < sizeof(typeTab) / sizeof(TypeTab); ++i) {
+ if (typeTab[i].k == t)
+ return typeTab[i].v;
+ }
+ return QShaderDescription::Unknown;
+}
+
+static struct ImageFormatTab {
+ QString k;
+ QShaderDescription::ImageFormat v;
+} imageFormatTab[] {
+ { QLatin1String("unknown"), QShaderDescription::ImageFormatUnknown },
+ { QLatin1String("rgba32f"), QShaderDescription::ImageFormatRgba32f },
+ { QLatin1String("rgba16"), QShaderDescription::ImageFormatRgba16f },
+ { QLatin1String("r32f"), QShaderDescription::ImageFormatR32f },
+ { QLatin1String("rgba8"), QShaderDescription::ImageFormatRgba8 },
+ { QLatin1String("rgba8_snorm"), QShaderDescription::ImageFormatRgba8Snorm },
+ { QLatin1String("rg32f"), QShaderDescription::ImageFormatRg32f },
+ { QLatin1String("rg16f"), QShaderDescription::ImageFormatRg16f },
+ { QLatin1String("r11f_g11f_b10f"), QShaderDescription::ImageFormatR11fG11fB10f },
+ { QLatin1String("r16f"), QShaderDescription::ImageFormatR16f },
+ { QLatin1String("rgba16"), QShaderDescription::ImageFormatRgba16 },
+ { QLatin1String("rgb10_a2"), QShaderDescription::ImageFormatRgb10A2 },
+ { QLatin1String("rg16"), QShaderDescription::ImageFormatRg16 },
+ { QLatin1String("rg8"), QShaderDescription::ImageFormatRg8 },
+ { QLatin1String("r16"), QShaderDescription::ImageFormatR16 },
+ { QLatin1String("r8"), QShaderDescription::ImageFormatR8 },
+ { QLatin1String("rgba16_snorm"), QShaderDescription::ImageFormatRgba16Snorm },
+ { QLatin1String("rg16_snorm"), QShaderDescription::ImageFormatRg16Snorm },
+ { QLatin1String("rg8_snorm"), QShaderDescription::ImageFormatRg8Snorm },
+ { QLatin1String("r16_snorm"), QShaderDescription::ImageFormatR16Snorm },
+ { QLatin1String("r8_snorm"), QShaderDescription::ImageFormatR8Snorm },
+ { QLatin1String("rgba32i"), QShaderDescription::ImageFormatRgba32i },
+ { QLatin1String("rgba16i"), QShaderDescription::ImageFormatRgba16i },
+ { QLatin1String("rgba8i"), QShaderDescription::ImageFormatRgba8i },
+ { QLatin1String("r32i"), QShaderDescription::ImageFormatR32i },
+ { QLatin1String("rg32i"), QShaderDescription::ImageFormatRg32i },
+ { QLatin1String("rg16i"), QShaderDescription::ImageFormatRg16i },
+ { QLatin1String("rg8i"), QShaderDescription::ImageFormatRg8i },
+ { QLatin1String("r16i"), QShaderDescription::ImageFormatR16i },
+ { QLatin1String("r8i"), QShaderDescription::ImageFormatR8i },
+ { QLatin1String("rgba32ui"), QShaderDescription::ImageFormatRgba32ui },
+ { QLatin1String("rgba16ui"), QShaderDescription::ImageFormatRgba16ui },
+ { QLatin1String("rgba8ui"), QShaderDescription::ImageFormatRgba8ui },
+ { QLatin1String("r32ui"), QShaderDescription::ImageFormatR32ui },
+ { QLatin1String("rgb10_a2ui"), QShaderDescription::ImageFormatRgb10a2ui },
+ { QLatin1String("rg32ui"), QShaderDescription::ImageFormatRg32ui },
+ { QLatin1String("rg16ui"), QShaderDescription::ImageFormatRg16ui },
+ { QLatin1String("rg8ui"), QShaderDescription::ImageFormatRg8ui },
+ { QLatin1String("r16ui"), QShaderDescription::ImageFormatR16ui },
+ { QLatin1String("r8ui"), QShaderDescription::ImageFormatR8ui }
+};
+
+static QString imageFormatStr(const QShaderDescription::ImageFormat &f)
+{
+ for (size_t i = 0; i < sizeof(imageFormatTab) / sizeof(ImageFormatTab); ++i) {
+ if (imageFormatTab[i].v == f)
+ return imageFormatTab[i].k;
+ }
+ return QString();
+}
+
+static QShaderDescription::ImageFormat mapImageFormat(const QString &f)
+{
+ for (size_t i = 0; i < sizeof(imageFormatTab) / sizeof(ImageFormatTab); ++i) {
+ if (imageFormatTab[i].k == f)
+ return imageFormatTab[i].v;
+ }
+ return QShaderDescription::ImageFormatUnknown;
+}
+
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug dbg, const QShaderDescription &sd)
+{
+ const QShaderDescriptionPrivate *d = sd.d;
+ QDebugStateSaver saver(dbg);
+
+ if (sd.isValid()) {
+ dbg.nospace() << "QShaderDescription("
+ << "inVars " << d->inVars
+ << " outVars " << d->outVars
+ << " uniformBlocks " << d->uniformBlocks
+ << " pcBlocks " << d->pushConstantBlocks
+ << " storageBlocks " << d->storageBlocks
+ << " combinedSamplers " << d->combinedImageSamplers
+ << " images " << d->storageImages
+ << ')';
+ } else {
+ dbg.nospace() << "QShaderDescription(null)";
+ }
+
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderDescription::InOutVariable &var)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "InOutVariable(" << typeStr(var.type) << ' ' << var.name;
+ if (var.location >= 0)
+ dbg.nospace() << " location=" << var.location;
+ if (var.binding >= 0)
+ dbg.nospace() << " binding=" << var.binding;
+ if (var.descriptorSet >= 0)
+ dbg.nospace() << " set=" << var.descriptorSet;
+ if (var.imageFormat != QShaderDescription::ImageFormatUnknown)
+ dbg.nospace() << " imageFormat=" << imageFormatStr(var.imageFormat);
+ if (var.imageFlags)
+ dbg.nospace() << " imageFlags=" << var.imageFlags;
+ dbg.nospace() << ')';
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderDescription::BlockVariable &var)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "BlockVariable(" << typeStr(var.type) << ' ' << var.name
+ << " offset=" << var.offset << " size=" << var.size;
+ if (!var.arrayDims.isEmpty())
+ dbg.nospace() << " array=" << var.arrayDims;
+ if (var.arrayStride)
+ dbg.nospace() << " arrayStride=" << var.arrayStride;
+ if (var.matrixStride)
+ dbg.nospace() << " matrixStride=" << var.matrixStride;
+ if (var.matrixIsRowMajor)
+ dbg.nospace() << " [rowmaj]";
+ if (!var.structMembers.isEmpty())
+ dbg.nospace() << " structMembers=" << var.structMembers;
+ dbg.nospace() << ')';
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderDescription::UniformBlock &blk)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "UniformBlock(" << blk.blockName << ' ' << blk.structName << " size=" << blk.size;
+ if (blk.binding >= 0)
+ dbg.nospace() << " binding=" << blk.binding;
+ if (blk.descriptorSet >= 0)
+ dbg.nospace() << " set=" << blk.descriptorSet;
+ dbg.nospace() << ' ' << blk.members << ')';
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderDescription::PushConstantBlock &blk)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "PushConstantBlock(" << blk.name << " size=" << blk.size << ' ' << blk.members << ')';
+ return dbg;
+}
+
+QDebug operator<<(QDebug dbg, const QShaderDescription::StorageBlock &blk)
+{
+ QDebugStateSaver saver(dbg);
+ dbg.nospace() << "StorageBlock(" << blk.blockName << ' ' << blk.instanceName << " knownSize=" << blk.knownSize;
+ if (blk.binding >= 0)
+ dbg.nospace() << " binding=" << blk.binding;
+ if (blk.descriptorSet >= 0)
+ dbg.nospace() << " set=" << blk.descriptorSet;
+ dbg.nospace() << ' ' << blk.members << ')';
+ return dbg;
+}
+#endif
+
+static const QString nameKey = QLatin1String("name");
+static const QString typeKey = QLatin1String("type");
+static const QString locationKey = QLatin1String("location");
+static const QString bindingKey = QLatin1String("binding");
+static const QString setKey = QLatin1String("set");
+static const QString imageFormatKey = QLatin1String("imageFormat");
+static const QString imageFlagsKey = QLatin1String("imageFlags");
+static const QString offsetKey = QLatin1String("offset");
+static const QString arrayDimsKey = QLatin1String("arrayDims");
+static const QString arrayStrideKey = QLatin1String("arrayStride");
+static const QString matrixStrideKey = QLatin1String("matrixStride");
+static const QString matrixRowMajorKey = QLatin1String("matrixRowMajor");
+static const QString structMembersKey = QLatin1String("structMembers");
+static const QString membersKey = QLatin1String("members");
+static const QString inputsKey = QLatin1String("inputs");
+static const QString outputsKey = QLatin1String("outputs");
+static const QString uniformBlocksKey = QLatin1String("uniformBlocks");
+static const QString blockNameKey = QLatin1String("blockName");
+static const QString structNameKey = QLatin1String("structName");
+static const QString instanceNameKey = QLatin1String("instanceName");
+static const QString sizeKey = QLatin1String("size");
+static const QString knownSizeKey = QLatin1String("knownSize");
+static const QString pushConstantBlocksKey = QLatin1String("pushConstantBlocks");
+static const QString storageBlocksKey = QLatin1String("storageBlocks");
+static const QString combinedImageSamplersKey = QLatin1String("combinedImageSamplers");
+static const QString storageImagesKey = QLatin1String("storageImages");
+static const QString localSizeKey = QLatin1String("localSize");
+
+static void addDeco(QJsonObject *obj, const QShaderDescription::InOutVariable &v)
+{
+ if (v.location >= 0)
+ (*obj)[locationKey] = v.location;
+ if (v.binding >= 0)
+ (*obj)[bindingKey] = v.binding;
+ if (v.descriptorSet >= 0)
+ (*obj)[setKey] = v.descriptorSet;
+ if (v.imageFormat != QShaderDescription::ImageFormatUnknown)
+ (*obj)[imageFormatKey] = imageFormatStr(v.imageFormat);
+ if (v.imageFlags)
+ (*obj)[imageFlagsKey] = int(v.imageFlags);
+}
+
+static QJsonObject inOutObject(const QShaderDescription::InOutVariable &v)
+{
+ QJsonObject obj;
+ obj[nameKey] = v.name;
+ obj[typeKey] = typeStr(v.type);
+ addDeco(&obj, v);
+ return obj;
+}
+
+static QJsonObject blockMemberObject(const QShaderDescription::BlockVariable &v)
+{
+ QJsonObject obj;
+ obj[nameKey] = v.name;
+ obj[typeKey] = typeStr(v.type);
+ obj[offsetKey] = v.offset;
+ obj[sizeKey] = v.size;
+ if (!v.arrayDims.isEmpty()) {
+ QJsonArray dimArr;
+ for (int dim : v.arrayDims)
+ dimArr.append(dim);
+ obj[arrayDimsKey] = dimArr;
+ }
+ if (v.arrayStride)
+ obj[arrayStrideKey] = v.arrayStride;
+ if (v.matrixStride)
+ obj[matrixStrideKey] = v.matrixStride;
+ if (v.matrixIsRowMajor)
+ obj[matrixRowMajorKey] = true;
+ if (!v.structMembers.isEmpty()) {
+ QJsonArray arr;
+ for (const QShaderDescription::BlockVariable &sv : v.structMembers)
+ arr.append(blockMemberObject(sv));
+ obj[structMembersKey] = arr;
+ }
+ return obj;
+}
+
+QJsonDocument QShaderDescriptionPrivate::makeDoc()
+{
+ QJsonObject root;
+
+ QJsonArray jinputs;
+ for (const QShaderDescription::InOutVariable &v : qAsConst(inVars))
+ jinputs.append(inOutObject(v));
+ if (!jinputs.isEmpty())
+ root[inputsKey] = jinputs;
+
+ QJsonArray joutputs;
+ for (const QShaderDescription::InOutVariable &v : qAsConst(outVars))
+ joutputs.append(inOutObject(v));
+ if (!joutputs.isEmpty())
+ root[outputsKey] = joutputs;
+
+ QJsonArray juniformBlocks;
+ for (const QShaderDescription::UniformBlock &b : uniformBlocks) {
+ QJsonObject juniformBlock;
+ juniformBlock[blockNameKey] = b.blockName;
+ juniformBlock[structNameKey] = b.structName;
+ juniformBlock[sizeKey] = b.size;
+ if (b.binding >= 0)
+ juniformBlock[bindingKey] = b.binding;
+ if (b.descriptorSet >= 0)
+ juniformBlock[setKey] = b.descriptorSet;
+ QJsonArray members;
+ for (const QShaderDescription::BlockVariable &v : b.members)
+ members.append(blockMemberObject(v));
+ juniformBlock[membersKey] = members;
+ juniformBlocks.append(juniformBlock);
+ }
+ if (!juniformBlocks.isEmpty())
+ root[uniformBlocksKey] = juniformBlocks;
+
+ QJsonArray jpushConstantBlocks;
+ for (const QShaderDescription::PushConstantBlock &b : pushConstantBlocks) {
+ QJsonObject jpushConstantBlock;
+ jpushConstantBlock[nameKey] = b.name;
+ jpushConstantBlock[sizeKey] = b.size;
+ QJsonArray members;
+ for (const QShaderDescription::BlockVariable &v : b.members)
+ members.append(blockMemberObject(v));
+ jpushConstantBlock[membersKey] = members;
+ jpushConstantBlocks.append(jpushConstantBlock);
+ }
+ if (!jpushConstantBlocks.isEmpty())
+ root[pushConstantBlocksKey] = jpushConstantBlocks;
+
+ QJsonArray jstorageBlocks;
+ for (const QShaderDescription::StorageBlock &b : storageBlocks) {
+ QJsonObject jstorageBlock;
+ jstorageBlock[blockNameKey] = b.blockName;
+ jstorageBlock[instanceNameKey] = b.instanceName;
+ jstorageBlock[knownSizeKey] = b.knownSize;
+ if (b.binding >= 0)
+ jstorageBlock[bindingKey] = b.binding;
+ if (b.descriptorSet >= 0)
+ jstorageBlock[setKey] = b.descriptorSet;
+ QJsonArray members;
+ for (const QShaderDescription::BlockVariable &v : b.members)
+ members.append(blockMemberObject(v));
+ jstorageBlock[membersKey] = members;
+ jstorageBlocks.append(jstorageBlock);
+ }
+ if (!jstorageBlocks.isEmpty())
+ root[storageBlocksKey] = jstorageBlocks;
+
+ QJsonArray jcombinedSamplers;
+ for (const QShaderDescription::InOutVariable &v : qAsConst(combinedImageSamplers)) {
+ QJsonObject sampler;
+ sampler[nameKey] = v.name;
+ sampler[typeKey] = typeStr(v.type);
+ addDeco(&sampler, v);
+ jcombinedSamplers.append(sampler);
+ }
+ if (!jcombinedSamplers.isEmpty())
+ root[combinedImageSamplersKey] = jcombinedSamplers;
+
+ QJsonArray jstorageImages;
+ for (const QShaderDescription::InOutVariable &v : qAsConst(storageImages)) {
+ QJsonObject image;
+ image[nameKey] = v.name;
+ image[typeKey] = typeStr(v.type);
+ addDeco(&image, v);
+ jstorageImages.append(image);
+ }
+ if (!jstorageImages.isEmpty())
+ root[storageImagesKey] = jstorageImages;
+
+ QJsonArray jlocalSize;
+ for (int i = 0; i < 3; ++i)
+ jlocalSize.append(QJsonValue(int(localSize[i])));
+ root[localSizeKey] = jlocalSize;
+
+ return QJsonDocument(root);
+}
+
+static QShaderDescription::InOutVariable inOutVar(const QJsonObject &obj)
+{
+ QShaderDescription::InOutVariable var;
+ var.name = obj[nameKey].toString();
+ var.type = mapType(obj[typeKey].toString());
+ if (obj.contains(locationKey))
+ var.location = obj[locationKey].toInt();
+ if (obj.contains(bindingKey))
+ var.binding = obj[bindingKey].toInt();
+ if (obj.contains(setKey))
+ var.descriptorSet = obj[setKey].toInt();
+ if (obj.contains(imageFormatKey))
+ var.imageFormat = mapImageFormat(obj[imageFormatKey].toString());
+ if (obj.contains(imageFlagsKey))
+ var.imageFlags = QShaderDescription::ImageFlags(obj[imageFlagsKey].toInt());
+ return var;
+}
+
+static QShaderDescription::BlockVariable blockVar(const QJsonObject &obj)
+{
+ QShaderDescription::BlockVariable var;
+ var.name = obj[nameKey].toString();
+ var.type = mapType(obj[typeKey].toString());
+ var.offset = obj[offsetKey].toInt();
+ var.size = obj[sizeKey].toInt();
+ if (obj.contains(arrayDimsKey)) {
+ QJsonArray dimArr = obj[arrayDimsKey].toArray();
+ for (int i = 0; i < dimArr.count(); ++i)
+ var.arrayDims.append(dimArr.at(i).toInt());
+ }
+ if (obj.contains(arrayStrideKey))
+ var.arrayStride = obj[arrayStrideKey].toInt();
+ if (obj.contains(matrixStrideKey))
+ var.matrixStride = obj[matrixStrideKey].toInt();
+ if (obj.contains(matrixRowMajorKey))
+ var.matrixIsRowMajor = obj[matrixRowMajorKey].toBool();
+ if (obj.contains(structMembersKey)) {
+ QJsonArray arr = obj[structMembersKey].toArray();
+ for (int i = 0; i < arr.count(); ++i)
+ var.structMembers.append(blockVar(arr.at(i).toObject()));
+ }
+ return var;
+}
+
+void QShaderDescriptionPrivate::loadDoc(const QJsonDocument &doc)
+{
+ if (doc.isNull()) {
+ qWarning("QShaderDescription: JSON document is empty");
+ return;
+ }
+
+ Q_ASSERT(ref.loadRelaxed() == 1); // must be detached
+
+ inVars.clear();
+ outVars.clear();
+ uniformBlocks.clear();
+ pushConstantBlocks.clear();
+ storageBlocks.clear();
+ combinedImageSamplers.clear();
+ storageImages.clear();
+
+ QJsonObject root = doc.object();
+
+ if (root.contains(inputsKey)) {
+ QJsonArray inputs = root[inputsKey].toArray();
+ for (int i = 0; i < inputs.count(); ++i)
+ inVars.append(inOutVar(inputs[i].toObject()));
+ }
+
+ if (root.contains(outputsKey)) {
+ QJsonArray outputs = root[outputsKey].toArray();
+ for (int i = 0; i < outputs.count(); ++i)
+ outVars.append(inOutVar(outputs[i].toObject()));
+ }
+
+ if (root.contains(uniformBlocksKey)) {
+ QJsonArray ubs = root[uniformBlocksKey].toArray();
+ for (int i = 0; i < ubs.count(); ++i) {
+ QJsonObject ubObj = ubs[i].toObject();
+ QShaderDescription::UniformBlock ub;
+ ub.blockName = ubObj[blockNameKey].toString();
+ ub.structName = ubObj[structNameKey].toString();
+ ub.size = ubObj[sizeKey].toInt();
+ if (ubObj.contains(bindingKey))
+ ub.binding = ubObj[bindingKey].toInt();
+ if (ubObj.contains(setKey))
+ ub.descriptorSet = ubObj[setKey].toInt();
+ QJsonArray members = ubObj[membersKey].toArray();
+ for (const QJsonValue &member : members)
+ ub.members.append(blockVar(member.toObject()));
+ uniformBlocks.append(ub);
+ }
+ }
+
+ if (root.contains(pushConstantBlocksKey)) {
+ QJsonArray pcs = root[pushConstantBlocksKey].toArray();
+ for (int i = 0; i < pcs.count(); ++i) {
+ QJsonObject pcObj = pcs[i].toObject();
+ QShaderDescription::PushConstantBlock pc;
+ pc.name = pcObj[nameKey].toString();
+ pc.size = pcObj[sizeKey].toInt();
+ QJsonArray members = pcObj[membersKey].toArray();
+ for (const QJsonValue &member : members)
+ pc.members.append(blockVar(member.toObject()));
+ pushConstantBlocks.append(pc);
+ }
+ }
+
+ if (root.contains(storageBlocksKey)) {
+ QJsonArray ubs = root[storageBlocksKey].toArray();
+ for (int i = 0; i < ubs.count(); ++i) {
+ QJsonObject sbObj = ubs[i].toObject();
+ QShaderDescription::StorageBlock sb;
+ sb.blockName = sbObj[blockNameKey].toString();
+ sb.instanceName = sbObj[instanceNameKey].toString();
+ sb.knownSize = sbObj[knownSizeKey].toInt();
+ if (sbObj.contains(bindingKey))
+ sb.binding = sbObj[bindingKey].toInt();
+ if (sbObj.contains(setKey))
+ sb.descriptorSet = sbObj[setKey].toInt();
+ QJsonArray members = sbObj[membersKey].toArray();
+ for (const QJsonValue &member : members)
+ sb.members.append(blockVar(member.toObject()));
+ storageBlocks.append(sb);
+ }
+ }
+
+ if (root.contains(combinedImageSamplersKey)) {
+ QJsonArray samplers = root[combinedImageSamplersKey].toArray();
+ for (int i = 0; i < samplers.count(); ++i)
+ combinedImageSamplers.append(inOutVar(samplers[i].toObject()));
+ }
+
+ if (root.contains(storageImagesKey)) {
+ QJsonArray images = root[storageImagesKey].toArray();
+ for (int i = 0; i < images.count(); ++i)
+ storageImages.append(inOutVar(images[i].toObject()));
+ }
+
+ if (root.contains(localSizeKey)) {
+ QJsonArray localSizeArr = root[localSizeKey].toArray();
+ if (localSizeArr.count() == 3) {
+ for (int i = 0; i < 3; ++i)
+ localSize[i] = localSizeArr[i].toInt();
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/rhi/qshaderdescription_p.h b/src/gui/rhi/qshaderdescription_p.h
new file mode 100644
index 0000000000..5a63b998cd
--- /dev/null
+++ b/src/gui/rhi/qshaderdescription_p.h
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSHADERDESCRIPTION_H
+#define QSHADERDESCRIPTION_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of a number of Qt sources files. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtGui/qtguiglobal.h>
+#include <QtCore/QString>
+#include <QtCore/QVector>
+#include <array>
+
+QT_BEGIN_NAMESPACE
+
+struct QShaderDescriptionPrivate;
+
+class Q_GUI_EXPORT QShaderDescription
+{
+public:
+ QShaderDescription();
+ QShaderDescription(const QShaderDescription &other);
+ QShaderDescription &operator=(const QShaderDescription &other);
+ ~QShaderDescription();
+ void detach();
+
+ bool isValid() const;
+
+ QByteArray toBinaryJson() const;
+ QByteArray toJson() const;
+
+ static QShaderDescription fromBinaryJson(const QByteArray &data);
+
+ enum VariableType {
+ Unknown = 0,
+
+ // do not reorder
+ Float,
+ Vec2,
+ Vec3,
+ Vec4,
+ Mat2,
+ Mat2x3,
+ Mat2x4,
+ Mat3,
+ Mat3x2,
+ Mat3x4,
+ Mat4,
+ Mat4x2,
+ Mat4x3,
+
+ Int,
+ Int2,
+ Int3,
+ Int4,
+
+ Uint,
+ Uint2,
+ Uint3,
+ Uint4,
+
+ Bool,
+ Bool2,
+ Bool3,
+ Bool4,
+
+ Double,
+ Double2,
+ Double3,
+ Double4,
+ DMat2,
+ DMat2x3,
+ DMat2x4,
+ DMat3,
+ DMat3x2,
+ DMat3x4,
+ DMat4,
+ DMat4x2,
+ DMat4x3,
+
+ Sampler1D,
+ Sampler2D,
+ Sampler2DMS,
+ Sampler3D,
+ SamplerCube,
+ Sampler1DArray,
+ Sampler2DArray,
+ Sampler2DMSArray,
+ Sampler3DArray,
+ SamplerCubeArray,
+ SamplerRect,
+ SamplerBuffer,
+
+ Image1D,
+ Image2D,
+ Image2DMS,
+ Image3D,
+ ImageCube,
+ Image1DArray,
+ Image2DArray,
+ Image2DMSArray,
+ Image3DArray,
+ ImageCubeArray,
+ ImageRect,
+ ImageBuffer,
+
+ Struct
+ };
+
+ enum ImageFormat {
+ // must match SPIR-V's ImageFormat
+ ImageFormatUnknown = 0,
+ ImageFormatRgba32f = 1,
+ ImageFormatRgba16f = 2,
+ ImageFormatR32f = 3,
+ ImageFormatRgba8 = 4,
+ ImageFormatRgba8Snorm = 5,
+ ImageFormatRg32f = 6,
+ ImageFormatRg16f = 7,
+ ImageFormatR11fG11fB10f = 8,
+ ImageFormatR16f = 9,
+ ImageFormatRgba16 = 10,
+ ImageFormatRgb10A2 = 11,
+ ImageFormatRg16 = 12,
+ ImageFormatRg8 = 13,
+ ImageFormatR16 = 14,
+ ImageFormatR8 = 15,
+ ImageFormatRgba16Snorm = 16,
+ ImageFormatRg16Snorm = 17,
+ ImageFormatRg8Snorm = 18,
+ ImageFormatR16Snorm = 19,
+ ImageFormatR8Snorm = 20,
+ ImageFormatRgba32i = 21,
+ ImageFormatRgba16i = 22,
+ ImageFormatRgba8i = 23,
+ ImageFormatR32i = 24,
+ ImageFormatRg32i = 25,
+ ImageFormatRg16i = 26,
+ ImageFormatRg8i = 27,
+ ImageFormatR16i = 28,
+ ImageFormatR8i = 29,
+ ImageFormatRgba32ui = 30,
+ ImageFormatRgba16ui = 31,
+ ImageFormatRgba8ui = 32,
+ ImageFormatR32ui = 33,
+ ImageFormatRgb10a2ui = 34,
+ ImageFormatRg32ui = 35,
+ ImageFormatRg16ui = 36,
+ ImageFormatRg8ui = 37,
+ ImageFormatR16ui = 38,
+ ImageFormatR8ui = 39
+ };
+
+ enum ImageFlag {
+ ReadOnlyImage = 1 << 0,
+ WriteOnlyImage = 1 << 1
+ };
+ Q_DECLARE_FLAGS(ImageFlags, ImageFlag)
+
+ // Optional data (like decorations) usually default to an otherwise invalid value (-1 or 0). This is intentional.
+
+ struct InOutVariable {
+ QString name;
+ VariableType type = Unknown;
+ int location = -1;
+ int binding = -1;
+ int descriptorSet = -1;
+ ImageFormat imageFormat = ImageFormatUnknown;
+ ImageFlags imageFlags;
+ };
+
+ struct BlockVariable {
+ QString name;
+ VariableType type = Unknown;
+ int offset = 0;
+ int size = 0;
+ QVector<int> arrayDims;
+ int arrayStride = 0;
+ int matrixStride = 0;
+ bool matrixIsRowMajor = false;
+ QVector<BlockVariable> structMembers;
+ };
+
+ struct UniformBlock {
+ QString blockName;
+ QString structName; // instanceName
+ int size = 0;
+ int binding = -1;
+ int descriptorSet = -1;
+ QVector<BlockVariable> members;
+ };
+
+ struct PushConstantBlock {
+ QString name;
+ int size = 0;
+ QVector<BlockVariable> members;
+ };
+
+ struct StorageBlock {
+ QString blockName;
+ QString instanceName;
+ int knownSize = 0;
+ int binding = -1;
+ int descriptorSet = -1;
+ QVector<BlockVariable> members;
+ };
+
+ QVector<InOutVariable> inputVariables() const;
+ QVector<InOutVariable> outputVariables() const;
+ QVector<UniformBlock> uniformBlocks() const;
+ QVector<PushConstantBlock> pushConstantBlocks() const;
+ QVector<StorageBlock> storageBlocks() const;
+ QVector<InOutVariable> combinedImageSamplers() const;
+ QVector<InOutVariable> storageImages() const;
+
+ std::array<uint, 3> computeShaderLocalSize() const;
+
+private:
+ QShaderDescriptionPrivate *d;
+ friend struct QShaderDescriptionPrivate;
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription &);
+#endif
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QShaderDescription::ImageFlags)
+
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription::InOutVariable &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription::BlockVariable &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription::UniformBlock &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription::PushConstantBlock &);
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QShaderDescription::StorageBlock &);
+#endif
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/qshaderdescription_p_p.h b/src/gui/rhi/qshaderdescription_p_p.h
new file mode 100644
index 0000000000..1caee24984
--- /dev/null
+++ b/src/gui/rhi/qshaderdescription_p_p.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Gui module
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSHADERDESCRIPTION_P_H
+#define QSHADERDESCRIPTION_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of a number of Qt sources files. This header file may change from
+// version to version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qshaderdescription_p.h"
+#include <QtCore/QVector>
+#include <QtCore/QAtomicInt>
+#include <QtCore/QJsonDocument>
+
+QT_BEGIN_NAMESPACE
+
+struct Q_GUI_EXPORT QShaderDescriptionPrivate
+{
+ QShaderDescriptionPrivate()
+ : ref(1)
+ {
+ localSize[0] = localSize[1] = localSize[2] = 0;
+ }
+
+ QShaderDescriptionPrivate(const QShaderDescriptionPrivate *other)
+ : ref(1),
+ inVars(other->inVars),
+ outVars(other->outVars),
+ uniformBlocks(other->uniformBlocks),
+ pushConstantBlocks(other->pushConstantBlocks),
+ storageBlocks(other->storageBlocks),
+ combinedImageSamplers(other->combinedImageSamplers),
+ storageImages(other->storageImages),
+ localSize(other->localSize)
+ {
+ }
+
+ static QShaderDescriptionPrivate *get(QShaderDescription *desc) { return desc->d; }
+ static const QShaderDescriptionPrivate *get(const QShaderDescription *desc) { return desc->d; }
+
+ QJsonDocument makeDoc();
+ void loadDoc(const QJsonDocument &doc);
+
+ QAtomicInt ref;
+ QVector<QShaderDescription::InOutVariable> inVars;
+ QVector<QShaderDescription::InOutVariable> outVars;
+ QVector<QShaderDescription::UniformBlock> uniformBlocks;
+ QVector<QShaderDescription::PushConstantBlock> pushConstantBlocks;
+ QVector<QShaderDescription::StorageBlock> storageBlocks;
+ QVector<QShaderDescription::InOutVariable> combinedImageSamplers;
+ QVector<QShaderDescription::InOutVariable> storageImages;
+ std::array<uint, 3> localSize;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/gui/rhi/rhi.pri b/src/gui/rhi/rhi.pri
new file mode 100644
index 0000000000..4297a5602b
--- /dev/null
+++ b/src/gui/rhi/rhi.pri
@@ -0,0 +1,57 @@
+HEADERS += \
+ rhi/qrhi_p.h \
+ rhi/qrhi_p_p.h \
+ rhi/qrhiprofiler_p.h \
+ rhi/qrhiprofiler_p_p.h \
+ rhi/qrhinull_p.h \
+ rhi/qrhinull_p_p.h \
+ rhi/qshader_p.h \
+ rhi/qshader_p_p.h \
+ rhi/qshaderdescription_p.h \
+ rhi/qshaderdescription_p_p.h
+
+SOURCES += \
+ rhi/qrhi.cpp \
+ rhi/qrhiprofiler.cpp \
+ rhi/qrhinull.cpp \
+ rhi/qshaderdescription.cpp \
+ rhi/qshader.cpp
+
+qtConfig(opengl) {
+ HEADERS += \
+ rhi/qrhigles2_p.h \
+ rhi/qrhigles2_p_p.h
+ SOURCES += \
+ rhi/qrhigles2.cpp
+}
+
+qtConfig(vulkan) {
+ HEADERS += \
+ rhi/qrhivulkan_p.h \
+ rhi/qrhivulkan_p_p.h
+ SOURCES += \
+ rhi/qrhivulkan.cpp
+}
+
+win32 {
+ HEADERS += \
+ rhi/qrhid3d11_p.h \
+ rhi/qrhid3d11_p_p.h
+ SOURCES += \
+ rhi/qrhid3d11.cpp
+
+ LIBS += -ld3d11 -ldxgi -ldxguid
+}
+
+# darwin {
+macos {
+ HEADERS += \
+ rhi/qrhimetal_p.h \
+ rhi/qrhimetal_p_p.h
+ SOURCES += \
+ rhi/qrhimetal.mm
+
+ LIBS += -framework AppKit -framework Metal
+}
+
+include($$PWD/../../3rdparty/VulkanMemoryAllocator.pri)
diff --git a/src/gui/rhi/tdr.hlsl b/src/gui/rhi/tdr.hlsl
new file mode 100644
index 0000000000..f79de91c4a
--- /dev/null
+++ b/src/gui/rhi/tdr.hlsl
@@ -0,0 +1,9 @@
+RWBuffer<uint> uav;
+cbuffer ConstantBuffer { uint zero; }
+
+[numthreads(256, 1, 1)]
+void killDeviceByTimingOut(uint3 id: SV_DispatchThreadID)
+{
+ while (zero == 0)
+ uav[id.x] = zero;
+}
diff --git a/src/gui/text/qabstracttextdocumentlayout.cpp b/src/gui/text/qabstracttextdocumentlayout.cpp
index 2278378613..8b8f3e28ac 100644
--- a/src/gui/text/qabstracttextdocumentlayout.cpp
+++ b/src/gui/text/qabstracttextdocumentlayout.cpp
@@ -41,6 +41,7 @@
#include <qtextformat.h>
#include "qtextdocument_p.h"
#include "qtextengine_p.h"
+#include "qtextlist.h"
#include "qabstracttextdocumentlayout_p.h"
@@ -650,6 +651,36 @@ QTextFormat QAbstractTextDocumentLayout::formatAt(const QPointF &pos) const
}
/*!
+ \since 5.14
+
+ Returns the block (probably a list item) whose \l{QTextBlockFormat::marker()}{marker}
+ is found at the given position \a pos.
+*/
+QTextBlock QAbstractTextDocumentLayout::blockWithMarkerAt(const QPointF &pos) const
+{
+ QTextBlock block = document()->firstBlock();
+ while (block.isValid()) {
+ if (block.blockFormat().marker() != QTextBlockFormat::MarkerType::NoMarker) {
+ QRectF blockBr = blockBoundingRect(block);
+ QTextBlockFormat blockFmt = block.blockFormat();
+ QFontMetrics fm(block.charFormat().font());
+ qreal totalIndent = blockFmt.indent() + blockFmt.leftMargin() + blockFmt.textIndent();
+ if (block.textList())
+ totalIndent += block.textList()->format().indent() * 40;
+ QRectF adjustedBr = blockBr.adjusted(totalIndent - fm.height(), 0, totalIndent - blockBr.width(), fm.height() - blockBr.height());
+ if (adjustedBr.contains(pos)) {
+ //qDebug() << "hit block" << block.text() << blockBr << adjustedBr << "marker" << block.blockFormat().marker()
+ // << "font" << block.charFormat().font() << "adj" << lineHeight << totalIndent;
+ if (block.blockFormat().hasProperty(QTextFormat::BlockMarker))
+ return block;
+ }
+ }
+ block = block.next();
+ }
+ return QTextBlock();
+}
+
+/*!
\fn QRectF QAbstractTextDocumentLayout::frameBoundingRect(QTextFrame *frame) const
Returns the bounding rectangle of \a frame.
diff --git a/src/gui/text/qabstracttextdocumentlayout.h b/src/gui/text/qabstracttextdocumentlayout.h
index 3371401420..397dcd37d4 100644
--- a/src/gui/text/qabstracttextdocumentlayout.h
+++ b/src/gui/text/qabstracttextdocumentlayout.h
@@ -87,6 +87,7 @@ public:
QString anchorAt(const QPointF& pos) const;
QString imageAt(const QPointF &pos) const;
QTextFormat formatAt(const QPointF &pos) const;
+ QTextBlock blockWithMarkerAt(const QPointF &pos) const;
virtual int pageCount() const = 0;
virtual QSizeF documentSize() const = 0;
diff --git a/src/gui/text/qabstracttextdocumentlayout_p.h b/src/gui/text/qabstracttextdocumentlayout_p.h
index 191c463dc6..d631ce3197 100644
--- a/src/gui/text/qabstracttextdocumentlayout_p.h
+++ b/src/gui/text/qabstracttextdocumentlayout_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
struct QTextObjectHandler
{
- QTextObjectHandler() : iface(0) {}
+ QTextObjectHandler() : iface(nullptr) {}
QTextObjectInterface *iface;
QPointer<QObject> component;
};
@@ -71,12 +71,12 @@ public:
Q_DECLARE_PUBLIC(QAbstractTextDocumentLayout)
inline QAbstractTextDocumentLayoutPrivate()
- : paintDevice(0) {}
+ : paintDevice(nullptr) {}
~QAbstractTextDocumentLayoutPrivate();
inline void setDocument(QTextDocument *doc) {
document = doc;
- docPrivate = 0;
+ docPrivate = nullptr;
if (doc)
docPrivate = doc->docHandle();
}
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index dc7e128bcd..ce7c7610c1 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -67,6 +67,7 @@ struct QCssKnownValue
static const QCssKnownValue properties[NumProperties - 1] = {
{ "-qt-background-role", QtBackgroundRole },
{ "-qt-block-indent", QtBlockIndent },
+ { "-qt-fg-texture-cachekey", QtForegroundTextureCacheKey },
{ "-qt-line-height-type", QtLineHeightType },
{ "-qt-list-indent", QtListIndent },
{ "-qt-list-number-prefix", QtListNumberPrefix },
@@ -91,6 +92,7 @@ static const QCssKnownValue properties[NumProperties - 1] = {
{ "border-bottom-right-radius", BorderBottomRightRadius },
{ "border-bottom-style", BorderBottomStyle },
{ "border-bottom-width", BorderBottomWidth },
+ { "border-collapse", BorderCollapse },
{ "border-color", BorderColor },
{ "border-image", BorderImage },
{ "border-left", BorderLeft },
@@ -221,6 +223,7 @@ static const QCssKnownValue values[NumKnownValues - 1] = {
{ "outset", Value_Outset },
{ "overline", Value_Overline },
{ "pre", Value_Pre },
+ { "pre-line", Value_PreLine },
{ "pre-wrap", Value_PreWrap },
{ "ridge", Value_Ridge },
{ "right", Value_Right },
@@ -247,10 +250,10 @@ static const QCssKnownValue values[NumKnownValues - 1] = {
};
//Map id to strings as they appears in the 'values' array above
-static const short indexOfId[NumKnownValues] = { 0, 41, 48, 42, 49, 54, 35, 26, 70, 71, 25, 43, 5, 63, 47,
- 29, 58, 59, 27, 51, 61, 6, 10, 39, 56, 19, 13, 17, 18, 20, 21, 50, 24, 46, 67, 37, 3, 2, 40, 62, 16,
- 11, 57, 14, 32, 64, 33, 65, 55, 66, 34, 69, 8, 28, 38, 12, 36, 60, 7, 9, 4, 68, 53, 22, 23, 30, 31,
- 1, 15, 0, 52, 45, 44 };
+static const short indexOfId[NumKnownValues] = { 0, 41, 48, 42, 49, 50, 55, 35, 26, 71, 72, 25, 43, 5, 64, 48,
+ 29, 59, 60, 27, 52, 62, 6, 10, 39, 56, 19, 13, 17, 18, 20, 21, 51, 24, 46, 68, 37, 3, 2, 40, 63, 16,
+ 11, 58, 14, 32, 65, 33, 66, 56, 67, 34, 70, 8, 28, 38, 12, 36, 61, 7, 9, 4, 69, 54, 22, 23, 30, 31,
+ 1, 15, 0, 53, 45, 44 };
QString Value::toString() const
{
@@ -609,11 +612,7 @@ bool ValueExtractor::extractBorder(int *borders, QBrush *colors, BorderStyle *st
case BorderRightStyle: styles[RightEdge] = decl.styleValue(); break;
case BorderStyles: decl.styleValues(styles); break;
-#ifndef QT_OS_ANDROID_GCC_48_WORKAROUND
case BorderTopLeftRadius: radii[0] = sizeValue(decl); break;
-#else
- case BorderTopLeftRadius: new(radii)QSize(sizeValue(decl)); break;
-#endif
case BorderTopRightRadius: radii[1] = sizeValue(decl); break;
case BorderBottomLeftRadius: radii[2] = sizeValue(decl); break;
case BorderBottomRightRadius: radii[3] = sizeValue(decl); break;
@@ -1730,6 +1729,14 @@ void Declaration::borderImageValue(QString *image, int *cuts,
*h = *v;
}
+bool Declaration::borderCollapseValue() const
+{
+ if (d->values.count() != 1)
+ return false;
+ else
+ return d->values.at(0).toString() == QLatin1String("collapse");
+}
+
QIcon Declaration::iconValue() const
{
if (d->parsed.isValid())
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h
index 860bbe382a..ab85e76cf3 100644
--- a/src/gui/text/qcssparser_p.h
+++ b/src/gui/text/qcssparser_p.h
@@ -122,6 +122,7 @@ enum Property {
BorderRight,
BorderTop,
BorderBottom,
+ BorderCollapse,
Padding,
PaddingLeft,
PaddingRight,
@@ -196,6 +197,7 @@ enum Property {
LineHeight,
QtLineHeightType,
FontKerning,
+ QtForegroundTextureCacheKey,
NumProperties
};
@@ -204,6 +206,7 @@ enum KnownValue {
Value_Normal,
Value_Pre,
Value_NoWrap,
+ Value_PreLine,
Value_PreWrap,
Value_Small,
Value_Medium,
@@ -467,8 +470,8 @@ struct Q_GUI_EXPORT Declaration
Attachment attachmentValue() const;
int styleFeaturesValue() const;
- bool intValue(int *i, const char *unit = 0) const;
- bool realValue(qreal *r, const char *unit = 0) const;
+ bool intValue(int *i, const char *unit = nullptr) const;
+ bool realValue(qreal *r, const char *unit = nullptr) const;
QSize sizeValue() const;
QRect rectValue() const;
@@ -476,6 +479,7 @@ struct Q_GUI_EXPORT Declaration
QIcon iconValue() const;
void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const;
+ bool borderCollapseValue() const;
};
QT_CSS_DECLARE_TYPEINFO(Declaration, Q_MOVABLE_TYPE)
@@ -584,7 +588,7 @@ struct Q_GUI_EXPORT Selector
{
QVector<BasicSelector> basicSelectors;
int specificity() const;
- quint64 pseudoClass(quint64 *negated = 0) const;
+ quint64 pseudoClass(quint64 *negated = nullptr) const;
QString pseudoElement() const;
};
QT_CSS_DECLARE_TYPEINFO(Selector, Q_MOVABLE_TYPE)
@@ -656,7 +660,7 @@ public:
};
QVector<StyleRule> styleRulesForNode(NodePtr node);
- QVector<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = 0);
+ QVector<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = nullptr);
virtual bool nodeNameEquals(NodePtr node, const QString& nodeName) const;
virtual QString attribute(NodePtr node, const QString &name) const = 0;
@@ -744,7 +748,7 @@ QT_CSS_DECLARE_TYPEINFO(Symbol, Q_MOVABLE_TYPE)
class Q_GUI_EXPORT Scanner
{
public:
- static QString preprocess(const QString &input, bool *hasEscapeSequences = 0);
+ static QString preprocess(const QString &input, bool *hasEscapeSequences = nullptr);
static void scan(const QString &preprocessedInput, QVector<Symbol> *symbols);
};
@@ -845,7 +849,7 @@ struct Q_GUI_EXPORT ValueExtractor
bool extractGeometry(int *w, int *h, int *minw, int *minh, int *maxw, int *maxh);
bool extractPosition(int *l, int *t, int *r, int *b, QCss::Origin *, Qt::Alignment *,
QCss::PositionMode *, Qt::Alignment *);
- bool extractBox(int *margins, int *paddings, int *spacing = 0);
+ bool extractBox(int *margins, int *paddings, int *spacing = nullptr);
bool extractBorder(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii);
bool extractOutline(int *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, int *offsets);
bool extractPalette(QBrush *fg, QBrush *sfg, QBrush *sbg, QBrush *abg);
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp
index 75e2e4e745..d8a971c7b7 100644
--- a/src/gui/text/qdistancefield.cpp
+++ b/src/gui/text/qdistancefield.cpp
@@ -782,7 +782,7 @@ bool qt_fontHasNarrowOutlines(QFontEngine *fontEngine)
if (glyph != 0)
im = fe->alphaMapForGlyph(glyph, QFixed(), QTransform());
- Q_ASSERT(fe->ref.load() == 0);
+ Q_ASSERT(fe->ref.loadRelaxed() == 0);
delete fe;
return imageHasNarrowOutlines(im);
diff --git a/src/gui/text/qdistancefield_p.h b/src/gui/text/qdistancefield_p.h
index c0873cedab..823bfaf1c6 100644
--- a/src/gui/text/qdistancefield_p.h
+++ b/src/gui/text/qdistancefield_p.h
@@ -72,7 +72,7 @@ int Q_GUI_EXPORT QT_DISTANCEFIELD_HIGHGLYPHCOUNT();
class Q_GUI_EXPORT QDistanceFieldData : public QSharedData
{
public:
- QDistanceFieldData() : glyph(0), width(0), height(0), nbytes(0), data(0) {}
+ QDistanceFieldData() : glyph(0), width(0), height(0), nbytes(0), data(nullptr) {}
QDistanceFieldData(const QDistanceFieldData &other);
~QDistanceFieldData();
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index f5dbec3a3e..bf130fa0b7 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -180,14 +180,14 @@ Q_GUI_EXPORT int qt_defaultDpi()
}
QFontPrivate::QFontPrivate()
- : engineData(0), dpi(qt_defaultDpi()), screen(0),
+ : engineData(0), dpi(qt_defaultDpi()),
underline(false), overline(false), strikeOut(false), kerning(true),
capital(0), letterSpacingIsAbsolute(false), scFont(0)
{
}
QFontPrivate::QFontPrivate(const QFontPrivate &other)
- : request(other.request), engineData(0), dpi(other.dpi), screen(other.screen),
+ : request(other.request), engineData(0), dpi(other.dpi),
underline(other.underline), overline(other.overline),
strikeOut(other.strikeOut), kerning(other.kerning),
capital(other.capital), letterSpacingIsAbsolute(other.letterSpacingIsAbsolute),
@@ -208,7 +208,7 @@ QFontPrivate::~QFontPrivate()
scFont = 0;
}
-extern QMutex *qt_fontdatabase_mutex();
+extern QRecursiveMutex *qt_fontdatabase_mutex();
#define QT_FONT_ENGINE_FROM_DATA(data, script) data->engines[script]
@@ -341,7 +341,7 @@ QFontEngineData::QFontEngineData()
QFontEngineData::~QFontEngineData()
{
- Q_ASSERT(ref.load() == 0);
+ Q_ASSERT(ref.loadRelaxed() == 0);
for (int i = 0; i < QChar::ScriptCount; ++i) {
if (engines[i]) {
if (!engines[i]->ref.deref())
@@ -586,11 +586,9 @@ QFont::QFont(const QFont &font, const QPaintDevice *pd)
{
Q_ASSERT(pd);
const int dpi = pd->logicalDpiY();
- const int screen = 0;
- if (font.d->dpi != dpi || font.d->screen != screen ) {
+ if (font.d->dpi != dpi) {
d = new QFontPrivate(*font.d);
d->dpi = dpi;
- d->screen = screen;
} else {
d = font.d;
}
@@ -609,7 +607,7 @@ QFont::QFont(QFontPrivate *data)
*/
void QFont::detach()
{
- if (d->ref.load() == 1) {
+ if (d->ref.loadRelaxed() == 1) {
if (d->engineData && !d->engineData->ref.deref())
delete d->engineData;
d->engineData = 0;
@@ -630,7 +628,7 @@ void QFont::detach()
*/
void QFontPrivate::detachButKeepEngineData(QFont *font)
{
- if (font->d->ref.load() == 1)
+ if (font->d->ref.loadRelaxed() == 1)
return;
QFontEngineData *engineData = font->d->engineData;
@@ -2088,7 +2086,7 @@ QString QFont::toString() const
\relates QFont
\since 5.3
*/
-uint qHash(const QFont &font, uint seed) Q_DECL_NOTHROW
+uint qHash(const QFont &font, uint seed) noexcept
{
return qHash(QFontPrivate::get(font)->request, seed);
}
@@ -2805,12 +2803,12 @@ void QFontCache::cleanup()
cache->setLocalData(0);
}
-QBasicAtomicInt font_cache_id = Q_BASIC_ATOMIC_INITIALIZER(1);
+static QBasicAtomicInt font_cache_id = Q_BASIC_ATOMIC_INITIALIZER(0);
QFontCache::QFontCache()
: QObject(), total_cost(0), max_cost(min_cost),
current_timestamp(0), fast(false), timer_id(-1),
- m_id(font_cache_id.fetchAndAddRelaxed(1))
+ m_id(font_cache_id.fetchAndAddRelaxed(1) + 1)
{
}
@@ -2839,7 +2837,7 @@ void QFontCache::clear()
delete data;
} else {
FC_DEBUG("QFontCache::clear: engineData %p still has refcount %d",
- data, data->ref.load());
+ data, data->ref.loadRelaxed());
}
++it;
}
@@ -2863,7 +2861,7 @@ void QFontCache::clear()
delete engine;
} else if (cacheCount == 0) {
FC_DEBUG("QFontCache::clear: engine %p still has refcount %d",
- engine, engine->ref.load());
+ engine, engine->ref.loadRelaxed());
}
it.value().data = 0;
}
@@ -2933,7 +2931,7 @@ void QFontCache::updateHitCountAndTimeStamp(Engine &value)
FC_DEBUG("QFontCache: found font engine\n"
" %p: timestamp %4u hits %3u ref %2d/%2d, type %d",
value.data, value.timestamp, value.hits,
- value.data->ref.load(), engineCacheCount.value(value.data),
+ value.data->ref.loadRelaxed(), engineCacheCount.value(value.data),
value.data->type());
}
@@ -2943,7 +2941,7 @@ void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMu
Q_ASSERT(key.multi == (engine->type() == QFontEngine::Multi));
#ifdef QFONTCACHE_DEBUG
- FC_DEBUG("QFontCache: inserting new engine %p, refcount %d", engine, engine->ref.load());
+ FC_DEBUG("QFontCache: inserting new engine %p, refcount %d", engine, engine->ref.loadRelaxed());
if (!insertMulti && engineCache.contains(key)) {
FC_DEBUG(" QFontCache already contains engine %p for key=(%g %g %d %d %d)",
engineCache.value(key).data, key.def.pointSize,
@@ -3032,9 +3030,9 @@ void QFontCache::decreaseCache()
EngineDataCache::ConstIterator it = engineDataCache.constBegin(),
end = engineDataCache.constEnd();
for (; it != end; ++it) {
- FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref.load()));
+ FC_DEBUG(" %p: ref %2d", it.value(), int(it.value()->ref.loadRelaxed()));
- if (it.value()->ref.load() != 1)
+ if (it.value()->ref.loadRelaxed() != 1)
in_use_cost += engine_data_cost;
}
}
@@ -3047,10 +3045,10 @@ void QFontCache::decreaseCache()
for (; it != end; ++it) {
FC_DEBUG(" %p: timestamp %4u hits %2u ref %2d/%2d, cost %u bytes",
it.value().data, it.value().timestamp, it.value().hits,
- it.value().data->ref.load(), engineCacheCount.value(it.value().data),
+ it.value().data->ref.loadRelaxed(), engineCacheCount.value(it.value().data),
it.value().data->cache_cost);
- if (it.value().data->ref.load() > engineCacheCount.value(it.value().data))
+ if (it.value().data->ref.loadRelaxed() > engineCacheCount.value(it.value().data))
in_use_cost += it.value().data->cache_cost / engineCacheCount.value(it.value().data);
}
@@ -3099,7 +3097,7 @@ void QFontCache::decreaseCache()
// clean out all unused engine data
EngineDataCache::Iterator it = engineDataCache.begin();
while (it != engineDataCache.end()) {
- if (it.value()->ref.load() == 1) {
+ if (it.value()->ref.loadRelaxed() == 1) {
FC_DEBUG(" %p", it.value());
decreaseCost(sizeof(QFontEngineData));
it.value()->ref.deref();
@@ -3127,7 +3125,7 @@ void QFontCache::decreaseCache()
EngineCache::Iterator jt = end;
for ( ; it != end; ++it) {
- if (it.value().data->ref.load() != engineCacheCount.value(it.value().data))
+ if (it.value().data->ref.loadRelaxed() != engineCacheCount.value(it.value().data))
continue;
if (it.value().timestamp < oldest && it.value().hits <= least_popular) {
@@ -3141,7 +3139,7 @@ void QFontCache::decreaseCache()
if (it != end) {
FC_DEBUG(" %p: timestamp %4u hits %2u ref %2d/%2d, type %d",
it.value().data, it.value().timestamp, it.value().hits,
- it.value().data->ref.load(), engineCacheCount.value(it.value().data),
+ it.value().data->ref.loadRelaxed(), engineCacheCount.value(it.value().data),
it.value().data->type());
QFontEngine *fontEngine = it.value().data;
@@ -3156,7 +3154,7 @@ void QFontCache::decreaseCache()
}
}
// and delete the last occurrence
- Q_ASSERT(fontEngine->ref.load() == 0);
+ Q_ASSERT(fontEngine->ref.loadRelaxed() == 0);
decreaseCost(fontEngine->cache_cost);
delete fontEngine;
engineCacheCount.remove(fontEngine);
@@ -3170,7 +3168,103 @@ void QFontCache::decreaseCache()
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug stream, const QFont &font)
{
- return stream << "QFont(" << font.toString() << ')';
+ QDebugStateSaver saver(stream);
+ stream.nospace().noquote();
+ stream << "QFont(";
+
+ if (stream.verbosity() == QDebug::DefaultVerbosity) {
+ stream << font.toString() << ")";
+ return stream;
+ }
+
+ QString fontDescription;
+ QDebug debug(&fontDescription);
+ debug.nospace();
+
+ const QFont defaultFont(new QFontPrivate);
+
+ for (int property = QFont::FamilyResolved; property < QFont::AllPropertiesResolved; property <<= 1) {
+ const bool resolved = (font.resolve_mask & property) != 0;
+ if (!resolved && stream.verbosity() == QDebug::MinimumVerbosity)
+ continue;
+
+ #define QFONT_DEBUG_SKIP_DEFAULT(prop) \
+ if ((font.prop() == defaultFont.prop()) && stream.verbosity() == 1) \
+ continue;
+
+ QDebugStateSaver saver(debug);
+
+ switch (property) {
+ case QFont::FamilyResolved:
+ debug << font.family(); break;
+ case QFont::SizeResolved:
+ if (font.pointSizeF() >= 0)
+ debug << font.pointSizeF() << "pt";
+ else if (font.pixelSize() >= 0)
+ debug << font.pixelSize() << "px";
+ else
+ Q_UNREACHABLE();
+ break;
+ case QFont::StyleHintResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(styleHint);
+ debug.verbosity(1) << font.styleHint(); break;
+ case QFont::StyleStrategyResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(styleStrategy);
+ debug.verbosity(1) << font.styleStrategy(); break;
+ case QFont::WeightResolved:
+ debug.verbosity(1) << QFont::Weight(font.weight()); break;
+ case QFont::StyleResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(style);
+ debug.verbosity(0) << font.style(); break;
+ case QFont::UnderlineResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(underline);
+ debug << "underline=" << font.underline(); break;
+ case QFont::OverlineResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(overline);
+ debug << "overline=" << font.overline(); break;
+ case QFont::StrikeOutResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(strikeOut);
+ debug << "strikeOut=" << font.strikeOut(); break;
+ case QFont::FixedPitchResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(fixedPitch);
+ debug << "fixedPitch=" << font.fixedPitch(); break;
+ case QFont::StretchResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(stretch);
+ debug.verbosity(0) << QFont::Stretch(font.stretch()); break;
+ case QFont::KerningResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(kerning);
+ debug << "kerning=" << font.kerning(); break;
+ case QFont::CapitalizationResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(capitalization);
+ debug.verbosity(0) << font.capitalization(); break;
+ case QFont::LetterSpacingResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(letterSpacing);
+ debug << "letterSpacing=" << font.letterSpacing();
+ debug.verbosity(0) << " (" << font.letterSpacingType() << ")";
+ break;
+ case QFont::HintingPreferenceResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(hintingPreference);
+ debug.verbosity(0) << font.hintingPreference(); break;
+ case QFont::StyleNameResolved:
+ QFONT_DEBUG_SKIP_DEFAULT(styleName);
+ debug << "styleName=" << font.styleName(); break;
+ default:
+ continue;
+ };
+
+ #undef QFONT_DEBUG_SKIP_DEFAULT
+
+ debug << ", ";
+ }
+
+ if (stream.verbosity() > QDebug::MinimumVerbosity)
+ debug.verbosity(0) << "resolveMask=" << QFlags<QFont::ResolveProperties>(font.resolve_mask);
+ else
+ fontDescription.chop(2); // Last ', '
+
+ stream << fontDescription << ')';
+
+ return stream;
}
#endif
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index e86f06353a..683aa3bf65 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -147,6 +147,7 @@ public:
Q_ENUM(SpacingType)
enum ResolveProperties {
+ NoPropertiesResolved = 0x0000,
FamilyResolved = 0x0001,
SizeResolved = 0x0002,
StyleHintResolved = 0x0004,
@@ -167,6 +168,7 @@ public:
FamiliesResolved = 0x20000,
AllPropertiesResolved = 0x3ffff
};
+ Q_ENUM(ResolveProperties)
QFont();
QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
@@ -259,10 +261,8 @@ public:
bool operator<(const QFont &) const;
operator QVariant() const;
bool isCopyOf(const QFont &) const;
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QFont &operator=(QFont &&other) Q_DECL_NOEXCEPT
+ inline QFont &operator=(QFont &&other) noexcept
{ qSwap(d, other.d); qSwap(resolve_mask, other.resolve_mask); return *this; }
-#endif
#if QT_DEPRECATED_SINCE(5, 3)
// needed for X11
@@ -335,13 +335,17 @@ private:
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QFont &);
#endif
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QFont &);
+#endif
+
QExplicitlySharedDataPointer<QFontPrivate> d;
uint resolve_mask;
};
Q_DECLARE_SHARED(QFont)
-Q_GUI_EXPORT uint qHash(const QFont &font, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QFont &font, uint seed = 0) noexcept;
inline bool QFont::bold() const
{ return weight() > Medium; }
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index e86ec31e47..adbb7a0121 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -136,21 +136,22 @@ struct QFontDef
}
};
-inline uint qHash(const QFontDef &fd, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QFontDef &fd, uint seed = 0) noexcept
{
- return qHash(qRound64(fd.pixelSize*10000)) // use only 4 fractional digits
- ^ qHash(fd.weight)
- ^ qHash(fd.style)
- ^ qHash(fd.stretch)
- ^ qHash(fd.styleHint)
- ^ qHash(fd.styleStrategy)
- ^ qHash(fd.ignorePitch)
- ^ qHash(fd.fixedPitch)
- ^ qHash(fd.family, seed)
- ^ qHash(fd.families, seed)
- ^ qHash(fd.styleName)
- ^ qHash(fd.hintingPreference)
- ;
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, qRound64(fd.pixelSize*10000)); // use only 4 fractional digits
+ seed = hash(seed, fd.weight);
+ seed = hash(seed, fd.style);
+ seed = hash(seed, fd.stretch);
+ seed = hash(seed, fd.styleHint);
+ seed = hash(seed, fd.styleStrategy);
+ seed = hash(seed, fd.ignorePitch);
+ seed = hash(seed, fd.fixedPitch);
+ seed = hash(seed, fd.family);
+ seed = hash(seed, fd.families);
+ seed = hash(seed, fd.styleName);
+ seed = hash(seed, fd.hintingPreference);
+ return seed;
}
class QFontEngineData
@@ -184,7 +185,6 @@ public:
QFontDef request;
mutable QFontEngineData *engineData;
int dpi;
- int screen;
uint underline : 1;
uint overline : 1;
@@ -229,19 +229,17 @@ public:
void clear();
struct Key {
- Key() : script(0), multi(0), screen(0) { }
- Key(const QFontDef &d, uchar c, bool m = 0, uchar s = 0)
- : def(d), script(c), multi(m), screen(s) { }
+ Key() : script(0), multi(0) { }
+ Key(const QFontDef &d, uchar c, bool m = 0)
+ : def(d), script(c), multi(m) { }
QFontDef def;
uchar script;
uchar multi: 1;
- uchar screen: 7;
inline bool operator<(const Key &other) const
{
if (script != other.script) return script < other.script;
- if (screen != other.screen) return screen < other.screen;
if (multi != other.multi) return multi < other.multi;
if (multi && def.fallBackFamilies.size() != other.def.fallBackFamilies.size())
return def.fallBackFamilies.size() < other.def.fallBackFamilies.size();
@@ -250,7 +248,6 @@ public:
inline bool operator==(const Key &other) const
{
return script == other.script
- && screen == other.screen
&& multi == other.multi
&& (!multi || def.fallBackFamilies == other.def.fallBackFamilies)
&& def == other.def;
@@ -266,7 +263,7 @@ public:
// QFontEngine cache
struct Engine {
- Engine() : data(0), timestamp(0), hits(0) { }
+ Engine() : data(nullptr), timestamp(0), hits(0) { }
Engine(QFontEngine *d) : data(d), timestamp(0), hits(0) { }
QFontEngine *data;
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 67783e5b42..67702ab5b5 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -422,7 +422,7 @@ struct FallbacksCacheKey {
QChar::Script script;
};
-inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) Q_DECL_NOTHROW
+inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) noexcept
{
return lhs.script == rhs.script &&
lhs.styleHint == rhs.styleHint &&
@@ -430,12 +430,12 @@ inline bool operator==(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rh
lhs.family == rhs.family;
}
-inline bool operator!=(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const FallbacksCacheKey &lhs, const FallbacksCacheKey &rhs) noexcept
{
return !operator==(lhs, rhs);
}
-inline uint qHash(const FallbacksCacheKey &key, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const FallbacksCacheKey &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.family);
@@ -451,8 +451,7 @@ class QFontDatabasePrivate
public:
QFontDatabasePrivate()
: count(0), families(0),
- fallbacksCache(64),
- reregisterAppFonts(false)
+ fallbacksCache(64)
{ }
~QFontDatabasePrivate() {
@@ -488,7 +487,6 @@ public:
};
QVector<ApplicationFont> applicationFonts;
int addAppFont(const QByteArray &fontData, const QString &fileName);
- bool reregisterAppFonts;
bool isApplicationFont(const QString &fileName);
void invalidate();
@@ -707,7 +705,7 @@ static QStringList familyList(const QFontDef &req)
}
Q_GLOBAL_STATIC(QFontDatabasePrivate, privateDb)
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, fontDatabaseMutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, fontDatabaseMutex)
// used in qguiapplication.cpp
void qt_cleanupFontDatabase()
@@ -719,8 +717,8 @@ void qt_cleanupFontDatabase()
}
}
-// used in qfontengine_x11.cpp
-QMutex *qt_fontdatabase_mutex()
+// used in qfont.cpp
+QRecursiveMutex *qt_fontdatabase_mutex()
{
return fontDatabaseMutex();
}
@@ -794,7 +792,7 @@ QString qt_resolveFontFamilyAlias(const QString &alias)
return alias;
}
-Q_GUI_EXPORT bool qt_isFontFamilyPopulated(const QString &familyName)
+bool qt_isFontFamilyPopulated(const QString &familyName)
{
QFontDatabasePrivate *d = privateDb();
QtFontFamily *f = d->family(familyName, QFontDatabasePrivate::RequestFamily);
@@ -898,15 +896,12 @@ static void initializeDb()
QFontDatabasePrivate *db = privateDb();
// init by asking for the platformfontdb for the first time or after invalidation
- if (!db->count)
+ if (!db->count) {
QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFontDatabase();
-
- if (db->reregisterAppFonts) {
for (int i = 0; i < db->applicationFonts.count(); i++) {
if (!db->applicationFonts.at(i).families.isEmpty())
registerFont(&db->applicationFonts[i]);
}
- db->reregisterAppFonts = false;
}
}
@@ -979,7 +974,7 @@ QFontEngine *loadSingleEngine(int script,
if (!engine->supportsScript(QChar::Script(script))) {
qWarning(" OpenType support missing for \"%s\", script %d",
+ qPrintable(def.family), script);
- if (engine->ref.load() == 0)
+ if (engine->ref.loadRelaxed() == 0)
delete engine;
return 0;
}
@@ -1034,11 +1029,7 @@ QFontEngine *loadEngine(int script, const QFontDef &request,
static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
{
- QFontDatabasePrivate *db = privateDb();
-
fnt->families = QGuiApplicationPrivate::platformIntegration()->fontDatabase()->addApplicationFont(fnt->data,fnt->fileName);
-
- db->reregisterAppFonts = true;
}
static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey,
@@ -2452,13 +2443,18 @@ int QFontDatabasePrivate::addAppFont(const QByteArray &fontData, const QString &
if (font.fileName.isEmpty() && !fontData.isEmpty())
font.fileName = QLatin1String(":qmemoryfonts/") + QString::number(i);
+ bool wasEmpty = privateDb()->count == 0;
registerFont(&font);
if (font.families.isEmpty())
return -1;
applicationFonts[i] = font;
- invalidate();
+ // If the cache has not yet been populated, we need to reload the application font later
+ if (wasEmpty)
+ invalidate();
+ else
+ emit qApp->fontDatabaseChanged();
return i;
}
@@ -2599,7 +2595,6 @@ bool QFontDatabase::removeApplicationFont(int handle)
db->applicationFonts[handle] = QFontDatabasePrivate::ApplicationFont();
- db->reregisterAppFonts = true;
db->invalidate();
return true;
}
@@ -2690,7 +2685,7 @@ QFontEngine *QFontDatabase::findFont(const QFontDef &request, int script)
QtFontDesc desc;
QList<int> blackListed;
int index = match(multi ? QChar::Script_Common : script, request, family_name, foundry_name, &desc, blackListed);
- if (index < 0 && QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFamilyAliases()) {
+ if (index < 0 && QGuiApplicationPrivate::platformIntegration()->fontDatabase()->populateFamilyAliases(family_name)) {
// We populated familiy aliases (e.g. localized families), so try again
index = match(multi ? QChar::Script_Common : script, request, family_name, foundry_name, &desc, blackListed);
}
@@ -2828,7 +2823,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
fe = QFontDatabase::findFont(req, script);
if (fe) {
if (fe->type() == QFontEngine::Box && !req.families.at(0).isEmpty()) {
- if (fe->ref.load() == 0)
+ if (fe->ref.loadRelaxed() == 0)
delete fe;
fe = 0;
} else {
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index e59d425cb6..403a0510fa 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1040,15 +1040,15 @@ void QFontEngine::setGlyphCache(const void *context, QFontEngineGlyphCache *cach
Q_ASSERT(cache);
GlyphCaches &caches = m_glyphCaches[context];
- for (GlyphCaches::const_iterator it = caches.constBegin(), end = caches.constEnd(); it != end; ++it) {
- if (cache == it->cache.data())
+ for (auto & e : caches) {
+ if (cache == e.cache.data())
return;
}
// Limit the glyph caches to 4 per context. This covers all 90 degree rotations,
// and limits memory use when there is continuous or random rotation
if (caches.size() == 4)
- caches.removeLast();
+ caches.pop_back();
GlyphCacheEntry entry;
entry.cache = cache;
@@ -1065,8 +1065,8 @@ QFontEngineGlyphCache *QFontEngine::glyphCache(const void *context,
if (caches == m_glyphCaches.cend())
return nullptr;
- for (GlyphCaches::const_iterator it = caches->begin(), end = caches->end(); it != end; ++it) {
- QFontEngineGlyphCache *cache = it->cache.data();
+ for (auto &e : *caches) {
+ QFontEngineGlyphCache *cache = e.cache.data();
if (format == cache->glyphFormat()
&& (format != Format_ARGB || color == cache->color())
&& qtransform_equals_no_translate(cache->m_transform, transform)) {
@@ -1200,7 +1200,7 @@ void QFontEngine::loadKerningPairs(QFixed scalingFactor)
end:
std::sort(kerning_pairs.begin(), kerning_pairs.end());
// for (int i = 0; i < kerning_pairs.count(); ++i)
-// qDebug() << 'i' << i << "left_right" << hex << kerning_pairs.at(i).left_right;
+// qDebug() << 'i' << i << "left_right" << Qt::hex << kerning_pairs.at(i).left_right;
}
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index 48dcdbeff7..03e14c737a 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -54,7 +54,6 @@
#include <QtGui/private/qtguiglobal_p.h>
#include "QtCore/qatomic.h"
#include <QtCore/qvarlengtharray.h>
-#include <QtCore/QLinkedList>
#include <QtCore/qhashfunctions.h>
#include "private/qtextengine_p.h"
#include "private/qfont_p.h"
@@ -137,7 +136,7 @@ public:
signed char format = 0;
uchar *data = nullptr;
private:
- Q_DISABLE_COPY(Glyph);
+ Q_DISABLE_COPY(Glyph)
};
virtual ~QFontEngine();
@@ -236,7 +235,7 @@ public:
virtual qreal minLeftBearing() const;
virtual qreal minRightBearing() const;
- virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
+ virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr);
inline bool canRender(uint ucs4) const { return glyphIndex(ucs4) != 0; }
virtual bool canRender(const QChar *str, int len) const;
@@ -246,7 +245,7 @@ public:
virtual int glyphCount() const;
virtual int glyphMargin(GlyphFormat format) { return format == Format_A32 ? 2 : 0; }
- virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return 0; }
+ virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return nullptr; }
virtual Qt::HANDLE handle() const;
@@ -304,33 +303,33 @@ public:
Holder() : ptr(nullptr), destroy_func(nullptr) {}
explicit Holder(void *p, qt_destroy_func_t d) : ptr(p), destroy_func(d) {}
~Holder() { if (ptr && destroy_func) destroy_func(ptr); }
- Holder(Holder &&other) Q_DECL_NOTHROW
+ Holder(Holder &&other) noexcept
: ptr(other.ptr),
destroy_func(other.destroy_func)
{
other.ptr = nullptr;
other.destroy_func = nullptr;
}
- Holder &operator=(Holder &&other) Q_DECL_NOTHROW
+ Holder &operator=(Holder &&other) noexcept
{ swap(other); return *this; }
- void swap(Holder &other) Q_DECL_NOTHROW
+ void swap(Holder &other) noexcept
{
qSwap(ptr, other.ptr);
qSwap(destroy_func, other.destroy_func);
}
- void *get() const Q_DECL_NOTHROW { return ptr; }
- void *release() Q_DECL_NOTHROW {
+ void *get() const noexcept { return ptr; }
+ void *release() noexcept {
void *result = ptr;
ptr = nullptr;
destroy_func = nullptr;
return result;
}
- void reset() Q_DECL_NOTHROW { Holder().swap(*this); }
- qt_destroy_func_t get_deleter() const Q_DECL_NOTHROW { return destroy_func; }
+ void reset() noexcept { Holder().swap(*this); }
+ qt_destroy_func_t get_deleter() const noexcept { return destroy_func; }
- bool operator!() const Q_DECL_NOTHROW { return !ptr; }
+ bool operator!() const noexcept { return !ptr; }
};
mutable Holder font_; // \ NOTE: Declared before m_glyphCaches, so font_, face_
@@ -381,7 +380,7 @@ private:
QExplicitlySharedDataPointer<QFontEngineGlyphCache> cache;
bool operator==(const GlyphCacheEntry &other) const { return cache == other.cache; }
};
- typedef QLinkedList<GlyphCacheEntry> GlyphCaches;
+ typedef std::list<GlyphCacheEntry> GlyphCaches;
mutable QHash<const void *, GlyphCaches> m_glyphCaches;
private:
@@ -401,7 +400,7 @@ inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId
}
inline uint qHash(const QFontEngine::FaceId &f, uint seed = 0)
- Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(f.filename)))
+ noexcept(noexcept(qHash(f.filename)))
{
QtPrivate::QHashCombine hash;
seed = hash(seed, f.filename);
@@ -469,7 +468,7 @@ public:
virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
virtual void doKerning(QGlyphLayout *, ShaperFlags) const override;
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override;
- virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0) override;
+ virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr) override;
virtual QFixed ascent() const override;
virtual QFixed capHeight() const override;
diff --git a/src/gui/text/qfontengine_qpf2.cpp b/src/gui/text/qfontengine_qpf2.cpp
index 110d512d39..409176d41b 100644
--- a/src/gui/text/qfontengine_qpf2.cpp
+++ b/src/gui/text/qfontengine_qpf2.cpp
@@ -140,9 +140,9 @@ static inline const uchar *verifyTag(const uchar *tagPtr, const uchar *endPtr)
}
#if defined(DEBUG_HEADER)
if (length == 1)
- qDebug() << "tag data" << hex << *tagPtr;
+ qDebug() << "tag data" << Qt::hex << *tagPtr;
else if (length == 4)
- qDebug() << "tag data" << hex << tagPtr[0] << tagPtr[1] << tagPtr[2] << tagPtr[3];
+ qDebug() << "tag data" << Qt::hex << tagPtr[0] << tagPtr[1] << tagPtr[2] << tagPtr[3];
#endif
}
return tagPtr + length;
@@ -367,7 +367,7 @@ bool QFontEngineQPF2::stringToCMap(const QChar *str, int len, QGlyphLayout *glyp
#if 0 && defined(DEBUG_FONTENGINE)
QChar c(uc);
if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c))
- qDebug() << "glyph for character" << c << '/' << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
+ qDebug() << "glyph for character" << c << '/' << Qt::hex << uc << "is" << Qt::dec << glyphs[glyph_pos].glyph;
seenGlyphs.insert(c);
#endif
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index c8dc8d676e..d3e4f11e8c 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -185,11 +185,9 @@ QFontMetrics::QFontMetrics(const QFont &font, const QPaintDevice *paintdevice)
#endif
{
const int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi();
- const int screen = 0;
- if (font.d->dpi != dpi || font.d->screen != screen ) {
+ if (font.d->dpi != dpi) {
d = new QFontPrivate(*font.d);
d->dpi = dpi;
- d->screen = screen;
} else {
d = font.d;
}
@@ -1036,8 +1034,15 @@ int QFontMetrics::lineWidth() const
return qRound(engine->lineThickness());
}
+/*!
+ \since 5.14
-
+ Returns the font DPI.
+*/
+qreal QFontMetrics::fontDpi() const
+{
+ return d->dpi;
+}
/*****************************************************************************
QFontMetricsF member functions
@@ -1171,11 +1176,9 @@ QFontMetricsF::QFontMetricsF(const QFont &font, const QPaintDevice *paintdevice)
#endif
{
int dpi = paintdevice ? paintdevice->logicalDpiY() : qt_defaultDpi();
- const int screen = 0;
- if (font.d->dpi != dpi || font.d->screen != screen ) {
+ if (font.d->dpi != dpi) {
d = new QFontPrivate(*font.d);
d->dpi = dpi;
- d->screen = screen;
} else {
d = font.d;
}
@@ -1913,4 +1916,14 @@ qreal QFontMetricsF::lineWidth() const
return engine->lineThickness().toReal();
}
+/*!
+ \since 5.14
+
+ Returns the font DPI.
+*/
+qreal QFontMetricsF::fontDpi() const
+{
+ return d->dpi;
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index 61931fa9bc..e92a1514a1 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -76,12 +76,10 @@ public:
~QFontMetrics();
QFontMetrics &operator=(const QFontMetrics &);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QFontMetrics &operator=(QFontMetrics &&other) Q_DECL_NOEXCEPT
+ inline QFontMetrics &operator=(QFontMetrics &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- void swap(QFontMetrics &other) Q_DECL_NOEXCEPT
+ void swap(QFontMetrics &other) noexcept
{ qSwap(d, other.d); }
int ascent() const;
@@ -137,6 +135,8 @@ public:
int strikeOutPos() const;
int lineWidth() const;
+ qreal fontDpi() const;
+
bool operator==(const QFontMetrics &other) const;
inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); }
@@ -172,12 +172,10 @@ public:
QFontMetricsF &operator=(const QFontMetricsF &);
QFontMetricsF &operator=(const QFontMetrics &);
-#ifdef Q_COMPILER_RVALUE_REFS
- inline QFontMetricsF &operator=(QFontMetricsF &&other)
+ inline QFontMetricsF &operator=(QFontMetricsF &&other) noexcept
{ qSwap(d, other.d); return *this; }
-#endif
- void swap(QFontMetricsF &other) { qSwap(d, other.d); }
+ void swap(QFontMetricsF &other) noexcept { qSwap(d, other.d); }
qreal ascent() const;
qreal capHeight() const;
@@ -220,6 +218,8 @@ public:
qreal strikeOutPos() const;
qreal lineWidth() const;
+ qreal fontDpi() const;
+
bool operator==(const QFontMetricsF &other) const;
inline bool operator !=(const QFontMetricsF &other) const { return !operator==(other); }
diff --git a/src/gui/text/qfragmentmap_p.h b/src/gui/text/qfragmentmap_p.h
index 35f60ac961..1d781352f8 100644
--- a/src/gui/text/qfragmentmap_p.h
+++ b/src/gui/text/qfragmentmap_p.h
@@ -216,7 +216,7 @@ private:
template <class Fragment>
QFragmentMapData<Fragment>::QFragmentMapData()
- : fragments(0)
+ : fragments(nullptr)
{
init();
}
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index bd44e11dce..3c16c3bf62 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -137,7 +137,7 @@ QGlyphRun::~QGlyphRun()
*/
void QGlyphRun::detach()
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
d.detach();
}
diff --git a/src/gui/text/qglyphrun.h b/src/gui/text/qglyphrun.h
index 6182c4f749..15e315bea2 100644
--- a/src/gui/text/qglyphrun.h
+++ b/src/gui/text/qglyphrun.h
@@ -66,13 +66,11 @@ public:
QGlyphRun();
QGlyphRun(const QGlyphRun &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QGlyphRun &operator=(QGlyphRun &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QGlyphRun &operator=(QGlyphRun &&other) noexcept { swap(other); return *this; }
QGlyphRun &operator=(const QGlyphRun &other);
~QGlyphRun();
- void swap(QGlyphRun &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QGlyphRun &other) noexcept { qSwap(d, other.d); }
QRawFont rawFont() const;
void setRawFont(const QRawFont &rawFont);
diff --git a/src/gui/text/qglyphrun_p.h b/src/gui/text/qglyphrun_p.h
index 5b6bdad648..465c3c7000 100644
--- a/src/gui/text/qglyphrun_p.h
+++ b/src/gui/text/qglyphrun_p.h
@@ -65,7 +65,7 @@ class QGlyphRunPrivate: public QSharedData
{
public:
QGlyphRunPrivate()
- : flags(0)
+ : flags(nullptr)
, glyphIndexData(glyphIndexes.constData())
, glyphIndexDataSize(0)
, glyphPositionData(glyphPositions.constData())
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index a911014a19..90322b24da 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -60,6 +60,7 @@ void qt_registerFont(const QString &familyname, const QString &stylename,
void qt_registerFontFamily(const QString &familyName);
void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias);
+bool qt_isFontFamilyPopulated(const QString &familyName);
/*!
Registers the pre-rendered QPF2 font contained in the given \a dataArray.
@@ -234,7 +235,7 @@ QSupportedWritingSystems::~QSupportedWritingSystems()
*/
void QSupportedWritingSystems::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QWritingSystemsPrivate *newd = new QWritingSystemsPrivate(d);
if (!d->ref.deref())
delete d;
@@ -666,6 +667,16 @@ void QPlatformFontDatabase::registerAliasToFontFamily(const QString &familyName,
}
/*!
+ Helper function that returns true if the font family has already been registered and populated.
+
+ \since 5.14
+*/
+bool QPlatformFontDatabase::isFamilyPopulated(const QString &familyName)
+{
+ return qt_isFontFamilyPopulated(familyName);
+}
+
+/*!
\class QPlatformFontDatabase
\since 5.0
\internal
diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h
index f4558129a7..f79c5db625 100644
--- a/src/gui/text/qplatformfontdatabase.h
+++ b/src/gui/text/qplatformfontdatabase.h
@@ -104,7 +104,7 @@ class Q_GUI_EXPORT QPlatformFontDatabase
public:
virtual ~QPlatformFontDatabase();
virtual void populateFontDatabase();
- virtual bool populateFamilyAliases() { return false; }
+ virtual bool populateFamilyAliases(const QString &missingFamily) { Q_UNUSED(missingFamily); return false; }
virtual void populateFamily(const QString &familyName);
virtual void invalidate();
@@ -139,6 +139,8 @@ public:
static void registerFontFamily(const QString &familyName);
static void registerAliasToFontFamily(const QString &familyName, const QString &alias);
+
+ static bool isFamilyPopulated(const QString &familyName);
};
QT_END_NAMESPACE
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index b2d8bf01af..a060448924 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -322,7 +322,7 @@ bool QRawFont::operator==(const QRawFont &other) const
\relates QRawFont
\since 5.8
*/
-uint qHash(const QRawFont &font, uint seed) Q_DECL_NOTHROW
+uint qHash(const QRawFont &font, uint seed) noexcept
{
return qHash(QRawFontPrivate::get(font)->fontEngine, seed);
}
diff --git a/src/gui/text/qrawfont.h b/src/gui/text/qrawfont.h
index 470f2694e4..c6289d6c93 100644
--- a/src/gui/text/qrawfont.h
+++ b/src/gui/text/qrawfont.h
@@ -79,13 +79,11 @@ public:
qreal pixelSize,
QFont::HintingPreference hintingPreference = QFont::PreferDefaultHinting);
QRawFont(const QRawFont &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QRawFont &operator=(QRawFont &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QRawFont &operator=(QRawFont &&other) noexcept { swap(other); return *this; }
QRawFont &operator=(const QRawFont &other);
~QRawFont();
- void swap(QRawFont &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QRawFont &other) noexcept { qSwap(d, other.d); }
bool isValid() const;
@@ -158,7 +156,7 @@ Q_DECLARE_SHARED(QRawFont)
Q_DECLARE_OPERATORS_FOR_FLAGS(QRawFont::LayoutFlags)
-Q_GUI_EXPORT uint qHash(const QRawFont &font, uint seed = 0) Q_DECL_NOTHROW;
+Q_GUI_EXPORT uint qHash(const QRawFont &font, uint seed = 0) noexcept;
inline QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32> &glyphIndexes, QRawFont::LayoutFlags layoutFlags) const
{
diff --git a/src/gui/text/qrawfont_p.h b/src/gui/text/qrawfont_p.h
index 0fc8739bfb..03259a94ed 100644
--- a/src/gui/text/qrawfont_p.h
+++ b/src/gui/text/qrawfont_p.h
@@ -67,9 +67,9 @@ class Q_GUI_EXPORT QRawFontPrivate
{
public:
QRawFontPrivate()
- : fontEngine(0)
+ : fontEngine(nullptr)
, hintingPreference(QFont::PreferDefaultHinting)
- , thread(0)
+ , thread(nullptr)
{}
QRawFontPrivate(const QRawFontPrivate &other)
@@ -78,53 +78,53 @@ public:
, thread(other.thread)
{
#ifndef QT_NO_DEBUG
- Q_ASSERT(fontEngine == 0 || thread == QThread::currentThread());
+ Q_ASSERT(fontEngine == nullptr || thread == QThread::currentThread());
#endif
- if (fontEngine != 0)
+ if (fontEngine != nullptr)
fontEngine->ref.ref();
}
~QRawFontPrivate()
{
#ifndef QT_NO_DEBUG
- Q_ASSERT(ref.load() == 0);
+ Q_ASSERT(ref.loadRelaxed() == 0);
#endif
cleanUp();
}
inline void cleanUp()
{
- setFontEngine(0);
+ setFontEngine(nullptr);
hintingPreference = QFont::PreferDefaultHinting;
}
inline bool isValid() const
{
#ifndef QT_NO_DEBUG
- Q_ASSERT(fontEngine == 0 || thread == QThread::currentThread());
+ Q_ASSERT(fontEngine == nullptr || thread == QThread::currentThread());
#endif
- return fontEngine != 0;
+ return fontEngine != nullptr;
}
inline void setFontEngine(QFontEngine *engine)
{
#ifndef QT_NO_DEBUG
- Q_ASSERT(fontEngine == 0 || thread == QThread::currentThread());
+ Q_ASSERT(fontEngine == nullptr || thread == QThread::currentThread());
#endif
if (fontEngine == engine)
return;
- if (fontEngine != 0) {
+ if (fontEngine != nullptr) {
if (!fontEngine->ref.deref())
delete fontEngine;
#ifndef QT_NO_DEBUG
- thread = 0;
+ thread = nullptr;
#endif
}
fontEngine = engine;
- if (fontEngine != 0) {
+ if (fontEngine != nullptr) {
fontEngine->ref.ref();
#ifndef QT_NO_DEBUG
thread = QThread::currentThread();
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index dd894f4d32..490e0b6b8f 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -181,7 +181,7 @@ QStaticText::QStaticText(const QStaticText &other)
*/
QStaticText::~QStaticText()
{
- Q_ASSERT(!data || data->ref.load() >= 1);
+ Q_ASSERT(!data || data->ref.loadRelaxed() >= 1);
}
/*!
@@ -189,7 +189,7 @@ QStaticText::~QStaticText()
*/
void QStaticText::detach()
{
- if (data->ref.load() != 1)
+ if (data->ref.loadRelaxed() != 1)
data.detach();
}
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h
index ada0456b8f..e8c94a6add 100644
--- a/src/gui/text/qstatictext.h
+++ b/src/gui/text/qstatictext.h
@@ -64,13 +64,11 @@ public:
QStaticText();
explicit QStaticText(const QString &text);
QStaticText(const QStaticText &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QStaticText &operator=(QStaticText &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QStaticText &operator=(QStaticText &&other) noexcept { swap(other); return *this; }
QStaticText &operator=(const QStaticText &);
~QStaticText();
- void swap(QStaticText &other) Q_DECL_NOTHROW { qSwap(data, other.data); }
+ void swap(QStaticText &other) noexcept { qSwap(data, other.data); }
void setText(const QString &text);
QString text() const;
diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h
index 4ec09297c5..8d6792216d 100644
--- a/src/gui/text/qstatictext_p.h
+++ b/src/gui/text/qstatictext_p.h
@@ -80,7 +80,7 @@ class Q_GUI_EXPORT QStaticTextItem
public:
QStaticTextItem() : useBackendOptimizations(false),
userDataNeedsUpdate(0), usesRawFont(0),
- m_fontEngine(0), m_userData(0) {}
+ m_fontEngine(nullptr), m_userData(nullptr) {}
void setUserData(QStaticTextUserData *newUserData)
{
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 102a776ed3..cf584f6980 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -45,6 +45,7 @@
#include <private/qtextdocument_p.h>
#include <qtextlayout.h>
#include <qpointer.h>
+#include <qscopedvaluerollback.h>
#include <qtextobject.h>
#include <qtextcursor.h>
#include <qdebug.h>
@@ -68,14 +69,14 @@ public:
void reformatBlocks(int from, int charsRemoved, int charsAdded);
void reformatBlock(const QTextBlock &block);
- inline void rehighlight(QTextCursor &cursor, QTextCursor::MoveOperation operation) {
- inReformatBlocks = true;
+ inline void rehighlight(QTextCursor &cursor, QTextCursor::MoveOperation operation)
+ {
+ QScopedValueRollback<bool> bg(inReformatBlocks, true);
cursor.beginEditBlock();
int from = cursor.position();
cursor.movePosition(operation);
reformatBlocks(from, 0, cursor.position() - from);
cursor.endEditBlock();
- inReformatBlocks = false;
}
inline void _q_delayedRehighlight() {
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h
index 1a00b753ad..7cad3cc5e8 100644
--- a/src/gui/text/qtextcursor.h
+++ b/src/gui/text/qtextcursor.h
@@ -73,13 +73,11 @@ public:
explicit QTextCursor(QTextFrame *frame);
explicit QTextCursor(const QTextBlock &block);
QTextCursor(const QTextCursor &cursor);
-#ifdef Q_COMPILER_RVALUE_REFS
- QTextCursor &operator=(QTextCursor &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QTextCursor &operator=(QTextCursor &&other) noexcept { swap(other); return *this; }
QTextCursor &operator=(const QTextCursor &other);
~QTextCursor();
- void swap(QTextCursor &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QTextCursor &other) noexcept { qSwap(d, other.d); }
bool isNull() const;
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 2c677dffe0..e94f635651 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -70,6 +70,12 @@
#include <private/qabstracttextdocumentlayout_p.h>
#include "qpagedpaintdevice.h"
#include "private/qpagedpaintdevice_p.h"
+#if QT_CONFIG(textmarkdownreader)
+#include <private/qtextmarkdownimporter_p.h>
+#endif
+#if QT_CONFIG(textmarkdownwriter)
+#include <private/qtextmarkdownwriter_p.h>
+#endif
#include <limits.h>
@@ -1964,9 +1970,12 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
QRectF body = QRectF(QPointF(0, 0), d->pageSize);
QPointF pageNumberPos;
+ qreal sourceDpiX = qt_defaultDpiX();
+ qreal sourceDpiY = qt_defaultDpiY();
+ const qreal dpiScaleX = qreal(printer->logicalDpiX()) / sourceDpiX;
+ const qreal dpiScaleY = qreal(printer->logicalDpiY()) / sourceDpiY;
+
if (documentPaginated) {
- qreal sourceDpiX = qt_defaultDpi();
- qreal sourceDpiY = sourceDpiX;
QPaintDevice *dev = doc->documentLayout()->paintDevice();
if (dev) {
@@ -1974,9 +1983,6 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
sourceDpiY = dev->logicalDpiY();
}
- const qreal dpiScaleX = qreal(printer->logicalDpiX()) / sourceDpiX;
- const qreal dpiScaleY = qreal(printer->logicalDpiY()) / sourceDpiY;
-
// scale to dpi
p.scale(dpiScaleX, dpiScaleY);
@@ -2005,15 +2011,21 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
// copy the custom object handlers
layout->d_func()->handlers = documentLayout()->d_func()->handlers;
- int dpiy = p.device()->logicalDpiY();
- int margin = (int) ((2/2.54)*dpiy); // 2 cm margins
+ // 2 cm margins, scaled to device in QTextDocumentLayoutPrivate::layoutFrame
+ const int horizontalMargin = int((2/2.54)*sourceDpiX);
+ const int verticalMargin = int((2/2.54)*sourceDpiY);
QTextFrameFormat fmt = doc->rootFrame()->frameFormat();
- fmt.setMargin(margin);
+ fmt.setLeftMargin(horizontalMargin);
+ fmt.setRightMargin(horizontalMargin);
+ fmt.setTopMargin(verticalMargin);
+ fmt.setBottomMargin(verticalMargin);
doc->rootFrame()->setFrameFormat(fmt);
+ // pageNumberPos must be in device coordinates, so scale to device here
+ const int dpiy = p.device()->logicalDpiY();
body = QRectF(0, 0, printer->width(), printer->height());
- pageNumberPos = QPointF(body.width() - margin,
- body.height() - margin
+ pageNumberPos = QPointF(body.width() - horizontalMargin * dpiScaleX,
+ body.height() - verticalMargin * dpiScaleY
+ QFontMetrics(doc->defaultFont(), p.device()).ascent()
+ 5 * dpiy / 72.0);
clonedDoc->setPageSize(body.size());
@@ -2061,8 +2073,9 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
\enum QTextDocument::ResourceType
This enum describes the types of resources that can be loaded by
- QTextDocument's loadResource() function.
+ QTextDocument's loadResource() function or by QTextBrowser::setSource().
+ \value UnknownResource No resource is loaded, or the resource type is not known.
\value HtmlResource The resource contains HTML.
\value ImageResource The resource contains image data.
Currently supported data types are QVariant::Pixmap and
@@ -2072,10 +2085,11 @@ void QTextDocument::print(QPagedPaintDevice *printer) const
The icon needs to be converted to one of the supported types first,
for example using QIcon::pixmap.
\value StyleSheetResource The resource contains CSS.
+ \value MarkdownResource The resource contains Markdown.
\value UserResource The first available value for user defined
resource types.
- \sa loadResource()
+ \sa loadResource(), QTextBrowser::sourceType()
*/
/*!
@@ -2471,9 +2485,19 @@ bool QTextHtmlExporter::emitCharFormatStyle(const QTextCharFormat &format)
if (format.foreground() != defaultCharFormat.foreground()
&& format.foreground().style() != Qt::NoBrush) {
- html += QLatin1String(" color:");
- html += colorValue(format.foreground().color());
- html += QLatin1Char(';');
+ QBrush brush = format.foreground();
+ if (brush.style() == Qt::TexturePattern) {
+ const bool isPixmap = qHasPixmapTexture(brush);
+ const qint64 cacheKey = isPixmap ? brush.texture().cacheKey() : brush.textureImage().cacheKey();
+
+ html += QLatin1String(" -qt-fg-texture-cachekey:");
+ html += QString::number(cacheKey);
+ html += QLatin1String(";");
+ } else {
+ html += QLatin1String(" color:");
+ html += colorValue(brush.color());
+ html += QLatin1Char(';');
+ }
attributesEmitted = true;
}
@@ -2576,51 +2600,43 @@ void QTextHtmlExporter::emitFloatStyle(QTextFrameFormat::Position pos, StyleMode
html += QLatin1Char('\"');
}
-void QTextHtmlExporter::emitBorderStyle(QTextFrameFormat::BorderStyle style)
+static QLatin1String richtextBorderStyleToHtmlBorderStyle(QTextFrameFormat::BorderStyle style)
{
- Q_ASSERT(style <= QTextFrameFormat::BorderStyle_Outset);
-
- html += QLatin1String(" border-style:");
-
switch (style) {
case QTextFrameFormat::BorderStyle_None:
- html += QLatin1String("none");
- break;
+ return QLatin1String("none");
case QTextFrameFormat::BorderStyle_Dotted:
- html += QLatin1String("dotted");
- break;
+ return QLatin1String("dotted");
case QTextFrameFormat::BorderStyle_Dashed:
- html += QLatin1String("dashed");
- break;
+ return QLatin1String("dashed");
case QTextFrameFormat::BorderStyle_Solid:
- html += QLatin1String("solid");
- break;
+ return QLatin1String("solid");
case QTextFrameFormat::BorderStyle_Double:
- html += QLatin1String("double");
- break;
+ return QLatin1String("double");
case QTextFrameFormat::BorderStyle_DotDash:
- html += QLatin1String("dot-dash");
- break;
+ return QLatin1String("dot-dash");
case QTextFrameFormat::BorderStyle_DotDotDash:
- html += QLatin1String("dot-dot-dash");
- break;
+ return QLatin1String("dot-dot-dash");
case QTextFrameFormat::BorderStyle_Groove:
- html += QLatin1String("groove");
- break;
+ return QLatin1String("groove");
case QTextFrameFormat::BorderStyle_Ridge:
- html += QLatin1String("ridge");
- break;
+ return QLatin1String("ridge");
case QTextFrameFormat::BorderStyle_Inset:
- html += QLatin1String("inset");
- break;
+ return QLatin1String("inset");
case QTextFrameFormat::BorderStyle_Outset:
- html += QLatin1String("outset");
- break;
+ return QLatin1String("outset");
default:
- Q_ASSERT(false);
- break;
+ Q_UNREACHABLE();
};
+ return QLatin1String("");
+}
+void QTextHtmlExporter::emitBorderStyle(QTextFrameFormat::BorderStyle style)
+{
+ Q_ASSERT(style <= QTextFrameFormat::BorderStyle_Outset);
+
+ html += QLatin1String(" border-style:");
+ html += richtextBorderStyleToHtmlBorderStyle(style);
html += QLatin1Char(';');
}
@@ -2733,6 +2749,12 @@ void QTextHtmlExporter::emitFragment(const QTextFragment &fragment)
if (imgFmt.hasProperty(QTextFormat::ImageName))
emitAttribute("src", imgFmt.name());
+ if (imgFmt.hasProperty(QTextFormat::ImageAltText))
+ emitAttribute("alt", imgFmt.stringProperty(QTextFormat::ImageAltText));
+
+ if (imgFmt.hasProperty(QTextFormat::ImageTitle))
+ emitAttribute("title", imgFmt.stringProperty(QTextFormat::ImageTitle));
+
if (imgFmt.hasProperty(QTextFormat::ImageWidth))
emitAttribute("width", QString::number(imgFmt.width()));
@@ -3181,6 +3203,33 @@ void QTextHtmlExporter::emitTable(const QTextTable *table)
if (cellFormat.hasProperty(QTextFormat::TableCellBottomPadding))
styleString += QLatin1String(" padding-bottom:") + QString::number(cellFormat.bottomPadding()) + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellTopBorder))
+ styleString += QLatin1String(" border-top:") + QString::number(cellFormat.topBorder()) + QLatin1String("px;");
+ if (cellFormat.hasProperty(QTextFormat::TableCellRightBorder))
+ styleString += QLatin1String(" border-right:") + QString::number(cellFormat.rightBorder()) + QLatin1String("px;");
+ if (cellFormat.hasProperty(QTextFormat::TableCellBottomBorder))
+ styleString += QLatin1String(" border-bottom:") + QString::number(cellFormat.bottomBorder()) + QLatin1String("px;");
+ if (cellFormat.hasProperty(QTextFormat::TableCellLeftBorder))
+ styleString += QLatin1String(" border-left:") + QString::number(cellFormat.leftBorder()) + QLatin1String("px;");
+
+ if (cellFormat.hasProperty(QTextFormat::TableCellTopBorderBrush))
+ styleString += QLatin1String(" border-top-color:") + cellFormat.topBorderBrush().color().name() + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellRightBorderBrush))
+ styleString += QLatin1String(" border-right-color:") + cellFormat.rightBorderBrush().color().name() + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellBottomBorderBrush))
+ styleString += QLatin1String(" border-bottom-color:") + cellFormat.bottomBorderBrush().color().name() + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellLeftBorderBrush))
+ styleString += QLatin1String(" border-left-color:") + cellFormat.leftBorderBrush().color().name() + QLatin1Char(';');
+
+ if (cellFormat.hasProperty(QTextFormat::TableCellTopBorderStyle))
+ styleString += QLatin1String(" border-top-style:") + richtextBorderStyleToHtmlBorderStyle(cellFormat.topBorderStyle()) + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellRightBorderStyle))
+ styleString += QLatin1String(" border-right-style:") + richtextBorderStyleToHtmlBorderStyle(cellFormat.rightBorderStyle()) + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellBottomBorderStyle))
+ styleString += QLatin1String(" border-bottom-style:") + richtextBorderStyleToHtmlBorderStyle(cellFormat.bottomBorderStyle()) + QLatin1Char(';');
+ if (cellFormat.hasProperty(QTextFormat::TableCellLeftBorderStyle))
+ styleString += QLatin1String(" border-left-style:") + richtextBorderStyleToHtmlBorderStyle(cellFormat.leftBorderStyle()) + QLatin1Char(';');
+
if (!styleString.isEmpty())
html += QLatin1String(" style=\"") + styleString + QLatin1Char('\"');
@@ -3287,6 +3336,9 @@ void QTextHtmlExporter::emitFrameStyle(const QTextFrameFormat &format, FrameType
QString::number(format.leftMargin()),
QString::number(format.rightMargin()));
+ if (format.property(QTextFormat::TableBorderCollapse).toBool())
+ html += QLatin1String(" border-collapse:collapse;");
+
if (html.length() == originalHtmlLength) // nothing emitted?
html.chop(styleAttribute.size());
else
@@ -3317,6 +3369,62 @@ QString QTextDocument::toHtml(const QByteArray &encoding) const
#endif // QT_NO_TEXTHTMLPARSER
/*!
+ \since 5.14
+ Returns a string containing a Markdown representation of the document with
+ the given \a features, or an empty string if writing fails for any reason.
+
+ \sa setMarkdown
+*/
+#if QT_CONFIG(textmarkdownwriter)
+QString QTextDocument::toMarkdown(QTextDocument::MarkdownFeatures features) const
+{
+ QString ret;
+ QTextStream s(&ret);
+ QTextMarkdownWriter w(s, features);
+ if (w.writeAll(this))
+ return ret;
+ return QString();
+}
+#endif
+
+/*!
+ \since 5.14
+ Replaces the entire contents of the document with the given
+ Markdown-formatted text in the \a markdown string, with the given
+ \a features supported. By default, all supported GitHub-style
+ Markdown features are included; pass \c MarkdownDialectCommonMark
+ for a more basic parse.
+
+ The Markdown formatting is respected as much as possible; for example,
+ "*bold* text" will produce text where the first word has a font weight that
+ gives it an emphasized appearance.
+
+ Parsing of HTML included in the \a markdown string is handled in the same
+ way as in \l setHtml; however, Markdown formatting inside HTML blocks is
+ not supported.
+
+ Some features of the parser can be enabled or disabled via the \a features
+ argument:
+
+ \value MarkdownNoHTML
+ Any HTML tags in the Markdown text will be discarded
+ \value MarkdownDialectCommonMark
+ The parser supports only the features standardized by CommonMark
+ \value MarkdownDialectGitHub
+ The parser supports the GitHub dialect
+
+ The default is \c MarkdownDialectGitHub.
+
+ The undo/redo history is reset when this function is called.
+*/
+#if QT_CONFIG(textmarkdownreader)
+void QTextDocument::setMarkdown(const QString &markdown, QTextDocument::MarkdownFeatures features)
+{
+ QTextMarkdownImporter(features).import(this, markdown);
+}
+#endif
+
+/*!
Returns a vector of text formats for all the formats used in the document.
*/
QVector<QTextFormat> QTextDocument::allFormats() const
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h
index c9b22e053b..7d46238257 100644
--- a/src/gui/text/qtextdocument.h
+++ b/src/gui/text/qtextdocument.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtGui module of the Qt Toolkit.
@@ -151,6 +151,24 @@ public:
void setHtml(const QString &html);
#endif
+#if QT_CONFIG(textmarkdownwriter) || QT_CONFIG(textmarkdownreader)
+ enum MarkdownFeature {
+ MarkdownNoHTML = 0x0020 | 0x0040,
+ MarkdownDialectCommonMark = 0,
+ MarkdownDialectGitHub = 0x0004 | 0x0008 | 0x0400 | 0x0100 | 0x0200 | 0x0800
+ };
+ Q_DECLARE_FLAGS(MarkdownFeatures, MarkdownFeature)
+ Q_FLAG(MarkdownFeatures)
+#endif
+
+#if QT_CONFIG(textmarkdownwriter)
+ QString toMarkdown(MarkdownFeatures features = MarkdownDialectGitHub) const;
+#endif
+
+#if QT_CONFIG(textmarkdownreader)
+ void setMarkdown(const QString &markdown, MarkdownFeatures features = MarkdownDialectGitHub);
+#endif
+
QString toRawText() const;
QString toPlainText() const;
void setPlainText(const QString &text);
@@ -206,12 +224,15 @@ public:
void print(QPagedPaintDevice *printer) const;
enum ResourceType {
+ UnknownResource = 0,
HtmlResource = 1,
ImageResource = 2,
StyleSheetResource = 3,
+ MarkdownResource = 4,
UserResource = 100
};
+ Q_ENUM(ResourceType)
QVariant resource(int type, const QUrl &name) const;
void addResource(int type, const QUrl &name, const QVariant &resource);
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index 6e535c12b3..a1b1c2e92b 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -40,6 +40,7 @@
#include <private/qtools_p.h>
#include <qdebug.h>
+#include <qscopedvaluerollback.h>
#include "qtextdocument_p.h"
#include "qtextdocument.h"
#include <qtextformat.h>
@@ -274,9 +275,10 @@ void QTextDocumentPrivate::clear()
rtFrame = 0;
init();
cursors = oldCursors;
- inContentsChange = true;
- emit q->contentsChange(0, len, 0);
- inContentsChange = false;
+ {
+ QScopedValueRollback<bool> bg(inContentsChange, true);
+ emit q->contentsChange(0, len, 0);
+ }
if (lout)
lout->documentChanged(0, len, 0);
} QT_CATCH(...) {
@@ -309,9 +311,10 @@ void QTextDocumentPrivate::setLayout(QAbstractTextDocumentLayout *layout)
it->free();
emit q->documentLayoutChanged();
- inContentsChange = true;
- emit q->contentsChange(0, 0, length());
- inContentsChange = false;
+ {
+ QScopedValueRollback<bool> bg(inContentsChange, true);
+ emit q->contentsChange(0, 0, length());
+ }
if (lout)
lout->documentChanged(0, 0, length());
}
@@ -1212,9 +1215,8 @@ void QTextDocumentPrivate::finishEdit()
if (lout && docChangeFrom >= 0) {
if (!inContentsChange) {
- inContentsChange = true;
+ QScopedValueRollback<bool> bg(inContentsChange, true);
emit q->contentsChange(docChangeFrom, docChangeOldLength, docChangeLength);
- inContentsChange = false;
}
lout->documentChanged(docChangeFrom, docChangeOldLength, docChangeLength);
}
diff --git a/src/gui/text/qtextdocument_p.h b/src/gui/text/qtextdocument_p.h
index d668066091..f4e7a25f22 100644
--- a/src/gui/text/qtextdocument_p.h
+++ b/src/gui/text/qtextdocument_p.h
@@ -101,10 +101,10 @@ class QTextBlockData : public QFragment<3>
{
public:
inline void initialize()
- { layout = 0; userData = 0; userState = -1; revision = 0; hidden = 0; }
+ { layout = nullptr; userData = nullptr; userState = -1; revision = 0; hidden = 0; }
void invalidate() const;
inline void free()
- { delete layout; layout = 0; delete userData; userData = 0; }
+ { delete layout; layout = nullptr; delete userData; userData = nullptr; }
mutable int format;
// ##### probably store a QTextEngine * here!
@@ -339,6 +339,7 @@ private:
int lastBlockCount;
public:
+ bool inContentsChange;
QTextOption defaultTextOption;
Qt::CursorMoveStyle defaultCursorMoveStyle;
#ifndef QT_NO_CSSPARSER
@@ -346,7 +347,6 @@ public:
#endif
int maximumBlockCount;
uint needsEnsureMaximumBlockCount : 1;
- uint inContentsChange : 1;
uint blockCursorAdjustment : 1;
QSizeF pageSize;
QString title;
@@ -357,6 +357,7 @@ public:
void mergeCachedResources(const QTextDocumentPrivate *priv);
+ friend struct QTextHtmlParserNode;
friend class QTextHtmlExporter;
friend class QTextCursor;
};
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index aef4ea1522..742c56382d 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -576,6 +576,9 @@ bool QTextHtmlImporter::appendNodeText()
&& ch != QChar::Nbsp
&& ch != QChar::ParagraphSeparator) {
+ if (wsm == QTextHtmlParserNode::WhiteSpacePreLine && (ch == QLatin1Char('\n') || ch == QLatin1Char('\r')))
+ compressNextWhitespace = PreserveWhiteSpace;
+
if (compressNextWhitespace == CollapseWhiteSpace)
compressNextWhitespace = RemoveWhiteSpace; // allow this one, and remove the ones coming next.
else if(compressNextWhitespace == RemoveWhiteSpace)
@@ -592,7 +595,9 @@ bool QTextHtmlImporter::appendNodeText()
}
} else if (wsm != QTextHtmlParserNode::WhiteSpacePreWrap) {
compressNextWhitespace = RemoveWhiteSpace;
- if (wsm == QTextHtmlParserNode::WhiteSpaceNoWrap)
+ if (wsm == QTextHtmlParserNode::WhiteSpacePreLine && (ch == QLatin1Char('\n') || ch == QLatin1Char('\r')))
+ { }
+ else if (wsm == QTextHtmlParserNode::WhiteSpaceNoWrap)
ch = QChar::Nbsp;
else
ch = QLatin1Char(' ');
@@ -605,6 +610,8 @@ bool QTextHtmlImporter::appendNodeText()
|| ch == QChar::ParagraphSeparator) {
if (!textToInsert.isEmpty()) {
+ if (wsm == QTextHtmlParserNode::WhiteSpacePreLine && textToInsert.at(textToInsert.length() - 1) == QLatin1Char(' '))
+ textToInsert = textToInsert.chopped(1);
cursor.insertText(textToInsert, format);
textToInsert.clear();
}
@@ -715,6 +722,10 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processSpecialNodes()
case Html_img: {
QTextImageFormat fmt;
fmt.setName(currentNode->imageName);
+ if (!currentNode->text.isEmpty())
+ fmt.setProperty(QTextFormat::ImageTitle, currentNode->text);
+ if (!currentNode->imageAlt.isEmpty())
+ fmt.setProperty(QTextFormat::ImageAltText, currentNode->imageAlt);
fmt.merge(currentNode->charFormat);
@@ -975,6 +986,7 @@ QTextHtmlImporter::Table QTextHtmlImporter::scanTable(int tableNodeIdx)
tableFmt.setColumns(table.columns);
tableFmt.setColumnWidthConstraints(columnWidths);
tableFmt.setHeaderRowCount(tableHeaderRowCount);
+ tableFmt.setBorderCollapse(node.borderCollapse);
fmt = tableFmt;
}
@@ -1050,6 +1062,33 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode()
fmt.setLeftPadding(leftPadding(currentNodeIdx));
if (rightPadding(currentNodeIdx) >= 0)
fmt.setRightPadding(rightPadding(currentNodeIdx));
+#ifndef QT_NO_CSSPARSER
+ if (tableCellBorder(currentNodeIdx, QCss::TopEdge) > 0)
+ fmt.setTopBorder(tableCellBorder(currentNodeIdx, QCss::TopEdge));
+ if (tableCellBorder(currentNodeIdx, QCss::RightEdge) > 0)
+ fmt.setRightBorder(tableCellBorder(currentNodeIdx, QCss::RightEdge));
+ if (tableCellBorder(currentNodeIdx, QCss::BottomEdge) > 0)
+ fmt.setBottomBorder(tableCellBorder(currentNodeIdx, QCss::BottomEdge));
+ if (tableCellBorder(currentNodeIdx, QCss::LeftEdge) > 0)
+ fmt.setLeftBorder(tableCellBorder(currentNodeIdx, QCss::LeftEdge));
+ if (tableCellBorderStyle(currentNodeIdx, QCss::TopEdge) != QTextFrameFormat::BorderStyle_None)
+ fmt.setTopBorderStyle(tableCellBorderStyle(currentNodeIdx, QCss::TopEdge));
+ if (tableCellBorderStyle(currentNodeIdx, QCss::RightEdge) != QTextFrameFormat::BorderStyle_None)
+ fmt.setRightBorderStyle(tableCellBorderStyle(currentNodeIdx, QCss::RightEdge));
+ if (tableCellBorderStyle(currentNodeIdx, QCss::BottomEdge) != QTextFrameFormat::BorderStyle_None)
+ fmt.setBottomBorderStyle(tableCellBorderStyle(currentNodeIdx, QCss::BottomEdge));
+ if (tableCellBorderStyle(currentNodeIdx, QCss::LeftEdge) != QTextFrameFormat::BorderStyle_None)
+ fmt.setLeftBorderStyle(tableCellBorderStyle(currentNodeIdx, QCss::LeftEdge));
+ if (tableCellBorderBrush(currentNodeIdx, QCss::TopEdge) != Qt::NoBrush)
+ fmt.setTopBorderBrush(tableCellBorderBrush(currentNodeIdx, QCss::TopEdge));
+ if (tableCellBorderBrush(currentNodeIdx, QCss::RightEdge) != Qt::NoBrush)
+ fmt.setRightBorderBrush(tableCellBorderBrush(currentNodeIdx, QCss::RightEdge));
+ if (tableCellBorderBrush(currentNodeIdx, QCss::BottomEdge) != Qt::NoBrush)
+ fmt.setBottomBorderBrush(tableCellBorderBrush(currentNodeIdx, QCss::BottomEdge));
+ if (tableCellBorderBrush(currentNodeIdx, QCss::LeftEdge) != Qt::NoBrush)
+ fmt.setLeftBorderBrush(tableCellBorderBrush(currentNodeIdx, QCss::LeftEdge));
+#endif
+
cell.setFormat(fmt);
cursor.setPosition(cell.firstPosition());
diff --git a/src/gui/text/qtextdocumentfragment_p.h b/src/gui/text/qtextdocumentfragment_p.h
index de01a02fbb..67b0c2c600 100644
--- a/src/gui/text/qtextdocumentfragment_p.h
+++ b/src/gui/text/qtextdocumentfragment_p.h
@@ -125,7 +125,7 @@ public:
QTextHtmlImporter(QTextDocument *_doc, const QString &html,
ImportMode mode,
- const QTextDocument *resourceProvider = 0);
+ const QTextDocument *resourceProvider = nullptr);
void import();
@@ -163,7 +163,7 @@ private:
#endif
struct TableCellIterator
{
- inline TableCellIterator(QTextTable *t = 0) : table(t), row(0), column(0) {}
+ inline TableCellIterator(QTextTable *t = nullptr) : table(t), row(0), column(0) {}
inline TableCellIterator &operator++() {
if (atEnd())
@@ -182,7 +182,7 @@ private:
return *this;
}
- inline bool atEnd() const { return table == 0 || row >= table->rows(); }
+ inline bool atEnd() const { return table == nullptr || row >= table->rows(); }
QTextTableCell cell() const { return table->cellAt(row, column); }
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index 65cafc7bc2..ed23a4d8d9 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -155,6 +155,50 @@ struct QTextLayoutStruct {
{ if (pageHeight == QFIXED_MAX) return; pageBottom += pageHeight; y = qMax(y, pageBottom - pageHeight + pageBottomMargin + pageTopMargin - frameY); }
};
+#ifndef QT_NO_CSSPARSER
+// helper struct to collect edge data and priorize edges for border-collapse mode
+struct EdgeData {
+
+ enum EdgeClass {
+ // don't change order, used for comparison
+ ClassInvalid, // queried (adjacent) cell does not exist
+ ClassNone, // no explicit border, no grid, no table border
+ ClassGrid, // 1px grid if drawGrid is true
+ ClassTableBorder, // an outermost edge
+ ClassExplicit // set in cell's format
+ };
+
+ EdgeData(qreal width, const QTextTableCell &cell, QCss::Edge edge, EdgeClass edgeClass) :
+ width(width), cell(cell), edge(edge), edgeClass(edgeClass) {}
+ EdgeData() :
+ width(0), edge(QCss::NumEdges), edgeClass(ClassInvalid) {}
+
+ // used for priorization with qMax
+ bool operator< (const EdgeData &other) const {
+ if (width < other.width) return true;
+ if (width > other.width) return false;
+ if (edgeClass < other.edgeClass) return true;
+ if (edgeClass > other.edgeClass) return false;
+ if (edge == QCss::TopEdge && other.edge == QCss::BottomEdge) return true;
+ if (edge == QCss::BottomEdge && other.edge == QCss::TopEdge) return false;
+ if (edge == QCss::LeftEdge && other.edge == QCss::RightEdge) return true;
+ return false;
+ }
+ bool operator> (const EdgeData &other) const {
+ return other < *this;
+ }
+
+ qreal width;
+ QTextTableCell cell;
+ QCss::Edge edge;
+ EdgeClass edgeClass;
+};
+
+// axisEdgeData is referenced by QTextTableData's inline methods, so predeclare
+class QTextTableData;
+static inline EdgeData axisEdgeData(QTextTable *table, const QTextTableData *td, const QTextTableCell &cell, QCss::Edge edge);
+#endif
+
class QTextTableData : public QTextFrameData
{
public:
@@ -169,8 +213,19 @@ public:
QVector<QFixed> cellVerticalOffsets;
+ // without borderCollapse, those equal QTextFrameData::border;
+ // otherwise the widest outermost cell edge will be used
+ QFixed effectiveLeftBorder;
+ QFixed effectiveTopBorder;
+ QFixed effectiveRightBorder;
+ QFixed effectiveBottomBorder;
+
QFixed headerHeight;
+ QFixed borderCell; // 0 if borderCollapse is enabled, QTextFrameData::border otherwise
+ bool borderCollapse;
+ bool drawGrid;
+
// maps from cell index (row + col * rowCount) to child frames belonging to
// the specific cell
QMultiHash<int, QTextFrame *> childFrameMap;
@@ -182,7 +237,7 @@ public:
inline void calcRowPosition(int row)
{
if (row > 0)
- rowPositions[row] = rowPositions.at(row - 1) + heights.at(row - 1) + border + cellSpacing + border;
+ rowPositions[row] = rowPositions.at(row - 1) + heights.at(row - 1) + borderCell + cellSpacing + borderCell;
}
QRectF cellRect(const QTextTableCell &cell) const;
@@ -198,30 +253,67 @@ public:
}
}
- inline QFixed topPadding(const QTextFormat &format) const
+#ifndef QT_NO_CSSPARSER
+ inline QFixed cellBorderWidth(QTextTable *table, const QTextTableCell &cell, QCss::Edge edge) const
+ {
+ qreal rv = axisEdgeData(table, this, cell, edge).width;
+ if (borderCollapse)
+ rv /= 2; // each cell has to add half of the border's width to its own padding
+ return QFixed::fromReal(rv * deviceScale);
+ }
+#endif
+
+ inline QFixed topPadding(QTextTable *table, const QTextTableCell &cell) const
{
- return paddingProperty(format, QTextFormat::TableCellTopPadding);
+#ifdef QT_NO_CSSPARSER
+ Q_UNUSED(table);
+#endif
+ return paddingProperty(cell.format(), QTextFormat::TableCellTopPadding)
+#ifndef QT_NO_CSSPARSER
+ + cellBorderWidth(table, cell, QCss::TopEdge)
+#endif
+ ;
}
- inline QFixed bottomPadding(const QTextFormat &format) const
+ inline QFixed bottomPadding(QTextTable *table, const QTextTableCell &cell) const
{
- return paddingProperty(format, QTextFormat::TableCellBottomPadding);
+#ifdef QT_NO_CSSPARSER
+ Q_UNUSED(table);
+#endif
+ return paddingProperty(cell.format(), QTextFormat::TableCellBottomPadding)
+#ifndef QT_NO_CSSPARSER
+ + cellBorderWidth(table, cell, QCss::BottomEdge)
+#endif
+ ;
}
- inline QFixed leftPadding(const QTextFormat &format) const
+ inline QFixed leftPadding(QTextTable *table, const QTextTableCell &cell) const
{
- return paddingProperty(format, QTextFormat::TableCellLeftPadding);
+#ifdef QT_NO_CSSPARSER
+ Q_UNUSED(table);
+#endif
+ return paddingProperty(cell.format(), QTextFormat::TableCellLeftPadding)
+#ifndef QT_NO_CSSPARSER
+ + cellBorderWidth(table, cell, QCss::LeftEdge)
+#endif
+ ;
}
- inline QFixed rightPadding(const QTextFormat &format) const
+ inline QFixed rightPadding(QTextTable *table, const QTextTableCell &cell) const
{
- return paddingProperty(format, QTextFormat::TableCellRightPadding);
+#ifdef QT_NO_CSSPARSER
+ Q_UNUSED(table);
+#endif
+ return paddingProperty(cell.format(), QTextFormat::TableCellRightPadding)
+#ifndef QT_NO_CSSPARSER
+ + cellBorderWidth(table, cell, QCss::RightEdge)
+#endif
+ ;
}
- inline QFixedPoint cellPosition(const QTextTableCell &cell) const
+ inline QFixedPoint cellPosition(QTextTable *table, const QTextTableCell &cell) const
{
- const QTextFormat fmt = cell.format();
- return cellPosition(cell.row(), cell.column()) + QFixedPoint(leftPadding(fmt), topPadding(fmt));
+ return cellPosition(cell.row(), cell.column()) + QFixedPoint(leftPadding(table, cell), topPadding(table, cell));
}
void updateTableSize();
@@ -257,10 +349,10 @@ static bool isFrameFromInlineObject(QTextFrame *f)
void QTextTableData::updateTableSize()
{
- const QFixed effectiveTopMargin = this->topMargin + border + padding;
- const QFixed effectiveBottomMargin = this->bottomMargin + border + padding;
- const QFixed effectiveLeftMargin = this->leftMargin + border + padding;
- const QFixed effectiveRightMargin = this->rightMargin + border + padding;
+ const QFixed effectiveTopMargin = this->topMargin + effectiveTopBorder + padding;
+ const QFixed effectiveBottomMargin = this->bottomMargin + effectiveBottomBorder + padding;
+ const QFixed effectiveLeftMargin = this->leftMargin + effectiveLeftBorder + padding;
+ const QFixed effectiveRightMargin = this->rightMargin + effectiveRightBorder + padding;
size.height = contentsHeight == -1
? rowPositions.constLast() + heights.constLast() + padding + border + cellSpacing + effectiveBottomMargin
: effectiveTopMargin + contentsHeight + effectiveBottomMargin;
@@ -453,6 +545,7 @@ public:
const QTextBlock &bl, bool inRootFrame) const;
void drawListItem(const QPointF &offset, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context,
const QTextBlock &bl, const QTextCharFormat *selectionFormat) const;
+ void drawTableCellBorder(const QRectF &cellRect, QPainter *painter, QTextTable *table, QTextTableData *td, const QTextTableCell &cell) const;
void drawTableCell(const QRectF &cellRect, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &cell_context,
QTextTable *table, QTextTableData *td, int r, int c,
QTextBlock *cursorBlockNeedingRepaint, QPointF *cursorBlockOffset) const;
@@ -719,7 +812,7 @@ QTextDocumentLayoutPrivate::hitTest(QTextTable *table, const QFixedPoint &point,
*position = cell.firstPosition();
- HitPoint hp = hitTest(cell.begin(), PointInside, point - td->cellPosition(cell), position, l, accuracy);
+ HitPoint hp = hitTest(cell.begin(), PointInside, point - td->cellPosition(table, cell), position, l, accuracy);
if (hp == PointExact)
return hp;
@@ -798,12 +891,45 @@ QFixed QTextDocumentLayoutPrivate::blockIndent(const QTextBlockFormat &blockForm
return QFixed::fromReal(indent * scale * document->indentWidth());
}
+struct BorderPaginator
+{
+ BorderPaginator(QTextDocument *document, const QRectF &rect, qreal topMarginAfterPageBreak, qreal bottomMargin, qreal border) :
+ pageHeight(document->pageSize().height()),
+ topPage(pageHeight > 0 ? static_cast<int>(rect.top() / pageHeight) : 0),
+ bottomPage(pageHeight > 0 ? static_cast<int>((rect.bottom() + border) / pageHeight) : 0),
+ rect(rect),
+ topMarginAfterPageBreak(topMarginAfterPageBreak),
+ bottomMargin(bottomMargin), border(border)
+ {}
+
+ QRectF clipRect(int page) const
+ {
+ QRectF clipped = rect.toRect();
+
+ if (topPage != bottomPage) {
+ clipped.setTop(qMax(clipped.top(), page * pageHeight + topMarginAfterPageBreak - border));
+ clipped.setBottom(qMin(clipped.bottom(), (page + 1) * pageHeight - bottomMargin));
+
+ if (clipped.bottom() <= clipped.top())
+ return QRectF();
+ }
+
+ return clipped;
+ }
+
+ qreal pageHeight;
+ int topPage;
+ int bottomPage;
+ QRectF rect;
+ qreal topMarginAfterPageBreak;
+ qreal bottomMargin;
+ qreal border;
+};
+
void QTextDocumentLayoutPrivate::drawBorder(QPainter *painter, const QRectF &rect, qreal topMargin, qreal bottomMargin,
qreal border, const QBrush &brush, QTextFrameFormat::BorderStyle style) const
{
- const qreal pageHeight = document->pageSize().height();
- const int topPage = pageHeight > 0 ? static_cast<int>(rect.top() / pageHeight) : 0;
- const int bottomPage = pageHeight > 0 ? static_cast<int>((rect.bottom() + border) / pageHeight) : 0;
+ BorderPaginator paginator(document, rect, topMargin, bottomMargin, border);
#ifndef QT_NO_CSSPARSER
QCss::BorderStyle cssStyle = static_cast<QCss::BorderStyle>(style + 1);
@@ -814,16 +940,11 @@ void QTextDocumentLayoutPrivate::drawBorder(QPainter *painter, const QRectF &rec
bool turn_off_antialiasing = !(painter->renderHints() & QPainter::Antialiasing);
painter->setRenderHint(QPainter::Antialiasing);
- for (int i = topPage; i <= bottomPage; ++i) {
- QRectF clipped = rect.toRect();
-
- if (topPage != bottomPage) {
- clipped.setTop(qMax(clipped.top(), i * pageHeight + topMargin - border));
- clipped.setBottom(qMin(clipped.bottom(), (i + 1) * pageHeight - bottomMargin));
+ for (int i = paginator.topPage; i <= paginator.bottomPage; ++i) {
+ QRectF clipped = paginator.clipRect(i);
+ if (!clipped.isValid())
+ continue;
- if (clipped.bottom() <= clipped.top())
- continue;
- }
#ifndef QT_NO_CSSPARSER
qDrawEdge(painter, clipped.left(), clipped.top(), clipped.left() + border, clipped.bottom() + border, 0, 0, QCss::LeftEdge, cssStyle, brush);
qDrawEdge(painter, clipped.left() + border, clipped.top(), clipped.right() + border, clipped.top() + border, 0, 0, QCss::TopEdge, cssStyle, brush);
@@ -920,6 +1041,38 @@ static void adjustContextSelectionsForCell(QAbstractTextDocumentLayout::PaintCon
}
}
+static bool cellClipTest(QTextTable *table, QTextTableData *td,
+ const QAbstractTextDocumentLayout::PaintContext &cell_context,
+ const QTextTableCell &cell,
+ QRectF cellRect)
+{
+#ifdef QT_NO_CSSPARSER
+ Q_UNUSED(table);
+ Q_UNUSED(cell);
+#endif
+
+ if (!cell_context.clip.isValid())
+ return false;
+
+ if (td->borderCollapse) {
+ // we need to account for the cell borders in the clipping test
+#ifndef QT_NO_CSSPARSER
+ cellRect.adjust(-axisEdgeData(table, td, cell, QCss::LeftEdge).width / 2,
+ -axisEdgeData(table, td, cell, QCss::TopEdge).width / 2,
+ axisEdgeData(table, td, cell, QCss::RightEdge).width / 2,
+ axisEdgeData(table, td, cell, QCss::BottomEdge).width / 2);
+#endif
+ } else {
+ qreal border = td->border.toReal();
+ cellRect.adjust(-border, -border, border, border);
+ }
+
+ if (!cellRect.intersects(cell_context.clip))
+ return true;
+
+ return false;
+}
+
void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *painter,
const QAbstractTextDocumentLayout::PaintContext &context,
QTextFrame *frame) const
@@ -931,7 +1084,10 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
Q_ASSERT(!fd->sizeDirty);
Q_ASSERT(!fd->layoutDirty);
- const QPointF off = offset + fd->position.toPointF();
+ // floor the offset to avoid painting artefacts when drawing adjacent borders
+ // we later also round table cell heights and widths
+ const QPointF off = QPointF(QPointF(offset + fd->position.toPointF()).toPoint());
+
if (context.clip.isValid()
&& (off.y() > context.clip.bottom() || off.y() + fd->size.height.toReal() < context.clip.top()
|| off.x() > context.clip.right() || off.x() + fd->size.width.toReal() < context.clip.left()))
@@ -979,10 +1135,12 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
const int tableStartPage = (absYPos / pageHeight).truncate();
const int tableEndPage = ((absYPos + td->size.height) / pageHeight).truncate();
- qreal border = td->border.toReal();
- drawFrameDecoration(painter, frame, fd, context.clip, frameRect);
+ // for borderCollapse draw frame decoration by drawing the outermost
+ // cell edges with width = td->border
+ if (!td->borderCollapse)
+ drawFrameDecoration(painter, frame, fd, context.clip, frameRect);
- // draw the table headers
+ // draw the repeated table headers for table continuation after page breaks
const int headerRowCount = qMin(table->format().headerRowCount(), rows - 1);
int page = tableStartPage + 1;
while (page <= tableEndPage) {
@@ -996,9 +1154,7 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
QRectF cellRect = td->cellRect(cell);
cellRect.translate(off.x(), headerOffset);
- // we need to account for the cell border in the clipping test
- int leftAdjust = qMin(qreal(0), 1 - border);
- if (cell_context.clip.isValid() && !cellRect.adjusted(leftAdjust, leftAdjust, border, border).intersects(cell_context.clip))
+ if (cellClipTest(table, td, cell_context, cell, cellRect))
continue;
drawTableCell(cellRect, painter, cell_context, table, td, r, c, &cursorBlockNeedingRepaint,
@@ -1038,9 +1194,7 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
QRectF cellRect = td->cellRect(cell);
cellRect.translate(off);
- // we need to account for the cell border in the clipping test
- int leftAdjust = qMin(qreal(0), 1 - border);
- if (cell_context.clip.isValid() && !cellRect.adjusted(leftAdjust, leftAdjust, border, border).intersects(cell_context.clip))
+ if (cellClipTest(table, td, cell_context, cell, cellRect))
continue;
drawTableCell(cellRect, painter, cell_context, table, td, r, c, &cursorBlockNeedingRepaint,
@@ -1077,6 +1231,602 @@ void QTextDocumentLayoutPrivate::drawFrame(const QPointF &offset, QPainter *pain
return;
}
+#ifndef QT_NO_CSSPARSER
+
+static inline QTextFormat::Property borderPropertyForEdge(QCss::Edge edge)
+{
+ switch (edge) {
+ case QCss::TopEdge:
+ return QTextFormat::TableCellTopBorder;
+ case QCss::BottomEdge:
+ return QTextFormat::TableCellBottomBorder;
+ case QCss::LeftEdge:
+ return QTextFormat::TableCellLeftBorder;
+ case QCss::RightEdge:
+ return QTextFormat::TableCellRightBorder;
+ default:
+ Q_UNREACHABLE();
+ return QTextFormat::UserProperty;
+ }
+}
+
+static inline QTextFormat::Property borderStylePropertyForEdge(QCss::Edge edge)
+{
+ switch (edge) {
+ case QCss::TopEdge:
+ return QTextFormat::TableCellTopBorderStyle;
+ case QCss::BottomEdge:
+ return QTextFormat::TableCellBottomBorderStyle;
+ case QCss::LeftEdge:
+ return QTextFormat::TableCellLeftBorderStyle;
+ case QCss::RightEdge:
+ return QTextFormat::TableCellRightBorderStyle;
+ default:
+ Q_UNREACHABLE();
+ return QTextFormat::UserProperty;
+ }
+}
+
+static inline QCss::Edge adjacentEdge(QCss::Edge edge)
+{
+ switch (edge) {
+ case QCss::TopEdge:
+ return QCss::BottomEdge;
+ case QCss::RightEdge:
+ return QCss::LeftEdge;
+ case QCss::BottomEdge:
+ return QCss::TopEdge;
+ case QCss::LeftEdge:
+ return QCss::RightEdge;
+ default:
+ Q_UNREACHABLE();
+ return QCss::NumEdges;
+ }
+}
+
+static inline bool isSameAxis(QCss::Edge e1, QCss::Edge e2)
+{
+ return e1 == e2 || e1 == adjacentEdge(e2);
+}
+
+static inline bool isVerticalAxis(QCss::Edge e)
+{
+ return e % 2 > 0;
+}
+
+static inline QTextTableCell adjacentCell(QTextTable *table, const QTextTableCell &cell,
+ QCss::Edge edge)
+{
+ int dc = 0;
+ int dr = 0;
+
+ switch (edge) {
+ case QCss::LeftEdge:
+ dc = -1;
+ break;
+ case QCss::RightEdge:
+ dc = cell.columnSpan();
+ break;
+ case QCss::TopEdge:
+ dr = -1;
+ break;
+ case QCss::BottomEdge:
+ dr = cell.rowSpan();
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+
+ // get sibling cell
+ int col = cell.column() + dc;
+ int row = cell.row() + dr;
+
+ if (col < 0 || row < 0 || col >= table->columns() || row >= table->rows())
+ return QTextTableCell();
+ else
+ return table->cellAt(cell.row() + dr, cell.column() + dc);
+}
+
+// returns true if the specified edges of both cells
+// are "one the same line" aka axis.
+//
+// | C0
+// |-----|-----|----|----- < "axis"
+// | C1 | C2 | C3 | C4
+//
+// cell edge competingCell competingEdge result
+// C0 Left C1 Left true
+// C0 Left C2 Left false
+// C0 Bottom C2 Top true
+// C0 Bottom C4 Left INVALID
+static inline bool sharesAxis(const QTextTableCell &cell, QCss::Edge edge,
+ const QTextTableCell &competingCell, QCss::Edge competingCellEdge)
+{
+ Q_ASSERT(isVerticalAxis(edge) == isVerticalAxis(competingCellEdge));
+
+ switch (edge) {
+ case QCss::TopEdge:
+ return cell.row() ==
+ competingCell.row() + (competingCellEdge == QCss::BottomEdge ? competingCell.rowSpan() : 0);
+ case QCss::BottomEdge:
+ return cell.row() + cell.rowSpan() ==
+ competingCell.row() + (competingCellEdge == QCss::TopEdge ? 0 : competingCell.rowSpan());
+ case QCss::LeftEdge:
+ return cell.column() ==
+ competingCell.column() + (competingCellEdge == QCss::RightEdge ? competingCell.columnSpan() : 0);
+ case QCss::RightEdge:
+ return cell.column() + cell.columnSpan() ==
+ competingCell.column() + (competingCellEdge == QCss::LeftEdge ? 0 : competingCell.columnSpan());
+ default:
+ Q_UNREACHABLE();
+ return false;
+ }
+}
+
+// returns the applicable EdgeData for the given cell and edge.
+// this is either set explicitly by the cell's format, an activated grid
+// or the general table border width for outermost edges.
+static inline EdgeData cellEdgeData(QTextTable *table, const QTextTableData *td,
+ const QTextTableCell &cell, QCss::Edge edge)
+{
+ if (!cell.isValid()) {
+ // e.g. non-existing adjacent cell
+ return EdgeData();
+ }
+
+ QTextTableCellFormat f = cell.format().toTableCellFormat();
+ if (f.hasProperty(borderStylePropertyForEdge(edge))) {
+ // border style is set
+ double width = 3; // default to 3 like browsers do
+ if (f.hasProperty(borderPropertyForEdge(edge)))
+ width = f.property(borderPropertyForEdge(edge)).toDouble();
+ return EdgeData(width, cell, edge, EdgeData::ClassExplicit);
+ } else if (td->drawGrid) {
+ const bool outermost =
+ (edge == QCss::LeftEdge && cell.column() == 0) ||
+ (edge == QCss::TopEdge && cell.row() == 0) ||
+ (edge == QCss::RightEdge && cell.column() + cell.columnSpan() >= table->columns()) ||
+ (edge == QCss::BottomEdge && cell.row() + cell.rowSpan() >= table->rows());
+
+ if (outermost) {
+ qreal border = table->format().border();
+ if (border > 1.0) {
+ // table border
+ return EdgeData(border, cell, edge, EdgeData::ClassTableBorder);
+ }
+ }
+ // 1px clean grid
+ return EdgeData(1.0, cell, edge, EdgeData::ClassGrid);
+ }
+ else {
+ return EdgeData(0, cell, edge, EdgeData::ClassNone);
+ }
+}
+
+// returns the EdgeData with the larger width of either the cell's edge its adjacent cell's edge
+static inline EdgeData axisEdgeData(QTextTable *table, const QTextTableData *td,
+ const QTextTableCell &cell, QCss::Edge edge)
+{
+ Q_ASSERT(cell.isValid());
+
+ EdgeData result = cellEdgeData(table, td, cell, edge);
+ if (!td->borderCollapse)
+ return result;
+
+ QTextTableCell ac = adjacentCell(table, cell, edge);
+ result = qMax(result, cellEdgeData(table, td, ac, adjacentEdge(edge)));
+
+ bool mustCheckThirdCell = false;
+ if (ac.isValid()) {
+ /* if C0 and C3 don't share the left/top axis, we must
+ * also check C1.
+ *
+ * C0 and C4 don't share the left axis so we have
+ * to take the top edge of C1 (T1) into account
+ * because this might be wider than C0's bottom
+ * edge (B0). For the sake of simplicity we skip
+ * checking T2 and T3.
+ *
+ * | C0
+ * |-----|-----|----|-----
+ * | C1 | C2 | C3 | C4
+ *
+ * width(T4) = max(T4, B0, T1) (T2 and T3 won't be checked)
+ */
+ switch (edge) {
+ case QCss::TopEdge:
+ case QCss::BottomEdge:
+ mustCheckThirdCell = !sharesAxis(cell, QCss::LeftEdge, ac, QCss::LeftEdge);
+ break;
+ case QCss::LeftEdge:
+ case QCss::RightEdge:
+ mustCheckThirdCell = !sharesAxis(cell, QCss::TopEdge, ac, QCss::TopEdge);
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ if (mustCheckThirdCell)
+ result = qMax(result, cellEdgeData(table, td, adjacentCell(table, ac, adjacentEdge(edge)), edge));
+
+ return result;
+}
+
+// checks an edge's joined competing edge according to priority rules and
+// adjusts maxCompetingEdgeData and maxOrthogonalEdgeData
+static inline void checkJoinedEdge(QTextTable *table, const QTextTableData *td, const QTextTableCell &cell,
+ QCss::Edge competingEdge,
+ const EdgeData &edgeData,
+ bool couldHaveContinuation,
+ EdgeData *maxCompetingEdgeData,
+ EdgeData *maxOrthogonalEdgeData)
+{
+ EdgeData competingEdgeData = axisEdgeData(table, td, cell, competingEdge);
+
+ if (competingEdgeData > edgeData) {
+ *maxCompetingEdgeData = competingEdgeData;
+ } else if (competingEdgeData.width == edgeData.width) {
+ if ((isSameAxis(edgeData.edge, competingEdge) && couldHaveContinuation)
+ || (!isVerticalAxis(edgeData.edge) && isVerticalAxis(competingEdge)) /* both widths are equal, vertical edge has priority */ ) {
+ *maxCompetingEdgeData = competingEdgeData;
+ }
+ }
+
+ if (maxOrthogonalEdgeData && competingEdgeData.width > maxOrthogonalEdgeData->width)
+ *maxOrthogonalEdgeData = competingEdgeData;
+}
+
+// the offset to make adjacent edges overlap in border collapse mode
+static inline qreal collapseOffset(const QTextDocumentLayoutPrivate *p, const EdgeData &w)
+{
+ return p->scaleToDevice(w.width) / 2.0;
+}
+
+// returns the offset that must be applied to the edge's
+// anchor (start point or end point) to avoid overlapping edges.
+//
+// Example 1:
+// 2
+// 2
+// 11111144444444 4 = top edge of cell, 4 pixels width
+// 3 3 = right edge of cell, 3 pixels width
+// 3 cell 4
+//
+// cell 4's top border is the widest border and will be
+// drawn with horiz. offset = -3/2 whereas its left border
+// of width 3 will be drawn with vert. offset = +4/2.
+//
+// Example 2:
+// 2
+// 2
+// 11111143333333
+// 4
+// 4 cell 4
+//
+// cell 4's left border is the widest and will be drawn
+// with vert. offset = -3/2 whereas its top border
+// of of width 3 will be drawn with hor. offset = +4/2.
+//
+// couldHaveContinuation: true for "end" anchor of an edge:
+// C
+// AAAAABBBBBB
+// D
+// width(A) == width(B) we consider B to be a continuation of A, so that B wins
+// and will be painted. A would only be painted including the right anchor if
+// there was no edge B (due to a rowspan or the axis C-D being the table's right
+// border).
+//
+// ignoreEdgesAbove: true if an egde (left, right or top) for the first row
+// after a table page break should be painted. In this case the edges of the
+// row above must be ignored.
+static inline double prioritizedEdgeAnchorOffset(const QTextDocumentLayoutPrivate *p,
+ QTextTable *table, const QTextTableData *td,
+ const QTextTableCell &cell,
+ const EdgeData &edgeData,
+ QCss::Edge orthogonalEdge,
+ bool couldHaveContinuation,
+ bool ignoreEdgesAbove)
+{
+ EdgeData maxCompetingEdgeData;
+ EdgeData maxOrthogonalEdgeData;
+ QTextTableCell competingCell;
+
+ // reference scenario for the inline comments:
+ // - edgeData being the top "T0" edge of C0
+ // - right anchor is '+', orthogonal edge is "R0"
+ // B C3 R|L C2 B
+ // ------+------
+ // T C0 R|L C1 T
+
+ // C0: T0/B3
+ // this is "edgeData"
+
+ // C0: R0/L1
+ checkJoinedEdge(table, td, cell, orthogonalEdge, edgeData, false,
+ &maxCompetingEdgeData, &maxOrthogonalEdgeData);
+
+ if (td->borderCollapse) {
+ // C1: T1/B2
+ if (!isVerticalAxis(edgeData.edge) || !ignoreEdgesAbove) {
+ competingCell = adjacentCell(table, cell, orthogonalEdge);
+ if (competingCell.isValid()) {
+ checkJoinedEdge(table, td, competingCell, edgeData.edge, edgeData, couldHaveContinuation,
+ &maxCompetingEdgeData, 0);
+ }
+ }
+
+ // C3: R3/L2
+ if (edgeData.edge != QCss::TopEdge || !ignoreEdgesAbove) {
+ competingCell = adjacentCell(table, cell, edgeData.edge);
+ if (competingCell.isValid() && sharesAxis(cell, orthogonalEdge, competingCell, orthogonalEdge)) {
+ checkJoinedEdge(table, td, competingCell, orthogonalEdge, edgeData, false,
+ &maxCompetingEdgeData, &maxOrthogonalEdgeData);
+ }
+ }
+ }
+
+ // wider edge has priority
+ bool hasPriority = edgeData > maxCompetingEdgeData;
+
+ if (td->borderCollapse) {
+ qreal offset = collapseOffset(p, maxOrthogonalEdgeData);
+ return hasPriority ? -offset : offset;
+ }
+ else
+ return hasPriority ? 0 : p->scaleToDevice(maxOrthogonalEdgeData.width);
+}
+
+// draw one edge of the given cell
+//
+// these options are for pagination / pagebreak handling:
+//
+// forceHeaderRow: true for all rows directly below a (repeated) header row.
+// if the table has headers the first row after a page break must check against
+// the last table header's row, not its actual predecessor.
+//
+// adjustTopAnchor: false for rows that are a continuation of a row after a page break
+// only evaluated for left/right edges
+//
+// adjustBottomAnchor: false for rows that will continue after a page break
+// only evaluated for left/right edges
+//
+// ignoreEdgesAbove: true if a row starts on top of the page and the
+// bottom edges of the prior row can therefore be ignored.
+static inline
+void drawCellBorder(const QTextDocumentLayoutPrivate *p, QPainter *painter,
+ QTextTable *table, const QTextTableData *td, const QTextTableCell &cell,
+ const QRectF &borderRect, QCss::Edge edge,
+ int forceHeaderRow, bool adjustTopAnchor, bool adjustBottomAnchor,
+ bool ignoreEdgesAbove)
+{
+ QPointF p1, p2;
+ qreal wh = 0;
+ qreal wv = 0;
+ EdgeData edgeData = axisEdgeData(table, td, cell, edge);
+
+ if (edgeData.width == 0)
+ return;
+
+ QTextTableCellFormat fmt = edgeData.cell.format().toTableCellFormat();
+ QTextFrameFormat::BorderStyle borderStyle = QTextFrameFormat::BorderStyle_None;
+ QBrush brush;
+
+ if (edgeData.edgeClass != EdgeData::ClassExplicit && td->drawGrid) {
+ borderStyle = QTextFrameFormat::BorderStyle_Solid;
+ brush = table->format().borderBrush();
+ }
+ else {
+ switch (edgeData.edge) {
+ case QCss::TopEdge:
+ brush = fmt.topBorderBrush();
+ borderStyle = fmt.topBorderStyle();
+ break;
+ case QCss::BottomEdge:
+ brush = fmt.bottomBorderBrush();
+ borderStyle = fmt.bottomBorderStyle();
+ break;
+ case QCss::LeftEdge:
+ brush = fmt.leftBorderBrush();
+ borderStyle = fmt.leftBorderStyle();
+ break;
+ case QCss::RightEdge:
+ brush = fmt.rightBorderBrush();
+ borderStyle = fmt.rightBorderStyle();
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ }
+
+ if (borderStyle == QTextFrameFormat::BorderStyle_None)
+ return;
+
+ // assume black if not explicit brush is set
+ if (brush.style() == Qt::NoBrush)
+ brush = Qt::black;
+
+ QTextTableCell cellOrHeader = cell;
+ if (forceHeaderRow != -1)
+ cellOrHeader = table->cellAt(forceHeaderRow, cell.column());
+
+ // adjust start and end anchors (e.g. left/right for top) according to priority rules
+ switch (edge) {
+ case QCss::TopEdge:
+ wv = p->scaleToDevice(edgeData.width);
+ p1 = borderRect.topLeft()
+ + QPointF(qFloor(prioritizedEdgeAnchorOffset(p, table, td, cell, edgeData, QCss::LeftEdge, false, ignoreEdgesAbove)), 0);
+ p2 = borderRect.topRight()
+ + QPointF(-qCeil(prioritizedEdgeAnchorOffset(p, table, td, cell, edgeData, QCss::RightEdge, true, ignoreEdgesAbove)), 0);
+ break;
+ case QCss::BottomEdge:
+ wv = p->scaleToDevice(edgeData.width);
+ p1 = borderRect.bottomLeft()
+ + QPointF(qFloor(prioritizedEdgeAnchorOffset(p, table, td, cell, edgeData, QCss::LeftEdge, false, false)), -wv);
+ p2 = borderRect.bottomRight()
+ + QPointF(-qCeil(prioritizedEdgeAnchorOffset(p, table, td, cell, edgeData, QCss::RightEdge, true, false)), -wv);
+ break;
+ case QCss::LeftEdge:
+ wh = p->scaleToDevice(edgeData.width);
+ p1 = borderRect.topLeft()
+ + QPointF(0, adjustTopAnchor ? qFloor(prioritizedEdgeAnchorOffset(p, table, td, cellOrHeader, edgeData,
+ forceHeaderRow != -1 ? QCss::BottomEdge : QCss::TopEdge,
+ false, ignoreEdgesAbove))
+ : 0);
+ p2 = borderRect.bottomLeft()
+ + QPointF(0, adjustBottomAnchor ? -qCeil(prioritizedEdgeAnchorOffset(p, table, td, cell, edgeData, QCss::BottomEdge, true, false))
+ : 0);
+ break;
+ case QCss::RightEdge:
+ wh = p->scaleToDevice(edgeData.width);
+ p1 = borderRect.topRight()
+ + QPointF(-wh, adjustTopAnchor ? qFloor(prioritizedEdgeAnchorOffset(p, table, td, cellOrHeader, edgeData,
+ forceHeaderRow != -1 ? QCss::BottomEdge : QCss::TopEdge,
+ false, ignoreEdgesAbove))
+ : 0);
+ p2 = borderRect.bottomRight()
+ + QPointF(-wh, adjustBottomAnchor ? -qCeil(prioritizedEdgeAnchorOffset(p, table, td, cell, edgeData, QCss::BottomEdge, true, false))
+ : 0);
+ break;
+ default: break;
+ }
+
+ // for borderCollapse move edge width/2 pixel out of the borderRect
+ // so that it shares space with the adjacent cell's edge.
+ // to avoid fractional offsets, qCeil/qFloor is used
+ if (td->borderCollapse) {
+ QPointF offset;
+ switch (edge) {
+ case QCss::TopEdge:
+ offset = QPointF(0, -qCeil(collapseOffset(p, edgeData)));
+ break;
+ case QCss::BottomEdge:
+ offset = QPointF(0, qFloor(collapseOffset(p, edgeData)));
+ break;
+ case QCss::LeftEdge:
+ offset = QPointF(-qCeil(collapseOffset(p, edgeData)), 0);
+ break;
+ case QCss::RightEdge:
+ offset = QPointF(qFloor(collapseOffset(p, edgeData)), 0);
+ break;
+ default: break;
+ }
+ p1 += offset;
+ p2 += offset;
+ }
+
+ QCss::BorderStyle cssStyle = static_cast<QCss::BorderStyle>(borderStyle + 1);
+
+// this reveals errors in the drawing logic
+#ifdef COLLAPSE_DEBUG
+ QColor c = brush.color();
+ c.setAlpha(150);
+ brush.setColor(c);
+#endif
+
+ qDrawEdge(painter, p1.x(), p1.y(), p2.x() + wh, p2.y() + wv, 0, 0, edge, cssStyle, brush);
+}
+#endif
+
+void QTextDocumentLayoutPrivate::drawTableCellBorder(const QRectF &cellRect, QPainter *painter,
+ QTextTable *table, QTextTableData *td,
+ const QTextTableCell &cell) const
+{
+#ifndef QT_NO_CSSPARSER
+ qreal topMarginAfterPageBreak = (td->effectiveTopMargin + td->cellSpacing + td->border).toReal();
+ qreal bottomMargin = (td->effectiveBottomMargin + td->cellSpacing + td->border).toReal();
+
+ const int headerRowCount = qMin(table->format().headerRowCount(), table->rows() - 1);
+ if (headerRowCount > 0 && cell.row() >= headerRowCount)
+ topMarginAfterPageBreak += td->headerHeight.toReal();
+
+ BorderPaginator paginator(document, cellRect, topMarginAfterPageBreak, bottomMargin, 0);
+
+ bool turn_off_antialiasing = !(painter->renderHints() & QPainter::Antialiasing);
+ painter->setRenderHint(QPainter::Antialiasing);
+
+ // paint cell borders for every page the cell appears on
+ for (int page = paginator.topPage; page <= paginator.bottomPage; ++page) {
+ const QRectF clipped = paginator.clipRect(page);
+ if (!clipped.isValid())
+ continue;
+
+ const qreal offset = cellRect.top() - td->rowPositions.at(cell.row()).toReal();
+ const int lastHeaderRow = table->format().headerRowCount() - 1;
+ const bool tableHasHeader = table->format().headerRowCount() > 0;
+ const bool isHeaderRow = cell.row() < table->format().headerRowCount();
+ const bool isFirstRow = cell.row() == lastHeaderRow + 1;
+ const bool isLastRow = cell.row() + cell.rowSpan() >= table->rows();
+ const bool previousRowOnPreviousPage = !isFirstRow
+ && !isHeaderRow
+ && BorderPaginator(document,
+ td->cellRect(adjacentCell(table, cell, QCss::TopEdge)).translated(0, offset),
+ topMarginAfterPageBreak,
+ bottomMargin,
+ 0).bottomPage < page;
+ const bool nextRowOnNextPage = !isLastRow
+ && BorderPaginator(document,
+ td->cellRect(adjacentCell(table, cell, QCss::BottomEdge)).translated(0, offset),
+ topMarginAfterPageBreak,
+ bottomMargin,
+ 0).topPage > page;
+ const bool rowStartsOnPage = page == paginator.topPage;
+ const bool rowEndsOnPage = page == paginator.bottomPage;
+ const bool rowStartsOnPageTop = !tableHasHeader
+ && rowStartsOnPage
+ && previousRowOnPreviousPage;
+ const bool rowStartsOnPageBelowHeader = tableHasHeader
+ && rowStartsOnPage
+ && previousRowOnPreviousPage;
+
+ const bool suppressTopBorder = td->borderCollapse
+ ? !isHeaderRow && (!rowStartsOnPage || rowStartsOnPageBelowHeader)
+ : !rowStartsOnPage;
+ const bool suppressBottomBorder = td->borderCollapse
+ ? !isHeaderRow && (!rowEndsOnPage || nextRowOnNextPage)
+ : !rowEndsOnPage;
+ const bool doNotAdjustTopAnchor = td->borderCollapse
+ ? !tableHasHeader && !rowStartsOnPage
+ : !rowStartsOnPage;
+ const bool doNotAdjustBottomAnchor = suppressBottomBorder;
+
+ if (!suppressTopBorder) {
+ drawCellBorder(this, painter, table, td, cell, clipped, QCss::TopEdge,
+ -1, true, true, rowStartsOnPageTop);
+ }
+
+ drawCellBorder(this, painter, table, td, cell, clipped, QCss::LeftEdge,
+ suppressTopBorder ? lastHeaderRow : -1,
+ !doNotAdjustTopAnchor,
+ !doNotAdjustBottomAnchor,
+ rowStartsOnPageTop);
+ drawCellBorder(this, painter, table, td, cell, clipped, QCss::RightEdge,
+ suppressTopBorder ? lastHeaderRow : -1,
+ !doNotAdjustTopAnchor,
+ !doNotAdjustBottomAnchor,
+ rowStartsOnPageTop);
+
+ if (!suppressBottomBorder) {
+ drawCellBorder(this, painter, table, td, cell, clipped, QCss::BottomEdge,
+ -1, true, true, false);
+ }
+ }
+
+ if (turn_off_antialiasing)
+ painter->setRenderHint(QPainter::Antialiasing, false);
+#else
+ Q_UNUSED(cell);
+ Q_UNUSED(cellRect);
+ Q_UNUSED(painter);
+ Q_UNUSED(table);
+ Q_UNUSED(td);
+ Q_UNUSED(cell);
+#endif
+}
+
void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &cell_context,
QTextTable *table, QTextTableData *td, int r, int c,
QTextBlock *cursorBlockNeedingRepaint, QPointF *cursorBlockOffset) const
@@ -1095,9 +1845,8 @@ void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter
return;
}
- QTextFormat fmt = cell.format();
- const QFixed leftPadding = td->leftPadding(fmt);
- const QFixed topPadding = td->topPadding(fmt);
+ const QFixed leftPadding = td->leftPadding(table, cell);
+ const QFixed topPadding = td->topPadding(table, cell);
qreal topMargin = (td->effectiveTopMargin + td->cellSpacing + td->border).toReal();
qreal bottomMargin = (td->effectiveBottomMargin + td->cellSpacing + td->border).toReal();
@@ -1106,7 +1855,7 @@ void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter
if (r >= headerRowCount)
topMargin += td->headerHeight.toReal();
- if (td->border != 0) {
+ if (!td->borderCollapse && td->border != 0) {
const QBrush oldBrush = painter->brush();
const QPen oldPen = painter->pen();
@@ -1172,6 +1921,9 @@ void QTextDocumentLayoutPrivate::drawTableCell(const QRectF &cellRect, QPainter
painter->setBrushOrigin(cellRect.topLeft());
}
+ // paint over the background - otherwise we would have to adjust the background paint cellRect for the border values
+ drawTableCellBorder(cellRect, painter, table, td, cell);
+
const QFixed verticalOffset = td->cellVerticalOffsets.at(c + r * table->columns());
const QPointF cellPos = QPointF(cellRect.left() + leftPadding.toReal(),
@@ -1446,6 +2198,21 @@ void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *p
QBrush brush = context.palette.brush(QPalette::Text);
+ bool marker = bl.blockFormat().marker() != QTextBlockFormat::MarkerType::NoMarker;
+ if (marker) {
+ int adj = fontMetrics.lineSpacing() / 6;
+ r.adjust(-adj, 0, -adj, 0);
+ if (bl.blockFormat().marker() == QTextBlockFormat::MarkerType::Checked) {
+ // ### Qt6: render with QStyle / PE_IndicatorCheckBox. We don't currently
+ // have access to that here, because it would be a widget dependency.
+ painter->setPen(QPen(painter->pen().color(), 2));
+ painter->drawLine(r.topLeft(), r.bottomRight());
+ painter->drawLine(r.topRight(), r.bottomLeft());
+ painter->setPen(QPen(painter->pen().color(), 0));
+ }
+ painter->drawRect(r.adjusted(-adj, -adj, adj, adj));
+ }
+
switch (style) {
case QTextListFormat::ListDecimal:
case QTextListFormat::ListLowerAlpha:
@@ -1466,16 +2233,21 @@ void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *p
break;
}
case QTextListFormat::ListSquare:
- painter->fillRect(r, brush);
+ if (!marker)
+ painter->fillRect(r, brush);
break;
case QTextListFormat::ListCircle:
- painter->setPen(QPen(brush, 0));
- painter->drawEllipse(r.translated(0.5, 0.5)); // pixel align for sharper rendering
+ if (!marker) {
+ painter->setPen(QPen(brush, 0));
+ painter->drawEllipse(r.translated(0.5, 0.5)); // pixel align for sharper rendering
+ }
break;
case QTextListFormat::ListDisc:
- painter->setBrush(brush);
- painter->setPen(Qt::NoPen);
- painter->drawEllipse(r);
+ if (!marker) {
+ painter->setBrush(brush);
+ painter->setPen(Qt::NoPen);
+ painter->drawEllipse(r);
+ }
break;
case QTextListFormat::ListStyleUndefined:
break;
@@ -1519,8 +2291,7 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
layoutStruct.maximumWidth = QFIXED_MAX;
layoutStruct.y = 0;
- const QTextFormat fmt = cell.format();
- const QFixed topPadding = td->topPadding(fmt);
+ const QFixed topPadding = td->topPadding(t, cell);
if (withPageBreaks) {
layoutStruct.frameY = absoluteTableY + td->rowPositions.at(cell.row()) + topPadding;
}
@@ -1538,8 +2309,22 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
if (layoutStruct.pageHeight < 0 || !withPageBreaks)
layoutStruct.pageHeight = QFIXED_MAX;
const int currentPage = layoutStruct.currentPage();
- layoutStruct.pageTopMargin = td->effectiveTopMargin + td->cellSpacing + td->border + topPadding;
- layoutStruct.pageBottomMargin = td->effectiveBottomMargin + td->cellSpacing + td->border + td->bottomPadding(fmt);
+
+ layoutStruct.pageTopMargin = td->effectiveTopMargin
+ + td->cellSpacing
+ + td->border
+ + td->paddingProperty(cell.format(), QTextFormat::TableCellTopPadding); // top cell-border is not repeated
+
+#ifndef QT_NO_CSSPARSER
+ const int headerRowCount = t->format().headerRowCount();
+ if (td->borderCollapse && headerRowCount > 0) {
+ // consider the header row's bottom edge width
+ qreal headerRowBottomBorderWidth = axisEdgeData(t, td, t->cellAt(headerRowCount - 1, cell.column()), QCss::BottomEdge).width;
+ layoutStruct.pageTopMargin += QFixed::fromReal(scaleToDevice(headerRowBottomBorderWidth) / 2);
+ }
+#endif
+
+ layoutStruct.pageBottomMargin = td->effectiveBottomMargin + td->cellSpacing + td->effectiveBottomBorder + td->bottomPadding(t, cell);
layoutStruct.pageBottom = (currentPage + 1) * layoutStruct.pageHeight - layoutStruct.pageBottomMargin;
layoutStruct.fullLayout = true;
@@ -1585,6 +2370,17 @@ QTextLayoutStruct QTextDocumentLayoutPrivate::layoutCell(QTextTable *t, const QT
return layoutStruct;
}
+#ifndef QT_NO_CSSPARSER
+static inline void findWidestOutermostBorder(QTextTable *table, QTextTableData *td,
+ const QTextTableCell &cell, QCss::Edge edge,
+ qreal *outerBorders)
+{
+ EdgeData w = cellEdgeData(table, td, cell, edge);
+ if (w.width > outerBorders[edge])
+ outerBorders[edge] = w.width;
+}
+#endif
+
QRectF QTextDocumentLayoutPrivate::layoutTable(QTextTable *table, int layoutFrom, int layoutTo, QFixed parentY)
{
qCDebug(lcTable) << "layoutTable from" << layoutFrom << "to" << layoutTo << "parentY" << parentY;
@@ -1601,7 +2397,7 @@ QRectF QTextDocumentLayoutPrivate::layoutTable(QTextTable *table, int layoutFrom
for (int i = 0; i < children.count(); ++i) {
QTextFrame *frame = children.at(i);
QTextTableCell cell = table->cellAt(frame->firstPosition());
- td->childFrameMap.insertMulti(cell.row() + cell.column() * rows, frame);
+ td->childFrameMap.insert(cell.row() + cell.column() * rows, frame);
}
}
@@ -1610,12 +2406,49 @@ QRectF QTextDocumentLayoutPrivate::layoutTable(QTextTable *table, int layoutFrom
columnWidthConstraints.resize(columns);
Q_ASSERT(columnWidthConstraints.count() == columns);
- const QFixed cellSpacing = td->cellSpacing = QFixed::fromReal(scaleToDevice(fmt.cellSpacing()));
+ // borderCollapse will disable drawing the html4 style table cell borders
+ // and draw a 1px grid instead. This also sets a fixed cellspacing
+ // of 1px if border > 0 (for the grid) and ignore any explicitly set
+ // cellspacing.
+ td->borderCollapse = fmt.borderCollapse();
+ td->borderCell = td->borderCollapse ? 0 : td->border;
+ const QFixed cellSpacing = td->cellSpacing = QFixed::fromReal(scaleToDevice(td->borderCollapse ? 0 : fmt.cellSpacing())).round();
+
+ td->drawGrid = (td->borderCollapse && fmt.border() >= 1);
+
+ td->effectiveTopBorder = td->effectiveBottomBorder = td->effectiveLeftBorder = td->effectiveRightBorder = td->border;
+
+#ifndef QT_NO_CSSPARSER
+ if (td->borderCollapse) {
+ // find the widest borders of the outermost cells
+ qreal outerBorders[QCss::NumEdges];
+ for (int i = 0; i < QCss::NumEdges; ++i)
+ outerBorders[i] = 0;
+
+ for (int r = 0; r < rows; ++r) {
+ if (r == 0) {
+ for (int c = 0; c < columns; ++c)
+ findWidestOutermostBorder(table, td, table->cellAt(r, c), QCss::TopEdge, outerBorders);
+ }
+ if (r == rows - 1) {
+ for (int c = 0; c < columns; ++c)
+ findWidestOutermostBorder(table, td, table->cellAt(r, c), QCss::BottomEdge, outerBorders);
+ }
+ findWidestOutermostBorder(table, td, table->cellAt(r, 0), QCss::LeftEdge, outerBorders);
+ findWidestOutermostBorder(table, td, table->cellAt(r, columns - 1), QCss::RightEdge, outerBorders);
+ }
+ td->effectiveTopBorder = QFixed::fromReal(scaleToDevice(outerBorders[QCss::TopEdge] / 2)).round();
+ td->effectiveBottomBorder = QFixed::fromReal(scaleToDevice(outerBorders[QCss::BottomEdge] / 2)).round();
+ td->effectiveLeftBorder = QFixed::fromReal(scaleToDevice(outerBorders[QCss::LeftEdge] / 2)).round();
+ td->effectiveRightBorder = QFixed::fromReal(scaleToDevice(outerBorders[QCss::RightEdge] / 2)).round();
+ }
+#endif
+
td->deviceScale = scaleToDevice(qreal(1));
td->cellPadding = QFixed::fromReal(scaleToDevice(fmt.cellPadding()));
- const QFixed leftMargin = td->leftMargin + td->border + td->padding;
- const QFixed rightMargin = td->rightMargin + td->border + td->padding;
- const QFixed topMargin = td->topMargin + td->border + td->padding;
+ const QFixed leftMargin = td->leftMargin + td->padding + td->effectiveLeftBorder;
+ const QFixed rightMargin = td->rightMargin + td->padding + td->effectiveRightBorder;
+ const QFixed topMargin = td->topMargin + td->padding + td->effectiveTopBorder;
const QFixed absoluteTableY = parentY + td->position.y;
@@ -1625,11 +2458,17 @@ recalc_minmax_widths:
QFixed remainingWidth = td->contentsWidth;
// two (vertical) borders per cell per column
- remainingWidth -= columns * 2 * td->border;
+ remainingWidth -= columns * 2 * td->borderCell;
// inter-cell spacing
remainingWidth -= (columns - 1) * cellSpacing;
// cell spacing at the left and right hand side
remainingWidth -= 2 * cellSpacing;
+
+ if (td->borderCollapse) {
+ remainingWidth -= td->effectiveLeftBorder;
+ remainingWidth -= td->effectiveRightBorder;
+ }
+
// remember the width used to distribute to percentaged columns
const QFixed initialTotalWidth = remainingWidth;
@@ -1654,9 +2493,8 @@ recalc_minmax_widths:
if (cspan > 1 && i != cell.column())
continue;
- const QTextFormat fmt = cell.format();
- const QFixed leftPadding = td->leftPadding(fmt);
- const QFixed rightPadding = td->rightPadding(fmt);
+ const QFixed leftPadding = td->leftPadding(table, cell);
+ const QFixed rightPadding = td->rightPadding(table, cell);
const QFixed widthPadding = leftPadding + rightPadding;
// to figure out the min and the max width lay out the cell at
@@ -1671,7 +2509,8 @@ recalc_minmax_widths:
for (int n = 0; n < cspan; ++n) {
const int col = i + n;
QFixed w = widthToDistribute / (cspan - n);
- td->minWidths[col] = qMax(td->minWidths.at(col), w);
+ // ceil to avoid going below minWidth when rounding all column widths later
+ td->minWidths[col] = qMax(td->minWidths.at(col), w).ceil();
widthToDistribute -= td->minWidths.at(col);
if (widthToDistribute <= 0)
break;
@@ -1687,6 +2526,12 @@ recalc_minmax_widths:
if (maxW == QFIXED_MAX)
continue;
+ // for variable columns the maxWidth will later be considered as the
+ // column width (column width = content width). We must avoid that the
+ // pixel-alignment rounding step floors this value and thus the text
+ // rendering later erroneously wraps the content.
+ maxW = maxW.ceil();
+
widthToDistribute = maxW;
for (int n = 0; n < cspan; ++n) {
const int col = i + n;
@@ -1777,11 +2622,23 @@ recalc_minmax_widths:
}
}
+ // in order to get a correct border rendering we must ensure that the distance between
+ // two cells is exactly 2 * td->cellBorder pixel. we do this by rounding the calculated width
+ // values here.
+ // to minimize the total rounding error we propagate the rounding error for each width
+ // to its successor.
+ QFixed error = 0;
+ for (int i = 0; i < columns; ++i) {
+ QFixed orig = td->widths[i];
+ td->widths[i] = (td->widths[i] - error).round();
+ error = td->widths[i] - orig;
+ }
+
td->columnPositions.resize(columns);
td->columnPositions[0] = leftMargin /*includes table border*/ + cellSpacing + td->border;
for (int i = 1; i < columns; ++i)
- td->columnPositions[i] = td->columnPositions.at(i-1) + td->widths.at(i-1) + 2 * td->border + cellSpacing;
+ td->columnPositions[i] = td->columnPositions.at(i-1) + td->widths.at(i-1) + 2 * td->borderCell + cellSpacing;
// - margin to compensate the + margin in columnPositions[0]
const QFixed contentsWidth = td->columnPositions.constLast() + td->widths.constLast() + td->padding + td->border + cellSpacing - leftMargin;
@@ -1877,17 +2734,15 @@ relayout:
if (cellRow != r) {
// the last row gets all the remaining space
if (cellRow + rspan - 1 == r)
- td->heights[r] = qMax(td->heights.at(r), heightToDistribute.at(c) - dropDistance);
+ td->heights[r] = qMax(td->heights.at(r), heightToDistribute.at(c) - dropDistance).round();
continue;
}
}
- const QTextFormat fmt = cell.format();
-
- const QFixed topPadding = td->topPadding(fmt);
- const QFixed bottomPadding = td->bottomPadding(fmt);
- const QFixed leftPadding = td->leftPadding(fmt);
- const QFixed rightPadding = td->rightPadding(fmt);
+ const QFixed topPadding = td->topPadding(table, cell);
+ const QFixed bottomPadding = td->bottomPadding(table, cell);
+ const QFixed leftPadding = td->leftPadding(table, cell);
+ const QFixed rightPadding = td->rightPadding(table, cell);
const QFixed widthPadding = leftPadding + rightPadding;
++rowCellCount;
@@ -1898,7 +2753,7 @@ relayout:
td, absoluteTableY,
/*withPageBreaks =*/true);
- const QFixed height = layoutStruct.y + bottomPadding + topPadding;
+ const QFixed height = (layoutStruct.y + bottomPadding + topPadding).round();
if (rspan > 1)
heightToDistribute[c] = height + dropDistance;
@@ -1924,13 +2779,13 @@ relayout:
}
if (haveRowSpannedCells) {
- const QFixed effectiveHeight = td->heights.at(r) + td->border + cellSpacing + td->border;
+ const QFixed effectiveHeight = td->heights.at(r) + td->borderCell + cellSpacing + td->borderCell;
for (int c = 0; c < columns; ++c)
heightToDistribute[c] = qMax(heightToDistribute.at(c) - effectiveHeight - dropDistance, QFixed(0));
}
if (r == headerRowCount - 1) {
- td->headerHeight = td->rowPositions.at(r) + td->heights.at(r) - td->rowPositions.at(0) + td->cellSpacing + 2 * td->border;
+ td->headerHeight = td->rowPositions.at(r) + td->heights.at(r) - td->rowPositions.at(0) + td->cellSpacing + 2 * td->borderCell;
td->headerHeight -= td->headerHeight * (td->headerHeight / pageHeight).truncate();
td->effectiveTopMargin += td->headerHeight;
}
@@ -1952,7 +2807,7 @@ relayout:
const QFixed availableHeight = td->rowPositions.at(r + rowSpan - 1) + td->heights.at(r + rowSpan - 1) - td->rowPositions.at(r);
const QTextCharFormat cellFormat = cell.format();
- const QFixed cellHeight = cellHeights.at(cellIndex++) + td->topPadding(cellFormat) + td->bottomPadding(cellFormat);
+ const QFixed cellHeight = cellHeights.at(cellIndex++) + td->topPadding(table, cell) + td->bottomPadding(table, cell);
QFixed offset = 0;
switch (cellFormat.verticalAlignment()) {
@@ -1977,14 +2832,14 @@ relayout:
td->minimumWidth = td->columnPositions.at(0);
for (int i = 0; i < columns; ++i) {
- td->minimumWidth += td->minWidths.at(i) + 2 * td->border + cellSpacing;
+ td->minimumWidth += td->minWidths.at(i) + 2 * td->borderCell + cellSpacing;
}
td->minimumWidth += rightMargin - td->border;
td->maximumWidth = td->columnPositions.at(0);
for (int i = 0; i < columns; ++i) {
if (td->maxWidths.at(i) != QFIXED_MAX)
- td->maximumWidth += td->maxWidths.at(i) + 2 * td->border + cellSpacing;
+ td->maximumWidth += td->maxWidths.at(i) + 2 * td->borderCell + cellSpacing;
qCDebug(lcTable) << "column" << i << "has final width" << td->widths.at(i).toReal()
<< "min" << td->minWidths.at(i).toReal() << "max" << td->maxWidths.at(i).toReal();
}
@@ -2092,24 +2947,24 @@ QRectF QTextDocumentLayoutPrivate::layoutFrame(QTextFrame *f, int layoutFrom, in
{
QTextFrameFormat fformat = f->frameFormat();
// set sizes of this frame from the format
- QFixed tm = QFixed::fromReal(fformat.topMargin());
+ QFixed tm = QFixed::fromReal(scaleToDevice(fformat.topMargin())).round();
if (tm != fd->topMargin) {
fd->topMargin = tm;
fullLayout = true;
}
- QFixed bm = QFixed::fromReal(fformat.bottomMargin());
+ QFixed bm = QFixed::fromReal(scaleToDevice(fformat.bottomMargin())).round();
if (bm != fd->bottomMargin) {
fd->bottomMargin = bm;
fullLayout = true;
}
- fd->leftMargin = QFixed::fromReal(fformat.leftMargin());
- fd->rightMargin = QFixed::fromReal(fformat.rightMargin());
- QFixed b = QFixed::fromReal(fformat.border());
+ fd->leftMargin = QFixed::fromReal(scaleToDevice(fformat.leftMargin())).round();
+ fd->rightMargin = QFixed::fromReal(scaleToDevice(fformat.rightMargin())).round();
+ QFixed b = QFixed::fromReal(scaleToDevice(fformat.border())).round();
if (b != fd->border) {
fd->border = b;
fullLayout = true;
}
- QFixed p = QFixed::fromReal(fformat.padding());
+ QFixed p = QFixed::fromReal(scaleToDevice(fformat.padding())).round();
if (p != fd->padding) {
fd->padding = p;
fullLayout = true;
@@ -3218,7 +4073,7 @@ QRectF QTextDocumentLayout::tableBoundingRect(QTextTable *table) const
if (QTextTable *table = qobject_cast<QTextTable *>(f)) {
QTextTableCell cell = table->cellAt(framePos);
if (cell.isValid())
- pos += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
+ pos += static_cast<QTextTableData *>(fd)->cellPosition(table, cell).toPointF();
}
}
@@ -3248,7 +4103,7 @@ QRectF QTextDocumentLayoutPrivate::frameBoundingRectInternal(QTextFrame *frame)
if (QTextTable *table = qobject_cast<QTextTable *>(f)) {
QTextTableCell cell = table->cellAt(framePos);
if (cell.isValid())
- pos += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
+ pos += static_cast<QTextTableData *>(fd)->cellPosition(table, cell).toPointF();
}
f = f->parentFrame();
@@ -3273,7 +4128,7 @@ QRectF QTextDocumentLayout::blockBoundingRect(const QTextBlock &block) const
if (QTextTable *table = qobject_cast<QTextTable *>(frame)) {
QTextTableCell cell = table->cellAt(blockPos);
if (cell.isValid())
- offset += static_cast<QTextTableData *>(fd)->cellPosition(cell).toPointF();
+ offset += static_cast<QTextTableData *>(fd)->cellPosition(table, cell).toPointF();
}
frame = frame->parentFrame();
diff --git a/src/gui/text/qtextdocumentwriter.cpp b/src/gui/text/qtextdocumentwriter.cpp
index 42e623153a..193d2c0dd3 100644
--- a/src/gui/text/qtextdocumentwriter.cpp
+++ b/src/gui/text/qtextdocumentwriter.cpp
@@ -51,6 +51,9 @@
#include "qtextdocumentfragment_p.h"
#include "qtextodfwriter_p.h"
+#if QT_CONFIG(textmarkdownwriter)
+#include "qtextmarkdownwriter_p.h"
+#endif
#include <algorithm>
@@ -267,6 +270,18 @@ bool QTextDocumentWriter::write(const QTextDocument *document)
}
#endif // QT_NO_TEXTODFWRITER
+#if QT_CONFIG(textmarkdownwriter)
+ if (format == "md" || format == "mkd" || format == "markdown") {
+ if (!d->device->isWritable() && !d->device->open(QIODevice::WriteOnly)) {
+ qWarning("QTextDocumentWriter::write: the device can not be opened for writing");
+ return false;
+ }
+ QTextStream s(d->device);
+ QTextMarkdownWriter writer(s, QTextDocument::MarkdownDialectGitHub);
+ return writer.writeAll(document);
+ }
+#endif // textmarkdownwriter
+
#ifndef QT_NO_TEXTHTMLPARSER
if (format == "html" || format == "htm") {
if (!d->device->isWritable() && ! d->device->open(QIODevice::WriteOnly)) {
@@ -348,6 +363,7 @@ QTextCodec *QTextDocumentWriter::codec() const
\header \li Format \li Description
\row \li plaintext \li Plain text
\row \li HTML \li HyperText Markup Language
+ \row \li markdown \li Markdown (CommonMark or GitHub dialects)
\row \li ODF \li OpenDocument Format
\endtable
@@ -364,6 +380,9 @@ QList<QByteArray> QTextDocumentWriter::supportedDocumentFormats()
#ifndef QT_NO_TEXTODFWRITER
answer << "ODF";
#endif // QT_NO_TEXTODFWRITER
+#if QT_CONFIG(textmarkdownwriter)
+ answer << "markdown";
+#endif
std::sort(answer.begin(), answer.end());
return answer;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index a7834587b1..209433dac5 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -989,7 +989,7 @@ struct QBidiAlgorithm {
BIDI_DEBUG() << "before implicit level processing:";
IsolatedRunSequenceIterator it(runs, i);
while (!it.atEnd()) {
- BIDI_DEBUG() << " " << *it << hex << text[*it].unicode() << analysis[*it].bidiDirection;
+ BIDI_DEBUG() << " " << *it << Qt::hex << text[*it].unicode() << analysis[*it].bidiDirection;
++it;
}
}
@@ -1002,7 +1002,7 @@ struct QBidiAlgorithm {
BIDI_DEBUG() << "after W4/W5";
IsolatedRunSequenceIterator it(runs, i);
while (!it.atEnd()) {
- BIDI_DEBUG() << " " << *it << hex << text[*it].unicode() << analysis[*it].bidiDirection;
+ BIDI_DEBUG() << " " << *it << Qt::hex << text[*it].unicode() << analysis[*it].bidiDirection;
++it;
}
}
@@ -1088,7 +1088,7 @@ struct QBidiAlgorithm {
if (BidiDebugEnabled) {
BIDI_DEBUG() << ">>>> start bidi, text length" << length;
for (int i = 0; i < length; ++i)
- BIDI_DEBUG() << hex << " (" << i << ")" << text[i].unicode() << text[i].direction();
+ BIDI_DEBUG() << Qt::hex << " (" << i << ")" << text[i].unicode() << text[i].direction();
}
{
@@ -1157,7 +1157,7 @@ struct QBidiAlgorithm {
if (BidiDebugEnabled) {
BIDI_DEBUG() << "final resolved levels:";
for (int i = 0; i < length; ++i)
- BIDI_DEBUG() << " " << i << hex << text[i].unicode() << dec << (int)analysis[i].bidiLevel;
+ BIDI_DEBUG() << " " << i << Qt::hex << text[i].unicode() << Qt::dec << (int)analysis[i].bidiLevel;
}
return true;
@@ -1968,7 +1968,9 @@ const QCharAttributes *QTextEngine::attributes() const
QUnicodeTools::initCharAttributes(reinterpret_cast<const ushort *>(layoutData->string.constData()),
layoutData->string.length(),
scriptItems.data(), scriptItems.size(),
- (QCharAttributes *)layoutData->memory);
+ (QCharAttributes *)layoutData->memory,
+ QUnicodeTools::CharAttributeOptions(QUnicodeTools::DefaultOptionsCompat
+ | QUnicodeTools::HangulLineBreakTailoring));
layoutData->haveCharAttributes = true;
@@ -2123,22 +2125,7 @@ void QTextEngine::itemize() const
}
#if QT_CONFIG(harfbuzz)
analysis = scriptAnalysis.data();
- if (qt_useHarfbuzzNG()) {
- // ### pretend HB-old behavior for now
- for (int i = 0; i < length; ++i) {
- switch (analysis[i].script) {
- case QChar::Script_Latin:
- case QChar::Script_Hiragana:
- case QChar::Script_Katakana:
- case QChar::Script_Bopomofo:
- case QChar::Script_Han:
- analysis[i].script = QChar::Script_Common;
- break;
- default:
- break;
- }
- }
- } else {
+ if (!qt_useHarfbuzzNG()) {
for (int i = 0; i < length; ++i)
analysis[i].script = hbscript_to_script(script_to_hbscript(analysis[i].script));
}
@@ -3617,7 +3604,12 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end,
int clusterLength = 0;
if (si->analysis.script != QChar::Script_Common &&
- si->analysis.script != QChar::Script_Greek) {
+ si->analysis.script != QChar::Script_Greek &&
+ si->analysis.script != QChar::Script_Latin &&
+ si->analysis.script != QChar::Script_Hiragana &&
+ si->analysis.script != QChar::Script_Katakana &&
+ si->analysis.script != QChar::Script_Bopomofo &&
+ si->analysis.script != QChar::Script_Han) {
if (glyph_pos == -1)
return si->position + end;
else {
diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h
index e9187ea605..76b9757eba 100644
--- a/src/gui/text/qtextengine_p.h
+++ b/src/gui/text/qtextengine_p.h
@@ -304,8 +304,8 @@ class QTextItemInt : public QTextItem
{
public:
inline QTextItemInt()
- : justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(0),
- logClusters(0), f(0), fontEngine(0)
+ : justified(false), underlineStyle(QTextCharFormat::NoUnderline), num_chars(0), chars(nullptr),
+ logClusters(nullptr), f(nullptr), fontEngine(nullptr)
{}
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe,
@@ -335,7 +335,7 @@ public:
struct QScriptItem
{
- Q_DECL_CONSTEXPR QScriptItem(int p, QScriptAnalysis a) Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QScriptItem(int p, QScriptAnalysis a) noexcept
: position(p), analysis(a),
num_glyphs(0), descent(-1), ascent(-1), leading(-1), width(-1),
glyph_data_offset(0) {}
@@ -348,10 +348,10 @@ struct QScriptItem
QFixed leading;
QFixed width;
int glyph_data_offset;
- Q_DECL_CONSTEXPR QFixed height() const Q_DECL_NOTHROW { return ascent + descent; }
+ Q_DECL_CONSTEXPR QFixed height() const noexcept { return ascent + descent; }
private:
friend class QVector<QScriptItem>;
- QScriptItem() {}; // for QVector, don't use
+ QScriptItem() {} // for QVector, don't use
};
Q_DECLARE_TYPEINFO(QScriptItem, Q_PRIMITIVE_TYPE);
@@ -484,7 +484,7 @@ public:
return end - si->position;
}
- QFontEngine *fontEngine(const QScriptItem &si, QFixed *ascent = 0, QFixed *descent = 0, QFixed *leading = 0) const;
+ QFontEngine *fontEngine(const QScriptItem &si, QFixed *ascent = nullptr, QFixed *descent = nullptr, QFixed *leading = nullptr) const;
QFont font(const QScriptItem &si) const;
inline QFont font() const { return fnt; }
@@ -530,7 +530,7 @@ public:
inline QTextFormatCollection *formatCollection() const {
if (block.docHandle())
return block.docHandle()->formatCollection();
- return specialData ? specialData->formatCollection.data() : 0;
+ return specialData ? specialData->formatCollection.data() : nullptr;
}
QTextCharFormat format(const QScriptItem *si) const;
inline QAbstractTextDocumentLayout *docLayout() const {
@@ -553,8 +553,8 @@ private:
mutable int prevPosition;
mutable int prevLength;
inline void reset() {
- prevFontEngine = 0;
- prevScaledFontEngine = 0;
+ prevFontEngine = nullptr;
+ prevScaledFontEngine = nullptr;
prevScript = -1;
prevPosition = -1;
prevLength = -1;
@@ -684,7 +684,7 @@ Q_DECLARE_TYPEINFO(QTextEngine::ItemDecoration, Q_MOVABLE_TYPE);
struct QTextLineItemIterator
{
QTextLineItemIterator(QTextEngine *eng, int lineNum, const QPointF &pos = QPointF(),
- const QTextLayout::FormatRange *_selection = 0);
+ const QTextLayout::FormatRange *_selection = nullptr);
inline bool atEnd() const { return logicalItem >= nItems - 1; }
inline bool atBeginning() const { return logicalItem <= 0; }
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 4a2985f74c..e3bd49a15e 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -564,6 +564,18 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
\value BlockTrailingHorizontalRulerWidth The width of a horizontal ruler element.
\value HeadingLevel The level of a heading, for example 1 corresponds to an HTML H1 tag; otherwise 0.
This enum value has been added in Qt 5.12.
+ \value BlockCodeFence The character that was used in the "fences" around a Markdown code block.
+ If the code block was indented rather than fenced, the block should not have this property.
+ This enum value has been added in Qt 5.14.
+
+ \value BlockQuoteLevel The depth of nested quoting on this block: 1 means the block is a top-level block quote.
+ Blocks that are not block quotes should not have this property.
+ This enum value has been added in Qt 5.14.
+ \value BlockCodeLanguage The programming language in a preformatted or code block.
+ Blocks that do not contain code should not have this property.
+ This enum value has been added in Qt 5.14.
+ \value BlockMarker The \l{QTextBlockFormat::MarkerType}{type of adornment} to be shown alongside the block.
+ This enum value has been added in Qt 5.14.
Character properties
@@ -638,6 +650,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
\value TableColumns
\value TableColumnWidthConstraints
\value TableHeaderRowCount
+ \value TableBorderCollapse Specifies the \l QTextTableFormat::borderCollapse property.
Table cell properties
@@ -648,9 +661,32 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
\value TableCellTopPadding
\value TableCellBottomPadding
+ Table cell properties intended for use with \l QTextTableFormat::borderCollapse enabled
+
+ \value TableCellTopBorder
+ \value TableCellBottomBorder
+ \value TableCellLeftBorder
+ \value TableCellRightBorder
+
+ \value TableCellTopBorderStyle
+ \value TableCellBottomBorderStyle
+ \value TableCellLeftBorderStyle
+ \value TableCellRightBorderStyle
+
+ \value TableCellTopBorderBrush
+ \value TableCellBottomBorderBrush
+ \value TableCellLeftBorderBrush
+ \value TableCellRightBorderBrush
+
Image properties
- \value ImageName
+ \value ImageName The filename or source of the image.
+ \value ImageTitle The title attribute of an HTML image tag, or
+ the quoted string that comes after the URL in a Markdown image link.
+ This enum value has been added in Qt 5.14.
+ \value ImageAltText The alt attribute of an HTML image tag, or
+ the image description in a Markdown image link.
+ This enum value has been added in Qt 5.14.
\value ImageWidth
\value ImageHeight
\value ImageQuality
@@ -2329,6 +2365,50 @@ QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
/*!
+ \fn void QTextBlockFormat::setMarker(MarkerType marker)
+ \since 5.14
+
+ Sets the type of adornment that should be rendered alongside the paragraph to \a marker.
+ For example, a list item can be adorned with a checkbox, either checked
+ or unchecked, as a replacement for its bullet. The default is \c NoMarker.
+
+ \sa marker()
+*/
+
+
+/*!
+ \fn MarkerType QTextBlockFormat::marker() const
+ \since 5.14
+
+ Returns the paragraph's marker if one has been set, or \c NoMarker if not.
+
+ \sa setMarker()
+*/
+
+
+/*!
+ \since 5.14
+ \enum QTextBlockFormat::MarkerType
+
+ This enum describes the types of markers a list item can have.
+ If a list item (a paragraph for which \l QTextBlock::textList() returns the list)
+ has a marker, it is rendered instead of the normal bullet.
+ In this way, checkable list items can be mixed with plain list items in the
+ same list, overriding the type of bullet specified by the
+ \l QTextListFormat::style() for the entire list.
+
+ \value NoMarker This is the default: the list item's bullet will be shown.
+ \value Unchecked Instead of the list item's bullet, an unchecked checkbox will be shown.
+ \value Checked Instead of the list item's bullet, a checked checkbox will be shown.
+
+ In the future, this may be extended to specify other types of paragraph
+ decorations.
+
+ \sa QTextListFormat::style()
+*/
+
+
+/*!
\fn void QTextBlockFormat::setLineHeight(qreal height, int heightType)
\since 4.8
@@ -3038,6 +3118,8 @@ QTextTableFormat::QTextTableFormat(const QTextFormat &fmt)
Sets the cell \a spacing for the table. This determines the distance
between adjacent cells.
+
+ This property will be ignored if \l borderCollapse is enabled.
*/
/*!
@@ -3089,6 +3171,44 @@ QTextTableFormat::QTextTableFormat(const QTextFormat &fmt)
*/
/*!
+ \fn void QTextTableFormat::setBorderCollapse(bool borderCollapse)
+ \since 5.14
+
+ Enabling \a borderCollapse will have the following implications:
+ \list
+ \li The borders and grid of the table will be rendered following the
+ CSS table \c border-collapse: \c collapse rules
+ \li Setting the \c border property to a minimum value of \c 1 will render a
+ one pixel solid inner table grid using the \l borderBrush property and an
+ outer border as specified
+ \li The various border style properties of \l QTextTableCellFormat can be used to
+ customize the grid and have precedence over the border and grid of the table
+ \li The \l cellSpacing property will be ignored
+ \li For print pagination:
+ \list
+ \li Columns continued on a page will not have their top cell border rendered
+ \li Repeated header rows will always have their bottom cell border rendered
+ \endlist
+ \endlist
+
+ With borderCollapse disabled, cell borders can still be styled
+ using QTextTableCellFormat but styling will be applied only within
+ the cell's frame, which is probably not very useful in practice.
+
+ \sa setBorder(), setBorderBrush(), setBorderStyle()
+ \sa QTextTableCellFormat
+*/
+
+/*!
+ \fn bool QTextTableFormat::borderCollapse() const
+ \since 5.14
+
+ Returns true if borderCollapse is enabled.
+
+ \sa setBorderCollapse()
+*/
+
+/*!
\fn void QTextFormat::setBackground(const QBrush &brush)
Sets the brush use to paint the document's background to the
@@ -3427,6 +3547,228 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt)
*/
/*!
+ \fn void QTextTableCellFormat::setTopBorder(qreal width)
+ \since 5.14
+
+ Sets the top border \a width of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn qreal QTextTableCellFormat::topBorder() const
+ \since 5.14
+
+ Returns the top border width of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setBottomBorder(qreal width)
+ \since 5.14
+
+ Sets the bottom border \a width of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn qreal QTextTableCellFormat::bottomBorder() const
+ \since 5.14
+
+ Returns the bottom border width of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setLeftBorder(qreal width)
+ \since 5.14
+
+ Sets the left border \a width of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn qreal QTextTableCellFormat::leftBorder() const
+ \since 5.14
+
+ Returns the left border width of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setRightBorder(qreal width)
+ \since 5.14
+
+ Sets the right border \a width of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn qreal QTextTableCellFormat::rightBorder() const
+ \since 5.14
+
+ Returns the right border width of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setBorder(qreal width)
+ \since 5.14
+
+ Sets the left, right, top, and bottom border \a width of the table cell.
+
+ \sa setLeftBorder(), setRightBorder(), setTopBorder(), setBottomBorder()
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setTopBorderStyle(QTextFrameFormat::BorderStyle style)
+ \since 5.14
+
+ Sets the top border \a style of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QTextFrameFormat::BorderStyle QTextTableCellFormat::topBorderStyle() const
+ \since 5.14
+
+ Returns the top border style of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setBottomBorderStyle(QTextFrameFormat::BorderStyle style)
+ \since 5.14
+
+ Sets the bottom border \a style of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QTextFrameFormat::BorderStyle QTextTableCellFormat::bottomBorderStyle() const
+ \since 5.14
+
+ Returns the bottom border style of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setLeftBorderStyle(QTextFrameFormat::BorderStyle style)
+ \since 5.14
+
+ Sets the left border \a style of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QTextFrameFormat::BorderStyle QTextTableCellFormat::leftBorderStyle() const
+ \since 5.14
+
+ Returns the left border style of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setRightBorderStyle(QTextFrameFormat::BorderStyle style)
+ \since 5.14
+
+ Sets the right border \a style of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QTextFrameFormat::BorderStyle QTextTableCellFormat::rightBorderStyle() const
+ \since 5.14
+
+ Returns the right border style of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setBorderStyle(QTextFrameFormat::BorderStyle style)
+ \since 5.14
+
+ Sets the left, right, top, and bottom border \a style of the table cell.
+
+ \sa setLeftBorderStyle(), setRightBorderStyle(), setTopBorderStyle(), setBottomBorderStyle()
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setTopBorderBrush(const QBrush &brush)
+ \since 5.14
+
+ Sets the top border \a brush of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QBrush QTextTableCellFormat::topBorderBrush() const
+ \since 5.14
+
+ Returns the top border brush of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setBottomBorderBrush(const QBrush &brush)
+ \since 5.14
+
+ Sets the bottom border \a brush of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QBrush QTextTableCellFormat::bottomBorderBrush() const
+ \since 5.14
+
+ Returns the bottom border brush of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setLeftBorderBrush(const QBrush &brush)
+ \since 5.14
+
+ Sets the left border \a brush of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QBrush QTextTableCellFormat::leftBorderBrush() const
+ \since 5.14
+
+ Returns the left border brush of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setRightBorderBrush(const QBrush &brush)
+ \since 5.14
+
+ Sets the right border \a brush of the table cell.
+
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
+ \fn QBrush QTextTableCellFormat::rightBorderBrush() const
+ \since 5.14
+
+ Returns the right border brush of the table cell.
+*/
+
+/*!
+ \fn void QTextTableCellFormat::setBorderBrush(const QBrush &brush)
+ \since 5.14
+
+ Sets the left, right, top, and bottom border \a brush of the table cell.
+
+ \sa setLeftBorderBrush(), setRightBorderBrush(), setTopBorderBrush(), setBottomBorderBrush()
+ \sa QTextTableFormat::setBorderCollapse
+*/
+
+/*!
\fn bool QTextTableCellFormat::isValid() const
\since 4.4
diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h
index 80d8e82694..28da0fe344 100644
--- a/src/gui/text/qtextformat.h
+++ b/src/gui/text/qtextformat.h
@@ -176,6 +176,10 @@ public:
BlockNonBreakableLines = 0x1050,
BlockTrailingHorizontalRulerWidth = 0x1060,
HeadingLevel = 0x1070,
+ BlockQuoteLevel = 0x1080,
+ BlockCodeLanguage = 0x1090,
+ BlockCodeFence = 0x1091,
+ BlockMarker = 0x10A0,
// character properties
FirstFontProperty = 0x1FE0,
@@ -238,6 +242,7 @@ public:
TableCellSpacing = 0x4102,
TableCellPadding = 0x4103,
TableHeaderRowCount = 0x4104,
+ TableBorderCollapse = 0x4105,
// table cell properties
TableCellRowSpan = 0x4810,
@@ -248,8 +253,25 @@ public:
TableCellLeftPadding = 0x4814,
TableCellRightPadding = 0x4815,
+ TableCellTopBorder = 0x4816,
+ TableCellBottomBorder = 0x4817,
+ TableCellLeftBorder = 0x4818,
+ TableCellRightBorder = 0x4819,
+
+ TableCellTopBorderStyle = 0x481a,
+ TableCellBottomBorderStyle = 0x481b,
+ TableCellLeftBorderStyle = 0x481c,
+ TableCellRightBorderStyle = 0x481d,
+
+ TableCellTopBorderBrush = 0x481e,
+ TableCellBottomBorderBrush = 0x481f,
+ TableCellLeftBorderBrush = 0x4820,
+ TableCellRightBorderBrush = 0x4821,
+
// image properties
ImageName = 0x5000,
+ ImageTitle = 0x5001,
+ ImageAltText = 0x5002,
ImageWidth = 0x5010,
ImageHeight = 0x5011,
ImageQuality = 0x5014,
@@ -605,6 +627,12 @@ public:
LineDistanceHeight = 4
};
+ enum class MarkerType {
+ NoMarker = 0,
+ Unchecked = 1,
+ Checked = 2
+ };
+
QTextBlockFormat();
bool isValid() const { return isBlockFormat(); }
@@ -668,6 +696,11 @@ public:
void setTabPositions(const QList<QTextOption::Tab> &tabs);
QList<QTextOption::Tab> tabPositions() const;
+ inline void setMarker(MarkerType marker)
+ { setProperty(BlockMarker, int(marker)); }
+ inline MarkerType marker() const
+ { return MarkerType(intProperty(BlockMarker)); }
+
protected:
explicit QTextBlockFormat(const QTextFormat &fmt);
friend class QTextFormat;
@@ -949,6 +982,11 @@ public:
inline int headerRowCount() const
{ return intProperty(TableHeaderRowCount); }
+ inline void setBorderCollapse(bool borderCollapse)
+ { setProperty(TableBorderCollapse, borderCollapse); }
+ inline bool borderCollapse() const
+ { return boolProperty(TableBorderCollapse); }
+
protected:
explicit QTextTableFormat(const QTextFormat &fmt);
friend class QTextFormat;
@@ -990,6 +1028,72 @@ public:
inline void setPadding(qreal padding);
+ inline void setTopBorder(qreal width)
+ { setProperty(TableCellTopBorder, width); }
+ inline qreal topBorder() const
+ { return doubleProperty(TableCellTopBorder); }
+
+ inline void setBottomBorder(qreal width)
+ { setProperty(TableCellBottomBorder, width); }
+ inline qreal bottomBorder() const
+ { return doubleProperty(TableCellBottomBorder); }
+
+ inline void setLeftBorder(qreal width)
+ { setProperty(TableCellLeftBorder, width); }
+ inline qreal leftBorder() const
+ { return doubleProperty(TableCellLeftBorder); }
+
+ inline void setRightBorder(qreal width)
+ { setProperty(TableCellRightBorder, width); }
+ inline qreal rightBorder() const
+ { return doubleProperty(TableCellRightBorder); }
+
+ inline void setBorder(qreal width);
+
+ inline void setTopBorderStyle(QTextFrameFormat::BorderStyle style)
+ { setProperty(TableCellTopBorderStyle, style); }
+ inline QTextFrameFormat::BorderStyle topBorderStyle() const
+ { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellTopBorderStyle)); }
+
+ inline void setBottomBorderStyle(QTextFrameFormat::BorderStyle style)
+ { setProperty(TableCellBottomBorderStyle, style); }
+ inline QTextFrameFormat::BorderStyle bottomBorderStyle() const
+ { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellBottomBorderStyle)); }
+
+ inline void setLeftBorderStyle(QTextFrameFormat::BorderStyle style)
+ { setProperty(TableCellLeftBorderStyle, style); }
+ inline QTextFrameFormat::BorderStyle leftBorderStyle() const
+ { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellLeftBorderStyle)); }
+
+ inline void setRightBorderStyle(QTextFrameFormat::BorderStyle style)
+ { setProperty(TableCellRightBorderStyle, style); }
+ inline QTextFrameFormat::BorderStyle rightBorderStyle() const
+ { return static_cast<QTextFrameFormat::BorderStyle>(intProperty(TableCellRightBorderStyle)); }
+
+ inline void setBorderStyle(QTextFrameFormat::BorderStyle style);
+
+ inline void setTopBorderBrush(const QBrush &brush)
+ { setProperty(TableCellTopBorderBrush, brush); }
+ inline QBrush topBorderBrush() const
+ { return brushProperty(TableCellTopBorderBrush); }
+
+ inline void setBottomBorderBrush(const QBrush &brush)
+ { setProperty(TableCellBottomBorderBrush, brush); }
+ inline QBrush bottomBorderBrush() const
+ { return brushProperty(TableCellBottomBorderBrush); }
+
+ inline void setLeftBorderBrush(const QBrush &brush)
+ { setProperty(TableCellLeftBorderBrush, brush); }
+ inline QBrush leftBorderBrush() const
+ { return brushProperty(TableCellLeftBorderBrush); }
+
+ inline void setRightBorderBrush(const QBrush &brush)
+ { setProperty(TableCellRightBorderBrush, brush); }
+ inline QBrush rightBorderBrush() const
+ { return brushProperty(TableCellRightBorderBrush); }
+
+ inline void setBorderBrush(const QBrush &brush);
+
protected:
explicit QTextTableCellFormat(const QTextFormat &fmt);
friend class QTextFormat;
@@ -1045,6 +1149,29 @@ inline void QTextTableCellFormat::setPadding(qreal padding)
setRightPadding(padding);
}
+inline void QTextTableCellFormat::setBorder(qreal width)
+{
+ setTopBorder(width);
+ setBottomBorder(width);
+ setLeftBorder(width);
+ setRightBorder(width);
+}
+
+inline void QTextTableCellFormat::setBorderStyle(QTextFrameFormat::BorderStyle style)
+{
+ setTopBorderStyle(style);
+ setBottomBorderStyle(style);
+ setLeftBorderStyle(style);
+ setRightBorderStyle(style);
+}
+
+inline void QTextTableCellFormat::setBorderBrush(const QBrush &brush)
+{
+ setTopBorderBrush(brush);
+ setBottomBorderBrush(brush);
+ setLeftBorderBrush(brush);
+ setRightBorderBrush(brush);
+}
QT_END_NAMESPACE
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 929db40e5d..5d37982a8b 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -491,12 +491,19 @@ QTextHtmlParserNode::QTextHtmlParserNode()
listStyle(QTextListFormat::ListStyleUndefined), imageWidth(-1), imageHeight(-1), tableBorder(0),
tableCellRowSpan(1), tableCellColSpan(1), tableCellSpacing(2), tableCellPadding(0),
borderBrush(Qt::darkGray), borderStyle(QTextFrameFormat::BorderStyle_Outset),
+ borderCollapse(false),
userState(-1), cssListIndent(0), wsm(WhiteSpaceModeUndefined)
{
margin[QTextHtmlParser::MarginLeft] = 0;
margin[QTextHtmlParser::MarginRight] = 0;
margin[QTextHtmlParser::MarginTop] = 0;
margin[QTextHtmlParser::MarginBottom] = 0;
+
+ for (int i = 0; i < 4; ++i) {
+ tableCellBorderStyle[i] = QTextFrameFormat::BorderStyle_None;
+ tableCellBorder[i] = 0;
+ tableCellBorderBrush[i] = Qt::NoBrush;
+ }
}
void QTextHtmlParser::dumpHtml()
@@ -649,7 +656,7 @@ void QTextHtmlParser::parseTag()
parseExclamationTag();
if (nodes.last().wsm != QTextHtmlParserNode::WhiteSpacePre
&& nodes.last().wsm != QTextHtmlParserNode::WhiteSpacePreWrap
- && !textEditMode)
+ && !textEditMode)
eatSpace();
return;
}
@@ -717,7 +724,8 @@ void QTextHtmlParser::parseTag()
// in a white-space preserving environment strip off a initial newline
// since the element itself already generates a newline
if ((node->wsm == QTextHtmlParserNode::WhiteSpacePre
- || node->wsm == QTextHtmlParserNode::WhiteSpacePreWrap)
+ || node->wsm == QTextHtmlParserNode::WhiteSpacePreWrap
+ || node->wsm == QTextHtmlParserNode::WhiteSpacePreLine)
&& node->isBlock()) {
if (pos < len - 1 && txt.at(pos) == QLatin1Char('\n'))
++pos;
@@ -761,7 +769,8 @@ void QTextHtmlParser::parseCloseTag()
// in a new block for elements following the <pre>
// ...foo\n</pre><p>blah -> foo</pre><p>blah
if ((at(p).wsm == QTextHtmlParserNode::WhiteSpacePre
- || at(p).wsm == QTextHtmlParserNode::WhiteSpacePreWrap)
+ || at(p).wsm == QTextHtmlParserNode::WhiteSpacePreWrap
+ || at(p).wsm == QTextHtmlParserNode::WhiteSpacePreLine)
&& at(p).isBlock()) {
if (at(last()).text.endsWith(QLatin1Char('\n')))
nodes[last()].text.chop(1);
@@ -1125,6 +1134,7 @@ void QTextHtmlParserNode::initializeProperties(const QTextHtmlParserNode *parent
margin[QTextHtmlParser::MarginBottom] = 12;
margin[QTextHtmlParser::MarginLeft] = 40;
margin[QTextHtmlParser::MarginRight] = 40;
+ blockFormat.setProperty(QTextFormat::BlockQuoteLevel, 1);
break;
case Html_dl:
margin[QTextHtmlParser::MarginTop] = 8;
@@ -1166,6 +1176,25 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
QCss::ValueExtractor extractor(declarations);
extractor.extractBox(margin, padding);
+ if (id == Html_td || id == Html_th) {
+ QCss::BorderStyle cssStyles[4];
+ int cssBorder[4];
+ QSize cssRadii[4]; // unused
+ for (int i = 0; i < 4; ++i) {
+ cssStyles[i] = QCss::BorderStyle_None;
+ cssBorder[i] = 0;
+ }
+ // this will parse (and cache) "border-width" as a list so the
+ // QCss::BorderWidth parsing below which expects a single value
+ // will not work as expected - which in this case does not matter
+ // because tableBorder is not relevant for cells.
+ extractor.extractBorder(cssBorder, tableCellBorderBrush, cssStyles, cssRadii);
+ for (int i = 0; i < 4; ++i) {
+ tableCellBorderStyle[i] = static_cast<QTextFrameFormat::BorderStyle>(cssStyles[i] - 1);
+ tableCellBorder[i] = static_cast<qreal>(cssBorder[i]);
+ }
+ }
+
for (int i = 0; i < declarations.count(); ++i) {
const QCss::Declaration &decl = declarations.at(i);
if (decl.d->values.isEmpty()) continue;
@@ -1183,6 +1212,9 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
case QCss::BorderWidth:
tableBorder = extractor.lengthValue(decl);
break;
+ case QCss::BorderCollapse:
+ borderCollapse = decl.borderCollapseValue();
+ break;
case QCss::Color: charFormat.setForeground(decl.colorValue()); break;
case QCss::Float:
cssFloat = QTextFrameFormat::InFlow;
@@ -1277,6 +1309,7 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
case QCss::Value_Pre: wsm = QTextHtmlParserNode::WhiteSpacePre; break;
case QCss::Value_NoWrap: wsm = QTextHtmlParserNode::WhiteSpaceNoWrap; break;
case QCss::Value_PreWrap: wsm = QTextHtmlParserNode::WhiteSpacePreWrap; break;
+ case QCss::Value_PreLine: wsm = QTextHtmlParserNode::WhiteSpacePreLine; break;
default: break;
}
break;
@@ -1334,6 +1367,17 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
default: break;
}
break;
+
+ case QCss::QtForegroundTextureCacheKey:
+ {
+ if (resourceProvider != nullptr && resourceProvider->docHandle() != nullptr) {
+ bool ok;
+ qint64 searchKey = decl.d->values.first().variant.toLongLong(&ok);
+ if (ok)
+ applyForegroundImage(searchKey, resourceProvider);
+ }
+ break;
+ }
default: break;
}
}
@@ -1366,6 +1410,37 @@ void QTextHtmlParserNode::applyCssDeclarations(const QVector<QCss::Declaration>
#endif // QT_NO_CSSPARSER
+void QTextHtmlParserNode::applyForegroundImage(qint64 searchKey, const QTextDocument *resourceProvider)
+{
+ QTextDocumentPrivate *priv = resourceProvider->docHandle();
+ for (int i = 0; i < priv->formats.numFormats(); ++i) {
+ QTextCharFormat format = priv->formats.charFormat(i);
+ if (format.isValid()) {
+ QBrush brush = format.foreground();
+ if (brush.style() == Qt::TexturePattern) {
+ const bool isPixmap = qHasPixmapTexture(brush);
+
+ if (isPixmap && QCoreApplication::instance()->thread() != QThread::currentThread()) {
+ qWarning("Can't apply QPixmap outside of GUI thread");
+ return;
+ }
+
+ const qint64 cacheKey = isPixmap ? brush.texture().cacheKey() : brush.textureImage().cacheKey();
+ if (cacheKey == searchKey) {
+ QBrush b;
+ if (isPixmap)
+ b.setTexture(brush.texture());
+ else
+ b.setTextureImage(brush.textureImage());
+ b.setStyle(Qt::TexturePattern);
+ charFormat.setForeground(b);
+ }
+ }
+ }
+ }
+
+}
+
void QTextHtmlParserNode::applyBackgroundImage(const QString &url, const QTextDocument *resourceProvider)
{
if (!url.isEmpty() && resourceProvider) {
@@ -1564,6 +1639,10 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
} else if (key == QLatin1String("height")) {
node->imageHeight = -2; // register that there is a value for it.
setFloatAttribute(&node->imageHeight, value);
+ } else if (key == QLatin1String("alt")) {
+ node->imageAlt = value;
+ } else if (key == QLatin1String("title")) {
+ node->text = value;
}
break;
case Html_tr:
@@ -1604,6 +1683,11 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
if (!c.isValid())
qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData());
node->charFormat.setBackground(c);
+ } else if (key == QLatin1String("bordercolor")) {
+ QColor c; c.setNamedColor(value);
+ if (!c.isValid())
+ qWarning("QTextHtmlParser::applyAttributes: Unknown color name '%s'",value.toLatin1().constData());
+ node->borderBrush = c;
} else if (key == QLatin1String("background")) {
node->applyBackgroundImage(value, resourceProvider);
} else if (key == QLatin1String("cellspacing")) {
@@ -1639,6 +1723,10 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
else if (key == QLatin1String("type"))
linkType = value;
break;
+ case Html_pre:
+ if (key == QLatin1String("class") && value.startsWith(QLatin1String("language-")))
+ node->blockFormat.setProperty(QTextFormat::BlockCodeLanguage, value.mid(9));
+ break;
default:
break;
}
diff --git a/src/gui/text/qtexthtmlparser_p.h b/src/gui/text/qtexthtmlparser_p.h
index 73dac38b82..31f558709f 100644
--- a/src/gui/text/qtexthtmlparser_p.h
+++ b/src/gui/text/qtexthtmlparser_p.h
@@ -158,6 +158,7 @@ struct QTextHtmlParserNode {
WhiteSpacePre,
WhiteSpaceNoWrap,
WhiteSpacePreWrap,
+ WhiteSpacePreLine,
WhiteSpaceModeUndefined = -1
};
@@ -184,6 +185,7 @@ struct QTextHtmlParserNode {
QString textListNumberPrefix;
QString textListNumberSuffix;
QString imageName;
+ QString imageAlt;
qreal imageWidth;
qreal imageHeight;
QTextLength width;
@@ -193,8 +195,12 @@ struct QTextHtmlParserNode {
int tableCellColSpan;
qreal tableCellSpacing;
qreal tableCellPadding;
+ qreal tableCellBorder[4];
+ QBrush tableCellBorderBrush[4];
+ QTextFrameFormat::BorderStyle tableCellBorderStyle[4];
QBrush borderBrush;
QTextFrameFormat::BorderStyle borderStyle;
+ bool borderCollapse;
int userState;
int cssListIndent;
@@ -250,6 +256,7 @@ struct QTextHtmlParserNode {
void setListStyle(const QVector<QCss::Value> &cssValues);
#endif
+ void applyForegroundImage(qint64 cacheKey, const QTextDocument *resourceProvider);
void applyBackgroundImage(const QString &url, const QTextDocument *resourceProvider);
bool hasOnlyWhitespace() const;
@@ -287,6 +294,10 @@ public:
inline int leftPadding(int i) const { return at(i).padding[MarginLeft]; }
inline int rightPadding(int i) const { return at(i).padding[MarginRight]; }
+ inline qreal tableCellBorder(int i, int edge) const { return at(i).tableCellBorder[edge]; }
+ inline QTextFrameFormat::BorderStyle tableCellBorderStyle(int i, int edge) const { return at(i).tableCellBorderStyle[edge]; }
+ inline QBrush tableCellBorderBrush(int i, int edge) const { return at(i).tableCellBorderBrush[edge]; }
+
void dumpHtml();
void parse(const QString &text, const QTextDocument *resourceProvider);
diff --git a/src/gui/text/qtextimagehandler_p.h b/src/gui/text/qtextimagehandler_p.h
index 339ef0af4f..fafd394ad3 100644
--- a/src/gui/text/qtextimagehandler_p.h
+++ b/src/gui/text/qtextimagehandler_p.h
@@ -65,7 +65,7 @@ class Q_GUI_EXPORT QTextImageHandler : public QObject,
Q_OBJECT
Q_INTERFACES(QTextObjectInterface)
public:
- explicit QTextImageHandler(QObject *parent = 0);
+ explicit QTextImageHandler(QObject *parent = nullptr);
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) override;
virtual void drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format) override;
diff --git a/src/gui/text/qtextmarkdownimporter.cpp b/src/gui/text/qtextmarkdownimporter.cpp
new file mode 100644
index 0000000000..c2ad1e5612
--- /dev/null
+++ b/src/gui/text/qtextmarkdownimporter.cpp
@@ -0,0 +1,601 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtextmarkdownimporter_p.h"
+#include "qtextdocumentfragment_p.h"
+#include <QLoggingCategory>
+#if QT_CONFIG(regularexpression)
+#include <QRegularExpression>
+#endif
+#include <QTextCursor>
+#include <QTextDocument>
+#include <QTextDocumentFragment>
+#include <QTextList>
+#include <QTextTable>
+#include "../../3rdparty/md4c/md4c.h"
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcMD, "qt.text.markdown")
+
+static const QChar Newline = QLatin1Char('\n');
+static const QChar Space = QLatin1Char(' ');
+
+// TODO maybe eliminate the margins after all views recognize BlockQuoteLevel, CSS can format it, etc.
+static const int BlockQuoteIndent = 40; // pixels, same as in QTextHtmlParserNode::initializeProperties
+
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureCollapseWhitespace) == MD_FLAG_COLLAPSEWHITESPACE);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeaturePermissiveATXHeaders) == MD_FLAG_PERMISSIVEATXHEADERS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeaturePermissiveURLAutoLinks) == MD_FLAG_PERMISSIVEURLAUTOLINKS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeaturePermissiveMailAutoLinks) == MD_FLAG_PERMISSIVEEMAILAUTOLINKS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureNoIndentedCodeBlocks) == MD_FLAG_NOINDENTEDCODEBLOCKS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureNoHTMLBlocks) == MD_FLAG_NOHTMLBLOCKS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureNoHTMLSpans) == MD_FLAG_NOHTMLSPANS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureTables) == MD_FLAG_TABLES);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureStrikeThrough) == MD_FLAG_STRIKETHROUGH);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeaturePermissiveWWWAutoLinks) == MD_FLAG_PERMISSIVEWWWAUTOLINKS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeaturePermissiveAutoLinks) == MD_FLAG_PERMISSIVEAUTOLINKS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureTasklists) == MD_FLAG_TASKLISTS);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::FeatureNoHTML) == MD_FLAG_NOHTML);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::DialectCommonMark) == MD_DIALECT_COMMONMARK);
+Q_STATIC_ASSERT(int(QTextMarkdownImporter::DialectGitHub) == MD_DIALECT_GITHUB);
+
+// --------------------------------------------------------
+// MD4C callback function wrappers
+
+static int CbEnterBlock(MD_BLOCKTYPE type, void *detail, void *userdata)
+{
+ QTextMarkdownImporter *mdi = static_cast<QTextMarkdownImporter *>(userdata);
+ return mdi->cbEnterBlock(int(type), detail);
+}
+
+static int CbLeaveBlock(MD_BLOCKTYPE type, void *detail, void *userdata)
+{
+ QTextMarkdownImporter *mdi = static_cast<QTextMarkdownImporter *>(userdata);
+ return mdi->cbLeaveBlock(int(type), detail);
+}
+
+static int CbEnterSpan(MD_SPANTYPE type, void *detail, void *userdata)
+{
+ QTextMarkdownImporter *mdi = static_cast<QTextMarkdownImporter *>(userdata);
+ return mdi->cbEnterSpan(int(type), detail);
+}
+
+static int CbLeaveSpan(MD_SPANTYPE type, void *detail, void *userdata)
+{
+ QTextMarkdownImporter *mdi = static_cast<QTextMarkdownImporter *>(userdata);
+ return mdi->cbLeaveSpan(int(type), detail);
+}
+
+static int CbText(MD_TEXTTYPE type, const MD_CHAR *text, MD_SIZE size, void *userdata)
+{
+ QTextMarkdownImporter *mdi = static_cast<QTextMarkdownImporter *>(userdata);
+ return mdi->cbText(int(type), text, size);
+}
+
+static void CbDebugLog(const char *msg, void *userdata)
+{
+ Q_UNUSED(userdata)
+ qCDebug(lcMD) << msg;
+}
+
+// MD4C callback function wrappers
+// --------------------------------------------------------
+
+static Qt::Alignment MdAlignment(MD_ALIGN a, Qt::Alignment defaultAlignment = Qt::AlignLeft | Qt::AlignVCenter)
+{
+ switch (a) {
+ case MD_ALIGN_LEFT:
+ return Qt::AlignLeft | Qt::AlignVCenter;
+ case MD_ALIGN_CENTER:
+ return Qt::AlignHCenter | Qt::AlignVCenter;
+ case MD_ALIGN_RIGHT:
+ return Qt::AlignRight | Qt::AlignVCenter;
+ default: // including MD_ALIGN_DEFAULT
+ return defaultAlignment;
+ }
+}
+
+QTextMarkdownImporter::QTextMarkdownImporter(QTextMarkdownImporter::Features features)
+ : m_monoFont(QFontDatabase::systemFont(QFontDatabase::FixedFont))
+ , m_features(features)
+{
+}
+
+QTextMarkdownImporter::QTextMarkdownImporter(QTextDocument::MarkdownFeatures features)
+ : QTextMarkdownImporter(static_cast<QTextMarkdownImporter::Features>(int(features)))
+{
+}
+
+void QTextMarkdownImporter::import(QTextDocument *doc, const QString &markdown)
+{
+ MD_PARSER callbacks = {
+ 0, // abi_version
+ unsigned(m_features),
+ &CbEnterBlock,
+ &CbLeaveBlock,
+ &CbEnterSpan,
+ &CbLeaveSpan,
+ &CbText,
+ &CbDebugLog,
+ nullptr // syntax
+ };
+ m_doc = doc;
+ m_paragraphMargin = m_doc->defaultFont().pointSize() * 2 / 3;
+ m_cursor = new QTextCursor(doc);
+ doc->clear();
+ qCDebug(lcMD) << "default font" << doc->defaultFont() << "mono font" << m_monoFont;
+ QByteArray md = markdown.toUtf8();
+ md_parse(md.constData(), MD_SIZE(md.size()), &callbacks, this);
+ delete m_cursor;
+ m_cursor = nullptr;
+}
+
+int QTextMarkdownImporter::cbEnterBlock(int blockType, void *det)
+{
+ m_blockType = blockType;
+ switch (blockType) {
+ case MD_BLOCK_P:
+ if (!m_listStack.isEmpty())
+ qCDebug(lcMD, m_listItem ? "P of LI at level %d" : "P continuation inside LI at level %d", m_listStack.count());
+ else
+ qCDebug(lcMD, "P");
+ m_needsInsertBlock = true;
+ break;
+ case MD_BLOCK_QUOTE:
+ ++m_blockQuoteDepth;
+ qCDebug(lcMD, "QUOTE level %d", m_blockQuoteDepth);
+ break;
+ case MD_BLOCK_CODE: {
+ MD_BLOCK_CODE_DETAIL *detail = static_cast<MD_BLOCK_CODE_DETAIL *>(det);
+ m_codeBlock = true;
+ m_blockCodeLanguage = QLatin1String(detail->lang.text, int(detail->lang.size));
+ m_blockCodeFence = detail->fence_char;
+ QString info = QLatin1String(detail->info.text, int(detail->info.size));
+ m_needsInsertBlock = true;
+ if (m_blockQuoteDepth)
+ qCDebug(lcMD, "CODE lang '%s' info '%s' fenced with '%c' inside QUOTE %d", qPrintable(m_blockCodeLanguage), qPrintable(info), m_blockCodeFence, m_blockQuoteDepth);
+ else
+ qCDebug(lcMD, "CODE lang '%s' info '%s' fenced with '%c'", qPrintable(m_blockCodeLanguage), qPrintable(info), m_blockCodeFence);
+ } break;
+ case MD_BLOCK_H: {
+ MD_BLOCK_H_DETAIL *detail = static_cast<MD_BLOCK_H_DETAIL *>(det);
+ QTextBlockFormat blockFmt;
+ QTextCharFormat charFmt;
+ int sizeAdjustment = 4 - int(detail->level); // H1 to H6: +3 to -2
+ charFmt.setProperty(QTextFormat::FontSizeAdjustment, sizeAdjustment);
+ charFmt.setFontWeight(QFont::Bold);
+ blockFmt.setHeadingLevel(int(detail->level));
+ m_needsInsertBlock = false;
+ m_cursor->insertBlock(blockFmt, charFmt);
+ qCDebug(lcMD, "H%d", detail->level);
+ } break;
+ case MD_BLOCK_LI: {
+ m_needsInsertBlock = true;
+ m_listItem = true;
+ MD_BLOCK_LI_DETAIL *detail = static_cast<MD_BLOCK_LI_DETAIL *>(det);
+ m_markerType = detail->is_task ?
+ (detail->task_mark == ' ' ? QTextBlockFormat::MarkerType::Unchecked : QTextBlockFormat::MarkerType::Checked) :
+ QTextBlockFormat::MarkerType::NoMarker;
+ qCDebug(lcMD) << "LI";
+ } break;
+ case MD_BLOCK_UL: {
+ if (m_needsInsertList) // list nested in an empty list
+ m_listStack.push(m_cursor->insertList(m_listFormat));
+ else
+ m_needsInsertList = true;
+ MD_BLOCK_UL_DETAIL *detail = static_cast<MD_BLOCK_UL_DETAIL *>(det);
+ m_listFormat = QTextListFormat();
+ m_listFormat.setIndent(m_listStack.count() + 1);
+ switch (detail->mark) {
+ case '*':
+ m_listFormat.setStyle(QTextListFormat::ListCircle);
+ break;
+ case '+':
+ m_listFormat.setStyle(QTextListFormat::ListSquare);
+ break;
+ default: // including '-'
+ m_listFormat.setStyle(QTextListFormat::ListDisc);
+ break;
+ }
+ qCDebug(lcMD, "UL %c level %d", detail->mark, m_listStack.count() + 1);
+ } break;
+ case MD_BLOCK_OL: {
+ if (m_needsInsertList) // list nested in an empty list
+ m_listStack.push(m_cursor->insertList(m_listFormat));
+ else
+ m_needsInsertList = true;
+ MD_BLOCK_OL_DETAIL *detail = static_cast<MD_BLOCK_OL_DETAIL *>(det);
+ m_listFormat = QTextListFormat();
+ m_listFormat.setIndent(m_listStack.count() + 1);
+ m_listFormat.setNumberSuffix(QChar::fromLatin1(detail->mark_delimiter));
+ m_listFormat.setStyle(QTextListFormat::ListDecimal);
+ qCDebug(lcMD, "OL xx%d level %d", detail->mark_delimiter, m_listStack.count() + 1);
+ } break;
+ case MD_BLOCK_TD: {
+ MD_BLOCK_TD_DETAIL *detail = static_cast<MD_BLOCK_TD_DETAIL *>(det);
+ ++m_tableCol;
+ // absolute movement (and storage of m_tableCol) shouldn't be necessary, but
+ // movePosition(QTextCursor::NextCell) doesn't work
+ QTextTableCell cell = m_currentTable->cellAt(m_tableRowCount - 1, m_tableCol);
+ if (!cell.isValid()) {
+ qWarning("malformed table in Markdown input");
+ return 1;
+ }
+ *m_cursor = cell.firstCursorPosition();
+ QTextBlockFormat blockFmt = m_cursor->blockFormat();
+ blockFmt.setAlignment(MdAlignment(detail->align));
+ m_cursor->setBlockFormat(blockFmt);
+ qCDebug(lcMD) << "TD; align" << detail->align << MdAlignment(detail->align) << "col" << m_tableCol;
+ } break;
+ case MD_BLOCK_TH: {
+ ++m_tableColumnCount;
+ ++m_tableCol;
+ if (m_currentTable->columns() < m_tableColumnCount)
+ m_currentTable->appendColumns(1);
+ auto cell = m_currentTable->cellAt(m_tableRowCount - 1, m_tableCol);
+ if (!cell.isValid()) {
+ qWarning("malformed table in Markdown input");
+ return 1;
+ }
+ auto fmt = cell.format();
+ fmt.setFontWeight(QFont::Bold);
+ cell.setFormat(fmt);
+ } break;
+ case MD_BLOCK_TR: {
+ ++m_tableRowCount;
+ m_nonEmptyTableCells.clear();
+ if (m_currentTable->rows() < m_tableRowCount)
+ m_currentTable->appendRows(1);
+ m_tableCol = -1;
+ qCDebug(lcMD) << "TR" << m_currentTable->rows();
+ } break;
+ case MD_BLOCK_TABLE:
+ m_tableColumnCount = 0;
+ m_tableRowCount = 0;
+ m_currentTable = m_cursor->insertTable(1, 1); // we don't know the dimensions yet
+ break;
+ case MD_BLOCK_HR: {
+ qCDebug(lcMD, "HR");
+ QTextBlockFormat blockFmt;
+ blockFmt.setProperty(QTextFormat::BlockTrailingHorizontalRulerWidth, 1);
+ m_cursor->insertBlock(blockFmt, QTextCharFormat());
+ } break;
+ default:
+ break; // nothing to do for now
+ }
+ return 0; // no error
+}
+
+int QTextMarkdownImporter::cbLeaveBlock(int blockType, void *detail)
+{
+ Q_UNUSED(detail)
+ switch (blockType) {
+ case MD_BLOCK_P:
+ m_listItem = false;
+ break;
+ case MD_BLOCK_UL:
+ case MD_BLOCK_OL:
+ if (Q_UNLIKELY(m_needsInsertList))
+ m_listStack.push(m_cursor->createList(m_listFormat));
+ if (Q_UNLIKELY(m_listStack.isEmpty())) {
+ qCWarning(lcMD, "list ended unexpectedly");
+ } else {
+ qCDebug(lcMD, "list at level %d ended", m_listStack.count());
+ m_listStack.pop();
+ }
+ break;
+ case MD_BLOCK_TR: {
+ // https://github.com/mity/md4c/issues/29
+ // MD4C doesn't tell us explicitly which cells are merged, so merge empty cells
+ // with previous non-empty ones
+ int mergeEnd = -1;
+ int mergeBegin = -1;
+ for (int col = m_tableCol; col >= 0; --col) {
+ if (m_nonEmptyTableCells.contains(col)) {
+ if (mergeEnd >= 0 && mergeBegin >= 0) {
+ qCDebug(lcMD) << "merging cells" << mergeBegin << "to" << mergeEnd << "inclusive, on row" << m_currentTable->rows() - 1;
+ m_currentTable->mergeCells(m_currentTable->rows() - 1, mergeBegin - 1, 1, mergeEnd - mergeBegin + 2);
+ }
+ mergeEnd = -1;
+ mergeBegin = -1;
+ } else {
+ if (mergeEnd < 0)
+ mergeEnd = col;
+ else
+ mergeBegin = col;
+ }
+ }
+ } break;
+ case MD_BLOCK_QUOTE: {
+ qCDebug(lcMD, "QUOTE level %d ended", m_blockQuoteDepth);
+ --m_blockQuoteDepth;
+ m_needsInsertBlock = true;
+ } break;
+ case MD_BLOCK_TABLE:
+ qCDebug(lcMD) << "table ended with" << m_currentTable->columns() << "cols and" << m_currentTable->rows() << "rows";
+ m_currentTable = nullptr;
+ m_cursor->movePosition(QTextCursor::End);
+ break;
+ case MD_BLOCK_LI:
+ qCDebug(lcMD, "LI at level %d ended", m_listStack.count());
+ m_listItem = false;
+ break;
+ case MD_BLOCK_CODE: {
+ m_codeBlock = false;
+ m_blockCodeLanguage.clear();
+ m_blockCodeFence = 0;
+ if (m_blockQuoteDepth)
+ qCDebug(lcMD, "CODE ended inside QUOTE %d", m_blockQuoteDepth);
+ else
+ qCDebug(lcMD, "CODE ended");
+ m_needsInsertBlock = true;
+ } break;
+ case MD_BLOCK_H:
+ m_cursor->setCharFormat(QTextCharFormat());
+ break;
+ default:
+ break;
+ }
+ return 0; // no error
+}
+
+int QTextMarkdownImporter::cbEnterSpan(int spanType, void *det)
+{
+ QTextCharFormat charFmt;
+ switch (spanType) {
+ case MD_SPAN_EM:
+ charFmt.setFontItalic(true);
+ break;
+ case MD_SPAN_STRONG:
+ charFmt.setFontWeight(QFont::Bold);
+ break;
+ case MD_SPAN_A: {
+ MD_SPAN_A_DETAIL *detail = static_cast<MD_SPAN_A_DETAIL *>(det);
+ QString url = QString::fromLatin1(detail->href.text, int(detail->href.size));
+ QString title = QString::fromLatin1(detail->title.text, int(detail->title.size));
+ charFmt.setAnchorHref(url);
+ charFmt.setAnchorNames(QStringList(title));
+ charFmt.setForeground(m_palette.link());
+ qCDebug(lcMD) << "anchor" << url << title;
+ } break;
+ case MD_SPAN_IMG: {
+ m_imageSpan = true;
+ m_imageFormat = QTextImageFormat();
+ MD_SPAN_IMG_DETAIL *detail = static_cast<MD_SPAN_IMG_DETAIL *>(det);
+ m_imageFormat.setName(QString::fromUtf8(detail->src.text, int(detail->src.size)));
+ m_imageFormat.setProperty(QTextFormat::ImageTitle, QString::fromUtf8(detail->title.text, int(detail->title.size)));
+ break;
+ }
+ case MD_SPAN_CODE:
+ charFmt.setFont(m_monoFont);
+ break;
+ case MD_SPAN_DEL:
+ charFmt.setFontStrikeOut(true);
+ break;
+ }
+ m_spanFormatStack.push(charFmt);
+ qCDebug(lcMD) << spanType << "setCharFormat" << charFmt.font().family() << charFmt.fontWeight()
+ << (charFmt.fontItalic() ? "italic" : "") << charFmt.foreground().color().name();
+ m_cursor->setCharFormat(charFmt);
+ return 0; // no error
+}
+
+int QTextMarkdownImporter::cbLeaveSpan(int spanType, void *detail)
+{
+ Q_UNUSED(detail)
+ QTextCharFormat charFmt;
+ if (!m_spanFormatStack.isEmpty()) {
+ m_spanFormatStack.pop();
+ if (!m_spanFormatStack.isEmpty())
+ charFmt = m_spanFormatStack.top();
+ }
+ m_cursor->setCharFormat(charFmt);
+ qCDebug(lcMD) << spanType << "setCharFormat" << charFmt.font().family() << charFmt.fontWeight()
+ << (charFmt.fontItalic() ? "italic" : "") << charFmt.foreground().color().name();
+ if (spanType == int(MD_SPAN_IMG))
+ m_imageSpan = false;
+ return 0; // no error
+}
+
+int QTextMarkdownImporter::cbText(int textType, const char *text, unsigned size)
+{
+ if (m_needsInsertBlock)
+ insertBlock();
+#if QT_CONFIG(regularexpression)
+ static const QRegularExpression openingBracket(QStringLiteral("<[a-zA-Z]"));
+ static const QRegularExpression closingBracket(QStringLiteral("(/>|</)"));
+#endif
+ QString s = QString::fromUtf8(text, int(size));
+
+ switch (textType) {
+ case MD_TEXT_NORMAL:
+#if QT_CONFIG(regularexpression)
+ if (m_htmlTagDepth) {
+ m_htmlAccumulator += s;
+ s = QString();
+ }
+#endif
+ break;
+ case MD_TEXT_NULLCHAR:
+ s = QString(QChar(0xFFFD)); // CommonMark-required replacement for null
+ break;
+ case MD_TEXT_BR:
+ s = QString(Newline);
+ break;
+ case MD_TEXT_SOFTBR:
+ s = QString(Space);
+ break;
+ case MD_TEXT_CODE:
+ // We'll see MD_SPAN_CODE too, which will set the char format, and that's enough.
+ break;
+#if QT_CONFIG(texthtmlparser)
+ case MD_TEXT_ENTITY:
+ m_cursor->insertHtml(s);
+ s = QString();
+ break;
+#endif
+ case MD_TEXT_HTML:
+ // count how many tags are opened and how many are closed
+#if QT_CONFIG(regularexpression) && QT_CONFIG(texthtmlparser)
+ {
+ int startIdx = 0;
+ while ((startIdx = s.indexOf(openingBracket, startIdx)) >= 0) {
+ ++m_htmlTagDepth;
+ startIdx += 2;
+ }
+ startIdx = 0;
+ while ((startIdx = s.indexOf(closingBracket, startIdx)) >= 0) {
+ --m_htmlTagDepth;
+ startIdx += 2;
+ }
+ }
+ m_htmlAccumulator += s;
+ if (!m_htmlTagDepth) { // all open tags are now closed
+ qCDebug(lcMD) << "HTML" << m_htmlAccumulator;
+ m_cursor->insertHtml(m_htmlAccumulator);
+ if (m_spanFormatStack.isEmpty())
+ m_cursor->setCharFormat(QTextCharFormat());
+ else
+ m_cursor->setCharFormat(m_spanFormatStack.top());
+ m_htmlAccumulator = QString();
+ }
+#endif
+ s = QString();
+ break;
+ }
+
+ switch (m_blockType) {
+ case MD_BLOCK_TD:
+ m_nonEmptyTableCells.append(m_tableCol);
+ break;
+ default:
+ break;
+ }
+
+ if (m_imageSpan) {
+ // TODO we don't yet support alt text with formatting, because of the cases where m_cursor
+ // already inserted the text above. Rather need to accumulate it in case we need it here.
+ m_imageFormat.setProperty(QTextFormat::ImageAltText, s);
+ qCDebug(lcMD) << "image" << m_imageFormat.name()
+ << "title" << m_imageFormat.stringProperty(QTextFormat::ImageTitle)
+ << "alt" << s << "relative to" << m_doc->baseUrl();
+ m_cursor->insertImage(m_imageFormat);
+ return 0; // no error
+ }
+
+ if (!s.isEmpty())
+ m_cursor->insertText(s);
+ if (m_cursor->currentList()) {
+ // The list item will indent the list item's text, so we don't need indentation on the block.
+ QTextBlockFormat bfmt = m_cursor->blockFormat();
+ bfmt.setIndent(0);
+ m_cursor->setBlockFormat(bfmt);
+ }
+ if (lcMD().isEnabled(QtDebugMsg)) {
+ QTextBlockFormat bfmt = m_cursor->blockFormat();
+ QString debugInfo;
+ if (m_cursor->currentList())
+ debugInfo = QLatin1String("in list at depth ") + QString::number(m_cursor->currentList()->format().indent());
+ if (bfmt.hasProperty(QTextFormat::BlockQuoteLevel))
+ debugInfo += QLatin1String("in blockquote at depth ") +
+ QString::number(bfmt.intProperty(QTextFormat::BlockQuoteLevel));
+ if (bfmt.hasProperty(QTextFormat::BlockCodeLanguage))
+ debugInfo += QLatin1String("in a code block");
+ qCDebug(lcMD) << textType << "in block" << m_blockType << s << qPrintable(debugInfo)
+ << "bindent" << bfmt.indent() << "tindent" << bfmt.textIndent()
+ << "margins" << bfmt.leftMargin() << bfmt.topMargin() << bfmt.bottomMargin() << bfmt.rightMargin();
+ }
+ qCDebug(lcMD) << textType << "in block" << m_blockType << s << "in list?" << m_cursor->currentList()
+ << "indent" << m_cursor->blockFormat().indent();
+ return 0; // no error
+}
+
+/*!
+ Insert a new block based on stored state.
+
+ m_cursor cannot store the state for the _next_ block ahead of time, because
+ m_cursor->setBlockFormat() controls the format of the block that the cursor
+ is already in; so cbLeaveBlock() cannot call setBlockFormat() without
+ altering the block that was just added. Therefore cbLeaveBlock() and the
+ following cbEnterBlock() set variables to remember what formatting should
+ come next, and insertBlock() is called just before the actual text
+ insertion, to create a new block with the right formatting.
+*/
+void QTextMarkdownImporter::insertBlock()
+{
+ QTextCharFormat charFormat;
+ if (!m_spanFormatStack.isEmpty())
+ charFormat = m_spanFormatStack.top();
+ QTextBlockFormat blockFormat;
+ if (!m_listStack.isEmpty() && !m_needsInsertList && m_listItem) {
+ QTextList *list = m_listStack.top();
+ blockFormat = list->item(list->count() - 1).blockFormat();
+ }
+ if (m_blockQuoteDepth) {
+ blockFormat.setProperty(QTextFormat::BlockQuoteLevel, m_blockQuoteDepth);
+ blockFormat.setLeftMargin(BlockQuoteIndent * m_blockQuoteDepth);
+ blockFormat.setRightMargin(BlockQuoteIndent);
+ }
+ if (m_codeBlock) {
+ blockFormat.setProperty(QTextFormat::BlockCodeLanguage, m_blockCodeLanguage);
+ if (m_blockCodeFence)
+ blockFormat.setProperty(QTextFormat::BlockCodeFence, QString(QLatin1Char(m_blockCodeFence)));
+ charFormat.setFont(m_monoFont);
+ } else {
+ blockFormat.setTopMargin(m_paragraphMargin);
+ blockFormat.setBottomMargin(m_paragraphMargin);
+ }
+ if (m_markerType == QTextBlockFormat::MarkerType::NoMarker)
+ blockFormat.clearProperty(QTextFormat::BlockMarker);
+ else
+ blockFormat.setMarker(m_markerType);
+ if (!m_listStack.isEmpty())
+ blockFormat.setIndent(m_listStack.count());
+ m_cursor->insertBlock(blockFormat, charFormat);
+ if (m_needsInsertList) {
+ m_listStack.push(m_cursor->createList(m_listFormat));
+ } else if (!m_listStack.isEmpty() && m_listItem) {
+ m_listStack.top()->add(m_cursor->block());
+ }
+ m_needsInsertList = false;
+ m_needsInsertBlock = false;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qtextmarkdownimporter_p.h b/src/gui/text/qtextmarkdownimporter_p.h
new file mode 100644
index 0000000000..f450da5eb3
--- /dev/null
+++ b/src/gui/text/qtextmarkdownimporter_p.h
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTEXTMARKDOWNIMPORTER_H
+#define QTEXTMARKDOWNIMPORTER_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/qfont.h>
+#include <QtGui/qtguiglobal.h>
+#include <QtGui/qpalette.h>
+#include <QtGui/qtextdocument.h>
+#include <QtGui/qtextlist.h>
+#include <QtCore/qstack.h>
+
+QT_BEGIN_NAMESPACE
+
+class QTextCursor;
+class QTextDocument;
+class QTextTable;
+
+class Q_GUI_EXPORT QTextMarkdownImporter
+{
+public:
+ enum Feature {
+ FeatureCollapseWhitespace = 0x0001,
+ FeaturePermissiveATXHeaders = 0x0002,
+ FeaturePermissiveURLAutoLinks = 0x0004,
+ FeaturePermissiveMailAutoLinks = 0x0008,
+ FeatureNoIndentedCodeBlocks = 0x0010,
+ FeatureNoHTMLBlocks = 0x0020,
+ FeatureNoHTMLSpans = 0x0040,
+ FeatureTables = 0x0100,
+ FeatureStrikeThrough = 0x0200,
+ FeaturePermissiveWWWAutoLinks = 0x0400,
+ FeatureTasklists = 0x0800,
+ // composite flags
+ FeaturePermissiveAutoLinks = FeaturePermissiveMailAutoLinks
+ | FeaturePermissiveURLAutoLinks | FeaturePermissiveWWWAutoLinks,
+ FeatureNoHTML = QTextDocument::MarkdownNoHTML,
+ DialectCommonMark = QTextDocument::MarkdownDialectCommonMark,
+ DialectGitHub = QTextDocument::MarkdownDialectGitHub
+ };
+ Q_DECLARE_FLAGS(Features, Feature)
+
+ QTextMarkdownImporter(Features features);
+ QTextMarkdownImporter(QTextDocument::MarkdownFeatures features);
+
+ void import(QTextDocument *doc, const QString &markdown);
+
+public:
+ // MD4C callbacks
+ int cbEnterBlock(int blockType, void* detail);
+ int cbLeaveBlock(int blockType, void* detail);
+ int cbEnterSpan(int spanType, void* detail);
+ int cbLeaveSpan(int spanType, void* detail);
+ int cbText(int textType, const char* text, unsigned size);
+
+private:
+ void insertBlock();
+
+private:
+ QTextDocument *m_doc = nullptr;
+ QTextCursor *m_cursor = nullptr;
+ QTextTable *m_currentTable = nullptr; // because m_cursor->currentTable() doesn't work
+#if QT_CONFIG(regularexpression)
+ QString m_htmlAccumulator;
+#endif
+ QString m_blockCodeLanguage;
+ QVector<int> m_nonEmptyTableCells; // in the current row
+ QStack<QTextList *> m_listStack;
+ QStack<QTextCharFormat> m_spanFormatStack;
+ QFont m_monoFont;
+ QPalette m_palette;
+#if QT_CONFIG(regularexpression)
+ int m_htmlTagDepth = 0;
+#endif
+ int m_blockQuoteDepth = 0;
+ int m_tableColumnCount = 0;
+ int m_tableRowCount = 0;
+ int m_tableCol = -1; // because relative cell movements (e.g. m_cursor->movePosition(QTextCursor::NextCell)) don't work
+ int m_paragraphMargin = 0;
+ int m_blockType = 0;
+ char m_blockCodeFence = 0;
+ Features m_features;
+ QTextImageFormat m_imageFormat;
+ QTextListFormat m_listFormat;
+ QTextBlockFormat::MarkerType m_markerType = QTextBlockFormat::MarkerType::NoMarker;
+ bool m_needsInsertBlock = false;
+ bool m_needsInsertList = false;
+ bool m_listItem = false; // true from the beginning of LI to the end of the first P
+ bool m_codeBlock = false;
+ bool m_imageSpan = false;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QTextMarkdownImporter::Features)
+
+QT_END_NAMESPACE
+
+#endif // QTEXTMARKDOWNIMPORTER_H
diff --git a/src/gui/text/qtextmarkdownwriter.cpp b/src/gui/text/qtextmarkdownwriter.cpp
new file mode 100644
index 0000000000..c9a63920c3
--- /dev/null
+++ b/src/gui/text/qtextmarkdownwriter.cpp
@@ -0,0 +1,565 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtextmarkdownwriter_p.h"
+#include "qtextdocumentlayout_p.h"
+#include "qfontinfo.h"
+#include "qfontmetrics.h"
+#include "qtextdocument_p.h"
+#include "qtextlist.h"
+#include "qtexttable.h"
+#include "qtextcursor.h"
+#include "qtextimagehandler_p.h"
+#include "qloggingcategory.h"
+#if QT_CONFIG(itemmodel)
+#include "qabstractitemmodel.h"
+#endif
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcMDW, "qt.text.markdown.writer")
+
+static const QChar Space = QLatin1Char(' ');
+static const QChar Newline = QLatin1Char('\n');
+static const QChar LineBreak = QChar(0x2028);
+static const QChar DoubleQuote = QLatin1Char('"');
+static const QChar Backtick = QLatin1Char('`');
+static const QChar Period = QLatin1Char('.');
+
+QTextMarkdownWriter::QTextMarkdownWriter(QTextStream &stream, QTextDocument::MarkdownFeatures features)
+ : m_stream(stream), m_features(features)
+{
+}
+
+bool QTextMarkdownWriter::writeAll(const QTextDocument *document)
+{
+ writeFrame(document->rootFrame());
+ return true;
+}
+
+#if QT_CONFIG(itemmodel)
+void QTextMarkdownWriter::writeTable(const QAbstractItemModel *table)
+{
+ QVector<int> tableColumnWidths(table->columnCount());
+ for (int col = 0; col < table->columnCount(); ++col) {
+ tableColumnWidths[col] = table->headerData(col, Qt::Horizontal).toString().length();
+ for (int row = 0; row < table->rowCount(); ++row) {
+ tableColumnWidths[col] = qMax(tableColumnWidths[col],
+ table->data(table->index(row, col)).toString().length());
+ }
+ }
+
+ // write the header and separator
+ for (int col = 0; col < table->columnCount(); ++col) {
+ QString s = table->headerData(col, Qt::Horizontal).toString();
+ m_stream << "|" << s << QString(tableColumnWidths[col] - s.length(), Space);
+ }
+ m_stream << "|" << Qt::endl;
+ for (int col = 0; col < tableColumnWidths.length(); ++col)
+ m_stream << '|' << QString(tableColumnWidths[col], QLatin1Char('-'));
+ m_stream << '|'<< Qt::endl;
+
+ // write the body
+ for (int row = 0; row < table->rowCount(); ++row) {
+ for (int col = 0; col < table->columnCount(); ++col) {
+ QString s = table->data(table->index(row, col)).toString();
+ m_stream << "|" << s << QString(tableColumnWidths[col] - s.length(), Space);
+ }
+ m_stream << '|'<< Qt::endl;
+ }
+ m_listInfo.clear();
+}
+#endif
+
+void QTextMarkdownWriter::writeFrame(const QTextFrame *frame)
+{
+ Q_ASSERT(frame);
+ const QTextTable *table = qobject_cast<const QTextTable*> (frame);
+ QTextFrame::iterator iterator = frame->begin();
+ QTextFrame *child = nullptr;
+ int tableRow = -1;
+ bool lastWasList = false;
+ QVector<int> tableColumnWidths;
+ if (table) {
+ tableColumnWidths.resize(table->columns());
+ for (int col = 0; col < table->columns(); ++col) {
+ for (int row = 0; row < table->rows(); ++ row) {
+ QTextTableCell cell = table->cellAt(row, col);
+ int cellTextLen = 0;
+ auto it = cell.begin();
+ while (it != cell.end()) {
+ QTextBlock block = it.currentBlock();
+ if (block.isValid())
+ cellTextLen += block.text().length();
+ ++it;
+ }
+ if (cell.columnSpan() == 1 && tableColumnWidths[col] < cellTextLen)
+ tableColumnWidths[col] = cellTextLen;
+ }
+ }
+ }
+ while (!iterator.atEnd()) {
+ if (iterator.currentFrame() && child != iterator.currentFrame())
+ writeFrame(iterator.currentFrame());
+ else { // no frame, it's a block
+ QTextBlock block = iterator.currentBlock();
+ // Look ahead and detect some cases when we should
+ // suppress needless blank lines, when there will be a big change in block format
+ bool nextIsDifferent = false;
+ bool ending = false;
+ {
+ QTextFrame::iterator next = iterator;
+ ++next;
+ if (next.atEnd()) {
+ nextIsDifferent = true;
+ ending = true;
+ } else {
+ QTextBlockFormat format = iterator.currentBlock().blockFormat();
+ QTextBlockFormat nextFormat = next.currentBlock().blockFormat();
+ if (nextFormat.indent() != format.indent() ||
+ nextFormat.property(QTextFormat::BlockCodeLanguage) != format.property(QTextFormat::BlockCodeLanguage))
+ nextIsDifferent = true;
+ }
+ }
+ if (table) {
+ QTextTableCell cell = table->cellAt(block.position());
+ if (tableRow < cell.row()) {
+ if (tableRow == 0) {
+ m_stream << Newline;
+ for (int col = 0; col < tableColumnWidths.length(); ++col)
+ m_stream << '|' << QString(tableColumnWidths[col], QLatin1Char('-'));
+ m_stream << '|';
+ }
+ m_stream << Newline << "|";
+ tableRow = cell.row();
+ }
+ } else if (!block.textList()) {
+ if (lastWasList)
+ m_stream << Newline;
+ }
+ int endingCol = writeBlock(block, !table, table && tableRow == 0,
+ nextIsDifferent && !block.textList());
+ m_doubleNewlineWritten = false;
+ if (table) {
+ QTextTableCell cell = table->cellAt(block.position());
+ int paddingLen = -endingCol;
+ int spanEndCol = cell.column() + cell.columnSpan();
+ for (int col = cell.column(); col < spanEndCol; ++col)
+ paddingLen += tableColumnWidths[col];
+ if (paddingLen > 0)
+ m_stream << QString(paddingLen, Space);
+ for (int col = cell.column(); col < spanEndCol; ++col)
+ m_stream << "|";
+ } else if (m_fencedCodeBlock && ending) {
+ m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space)
+ << m_codeBlockFence << Newline << Newline;
+ m_codeBlockFence.clear();
+ } else if (m_indentedCodeBlock && nextIsDifferent) {
+ m_stream << Newline;
+ } else if (endingCol > 0) {
+ if (block.textList() || block.blockFormat().hasProperty(QTextFormat::BlockCodeLanguage)) {
+ m_stream << Newline;
+ } else {
+ m_stream << Newline << Newline;
+ m_doubleNewlineWritten = true;
+ }
+ }
+ lastWasList = block.textList();
+ }
+ child = iterator.currentFrame();
+ ++iterator;
+ }
+ if (table) {
+ m_stream << Newline << Newline;
+ m_doubleNewlineWritten = true;
+ }
+ m_listInfo.clear();
+}
+
+QTextMarkdownWriter::ListInfo QTextMarkdownWriter::listInfo(QTextList *list)
+{
+ if (!m_listInfo.contains(list)) {
+ // decide whether this list is loose or tight
+ ListInfo info;
+ info.loose = false;
+ if (list->count() > 1) {
+ QTextBlock first = list->item(0);
+ QTextBlock last = list->item(list->count() - 1);
+ QTextBlock next = first.next();
+ while (next.isValid()) {
+ if (next == last)
+ break;
+ qCDebug(lcMDW) << "next block in list" << list << next.text() << "part of list?" << next.textList();
+ if (!next.textList()) {
+ // If we find a continuation paragraph, this list is "loose"
+ // because it will need a blank line to separate that paragraph.
+ qCDebug(lcMDW) << "decided list beginning with" << first.text() << "is loose after" << next.text();
+ info.loose = true;
+ break;
+ }
+ next = next.next();
+ }
+ }
+ m_listInfo.insert(list, info);
+ return info;
+ }
+ return m_listInfo.value(list);
+}
+
+static int nearestWordWrapIndex(const QString &s, int before)
+{
+ before = qMin(before, s.length());
+ int fragBegin = qMax(before - 15, 0);
+ if (lcMDW().isDebugEnabled()) {
+ QString frag = s.mid(fragBegin, 30);
+ qCDebug(lcMDW) << frag << before;
+ qCDebug(lcMDW) << QString(before - fragBegin, Period) + QLatin1Char('<');
+ }
+ for (int i = before - 1; i >= 0; --i) {
+ if (s.at(i).isSpace()) {
+ qCDebug(lcMDW) << QString(i - fragBegin, Period) + QLatin1Char('^') << i;
+ return i;
+ }
+ }
+ qCDebug(lcMDW, "not possible");
+ return -1;
+}
+
+static int adjacentBackticksCount(const QString &s)
+{
+ int start = -1, len = s.length();
+ int ret = 0;
+ for (int i = 0; i < len; ++i) {
+ if (s.at(i) == Backtick) {
+ if (start < 0)
+ start = i;
+ } else if (start >= 0) {
+ ret = qMax(ret, i - start);
+ start = -1;
+ }
+ }
+ if (s.at(len - 1) == Backtick)
+ ret = qMax(ret, len - start);
+ return ret;
+}
+
+static void maybeEscapeFirstChar(QString &s)
+{
+ QString sTrimmed = s.trimmed();
+ if (sTrimmed.isEmpty())
+ return;
+ char firstChar = sTrimmed.at(0).toLatin1();
+ if (firstChar == '*' || firstChar == '+' || firstChar == '-') {
+ int i = s.indexOf(QLatin1Char(firstChar));
+ s.insert(i, QLatin1Char('\\'));
+ }
+}
+
+int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ignoreFormat, bool ignoreEmpty)
+{
+ if (block.text().isEmpty() && ignoreEmpty)
+ return 0;
+ const int ColumnLimit = 80;
+ QTextBlockFormat blockFmt = block.blockFormat();
+ bool missedBlankCodeBlockLine = false;
+ if (block.textList()) { // it's a list-item
+ auto fmt = block.textList()->format();
+ const int listLevel = fmt.indent();
+ const int number = block.textList()->itemNumber(block) + 1;
+ QByteArray bullet = " ";
+ bool numeric = false;
+ switch (fmt.style()) {
+ case QTextListFormat::ListDisc:
+ bullet = "-";
+ m_wrappedLineIndent = 2;
+ break;
+ case QTextListFormat::ListCircle:
+ bullet = "*";
+ m_wrappedLineIndent = 2;
+ break;
+ case QTextListFormat::ListSquare:
+ bullet = "+";
+ m_wrappedLineIndent = 2;
+ break;
+ case QTextListFormat::ListStyleUndefined: break;
+ case QTextListFormat::ListDecimal:
+ case QTextListFormat::ListLowerAlpha:
+ case QTextListFormat::ListUpperAlpha:
+ case QTextListFormat::ListLowerRoman:
+ case QTextListFormat::ListUpperRoman:
+ numeric = true;
+ m_wrappedLineIndent = 4;
+ break;
+ }
+ switch (blockFmt.marker()) {
+ case QTextBlockFormat::MarkerType::Checked:
+ bullet += " [x]";
+ break;
+ case QTextBlockFormat::MarkerType::Unchecked:
+ bullet += " [ ]";
+ break;
+ default:
+ break;
+ }
+ int indentFirstLine = (listLevel - 1) * (numeric ? 4 : 2);
+ m_wrappedLineIndent += indentFirstLine;
+ if (m_lastListIndent != listLevel && !m_doubleNewlineWritten && listInfo(block.textList()).loose)
+ m_stream << Newline;
+ m_lastListIndent = listLevel;
+ QString prefix(indentFirstLine, Space);
+ if (numeric) {
+ QString suffix = fmt.numberSuffix();
+ if (suffix.isEmpty())
+ suffix = QString(Period);
+ QString numberStr = QString::number(number) + suffix + Space;
+ if (numberStr.length() == 3)
+ numberStr += Space;
+ prefix += numberStr;
+ } else {
+ prefix += QLatin1String(bullet) + Space;
+ }
+ m_stream << prefix;
+ } else if (blockFmt.hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth)) {
+ m_stream << "- - -\n"; // unambiguous horizontal rule, not an underline under a heading
+ return 0;
+ } else if (blockFmt.hasProperty(QTextFormat::BlockCodeFence) || blockFmt.stringProperty(QTextFormat::BlockCodeLanguage).length() > 0) {
+ // It's important to preserve blank lines in code blocks. But blank lines in code blocks
+ // inside block quotes are getting preserved anyway (along with the "> " prefix).
+ if (!blockFmt.hasProperty(QTextFormat::BlockQuoteLevel))
+ missedBlankCodeBlockLine = true; // only if we don't get any fragments below
+ if (!m_fencedCodeBlock) {
+ QString fenceChar = blockFmt.stringProperty(QTextFormat::BlockCodeFence);
+ if (fenceChar.isEmpty())
+ fenceChar = QLatin1String("`");
+ m_codeBlockFence = QString(3, fenceChar.at(0));
+ // A block quote can contain an indented code block, but not vice-versa.
+ m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space) << m_codeBlockFence
+ << Space << blockFmt.stringProperty(QTextFormat::BlockCodeLanguage) << Newline;
+ m_fencedCodeBlock = true;
+ }
+ } else if (!blockFmt.indent()) {
+ if (m_fencedCodeBlock) {
+ m_stream << m_linePrefix << QString(m_wrappedLineIndent, Space)
+ << m_codeBlockFence << Newline;
+ m_fencedCodeBlock = false;
+ m_codeBlockFence.clear();
+ }
+ m_wrappedLineIndent = 0;
+ m_linePrefix.clear();
+ if (blockFmt.hasProperty(QTextFormat::BlockQuoteLevel)) {
+ int level = blockFmt.intProperty(QTextFormat::BlockQuoteLevel);
+ QString quoteMarker = QStringLiteral("> ");
+ m_linePrefix.reserve(level * 2);
+ for (int i = 0; i < level; ++i)
+ m_linePrefix += quoteMarker;
+ }
+ if (blockFmt.hasProperty(QTextFormat::BlockCodeLanguage)) {
+ // A block quote can contain an indented code block, but not vice-versa.
+ m_linePrefix += QString(4, Space);
+ m_indentedCodeBlock = true;
+ }
+ }
+ if (blockFmt.headingLevel())
+ m_stream << QByteArray(blockFmt.headingLevel(), '#') << ' ';
+ else
+ m_stream << m_linePrefix;
+
+ QString wrapIndentString = m_linePrefix + QString(m_wrappedLineIndent, Space);
+ // It would be convenient if QTextStream had a lineCharPos() accessor,
+ // to keep track of how many characters (not bytes) have been written on the current line,
+ // but it doesn't. So we have to keep track with this col variable.
+ int col = wrapIndentString.length();
+ bool mono = false;
+ bool startsOrEndsWithBacktick = false;
+ bool bold = false;
+ bool italic = false;
+ bool underline = false;
+ bool strikeOut = false;
+ QString backticks(Backtick);
+ for (QTextBlock::Iterator frag = block.begin(); !frag.atEnd(); ++frag) {
+ missedBlankCodeBlockLine = false;
+ QString fragmentText = frag.fragment().text();
+ while (fragmentText.endsWith(Newline))
+ fragmentText.chop(1);
+ if (block.textList()) { // <li>first line</br>continuation</li>
+ QString newlineIndent = QString(Newline) + QString(m_wrappedLineIndent, Space);
+ fragmentText.replace(QString(LineBreak), newlineIndent);
+ } else if (blockFmt.indent() > 0) { // <li>first line<p>continuation</p></li>
+ m_stream << QString(m_wrappedLineIndent, Space);
+ } else {
+ fragmentText.replace(LineBreak, Newline);
+ }
+ startsOrEndsWithBacktick |= fragmentText.startsWith(Backtick) || fragmentText.endsWith(Backtick);
+ QTextCharFormat fmt = frag.fragment().charFormat();
+ if (fmt.isImageFormat()) {
+ QTextImageFormat ifmt = fmt.toImageFormat();
+ QString desc = ifmt.stringProperty(QTextFormat::ImageAltText);
+ if (desc.isEmpty())
+ desc = QLatin1String("image");
+ QString s = QLatin1String("![") + desc + QLatin1String("](") + ifmt.name();
+ QString title = ifmt.stringProperty(QTextFormat::ImageTitle);
+ if (!title.isEmpty())
+ s += Space + DoubleQuote + title + DoubleQuote;
+ s += QLatin1Char(')');
+ if (wrap && col + s.length() > ColumnLimit) {
+ m_stream << Newline << wrapIndentString;
+ col = m_wrappedLineIndent;
+ }
+ m_stream << s;
+ col += s.length();
+ } else if (fmt.hasProperty(QTextFormat::AnchorHref)) {
+ QString s = QLatin1Char('[') + fragmentText + QLatin1String("](") +
+ fmt.property(QTextFormat::AnchorHref).toString() + QLatin1Char(')');
+ if (wrap && col + s.length() > ColumnLimit) {
+ m_stream << Newline << wrapIndentString;
+ col = m_wrappedLineIndent;
+ }
+ m_stream << s;
+ col += s.length();
+ } else {
+ QFontInfo fontInfo(fmt.font());
+ bool monoFrag = fontInfo.fixedPitch();
+ QString markers;
+ if (!ignoreFormat) {
+ if (monoFrag != mono && !m_indentedCodeBlock && !m_fencedCodeBlock) {
+ if (monoFrag)
+ backticks = QString(adjacentBackticksCount(fragmentText) + 1, Backtick);
+ markers += backticks;
+ if (startsOrEndsWithBacktick)
+ markers += Space;
+ mono = monoFrag;
+ }
+ if (!blockFmt.headingLevel() && !mono) {
+ if (fontInfo.bold() != bold) {
+ markers += QLatin1String("**");
+ bold = fontInfo.bold();
+ }
+ if (fontInfo.italic() != italic) {
+ markers += QLatin1Char('*');
+ italic = fontInfo.italic();
+ }
+ if (fontInfo.strikeOut() != strikeOut) {
+ markers += QLatin1String("~~");
+ strikeOut = fontInfo.strikeOut();
+ }
+ if (fontInfo.underline() != underline) {
+ // Markdown doesn't support underline, but the parser will treat a single underline
+ // the same as a single asterisk, and the marked fragment will be rendered in italics.
+ // That will have to do.
+ markers += QLatin1Char('_');
+ underline = fontInfo.underline();
+ }
+ }
+ }
+ if (wrap && col + markers.length() * 2 + fragmentText.length() > ColumnLimit) {
+ int i = 0;
+ int fragLen = fragmentText.length();
+ bool breakingLine = false;
+ while (i < fragLen) {
+ if (col >= ColumnLimit) {
+ m_stream << Newline << wrapIndentString;
+ col = m_wrappedLineIndent;
+ while (fragmentText[i].isSpace())
+ ++i;
+ }
+ int j = i + ColumnLimit - col;
+ if (j < fragLen) {
+ int wi = nearestWordWrapIndex(fragmentText, j);
+ if (wi < 0) {
+ j = fragLen;
+ } else if (wi >= i) {
+ j = wi;
+ breakingLine = true;
+ }
+ } else {
+ j = fragLen;
+ breakingLine = false;
+ }
+ QString subfrag = fragmentText.mid(i, j - i);
+ if (!i) {
+ m_stream << markers;
+ col += markers.length();
+ }
+ if (col == m_wrappedLineIndent)
+ maybeEscapeFirstChar(subfrag);
+ m_stream << subfrag;
+ if (breakingLine) {
+ m_stream << Newline << wrapIndentString;
+ col = m_wrappedLineIndent;
+ } else {
+ col += subfrag.length();
+ }
+ i = j + 1;
+ }
+ } else {
+ m_stream << markers << fragmentText;
+ col += markers.length() + fragmentText.length();
+ }
+ }
+ }
+ if (mono) {
+ if (startsOrEndsWithBacktick) {
+ m_stream << Space;
+ col += 1;
+ }
+ m_stream << backticks;
+ col += backticks.size();
+ }
+ if (bold) {
+ m_stream << "**";
+ col += 2;
+ }
+ if (italic) {
+ m_stream << "*";
+ col += 1;
+ }
+ if (underline) {
+ m_stream << "_";
+ col += 1;
+ }
+ if (strikeOut) {
+ m_stream << "~~";
+ col += 2;
+ }
+ if (missedBlankCodeBlockLine)
+ m_stream << Newline;
+ return col;
+}
+
+QT_END_NAMESPACE
diff --git a/src/gui/text/qtextmarkdownwriter_p.h b/src/gui/text/qtextmarkdownwriter_p.h
new file mode 100644
index 0000000000..c3076155d0
--- /dev/null
+++ b/src/gui/text/qtextmarkdownwriter_p.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTEXTMARKDOWNWRITER_P_H
+#define QTEXTMARKDOWNWRITER_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/private/qtguiglobal_p.h>
+#include <QtCore/QTextStream>
+
+#include "qtextdocument_p.h"
+#include "qtextdocumentwriter.h"
+
+QT_BEGIN_NAMESPACE
+
+class QAbstractItemModel;
+
+class Q_GUI_EXPORT QTextMarkdownWriter
+{
+public:
+ QTextMarkdownWriter(QTextStream &stream, QTextDocument::MarkdownFeatures features);
+ bool writeAll(const QTextDocument *document);
+#if QT_CONFIG(itemmodel)
+ void writeTable(const QAbstractItemModel *table);
+#endif
+
+ int writeBlock(const QTextBlock &block, bool table, bool ignoreFormat, bool ignoreEmpty);
+ void writeFrame(const QTextFrame *frame);
+
+private:
+ struct ListInfo {
+ bool loose;
+ };
+
+ ListInfo listInfo(QTextList *list);
+
+private:
+ QTextStream &m_stream;
+ QTextDocument::MarkdownFeatures m_features;
+ QMap<QTextList *, ListInfo> m_listInfo;
+ QString m_linePrefix;
+ QString m_codeBlockFence;
+ int m_wrappedLineIndent = 0;
+ int m_lastListIndent = 1;
+ bool m_doubleNewlineWritten = false;
+ bool m_indentedCodeBlock = false;
+ bool m_fencedCodeBlock = false;
+};
+
+QT_END_NAMESPACE
+
+#endif // QTEXTMARKDOWNWRITER_P_H
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index 40960c910e..b845889c3d 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -678,7 +678,7 @@ QTextFrame::iterator::iterator(QTextFrame *frame, int block, int begin, int end)
/*!
Copy constructor. Constructs a copy of the \a other iterator.
*/
-QTextFrame::iterator::iterator(const iterator &other) Q_DECL_NOTHROW
+QTextFrame::iterator::iterator(const iterator &other) noexcept
{
f = other.f;
b = other.b;
@@ -691,7 +691,7 @@ QTextFrame::iterator::iterator(const iterator &other) Q_DECL_NOTHROW
Assigns \a other to this iterator and returns a reference to
this iterator.
*/
-QTextFrame::iterator &QTextFrame::iterator::operator=(const iterator &other) Q_DECL_NOTHROW
+QTextFrame::iterator &QTextFrame::iterator::operator=(const iterator &other) noexcept
{
f = other.f;
b = other.b;
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 694eb729d5..215a76fb4d 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -151,11 +151,11 @@ public:
public:
iterator(); // ### Qt 6: inline
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- iterator(const iterator &o) Q_DECL_NOTHROW; // = default
- iterator &operator=(const iterator &o) Q_DECL_NOTHROW; // = default
- iterator(iterator &&other) Q_DECL_NOTHROW // = default
+ iterator(const iterator &o) noexcept; // = default
+ iterator &operator=(const iterator &o) noexcept; // = default
+ iterator(iterator &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); }
- iterator &operator=(iterator &&other) Q_DECL_NOTHROW // = default
+ iterator &operator=(iterator &&other) noexcept // = default
{ memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(iterator)); return *this; }
#endif
diff --git a/src/gui/text/qtextobject_p.h b/src/gui/text/qtextobject_p.h
index 81ab023cc3..87c83868da 100644
--- a/src/gui/text/qtextobject_p.h
+++ b/src/gui/text/qtextobject_p.h
@@ -93,7 +93,7 @@ class QTextFramePrivate : public QTextObjectPrivate
Q_DECLARE_PUBLIC(QTextFrame)
public:
QTextFramePrivate(QTextDocument *doc)
- : QTextObjectPrivate(doc), fragment_start(0), fragment_end(0), parentFrame(0), layoutData(0)
+ : QTextObjectPrivate(doc), fragment_start(0), fragment_end(0), parentFrame(nullptr), layoutData(nullptr)
{
}
virtual void fragmentAdded(QChar type, uint fragment);
diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp
index 6d23866392..0e8666565f 100644
--- a/src/gui/text/qtextodfwriter.cpp
+++ b/src/gui/text/qtextodfwriter.cpp
@@ -523,9 +523,7 @@ void QTextOdfWriter::writeFormats(QXmlStreamWriter &writer, const QSet<int> &for
{
writer.writeStartElement(officeNS, QString::fromLatin1("automatic-styles"));
QVector<QTextFormat> allStyles = m_document->allFormats();
- QSetIterator<int> formatId(formats);
- while(formatId.hasNext()) {
- int formatIndex = formatId.next();
+ for (int formatIndex : formats) {
QTextFormat textFormat = allStyles.at(formatIndex);
switch (textFormat.type()) {
case QTextFormat::CharFormat:
@@ -1057,7 +1055,7 @@ bool QTextOdfWriter::writeAll()
// add objects for lists, frames and tables
const QVector<QTextFormat> allFormats = m_document->allFormats();
- const QList<int> copy = formats.toList();
+ const QList<int> copy = formats.values();
for (auto index : copy) {
QTextObject *object = m_document->objectForFormat(allFormats[index]);
if (object) {
diff --git a/src/gui/text/qtexttable_p.h b/src/gui/text/qtexttable_p.h
index c969e1d5bc..5c05611009 100644
--- a/src/gui/text/qtexttable_p.h
+++ b/src/gui/text/qtexttable_p.h
@@ -61,7 +61,7 @@ class QTextTablePrivate : public QTextFramePrivate
{
Q_DECLARE_PUBLIC(QTextTable)
public:
- QTextTablePrivate(QTextDocument *document) : QTextFramePrivate(document), grid(0), nRows(0), nCols(0), dirty(true), blockFragmentUpdates(false) {}
+ QTextTablePrivate(QTextDocument *document) : QTextFramePrivate(document), grid(nullptr), nRows(0), nCols(0), dirty(true), blockFragmentUpdates(false) {}
~QTextTablePrivate();
static QTextTable *createTable(QTextDocumentPrivate *, int pos, int rows, int cols, const QTextTableFormat &tableFormat);
diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h
index 378072b366..6fec8d7719 100644
--- a/src/gui/text/qzipreader_p.h
+++ b/src/gui/text/qzipreader_p.h
@@ -79,11 +79,11 @@ public:
struct FileInfo
{
- FileInfo() Q_DECL_NOTHROW
+ FileInfo() noexcept
: isDir(false), isFile(false), isSymLink(false), crc(0), size(0)
{}
- bool isValid() const Q_DECL_NOTHROW { return isDir || isFile || isSymLink; }
+ bool isValid() const noexcept { return isDir || isFile || isSymLink; }
QString filePath;
uint isDir : 1;
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index abe20abe02..5e97b312f1 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -97,6 +97,25 @@ qtConfig(textodfwriter) {
text/qzip.cpp
}
+qtConfig(textmarkdownreader) {
+ qtConfig(system-textmarkdownreader) {
+ QMAKE_USE += libmd4c
+ } else {
+ include($$PWD/../../3rdparty/md4c.pri)
+ }
+ HEADERS += \
+ text/qtextmarkdownimporter_p.h
+ SOURCES += \
+ text/qtextmarkdownimporter.cpp
+}
+
+qtConfig(textmarkdownwriter) {
+ HEADERS += \
+ text/qtextmarkdownwriter_p.h
+ SOURCES += \
+ text/qtextmarkdownwriter.cpp
+}
+
qtConfig(cssparser) {
HEADERS += \
text/qcssparser_p.h
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 8c7cf8682c..99214c4960 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -60,9 +60,9 @@ class QOpenUrlHandlerRegistry : public QObject
{
Q_OBJECT
public:
- inline QOpenUrlHandlerRegistry() : mutex(QMutex::Recursive) {}
+ QOpenUrlHandlerRegistry() = default;
- QMutex mutex;
+ QRecursiveMutex mutex;
struct Handler
{
@@ -290,6 +290,7 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
setUrlHandler(scheme, 0, 0);
}
+#if QT_DEPRECATED_SINCE(5, 0)
/*!
\enum QDesktopServices::StandardLocation
\since 4.4
@@ -344,6 +345,7 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
\obsolete
Use QStandardPaths::displayName()
*/
+#endif
extern Q_CORE_EXPORT QString qt_applicationName_noFallback();
diff --git a/src/gui/util/qgridlayoutengine_p.h b/src/gui/util/qgridlayoutengine_p.h
index 5f0cc5da73..5f0e84edb1 100644
--- a/src/gui/util/qgridlayoutengine_p.h
+++ b/src/gui/util/qgridlayoutengine_p.h
@@ -180,7 +180,7 @@ public:
t = &q_minimumAscent;
break;
default:
- t = 0;
+ t = nullptr;
break;
}
return *t;
@@ -205,7 +205,7 @@ public:
t = &q_minimumAscent;
break;
default:
- t = 0;
+ t = nullptr;
break;
}
return *t;
@@ -276,7 +276,7 @@ class Q_GUI_EXPORT QGridLayoutItem
{
public:
QGridLayoutItem(int row, int column, int rowSpan = 1, int columnSpan = 1,
- Qt::Alignment alignment = 0);
+ Qt::Alignment alignment = nullptr);
virtual ~QGridLayoutItem() {}
inline int firstRow() const { return q_firstRows[Ver]; }
@@ -339,7 +339,7 @@ private:
class Q_GUI_EXPORT QGridLayoutEngine
{
public:
- QGridLayoutEngine(Qt::Alignment defaultAlignment = Qt::Alignment(0), bool snapToPixelGrid = false);
+ QGridLayoutEngine(Qt::Alignment defaultAlignment = Qt::Alignment(nullptr), bool snapToPixelGrid = false);
inline ~QGridLayoutEngine() { qDeleteAll(q_items); }
int rowCount(Qt::Orientation orientation) const;
diff --git a/src/gui/util/qshaderformat.cpp b/src/gui/util/qshaderformat.cpp
index e4e3718199..ea86dd6ca5 100644
--- a/src/gui/util/qshaderformat.cpp
+++ b/src/gui/util/qshaderformat.cpp
@@ -41,59 +41,59 @@
QT_BEGIN_NAMESPACE
-QShaderFormat::QShaderFormat() Q_DECL_NOTHROW
+QShaderFormat::QShaderFormat() noexcept
: m_api(NoApi)
, m_shaderType(Fragment)
{
}
-QShaderFormat::Api QShaderFormat::api() const Q_DECL_NOTHROW
+QShaderFormat::Api QShaderFormat::api() const noexcept
{
return m_api;
}
-void QShaderFormat::setApi(QShaderFormat::Api api) Q_DECL_NOTHROW
+void QShaderFormat::setApi(QShaderFormat::Api api) noexcept
{
m_api = api;
}
-QVersionNumber QShaderFormat::version() const Q_DECL_NOTHROW
+QVersionNumber QShaderFormat::version() const noexcept
{
return m_version;
}
-void QShaderFormat::setVersion(const QVersionNumber &version) Q_DECL_NOTHROW
+void QShaderFormat::setVersion(const QVersionNumber &version) noexcept
{
m_version = version;
}
-QStringList QShaderFormat::extensions() const Q_DECL_NOTHROW
+QStringList QShaderFormat::extensions() const noexcept
{
return m_extensions;
}
-void QShaderFormat::setExtensions(const QStringList &extensions) Q_DECL_NOTHROW
+void QShaderFormat::setExtensions(const QStringList &extensions) noexcept
{
m_extensions = extensions;
m_extensions.sort();
}
-QString QShaderFormat::vendor() const Q_DECL_NOTHROW
+QString QShaderFormat::vendor() const noexcept
{
return m_vendor;
}
-void QShaderFormat::setVendor(const QString &vendor) Q_DECL_NOTHROW
+void QShaderFormat::setVendor(const QString &vendor) noexcept
{
m_vendor = vendor;
}
-bool QShaderFormat::isValid() const Q_DECL_NOTHROW
+bool QShaderFormat::isValid() const noexcept
{
return m_api != NoApi && m_version.majorVersion() > 0;
}
-bool QShaderFormat::supports(const QShaderFormat &other) const Q_DECL_NOTHROW
+bool QShaderFormat::supports(const QShaderFormat &other) const noexcept
{
if (!isValid() || !other.isValid())
return false;
@@ -133,7 +133,7 @@ void QShaderFormat::setShaderType(QShaderFormat::ShaderType shaderType) Q_DECL_N
m_shaderType = shaderType;
}
-bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) noexcept
{
return lhs.api() == rhs.api()
&& lhs.version() == rhs.version()
diff --git a/src/gui/util/qshaderformat_p.h b/src/gui/util/qshaderformat_p.h
index 8d5e83bd22..c50d7d5729 100644
--- a/src/gui/util/qshaderformat_p.h
+++ b/src/gui/util/qshaderformat_p.h
@@ -78,22 +78,22 @@ public:
Compute
};
- Q_GUI_EXPORT QShaderFormat() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderFormat() noexcept;
- Q_GUI_EXPORT Api api() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setApi(Api api) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Api api() const noexcept;
+ Q_GUI_EXPORT void setApi(Api api) noexcept;
- Q_GUI_EXPORT QVersionNumber version() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setVersion(const QVersionNumber &version) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVersionNumber version() const noexcept;
+ Q_GUI_EXPORT void setVersion(const QVersionNumber &version) noexcept;
- Q_GUI_EXPORT QStringList extensions() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setExtensions(const QStringList &extensions) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QStringList extensions() const noexcept;
+ Q_GUI_EXPORT void setExtensions(const QStringList &extensions) noexcept;
- Q_GUI_EXPORT QString vendor() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setVendor(const QString &vendor) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QString vendor() const noexcept;
+ Q_GUI_EXPORT void setVendor(const QString &vendor) noexcept;
- Q_GUI_EXPORT bool isValid() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT bool supports(const QShaderFormat &other) const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT bool isValid() const noexcept;
+ Q_GUI_EXPORT bool supports(const QShaderFormat &other) const noexcept;
Q_GUI_EXPORT ShaderType shaderType() const Q_DECL_NOTHROW;
Q_GUI_EXPORT void setShaderType(ShaderType shaderType) Q_DECL_NOTHROW;
@@ -106,9 +106,9 @@ private:
ShaderType m_shaderType;
};
-Q_GUI_EXPORT bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderFormat &lhs, const QShaderFormat &rhs) noexcept;
-inline bool operator!=(const QShaderFormat &lhs, const QShaderFormat &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderFormat &lhs, const QShaderFormat &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadergraph.cpp b/src/gui/util/qshadergraph.cpp
index 40b85ac469..b05b710713 100644
--- a/src/gui/util/qshadergraph.cpp
+++ b/src/gui/util/qshadergraph.cpp
@@ -118,12 +118,12 @@ namespace
}
}
-QUuid QShaderGraph::Statement::uuid() const Q_DECL_NOTHROW
+QUuid QShaderGraph::Statement::uuid() const noexcept
{
return node.uuid();
}
-int QShaderGraph::Statement::portIndex(QShaderNodePort::Direction direction, const QString &portName) const Q_DECL_NOTHROW
+int QShaderGraph::Statement::portIndex(QShaderNodePort::Direction direction, const QString &portName) const noexcept
{
const QVector<QShaderNodePort> ports = node.ports();
int index = 0;
@@ -150,7 +150,7 @@ void QShaderGraph::removeNode(const QShaderNode &node)
m_nodes.erase(it);
}
-QVector<QShaderNode> QShaderGraph::nodes() const Q_DECL_NOTHROW
+QVector<QShaderNode> QShaderGraph::nodes() const noexcept
{
return m_nodes;
}
@@ -167,7 +167,7 @@ void QShaderGraph::removeEdge(const QShaderGraph::Edge &edge)
m_edges.removeAll(edge);
}
-QVector<QShaderGraph::Edge> QShaderGraph::edges() const Q_DECL_NOTHROW
+QVector<QShaderGraph::Edge> QShaderGraph::edges() const noexcept
{
return m_edges;
}
@@ -244,7 +244,7 @@ QVector<QShaderGraph::Statement> QShaderGraph::createStatements(const QStringLis
return result;
}
-bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) noexcept
{
return lhs.sourceNodeUuid == rhs.sourceNodeUuid
&& lhs.sourcePortName == rhs.sourcePortName
@@ -252,7 +252,7 @@ bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_
&& lhs.targetPortName == rhs.targetPortName;
}
-bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) noexcept
{
return lhs.inputs == rhs.inputs
&& lhs.outputs == rhs.outputs
diff --git a/src/gui/util/qshadergraph_p.h b/src/gui/util/qshadergraph_p.h
index 756e1b2da2..9367a3783c 100644
--- a/src/gui/util/qshadergraph_p.h
+++ b/src/gui/util/qshadergraph_p.h
@@ -73,8 +73,8 @@ public:
class Statement
{
public:
- Q_GUI_EXPORT QUuid uuid() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT int portIndex(QShaderNodePort::Direction direction, const QString &portName) const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QUuid uuid() const noexcept;
+ Q_GUI_EXPORT int portIndex(QShaderNodePort::Direction direction, const QString &portName) const noexcept;
QShaderNode node;
QVector<int> inputs;
@@ -83,11 +83,11 @@ public:
Q_GUI_EXPORT void addNode(const QShaderNode &node);
Q_GUI_EXPORT void removeNode(const QShaderNode &node);
- Q_GUI_EXPORT QVector<QShaderNode> nodes() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVector<QShaderNode> nodes() const noexcept;
Q_GUI_EXPORT void addEdge(const Edge &edge);
Q_GUI_EXPORT void removeEdge(const Edge &edge);
- Q_GUI_EXPORT QVector<Edge> edges() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVector<Edge> edges() const noexcept;
Q_GUI_EXPORT QVector<Statement> createStatements(const QStringList &enabledLayers = QStringList()) const;
@@ -96,16 +96,16 @@ private:
QVector<Edge> m_edges;
};
-Q_GUI_EXPORT bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) noexcept;
-inline bool operator!=(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderGraph::Edge &lhs, const QShaderGraph::Edge &rhs) noexcept
{
return !(lhs == rhs);
}
-Q_GUI_EXPORT bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) noexcept;
-inline bool operator!=(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderGraph::Statement &lhs, const QShaderGraph::Statement &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadergraphloader.cpp b/src/gui/util/qshadergraphloader.cpp
index b9d8318655..a393e876e0 100644
--- a/src/gui/util/qshadergraphloader.cpp
+++ b/src/gui/util/qshadergraphloader.cpp
@@ -52,29 +52,29 @@ QT_BEGIN_NAMESPACE
void qt_register_ShaderLanguage_enums();
-QShaderGraphLoader::QShaderGraphLoader() Q_DECL_NOTHROW
+QShaderGraphLoader::QShaderGraphLoader() noexcept
: m_status(Null),
m_device(nullptr)
{
qt_register_ShaderLanguage_enums();
}
-QShaderGraphLoader::Status QShaderGraphLoader::status() const Q_DECL_NOTHROW
+QShaderGraphLoader::Status QShaderGraphLoader::status() const noexcept
{
return m_status;
}
-QShaderGraph QShaderGraphLoader::graph() const Q_DECL_NOTHROW
+QShaderGraph QShaderGraphLoader::graph() const noexcept
{
return m_graph;
}
-QIODevice *QShaderGraphLoader::device() const Q_DECL_NOTHROW
+QIODevice *QShaderGraphLoader::device() const noexcept
{
return m_device;
}
-void QShaderGraphLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
+void QShaderGraphLoader::setDevice(QIODevice *device) noexcept
{
m_device = device;
m_graph = QShaderGraph();
@@ -83,12 +83,12 @@ void QShaderGraphLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
: Error;
}
-QHash<QString, QShaderNode> QShaderGraphLoader::prototypes() const Q_DECL_NOTHROW
+QHash<QString, QShaderNode> QShaderGraphLoader::prototypes() const noexcept
{
return m_prototypes;
}
-void QShaderGraphLoader::setPrototypes(const QHash<QString, QShaderNode> &prototypes) Q_DECL_NOTHROW
+void QShaderGraphLoader::setPrototypes(const QHash<QString, QShaderNode> &prototypes) noexcept
{
m_prototypes = prototypes;
}
diff --git a/src/gui/util/qshadergraphloader_p.h b/src/gui/util/qshadergraphloader_p.h
index 97cbd8d18c..e7aa19fa2d 100644
--- a/src/gui/util/qshadergraphloader_p.h
+++ b/src/gui/util/qshadergraphloader_p.h
@@ -69,16 +69,16 @@ public:
Error
};
- Q_GUI_EXPORT QShaderGraphLoader() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderGraphLoader() noexcept;
- Q_GUI_EXPORT Status status() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT QShaderGraph graph() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Status status() const noexcept;
+ Q_GUI_EXPORT QShaderGraph graph() const noexcept;
- Q_GUI_EXPORT QIODevice *device() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setDevice(QIODevice *device) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QIODevice *device() const noexcept;
+ Q_GUI_EXPORT void setDevice(QIODevice *device) noexcept;
- Q_GUI_EXPORT QHash<QString, QShaderNode> prototypes() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setPrototypes(const QHash<QString, QShaderNode> &prototypes) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QHash<QString, QShaderNode> prototypes() const noexcept;
+ Q_GUI_EXPORT void setPrototypes(const QHash<QString, QShaderNode> &prototypes) noexcept;
Q_GUI_EXPORT void load();
diff --git a/src/gui/util/qshaderlanguage_p.h b/src/gui/util/qshaderlanguage_p.h
index 3af967b8c6..193f797cc3 100644
--- a/src/gui/util/qshaderlanguage_p.h
+++ b/src/gui/util/qshaderlanguage_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
namespace QShaderLanguage
{
- Q_GUI_EXPORT Q_NAMESPACE
+ Q_NAMESPACE_EXPORT(Q_GUI_EXPORT)
enum StorageQualifier : char {
Const = 1,
diff --git a/src/gui/util/qshadernode.cpp b/src/gui/util/qshadernode.cpp
index e570880d1d..547e5c51a8 100644
--- a/src/gui/util/qshadernode.cpp
+++ b/src/gui/util/qshadernode.cpp
@@ -41,7 +41,7 @@
QT_BEGIN_NAMESPACE
-QShaderNode::Type QShaderNode::type() const Q_DECL_NOTHROW
+QShaderNode::Type QShaderNode::type() const noexcept
{
int inputCount = 0;
int outputCount = 0;
@@ -62,27 +62,27 @@ QShaderNode::Type QShaderNode::type() const Q_DECL_NOTHROW
: Function;
}
-QUuid QShaderNode::uuid() const Q_DECL_NOTHROW
+QUuid QShaderNode::uuid() const noexcept
{
return m_uuid;
}
-void QShaderNode::setUuid(const QUuid &uuid) Q_DECL_NOTHROW
+void QShaderNode::setUuid(const QUuid &uuid) noexcept
{
m_uuid = uuid;
}
-QStringList QShaderNode::layers() const Q_DECL_NOTHROW
+QStringList QShaderNode::layers() const noexcept
{
return m_layers;
}
-void QShaderNode::setLayers(const QStringList &layers) Q_DECL_NOTHROW
+void QShaderNode::setLayers(const QStringList &layers) noexcept
{
m_layers = layers;
}
-QVector<QShaderNodePort> QShaderNode::ports() const Q_DECL_NOTHROW
+QVector<QShaderNodePort> QShaderNode::ports() const noexcept
{
return m_ports;
}
@@ -157,13 +157,13 @@ QShaderNode::Rule QShaderNode::rule(const QShaderFormat &format) const
return it != m_rules.crend() ? it->second : Rule();
}
-QShaderNode::Rule::Rule(const QByteArray &subs, const QByteArrayList &snippets) Q_DECL_NOTHROW
+QShaderNode::Rule::Rule(const QByteArray &subs, const QByteArrayList &snippets) noexcept
: substitution(subs),
headerSnippets(snippets)
{
}
-bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) noexcept
{
return lhs.substitution == rhs.substitution
&& lhs.headerSnippets == rhs.headerSnippets;
diff --git a/src/gui/util/qshadernode_p.h b/src/gui/util/qshadernode_p.h
index 12ff9b2a2c..c3d149d8a5 100644
--- a/src/gui/util/qshadernode_p.h
+++ b/src/gui/util/qshadernode_p.h
@@ -73,21 +73,21 @@ public:
class Rule
{
public:
- Q_GUI_EXPORT Rule(const QByteArray &substitution = QByteArray(), const QByteArrayList &headerSnippets = QByteArrayList()) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Rule(const QByteArray &substitution = QByteArray(), const QByteArrayList &headerSnippets = QByteArrayList()) noexcept;
QByteArray substitution;
QByteArrayList headerSnippets;
};
- Q_GUI_EXPORT Type type() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Type type() const noexcept;
- Q_GUI_EXPORT QUuid uuid() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setUuid(const QUuid &uuid) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QUuid uuid() const noexcept;
+ Q_GUI_EXPORT void setUuid(const QUuid &uuid) noexcept;
- Q_GUI_EXPORT QStringList layers() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setLayers(const QStringList &layers) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QStringList layers() const noexcept;
+ Q_GUI_EXPORT void setLayers(const QStringList &layers) noexcept;
- Q_GUI_EXPORT QVector<QShaderNodePort> ports() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QVector<QShaderNodePort> ports() const noexcept;
Q_GUI_EXPORT void addPort(const QShaderNodePort &port);
Q_GUI_EXPORT void removePort(const QShaderNodePort &port);
@@ -110,9 +110,9 @@ private:
QVector<QPair<QShaderFormat, QShaderNode::Rule>> m_rules;
};
-Q_GUI_EXPORT bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) noexcept;
-inline bool operator!=(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderNode::Rule &lhs, const QShaderNode::Rule &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadernodeport.cpp b/src/gui/util/qshadernodeport.cpp
index 03646a9467..15dbc4160e 100644
--- a/src/gui/util/qshadernodeport.cpp
+++ b/src/gui/util/qshadernodeport.cpp
@@ -41,12 +41,12 @@
QT_BEGIN_NAMESPACE
-QShaderNodePort::QShaderNodePort() Q_DECL_NOTHROW
+QShaderNodePort::QShaderNodePort() noexcept
: direction(Output)
{
}
-bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW
+bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) noexcept
{
return lhs.direction == rhs.direction
&& lhs.name == rhs.name;
diff --git a/src/gui/util/qshadernodeport_p.h b/src/gui/util/qshadernodeport_p.h
index cfdaf05017..c69ba23a3f 100644
--- a/src/gui/util/qshadernodeport_p.h
+++ b/src/gui/util/qshadernodeport_p.h
@@ -66,15 +66,15 @@ public:
Output
};
- Q_GUI_EXPORT QShaderNodePort() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderNodePort() noexcept;
QShaderNodePort::Direction direction;
QString name;
};
-Q_GUI_EXPORT bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW;
+Q_GUI_EXPORT bool operator==(const QShaderNodePort &lhs, const QShaderNodePort &rhs) noexcept;
-inline bool operator!=(const QShaderNodePort &lhs, const QShaderNodePort &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QShaderNodePort &lhs, const QShaderNodePort &rhs) noexcept
{
return !(lhs == rhs);
}
diff --git a/src/gui/util/qshadernodesloader.cpp b/src/gui/util/qshadernodesloader.cpp
index 5369e8bd4c..922479332c 100644
--- a/src/gui/util/qshadernodesloader.cpp
+++ b/src/gui/util/qshadernodesloader.cpp
@@ -48,28 +48,28 @@
QT_BEGIN_NAMESPACE
-QShaderNodesLoader::QShaderNodesLoader() Q_DECL_NOTHROW
+QShaderNodesLoader::QShaderNodesLoader() noexcept
: m_status(Null),
m_device(nullptr)
{
}
-QShaderNodesLoader::Status QShaderNodesLoader::status() const Q_DECL_NOTHROW
+QShaderNodesLoader::Status QShaderNodesLoader::status() const noexcept
{
return m_status;
}
-QHash<QString, QShaderNode> QShaderNodesLoader::nodes() const Q_DECL_NOTHROW
+QHash<QString, QShaderNode> QShaderNodesLoader::nodes() const noexcept
{
return m_nodes;
}
-QIODevice *QShaderNodesLoader::device() const Q_DECL_NOTHROW
+QIODevice *QShaderNodesLoader::device() const noexcept
{
return m_device;
}
-void QShaderNodesLoader::setDevice(QIODevice *device) Q_DECL_NOTHROW
+void QShaderNodesLoader::setDevice(QIODevice *device) noexcept
{
m_device = device;
m_nodes.clear();
diff --git a/src/gui/util/qshadernodesloader_p.h b/src/gui/util/qshadernodesloader_p.h
index 0bec871857..432d7d4494 100644
--- a/src/gui/util/qshadernodesloader_p.h
+++ b/src/gui/util/qshadernodesloader_p.h
@@ -69,13 +69,13 @@ public:
Error
};
- Q_GUI_EXPORT QShaderNodesLoader() Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QShaderNodesLoader() noexcept;
- Q_GUI_EXPORT Status status() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT QHash<QString, QShaderNode> nodes() const Q_DECL_NOTHROW;
+ Q_GUI_EXPORT Status status() const noexcept;
+ Q_GUI_EXPORT QHash<QString, QShaderNode> nodes() const noexcept;
- Q_GUI_EXPORT QIODevice *device() const Q_DECL_NOTHROW;
- Q_GUI_EXPORT void setDevice(QIODevice *device) Q_DECL_NOTHROW;
+ Q_GUI_EXPORT QIODevice *device() const noexcept;
+ Q_GUI_EXPORT void setDevice(QIODevice *device) noexcept;
Q_GUI_EXPORT void load();
Q_GUI_EXPORT void load(const QJsonObject &prototypesObject);
diff --git a/src/gui/util/qvalidator.h b/src/gui/util/qvalidator.h
index cc7cbcb559..f0e72e3814 100644
--- a/src/gui/util/qvalidator.h
+++ b/src/gui/util/qvalidator.h
@@ -69,6 +69,7 @@ public:
Intermediate,
Acceptable
};
+ Q_ENUM(State)
void setLocale(const QLocale &locale);
QLocale locale() const;
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index e5e711b1a0..d3402133d6 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -8,7 +8,6 @@ HEADERS += \
util/qabstractlayoutstyleinfo_p.h \
util/qlayoutpolicy_p.h \
util/qshaderformat_p.h \
- util/qshadergenerator_p.h \
util/qshadergraph_p.h \
util/qshadergraphloader_p.h \
util/qshaderlanguage_p.h \
@@ -29,7 +28,6 @@ SOURCES += \
util/qabstractlayoutstyleinfo.cpp \
util/qlayoutpolicy.cpp \
util/qshaderformat.cpp \
- util/qshadergenerator.cpp \
util/qshadergraph.cpp \
util/qshadergraphloader.cpp \
util/qshaderlanguage.cpp \
@@ -41,3 +39,10 @@ SOURCES += \
util/qpkmhandler.cpp \
util/qktxhandler.cpp \
util/qastchandler.cpp
+
+qtConfig(regularexpression) {
+ HEADERS += \
+ util/qshadergenerator_p.h
+ SOURCES += \
+ util/qshadergenerator.cpp
+}
diff --git a/src/gui/vulkan/qplatformvulkaninstance.cpp b/src/gui/vulkan/qplatformvulkaninstance.cpp
index 6201d3ec11..9d044bfd58 100644
--- a/src/gui/vulkan/qplatformvulkaninstance.cpp
+++ b/src/gui/vulkan/qplatformvulkaninstance.cpp
@@ -85,4 +85,9 @@ void QPlatformVulkanInstance::presentQueued(QWindow *window)
Q_UNUSED(window);
}
+void QPlatformVulkanInstance::setDebugFilters(const QVector<QVulkanInstance::DebugFilter> &filters)
+{
+ Q_UNUSED(filters);
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/vulkan/qplatformvulkaninstance.h b/src/gui/vulkan/qplatformvulkaninstance.h
index 9f34803f7b..d47c59b5db 100644
--- a/src/gui/vulkan/qplatformvulkaninstance.h
+++ b/src/gui/vulkan/qplatformvulkaninstance.h
@@ -78,6 +78,7 @@ public:
virtual PFN_vkVoidFunction getInstanceProcAddr(const char *name) = 0;
virtual bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) = 0;
virtual void presentQueued(QWindow *window);
+ virtual void setDebugFilters(const QVector<QVulkanInstance::DebugFilter> &filters);
private:
QScopedPointer<QPlatformVulkanInstancePrivate> d_ptr;
diff --git a/src/gui/vulkan/qvulkaninstance.cpp b/src/gui/vulkan/qvulkaninstance.cpp
index 2941bfd01f..0605d88cca 100644
--- a/src/gui/vulkan/qvulkaninstance.cpp
+++ b/src/gui/vulkan/qvulkaninstance.cpp
@@ -269,6 +269,7 @@ public:
VkResult errorCode;
QScopedPointer<QVulkanFunctions> funcs;
QHash<VkDevice, QVulkanDeviceFunctions *> deviceFuncs;
+ QVector<QVulkanInstance::DebugFilter> debugFilters;
};
bool QVulkanInstancePrivate::ensureVulkan()
@@ -570,6 +571,7 @@ bool QVulkanInstance::create()
d_ptr->extensions = d_ptr->platformInst->enabledExtensions();
d_ptr->errorCode = VK_SUCCESS;
d_ptr->funcs.reset(new QVulkanFunctions(this));
+ d_ptr->platformInst->setDebugFilters(d_ptr->debugFilters);
return true;
}
@@ -785,6 +787,50 @@ void QVulkanInstance::presentQueued(QWindow *window)
d_ptr->platformInst->presentQueued(window);
}
+/*!
+ \typedef QVulkanInstance::DebugFilter
+
+ Typedef for debug filtering callback functions.
+
+ \sa installDebugOutputFilter(), removeDebugOutputFilter()
+ */
+
+/*!
+ Installs a \a filter function that is called for every Vulkan debug
+ message. When the callback returns \c true, the message is stopped (filtered
+ out) and will not appear on the debug output.
+
+ \note Filtering is only effective when NoDebugOutputRedirect is not
+ \l{setFlags()}{set}. Installing filters has no effect otherwise.
+
+ \note This function can be called before create().
+
+ \sa removeDebugOutputFilter()
+ */
+void QVulkanInstance::installDebugOutputFilter(DebugFilter filter)
+{
+ if (!d_ptr->debugFilters.contains(filter)) {
+ d_ptr->debugFilters.append(filter);
+ if (d_ptr->platformInst)
+ d_ptr->platformInst->setDebugFilters(d_ptr->debugFilters);
+ }
+}
+
+/*!
+ Removes a \a filter function previously installed by
+ installDebugOutputFilter().
+
+ \note This function can be called before create().
+
+ \sa installDebugOutputFilter()
+ */
+void QVulkanInstance::removeDebugOutputFilter(DebugFilter filter)
+{
+ d_ptr->debugFilters.removeOne(filter);
+ if (d_ptr->platformInst)
+ d_ptr->platformInst->setDebugFilters(d_ptr->debugFilters);
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QVulkanLayer &layer)
{
diff --git a/src/gui/vulkan/qvulkaninstance.h b/src/gui/vulkan/qvulkaninstance.h
index 57459e458c..70f2fd5102 100644
--- a/src/gui/vulkan/qvulkaninstance.h
+++ b/src/gui/vulkan/qvulkaninstance.h
@@ -84,14 +84,14 @@ struct QVulkanLayer
};
Q_DECLARE_TYPEINFO(QVulkanLayer, Q_MOVABLE_TYPE);
-inline bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs) Q_DECL_NOTHROW
+inline bool operator==(const QVulkanLayer &lhs, const QVulkanLayer &rhs) noexcept
{
return lhs.name == rhs.name && lhs.version == rhs.version && lhs.specVersion == rhs.specVersion;
}
-inline bool operator!=(const QVulkanLayer &lhs, const QVulkanLayer &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QVulkanLayer &lhs, const QVulkanLayer &rhs) noexcept
{ return !(lhs == rhs); }
-inline uint qHash(const QVulkanLayer &key, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QVulkanLayer &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.name);
@@ -107,14 +107,14 @@ struct QVulkanExtension
};
Q_DECLARE_TYPEINFO(QVulkanExtension, Q_MOVABLE_TYPE);
-inline bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs) Q_DECL_NOTHROW
+inline bool operator==(const QVulkanExtension &lhs, const QVulkanExtension &rhs) noexcept
{
return lhs.name == rhs.name && lhs.version == rhs.version;
}
-inline bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QVulkanExtension &lhs, const QVulkanExtension &rhs) noexcept
{ return !(lhs == rhs); }
-inline uint qHash(const QVulkanExtension &key, uint seed = 0) Q_DECL_NOTHROW
+inline uint qHash(const QVulkanExtension &key, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
seed = hash(seed, key.name);
@@ -188,6 +188,11 @@ public:
void presentQueued(QWindow *window);
+ typedef bool (*DebugFilter)(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object,
+ size_t location, int32_t messageCode, const char *pLayerPrefix, const char *pMessage);
+ void installDebugOutputFilter(DebugFilter filter);
+ void removeDebugOutputFilter(DebugFilter filter);
+
private:
QScopedPointer<QVulkanInstancePrivate> d_ptr;
Q_DISABLE_COPY(QVulkanInstance)
diff --git a/src/gui/vulkan/qvulkanwindow.cpp b/src/gui/vulkan/qvulkanwindow.cpp
index 6d12377a60..4b5c2b56ee 100644
--- a/src/gui/vulkan/qvulkanwindow.cpp
+++ b/src/gui/vulkan/qvulkanwindow.cpp
@@ -498,12 +498,12 @@ QVector<int> QVulkanWindow::supportedSampleCounts()
VkSampleCountFlags depth = limits->framebufferDepthSampleCounts;
VkSampleCountFlags stencil = limits->framebufferStencilSampleCounts;
- for (size_t i = 0; i < sizeof(qvk_sampleCounts) / sizeof(qvk_sampleCounts[0]); ++i) {
- if ((color & qvk_sampleCounts[i].mask)
- && (depth & qvk_sampleCounts[i].mask)
- && (stencil & qvk_sampleCounts[i].mask))
+ for (const auto &qvk_sampleCount : qvk_sampleCounts) {
+ if ((color & qvk_sampleCount.mask)
+ && (depth & qvk_sampleCount.mask)
+ && (stencil & qvk_sampleCount.mask))
{
- result.append(qvk_sampleCounts[i].count);
+ result.append(qvk_sampleCount.count);
}
}
@@ -547,9 +547,9 @@ void QVulkanWindow::setSampleCount(int sampleCount)
return;
}
- for (size_t i = 0; i < sizeof(qvk_sampleCounts) / sizeof(qvk_sampleCounts[0]); ++i) {
- if (qvk_sampleCounts[i].count == sampleCount) {
- d->sampleCount = qvk_sampleCounts[i].mask;
+ for (const auto &qvk_sampleCount : qvk_sampleCounts) {
+ if (qvk_sampleCount.count == sampleCount) {
+ d->sampleCount = qvk_sampleCount.mask;
return;
}
}
diff --git a/src/gui/vulkan/qvulkanwindow_p.h b/src/gui/vulkan/qvulkanwindow_p.h
index c6a772bc31..fb374a5564 100644
--- a/src/gui/vulkan/qvulkanwindow_p.h
+++ b/src/gui/vulkan/qvulkanwindow_p.h
@@ -97,7 +97,7 @@ public:
int physDevIndex = 0;
QVector<VkPhysicalDevice> physDevs;
QVector<VkPhysicalDeviceProperties> physDevProps;
- QVulkanWindow::Flags flags = 0;
+ QVulkanWindow::Flags flags = nullptr;
QByteArrayList requestedDevExtensions;
QHash<VkPhysicalDevice, QVulkanInfoVector<QVulkanExtension> > supportedDevExtensions;
QVector<VkFormat> requestedColorFormats;
diff --git a/src/gui/vulkan/vulkan.pri b/src/gui/vulkan/vulkan.pri
index 9bd7391235..5c902e8b82 100644
--- a/src/gui/vulkan/vulkan.pri
+++ b/src/gui/vulkan/vulkan.pri
@@ -17,39 +17,45 @@ qtConfig(vulkan) {
QMAKE_USE += vulkan/nolink
}
-# Generate qvulkanfunctions.h, qvulkanfunctions_p.h, qvulkanfunctions_p.cpp
-QMAKE_QVKGEN_INPUT = vulkan/vk.xml
-QMAKE_QVKGEN_LICENSE_HEADER = $$QT_SOURCE_TREE/header.LGPL
-qtPrepareTool(QMAKE_QVKGEN, qvkgen)
-
-qvkgen_h.commands = $$QMAKE_QVKGEN ${QMAKE_FILE_IN} $$shell_quote($$QMAKE_QVKGEN_LICENSE_HEADER) ${QMAKE_FILE_OUT_PATH}/${QMAKE_FILE_OUT_BASE}
-qvkgen_h.output = $$OUT_PWD/vulkan/qvulkanfunctions.h
-qvkgen_h.input = QMAKE_QVKGEN_INPUT
-qtConfig(vulkan): \
- qvkgen_h.variable_out = HEADERS
-else: \
- qvkgen_h.CONFIG += target_predeps no_link
-QMAKE_EXTRA_COMPILERS += qvkgen_h
-
-qvkgen_ph.commands = $$escape_expand(\\n)
-qvkgen_ph.output = $$OUT_PWD/vulkan/qvulkanfunctions_p.h
-qvkgen_ph.input = QMAKE_QVKGEN_INPUT
-qvkgen_ph.depends += $$OUT_PWD/vulkan/qvulkanfunctions.h
-qtConfig(vulkan): \
- qvkgen_ph.variable_out = HEADERS
-else: \
- qvkgen_ph.CONFIG += target_predeps no_link
-QMAKE_EXTRA_COMPILERS += qvkgen_ph
-
-qvkgen_pimpl.commands = $$escape_expand(\\n)
-qvkgen_pimpl.output = $$OUT_PWD/vulkan/qvulkanfunctions_p.cpp
-qvkgen_pimpl.input = QMAKE_QVKGEN_INPUT
-qvkgen_pimpl.depends += $$OUT_PWD/vulkan/qvulkanfunctions_p.h
-qtConfig(vulkan): \
- qvkgen_pimpl.variable_out = SOURCES
-else: \
- qvkgen_pimpl.CONFIG += target_predeps no_link
-QMAKE_EXTRA_COMPILERS += qvkgen_pimpl
+qtConfig(vkgen) {
+ # Generate qvulkanfunctions.h, qvulkanfunctions_p.h, qvulkanfunctions_p.cpp
+ QMAKE_QVKGEN_INPUT = vulkan/vk.xml
+ QMAKE_QVKGEN_LICENSE_HEADER = $$QT_SOURCE_TREE/header.LGPL
+ qtPrepareTool(QMAKE_QVKGEN, qvkgen)
+
+ qvkgen_h.commands = $$QMAKE_QVKGEN ${QMAKE_FILE_IN} $$shell_quote($$QMAKE_QVKGEN_LICENSE_HEADER) ${QMAKE_FILE_OUT_PATH}/${QMAKE_FILE_OUT_BASE}
+ qvkgen_h.output = $$OUT_PWD/vulkan/qvulkanfunctions.h
+ qvkgen_h.input = QMAKE_QVKGEN_INPUT
+ qtConfig(vulkan): \
+ qvkgen_h.variable_out = HEADERS
+ else: \
+ qvkgen_h.CONFIG += target_predeps no_link
+ QMAKE_EXTRA_COMPILERS += qvkgen_h
+
+ qvkgen_ph.commands = $$escape_expand(\\n)
+ qvkgen_ph.output = $$OUT_PWD/vulkan/qvulkanfunctions_p.h
+ qvkgen_ph.input = QMAKE_QVKGEN_INPUT
+ qvkgen_ph.depends += $$OUT_PWD/vulkan/qvulkanfunctions.h
+ qtConfig(vulkan): \
+ qvkgen_ph.variable_out = HEADERS
+ else: \
+ qvkgen_ph.CONFIG += target_predeps no_link
+ QMAKE_EXTRA_COMPILERS += qvkgen_ph
+
+ qvkgen_pimpl.commands = $$escape_expand(\\n)
+ qvkgen_pimpl.output = $$OUT_PWD/vulkan/qvulkanfunctions_p.cpp
+ qvkgen_pimpl.input = QMAKE_QVKGEN_INPUT
+ qvkgen_pimpl.depends += $$OUT_PWD/vulkan/qvulkanfunctions_p.h
+ qtConfig(vulkan): \
+ qvkgen_pimpl.variable_out = SOURCES
+ else: \
+ qvkgen_pimpl.CONFIG += target_predeps no_link
+ QMAKE_EXTRA_COMPILERS += qvkgen_pimpl
+} else {
+ # generate dummy files to make qmake happy
+ write_file($$OUT_PWD/vulkan/qvulkanfunctions.h)
+ write_file($$OUT_PWD/vulkan/qvulkanfunctions_p.h)
+}
# Ensure qvulkanfunctions.h gets installed correctly
targ_headers.CONFIG += no_check_exist
diff --git a/src/network/access/access.pri b/src/network/access/access.pri
index 8a92308f12..cfb20dcd71 100644
--- a/src/network/access/access.pri
+++ b/src/network/access/access.pri
@@ -97,7 +97,8 @@ qtConfig(http) {
access/qhttpnetworkrequest.cpp \
access/qhttpprotocolhandler.cpp \
access/qhttpthreaddelegate.cpp \
- access/qnetworkreplyhttpimpl.cpp
+ access/qnetworkreplyhttpimpl.cpp \
+ access/qhttp2configuration.cpp
HEADERS += \
access/qabstractprotocolhandler_p.h \
@@ -111,7 +112,8 @@ qtConfig(http) {
access/qhttpnetworkrequest_p.h \
access/qhttpprotocolhandler_p.h \
access/qhttpthreaddelegate_p.h \
- access/qnetworkreplyhttpimpl_p.h
+ access/qnetworkreplyhttpimpl_p.h \
+ access/qhttp2configuration.h
qtConfig(ssl) {
SOURCES += \
diff --git a/src/network/access/http2/hpack.cpp b/src/network/access/http2/hpack.cpp
index 2d324d5092..b40cc29e1a 100644
--- a/src/network/access/http2/hpack.cpp
+++ b/src/network/access/http2/hpack.cpp
@@ -208,6 +208,11 @@ void Encoder::setMaxDynamicTableSize(quint32 size)
lookupTable.setMaxDynamicTableSize(size);
}
+void Encoder::setCompressStrings(bool compress)
+{
+ compressStrings = compress;
+}
+
bool Encoder::encodeRequestPseudoHeaders(BitOStream &outputStream,
const HttpHeader &header)
{
diff --git a/src/network/access/http2/hpack_p.h b/src/network/access/http2/hpack_p.h
index 6a1d30d87b..8c2701e7af 100644
--- a/src/network/access/http2/hpack_p.h
+++ b/src/network/access/http2/hpack_p.h
@@ -83,6 +83,7 @@ public:
quint32 newSize);
void setMaxDynamicTableSize(quint32 size);
+ void setCompressStrings(bool compress);
private:
bool encodeRequestPseudoHeaders(BitOStream &outputStream,
diff --git a/src/network/access/http2/http2frames.cpp b/src/network/access/http2/http2frames.cpp
index e695b4dd9e..ce33505683 100644
--- a/src/network/access/http2/http2frames.cpp
+++ b/src/network/access/http2/http2frames.cpp
@@ -305,7 +305,7 @@ FrameStatus FrameReader::read(QAbstractSocket &socket)
return status;
}
- if (Http2PredefinedParameters::maxFrameSize < frame.payloadSize())
+ if (Http2PredefinedParameters::maxPayloadSize < frame.payloadSize())
return FrameStatus::sizeError;
frame.buffer.resize(frame.payloadSize() + frameHeaderSize);
@@ -388,7 +388,7 @@ void FrameWriter::setPayloadSize(quint32 size)
auto &buffer = frame.buffer;
Q_ASSERT(buffer.size() >= frameHeaderSize);
- Q_ASSERT(size < maxPayloadSize);
+ Q_ASSERT(size <= maxPayloadSize);
buffer[0] = size >> 16;
buffer[1] = size >> 8;
diff --git a/src/network/access/http2/http2protocol.cpp b/src/network/access/http2/http2protocol.cpp
index 0be72042c6..31da6fd616 100644
--- a/src/network/access/http2/http2protocol.cpp
+++ b/src/network/access/http2/http2protocol.cpp
@@ -43,6 +43,8 @@
#include "private/qhttpnetworkrequest_p.h"
#include "private/qhttpnetworkreply_p.h"
+#include <access/qhttp2configuration.h>
+
#include <QtCore/qbytearray.h>
#include <QtCore/qstring.h>
@@ -62,88 +64,29 @@ const char Http2clientPreface[clientPrefaceLength] =
0x2e, 0x30, 0x0d, 0x0a, 0x0d, 0x0a,
0x53, 0x4d, 0x0d, 0x0a, 0x0d, 0x0a};
-// TODO: (in 5.11) - remove it!
-const char *http2ParametersPropertyName = "QT_HTTP2_PARAMETERS_PROPERTY";
-
-ProtocolParameters::ProtocolParameters()
-{
- settingsFrameData[Settings::INITIAL_WINDOW_SIZE_ID] = qtDefaultStreamReceiveWindowSize;
- settingsFrameData[Settings::ENABLE_PUSH_ID] = 0;
-}
-
-bool ProtocolParameters::validate() const
+Frame configurationToSettingsFrame(const QHttp2Configuration &config)
{
- // 0. Huffman/indexing: any values are valid and allowed.
-
- // 1. Session receive window size (client side): HTTP/2 starts from the
- // default value of 64Kb, if a client code tries to set lesser value,
- // the delta would become negative, but this is not allowed.
- if (maxSessionReceiveWindowSize < qint32(defaultSessionWindowSize)) {
- qCWarning(QT_HTTP2, "Session receive window must be at least 65535 bytes");
- return false;
- }
-
- // 2. HEADER_TABLE_SIZE: we do not validate HEADER_TABLE_SIZE, considering
- // all values as valid. RFC 7540 and 7541 do not provide any lower/upper
- // limits. If it's 0 - we do not index anything, if it's too huge - a user
- // who provided such a value can potentially have a huge memory footprint,
- // up to them to decide.
-
- // 3. SETTINGS_ENABLE_PUSH: RFC 7540, 6.5.2, a value other than 0 or 1 will
- // be treated by our peer as a PROTOCOL_ERROR.
- if (settingsFrameData.contains(Settings::ENABLE_PUSH_ID)
- && settingsFrameData[Settings::ENABLE_PUSH_ID] > 1) {
- qCWarning(QT_HTTP2, "SETTINGS_ENABLE_PUSH can be only 0 or 1");
- return false;
- }
-
- // 4. SETTINGS_MAX_CONCURRENT_STREAMS : RFC 7540 recommends 100 as the lower
- // limit, says nothing about the upper limit. The RFC allows 0, but this makes
- // no sense to us at all: there is no way a user can change this later and
- // we'll not be able to get any responses on such a connection.
- if (settingsFrameData.contains(Settings::MAX_CONCURRENT_STREAMS_ID)
- && !settingsFrameData[Settings::MAX_CONCURRENT_STREAMS_ID]) {
- qCWarning(QT_HTTP2, "MAX_CONCURRENT_STREAMS must be a positive number");
- return false;
- }
-
- // 5. SETTINGS_INITIAL_WINDOW_SIZE.
- if (settingsFrameData.contains(Settings::INITIAL_WINDOW_SIZE_ID)) {
- const quint32 value = settingsFrameData[Settings::INITIAL_WINDOW_SIZE_ID];
- // RFC 7540, 6.5.2 (the upper limit). The lower limit is our own - we send
- // SETTINGS frame only once and will not be able to change this 0, thus
- // we'll suspend all streams.
- if (!value || value > quint32(maxSessionReceiveWindowSize)) {
- qCWarning(QT_HTTP2, "INITIAL_WINDOW_SIZE must be in the range "
- "(0, 2^31-1]");
- return false;
- }
- }
-
- // 6. SETTINGS_MAX_FRAME_SIZE: RFC 7540, 6.5.2, a value outside of the range
- // [2^14-1, 2^24-1] will be treated by our peer as a PROTOCOL_ERROR.
- if (settingsFrameData.contains(Settings::MAX_FRAME_SIZE_ID)) {
- const quint32 value = settingsFrameData[Settings::INITIAL_WINDOW_SIZE_ID];
- if (value < maxFrameSize || value > maxPayloadSize) {
- qCWarning(QT_HTTP2, "MAX_FRAME_SIZE must be in the range [2^14, 2^24-1]");
- return false;
- }
+ // 6.5 SETTINGS
+ FrameWriter builder(FrameType::SETTINGS, FrameFlag::EMPTY, connectionStreamID);
+ // Server push:
+ builder.append(Settings::ENABLE_PUSH_ID);
+ builder.append(int(config.serverPushEnabled()));
+ // Stream receive window size:
+ builder.append(Settings::INITIAL_WINDOW_SIZE_ID);
+ builder.append(config.streamReceiveWindowSize());
+
+ if (config.maxFrameSize() != minPayloadLimit) {
+ builder.append(Settings::MAX_FRAME_SIZE_ID);
+ builder.append(config.maxFrameSize());
}
-
- // For SETTINGS_MAX_HEADER_LIST_SIZE RFC 7540 does not provide any specific
- // numbers. It's clear, if a value is too small, no header can ever be sent
- // by our peer at all. The default value is unlimited and we normally do not
- // change this.
- //
- // Note: the size is calculated as the length of uncompressed (no HPACK)
- // name + value + 32 bytes.
-
- return true;
+ // TODO: In future, if the need is proven, we can
+ // also send decoding table size and header list size.
+ // For now, defaults suffice.
+ return builder.outboundFrame();
}
-QByteArray ProtocolParameters::settingsFrameToBase64() const
+QByteArray settingsFrameToBase64(const Frame &frame)
{
- Frame frame(settingsFrame());
// SETTINGS frame's payload consists of pairs:
// 2-byte-identifier | 4-byte-value == multiple of 6.
Q_ASSERT(frame.payloadSize() && !(frame.payloadSize() % 6));
@@ -157,20 +100,7 @@ QByteArray ProtocolParameters::settingsFrameToBase64() const
return wrapper.toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
}
-Frame ProtocolParameters::settingsFrame() const
-{
- // 6.5 SETTINGS
- FrameWriter builder(FrameType::SETTINGS, FrameFlag::EMPTY, connectionStreamID);
- for (auto it = settingsFrameData.cbegin(), end = settingsFrameData.cend();
- it != end; ++it) {
- builder.append(it.key());
- builder.append(it.value());
- }
-
- return builder.outboundFrame();
-}
-
-void ProtocolParameters::addProtocolUpgradeHeaders(QHttpNetworkRequest *request) const
+void appendProtocolUpgradeHeaders(const QHttp2Configuration &config, QHttpNetworkRequest *request)
{
Q_ASSERT(request);
// RFC 2616, 14.10
@@ -184,8 +114,10 @@ void ProtocolParameters::addProtocolUpgradeHeaders(QHttpNetworkRequest *request)
request->setHeaderField("Connection", value);
// This we just (re)write.
request->setHeaderField("Upgrade", "h2c");
+
+ const Frame frame(configurationToSettingsFrame(config));
// This we just (re)write.
- request->setHeaderField("HTTP2-Settings", settingsFrameToBase64());
+ request->setHeaderField("HTTP2-Settings", settingsFrameToBase64(frame));
}
void qt_error(quint32 errorCode, QNetworkReply::NetworkError &error,
diff --git a/src/network/access/http2/http2protocol_p.h b/src/network/access/http2/http2protocol_p.h
index 7142d6f1fa..b0af5aa919 100644
--- a/src/network/access/http2/http2protocol_p.h
+++ b/src/network/access/http2/http2protocol_p.h
@@ -55,12 +55,14 @@
#include <QtCore/qloggingcategory.h>
#include <QtCore/qmetatype.h>
#include <QtCore/qglobal.h>
+#include <QtCore/qmap.h>
// Different HTTP/2 constants/values as defined by RFC 7540.
QT_BEGIN_NAMESPACE
class QHttpNetworkRequest;
+class QHttp2Configuration;
class QHttpNetworkReply;
class QByteArray;
class QString;
@@ -118,13 +120,19 @@ enum Http2PredefinedParameters
connectionStreamID = 0, // HTTP/2, 5.1.1
frameHeaderSize = 9, // HTTP/2, 4.1
- // It's our max frame size we send in SETTINGS frame,
- // it's also the default one and we also use it to later
- // validate incoming frames:
- maxFrameSize = 16384, // HTTP/2 6.5.2
+ // The initial allowed payload size. We would use it as an
+ // upper limit for a frame payload we send, until our peer
+ // updates us with a larger SETTINGS_MAX_FRAME_SIZE.
- defaultSessionWindowSize = 65535, // HTTP/2 6.5.2
+ // The initial maximum payload size that an HTTP/2 frame
+ // can contain is 16384. It's also the minimal size that
+ // can be advertised via 'SETTINGS' frames. A real frame
+ // can have a payload smaller than 16384.
+ minPayloadLimit = 16384, // HTTP/2 6.5.2
+ // The maximum allowed payload size.
maxPayloadSize = (1 << 24) - 1, // HTTP/2 6.5.2
+
+ defaultSessionWindowSize = 65535, // HTTP/2 6.5.2
// Using 1000 (rather arbitrarily), just to
// impose *some* upper limit:
maxPeerConcurrentStreams = 1000,
@@ -145,48 +153,9 @@ const quint32 lastValidStreamID((quint32(1) << 31) - 1); // HTTP/2, 5.1.1
const qint32 maxSessionReceiveWindowSize((quint32(1) << 31) - 1);
const qint32 qtDefaultStreamReceiveWindowSize = maxSessionReceiveWindowSize / maxConcurrentStreams;
-// The class ProtocolParameters allows client code to customize HTTP/2 protocol
-// handler, if needed. Normally, we use our own default parameters (see below).
-// In 5.10 we can also use setProperty/property on a QNAM object to pass the
-// non-default values to the protocol handler. In 5.11 this will probably become
-// a public API.
-
-using RawSettings = QMap<Settings, quint32>;
-
-struct Q_AUTOTEST_EXPORT ProtocolParameters
-{
- ProtocolParameters();
-
- bool validate() const;
- QByteArray settingsFrameToBase64() const;
- struct Frame settingsFrame() const;
- void addProtocolUpgradeHeaders(QHttpNetworkRequest *request) const;
-
- // HPACK:
- // TODO: for now we ignore them (fix it for 5.11, would require changes in HPACK)
- bool useHuffman = true;
- bool indexStrings = true;
-
- // This parameter is not negotiated via SETTINGS frames, so we have it
- // as a member and will convey it to our peer as a WINDOW_UPDATE frame.
- // Note, some servers do not accept our WINDOW_UPDATE from the default
- // 64 KB to the possible maximum. Let's use a half of it:
- qint32 maxSessionReceiveWindowSize = Http2::maxSessionReceiveWindowSize / 2;
-
- // This is our default SETTINGS frame:
- //
- // SETTINGS_INITIAL_WINDOW_SIZE: (2^31 - 1) / 100
- // SETTINGS_ENABLE_PUSH: 0.
- //
- // Note, whenever we skip some value in our SETTINGS frame, our peer
- // will assume the defaults recommended by RFC 7540, which in general
- // are good enough, although we (and most browsers) prefer to work
- // with larger window sizes.
- RawSettings settingsFrameData;
-};
-
-// TODO: remove in 5.11
-extern const Q_AUTOTEST_EXPORT char *http2ParametersPropertyName;
+struct Frame configurationToSettingsFrame(const QHttp2Configuration &configuration);
+QByteArray settingsFrameToBase64(const Frame &settingsFrame);
+void appendProtocolUpgradeHeaders(const QHttp2Configuration &configuration, QHttpNetworkRequest *request);
extern const Q_AUTOTEST_EXPORT char Http2clientPreface[clientPrefaceLength];
@@ -235,6 +204,5 @@ Q_DECLARE_LOGGING_CATEGORY(QT_HTTP2)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(Http2::Settings)
-Q_DECLARE_METATYPE(Http2::ProtocolParameters)
#endif
diff --git a/src/network/access/qabstractnetworkcache.h b/src/network/access/qabstractnetworkcache.h
index 678bae2d6e..e357dfe58f 100644
--- a/src/network/access/qabstractnetworkcache.h
+++ b/src/network/access/qabstractnetworkcache.h
@@ -67,12 +67,10 @@ public:
QNetworkCacheMetaData(const QNetworkCacheMetaData &other);
~QNetworkCacheMetaData();
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkCacheMetaData &operator=(QNetworkCacheMetaData &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkCacheMetaData &operator=(QNetworkCacheMetaData &&other) noexcept { swap(other); return *this; }
QNetworkCacheMetaData &operator=(const QNetworkCacheMetaData &other);
- void swap(QNetworkCacheMetaData &other) Q_DECL_NOTHROW
+ void swap(QNetworkCacheMetaData &other) noexcept
{ qSwap(d, other.d); }
bool operator==(const QNetworkCacheMetaData &other) const;
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 4e399f018f..cc230a5411 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -955,11 +955,9 @@ void QFtpPI::readyRead()
}
}
}
- QString endOfMultiLine;
- endOfMultiLine[0] = '0' + replyCode[0];
- endOfMultiLine[1] = '0' + replyCode[1];
- endOfMultiLine[2] = '0' + replyCode[2];
- endOfMultiLine[3] = QLatin1Char(' ');
+ const char count[4] = { char('0' + replyCode[0]), char('0' + replyCode[1]),
+ char('0' + replyCode[2]), char(' ') };
+ QString endOfMultiLine(QLatin1String(count, 4));
QString lineCont(endOfMultiLine);
lineCont[3] = QLatin1Char('-');
QStringRef lineLeft4 = line.leftRef(4);
@@ -2124,6 +2122,17 @@ void QFtp::abort()
/*!
\internal
+ Clears the last error.
+
+ \sa currentCommand()
+*/
+void QFtp::clearError()
+{
+ d_func()->error = NoError;
+}
+
+/*!
+ \internal
Returns the identifier of the FTP command that is being executed
or 0 if there is no command being executed.
diff --git a/src/network/access/qftp_p.h b/src/network/access/qftp_p.h
index 0516c3d1f9..a55429933b 100644
--- a/src/network/access/qftp_p.h
+++ b/src/network/access/qftp_p.h
@@ -67,7 +67,7 @@ class Q_AUTOTEST_EXPORT QFtp : public QObject
Q_OBJECT
public:
- explicit QFtp(QObject *parent = 0);
+ explicit QFtp(QObject *parent = nullptr);
virtual ~QFtp();
enum State {
@@ -118,7 +118,7 @@ public:
int setTransferMode(TransferMode mode);
int list(const QString &dir = QString());
int cd(const QString &dir);
- int get(const QString &file, QIODevice *dev=0, TransferType type = Binary);
+ int get(const QString &file, QIODevice *dev=nullptr, TransferType type = Binary);
int put(const QByteArray &data, const QString &file, TransferType type = Binary);
int put(QIODevice *dev, const QString &file, TransferType type = Binary);
int remove(const QString &file);
@@ -157,6 +157,9 @@ Q_SIGNALS:
void commandFinished(int, bool);
void done(bool);
+protected:
+ void clearError();
+
private:
Q_DISABLE_COPY_MOVE(QFtp)
Q_DECLARE_PRIVATE(QFtp)
diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp
index ce70b6af90..0cef0ad3dc 100644
--- a/src/network/access/qhsts.cpp
+++ b/src/network/access/qhsts.cpp
@@ -145,7 +145,7 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
return;
}
- knownHosts.insert(pos, {hostName, newPolicy});
+ knownHosts.insert({hostName, newPolicy});
#if QT_CONFIG(settings)
if (hstsStore)
hstsStore->addToObserved(newPolicy);
@@ -156,7 +156,7 @@ void QHstsCache::updateKnownHost(const QString &host, const QDateTime &expires,
if (newPolicy.isExpired())
knownHosts.erase(pos);
else if (pos->second != newPolicy)
- pos->second = std::move(newPolicy);
+ pos->second = newPolicy;
else
return;
diff --git a/src/network/access/qhstspolicy.h b/src/network/access/qhstspolicy.h
index 176a8fa635..f1b2ee99e5 100644
--- a/src/network/access/qhstspolicy.h
+++ b/src/network/access/qhstspolicy.h
@@ -65,10 +65,10 @@ public:
QUrl::ParsingMode mode = QUrl::DecodedMode);
QHstsPolicy(const QHstsPolicy &rhs);
QHstsPolicy &operator=(const QHstsPolicy &rhs);
- QHstsPolicy &operator=(QHstsPolicy &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QHstsPolicy &operator=(QHstsPolicy &&other) noexcept { swap(other); return *this; }
~QHstsPolicy();
- void swap(QHstsPolicy &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QHstsPolicy &other) noexcept { qSwap(d, other.d); }
void setHost(const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode);
QString host(QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded) const;
diff --git a/src/network/access/qhttp2configuration.cpp b/src/network/access/qhttp2configuration.cpp
new file mode 100644
index 0000000000..bd4318d4e9
--- /dev/null
+++ b/src/network/access/qhttp2configuration.cpp
@@ -0,0 +1,312 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qhttp2configuration.h"
+
+#include "private/http2protocol_p.h"
+#include "private/hpack_p.h"
+
+#include "qdebug.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QHttp2Configuration
+ \brief The QHttp2Configuration class controls HTTP/2 parameters and settings.
+ \since 5.14
+
+ \reentrant
+ \inmodule QtNetwork
+ \ingroup network
+ \ingroup shared
+
+ QHttp2Configuration controls HTTP/2 parameters and settings that
+ QNetworkAccessManager will use to send requests and process responses
+ when the HTTP/2 protocol is enabled.
+
+ The HTTP/2 parameters that QHttp2Configuration currently supports include:
+
+ \list
+ \li The session window size for connection-level flow control.
+ Will be sent to a remote peer when needed as 'WINDOW_UPDATE'
+ frames on the stream with an identifier 0.
+ \li The stream receiving window size for stream-level flow control.
+ Sent as 'SETTINGS_INITIAL_WINDOW_SIZE' parameter in the initial
+ SETTINGS frame and, when needed, 'WINDOW_UPDATE' frames will be
+ sent on streams that QNetworkAccessManager opens.
+ \li The maximum frame size. This parameter limits the maximum payload
+ a frame coming from the remote peer can have. Sent by QNetworkAccessManager
+ as 'SETTINGS_MAX_FRAME_SIZE' parameter in the initial 'SETTINGS'
+ frame.
+ \li The server push. Allows to enable or disable server push. Sent
+ as 'SETTINGS_ENABLE_PUSH' parameter in the initial 'SETTINGS'
+ frame.
+ \endlist
+
+ The QHttp2Configuration class also controls if the header compression
+ algorithm (HPACK) is additionally using Huffman coding for string
+ compression.
+
+ \note The configuration must be set before the first request
+ was sent to a given host (and thus an HTTP/2 session established).
+
+ \note Details about flow control, server push and 'SETTINGS'
+ can be found in \l {https://httpwg.org/specs/rfc7540.html}{RFC 7540}.
+ Different modes and parameters of the HPACK compression algorithm
+ are described in \l {https://httpwg.org/specs/rfc7541.html}{RFC 7541}.
+
+ \sa QNetworkRequest::setHttp2Configuration(), QNetworkRequest::http2Configuration(), QNetworkAccessManager
+*/
+
+class QHttp2ConfigurationPrivate : public QSharedData
+{
+public:
+ unsigned sessionWindowSize = Http2::defaultSessionWindowSize;
+ // The size below is quite a limiting default value, QNetworkRequest
+ // by default sets a larger number, an application can change this using
+ // QNetworkRequest::setHttp2Configuration.
+ unsigned streamWindowSize = Http2::defaultSessionWindowSize;
+
+ unsigned maxFrameSize = Http2::minPayloadLimit; // Initial (default) value of 16Kb.
+
+ bool pushEnabled = false;
+ // TODO: for now those two below are noop.
+ bool huffmanCompressionEnabled = true;
+};
+
+/*!
+ Default constructs a QHttp2Configuration object.
+
+ Such a configuration has the following values:
+ \list
+ \li Server push is disabled
+ \li Huffman string compression is enabled
+ \li Window size for connection-level flow control is 65535 octets
+ \li Window size for stream-level flow control is 65535 octets
+ \li Frame size is 16384 octets
+ \endlist
+*/
+QHttp2Configuration::QHttp2Configuration()
+ : d(new QHttp2ConfigurationPrivate)
+{
+}
+
+/*!
+ Copy-constructs this QHttp2Configuration.
+*/
+QHttp2Configuration::QHttp2Configuration(const QHttp2Configuration &) = default;
+
+/*!
+ Move-constructs this QHttp2Configuration from \a other
+*/
+QHttp2Configuration::QHttp2Configuration(QHttp2Configuration &&other) noexcept
+{
+ swap(other);
+}
+
+/*!
+ Copy-assigns to this QHttp2Configuration.
+*/
+QHttp2Configuration &QHttp2Configuration::operator=(const QHttp2Configuration &) = default;
+
+/*!
+ Move-assigns to this QHttp2Configuration.
+*/
+QHttp2Configuration &QHttp2Configuration::operator=(QHttp2Configuration &&) noexcept = default;
+
+/*!
+ Destructor.
+*/
+QHttp2Configuration::~QHttp2Configuration()
+{
+}
+
+/*!
+ If \a enable is \c true, a remote server can potentially
+ use server push to send reponses in advance.
+
+ \sa serverPushEnabled
+*/
+void QHttp2Configuration::setServerPushEnabled(bool enable)
+{
+ d->pushEnabled = enable;
+}
+
+/*!
+ Returns true if server push was enabled.
+
+ \note By default, QNetworkAccessManager disables server
+ push via the 'SETTINGS' frame.
+
+ \sa setServerPushEnabled
+*/
+bool QHttp2Configuration::serverPushEnabled() const
+{
+ return d->pushEnabled;
+}
+
+/*!
+ If \a enable is \c true, HPACK compression will additionally
+ compress string using the Huffman coding. Enabled by default.
+
+ \note This parameter only affects 'HEADERS' frames that
+ QNetworkAccessManager is sending.
+
+ \sa huffmanCompressionEnabled
+*/
+void QHttp2Configuration::setHuffmanCompressionEnabled(bool enable)
+{
+ d->huffmanCompressionEnabled = enable;
+}
+
+/*!
+ Returns \c true if the Huffman coding in HPACK is enabled.
+
+ \sa setHuffmanCompressionEnabled
+*/
+bool QHttp2Configuration::huffmanCompressionEnabled() const
+{
+ return d->huffmanCompressionEnabled;
+}
+
+/*!
+ Sets the window size for connection-level flow control.
+ \a size cannot be 0 and must not exceed 2147483647 octets.
+
+ \sa sessionReceiveWindowSize
+*/
+bool QHttp2Configuration::setSessionReceiveWindowSize(unsigned size)
+{
+ if (!size || size > Http2::maxSessionReceiveWindowSize) { // RFC-7540, 6.9
+ qCWarning(QT_HTTP2) << "Invalid session window size";
+ return false;
+ }
+
+ d->sessionWindowSize = size;
+ return true;
+}
+
+/*!
+ Returns the window size for connection-level flow control.
+ The default value QNetworkAccessManager will be using is
+ 2147483647 octets.
+*/
+unsigned QHttp2Configuration::sessionReceiveWindowSize() const
+{
+ return d->sessionWindowSize;
+}
+
+/*!
+ Sets the window size for stream-level flow control.
+ \a size cannot be 0 and must not exceed 2147483647 octets.
+
+ \sa streamReceiveWindowSize
+ */
+bool QHttp2Configuration::setStreamReceiveWindowSize(unsigned size)
+{
+ if (!size || size > Http2::maxSessionReceiveWindowSize) { // RFC-7540, 6.9
+ qCWarning(QT_HTTP2) << "Invalid stream window size";
+ return false;
+ }
+
+ d->streamWindowSize = size;
+ return true;
+}
+
+/*!
+ Returns the window size for stream-level flow control.
+ The default value QNetworkAccessManager will be using is
+ 21474836 octets.
+*/
+unsigned QHttp2Configuration::streamReceiveWindowSize() const
+{
+ return d->streamWindowSize;
+}
+
+/*!
+ Sets the maximum frame size that QNetworkAccessManager
+ will advertise to the server when sending its initial SETTINGS frame.
+ \note While this \a size is required to be within a range between
+ 16384 and 16777215 inclusive, the actual payload size in frames
+ that carry payload maybe be less than 16384.
+*/
+bool QHttp2Configuration::setMaxFrameSize(unsigned size)
+{
+ if (size < Http2::minPayloadLimit || size > Http2::maxPayloadSize) {
+ qCWarning(QT_HTTP2) << "Maximum frame size to advertise is invalid";
+ return false;
+ }
+
+ d->maxFrameSize = size;
+ return true;
+}
+
+/*!
+ The maximum payload size that HTTP/2 frames can
+ have. The default (initial) value is 16384 octets.
+*/
+unsigned QHttp2Configuration::maxFrameSize() const
+{
+ return d->maxFrameSize;
+}
+
+/*!
+ Swaps this configuration with the \a other configuration.
+*/
+void QHttp2Configuration::swap(QHttp2Configuration &other) noexcept
+{
+ d.swap(other.d);
+}
+
+/*!
+ Returns \c true if \a lhs and \a rhs have the same set of HTTP/2
+ parameters.
+*/
+bool operator==(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs)
+{
+ if (lhs.d == rhs.d)
+ return true;
+
+ return lhs.d->pushEnabled == rhs.d->pushEnabled
+ && lhs.d->huffmanCompressionEnabled == rhs.d->huffmanCompressionEnabled
+ && lhs.d->sessionWindowSize == rhs.d->sessionWindowSize
+ && lhs.d->streamWindowSize == rhs.d->streamWindowSize;
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/access/qhttp2configuration.h b/src/network/access/qhttp2configuration.h
new file mode 100644
index 0000000000..e5c235e2be
--- /dev/null
+++ b/src/network/access/qhttp2configuration.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QHTTP2CONFIGURATION_H
+#define QHTTP2CONFIGURATION_H
+
+#include <QtNetwork/qtnetworkglobal.h>
+
+#include <QtCore/qshareddata.h>
+
+#ifndef Q_CLANG_QDOC
+QT_REQUIRE_CONFIG(http);
+#endif
+
+QT_BEGIN_NAMESPACE
+
+class QHttp2ConfigurationPrivate;
+class Q_NETWORK_EXPORT QHttp2Configuration
+{
+ friend Q_NETWORK_EXPORT bool operator==(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs);
+
+public:
+ QHttp2Configuration();
+ QHttp2Configuration(const QHttp2Configuration &other);
+ QHttp2Configuration(QHttp2Configuration &&other) noexcept;
+ QHttp2Configuration &operator = (const QHttp2Configuration &other);
+ QHttp2Configuration &operator = (QHttp2Configuration &&other) noexcept;
+
+ ~QHttp2Configuration();
+
+ void setServerPushEnabled(bool enable);
+ bool serverPushEnabled() const;
+
+ void setHuffmanCompressionEnabled(bool enable);
+ bool huffmanCompressionEnabled() const;
+
+ bool setSessionReceiveWindowSize(unsigned size);
+ unsigned sessionReceiveWindowSize() const;
+
+ bool setStreamReceiveWindowSize(unsigned size);
+ unsigned streamReceiveWindowSize() const;
+
+ bool setMaxFrameSize(unsigned size);
+ unsigned maxFrameSize() const;
+
+ void swap(QHttp2Configuration &other) noexcept;
+
+private:
+
+ QSharedDataPointer<QHttp2ConfigurationPrivate> d;
+};
+
+Q_DECLARE_SHARED(QHttp2Configuration)
+
+Q_NETWORK_EXPORT bool operator==(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs);
+
+inline bool operator!=(const QHttp2Configuration &lhs, const QHttp2Configuration &rhs)
+{
+ return !(lhs == rhs);
+}
+
+QT_END_NAMESPACE
+
+#endif // QHTTP2CONFIGURATION_H
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 6609aa0594..dce51d4fd5 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -40,6 +40,7 @@
#include "qhttpnetworkconnection_p.h"
#include "qhttp2protocolhandler_p.h"
+#include "http2/http2frames_p.h"
#include "http2/bitstreams_p.h"
#include <private/qnoncontiguousbytedevice_p.h>
@@ -51,6 +52,8 @@
#include <QtCore/qlist.h>
#include <QtCore/qurl.h>
+#include <qhttp2configuration.h>
+
#ifndef QT_NO_NETWORKPROXY
#include <QtNetwork/qnetworkproxy.h>
#endif
@@ -174,30 +177,11 @@ QHttp2ProtocolHandler::QHttp2ProtocolHandler(QHttpNetworkConnectionChannel *chan
Q_ASSERT(channel && m_connection);
continuedFrames.reserve(20);
- const ProtocolParameters params(m_connection->http2Parameters());
- Q_ASSERT(params.validate());
-
- maxSessionReceiveWindowSize = params.maxSessionReceiveWindowSize;
-
- const RawSettings &data = params.settingsFrameData;
- for (auto param = data.cbegin(), end = data.cend(); param != end; ++param) {
- switch (param.key()) {
- case Settings::INITIAL_WINDOW_SIZE_ID:
- streamInitialReceiveWindowSize = param.value();
- break;
- case Settings::ENABLE_PUSH_ID:
- pushPromiseEnabled = param.value();
- break;
- case Settings::HEADER_TABLE_SIZE_ID:
- case Settings::MAX_CONCURRENT_STREAMS_ID:
- case Settings::MAX_FRAME_SIZE_ID:
- case Settings::MAX_HEADER_LIST_SIZE_ID:
- // These other settings are just recommendations to our peer. We
- // only check they are not crazy in ProtocolParameters::validate().
- default:
- break;
- }
- }
+ const auto h2Config = m_connection->http2Parameters();
+ maxSessionReceiveWindowSize = h2Config.sessionReceiveWindowSize();
+ pushPromiseEnabled = h2Config.serverPushEnabled();
+ streamInitialReceiveWindowSize = h2Config.streamReceiveWindowSize();
+ encoder.setCompressStrings(h2Config.huffmanCompressionEnabled());
if (!channel->ssl && m_connection->connectionType() != QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
// We upgraded from HTTP/1.1 to HTTP/2. channel->request was already sent
@@ -243,7 +227,8 @@ void QHttp2ProtocolHandler::_q_uploadDataReadyRead()
auto data = qobject_cast<QNonContiguousByteDevice *>(sender());
Q_ASSERT(data);
- const qint32 streamID = data->property("HTTP2StreamID").toInt();
+ const qint32 streamID = streamIDs.value(data);
+ Q_ASSERT(streamID != 0);
Q_ASSERT(activeStreams.contains(streamID));
auto &stream = activeStreams[streamID];
@@ -258,7 +243,7 @@ void QHttp2ProtocolHandler::_q_uploadDataReadyRead()
void QHttp2ProtocolHandler::_q_replyDestroyed(QObject *reply)
{
- const quint32 streamID = reply->property("HTTP2StreamID").toInt();
+ const quint32 streamID = streamIDs.take(reply);
if (activeStreams.contains(streamID)) {
sendRST_STREAM(streamID, CANCEL);
markAsReset(streamID);
@@ -266,6 +251,11 @@ void QHttp2ProtocolHandler::_q_replyDestroyed(QObject *reply)
}
}
+void QHttp2ProtocolHandler::_q_uploadDataDestroyed(QObject *uploadData)
+{
+ streamIDs.remove(uploadData);
+}
+
void QHttp2ProtocolHandler::_q_readyRead()
{
_q_receiveReply();
@@ -441,20 +431,17 @@ bool QHttp2ProtocolHandler::sendClientPreface()
return false;
// 6.5 SETTINGS
- const ProtocolParameters params(m_connection->http2Parameters());
- Q_ASSERT(params.validate());
- frameWriter.setOutboundFrame(params.settingsFrame());
+ frameWriter.setOutboundFrame(Http2::configurationToSettingsFrame(m_connection->http2Parameters()));
Q_ASSERT(frameWriter.outboundFrame().payloadSize());
if (!frameWriter.write(*m_socket))
return false;
sessionReceiveWindowSize = maxSessionReceiveWindowSize;
- // ProtocolParameters::validate does not allow maxSessionReceiveWindowSize
- // to be smaller than defaultSessionWindowSize, so everything is OK here with
- // 'delta':
+ // We only send WINDOW_UPDATE for the connection if the size differs from the
+ // default 64 KB:
const auto delta = maxSessionReceiveWindowSize - Http2::defaultSessionWindowSize;
- if (!sendWINDOW_UPDATE(Http2::connectionStreamID, delta))
+ if (delta && !sendWINDOW_UPDATE(Http2::connectionStreamID, delta))
return false;
prefaceSent = true;
@@ -1088,7 +1075,7 @@ bool QHttp2ProtocolHandler::acceptSetting(Http2::Settings identifier, quint32 ne
}
if (identifier == Settings::MAX_FRAME_SIZE_ID) {
- if (newValue < Http2::maxFrameSize || newValue > Http2::maxPayloadSize) {
+ if (newValue < Http2::minPayloadLimit || newValue > Http2::maxPayloadSize) {
connectionError(PROTOCOL_ERROR, "SETTGINGS max frame size is out of range");
return false;
}
@@ -1295,7 +1282,7 @@ quint32 QHttp2ProtocolHandler::createNewStream(const HttpMessagePair &message, b
replyPrivate->connection = m_connection;
replyPrivate->connectionChannel = m_channel;
reply->setSpdyWasUsed(true);
- reply->setProperty("HTTP2StreamID", newStreamID);
+ streamIDs.insert(reply, newStreamID);
connect(reply, SIGNAL(destroyed(QObject*)),
this, SLOT(_q_replyDestroyed(QObject*)));
@@ -1307,7 +1294,9 @@ quint32 QHttp2ProtocolHandler::createNewStream(const HttpMessagePair &message, b
if (auto src = newStream.data()) {
connect(src, SIGNAL(readyRead()), this,
SLOT(_q_uploadDataReadyRead()), Qt::QueuedConnection);
- src->setProperty("HTTP2StreamID", newStreamID);
+ connect(src, &QHttp2ProtocolHandler::destroyed,
+ this, &QHttp2ProtocolHandler::_q_uploadDataDestroyed);
+ streamIDs.insert(src, newStreamID);
}
}
@@ -1350,14 +1339,13 @@ void QHttp2ProtocolHandler::markAsReset(quint32 streamID)
quint32 QHttp2ProtocolHandler::popStreamToResume()
{
quint32 streamID = connectionStreamID;
- const int nQ = sizeof suspendedStreams / sizeof suspendedStreams[0];
using QNR = QHttpNetworkRequest;
- const QNR::Priority ranks[nQ] = {QNR::HighPriority,
- QNR::NormalPriority,
- QNR::LowPriority};
+ const QNR::Priority ranks[] = {QNR::HighPriority,
+ QNR::NormalPriority,
+ QNR::LowPriority};
- for (int i = 0; i < nQ; ++i) {
- auto &queue = suspendedStreams[ranks[i]];
+ for (const QNR::Priority rank : ranks) {
+ auto &queue = suspendedStreams[rank];
auto it = queue.begin();
for (; it != queue.end(); ++it) {
if (!activeStreams.contains(*it))
@@ -1378,9 +1366,7 @@ quint32 QHttp2ProtocolHandler::popStreamToResume()
void QHttp2ProtocolHandler::removeFromSuspended(quint32 streamID)
{
- const int nQ = sizeof suspendedStreams / sizeof suspendedStreams[0];
- for (int i = 0; i < nQ; ++i) {
- auto &q = suspendedStreams[i];
+ for (auto &q : suspendedStreams) {
q.erase(std::remove(q.begin(), q.end(), streamID), q.end());
}
}
@@ -1389,10 +1375,14 @@ void QHttp2ProtocolHandler::deleteActiveStream(quint32 streamID)
{
if (activeStreams.contains(streamID)) {
auto &stream = activeStreams[streamID];
- if (stream.reply())
+ if (stream.reply()) {
stream.reply()->disconnect(this);
- if (stream.data())
+ streamIDs.remove(stream.reply());
+ }
+ if (stream.data()) {
stream.data()->disconnect(this);
+ streamIDs.remove(stream.data());
+ }
activeStreams.remove(streamID);
}
diff --git a/src/network/access/qhttp2protocolhandler_p.h b/src/network/access/qhttp2protocolhandler_p.h
index d91853f613..43fdb136cd 100644
--- a/src/network/access/qhttp2protocolhandler_p.h
+++ b/src/network/access/qhttp2protocolhandler_p.h
@@ -55,6 +55,8 @@
#include <private/qabstractprotocolhandler_p.h>
#include <private/qhttpnetworkrequest_p.h>
+#include <access/qhttp2configuration.h>
+
#include <private/http2protocol_p.h>
#include <private/http2streams_p.h>
#include <private/http2frames_p.h>
@@ -95,6 +97,7 @@ public:
private slots:
void _q_uploadDataReadyRead();
void _q_replyDestroyed(QObject* reply);
+ void _q_uploadDataDestroyed(QObject* uploadData);
private:
using Stream = Http2::Stream;
@@ -158,13 +161,15 @@ private:
HPack::Decoder decoder;
HPack::Encoder encoder;
+ QHash<QObject *, int> streamIDs;
QHash<quint32, Stream> activeStreams;
std::deque<quint32> suspendedStreams[3]; // 3 for priorities: High, Normal, Low.
static const std::deque<quint32>::size_type maxRecycledStreams;
std::deque<quint32> recycledStreams;
- // Peer's max frame size.
- quint32 maxFrameSize = Http2::maxFrameSize;
+ // Peer's max frame size (this min is the default value
+ // we start with, that can be updated by SETTINGS frame):
+ quint32 maxFrameSize = Http2::minPayloadLimit;
Http2::FrameReader frameReader;
Http2::Frame inboundFrame;
@@ -176,28 +181,28 @@ private:
// Control flow:
- // This is how many concurrent streams our peer expects from us:
- // 100 is the default value, can be updated by the server's SETTINGS
- // frame(s):
+ // This is how many concurrent streams our peer allows us, 100 is the
+ // initial value, can be updated by the server's SETTINGS frame(s):
quint32 maxConcurrentStreams = Http2::maxConcurrentStreams;
// While we allow sending SETTTINGS_MAX_CONCURRENT_STREAMS to limit our peer,
// it's just a hint and we do not actually enforce it (and we can continue
// sending requests and creating streams while maxConcurrentStreams allows).
- // This is the max value, we set it in a ctor from Http2::ProtocolParameters,
- // it does not change after that.
+ // This is our (client-side) maximum possible receive window size, we set
+ // it in a ctor from QHttp2Configuration, it does not change after that.
+ // The default is 64Kb:
qint32 maxSessionReceiveWindowSize = Http2::defaultSessionWindowSize;
- // Our session receive window size, default is 64Kb. We'll update it from QNAM's
- // Http2::ProtocolParameters. Signed integer since it can become negative
+ // Our session current receive window size, updated in a ctor from
+ // QHttp2Configuration. Signed integer since it can become negative
// (it's still a valid window size).
qint32 sessionReceiveWindowSize = Http2::defaultSessionWindowSize;
// Our per-stream receive window size, default is 64 Kb, will be updated
- // from QNAM's Http2::ProtocolParameters. Again, signed - can become negative.
+ // from QHttp2Configuration. Again, signed - can become negative.
qint32 streamInitialReceiveWindowSize = Http2::defaultSessionWindowSize;
// These are our peer's receive window sizes, they will be updated by the
- // peer's SETTINGS and WINDOW_UPDATE frames.
+ // peer's SETTINGS and WINDOW_UPDATE frames, defaults presumed to be 64Kb.
qint32 sessionSendWindowSize = Http2::defaultSessionWindowSize;
qint32 streamInitialSendWindowSize = Http2::defaultSessionWindowSize;
diff --git a/src/network/access/qhttpmultipart.h b/src/network/access/qhttpmultipart.h
index 78585a704d..56db83779a 100644
--- a/src/network/access/qhttpmultipart.h
+++ b/src/network/access/qhttpmultipart.h
@@ -60,12 +60,10 @@ public:
QHttpPart();
QHttpPart(const QHttpPart &other);
~QHttpPart();
-#ifdef Q_COMPILER_RVALUE_REFS
- QHttpPart &operator=(QHttpPart &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QHttpPart &operator=(QHttpPart &&other) noexcept { swap(other); return *this; }
QHttpPart &operator=(const QHttpPart &other);
- void swap(QHttpPart &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QHttpPart &other) noexcept { qSwap(d, other.d); }
bool operator==(const QHttpPart &other) const;
inline bool operator!=(const QHttpPart &other) const
diff --git a/src/network/access/qhttpmultipart_p.h b/src/network/access/qhttpmultipart_p.h
index 363e0b346c..ead1eadf3b 100644
--- a/src/network/access/qhttpmultipart_p.h
+++ b/src/network/access/qhttpmultipart_p.h
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
class QHttpPartPrivate: public QSharedData, public QNetworkHeadersPrivate
{
public:
- inline QHttpPartPrivate() : bodyDevice(0), headerCreated(false), readPointer(0)
+ inline QHttpPartPrivate() : bodyDevice(nullptr), headerCreated(false), readPointer(0)
{
}
~QHttpPartPrivate()
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 294273d751..21c6359807 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -398,11 +398,12 @@ void QHttpNetworkConnectionPrivate::copyCredentials(int fromChannel, QAuthentica
{
Q_ASSERT(auth);
- // NTLM is a multi phase authentication. Copying credentials between authenticators would mess things up.
+ // NTLM and Negotiate do multi-phase authentication.
+ // Copying credentialsbetween authenticators would mess things up.
if (fromChannel >= 0) {
- if (!isProxy && channels[fromChannel].authMethod == QAuthenticatorPrivate::Ntlm)
- return;
- if (isProxy && channels[fromChannel].proxyAuthMethod == QAuthenticatorPrivate::Ntlm)
+ const QHttpNetworkConnectionChannel &channel = channels[fromChannel];
+ const QAuthenticatorPrivate::Method method = isProxy ? channel.proxyAuthMethod : channel.authMethod;
+ if (method == QAuthenticatorPrivate::Ntlm || method == QAuthenticatorPrivate::Negotiate)
return;
}
@@ -592,24 +593,26 @@ void QHttpNetworkConnectionPrivate::createAuthorization(QAbstractSocket *socket,
if ((channels[i].authMethod != QAuthenticatorPrivate::Ntlm && request.headerField("Authorization").isEmpty()) || channels[i].lastStatus == 401) {
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].authenticator);
if (priv && priv->method != QAuthenticatorPrivate::None) {
- QByteArray response = priv->calculateResponse(request.methodName(), request.uri(false));
+ QByteArray response = priv->calculateResponse(request.methodName(), request.uri(false), request.url().host());
request.setHeaderField("Authorization", response);
channels[i].authenticationCredentialsSent = true;
}
}
}
+#if QT_CONFIG(networkproxy)
// Send "Proxy-Authorization" header, but not if it's NTLM and the socket is already authenticated.
if (channels[i].proxyAuthMethod != QAuthenticatorPrivate::None) {
if (!(channels[i].proxyAuthMethod == QAuthenticatorPrivate::Ntlm && channels[i].lastStatus != 407)) {
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(channels[i].proxyAuthenticator);
if (priv && priv->method != QAuthenticatorPrivate::None) {
- QByteArray response = priv->calculateResponse(request.methodName(), request.uri(false));
+ QByteArray response = priv->calculateResponse(request.methodName(), request.uri(false), networkProxy.hostName());
request.setHeaderField("Proxy-Authorization", response);
channels[i].proxyCredentialsSent = true;
}
}
}
+#endif // QT_CONFIG(networkproxy)
}
QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetworkRequest &request)
@@ -1318,8 +1321,12 @@ QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16
: QObject(*(new QHttpNetworkConnectionPrivate(hostName, port, encrypt, connectionType)), parent)
{
Q_D(QHttpNetworkConnection);
- d->networkSession = qMove(networkSession);
+ d->networkSession = std::move(networkSession);
d->init();
+ if (QNetworkStatusMonitor::isEnabled()) {
+ connect(&d->connectionMonitor, &QNetworkConnectionMonitor::reachabilityChanged,
+ this, &QHttpNetworkConnection::onlineStateChanged, Qt::QueuedConnection);
+ }
}
QHttpNetworkConnection::QHttpNetworkConnection(quint16 connectionCount, const QString &hostName,
@@ -1330,8 +1337,12 @@ QHttpNetworkConnection::QHttpNetworkConnection(quint16 connectionCount, const QS
connectionType)), parent)
{
Q_D(QHttpNetworkConnection);
- d->networkSession = qMove(networkSession);
+ d->networkSession = std::move(networkSession);
d->init();
+ if (QNetworkStatusMonitor::isEnabled()) {
+ connect(&d->connectionMonitor, &QNetworkConnectionMonitor::reachabilityChanged,
+ this, &QHttpNetworkConnection::onlineStateChanged, Qt::QueuedConnection);
+ }
}
#else
QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16 port, bool encrypt,
@@ -1340,6 +1351,10 @@ QHttpNetworkConnection::QHttpNetworkConnection(const QString &hostName, quint16
{
Q_D(QHttpNetworkConnection);
d->init();
+ if (QNetworkStatusMonitor::isEnabled()) {
+ connect(&d->connectionMonitor, &QNetworkConnectionMonitor::reachabilityChanged,
+ this, &QHttpNetworkConnection::onlineStateChanged, Qt::QueuedConnection);
+ }
}
QHttpNetworkConnection::QHttpNetworkConnection(quint16 connectionCount, const QString &hostName,
@@ -1350,8 +1365,12 @@ QHttpNetworkConnection::QHttpNetworkConnection(quint16 connectionCount, const QS
{
Q_D(QHttpNetworkConnection);
d->init();
+ if (QNetworkStatusMonitor::isEnabled()) {
+ connect(&d->connectionMonitor, &QNetworkConnectionMonitor::reachabilityChanged,
+ this, &QHttpNetworkConnection::onlineStateChanged, Qt::QueuedConnection);
+ }
}
-#endif
+#endif // QT_NO_BEARERMANAGEMENT
QHttpNetworkConnection::~QHttpNetworkConnection()
{
@@ -1438,21 +1457,16 @@ void QHttpNetworkConnection::setConnectionType(ConnectionType type)
d->connectionType = type;
}
-Http2::ProtocolParameters QHttpNetworkConnection::http2Parameters() const
+QHttp2Configuration QHttpNetworkConnection::http2Parameters() const
{
Q_D(const QHttpNetworkConnection);
return d->http2Parameters;
}
-void QHttpNetworkConnection::setHttp2Parameters(const Http2::ProtocolParameters &params)
+void QHttpNetworkConnection::setHttp2Parameters(const QHttp2Configuration &params)
{
Q_D(QHttpNetworkConnection);
- if (params.validate()) {
- d->http2Parameters = params;
- } else {
- qCWarning(QT_HTTP2)
- << "invalid HTTP/2 parameters, falling back to defaults instead";
- }
+ d->http2Parameters = params;
}
// SSL support below
@@ -1477,7 +1491,7 @@ QSharedPointer<QSslContext> QHttpNetworkConnection::sslContext()
void QHttpNetworkConnection::setSslContext(QSharedPointer<QSslContext> context)
{
Q_D(QHttpNetworkConnection);
- d->sslContext = qMove(context);
+ d->sslContext = std::move(context);
}
void QHttpNetworkConnection::ignoreSslErrors(int channel)
@@ -1531,6 +1545,26 @@ void QHttpNetworkConnection::setPeerVerifyName(const QString &peerName)
d->peerVerifyName = peerName;
}
+void QHttpNetworkConnection::onlineStateChanged(bool isOnline)
+{
+ Q_D(QHttpNetworkConnection);
+
+ if (isOnline) {
+ // If we did not have any 'isOffline' previously - well, good
+ // to know, we are 'online' apparently.
+ return;
+ }
+
+ for (int i = 0; i < d->activeChannelCount; i++) {
+ auto &channel = d->channels[i];
+ channel.emitFinishedWithError(QNetworkReply::TemporaryNetworkFailureError, "Temporary network failure.");
+ channel.close();
+ }
+
+ // We don't care, this connection is broken from our POV.
+ d->connectionMonitor.stopMonitoring();
+}
+
#ifndef QT_NO_NETWORKPROXY
// only called from QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired, not
// from QHttpNetworkConnectionChannel::handleAuthenticationChallenge
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 2bd727e0af..6808a0c0ac 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -57,6 +57,8 @@
#include <QtNetwork/qabstractsocket.h>
#include <QtNetwork/qnetworksession.h>
+#include <qhttp2configuration.h>
+
#include <private/qobject_p.h>
#include <qauthenticator.h>
#include <qnetworkproxy.h>
@@ -67,6 +69,7 @@
#include <private/qhttpnetworkheader_p.h>
#include <private/qhttpnetworkrequest_p.h>
#include <private/qhttpnetworkreply_p.h>
+#include <private/qnetconmonitor_p.h>
#include <private/http2protocol_p.h>
#include <private/qhttpnetworkconnectionchannel_p.h>
@@ -101,10 +104,10 @@ public:
#ifndef QT_NO_BEARERMANAGEMENT
explicit QHttpNetworkConnection(const QString &hostName, quint16 port = 80, bool encrypt = false,
ConnectionType connectionType = ConnectionTypeHTTP,
- QObject *parent = 0, QSharedPointer<QNetworkSession> networkSession
+ QObject *parent = nullptr, QSharedPointer<QNetworkSession> networkSession
= QSharedPointer<QNetworkSession>());
QHttpNetworkConnection(quint16 channelCount, const QString &hostName, quint16 port = 80,
- bool encrypt = false, QObject *parent = 0,
+ bool encrypt = false, QObject *parent = nullptr,
QSharedPointer<QNetworkSession> networkSession = QSharedPointer<QNetworkSession>(),
ConnectionType connectionType = ConnectionTypeHTTP);
#else
@@ -141,8 +144,8 @@ public:
ConnectionType connectionType();
void setConnectionType(ConnectionType type);
- Http2::ProtocolParameters http2Parameters() const;
- void setHttp2Parameters(const Http2::ProtocolParameters &params);
+ QHttp2Configuration http2Parameters() const;
+ void setHttp2Parameters(const QHttp2Configuration &params);
#ifndef QT_NO_SSL
void setSslConfiguration(const QSslConfiguration &config);
@@ -156,6 +159,10 @@ public:
QString peerVerifyName() const;
void setPeerVerifyName(const QString &peerName);
+
+public slots:
+ void onlineStateChanged(bool isOnline);
+
private:
Q_DECLARE_PRIVATE(QHttpNetworkConnection)
Q_DISABLE_COPY_MOVE(QHttpNetworkConnection)
@@ -289,9 +296,17 @@ public:
QSharedPointer<QNetworkSession> networkSession;
#endif
- Http2::ProtocolParameters http2Parameters;
+ QHttp2Configuration http2Parameters;
QString peerVerifyName;
+ // If network status monitoring is enabled, we activate connectionMonitor
+ // as soons as one of channels managed to connect to host (and we
+ // have a pair of addresses (us,peer).
+ // NETMONTODO: consider activating a monitor on a change from
+ // HostLookUp state to ConnectingState (means we have both
+ // local/remote addresses known and can start monitoring this
+ // early).
+ QNetworkConnectionMonitor connectionMonitor;
friend class QHttpNetworkConnectionChannel;
};
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 8f94cef32b..39f392a79b 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -40,6 +40,7 @@
#include "qhttpnetworkconnectionchannel_p.h"
#include "qhttpnetworkconnection_p.h"
+#include "qhttp2configuration.h"
#include "private/qnoncontiguousbytedevice_p.h"
#include <qpair.h>
@@ -48,6 +49,7 @@
#include <private/qhttp2protocolhandler_p.h>
#include <private/qhttpprotocolhandler_p.h>
#include <private/qspdyprotocolhandler_p.h>
+#include <private/http2protocol_p.h>
#ifndef QT_NO_SSL
# include <private/qsslsocket_p.h>
@@ -59,6 +61,8 @@
#include "private/qnetworksession_p.h"
#endif
+#include "private/qnetconmonitor_p.h"
+
QT_BEGIN_NAMESPACE
namespace
@@ -902,6 +906,16 @@ void QHttpNetworkConnectionChannel::_q_connected()
pipeliningSupported = QHttpNetworkConnectionChannel::PipeliningSupportUnknown;
+ if (QNetworkStatusMonitor::isEnabled()) {
+ auto connectionPrivate = connection->d_func();
+ if (!connectionPrivate->connectionMonitor.isMonitoring()) {
+ // Now that we have a pair of addresses, we can start monitoring the
+ // connection status to handle its loss properly.
+ if (connectionPrivate->connectionMonitor.setTargets(socket->localAddress(), socket->peerAddress()))
+ connectionPrivate->connectionMonitor.startMonitoring();
+ }
+ }
+
// ### FIXME: if the server closes the connection unexpectedly, we shouldn't send the same broken request again!
//channels[i].reconnectAttempts = 2;
if (ssl || pendingEncrypt) { // FIXME: Didn't work properly with pendingEncrypt only, we should refactor this into an EncrypingState
@@ -938,9 +952,7 @@ void QHttpNetworkConnectionChannel::_q_connected()
if (tryProtocolUpgrade) {
// Let's augment our request with some magic headers and try to
// switch to HTTP/2.
- const Http2::ProtocolParameters params(connection->http2Parameters());
- Q_ASSERT(params.validate());
- params.addProtocolUpgradeHeaders(&request);
+ Http2::appendProtocolUpgradeHeaders(connection->http2Parameters(), &request);
}
sendRequest();
}
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index c9c3172304..a8b635c45a 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -444,6 +444,9 @@ QAuthenticatorPrivate::Method QHttpNetworkReplyPrivate::authenticationMethod(boo
} else if (method < QAuthenticatorPrivate::DigestMd5
&& line.startsWith("digest")) {
method = QAuthenticatorPrivate::DigestMd5;
+ } else if (method < QAuthenticatorPrivate::Negotiate
+ && line.startsWith("negotiate")) {
+ method = QAuthenticatorPrivate::Negotiate;
}
}
return method;
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index 863e21ea3e..12cfe359aa 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -89,7 +89,7 @@ class Q_AUTOTEST_EXPORT QHttpNetworkReply : public QObject, public QHttpNetworkH
Q_OBJECT
public:
- explicit QHttpNetworkReply(const QUrl &url = QUrl(), QObject *parent = 0);
+ explicit QHttpNetworkReply(const QUrl &url = QUrl(), QObject *parent = nullptr);
virtual ~QHttpNetworkReply();
QUrl url() const override;
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 46a6615f4d..63a3c4f204 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -190,7 +190,7 @@ public:
QHttpNetworkConnection::ConnectionType connectionType,
QSharedPointer<QNetworkSession> networkSession)
: QHttpNetworkConnection(hostName, port, encrypt, connectionType, /*parent=*/0,
- qMove(networkSession))
+ std::move(networkSession))
#endif
{
setExpires(true);
@@ -354,9 +354,9 @@ void QHttpThreadDelegate::startRequest()
networkSession);
#endif // QT_NO_BEARERMANAGEMENT
if (connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2
- && http2Parameters.validate()) {
+ || connectionType == QHttpNetworkConnection::ConnectionTypeHTTP2Direct) {
httpConnection->setHttp2Parameters(http2Parameters);
- } // else we ignore invalid parameters and use our own defaults.
+ }
#ifndef QT_NO_SSL
// Set the QSslConfiguration from this QNetworkRequest.
if (ssl)
diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h
index 019a8b8b74..355d1afc30 100644
--- a/src/network/access/qhttpthreaddelegate_p.h
+++ b/src/network/access/qhttpthreaddelegate_p.h
@@ -62,6 +62,7 @@
#include <QNetworkReply>
#include "qhttpnetworkrequest_p.h"
#include "qhttpnetworkconnection_p.h"
+#include "qhttp2configuration.h"
#include <QSharedPointer>
#include <QScopedPointer>
#include "private/qnoncontiguousbytedevice_p.h"
@@ -82,7 +83,7 @@ class QHttpThreadDelegate : public QObject
{
Q_OBJECT
public:
- explicit QHttpThreadDelegate(QObject *parent = 0);
+ explicit QHttpThreadDelegate(QObject *parent = nullptr);
~QHttpThreadDelegate();
@@ -116,7 +117,7 @@ public:
qint64 removedContentLength;
QNetworkReply::NetworkError incomingErrorCode;
QString incomingErrorDetail;
- Http2::ProtocolParameters http2Parameters;
+ QHttp2Configuration http2Parameters;
#ifndef QT_NO_BEARERMANAGEMENT
QSharedPointer<QNetworkSession> networkSession;
#endif
@@ -207,7 +208,7 @@ public:
: QNonContiguousByteDevice(),
wantDataPending(false),
m_amount(0),
- m_data(0),
+ m_data(nullptr),
m_atEnd(aE),
m_size(s),
m_pos(0)
@@ -240,12 +241,12 @@ public:
// Do nothing, we already sent a wantData signal and wait for results
len = 0;
}
- return 0;
+ return nullptr;
}
bool advanceReadPointer(qint64 a) override
{
- if (m_data == 0)
+ if (m_data == nullptr)
return false;
m_amount -= a;
@@ -269,7 +270,7 @@ public:
bool reset() override
{
m_amount = 0;
- m_data = 0;
+ m_data = nullptr;
m_dataArray.clear();
if (wantDataPending) {
diff --git a/src/network/access/qnetworkaccessauthenticationmanager_p.h b/src/network/access/qnetworkaccessauthenticationmanager_p.h
index 548675728f..31111ca2a5 100644
--- a/src/network/access/qnetworkaccessauthenticationmanager_p.h
+++ b/src/network/access/qnetworkaccessauthenticationmanager_p.h
@@ -90,12 +90,12 @@ public:
void cacheCredentials(const QUrl &url, const QAuthenticator *auth);
QNetworkAuthenticationCredential fetchCachedCredentials(const QUrl &url,
- const QAuthenticator *auth = 0);
+ const QAuthenticator *auth = nullptr);
#ifndef QT_NO_NETWORKPROXY
void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth);
QNetworkAuthenticationCredential fetchCachedProxyCredentials(const QNetworkProxy &proxy,
- const QAuthenticator *auth = 0);
+ const QAuthenticator *auth = nullptr);
#endif
void clearCache();
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp
index 272dd22097..566e410051 100644
--- a/src/network/access/qnetworkaccessbackend.cpp
+++ b/src/network/access/qnetworkaccessbackend.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
class QNetworkAccessBackendFactoryData: public QList<QNetworkAccessBackendFactory *>
{
public:
- QNetworkAccessBackendFactoryData() : mutex(QMutex::Recursive)
+ QNetworkAccessBackendFactoryData()
{
valid.ref();
}
@@ -68,7 +68,7 @@ public:
valid.deref();
}
- QMutex mutex;
+ QRecursiveMutex mutex;
//this is used to avoid (re)constructing factory data from destructors of other global classes
static QBasicAtomicInt valid;
};
@@ -83,7 +83,7 @@ QNetworkAccessBackendFactory::QNetworkAccessBackendFactory()
QNetworkAccessBackendFactory::~QNetworkAccessBackendFactory()
{
- if (QNetworkAccessBackendFactoryData::valid.load()) {
+ if (QNetworkAccessBackendFactoryData::valid.loadRelaxed()) {
QMutexLocker locker(&factoryData()->mutex);
factoryData()->removeAll(this);
}
@@ -92,7 +92,7 @@ QNetworkAccessBackendFactory::~QNetworkAccessBackendFactory()
QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessManager::Operation op,
const QNetworkRequest &request)
{
- if (QNetworkAccessBackendFactoryData::valid.load()) {
+ if (QNetworkAccessBackendFactoryData::valid.loadRelaxed()) {
QMutexLocker locker(&factoryData()->mutex);
QNetworkAccessBackendFactoryData::ConstIterator it = factoryData()->constBegin(),
end = factoryData()->constEnd();
@@ -110,7 +110,7 @@ QNetworkAccessBackend *QNetworkAccessManagerPrivate::findBackend(QNetworkAccessM
QStringList QNetworkAccessManagerPrivate::backendSupportedSchemes() const
{
- if (QNetworkAccessBackendFactoryData::valid.load()) {
+ if (QNetworkAccessBackendFactoryData::valid.loadRelaxed()) {
QMutexLocker locker(&factoryData()->mutex);
QNetworkAccessBackendFactoryData::ConstIterator it = factoryData()->constBegin();
QNetworkAccessBackendFactoryData::ConstIterator end = factoryData()->constEnd();
diff --git a/src/network/access/qnetworkaccesscache.cpp b/src/network/access/qnetworkaccesscache.cpp
index 00bb18cb82..b694a2c999 100644
--- a/src/network/access/qnetworkaccesscache.cpp
+++ b/src/network/access/qnetworkaccesscache.cpp
@@ -40,11 +40,12 @@
#include "qnetworkaccesscache_p.h"
#include "QtCore/qpointer.h"
#include "QtCore/qdatetime.h"
-#include "QtCore/qqueue.h"
#include "qnetworkaccessmanager_p.h"
#include "qnetworkreply_p.h"
#include "qnetworkrequest.h"
+#include <vector>
+
QT_BEGIN_NAMESPACE
enum ExpiryTimeEnum {
@@ -63,7 +64,7 @@ namespace {
struct QNetworkAccessCache::Node
{
QDateTime timestamp;
- QQueue<Receiver> receiverQueue;
+ std::vector<Receiver> receiverQueue;
QByteArray key;
Node *older, *newer;
@@ -277,10 +278,7 @@ bool QNetworkAccessCache::requestEntry(const QByteArray &key, QObject *target, c
// object is not shareable and is in use
// queue for later use
Q_ASSERT(node->older == 0 && node->newer == 0);
- Receiver receiver;
- receiver.object = target;
- receiver.member = member;
- node->receiverQueue.enqueue(receiver);
+ node->receiverQueue.push_back({target, member});
// request queued
return true;
@@ -331,17 +329,19 @@ void QNetworkAccessCache::releaseEntry(const QByteArray &key)
Q_ASSERT(node->useCount > 0);
// are there other objects waiting?
- if (!node->receiverQueue.isEmpty()) {
+ const auto objectStillExists = [](const Receiver &r) { return !r.object.isNull(); };
+
+ auto &queue = node->receiverQueue;
+ auto qit = std::find_if(queue.begin(), queue.end(), objectStillExists);
+
+ const Receiver receiver = qit == queue.end() ? Receiver{} : std::move(*qit++) ;
+
+ queue.erase(queue.begin(), qit);
+
+ if (receiver.object) {
// queue another activation
- Receiver receiver;
- do {
- receiver = node->receiverQueue.dequeue();
- } while (receiver.object.isNull() && !node->receiverQueue.isEmpty());
-
- if (!receiver.object.isNull()) {
- emitEntryReady(node, receiver.object, receiver.member);
- return;
- }
+ emitEntryReady(node, receiver.object, receiver.member);
+ return;
}
if (!--node->useCount) {
diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp
index 5ad820eba0..51ed2f5a55 100644
--- a/src/network/access/qnetworkaccessftpbackend.cpp
+++ b/src/network/access/qnetworkaccessftpbackend.cpp
@@ -99,6 +99,8 @@ public:
connect(this, SIGNAL(done(bool)), this, SLOT(deleteLater()));
close();
}
+
+ using QFtp::clearError;
};
QNetworkAccessFtpBackend::QNetworkAccessFtpBackend()
@@ -282,7 +284,10 @@ void QNetworkAccessFtpBackend::ftpDone()
}
// check for errors:
- if (ftp->error() != QFtp::NoError) {
+ if (state == CheckingFeatures && ftp->error() == QFtp::UnknownError) {
+ qWarning("QNetworkAccessFtpBackend: HELP command failed, ignoring it");
+ ftp->clearError();
+ } else if (ftp->error() != QFtp::NoError) {
QString msg;
if (operation() == QNetworkAccessManager::GetOperation)
msg = tr("Error while downloading %1: %2");
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index b9c8116421..76b95b5823 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -70,6 +70,7 @@
#include "QtNetwork/private/qauthenticator_p.h"
#include "QtNetwork/qsslconfiguration.h"
#include "QtNetwork/qnetworkconfigmanager.h"
+#include "QtNetwork/private/http2protocol_p.h"
#if QT_CONFIG(http)
#include "qhttpmultipart.h"
@@ -90,6 +91,8 @@
#include "qnetworkreplywasmimpl_p.h"
#endif
+#include "qnetconmonitor_p.h"
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QNetworkAccessFileBackendFactory, fileBackend)
@@ -486,18 +489,26 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
qRegisterMetaType<QNetworkReply::NetworkError>();
qRegisterMetaType<QSharedPointer<char> >();
-#ifndef QT_NO_BEARERMANAGEMENT
Q_D(QNetworkAccessManager);
- // if a session is required, we track online state through
- // the QNetworkSession's signals if a request is already made.
- // we need to track current accessibility state by default
- //
- connect(&d->networkConfigurationManager, SIGNAL(onlineStateChanged(bool)),
- SLOT(_q_onlineStateChanged(bool)));
- connect(&d->networkConfigurationManager, SIGNAL(configurationChanged(QNetworkConfiguration)),
- SLOT(_q_configurationChanged(QNetworkConfiguration)));
-#endif
+ if (QNetworkStatusMonitor::isEnabled()) {
+ connect(&d->statusMonitor, SIGNAL(onlineStateChanged(bool)),
+ SLOT(_q_onlineStateChanged(bool)));
+#ifdef QT_NO_BEARERMANAGEMENT
+ d->networkAccessible = d->statusMonitor.isNetworkAccessible();
+#else
+ d->networkAccessible = d->statusMonitor.isNetworkAccessible() ? Accessible : NotAccessible;
+ } else {
+ // if a session is required, we track online state through
+ // the QNetworkSession's signals if a request is already made.
+ // we need to track current accessibility state by default
+ //
+ connect(&d->networkConfigurationManager, SIGNAL(onlineStateChanged(bool)),
+ SLOT(_q_onlineStateChanged(bool)));
+ connect(&d->networkConfigurationManager, SIGNAL(configurationChanged(QNetworkConfiguration)),
+ SLOT(_q_configurationChanged(QNetworkConfiguration)));
+#endif // QT_NO_BEARERMANAGEMENT
+ }
}
/*!
@@ -1030,6 +1041,7 @@ QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &requ
void QNetworkAccessManager::setConfiguration(const QNetworkConfiguration &config)
{
Q_D(QNetworkAccessManager);
+
d->networkConfiguration = config;
d->customNetworkConfiguration = true;
d->createSession(config);
@@ -1048,7 +1060,7 @@ QNetworkConfiguration QNetworkAccessManager::configuration() const
Q_D(const QNetworkAccessManager);
QSharedPointer<QNetworkSession> session(d->getNetworkSession());
- if (session) {
+ if (session && !d->statusMonitor.isEnabled()) {
return session->configuration();
} else {
return d->networkConfigurationManager.defaultConfiguration();
@@ -1075,7 +1087,7 @@ QNetworkConfiguration QNetworkAccessManager::activeConfiguration() const
Q_D(const QNetworkAccessManager);
QSharedPointer<QNetworkSession> networkSession(d->getNetworkSession());
- if (networkSession) {
+ if (networkSession && !d->statusMonitor.isEnabled()) {
return d->networkConfigurationManager.configurationFromIdentifier(
networkSession->sessionProperty(QLatin1String("ActiveConfiguration")).toString());
} else {
@@ -1114,6 +1126,12 @@ QNetworkAccessManager::NetworkAccessibility QNetworkAccessManager::networkAccess
{
Q_D(const QNetworkAccessManager);
+ if (d->statusMonitor.isEnabled()) {
+ if (!d->statusMonitor.isMonitoring())
+ d->statusMonitor.start();
+ return d->networkAccessible;
+ }
+
if (d->customNetworkConfiguration && d->networkConfiguration.state().testFlag(QNetworkConfiguration::Undefined))
return UnknownAccessibility;
@@ -1162,7 +1180,6 @@ QSharedPointer<QNetworkSession> QNetworkAccessManagerPrivate::getNetworkSession(
#endif // QT_NO_BEARERMANAGEMENT
-
#ifndef QT_NO_SSL
/*!
\since 5.2
@@ -1387,6 +1404,11 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, redirectPolicy());
}
+ if (autoDeleteReplies()
+ && req.attribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute).isNull()) {
+ req.setAttribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute, true);
+ }
+
bool isLocalFile = req.url().isLocalFile();
QString scheme = req.url().scheme();
@@ -1435,35 +1457,57 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
}
}
-#ifndef QT_NO_BEARERMANAGEMENT
+ if (d->statusMonitor.isEnabled()) {
+ // See the code in ctor - QNetworkStatusMonitor allows us to
+ // immediately set 'networkAccessible' even before we start
+ // the monitor.
+#ifdef QT_NO_BEARERMANAGEMENT
+ if (d->networkAccessible
+#else
+ if (d->networkAccessible == NotAccessible
+#endif // QT_NO_BEARERMANAGEMENT
+ && !isLocalFile) {
+ QHostAddress dest;
+ QString host = req.url().host().toLower();
+ if (!(dest.setAddress(host) && dest.isLoopback())
+ && host != QLatin1String("localhost")
+ && host != QHostInfo::localHostName().toLower()) {
+ return new QDisabledNetworkReply(this, req, op);
+ }
+ }
- // Return a disabled network reply if network access is disabled.
- // Except if the scheme is empty or file:// or if the host resolves to a loopback address.
- if (d->networkAccessible == NotAccessible && !isLocalFile) {
- QHostAddress dest;
- QString host = req.url().host().toLower();
- if (!(dest.setAddress(host) && dest.isLoopback()) && host != QLatin1String("localhost")
+ if (!d->statusMonitor.isMonitoring() && !d->statusMonitor.start())
+ qWarning(lcNetMon, "failed to start network status monitoring");
+ } else {
+#ifndef QT_NO_BEARERMANAGEMENT
+ // Return a disabled network reply if network access is disabled.
+ // Except if the scheme is empty or file:// or if the host resolves to a loopback address.
+ if (d->networkAccessible == NotAccessible && !isLocalFile) {
+ QHostAddress dest;
+ QString host = req.url().host().toLower();
+ if (!(dest.setAddress(host) && dest.isLoopback()) && host != QLatin1String("localhost")
&& host != QHostInfo::localHostName().toLower()) {
- return new QDisabledNetworkReply(this, req, op);
+ return new QDisabledNetworkReply(this, req, op);
+ }
}
- }
- if (!d->networkSessionStrongRef && (d->initializeSession || !d->networkConfiguration.identifier().isEmpty())) {
- if (!d->networkConfiguration.identifier().isEmpty()) {
- if ((d->networkConfiguration.state() & QNetworkConfiguration::Defined)
- && d->networkConfiguration != d->networkConfigurationManager.defaultConfiguration())
- d->createSession(d->networkConfigurationManager.defaultConfiguration());
- else
- d->createSession(d->networkConfiguration);
+ if (!d->networkSessionStrongRef && (d->initializeSession || !d->networkConfiguration.identifier().isEmpty())) {
+ if (!d->networkConfiguration.identifier().isEmpty()) {
+ if ((d->networkConfiguration.state() & QNetworkConfiguration::Defined)
+ && d->networkConfiguration != d->networkConfigurationManager.defaultConfiguration())
+ d->createSession(d->networkConfigurationManager.defaultConfiguration());
+ else
+ d->createSession(d->networkConfiguration);
- } else {
- if (d->networkSessionRequired)
- d->createSession(d->networkConfigurationManager.defaultConfiguration());
- else
- d->initializeSession = false;
+ } else {
+ if (d->networkSessionRequired)
+ d->createSession(d->networkConfigurationManager.defaultConfiguration());
+ else
+ d->initializeSession = false;
+ }
}
- }
#endif
+ }
QNetworkRequest request = req;
if (!request.header(QNetworkRequest::ContentLengthHeader).isValid() &&
@@ -1510,8 +1554,10 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
#endif
QNetworkReplyHttpImpl *reply = new QNetworkReplyHttpImpl(this, request, op, outgoingData);
#ifndef QT_NO_BEARERMANAGEMENT
- connect(this, SIGNAL(networkSessionConnected()),
- reply, SLOT(_q_networkSessionConnected()));
+ if (!d->statusMonitor.isEnabled()) {
+ connect(this, SIGNAL(networkSessionConnected()),
+ reply, SLOT(_q_networkSessionConnected()));
+ }
#endif
return reply;
}
@@ -1520,7 +1566,9 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
// first step: create the reply
QNetworkReplyImpl *reply = new QNetworkReplyImpl(this);
#ifndef QT_NO_BEARERMANAGEMENT
- if (!isLocalFile) {
+ // NETMONTODO: network reply impl must be augmented to use the same monitoring
+ // capabilities as http network reply impl does. Once it does: uncomment the condition below
+ if (!isLocalFile /*&& !d->statusMonitor.isEnabled()*/) {
connect(this, SIGNAL(networkSessionConnected()),
reply, SLOT(_q_networkSessionConnected()));
}
@@ -1631,13 +1679,50 @@ void QNetworkAccessManager::clearConnectionCache()
QNetworkAccessManagerPrivate::clearConnectionCache(this);
}
+
+/*!
+ \since 5.14
+
+ Returns the true if QNetworkAccessManager is currently configured
+ to automatically delete QNetworkReplies, false otherwise.
+
+ \sa setAutoDeleteReplies,
+ QNetworkRequest::AutoDeleteReplyOnFinishAttribute
+*/
+bool QNetworkAccessManager::autoDeleteReplies() const
+{
+ return d_func()->autoDeleteReplies;
+}
+
+/*!
+ \since 5.14
+
+ Enables or disables automatic deletion of \l {QNetworkReply} {QNetworkReplies}.
+
+ Setting \a shouldAutoDelete to true is the same as setting the
+ QNetworkRequest::AutoDeleteReplyOnFinishAttribute attribute to
+ true on all \e{future} \l {QNetworkRequest} {QNetworkRequests}
+ passed to this instance of QNetworkAccessManager unless the
+ attribute was already explicitly set on the QNetworkRequest.
+
+ \sa autoDeleteReplies,
+ QNetworkRequest::AutoDeleteReplyOnFinishAttribute
+*/
+void QNetworkAccessManager::setAutoDeleteReplies(bool shouldAutoDelete)
+{
+ d_func()->autoDeleteReplies = shouldAutoDelete;
+}
+
void QNetworkAccessManagerPrivate::_q_replyFinished()
{
Q_Q(QNetworkAccessManager);
QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());
- if (reply)
+ if (reply) {
emit q->finished(reply);
+ if (reply->request().attribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute, false).toBool())
+ QMetaObject::invokeMethod(reply, [reply] { reply->deleteLater(); }, Qt::QueuedConnection);
+ }
#ifndef QT_NO_BEARERMANAGEMENT
// If there are no active requests, release our reference to the network session.
@@ -1989,7 +2074,13 @@ void QNetworkAccessManagerPrivate::_q_networkSessionStateChanged(QNetworkSession
void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
{
- Q_Q(QNetworkAccessManager);
+ Q_Q(QNetworkAccessManager);
+
+ if (statusMonitor.isEnabled()) {
+ networkAccessible = isOnline ? QNetworkAccessManager::Accessible : QNetworkAccessManager::NotAccessible;
+ return;
+ }
+
// if the user set a config, we only care whether this one is active.
// Otherwise, this QNAM is online if there is an online config.
@@ -2019,6 +2110,9 @@ void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
void QNetworkAccessManagerPrivate::_q_configurationChanged(const QNetworkConfiguration &configuration)
{
+ if (statusMonitor.isEnabled())
+ return;
+
const QString id = configuration.identifier();
if (configuration.state().testFlag(QNetworkConfiguration::Active)) {
if (!onlineConfigurations.contains(id)) {
@@ -2051,6 +2145,9 @@ void QNetworkAccessManagerPrivate::_q_configurationChanged(const QNetworkConfigu
void QNetworkAccessManagerPrivate::_q_networkSessionFailed(QNetworkSession::SessionError)
{
+ if (statusMonitor.isEnabled())
+ return;
+
const auto cfgs = networkConfigurationManager.allConfigurations();
for (const QNetworkConfiguration &cfg : cfgs) {
if (cfg.state().testFlag(QNetworkConfiguration::Active)) {
@@ -2062,6 +2159,13 @@ void QNetworkAccessManagerPrivate::_q_networkSessionFailed(QNetworkSession::Sess
}
}
+#else
+
+void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
+{
+ networkAccessible = isOnline;
+}
+
#endif // QT_NO_BEARERMANAGEMENT
#if QT_CONFIG(http)
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index 7e2f7683d0..98498d07d2 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -167,6 +167,9 @@ public:
void setRedirectPolicy(QNetworkRequest::RedirectPolicy policy);
QNetworkRequest::RedirectPolicy redirectPolicy() const;
+ bool autoDeleteReplies() const;
+ void setAutoDeleteReplies(bool autoDelete);
+
Q_SIGNALS:
#ifndef QT_NO_NETWORKPROXY
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
@@ -209,10 +212,10 @@ private:
#ifndef QT_NO_BEARERMANAGEMENT
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionClosed())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionStateChanged(QNetworkSession::State))
- Q_PRIVATE_SLOT(d_func(), void _q_onlineStateChanged(bool))
Q_PRIVATE_SLOT(d_func(), void _q_configurationChanged(const QNetworkConfiguration &))
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed(QNetworkSession::SessionError))
#endif
+ Q_PRIVATE_SLOT(d_func(), void _q_onlineStateChanged(bool))
};
QT_END_NAMESPACE
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index 5cab4928e4..67ea2094b3 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -55,6 +55,7 @@
#include "qnetworkaccessmanager.h"
#include "qnetworkaccesscache_p.h"
#include "qnetworkaccessbackend_p.h"
+#include "private/qnetconmonitor_p.h"
#include "qnetworkrequest.h"
#include "qhsts_p.h"
#include "private/qobject_p.h"
@@ -151,6 +152,7 @@ public:
QNetworkAccessBackend *findBackend(QNetworkAccessManager::Operation op, const QNetworkRequest &request);
QStringList backendSupportedSchemes() const;
+ void _q_onlineStateChanged(bool isOnline);
#ifndef QT_NO_BEARERMANAGEMENT
void createSession(const QNetworkConfiguration &config);
QSharedPointer<QNetworkSession> getNetworkSession() const;
@@ -160,12 +162,11 @@ public:
void _q_networkSessionPreferredConfigurationChanged(const QNetworkConfiguration &config,
bool isSeamless);
void _q_networkSessionStateChanged(QNetworkSession::State state);
- void _q_onlineStateChanged(bool isOnline);
+
void _q_configurationChanged(const QNetworkConfiguration &configuration);
void _q_networkSessionFailed(QNetworkSession::SessionError error);
QSet<QString> onlineConfigurations;
-
#endif
#if QT_CONFIG(http)
@@ -199,6 +200,8 @@ public:
int activeReplyCount;
bool online;
bool initializeSession;
+#else
+ bool networkAccessible = true;
#endif
bool cookieJarCreated;
@@ -222,6 +225,9 @@ public:
QScopedPointer<QHstsStore> stsStore;
#endif // QT_CONFIG(settings)
bool stsEnabled = false;
+ mutable QNetworkStatusMonitor statusMonitor;
+
+ bool autoDeleteReplies = false;
#ifndef QT_NO_BEARERMANAGEMENT
Q_AUTOTEST_EXPORT static const QWeakPointer<const QNetworkSession> getNetworkSession(const QNetworkAccessManager *manager);
diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp
index b7cf989477..903de322ff 100644
--- a/src/network/access/qnetworkcookie.cpp
+++ b/src/network/access/qnetworkcookie.cpp
@@ -46,6 +46,7 @@
#include "QtCore/qdebug.h"
#include "QtCore/qlist.h"
#include "QtCore/qlocale.h"
+#include <QtCore/qregexp.h>
#include "QtCore/qstring.h"
#include "QtCore/qstringlist.h"
#include "QtCore/qurl.h"
diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h
index e462b98555..b712b63849 100644
--- a/src/network/access/qnetworkcookie.h
+++ b/src/network/access/qnetworkcookie.h
@@ -66,12 +66,10 @@ public:
explicit QNetworkCookie(const QByteArray &name = QByteArray(), const QByteArray &value = QByteArray());
QNetworkCookie(const QNetworkCookie &other);
~QNetworkCookie();
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkCookie &operator=(QNetworkCookie &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkCookie &operator=(QNetworkCookie &&other) noexcept { swap(other); return *this; }
QNetworkCookie &operator=(const QNetworkCookie &other);
- void swap(QNetworkCookie &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkCookie &other) noexcept { qSwap(d, other.d); }
bool operator==(const QNetworkCookie &other) const;
inline bool operator!=(const QNetworkCookie &other) const
diff --git a/src/network/access/qnetworkdiskcache_p.h b/src/network/access/qnetworkdiskcache_p.h
index f7988e7dda..c797e63830 100644
--- a/src/network/access/qnetworkdiskcache_p.h
+++ b/src/network/access/qnetworkdiskcache_p.h
@@ -67,7 +67,7 @@ class QFile;
class QCacheItem
{
public:
- QCacheItem() : file(0)
+ QCacheItem() : file(nullptr)
{
}
~QCacheItem()
@@ -85,7 +85,7 @@ public:
metaData = QNetworkCacheMetaData();
data.close();
delete file;
- file = 0;
+ file = nullptr;
}
void writeHeader(QFile *device) const;
void writeCompressedData(QFile *device) const;
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index aca9cb1c08..fb30bfd4f1 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -687,7 +687,7 @@ QVariant QNetworkReply::attribute(QNetworkRequest::Attribute code) const
return d_func()->attributes.value(code);
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
/*!
Returns the SSL configuration and state associated with this
reply, if SSL was used. It will contain the remote server's
@@ -742,7 +742,6 @@ void QNetworkReply::ignoreSslErrors(const QList<QSslError> &errors)
{
ignoreSslErrorsImplementation(errors);
}
-#endif
/*!
\fn void QNetworkReply::sslConfigurationImplementation(QSslConfiguration &configuration) const
@@ -786,6 +785,8 @@ void QNetworkReply::ignoreSslErrorsImplementation(const QList<QSslError> &)
{
}
+#endif // QT_CONFIG(ssl)
+
/*!
If this function is called, SSL errors related to network
connection will be ignored, including certificate validation
diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h
index 63c2752caf..4a402daa91 100644
--- a/src/network/access/qnetworkreply.h
+++ b/src/network/access/qnetworkreply.h
@@ -143,7 +143,7 @@ public:
// attributes
QVariant attribute(QNetworkRequest::Attribute code) const;
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
QSslConfiguration sslConfiguration() const;
void setSslConfiguration(const QSslConfiguration &configuration);
void ignoreSslErrors(const QList<QSslError> &errors);
@@ -157,7 +157,7 @@ Q_SIGNALS:
void metaDataChanged();
void finished();
void error(QNetworkReply::NetworkError);
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void encrypted();
void sslErrors(const QList<QSslError> &errors);
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator);
@@ -182,9 +182,11 @@ protected:
void setRawHeader(const QByteArray &headerName, const QByteArray &value);
void setAttribute(QNetworkRequest::Attribute code, const QVariant &value);
+#if QT_CONFIG(ssl)
virtual void sslConfigurationImplementation(QSslConfiguration &) const;
virtual void setSslConfigurationImplementation(const QSslConfiguration &);
virtual void ignoreSslErrorsImplementation(const QList<QSslError> &);
+#endif
private:
Q_DECLARE_PRIVATE(QNetworkReply)
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index 489c489e5c..8ac81d1780 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -59,6 +59,7 @@
#include <QtCore/private/qthread_p.h>
#include "qnetworkcookiejar.h"
+#include "qnetconmonitor_p.h"
#include <string.h> // for strchr
@@ -166,6 +167,11 @@ static QHash<QByteArray, QByteArray> parseHttpOptionHeader(const QByteArray &hea
#if QT_CONFIG(bearermanagement)
static bool isSessionNeeded(const QUrl &url)
{
+ if (QNetworkStatusMonitor::isEnabled()) {
+ // In case QNetworkStatus/QNetConManager are in business,
+ // no session, no bearer manager are involved.
+ return false;
+ }
// Connections to the local machine does not require a session
QString host = url.host().toLower();
return !QHostAddress(host).isLoopback() && host != QLatin1String("localhost")
@@ -792,12 +798,11 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
// Create the HTTP thread delegate
QHttpThreadDelegate *delegate = new QHttpThreadDelegate;
- // Propagate Http/2 settings if any
- const QVariant blob(manager->property(Http2::http2ParametersPropertyName));
- if (blob.isValid() && blob.canConvert<Http2::ProtocolParameters>())
- delegate->http2Parameters = blob.value<Http2::ProtocolParameters>();
+ // Propagate Http/2 settings:
+ delegate->http2Parameters = request.http2Configuration();
#ifndef QT_NO_BEARERMANAGEMENT
- delegate->networkSession = managerPrivate->getNetworkSession();
+ if (!QNetworkStatusMonitor::isEnabled())
+ delegate->networkSession = managerPrivate->getNetworkSession();
#endif
// For the synchronous HTTP, this is the normal way the delegate gets deleted
@@ -1048,59 +1053,39 @@ void QNetworkReplyHttpImplPrivate::replyDownloadData(QByteArray d)
if (!q->isOpen())
return;
- int pendingSignals = (int)pendingDownloadDataEmissions->fetchAndAddAcquire(-1) - 1;
+ if (cacheEnabled && isCachingAllowed() && !cacheSaveDevice)
+ initCacheSaveDevice();
+
+ // This is going to look a little strange. When downloading data while a
+ // HTTP redirect is happening (and enabled), we write the redirect
+ // response to the cache. However, we do not append it to our internal
+ // buffer as that will contain the response data only for the final
+ // response
+ if (cacheSaveDevice)
+ cacheSaveDevice->write(d);
+ if (!isHttpRedirectResponse()) {
+ buffer.append(d);
+ bytesDownloaded += d.size();
+ }
+ bytesBuffered += d.size();
+
+ int pendingSignals = pendingDownloadDataEmissions->fetchAndSubAcquire(1) - 1;
if (pendingSignals > 0) {
// Some more signal emissions to this slot are pending.
// Instead of writing the downstream data, we wait
// and do it in the next call we get
// (signal comppression)
- pendingDownloadData.append(d);
return;
}
- pendingDownloadData.append(d);
- d.clear();
- // We need to usa a copy for calling writeDownstreamData as we could
- // possibly recurse into this this function when we call
- // appendDownstreamDataSignalEmissions because the user might call
- // processEvents() or spin an event loop when this occur.
- QByteDataBuffer pendingDownloadDataCopy = pendingDownloadData;
- pendingDownloadData.clear();
-
- if (cacheEnabled && isCachingAllowed() && !cacheSaveDevice) {
- initCacheSaveDevice();
- }
-
- qint64 bytesWritten = 0;
- for (int i = 0; i < pendingDownloadDataCopy.bufferCount(); i++) {
- QByteArray const &item = pendingDownloadDataCopy[i];
-
- // This is going to look a little strange. When downloading data while a
- // HTTP redirect is happening (and enabled), we write the redirect
- // response to the cache. However, we do not append it to our internal
- // buffer as that will contain the response data only for the final
- // response
- if (cacheSaveDevice)
- cacheSaveDevice->write(item.constData(), item.size());
-
- if (!isHttpRedirectResponse())
- buffer.append(item);
-
- bytesWritten += item.size();
- }
- bytesBuffered += bytesWritten;
- pendingDownloadDataCopy.clear();
+ if (isHttpRedirectResponse())
+ return;
QVariant totalSize = cookedHeaders.value(QNetworkRequest::ContentLengthHeader);
if (preMigrationDownloaded != Q_INT64_C(-1))
totalSize = totalSize.toLongLong() + preMigrationDownloaded;
- if (isHttpRedirectResponse())
- return;
-
- bytesDownloaded += bytesWritten;
-
emit q->readyRead();
// emit readyRead before downloadProgress incase this will cause events to be
// processed and we get into a recursive call (as in QProgressDialog).
@@ -1808,7 +1793,7 @@ bool QNetworkReplyHttpImplPrivate::start(const QNetworkRequest &newHttpRequest)
{
#ifndef QT_NO_BEARERMANAGEMENT
QSharedPointer<QNetworkSession> networkSession(managerPrivate->getNetworkSession());
- if (!networkSession) {
+ if (!networkSession || QNetworkStatusMonitor::isEnabled()) {
#endif
postRequest(newHttpRequest);
return true;
@@ -1896,7 +1881,7 @@ void QNetworkReplyHttpImplPrivate::_q_startOperation()
// state changes.
if (!startWaitForSession(session))
return;
- } else if (session) {
+ } else if (session && !QNetworkStatusMonitor::isEnabled()) {
QObject::connect(session.data(), SIGNAL(stateChanged(QNetworkSession::State)),
q, SLOT(_q_networkSessionStateChanged(QNetworkSession::State)),
Qt::QueuedConnection);
@@ -2185,7 +2170,7 @@ void QNetworkReplyHttpImplPrivate::finished()
#ifndef QT_NO_BEARERMANAGEMENT
Q_ASSERT(managerPrivate);
QSharedPointer<QNetworkSession> session = managerPrivate->getNetworkSession();
- if (session && session->state() == QNetworkSession::Roaming &&
+ if (!QNetworkStatusMonitor::isEnabled() && session && session->state() == QNetworkSession::Roaming &&
state == Working && errorCode != QNetworkReply::OperationCanceledError) {
// only content with a known size will fail with a temporary network failure error
if (!totalSize.isNull()) {
diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h
index f5f01d0811..ef69ce0653 100644
--- a/src/network/access/qnetworkreplyhttpimpl_p.h
+++ b/src/network/access/qnetworkreplyhttpimpl_p.h
@@ -63,7 +63,6 @@
#include <QtNetwork/QNetworkCacheMetaData>
#include <private/qhttpnetworkrequest_p.h>
-#include <private/qbytedata_p.h>
#include <private/qnetworkreply_p.h>
#include <QtNetwork/QNetworkProxy>
#include <QtNetwork/QNetworkSession>
@@ -248,7 +247,6 @@ public:
quint64 resumeOffset;
qint64 preMigrationDownloaded;
- QByteDataBuffer pendingDownloadData; // For signal compression
qint64 bytesDownloaded;
qint64 bytesBuffered;
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index a794b492e7..6eab500e8c 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -158,7 +158,7 @@ void QNetworkReplyImplPrivate::_q_startOperation()
} else {
if (state != Finished) {
if (operation == QNetworkAccessManager::GetOperation)
- pendingNotifications.append(NotifyDownstreamReadyWrite);
+ pendingNotifications.push_back(NotifyDownstreamReadyWrite);
handleNotifications();
}
@@ -368,6 +368,7 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const
outgoingData = data;
request = req;
+ originalRequest = req;
url = request.url();
operation = op;
@@ -432,8 +433,9 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const
void QNetworkReplyImplPrivate::backendNotify(InternalNotifications notification)
{
Q_Q(QNetworkReplyImpl);
- if (!pendingNotifications.contains(notification))
- pendingNotifications.enqueue(notification);
+ const auto it = std::find(pendingNotifications.cbegin(), pendingNotifications.cend(), notification);
+ if (it == pendingNotifications.cend())
+ pendingNotifications.push_back(notification);
if (pendingNotifications.size() == 1)
QCoreApplication::postEvent(q, new QEvent(QEvent::NetworkReplyUpdated));
@@ -444,14 +446,9 @@ void QNetworkReplyImplPrivate::handleNotifications()
if (notificationHandlingPaused)
return;
- NotificationQueue current = pendingNotifications;
- pendingNotifications.clear();
-
- if (state != Working)
- return;
-
- while (state == Working && !current.isEmpty()) {
- InternalNotifications notification = current.dequeue();
+ for (InternalNotifications notification : qExchange(pendingNotifications, {})) {
+ if (state != Working)
+ return;
switch (notification) {
case NotifyDownstreamReadyWrite:
if (copyDevice)
@@ -465,8 +462,7 @@ void QNetworkReplyImplPrivate::handleNotifications()
break;
case NotifyCopyFinished: {
- QIODevice *dev = copyDevice;
- copyDevice = 0;
+ QIODevice *dev = qExchange(copyDevice, nullptr);
backend->copyFinished(dev);
break;
}
@@ -1116,7 +1112,6 @@ bool QNetworkReplyImplPrivate::migrateBackend()
return true;
}
-#ifndef QT_NO_BEARERMANAGEMENT
QDisabledNetworkReply::QDisabledNetworkReply(QObject *parent,
const QNetworkRequest &req,
QNetworkAccessManager::Operation op)
@@ -1141,7 +1136,6 @@ QDisabledNetworkReply::QDisabledNetworkReply(QObject *parent,
QDisabledNetworkReply::~QDisabledNetworkReply()
{
}
-#endif
QT_END_NAMESPACE
diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h
index f4e8284ab6..8cec79541a 100644
--- a/src/network/access/qnetworkreplyimpl_p.h
+++ b/src/network/access/qnetworkreplyimpl_p.h
@@ -74,7 +74,7 @@ class QNetworkReplyImpl: public QNetworkReply
{
Q_OBJECT
public:
- QNetworkReplyImpl(QObject *parent = 0);
+ QNetworkReplyImpl(QObject *parent = nullptr);
~QNetworkReplyImpl();
virtual void abort() override;
@@ -117,8 +117,6 @@ public:
NotifyCopyFinished
};
- typedef QQueue<InternalNotifications> NotificationQueue;
-
QNetworkReplyImplPrivate();
void _q_startOperation();
@@ -178,7 +176,7 @@ public:
bool cacheEnabled;
QIODevice *cacheSaveDevice;
- NotificationQueue pendingNotifications;
+ std::vector<InternalNotifications> pendingNotifications;
bool notificationHandlingPaused;
QUrl urlForLastAuthentication;
@@ -209,7 +207,6 @@ public:
};
Q_DECLARE_TYPEINFO(QNetworkReplyImplPrivate::InternalNotifications, Q_PRIMITIVE_TYPE);
-#ifndef QT_NO_BEARERMANAGEMENT
class QDisabledNetworkReply : public QNetworkReply
{
Q_OBJECT
@@ -223,7 +220,6 @@ public:
protected:
qint64 readData(char *, qint64) override { return -1; }
};
-#endif
QT_END_NAMESPACE
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index f15c43cdd8..118fb6b1fb 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -42,6 +42,10 @@
#include "qplatformdefs.h"
#include "qnetworkcookie.h"
#include "qsslconfiguration.h"
+#if QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+#include "qhttp2configuration.h"
+#include "private/http2protocol_p.h"
+#endif
#include "QtCore/qshareddata.h"
#include "QtCore/qlocale.h"
#include "QtCore/qdatetime.h"
@@ -331,6 +335,12 @@ QT_BEGIN_NAMESPACE
\omitvalue ResourceTypeAttribute
+ \value AutoDeleteReplyOnFinishAttribute
+ Requests only, type: QMetaType::Bool (default: false)
+ If set, this attribute will make QNetworkAccessManager delete
+ the QNetworkReply after having emitted "finished".
+ (This value was introduced in 5.14.)
+
\value User
Special type. Additional information can be passed in
QVariants with types ranging from User to UserMax. The default
@@ -439,6 +449,9 @@ public:
sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
#endif
peerVerifyName = other.peerVerifyName;
+#if QT_CONFIG(http)
+ h2Configuration = other.h2Configuration;
+#endif
}
inline bool operator==(const QNetworkRequestPrivate &other) const
@@ -448,7 +461,11 @@ public:
rawHeaders == other.rawHeaders &&
attributes == other.attributes &&
maxRedirectsAllowed == other.maxRedirectsAllowed &&
- peerVerifyName == other.peerVerifyName;
+ peerVerifyName == other.peerVerifyName
+#if QT_CONFIG(http)
+ && h2Configuration == other.h2Configuration
+#endif
+ ;
// don't compare cookedHeaders
}
@@ -459,16 +476,39 @@ public:
#endif
int maxRedirectsAllowed;
QString peerVerifyName;
+#if QT_CONFIG(http)
+ QHttp2Configuration h2Configuration;
+#endif
};
/*!
+ Constructs a QNetworkRequest object with no URL to be requested.
+ Use setUrl() to set one.
+
+ \sa url(), setUrl()
+*/
+QNetworkRequest::QNetworkRequest()
+ : d(new QNetworkRequestPrivate)
+{
+#if QT_CONFIG(http)
+ // Initial values proposed by RFC 7540 are quite draconian,
+ // so unless an application will set its own parameters, we
+ // make stream window size larger and increase (via WINDOW_UPDATE)
+ // the session window size. These are our 'defaults':
+ d->h2Configuration.setStreamReceiveWindowSize(Http2::qtDefaultStreamReceiveWindowSize);
+ d->h2Configuration.setSessionReceiveWindowSize(Http2::maxSessionReceiveWindowSize);
+ d->h2Configuration.setServerPushEnabled(false);
+#endif // QT_CONFIG(http)
+}
+
+/*!
Constructs a QNetworkRequest object with \a url as the URL to be
requested.
\sa url(), setUrl()
*/
QNetworkRequest::QNetworkRequest(const QUrl &url)
- : d(new QNetworkRequestPrivate)
+ : QNetworkRequest()
{
d->url = url;
}
@@ -818,6 +858,52 @@ void QNetworkRequest::setPeerVerifyName(const QString &peerName)
d->peerVerifyName = peerName;
}
+#if QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+/*!
+ \since 5.14
+
+ Returns the current parameters that QNetworkAccessManager is
+ using for this request and its underlying HTTP/2 connection.
+ This is either a configuration previously set by an application
+ or a default configuration.
+
+ The default values that QNetworkAccessManager is using are:
+
+ \list
+ \li Window size for connection-level flowcontrol is 2147483647 octets
+ \li Window size for stream-level flowcontrol is 21474836 octets
+ \li Max frame size is 16384
+ \endlist
+
+ By default, server push is disabled, Huffman compression and
+ string indexing are enabled.
+
+ \sa setHttp2Configuration
+*/
+QHttp2Configuration QNetworkRequest::http2Configuration() const
+{
+ return d->h2Configuration;
+}
+
+/*!
+ \since 5.14
+
+ Sets request's HTTP/2 parameters from \a configuration.
+
+ \note The configuration must be set prior to making a request.
+ \note HTTP/2 multiplexes several streams in a single HTTP/2
+ connection. This implies that QNetworkAccessManager will use
+ the configuration found in the first request from a series
+ of requests sent to the same host.
+
+ \sa http2Configuration, QNetworkAccessManager, QHttp2Configuration
+*/
+void QNetworkRequest::setHttp2Configuration(const QHttp2Configuration &configuration)
+{
+ d->h2Configuration = configuration;
+}
+#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+
static QByteArray headerName(QNetworkRequest::KnownHeaders header)
{
switch (header) {
@@ -1338,7 +1424,7 @@ QDateTime QNetworkHeadersPrivate::fromHttpDate(const QByteArray &value)
QByteArray QNetworkHeadersPrivate::toHttpDate(const QDateTime &dt)
{
- return QLocale::c().toString(dt, QLatin1String("ddd, dd MMM yyyy hh:mm:ss 'GMT'"))
+ return QLocale::c().toString(dt, u"ddd, dd MMM yyyy hh:mm:ss 'GMT'")
.toLatin1();
}
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index efb9cbecba..e09ff8aaae 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
class QSslConfiguration;
+class QHttp2Configuration;
class QNetworkRequestPrivate;
class Q_NETWORK_EXPORT QNetworkRequest
@@ -98,6 +99,7 @@ public:
RedirectPolicyAttribute,
Http2DirectAttribute,
ResourceTypeAttribute, // internal
+ AutoDeleteReplyOnFinishAttribute,
User = 1000,
UserMax = 32767
@@ -127,15 +129,14 @@ public:
};
- explicit QNetworkRequest(const QUrl &url = QUrl());
+ QNetworkRequest();
+ explicit QNetworkRequest(const QUrl &url);
QNetworkRequest(const QNetworkRequest &other);
~QNetworkRequest();
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkRequest &operator=(QNetworkRequest &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkRequest &operator=(QNetworkRequest &&other) noexcept { swap(other); return *this; }
QNetworkRequest &operator=(const QNetworkRequest &other);
- void swap(QNetworkRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkRequest &other) noexcept { qSwap(d, other.d); }
bool operator==(const QNetworkRequest &other) const;
inline bool operator!=(const QNetworkRequest &other) const
@@ -175,6 +176,10 @@ public:
QString peerVerifyName() const;
void setPeerVerifyName(const QString &peerName);
+#if QT_CONFIG(http) || defined(Q_CLANG_QDOC)
+ QHttp2Configuration http2Configuration() const;
+ void setHttp2Configuration(const QHttp2Configuration &configuration);
+#endif // QT_CONFIG(http) || defined(Q_CLANG_QDOC)
private:
QSharedDataPointer<QNetworkRequestPrivate> d;
friend class QNetworkRequestPrivate;
diff --git a/src/network/access/qspdyprotocolhandler.cpp b/src/network/access/qspdyprotocolhandler.cpp
index 403c01e974..f845235bf7 100644
--- a/src/network/access/qspdyprotocolhandler.cpp
+++ b/src/network/access/qspdyprotocolhandler.cpp
@@ -305,7 +305,7 @@ bool QSpdyProtocolHandler::sendRequest()
currentReply->setSpdyWasUsed(true);
qint32 streamID = generateNextStreamID();
- currentReply->setProperty("SPDYStreamID", streamID);
+ m_streamIDs.insert(currentReply, streamID);
currentReply->setRequest(currentRequest);
currentReply->d_func()->connection = m_connection;
@@ -322,7 +322,7 @@ bool QSpdyProtocolHandler::sendRequest()
void QSpdyProtocolHandler::_q_replyDestroyed(QObject* reply)
{
- qint32 streamID = reply->property("SPDYStreamID").toInt();
+ qint32 streamID = m_streamIDs.take(reply);
if (m_inFlightStreams.remove(streamID))
sendRST_STREAM(streamID, RST_STREAM_CANCEL);
}
@@ -624,10 +624,12 @@ void QSpdyProtocolHandler::sendSYN_STREAM(const HttpMessagePair &messagePair,
// hack: set the stream ID on the device directly, so when we get
// the signal for uploading we know which stream we are sending on
- request.uploadByteDevice()->setProperty("SPDYStreamID", streamID);
+ m_streamIDs.insert(request.uploadByteDevice(), streamID);
QObject::connect(request.uploadByteDevice(), SIGNAL(readyRead()), this,
SLOT(_q_uploadDataReadyRead()), Qt::QueuedConnection);
+ QObject::connect(request.uploadByteDevice(), SIGNAL(destroyed(QObject*)), this,
+ SLOT(_q_uploadDataDestroyed(QObject *)));
}
QByteArray namesAndValues = composeHeader(request);
@@ -663,6 +665,11 @@ void QSpdyProtocolHandler::sendSYN_STREAM(const HttpMessagePair &messagePair,
uploadData(streamID);
}
+void QSpdyProtocolHandler::_q_uploadDataDestroyed(QObject *uploadData)
+{
+ m_streamIDs.remove(uploadData);
+}
+
void QSpdyProtocolHandler::sendRST_STREAM(qint32 streamID, RST_STREAM_STATUS_CODE statusCode)
{
char wireData[8];
@@ -756,7 +763,7 @@ void QSpdyProtocolHandler::_q_uploadDataReadyRead()
{
QNonContiguousByteDevice *device = qobject_cast<QNonContiguousByteDevice *>(sender());
Q_ASSERT(device);
- qint32 streamID = device->property("SPDYStreamID").toInt();
+ qint32 streamID = m_streamIDs.value(device);
Q_ASSERT(streamID > 0);
uploadData(streamID);
}
diff --git a/src/network/access/qspdyprotocolhandler_p.h b/src/network/access/qspdyprotocolhandler_p.h
index dd93a9aba2..14e2ff388a 100644
--- a/src/network/access/qspdyprotocolhandler_p.h
+++ b/src/network/access/qspdyprotocolhandler_p.h
@@ -110,6 +110,7 @@ public:
private slots:
void _q_uploadDataReadyRead();
void _q_replyDestroyed(QObject*);
+ void _q_uploadDataDestroyed(QObject *);
private:
@@ -216,6 +217,7 @@ private:
bool m_waitingForCompleteStream;
z_stream m_deflateStream;
z_stream m_inflateStream;
+ QHash<QObject *, qint32> m_streamIDs;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QSpdyProtocolHandler::DataFrameFlags)
diff --git a/src/network/bearer/qbearerengine.cpp b/src/network/bearer/qbearerengine.cpp
index 677da08cb6..06bf449611 100644
--- a/src/network/bearer/qbearerengine.cpp
+++ b/src/network/bearer/qbearerengine.cpp
@@ -38,6 +38,8 @@
****************************************************************************/
#include "qbearerengine_p.h"
+#include <QtCore/private/qlocking_p.h>
+
#include <algorithm>
#ifndef QT_NO_BEARERMANAGEMENT
@@ -46,24 +48,23 @@ QT_BEGIN_NAMESPACE
static void cleanUpConfigurations(QHash<QString, QNetworkConfigurationPrivatePointer> &configurations)
{
- for (const auto &ptr : qAsConst(configurations)) {
+ for (auto &ptr : qExchange(configurations, {})) {
ptr->isValid = false;
ptr->id.clear();
}
- configurations.clear();
}
static bool hasUsedConfiguration(const QHash<QString, QNetworkConfigurationPrivatePointer> &configurations)
{
auto isUsed = [](const QNetworkConfigurationPrivatePointer &ptr) {
- return ptr->ref.load() > 1;
+ return ptr->ref.loadRelaxed() > 1;
};
const auto end = configurations.end();
return std::find_if(configurations.begin(), end, isUsed) != end;
}
QBearerEngine::QBearerEngine(QObject *parent)
- : QObject(parent), mutex(QMutex::Recursive)
+ : QObject(parent)
{
}
@@ -87,7 +88,7 @@ bool QBearerEngine::requiresPolling() const
*/
bool QBearerEngine::configurationsInUse() const
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
return hasUsedConfiguration(accessPointConfigurations)
|| hasUsedConfiguration(snapConfigurations)
|| hasUsedConfiguration(userChoiceConfigurations);
diff --git a/src/network/bearer/qbearerengine_p.h b/src/network/bearer/qbearerengine_p.h
index 5fc2578a78..c69f478b26 100644
--- a/src/network/bearer/qbearerengine_p.h
+++ b/src/network/bearer/qbearerengine_p.h
@@ -77,7 +77,7 @@ class Q_NETWORK_EXPORT QBearerEngine : public QObject
friend class QNetworkConfigurationManagerPrivate;
public:
- explicit QBearerEngine(QObject *parent = 0);
+ explicit QBearerEngine(QObject *parent = nullptr);
virtual ~QBearerEngine();
virtual bool hasIdentifier(const QString &id) = 0;
@@ -105,7 +105,7 @@ protected:
QHash<QString, QNetworkConfigurationPrivatePointer> snapConfigurations;
QHash<QString, QNetworkConfigurationPrivatePointer> userChoiceConfigurations;
- mutable QMutex mutex;
+ mutable QRecursiveMutex mutex;
};
QT_END_NAMESPACE
diff --git a/src/network/bearer/qbearerplugin_p.h b/src/network/bearer/qbearerplugin_p.h
index 0cdde3c06c..ac787d0541 100644
--- a/src/network/bearer/qbearerplugin_p.h
+++ b/src/network/bearer/qbearerplugin_p.h
@@ -68,7 +68,7 @@ class Q_NETWORK_EXPORT QBearerEnginePlugin : public QObject
{
Q_OBJECT
public:
- explicit QBearerEnginePlugin(QObject *parent = 0);
+ explicit QBearerEnginePlugin(QObject *parent = nullptr);
virtual ~QBearerEnginePlugin();
virtual QBearerEngine *create(const QString &key) const = 0;
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index a903ecda5f..b432444669 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -45,6 +45,7 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qthread.h>
#include <QtCore/private/qcoreapplication_p.h>
+#include <QtCore/private/qlocking_p.h>
#include <QtCore/private/qthread_p.h>
#include <QtCore/qbytearray.h>
@@ -58,7 +59,7 @@
QT_BEGIN_NAMESPACE
QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
- : QObject(), pollTimer(0), mutex(QMutex::Recursive),
+ : QObject(), pollTimer(0),
loader(QBearerEngineFactoryInterface_iid, QLatin1String("/bearer")),
forcedPolling(0), firstUpdate(true)
{
@@ -115,10 +116,10 @@ QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration(
QNetworkConfigurationPrivatePointer defaultConfiguration;
for (QBearerEngine *engine : sessionEngines) {
- QMutexLocker locker(&engine->mutex);
+ const auto locker = qt_scoped_lock(engine->mutex);
for (const auto &ptr : qAsConst(engine->snapConfigurations)) {
- QMutexLocker configLocker(&ptr->mutex);
+ const auto locker = qt_scoped_lock(ptr->mutex);
if ((ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
QNetworkConfiguration config;
@@ -211,11 +212,11 @@ QList<QNetworkConfiguration> QNetworkConfigurationManagerPrivate::allConfigurati
for (QBearerEngine *engine : sessionEngines) {
- QMutexLocker locker(&engine->mutex);
+ const auto locker = qt_scoped_lock(engine->mutex);
//find all InternetAccessPoints
for (const auto &ptr : qAsConst(engine->accessPointConfigurations)) {
- QMutexLocker configLocker(&ptr->mutex);
+ const auto locker = qt_scoped_lock(ptr->mutex);
if ((ptr->state & filter) == filter) {
QNetworkConfiguration pt;
@@ -226,7 +227,7 @@ QList<QNetworkConfiguration> QNetworkConfigurationManagerPrivate::allConfigurati
//find all service networks
for (const auto &ptr : qAsConst(engine->snapConfigurations)) {
- QMutexLocker configLocker(&ptr->mutex);
+ const auto locker = qt_scoped_lock(ptr->mutex);
if ((ptr->state & filter) == filter) {
QNetworkConfiguration pt;
@@ -243,10 +244,10 @@ QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIden
{
QNetworkConfiguration item;
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
for (QBearerEngine *engine : sessionEngines) {
- QMutexLocker locker(&engine->mutex);
+ const auto locker = qt_scoped_lock(engine->mutex);
if (auto ptr = engine->accessPointConfigurations.value(identifier)) {
item.d = std::move(ptr);
break;
@@ -266,7 +267,7 @@ QNetworkConfiguration QNetworkConfigurationManagerPrivate::configurationFromIden
bool QNetworkConfigurationManagerPrivate::isOnline() const
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
// We need allConfigurations since onlineConfigurations is filled with queued connections
// and thus is not always (more importantly just after creation) up to date
@@ -275,7 +276,7 @@ bool QNetworkConfigurationManagerPrivate::isOnline() const
QNetworkConfigurationManager::Capabilities QNetworkConfigurationManagerPrivate::capabilities() const
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QNetworkConfigurationManager::Capabilities capFlags;
@@ -287,7 +288,7 @@ QNetworkConfigurationManager::Capabilities QNetworkConfigurationManagerPrivate::
void QNetworkConfigurationManagerPrivate::configurationAdded(QNetworkConfigurationPrivatePointer ptr)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (!firstUpdate) {
QNetworkConfiguration item;
@@ -295,24 +296,24 @@ void QNetworkConfigurationManagerPrivate::configurationAdded(QNetworkConfigurati
emit configurationAdded(item);
}
- ptr->mutex.lock();
+ auto ptrLocker = qt_unique_lock(ptr->mutex);
if (ptr->state == QNetworkConfiguration::Active) {
- ptr->mutex.unlock();
- onlineConfigurations.insert(ptr->id);
+ const auto id = ptr->id;
+ ptrLocker.unlock();
+ onlineConfigurations.insert(id);
if (!firstUpdate && onlineConfigurations.count() == 1)
emit onlineStateChanged(true);
- } else {
- ptr->mutex.unlock();
}
}
void QNetworkConfigurationManagerPrivate::configurationRemoved(QNetworkConfigurationPrivatePointer ptr)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
- ptr->mutex.lock();
- ptr->isValid = false;
- ptr->mutex.unlock();
+ {
+ const auto locker = qt_scoped_lock(ptr->mutex);
+ ptr->isValid = false;
+ }
if (!firstUpdate) {
QNetworkConfiguration item;
@@ -327,7 +328,7 @@ void QNetworkConfigurationManagerPrivate::configurationRemoved(QNetworkConfigura
void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigurationPrivatePointer ptr)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (!firstUpdate) {
QNetworkConfiguration item;
@@ -337,12 +338,13 @@ void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigura
bool previous = !onlineConfigurations.isEmpty();
- ptr->mutex.lock();
- if (ptr->state == QNetworkConfiguration::Active)
- onlineConfigurations.insert(ptr->id);
- else
- onlineConfigurations.remove(ptr->id);
- ptr->mutex.unlock();
+ {
+ const auto locker = qt_scoped_lock(ptr->mutex);
+ if (ptr->state == QNetworkConfiguration::Active)
+ onlineConfigurations.insert(ptr->id);
+ else
+ onlineConfigurations.remove(ptr->id);
+ }
bool online = !onlineConfigurations.isEmpty();
@@ -354,7 +356,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
{
typedef QMultiMap<int, QString> PluginKeyMap;
typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator;
- QMutexLocker locker(&mutex);
+
+ auto locker = qt_unique_lock(mutex);
if (firstUpdate) {
if (qobject_cast<QBearerEngine *>(sender()))
@@ -432,7 +435,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (sessionEngines.isEmpty()) {
emit configurationUpdateComplete();
@@ -449,14 +452,14 @@ void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()
QList<QBearerEngine *> QNetworkConfigurationManagerPrivate::engines() const
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
return sessionEngines;
}
void QNetworkConfigurationManagerPrivate::startPolling()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (!pollTimer) {
pollTimer = new QTimer(this);
bool ok;
@@ -482,7 +485,7 @@ void QNetworkConfigurationManagerPrivate::startPolling()
void QNetworkConfigurationManagerPrivate::pollEngines()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
for (QBearerEngine *engine : qAsConst(sessionEngines)) {
if (engine->requiresPolling() && (forcedPolling || engine->configurationsInUse())) {
@@ -494,7 +497,7 @@ void QNetworkConfigurationManagerPrivate::pollEngines()
void QNetworkConfigurationManagerPrivate::enablePolling()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
++forcedPolling;
@@ -504,7 +507,7 @@ void QNetworkConfigurationManagerPrivate::enablePolling()
void QNetworkConfigurationManagerPrivate::disablePolling()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
--forcedPolling;
}
diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h
index 380e25c22f..4819c2027c 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.h
+++ b/src/network/bearer/qnetworkconfigmanager_p.h
@@ -117,7 +117,7 @@ private:
QThread *bearerThread;
private:
- mutable QMutex mutex;
+ mutable QRecursiveMutex mutex;
QFactoryLoader loader;
QList<QBearerEngine *> sessionEngines;
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp
index f5ced0693a..19bc44e02a 100644
--- a/src/network/bearer/qnetworkconfiguration.cpp
+++ b/src/network/bearer/qnetworkconfiguration.cpp
@@ -414,34 +414,7 @@ bool QNetworkConfiguration::isRoamingAvailable() const
*/
QList<QNetworkConfiguration> QNetworkConfiguration::children() const
{
- QList<QNetworkConfiguration> results;
-
- if (!d)
- return results;
-
- QMutexLocker locker(&d->mutex);
-
- if (d->type != QNetworkConfiguration::ServiceNetwork || !d->isValid)
- return results;
-
- for (auto it = d->serviceNetworkMembers.begin(), end = d->serviceNetworkMembers.end(); it != end;) {
- QNetworkConfigurationPrivatePointer p = it.value();
- //if we have an invalid member get rid of it -> was deleted earlier on
- {
- QMutexLocker childLocker(&p->mutex);
-
- if (!p->isValid) {
- it = d->serviceNetworkMembers.erase(it);
- continue;
- }
- }
- QNetworkConfiguration item;
- item.d = p;
- results << item;
- ++it;
- }
-
- return results;
+ return {};
}
/*!
diff --git a/src/network/bearer/qnetworkconfiguration.h b/src/network/bearer/qnetworkconfiguration.h
index e7b74034fc..048abc2fc8 100644
--- a/src/network/bearer/qnetworkconfiguration.h
+++ b/src/network/bearer/qnetworkconfiguration.h
@@ -55,13 +55,11 @@ class Q_NETWORK_EXPORT QNetworkConfiguration
public:
QNetworkConfiguration();
QNetworkConfiguration(const QNetworkConfiguration& other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkConfiguration &operator=(QNetworkConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkConfiguration &operator=(QNetworkConfiguration &&other) noexcept { swap(other); return *this; }
QNetworkConfiguration &operator=(const QNetworkConfiguration &other);
~QNetworkConfiguration();
- void swap(QNetworkConfiguration &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkConfiguration &other) noexcept { qSwap(d, other.d); }
bool operator==(const QNetworkConfiguration &other) const;
inline bool operator!=(const QNetworkConfiguration &other) const
diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h
index 1b1ece39b7..96854fe831 100644
--- a/src/network/bearer/qnetworkconfiguration_p.h
+++ b/src/network/bearer/qnetworkconfiguration_p.h
@@ -65,22 +65,14 @@ class QNetworkConfigurationPrivate : public QSharedData
{
public:
QNetworkConfigurationPrivate() :
- mutex(QMutex::Recursive),
type(QNetworkConfiguration::Invalid),
purpose(QNetworkConfiguration::UnknownPurpose),
bearerType(QNetworkConfiguration::BearerUnknown),
isValid(false), roamingSupported(false),
timeout(DefaultTimeout)
{}
- virtual ~QNetworkConfigurationPrivate()
- {
- //release pointers to member configurations
- serviceNetworkMembers.clear();
- }
- QMap<unsigned int, QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
-
- mutable QMutex mutex;
+ mutable QRecursiveMutex mutex;
QString name;
QString id;
diff --git a/src/network/bearer/qnetworksession_p.h b/src/network/bearer/qnetworksession_p.h
index 661587603c..7c1ff63b68 100644
--- a/src/network/bearer/qnetworksession_p.h
+++ b/src/network/bearer/qnetworksession_p.h
@@ -68,7 +68,7 @@ class Q_NETWORK_EXPORT QNetworkSessionPrivate : public QObject
public:
QNetworkSessionPrivate() : QObject(),
- state(QNetworkSession::Invalid), isOpen(false), mutex(QMutex::Recursive)
+ state(QNetworkSession::Invalid), isOpen(false)
{}
virtual ~QNetworkSessionPrivate()
{}
@@ -147,7 +147,7 @@ protected:
QNetworkSession::State state;
bool isOpen;
- QMutex mutex;
+ QRecursiveMutex mutex;
};
QT_END_NAMESPACE
diff --git a/src/network/bearer/qsharednetworksession.cpp b/src/network/bearer/qsharednetworksession.cpp
index fc01acb8b4..b3e9892f4b 100644
--- a/src/network/bearer/qsharednetworksession.cpp
+++ b/src/network/bearer/qsharednetworksession.cpp
@@ -57,36 +57,44 @@ inline QSharedNetworkSessionManager* sharedNetworkSessionManager()
return rv;
}
-static void doDeleteLater(QObject* obj)
+struct DeleteLater {
+ void operator()(QObject* obj) const
+ {
+ obj->deleteLater();
+ }
+};
+
+template <typename Container>
+static void maybe_prune_expired(Container &c)
{
- obj->deleteLater();
+ if (c.size() > 16) {
+ for (auto it = c.cbegin(), end = c.cend(); it != end; /*erasing*/) {
+ if (!it->second.lock())
+ it = c.erase(it);
+ else
+ ++it;
+ }
+ }
}
QSharedPointer<QNetworkSession> QSharedNetworkSessionManager::getSession(const QNetworkConfiguration &config)
{
- QSharedNetworkSessionManager *m(sharedNetworkSessionManager());
- const auto it = m->sessions.constFind(config);
+ QSharedNetworkSessionManager *m = sharedNetworkSessionManager();
+ maybe_prune_expired(m->sessions);
+ auto &entry = m->sessions[config];
//if already have a session, return it
- if (it != m->sessions.cend()) {
- QSharedPointer<QNetworkSession> p = it.value().toStrongRef();
- if (!p.isNull())
- return p;
- }
+ if (auto p = entry.toStrongRef())
+ return p;
//otherwise make one
- QSharedPointer<QNetworkSession> session(new QNetworkSession(config), doDeleteLater);
- m->sessions[config] = session;
+ QSharedPointer<QNetworkSession> session(new QNetworkSession(config), DeleteLater{});
+ entry = session;
return session;
}
void QSharedNetworkSessionManager::setSession(const QNetworkConfiguration &config, QSharedPointer<QNetworkSession> session)
{
- QSharedNetworkSessionManager *m(sharedNetworkSessionManager());
- m->sessions[config] = session;
-}
-
-uint qHash(const QNetworkConfiguration& config)
-{
- return ((uint)config.type()) | (((uint)config.bearerType()) << 8) | (((uint)config.purpose()) << 16);
+ QSharedNetworkSessionManager *m = sharedNetworkSessionManager();
+ m->sessions[config] = std::move(session);
}
QT_END_NAMESPACE
diff --git a/src/network/bearer/qsharednetworksession_p.h b/src/network/bearer/qsharednetworksession_p.h
index 001b8af02a..f22f9eeacb 100644
--- a/src/network/bearer/qsharednetworksession_p.h
+++ b/src/network/bearer/qsharednetworksession_p.h
@@ -54,16 +54,26 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
#include "qnetworksession.h"
#include "qnetworkconfiguration.h"
-#include <QHash>
#include <QSharedPointer>
#include <QWeakPointer>
#include <QMutex>
+#include <unordered_map>
+
#ifndef QT_NO_BEARERMANAGEMENT
QT_BEGIN_NAMESPACE
-uint qHash(const QNetworkConfiguration& config);
+namespace QtPrivate {
+struct NetworkConfigurationHash {
+ using result_type = size_t;
+ using argument_type = QNetworkConfiguration;
+ size_t operator()(const QNetworkConfiguration &config) const noexcept
+ {
+ return std::hash<size_t>{}(size_t(config.type()) | (size_t(config.bearerType()) << 8) | (size_t(config.purpose()) << 16));
+ }
+};
+}
class QSharedNetworkSessionManager
{
@@ -71,7 +81,7 @@ public:
static QSharedPointer<QNetworkSession> getSession(const QNetworkConfiguration &config);
static void setSession(const QNetworkConfiguration &config, QSharedPointer<QNetworkSession> session);
private:
- QHash<QNetworkConfiguration, QWeakPointer<QNetworkSession> > sessions;
+ std::unordered_map<QNetworkConfiguration, QWeakPointer<QNetworkSession>, QtPrivate::NetworkConfigurationHash> sessions;
};
QT_END_NAMESPACE
diff --git a/src/network/configure.json b/src/network/configure.json
index f74c481f38..f501465c91 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -98,6 +98,30 @@
"condition": "!config.msvc"
}
]
+ },
+ "gssapi": {
+ "label": "KRB5 GSSAPI Support",
+ "test": {
+ "head": [
+ "#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))",
+ "# include <TargetConditionals.h>",
+ "# if defined(TARGET_OS_MAC) && TARGET_OS_MAC",
+ "# include <GSS/GSS.h>",
+ "# endif",
+ "#else",
+ "# include <gssapi/gssapi.h>",
+ "#endif"
+ ],
+ "main": [
+ "gss_ctx_id_t ctx;",
+ "gss_context_time(nullptr, ctx, nullptr);"
+ ]
+ },
+ "sources": [
+ { "libs": "-framework GSS", "condition": "config.darwin" },
+ { "type": "pkgConfig", "args": "krb5-gssapi" },
+ "-lgssapi_krb5"
+ ]
}
},
@@ -199,6 +223,22 @@
]
},
"use": "openssl"
+ },
+ "netlistmgr": {
+ "label": "Network List Manager",
+ "type": "compile",
+ "test": {
+ "include": [ "netlistmgr.h", "wrl/client.h" ],
+ "main": [
+ "using namespace Microsoft::WRL;",
+ "ComPtr<INetworkListManager> networkListManager;",
+ "ComPtr<IConnectionPoint> connectionPoint;",
+ "ComPtr<IConnectionPointContainer> connectionPointContainer;",
+ "networkListManager.As(&connectionPointContainer);",
+ "connectionPointContainer->FindConnectionPoint(IID_INetworkConnectionEvents, &connectionPoint);"
+ ],
+ "qmake": "LIBS += -lOle32"
+ }
}
},
@@ -261,7 +301,7 @@
"disable": "input.securetransport == 'no' || input.ssl == 'no'",
"condition": "config.darwin && (input.openssl == '' || input.openssl == 'no')",
"output": [
- "privateFeature",
+ "publicFeature",
{ "type": "define", "name": "QT_SECURETRANSPORT" }
]
},
@@ -283,7 +323,7 @@
"label": "DTLS",
"purpose": "Provides a DTLS implementation",
"section": "Networking",
- "condition": "features.openssl && tests.dtls",
+ "condition": "features.openssl && features.udpsocket && tests.dtls",
"output": [ "publicFeature" ]
},
"ocsp": {
@@ -378,6 +418,27 @@
"purpose": "Provides API for DNS lookups.",
"section": "Networking",
"output": [ "publicFeature" ]
+ },
+ "gssapi": {
+ "label": "GSSAPI",
+ "purpose": "Enable SPNEGO authentication through GSSAPI",
+ "section": "Networking",
+ "condition": "!config.win32 && libs.gssapi",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "sspi": {
+ "label": "SSPI",
+ "purpose": "Enable NTLM/SPNEGO authentication through SSPI",
+ "section": "Networking",
+ "condition": "config.win32 && !config.winrt",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "netlistmgr": {
+ "label": "Network List Manager",
+ "purpose": "Use Network List Manager to keep track of network connectivity",
+ "section": "Networking",
+ "condition": "config.win32 && tests.netlistmgr",
+ "output": [ "privateFeature" ]
}
},
@@ -437,7 +498,8 @@ For example:
"dtls",
"ocsp",
"sctp",
- "system-proxies"
+ "system-proxies",
+ "gssapi"
]
}
]
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri
index 7074fcd5eb..110d9f56bf 100644
--- a/src/network/kernel/kernel.pri
+++ b/src/network/kernel/kernel.pri
@@ -16,7 +16,8 @@ HEADERS += kernel/qtnetworkglobal.h \
kernel/qnetworkinterface.h \
kernel/qnetworkinterface_p.h \
kernel/qnetworkinterface_unix_p.h \
- kernel/qnetworkproxy.h
+ kernel/qnetworkproxy.h \
+ kernel/qnetconmonitor_p.h
SOURCES += kernel/qauthenticator.cpp \
kernel/qhostaddress.cpp \
@@ -71,6 +72,19 @@ mac {
!uikit: LIBS_PRIVATE += -framework CoreServices -framework SystemConfiguration
}
+macos | ios {
+ OBJECTIVE_SOURCES += \
+ kernel/qnetconmonitor_darwin.mm
+
+ LIBS_PRIVATE += -framework SystemConfiguration
+} else:qtConfig(netlistmgr) {
+ SOURCES += kernel/qnetconmonitor_win.cpp
+} else {
+ SOURCES += kernel/qnetconmonitor_stub.cpp
+}
+
+qtConfig(gssapi): QMAKE_USE_PRIVATE += gssapi
+
uikit:HEADERS += kernel/qnetworkinterface_uikit_p.h
osx:SOURCES += kernel/qnetworkproxy_mac.cpp
else:win32:!winrt: SOURCES += kernel/qnetworkproxy_win.cpp
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index 47ce9ab0c6..33a30eb1cd 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -52,22 +52,34 @@
#ifdef Q_OS_WIN
#include <qmutex.h>
-#include <private/qmutexpool_p.h>
#include <rpc.h>
-#ifndef Q_OS_WINRT
+#endif
+
+#if QT_CONFIG(sspi) // SSPI
#define SECURITY_WIN32 1
#include <security.h>
-#endif
-#endif
+#elif QT_CONFIG(gssapi) // GSSAPI
+#if defined(Q_OS_DARWIN)
+#include <GSS/GSS.h>
+#else
+#include <gssapi/gssapi.h>
+#endif // Q_OS_DARWIN
+#endif // Q_CONFIG(sspi)
QT_BEGIN_NAMESPACE
static QByteArray qNtlmPhase1();
static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phase2data);
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-static QByteArray qNtlmPhase1_SSPI(QAuthenticatorPrivate *ctx);
-static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray& phase2data);
-#endif
+#if QT_CONFIG(sspi) // SSPI
+static QByteArray qSspiStartup(QAuthenticatorPrivate *ctx, QAuthenticatorPrivate::Method method,
+ const QString& host);
+static QByteArray qSspiContinue(QAuthenticatorPrivate *ctx, QAuthenticatorPrivate::Method method,
+ const QString& host, const QByteArray& challenge = QByteArray());
+#elif QT_CONFIG(gssapi) // GSSAPI
+static QByteArray qGssapiStartup(QAuthenticatorPrivate *ctx, const QString& host);
+static QByteArray qGssapiContinue(QAuthenticatorPrivate *ctx,
+ const QByteArray& challenge = QByteArray());
+#endif // gssapi
/*!
\class QAuthenticator
@@ -90,6 +102,7 @@ static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray&
\li Basic
\li NTLM version 2
\li Digest-MD5
+ \li SPNEGO/Negotiate
\endlist
\target qauthenticator-options
@@ -133,6 +146,10 @@ static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray&
The Digest-MD5 authentication mechanism supports no outgoing options.
+ \section2 SPNEGO/Negotiate
+
+ This authentication mechanism currently supports no incoming or outgoing options.
+
\sa QSslSocket
*/
@@ -187,7 +204,7 @@ QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other)
d->options = other.d->options;
} else if (d->phase == QAuthenticatorPrivate::Start) {
delete d;
- d = 0;
+ d = nullptr;
}
return *this;
}
@@ -339,21 +356,25 @@ bool QAuthenticator::isNull() const
return !d;
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-class QNtlmWindowsHandles
+#if QT_CONFIG(sspi) // SSPI
+class QSSPIWindowsHandles
{
public:
CredHandle credHandle;
CtxtHandle ctxHandle;
};
-#endif
+#elif QT_CONFIG(gssapi) // GSSAPI
+class QGssApiHandles
+{
+public:
+ gss_ctx_id_t gssCtx = nullptr;
+ gss_name_t targetName;
+};
+#endif // gssapi
QAuthenticatorPrivate::QAuthenticatorPrivate()
: method(None)
- #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- , ntlmWindowsHandles(0)
- #endif
, hasFailed(false)
, phase(Start)
, nonceCount(0)
@@ -363,13 +384,7 @@ QAuthenticatorPrivate::QAuthenticatorPrivate()
nonceCount = 0;
}
-QAuthenticatorPrivate::~QAuthenticatorPrivate()
-{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- if (ntlmWindowsHandles)
- delete ntlmWindowsHandles;
-#endif
-}
+QAuthenticatorPrivate::~QAuthenticatorPrivate() = default;
void QAuthenticatorPrivate::updateCredentials()
{
@@ -424,6 +439,9 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
} else if (method < DigestMd5 && str.startsWith("digest")) {
method = DigestMd5;
headerVal = current.second.mid(7);
+ } else if (method < Negotiate && str.startsWith("negotiate")) {
+ method = Negotiate;
+ headerVal = current.second.mid(10);
}
}
@@ -439,6 +457,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
phase = Done;
break;
case Ntlm:
+ case Negotiate:
// work is done in calculateResponse()
break;
case DigestMd5: {
@@ -456,33 +475,36 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
}
}
-QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMethod, const QByteArray &path)
+QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMethod, const QByteArray &path, const QString& host)
{
+#if !QT_CONFIG(sspi) && !QT_CONFIG(gssapi)
+ Q_UNUSED(host);
+#endif
QByteArray response;
- const char *methodString = 0;
+ const char* methodString = nullptr;
switch(method) {
case QAuthenticatorPrivate::None:
methodString = "";
phase = Done;
break;
case QAuthenticatorPrivate::Basic:
- methodString = "Basic ";
+ methodString = "Basic";
response = user.toLatin1() + ':' + password.toLatin1();
response = response.toBase64();
phase = Done;
break;
case QAuthenticatorPrivate::DigestMd5:
- methodString = "Digest ";
+ methodString = "Digest";
response = digestMd5Response(challenge, requestMethod, path);
phase = Done;
break;
case QAuthenticatorPrivate::Ntlm:
- methodString = "NTLM ";
+ methodString = "NTLM";
if (challenge.isEmpty()) {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if QT_CONFIG(sspi) // SSPI
QByteArray phase1Token;
if (user.isEmpty()) // Only pull from system if no user was specified in authenticator
- phase1Token = qNtlmPhase1_SSPI(this);
+ phase1Token = qSspiStartup(this, method, host);
if (!phase1Token.isEmpty()) {
response = phase1Token.toBase64();
phase = Phase2;
@@ -496,10 +518,10 @@ QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMet
phase = Phase2;
}
} else {
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+#if QT_CONFIG(sspi) // SSPI
QByteArray phase3Token;
- if (ntlmWindowsHandles)
- phase3Token = qNtlmPhase3_SSPI(this, QByteArray::fromBase64(challenge));
+ if (sspiWindowsHandles)
+ phase3Token = qSspiContinue(this, method, host, QByteArray::fromBase64(challenge));
if (!phase3Token.isEmpty()) {
response = phase3Token.toBase64();
phase = Done;
@@ -512,8 +534,39 @@ QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMet
}
break;
+ case QAuthenticatorPrivate::Negotiate:
+ methodString = "Negotiate";
+ if (challenge.isEmpty()) {
+ QByteArray phase1Token;
+#if QT_CONFIG(sspi) // SSPI
+ phase1Token = qSspiStartup(this, method, host);
+#elif QT_CONFIG(gssapi) // GSSAPI
+ phase1Token = qGssapiStartup(this, host);
+#endif
+
+ if (!phase1Token.isEmpty()) {
+ response = phase1Token.toBase64();
+ phase = Phase2;
+ } else {
+ phase = Done;
+ }
+ } else {
+ QByteArray phase3Token;
+#if QT_CONFIG(sspi) // SSPI
+ phase3Token = qSspiContinue(this, method, host, QByteArray::fromBase64(challenge));
+#elif QT_CONFIG(gssapi) // GSSAPI
+ phase3Token = qGssapiContinue(this, QByteArray::fromBase64(challenge));
+#endif
+ if (!phase3Token.isEmpty()) {
+ response = phase3Token.toBase64();
+ phase = Done;
+ }
+ }
+
+ break;
}
- return QByteArray(methodString) + response;
+
+ return QByteArray::fromRawData(methodString, qstrlen(methodString)) + ' ' + response;
}
@@ -699,9 +752,10 @@ QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge,
return credentials;
}
-// ---------------------------- Digest Md5 code ----------------------------------------
+// ---------------------------- End of Digest Md5 code ---------------------------------
+// ---------------------------- NTLM code ----------------------------------------------
/*
* NTLM message flags.
@@ -1419,156 +1473,237 @@ static QByteArray qNtlmPhase3(QAuthenticatorPrivate *ctx, const QByteArray& phas
return rc;
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+// ---------------------------- End of NTLM code ---------------------------------------
+
+#if QT_CONFIG(sspi) // SSPI
+// ---------------------------- SSPI code ----------------------------------------------
// See http://davenport.sourceforge.net/ntlm.html
// and libcurl http_ntlm.c
// Handle of secur32.dll
-static HMODULE securityDLLHandle = NULL;
+static HMODULE securityDLLHandle = nullptr;
// Pointer to SSPI dispatch table
-static PSecurityFunctionTable pSecurityFunctionTable = NULL;
-
+static PSecurityFunctionTable pSecurityFunctionTable = nullptr;
-static bool q_NTLM_SSPI_library_load()
+static bool q_SSPI_library_load()
{
static QBasicMutex mutex;
QMutexLocker l(&mutex);
// Initialize security interface
- if (pSecurityFunctionTable == NULL) {
+ if (pSecurityFunctionTable == nullptr) {
securityDLLHandle = LoadLibrary(L"secur32.dll");
- if (securityDLLHandle != NULL) {
+ if (securityDLLHandle != nullptr) {
INIT_SECURITY_INTERFACE pInitSecurityInterface =
reinterpret_cast<INIT_SECURITY_INTERFACE>(
reinterpret_cast<QFunctionPointer>(GetProcAddress(securityDLLHandle, "InitSecurityInterfaceW")));
- if (pInitSecurityInterface != NULL)
+ if (pInitSecurityInterface != nullptr)
pSecurityFunctionTable = pInitSecurityInterface();
}
}
- if (pSecurityFunctionTable == NULL)
+ if (pSecurityFunctionTable == nullptr)
return false;
return true;
}
-// Phase 1:
-static QByteArray qNtlmPhase1_SSPI(QAuthenticatorPrivate *ctx)
+static QByteArray qSspiStartup(QAuthenticatorPrivate *ctx, QAuthenticatorPrivate::Method method,
+ const QString& host)
{
- QByteArray result;
+ if (!q_SSPI_library_load())
+ return QByteArray();
+
+ TimeStamp expiry; // For Windows 9x compatibility of SSPI calls
- if (!q_NTLM_SSPI_library_load())
- return result;
+ if (!ctx->sspiWindowsHandles)
+ ctx->sspiWindowsHandles.reset(new QSSPIWindowsHandles);
+ memset(&ctx->sspiWindowsHandles->credHandle, 0, sizeof(CredHandle));
- // 1. The client obtains a representation of the credential set
- // for the user via the SSPI AcquireCredentialsHandle function.
- if (!ctx->ntlmWindowsHandles)
- ctx->ntlmWindowsHandles = new QNtlmWindowsHandles;
- memset(&ctx->ntlmWindowsHandles->credHandle, 0, sizeof(CredHandle));
- TimeStamp tsDummy;
+ // Acquire our credentials handle
SECURITY_STATUS secStatus = pSecurityFunctionTable->AcquireCredentialsHandle(
- NULL, (SEC_WCHAR*)L"NTLM", SECPKG_CRED_OUTBOUND, NULL, NULL,
- NULL, NULL, &ctx->ntlmWindowsHandles->credHandle, &tsDummy);
+ nullptr,
+ (SEC_WCHAR*)(method == QAuthenticatorPrivate::Negotiate ? L"Negotiate" : L"NTLM"),
+ SECPKG_CRED_OUTBOUND, nullptr, nullptr, nullptr, nullptr,
+ &ctx->sspiWindowsHandles->credHandle, &expiry
+ );
if (secStatus != SEC_E_OK) {
- delete ctx->ntlmWindowsHandles;
- ctx->ntlmWindowsHandles = 0;
- return result;
+ ctx->sspiWindowsHandles.reset(nullptr);
+ return QByteArray();
}
- // 2. The client calls the SSPI InitializeSecurityContext function
- // to obtain an authentication request token (in our case, a Type 1 message).
- // The client sends this token to the server.
- SecBufferDesc desc;
- SecBuffer buf;
- desc.ulVersion = SECBUFFER_VERSION;
- desc.cBuffers = 1;
- desc.pBuffers = &buf;
- buf.cbBuffer = 0;
- buf.BufferType = SECBUFFER_TOKEN;
- buf.pvBuffer = NULL;
- ULONG attrs;
-
- secStatus = pSecurityFunctionTable->InitializeSecurityContext(&ctx->ntlmWindowsHandles->credHandle, NULL,
- const_cast<SEC_WCHAR*>(L"") /* host */,
- ISC_REQ_ALLOCATE_MEMORY,
- 0, SECURITY_NETWORK_DREP,
- NULL, 0,
- &ctx->ntlmWindowsHandles->ctxHandle, &desc,
- &attrs, &tsDummy);
- if (secStatus == SEC_I_COMPLETE_AND_CONTINUE ||
- secStatus == SEC_I_CONTINUE_NEEDED) {
- pSecurityFunctionTable->CompleteAuthToken(&ctx->ntlmWindowsHandles->ctxHandle, &desc);
- } else if (secStatus != SEC_E_OK) {
- if ((const char*)buf.pvBuffer)
- pSecurityFunctionTable->FreeContextBuffer(buf.pvBuffer);
- pSecurityFunctionTable->FreeCredentialsHandle(&ctx->ntlmWindowsHandles->credHandle);
- delete ctx->ntlmWindowsHandles;
- ctx->ntlmWindowsHandles = 0;
- return result;
+ return qSspiContinue(ctx, method, host);
+}
+
+static QByteArray qSspiContinue(QAuthenticatorPrivate *ctx, QAuthenticatorPrivate::Method method,
+ const QString &host, const QByteArray &challenge)
+{
+ QByteArray result;
+ SecBuffer challengeBuf;
+ SecBuffer responseBuf;
+ SecBufferDesc challengeDesc;
+ SecBufferDesc responseDesc;
+ unsigned long attrs;
+ TimeStamp expiry; // For Windows 9x compatibility of SSPI calls
+
+ if (!challenge.isEmpty())
+ {
+ // Setup the challenge "input" security buffer
+ challengeDesc.ulVersion = SECBUFFER_VERSION;
+ challengeDesc.cBuffers = 1;
+ challengeDesc.pBuffers = &challengeBuf;
+ challengeBuf.BufferType = SECBUFFER_TOKEN;
+ challengeBuf.pvBuffer = (PVOID)(challenge.data());
+ challengeBuf.cbBuffer = challenge.length();
}
- result = QByteArray((const char*)buf.pvBuffer, buf.cbBuffer);
- pSecurityFunctionTable->FreeContextBuffer(buf.pvBuffer);
+ // Setup the response "output" security buffer
+ responseDesc.ulVersion = SECBUFFER_VERSION;
+ responseDesc.cBuffers = 1;
+ responseDesc.pBuffers = &responseBuf;
+ responseBuf.BufferType = SECBUFFER_TOKEN;
+ responseBuf.pvBuffer = nullptr;
+ responseBuf.cbBuffer = 0;
+
+ // Calculate target (SPN for Negotiate, empty for NTLM)
+ std::wstring targetNameW = (method == QAuthenticatorPrivate::Negotiate
+ ? QLatin1String("HTTP/") + host : QString()).toStdWString();
+
+ // Generate our challenge-response message
+ SECURITY_STATUS secStatus = pSecurityFunctionTable->InitializeSecurityContext(
+ &ctx->sspiWindowsHandles->credHandle,
+ !challenge.isEmpty() ? &ctx->sspiWindowsHandles->ctxHandle : nullptr,
+ const_cast<wchar_t*>(targetNameW.data()),
+ ISC_REQ_ALLOCATE_MEMORY,
+ 0, SECURITY_NATIVE_DREP,
+ !challenge.isEmpty() ? &challengeDesc : nullptr,
+ 0, &ctx->sspiWindowsHandles->ctxHandle,
+ &responseDesc, &attrs,
+ &expiry
+ );
+
+ if (secStatus == SEC_I_COMPLETE_NEEDED || secStatus == SEC_I_COMPLETE_AND_CONTINUE) {
+ secStatus = pSecurityFunctionTable->CompleteAuthToken(&ctx->sspiWindowsHandles->ctxHandle,
+ &responseDesc);
+ }
+
+ if (secStatus != SEC_I_COMPLETE_AND_CONTINUE && secStatus != SEC_I_CONTINUE_NEEDED) {
+ pSecurityFunctionTable->FreeCredentialsHandle(&ctx->sspiWindowsHandles->credHandle);
+ pSecurityFunctionTable->DeleteSecurityContext(&ctx->sspiWindowsHandles->ctxHandle);
+ ctx->sspiWindowsHandles.reset(nullptr);
+ }
+
+ result = QByteArray((const char*)responseBuf.pvBuffer, responseBuf.cbBuffer);
+ pSecurityFunctionTable->FreeContextBuffer(responseBuf.pvBuffer);
+
return result;
}
-// Phase 2:
-// 3. The server receives the token from the client, and uses it as input to the
-// AcceptSecurityContext SSPI function. This creates a local security context on
-// the server to represent the client, and yields an authentication response token
-// (the Type 2 message), which is sent to the client.
+// ---------------------------- End of SSPI code ---------------------------------------
+
+#elif QT_CONFIG(gssapi) // GSSAPI
+
+// ---------------------------- GSSAPI code ----------------------------------------------
+// See postgres src/interfaces/libpq/fe-auth.c
+
+// Fetch all errors of a specific type
+static void q_GSSAPI_error_int(const char *message, OM_uint32 stat, int type)
+{
+ OM_uint32 minStat, msgCtx = 0;
+ gss_buffer_desc msg;
+
+ do {
+ gss_display_status(&minStat, stat, type, GSS_C_NO_OID, &msgCtx, &msg);
+ qDebug() << message << ": " << reinterpret_cast<const char*>(msg.value);
+ gss_release_buffer(&minStat, &msg);
+ } while (msgCtx);
+}
-// Phase 3:
-static QByteArray qNtlmPhase3_SSPI(QAuthenticatorPrivate *ctx, const QByteArray& phase2data)
+// GSSAPI errors contain two parts; extract both
+static void q_GSSAPI_error(const char *message, OM_uint32 majStat, OM_uint32 minStat)
{
- // 4. The client receives the response token from the server and calls
- // InitializeSecurityContext again, passing the server's token as input.
- // This provides us with another authentication request token (the Type 3 message).
- // The return value indicates that the security context was successfully initialized;
- // the token is sent to the server.
+ // Fetch major error codes
+ q_GSSAPI_error_int(message, majStat, GSS_C_GSS_CODE);
+ // Add the minor codes as well
+ q_GSSAPI_error_int(message, minStat, GSS_C_MECH_CODE);
+}
+
+// Send initial GSS authentication token
+static QByteArray qGssapiStartup(QAuthenticatorPrivate *ctx, const QString &host)
+{
+ OM_uint32 majStat, minStat;
+
+ if (!ctx->gssApiHandles)
+ ctx->gssApiHandles.reset(new QGssApiHandles);
+
+ // Convert target name to internal form
+ QByteArray serviceName = QStringLiteral("HTTPS@%1").arg(host).toLocal8Bit();
+ gss_buffer_desc nameDesc = {static_cast<std::size_t>(serviceName.size()), serviceName.data()};
+
+ majStat = gss_import_name(&minStat, &nameDesc,
+ GSS_C_NT_HOSTBASED_SERVICE, &ctx->gssApiHandles->targetName);
+
+ if (majStat != GSS_S_COMPLETE) {
+ q_GSSAPI_error("gss_import_name error", majStat, minStat);
+ ctx->gssApiHandles.reset(nullptr);
+ return QByteArray();
+ }
+
+ // Call qGssapiContinue with GSS_C_NO_CONTEXT to get initial packet
+ ctx->gssApiHandles->gssCtx = GSS_C_NO_CONTEXT;
+ return qGssapiContinue(ctx);
+}
+
+// Continue GSS authentication with next token as needed
+static QByteArray qGssapiContinue(QAuthenticatorPrivate *ctx, const QByteArray& challenge)
+{
+ OM_uint32 majStat, minStat, ignored;
QByteArray result;
+ gss_buffer_desc inBuf = {0, nullptr}; // GSS input token
+ gss_buffer_desc outBuf; // GSS output token
- if (pSecurityFunctionTable == NULL)
- return result;
-
- SecBuffer type_2, type_3;
- SecBufferDesc type_2_desc, type_3_desc;
- ULONG attrs;
- TimeStamp tsDummy; // For Windows 9x compatibility of SPPI calls
-
- type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION;
- type_2_desc.cBuffers = type_3_desc.cBuffers = 1;
- type_2_desc.pBuffers = &type_2;
- type_3_desc.pBuffers = &type_3;
-
- type_2.BufferType = SECBUFFER_TOKEN;
- type_2.pvBuffer = (PVOID)phase2data.data();
- type_2.cbBuffer = phase2data.length();
- type_3.BufferType = SECBUFFER_TOKEN;
- type_3.pvBuffer = 0;
- type_3.cbBuffer = 0;
-
- SECURITY_STATUS secStatus = pSecurityFunctionTable->InitializeSecurityContext(&ctx->ntlmWindowsHandles->credHandle,
- &ctx->ntlmWindowsHandles->ctxHandle,
- const_cast<SEC_WCHAR*>(L"") /* host */,
- ISC_REQ_ALLOCATE_MEMORY,
- 0, SECURITY_NETWORK_DREP, &type_2_desc,
- 0, &ctx->ntlmWindowsHandles->ctxHandle, &type_3_desc,
- &attrs, &tsDummy);
-
- if (secStatus == SEC_E_OK && ((const char*)type_3.pvBuffer)) {
- result = QByteArray((const char*)type_3.pvBuffer, type_3.cbBuffer);
- pSecurityFunctionTable->FreeContextBuffer(type_3.pvBuffer);
+ if (!challenge.isEmpty()) {
+ inBuf.value = const_cast<char*>(challenge.data());
+ inBuf.length = challenge.length();
}
- pSecurityFunctionTable->FreeCredentialsHandle(&ctx->ntlmWindowsHandles->credHandle);
- pSecurityFunctionTable->DeleteSecurityContext(&ctx->ntlmWindowsHandles->ctxHandle);
- delete ctx->ntlmWindowsHandles;
- ctx->ntlmWindowsHandles = 0;
+ majStat = gss_init_sec_context(&minStat,
+ GSS_C_NO_CREDENTIAL,
+ &ctx->gssApiHandles->gssCtx,
+ ctx->gssApiHandles->targetName,
+ GSS_C_NO_OID,
+ GSS_C_MUTUAL_FLAG,
+ 0,
+ GSS_C_NO_CHANNEL_BINDINGS,
+ challenge.isEmpty() ? GSS_C_NO_BUFFER : &inBuf,
+ nullptr,
+ &outBuf,
+ nullptr,
+ nullptr);
+
+ if (outBuf.length != 0)
+ result = QByteArray(reinterpret_cast<const char*>(outBuf.value), outBuf.length);
+ gss_release_buffer(&ignored, &outBuf);
+
+ if (majStat != GSS_S_COMPLETE && majStat != GSS_S_CONTINUE_NEEDED) {
+ q_GSSAPI_error("gss_init_sec_context error", majStat, minStat);
+ gss_release_name(&ignored, &ctx->gssApiHandles->targetName);
+ if (ctx->gssApiHandles->gssCtx)
+ gss_delete_sec_context(&ignored, &ctx->gssApiHandles->gssCtx, GSS_C_NO_BUFFER);
+ ctx->gssApiHandles.reset(nullptr);
+ }
+
+ if (majStat == GSS_S_COMPLETE) {
+ gss_release_name(&ignored, &ctx->gssApiHandles->targetName);
+ ctx->gssApiHandles.reset(nullptr);
+ }
return result;
}
-#endif // Q_OS_WIN && !Q_OS_WINRT
+
+// ---------------------------- End of GSSAPI code ----------------------------------------------
+
+#endif // gssapi
QT_END_NAMESPACE
diff --git a/src/network/kernel/qauthenticator_p.h b/src/network/kernel/qauthenticator_p.h
index 265cb7afe2..e201d22650 100644
--- a/src/network/kernel/qauthenticator_p.h
+++ b/src/network/kernel/qauthenticator_p.h
@@ -54,6 +54,7 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
#include <qhash.h>
#include <qbytearray.h>
+#include <qscopedpointer.h>
#include <qstring.h>
#include <qauthenticator.h>
#include <qvariant.h>
@@ -61,14 +62,16 @@
QT_BEGIN_NAMESPACE
class QHttpResponseHeader;
-#ifdef Q_OS_WIN
-class QNtlmWindowsHandles;
+#if QT_CONFIG(sspi) // SSPI
+class QSSPIWindowsHandles;
+#elif QT_CONFIG(gssapi) // GSSAPI
+class QGssApiHandles;
#endif
class Q_AUTOTEST_EXPORT QAuthenticatorPrivate
{
public:
- enum Method { None, Basic, Ntlm, DigestMd5 };
+ enum Method { None, Basic, Ntlm, DigestMd5, Negotiate };
QAuthenticatorPrivate();
~QAuthenticatorPrivate();
@@ -79,8 +82,10 @@ public:
Method method;
QString realm;
QByteArray challenge;
-#ifdef Q_OS_WIN
- QNtlmWindowsHandles *ntlmWindowsHandles;
+#if QT_CONFIG(sspi) // SSPI
+ QScopedPointer<QSSPIWindowsHandles> sspiWindowsHandles;
+#elif QT_CONFIG(gssapi) // GSSAPI
+ QScopedPointer<QGssApiHandles> gssApiHandles;
#endif
bool hasFailed; //credentials have been tried but rejected by server.
@@ -100,7 +105,7 @@ public:
QString workstation;
QString userDomain;
- QByteArray calculateResponse(const QByteArray &method, const QByteArray &path);
+ QByteArray calculateResponse(const QByteArray &method, const QByteArray &path, const QString& host);
inline static QAuthenticatorPrivate *getPrivate(QAuthenticator &auth) { return auth.d; }
inline static const QAuthenticatorPrivate *getPrivate(const QAuthenticator &auth) { return auth.d; }
diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h
index eebd0abe66..110a74da44 100644
--- a/src/network/kernel/qdnslookup.h
+++ b/src/network/kernel/qdnslookup.h
@@ -64,13 +64,11 @@ class Q_NETWORK_EXPORT QDnsDomainNameRecord
public:
QDnsDomainNameRecord();
QDnsDomainNameRecord(const QDnsDomainNameRecord &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDnsDomainNameRecord &operator=(QDnsDomainNameRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDnsDomainNameRecord &operator=(QDnsDomainNameRecord &&other) noexcept { swap(other); return *this; }
QDnsDomainNameRecord &operator=(const QDnsDomainNameRecord &other);
~QDnsDomainNameRecord();
- void swap(QDnsDomainNameRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDnsDomainNameRecord &other) noexcept { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
@@ -88,13 +86,11 @@ class Q_NETWORK_EXPORT QDnsHostAddressRecord
public:
QDnsHostAddressRecord();
QDnsHostAddressRecord(const QDnsHostAddressRecord &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDnsHostAddressRecord &operator=(QDnsHostAddressRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDnsHostAddressRecord &operator=(QDnsHostAddressRecord &&other) noexcept { swap(other); return *this; }
QDnsHostAddressRecord &operator=(const QDnsHostAddressRecord &other);
~QDnsHostAddressRecord();
- void swap(QDnsHostAddressRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDnsHostAddressRecord &other) noexcept { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
@@ -112,13 +108,11 @@ class Q_NETWORK_EXPORT QDnsMailExchangeRecord
public:
QDnsMailExchangeRecord();
QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDnsMailExchangeRecord &operator=(QDnsMailExchangeRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDnsMailExchangeRecord &operator=(QDnsMailExchangeRecord &&other) noexcept { swap(other); return *this; }
QDnsMailExchangeRecord &operator=(const QDnsMailExchangeRecord &other);
~QDnsMailExchangeRecord();
- void swap(QDnsMailExchangeRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDnsMailExchangeRecord &other) noexcept { qSwap(d, other.d); }
QString exchange() const;
QString name() const;
@@ -137,13 +131,11 @@ class Q_NETWORK_EXPORT QDnsServiceRecord
public:
QDnsServiceRecord();
QDnsServiceRecord(const QDnsServiceRecord &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDnsServiceRecord &operator=(QDnsServiceRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDnsServiceRecord &operator=(QDnsServiceRecord &&other) noexcept { swap(other); return *this; }
QDnsServiceRecord &operator=(const QDnsServiceRecord &other);
~QDnsServiceRecord();
- void swap(QDnsServiceRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDnsServiceRecord &other) noexcept { qSwap(d, other.d); }
QString name() const;
quint16 port() const;
@@ -164,13 +156,11 @@ class Q_NETWORK_EXPORT QDnsTextRecord
public:
QDnsTextRecord();
QDnsTextRecord(const QDnsTextRecord &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QDnsTextRecord &operator=(QDnsTextRecord &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QDnsTextRecord &operator=(QDnsTextRecord &&other) noexcept { swap(other); return *this; }
QDnsTextRecord &operator=(const QDnsTextRecord &other);
~QDnsTextRecord();
- void swap(QDnsTextRecord &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QDnsTextRecord &other) noexcept { qSwap(d, other.d); }
QString name() const;
quint32 timeToLive() const;
diff --git a/src/network/kernel/qdnslookup_p.h b/src/network/kernel/qdnslookup_p.h
index 2dc98e527a..8c3c2ed3e1 100644
--- a/src/network/kernel/qdnslookup_p.h
+++ b/src/network/kernel/qdnslookup_p.h
@@ -95,7 +95,7 @@ public:
QDnsLookupPrivate()
: isFinished(false)
, type(QDnsLookup::A)
- , runnable(0)
+ , runnable(nullptr)
{ }
void _q_lookupFinished(const QDnsLookupReply &reply);
diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp
index cfdb9ca633..262893179c 100644
--- a/src/network/kernel/qdnslookup_win.cpp
+++ b/src/network/kernel/qdnslookup_win.cpp
@@ -41,7 +41,6 @@
#include "qdnslookup_p.h"
#include <qurl.h>
-#include <private/qmutexpool_p.h>
#include <private/qsystemerror_p.h>
#include <qt_windows.h>
diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp
index 5d0ef150f3..b54fb349fb 100644
--- a/src/network/kernel/qhostaddress.cpp
+++ b/src/network/kernel/qhostaddress.cpp
@@ -1333,7 +1333,7 @@ QDebug operator<<(QDebug d, const QHostAddress &address)
\relates QHostAddress
Returns a hash of the host address \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QHostAddress &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QHostAddress &key, uint seed) noexcept
{
return qHashBits(key.d->a6.c, 16, seed);
}
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h
index 00555f3d8e..799247695e 100644
--- a/src/network/kernel/qhostaddress.h
+++ b/src/network/kernel/qhostaddress.h
@@ -66,7 +66,7 @@ typedef QIPv6Address Q_IPV6ADDR;
class QHostAddress;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed = 0) noexcept;
class Q_NETWORK_EXPORT QHostAddress
{
@@ -102,11 +102,8 @@ public:
QHostAddress(SpecialAddress address);
~QHostAddress();
-#ifdef Q_COMPILER_RVALUE_REFS
- QHostAddress &operator=(QHostAddress &&other) Q_DECL_NOTHROW
+ QHostAddress &operator=(QHostAddress &&other) noexcept
{ swap(other); return *this; }
-#endif
-
QHostAddress &operator=(const QHostAddress &other);
#if QT_DEPRECATED_SINCE(5, 8)
QT_DEPRECATED_X("use = QHostAddress(string) instead")
@@ -114,7 +111,7 @@ public:
#endif
QHostAddress &operator=(SpecialAddress address);
- void swap(QHostAddress &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QHostAddress &other) noexcept { d.swap(other.d); }
void setAddress(quint32 ip4Addr);
void setAddress(quint8 *ip6Addr); // ### Qt 6: remove me
@@ -157,7 +154,7 @@ public:
static QPair<QHostAddress, int> parseSubnet(const QString &subnet);
- friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_NETWORK_EXPORT uint qHash(const QHostAddress &key, uint seed) noexcept;
protected:
friend class QHostAddressPrivate;
QExplicitlySharedDataPointer<QHostAddressPrivate> d;
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index f4348b690e..f9335c3bb9 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -37,13 +37,17 @@
**
****************************************************************************/
+//#define QHOSTINFO_DEBUG
+
#include "qhostinfo.h"
#include "qhostinfo_p.h"
+#include <qplatformdefs.h>
#include "QtCore/qscopedpointer.h"
#include <qabstracteventdispatcher.h>
#include <qcoreapplication.h>
#include <qmetaobject.h>
+#include <qscopeguard.h>
#include <qstringlist.h>
#include <qthread.h>
#include <qurl.h>
@@ -53,6 +57,15 @@
#ifdef Q_OS_UNIX
# include <unistd.h>
+# include <netdb.h>
+# include <netinet/in.h>
+# if defined(AI_ADDRCONFIG)
+# define Q_ADDRCONFIG AI_ADDRCONFIG
+# endif
+#elif defined Q_OS_WIN
+# include <ws2tcpip.h>
+
+# define QT_SOCKLEN_T int
#endif
QT_BEGIN_NAMESPACE
@@ -64,8 +77,8 @@ Q_GLOBAL_STATIC(QHostInfoLookupManager, theHostInfoLookupManager)
namespace {
struct ToBeLookedUpEquals {
typedef bool result_type;
- explicit ToBeLookedUpEquals(const QString &toBeLookedUp) Q_DECL_NOTHROW : m_toBeLookedUp(toBeLookedUp) {}
- result_type operator()(QHostInfoRunnable* lookup) const Q_DECL_NOTHROW
+ explicit ToBeLookedUpEquals(const QString &toBeLookedUp) noexcept : m_toBeLookedUp(toBeLookedUp) {}
+ result_type operator()(QHostInfoRunnable* lookup) const noexcept
{
return m_toBeLookedUp == lookup->toBeLookedUp;
}
@@ -73,13 +86,6 @@ private:
QString m_toBeLookedUp;
};
-// ### C++11: remove once we can use std::any_of()
-template<class InputIt, class UnaryPredicate>
-bool any_of(InputIt first, InputIt last, UnaryPredicate p)
-{
- return std::find_if(first, last, p) != last;
-}
-
template <typename InputIt, typename OutputIt1, typename OutputIt2, typename UnaryPredicate>
std::pair<OutputIt1, OutputIt2> separate_if(InputIt first, InputIt last, OutputIt1 dest1, OutputIt2 dest2, UnaryPredicate p)
{
@@ -96,16 +102,6 @@ std::pair<OutputIt1, OutputIt2> separate_if(InputIt first, InputIt last, OutputI
return std::make_pair(dest1, dest2);
}
-int get_signal_index()
-{
- static auto senderMetaObject = &QHostInfoResult::staticMetaObject;
- static auto signal = &QHostInfoResult::resultsReady;
- int signal_index = -1;
- void *args[] = { &signal_index, &signal };
- senderMetaObject->static_metacall(QMetaObject::IndexOfMethod, 0, args);
- return signal_index + QMetaObjectPrivate::signalOffset(senderMetaObject);
-}
-
}
/*
@@ -123,38 +119,59 @@ void QHostInfoResult::postResultsReady(const QHostInfo &info)
{
// queued connection will take care of dispatching to right thread
if (!slotObj) {
- emitResultsReady(info);
+ emit resultsReady(info);
return;
}
- static const int signal_index = get_signal_index();
-
// we used to have a context object, but it's already destroyed
if (withContextObject && !receiver)
return;
- /* QHostInfoResult c'tor moves the result object to the thread of receiver.
- If we don't have a receiver, then the result object will not live in a
- thread that runs an event loop - so move it to this' thread, which is the thread
- that initiated the lookup, and required to have a running event loop. */
- auto result = new QHostInfoResult(receiver, slotObj);
- if (!receiver)
- result->moveToThread(thread());
+ static const int signal_index = []() -> int {
+ auto senderMetaObject = &QHostInfoResult::staticMetaObject;
+ auto signal = &QHostInfoResult::resultsReady;
+ int signal_index = -1;
+ void *args[] = { &signal_index, &signal };
+ senderMetaObject->static_metacall(QMetaObject::IndexOfMethod, 0, args);
+ return signal_index + QMetaObjectPrivate::signalOffset(senderMetaObject);
+ }();
+
+ // a long-living version of this
+ auto result = new QHostInfoResult(this);
Q_CHECK_PTR(result);
+
const int nargs = 2;
- auto types = reinterpret_cast<int *>(malloc(nargs * sizeof(int)));
- Q_CHECK_PTR(types);
+ auto metaCallEvent = new QMetaCallEvent(slotObj, nullptr, signal_index, nargs);
+ Q_CHECK_PTR(metaCallEvent);
+ void **args = metaCallEvent->args();
+ int *types = metaCallEvent->types();
types[0] = QMetaType::type("void");
types[1] = QMetaType::type("QHostInfo");
- auto args = reinterpret_cast<void **>(malloc(nargs * sizeof(void *)));
- Q_CHECK_PTR(args);
- args[0] = 0;
+ args[0] = nullptr;
args[1] = QMetaType::create(types[1], &info);
Q_CHECK_PTR(args[1]);
- auto metaCallEvent = new QMetaCallEvent(slotObj, nullptr, signal_index, nargs, types, args);
- Q_CHECK_PTR(metaCallEvent);
qApp->postEvent(result, metaCallEvent);
}
+/*
+ Receives the event posted by postResultsReady, and calls the functor.
+*/
+bool QHostInfoResult::event(QEvent *event)
+{
+ if (event->type() == QEvent::MetaCall) {
+ Q_ASSERT(slotObj);
+ auto metaCallEvent = static_cast<QMetaCallEvent *>(event);
+ auto args = metaCallEvent->args();
+ // we didn't have a context object, or it's still alive
+ if (!withContextObject || receiver)
+ slotObj->call(const_cast<QObject*>(receiver.data()), args);
+ slotObj->destroyIfLastRef();
+
+ deleteLater();
+ return true;
+ }
+ return QObject::event(event);
+}
+
/*!
\class QHostInfo
\brief The QHostInfo class provides static functions for host name lookups.
@@ -249,64 +266,9 @@ static int nextId()
\sa abortHostLookup(), addresses(), error(), fromName()
*/
-int QHostInfo::lookupHost(const QString &name, QObject *receiver,
- const char *member)
+int QHostInfo::lookupHost(const QString &name, QObject *receiver, const char *member)
{
-#if defined QHOSTINFO_DEBUG
- qDebug("QHostInfo::lookupHost(\"%s\", %p, %s)",
- name.toLatin1().constData(), receiver, member ? member + 1 : 0);
-#endif
-
- if (!QAbstractEventDispatcher::instance(QThread::currentThread())) {
- qWarning("QHostInfo::lookupHost() called with no event dispatcher");
- return -1;
- }
-
- qRegisterMetaType<QHostInfo>();
-
- int id = nextId(); // generate unique ID
-
- if (name.isEmpty()) {
- if (!receiver)
- return -1;
-
- QHostInfo hostInfo(id);
- hostInfo.setError(QHostInfo::HostNotFound);
- hostInfo.setErrorString(QCoreApplication::translate("QHostInfo", "No host name given"));
- QScopedPointer<QHostInfoResult> result(new QHostInfoResult);
- QObject::connect(result.data(), SIGNAL(resultsReady(QHostInfo)),
- receiver, member, Qt::QueuedConnection);
- result.data()->emitResultsReady(hostInfo);
- return id;
- }
-
- QHostInfoLookupManager *manager = theHostInfoLookupManager();
-
- if (manager) {
- // the application is still alive
- if (manager->cache.isEnabled()) {
- // check cache first
- bool valid = false;
- QHostInfo info = manager->cache.get(name, &valid);
- if (valid) {
- if (!receiver)
- return -1;
-
- info.setLookupId(id);
- QHostInfoResult result;
- QObject::connect(&result, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection);
- result.emitResultsReady(info);
- return id;
- }
- }
-
- // cache is not enabled or it was not in the cache, do normal lookup
- QHostInfoRunnable* runnable = new QHostInfoRunnable(name, id);
- if (receiver)
- QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection);
- manager->scheduleLookup(runnable);
- }
- return id;
+ return QHostInfoPrivate::lookupHostImpl(name, receiver, nullptr, member);
}
/*!
@@ -416,7 +378,7 @@ QHostInfo QHostInfo::fromName(const QString &name)
#endif
QHostInfo hostInfo = QHostInfoAgent::fromName(name);
- QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
+ QHostInfoLookupManager* manager = theHostInfoLookupManager();
manager->cache.put(name, hostInfo);
return hostInfo;
}
@@ -429,7 +391,7 @@ QHostInfo QHostInfoPrivate::fromName(const QString &name, QSharedPointer<QNetwor
#endif
QHostInfo hostInfo = QHostInfoAgent::fromName(name, session);
- QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
+ QHostInfoLookupManager* manager = theHostInfoLookupManager();
manager->cache.put(name, hostInfo);
return hostInfo;
}
@@ -442,6 +404,162 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName, QSharedPointer<QNetw
}
#endif
+QHostInfo QHostInfoAgent::reverseLookup(const QHostAddress &address)
+{
+ QHostInfo results;
+ // Reverse lookup
+ sockaddr_in sa4;
+ sockaddr_in6 sa6;
+ sockaddr *sa = 0;
+ QT_SOCKLEN_T saSize;
+ if (address.protocol() == QAbstractSocket::IPv4Protocol) {
+ sa = reinterpret_cast<sockaddr *>(&sa4);
+ saSize = sizeof(sa4);
+ memset(&sa4, 0, sizeof(sa4));
+ sa4.sin_family = AF_INET;
+ sa4.sin_addr.s_addr = htonl(address.toIPv4Address());
+ } else {
+ sa = reinterpret_cast<sockaddr *>(&sa6);
+ saSize = sizeof(sa6);
+ memset(&sa6, 0, sizeof(sa6));
+ sa6.sin6_family = AF_INET6;
+ memcpy(&sa6.sin6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr));
+ }
+
+ char hbuf[NI_MAXHOST];
+ if (sa && getnameinfo(sa, saSize, hbuf, sizeof(hbuf), nullptr, 0, 0) == 0)
+ results.setHostName(QString::fromLatin1(hbuf));
+
+ if (results.hostName().isEmpty())
+ results.setHostName(address.toString());
+ results.setAddresses(QList<QHostAddress>() << address);
+
+ return results;
+}
+
+/*
+ Call getaddrinfo, and returns the results as QHostInfo::addresses
+*/
+QHostInfo QHostInfoAgent::lookup(const QString &hostName)
+{
+ QHostInfo results;
+
+ // IDN support
+ QByteArray aceHostname = QUrl::toAce(hostName);
+ results.setHostName(hostName);
+ if (aceHostname.isEmpty()) {
+ results.setError(QHostInfo::HostNotFound);
+ results.setErrorString(hostName.isEmpty() ?
+ QCoreApplication::translate("QHostInfoAgent", "No host name given") :
+ QCoreApplication::translate("QHostInfoAgent", "Invalid hostname"));
+ return results;
+ }
+
+ addrinfo *res = 0;
+ struct addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+#ifdef Q_ADDRCONFIG
+ hints.ai_flags = Q_ADDRCONFIG;
+#endif
+
+ int result = getaddrinfo(aceHostname.constData(), nullptr, &hints, &res);
+# ifdef Q_ADDRCONFIG
+ if (result == EAI_BADFLAGS) {
+ // if the lookup failed with AI_ADDRCONFIG set, try again without it
+ hints.ai_flags = 0;
+ result = getaddrinfo(aceHostname.constData(), nullptr, &hints, &res);
+ }
+# endif
+
+ if (result == 0) {
+ addrinfo *node = res;
+ QList<QHostAddress> addresses;
+ while (node) {
+#ifdef QHOSTINFO_DEBUG
+ qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family
+ << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol
+ << "ai_addrlen:" << node->ai_addrlen;
+#endif
+ switch (node->ai_family) {
+ case AF_INET: {
+ QHostAddress addr;
+ addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr));
+ if (!addresses.contains(addr))
+ addresses.append(addr);
+ break;
+ }
+ case AF_INET6: {
+ QHostAddress addr;
+ sockaddr_in6 *sa6 = (sockaddr_in6 *) node->ai_addr;
+ addr.setAddress(sa6->sin6_addr.s6_addr);
+ if (sa6->sin6_scope_id)
+ addr.setScopeId(QString::number(sa6->sin6_scope_id));
+ if (!addresses.contains(addr))
+ addresses.append(addr);
+ break;
+ }
+ default:
+ results.setError(QHostInfo::UnknownError);
+ results.setErrorString(QCoreApplication::translate("QHostInfoAgent", "Unknown address type"));
+ }
+ node = node->ai_next;
+ }
+ if (addresses.isEmpty()) {
+ // Reached the end of the list, but no addresses were found; this
+ // means the list contains one or more unknown address types.
+ results.setError(QHostInfo::UnknownError);
+ results.setErrorString(QCoreApplication::translate("QHostInfoAgent", "Unknown address type"));
+ }
+
+ results.setAddresses(addresses);
+ freeaddrinfo(res);
+ } else {
+ switch (result) {
+#ifdef Q_OS_WIN
+ case WSAHOST_NOT_FOUND: //authoritative not found
+ case WSATRY_AGAIN: //non authoritative not found
+ case WSANO_DATA: //valid name, no associated address
+#else
+ case EAI_NONAME:
+ case EAI_FAIL:
+# ifdef EAI_NODATA // EAI_NODATA is deprecated in RFC 3493
+ case EAI_NODATA:
+# endif
+#endif
+ results.setError(QHostInfo::HostNotFound);
+ results.setErrorString(QCoreApplication::translate("QHostInfoAgent", "Host not found"));
+ break;
+ default:
+ results.setError(QHostInfo::UnknownError);
+#ifdef Q_OS_WIN
+ results.setErrorString(QString::fromWCharArray(gai_strerror(result)));
+#else
+ results.setErrorString(QString::fromLocal8Bit(gai_strerror(result)));
+#endif
+ break;
+ }
+ }
+
+#if defined(QHOSTINFO_DEBUG)
+ if (results.error() != QHostInfo::NoError) {
+ qDebug("QHostInfoAgent::fromName(): error #%d %s",
+ h_errno, results.errorString().toLatin1().constData());
+ } else {
+ QString tmp;
+ QList<QHostAddress> addresses = results.addresses();
+ for (int i = 0; i < addresses.count(); ++i) {
+ if (i != 0) tmp += QLatin1String(", ");
+ tmp += addresses.at(i).toString();
+ }
+ qDebug("QHostInfoAgent::fromName(): found %i entries for \"%s\": {%s}",
+ addresses.count(), aceHostname.constData(),
+ tmp.toLatin1().constData());
+ }
+#endif
+
+ return results;
+}
/*!
\enum QHostInfo::HostInfoError
@@ -462,8 +580,9 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName, QSharedPointer<QNetw
\sa lookupId()
*/
QHostInfo::QHostInfo(int id)
- : d(new QHostInfoPrivate)
+ : d_ptr(new QHostInfoPrivate)
{
+ Q_D(QHostInfo);
d->lookupId = id;
}
@@ -471,17 +590,32 @@ QHostInfo::QHostInfo(int id)
Constructs a copy of \a other.
*/
QHostInfo::QHostInfo(const QHostInfo &other)
- : d(new QHostInfoPrivate(*other.d.data()))
+ : d_ptr(new QHostInfoPrivate(*other.d_ptr))
{
}
/*!
+ \fn QHostInfo(QHostInfo &&other)
+
+ Move-constructs a new QHostInfo from \a other.
+
+ \note The moved-from object \a other is placed in a
+ partially-formed state, in which the only valid operations are
+ destruction and assignment of a new value.
+
+ \since 5.14
+*/
+
+/*!
Assigns the data of the \a other object to this host info object,
and returns a reference to it.
*/
QHostInfo &QHostInfo::operator=(const QHostInfo &other)
{
- *d.data() = *other.d.data();
+ if (d_ptr)
+ *d_ptr = *other.d_ptr;
+ else
+ d_ptr = new QHostInfoPrivate(*other.d_ptr);
return *this;
}
@@ -490,6 +624,7 @@ QHostInfo &QHostInfo::operator=(const QHostInfo &other)
*/
QHostInfo::~QHostInfo()
{
+ delete d_ptr;
}
/*!
@@ -504,6 +639,7 @@ QHostInfo::~QHostInfo()
*/
QList<QHostAddress> QHostInfo::addresses() const
{
+ Q_D(const QHostInfo);
return d->addrs;
}
@@ -514,6 +650,7 @@ QList<QHostAddress> QHostInfo::addresses() const
*/
void QHostInfo::setAddresses(const QList<QHostAddress> &addresses)
{
+ Q_D(QHostInfo);
d->addrs = addresses;
}
@@ -524,6 +661,7 @@ void QHostInfo::setAddresses(const QList<QHostAddress> &addresses)
*/
QString QHostInfo::hostName() const
{
+ Q_D(const QHostInfo);
return d->hostName;
}
@@ -534,6 +672,7 @@ QString QHostInfo::hostName() const
*/
void QHostInfo::setHostName(const QString &hostName)
{
+ Q_D(QHostInfo);
d->hostName = hostName;
}
@@ -545,6 +684,7 @@ void QHostInfo::setHostName(const QString &hostName)
*/
QHostInfo::HostInfoError QHostInfo::error() const
{
+ Q_D(const QHostInfo);
return d->err;
}
@@ -555,6 +695,7 @@ QHostInfo::HostInfoError QHostInfo::error() const
*/
void QHostInfo::setError(HostInfoError error)
{
+ Q_D(QHostInfo);
d->err = error;
}
@@ -565,6 +706,7 @@ void QHostInfo::setError(HostInfoError error)
*/
int QHostInfo::lookupId() const
{
+ Q_D(const QHostInfo);
return d->lookupId;
}
@@ -575,6 +717,7 @@ int QHostInfo::lookupId() const
*/
void QHostInfo::setLookupId(int id)
{
+ Q_D(QHostInfo);
d->lookupId = id;
}
@@ -586,6 +729,7 @@ void QHostInfo::setLookupId(int id)
*/
QString QHostInfo::errorString() const
{
+ Q_D(const QHostInfo);
return d->errorStr;
}
@@ -597,6 +741,7 @@ QString QHostInfo::errorString() const
*/
void QHostInfo::setErrorString(const QString &str)
{
+ Q_D(QHostInfo);
d->errorStr = str;
}
@@ -631,14 +776,32 @@ QString QHostInfo::localHostName()
\sa hostName()
*/
+// ### Qt 6 merge with function below
int QHostInfo::lookupHostImpl(const QString &name,
const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj)
{
+ return QHostInfoPrivate::lookupHostImpl(name, receiver, slotObj, nullptr);
+}
+/*
+ Called by the various lookupHost overloads to perform the lookup.
+
+ Signals either the functor encapuslated in the \a slotObj in the context
+ of \a receiver, or the \a member slot of the \a receiver.
+
+ \a receiver might be the nullptr, but only if a \a slotObj is provided.
+*/
+int QHostInfoPrivate::lookupHostImpl(const QString &name,
+ const QObject *receiver,
+ QtPrivate::QSlotObjectBase *slotObj,
+ const char *member)
+{
#if defined QHOSTINFO_DEBUG
- qDebug("QHostInfo::lookupHost(\"%s\", %p, %p)",
- name.toLatin1().constData(), receiver, slotObj);
+ qDebug("QHostInfoPrivate::lookupHostImpl(\"%s\", %p, %p, %s)",
+ name.toLatin1().constData(), receiver, slotObj, member ? member + 1 : 0);
#endif
+ Q_ASSERT(!member != !slotObj); // one of these must be set, but not both
+ Q_ASSERT(receiver || slotObj);
if (!QAbstractEventDispatcher::instance(QThread::currentThread())) {
qWarning("QHostInfo::lookupHost() called with no event dispatcher");
@@ -653,8 +816,13 @@ int QHostInfo::lookupHostImpl(const QString &name,
QHostInfo hostInfo(id);
hostInfo.setError(QHostInfo::HostNotFound);
hostInfo.setErrorString(QCoreApplication::translate("QHostInfo", "No host name given"));
+
QHostInfoResult result(receiver, slotObj);
+ if (receiver && member)
+ QObject::connect(&result, SIGNAL(resultsReady(QHostInfo)),
+ receiver, member, Qt::QueuedConnection);
result.postResultsReady(hostInfo);
+
return id;
}
@@ -669,23 +837,24 @@ int QHostInfo::lookupHostImpl(const QString &name,
if (valid) {
info.setLookupId(id);
QHostInfoResult result(receiver, slotObj);
+ if (receiver && member)
+ QObject::connect(&result, SIGNAL(resultsReady(QHostInfo)),
+ receiver, member, Qt::QueuedConnection);
result.postResultsReady(info);
return id;
}
}
// cache is not enabled or it was not in the cache, do normal lookup
- QHostInfoRunnable* runnable = new QHostInfoRunnable(name, id, receiver, slotObj);
+ QHostInfoRunnable *runnable = new QHostInfoRunnable(name, id, receiver, slotObj);
+ if (receiver && member)
+ QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)),
+ receiver, member, Qt::QueuedConnection);
manager->scheduleLookup(runnable);
}
return id;
}
-QHostInfoRunnable::QHostInfoRunnable(const QString &hn, int i) : toBeLookedUp(hn), id(i)
-{
- setAutoDelete(true);
-}
-
QHostInfoRunnable::QHostInfoRunnable(const QString &hn, int i, const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj) :
toBeLookedUp(hn), id(i), resultEmitter(receiver, slotObj)
@@ -697,11 +866,10 @@ QHostInfoRunnable::QHostInfoRunnable(const QString &hn, int i, const QObject *re
void QHostInfoRunnable::run()
{
QHostInfoLookupManager *manager = theHostInfoLookupManager();
+ const auto sg = qScopeGuard([&] { manager->lookupFinished(this); });
// check aborted
- if (manager->wasAborted(id)) {
- manager->lookupFinished(this);
+ if (manager->wasAborted(id))
return;
- }
QHostInfo hostInfo;
@@ -723,10 +891,8 @@ void QHostInfoRunnable::run()
}
// check aborted again
- if (manager->wasAborted(id)) {
- manager->lookupFinished(this);
+ if (manager->wasAborted(id))
return;
- }
// signal emission
hostInfo.setLookupId(id);
@@ -750,16 +916,15 @@ void QHostInfoRunnable::run()
}
#endif
- manager->lookupFinished(this);
-
// thread goes back to QThreadPool
}
-QHostInfoLookupManager::QHostInfoLookupManager() : mutex(QMutex::Recursive), wasDeleted(false)
+QHostInfoLookupManager::QHostInfoLookupManager() : wasDeleted(false)
{
- moveToThread(QCoreApplicationPrivate::mainThread());
#if QT_CONFIG(thread)
- connect(QCoreApplication::instance(), SIGNAL(destroyed()), SLOT(waitForThreadPoolDone()), Qt::DirectConnection);
+ QObject::connect(QCoreApplication::instance(), &QObject::destroyed,
+ &threadPool, [&](QObject *) { threadPool.waitForDone(); },
+ Qt::DirectConnection);
threadPool.setMaxThreadCount(20); // do up to 20 DNS lookups in parallel
#endif
}
@@ -794,10 +959,9 @@ void QHostInfoLookupManager::clear()
cache.clear();
}
-void QHostInfoLookupManager::work()
+// assumes mutex is locked by caller
+void QHostInfoLookupManager::rescheduleWithMutexHeld()
{
- QMutexLocker locker(&mutex);
-
if (wasDeleted)
return;
@@ -816,7 +980,7 @@ void QHostInfoLookupManager::work()
#if QT_CONFIG(thread)
auto isAlreadyRunning = [this](QHostInfoRunnable *lookup) {
- return any_of(currentLookups.cbegin(), currentLookups.cend(), ToBeLookedUpEquals(lookup->toBeLookedUp));
+ return std::any_of(currentLookups.cbegin(), currentLookups.cend(), ToBeLookedUpEquals(lookup->toBeLookedUp));
};
// Transfer any postponed lookups that aren't currently running to the scheduled list, keeping already-running lookups:
@@ -862,7 +1026,7 @@ void QHostInfoLookupManager::scheduleLookup(QHostInfoRunnable *r)
return;
scheduledLookups.enqueue(r);
- work();
+ rescheduleWithMutexHeld();
}
// called by QHostInfo
@@ -918,7 +1082,7 @@ void QHostInfoLookupManager::lookupFinished(QHostInfoRunnable *r)
currentLookups.removeOne(r);
#endif
finishedLookups.append(r);
- work();
+ rescheduleWithMutexHeld();
}
// This function returns immediately when we had a result in the cache, else it will later emit a signal
@@ -928,7 +1092,7 @@ QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char
*id = -1;
// check cache
- QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
+ QHostInfoLookupManager* manager = theHostInfoLookupManager();
if (manager && manager->cache.isEnabled()) {
QHostInfo info = manager->cache.get(name, valid);
if (*valid) {
@@ -937,7 +1101,7 @@ QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char
}
// was not in cache, trigger lookup
- *id = QHostInfo::lookupHost(name, receiver, member);
+ *id = QHostInfoPrivate::lookupHostImpl(name, receiver, nullptr, member);
// return empty response, valid==false
return QHostInfo();
@@ -945,7 +1109,7 @@ QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char
void qt_qhostinfo_clear_cache()
{
- QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
+ QHostInfoLookupManager* manager = theHostInfoLookupManager();
if (manager) {
manager->clear();
}
@@ -954,7 +1118,7 @@ void qt_qhostinfo_clear_cache()
#ifdef QT_BUILD_INTERNAL
void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
{
- QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
+ QHostInfoLookupManager* manager = theHostInfoLookupManager();
if (manager) {
manager->cache.setEnabled(e);
}
@@ -962,7 +1126,7 @@ void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
void qt_qhostinfo_cache_inject(const QString &hostname, const QHostInfo &resolution)
{
- QAbstractHostInfoLookupManager* manager = theHostInfoLookupManager();
+ QHostInfoLookupManager* manager = theHostInfoLookupManager();
if (!manager || !manager->cache.isEnabled())
return;
@@ -1018,9 +1182,4 @@ void QHostInfoCache::clear()
cache.clear();
}
-QAbstractHostInfoLookupManager* QAbstractHostInfoLookupManager::globalInstance()
-{
- return theHostInfoLookupManager();
-}
-
QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h
index 49871ad470..cda286b423 100644
--- a/src/network/kernel/qhostinfo.h
+++ b/src/network/kernel/qhostinfo.h
@@ -62,11 +62,12 @@ public:
explicit QHostInfo(int lookupId = -1);
QHostInfo(const QHostInfo &d);
+ QHostInfo(QHostInfo &&other) noexcept : d_ptr(qExchange(other.d_ptr, nullptr)) {}
QHostInfo &operator=(const QHostInfo &d);
- QHostInfo &operator=(QHostInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QHostInfo &operator=(QHostInfo &&other) noexcept { swap(other); return *this; }
~QHostInfo();
- void swap(QHostInfo &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QHostInfo &other) noexcept { qSwap(d_ptr, other.d_ptr); }
QString hostName() const;
void setHostName(const QString &name);
@@ -147,7 +148,8 @@ public:
#endif // Q_QDOC
private:
- QScopedPointer<QHostInfoPrivate> d;
+ QHostInfoPrivate *d_ptr;
+ Q_DECLARE_PRIVATE(QHostInfo)
static int lookupHostImpl(const QString &name,
const QObject *receiver,
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index fa6529bdfd..1798ceab0a 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -81,69 +81,50 @@ QT_BEGIN_NAMESPACE
class QHostInfoResult : public QObject
{
Q_OBJECT
-
- QPointer<const QObject> receiver = nullptr;
- QtPrivate::QSlotObjectBase *slotObj = nullptr;
- const bool withContextObject = false;
-
public:
- QHostInfoResult() = default;
- QHostInfoResult(const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj) :
- receiver(receiver),
- slotObj(slotObj),
- withContextObject(slotObj && receiver)
+ QHostInfoResult(const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj)
+ : receiver(receiver), slotObj(slotObj),
+ withContextObject(slotObj && receiver)
{
- connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this,
- &QObject::deleteLater);
- if (slotObj && receiver)
+ if (receiver)
moveToThread(receiver->thread());
}
void postResultsReady(const QHostInfo &info);
-public Q_SLOTS:
- inline void emitResultsReady(const QHostInfo &info)
- {
- if (slotObj) {
- // we either didn't have a context object, or it's still alive
- if (!withContextObject || receiver) {
- QHostInfo copy = info;
- void *args[2] = { 0, reinterpret_cast<void *>(&copy) };
- slotObj->call(const_cast<QObject*>(receiver.data()), args);
- }
- slotObj->destroyIfLastRef();
- } else {
- emit resultsReady(info);
- }
- }
+Q_SIGNALS:
+ void resultsReady(const QHostInfo &info);
protected:
- bool event(QEvent *event) override
+ bool event(QEvent *event) override;
+
+private:
+ QHostInfoResult(const QHostInfoResult *other)
+ : receiver(other->receiver), slotObj(other->slotObj),
+ withContextObject(other->withContextObject)
{
- if (event->type() == QEvent::MetaCall) {
- auto metaCallEvent = static_cast<QMetaCallEvent *>(event);
- auto args = metaCallEvent->args();
- auto hostInfo = reinterpret_cast<QHostInfo *>(args[1]);
- emitResultsReady(*hostInfo);
- deleteLater();
- return true;
- }
- return QObject::event(event);
+ // cleanup if the application terminates before results are delivered
+ connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
+ this, &QObject::deleteLater);
+ // maintain thread affinity
+ moveToThread(other->thread());
}
-Q_SIGNALS:
- void resultsReady(const QHostInfo &info);
+ QPointer<const QObject> receiver = nullptr;
+ QtPrivate::QSlotObjectBase *slotObj = nullptr;
+ const bool withContextObject = false;
};
-// needs to be QObject because fromName calls tr()
-class QHostInfoAgent : public QObject
+class QHostInfoAgent
{
- Q_OBJECT
public:
static QHostInfo fromName(const QString &hostName);
#ifndef QT_NO_BEARERMANAGEMENT
static QHostInfo fromName(const QString &hostName, QSharedPointer<QNetworkSession> networkSession);
#endif
+private:
+ static QHostInfo lookup(const QString &hostName);
+ static QHostInfo reverseLookup(const QHostAddress &address);
};
class QHostInfoPrivate
@@ -159,6 +140,10 @@ public:
//not a public API yet
static QHostInfo fromName(const QString &hostName, QSharedPointer<QNetworkSession> networkSession);
#endif
+ static int lookupHostImpl(const QString &name,
+ const QObject *receiver,
+ QtPrivate::QSlotObjectBase *slotObj,
+ const char *member);
QHostInfo::HostInfoError err;
QString errorStr;
@@ -203,7 +188,6 @@ private:
class QHostInfoRunnable : public QRunnable
{
public:
- QHostInfoRunnable(const QString &hn, int i);
QHostInfoRunnable(const QString &hn, int i, const QObject *receiver,
QtPrivate::QSlotObjectBase *slotObj);
void run() override;
@@ -214,31 +198,13 @@ public:
};
-class QAbstractHostInfoLookupManager : public QObject
+class QHostInfoLookupManager
{
- Q_OBJECT
-
-public:
- ~QAbstractHostInfoLookupManager() {}
- virtual void clear() = 0;
-
- QHostInfoCache cache;
-
-protected:
- QAbstractHostInfoLookupManager() {}
- static QAbstractHostInfoLookupManager* globalInstance();
-
-};
-
-class QHostInfoLookupManager : public QAbstractHostInfoLookupManager
-{
- Q_OBJECT
public:
QHostInfoLookupManager();
~QHostInfoLookupManager();
- void clear() override;
- void work();
+ void clear();
// called from QHostInfo
void scheduleLookup(QHostInfoRunnable *r);
@@ -248,6 +214,8 @@ public:
void lookupFinished(QHostInfoRunnable *r);
bool wasAborted(int id);
+ QHostInfoCache cache;
+
friend class QHostInfoRunnable;
protected:
#if QT_CONFIG(thread)
@@ -265,10 +233,8 @@ protected:
bool wasDeleted;
-private slots:
-#if QT_CONFIG(thread)
- void waitForThreadPoolDone() { threadPool.waitForDone(); }
-#endif
+private:
+ void rescheduleWithMutexHeld();
};
QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index e4810d68ee..78a05f8407 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -72,17 +72,6 @@
QT_BEGIN_NAMESPACE
-// Almost always the same. If not, specify in qplatformdefs.h.
-#if !defined(QT_SOCKOPTLEN_T)
-# define QT_SOCKOPTLEN_T QT_SOCKLEN_T
-#endif
-
-// HP-UXi has a bug in getaddrinfo(3) that makes it thread-unsafe
-// with this flag. So disable it in that platform.
-#if defined(AI_ADDRCONFIG) && !defined(Q_OS_HPUX)
-# define Q_ADDRCONFIG AI_ADDRCONFIG
-#endif
-
enum LibResolvFeature {
NeedResInit,
NeedResNInit
@@ -197,132 +186,10 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
local_res_init();
QHostAddress address;
- if (address.setAddress(hostName)) {
- // Reverse lookup
- sockaddr_in sa4;
- sockaddr_in6 sa6;
- sockaddr *sa = 0;
- QT_SOCKLEN_T saSize = 0;
- if (address.protocol() == QAbstractSocket::IPv4Protocol) {
- sa = (sockaddr *)&sa4;
- saSize = sizeof(sa4);
- memset(&sa4, 0, sizeof(sa4));
- sa4.sin_family = AF_INET;
- sa4.sin_addr.s_addr = htonl(address.toIPv4Address());
- }
- else {
- sa = (sockaddr *)&sa6;
- saSize = sizeof(sa6);
- memset(&sa6, 0, sizeof(sa6));
- sa6.sin6_family = AF_INET6;
- memcpy(sa6.sin6_addr.s6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr.s6_addr));
- }
-
- char hbuf[NI_MAXHOST];
- if (sa && getnameinfo(sa, saSize, hbuf, sizeof(hbuf), 0, 0, 0) == 0)
- results.setHostName(QString::fromLatin1(hbuf));
-
- if (results.hostName().isEmpty())
- results.setHostName(address.toString());
- results.setAddresses(QList<QHostAddress>() << address);
- return results;
- }
-
- // IDN support
- QByteArray aceHostname = QUrl::toAce(hostName);
- results.setHostName(hostName);
- if (aceHostname.isEmpty()) {
- results.setError(QHostInfo::HostNotFound);
- results.setErrorString(hostName.isEmpty() ?
- QCoreApplication::translate("QHostInfoAgent", "No host name given") :
- QCoreApplication::translate("QHostInfoAgent", "Invalid hostname"));
- return results;
- }
-
- // Call getaddrinfo, and place all IPv4 addresses at the start and
- // the IPv6 addresses at the end of the address list in results.
- addrinfo *res = 0;
- struct addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = PF_UNSPEC;
-#ifdef Q_ADDRCONFIG
- hints.ai_flags = Q_ADDRCONFIG;
-#endif
+ if (address.setAddress(hostName))
+ return reverseLookup(address);
- int result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
-# ifdef Q_ADDRCONFIG
- if (result == EAI_BADFLAGS) {
- // if the lookup failed with AI_ADDRCONFIG set, try again without it
- hints.ai_flags = 0;
- result = getaddrinfo(aceHostname.constData(), 0, &hints, &res);
- }
-# endif
-
- if (result == 0) {
- addrinfo *node = res;
- QList<QHostAddress> addresses;
- while (node) {
-#ifdef QHOSTINFO_DEBUG
- qDebug() << "getaddrinfo node: flags:" << node->ai_flags << "family:" << node->ai_family << "ai_socktype:" << node->ai_socktype << "ai_protocol:" << node->ai_protocol << "ai_addrlen:" << node->ai_addrlen;
-#endif
- if (node->ai_family == AF_INET) {
- QHostAddress addr;
- addr.setAddress(ntohl(((sockaddr_in *) node->ai_addr)->sin_addr.s_addr));
- if (!addresses.contains(addr))
- addresses.append(addr);
- }
- else if (node->ai_family == AF_INET6) {
- QHostAddress addr;
- sockaddr_in6 *sa6 = (sockaddr_in6 *) node->ai_addr;
- addr.setAddress(sa6->sin6_addr.s6_addr);
- if (sa6->sin6_scope_id)
- addr.setScopeId(QString::number(sa6->sin6_scope_id));
- if (!addresses.contains(addr))
- addresses.append(addr);
- }
- node = node->ai_next;
- }
- if (addresses.isEmpty() && node == 0) {
- // Reached the end of the list, but no addresses were found; this
- // means the list contains one or more unknown address types.
- results.setError(QHostInfo::UnknownError);
- results.setErrorString(tr("Unknown address type"));
- }
-
- results.setAddresses(addresses);
- freeaddrinfo(res);
- } else if (result == EAI_NONAME
- || result == EAI_FAIL
-#ifdef EAI_NODATA
- // EAI_NODATA is deprecated in RFC 3493
- || result == EAI_NODATA
-#endif
- ) {
- results.setError(QHostInfo::HostNotFound);
- results.setErrorString(tr("Host not found"));
- } else {
- results.setError(QHostInfo::UnknownError);
- results.setErrorString(QString::fromLocal8Bit(gai_strerror(result)));
- }
-
-
-#if defined(QHOSTINFO_DEBUG)
- if (results.error() != QHostInfo::NoError) {
- qDebug("QHostInfoAgent::fromName(): error #%d %s",
- h_errno, results.errorString().toLatin1().constData());
- } else {
- QString tmp;
- QList<QHostAddress> addresses = results.addresses();
- for (int i = 0; i < addresses.count(); ++i) {
- if (i != 0) tmp += ", ";
- tmp += addresses.at(i).toString();
- }
- qDebug("QHostInfoAgent::fromName(): found %i entries for \"%s\": {%s}",
- addresses.count(), hostName.toLatin1().constData(),
- tmp.toLatin1().constData());
- }
-#endif
- return results;
+ return lookup(hostName);
}
QString QHostInfo::localDomainName()
diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp
index c51e9968f8..0b5cc98970 100644
--- a/src/network/kernel/qhostinfo_win.cpp
+++ b/src/network/kernel/qhostinfo_win.cpp
@@ -51,27 +51,10 @@ QT_BEGIN_NAMESPACE
//#define QHOSTINFO_DEBUG
//###
-#define QT_SOCKLEN_T int
#ifndef NI_MAXHOST // already defined to 1025 in ws2tcpip.h?
#define NI_MAXHOST 1024
#endif
-static void translateWSAError(int error, QHostInfo *results)
-{
- switch (error) {
- case WSAHOST_NOT_FOUND: //authoritative not found
- case WSATRY_AGAIN: //non authoritative not found
- case WSANO_DATA: //valid name, no associated address
- results->setError(QHostInfo::HostNotFound);
- results->setErrorString(QHostInfoAgent::tr("Host not found"));
- return;
- default:
- results->setError(QHostInfo::UnknownError);
- results->setErrorString(QHostInfoAgent::tr("Unknown error (%1)").arg(error));
- return;
- }
-}
-
QHostInfo QHostInfoAgent::fromName(const QString &hostName)
{
QSysInfo::machineHostName(); // this initializes ws2_32.dll
@@ -79,98 +62,15 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
QHostInfo results;
#if defined(QHOSTINFO_DEBUG)
- qDebug("QHostInfoAgent::fromName(): looking up \"%s\" (IPv6 support is %s)",
- hostName.toLatin1().constData(),
- (getaddrinfo && freeaddrinfo) ? "enabled" : "disabled");
+ qDebug("QHostInfoAgent::fromName(%s) looking up...",
+ hostName.toLatin1().constData());
#endif
QHostAddress address;
- if (address.setAddress(hostName)) {
- // Reverse lookup
- sockaddr_in sa4;
- sockaddr_in6 sa6;
- sockaddr *sa;
- QT_SOCKLEN_T saSize;
- if (address.protocol() == QAbstractSocket::IPv4Protocol) {
- sa = reinterpret_cast<sockaddr *>(&sa4);
- saSize = sizeof(sa4);
- memset(&sa4, 0, sizeof(sa4));
- sa4.sin_family = AF_INET;
- sa4.sin_addr.s_addr = htonl(address.toIPv4Address());
- } else {
- sa = reinterpret_cast<sockaddr *>(&sa6);
- saSize = sizeof(sa6);
- memset(&sa6, 0, sizeof(sa6));
- sa6.sin6_family = AF_INET6;
- memcpy(&sa6.sin6_addr, address.toIPv6Address().c, sizeof(sa6.sin6_addr));
- }
-
- char hbuf[NI_MAXHOST];
- if (getnameinfo(sa, saSize, hbuf, sizeof(hbuf), 0, 0, 0) == 0)
- results.setHostName(QString::fromLatin1(hbuf));
-
- if (results.hostName().isEmpty())
- results.setHostName(address.toString());
- results.setAddresses(QList<QHostAddress>() << address);
- return results;
- }
+ if (address.setAddress(hostName))
+ return reverseLookup(address);
- // IDN support
- QByteArray aceHostname = QUrl::toAce(hostName);
- results.setHostName(hostName);
- if (aceHostname.isEmpty()) {
- results.setError(QHostInfo::HostNotFound);
- results.setErrorString(hostName.isEmpty() ? tr("No host name given") : tr("Invalid hostname"));
- return results;
- }
-
- addrinfo *res;
- int err = getaddrinfo(aceHostname.constData(), 0, 0, &res);
- if (err == 0) {
- QList<QHostAddress> addresses;
- for (addrinfo *p = res; p != 0; p = p->ai_next) {
- switch (p->ai_family) {
- case AF_INET: {
- QHostAddress addr;
- addr.setAddress(ntohl(reinterpret_cast<sockaddr_in *>(p->ai_addr)->sin_addr.s_addr));
- if (!addresses.contains(addr))
- addresses.append(addr);
- }
- break;
- case AF_INET6: {
- QHostAddress addr;
- addr.setAddress(reinterpret_cast<const sockaddr_in6 *>(p->ai_addr)->sin6_addr.s6_addr);
- if (!addresses.contains(addr))
- addresses.append(addr);
- }
- break;
- default:
- results.setError(QHostInfo::UnknownError);
- results.setErrorString(tr("Unknown address type"));
- }
- }
- results.setAddresses(addresses);
- freeaddrinfo(res);
- } else {
- translateWSAError(WSAGetLastError(), &results);
- }
-
-#if defined(QHOSTINFO_DEBUG)
- if (results.error() != QHostInfo::NoError) {
- qDebug("QHostInfoAgent::run(): error (%s)",
- results.errorString().toLatin1().constData());
- } else {
- QString tmp;
- QList<QHostAddress> addresses = results.addresses();
- for (int i = 0; i < addresses.count(); ++i) {
- if (i != 0) tmp += ", ";
- tmp += addresses.at(i).toString();
- }
- qDebug("QHostInfoAgent::run(): found %i entries: {%s}",
- addresses.count(), tmp.toLatin1().constData());
- }
-#endif
- return results;
+ return lookup(hostName);
}
// QString QHostInfo::localDomainName() defined in qnetworkinterface_win.cpp
diff --git a/src/network/kernel/qnetconmonitor_darwin.mm b/src/network/kernel/qnetconmonitor_darwin.mm
new file mode 100644
index 0000000000..f6daf9ed50
--- /dev/null
+++ b/src/network/kernel/qnetconmonitor_darwin.mm
@@ -0,0 +1,419 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "private/qnativesocketengine_p.h"
+#include "private/qnetconmonitor_p.h"
+
+#include "private/qobject_p.h"
+
+#include <SystemConfiguration/SystemConfiguration.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+#include <netinet/in.h>
+
+#include <cstring>
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcNetMon, "qt.network.monitor");
+
+namespace {
+
+class ReachabilityDispatchQueue
+{
+public:
+ ReachabilityDispatchQueue()
+ {
+ queue = dispatch_queue_create("qt-network-reachability-queue", nullptr);
+ if (!queue)
+ qCWarning(lcNetMon, "Failed to create a dispatch queue for reachability probes");
+ }
+
+ ~ReachabilityDispatchQueue()
+ {
+ if (queue)
+ dispatch_release(queue);
+ }
+
+ dispatch_queue_t data() const
+ {
+ return queue;
+ }
+
+private:
+ dispatch_queue_t queue = nullptr;
+
+ Q_DISABLE_COPY_MOVE(ReachabilityDispatchQueue)
+};
+
+dispatch_queue_t qt_reachability_queue()
+{
+ static const ReachabilityDispatchQueue reachabilityQueue;
+ return reachabilityQueue.data();
+}
+
+qt_sockaddr qt_hostaddress_to_sockaddr(const QHostAddress &src)
+{
+ if (src.isNull())
+ return {};
+
+ qt_sockaddr dst;
+ if (src.protocol() == QAbstractSocket::IPv4Protocol) {
+ dst.a4 = sockaddr_in{};
+ dst.a4.sin_family = AF_INET;
+ dst.a4.sin_addr.s_addr = htonl(src.toIPv4Address());
+ dst.a4.sin_len = sizeof(sockaddr_in);
+ } else if (src.protocol() == QAbstractSocket::IPv6Protocol) {
+ dst.a6 = sockaddr_in6{};
+ dst.a6.sin6_family = AF_INET6;
+ dst.a6.sin6_len = sizeof(sockaddr_in6);
+ const Q_IPV6ADDR ipv6 = src.toIPv6Address();
+ std::memcpy(&dst.a6.sin6_addr, &ipv6, sizeof ipv6);
+ } else {
+ Q_UNREACHABLE();
+ }
+
+ return dst;
+}
+
+} // unnamed namespace
+
+class QNetworkConnectionMonitorPrivate : public QObjectPrivate
+{
+public:
+ SCNetworkReachabilityRef probe = nullptr;
+ SCNetworkReachabilityFlags state = kSCNetworkReachabilityFlagsIsLocalAddress;
+ bool scheduled = false;
+
+ void updateState(SCNetworkReachabilityFlags newState);
+ void reset();
+ bool isReachable() const;
+
+ static void probeCallback(SCNetworkReachabilityRef probe, SCNetworkReachabilityFlags flags, void *info);
+
+ Q_DECLARE_PUBLIC(QNetworkConnectionMonitor)
+};
+
+void QNetworkConnectionMonitorPrivate::updateState(SCNetworkReachabilityFlags newState)
+{
+ // To be executed only on the reachability queue.
+ Q_Q(QNetworkConnectionMonitor);
+
+ // NETMONTODO: for now, 'online' for us means kSCNetworkReachabilityFlagsReachable
+ // is set. There are more possible flags that require more tests/some special
+ // setup. So in future this part and related can change/be extended.
+ const bool wasReachable = isReachable();
+ state = newState;
+ if (wasReachable != isReachable())
+ emit q->reachabilityChanged(isReachable());
+}
+
+void QNetworkConnectionMonitorPrivate::reset()
+{
+ if (probe) {
+ CFRelease(probe);
+ probe = nullptr;
+ }
+
+ state = kSCNetworkReachabilityFlagsIsLocalAddress;
+ scheduled = false;
+}
+
+bool QNetworkConnectionMonitorPrivate::isReachable() const
+{
+ return !!(state & kSCNetworkReachabilityFlagsReachable);
+}
+
+void QNetworkConnectionMonitorPrivate::probeCallback(SCNetworkReachabilityRef probe, SCNetworkReachabilityFlags flags, void *info)
+{
+ // To be executed only on the reachability queue.
+ Q_UNUSED(probe);
+
+ auto monitorPrivate = static_cast<QNetworkConnectionMonitorPrivate *>(info);
+ Q_ASSERT(monitorPrivate);
+ monitorPrivate->updateState(flags);
+}
+
+QNetworkConnectionMonitor::QNetworkConnectionMonitor()
+ : QObject(*new QNetworkConnectionMonitorPrivate)
+{
+}
+
+QNetworkConnectionMonitor::QNetworkConnectionMonitor(const QHostAddress &local, const QHostAddress &remote)
+ : QObject(*new QNetworkConnectionMonitorPrivate)
+{
+ setTargets(local, remote);
+}
+
+QNetworkConnectionMonitor::~QNetworkConnectionMonitor()
+{
+ Q_D(QNetworkConnectionMonitor);
+
+ stopMonitoring();
+ d->reset();
+}
+
+bool QNetworkConnectionMonitor::setTargets(const QHostAddress &local, const QHostAddress &remote)
+{
+ Q_D(QNetworkConnectionMonitor);
+
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Monitor is already active, call stopMonitoring() first");
+ return false;
+ }
+
+ if (local.isNull()) {
+ qCWarning(lcNetMon, "Invalid (null) local address, cannot create a reachability target");
+ return false;
+ }
+
+ // Clear the old target if needed:
+ d->reset();
+
+ qt_sockaddr client = qt_hostaddress_to_sockaddr(local);
+ if (remote.isNull()) {
+ // That's a special case our QNetworkStatusMonitor is using (AnyIpv4/6 address to check an overall status).
+ d->probe = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, reinterpret_cast<sockaddr *>(&client));
+ } else {
+ qt_sockaddr target = qt_hostaddress_to_sockaddr(remote);
+ d->probe = SCNetworkReachabilityCreateWithAddressPair(kCFAllocatorDefault,
+ reinterpret_cast<sockaddr *>(&client),
+ reinterpret_cast<sockaddr *>(&target));
+ }
+
+ if (d->probe) {
+ // Let's read the initial state so that callback coming later can
+ // see a difference. Ignore errors though.
+ SCNetworkReachabilityGetFlags(d->probe, &d->state);
+ }else {
+ qCWarning(lcNetMon, "Failed to create network reachability probe");
+ return false;
+ }
+
+ return true;
+}
+
+bool QNetworkConnectionMonitor::startMonitoring()
+{
+ Q_D(QNetworkConnectionMonitor);
+
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Monitor is already active, call stopMonitoring() first");
+ return false;
+ }
+
+ if (!d->probe) {
+ qCWarning(lcNetMon, "Can not start monitoring, set targets first");
+ return false;
+ }
+
+ auto queue = qt_reachability_queue();
+ if (!queue) {
+ qWarning(lcNetMon, "Failed to create a dispatch queue to schedule a probe on");
+ return false;
+ }
+
+ SCNetworkReachabilityContext context = {};
+ context.info = d;
+ if (!SCNetworkReachabilitySetCallback(d->probe, QNetworkConnectionMonitorPrivate::probeCallback, &context)) {
+ qWarning(lcNetMon, "Failed to set a reachability callback");
+ return false;
+ }
+
+
+ if (!SCNetworkReachabilitySetDispatchQueue(d->probe, queue)) {
+ qWarning(lcNetMon, "Failed to schedule a reachability callback on a queue");
+ return false;
+ }
+
+ return d->scheduled = true;
+}
+
+bool QNetworkConnectionMonitor::isMonitoring() const
+{
+ Q_D(const QNetworkConnectionMonitor);
+
+ return d->scheduled;
+}
+
+void QNetworkConnectionMonitor::stopMonitoring()
+{
+ Q_D(QNetworkConnectionMonitor);
+
+ if (d->scheduled) {
+ Q_ASSERT(d->probe);
+ SCNetworkReachabilitySetDispatchQueue(d->probe, nullptr);
+ SCNetworkReachabilitySetCallback(d->probe, nullptr, nullptr);
+ d->scheduled = false;
+ }
+}
+
+bool QNetworkConnectionMonitor::isReachable()
+{
+ Q_D(QNetworkConnectionMonitor);
+
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Calling isReachable() is unsafe after the monitoring started");
+ return false;
+ }
+
+ if (!d->probe) {
+ qCWarning(lcNetMon, "Reachability is unknown, set the target first");
+ return false;
+ }
+
+ return d->isReachable();
+}
+
+class QNetworkStatusMonitorPrivate : public QObjectPrivate
+{
+public:
+ QNetworkConnectionMonitor ipv4Probe;
+ bool isOnlineIpv4 = false;
+ QNetworkConnectionMonitor ipv6Probe;
+ bool isOnlineIpv6 = false;
+};
+
+QNetworkStatusMonitor::QNetworkStatusMonitor()
+ : QObject(*new QNetworkStatusMonitorPrivate)
+{
+ Q_D(QNetworkStatusMonitor);
+
+ if (d->ipv4Probe.setTargets(QHostAddress::AnyIPv4, {})) {
+ // We manage to create SCNetworkReachabilityRef for IPv4, let's
+ // read the last known state then!
+ d->isOnlineIpv4 = d->ipv4Probe.isReachable();
+ }
+
+ if (d->ipv6Probe.setTargets(QHostAddress::AnyIPv6, {})) {
+ // We manage to create SCNetworkReachability ref for IPv6, let's
+ // read the last known state then!
+ d->isOnlineIpv6 = d->ipv6Probe.isReachable();
+ }
+
+
+ connect(&d->ipv4Probe, &QNetworkConnectionMonitor::reachabilityChanged, this,
+ &QNetworkStatusMonitor::reachabilityChanged, Qt::QueuedConnection);
+ connect(&d->ipv6Probe, &QNetworkConnectionMonitor::reachabilityChanged, this,
+ &QNetworkStatusMonitor::reachabilityChanged, Qt::QueuedConnection);
+}
+
+QNetworkStatusMonitor::~QNetworkStatusMonitor()
+{
+ Q_D(QNetworkStatusMonitor);
+
+ d->ipv4Probe.disconnect();
+ d->ipv4Probe.stopMonitoring();
+ d->ipv6Probe.disconnect();
+ d->ipv6Probe.stopMonitoring();
+}
+
+bool QNetworkStatusMonitor::start()
+{
+ Q_D(QNetworkStatusMonitor);
+
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Network status monitor is already active");
+ return true;
+ }
+
+ d->ipv4Probe.startMonitoring();
+ d->ipv6Probe.startMonitoring();
+
+ return isMonitoring();
+}
+
+void QNetworkStatusMonitor::stop()
+{
+ Q_D(QNetworkStatusMonitor);
+
+ if (d->ipv4Probe.isMonitoring())
+ d->ipv4Probe.stopMonitoring();
+ if (d->ipv6Probe.isMonitoring())
+ d->ipv6Probe.stopMonitoring();
+}
+
+bool QNetworkStatusMonitor::isMonitoring() const
+{
+ Q_D(const QNetworkStatusMonitor);
+
+ return d->ipv4Probe.isMonitoring() || d->ipv6Probe.isMonitoring();
+}
+
+bool QNetworkStatusMonitor::isNetworkAccessible()
+{
+ // This function is to be executed on the thread that created
+ // and uses 'this'.
+ Q_D(QNetworkStatusMonitor);
+
+ return d->isOnlineIpv4 || d->isOnlineIpv6;
+}
+
+bool QNetworkStatusMonitor::isEnabled()
+{
+ return true;
+}
+
+void QNetworkStatusMonitor::reachabilityChanged(bool online)
+{
+ // This function is executed on the thread that created/uses 'this',
+ // not on the reachability queue.
+ Q_D(QNetworkStatusMonitor);
+
+ auto probe = qobject_cast<QNetworkConnectionMonitor *>(sender());
+ if (!probe)
+ return;
+
+ const bool isIpv4 = probe == &d->ipv4Probe;
+ bool &probeOnline = isIpv4 ? d->isOnlineIpv4 : d->isOnlineIpv6;
+ bool otherOnline = isIpv4 ? d->isOnlineIpv6 : d->isOnlineIpv4;
+
+ if (probeOnline == online) {
+ // We knew this already?
+ return;
+ }
+
+ probeOnline = online;
+ if (!otherOnline) {
+ // We either just lost or got a network access.
+ emit onlineStateChanged(probeOnline);
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/kernel/qnetconmonitor_p.h b/src/network/kernel/qnetconmonitor_p.h
new file mode 100644
index 0000000000..282bac5081
--- /dev/null
+++ b/src/network/kernel/qnetconmonitor_p.h
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QNETCONMONITOR_P_H
+#define QNETCONMONITOR_P_H
+
+#include <private/qtnetworkglobal_p.h>
+
+#include <QtCore/qloggingcategory.h>
+#include <QtNetwork/qhostaddress.h>
+#include <QtCore/qglobal.h>
+#include <QtCore/qobject.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_BEGIN_NAMESPACE
+
+class QNetworkConnectionMonitorPrivate;
+class Q_AUTOTEST_EXPORT QNetworkConnectionMonitor : public QObject
+{
+ Q_OBJECT
+
+public:
+ QNetworkConnectionMonitor();
+ QNetworkConnectionMonitor(const QHostAddress &local, const QHostAddress &remote = {});
+ ~QNetworkConnectionMonitor();
+
+ bool setTargets(const QHostAddress &local, const QHostAddress &remote);
+ bool isReachable();
+
+ // Important: on Darwin you should not call isReachable() after
+ // startMonitoring(), you have to listen to reachabilityChanged()
+ // signal instead.
+ bool startMonitoring();
+ bool isMonitoring() const;
+ void stopMonitoring();
+
+Q_SIGNALS:
+ // Important: connect to this using QueuedConnection. On Darwin
+ // callback is coming on a special dispatch queue.
+ void reachabilityChanged(bool isOnline);
+
+private:
+ Q_DECLARE_PRIVATE(QNetworkConnectionMonitor)
+ Q_DISABLE_COPY_MOVE(QNetworkConnectionMonitor)
+};
+
+class QNetworkStatusMonitorPrivate;
+class Q_AUTOTEST_EXPORT QNetworkStatusMonitor : public QObject
+{
+ Q_OBJECT
+
+public:
+ QNetworkStatusMonitor();
+ ~QNetworkStatusMonitor();
+
+ bool isNetworkAccessible();
+
+ bool start();
+ void stop();
+ bool isMonitoring() const;
+
+ static bool isEnabled();
+
+Q_SIGNALS:
+ // Unlike QNetworkConnectionMonitor, this can be connected to directly.
+ void onlineStateChanged(bool isOnline);
+
+private slots:
+ void reachabilityChanged(bool isOnline);
+
+private:
+ Q_DECLARE_PRIVATE(QNetworkStatusMonitor)
+ Q_DISABLE_COPY_MOVE(QNetworkStatusMonitor)
+};
+
+Q_DECLARE_LOGGING_CATEGORY(lcNetMon)
+
+QT_END_NAMESPACE
+
+#endif // QNETCONMONITOR_P_H
diff --git a/src/network/kernel/qnetconmonitor_stub.cpp b/src/network/kernel/qnetconmonitor_stub.cpp
new file mode 100644
index 0000000000..1ad4e9ba5a
--- /dev/null
+++ b/src/network/kernel/qnetconmonitor_stub.cpp
@@ -0,0 +1,141 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qnetconmonitor_p.h"
+
+#include "private/qobject_p.h"
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcNetMon, "qt.network.monitor");
+
+// Note: this 'stub' version is never enabled (see QNetworkStatusMonitor::isEnabled below)
+// and thus should never affect QNAM in any unusuall way. Having this 'stub' version is similar
+// to building Qt with bearer management configured out.
+
+class QNetworkConnectionMonitorPrivate : public QObjectPrivate
+{
+};
+
+QNetworkConnectionMonitor::QNetworkConnectionMonitor()
+ : QObject(*new QNetworkConnectionMonitorPrivate)
+{
+}
+
+QNetworkConnectionMonitor::QNetworkConnectionMonitor(const QHostAddress &local, const QHostAddress &remote)
+ : QObject(*new QNetworkConnectionMonitorPrivate)
+{
+ Q_UNUSED(local)
+ Q_UNUSED(remote)
+}
+
+QNetworkConnectionMonitor::~QNetworkConnectionMonitor()
+{
+}
+
+bool QNetworkConnectionMonitor::setTargets(const QHostAddress &local, const QHostAddress &remote)
+{
+ Q_UNUSED(local)
+ Q_UNUSED(remote)
+
+ return false;
+}
+
+bool QNetworkConnectionMonitor::startMonitoring()
+{
+ return false;
+}
+
+bool QNetworkConnectionMonitor::isMonitoring() const
+{
+ return false;
+}
+
+void QNetworkConnectionMonitor::stopMonitoring()
+{
+}
+
+bool QNetworkConnectionMonitor::isReachable()
+{
+ return false;
+}
+
+class QNetworkStatusMonitorPrivate : public QObjectPrivate
+{
+};
+
+QNetworkStatusMonitor::QNetworkStatusMonitor()
+ : QObject(*new QNetworkStatusMonitorPrivate)
+{
+}
+
+QNetworkStatusMonitor::~QNetworkStatusMonitor()
+{
+}
+
+bool QNetworkStatusMonitor::start()
+{
+ return false;
+}
+
+void QNetworkStatusMonitor::stop()
+{
+}
+
+bool QNetworkStatusMonitor::isMonitoring() const
+{
+ return false;
+}
+
+bool QNetworkStatusMonitor::isNetworkAccessible()
+{
+ return false;
+}
+
+bool QNetworkStatusMonitor::isEnabled()
+{
+ return false;
+}
+
+void QNetworkStatusMonitor::reachabilityChanged(bool online)
+{
+ Q_UNUSED(online)
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/kernel/qnetconmonitor_win.cpp b/src/network/kernel/qnetconmonitor_win.cpp
new file mode 100644
index 0000000000..1566e7f914
--- /dev/null
+++ b/src/network/kernel/qnetconmonitor_win.cpp
@@ -0,0 +1,712 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qnetconmonitor_p.h"
+
+#include "private/qobject_p.h"
+
+#include <QtCore/quuid.h>
+#include <QtCore/qmetaobject.h>
+
+#include <QtNetwork/qnetworkinterface.h>
+
+#include <objbase.h>
+#include <netlistmgr.h>
+#include <wrl/client.h>
+#include <wrl/wrappers/corewrappers.h>
+#include <comdef.h>
+#include <iphlpapi.h>
+
+#include <algorithm>
+
+using namespace Microsoft::WRL;
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(lcNetMon, "qt.network.monitor");
+
+namespace {
+QString errorStringFromHResult(HRESULT hr)
+{
+ _com_error error(hr);
+ return QString::fromWCharArray(error.ErrorMessage());
+}
+
+template<typename T>
+bool QueryInterfaceImpl(IUnknown *from, REFIID riid, void **ppvObject)
+{
+ if (riid == __uuidof(T)) {
+ *ppvObject = static_cast<T *>(from);
+ from->AddRef();
+ return true;
+ }
+ return false;
+}
+
+QNetworkInterface getInterfaceFromHostAddress(const QHostAddress &local)
+{
+ QList<QNetworkInterface> interfaces = QNetworkInterface::allInterfaces();
+ auto it = std::find_if(
+ interfaces.cbegin(), interfaces.cend(), [&local](const QNetworkInterface &iface) {
+ const auto &entries = iface.addressEntries();
+ return std::any_of(entries.cbegin(), entries.cend(),
+ [&local](const QNetworkAddressEntry &entry) {
+ return entry.ip().isEqual(local,
+ QHostAddress::TolerantConversion);
+ });
+ });
+ if (it == interfaces.cend()) {
+ qCWarning(lcNetMon, "Could not find the interface for the local address.");
+ return {};
+ }
+ return *it;
+}
+} // anonymous namespace
+
+class QNetworkConnectionEvents : public INetworkConnectionEvents
+{
+public:
+ QNetworkConnectionEvents(QNetworkConnectionMonitorPrivate *monitor);
+ virtual ~QNetworkConnectionEvents();
+
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) override;
+
+ ULONG STDMETHODCALLTYPE AddRef() override { return ++ref; }
+ ULONG STDMETHODCALLTYPE Release() override
+ {
+ if (--ref == 0) {
+ delete this;
+ return 0;
+ }
+ return ref;
+ }
+
+ HRESULT STDMETHODCALLTYPE
+ NetworkConnectionConnectivityChanged(GUID connectionId, NLM_CONNECTIVITY connectivity) override;
+ HRESULT STDMETHODCALLTYPE NetworkConnectionPropertyChanged(
+ GUID connectionId, NLM_CONNECTION_PROPERTY_CHANGE flags) override;
+
+ Q_REQUIRED_RESULT
+ bool setTarget(const QNetworkInterface &iface);
+ Q_REQUIRED_RESULT
+ bool startMonitoring();
+ Q_REQUIRED_RESULT
+ bool stopMonitoring();
+
+private:
+ ComPtr<INetworkConnection> getNetworkConnectionFromAdapterGuid(QUuid guid);
+
+ QUuid currentConnectionId{};
+
+ ComPtr<INetworkListManager> networkListManager;
+ ComPtr<IConnectionPoint> connectionPoint;
+
+ QNetworkConnectionMonitorPrivate *monitor = nullptr;
+
+ QAtomicInteger<ULONG> ref = 0;
+ DWORD cookie = 0;
+};
+
+class QNetworkConnectionMonitorPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QNetworkConnectionMonitor);
+
+public:
+ QNetworkConnectionMonitorPrivate();
+ ~QNetworkConnectionMonitorPrivate();
+
+ Q_REQUIRED_RESULT
+ bool setTargets(const QHostAddress &local, const QHostAddress &remote);
+ Q_REQUIRED_RESULT
+ bool startMonitoring();
+ void stopMonitoring();
+
+ void setConnectivity(NLM_CONNECTIVITY newConnectivity);
+
+private:
+ ComPtr<QNetworkConnectionEvents> connectionEvents;
+ // We can assume we have access to internet/subnet when this class is created because
+ // connection has already been established to the peer:
+ NLM_CONNECTIVITY connectivity =
+ NLM_CONNECTIVITY(NLM_CONNECTIVITY_IPV4_INTERNET | NLM_CONNECTIVITY_IPV6_INTERNET
+ | NLM_CONNECTIVITY_IPV4_SUBNET | NLM_CONNECTIVITY_IPV6_SUBNET);
+
+ bool sameSubnet = false;
+ bool monitoring = false;
+ bool comInitFailed = false;
+ bool remoteIsIPv6 = false;
+};
+
+QNetworkConnectionEvents::QNetworkConnectionEvents(QNetworkConnectionMonitorPrivate *monitor)
+ : monitor(monitor)
+{
+ auto hr = CoCreateInstance(CLSID_NetworkListManager, nullptr, CLSCTX_INPROC_SERVER,
+ IID_INetworkListManager, &networkListManager);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Could not get a NetworkListManager instance:"
+ << errorStringFromHResult(hr);
+ return;
+ }
+
+ ComPtr<IConnectionPointContainer> connectionPointContainer;
+ hr = networkListManager.As(&connectionPointContainer);
+ if (SUCCEEDED(hr)) {
+ hr = connectionPointContainer->FindConnectionPoint(IID_INetworkConnectionEvents,
+ &connectionPoint);
+ }
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to get connection point for network events:"
+ << errorStringFromHResult(hr);
+ }
+}
+
+QNetworkConnectionEvents::~QNetworkConnectionEvents()
+{
+ Q_ASSERT(ref == 0);
+}
+
+ComPtr<INetworkConnection> QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid(QUuid guid)
+{
+ ComPtr<IEnumNetworkConnections> connections;
+ auto hr = networkListManager->GetNetworkConnections(connections.GetAddressOf());
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to enumerate network connections:"
+ << errorStringFromHResult(hr);
+ return nullptr;
+ }
+ ComPtr<INetworkConnection> connection = nullptr;
+ do {
+ hr = connections->Next(1, connection.GetAddressOf(), nullptr);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to get next network connection in enumeration:"
+ << errorStringFromHResult(hr);
+ break;
+ }
+ if (connection) {
+ GUID adapterId;
+ hr = connection->GetAdapterId(&adapterId);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to get adapter ID from network connection:"
+ << errorStringFromHResult(hr);
+ continue;
+ }
+ if (guid == adapterId)
+ return connection;
+ }
+ } while (connection);
+ return nullptr;
+}
+
+HRESULT STDMETHODCALLTYPE QNetworkConnectionEvents::QueryInterface(REFIID riid, void **ppvObject)
+{
+ if (!ppvObject)
+ return E_INVALIDARG;
+
+ return QueryInterfaceImpl<IUnknown>(this, riid, ppvObject)
+ || QueryInterfaceImpl<INetworkConnectionEvents>(this, riid, ppvObject)
+ ? S_OK
+ : E_NOINTERFACE;
+}
+
+HRESULT STDMETHODCALLTYPE QNetworkConnectionEvents::NetworkConnectionConnectivityChanged(
+ GUID connectionId, NLM_CONNECTIVITY newConnectivity)
+{
+ // This function is run on a different thread than 'monitor' is created on, so we need to run
+ // it on that thread
+ QMetaObject::invokeMethod(monitor->q_ptr,
+ [this, connectionId, newConnectivity, monitor = this->monitor]() {
+ if (connectionId == currentConnectionId)
+ monitor->setConnectivity(newConnectivity);
+ },
+ Qt::QueuedConnection);
+ return S_OK;
+}
+
+HRESULT STDMETHODCALLTYPE QNetworkConnectionEvents::NetworkConnectionPropertyChanged(
+ GUID connectionId, NLM_CONNECTION_PROPERTY_CHANGE flags)
+{
+ Q_UNUSED(connectionId);
+ Q_UNUSED(flags);
+ return E_NOTIMPL;
+}
+
+bool QNetworkConnectionEvents::setTarget(const QNetworkInterface &iface)
+{
+ // Unset this in case it's already set to something
+ currentConnectionId = QUuid{};
+
+ NET_LUID luid;
+ if (ConvertInterfaceIndexToLuid(iface.index(), &luid) != NO_ERROR) {
+ qCWarning(lcNetMon, "Could not get the LUID for the interface.");
+ return false;
+ }
+ GUID guid;
+ if (ConvertInterfaceLuidToGuid(&luid, &guid) != NO_ERROR) {
+ qCWarning(lcNetMon, "Could not get the GUID for the interface.");
+ return false;
+ }
+ ComPtr<INetworkConnection> connection = getNetworkConnectionFromAdapterGuid(guid);
+ if (!connection) {
+ qCWarning(lcNetMon, "Could not get the INetworkConnection instance for the adapter GUID.");
+ return false;
+ }
+ auto hr = connection->GetConnectionId(&guid);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to get the connection's GUID:" << errorStringFromHResult(hr);
+ return false;
+ }
+ currentConnectionId = guid;
+
+ return true;
+}
+
+bool QNetworkConnectionEvents::startMonitoring()
+{
+ if (currentConnectionId.isNull()) {
+ qCWarning(lcNetMon, "Can not start monitoring, set targets first");
+ return false;
+ }
+ if (!connectionPoint) {
+ qCWarning(lcNetMon,
+ "We don't have the connection point, cannot start listening to events!");
+ return false;
+ }
+
+ auto hr = connectionPoint->Advise(this, &cookie);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to subscribe to network connectivity events:"
+ << errorStringFromHResult(hr);
+ return false;
+ }
+ return true;
+}
+
+bool QNetworkConnectionEvents::stopMonitoring()
+{
+ auto hr = connectionPoint->Unadvise(cookie);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to unsubscribe from network connection events:"
+ << errorStringFromHResult(hr);
+ return false;
+ }
+ cookie = 0;
+ currentConnectionId = QUuid{};
+ return true;
+}
+
+QNetworkConnectionMonitorPrivate::QNetworkConnectionMonitorPrivate()
+{
+ auto hr = CoInitialize(nullptr);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to initialize COM:" << errorStringFromHResult(hr);
+ comInitFailed = true;
+ return;
+ }
+
+ connectionEvents = new QNetworkConnectionEvents(this);
+}
+
+QNetworkConnectionMonitorPrivate::~QNetworkConnectionMonitorPrivate()
+{
+ if (comInitFailed)
+ return;
+ if (monitoring)
+ stopMonitoring();
+ connectionEvents.Reset();
+ CoUninitialize();
+}
+
+bool QNetworkConnectionMonitorPrivate::setTargets(const QHostAddress &local,
+ const QHostAddress &remote)
+{
+ if (comInitFailed)
+ return false;
+
+ QNetworkInterface iface = getInterfaceFromHostAddress(local);
+ if (!iface.isValid())
+ return false;
+ const auto &addressEntries = iface.addressEntries();
+ auto it = std::find_if(
+ addressEntries.cbegin(), addressEntries.cend(),
+ [&local](const QNetworkAddressEntry &entry) { return entry.ip() == local; });
+ if (Q_UNLIKELY(it == addressEntries.cend())) {
+ qCWarning(lcNetMon, "The address entry we were working with disappeared");
+ return false;
+ }
+ sameSubnet = remote.isInSubnet(local, it->prefixLength());
+ remoteIsIPv6 = remote.protocol() == QAbstractSocket::IPv6Protocol;
+
+ return connectionEvents->setTarget(iface);
+}
+
+void QNetworkConnectionMonitorPrivate::setConnectivity(NLM_CONNECTIVITY newConnectivity)
+{
+ Q_Q(QNetworkConnectionMonitor);
+ const bool reachable = q->isReachable();
+ connectivity = newConnectivity;
+ const bool newReachable = q->isReachable();
+ if (reachable != newReachable)
+ emit q->reachabilityChanged(newReachable);
+}
+
+bool QNetworkConnectionMonitorPrivate::startMonitoring()
+{
+ Q_ASSERT(connectionEvents);
+ Q_ASSERT(!monitoring);
+ if (connectionEvents->startMonitoring())
+ monitoring = true;
+ return monitoring;
+}
+
+void QNetworkConnectionMonitorPrivate::stopMonitoring()
+{
+ Q_ASSERT(connectionEvents);
+ Q_ASSERT(monitoring);
+ if (connectionEvents->stopMonitoring())
+ monitoring = false;
+}
+
+QNetworkConnectionMonitor::QNetworkConnectionMonitor()
+ : QObject(*new QNetworkConnectionMonitorPrivate)
+{
+}
+
+QNetworkConnectionMonitor::QNetworkConnectionMonitor(const QHostAddress &local,
+ const QHostAddress &remote)
+ : QObject(*new QNetworkConnectionMonitorPrivate)
+{
+ setTargets(local, remote);
+}
+
+QNetworkConnectionMonitor::~QNetworkConnectionMonitor() = default;
+
+bool QNetworkConnectionMonitor::setTargets(const QHostAddress &local, const QHostAddress &remote)
+{
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Monitor is already active, call stopMonitoring() first");
+ return false;
+ }
+ if (local.isNull()) {
+ qCWarning(lcNetMon, "Invalid (null) local address, cannot create a reachability target");
+ return false;
+ }
+ // Silently return false for loopback addresses instead of printing warnings later
+ if (remote.isLoopback())
+ return false;
+
+ return d_func()->setTargets(local, remote);
+}
+
+bool QNetworkConnectionMonitor::startMonitoring()
+{
+ Q_D(QNetworkConnectionMonitor);
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Monitor is already active, call stopMonitoring() first");
+ return false;
+ }
+ return d->startMonitoring();
+}
+
+bool QNetworkConnectionMonitor::isMonitoring() const
+{
+ return d_func()->monitoring;
+}
+
+void QNetworkConnectionMonitor::stopMonitoring()
+{
+ Q_D(QNetworkConnectionMonitor);
+ if (!isMonitoring()) {
+ qCWarning(lcNetMon, "stopMonitoring was called when not monitoring!");
+ return;
+ }
+ d->stopMonitoring();
+}
+
+bool QNetworkConnectionMonitor::isReachable()
+{
+ Q_D(QNetworkConnectionMonitor);
+ NLM_CONNECTIVITY required = d->sameSubnet
+ ? (d->remoteIsIPv6 ? NLM_CONNECTIVITY_IPV6_SUBNET : NLM_CONNECTIVITY_IPV4_SUBNET)
+ : (d->remoteIsIPv6 ? NLM_CONNECTIVITY_IPV6_INTERNET : NLM_CONNECTIVITY_IPV4_INTERNET);
+ return d_func()->connectivity & required;
+}
+
+class QNetworkListManagerEvents : public INetworkListManagerEvents
+{
+public:
+ QNetworkListManagerEvents(QNetworkStatusMonitorPrivate *monitor);
+ virtual ~QNetworkListManagerEvents();
+
+ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject) override;
+
+ ULONG STDMETHODCALLTYPE AddRef() override { return ++ref; }
+ ULONG STDMETHODCALLTYPE Release() override
+ {
+ if (--ref == 0) {
+ delete this;
+ return 0;
+ }
+ return ref;
+ }
+
+ HRESULT STDMETHODCALLTYPE ConnectivityChanged(NLM_CONNECTIVITY newConnectivity) override;
+
+ Q_REQUIRED_RESULT
+ bool start();
+ Q_REQUIRED_RESULT
+ bool stop();
+
+private:
+ ComPtr<INetworkListManager> networkListManager = nullptr;
+ ComPtr<IConnectionPoint> connectionPoint = nullptr;
+
+ QNetworkStatusMonitorPrivate *monitor = nullptr;
+
+ QAtomicInteger<ULONG> ref = 0;
+ DWORD cookie = 0;
+};
+
+class QNetworkStatusMonitorPrivate : public QObjectPrivate
+{
+ Q_DECLARE_PUBLIC(QNetworkStatusMonitor);
+
+public:
+ QNetworkStatusMonitorPrivate();
+ ~QNetworkStatusMonitorPrivate();
+
+ Q_REQUIRED_RESULT
+ bool start();
+ void stop();
+
+ void setConnectivity(NLM_CONNECTIVITY newConnectivity);
+
+private:
+ friend class QNetworkListManagerEvents;
+
+ ComPtr<QNetworkListManagerEvents> managerEvents;
+ NLM_CONNECTIVITY connectivity = NLM_CONNECTIVITY_DISCONNECTED;
+
+ bool monitoring = false;
+ bool comInitFailed = false;
+};
+
+QNetworkListManagerEvents::QNetworkListManagerEvents(QNetworkStatusMonitorPrivate *monitor)
+ : monitor(monitor)
+{
+ auto hr = CoCreateInstance(CLSID_NetworkListManager, nullptr, CLSCTX_INPROC_SERVER,
+ IID_INetworkListManager, &networkListManager);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Could not get a NetworkListManager instance:"
+ << errorStringFromHResult(hr);
+ return;
+ }
+
+ // Set initial connectivity
+ hr = networkListManager->GetConnectivity(&monitor->connectivity);
+ if (FAILED(hr))
+ qCWarning(lcNetMon) << "Could not get connectivity:" << errorStringFromHResult(hr);
+
+ ComPtr<IConnectionPointContainer> connectionPointContainer;
+ hr = networkListManager.As(&connectionPointContainer);
+ if (SUCCEEDED(hr)) {
+ hr = connectionPointContainer->FindConnectionPoint(IID_INetworkListManagerEvents,
+ &connectionPoint);
+ }
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to get connection point for network list manager events:"
+ << errorStringFromHResult(hr);
+ }
+}
+
+QNetworkListManagerEvents::~QNetworkListManagerEvents()
+{
+ Q_ASSERT(ref == 0);
+}
+
+HRESULT STDMETHODCALLTYPE QNetworkListManagerEvents::QueryInterface(REFIID riid, void **ppvObject)
+{
+ if (!ppvObject)
+ return E_INVALIDARG;
+
+ return QueryInterfaceImpl<IUnknown>(this, riid, ppvObject)
+ || QueryInterfaceImpl<INetworkListManagerEvents>(this, riid, ppvObject)
+ ? S_OK
+ : E_NOINTERFACE;
+}
+
+HRESULT STDMETHODCALLTYPE
+QNetworkListManagerEvents::ConnectivityChanged(NLM_CONNECTIVITY newConnectivity)
+{
+ // This function is run on a different thread than 'monitor' is created on, so we need to run
+ // it on that thread
+ QMetaObject::invokeMethod(monitor->q_ptr,
+ [newConnectivity, monitor = this->monitor]() {
+ monitor->setConnectivity(newConnectivity);
+ },
+ Qt::QueuedConnection);
+ return S_OK;
+}
+
+bool QNetworkListManagerEvents::start()
+{
+ if (!connectionPoint) {
+ qCWarning(lcNetMon, "Initialization failed, can't start!");
+ return false;
+ }
+ auto hr = connectionPoint->Advise(this, &cookie);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to subscribe to network connectivity events:"
+ << errorStringFromHResult(hr);
+ return false;
+ }
+ return true;
+}
+
+bool QNetworkListManagerEvents::stop()
+{
+ Q_ASSERT(connectionPoint);
+ auto hr = connectionPoint->Unadvise(cookie);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to unsubscribe from network connectivity events:"
+ << errorStringFromHResult(hr);
+ return false;
+ }
+ cookie = 0;
+ return true;
+}
+
+QNetworkStatusMonitorPrivate::QNetworkStatusMonitorPrivate()
+{
+ auto hr = CoInitialize(nullptr);
+ if (FAILED(hr)) {
+ qCWarning(lcNetMon) << "Failed to initialize COM:" << errorStringFromHResult(hr);
+ comInitFailed = true;
+ return;
+ }
+ managerEvents = new QNetworkListManagerEvents(this);
+}
+
+QNetworkStatusMonitorPrivate::~QNetworkStatusMonitorPrivate()
+{
+ if (comInitFailed)
+ return;
+ if (monitoring)
+ stop();
+ managerEvents.Reset();
+ CoUninitialize();
+}
+
+void QNetworkStatusMonitorPrivate::setConnectivity(NLM_CONNECTIVITY newConnectivity)
+{
+ Q_Q(QNetworkStatusMonitor);
+
+ const bool oldAccessibility = q->isNetworkAccessible();
+ connectivity = newConnectivity;
+ const bool accessibility = q->isNetworkAccessible();
+ if (oldAccessibility != accessibility)
+ emit q->onlineStateChanged(accessibility);
+}
+
+bool QNetworkStatusMonitorPrivate::start()
+{
+ if (comInitFailed)
+ return false;
+ Q_ASSERT(managerEvents);
+ Q_ASSERT(!monitoring);
+ if (managerEvents->start())
+ monitoring = true;
+ return monitoring;
+}
+
+void QNetworkStatusMonitorPrivate::stop()
+{
+ Q_ASSERT(managerEvents);
+ Q_ASSERT(monitoring);
+ if (managerEvents->stop())
+ monitoring = false;
+}
+
+QNetworkStatusMonitor::QNetworkStatusMonitor() : QObject(*new QNetworkStatusMonitorPrivate) {}
+
+QNetworkStatusMonitor::~QNetworkStatusMonitor() {}
+
+bool QNetworkStatusMonitor::start()
+{
+ if (isMonitoring()) {
+ qCWarning(lcNetMon, "Monitor is already active, call stopMonitoring() first");
+ return false;
+ }
+
+ return d_func()->start();
+}
+
+void QNetworkStatusMonitor::stop()
+{
+ if (!isMonitoring()) {
+ qCWarning(lcNetMon, "stopMonitoring was called when not monitoring!");
+ return;
+ }
+
+ d_func()->stop();
+}
+
+bool QNetworkStatusMonitor::isMonitoring() const
+{
+ return d_func()->monitoring;
+}
+
+bool QNetworkStatusMonitor::isNetworkAccessible()
+{
+ return d_func()->connectivity
+ & (NLM_CONNECTIVITY_IPV4_INTERNET | NLM_CONNECTIVITY_IPV6_INTERNET
+ | NLM_CONNECTIVITY_IPV4_SUBNET | NLM_CONNECTIVITY_IPV6_SUBNET);
+}
+
+bool QNetworkStatusMonitor::isEnabled()
+{
+ return true;
+}
+
+void QNetworkStatusMonitor::reachabilityChanged(bool online)
+{
+ Q_UNUSED(online);
+ Q_UNREACHABLE();
+}
+
+QT_END_NAMESPACE
diff --git a/src/network/kernel/qnetworkdatagram.h b/src/network/kernel/qnetworkdatagram.h
index 1acb44a1e0..70958fea42 100644
--- a/src/network/kernel/qnetworkdatagram.h
+++ b/src/network/kernel/qnetworkdatagram.h
@@ -61,13 +61,13 @@ public:
~QNetworkDatagram()
{ if (d) destroy(d); }
- QNetworkDatagram(QNetworkDatagram &&other) Q_DECL_NOTHROW
+ QNetworkDatagram(QNetworkDatagram &&other) noexcept
: d(other.d)
{ other.d = nullptr; }
- QNetworkDatagram &operator=(QNetworkDatagram &&other) Q_DECL_NOTHROW
+ QNetworkDatagram &operator=(QNetworkDatagram &&other) noexcept
{ swap(other); return *this; }
- void swap(QNetworkDatagram &other) Q_DECL_NOTHROW
+ void swap(QNetworkDatagram &other) noexcept
{ qSwap(d, other.d); }
void clear();
diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h
index 148fd5e10d..4caedaa38f 100644
--- a/src/network/kernel/qnetworkinterface.h
+++ b/src/network/kernel/qnetworkinterface.h
@@ -64,13 +64,11 @@ public:
QNetworkAddressEntry();
QNetworkAddressEntry(const QNetworkAddressEntry &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkAddressEntry &operator=(QNetworkAddressEntry &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkAddressEntry &operator=(QNetworkAddressEntry &&other) noexcept { swap(other); return *this; }
QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other);
~QNetworkAddressEntry();
- void swap(QNetworkAddressEntry &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkAddressEntry &other) noexcept { qSwap(d, other.d); }
bool operator==(const QNetworkAddressEntry &other) const;
inline bool operator!=(const QNetworkAddressEntry &other) const
@@ -142,13 +140,11 @@ public:
QNetworkInterface();
QNetworkInterface(const QNetworkInterface &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkInterface &operator=(QNetworkInterface &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkInterface &operator=(QNetworkInterface &&other) noexcept { swap(other); return *this; }
QNetworkInterface &operator=(const QNetworkInterface &other);
~QNetworkInterface();
- void swap(QNetworkInterface &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkInterface &other) noexcept { qSwap(d, other.d); }
bool isValid() const;
diff --git a/src/network/kernel/qnetworkinterface_p.h b/src/network/kernel/qnetworkinterface_p.h
index 87a46b75fa..44e27a7e34 100644
--- a/src/network/kernel/qnetworkinterface_p.h
+++ b/src/network/kernel/qnetworkinterface_p.h
@@ -82,7 +82,7 @@ public:
class QNetworkInterfacePrivate: public QSharedData
{
public:
- QNetworkInterfacePrivate() : index(0), flags(0)
+ QNetworkInterfacePrivate() : index(0), flags(nullptr)
{ }
~QNetworkInterfacePrivate()
{ }
diff --git a/src/network/kernel/qnetworkinterface_unix_p.h b/src/network/kernel/qnetworkinterface_unix_p.h
index c085194e3c..553af5a303 100644
--- a/src/network/kernel/qnetworkinterface_unix_p.h
+++ b/src/network/kernel/qnetworkinterface_unix_p.h
@@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE
static QNetworkInterface::InterfaceFlags convertFlags(uint rawFlags)
{
- QNetworkInterface::InterfaceFlags flags = 0;
+ QNetworkInterface::InterfaceFlags flags = nullptr;
flags |= (rawFlags & IFF_UP) ? QNetworkInterface::IsUp : QNetworkInterface::InterfaceFlag(0);
flags |= (rawFlags & IFF_RUNNING) ? QNetworkInterface::IsRunning : QNetworkInterface::InterfaceFlag(0);
flags |= (rawFlags & IFF_BROADCAST) ? QNetworkInterface::CanBroadcast : QNetworkInterface::InterfaceFlag(0);
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index febddfd880..a2a89ed94b 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -254,8 +254,7 @@ class QGlobalNetworkProxy
{
public:
QGlobalNetworkProxy()
- : mutex(QMutex::Recursive)
- , applicationLevelProxy(0)
+ : applicationLevelProxy(0)
, applicationLevelProxyFactory(0)
#if QT_CONFIG(socks5)
, socks5SocketEngineHandler(0)
@@ -338,7 +337,7 @@ public:
QList<QNetworkProxy> proxyForQuery(const QNetworkProxyQuery &query);
private:
- QMutex mutex;
+ QRecursiveMutex mutex;
QNetworkProxy *applicationLevelProxy;
QNetworkProxyFactory *applicationLevelProxyFactory;
#if QT_CONFIG(socks5)
@@ -483,7 +482,7 @@ public:
template<> void QSharedDataPointer<QNetworkProxyPrivate>::detach()
{
- if (d && d->ref.load() == 1)
+ if (d && d->ref.loadRelaxed() == 1)
return;
QNetworkProxyPrivate *x = (d ? new QNetworkProxyPrivate(*d)
: new QNetworkProxyPrivate);
@@ -927,7 +926,7 @@ public:
template<> void QSharedDataPointer<QNetworkProxyQueryPrivate>::detach()
{
- if (d && d->ref.load() == 1)
+ if (d && d->ref.loadRelaxed() == 1)
return;
QNetworkProxyQueryPrivate *x = (d ? new QNetworkProxyQueryPrivate(*d)
: new QNetworkProxyQueryPrivate);
diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h
index 7e3e6906a8..302a2ce6ca 100644
--- a/src/network/kernel/qnetworkproxy.h
+++ b/src/network/kernel/qnetworkproxy.h
@@ -89,13 +89,11 @@ public:
QueryType queryType = TcpServer);
#endif
QNetworkProxyQuery(const QNetworkProxyQuery &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkProxyQuery &operator=(QNetworkProxyQuery &&other) noexcept { swap(other); return *this; }
QNetworkProxyQuery &operator=(const QNetworkProxyQuery &other);
~QNetworkProxyQuery();
- void swap(QNetworkProxyQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkProxyQuery &other) noexcept { qSwap(d, other.d); }
bool operator==(const QNetworkProxyQuery &other) const;
inline bool operator!=(const QNetworkProxyQuery &other) const
@@ -161,13 +159,11 @@ public:
QNetworkProxy(ProxyType type, const QString &hostName = QString(), quint16 port = 0,
const QString &user = QString(), const QString &password = QString());
QNetworkProxy(const QNetworkProxy &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QNetworkProxy &operator=(QNetworkProxy &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QNetworkProxy &operator=(QNetworkProxy &&other) noexcept { swap(other); return *this; }
QNetworkProxy &operator=(const QNetworkProxy &other);
~QNetworkProxy();
- void swap(QNetworkProxy &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QNetworkProxy &other) noexcept { qSwap(d, other.d); }
bool operator==(const QNetworkProxy &other) const;
inline bool operator!=(const QNetworkProxy &other) const
diff --git a/src/network/network.pro b/src/network/network.pro
index 9082439f1c..d8453e879c 100644
--- a/src/network/network.pro
+++ b/src/network/network.pro
@@ -26,7 +26,7 @@ qtConfig(bearermanagement) {
ANDROID_BUNDLED_JAR_DEPENDENCIES = \
jar/QtAndroidBearer.jar
ANDROID_LIB_DEPENDENCIES = \
- plugins/bearer/libqandroidbearer.so
+ plugins/bearer/libplugins_bearer_qandroidbearer.so
MODULE_PLUGIN_TYPES = \
bearer
ANDROID_PERMISSIONS += \
diff --git a/src/network/socket/qabstractsocketengine_p.h b/src/network/socket/qabstractsocketengine_p.h
index 8eebb06a4d..112e7032d6 100644
--- a/src/network/socket/qabstractsocketengine_p.h
+++ b/src/network/socket/qabstractsocketengine_p.h
@@ -88,7 +88,7 @@ public:
static QAbstractSocketEngine *createSocketEngine(QAbstractSocket::SocketType socketType, const QNetworkProxy &, QObject *parent);
static QAbstractSocketEngine *createSocketEngine(qintptr socketDescriptor, QObject *parent);
- QAbstractSocketEngine(QObject *parent = 0);
+ QAbstractSocketEngine(QObject *parent = nullptr);
enum SocketOption {
NonBlockingSocketOption,
@@ -155,7 +155,7 @@ public:
virtual qint64 pendingDatagramSize() const = 0;
#endif // QT_NO_UDPSOCKET
- virtual qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader *header = 0,
+ virtual qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader *header = nullptr,
PacketHeaderOptions = WantNone) = 0;
virtual qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &header) = 0;
virtual qint64 bytesToWrite() const = 0;
@@ -163,11 +163,11 @@ public:
virtual int option(SocketOption option) const = 0;
virtual bool setOption(SocketOption option, int value) = 0;
- virtual bool waitForRead(int msecs = 30000, bool *timedOut = 0) = 0;
- virtual bool waitForWrite(int msecs = 30000, bool *timedOut = 0) = 0;
+ virtual bool waitForRead(int msecs = 30000, bool *timedOut = nullptr) = 0;
+ virtual bool waitForWrite(int msecs = 30000, bool *timedOut = nullptr) = 0;
virtual bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) = 0;
+ int msecs = 30000, bool *timedOut = nullptr) = 0;
QAbstractSocket::SocketError error() const;
QString errorString() const;
@@ -202,7 +202,7 @@ public Q_SLOTS:
public:
void setReceiver(QAbstractSocketEngineReceiver *receiver);
protected:
- QAbstractSocketEngine(QAbstractSocketEnginePrivate &dd, QObject* parent = 0);
+ QAbstractSocketEngine(QAbstractSocketEnginePrivate &dd, QObject* parent = nullptr);
void setError(QAbstractSocket::SocketError error, const QString &errorString) const;
void setState(QAbstractSocket::SocketState state);
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index bfde3870c4..c67b273937 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -524,7 +524,7 @@ void QHttpSocketEngine::slotSocketConnected()
//qDebug() << "slotSocketConnected: priv=" << priv << (priv ? (int)priv->method : -1);
if (priv && priv->method != QAuthenticatorPrivate::None) {
d->credentialsSent = true;
- data += "Proxy-Authorization: " + priv->calculateResponse(method, path);
+ data += "Proxy-Authorization: " + priv->calculateResponse(method, path, d->proxy.hostName());
data += "\r\n";
}
data += "\r\n";
diff --git a/src/network/socket/qhttpsocketengine_p.h b/src/network/socket/qhttpsocketengine_p.h
index bbcc09eee9..0c2c450c81 100644
--- a/src/network/socket/qhttpsocketengine_p.h
+++ b/src/network/socket/qhttpsocketengine_p.h
@@ -79,7 +79,7 @@ public:
ReadResponseContent,
ReadResponseHeader
};
- QHttpSocketEngine(QObject *parent = 0);
+ QHttpSocketEngine(QObject *parent = nullptr);
~QHttpSocketEngine();
bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
@@ -126,11 +126,11 @@ public:
int option(SocketOption option) const override;
bool setOption(SocketOption option, int value) override;
- bool waitForRead(int msecs = 30000, bool *timedOut = 0) override;
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0) override;
+ bool waitForRead(int msecs = 30000, bool *timedOut = nullptr) override;
+ bool waitForWrite(int msecs = 30000, bool *timedOut = nullptr) override;
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) override;
+ int msecs = 30000, bool *timedOut = nullptr) override;
bool isReadNotificationEnabled() const override;
void setReadNotificationEnabled(bool enable) override;
diff --git a/src/network/socket/qlocalserver_p.h b/src/network/socket/qlocalserver_p.h
index 2c073908cb..92616e59ce 100644
--- a/src/network/socket/qlocalserver_p.h
+++ b/src/network/socket/qlocalserver_p.h
@@ -78,7 +78,7 @@ class QLocalServerPrivate : public QObjectPrivate
public:
QLocalServerPrivate() :
#if !defined(QT_LOCALSOCKET_TCP) && !defined(Q_OS_WIN)
- listenSocket(-1), socketNotifier(0),
+ listenSocket(-1), socketNotifier(nullptr),
#endif
maxPendingConnections(30), error(QAbstractSocket::UnknownSocketError),
socketOptions(QLocalServer::NoOptions)
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 2292566265..e5f0701d14 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -125,7 +125,7 @@ class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine
{
Q_OBJECT
public:
- QNativeSocketEngine(QObject *parent = 0);
+ QNativeSocketEngine(QObject *parent = nullptr);
~QNativeSocketEngine();
bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
@@ -161,7 +161,7 @@ public:
qint64 pendingDatagramSize() const override;
#endif // QT_NO_UDPSOCKET
- qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
+ qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = nullptr,
PacketHeaderOptions = WantNone) override;
qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) override;
qint64 bytesToWrite() const override;
@@ -177,11 +177,11 @@ public:
int option(SocketOption option) const override;
bool setOption(SocketOption option, int value) override;
- bool waitForRead(int msecs = 30000, bool *timedOut = 0) override;
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0) override;
+ bool waitForRead(int msecs = 30000, bool *timedOut = nullptr) override;
+ bool waitForWrite(int msecs = 30000, bool *timedOut = nullptr) override;
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) override;
+ int msecs = 30000, bool *timedOut = nullptr) override;
bool isReadNotificationEnabled() const override;
void setReadNotificationEnabled(bool enable) override;
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 24c17124dc..3ca586e247 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -1000,8 +1000,11 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS
// parse the ancillary data
struct cmsghdr *cmsgptr;
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_CLANG("-Wsign-compare")
for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
+ QT_WARNING_POP
if (cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_PKTINFO
&& cmsgptr->cmsg_len >= CMSG_LEN(sizeof(in6_pktinfo))) {
in6_pktinfo *info = reinterpret_cast<in6_pktinfo *>(CMSG_DATA(cmsgptr));
diff --git a/src/network/socket/qsctpserver.cpp b/src/network/socket/qsctpserver.cpp
index 77cb997192..2aa694b3fd 100644
--- a/src/network/socket/qsctpserver.cpp
+++ b/src/network/socket/qsctpserver.cpp
@@ -229,13 +229,12 @@ QSctpSocket *QSctpServer::nextPendingDatagramConnection()
{
Q_D(QSctpServer);
- QMutableListIterator<QTcpSocket *> i(d->pendingConnections);
- while (i.hasNext()) {
- QSctpSocket *socket = qobject_cast<QSctpSocket *>(i.next());
+ for (auto it = d->pendingConnections.begin(), end = d->pendingConnections.end(); it != end; ++it) {
+ QSctpSocket *socket = qobject_cast<QSctpSocket *>(*it);
Q_ASSERT(socket);
if (socket->isInDatagramMode()) {
- i.remove();
+ d->pendingConnections.erase(it);
Q_ASSERT(d->socketEngine);
d->socketEngine->setReadNotificationEnabled(true);
return socket;
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index 18b3ce9db2..8a030601dc 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -322,8 +322,8 @@ public:
protected:
void timerEvent(QTimerEvent * event) override;
- QMutex mutex;
- int sweepTimerId;
+ QRecursiveMutex mutex;
+ int sweepTimerId = -1;
//socket descriptor, data, timestamp
QHash<int, QSocks5BindData *> store;
};
@@ -331,8 +331,6 @@ protected:
Q_GLOBAL_STATIC(QSocks5BindStore, socks5BindStore)
QSocks5BindStore::QSocks5BindStore()
- : mutex(QMutex::Recursive)
- , sweepTimerId(-1)
{
QCoreApplication *app = QCoreApplication::instance();
if (app && app->thread() != thread())
@@ -801,9 +799,9 @@ void QSocks5SocketEnginePrivate::sendRequestMethod()
QByteArray buf;
buf.reserve(270); // big enough for domain name;
- buf[0] = S5_VERSION_5;
- buf[1] = command;
- buf[2] = 0x00;
+ buf.append(char(S5_VERSION_5));
+ buf.append(command);
+ buf.append('\0');
if (peerName.isEmpty() && !qt_socks5_set_host_address_and_port(address, port, &buf)) {
QSOCKS5_DEBUG << "error setting address" << address << " : " << port;
//### set error code ....
diff --git a/src/network/socket/qsocks5socketengine_p.h b/src/network/socket/qsocks5socketengine_p.h
index ef9d771753..c256987e2d 100644
--- a/src/network/socket/qsocks5socketengine_p.h
+++ b/src/network/socket/qsocks5socketengine_p.h
@@ -65,7 +65,7 @@ class Q_AUTOTEST_EXPORT QSocks5SocketEngine : public QAbstractSocketEngine
{
Q_OBJECT
public:
- QSocks5SocketEngine(QObject *parent = 0);
+ QSocks5SocketEngine(QObject *parent = nullptr);
~QSocks5SocketEngine();
bool initialize(QAbstractSocket::SocketType type, QAbstractSocket::NetworkLayerProtocol protocol = QAbstractSocket::IPv4Protocol) override;
@@ -104,7 +104,7 @@ public:
qint64 pendingDatagramSize() const override;
#endif // QT_NO_UDPSOCKET
- qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = 0,
+ qint64 readDatagram(char *data, qint64 maxlen, QIpPacketHeader * = nullptr,
PacketHeaderOptions = WantNone) override;
qint64 writeDatagram(const char *data, qint64 len, const QIpPacketHeader &) override;
qint64 bytesToWrite() const override;
@@ -112,11 +112,11 @@ public:
int option(SocketOption option) const override;
bool setOption(SocketOption option, int value) override;
- bool waitForRead(int msecs = 30000, bool *timedOut = 0) override;
- bool waitForWrite(int msecs = 30000, bool *timedOut = 0) override;
+ bool waitForRead(int msecs = 30000, bool *timedOut = nullptr) override;
+ bool waitForWrite(int msecs = 30000, bool *timedOut = nullptr) override;
bool waitForReadOrWrite(bool *readyToRead, bool *readyToWrite,
bool checkRead, bool checkWrite,
- int msecs = 30000, bool *timedOut = 0) override;
+ int msecs = 30000, bool *timedOut = nullptr) override;
bool isReadNotificationEnabled() const override;
void setReadNotificationEnabled(bool enable) override;
diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri
index 44ff5b7b39..c3a98ea31a 100644
--- a/src/network/socket/socket.pri
+++ b/src/network/socket/socket.pri
@@ -58,7 +58,7 @@ unix {
msvc: QMAKE_MOC_OPTIONS += -D_WINSOCK_DEPRECATED_NO_WARNINGS
win32:!winrt:SOURCES += socket/qnativesocketengine_win.cpp
-win32:!winrt:LIBS_PRIVATE += -ladvapi32
+win32:!winrt: QMAKE_USE_PRIVATE += advapi32
winrt {
SOURCES += socket/qnativesocketengine_winrt.cpp
diff --git a/src/network/ssl/qasn1element_p.h b/src/network/ssl/qasn1element_p.h
index 22948e3ca5..020b5aa1af 100644
--- a/src/network/ssl/qasn1element_p.h
+++ b/src/network/ssl/qasn1element_p.h
@@ -156,10 +156,10 @@ public:
static QAsn1Element fromVector(const QVector<QAsn1Element> &items);
static QAsn1Element fromObjectId(const QByteArray &id);
- bool toBool(bool *ok = 0) const;
+ bool toBool(bool *ok = nullptr) const;
QDateTime toDateTime() const;
QMultiMap<QByteArray, QString> toInfo() const;
- qint64 toInteger(bool *ok = 0) const;
+ qint64 toInteger(bool *ok = nullptr) const;
QVector<QAsn1Element> toVector() const;
QByteArray toObjectId() const;
QByteArray toObjectName() const;
diff --git a/src/network/ssl/qdtls.cpp b/src/network/ssl/qdtls.cpp
index 3185bfa124..a2280a7d10 100644
--- a/src/network/ssl/qdtls.cpp
+++ b/src/network/ssl/qdtls.cpp
@@ -342,7 +342,7 @@ QT_BEGIN_NAMESPACE
QSslConfiguration QDtlsBasePrivate::configuration() const
{
auto copyPrivate = new QSslConfigurationPrivate(dtlsConfiguration);
- copyPrivate->ref.store(0); // the QSslConfiguration constructor refs up
+ copyPrivate->ref.storeRelaxed(0); // the QSslConfiguration constructor refs up
QSslConfiguration copy(copyPrivate);
copyPrivate->sessionCipher = sessionCipher;
copyPrivate->sessionProtocol = sessionProtocol;
diff --git a/src/network/ssl/qdtls_openssl.cpp b/src/network/ssl/qdtls_openssl.cpp
index 8be53df24f..d9ddcceb40 100644
--- a/src/network/ssl/qdtls_openssl.cpp
+++ b/src/network/ssl/qdtls_openssl.cpp
@@ -729,7 +729,7 @@ bool DtlsState::initCtxAndConnection(QDtlsBasePrivate *dtlsBase)
// Create a deep copy of our configuration
auto configurationCopy = new QSslConfigurationPrivate(dtlsBase->dtlsConfiguration);
- configurationCopy->ref.store(0); // the QSslConfiguration constructor refs up
+ configurationCopy->ref.storeRelaxed(0); // the QSslConfiguration constructor refs up
// DTLSTODO: check we do not set something DTLS-incompatible there ...
TlsContext newContext(QSslContext::sharedFromConfiguration(dtlsBase->mode,
diff --git a/src/network/ssl/qocspresponse.cpp b/src/network/ssl/qocspresponse.cpp
index d564e817ca..bf27bb768b 100644
--- a/src/network/ssl/qocspresponse.cpp
+++ b/src/network/ssl/qocspresponse.cpp
@@ -133,7 +133,7 @@ QOcspResponse::QOcspResponse(const QOcspResponse &) = default;
Move-constructs a QOcspResponse instance.
*/
-QOcspResponse::QOcspResponse(QOcspResponse &&) Q_DECL_NOTHROW = default;
+QOcspResponse::QOcspResponse(QOcspResponse &&) noexcept = default;
/*!
\since 5.13
@@ -154,7 +154,7 @@ QOcspResponse &QOcspResponse::operator=(const QOcspResponse &) = default;
Move-assigns to this QOcspResponse instance.
*/
-QOcspResponse &QOcspResponse::operator=(QOcspResponse &&) Q_DECL_NOTHROW = default;
+QOcspResponse &QOcspResponse::operator=(QOcspResponse &&) noexcept = default;
/*!
\fn void QOcspResponse::swap(QOcspResponse &other)
@@ -239,7 +239,7 @@ Q_NETWORK_EXPORT bool operator==(const QOcspResponse &lhs, const QOcspResponse &
\since 5.13
\relates QHash
*/
-uint qHash(const QOcspResponse &response, uint seed)
+uint qHash(const QOcspResponse &response, uint seed) noexcept
{
const QOcspResponsePrivate *d = response.d.data();
Q_ASSERT(d);
diff --git a/src/network/ssl/qocspresponse.h b/src/network/ssl/qocspresponse.h
index 552a088ba5..cf6be5a369 100644
--- a/src/network/ssl/qocspresponse.h
+++ b/src/network/ssl/qocspresponse.h
@@ -73,7 +73,7 @@ enum class QOcspRevocationReason
};
class QOcspResponse;
-Q_NETWORK_EXPORT uint qHash(const QOcspResponse &response, uint seed = 0);
+Q_NETWORK_EXPORT uint qHash(const QOcspResponse &response, uint seed = 0) noexcept;
class QOcspResponsePrivate;
class Q_NETWORK_EXPORT QOcspResponse
@@ -82,11 +82,11 @@ public:
QOcspResponse();
QOcspResponse(const QOcspResponse &other);
- QOcspResponse(QOcspResponse && other) Q_DECL_NOEXCEPT;
+ QOcspResponse(QOcspResponse && other) noexcept;
~QOcspResponse();
QOcspResponse &operator = (const QOcspResponse &other);
- QOcspResponse &operator = (QOcspResponse &&other) Q_DECL_NOTHROW;
+ QOcspResponse &operator = (QOcspResponse &&other) noexcept;
QOcspCertificateStatus certificateStatus() const;
QOcspRevocationReason revocationReason() const;
@@ -94,13 +94,13 @@ public:
class QSslCertificate responder() const;
QSslCertificate subject() const;
- void swap(QOcspResponse &other) Q_DECL_NOTHROW { d.swap(other.d); }
+ void swap(QOcspResponse &other) noexcept { d.swap(other.d); }
private:
friend class QSslSocketBackendPrivate;
friend Q_NETWORK_EXPORT bool operator==(const QOcspResponse &lhs, const QOcspResponse &rhs);
- friend Q_NETWORK_EXPORT uint qHash(const QOcspResponse &response, uint seed);
+ friend Q_NETWORK_EXPORT uint qHash(const QOcspResponse &response, uint seed) noexcept;
QSharedDataPointer<QOcspResponsePrivate> d;
};
diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h
index 266fcdacb4..69901b526c 100644
--- a/src/network/ssl/qsslcertificate.h
+++ b/src/network/ssl/qsslcertificate.h
@@ -66,7 +66,7 @@ class QStringList;
class QSslCertificate;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed = 0) noexcept;
class QSslCertificatePrivate;
class Q_NETWORK_EXPORT QSslCertificate
@@ -88,12 +88,10 @@ public:
explicit QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem);
QSslCertificate(const QSslCertificate &other);
~QSslCertificate();
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslCertificate &operator=(QSslCertificate &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslCertificate &operator=(QSslCertificate &&other) noexcept { swap(other); return *this; }
QSslCertificate &operator=(const QSslCertificate &other);
- void swap(QSslCertificate &other) Q_DECL_NOTHROW
+ void swap(QSslCertificate &other) noexcept
{ qSwap(d, other.d); }
bool operator==(const QSslCertificate &other) const;
@@ -169,7 +167,7 @@ private:
friend class QSslCertificatePrivate;
friend class QSslSocketBackendPrivate;
- friend Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW;
+ friend Q_NETWORK_EXPORT uint qHash(const QSslCertificate &key, uint seed) noexcept;
};
Q_DECLARE_SHARED(QSslCertificate)
diff --git a/src/network/ssl/qsslcertificate_openssl.cpp b/src/network/ssl/qsslcertificate_openssl.cpp
index 899c8a0d2d..6f1fb26add 100644
--- a/src/network/ssl/qsslcertificate_openssl.cpp
+++ b/src/network/ssl/qsslcertificate_openssl.cpp
@@ -45,12 +45,19 @@
#include "qsslcertificateextension_p.h"
#include <QtCore/qendian.h>
+#include <QtCore/qmutex.h>
-#if QT_CONFIG(thread)
-#include <QtCore/private/qmutexpool_p.h>
-#endif
QT_BEGIN_NAMESPACE
+Q_CONSTEXPR int MutexPoolSize = 17;
+static QBasicMutex mutexPool[MutexPoolSize];
+namespace QMutexPool {
+ static QBasicMutex *globalInstanceGet(const void *addr)
+ {
+ return mutexPool + (quintptr(addr) % MutexPoolSize);
+ }
+}
+
// forward declaration
static QMultiMap<QByteArray, QString> _q_mapFromX509Name(X509_NAME *name);
@@ -65,7 +72,7 @@ bool QSslCertificate::operator==(const QSslCertificate &other) const
return false;
}
-uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QSslCertificate &key, uint seed) noexcept
{
if (X509 * const x509 = key.d->x509) {
const EVP_MD *sha1 = q_EVP_sha1();
diff --git a/src/network/ssl/qsslcertificate_p.h b/src/network/ssl/qsslcertificate_p.h
index 4b331d4c4e..234cd45ceb 100644
--- a/src/network/ssl/qsslcertificate_p.h
+++ b/src/network/ssl/qsslcertificate_p.h
@@ -87,7 +87,7 @@ class QSslCertificatePrivate
{
public:
QSslCertificatePrivate()
- : null(true), x509(0)
+ : null(true), x509(nullptr)
{
#ifndef QT_NO_SSL
QSslSocketPrivate::ensureInitialized();
diff --git a/src/network/ssl/qsslcertificate_qt.cpp b/src/network/ssl/qsslcertificate_qt.cpp
index cce59b5ef3..8b5035ad96 100644
--- a/src/network/ssl/qsslcertificate_qt.cpp
+++ b/src/network/ssl/qsslcertificate_qt.cpp
@@ -64,7 +64,7 @@ bool QSslCertificate::operator==(const QSslCertificate &other) const
return d->derData == other.d->derData;
}
-uint qHash(const QSslCertificate &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QSslCertificate &key, uint seed) noexcept
{
// DER is the native encoding here, so toDer() is just "return d->derData":
return qHash(key.toDer(), seed);
diff --git a/src/network/ssl/qsslcertificateextension.h b/src/network/ssl/qsslcertificateextension.h
index c2910e1707..7cc8a888be 100644
--- a/src/network/ssl/qsslcertificateextension.h
+++ b/src/network/ssl/qsslcertificateextension.h
@@ -55,13 +55,11 @@ class Q_NETWORK_EXPORT QSslCertificateExtension
public:
QSslCertificateExtension();
QSslCertificateExtension(const QSslCertificateExtension &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslCertificateExtension &operator=(QSslCertificateExtension &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslCertificateExtension &operator=(QSslCertificateExtension &&other) noexcept { swap(other); return *this; }
QSslCertificateExtension &operator=(const QSslCertificateExtension &other);
~QSslCertificateExtension();
- void swap(QSslCertificateExtension &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QSslCertificateExtension &other) noexcept { qSwap(d, other.d); }
QString oid() const;
QString name() const;
diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h
index c6328e0169..6994f590ae 100644
--- a/src/network/ssl/qsslcipher.h
+++ b/src/network/ssl/qsslcipher.h
@@ -59,13 +59,11 @@ public:
explicit QSslCipher(const QString &name);
QSslCipher(const QString &name, QSsl::SslProtocol protocol);
QSslCipher(const QSslCipher &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslCipher &operator=(QSslCipher &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslCipher &operator=(QSslCipher &&other) noexcept { swap(other); return *this; }
QSslCipher &operator=(const QSslCipher &other);
~QSslCipher();
- void swap(QSslCipher &other) Q_DECL_NOTHROW
+ void swap(QSslCipher &other) noexcept
{ qSwap(d, other.d); }
bool operator==(const QSslCipher &other) const;
diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h
index 8f53e25a53..c25c2686de 100644
--- a/src/network/ssl/qsslconfiguration.h
+++ b/src/network/ssl/qsslconfiguration.h
@@ -85,12 +85,10 @@ public:
QSslConfiguration();
QSslConfiguration(const QSslConfiguration &other);
~QSslConfiguration();
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslConfiguration &operator=(QSslConfiguration &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslConfiguration &operator=(QSslConfiguration &&other) noexcept { swap(other); return *this; }
QSslConfiguration &operator=(const QSslConfiguration &other);
- void swap(QSslConfiguration &other) Q_DECL_NOTHROW
+ void swap(QSslConfiguration &other) noexcept
{ qSwap(d, other.d); }
bool operator==(const QSslConfiguration &other) const;
diff --git a/src/network/ssl/qsslcontext_openssl11.cpp b/src/network/ssl/qsslcontext_openssl11.cpp
index 21a5c779f7..db023b7331 100644
--- a/src/network/ssl/qsslcontext_openssl11.cpp
+++ b/src/network/ssl/qsslcontext_openssl11.cpp
@@ -193,7 +193,6 @@ init_context:
minVersion = TLS1_2_VERSION;
maxVersion = 0;
break;
-#if QT_CONFIG(dtls)
case QSsl::DtlsV1_0:
minVersion = DTLS1_VERSION;
maxVersion = DTLS1_VERSION;
@@ -210,7 +209,6 @@ init_context:
minVersion = DTLS1_2_VERSION;
maxVersion = DTLS_MAX_VERSION;
break;
-#endif // dtls
case QSsl::TlsV1_3OrLater:
#ifdef TLS1_3_VERSION
minVersion = TLS1_3_VERSION;
diff --git a/src/network/ssl/qsslcontext_openssl_p.h b/src/network/ssl/qsslcontext_openssl_p.h
index 48beebf134..1fa27279c7 100644
--- a/src/network/ssl/qsslcontext_openssl_p.h
+++ b/src/network/ssl/qsslcontext_openssl_p.h
@@ -89,7 +89,7 @@ public:
#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_NEXTPROTONEG)
// must be public because we want to use it from an OpenSSL callback
struct NPNContext {
- NPNContext() : data(0),
+ NPNContext() : data(nullptr),
len(0),
status(QSslConfiguration::NextProtocolNegotiationNone)
{ }
diff --git a/src/network/ssl/qssldiffiehellmanparameters.cpp b/src/network/ssl/qssldiffiehellmanparameters.cpp
index 65041d4456..7807afaa30 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters.cpp
@@ -213,7 +213,7 @@ QSslDiffieHellmanParameters &QSslDiffieHellmanParameters::operator=(const QSslDi
Setting an empty QSslDiffieHellmanParameters instance on a QSslSocket-based
server will disable Diffie-Hellman key exchange.
*/
-bool QSslDiffieHellmanParameters::isEmpty() const Q_DECL_NOTHROW
+bool QSslDiffieHellmanParameters::isEmpty() const noexcept
{
return d->derData.isNull() && d->error == QSslDiffieHellmanParameters::NoError;
}
@@ -229,7 +229,7 @@ bool QSslDiffieHellmanParameters::isEmpty() const Q_DECL_NOTHROW
\sa error()
*/
-bool QSslDiffieHellmanParameters::isValid() const Q_DECL_NOTHROW
+bool QSslDiffieHellmanParameters::isValid() const noexcept
{
return d->error == QSslDiffieHellmanParameters::NoError;
}
@@ -253,7 +253,7 @@ bool QSslDiffieHellmanParameters::isValid() const Q_DECL_NOTHROW
Returns the error that caused the QSslDiffieHellmanParameters object
to be invalid.
*/
-QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const Q_DECL_NOTHROW
+QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const noexcept
{
return d->error;
}
@@ -262,7 +262,7 @@ QSslDiffieHellmanParameters::Error QSslDiffieHellmanParameters::error() const Q_
Returns a human-readable description of the error that caused the
QSslDiffieHellmanParameters object to be invalid.
*/
-QString QSslDiffieHellmanParameters::errorString() const Q_DECL_NOTHROW
+QString QSslDiffieHellmanParameters::errorString() const noexcept
{
switch (d->error) {
case QSslDiffieHellmanParameters::NoError:
@@ -283,7 +283,7 @@ QString QSslDiffieHellmanParameters::errorString() const Q_DECL_NOTHROW
Returns \c true if \a lhs is equal to \a rhs; otherwise returns \c false.
*/
-bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW
+bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
{
return lhs.d->derData == rhs.d->derData;
}
@@ -316,7 +316,7 @@ QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam)
Returns an hash value for \a dhparam, using \a seed to seed
the calculation.
*/
-uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) Q_DECL_NOTHROW
+uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) noexcept
{
return qHash(dhparam.d->derData, seed);
}
diff --git a/src/network/ssl/qssldiffiehellmanparameters.h b/src/network/ssl/qssldiffiehellmanparameters.h
index 497d2bebfb..f62a3b8f44 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.h
+++ b/src/network/ssl/qssldiffiehellmanparameters.h
@@ -56,16 +56,16 @@ class QSslDiffieHellmanParametersPrivate;
class QSslDiffieHellmanParameters;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed = 0) Q_DECL_NOTHROW;
+Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed = 0) noexcept;
#ifndef QT_NO_DEBUG_STREAM
class QDebug;
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparams);
#endif
-Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW;
+Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept;
-inline bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW
+inline bool operator!=(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept
{
return !operator==(lhs, rhs);
}
@@ -83,30 +83,30 @@ public:
Q_NETWORK_EXPORT QSslDiffieHellmanParameters();
Q_NETWORK_EXPORT QSslDiffieHellmanParameters(const QSslDiffieHellmanParameters &other);
- QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
+ QSslDiffieHellmanParameters(QSslDiffieHellmanParameters &&other) noexcept : d(other.d) { other.d = nullptr; }
Q_NETWORK_EXPORT ~QSslDiffieHellmanParameters();
Q_NETWORK_EXPORT QSslDiffieHellmanParameters &operator=(const QSslDiffieHellmanParameters &other);
- QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QSslDiffieHellmanParameters &operator=(QSslDiffieHellmanParameters &&other) noexcept { swap(other); return *this; }
- void swap(QSslDiffieHellmanParameters &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QSslDiffieHellmanParameters &other) noexcept { qSwap(d, other.d); }
Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(const QByteArray &encoded, QSsl::EncodingFormat format = QSsl::Pem);
Q_NETWORK_EXPORT static QSslDiffieHellmanParameters fromEncoded(QIODevice *device, QSsl::EncodingFormat format = QSsl::Pem);
- Q_NETWORK_EXPORT bool isEmpty() const Q_DECL_NOTHROW;
- Q_NETWORK_EXPORT bool isValid() const Q_DECL_NOTHROW;
- Q_NETWORK_EXPORT Error error() const Q_DECL_NOTHROW;
- Q_NETWORK_EXPORT QString errorString() const Q_DECL_NOTHROW;
+ Q_NETWORK_EXPORT bool isEmpty() const noexcept;
+ Q_NETWORK_EXPORT bool isValid() const noexcept;
+ Q_NETWORK_EXPORT Error error() const noexcept;
+ Q_NETWORK_EXPORT QString errorString() const noexcept;
private:
QSslDiffieHellmanParametersPrivate *d;
friend class QSslContext;
- friend Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) Q_DECL_NOTHROW;
+ friend Q_NETWORK_EXPORT bool operator==(const QSslDiffieHellmanParameters &lhs, const QSslDiffieHellmanParameters &rhs) noexcept;
#ifndef QT_NO_DEBUG_STREAM
friend Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslDiffieHellmanParameters &dhparam);
#endif
- friend Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) Q_DECL_NOTHROW;
+ friend Q_NETWORK_EXPORT uint qHash(const QSslDiffieHellmanParameters &dhparam, uint seed) noexcept;
};
Q_DECLARE_SHARED(QSslDiffieHellmanParameters)
diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h
index 57dda19bad..28de3a03b4 100644
--- a/src/network/ssl/qsslellipticcurve.h
+++ b/src/network/ssl/qsslellipticcurve.h
@@ -52,11 +52,11 @@ QT_BEGIN_NAMESPACE
class QSslEllipticCurve;
// qHash is a friend, but we can't use default arguments for friends (§8.3.6.4)
-Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed = 0) Q_DECL_NOTHROW;
+Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed = 0) noexcept;
class QSslEllipticCurve {
public:
- Q_DECL_CONSTEXPR QSslEllipticCurve() Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR QSslEllipticCurve() noexcept
: id(0)
{
}
@@ -67,18 +67,18 @@ public:
Q_REQUIRED_RESULT Q_NETWORK_EXPORT QString shortName() const;
Q_REQUIRED_RESULT Q_NETWORK_EXPORT QString longName() const;
- Q_DECL_CONSTEXPR bool isValid() const Q_DECL_NOTHROW
+ Q_DECL_CONSTEXPR bool isValid() const noexcept
{
return id != 0;
}
- Q_NETWORK_EXPORT bool isTlsNamedCurve() const Q_DECL_NOTHROW;
+ Q_NETWORK_EXPORT bool isTlsNamedCurve() const noexcept;
private:
int id;
- friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW;
- friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW;
+ friend Q_DECL_CONSTEXPR bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept;
+ friend Q_DECL_CONSTEXPR uint qHash(QSslEllipticCurve curve, uint seed) noexcept;
friend class QSslContext;
friend class QSslSocketPrivate;
@@ -87,13 +87,13 @@ private:
Q_DECLARE_TYPEINFO(QSslEllipticCurve, Q_PRIMITIVE_TYPE);
-Q_DECL_CONSTEXPR inline uint qHash(QSslEllipticCurve curve, uint seed) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline uint qHash(QSslEllipticCurve curve, uint seed) noexcept
{ return qHash(curve.id, seed); }
-Q_DECL_CONSTEXPR inline bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator==(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
{ return lhs.id == rhs.id; }
-Q_DECL_CONSTEXPR inline bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) Q_DECL_NOTHROW
+Q_DECL_CONSTEXPR inline bool operator!=(QSslEllipticCurve lhs, QSslEllipticCurve rhs) noexcept
{ return !operator==(lhs, rhs); }
#ifndef QT_NO_DEBUG_STREAM
diff --git a/src/network/ssl/qsslellipticcurve_dummy.cpp b/src/network/ssl/qsslellipticcurve_dummy.cpp
index 93e081b9e0..1313e06875 100644
--- a/src/network/ssl/qsslellipticcurve_dummy.cpp
+++ b/src/network/ssl/qsslellipticcurve_dummy.cpp
@@ -63,7 +63,7 @@ QSslEllipticCurve QSslEllipticCurve::fromLongName(const QString &name)
return QSslEllipticCurve();
}
-bool QSslEllipticCurve::isTlsNamedCurve() const Q_DECL_NOTHROW
+bool QSslEllipticCurve::isTlsNamedCurve() const noexcept
{
return false;
}
diff --git a/src/network/ssl/qsslellipticcurve_openssl.cpp b/src/network/ssl/qsslellipticcurve_openssl.cpp
index 8cd14837f0..b5e38ada53 100644
--- a/src/network/ssl/qsslellipticcurve_openssl.cpp
+++ b/src/network/ssl/qsslellipticcurve_openssl.cpp
@@ -170,7 +170,7 @@ static const int tlsNamedCurveNIDs[] = {
static const size_t tlsNamedCurveNIDCount = sizeof(tlsNamedCurveNIDs) / sizeof(tlsNamedCurveNIDs[0]);
-bool QSslEllipticCurve::isTlsNamedCurve() const Q_DECL_NOTHROW
+bool QSslEllipticCurve::isTlsNamedCurve() const noexcept
{
const int * const tlsNamedCurveNIDsEnd = tlsNamedCurveNIDs + tlsNamedCurveNIDCount;
return std::find(tlsNamedCurveNIDs, tlsNamedCurveNIDsEnd, id) != tlsNamedCurveNIDsEnd;
diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp
index 02dd16a58d..cdc018a508 100644
--- a/src/network/ssl/qsslerror.cpp
+++ b/src/network/ssl/qsslerror.cpp
@@ -86,6 +86,7 @@
\value UnspecifiedError
\value NoSslSupport
\value CertificateBlacklisted
+ \value CertificateStatusUnknown
\value OcspNoResponseFound
\value OcspMalformedRequest
\value OcspMalformedResponse
@@ -361,11 +362,11 @@ QSslCertificate QSslError::certificate() const
\since 5.4
\relates QHash
*/
-uint qHash(const QSslError &key, uint seed) Q_DECL_NOTHROW
+uint qHash(const QSslError &key, uint seed) noexcept
{
- // 2x boost::hash_combine inlined:
- seed ^= qHash(key.error()) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- seed ^= qHash(key.certificate()) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ QtPrivate::QHashCombine hash;
+ seed = hash(seed, key.error());
+ seed = hash(seed, key.certificate());
return seed;
}
diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h
index 513b8afd7f..28eb1a9ea8 100644
--- a/src/network/ssl/qsslerror.h
+++ b/src/network/ssl/qsslerror.h
@@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
class QSslErrorPrivate;
class Q_NETWORK_EXPORT QSslError
{
+ Q_GADGET
public:
enum SslError {
NoError,
@@ -94,6 +95,7 @@ public:
OcspStatusUnknown,
UnspecifiedError = -1
};
+ Q_ENUM(SslError)
// RVCT compiler in debug build does not like about default values in const-
// So as an workaround we define all constructor overloads here explicitly
@@ -103,13 +105,11 @@ public:
QSslError(const QSslError &other);
- void swap(QSslError &other) Q_DECL_NOTHROW
+ void swap(QSslError &other) noexcept
{ qSwap(d, other.d); }
~QSslError();
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslError &operator=(QSslError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslError &operator=(QSslError &&other) noexcept { swap(other); return *this; }
QSslError &operator=(const QSslError &other);
bool operator==(const QSslError &other) const;
inline bool operator!=(const QSslError &other) const
@@ -124,7 +124,7 @@ private:
};
Q_DECLARE_SHARED(QSslError)
-Q_NETWORK_EXPORT uint qHash(const QSslError &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_NETWORK_EXPORT uint qHash(const QSslError &key, uint seed = 0) noexcept;
#ifndef QT_NO_DEBUG_STREAM
class QDebug;
diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h
index 6de02b1e44..74be406539 100644
--- a/src/network/ssl/qsslkey.h
+++ b/src/network/ssl/qsslkey.h
@@ -71,13 +71,12 @@ public:
const QByteArray &passPhrase = QByteArray());
explicit QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey);
QSslKey(const QSslKey &other);
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslKey &operator=(QSslKey &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslKey(QSslKey &&other) noexcept;
+ QSslKey &operator=(QSslKey &&other) noexcept;
QSslKey &operator=(const QSslKey &other);
~QSslKey();
- void swap(QSslKey &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QSslKey &other) noexcept { qSwap(d, other.d); }
bool isNull() const;
void clear();
diff --git a/src/network/ssl/qsslkey_mac.cpp b/src/network/ssl/qsslkey_mac.cpp
index d460cbfdab..814fe1c4bc 100644
--- a/src/network/ssl/qsslkey_mac.cpp
+++ b/src/network/ssl/qsslkey_mac.cpp
@@ -42,7 +42,9 @@
#include <CommonCrypto/CommonCrypto.h>
-QT_USE_NAMESPACE
+#include <cstddef>
+
+QT_BEGIN_NAMESPACE
static QByteArray wrapCCCrypt(CCOperation ccOp,
QSslKeyPrivate::Cipher cipher,
@@ -64,17 +66,23 @@ static QByteArray wrapCCCrypt(CCOperation ccOp,
blockSize = kCCBlockSizeRC2;
ccAlgorithm = kCCAlgorithmRC2;
break;
- };
+ case QSslKeyPrivate::Aes128Cbc:
+ case QSslKeyPrivate::Aes192Cbc:
+ case QSslKeyPrivate::Aes256Cbc:
+ blockSize = kCCBlockSizeAES128;
+ ccAlgorithm = kCCAlgorithmAES;
+ break;
+ }
size_t plainLength = 0;
QByteArray plain(data.size() + blockSize, 0);
CCCryptorStatus status = CCCrypt(
ccOp, ccAlgorithm, kCCOptionPKCS7Padding,
- key.constData(), key.size(),
+ key.constData(), std::size_t(key.size()),
iv.constData(),
- data.constData(), data.size(),
- plain.data(), plain.size(), &plainLength);
+ data.constData(), std::size_t(data.size()),
+ plain.data(), std::size_t(plain.size()), &plainLength);
if (status == kCCSuccess)
- return plain.left(plainLength);
+ return plain.left(int(plainLength));
return QByteArray();
}
@@ -87,3 +95,5 @@ QByteArray QSslKeyPrivate::encrypt(Cipher cipher, const QByteArray &data, const
{
return wrapCCCrypt(kCCEncrypt, cipher, data, key, iv);
}
+
+QT_END_NAMESPACE
diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp
index 99c1a39c73..888058df22 100644
--- a/src/network/ssl/qsslkey_openssl.cpp
+++ b/src/network/ssl/qsslkey_openssl.cpp
@@ -333,6 +333,15 @@ static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data,
type = q_EVP_rc2_cbc();
#endif
break;
+ case QSslKeyPrivate::Aes128Cbc:
+ type = q_EVP_aes_128_cbc();
+ break;
+ case QSslKeyPrivate::Aes192Cbc:
+ type = q_EVP_aes_192_cbc();
+ break;
+ case QSslKeyPrivate::Aes256Cbc:
+ type = q_EVP_aes_256_cbc();
+ break;
}
if (type == nullptr)
diff --git a/src/network/ssl/qsslkey_p.cpp b/src/network/ssl/qsslkey_p.cpp
index 5c90719fcd..b0d6c729f9 100644
--- a/src/network/ssl/qsslkey_p.cpp
+++ b/src/network/ssl/qsslkey_p.cpp
@@ -385,6 +385,24 @@ QSslKey::QSslKey(const QSslKey &other) : d(other.d)
{
}
+QSslKey::QSslKey(QSslKey &&other) noexcept
+ : d(nullptr)
+{
+ qSwap(d, other.d);
+}
+
+QSslKey &QSslKey::operator=(QSslKey &&other) noexcept
+{
+ if (this == &other)
+ return *this;
+
+ // If no one else is referencing the key data we want to make sure
+ // before we swap the d-ptr that it is not left in memory.
+ d.reset();
+ qSwap(d, other.d);
+ return *this;
+}
+
/*!
Destroys the QSslKey object.
*/
diff --git a/src/network/ssl/qsslkey_p.h b/src/network/ssl/qsslkey_p.h
index 06403b5479..dd1a31b0e5 100644
--- a/src/network/ssl/qsslkey_p.h
+++ b/src/network/ssl/qsslkey_p.h
@@ -68,7 +68,7 @@ class QSslKeyPrivate
public:
inline QSslKeyPrivate()
: algorithm(QSsl::Opaque)
- , opaque(0)
+ , opaque(nullptr)
{
clear(false);
}
@@ -105,7 +105,10 @@ public:
enum Cipher {
DesCbc,
DesEde3Cbc,
- Rc2Cbc
+ Rc2Cbc,
+ Aes128Cbc,
+ Aes192Cbc,
+ Aes256Cbc
};
Q_AUTOTEST_EXPORT static QByteArray decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
diff --git a/src/network/ssl/qsslkey_qt.cpp b/src/network/ssl/qsslkey_qt.cpp
index 5ebd8ac3bd..43969c3d28 100644
--- a/src/network/ssl/qsslkey_qt.cpp
+++ b/src/network/ssl/qsslkey_qt.cpp
@@ -48,6 +48,8 @@
#include <QtNetwork/qpassworddigestor.h>
+#include <cstring>
+
QT_USE_NAMESPACE
static const quint8 bits_table[256] = {
@@ -124,6 +126,37 @@ static int numberOfBits(const QByteArray &modulus)
return bits;
}
+static QByteArray deriveAesKey(QSslKeyPrivate::Cipher cipher, const QByteArray &passPhrase, const QByteArray &iv)
+{
+ // This is somewhat simplified and shortened version of what OpenSSL does.
+ // See, for example, EVP_BytesToKey for the "algorithm" itself and elsewhere
+ // in their code for what they pass as arguments to EVP_BytesToKey when
+ // deriving encryption keys (when reading/writing pems files with encrypted
+ // keys).
+
+ Q_ASSERT(iv.size() >= 8);
+
+ QCryptographicHash hash(QCryptographicHash::Md5);
+
+ QByteArray data(passPhrase);
+ data.append(iv.data(), 8); // AKA PKCS5_SALT_LEN in OpenSSL.
+
+ hash.addData(data);
+
+ if (cipher == QSslKeyPrivate::Aes128Cbc)
+ return hash.result();
+
+ QByteArray key(hash.result());
+ hash.reset();
+ hash.addData(key);
+ hash.addData(data);
+
+ if (cipher == QSslKeyPrivate::Aes192Cbc)
+ return key.append(hash.result().constData(), 8);
+
+ return key.append(hash.result());
+}
+
static QByteArray deriveKey(QSslKeyPrivate::Cipher cipher, const QByteArray &passPhrase, const QByteArray &iv)
{
QByteArray key;
@@ -145,14 +178,19 @@ static QByteArray deriveKey(QSslKeyPrivate::Cipher cipher, const QByteArray &pas
case QSslKeyPrivate::Rc2Cbc:
key = hash.result();
break;
+ case QSslKeyPrivate::Aes128Cbc:
+ case QSslKeyPrivate::Aes192Cbc:
+ case QSslKeyPrivate::Aes256Cbc:
+ return deriveAesKey(cipher, passPhrase, iv);
}
return key;
}
void QSslKeyPrivate::clear(bool deep)
{
- Q_UNUSED(deep);
isNull = true;
+ if (deep)
+ std::memset(derData.data(), 0, derData.size());
derData.clear();
keyLength = -1;
}
@@ -378,6 +416,12 @@ void QSslKeyPrivate::decodePem(const QByteArray &pem, const QByteArray &passPhra
cipher = DesEde3Cbc;
} else if (dekInfo.first() == "RC2-CBC") {
cipher = Rc2Cbc;
+ } else if (dekInfo.first() == "AES-128-CBC") {
+ cipher = Aes128Cbc;
+ } else if (dekInfo.first() == "AES-192-CBC") {
+ cipher = Aes192Cbc;
+ } else if (dekInfo.first() == "AES-256-CBC") {
+ cipher = Aes256Cbc;
} else {
clear(deepClear);
return;
@@ -554,6 +598,10 @@ static EncryptionData readPbes2(const QVector<QAsn1Element> &element, const QByt
return {};
break;
} // @todo(?): case (RC5 , AES)
+ case QSslKeyPrivate::Cipher::Aes128Cbc:
+ case QSslKeyPrivate::Cipher::Aes192Cbc:
+ case QSslKeyPrivate::Cipher::Aes256Cbc:
+ Q_UNREACHABLE();
}
if (Q_LIKELY(keyDerivationAlgorithm == PKCS5_PBKDF2_ENCRYPTION_OID)) {
diff --git a/src/network/ssl/qsslkey_schannel.cpp b/src/network/ssl/qsslkey_schannel.cpp
index 5694068860..1e21d123f4 100644
--- a/src/network/ssl/qsslkey_schannel.cpp
+++ b/src/network/ssl/qsslkey_schannel.cpp
@@ -57,6 +57,10 @@ const wchar_t *getName(QSslKeyPrivate::Cipher cipher)
return BCRYPT_3DES_ALGORITHM;
case QSslKeyPrivate::Cipher::Rc2Cbc:
return BCRYPT_RC2_ALGORITHM;
+ case QSslKeyPrivate::Cipher::Aes128Cbc:
+ case QSslKeyPrivate::Cipher::Aes192Cbc:
+ case QSslKeyPrivate::Cipher::Aes256Cbc:
+ return BCRYPT_AES_ALGORITHM;
}
Q_UNREACHABLE();
}
diff --git a/src/network/ssl/qsslkey_winrt.cpp b/src/network/ssl/qsslkey_winrt.cpp
index f2ed813965..69eaaa387f 100644
--- a/src/network/ssl/qsslkey_winrt.cpp
+++ b/src/network/ssl/qsslkey_winrt.cpp
@@ -83,6 +83,15 @@ struct SslKeyGlobal
hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"RC2_CBC").Get(),
&keyProviders[QSslKeyPrivate::Rc2Cbc]);
Q_ASSERT_SUCCEEDED(hr);
+ hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
+ &keyProviders[QSslKeyPrivate::Aes128Cbc]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
+ &keyProviders[QSslKeyPrivate::Aes192Cbc]);
+ Q_ASSERT_SUCCEEDED(hr);
+ hr = keyProviderFactory->OpenAlgorithm(HString::MakeReference(L"AES_CBC").Get(),
+ &keyProviders[QSslKeyPrivate::Aes256Cbc]);
+ Q_ASSERT_SUCCEEDED(hr);
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Security_Cryptography_CryptographicBuffer).Get(),
&bufferFactory);
diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h
index 423f7731b4..5d714dc34e 100644
--- a/src/network/ssl/qsslpresharedkeyauthenticator.h
+++ b/src/network/ssl/qsslpresharedkeyauthenticator.h
@@ -59,11 +59,9 @@ public:
Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator(const QSslPreSharedKeyAuthenticator &authenticator);
Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator);
-#ifdef Q_COMPILER_RVALUE_REFS
- QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) Q_DECL_NOTHROW { swap(other); return *this; }
-#endif
+ QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) noexcept { swap(other); return *this; }
- void swap(QSslPreSharedKeyAuthenticator &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QSslPreSharedKeyAuthenticator &other) noexcept { qSwap(d, other.d); }
Q_NETWORK_EXPORT QByteArray identityHint() const;
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index e164217e4e..e302aa1761 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -761,8 +761,8 @@ qint64 QSslSocket::bytesAvailable() const
{
Q_D(const QSslSocket);
if (d->mode == UnencryptedMode)
- return QIODevice::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0);
- return QIODevice::bytesAvailable();
+ return QAbstractSocket::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0);
+ return QAbstractSocket::bytesAvailable();
}
/*!
@@ -818,8 +818,8 @@ bool QSslSocket::canReadLine() const
{
Q_D(const QSslSocket);
if (d->mode == UnencryptedMode)
- return QIODevice::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine());
- return QIODevice::canReadLine();
+ return QAbstractSocket::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine());
+ return QAbstractSocket::canReadLine();
}
/*!
@@ -849,8 +849,8 @@ bool QSslSocket::atEnd() const
{
Q_D(const QSslSocket);
if (d->mode == UnencryptedMode)
- return QIODevice::atEnd() && (!d->plainSocket || d->plainSocket->atEnd());
- return QIODevice::atEnd();
+ return QAbstractSocket::atEnd() && (!d->plainSocket || d->plainSocket->atEnd());
+ return QAbstractSocket::atEnd();
}
/*!
@@ -924,7 +924,7 @@ QSslConfiguration QSslSocket::sslConfiguration() const
// create a deep copy of our configuration
QSslConfigurationPrivate *copy = new QSslConfigurationPrivate(d->configuration);
- copy->ref.store(0); // the QSslConfiguration constructor refs up
+ copy->ref.storeRelaxed(0); // the QSslConfiguration constructor refs up
copy->sessionCipher = d->sessionCipher();
copy->sessionProtocol = d->sessionProtocol();
@@ -1209,12 +1209,21 @@ void QSslSocket::setPrivateKey(const QSslKey &key)
void QSslSocket::setPrivateKey(const QString &fileName, QSsl::KeyAlgorithm algorithm,
QSsl::EncodingFormat format, const QByteArray &passPhrase)
{
- Q_D(QSslSocket);
QFile file(fileName);
- if (file.open(QIODevice::ReadOnly)) {
- d->configuration.privateKey = QSslKey(file.readAll(), algorithm,
- format, QSsl::PrivateKey, passPhrase);
+ if (!file.open(QIODevice::ReadOnly)) {
+ qCWarning(lcSsl, "QSslSocket::setPrivateKey: Couldn't open file for reading");
+ return;
+ }
+
+ QSslKey key(file.readAll(), algorithm, format, QSsl::PrivateKey, passPhrase);
+ if (key.isNull()) {
+ qCWarning(lcSsl, "QSslSocket::setPrivateKey: "
+ "The specified file does not contain a valid key");
+ return;
}
+
+ Q_D(QSslSocket);
+ d->configuration.privateKey = key;
}
/*!
@@ -1503,7 +1512,7 @@ bool QSslSocket::addDefaultCaCertificates(const QString &path, QSsl::EncodingFor
SSL socket's CA certificate database is initialized to the default
CA certificate database.
- \sa QSslConfiguration::defaultCaCertificates(), addCaCertificates()
+ \sa QSslConfiguration::caCertificates(), addCaCertificates()
*/
void QSslSocket::addDefaultCaCertificate(const QSslCertificate &certificate)
{
@@ -2369,7 +2378,7 @@ void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPri
if (!global)
return;
- ptr->ref.store(1);
+ ptr->ref.storeRelaxed(1);
ptr->peerCertificate = global->peerCertificate;
ptr->peerCertificateChain = global->peerCertificateChain;
ptr->localCertificateChain = global->localCertificateChain;
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index e290ba79dd..e0e065679d 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -215,7 +215,7 @@ void QSecureTransportContext::reset(SSLContextRef newContext)
context = newContext;
}
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_securetransport_mutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, qt_securetransport_mutex)
//#define QSSLSOCKET_DEBUG
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index c0035d23a8..d4bad1b1a5 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -523,11 +523,12 @@ bool QSslSocketBackendPrivate::initSslContext()
{
Q_Q(QSslSocket);
- // If no external context was set (e.g. bei QHttpNetworkConnection) we will create a default context
+ // If no external context was set (e.g. by QHttpNetworkConnection) we will
+ // create a default context
if (!sslContextPointer) {
// create a deep copy of our configuration
QSslConfigurationPrivate *configurationCopy = new QSslConfigurationPrivate(configuration);
- configurationCopy->ref.store(0); // the QSslConfiguration constructor refs up
+ configurationCopy->ref.storeRelaxed(0); // the QSslConfiguration constructor refs up
sslContextPointer = QSslContext::sharedFromConfiguration(mode, configurationCopy, allowRootCertOnDemandLoading);
}
diff --git a/src/network/ssl/qsslsocket_openssl11.cpp b/src/network/ssl/qsslsocket_openssl11.cpp
index b60b8be41f..1d935c5217 100644
--- a/src/network/ssl/qsslsocket_openssl11.cpp
+++ b/src/network/ssl/qsslsocket_openssl11.cpp
@@ -68,10 +68,11 @@
#include <QtCore/qfile.h>
#include <QtCore/qmutex.h>
#include <QtCore/qlibrary.h>
+#include <QtCore/qoperatingsystemversion.h>
QT_BEGIN_NAMESPACE
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_opensslInitMutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, qt_opensslInitMutex)
void QSslSocketPrivate::deinitialize()
{
@@ -142,13 +143,12 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
if (!s_loadRootCertsOnDemand)
setDefaultCaCertificates(systemCaCertificates());
#ifdef Q_OS_WIN
- //Enabled for fetching additional root certs from windows update on windows 6+
+ //Enabled for fetching additional root certs from windows update on windows.
//This flag is set false by setDefaultCaCertificates() indicating the app uses
//its own cert bundle rather than the system one.
//Same logic that disables the unix on demand cert loading.
//Unlike unix, we do preload the certificates from the cert store.
- if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0)
- s_loadRootCertsOnDemand = true;
+ s_loadRootCertsOnDemand = true;
#endif
}
diff --git a/src/network/ssl/qsslsocket_openssl11_symbols_p.h b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
index 150617e3d2..0fe0899d4f 100644
--- a/src/network/ssl/qsslsocket_openssl11_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
@@ -82,6 +82,7 @@ Q_AUTOTEST_EXPORT const BIO_METHOD *q_BIO_s_mem();
int q_DSA_bits(DSA *a);
int q_EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *c);
+Q_AUTOTEST_EXPORT int q_EVP_PKEY_up_ref(EVP_PKEY *a);
int q_EVP_PKEY_base_id(EVP_PKEY *a);
int q_RSA_bits(RSA *a);
Q_AUTOTEST_EXPORT int q_OPENSSL_sk_num(OPENSSL_STACK *a);
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 74ac852bcd..1fcfdf9f16 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -63,13 +63,11 @@
# include <QtCore/qlibrary.h>
#endif
#include <QtCore/qmutex.h>
-#if QT_CONFIG(thread)
-#include <private/qmutexpool_p.h>
-#endif
#include <QtCore/qdatetime.h>
#if defined(Q_OS_UNIX)
#include <QtCore/qdir.h>
#endif
+#include <QtCore/private/qmemory_p.h>
#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
#include <link.h>
#endif
@@ -150,6 +148,7 @@ DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return nullptr, return)
DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return nullptr, return)
DEFINEFUNC2(int, BN_is_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return)
DEFINEFUNC(int, EVP_CIPHER_CTX_reset, EVP_CIPHER_CTX *c, c, return 0, return)
+DEFINEFUNC(int, EVP_PKEY_up_ref, EVP_PKEY *a, a, return 0, return)
DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return)
DEFINEFUNC(int, RSA_bits, RSA *a, a, return 0, return)
DEFINEFUNC(int, DSA_bits, DSA *a, a, return 0, return)
@@ -363,6 +362,11 @@ DEFINEFUNC(const EVP_CIPHER *, EVP_des_ede3_cbc, DUMMYARG, DUMMYARG, return null
#ifndef OPENSSL_NO_RC2
DEFINEFUNC(const EVP_CIPHER *, EVP_rc2_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
#endif
+#ifndef OPENSSL_NO_AES
+DEFINEFUNC(const EVP_CIPHER *, EVP_aes_128_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
+DEFINEFUNC(const EVP_CIPHER *, EVP_aes_192_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
+DEFINEFUNC(const EVP_CIPHER *, EVP_aes_256_cbc, DUMMYARG, DUMMYARG, return nullptr, return)
+#endif
DEFINEFUNC(const EVP_MD *, EVP_sha1, DUMMYARG, DUMMYARG, return nullptr, return)
DEFINEFUNC3(int, EVP_PKEY_assign, EVP_PKEY *a, a, int b, b, char *c, c, return -1, return)
DEFINEFUNC2(int, EVP_PKEY_set1_RSA, EVP_PKEY *a, a, RSA *b, b, return -1, return)
@@ -371,6 +375,7 @@ DEFINEFUNC2(int, EVP_PKEY_set1_DH, EVP_PKEY *a, a, DH *b, b, return -1, return)
#ifndef OPENSSL_NO_EC
DEFINEFUNC2(int, EVP_PKEY_set1_EC_KEY, EVP_PKEY *a, a, EC_KEY *b, b, return -1, return)
#endif
+DEFINEFUNC2(int, EVP_PKEY_cmp, const EVP_PKEY *a, a, const EVP_PKEY *b, b, return -1, return)
DEFINEFUNC(void, EVP_PKEY_free, EVP_PKEY *a, a, return, DUMMYARG)
DEFINEFUNC(DSA *, EVP_PKEY_get1_DSA, EVP_PKEY *a, a, return nullptr, return)
DEFINEFUNC(RSA *, EVP_PKEY_get1_RSA, EVP_PKEY *a, a, return nullptr, return)
@@ -592,8 +597,8 @@ DEFINEFUNC2(PKCS12 *, d2i_PKCS12_bio, BIO *bio, bio, PKCS12 **pkcs12, pkcs12, re
DEFINEFUNC(void, PKCS12_free, PKCS12 *pkcs12, pkcs12, return, DUMMYARG)
#define RESOLVEFUNC(func) \
- if (!(_q_##func = _q_PTR_##func(libs.first->resolve(#func))) \
- && !(_q_##func = _q_PTR_##func(libs.second->resolve(#func)))) \
+ if (!(_q_##func = _q_PTR_##func(libs.ssl->resolve(#func))) \
+ && !(_q_##func = _q_PTR_##func(libs.crypto->resolve(#func)))) \
qsslSocketCannotResolveSymbolWarning(#func);
#if !defined QT_LINKED_OPENSSL
@@ -692,7 +697,7 @@ static QStringList libraryPathList()
// discover paths of already loaded libraries
QSet<QString> loadedPaths;
dl_iterate_phdr(dlIterateCallback, &loadedPaths);
- paths.append(loadedPaths.toList());
+ paths.append(loadedPaths.values());
#endif
return paths;
@@ -729,34 +734,31 @@ static QStringList findAllLibCrypto()
# endif
#ifdef Q_OS_WIN
-static bool tryToLoadOpenSslWin32Library(QLatin1String ssleay32LibName, QLatin1String libeay32LibName, QPair<QSystemLibrary*, QSystemLibrary*> &pair)
-{
- pair.first = 0;
- pair.second = 0;
- QSystemLibrary *ssleay32 = new QSystemLibrary(ssleay32LibName);
+struct LoadedOpenSsl {
+ std::unique_ptr<QSystemLibrary> ssl, crypto;
+};
+
+static bool tryToLoadOpenSslWin32Library(QLatin1String ssleay32LibName, QLatin1String libeay32LibName, LoadedOpenSsl &result)
+{
+ auto ssleay32 = qt_make_unique<QSystemLibrary>(ssleay32LibName);
if (!ssleay32->load(false)) {
- delete ssleay32;
return FALSE;
}
- QSystemLibrary *libeay32 = new QSystemLibrary(libeay32LibName);
+ auto libeay32 = qt_make_unique<QSystemLibrary>(libeay32LibName);
if (!libeay32->load(false)) {
- delete ssleay32;
- delete libeay32;
return FALSE;
}
- pair.first = ssleay32;
- pair.second = libeay32;
+ result.ssl = std::move(ssleay32);
+ result.crypto = std::move(libeay32);
return TRUE;
}
-static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
+static LoadedOpenSsl loadOpenSsl()
{
- QPair<QSystemLibrary*,QSystemLibrary*> pair;
- pair.first = 0;
- pair.second = 0;
+ LoadedOpenSsl result;
#if QT_CONFIG(opensslv11)
// With OpenSSL 1.1 the names have changed to libssl-1_1(-x64) and libcrypto-1_1(-x64), for builds using
@@ -769,7 +771,7 @@ static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
#endif // !Q_PROCESSOR_x86_64
tryToLoadOpenSslWin32Library(QLatin1String("libssl-1_1" QT_SSL_SUFFIX),
- QLatin1String("libcrypto-1_1" QT_SSL_SUFFIX), pair);
+ QLatin1String("libcrypto-1_1" QT_SSL_SUFFIX), result);
#undef QT_SSL_SUFFIX
@@ -778,28 +780,30 @@ static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
// When OpenSSL is built using MSVC then the libraries are named 'ssleay32.dll' and 'libeay32'dll'.
// When OpenSSL is built using GCC then different library names are used (depending on the OpenSSL version)
// The oldest version of a GCC-based OpenSSL which can be detected by the code below is 0.9.8g (released in 2007)
- if (!tryToLoadOpenSslWin32Library(QLatin1String("ssleay32"), QLatin1String("libeay32"), pair)) {
- if (!tryToLoadOpenSslWin32Library(QLatin1String("libssl-10"), QLatin1String("libcrypto-10"), pair)) {
- if (!tryToLoadOpenSslWin32Library(QLatin1String("libssl-8"), QLatin1String("libcrypto-8"), pair)) {
- tryToLoadOpenSslWin32Library(QLatin1String("libssl-7"), QLatin1String("libcrypto-7"), pair);
+ if (!tryToLoadOpenSslWin32Library(QLatin1String("ssleay32"), QLatin1String("libeay32"), result)) {
+ if (!tryToLoadOpenSslWin32Library(QLatin1String("libssl-10"), QLatin1String("libcrypto-10"), result)) {
+ if (!tryToLoadOpenSslWin32Library(QLatin1String("libssl-8"), QLatin1String("libcrypto-8"), result)) {
+ tryToLoadOpenSslWin32Library(QLatin1String("libssl-7"), QLatin1String("libcrypto-7"), result);
}
}
}
#endif // !QT_CONFIG(opensslv11)
- return pair;
+ return result;
}
#else
-static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+struct LoadedOpenSsl {
+ std::unique_ptr<QLibrary> ssl, crypto;
+};
+
+static LoadedOpenSsl loadOpenSsl()
{
- QPair<QLibrary*,QLibrary*> pair;
+ LoadedOpenSsl result = {qt_make_unique<QLibrary>(), qt_make_unique<QLibrary>()};
# if defined(Q_OS_UNIX)
- QLibrary *&libssl = pair.first;
- QLibrary *&libcrypto = pair.second;
- libssl = new QLibrary;
- libcrypto = new QLibrary;
+ QLibrary * const libssl = result.ssl.get();
+ QLibrary * const libcrypto = result.crypto.get();
// Try to find the libssl library on the system.
//
@@ -843,7 +847,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER));
if (libcrypto->load() && libssl->load()) {
// libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
- return pair;
+ return result;
} else {
libssl->unload();
libcrypto->unload();
@@ -862,7 +866,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
libssl->setFileNameAndVersion(QLatin1String("ssl"), fallbackSoname);
libcrypto->setFileNameAndVersion(QLatin1String("crypto"), fallbackSoname);
if (libcrypto->load() && libssl->load()) {
- return pair;
+ return result;
} else {
libssl->unload();
libcrypto->unload();
@@ -899,7 +903,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
# endif
if (libcrypto->load() && libssl->load()) {
// libssl.so.0 and libcrypto.so.0 found
- return pair;
+ return result;
} else {
libssl->unload();
libcrypto->unload();
@@ -924,7 +928,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
if (libssl->load()) {
// libssl.so.x and libcrypto.so.x found
- return pair;
+ return result;
} else {
libssl->unload();
}
@@ -934,41 +938,33 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
}
// failed to load anything
- delete libssl;
- delete libcrypto;
- libssl = libcrypto = 0;
- return pair;
+ result = {};
+ return result;
# else
// not implemented for this platform yet
- return pair;
+ return result;
# endif
}
#endif
+static QBasicMutex symbolResolveMutex;
+static QBasicAtomicInt symbolsResolved = Q_BASIC_ATOMIC_INITIALIZER(false);
+static bool triedToResolveSymbols = false;
+
bool q_resolveOpenSslSymbols()
{
- static bool symbolsResolved = false;
- static bool triedToResolveSymbols = false;
-#if QT_CONFIG(thread)
-#if QT_CONFIG(opensslv11)
- QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_OPENSSL_init_ssl));
-#else
- QMutexLocker locker(QMutexPool::globalInstanceGet((void *)&q_SSL_library_init));
-#endif
-#endif
- if (symbolsResolved)
+ if (symbolsResolved.loadAcquire())
+ return true;
+ QMutexLocker locker(&symbolResolveMutex);
+ if (symbolsResolved.loadRelaxed())
return true;
if (triedToResolveSymbols)
return false;
triedToResolveSymbols = true;
-#ifdef Q_OS_WIN
- QPair<QSystemLibrary *, QSystemLibrary *> libs = loadOpenSslWin32();
-#else
- QPair<QLibrary *, QLibrary *> libs = loadOpenSsl();
-#endif
- if (!libs.first || !libs.second)
+ LoadedOpenSsl libs = loadOpenSsl();
+ if (!libs.ssl || !libs.crypto)
// failed to load them
return false;
@@ -978,6 +974,7 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(OPENSSL_init_crypto)
RESOLVEFUNC(ASN1_STRING_get0_data)
RESOLVEFUNC(EVP_CIPHER_CTX_reset)
+ RESOLVEFUNC(EVP_PKEY_up_ref)
RESOLVEFUNC(EVP_PKEY_base_id)
RESOLVEFUNC(RSA_bits)
RESOLVEFUNC(OPENSSL_sk_new_null)
@@ -1016,8 +1013,6 @@ bool q_resolveOpenSslSymbols()
if (!_q_OpenSSL_version) {
// Apparently, we were built with OpenSSL 1.1 enabled but are now using
// a wrong library.
- delete libs.first;
- delete libs.second;
qCWarning(lcSsl, "Incompatible version of OpenSSL");
return false;
}
@@ -1139,8 +1134,6 @@ bool q_resolveOpenSslSymbols()
// OpenSSL 1.1 has deprecated and removed SSLeay. We consider a failure to
// resolve this symbol as a failure to resolve symbols.
// The right operand of '||' above is ... a bit of paranoia.
- delete libs.first;
- delete libs.second;
qCWarning(lcSsl, "Incompatible version of OpenSSL");
return false;
}
@@ -1204,6 +1197,11 @@ bool q_resolveOpenSslSymbols()
#ifndef OPENSSL_NO_RC2
RESOLVEFUNC(EVP_rc2_cbc)
#endif
+#ifndef OPENSSL_NO_AES
+ RESOLVEFUNC(EVP_aes_128_cbc)
+ RESOLVEFUNC(EVP_aes_192_cbc)
+ RESOLVEFUNC(EVP_aes_256_cbc)
+#endif
RESOLVEFUNC(EVP_sha1)
RESOLVEFUNC(EVP_PKEY_assign)
RESOLVEFUNC(EVP_PKEY_set1_RSA)
@@ -1212,6 +1210,7 @@ bool q_resolveOpenSslSymbols()
#ifndef OPENSSL_NO_EC
RESOLVEFUNC(EVP_PKEY_set1_EC_KEY)
#endif
+ RESOLVEFUNC(EVP_PKEY_cmp)
RESOLVEFUNC(EVP_PKEY_free)
RESOLVEFUNC(EVP_PKEY_get1_DSA)
RESOLVEFUNC(EVP_PKEY_get1_RSA)
@@ -1405,9 +1404,7 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(d2i_PKCS12_bio)
RESOLVEFUNC(PKCS12_free)
- symbolsResolved = true;
- delete libs.first;
- delete libs.second;
+ symbolsResolved.storeRelease(true);
return true;
}
#endif // QT_CONFIG(library)
diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
index 7b604b2ab8..69b2b90fbd 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
@@ -281,14 +281,20 @@ const EVP_CIPHER *q_EVP_des_ede3_cbc();
#ifndef OPENSSL_NO_RC2
const EVP_CIPHER *q_EVP_rc2_cbc();
#endif
+#ifndef OPENSSL_NO_AES
+const EVP_CIPHER *q_EVP_aes_128_cbc();
+const EVP_CIPHER *q_EVP_aes_192_cbc();
+const EVP_CIPHER *q_EVP_aes_256_cbc();
+#endif
Q_AUTOTEST_EXPORT const EVP_MD *q_EVP_sha1();
int q_EVP_PKEY_assign(EVP_PKEY *a, int b, char *c);
Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_RSA(EVP_PKEY *a, RSA *b);
-int q_EVP_PKEY_set1_DSA(EVP_PKEY *a, DSA *b);
-int q_EVP_PKEY_set1_DH(EVP_PKEY *a, DH *b);
+Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_DSA(EVP_PKEY *a, DSA *b);
+Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_DH(EVP_PKEY *a, DH *b);
#ifndef OPENSSL_NO_EC
-int q_EVP_PKEY_set1_EC_KEY(EVP_PKEY *a, EC_KEY *b);
+Q_AUTOTEST_EXPORT int q_EVP_PKEY_set1_EC_KEY(EVP_PKEY *a, EC_KEY *b);
#endif
+Q_AUTOTEST_EXPORT int q_EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
Q_AUTOTEST_EXPORT void q_EVP_PKEY_free(EVP_PKEY *a);
RSA *q_EVP_PKEY_get1_RSA(EVP_PKEY *a);
DSA *q_EVP_PKEY_get1_DSA(EVP_PKEY *a);
diff --git a/src/network/ssl/qsslsocket_opensslpre11.cpp b/src/network/ssl/qsslsocket_opensslpre11.cpp
index f5aab821ea..2af437f0fa 100644
--- a/src/network/ssl/qsslsocket_opensslpre11.cpp
+++ b/src/network/ssl/qsslsocket_opensslpre11.cpp
@@ -67,7 +67,6 @@
#include <QtCore/qthread.h>
#include <QtCore/qfile.h>
#include <QtCore/qmutex.h>
-#include <QtCore/qlibrary.h>
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/qsslsocket_qt.cpp b/src/network/ssl/qsslsocket_qt.cpp
index b0fb60ea76..9ff9a66c05 100644
--- a/src/network/ssl/qsslsocket_qt.cpp
+++ b/src/network/ssl/qsslsocket_qt.cpp
@@ -72,6 +72,7 @@ static QAsn1Element _q_PKCS7_data(const QByteArray &data)
Some test vectors:
http://www.drh-consultancy.demon.co.uk/test.txt
+ \internal
*/
static QByteArray _q_PKCS12_keygen(char id, const QByteArray &salt, const QString &passPhrase, int n, int r)
{
diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp
index 46c109b6e5..c6e3e4d786 100644
--- a/src/network/ssl/qsslsocket_schannel.cpp
+++ b/src/network/ssl/qsslsocket_schannel.cpp
@@ -435,7 +435,7 @@ QByteArray createAlpnString(const QByteArrayList &nextAllowedProtocols)
bool QSslSocketPrivate::s_loadRootCertsOnDemand = true;
bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_schannel_mutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, qt_schannel_mutex)
void QSslSocketPrivate::ensureInitialized()
{
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
index d54ac2ad73..39c1ce55e3 100644
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ b/src/network/ssl/qsslsocket_winrt.cpp
@@ -177,6 +177,7 @@ void QSslSocketPrivate::ensureInitialized()
long QSslSocketPrivate::sslLibraryVersionNumber()
{
+ // ### Qt 6: Find a proper replacement for the deprecated method below.
return QSysInfo::windowsVersion();
}
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index ec472da2e8..d23b3ad550 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -372,7 +372,7 @@ private:
class QGLEngineShaderProg
{
public:
- QGLEngineShaderProg() : program(0) {}
+ QGLEngineShaderProg() : program(nullptr) {}
~QGLEngineShaderProg() {
if (program)
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index cc97bed3f7..2546f6dc13 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1391,13 +1391,19 @@ void QGL2PaintEngineEx::renderHintsChanged()
state()->renderHintsChanged = true;
#if !defined(QT_OPENGL_ES_2)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
if (!d->ctx->contextHandle()->isOpenGLES()) {
if ((state()->renderHints & QPainter::Antialiasing)
- || (state()->renderHints & QPainter::HighQualityAntialiasing))
+#if QT_DEPRECATED_SINCE(5, 14)
+ || (state()->renderHints & QPainter::HighQualityAntialiasing)
+#endif
+ )
d->glEnable(GL_MULTISAMPLE);
else
d->glDisable(GL_MULTISAMPLE);
}
+QT_WARNING_POP
#endif
d->lastTextureUsed = GLuint(-1);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index abf5b8ea48..762aac2f65 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -175,9 +175,9 @@ public:
QGL2PaintEngineExPrivate(QGL2PaintEngineEx *q_ptr) :
q(q_ptr),
- shaderManager(0),
+ shaderManager(nullptr),
width(0), height(0),
- ctx(0),
+ ctx(nullptr),
useSystemClip(true),
elementIndicesVBOId(0),
opacityArray(0),
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index e76216ef5d..7c12ce8998 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -139,7 +139,7 @@ public:
inline void setPaintEnginePrivate(QGL2PaintEngineExPrivate *p) { pex = p; }
- inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : 0; }
+ inline const QOpenGLContextGroup *contextGroup() const { return m_textureResource ? m_textureResource->group() : nullptr; }
inline int serialNumber() const { return m_serialNumber; }
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 799e984a68..2c5a40a992 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -397,7 +397,7 @@ QGLFormat::QGLFormat(QGL::FormatOptions options, int plane)
*/
void QGLFormat::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QGLFormatPrivate *newd = new QGLFormatPrivate(d);
if (!d->ref.deref())
delete d;
@@ -1667,11 +1667,6 @@ bool operator!=(const QGLFormat& a, const QGLFormat& b)
}
struct QGLContextGroupList {
- QGLContextGroupList()
- : m_mutex(QMutex::Recursive)
- {
- }
-
void append(QGLContextGroup *group) {
QMutexLocker locker(&m_mutex);
m_list.append(group);
@@ -1683,7 +1678,7 @@ struct QGLContextGroupList {
}
QList<QGLContextGroup *> m_list;
- QMutex m_mutex;
+ QRecursiveMutex m_mutex;
};
Q_GLOBAL_STATIC(QGLContextGroupList, qt_context_groups)
@@ -5208,7 +5203,7 @@ void QGLContextGroup::addShare(const QGLContext *context, const QGLContext *shar
return;
// Make sure 'context' is not already shared with another group of contexts.
- Q_ASSERT(context->d_ptr->group->m_refs.load() == 1);
+ Q_ASSERT(context->d_ptr->group->m_refs.loadRelaxed() == 1);
// Free 'context' group resources and make it use the same resources as 'share'.
QGLContextGroup *group = share->d_ptr->group;
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index ed364283cc..4e52c0f5e9 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -203,7 +203,7 @@ const QGLContext *qt_gl_transfer_context(const QGLContext *);
class QGLTemporaryContextPrivate;
class QGLTemporaryContext {
public:
- explicit QGLTemporaryContext(bool directRendering = true, QWidget *parent = 0);
+ explicit QGLTemporaryContext(bool directRendering = true, QWidget *parent = nullptr);
~QGLTemporaryContext();
private:
@@ -302,7 +302,7 @@ class Q_OPENGL_EXPORT QGLShareContextScope
{
public:
QGLShareContextScope(const QGLContext *ctx)
- : m_oldContext(0)
+ : m_oldContext(nullptr)
{
QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
if (currentContext != ctx && !QGLContext::areSharing(ctx, currentContext)) {
@@ -367,7 +367,7 @@ Q_SIGNALS:
class QGLTexture {
public:
- explicit QGLTexture(QGLContext *ctx = 0, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D,
+ explicit QGLTexture(QGLContext *ctx = nullptr, GLuint tx_id = 0, GLenum tx_target = GL_TEXTURE_2D,
QGLContext::BindOptions opt = QGLContext::DefaultBindOption)
: context(ctx),
id(tx_id),
@@ -378,7 +378,7 @@ public:
~QGLTexture() {
if (options & QGLContext::MemoryManagedBindOption) {
Q_ASSERT(context);
- QPlatformPixmap *boundPixmap = 0;
+ QPlatformPixmap *boundPixmap = nullptr;
context->d_ptr->texture_destroyer->emitFreeTexture(context, boundPixmap, id);
}
}
@@ -392,9 +392,9 @@ public:
bool canBindCompressedTexture
(const char *buf, int len, const char *format, bool *hasAlpha);
QSize bindCompressedTexture
- (const QString& fileName, const char *format = 0);
+ (const QString& fileName, const char *format = nullptr);
QSize bindCompressedTexture
- (const char *buf, int len, const char *format = 0);
+ (const char *buf, int len, const char *format = nullptr);
QSize bindCompressedTextureDDS(const char *buf, int len);
QSize bindCompressedTexturePVR(const char *buf, int len);
};
diff --git a/src/opengl/qglcolormap.cpp b/src/opengl/qglcolormap.cpp
index d607363ac0..f314a9715d 100644
--- a/src/opengl/qglcolormap.cpp
+++ b/src/opengl/qglcolormap.cpp
@@ -153,7 +153,7 @@ QGLColormap & QGLColormap::operator=(const QGLColormap &map)
void QGLColormap::detach_helper()
{
QGLColormapData *x = new QGLColormapData;
- x->ref.store(1);
+ x->ref.storeRelaxed(1);
x->cmapHandle = 0;
x->cells = 0;
if (d->cells) {
diff --git a/src/opengl/qglcolormap.h b/src/opengl/qglcolormap.h
index 772e327e34..b59b56e040 100644
--- a/src/opengl/qglcolormap.h
+++ b/src/opengl/qglcolormap.h
@@ -90,7 +90,7 @@ private:
inline void QGLColormap::detach()
{
- if (d->ref.load() != 1)
+ if (d->ref.loadRelaxed() != 1)
detach_helper();
}
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index b2158ebfaa..d0f82a85fa 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -145,7 +145,7 @@ extern QImage qt_gl_read_frame_buffer(const QSize&, bool, bool);
*/
void QGLFramebufferObjectFormat::detach()
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
QGLFramebufferObjectFormatPrivate *newd
= new QGLFramebufferObjectFormatPrivate(d);
if (!d->ref.deref())
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index bf5e21cf0b..9d536527c3 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -124,9 +124,9 @@ private:
class QGLFramebufferObjectPrivate
{
public:
- QGLFramebufferObjectPrivate() : fbo_guard(0), texture_guard(0), depth_buffer_guard(0)
- , stencil_buffer_guard(0), color_buffer_guard(0)
- , valid(false), engine(0) {}
+ QGLFramebufferObjectPrivate() : fbo_guard(nullptr), texture_guard(nullptr), depth_buffer_guard(nullptr)
+ , stencil_buffer_guard(nullptr), color_buffer_guard(nullptr)
+ , valid(false), engine(nullptr) {}
~QGLFramebufferObjectPrivate() {}
void init(QGLFramebufferObject *q, const QSize& sz,
diff --git a/src/opengl/qglpixelbuffer_p.h b/src/opengl/qglpixelbuffer_p.h
index 9125fcfb4b..2729ade2b6 100644
--- a/src/opengl/qglpixelbuffer_p.h
+++ b/src/opengl/qglpixelbuffer_p.h
@@ -77,7 +77,7 @@ private:
class QGLPixelBufferPrivate {
Q_DECLARE_PUBLIC(QGLPixelBuffer)
public:
- QGLPixelBufferPrivate(QGLPixelBuffer *q) : q_ptr(q), invalid(true), qctx(0), widget(0), fbo(0), blit_fbo(0), pbuf(0), ctx(0)
+ QGLPixelBufferPrivate(QGLPixelBuffer *q) : q_ptr(q), invalid(true), qctx(nullptr), widget(nullptr), fbo(nullptr), blit_fbo(nullptr), pbuf(nullptr), ctx(nullptr)
{
}
bool init(const QSize &size, const QGLFormat &f, QGLWidget *shareWidget);
diff --git a/src/opengl/qgraphicsshadereffect_p.h b/src/opengl/qgraphicsshadereffect_p.h
index 1a32f24d70..218caa2936 100644
--- a/src/opengl/qgraphicsshadereffect_p.h
+++ b/src/opengl/qgraphicsshadereffect_p.h
@@ -67,7 +67,7 @@ class Q_OPENGL_EXPORT QGraphicsShaderEffect : public QGraphicsEffect
{
Q_OBJECT
public:
- QGraphicsShaderEffect(QObject *parent = 0);
+ QGraphicsShaderEffect(QObject *parent = nullptr);
virtual ~QGraphicsShaderEffect();
QByteArray pixelShaderFragment() const;
diff --git a/src/platformheaders/nativecontexts/qeglnativecontext.h b/src/platformheaders/nativecontexts/qeglnativecontext.h
index d4a0e998da..5af2b304fe 100644
--- a/src/platformheaders/nativecontexts/qeglnativecontext.h
+++ b/src/platformheaders/nativecontexts/qeglnativecontext.h
@@ -54,8 +54,8 @@ typedef int EGLDisplay;
struct QEGLNativeContext
{
QEGLNativeContext()
- : m_context(0),
- m_display(0)
+ : m_context(nullptr),
+ m_display(nullptr)
{ }
QEGLNativeContext(EGLContext ctx, EGLDisplay dpy)
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_p.h
index b1ce14b5c3..f1f50e9708 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_p.h
@@ -86,7 +86,7 @@ public:
Q_ENUM(QDeviceType)
Q_DECLARE_FLAGS(QDeviceTypes, QDeviceType)
- static QDeviceDiscovery *create(QDeviceTypes type, QObject *parent = 0);
+ static QDeviceDiscovery *create(QDeviceTypes type, QObject *parent = nullptr);
virtual QStringList scanConnectedDevices() = 0;
diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h b/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h
index 28618d0b21..82b475776d 100644
--- a/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h
+++ b/src/platformsupport/devicediscovery/qdevicediscovery_udev_p.h
@@ -61,7 +61,7 @@ class QDeviceDiscoveryUDev : public QDeviceDiscovery
Q_OBJECT
public:
- QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev, QObject *parent = 0);
+ QDeviceDiscoveryUDev(QDeviceTypes types, struct udev *udev, QObject *parent = nullptr);
~QDeviceDiscoveryUDev();
QStringList scanConnectedDevices() override;
diff --git a/src/platformsupport/edid/qedidparser.cpp b/src/platformsupport/edid/qedidparser.cpp
index 06c8852825..6bf1f1db96 100644
--- a/src/platformsupport/edid/qedidparser.cpp
+++ b/src/platformsupport/edid/qedidparser.cpp
@@ -42,8 +42,6 @@
#include "qedidparser_p.h"
#include "qedidvendortable_p.h"
-#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
-
#define EDID_DESCRIPTOR_ALPHANUMERIC_STRING 0xfe
#define EDID_DESCRIPTOR_PRODUCT_NAME 0xfc
#define EDID_DESCRIPTOR_SERIAL_NUMBER 0xff
@@ -139,9 +137,9 @@ bool QEdidParser::parse(const QByteArray &blob)
manufacturer = m_vendorCache.value(pnpIdString);
if (manufacturer.isEmpty()) {
// Find the manufacturer from the vendor lookup table
- for (size_t i = 0; i < ARRAY_LENGTH(q_edidVendorTable); i++) {
- if (strncmp(q_edidVendorTable[i].id, pnpId, 3) == 0) {
- manufacturer = QString::fromUtf8(q_edidVendorTable[i].name);
+ for (const auto &vendor : q_edidVendorTable) {
+ if (strncmp(vendor.id, pnpId, 3) == 0) {
+ manufacturer = QString::fromUtf8(vendor.name);
break;
}
}
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 0285e067a6..8ad2eb7248 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -60,7 +60,7 @@ class QEGLPbuffer : public QPlatformOffscreenSurface
{
public:
QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffscreenSurface *offscreenSurface,
- QEGLPlatformContext::Flags flags = 0);
+ QEGLPlatformContext::Flags flags = nullptr);
~QEGLPbuffer();
QSurfaceFormat format() const override { return m_format; }
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index d6cbbe4131..ed77c57df5 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -68,8 +68,8 @@ public:
Q_DECLARE_FLAGS(Flags, Flag)
QEGLPlatformContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display,
- EGLConfig *config = 0, const QVariant &nativeHandle = QVariant(),
- Flags flags = 0);
+ EGLConfig *config = nullptr, const QVariant &nativeHandle = QVariant(),
+ Flags flags = nullptr);
~QEGLPlatformContext();
void initialize() override;
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
index 085a1c52f3..b9254d3071 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
+++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib_p.h
@@ -64,7 +64,7 @@ class QPAEventDispatcherGlib : public QEventDispatcherGlib
Q_DECLARE_PRIVATE(QPAEventDispatcherGlib)
public:
- explicit QPAEventDispatcherGlib(QObject *parent = 0);
+ explicit QPAEventDispatcherGlib(QObject *parent = nullptr);
~QPAEventDispatcherGlib();
bool processEvents(QEventLoop::ProcessEventsFlags flags) override;
@@ -77,7 +77,7 @@ class QPAEventDispatcherGlibPrivate : public QEventDispatcherGlibPrivate
{
Q_DECLARE_PUBLIC(QPAEventDispatcherGlib)
public:
- QPAEventDispatcherGlibPrivate(GMainContext *context = 0);
+ QPAEventDispatcherGlibPrivate(GMainContext *context = nullptr);
GUserEventSource *userEventSource;
};
diff --git a/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h b/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h
index 7f775b73ee..8157b8793d 100644
--- a/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h
+++ b/src/platformsupport/eventdispatchers/qunixeventdispatcher_qpa_p.h
@@ -61,7 +61,7 @@ class QUnixEventDispatcherQPA : public QEventDispatcherUNIX
Q_OBJECT
public:
- explicit QUnixEventDispatcherQPA(QObject *parent = 0);
+ explicit QUnixEventDispatcherQPA(QObject *parent = nullptr);
~QUnixEventDispatcherQPA();
bool processEvents(QEventLoop::ProcessEventsFlags flags);
diff --git a/src/platformsupport/fbconvenience/qfbvthandler_p.h b/src/platformsupport/fbconvenience/qfbvthandler_p.h
index 17d07317b2..d565ec3632 100644
--- a/src/platformsupport/fbconvenience/qfbvthandler_p.h
+++ b/src/platformsupport/fbconvenience/qfbvthandler_p.h
@@ -63,7 +63,7 @@ class QFbVtHandler : public QObject
Q_OBJECT
public:
- QFbVtHandler(QObject *parent = 0);
+ QFbVtHandler(QObject *parent = nullptr);
~QFbVtHandler();
signals:
diff --git a/src/platformsupport/fbconvenience/qfbwindow.cpp b/src/platformsupport/fbconvenience/qfbwindow.cpp
index 36f92b8cea..9f5f87d9d6 100644
--- a/src/platformsupport/fbconvenience/qfbwindow.cpp
+++ b/src/platformsupport/fbconvenience/qfbwindow.cpp
@@ -45,11 +45,12 @@
QT_BEGIN_NAMESPACE
+static QBasicAtomicInt winIdGenerator = Q_BASIC_ATOMIC_INITIALIZER(0);
+
QFbWindow::QFbWindow(QWindow *window)
: QPlatformWindow(window), mBackingStore(0), mWindowState(Qt::WindowNoState)
{
- static QAtomicInt winIdGenerator(1);
- mWindowId = winIdGenerator.fetchAndAddRelaxed(1);
+ mWindowId = winIdGenerator.fetchAndAddRelaxed(1) + 1;
}
QFbWindow::~QFbWindow()
diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
index e545d54ec2..7abf295782 100644
--- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
+++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp
@@ -721,7 +721,7 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString &family, QFont
FcValue value;
value.type = FcTypeString;
- QByteArray cs = family.toUtf8();
+ const QByteArray cs = family.toUtf8();
value.u.s = (const FcChar8 *)cs.data();
FcPatternAdd(pattern,FC_FAMILY,value,true);
@@ -863,7 +863,7 @@ QString QFontconfigDatabase::resolveFontFamilyAlias(const QString &family) const
return family;
if (!family.isEmpty()) {
- QByteArray cs = family.toUtf8();
+ const QByteArray cs = family.toUtf8();
FcPatternAddString(pattern, FC_FAMILY, (const FcChar8 *) cs.constData());
}
FcConfigSubstitute(0, pattern, FcMatchPattern);
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
index 08e652b2a0..8c6cc8fbc1 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
@@ -121,13 +121,12 @@ class QtFreetypeData
{
public:
QtFreetypeData()
- : library(0), hasPatentFreeLcdRendering(false)
+ : library(0)
{ }
~QtFreetypeData();
FT_Library library;
QHash<QFontEngine::FaceId, QFreetypeFace *> faces;
- bool hasPatentFreeLcdRendering;
};
QtFreetypeData::~QtFreetypeData()
@@ -153,11 +152,6 @@ QtFreetypeData *qt_getFreetypeData()
FT_Bool no_darkening = false;
FT_Property_Set(freetypeData->library, "cff", "no-stem-darkening", &no_darkening);
#endif
- // FreeType has since 2.8.1 a patent free alternative to LCD-filtering.
- FT_Int amajor, aminor = 0, apatch = 0;
- FT_Library_Version(freetypeData->library, &amajor, &aminor, &apatch);
- if (QT_VERSION_CHECK(amajor, aminor, apatch) >= QT_VERSION_CHECK(2, 8, 1))
- freetypeData->hasPatentFreeLcdRendering = true;
}
return freetypeData;
}
@@ -260,7 +254,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id,
}
newFreetype->face = face;
- newFreetype->ref.store(1);
+ newFreetype->ref.storeRelaxed(1);
newFreetype->xsize = 0;
newFreetype->ysize = 0;
newFreetype->matrix.xx = 0x10000;
@@ -556,26 +550,7 @@ void QFreetypeFace::addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point,
slot->bitmap.buffer, slot->bitmap.pitch, slot->bitmap.width, slot->bitmap.rows, path);
}
-struct LcdFilterDummy
-{
- static inline void filterPixel(uchar &, uchar &, uchar &)
- {}
-};
-
-struct LcdFilterLegacy
-{
- static inline void filterPixel(uchar &red, uchar &green, uchar &blue)
- {
- uint r = red, g = green, b = blue;
- // intra-pixel filter used by the legacy filter (adopted from _ft_lcd_filter_legacy)
- red = (r * uint(65538 * 9/13) + g * uint(65538 * 1/6) + b * uint(65538 * 1/13)) / 65536;
- green = (r * uint(65538 * 3/13) + g * uint(65538 * 4/6) + b * uint(65538 * 3/13)) / 65536;
- blue = (r * uint(65538 * 1/13) + g * uint(65538 * 1/6) + b * uint(65538 * 9/13)) / 65536;
- }
-};
-
-template <typename LcdFilter>
-static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
+static inline void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
{
const int offs = bgr ? -1 : 1;
const int w = width * 3;
@@ -585,7 +560,6 @@ static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int
uchar red = src[x + 1 - offs];
uchar green = src[x + 1];
uchar blue = src[x + 1 + offs];
- LcdFilter::filterPixel(red, green, blue);
*dd++ = (0xFFU << 24) | (red << 16) | (green << 8) | blue;
}
dst += width;
@@ -593,16 +567,7 @@ static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int
}
}
-static inline void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
-{
- if (!legacyFilter)
- convertRGBToARGB_helper<LcdFilterDummy>(src, dst, width, height, src_pitch, bgr);
- else
- convertRGBToARGB_helper<LcdFilterLegacy>(src, dst, width, height, src_pitch, bgr);
-}
-
-template <typename LcdFilter>
-static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
+static inline void convertRGBToARGB_V(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
{
const int offs = bgr ? -src_pitch : src_pitch;
while (height--) {
@@ -610,54 +575,12 @@ static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, in
uchar red = src[x + src_pitch - offs];
uchar green = src[x + src_pitch];
uchar blue = src[x + src_pitch + offs];
- LcdFilter::filterPixel(red, green, blue);
*dst++ = (0XFFU << 24) | (red << 16) | (green << 8) | blue;
}
src += 3*src_pitch;
}
}
-static inline void convertRGBToARGB_V(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
-{
- if (!legacyFilter)
- convertRGBToARGB_V_helper<LcdFilterDummy>(src, dst, width, height, src_pitch, bgr);
- else
- convertRGBToARGB_V_helper<LcdFilterLegacy>(src, dst, width, height, src_pitch, bgr);
-}
-
-static inline void convertGRAYToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch)
-{
- while (height--) {
- const uchar *p = src;
- const uchar * const e = p + width;
- while (p < e) {
- uchar gray = *p++;
- *dst++ = (0xFFU << 24) | (gray << 16) | (gray << 8) | gray;
- }
- src += src_pitch;
- }
-}
-
-static void convoluteBitmap(const uchar *src, uchar *dst, int width, int height, int pitch)
-{
- // convolute the bitmap with a triangle filter to get rid of color fringes
- // If we take account for a gamma value of 2, we end up with
- // weights of 1, 4, 9, 4, 1. We use an approximation of 1, 3, 8, 3, 1 here,
- // as this nicely sums up to 16 :)
- int h = height;
- while (h--) {
- dst[0] = dst[1] = 0;
- //
- for (int x = 2; x < width - 2; ++x) {
- uint sum = src[x-2] + 3*src[x-1] + 8*src[x] + 3*src[x+1] + src[x+2];
- dst[x] = (uchar) (sum >> 4);
- }
- dst[width - 2] = dst[width - 1] = 0;
- src += pitch;
- dst += pitch;
- }
-}
-
static QFontEngine::SubpixelAntialiasingType subpixelAntialiasingTypeHint()
{
static int type = -1;
@@ -1148,126 +1071,49 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
int glyph_buffer_size = 0;
QScopedArrayPointer<uchar> glyph_buffer;
- bool useFreetypeRenderGlyph = false;
- if (slot->format == FT_GLYPH_FORMAT_OUTLINE && (hsubpixel || vfactor != 1)) {
- err = FT_Library_SetLcdFilter(slot->library, (FT_LcdFilter)lcdFilterType);
- // We use FT_Render_Glyph if freetype has support for lcd-filtering
- // or is version 2.8.1 or higher and can do without.
- if (err == FT_Err_Ok || qt_getFreetypeData()->hasPatentFreeLcdRendering)
- useFreetypeRenderGlyph = true;
+ FT_Render_Mode renderMode = (default_hint_style == HintLight) ? FT_RENDER_MODE_LIGHT : FT_RENDER_MODE_NORMAL;
+ switch (format) {
+ case Format_Mono:
+ renderMode = FT_RENDER_MODE_MONO;
+ break;
+ case Format_A32:
+ Q_ASSERT(hsubpixel || vfactor != 1);
+ renderMode = hsubpixel ? FT_RENDER_MODE_LCD : FT_RENDER_MODE_LCD_V;
+ break;
+ case Format_A8:
+ case Format_ARGB:
+ break;
+ default:
+ Q_UNREACHABLE();
}
- if (useFreetypeRenderGlyph) {
- err = FT_Render_Glyph(slot, hsubpixel ? FT_RENDER_MODE_LCD : FT_RENDER_MODE_LCD_V);
-
- if (err != FT_Err_Ok)
- qWarning("render glyph failed err=%x face=%p, glyph=%d", err, face, glyph);
-
- FT_Library_SetLcdFilter(slot->library, FT_LCD_FILTER_NONE);
+ FT_Library_SetLcdFilter(slot->library, (FT_LcdFilter)lcdFilterType);
- info.height = slot->bitmap.rows / vfactor;
- info.width = hsubpixel ? slot->bitmap.width / 3 : slot->bitmap.width;
- info.x = slot->bitmap_left;
- info.y = slot->bitmap_top;
+ err = FT_Render_Glyph(slot, renderMode);
+ if (err != FT_Err_Ok)
+ qWarning("render glyph failed err=%x face=%p, glyph=%d", err, face, glyph);
- glyph_buffer_size = info.width * info.height * 4;
- glyph_buffer.reset(new uchar[glyph_buffer_size]);
+ FT_Library_SetLcdFilter(slot->library, FT_LCD_FILTER_NONE);
- if (hsubpixel)
- convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_RGB, false);
- else if (vfactor != 1)
- convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_VRGB, false);
- } else {
- int left = slot->metrics.horiBearingX;
- int right = slot->metrics.horiBearingX + slot->metrics.width;
- int top = slot->metrics.horiBearingY;
- int bottom = slot->metrics.horiBearingY - slot->metrics.height;
- if (transform && slot->format != FT_GLYPH_FORMAT_BITMAP)
- transformBoundingBox(&left, &top, &right, &bottom, &matrix);
- left = FLOOR(left);
- right = CEIL(right);
- bottom = FLOOR(bottom);
- top = CEIL(top);
-
- int hpixels = TRUNC(right - left);
- // subpixel position requires one more pixel
- if (subPixelPosition > 0 && format != Format_Mono)
- hpixels++;
-
- if (hsubpixel)
- hpixels = hpixels*3 + 8;
- info.width = hpixels;
- info.height = TRUNC(top - bottom);
- info.x = TRUNC(left);
- info.y = TRUNC(top);
- if (hsubpixel) {
- info.width /= 3;
- info.x -= 1;
- }
-
- // If any of the metrics are too large to fit, don't cache them
- if (areMetricsTooLarge(info))
- return 0;
+ info.height = slot->bitmap.rows;
+ info.width = slot->bitmap.width;
+ info.x = slot->bitmap_left;
+ info.y = slot->bitmap_top;
+ if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_LCD)
+ info.width = info.width / 3;
+ if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V)
+ info.height = info.height / vfactor;
int pitch = (format == Format_Mono ? ((info.width + 31) & ~31) >> 3 :
(format == Format_A8 ? (info.width + 3) & ~3 : info.width * 4));
- if (glyph_buffer_size < pitch * info.height) {
- glyph_buffer_size = pitch * info.height;
- glyph_buffer.reset(new uchar[glyph_buffer_size]);
- memset(glyph_buffer.data(), 0, glyph_buffer_size);
- }
- if (slot->format == FT_GLYPH_FORMAT_OUTLINE) {
- FT_Bitmap bitmap;
- bitmap.rows = info.height*vfactor;
- bitmap.width = hpixels;
- bitmap.pitch = format == Format_Mono ? (((info.width + 31) & ~31) >> 3) : ((bitmap.width + 3) & ~3);
- int bitmap_buffer_size = bitmap.rows * bitmap.pitch;
- if (!hsubpixel && vfactor == 1 && format != Format_A32) {
- Q_ASSERT(glyph_buffer_size <= bitmap_buffer_size);
- bitmap.buffer = glyph_buffer.data();
- } else {
- bitmap.buffer = new uchar[bitmap_buffer_size];
- memset(bitmap.buffer, 0, bitmap_buffer_size);
- }
- bitmap.pixel_mode = format == Format_Mono ? FT_PIXEL_MODE_MONO : FT_PIXEL_MODE_GRAY;
- FT_Matrix matrix;
- matrix.xx = (hsubpixel ? 3 : 1) << 16;
- matrix.yy = vfactor << 16;
- matrix.yx = matrix.xy = 0;
-
- FT_Outline_Transform(&slot->outline, &matrix);
- FT_Outline_Translate (&slot->outline, (hsubpixel ? -3*left +(4<<6) : -left), -bottom*vfactor);
- FT_Outline_Get_Bitmap(slot->library, &slot->outline, &bitmap);
- if (hsubpixel) {
- Q_ASSERT (bitmap.pixel_mode == FT_PIXEL_MODE_GRAY);
- Q_ASSERT(antialias);
- uchar *convoluted = new uchar[bitmap_buffer_size];
- bool useLegacyLcdFilter = false;
- useLegacyLcdFilter = (lcdFilterType == FT_LCD_FILTER_LEGACY);
- uchar *buffer = bitmap.buffer;
- if (!useLegacyLcdFilter) {
- convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch);
- buffer = convoluted;
- }
- convertRGBToARGB(buffer + 1, (uint *)glyph_buffer.data(), info.width, info.height, bitmap.pitch, subpixelType != Subpixel_RGB, useLegacyLcdFilter);
- delete [] convoluted;
- } else if (vfactor != 1) {
- convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, bitmap.pitch, subpixelType != Subpixel_VRGB, true);
- } else if (format == Format_A32 && bitmap.pixel_mode == FT_PIXEL_MODE_GRAY) {
- convertGRAYToARGB(bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, bitmap.pitch);
- }
+ glyph_buffer_size = info.height * pitch;
+ glyph_buffer.reset(new uchar[glyph_buffer_size]);
- if (bitmap.buffer != glyph_buffer.data())
- delete [] bitmap.buffer;
- } else if (slot->format == FT_GLYPH_FORMAT_BITMAP) {
-#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100) >= 20500)
- Q_ASSERT(slot->bitmap.pixel_mode == FT_PIXEL_MODE_MONO || slot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA);
-#else
- Q_ASSERT(slot->bitmap.pixel_mode == FT_PIXEL_MODE_MONO);
-#endif
+ if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
uchar *src = slot->bitmap.buffer;
uchar *dst = glyph_buffer.data();
int h = slot->bitmap.rows;
+ // Some fonts return bitmaps even when we requested something else:
if (format == Format_Mono) {
int bytes = ((info.width + 7) & ~7) >> 3;
while (h--) {
@@ -1275,69 +1121,63 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph,
dst += pitch;
src += slot->bitmap.pitch;
}
- } else if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) {
- if (hsubpixel) {
- while (h--) {
- uint *dd = (uint *)dst;
- *dd++ = 0;
- for (int x = 0; x < static_cast<int>(slot->bitmap.width); x++) {
- uint a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffff : 0x000000);
- *dd++ = a;
- }
- *dd++ = 0;
- dst += pitch;
- src += slot->bitmap.pitch;
- }
- } else if (vfactor != 1) {
- while (h--) {
- uint *dd = (uint *)dst;
- for (int x = 0; x < static_cast<int>(slot->bitmap.width); x++) {
- uint a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffff : 0x000000);
- *dd++ = a;
- }
- dst += pitch;
- src += slot->bitmap.pitch;
- }
- } else {
- while (h--) {
- for (int x = 0; x < static_cast<int>(slot->bitmap.width); x++) {
- unsigned char a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xff : 0x00);
- dst[x] = a;
- }
- dst += pitch;
- src += slot->bitmap.pitch;
- }
+ } else if (format == Format_A8) {
+ while (h--) {
+ for (int x = 0; x < int{info.width}; x++)
+ dst[x] = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xff : 0x00);
+ dst += pitch;
+ src += slot->bitmap.pitch;
}
- }
-#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100) >= 20500)
- else if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_BGRA)
- {
+ } else {
while (h--) {
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
- const quint32 *srcPixel = (const quint32 *)src;
- quint32 *dstPixel = (quint32 *)dst;
- for (int x = 0; x < static_cast<int>(slot->bitmap.width); x++, srcPixel++, dstPixel++) {
- const quint32 pixel = *srcPixel;
- *dstPixel = qbswap(pixel);
- }
-#else
- memcpy(dst, src, slot->bitmap.width * 4);
-#endif
- dst += slot->bitmap.pitch;
+ uint *dd = reinterpret_cast<uint *>(dst);
+ for (int x = 0; x < int{info.width}; x++)
+ dd[x] = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffffff : 0x00000000);
+ dst += pitch;
src += slot->bitmap.pitch;
}
- info.width = info.linearAdvance = info.xOff = slot->bitmap.width;
- info.height = slot->bitmap.rows;
- info.x = slot->bitmap_left;
- info.y = slot->bitmap_top;
}
+ } else if (slot->bitmap.pixel_mode == 7 /*FT_PIXEL_MODE_BGRA*/) {
+ Q_ASSERT(format == Format_ARGB);
+ uchar *src = slot->bitmap.buffer;
+ uchar *dst = glyph_buffer.data();
+ int h = slot->bitmap.rows;
+ while (h--) {
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ const quint32 *srcPixel = (const quint32 *)src;
+ quint32 *dstPixel = (quint32 *)dst;
+ for (int x = 0; x < static_cast<int>(slot->bitmap.width); x++, srcPixel++, dstPixel++) {
+ const quint32 pixel = *srcPixel;
+ *dstPixel = qbswap(pixel);
+ }
+#else
+ memcpy(dst, src, slot->bitmap.width * 4);
#endif
+ dst += slot->bitmap.pitch;
+ src += slot->bitmap.pitch;
+ }
+ info.linearAdvance = info.xOff = slot->bitmap.width;
+ } else if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY) {
+ Q_ASSERT(format == Format_A8);
+ uchar *src = slot->bitmap.buffer;
+ uchar *dst = glyph_buffer.data();
+ int h = slot->bitmap.rows;
+ int bytes = info.width;
+ while (h--) {
+ memcpy (dst, src, bytes);
+ dst += pitch;
+ src += slot->bitmap.pitch;
+ }
+ } else if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_LCD) {
+ Q_ASSERT(format == Format_A32);
+ convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_RGB);
+ } else if (slot->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V) {
+ Q_ASSERT(format == Format_A32);
+ convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer.data(), info.width, info.height, slot->bitmap.pitch, subpixelType != Subpixel_VRGB);
} else {
- qWarning("QFontEngine: Glyph neither outline nor bitmap format=%d", slot->format);
+ qWarning("QFontEngine: Glyph rendered in unknown pixel_mode=%d", slot->bitmap.pixel_mode);
return 0;
}
- }
-
if (!g) {
g = new Glyph;
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
index 2863d206d2..2e3aef6979 100644
--- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
+++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h
@@ -116,11 +116,11 @@ private:
friend class QFontEngineFT;
friend class QtFreetypeData;
friend struct QScopedPointerDeleter<QFreetypeFace>;
- QFreetypeFace() : _lock(QMutex::Recursive) {}
+ QFreetypeFace() = default;
~QFreetypeFace() {}
void cleanup();
QAtomicInt ref;
- QMutex _lock;
+ QRecursiveMutex _lock;
QByteArray fontData;
QFontEngine::Holder hbFace;
@@ -252,7 +252,7 @@ private:
inline bool isScalableBitmap() const { return freetype->isScalableBitmap(); }
inline Glyph *loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format = Format_None, bool fetchMetricsOnly = false, bool disableOutlineDrawing = false) const
- { return loadGlyph(cacheEnabled ? &defaultGlyphSet : 0, glyph, subPixelPosition, format, fetchMetricsOnly, disableOutlineDrawing); }
+ { return loadGlyph(cacheEnabled ? &defaultGlyphSet : nullptr, glyph, subPixelPosition, format, fetchMetricsOnly, disableOutlineDrawing); }
Glyph *loadGlyph(QGlyphSet *set, uint glyph, QFixed subPixelPosition, GlyphFormat = Format_None, bool fetchMetricsOnly = false, bool disableOutlineDrawing = false) const;
Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format, const QTransform &t, bool fetchBoundingBox = false, bool disableOutlineDrawing = false);
diff --git a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp
index adc2f6c1fe..25c10fbd3c 100644
--- a/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp
@@ -127,7 +127,7 @@ QStringList QFreeTypeFontDatabase::addTTFile(const QByteArray &fontData, const Q
error = FT_New_Face(library, file.constData(), index, &face);
}
if (error != FT_Err_Ok) {
- qDebug() << "FT_New_Face failed with index" << index << ':' << hex << error;
+ qDebug() << "FT_New_Face failed with index" << index << ':' << Qt::hex << error;
break;
}
numFaces = face->num_faces;
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index c450e91d49..daa3dc94ea 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -48,6 +48,8 @@
#import <UIKit/UIFont.h>
#endif
+#include <QtCore/qelapsedtimer.h>
+
#include "qcoretextfontdatabase_p.h"
#include "qfontengine_coretext_p.h"
#if QT_CONFIG(settings)
@@ -100,20 +102,6 @@ static const char *languageForWritingSystem[] = {
};
enum { LanguageCount = sizeof(languageForWritingSystem) / sizeof(const char *) };
-#ifdef Q_OS_OSX
-static NSInteger languageMapSort(id obj1, id obj2, void *context)
-{
- NSArray<NSString *> *map1 = reinterpret_cast<NSArray<NSString *> *>(obj1);
- NSArray<NSString *> *map2 = reinterpret_cast<NSArray<NSString *> *>(obj2);
- NSArray<NSString *> *languages = reinterpret_cast<NSArray<NSString *> *>(context);
-
- NSString *lang1 = [map1 objectAtIndex:0];
- NSString *lang2 = [map2 objectAtIndex:0];
-
- return [languages indexOfObject:lang1] - [languages indexOfObject:lang2];
-}
-#endif
-
QCoreTextFontDatabase::QCoreTextFontDatabase()
: m_hasPopulatedAliases(false)
{
@@ -127,39 +115,77 @@ QCoreTextFontDatabase::~QCoreTextFontDatabase()
void QCoreTextFontDatabase::populateFontDatabase()
{
+ qCDebug(lcQpaFonts) << "Populating font database...";
+ QElapsedTimer elapsed;
+ if (lcQpaFonts().isDebugEnabled())
+ elapsed.start();
+
QCFType<CFArrayRef> familyNames = CTFontManagerCopyAvailableFontFamilyNames();
for (NSString *familyName in familyNames.as<const NSArray *>())
QPlatformFontDatabase::registerFontFamily(QString::fromNSString(familyName));
+ qCDebug(lcQpaFonts) << "Populating available families took" << elapsed.restart() << "ms";
+
// Force creating the theme fonts to get the descriptors in m_systemFontDescriptors
if (m_themeFonts.isEmpty())
(void)themeFonts();
+ qCDebug(lcQpaFonts) << "Resolving theme fonts took" << elapsed.restart() << "ms";
+
Q_FOREACH (CTFontDescriptorRef fontDesc, m_systemFontDescriptors)
populateFromDescriptor(fontDesc);
+ qCDebug(lcQpaFonts) << "Populating system descriptors took" << elapsed.restart() << "ms";
+
Q_ASSERT(!m_hasPopulatedAliases);
}
-bool QCoreTextFontDatabase::populateFamilyAliases()
+bool QCoreTextFontDatabase::populateFamilyAliases(const QString &missingFamily)
{
#if defined(Q_OS_MACOS)
if (m_hasPopulatedAliases)
return false;
+ // There's no API to go from a localized family name to its non-localized
+ // name, so we have to resort to enumerating all the available fonts and
+ // doing a reverse lookup.
+
+ qCDebug(lcQpaFonts) << "Populating family aliases...";
+ QElapsedTimer elapsed;
+ elapsed.start();
+
+ QString nonLocalizedMatch;
QCFType<CFArrayRef> familyNames = CTFontManagerCopyAvailableFontFamilyNames();
+ NSFontManager *fontManager = NSFontManager.sharedFontManager;
for (NSString *familyName in familyNames.as<const NSArray *>()) {
- NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSString *localizedFamilyName = [fontManager localizedNameForFamily:familyName face:nil];
if (![localizedFamilyName isEqual:familyName]) {
- QPlatformFontDatabase::registerAliasToFontFamily(
- QString::fromNSString(familyName),
- QString::fromNSString(localizedFamilyName));
+ QString nonLocalizedFamily = QString::fromNSString(familyName);
+ QString localizedFamily = QString::fromNSString(localizedFamilyName);
+ QPlatformFontDatabase::registerAliasToFontFamily(nonLocalizedFamily, localizedFamily);
+ if (localizedFamily == missingFamily)
+ nonLocalizedMatch = nonLocalizedFamily;
}
}
m_hasPopulatedAliases = true;
+
+ if (lcQpaFonts().isWarningEnabled()) {
+ QString warningMessage;
+ QDebug msg(&warningMessage);
+
+ msg << "Populating font family aliases took" << elapsed.restart() << "ms.";
+ if (!nonLocalizedMatch.isNull())
+ msg << "Replace uses of" << missingFamily << "with its non-localized name" << nonLocalizedMatch;
+ else
+ msg << "Replace uses of missing font family" << missingFamily << "with one that exists";
+ msg << "to avoid this cost.";
+
+ qCWarning(lcQpaFonts) << qPrintable(warningMessage);
+ }
+
return true;
#else
+ Q_UNUSED(missingFamily);
return false;
#endif
}
@@ -173,7 +199,7 @@ void QCoreTextFontDatabase::populateFamily(const QString &familyName)
// A single family might match several different fonts with different styles eg.
QCFType<CFArrayRef> matchingFonts = (CFArrayRef) CTFontDescriptorCreateMatchingFontDescriptors(nameOnlyDescriptor, 0);
if (!matchingFonts) {
- qWarning() << "QCoreTextFontDatabase: Found no matching fonts for family" << familyName;
+ qCWarning(lcQpaFonts) << "QCoreTextFontDatabase: Found no matching fonts for family" << familyName;
return;
}
@@ -406,175 +432,163 @@ template class QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>;
template class QCoreTextFontDatabaseEngineFactory<QFontEngineFT>;
#endif
-QFont::StyleHint styleHintFromNSString(NSString *style)
+CTFontDescriptorRef descriptorForFamily(const QString &familyName)
+{
+ return CTFontDescriptorCreateWithAttributes(CFDictionaryRef(@{
+ (id)kCTFontFamilyNameAttribute: familyName.toNSString()
+ }));
+}
+
+CTFontDescriptorRef descriptorForFamily(const char *familyName)
{
- if ([style isEqual: @"sans-serif"])
- return QFont::SansSerif;
- else if ([style isEqual: @"monospace"])
- return QFont::Monospace;
- else if ([style isEqual: @"cursive"])
- return QFont::Cursive;
- else if ([style isEqual: @"serif"])
- return QFont::Serif;
- else if ([style isEqual: @"fantasy"])
- return QFont::Fantasy;
- else // if ([style isEqual: @"default"])
- return QFont::AnyStyle;
+ return descriptorForFamily(QString::fromLatin1(familyName));
}
-#ifdef Q_OS_OSX
-static QString familyNameFromPostScriptName(NSString *psName)
+CFArrayRef fallbacksForDescriptor(CTFontDescriptorRef descriptor)
{
- QCFType<CTFontDescriptorRef> fontDescriptor = (CTFontDescriptorRef) CTFontDescriptorCreateWithNameAndSize((CFStringRef)psName, 12.0);
- QCFString familyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontDescriptor, kCTFontFamilyNameAttribute);
- QString name = QString::fromCFString(familyName);
- if (name.isEmpty())
- qWarning() << "QCoreTextFontDatabase: Failed to resolve family name for PostScript name " << QString::fromCFString((CFStringRef)psName);
+ QCFType<CTFontRef> font = CTFontCreateWithFontDescriptor(descriptor, 0.0, nullptr);
+ if (!font) {
+ qCWarning(lcQpaFonts) << "Failed to create fallback font for" << descriptor;
+ return nullptr;
+ }
+
+ CFArrayRef cascadeList = CFArrayRef(CTFontCopyDefaultCascadeListForLanguages(font,
+ (CFArrayRef)[NSUserDefaults.standardUserDefaults stringArrayForKey:@"AppleLanguages"]));
+
+ if (!cascadeList) {
+ qCWarning(lcQpaFonts) << "Failed to create fallback cascade list for" << descriptor;
+ return nullptr;
+ }
- return name;
+ return cascadeList;
}
-#endif
-static void addExtraFallbacks(QStringList *fallbackList)
+CFArrayRef QCoreTextFontDatabase::fallbacksForFamily(const QString &family)
{
-#if defined(Q_OS_MACOS)
- // Since we are only returning a list of default fonts for the current language, we do not
- // cover all unicode completely. This was especially an issue for some of the common script
- // symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
- // of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
- // of Unicode 2.1.
- if (!fallbackList->contains(QStringLiteral("Arial Unicode MS")))
- fallbackList->append(QStringLiteral("Arial Unicode MS"));
- // Since some symbols (specifically Braille) are not in Arial Unicode MS, we
- // add Apple Symbols to cover those too.
- if (!fallbackList->contains(QStringLiteral("Apple Symbols")))
- fallbackList->append(QStringLiteral("Apple Symbols"));
-#else
- Q_UNUSED(fallbackList)
-#endif
+ if (family.isEmpty())
+ return nullptr;
+
+ QCFType<CTFontDescriptorRef> fontDescriptor = descriptorForFamily(family);
+ if (!fontDescriptor) {
+ qCWarning(lcQpaFonts) << "Failed to create fallback font descriptor for" << family;
+ return nullptr;
+ }
+
+ // If the font is not available we want to fall back to the style hint.
+ // By creating a matching font descriptor we can verify whether the font
+ // is available or not, and avoid CTFontCreateWithFontDescriptor picking
+ // a default font for us based on incomplete information.
+ fontDescriptor = CTFontDescriptorCreateMatchingFontDescriptor(fontDescriptor, 0);
+ if (!fontDescriptor)
+ return nullptr;
+
+ return fallbacksForDescriptor(fontDescriptor);
}
-// ### Replace this with QPlatformFontDatabase::isFamilyPopulated() in Qt 5.14
-Q_GUI_EXPORT extern bool qt_isFontFamilyPopulated(const QString &familyName);
+CTFontDescriptorRef descriptorForFontType(CTFontUIFontType uiType)
+{
+ static const CGFloat kDefaultSizeForRequestedUIType = 0.0;
+ QCFType<CTFontRef> ctFont = CTFontCreateUIFontForLanguage(
+ uiType, kDefaultSizeForRequestedUIType, nullptr);
+ return CTFontCopyFontDescriptor(ctFont);
+}
+
+CTFontDescriptorRef descriptorForStyle(QFont::StyleHint styleHint)
+{
+ switch (styleHint) {
+ case QFont::SansSerif: return descriptorForFamily("Helvetica");
+ case QFont::Serif: return descriptorForFamily("Times New Roman");
+ case QFont::Monospace: return descriptorForFamily("Menlo");
+#ifdef Q_OS_MACOS
+ case QFont::Cursive: return descriptorForFamily("Apple Chancery");
+#endif
+ case QFont::Fantasy: return descriptorForFamily("Zapfino");
+ case QFont::TypeWriter: return descriptorForFamily("American Typewriter");
+ case QFont::AnyStyle: Q_FALLTHROUGH();
+ case QFont::System: return descriptorForFontType(kCTFontUIFontSystem);
+ default: return nullptr; // No matching font on this platform
+ }
+}
QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const
{
Q_UNUSED(style);
- Q_UNUSED(script);
+
+ qCDebug(lcQpaFonts).nospace() << "Resolving fallbacks families for"
+ << (!family.isEmpty() ? qPrintable(QLatin1String(" family '%1' with").arg(family)) : "")
+ << " style hint " << styleHint;
QMacAutoReleasePool pool;
- static QHash<QString, QStringList> fallbackLists;
-
- if (!family.isEmpty()) {
- QCFType<CFMutableDictionaryRef> attributes = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
- CFDictionaryAddValue(attributes, kCTFontFamilyNameAttribute, QCFString(family));
- if (QCFType<CTFontDescriptorRef> fontDescriptor = CTFontDescriptorCreateWithAttributes(attributes)) {
- if (QCFType<CTFontRef> font = CTFontCreateWithFontDescriptor(fontDescriptor, 12.0, 0)) {
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- NSArray *languages = [defaults stringArrayForKey: @"AppleLanguages"];
-
- QCFType<CFArrayRef> cascadeList = (CFArrayRef) CTFontCopyDefaultCascadeListForLanguages(font, (CFArrayRef) languages);
- if (cascadeList) {
- QStringList fallbackList;
- const int numCascades = CFArrayGetCount(cascadeList);
-
- int symbolIndex = -1;
- int notoSansUniversalIndex = -1;
- for (int i = 0; i < numCascades; ++i) {
- CTFontDescriptorRef fontFallback = (CTFontDescriptorRef) CFArrayGetValueAtIndex(cascadeList, i);
- QCFString fallbackFamilyName = (CFStringRef) CTFontDescriptorCopyAttribute(fontFallback, kCTFontFamilyNameAttribute);
-
- QString fallbackName = QString::fromCFString(fallbackFamilyName);
- fallbackList.append(fallbackName);
-
- if (!qt_isFontFamilyPopulated(fallbackName))
- const_cast<QCoreTextFontDatabase *>(this)->populateFromDescriptor(fontFallback, fallbackName);
-
- if (fallbackName == QLatin1String(".Apple Symbols Fallback"))
- symbolIndex = fallbackList.size() - 1;
- else if (fallbackName == QLatin1String(".Noto Sans Universal"))
- notoSansUniversalIndex = fallbackList.size() - 1;
- }
-
- // .Apple Symbols Fallback will be at the beginning of the list and we will
- // detect that this has glyphs for Arabic and other writing systems.
- // Since it is a symbol font, it should be the last resort, so that
- // the proper fonts for these writing systems are preferred.
- if (symbolIndex >= 0) {
- fallbackList.move(symbolIndex, fallbackList.size() - 1);
- if (notoSansUniversalIndex > symbolIndex)
- --notoSansUniversalIndex;
- }
-
- // .Noto Sans Universal appears to have a bug when the application
- // does not have a valid Info.plist, which causes it to return glyph #4
- // (a question mark) for any character.
- if (notoSansUniversalIndex >= 0)
- fallbackList.move(notoSansUniversalIndex, fallbackList.size() - 1);
-
- addExtraFallbacks(&fallbackList);
-
- extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &);
- fallbackList = qt_sort_families_by_writing_system(script, fallbackList);
-
- return fallbackList;
- }
- }
+ QStringList fallbackList;
+
+ QCFType<CFArrayRef> fallbackFonts = fallbacksForFamily(family);
+ if (!fallbackFonts || !CFArrayGetCount(fallbackFonts)) {
+ // We were not able to find a fallback for the specific family,
+ // or the family was empty, so we fall back to the style hint.
+ if (!family.isEmpty())
+ qCDebug(lcQpaFonts) << "No fallbacks found. Using style hint instead";
+
+ if (QCFType<CTFontDescriptorRef> styleDescriptor = descriptorForStyle(styleHint)) {
+ CFMutableArrayRef tmp = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
+ CFArrayAppendValue(tmp, styleDescriptor);
+ QCFType<CFArrayRef> styleFallbacks = fallbacksForDescriptor(styleDescriptor);
+ CFArrayAppendArray(tmp, styleFallbacks, CFRangeMake(0, CFArrayGetCount(styleFallbacks)));
+ fallbackFonts = tmp;
}
}
- // We were not able to find a fallback for the specific family,
- // so we fall back to the stylehint.
-
- static const QString styleLookupKey = QString::fromLatin1(".QFontStyleHint_%1");
-
- static bool didPopulateStyleFallbacks = false;
- if (!didPopulateStyleFallbacks) {
-#if defined(Q_OS_MACX)
- NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
- NSArray<NSString *> *languages = [defaults stringArrayForKey:@"AppleLanguages"];
-
- NSDictionary<NSString *, id> *fallbackDict = [NSDictionary<NSString *, id> dictionaryWithContentsOfFile:@"/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.plist"];
-
- for (NSString *style in [fallbackDict allKeys]) {
- NSArray *list = [fallbackDict valueForKey:style];
- QFont::StyleHint fallbackStyleHint = styleHintFromNSString(style);
- QStringList fallbackList;
- for (id item in list) {
- // sort the array based on system language preferences
- if ([item isKindOfClass:[NSArray class]]) {
- NSArray *langs = [reinterpret_cast<NSArray *>(item)
- sortedArrayUsingFunction:languageMapSort context:languages];
- for (NSArray<NSString *> *map in langs)
- fallbackList.append(familyNameFromPostScriptName([map objectAtIndex:1]));
- }
- else if ([item isKindOfClass: [NSString class]])
- fallbackList.append(familyNameFromPostScriptName(item));
- }
+ if (!fallbackFonts)
+ return fallbackList;
+
+ const int numberOfFallbacks = CFArrayGetCount(fallbackFonts);
+ for (int i = 0; i < numberOfFallbacks; ++i) {
+ auto fallbackDescriptor = CTFontDescriptorRef(CFArrayGetValueAtIndex(fallbackFonts, i));
+ auto fallbackFamilyName = QCFString(CTFontDescriptorCopyAttribute(fallbackDescriptor, kCTFontFamilyNameAttribute));
+
+ if (!isFamilyPopulated(fallbackFamilyName)) {
+ // We need to populate, or at least register the fallback fonts,
+ // otherwise the Qt font database may not know they exist.
+ if (isPrivateFontFamily(fallbackFamilyName))
+ const_cast<QCoreTextFontDatabase *>(this)->populateFromDescriptor(fallbackDescriptor);
+ else
+ registerFontFamily(fallbackFamilyName);
+ }
- fallbackList.append(QLatin1String("Apple Color Emoji"));
+ fallbackList.append(fallbackFamilyName);
+ }
- addExtraFallbacks(&fallbackList);
- fallbackLists[styleLookupKey.arg(fallbackStyleHint)] = fallbackList;
- }
-#else
- QStringList staticFallbackList;
- staticFallbackList << QString::fromLatin1("Helvetica,Apple Color Emoji,Geeza Pro,Arial Hebrew,Thonburi,Kailasa"
- "Hiragino Kaku Gothic ProN,.Heiti J,Apple SD Gothic Neo,.Heiti K,Heiti SC,Heiti TC"
- "Bangla Sangam MN,Devanagari Sangam MN,Gujarati Sangam MN,Gurmukhi MN,Kannada Sangam MN"
- "Malayalam Sangam MN,Oriya Sangam MN,Sinhala Sangam MN,Tamil Sangam MN,Telugu Sangam MN"
- "Euphemia UCAS,.PhoneFallback").split(QLatin1String(","));
-
- for (int i = QFont::Helvetica; i <= QFont::Fantasy; ++i)
- fallbackLists[styleLookupKey.arg(i)] = staticFallbackList;
+ // Some fallback fonts will have have an order in the list returned
+ // by Core Text that would indicate they should be preferred for e.g.
+ // Arabic, or Emoji, while in reality only supporting a tiny subset
+ // of the required glyphs, or representing them by question marks.
+ // Move these to the end, so that the proper fonts are preferred.
+ for (const char *family : { ".Apple Symbols Fallback", ".Noto Sans Universal" }) {
+ int index = fallbackList.indexOf(QLatin1String(family));
+ if (index >= 0)
+ fallbackList.move(index, fallbackList.size() - 1);
+ }
+
+#if defined(Q_OS_MACOS)
+ // Since we are only returning a list of default fonts for the current language, we do not
+ // cover all Unicode completely. This was especially an issue for some of the common script
+ // symbols such as mathematical symbols, currency or geometric shapes. To minimize the risk
+ // of missing glyphs, we add Arial Unicode MS as a final fail safe, since this covers most
+ // of Unicode 2.1.
+ if (!fallbackList.contains(QStringLiteral("Arial Unicode MS")))
+ fallbackList.append(QStringLiteral("Arial Unicode MS"));
+ // Since some symbols (specifically Braille) are not in Arial Unicode MS, we
+ // add Apple Symbols to cover those too.
+ if (!fallbackList.contains(QStringLiteral("Apple Symbols")))
+ fallbackList.append(QStringLiteral("Apple Symbols"));
#endif
- didPopulateStyleFallbacks = true;
- }
+ extern QStringList qt_sort_families_by_writing_system(QChar::Script, const QStringList &);
+ fallbackList = qt_sort_families_by_writing_system(script, fallbackList);
- Q_ASSERT(!fallbackLists.isEmpty());
- return fallbackLists[styleLookupKey.arg(styleHint)];
+ qCDebug(lcQpaFonts).nospace() << "Fallback families ordered by script " << script << ": " << fallbackList;
+
+ return fallbackList;
}
QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName)
@@ -733,10 +747,8 @@ static CTFontDescriptorRef fontDescriptorFromTheme(QPlatformTheme::Font f)
}
#endif // Q_OS_IOS, Q_OS_TVOS, Q_OS_WATCHOS
- // OSX default case and iOS fallback case
- CTFontUIFontType fontType = fontTypeFromTheme(f);
- QCFType<CTFontRef> ctFont = CTFontCreateUIFontForLanguage(fontType, 0.0, NULL);
- return CTFontCopyFontDescriptor(ctFont);
+ // macOS default case and iOS fallback case
+ return descriptorForFontType(fontTypeFromTheme(f));
}
const QHash<QPlatformTheme::Font, QFont *> &QCoreTextFontDatabase::themeFonts() const
@@ -769,8 +781,8 @@ QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const
QFont QCoreTextFontDatabase::defaultFont() const
{
if (defaultFontName.isEmpty()) {
- QCFType<CTFontRef> font = CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, 12.0, NULL);
- defaultFontName = (QString) QCFString(CTFontCopyFullName(font));
+ QCFType<CTFontDescriptorRef> systemFont = descriptorForFontType(kCTFontUIFontSystem);
+ defaultFontName = QCFString(CTFontDescriptorCopyAttribute(systemFont, kCTFontFamilyNameAttribute));
}
return QFont(defaultFontName);
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
index 05f6ed641c..eebb3eb964 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
@@ -71,7 +71,7 @@ public:
QCoreTextFontDatabase();
~QCoreTextFontDatabase();
void populateFontDatabase() override;
- bool populateFamilyAliases() override;
+ bool populateFamilyAliases(const QString &missingFamily) override;
void populateFamily(const QString &familyName) override;
void invalidate() override;
@@ -92,6 +92,7 @@ protected:
private:
void populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName = QString());
+ static CFArrayRef fallbacksForFamily(const QString &family);
mutable QString defaultFontName;
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
index c523e799e6..011476cf13 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
@@ -53,6 +53,7 @@
#include <QtCore/QtEndian>
#include <QtCore/QThreadStorage>
#include <QtCore/private/qsystemlibrary_p.h>
+#include <QtCore/private/qwinregistry_p.h>
#include <wchar.h>
@@ -1007,12 +1008,27 @@ static QChar *createFontFile(const QString &faceName)
return faceNamePtr;
}
+namespace {
+ struct StoreFontPayload {
+ StoreFontPayload(const QString &family,
+ QWindowsFontDatabase *fontDatabase)
+ : populatedFontFamily(family)
+ , windowsFontDatabase(fontDatabase)
+ {}
+
+ QString populatedFontFamily;
+ QSet<QPair<QString,QString> > foundFontAndStyles;
+ QWindowsFontDatabase *windowsFontDatabase;
+ };
+}
+
static bool addFontToDatabase(QString familyName,
QString styleName,
const LOGFONT &logFont,
const TEXTMETRIC *textmetric,
const FONTSIGNATURE *signature,
- int type)
+ int type,
+ StoreFontPayload *sfp)
{
// the "@family" fonts are just the same as "family". Ignore them.
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QLatin1String("WST_")))
@@ -1092,6 +1108,16 @@ static bool addFontToDatabase(QString familyName,
writingSystems.setSupported(ws);
}
+ // We came here from populating a different font family, so we have
+ // to ensure the entire typographic family is populated before we
+ // mark it as such inside registerFont()
+ if (!subFamilyName.isEmpty()
+ && familyName != subFamilyName
+ && sfp->populatedFontFamily != familyName
+ && !QPlatformFontDatabase::isFamilyPopulated(familyName)) {
+ sfp->windowsFontDatabase->populateFamily(familyName);
+ }
+
QPlatformFontDatabase::registerFont(familyName, styleName, foundryName, weight,
style, stretch, antialias, scalable, size, fixed, writingSystems, createFontFile(faceName));
@@ -1128,17 +1154,18 @@ static int QT_WIN_CALLBACK storeFont(const LOGFONT *logFont, const TEXTMETRIC *t
// to the documentation is identical to a TEXTMETRIC except for the last four
// members, which we don't use anyway
const FONTSIGNATURE *signature = nullptr;
+ StoreFontPayload *sfp = reinterpret_cast<StoreFontPayload *>(lparam);
+ Q_ASSERT(sfp != nullptr);
if (type & TRUETYPE_FONTTYPE) {
signature = &reinterpret_cast<const NEWTEXTMETRICEX *>(textmetric)->ntmFontSig;
// We get a callback for each script-type supported, but we register them all
// at once using the signature, so we only need one call to addFontToDatabase().
- QSet<QPair<QString,QString>> *foundFontAndStyles = reinterpret_cast<QSet<QPair<QString,QString>> *>(lparam);
QPair<QString,QString> fontAndStyle(familyName, styleName);
- if (foundFontAndStyles->contains(fontAndStyle))
+ if (sfp->foundFontAndStyles.contains(fontAndStyle))
return 1;
- foundFontAndStyles->insert(fontAndStyle);
+ sfp->foundFontAndStyles.insert(fontAndStyle);
}
- addFontToDatabase(familyName, styleName, *logFont, textmetric, signature, type);
+ addFontToDatabase(familyName, styleName, *logFont, textmetric, signature, type, sfp);
// keep on enumerating
return 1;
@@ -1157,8 +1184,8 @@ void QWindowsFontDatabase::populateFamily(const QString &familyName)
familyName.toWCharArray(lf.lfFaceName);
lf.lfFaceName[familyName.size()] = 0;
lf.lfPitchAndFamily = 0;
- QSet<QPair<QString,QString>> foundFontAndStyles;
- EnumFontFamiliesEx(dummy, &lf, storeFont, reinterpret_cast<intptr_t>(&foundFontAndStyles), 0);
+ StoreFontPayload sfp(familyName, this);
+ EnumFontFamiliesEx(dummy, &lf, storeFont, reinterpret_cast<intptr_t>(&sfp), 0);
ReleaseDC(0, dummy);
}
@@ -1184,33 +1211,8 @@ static int QT_WIN_CALLBACK populateFontFamilies(const LOGFONT *logFont, const TE
void QWindowsFontDatabase::addDefaultEUDCFont()
{
- QString path;
- {
- HKEY key;
- if (RegOpenKeyEx(HKEY_CURRENT_USER,
- L"EUDC\\1252",
- 0,
- KEY_READ,
- &key) != ERROR_SUCCESS) {
- return;
- }
-
- WCHAR value[MAX_PATH];
- DWORD bufferSize = sizeof(value);
- ZeroMemory(value, bufferSize);
-
- if (RegQueryValueEx(key,
- L"SystemDefaultEUDCFont",
- nullptr,
- nullptr,
- reinterpret_cast<LPBYTE>(value),
- &bufferSize) == ERROR_SUCCESS) {
- path = QString::fromWCharArray(value);
- }
-
- RegCloseKey(key);
- }
-
+ const QString path = QWinRegistryKey(HKEY_CURRENT_USER, LR"(EUDC\1252)")
+ .stringValue(L"SystemDefaultEUDCFont");
if (!path.isEmpty()) {
QFile file(path);
if (!file.open(QIODevice::ReadOnly)) {
@@ -1338,11 +1340,11 @@ QT_WARNING_POP
if (request.family != fontEngine->fontDef.family) {
qWarning("%s: Failed to load font. Got fallback instead: %s",
__FUNCTION__, qPrintable(fontEngine->fontDef.family));
- if (fontEngine->ref.load() == 0)
+ if (fontEngine->ref.loadRelaxed() == 0)
delete fontEngine;
fontEngine = 0;
} else {
- Q_ASSERT(fontEngine->ref.load() == 0);
+ Q_ASSERT(fontEngine->ref.loadRelaxed() == 0);
// Override the generated font name
switch (fontEngine->type()) {
@@ -1514,7 +1516,7 @@ static void getFamiliesAndSignatures(const QByteArray &fontData,
if (names.name.isEmpty())
continue;
- families->append(qMove(names));
+ families->append(std::move(names));
if (values || signatures)
getFontTable(data, font, MAKE_TAG('O', 'S', '/', '2'), &table, &length);
@@ -1598,8 +1600,9 @@ QStringList QWindowsFontDatabase::addApplicationFont(const QByteArray &fontData,
TEXTMETRIC textMetrics;
GetTextMetrics(hdc, &textMetrics);
+ StoreFontPayload sfp(familyName, this);
addFontToDatabase(familyName, styleName, lf, &textMetrics, &signatures.at(j),
- TRUETYPE_FONTTYPE);
+ TRUETYPE_FONTTYPE, &sfp);
SelectObject(hdc, oldobj);
DeleteObject(hfont);
@@ -2078,28 +2081,6 @@ int QWindowsFontDatabase::defaultVerticalDPI()
return vDPI;
}
-QString QWindowsFontDatabase::readRegistryString(HKEY parentHandle, const wchar_t *keyPath, const wchar_t *keyName)
-{
- QString result;
- HKEY handle = 0;
- if (RegOpenKeyEx(parentHandle, keyPath, 0, KEY_READ, &handle) == ERROR_SUCCESS) {
- // get the size and type of the value
- DWORD dataType;
- DWORD dataSize;
- if (RegQueryValueEx(handle, keyName, 0, &dataType, 0, &dataSize) == ERROR_SUCCESS) {
- if (dataType == REG_SZ || dataType == REG_EXPAND_SZ) {
- dataSize += 2; // '\0' missing?
- QVarLengthArray<unsigned char> data(dataSize);
- data[dataSize - 2] = data[dataSize - 1] = '\0';
- if (RegQueryValueEx(handle, keyName, 0, 0, data.data(), &dataSize) == ERROR_SUCCESS)
- result = QString::fromWCharArray(reinterpret_cast<const wchar_t *>(data.data()));
- }
- }
- RegCloseKey(handle);
- }
- return result;
-}
-
bool QWindowsFontDatabase::isPrivateFontFamily(const QString &family) const
{
return m_eudcFonts.contains(family) || QPlatformFontDatabase::isPrivateFontFamily(family);
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
index fdef0f5ff1..a6b7fcf31e 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_ft.cpp
@@ -48,7 +48,11 @@
#include <QtCore/QDir>
#include <QtCore/QDirIterator>
#include <QtCore/QSettings>
+#if QT_CONFIG(regularexpression)
#include <QtCore/QRegularExpression>
+#else
+#include <QtCore/QRegExp>
+#endif
#include <QtGui/QGuiApplication>
#include <QtGui/QFontDatabase>
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
index b85a2dceee..f132e69d4d 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
@@ -96,6 +96,8 @@ public:
QWindowsFontDatabase();
~QWindowsFontDatabase() override;
+ void ensureFamilyPopulated(const QString &familyName);
+
void populateFontDatabase() override;
void populateFamily(const QString &familyName) override;
QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override;
@@ -131,8 +133,6 @@ public:
static void setFontOptions(unsigned options);
static unsigned fontOptions();
- static QString readRegistryString(HKEY parentHandle, const wchar_t *keyPath, const wchar_t *keyName);
-
private:
void removeApplicationFonts();
void addDefaultEUDCFont();
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
index a4490a6664..e796c18e79 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QFile>
#include <private/qstringiterator_p.h>
#include <QtCore/private/qsystemlibrary_p.h>
+#include <QtCore/private/qwinregistry_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
#include <QtGui/private/qhighdpiscaling_p.h>
@@ -945,10 +946,10 @@ void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
QString QWindowsFontEngineDirectWrite::fontNameSubstitute(const QString &familyName)
{
- const wchar_t key[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes";
const QString substitute =
- QWindowsFontDatabase::readRegistryString(HKEY_LOCAL_MACHINE, key,
- reinterpret_cast<const wchar_t *>(familyName.utf16()));
+ QWinRegistryKey(HKEY_LOCAL_MACHINE,
+ LR"(Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes)")
+ .stringValue(familyName);
return substitute.isEmpty() ? familyName : substitute;
}
diff --git a/src/platformsupport/fontdatabases/windows/windows.pri b/src/platformsupport/fontdatabases/windows/windows.pri
index 9c529f55ea..7ddfb2c281 100644
--- a/src/platformsupport/fontdatabases/windows/windows.pri
+++ b/src/platformsupport/fontdatabases/windows/windows.pri
@@ -30,5 +30,5 @@ qtConfig(directwrite):qtConfig(direct2d) {
DEFINES *= QT_NO_DIRECTWRITE
}
-LIBS += -lole32 -lgdi32 -luser32 -ladvapi32
-mingw: LIBS += -luuid
+QMAKE_USE_PRIVATE += advapi32 ole32 user32 gdi32
+mingw: QMAKE_USE_PRIVATE += uuid
diff --git a/src/platformsupport/fontdatabases/winrt/winrt.pri b/src/platformsupport/fontdatabases/winrt/winrt.pri
index 7617df2e7a..1cd417c1fd 100644
--- a/src/platformsupport/fontdatabases/winrt/winrt.pri
+++ b/src/platformsupport/fontdatabases/winrt/winrt.pri
@@ -8,6 +8,4 @@ HEADERS += \
DEFINES += __WRL_NO_DEFAULT_LIB__
-LIBS += -lws2_32
-
-QMAKE_USE_PRIVATE += dwrite_1
+QMAKE_USE_PRIVATE += dwrite_1 ws2_32
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp
index 5f16d00dad..81bccb1c25 100644
--- a/src/platformsupport/glxconvenience/qglxconvenience.cpp
+++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp
@@ -317,7 +317,7 @@ void qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat *format, Display *display,
glXGetFBConfigAttrib(display, config, GLX_ALPHA_SIZE, &alphaSize);
glXGetFBConfigAttrib(display, config, GLX_DEPTH_SIZE, &depthSize);
glXGetFBConfigAttrib(display, config, GLX_STENCIL_SIZE, &stencilSize);
- glXGetFBConfigAttrib(display, config, GLX_SAMPLES_ARB, &sampleBuffers);
+ glXGetFBConfigAttrib(display, config, GLX_SAMPLE_BUFFERS_ARB, &sampleBuffers);
glXGetFBConfigAttrib(display, config, GLX_STEREO, &stereo);
if (flags & QGLX_SUPPORTS_SRGB)
glXGetFBConfigAttrib(display, config, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, &srgbCapable);
@@ -356,7 +356,7 @@ void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display,
glXGetConfig(display, visualInfo, GLX_ALPHA_SIZE, &alphaSize);
glXGetConfig(display, visualInfo, GLX_DEPTH_SIZE, &depthSize);
glXGetConfig(display, visualInfo, GLX_STENCIL_SIZE, &stencilSize);
- glXGetConfig(display, visualInfo, GLX_SAMPLES_ARB, &sampleBuffers);
+ glXGetConfig(display, visualInfo, GLX_SAMPLE_BUFFERS_ARB, &sampleBuffers);
glXGetConfig(display, visualInfo, GLX_STEREO, &stereo);
if (flags & QGLX_SUPPORTS_SRGB)
glXGetConfig(display, visualInfo, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB, &srgbCapable);
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index 666613f09d..3555763b89 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -66,7 +66,7 @@ Q_LOGGING_CATEGORY(qLcEvdevKeyMap, "qt.qpa.input.keymap")
// simple builtin US keymap
#include "qevdevkeyboard_defaultmap_p.h"
-void QFdContainer::reset() Q_DECL_NOTHROW
+void QFdContainer::reset() noexcept
{
if (m_fd >= 0)
qt_safe_close(m_fd);
@@ -98,11 +98,12 @@ QEvdevKeyboardHandler::~QEvdevKeyboardHandler()
unloadKeymap();
}
-QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
+std::unique_ptr<QEvdevKeyboardHandler> QEvdevKeyboardHandler::create(const QString &device,
const QString &specification,
const QString &defaultKeymapFile)
{
- qCDebug(qLcEvdevKey) << "Try to create keyboard handler for" << device << specification;
+ qCDebug(qLcEvdevKey, "Try to create keyboard handler for \"%ls\" \"%ls\"",
+ qUtf16Printable(device), qUtf16Printable(specification));
QString keymapFile = defaultKeymapFile;
int repeatDelay = 400;
@@ -127,7 +128,7 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
grab = arg.mid(5).toInt();
}
- qCDebug(qLcEvdevKey) << "Opening keyboard at" << device;
+ qCDebug(qLcEvdevKey, "Opening keyboard at %ls", qUtf16Printable(device));
QFdContainer fd(qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0));
if (fd.get() >= 0) {
@@ -137,16 +138,16 @@ QEvdevKeyboardHandler *QEvdevKeyboardHandler::create(const QString &device,
::ioctl(fd.get(), EVIOCSREP, kbdrep);
}
- return new QEvdevKeyboardHandler(device, fd, disableZap, enableCompose, keymapFile);
+ return std::unique_ptr<QEvdevKeyboardHandler>(new QEvdevKeyboardHandler(device, fd, disableZap, enableCompose, keymapFile));
} else {
- qWarning("Cannot open keyboard input device '%s': %s", qPrintable(device), strerror(errno));
- return 0;
+ qErrnoWarning("Cannot open keyboard input device '%ls'", qUtf16Printable(device));
+ return nullptr;
}
}
void QEvdevKeyboardHandler::switchLed(int led, bool state)
{
- qCDebug(qLcEvdevKey) << "switchLed" << led << state;
+ qCDebug(qLcEvdevKey, "switchLed %d %d", led, int(state));
struct ::input_event led_ie;
::gettimeofday(&led_ie.time, 0);
@@ -170,7 +171,7 @@ void QEvdevKeyboardHandler::readKeycode()
return;
} else if (result < 0) {
if (errno != EINTR && errno != EAGAIN) {
- qErrnoWarning(errno, "evdevkeyboard: Could not read from input device");
+ qErrnoWarning("evdevkeyboard: Could not read from input device");
// If the device got disconnected, stop reading, otherwise we get flooded
// by the above error over and over again.
if (errno == ENODEV) {
@@ -230,7 +231,7 @@ void QEvdevKeyboardHandler::processKeyEvent(int nativecode, int unicode, int qtc
QWindowSystemInterface::handleExtendedKeyEvent(0, (isPress ? QEvent::KeyPress : QEvent::KeyRelease),
qtcode, modifiers, nativecode + 8, 0, int(modifiers),
- (unicode != 0xffff ) ? QString(unicode) : QString(), autoRepeat);
+ (unicode != 0xffff ) ? QString(QChar(unicode)) : QString(), autoRepeat);
}
QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint16 keycode, bool pressed, bool autorepeat)
@@ -473,7 +474,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
void QEvdevKeyboardHandler::unloadKeymap()
{
- qCDebug(qLcEvdevKey) << "Unload current keymap and restore built-in";
+ qCDebug(qLcEvdevKey, "Unload current keymap and restore built-in");
if (m_keymap && m_keymap != s_keymap_default)
delete [] m_keymap;
@@ -517,12 +518,12 @@ void QEvdevKeyboardHandler::unloadKeymap()
bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
{
- qCDebug(qLcEvdevKey) << "Loading keymap" << file;
+ qCDebug(qLcEvdevKey, "Loading keymap %ls", qUtf16Printable(file));
QFile f(file);
if (!f.open(QIODevice::ReadOnly)) {
- qWarning("Could not open keymap file '%s'", qPrintable(file));
+ qWarning("Could not open keymap file '%ls'", qUtf16Printable(file));
return false;
}
@@ -541,7 +542,7 @@ bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
ds >> qmap_magic >> qmap_version >> qmap_keymap_size >> qmap_keycompose_size;
if (ds.status() != QDataStream::Ok || qmap_magic != QEvdevKeyboardMap::FileMagic || qmap_version != 1 || qmap_keymap_size == 0) {
- qWarning("'%s' is not a valid .qmap keymap file", qPrintable(file));
+ qWarning("'%ls' is not a valid .qmap keymap file", qUtf16Printable(file));
return false;
}
@@ -557,7 +558,7 @@ bool QEvdevKeyboardHandler::loadKeymap(const QString &file)
delete [] qmap_keymap;
delete [] qmap_keycompose;
- qWarning("Keymap file '%s' cannot be loaded.", qPrintable(file));
+ qWarning("Keymap file '%ls' cannot be loaded.", qUtf16Printable(file));
return false;
}
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
index 21e6d055a0..f92a2bf704 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler_p.h
@@ -55,6 +55,8 @@
#include <QTimer>
#include <QDataStream>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QSocketNotifier;
@@ -134,13 +136,13 @@ class QFdContainer
int m_fd;
Q_DISABLE_COPY_MOVE(QFdContainer);
public:
- explicit QFdContainer(int fd = -1) Q_DECL_NOTHROW : m_fd(fd) {}
+ explicit QFdContainer(int fd = -1) noexcept : m_fd(fd) {}
~QFdContainer() { reset(); }
- int get() const Q_DECL_NOTHROW { return m_fd; }
+ int get() const noexcept { return m_fd; }
- int release() Q_DECL_NOTHROW { int result = m_fd; m_fd = -1; return result; }
- void reset() Q_DECL_NOTHROW;
+ int release() noexcept { int result = m_fd; m_fd = -1; return result; }
+ void reset() noexcept;
};
class QEvdevKeyboardHandler : public QObject
@@ -168,7 +170,7 @@ public:
SwitchConsoleMask = 0x0000007f
};
- static QEvdevKeyboardHandler *create(const QString &device,
+ static std::unique_ptr<QEvdevKeyboardHandler> create(const QString &device,
const QString &specification,
const QString &defaultKeymapFile = QString());
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
index e1659bc0d9..52d9c34b1c 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager.cpp
@@ -39,6 +39,8 @@
#include "qevdevkeyboardmanager_p.h"
+#include <QtInputSupport/private/qevdevutil_p.h>
+
#include <QStringList>
#include <QCoreApplication>
#include <QLoggingCategory>
@@ -61,36 +63,24 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
if (spec.isEmpty())
spec = specification;
- QStringList args = spec.split(QLatin1Char(':'));
- QStringList devices;
-
- foreach (const QString &arg, args) {
- if (arg.startsWith(QLatin1String("/dev/"))) {
- // if device is specified try to use it
- devices.append(arg);
- args.removeAll(arg);
- }
- }
-
- // build new specification without /dev/ elements
- m_spec = args.join(QLatin1Char(':'));
+ auto parsed = QEvdevUtil::parseSpecification(spec);
+ m_spec = std::move(parsed.spec);
// add all keyboards for devices specified in the argument list
- foreach (const QString &device, devices)
+ for (const QString &device : qAsConst(parsed.devices))
addKeyboard(device);
- if (devices.isEmpty()) {
- qCDebug(qLcEvdevKey) << "evdevkeyboard: Using device discovery";
- m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Keyboard, this);
- if (m_deviceDiscovery) {
+ if (parsed.devices.isEmpty()) {
+ qCDebug(qLcEvdevKey, "evdevkeyboard: Using device discovery");
+ if (auto deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Keyboard, this)) {
// scan and add already connected keyboards
- const QStringList devices = m_deviceDiscovery->scanConnectedDevices();
+ const QStringList devices = deviceDiscovery->scanConnectedDevices();
for (const QString &device : devices)
addKeyboard(device);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceDetected,
this, &QEvdevKeyboardManager::addKeyboard);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
this, &QEvdevKeyboardManager::removeKeyboard);
}
}
@@ -98,36 +88,34 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString &
QEvdevKeyboardManager::~QEvdevKeyboardManager()
{
- qDeleteAll(m_keyboards);
- m_keyboards.clear();
}
void QEvdevKeyboardManager::addKeyboard(const QString &deviceNode)
{
- qCDebug(qLcEvdevKey) << "Adding keyboard at" << deviceNode;
- QEvdevKeyboardHandler *keyboard;
- keyboard = QEvdevKeyboardHandler::create(deviceNode, m_spec, m_defaultKeymapFile);
+ qCDebug(qLcEvdevKey, "Adding keyboard at %ls", qUtf16Printable(deviceNode));
+ auto keyboard = QEvdevKeyboardHandler::create(deviceNode, m_spec, m_defaultKeymapFile);
if (keyboard) {
- m_keyboards.insert(deviceNode, keyboard);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypeKeyboard, m_keyboards.count());
+ m_keyboards.add(deviceNode, std::move(keyboard));
+ updateDeviceCount();
} else {
- qWarning("Failed to open keyboard device %s", qPrintable(deviceNode));
+ qWarning("Failed to open keyboard device %ls", qUtf16Printable(deviceNode));
}
}
void QEvdevKeyboardManager::removeKeyboard(const QString &deviceNode)
{
- if (m_keyboards.contains(deviceNode)) {
- qCDebug(qLcEvdevKey) << "Removing keyboard at" << deviceNode;
- QEvdevKeyboardHandler *keyboard = m_keyboards.value(deviceNode);
- m_keyboards.remove(deviceNode);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypeKeyboard, m_keyboards.count());
- delete keyboard;
+ if (m_keyboards.remove(deviceNode)) {
+ qCDebug(qLcEvdevKey, "Removing keyboard at %ls", qUtf16Printable(deviceNode));
+ updateDeviceCount();
}
}
+void QEvdevKeyboardManager::updateDeviceCount()
+{
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypeKeyboard, m_keyboards.count());
+}
+
void QEvdevKeyboardManager::loadKeymap(const QString &file)
{
m_defaultKeymapFile = file;
@@ -141,22 +129,22 @@ void QEvdevKeyboardManager::loadKeymap(const QString &file)
if (arg.startsWith(QLatin1String("keymap=")))
keymapFromSpec = arg.mid(7).toString();
}
- foreach (QEvdevKeyboardHandler *handler, m_keyboards) {
+ for (const auto &keyboard : m_keyboards) {
if (keymapFromSpec.isEmpty())
- handler->unloadKeymap();
+ keyboard.handler->unloadKeymap();
else
- handler->loadKeymap(keymapFromSpec);
+ keyboard.handler->loadKeymap(keymapFromSpec);
}
} else {
- foreach (QEvdevKeyboardHandler *handler, m_keyboards)
- handler->loadKeymap(file);
+ for (const auto &keyboard : m_keyboards)
+ keyboard.handler->loadKeymap(file);
}
}
void QEvdevKeyboardManager::switchLang()
{
- foreach (QEvdevKeyboardHandler *handler, m_keyboards)
- handler->switchLang();
+ for (const auto &keyboard : m_keyboards)
+ keyboard.handler->switchLang();
}
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
index 326e438a7c..d91da330c3 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardmanager_p.h
@@ -53,6 +53,7 @@
#include "qevdevkeyboardhandler_p.h"
+#include <QtInputSupport/private/devicehandlerlist_p.h>
#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
#include <QObject>
@@ -64,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QEvdevKeyboardManager : public QObject
{
public:
- QEvdevKeyboardManager(const QString &key, const QString &specification, QObject *parent = 0);
+ QEvdevKeyboardManager(const QString &key, const QString &specification, QObject *parent = nullptr);
~QEvdevKeyboardManager();
void loadKeymap(const QString &file);
@@ -74,9 +75,10 @@ public:
void removeKeyboard(const QString &deviceNode);
private:
+ void updateDeviceCount();
+
QString m_spec;
- QHash<QString,QEvdevKeyboardHandler*> m_keyboards;
- QDeviceDiscovery *m_deviceDiscovery;
+ QtInputSupport::DeviceHandlerList<QEvdevKeyboardHandler> m_keyboards;
QString m_defaultKeymapFile;
};
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 86a4cd0076..6a53ad2088 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcEvdevMouse, "qt.qpa.input")
-QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QString &specification)
+std::unique_ptr<QEvdevMouseHandler> QEvdevMouseHandler::create(const QString &device, const QString &specification)
{
qCDebug(qLcEvdevMouse) << "create mouse handler for" << device << specification;
@@ -91,10 +91,10 @@ QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QStr
fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
if (fd >= 0) {
::ioctl(fd, EVIOCGRAB, grab);
- return new QEvdevMouseHandler(device, fd, abs, compression, jitterLimit);
+ return std::unique_ptr<QEvdevMouseHandler>(new QEvdevMouseHandler(device, fd, abs, compression, jitterLimit));
} else {
qErrnoWarning(errno, "Cannot open mouse input device %s", qPrintable(device));
- return 0;
+ return nullptr;
}
}
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
index c7f2b04eb2..727f1a02f9 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler_p.h
@@ -56,6 +56,8 @@
#include <QPoint>
#include <QEvent>
+#include <memory>
+
QT_BEGIN_NAMESPACE
class QSocketNotifier;
@@ -64,7 +66,7 @@ class QEvdevMouseHandler : public QObject
{
Q_OBJECT
public:
- static QEvdevMouseHandler *create(const QString &device, const QString &specification);
+ static std::unique_ptr<QEvdevMouseHandler> create(const QString &device, const QString &specification);
~QEvdevMouseHandler();
void readMouseData();
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
index 06025c016e..daa52d690e 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager.cpp
@@ -39,6 +39,8 @@
#include "qevdevmousemanager_p.h"
+#include <QtInputSupport/private/qevdevutil_p.h>
+
#include <QStringList>
#include <QGuiApplication>
#include <QScreen>
@@ -63,40 +65,32 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
if (spec.isEmpty())
spec = specification;
- QStringList args = spec.split(QLatin1Char(':'));
- QStringList devices;
+ auto parsed = QEvdevUtil::parseSpecification(spec);
+ m_spec = std::move(parsed.spec);
- foreach (const QString &arg, args) {
- if (arg.startsWith(QLatin1String("/dev/"))) {
- // if device is specified try to use it
- devices.append(arg);
- args.removeAll(arg);
- } else if (arg.startsWith(QLatin1String("xoffset="))) {
+ for (const QStringRef &arg : qAsConst(parsed.args)) {
+ if (arg.startsWith(QLatin1String("xoffset="))) {
m_xoffset = arg.mid(8).toInt();
} else if (arg.startsWith(QLatin1String("yoffset="))) {
m_yoffset = arg.mid(8).toInt();
}
}
- // build new specification without /dev/ elements
- m_spec = args.join(QLatin1Char(':'));
-
// add all mice for devices specified in the argument list
- foreach (const QString &device, devices)
+ for (const QString &device : qAsConst(parsed.devices))
addMouse(device);
- if (devices.isEmpty()) {
- qCDebug(qLcEvdevMouse) << "evdevmouse: Using device discovery";
- m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse | QDeviceDiscovery::Device_Touchpad, this);
- if (m_deviceDiscovery) {
+ if (parsed.devices.isEmpty()) {
+ qCDebug(qLcEvdevMouse, "evdevmouse: Using device discovery");
+ if (auto deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Mouse | QDeviceDiscovery::Device_Touchpad, this)) {
// scan and add already connected keyboards
- const QStringList devices = m_deviceDiscovery->scanConnectedDevices();
+ const QStringList devices = deviceDiscovery->scanConnectedDevices();
for (const QString &device : devices)
addMouse(device);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceDetected,
this, &QEvdevMouseManager::addMouse);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
this, &QEvdevMouseManager::removeMouse);
}
}
@@ -111,8 +105,6 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif
QEvdevMouseManager::~QEvdevMouseManager()
{
- qDeleteAll(m_mice);
- m_mice.clear();
}
void QEvdevMouseManager::clampPosition()
@@ -159,31 +151,32 @@ void QEvdevMouseManager::handleWheelEvent(QPoint delta)
void QEvdevMouseManager::addMouse(const QString &deviceNode)
{
- qCDebug(qLcEvdevMouse) << "Adding mouse at" << deviceNode;
- QEvdevMouseHandler *handler = QEvdevMouseHandler::create(deviceNode, m_spec);
+ qCDebug(qLcEvdevMouse, "Adding mouse at %ls", qUtf16Printable(deviceNode));
+ auto handler = QEvdevMouseHandler::create(deviceNode, m_spec);
if (handler) {
- connect(handler, &QEvdevMouseHandler::handleMouseEvent,
+ connect(handler.get(), &QEvdevMouseHandler::handleMouseEvent,
this, &QEvdevMouseManager::handleMouseEvent);
- connect(handler, &QEvdevMouseHandler::handleWheelEvent,
+ connect(handler.get(), &QEvdevMouseHandler::handleWheelEvent,
this, &QEvdevMouseManager::handleWheelEvent);
- m_mice.insert(deviceNode, handler);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypePointer, m_mice.count());
+ m_mice.add(deviceNode, std::move(handler));
+ updateDeviceCount();
} else {
- qWarning("evdevmouse: Failed to open mouse device %s", qPrintable(deviceNode));
+ qWarning("evdevmouse: Failed to open mouse device %ls", qUtf16Printable(deviceNode));
}
}
void QEvdevMouseManager::removeMouse(const QString &deviceNode)
{
- if (m_mice.contains(deviceNode)) {
- qCDebug(qLcEvdevMouse) << "Removing mouse at" << deviceNode;
- QEvdevMouseHandler *handler = m_mice.value(deviceNode);
- m_mice.remove(deviceNode);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypePointer, m_mice.count());
- delete handler;
+ if (m_mice.remove(deviceNode)) {
+ qCDebug(qLcEvdevMouse, "Removing mouse at %ls", qUtf16Printable(deviceNode));
+ updateDeviceCount();
}
}
+void QEvdevMouseManager::updateDeviceCount()
+{
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypePointer, m_mice.count());
+}
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
index 13a8e3dec5..f5c32ed8b5 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
+++ b/src/platformsupport/input/evdevmouse/qevdevmousemanager_p.h
@@ -53,6 +53,8 @@
#include "qevdevmousehandler_p.h"
+#include <QtInputSupport/private/devicehandlerlist_p.h>
+
#include <QObject>
#include <QHash>
#include <QSocketNotifier>
@@ -65,7 +67,7 @@ class QDeviceDiscovery;
class QEvdevMouseManager : public QObject
{
public:
- QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent = 0);
+ QEvdevMouseManager(const QString &key, const QString &specification, QObject *parent = nullptr);
~QEvdevMouseManager();
void handleMouseEvent(int x, int y, bool abs, Qt::MouseButtons buttons,
@@ -77,10 +79,10 @@ public:
private:
void clampPosition();
+ void updateDeviceCount();
QString m_spec;
- QHash<QString,QEvdevMouseHandler*> m_mice;
- QDeviceDiscovery *m_deviceDiscovery;
+ QtInputSupport::DeviceHandlerList<QEvdevMouseHandler> m_mice;
int m_x;
int m_y;
int m_xoffset;
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
index b6051aaf3c..c86840b76c 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
+++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler.cpp
@@ -172,11 +172,11 @@ QEvdevTabletHandler::QEvdevTabletHandler(const QString &device, const QString &s
setObjectName(QLatin1String("Evdev Tablet Handler"));
- qCDebug(qLcEvdevTablet, "evdevtablet: using %s", qPrintable(device));
+ qCDebug(qLcEvdevTablet, "evdevtablet: using %ls", qUtf16Printable(device));
m_fd = QT_OPEN(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
if (m_fd < 0) {
- qErrnoWarning(errno, "evdevtablet: Cannot open input device %s", qPrintable(device));
+ qErrnoWarning("evdevtablet: Cannot open input device %ls", qUtf16Printable(device));
return;
}
@@ -184,11 +184,11 @@ QEvdevTabletHandler::QEvdevTabletHandler(const QString &device, const QString &s
if (grabSuccess)
ioctl(m_fd, EVIOCGRAB, (void *) 0);
else
- qWarning("evdevtablet: %s: The device is grabbed by another process. No events will be read.", qPrintable(device));
+ qWarning("evdevtablet: %ls: The device is grabbed by another process. No events will be read.", qUtf16Printable(device));
d = new QEvdevTabletData(this);
if (!queryLimits())
- qWarning("evdevtablet: %s: Unset or invalid ABS limits. Behavior will be unspecified.", qPrintable(device));
+ qWarning("evdevtablet: %ls: Unset or invalid ABS limits. Behavior will be unspecified.", qUtf16Printable(device));
m_notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
connect(m_notifier, &QSocketNotifier::activated, this, &QEvdevTabletHandler::readData);
@@ -216,32 +216,32 @@ bool QEvdevTabletHandler::queryLimits()
if (ok) {
d->minValues.x = absInfo.minimum;
d->maxValues.x = absInfo.maximum;
- qCDebug(qLcEvdevTablet, "evdevtablet: %s: min X: %d max X: %d", qPrintable(m_device),
+ qCDebug(qLcEvdevTablet, "evdevtablet: %ls: min X: %d max X: %d", qUtf16Printable(m_device),
d->minValues.x, d->maxValues.x);
}
ok &= ioctl(m_fd, EVIOCGABS(ABS_Y), &absInfo) >= 0;
if (ok) {
d->minValues.y = absInfo.minimum;
d->maxValues.y = absInfo.maximum;
- qCDebug(qLcEvdevTablet, "evdevtablet: %s: min Y: %d max Y: %d", qPrintable(m_device),
+ qCDebug(qLcEvdevTablet, "evdevtablet: %ls: min Y: %d max Y: %d", qUtf16Printable(m_device),
d->minValues.y, d->maxValues.y);
}
if (ioctl(m_fd, EVIOCGABS(ABS_PRESSURE), &absInfo) >= 0) {
d->minValues.p = absInfo.minimum;
d->maxValues.p = absInfo.maximum;
- qCDebug(qLcEvdevTablet, "evdevtablet: %s: min pressure: %d max pressure: %d", qPrintable(m_device),
+ qCDebug(qLcEvdevTablet, "evdevtablet: %ls: min pressure: %d max pressure: %d", qUtf16Printable(m_device),
d->minValues.p, d->maxValues.p);
}
if (ioctl(m_fd, EVIOCGABS(ABS_DISTANCE), &absInfo) >= 0) {
d->minValues.d = absInfo.minimum;
d->maxValues.d = absInfo.maximum;
- qCDebug(qLcEvdevTablet, "evdevtablet: %s: min distance: %d max distance: %d", qPrintable(m_device),
+ qCDebug(qLcEvdevTablet, "evdevtablet: %ls: min distance: %d max distance: %d", qUtf16Printable(m_device),
d->minValues.d, d->maxValues.d);
}
char name[128];
if (ioctl(m_fd, EVIOCGNAME(sizeof(name) - 1), name) >= 0) {
d->devName = QString::fromLocal8Bit(name);
- qCDebug(qLcEvdevTablet, "evdevtablet: %s: device name: %s", qPrintable(m_device), name);
+ qCDebug(qLcEvdevTablet, "evdevtablet: %ls: device name: %s", qUtf16Printable(m_device), name);
}
return ok;
}
@@ -253,11 +253,11 @@ void QEvdevTabletHandler::readData()
for (; ;) {
int result = QT_READ(m_fd, reinterpret_cast<char*>(buffer) + n, sizeof(buffer) - n);
if (!result) {
- qWarning("evdevtablet: %s: Got EOF from input device", qPrintable(m_device));
+ qWarning("evdevtablet: %ls: Got EOF from input device", qUtf16Printable(m_device));
return;
} else if (result < 0) {
if (errno != EINTR && errno != EAGAIN) {
- qErrnoWarning(errno, "evdevtablet: %s: Could not read from input device", qPrintable(m_device));
+ qErrnoWarning("evdevtablet: %ls: Could not read from input device", qUtf16Printable(m_device));
if (errno == ENODEV) { // device got disconnected -> stop reading
delete m_notifier;
m_notifier = 0;
diff --git a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
index 66e821117a..b83bb21258 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h
@@ -64,7 +64,7 @@ class QEvdevTabletData;
class QEvdevTabletHandler : public QObject
{
public:
- explicit QEvdevTabletHandler(const QString &device, const QString &spec = QString(), QObject *parent = 0);
+ explicit QEvdevTabletHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr);
~QEvdevTabletHandler();
qint64 deviceId() const;
@@ -83,7 +83,7 @@ private:
class QEvdevTabletHandlerThread : public QDaemonThread
{
public:
- explicit QEvdevTabletHandlerThread(const QString &device, const QString &spec, QObject *parent = 0);
+ explicit QEvdevTabletHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr);
~QEvdevTabletHandlerThread();
void run() override;
QEvdevTabletHandler *handler() { return m_handler; }
diff --git a/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp b/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp
index 90949408ac..d9888c5b97 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp
+++ b/src/platformsupport/input/evdevtablet/qevdevtabletmanager.cpp
@@ -40,12 +40,15 @@
#include "qevdevtabletmanager_p.h"
#include "qevdevtablethandler_p.h"
+#include <QtInputSupport/private/qevdevutil_p.h>
+
#include <QStringList>
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
#include <private/qguiapplication_p.h>
#include <private/qinputdevicemanager_p_p.h>
+#include <private/qmemory_p.h>
QT_BEGIN_NAMESPACE
@@ -64,34 +67,23 @@ QEvdevTabletManager::QEvdevTabletManager(const QString &key, const QString &spec
if (spec.isEmpty())
spec = specification;
- QStringList args = spec.split(QLatin1Char(':'));
- QStringList devices;
-
- foreach (const QString &arg, args) {
- if (arg.startsWith(QLatin1String("/dev/"))) {
- devices.append(arg);
- args.removeAll(arg);
- }
- }
-
- // build new specification without /dev/ elements
- m_spec = args.join(QLatin1Char(':'));
+ auto parsed = QEvdevUtil::parseSpecification(spec);
+ m_spec = std::move(parsed.spec);
- foreach (const QString &device, devices)
+ for (const QString &device : qAsConst(parsed.devices))
addDevice(device);
// when no devices specified, use device discovery to scan and monitor
- if (devices.isEmpty()) {
- qCDebug(qLcEvdevTablet) << "evdevtablet: Using device discovery";
- m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Tablet, this);
- if (m_deviceDiscovery) {
- const QStringList devices = m_deviceDiscovery->scanConnectedDevices();
+ if (parsed.devices.isEmpty()) {
+ qCDebug(qLcEvdevTablet, "evdevtablet: Using device discovery");
+ if (auto deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Tablet, this)) {
+ const QStringList devices = deviceDiscovery->scanConnectedDevices();
for (const QString &device : devices)
addDevice(device);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceDetected,
this, &QEvdevTabletManager::addDevice);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
this, &QEvdevTabletManager::removeDevice);
}
}
@@ -99,33 +91,32 @@ QEvdevTabletManager::QEvdevTabletManager(const QString &key, const QString &spec
QEvdevTabletManager::~QEvdevTabletManager()
{
- qDeleteAll(m_activeDevices);
}
void QEvdevTabletManager::addDevice(const QString &deviceNode)
{
- qCDebug(qLcEvdevTablet) << "Adding device at" << deviceNode;
- QEvdevTabletHandlerThread *handler;
- handler = new QEvdevTabletHandlerThread(deviceNode, m_spec);
+ qCDebug(qLcEvdevTablet, "Adding device at %ls", qUtf16Printable(deviceNode));
+ auto handler = qt_make_unique<QEvdevTabletHandlerThread>(deviceNode, m_spec);
if (handler) {
- m_activeDevices.insert(deviceNode, handler);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypeTablet, m_activeDevices.count());
+ m_activeDevices.add(deviceNode, std::move(handler));
+ updateDeviceCount();
} else {
- qWarning("evdevtablet: Failed to open tablet device %s", qPrintable(deviceNode));
+ qWarning("evdevtablet: Failed to open tablet device %ls", qUtf16Printable(deviceNode));
}
}
void QEvdevTabletManager::removeDevice(const QString &deviceNode)
{
- if (m_activeDevices.contains(deviceNode)) {
- qCDebug(qLcEvdevTablet) << "Removing device at" << deviceNode;
- QEvdevTabletHandlerThread *handler = m_activeDevices.value(deviceNode);
- m_activeDevices.remove(deviceNode);
- QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
- QInputDeviceManager::DeviceTypeTablet, m_activeDevices.count());
- delete handler;
+ if (m_activeDevices.remove(deviceNode)) {
+ qCDebug(qLcEvdevTablet, "Removing device at %ls", qUtf16Printable(deviceNode));
+ updateDeviceCount();
}
}
+void QEvdevTabletManager::updateDeviceCount()
+{
+ QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
+ QInputDeviceManager::DeviceTypeTablet, m_activeDevices.count());
+}
+
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h b/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h
index cde91c55aa..bb18ffba04 100644
--- a/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h
+++ b/src/platformsupport/input/evdevtablet/qevdevtabletmanager_p.h
@@ -51,6 +51,8 @@
// We mean it.
//
+#include <QtInputSupport/private/devicehandlerlist_p.h>
+
#include <QObject>
#include <QHash>
#include <QSocketNotifier>
@@ -63,16 +65,17 @@ class QEvdevTabletHandlerThread;
class QEvdevTabletManager : public QObject
{
public:
- QEvdevTabletManager(const QString &key, const QString &spec, QObject *parent = 0);
+ QEvdevTabletManager(const QString &key, const QString &spec, QObject *parent = nullptr);
~QEvdevTabletManager();
void addDevice(const QString &deviceNode);
void removeDevice(const QString &deviceNode);
private:
+ void updateDeviceCount();
+
QString m_spec;
- QDeviceDiscovery *m_deviceDiscovery;
- QHash<QString, QEvdevTabletHandlerThread *> m_activeDevices;
+ QtInputSupport::DeviceHandlerList<QEvdevTabletHandlerThread> m_activeDevices;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index f86f80785e..c51db59e1f 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -49,6 +49,9 @@
#include <QtCore/private/qcore_unix_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qguiapplication_p.h>
+
+#include <mutex>
+
#ifdef Q_OS_FREEBSD
#include <dev/evdev/input.h>
#else
@@ -66,6 +69,7 @@ extern "C" {
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcEvdevTouch, "qt.qpa.input")
+Q_LOGGING_CATEGORY(qLcEvents, "qt.qpa.input.events")
/* android (and perhaps some other linux-derived stuff) don't define everything
* in linux/input.h, so we'll need to do that ourselves.
@@ -228,7 +232,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
}
}
- qCDebug(qLcEvdevTouch, "evdevtouch: Using device %s", qPrintable(device));
+ qCDebug(qLcEvdevTouch, "evdevtouch: Using device %ls", qUtf16Printable(device));
m_fd = QT_OPEN(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
@@ -236,7 +240,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
m_notify = new QSocketNotifier(m_fd, QSocketNotifier::Read, this);
connect(m_notify, &QSocketNotifier::activated, this, &QEvdevTouchScreenHandler::readData);
} else {
- qErrnoWarning(errno, "evdevtouch: Cannot open input device %s", qPrintable(device));
+ qErrnoWarning("evdevtouch: Cannot open input device %ls", qUtf16Printable(device));
return;
}
@@ -266,8 +270,8 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
d->deviceNode = device;
qCDebug(qLcEvdevTouch,
- "evdevtouch: %s: Protocol type %c %s (%s), filtered=%s",
- qPrintable(d->deviceNode),
+ "evdevtouch: %ls: Protocol type %c %s (%s), filtered=%s",
+ qUtf16Printable(d->deviceNode),
d->m_typeB ? 'B' : 'A', mtdevStr,
d->m_singleTouch ? "single" : "multi",
d->m_filtered ? "yes" : "no");
@@ -279,7 +283,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
bool has_x_range = false, has_y_range = false;
if (ioctl(m_fd, EVIOCGABS((d->m_singleTouch ? ABS_X : ABS_MT_POSITION_X)), &absInfo) >= 0) {
- qCDebug(qLcEvdevTouch, "evdevtouch: %s: min X: %d max X: %d", qPrintable(device),
+ qCDebug(qLcEvdevTouch, "evdevtouch: %ls: min X: %d max X: %d", qUtf16Printable(device),
absInfo.minimum, absInfo.maximum);
d->hw_range_x_min = absInfo.minimum;
d->hw_range_x_max = absInfo.maximum;
@@ -287,7 +291,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
}
if (ioctl(m_fd, EVIOCGABS((d->m_singleTouch ? ABS_Y : ABS_MT_POSITION_Y)), &absInfo) >= 0) {
- qCDebug(qLcEvdevTouch, "evdevtouch: %s: min Y: %d max Y: %d", qPrintable(device),
+ qCDebug(qLcEvdevTouch, "evdevtouch: %ls: min Y: %d max Y: %d", qUtf16Printable(device),
absInfo.minimum, absInfo.maximum);
d->hw_range_y_min = absInfo.minimum;
d->hw_range_y_max = absInfo.maximum;
@@ -295,10 +299,10 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
}
if (!has_x_range || !has_y_range)
- qWarning("evdevtouch: %s: Invalid ABS limits, behavior unspecified", qPrintable(device));
+ qWarning("evdevtouch: %ls: Invalid ABS limits, behavior unspecified", qUtf16Printable(device));
if (ioctl(m_fd, EVIOCGABS(ABS_PRESSURE), &absInfo) >= 0) {
- qCDebug(qLcEvdevTouch, "evdevtouch: %s: min pressure: %d max pressure: %d", qPrintable(device),
+ qCDebug(qLcEvdevTouch, "evdevtouch: %ls: min pressure: %d max pressure: %d", qUtf16Printable(device),
absInfo.minimum, absInfo.maximum);
if (absInfo.maximum > absInfo.minimum) {
d->hw_pressure_min = absInfo.minimum;
@@ -309,7 +313,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
char name[1024];
if (ioctl(m_fd, EVIOCGNAME(sizeof(name) - 1), name) >= 0) {
d->hw_name = QString::fromLocal8Bit(name);
- qCDebug(qLcEvdevTouch, "evdevtouch: %s: device name: %s", qPrintable(device), name);
+ qCDebug(qLcEvdevTouch, "evdevtouch: %ls: device name: %s", qUtf16Printable(device), name);
}
// Fix up the coordinate ranges for am335x in case the kernel driver does not have them fixed.
@@ -345,8 +349,8 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
if (mapping.load()) {
d->m_screenName = mapping.screenNameForDeviceNode(d->deviceNode);
if (!d->m_screenName.isEmpty())
- qCDebug(qLcEvdevTouch, "evdevtouch: Mapping device %s to screen %s",
- qPrintable(d->deviceNode), qPrintable(d->m_screenName));
+ qCDebug(qLcEvdevTouch, "evdevtouch: Mapping device %ls to screen %ls",
+ qUtf16Printable(d->deviceNode), qUtf16Printable(d->m_screenName));
}
registerTouchDevice();
@@ -427,7 +431,7 @@ err:
return;
} else if (events < 0) {
if (errno != EINTR && errno != EAGAIN) {
- qErrnoWarning(errno, "evdevtouch: Could not read from input device");
+ qErrnoWarning("evdevtouch: Could not read from input device");
if (errno == ENODEV) { // device got disconnected -> stop reading
delete m_notify;
m_notify = nullptr;
@@ -536,6 +540,9 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
if (m_typeB)
m_contacts[m_currentSlot].maj = m_currentData.maj;
} else if (data->code == ABS_PRESSURE || data->code == ABS_MT_PRESSURE) {
+ if (Q_UNLIKELY(qLcEvents().isDebugEnabled()))
+ qCDebug(qLcEvents, "EV_ABS code 0x%x: pressure %d; bounding to [%d,%d]",
+ data->code, data->value, hw_pressure_min, hw_pressure_max);
m_currentData.pressure = qBound(hw_pressure_min, data->value, hw_pressure_max);
if (m_typeB || m_singleTouch)
m_contacts[m_currentSlot].pressure = m_currentData.pressure;
@@ -563,8 +570,9 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
if (!m_contacts.isEmpty() && m_contacts.constBegin().value().trackingId == -1)
assignIds();
+ std::unique_lock<QMutex> locker;
if (m_filtered)
- m_mutex.lock();
+ locker = std::unique_lock<QMutex>{m_mutex};
// update timestamps
m_lastTimeStamp = m_timeStamp;
@@ -573,10 +581,11 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
m_lastTouchPoints = m_touchPoints;
m_touchPoints.clear();
Qt::TouchPointStates combinedStates;
+ bool hasPressure = false;
+
+ for (auto i = m_contacts.begin(), end = m_contacts.end(); i != end; /*erasing*/) {
+ auto it = i++;
- QMutableHashIterator<int, Contact> it(m_contacts);
- while (it.hasNext()) {
- it.next();
Contact &contact(it.value());
if (!contact.state)
@@ -599,17 +608,18 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
// Avoid reporting a contact in released state more than once.
if (!m_typeB && contact.state == Qt::TouchPointReleased
&& !m_lastContacts.contains(key)) {
- it.remove();
+ m_contacts.erase(it);
continue;
}
+ if (contact.pressure)
+ hasPressure = true;
+
addTouchPoint(contact, &combinedStates);
}
// Now look for contacts that have disappeared since the last sync.
- it = m_lastContacts;
- while (it.hasNext()) {
- it.next();
+ for (auto it = m_lastContacts.begin(), end = m_lastContacts.end(); it != end; ++it) {
Contact &contact(it.value());
int key = m_typeB ? it.key() : contact.trackingId;
if (m_typeB) {
@@ -626,9 +636,9 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
}
// Remove contacts that have just been reported as released.
- it = m_contacts;
- while (it.hasNext()) {
- it.next();
+ for (auto i = m_contacts.begin(), end = m_contacts.end(); i != end; /*erasing*/) {
+ auto it = i++;
+
Contact &contact(it.value());
if (!contact.state)
@@ -638,7 +648,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
if (m_typeB)
contact.state = static_cast<Qt::TouchPointState>(0);
else
- it.remove();
+ m_contacts.erase(it);
} else {
contact.state = Qt::TouchPointStationary;
}
@@ -649,11 +659,8 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
m_contacts.clear();
- if (!m_touchPoints.isEmpty() && combinedStates != Qt::TouchPointStationary)
+ if (!m_touchPoints.isEmpty() && (hasPressure || combinedStates != Qt::TouchPointStationary))
reportPoints();
-
- if (m_filtered)
- m_mutex.unlock();
}
m_lastEventType = data->type;
@@ -778,6 +785,9 @@ void QEvdevTouchScreenData::reportPoints()
tp.pressure = tp.state == Qt::TouchPointReleased ? 0 : 1;
else
tp.pressure = (tp.pressure - hw_pressure_min) / qreal(hw_pressure_max - hw_pressure_min);
+
+ if (Q_UNLIKELY(qLcEvents().isDebugEnabled()))
+ qCDebug(qLcEvents) << "reporting" << tp;
}
// Let qguiapp pick the target window.
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
index 4cacbf03e5..bf2df93d11 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp
@@ -40,12 +40,15 @@
#include "qevdevtouchmanager_p.h"
#include "qevdevtouchhandler_p.h"
+#include <QtInputSupport/private/qevdevutil_p.h>
+
#include <QStringList>
#include <QGuiApplication>
#include <QLoggingCategory>
#include <QtDeviceDiscoverySupport/private/qdevicediscovery_p.h>
#include <private/qguiapplication_p.h>
#include <private/qinputdevicemanager_p_p.h>
+#include <private/qmemory_p.h>
QT_BEGIN_NAMESPACE
@@ -64,34 +67,23 @@ QEvdevTouchManager::QEvdevTouchManager(const QString &key, const QString &specif
if (spec.isEmpty())
spec = specification;
- QStringList args = spec.split(QLatin1Char(':'));
- QStringList devices;
-
- foreach (const QString &arg, args) {
- if (arg.startsWith(QLatin1String("/dev/"))) {
- devices.append(arg);
- args.removeAll(arg);
- }
- }
-
- // build new specification without /dev/ elements
- m_spec = args.join(QLatin1Char(':'));
+ auto parsed = QEvdevUtil::parseSpecification(spec);
+ m_spec = std::move(parsed.spec);
- foreach (const QString &device, devices)
+ for (const QString &device : qAsConst(parsed.devices))
addDevice(device);
// when no devices specified, use device discovery to scan and monitor
- if (devices.isEmpty()) {
- qCDebug(qLcEvdevTouch) << "evdevtouch: Using device discovery";
- m_deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Touchpad | QDeviceDiscovery::Device_Touchscreen, this);
- if (m_deviceDiscovery) {
- const QStringList devices = m_deviceDiscovery->scanConnectedDevices();
+ if (parsed.devices.isEmpty()) {
+ qCDebug(qLcEvdevTouch, "evdevtouch: Using device discovery");
+ if (auto deviceDiscovery = QDeviceDiscovery::create(QDeviceDiscovery::Device_Touchpad | QDeviceDiscovery::Device_Touchscreen, this)) {
+ const QStringList devices = deviceDiscovery->scanConnectedDevices();
for (const QString &device : devices)
addDevice(device);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceDetected,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceDetected,
this, &QEvdevTouchManager::addDevice);
- connect(m_deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
+ connect(deviceDiscovery, &QDeviceDiscovery::deviceRemoved,
this, &QEvdevTouchManager::removeDevice);
}
}
@@ -99,30 +91,24 @@ QEvdevTouchManager::QEvdevTouchManager(const QString &key, const QString &specif
QEvdevTouchManager::~QEvdevTouchManager()
{
- qDeleteAll(m_activeDevices);
}
void QEvdevTouchManager::addDevice(const QString &deviceNode)
{
- qCDebug(qLcEvdevTouch) << "evdevtouch: Adding device at" << deviceNode;
- QEvdevTouchScreenHandlerThread *handler;
- handler = new QEvdevTouchScreenHandlerThread(deviceNode, m_spec);
+ qCDebug(qLcEvdevTouch, "evdevtouch: Adding device at %ls", qUtf16Printable(deviceNode));
+ auto handler = qt_make_unique<QEvdevTouchScreenHandlerThread>(deviceNode, m_spec);
if (handler) {
- m_activeDevices.insert(deviceNode, handler);
- connect(handler, &QEvdevTouchScreenHandlerThread::touchDeviceRegistered, this, &QEvdevTouchManager::updateInputDeviceCount);
+ connect(handler.get(), &QEvdevTouchScreenHandlerThread::touchDeviceRegistered, this, &QEvdevTouchManager::updateInputDeviceCount);
+ m_activeDevices.add(deviceNode, std::move(handler));
} else {
- qWarning("evdevtouch: Failed to open touch device %s", qPrintable(deviceNode));
+ qWarning("evdevtouch: Failed to open touch device %ls", qUtf16Printable(deviceNode));
}
}
void QEvdevTouchManager::removeDevice(const QString &deviceNode)
{
- if (m_activeDevices.contains(deviceNode)) {
- qCDebug(qLcEvdevTouch) << "evdevtouch: Removing device at" << deviceNode;
- QEvdevTouchScreenHandlerThread *handler = m_activeDevices.value(deviceNode);
- m_activeDevices.remove(deviceNode);
- delete handler;
-
+ if (m_activeDevices.remove(deviceNode)) {
+ qCDebug(qLcEvdevTouch, "evdevtouch: Removing device at %ls", qUtf16Printable(deviceNode));
updateInputDeviceCount();
}
}
@@ -130,13 +116,13 @@ void QEvdevTouchManager::removeDevice(const QString &deviceNode)
void QEvdevTouchManager::updateInputDeviceCount()
{
int registeredTouchDevices = 0;
- Q_FOREACH (QEvdevTouchScreenHandlerThread *handler, m_activeDevices) {
- if (handler->isTouchDeviceRegistered())
+ for (const auto &device : m_activeDevices) {
+ if (device.handler->isTouchDeviceRegistered())
++registeredTouchDevices;
}
- qCDebug(qLcEvdevTouch) << "evdevtouch: Updating QInputDeviceManager device count:" << registeredTouchDevices << " touch devices,"
- << m_activeDevices.count() - registeredTouchDevices << "pending handler(s)" ;
+ qCDebug(qLcEvdevTouch, "evdevtouch: Updating QInputDeviceManager device count: %d touch devices, %d pending handler(s)",
+ registeredTouchDevices, m_activeDevices.count() - registeredTouchDevices);
QInputDeviceManagerPrivate::get(QGuiApplicationPrivate::inputDeviceManager())->setDeviceCount(
QInputDeviceManager::DeviceTypeTouch, registeredTouchDevices);
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
index e524c516f1..94ee05d900 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h
@@ -51,6 +51,8 @@
// We mean it.
//
+#include <QtInputSupport/private/devicehandlerlist_p.h>
+
#include <QObject>
#include <QHash>
#include <QSocketNotifier>
@@ -63,7 +65,7 @@ class QEvdevTouchScreenHandlerThread;
class QEvdevTouchManager : public QObject
{
public:
- QEvdevTouchManager(const QString &key, const QString &spec, QObject *parent = 0);
+ QEvdevTouchManager(const QString &key, const QString &spec, QObject *parent = nullptr);
~QEvdevTouchManager();
void addDevice(const QString &deviceNode);
@@ -73,8 +75,7 @@ public:
private:
QString m_spec;
- QDeviceDiscovery *m_deviceDiscovery;
- QHash<QString, QEvdevTouchScreenHandlerThread *> m_activeDevices;
+ QtInputSupport::DeviceHandlerList<QEvdevTouchScreenHandlerThread> m_activeDevices;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/input/libinput/qlibinputhandler.cpp b/src/platformsupport/input/libinput/qlibinputhandler.cpp
index e5dc182bec..95dfb46d16 100644
--- a/src/platformsupport/input/libinput/qlibinputhandler.cpp
+++ b/src/platformsupport/input/libinput/qlibinputhandler.cpp
@@ -205,6 +205,9 @@ void QLibInputHandler::processEvent(libinput_event *ev)
case LIBINPUT_EVENT_POINTER_MOTION:
m_pointer->processMotion(libinput_event_get_pointer_event(ev));
break;
+ case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
+ m_pointer->processAbsMotion(libinput_event_get_pointer_event(ev));
+ break;
case LIBINPUT_EVENT_POINTER_AXIS:
m_pointer->processAxis(libinput_event_get_pointer_event(ev));
break;
diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp
index c54b61fc66..db9e81b5df 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer.cpp
+++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp
@@ -103,6 +103,24 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e)
Qt::NoButton, QEvent::MouseMove, mods);
}
+void QLibInputPointer::processAbsMotion(libinput_event_pointer *e)
+{
+ QScreen * const primaryScreen = QGuiApplication::primaryScreen();
+ const QRect g = QHighDpi::toNativePixels(primaryScreen->virtualGeometry(), primaryScreen);
+
+ const double x = libinput_event_pointer_get_absolute_x_transformed(e, g.width());
+ const double y = libinput_event_pointer_get_absolute_y_transformed(e, g.height());
+
+ m_pos.setX(qBound(g.left(), qRound(g.left() + x), g.right()));
+ m_pos.setY(qBound(g.top(), qRound(g.top() + y), g.bottom()));
+
+ Qt::KeyboardModifiers mods = QGuiApplicationPrivate::inputDeviceManager()->keyboardModifiers();
+
+ QWindowSystemInterface::handleMouseEvent(nullptr, m_pos, m_pos, m_buttons,
+ Qt::NoButton, QEvent::MouseMove, mods);
+
+}
+
void QLibInputPointer::processAxis(libinput_event_pointer *e)
{
double value; // default axis value is 15 degrees per wheel click
diff --git a/src/platformsupport/input/libinput/qlibinputpointer_p.h b/src/platformsupport/input/libinput/qlibinputpointer_p.h
index a7a66337f1..55d4a5f919 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer_p.h
+++ b/src/platformsupport/input/libinput/qlibinputpointer_p.h
@@ -64,6 +64,7 @@ public:
void processButton(libinput_event_pointer *e);
void processMotion(libinput_event_pointer *e);
+ void processAbsMotion(libinput_event_pointer *e);
void processAxis(libinput_event_pointer *e);
void setPos(const QPoint &pos);
diff --git a/src/platformsupport/input/libinput/qlibinputtouch_p.h b/src/platformsupport/input/libinput/qlibinputtouch_p.h
index 6f88001d19..51304e6a21 100644
--- a/src/platformsupport/input/libinput/qlibinputtouch_p.h
+++ b/src/platformsupport/input/libinput/qlibinputtouch_p.h
@@ -73,7 +73,7 @@ public:
private:
struct DeviceState {
- DeviceState() : m_touchDevice(0) { }
+ DeviceState() : m_touchDevice(nullptr) { }
QWindowSystemInterface::TouchPoint *point(int32_t slot);
QList<QWindowSystemInterface::TouchPoint> m_points;
QTouchDevice *m_touchDevice;
diff --git a/src/platformsupport/input/shared/devicehandlerlist_p.h b/src/platformsupport/input/shared/devicehandlerlist_p.h
new file mode 100644
index 0000000000..97794d4d7d
--- /dev/null
+++ b/src/platformsupport/input/shared/devicehandlerlist_p.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTINPUTSUPPORT_DEVICEHANDLERLIST_P_H
+#define QTINPUTSUPPORT_DEVICEHANDLERLIST_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 <QString>
+
+#include <vector>
+#include <memory>
+
+namespace QtInputSupport {
+
+template <typename Handler>
+class DeviceHandlerList {
+public:
+ struct Device {
+ QString deviceNode;
+ std::unique_ptr<Handler> handler;
+ };
+
+ void add(const QString &deviceNode, std::unique_ptr<Handler> handler)
+ {
+ v.push_back({deviceNode, std::move(handler)});
+ }
+
+ bool remove(const QString &deviceNode)
+ {
+ const auto deviceNodeMatches = [&] (const Device &d) { return d.deviceNode == deviceNode; };
+ const auto it = std::find_if(v.cbegin(), v.cend(), deviceNodeMatches);
+ if (it == v.cend())
+ return false;
+ v.erase(it);
+ return true;
+ }
+
+ int count() const noexcept { return static_cast<int>(v.size()); }
+
+ typename std::vector<Device>::const_iterator begin() const noexcept { return v.begin(); }
+ typename std::vector<Device>::const_iterator end() const noexcept { return v.end(); }
+
+private:
+ std::vector<Device> v;
+};
+
+} // QtInputSupport
+
+#endif // QTINPUTSUPPORT_DEVICEHANDLERLIST_P_H
diff --git a/src/widgets/util/qscroller_mac.mm b/src/platformsupport/input/shared/qevdevutil.cpp
index 6dbb483089..74f8bcdc2b 100644
--- a/src/widgets/util/qscroller_mac.mm
+++ b/src/platformsupport/input/shared/qevdevutil.cpp
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the plugins module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,36 +37,34 @@
**
****************************************************************************/
-#include <QtCore/qglobal.h>
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-
-#import <AppKit/AppKit.h>
-
-#include "qscroller_p.h"
+#include "qevdevutil_p.h"
QT_BEGIN_NAMESPACE
-QPointF QScrollerPrivate::realDpi(int screen) const
-{
- QMacAutoReleasePool pool;
- NSArray *nsscreens = [NSScreen screens];
+namespace QEvdevUtil {
- if (screen < 0 || screen >= int([nsscreens count]))
- screen = 0;
+ParsedSpecification parseSpecification(const QString &specification)
+{
+ ParsedSpecification result;
- NSScreen *nsscreen = [nsscreens objectAtIndex:screen];
- CGDirectDisplayID display = [[[nsscreen deviceDescription] objectForKey:@"NSScreenNumber"] intValue];
+ result.args = specification.splitRef(QLatin1Char(':'));
- CGSize mmsize = CGDisplayScreenSize(display);
- if (mmsize.width > 0 && mmsize.height > 0) {
- return QPointF(CGDisplayPixelsWide(display) / mmsize.width,
- CGDisplayPixelsHigh(display) / mmsize.height) * qreal(25.4);
- } else {
- return QPointF();
+ for (const QStringRef &arg : qAsConst(result.args)) {
+ if (arg.startsWith(QLatin1String("/dev/"))) {
+ // if device is specified try to use it
+ result.devices.append(arg.toString());
+ } else {
+ // build new specification without /dev/ elements
+ result.spec += arg + QLatin1Char(':');
+ }
}
+
+ if (!result.spec.isEmpty())
+ result.spec.chop(1); // remove trailing ':'
+
+ return result;
}
-QT_END_NAMESPACE
+} // namespace QEvdevUtil
-#endif
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.h b/src/platformsupport/input/shared/qevdevutil_p.h
index 92331a6fb1..7d0a5af130 100644
--- a/src/plugins/platforms/mirclient/qmirclientglcontext.h
+++ b/src/platformsupport/input/shared/qevdevutil_p.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2019 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the plugins module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -37,27 +37,40 @@
**
****************************************************************************/
+#ifndef QEVDEVUTIL_P_H
+#define QEVDEVUTIL_P_H
-#ifndef QMIRCLIENTGLCONTEXT_H
-#define QMIRCLIENTGLCONTEXT_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 <qpa/qplatformopenglcontext.h>
-#include <QtEglSupport/private/qeglplatformcontext_p.h>
+#include <QString>
+#include <QStringList>
+#include <QVector>
+#include <QStringRef>
-#include <EGL/egl.h>
+QT_BEGIN_NAMESPACE
-class QMirClientOpenGLContext : public QEGLPlatformContext
+namespace QEvdevUtil {
+
+struct ParsedSpecification
{
-public:
- QMirClientOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
- EGLDisplay display);
+ QString spec;
+ QStringList devices;
+ QVector<QStringRef> args;
+};
- // QEGLPlatformContext methods.
- void swapBuffers(QPlatformSurface *surface) final;
- bool makeCurrent(QPlatformSurface *surface) final;
+ParsedSpecification parseSpecification(const QString &specification);
-protected:
- EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) final;
-};
+}
+
+QT_END_NAMESPACE
-#endif // QMIRCLIENTGLCONTEXT_H
+#endif // QEVDEVUTIL_P_H
diff --git a/src/platformsupport/input/shared/shared.pri b/src/platformsupport/input/shared/shared.pri
index 1443235244..c29d11e7d6 100644
--- a/src/platformsupport/input/shared/shared.pri
+++ b/src/platformsupport/input/shared/shared.pri
@@ -1,5 +1,8 @@
HEADERS += \
+ $$PWD/devicehandlerlist_p.h \
+ $$PWD/qevdevutil_p.h \
$$PWD/qtouchoutputmapping_p.h
SOURCES += \
+ $$PWD/qevdevutil.cpp \
$$PWD/qtouchoutputmapping.cpp
diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp
index 7609416fea..e105f5ea98 100644
--- a/src/platformsupport/input/tslib/qtslib.cpp
+++ b/src/platformsupport/input/tslib/qtslib.cpp
@@ -57,38 +57,22 @@ QTsLibMouseHandler::QTsLibMouseHandler(const QString &key,
const QString &specification,
QObject *parent)
: QObject(parent),
- m_notify(0), m_x(0), m_y(0), m_pressed(0), m_rawMode(false)
+ m_rawMode(!key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive))
{
qCDebug(qLcTsLib) << "Initializing tslib plugin" << key << specification;
setObjectName(QLatin1String("TSLib Mouse Handler"));
- QByteArray device = qgetenv("TSLIB_TSDEVICE");
-
- if (specification.startsWith(QLatin1String("/dev/")))
- device = specification.toLocal8Bit();
-
- if (device.isEmpty())
- device = QByteArrayLiteral("/dev/input/event1");
-
- m_dev = ts_open(device.constData(), 1);
+ m_dev = ts_setup(nullptr, 1);
if (!m_dev) {
- qErrnoWarning(errno, "ts_open() failed");
+ qErrnoWarning(errno, "ts_setup() failed");
return;
}
- if (ts_config(m_dev))
- qErrnoWarning(errno, "ts_config() failed");
-
- m_rawMode = !key.compare(QLatin1String("TslibRaw"), Qt::CaseInsensitive);
-
- int fd = ts_fd(m_dev);
- if (fd >= 0) {
- qCDebug(qLcTsLib) << "tslib device is" << device;
- m_notify = new QSocketNotifier(fd, QSocketNotifier::Read, this);
- connect(m_notify, &QSocketNotifier::activated, this, &QTsLibMouseHandler::readMouseData);
- } else {
- qErrnoWarning(errno, "tslib: Cannot open input device %s", device.constData());
- }
+#ifdef TSLIB_VERSION_EVENTPATH /* also introduced in 1.15 */
+ qCDebug(qLcTsLib) << "tslib device is" << ts_get_eventpath(m_dev);
+#endif
+ m_notify = new QSocketNotifier(ts_fd(m_dev), QSocketNotifier::Read, this);
+ connect(m_notify, &QSocketNotifier::activated, this, &QTsLibMouseHandler::readMouseData);
}
QTsLibMouseHandler::~QTsLibMouseHandler()
diff --git a/src/platformsupport/input/tslib/qtslib_p.h b/src/platformsupport/input/tslib/qtslib_p.h
index 0c08fb6a3d..ffd60cd0e3 100644
--- a/src/platformsupport/input/tslib/qtslib_p.h
+++ b/src/platformsupport/input/tslib/qtslib_p.h
@@ -71,11 +71,12 @@ private slots:
void readMouseData();
private:
- QSocketNotifier * m_notify;
+ QSocketNotifier * m_notify = nullptr;
tsdev *m_dev;
- int m_x, m_y;
- bool m_pressed;
- bool m_rawMode;
+ int m_x = 0;
+ int m_y = 0;
+ bool m_pressed = false;
+ const bool m_rawMode;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
index fec59cfc7b..6121faf362 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp
+++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp
@@ -66,6 +66,8 @@ enum OutputConfiguration {
int QKmsDevice::crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr connector)
{
+ int candidate = -1;
+
for (int i = 0; i < connector->count_encoders; i++) {
drmModeEncoderPtr encoder = drmModeGetEncoder(m_dri_fd, connector->encoders[i]);
if (!encoder) {
@@ -73,19 +75,30 @@ int QKmsDevice::crtcForConnector(drmModeResPtr resources, drmModeConnectorPtr co
continue;
}
+ quint32 encoderId = encoder->encoder_id;
+ quint32 crtcId = encoder->crtc_id;
quint32 possibleCrtcs = encoder->possible_crtcs;
drmModeFreeEncoder(encoder);
for (int j = 0; j < resources->count_crtcs; j++) {
bool isPossible = possibleCrtcs & (1 << j);
bool isAvailable = !(m_crtc_allocator & (1 << j));
-
- if (isPossible && isAvailable)
+ // Preserve the existing CRTC -> encoder -> connector routing if
+ // any. It makes the initialization faster, and may be better
+ // since we have a very dumb picking algorithm.
+ bool isBestChoice = (!connector->encoder_id ||
+ (connector->encoder_id == encoderId &&
+ resources->crtcs[j] == crtcId));
+
+ if (isPossible && isAvailable && isBestChoice) {
return j;
+ } else if (isPossible && isAvailable) {
+ candidate = j;
+ }
}
}
- return -1;
+ return candidate;
}
static const char * const connector_type_names[] = { // must match DRM_MODE_CONNECTOR_*
@@ -381,23 +394,26 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources,
if (!cloneSource.isEmpty())
qCDebug(qLcKmsDebug) << "Output" << connectorName << " clones output " << cloneSource;
- const QByteArray fbsize = userConnectorConfig.value(QStringLiteral("size")).toByteArray().toLower();
QSize framebufferSize;
- framebufferSize.setWidth(modes[selected_mode].hdisplay);
- framebufferSize.setHeight(modes[selected_mode].vdisplay);
-
+ bool framebufferSizeSet = false;
+ const QByteArray fbsize = userConnectorConfig.value(QStringLiteral("size")).toByteArray().toLower();
+ if (!fbsize.isEmpty()) {
+ if (sscanf(fbsize.constData(), "%dx%d", &framebufferSize.rwidth(), &framebufferSize.rheight()) == 2) {
#if QT_CONFIG(drm_atomic)
- if (hasAtomicSupport()) {
- if (sscanf(fbsize.constData(), "%dx%d", &framebufferSize.rwidth(), &framebufferSize.rheight()) != 2) {
- qWarning("Framebuffer size format is invalid.");
+ if (hasAtomicSupport())
+ framebufferSizeSet = true;
+#endif
+ if (!framebufferSizeSet)
+ qWarning("Setting framebuffer size is only available with DRM atomic API");
+ } else {
+ qWarning("Invalid framebuffer size '%s'", fbsize.constData());
}
- } else {
- qWarning("Setting framebuffer size is only available with DRM atomic API");
}
-#else
- if (fbsize.size())
- qWarning("Setting framebuffer size is only available with DRM atomic API");
-#endif
+ if (!framebufferSizeSet) {
+ framebufferSize.setWidth(modes[selected_mode].hdisplay);
+ framebufferSize.setHeight(modes[selected_mode].vdisplay);
+ }
+
qCDebug(qLcKmsDebug) << "Output" << connectorName << "framebuffer size is " << framebufferSize;
QKmsOutput output;
@@ -799,9 +815,7 @@ void QKmsDevice::discoverPlanes()
for (int i = 0; i < countFormats; ++i) {
uint32_t f = drmplane->formats[i];
plane.supportedFormats.append(f);
- QString s;
- s.sprintf("%c%c%c%c ", f, f >> 8, f >> 16, f >> 24);
- formatStr += s;
+ formatStr += QString::asprintf("%c%c%c%c ", f, f >> 8, f >> 16, f >> 24);
}
qCDebug(qLcKmsDebug, "plane %d: id = %u countFormats = %d possibleCrtcs = 0x%x supported formats = %s",
@@ -848,6 +862,8 @@ void QKmsDevice::discoverPlanes()
plane.crtcYPropertyId = prop->prop_id;
} else if (!strcasecmp(prop->name, "zpos")) {
plane.zposPropertyId = prop->prop_id;
+ } else if (!strcasecmp(prop->name, "blend_op")) {
+ plane.blendOpPropertyId = prop->prop_id;
}
});
diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
index 14da6bb947..b1150e2875 100644
--- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h
+++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h
@@ -178,6 +178,7 @@ struct QKmsPlane
uint32_t crtcwidthPropertyId = 0;
uint32_t crtcheightPropertyId = 0;
uint32_t zposPropertyId = 0;
+ uint32_t blendOpPropertyId = 0;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QKmsPlane::Rotations)
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 6e8cab93a2..4a83c6eb80 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -2050,8 +2050,8 @@ QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int of
int endOffset;
QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
- QStringList attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
- foreach (const QString &attr, attributes) {
+ const QStringList attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
+ for (const QString &attr : attributes) {
QStringList items;
items = attr.split(QLatin1Char(':'), QString::SkipEmptyParts, Qt::CaseSensitive);
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
@@ -2069,14 +2069,13 @@ QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, in
{
QString mapped;
QString joined;
- QStringList attributes;
QSpiAttributeSet map;
int startOffset;
int endOffset;
joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
- attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
- foreach (const QString& attr, attributes) {
+ const QStringList attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
+ for (const QString& attr : attributes) {
QStringList items;
items = attr.split(QLatin1Char(':'), QString::SkipEmptyParts, Qt::CaseSensitive);
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
index b5704f53ad..0b624389a3 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor_p.h
@@ -76,7 +76,7 @@ class AtSpiAdaptor :public QDBusVirtualObject
Q_OBJECT
public:
- explicit AtSpiAdaptor(DBusConnection *connection, QObject *parent = 0);
+ explicit AtSpiAdaptor(DBusConnection *connection, QObject *parent = nullptr);
~AtSpiAdaptor();
void registerApplication();
diff --git a/src/platformsupport/linuxaccessibility/cache_p.h b/src/platformsupport/linuxaccessibility/cache_p.h
index e8529b779b..cc55acc6f8 100644
--- a/src/platformsupport/linuxaccessibility/cache_p.h
+++ b/src/platformsupport/linuxaccessibility/cache_p.h
@@ -65,7 +65,7 @@ class QSpiDBusCache : public QObject
Q_OBJECT
public:
- explicit QSpiDBusCache(QDBusConnection c, QObject* parent = 0);
+ explicit QSpiDBusCache(QDBusConnection c, QObject* parent = nullptr);
void emitAddAccessible(const QSpiAccessibleCacheItem& item);
void emitRemoveAccessible(const QSpiObjectReference& item);
diff --git a/src/platformsupport/linuxaccessibility/dbusconnection_p.h b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
index 4030fabc22..860c18ca05 100644
--- a/src/platformsupport/linuxaccessibility/dbusconnection_p.h
+++ b/src/platformsupport/linuxaccessibility/dbusconnection_p.h
@@ -65,7 +65,7 @@ class DBusConnection : public QObject
Q_OBJECT
public:
- DBusConnection(QObject *parent = 0);
+ DBusConnection(QObject *parent = nullptr);
QDBusConnection connection() const;
bool isEnabled() const { return m_enabled; }
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h
index 7959f0c28a..f484795fbb 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuconnection_p.h
@@ -69,7 +69,7 @@ class QDBusMenuConnection : public QObject
Q_OBJECT
public:
- QDBusMenuConnection(QObject *parent = 0, const QString &serviceName = QString());
+ QDBusMenuConnection(QObject *parent = nullptr, const QString &serviceName = QString());
QDBusConnection connection() const { return m_connection; }
QDBusServiceWatcher *dbusWatcher() const { return m_dbusWatcher; }
bool isStatusNotifierHostRegistered() const { return m_statusNotifierHostRegistered; }
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h
index c92de0a140..cffc080f87 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h
@@ -92,15 +92,11 @@ public:
public Q_SLOTS: // METHODS
QDBusPendingReply<QString, QDBusObjectPath> GetMenuForWindow(uint windowId)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId);
- return asyncCallWithArgumentList(QStringLiteral("GetMenuForWindow"), argumentList);
+ return asyncCall(QStringLiteral("GetMenuForWindow"), windowId);
}
QDBusReply<QString> GetMenuForWindow(uint windowId, QDBusObjectPath &menuObjectPath)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetMenuForWindow"), argumentList);
+ QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetMenuForWindow"), windowId);
QList<QVariant> arguments = reply.arguments();
if (reply.type() == QDBusMessage::ReplyMessage && arguments.count() == 2)
menuObjectPath = qdbus_cast<QDBusObjectPath>(arguments.at(1));
@@ -109,16 +105,12 @@ public Q_SLOTS: // METHODS
QDBusPendingReply<> RegisterWindow(uint windowId, const QDBusObjectPath &menuObjectPath)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId) << QVariant::fromValue(menuObjectPath);
- return asyncCallWithArgumentList(QStringLiteral("RegisterWindow"), argumentList);
+ return asyncCall(QStringLiteral("RegisterWindow"), windowId, menuObjectPath);
}
QDBusPendingReply<> UnregisterWindow(uint windowId)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(windowId);
- return asyncCallWithArgumentList(QStringLiteral("UnregisterWindow"), argumentList);
+ return asyncCall(QStringLiteral("UnregisterWindow"), windowId);
}
};
diff --git a/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h b/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h
index 352b4aa5d6..2194a787eb 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h
+++ b/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h
@@ -88,33 +88,28 @@ public:
public:
QXdgNotificationInterface(const QString &service, const QString &path,
- const QDBusConnection &connection, QObject *parent = 0);
+ const QDBusConnection &connection, QObject *parent = nullptr);
~QXdgNotificationInterface();
public Q_SLOTS: // METHODS
inline QDBusPendingReply<> closeNotification(uint id)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(id);
- return asyncCallWithArgumentList(QStringLiteral("CloseNotification"), argumentList);
+ return asyncCall(QStringLiteral("CloseNotification"), id);
}
inline QDBusPendingReply<QStringList> getCapabilities()
{
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetCapabilities"), argumentList);
+ return asyncCall(QStringLiteral("GetCapabilities"));
}
inline QDBusPendingReply<QString, QString, QString, QString> getServerInformation()
{
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QStringLiteral("GetServerInformation"), argumentList);
+ return asyncCall(QStringLiteral("GetServerInformation"));
}
inline QDBusReply<QString> getServerInformation(QString &vendor, QString &version, QString &specVersion)
{
- QList<QVariant> argumentList;
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetServerInformation"), argumentList);
+ QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetServerInformation"));
if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 4) {
vendor = qdbus_cast<QString>(reply.arguments().at(1));
version = qdbus_cast<QString>(reply.arguments().at(2));
@@ -129,12 +124,7 @@ public Q_SLOTS: // METHODS
const QVariantMap &hints, int timeout)
{
qCDebug(qLcTray) << appName << replacesId << appIcon << summary << body << actions << hints << timeout;
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(appName) << QVariant::fromValue(replacesId) <<
- QVariant::fromValue(appIcon) << QVariant::fromValue(summary) <<
- QVariant::fromValue(body) << QVariant::fromValue(actions) <<
- QVariant::fromValue(hints) << QVariant::fromValue(timeout);
- return asyncCallWithArgumentList(QStringLiteral("Notify"), argumentList);
+ return asyncCall(QStringLiteral("Notify"), appName, replacesId, appIcon, summary, body, actions, hints, timeout);
}
Q_SIGNALS:
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 6db25a90da..70d5616075 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -175,15 +175,9 @@ QStringList QGenericUnixTheme::xdgIconThemePaths()
if (homeIconDir.isDir())
paths.prepend(homeIconDir.absoluteFilePath());
- QString xdgDirString = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
- if (xdgDirString.isEmpty())
- xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
- const auto xdgDirs = xdgDirString.splitRef(QLatin1Char(':'));
- for (const QStringRef &xdgDir : xdgDirs) {
- const QFileInfo xdgIconsDir(xdgDir + QLatin1String("/icons"));
- if (xdgIconsDir.isDir())
- paths.append(xdgIconsDir.absoluteFilePath());
- }
+ paths.append(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
+ QStringLiteral("icons"),
+ QStandardPaths::LocateDirectory));
return paths;
}
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index a5963b79ea..c0da9d8370 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -109,7 +109,7 @@ public:
QVariant themeHint(ThemeHint hint) const override;
QIcon fileIcon(const QFileInfo &fileInfo,
- QPlatformTheme::IconOptions iconOptions = 0) const override;
+ QPlatformTheme::IconOptions iconOptions = nullptr) const override;
const QPalette *palette(Palette type = SystemPalette) const override;
@@ -134,7 +134,7 @@ public:
QGnomeTheme();
QVariant themeHint(ThemeHint hint) const override;
QIcon fileIcon(const QFileInfo &fileInfo,
- QPlatformTheme::IconOptions = 0) const override;
+ QPlatformTheme::IconOptions = nullptr) const override;
const QFont *font(Font type) const override;
QString standardButtonText(int button) const override;
diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
index b9c5669b3f..68340a3173 100644
--- a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
+++ b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance.cpp
@@ -330,6 +330,11 @@ bool QBasicPlatformVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevi
return supported;
}
+void QBasicPlatformVulkanInstance::setDebugFilters(const QVector<QVulkanInstance::DebugFilter> &filters)
+{
+ m_debugFilters = filters;
+}
+
void QBasicPlatformVulkanInstance::destroySurface(VkSurfaceKHR surface) const
{
if (m_destroySurface && surface)
@@ -345,11 +350,11 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL defaultDebugCallbackFunc(VkDebugReportFlag
const char *pMessage,
void *pUserData)
{
- Q_UNUSED(flags);
- Q_UNUSED(objectType);
- Q_UNUSED(object);
- Q_UNUSED(location);
- Q_UNUSED(pUserData);
+ QBasicPlatformVulkanInstance *self = static_cast<QBasicPlatformVulkanInstance *>(pUserData);
+ for (QVulkanInstance::DebugFilter filter : *self->debugFilters()) {
+ if (filter(flags, objectType, object, location, messageCode, pLayerPrefix, pMessage))
+ return VK_FALSE;
+ }
// not categorized, just route to plain old qDebug
qDebug("vkDebug: %s: %d: %s", pLayerPrefix, messageCode, pMessage);
@@ -374,6 +379,7 @@ void QBasicPlatformVulkanInstance::setupDebugOutput()
| VK_DEBUG_REPORT_WARNING_BIT_EXT
| VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT;
dbgCallbackInfo.pfnCallback = defaultDebugCallbackFunc;
+ dbgCallbackInfo.pUserData = this;
VkResult err = createDebugReportCallback(m_vkInst, &dbgCallbackInfo, nullptr, &m_debugCallback);
if (err != VK_SUCCESS)
diff --git a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
index 566140b032..e59d9219fb 100644
--- a/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
+++ b/src/platformsupport/vkconvenience/qbasicvulkanplatforminstance_p.h
@@ -73,7 +73,10 @@ public:
QByteArrayList enabledExtensions() const override;
PFN_vkVoidFunction getInstanceProcAddr(const char *name) override;
bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override;
+ void setDebugFilters(const QVector<QVulkanInstance::DebugFilter> &filters) override;
+
void destroySurface(VkSurfaceKHR surface) const;
+ const QVector<QVulkanInstance::DebugFilter> *debugFilters() const { return &m_debugFilters; }
protected:
void loadVulkanLibrary(const QString &defaultLibraryName);
@@ -105,6 +108,7 @@ private:
VkDebugReportCallbackEXT m_debugCallback;
PFN_vkDestroyDebugReportCallbackEXT m_vkDestroyDebugReportCallbackEXT;
+ QVector<QVulkanInstance::DebugFilter> m_debugFilters;
};
QT_END_NAMESPACE
diff --git a/src/platformsupport/vkconvenience/qvkconvenience.cpp b/src/platformsupport/vkconvenience/qvkconvenience.cpp
index 462cdc9e0d..acde1d1bda 100644
--- a/src/platformsupport/vkconvenience/qvkconvenience.cpp
+++ b/src/platformsupport/vkconvenience/qvkconvenience.cpp
@@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE
\ingroup qpa
*/
+#if QT_CONFIG(opengl)
VkFormat QVkConvenience::vkFormatFromGlFormat(uint glFormat)
{
using GlFormat = QOpenGLTexture::TextureFormat;
@@ -211,5 +212,6 @@ VkFormat QVkConvenience::vkFormatFromGlFormat(uint glFormat)
default: return VK_FORMAT_UNDEFINED;
}
}
+#endif
QT_END_NAMESPACE
diff --git a/src/platformsupport/vkconvenience/qvkconvenience_p.h b/src/platformsupport/vkconvenience/qvkconvenience_p.h
index 1dd1dfc4a7..580271b593 100644
--- a/src/platformsupport/vkconvenience/qvkconvenience_p.h
+++ b/src/platformsupport/vkconvenience/qvkconvenience_p.h
@@ -59,7 +59,9 @@ QT_BEGIN_NAMESPACE
class QVkConvenience
{
public:
+#if QT_CONFIG(opengl)
static VkFormat vkFormatFromGlFormat(uint glFormat);
+#endif
};
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/android/jar/jar.pro b/src/plugins/bearer/android/jar/jar.pro
index f988019dac..8277a8abc1 100644
--- a/src/plugins/bearer/android/jar/jar.pro
+++ b/src/plugins/bearer/android/jar/jar.pro
@@ -1,3 +1,5 @@
+CONFIG += single_arch
+
TARGET = QtAndroidBearer
load(qt_build_paths)
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index eabae5a07b..8b2076bd18 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -46,6 +46,7 @@
#include <QtNetwork/qnetworksession.h>
#include <QtCore/qdebug.h>
+#include <QtCore/private/qlocking_p.h>
#include <QtDBus/QtDBus>
#include <QtDBus/QDBusConnection>
@@ -74,13 +75,13 @@ QConnmanEngine::~QConnmanEngine()
bool QConnmanEngine::connmanAvailable() const
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
return connmanManager->isValid();
}
void QConnmanEngine::initialize()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
connect(ofonoManager,SIGNAL(modemChanged()),this,SLOT(changedModem()));
ofonoNetwork = new QOfonoNetworkRegistrationInterface(ofonoManager->currentModem(),this);
@@ -101,7 +102,7 @@ void QConnmanEngine::initialize()
void QConnmanEngine::changedModem()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (ofonoNetwork)
delete ofonoNetwork;
@@ -114,7 +115,7 @@ void QConnmanEngine::changedModem()
void QConnmanEngine::servicesReady(const QStringList &list)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
for (const QString &servPath : list)
addServiceConfiguration(servPath);
@@ -123,7 +124,7 @@ void QConnmanEngine::servicesReady(const QStringList &list)
QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QList<QNetworkConfigurationPrivate *> fetchedConfigurations;
QNetworkConfigurationPrivate* cpPriv = 0;
const int numFoundConfigurations = foundConfigurations.count();
@@ -150,19 +151,19 @@ QList<QNetworkConfigurationPrivate *> QConnmanEngine::getConfigurations()
QString QConnmanEngine::getInterfaceFromId(const QString &id)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
return configInterfaces.value(id);
}
bool QConnmanEngine::hasIdentifier(const QString &id)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
return accessPointConfigurations.contains(id);
}
void QConnmanEngine::connectToId(const QString &id)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QConnmanServiceInterface *serv = connmanServiceInterfaces.value(id);
@@ -184,7 +185,7 @@ void QConnmanEngine::connectToId(const QString &id)
void QConnmanEngine::disconnectFromId(const QString &id)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QConnmanServiceInterface *serv = connmanServiceInterfaces.value(id);
if (!serv || !serv->isValid()) {
@@ -196,7 +197,7 @@ void QConnmanEngine::disconnectFromId(const QString &id)
void QConnmanEngine::requestUpdate()
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QTimer::singleShot(0, this, SLOT(doRequestUpdate()));
}
@@ -215,7 +216,7 @@ void QConnmanEngine::finishedScan(bool error)
void QConnmanEngine::updateServices(const ConnmanMapList &changed, const QList<QDBusObjectPath> &removed)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
foreach (const QDBusObjectPath &objectPath, removed) {
removeConfiguration(objectPath.path());
@@ -234,7 +235,7 @@ void QConnmanEngine::updateServices(const ConnmanMapList &changed, const QList<Q
QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
@@ -275,7 +276,7 @@ QNetworkSession::State QConnmanEngine::sessionStateForId(const QString &id)
quint64 QConnmanEngine::bytesWritten(const QString &id)
{//TODO use connman counter API
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
quint64 result = 0;
QString devFile = getInterfaceFromId(id);
QFile tx("/sys/class/net/"+devFile+"/statistics/tx_bytes");
@@ -290,7 +291,7 @@ quint64 QConnmanEngine::bytesWritten(const QString &id)
quint64 QConnmanEngine::bytesReceived(const QString &id)
{//TODO use connman counter API
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
quint64 result = 0;
QString devFile = getInterfaceFromId(id);
QFile rx("/sys/class/net/"+devFile+"/statistics/rx_bytes");
@@ -305,7 +306,7 @@ quint64 QConnmanEngine::bytesReceived(const QString &id)
quint64 QConnmanEngine::startTime(const QString &/*id*/)
{
// TODO
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
if (activeTime.isNull()) {
return 0;
}
@@ -327,7 +328,7 @@ QNetworkSessionPrivate *QConnmanEngine::createSessionBackend()
QNetworkConfigurationPrivatePointer QConnmanEngine::defaultConfiguration()
{
- const QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
const auto servPaths = connmanManager->getServices();
for (const QString &servPath : servPaths) {
if (connmanServiceInterfaces.contains(servPath)) {
@@ -352,7 +353,7 @@ void QConnmanEngine::configurationChange(QConnmanServiceInterface *serv)
{
if (!serv)
return;
- QMutexLocker locker(&mutex);
+ auto locker = qt_unique_lock(mutex);
QString id = serv->path();
if (accessPointConfigurations.contains(id)) {
@@ -381,7 +382,7 @@ void QConnmanEngine::configurationChange(QConnmanServiceInterface *serv)
if (changed) {
locker.unlock();
emit configurationChanged(ptr);
- locker.relock();
+ locker.lock();
}
}
@@ -391,7 +392,7 @@ void QConnmanEngine::configurationChange(QConnmanServiceInterface *serv)
QNetworkConfiguration::StateFlags QConnmanEngine::getStateForService(const QString &service)
{
- QMutexLocker locker(&mutex);
+ const auto locker = qt_scoped_lock(mutex);
QConnmanServiceInterface *serv = connmanServiceInterfaces.value(service);
if (!serv)
return QNetworkConfiguration::Undefined;
@@ -472,7 +473,7 @@ bool QConnmanEngine::isRoamingAllowed(const QString &context)
void QConnmanEngine::removeConfiguration(const QString &id)
{
- QMutexLocker locker(&mutex);
+ auto locker = qt_unique_lock(mutex);
if (accessPointConfigurations.contains(id)) {
@@ -485,13 +486,12 @@ void QConnmanEngine::removeConfiguration(const QString &id)
foundConfigurations.removeOne(ptr.data());
locker.unlock();
emit configurationRemoved(ptr);
- locker.relock();
}
}
void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
{
- QMutexLocker locker(&mutex);
+ auto locker = qt_unique_lock(mutex);
if (!connmanServiceInterfaces.contains(servicePath)) {
QConnmanServiceInterface *serv = new QConnmanServiceInterface(servicePath, this);
connmanServiceInterfaces.insert(serv->path(),serv);
@@ -547,7 +547,6 @@ void QConnmanEngine::addServiceConfiguration(const QString &servicePath)
locker.unlock();
Q_EMIT configurationAdded(ptr);
- locker.relock();
}
}
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index c9ff17f801..ef80d38fa2 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -68,7 +68,7 @@ class QConnmanEngine : public QBearerEngineImpl
Q_OBJECT
public:
- QConnmanEngine(QObject *parent = 0);
+ QConnmanEngine(QObject *parent = nullptr);
~QConnmanEngine();
bool connmanAvailable() const;
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 3659eb7740..35d9c40680 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -80,8 +80,7 @@ QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent)
qDBusRegisterMetaType<ConnmanMap>();
qDBusRegisterMetaType<ConnmanMapList>();
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> props_reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> props_reply = asyncCall(QLatin1String("GetProperties"));
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(props_reply, this);
QObject::connect(watcher,SIGNAL(finished(QDBusPendingCallWatcher*)),
@@ -106,8 +105,7 @@ QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent)
QLatin1String("TechnologyRemoved"),
this,SLOT(technologyRemoved(QDBusObjectPath)));
- QList<QVariant> argumentList2;
- QDBusPendingReply<ConnmanMapList> serv_reply = asyncCallWithArgumentList(QLatin1String("GetServices"), argumentList2);
+ QDBusPendingReply<ConnmanMapList> serv_reply = asyncCall(QLatin1String("GetServices"));
QDBusPendingCallWatcher *watcher2 = new QDBusPendingCallWatcher(serv_reply, this);
QObject::connect(watcher2,SIGNAL(finished(QDBusPendingCallWatcher*)),
@@ -289,8 +287,7 @@ QConnmanServiceInterface::QConnmanServiceInterface(const QString &dbusPathName,Q
CONNMAN_SERVICE_INTERFACE,
QDBusConnection::systemBus(), parent)
{
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> props_reply = asyncCallWithArgumentList(QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> props_reply = asyncCall(QLatin1String("GetProperties"));
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(props_reply, this);
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux_p.h b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
index d2804ebca6..790325f9a1 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux_p.h
+++ b/src/plugins/bearer/connman/qconnmanservice_linux_p.h
@@ -105,7 +105,7 @@ class QConnmanManagerInterface : public QDBusAbstractInterface
public:
- QConnmanManagerInterface( QObject *parent = 0);
+ QConnmanManagerInterface( QObject *parent = nullptr);
~QConnmanManagerInterface();
QDBusObjectPath path() const;
@@ -155,7 +155,7 @@ class QConnmanServiceInterface : public QDBusAbstractInterface
public:
- explicit QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = 0);
+ explicit QConnmanServiceInterface(const QString &dbusPathName,QObject *parent = nullptr);
~QConnmanServiceInterface();
QVariantMap getProperties();
@@ -202,7 +202,7 @@ class QConnmanTechnologyInterface : public QDBusAbstractInterface
public:
- explicit QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = 0);
+ explicit QConnmanTechnologyInterface(const QString &dbusPathName,QObject *parent = nullptr);
~QConnmanTechnologyInterface();
QString type();
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h
index 4a431b886e..6dddee66a4 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.h
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.h
@@ -122,9 +122,9 @@ public:
QString interfaceName;
QMap<QString, QString> configurationInterface;
void getUserConfigurations();
- QString getNetworkNameFromSsid(const QString &ssid);
- QString getSsidFromNetworkName(const QString &name);
- bool isKnownSsid(const QString &ssid);
+ QString getNetworkNameFromSsid(const QString &ssid) const;
+ QString getSsidFromNetworkName(const QString &name) const;
+ bool isKnownSsid(const QString &ssid) const;
QMap<QString, QMap<QString,QString> > userProfiles;
signals:
@@ -135,7 +135,7 @@ protected:
private:
QList<QNetworkConfigurationPrivate *> fetchedConfigurations;
- QMutex mutex;
+ mutable QMutex mutex;
QStringList foundNetwork(const QString &id, const QString &ssid, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose);
};
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index c3dd49ff3e..66f2ed017b 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -62,12 +62,11 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
#include <ifaddrs.h>
@interface QT_MANGLE_NAMESPACE(QNSListener) : NSObject <CWEventDelegate>
-
@property (assign) QCoreWlanEngine* engine;
-
@end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSListener);
-@implementation QT_MANGLE_NAMESPACE(QNSListener) {
+@implementation QNSListener {
NSNotificationCenter *notificationCenter;
CWWiFiClient *client;
QCoreWlanEngine *engine;
@@ -88,7 +87,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
return self;
}
-static QT_MANGLE_NAMESPACE(QNSListener) *listener = 0;
+static QNSListener *listener = 0;
-(void)dealloc
{
@@ -203,9 +202,7 @@ void QScanThread::run()
}
}
// add known configurations that are not around.
- QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
- while (i.hasNext()) {
- i.next();
+ for (auto i = userProfiles.cbegin(), end = userProfiles.cend(); i != end; ++i) {
QString networkName = i.key();
const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkName));
@@ -215,11 +212,8 @@ void QScanThread::run()
const QString ssidId = QString::number(qHash(QLatin1String("corewlan:") + networkSsid));
QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
QString interfaceName;
- QMapIterator<QString, QString> ij(i.value());
- while (ij.hasNext()) {
- ij.next();
- interfaceName = ij.value();
- }
+ if (!i.value().isEmpty())
+ interfaceName = i.value().last();
if (currentInterfaceServiceActive) {
if (networkSsid == QString::fromNSString([currentInterface ssid])) {
@@ -269,11 +263,7 @@ QStringList QScanThread::foundNetwork(const QString &id, const QString &name, co
QList<QNetworkConfigurationPrivate *> QScanThread::getConfigurations()
{
QMutexLocker locker(&mutex);
-
- QList<QNetworkConfigurationPrivate *> foundConfigurations = fetchedConfigurations;
- fetchedConfigurations.clear();
-
- return foundConfigurations;
+ return qExchange(fetchedConfigurations, {});
}
void QScanThread::getUserConfigurations()
@@ -363,17 +353,12 @@ void QScanThread::getUserConfigurations()
}
}
-QString QScanThread::getSsidFromNetworkName(const QString &name)
+QString QScanThread::getSsidFromNetworkName(const QString &name) const
{
QMutexLocker locker(&mutex);
- QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
- while (i.hasNext()) {
- i.next();
- QMap<QString,QString> map = i.value();
- QMapIterator<QString, QString> ij(i.value());
- while (ij.hasNext()) {
- ij.next();
+ for (auto i = userProfiles.cbegin(), end = userProfiles.cend(); i != end; ++i) {
+ for (auto ij = i.value().cbegin(), end = i.value().cend(); ij != end; ++ij) {
const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") +i.key()));
if(name == i.key() || name == networkNameHash) {
return ij.key();
@@ -383,36 +368,24 @@ QString QScanThread::getSsidFromNetworkName(const QString &name)
return QString();
}
-QString QScanThread::getNetworkNameFromSsid(const QString &ssid)
+QString QScanThread::getNetworkNameFromSsid(const QString &ssid) const
{
QMutexLocker locker(&mutex);
- QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
- while (i.hasNext()) {
- i.next();
- QMap<QString,QString> map = i.value();
- QMapIterator<QString, QString> ij(i.value());
- while (ij.hasNext()) {
- ij.next();
- if(ij.key() == ssid) {
- return i.key();
- }
- }
+ for (auto i = userProfiles.cbegin(), end = userProfiles.cend(); i != end; ++i) {
+ if (i.value().contains(ssid))
+ return i.key();
}
return QString();
}
-bool QScanThread::isKnownSsid(const QString &ssid)
+bool QScanThread::isKnownSsid(const QString &ssid) const
{
QMutexLocker locker(&mutex);
- QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
- while (i.hasNext()) {
- i.next();
- QMap<QString,QString> map = i.value();
- if(map.keys().contains(ssid)) {
+ for (auto i = userProfiles.cbegin(), end = userProfiles.cend(); i != end; ++i) {
+ if (i.value().contains(ssid))
return true;
- }
}
return false;
}
@@ -430,8 +403,7 @@ QCoreWlanEngine::~QCoreWlanEngine()
{
scanThread->wait();
- while (!foundConfigurations.isEmpty())
- delete foundConfigurations.takeFirst();
+ qDeleteAll(qExchange(foundConfigurations, {}));
[listener remove];
[listener release];
}
@@ -442,7 +414,7 @@ void QCoreWlanEngine::initialize()
QMacAutoReleasePool pool;
if ([[CWWiFiClient interfaceNames] count] > 0 && !listener) {
- listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init];
+ listener = [QNSListener alloc] init];
listener.engine = this;
hasWifi = true;
} else {
@@ -486,9 +458,7 @@ void QCoreWlanEngine::connectToId(const QString &id)
const QString idHash2 = QString::number(qHash(QLatin1String("corewlan:") + scanThread->getNetworkNameFromSsid(ptr->name)));
QString wantedNetwork;
- QMapIterator<QString, QMap<QString, QString> > i(scanThread->userProfiles);
- while (i.hasNext()) {
- i.next();
+ for (auto i = scanThread->userProfiles.cbegin(), end = scanThread->userProfiles.cend(); i != end; ++i) {
wantedNetwork = i.key();
const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") + wantedNetwork));
if (id == networkNameHash) {
diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h
index 08960d66f6..79c71ca7a3 100644
--- a/src/plugins/bearer/generic/qgenericengine.h
+++ b/src/plugins/bearer/generic/qgenericengine.h
@@ -55,7 +55,7 @@ class QGenericEngine : public QBearerEngineImpl
Q_OBJECT
public:
- QGenericEngine(QObject *parent = 0);
+ QGenericEngine(QObject *parent = nullptr);
~QGenericEngine();
QString getInterfaceFromId(const QString &id) override;
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
index 5d72731bc4..05f9b3ca17 100644
--- a/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
+++ b/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
@@ -99,8 +99,7 @@ QOfonoManagerInterface::~QOfonoManagerInterface()
QStringList QOfonoManagerInterface::getModems()
{
if (modemList.isEmpty()) {
- QList<QVariant> argumentList;
- QDBusPendingReply<PathPropertiesList> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetModems"), argumentList);
+ QDBusPendingReply<PathPropertiesList> reply = call(QDBus::Block, QLatin1String("GetModems"));
reply.waitForFinished();
if (!reply.isError()) {
const auto modems = reply.value();
@@ -184,8 +183,7 @@ QStringList QOfonoModemInterface::interfaces()
QVariantMap QOfonoModemInterface::getProperties()
{
if (propertiesMap.isEmpty()) {
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> reply = call(QDBus::Block, QLatin1String("GetProperties"));
if (!reply.isError()) {
propertiesMap = reply.value();
}
@@ -233,8 +231,7 @@ QVariant QOfonoNetworkRegistrationInterface::getProperty(const QString &property
QVariantMap QOfonoNetworkRegistrationInterface::getProperties()
{
if (propertiesMap.isEmpty()) {
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> reply = call(QDBus::Block, QLatin1String("GetProperties"));
reply.waitForFinished();
if (!reply.isError()) {
propertiesMap = reply.value();
@@ -306,8 +303,7 @@ QVariant QOfonoDataConnectionManagerInterface::getProperty(const QString &proper
QVariantMap &QOfonoDataConnectionManagerInterface::getProperties()
{
if (propertiesMap.isEmpty()) {
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> reply = call(QDBus::Block, QLatin1String("GetProperties"));
if (!reply.isError()) {
propertiesMap = reply.value();
}
@@ -343,8 +339,7 @@ QOfonoConnectionContextInterface::~QOfonoConnectionContextInterface()
QVariantMap QOfonoConnectionContextInterface::getProperties()
{
if (propertiesMap.isEmpty()) {
- QList<QVariant> argumentList;
- QDBusPendingReply<QVariantMap> reply = callWithArgumentList(QDBus::Block, QLatin1String("GetProperties"), argumentList);
+ QDBusPendingReply<QVariantMap> reply = call(QDBus::Block, QLatin1String("GetProperties"));
if (!reply.isError()) {
propertiesMap = reply.value();
}
diff --git a/src/plugins/bearer/linux_common/qofonoservice_linux_p.h b/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
index 35614a20f2..62df5d4fa7 100644
--- a/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
+++ b/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
@@ -100,7 +100,7 @@ class QOfonoManagerInterface : public QDBusAbstractInterface
public:
- QOfonoManagerInterface( QObject *parent = 0);
+ QOfonoManagerInterface( QObject *parent = nullptr);
~QOfonoManagerInterface();
QStringList getModems();
@@ -120,7 +120,7 @@ class QOfonoModemInterface : public QDBusAbstractInterface
public:
- explicit QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0);
+ explicit QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = nullptr);
~QOfonoModemInterface();
bool isPowered();
@@ -140,7 +140,7 @@ class QOfonoNetworkRegistrationInterface : public QDBusAbstractInterface
public:
- explicit QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0);
+ explicit QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = nullptr);
~QOfonoNetworkRegistrationInterface();
QString getTechnology();
@@ -159,7 +159,7 @@ class QOfonoDataConnectionManagerInterface : public QDBusAbstractInterface
public:
- explicit QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0);
+ explicit QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = nullptr);
~QOfonoDataConnectionManagerInterface();
QStringList contexts();
@@ -184,7 +184,7 @@ class QOfonoConnectionContextInterface : public QDBusAbstractInterface
public:
- explicit QOfonoConnectionContextInterface(const QString &dbusPathName, QObject *parent = 0);
+ explicit QOfonoConnectionContextInterface(const QString &dbusPathName, QObject *parent = nullptr);
~QOfonoConnectionContextInterface();
QVariant getProperty(const QString &);
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
index bb43072aba..777b4eea59 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
@@ -45,6 +45,7 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qcoreapplication.h>
+#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qdebug.h>
@@ -612,7 +613,8 @@ bool QNativeWifiEngine::requiresPolling() const
{
// On Windows XP SP2 and SP3 only connection and disconnection notifications are available.
// We need to poll for changes in available wireless networks.
- return QSysInfo::WindowsVersion <= QSysInfo::WV_2003;
+ return QOperatingSystemVersion::current()
+ <= QOperatingSystemVersion(QOperatingSystemVersion::Windows, 5, 2);
}
QT_END_NAMESPACE
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
index 74fe24b5ab..a95c68abdf 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
@@ -69,7 +69,7 @@ class QNetworkManagerEngine : public QBearerEngineImpl
Q_OBJECT
public:
- QNetworkManagerEngine(QObject *parent = 0);
+ QNetworkManagerEngine(QObject *parent = nullptr);
~QNetworkManagerEngine();
bool networkManagerAvailable() const;
@@ -99,7 +99,7 @@ private Q_SLOTS:
void interfacePropertiesChanged(const QMap<QString, QVariant> &properties);
void activeConnectionPropertiesChanged(const QMap<QString, QVariant> &properties);
- void newConnection(const QDBusObjectPath &path, QNetworkManagerSettings *settings = 0);
+ void newConnection(const QDBusObjectPath &path, QNetworkManagerSettings *settings = nullptr);
void removeConnection(const QString &path);
void updateConnection();
void activationFinished(QDBusPendingCallWatcher *watcher);
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
index 3e77580015..35199eb7a2 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
@@ -72,11 +72,9 @@ QNetworkManagerInterface::QNetworkManagerInterface(QObject *parent)
QLatin1String(NM_DBUS_PATH),
DBUS_PROPERTIES_INTERFACE,
QDBusConnection::systemBus());
- QList<QVariant> argumentList;
- argumentList << QLatin1String(NM_DBUS_INTERFACE);
QDBusPendingReply<QVariantMap> propsReply
- = managerPropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
- argumentList);
+ = managerPropertiesInterface.call(QDBus::Block, QLatin1String("GetAll"), QLatin1String(NM_DBUS_INTERFACE));
+
if (!propsReply.isError()) {
propertyMap = propsReply.value();
} else {
@@ -344,11 +342,8 @@ QNetworkManagerInterfaceDevice::QNetworkManagerInterfaceDevice(const QString &de
DBUS_PROPERTIES_INTERFACE,
QDBusConnection::systemBus(),parent);
- QList<QVariant> argumentList;
- argumentList << QLatin1String(NM_DBUS_INTERFACE_DEVICE);
QDBusPendingReply<QVariantMap> propsReply
- = devicePropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
- argumentList);
+ = devicePropertiesInterface.call(QDBus::Block, QLatin1String("GetAll"), QLatin1String(NM_DBUS_INTERFACE_DEVICE));
if (!propsReply.isError()) {
propertyMap = propsReply.value();
@@ -446,11 +441,8 @@ QNetworkManagerInterfaceDeviceWired::QNetworkManagerInterfaceDeviceWired(const Q
DBUS_PROPERTIES_INTERFACE,
QDBusConnection::systemBus(),parent);
- QList<QVariant> argumentList;
- argumentList << QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRED);
QDBusPendingReply<QVariantMap> propsReply
- = deviceWiredPropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
- argumentList);
+ = deviceWiredPropertiesInterface.call(QDBus::Block, QLatin1String("GetAll"), QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRED));
if (!propsReply.isError()) {
propertyMap = propsReply.value();
@@ -543,11 +535,9 @@ QNetworkManagerInterfaceDeviceWireless::QNetworkManagerInterfaceDeviceWireless(c
DBUS_PROPERTIES_INTERFACE,
QDBusConnection::systemBus(),parent);
- QList<QVariant> argumentList;
- argumentList << QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRELESS);
QDBusPendingReply<QVariantMap> propsReply
- = deviceWirelessPropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
- argumentList);
+ = deviceWirelessPropertiesInterface.call(QDBus::Block, QLatin1String("GetAll"), QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRELESS));
+
if (!propsReply.isError()) {
propertyMap = propsReply.value();
}
@@ -647,11 +637,9 @@ QNetworkManagerInterfaceDeviceModem::QNetworkManagerInterfaceDeviceModem(const Q
QLatin1String("org.freedesktop.DBus.Properties"),
QDBusConnection::systemBus(),parent);
- QList<QVariant> argumentList;
- argumentList << QLatin1String(NM_DBUS_INTERFACE_DEVICE_MODEM);
QDBusPendingReply<QVariantMap> propsReply
- = deviceModemPropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
- argumentList);
+ = deviceModemPropertiesInterface.call(QDBus::Block, QLatin1String("GetAll"), QLatin1String(NM_DBUS_INTERFACE_DEVICE_MODEM));
+
if (!propsReply.isError()) {
propertyMap = propsReply.value();
}
@@ -746,9 +734,7 @@ QList <QDBusObjectPath> QNetworkManagerSettings::listConnections()
QString QNetworkManagerSettings::getConnectionByUuid(const QString &uuid)
{
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(uuid);
- QDBusReply<QDBusObjectPath > reply = callWithArgumentList(QDBus::Block,QLatin1String("GetConnectionByUuid"), argumentList);
+ QDBusReply<QDBusObjectPath > reply = call(QDBus::Block, QLatin1String("GetConnectionByUuid"), uuid);
return reply.value().path();
}
@@ -917,11 +903,8 @@ QNetworkManagerConnectionActive::QNetworkManagerConnectionActive(const QString &
QDBusConnection::systemBus());
- QList<QVariant> argumentList;
- argumentList << QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
QDBusPendingReply<QVariantMap> propsReply
- = connectionActivePropertiesInterface.callWithArgumentList(QDBus::Block,QLatin1String("GetAll"),
- argumentList);
+ = connectionActivePropertiesInterface.call(QDBus::Block, QLatin1String("GetAll"), QLatin1String(NM_DBUS_INTERFACE_ACTIVE_CONNECTION));
if (!propsReply.isError()) {
propertyMap = propsReply.value();
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h
index c879083faf..bff7a71097 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h
@@ -152,7 +152,7 @@ public:
NM_STATE_CONNECTED_GLOBAL = 70
} NMState;
- QNetworkManagerInterface(QObject *parent = 0);
+ QNetworkManagerInterface(QObject *parent = nullptr);
~QNetworkManagerInterface();
QList <QDBusObjectPath> getDevices();
@@ -228,7 +228,7 @@ public:
Q_DECLARE_FLAGS(ApSecurityFlags, ApSecurityFlag)
- explicit QNetworkManagerInterfaceAccessPoint(const QString &dbusPathName, QObject *parent = 0);
+ explicit QNetworkManagerInterfaceAccessPoint(const QString &dbusPathName, QObject *parent = nullptr);
~QNetworkManagerInterfaceAccessPoint();
quint32 flags() const;
@@ -259,7 +259,7 @@ class QNetworkManagerInterfaceDevice : public QDBusAbstractInterface
public:
- explicit QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent = 0);
+ explicit QNetworkManagerInterfaceDevice(const QString &deviceObjectPath, QObject *parent = nullptr);
~QNetworkManagerInterfaceDevice();
QString udi() const;
@@ -288,7 +288,7 @@ class QNetworkManagerInterfaceDeviceWired : public QDBusAbstractInterface
public:
explicit QNetworkManagerInterfaceDeviceWired(const QString &ifaceDevicePath,
- QObject *parent = 0);
+ QObject *parent = nullptr);
~QNetworkManagerInterfaceDeviceWired();
QString hwAddress() const;
@@ -325,7 +325,7 @@ public:
};
explicit QNetworkManagerInterfaceDeviceWireless(const QString &ifaceDevicePath,
- QObject *parent = 0);
+ QObject *parent = nullptr);
~QNetworkManagerInterfaceDeviceWireless();
QList <QDBusObjectPath> getAccessPoints();
@@ -367,7 +367,7 @@ public:
Q_DECLARE_FLAGS(ModemCapabilities, ModemCapability)
explicit QNetworkManagerInterfaceDeviceModem(const QString &ifaceDevicePath,
- QObject *parent = 0);
+ QObject *parent = nullptr);
~QNetworkManagerInterfaceDeviceModem();
ModemCapabilities modemCapabilities() const;
@@ -392,7 +392,7 @@ class QNetworkManagerSettings : public QDBusAbstractInterface
public:
- explicit QNetworkManagerSettings(const QString &settingsService, QObject *parent = 0);
+ explicit QNetworkManagerSettings(const QString &settingsService, QObject *parent = nullptr);
~QNetworkManagerSettings();
QList <QDBusObjectPath> listConnections();
@@ -413,7 +413,7 @@ class QNetworkManagerSettingsConnection : public QDBusAbstractInterface
public:
- QNetworkManagerSettingsConnection(const QString &settingsService, const QString &connectionObjectPath, QObject *parent = 0);
+ QNetworkManagerSettingsConnection(const QString &settingsService, const QString &connectionObjectPath, QObject *parent = nullptr);
~QNetworkManagerSettingsConnection();
QNmSettingsMap getSettings();
@@ -451,7 +451,7 @@ public:
Activated = 2
};
- explicit QNetworkManagerConnectionActive(const QString &dbusPathName, QObject *parent = 0);
+ explicit QNetworkManagerConnectionActive(const QString &dbusPathName, QObject *parent = nullptr);
~ QNetworkManagerConnectionActive();
QDBusObjectPath connection() const;
@@ -478,7 +478,7 @@ class QNetworkManagerIp4Config : public QDBusAbstractInterface
Q_OBJECT
public:
- explicit QNetworkManagerIp4Config(const QString &dbusPathName, QObject *parent = 0);
+ explicit QNetworkManagerIp4Config(const QString &dbusPathName, QObject *parent = nullptr);
~QNetworkManagerIp4Config();
QStringList domains() const;
@@ -489,7 +489,7 @@ class PropertiesDBusInterface : public QDBusAbstractInterface
public:
PropertiesDBusInterface(const QString &service, const QString &path,
const QString &interface, const QDBusConnection &connection,
- QObject *parent = 0)
+ QObject *parent = nullptr)
: QDBusAbstractInterface(service, path, interface.toLatin1().data(), connection, parent)
{}
};
diff --git a/src/plugins/bearer/nla/nla.pro b/src/plugins/bearer/nla/nla.pro
index 113d0667d2..76f3279d25 100644
--- a/src/plugins/bearer/nla/nla.pro
+++ b/src/plugins/bearer/nla/nla.pro
@@ -2,7 +2,7 @@ TARGET = qnlabearer
QT = core core-private network network-private
-LIBS += -lws2_32
+QMAKE_USE_PRIVATE += ws2_32
HEADERS += qnlaengine.h \
../platformdefs_win.h \
diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp
index 726e1efb92..e1e60389f1 100644
--- a/src/plugins/bearer/nla/qnlaengine.cpp
+++ b/src/plugins/bearer/nla/qnlaengine.cpp
@@ -75,38 +75,38 @@ QWindowsSockInit2::~QWindowsSockInit2()
#ifdef BEARER_MANAGEMENT_DEBUG
static void printBlob(NLA_BLOB *blob)
{
- qDebug() << "==== BEGIN NLA_BLOB ====" << endl
+ qDebug() << "==== BEGIN NLA_BLOB ====" << Qt::endl
- << "type:" << blob->header.type << endl
- << "size:" << blob->header.dwSize << endl
+ << "type:" << blob->header.type << Qt::endl
+ << "size:" << blob->header.dwSize << Qt::endl
<< "next offset:" << blob->header.nextOffset;
switch (blob->header.type) {
case NLA_RAW_DATA:
- qDebug() << "Raw Data" << endl
+ qDebug() << "Raw Data" << Qt::endl
<< '\t' << blob->data.rawData;
break;
case NLA_INTERFACE:
- qDebug() << "Interface" << endl
- << "\ttype:" << blob->data.interfaceData.dwType << endl
- << "\tspeed:" << blob->data.interfaceData.dwSpeed << endl
+ qDebug() << "Interface" << Qt::endl
+ << "\ttype:" << blob->data.interfaceData.dwType << Qt::endl
+ << "\tspeed:" << blob->data.interfaceData.dwSpeed << Qt::endl
<< "\tadapter:" << blob->data.interfaceData.adapterName;
break;
case NLA_802_1X_LOCATION:
- qDebug() << "802.1x Location" << endl
+ qDebug() << "802.1x Location" << Qt::endl
<< '\t' << blob->data.locationData.information;
break;
case NLA_CONNECTIVITY:
- qDebug() << "Connectivity" << endl
- << "\ttype:" << blob->data.connectivity.type << endl
+ qDebug() << "Connectivity" << Qt::endl
+ << "\ttype:" << blob->data.connectivity.type << Qt::endl
<< "\tinternet:" << blob->data.connectivity.internet;
break;
case NLA_ICS:
- qDebug() << "ICS" << endl
- << "\tspeed:" << blob->data.ICS.remote.speed << endl
- << "\ttype:" << blob->data.ICS.remote.type << endl
- << "\tstate:" << blob->data.ICS.remote.state << endl
- << "\tmachine name:" << blob->data.ICS.remote.machineName << endl
+ qDebug() << "ICS" << Qt::endl
+ << "\tspeed:" << blob->data.ICS.remote.speed << Qt::endl
+ << "\ttype:" << blob->data.ICS.remote.type << Qt::endl
+ << "\tstate:" << blob->data.ICS.remote.state << Qt::endl
+ << "\tmachine name:" << blob->data.ICS.remote.machineName << Qt::endl
<< "\tshared adapter name:" << blob->data.ICS.remote.sharedAdapterName;
break;
default:
@@ -119,9 +119,6 @@ static void printBlob(NLA_BLOB *blob)
static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interface)
{
-#ifdef Q_OS_WINCE
- Q_UNUSED(interface)
-#else
unsigned long oid;
DWORD bytesWritten;
@@ -177,8 +174,6 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
qDebug() << medium << physicalMedium;
#endif
-#endif
-
return QNetworkConfiguration::BearerUnknown;
}
@@ -307,16 +302,12 @@ void QNlaThread::run()
break;
}
-#ifndef Q_OS_WINCE
// Not interested in unrelated IO completion events
// although we also don't want to block them
while (WaitForSingleObjectEx(changeEvent, WSA_INFINITE, true) != WAIT_IO_COMPLETION &&
handle)
{
}
-#else
- WaitForSingleObject(changeEvent, WSA_INFINITE);
-#endif
mutex.lock();
if (handle) {
diff --git a/src/plugins/bearer/qbearerengine_impl.h b/src/plugins/bearer/qbearerengine_impl.h
index 3f8a4d821d..5c003aaaf6 100644
--- a/src/plugins/bearer/qbearerengine_impl.h
+++ b/src/plugins/bearer/qbearerengine_impl.h
@@ -56,7 +56,7 @@ public:
DisconnectionError,
};
- QBearerEngineImpl(QObject *parent = 0) : QBearerEngine(parent) {}
+ QBearerEngineImpl(QObject *parent = nullptr) : QBearerEngine(parent) {}
~QBearerEngineImpl() {}
virtual void connectToId(const QString &id) = 0;
diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h
index d9aa6ca8fb..0f8e014900 100644
--- a/src/plugins/bearer/qnetworksession_impl.h
+++ b/src/plugins/bearer/qnetworksession_impl.h
@@ -66,7 +66,7 @@ class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate
public:
QNetworkSessionPrivateImpl()
- : engine(0), startTime(0), lastError(QNetworkSession::UnknownSessionError), sessionTimeout(-1), currentPolicies(QNetworkSession::NoPolicy), opened(false)
+ : engine(nullptr), startTime(0), lastError(QNetworkSession::UnknownSessionError), sessionTimeout(-1), currentPolicies(QNetworkSession::NoPolicy), opened(false)
{}
~QNetworkSessionPrivateImpl()
{}
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index aed2900356..1f1675e490 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -40,10 +40,14 @@
#include "qjpeghandler_p.h"
#include <qimage.h>
+#include <qcolorspace.h>
+#include <qcolortransform.h>
+#include <qdebug.h>
#include <qvariant.h>
#include <qvector.h>
#include <qbuffer.h>
#include <qmath.h>
+#include <private/qicc_p.h>
#include <private/qsimd_p.h>
#include <private/qimage_p.h> // for qt_getImageText
@@ -488,6 +492,8 @@ inline my_jpeg_destination_mgr::my_jpeg_destination_mgr(QIODevice *device)
free_in_buffer = max_buf;
}
+static constexpr int maxMarkerSize = 65533;
+
static inline void set_text(const QImage &image, j_compress_ptr cinfo, const QString &description)
{
const QMap<QString, QString> text = qt_getImageText(image, description);
@@ -496,12 +502,33 @@ static inline void set_text(const QImage &image, j_compress_ptr cinfo, const QSt
if (!comment.isEmpty())
comment += ": ";
comment += it.value().toUtf8();
- if (comment.length() > 65530)
- comment.truncate(65530);
+ if (comment.length() > maxMarkerSize)
+ comment.truncate(maxMarkerSize);
jpeg_write_marker(cinfo, JPEG_COM, (const JOCTET *)comment.constData(), comment.size());
}
}
+static inline void write_icc_profile(const QImage &image, j_compress_ptr cinfo)
+{
+ const QByteArray iccProfile = image.colorSpace().iccProfile();
+ if (iccProfile.isEmpty())
+ return;
+
+ const QByteArray iccSignature("ICC_PROFILE", 12);
+ constexpr int maxIccMarkerSize = maxMarkerSize - (12 + 2);
+ int index = 0;
+ const int markers = (iccProfile.size() + (maxIccMarkerSize - 1)) / maxIccMarkerSize;
+ Q_ASSERT(markers < 256);
+ for (int marker = 1; marker <= markers; ++marker) {
+ const int len = std::min(iccProfile.size() - index, maxIccMarkerSize);
+ const QByteArray block = iccSignature
+ + QByteArray(1, char(marker)) + QByteArray(1, char(markers))
+ + iccProfile.mid(index, len);
+ jpeg_write_marker(cinfo, JPEG_APP0 + 2, reinterpret_cast<const JOCTET *>(block.constData()), block.size());
+ index += len;
+ }
+}
+
static bool write_jpeg_image(const QImage &image, QIODevice *device, volatile int sourceQuality, const QString &description, bool optimize, bool progressive)
{
bool success = false;
@@ -582,6 +609,8 @@ static bool write_jpeg_image(const QImage &image, QIODevice *device, volatile in
jpeg_start_compress(&cinfo, TRUE);
set_text(image, &cinfo, description);
+ if (cinfo.in_color_space == JCS_RGB)
+ write_icc_profile(image, &cinfo);
row_pointer[0] = new uchar[cinfo.image_width*cinfo.input_components];
int w = cinfo.image_width;
@@ -725,6 +754,7 @@ public:
QRect clipRect;
QString description;
QStringList readTexts;
+ QByteArray iccProfile;
struct jpeg_decompress_struct info;
struct my_jpeg_source_mgr * iod_src;
@@ -887,6 +917,7 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
if (!setjmp(err.setjmp_buffer)) {
jpeg_save_markers(&info, JPEG_COM, 0xFFFF);
jpeg_save_markers(&info, JPEG_APP0 + 1, 0xFFFF); // Exif uses APP1 marker
+ jpeg_save_markers(&info, JPEG_APP0 + 2, 0xFFFF); // ICC uses APP2 marker
(void) jpeg_read_header(&info, TRUE);
@@ -919,6 +950,10 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device)
readTexts.append(value);
} else if (marker->marker == JPEG_APP0 + 1) {
exifData.append((const char*)marker->data, marker->data_length);
+ } else if (marker->marker == JPEG_APP0 + 2) {
+ if (marker->data_length > 128 + 4 + 14 && strcmp((const char *)marker->data, "ICC_PROFILE") == 0) {
+ iccProfile.append((const char*)marker->data + 14, marker->data_length - 14);
+ }
}
}
@@ -954,6 +989,9 @@ bool QJpegHandlerPrivate::read(QImage *image)
for (int i = 0; i < readTexts.size()-1; i+=2)
image->setText(readTexts.at(i), readTexts.at(i+1));
+ if (!iccProfile.isEmpty())
+ image->setColorSpace(QColorSpace::fromIccProfile(iccProfile));
+
state = ReadingEnd;
return true;
}
@@ -962,7 +1000,6 @@ bool QJpegHandlerPrivate::read(QImage *image)
}
return false;
-
}
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32_neon(quint32 *dst, const uchar *src, int len);
diff --git a/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h b/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
index 47a40ab8c2..396a213aaa 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
@@ -31,7 +31,7 @@ public:
{ return "org.freedesktop.IBus.InputContext"; }
public:
- QIBusInputContextProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
+ QIBusInputContextProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
~QIBusInputContextProxy();
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index d4daea2eb3..8e7b8df120 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -59,9 +59,9 @@ class QIBusFilterEventWatcher: public QDBusPendingCallWatcher
{
public:
explicit QIBusFilterEventWatcher(const QDBusPendingCall &call,
- QObject *parent = 0,
- QWindow *window = 0,
- const Qt::KeyboardModifiers modifiers = 0,
+ QObject *parent = nullptr,
+ QWindow *window = nullptr,
+ const Qt::KeyboardModifiers modifiers = nullptr,
const QVariantList arguments = QVariantList())
: QDBusPendingCallWatcher(call, parent)
, m_window(window)
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxy.h b/src/plugins/platforminputcontexts/ibus/qibusproxy.h
index 839e972c34..c9876deebf 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxy.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxy.h
@@ -35,7 +35,7 @@ public:
{ return QStringLiteral("org.freedesktop.DBus.Properties"); }
public:
- QIBusProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
+ QIBusProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
~QIBusProxy();
diff --git a/src/plugins/platforms/android/android.pro b/src/plugins/platforms/android/android.pro
index 78632a9bea..730247cd7f 100644
--- a/src/plugins/platforms/android/android.pro
+++ b/src/plugins/platforms/android/android.pro
@@ -1,9 +1,5 @@
TARGET = qtforandroid
-# STATICPLUGIN needed because there's a Q_IMPORT_PLUGIN in androidjnimain.cpp
-# Yes, the plugin imports itself statically
-DEFINES += QT_STATICPLUGIN
-
LIBS += -ljnigraphics -landroid
QT += \
@@ -19,7 +15,8 @@ INCLUDEPATH += \
$$PWD \
$$QT_SOURCE_TREE/src/3rdparty/android
-SOURCES += $$PWD/androidplatformplugin.cpp \
+SOURCES += $$PWD/main.cpp \
+ $$PWD/androidplatformplugin.cpp \
$$PWD/androidcontentfileengine.cpp \
$$PWD/androiddeadlockprotector.cpp \
$$PWD/androidjnimain.cpp \
@@ -92,8 +89,5 @@ qtConfig(vulkan) {
}
PLUGIN_TYPE = platforms
+PLUGIN_CLASS_NAME = QAndroidIntegrationPlugin
load(qt_plugin)
-
-#Non-standard install directory, QTBUG-29859
-DESTDIR = $$DESTDIR/android
-target.path = $${target.path}/android
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 6ae429b24e..fd2644717e 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -60,6 +60,7 @@
#include "qandroideventdispatcher.h"
#include <android/api-level.h>
+#include <QtCore/qresource.h>
#include <QtCore/qthread.h>
#include <QtCore/private/qjnihelpers_p.h>
#include <QtCore/private/qjni_p.h>
@@ -68,8 +69,6 @@
#include <qpa/qwindowsysteminterface.h>
-Q_IMPORT_PLUGIN(QAndroidPlatformIntegrationPlugin)
-
QT_BEGIN_NAMESPACE
static JavaVM *m_javaVM = nullptr;
@@ -77,6 +76,7 @@ static jclass m_applicationClass = nullptr;
static jobject m_classLoaderObject = nullptr;
static jmethodID m_loadClassMethodID = nullptr;
static AAssetManager *m_assetManager = nullptr;
+static jobject m_assets = nullptr;
static jobject m_resourcesObj = nullptr;
static jobject m_activityObject = nullptr;
static jmethodID m_createSurfaceMethodID = nullptr;
@@ -441,6 +441,11 @@ namespace QtAndroid
return block;
}
+ jobject assets()
+ {
+ return m_assets;
+ }
+
} // namespace QtAndroid
static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring paramsString, jstring environmentString)
@@ -454,9 +459,9 @@ static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring pa
const QList<QByteArray> envVars = QByteArray(nativeString).split('\t');
env->ReleaseStringUTFChars(environmentString, nativeString);
for (const QByteArray &envVar : envVars) {
- const QList<QByteArray> envVarPair = envVar.split('=');
- if (envVarPair.size() == 2 && ::setenv(envVarPair[0], envVarPair[1], 1) != 0)
- qWarning() << "Can't set environment" << envVarPair;
+ int pos = envVar.indexOf('=');
+ if (pos != -1 && ::setenv(envVar.left(pos), envVar.mid(pos + 1), 1) != 0)
+ qWarning() << "Can't set environment" << envVar;
}
}
@@ -485,7 +490,7 @@ static jboolean startQtAndroidPlugin(JNIEnv *env, jobject /*object*/, jstring pa
}
if (Q_UNLIKELY(!m_main)) {
- qCritical() << "dlsym failed:" << dlerror() << endl
+ qCritical() << "dlsym failed:" << dlerror() << Qt::endl
<< "Could not find main method";
return false;
}
@@ -521,6 +526,10 @@ static jboolean startQtApplication(JNIEnv */*env*/, jclass /*clazz*/)
vm->AttachCurrentThread(&env, &args);
}
+ // Register resources if they are available
+ if (QFile{QStringLiteral("assets:/android_rcc_bundle.rcc")}.exists())
+ QResource::registerResource(QStringLiteral("assets:/android_rcc_bundle.rcc"));
+
QVarLengthArray<const char *> params(m_applicationParams.size());
for (int i = 0; i < m_applicationParams.size(); i++)
params[i] = static_cast<const char *>(m_applicationParams[i].constData());
@@ -590,6 +599,8 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
env->DeleteGlobalRef(m_RGB_565_BitmapConfigValue);
if (m_bitmapDrawableClass)
env->DeleteGlobalRef(m_bitmapDrawableClass);
+ if (m_assets)
+ env->DeleteGlobalRef(m_assets);
m_androidPlatformIntegration = nullptr;
delete m_androidAssetsFileEngineHandler;
m_androidAssetsFileEngineHandler = nullptr;
@@ -842,7 +853,8 @@ static int registerNatives(JNIEnv *env)
if (object) {
FIND_AND_CHECK_CLASS("android/content/ContextWrapper");
GET_AND_CHECK_METHOD(methodID, clazz, "getAssets", "()Landroid/content/res/AssetManager;");
- m_assetManager = AAssetManager_fromJava(env, env->CallObjectMethod(object, methodID));
+ m_assets = env->NewGlobalRef(env->CallObjectMethod(object, methodID));
+ m_assetManager = AAssetManager_fromJava(env, m_assets);
GET_AND_CHECK_METHOD(methodID, clazz, "getResources", "()Landroid/content/res/Resources;");
m_resourcesObj = env->NewGlobalRef(env->CallObjectMethod(object, methodID));
diff --git a/src/plugins/platforms/android/androidjnimain.h b/src/plugins/platforms/android/androidjnimain.h
index 08f1d50fe3..17ae30a1be 100644
--- a/src/plugins/platforms/android/androidjnimain.h
+++ b/src/plugins/platforms/android/androidjnimain.h
@@ -82,6 +82,7 @@ namespace QtAndroid
double scaledDensity();
double pixelDensity();
JavaVM *javaVM();
+ jobject assets();
AAssetManager *assetManager();
jclass applicationClass();
jobject activity();
diff --git a/src/plugins/platforms/android/androidjnimenu.cpp b/src/plugins/platforms/android/androidjnimenu.cpp
index e9359def0f..de2fdaa0e2 100644
--- a/src/plugins/platforms/android/androidjnimenu.cpp
+++ b/src/plugins/platforms/android/androidjnimenu.cpp
@@ -60,12 +60,12 @@ namespace QtAndroidMenu
{
static QList<QAndroidPlatformMenu *> pendingContextMenus;
static QAndroidPlatformMenu *visibleMenu = 0;
- static QMutex visibleMenuMutex(QMutex::Recursive);
+ static QRecursiveMutex visibleMenuMutex;
static QSet<QAndroidPlatformMenuBar *> menuBars;
static QAndroidPlatformMenuBar *visibleMenuBar = 0;
static QWindow *activeTopLevelWindow = 0;
- static QMutex menuBarMutex(QMutex::Recursive);
+ static QRecursiveMutex menuBarMutex;
static jmethodID openContextMenuMethodID = 0;
diff --git a/src/plugins/platforms/mirclient/qmirclientplugin.h b/src/plugins/platforms/android/main.cpp
index 207d97b5af..c304fc8d69 100644
--- a/src/plugins/platforms/mirclient/qmirclientplugin.h
+++ b/src/plugins/platforms/android/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2019 BogDan Vatra <bogdan@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -38,19 +38,26 @@
****************************************************************************/
-#ifndef QMIRCLIENTPLUGIN_H
-#define QMIRCLIENTPLUGIN_H
-
#include <qpa/qplatformintegrationplugin.h>
+#include "qandroidplatformintegration.h"
+
+QT_BEGIN_NAMESPACE
-class QMirClientIntegrationPlugin : public QPlatformIntegrationPlugin
+class QAndroidIntegrationPlugin : public QPlatformIntegrationPlugin
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "mirclient.json")
+ Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "android.json")
public:
- QPlatformIntegration *create(const QString &system, const QStringList &paramList,
- int &argc, char **argv) override;
+ QPlatformIntegration *create(const QString& system, const QStringList& paramList) override;
};
-#endif // QMIRCLIENTPLUGIN_H
+QPlatformIntegration *QAndroidIntegrationPlugin::create(const QString& system, const QStringList& paramList)
+{
+ if (!system.compare(QLatin1String("android"), Qt::CaseInsensitive))
+ return new QAndroidPlatformIntegration(paramList);
+
+ return nullptr;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
index e1dcebfa4c..26e72a480f 100644
--- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
+++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp
@@ -39,40 +39,139 @@
#include "qandroidassetsfileenginehandler.h"
#include "androidjnimain.h"
+#include <optional>
#include <QCoreApplication>
#include <QVector>
+#include <QtCore/private/qjni_p.h>
QT_BEGIN_NAMESPACE
-typedef QVector<QString> FilesList;
+static const QLatin1String assetsPrefix("assets:");
+const static int prefixSize = 7;
-struct AndroidAssetDir
+static inline QString cleanedAssetPath(QString file)
{
- AndroidAssetDir(AAssetDir* ad)
+ if (file.startsWith(assetsPrefix))
+ file.remove(0, prefixSize);
+ file.replace(QLatin1String("//"), QLatin1String("/"));
+ if (file.startsWith(QLatin1Char('/')))
+ file.remove(0, 1);
+ if (file.endsWith(QLatin1Char('/')))
+ file.chop(1);
+ return file;
+}
+
+static inline QString prefixedPath(QString path)
+{
+ path = assetsPrefix + QLatin1Char('/') + path;
+ path.replace(QLatin1String("//"), QLatin1String("/"));
+ return path;
+}
+
+struct AssetItem {
+ enum class Type {
+ File,
+ Folder
+ };
+
+ AssetItem (const QString &rawName)
+ : name(rawName)
+ {
+ if (name.endsWith(QLatin1Char('/'))) {
+ type = Type::Folder;
+ name.chop(1);
+ }
+ }
+ Type type = Type::File;
+ QString name;
+};
+
+using AssetItemList = QVector<AssetItem>;
+
+class FolderIterator : public AssetItemList
+{
+public:
+ static QSharedPointer<FolderIterator> fromCache(const QString &path)
{
- if (ad) {
- const char *fileName;
- while ((fileName = AAssetDir_getNextFileName(ad)))
- m_items.push_back(QString::fromUtf8(fileName));
- AAssetDir_close(ad);
+ QMutexLocker lock(&m_assetsCacheMutex);
+ QSharedPointer<FolderIterator> *folder = m_assetsCache.object(path);
+ if (!folder) {
+ folder = new QSharedPointer<FolderIterator>{new FolderIterator{path}};
+ if (!m_assetsCache.insert(path, folder)) {
+ QSharedPointer<FolderIterator> res = *folder;
+ delete folder;
+ return res;
+ }
}
+ return *folder;
+ }
+
+ FolderIterator(const QString &path)
+ : m_path(path)
+ {
+ QJNIObjectPrivate files = QJNIObjectPrivate::callStaticObjectMethod(QtAndroid::applicationClass(),
+ "listAssetContent",
+ "(Landroid/content/res/AssetManager;Ljava/lang/String;)[Ljava/lang/String;",
+ QtAndroid::assets(), QJNIObjectPrivate::fromString(path).object());
+ if (files.isValid()) {
+ QJNIEnvironmentPrivate env;
+ jobjectArray jFiles = static_cast<jobjectArray>(files.object());
+ const jint nFiles = env->GetArrayLength(jFiles);
+ for (int i = 0; i < nFiles; ++i)
+ push_back({QJNIObjectPrivate(env->GetObjectArrayElement(jFiles, i)).toString()});
+ }
+ m_path = assetsPrefix + QLatin1Char('/') + m_path + QLatin1Char('/');
+ m_path.replace(QLatin1String("//"), QLatin1String("/"));
+ }
+
+ QString currentFileName() const
+ {
+ if (m_index < 0 || m_index >= size())
+ return {};
+ return at(m_index).name;
+ }
+ QString currentFilePath() const
+ {
+ if (m_index < 0 || m_index >= size())
+ return {};
+ return m_path + at(m_index).name;
+ }
+
+ bool hasNext() const
+ {
+ return !empty() && m_index + 1 < size();
+ }
+
+ std::optional<std::pair<QString, AssetItem>> next()
+ {
+ if (!hasNext())
+ return {};
+ ++m_index;
+ return std::pair<QString, AssetItem>(currentFileName(), at(m_index));
}
- FilesList m_items;
+
+private:
+ int m_index = -1;
+ QString m_path;
+ static QCache<QString, QSharedPointer<FolderIterator>> m_assetsCache;
+ static QMutex m_assetsCacheMutex;
};
+QCache<QString, QSharedPointer<FolderIterator>> FolderIterator::m_assetsCache(std::max(50, qEnvironmentVariableIntValue("QT_ANDROID_MAX_ASSETS_CACHE_SIZE")));
+QMutex FolderIterator::m_assetsCacheMutex;
+
class AndroidAbstractFileEngineIterator: public QAbstractFileEngineIterator
{
public:
AndroidAbstractFileEngineIterator(QDir::Filters filters,
const QStringList &nameFilters,
- QSharedPointer<AndroidAssetDir> asset,
const QString &path)
: QAbstractFileEngineIterator(filters, nameFilters)
{
- m_items = asset->m_items;
- m_index = -1;
- m_path = path;
+ m_stack.push_back(FolderIterator::fromCache(cleanedAssetPath(path)));
+ if (m_stack.last()->empty())
+ m_stack.pop_back();
}
QFileInfo currentFileInfo() const override
@@ -82,54 +181,59 @@ public:
QString currentFileName() const override
{
- if (m_index < 0 || m_index >= m_items.size())
- return QString();
- QString fileName = m_items[m_index];
- if (fileName.endsWith(QLatin1Char('/')))
- fileName.chop(1);
- return fileName;
+ if (!m_currentIterator)
+ return {};
+ return m_currentIterator->currentFileName();
}
virtual QString currentFilePath() const
{
- return m_path + currentFileName();
+ if (!m_currentIterator)
+ return {};
+ return m_currentIterator->currentFilePath();
}
bool hasNext() const override
{
- return m_items.size() && (m_index < m_items.size() - 1);
+ if (m_stack.empty())
+ return false;
+ if (!m_stack.last()->hasNext()) {
+ m_stack.pop_back();
+ return hasNext();
+ }
+ return true;
}
QString next() override
{
- if (!hasNext())
- return QString();
- m_index++;
- return currentFileName();
+ if (m_stack.empty()) {
+ m_currentIterator.reset();
+ return {};
+ }
+ m_currentIterator = m_stack.last();
+ auto res = m_currentIterator->next();
+ if (!res)
+ return {};
+ if (res->second.type == AssetItem::Type::Folder) {
+ m_stack.push_back(FolderIterator::fromCache(cleanedAssetPath(currentFilePath())));
+ if (m_stack.last()->empty())
+ m_stack.pop_back();
+ }
+ return res->first;
}
private:
- QString m_path;
- FilesList m_items;
- int m_index;
+ mutable QSharedPointer<FolderIterator> m_currentIterator;
+ mutable QVector<QSharedPointer<FolderIterator>> m_stack;
};
class AndroidAbstractFileEngine: public QAbstractFileEngine
{
public:
- explicit AndroidAbstractFileEngine(AAsset *asset, const QString &fileName)
- {
- m_assetFile = asset;
- m_fileName = fileName;
- }
-
- explicit AndroidAbstractFileEngine(QSharedPointer<AndroidAssetDir> asset, const QString &fileName)
+ explicit AndroidAbstractFileEngine(AAssetManager *assetManager, const QString &fileName)
+ : m_assetManager(assetManager)
{
- m_assetFile = 0;
- m_assetDir = asset;
- m_fileName = fileName;
- if (!m_fileName.endsWith(QLatin1Char('/')))
- m_fileName += QLatin1Char('/');
+ setFileName(fileName);
}
~AndroidAbstractFileEngine()
@@ -139,7 +243,11 @@ public:
bool open(QIODevice::OpenMode openMode) override
{
- return m_assetFile != 0 && (openMode & QIODevice::WriteOnly) == 0;
+ if (m_isFolder || (openMode & QIODevice::WriteOnly))
+ return false;
+ close();
+ m_assetFile = AAssetManager_open(m_assetManager, m_fileName.toUtf8(), AASSET_MODE_BUFFER);
+ return m_assetFile;
}
bool close() override
@@ -200,7 +308,7 @@ public:
FileFlags flags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag);
if (m_assetFile)
flags |= FileType;
- if (!m_assetDir.isNull())
+ else if (m_isFolder)
flags |= DirectoryType;
return type & flags;
@@ -213,19 +321,19 @@ public:
case DefaultName:
case AbsoluteName:
case CanonicalName:
- return m_fileName;
+ return prefixedPath(m_fileName);
case BaseName:
if ((pos = m_fileName.lastIndexOf(QChar(QLatin1Char('/')))) != -1)
- return m_fileName.mid(pos);
+ return prefixedPath(m_fileName.mid(pos));
else
- return m_fileName;
+ return prefixedPath(m_fileName);
case PathName:
case AbsolutePathName:
case CanonicalPathName:
if ((pos = m_fileName.lastIndexOf(QChar(QLatin1Char('/')))) != -1)
- return m_fileName.left(pos);
+ return prefixedPath(m_fileName.left(pos));
else
- return m_fileName;
+ return prefixedPath(m_fileName);
default:
return QString();
}
@@ -233,164 +341,46 @@ public:
void setFileName(const QString &file) override
{
- if (file == m_fileName)
- return;
-
- m_fileName = file;
- if (!m_fileName.endsWith(QLatin1Char('/')))
- m_fileName += QLatin1Char('/');
-
close();
+ m_fileName = cleanedAssetPath(file);
+ m_isFolder = !open(QIODevice::ReadOnly) && !FolderIterator::fromCache(m_fileName)->empty();
}
Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override
{
- if (!m_assetDir.isNull())
- return new AndroidAbstractFileEngineIterator(filters, filterNames, m_assetDir, m_fileName);
- return 0;
+ if (m_isFolder)
+ return new AndroidAbstractFileEngineIterator(filters, filterNames, m_fileName);
+ return nullptr;
}
private:
- AAsset *m_assetFile;
- QSharedPointer<AndroidAssetDir> m_assetDir;
+ AAsset *m_assetFile = nullptr;
+ AAssetManager *m_assetManager;
QString m_fileName;
+ bool m_isFolder;
};
AndroidAssetsFileEngineHandler::AndroidAssetsFileEngineHandler()
- : m_assetsCache(std::max(5, qEnvironmentVariableIntValue("QT_ANDROID_MAX_ASSETS_CACHE_SIZE")))
- , m_hasPrepopulatedCache(false)
- , m_hasTriedPrepopulatingCache(false)
{
m_assetManager = QtAndroid::assetManager();
}
-AndroidAssetsFileEngineHandler::~AndroidAssetsFileEngineHandler()
-{
-}
-
-void AndroidAssetsFileEngineHandler::prepopulateCache() const
-{
- Q_ASSERT(!m_hasTriedPrepopulatingCache);
- m_hasTriedPrepopulatingCache = true;
-
- Q_ASSERT(m_assetsCache.isEmpty());
-
- // Failsafe: Don't read cache files that are larger than 1MB
- static qint64 maxPrepopulatedCacheSize = qMax(1024LL * 1024LL,
- qgetenv("QT_ANDROID_MAX_PREPOPULATED_ASSETS_CACHE_SIZE").toLongLong());
-
- const char *fileName = "--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list";
- AAsset *asset = AAssetManager_open(m_assetManager, fileName, AASSET_MODE_BUFFER);
- if (asset) {
- m_hasPrepopulatedCache = true;
- AndroidAbstractFileEngine fileEngine(asset, QString::fromLatin1(fileName));
- if (fileEngine.open(QIODevice::ReadOnly)) {
- qint64 size = fileEngine.size();
-
- if (size <= maxPrepopulatedCacheSize) {
- QByteArray bytes(size, Qt::Uninitialized);
- qint64 read = fileEngine.read(bytes.data(), size);
- if (read != size) {
- qWarning("Failed to read prepopulated cache");
- return;
- }
-
- QDataStream stream(&bytes, QIODevice::ReadOnly);
- stream.setVersion(QDataStream::Qt_5_3);
- if (stream.status() != QDataStream::Ok) {
- qWarning("Failed to read prepopulated cache");
- return;
- }
-
- while (!stream.atEnd()) {
- QString directoryName;
- stream >> directoryName;
-
- int fileCount;
- stream >> fileCount;
-
- QVector<QString> fileList;
- fileList.reserve(fileCount);
- while (fileCount--) {
- QString fileName;
- stream >> fileName;
- fileList.append(fileName);
- }
-
- QSharedPointer<AndroidAssetDir> *aad = new QSharedPointer<AndroidAssetDir>(new AndroidAssetDir(0));
- (*aad)->m_items = fileList;
-
- // Cost = 0, because we should always cache everything if there's a prepopulated cache
- QByteArray key = directoryName != QLatin1String("/")
- ? QByteArray("assets:/") + directoryName.toUtf8()
- : QByteArray("assets:");
-
- bool ok = m_assetsCache.insert(key, aad, 0);
- if (!ok)
- qWarning("Failed to insert in cache: %s", qPrintable(directoryName));
- }
- } else {
- qWarning("Prepopulated cache is too large to read.\n"
- "Use environment variable QT_ANDROID_MAX_PREPOPULATED_ASSETS_CACHE_SIZE to adjust size.");
- }
- }
- }
-}
-
QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &fileName) const
{
if (fileName.isEmpty())
- return 0;
+ return nullptr;
- static QLatin1String assetsPrefix("assets:");
if (!fileName.startsWith(assetsPrefix))
- return 0;
-
- static int prefixSize = assetsPrefix.size() + 1;
-
- QByteArray path;
- if (!fileName.endsWith(QLatin1Char('/'))) {
- path = fileName.toUtf8();
- if (path.size() > prefixSize) {
- AAsset *asset = AAssetManager_open(m_assetManager,
- path.constData() + prefixSize,
- AASSET_MODE_BUFFER);
- if (asset)
- return new AndroidAbstractFileEngine(asset, fileName);
- }
- }
-
- if (!path.size())
- path = fileName.left(fileName.length() - 1).toUtf8();
-
-
- m_assetsCacheMutext.lock();
- if (!m_hasTriedPrepopulatingCache)
- prepopulateCache();
-
- QSharedPointer<AndroidAssetDir> *aad = m_assetsCache.object(path);
- m_assetsCacheMutext.unlock();
- if (!aad) {
- if (!m_hasPrepopulatedCache && path.size() > prefixSize) {
- AAssetDir *assetDir = AAssetManager_openDir(m_assetManager, path.constData() + prefixSize);
- if (assetDir) {
- if (AAssetDir_getNextFileName(assetDir)) {
- AAssetDir_rewind(assetDir);
- aad = new QSharedPointer<AndroidAssetDir>(new AndroidAssetDir(assetDir));
- m_assetsCacheMutext.lock();
- m_assetsCache.insert(path, aad);
- m_assetsCacheMutext.unlock();
- return new AndroidAbstractFileEngine(*aad, fileName);
- } else {
- AAssetDir_close(assetDir);
- }
- }
- }
- } else {
- return new AndroidAbstractFileEngine(*aad, fileName);
- }
- return 0;
+ return nullptr;
+
+ QString path = fileName.mid(prefixSize);
+ path.replace(QLatin1String("//"), QLatin1String("/"));
+ if (path.startsWith(QLatin1Char('/')))
+ path.remove(0, 1);
+ if (path.endsWith(QLatin1Char('/')))
+ path.chop(1);
+ return new AndroidAbstractFileEngine(m_assetManager, path);
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.h b/src/plugins/platforms/android/qandroidassetsfileenginehandler.h
index f99dc9a11a..51cc5b07a8 100644
--- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.h
+++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.h
@@ -49,22 +49,14 @@
QT_BEGIN_NAMESPACE
-struct AndroidAssetDir;
class AndroidAssetsFileEngineHandler: public QAbstractFileEngineHandler
{
public:
AndroidAssetsFileEngineHandler();
- virtual ~AndroidAssetsFileEngineHandler();
QAbstractFileEngine *create(const QString &fileName) const override;
private:
- void prepopulateCache() const;
-
AAssetManager *m_assetManager;
- mutable QCache<QByteArray, QSharedPointer<AndroidAssetDir>> m_assetsCache;
- mutable QMutex m_assetsCacheMutext;
- mutable bool m_hasPrepopulatedCache;
- mutable bool m_hasTriedPrepopulatingCache;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/qandroideventdispatcher.cpp b/src/plugins/platforms/android/qandroideventdispatcher.cpp
index e12551283f..3a1fb7a6de 100644
--- a/src/plugins/platforms/android/qandroideventdispatcher.cpp
+++ b/src/plugins/platforms/android/qandroideventdispatcher.cpp
@@ -78,14 +78,14 @@ void QAndroidEventDispatcher::stop()
void QAndroidEventDispatcher::goingToStop(bool stop)
{
- m_goingToStop.store(stop ? 1 : 0);
+ m_goingToStop.storeRelaxed(stop ? 1 : 0);
if (!stop)
wakeUp();
}
bool QAndroidEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
{
- if (m_goingToStop.load())
+ if (m_goingToStop.loadRelaxed())
flags |= QEventLoop::ExcludeSocketNotifiers | QEventLoop::X11ExcludeTimers;
{
diff --git a/src/plugins/platforms/android/qandroideventdispatcher.h b/src/plugins/platforms/android/qandroideventdispatcher.h
index e6f903bced..4fdd7af7a5 100644
--- a/src/plugins/platforms/android/qandroideventdispatcher.h
+++ b/src/plugins/platforms/android/qandroideventdispatcher.h
@@ -68,7 +68,7 @@ class QAndroidEventDispatcherStopper
{
public:
static QAndroidEventDispatcherStopper *instance();
- static bool stopped() {return !instance()->m_started.load(); }
+ static bool stopped() {return !instance()->m_started.loadRelaxed(); }
void startAll();
void stopAll();
void addEventDispatcher(QAndroidEventDispatcher *dispatcher);
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp
index 7dc8bb8080..80757c2135 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.cpp
+++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp
@@ -401,15 +401,17 @@ void QAndroidPlatformScreen::doRedraw()
m_dirtyRect = QRect();
}
+static const int androidLogicalDpi = 72;
+
QDpi QAndroidPlatformScreen::logicalDpi() const
{
- qreal lDpi = QtAndroid::scaledDensity() * 72;
+ qreal lDpi = QtAndroid::scaledDensity() * androidLogicalDpi;
return QDpi(lDpi, lDpi);
}
-qreal QAndroidPlatformScreen::pixelDensity() const
+QDpi QAndroidPlatformScreen::logicalBaseDpi() const
{
- return QtAndroid::pixelDensity();
+ return QDpi(androidLogicalDpi, androidLogicalDpi);
}
Qt::ScreenOrientation QAndroidPlatformScreen::orientation() const
diff --git a/src/plugins/platforms/android/qandroidplatformscreen.h b/src/plugins/platforms/android/qandroidplatformscreen.h
index f15aeae3fd..5dc158e351 100644
--- a/src/plugins/platforms/android/qandroidplatformscreen.h
+++ b/src/plugins/platforms/android/qandroidplatformscreen.h
@@ -103,7 +103,7 @@ protected:
private:
QDpi logicalDpi() const override;
- qreal pixelDensity() const override;
+ QDpi logicalBaseDpi() const override;
Qt::ScreenOrientation orientation() const override;
Qt::ScreenOrientation nativeOrientation() const override;
void surfaceChanged(JNIEnv *env, jobject surface, int w, int h) override;
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.cpp b/src/plugins/platforms/android/qandroidplatformwindow.cpp
index c095f51fa3..4f691ce112 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.cpp
+++ b/src/plugins/platforms/android/qandroidplatformwindow.cpp
@@ -49,13 +49,14 @@
QT_BEGIN_NAMESPACE
+static QBasicAtomicInt winIdGenerator = Q_BASIC_ATOMIC_INITIALIZER(0);
+
QAndroidPlatformWindow::QAndroidPlatformWindow(QWindow *window)
: QPlatformWindow(window)
{
m_windowFlags = Qt::Widget;
m_windowState = Qt::WindowNoState;
- static QAtomicInt winIdGenerator(1);
- m_windowId = winIdGenerator.fetchAndAddRelaxed(1);
+ m_windowId = winIdGenerator.fetchAndAddRelaxed(1) + 1;
setWindowState(window->windowStates());
}
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h
index f2e51bd3df..d8eb6b7b7f 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.h
+++ b/src/plugins/platforms/android/qandroidplatformwindow.h
@@ -65,6 +65,9 @@ public:
void setParent(const QPlatformWindow *window) override;
WId winId() const override { return m_windowId; }
+ bool setMouseGrabEnabled(bool grab) override { Q_UNUSED(grab); return false; }
+ bool setKeyboardGrabEnabled(bool grab) override { Q_UNUSED(grab); return false; }
+
QAndroidPlatformScreen *platformScreen() const;
void propagateSizeHints() override;
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.h b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
index 457c158ddc..539d876094 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
@@ -44,9 +44,9 @@
#include <QtGui>
#include <qpa/qplatformaccessibility.h>
-#ifndef QT_NO_ACCESSIBILITY
+#include "qcocoaaccessibilityelement.h"
-@class QT_MANGLE_NAMESPACE(QMacAccessibilityElement);
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
@@ -84,7 +84,7 @@ namespace QCocoaAccessible {
NSString *macRole(QAccessibleInterface *interface);
NSString *macSubrole(QAccessibleInterface *interface);
bool shouldBeIgnored(QAccessibleInterface *interface);
-NSArray<QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *> *unignoredChildren(QAccessibleInterface *interface);
+NSArray<QMacAccessibilityElement *> *unignoredChildren(QAccessibleInterface *interface);
NSString *getTranslatedAction(const QString &qtAction);
QString translateAction(NSString *nsAction, QAccessibleInterface *interface);
bool hasValueAttribute(QAccessibleInterface *interface);
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 368cf56c80..db4ec251ae 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -177,7 +177,7 @@ NSString *macRole(QAccessibleInterface *interface)
if (roleMap.isEmpty())
populateRoleMap();
- // MAC_ACCESSIBILTY_DEBUG() << "role for" << interface.object() << "interface role" << hex << qtRole;
+ // MAC_ACCESSIBILTY_DEBUG() << "role for" << interface.object() << "interface role" << Qt::hex << qtRole;
if (roleMap.contains(qtRole)) {
// MAC_ACCESSIBILTY_DEBUG() << "return" << roleMap[qtRole];
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
index 914aaa2b1b..141ce6bf1a 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
@@ -50,9 +50,7 @@
#import <qaccessible.h>
-@class QT_MANGLE_NAMESPACE(QMacAccessibilityElement);
-
-@interface QT_MANGLE_NAMESPACE(QMacAccessibilityElement) : NSObject
+@interface QT_MANGLE_NAMESPACE(QMacAccessibilityElement) : NSObject <NSAccessibilityElement>
- (instancetype)initWithId:(QAccessible::Id)anId;
+ (instancetype)elementWithId:(QAccessible::Id)anId;
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index f0ef70e3a3..3560c9d9b5 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -174,6 +174,17 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
// accessibility protocol
//
+- (BOOL)isAccessibilityFocused
+{
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid()) {
+ return false;
+ }
+ // Just check if the app thinks we're focused.
+ id focusedElement = NSApp.accessibilityApplicationFocusedUIElement;
+ return [focusedElement isEqual:self];
+}
+
// attributes
+ (id) lineNumberForIndex: (int)index forText:(const QString &)text
@@ -187,54 +198,58 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
return YES;
}
-- (NSArray<NSString *> *)accessibilityAttributeNames {
- static NSArray<NSString *> *defaultAttributes = [@[
- NSAccessibilityRoleAttribute,
- NSAccessibilityRoleDescriptionAttribute,
- NSAccessibilitySubroleAttribute,
- NSAccessibilityChildrenAttribute,
- NSAccessibilityFocusedAttribute,
- NSAccessibilityParentAttribute,
- NSAccessibilityWindowAttribute,
- NSAccessibilityTopLevelUIElementAttribute,
- NSAccessibilityPositionAttribute,
- NSAccessibilitySizeAttribute,
- NSAccessibilityTitleAttribute,
- NSAccessibilityDescriptionAttribute,
- NSAccessibilityEnabledAttribute
- ] retain];
+- (NSString *) accessibilityRole {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return NSAccessibilityUnknownRole;
+ return QCocoaAccessible::macRole(iface);
+}
+- (NSString *) accessibilitySubRole {
QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
if (!iface || !iface->isValid())
- return defaultAttributes;
+ return NSAccessibilityUnknownRole;
+ return QCocoaAccessible::macSubrole(iface);
+}
- NSMutableArray<NSString *> *attributes = [[NSMutableArray<NSString *> alloc] initWithCapacity:defaultAttributes.count];
- [attributes addObjectsFromArray:defaultAttributes];
+- (NSString *) accessibilityRoleDescription {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return NSAccessibilityUnknownRole;
+ return NSAccessibilityRoleDescription(self.accessibilityRole, self.accessibilitySubRole);
+}
- if (QCocoaAccessible::hasValueAttribute(iface)) {
- [attributes addObject:NSAccessibilityValueAttribute];
- }
+- (NSArray *) accessibilityChildren {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return nil;
+ return QCocoaAccessible::unignoredChildren(iface);
+}
- if (iface->textInterface()) {
- [attributes addObjectsFromArray:@[
- NSAccessibilityNumberOfCharactersAttribute,
- NSAccessibilitySelectedTextAttribute,
- NSAccessibilitySelectedTextRangeAttribute,
- NSAccessibilityVisibleCharacterRangeAttribute,
- NSAccessibilityInsertionPointLineNumberAttribute
- ]];
-
-// TODO: multi-selection: NSAccessibilitySelectedTextRangesAttribute,
- }
+- (id) accessibilityWindow {
+ // We're in the same window as our parent.
+ return [self.accessibilityParent accessibilityWindow];
+}
- if (iface->valueInterface()) {
- [attributes addObjectsFromArray:@[
- NSAccessibilityMinValueAttribute,
- NSAccessibilityMaxValueAttribute
- ]];
- }
+- (id) accessibilityTopLevelUIElementAttribute {
+ // We're in the same top level element as our parent.
+ return [self.accessibilityParent accessibilityTopLevelUIElementAttribute];
+}
- return [attributes autorelease];
+- (NSString *) accessibilityTitle {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return nil;
+ if (iface->role() == QAccessible::StaticText)
+ return nil;
+ return iface->text(QAccessible::Name).toNSString();
+}
+
+- (BOOL) accessibilityEnabledAttribute {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return false;
+ return !iface->state().disabled;
}
- (id)accessibilityParent {
@@ -271,112 +286,117 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
return QCocoaScreen::mapToNative(iface->rect());
}
-- (id) minValueAttribute:(QAccessibleInterface*)iface {
+- (NSString*)accessibilityLabel {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid()) {
+ qWarning() << "Called accessibilityLabel on invalid object: " << axid;
+ return nil;
+ }
+ return iface->text(QAccessible::Description).toNSString();
+}
+
+- (void)setAccessibilityLabel:(NSString*)label{
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return;
+ iface->setText(QAccessible::Description, QString::fromNSString(label));
+}
+
+- (id) accessibilityMinValue:(QAccessibleInterface*)iface {
if (QAccessibleValueInterface *val = iface->valueInterface())
return @(val->minimumValue().toDouble());
return nil;
}
-- (id) maxValueAttribute:(QAccessibleInterface*)iface {
+- (id) accessibilityMaxValue:(QAccessibleInterface*)iface {
if (QAccessibleValueInterface *val = iface->valueInterface())
return @(val->maximumValue().toDouble());
return nil;
}
-- (id)accessibilityAttributeValue:(NSString *)attribute {
+- (id) accessibilityValue {
QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
- if (!iface || !iface->isValid()) {
- qWarning() << "Called attribute on invalid object: " << axid;
+ if (!iface || !iface->isValid())
return nil;
- }
- if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) {
- return QCocoaAccessible::macRole(iface);
- } else if ([attribute isEqualToString:NSAccessibilitySubroleAttribute]) {
- return QCocoaAccessible::macSubrole(iface);
- } else if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
- return NSAccessibilityRoleDescription(QCocoaAccessible::macRole(iface),
- [self accessibilityAttributeValue:NSAccessibilitySubroleAttribute]);
- } else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
- return QCocoaAccessible::unignoredChildren(iface);
- } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
- // Just check if the app thinks we're focused.
- id focusedElement = [NSApp accessibilityAttributeValue:NSAccessibilityFocusedUIElementAttribute];
- return @([focusedElement isEqual:self]);
- } else if ([attribute isEqualToString:NSAccessibilityParentAttribute]) {
- return self.accessibilityParent;
- } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) {
- // We're in the same window as our parent.
- return [[self accessibilityParent] accessibilityAttributeValue:NSAccessibilityWindowAttribute];
- } else if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute]) {
- // We're in the same top level element as our parent.
- return [[self accessibilityParent] accessibilityAttributeValue:NSAccessibilityTopLevelUIElementAttribute];
- } else if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) {
- // The position in points of the element's lower-left corner in screen-relative coordinates
- QPointF qtPosition = QRectF(iface->rect()).bottomLeft();
- return [NSValue valueWithPoint:QCocoaScreen::mapToNative(qtPosition)];
- } else if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) {
- QSize qtSize = iface->rect().size();
- return [NSValue valueWithSize: NSMakeSize(qtSize.width(), qtSize.height())];
- } else if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) {
- if (iface->role() == QAccessible::StaticText)
- return nil;
- return iface->text(QAccessible::Name).toNSString();
- } else if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) {
- return iface->text(QAccessible::Description).toNSString();
- } else if ([attribute isEqualToString:NSAccessibilityEnabledAttribute]) {
- return @(!iface->state().disabled);
- } else if ([attribute isEqualToString:NSAccessibilityValueAttribute]) {
- // VoiceOver asks for the value attribute for all elements. Return nil
- // if we don't want the element to have a value attribute.
- if (!QCocoaAccessible::hasValueAttribute(iface))
- return nil;
+ // VoiceOver asks for the value attribute for all elements. Return nil
+ // if we don't want the element to have a value attribute.
+ if (!QCocoaAccessible::hasValueAttribute(iface))
+ return nil;
+
+ return QCocoaAccessible::getValueAttribute(iface);
+}
- return QCocoaAccessible::getValueAttribute(iface);
+- (NSInteger) accessibilityNumberOfCharacters {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return 0;
+ if (QAccessibleTextInterface *text = iface->textInterface())
+ return text->characterCount();
+ return 0;
+}
- } else if ([attribute isEqualToString:NSAccessibilityNumberOfCharactersAttribute]) {
- if (QAccessibleTextInterface *text = iface->textInterface())
- return @(text->characterCount());
+- (NSString *) accessibilitySelectedText {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
return nil;
- } else if ([attribute isEqualToString:NSAccessibilitySelectedTextAttribute]) {
- if (QAccessibleTextInterface *text = iface->textInterface()) {
- int start = 0;
- int end = 0;
+ if (QAccessibleTextInterface *text = iface->textInterface()) {
+ int start = 0;
+ int end = 0;
+ text->selection(0, &start, &end);
+ return text->text(start, end).toNSString();
+ }
+ return nil;
+}
+
+- (NSRange) accessibilitySelectedTextRange {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return NSRange();
+ if (QAccessibleTextInterface *text = iface->textInterface()) {
+ int start = 0;
+ int end = 0;
+ if (text->selectionCount() > 0) {
text->selection(0, &start, &end);
- return text->text(start, end).toNSString();
- }
- return nil;
- } else if ([attribute isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) {
- if (QAccessibleTextInterface *text = iface->textInterface()) {
- int start = 0;
- int end = 0;
- if (text->selectionCount() > 0) {
- text->selection(0, &start, &end);
- } else {
- start = text->cursorPosition();
- end = start;
- }
- return [NSValue valueWithRange:NSMakeRange(quint32(start), quint32(end - start))];
- }
- return [NSValue valueWithRange: NSMakeRange(0, 0)];
- } else if ([attribute isEqualToString:NSAccessibilityVisibleCharacterRangeAttribute]) {
- // FIXME This is not correct and may impact performance for big texts
- if (QAccessibleTextInterface *text = iface->textInterface())
- return [NSValue valueWithRange: NSMakeRange(0, text->characterCount())];
- return [NSValue valueWithRange: NSMakeRange(0, iface->text(QAccessible::Name).length())];
- } else if ([attribute isEqualToString:NSAccessibilityInsertionPointLineNumberAttribute]) {
- if (QAccessibleTextInterface *text = iface->textInterface()) {
- int position = text->cursorPosition();
- return [self accessibilityAttributeValue:NSAccessibilityLineForIndexParameterizedAttribute forParameter:@(position)];
+ } else {
+ start = text->cursorPosition();
+ end = start;
}
- return nil;
- } else if ([attribute isEqualToString:NSAccessibilityMinValueAttribute]) {
- return [self minValueAttribute:iface];
- } else if ([attribute isEqualToString:NSAccessibilityMaxValueAttribute]) {
- return [self maxValueAttribute:iface];
+ return NSMakeRange(quint32(start), quint32(end - start));
}
+ return NSMakeRange(0, 0);
+}
- return nil;
+- (NSInteger)accessibilityLineForIndex:(NSInteger)index {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return 0;
+ if (QAccessibleTextInterface *text = iface->textInterface()) {
+ QString textToPos = text->text(0, index);
+ return textToPos.count('\n');
+ }
+ return 0;
+}
+
+- (NSRange)accessibilityVisibleCharacterRange {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return NSRange();
+ // FIXME This is not correct and may impact performance for big texts
+ if (QAccessibleTextInterface *text = iface->textInterface())
+ return NSMakeRange(0, static_cast<uint>(text->characterCount()));
+ return NSMakeRange(0, static_cast<uint>(iface->text(QAccessible::Name).length()));
+}
+
+- (NSInteger) accessibilityInsertionPointLineNumber {
+ QAccessibleInterface *iface = QAccessible::accessibleInterface(axid);
+ if (!iface || !iface->isValid())
+ return 0;
+ if (QAccessibleTextInterface *text = iface->textInterface()) {
+ int position = text->cursorPosition();
+ return [self accessibilityLineForIndex:position];
+ }
+ return 0;
}
- (NSArray *)accessibilityParameterizedAttributeNames {
diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm
index 340191622a..c6029bcf03 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplication.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm
@@ -144,7 +144,7 @@ static void qt_maybeSendKeyEquivalentUpEvent(NSEvent *event)
}
}
-@implementation QT_MANGLE_NAMESPACE(QNSApplication)
+@implementation QNSApplication
- (void)QT_MANGLE_NAMESPACE(qt_sendEvent_original):(NSEvent *)event
{
@@ -188,7 +188,7 @@ void qt_redirectNSApplicationSendEvent()
// can be unloaded.
return;
- if ([NSApp isMemberOfClass:[QT_MANGLE_NAMESPACE(QNSApplication) class]]) {
+ if ([NSApp isMemberOfClass:[QNSApplication class]]) {
// No need to change implementation since Qt
// already controls a subclass of NSApplication
return;
@@ -201,7 +201,7 @@ void qt_redirectNSApplicationSendEvent()
qt_cocoa_change_implementation(
[NSApplication class],
@selector(sendEvent:),
- [QT_MANGLE_NAMESPACE(QNSApplication) class],
+ [QNSApplication class],
@selector(QT_MANGLE_NAMESPACE(qt_sendEvent_replacement):),
@selector(QT_MANGLE_NAMESPACE(qt_sendEvent_original):));
}
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
index 0816730c54..8ec9d6fbe0 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
@@ -89,8 +89,7 @@
#include <qglobal.h>
#include <private/qcore_mac_p.h>
-
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
+#include "qcocoansmenu.h"
@interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) : NSObject <NSApplicationDelegate>
@property (nonatomic, retain) NSMenu *dockMenu;
@@ -100,8 +99,9 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
- (bool)inLaunch;
@end
-@interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) (MenuAPI)
-- (void)qt_itemFired:(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem) *)item;
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaApplicationDelegate);
+
+@interface QCocoaApplicationDelegate (MenuAPI)
+- (void)qt_itemFired:(QCocoaNSMenuItem *)item;
@end
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaApplicationDelegate);
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 2cf6672da9..9b0a6b1b86 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -88,10 +88,13 @@
#include <qpa/qwindowsysteminterface.h>
#include <qwindowdefs.h>
+QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcQpaApplication, "qt.qpa.application");
+QT_END_NAMESPACE
+
QT_USE_NAMESPACE
@implementation QCocoaApplicationDelegate {
- bool startedQuit;
NSObject <NSApplicationDelegate> *reflectionDelegate;
bool inLaunch;
}
@@ -140,71 +143,30 @@ QT_USE_NAMESPACE
return [[self.dockMenu retain] autorelease];
}
-- (BOOL)canQuit
-{
- [[NSApp mainMenu] cancelTracking];
-
- bool handle_quit = true;
- NSMenuItem *quitMenuItem = [[QT_MANGLE_NAMESPACE(QCocoaMenuLoader) sharedMenuLoader] quitMenuItem];
- if (!QGuiApplicationPrivate::instance()->modalWindowList.isEmpty()
- && [quitMenuItem isEnabled]) {
- int visible = 0;
- const QWindowList tlws = QGuiApplication::topLevelWindows();
- for (int i = 0; i < tlws.size(); ++i) {
- if (tlws.at(i)->isVisible())
- ++visible;
- }
- handle_quit = (visible <= 1);
- }
-
- if (handle_quit) {
- QCloseEvent ev;
- QGuiApplication::sendEvent(qGuiApp, &ev);
- if (ev.isAccepted()) {
- return YES;
- }
- }
-
- return NO;
-}
-
// This function will only be called when NSApp is actually running.
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
- // The reflection delegate gets precedence
- if (reflectionDelegate) {
- if ([reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)])
- return [reflectionDelegate applicationShouldTerminate:sender];
- return NSTerminateNow;
- }
-
- if ([self canQuit]) {
- if (!startedQuit) {
- startedQuit = true;
- // Close open windows. This is done in order to deliver de-expose
- // events while the event loop is still running.
- const QWindowList topLevels = QGuiApplication::topLevelWindows();
- for (int i = 0; i < topLevels.size(); ++i) {
- QWindow *topLevelWindow = topLevels.at(i);
- // Already closed windows will not have a platform window, skip those
- if (topLevelWindow->handle())
- QWindowSystemInterface::handleCloseEvent(topLevelWindow);
- }
- QWindowSystemInterface::flushWindowSystemEvents();
-
- QGuiApplication::exit(0);
- startedQuit = false;
- }
- }
+ if ([reflectionDelegate respondsToSelector:_cmd])
+ return [reflectionDelegate applicationShouldTerminate:sender];
if (QGuiApplicationPrivate::instance()->threadData->eventLoops.isEmpty()) {
- // INVARIANT: No event loop is executing. This probably
- // means that Qt is used as a plugin, or as a part of a native
- // Cocoa application. In any case it should be fine to
- // terminate now:
+ // No event loop is executing. This probably means that Qt is used as a plugin,
+ // or as a part of a native Cocoa application. In any case it should be fine to
+ // terminate now.
+ qCDebug(lcQpaApplication) << "No running event loops, terminating now";
return NSTerminateNow;
}
+ if (!QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>()) {
+ qCDebug(lcQpaApplication) << "Application termination canceled";
+ return NSTerminateCancel;
+ }
+
+ // Even if the application termination was accepted by the application we can't
+ // return NSTerminateNow, as that would trigger AppKit to ultimately call exit().
+ // We need to ensure that the runloop continues spinning so that we can return
+ // from our own event loop back to main(), and exit from there.
+ qCDebug(lcQpaApplication) << "Termination accepted, but returning to runloop for exit through main()";
return NSTerminateCancel;
}
@@ -228,10 +190,6 @@ QT_USE_NAMESPACE
*/
NSAppleEventManager *eventManager = [NSAppleEventManager sharedAppleEventManager];
[eventManager setEventHandler:self
- andSelector:@selector(appleEventQuit:withReplyEvent:)
- forEventClass:kCoreEventClass
- andEventID:kAEQuitApplication];
- [eventManager setEventHandler:self
andSelector:@selector(getUrl:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
@@ -241,7 +199,6 @@ QT_USE_NAMESPACE
- (void)removeAppleEventHandlers
{
NSAppleEventManager *eventManager = [NSAppleEventManager sharedAppleEventManager];
- [eventManager removeEventHandlerForEventClass:kCoreEventClass andEventID:kAEQuitApplication];
[eventManager removeEventHandlerForEventClass:kInternetEventClass andEventID:kAEGetURL];
}
@@ -282,26 +239,22 @@ QT_USE_NAMESPACE
QWindowSystemInterface::handleFileOpenEvent(qtFileName);
}
- if (reflectionDelegate &&
- [reflectionDelegate respondsToSelector:@selector(application:openFiles:)])
+ if ([reflectionDelegate respondsToSelector:_cmd])
[reflectionDelegate application:sender openFiles:filenames];
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
{
- // If we have a reflection delegate, that will get to call the shots.
- if (reflectionDelegate
- && [reflectionDelegate respondsToSelector:
- @selector(applicationShouldTerminateAfterLastWindowClosed:)])
+ if ([reflectionDelegate respondsToSelector:_cmd])
return [reflectionDelegate applicationShouldTerminateAfterLastWindowClosed:sender];
+
return NO; // Someday qApp->quitOnLastWindowClosed(); when QApp and NSApp work closer together.
}
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
- if (reflectionDelegate
- && [reflectionDelegate respondsToSelector:@selector(applicationDidBecomeActive:)])
+ if ([reflectionDelegate respondsToSelector:_cmd])
[reflectionDelegate applicationDidBecomeActive:notification];
QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
@@ -309,8 +262,7 @@ QT_USE_NAMESPACE
- (void)applicationDidResignActive:(NSNotification *)notification
{
- if (reflectionDelegate
- && [reflectionDelegate respondsToSelector:@selector(applicationDidResignActive:)])
+ if ([reflectionDelegate respondsToSelector:_cmd])
[reflectionDelegate applicationDidResignActive:notification];
QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
@@ -318,10 +270,7 @@ QT_USE_NAMESPACE
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
{
- Q_UNUSED(theApplication);
- Q_UNUSED(flag);
- if (reflectionDelegate
- && [reflectionDelegate respondsToSelector:@selector(applicationShouldHandleReopen:hasVisibleWindows:)])
+ if ([reflectionDelegate respondsToSelector:_cmd])
return [reflectionDelegate applicationShouldHandleReopen:theApplication hasVisibleWindows:flag];
/*
@@ -354,16 +303,13 @@ QT_USE_NAMESPACE
- (BOOL)respondsToSelector:(SEL)aSelector
{
- BOOL result = [super respondsToSelector:aSelector];
- if (!result && reflectionDelegate)
- result = [reflectionDelegate respondsToSelector:aSelector];
- return result;
+ return [super respondsToSelector:aSelector] || [reflectionDelegate respondsToSelector:aSelector];
}
- (void)forwardInvocation:(NSInvocation *)invocation
{
SEL invocationSelector = [invocation selector];
- if (reflectionDelegate && [reflectionDelegate respondsToSelector:invocationSelector])
+ if ([reflectionDelegate respondsToSelector:invocationSelector])
[invocation invokeWithTarget:reflectionDelegate];
else
[self doesNotRecognizeSelector:invocationSelector];
@@ -375,14 +321,6 @@ QT_USE_NAMESPACE
NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
QWindowSystemInterface::handleFileOpenEvent(QUrl(QString::fromNSString(urlString)));
}
-
-- (void)appleEventQuit:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent
-{
- Q_UNUSED(event);
- Q_UNUSED(replyEvent);
- [NSApp terminate:self];
-}
-
@end
@implementation QCocoaApplicationDelegate (Menus)
diff --git a/src/plugins/platforms/cocoa/qcocoabackingstore.mm b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
index 5550f0586b..b17302a640 100644
--- a/src/plugins/platforms/cocoa/qcocoabackingstore.mm
+++ b/src/plugins/platforms/cocoa/qcocoabackingstore.mm
@@ -195,7 +195,7 @@ void QNSWindowBackingStore::flush(QWindow *window, const QRegion &region, const
// context is set up correctly (coordinate system, clipping, etc). Outside
// of the normal display cycle there is no focused view, as explained above,
// so we have to handle it manually. There's also a corner case inside the
- // normal display cycle due to way QWidgetBackingStore composits native child
+ // normal display cycle due to way QWidgetRepaintManager composits native child
// widgets, where we'll get a flush of a native child during the drawRect of
// its parent/ancestor, and the parent/ancestor being the one locked by AppKit.
// In this case we also need to lock and unlock focus manually.
@@ -560,17 +560,26 @@ void QCALayerBackingStore::flush(QWindow *flushedWindow, const QRegion &region,
flushedView.layer.contents = nil;
}
- qCInfo(lcQpaBackingStore) << "Flushing" << backBufferSurface
- << "to" << flushedView.layer << "of" << flushedView;
-
- flushedView.layer.contents = backBufferSurface;
+ if (flushedView == backingStoreView) {
+ qCInfo(lcQpaBackingStore) << "Flushing" << backBufferSurface
+ << "to" << flushedView.layer << "of" << flushedView;
+ flushedView.layer.contents = backBufferSurface;
+ } else {
+ auto subviewRect = [flushedView convertRect:flushedView.bounds toView:backingStoreView];
+ auto scale = flushedView.layer.contentsScale;
+ subviewRect = CGRectApplyAffineTransform(subviewRect, CGAffineTransformMakeScale(scale, scale));
+
+ // We make a copy of the image data up front, which means we don't
+ // need to mark the IOSurface as being in use. FIXME: Investigate
+ // if there's a cheaper way to get sub-image data to a layer.
+ m_buffers.back()->lock(QPlatformGraphicsBuffer::SWReadAccess);
+ QImage subImage = m_buffers.back()->asImage()->copy(QRectF::fromCGRect(subviewRect).toRect());
+ m_buffers.back()->unlock();
- if (flushedView != backingStoreView) {
- const CGSize backingStoreSize = backingStoreView.bounds.size;
- flushedView.layer.contentsRect = CGRectApplyAffineTransform(
- [flushedView convertRect:flushedView.bounds toView:backingStoreView],
- // The contentsRect is in unit coordinate system
- CGAffineTransformMakeScale(1.0 / backingStoreSize.width, 1.0 / backingStoreSize.height));
+ qCInfo(lcQpaBackingStore) << "Flushing" << subImage
+ << "to" << flushedView.layer << "of subview" << flushedView;
+ QCFType<CGImageRef> cgImage = subImage.toCGImage();
+ flushedView.layer.contents = (__bridge id)static_cast<CGImageRef>(cgImage);
}
// Since we may receive multiple flushes before a new frame is started, we do not
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index d7850b1481..c9fa035d87 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -293,7 +293,7 @@ class QCocoaColorPanel
public:
QCocoaColorPanel()
{
- mDelegate = [[QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) alloc] init];
+ mDelegate = [[QNSColorPanelDelegate alloc] init];
}
~QCocoaColorPanel()
@@ -366,7 +366,7 @@ public:
}
private:
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *mDelegate;
+ QNSColorPanelDelegate *mDelegate;
};
Q_GLOBAL_STATIC(QCocoaColorPanel, sharedColorPanel)
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
index d3bb0711f0..e87fc39c42 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
@@ -881,7 +881,7 @@ void QCocoaEventDispatcherPrivate::processPostedEvents()
return;
}
- int serial = serialNumber.load();
+ int serial = serialNumber.loadRelaxed();
if (!threadData->canWait || (serial != lastSerial)) {
lastSerial = serial;
QCoreApplication::sendPostedEvents();
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index 2ddda14289..dd0afbefe6 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -43,10 +43,16 @@
#include <QObject>
#include <QtWidgets/qtwidgetsglobal.h>
#include <qpa/qplatformdialoghelper.h>
+#include <QtCore/private/qcore_mac_p.h>
+
+#import <AppKit/NSSavePanel.h>
QT_REQUIRE_CONFIG(filedialog);
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate));
+@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) : NSObject<NSOpenSavePanelDelegate>
+@end
+
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
QT_BEGIN_NAMESPACE
@@ -84,7 +90,7 @@ public:
void QNSOpenSavePanelDelegate_filterSelected(int menuIndex);
private:
- QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *mDelegate;
+ QNSOpenSavePanelDelegate *mDelegate;
QUrl mDir;
};
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index d1695ea860..6aa21d78d1 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -51,7 +51,6 @@
#include "qt_mac_p.h"
#include "qcocoahelpers.h"
#include "qcocoaeventdispatcher.h"
-#include <qregexp.h>
#include <qbuffer.h>
#include <qdebug.h>
#include <qstringlist.h>
@@ -77,27 +76,6 @@ QT_USE_NAMESPACE
typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
-@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
- : NSObject<NSOpenSavePanelDelegate>
-
-- (NSString *)strip:(const QString &)label;
-- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url;
-- (void)filterChanged:(id)sender;
-- (void)showModelessPanel;
-- (BOOL)runApplicationModalPanel;
-- (void)showWindowModalSheet:(QWindow *)docWidget;
-- (void)updateProperties;
-- (QStringList)acceptableExtensionsForSave;
-- (QString)removeExtensions:(const QString &)filter;
-- (void)createTextField;
-- (void)createPopUpButton:(const QString &)selectedFilter hideDetails:(BOOL)hideDetails;
-- (QStringList)findStrippedFilterWithVisualFilterName:(QString)name;
-- (void)createAccessory;
-
-@end
-
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
-
@implementation QNSOpenSavePanelDelegate {
@public
NSOpenPanel *mOpenPanel;
@@ -215,7 +193,7 @@ static QString strippedText(QString s)
NSString *filepath = info.filePath().toNSString();
NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()];
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
- || [self panel:nil shouldEnableURL:url];
+ || [self panel:mOpenPanel shouldEnableURL:url];
[self updateProperties];
[mSavePanel setNameFieldStringValue:selectable ? info.fileName().toNSString() : @""];
@@ -234,7 +212,7 @@ static QString strippedText(QString s)
NSString *filepath = info.filePath().toNSString();
NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()];
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
- || [self panel:nil shouldEnableURL:url];
+ || [self panel:mSavePanel shouldEnableURL:url];
[mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]];
[mSavePanel setNameFieldStringValue:selectable ? info.fileName().toNSString() : @""];
@@ -264,7 +242,7 @@ static QString strippedText(QString s)
NSString *filepath = info.filePath().toNSString();
NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()];
bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave)
- || [self panel:nil shouldEnableURL:url];
+ || [self panel:mSavePanel shouldEnableURL:url];
[self updateProperties];
[mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]];
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 8c0af97a68..7748c304e3 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -283,7 +283,7 @@ class QCocoaFontPanel
public:
QCocoaFontPanel()
{
- mDelegate = [[QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) alloc] init];
+ mDelegate = [[QNSFontPanelDelegate alloc] init];
}
~QCocoaFontPanel()
@@ -356,7 +356,7 @@ public:
}
private:
- QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *mDelegate;
+ QNSFontPanelDelegate *mDelegate;
};
Q_GLOBAL_STATIC(QCocoaFontPanel, sharedFontPanel)
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.h b/src/plugins/platforms/cocoa/qcocoaglcontext.h
index bb309c0713..4210a4ed3f 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.h
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.h
@@ -50,6 +50,8 @@
QT_BEGIN_NAMESPACE
+class QCocoaWindow;
+
class QCocoaGLContext : public QPlatformOpenGLContext
{
public:
@@ -76,12 +78,12 @@ private:
static NSOpenGLPixelFormat *pixelFormatForSurfaceFormat(const QSurfaceFormat &format);
bool setDrawable(QPlatformSurface *surface);
+ void prepareDrawable(QCocoaWindow *platformWindow);
void updateSurfaceFormat();
NSOpenGLContext *m_context = nil;
NSOpenGLContext *m_shareContext = nil;
QSurfaceFormat m_format;
- bool m_didCheckForSoftwareContext = false;
QVarLengthArray<QMacNotificationObserver, 3> m_updateObservers;
QAtomicInt m_needsUpdate = false;
};
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index ba7d12ce30..b312e033cd 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -223,12 +223,10 @@ NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurface
attrs << NSOpenGLPFAAllowOfflineRenderers;
}
- // FIXME: Pull this information out of the NSView
- QByteArray useLayer = qgetenv("QT_MAC_WANTS_LAYER");
- if (!useLayer.isEmpty() && useLayer.toInt() > 0) {
- // Disable the software rendering fallback. This makes compositing
- // OpenGL and raster NSViews using Core Animation layers possible.
- attrs << NSOpenGLPFANoRecovery;
+ if (qGuiApp->testAttribute(Qt::AA_UseSoftwareOpenGL)) {
+ // kCGLRendererGenericFloatID is the modern software renderer on macOS,
+ // as opposed to kCGLRendererGenericID, which is deprecated.
+ attrs << NSOpenGLPFARendererID << kCGLRendererGenericFloatID;
}
attrs << 0; // 0-terminate array
@@ -368,23 +366,6 @@ bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
[m_context makeCurrentContext];
if (surface->surface()->surfaceClass() == QSurface::Window) {
- // Disable high-resolution surfaces when using the software renderer, which has the
- // problem that the system silently falls back to a to using a low-resolution buffer
- // when a high-resolution buffer is requested. This is not detectable using the NSWindow
- // convertSizeToBacking and backingScaleFactor APIs. A typical result of this is that Qt
- // will display a quarter of the window content when running in a virtual machine.
- if (!m_didCheckForSoftwareContext) {
- // FIXME: This ensures we check only once per context,
- // but the context may be used for multiple surfaces.
- m_didCheckForSoftwareContext = true;
-
- const GLubyte* renderer = glGetString(GL_RENDERER);
- if (qstrcmp((const char *)renderer, "Apple Software Renderer") == 0) {
- NSView *view = static_cast<QCocoaWindow *>(surface)->m_view;
- [view setWantsBestResolutionOpenGLSurface:NO];
- }
- }
-
if (m_needsUpdate.fetchAndStoreRelaxed(false))
update();
}
@@ -413,11 +394,14 @@ bool QCocoaGLContext::setDrawable(QPlatformSurface *surface)
}
Q_ASSERT(surface->surface()->surfaceClass() == QSurface::Window);
- QNSView *view = qnsview_cast(static_cast<QCocoaWindow *>(surface)->view());
+ auto *cocoaWindow = static_cast<QCocoaWindow *>(surface);
+ QNSView *view = qnsview_cast(cocoaWindow->view());
if (view == m_context.view)
return true;
+ prepareDrawable(cocoaWindow);
+
// Setting the drawable may happen on a separate thread as a result of
// a call to makeCurrent, so we need to set up the observers before we
// associate the view with the context. That way we will guarantee that
@@ -460,6 +444,30 @@ bool QCocoaGLContext::setDrawable(QPlatformSurface *surface)
return true;
}
+void QCocoaGLContext::prepareDrawable(QCocoaWindow *platformWindow)
+{
+ // We generally want high-DPI GL surfaces, unless the user has explicitly disabled them
+ bool prefersBestResolutionOpenGLSurface = qt_mac_resolveOption(YES,
+ platformWindow->window(), "_q_mac_wantsBestResolutionOpenGLSurface",
+ "QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE");
+
+ auto *view = platformWindow->view();
+
+ // The only case we have to opt out ourselves is when using the Apple software renderer
+ // in combination with surface-backed views, as these together do not support high-DPI.
+ if (prefersBestResolutionOpenGLSurface) {
+ int rendererID = 0;
+ [m_context getValues:&rendererID forParameter:NSOpenGLContextParameterCurrentRendererID];
+ bool isSoftwareRenderer = (rendererID & kCGLRendererIDMatchingMask) == kCGLRendererGenericFloatID;
+ if (isSoftwareRenderer && !view.layer) {
+ qCInfo(lcQpaOpenGLContext) << "Disabling high resolution GL surface due to software renderer";
+ prefersBestResolutionOpenGLSurface = false;
+ }
+ }
+
+ view.wantsBestResolutionOpenGLSurface = prefersBestResolutionOpenGLSurface;
+}
+
// NSOpenGLContext is not re-entrant. Even when using separate contexts per thread,
// view, and window, calls into the API will still deadlock. For more information
// see https://openradar.appspot.com/37064579
@@ -491,6 +499,21 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
return;
}
+ if (m_context.view.layer) {
+ // Flushing an NSOpenGLContext will hit the screen immediately, ignoring
+ // any Core Animation transactions in place. This may result in major
+ // visual artifacts if the flush happens out of sync with the size
+ // of the layer, view, and window reflected by other parts of the UI,
+ // e.g. if the application flushes in the resize event or a timer during
+ // window resizing, instead of in the expose event.
+ auto *cocoaWindow = static_cast<QCocoaWindow *>(surface);
+ if (cocoaWindow->geometry().size() != cocoaWindow->m_exposedRect.size()) {
+ qCInfo(lcQpaOpenGLContext) << "Window exposed size does not match geometry (yet)."
+ << "Skipping flush to avoid visual artifacts.";
+ return;
+ }
+ }
+
QMutexLocker locker(&s_reentrancyMutex);
[m_context flushBuffer];
}
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index a957710a88..1dccf0621c 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -44,8 +44,7 @@
#include <QtCore/QList>
#include <qpa/qplatformmenu.h>
#include "qcocoamenuitem.h"
-
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenu));
+#include "qcocoansmenu.h"
QT_BEGIN_NAMESPACE
@@ -107,7 +106,7 @@ private:
void scheduleUpdate();
QList<QCocoaMenuItem *> m_menuItems;
- QT_MANGLE_NAMESPACE(QCocoaNSMenu) *m_nativeMenu;
+ QCocoaNSMenu *m_nativeMenu;
NSMenuItem *m_attachedItem;
int m_updateTimer;
bool m_enabled:1;
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index 30bff78a36..363defdd28 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -278,12 +278,11 @@ void QCocoaMenuBar::updateMenuBarImmediately()
// we still have to update the menubar.
if ((win->flags() & Qt::WindowType_Mask) != Qt::Tool)
return;
- typedef QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) AppDelegate;
NSApplication *app = [NSApplication sharedApplication];
- if (![app.delegate isKindOfClass:[AppDelegate class]])
+ if (![app.delegate isKindOfClass:[QCocoaApplicationDelegate class]])
return;
// We apply this logic _only_ during the startup.
- AppDelegate *appDelegate = app.delegate;
+ QCocoaApplicationDelegate *appDelegate = app.delegate;
if (!appDelegate.inLaunch)
return;
}
@@ -403,3 +402,4 @@ QCocoaWindow *QCocoaMenuBar::cocoaWindow() const
QT_END_NAMESPACE
+#include "moc_qcocoamenubar.cpp"
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
index ef9b2659d2..c35cf6d799 100644
--- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm
@@ -53,6 +53,7 @@
#include <QtGui/private/qcoregraphics_p.h>
#include <QtCore/QDebug>
+#include <QtCore/QRegExp>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoansmenu.h b/src/plugins/platforms/cocoa/qcocoansmenu.h
index 6cbb6e4a01..0c77e2f1aa 100644
--- a/src/plugins/platforms/cocoa/qcocoansmenu.h
+++ b/src/plugins/platforms/cocoa/qcocoansmenu.h
@@ -59,31 +59,20 @@ QT_FORWARD_DECLARE_CLASS(QCocoaMenu);
QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem);
@interface QT_MANGLE_NAMESPACE(QCocoaNSMenuDelegate) : NSObject <NSMenuDelegate>
-
+ (instancetype)sharedMenuDelegate;
-
-- (NSMenuItem *)findItemInMenu:(NSMenu *)menu
- forKey:(NSString *)key
- modifiers:(NSUInteger)modifiers;
-
+- (NSMenuItem *)findItemInMenu:(NSMenu *)menu forKey:(NSString *)key modifiers:(NSUInteger)modifiers;
@end
@interface QT_MANGLE_NAMESPACE(QCocoaNSMenu) : NSMenu
-
@property (readonly, nonatomic) QCocoaMenu *platformMenu;
-
- (instancetype)initWithPlatformMenu:(QCocoaMenu *)menu;
-
@end
@interface QT_MANGLE_NAMESPACE(QCocoaNSMenuItem) : NSMenuItem
-
@property (nonatomic) QCocoaMenuItem *platformMenuItem;
-
+ (instancetype)separatorItemWithPlatformMenuItem:(QCocoaMenuItem *)menuItem;
- (instancetype)initWithPlatformMenuItem:(QCocoaMenuItem *)menuItem;
- (instancetype)init;
-
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaNSMenu);
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.h b/src/plugins/platforms/cocoa/qcocoascreen.h
index 491af2fe9c..7ec9a2b5af 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.h
+++ b/src/plugins/platforms/cocoa/qcocoascreen.h
@@ -68,6 +68,7 @@ public:
qreal devicePixelRatio() const override { return m_devicePixelRatio; }
QSizeF physicalSize() const override { return m_physicalSize; }
QDpi logicalDpi() const override { return m_logicalDpi; }
+ QDpi logicalBaseDpi() const override { return m_logicalDpi; }
qreal refreshRate() const override { return m_refreshRate; }
QString name() const override { return m_name; }
QPlatformCursor *cursor() const override { return m_cursor; }
@@ -98,18 +99,18 @@ private:
static void add(CGDirectDisplayID displayId);
void remove();
- CGDirectDisplayID m_displayId = 0;
+ CGDirectDisplayID m_displayId = kCGNullDirectDisplay;
QRect m_geometry;
QRect m_availableGeometry;
QDpi m_logicalDpi;
- qreal m_refreshRate;
- int m_depth;
+ qreal m_refreshRate = 0;
+ int m_depth = 0;
QString m_name;
QImage::Format m_format;
QSizeF m_physicalSize;
QCocoaCursor *m_cursor;
- qreal m_devicePixelRatio;
+ qreal m_devicePixelRatio = 0;
CVDisplayLinkRef m_displayLink = nullptr;
dispatch_source_t m_displayLinkSource = nullptr;
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
index 16b11b3835..bd5c95b9d0 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.mm
+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
@@ -54,6 +54,23 @@
QT_BEGIN_NAMESPACE
+namespace CoreGraphics {
+ Q_NAMESPACE
+ enum DisplayChange {
+ Moved = kCGDisplayMovedFlag,
+ SetMain = kCGDisplaySetMainFlag,
+ SetMode = kCGDisplaySetModeFlag,
+ Added = kCGDisplayAddFlag,
+ Removed = kCGDisplayRemoveFlag,
+ Enabled = kCGDisplayEnabledFlag,
+ Disabled = kCGDisplayDisabledFlag,
+ Mirrored = kCGDisplayMirrorFlag,
+ UnMirrored = kCGDisplayUnMirrorFlag,
+ DesktopShapeChanged = kCGDisplayDesktopShapeChangedFlag
+ };
+ Q_ENUM_NS(DisplayChange)
+}
+
void QCocoaScreen::initializeScreens()
{
uint32_t displayCount = 0;
@@ -73,6 +90,10 @@ void QCocoaScreen::initializeScreens()
Q_UNUSED(userInfo);
+ qCDebug(lcQpaScreen).verbosity(0).nospace() << "Display reconfiguration"
+ << " (" << QFlags<CoreGraphics::DisplayChange>(flags) << ")"
+ << " for displayId=" << displayId;
+
QCocoaScreen *cocoaScreen = QCocoaScreen::get(displayId);
if ((flags & kCGDisplayAddFlag) || !cocoaScreen) {
@@ -98,16 +119,19 @@ void QCocoaScreen::initializeScreens()
}
cocoaScreen->updateProperties();
- qCInfo(lcQpaScreen) << "Reconfigured" << cocoaScreen;
+ qCInfo(lcQpaScreen).nospace() << "Reconfigured " <<
+ (primaryScreen() == cocoaScreen ? "primary " : "")
+ << cocoaScreen;
}
}, nullptr);
}
void QCocoaScreen::add(CGDirectDisplayID displayId)
{
+ const bool isPrimary = CGDisplayIsMain(displayId);
QCocoaScreen *cocoaScreen = new QCocoaScreen(displayId);
- qCInfo(lcQpaScreen) << "Adding" << cocoaScreen;
- QWindowSystemInterface::handleScreenAdded(cocoaScreen, CGDisplayIsMain(displayId));
+ qCInfo(lcQpaScreen).nospace() << "Adding " << (isPrimary ? "new primary " : "") << cocoaScreen;
+ QWindowSystemInterface::handleScreenAdded(cocoaScreen, isPrimary);
}
QCocoaScreen::QCocoaScreen(CGDirectDisplayID displayId)
@@ -126,7 +150,7 @@ void QCocoaScreen::cleanupScreens()
void QCocoaScreen::remove()
{
- m_displayId = 0; // Prevent stale references during removal
+ m_displayId = kCGNullDirectDisplay; // Prevent stale references during removal
// This may result in the application responding to QGuiApplication::screenRemoved
// by moving the window to another screen, either by setGeometry, or by setScreen.
@@ -139,6 +163,7 @@ void QCocoaScreen::remove()
// QCocoaWindow::windowDidChangeScreen. At that point the window will appear to have
// already changed its screen, but that's only true if comparing the Qt screens,
// not when comparing the NSScreens.
+ qCInfo(lcQpaScreen).nospace() << "Removing " << (primaryScreen() == this ? "current primary " : "") << this;
QWindowSystemInterface::handleScreenRemoved(this);
}
@@ -350,15 +375,6 @@ void QCocoaScreen::deliverUpdateRequests()
// it on the main thread yet, because the processing of the update request is taking
// too long, or because the update request was deferred due to window live resizing.
qDeferredDebug(screenUpdates) << ", " << framesAheadOfDelivery << " frame(s) ahead";
-
- // We skip the frame completely if we're live-resizing, to not put any extra
- // strain on the main thread runloop. Otherwise we assume we should push frames
- // as fast as possible, and hopefully the callback will be delivered on the
- // main thread just when the previous finished.
- if (qt_apple_sharedApplication().keyWindow.inLiveResize) {
- qDeferredDebug(screenUpdates) << "; waiting for main thread to catch up";
- return;
- }
}
qDeferredDebug(screenUpdates) << "; signaling dispatch source";
@@ -551,10 +567,10 @@ QPixmap QCocoaScreen::grabWindow(WId view, int x, int y, int width, int height)
*/
QCocoaScreen *QCocoaScreen::primaryScreen()
{
- auto screen = static_cast<QCocoaScreen *>(QGuiApplication::primaryScreen()->handle());
- Q_ASSERT_X(screen == get(CGMainDisplayID()), "QCocoaScreen",
- "The application's primary screen should always be in sync with the main display");
- return screen;
+ // Note: The primary screen that Qt knows about may not match the current CGMainDisplayID()
+ // if macOS has not yet been able to inform us that the main display has changed, but we
+ // will update the primary screen accordingly once the reconfiguration callback comes in.
+ return static_cast<QCocoaScreen *>(QGuiApplication::primaryScreen()->handle());
}
QList<QPlatformScreen*> QCocoaScreen::virtualSiblings() const
@@ -596,7 +612,7 @@ NSScreen *QCocoaScreen::nativeScreen() const
QCFType<CFUUIDRef> uuid = CGDisplayCreateUUIDFromDisplayID(m_displayId);
for (NSScreen *screen in [NSScreen screens]) {
- if (CGDisplayCreateUUIDFromDisplayID(screen.qt_displayId) == uuid)
+ if (QCFType<CFUUIDRef>(CGDisplayCreateUUIDFromDisplayID(screen.qt_displayId)) == uuid)
return screen;
}
@@ -638,6 +654,7 @@ QDebug operator<<(QDebug debug, const QCocoaScreen *screen)
debug << ", geometry=" << screen->geometry();
debug << ", dpr=" << screen->devicePixelRatio();
debug << ", name=" << screen->name();
+ debug << ", displayId=" << screen->m_displayId;
debug << ", native=" << screen->nativeScreen();
}
debug << ')';
@@ -645,6 +662,8 @@ QDebug operator<<(QDebug debug, const QCocoaScreen *screen)
}
#endif // !QT_NO_DEBUG_STREAM
+#include "qcocoascreen.moc"
+
QT_END_NAMESPACE
@implementation NSScreen (QtExtras)
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 9b6dc94d33..cb25bd7d81 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -52,6 +52,8 @@
@property (class, strong, readonly) NSColor *unemphasizedSelectedTextColor NS_AVAILABLE_MAC(10_14);
@property (class, strong, readonly) NSColor *unemphasizedSelectedContentBackgroundColor NS_AVAILABLE_MAC(10_14);
@property (class, strong, readonly) NSArray<NSColor *> *alternatingContentBackgroundColors NS_AVAILABLE_MAC(10_14);
+// Missing from non-Mojave SDKs, even if introduced in 10.10
+@property (class, strong, readonly) NSColor *linkColor NS_AVAILABLE_MAC(10_10);
@end
#endif
@@ -111,6 +113,8 @@ QPalette * qt_mac_createSystemPalette()
palette->setBrush(QPalette::ToolTipBase, qt_mac_toQBrush([NSColor controlColor]));
+ palette->setColor(QPalette::Normal, QPalette::Link, qt_mac_toQColor([NSColor linkColor]));
+
return palette;
}
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index db64702b8d..a5b42ac4e3 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -80,6 +80,8 @@
#include <qimagewriter.h>
#include <qdebug.h>
+#include <QtCore/private/qcore_mac_p.h>
+
#include "qcocoamenu.h"
#include "qt_mac_p.h"
@@ -92,8 +94,6 @@
QT_USE_NAMESPACE
-@class QT_MANGLE_NAMESPACE(QNSImageView);
-
@interface QT_MANGLE_NAMESPACE(QNSStatusItem) : NSObject <NSUserNotificationCenterDelegate>
@property (nonatomic, assign) QCocoaMenu *menu;
@property (nonatomic, assign) QIcon icon;
@@ -104,12 +104,13 @@ QT_USE_NAMESPACE
- (void)doubleClickSelector:(id)sender;
@end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSStatusItem);
+
@interface QT_MANGLE_NAMESPACE(QNSImageView) : NSImageView
@property (nonatomic, assign) BOOL down;
-@property (nonatomic, assign) QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
+@property (nonatomic, assign) QNSStatusItem *parent;
@end
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSStatusItem);
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSImageView);
QT_BEGIN_NAMESPACE
@@ -360,7 +361,7 @@ QT_END_NAMESPACE
@implementation QNSStatusItem {
QCocoaSystemTrayIcon *systray;
NSStatusItem *item;
- QT_MANGLE_NAMESPACE(QNSImageView) *imageCell;
+ QNSImageView *imageCell;
}
@synthesize menu = menu;
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h
index 788b616e78..a00cbdfea3 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.h
+++ b/src/plugins/platforms/cocoa/qcocoatheme.h
@@ -43,8 +43,6 @@
#include <QtCore/QHash>
#include <qpa/qplatformtheme.h>
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver));
-
#include <QtCore/private/qcore_mac_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index c6ce6e6819..fef72bc496 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -161,7 +161,6 @@ public:
Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
- Q_NOTIFICATION_HANDLER(NSWindowDidChangeBackingPropertiesNotification) void windowDidChangeBackingProperties();
Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
bool windowShouldClose();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index db4bc12210..15329ca708 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1262,17 +1262,6 @@ void QCocoaWindow::windowDidChangeScreen()
currentScreen->requestUpdate();
}
}
-/*
- The window's backing scale factor or color space has changed.
-*/
-void QCocoaWindow::windowDidChangeBackingProperties()
-{
- // Ideally we would plumb this thought QPA in a way that lets clients
- // invalidate their own caches, and recreate QBackingStore. For now we
- // trigger an expose, and let QCocoaBackingStore deal with its own
- // buffer invalidation.
- [m_view setNeedsDisplay:YES];
-}
void QCocoaWindow::windowWillClose()
{
@@ -1286,14 +1275,11 @@ void QCocoaWindow::windowWillClose()
bool QCocoaWindow::windowShouldClose()
{
qCDebug(lcQpaWindow) << "QCocoaWindow::windowShouldClose" << window();
- // This callback should technically only determine if the window
- // should (be allowed to) close, but since our QPA API to determine
- // that also involves actually closing the window we do both at the
- // same time, instead of doing the latter in windowWillClose.
- bool accepted = false;
- QWindowSystemInterface::handleCloseEvent(window(), &accepted);
- QWindowSystemInterface::flushWindowSystemEvents();
- return accepted;
+ // This callback should technically only determine if the window
+ // should (be allowed to) close, but since our QPA API to determine
+ // that also involves actually closing the window we do both at the
+ // same time, instead of doing the latter in windowWillClose.
+ return QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(window());
}
// ----------------------------- QPA forwarding -----------------------------
@@ -1526,17 +1512,6 @@ bool QCocoaWindow::updatesWithDisplayLink() const
void QCocoaWindow::deliverUpdateRequest()
{
- // Don't send update requests for views that need display, as the update
- // request doesn't carry any information about dirty rects, so the app
- // may end up painting a smaller region than required. (For some reason
- // the layer and view's needsDisplay status isn't always in sync, even if
- // the view is layer-backed, not layer-hosted, so we check both).
- if (m_view.layer.needsDisplay || m_view.needsDisplay) {
- qCDebug(lcQpaDrawing) << "View needs display, deferring update request for" << window();
- requestUpdate();
- return;
- }
-
qCDebug(lcQpaDrawing) << "Delivering update request to" << window();
QPlatformWindow::deliverUpdateRequest();
}
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index b40dfe0d14..74d0735b4c 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -51,37 +51,30 @@ class QCocoaGLContext;
class QPointF;
QT_END_NAMESPACE
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
-
@interface QT_MANGLE_NAMESPACE(QNSView) : NSView
-
@property (nonatomic, retain) NSCursor *cursor;
-
- (instancetype)initWithCocoaWindow:(QCocoaWindow *)platformWindow;
-
- (void)convertFromScreen:(NSPoint)mouseLocation toWindowPoint:(QPointF *)qtWindowPoint andScreenPoint:(QPointF *)qtScreenPoint;
-
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (MouseAPI)
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
+
+@interface QNSView (MouseAPI)
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent;
- (void)resetMouseButtons;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (KeysAPI)
+@interface QNSView (KeysAPI)
+ (Qt::KeyboardModifiers)convertKeyModifiers:(ulong)modifierFlags;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (ComplexTextAPI)
+@interface QNSView (ComplexTextAPI)
- (void)unmarkText;
- (void)cancelComposingText;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (QtExtras)
+@interface QNSView (QtExtras)
@property (nonatomic, readonly) QCocoaWindow *platformWindow;
@end
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
-
#endif //QNSVIEW_H
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 5309449dce..a6e5ca5f7b 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -66,13 +66,13 @@
#include "qcocoaintegration.h"
// Private interface
-@interface QT_MANGLE_NAMESPACE(QNSView) ()
+@interface QNSView ()
- (BOOL)isTransparentForUserInput;
@property (assign) NSView* previousSuperview;
@property (assign) NSWindow* previousWindow;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Drawing) <CALayerDelegate>
+@interface QNSView (Drawing) <CALayerDelegate>
- (void)initDrawing;
@end
@@ -84,7 +84,9 @@
- (void)cursorUpdate:(NSEvent *)theEvent;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Mouse)
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSViewMouseMoveHelper);
+
+@interface QNSView (Mouse)
- (void)initMouse;
- (NSPoint)screenMousePoint:(NSEvent *)theEvent;
- (void)mouseMovedImpl:(NSEvent *)theEvent;
@@ -92,28 +94,28 @@
- (void)mouseExitedImpl:(NSEvent *)theEvent;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Touch)
+@interface QNSView (Touch)
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Tablet)
+@interface QNSView (Tablet)
- (bool)handleTabletEvent:(NSEvent *)theEvent;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Gestures)
+@interface QNSView (Gestures)
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Dragging)
+@interface QNSView (Dragging)
-(void)registerDragTypes;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Keys)
+@interface QNSView (Keys)
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (ComplexText) <NSTextInputClient>
+@interface QNSView (ComplexText) <NSTextInputClient>
- (void)textInputContextKeyboardSelectionDidChangeNotification:(NSNotification *)textInputContextKeyboardSelectionDidChangeNotification;
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) {
+@implementation QNSView {
QPointer<QCocoaWindow> m_platformWindow;
Qt::MouseButtons m_buttons;
Qt::MouseButtons m_acceptedMouseDowns;
@@ -125,7 +127,7 @@
bool m_sendUpAsRightButton;
Qt::KeyboardModifiers m_currentWheelModifiers;
NSString *m_inputSource;
- QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) *m_mouseMoveHelper;
+ QNSViewMouseMoveHelper *m_mouseMoveHelper;
bool m_resendKeyEvent;
bool m_scrolling;
bool m_updatingDrag;
@@ -379,7 +381,7 @@
// -----------------------------------------------------
-@implementation QT_MANGLE_NAMESPACE(QNSView) (QtExtras)
+@implementation QNSView (QtExtras)
- (QCocoaWindow*)platformWindow
{
diff --git a/src/plugins/platforms/cocoa/qnsview_accessibility.mm b/src/plugins/platforms/cocoa/qnsview_accessibility.mm
index 32ec0b74d4..7041e14da7 100644
--- a/src/plugins/platforms/cocoa/qnsview_accessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsview_accessibility.mm
@@ -47,7 +47,7 @@
#import <AppKit/NSAccessibility.h>
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Accessibility)
+@implementation QNSView (Accessibility)
- (id)childAccessibleElement
{
diff --git a/src/plugins/platforms/cocoa/qnsview_complextext.mm b/src/plugins/platforms/cocoa/qnsview_complextext.mm
index 6ff9b26ca4..5926840cf3 100644
--- a/src/plugins/platforms/cocoa/qnsview_complextext.mm
+++ b/src/plugins/platforms/cocoa/qnsview_complextext.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (ComplexTextAPI)
+@implementation QNSView (ComplexTextAPI)
- (void)cancelComposingText
{
@@ -80,7 +80,7 @@
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (ComplexText)
+@implementation QNSView (ComplexText)
- (void)insertNewline:(id)sender
{
diff --git a/src/plugins/platforms/cocoa/qnsview_dragging.mm b/src/plugins/platforms/cocoa/qnsview_dragging.mm
index 41b96b2df6..650612e7ff 100644
--- a/src/plugins/platforms/cocoa/qnsview_dragging.mm
+++ b/src/plugins/platforms/cocoa/qnsview_dragging.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Dragging)
+@implementation QNSView (Dragging)
-(void)registerDragTypes
{
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index d2e6f848a0..2fd63fad67 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -39,24 +39,11 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Drawing)
+@implementation QNSView (Drawing)
- (void)initDrawing
{
- self.wantsLayer = [self layerExplicitlyRequested]
- || [self shouldUseMetalLayer]
- || [self layerEnabledByMacOS];
-
- // Enable high-DPI OpenGL for retina displays. Enabling has the side
- // effect that Cocoa will start calling glViewport(0, 0, width, height),
- // overriding any glViewport calls in application code. This is usually not a
- // problem, except if the application wants to have a "custom" viewport.
- // (like the hellogl example)
- if (m_platformWindow->window()->supportsOpenGL()) {
- self.wantsBestResolutionOpenGLSurface = qt_mac_resolveOption(YES, m_platformWindow->window(),
- "_q_mac_wantsBestResolutionOpenGLSurface", "QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE");
- // See also QCocoaGLContext::makeCurrent for software renderer workarounds.
- }
+ [self updateLayerBacking];
}
- (BOOL)isOpaque
@@ -71,22 +58,13 @@
return YES;
}
-- (void)drawRect:(NSRect)dirtyRect
-{
- Q_UNUSED(dirtyRect);
-
- if (!m_platformWindow)
- return;
+// ----------------------- Layer setup -----------------------
- QRegion exposedRegion;
- const NSRect *dirtyRects;
- NSInteger numDirtyRects;
- [self getRectsBeingDrawn:&dirtyRects count:&numDirtyRects];
- for (int i = 0; i < numDirtyRects; ++i)
- exposedRegion += QRectF::fromCGRect(dirtyRects[i]).toRect();
-
- qCDebug(lcQpaDrawing) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion;
- m_platformWindow->handleExposeEvent(exposedRegion);
+- (void)updateLayerBacking
+{
+ self.wantsLayer = [self layerEnabledByMacOS]
+ || [self layerExplicitlyRequested]
+ || [self shouldUseMetalLayer];
}
- (BOOL)layerEnabledByMacOS
@@ -123,40 +101,81 @@
return surfaceType == QWindow::MetalSurface || surfaceType == QWindow::VulkanSurface;
}
+/*
+ This method is called by AppKit when layer-backing is requested by
+ setting wantsLayer too YES (via -[NSView _updateLayerBackedness]),
+ or in cases where AppKit itself decides that a view should be
+ layer-backed.
+
+ Note however that some code paths in AppKit will not go via this
+ method for creating the backing layer, and will instead create the
+ layer manually, and just call setLayer. An example of this is when
+ an NSOpenGLContext is attached to a view, in which case AppKit will
+ create a new layer in NSOpenGLContextSetLayerOnViewIfNecessary.
+
+ For this reason we leave the implementation of this override as
+ minimal as possible, only focusing on creating the appropriate
+ layer type, and then leave it up to setLayer to do the work of
+ making sure the layer is set up correctly.
+*/
- (CALayer *)makeBackingLayer
{
if ([self shouldUseMetalLayer]) {
// Check if Metal is supported. If it isn't then it's most likely
// too late at this point and the QWindow will be non-functional,
// but we can at least print a warning.
- if (![MTLCreateSystemDefaultDevice() autorelease]) {
- qWarning() << "QWindow initialization error: Metal is not supported";
- return [super makeBackingLayer];
+ if ([MTLCreateSystemDefaultDevice() autorelease]) {
+ return [CAMetalLayer layer];
+ } else {
+ qCWarning(lcQpaDrawing) << "Failed to create QWindow::MetalSurface."
+ << "Metal is not supported by any of the GPUs in this system.";
}
-
- CAMetalLayer *layer = [CAMetalLayer layer];
-
- // Set the contentsScale for the layer. This is normally done in
- // viewDidChangeBackingProperties, however on startup that function
- // is called before the layer is created here. The layer's drawableSize
- // is updated from layoutSublayersOfLayer as usual.
- layer.contentsScale = self.window.backingScaleFactor;
-
- return layer;
}
return [super makeBackingLayer];
}
+/*
+ This method is called by AppKit whenever the view is asked to change
+ its layer, which can happen both as a result of enabling layer-backing,
+ or when a layer is set explicitly. The latter can happen both when a
+ view is layer-hosting, or when AppKit internals are switching out the
+ layer-backed view, as described above for makeBackingLayer.
+*/
- (void)setLayer:(CALayer *)layer
{
- qCDebug(lcQpaDrawing) << "Making" << self << "layer-backed with" << layer
- << "due to being" << ([self layerExplicitlyRequested] ? "explicitly requested"
+ qCDebug(lcQpaDrawing) << "Making" << self
+ << (self.wantsLayer ? "layer-backed" : "layer-hosted")
+ << "with" << layer << "due to being" << ([self layerExplicitlyRequested] ? "explicitly requested"
: [self shouldUseMetalLayer] ? "needed by surface type" : "enabled by macOS");
+
+ if (layer.delegate && layer.delegate != self) {
+ qCWarning(lcQpaDrawing) << "Layer already has delegate" << layer.delegate
+ << "This delegate is responsible for all view updates for" << self;
+ } else {
+ layer.delegate = self;
+ }
+
[super setLayer:layer];
- layer.delegate = self;
+
+ // When adding a view to a view hierarchy the backing properties will change
+ // which results in updating the contents scale, but in case of switching the
+ // layer on a view that's already in a view hierarchy we need to manually ensure
+ // the scale is up to date.
+ if (self.superview)
+ [self updateLayerContentsScale];
+
+ if (self.opaque && lcQpaDrawing().isDebugEnabled()) {
+ // If the view claims to be opaque we expect it to fill the entire
+ // layer with content, in which case we want to detect any areas
+ // where it doesn't.
+ layer.backgroundColor = NSColor.magentaColor.CGColor;
+ }
+
}
+// ----------------------- Layer updates -----------------------
+
- (NSViewLayerContentsRedrawPolicy)layerContentsRedrawPolicy
{
// We need to set this explicitly since the super implementation
@@ -164,64 +183,106 @@
return NSViewLayerContentsRedrawDuringViewResize;
}
-#if 0 // Disabled until we enable lazy backingstore resizing
- (NSViewLayerContentsPlacement)layerContentsPlacement
{
- // Always place the layer at top left without any automatic scaling,
- // so that we can re-use larger layers when resizing a window down.
+ // Always place the layer at top left without any automatic scaling.
+ // This will highlight situations where we're missing content for the
+ // layer by not responding to the displayLayer: request synchronously.
+ // It also allows us to re-use larger layers when resizing a window down.
return NSViewLayerContentsPlacementTopLeft;
}
-#endif
-- (void)updateMetalLayerDrawableSize:(CAMetalLayer *)layer
+- (void)viewDidChangeBackingProperties
{
- CGSize drawableSize = layer.bounds.size;
- drawableSize.width *= layer.contentsScale;
- drawableSize.height *= layer.contentsScale;
- layer.drawableSize = drawableSize;
+ qCDebug(lcQpaDrawing) << "Backing properties changed for" << self;
+
+ if (self.layer)
+ [self updateLayerContentsScale];
+
+ // Ideally we would plumb this situation through QPA in a way that lets
+ // clients invalidate their own caches, recreate QBackingStore, etc.
+ // For now we trigger an expose, and let QCocoaBackingStore deal with
+ // buffer invalidation internally.
+ [self setNeedsDisplay:YES];
}
-- (void)layoutSublayersOfLayer:(CALayer *)layer
+- (void)updateLayerContentsScale
{
- if ([layer isKindOfClass:CAMetalLayer.class])
- [self updateMetalLayerDrawableSize:static_cast<CAMetalLayer* >(layer)];
+ // We expect clients to fill the layer with retina aware content,
+ // based on the devicePixelRatio of the QWindow, so we set the
+ // layer's content scale to match that. By going via devicePixelRatio
+ // instead of applying the NSWindow's backingScaleFactor, we also take
+ // into account OpenGL views with wantsBestResolutionOpenGLSurface set
+ // to NO. In this case the window will have a backingScaleFactor of 2,
+ // but the QWindow will have a devicePixelRatio of 1.
+ auto devicePixelRatio = m_platformWindow->devicePixelRatio();
+ qCDebug(lcQpaDrawing) << "Updating" << self.layer << "content scale to" << devicePixelRatio;
+ self.layer.contentsScale = devicePixelRatio;
}
-- (void)displayLayer:(CALayer *)layer
+/*
+ This method is called by AppKit to determine whether it should update
+ the contentScale of the layer to match the window backing scale.
+
+ We always return NO since we're updating the contents scale manually.
+*/
+- (BOOL)layer:(CALayer *)layer shouldInheritContentsScale:(CGFloat)scale fromWindow:(NSWindow *)window
{
- if (!NSThread.isMainThread) {
- // Qt is calling AppKit APIs such as -[NSOpenGLContext setView:] on secondary threads,
- // which we shouldn't do. This may result in AppKit (wrongly) triggering a display on
- // the thread where we made the call, so block it here and defer to the main thread.
- qCWarning(lcQpaDrawing) << "Display non non-main thread! Deferring to main thread";
- dispatch_async(dispatch_get_main_queue(), ^{ self.needsDisplay = YES; });
- return;
- }
+ Q_UNUSED(layer); Q_UNUSED(scale); Q_UNUSED(window);
+ return NO;
+}
- Q_ASSERT(layer == self.layer);
+// ----------------------- Draw callbacks -----------------------
+
+/*
+ This method is called by AppKit for the non-layer case, where we are
+ drawing into the NSWindow's surface.
+*/
+- (void)drawRect:(NSRect)dirtyBoundingRect
+{
+ Q_ASSERT_X(!self.layer, "QNSView",
+ "The drawRect code path should not be hit when we are layer backed");
if (!m_platformWindow)
return;
- qCDebug(lcQpaDrawing) << "[QNSView displayLayer]" << m_platformWindow->window();
+ QRegion exposedRegion;
+ const NSRect *dirtyRects;
+ NSInteger numDirtyRects;
+ [self getRectsBeingDrawn:&dirtyRects count:&numDirtyRects];
+ for (int i = 0; i < numDirtyRects; ++i)
+ exposedRegion += QRectF::fromCGRect(dirtyRects[i]).toRect();
- // FIXME: Find out if there's a way to resolve the dirty rect like in drawRect:
- m_platformWindow->handleExposeEvent(QRectF::fromCGRect(self.bounds).toRect());
+ if (exposedRegion.isEmpty())
+ exposedRegion = QRectF::fromCGRect(dirtyBoundingRect).toRect();
+
+ qCDebug(lcQpaDrawing) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion;
+ m_platformWindow->handleExposeEvent(exposedRegion);
}
-- (void)viewDidChangeBackingProperties
+/*
+ This method is called by AppKit when we are layer-backed, where
+ we are drawing into the layer.
+*/
+- (void)displayLayer:(CALayer *)layer
{
- CALayer *layer = self.layer;
- if (!layer)
- return;
+ Q_ASSERT_X(self.layer && layer == self.layer, "QNSView",
+ "The displayLayer code path should only be hit for our own layer");
- layer.contentsScale = self.window.backingScaleFactor;
+ if (!m_platformWindow)
+ return;
- // Metal layers must be manually updated on e.g. screen change
- if ([layer isKindOfClass:CAMetalLayer.class]) {
- [self updateMetalLayerDrawableSize:static_cast<CAMetalLayer* >(layer)];
- [self setNeedsDisplay:YES];
+ if (!NSThread.isMainThread) {
+ // Qt is calling AppKit APIs such as -[NSOpenGLContext setView:] on secondary threads,
+ // which we shouldn't do. This may result in AppKit (wrongly) triggering a display on
+ // the thread where we made the call, so block it here and defer to the main thread.
+ qCWarning(lcQpaDrawing) << "Display non non-main thread! Deferring to main thread";
+ dispatch_async(dispatch_get_main_queue(), ^{ self.needsDisplay = YES; });
+ return;
}
+
+ qCDebug(lcQpaDrawing) << "[QNSView displayLayer]" << m_platformWindow->window();
+ m_platformWindow->handleExposeEvent(QRectF::fromCGRect(self.bounds).toRect());
}
@end
diff --git a/src/plugins/platforms/cocoa/qnsview_gestures.mm b/src/plugins/platforms/cocoa/qnsview_gestures.mm
index 61d551ee0e..a80261fd6a 100644
--- a/src/plugins/platforms/cocoa/qnsview_gestures.mm
+++ b/src/plugins/platforms/cocoa/qnsview_gestures.mm
@@ -43,7 +43,7 @@
Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Gestures)
+@implementation QNSView (Gestures)
- (bool)handleGestureAsBeginEnd:(NSEvent *)event
{
@@ -70,7 +70,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
if ([self handleGestureAsBeginEnd:event])
return;
- qCDebug(lcQpaGestures) << "magnifyWithEvent" << [event magnification] << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaGestures) << "magnifyWithEvent" << [event magnification] << "from device" << Qt::hex << [event deviceID];
const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint;
QPointF screenPoint;
@@ -85,7 +85,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
return;
static bool zoomIn = true;
- qCDebug(lcQpaGestures) << "smartMagnifyWithEvent" << zoomIn << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaGestures) << "smartMagnifyWithEvent" << zoomIn << "from device" << Qt::hex << [event deviceID];
const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint;
QPointF screenPoint;
@@ -116,7 +116,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
if (!m_platformWindow)
return;
- qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY] << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaGestures) << "swipeWithEvent" << [event deltaX] << [event deltaY] << "from device" << Qt::hex << [event deviceID];
const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint;
QPointF screenPoint;
@@ -145,7 +145,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
QPointF windowPoint;
QPointF screenPoint;
[self convertFromScreen:[self screenMousePoint:event] toWindowPoint:&windowPoint andScreenPoint:&screenPoint];
- qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaGestures) << "beginGestureWithEvent @" << windowPoint << "from device" << Qt::hex << [event deviceID];
QWindowSystemInterface::handleGestureEvent(m_platformWindow->window(), QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), timestamp, Qt::BeginNativeGesture,
windowPoint, screenPoint);
}
@@ -155,7 +155,7 @@ Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
if (!m_platformWindow)
return;
- qCDebug(lcQpaGestures) << "endGestureWithEvent" << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaGestures) << "endGestureWithEvent" << "from device" << Qt::hex << [event deviceID];
const NSTimeInterval timestamp = [event timestamp];
QPointF windowPoint;
QPointF screenPoint;
diff --git a/src/plugins/platforms/cocoa/qnsview_keys.mm b/src/plugins/platforms/cocoa/qnsview_keys.mm
index ad751279bb..847adca207 100644
--- a/src/plugins/platforms/cocoa/qnsview_keys.mm
+++ b/src/plugins/platforms/cocoa/qnsview_keys.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (KeysAPI)
+@implementation QNSView (KeysAPI)
+ (Qt::KeyboardModifiers)convertKeyModifiers:(ulong)modifierFlags
{
@@ -60,7 +60,7 @@
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Keys)
+@implementation QNSView (Keys)
- (int)convertKeyCode:(QChar)keyChar
{
diff --git a/src/plugins/platforms/cocoa/qnsview_menus.mm b/src/plugins/platforms/cocoa/qnsview_menus.mm
index f0489552aa..a55fd97eb7 100644
--- a/src/plugins/platforms/cocoa/qnsview_menus.mm
+++ b/src/plugins/platforms/cocoa/qnsview_menus.mm
@@ -53,11 +53,11 @@ static bool selectorIsCutCopyPaste(SEL selector)
|| selector == @selector(selectAll:));
}
-@interface QT_MANGLE_NAMESPACE(QNSView) (Menus)
+@interface QNSView (Menus)
- (void)qt_itemFired:(QCocoaNSMenuItem *)item;
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Menus)
+@implementation QNSView (Menus)
- (BOOL)validateMenuItem:(NSMenuItem*)item
{
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm
index 3a5a074264..9e2761f850 100644
--- a/src/plugins/platforms/cocoa/qnsview_mouse.mm
+++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm
@@ -55,7 +55,7 @@
interact with the responder chain by e.g. calling super if Qt does not
accept the mouse event
*/
-@implementation QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) {
+@implementation QNSViewMouseMoveHelper {
QNSView *view;
}
@@ -89,7 +89,7 @@
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (MouseAPI)
+@implementation QNSView (MouseAPI)
- (void)resetMouseButtons
{
@@ -178,7 +178,7 @@
}
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Mouse)
+@implementation QNSView (Mouse)
- (void)initMouse
{
@@ -193,7 +193,7 @@
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, m_platformWindow->window(),
"_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
- m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
+ m_mouseMoveHelper = [[QNSViewMouseMoveHelper alloc] initWithView:self];
NSUInteger trackingOptions = NSTrackingActiveInActiveApp
| NSTrackingMouseEnteredAndExited | NSTrackingCursorUpdate;
@@ -222,6 +222,11 @@
return NO;
if ([self isTransparentForUserInput])
return NO;
+ QPointF windowPoint;
+ QPointF screenPoint;
+ [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint: &windowPoint andScreenPoint: &screenPoint];
+ if (!qt_window_private(m_platformWindow->window())->allowClickThrough(screenPoint.toPoint()))
+ return NO;
return YES;
}
diff --git a/src/plugins/platforms/cocoa/qnsview_tablet.mm b/src/plugins/platforms/cocoa/qnsview_tablet.mm
index 43b0aa0960..ba1fa55892 100644
--- a/src/plugins/platforms/cocoa/qnsview_tablet.mm
+++ b/src/plugins/platforms/cocoa/qnsview_tablet.mm
@@ -54,7 +54,7 @@ struct QCocoaTabletDeviceData
typedef QHash<uint, QCocoaTabletDeviceData> QCocoaTabletDeviceDataHash;
Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Tablet)
+@implementation QNSView (Tablet)
- (bool)handleTabletEvent:(NSEvent *)theEvent
{
diff --git a/src/plugins/platforms/cocoa/qnsview_touch.mm b/src/plugins/platforms/cocoa/qnsview_touch.mm
index e789213f70..8dfae27c63 100644
--- a/src/plugins/platforms/cocoa/qnsview_touch.mm
+++ b/src/plugins/platforms/cocoa/qnsview_touch.mm
@@ -41,7 +41,7 @@
Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Touch)
+@implementation QNSView (Touch)
- (bool)shouldSendSingleTouch
{
@@ -60,7 +60,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
- qCDebug(lcQpaTouch) << "touchesBeganWithEvent" << points << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaTouch) << "touchesBeganWithEvent" << points << "from device" << Qt::hex << [event deviceID];
QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points);
}
@@ -71,7 +71,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
- qCDebug(lcQpaTouch) << "touchesMovedWithEvent" << points << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaTouch) << "touchesMovedWithEvent" << points << "from device" << Qt::hex << [event deviceID];
QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points);
}
@@ -82,7 +82,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
- qCDebug(lcQpaTouch) << "touchesEndedWithEvent" << points << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaTouch) << "touchesEndedWithEvent" << points << "from device" << Qt::hex << [event deviceID];
QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points);
}
@@ -93,7 +93,7 @@ Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
const NSTimeInterval timestamp = [event timestamp];
const QList<QWindowSystemInterface::TouchPoint> points = QCocoaTouch::getCurrentTouchPointList(event, [self shouldSendSingleTouch]);
- qCDebug(lcQpaTouch) << "touchesCancelledWithEvent" << points << "from device" << hex << [event deviceID];
+ qCDebug(lcQpaTouch) << "touchesCancelledWithEvent" << points << "from device" << Qt::hex << [event deviceID];
QWindowSystemInterface::handleTouchEvent(m_platformWindow->window(), timestamp * 1000, QCocoaTouch::getTouchDevice(QTouchDevice::TouchPad, [event deviceID]), points);
}
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
index 68cb270457..6b4e110af2 100644
--- a/src/plugins/platforms/cocoa/qnswindow.mm
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -255,8 +255,8 @@ static bool isMouseEvent(NSEvent *ev)
- (NSColor *)backgroundColor
{
- return self.styleMask & NSWindowStyleMaskTexturedBackground ?
- [super backgroundColor] : [NSColor clearColor];
+ return self.styleMask == NSWindowStyleMaskBorderless ?
+ [NSColor clearColor] : [super backgroundColor];
}
- (void)sendEvent:(NSEvent*)theEvent
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac_p.h b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
index 3d94227ae4..6a1ed2e263 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac_p.h
+++ b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
@@ -64,11 +64,7 @@
#include "qpaintengine_mac_p.h"
-#ifdef __OBJC__
-@class NSPrintInfo;
-#else
-typedef void NSPrintInfo;
-#endif
+Q_FORWARD_DECLARE_OBJC_CLASS(NSPrintInfo);
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro
index 9764272632..6e73bd14f9 100644
--- a/src/plugins/platforms/direct2d/direct2d.pro
+++ b/src/plugins/platforms/direct2d/direct2d.pro
@@ -8,8 +8,8 @@ QT += \
qtConfig(accessibility): QT += accessibility_support-private
qtConfig(vulkan): QT += vulkan_support-private
-LIBS += -ldwmapi -lversion -lgdi32
-QMAKE_USE_PRIVATE += dwrite_1 d2d1_1 d3d11_1 dxgi1_2
+LIBS += -ldwmapi -lversion
+QMAKE_USE_PRIVATE += gdi32 dwrite_1 d2d1_1 d3d11_1 dxgi1_2
include(../windows/windows.pri)
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
index f72ea2b038..6d4d47e3da 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbackingstore.h
@@ -48,7 +48,7 @@ class QWindowsDirect2DWindow;
class QWindowsDirect2DBackingStore : public QPlatformBackingStore
{
- Q_DISABLE_COPY(QWindowsDirect2DBackingStore)
+ Q_DISABLE_COPY_MOVE(QWindowsDirect2DBackingStore)
public:
QWindowsDirect2DBackingStore(QWindow *window);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h
index d8a8a49aec..8fd683106d 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dbitmap.h
@@ -59,7 +59,7 @@ class QColor;
class QWindowsDirect2DBitmap
{
Q_DECLARE_PRIVATE(QWindowsDirect2DBitmap)
- Q_DISABLE_COPY(QWindowsDirect2DBitmap)
+ Q_DISABLE_COPY_MOVE(QWindowsDirect2DBitmap)
public:
QWindowsDirect2DBitmap();
QWindowsDirect2DBitmap(ID2D1Bitmap1 *bitmap, ID2D1DeviceContext *dc);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h
index aee0eb867d..a28c674671 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2ddevicecontext.h
@@ -91,7 +91,7 @@ private:
};
class QWindowsDirect2DDeviceContextSuspender {
- Q_DISABLE_COPY(QWindowsDirect2DDeviceContextSuspender)
+ Q_DISABLE_COPY_MOVE(QWindowsDirect2DDeviceContextSuspender)
QWindowsDirect2DDeviceContext *m_dc;
public:
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
index 86c863ec50..e074f87eb4 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.cpp
@@ -51,22 +51,11 @@
#include <QtCore/qversionnumber.h>
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/qpa/qwindowsysteminterface.h>
-#include <QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h>
#include <QVarLengthArray>
QT_BEGIN_NAMESPACE
-class QWindowsDirect2DEventDispatcher : public QWindowsGuiEventDispatcher
-{
-public:
- QWindowsDirect2DEventDispatcher(QObject *parent = nullptr)
- : QWindowsGuiEventDispatcher(parent)
- {
- uninstallMessageHook(); // ### Workaround for QTBUG-42428
- }
-};
-
class QWindowsDirect2DIntegrationPrivate
{
public:
@@ -91,7 +80,7 @@ static QVersionNumber systemD2DVersion()
if (VerQueryValue(info.constData(), __TEXT("\\"),
reinterpret_cast<void **>(&fi), &size) && size) {
- const VS_FIXEDFILEINFO *verInfo = reinterpret_cast<const VS_FIXEDFILEINFO *>(fi);
+ const auto *verInfo = reinterpret_cast<const VS_FIXEDFILEINFO *>(fi);
return QVersionNumber{HIWORD(verInfo->dwFileVersionMS), LOWORD(verInfo->dwFileVersionMS),
HIWORD(verInfo->dwFileVersionLS), LOWORD(verInfo->dwFileVersionLS)};
}
@@ -140,7 +129,7 @@ QWindowsDirect2DIntegration *QWindowsDirect2DIntegration::create(const QStringLi
return nullptr;
}
- QWindowsDirect2DIntegration *integration = new QWindowsDirect2DIntegration(paramList);
+ auto *integration = new QWindowsDirect2DIntegration(paramList);
if (!integration->init()) {
delete integration;
@@ -188,11 +177,6 @@ QPlatformBackingStore *QWindowsDirect2DIntegration::createPlatformBackingStore(Q
return new QWindowsDirect2DBackingStore(window);
}
-QAbstractEventDispatcher *QWindowsDirect2DIntegration::createEventDispatcher() const
-{
- return new QWindowsDirect2DEventDispatcher;
-}
-
QWindowsDirect2DContext *QWindowsDirect2DIntegration::direct2DContext() const
{
return &d->m_d2dContext;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
index 19c7521eb7..5ea36e04bc 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dintegration.h
@@ -61,7 +61,6 @@ public:
QPlatformNativeInterface *nativeInterface() const override;
QPlatformPixmap *createPlatformPixmap(QPlatformPixmap::PixelType type) const override;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
- QAbstractEventDispatcher *createEventDispatcher() const override;
QWindowsDirect2DContext *direct2DContext() const;
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
index fa201c784e..03be44e095 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
@@ -253,7 +253,7 @@ struct D2DVectorPathCache {
static void cleanup_func(QPaintEngineEx *engine, void *data) {
Q_UNUSED(engine);
- D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(data);
+ auto *e = static_cast<D2DVectorPathCache *>(data);
delete e;
}
};
@@ -689,7 +689,7 @@ public:
*needsEmulation = true;
} else {
ComPtr<ID2D1LinearGradientBrush> linear;
- const QLinearGradient *qlinear = static_cast<const QLinearGradient *>(newBrush.gradient());
+ const auto *qlinear = static_cast<const QLinearGradient *>(newBrush.gradient());
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES linearGradientBrushProperties;
ComPtr<ID2D1GradientStopCollection> gradientStopCollection;
@@ -727,7 +727,7 @@ public:
*needsEmulation = true;
} else {
ComPtr<ID2D1RadialGradientBrush> radial;
- const QRadialGradient *qradial = static_cast<const QRadialGradient *>(newBrush.gradient());
+ const auto *qradial = static_cast<const QRadialGradient *>(newBrush.gradient());
D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES radialGradientBrushProperties;
ComPtr<ID2D1GradientStopCollection> gradientStopCollection;
@@ -807,7 +807,7 @@ public:
: nullptr;
if (cacheEntry) {
- D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
+ auto *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
if (alias && e->aliased)
return e->aliased;
else if (!alias && e->antiAliased)
@@ -885,7 +885,7 @@ public:
if (!cacheEntry)
cacheEntry = path.addCacheData(q, new D2DVectorPathCache, D2DVectorPathCache::cleanup_func);
- D2DVectorPathCache *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
+ auto *e = static_cast<D2DVectorPathCache *>(cacheEntry->data);
if (alias)
e->aliased = geometry;
else
@@ -941,9 +941,16 @@ public:
{
Q_Q(QWindowsDirect2DPaintEngine);
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
// Default path (no optimization)
if (!(path.shape() == QVectorPath::LinesHint || path.shape() == QVectorPath::PolygonHint)
- || !pen.dashBrush || q->state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)) {
+ || !pen.dashBrush
+#if QT_DEPRECATED_SINCE(5, 14)
+ || q->state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)
+#endif
+ || q->state()->renderHints.testFlag(QPainter::Antialiasing)) {
+QT_WARNING_POP
ComPtr<ID2D1Geometry> geometry = vectorPathToID2D1PathGeometry(path);
if (!geometry) {
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
@@ -1481,7 +1488,7 @@ void QWindowsDirect2DPaintEngine::drawPixmap(const QRectF &r,
return;
}
- QWindowsDirect2DPlatformPixmap *pp = static_cast<QWindowsDirect2DPlatformPixmap *>(pm.handle());
+ auto *pp = static_cast<QWindowsDirect2DPlatformPixmap *>(pm.handle());
QWindowsDirect2DBitmap *bitmap = pp->bitmap();
ensurePen();
@@ -1593,7 +1600,7 @@ void QWindowsDirect2DPaintEngine::drawTextItem(const QPointF &p, const QTextItem
Q_D(QWindowsDirect2DPaintEngine);
D2D_TAG(D2DDebugDrawTextItemTag);
- const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem);
+ const auto &ti = static_cast<const QTextItemInt &>(textItem);
if (ti.glyphs.numGlyphs == 0)
return;
@@ -1686,7 +1693,7 @@ void QWindowsDirect2DPaintEngine::rasterFill(const QVectorPath &path, const QBru
p.setBrush(state()->brush);
p.setPen(state()->pen);
- QPaintEngineEx *extended = static_cast<QPaintEngineEx *>(engine);
+ auto *extended = static_cast<QPaintEngineEx *>(engine);
for (const QPainterClipInfo &info : qAsConst(state()->clipInfo)) {
extended->state()->matrix = info.matrix;
extended->transformChanged();
@@ -1800,7 +1807,7 @@ void QWindowsDirect2DPaintEngine::resume()
class QWindowsDirect2DPaintEngineSuspenderImpl
{
- Q_DISABLE_COPY(QWindowsDirect2DPaintEngineSuspenderImpl)
+ Q_DISABLE_COPY_MOVE(QWindowsDirect2DPaintEngineSuspenderImpl)
QWindowsDirect2DPaintEngine *m_engine;
bool m_active;
public:
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h
index 6404c60b13..f61e908bce 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.h
@@ -128,7 +128,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QWindowsDirect2DPaintEngine::Flags)
class QWindowsDirect2DPaintEngineSuspenderPrivate;
class QWindowsDirect2DPaintEngineSuspender
{
- Q_DISABLE_COPY(QWindowsDirect2DPaintEngineSuspender)
+ Q_DISABLE_COPY_MOVE(QWindowsDirect2DPaintEngineSuspender)
Q_DECLARE_PRIVATE(QWindowsDirect2DPaintEngineSuspender)
QScopedPointer<QWindowsDirect2DPaintEngineSuspenderPrivate> d_ptr;
public:
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
index 239e5f3087..c417daaeae 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp
@@ -310,7 +310,7 @@ void QWindowsDirect2DWindow::setupBitmap()
QWindowsDirect2DPaintEngine::Flags flags = QWindowsDirect2DPaintEngine::NoFlag;
if (!m_directRendering)
flags |= QWindowsDirect2DPaintEngine::TranslucentTopLevelWindow;
- QWindowsDirect2DPlatformPixmap *pp = new QWindowsDirect2DPlatformPixmap(QPlatformPixmap::PixmapType,
+ auto *pp = new QWindowsDirect2DPlatformPixmap(QPlatformPixmap::PixmapType,
flags,
m_bitmap.data());
m_pixmap.reset(new QPixmap(pp));
diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h
index 89c2e89f58..8768f9dd8c 100644
--- a/src/plugins/platforms/eglfs/api/qeglfscursor_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfscursor_p.h
@@ -59,6 +59,8 @@
#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/private/qinputdevicemanager_p.h>
+#include <QtCore/qvector.h>
+
QT_BEGIN_NAMESPACE
class QOpenGLShaderProgram;
@@ -143,7 +145,7 @@ private:
int cursorsPerRow;
int width, height; // width and height of the atlas
int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
- QList<QPoint> hotSpots;
+ QVector<QPoint> hotSpots;
QImage image; // valid until it's uploaded
} m_cursorAtlas;
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h
index c96dd585d3..d47b579238 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h
@@ -41,7 +41,7 @@
#define QEGLFSKMSGBMCURSOR_H
#include <qpa/qplatformcursor.h>
-#include <QtCore/QList>
+#include <QtCore/QVector>
#include <QtGui/QImage>
#include <QtGui/private/qinputdevicemanager_p.h>
@@ -110,7 +110,7 @@ private:
int cursorsPerRow;
int width, height; // width and height of the atlas
int cursorWidth, cursorHeight; // width and height of cursors inside the atlas
- QList<QPoint> hotSpots;
+ QVector<QPoint> hotSpots;
QImage image;
} m_cursorAtlas;
};
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
index 359b086372..16dbfe1522 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
@@ -161,7 +161,7 @@ gbm_surface *QEglFSKmsGbmScreen::createSurface(EGLConfig eglConfig)
if (queryFromEgl) {
EGLint native_format = -1;
EGLBoolean success = eglGetConfigAttrib(display(), eglConfig, EGL_NATIVE_VISUAL_ID, &native_format);
- qCDebug(qLcEglfsKmsDebug) << "Got native format" << hex << native_format << dec
+ qCDebug(qLcEglfsKmsDebug) << "Got native format" << Qt::hex << native_format << Qt::dec
<< "from eglGetConfigAttrib() with return code" << bool(success);
if (success) {
@@ -344,6 +344,9 @@ void QEglFSKmsGbmScreen::flip()
static int zpos = qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_ZPOS");
if (zpos)
drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->zposPropertyId, zpos);
+ static uint blendOp = uint(qEnvironmentVariableIntValue("QT_QPA_EGLFS_KMS_BLEND_OP"));
+ if (blendOp)
+ drmModeAtomicAddProperty(request, op.eglfs_plane->id, op.eglfs_plane->blendOpPropertyId, blendOp);
}
#endif
} else {
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
index 2e84915c80..07b2de7c58 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
@@ -66,7 +66,7 @@ QAtomicInt running;
void EventReader::run()
{
xcb_generic_event_t *event = nullptr;
- while (running.load() && (event = xcb_wait_for_event(m_integration->connection()))) {
+ while (running.loadRelaxed() && (event = xcb_wait_for_event(m_integration->connection()))) {
uint response_type = event->response_type & ~0x80;
switch (response_type) {
case XCB_CLIENT_MESSAGE: {
diff --git a/src/plugins/platforms/haiku/qhaikuapplication.cpp b/src/plugins/platforms/haiku/qhaikuapplication.cpp
index b75810c453..de4acdfd4a 100644
--- a/src/plugins/platforms/haiku/qhaikuapplication.cpp
+++ b/src/plugins/platforms/haiku/qhaikuapplication.cpp
@@ -42,6 +42,8 @@
#include <QCoreApplication>
#include <QFileOpenEvent>
+#include <qpa/qwindowsysteminterface.h>
+
#include <Entry.h>
#include <Path.h>
@@ -52,8 +54,7 @@ QHaikuApplication::QHaikuApplication(const char *signature)
bool QHaikuApplication::QuitRequested()
{
- QEvent quitEvent(QEvent::Quit);
- QCoreApplication::sendEvent(QCoreApplication::instance(), &quitEvent);
+ QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>();
return true;
}
diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm
index cecbb17039..cb1a8a96f8 100644
--- a/src/plugins/platforms/ios/qioscontext.mm
+++ b/src/plugins/platforms/ios/qioscontext.mm
@@ -118,7 +118,7 @@ QSurfaceFormat QIOSContext::format() const
return m_format;
}
-#define QT_IOS_GL_STATUS_CASE(val) case val: return QLatin1Literal(#val)
+#define QT_IOS_GL_STATUS_CASE(val) case val: return QLatin1String(#val)
static QString fboStatusString(GLenum status)
{
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm
index 776343c5aa..c5856051de 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.mm
+++ b/src/plugins/platforms/ios/qioseventdispatcher.mm
@@ -211,6 +211,8 @@ namespace
} logActivity;
}
+using namespace QT_PREPEND_NAMESPACE(QtPrivate);
+
extern "C" int qt_main_wrapper(int argc, char *argv[])
{
@autoreleasepool {
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
index dc7ea08dc5..cb8962d4b8 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
@@ -188,7 +188,7 @@ static QImage::Format determineFormat(const fb_var_screeninfo &info, int depth)
if (memcmp(rgba, rgb888, 3 * sizeof(fb_bitfield)) == 0) {
format = QImage::Format_RGB888;
} else if (memcmp(rgba, bgr888, 3 * sizeof(fb_bitfield)) == 0) {
- format = QImage::Format_RGB888;
+ format = QImage::Format_BGR888;
// pixeltype = BGRPixel;
}
break;
diff --git a/src/plugins/platforms/mirclient/mirclient.json b/src/plugins/platforms/mirclient/mirclient.json
deleted file mode 100644
index c31558a2f1..0000000000
--- a/src/plugins/platforms/mirclient/mirclient.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "Keys": [ "mirclient" ]
-}
diff --git a/src/plugins/platforms/mirclient/mirclient.pro b/src/plugins/platforms/mirclient/mirclient.pro
deleted file mode 100644
index d9eb069200..0000000000
--- a/src/plugins/platforms/mirclient/mirclient.pro
+++ /dev/null
@@ -1,61 +0,0 @@
-TARGET = qmirclient
-
-QT += \
- core-private gui-private dbus \
- theme_support-private eventdispatcher_support-private \
- fontdatabase_support-private egl_support-private
-
-qtHaveModule(linuxaccessibility_support-private): \
- QT += linuxaccessibility_support-private
-
-DEFINES += MESA_EGL_NO_X11_HEADERS
-# CONFIG += c++11 # only enables C++0x
-QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -Werror -Wall
-QMAKE_LFLAGS += -std=c++11 -Wl,-no-undefined
-
-QMAKE_USE_PRIVATE += mirclient
-
-SOURCES = \
- qmirclientappstatecontroller.cpp \
- qmirclientbackingstore.cpp \
- qmirclientclipboard.cpp \
- qmirclientcursor.cpp \
- qmirclientdebugextension.cpp \
- qmirclientdesktopwindow.cpp \
- qmirclientglcontext.cpp \
- qmirclientinput.cpp \
- qmirclientintegration.cpp \
- qmirclientnativeinterface.cpp \
- qmirclientplatformservices.cpp \
- qmirclientplugin.cpp \
- qmirclientscreen.cpp \
- qmirclientscreenobserver.cpp \
- qmirclienttheme.cpp \
- qmirclientwindow.cpp
-
-HEADERS = \
- qmirclientappstatecontroller.h \
- qmirclientbackingstore.h \
- qmirclientclipboard.h \
- qmirclientcursor.h \
- qmirclientdebugextension.h \
- qmirclientdesktopwindow.h \
- qmirclientglcontext.h \
- qmirclientinput.h \
- qmirclientintegration.h \
- qmirclientlogging.h \
- qmirclientnativeinterface.h \
- qmirclientorientationchangeevent_p.h \
- qmirclientplatformservices.h \
- qmirclientplugin.h \
- qmirclientscreen.h \
- qmirclientscreenobserver.h \
- qmirclienttheme.h \
- qmirclientwindow.h
-
-QMAKE_USE_PRIVATE += xkbcommon
-
-PLUGIN_TYPE = platforms
-PLUGIN_CLASS_NAME = MirServerIntegrationPlugin
-!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
-load(qt_plugin)
diff --git a/src/plugins/platforms/mirclient/qmirclientappstatecontroller.cpp b/src/plugins/platforms/mirclient/qmirclientappstatecontroller.cpp
deleted file mode 100644
index 69fc9b7aa7..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientappstatecontroller.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientappstatecontroller.h"
-
-#include <qpa/qwindowsysteminterface.h>
-
-/*
- * QMirClientAppStateController - updates Qt's QApplication::applicationState property.
- *
- * Tries to avoid active-inactive-active invocations using a timer. The rapid state
- * change can confuse some applications.
- */
-
-QMirClientAppStateController::QMirClientAppStateController()
- : m_suspended(false)
- , m_lastActive(true)
-{
- m_inactiveTimer.setSingleShot(true);
- m_inactiveTimer.setInterval(10);
- QObject::connect(&m_inactiveTimer, &QTimer::timeout, []()
- {
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
- });
-}
-
-void QMirClientAppStateController::setSuspended()
-{
- m_inactiveTimer.stop();
- if (!m_suspended) {
- m_suspended = true;
-
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
- }
-}
-
-void QMirClientAppStateController::setResumed()
-{
- m_inactiveTimer.stop();
- if (m_suspended) {
- m_suspended = false;
-
- if (m_lastActive) {
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
- } else {
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationInactive);
- }
- }
-}
-
-void QMirClientAppStateController::setWindowFocused(bool focused)
-{
- if (m_suspended) {
- return;
- }
-
- if (focused) {
- m_inactiveTimer.stop();
- QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
- } else {
- m_inactiveTimer.start();
- }
-
- m_lastActive = focused;
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientbackingstore.cpp b/src/plugins/platforms/mirclient/qmirclientbackingstore.cpp
deleted file mode 100644
index 51363619d9..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientbackingstore.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientbackingstore.h"
-#include "qmirclientlogging.h"
-#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLTexture>
-#include <QtGui/QMatrix4x4>
-#include <QtGui/qopengltextureblitter.h>
-#include <QtGui/qopenglfunctions.h>
-
-QMirClientBackingStore::QMirClientBackingStore(QWindow* window)
- : QPlatformBackingStore(window)
- , mContext(new QOpenGLContext)
- , mTexture(new QOpenGLTexture(QOpenGLTexture::Target2D))
- , mBlitter(new QOpenGLTextureBlitter)
-{
- mContext->setFormat(window->requestedFormat());
- mContext->setScreen(window->screen());
- mContext->create();
-
- window->setSurfaceType(QSurface::OpenGLSurface);
-}
-
-QMirClientBackingStore::~QMirClientBackingStore()
-{
- mContext->makeCurrent(window()); // needed as QOpenGLTexture destructor assumes current context
-}
-
-void QMirClientBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)
-{
- Q_UNUSED(region);
- Q_UNUSED(offset);
- mContext->makeCurrent(window);
- glViewport(0, 0, window->width(), window->height());
-
- updateTexture();
-
- if (!mBlitter->isCreated())
- mBlitter->create();
-
- mBlitter->bind();
- mBlitter->blit(mTexture->textureId(), QMatrix4x4(), QOpenGLTextureBlitter::OriginTopLeft);
- mBlitter->release();
-
- mContext->swapBuffers(window);
-}
-
-void QMirClientBackingStore::updateTexture()
-{
- if (mDirty.isNull())
- return;
-
- if (!mTexture->isCreated()) {
- mTexture->setMinificationFilter(QOpenGLTexture::Nearest);
- mTexture->setMagnificationFilter(QOpenGLTexture::Nearest);
- mTexture->setWrapMode(QOpenGLTexture::ClampToEdge);
- mTexture->setData(mImage, QOpenGLTexture::DontGenerateMipMaps);
- mTexture->create();
- }
- mTexture->bind();
-
- QRegion fixed;
- QRect imageRect = mImage.rect();
-
- for (const QRect &rect : mDirty) {
- // intersect with image rect to be sure
- QRect r = imageRect & rect;
-
- // if the rect is wide enough it is cheaper to just extend it instead of doing an image copy
- if (r.width() >= imageRect.width() / 2) {
- r.setX(0);
- r.setWidth(imageRect.width());
- }
-
- fixed |= r;
- }
-
- for (const QRect &rect : fixed) {
- // if the sub-rect is full-width we can pass the image data directly to
- // OpenGL instead of copying, since there is no gap between scanlines
- if (rect.width() == imageRect.width()) {
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
- mImage.constScanLine(rect.y()));
- } else {
- glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), GL_RGBA, GL_UNSIGNED_BYTE,
- mImage.copy(rect).constBits());
- }
- }
- /* End of code taken from QEGLPlatformBackingStore */
-
- mDirty = QRegion();
-}
-
-
-void QMirClientBackingStore::beginPaint(const QRegion& region)
-{
- mDirty |= region;
-}
-
-void QMirClientBackingStore::resize(const QSize& size, const QRegion& /*staticContents*/)
-{
- mImage = QImage(size, QImage::Format_RGBA8888);
-
- mContext->makeCurrent(window());
-
- if (mTexture->isCreated())
- mTexture->destroy();
-}
-
-QPaintDevice* QMirClientBackingStore::paintDevice()
-{
- return &mImage;
-}
-
-QImage QMirClientBackingStore::toImage() const
-{
- // used by QPlatformBackingStore::composeAndFlush
- return mImage;
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientbackingstore.h b/src/plugins/platforms/mirclient/qmirclientbackingstore.h
deleted file mode 100644
index 7644c77df2..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientbackingstore.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTBACKINGSTORE_H
-#define QMIRCLIENTBACKINGSTORE_H
-
-#include <qpa/qplatformbackingstore.h>
-
-class QOpenGLContext;
-class QOpenGLTexture;
-class QOpenGLTextureBlitter;
-
-class QMirClientBackingStore : public QPlatformBackingStore
-{
-public:
- QMirClientBackingStore(QWindow* window);
- virtual ~QMirClientBackingStore();
-
- // QPlatformBackingStore methods.
- void beginPaint(const QRegion&) override;
- void flush(QWindow* window, const QRegion& region, const QPoint& offset) override;
- void resize(const QSize& size, const QRegion& staticContents) override;
- QPaintDevice* paintDevice() override;
- QImage toImage() const override;
-
-protected:
- void updateTexture();
-
-private:
- QScopedPointer<QOpenGLContext> mContext;
- QScopedPointer<QOpenGLTexture> mTexture;
- QScopedPointer<QOpenGLTextureBlitter> mBlitter;
- QImage mImage;
- QRegion mDirty;
-};
-
-#endif // QMIRCLIENTBACKINGSTORE_H
diff --git a/src/plugins/platforms/mirclient/qmirclientclipboard.cpp b/src/plugins/platforms/mirclient/qmirclientclipboard.cpp
deleted file mode 100644
index b9fc9b3b42..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientclipboard.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientclipboard.h"
-#include "qmirclientlogging.h"
-#include "qmirclientwindow.h"
-
-#include <QDBusPendingCallWatcher>
-#include <QGuiApplication>
-#include <QSignalBlocker>
-#include <QtCore/QMimeData>
-#include <QtCore/QStringList>
-
-// content-hub
-#include <com/ubuntu/content/hub.h>
-
-// get this cumbersome nested namespace out of the way
-using namespace com::ubuntu::content;
-
-QMirClientClipboard::QMirClientClipboard()
- : mMimeData(new QMimeData)
- , mContentHub(Hub::Client::instance())
-{
- connect(mContentHub, &Hub::pasteboardChanged, this, [this]() {
- if (mClipboardState == QMirClientClipboard::SyncedClipboard) {
- mClipboardState = QMirClientClipboard::OutdatedClipboard;
- emitChanged(QClipboard::Clipboard);
- }
- });
-
- connect(qGuiApp, &QGuiApplication::applicationStateChanged,
- this, &QMirClientClipboard::onApplicationStateChanged);
-
- requestMimeData();
-}
-
-QMirClientClipboard::~QMirClientClipboard()
-{
- delete mMimeData;
-}
-
-QMimeData* QMirClientClipboard::mimeData(QClipboard::Mode mode)
-{
- if (mode != QClipboard::Clipboard)
- return nullptr;
-
- // Blocks dataChanged() signal from being emitted. Makes no sense to emit it from
- // inside the data getter.
- const QSignalBlocker blocker(this);
-
- if (mClipboardState == OutdatedClipboard) {
- updateMimeData();
- } else if (mClipboardState == SyncingClipboard) {
- mPasteReply->waitForFinished();
- }
-
- return mMimeData;
-}
-
-void QMirClientClipboard::setMimeData(QMimeData* mimeData, QClipboard::Mode mode)
-{
- QWindow *focusWindow = QGuiApplication::focusWindow();
- if (focusWindow && mode == QClipboard::Clipboard && mimeData != nullptr) {
- QString surfaceId = static_cast<QMirClientWindow*>(focusWindow->handle())->persistentSurfaceId();
-
- QDBusPendingCall reply = mContentHub->createPaste(surfaceId, *mimeData);
-
- // Don't care whether it succeeded
- QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
- connect(watcher, &QDBusPendingCallWatcher::finished,
- watcher, &QObject::deleteLater);
-
- mMimeData = mimeData;
- mClipboardState = SyncedClipboard;
- emitChanged(QClipboard::Clipboard);
- }
-}
-
-bool QMirClientClipboard::supportsMode(QClipboard::Mode mode) const
-{
- return mode == QClipboard::Clipboard;
-}
-
-bool QMirClientClipboard::ownsMode(QClipboard::Mode mode) const
-{
- Q_UNUSED(mode);
- return false;
-}
-
-void QMirClientClipboard::onApplicationStateChanged(Qt::ApplicationState state)
-{
- if (state == Qt::ApplicationActive) {
- // Only focused or active applications might be allowed to paste, so we probably
- // missed changes in the clipboard while we were hidden, inactive or, more importantly,
- // suspended.
- requestMimeData();
- }
-}
-
-void QMirClientClipboard::updateMimeData()
-{
- if (qGuiApp->applicationState() != Qt::ApplicationActive) {
- // Don't even bother asking as content-hub would probably ignore our request (and should).
- return;
- }
-
- delete mMimeData;
-
- QWindow *focusWindow = QGuiApplication::focusWindow();
- if (focusWindow) {
- QString surfaceId = static_cast<QMirClientWindow*>(focusWindow->handle())->persistentSurfaceId();
- mMimeData = mContentHub->latestPaste(surfaceId);
- mClipboardState = SyncedClipboard;
- emitChanged(QClipboard::Clipboard);
- }
-}
-
-void QMirClientClipboard::requestMimeData()
-{
- if (qGuiApp->applicationState() != Qt::ApplicationActive) {
- // Don't even bother asking as content-hub would probably ignore our request (and should).
- return;
- }
-
- QWindow *focusWindow = QGuiApplication::focusWindow();
- if (!focusWindow) {
- return;
- }
-
- QString surfaceId = static_cast<QMirClientWindow*>(focusWindow->handle())->persistentSurfaceId();
- QDBusPendingCall reply = mContentHub->requestLatestPaste(surfaceId);
- mClipboardState = SyncingClipboard;
-
- mPasteReply = new QDBusPendingCallWatcher(reply, this);
- connect(mPasteReply, &QDBusPendingCallWatcher::finished,
- this, [this]() {
- delete mMimeData;
- mMimeData = mContentHub->paste(*mPasteReply);
- mClipboardState = SyncedClipboard;
- mPasteReply->deleteLater();
- mPasteReply = nullptr;
- emitChanged(QClipboard::Clipboard);
- });
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientclipboard.h b/src/plugins/platforms/mirclient/qmirclientclipboard.h
deleted file mode 100644
index 09e9bcdf38..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientclipboard.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTCLIPBOARD_H
-#define QMIRCLIENTCLIPBOARD_H
-
-#include <qpa/qplatformclipboard.h>
-
-#include <QMimeData>
-#include <QPointer>
-
-namespace com {
- namespace ubuntu {
- namespace content {
- class Hub;
- }
- }
-}
-
-class QDBusPendingCallWatcher;
-
-class QMirClientClipboard : public QObject, public QPlatformClipboard
-{
- Q_OBJECT
-public:
- QMirClientClipboard();
- virtual ~QMirClientClipboard();
-
- // QPlatformClipboard methods.
- QMimeData* mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
- void setMimeData(QMimeData* data, QClipboard::Mode mode = QClipboard::Clipboard) override;
- bool supportsMode(QClipboard::Mode mode) const override;
- bool ownsMode(QClipboard::Mode mode) const override;
-
-private Q_SLOTS:
- void onApplicationStateChanged(Qt::ApplicationState state);
-
-private:
- void updateMimeData();
- void requestMimeData();
-
- QMimeData *mMimeData;
-
- enum {
- OutdatedClipboard, // Our mimeData is outdated, need to fetch latest from ContentHub
- SyncingClipboard, // Our mimeData is outdated and we are waiting for ContentHub to reply with the latest paste
- SyncedClipboard // Our mimeData is in sync with what ContentHub has
- } mClipboardState{OutdatedClipboard};
-
- com::ubuntu::content::Hub *mContentHub;
-
- QDBusPendingCallWatcher *mPasteReply{nullptr};
-};
-
-#endif // QMIRCLIENTCLIPBOARD_H
diff --git a/src/plugins/platforms/mirclient/qmirclientcursor.cpp b/src/plugins/platforms/mirclient/qmirclientcursor.cpp
deleted file mode 100644
index 812cde95c6..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientcursor.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientcursor.h"
-
-#include "qmirclientlogging.h"
-#include "qmirclientwindow.h"
-
-#include <mir_toolkit/mir_client_library.h>
-
-Q_LOGGING_CATEGORY(mirclientCursor, "qt.qpa.mirclient.cursor", QtWarningMsg)
-
-QMirClientCursor::QMirClientCursor(MirConnection *connection)
- : mConnection(connection)
-{
- /*
- * TODO: Add the missing cursors to Mir (LP: #1388987)
- * Those are the ones without a mir_ prefix, which are X11 cursors
- * and won't be understood by any shell other than Unity8.
- */
- mShapeToCursorName[Qt::ArrowCursor] = mir_arrow_cursor_name;
- mShapeToCursorName[Qt::UpArrowCursor] = "up_arrow";
- mShapeToCursorName[Qt::CrossCursor] = mir_crosshair_cursor_name;
- mShapeToCursorName[Qt::WaitCursor] = mir_busy_cursor_name;
- mShapeToCursorName[Qt::IBeamCursor] = mir_caret_cursor_name;
- mShapeToCursorName[Qt::SizeVerCursor] = mir_vertical_resize_cursor_name;
- mShapeToCursorName[Qt::SizeHorCursor] = mir_horizontal_resize_cursor_name;
- mShapeToCursorName[Qt::SizeBDiagCursor] = mir_diagonal_resize_bottom_to_top_cursor_name;
- mShapeToCursorName[Qt::SizeFDiagCursor] = mir_diagonal_resize_top_to_bottom_cursor_name;
- mShapeToCursorName[Qt::SizeAllCursor] = mir_omnidirectional_resize_cursor_name;
- mShapeToCursorName[Qt::BlankCursor] = mir_disabled_cursor_name;
- mShapeToCursorName[Qt::SplitVCursor] = mir_vsplit_resize_cursor_name;
- mShapeToCursorName[Qt::SplitHCursor] = mir_hsplit_resize_cursor_name;
- mShapeToCursorName[Qt::PointingHandCursor] = mir_pointing_hand_cursor_name;
- mShapeToCursorName[Qt::ForbiddenCursor] = "forbidden";
- mShapeToCursorName[Qt::WhatsThisCursor] = "whats_this";
- mShapeToCursorName[Qt::BusyCursor] = "left_ptr_watch";
- mShapeToCursorName[Qt::OpenHandCursor] = mir_open_hand_cursor_name;
- mShapeToCursorName[Qt::ClosedHandCursor] = mir_closed_hand_cursor_name;
- mShapeToCursorName[Qt::DragCopyCursor] = "dnd-copy";
- mShapeToCursorName[Qt::DragMoveCursor] = "dnd-move";
- mShapeToCursorName[Qt::DragLinkCursor] = "dnd-link";
-}
-
-namespace {
-const char *qtCursorShapeToStr(Qt::CursorShape shape)
-{
- switch (shape) {
- case Qt::ArrowCursor:
- return "Arrow";
- case Qt::UpArrowCursor:
- return "UpArrow";
- case Qt::CrossCursor:
- return "Cross";
- case Qt::WaitCursor:
- return "Wait";
- case Qt::IBeamCursor:
- return "IBeam";
- case Qt::SizeVerCursor:
- return "SizeVer";
- case Qt::SizeHorCursor:
- return "SizeHor";
- case Qt::SizeBDiagCursor:
- return "SizeBDiag";
- case Qt::SizeFDiagCursor:
- return "SizeFDiag";
- case Qt::SizeAllCursor:
- return "SizeAll";
- case Qt::BlankCursor:
- return "Blank";
- case Qt::SplitVCursor:
- return "SplitV";
- case Qt::SplitHCursor:
- return "SplitH";
- case Qt::PointingHandCursor:
- return "PointingHand";
- case Qt::ForbiddenCursor:
- return "Forbidden";
- case Qt::WhatsThisCursor:
- return "WhatsThis";
- case Qt::BusyCursor:
- return "Busy";
- case Qt::OpenHandCursor:
- return "OpenHand";
- case Qt::ClosedHandCursor:
- return "ClosedHand";
- case Qt::DragCopyCursor:
- return "DragCopy";
- case Qt::DragMoveCursor:
- return "DragMove";
- case Qt::DragLinkCursor:
- return "DragLink";
- case Qt::BitmapCursor:
- return "Bitmap";
- default:
- return "???";
- }
-}
-} // anonymous namespace
-
-void QMirClientCursor::changeCursor(QCursor *windowCursor, QWindow *window)
-{
- if (!window) {
- return;
- }
-
- MirSurface *surface = static_cast<QMirClientWindow*>(window->handle())->mirSurface();
-
- if (!surface) {
- return;
- }
-
-
- if (windowCursor) {
- qCDebug(mirclientCursor, "changeCursor shape=%s, window=%p", qtCursorShapeToStr(windowCursor->shape()), window);
- if (!windowCursor->pixmap().isNull()) {
- configureMirCursorWithPixmapQCursor(surface, *windowCursor);
- } else if (windowCursor->shape() == Qt::BitmapCursor) {
- // TODO: Implement bitmap cursor support
- applyDefaultCursorConfiguration(surface);
- } else {
- const auto &cursorName = mShapeToCursorName.value(windowCursor->shape(), QByteArray("left_ptr"));
- auto cursorConfiguration = mir_cursor_configuration_from_name(cursorName.data());
- mir_surface_configure_cursor(surface, cursorConfiguration);
- mir_cursor_configuration_destroy(cursorConfiguration);
- }
- } else {
- applyDefaultCursorConfiguration(surface);
- }
-
-}
-
-void QMirClientCursor::configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor)
-{
- QImage image = cursor.pixmap().toImage();
-
- if (image.format() != QImage::Format_ARGB32) {
- image = image.convertToFormat(QImage::Format_ARGB32);
- }
-
- MirBufferStream *bufferStream = mir_connection_create_buffer_stream_sync(mConnection,
- image.width(), image.height(), mir_pixel_format_argb_8888, mir_buffer_usage_software);
-
- {
- MirGraphicsRegion region;
- mir_buffer_stream_get_graphics_region(bufferStream, &region);
-
- char *regionLine = region.vaddr;
- Q_ASSERT(image.bytesPerLine() <= region.stride);
- for (int i = 0; i < image.height(); ++i) {
- memcpy(regionLine, image.scanLine(i), image.bytesPerLine());
- regionLine += region.stride;
- }
- }
-
- mir_buffer_stream_swap_buffers_sync(bufferStream);
-
- {
- auto configuration = mir_cursor_configuration_from_buffer_stream(bufferStream, cursor.hotSpot().x(), cursor.hotSpot().y());
- mir_surface_configure_cursor(surface, configuration);
- mir_cursor_configuration_destroy(configuration);
- }
-
- mir_buffer_stream_release_sync(bufferStream);
-}
-
-void QMirClientCursor::applyDefaultCursorConfiguration(MirSurface *surface)
-{
- auto cursorConfiguration = mir_cursor_configuration_from_name("left_ptr");
- mir_surface_configure_cursor(surface, cursorConfiguration);
- mir_cursor_configuration_destroy(cursorConfiguration);
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientcursor.h b/src/plugins/platforms/mirclient/qmirclientcursor.h
deleted file mode 100644
index c5de23b272..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientcursor.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTCURSOR_H
-#define QMIRCLIENTCURSOR_H
-
-#include <qpa/qplatformcursor.h>
-
-#include <QMap>
-#include <QByteArray>
-
-struct MirConnection;
-struct MirSurface;
-
-class QMirClientCursor : public QPlatformCursor
-{
-public:
- QMirClientCursor(MirConnection *connection);
- void changeCursor(QCursor *windowCursor, QWindow *window) override;
-private:
- void configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor);
- void applyDefaultCursorConfiguration(MirSurface *surface);
- QMap<int, QByteArray> mShapeToCursorName;
- MirConnection *mConnection;
-};
-
-#endif // QMIRCLIENTCURSOR_H
diff --git a/src/plugins/platforms/mirclient/qmirclientdebugextension.cpp b/src/plugins/platforms/mirclient/qmirclientdebugextension.cpp
deleted file mode 100644
index 9aa934083d..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientdebugextension.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientdebugextension.h"
-
-#include "qmirclientlogging.h"
-
-// mir client debug
-#include <mir_toolkit/debug/surface.h>
-
-Q_LOGGING_CATEGORY(mirclientDebug, "qt.qpa.mirclient.debug")
-
-QMirClientDebugExtension::QMirClientDebugExtension()
- : m_mirclientDebug(QStringLiteral("mirclient-debug-extension"), 1)
- , m_mapper(nullptr)
-{
- qCDebug(mirclientDebug) << "NOTICE: Loading mirclient-debug-extension";
- m_mapper = (MapperPrototype) m_mirclientDebug.resolve("mir_debug_surface_coords_to_screen");
-
- if (!m_mirclientDebug.isLoaded()) {
- qCWarning(mirclientDebug) << "ERROR: mirclient-debug-extension failed to load:"
- << m_mirclientDebug.errorString();
- } else if (!m_mapper) {
- qCWarning(mirclientDebug) << "ERROR: unable to find required symbols in mirclient-debug-extension:"
- << m_mirclientDebug.errorString();
- }
-}
-
-QPoint QMirClientDebugExtension::mapSurfacePointToScreen(MirSurface *surface, const QPoint &point)
-{
- if (!m_mapper) {
- return point;
- }
-
- QPoint mappedPoint;
- bool status = m_mapper(surface, point.x(), point.y(), &mappedPoint.rx(), &mappedPoint.ry());
- if (status) {
- return mappedPoint;
- } else {
- return point;
- }
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp b/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
deleted file mode 100644
index fc7d90d5ec..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientglcontext.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientglcontext.h"
-#include "qmirclientlogging.h"
-#include "qmirclientwindow.h"
-
-#include <QOpenGLFramebufferObject>
-#include <QtEglSupport/private/qeglconvenience_p.h>
-#include <QtEglSupport/private/qeglpbuffer_p.h>
-#include <QtGui/private/qopenglcontext_p.h>
-
-Q_LOGGING_CATEGORY(mirclientGraphics, "qt.qpa.mirclient.graphics", QtWarningMsg)
-
-namespace {
-
-void printEglConfig(EGLDisplay display, EGLConfig config)
-{
- Q_ASSERT(display != EGL_NO_DISPLAY);
- Q_ASSERT(config != nullptr);
-
- const char *string = eglQueryString(display, EGL_VENDOR);
- qCDebug(mirclientGraphics, "EGL vendor: %s", string);
-
- string = eglQueryString(display, EGL_VERSION);
- qCDebug(mirclientGraphics, "EGL version: %s", string);
-
- string = eglQueryString(display, EGL_EXTENSIONS);
- qCDebug(mirclientGraphics, "EGL extensions: %s", string);
-
- qCDebug(mirclientGraphics, "EGL configuration attributes:");
- q_printEglConfig(display, config);
-}
-
-} // anonymous namespace
-
-QMirClientOpenGLContext::QMirClientOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
- EGLDisplay display)
- : QEGLPlatformContext(format, share, display, 0)
-{
- if (mirclientGraphics().isDebugEnabled()) {
- printEglConfig(display, eglConfig());
- }
-}
-
-static bool needsFBOReadBackWorkaround()
-{
- static bool set = false;
- static bool needsWorkaround = false;
-
- if (Q_UNLIKELY(!set)) {
- const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
- needsWorkaround = qstrncmp(rendererString, "Mali-400", 8) == 0
- || qstrncmp(rendererString, "Mali-T7", 7) == 0
- || qstrncmp(rendererString, "PowerVR Rogue G6200", 19) == 0;
- set = true;
- }
-
- return needsWorkaround;
-}
-
-bool QMirClientOpenGLContext::makeCurrent(QPlatformSurface* surface)
-{
- const bool ret = QEGLPlatformContext::makeCurrent(surface);
-
- if (Q_LIKELY(ret)) {
- QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
- if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) {
- ctx_d->workaround_brokenFBOReadBack = true;
- }
- }
- return ret;
-}
-
-// Following method used internally in the base class QEGLPlatformContext to access
-// the egl surface of a QPlatformSurface/QMirClientWindow
-EGLSurface QMirClientOpenGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
-{
- if (surface->surface()->surfaceClass() == QSurface::Window) {
- return static_cast<QMirClientWindow *>(surface)->eglSurface();
- } else {
- return static_cast<QEGLPbuffer *>(surface)->pbuffer();
- }
-}
-
-void QMirClientOpenGLContext::swapBuffers(QPlatformSurface* surface)
-{
- QEGLPlatformContext::swapBuffers(surface);
-
- if (surface->surface()->surfaceClass() == QSurface::Window) {
- // notify window on swap completion
- auto platformWindow = static_cast<QMirClientWindow *>(surface);
- platformWindow->onSwapBuffersDone();
- }
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientinput.cpp b/src/plugins/platforms/mirclient/qmirclientinput.cpp
deleted file mode 100644
index e5319b0435..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientinput.cpp
+++ /dev/null
@@ -1,708 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// Local
-#include "qmirclientinput.h"
-#include "qmirclientintegration.h"
-#include "qmirclientnativeinterface.h"
-#include "qmirclientscreen.h"
-#include "qmirclientwindow.h"
-#include "qmirclientlogging.h"
-#include "qmirclientorientationchangeevent_p.h"
-
-// Qt
-#include <QtCore/QThread>
-#include <QtCore/qglobal.h>
-#include <QtCore/QCoreApplication>
-#include <QtGui/private/qguiapplication_p.h>
-#include <qpa/qplatforminputcontext.h>
-#include <qpa/qwindowsysteminterface.h>
-#include <QTextCodec>
-
-#include <xkbcommon/xkbcommon.h>
-#include <xkbcommon/xkbcommon-keysyms.h>
-
-#include <mir_toolkit/mir_client_library.h>
-
-Q_LOGGING_CATEGORY(mirclientInput, "qt.qpa.mirclient.input", QtWarningMsg)
-
-namespace
-{
-
-// XKB Keysyms which do not map directly to Qt types (i.e. Unicode points)
-static const uint32_t KeyTable[] = {
- XKB_KEY_Escape, Qt::Key_Escape,
- XKB_KEY_Tab, Qt::Key_Tab,
- XKB_KEY_ISO_Left_Tab, Qt::Key_Backtab,
- XKB_KEY_BackSpace, Qt::Key_Backspace,
- XKB_KEY_Return, Qt::Key_Return,
- XKB_KEY_Insert, Qt::Key_Insert,
- XKB_KEY_Delete, Qt::Key_Delete,
- XKB_KEY_Clear, Qt::Key_Delete,
- XKB_KEY_Pause, Qt::Key_Pause,
- XKB_KEY_Print, Qt::Key_Print,
-
- XKB_KEY_Home, Qt::Key_Home,
- XKB_KEY_End, Qt::Key_End,
- XKB_KEY_Left, Qt::Key_Left,
- XKB_KEY_Up, Qt::Key_Up,
- XKB_KEY_Right, Qt::Key_Right,
- XKB_KEY_Down, Qt::Key_Down,
- XKB_KEY_Prior, Qt::Key_PageUp,
- XKB_KEY_Next, Qt::Key_PageDown,
-
- XKB_KEY_Shift_L, Qt::Key_Shift,
- XKB_KEY_Shift_R, Qt::Key_Shift,
- XKB_KEY_Shift_Lock, Qt::Key_Shift,
- XKB_KEY_Control_L, Qt::Key_Control,
- XKB_KEY_Control_R, Qt::Key_Control,
- XKB_KEY_Meta_L, Qt::Key_Meta,
- XKB_KEY_Meta_R, Qt::Key_Meta,
- XKB_KEY_Alt_L, Qt::Key_Alt,
- XKB_KEY_Alt_R, Qt::Key_Alt,
- XKB_KEY_Caps_Lock, Qt::Key_CapsLock,
- XKB_KEY_Num_Lock, Qt::Key_NumLock,
- XKB_KEY_Scroll_Lock, Qt::Key_ScrollLock,
- XKB_KEY_Super_L, Qt::Key_Super_L,
- XKB_KEY_Super_R, Qt::Key_Super_R,
- XKB_KEY_Menu, Qt::Key_Menu,
- XKB_KEY_Hyper_L, Qt::Key_Hyper_L,
- XKB_KEY_Hyper_R, Qt::Key_Hyper_R,
- XKB_KEY_Help, Qt::Key_Help,
-
- XKB_KEY_KP_Space, Qt::Key_Space,
- XKB_KEY_KP_Tab, Qt::Key_Tab,
- XKB_KEY_KP_Enter, Qt::Key_Enter,
- XKB_KEY_KP_Home, Qt::Key_Home,
- XKB_KEY_KP_Left, Qt::Key_Left,
- XKB_KEY_KP_Up, Qt::Key_Up,
- XKB_KEY_KP_Right, Qt::Key_Right,
- XKB_KEY_KP_Down, Qt::Key_Down,
- XKB_KEY_KP_Prior, Qt::Key_PageUp,
- XKB_KEY_KP_Next, Qt::Key_PageDown,
- XKB_KEY_KP_End, Qt::Key_End,
- XKB_KEY_KP_Begin, Qt::Key_Clear,
- XKB_KEY_KP_Insert, Qt::Key_Insert,
- XKB_KEY_KP_Delete, Qt::Key_Delete,
- XKB_KEY_KP_Equal, Qt::Key_Equal,
- XKB_KEY_KP_Multiply, Qt::Key_Asterisk,
- XKB_KEY_KP_Add, Qt::Key_Plus,
- XKB_KEY_KP_Separator, Qt::Key_Comma,
- XKB_KEY_KP_Subtract, Qt::Key_Minus,
- XKB_KEY_KP_Decimal, Qt::Key_Period,
- XKB_KEY_KP_Divide, Qt::Key_Slash,
-
- XKB_KEY_ISO_Level3_Shift, Qt::Key_AltGr,
- XKB_KEY_Multi_key, Qt::Key_Multi_key,
- XKB_KEY_Codeinput, Qt::Key_Codeinput,
- XKB_KEY_SingleCandidate, Qt::Key_SingleCandidate,
- XKB_KEY_MultipleCandidate, Qt::Key_MultipleCandidate,
- XKB_KEY_PreviousCandidate, Qt::Key_PreviousCandidate,
-
- // dead keys
- XKB_KEY_dead_grave, Qt::Key_Dead_Grave,
- XKB_KEY_dead_acute, Qt::Key_Dead_Acute,
- XKB_KEY_dead_circumflex, Qt::Key_Dead_Circumflex,
- XKB_KEY_dead_tilde, Qt::Key_Dead_Tilde,
- XKB_KEY_dead_macron, Qt::Key_Dead_Macron,
- XKB_KEY_dead_breve, Qt::Key_Dead_Breve,
- XKB_KEY_dead_abovedot, Qt::Key_Dead_Abovedot,
- XKB_KEY_dead_diaeresis, Qt::Key_Dead_Diaeresis,
- XKB_KEY_dead_abovering, Qt::Key_Dead_Abovering,
- XKB_KEY_dead_doubleacute, Qt::Key_Dead_Doubleacute,
- XKB_KEY_dead_caron, Qt::Key_Dead_Caron,
- XKB_KEY_dead_cedilla, Qt::Key_Dead_Cedilla,
- XKB_KEY_dead_ogonek, Qt::Key_Dead_Ogonek,
- XKB_KEY_dead_iota, Qt::Key_Dead_Iota,
- XKB_KEY_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound,
- XKB_KEY_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound,
- XKB_KEY_dead_belowdot, Qt::Key_Dead_Belowdot,
- XKB_KEY_dead_hook, Qt::Key_Dead_Hook,
- XKB_KEY_dead_horn, Qt::Key_Dead_Horn,
- XKB_KEY_dead_stroke, Qt::Key_Dead_Stroke,
- XKB_KEY_dead_abovecomma, Qt::Key_Dead_Abovecomma,
- XKB_KEY_dead_abovereversedcomma, Qt::Key_Dead_Abovereversedcomma,
- XKB_KEY_dead_doublegrave, Qt::Key_Dead_Doublegrave,
- XKB_KEY_dead_belowring, Qt::Key_Dead_Belowring,
- XKB_KEY_dead_belowmacron, Qt::Key_Dead_Belowmacron,
- XKB_KEY_dead_belowcircumflex, Qt::Key_Dead_Belowcircumflex,
- XKB_KEY_dead_belowtilde, Qt::Key_Dead_Belowtilde,
- XKB_KEY_dead_belowbreve, Qt::Key_Dead_Belowbreve,
- XKB_KEY_dead_belowdiaeresis, Qt::Key_Dead_Belowdiaeresis,
- XKB_KEY_dead_invertedbreve, Qt::Key_Dead_Invertedbreve,
- XKB_KEY_dead_belowcomma, Qt::Key_Dead_Belowcomma,
- XKB_KEY_dead_currency, Qt::Key_Dead_Currency,
- XKB_KEY_dead_a, Qt::Key_Dead_a,
- XKB_KEY_dead_A, Qt::Key_Dead_A,
- XKB_KEY_dead_e, Qt::Key_Dead_e,
- XKB_KEY_dead_E, Qt::Key_Dead_E,
- XKB_KEY_dead_i, Qt::Key_Dead_i,
- XKB_KEY_dead_I, Qt::Key_Dead_I,
- XKB_KEY_dead_o, Qt::Key_Dead_o,
- XKB_KEY_dead_O, Qt::Key_Dead_O,
- XKB_KEY_dead_u, Qt::Key_Dead_u,
- XKB_KEY_dead_U, Qt::Key_Dead_U,
- XKB_KEY_dead_small_schwa, Qt::Key_Dead_Small_Schwa,
- XKB_KEY_dead_capital_schwa, Qt::Key_Dead_Capital_Schwa,
- XKB_KEY_dead_greek, Qt::Key_Dead_Greek,
- XKB_KEY_dead_lowline, Qt::Key_Dead_Lowline,
- XKB_KEY_dead_aboveverticalline, Qt::Key_Dead_Aboveverticalline,
- XKB_KEY_dead_belowverticalline, Qt::Key_Dead_Belowverticalline,
- XKB_KEY_dead_longsolidusoverlay, Qt::Key_Dead_Longsolidusoverlay,
-
- XKB_KEY_Mode_switch, Qt::Key_Mode_switch,
- XKB_KEY_script_switch, Qt::Key_Mode_switch,
- XKB_KEY_XF86AudioRaiseVolume, Qt::Key_VolumeUp,
- XKB_KEY_XF86AudioLowerVolume, Qt::Key_VolumeDown,
- XKB_KEY_XF86PowerOff, Qt::Key_PowerOff,
- XKB_KEY_XF86PowerDown, Qt::Key_PowerDown,
-
- 0, 0
-};
-
-Qt::WindowState mirSurfaceStateToWindowState(MirSurfaceState state)
-{
- switch (state) {
- case mir_surface_state_fullscreen:
- return Qt::WindowFullScreen;
- case mir_surface_state_maximized:
- case mir_surface_state_vertmaximized:
- case mir_surface_state_horizmaximized:
- return Qt::WindowMaximized;
- case mir_surface_state_minimized:
- return Qt::WindowMinimized;
- case mir_surface_state_hidden:
- // We should be handling this state separately.
- Q_ASSERT(false);
- case mir_surface_state_restored:
- case mir_surface_state_unknown:
- default:
- return Qt::WindowNoState;
- }
-}
-
-} // namespace
-
-class UbuntuEvent : public QEvent
-{
-public:
- UbuntuEvent(QMirClientWindow* window, const MirEvent *event, QEvent::Type type)
- : QEvent(type), window(window) {
- nativeEvent = mir_event_ref(event);
- }
- ~UbuntuEvent()
- {
- mir_event_unref(nativeEvent);
- }
-
- QPointer<QMirClientWindow> window;
- const MirEvent *nativeEvent;
-};
-
-QMirClientInput::QMirClientInput(QMirClientClientIntegration* integration)
- : QObject(nullptr)
- , mIntegration(integration)
- , mEventFilterType(static_cast<QMirClientNativeInterface*>(
- integration->nativeInterface())->genericEventFilterType())
- , mEventType(static_cast<QEvent::Type>(QEvent::registerEventType()))
- , mLastInputWindow(nullptr)
-{
- // Initialize touch device.
- mTouchDevice = new QTouchDevice;
- mTouchDevice->setType(QTouchDevice::TouchScreen);
- mTouchDevice->setCapabilities(
- QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::Pressure |
- QTouchDevice::NormalizedPosition);
- QWindowSystemInterface::registerTouchDevice(mTouchDevice);
-}
-
-QMirClientInput::~QMirClientInput()
-{
- // Qt will take care of deleting mTouchDevice.
-}
-
-static const char* nativeEventTypeToStr(MirEventType t)
-{
- switch (t)
- {
- case mir_event_type_key:
- return "key";
- case mir_event_type_motion:
- return "motion";
- case mir_event_type_surface:
- return "surface";
- case mir_event_type_resize:
- return "resize";
- case mir_event_type_prompt_session_state_change:
- return "prompt_session_state_change";
- case mir_event_type_orientation:
- return "orientation";
- case mir_event_type_close_surface:
- return "close_surface";
- case mir_event_type_input:
- return "input";
- case mir_event_type_keymap:
- return "keymap";
- case mir_event_type_input_configuration:
- return "input_configuration";
- case mir_event_type_surface_output:
- return "surface_output";
- case mir_event_type_input_device_state:
- return "input_device_state";
- default:
- return "unknown";
- }
-}
-
-void QMirClientInput::customEvent(QEvent* event)
-{
- Q_ASSERT(QThread::currentThread() == thread());
- UbuntuEvent* ubuntuEvent = static_cast<UbuntuEvent*>(event);
- const MirEvent *nativeEvent = ubuntuEvent->nativeEvent;
-
- if ((ubuntuEvent->window == nullptr) || (ubuntuEvent->window->window() == nullptr)) {
- qCWarning(mirclient) << "Attempted to deliver an event to a non-existent window, ignoring.";
- return;
- }
-
- // Event filtering.
- long result;
- if (QWindowSystemInterface::handleNativeEvent(
- ubuntuEvent->window->window(), mEventFilterType,
- const_cast<void *>(static_cast<const void *>(nativeEvent)), &result) == true) {
- qCDebug(mirclient, "event filtered out by native interface");
- return;
- }
-
- qCDebug(mirclientInput, "customEvent(type=%s)", nativeEventTypeToStr(mir_event_get_type(nativeEvent)));
-
- // Event dispatching.
- switch (mir_event_get_type(nativeEvent))
- {
- case mir_event_type_input:
- dispatchInputEvent(ubuntuEvent->window, mir_event_get_input_event(nativeEvent));
- break;
- case mir_event_type_resize:
- {
- auto resizeEvent = mir_event_get_resize_event(nativeEvent);
-
- // Enable workaround for Screen rotation
- auto const targetWindow = ubuntuEvent->window;
- if (targetWindow) {
- auto const screen = static_cast<QMirClientScreen*>(targetWindow->screen());
- if (screen) {
- screen->handleWindowSurfaceResize(
- mir_resize_event_get_width(resizeEvent),
- mir_resize_event_get_height(resizeEvent));
- }
-
- targetWindow->handleSurfaceResized(
- mir_resize_event_get_width(resizeEvent),
- mir_resize_event_get_height(resizeEvent));
- }
- break;
- }
- case mir_event_type_surface:
- handleSurfaceEvent(ubuntuEvent->window, mir_event_get_surface_event(nativeEvent));
- break;
- case mir_event_type_surface_output:
- handleSurfaceOutputEvent(ubuntuEvent->window, mir_event_get_surface_output_event(nativeEvent));
- break;
- case mir_event_type_orientation:
- dispatchOrientationEvent(ubuntuEvent->window->window(), mir_event_get_orientation_event(nativeEvent));
- break;
- case mir_event_type_close_surface:
- QWindowSystemInterface::handleCloseEvent(ubuntuEvent->window->window());
- break;
- default:
- qCDebug(mirclient, "unhandled event type: %d", static_cast<int>(mir_event_get_type(nativeEvent)));
- }
-}
-
-void QMirClientInput::postEvent(QMirClientWindow *platformWindow, const MirEvent *event)
-{
- QWindow *window = platformWindow->window();
-
- QCoreApplication::postEvent(this, new UbuntuEvent(
- platformWindow, event, mEventType));
-
- if ((window->flags().testFlag(Qt::WindowTransparentForInput)) && window->parent()) {
- QCoreApplication::postEvent(this, new UbuntuEvent(
- static_cast<QMirClientWindow*>(platformWindow->QPlatformWindow::parent()),
- event, mEventType));
- }
-}
-
-void QMirClientInput::dispatchInputEvent(QMirClientWindow *window, const MirInputEvent *ev)
-{
- switch (mir_input_event_get_type(ev))
- {
- case mir_input_event_type_key:
- dispatchKeyEvent(window, ev);
- break;
- case mir_input_event_type_touch:
- dispatchTouchEvent(window, ev);
- break;
- case mir_input_event_type_pointer:
- dispatchPointerEvent(window, ev);
- break;
- default:
- break;
- }
-}
-
-void QMirClientInput::dispatchTouchEvent(QMirClientWindow *window, const MirInputEvent *ev)
-{
- const MirTouchEvent *tev = mir_input_event_get_touch_event(ev);
-
- // FIXME(loicm) Max pressure is device specific. That one is for the Samsung Galaxy Nexus. That
- // needs to be fixed as soon as the compat input lib adds query support.
- const float kMaxPressure = 1.28;
- const QRect kWindowGeometry = window->geometry();
- QList<QWindowSystemInterface::TouchPoint> touchPoints;
-
-
- // TODO: Is it worth setting the Qt::TouchPointStationary ones? Currently they are left
- // as Qt::TouchPointMoved
- const unsigned int kPointerCount = mir_touch_event_point_count(tev);
- touchPoints.reserve(int(kPointerCount));
- for (unsigned int i = 0; i < kPointerCount; ++i) {
- QWindowSystemInterface::TouchPoint touchPoint;
-
- const float kX = mir_touch_event_axis_value(tev, i, mir_touch_axis_x) + kWindowGeometry.x();
- const float kY = mir_touch_event_axis_value(tev, i, mir_touch_axis_y) + kWindowGeometry.y(); // see bug lp:1346633 workaround comments elsewhere
- const float kW = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_major);
- const float kH = mir_touch_event_axis_value(tev, i, mir_touch_axis_touch_minor);
- const float kP = mir_touch_event_axis_value(tev, i, mir_touch_axis_pressure);
- touchPoint.id = mir_touch_event_id(tev, i);
- touchPoint.normalPosition = QPointF(kX / kWindowGeometry.width(), kY / kWindowGeometry.height());
- touchPoint.area = QRectF(kX - (kW / 2.0), kY - (kH / 2.0), kW, kH);
- touchPoint.pressure = kP / kMaxPressure;
-
- MirTouchAction touch_action = mir_touch_event_action(tev, i);
- switch (touch_action)
- {
- case mir_touch_action_down:
- mLastInputWindow = window;
- touchPoint.state = Qt::TouchPointPressed;
- break;
- case mir_touch_action_up:
- touchPoint.state = Qt::TouchPointReleased;
- break;
- case mir_touch_action_change:
- touchPoint.state = Qt::TouchPointMoved;
- break;
- default:
- Q_UNREACHABLE();
- }
-
- touchPoints.append(touchPoint);
- }
-
- ulong timestamp = mir_input_event_get_event_time(ev) / 1000000;
- QWindowSystemInterface::handleTouchEvent(window->window(), timestamp,
- mTouchDevice, touchPoints);
-}
-
-static uint32_t translateKeysym(uint32_t sym, const QString &text) {
- int code = 0;
-
- QTextCodec *systemCodec = QTextCodec::codecForLocale();
- if (sym < 128 || (sym < 256 && systemCodec->mibEnum() == 4)) {
- // upper-case key, if known
- code = isprint((int)sym) ? toupper((int)sym) : 0;
- } else if (sym >= XKB_KEY_F1 && sym <= XKB_KEY_F35) {
- return Qt::Key_F1 + (int(sym) - XKB_KEY_F1);
- } else if (text.length() == 1 && text.unicode()->unicode() > 0x1f
- && text.unicode()->unicode() != 0x7f
- && !(sym >= XKB_KEY_dead_grave && sym <= XKB_KEY_dead_currency)) {
- code = text.unicode()->toUpper().unicode();
- } else {
- for (int i = 0; KeyTable[i]; i += 2)
- if (sym == KeyTable[i])
- code = KeyTable[i + 1];
- }
-
- return code;
-}
-
-namespace
-{
-Qt::KeyboardModifiers qt_modifiers_from_mir(MirInputEventModifiers modifiers)
-{
- Qt::KeyboardModifiers q_modifiers = Qt::NoModifier;
- if (modifiers & mir_input_event_modifier_shift) {
- q_modifiers |= Qt::ShiftModifier;
- }
- if (modifiers & mir_input_event_modifier_ctrl) {
- q_modifiers |= Qt::ControlModifier;
- }
- if (modifiers & mir_input_event_modifier_alt_left) {
- q_modifiers |= Qt::AltModifier;
- }
- if (modifiers & mir_input_event_modifier_meta) {
- q_modifiers |= Qt::MetaModifier;
- }
- if (modifiers & mir_input_event_modifier_alt_right) {
- q_modifiers |= Qt::GroupSwitchModifier;
- }
- return q_modifiers;
-}
-}
-
-void QMirClientInput::dispatchKeyEvent(QMirClientWindow *window, const MirInputEvent *event)
-{
- const MirKeyboardEvent *key_event = mir_input_event_get_keyboard_event(event);
-
- ulong timestamp = mir_input_event_get_event_time(event) / 1000000;
- xkb_keysym_t xk_sym = mir_keyboard_event_key_code(key_event);
- quint32 scan_code = mir_keyboard_event_scan_code(key_event);
- quint32 native_modifiers = mir_keyboard_event_modifiers(key_event);
-
- // Key modifier and unicode index mapping.
- auto modifiers = qt_modifiers_from_mir(native_modifiers);
-
- MirKeyboardAction action = mir_keyboard_event_action(key_event);
- QEvent::Type keyType = action == mir_keyboard_action_up
- ? QEvent::KeyRelease : QEvent::KeyPress;
-
- if (action == mir_keyboard_action_down)
- mLastInputWindow = window;
-
- QString text;
- QVarLengthArray<char, 32> chars(32);
- {
- int result = xkb_keysym_to_utf8(xk_sym, chars.data(), chars.size());
-
- if (result > 0) {
- text = QString::fromUtf8(chars.constData());
- }
- }
- int sym = translateKeysym(xk_sym, text);
-
- bool is_auto_rep = action == mir_keyboard_action_repeat;
-
- QPlatformInputContext *context = QGuiApplicationPrivate::platformIntegration()->inputContext();
- if (context) {
- QKeyEvent qKeyEvent(keyType, sym, modifiers, scan_code, xk_sym, native_modifiers, text, is_auto_rep);
- qKeyEvent.setTimestamp(timestamp);
- if (context->filterEvent(&qKeyEvent)) {
- qCDebug(mirclient, "key event filtered out by input context");
- return;
- }
- }
-
- QWindowSystemInterface::handleExtendedKeyEvent(window->window(), timestamp, keyType, sym, modifiers, scan_code, xk_sym, native_modifiers, text, is_auto_rep);
-}
-
-namespace
-{
-Qt::MouseButtons extract_buttons(const MirPointerEvent *pev)
-{
- Qt::MouseButtons buttons = Qt::NoButton;
- if (mir_pointer_event_button_state(pev, mir_pointer_button_primary))
- buttons |= Qt::LeftButton;
- if (mir_pointer_event_button_state(pev, mir_pointer_button_secondary))
- buttons |= Qt::RightButton;
- if (mir_pointer_event_button_state(pev, mir_pointer_button_tertiary))
- buttons |= Qt::MiddleButton;
- if (mir_pointer_event_button_state(pev, mir_pointer_button_back))
- buttons |= Qt::BackButton;
- if (mir_pointer_event_button_state(pev, mir_pointer_button_forward))
- buttons |= Qt::ForwardButton;
-
- return buttons;
-}
-}
-
-void QMirClientInput::dispatchPointerEvent(QMirClientWindow *platformWindow, const MirInputEvent *ev)
-{
- const auto window = platformWindow->window();
- const auto timestamp = mir_input_event_get_event_time(ev) / 1000000;
-
- const auto pev = mir_input_event_get_pointer_event(ev);
- const auto action = mir_pointer_event_action(pev);
-
- const auto modifiers = qt_modifiers_from_mir(mir_pointer_event_modifiers(pev));
- const auto localPoint = QPointF(mir_pointer_event_axis_value(pev, mir_pointer_axis_x),
- mir_pointer_event_axis_value(pev, mir_pointer_axis_y));
-
- mLastInputWindow = platformWindow;
-
- switch (action) {
- case mir_pointer_action_button_up:
- case mir_pointer_action_button_down:
- case mir_pointer_action_motion:
- {
- const float hDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_hscroll);
- const float vDelta = mir_pointer_event_axis_value(pev, mir_pointer_axis_vscroll);
-
- if (hDelta != 0 || vDelta != 0) {
- // QWheelEvent::DefaultDeltasPerStep = 120 but doesn't exist on vivid
- const QPoint angleDelta(120 * hDelta, 120 * vDelta);
- QWindowSystemInterface::handleWheelEvent(window, timestamp, localPoint, window->position() + localPoint,
- QPoint(), angleDelta, modifiers, Qt::ScrollUpdate);
- }
- auto buttons = extract_buttons(pev);
- QWindowSystemInterface::handleMouseEvent(window, timestamp, localPoint, window->position() + localPoint /* Should we omit global point instead? */,
- buttons, modifiers);
- break;
- }
- case mir_pointer_action_enter:
- QWindowSystemInterface::handleEnterEvent(window, localPoint, window->position() + localPoint);
- break;
- case mir_pointer_action_leave:
- QWindowSystemInterface::handleLeaveEvent(window);
- break;
- default:
- Q_UNREACHABLE();
- }
-}
-
-static const char* nativeOrientationDirectionToStr(MirOrientation orientation)
-{
- switch (orientation) {
- case mir_orientation_normal:
- return "Normal";
- case mir_orientation_left:
- return "Left";
- case mir_orientation_inverted:
- return "Inverted";
- case mir_orientation_right:
- return "Right";
- }
- Q_UNREACHABLE();
-}
-
-void QMirClientInput::dispatchOrientationEvent(QWindow *window, const MirOrientationEvent *event)
-{
- MirOrientation mir_orientation = mir_orientation_event_get_direction(event);
- qCDebug(mirclientInput, "orientation direction: %s", nativeOrientationDirectionToStr(mir_orientation));
-
- if (!window->screen()) {
- qCDebug(mirclient, "Window has no associated screen, dropping orientation event");
- return;
- }
-
- OrientationChangeEvent::Orientation orientation;
- switch (mir_orientation) {
- case mir_orientation_normal:
- orientation = OrientationChangeEvent::TopUp;
- break;
- case mir_orientation_left:
- orientation = OrientationChangeEvent::LeftUp;
- break;
- case mir_orientation_inverted:
- orientation = OrientationChangeEvent::TopDown;
- break;
- case mir_orientation_right:
- orientation = OrientationChangeEvent::RightUp;
- break;
- default:
- qCDebug(mirclient, "No such orientation %d", mir_orientation);
- return;
- }
-
- // Dispatch orientation event to [Platform]Screen, as that is where Qt reads it. Screen will handle
- // notifying Qt of the actual orientation change - done to prevent multiple Windows each creating
- // an identical orientation change event and passing it directly to Qt.
- // [Platform]Screen can also factor in the native orientation.
- QCoreApplication::postEvent(static_cast<QMirClientScreen*>(window->screen()->handle()),
- new OrientationChangeEvent(OrientationChangeEvent::mType, orientation));
-}
-
-void QMirClientInput::handleSurfaceEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceEvent *event)
-{
- auto surfaceEventAttribute = mir_surface_event_get_attribute(event);
-
- switch (surfaceEventAttribute) {
- case mir_surface_attrib_focus: {
- window->handleSurfaceFocusChanged(
- mir_surface_event_get_attribute_value(event) == mir_surface_focused);
- break;
- }
- case mir_surface_attrib_visibility: {
- window->handleSurfaceExposeChange(
- mir_surface_event_get_attribute_value(event) == mir_surface_visibility_exposed);
- break;
- }
- // Remaining attributes are ones client sets for server, and server should not override them
- case mir_surface_attrib_state: {
- MirSurfaceState state = static_cast<MirSurfaceState>(mir_surface_event_get_attribute_value(event));
-
- if (state == mir_surface_state_hidden) {
- window->handleSurfaceVisibilityChanged(false);
- } else {
- // it's visible!
- window->handleSurfaceVisibilityChanged(true);
- window->handleSurfaceStateChanged(mirSurfaceStateToWindowState(state));
- }
- break;
- }
- case mir_surface_attrib_type:
- case mir_surface_attrib_swapinterval:
- case mir_surface_attrib_dpi:
- case mir_surface_attrib_preferred_orientation:
- case mir_surface_attribs:
- break;
- }
-}
-
-void QMirClientInput::handleSurfaceOutputEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceOutputEvent *event)
-{
- const uint32_t outputId = mir_surface_output_event_get_output_id(event);
- const int dpi = mir_surface_output_event_get_dpi(event);
- const MirFormFactor formFactor = mir_surface_output_event_get_form_factor(event);
- const float scale = mir_surface_output_event_get_scale(event);
-
- const auto screenObserver = mIntegration->screenObserver();
- QMirClientScreen *screen = screenObserver->findScreenWithId(outputId);
- if (!screen) {
- qCWarning(mirclient) << "Mir notified window" << window->window() << "on an unknown screen with id" << outputId;
- return;
- }
-
- screenObserver->handleScreenPropertiesChange(screen, dpi, formFactor, scale);
- window->handleScreenPropertiesChange(formFactor, scale);
-
- if (window->screen() != screen) {
- QWindowSystemInterface::handleWindowScreenChanged(window->window(), screen->screen());
- }
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientinput.h b/src/plugins/platforms/mirclient/qmirclientinput.h
deleted file mode 100644
index 263cb5e54e..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientinput.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTINPUT_H
-#define QMIRCLIENTINPUT_H
-
-// Qt
-#include <qpa/qwindowsysteminterface.h>
-
-#include <mir_toolkit/mir_client_library.h>
-
-class QMirClientClientIntegration;
-class QMirClientWindow;
-
-class QMirClientInput : public QObject
-{
- Q_OBJECT
-
-public:
- QMirClientInput(QMirClientClientIntegration* integration);
- virtual ~QMirClientInput();
-
- // QObject methods.
- void customEvent(QEvent* event) override;
-
- void postEvent(QMirClientWindow* window, const MirEvent *event);
- QMirClientClientIntegration* integration() const { return mIntegration; }
- QMirClientWindow *lastInputWindow() const {return mLastInputWindow; }
-
-protected:
- void dispatchKeyEvent(QMirClientWindow *window, const MirInputEvent *event);
- void dispatchPointerEvent(QMirClientWindow *window, const MirInputEvent *event);
- void dispatchTouchEvent(QMirClientWindow *window, const MirInputEvent *event);
- void dispatchInputEvent(QMirClientWindow *window, const MirInputEvent *event);
-
- void dispatchOrientationEvent(QWindow* window, const MirOrientationEvent *event);
- void handleSurfaceEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceEvent *event);
- void handleSurfaceOutputEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceOutputEvent *event);
-
-private:
- QMirClientClientIntegration* mIntegration;
- QTouchDevice* mTouchDevice;
- const QByteArray mEventFilterType;
- const QEvent::Type mEventType;
-
- QMirClientWindow *mLastInputWindow;
-};
-
-#endif // QMIRCLIENTINPUT_H
diff --git a/src/plugins/platforms/mirclient/qmirclientintegration.cpp b/src/plugins/platforms/mirclient/qmirclientintegration.cpp
deleted file mode 100644
index d2b1dbee0d..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientintegration.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// Local
-#include "qmirclientintegration.h"
-#include "qmirclientbackingstore.h"
-#include "qmirclientclipboard.h"
-#include "qmirclientdebugextension.h"
-#include "qmirclientdesktopwindow.h"
-#include "qmirclientglcontext.h"
-#include "qmirclientinput.h"
-#include "qmirclientlogging.h"
-#include "qmirclientnativeinterface.h"
-#include "qmirclientscreen.h"
-#include "qmirclienttheme.h"
-#include "qmirclientwindow.h"
-
-// Qt
-#include <QFileInfo>
-#include <QGuiApplication>
-#include <qpa/qplatformnativeinterface.h>
-#include <qpa/qplatforminputcontextfactory_p.h>
-#include <qpa/qplatforminputcontext.h>
-#include <qpa/qwindowsysteminterface.h>
-#include <QtEglSupport/private/qeglconvenience_p.h>
-#include <QtEglSupport/private/qeglpbuffer_p.h>
-#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
-#ifndef QT_NO_ACCESSIBILITY
-#include <qpa/qplatformaccessibility.h>
-#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE
-#include <QtLinuxAccessibilitySupport/private/bridge_p.h>
-#endif
-#endif
-
-#include <QOpenGLContext>
-#include <QOffscreenSurface>
-
-// platform-api
-#include <ubuntu/application/lifecycle_delegate.h>
-#include <ubuntu/application/id.h>
-#include <ubuntu/application/options.h>
-
-static void resumedCallback(const UApplicationOptions */*options*/, void* context)
-{
- auto integration = static_cast<QMirClientClientIntegration*>(context);
- integration->appStateController()->setResumed();
-}
-
-static void aboutToStopCallback(UApplicationArchive */*archive*/, void* context)
-{
- auto integration = static_cast<QMirClientClientIntegration*>(context);
- auto inputContext = integration->inputContext();
- if (inputContext) {
- inputContext->hideInputPanel();
- } else {
- qCWarning(mirclient) << "aboutToStopCallback(): no input context";
- }
- integration->appStateController()->setSuspended();
-}
-
-QMirClientClientIntegration::QMirClientClientIntegration(int argc, char **argv)
- : QPlatformIntegration()
- , mNativeInterface(new QMirClientNativeInterface(this))
- , mFontDb(new QGenericUnixFontDatabase)
- , mServices(new QMirClientPlatformServices)
- , mAppStateController(new QMirClientAppStateController)
- , mScaleFactor(1.0)
-{
- {
- QStringList args = QCoreApplication::arguments();
- setupOptions(args);
- QByteArray sessionName = generateSessionName(args);
- setupDescription(sessionName);
- }
-
- // Create new application instance
- mInstance = u_application_instance_new_from_description_with_options(mDesc, mOptions);
-
- if (Q_UNLIKELY(!mInstance))
- qFatal("QMirClientClientIntegration: connection to Mir server failed. Check that a Mir server is\n"
- "running, and the correct socket is being used and is accessible. The shell may have\n"
- "rejected the incoming connection, so check its log file");
-
- mMirConnection = u_application_instance_get_mir_connection(mInstance);
-
- // Choose the default surface format suited to the Mir platform
- QSurfaceFormat defaultFormat;
- defaultFormat.setRedBufferSize(8);
- defaultFormat.setGreenBufferSize(8);
- defaultFormat.setBlueBufferSize(8);
- QSurfaceFormat::setDefaultFormat(defaultFormat);
-
- // Initialize EGL.
- mEglNativeDisplay = mir_connection_get_egl_native_display(mMirConnection);
- ASSERT((mEglDisplay = eglGetDisplay(mEglNativeDisplay)) != EGL_NO_DISPLAY);
- ASSERT(eglInitialize(mEglDisplay, nullptr, nullptr) == EGL_TRUE);
-
- // Has debug mode been requsted, either with "-testability" switch or QT_LOAD_TESTABILITY env var
- bool testability = qEnvironmentVariableIsSet("QT_LOAD_TESTABILITY");
- for (int i=1; !testability && i<argc; i++) {
- if (strcmp(argv[i], "-testability") == 0) {
- testability = true;
- }
- }
- if (testability) {
- mDebugExtension.reset(new QMirClientDebugExtension);
- }
-}
-
-void QMirClientClientIntegration::initialize()
-{
- // Init the ScreenObserver
- mScreenObserver.reset(new QMirClientScreenObserver(mMirConnection));
- connect(mScreenObserver.data(), &QMirClientScreenObserver::screenAdded,
- [this](QMirClientScreen *screen) { QWindowSystemInterface::handleScreenAdded(screen); });
- connect(mScreenObserver.data(), &QMirClientScreenObserver::screenRemoved,
- this, &QMirClientClientIntegration::destroyScreen);
-
- Q_FOREACH (auto screen, mScreenObserver->screens()) {
- QWindowSystemInterface::handleScreenAdded(screen);
- }
-
- // Initialize input.
- mInput = new QMirClientInput(this);
- mInputContext = QPlatformInputContextFactory::create();
-
- // compute the scale factor
- const int defaultGridUnit = 8;
- int gridUnit = defaultGridUnit;
- QByteArray gridUnitString = qgetenv("GRID_UNIT_PX");
- if (!gridUnitString.isEmpty()) {
- bool ok;
- gridUnit = gridUnitString.toInt(&ok);
- if (!ok) {
- gridUnit = defaultGridUnit;
- }
- }
- mScaleFactor = static_cast<qreal>(gridUnit) / defaultGridUnit;
-}
-
-QMirClientClientIntegration::~QMirClientClientIntegration()
-{
- eglTerminate(mEglDisplay);
- delete mInput;
- delete mInputContext;
- delete mServices;
-}
-
-QPlatformServices *QMirClientClientIntegration::services() const
-{
- return mServices;
-}
-
-void QMirClientClientIntegration::setupOptions(QStringList &args)
-{
- int argc = args.size() + 1;
- char **argv = new char*[argc];
- for (int i = 0; i < argc - 1; i++)
- argv[i] = qstrdup(args.at(i).toLocal8Bit());
- argv[argc - 1] = nullptr;
-
- mOptions = u_application_options_new_from_cmd_line(argc - 1, argv);
-
- for (int i = 0; i < argc; i++)
- delete [] argv[i];
- delete [] argv;
-}
-
-void QMirClientClientIntegration::setupDescription(QByteArray &sessionName)
-{
- mDesc = u_application_description_new();
-
- UApplicationId* id = u_application_id_new_from_stringn(sessionName.data(), sessionName.count());
- u_application_description_set_application_id(mDesc, id);
-
- UApplicationLifecycleDelegate* delegate = u_application_lifecycle_delegate_new();
- u_application_lifecycle_delegate_set_application_resumed_cb(delegate, &resumedCallback);
- u_application_lifecycle_delegate_set_application_about_to_stop_cb(delegate, &aboutToStopCallback);
- u_application_lifecycle_delegate_set_context(delegate, this);
- u_application_description_set_application_lifecycle_delegate(mDesc, delegate);
-}
-
-QByteArray QMirClientClientIntegration::generateSessionName(QStringList &args)
-{
- // Try to come up with some meaningful session name to uniquely identify this session,
- // helping with shell debugging
-
- if (args.count() == 0) {
- return QByteArray("QtUbuntu");
- } if (args[0].contains("qmlscene")) {
- return generateSessionNameFromQmlFile(args);
- } else {
- // use the executable name
- QFileInfo fileInfo(args[0]);
- return fileInfo.fileName().toLocal8Bit();
- }
-}
-
-QByteArray QMirClientClientIntegration::generateSessionNameFromQmlFile(QStringList &args)
-{
- Q_FOREACH (QString arg, args) {
- if (arg.endsWith(".qml")) {
- QFileInfo fileInfo(arg);
- return fileInfo.fileName().toLocal8Bit();
- }
- }
-
- // give up
- return "qmlscene";
-}
-
-QPlatformWindow* QMirClientClientIntegration::createPlatformWindow(QWindow* window) const
-{
- if (window->type() == Qt::Desktop) {
- // Desktop windows should not be backed up by a mir surface as they don't draw anything (nor should).
- return new QMirClientDesktopWindow(window);
- } else {
- return new QMirClientWindow(window, mInput, mNativeInterface, mAppStateController.data(),
- mEglDisplay, mMirConnection, mDebugExtension.data());
- }
-}
-
-bool QMirClientClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
-{
- switch (cap) {
- case ThreadedOpenGL:
- if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
- return true;
- } else {
- qCDebug(mirclient, "disabled threaded OpenGL");
- return false;
- }
-
- case ThreadedPixmaps:
- case OpenGL:
- case ApplicationState:
- case MultipleWindows:
- case NonFullScreenWindows:
-#if QT_VERSION > QT_VERSION_CHECK(5, 5, 0)
- case SwitchableWidgetComposition:
-#endif
- case RasterGLSurface: // needed for QQuickWidget
- return true;
- default:
- return QPlatformIntegration::hasCapability(cap);
- }
-}
-
-QAbstractEventDispatcher *QMirClientClientIntegration::createEventDispatcher() const
-{
- return createUnixEventDispatcher();
-}
-
-QPlatformBackingStore* QMirClientClientIntegration::createPlatformBackingStore(QWindow* window) const
-{
- return new QMirClientBackingStore(window);
-}
-
-QPlatformOpenGLContext* QMirClientClientIntegration::createPlatformOpenGLContext(
- QOpenGLContext* context) const
-{
- QSurfaceFormat format(context->format());
-
- auto platformContext = new QMirClientOpenGLContext(format, context->shareHandle(), mEglDisplay);
- if (!platformContext->isValid()) {
- // Older Intel Atom-based devices only support OpenGL 1.4 compatibility profile but by default
- // QML asks for at least OpenGL 2.0. The XCB GLX backend ignores this request and returns a
- // 1.4 context, but the XCB EGL backend tries to honor it, and fails. The 1.4 context appears to
- // have sufficient capabilities on MESA (i915) to render correctly however. So reduce the default
- // requested OpenGL version to 1.0 to ensure EGL will give us a working context (lp:1549455).
- static const bool isMesa = QString(eglQueryString(mEglDisplay, EGL_VENDOR)).contains(QStringLiteral("Mesa"));
- if (isMesa) {
- qCDebug(mirclientGraphics, "Attempting to choose OpenGL 1.4 context which may suit Mesa");
- format.setMajorVersion(1);
- format.setMinorVersion(4);
- delete platformContext;
- platformContext = new QMirClientOpenGLContext(format, context->shareHandle(), mEglDisplay);
- }
- }
- return platformContext;
-}
-
-QStringList QMirClientClientIntegration::themeNames() const
-{
- return QStringList(QMirClientTheme::name);
-}
-
-QPlatformTheme* QMirClientClientIntegration::createPlatformTheme(const QString& name) const
-{
- Q_UNUSED(name);
- return new QMirClientTheme;
-}
-
-QVariant QMirClientClientIntegration::styleHint(StyleHint hint) const
-{
- switch (hint) {
- case QPlatformIntegration::StartDragDistance: {
- // default is 10 pixels (see QPlatformTheme::defaultThemeHint)
- return 10.0 * mScaleFactor;
- }
- case QPlatformIntegration::PasswordMaskDelay: {
- // return time in milliseconds - 1 second
- return QVariant(1000);
- }
- default:
- break;
- }
- return QPlatformIntegration::styleHint(hint);
-}
-
-QPlatformClipboard* QMirClientClientIntegration::clipboard() const
-{
- static QPlatformClipboard *clipboard = nullptr;
- if (!clipboard) {
- clipboard = new QMirClientClipboard;
- }
- return clipboard;
-}
-
-QPlatformNativeInterface* QMirClientClientIntegration::nativeInterface() const
-{
- return mNativeInterface;
-}
-
-QPlatformOffscreenSurface *QMirClientClientIntegration::createPlatformOffscreenSurface(
- QOffscreenSurface *surface) const
-{
- return new QEGLPbuffer(mEglDisplay, surface->requestedFormat(), surface);
-}
-
-void QMirClientClientIntegration::destroyScreen(QMirClientScreen *screen)
-{
- // FIXME: on deleting a screen while a Window is on it, Qt will automatically
- // move the window to the primaryScreen(). This will trigger a screenChanged
- // signal, causing things like QQuickScreenAttached to re-fetch screen properties
- // like DPI and physical size. However this is crashing, as Qt is calling virtual
- // functions on QPlatformScreen, for reasons unclear. As workaround, move window
- // to primaryScreen() before deleting the screen. Might be QTBUG-38650
-
- QScreen *primaryScreen = QGuiApplication::primaryScreen();
- if (screen != primaryScreen->handle()) {
- uint32_t movedWindowCount = 0;
- Q_FOREACH (QWindow *w, QGuiApplication::topLevelWindows()) {
- if (w->screen()->handle() == screen) {
- QWindowSystemInterface::handleWindowScreenChanged(w, primaryScreen);
- ++movedWindowCount;
- }
- }
- if (movedWindowCount > 0) {
- QWindowSystemInterface::flushWindowSystemEvents();
- }
- }
-
- qCDebug(mirclient) << "Removing Screen with id" << screen->mirOutputId() << "and geometry" << screen->geometry();
-#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
- delete screen;
-#else
- QWindowSystemInterface::handleScreenRemoved(screen);
-#endif
-}
-
-#ifndef QT_NO_ACCESSIBILITY
-QPlatformAccessibility *QMirClientClientIntegration::accessibility() const
-{
-#if !defined(QT_NO_ACCESSIBILITY_ATSPI_BRIDGE)
- if (!mAccessibility) {
- Q_ASSERT_X(QCoreApplication::eventDispatcher(), "QMirClientIntegration",
- "Initializing accessibility without event-dispatcher!");
- mAccessibility.reset(new QSpiAccessibleBridge());
- }
-#endif
- return mAccessibility.data();
-}
-#endif
diff --git a/src/plugins/platforms/mirclient/qmirclientintegration.h b/src/plugins/platforms/mirclient/qmirclientintegration.h
deleted file mode 100644
index 035117f4da..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientintegration.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTINTEGRATION_H
-#define QMIRCLIENTINTEGRATION_H
-
-#include <qpa/qplatformintegration.h>
-#include <QSharedPointer>
-
-#include "qmirclientappstatecontroller.h"
-#include "qmirclientplatformservices.h"
-#include "qmirclientscreenobserver.h"
-
-// platform-api
-#include <ubuntu/application/description.h>
-#include <ubuntu/application/instance.h>
-
-#include <EGL/egl.h>
-
-class QMirClientDebugExtension;
-class QMirClientInput;
-class QMirClientNativeInterface;
-class QMirClientScreen;
-class MirConnection;
-
-class QMirClientClientIntegration : public QObject, public QPlatformIntegration
-{
- Q_OBJECT
-
-public:
- QMirClientClientIntegration(int argc, char **argv);
- virtual ~QMirClientClientIntegration();
-
- // QPlatformIntegration methods.
- bool hasCapability(QPlatformIntegration::Capability cap) const override;
- QAbstractEventDispatcher *createEventDispatcher() const override;
- QPlatformNativeInterface* nativeInterface() const override;
- QPlatformBackingStore* createPlatformBackingStore(QWindow* window) const override;
- QPlatformOpenGLContext* createPlatformOpenGLContext(QOpenGLContext* context) const override;
- QPlatformFontDatabase* fontDatabase() const override { return mFontDb; }
- QStringList themeNames() const override;
- QPlatformTheme* createPlatformTheme(const QString& name) const override;
- QVariant styleHint(StyleHint hint) const override;
- QPlatformServices *services() const override;
- QPlatformWindow* createPlatformWindow(QWindow* window) const override;
- QPlatformInputContext* inputContext() const override { return mInputContext; }
- QPlatformClipboard* clipboard() const override;
- void initialize() override;
- QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
- QPlatformAccessibility *accessibility() const override;
-
- // New methods.
- MirConnection *mirConnection() const { return mMirConnection; }
- EGLDisplay eglDisplay() const { return mEglDisplay; }
- EGLNativeDisplayType eglNativeDisplay() const { return mEglNativeDisplay; }
- QMirClientAppStateController *appStateController() const { return mAppStateController.data(); }
- QMirClientScreenObserver *screenObserver() const { return mScreenObserver.data(); }
- QMirClientDebugExtension *debugExtension() const { return mDebugExtension.data(); }
-
-private Q_SLOTS:
- void destroyScreen(QMirClientScreen *screen);
-
-private:
- void setupOptions(QStringList &args);
- void setupDescription(QByteArray &sessionName);
- static QByteArray generateSessionName(QStringList &args);
- static QByteArray generateSessionNameFromQmlFile(QStringList &args);
-
- QMirClientNativeInterface* mNativeInterface;
- QPlatformFontDatabase* mFontDb;
-
- QMirClientPlatformServices* mServices;
-
- QMirClientInput* mInput;
- QPlatformInputContext* mInputContext;
- mutable QScopedPointer<QPlatformAccessibility> mAccessibility;
- QScopedPointer<QMirClientDebugExtension> mDebugExtension;
- QScopedPointer<QMirClientScreenObserver> mScreenObserver;
- QScopedPointer<QMirClientAppStateController> mAppStateController;
- qreal mScaleFactor;
-
- MirConnection *mMirConnection;
-
- // Platform API stuff
- UApplicationOptions* mOptions;
- UApplicationDescription* mDesc;
- UApplicationInstance* mInstance;
-
- // EGL related
- EGLDisplay mEglDisplay{EGL_NO_DISPLAY};
- EGLNativeDisplayType mEglNativeDisplay;
-};
-
-#endif // QMIRCLIENTINTEGRATION_H
diff --git a/src/plugins/platforms/mirclient/qmirclientlogging.h b/src/plugins/platforms/mirclient/qmirclientlogging.h
deleted file mode 100644
index 4921864ced..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientlogging.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTLOGGING_H
-#define QMIRCLIENTLOGGING_H
-
-#include <QLoggingCategory>
-
-#define ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
-
-Q_DECLARE_LOGGING_CATEGORY(mirclient)
-Q_DECLARE_LOGGING_CATEGORY(mirclientBufferSwap)
-Q_DECLARE_LOGGING_CATEGORY(mirclientInput)
-Q_DECLARE_LOGGING_CATEGORY(mirclientGraphics)
-Q_DECLARE_LOGGING_CATEGORY(mirclientCursor)
-Q_DECLARE_LOGGING_CATEGORY(mirclientDebug)
-
-#endif // QMIRCLIENTLOGGING_H
diff --git a/src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp b/src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp
deleted file mode 100644
index b85e6fedfa..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientnativeinterface.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// Local
-#include "qmirclientnativeinterface.h"
-#include "qmirclientscreen.h"
-#include "qmirclientglcontext.h"
-#include "qmirclientwindow.h"
-
-// Qt
-#include <QtGui/private/qguiapplication_p.h>
-#include <QtGui/qopenglcontext.h>
-#include <QtGui/qscreen.h>
-#include <QtCore/QMap>
-
-class UbuntuResourceMap : public QMap<QByteArray, QMirClientNativeInterface::ResourceType>
-{
-public:
- UbuntuResourceMap()
- : QMap<QByteArray, QMirClientNativeInterface::ResourceType>() {
- insert("egldisplay", QMirClientNativeInterface::EglDisplay);
- insert("eglcontext", QMirClientNativeInterface::EglContext);
- insert("nativeorientation", QMirClientNativeInterface::NativeOrientation);
- insert("display", QMirClientNativeInterface::Display);
- insert("mirconnection", QMirClientNativeInterface::MirConnection);
- insert("mirsurface", QMirClientNativeInterface::MirSurface);
- insert("scale", QMirClientNativeInterface::Scale);
- insert("formfactor", QMirClientNativeInterface::FormFactor);
- }
-};
-
-Q_GLOBAL_STATIC(UbuntuResourceMap, ubuntuResourceMap)
-
-QMirClientNativeInterface::QMirClientNativeInterface(const QMirClientClientIntegration *integration)
- : mIntegration(integration)
- , mGenericEventFilterType(QByteArrayLiteral("Event"))
- , mNativeOrientation(nullptr)
-{
-}
-
-QMirClientNativeInterface::~QMirClientNativeInterface()
-{
- delete mNativeOrientation;
- mNativeOrientation = nullptr;
-}
-
-void* QMirClientNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
-{
- const QByteArray lowerCaseResource = resourceString.toLower();
-
- if (!ubuntuResourceMap()->contains(lowerCaseResource)) {
- return nullptr;
- }
-
- const ResourceType resourceType = ubuntuResourceMap()->value(lowerCaseResource);
-
- if (resourceType == QMirClientNativeInterface::MirConnection) {
- return mIntegration->mirConnection();
- } else {
- return nullptr;
- }
-}
-
-void* QMirClientNativeInterface::nativeResourceForContext(
- const QByteArray& resourceString, QOpenGLContext* context)
-{
- if (!context)
- return nullptr;
-
- const QByteArray kLowerCaseResource = resourceString.toLower();
-
- if (!ubuntuResourceMap()->contains(kLowerCaseResource))
- return nullptr;
-
- const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
-
- if (kResourceType == QMirClientNativeInterface::EglContext)
- return static_cast<QMirClientOpenGLContext*>(context->handle())->eglContext();
- else
- return nullptr;
-}
-
-void* QMirClientNativeInterface::nativeResourceForWindow(const QByteArray& resourceString, QWindow* window)
-{
- const QByteArray kLowerCaseResource = resourceString.toLower();
- if (!ubuntuResourceMap()->contains(kLowerCaseResource))
- return NULL;
- const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
-
- switch (kResourceType) {
- case EglDisplay:
- return mIntegration->eglDisplay();
- case NativeOrientation:
- // Return the device's native screen orientation.
- if (window) {
- QMirClientScreen *ubuntuScreen = static_cast<QMirClientScreen*>(window->screen()->handle());
- mNativeOrientation = new Qt::ScreenOrientation(ubuntuScreen->nativeOrientation());
- } else {
- QPlatformScreen *platformScreen = QGuiApplication::primaryScreen()->handle();
- mNativeOrientation = new Qt::ScreenOrientation(platformScreen->nativeOrientation());
- }
- return mNativeOrientation;
- case MirSurface:
- if (window) {
- auto ubuntuWindow = static_cast<QMirClientWindow*>(window->handle());
- if (ubuntuWindow) {
- return ubuntuWindow->mirSurface();
- } else {
- return nullptr;
- }
- } else {
- return nullptr;
- }
- default:
- return nullptr;
- }
-}
-
-void* QMirClientNativeInterface::nativeResourceForScreen(const QByteArray& resourceString, QScreen* screen)
-{
- const QByteArray kLowerCaseResource = resourceString.toLower();
- if (!ubuntuResourceMap()->contains(kLowerCaseResource))
- return NULL;
- const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
- if (!screen)
- screen = QGuiApplication::primaryScreen();
- auto ubuntuScreen = static_cast<QMirClientScreen*>(screen->handle());
- if (kResourceType == QMirClientNativeInterface::Display) {
- return mIntegration->eglNativeDisplay();
- // Changes to the following properties are emitted via the QMirClientNativeInterface::screenPropertyChanged
- // signal fired by QMirClientScreen. Connect to this signal for these properties updates.
- // WARNING: code highly thread unsafe!
- } else if (kResourceType == QMirClientNativeInterface::Scale) {
- // In application code, read with:
- // float scale = *reinterpret_cast<float*>(nativeResourceForScreen("scale", screen()));
- return &ubuntuScreen->mScale;
- } else if (kResourceType == QMirClientNativeInterface::FormFactor) {
- return &ubuntuScreen->mFormFactor;
- } else
- return NULL;
-}
-
-// Changes to these properties are emitted via the QMirClientNativeInterface::windowPropertyChanged
-// signal fired by QMirClientWindow. Connect to this signal for these properties updates.
-QVariantMap QMirClientNativeInterface::windowProperties(QPlatformWindow *window) const
-{
- QVariantMap propertyMap;
- auto w = static_cast<QMirClientWindow*>(window);
- if (w) {
- propertyMap.insert("scale", w->scale());
- propertyMap.insert("formFactor", w->formFactor());
- }
- return propertyMap;
-}
-
-QVariant QMirClientNativeInterface::windowProperty(QPlatformWindow *window, const QString &name) const
-{
- auto w = static_cast<QMirClientWindow*>(window);
- if (!w) {
- return QVariant();
- }
-
- if (name == QStringLiteral("scale")) {
- return w->scale();
- } else if (name == QStringLiteral("formFactor")) {
- return w->formFactor();
- } else {
- return QVariant();
- }
-}
-
-QVariant QMirClientNativeInterface::windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const
-{
- QVariant returnVal = windowProperty(window, name);
- if (!returnVal.isValid()) {
- return defaultValue;
- } else {
- return returnVal;
- }
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientnativeinterface.h b/src/plugins/platforms/mirclient/qmirclientnativeinterface.h
deleted file mode 100644
index eb601de301..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientnativeinterface.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTNATIVEINTERFACE_H
-#define QMIRCLIENTNATIVEINTERFACE_H
-
-#include <qpa/qplatformnativeinterface.h>
-
-#include "qmirclientintegration.h"
-
-class QPlatformScreen;
-
-class QMirClientNativeInterface : public QPlatformNativeInterface {
- Q_OBJECT
-public:
- enum ResourceType { EglDisplay, EglContext, NativeOrientation, Display, MirConnection, MirSurface, Scale, FormFactor };
-
- QMirClientNativeInterface(const QMirClientClientIntegration *integration);
- ~QMirClientNativeInterface();
-
- // QPlatformNativeInterface methods.
- void* nativeResourceForIntegration(const QByteArray &resource) override;
- void* nativeResourceForContext(const QByteArray& resourceString,
- QOpenGLContext* context) override;
- void* nativeResourceForWindow(const QByteArray& resourceString,
- QWindow* window) override;
- void* nativeResourceForScreen(const QByteArray& resourceString,
- QScreen* screen) override;
-
- QVariantMap windowProperties(QPlatformWindow *window) const override;
- QVariant windowProperty(QPlatformWindow *window, const QString &name) const override;
- QVariant windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const override;
-
- // New methods.
- const QByteArray& genericEventFilterType() const { return mGenericEventFilterType; }
-
-Q_SIGNALS: // New signals
- void screenPropertyChanged(QPlatformScreen *screen, const QString &propertyName);
-
-private:
- const QMirClientClientIntegration *mIntegration;
- const QByteArray mGenericEventFilterType;
- Qt::ScreenOrientation* mNativeOrientation;
-};
-
-#endif // QMIRCLIENTNATIVEINTERFACE_H
diff --git a/src/plugins/platforms/mirclient/qmirclientplatformservices.cpp b/src/plugins/platforms/mirclient/qmirclientplatformservices.cpp
deleted file mode 100644
index 1ccd57fc28..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientplatformservices.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientplatformservices.h"
-
-#include <QUrl>
-
-#include <ubuntu/application/url_dispatcher/service.h>
-#include <ubuntu/application/url_dispatcher/session.h>
-
-bool QMirClientPlatformServices::openUrl(const QUrl &url)
-{
- return callDispatcher(url);
-}
-
-bool QMirClientPlatformServices::openDocument(const QUrl &url)
-{
- return callDispatcher(url);
-}
-
-bool QMirClientPlatformServices::callDispatcher(const QUrl &url)
-{
- UAUrlDispatcherSession* session = ua_url_dispatcher_session();
- if (!session)
- return false;
-
- ua_url_dispatcher_session_open(session, url.toEncoded().constData(), NULL, NULL);
-
- free(session);
-
- // We are returning true here because the other option
- // is spawning a nested event loop and wait for the
- // callback. But there is no guarantee on how fast
- // the callback is going to be so we prefer to avoid the
- // nested event loop. Long term plan is improve Qt API
- // to support an async openUrl
- return true;
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientplatformservices.h b/src/plugins/platforms/mirclient/qmirclientplatformservices.h
deleted file mode 100644
index a1cd5758ca..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientplatformservices.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTPLATFORMSERVICES_H
-#define QMIRCLIENTPLATFORMSERVICES_H
-
-#include <qpa/qplatformservices.h>
-#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
-
-class QMirClientPlatformServices : public QPlatformServices {
-public:
- bool openUrl(const QUrl &url) override;
- bool openDocument(const QUrl &url) override;
-
-private:
- bool callDispatcher(const QUrl &url);
-};
-
-#endif // QMIRCLIENTPLATFORMSERVICES_H
diff --git a/src/plugins/platforms/mirclient/qmirclientplugin.cpp b/src/plugins/platforms/mirclient/qmirclientplugin.cpp
deleted file mode 100644
index fc44edfe40..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientplugin.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientplugin.h"
-#include "qmirclientintegration.h"
-#include "qmirclientlogging.h"
-
-Q_LOGGING_CATEGORY(mirclient, "qt.qpa.mirclient", QtWarningMsg)
-
-QPlatformIntegration *QMirClientIntegrationPlugin::create(const QString &system,
- const QStringList &/*paramList*/,
- int &argc, char **argv)
-{
- if (system.toLower() == QLatin1String("mirclient")) {
- return new QMirClientClientIntegration(argc, argv);
- } else {
- return 0;
- }
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientscreen.cpp b/src/plugins/platforms/mirclient/qmirclientscreen.cpp
deleted file mode 100644
index cc8db830aa..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientscreen.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// local
-#include "qmirclientscreen.h"
-#include "qmirclientlogging.h"
-#include "qmirclientorientationchangeevent_p.h"
-#include "qmirclientnativeinterface.h"
-
-#include <mir_toolkit/mir_client_library.h>
-
-// Qt
-#include <QGuiApplication>
-#include <QtCore/qmath.h>
-#include <QScreen>
-#include <QThread>
-#include <qpa/qwindowsysteminterface.h>
-#include <QtEglSupport/private/qeglconvenience_p.h>
-
-#include <memory>
-
-static const int overrideDevicePixelRatio = qgetenv("QT_DEVICE_PIXEL_RATIO").toInt();
-
-static const char *orientationToStr(Qt::ScreenOrientation orientation) {
- switch (orientation) {
- case Qt::PrimaryOrientation:
- return "primary";
- case Qt::PortraitOrientation:
- return "portrait";
- case Qt::LandscapeOrientation:
- return "landscape";
- case Qt::InvertedPortraitOrientation:
- return "inverted portrait";
- case Qt::InvertedLandscapeOrientation:
- return "inverted landscape";
- }
- Q_UNREACHABLE();
-}
-
-const QEvent::Type OrientationChangeEvent::mType =
- static_cast<QEvent::Type>(QEvent::registerEventType());
-
-
-QMirClientScreen::QMirClientScreen(const MirOutput *output, MirConnection *connection)
- : mDevicePixelRatio(1.0)
- , mFormat(QImage::Format_RGB32)
- , mDepth(32)
- , mDpi{0}
- , mFormFactor{mir_form_factor_unknown}
- , mScale{1.0}
- , mOutputId(0)
- , mCursor(connection)
-{
- setMirOutput(output);
-}
-
-QMirClientScreen::~QMirClientScreen()
-{
-}
-
-void QMirClientScreen::customEvent(QEvent* event) {
- Q_ASSERT(QThread::currentThread() == thread());
-
- OrientationChangeEvent* oReadingEvent = static_cast<OrientationChangeEvent*>(event);
- switch (oReadingEvent->mOrientation) {
- case OrientationChangeEvent::LeftUp: {
- mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
- Qt::InvertedPortraitOrientation : Qt::LandscapeOrientation;
- break;
- }
- case OrientationChangeEvent::TopUp: {
- mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
- Qt::LandscapeOrientation : Qt::PortraitOrientation;
- break;
- }
- case OrientationChangeEvent::RightUp: {
- mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
- Qt::PortraitOrientation : Qt::InvertedLandscapeOrientation;
- break;
- }
- case OrientationChangeEvent::TopDown: {
- mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
- Qt::InvertedLandscapeOrientation : Qt::InvertedPortraitOrientation;
- break;
- }
- }
-
- // Raise the event signal so that client apps know the orientation changed
- qCDebug(mirclient, "QMirClientScreen::customEvent - handling orientation change to %s", orientationToStr(mCurrentOrientation));
- QWindowSystemInterface::handleScreenOrientationChange(screen(), mCurrentOrientation);
-}
-
-void QMirClientScreen::handleWindowSurfaceResize(int windowWidth, int windowHeight)
-{
- if ((windowWidth > windowHeight && mGeometry.width() < mGeometry.height())
- || (windowWidth < windowHeight && mGeometry.width() > mGeometry.height())) {
-
- // The window aspect ratio differ's from the screen one. This means that
- // unity8 has rotated the window in its scene.
- // As there's no way to express window rotation in Qt's API, we have
- // Flip QScreen's dimensions so that orientation properties match
- // (primaryOrientation particularly).
- // FIXME: This assumes a phone scenario. Won't work, or make sense,
- // on the desktop
-
- QRect currGeometry = mGeometry;
- mGeometry.setWidth(currGeometry.height());
- mGeometry.setHeight(currGeometry.width());
-
- qCDebug(mirclient, "QMirClientScreen::handleWindowSurfaceResize - new screen geometry (w=%d, h=%d)",
- mGeometry.width(), mGeometry.height());
- QWindowSystemInterface::handleScreenGeometryChange(screen(),
- mGeometry /* newGeometry */,
- mGeometry /* newAvailableGeometry */);
-
- if (mGeometry.width() < mGeometry.height()) {
- mCurrentOrientation = Qt::PortraitOrientation;
- } else {
- mCurrentOrientation = Qt::LandscapeOrientation;
- }
- qCDebug(mirclient, "QMirClientScreen::handleWindowSurfaceResize - new orientation %s",orientationToStr(mCurrentOrientation));
- QWindowSystemInterface::handleScreenOrientationChange(screen(), mCurrentOrientation);
- }
-}
-
-void QMirClientScreen::setMirOutput(const MirOutput *output)
-{
- // Physical screen size (in mm)
- mPhysicalSize.setWidth(mir_output_get_physical_width_mm(output));
- mPhysicalSize.setHeight(mir_output_get_physical_height_mm(output));
-
- // Pixel Format
-// mFormat = qImageFormatFromMirPixelFormat(mir_output_get_current_pixel_format(output)); // GERRY: TODO
-
- // Pixel depth
- mDepth = 8 * MIR_BYTES_PER_PIXEL(mir_output_get_current_pixel_format(output));
-
- // Mode = Resolution & refresh rate
- const MirOutputMode *mode = mir_output_get_current_mode(output);
- mNativeGeometry.setX(mir_output_get_position_x(output));
- mNativeGeometry.setY(mir_output_get_position_y(output));
- mNativeGeometry.setWidth(mir_output_mode_get_width(mode));
- mNativeGeometry.setHeight(mir_output_mode_get_height(mode));
-
- mRefreshRate = mir_output_mode_get_refresh_rate(mode);
-
- // UI scale & DPR
- mScale = mir_output_get_scale_factor(output);
- if (overrideDevicePixelRatio > 0) {
- mDevicePixelRatio = overrideDevicePixelRatio;
- } else {
- mDevicePixelRatio = 1.0; // FIXME - need to determine suitable DPR for the specified scale
- }
-
- mFormFactor = mir_output_get_form_factor(output);
-
- mOutputId = mir_output_get_id(output);
-
- mGeometry.setX(mNativeGeometry.x());
- mGeometry.setY(mNativeGeometry.y());
- mGeometry.setWidth(mNativeGeometry.width());
- mGeometry.setHeight(mNativeGeometry.height());
-
- // Set the default orientation based on the initial screen dimensions.
- mNativeOrientation = (mGeometry.width() >= mGeometry.height()) ? Qt::LandscapeOrientation : Qt::PortraitOrientation;
-
- // If it's a landscape device (i.e. some tablets), start in landscape, otherwise portrait
- mCurrentOrientation = (mNativeOrientation == Qt::LandscapeOrientation) ? Qt::LandscapeOrientation : Qt::PortraitOrientation;
-}
-
-void QMirClientScreen::updateMirOutput(const MirOutput *output)
-{
- auto oldRefreshRate = mRefreshRate;
- auto oldScale = mScale;
- auto oldFormFactor = mFormFactor;
- auto oldGeometry = mGeometry;
-
- setMirOutput(output);
-
- // Emit change signals in particular order
- if (oldGeometry != mGeometry) {
- QWindowSystemInterface::handleScreenGeometryChange(screen(),
- mGeometry /* newGeometry */,
- mGeometry /* newAvailableGeometry */);
- }
-
- if (!qFuzzyCompare(mRefreshRate, oldRefreshRate)) {
- QWindowSystemInterface::handleScreenRefreshRateChange(screen(), mRefreshRate);
- }
-
- auto nativeInterface = static_cast<QMirClientNativeInterface *>(qGuiApp->platformNativeInterface());
- if (!qFuzzyCompare(mScale, oldScale)) {
- nativeInterface->screenPropertyChanged(this, QStringLiteral("scale"));
- }
- if (mFormFactor != oldFormFactor) {
- nativeInterface->screenPropertyChanged(this, QStringLiteral("formFactor"));
- }
-}
-
-void QMirClientScreen::setAdditionalMirDisplayProperties(float scale, MirFormFactor formFactor, int dpi)
-{
- if (mDpi != dpi) {
- mDpi = dpi;
- QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(), dpi, dpi);
- }
-
- auto nativeInterface = static_cast<QMirClientNativeInterface *>(qGuiApp->platformNativeInterface());
- if (!qFuzzyCompare(mScale, scale)) {
- mScale = scale;
- nativeInterface->screenPropertyChanged(this, QStringLiteral("scale"));
- }
- if (mFormFactor != formFactor) {
- mFormFactor = formFactor;
- nativeInterface->screenPropertyChanged(this, QStringLiteral("formFactor"));
- }
-}
-
-QDpi QMirClientScreen::logicalDpi() const
-{
- if (mDpi > 0) {
- return QDpi(mDpi, mDpi);
- } else {
- return QPlatformScreen::logicalDpi();
- }
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientscreen.h b/src/plugins/platforms/mirclient/qmirclientscreen.h
deleted file mode 100644
index b31cba1964..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientscreen.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTSCREEN_H
-#define QMIRCLIENTSCREEN_H
-
-#include <qpa/qplatformscreen.h>
-#include <QSurfaceFormat>
-
-#include <mir_toolkit/common.h> // just for MirFormFactor enum
-
-#include "qmirclientcursor.h"
-
-struct MirConnection;
-struct MirOutput;
-
-class QMirClientScreen : public QObject, public QPlatformScreen
-{
- Q_OBJECT
-public:
- QMirClientScreen(const MirOutput *output, MirConnection *connection);
- virtual ~QMirClientScreen();
-
- // QPlatformScreen methods.
- QImage::Format format() const override { return mFormat; }
- int depth() const override { return mDepth; }
- QRect geometry() const override { return mGeometry; }
- QRect availableGeometry() const override { return mGeometry; }
- QSizeF physicalSize() const override { return mPhysicalSize; }
- qreal devicePixelRatio() const override { return mDevicePixelRatio; }
- QDpi logicalDpi() const override;
- Qt::ScreenOrientation nativeOrientation() const override { return mNativeOrientation; }
- Qt::ScreenOrientation orientation() const override { return mNativeOrientation; }
- QPlatformCursor *cursor() const override { return const_cast<QMirClientCursor*>(&mCursor); }
-
- // Additional Screen properties from Mir
- int mirOutputId() const { return mOutputId; }
- MirFormFactor formFactor() const { return mFormFactor; }
- float scale() const { return mScale; }
-
- // Internally used methods
- void updateMirOutput(const MirOutput *output);
- void setAdditionalMirDisplayProperties(float scale, MirFormFactor formFactor, int dpi);
- void handleWindowSurfaceResize(int width, int height);
-
- // QObject methods.
- void customEvent(QEvent* event) override;
-
-private:
- void setMirOutput(const MirOutput *output);
-
- QRect mGeometry, mNativeGeometry;
- QSizeF mPhysicalSize;
- qreal mDevicePixelRatio;
- Qt::ScreenOrientation mNativeOrientation;
- Qt::ScreenOrientation mCurrentOrientation;
- QImage::Format mFormat;
- int mDepth;
- int mDpi;
- qreal mRefreshRate;
- MirFormFactor mFormFactor;
- float mScale;
- int mOutputId;
- QMirClientCursor mCursor;
-
- friend class QMirClientNativeInterface;
-};
-
-#endif // QMIRCLIENTSCREEN_H
diff --git a/src/plugins/platforms/mirclient/qmirclientscreenobserver.cpp b/src/plugins/platforms/mirclient/qmirclientscreenobserver.cpp
deleted file mode 100644
index 792aeca351..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientscreenobserver.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qmirclientscreenobserver.h"
-#include "qmirclientscreen.h"
-#include "qmirclientwindow.h"
-#include "qmirclientlogging.h"
-
-// Qt
-#include <QMetaObject>
-#include <QPointer>
-
-// Mir
-#include <mirclient/mir_toolkit/mir_connection.h>
-#include <mirclient/mir_toolkit/mir_display_configuration.h>
-
-#include <memory>
-
-namespace {
- static void displayConfigurationChangedCallback(MirConnection */*connection*/, void* context)
- {
- ASSERT(context != NULL);
- QMirClientScreenObserver *observer = static_cast<QMirClientScreenObserver *>(context);
- QMetaObject::invokeMethod(observer, "update");
- }
-
- const char *mirFormFactorToStr(MirFormFactor formFactor)
- {
- switch (formFactor) {
- case mir_form_factor_unknown: return "unknown";
- case mir_form_factor_phone: return "phone";
- case mir_form_factor_tablet: return "tablet";
- case mir_form_factor_monitor: return "monitor";
- case mir_form_factor_tv: return "tv";
- case mir_form_factor_projector: return "projector";
- }
- Q_UNREACHABLE();
- }
-} // anonymous namespace
-
-QMirClientScreenObserver::QMirClientScreenObserver(MirConnection *mirConnection)
- : mMirConnection(mirConnection)
-{
- mir_connection_set_display_config_change_callback(mirConnection, ::displayConfigurationChangedCallback, this);
- update();
-}
-
-void QMirClientScreenObserver::update()
-{
- // Wrap MirDisplayConfiguration to always delete when out of scope
- auto configDeleter = [](MirDisplayConfig *config) { mir_display_config_release(config); };
- using configUp = std::unique_ptr<MirDisplayConfig, decltype(configDeleter)>;
- configUp displayConfig(mir_connection_create_display_configuration(mMirConnection), configDeleter);
-
- // Mir only tells us something changed, it is up to us to figure out what.
- QList<QMirClientScreen*> newScreenList;
- QList<QMirClientScreen*> oldScreenList = mScreenList;
- mScreenList.clear();
-
- for (int i = 0; i < mir_display_config_get_num_outputs(displayConfig.get()); i++) {
- const MirOutput *output = mir_display_config_get_output(displayConfig.get(), i);
- if (mir_output_is_enabled(output)) {
- QMirClientScreen *screen = findScreenWithId(oldScreenList, mir_output_get_id(output));
- if (screen) { // we've already set up this display before
- screen->updateMirOutput(output);
- oldScreenList.removeAll(screen);
- } else {
- // new display, so create QMirClientScreen for it
- screen = new QMirClientScreen(output, mMirConnection);
- newScreenList.append(screen);
- qCDebug(mirclient) << "Added Screen with id" << mir_output_get_id(output)
- << "and geometry" << screen->geometry();
- }
- mScreenList.append(screen);
- }
- }
-
- // Announce old & unused Screens, should be deleted by the slot
- Q_FOREACH (const auto screen, oldScreenList) {
- Q_EMIT screenRemoved(screen);
- }
-
- /*
- * Mir's MirDisplayOutput does not include formFactor or scale for some reason, but Qt
- * will want that information on creating the QScreen. Only way we get that info is when
- * Mir positions a Window on that Screen. See "handleScreenPropertiesChange" method
- */
-
- // Announce new Screens
- Q_FOREACH (const auto screen, newScreenList) {
- Q_EMIT screenAdded(screen);
- }
-
- qCDebug(mirclient) << "=======================================";
- for (auto screen: mScreenList) {
- qCDebug(mirclient) << screen << "- id:" << screen->mirOutputId()
- << "geometry:" << screen->geometry()
- << "form factor:" << mirFormFactorToStr(screen->formFactor())
- << "scale:" << screen->scale();
- }
- qCDebug(mirclient) << "=======================================";
-}
-
-QMirClientScreen *QMirClientScreenObserver::findScreenWithId(int id)
-{
- return findScreenWithId(mScreenList, id);
-}
-
-QMirClientScreen *QMirClientScreenObserver::findScreenWithId(const QList<QMirClientScreen *> &list, int id)
-{
- Q_FOREACH (const auto screen, list) {
- if (screen->mirOutputId() == id) {
- return screen;
- }
- }
- return nullptr;
-}
-
-void QMirClientScreenObserver::handleScreenPropertiesChange(QMirClientScreen *screen, int dpi,
- MirFormFactor formFactor, float scale)
-{
- screen->setAdditionalMirDisplayProperties(scale, formFactor, dpi);
-}
-
diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.cpp b/src/plugins/platforms/mirclient/qmirclientwindow.cpp
deleted file mode 100644
index decd21516e..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientwindow.cpp
+++ /dev/null
@@ -1,968 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-// Local
-#include "qmirclientwindow.h"
-#include "qmirclientdebugextension.h"
-#include "qmirclientnativeinterface.h"
-#include "qmirclientinput.h"
-#include "qmirclientintegration.h"
-#include "qmirclientscreen.h"
-#include "qmirclientlogging.h"
-
-#include <mir_toolkit/mir_client_library.h>
-#include <mir_toolkit/version.h>
-
-// Qt
-#include <qpa/qwindowsysteminterface.h>
-#include <QMutexLocker>
-#include <QSize>
-#include <QtMath>
-#include <QtEglSupport/private/qeglconvenience_p.h>
-
-// Platform API
-#include <ubuntu/application/instance.h>
-
-#include <EGL/egl.h>
-
-Q_LOGGING_CATEGORY(mirclientBufferSwap, "qt.qpa.mirclient.bufferSwap", QtWarningMsg)
-
-namespace
-{
-const Qt::WindowType LowChromeWindowHint = (Qt::WindowType)0x00800000;
-
-// FIXME: this used to be defined by platform-api, but it's been removed in v3. Change ubuntu-keyboard to use
-// a different enum for window roles.
-enum UAUiWindowRole {
- U_MAIN_ROLE = 1,
- U_DASH_ROLE,
- U_INDICATOR_ROLE,
- U_NOTIFICATIONS_ROLE,
- U_GREETER_ROLE,
- U_LAUNCHER_ROLE,
- U_ON_SCREEN_KEYBOARD_ROLE,
- U_SHUTDOWN_DIALOG_ROLE,
-};
-
-struct MirSpecDeleter
-{
- void operator()(MirSurfaceSpec *spec) { mir_surface_spec_release(spec); }
-};
-
-using Spec = std::unique_ptr<MirSurfaceSpec, MirSpecDeleter>;
-
-EGLNativeWindowType nativeWindowFor(MirSurface *surf)
-{
- auto stream = mir_surface_get_buffer_stream(surf);
- return reinterpret_cast<EGLNativeWindowType>(mir_buffer_stream_get_egl_native_window(stream));
-}
-
-const char *qtWindowStateToStr(Qt::WindowState state)
-{
- switch (state) {
- case Qt::WindowNoState:
- return "NoState";
- case Qt::WindowFullScreen:
- return "FullScreen";
- case Qt::WindowMaximized:
- return "Maximized";
- case Qt::WindowMinimized:
- return "Minimized";
- case Qt::WindowActive:
- return "Active";
- }
- Q_UNREACHABLE();
-}
-
-const char *mirSurfaceStateToStr(MirSurfaceState surfaceState)
-{
- switch (surfaceState) {
- case mir_surface_state_unknown: return "unknown";
- case mir_surface_state_restored: return "restored";
- case mir_surface_state_minimized: return "minimized";
- case mir_surface_state_maximized: return "vertmaximized";
- case mir_surface_state_vertmaximized: return "vertmaximized";
- case mir_surface_state_fullscreen: return "fullscreen";
- case mir_surface_state_horizmaximized: return "horizmaximized";
- case mir_surface_state_hidden: return "hidden";
- case mir_surface_states: Q_UNREACHABLE();
- }
- Q_UNREACHABLE();
-}
-
-const char *mirPixelFormatToStr(MirPixelFormat pixelFormat)
-{
- switch (pixelFormat) {
- case mir_pixel_format_invalid: return "invalid";
- case mir_pixel_format_abgr_8888: return "ABGR8888";
- case mir_pixel_format_xbgr_8888: return "XBGR8888";
- case mir_pixel_format_argb_8888: return "ARGB8888";
- case mir_pixel_format_xrgb_8888: return "XRGB8888";
- case mir_pixel_format_bgr_888: return "BGR888";
- case mir_pixel_format_rgb_888: return "RGB888";
- case mir_pixel_format_rgb_565: return "RGB565";
- case mir_pixel_format_rgba_5551: return "RGBA5551";
- case mir_pixel_format_rgba_4444: return "RGBA4444";
- case mir_pixel_formats: Q_UNREACHABLE();
- }
- Q_UNREACHABLE();
-}
-
-const char *mirSurfaceTypeToStr(MirSurfaceType type)
-{
- switch (type) {
- case mir_surface_type_normal: return "Normal"; /**< AKA "regular" */
- case mir_surface_type_utility: return "Utility"; /**< AKA "floating regular" */
- case mir_surface_type_dialog: return "Dialog";
- case mir_surface_type_gloss: return "Gloss";
- case mir_surface_type_freestyle: return "Freestyle";
- case mir_surface_type_menu: return "Menu";
- case mir_surface_type_inputmethod: return "Input Method"; /**< AKA "OSK" or handwriting etc. */
- case mir_surface_type_satellite: return "Satellite"; /**< AKA "toolbox"/"toolbar" */
- case mir_surface_type_tip: return "Tip"; /**< AKA "tooltip" */
- case mir_surface_types: Q_UNREACHABLE();
- }
- return "";
-}
-
-MirSurfaceState qtWindowStateToMirSurfaceState(Qt::WindowState state)
-{
- switch (state) {
- case Qt::WindowNoState:
- case Qt::WindowActive:
- return mir_surface_state_restored;
- case Qt::WindowFullScreen:
- return mir_surface_state_fullscreen;
- case Qt::WindowMaximized:
- return mir_surface_state_maximized;
- case Qt::WindowMinimized:
- return mir_surface_state_minimized;
- }
- return mir_surface_state_unknown; // should never be reached
-}
-
-MirSurfaceType qtWindowTypeToMirSurfaceType(Qt::WindowType type)
-{
- switch (type & Qt::WindowType_Mask) {
- case Qt::Dialog:
- return mir_surface_type_dialog;
- case Qt::Sheet:
- case Qt::Drawer:
- return mir_surface_type_utility;
- case Qt::Popup:
- case Qt::Tool:
- return mir_surface_type_menu;
- case Qt::ToolTip:
- return mir_surface_type_tip;
- case Qt::SplashScreen:
- return mir_surface_type_freestyle;
- case Qt::Window:
- default:
- return mir_surface_type_normal;
- }
-}
-
-WId makeId()
-{
- static int id = 1;
- return id++;
-}
-
-UAUiWindowRole roleFor(QWindow *window)
-{
- QVariant roleVariant = window->property("role");
- if (!roleVariant.isValid())
- return U_MAIN_ROLE;
-
- uint role = roleVariant.toUInt();
- if (role < U_MAIN_ROLE || role > U_SHUTDOWN_DIALOG_ROLE)
- return U_MAIN_ROLE;
-
- return static_cast<UAUiWindowRole>(role);
-}
-
-QMirClientWindow *transientParentFor(QWindow *window)
-{
- QWindow *parent = window->transientParent();
- return parent ? static_cast<QMirClientWindow *>(parent->handle()) : nullptr;
-}
-
-bool requiresParent(const MirSurfaceType type)
-{
- switch (type) {
- case mir_surface_type_dialog: //FIXME - not quite what the specification dictates, but is what Mir's api dictates
- case mir_surface_type_utility:
- case mir_surface_type_gloss:
- case mir_surface_type_menu:
- case mir_surface_type_satellite:
- case mir_surface_type_tip:
- return true;
- default:
- return false;
- }
-}
-
-bool requiresParent(const Qt::WindowType type)
-{
- return requiresParent(qtWindowTypeToMirSurfaceType(type));
-}
-
-bool isMovable(const Qt::WindowType type)
-{
- auto mirType = qtWindowTypeToMirSurfaceType(type);
- switch (mirType) {
- case mir_surface_type_menu:
- case mir_surface_type_tip:
- return true;
- default:
- return false;
- }
-}
-
-Spec makeSurfaceSpec(QWindow *window, MirPixelFormat pixelFormat, QMirClientWindow *parentWindowHandle,
- MirConnection *connection)
-{
- const auto geometry = window->geometry();
- const int width = geometry.width() > 0 ? geometry.width() : 1;
- const int height = geometry.height() > 0 ? geometry.height() : 1;
- auto type = qtWindowTypeToMirSurfaceType(window->type());
-
- if (U_ON_SCREEN_KEYBOARD_ROLE == roleFor(window)) {
- type = mir_surface_type_inputmethod;
- }
-
- MirRectangle location{geometry.x(), geometry.y(), 0, 0};
- MirSurface *parent = nullptr;
- if (parentWindowHandle) {
- parent = parentWindowHandle->mirSurface();
- // Qt uses absolute positioning, but Mir positions surfaces relative to parent.
- location.top -= parentWindowHandle->geometry().top();
- location.left -= parentWindowHandle->geometry().left();
- }
-
- Spec spec;
-
- switch (type) {
- case mir_surface_type_menu:
- spec = Spec{mir_connection_create_spec_for_menu(connection, width, height, pixelFormat, parent,
- &location, mir_edge_attachment_any)};
- break;
- case mir_surface_type_dialog:
- spec = Spec{mir_connection_create_spec_for_modal_dialog(connection, width, height, pixelFormat, parent)};
- break;
- case mir_surface_type_utility:
- spec = Spec{mir_connection_create_spec_for_dialog(connection, width, height, pixelFormat)};
- break;
- case mir_surface_type_tip:
-#if MIR_CLIENT_VERSION < MIR_VERSION_NUMBER(3, 4, 0)
- spec = Spec{mir_connection_create_spec_for_tooltip(connection, width, height, pixelFormat, parent,
- &location)};
-#else
- spec = Spec{mir_connection_create_spec_for_tip(connection, width, height, pixelFormat, parent,
- &location, mir_edge_attachment_any)};
-#endif
- break;
- case mir_surface_type_inputmethod:
- spec = Spec{mir_connection_create_spec_for_input_method(connection, width, height, pixelFormat)};
- break;
- default:
- spec = Spec{mir_connection_create_spec_for_normal_surface(connection, width, height, pixelFormat)};
- break;
- }
-
- qCDebug(mirclient, "makeSurfaceSpec(window=%p): %s spec (type=0x%x, position=(%d, %d)px, size=(%dx%d)px)",
- window, mirSurfaceTypeToStr(type), window->type(), location.left, location.top, width, height);
-
- return std::move(spec);
-}
-
-void setSizingConstraints(MirSurfaceSpec *spec, const QSize& minSize, const QSize& maxSize, const QSize& increment)
-{
- mir_surface_spec_set_min_width(spec, minSize.width());
- mir_surface_spec_set_min_height(spec, minSize.height());
- if (maxSize.width() >= minSize.width()) {
- mir_surface_spec_set_max_width(spec, maxSize.width());
- }
- if (maxSize.height() >= minSize.height()) {
- mir_surface_spec_set_max_height(spec, maxSize.height());
- }
- if (increment.width() > 0) {
- mir_surface_spec_set_width_increment(spec, increment.width());
- }
- if (increment.height() > 0) {
- mir_surface_spec_set_height_increment(spec, increment.height());
- }
-}
-
-MirSurface *createMirSurface(QWindow *window, int mirOutputId, QMirClientWindow *parentWindowHandle,
- MirPixelFormat pixelFormat, MirConnection *connection,
- mir_surface_event_callback inputCallback, void *inputContext)
-{
- auto spec = makeSurfaceSpec(window, pixelFormat, parentWindowHandle, connection);
-
- // Install event handler as early as possible
- mir_surface_spec_set_event_handler(spec.get(), inputCallback, inputContext);
-
- const auto title = window->title().toUtf8();
- mir_surface_spec_set_name(spec.get(), title.constData());
-
- setSizingConstraints(spec.get(), window->minimumSize(), window->maximumSize(), window->sizeIncrement());
-
- if (window->windowState() == Qt::WindowFullScreen) {
- mir_surface_spec_set_fullscreen_on_output(spec.get(), mirOutputId);
- }
-
- if (window->flags() & LowChromeWindowHint) {
- mir_surface_spec_set_shell_chrome(spec.get(), mir_shell_chrome_low);
- }
-
- if (!window->isVisible()) {
- mir_surface_spec_set_state(spec.get(), mir_surface_state_hidden);
- }
-
- auto surface = mir_surface_create_sync(spec.get());
- Q_ASSERT(mir_surface_is_valid(surface));
- return surface;
-}
-
-QMirClientWindow *getParentIfNecessary(QWindow *window, QMirClientInput *input)
-{
- QMirClientWindow *parentWindowHandle = nullptr;
- if (requiresParent(window->type())) {
- parentWindowHandle = transientParentFor(window);
- if (parentWindowHandle == nullptr) {
- // NOTE: Mir requires this surface have a parent. Try using the last surface to receive input as that will
- // most likely be the one that caused this surface to be created
- parentWindowHandle = input->lastInputWindow();
- }
- }
- return parentWindowHandle;
-}
-
-MirPixelFormat disableAlphaBufferIfPossible(MirPixelFormat pixelFormat)
-{
- switch (pixelFormat) {
- case mir_pixel_format_abgr_8888:
- return mir_pixel_format_xbgr_8888;
- case mir_pixel_format_argb_8888:
- return mir_pixel_format_xrgb_8888;
- default: // can do nothing, leave it alone
- return pixelFormat;
- }
-}
-} //namespace
-
-
-
-class UbuntuSurface
-{
-public:
- UbuntuSurface(QMirClientWindow *platformWindow, EGLDisplay display, QMirClientInput *input, MirConnection *connection);
- ~UbuntuSurface();
-
- UbuntuSurface(const UbuntuSurface &) = delete;
- UbuntuSurface& operator=(const UbuntuSurface &) = delete;
-
- void updateGeometry(const QRect &newGeometry);
- void updateTitle(const QString& title);
- void setSizingConstraints(const QSize& minSize, const QSize& maxSize, const QSize& increment);
-
- void onSwapBuffersDone();
- void handleSurfaceResized(int width, int height);
- int needsRepaint() const;
-
- MirSurfaceState state() const { return mir_surface_get_state(mMirSurface); }
- void setState(MirSurfaceState state);
-
- MirSurfaceType type() const { return mir_surface_get_type(mMirSurface); }
-
- void setShellChrome(MirShellChrome shellChrome);
-
- EGLSurface eglSurface() const { return mEglSurface; }
- MirSurface *mirSurface() const { return mMirSurface; }
-
- void setSurfaceParent(MirSurface*);
- bool hasParent() const { return mParented; }
-
- QSurfaceFormat format() const { return mFormat; }
-
- bool mNeedsExposeCatchup;
-
- QString persistentSurfaceId();
-
-private:
- static void surfaceEventCallback(MirSurface* surface, const MirEvent *event, void* context);
- void postEvent(const MirEvent *event);
-
- QWindow * const mWindow;
- QMirClientWindow * const mPlatformWindow;
- QMirClientInput * const mInput;
- MirConnection * const mConnection;
- QMirClientWindow * mParentWindowHandle{nullptr};
-
- MirSurface* mMirSurface;
- const EGLDisplay mEglDisplay;
- EGLSurface mEglSurface;
-
- bool mNeedsRepaint;
- bool mParented;
- QSize mBufferSize;
- QSurfaceFormat mFormat;
- MirPixelFormat mPixelFormat;
-
- QMutex mTargetSizeMutex;
- QSize mTargetSize;
- MirShellChrome mShellChrome;
- QString mPersistentIdStr;
-};
-
-UbuntuSurface::UbuntuSurface(QMirClientWindow *platformWindow, EGLDisplay display, QMirClientInput *input, MirConnection *connection)
- : mWindow(platformWindow->window())
- , mPlatformWindow(platformWindow)
- , mInput(input)
- , mConnection(connection)
- , mEglDisplay(display)
- , mNeedsRepaint(false)
- , mParented(mWindow->transientParent() || mWindow->parent())
- , mFormat(mWindow->requestedFormat())
- , mShellChrome(mWindow->flags() & LowChromeWindowHint ? mir_shell_chrome_low : mir_shell_chrome_normal)
-{
- // Have Qt choose most suitable EGLConfig for the requested surface format, and update format to reflect it
- EGLConfig config = q_configFromGLFormat(display, mFormat, true);
- if (config == 0) {
- // Older Intel Atom-based devices only support OpenGL 1.4 compatibility profile but by default
- // QML asks for at least OpenGL 2.0. The XCB GLX backend ignores this request and returns a
- // 1.4 context, but the XCB EGL backend tries to honor it, and fails. The 1.4 context appears to
- // have sufficient capabilities on MESA (i915) to render correctly however. So reduce the default
- // requested OpenGL version to 1.0 to ensure EGL will give us a working context (lp:1549455).
- static const bool isMesa = QString(eglQueryString(display, EGL_VENDOR)).contains(QStringLiteral("Mesa"));
- if (isMesa) {
- qCDebug(mirclientGraphics, "Attempting to choose OpenGL 1.4 context which may suit Mesa");
- mFormat.setMajorVersion(1);
- mFormat.setMinorVersion(4);
- config = q_configFromGLFormat(display, mFormat, true);
- }
- }
- if (config == 0) {
- qCritical() << "Qt failed to choose a suitable EGLConfig to suit the surface format" << mFormat;
- }
-
- mFormat = q_glFormatFromConfig(display, config, mFormat);
-
- // Have Mir decide the pixel format most suited to the chosen EGLConfig. This is the only way
- // Mir will know what EGLConfig has been chosen - it cannot deduce it from the buffers.
- mPixelFormat = mir_connection_get_egl_pixel_format(connection, display, config);
- // But the chosen EGLConfig might have an alpha buffer enabled, even if not requested by the client.
- // If that's the case, try to edit the chosen pixel format in order to disable the alpha buffer.
- // This is an optimization for the compositor, as it can avoid blending this surface.
- if (mWindow->requestedFormat().alphaBufferSize() < 0) {
- mPixelFormat = disableAlphaBufferIfPossible(mPixelFormat);
- }
-
- const auto outputId = static_cast<QMirClientScreen *>(mWindow->screen()->handle())->mirOutputId();
-
- mParentWindowHandle = getParentIfNecessary(mWindow, input);
-
- mMirSurface = createMirSurface(mWindow, outputId, mParentWindowHandle, mPixelFormat, connection, surfaceEventCallback, this);
- mEglSurface = eglCreateWindowSurface(mEglDisplay, config, nativeWindowFor(mMirSurface), nullptr);
-
- mNeedsExposeCatchup = mir_surface_get_visibility(mMirSurface) == mir_surface_visibility_occluded;
-
- // Window manager can give us a final size different from what we asked for
- // so let's check what we ended up getting
- MirSurfaceParameters parameters;
- mir_surface_get_parameters(mMirSurface, &parameters);
-
- auto geom = mWindow->geometry();
- geom.setWidth(parameters.width);
- geom.setHeight(parameters.height);
-
- // Assume that the buffer size matches the surface size at creation time
- mBufferSize = geom.size();
- QWindowSystemInterface::handleGeometryChange(mWindow, geom);
-
- qCDebug(mirclient) << "Created surface with geometry:" << geom << "title:" << mWindow->title()
- << "role:" << roleFor(mWindow);
- qCDebug(mirclientGraphics)
- << "Requested format:" << mWindow->requestedFormat()
- << "\nActual format:" << mFormat
- << "with associated Mir pixel format:" << mirPixelFormatToStr(mPixelFormat);
-}
-
-UbuntuSurface::~UbuntuSurface()
-{
- if (mEglSurface != EGL_NO_SURFACE)
- eglDestroySurface(mEglDisplay, mEglSurface);
- if (mMirSurface) {
- mir_surface_release_sync(mMirSurface);
- }
-}
-
-void UbuntuSurface::updateGeometry(const QRect &newGeometry)
-{
- qCDebug(mirclient,"updateGeometry(window=%p, width=%d, height=%d)", mWindow,
- newGeometry.width(), newGeometry.height());
-
- Spec spec;
- if (isMovable(mWindow->type())) {
- spec = Spec{makeSurfaceSpec(mWindow, mPixelFormat, mParentWindowHandle, mConnection)};
- } else {
- spec = Spec{mir_connection_create_spec_for_changes(mConnection)};
- mir_surface_spec_set_width(spec.get(), newGeometry.width());
- mir_surface_spec_set_height(spec.get(), newGeometry.height());
- }
- mir_surface_apply_spec(mMirSurface, spec.get());
-}
-
-void UbuntuSurface::updateTitle(const QString& newTitle)
-{
- const auto title = newTitle.toUtf8();
- Spec spec{mir_connection_create_spec_for_changes(mConnection)};
- mir_surface_spec_set_name(spec.get(), title.constData());
- mir_surface_apply_spec(mMirSurface, spec.get());
-}
-
-void UbuntuSurface::setSizingConstraints(const QSize& minSize, const QSize& maxSize, const QSize& increment)
-{
- Spec spec{mir_connection_create_spec_for_changes(mConnection)};
- ::setSizingConstraints(spec.get(), minSize, maxSize, increment);
- mir_surface_apply_spec(mMirSurface, spec.get());
-}
-
-void UbuntuSurface::handleSurfaceResized(int width, int height)
-{
- QMutexLocker lock(&mTargetSizeMutex);
-
- // mir's resize event is mainly a signal that we need to redraw our content. We use the
- // width/height as identifiers to figure out if this is the latest surface resize event
- // that has posted, discarding any old ones. This avoids issuing too many redraw events.
- // see TODO in postEvent as the ideal way we should handle this.
- // The actual buffer size may or may have not changed at this point, so let the rendering
- // thread drive the window geometry updates.
- mNeedsRepaint = mTargetSize.width() == width && mTargetSize.height() == height;
-}
-
-int UbuntuSurface::needsRepaint() const
-{
- if (mNeedsRepaint) {
- if (mTargetSize != mBufferSize) {
- //If the buffer hasn't changed yet, we need at least two redraws,
- //once to get the new buffer size and propagate the geometry changes
- //and the second to redraw the content at the new size
- return 2;
- } else {
- // The buffer size has already been updated so we only need one redraw
- // to render at the new size
- return 1;
- }
- }
- return 0;
-}
-
-void UbuntuSurface::setState(MirSurfaceState state)
-{
- mir_wait_for(mir_surface_set_state(mMirSurface, state));
-}
-
-void UbuntuSurface::setShellChrome(MirShellChrome chrome)
-{
- if (chrome != mShellChrome) {
- auto spec = Spec{mir_connection_create_spec_for_changes(mConnection)};
- mir_surface_spec_set_shell_chrome(spec.get(), chrome);
- mir_surface_apply_spec(mMirSurface, spec.get());
-
- mShellChrome = chrome;
- }
-}
-
-void UbuntuSurface::onSwapBuffersDone()
-{
- static int sFrameNumber = 0;
- ++sFrameNumber;
-
- EGLint eglSurfaceWidth = -1;
- EGLint eglSurfaceHeight = -1;
- eglQuerySurface(mEglDisplay, mEglSurface, EGL_WIDTH, &eglSurfaceWidth);
- eglQuerySurface(mEglDisplay, mEglSurface, EGL_HEIGHT, &eglSurfaceHeight);
-
- const bool validSize = eglSurfaceWidth > 0 && eglSurfaceHeight > 0;
-
- if (validSize && (mBufferSize.width() != eglSurfaceWidth || mBufferSize.height() != eglSurfaceHeight)) {
-
- qCDebug(mirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - size changed (%d, %d) => (%d, %d)",
- mWindow, sFrameNumber, mBufferSize.width(), mBufferSize.height(), eglSurfaceWidth, eglSurfaceHeight);
-
- mBufferSize.rwidth() = eglSurfaceWidth;
- mBufferSize.rheight() = eglSurfaceHeight;
-
- QRect newGeometry = mPlatformWindow->geometry();
- newGeometry.setSize(mBufferSize);
-
- QWindowSystemInterface::handleGeometryChange(mWindow, newGeometry);
- } else {
- qCDebug(mirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - buffer size (%d,%d)",
- mWindow, sFrameNumber, mBufferSize.width(), mBufferSize.height());
- }
-}
-
-void UbuntuSurface::surfaceEventCallback(MirSurface *surface, const MirEvent *event, void* context)
-{
- Q_UNUSED(surface);
- Q_ASSERT(context != nullptr);
-
- auto s = static_cast<UbuntuSurface *>(context);
- s->postEvent(event);
-}
-
-void UbuntuSurface::postEvent(const MirEvent *event)
-{
- if (mir_event_type_resize == mir_event_get_type(event)) {
- // TODO: The current event queue just accumulates all resize events;
- // It would be nicer if we could update just one event if that event has not been dispatched.
- // As a workaround, we use the width/height as an identifier of this latest event
- // so the event handler (handleSurfaceResized) can discard/ignore old ones.
- const auto resizeEvent = mir_event_get_resize_event(event);
- const auto width = mir_resize_event_get_width(resizeEvent);
- const auto height = mir_resize_event_get_height(resizeEvent);
- qCDebug(mirclient, "resizeEvent(window=%p, width=%d, height=%d)", mWindow, width, height);
-
- QMutexLocker lock(&mTargetSizeMutex);
- mTargetSize.rwidth() = width;
- mTargetSize.rheight() = height;
- }
-
- mInput->postEvent(mPlatformWindow, event);
-}
-
-void UbuntuSurface::setSurfaceParent(MirSurface* parent)
-{
- qCDebug(mirclient, "setSurfaceParent(window=%p)", mWindow);
-
- mParented = true;
- Spec spec{mir_connection_create_spec_for_changes(mConnection)};
- mir_surface_spec_set_parent(spec.get(), parent);
- mir_surface_apply_spec(mMirSurface, spec.get());
-}
-
-QString UbuntuSurface::persistentSurfaceId()
-{
- if (mPersistentIdStr.isEmpty()) {
- MirPersistentId* mirPermaId = mir_surface_request_persistent_id_sync(mMirSurface);
- mPersistentIdStr = mir_persistent_id_as_string(mirPermaId);
- mir_persistent_id_release(mirPermaId);
- }
- return mPersistentIdStr;
-}
-
-QMirClientWindow::QMirClientWindow(QWindow *w, QMirClientInput *input, QMirClientNativeInterface *native,
- QMirClientAppStateController *appState, EGLDisplay eglDisplay,
- MirConnection *mirConnection, QMirClientDebugExtension *debugExt)
- : QObject(nullptr)
- , QPlatformWindow(w)
- , mId(makeId())
- , mWindowState(w->windowState())
- , mWindowFlags(w->flags())
- , mWindowVisible(false)
- , mAppStateController(appState)
- , mDebugExtention(debugExt)
- , mNativeInterface(native)
- , mSurface(new UbuntuSurface{this, eglDisplay, input, mirConnection})
- , mScale(1.0)
- , mFormFactor(mir_form_factor_unknown)
-{
- mWindowExposed = mSurface->mNeedsExposeCatchup == false;
-
- qCDebug(mirclient, "QMirClientWindow(window=%p, screen=%p, input=%p, surf=%p) with title '%s', role: '%d'",
- w, w->screen()->handle(), input, mSurface.get(), qPrintable(window()->title()), roleFor(window()));
-}
-
-QMirClientWindow::~QMirClientWindow()
-{
- qCDebug(mirclient, "~QMirClientWindow(window=%p)", this);
-}
-
-void QMirClientWindow::handleSurfaceResized(int width, int height)
-{
- QMutexLocker lock(&mMutex);
- qCDebug(mirclient, "handleSurfaceResize(window=%p, size=(%dx%d)px", window(), width, height);
-
- mSurface->handleSurfaceResized(width, height);
-
- // This resize event could have occurred just after the last buffer swap for this window.
- // This means the client may still be holding a buffer with the older size. The first redraw call
- // will then render at the old size. After swapping the client now will get a new buffer with the
- // updated size but it still needs re-rendering so another redraw may be needed.
- // A mir API to drop the currently held buffer would help here, so that we wouldn't have to redraw twice
- auto const numRepaints = mSurface->needsRepaint();
- lock.unlock();
- qCDebug(mirclient, "handleSurfaceResize(window=%p) redraw %d times", window(), numRepaints);
- for (int i = 0; i < numRepaints; i++) {
- qCDebug(mirclient, "handleSurfaceResize(window=%p) repainting size=(%dx%d)dp", window(), geometry().size().width(), geometry().size().height());
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
- }
-}
-
-void QMirClientWindow::handleSurfaceExposeChange(bool exposed)
-{
- QMutexLocker lock(&mMutex);
- qCDebug(mirclient, "handleSurfaceExposeChange(window=%p, exposed=%s)", window(), exposed ? "true" : "false");
-
- mSurface->mNeedsExposeCatchup = false;
- if (mWindowExposed == exposed) return;
- mWindowExposed = exposed;
-
- lock.unlock();
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
-}
-
-void QMirClientWindow::handleSurfaceFocusChanged(bool focused)
-{
- qCDebug(mirclient, "handleSurfaceFocusChanged(window=%p, focused=%d)", window(), focused);
- if (focused) {
- mAppStateController->setWindowFocused(true);
- QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason);
- } else {
- mAppStateController->setWindowFocused(false);
- }
-}
-
-void QMirClientWindow::handleSurfaceVisibilityChanged(bool visible)
-{
- qCDebug(mirclient, "handleSurfaceVisibilityChanged(window=%p, visible=%d)", window(), visible);
-
- if (mWindowVisible == visible) return;
- mWindowVisible = visible;
-
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
-}
-
-void QMirClientWindow::handleSurfaceStateChanged(Qt::WindowState state)
-{
- qCDebug(mirclient, "handleSurfaceStateChanged(window=%p, %s)", window(), qtWindowStateToStr(state));
-
- if (mWindowState == state) return;
- mWindowState = state;
-
- QWindowSystemInterface::handleWindowStateChanged(window(), state);
-}
-
-void QMirClientWindow::setWindowState(Qt::WindowStates states)
-{
- Qt::WindowState state = Qt::WindowNoState;
- if (states & Qt::WindowMinimized)
- state = Qt::WindowMinimized;
- else if (states & Qt::WindowFullScreen)
- state = Qt::WindowFullScreen;
- else if (states & Qt::WindowMaximized)
- state = Qt::WindowMaximized;
-
- QMutexLocker lock(&mMutex);
- qCDebug(mirclient, "setWindowState(window=%p, %s)", this, qtWindowStateToStr(state));
-
- if (mWindowState == state) return;
- mWindowState = state;
-
- lock.unlock();
- updateSurfaceState();
-}
-
-void QMirClientWindow::setWindowFlags(Qt::WindowFlags flags)
-{
- QMutexLocker lock(&mMutex);
- qCDebug(mirclient, "setWindowFlags(window=%p, 0x%x)", this, (int)flags);
-
- if (mWindowFlags == flags) return;
- mWindowFlags = flags;
-
- mSurface->setShellChrome(mWindowFlags & LowChromeWindowHint ? mir_shell_chrome_low : mir_shell_chrome_normal);
-}
-
-QRect QMirClientWindow::geometry() const
-{
- if (mDebugExtention) {
- auto geom = QPlatformWindow::geometry();
- geom.moveTopLeft(mDebugExtention->mapSurfacePointToScreen(mSurface->mirSurface(), QPoint(0,0)));
- return geom;
- } else {
- return QPlatformWindow::geometry();
- }
-}
-
-void QMirClientWindow::setGeometry(const QRect& rect)
-{
- QMutexLocker lock(&mMutex);
-
- if (window()->windowState() == Qt::WindowFullScreen || window()->windowState() == Qt::WindowMaximized) {
- qCDebug(mirclient, "setGeometry(window=%p) - not resizing, window is maximized or fullscreen", window());
- return;
- }
-
- qCDebug(mirclient, "setGeometry (window=%p, position=(%d, %d)dp, size=(%dx%d)dp)",
- window(), rect.x(), rect.y(), rect.width(), rect.height());
- // Immediately update internal geometry so Qt believes position updated
- QRect newPosition(geometry());
- newPosition.moveTo(rect.topLeft());
- QPlatformWindow::setGeometry(newPosition);
-
- mSurface->updateGeometry(rect);
- // Note: don't call handleGeometryChange here, wait to see what Mir replies with.
-}
-
-void QMirClientWindow::setVisible(bool visible)
-{
- QMutexLocker lock(&mMutex);
- qCDebug(mirclient, "setVisible (window=%p, visible=%s)", window(), visible ? "true" : "false");
-
- if (mWindowVisible == visible) return;
- mWindowVisible = visible;
-
- if (visible) {
- if (!mSurface->hasParent() && window()->type() == Qt::Dialog) {
- // The dialog may have been parented after creation time
- // so morph it into a modal dialog
- auto parent = transientParentFor(window());
- if (parent) {
- mSurface->setSurfaceParent(parent->mirSurface());
- }
- }
- }
-
- lock.unlock();
- updateSurfaceState();
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
-}
-
-void QMirClientWindow::setWindowTitle(const QString& title)
-{
- QMutexLocker lock(&mMutex);
- qCDebug(mirclient, "setWindowTitle(window=%p) title=%s)", window(), title.toUtf8().constData());
- mSurface->updateTitle(title);
-}
-
-void QMirClientWindow::propagateSizeHints()
-{
- QMutexLocker lock(&mMutex);
- const auto win = window();
- qCDebug(mirclient, "propagateSizeHints(window=%p) min(%d,%d), max(%d,%d) increment(%d, %d)",
- win, win->minimumSize().width(), win->minimumSize().height(),
- win->maximumSize().width(), win->maximumSize().height(),
- win->sizeIncrement().width(), win->sizeIncrement().height());
- mSurface->setSizingConstraints(win->minimumSize(), win->maximumSize(), win->sizeIncrement());
-}
-
-bool QMirClientWindow::isExposed() const
-{
- // mNeedsExposeCatchup because we need to render a frame to get the expose surface event from mir.
- return mWindowVisible && (mWindowExposed || (mSurface && mSurface->mNeedsExposeCatchup));
-}
-
-QSurfaceFormat QMirClientWindow::format() const
-{
- return mSurface->format();
-}
-
-QPoint QMirClientWindow::mapToGlobal(const QPoint &pos) const
-{
- if (mDebugExtention) {
- return mDebugExtention->mapSurfacePointToScreen(mSurface->mirSurface(), pos);
- } else {
- return pos;
- }
-}
-
-void* QMirClientWindow::eglSurface() const
-{
- return mSurface->eglSurface();
-}
-
-MirSurface *QMirClientWindow::mirSurface() const
-{
- return mSurface->mirSurface();
-}
-
-WId QMirClientWindow::winId() const
-{
- return mId;
-}
-
-void QMirClientWindow::onSwapBuffersDone()
-{
- QMutexLocker lock(&mMutex);
- mSurface->onSwapBuffersDone();
-
- if (mSurface->mNeedsExposeCatchup) {
- mSurface->mNeedsExposeCatchup = false;
- mWindowExposed = false;
-
- lock.unlock();
- QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
- }
-}
-
-void QMirClientWindow::handleScreenPropertiesChange(MirFormFactor formFactor, float scale)
-{
- // Update the scale & form factor native-interface properties for the windows affected
- // as there is no convenient way to emit signals for those custom properties on a QScreen
- if (formFactor != mFormFactor) {
- mFormFactor = formFactor;
- Q_EMIT mNativeInterface->windowPropertyChanged(this, QStringLiteral("formFactor"));
- }
-
- if (!qFuzzyCompare(scale, mScale)) {
- mScale = scale;
- Q_EMIT mNativeInterface->windowPropertyChanged(this, QStringLiteral("scale"));
- }
-}
-
-void QMirClientWindow::updateSurfaceState()
-{
- QMutexLocker lock(&mMutex);
- MirSurfaceState newState = mWindowVisible ? qtWindowStateToMirSurfaceState(mWindowState) :
- mir_surface_state_hidden;
- qCDebug(mirclient, "updateSurfaceState (window=%p, surfaceState=%s)", window(), mirSurfaceStateToStr(newState));
- if (newState != mSurface->state()) {
- mSurface->setState(newState);
- }
-}
-
-QString QMirClientWindow::persistentSurfaceId()
-{
- return mSurface->persistentSurfaceId();
-}
diff --git a/src/plugins/platforms/mirclient/qmirclientwindow.h b/src/plugins/platforms/mirclient/qmirclientwindow.h
deleted file mode 100644
index 6c5695d62f..0000000000
--- a/src/plugins/platforms/mirclient/qmirclientwindow.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014-2016 Canonical, Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QMIRCLIENTWINDOW_H
-#define QMIRCLIENTWINDOW_H
-
-#include <qpa/qplatformwindow.h>
-#include <QSharedPointer>
-#include <QMutex>
-
-#include <mir_toolkit/common.h> // needed only for MirFormFactor enum
-
-#include <memory>
-
-#include <EGL/egl.h>
-
-class QMirClientAppStateController;
-class QMirClientDebugExtension;
-class QMirClientNativeInterface;
-class QMirClientInput;
-class QMirClientScreen;
-class UbuntuSurface;
-struct MirSurface;
-class MirConnection;
-
-class QMirClientWindow : public QObject, public QPlatformWindow
-{
- Q_OBJECT
-public:
- QMirClientWindow(QWindow *w, QMirClientInput *input, QMirClientNativeInterface* native,
- QMirClientAppStateController *appState, EGLDisplay eglDisplay,
- MirConnection *mirConnection, QMirClientDebugExtension *debugExt);
- virtual ~QMirClientWindow();
-
- // QPlatformWindow methods.
- WId winId() const override;
- QRect geometry() const override;
- void setGeometry(const QRect&) override;
- void setWindowState(Qt::WindowStates state) override;
- void setWindowFlags(Qt::WindowFlags flags) override;
- void setVisible(bool visible) override;
- void setWindowTitle(const QString &title) override;
- void propagateSizeHints() override;
- bool isExposed() const override;
-
- QPoint mapToGlobal(const QPoint &pos) const override;
- QSurfaceFormat format() const override;
-
- // Additional Window properties exposed by NativeInterface
- MirFormFactor formFactor() const { return mFormFactor; }
- float scale() const { return mScale; }
-
- // New methods.
- void *eglSurface() const;
- MirSurface *mirSurface() const;
- void handleSurfaceResized(int width, int height);
- void handleSurfaceExposeChange(bool exposed);
- void handleSurfaceFocusChanged(bool focused);
- void handleSurfaceVisibilityChanged(bool visible);
- void handleSurfaceStateChanged(Qt::WindowState state);
- void onSwapBuffersDone();
- void handleScreenPropertiesChange(MirFormFactor formFactor, float scale);
- QString persistentSurfaceId();
-
-private:
- void updateSurfaceState();
- mutable QMutex mMutex;
- const WId mId;
- Qt::WindowState mWindowState;
- Qt::WindowFlags mWindowFlags;
- bool mWindowVisible;
- bool mWindowExposed;
- QMirClientAppStateController *mAppStateController;
- QMirClientDebugExtension *mDebugExtention;
- QMirClientNativeInterface *mNativeInterface;
- std::unique_ptr<UbuntuSurface> mSurface;
- float mScale;
- MirFormFactor mFormFactor;
-};
-
-#endif // QMIRCLIENTWINDOW_H
diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.cpp b/src/plugins/platforms/offscreen/qoffscreencommon.cpp
index f0eb69718a..eae25012c1 100644
--- a/src/plugins/platforms/offscreen/qoffscreencommon.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreencommon.cpp
@@ -77,7 +77,8 @@ public:
if (containing != previous)
QWindowSystemInterface::handleEnterLeaveEvent(containing, previous, local, pos);
- QWindowSystemInterface::handleMouseEvent(containing, local, pos, QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
+ QWindowSystemInterface::handleMouseEvent(containing, local, pos, QGuiApplication::mouseButtons(), Qt::NoButton,
+ QEvent::MouseMove, QGuiApplication::keyboardModifiers(), Qt::MouseEventSynthesizedByQt);
QOffscreenScreen::windowContainingCursor = containing ? containing->handle() : 0;
}
diff --git a/src/plugins/platforms/openwfd/qopenwfdscreen.h b/src/plugins/platforms/openwfd/qopenwfdscreen.h
index dede0025a9..dec51d306b 100644
--- a/src/plugins/platforms/openwfd/qopenwfdscreen.h
+++ b/src/plugins/platforms/openwfd/qopenwfdscreen.h
@@ -48,7 +48,6 @@
#include <WF/wfd.h>
#include <QtCore/QVarLengthArray>
-#include <QtCore/QLinkedList>
#define BUFFER_NUM 4
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index acc55adf6f..c4f2b30965 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -48,6 +48,4 @@ haiku {
wasm: SUBDIRS += wasm
-qtConfig(mirclient): SUBDIRS += mirclient
-
qtConfig(integrityfb): SUBDIRS += integrity
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index 96bfa1dd19..bfd56e8d13 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -33,6 +33,7 @@ QT += \
SOURCES = main.cpp \
qqnxbuffer.cpp \
+ qqnxforeignwindow.cpp \
qqnxintegration.cpp \
qqnxscreen.cpp \
qqnxwindow.cpp \
@@ -50,6 +51,7 @@ SOURCES = main.cpp \
HEADERS = main.h \
qqnxbuffer.h \
+ qqnxforeignwindow.h \
qqnxkeytranslator.h \
qqnxintegration.h \
qqnxscreen.h \
diff --git a/src/plugins/platforms/mirclient/qmirclienttheme.cpp b/src/plugins/platforms/qnx/qqnxforeignwindow.cpp
index dcfef7ca67..94608215dc 100644
--- a/src/plugins/platforms/mirclient/qmirclienttheme.cpp
+++ b/src/plugins/platforms/qnx/qqnxforeignwindow.cpp
@@ -1,6 +1,6 @@
-/****************************************************************************
+/***************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2018 QNX Software Systems. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -37,31 +37,29 @@
**
****************************************************************************/
+#include "qqnxforeignwindow.h"
+#include "qqnxintegration.h"
-#include "qmirclienttheme.h"
+QT_BEGIN_NAMESPACE
-#include <QtCore/QVariant>
-
-const char *QMirClientTheme::name = "ubuntu";
-
-QMirClientTheme::QMirClientTheme()
+QQnxForeignWindow::QQnxForeignWindow(QWindow *window,
+ screen_context_t context,
+ screen_window_t screenWindow)
+ : QQnxWindow(window, context, screenWindow)
{
+ initWindow();
}
-QMirClientTheme::~QMirClientTheme()
+bool QQnxForeignWindow::isForeignWindow() const
{
+ return true;
}
-QVariant QMirClientTheme::themeHint(ThemeHint hint) const
+int QQnxForeignWindow::pixelFormat() const
{
- if (hint == QPlatformTheme::SystemIconThemeName) {
- QByteArray iconTheme = qgetenv("QTUBUNTU_ICON_THEME");
- if (iconTheme.isEmpty()) {
- return QVariant(QStringLiteral("ubuntu-mobile"));
- } else {
- return QVariant(QString(iconTheme));
- }
- } else {
- return QGenericUnixTheme::themeHint(hint);
- }
+ int result = SCREEN_FORMAT_RGBA8888;
+ screen_get_window_property_iv(nativeHandle(), SCREEN_PROPERTY_FORMAT, &result);
+ return result;
}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/platforms/mirclient/qmirclientdebugextension.h b/src/plugins/platforms/qnx/qqnxforeignwindow.h
index 0596561d77..22dde643e4 100644
--- a/src/plugins/platforms/mirclient/qmirclientdebugextension.h
+++ b/src/plugins/platforms/qnx/qqnxforeignwindow.h
@@ -1,6 +1,6 @@
-/****************************************************************************
+/***************************************************************************
**
-** Copyright (C) 2016 Canonical, Ltd.
+** Copyright (C) 2018 QNX Software Systems. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
@@ -37,27 +37,25 @@
**
****************************************************************************/
+#ifndef QQNXFOREIGNWINDOW_H
+#define QQNXFOREIGNWINDOW_H
-#ifndef QMIRCLIENTDEBUGEXTENSION_H
-#define QMIRCLIENTDEBUGEXTENSION_H
+#include "qqnxwindow.h"
-#include <QPoint>
-#include <QLibrary>
-struct MirSurface;
+QT_BEGIN_NAMESPACE
-typedef bool (*MapperPrototype)(MirSurface* surface, int x, int y, int* screenX, int* screenY);
-
-
-class QMirClientDebugExtension
+class QQnxForeignWindow : public QQnxWindow
{
public:
- QMirClientDebugExtension();
+ QQnxForeignWindow(QWindow *window,
+ screen_context_t context,
+ screen_window_t screenWindow);
- QPoint mapSurfacePointToScreen(MirSurface *, const QPoint &point);
-
-private:
- QLibrary m_mirclientDebug;
- MapperPrototype m_mapper;
+ bool isForeignWindow() const override;
+ int pixelFormat() const override;
+ void resetBuffers() override {}
};
-#endif // QMIRCLIENTDEBUGEXTENSION_H
+QT_END_NAMESPACE
+
+#endif // QQNXFOREIGNWINDOW_H
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index a45dcabeb7..f479e94988 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -51,6 +51,7 @@
#include "qqnxabstractvirtualkeyboard.h"
#include "qqnxservices.h"
+#include "qqnxforeignwindow.h"
#include "qqnxrasterwindow.h"
#if !defined(QT_NO_OPENGL)
#include "qqnxeglwindow.h"
@@ -147,6 +148,7 @@ static inline int getContextCapabilities(const QStringList &paramList)
QQnxIntegration::QQnxIntegration(const QStringList &paramList)
: QPlatformIntegration()
+ , m_screenContextId(256, 0)
, m_screenEventThread(0)
, m_navigatorEventHandler(new QQnxNavigatorEventHandler())
, m_virtualKeyboard(0)
@@ -178,6 +180,11 @@ QQnxIntegration::QQnxIntegration(const QStringList &paramList)
qFatal("%s - Screen: Failed to create screen context - Error: %s (%i)",
Q_FUNC_INFO, strerror(errno), errno);
}
+ screen_get_context_property_cv(m_screenContext,
+ SCREEN_PROPERTY_ID,
+ m_screenContextId.size(),
+ m_screenContextId.data());
+ m_screenContextId.resize(strlen(m_screenContextId.constData()));
#if QT_CONFIG(qqnx_pps)
// Create/start navigator event notifier
@@ -310,6 +317,7 @@ bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
qIntegrationDebug();
switch (cap) {
case MultipleWindows:
+ case ForeignWindows:
case ThreadedPixmaps:
return true;
#if !defined(QT_NO_OPENGL)
@@ -323,6 +331,18 @@ bool QQnxIntegration::hasCapability(QPlatformIntegration::Capability cap) const
}
}
+QPlatformWindow *QQnxIntegration::createForeignWindow(QWindow *window, WId nativeHandle) const
+{
+ screen_window_t screenWindow = reinterpret_cast<screen_window_t>(nativeHandle);
+ if (this->window(screenWindow)) {
+ qWarning() << "QWindow already created for foreign window"
+ << screenWindow;
+ return nullptr;
+ }
+
+ return new QQnxForeignWindow(window, m_screenContext, screenWindow);
+}
+
QPlatformWindow *QQnxIntegration::createPlatformWindow(QWindow *window) const
{
qIntegrationDebug();
@@ -478,7 +498,7 @@ QPlatformServices * QQnxIntegration::services() const
return m_services;
}
-QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
+QWindow *QQnxIntegration::window(screen_window_t qnxWindow) const
{
qIntegrationDebug();
QMutexLocker locker(&m_windowMapperMutex);
@@ -587,12 +607,11 @@ QList<screen_display_t *> QQnxIntegration::sortDisplays(screen_display_t *availa
// Move all displays with matching ID from the intermediate list
// to the beginning of the ordered list
- QMutableListIterator<screen_display_t *> iter(allDisplays);
- while (iter.hasNext()) {
- screen_display_t *display = iter.next();
+ for (auto it = allDisplays.begin(), end = allDisplays.end(); it != end; ++it) {
+ screen_display_t *display = *it;
if (getIdOfDisplay(*display) == requestedValue) {
orderedDisplays.append(display);
- iter.remove();
+ allDisplays.erase(it);
break;
}
}
@@ -706,6 +725,11 @@ screen_context_t QQnxIntegration::screenContext()
return m_screenContext;
}
+QByteArray QQnxIntegration::screenContextId()
+{
+ return m_screenContextId;
+}
+
QQnxNavigatorEventHandler *QQnxIntegration::navigatorEventHandler()
{
return m_navigatorEventHandler;
diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h
index 366556dc4b..0bf37880d1 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.h
+++ b/src/plugins/platforms/qnx/qqnxintegration.h
@@ -92,6 +92,7 @@ public:
bool hasCapability(QPlatformIntegration::Capability cap) const override;
+ QPlatformWindow *createForeignWindow(QWindow *window, WId nativeHandle) const override;
QPlatformWindow *createPlatformWindow(QWindow *window) const override;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
@@ -123,7 +124,7 @@ public:
QPlatformServices *services() const override;
- QWindow *window(screen_window_t qnxWindow);
+ QWindow *window(screen_window_t qnxWindow) const;
QQnxScreen *screenForNative(screen_display_t qnxScreen) const;
@@ -132,6 +133,7 @@ public:
QQnxScreen *primaryDisplay() const;
Options options() const;
screen_context_t screenContext();
+ QByteArray screenContextId();
QQnxNavigatorEventHandler *navigatorEventHandler();
@@ -145,6 +147,7 @@ private:
int displayCount);
screen_context_t m_screenContext;
+ QByteArray m_screenContextId;
QQnxScreenEventThread *m_screenEventThread;
QQnxNavigatorEventHandler *m_navigatorEventHandler;
QQnxAbstractVirtualKeyboard *m_virtualKeyboard;
@@ -168,7 +171,7 @@ private:
QSimpleDrag *m_drag;
#endif
QQnxWindowMapper m_windowMapper;
- QMutex m_windowMapperMutex;
+ mutable QMutex m_windowMapperMutex;
Options m_options;
diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
index f29e11489b..a9b5860187 100644
--- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp
@@ -45,6 +45,7 @@
#include "qqnxkeytranslator.h"
#include "qqnxscreen.h"
#include "qqnxscreeneventfilter.h"
+#include "qqnxscreentraits.h"
#include <QDebug>
#include <QGuiApplication>
@@ -89,6 +90,51 @@ static QString capKeyString(int cap, int modifiers, int key)
return QString();
}
+template <typename T>
+static void finishCloseEvent(screen_event_t event)
+{
+ T t;
+ screen_get_event_property_pv(event,
+ screen_traits<T>::propertyName,
+ reinterpret_cast<void**>(&t));
+ screen_traits<T>::destroy(t);
+}
+
+static void finishCloseEvent(screen_event_t event)
+{
+ // Let libscreen know that we're finished with anything that may have been acquired.
+ int objectType = SCREEN_OBJECT_TYPE_CONTEXT;
+ screen_get_event_property_iv(event, SCREEN_PROPERTY_OBJECT_TYPE, &objectType);
+ switch (objectType) {
+ case SCREEN_OBJECT_TYPE_CONTEXT:
+ finishCloseEvent<screen_context_t>(event);
+ break;
+ case SCREEN_OBJECT_TYPE_DEVICE:
+ finishCloseEvent<screen_device_t>(event);
+ break;
+ case SCREEN_OBJECT_TYPE_DISPLAY:
+ // no screen_destroy_display
+ break;
+ case SCREEN_OBJECT_TYPE_GROUP:
+ finishCloseEvent<screen_group_t>(event);
+ break;
+ case SCREEN_OBJECT_TYPE_PIXMAP:
+ finishCloseEvent<screen_pixmap_t>(event);
+ break;
+ case SCREEN_OBJECT_TYPE_SESSION:
+ finishCloseEvent<screen_session_t>(event);
+ break;
+#if _SCREEN_VERSION >= _SCREEN_MAKE_VERSION(2, 0, 0)
+ case SCREEN_OBJECT_TYPE_STREAM:
+ finishCloseEvent<screen_stream_t>(event);
+ break;
+#endif
+ case SCREEN_OBJECT_TYPE_WINDOW:
+ finishCloseEvent<screen_window_t>(event);
+ break;
+ }
+}
+
QT_BEGIN_NAMESPACE
QQnxScreenEventHandler::QQnxScreenEventHandler(QQnxIntegration *integration)
@@ -242,11 +288,18 @@ void QQnxScreenEventHandler::processEvents()
break;
++count;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result = 0;
+#else
long result = 0;
+#endif
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
bool handled = dispatcher && dispatcher->filterNativeEvent(QByteArrayLiteral("screen_event_t"), event, &result);
if (!handled)
handleEvent(event);
+
+ if (type == SCREEN_EVENT_CLOSE)
+ finishCloseEvent(event);
}
m_eventThread->armEventsPending(count);
@@ -583,7 +636,7 @@ void QQnxScreenEventHandler::handleDisplayEvent(screen_event_t event)
// We never remove the primary display, the qpa plugin doesn't support that and it crashes.
// To support it, this would be needed:
// - Adjust all qnx qpa code which uses screens
- // - Make QWidgetBackingStore not dereference a null paint device
+ // - Make QWidgetRepaintManager not dereference a null paint device
// - Create platform resources ( QQnxWindow ) for all QWindow because they would be deleted
// when you delete the screen
diff --git a/src/plugins/platforms/qnx/qqnxscreentraits.h b/src/plugins/platforms/qnx/qqnxscreentraits.h
new file mode 100644
index 0000000000..ebd74141f2
--- /dev/null
+++ b/src/plugins/platforms/qnx/qqnxscreentraits.h
@@ -0,0 +1,127 @@
+/***************************************************************************
+**
+** Copyright (C) 2018 QNX Software Systems. All rights reserved.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQNXSCREENTRAITS_H
+#define QQNXSCREENTRAITS_H
+
+#include <screen/screen.h>
+
+QT_BEGIN_NAMESPACE
+
+template <typename T>
+class screen_traits
+{
+};
+
+template <>
+class screen_traits<screen_context_t>
+{
+public:
+ typedef screen_context_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_CONTEXT;
+ static int destroy(screen_context_t context) { return screen_destroy_context(context); }
+};
+
+template <>
+class screen_traits<screen_device_t>
+{
+public:
+ typedef screen_device_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_DEVICE;
+ static int destroy(screen_device_t device) { return screen_destroy_device(device); }
+};
+
+template <>
+class screen_traits<screen_display_t>
+{
+public:
+ typedef screen_display_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_DISPLAY;
+};
+
+template <>
+class screen_traits<screen_group_t>
+{
+public:
+ typedef screen_group_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_GROUP;
+ static int destroy(screen_group_t group) { return screen_destroy_group(group); }
+};
+
+template <>
+class screen_traits<screen_pixmap_t>
+{
+public:
+ typedef screen_pixmap_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_PIXMAP;
+ static int destroy(screen_pixmap_t pixmap) { return screen_destroy_pixmap(pixmap); }
+};
+
+template <>
+class screen_traits<screen_session_t>
+{
+public:
+ typedef screen_session_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_SESSION;
+ static int destroy(screen_session_t session) { return screen_destroy_session(session); }
+};
+
+#if _SCREEN_VERSION >= _SCREEN_MAKE_VERSION(2, 0, 0)
+template <>
+class screen_traits<screen_stream_t>
+{
+public:
+ typedef screen_stream_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_STREAM;
+ static int destroy(screen_stream_t stream) { return screen_destroy_stream(stream); }
+};
+#endif
+
+template <>
+class screen_traits<screen_window_t>
+{
+public:
+ typedef screen_window_t screen_type;
+ static const int propertyName = SCREEN_PROPERTY_WINDOW;
+ static int destroy(screen_window_t window) { return screen_destroy_window(window); }
+};
+
+QT_END_NAMESPACE
+
+#endif // QQNXSCREENTRAITS_H
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 7644e28b44..1d3d609017 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -155,6 +155,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
m_parentWindow(0),
m_visible(false),
m_exposed(true),
+ m_foreign(false),
m_windowState(Qt::WindowNoState),
m_mmRendererWindow(0),
m_firstActivateHandled(false)
@@ -254,6 +255,39 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootW
}
}
+QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, screen_window_t screenWindow)
+ : QPlatformWindow(window)
+ , m_screenContext(context)
+ , m_window(screenWindow)
+ , m_screen(0)
+ , m_parentWindow(0)
+ , m_visible(false)
+ , m_exposed(true)
+ , m_foreign(true)
+ , m_windowState(Qt::WindowNoState)
+ , m_mmRendererWindow(0)
+ , m_parentGroupName(256, 0)
+ , m_isTopLevel(false)
+{
+ qWindowDebug() << "window =" << window << ", size =" << window->size();
+
+ collectWindowGroup();
+
+ screen_get_window_property_cv(m_window,
+ SCREEN_PROPERTY_PARENT,
+ m_parentGroupName.size(),
+ m_parentGroupName.data());
+ m_parentGroupName.resize(strlen(m_parentGroupName.constData()));
+
+ // If a window group has been provided join it now. If it's an empty string that's OK too,
+ // it'll cause us not to join a group (the app will presumably join at some future time).
+ QVariant parentGroup = window->property("qnxInitialWindowGroup");
+ if (!parentGroup.isValid())
+ parentGroup = window->property("_q_platform_qnxParentGroup");
+ if (parentGroup.isValid() && parentGroup.canConvert<QByteArray>())
+ joinWindowGroup(parentGroup.toByteArray());
+}
+
QQnxWindow::~QQnxWindow()
{
qWindowDebug() << "window =" << window();
@@ -270,7 +304,11 @@ QQnxWindow::~QQnxWindow()
m_screen->updateHierarchy();
// Cleanup QNX window and its buffers
- screen_destroy_window(m_window);
+ // Foreign windows are cleaned up externally after the CLOSE event has been handled.
+ if (m_foreign)
+ removeContextPermission();
+ else
+ screen_destroy_window(m_window);
}
void QQnxWindow::setGeometry(const QRect &rect)
@@ -793,14 +831,24 @@ void QQnxWindow::initWindow()
setGeometryHelper(shouldMakeFullScreen() ? screen()->geometry() : window()->geometry());
}
-void QQnxWindow::createWindowGroup()
+void QQnxWindow::collectWindowGroup()
{
- // Generate a random window group name
- m_windowGroupName = QUuid::createUuid().toByteArray();
+ QByteArray groupName(256, 0);
+ Q_SCREEN_CHECKERROR(screen_get_window_property_cv(m_window,
+ SCREEN_PROPERTY_GROUP,
+ groupName.size(),
+ groupName.data()),
+ "Failed to retrieve window group");
+ groupName.resize(strlen(groupName.constData()));
+ m_windowGroupName = groupName;
+}
- // Create window group so child windows can be parented by container window
- Q_SCREEN_CHECKERROR(screen_create_window_group(m_window, m_windowGroupName.constData()),
+void QQnxWindow::createWindowGroup()
+{
+ Q_SCREEN_CHECKERROR(screen_create_window_group(m_window, nullptr),
"Failed to create window group");
+
+ collectWindowGroup();
}
void QQnxWindow::joinWindowGroup(const QByteArray &groupName)
@@ -809,6 +857,17 @@ void QQnxWindow::joinWindowGroup(const QByteArray &groupName)
qWindowDebug() << "group:" << groupName;
+ // screen has this annoying habit of generating a CLOSE/CREATE when the owner context of
+ // the parent group moves a foreign window to another group that it also owns. The
+ // CLOSE/CREATE changes the identity of the foreign window. Usually, this is undesirable.
+ // To prevent this CLOSE/CREATE when changing the parent group, we temporarily add a
+ // context permission for the Qt context. screen won't send a CLOSE/CREATE when the
+ // context has some permission other than the PARENT permission. If there isn't a new
+ // group (the window has no parent), this context permission is left in place.
+
+ if (m_foreign && !m_parentGroupName.isEmpty())\
+ addContextPermission();
+
if (!groupName.isEmpty()) {
if (groupName != m_parentGroupName) {
screen_join_window_group(m_window, groupName);
@@ -827,6 +886,9 @@ void QQnxWindow::joinWindowGroup(const QByteArray &groupName)
m_parentGroupName = "";
}
+ if (m_foreign && !groupName.isEmpty())
+ removeContextPermission();
+
if (changed)
screen_flush_context(m_screenContext, 0);
}
@@ -899,4 +961,26 @@ bool QQnxWindow::focusable() const
return (window()->flags() & Qt::WindowDoesNotAcceptFocus) != Qt::WindowDoesNotAcceptFocus;
}
+void QQnxWindow::addContextPermission()
+{
+ QByteArray grantString("context:");
+ grantString.append(QQnxIntegration::instance()->screenContextId());
+ grantString.append(":rw-");
+ screen_set_window_property_cv(m_window,
+ SCREEN_PROPERTY_PERMISSIONS,
+ grantString.length(),
+ grantString.data());
+}
+
+void QQnxWindow::removeContextPermission()
+{
+ QByteArray revokeString("context:");
+ revokeString.append(QQnxIntegration::instance()->screenContextId());
+ revokeString.append(":---");
+ screen_set_window_property_cv(m_window,
+ SCREEN_PROPERTY_PERMISSIONS,
+ revokeString.length(),
+ revokeString.data());
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index 20c38cb4b7..9040619c41 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -64,7 +64,8 @@ class QQnxWindow : public QPlatformWindow
{
friend class QQnxScreen;
public:
- QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow);
+ explicit QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow);
+ explicit QQnxWindow(QWindow *window, screen_context_t context, screen_window_t screenWindow);
virtual ~QQnxWindow();
void setGeometry(const QRect &rect) override;
@@ -124,6 +125,7 @@ protected:
screen_context_t m_screenContext;
private:
+ void collectWindowGroup();
void createWindowGroup();
void setGeometryHelper(const QRect &rect);
void removeFromParent();
@@ -135,6 +137,9 @@ private:
bool showWithoutActivating() const;
bool focusable() const;
+ void addContextPermission();
+ void removeContextPermission();
+
screen_window_t m_window;
QSize m_bufferSize;
@@ -144,6 +149,7 @@ private:
QScopedPointer<QQnxAbstractCover> m_cover;
bool m_visible;
bool m_exposed;
+ bool m_foreign;
QRect m_unmaximizedGeometry;
Qt::WindowStates m_windowState;
QString m_mmRendererWindowName;
diff --git a/src/plugins/platforms/vnc/qvnc_p.h b/src/plugins/platforms/vnc/qvnc_p.h
index 338fae9f87..f7f2f74ddb 100644
--- a/src/plugins/platforms/vnc/qvnc_p.h
+++ b/src/plugins/platforms/vnc/qvnc_p.h
@@ -139,7 +139,7 @@ public:
class QRfbServerInit
{
public:
- QRfbServerInit() { name = 0; }
+ QRfbServerInit() { name = nullptr; }
~QRfbServerInit() { delete[] name; }
int size() const { return QRfbPixelFormat::size() + 8 + strlen(name); }
diff --git a/src/plugins/platforms/vnc/qvncclient.cpp b/src/plugins/platforms/vnc/qvncclient.cpp
index 9dfe873927..3a373a5e4b 100644
--- a/src/plugins/platforms/vnc/qvncclient.cpp
+++ b/src/plugins/platforms/vnc/qvncclient.cpp
@@ -587,9 +587,18 @@ void QVncClient::frameBufferUpdateRequest()
void QVncClient::pointerEvent()
{
QRfbPointerEvent ev;
+ static int buttonState = Qt::NoButton;
if (ev.read(m_clientSocket)) {
- const QPoint pos = m_server->screen()->geometry().topLeft() + QPoint(ev.x, ev.y);
- QWindowSystemInterface::handleMouseEvent(0, pos, pos, ev.buttons, QGuiApplication::keyboardModifiers());
+ const QPointF pos = m_server->screen()->geometry().topLeft() + QPoint(ev.x, ev.y);
+ int buttonStateChange = buttonState ^ int(ev.buttons);
+ QEvent::Type type = QEvent::MouseMove;
+ if (int(ev.buttons) > buttonState)
+ type = QEvent::MouseButtonPress;
+ else if (int(ev.buttons) < buttonState)
+ type = QEvent::MouseButtonRelease;
+ QWindowSystemInterface::handleMouseEvent(nullptr, pos, pos, ev.buttons, Qt::MouseButton(buttonStateChange),
+ type, QGuiApplication::keyboardModifiers());
+ buttonState = int(ev.buttons);
m_handleMsg = false;
}
}
diff --git a/src/plugins/platforms/vnc/qvncscreen.h b/src/plugins/platforms/vnc/qvncscreen.h
index e69aa90d41..db658d4ecc 100644
--- a/src/plugins/platforms/vnc/qvncscreen.h
+++ b/src/plugins/platforms/vnc/qvncscreen.h
@@ -82,12 +82,12 @@ public:
qreal dpiX = 96;
qreal dpiY = 96;
- QVncDirtyMap *dirty = 0;
+ QVncDirtyMap *dirty = nullptr;
QRegion dirtyRegion;
int refreshRate = 30;
- QVncServer *vncServer = 0;
+ QVncServer *vncServer = nullptr;
#if QT_CONFIG(cursor)
- QVncClientCursor *clientCursor = 0;
+ QVncClientCursor *clientCursor = nullptr;
#endif
};
diff --git a/src/plugins/platforms/wasm/qtlogo.svg b/src/plugins/platforms/wasm/qtlogo.svg
index cb8989bb79..ad7c7776bf 100644
--- a/src/plugins/platforms/wasm/qtlogo.svg
+++ b/src/plugins/platforms/wasm/qtlogo.svg
@@ -5,15 +5,10 @@
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="462pt"
height="339pt"
viewBox="0 0 462 339"
- version="1.1"
- id="svg2"
- inkscape:version="0.91 r13725"
- sodipodi:docname="TheQtCompany_logo_2.svg">
+ version="1.1">
<metadata
id="metadata20">
<rdf:RDF>
@@ -26,28 +21,6 @@
</cc:Work>
</rdf:RDF>
</metadata>
- <defs
- id="defs18" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1536"
- inkscape:window-height="801"
- id="namedview16"
- showgrid="false"
- inkscape:zoom="1.1138643"
- inkscape:cx="270.58047"
- inkscape:cy="174.65092"
- inkscape:window-x="-8"
- inkscape:window-y="-8"
- inkscape:window-maximized="1"
- inkscape:current-layer="svg2" />
<path
fill="#41cd52"
d=" M 63.50 0.00 L 462.00 0.00 L 462.00 274.79 C 440.60 296.26 419.13 317.66 397.61 339.00 L 0.00 339.00 L 0.00 63.39 C 21.08 42.18 42.34 21.13 63.50 0.00 Z"
diff --git a/src/plugins/platforms/wasm/qwasmbackingstore.cpp b/src/plugins/platforms/wasm/qwasmbackingstore.cpp
index e8eda2605f..7e8a382512 100644
--- a/src/plugins/platforms/wasm/qwasmbackingstore.cpp
+++ b/src/plugins/platforms/wasm/qwasmbackingstore.cpp
@@ -81,6 +81,11 @@ void QWasmBackingStore::updateTexture()
if (m_dirty.isNull())
return;
+ if (m_recreateTexture && m_texture->isCreated()) {
+ m_recreateTexture = false;
+ m_texture->destroy();
+ }
+
if (!m_texture->isCreated()) {
m_texture->setMinificationFilter(QOpenGLTexture::Nearest);
m_texture->setMagnificationFilter(QOpenGLTexture::Nearest);
@@ -146,9 +151,7 @@ void QWasmBackingStore::resize(const QSize &size, const QRegion &staticContents)
m_image = QImage(size * window()->devicePixelRatio(), QImage::Format_RGB32);
m_image.setDevicePixelRatio(window()->devicePixelRatio());
-
- if (m_texture->isCreated())
- m_texture->destroy();
+ m_recreateTexture = true;
}
QImage QWasmBackingStore::toImage() const
diff --git a/src/plugins/platforms/wasm/qwasmbackingstore.h b/src/plugins/platforms/wasm/qwasmbackingstore.h
index 4bca83c457..b93c96b483 100644
--- a/src/plugins/platforms/wasm/qwasmbackingstore.h
+++ b/src/plugins/platforms/wasm/qwasmbackingstore.h
@@ -64,6 +64,7 @@ private:
QImage m_image;
QScopedPointer<QOpenGLTexture> m_texture;
QRegion m_dirty;
+ bool m_recreateTexture = false;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp
index 6d211667be..a810880c43 100644
--- a/src/plugins/platforms/wasm/qwasmcompositor.cpp
+++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp
@@ -681,7 +681,7 @@ void QWasmCompositor::frame()
QWasmWindow *someWindow = nullptr;
- foreach (QWasmWindow *window, m_windowStack) {
+ for (QWasmWindow *window : qAsConst(m_windowStack)) {
if (window->window()->surfaceClass() == QSurface::Window
&& qt_window_private(static_cast<QWindow *>(window->window()))->receivedExpose) {
someWindow = window;
@@ -715,7 +715,7 @@ void QWasmCompositor::frame()
m_blitter->bind();
m_blitter->setRedBlueSwizzle(true);
- foreach (QWasmWindow *window, m_windowStack) {
+ for (QWasmWindow *window : qAsConst(m_windowStack)) {
QWasmCompositedWindow &compositedWindow = m_compositedWindows[window];
if (!compositedWindow.visible)
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
index 43e82435cf..ad94ba9c77 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp
@@ -780,6 +780,60 @@ quint64 QWasmEventTranslator::getTimestamp()
return QDeadlineTimer::current().deadlineNSecs() / 1000;
}
+struct KeyMapping { Qt::Key from, to; };
+
+constexpr KeyMapping tildeKeyTable[] = { // ~
+ { Qt::Key_A, Qt::Key_Atilde },
+ { Qt::Key_N, Qt::Key_Ntilde },
+ { Qt::Key_O, Qt::Key_Otilde },
+};
+constexpr KeyMapping graveKeyTable[] = { // `
+ { Qt::Key_A, Qt::Key_Agrave },
+ { Qt::Key_E, Qt::Key_Egrave },
+ { Qt::Key_I, Qt::Key_Igrave },
+ { Qt::Key_O, Qt::Key_Ograve },
+ { Qt::Key_U, Qt::Key_Ugrave },
+};
+constexpr KeyMapping acuteKeyTable[] = { // '
+ { Qt::Key_A, Qt::Key_Aacute },
+ { Qt::Key_E, Qt::Key_Eacute },
+ { Qt::Key_I, Qt::Key_Iacute },
+ { Qt::Key_O, Qt::Key_Oacute },
+ { Qt::Key_U, Qt::Key_Uacute },
+ { Qt::Key_Y, Qt::Key_Yacute },
+};
+constexpr KeyMapping diaeresisKeyTable[] = { // umlaut ¨
+ { Qt::Key_A, Qt::Key_Adiaeresis },
+ { Qt::Key_E, Qt::Key_Ediaeresis },
+ { Qt::Key_I, Qt::Key_Idiaeresis },
+ { Qt::Key_O, Qt::Key_Odiaeresis },
+ { Qt::Key_U, Qt::Key_Udiaeresis },
+ { Qt::Key_Y, Qt::Key_ydiaeresis },
+};
+constexpr KeyMapping circumflexKeyTable[] = { // ^
+ { Qt::Key_A, Qt::Key_Acircumflex },
+ { Qt::Key_E, Qt::Key_Ecircumflex },
+ { Qt::Key_I, Qt::Key_Icircumflex },
+ { Qt::Key_O, Qt::Key_Ocircumflex },
+ { Qt::Key_U, Qt::Key_Ucircumflex },
+};
+
+static Qt::Key find_impl(const KeyMapping *first, const KeyMapping *last, Qt::Key key) noexcept
+{
+ while (first != last) {
+ if (first->from == key)
+ return first->to;
+ ++first;
+ }
+ return Qt::Key_unknown;
+}
+
+template <size_t N>
+static Qt::Key find(const KeyMapping (&map)[N], Qt::Key key) noexcept
+{
+ return find_impl(map, map + N, key);
+}
+
Qt::Key QWasmEventTranslator::translateDeadKey(Qt::Key deadKey, Qt::Key accentBaseKey)
{
Qt::Key wasmKey = Qt::Key_unknown;
@@ -789,25 +843,25 @@ Qt::Key QWasmEventTranslator::translateDeadKey(Qt::Key deadKey, Qt::Key accentBa
#else
case Qt::Key_O: // ´ Key_Dead_Grave
#endif
- wasmKey = graveKeyTable.value(accentBaseKey);
+ wasmKey = find(graveKeyTable, accentBaseKey);
break;
case Qt::Key_E: // ´ Key_Dead_Acute
- wasmKey = acuteKeyTable.value(accentBaseKey);
+ wasmKey = find(acuteKeyTable, accentBaseKey);
break;
case Qt::Key_AsciiTilde:
case Qt::Key_N:// Key_Dead_Tilde
- wasmKey = tildeKeyTable.value(accentBaseKey);
+ wasmKey = find(tildeKeyTable, accentBaseKey);
break;
#ifndef Q_OS_MACOS
case Qt::Key_QuoteLeft:
#endif
case Qt::Key_U:// ¨ Key_Dead_Diaeresis
- wasmKey = diaeresisKeyTable.value(accentBaseKey);
+ wasmKey = find(diaeresisKeyTable, accentBaseKey);
break;
case Qt::Key_I:// macOS Key_Dead_Circumflex
case Qt::Key_6:// linux
case Qt::Key_Apostrophe:// linux
- wasmKey = circumflexKeyTable.value(accentBaseKey);
+ wasmKey = find(circumflexKeyTable, accentBaseKey);
break;
default:
break;
diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.h b/src/plugins/platforms/wasm/qwasmeventtranslator.h
index 1655b7226a..568ae00732 100644
--- a/src/plugins/platforms/wasm/qwasmeventtranslator.h
+++ b/src/plugins/platforms/wasm/qwasmeventtranslator.h
@@ -77,42 +77,6 @@ private:
Qt::Key translateDeadKey(Qt::Key deadKey, Qt::Key accentBaseKey);
- QHash<Qt::Key , Qt::Key> tildeKeyTable { // ~
- { Qt::Key_A, Qt::Key_Atilde},
- { Qt::Key_N, Qt::Key_Ntilde},
- { Qt::Key_O, Qt::Key_Otilde}
- };
- QHash<Qt::Key , Qt::Key> graveKeyTable { // `
- { Qt::Key_A, Qt::Key_Agrave},
- { Qt::Key_E, Qt::Key_Egrave},
- { Qt::Key_I, Qt::Key_Igrave},
- { Qt::Key_O, Qt::Key_Ograve},
- { Qt::Key_U, Qt::Key_Ugrave}
- };
- QHash<Qt::Key , Qt::Key> acuteKeyTable { // '
- { Qt::Key_A, Qt::Key_Aacute},
- { Qt::Key_E, Qt::Key_Eacute},
- { Qt::Key_I, Qt::Key_Iacute},
- { Qt::Key_O, Qt::Key_Oacute},
- { Qt::Key_U, Qt::Key_Uacute},
- { Qt::Key_Y, Qt::Key_Yacute}
- };
- QHash<Qt::Key , Qt::Key> diaeresisKeyTable { // umlaut ¨
- { Qt::Key_A, Qt::Key_Adiaeresis},
- { Qt::Key_E, Qt::Key_Ediaeresis},
- { Qt::Key_I, Qt::Key_Idiaeresis},
- { Qt::Key_O, Qt::Key_Odiaeresis},
- { Qt::Key_U, Qt::Key_Udiaeresis},
- { Qt::Key_Y, Qt::Key_ydiaeresis}
- };
- QHash<Qt::Key , Qt::Key> circumflexKeyTable { // ^
- { Qt::Key_A, Qt::Key_Acircumflex},
- { Qt::Key_E, Qt::Key_Ecircumflex},
- { Qt::Key_I, Qt::Key_Icircumflex},
- { Qt::Key_O, Qt::Key_Ocircumflex},
- { Qt::Key_U, Qt::Key_Ucircumflex}
- };
-
QMap <int, QPointF> pressedTouchIds;
private:
diff --git a/src/plugins/platforms/wasm/qwasmfontdatabase.cpp b/src/plugins/platforms/wasm/qwasmfontdatabase.cpp
index dc6bb5847e..53e875ead6 100644
--- a/src/plugins/platforms/wasm/qwasmfontdatabase.cpp
+++ b/src/plugins/platforms/wasm/qwasmfontdatabase.cpp
@@ -38,10 +38,13 @@ void QWasmFontDatabase::populateFontDatabase()
// Load font file from resources. Currently
// all fonts needs to be bundled with the nexe
// as Qt resources.
- QStringList fontFileNames = QStringList() << QStringLiteral(":/fonts/DejaVuSansMono.ttf")
- << QStringLiteral(":/fonts/Vera.ttf")
- << QStringLiteral(":/fonts/DejaVuSans.ttf");
- foreach (const QString &fontFileName, fontFileNames) {
+
+ const QString fontFileNames[] = {
+ QStringLiteral(":/fonts/DejaVuSansMono.ttf"),
+ QStringLiteral(":/fonts/Vera.ttf"),
+ QStringLiteral(":/fonts/DejaVuSans.ttf"),
+ };
+ for (const QString &fontFileName : fontFileNames) {
QFile theFont(fontFileName);
if (!theFont.open(QIODevice::ReadOnly))
break;
diff --git a/src/plugins/platforms/wasm/wasm.pro b/src/plugins/platforms/wasm/wasm.pro
index c28df8f893..f8c8175525 100644
--- a/src/plugins/platforms/wasm/wasm.pro
+++ b/src/plugins/platforms/wasm/wasm.pro
@@ -7,6 +7,8 @@ QT += \
# Avoid X11 header collision, use generic EGL native types
DEFINES += QT_EGL_NO_X11
+DEFINES += QT_NO_FOREACH
+
SOURCES = \
main.cpp \
qwasmintegration.cpp \
diff --git a/src/plugins/platforms/wasm/wasm_shell.html b/src/plugins/platforms/wasm/wasm_shell.html
index a118c217f3..d4bf632830 100644
--- a/src/plugins/platforms/wasm/wasm_shell.html
+++ b/src/plugins/platforms/wasm/wasm_shell.html
@@ -17,7 +17,7 @@
<body onload="init()">
<figure style="overflow:visible;" id="qtspinner">
<center style="margin-top:1.5em; line-height:150%">
- <img src="qtlogo.svg"; width=320; height=200; style="display:block"> </img>
+ <img src="qtlogo.svg" width="320" height="200" style="display:block"></img>
<strong>Qt for WebAssembly: @APPNAME@</strong>
<div id="qtstatus"></div>
<noscript>JavaScript is disabled. Please enable JavaScript to use this application.</noscript>
diff --git a/src/plugins/platforms/windows/qwin10helpers.cpp b/src/plugins/platforms/windows/qwin10helpers.cpp
index cc17d8798f..9a7fce9cd5 100644
--- a/src/plugins/platforms/windows/qwin10helpers.cpp
+++ b/src/plugins/platforms/windows/qwin10helpers.cpp
@@ -137,7 +137,7 @@ bool qt_windowsIsTabletMode(HWND hwnd)
const wchar_t uiViewSettingsId[] = L"Windows.UI.ViewManagement.UIViewSettings";
HSTRING_HEADER uiViewSettingsIdRefHeader;
HSTRING uiViewSettingsIdHs = nullptr;
- const UINT32 uiViewSettingsIdLen = UINT32(sizeof(uiViewSettingsId) / sizeof(uiViewSettingsId[0]) - 1);
+ const auto uiViewSettingsIdLen = UINT32(sizeof(uiViewSettingsId) / sizeof(uiViewSettingsId[0]) - 1);
if (FAILED(baseComDll.windowsCreateStringReference(uiViewSettingsId, uiViewSettingsIdLen, &uiViewSettingsIdRefHeader, &uiViewSettingsIdHs)))
return false;
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 68807fabdd..bd7bdc55d1 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -158,7 +158,7 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
format = qt_maybeAlphaVersionWithSameDepth(format);
QWindowsNativeImage *oldwni = m_image.data();
- QWindowsNativeImage *newwni = new QWindowsNativeImage(size.width(), size.height(), format);
+ auto *newwni = new QWindowsNativeImage(size.width(), size.height(), format);
if (oldwni && !region.isEmpty()) {
const QImage &oldimg(oldwni->image());
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.h b/src/plugins/platforms/windows/qwindowsbackingstore.h
index 088ab3b257..b96c8f0e61 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.h
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.h
@@ -52,7 +52,7 @@ class QWindowsNativeImage;
class QWindowsBackingStore : public QPlatformBackingStore
{
- Q_DISABLE_COPY(QWindowsBackingStore)
+ Q_DISABLE_COPY_MOVE(QWindowsBackingStore)
public:
QWindowsBackingStore(QWindow *window);
~QWindowsBackingStore() override;
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.cpp b/src/plugins/platforms/windows/qwindowsclipboard.cpp
index b87e43f3f7..4e6d3306e1 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.cpp
+++ b/src/plugins/platforms/windows/qwindowsclipboard.cpp
@@ -115,12 +115,21 @@ static QDebug operator<<(QDebug d, const QMimeData *mimeData)
IDataObject *QWindowsClipboardRetrievalMimeData::retrieveDataObject() const
{
+ enum : int { attempts = 3 };
IDataObject * pDataObj = nullptr;
- if (OleGetClipboard(&pDataObj) == S_OK) {
- if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaMime) << __FUNCTION__ << pDataObj;
- return pDataObj;
+ // QTBUG-53979, retry in case the other application has clipboard locked
+ for (int i = 1; i <= attempts; ++i) {
+ if (SUCCEEDED(OleGetClipboard(&pDataObj))) {
+ if (QWindowsContext::verbose > 1)
+ qCDebug(lcQpaMime) << __FUNCTION__ << pDataObj;
+ return pDataObj;
+ }
+ qCWarning(lcQpaMime, i == attempts
+ ? "Unable to obtain clipboard."
+ : "Retrying to obtain clipboard.");
+ QThread::msleep(50);
}
+
return nullptr;
}
diff --git a/src/plugins/platforms/windows/qwindowsclipboard.h b/src/plugins/platforms/windows/qwindowsclipboard.h
index 469d638b89..24a6bc908d 100644
--- a/src/plugins/platforms/windows/qwindowsclipboard.h
+++ b/src/plugins/platforms/windows/qwindowsclipboard.h
@@ -58,7 +58,7 @@ protected:
class QWindowsClipboard : public QPlatformClipboard
{
- Q_DISABLE_COPY(QWindowsClipboard)
+ Q_DISABLE_COPY_MOVE(QWindowsClipboard)
public:
QWindowsClipboard();
~QWindowsClipboard() override;
@@ -87,8 +87,8 @@ private:
QWindowsClipboardRetrievalMimeData m_retrievalData;
QWindowsOleDataObject *m_data = nullptr;
- HWND m_clipboardViewer = 0;
- HWND m_nextClipboardViewer = 0;
+ HWND m_clipboardViewer = nullptr;
+ HWND m_nextClipboardViewer = nullptr;
bool m_formatListenerRegistered = false;
};
diff --git a/src/plugins/platforms/windows/qwindowscombase.h b/src/plugins/platforms/windows/qwindowscombase.h
index 6b25d665dc..45cba9c68b 100644
--- a/src/plugins/platforms/windows/qwindowscombase.h
+++ b/src/plugins/platforms/windows/qwindowscombase.h
@@ -80,7 +80,7 @@ bool qWindowsComQueryUnknownInterfaceMulti(Derived *d, REFIID id, LPVOID *iface)
// Helper base class to provide IUnknown methods for COM classes (single inheritance)
template <class ComInterface> class QWindowsComBase : public ComInterface
{
- Q_DISABLE_COPY(QWindowsComBase)
+ Q_DISABLE_COPY_MOVE(QWindowsComBase)
public:
explicit QWindowsComBase(ULONG initialRefCount = 1) : m_ref(initialRefCount) {}
virtual ~QWindowsComBase() = default;
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 5c1b00a1c9..a2dd25f8cc 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -79,6 +79,7 @@
#include <QtCore/qscopedpointer.h>
#include <QtCore/quuid.h>
#include <QtCore/private/qsystemlibrary_p.h>
+#include <QtCore/private/qwinregistry_p.h>
#include <QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h>
@@ -134,8 +135,8 @@ static inline bool useRTL_Extensions()
#if QT_CONFIG(sessionmanager)
static inline QWindowsSessionManager *platformSessionManager()
{
- QGuiApplicationPrivate *guiPrivate = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
- QSessionManagerPrivate *managerPrivate = static_cast<QSessionManagerPrivate*>(QObjectPrivate::get(guiPrivate->session_manager));
+ auto *guiPrivate = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
+ auto *managerPrivate = static_cast<QSessionManagerPrivate*>(QObjectPrivate::get(guiPrivate->session_manager));
return static_cast<QWindowsSessionManager *>(managerPrivate->platformSessionManager);
}
@@ -606,7 +607,7 @@ QString QWindowsContext::registerWindowClass(QString cname,
// add a UUID.
static int classExists = -1;
- const HINSTANCE appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
+ const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
if (classExists == -1) {
WNDCLASS wcinfo;
classExists = GetClassInfo(appInstance, reinterpret_cast<LPCWSTR>(cname.utf16()), &wcinfo);
@@ -652,14 +653,14 @@ QString QWindowsContext::registerWindowClass(QString cname,
d->m_registeredWindowClassNames.insert(cname);
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << cname
- << " style=0x" << hex << style << dec
+ << " style=0x" << Qt::hex << style << Qt::dec
<< " brush=" << brush << " icon=" << icon << " atom=" << atom;
return cname;
}
void QWindowsContext::unregisterWindowClasses()
{
- const HINSTANCE appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
+ const auto appInstance = static_cast<HINSTANCE>(GetModuleHandle(nullptr));
for (const QString &name : qAsConst(d->m_registeredWindowClassNames)) {
if (!UnregisterClass(reinterpret_cast<LPCWSTR>(name.utf16()), appInstance) && QWindowsContext::verbose)
@@ -774,7 +775,7 @@ static inline bool findPlatformWindowHelper(const POINT &screenPoint, unsigned c
HWND *hwnd, QWindowsWindow **result)
{
POINT point = screenPoint;
- ScreenToClient(*hwnd, &point);
+ screenToClient(*hwnd, &point);
// Returns parent if inside & none matched.
const HWND child = ChildWindowFromPointEx(*hwnd, point, cwexFlags);
if (!child || child == *hwnd)
@@ -1111,7 +1112,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
// For non-client-area messages, these are screen coordinates (as expected
// in the MSG structure), otherwise they are client coordinates.
if (!(et & QtWindows::NonClientEventFlag)) {
- ClientToScreen(msg.hwnd, &msg.pt);
+ clientToScreen(msg.hwnd, &msg.pt);
}
} else {
GetCursorPos(&msg.pt);
@@ -1202,13 +1203,11 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
case QtWindows::QuerySizeHints:
d->m_creationContext->applyToMinMaxInfo(reinterpret_cast<MINMAXINFO *>(lParam));
return true;
- case QtWindows::ResizeEvent: {
- const QSize size(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) - d->m_creationContext->menuHeight);
- d->m_creationContext->obtainedGeometry.setSize(size);
- }
+ case QtWindows::ResizeEvent:
+ d->m_creationContext->obtainedSize = QSize(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
return true;
case QtWindows::MoveEvent:
- d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+ d->m_creationContext->obtainedPos = QPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
return true;
case QtWindows::NonClientCreate:
if (shouldHaveNonClientDpiScaling(d->m_creationContext->window))
@@ -1421,7 +1420,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
sessionManager->blocksInteraction();
sessionManager->clearCancellation();
- QGuiApplicationPrivate *qGuiAppPriv = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
+ auto *qGuiAppPriv = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
qGuiAppPriv->commitData();
if (lParam & ENDSESSION_LOGOFF)
@@ -1439,7 +1438,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
// we receive the message for each toplevel window included internal hidden ones,
// but the aboutToQuit signal should be emitted only once.
- QGuiApplicationPrivate *qGuiAppPriv = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
+ auto *qGuiAppPriv = static_cast<QGuiApplicationPrivate*>(QObjectPrivate::get(qApp));
if (endsession && !qGuiAppPriv->aboutToQuitEmitted) {
qGuiAppPriv->aboutToQuitEmitted = true;
int index = QGuiApplication::staticMetaObject.indexOfSignal("aboutToQuit()");
@@ -1578,28 +1577,13 @@ QTouchDevice *QWindowsContext::touchDevice() const
d->m_pointerHandler.touchDevice() : d->m_mouseHandler.touchDevice();
}
-static DWORD readDwordRegistrySetting(const wchar_t *regKey, const wchar_t *subKey, DWORD defaultValue)
-{
- DWORD result = defaultValue;
- HKEY handle;
- if (RegOpenKeyEx(HKEY_CURRENT_USER, regKey, 0, KEY_READ, &handle) == ERROR_SUCCESS) {
- DWORD type;
- if (RegQueryValueEx(handle, subKey, nullptr, &type, nullptr, nullptr) == ERROR_SUCCESS
- && type == REG_DWORD) {
- DWORD value;
- DWORD size = sizeof(result);
- if (RegQueryValueEx(handle, subKey, nullptr, nullptr, reinterpret_cast<unsigned char *>(&value), &size) == ERROR_SUCCESS)
- result = value;
- }
- RegCloseKey(handle);
- }
- return result;
-}
-
DWORD QWindowsContext::readAdvancedExplorerSettings(const wchar_t *subKey, DWORD defaultValue)
{
- return readDwordRegistrySetting(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
- subKey, defaultValue);
+ const auto value =
+ QWinRegistryKey(HKEY_CURRENT_USER,
+ LR"(Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced)")
+ .dwordValue(subKey);
+ return value.second ? value.first : defaultValue;
}
static inline bool isEmptyRect(const RECT &rect)
@@ -1652,7 +1636,7 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR
if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) {
if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) {
qCDebug(lcQpaEvents).nospace() << "EVENT: hwd=" << hwnd << ' ' << eventName
- << " msg=0x" << hex << message << " et=0x" << et << dec << " wp="
+ << " msg=0x" << Qt::hex << message << " et=0x" << et << Qt::dec << " wp="
<< int(wParam) << " at " << GET_X_LPARAM(lParam) << ','
<< GET_Y_LPARAM(lParam) << " handled=" << handled;
}
@@ -1688,7 +1672,11 @@ static inline QByteArray nativeEventType() { return QByteArrayLiteral("windows_g
bool QWindowsContext::filterNativeEvent(MSG *msg, LRESULT *result)
{
QAbstractEventDispatcher *dispatcher = QAbstractEventDispatcher::instance();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr filterResult = 0;
+#else
long filterResult = 0;
+#endif
if (dispatcher && dispatcher->filterNativeEvent(nativeEventType(), msg, &filterResult)) {
*result = LRESULT(filterResult);
return true;
@@ -1699,7 +1687,11 @@ bool QWindowsContext::filterNativeEvent(MSG *msg, LRESULT *result)
// Send to QWindowSystemInterface
bool QWindowsContext::filterNativeEvent(QWindow *window, MSG *msg, LRESULT *result)
{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr filterResult = 0;
+#else
long filterResult = 0;
+#endif
if (QWindowSystemInterface::handleNativeEvent(window, nativeEventType(), msg, &filterResult)) {
*result = LRESULT(filterResult);
return true;
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index 04290379db..8027f09389 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -155,7 +155,7 @@ struct QWindowsShcoreDLL {
class QWindowsContext
{
- Q_DISABLE_COPY(QWindowsContext)
+ Q_DISABLE_COPY_MOVE(QWindowsContext)
public:
enum SystemInfoFlags
@@ -182,11 +182,11 @@ public:
QString registerWindowClass(const QWindow *w);
QString registerWindowClass(QString cname, WNDPROC proc,
- unsigned style = 0, HBRUSH brush = 0,
+ unsigned style = 0, HBRUSH brush = nullptr,
bool icon = false);
HWND createDummyWindow(const QString &classNameIn,
const wchar_t *windowName,
- WNDPROC wndProc = 0, DWORD style = WS_OVERLAPPED);
+ WNDPROC wndProc = nullptr, DWORD style = WS_OVERLAPPED);
HDC displayContext() const;
int screenDepth() const;
diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp
index 20a8117304..17e8cffb76 100644
--- a/src/plugins/platforms/windows/qwindowscursor.cpp
+++ b/src/plugins/platforms/windows/qwindowscursor.cpp
@@ -752,7 +752,7 @@ QPixmap QWindowsCursor::dragDefaultCursor(Qt::DropAction action) const
&& GetObject(iconInfo.hbmColor, sizeof(BITMAP), &bmColor)
&& bmColor.bmWidth == bmColor.bmWidthBytes / 4) {
const int colorBitsLength = bmColor.bmHeight * bmColor.bmWidthBytes;
- uchar *colorBits = new uchar[colorBitsLength];
+ auto *colorBits = new uchar[colorBitsLength];
GetBitmapBits(iconInfo.hbmColor, colorBitsLength, colorBits);
const QImage colorImage(colorBits, bmColor.bmWidth, bmColor.bmHeight,
bmColor.bmWidthBytes, QImage::Format_ARGB32);
diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h
index 8495b51a5a..b896f4c7a9 100644
--- a/src/plugins/platforms/windows/qwindowscursor.h
+++ b/src/plugins/platforms/windows/qwindowscursor.h
@@ -61,14 +61,14 @@ inline bool operator==(const QWindowsPixmapCursorCacheKey &k1, const QWindowsPix
return k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey;
}
-inline uint qHash(const QWindowsPixmapCursorCacheKey &k, uint seed) Q_DECL_NOTHROW
+inline uint qHash(const QWindowsPixmapCursorCacheKey &k, uint seed) noexcept
{
return (uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed;
}
class CursorHandle
{
- Q_DISABLE_COPY(CursorHandle)
+ Q_DISABLE_COPY_MOVE(CursorHandle)
public:
explicit CursorHandle(HCURSOR hcursor = nullptr) : m_hcursor(hcursor) {}
~CursorHandle()
@@ -84,7 +84,7 @@ private:
const HCURSOR m_hcursor;
};
-typedef QSharedPointer<CursorHandle> CursorHandlePtr;
+using CursorHandlePtr = QSharedPointer<CursorHandle>;
class QWindowsCursor : public QPlatformCursor
{
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 9de3268fc8..b7ab952a1d 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -271,7 +271,7 @@ QWindowsNativeDialogBase *QWindowsDialogHelperBase<BaseClass>::ensureNativeDialo
class QWindowsDialogThread : public QThread
{
public:
- typedef QSharedPointer<QWindowsNativeDialogBase> QWindowsNativeDialogBasePtr;
+ using QWindowsNativeDialogBasePtr = QSharedPointer<QWindowsNativeDialogBase>;
explicit QWindowsDialogThread(const QWindowsNativeDialogBasePtr &d, HWND owner)
: m_dialog(d), m_owner(owner) {}
@@ -356,7 +356,7 @@ struct FindDialogContext
static BOOL QT_WIN_CALLBACK findDialogEnumWindowsProc(HWND hwnd, LPARAM lParam)
{
- FindDialogContext *context = reinterpret_cast<FindDialogContext *>(lParam);
+ auto *context = reinterpret_cast<FindDialogContext *>(lParam);
DWORD winPid = 0;
GetWindowThreadProcessId(hwnd, &winPid);
if (winPid != context->processId)
@@ -507,7 +507,7 @@ class QWindowsNativeFileDialogBase;
class QWindowsNativeFileDialogEventHandler : public QWindowsComBase<IFileDialogEvents>
{
- Q_DISABLE_COPY(QWindowsNativeFileDialogEventHandler)
+ Q_DISABLE_COPY_MOVE(QWindowsNativeFileDialogEventHandler)
public:
static IFileDialogEvents *create(QWindowsNativeFileDialogBase *nativeFileDialog);
@@ -531,7 +531,7 @@ private:
IFileDialogEvents *QWindowsNativeFileDialogEventHandler::create(QWindowsNativeFileDialogBase *nativeFileDialog)
{
IFileDialogEvents *result;
- QWindowsNativeFileDialogEventHandler *eventHandler = new QWindowsNativeFileDialogEventHandler(nativeFileDialog);
+ auto *eventHandler = new QWindowsNativeFileDialogEventHandler(nativeFileDialog);
if (FAILED(eventHandler->QueryInterface(IID_IFileDialogEvents, reinterpret_cast<void **>(&result)))) {
qErrnoWarning("Unable to obtain IFileDialogEvents");
return nullptr;
@@ -551,7 +551,7 @@ IFileDialogEvents *QWindowsNativeFileDialogEventHandler::create(QWindowsNativeFi
class QWindowsShellItem
{
public:
- typedef std::vector<IShellItem *> IShellItems;
+ using IShellItems = std::vector<IShellItem *>;
explicit QWindowsShellItem(IShellItem *item);
@@ -736,7 +736,7 @@ QString QWindowsShellItem::libraryItemDefaultSaveFolder(IShellItem *item)
#ifndef QT_NO_DEBUG_STREAM
void QWindowsShellItem::format(QDebug &d) const
{
- d << "attributes=0x" << hex << attributes() << dec;
+ d << "attributes=0x" << Qt::hex << attributes() << Qt::dec;
if (isFileSystem())
d << " [filesys]";
if (isDir())
@@ -972,7 +972,7 @@ void QWindowsNativeFileDialogBase::doExec(HWND owner)
// gets a WM_CLOSE or the parent window is destroyed.
const HRESULT hr = m_fileDialog->Show(owner);
QWindowsDialogs::eatMouseMove();
- qCDebug(lcQpaDialogs) << '<' << __FUNCTION__ << " returns " << hex << hr;
+ qCDebug(lcQpaDialogs) << '<' << __FUNCTION__ << " returns " << Qt::hex << hr;
// Emit accepted() only if there is a result as otherwise UI hangs occur.
// For example, typing in invalid URLs results in empty result lists.
if (hr == S_OK && !m_data.selectedFiles().isEmpty()) {
@@ -1013,7 +1013,7 @@ void QWindowsNativeFileDialogBase::setMode(QFileDialogOptions::FileMode mode,
}
qCDebug(lcQpaDialogs) << __FUNCTION__ << "mode=" << mode
<< "acceptMode=" << acceptMode << "options=" << options
- << "results in" << showbase << hex << flags;
+ << "results in" << Qt::showbase << Qt::hex << flags;
if (FAILED(m_fileDialog->SetOptions(flags)))
qErrnoWarning("%s: SetOptions() failed", __FUNCTION__);
@@ -1112,7 +1112,7 @@ void QWindowsNativeFileDialogBase::setDefaultSuffixSys(const QString &s)
// If this parameter is non-empty, it will be appended by the dialog for the 'Any files'
// filter ('*'). If this parameter is non-empty and the current filter has a suffix,
// the dialog will append the filter's suffix.
- wchar_t *wSuffix = const_cast<wchar_t *>(reinterpret_cast<const wchar_t *>(s.utf16()));
+ auto *wSuffix = const_cast<wchar_t *>(reinterpret_cast<const wchar_t *>(s.utf16()));
m_fileDialog->SetDefaultExtension(wSuffix);
}
@@ -1125,7 +1125,7 @@ static inline IFileDialog2 *getFileDialog2(IFileDialog *fileDialog)
void QWindowsNativeFileDialogBase::setLabelText(QFileDialogOptions::DialogLabel l, const QString &text)
{
- wchar_t *wText = const_cast<wchar_t *>(reinterpret_cast<const wchar_t *>(text.utf16()));
+ auto *wText = const_cast<wchar_t *>(reinterpret_cast<const wchar_t *>(text.utf16()));
switch (l) {
case QFileDialogOptions::FileName:
m_fileDialog->SetFileNameLabel(wText);
@@ -1688,7 +1688,7 @@ class QWindowsXpNativeFileDialog : public QWindowsNativeDialogBase
{
Q_OBJECT
public:
- typedef QSharedPointer<QFileDialogOptions> OptionsPtr;
+ using OptionsPtr = QSharedPointer<QFileDialogOptions>;
static QWindowsXpNativeFileDialog *create(const OptionsPtr &options, const QWindowsFileDialogSharedData &data);
@@ -1770,7 +1770,7 @@ void QWindowsXpNativeFileDialog::doExec(HWND owner)
static int QT_WIN_CALLBACK xpFileDialogGetExistingDirCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
- QWindowsXpNativeFileDialog *dialog = reinterpret_cast<QWindowsXpNativeFileDialog *>(lpData);
+ auto *dialog = reinterpret_cast<QWindowsXpNativeFileDialog *>(lpData);
return dialog->existingDirCallback(hwnd, uMsg, lParam);
}
@@ -1779,7 +1779,7 @@ static int QT_WIN_CALLBACK xpFileDialogGetExistingDirCallbackProc(HWND hwnd, UIN
#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
typedef ITEMIDLIST *qt_LpItemIdList;
#else
-typedef PIDLIST_ABSOLUTE qt_LpItemIdList;
+using qt_LpItemIdList = PIDLIST_ABSOLUTE;
#endif
int QWindowsXpNativeFileDialog::existingDirCallback(HWND hwnd, UINT uMsg, LPARAM lParam)
@@ -1843,7 +1843,7 @@ void QWindowsXpNativeFileDialog::populateOpenFileName(OPENFILENAME *ofn, HWND ow
const QList<FilterSpec> specs =
filterSpecs(m_options->nameFilters(), m_options->options() & QFileDialogOptions::HideNameFilterDetails, &totalStringLength);
const int size = specs.size();
- wchar_t *ptr = new wchar_t[totalStringLength + 2 * size + 1];
+ auto *ptr = new wchar_t[totalStringLength + 2 * size + 1];
ofn->lpstrFilter = ptr;
for (const FilterSpec &spec : specs) {
ptr += spec.description.toWCharArray(ptr);
@@ -2007,7 +2007,7 @@ QString QWindowsXpFileDialogHelper::selectedNameFilter() const
\ingroup qt-lighthouse-win
*/
-typedef QSharedPointer<QColor> SharedPointerColor;
+using SharedPointerColor = QSharedPointer<QColor>;
#ifdef USE_NATIVE_COLOR_DIALOG
class QWindowsNativeColorDialog : public QWindowsNativeDialogBase
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.h b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
index 6099ea9ac6..8686749011 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.h
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.h
@@ -64,9 +64,9 @@ namespace QWindowsDialogs
template <class BaseClass>
class QWindowsDialogHelperBase : public BaseClass
{
- Q_DISABLE_COPY(QWindowsDialogHelperBase)
+ Q_DISABLE_COPY_MOVE(QWindowsDialogHelperBase)
public:
- typedef QSharedPointer<QWindowsNativeDialogBase> QWindowsNativeDialogBasePtr;
+ using QWindowsNativeDialogBasePtr = QSharedPointer<QWindowsNativeDialogBase>;
~QWindowsDialogHelperBase() { cleanupThread(); }
void exec() override;
@@ -75,7 +75,7 @@ public:
QWindow *parent) override;
void hide() override;
- virtual bool supportsNonModalDialog(const QWindow * /* parent */ = 0) const { return true; }
+ virtual bool supportsNonModalDialog(const QWindow * /* parent */ = nullptr) const { return true; }
protected:
QWindowsDialogHelperBase() = default;
@@ -91,7 +91,7 @@ private:
void cleanupThread();
QWindowsNativeDialogBasePtr m_nativeDialog;
- HWND m_ownerWindow = 0;
+ HWND m_ownerWindow = nullptr;
int m_timerId = 0;
QThread *m_thread = nullptr;
};
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index 322865b0f3..3e4c93d47a 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -428,7 +428,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
if (QWindowsContext::verbose > 1 || result != S_OK) {
qCDebug(lcQpaMime) << __FUNCTION__ << "fEscapePressed=" << fEscapePressed
<< "grfKeyState=" << grfKeyState << "buttons" << m_currentButtons
- << "returns 0x" << hex << int(result) << dec;
+ << "returns 0x" << Qt::hex << int(result) << Qt::dec;
}
return ResultFromScode(result);
}
@@ -627,7 +627,7 @@ QWindowsOleDropTarget::Drop(LPDATAOBJECT pDataObj, DWORD grfKeyState,
m_chosenEffect = DROPEFFECT_COPY;
HGLOBAL hData = GlobalAlloc(0, sizeof(DWORD));
if (hData) {
- DWORD *moveEffect = reinterpret_cast<DWORD *>(GlobalLock(hData));
+ auto *moveEffect = reinterpret_cast<DWORD *>(GlobalLock(hData));
*moveEffect = DROPEFFECT_MOVE;
GlobalUnlock(hData);
STGMEDIUM medium;
@@ -704,13 +704,13 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag)
DWORD resultEffect;
QWindowsDrag::m_canceled = false;
- QWindowsOleDropSource *windowDropSource = new QWindowsOleDropSource(this);
+ auto *windowDropSource = new QWindowsOleDropSource(this);
windowDropSource->createCursors();
- QWindowsDropDataObject *dropDataObject = new QWindowsDropDataObject(dropData);
+ auto *dropDataObject = new QWindowsDropDataObject(dropData);
const Qt::DropActions possibleActions = drag->supportedActions();
const DWORD allowedEffects = translateToWinDragEffects(possibleActions);
qCDebug(lcQpaMime) << '>' << __FUNCTION__ << "possible Actions=0x"
- << hex << int(possibleActions) << "effects=0x" << allowedEffects << dec;
+ << Qt::hex << int(possibleActions) << "effects=0x" << allowedEffects << Qt::dec;
// Indicate message handlers we are in DoDragDrop() event loop.
QWindowsDrag::m_dragging = true;
const HRESULT r = DoDragDrop(dropDataObject, windowDropSource, allowedEffects, &resultEffect);
@@ -734,9 +734,9 @@ Qt::DropAction QWindowsDrag::drag(QDrag *drag)
dropDataObject->releaseQt();
dropDataObject->Release(); // Will delete obj if refcount becomes 0
windowDropSource->Release(); // Will delete src if refcount becomes 0
- qCDebug(lcQpaMime) << '<' << __FUNCTION__ << hex << "allowedEffects=0x" << allowedEffects
+ qCDebug(lcQpaMime) << '<' << __FUNCTION__ << Qt::hex << "allowedEffects=0x" << allowedEffects
<< "reportedPerformedEffect=0x" << reportedPerformedEffect
- << " resultEffect=0x" << resultEffect << "hr=0x" << int(r) << dec << "dropAction=" << dragResult;
+ << " resultEffect=0x" << resultEffect << "hr=0x" << int(r) << Qt::dec << "dropAction=" << dragResult;
return dragResult;
}
diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp
index 063e81150e..e9f3dc5189 100644
--- a/src/plugins/platforms/windows/qwindowseglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp
@@ -469,10 +469,10 @@ bool QWindowsEGLContext::makeCurrent(QPlatformSurface *surface)
QWindowsEGLStaticContext::libEGL.eglBindAPI(m_api);
- QWindowsWindow *window = static_cast<QWindowsWindow *>(surface);
+ auto *window = static_cast<QWindowsWindow *>(surface);
window->aboutToMakeCurrent();
int err = 0;
- EGLSurface eglSurface = static_cast<EGLSurface>(window->surface(m_eglConfig, &err));
+ auto eglSurface = static_cast<EGLSurface>(window->surface(m_eglConfig, &err));
if (eglSurface == EGL_NO_SURFACE) {
if (err == EGL_CONTEXT_LOST) {
m_eglContext = EGL_NO_CONTEXT;
@@ -531,9 +531,9 @@ void QWindowsEGLContext::doneCurrent()
void QWindowsEGLContext::swapBuffers(QPlatformSurface *surface)
{
QWindowsEGLStaticContext::libEGL.eglBindAPI(m_api);
- QWindowsWindow *window = static_cast<QWindowsWindow *>(surface);
+ auto *window = static_cast<QWindowsWindow *>(surface);
int err = 0;
- EGLSurface eglSurface = static_cast<EGLSurface>(window->surface(m_eglConfig, &err));
+ auto eglSurface = static_cast<EGLSurface>(window->surface(m_eglConfig, &err));
if (eglSurface == EGL_NO_SURFACE) {
if (err == EGL_CONTEXT_LOST) {
m_eglContext = EGL_NO_CONTEXT;
diff --git a/src/plugins/platforms/windows/qwindowseglcontext.h b/src/plugins/platforms/windows/qwindowseglcontext.h
index 8a1e1ddae8..d96e266159 100644
--- a/src/plugins/platforms/windows/qwindowseglcontext.h
+++ b/src/plugins/platforms/windows/qwindowseglcontext.h
@@ -109,7 +109,7 @@ private:
class QWindowsEGLStaticContext : public QWindowsStaticOpenGLContext
{
- Q_DISABLE_COPY(QWindowsEGLStaticContext)
+ Q_DISABLE_COPY_MOVE(QWindowsEGLStaticContext)
public:
static QWindowsEGLStaticContext *create(QWindowsOpenGLTester::Renderers preferredType);
diff --git a/src/plugins/platforms/windows/qwindowsgdinativeinterface.cpp b/src/plugins/platforms/windows/qwindowsgdinativeinterface.cpp
index 08e11c5e39..f2418b0e60 100644
--- a/src/plugins/platforms/windows/qwindowsgdinativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsgdinativeinterface.cpp
@@ -50,7 +50,7 @@ void *QWindowsGdiNativeInterface::nativeResourceForBackingStore(const QByteArray
qWarning("%s: '%s' requested for null backingstore or backingstore without handle.", __FUNCTION__, resource.constData());
return nullptr;
}
- QWindowsBackingStore *wbs = static_cast<QWindowsBackingStore *>(bs->handle());
+ auto *wbs = static_cast<QWindowsBackingStore *>(bs->handle());
if (resource == "getDC")
return wbs->getDC();
qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 50f528e7fc..8bf88300e9 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -243,7 +243,7 @@ QDebug operator<<(QDebug d, const PIXELFORMATDESCRIPTOR &pd)
QDebugStateSaver saver(d);
d.nospace();
d << "PIXELFORMATDESCRIPTOR "
- << "dwFlags=" << hex << showbase << pd.dwFlags << dec << noshowbase;
+ << "dwFlags=" << Qt::hex << Qt::showbase << pd.dwFlags << Qt::dec << Qt::noshowbase;
if (pd.dwFlags & PFD_DRAW_TO_WINDOW) d << " PFD_DRAW_TO_WINDOW";
if (pd.dwFlags & PFD_DRAW_TO_BITMAP) d << " PFD_DRAW_TO_BITMAP";
if (pd.dwFlags & PFD_SUPPORT_GDI) d << " PFD_SUPPORT_GDI";
@@ -631,10 +631,10 @@ static int choosePixelFormat(HDC hdc,
nsp << __FUNCTION__;
if (sampleBuffersRequested)
nsp << " samples=" << iAttributes[samplesValuePosition];
- nsp << " Attributes: " << hex << showbase;
+ nsp << " Attributes: " << Qt::hex << Qt::showbase;
for (int ii = 0; ii < i; ++ii)
nsp << iAttributes[ii] << ',';
- nsp << noshowbase << dec << "\n obtained px #" << pixelFormat
+ nsp << Qt::noshowbase << Qt::dec << "\n obtained px #" << pixelFormat
<< " of " << numFormats << "\n " << *obtainedPfd;
qCDebug(lcQpaGl) << message;
} // Debug
@@ -784,7 +784,7 @@ static HGLRC createContext(const QOpenGLStaticContext &staticContext,
if (!result) {
QString message;
QDebug(&message).nospace() << __FUNCTION__ << ": wglCreateContextAttribsARB() failed (GL error code: 0x"
- << hex << staticContext.opengl32.glGetError() << dec << ") for format: " << format << ", shared context: " << shared;
+ << Qt::hex << staticContext.opengl32.glGetError() << Qt::dec << ") for format: " << format << ", shared context: " << shared;
qErrnoWarning("%s", qPrintable(message));
}
return result;
@@ -912,7 +912,7 @@ void QWindowsOpenGLContextFormat::apply(QSurfaceFormat *format) const
class QOpenGLTemporaryContext
{
- Q_DISABLE_COPY(QOpenGLTemporaryContext)
+ Q_DISABLE_COPY_MOVE(QOpenGLTemporaryContext)
public:
QOpenGLTemporaryContext();
~QOpenGLTemporaryContext();
@@ -1028,7 +1028,7 @@ QOpenGLStaticContext *QOpenGLStaticContext::create(bool softwareRendering)
QScopedPointer<QOpenGLTemporaryContext> temporaryContext;
if (!QOpenGLStaticContext::opengl32.wglGetCurrentContext())
temporaryContext.reset(new QOpenGLTemporaryContext);
- QOpenGLStaticContext *result = new QOpenGLStaticContext;
+ auto *result = new QOpenGLStaticContext;
qCDebug(lcQpaGl) << __FUNCTION__ << *result;
return result;
}
@@ -1070,7 +1070,7 @@ QWindowsGLContext::QWindowsGLContext(QOpenGLStaticContext *staticContext,
qWarning("QWindowsGLContext: Requires a QWGLNativeContext");
return;
}
- QWGLNativeContext handle = nativeHandle.value<QWGLNativeContext>();
+ auto handle = nativeHandle.value<QWGLNativeContext>();
HGLRC wglcontext = handle.context();
HWND wnd = handle.window();
if (!wglcontext || !wnd) {
@@ -1308,7 +1308,7 @@ bool QWindowsGLContext::makeCurrent(QPlatformSurface *surface)
Q_ASSERT(surface->surface()->supportsOpenGL());
// Do we already have a DC entry for that window?
- QWindowsWindow *window = static_cast<QWindowsWindow *>(surface);
+ auto *window = static_cast<QWindowsWindow *>(surface);
window->aboutToMakeCurrent();
const HWND hwnd = window->handle();
if (const QOpenGLContextData *contextData = findByHWND(m_windowContexts, hwnd)) {
@@ -1377,7 +1377,7 @@ QFunctionPointer QWindowsGLContext::getProcAddress(const char *procName)
// Even though we use QFunctionPointer, it does not mean the function can be called.
// It will need to be cast to the proper function type with the correct calling
// convention. QFunctionPointer is nothing more than a glorified void* here.
- QFunctionPointer procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName));
+ auto procAddress = reinterpret_cast<QFunctionPointer>(QOpenGLStaticContext::opengl32.wglGetProcAddress(procName));
// We support AllGLFunctionsQueryable, which means this function must be able to
// return a function pointer even for functions that are in GL.h and exported
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index 00e4d323a6..8b0c33f7d5 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -75,9 +75,9 @@ struct QOpenGLContextData
QOpenGLContextData(HGLRC r, HWND h, HDC d) : renderingContext(r), hwnd(h), hdc(d) {}
QOpenGLContextData() {}
- HGLRC renderingContext = 0;
- HWND hwnd = 0;
- HDC hdc = 0;
+ HGLRC renderingContext = nullptr;
+ HWND hwnd = nullptr;
+ HDC hdc = nullptr;
};
class QOpenGLStaticContext;
@@ -89,7 +89,7 @@ struct QWindowsOpenGLContextFormat
QSurfaceFormat::OpenGLContextProfile profile = QSurfaceFormat::NoProfile;
int version = 0; //! majorVersion<<8 + minorVersion
- QSurfaceFormat::FormatOptions options = 0;
+ QSurfaceFormat::FormatOptions options = nullptr;
};
#ifndef QT_NO_DEBUG_STREAM
@@ -134,7 +134,7 @@ private:
class QOpenGLStaticContext : public QWindowsStaticOpenGLContext
{
- Q_DISABLE_COPY(QOpenGLStaticContext)
+ Q_DISABLE_COPY_MOVE(QOpenGLStaticContext)
QOpenGLStaticContext();
public:
enum Extensions
@@ -223,7 +223,7 @@ private:
typedef GLenum (APIENTRY *GlGetGraphicsResetStatusArbType)();
inline void releaseDCs();
- bool updateObtainedParams(HDC hdc, int *obtainedSwapInterval = 0);
+ bool updateObtainedParams(HDC hdc, int *obtainedSwapInterval = nullptr);
QOpenGLStaticContext *m_staticContext;
QOpenGLContext *m_context;
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index bbfad7d712..079c25f9eb 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -666,9 +666,9 @@ void QWindowsInputContext::handleInputLanguageChanged(WPARAM wparam, LPARAM lpar
m_locale = qt_localeFromLCID(m_languageId);
emitLocaleChanged();
- qCDebug(lcQpaInputMethods) << __FUNCTION__ << hex << showbase
+ qCDebug(lcQpaInputMethods) << __FUNCTION__ << Qt::hex << Qt::showbase
<< oldLanguageId << "->" << newLanguageId << "Character set:"
- << DWORD(wparam) << dec << noshowbase << m_locale;
+ << DWORD(wparam) << Qt::dec << Qt::noshowbase << m_locale;
}
/*!
@@ -726,7 +726,7 @@ int QWindowsInputContext::reconvertString(RECONVERTSTRING *reconv)
reconv->dwCompStrOffset = DWORD(startPos) * sizeof(ushort); // byte count.
reconv->dwTargetStrLen = reconv->dwCompStrLen;
reconv->dwTargetStrOffset = reconv->dwCompStrOffset;
- ushort *pastReconv = reinterpret_cast<ushort *>(reconv + 1);
+ auto *pastReconv = reinterpret_cast<ushort *>(reconv + 1);
std::copy(surroundingText.utf16(), surroundingText.utf16() + surroundingText.size(),
QT_MAKE_UNCHECKED_ARRAY_ITERATOR(pastReconv));
return memSize;
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.h b/src/plugins/platforms/windows/qwindowsinputcontext.h
index a47585c29e..857706bcb9 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.h
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.h
@@ -53,12 +53,12 @@ class QWindowsWindow;
class QWindowsInputContext : public QPlatformInputContext
{
- Q_DISABLE_COPY(QWindowsInputContext)
+ Q_DISABLE_COPY_MOVE(QWindowsInputContext)
Q_OBJECT
struct CompositionContext
{
- HWND hwnd = 0;
+ HWND hwnd = nullptr;
QString composition;
int position = 0;
bool isComposing = false;
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 849e6cf2d0..09117f663d 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -133,7 +133,7 @@ QT_BEGIN_NAMESPACE
struct QWindowsIntegrationPrivate
{
- Q_DISABLE_COPY(QWindowsIntegrationPrivate)
+ Q_DISABLE_COPY_MOVE(QWindowsIntegrationPrivate)
explicit QWindowsIntegrationPrivate(const QStringList &paramList);
~QWindowsIntegrationPrivate();
@@ -217,6 +217,8 @@ static inline unsigned parseOptions(const QStringList &paramList,
options |= QWindowsIntegration::NoNativeMenus;
} else if (param == QLatin1String("nowmpointer")) {
options |= QWindowsIntegration::DontUseWMPointer;
+ } else if (param == QLatin1String("reverse")) {
+ options |= QWindowsIntegration::RtlEnabled;
} else {
qWarning() << "Unknown option" << param;
}
@@ -324,9 +326,9 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co
QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) const
{
if (window->type() == Qt::Desktop) {
- QWindowsDesktopWindow *result = new QWindowsDesktopWindow(window);
+ auto *result = new QWindowsDesktopWindow(window);
qCDebug(lcQpaWindows) << "Desktop window:" << window
- << showbase << hex << result->winId() << noshowbase << dec << result->geometry();
+ << Qt::showbase << Qt::hex << result->winId() << Qt::noshowbase << Qt::dec << result->geometry();
return result;
}
@@ -371,15 +373,15 @@ QPlatformWindow *QWindowsIntegration::createForeignWindow(QWindow *window, WId n
qWarning("Windows QPA: Invalid foreign window ID %p.", hwnd);
return nullptr;
}
- QWindowsForeignWindow *result = new QWindowsForeignWindow(window, hwnd);
+ auto *result = new QWindowsForeignWindow(window, hwnd);
const QRect obtainedGeometry = result->geometry();
QScreen *screen = nullptr;
if (const QPlatformScreen *pScreen = result->screenForGeometry(obtainedGeometry))
screen = pScreen->screen();
if (screen && screen != window->screen())
window->setScreen(screen);
- qCDebug(lcQpaWindows) << "Foreign window:" << window << showbase << hex
- << result->winId() << noshowbase << dec << obtainedGeometry << screen;
+ qCDebug(lcQpaWindows) << "Foreign window:" << window << Qt::showbase << Qt::hex
+ << result->winId() << Qt::noshowbase << Qt::dec << obtainedGeometry << screen;
return result;
}
diff --git a/src/plugins/platforms/windows/qwindowsintegration.h b/src/plugins/platforms/windows/qwindowsintegration.h
index e28b2c2fb3..b49d21022b 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.h
+++ b/src/plugins/platforms/windows/qwindowsintegration.h
@@ -54,7 +54,7 @@ class QWindowsStaticOpenGLContext;
class QWindowsIntegration : public QPlatformIntegration
{
- Q_DISABLE_COPY(QWindowsIntegration)
+ Q_DISABLE_COPY_MOVE(QWindowsIntegration)
public:
enum Options { // Options to be passed on command line.
FontDatabaseFreeType = 0x1,
@@ -69,7 +69,8 @@ public:
AlwaysUseNativeMenus = 0x100,
NoNativeMenus = 0x200,
DontUseWMPointer = 0x400,
- DetectAltGrModifier = 0x800
+ DetectAltGrModifier = 0x800,
+ RtlEnabled = 0x1000
};
explicit QWindowsIntegration(const QStringList &paramList);
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index da630005d6..4f0f846749 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -100,7 +100,7 @@ QWindowsKeyMapper::QWindowsKeyMapper()
: m_useRTLExtensions(false), m_keyGrabber(nullptr)
{
memset(keyLayout, 0, sizeof(keyLayout));
- QGuiApplication *app = static_cast<QGuiApplication *>(QGuiApplication::instance());
+ auto *app = static_cast<QGuiApplication *>(QGuiApplication::instance());
QObject::connect(app, &QGuiApplication::applicationStateChanged,
app, clearKeyRecorderOnApplicationInActive);
changeKeyboard();
@@ -554,7 +554,7 @@ QDebug operator<<(QDebug d, const KeyboardLayoutItem &k)
if (const quint32 qtKey = k.qtKey[i]) {
d << '[' << i << ' ';
QtDebugUtils::formatQFlags(d, ModsTbl[i]);
- d << ' ' << hex << showbase << qtKey << dec << noshowbase << ' ';
+ d << ' ' << Qt::hex << Qt::showbase << qtKey << Qt::dec << Qt::noshowbase << ' ';
QtDebugUtils::formatQEnum(d, Qt::Key(qtKey));
if (qtKey >= 32 && qtKey < 128)
d << " '" << char(qtKey) << '\'';
@@ -776,7 +776,7 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32
::ToAscii(vk_key, scancode, kbdBuffer, reinterpret_cast<LPWORD>(&buffer), 0);
}
qCDebug(lcQpaEvents) << __FUNCTION__ << "for virtual key="
- << hex << showbase << vk_key << dec << noshowbase << keyLayout[vk_key];
+ << Qt::hex << Qt::showbase << vk_key << Qt::dec << Qt::noshowbase << keyLayout[vk_key];
}
static inline QString messageKeyText(const MSG &msg)
@@ -950,7 +950,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
const UINT msgType = msg.message;
const quint32 scancode = (msg.lParam >> 16) & scancodeBitmask;
- quint32 vk_key = quint32(msg.wParam);
+ auto vk_key = quint32(msg.wParam);
quint32 nModifiers = 0;
QWindow *receiver = m_keyGrabber ? m_keyGrabber : window;
@@ -1182,7 +1182,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, MSG msg,
// results, if we map this virtual key-code directly (for eg '?' US layouts). So try
// to find the correct key using the current message parameters & keyboard state.
if (uch.isNull() && msgType == WM_IME_KEYDOWN) {
- const QWindowsInputContext *windowsInputContext =
+ const auto *windowsInputContext =
qobject_cast<const QWindowsInputContext *>(QWindowsIntegration::instance()->inputContext());
if (!(windowsInputContext && windowsInputContext->isComposing()))
vk_key = ImmGetVirtualKey(reinterpret_cast<HWND>(window->winId()));
@@ -1400,7 +1400,7 @@ QList<int> QWindowsKeyMapper::possibleKeys(const QKeyEvent *e) const
}
}
qCDebug(lcQpaEvents) << __FUNCTION__ << e << "nativeVirtualKey="
- << showbase << hex << e->nativeVirtualKey() << dec << noshowbase
+ << Qt::showbase << Qt::hex << e->nativeVirtualKey() << Qt::dec << Qt::noshowbase
<< e->modifiers() << kbItem << "\n returns" << formatKeys(result);
return result;
}
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.h b/src/plugins/platforms/windows/qwindowskeymapper.h
index a454f0f973..b1ada1d373 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.h
+++ b/src/plugins/platforms/windows/qwindowskeymapper.h
@@ -71,7 +71,7 @@ struct KeyboardLayoutItem {
class QWindowsKeyMapper
{
- Q_DISABLE_COPY(QWindowsKeyMapper)
+ Q_DISABLE_COPY_MOVE(QWindowsKeyMapper)
public:
explicit QWindowsKeyMapper();
~QWindowsKeyMapper();
diff --git a/src/plugins/platforms/windows/qwindowsmenu.cpp b/src/plugins/platforms/windows/qwindowsmenu.cpp
index 5a92a7cf90..d20edd685e 100644
--- a/src/plugins/platforms/windows/qwindowsmenu.cpp
+++ b/src/plugins/platforms/windows/qwindowsmenu.cpp
@@ -518,7 +518,7 @@ QWindowsMenu::~QWindowsMenu()
void QWindowsMenu::insertMenuItem(QPlatformMenuItem *menuItemIn, QPlatformMenuItem *before)
{
qCDebug(lcQpaMenus) << __FUNCTION__ << '(' << menuItemIn << ", before=" << before << ')' << this;
- QWindowsMenuItem *menuItem = static_cast<QWindowsMenuItem *>(menuItemIn);
+ auto *menuItem = static_cast<QWindowsMenuItem *>(menuItemIn);
const int index = insertBefore(&m_menuItems, menuItemIn, before);
const bool append = index == m_menuItems.size() - 1;
menuItem->insertIntoMenu(this, append, index);
@@ -689,7 +689,7 @@ void QWindowsPopupMenu::showPopup(const QWindow *parentWindow, const QRect &targ
const QPlatformMenuItem *item)
{
qCDebug(lcQpaMenus) << __FUNCTION__ << '>' << this << parentWindow << targetRect << item;
- const QWindowsBaseWindow *window = static_cast<const QWindowsBaseWindow *>(parentWindow->handle());
+ const auto *window = static_cast<const QWindowsBaseWindow *>(parentWindow->handle());
const QPoint globalPos = window->mapToGlobal(targetRect.topLeft());
trackPopupMenu(window->handle(), globalPos.x(), globalPos.y());
}
@@ -756,7 +756,7 @@ QWindowsMenuBar::~QWindowsMenuBar()
void QWindowsMenuBar::insertMenu(QPlatformMenu *menuIn, QPlatformMenu *before)
{
qCDebug(lcQpaMenus) << __FUNCTION__ << menuIn << "before=" << before;
- QWindowsMenu *menu = static_cast<QWindowsMenu *>(menuIn);
+ auto *menu = static_cast<QWindowsMenu *>(menuIn);
const int index = insertBefore(&m_menus, menuIn, before);
menu->insertIntoMenuBar(this, index == m_menus.size() - 1, index);
}
@@ -784,7 +784,7 @@ void QWindowsMenuBar::handleReparent(QWindow *newParentWindow)
if (QPlatformWindow *platWin = newParentWindow->handle())
install(static_cast<QWindowsWindow *>(platWin));
else // Store for later creation, see menuBarOf()
- newParentWindow->setProperty(menuBarPropertyName, qVariantFromValue<QObject *>(this));
+ newParentWindow->setProperty(menuBarPropertyName, QVariant::fromValue<QObject *>(this));
}
QWindowsMenuBar *QWindowsMenuBar::menuBarOf(const QWindow *notYetCreatedWindow)
@@ -896,8 +896,8 @@ void QWindowsMenuItem::formatDebug(QDebug &d) const
d << ", parentMenu=" << static_cast<const void *>(m_parentMenu);
if (m_subMenu)
d << ", subMenu=" << static_cast<const void *>(m_subMenu);
- d << ", tag=" << showbase << hex
- << tag() << noshowbase << dec << ", id=" << m_id;
+ d << ", tag=" << Qt::showbase << Qt::hex
+ << tag() << Qt::noshowbase << Qt::dec << ", id=" << m_id;
#if QT_CONFIG(shortcut)
if (!m_shortcut.isEmpty())
d << ", shortcut=" << m_shortcut;
@@ -933,7 +933,7 @@ void QWindowsMenu::formatDebug(QDebug &d) const
if (m_parentMenu != nullptr)
d << " [on menu]";
if (tag())
- d << ", tag=" << showbase << hex << tag() << noshowbase << dec;
+ d << ", tag=" << Qt::showbase << Qt::hex << tag() << Qt::noshowbase << Qt::dec;
if (m_visible)
d << " [visible]";
if (m_enabled)
diff --git a/src/plugins/platforms/windows/qwindowsmenu.h b/src/plugins/platforms/windows/qwindowsmenu.h
index 6de1553f35..aa36846ec0 100644
--- a/src/plugins/platforms/windows/qwindowsmenu.h
+++ b/src/plugins/platforms/windows/qwindowsmenu.h
@@ -120,7 +120,7 @@ class QWindowsMenu : public QPlatformMenu
{
Q_OBJECT
public:
- typedef QVector<QWindowsMenuItem *> MenuItems;
+ using MenuItems = QVector<QWindowsMenuItem *>;
QWindowsMenu();
~QWindowsMenu();
@@ -196,7 +196,7 @@ class QWindowsMenuBar : public QPlatformMenuBar
{
Q_OBJECT
public:
- typedef QVector<QWindowsMenu *> Menus;
+ using Menus = QVector<QWindowsMenu *>;
QWindowsMenuBar();
~QWindowsMenuBar() override;
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index 030d8d1e0f..b9d8b191f5 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -178,7 +178,7 @@ static bool qt_write_dibv5(QDataStream &s, QImage image)
if (image.format() != QImage::Format_ARGB32)
image = image.convertToFormat(QImage::Format_ARGB32);
- uchar *buf = new uchar[bpl_bmp];
+ auto *buf = new uchar[bpl_bmp];
memset(buf, 0, size_t(bpl_bmp));
for (int y=image.height()-1; y>=0; y--) {
@@ -264,7 +264,7 @@ static bool qt_read_dibv5(QDataStream &s, QImage &image)
const int bpl = image.bytesPerLine();
uchar *data = image.bits();
- uchar *buf24 = new uchar[bpl];
+ auto *buf24 = new uchar[bpl];
const int bpl24 = ((w * nbits + 31) / 32) * 4;
while (--h >= 0) {
@@ -286,7 +286,7 @@ static bool qt_read_dibv5(QDataStream &s, QImage &image)
if (bi.bV5Height < 0) {
// Flip the image
- uchar *buf = new uchar[bpl];
+ auto *buf = new uchar[bpl];
h = -bi.bV5Height;
for (int y = 0; y < h/2; ++y) {
memcpy(buf, data + y * bpl, size_t(bpl));
@@ -772,16 +772,16 @@ bool QWindowsMimeURI::convertFromMime(const FORMATETC &formatetc, const QMimeDat
}
QByteArray result(size, '\0');
- DROPFILES* d = reinterpret_cast<DROPFILES *>(result.data());
+ auto* d = reinterpret_cast<DROPFILES *>(result.data());
d->pFiles = sizeof(DROPFILES);
GetCursorPos(&d->pt); // try
d->fNC = true;
char *files = (reinterpret_cast<char*>(d)) + d->pFiles;
d->fWide = true;
- wchar_t *f = reinterpret_cast<wchar_t *>(files);
+ auto *f = reinterpret_cast<wchar_t *>(files);
for (int i=0; i<fileNames.size(); i++) {
- const size_t l = size_t(fileNames.at(i).length());
+ const auto l = size_t(fileNames.at(i).length());
memcpy(f, fileNames.at(i).utf16(), l * sizeof(ushort));
f += l;
*f++ = 0;
@@ -852,9 +852,9 @@ QVariant QWindowsMimeURI::convertToMime(const QString &mimeType, LPDATAOBJECT pD
if (data.isEmpty())
return QVariant();
- const DROPFILES *hdrop = reinterpret_cast<const DROPFILES *>(data.constData());
+ const auto *hdrop = reinterpret_cast<const DROPFILES *>(data.constData());
if (hdrop->fWide) {
- const wchar_t *filesw = reinterpret_cast<const wchar_t *>(data.constData() + hdrop->pFiles);
+ const auto *filesw = reinterpret_cast<const wchar_t *>(data.constData() + hdrop->pFiles);
int i = 0;
while (filesw[i]) {
QString fileurl = QString::fromWCharArray(filesw + i);
@@ -1055,7 +1055,7 @@ QVector<FORMATETC> QWindowsMimeImage::formatsForMime(const QString &mimeType, co
QVector<FORMATETC> formatetcs;
if (mimeData->hasImage() && mimeType == QLatin1String("application/x-qt-image")) {
//add DIBV5 if image has alpha channel. Do not add CF_PNG here as it will confuse MS Office (QTBUG47656).
- QImage image = qvariant_cast<QImage>(mimeData->imageData());
+ auto image = qvariant_cast<QImage>(mimeData->imageData());
if (!image.isNull() && image.hasAlphaChannel())
formatetcs += setCf(CF_DIBV5);
formatetcs += setCf(CF_DIB);
@@ -1097,7 +1097,7 @@ bool QWindowsMimeImage::convertFromMime(const FORMATETC &formatetc, const QMimeD
{
int cf = getCf(formatetc);
if ((cf == CF_DIB || cf == CF_DIBV5 || cf == int(CF_PNG)) && mimeData->hasImage()) {
- QImage img = qvariant_cast<QImage>(mimeData->imageData());
+ auto img = qvariant_cast<QImage>(mimeData->imageData());
if (img.isNull())
return false;
QByteArray ba;
diff --git a/src/plugins/platforms/windows/qwindowsmime.h b/src/plugins/platforms/windows/qwindowsmime.h
index 6bbbae1a0e..1c389e8800 100644
--- a/src/plugins/platforms/windows/qwindowsmime.h
+++ b/src/plugins/platforms/windows/qwindowsmime.h
@@ -53,7 +53,7 @@ class QMimeData;
class QWindowsMime
{
- Q_DISABLE_COPY(QWindowsMime)
+ Q_DISABLE_COPY_MOVE(QWindowsMime)
public:
QWindowsMime();
virtual ~QWindowsMime();
@@ -73,7 +73,7 @@ public:
class QWindowsMimeConverter
{
- Q_DISABLE_COPY(QWindowsMimeConverter)
+ Q_DISABLE_COPY_MOVE(QWindowsMimeConverter)
public:
QWindowsMimeConverter();
~QWindowsMimeConverter();
@@ -85,7 +85,7 @@ public:
// Convenience.
QVariant convertToMime(const QStringList &mimeTypes, IDataObject *pDataObj, QVariant::Type preferredType,
- QString *format = 0) const;
+ QString *format = nullptr) const;
void registerMime(QWindowsMime *mime);
void unregisterMime(QWindowsMime *mime) { m_mimes.removeOne(mime); }
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index e33591c33d..6df5e6aa27 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -106,7 +106,7 @@ static inline void compressMouseMove(MSG *msg)
// Extract the x,y coordinates from the lParam as we do in the WndProc
msg->pt.x = GET_X_LPARAM(mouseMsg.lParam);
msg->pt.y = GET_Y_LPARAM(mouseMsg.lParam);
- ClientToScreen(msg->hwnd, &(msg->pt));
+ clientToScreen(msg->hwnd, &(msg->pt));
// Remove the mouse move message
PeekMessage(&mouseMsg, msg->hwnd, WM_MOUSEMOVE,
WM_MOUSEMOVE, PM_REMOVE);
@@ -124,10 +124,10 @@ static inline QTouchDevice *createTouchDevice()
return nullptr;
const int tabletPc = GetSystemMetrics(SM_TABLETPC);
const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES);
- qCDebug(lcQpaEvents) << "Digitizers:" << hex << showbase << (digitizers & ~NID_READY)
- << "Ready:" << (digitizers & NID_READY) << dec << noshowbase
+ qCDebug(lcQpaEvents) << "Digitizers:" << Qt::hex << Qt::showbase << (digitizers & ~NID_READY)
+ << "Ready:" << (digitizers & NID_READY) << Qt::dec << Qt::noshowbase
<< "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints;
- QTouchDevice *result = new QTouchDevice;
+ auto *result = new QTouchDevice;
result->setType(digitizers & NID_INTEGRATED_TOUCH
? QTouchDevice::TouchScreen : QTouchDevice::TouchPad);
QTouchDevice::Capabilities capabilities = QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::NormalizedPosition;
@@ -268,7 +268,13 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
if (et == QtWindows::MouseWheelEvent)
return translateMouseWheelEvent(window, hwnd, msg, result);
- const QPoint winEventPosition(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
+ QPoint winEventPosition(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
+ if ((et & QtWindows::NonClientEventFlag) == 0 && QWindowsBaseWindow::isRtlLayout(hwnd)) {
+ RECT clientArea;
+ GetClientRect(hwnd, &clientArea);
+ winEventPosition.setX(clientArea.right - winEventPosition.x());
+ }
+
QPoint clientPosition;
QPoint globalPosition;
if (et & QtWindows::NonClientEventFlag) {
@@ -300,7 +306,7 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
// However, when tablet support is active, extraInfo is a packet serial number. This is not a problem
// since we do not want to ignore mouse events coming from a tablet.
// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320.aspx
- const quint64 extraInfo = quint64(GetMessageExtraInfo());
+ const auto extraInfo = quint64(GetMessageExtraInfo());
if ((extraInfo & signatureMask) == miWpSignature) {
if (extraInfo & 0x80) { // Bit 7 indicates touch event, else tablet pen.
source = Qt::MouseEventSynthesizedBySystem;
@@ -364,7 +370,7 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
return true;
}
- QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window->handle());
+ auto *platformWindow = static_cast<QWindowsWindow *>(window->handle());
// If the window was recently resized via mouse doubleclick on the frame or title bar,
// we don't get WM_LBUTTONDOWN or WM_LBUTTONDBLCLK for the second click,
@@ -603,8 +609,8 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND,
QtWindows::WindowsEventType,
MSG msg, LRESULT *)
{
- typedef QWindowSystemInterface::TouchPoint QTouchPoint;
- typedef QList<QWindowSystemInterface::TouchPoint> QTouchPointList;
+ using QTouchPoint = QWindowSystemInterface::TouchPoint;
+ using QTouchPointList = QList<QWindowSystemInterface::TouchPoint>;
if (!QWindowsContext::instance()->initTouch()) {
qWarning("Unable to initialize touch handling.");
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h
index 5fe4b09c1e..1d3d1f4761 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.h
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.h
@@ -54,7 +54,7 @@ class QTouchDevice;
class QWindowsMouseHandler
{
- Q_DISABLE_COPY(QWindowsMouseHandler)
+ Q_DISABLE_COPY_MOVE(QWindowsMouseHandler)
public:
QWindowsMouseHandler();
@@ -79,7 +79,7 @@ public:
static Qt::MouseButtons queryMouseButtons();
QWindow *windowUnderMouse() const { return m_windowUnderMouse.data(); }
- void clearWindowUnderMouse() { m_windowUnderMouse = 0; }
+ void clearWindowUnderMouse() { m_windowUnderMouse = nullptr; }
void clearEvents();
private:
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
index 9003e94c56..d1d181d66e 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp
@@ -40,6 +40,7 @@
#include "qwindowsnativeinterface.h"
#include "qwindowsclipboard.h"
#include "qwindowswindow.h"
+#include "qwindowsscreen.h"
#include "qwindowscontext.h"
#include "qwindowscursor.h"
#include "qwindowsopenglcontext.h"
@@ -97,7 +98,7 @@ void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resourc
qWarning("%s: '%s' requested for null window or window without handle.", __FUNCTION__, resource.constData());
return nullptr;
}
- QWindowsWindow *bw = static_cast<QWindowsWindow *>(window->handle());
+ auto *bw = static_cast<QWindowsWindow *>(window->handle());
int type = resourceType(resource);
if (type == HandleType)
return bw->handle();
@@ -124,6 +125,21 @@ void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resourc
return nullptr;
}
+void *QWindowsNativeInterface::nativeResourceForScreen(const QByteArray &resource, QScreen *screen)
+{
+ if (!screen || !screen->handle()) {
+ qWarning("%s: '%s' requested for null screen or screen without handle.", __FUNCTION__, resource.constData());
+ return nullptr;
+ }
+ auto *bs = static_cast<QWindowsScreen *>(screen->handle());
+ int type = resourceType(resource);
+ if (type == HandleType)
+ return bs->handle();
+
+ qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
+ return nullptr;
+}
+
#ifndef QT_NO_CURSOR
void *QWindowsNativeInterface::nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor)
{
@@ -141,9 +157,9 @@ static const char customMarginPropertyC[] = "WindowsCustomMargins";
QVariant QWindowsNativeInterface::windowProperty(QPlatformWindow *window, const QString &name) const
{
- QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window);
+ auto *platformWindow = static_cast<QWindowsWindow *>(window);
if (name == QLatin1String(customMarginPropertyC))
- return qVariantFromValue(platformWindow->customMargins());
+ return QVariant::fromValue(platformWindow->customMargins());
return QVariant();
}
@@ -155,7 +171,7 @@ QVariant QWindowsNativeInterface::windowProperty(QPlatformWindow *window, const
void QWindowsNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value)
{
- QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window);
+ auto *platformWindow = static_cast<QWindowsWindow *>(window);
if (name == QLatin1String(customMarginPropertyC))
platformWindow->setCustomMargins(qvariant_cast<QMargins>(value));
}
@@ -190,7 +206,7 @@ void *QWindowsNativeInterface::nativeResourceForContext(const QByteArray &resour
return nullptr;
}
- QWindowsOpenGLContext *glcontext = static_cast<QWindowsOpenGLContext *>(context->handle());
+ auto *glcontext = static_cast<QWindowsOpenGLContext *>(context->handle());
switch (resourceType(resource)) {
case RenderingContextType: // Fall through.
case EglContextType:
diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.h b/src/plugins/platforms/windows/qwindowsnativeinterface.h
index e6f8aae8fb..ce395dc5a4 100644
--- a/src/plugins/platforms/windows/qwindowsnativeinterface.h
+++ b/src/plugins/platforms/windows/qwindowsnativeinterface.h
@@ -74,6 +74,7 @@ public:
void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override;
#endif
void *nativeResourceForWindow(const QByteArray &resource, QWindow *window) override;
+ void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override;
#ifndef QT_NO_CURSOR
void *nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override;
#endif
diff --git a/src/plugins/platforms/windows/qwindowsole.cpp b/src/plugins/platforms/windows/qwindowsole.cpp
index e9c3f2cbf6..f3450e2806 100644
--- a/src/plugins/platforms/windows/qwindowsole.cpp
+++ b/src/plugins/platforms/windows/qwindowsole.cpp
@@ -110,7 +110,7 @@ QWindowsOleDataObject::GetData(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium)
}
if (QWindowsContext::verbose > 1 && lcQpaMime().isDebugEnabled())
- qCDebug(lcQpaMime) <<__FUNCTION__ << *pformatetc << "returns" << hex << showbase << quint64(hr);
+ qCDebug(lcQpaMime) <<__FUNCTION__ << *pformatetc << "returns" << Qt::hex << Qt::showbase << quint64(hr);
return hr;
}
@@ -135,7 +135,7 @@ QWindowsOleDataObject::QueryGetData(LPFORMATETC pformatetc)
ResultFromScode(S_OK) : ResultFromScode(S_FALSE);
}
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << hex << int(hr);
+ qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << Qt::hex << int(hr);
return hr;
}
@@ -155,7 +155,7 @@ QWindowsOleDataObject::SetData(LPFORMATETC pFormatetc, STGMEDIUM *pMedium, BOOL
HRESULT hr = ResultFromScode(E_NOTIMPL);
if (pFormatetc->cfFormat == CF_PERFORMEDDROPEFFECT && pMedium->tymed == TYMED_HGLOBAL) {
- DWORD * val = (DWORD*)GlobalLock(pMedium->hGlobal);
+ auto * val = (DWORD*)GlobalLock(pMedium->hGlobal);
performedEffect = *val;
GlobalUnlock(pMedium->hGlobal);
if (fRelease)
@@ -163,7 +163,7 @@ QWindowsOleDataObject::SetData(LPFORMATETC pFormatetc, STGMEDIUM *pMedium, BOOL
hr = ResultFromScode(S_OK);
}
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << hex << int(hr);
+ qCDebug(lcQpaMime) << __FUNCTION__ << " returns 0x" << Qt::hex << int(hr);
return hr;
}
@@ -193,7 +193,7 @@ QWindowsOleDataObject::EnumFormatEtc(DWORD dwDirection, LPENUMFORMATETC FAR* ppe
fmtetcs.append(formatetc);
}
- QWindowsOleEnumFmtEtc *enumFmtEtc = new QWindowsOleEnumFmtEtc(fmtetcs);
+ auto *enumFmtEtc = new QWindowsOleEnumFmtEtc(fmtetcs);
*ppenumFormatEtc = enumFmtEtc;
if (enumFmtEtc->isNull()) {
delete enumFmtEtc;
@@ -237,7 +237,7 @@ QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<FORMATETC> &fmtetcs)
qCDebug(lcQpaMime) << __FUNCTION__ << fmtetcs;
m_lpfmtetcs.reserve(fmtetcs.count());
for (int idx = 0; idx < fmtetcs.count(); ++idx) {
- LPFORMATETC destetc = new FORMATETC();
+ auto destetc = new FORMATETC();
if (copyFormatEtc(destetc, &(fmtetcs.at(idx)))) {
m_lpfmtetcs.append(destetc);
} else {
@@ -255,7 +255,7 @@ QWindowsOleEnumFmtEtc::QWindowsOleEnumFmtEtc(const QVector<LPFORMATETC> &lpfmtet
m_lpfmtetcs.reserve(lpfmtetcs.count());
for (int idx = 0; idx < lpfmtetcs.count(); ++idx) {
LPFORMATETC srcetc = lpfmtetcs.at(idx);
- LPFORMATETC destetc = new FORMATETC();
+ auto destetc = new FORMATETC();
if (copyFormatEtc(destetc, srcetc)) {
m_lpfmtetcs.append(destetc);
} else {
@@ -357,7 +357,7 @@ QWindowsOleEnumFmtEtc::Clone(LPENUMFORMATETC FAR* newEnum)
if (newEnum == nullptr)
return ResultFromScode(E_INVALIDARG);
- QWindowsOleEnumFmtEtc *result = new QWindowsOleEnumFmtEtc(m_lpfmtetcs);
+ auto *result = new QWindowsOleEnumFmtEtc(m_lpfmtetcs);
result->m_nIndex = m_nIndex;
if (result->isNull()) {
diff --git a/src/plugins/platforms/windows/qwindowsopenglcontext.h b/src/plugins/platforms/windows/qwindowsopenglcontext.h
index cc6d93d35e..1416a7e575 100644
--- a/src/plugins/platforms/windows/qwindowsopenglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsopenglcontext.h
@@ -51,7 +51,7 @@ class QWindowsOpenGLContext;
class QWindowsStaticOpenGLContext
{
- Q_DISABLE_COPY(QWindowsStaticOpenGLContext)
+ Q_DISABLE_COPY_MOVE(QWindowsStaticOpenGLContext)
public:
static QWindowsStaticOpenGLContext *create();
virtual ~QWindowsStaticOpenGLContext() = default;
@@ -63,7 +63,7 @@ public:
// If the windowing system interface needs explicitly created window surfaces (like EGL),
// reimplement these.
- virtual void *createWindowSurface(void * /*nativeWindow*/, void * /*nativeConfig*/, int * /*err*/) { return 0; }
+ virtual void *createWindowSurface(void * /*nativeWindow*/, void * /*nativeConfig*/, int * /*err*/) { return nullptr; }
virtual void destroyWindowSurface(void * /*nativeSurface*/) { }
protected:
@@ -75,14 +75,14 @@ private:
class QWindowsOpenGLContext : public QPlatformOpenGLContext
{
- Q_DISABLE_COPY(QWindowsOpenGLContext)
+ Q_DISABLE_COPY_MOVE(QWindowsOpenGLContext)
public:
// Returns the native context handle (e.g. HGLRC for WGL, EGLContext for EGL).
virtual void *nativeContext() const = 0;
// These should be implemented only for some winsys interfaces, for example EGL.
// For others, like WGL, they are not relevant.
- virtual void *nativeDisplay() const { return 0; }
+ virtual void *nativeDisplay() const { return nullptr; }
virtual void *nativeConfig() const { return 0; }
protected:
diff --git a/src/plugins/platforms/windows/qwindowsopengltester.cpp b/src/plugins/platforms/windows/qwindowsopengltester.cpp
index 840a3a11c4..afc1991e2c 100644
--- a/src/plugins/platforms/windows/qwindowsopengltester.cpp
+++ b/src/plugins/platforms/windows/qwindowsopengltester.cpp
@@ -83,7 +83,7 @@ static GpuDescription adapterIdentifierToGpuDescription(const D3DADAPTER_IDENTIF
class QDirect3D9Handle
{
public:
- Q_DISABLE_COPY(QDirect3D9Handle)
+ Q_DISABLE_COPY_MOVE(QDirect3D9Handle)
QDirect3D9Handle();
~QDirect3D9Handle();
@@ -188,9 +188,9 @@ QDebug operator<<(QDebug d, const GpuDescription &gd)
{
QDebugStateSaver s(d);
d.nospace();
- d << hex << showbase << "GpuDescription(vendorId=" << gd.vendorId
+ d << Qt::hex << Qt::showbase << "GpuDescription(vendorId=" << gd.vendorId
<< ", deviceId=" << gd.deviceId << ", subSysId=" << gd.subSysId
- << dec << noshowbase << ", revision=" << gd.revision
+ << Qt::dec << Qt::noshowbase << ", revision=" << gd.revision
<< ", driver: " << gd.driverName
<< ", version=" << gd.driverVersion << ", " << gd.description
<< gd.gpuSuitableScreen << ')';
@@ -207,11 +207,11 @@ QString GpuDescription::toString() const
<< "\n Driver Name : " << driverName
<< "\n Driver Version : " << driverVersion.toString()
<< "\n Vendor ID : 0x" << qSetPadChar(QLatin1Char('0'))
- << uppercasedigits << hex << qSetFieldWidth(4) << vendorId
+ << Qt::uppercasedigits << Qt::hex << qSetFieldWidth(4) << vendorId
<< "\n Device ID : 0x" << qSetFieldWidth(4) << deviceId
<< "\n SubSys ID : 0x" << qSetFieldWidth(8) << subSysId
<< "\n Revision ID : 0x" << qSetFieldWidth(4) << revision
- << dec;
+ << Qt::dec;
if (!gpuSuitableScreen.isEmpty())
str << "\nGL windows forced to screen: " << gpuSuitableScreen;
return result;
@@ -457,7 +457,7 @@ bool QWindowsOpenGLTester::testDesktopGL()
// Check the version. If we got 1.x then it's all hopeless and we can stop right here.
typedef const GLubyte * (APIENTRY * GetString_t)(GLenum name);
- GetString_t GetString = reinterpret_cast<GetString_t>(
+ auto GetString = reinterpret_cast<GetString_t>(
reinterpret_cast<QFunctionPointer>(::GetProcAddress(lib, "glGetString")));
if (GetString) {
if (const char *versionStr = reinterpret_cast<const char *>(GetString(GL_VERSION))) {
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index fae01c9147..b477147da7 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -317,10 +317,10 @@ static QTouchDevice *createTouchDevice()
return nullptr;
const int tabletPc = GetSystemMetrics(SM_TABLETPC);
const int maxTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES);
- qCDebug(lcQpaEvents) << "Digitizers:" << hex << showbase << (digitizers & ~NID_READY)
- << "Ready:" << (digitizers & NID_READY) << dec << noshowbase
+ qCDebug(lcQpaEvents) << "Digitizers:" << Qt::hex << Qt::showbase << (digitizers & ~NID_READY)
+ << "Ready:" << (digitizers & NID_READY) << Qt::dec << Qt::noshowbase
<< "Tablet PC:" << tabletPc << "Max touch points:" << maxTouchPoints;
- QTouchDevice *result = new QTouchDevice;
+ auto *result = new QTouchDevice;
result->setType(digitizers & NID_INTEGRATED_TOUCH
? QTouchDevice::TouchScreen : QTouchDevice::TouchPad);
QTouchDevice::Capabilities capabilities = QTouchDevice::Position | QTouchDevice::Area | QTouchDevice::NormalizedPosition;
@@ -350,7 +350,7 @@ void QWindowsPointerHandler::handleCaptureRelease(QWindow *window,
QEvent::Type eventType,
Qt::MouseButtons mouseButtons)
{
- QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window->handle());
+ auto *platformWindow = static_cast<QWindowsWindow *>(window->handle());
// Qt expects the platform plugin to capture the mouse on any button press until release.
if (!platformWindow->hasMouseCapture() && eventType == QEvent::MouseButtonPress) {
@@ -386,7 +386,7 @@ void QWindowsPointerHandler::handleEnterLeave(QWindow *window,
QWindow *currentWindowUnderPointer,
QPoint globalPos)
{
- QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window->handle());
+ auto *platformWindow = static_cast<QWindowsWindow *>(window->handle());
const bool hasCapture = platformWindow->hasMouseCapture();
// No enter or leave events are sent as long as there is an autocapturing window.
@@ -470,26 +470,26 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
if (!screen)
return false;
- POINTER_TOUCH_INFO *touchInfo = static_cast<POINTER_TOUCH_INFO *>(vTouchInfo);
+ auto *touchInfo = static_cast<POINTER_TOUCH_INFO *>(vTouchInfo);
const QRect screenGeometry = screen->geometry();
QList<QWindowSystemInterface::TouchPoint> touchPoints;
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaEvents).noquote().nospace() << showbase
+ qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase
<< __FUNCTION__
- << " message=" << hex << msg.message
- << " count=" << dec << count;
+ << " message=" << Qt::hex << msg.message
+ << " count=" << Qt::dec << count;
- Qt::TouchPointStates allStates = 0;
+ Qt::TouchPointStates allStates = nullptr;
for (quint32 i = 0; i < count; ++i) {
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaEvents).noquote().nospace() << showbase
+ qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase
<< " TouchPoint id=" << touchInfo[i].pointerInfo.pointerId
<< " frame=" << touchInfo[i].pointerInfo.frameId
- << " flags=" << hex << touchInfo[i].pointerInfo.pointerFlags;
+ << " flags=" << Qt::hex << touchInfo[i].pointerInfo.pointerFlags;
QWindowSystemInterface::TouchPoint touchPoint;
const quint32 pointerId = touchInfo[i].pointerInfo.pointerId;
@@ -550,13 +550,13 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin
if (et & QtWindows::NonClientEventFlag)
return false; // Let DefWindowProc() handle Non Client messages.
- POINTER_PEN_INFO *penInfo = static_cast<POINTER_PEN_INFO *>(vPenInfo);
+ auto *penInfo = static_cast<POINTER_PEN_INFO *>(vPenInfo);
RECT pRect, dRect;
if (!QWindowsContext::user32dll.getPointerDeviceRects(penInfo->pointerInfo.sourceDevice, &pRect, &dRect))
return false;
- const qint64 sourceDevice = (qint64)penInfo->pointerInfo.sourceDevice;
+ const auto sourceDevice = (qint64)penInfo->pointerInfo.sourceDevice;
const QPoint globalPos = QPoint(penInfo->pointerInfo.ptPixelLocation.x, penInfo->pointerInfo.ptPixelLocation.y);
const QPoint localPos = QWindowsGeometryHint::mapFromGlobal(hwnd, globalPos);
const QPointF hiResGlobalPos = QPointF(dRect.left + qreal(penInfo->pointerInfo.ptHimetricLocation.x - pRect.left)
@@ -571,11 +571,11 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin
const int z = 0;
if (QWindowsContext::verbose > 1)
- qCDebug(lcQpaEvents).noquote().nospace() << showbase
+ qCDebug(lcQpaEvents).noquote().nospace() << Qt::showbase
<< __FUNCTION__ << " sourceDevice=" << sourceDevice
<< " globalPos=" << globalPos << " localPos=" << localPos << " hiResGlobalPos=" << hiResGlobalPos
- << " message=" << hex << msg.message
- << " flags=" << hex << penInfo->pointerInfo.pointerFlags;
+ << " message=" << Qt::hex << msg.message
+ << " flags=" << Qt::hex << penInfo->pointerInfo.pointerFlags;
const QTabletEvent::TabletDevice device = QTabletEvent::Stylus;
QTabletEvent::PointerType type;
@@ -698,7 +698,13 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window,
{
*result = 0;
- const QPoint eventPos(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
+ QPoint eventPos(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
+ if ((et & QtWindows::NonClientEventFlag) == 0 && QWindowsBaseWindow::isRtlLayout(hwnd)) {
+ RECT clientArea;
+ GetClientRect(hwnd, &clientArea);
+ eventPos.setX(clientArea.right - eventPos.x());
+ }
+
QPoint localPos;
QPoint globalPos;
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.h b/src/plugins/platforms/windows/qwindowspointerhandler.h
index b6b89cefed..8874db27e3 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.h
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.h
@@ -55,7 +55,7 @@ class QTouchDevice;
class QWindowsPointerHandler
{
- Q_DISABLE_COPY(QWindowsPointerHandler)
+ Q_DISABLE_COPY_MOVE(QWindowsPointerHandler)
public:
QWindowsPointerHandler() = default;
bool translatePointerEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result);
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index cecd06f5a4..df63adf558 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -73,7 +73,7 @@ static inline QDpi monitorDPI(HMONITOR hMonitor)
return {0, 0};
}
-typedef QList<QWindowsScreenData> WindowsScreenDataList;
+using WindowsScreenDataList = QList<QWindowsScreenData>;
static bool monitorData(HMONITOR hMonitor, QWindowsScreenData *data)
{
@@ -121,7 +121,7 @@ BOOL QT_WIN_CALLBACK monitorEnumCallback(HMONITOR hMonitor, HDC, LPRECT, LPARAM
{
QWindowsScreenData data;
if (monitorData(hMonitor, &data)) {
- WindowsScreenDataList *result = reinterpret_cast<WindowsScreenDataList *>(p);
+ auto *result = reinterpret_cast<WindowsScreenDataList *>(p);
// QWindowSystemInterface::handleScreenAdded() documentation specifies that first
// added screen will be the primary screen, so order accordingly.
// Note that the side effect of this policy is that there is no way to change primary
@@ -257,15 +257,6 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags)
return result;
}
-qreal QWindowsScreen::pixelDensity() const
-{
- // QTBUG-49195: Use logical DPI instead of physical DPI to calculate
- // the pixel density since it is reflects the Windows UI scaling.
- // High DPI auto scaling should be disabled when the user chooses
- // small fonts on a High DPI monitor, resulting in lower logical DPI.
- return qMax(1, qRound(logicalDpi().first / 96));
-}
-
/*!
\brief Determine siblings in a virtual desktop system.
@@ -329,6 +320,11 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)
}
}
+HMONITOR QWindowsScreen::handle() const
+{
+ return m_data.hMonitor;
+}
+
QRect QWindowsScreen::virtualGeometry(const QPlatformScreen *screen) // cf QScreen::virtualGeometry()
{
QRect result;
@@ -556,7 +552,7 @@ bool QWindowsScreenManager::handleScreenChanges()
if (existingIndex == 0)
primaryScreenChanged = true;
} else {
- QWindowsScreen *newScreen = new QWindowsScreen(newData);
+ auto *newScreen = new QWindowsScreen(newData);
m_screens.push_back(newScreen);
QWindowSystemInterface::handleScreenAdded(newScreen,
newData.flags & QWindowsScreenData::PrimaryScreen);
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h
index 8ad012512e..2fd56f53cf 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.h
+++ b/src/plugins/platforms/windows/qwindowsscreen.h
@@ -76,7 +76,7 @@ class QWindowsScreen : public QPlatformScreen
{
public:
#ifndef QT_NO_CURSOR
- typedef QScopedPointer<QPlatformCursor> CursorPtr;
+ using CursorPtr = QScopedPointer<QPlatformCursor>;
#endif
explicit QWindowsScreen(const QWindowsScreenData &data);
@@ -87,7 +87,7 @@ public:
QImage::Format format() const override { return m_data.format; }
QSizeF physicalSize() const override { return m_data.physicalSizeMM; }
QDpi logicalDpi() const override { return m_data.dpi; }
- qreal pixelDensity() const override;
+ QDpi logicalBaseDpi() const override { return QDpi(96, 96); };
qreal devicePixelRatio() const override { return 1.0; }
qreal refreshRate() const override { return m_data.refreshRateHz; }
QString name() const override { return m_data.name; }
@@ -104,6 +104,8 @@ public:
inline void handleChanges(const QWindowsScreenData &newData);
+ HMONITOR handle() const;
+
#ifndef QT_NO_CURSOR
QPlatformCursor *cursor() const override { return m_cursor.data(); }
const CursorPtr &cursorPtr() const { return m_cursor; }
@@ -125,7 +127,7 @@ private:
class QWindowsScreenManager
{
public:
- typedef QList<QWindowsScreen *> WindowsScreenList;
+ using WindowsScreenList = QList<QWindowsScreen *>;
QWindowsScreenManager();
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp
index 9504513a5e..83b052bb49 100644
--- a/src/plugins/platforms/windows/qwindowsservices.cpp
+++ b/src/plugins/platforms/windows/qwindowsservices.cpp
@@ -45,6 +45,8 @@
#include <QtCore/qdebug.h>
#include <QtCore/qdir.h>
+#include <QtCore/private/qwinregistry_p.h>
+
#include <shlobj.h>
#include <intshcut.h>
@@ -57,7 +59,7 @@ static inline bool shellExecute(const QUrl &url)
const QString nativeFilePath = url.isLocalFile() && !url.hasFragment() && !url.hasQuery()
? QDir::toNativeSeparators(url.toLocalFile())
: url.toString(QUrl::FullyEncoded);
- const quintptr result =
+ const auto result =
reinterpret_cast<quintptr>(ShellExecute(nullptr, nullptr,
reinterpret_cast<const wchar_t *>(nativeFilePath.utf16()),
nullptr, nullptr, SW_SHOWNORMAL));
@@ -78,35 +80,24 @@ static inline QString mailCommand()
const wchar_t mailUserKey[] = L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice";
- wchar_t command[MAX_PATH] = {0};
// Check if user has set preference, otherwise use default.
- HKEY handle;
- QString keyName;
- if (!RegOpenKeyEx(HKEY_CURRENT_USER, mailUserKey, 0, KEY_READ, &handle)) {
- DWORD bufferSize = BufferSize;
- if (!RegQueryValueEx(handle, L"Progid", nullptr, nullptr, reinterpret_cast<unsigned char*>(command), &bufferSize))
- keyName = QString::fromWCharArray(command);
- RegCloseKey(handle);
- }
+ QString keyName = QWinRegistryKey(HKEY_CURRENT_USER, mailUserKey)
+ .stringValue( L"Progid");
const QLatin1String mailto = keyName.isEmpty() ? QLatin1String("mailto") : QLatin1String();
keyName += mailto + QLatin1String("\\Shell\\Open\\Command");
if (debug)
qDebug() << __FUNCTION__ << "keyName=" << keyName;
- command[0] = 0;
- if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, reinterpret_cast<const wchar_t*>(keyName.utf16()), 0, KEY_READ, &handle)) {
- DWORD bufferSize = BufferSize;
- RegQueryValueEx(handle, L"", nullptr, nullptr, reinterpret_cast<unsigned char*>(command), &bufferSize);
- RegCloseKey(handle);
- }
+ const QString command = QWinRegistryKey(HKEY_CLASSES_ROOT, keyName).stringValue(L"");
// QTBUG-57816: As of Windows 10, if there is no mail client installed, an entry like
// "rundll32.exe .. url.dll,MailToProtocolHandler %l" is returned. Launching it
// silently fails or brings up a broken dialog after a long time, so exclude it and
// fall back to ShellExecute() which brings up the URL assocation dialog.
- if (!command[0] || wcsstr(command, L",MailToProtocolHandler") != nullptr)
+ if (command.isEmpty() || command.contains(QLatin1String(",MailToProtocolHandler")))
return QString();
wchar_t expandedCommand[MAX_PATH] = {0};
- return ExpandEnvironmentStrings(command, expandedCommand, MAX_PATH) ?
- QString::fromWCharArray(expandedCommand) : QString::fromWCharArray(command);
+ return ExpandEnvironmentStrings(reinterpret_cast<const wchar_t *>(command.utf16()),
+ expandedCommand, MAX_PATH)
+ ? QString::fromWCharArray(expandedCommand) : command;
}
static inline bool launchMail(const QUrl &url)
diff --git a/src/plugins/platforms/windows/qwindowssessionmanager.h b/src/plugins/platforms/windows/qwindowssessionmanager.h
index 4c4256f2b0..0769ed1fce 100644
--- a/src/plugins/platforms/windows/qwindowssessionmanager.h
+++ b/src/plugins/platforms/windows/qwindowssessionmanager.h
@@ -79,7 +79,7 @@ private:
bool m_blockUserInput = false;
bool m_canceled = false;
- Q_DISABLE_COPY(QWindowsSessionManager)
+ Q_DISABLE_COPY_MOVE(QWindowsSessionManager)
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
index c0f4e4d014..f2dba4d06b 100644
--- a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
+++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
@@ -117,7 +117,7 @@ struct QWindowsHwndSystemTrayIconEntry
QWindowsSystemTrayIcon *trayIcon;
};
-typedef QVector<QWindowsHwndSystemTrayIconEntry> HwndTrayIconEntries;
+using HwndTrayIconEntries = QVector<QWindowsHwndSystemTrayIconEntry>;
Q_GLOBAL_STATIC(HwndTrayIconEntries, hwndTrayIconEntries)
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 44b94d044d..cd5a78abb6 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -146,13 +146,13 @@ QDebug operator<<(QDebug d, const LOGCONTEXT &lc)
QDebugStateSaver saver(d);
d.nospace();
d << "LOGCONTEXT(\"" << QString::fromWCharArray(lc.lcName) << "\", options=0x"
- << hex << lc.lcOptions << dec;
+ << Qt::hex << lc.lcOptions << Qt::dec;
formatOptions(d, lc.lcOptions);
- d << ", status=0x" << hex << lc.lcStatus << ", device=0x" << lc.lcDevice
- << dec << ", PktRate=" << lc.lcPktRate
+ d << ", status=0x" << Qt::hex << lc.lcStatus << ", device=0x" << lc.lcDevice
+ << Qt::dec << ", PktRate=" << lc.lcPktRate
<< ", PktData=" << lc.lcPktData << ", PktMode=" << lc.lcPktMode
- << ", MoveMask=0x" << hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask
- << ", BtnUpMask=0x" << lc.lcBtnUpMask << dec << ", SysMode=" << lc.lcSysMode
+ << ", MoveMask=0x" << Qt::hex << lc.lcMoveMask << ", BtnDnMask=0x" << lc.lcBtnDnMask
+ << ", BtnUpMask=0x" << lc.lcBtnUpMask << Qt::dec << ", SysMode=" << lc.lcSysMode
<< ", InOrg=(" << lc.lcInOrgX << ", " << lc.lcInOrgY << ", " << lc.lcInOrgZ
<< "), InExt=(" << lc.lcInExtX << ", " << lc.lcInExtY << ", " << lc.lcInExtZ
<< ") OutOrg=(" << lc.lcOutOrgX << ", " << lc.lcOutOrgY << ", "
@@ -305,7 +305,7 @@ QString QWindowsTabletSupport::description() const
<< '.' << (specificationVersion & 0xFF) << " implementation: v"
<< (implementationVersion >> 8) << '.' << (implementationVersion & 0xFF)
<< ' ' << devices << " device(s), " << cursors << " cursor(s), "
- << extensions << " extensions" << ", options: 0x" << hex << opts << dec;
+ << extensions << " extensions" << ", options: 0x" << Qt::hex << opts << Qt::dec;
formatOptions(str, opts);
if (m_tiltSupport)
str << " tilt";
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.h b/src/plugins/platforms/windows/qwindowstabletsupport.h
index 8f97982308..6bcf3357a5 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.h
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.h
@@ -110,7 +110,7 @@ QDebug operator<<(QDebug d, const QWindowsTabletDeviceData &t);
class QWindowsTabletSupport
{
- Q_DISABLE_COPY(QWindowsTabletSupport)
+ Q_DISABLE_COPY_MOVE(QWindowsTabletSupport)
explicit QWindowsTabletSupport(HWND window, HCTX context);
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index a6b9781252..40f9652cbd 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -162,25 +162,19 @@ public:
m_init = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
QMutexLocker readyLocker(&m_readyMutex);
- while (!m_cancelled.load()) {
- if (!m_params && !m_cancelled.load()
+ while (!m_cancelled.loadRelaxed()) {
+ if (!m_params && !m_cancelled.loadRelaxed()
&& !m_readyCondition.wait(&m_readyMutex, 1000))
continue;
if (m_params) {
const QString fileName = m_params->fileName;
SHFILEINFO info;
-#ifndef Q_OS_WINCE
- const UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
-#endif
const bool result = SHGetFileInfo(reinterpret_cast<const wchar_t *>(fileName.utf16()),
m_params->attributes, &info, sizeof(SHFILEINFO),
m_params->flags);
-#ifndef Q_OS_WINCE
- SetErrorMode(oldErrorMode);
-#endif
m_doneMutex.lock();
- if (!m_cancelled.load()) {
+ if (!m_cancelled.loadRelaxed()) {
*m_params->result = result;
memcpy(m_params->info, &info, sizeof(SHFILEINFO));
}
@@ -210,7 +204,7 @@ public:
void cancel()
{
QMutexLocker doneLocker(&m_doneMutex);
- m_cancelled.store(1);
+ m_cancelled.storeRelaxed(1);
m_readyCondition.wakeAll();
}
@@ -472,6 +466,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
result = int(scrollLines);
return QVariant(result);
}
+ case MouseDoubleClickDistance:
+ return GetSystemMetrics(SM_CXDOUBLECLK);
default:
break;
}
@@ -589,7 +585,7 @@ Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon);
static QPixmap loadIconFromShell32(int resourceId, QSizeF size)
{
if (const HMODULE hmod = QSystemLibrary::load(L"shell32")) {
- HICON iconHandle =
+ auto iconHandle =
static_cast<HICON>(LoadImage(hmod, MAKEINTRESOURCE(resourceId),
IMAGE_ICON, int(size.width()), int(size.height()), 0));
if (iconHandle) {
diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h
index 28c69e4ec1..07120230ce 100644
--- a/src/plugins/platforms/windows/qwindowstheme.h
+++ b/src/plugins/platforms/windows/qwindowstheme.h
@@ -51,7 +51,7 @@ class QWindow;
class QWindowsTheme : public QPlatformTheme
{
- Q_DISABLE_COPY(QWindowsTheme)
+ Q_DISABLE_COPY_MOVE(QWindowsTheme)
public:
QWindowsTheme();
~QWindowsTheme() override;
@@ -71,7 +71,7 @@ public:
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
- QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = 0) const override;
+ QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = nullptr) const override;
void windowsThemeChanged(QWindow *window);
void displayChanged() { refreshIconPixmapSizes(); }
diff --git a/src/plugins/platforms/windows/qwindowsthreadpoolrunner.h b/src/plugins/platforms/windows/qwindowsthreadpoolrunner.h
index 731e4b5432..ffe2e62069 100644
--- a/src/plugins/platforms/windows/qwindowsthreadpoolrunner.h
+++ b/src/plugins/platforms/windows/qwindowsthreadpoolrunner.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
*/
class QWindowsThreadPoolRunner
{
- Q_DISABLE_COPY(QWindowsThreadPoolRunner)
+ Q_DISABLE_COPY_MOVE(QWindowsThreadPoolRunner)
#if QT_CONFIG(thread)
template <class RunnableFunction> // nested class implementing QRunnable to execute a function.
diff --git a/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp b/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp
index 7a01483abd..812ea8193a 100644
--- a/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp
+++ b/src/plugins/platforms/windows/qwindowsvulkaninstance.cpp
@@ -81,7 +81,7 @@ bool QWindowsVulkanInstance::supportsPresent(VkPhysicalDevice physicalDevice,
VkSurfaceKHR QWindowsVulkanInstance::createSurface(HWND win)
{
- VkSurfaceKHR surface = 0;
+ VkSurfaceKHR surface = VK_NULL_HANDLE;
if (!m_createSurface) {
m_createSurface = reinterpret_cast<PFN_vkCreateWin32SurfaceKHR>(
diff --git a/src/plugins/platforms/windows/qwindowsvulkaninstance.h b/src/plugins/platforms/windows/qwindowsvulkaninstance.h
index 3292137c39..cc7ef476d4 100644
--- a/src/plugins/platforms/windows/qwindowsvulkaninstance.h
+++ b/src/plugins/platforms/windows/qwindowsvulkaninstance.h
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
class QWindowsVulkanInstance : public QBasicPlatformVulkanInstance
{
- Q_DISABLE_COPY(QWindowsVulkanInstance)
+ Q_DISABLE_COPY_MOVE(QWindowsVulkanInstance)
public:
QWindowsVulkanInstance(QVulkanInstance *instance);
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 1d8b252029..ea91e3bb2d 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -86,7 +86,7 @@
QT_BEGIN_NAMESPACE
-typedef QSharedPointer<QWindowCreationContext> QWindowCreationContextPtr;
+using QWindowCreationContextPtr = QSharedPointer<QWindowCreationContext>;
enum {
defaultWindowWidth = 160,
@@ -134,6 +134,10 @@ static QByteArray debugWinExStyle(DWORD exStyle)
rc += " WS_EX_LAYERED";
if (exStyle & WS_EX_DLGMODALFRAME)
rc += " WS_EX_DLGMODALFRAME";
+ if (exStyle & WS_EX_LAYOUTRTL)
+ rc += " WS_EX_LAYOUTRTL";
+ if (exStyle & WS_EX_NOINHERITLAYOUT)
+ rc += " WS_EX_NOINHERITLAYOUT";
return rc;
}
@@ -239,7 +243,7 @@ QDebug operator<<(QDebug d, const WINDOWPLACEMENT &wp)
QDebugStateSaver saver(d);
d.nospace();
d.noquote();
- d << "WINDOWPLACEMENT(flags=0x" << hex << wp.flags << dec << ", showCmd="
+ d << "WINDOWPLACEMENT(flags=0x" << Qt::hex << wp.flags << Qt::dec << ", showCmd="
<< wp.showCmd << ", ptMinPosition=" << wp.ptMinPosition << ", ptMaxPosition=" << wp.ptMaxPosition
<< ", rcNormalPosition=" << wp.rcNormalPosition;
return d;
@@ -249,7 +253,7 @@ QDebug operator<<(QDebug d, const GUID &guid)
{
QDebugStateSaver saver(d);
d.nospace();
- d << '{' << hex << uppercasedigits << qSetPadChar(QLatin1Char('0'))
+ d << '{' << Qt::hex << Qt::uppercasedigits << qSetPadChar(QLatin1Char('0'))
<< qSetFieldWidth(8) << guid.Data1
<< qSetFieldWidth(0) << '-' << qSetFieldWidth(4)
<< guid.Data2 << qSetFieldWidth(0) << '-' << qSetFieldWidth(4)
@@ -307,7 +311,7 @@ static inline QRect frameGeometry(HWND hwnd, bool topLevel)
const int width = rect.right - rect.left;
const int height = rect.bottom - rect.top;
POINT leftTop = { rect.left, rect.top };
- ScreenToClient(parent, &leftTop);
+ screenToClient(parent, &leftTop);
rect.left = leftTop.x;
rect.top = leftTop.y;
rect.right = leftTop.x + width;
@@ -490,7 +494,7 @@ static QMargins invisibleMargins(QPoint screenPoint)
struct WindowCreationData
{
- typedef QWindowsWindowData WindowData;
+ using WindowData = QWindowsWindowData;
enum Flags { ForceChild = 0x1, ForceTopLevel = 0x2 };
void fromWindow(const QWindow *w, const Qt::WindowFlags flags, unsigned creationFlags = 0);
@@ -667,6 +671,17 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
if ((flags & Qt::MSWindowsFixedSizeDialogHint))
dialog = true;
+ // This causes the title bar to drawn RTL and the close button
+ // to be left. Note that this causes:
+ // - All DCs created on the Window to have RTL layout (see SetLayout)
+ // - ClientToScreen() and ScreenToClient() to work in reverse as well.
+ // - Mouse event coordinates to be mirrored.
+ // - Positioning of child Windows.
+ if (QGuiApplication::layoutDirection() == Qt::RightToLeft
+ && (QWindowsIntegration::instance()->options() & QWindowsIntegration::RtlEnabled) != 0) {
+ exStyle |= WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT;
+ }
+
// Parent: Use transient parent for top levels.
if (popup) {
flags |= Qt::WindowStaysOnTopHint; // a popup stays on top, no parent.
@@ -744,17 +759,22 @@ QWindowsWindowData
const QString windowClassName = QWindowsContext::instance()->registerWindowClass(w);
- const QRect rect = QPlatformWindow::initialGeometry(w, data.geometry, defaultWindowWidth, defaultWindowHeight);
+ const QScreen *screen{};
+ const QRect rect = QPlatformWindow::initialGeometry(w, data.geometry,
+ defaultWindowWidth, defaultWindowHeight,
+ &screen);
if (title.isEmpty() && (result.flags & Qt::WindowTitleHint))
title = topLevel ? qAppName() : w->objectName();
- const wchar_t *titleUtf16 = reinterpret_cast<const wchar_t *>(title.utf16());
- const wchar_t *classNameUtf16 = reinterpret_cast<const wchar_t *>(windowClassName.utf16());
+ const auto *titleUtf16 = reinterpret_cast<const wchar_t *>(title.utf16());
+ const auto *classNameUtf16 = reinterpret_cast<const wchar_t *>(windowClassName.utf16());
// Capture events before CreateWindowEx() returns. The context is cleared in
// the QWindowsWindow constructor.
- const QWindowCreationContextPtr context(new QWindowCreationContext(w, data.geometry, rect, data.customMargins, style, exStyle));
+ const QWindowCreationContextPtr context(new QWindowCreationContext(w, screen, data.geometry,
+ rect, data.customMargins,
+ style, exStyle));
QWindowsContext::instance()->setWindowCreationContext(context);
const bool hasFrame = (style & (WS_DLGFRAME | WS_THICKFRAME));
@@ -772,6 +792,16 @@ QWindowsWindowData
QPoint pos = calcPosition(w, context, invMargins);
+ // Mirror the position when creating on a parent in RTL mode, ditto for the obtained geometry.
+ int mirrorParentWidth = 0;
+ if (!w->isTopLevel() && QWindowsBaseWindow::isRtlLayout(parentHandle)) {
+ RECT rect;
+ GetClientRect(parentHandle, &rect);
+ mirrorParentWidth = rect.right;
+ }
+ if (mirrorParentWidth != 0 && pos.x() != CW_USEDEFAULT && context->frameWidth != CW_USEDEFAULT)
+ pos.setX(mirrorParentWidth - context->frameWidth - pos.x());
+
result.hwnd = CreateWindowEx(exStyle, classNameUtf16, titleUtf16,
style,
pos.x(), pos.y(),
@@ -779,14 +809,21 @@ QWindowsWindowData
parentHandle, nullptr, appinst, nullptr);
qCDebug(lcQpaWindows).nospace()
<< "CreateWindowEx: returns " << w << ' ' << result.hwnd << " obtained geometry: "
- << context->obtainedGeometry << ' ' << context->margins;
+ << context->obtainedPos << context->obtainedSize << ' ' << context->margins;
if (!result.hwnd) {
qErrnoWarning("%s: CreateWindowEx failed", __FUNCTION__);
return result;
}
- result.geometry = context->obtainedGeometry;
+ if (mirrorParentWidth != 0) {
+ context->obtainedPos.setX(mirrorParentWidth - context->obtainedSize.width()
+ - context->obtainedPos.x());
+ }
+
+ QRect obtainedGeometry(context->obtainedPos, context->obtainedSize);
+
+ result.geometry = obtainedGeometry;
result.fullFrameMargins = context->margins;
result.embedded = embedded;
result.hasFrame = hasFrame;
@@ -847,10 +884,10 @@ void WindowCreationData::initialize(const QWindow *w, HWND hwnd, bool frameChang
// Scaling helpers for size constraints.
-static QSize toNativeSizeConstrained(QSize dip, const QWindow *w)
+static QSize toNativeSizeConstrained(QSize dip, const QScreen *s)
{
if (QHighDpiScaling::isActive()) {
- const qreal factor = QHighDpiScaling::factor(w);
+ const qreal factor = QHighDpiScaling::factor(s);
if (!qFuzzyCompare(factor, qreal(1))) {
if (dip.width() > 0 && dip.width() < QWINDOWSIZE_MAX)
dip.setWidth(qRound(qreal(dip.width()) * factor));
@@ -905,7 +942,7 @@ QMargins QWindowsGeometryHint::frame(DWORD style, DWORD exStyle, qreal dpi)
const QMargins result(qAbs(rect.left), qAbs(rect.top),
qAbs(rect.right), qAbs(rect.bottom));
qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << " style="
- << showbase << hex << style << " exStyle=" << exStyle << dec << noshowbase
+ << Qt::showbase << Qt::hex << style << " exStyle=" << exStyle << Qt::dec << Qt::noshowbase
<< " dpi=" << dpi
<< ' ' << rect << ' ' << result;
return result;
@@ -950,7 +987,7 @@ bool QWindowsGeometryHint::handleCalculateSize(const QMargins &customMargins, co
if (!msg.wParam || customMargins.isNull())
return false;
*result = DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
- NCCALCSIZE_PARAMS *ncp = reinterpret_cast<NCCALCSIZE_PARAMS *>(msg.lParam);
+ auto *ncp = reinterpret_cast<NCCALCSIZE_PARAMS *>(msg.lParam);
const RECT oldClientArea = ncp->rgrc[0];
ncp->rgrc[0].left += customMargins.left();
ncp->rgrc[0].top += customMargins.top();
@@ -963,11 +1000,12 @@ bool QWindowsGeometryHint::handleCalculateSize(const QMargins &customMargins, co
return true;
}
-void QWindowsGeometryHint::frameSizeConstraints(const QWindow *w, const QMargins &margins,
+void QWindowsGeometryHint::frameSizeConstraints(const QWindow *w, const QScreen *screen,
+ const QMargins &margins,
QSize *minimumSize, QSize *maximumSize)
{
- *minimumSize = toNativeSizeConstrained(w->minimumSize(), w);
- *maximumSize = toNativeSizeConstrained(w->maximumSize(), w);
+ *minimumSize = toNativeSizeConstrained(w->minimumSize(), screen);
+ *maximumSize = toNativeSizeConstrained(w->maximumSize(), screen);
const int maximumWidth = qMax(maximumSize->width(), minimumSize->width());
const int maximumHeight = qMax(maximumSize->height(), minimumSize->height());
@@ -985,12 +1023,13 @@ void QWindowsGeometryHint::frameSizeConstraints(const QWindow *w, const QMargins
}
void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w,
+ const QScreen *screen,
const QMargins &margins,
MINMAXINFO *mmi)
{
QSize minimumSize;
QSize maximumSize;
- frameSizeConstraints(w, margins, &minimumSize, &maximumSize);
+ frameSizeConstraints(w, screen, margins, &minimumSize, &maximumSize);
qCDebug(lcQpaWindows).nospace() << '>' << __FUNCTION__ << '<' << " min="
<< minimumSize.width() << ',' << minimumSize.height()
<< " max=" << maximumSize.width() << ',' << maximumSize.height()
@@ -1009,6 +1048,13 @@ void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w,
qCDebug(lcQpaWindows).nospace() << '<' << __FUNCTION__ << " out " << *mmi;
}
+void QWindowsGeometryHint::applyToMinMaxInfo(const QWindow *w,
+ const QMargins &margins,
+ MINMAXINFO *mmi)
+{
+ applyToMinMaxInfo(w, w->screen(), margins, mmi);
+}
+
bool QWindowsGeometryHint::positionIncludesFrame(const QWindow *w)
{
return qt_window_private(const_cast<QWindow *>(w))->positionPolicy
@@ -1033,6 +1079,11 @@ bool QWindowsGeometryHint::positionIncludesFrame(const QWindow *w)
\ingroup qt-lighthouse-win
*/
+bool QWindowsBaseWindow::isRtlLayout(HWND hwnd)
+{
+ return (GetWindowLongPtrW(hwnd, GWL_EXSTYLE) & WS_EX_LAYOUTRTL) != 0;
+}
+
QWindowsBaseWindow *QWindowsBaseWindow::baseWindowOf(const QWindow *w)
{
if (w) {
@@ -1189,13 +1240,16 @@ void QWindowsForeignWindow::setVisible(bool visible)
\ingroup qt-lighthouse-win
*/
-QWindowCreationContext::QWindowCreationContext(const QWindow *w,
+QWindowCreationContext::QWindowCreationContext(const QWindow *w, const QScreen *s,
const QRect &geometryIn, const QRect &geometry,
const QMargins &cm,
DWORD style, DWORD exStyle) :
window(w),
+ screen(s),
requestedGeometryIn(geometryIn),
- requestedGeometry(geometry), obtainedGeometry(geometry),
+ requestedGeometry(geometry),
+ obtainedPos(geometryIn.topLeft()),
+ obtainedSize(geometryIn.size()),
margins(QWindowsGeometryHint::frame(w, geometry, style, exStyle)),
customMargins(cm)
{
@@ -1231,7 +1285,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
void QWindowCreationContext::applyToMinMaxInfo(MINMAXINFO *mmi) const
{
- QWindowsGeometryHint::applyToMinMaxInfo(window, margins + customMargins, mmi);
+ QWindowsGeometryHint::applyToMinMaxInfo(window, screen, margins + customMargins, mmi);
}
/*!
@@ -1266,7 +1320,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
m_cursor(new CursorHandle),
m_format(aWindow->requestedFormat())
#if QT_CONFIG(vulkan)
- , m_vkSurface(0)
+ , m_vkSurface(VK_NULL_HANDLE)
#endif
{
QWindowsContext::instance()->addWindow(m_data.hwnd, this);
@@ -1323,11 +1377,12 @@ void QWindowsWindow::initialize()
// will send the message) and screen change signals of QWindow.
if (w->type() != Qt::Desktop) {
const Qt::WindowState state = w->windowState();
+ const QRect obtainedGeometry(creationContext->obtainedPos, creationContext->obtainedSize);
if (state != Qt::WindowMaximized && state != Qt::WindowFullScreen
- && creationContext->requestedGeometryIn != creationContext->obtainedGeometry) {
- QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(w, creationContext->obtainedGeometry);
+ && creationContext->requestedGeometryIn != obtainedGeometry) {
+ QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(w, obtainedGeometry);
}
- QPlatformScreen *obtainedScreen = screenForGeometry(creationContext->obtainedGeometry);
+ QPlatformScreen *obtainedScreen = screenForGeometry(obtainedGeometry);
if (obtainedScreen && screen() != obtainedScreen)
QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::SynchronousDelivery>(w, obtainedScreen->screen());
}
@@ -1366,14 +1421,14 @@ void QWindowsWindow::destroyWindow()
QVulkanInstance *inst = window()->vulkanInstance();
if (inst)
static_cast<QWindowsVulkanInstance *>(inst->handle())->destroySurface(m_vkSurface);
- m_vkSurface = 0;
+ m_vkSurface = VK_NULL_HANDLE;
}
#endif
#ifndef QT_NO_OPENGL
if (m_surface) {
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
staticOpenGLContext->destroyWindowSurface(m_surface);
- m_surface = 0;
+ m_surface = nullptr;
}
#endif
DestroyWindow(m_data.hwnd);
@@ -1462,7 +1517,7 @@ QWindow *QWindowsWindow::topLevelOf(QWindow *w)
w = parent;
if (const QPlatformWindow *handle = w->handle()) {
- const QWindowsWindow *ww = static_cast<const QWindowsWindow *>(handle);
+ const auto *ww = static_cast<const QWindowsWindow *>(handle);
if (ww->isEmbedded()) {
HWND parentHWND = GetAncestor(ww->handle(), GA_PARENT);
const HWND desktopHwnd = GetDesktopWindow();
@@ -1536,7 +1591,7 @@ bool QWindowsWindow::isActive() const
bool QWindowsWindow::isAncestorOf(const QPlatformWindow *child) const
{
- const QWindowsWindow *childWindow = static_cast<const QWindowsWindow *>(child);
+ const auto *childWindow = static_cast<const QWindowsWindow *>(child);
return IsChild(m_data.hwnd, childWindow->handle());
}
@@ -1685,7 +1740,7 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent)
HWND oldParentHWND = parentHwnd();
HWND newParentHWND = nullptr;
if (parent) {
- const QWindowsWindow *parentW = static_cast<const QWindowsWindow *>(parent);
+ const auto *parentW = static_cast<const QWindowsWindow *>(parent);
newParentHWND = parentW->handle();
}
@@ -1946,7 +2001,16 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
windowPlacement.showCmd = windowPlacement.showCmd == SW_SHOWMINIMIZED ? SW_SHOWMINIMIZED : SW_HIDE;
result = SetWindowPlacement(hwnd, &windowPlacement);
} else {
- result = MoveWindow(hwnd, frameGeometry.x(), frameGeometry.y(),
+ int x = frameGeometry.x();
+ if (!window()->isTopLevel()) {
+ const HWND parentHandle = GetParent(hwnd);
+ if (isRtlLayout(parentHandle)) {
+ RECT rect;
+ GetClientRect(parentHandle, &rect);
+ x = rect.right - frameGeometry.width() - x;
+ }
+ }
+ result = MoveWindow(hwnd, x, frameGeometry.y(),
frameGeometry.width(), frameGeometry.height(), true);
}
qCDebug(lcQpaWindows) << '<' << __FUNCTION__ << window()
@@ -1962,8 +2026,11 @@ void QWindowsBaseWindow::setGeometry_sys(const QRect &rect) const
HDC QWindowsWindow::getDC()
{
- if (!m_hdc)
+ if (!m_hdc) {
m_hdc = GetDC(handle());
+ if (QGuiApplication::layoutDirection() == Qt::RightToLeft)
+ SetLayout(m_hdc, 0); // Clear RTL layout
+ }
return m_hdc;
}
@@ -2318,7 +2385,7 @@ void QWindowsWindow::propagateSizeHints()
bool QWindowsWindow::handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &margins)
{
- WINDOWPOS *windowPos = reinterpret_cast<WINDOWPOS *>(message->lParam);
+ auto *windowPos = reinterpret_cast<WINDOWPOS *>(message->lParam);
if ((windowPos->flags & SWP_NOZORDER) == 0) {
if (QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(qWindow)) {
QWindow *parentWindow = qWindow->parent();
@@ -2900,14 +2967,14 @@ void QWindowsWindow::invalidateSurface()
QVulkanInstance *inst = window()->vulkanInstance();
if (inst)
static_cast<QWindowsVulkanInstance *>(inst->handle())->destroySurface(m_vkSurface);
- m_vkSurface = 0;
+ m_vkSurface = VK_NULL_HANDLE;
}
#endif
#ifndef QT_NO_OPENGL
if (m_surface) {
if (QWindowsStaticOpenGLContext *staticOpenGLContext = QWindowsIntegration::staticOpenGLContext())
staticOpenGLContext->destroyWindowSurface(m_surface);
- m_surface = 0;
+ m_surface = nullptr;
}
#endif // QT_NO_OPENGL
}
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 958564aa86..1f8800272b 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -66,9 +66,12 @@ struct QWindowsGeometryHint
static QMargins frame(const QWindow *w, const QRect &geometry,
DWORD style, DWORD exStyle);
static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result);
+ static void applyToMinMaxInfo(const QWindow *w, const QScreen *screen,
+ const QMargins &margins, MINMAXINFO *mmi);
static void applyToMinMaxInfo(const QWindow *w, const QMargins &margins,
MINMAXINFO *mmi);
- static void frameSizeConstraints(const QWindow *w, const QMargins &margins,
+ static void frameSizeConstraints(const QWindow *w, const QScreen *screen,
+ const QMargins &margins,
QSize *minimumSize, QSize *maximumSize);
static inline QPoint mapToGlobal(HWND hwnd, const QPoint &);
static inline QPoint mapToGlobal(const QWindow *w, const QPoint &);
@@ -80,16 +83,20 @@ struct QWindowsGeometryHint
struct QWindowCreationContext
{
- explicit QWindowCreationContext(const QWindow *w,
+ explicit QWindowCreationContext(const QWindow *w, const QScreen *s,
const QRect &geometryIn, const QRect &geometry,
const QMargins &customMargins,
DWORD style, DWORD exStyle);
void applyToMinMaxInfo(MINMAXINFO *mmi) const;
const QWindow *window;
+ // The screen to use to scale size constraints, etc. Might differ from the
+ // screen of the window after QPlatformWindow::initialGeometry() (QTBUG-77307).
+ const QScreen *screen;
QRect requestedGeometryIn; // QWindow scaled
QRect requestedGeometry; // after QPlatformWindow::initialGeometry()
- QRect obtainedGeometry;
+ QPoint obtainedPos;
+ QSize obtainedSize;
QMargins margins;
QMargins customMargins; // User-defined, additional frame for WM_NCCALCSIZE
int frameX = CW_USEDEFAULT; // Passed on to CreateWindowEx(), including frame.
@@ -105,7 +112,7 @@ struct QWindowsWindowData
QRect geometry;
QMargins fullFrameMargins; // Do not use directly for windows, see FrameDirty.
QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
- HWND hwnd = 0;
+ HWND hwnd = nullptr;
bool embedded = false;
bool hasFrame = false;
@@ -116,7 +123,7 @@ struct QWindowsWindowData
class QWindowsBaseWindow : public QPlatformWindow
{
- Q_DISABLE_COPY(QWindowsBaseWindow)
+ Q_DISABLE_COPY_MOVE(QWindowsBaseWindow)
public:
explicit QWindowsBaseWindow(QWindow *window) : QPlatformWindow(window) {}
@@ -134,6 +141,7 @@ public:
unsigned style() const { return GetWindowLongPtr(handle(), GWL_STYLE); }
unsigned exStyle() const { return GetWindowLongPtr(handle(), GWL_EXSTYLE); }
+ static bool isRtlLayout(HWND hwnd);
static QWindowsBaseWindow *baseWindowOf(const QWindow *w);
static HWND handleOf(const QWindow *w);
@@ -355,7 +363,7 @@ private:
inline void setParent_sys(const QPlatformWindow *parent);
inline void updateTransientParent() const;
void destroyWindow();
- inline bool isDropSiteEnabled() const { return m_dropTarget != 0; }
+ inline bool isDropSiteEnabled() const { return m_dropTarget != nullptr; }
void setDropSiteEnabled(bool enabled);
void updateDropSite(bool topLevel);
void handleGeometryChange();
@@ -366,7 +374,7 @@ private:
mutable QWindowsWindowData m_data;
QPointer<QWindowsMenuBar> m_menuBar;
mutable unsigned m_flags = WithinCreate;
- HDC m_hdc = 0;
+ HDC m_hdc = nullptr;
Qt::WindowStates m_windowState = Qt::WindowNoState;
qreal m_opacity = 1;
#ifndef QT_NO_CURSOR
@@ -376,15 +384,15 @@ private:
unsigned m_savedStyle = 0;
QRect m_savedFrameGeometry;
const QSurfaceFormat m_format;
- HICON m_iconSmall = 0;
- HICON m_iconBig = 0;
+ HICON m_iconSmall = nullptr;
+ HICON m_iconBig = nullptr;
void *m_surface = nullptr;
static bool m_screenForGLInitialized;
#if QT_CONFIG(vulkan)
// note: intentionally not using void * in order to avoid breaking x86
- VkSurfaceKHR m_vkSurface = 0;
+ VkSurfaceKHR m_vkSurface = VK_NULL_HANDLE;
#endif
static bool m_borderInFullScreenDefault;
};
@@ -399,18 +407,38 @@ QDebug operator<<(QDebug d, const WINDOWPOS &);
QDebug operator<<(QDebug d, const GUID &guid);
#endif // !QT_NO_DEBUG_STREAM
+static inline void clientToScreen(HWND hwnd, POINT *wP)
+{
+ if (QWindowsBaseWindow::isRtlLayout(hwnd)) {
+ RECT clientArea;
+ GetClientRect(hwnd, &clientArea);
+ wP->x = clientArea.right - wP->x;
+ }
+ ClientToScreen(hwnd, wP);
+}
+
+static inline void screenToClient(HWND hwnd, POINT *wP)
+{
+ ScreenToClient(hwnd, wP);
+ if (QWindowsBaseWindow::isRtlLayout(hwnd)) {
+ RECT clientArea;
+ GetClientRect(hwnd, &clientArea);
+ wP->x = clientArea.right - wP->x;
+ }
+}
+
// ---------- QWindowsGeometryHint inline functions.
QPoint QWindowsGeometryHint::mapToGlobal(HWND hwnd, const QPoint &qp)
{
POINT p = { qp.x(), qp.y() };
- ClientToScreen(hwnd, &p);
+ clientToScreen(hwnd, &p);
return QPoint(p.x, p.y);
}
QPoint QWindowsGeometryHint::mapFromGlobal(const HWND hwnd, const QPoint &qp)
{
POINT p = { qp.x(), qp.y() };
- ScreenToClient(hwnd, &p);
+ screenToClient(hwnd, &p);
return QPoint(p.x, p.y);
}
@@ -449,11 +477,11 @@ inline void QWindowsWindow::destroyIcon()
{
if (m_iconBig) {
DestroyIcon(m_iconBig);
- m_iconBig = 0;
+ m_iconBig = nullptr;
}
if (m_iconSmall) {
DestroyIcon(m_iconSmall);
- m_iconSmall = 0;
+ m_iconSmall = nullptr;
}
}
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h
index 9caa7d6898..a20df28e3f 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiabaseprovider.h
@@ -57,7 +57,7 @@ class QAccessibleInterface;
class QWindowsUiaBaseProvider : public QObject
{
Q_OBJECT
- Q_DISABLE_COPY(QWindowsUiaBaseProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaBaseProvider)
public:
explicit QWindowsUiaBaseProvider(QAccessible::Id id);
virtual ~QWindowsUiaBaseProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h
index 3d17056d38..3244122038 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiagriditemprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaGridItemProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<IGridItemProvider>
{
- Q_DISABLE_COPY(QWindowsUiaGridItemProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaGridItemProvider)
public:
explicit QWindowsUiaGridItemProvider(QAccessible::Id id);
virtual ~QWindowsUiaGridItemProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h
index b96fc1a93c..0e5f81108e 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiagridprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaGridProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<IGridProvider>
{
- Q_DISABLE_COPY(QWindowsUiaGridProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaGridProvider)
public:
explicit QWindowsUiaGridProvider(QAccessible::Id id);
virtual ~QWindowsUiaGridProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h
index 5fb509c5f3..7d646894a1 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiainvokeprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaInvokeProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<IInvokeProvider>
{
- Q_DISABLE_COPY(QWindowsUiaInvokeProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaInvokeProvider)
public:
explicit QWindowsUiaInvokeProvider(QAccessible::Id id);
virtual ~QWindowsUiaInvokeProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
index 96d64acc32..f589fd6b10 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp
@@ -82,7 +82,7 @@ QWindowsUiaMainProvider *QWindowsUiaMainProvider::providerForAccessible(QAccessi
QAccessible::Id id = QAccessible::uniqueId(accessible);
QWindowsUiaProviderCache *providerCache = QWindowsUiaProviderCache::instance();
- QWindowsUiaMainProvider *provider = qobject_cast<QWindowsUiaMainProvider *>(providerCache->providerForId(id));
+ auto *provider = qobject_cast<QWindowsUiaMainProvider *>(providerCache->providerForId(id));
if (provider) {
provider->AddRef();
@@ -153,7 +153,7 @@ void QWindowsUiaMainProvider::notifyValueChange(QAccessibleValueChangeEvent *eve
int count = listacc->childCount();
for (int i = 0; i < count; ++i) {
QAccessibleInterface *item = listacc->child(i);
- if (item && item->text(QAccessible::Name) == event->value()) {
+ if (item && item->isValid() && item->text(QAccessible::Name) == event->value()) {
if (!item->state().selected) {
if (QAccessibleActionInterface *actionInterface = item->actionInterface())
actionInterface->doAction(QAccessibleActionInterface::toggleAction());
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
index df0d60f9c9..cdc239ed99 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.h
@@ -60,7 +60,7 @@ class QWindowsUiaMainProvider :
public IRawElementProviderFragmentRoot
{
Q_OBJECT
- Q_DISABLE_COPY(QWindowsUiaMainProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaMainProvider)
public:
static QWindowsUiaMainProvider *providerForAccessible(QAccessibleInterface *accessible);
explicit QWindowsUiaMainProvider(QAccessibleInterface *a, int initialRefCount = 1);
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h
index c5e0a03ee5..fc82d3a2cc 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiarangevalueprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaRangeValueProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<IRangeValueProvider>
{
- Q_DISABLE_COPY(QWindowsUiaRangeValueProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaRangeValueProvider)
public:
explicit QWindowsUiaRangeValueProvider(QAccessible::Id id);
virtual ~QWindowsUiaRangeValueProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h
index 1f2605188b..4b59c4e40f 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionitemprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaSelectionItemProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<ISelectionItemProvider>
{
- Q_DISABLE_COPY(QWindowsUiaSelectionItemProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaSelectionItemProvider)
public:
explicit QWindowsUiaSelectionItemProvider(QAccessible::Id id);
virtual ~QWindowsUiaSelectionItemProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h
index 0376d25804..ee1044ec7a 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaselectionprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaSelectionProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<ISelectionProvider>
{
- Q_DISABLE_COPY(QWindowsUiaSelectionProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaSelectionProvider)
public:
explicit QWindowsUiaSelectionProvider(QAccessible::Id id);
virtual ~QWindowsUiaSelectionProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h
index bf4b52ee0b..9804c35f8e 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableitemprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaTableItemProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<ITableItemProvider>
{
- Q_DISABLE_COPY(QWindowsUiaTableItemProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaTableItemProvider)
public:
explicit QWindowsUiaTableItemProvider(QAccessible::Id id);
virtual ~QWindowsUiaTableItemProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h
index 94c8ab93a7..a8b16035ec 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatableprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaTableProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<ITableProvider>
{
- Q_DISABLE_COPY(QWindowsUiaTableProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaTableProvider)
public:
explicit QWindowsUiaTableProvider(QAccessible::Id id);
virtual ~QWindowsUiaTableProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp
index 9d1e72fb78..50ecfc7ecd 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.cpp
@@ -100,7 +100,7 @@ HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::GetSelection(SAFEARRAY **pRet
for (LONG i = 0; i < selCount; ++i) {
int startOffset = 0, endOffset = 0;
textInterface->selection((int)i, &startOffset, &endOffset);
- QWindowsUiaTextRangeProvider *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), startOffset, endOffset);
+ auto *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), startOffset, endOffset);
SafeArrayPutElement(*pRetVal, &i, static_cast<IUnknown *>(textRangeProvider));
textRangeProvider->Release();
}
@@ -110,7 +110,7 @@ HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::GetSelection(SAFEARRAY **pRet
if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 1))) {
LONG i = 0;
int cursorPosition = textInterface->cursorPosition();
- QWindowsUiaTextRangeProvider *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), cursorPosition, cursorPosition);
+ auto *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), cursorPosition, cursorPosition);
SafeArrayPutElement(*pRetVal, &i, static_cast<IUnknown *>(textRangeProvider));
textRangeProvider->Release();
}
@@ -138,7 +138,7 @@ HRESULT STDMETHODCALLTYPE QWindowsUiaTextProvider::GetVisibleRanges(SAFEARRAY **
// Considering the entire text as visible.
if ((*pRetVal = SafeArrayCreateVector(VT_UNKNOWN, 0, 1))) {
LONG i = 0;
- QWindowsUiaTextRangeProvider *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), 0, textInterface->characterCount());
+ auto *textRangeProvider = new QWindowsUiaTextRangeProvider(id(), 0, textInterface->characterCount());
SafeArrayPutElement(*pRetVal, &i, static_cast<IUnknown *>(textRangeProvider));
textRangeProvider->Release();
}
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h
index a9be70fa16..ffab48b0e8 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextprovider.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaTextProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<ITextProvider2>
{
- Q_DISABLE_COPY(QWindowsUiaTextProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaTextProvider)
public:
explicit QWindowsUiaTextProvider(QAccessible::Id id);
~QWindowsUiaTextProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp
index 1be186f6b3..d8b8f7281d 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.cpp
@@ -48,6 +48,7 @@
#include <QtGui/qaccessible.h>
#include <QtCore/qloggingcategory.h>
#include <QtCore/qstring.h>
+#include <QtCore/qvarlengtharray.h>
QT_BEGIN_NAMESPACE
@@ -92,7 +93,7 @@ HRESULT QWindowsUiaTextRangeProvider::Compare(ITextRangeProvider *range, BOOL *p
if (!range || !pRetVal)
return E_INVALIDARG;
- QWindowsUiaTextRangeProvider *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(range);
+ auto *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(range);
*pRetVal = ((targetProvider->m_startOffset == m_startOffset) && (targetProvider->m_endOffset == m_endOffset));
return S_OK;
}
@@ -110,7 +111,7 @@ HRESULT QWindowsUiaTextRangeProvider::CompareEndpoints(TextPatternRangeEndpoint
if (!targetRange || !pRetVal)
return E_INVALIDARG;
- QWindowsUiaTextRangeProvider *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(targetRange);
+ auto *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(targetRange);
int point = (endpoint == TextPatternRangeEndpoint_Start) ? m_startOffset : m_endOffset;
int targetPoint = (targetEndpoint == TextPatternRangeEndpoint_Start) ?
@@ -227,7 +228,7 @@ HRESULT QWindowsUiaTextRangeProvider::GetBoundingRectangles(SAFEARRAY **pRetVal)
return UIA_E_ELEMENTNOTAVAILABLE;
int len = textInterface->characterCount();
- QList<QRect> rectList;
+ QVarLengthArray<QRect> rectList;
if ((m_startOffset >= 0) && (m_endOffset <= len) && (m_startOffset < m_endOffset)) {
int start, end;
@@ -373,7 +374,7 @@ HRESULT QWindowsUiaTextRangeProvider::MoveEndpointByRange(TextPatternRangeEndpoi
qCDebug(lcQpaUiAutomation) << __FUNCTION__
<< "endpoint=" << endpoint << "targetRange=" << targetRange << "targetEndpoint=" << targetEndpoint << "this: " << this;
- QWindowsUiaTextRangeProvider *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(targetRange);
+ auto *targetProvider = static_cast<QWindowsUiaTextRangeProvider *>(targetRange);
int targetPoint = (targetEndpoint == TextPatternRangeEndpoint_Start) ?
targetProvider->m_startOffset : targetProvider->m_endOffset;
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h
index 39b9069fc0..3b4ec63ceb 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatextrangeprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaTextRangeProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<ITextRangeProvider>
{
- Q_DISABLE_COPY(QWindowsUiaTextRangeProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaTextRangeProvider)
public:
explicit QWindowsUiaTextRangeProvider(QAccessible::Id id, int startOffset, int endOffset);
virtual ~QWindowsUiaTextRangeProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h
index 2bed6f7e36..892b635b41 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiatoggleprovider.h
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaToggleProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<IToggleProvider>
{
- Q_DISABLE_COPY(QWindowsUiaToggleProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaToggleProvider)
public:
explicit QWindowsUiaToggleProvider(QAccessible::Id id);
virtual ~QWindowsUiaToggleProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h
index 334a17e51d..3edfe7a08b 100644
--- a/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h
+++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiavalueprovider.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
class QWindowsUiaValueProvider : public QWindowsUiaBaseProvider,
public QWindowsComBase<IValueProvider>
{
- Q_DISABLE_COPY(QWindowsUiaValueProvider)
+ Q_DISABLE_COPY_MOVE(QWindowsUiaValueProvider)
public:
explicit QWindowsUiaValueProvider(QAccessible::Id id);
virtual ~QWindowsUiaValueProvider();
diff --git a/src/plugins/platforms/windows/uiautomation/uiautomation.pri b/src/plugins/platforms/windows/uiautomation/uiautomation.pri
index 5d4fa5755b..ee9332e7ea 100644
--- a/src/plugins/platforms/windows/uiautomation/uiautomation.pri
+++ b/src/plugins/platforms/windows/uiautomation/uiautomation.pri
@@ -41,5 +41,4 @@ HEADERS += \
$$PWD/qwindowsuiawindowprovider.h \
$$PWD/qwindowsuiautils.h
-mingw: LIBS *= -luuid
-
+mingw: QMAKE_USE *= uuid
diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri
index 7004d7e854..95ba961df1 100644
--- a/src/plugins/platforms/windows/windows.pri
+++ b/src/plugins/platforms/windows/windows.pri
@@ -1,15 +1,21 @@
# Note: OpenGL32 must precede Gdi32 as it overwrites some functions.
-LIBS += -lole32 -luser32 -lwinspool -limm32 -lwinmm -loleaut32
+LIBS += -lwinspool -limm32 -loleaut32
QT_FOR_CONFIG += gui
qtConfig(opengl):!qtConfig(opengles2):!qtConfig(dynamicgl): LIBS *= -lopengl32
-mingw: LIBS *= -luuid
+mingw: QMAKE_USE *= uuid
# For the dialog helpers:
-LIBS += -lshlwapi -lshell32 -ladvapi32 -lwtsapi32
-
-QMAKE_USE_PRIVATE += d3d9/nolink
+LIBS += -lshlwapi -lwtsapi32
+
+QMAKE_USE_PRIVATE += \
+ advapi32 \
+ d3d9/nolink \
+ ole32 \
+ shell32 \
+ user32 \
+ winmm
DEFINES *= QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
diff --git a/src/plugins/platforms/windows/windows.pro b/src/plugins/platforms/windows/windows.pro
index 174bc7b609..50a3bb41a9 100644
--- a/src/plugins/platforms/windows/windows.pro
+++ b/src/plugins/platforms/windows/windows.pro
@@ -8,7 +8,8 @@ QT += \
qtConfig(accessibility): QT += accessibility_support-private
qtConfig(vulkan): QT += vulkan_support-private
-LIBS += -lgdi32 -ldwmapi
+LIBS += -ldwmapi
+QMAKE_USE_PRIVATE += gdi32
include(windows.pri)
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 342e142a74..86ab7651c6 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -1091,7 +1091,7 @@ HRESULT QWinRTScreen::onPointerEntered(ICoreWindow *, IPointerEventArgs *args)
d->currentTargetWindow = topWindow();
if (d->mouseGrabWindow)
- d->currentTargetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.loadRelaxed()->window();
qCDebug(lcQpaEvents) << __FUNCTION__ << "handleEnterEvent" << d->currentTargetWindow << pos;
QWindowSystemInterface::handleEnterEvent(d->currentTargetWindow, pos, pos);
@@ -1115,7 +1115,7 @@ HRESULT QWinRTScreen::onPointerExited(ICoreWindow *, IPointerEventArgs *args)
d->touchPoints.remove(id);
if (d->mouseGrabWindow)
- d->currentTargetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.loadRelaxed()->window();
qCDebug(lcQpaEvents) << __FUNCTION__ << "handleLeaveEvent" << d->currentTargetWindow;
QWindowSystemInterface::handleLeaveEvent(d->currentTargetWindow);
@@ -1146,7 +1146,7 @@ HRESULT QWinRTScreen::onPointerUpdated(ICoreWindow *, IPointerEventArgs *args)
d->currentTargetWindow = windowUnderPointer;
if (d->mouseGrabWindow)
- d->currentTargetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.loadRelaxed()->window();
if (d->currentTargetWindow) {
const QPointF globalPosDelta = pos - posPoint;
@@ -1348,7 +1348,7 @@ void QWinRTScreen::emulateMouseMove(const QPointF &point, MousePositionTransitio
d->currentTargetWindow = windowUnderPointer;
if (d->mouseGrabWindow)
- d->currentTargetWindow = d->mouseGrabWindow.load()->window();
+ d->currentTargetWindow = d->mouseGrabWindow.loadRelaxed()->window();
if (d->currentTargetWindow) {
const QPointF globalPosDelta = pos - posPoint;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.cpp
index 524000b618..355dbf7d20 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiagriditemprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -105,19 +107,17 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaGridItemProvider::get_ContainingGrid(IIRawEle
*value = nullptr;
auto accid = id();
- auto elementId = QSharedPointer<QAccessible::Id>(new QAccessible::Id(0));
- auto ptrElementId = new QSharedPointer<QAccessible::Id>(elementId);
+ auto elementId = std::make_shared<QAccessible::Id>(0);
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementId]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementId]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface()) {
if (QAccessibleInterface *table = tableCellInterface->table()) {
- **ptrElementId = idForAccessible(table);
- QWinRTUiaMetadataCache::instance()->load(**ptrElementId);
+ *elementId = idForAccessible(table);
+ QWinRTUiaMetadataCache::instance()->load(*elementId);
}
}
}
- delete ptrElementId;
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.cpp
index e469991de2..3bd90f6850 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiagridprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -104,21 +106,19 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaGridProvider::GetItem(INT32 row, INT32 column
*returnValue = nullptr;
auto accid = id();
- auto elementId = QSharedPointer<QAccessible::Id>(new QAccessible::Id(0));
- auto ptrElementId = new QSharedPointer<QAccessible::Id>(elementId);
+ auto elementId = std::make_shared<QAccessible::Id>(0);
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, row, column, ptrElementId]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, row, column, elementId]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTableInterface *tableInterface = accessible->tableInterface()) {
if ((row >= 0) && (row < tableInterface->rowCount()) && (column >= 0) && (column < tableInterface->columnCount())) {
if (QAccessibleInterface *cell = tableInterface->cellAt(row, column)) {
- **ptrElementId = idForAccessible(cell);
- QWinRTUiaMetadataCache::instance()->load(**ptrElementId);
+ *elementId = idForAccessible(cell);
+ QWinRTUiaMetadataCache::instance()->load(*elementId);
}
}
}
}
- delete ptrElementId;
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.cpp
index 6f3ad6dcd2..0b1db306bd 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.cpp
@@ -64,6 +64,8 @@
#include <QtCore/qfunctions_winrt.h>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
using namespace QWinRTUiAutomation;
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
@@ -179,7 +181,7 @@ HRESULT QWinRTUiaMainProvider::rawProviderForAccessibleId(QAccessible::Id elemen
}
// Returns an array of IIRawElementProviderSimple instances for a list of accessible interface ids.
-HRESULT QWinRTUiaMainProvider::rawProviderArrayForAccessibleIdList(const QList<QAccessible::Id> &elementIds,
+HRESULT QWinRTUiaMainProvider::rawProviderArrayForAccessibleIdList(const QVarLengthArray<QAccessible::Id> &elementIds,
UINT32 *returnValueSize,
IIRawElementProviderSimple ***returnValue)
{
@@ -190,7 +192,7 @@ HRESULT QWinRTUiaMainProvider::rawProviderArrayForAccessibleIdList(const QList<Q
QList<IIRawElementProviderSimple *> rawProviderList;
- for (auto elementId : qAsConst(elementIds)) {
+ for (auto elementId : elementIds) {
IIRawElementProviderSimple *rawProvider;
if (SUCCEEDED(rawProviderForAccessibleId(elementId, &rawProvider)))
rawProviderList.append(rawProvider);
@@ -515,10 +517,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaMainProvider::GetChildrenCore(IVector<Automat
*returnValue = nullptr;
auto accid = id();
- auto children = QSharedPointer<QList<QAccessible::Id>>(new QList<QAccessible::Id>);
- auto ptrChildren = new QSharedPointer<QList<QAccessible::Id>>(children);
+ auto children = std::make_shared<QVarLengthArray<QAccessible::Id>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrChildren]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, children]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
int childCount = accessible->childCount();
for (int i = 0; i < childCount; ++i) {
@@ -526,11 +527,10 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaMainProvider::GetChildrenCore(IVector<Automat
QAccessible::Id childId = idForAccessible(childAcc);
QWinRTUiaMetadataCache::instance()->load(childId);
if (!childAcc->state().invisible)
- (*ptrChildren)->append(childId);
+ children->append(childId);
}
}
}
- delete ptrChildren;
return S_OK;
}))) {
return E_FAIL;
@@ -538,7 +538,7 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaMainProvider::GetChildrenCore(IVector<Automat
ComPtr<IVector<AutomationPeer *>> peerVector = Make<QWinRTUiaPeerVector>();
- for (auto childId : qAsConst(*children)) {
+ for (auto childId : *children) {
if (ComPtr<QWinRTUiaMainProvider> provider = providerForAccessibleId(childId)) {
IAutomationPeer *peer;
if (SUCCEEDED(provider.CopyTo(&peer)))
@@ -750,10 +750,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaMainProvider::GetPeerFromPointCore(ABI::Windo
// Scale coordinates from High DPI screens?
auto accid = id();
- auto elementId = QSharedPointer<QAccessible::Id>(new QAccessible::Id(0));
- auto ptrElementId = new QSharedPointer<QAccessible::Id>(elementId);
+ auto elementId = std::make_shared<QAccessible::Id>(0);
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementId, point]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementId, point]() {
// Controls can be embedded within grouping elements. By default returns the innermost control.
QAccessibleInterface *target = accessibleForId(accid);
while (QAccessibleInterface *tmpacc = target->childAt(point.X, point.Y)) {
@@ -761,9 +760,8 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaMainProvider::GetPeerFromPointCore(ABI::Windo
// For accessibility tools it may be better to return the text element instead of its subcomponents.
if (target->textInterface()) break;
}
- **ptrElementId = idForAccessible(target);
- QWinRTUiaMetadataCache::instance()->load(**ptrElementId);
- delete ptrElementId;
+ *elementId = idForAccessible(target);
+ QWinRTUiaMetadataCache::instance()->load(*elementId);
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.h b/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.h
index 384a166cf7..23a6e56ae7 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.h
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiamainprovider.h
@@ -69,7 +69,7 @@ public:
virtual ~QWinRTUiaMainProvider();
static QWinRTUiaMainProvider *providerForAccessibleId(QAccessible::Id id);
static HRESULT rawProviderForAccessibleId(QAccessible::Id elementId, ABI::Windows::UI::Xaml::Automation::Provider::IIRawElementProviderSimple **returnValue);
- static HRESULT rawProviderArrayForAccessibleIdList(const QList<QAccessible::Id> &elementIds, UINT32 *returnValueSize, ABI::Windows::UI::Xaml::Automation::Provider::IIRawElementProviderSimple ***returnValue);
+ static HRESULT rawProviderArrayForAccessibleIdList(const QVarLengthArray<QAccessible::Id> &elementIds, UINT32 *returnValueSize, ABI::Windows::UI::Xaml::Automation::Provider::IIRawElementProviderSimple ***returnValue);
static void notifyFocusChange(QAccessibleEvent *event);
static void notifyVisibilityChange(QAccessibleEvent *event);
static void notifyStateChange(QAccessibleStateChangeEvent *event);
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.cpp
index 9bc88272ba..2cb5aa685c 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionitemprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -94,21 +96,19 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaSelectionItemProvider::get_SelectionContainer
*value = nullptr;
auto accid = id();
- auto elementId = QSharedPointer<QAccessible::Id>(new QAccessible::Id(0));
- auto ptrElementId = new QSharedPointer<QAccessible::Id>(elementId);
+ auto elementId = std::make_shared<QAccessible::Id>(0);
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementId]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementId]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
// Radio buttons do not require a container.
if (accessible->role() == QAccessible::ListItem) {
if (QAccessibleInterface *parent = accessible->parent()) {
if (parent->role() == QAccessible::List) {
- **ptrElementId = idForAccessible(parent);
+ *elementId = idForAccessible(parent);
}
}
}
}
- delete ptrElementId;
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.cpp
index 9e61a8df61..4d825351c8 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiaselectionprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -89,10 +91,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaSelectionProvider::get_IsSelectionRequired(bo
*value = false;
auto accid = id();
- auto selectionRequired = QSharedPointer<bool>(new bool(false));
- auto ptrSelectionRequired = new QSharedPointer<bool>(selectionRequired);
+ auto selectionRequired = std::make_shared<bool>(false);
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrSelectionRequired]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, selectionRequired]() {
// Initially returns false if none are selected. After the first selection, it may be required.
bool anySelected = false;
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
@@ -105,9 +106,8 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaSelectionProvider::get_IsSelectionRequired(bo
}
}
}
- **ptrSelectionRequired = anySelected && !accessible->state().multiSelectable && !accessible->state().extSelectable;
+ *selectionRequired = anySelected && !accessible->state().multiSelectable && !accessible->state().extSelectable;
}
- delete ptrSelectionRequired;
return S_OK;
}))) {
return E_FAIL;
@@ -128,10 +128,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaSelectionProvider::GetSelection(UINT32 *retur
*returnValue = nullptr;
auto accid = id();
- auto elementIds = QSharedPointer<QList<QAccessible::Id>>(new QList<QAccessible::Id>);
- auto ptrElementIds = new QSharedPointer<QList<QAccessible::Id>>(elementIds);
+ auto elementIds = std::make_shared<QVarLengthArray<QAccessible::Id>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementIds]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementIds]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
int childCount = accessible->childCount();
for (int i = 0; i < childCount; ++i) {
@@ -139,12 +138,11 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaSelectionProvider::GetSelection(UINT32 *retur
if (childAcc->state().selected) {
QAccessible::Id childId = idForAccessible(childAcc);
QWinRTUiaMetadataCache::instance()->load(childId);
- (*ptrElementIds)->append(childId);
+ elementIds->append(childId);
}
}
}
}
- delete ptrElementIds;
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.cpp
index 1af74a8b72..7cd953de87 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableitemprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -79,21 +81,19 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTableItemProvider::GetColumnHeaderItems(UINT3
*returnValue = nullptr;
auto accid = id();
- auto elementIds = QSharedPointer<QList<QAccessible::Id>>(new QList<QAccessible::Id>);
- auto ptrElementIds = new QSharedPointer<QList<QAccessible::Id>>(elementIds);
+ auto elementIds = std::make_shared<QVarLengthArray<QAccessible::Id>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementIds]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementIds]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface()) {
QList<QAccessibleInterface *> headers = tableCellInterface->columnHeaderCells();
for (auto header : qAsConst(headers)) {
QAccessible::Id headerId = idForAccessible(header);
QWinRTUiaMetadataCache::instance()->load(headerId);
- (*ptrElementIds)->append(headerId);
+ elementIds->append(headerId);
}
}
}
- delete ptrElementIds;
return S_OK;
}))) {
return E_FAIL;
@@ -113,21 +113,19 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTableItemProvider::GetRowHeaderItems(UINT32 *
*returnValue = nullptr;
auto accid = id();
- auto elementIds = QSharedPointer<QList<QAccessible::Id>>(new QList<QAccessible::Id>);
- auto ptrElementIds = new QSharedPointer<QList<QAccessible::Id>>(elementIds);
+ auto elementIds = std::make_shared<QVarLengthArray<QAccessible::Id>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementIds]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementIds]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface()) {
QList<QAccessibleInterface *> headers = tableCellInterface->rowHeaderCells();
for (auto header : qAsConst(headers)) {
QAccessible::Id headerId = idForAccessible(header);
QWinRTUiaMetadataCache::instance()->load(headerId);
- (*ptrElementIds)->append(headerId);
+ elementIds->append(headerId);
}
}
}
- delete ptrElementIds;
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.cpp
index e71ade3c1f..d763b320b1 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatableprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -91,10 +93,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTableProvider::GetColumnHeaders(UINT32 *retur
*returnValue = nullptr;
auto accid = id();
- auto elementIds = QSharedPointer<QList<QAccessible::Id>>(new QList<QAccessible::Id>);
- auto ptrElementIds = new QSharedPointer<QList<QAccessible::Id>>(elementIds);
+ auto elementIds = std::make_shared<QVarLengthArray<QAccessible::Id>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementIds]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementIds]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTableInterface *tableInterface = accessible->tableInterface()) {
for (int i = 0; i < tableInterface->columnCount(); ++i) {
@@ -105,14 +106,13 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTableProvider::GetColumnHeaders(UINT32 *retur
for (auto header : qAsConst(headers)) {
QAccessible::Id headerId = idForAccessible(header);
QWinRTUiaMetadataCache::instance()->load(headerId);
- (*ptrElementIds)->append(headerId);
+ elementIds->append(headerId);
}
}
}
}
}
}
- delete ptrElementIds;
return S_OK;
}))) {
return E_FAIL;
@@ -132,10 +132,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTableProvider::GetRowHeaders(UINT32 *returnVa
*returnValue = nullptr;
auto accid = id();
- auto elementIds = QSharedPointer<QList<QAccessible::Id>>(new QList<QAccessible::Id>);
- auto ptrElementIds = new QSharedPointer<QList<QAccessible::Id>>(elementIds);
+ auto elementIds = std::make_shared<QVarLengthArray<QAccessible::Id>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrElementIds]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, elementIds]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTableInterface *tableInterface = accessible->tableInterface()) {
for (int i = 0; i < tableInterface->rowCount(); ++i) {
@@ -146,14 +145,13 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTableProvider::GetRowHeaders(UINT32 *returnVa
for (auto header : qAsConst(headers)) {
QAccessible::Id headerId = idForAccessible(header);
QWinRTUiaMetadataCache::instance()->load(headerId);
- (*ptrElementIds)->append(headerId);
+ elementIds->append(headerId);
}
}
}
}
}
}
- delete ptrElementIds;
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.cpp
index aa120377df..cd7420f360 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -104,26 +106,26 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextProvider::GetSelection(UINT32 *returnValu
*returnValueSize = 0;
*returnValue = nullptr;
+ struct Selection { int startOffset, endOffset; };
+
auto accid = id();
- auto selections = QSharedPointer<QList<QPair<int,int>>>(new QList<QPair<int,int>>);
- auto ptrSelections = new QSharedPointer<QList<QPair<int,int>>>(selections);
+ auto selections = std::make_shared<QVarLengthArray<Selection>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, ptrSelections]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, selections]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTextInterface *textInterface = accessible->textInterface()) {
for (int i = 0; i < textInterface->selectionCount(); ++i) {
- QPair<int,int> sel;
- textInterface->selection(i, &sel.first, &sel.second);
- (*ptrSelections)->append(sel);
+ int startOffset, endOffset;
+ textInterface->selection(i, &startOffset, &endOffset);
+ selections->append({startOffset, endOffset});
}
- if ((*ptrSelections)->size() == 0) {
+ if (selections->size() == 0) {
// If there is no selection, we return an array with a single degenerate (empty) text range at the cursor position.
- QPair<int,int> sel(textInterface->cursorPosition(), textInterface->cursorPosition());
- (*ptrSelections)->append(sel);
+ auto cur = textInterface->cursorPosition();
+ selections->append({cur, cur});
}
}
}
- delete ptrSelections;
return S_OK;
}))) {
return E_FAIL;
@@ -137,9 +139,11 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextProvider::GetSelection(UINT32 *returnValu
if (!providerArray)
return E_OUTOFMEMORY;
- for (int i = 0; i < selCount; ++i) {
- ComPtr<QWinRTUiaTextRangeProvider> textRangeProvider = Make<QWinRTUiaTextRangeProvider>(id(), (*selections)[i].first, (*selections)[i].second);
- textRangeProvider.CopyTo(&providerArray[i]);
+ auto dst = providerArray;
+ for (auto sel : *selections) {
+ ComPtr<QWinRTUiaTextRangeProvider> textRangeProvider
+ = Make<QWinRTUiaTextRangeProvider>(id(), sel.startOffset, sel.endOffset);
+ textRangeProvider.CopyTo(dst++);
}
*returnValueSize = selCount;
*returnValue = providerArray;
@@ -184,14 +188,12 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextProvider::RangeFromPoint(ABI::Windows::Fo
const QPoint pt(screenLocation.X, screenLocation.Y);
auto accid = id();
- auto offset = QSharedPointer<int>(new int);
- auto ptrOffset = new QSharedPointer<int>(offset);
+ auto offset = std::make_shared<int>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, pt, ptrOffset]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, pt, offset]() {
if (QAccessibleInterface *accessible = accessibleForId(accid))
if (QAccessibleTextInterface *textInterface = accessible->textInterface())
- **ptrOffset = qBound(0, textInterface->offsetAtPoint(pt), textInterface->characterCount() - 1);
- delete ptrOffset;
+ *offset = qBound(0, textInterface->offsetAtPoint(pt), textInterface->characterCount() - 1);
return S_OK;
}))) {
return E_FAIL;
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.cpp
index fc3778d652..ca15feaff9 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiatextrangeprovider.cpp
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/private/qeventdispatcher_winrt_p.h>
+#include <memory>
+
QT_BEGIN_NAMESPACE
using namespace QWinRTUiAutomation;
@@ -212,10 +214,9 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextRangeProvider::GetBoundingRectangles(UINT
auto accid = id();
auto startOffset = m_startOffset;
auto endOffset = m_endOffset;
- auto rects = QSharedPointer<QList<QRect>>(new QList<QRect>);
- auto ptrRects = new QSharedPointer<QList<QRect>>(rects);
+ auto rects = std::make_shared<QVarLengthArray<QRect>>();
- if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, startOffset, endOffset, ptrRects]() {
+ if (!SUCCEEDED(QEventDispatcherWinRT::runOnMainThread([accid, startOffset, endOffset, rects]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
if (QAccessibleTextInterface *textInterface = accessible->textInterface()) {
int len = textInterface->characterCount();
@@ -233,7 +234,7 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextRangeProvider::GetBoundingRectangles(UINT
qMin(startRect.y(), endRect.y()),
qMax(startRect.x() + startRect.width(), endRect.x() + endRect.width()) - qMin(startRect.x(), endRect.x()),
qMax(startRect.y() + startRect.height(), endRect.y() + endRect.height()) - qMin(startRect.y(), endRect.y()));
- (*ptrRects)->append(lineRect);
+ rects->append(lineRect);
}
if (end >= len) break;
textInterface->textAfterOffset(end + 1, QAccessible::LineBoundary, &start, &end);
@@ -241,7 +242,6 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextRangeProvider::GetBoundingRectangles(UINT
}
}
}
- delete ptrRects;
return S_OK;
}))) {
return E_FAIL;
@@ -251,11 +251,12 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaTextRangeProvider::GetBoundingRectangles(UINT
if (!doubleArray)
return E_OUTOFMEMORY;
- for (int i = 0; i < rects->size(); ++i) {
- doubleArray[i*4] = (*rects)[i].left();
- doubleArray[i*4+1] = (*rects)[i].top();
- doubleArray[i*4+2] = (*rects)[i].width();
- doubleArray[i*4+3] = (*rects)[i].height();
+ DOUBLE *dst = doubleArray;
+ for (auto rect : *rects) {
+ *dst++ = rect.left();
+ *dst++ = rect.top();
+ *dst++ = rect.width();
+ *dst++ = rect.height();
}
*returnValue = doubleArray;
*returnValueSize = 4 * rects->size();
diff --git a/src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.cpp b/src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.cpp
index 21389b74d2..255d8ee49e 100644
--- a/src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.cpp
+++ b/src/plugins/platforms/winrt/uiautomation/qwinrtuiavalueprovider.cpp
@@ -96,24 +96,22 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaValueProvider::SetValue(HSTRING value)
qCDebug(lcQpaUiAutomation) << __FUNCTION__;
auto accid = id();
- auto tmpValue = QSharedPointer<QString>(new QString);
- auto ptrValue = new QSharedPointer<QString>(tmpValue);
- *tmpValue = hStrToQStr(value);
+ QString tmpValue = hStrToQStr(value);
- QEventDispatcherWinRT::runOnMainThread([accid, ptrValue]() {
+ QEventDispatcherWinRT::runOnMainThread([accid, tmpValue]() {
if (QAccessibleInterface *accessible = accessibleForId(accid)) {
// First sets the value as a text.
- accessible->setText(QAccessible::Value, **ptrValue);
+ accessible->setText(QAccessible::Value, tmpValue);
// Then, if the control supports the value interface (range value)
// and the supplied text can be converted to a number, and that number
// lies within the min/max limits, sets it as the control's current (numeric) value.
if (QAccessibleValueInterface *valueInterface = accessible->valueInterface()) {
bool ok = false;
- double numval = (*ptrValue)->toDouble(&ok);
+ double numval = tmpValue.toDouble(&ok);
if (ok) {
double minimum = valueInterface->minimumValue().toDouble();
double maximum = valueInterface->maximumValue().toDouble();
@@ -124,7 +122,6 @@ HRESULT STDMETHODCALLTYPE QWinRTUiaValueProvider::SetValue(HSTRING value)
}
}
QWinRTUiaMetadataCache::instance()->load(accid);
- delete ptrValue;
return S_OK;
}, 0);
diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro
index 43132a1a76..43dc8f074c 100644
--- a/src/plugins/platforms/winrt/winrt.pro
+++ b/src/plugins/platforms/winrt/winrt.pro
@@ -8,8 +8,7 @@ QT += \
DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__
-LIBS += -lws2_32
-QMAKE_USE_PRIVATE += d3d11
+QMAKE_USE_PRIVATE += d3d11 ws2_32
SOURCES = \
main.cpp \
diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h
index d5a0af97b0..b18248570f 100644
--- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h
+++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationplugin.h
@@ -54,7 +54,7 @@ class Q_XCB_EXPORT QXcbGlIntegrationPlugin : public QObject
{
Q_OBJECT
public:
- explicit QXcbGlIntegrationPlugin(QObject *parent = 0)
+ explicit QXcbGlIntegrationPlugin(QObject *parent = nullptr)
: QObject(parent)
{ }
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
index b751aaf8a3..34895caaa2 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp
@@ -164,7 +164,11 @@ bool QXcbGlxIntegration::handleXcbEvent(xcb_generic_event_t *event, uint respons
XUnlockDisplay(xdisplay);
locked = false;
auto eventType = m_connection->nativeInterface()->nativeEventType();
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result = 0;
+# else
long result = 0;
+# endif
handled = dispatcher->filterNativeEvent(eventType, &ev, &result);
}
#endif
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
index 8d958aae94..82b6d60bcd 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
@@ -455,7 +455,7 @@ static const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE] = {
static QPixmap qt_patternForAlpha(uchar alpha, int screen)
{
QPixmap pm;
- QString key = QLatin1Literal("$qt-alpha-brush$")
+ QString key = QLatin1String("$qt-alpha-brush$")
% HexString<uchar>(alpha)
% HexString<int>(screen);
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
index b1ce39f363..f86bedbdcd 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
@@ -2017,7 +2017,7 @@ QImage QX11PlatformPixmap::toImage(const QXImageWrapper &xiWrapper, const QRect
}
} else if (xi->bits_per_pixel == d) { // compatible depth
char *xidata = xi->data; // copy each scanline
- int bpl = qMin(image.bytesPerLine(),xi->bytes_per_line);
+ int bpl = qMin(int(image.bytesPerLine()),xi->bytes_per_line);
for (int y=0; y<xi->height; y++) {
memcpy(image.scanLine(y), xidata, bpl);
xidata += xi->bytes_per_line;
diff --git a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h
index a13a8f0483..1f7e7cf49b 100644
--- a/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h
+++ b/src/plugins/platforms/xcb/nativepainting/qt_x11_p.h
@@ -190,7 +190,7 @@ struct QX11InfoData {
};
template <class T>
-Q_DECL_RELAXED_CONSTEXPR inline int lowest_bit(T v) Q_DECL_NOTHROW
+Q_DECL_RELAXED_CONSTEXPR inline int lowest_bit(T v) noexcept
{
int result = qCountTrailingZeroBits(v);
return ((result >> 3) == sizeof(T)) ? -1 : result;
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index f98b2dfe3a..cac6345b66 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -440,7 +440,11 @@ const char *xcb_protocol_request_codes[] =
void QXcbConnection::handleXcbError(xcb_generic_error_t *error)
{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result = 0;
+#else
long result = 0;
+#endif
QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance();
if (dispatcher && dispatcher->filterNativeEvent(m_nativeInterface->nativeEventType(), error, &result))
return;
@@ -537,7 +541,11 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
if (Q_UNLIKELY(lcQpaEvents().isDebugEnabled()))
printXcbEvent(lcQpaEvents(), "Event", event);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result = 0; // Used only by MS Windows
+#else
long result = 0; // Used only by MS Windows
+#endif
if (QAbstractEventDispatcher *dispatcher = QAbstractEventDispatcher::instance()) {
if (dispatcher->filterNativeEvent(m_nativeInterface->nativeEventType(), event, &result))
return;
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index bbfa252881..7cf25d41a6 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -108,7 +108,7 @@ public:
virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {}
virtual void handleXIEnterLeave(xcb_ge_event_t *) {}
#endif
- virtual QXcbWindow *toWindow() { return 0; }
+ virtual QXcbWindow *toWindow() { return nullptr; }
};
typedef QHash<xcb_window_t, QXcbWindowEventListener *> WindowMapper;
@@ -366,7 +366,7 @@ private:
WindowMapper m_mapper;
- Qt::MouseButtons m_buttonState = 0;
+ Qt::MouseButtons m_buttonState = nullptr;
Qt::MouseButton m_button = Qt::NoButton;
QXcbWindow *m_focusWindow = nullptr;
diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.h b/src/plugins/platforms/xcb/qxcbconnection_basic.h
index b979129cba..1bd4310562 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_basic.h
+++ b/src/plugins/platforms/xcb/qxcbconnection_basic.h
@@ -163,7 +163,7 @@ private:
#define Q_XCB_REPLY_CONNECTION_ARG(connection, ...) connection
struct QStdFreeDeleter {
- void operator()(void *p) const Q_DECL_NOTHROW { return std::free(p); }
+ void operator()(void *p) const noexcept { return std::free(p); }
};
#define Q_XCB_REPLY(call, ...) \
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index bc09fe2f91..4639185416 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -997,8 +997,8 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
QPoint global(fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y));
Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective);
if (modifiers & Qt::AltModifier) {
- std::swap(angleDelta.rx(), angleDelta.ry());
- std::swap(rawDelta.rx(), rawDelta.ry());
+ angleDelta = angleDelta.transposed();
+ rawDelta = rawDelta.transposed();
}
qCDebug(lcQpaXInputEvents) << "scroll wheel @ window pos" << local << "delta px" << rawDelta << "angle" << angleDelta;
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiDeviceEvent->time, local, global, rawDelta, angleDelta, modifiers);
@@ -1024,7 +1024,7 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
QPoint global(fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y));
Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective);
if (modifiers & Qt::AltModifier)
- std::swap(angleDelta.rx(), angleDelta.ry());
+ angleDelta = angleDelta.transposed();
qCDebug(lcQpaXInputEvents) << "scroll wheel (button" << xiDeviceEvent->detail << ") @ window pos" << local << "delta angle" << angleDelta;
QWindowSystemInterface::handleWheelEvent(platformWindow->window(), xiDeviceEvent->time, local, global, QPoint(), angleDelta, modifiers);
}
diff --git a/src/plugins/platforms/xcb/qxcbcursor.h b/src/plugins/platforms/xcb/qxcbcursor.h
index 5bc806381c..0b238823f0 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.h
+++ b/src/plugins/platforms/xcb/qxcbcursor.h
@@ -65,7 +65,7 @@ inline bool operator==(const QXcbCursorCacheKey &k1, const QXcbCursorCacheKey &k
return k1.shape == k2.shape && k1.bitmapCacheKey == k2.bitmapCacheKey && k1.maskCacheKey == k2.maskCacheKey;
}
-inline uint qHash(const QXcbCursorCacheKey &k, uint seed) Q_DECL_NOTHROW
+inline uint qHash(const QXcbCursorCacheKey &k, uint seed) noexcept
{
return (uint(k.shape) + uint(k.bitmapCacheKey) + uint(k.maskCacheKey)) ^ seed;
}
@@ -83,7 +83,7 @@ public:
QPoint pos() const override;
void setPos(const QPoint &pos) override;
- static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = 0);
+ static void queryPointer(QXcbConnection *c, QXcbVirtualDesktop **virtualDesktop, QPoint *pos, int *keybMask = nullptr);
#ifndef QT_NO_CURSOR
xcb_cursor_t xcbCursor(const QCursor &c) const
diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h
index c19008c04b..1388e68acc 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.h
+++ b/src/plugins/platforms/xcb/qxcbdrag.h
@@ -86,7 +86,7 @@ public:
void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event);
void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event);
void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event,
- Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0);
+ Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr);
void handleStatus(const xcb_client_message_event_t *event);
void handleSelectionRequest(const xcb_selection_request_event_t *event);
@@ -109,7 +109,7 @@ private:
void init();
void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event,
- Qt::MouseButtons b = 0, Qt::KeyboardModifiers mods = 0);
+ Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr);
void handle_xdnd_status(const xcb_client_message_event_t *event);
void send_leave();
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 899081e752..81b889a80f 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -636,13 +636,13 @@ static void dumpNativeWindowsRecursion(const QXcbConnection *connection, xcb_win
const QChar oldPadChar =str.padChar();
str.setFieldWidth(8);
str.setPadChar(QLatin1Char('0'));
- str << hex << window;
+ str << Qt::hex << window;
str.setFieldWidth(oldFieldWidth);
str.setPadChar(oldPadChar);
- str << dec << " \""
+ str << Qt::dec << " \""
<< QXcbWindow::windowTitle(connection, window) << "\" "
- << geom.width() << 'x' << geom.height() << forcesign << geom.x() << geom.y()
- << noforcesign << '\n';
+ << geom.width() << 'x' << geom.height() << Qt::forcesign << geom.x() << geom.y()
+ << Qt::noforcesign << '\n';
auto reply = Q_XCB_REPLY(xcb_query_tree, conn, window);
if (reply) {
diff --git a/src/plugins/platforms/xcb/qxcbobject.h b/src/plugins/platforms/xcb/qxcbobject.h
index 1b98d9346b..931bed9ec1 100644
--- a/src/plugins/platforms/xcb/qxcbobject.h
+++ b/src/plugins/platforms/xcb/qxcbobject.h
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
class QXcbObject
{
public:
- QXcbObject(QXcbConnection *connection = 0) : m_connection(connection) {}
+ QXcbObject(QXcbConnection *connection = nullptr) : m_connection(connection) {}
void setConnection(QXcbConnection *connection) { m_connection = connection; }
QXcbConnection *connection() const { return m_connection; }
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index 0cf0942dab..8da299d491 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -660,10 +660,6 @@ QImage::Format QXcbScreen::format() const
int QXcbScreen::forcedDpi() const
{
- static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI");
- if (overrideDpi)
- return overrideDpi;
-
const int forcedDpi = m_virtualDesktop->forcedDpi();
if (forcedDpi > 0)
return forcedDpi;
@@ -679,11 +675,6 @@ QDpi QXcbScreen::logicalDpi() const
return m_virtualDesktop->dpi();
}
-qreal QXcbScreen::pixelDensity() const
-{
- return m_pixelDensity;
-}
-
QPlatformCursor *QXcbScreen::cursor() const
{
return m_cursor;
@@ -747,14 +738,6 @@ void QXcbScreen::updateGeometry(const QRect &geometry, uint8_t rotation)
if (m_sizeMillimeters.isEmpty())
m_sizeMillimeters = sizeInMillimeters(geometry.size(), m_virtualDesktop->dpi());
- qreal dpi = forcedDpi();
- if (dpi <= 0)
- dpi = geometry.width() / physicalSize().width() * qreal(25.4);
-
- // Use 128 as a reference DPI on small screens. This favors "small UI" over "large UI".
- qreal referenceDpi = physicalSize().width() <= 320 ? 128 : 96;
-
- m_pixelDensity = qMax(1, qRound(dpi/referenceDpi));
m_geometry = geometry;
m_availableGeometry = geometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);
@@ -925,7 +908,7 @@ QByteArray QXcbScreen::getEdid() const
static inline void formatRect(QDebug &debug, const QRect r)
{
debug << r.width() << 'x' << r.height()
- << forcesign << r.x() << r.y() << noforcesign;
+ << Qt::forcesign << r.x() << r.y() << Qt::noforcesign;
}
static inline void formatSizeF(QDebug &debug, const QSizeF s)
@@ -939,7 +922,7 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen)
debug.nospace();
debug << "QXcbScreen(" << (const void *)screen;
if (screen) {
- debug << fixed << qSetRealNumberPrecision(1);
+ debug << Qt::fixed << qSetRealNumberPrecision(1);
debug << ", name=" << screen->name();
debug << ", geometry=";
formatRect(debug, screen->geometry());
@@ -957,7 +940,7 @@ QDebug operator<<(QDebug debug, const QXcbScreen *screen)
debug << "), orientation=" << screen->orientation();
debug << ", depth=" << screen->depth();
debug << ", refreshRate=" << screen->refreshRate();
- debug << ", root=" << hex << screen->root();
+ debug << ", root=" << Qt::hex << screen->root();
debug << ", windowManagerName=" << screen->windowManagerName();
}
debug << ')';
diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h
index 914ce6307d..79698b4ef3 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.h
+++ b/src/plugins/platforms/xcb/qxcbscreen.h
@@ -161,7 +161,7 @@ public:
QImage::Format format() const override;
QSizeF physicalSize() const override { return m_sizeMillimeters; }
QDpi logicalDpi() const override;
- qreal pixelDensity() const override;
+ QDpi logicalBaseDpi() const override { return QDpi(96, 96); };
QPlatformCursor *cursor() const override;
qreal refreshRate() const override { return m_refreshRate; }
Qt::ScreenOrientation orientation() const override { return m_orientation; }
@@ -227,7 +227,6 @@ private:
Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation;
QXcbCursor *m_cursor;
qreal m_refreshRate = 60.0;
- int m_pixelDensity = 1;
QEdidParser m_edid;
};
diff --git a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp
index 2303ccf806..f880d4d722 100644
--- a/src/plugins/platforms/xcb/qxcbsessionmanager.cpp
+++ b/src/plugins/platforms/xcb/qxcbsessionmanager.cpp
@@ -42,6 +42,8 @@
#ifndef QT_NO_SESSIONMANAGER
+#include <qpa/qwindowsysteminterface.h>
+
#include <qguiapplication.h>
#include <qdatetime.h>
#include <qfileinfo.h>
@@ -289,8 +291,7 @@ static void sm_dieCallback(SmcConn smcConn, SmPointer /* clientData */)
if (smcConn != smcConnection)
return;
resetSmState();
- QEvent quitEvent(QEvent::Quit);
- QGuiApplication::sendEvent(qApp, &quitEvent);
+ QWindowSystemInterface::handleApplicationTermination<QWindowSystemInterface::SynchronousDelivery>();
}
static void sm_shutdownCancelledCallback(SmcConn smcConn, SmPointer clientData)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 610eca06a5..97da420798 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1657,7 +1657,11 @@ bool QXcbWindow::requestSystemTrayWindowDock()
bool QXcbWindow::handleNativeEvent(xcb_generic_event_t *event)
{
auto eventType = connection()->nativeInterface()->nativeEventType();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result = 0; // Used only by MS Windows
+#else
long result = 0; // Used only by MS Windows
+#endif
return QWindowSystemInterface::handleNativeEvent(window(), eventType, event, &result);
}
@@ -1904,7 +1908,7 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
else if (detail == 7)
angleDelta.setX(-120);
if (modifiers & Qt::AltModifier)
- std::swap(angleDelta.rx(), angleDelta.ry());
+ angleDelta = angleDelta.transposed();
QWindowSystemInterface::handleWheelEvent(window(), timestamp, local, global, QPoint(), angleDelta, modifiers);
#if QT_CONFIG(xcb_xinput)
}
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index 8258cc2dfa..5de5974ca7 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -166,7 +166,7 @@ public:
bool needsSync() const;
void postSyncWindowRequest();
- void clearSyncWindowRequest() { m_pendingSyncRequest = 0; }
+ void clearSyncWindowRequest() { m_pendingSyncRequest = nullptr; }
QXcbScreen *xcbScreen() const;
diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h
index 3497c6a6f1..5cfc4df0d0 100644
--- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h
+++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.h
@@ -72,7 +72,7 @@ public:
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override;
QIcon fileIcon(const QFileInfo &fileInfo,
- QPlatformTheme::IconOptions iconOptions = 0) const override;
+ QPlatformTheme::IconOptions iconOptions = nullptr) const override;
QIconEngine *createIconEngine(const QString &iconName) const override;
diff --git a/src/plugins/printsupport/windows/windows.pro b/src/plugins/printsupport/windows/windows.pro
index 06694fb7fe..6ca601b2a4 100644
--- a/src/plugins/printsupport/windows/windows.pro
+++ b/src/plugins/printsupport/windows/windows.pro
@@ -18,7 +18,8 @@ HEADERS += \
OTHER_FILES += windows.json
-LIBS += -lwinspool -lcomdlg32 -lgdi32 -luser32
+LIBS += -lwinspool -lcomdlg32
+QMAKE_USE_PRIVATE += user32 gdi32
PLUGIN_TYPE = printsupport
PLUGIN_CLASS_NAME = QWindowsPrinterSupportPlugin
diff --git a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
index ead08dbce8..0f39f6aa0d 100644
--- a/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase.cpp
@@ -40,6 +40,7 @@
#include "qsql_ibase_p.h"
#include <qcoreapplication.h>
#include <qdatetime.h>
+#include <qdeadlinetimer.h>
#include <qvariant.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
@@ -1570,10 +1571,9 @@ void QIBaseDriver::close()
d->eventBuffers.clear();
#if defined(FB_API_VER)
- // Workaround for Firebird crash
- QTime timer;
- timer.start();
- while (timer.elapsed() < 500)
+ // TODO check whether this workaround for Firebird crash is still needed
+ QDeadlineTimer timer(500);
+ while (!timer.hasExpired())
QCoreApplication::processEvents();
#endif
}
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc_p.h b/src/plugins/sqldrivers/odbc/qsql_odbc_p.h
index ea0aa6fc8b..ccd0206f38 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc_p.h
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc_p.h
@@ -89,8 +89,8 @@ class Q_EXPORT_SQLDRIVER_ODBC QODBCDriver : public QSqlDriver
friend class QODBCResultPrivate;
public:
- explicit QODBCDriver(QObject *parent=0);
- QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent=0);
+ explicit QODBCDriver(QObject *parent=nullptr);
+ QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent=nullptr);
virtual ~QODBCDriver();
bool hasFeature(DriverFeature f) const override;
void close() override;
diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp
index c1be91cb22..760685f64b 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql.cpp
+++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp
@@ -428,12 +428,14 @@ static QVariant::Type qDecodePSQLType(int t)
void QPSQLResultPrivate::deallocatePreparedStmt()
{
- const QString stmt = QStringLiteral("DEALLOCATE ") + preparedStmtId;
- PGresult *result = drv_d_func()->exec(stmt);
+ if (drv_d_func()) {
+ const QString stmt = QStringLiteral("DEALLOCATE ") + preparedStmtId;
+ PGresult *result = drv_d_func()->exec(stmt);
- if (PQresultStatus(result) != PGRES_COMMAND_OK)
- qWarning("Unable to free statement: %s", PQerrorMessage(drv_d_func()->connection));
- PQclear(result);
+ if (PQresultStatus(result) != PGRES_COMMAND_OK)
+ qWarning("Unable to free statement: %s", PQerrorMessage(drv_d_func()->connection));
+ PQclear(result);
+ }
preparedStmtId.clear();
}
@@ -810,8 +812,8 @@ QSqlRecord QPSQLResult::record() const
return info;
int count = PQnfields(d->result);
+ QSqlField f;
for (int i = 0; i < count; ++i) {
- QSqlField f;
if (d->drv_d_func()->isUtf8)
f.setName(QString::fromUtf8(PQfname(d->result, i)));
else
@@ -831,6 +833,8 @@ QSqlRecord QPSQLResult::record() const
}
}
f.setTableName(tableName);
+ } else {
+ f.setTableName(QString());
}
int ptype = PQftype(d->result, i);
f.setType(qDecodePSQLType(ptype));
@@ -1074,8 +1078,10 @@ static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin)
return QPSQLDriver::Version10;
case 11:
return QPSQLDriver::Version11;
+ case 12:
+ return QPSQLDriver::Version12;
default:
- if (vMaj > 11)
+ if (vMaj > 12)
return QPSQLDriver::UnknownLaterVersion;
break;
}
@@ -1435,26 +1441,29 @@ QSqlRecord QPSQLDriver::record(const QString &tablename) const
schema = stripDelimiters(schema, QSqlDriver::TableName);
tbl = stripDelimiters(tbl, QSqlDriver::TableName);
- QString stmt = QStringLiteral("SELECT pg_attribute.attname, pg_attribute.atttypid::int, "
- "pg_attribute.attnotnull, pg_attribute.attlen, pg_attribute.atttypmod, "
- "pg_attrdef.adsrc "
- "FROM pg_class, pg_attribute "
- "LEFT JOIN pg_attrdef ON (pg_attrdef.adrelid = "
- "pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum) "
- "WHERE %1 "
- "AND pg_class.relname = '%2' "
- "AND pg_attribute.attnum > 0 "
- "AND pg_attribute.attrelid = pg_class.oid "
- "AND pg_attribute.attisdropped = false "
- "ORDER BY pg_attribute.attnum");
- if (schema.isEmpty())
- stmt = stmt.arg(QStringLiteral("pg_table_is_visible(pg_class.oid)"));
- else
- stmt = stmt.arg(QStringLiteral("pg_class.relnamespace = (SELECT oid FROM "
- "pg_namespace WHERE pg_namespace.nspname = '%1')").arg(schema));
+ const QString adsrc = protocol() < Version8
+ ? QStringLiteral("pg_attrdef.adsrc")
+ : QStringLiteral("pg_get_expr(pg_attrdef.adbin, pg_attrdef.adrelid)");
+ const QString nspname = schema.isEmpty()
+ ? QStringLiteral("pg_table_is_visible(pg_class.oid)")
+ : QStringLiteral("pg_class.relnamespace = (SELECT oid FROM "
+ "pg_namespace WHERE pg_namespace.nspname = '%1')").arg(schema);
+ const QString stmt =
+ QStringLiteral("SELECT pg_attribute.attname, pg_attribute.atttypid::int, "
+ "pg_attribute.attnotnull, pg_attribute.attlen, pg_attribute.atttypmod, "
+ "%1 "
+ "FROM pg_class, pg_attribute "
+ "LEFT JOIN pg_attrdef ON (pg_attrdef.adrelid = "
+ "pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum) "
+ "WHERE %2 "
+ "AND pg_class.relname = '%3' "
+ "AND pg_attribute.attnum > 0 "
+ "AND pg_attribute.attrelid = pg_class.oid "
+ "AND pg_attribute.attisdropped = false "
+ "ORDER BY pg_attribute.attnum").arg(adsrc, nspname, tbl);
QSqlQuery query(createResult());
- query.exec(stmt.arg(tbl));
+ query.exec(stmt);
while (query.next()) {
int len = query.value(3).toInt();
int precision = query.value(4).toInt();
@@ -1506,7 +1515,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
// this is safe since postgresql stores only the UTC value and not the timezone offset (only used
// while parsing), so we have correct behavior in both case of with timezone and without tz
r = QStringLiteral("TIMESTAMP WITH TIME ZONE ") + QLatin1Char('\'') +
- QLocale::c().toString(field.value().toDateTime().toUTC(), QStringLiteral("yyyy-MM-ddThh:mm:ss.zzz")) +
+ QLocale::c().toString(field.value().toDateTime().toUTC(), u"yyyy-MM-ddThh:mm:ss.zzz") +
QLatin1Char('Z') + QLatin1Char('\'');
} else {
r = nullStr();
@@ -1518,7 +1527,7 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const
case QVariant::Time:
#if QT_CONFIG(datestring)
if (field.value().toTime().isValid()) {
- r = QLatin1Char('\'') + field.value().toTime().toString(QLatin1String("hh:mm:ss.zzz")) + QLatin1Char('\'');
+ r = QLatin1Char('\'') + field.value().toTime().toString(u"hh:mm:ss.zzz") + QLatin1Char('\'');
} else
#endif
{
diff --git a/src/plugins/sqldrivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h
index 99e0b5f60f..9ac1fb50d7 100644
--- a/src/plugins/sqldrivers/psql/qsql_psql_p.h
+++ b/src/plugins/sqldrivers/psql/qsql_psql_p.h
@@ -93,6 +93,7 @@ public:
Version9_6 = 22,
Version10 = 23,
Version11 = 24,
+ Version12 = 25,
UnknownLaterVersion = 100000
};
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index f1a003ddcd..001bd673fc 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -531,7 +531,7 @@ bool QSQLiteResult::exec()
}
case QVariant::Time: {
const QTime time = value.toTime();
- const QString str = time.toString(QStringViewLiteral("hh:mm:ss.zzz"));
+ const QString str = time.toString(u"hh:mm:ss.zzz");
res = sqlite3_bind_text16(d->stmt, i + 1, str.utf16(),
str.size() * sizeof(ushort), SQLITE_TRANSIENT);
break;
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h b/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h
index 61be4c937f..c7952bca9a 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite_p.h
@@ -72,8 +72,8 @@ class Q_EXPORT_SQLDRIVER_SQLITE QSQLiteDriver : public QSqlDriver
Q_OBJECT
friend class QSQLiteResultPrivate;
public:
- explicit QSQLiteDriver(QObject *parent = 0);
- explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = 0);
+ explicit QSQLiteDriver(QObject *parent = nullptr);
+ explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = nullptr);
~QSQLiteDriver();
bool hasFeature(DriverFeature f) const override;
bool open(const QString & db,
diff --git a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
index 390f05c7aa..b7bcd044ab 100644
--- a/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
+++ b/src/plugins/sqldrivers/sqlite2/qsql_sqlite2.cpp
@@ -43,7 +43,6 @@
#include <qvariant.h>
#include <qdatetime.h>
#include <qfile.h>
-#include <qregexp.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
diff --git a/src/plugins/sqldrivers/sqlite2/smain.cpp b/src/plugins/sqldrivers/sqlite2/smain.cpp
index 3a5734f8c9..7d971d6e5a 100644
--- a/src/plugins/sqldrivers/sqlite2/smain.cpp
+++ b/src/plugins/sqldrivers/sqlite2/smain.cpp
@@ -43,6 +43,7 @@
QT_BEGIN_NAMESPACE
+// ### Qt6: remove, obsolete since 5.14
class QSQLite2DriverPlugin : public QSqlDriverPlugin
{
Q_OBJECT
diff --git a/src/plugins/sqldrivers/tds/main.cpp b/src/plugins/sqldrivers/tds/main.cpp
index 4aa1444608..18efb22ea4 100644
--- a/src/plugins/sqldrivers/tds/main.cpp
+++ b/src/plugins/sqldrivers/tds/main.cpp
@@ -50,6 +50,7 @@
QT_BEGIN_NAMESPACE
+// ### Qt6: remove, obsolete since 4.7
class QTDSDriverPlugin : public QSqlDriverPlugin
{
Q_OBJECT
diff --git a/src/plugins/sqldrivers/tds/qsql_tds.cpp b/src/plugins/sqldrivers/tds/qsql_tds.cpp
index ad95b097ef..9c8d242028 100644
--- a/src/plugins/sqldrivers/tds/qsql_tds.cpp
+++ b/src/plugins/sqldrivers/tds/qsql_tds.cpp
@@ -813,7 +813,7 @@ QString QTDSDriver::formatValue(const QSqlField &field,
r = QLatin1String("NULL");
else if (field.type() == QVariant::DateTime) {
if (field.value().toDateTime().isValid()){
- r = field.value().toDateTime().toString(QLatin1String("yyyyMMdd hh:mm:ss"));
+ r = field.value().toDateTime().toString(u"yyyyMMdd hh:mm:ss");
r.prepend(QLatin1String("'"));
r.append(QLatin1String("'"));
} else
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 62f089b654..610329a350 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -50,92 +50,30 @@
#define QMAC_QAQUASTYLE_SIZE_CONSTRAIN
//#define DEBUG_SIZE_CONSTRAINT
-#include <private/qcore_mac_p.h>
-#if QT_CONFIG(tabbar)
-#include <private/qtabbar_p.h>
-#endif
-#include <private/qpainter_p.h>
-#include <qapplication.h>
-#include <qbitmap.h>
-#if QT_CONFIG(combobox)
-#include <private/qcombobox_p.h>
-#include <qcombobox.h>
-#endif
-#if QT_CONFIG(dialogbuttonbox)
-#include <qdialogbuttonbox.h>
-#endif
-#if QT_CONFIG(dockwidget)
-#include <qdockwidget.h>
-#endif
-#include <qevent.h>
-#include <qfocusframe.h>
-#include <qformlayout.h>
-#include <qgroupbox.h>
-#include <qhash.h>
-#include <qheaderview.h>
-#if QT_CONFIG(lineedit)
-#include <qlineedit.h>
-#endif
-#if QT_CONFIG(mainwindow)
-#include <qmainwindow.h>
-#endif
+#include <QtCore/qoperatingsystemversion.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qvarlengtharray.h>
+
+#include <QtCore/private/qcore_mac_p.h>
+
+#include <QtGui/private/qcoregraphics_p.h>
+#include <QtGui/qpa/qplatformfontdatabase.h>
+#include <QtGui/qpa/qplatformtheme.h>
+
+#include <QtWidgets/private/qstyleanimation_p.h>
+
#if QT_CONFIG(mdiarea)
-#include <qmdisubwindow.h>
-#endif
-#if QT_CONFIG(menubar)
-#include <qmenubar.h>
-#endif
-#include <qpaintdevice.h>
-#include <qpainter.h>
-#include <qpixmapcache.h>
-#include <qpointer.h>
-#if QT_CONFIG(progressbar)
-#include <qprogressbar.h>
-#endif
-#if QT_CONFIG(pushbutton)
-#include <qpushbutton.h>
-#endif
-#include <qradiobutton.h>
-#if QT_CONFIG(rubberband)
-#include <qrubberband.h>
+#include <QtWidgets/qmdisubwindow.h>
#endif
#if QT_CONFIG(scrollbar)
-#include <qscrollbar.h>
-#endif
-#if QT_CONFIG(sizegrip)
-#include <qsizegrip.h>
-#endif
-#include <qstyleoption.h>
-#include <qtoolbar.h>
-#if QT_CONFIG(toolbutton)
-#include <qtoolbutton.h>
+#include <QtWidgets/qscrollbar.h>
#endif
-#if QT_CONFIG(treeview)
-#include <qtreeview.h>
-#endif
-#if QT_CONFIG(tableview)
-#include <qtableview.h>
+#if QT_CONFIG(tabbar)
+#include <QtWidgets/private/qtabbar_p.h>
#endif
-#include <qoperatingsystemversion.h>
#if QT_CONFIG(wizard)
-#include <qwizard.h>
-#endif
-#include <qdebug.h>
-#if QT_CONFIG(datetimeedit)
-#include <qdatetimeedit.h>
+#include <QtWidgets/qwizard.h>
#endif
-#include <qmath.h>
-#include <QtWidgets/qgraphicsproxywidget.h>
-#if QT_CONFIG(graphicsview)
-#include <QtWidgets/qgraphicsview.h>
-#endif
-#include <QtCore/qvariant.h>
-#include <QtCore/qvarlengtharray.h>
-#include <private/qstylehelper_p.h>
-#include <private/qstyleanimation_p.h>
-#include <qpa/qplatformfontdatabase.h>
-#include <qpa/qplatformtheme.h>
-#include <QtGui/private/qcoregraphics_p.h>
#include <cmath>
@@ -297,6 +235,7 @@ static QLinearGradient titlebarGradientInactive()
return qt_mac_applicationIsInDarkMode() ? darkGradient : lightGradient;
}
+#if QT_CONFIG(tabwidget)
static void clipTabBarFrame(const QStyleOption *option, const QMacStyle *style, CGContextRef ctx)
{
Q_ASSERT(option);
@@ -316,6 +255,7 @@ static void clipTabBarFrame(const QStyleOption *option, const QMacStyle *style,
CGContextClipToRects(ctx, &cgRects[0], size_t(cgRects.size()));
}
}
+#endif
static const QColor titlebarSeparatorLineActive(111, 111, 111);
static const QColor titlebarSeparatorLineInactive(131, 131, 131);
@@ -340,6 +280,7 @@ static const qreal titleBarButtonSpacing = 8;
// hovered: tab is hovered
bool isDarkMode() { return qt_mac_applicationIsInDarkMode(); }
+#if QT_CONFIG(tabbar)
static const QColor lightTabBarTabBackgroundActive(190, 190, 190);
static const QColor darkTabBarTabBackgroundActive(38, 38, 38);
static const QColor tabBarTabBackgroundActive() { return isDarkMode() ? darkTabBarTabBackgroundActive : lightTabBarTabBackgroundActive; }
@@ -385,6 +326,21 @@ static const QColor tabBarCloseButtonCrossSelected(115, 115, 115);
static const int closeButtonSize = 14;
static const qreal closeButtonCornerRadius = 2.0;
+#endif // QT_CONFIG(tabbar)
+
+#ifndef QT_NO_ACCESSIBILITY // This ifdef to avoid "unused function" warning.
+QBrush brushForToolButton(bool isOnKeyWindow)
+{
+ // When a toolbutton in a toolbar is in the 'ON' state, we draw a
+ // partially transparent background. The colors must be different
+ // for 'Aqua' and 'DarkAqua' appearances though.
+ if (isDarkMode())
+ return isOnKeyWindow ? QColor(73, 73, 73, 100) : QColor(56, 56, 56, 100);
+
+ return isOnKeyWindow ? QColor(0, 0, 0, 28) : QColor(0, 0, 0, 21);
+}
+#endif // QT_NO_ACCESSIBILITY
+
static const int headerSectionArrowHeight = 6;
static const int headerSectionSeparatorInset = 2;
@@ -560,6 +516,7 @@ static bool isInMacUnifiedToolbarArea(QWindow *window, int windowY)
}
+#if QT_CONFIG(tabbar)
static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pressed, bool documentMode)
{
p->setRenderHints(QPainter::Antialiasing);
@@ -597,7 +554,6 @@ static void drawTabCloseButton(QPainter *p, bool hover, bool selected, bool pres
p->drawLine(margin, height - margin, width - margin, margin);
}
-#if QT_CONFIG(tabbar)
QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect)
{
const auto tabDirection = QMacStylePrivate::tabDirection(shape);
@@ -613,10 +569,10 @@ QRect rotateTabPainter(QPainter *p, QTabBar::Shape shape, QRect tabRect)
newRot = -90;
}
tabRect.setRect(0, 0, tabRect.height(), tabRect.width());
- QMatrix m;
- m.translate(newX, newY);
- m.rotate(newRot);
- p->setMatrix(m, true);
+ QTransform transform;
+ transform.translate(newX, newY);
+ transform.rotate(newRot);
+ p->setTransform(transform, true);
}
return tabRect;
}
@@ -919,8 +875,10 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QLineEdit *>(widg))
ct = QStyle::CT_LineEdit;
#endif
+#if QT_CONFIG(itemviews)
else if (qobject_cast<const QHeaderView *>(widg))
ct = QStyle::CT_HeaderSection;
+#endif
#if QT_CONFIG(menubar)
else if (qobject_cast<const QMenuBar *>(widg))
ct = QStyle::CT_MenuBar;
@@ -2221,10 +2179,12 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
int ret = 0;
switch (metric) {
+#if QT_CONFIG(tabbar)
case PM_TabCloseIndicatorWidth:
case PM_TabCloseIndicatorHeight:
ret = closeButtonSize;
break;
+#endif
case PM_ToolBarIconSize:
ret = proxy()->pixelMetric(PM_LargeIconSize);
break;
@@ -2348,11 +2308,11 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
}
break;
case PM_SmallIconSize:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16., opt));
break;
case PM_LargeIconSize:
- ret = int(QStyleHelper::dpiScaled(32.));
+ ret = int(QStyleHelper::dpiScaled(32., opt));
break;
case PM_IconViewIconSize:
@@ -2381,10 +2341,12 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 16;
break;
case QStyleHelper::SizeDefault:
+#if QT_CONFIG(tabbar)
const QStyleOptionTab *tb = qstyleoption_cast<const QStyleOptionTab *>(opt);
if (tb && tb->documentMode)
ret = 30;
else
+#endif
ret = QCommonStyle::pixelMetric(metric, opt, widget);
break;
}
@@ -2895,9 +2857,11 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = [NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay;
}
break;
+#if QT_CONFIG(itemviews)
case SH_ItemView_ScrollMode:
ret = QAbstractItemView::ScrollPerPixel;
break;
+#endif
case SH_TitleBar_ShowToolTipsOnButtons:
// min/max/close buttons on windows don't show tool tips
ret = false;
@@ -3001,24 +2965,24 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
}
#endif
- QMatrix matrix;
- matrix.translate(opt->rect.center().x() + xOffset, opt->rect.center().y() + 2);
+ QTransform transform;
+ transform.translate(opt->rect.center().x() + xOffset, opt->rect.center().y() + 2);
QPainterPath path;
switch(pe) {
default:
case PE_IndicatorArrowDown:
break;
case PE_IndicatorArrowUp:
- matrix.rotate(180);
+ transform.rotate(180);
break;
case PE_IndicatorArrowLeft:
- matrix.rotate(90);
+ transform.rotate(90);
break;
case PE_IndicatorArrowRight:
- matrix.rotate(-90);
+ transform.rotate(-90);
break;
}
- p->setMatrix(matrix);
+ p->setTransform(transform);
path.moveTo(-halfSize, -halfSize * 0.5);
path.lineTo(0.0, halfSize * 0.5);
@@ -3039,7 +3003,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
p->restore();
return;
}
-
+#if QT_CONFIG(tabwidget)
QRegion region(tbb->rect);
region -= tbb->tabBarRect;
p->save();
@@ -3063,6 +3027,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
}
proxy()->drawPrimitive(PE_FrameTabWidget, &twf, p, w);
p->restore();
+#endif
}
break;
#endif
@@ -3109,8 +3074,10 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
needTranslation = true;
}
d->drawNSViewInRect(box, adjustedRect, p, ^(CGContextRef ctx, const CGRect &rect) {
+#if QT_CONFIG(tabwidget)
if (QTabWidget *tabWidget = qobject_cast<QTabWidget *>(opt->styleObject))
clipTabBarFrame(opt, this, ctx);
+#endif
CGContextTranslateCTM(ctx, 0, rect.origin.y + rect.size.height);
CGContextScaleCTM(ctx, 1, -1);
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSMojave
@@ -3404,6 +3371,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
} break;
case PE_FrameStatusBarItem:
break;
+#if QT_CONFIG(tabbar)
case PE_IndicatorTabClose: {
// Make close button visible only on the hovered tab.
QTabBar *tabBar = qobject_cast<QTabBar*>(w->parentWidget());
@@ -3428,6 +3396,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
}
}
} break;
+#endif // QT_CONFIG(tabbar)
case PE_PanelStatusBar: {
// Fill the status bar with the titlebar gradient.
QLinearGradient linearGrad;
@@ -3507,6 +3476,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
{
Q_D(const QMacStyle);
const AppearanceSync sync;
+ const QMacAutoReleasePool pool;
QMacCGContext cg(p);
QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr;
d->resolveCurrentNSView(window);
@@ -4371,7 +4341,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
break;
case CE_ProgressBarContents:
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
- QMacAutoReleasePool pool;
const bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0);
const bool vertical = pb->orientation == Qt::Vertical;
const bool inverted = pb->invertedAppearance;
@@ -4598,6 +4567,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
const int controlSize = getControlSize(opt, widget);
switch (sr) {
+#if QT_CONFIG(itemviews)
case SE_ItemViewItemText:
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
int fw = proxy()->pixelMetric(PM_FocusFrameHMargin, opt, widget);
@@ -4607,6 +4577,7 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt,
rect.adjust(-fw, 0, 0, 0);
}
break;
+#endif
case SE_ToolBoxTabContents:
rect = QCommonStyle::subElementRect(sr, opt, widget);
break;
@@ -5317,9 +5288,20 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
}
d->drawNSViewInRect(slider, opt->rect, p, ^(CGContextRef ctx, const CGRect &rect) {
- if (isHorizontal && sl->upsideDown) {
- CGContextTranslateCTM(ctx, rect.size.width, 0);
- CGContextScaleCTM(ctx, -1, 1);
+
+ // Since the GC is flipped, upsideDown means *not* inverted when vertical.
+ const bool verticalFlip = !isHorizontal && !sl->upsideDown; // FIXME: && !isSierraOrLater
+
+ if (isHorizontal) {
+ if (sl->upsideDown) {
+ CGContextTranslateCTM(ctx, rect.size.width, rect.origin.y);
+ CGContextScaleCTM(ctx, -1, 1);
+ } else {
+ CGContextTranslateCTM(ctx, 0, rect.origin.y);
+ }
+ } else if (verticalFlip) {
+ CGContextTranslateCTM(ctx, rect.origin.x, rect.size.height);
+ CGContextScaleCTM(ctx, 1, -1);
}
if (hasDoubleTicks) {
@@ -5330,9 +5312,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
CGContextTranslateCTM(ctx, 1, 0);
}
- // Since the GC is flipped, upsideDown means *not* inverted when vertical.
- const bool verticalFlip = !isHorizontal && !sl->upsideDown; // FIXME: && !isSierraOrLater
-
#if 0
// FIXME: Sadly, this part doesn't work. It seems to somehow polute the
// NSSlider's internal state and, when we need to use the "else" part,
@@ -5396,9 +5375,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
// This ain't HIG kosher: force round knob look.
if (hasDoubleTicks)
slider.numberOfTickMarks = 0;
- // Draw the knob in the symmetrical position instead of flipping.
- if (verticalFlip)
- slider.intValue = slider.maxValue - slider.intValue + slider.minValue;
[cell drawKnob];
}
}
@@ -5563,7 +5539,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
const auto ct = d->windowButtonCocoaControl(sc);
const auto cw = QMacStylePrivate::CocoaControl(ct, QStyleHelper::SizeLarge);
auto *wb = static_cast<NSButton *>(d->cocoaControl(cw));
- wb.enabled = (sc & titlebar->subControls);
+ wb.enabled = (sc & titlebar->subControls) && isActive;
[wb highlight:(titlebar->state & State_Sunken) && (sc & titlebar->activeSubControls)];
Q_UNUSED(isHovered); // FIXME No public API for this
@@ -5641,8 +5617,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
if (view)
isKey = [view.window isKeyWindow];
- QBrush brush(isKey ? QColor(0, 0, 0, 28)
- : QColor(0, 0, 0, 21));
+ QBrush brush(brushForToolButton(isKey));
QPainterPath path;
path.addRoundedRect(QRectF(tb->rect.x(), tb->rect.y(), tb->rect.width(), tb->rect.height() + 4), 4, 4);
p->setRenderHint(QPainter::Antialiasing);
@@ -6436,12 +6411,14 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = sz.expandedTo(QSize(sz.width(), minimumSize));
}
break;
+#if QT_CONFIG(itemviews)
case CT_ItemViewItem:
if (const QStyleOptionViewItem *vopt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
sz = QCommonStyle::sizeFromContents(ct, vopt, csz, widget);
sz.setHeight(sz.height() + 2);
}
break;
+#endif
default:
sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 6b3f525adc..d6af18f01f 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -41,98 +41,105 @@
#ifndef QMACSTYLE_MAC_P_P_H
#define QMACSTYLE_MAC_P_P_H
-#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <QtWidgets/private/qcommonstyle_p.h>
#include "qmacstyle_mac_p.h"
-#include <private/qapplication_p.h>
+
+#include <QtCore/qdebug.h>
+#include <QtCore/qhash.h>
+#include <QtCore/qmap.h>
+#include <QtCore/qmath.h>
+#include <QtCore/qpair.h>
+#include <QtCore/qpointer.h>
+#include <QtCore/qtextstream.h>
+#include <QtCore/qvector.h>
+
+#include <QtGui/private/qpainter_p.h>
+
+#include <QtGui/qbitmap.h>
+#include <QtGui/qevent.h>
+#include <QtGui/qpaintdevice.h>
+#include <QtGui/qpainter.h>
+#include <QtGui/qpixmapcache.h>
+
+#include <QtWidgets/private/qapplication_p.h>
+#include <QtWidgets/private/qcommonstyle_p.h>
+#include <QtWidgets/private/qstylehelper_p.h>
+
+#include <QtWidgets/qapplication.h>
+#include <QtWidgets/qfocusframe.h>
+#include <QtWidgets/qformlayout.h>
+#include <QtWidgets/qlayout.h>
+#include <QtWidgets/qstyleoption.h>
+#include <QtWidgets/qtextedit.h>
+
+#if QT_CONFIG(checkbox)
+#include <QtWidgets/qcheckbox.h>
+#endif
#if QT_CONFIG(combobox)
-#include <private/qcombobox_p.h>
+#include <QtWidgets/private/qcombobox_p.h>
+#include <QtWidgets/qcombobox.h>
#endif
-#include <private/qpainter_p.h>
-#include <private/qstylehelper_p.h>
-#include <qapplication.h>
-#include <qbitmap.h>
-#if QT_CONFIG(checkbox)
-#include <qcheckbox.h>
+#if QT_CONFIG(datetimeedit)
+#include <QtWidgets/qdatetimeedit.h>
#endif
-#include <qcombobox.h>
#if QT_CONFIG(dialogbuttonbox)
-#include <qdialogbuttonbox.h>
+#include <QtWidgets/qdialogbuttonbox.h>
#endif
#if QT_CONFIG(dockwidget)
-#include <qdockwidget.h>
+#include <QtWidgets/qdockwidget.h>
+#endif
+#if QT_CONFIG(graphicsview)
+#include <QtWidgets/qgraphicsproxywidget.h>
+#include <QtWidgets/qgraphicsview.h>
#endif
-#include <qevent.h>
-#include <qfocusframe.h>
-#include <qformlayout.h>
#if QT_CONFIG(groupbox)
-#include <qgroupbox.h>
+#include <QtWidgets/qgroupbox.h>
+#endif
+#if QT_CONFIG(itemviews)
+#include <QtWidgets/qheaderview.h>
#endif
-#include <qhash.h>
-#include <qheaderview.h>
-#include <qlayout.h>
#if QT_CONFIG(lineedit)
-#include <qlineedit.h>
+#include <QtWidgets/qlineedit.h>
#endif
#if QT_CONFIG(listview)
-#include <qlistview.h>
+#include <QtWidgets/qlistview.h>
#endif
#if QT_CONFIG(mainwindow)
-#include <qmainwindow.h>
+#include <QtWidgets/qmainwindow.h>
#endif
-#include <qmap.h>
#if QT_CONFIG(menubar)
-#include <qmenubar.h>
+#include <QtWidgets/qmenubar.h>
#endif
-#include <qpaintdevice.h>
-#include <qpainter.h>
-#include <qpixmapcache.h>
-#include <qpointer.h>
#if QT_CONFIG(progressbar)
-#include <qprogressbar.h>
+#include <QtWidgets/qprogressbar.h>
#endif
#if QT_CONFIG(pushbutton)
-#include <qpushbutton.h>
+#include <QtWidgets/qpushbutton.h>
#endif
-#include <qradiobutton.h>
+#include <QtWidgets/qradiobutton.h>
#if QT_CONFIG(rubberband)
-#include <qrubberband.h>
+#include <QtWidgets/qrubberband.h>
#endif
#if QT_CONFIG(sizegrip)
-#include <qsizegrip.h>
+#include <QtWidgets/qsizegrip.h>
#endif
#if QT_CONFIG(spinbox)
-#include <qspinbox.h>
+#include <QtWidgets/qspinbox.h>
#endif
#if QT_CONFIG(splitter)
-#include <qsplitter.h>
+#include <QtWidgets/qsplitter.h>
+#endif
+#if QT_CONFIG(tableview)
+#include <QtWidgets/qtableview.h>
#endif
-#include <qstyleoption.h>
-#include <qtextedit.h>
-#include <qtextstream.h>
#if QT_CONFIG(toolbar)
-#include <qtoolbar.h>
+#include <QtWidgets/qtoolbar.h>
#endif
#if QT_CONFIG(toolbutton)
-#include <qtoolbutton.h>
+#include <QtWidgets/qtoolbutton.h>
#endif
#if QT_CONFIG(treeview)
-#include <qtreeview.h>
-#endif
-#if QT_CONFIG(tableview)
-#include <qtableview.h>
+#include <QtWidgets/qtreeview.h>
#endif
-#include <qdebug.h>
-#if QT_CONFIG(datetimeedit)
-#include <qdatetimeedit.h>
-#endif
-#include <qmath.h>
-#include <qpair.h>
-#include <qvector.h>
-#include <QtWidgets/qgraphicsproxywidget.h>
-#include <QtWidgets/qgraphicsview.h>
-
-
//
// W A R N I N G
diff --git a/src/plugins/styles/windowsvista/main.cpp b/src/plugins/styles/windowsvista/main.cpp
index d5048e45b7..5e7bcf5e6e 100644
--- a/src/plugins/styles/windowsvista/main.cpp
+++ b/src/plugins/styles/windowsvista/main.cpp
@@ -48,7 +48,7 @@ class QWindowsVistaStylePlugin : public QStylePlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "windowsvistastyle.json")
public:
- QStyle *create(const QString &key);
+ QStyle *create(const QString &key) override;
};
QStyle *QWindowsVistaStylePlugin::create(const QString &key)
@@ -56,7 +56,7 @@ QStyle *QWindowsVistaStylePlugin::create(const QString &key)
if (key.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) == 0)
return new QWindowsVistaStyle();
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index 8a3ae17b1d..e213d65946 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -44,7 +44,6 @@
#include <qwindow.h>
#include <private/qstyleanimation_p.h>
#include <private/qstylehelper_p.h>
-#include <private/qapplication_p.h>
#include <qpa/qplatformnativeinterface.h>
QT_BEGIN_NAMESPACE
@@ -84,16 +83,14 @@ static const int windowsRightBorder = 15; // right border on windows
*/
bool QWindowsVistaStylePrivate::useVista()
{
- return (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
- && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))
- && QWindowsVistaStylePrivate::useXP();
+ return QWindowsVistaStylePrivate::useXP();
}
/* \internal
Checks and returns the style object
*/
inline QObject *styleObject(const QStyleOption *option) {
- return option ? option->styleObject : 0;
+ return option ? option->styleObject : nullptr;
}
/* \internal
@@ -118,7 +115,7 @@ static inline QImage createAnimationBuffer(const QStyleOption *option, const QWi
Used by animations to clone a styleoption and shift its offset
*/
QStyleOption *clonedAnimationStyleOption(const QStyleOption*option) {
- QStyleOption *styleOption = 0;
+ QStyleOption *styleOption = nullptr;
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider*>(option))
styleOption = new QStyleOptionSlider(*slider);
else if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox*>(option))
@@ -299,7 +296,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
int oldState = styleObject->property("_q_stylestate").toInt();
oldRect = styleObject->property("_q_stylerect").toRect();
newRect = option->rect;
- styleObject->setProperty("_q_stylestate", (int)option->state);
+ styleObject->setProperty("_q_stylestate", int(option->state));
styleObject->setProperty("_q_stylerect", option->rect);
bool doTransition = oldState &&
@@ -317,7 +314,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (doTransition) {
QStyleOption *styleOption = clonedAnimationStyleOption(option);
- styleOption->state = (QStyle::State)oldState;
+ styleOption->state = QStyle::State(oldState);
QWindowsVistaAnimation *anim = qobject_cast<QWindowsVistaAnimation *>(d->animation(styleObject));
QWindowsVistaTransition *t = new QWindowsVistaTransition(styleObject);
@@ -342,7 +339,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
// The end state of the transition is simply the result we would have painted
// if the style was not animated.
- styleOption->styleObject = 0;
+ styleOption->styleObject = nullptr;
styleOption->state = option->state;
proxy()->drawPrimitive(element, styleOption, &endPainter, widget);
@@ -357,7 +354,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
//translate state flags to UXTHEME states :
if (element == PE_FrameLineEdit) {
- theme = OpenThemeData(0, L"Edit");
+ theme = OpenThemeData(nullptr, L"Edit");
partId = EP_EDITBORDER_NOSCROLL;
if (oldState & State_MouseOver)
@@ -375,7 +372,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
toState = ETS_NORMAL;
} else {
- theme = OpenThemeData(0, L"Button");
+ theme = OpenThemeData(nullptr, L"Button");
if (element == PE_IndicatorRadioButton)
partId = BP_RADIOBUTTON;
else if (element == PE_IndicatorCheckBox)
@@ -391,7 +388,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
if (theme
&& SUCCEEDED(GetThemeTransitionDuration(theme, partId, fromState, toState,
TMT_TRANSITIONDURATIONS, &duration))) {
- t->setDuration(duration);
+ t->setDuration(int(duration));
}
t->setStartTime(QTime::currentTime());
@@ -536,7 +533,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
else if (state & State_MouseOver)
stateId = EBS_HOT;
- XPThemeData theme(0, painter, QWindowsXPStylePrivate::EditTheme,
+ XPThemeData theme(nullptr, painter, QWindowsXPStylePrivate::EditTheme,
partId, stateId, rect);
if (!theme.isValid()) {
QWindowsStyle::drawPrimitive(element, option, painter, widget);
@@ -583,27 +580,26 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
p->drawRect(option->rect.adjusted(0, 0, -1, -1));
p->setPen(oldPen);
return;
- } else {
- int stateId = ETS_NORMAL;
- if (!(state & State_Enabled))
- stateId = ETS_DISABLED;
- else if (state & State_ReadOnly)
- stateId = ETS_READONLY;
- else if (state & State_MouseOver)
- stateId = ETS_HOT;
- else if (state & State_HasFocus)
- stateId = ETS_SELECTED;
- XPThemeData theme(widget, painter,
- QWindowsXPStylePrivate::EditTheme,
- EP_EDITBORDER_NOSCROLL, stateId, option->rect);
- theme.noContent = true;
- painter->save();
- QRegion clipRegion = option->rect;
- clipRegion -= option->rect.adjusted(2, 2, -2, -2);
- painter->setClipRegion(clipRegion);
- d->drawBackground(theme);
- painter->restore();
}
+ int stateId = ETS_NORMAL;
+ if (!(state & State_Enabled))
+ stateId = ETS_DISABLED;
+ else if (state & State_ReadOnly)
+ stateId = ETS_READONLY;
+ else if (state & State_MouseOver)
+ stateId = ETS_HOT;
+ else if (state & State_HasFocus)
+ stateId = ETS_SELECTED;
+ XPThemeData theme(widget, painter,
+ QWindowsXPStylePrivate::EditTheme,
+ EP_EDITBORDER_NOSCROLL, stateId, option->rect);
+ theme.noContent = true;
+ painter->save();
+ QRegion clipRegion = option->rect;
+ clipRegion -= option->rect.adjusted(2, 2, -2, -2);
+ painter->setClipRegion(clipRegion);
+ d->drawBackground(theme);
+ painter->restore();
}
break;
@@ -726,7 +722,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
d->drawBackground(theme);
} else {
QWindowsXPStyle::drawPrimitive(PE_PanelItemViewItem, option, painter, widget);
- break;;
+ break;
}
QPixmapCache::insert(key, pixmap);
}
@@ -772,7 +768,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
case PE_Widget:
{
#if QT_CONFIG(dialogbuttonbox)
- const QDialogButtonBox *buttonBox = 0;
+ const QDialogButtonBox *buttonBox = nullptr;
if (qobject_cast<const QMessageBox *> (widget))
buttonBox = widget->findChild<const QDialogButtonBox *>(QLatin1String("qt_msgbox_buttonbox"));
@@ -846,7 +842,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
int oldState = styleObject->property("_q_stylestate").toInt();
oldRect = styleObject->property("_q_stylerect").toRect();
newRect = option->rect;
- styleObject->setProperty("_q_stylestate", (int)option->state);
+ styleObject->setProperty("_q_stylestate", int(option->state));
styleObject->setProperty("_q_stylerect", option->rect);
bool wasDefault = false;
@@ -872,7 +868,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
QWindowsVistaTransition *t = new QWindowsVistaTransition(styleObject);
QWindowsVistaAnimation *anim = qobject_cast<QWindowsVistaAnimation *>(d->animation(styleObject));
QStyleOption *styleOption = clonedAnimationStyleOption(option);
- styleOption->state = (QStyle::State)oldState;
+ styleOption->state = QStyle::State(oldState);
QImage startImage = createAnimationBuffer(option, widget);
QPainter startPainter(&startImage);
@@ -894,12 +890,12 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
DWORD duration = 0;
- const HTHEME theme = OpenThemeData(0, L"Button");
+ const HTHEME theme = OpenThemeData(nullptr, L"Button");
int fromState = buttonStateId(oldState, BP_PUSHBUTTON);
int toState = buttonStateId(option->state, BP_PUSHBUTTON);
if (GetThemeTransitionDuration(theme, BP_PUSHBUTTON, fromState, toState, TMT_TRANSITIONDURATIONS, &duration) == S_OK)
- t->setDuration(duration);
+ t->setDuration(int(duration));
else
t->setDuration(0);
t->setStartTime(QTime::currentTime());
@@ -985,16 +981,16 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (btn->features & QStyleOptionButton::HasMenu) {
int mbiw = 0, mbih = 0;
- XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ToolBarTheme,
+ XPThemeData theme(widget, nullptr, QWindowsXPStylePrivate::ToolBarTheme,
TP_DROPDOWNBUTTON);
if (theme.isValid()) {
- const QSizeF size = theme.size() * QStyleHelper::dpiScaled(1);
+ const QSizeF size = theme.size() * QStyleHelper::dpiScaled(1, option);
if (!size.isEmpty()) {
mbiw = qRound(size.width());
mbih = qRound(size.height());
}
}
- QRect ir = subElementRect(SE_PushButtonContents, option, 0);
+ QRect ir = subElementRect(SE_PushButtonContents, option, nullptr);
QStyleOptionButton newBtn = *btn;
newBtn.rect = QStyle::visualRect(option->direction, option->rect,
QRect(ir.right() - mbiw - 2,
@@ -1139,7 +1135,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
QPalette::ColorRole textRole = disabled ? QPalette::Text : QPalette::ButtonText;
QPixmap pix = mbi->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, option, widget), QIcon::Normal);
- uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine;
+ int alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine;
if (!proxy()->styleHint(SH_UnderlineShortcut, mbi, widget))
alignment |= Qt::TextHideMnemonic;
@@ -1179,7 +1175,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
int checkcol = qRound(qreal(25) * factor);
const int gutterWidth = qRound(qreal(3) * factor);
{
- XPThemeData theme(widget, 0, QWindowsXPStylePrivate::MenuTheme,
+ XPThemeData theme(widget, nullptr, QWindowsXPStylePrivate::MenuTheme,
MENU_POPUPCHECKBACKGROUND, MBI_HOT);
XPThemeData themeSize = theme;
themeSize.partId = MENU_POPUPCHECK;
@@ -1396,7 +1392,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
int mw = proxy()->pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, widget);
int fw = proxy()->pixelMetric(PM_DockWidgetFrameWidth, dwOpt, widget);
const QDockWidget *dw = qobject_cast<const QDockWidget *>(widget);
- bool isFloating = dw != 0 && dw->isFloating();
+ bool isFloating = dw && dw->isFloating();
QRect r = option->rect.adjusted(0, 2, -1, -3);
QRect titleRect = r;
@@ -1413,7 +1409,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (isFloating) {
titleRect.adjust(0, -fw, 0, 0);
- if (widget != 0 && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey())
+ if (widget && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey())
titleRect.adjust(titleRect.height() + mw, 0, 0, 0);
} else {
titleRect.adjust(mw, 0, 0, 0);
@@ -1519,8 +1515,8 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
int oldActiveControls = styleObject->property("_q_stylecontrols").toInt();
QRect oldRect = styleObject->property("_q_stylerect").toRect();
- styleObject->setProperty("_q_stylestate", (int)option->state);
- styleObject->setProperty("_q_stylecontrols", (int)option->activeSubControls);
+ styleObject->setProperty("_q_stylestate", int(option->state));
+ styleObject->setProperty("_q_stylecontrols", int(option->activeSubControls));
styleObject->setProperty("_q_stylerect", option->rect);
bool doTransition = ((state & State_Sunken) != (oldState & State_Sunken) ||
@@ -1564,8 +1560,8 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
// Draw transition source
if (!anim) {
- styleOption->state = (QStyle::State)oldState;
- styleOption->activeSubControls = (QStyle::SubControl)oldActiveControls;
+ styleOption->state = QStyle::State(oldState);
+ styleOption->activeSubControls = QStyle::SubControl(oldActiveControls);
proxy()->drawComplexControl(control, styleOption, &startPainter, widget);
} else {
anim->paint(&startPainter, option);
@@ -1816,7 +1812,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
// That however breaks with QtQuickControls where this results in transparent
// spinbox background, so if there's no "widget" passed (QtQuickControls case),
// let ftheme.noContent be false, which fixes the spinbox rendering in QQC
- ftheme.noContent = (widget != NULL);
+ ftheme.noContent = (widget != nullptr);
d->drawBackground(ftheme);
}
if (sub & SC_SpinBoxUp) {
@@ -1873,7 +1869,7 @@ QSize QWindowsVistaStyle::sizeFromContents(ContentsType type, const QStyleOption
sz = QWindowsXPStyle::sizeFromContents(type, option, size, widget);
int minimumHeight;
{
- XPThemeData theme(widget, 0,
+ XPThemeData theme(widget, nullptr,
QWindowsXPStylePrivate::MenuTheme,
MENU_POPUPCHECKBACKGROUND, MBI_HOT);
XPThemeData themeSize = theme;
@@ -1941,7 +1937,7 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption
case SE_PushButtonContents:
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
MARGINS borderSize;
- const HTHEME theme = OpenThemeData(widget ? QWindowsVistaStylePrivate::winId(widget) : 0, L"Button");
+ const HTHEME theme = OpenThemeData(widget ? QWindowsVistaStylePrivate::winId(widget) : nullptr, L"Button");
if (theme) {
int stateId = PBS_NORMAL;
if (!(option->state & State_Enabled))
@@ -1956,7 +1952,7 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption
int border = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget);
rect = option->rect.adjusted(border, border, -border, -border);
- if (SUCCEEDED(GetThemeMargins(theme, NULL, BP_PUSHBUTTON, stateId, TMT_CONTENTMARGINS, NULL, &borderSize))) {
+ if (SUCCEEDED(GetThemeMargins(theme, nullptr, BP_PUSHBUTTON, stateId, TMT_CONTENTMARGINS, nullptr, &borderSize))) {
rect.adjust(borderSize.cxLeftWidth, borderSize.cyTopHeight,
-borderSize.cxRightWidth, -borderSize.cyBottomHeight);
rect = visualRect(option->direction, option->rect, rect);
@@ -1974,7 +1970,7 @@ QRect QWindowsVistaStyle::subElementRect(SubElement element, const QStyleOption
int y = option->rect.y();
int margin = proxy()->pixelMetric(QStyle::PM_HeaderMargin, option, widget);
- XPThemeData theme(widget, 0,
+ XPThemeData theme(widget, nullptr,
QWindowsXPStylePrivate::HeaderTheme,
HP_HEADERSORTARROW, HSAS_SORTEDDOWN, option->rect);
@@ -2047,7 +2043,7 @@ static bool buttonVisible(const QStyle::SubControl sc, const QStyleOptionTitleBa
bool isMinimized = tb->titleBarState & Qt::WindowMinimized;
bool isMaximized = tb->titleBarState & Qt::WindowMaximized;
- const uint flags = tb->titleBarFlags;
+ const auto flags = tb->titleBarFlags;
bool retVal = false;
switch (sc) {
case QStyle::SC_TitleBarContextHelpButton:
@@ -2105,7 +2101,7 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co
if (option) {
if (QStyleHintReturnMask *mask = qstyleoption_cast<QStyleHintReturnMask*>(returnData)) {
ret = true;
- XPThemeData themeData(widget, 0,
+ XPThemeData themeData(widget, nullptr,
QWindowsXPStylePrivate::ToolTipTheme,
TTP_STANDARD, TTSS_NORMAL, option->rect);
mask->region = d->region(themeData);
@@ -2114,7 +2110,7 @@ int QWindowsVistaStyle::styleHint(StyleHint hint, const QStyleOption *option, co
break;
case SH_Table_GridLineColor:
if (option)
- ret = option->palette.color(QPalette::Base).darker(118).rgb();
+ ret = int(option->palette.color(QPalette::Base).darker(118).rgb());
else
ret = -1;
break;
@@ -2146,7 +2142,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
const int x = cb->rect.x(), y = cb->rect.y(), wi = cb->rect.width(), he = cb->rect.height();
const int margin = cb->frame ? 3 : 0;
const int bmarg = cb->frame ? 2 : 0;
- const int arrowWidth = qRound(QStyleHelper::dpiScaled(16));
+ const int arrowWidth = qRound(QStyleHelper::dpiScaled(16, option));
const int arrowButtonWidth = bmarg + arrowWidth;
const int xpos = x + wi - arrowButtonWidth;
@@ -2180,7 +2176,7 @@ QRect QWindowsVistaStyle::subControlRect(ComplexControl control, const QStyleOpt
const int height = tb->rect.height();
const int width = tb->rect.width();
const int buttonWidth =
- qRound(qreal(GetSystemMetrics(SM_CXSIZE)) * factor - QStyleHelper::dpiScaled(4));
+ qRound(qreal(GetSystemMetrics(SM_CXSIZE)) * factor - QStyleHelper::dpiScaled(4, option));
const int frameWidth = proxy()->pixelMetric(PM_MdiSubWindowFrameWidth, option, widget);
const bool sysmenuHint = (tb->titleBarFlags & Qt::WindowSystemMenuHint) != 0;
@@ -2281,7 +2277,7 @@ int QWindowsVistaStyle::pixelMetric(PixelMetric metric, const QStyleOption *opti
int ret = QWindowsVistaStylePrivate::fixedPixelMetric(metric);
if (ret != QWindowsStylePrivate::InvalidMetric)
- return int(QStyleHelper::dpiScaled(ret));
+ return int(QStyleHelper::dpiScaled(ret, option));
return QWindowsXPStyle::pixelMetric(metric, option, widget);
}
@@ -2325,7 +2321,7 @@ void QWindowsVistaStyle::polish(QWidget *widget)
//we do not have to care about unpolishing
widget->setContentsMargins(3, 0, 4, 0);
COLORREF bgRef;
- HTHEME theme = OpenThemeData(widget ? QWindowsVistaStylePrivate::winId(widget) : 0, L"TOOLTIP");
+ HTHEME theme = OpenThemeData(widget ? QWindowsVistaStylePrivate::winId(widget) : nullptr, L"TOOLTIP");
if (theme && SUCCEEDED(GetThemeColor(theme, TTP_STANDARD, TTSS_NORMAL, TMT_TEXTCOLOR, &bgRef))) {
QColor textColor = QColor::fromRgb(bgRef);
QPalette pal;
@@ -2465,7 +2461,7 @@ QIcon QWindowsVistaStyle::standardIcon(StandardPixmap standardIcon,
switch(standardIcon) {
case SP_CommandLink:
{
- XPThemeData theme(0, 0,
+ XPThemeData theme(nullptr, nullptr,
QWindowsXPStylePrivate::ButtonTheme,
BP_COMMANDLINKGLYPH, CMDLGS_NORMAL);
if (theme.isValid()) {
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
index d66b17e9f8..8fef9f9927 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
@@ -162,7 +162,7 @@ class QWindowsVistaAnimation : public QBlendStyleAnimation
public:
QWindowsVistaAnimation(Type type, QObject *target) : QBlendStyleAnimation(type, target) { }
- virtual bool isUpdateNeeded() const;
+ bool isUpdateNeeded() const override;
void paint(QPainter *painter, const QStyleOption *option);
};
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index 90026e5bf0..bf80138b32 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -117,7 +117,7 @@ static inline QBackingStore *backingStoreForWidget(const QWidget *widget)
if (const QWidget *topLevel = widget->nativeParentWidget())
if (QBackingStore *topLevelBackingStore = topLevel->backingStore())
return topLevelBackingStore;
- return 0;
+ return nullptr;
}
static inline HDC hdcForWidgetBackingStore(const QWidget *widget)
@@ -127,7 +127,7 @@ static inline HDC hdcForWidgetBackingStore(const QWidget *widget)
if (nativeInterface)
return static_cast<HDC>(nativeInterface->nativeResourceForBackingStore(QByteArrayLiteral("getDC"), backingStore));
}
- return 0;
+ return nullptr;
}
// Theme data helper ------------------------------------------------------------------------------
@@ -148,7 +148,7 @@ bool XPThemeData::isValid()
HTHEME XPThemeData::handle()
{
if (!QWindowsXPStylePrivate::useXP())
- return 0;
+ return nullptr;
if (!htheme)
htheme = QWindowsXPStylePrivate::createTheme(theme, QWindowsXPStylePrivate::winId(widget));
@@ -175,10 +175,10 @@ RECT XPThemeData::toRECT(const QRect &qr)
HRGN XPThemeData::mask(QWidget *widget)
{
if (!IsThemeBackgroundPartiallyTransparent(handle(), partId, stateId))
- return 0;
+ return nullptr;
HRGN hrgn;
- HDC dc = 0;
+ HDC dc = nullptr;
if (widget)
dc = hdcForWidgetBackingStore(widget);
RECT nativeRect = toRECT(rect);
@@ -188,7 +188,7 @@ HRGN XPThemeData::mask(QWidget *widget)
// QWindowsXPStylePrivate -------------------------------------------------------------------------
// Static initializations
-HWND QWindowsXPStylePrivate::m_vistaTreeViewHelper = 0;
+HWND QWindowsXPStylePrivate::m_vistaTreeViewHelper = nullptr;
HTHEME QWindowsXPStylePrivate::m_themes[NThemes];
bool QWindowsXPStylePrivate::use_xp = false;
QBasicAtomicInt QWindowsXPStylePrivate::ref = Q_BASIC_ATOMIC_INITIALIZER(-1); // -1 based refcounting
@@ -227,7 +227,7 @@ bool QWindowsXPStylePrivate::useXP(bool update)
{
if (!update)
return use_xp;
- return use_xp = IsThemeActive() && (IsAppThemed() || !QApplication::instance());
+ return use_xp = IsThemeActive() && (IsAppThemed() || !QCoreApplication::instance());
}
/* \internal
@@ -241,7 +241,7 @@ void QWindowsXPStylePrivate::init(bool force)
ref.ref();
useXP(true);
- std::fill(m_themes, m_themes + NThemes, HTHEME(0));
+ std::fill(m_themes, m_themes + NThemes, nullptr);
}
/* \internal
@@ -253,12 +253,12 @@ void QWindowsXPStylePrivate::cleanup(bool force)
if (bufferDC && nullBitmap)
SelectObject(bufferDC, nullBitmap);
DeleteObject(bufferBitmap);
- bufferBitmap = 0;
+ bufferBitmap = nullptr;
}
if(bufferDC)
DeleteDC(bufferDC);
- bufferDC = 0;
+ bufferDC = nullptr;
if (ref.deref() && !force)
return;
@@ -282,7 +282,7 @@ void QWindowsXPStylePrivate::cleanup(bool force)
static inline HWND createTreeViewHelperWindow()
{
if (QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface()) {
- void *hwnd = 0;
+ void *hwnd = nullptr;
void *wndProc = reinterpret_cast<void *>(DefWindowProc);
if (QMetaObject::invokeMethod(ni, "createMessageWindow", Qt::DirectConnection,
Q_RETURN_ARG(void*, hwnd),
@@ -292,7 +292,7 @@ static inline HWND createTreeViewHelperWindow()
return reinterpret_cast<HWND>(hwnd);
}
}
- return 0;
+ return nullptr;
}
bool QWindowsXPStylePrivate::initVistaTreeViewTheming()
@@ -305,7 +305,7 @@ bool QWindowsXPStylePrivate::initVistaTreeViewTheming()
qWarning("Unable to create the treeview helper window.");
return false;
}
- if (FAILED(SetWindowTheme(m_vistaTreeViewHelper, L"explorer", NULL))) {
+ if (FAILED(SetWindowTheme(m_vistaTreeViewHelper, L"explorer", nullptr))) {
qErrnoWarning("SetWindowTheme() failed.");
cleanupVistaTreeViewTheming();
return false;
@@ -317,7 +317,7 @@ void QWindowsXPStylePrivate::cleanupVistaTreeViewTheming()
{
if (m_vistaTreeViewHelper) {
DestroyWindow(m_vistaTreeViewHelper);
- m_vistaTreeViewHelper = 0;
+ m_vistaTreeViewHelper = nullptr;
}
}
@@ -328,11 +328,12 @@ void QWindowsXPStylePrivate::cleanupVistaTreeViewTheming()
*/
void QWindowsXPStylePrivate::cleanupHandleMap()
{
- for (int i = 0; i < NThemes; ++i)
- if (m_themes[i]) {
- CloseThemeData(m_themes[i]);
- m_themes[i] = 0;
+ for (auto &theme : m_themes) {
+ if (theme) {
+ CloseThemeData(theme);
+ theme = nullptr;
}
+ }
QWindowsXPStylePrivate::cleanupVistaTreeViewTheming();
}
@@ -340,7 +341,7 @@ HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd)
{
if (Q_UNLIKELY(theme < 0 || theme >= NThemes || !hwnd)) {
qWarning("Invalid parameters #%d, %p", theme, hwnd);
- return 0;
+ return nullptr;
}
if (!m_themes[theme]) {
const wchar_t *name = themeNames[theme];
@@ -427,16 +428,16 @@ HBITMAP QWindowsXPStylePrivate::buffer(int w, int h)
if (bufferDC && nullBitmap)
SelectObject(bufferDC, nullBitmap);
DeleteObject(bufferBitmap);
- bufferBitmap = 0;
+ bufferBitmap = nullptr;
}
w = qMax(bufferW, w);
h = qMax(bufferH, h);
if (!bufferDC) {
- HDC displayDC = GetDC(0);
+ HDC displayDC = GetDC(nullptr);
bufferDC = CreateCompatibleDC(displayDC);
- ReleaseDC(0, displayDC);
+ ReleaseDC(nullptr, displayDC);
}
// Define the header
@@ -450,22 +451,22 @@ HBITMAP QWindowsXPStylePrivate::buffer(int w, int h)
bmi.bmiHeader.biCompression = BI_RGB;
// Create the pixmap
- bufferPixels = 0;
- bufferBitmap = CreateDIBSection(bufferDC, &bmi, DIB_RGB_COLORS, (void **) &bufferPixels, 0, 0);
+ bufferPixels = nullptr;
+ bufferBitmap = CreateDIBSection(bufferDC, &bmi, DIB_RGB_COLORS, reinterpret_cast<void **>(&bufferPixels), nullptr, 0);
GdiFlush();
- nullBitmap = (HBITMAP)SelectObject(bufferDC, bufferBitmap);
+ nullBitmap = static_cast<HBITMAP>(SelectObject(bufferDC, bufferBitmap));
if (Q_UNLIKELY(!bufferBitmap)) {
qErrnoWarning("QWindowsXPStylePrivate::buffer(%dx%d), CreateDIBSection() failed.", w, h);
bufferW = 0;
bufferH = 0;
- return 0;
+ return nullptr;
}
if (Q_UNLIKELY(!bufferPixels)) {
qErrnoWarning("QWindowsXPStylePrivate::buffer(%dx%d), CreateDIBSection() did not allocate pixel data.", w, h);
bufferW = 0;
bufferH = 0;
- return 0;
+ return nullptr;
}
bufferW = w;
bufferH = h;
@@ -493,7 +494,7 @@ bool QWindowsXPStylePrivate::isTransparent(XPThemeData &themeData)
*/
QRegion QWindowsXPStylePrivate::region(XPThemeData &themeData)
{
- HRGN hRgn = 0;
+ HRGN hRgn = nullptr;
const qreal factor = QWindowsStylePrivate::nativeMetricScaleFactor(themeData.widget);
RECT rect = themeData.toRECT(QRect(themeData.rect.topLeft() / factor, themeData.rect.size() / factor));
if (!SUCCEEDED(GetThemeBackgroundRegion(themeData.handle(), bufferHDC(), themeData.partId,
@@ -502,12 +503,12 @@ QRegion QWindowsXPStylePrivate::region(XPThemeData &themeData)
}
HRGN dest = CreateRectRgn(0, 0, 0, 0);
- const bool success = CombineRgn(dest, hRgn, 0, RGN_COPY) != ERROR;
+ const bool success = CombineRgn(dest, hRgn, nullptr, RGN_COPY) != ERROR;
QRegion region;
if (success) {
- int numBytes = GetRegionData(dest, 0, 0);
+ const auto numBytes = GetRegionData(dest, 0, nullptr);
if (numBytes == 0)
return QRegion();
@@ -551,7 +552,7 @@ bool QWindowsXPStylePrivate::hasAlphaChannel(const QRect &rect)
int firstAlpha = -1;
for (int y = startY; y < h/2; ++y) {
- DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
+ auto buffer = reinterpret_cast<const DWORD *>(bufferPixels) + (y * bufferW);
for (int x = startX; x < w; ++x, ++buffer) {
int alpha = (*buffer) >> 24;
if (firstAlpha == -1)
@@ -580,7 +581,7 @@ bool QWindowsXPStylePrivate::fixAlphaChannel(const QRect &rect)
bool hasFixedAlphaValue = false;
for (int y = startY; y < h; ++y) {
- DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
+ auto buffer = reinterpret_cast<DWORD *>(bufferPixels) + (y * bufferW);
for (int x = startX; x < w; ++x, ++buffer) {
uint pixel = *buffer;
int alpha = qAlpha(pixel);
@@ -612,7 +613,7 @@ bool QWindowsXPStylePrivate::swapAlphaChannel(const QRect &rect, bool allPixels)
// Flip the alphas, so that 255-alpha pixels are 0, and 0-alpha are 255.
for (int y = startY; y < h; ++y) {
- DWORD *buffer = (DWORD*)bufferPixels + (y * bufferW);
+ auto buffer = reinterpret_cast<DWORD *>(bufferPixels) + (y * bufferW);
for (int x = startX; x < w; ++x, ++buffer) {
if (allPixels) {
*buffer |= 0xFF000000;
@@ -668,7 +669,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData)
return true;
QPainter *painter = themeData.painter;
- Q_ASSERT_X(painter != 0, "QWindowsXPStylePrivate::drawBackground()", "Trying to draw a theme part without a painter");
+ Q_ASSERT_X(painter != nullptr, "QWindowsXPStylePrivate::drawBackground()", "Trying to draw a theme part without a painter");
if (!painter || !painter->isActive())
return false;
@@ -706,7 +707,7 @@ bool QWindowsXPStylePrivate::drawBackground(XPThemeData &themeData)
}
}
- const HDC dc = canDrawDirectly ? hdcForWidgetBackingStore(themeData.widget) : HDC(0);
+ const HDC dc = canDrawDirectly ? hdcForWidgetBackingStore(themeData.widget) : nullptr;
const bool result = dc
? drawBackgroundDirectly(dc, themeData, aditionalDevicePixelRatio)
: drawBackgroundThruNativeBuffer(themeData, aditionalDevicePixelRatio);
@@ -740,7 +741,7 @@ bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeDa
{
QPainter *painter = themeData.painter;
- const auto deviceTransform = painter->deviceTransform();
+ const auto &deviceTransform = painter->deviceTransform();
const QPointF redirectionDelta(deviceTransform.dx(), deviceTransform.dy());
const QRect area = scaleRect(QRectF(themeData.rect), additionalDevicePixelRatio).translated(redirectionDelta).toRect();
@@ -771,7 +772,7 @@ bool QWindowsXPStylePrivate::drawBackgroundDirectly(HDC dc, XPThemeData &themeDa
| (themeData.mirrorHorizontally ? DTBG_MIRRORDC : 0);
const HRESULT result = DrawThemeBackgroundEx(themeData.handle(), dc, themeData.partId, themeData.stateId, &(drawRECT), &drawOptions);
- SelectClipRgn(dc, 0);
+ SelectClipRgn(dc, nullptr);
DeleteObject(hrgn);
return SUCCEEDED(result);
}
@@ -1099,9 +1100,7 @@ QWindowsXPStyle::QWindowsXPStyle()
/*!
Destroys the style.
*/
-QWindowsXPStyle::~QWindowsXPStyle()
-{
-}
+QWindowsXPStyle::~QWindowsXPStyle() = default;
/*! \reimp */
void QWindowsXPStyle::unpolish(QApplication *app)
@@ -1157,7 +1156,7 @@ void QWindowsXPStyle::polish(QWidget *widget)
if (!d->hasInitColors) {
// Get text color for group box labels
COLORREF cref;
- XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ButtonTheme, 0, 0);
+ XPThemeData theme(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme, 0, 0);
GetThemeColor(theme.handle(), BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &cref);
d->groupBoxTextColor = qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
GetThemeColor(theme.handle(), BP_GROUPBOX, GBS_DISABLED, TMT_TEXTCOLOR, &cref);
@@ -1270,7 +1269,7 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
MARGINS borderSize;
if (widget) {
- XPThemeData buttontheme(widget, 0, QWindowsXPStylePrivate::ButtonTheme);
+ XPThemeData buttontheme(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme);
HTHEME theme = buttontheme.handle();
if (theme) {
int stateId;
@@ -1288,7 +1287,7 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
int border = proxy()->pixelMetric(PM_DefaultFrameWidth, btn, widget);
rect = option->rect.adjusted(border, border, -border, -border);
- if (SUCCEEDED(GetThemeMargins(theme, NULL, BP_PUSHBUTTON, stateId, TMT_CONTENTMARGINS, NULL, &borderSize))) {
+ if (SUCCEEDED(GetThemeMargins(theme, nullptr, BP_PUSHBUTTON, stateId, TMT_CONTENTMARGINS, nullptr, &borderSize))) {
rect.adjust(borderSize.cxLeftWidth, borderSize.cyTopHeight,
-borderSize.cxRightWidth, -borderSize.cyBottomHeight);
rect = visualRect(option->direction, option->rect, rect);
@@ -1468,7 +1467,7 @@ case PE_Frame:
return;
themeNumber = QWindowsXPStylePrivate::ListViewTheme;
partId = LVP_LISTGROUP;
- XPThemeData theme(widget, 0, themeNumber, partId, 0);
+ XPThemeData theme(widget, nullptr, themeNumber, partId);
if (!(flags & State_Enabled))
stateId = ETS_DISABLED;
@@ -1486,16 +1485,19 @@ case PE_Frame:
// Inner white border
p->setPen(QPen(option->palette.base().color(), 0));
- p->drawRect(QRectF(option->rect).adjusted(QStyleHelper::dpiScaled(0.5), QStyleHelper::dpiScaled(0.5),
- QStyleHelper::dpiScaled(-1), QStyleHelper::dpiScaled(-1)));
+ const qreal dpi = QStyleHelper::dpi(option);
+ const auto topLevelAdjustment = QStyleHelper::dpiScaled(0.5, dpi);
+ const auto bottomRightAdjustment = QStyleHelper::dpiScaled(-1, dpi);
+ p->drawRect(QRectF(option->rect).adjusted(topLevelAdjustment, topLevelAdjustment,
+ bottomRightAdjustment, bottomRightAdjustment));
// Outer dark border
p->setPen(QPen(bordercolor, 0));
- p->drawRect(QRectF(option->rect).adjusted(0, 0, QStyleHelper::dpiScaled(-0.5), QStyleHelper::dpiScaled(-0.5)));
+ p->drawRect(QRectF(option->rect).adjusted(0, 0, -topLevelAdjustment, -topLevelAdjustment));
p->setPen(oldPen);
return;
- } else if (fillType == BT_NONE) {
- return;
}
+ if (fillType == BT_NONE)
+ return;
}
break;
}
@@ -1511,7 +1513,8 @@ case PE_Frame:
p->drawRect(option->rect.adjusted(0, 0, -1, -1));
p->setPen(oldPen);
return;
- } else if (qstyleoption_cast<const QStyleOptionFrame *>(option)) {
+ }
+ if (qstyleoption_cast<const QStyleOptionFrame *>(option)) {
themeNumber = QWindowsXPStylePrivate::EditTheme;
partId = EP_EDITTEXT;
noContent = true;
@@ -1535,7 +1538,7 @@ case PE_Frame:
if (QWindowsXPStylePrivate::isLineEditBaseColorSet(option, widget)) {
p->fillRect(panel->rect, panel->palette.brush(QPalette::Base));
} else {
- XPThemeData theme(0, p, themeNumber, partId, stateId, rect);
+ XPThemeData theme(nullptr, p, themeNumber, partId, stateId, rect);
if (!theme.isValid()) {
QWindowsStyle::drawPrimitive(pe, option, p, widget);
return;
@@ -1584,9 +1587,9 @@ case PE_Frame:
wchar_t themeFileName[maxlength];
wchar_t themeColor[maxlength];
// Due to a a scaling issue with the XP Silver theme, tab gradients are not used with it
- if (GetCurrentThemeName(themeFileName, maxlength, themeColor, maxlength, NULL, 0) == S_OK) {
- wchar_t *offset = 0;
- if ((offset = wcsrchr(themeFileName, QChar(QLatin1Char('\\')).unicode())) != NULL) {
+ if (GetCurrentThemeName(themeFileName, maxlength, themeColor, maxlength, nullptr, 0) == S_OK) {
+ wchar_t *offset = nullptr;
+ if ((offset = wcsrchr(themeFileName, QChar(QLatin1Char('\\')).unicode())) != nullptr) {
offset++;
if (!lstrcmp(offset, L"Luna.msstyles") && !lstrcmp(offset, L"Metallic")) {
useGradient = false;
@@ -1817,7 +1820,7 @@ case PE_Frame:
bef_v -= delta;
aft_h += delta;
aft_v += delta;
- XPThemeData theme(0, p, QWindowsXPStylePrivate::XpTreeViewTheme);
+ XPThemeData theme(nullptr, p, QWindowsXPStylePrivate::XpTreeViewTheme);
theme.rect = QRect(bef_h, bef_v, decoration_size, decoration_size);
theme.partId = TVP_GLYPH;
theme.stateId = flags & QStyle::State_Open ? GLPS_OPENED : GLPS_CLOSED;
@@ -1909,7 +1912,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
{
themeNumber = QWindowsXPStylePrivate::StatusTheme;
partId = SP_GRIPPER;
- XPThemeData theme(0, p, themeNumber, partId, 0);
+ XPThemeData theme(nullptr, p, themeNumber, partId);
QSize size = (theme.size() * QWindowsStylePrivate::nativeMetricScaleFactor(widget)).toSize();
size.rheight()--;
if (const QStyleOptionSizeGrip *sg = qstyleoption_cast<const QStyleOptionSizeGrip *>(option)) {
@@ -1977,7 +1980,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
if (btn->features & QStyleOptionButton::HasMenu) {
int mbiw = 0, mbih = 0;
- XPThemeData theme(widget, 0,
+ XPThemeData theme(widget, nullptr,
QWindowsXPStylePrivate::ToolBarTheme,
TP_SPLITBUTTONDROPDOWN);
if (theme.isValid()) {
@@ -2306,7 +2309,7 @@ void QWindowsXPStyle::drawControl(ControlElement element, const QStyleOption *op
if (isFloating) {
titleRect.adjust(0, -fw, 0, 0);
- if (widget != 0 && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey())
+ if (widget != nullptr && widget->windowIcon().cacheKey() != QApplication::windowIcon().cacheKey())
titleRect.adjust(titleRect.height() + mw, 0, 0, 0);
} else {
titleRect.adjust(mw, 0, 0, 0);
@@ -2772,7 +2775,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
break;
v = nextInterval;
}
- if (lines.size() > 0) {
+ if (!lines.isEmpty()) {
p->save();
p->translate(slrect.topLeft());
p->drawLines(lines.constData(), lines.size());
@@ -2920,7 +2923,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
p->save();
p->setClipRect(menuarea);
tool.rect = option->rect;
- proxy()->drawPrimitive(PE_PanelButtonBevel, &tool, p, 0);
+ proxy()->drawPrimitive(PE_PanelButtonBevel, &tool, p, nullptr);
p->restore();
}
// Draw arrow
@@ -3220,7 +3223,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
-static inline Qt::Orientation progressBarOrientation(const QStyleOption *option = 0)
+static inline Qt::Orientation progressBarOrientation(const QStyleOption *option = nullptr)
{
if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(option))
return pb->orientation;
@@ -3231,27 +3234,27 @@ int QWindowsXPStylePrivate::pixelMetricFromSystemDp(QStyle::PixelMetric pm, cons
{
switch (pm) {
case QStyle::PM_IndicatorWidth:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_CHECKBOX, CBS_UNCHECKEDNORMAL).width();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme, BP_CHECKBOX, CBS_UNCHECKEDNORMAL).width();
case QStyle::PM_IndicatorHeight:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_CHECKBOX, CBS_UNCHECKEDNORMAL).height();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme, BP_CHECKBOX, CBS_UNCHECKEDNORMAL).height();
case QStyle::PM_ExclusiveIndicatorWidth:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL).width();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL).width();
case QStyle::PM_ExclusiveIndicatorHeight:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL).height();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme, BP_RADIOBUTTON, RBS_UNCHECKEDNORMAL).height();
case QStyle::PM_ProgressBarChunkWidth:
return progressBarOrientation(option) == Qt::Horizontal
- ? XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::ProgressTheme, PP_CHUNK).width()
- : XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::ProgressTheme, PP_CHUNKVERT).height();
+ ? XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::ProgressTheme, PP_CHUNK).width()
+ : XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::ProgressTheme, PP_CHUNKVERT).height();
case QStyle::PM_SliderThickness:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::TrackBarTheme, TKP_THUMB).height();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::TrackBarTheme, TKP_THUMB).height();
case QStyle::PM_TitleBarHeight:
return widget && (widget->windowType() == Qt::Tool)
? GetSystemMetrics(SM_CYSMCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME)
: GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CXSIZEFRAME);
case QStyle::PM_MdiSubWindowFrameWidth:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::WindowTheme, WP_FRAMELEFT, FS_ACTIVE).width();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::WindowTheme, WP_FRAMELEFT, FS_ACTIVE).width();
case QStyle::PM_DockWidgetFrameWidth:
- return XPThemeData::themeSize(widget, 0, QWindowsXPStylePrivate::WindowTheme, WP_SMALLFRAMERIGHT, FS_ACTIVE).width();
+ return XPThemeData::themeSize(widget, nullptr, QWindowsXPStylePrivate::WindowTheme, WP_SMALLFRAMERIGHT, FS_ACTIVE).width();
default:
break;
}
@@ -3311,7 +3314,8 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
break;
case PM_SplitterWidth:
- res = qMax(int(QStyleHelper::dpiScaled(5.)), QApplication::globalStrut().width());
+ res = qMax(int(QStyleHelper::dpiScaled(5., option)),
+ QApplication::globalStrut().width());
break;
case PM_MdiSubWindowMinimizedWidth:
@@ -3320,13 +3324,13 @@ int QWindowsXPStyle::pixelMetric(PixelMetric pm, const QStyleOption *option, con
#if QT_CONFIG(toolbar)
case PM_ToolBarHandleExtent:
- res = int(QStyleHelper::dpiScaled(8.));
+ res = int(QStyleHelper::dpiScaled(8., option));
break;
#endif // QT_CONFIG(toolbar)
case PM_DockWidgetSeparatorExtent:
case PM_DockWidgetTitleMargin:
- res = int(QStyleHelper::dpiScaled(4.));
+ res = int(QStyleHelper::dpiScaled(4., option));
break;
case PM_ButtonShiftHorizontal:
@@ -3411,7 +3415,7 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
const bool isToolTitle = false;
const int height = tb->rect.height();
const int width = tb->rect.width();
- const int buttonMargin = int(QStyleHelper::dpiScaled(4));
+ const int buttonMargin = int(QStyleHelper::dpiScaled(4, option));
const qreal factor = QWindowsStylePrivate::nativeMetricScaleFactor(widget);
int buttonHeight = qRound(qreal(GetSystemMetrics(SM_CYSIZE)) * factor)
- buttonMargin;
@@ -3522,21 +3526,28 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
case CC_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
const int x = cmb->rect.x(), y = cmb->rect.y(), wi = cmb->rect.width(), he = cmb->rect.height();
- const int xpos = x + wi - qRound(QStyleHelper::dpiScaled(1 + 16));
+ const int xpos = x + wi - qRound(QStyleHelper::dpiScaled(1 + 16, option));
switch (subControl) {
case SC_ComboBoxFrame:
rect = cmb->rect;
break;
- case SC_ComboBoxArrow:
- rect = QRect(xpos, y + qRound(QStyleHelper::dpiScaled(1)),
- qRound(QStyleHelper::dpiScaled(16)), he - qRound(QStyleHelper::dpiScaled(2)));
+ case SC_ComboBoxArrow: {
+ const qreal dpi = QStyleHelper::dpi(option);
+ rect = QRect(xpos, y + qRound(QStyleHelper::dpiScaled(1, dpi)),
+ qRound(QStyleHelper::dpiScaled(16, dpi)),
+ he - qRound(QStyleHelper::dpiScaled(2, dpi)));
+ }
break;
- case SC_ComboBoxEditField:
- rect = QRect(x + qRound(QStyleHelper::dpiScaled(2)), y + qRound(QStyleHelper::dpiScaled(2)),
- wi - qRound(QStyleHelper::dpiScaled(3 + 16)), he - qRound(QStyleHelper::dpiScaled(4)));
+ case SC_ComboBoxEditField: {
+ const qreal dpi = QStyleHelper::dpi(option);
+ const int frame = qRound(QStyleHelper::dpiScaled(2, dpi));
+ rect = QRect(x + frame, y + frame,
+ wi - qRound(QStyleHelper::dpiScaled(3 + 16, dpi)),
+ he - qRound(QStyleHelper::dpiScaled(4, dpi)));
+ }
break;
case SC_ComboBoxListBoxPopup:
@@ -3609,7 +3620,7 @@ QSize QWindowsXPStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt
case CT_LineEdit:
case CT_ComboBox:
{
- XPThemeData buttontheme(widget, 0, QWindowsXPStylePrivate::ButtonTheme, BP_PUSHBUTTON, PBS_NORMAL);
+ XPThemeData buttontheme(widget, nullptr, QWindowsXPStylePrivate::ButtonTheme, BP_PUSHBUTTON, PBS_NORMAL);
if (buttontheme.isValid()) {
const qreal factor = QWindowsXPStylePrivate::nativeMetricScaleFactor(widget);
const QMarginsF borderSize = buttontheme.margins() * factor;
@@ -3730,11 +3741,11 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
titleBarRect.setHeight(tbHeight);
XPThemeData themeData;
if (titlebar->titleBarState & Qt::WindowMinimized) {
- themeData = XPThemeData(widget, 0,
+ themeData = XPThemeData(widget, nullptr,
QWindowsXPStylePrivate::WindowTheme,
WP_MINCAPTION, CS_ACTIVE, titleBarRect);
} else
- themeData = XPThemeData(widget, 0,
+ themeData = XPThemeData(widget, nullptr,
QWindowsXPStylePrivate::WindowTheme,
WP_CAPTION, CS_ACTIVE, titleBarRect);
mask->region = d->region(themeData) +
@@ -3763,10 +3774,8 @@ int QWindowsXPStyle::styleHint(StyleHint hint, const QStyleOption *option, const
/*! \reimp */
QPalette QWindowsXPStyle::standardPalette() const
{
- if (QWindowsXPStylePrivate::useXP() && QApplicationPrivate::sys_pal)
- return *QApplicationPrivate::sys_pal;
- else
- return QWindowsStyle::standardPalette();
+ return QWindowsXPStylePrivate::useXP() && QApplicationPrivate::sys_pal
+ ? *QApplicationPrivate::sys_pal : QWindowsStyle::standardPalette();
}
/*!
@@ -3784,7 +3793,7 @@ QPixmap QWindowsXPStyle::standardPixmap(StandardPixmap standardPixmap, const QSt
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (widget && widget->isWindow()) {
- XPThemeData theme(widget, 0, QWindowsXPStylePrivate::WindowTheme, WP_SMALLCLOSEBUTTON, CBS_NORMAL);
+ XPThemeData theme(widget, nullptr, QWindowsXPStylePrivate::WindowTheme, WP_SMALLCLOSEBUTTON, CBS_NORMAL);
if (theme.isValid()) {
const QSize size = (theme.size() * QWindowsStylePrivate::nativeMetricScaleFactor(widget)).toSize();
return QIcon(QWindowsStyle::standardPixmap(standardPixmap, option, widget)).pixmap(size);
@@ -3815,9 +3824,9 @@ QIcon QWindowsXPStyle::standardIcon(StandardPixmap standardIcon,
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (d->dockFloat.isNull()) {
- XPThemeData themeSize(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ XPThemeData themeSize(nullptr, nullptr, QWindowsXPStylePrivate::WindowTheme,
WP_SMALLCLOSEBUTTON, CBS_NORMAL);
- XPThemeData theme(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ XPThemeData theme(nullptr, nullptr, QWindowsXPStylePrivate::WindowTheme,
WP_MAXBUTTON, MAXBS_NORMAL);
if (theme.isValid()) {
const QSize size = (themeSize.size() * QWindowsStylePrivate::nativeMetricScaleFactor(widget)).toSize();
@@ -3851,7 +3860,7 @@ QIcon QWindowsXPStyle::standardIcon(StandardPixmap standardIcon,
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (d->dockClose.isNull()) {
- XPThemeData theme(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ XPThemeData theme(nullptr, nullptr, QWindowsXPStylePrivate::WindowTheme,
WP_SMALLCLOSEBUTTON, CBS_NORMAL);
if (theme.isValid()) {
const QSize size = (theme.size() * QWindowsStylePrivate::nativeMetricScaleFactor(widget)).toSize();
@@ -3885,9 +3894,9 @@ QIcon QWindowsXPStyle::standardIcon(StandardPixmap standardIcon,
if (qstyleoption_cast<const QStyleOptionDockWidget *>(option))
{
if (d->dockFloat.isNull()) {
- XPThemeData themeSize(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ XPThemeData themeSize(nullptr, nullptr, QWindowsXPStylePrivate::WindowTheme,
WP_SMALLCLOSEBUTTON, CBS_NORMAL);
- XPThemeData theme(0, 0, QWindowsXPStylePrivate::WindowTheme,
+ XPThemeData theme(nullptr, nullptr, QWindowsXPStylePrivate::WindowTheme,
WP_RESTOREBUTTON, RBS_NORMAL);
if (theme.isValid()) {
const QSize size = (themeSize.size() * QWindowsStylePrivate::nativeMetricScaleFactor(widget)).toSize();
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
index 60f9d7e9b7..ad7754e3d4 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle_p_p.h
@@ -100,11 +100,11 @@ class QDebug;
class XPThemeData
{
public:
- explicit XPThemeData(const QWidget *w = 0, QPainter *p = 0, int themeIn = -1,
+ explicit XPThemeData(const QWidget *w = nullptr, QPainter *p = nullptr, int themeIn = -1,
int part = 0, int state = 0, const QRect &r = QRect())
- : widget(w), painter(p), theme(themeIn), htheme(0), partId(part), stateId(state),
+ : widget(w), painter(p), theme(themeIn), partId(part), stateId(state),
mirrorHorizontally(false), mirrorVertically(false), noBorder(false),
- noContent(false), rotate(0), rect(r)
+ noContent(false), rect(r)
{}
HRGN mask(QWidget *widget);
@@ -117,17 +117,17 @@ public:
QMarginsF margins(const QRect &rect, int propId = TMT_CONTENTMARGINS);
QMarginsF margins(int propId = TMT_CONTENTMARGINS);
- static QSizeF themeSize(const QWidget *w = 0, QPainter *p = 0, int themeIn = -1, int part = 0, int state = 0);
- static QMarginsF themeMargins(const QRect &rect, const QWidget *w = 0, QPainter *p = 0, int themeIn = -1,
+ static QSizeF themeSize(const QWidget *w = nullptr, QPainter *p = nullptr, int themeIn = -1, int part = 0, int state = 0);
+ static QMarginsF themeMargins(const QRect &rect, const QWidget *w = nullptr, QPainter *p = nullptr, int themeIn = -1,
int part = 0, int state = 0, int propId = TMT_CONTENTMARGINS);
- static QMarginsF themeMargins(const QWidget *w = 0, QPainter *p = 0, int themeIn = -1,
+ static QMarginsF themeMargins(const QWidget *w = nullptr, QPainter *p = nullptr, int themeIn = -1,
int part = 0, int state = 0, int propId = TMT_CONTENTMARGINS);
const QWidget *widget;
QPainter *painter;
int theme;
- HTHEME htheme;
+ HTHEME htheme = nullptr;
int partId;
int stateId;
@@ -135,18 +135,18 @@ public:
uint mirrorVertically : 1;
uint noBorder : 1;
uint noContent : 1;
- uint rotate;
+ uint rotate = 0;
QRect rect;
};
struct ThemeMapKey {
- int theme;
- int partId;
- int stateId;
- bool noBorder;
- bool noContent;
+ int theme = 0;
+ int partId = -1;
+ int stateId = -1;
+ bool noBorder = false;
+ bool noContent = false;
- ThemeMapKey() : partId(-1), stateId(-1) {}
+ ThemeMapKey() = default;
ThemeMapKey(const XPThemeData &data)
: theme(data.theme), partId(data.partId), stateId(data.stateId),
noBorder(data.noBorder), noContent(data.noContent) {}
@@ -171,7 +171,7 @@ enum AlphaChannelType {
};
struct ThemeMapData {
- AlphaChannelType alphaType; // Which type of alpha on part & state
+ AlphaChannelType alphaType = UnknownAlpha; // Which type of alpha on part & state
bool dataValid : 1; // Only used to detect if hash value is ok
bool partIsTransparent : 1;
@@ -217,15 +217,13 @@ public:
};
QWindowsXPStylePrivate()
- : QWindowsStylePrivate(), hasInitColors(false), bufferDC(0), bufferBitmap(0), nullBitmap(0),
- bufferPixels(0), bufferW(0), bufferH(0)
{ init(); }
~QWindowsXPStylePrivate()
{ cleanup(); }
- static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0);
- static int fixedPixelMetric(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0);
+ static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr);
+ static int fixedPixelMetric(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr);
static HWND winId(const QWidget *widget);
@@ -251,10 +249,10 @@ public:
bool fixAlphaChannel(const QRect &rect);
bool swapAlphaChannel(const QRect &rect, bool allPixels = false);
- QRgb groupBoxTextColor;
- QRgb groupBoxTextColorDisabled;
- QRgb sliderTickColor;
- bool hasInitColors;
+ QRgb groupBoxTextColor = 0;
+ QRgb groupBoxTextColorDisabled = 0;
+ QRgb sliderTickColor = 0;
+ bool hasInitColors = false;
static HTHEME createTheme(int theme, HWND hwnd);
static QString themeName(int theme);
@@ -277,11 +275,12 @@ private:
static bool use_xp;
QHash<ThemeMapKey, ThemeMapData> alphaCache;
- HDC bufferDC;
- HBITMAP bufferBitmap;
- HBITMAP nullBitmap;
- uchar *bufferPixels;
- int bufferW, bufferH;
+ HDC bufferDC = nullptr;
+ HBITMAP bufferBitmap = nullptr;
+ HBITMAP nullBitmap = nullptr;
+ uchar *bufferPixels = nullptr;
+ int bufferW = 0;
+ int bufferH = 0;
static HWND m_vistaTreeViewHelper;
static HTHEME m_themes[NThemes];
@@ -292,7 +291,7 @@ inline QSizeF XPThemeData::size()
QSizeF result(0, 0);
if (isValid()) {
SIZE size;
- if (SUCCEEDED(GetThemePartSize(handle(), 0, partId, stateId, 0, TS_TRUE, &size)))
+ if (SUCCEEDED(GetThemePartSize(handle(), nullptr, partId, stateId, nullptr, TS_TRUE, &size)))
result = QSize(size.cx, size.cy);
}
return result;
@@ -304,7 +303,7 @@ inline QMarginsF XPThemeData::margins(const QRect &qRect, int propId)
if (isValid()) {
MARGINS margins;
RECT rect = XPThemeData::toRECT(qRect);
- if (SUCCEEDED(GetThemeMargins(handle(), 0, partId, stateId, propId, &rect, &margins)))
+ if (SUCCEEDED(GetThemeMargins(handle(), nullptr, partId, stateId, propId, &rect, &margins)))
result = QMargins(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight);
}
return result;
@@ -315,7 +314,7 @@ inline QMarginsF XPThemeData::margins(int propId)
QMarginsF result(0, 0, 0 ,0);
if (isValid()) {
MARGINS margins;
- if (SUCCEEDED(GetThemeMargins(handle(), 0, partId, stateId, propId, NULL, &margins)))
+ if (SUCCEEDED(GetThemeMargins(handle(), nullptr, partId, stateId, propId, nullptr, &margins)))
result = QMargins(margins.cxLeftWidth, margins.cyTopHeight, margins.cxRightWidth, margins.cyBottomHeight);
}
return result;
diff --git a/src/plugins/styles/windowsvista/windowsvista.pro b/src/plugins/styles/windowsvista/windowsvista.pro
index f82bcfc91b..c08db7f533 100644
--- a/src/plugins/styles/windowsvista/windowsvista.pro
+++ b/src/plugins/styles/windowsvista/windowsvista.pro
@@ -10,7 +10,7 @@ SOURCES += qwindowsvistastyle.cpp
HEADERS += qwindowsxpstyle_p.h qwindowsxpstyle_p_p.h
SOURCES += qwindowsxpstyle.cpp
-LIBS_PRIVATE += -lgdi32 -luser32
+QMAKE_USE_PRIVATE += user32 gdi32
# DEFINES/LIBS needed for qwizard_win.cpp and the styles
include(../../../widgets/kernel/win.pri)
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index 3cc89890fc..372716adfc 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -73,7 +73,9 @@ public:
PrintPageRange = 0x0004,
PrintShowPageSize = 0x0008,
PrintCollateCopies = 0x0010,
- DontUseSheet = 0x0020,
+#if QT_DEPRECATED_SINCE(5, 14)
+ DontUseSheet Q_DECL_ENUMERATOR_DEPRECATED = 0x0020,
+#endif
PrintCurrentPage = 0x0040
};
Q_ENUM(PrintDialogOption)
@@ -84,8 +86,6 @@ public:
explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = nullptr);
~QAbstractPrintDialog();
- int exec() override = 0;
-
// obsolete
void addEnabledOption(PrintDialogOption option);
void setEnabledOptions(PrintDialogOptions options);
diff --git a/src/printsupport/dialogs/qpagesetupdialog.cpp b/src/printsupport/dialogs/qpagesetupdialog.cpp
index dc0457d20d..ce2a0416c8 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog.cpp
@@ -114,10 +114,8 @@ void QPageSetupDialogPrivate::setPrinter(QPrinter *newPrinter)
printer = new QPrinter;
ownsPrinter = true;
}
-#if 1 // Used to be excluded in Qt4 for Q_WS_X11
if (printer->outputFormat() != QPrinter::NativeFormat)
qWarning("QPageSetupDialog: Cannot be used on non-native printers");
-#endif
}
/*!
diff --git a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
index d9b4a84aa9..1d8af9dbf0 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
+++ b/src/printsupport/dialogs/qpagesetupdialog_unix.cpp
@@ -361,13 +361,21 @@ void QPageSetupWidget::initPageSizes()
QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
if (ps) {
QPrintDevice printDevice = ps->createPrintDevice(m_printerName);
+ const QPageSize defaultSize = printDevice.defaultPageSize();
const auto pageSizes = printDevice.supportedPageSizes();
for (const QPageSize &pageSize : pageSizes)
m_ui.pageSizeCombo->addItem(pageSize.name(), QVariant::fromValue(pageSize));
- if (m_ui.pageSizeCombo->count() > 0 && printDevice.supportsCustomPageSizes()) {
- m_ui.pageSizeCombo->addItem(tr("Custom"));
- m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1;
+ if (m_ui.pageSizeCombo->count() > 0) {
+ if (printDevice.supportsCustomPageSizes()) {
+ m_ui.pageSizeCombo->addItem(tr("Custom"));
+ m_realCustomPageSizeIndex = m_ui.pageSizeCombo->count() - 1;
+ }
m_blockSignals = false;
+
+ // If the defaultSize is index 0, setCurrentIndex won't emit the currentIndexChanged
+ // signal; workaround the issue by initially setting the currentIndex to -1
+ m_ui.pageSizeCombo->setCurrentIndex(-1);
+ m_ui.pageSizeCombo->setCurrentIndex(m_ui.pageSizeCombo->findData(QVariant::fromValue(defaultSize)));
return;
}
}
@@ -403,12 +411,6 @@ void QPageSetupWidget::setPrinter(QPrinter *printer, QPrintDevice *printDevice,
// Initialize the layout to the current QPrinter layout
m_pageLayout = m_printer->pageLayout();
- if (printDevice) {
- const QPageSize pageSize = printDevice->defaultPageSize();
- const QMarginsF printable = printDevice->printableMargins(pageSize, m_pageLayout.orientation(), m_printer->resolution());
- m_pageLayout.setPageSize(pageSize, qt_convertMargins(printable, QPageLayout::Point, m_pageLayout.units()));
- }
-
// Assume if margins are Points then is by default, so set to locale default units
if (m_pageLayout.units() == QPageLayout::Point) {
if (QLocale().measurementSystem() == QLocale::MetricSystem)
@@ -735,8 +737,12 @@ int QPageSetupDialog::exec()
Q_D(QPageSetupDialog);
int ret = QDialog::exec();
- if (ret == Accepted)
+ if (ret == Accepted) {
static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->setupPrinter();
+ static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->updateSavedValues();
+ } else {
+ static_cast <QUnixPageSetupDialogPrivate*>(d)->widget->revertToSavedValues();
+ }
return ret;
}
diff --git a/src/printsupport/dialogs/qprintdialog_unix.cpp b/src/printsupport/dialogs/qprintdialog_unix.cpp
index d2937e7547..c7328d9732 100644
--- a/src/printsupport/dialogs/qprintdialog_unix.cpp
+++ b/src/printsupport/dialogs/qprintdialog_unix.cpp
@@ -398,12 +398,12 @@ static const char *ppdOriginallySelectedChoiceProperty = "_q_ppd_originally_sele
// Used to store the warning label pointer for each QComboBox that represents an advanced option
static const char *warningLabelProperty = "_q_warning_label";
-static bool isBlacklistedGroup(const ppd_group_t *group) Q_DECL_NOTHROW
+static bool isBlacklistedGroup(const ppd_group_t *group) noexcept
{
return qstrcmp(group->name, "InstallableOptions") == 0;
};
-static bool isBlacklistedOption(const char *keyword) Q_DECL_NOTHROW
+static bool isBlacklistedOption(const char *keyword) noexcept
{
// We already let the user set these options elsewhere
const char *cupsOptionBlacklist[] = {
@@ -739,7 +739,7 @@ void QPrintDialogPrivate::selectPrinter(const QPrinter::OutputFormat outputForma
}
#if QT_CONFIG(cups)
-static std::vector<std::pair<int, int>> pageRangesFromString(const QString &pagesString) Q_DECL_NOTHROW
+static std::vector<std::pair<int, int>> pageRangesFromString(const QString &pagesString) noexcept
{
std::vector<std::pair<int, int>> result;
const QStringList items = pagesString.split(',');
@@ -793,7 +793,7 @@ static std::vector<std::pair<int, int>> pageRangesFromString(const QString &page
return result;
}
-static QString stringFromPageRanges(const std::vector<std::pair<int, int>> &pageRanges) Q_DECL_NOTHROW
+static QString stringFromPageRanges(const std::vector<std::pair<int, int>> &pageRanges) noexcept
{
QString result;
@@ -810,7 +810,7 @@ static QString stringFromPageRanges(const std::vector<std::pair<int, int>> &page
return result;
}
-static bool isValidPagesString(const QString &pagesString) Q_DECL_NOTHROW
+static bool isValidPagesString(const QString &pagesString) noexcept
{
if (pagesString.isEmpty())
return false;
@@ -1087,7 +1087,7 @@ void QPrintDialog::setVisible(bool visible)
int QPrintDialog::exec()
{
- return QDialog::exec();
+ return QAbstractPrintDialog::exec();
}
void QPrintDialog::accept()
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp
index e6b665f82c..39575d5f57 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.cpp
+++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp
@@ -152,8 +152,8 @@ class QPrintPreviewDialogPrivate : public QDialogPrivate
Q_DECLARE_PUBLIC(QPrintPreviewDialog)
public:
QPrintPreviewDialogPrivate()
- : printDialog(nullptr), ownPrinter(false),
- initialized(false) {}
+ : printDialog(nullptr), pageSetupDialog(nullptr),
+ ownPrinter(false), initialized(false) {}
// private slots
void _q_fit(QAction *action);
@@ -178,6 +178,7 @@ public:
void updateZoomFactor();
QPrintDialog *printDialog;
+ QPageSetupDialog *pageSetupDialog;
QPrintPreviewWidget *preview;
QPrinter *printer;
bool ownPrinter;
@@ -494,7 +495,7 @@ void QPrintPreviewDialogPrivate::updatePageNumLabel()
void QPrintPreviewDialogPrivate::updateZoomFactor()
{
- zoomFactor->lineEdit()->setText(QString().sprintf("%.1f%%", preview->zoomFactor()*100));
+ zoomFactor->lineEdit()->setText(QString::asprintf("%.1f%%", preview->zoomFactor()*100));
}
void QPrintPreviewDialogPrivate::_q_fit(QAction* action)
@@ -602,8 +603,10 @@ void QPrintPreviewDialogPrivate::_q_pageSetup()
{
Q_Q(QPrintPreviewDialog);
- QPageSetupDialog pageSetup(printer, q);
- if (pageSetup.exec() == QDialog::Accepted) {
+ if (!pageSetupDialog)
+ pageSetupDialog = new QPageSetupDialog(printer, q);
+
+ if (pageSetupDialog->exec() == QDialog::Accepted) {
// update possible orientation changes
if (preview->orientation() == QPrinter::Portrait) {
portraitAction->setChecked(true);
@@ -713,6 +716,7 @@ QPrintPreviewDialog::~QPrintPreviewDialog()
if (d->ownPrinter)
delete d->printer;
delete d->printDialog;
+ delete d->pageSetupDialog;
}
/*!
diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri
index ea7b4b9780..2ceaf152eb 100644
--- a/src/printsupport/kernel/kernel.pri
+++ b/src/printsupport/kernel/kernel.pri
@@ -33,7 +33,10 @@ win32 {
$$PWD/qprintengine_win_p.h
SOURCES += \
$$PWD/qprintengine_win.cpp
- !winrt: LIBS_PRIVATE += -lwinspool -lcomdlg32 -lgdi32 -luser32
+ !winrt {
+ LIBS_PRIVATE += -lwinspool -lcomdlg32
+ QMAKE_USE_PRIVATE += user32 gdi32
+ }
}
unix:!darwin:qtConfig(cups) {
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index 8505e8356c..2fc4621960 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -44,12 +44,12 @@
QT_BEGIN_NAMESPACE
-static QStringList cupsOptionsList(QPrinter *printer) Q_DECL_NOTHROW
+static QStringList cupsOptionsList(QPrinter *printer) noexcept
{
return printer->printEngine()->property(PPK_CupsOptions).toStringList();
}
-void setCupsOptions(QPrinter *printer, const QStringList &cupsOptions) Q_DECL_NOTHROW
+void setCupsOptions(QPrinter *printer, const QStringList &cupsOptions) noexcept
{
printer->printEngine()->setProperty(PPK_CupsOptions, QVariant(cupsOptions));
}
@@ -106,7 +106,7 @@ static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold,
if (holdUntilTime < localDateTime.time())
localDateTime = localDateTime.addDays(1);
localDateTime.setTime(holdUntilTime);
- return localDateTime.toUTC().time().toString(QStringViewLiteral("HH:mm"));
+ return localDateTime.toUTC().time().toString(u"HH:mm");
}
// else fall through:
Q_FALLTHROUGH();
diff --git a/src/printsupport/kernel/qprintdevice_p.h b/src/printsupport/kernel/qprintdevice_p.h
index a2b18f08cf..9e76c37617 100644
--- a/src/printsupport/kernel/qprintdevice_p.h
+++ b/src/printsupport/kernel/qprintdevice_p.h
@@ -76,9 +76,7 @@ public:
~QPrintDevice();
QPrintDevice &operator=(const QPrintDevice &other);
- #ifdef Q_COMPILER_RVALUE_REFS
QPrintDevice &operator=(QPrintDevice &&other) { swap(other); return *this; }
-#endif
void swap(QPrintDevice &other) { d.swap(other.d); }
diff --git a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp
index a27feb1505..bba0487452 100644
--- a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp
+++ b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp
@@ -213,7 +213,7 @@ void QSqlQuery_snippets()
while (i.hasNext()) {
i.next();
cout << i.key().toUtf8().data() << ": "
- << i.value().toString().toUtf8().data() << endl;
+ << i.value().toString().toUtf8().data() << Qt::endl;
}
//! [14]
}
@@ -223,7 +223,7 @@ void QSqlQuery_snippets()
//! [15]
QList<QVariant> list = query.boundValues().values();
for (int i = 0; i < list.size(); ++i)
- cout << i << ": " << list.at(i).toString().toUtf8().data() << endl;
+ cout << i << ": " << list.at(i).toString().toUtf8().data() << Qt::endl;
//! [15]
}
}
diff --git a/src/sql/doc/src/sql-driver.qdoc b/src/sql/doc/src/sql-driver.qdoc
index cccce48bb3..c6ac4d17ff 100644
--- a/src/sql/doc/src/sql-driver.qdoc
+++ b/src/sql/doc/src/sql-driver.qdoc
@@ -54,9 +54,9 @@
\li Open Database Connectivity (ODBC) - Microsoft SQL Server and other
ODBC-compliant databases
\row \li \l{#QPSQL}{QPSQL} \li PostgreSQL (versions 7.3 and above)
- \row \li \l{#QSQLITE2}{QSQLITE2} \li SQLite version 2
+ \row \li \l{#QSQLITE2}{QSQLITE2} \li SQLite version 2 \note obsolete since Qt 5.14
\row \li \l{#QSQLITE}{QSQLITE} \li SQLite version 3
- \row \li \l{#QTDS}{QTDS} \li Sybase Adaptive Server \note obsolete from Qt 4.7
+ \row \li \l{#QTDS}{QTDS} \li Sybase Adaptive Server \note obsolete since Qt 4.7
\endtable
SQLite is the in-process database system with the best test coverage
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index f61c72285a..01726d79ef 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -184,7 +184,7 @@ QSqlDatabasePrivate *QSqlDatabasePrivate::shared_null()
void QSqlDatabasePrivate::invalidateDb(const QSqlDatabase &db, const QString &name, bool doWarn)
{
- if (db.d->ref.load() != 1 && doWarn) {
+ if (db.d->ref.loadRelaxed() != 1 && doWarn) {
qWarning("QSqlDatabasePrivate::removeDatabase: connection '%s' is still in use, "
"all queries will cease to work.", name.toLocal8Bit().constData());
db.d->disable();
diff --git a/src/sql/kernel/qsqlerror.cpp b/src/sql/kernel/qsqlerror.cpp
index 41ea497ad7..7a1a91948c 100644
--- a/src/sql/kernel/qsqlerror.cpp
+++ b/src/sql/kernel/qsqlerror.cpp
@@ -365,7 +365,7 @@ QString QSqlError::nativeErrorCode() const
QString QSqlError::text() const
{
QString result = d->databaseError;
- if (!d->databaseError.endsWith(QLatin1String("\n")))
+ if (!d->databaseError.isEmpty() && !d->driverError.isEmpty() && !d->databaseError.endsWith(QLatin1String("\n")))
result += QLatin1Char(' ');
result += d->driverError;
return result;
diff --git a/src/sql/kernel/qsqlerror.h b/src/sql/kernel/qsqlerror.h
index 6dac47a7fe..7dfb6eb9ec 100644
--- a/src/sql/kernel/qsqlerror.h
+++ b/src/sql/kernel/qsqlerror.h
@@ -66,15 +66,15 @@ public:
ErrorType type = NoError,
const QString &errorCode = QString());
QSqlError(const QSqlError& other);
- QSqlError(QSqlError &&other) Q_DECL_NOTHROW : d(other.d) { other.d = nullptr; }
+ QSqlError(QSqlError &&other) noexcept : d(other.d) { other.d = nullptr; }
QSqlError& operator=(const QSqlError& other);
- QSqlError &operator=(QSqlError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
+ QSqlError &operator=(QSqlError &&other) noexcept { swap(other); return *this; }
bool operator==(const QSqlError& other) const;
bool operator!=(const QSqlError& other) const;
~QSqlError();
- void swap(QSqlError &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+ void swap(QSqlError &other) noexcept { qSwap(d, other.d); }
QString driverText() const;
QString databaseText() const;
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index daadcb8a0e..e7c444f5b9 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -374,7 +374,7 @@ bool QSqlQuery::exec(const QString& query)
QElapsedTimer t;
t.start();
#endif
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
bool fo = isForwardOnly();
*this = QSqlQuery(driver()->createResult());
d->sqlResult->setNumericalPrecisionPolicy(d->sqlResult->numericalPrecisionPolicy());
@@ -960,7 +960,7 @@ void QSqlQuery::clear()
*/
bool QSqlQuery::prepare(const QString& query)
{
- if (d->ref.load() != 1) {
+ if (d->ref.loadRelaxed() != 1) {
bool fo = isForwardOnly();
*this = QSqlQuery(driver()->createResult());
setForwardOnly(fo);
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index ecbe3eacdb..c4dc5d1adb 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -535,7 +535,7 @@ QDebug operator<<(QDebug dbg, const QSqlRecord &r)
dbg << "QSqlRecord(" << count << ')';
for (int i = 0; i < count; ++i) {
dbg.nospace();
- dbg << '\n' << qSetFieldWidth(2) << right << i << left << qSetFieldWidth(0) << ':';
+ dbg << '\n' << qSetFieldWidth(2) << Qt::right << i << Qt::left << qSetFieldWidth(0) << ':';
dbg.space();
dbg << r.field(i) << r.value(i).toString();
}
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 589088238b..cc91c6d0ed 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -41,7 +41,6 @@
#include "qvariant.h"
#include "qhash.h"
-#include "qregexp.h"
#include "qsqlerror.h"
#include "qsqlfield.h"
#include "qsqlrecord.h"
diff --git a/src/sql/models/qsqlquerymodel_p.h b/src/sql/models/qsqlquerymodel_p.h
index d5ca2f89cb..64e9aeb3db 100644
--- a/src/sql/models/qsqlquerymodel_p.h
+++ b/src/sql/models/qsqlquerymodel_p.h
@@ -75,7 +75,7 @@ public:
void initColOffsets(int size);
int columnInQuery(int modelColumn) const;
- mutable QSqlQuery query = { QSqlQuery(0) };
+ mutable QSqlQuery query = { QSqlQuery(nullptr) };
mutable QSqlError error;
QModelIndex bottom;
QSqlRecord rec;
diff --git a/src/sql/models/qsqlrelationaltablemodel.h b/src/sql/models/qsqlrelationaltablemodel.h
index 555755009c..1929bd320a 100644
--- a/src/sql/models/qsqlrelationaltablemodel.h
+++ b/src/sql/models/qsqlrelationaltablemodel.h
@@ -58,7 +58,7 @@ public:
const QString &displayCol)
: tName(aTableName), iColumn(indexCol), dColumn(displayCol) {}
- void swap(QSqlRelation &other) Q_DECL_NOTHROW
+ void swap(QSqlRelation &other) noexcept
{
qSwap(tName, other.tName);
qSwap(iColumn, other.iColumn);
@@ -71,7 +71,7 @@ public:
{ return iColumn; }
inline QString displayColumn() const
{ return dColumn; }
- bool isValid() const Q_DECL_NOTHROW
+ bool isValid() const noexcept
{ return !(tName.isEmpty() || iColumn.isEmpty() || dColumn.isEmpty()); }
private:
QString tName, iColumn, dColumn;
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 98d6ddf882..4bc9a8c2f8 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -611,7 +611,7 @@ bool QSqlTableModel::setData(const QModelIndex &index, const QVariant &value, in
/*!
\reimp
*/
-bool QStringListModel::clearItemData(const QModelIndex &index)
+bool QSqlTableModel::clearItemData(const QModelIndex &index)
{
return setData(index, QVariant(), Qt::EditRole);
}
diff --git a/src/sql/models/qsqltablemodel_p.h b/src/sql/models/qsqltablemodel_p.h
index bb568ab444..9ac34e7259 100644
--- a/src/sql/models/qsqltablemodel_p.h
+++ b/src/sql/models/qsqltablemodel_p.h
@@ -93,7 +93,7 @@ public:
QSqlTableModel::EditStrategy strategy;
bool busyInsertingRows;
- QSqlQuery editQuery = { QSqlQuery(0) };
+ QSqlQuery editQuery = { QSqlQuery(nullptr) };
QSqlIndex primaryIndex;
QString tableName;
QString filter;
diff --git a/src/src.pro b/src/src.pro
index ce3db6d783..8ff3ec4c1f 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -23,10 +23,6 @@ src_tools_rcc.subdir = tools/rcc
src_tools_rcc.target = sub-rcc
src_tools_rcc.depends = src_tools_bootstrap
-src_tools_qfloat16_tables.subdir = tools/qfloat16-tables
-src_tools_qfloat16_tables.target = sub-qfloat16-tables
-src_tools_qfloat16_tables.depends = src_tools_bootstrap
-
src_tools_qlalr.subdir = tools/qlalr
src_tools_qlalr.target = sub-qlalr
force_bootstrap: src_tools_qlalr.depends = src_tools_bootstrap
@@ -59,6 +55,10 @@ src_tools_androiddeployqt.subdir = tools/androiddeployqt
src_tools_androiddeployqt.target = sub-androiddeployqt
src_tools_androiddeployqt.depends = src_corelib
+src_tools_androidtestrunner.subdir = tools/androidtestrunner
+src_tools_androidtestrunner.target = sub-androidtestrunner
+src_tools_androidtestrunner.depends = src_corelib
+
src_tools_qvkgen.subdir = tools/qvkgen
src_tools_qvkgen.target = sub-qvkgen
force_bootstrap: src_tools_qvkgen.depends = src_tools_bootstrap
@@ -70,7 +70,7 @@ src_winmain.depends = sub-corelib # just for the module .pri file
src_corelib.subdir = $$PWD/corelib
src_corelib.target = sub-corelib
-src_corelib.depends = src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qfloat16_tables
+src_corelib.depends = src_tools_moc src_tools_rcc src_tools_tracegen
src_xml.subdir = $$PWD/xml
src_xml.target = sub-xml
@@ -157,12 +157,12 @@ src_android.subdir = $$PWD/android
src_3rdparty_freetype.depends += src_corelib
}
}
-SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qfloat16_tables
+SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_tracegen
qtConfig(regularexpression):pcre2 {
SUBDIRS += src_3rdparty_pcre2
src_corelib.depends += src_3rdparty_pcre2
}
-TOOLS = src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qlalr src_tools_qfloat16_tables
+TOOLS = src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qlalr
SUBDIRS += src_corelib src_tools_qlalr
win32:SUBDIRS += src_winmain
qtConfig(network) {
@@ -186,8 +186,10 @@ qtConfig(dbus) {
}
android {
- SUBDIRS += src_tools_androiddeployqt
- TOOLS += src_tools_androiddeployqt
+ SUBDIRS += src_tools_androiddeployqt \
+ src_tools_androidtestrunner
+ TOOLS += src_tools_androiddeployqt \
+ src_tools_androidtestrunner
}
qtConfig(concurrent): SUBDIRS += src_concurrent
@@ -209,9 +211,11 @@ qtConfig(gui) {
SUBDIRS += src_3rdparty_freetype
src_platformsupport.depends += src_3rdparty_freetype
}
- SUBDIRS += src_tools_qvkgen
- src_gui.depends += src_tools_qvkgen
- TOOLS += src_tools_qvkgen
+ qtConfig(vkgen) {
+ SUBDIRS += src_tools_qvkgen
+ src_gui.depends += src_tools_qvkgen
+ TOOLS += src_tools_qvkgen
+ }
SUBDIRS += src_gui src_platformsupport src_platformheaders
qtConfig(opengl): SUBDIRS += src_openglextensions
src_plugins.depends += src_gui src_platformsupport src_platformheaders
diff --git a/src/testlib/configure.json b/src/testlib/configure.json
index df6132cdc2..726f614ee5 100644
--- a/src/testlib/configure.json
+++ b/src/testlib/configure.json
@@ -16,6 +16,12 @@
"purpose": "Provides a utility to test item models.",
"condition": "features.itemmodel",
"output": [ "publicFeature" ]
+ },
+ "valgrind": {
+ "label": "Valgrind",
+ "purpose": "Profiling support with callgrind.",
+ "condition": "(config.linux || config.darwin) && features.process && features.regularexpression",
+ "output": [ "publicFeature" ]
}
},
diff --git a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp
index a4513a55a9..37aba2715b 100644
--- a/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp
+++ b/src/testlib/doc/snippets/code/doc_src_qsignalspy.cpp
@@ -98,3 +98,51 @@ QVERIFY(spy.wait(1000));
QSignalSpy spy(myPushButton, &QPushButton::clicked);
//! [6]
+//! [7]
+QObject object;
+auto mo = object.metaObject();
+auto signalIndex = mo->indexOfSignal("objectNameChanged(QString)");
+auto signal = mo->method(signalIndex);
+
+QSignalSpy spy(&object, signal);
+object.setObjectName("A new object name");
+QCOMPARE(spy.count(), 1);
+//! [7]
+
+//! [8]
+void tst_QWindow::writeMinMaxDimensionalProps_data()
+ QTest::addColumn<int>("propertyIndex");
+
+ // Collect all relevant properties
+ static const auto mo = QWindow::staticMetaObject;
+ for (int i = mo.propertyOffset(); i < mo.propertyCount(); ++i) {
+ auto property = mo.property(i);
+
+ // ...that have type int
+ if (property.type() == QVariant::Int) {
+ static const QRegularExpression re("^minimum|maximum");
+ const auto name = property.name();
+
+ // ...and start with "minimum" or "maximum"
+ if (re.match(name).hasMatch()) {
+ QTest::addRow("%s", name) << i;
+ }
+ }
+ }
+}
+
+void tst_QWindow::writeMinMaxDimensionalProps()
+{
+ QFETCH(int, propertyIndex);
+
+ auto property = QWindow::staticMetaObject.property(propertyIndex);
+ QVERIFY(property.isWritable());
+ QVERIFY(property.hasNotifySignal());
+
+ QWindow window;
+ QSignalSpy spy(&window, property.notifySignal());
+
+ QVERIFY(property.write(&window, 42));
+ QCOMPARE(spy.count(), 1);
+}
+//! [8]
diff --git a/src/testlib/doc/src/qttestlib-manual.qdoc b/src/testlib/doc/src/qttestlib-manual.qdoc
index a55671522b..19d871d404 100644
--- a/src/testlib/doc/src/qttestlib-manual.qdoc
+++ b/src/testlib/doc/src/qttestlib-manual.qdoc
@@ -123,6 +123,11 @@
Example:
\snippet code/doc_src_qtestlib.cpp 0
+ Finally, if the test class has a static public \c{void initMain()} method,
+ it is called by the QTEST_MAIN macros before the QApplication object
+ is instantiated. For example, this allows for setting application
+ attributes like Qt::AA_DisableHighDpiScaling. This was added in 5.14.
+
For more examples, refer to the \l{Qt Test Tutorial}.
\if !defined(qtforpython)
diff --git a/src/testlib/qabstracttestlogger.cpp b/src/testlib/qabstracttestlogger.cpp
index 2b54cd410b..ff05dd88c7 100644
--- a/src/testlib/qabstracttestlogger.cpp
+++ b/src/testlib/qabstracttestlogger.cpp
@@ -87,7 +87,7 @@ QAbstractTestLogger::~QAbstractTestLogger()
if (stream != stdout) {
fclose(stream);
}
- stream = 0;
+ stream = nullptr;
}
void QAbstractTestLogger::filterUnprintable(char *str) const
diff --git a/src/testlib/qabstracttestlogger_p.h b/src/testlib/qabstracttestlogger_p.h
index a64e7ea96f..e5a1404c16 100644
--- a/src/testlib/qabstracttestlogger_p.h
+++ b/src/testlib/qabstracttestlogger_p.h
@@ -97,14 +97,14 @@ public:
virtual void enterTestData(QTestData *) {}
virtual void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) = 0;
+ const char *file = nullptr, int line = 0) = 0;
virtual void addBenchmarkResult(const QBenchmarkResult &result) = 0;
virtual void addMessage(QtMsgType, const QMessageLogContext &,
const QString &);
virtual void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) = 0;
+ const char *file = nullptr, int line = 0) = 0;
void outputString(const char *msg);
@@ -117,8 +117,7 @@ struct QTestCharBuffer
{
enum { InitialSize = 512 };
- inline QTestCharBuffer()
- : _size(InitialSize), buf(staticBuf)
+ inline QTestCharBuffer() : buf(staticBuf)
{
staticBuf[0] = '\0';
}
@@ -151,7 +150,7 @@ struct QTestCharBuffer
inline bool reset(int newSize)
{
- char *newBuf = 0;
+ char *newBuf = nullptr;
if (buf == staticBuf) {
// if we point to our internal buffer, we need to malloc first
newBuf = reinterpret_cast<char *>(malloc(newSize));
@@ -170,7 +169,7 @@ struct QTestCharBuffer
}
private:
- int _size;
+ int _size = InitialSize;
char* buf;
char staticBuf[InitialSize];
};
diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp
index d49d07bb70..aafdc64831 100644
--- a/src/testlib/qbenchmark.cpp
+++ b/src/testlib/qbenchmark.cpp
@@ -51,14 +51,6 @@ QT_BEGIN_NAMESPACE
QBenchmarkGlobalData *QBenchmarkGlobalData::current;
QBenchmarkGlobalData::QBenchmarkGlobalData()
- : measurer(0)
- , walltimeMinimum(-1)
- , iterationCount(-1)
- , medianIterationCount(-1)
- , createChart(false)
- , verboseOutput(false)
- , minimumTotal(-1)
- , mode_(WallTime)
{
setMode(mode_);
}
@@ -66,23 +58,23 @@ QBenchmarkGlobalData::QBenchmarkGlobalData()
QBenchmarkGlobalData::~QBenchmarkGlobalData()
{
delete measurer;
- QBenchmarkGlobalData::current = 0;
+ if (QBenchmarkGlobalData::current == this)
+ QBenchmarkGlobalData::current = nullptr;
}
void QBenchmarkGlobalData::setMode(Mode mode)
{
mode_ = mode;
- if (measurer)
- delete measurer;
+ delete measurer;
measurer = createMeasurer();
}
QBenchmarkMeasurerBase * QBenchmarkGlobalData::createMeasurer()
{
- QBenchmarkMeasurerBase *measurer = 0;
+ QBenchmarkMeasurerBase *measurer = nullptr;
if (0) {
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
} else if (mode_ == CallgrindChildProcess || mode_ == CallgrindParentProcess) {
measurer = new QBenchmarkCallgrindMeasurer;
#endif
@@ -105,24 +97,18 @@ QBenchmarkMeasurerBase * QBenchmarkGlobalData::createMeasurer()
int QBenchmarkGlobalData::adjustMedianIterationCount()
{
- if (medianIterationCount != -1) {
- return medianIterationCount;
- } else {
- return measurer->adjustMedianCount(1);
- }
+ return medianIterationCount != -1
+ ? medianIterationCount : measurer->adjustMedianCount(1);
}
QBenchmarkTestMethodData *QBenchmarkTestMethodData::current;
-QBenchmarkTestMethodData::QBenchmarkTestMethodData()
-:resultAccepted(false), runOnce(false), iterationCount(-1)
-{
-}
+QBenchmarkTestMethodData::QBenchmarkTestMethodData() = default;
QBenchmarkTestMethodData::~QBenchmarkTestMethodData()
{
- QBenchmarkTestMethodData::current = 0;
+ QBenchmarkTestMethodData::current = nullptr;
}
void QBenchmarkTestMethodData::beginDataRun()
diff --git a/src/testlib/qbenchmark_p.h b/src/testlib/qbenchmark_p.h
index 3fa9c5f534..93b5becb2b 100644
--- a/src/testlib/qbenchmark_p.h
+++ b/src/testlib/qbenchmark_p.h
@@ -55,12 +55,6 @@
#include <QtCore/qglobal.h>
-#if (defined(Q_OS_LINUX) || defined Q_OS_MACOS) && QT_CONFIG(process)
-#define QTESTLIB_USE_VALGRIND
-#else
-#undef QTESTLIB_USE_VALGRIND
-#endif
-
#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) && !defined(Q_OS_ANDROID)
#define QTESTLIB_USE_PERF_EVENTS
#else
@@ -70,7 +64,7 @@
#include <QtTest/private/qbenchmarkmeasurement_p.h>
#include <QtCore/QMap>
#include <QtTest/qttestglobal.h>
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
#include <QtTest/private/qbenchmarkvalgrind_p.h>
#endif
#ifdef QTESTLIB_USE_PERF_EVENTS
@@ -87,7 +81,7 @@ struct QBenchmarkContext
QString slotName;
QString tag; // from _data() function
- int checkpointIndex;
+ int checkpointIndex = -1;
QString toString() const
{
@@ -95,7 +89,7 @@ struct QBenchmarkContext
.arg(slotName, tag, QString::number(checkpointIndex));
}
- QBenchmarkContext() : checkpointIndex(-1) {}
+ QBenchmarkContext() = default;
};
Q_DECLARE_TYPEINFO(QBenchmarkContext, Q_MOVABLE_TYPE);
@@ -103,19 +97,13 @@ class QBenchmarkResult
{
public:
QBenchmarkContext context;
- qreal value;
- int iterations;
- QTest::QBenchmarkMetric metric;
- bool setByMacro;
- bool valid;
-
- QBenchmarkResult()
- : value(-1)
- , iterations(-1)
- , metric(QTest::FramesPerSecond)
- , setByMacro(true)
- , valid(false)
- { }
+ qreal value = -1;
+ int iterations = -1;
+ QTest::QBenchmarkMetric metric = QTest::FramesPerSecond;
+ bool setByMacro = true;
+ bool valid = false;
+
+ QBenchmarkResult() = default;
QBenchmarkResult(
const QBenchmarkContext &context, const qreal value, const int iterations,
@@ -153,17 +141,17 @@ public:
QBenchmarkMeasurerBase *createMeasurer();
int adjustMedianIterationCount();
- QBenchmarkMeasurerBase *measurer;
+ QBenchmarkMeasurerBase *measurer = nullptr;
QBenchmarkContext context;
- int walltimeMinimum;
- int iterationCount;
- int medianIterationCount;
- bool createChart;
- bool verboseOutput;
+ int walltimeMinimum = -1;
+ int iterationCount = -1;
+ int medianIterationCount = -1;
+ bool createChart = false;
+ bool verboseOutput = false;
QString callgrindOutFileBase;
- int minimumTotal;
+ int minimumTotal = -1;
private:
- Mode mode_;
+ Mode mode_ = WallTime;
};
/*
@@ -190,9 +178,9 @@ public:
void setResult(qreal value, QTest::QBenchmarkMetric metric, bool setByMacro = true);
QBenchmarkResult result;
- bool resultAccepted;
- bool runOnce;
- int iterationCount;
+ bool resultAccepted = false;
+ bool runOnce = false;
+ int iterationCount = -1;
};
// low-level API:
diff --git a/src/testlib/qbenchmarkevent.cpp b/src/testlib/qbenchmarkevent.cpp
index f696f8b1eb..bcae9325cd 100644
--- a/src/testlib/qbenchmarkevent.cpp
+++ b/src/testlib/qbenchmarkevent.cpp
@@ -44,14 +44,9 @@
QT_BEGIN_NAMESPACE
-QBenchmarkEvent::QBenchmarkEvent()
- : eventCounter(0)
-{
-}
+QBenchmarkEvent::QBenchmarkEvent() = default;
-QBenchmarkEvent::~QBenchmarkEvent()
-{
-}
+QBenchmarkEvent::~QBenchmarkEvent() = default;
void QBenchmarkEvent::start()
{
@@ -96,7 +91,11 @@ QTest::QBenchmarkMetric QBenchmarkEvent::metricType()
}
// This could be done in a much better way, this is just the beginning.
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QBenchmarkEvent::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QBenchmarkEvent::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
+#endif
{
Q_UNUSED(eventType);
Q_UNUSED(message);
diff --git a/src/testlib/qbenchmarkevent_p.h b/src/testlib/qbenchmarkevent_p.h
index af42a17141..9fe3daa33b 100644
--- a/src/testlib/qbenchmarkevent_p.h
+++ b/src/testlib/qbenchmarkevent_p.h
@@ -71,8 +71,12 @@ public:
int adjustMedianCount(int suggestion) override;
bool repeatCount() override { return 1; }
QTest::QBenchmarkMetric metricType() override;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
+#else
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
- qint64 eventCounter;
+#endif
+ qint64 eventCounter = 0;
};
QT_END_NAMESPACE
diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h
index 8dbfd4b618..1e2b82c25d 100644
--- a/src/testlib/qbenchmarkmeasurement_p.h
+++ b/src/testlib/qbenchmarkmeasurement_p.h
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
class QBenchmarkMeasurerBase
{
public:
- virtual ~QBenchmarkMeasurerBase() {}
+ virtual ~QBenchmarkMeasurerBase() = default;
virtual void init() {}
virtual void start() = 0;
virtual qint64 checkpoint() = 0;
@@ -66,7 +66,7 @@ public:
virtual bool isMeasurementAccepted(qint64 measurement) = 0;
virtual int adjustIterationCount(int suggestion) = 0;
virtual int adjustMedianCount(int suggestion) = 0;
- virtual bool repeatCount() { return 1; }
+ virtual bool repeatCount() { return true; }
virtual bool needsWarmupIteration() { return false; }
virtual QTest::QBenchmarkMetric metricType() = 0;
};
diff --git a/src/testlib/qbenchmarkperfevents.cpp b/src/testlib/qbenchmarkperfevents.cpp
index 91f0792338..e8c6969d4a 100644
--- a/src/testlib/qbenchmarkperfevents.cpp
+++ b/src/testlib/qbenchmarkperfevents.cpp
@@ -147,7 +147,7 @@ bool QBenchmarkPerfEventsMeasurer::isAvailable()
{
// this generates an EFAULT because attr == NULL if perf_event_open is available
// if the kernel is too old, it generates ENOSYS
- return perf_event_open(0, 0, 0, 0, 0) == -1 && errno != ENOSYS;
+ return perf_event_open(nullptr, 0, 0, 0, 0) == -1 && errno != ENOSYS;
}
/* Event list structure
@@ -500,10 +500,7 @@ void QBenchmarkPerfEventsMeasurer::listCounters()
"Attributes can be combined, for example: -perfcounter branch-mispredicts:kh\n");
}
-QBenchmarkPerfEventsMeasurer::QBenchmarkPerfEventsMeasurer()
- : fd(-1)
-{
-}
+QBenchmarkPerfEventsMeasurer::QBenchmarkPerfEventsMeasurer() = default;
QBenchmarkPerfEventsMeasurer::~QBenchmarkPerfEventsMeasurer()
{
diff --git a/src/testlib/qbenchmarkperfevents_p.h b/src/testlib/qbenchmarkperfevents_p.h
index 86ba556549..3f27161ef5 100644
--- a/src/testlib/qbenchmarkperfevents_p.h
+++ b/src/testlib/qbenchmarkperfevents_p.h
@@ -60,23 +60,23 @@ class QBenchmarkPerfEventsMeasurer : public QBenchmarkMeasurerBase
public:
QBenchmarkPerfEventsMeasurer();
~QBenchmarkPerfEventsMeasurer();
- virtual void init() override;
- virtual void start() override;
- virtual qint64 checkpoint() override;
- virtual qint64 stop() override;
- virtual bool isMeasurementAccepted(qint64 measurement) override;
- virtual int adjustIterationCount(int suggestion) override;
- virtual int adjustMedianCount(int suggestion) override;
- virtual bool repeatCount() override { return 1; }
- virtual bool needsWarmupIteration() override { return true; }
- virtual QTest::QBenchmarkMetric metricType() override;
+ void init() override;
+ void start() override;
+ qint64 checkpoint() override;
+ qint64 stop() override;
+ bool isMeasurementAccepted(qint64 measurement) override;
+ int adjustIterationCount(int suggestion) override;
+ int adjustMedianCount(int suggestion) override;
+ bool repeatCount() override { return true; }
+ bool needsWarmupIteration() override { return true; }
+ QTest::QBenchmarkMetric metricType() override;
static bool isAvailable();
static QTest::QBenchmarkMetric metricForEvent(quint32 type, quint64 event_id);
static void setCounter(const char *name);
static void listCounters();
private:
- int fd;
+ int fd = -1;
qint64 readValue();
};
diff --git a/src/testlib/qbenchmarkvalgrind.cpp b/src/testlib/qbenchmarkvalgrind.cpp
index 7d24eb8293..44888c4d30 100644
--- a/src/testlib/qbenchmarkvalgrind.cpp
+++ b/src/testlib/qbenchmarkvalgrind.cpp
@@ -39,8 +39,6 @@
#include <QtTest/private/qbenchmark_p.h>
-#ifdef QTESTLIB_USE_VALGRIND
-
#include <QtTest/private/qbenchmarkvalgrind_p.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qcoreapplication.h>
@@ -170,7 +168,7 @@ QString QBenchmarkValgrindUtils::outFileBase(qint64 pid)
// Returns \c true upon success, otherwise false.
bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppArgs, int &exitCode)
{
- const QString execFile(origAppArgs.at(0));
+ const QString &execFile = origAppArgs.at(0);
QStringList args;
args << QLatin1String("--tool=callgrind") << QLatin1String("--instr-atstart=yes")
<< QLatin1String("--quiet")
@@ -179,7 +177,7 @@ bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppA
// pass on original arguments that make sense (e.g. avoid wasting time producing output
// that will be ignored anyway) ...
for (int i = 1; i < origAppArgs.size(); ++i) {
- const QString arg(origAppArgs.at(i));
+ const QString &arg = origAppArgs.at(i);
if (arg == QLatin1String("-callgrind"))
continue;
args << arg; // ok to pass on
@@ -243,5 +241,3 @@ QTest::QBenchmarkMetric QBenchmarkCallgrindMeasurer::metricType()
}
QT_END_NAMESPACE
-
-#endif // QTESTLIB_USE_VALGRIND
diff --git a/src/testlib/qbenchmarkvalgrind_p.h b/src/testlib/qbenchmarkvalgrind_p.h
index 69219b9a65..0619be9f22 100644
--- a/src/testlib/qbenchmarkvalgrind_p.h
+++ b/src/testlib/qbenchmarkvalgrind_p.h
@@ -58,6 +58,8 @@
class QStringList;
+QT_REQUIRE_CONFIG(valgrind);
+
QT_BEGIN_NAMESPACE
class QBenchmarkValgrindUtils
diff --git a/src/testlib/qcsvbenchmarklogger.cpp b/src/testlib/qcsvbenchmarklogger.cpp
index ee7270b634..f410ec6e3d 100644
--- a/src/testlib/qcsvbenchmarklogger.cpp
+++ b/src/testlib/qcsvbenchmarklogger.cpp
@@ -46,9 +46,7 @@ QCsvBenchmarkLogger::QCsvBenchmarkLogger(const char *filename)
{
}
-QCsvBenchmarkLogger::~QCsvBenchmarkLogger()
-{
-}
+QCsvBenchmarkLogger::~QCsvBenchmarkLogger() = default;
void QCsvBenchmarkLogger::startLogging()
{
diff --git a/src/testlib/qcsvbenchmarklogger_p.h b/src/testlib/qcsvbenchmarklogger_p.h
index 5840aee0f5..83e465c859 100644
--- a/src/testlib/qcsvbenchmarklogger_p.h
+++ b/src/testlib/qcsvbenchmarklogger_p.h
@@ -68,11 +68,11 @@ public:
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
};
QT_END_NAMESPACE
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp
index ed53dcdde8..c2e0bebaa0 100644
--- a/src/testlib/qplaintestlogger.cpp
+++ b/src/testlib/qplaintestlogger.cpp
@@ -316,9 +316,7 @@ QPlainTestLogger::QPlainTestLogger(const char *filename)
{
}
-QPlainTestLogger::~QPlainTestLogger()
-{
-}
+QPlainTestLogger::~QPlainTestLogger() = default;
void QPlainTestLogger::startLogging()
{
diff --git a/src/testlib/qplaintestlogger_p.h b/src/testlib/qplaintestlogger_p.h
index 55755830b2..80ef4864c1 100644
--- a/src/testlib/qplaintestlogger_p.h
+++ b/src/testlib/qplaintestlogger_p.h
@@ -68,17 +68,17 @@ public:
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(QtMsgType, const QMessageLogContext &,
const QString &) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
private:
- void printMessage(const char *type, const char *msg, const char *file = 0, int line = 0);
+ void printMessage(const char *type, const char *msg, const char *file = nullptr, int line = 0);
void outputMessage(const char *str);
void printBenchmarkResult(const QBenchmarkResult &result);
};
diff --git a/src/testlib/qsignaldumper.cpp b/src/testlib/qsignaldumper.cpp
index 8305c5d424..70f4d5e63d 100644
--- a/src/testlib/qsignaldumper.cpp
+++ b/src/testlib/qsignaldumper.cpp
@@ -56,7 +56,7 @@ namespace QTest
inline static void qPrintMessage(const QByteArray &ba)
{
- QTestLog::info(ba.constData(), 0, 0);
+ QTestLog::info(ba.constData(), nullptr, 0);
}
Q_GLOBAL_STATIC(QList<QByteArray>, ignoreClasses)
@@ -87,7 +87,7 @@ static void qSignalDumperCallback(QObject *caller, int signal_index, void **argv
str += objname.toLocal8Bit();
if (!objname.isEmpty())
str += ' ';
- str += QByteArray::number(quintptr(caller), 16);
+ str += QByteArray::number(quintptr(caller), 16).rightJustified(8, '0');
str += ") ";
str += member.name();
@@ -105,7 +105,7 @@ static void qSignalDumperCallback(QObject *caller, int signal_index, void **argv
str += '@';
quintptr addr = quintptr(*reinterpret_cast<void **>(argv[i + 1]));
- str.append(QByteArray::number(addr, 16));
+ str.append(QByteArray::number(addr, 16).rightJustified(8, '0'));
} else if (typeId != QMetaType::UnknownType) {
Q_ASSERT(typeId != QMetaType::Void); // void parameter => metaobject is corrupt
str.append(arg)
@@ -144,7 +144,7 @@ static void qSignalDumperCallbackSlot(QObject *caller, int method_index, void **
str += objname.toLocal8Bit();
if (!objname.isEmpty())
str += ' ';
- str += QByteArray::number(quintptr(caller), 16);
+ str += QByteArray::number(quintptr(caller), 16).rightJustified(8, '0');
str += ") ";
str += member.methodSignature();
@@ -169,14 +169,13 @@ static void qSignalDumperCallbackEndSignal(QObject *caller, int /*signal_index*/
void QSignalDumper::startDump()
{
static QSignalSpyCallbackSet set = { QTest::qSignalDumperCallback,
- QTest::qSignalDumperCallbackSlot, QTest::qSignalDumperCallbackEndSignal, 0 };
- qt_register_signal_spy_callbacks(set);
+ QTest::qSignalDumperCallbackSlot, QTest::qSignalDumperCallbackEndSignal, nullptr };
+ qt_register_signal_spy_callbacks(&set);
}
void QSignalDumper::endDump()
{
- static QSignalSpyCallbackSet nset = { 0, 0, 0 ,0 };
- qt_register_signal_spy_callbacks(nset);
+ qt_register_signal_spy_callbacks(nullptr);
}
void QSignalDumper::ignoreClass(const QByteArray &klass)
diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h
index 218a26ec5c..dc0c58044f 100644
--- a/src/testlib/qsignalspy.h
+++ b/src/testlib/qsignalspy.h
@@ -59,11 +59,8 @@ public:
explicit QSignalSpy(const QObject *obj, const char *aSignal)
: m_waiting(false)
{
- static const int memberOffset = QObject::staticMetaObject.methodCount();
- if (!obj) {
- qWarning("QSignalSpy: Cannot spy on a null object");
+ if (!isObjectValid(obj))
return;
- }
if (!aSignal) {
qWarning("QSignalSpy: Null signal name is not valid");
@@ -83,11 +80,9 @@ public:
return;
}
- if (!QMetaObject::connect(obj, sigIndex, this, memberOffset,
- Qt::DirectConnection, nullptr)) {
- qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
+ if (!connectToSignal(obj, sigIndex))
return;
- }
+
sig = ba;
initArgs(mo->method(sigIndex), obj);
}
@@ -100,11 +95,8 @@ public:
QSignalSpy(const typename QtPrivate::FunctionPointer<Func>::Object *obj, Func signal0)
: m_waiting(false)
{
- static const int memberOffset = QObject::staticMetaObject.methodCount();
- if (!obj) {
- qWarning("QSignalSpy: Cannot spy on a null object");
+ if (!isObjectValid(obj))
return;
- }
if (!signal0) {
qWarning("QSignalSpy: Null signal name is not valid");
@@ -114,23 +106,28 @@ public:
const QMetaObject * const mo = obj->metaObject();
const QMetaMethod signalMetaMethod = QMetaMethod::fromSignal(signal0);
const int sigIndex = signalMetaMethod.methodIndex();
- if (!signalMetaMethod.isValid() ||
- signalMetaMethod.methodType() != QMetaMethod::Signal) {
- qWarning("QSignalSpy: Not a valid signal: '%s'",
- signalMetaMethod.methodSignature().constData());
+
+ if (!isSignalMetaMethodValid(signalMetaMethod))
return;
- }
- if (!QMetaObject::connect(obj, sigIndex, this, memberOffset,
- Qt::DirectConnection, 0)) {
- qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
+ if (!connectToSignal(obj, sigIndex))
return;
- }
+
sig = signalMetaMethod.methodSignature();
initArgs(mo->method(sigIndex), obj);
}
#endif // Q_CLANG_QDOC
+ QSignalSpy(const QObject *obj, const QMetaMethod &signal)
+ : m_waiting(false)
+ {
+ if (isObjectValid(obj) && isSignalMetaMethodValid(signal) &&
+ connectToSignal(obj, signal.methodIndex())) {
+ sig = signal.methodSignature();
+ initArgs(signal, obj);
+ }
+ }
+
inline bool isValid() const { return !sig.isEmpty(); }
inline QByteArray signal() const { return sig; }
@@ -160,6 +157,38 @@ public:
}
private:
+ bool connectToSignal(const QObject *sender, int sigIndex)
+ {
+ static const int memberOffset = QObject::staticMetaObject.methodCount();
+ const bool connected = QMetaObject::connect(
+ sender, sigIndex, this, memberOffset, Qt::DirectConnection, nullptr);
+
+ if (!connected)
+ qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
+
+ return connected;
+ }
+
+ static bool isSignalMetaMethodValid(const QMetaMethod &signal)
+ {
+ const bool valid = signal.isValid() && signal.methodType() == QMetaMethod::Signal;
+
+ if (!valid)
+ qWarning("QSignalSpy: Not a valid signal: '%s'", signal.methodSignature().constData());
+
+ return valid;
+ }
+
+ static bool isObjectValid(const QObject *object)
+ {
+ const bool valid = !!object;
+
+ if (!valid)
+ qWarning("QSignalSpy: Cannot spy on a null object");
+
+ return valid;
+ }
+
void initArgs(const QMetaMethod &member, const QObject *obj)
{
args.reserve(member.parameterCount());
diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc
index 39639d0a09..d532ad478d 100644
--- a/src/testlib/qsignalspy.qdoc
+++ b/src/testlib/qsignalspy.qdoc
@@ -98,6 +98,28 @@
\snippet code/doc_src_qsignalspy.cpp 6
*/
+/*! \fn QSignalSpy(const QObject *obj, const QMetaMethod &signal)
+ \since 5.14
+
+ Constructs a new QSignalSpy that listens for emissions of the \a signal
+ from the QObject \a object. If QSignalSpy is not able to listen for a
+ valid signal (for example, because \a object is \nullptr or \a signal does
+ not denote a valid signal of \a object), an explanatory warning message
+ will be output using qWarning() and subsequent calls to \c isValid() will
+ return false.
+
+ This constructor is convenient to use when Qt's meta-object system is
+ heavily used in a test.
+
+ Basic usage example:
+ \snippet code/doc_src_qsignalspy.cpp 7
+
+ Imagine we need to check whether all properties of the QWindow class
+ that represent minimum and maximum dimensions are properly writable.
+ The following example demonstrates one of the approaches:
+ \snippet code/doc_src_qsignalspy.cpp 8
+*/
+
/*! \fn QSignalSpy::isValid() const
Returns \c true if the signal spy listens to a valid signal, otherwise false.
diff --git a/src/testlib/qtaptestlogger.cpp b/src/testlib/qtaptestlogger.cpp
index 540b36e273..5b5a3c4875 100644
--- a/src/testlib/qtaptestlogger.cpp
+++ b/src/testlib/qtaptestlogger.cpp
@@ -55,9 +55,7 @@ QTapTestLogger::QTapTestLogger(const char *filename)
{
}
-QTapTestLogger::~QTapTestLogger()
-{
-}
+QTapTestLogger::~QTapTestLogger() = default;
void QTapTestLogger::startLogging()
{
@@ -154,10 +152,10 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
// This is fragile, but unfortunately testlib doesn't plumb
// the expected and actual values to the loggers (yet).
static QRegularExpression verifyRegex(
- QLatin1Literal("^'(?<actualexpression>.*)' returned (?<actual>\\w+).+\\((?<message>.*)\\)$"));
+ QLatin1String("^'(?<actualexpression>.*)' returned (?<actual>\\w+).+\\((?<message>.*)\\)$"));
static QRegularExpression comparRegex(
- QLatin1Literal("^(?<message>.*)\n"
+ QLatin1String("^(?<message>.*)\n"
"\\s*Actual\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n"
"\\s*Expected\\s+\\((?<expectedexpresssion>.*)\\)\\s*: (?<expected>.*)$"));
@@ -168,22 +166,22 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
if (match.hasMatch()) {
bool isVerify = match.regularExpression() == verifyRegex;
- QString message = match.captured(QLatin1Literal("message"));
+ QString message = match.captured(QLatin1String("message"));
QString expected;
QString actual;
if (isVerify) {
- QString expression = QLatin1Literal(" (")
- % match.captured(QLatin1Literal("actualexpression")) % QLatin1Char(')') ;
- actual = match.captured(QLatin1Literal("actual")).toLower() % expression;
- expected = (actual.startsWith(QLatin1Literal("true")) ? QLatin1Literal("false") : QLatin1Literal("true")) % expression;
+ QString expression = QLatin1String(" (")
+ % match.captured(QLatin1String("actualexpression")) % QLatin1Char(')') ;
+ actual = match.captured(QLatin1String("actual")).toLower() % expression;
+ expected = (actual.startsWith(QLatin1String("true")) ? QLatin1String("false") : QLatin1String("true")) % expression;
if (message.isEmpty())
- message = QLatin1Literal("Verification failed");
+ message = QLatin1String("Verification failed");
} else {
- expected = match.captured(QLatin1Literal("expected"))
- % QLatin1Literal(" (") % match.captured(QLatin1Literal("expectedexpresssion")) % QLatin1Char(')');
- actual = match.captured(QLatin1Literal("actual"))
- % QLatin1Literal(" (") % match.captured(QLatin1Literal("actualexpression")) % QLatin1Char(')');
+ expected = match.captured(QLatin1String("expected"))
+ % QLatin1String(" (") % match.captured(QLatin1String("expectedexpresssion")) % QLatin1Char(')');
+ actual = match.captured(QLatin1String("actual"))
+ % QLatin1String(" (") % match.captured(QLatin1String("actualexpression")) % QLatin1Char(')');
}
QTestCharBuffer diagnosticsYamlish;
diff --git a/src/testlib/qtaptestlogger_p.h b/src/testlib/qtaptestlogger_p.h
index b51343e4fe..967c724b51 100644
--- a/src/testlib/qtaptestlogger_p.h
+++ b/src/testlib/qtaptestlogger_p.h
@@ -70,9 +70,9 @@ public:
void enterTestData(QTestData *data) override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &) override {};
private:
diff --git a/src/testlib/qteamcitylogger.cpp b/src/testlib/qteamcitylogger.cpp
index 577c8e70cd..8a77143454 100644
--- a/src/testlib/qteamcitylogger.cpp
+++ b/src/testlib/qteamcitylogger.cpp
@@ -103,9 +103,7 @@ QTeamCityLogger::QTeamCityLogger(const char *filename)
{
}
-QTeamCityLogger::~QTeamCityLogger()
-{
-}
+QTeamCityLogger::~QTeamCityLogger() = default;
void QTeamCityLogger::startLogging()
{
@@ -224,9 +222,7 @@ QString QTeamCityLogger::tcEscapedString(const QString &str) const
{
QString formattedString;
- for (int i = 0; i < str.length(); i++) {
- QChar ch = str.at(i);
-
+ for (QChar ch : str) {
switch (ch.toLatin1()) {
case '\n':
formattedString.append(QLatin1String("|n"));
@@ -251,7 +247,7 @@ QString QTeamCityLogger::tcEscapedString(const QString &str) const
}
}
- return qMove(formattedString).simplified();
+ return std::move(formattedString).simplified();
}
QString QTeamCityLogger::escapedTestFuncName() const
diff --git a/src/testlib/qteamcitylogger_p.h b/src/testlib/qteamcitylogger_p.h
index 80f2454724..dd7c0cdcf0 100644
--- a/src/testlib/qteamcitylogger_p.h
+++ b/src/testlib/qteamcitylogger_p.h
@@ -70,11 +70,11 @@ public:
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
private:
QString currTestFuncName;
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index ebd94939ce..27fe08e8f4 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -46,12 +46,15 @@
#include <QtTest/qtestdata.h>
#include <QtTest/qbenchmark.h>
+#include <QtCore/qbitarray.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qstring.h>
#include <QtCore/qstringlist.h>
#include <QtCore/qcborcommon.h>
#include <QtCore/qdatetime.h>
+#if QT_CONFIG(itemmodel)
#include <QtCore/qabstractitemmodel.h>
+#endif
#include <QtCore/qobject.h>
#include <QtCore/qvariant.h>
#include <QtCore/qurl.h>
@@ -89,25 +92,35 @@ template<> inline char *toString(const QByteArray &ba)
return QTest::toPrettyCString(ba.constData(), ba.length());
}
+template<> inline char *toString(const QBitArray &ba)
+{
+ qsizetype size = ba.size();
+ char *str = static_cast<char *>(malloc(size + 1));
+ for (qsizetype i = 0; i < size; ++i)
+ str[i] = "01"[ba.testBit(i)];
+ str[size] = '\0';
+ return str;
+}
+
#if QT_CONFIG(datestring)
template<> inline char *toString(const QTime &time)
{
return time.isValid()
- ? qstrdup(qPrintable(time.toString(QStringViewLiteral("hh:mm:ss.zzz"))))
+ ? qstrdup(qPrintable(time.toString(u"hh:mm:ss.zzz")))
: qstrdup("Invalid QTime");
}
template<> inline char *toString(const QDate &date)
{
return date.isValid()
- ? qstrdup(qPrintable(date.toString(QStringViewLiteral("yyyy/MM/dd"))))
+ ? qstrdup(qPrintable(date.toString(u"yyyy/MM/dd")))
: qstrdup("Invalid QDate");
}
template<> inline char *toString(const QDateTime &dateTime)
{
return dateTime.isValid()
- ? qstrdup(qPrintable(dateTime.toString(QStringViewLiteral("yyyy/MM/dd hh:mm:ss.zzz[t]"))))
+ ? qstrdup(qPrintable(dateTime.toString(u"yyyy/MM/dd hh:mm:ss.zzz[t]")))
: qstrdup("Invalid QDateTime");
}
#endif // datestring
@@ -129,12 +142,14 @@ template<> inline char *toString(const QChar &c)
return qstrdup(qPrintable(QString::fromLatin1("QChar: '%1' (0x%2)").arg(c).arg(QString::number(static_cast<int>(c.unicode()), 16))));
}
+#if QT_CONFIG(itemmodel)
template<> inline char *toString(const QModelIndex &idx)
{
char msg[128];
qsnprintf(msg, sizeof(msg), "QModelIndex(%d,%d,%p,%p)", idx.row(), idx.column(), idx.internalPointer(), idx.model());
return qstrdup(msg);
}
+#endif
template<> inline char *toString(const QPoint &p)
{
@@ -364,8 +379,36 @@ inline bool qCompare(quint32 const &t1, quint64 const &t2, const char *actual,
{
return qCompare(static_cast<quint64>(t1), t2, actual, expected, file, line);
}
+namespace Internal {
+template <typename T>
+class HasInitMain // SFINAE test for the presence of initMain()
+{
+private:
+ using YesType = char[1];
+ using NoType = char[2];
+
+ template <typename C> static YesType& test( decltype(&C::initMain) ) ;
+ template <typename C> static NoType& test(...);
+
+public:
+ enum { value = sizeof(test<T>(nullptr)) == sizeof(YesType) };
+};
+
+template<typename T>
+typename std::enable_if<HasInitMain<T>::value, void>::type callInitMain()
+{
+ T::initMain();
+}
+
+template<typename T>
+typename std::enable_if<!HasInitMain<T>::value, void>::type callInitMain()
+{
}
+
+} // namespace Internal
+
+} // namespace QTest
QT_END_NAMESPACE
#ifdef QT_TESTCASE_BUILDDIR
@@ -424,52 +467,53 @@ int main(int argc, char *argv[]) \
# define QTEST_DISABLE_KEYPAD_NAVIGATION
#endif
-#define QTEST_MAIN(TestObject) \
-int main(int argc, char *argv[]) \
-{ \
+#define QTEST_MAIN_IMPL(TestObject) \
TESTLIB_SELFCOVERAGE_START(#TestObject) \
+ QT_PREPEND_NAMESPACE(QTest::Internal::callInitMain)<TestObject>(); \
QApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
QTEST_DISABLE_KEYPAD_NAVIGATION \
TestObject tc; \
QTEST_SET_MAIN_SOURCE_PATH \
- return QTest::qExec(&tc, argc, argv); \
-}
+ return QTest::qExec(&tc, argc, argv);
#elif defined(QT_GUI_LIB)
#include <QtTest/qtest_gui.h>
-#define QTEST_MAIN(TestObject) \
-int main(int argc, char *argv[]) \
-{ \
+#define QTEST_MAIN_IMPL(TestObject) \
TESTLIB_SELFCOVERAGE_START(#TestObject) \
+ QT_PREPEND_NAMESPACE(QTest::Internal::callInitMain)<TestObject>(); \
QGuiApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
TestObject tc; \
QTEST_SET_MAIN_SOURCE_PATH \
- return QTest::qExec(&tc, argc, argv); \
-}
+ return QTest::qExec(&tc, argc, argv);
#else
-#define QTEST_MAIN(TestObject) \
-int main(int argc, char *argv[]) \
-{ \
+#define QTEST_MAIN_IMPL(TestObject) \
TESTLIB_SELFCOVERAGE_START(#TestObject) \
+ QT_PREPEND_NAMESPACE(QTest::Internal::callInitMain)<TestObject>(); \
QCoreApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
TestObject tc; \
QTEST_SET_MAIN_SOURCE_PATH \
- return QTest::qExec(&tc, argc, argv); \
-}
+ return QTest::qExec(&tc, argc, argv);
#endif // QT_GUI_LIB
+#define QTEST_MAIN(TestObject) \
+int main(int argc, char *argv[]) \
+{ \
+ QTEST_MAIN_IMPL(TestObject) \
+}
+
#define QTEST_GUILESS_MAIN(TestObject) \
int main(int argc, char *argv[]) \
{ \
TESTLIB_SELFCOVERAGE_START(#TestObject) \
+ QT_PREPEND_NAMESPACE(QTest::Internal::callInitMain)<TestObject>(); \
QCoreApplication app(argc, argv); \
app.setAttribute(Qt::AA_Use96Dpi, true); \
TestObject tc; \
diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h
index e5101e6955..d1efde54b1 100644
--- a/src/testlib/qtest_gui.h
+++ b/src/testlib/qtest_gui.h
@@ -162,6 +162,14 @@ inline bool qCompare(QImage const &t1, QImage const &t2,
}
if (t1Null && t2Null)
return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
+ if (!qFuzzyCompare(t1.devicePixelRatioF(), t2.devicePixelRatioF())) {
+ qsnprintf(msg, 1024, "Compared QImages differ in device pixel ratio.\n"
+ " Actual (%s): %g\n"
+ " Expected (%s): %g",
+ actual, t1.devicePixelRatioF(),
+ expected, t2.devicePixelRatioF());
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
+ }
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QImages differ in size.\n"
" Actual (%s): %dx%d\n"
@@ -196,6 +204,14 @@ inline bool qCompare(QPixmap const &t1, QPixmap const &t2, const char *actual, c
}
if (t1Null && t2Null)
return compare_helper(true, nullptr, nullptr, nullptr, actual, expected, file, line);
+ if (!qFuzzyCompare(t1.devicePixelRatioF(), t2.devicePixelRatioF())) {
+ qsnprintf(msg, 1024, "Compared QPixmaps differ in device pixel ratio.\n"
+ " Actual (%s): %g\n"
+ " Expected (%s): %g",
+ actual, t1.devicePixelRatioF(),
+ expected, t2.devicePixelRatioF());
+ return compare_helper(false, msg, nullptr, nullptr, actual, expected, file, line);
+ }
if (t1.width() != t2.width() || t1.height() != t2.height()) {
qsnprintf(msg, 1024, "Compared QPixmaps differ in size.\n"
" Actual (%s): %dx%d\n"
diff --git a/src/testlib/qtestaccessible.h b/src/testlib/qtestaccessible.h
index d14dcec031..bd77ee77a1 100644
--- a/src/testlib/qtestaccessible.h
+++ b/src/testlib/qtestaccessible.h
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QObject;
// Use pointers since we subclass QAccessibleEvent
-typedef QList<QAccessibleEvent*> EventList;
+using EventList = QList<QAccessibleEvent*>;
bool operator==(const QAccessibleEvent &l, const QAccessibleEvent &r)
{
diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp
index 6642699758..9b7c2495d4 100644
--- a/src/testlib/qtestblacklist.cpp
+++ b/src/testlib/qtestblacklist.cpp
@@ -169,12 +169,14 @@ static QSet<QByteArray> keywords()
#endif
;
+#if QT_CONFIG(properties)
QCoreApplication *app = QCoreApplication::instance();
if (app) {
const QVariant platformName = app->property("platformName");
if (platformName.isValid())
set << platformName.toByteArray();
}
+#endif
return set;
}
@@ -208,11 +210,10 @@ static bool checkCondition(const QByteArray &condition)
static const QSet<QByteArray> matchedConditions = activeConditions();
QList<QByteArray> conds = condition.split(' ');
- for (int i = 0; i < conds.size(); ++i) {
- QByteArray c = conds.at(i);
+ for (QByteArray c : conds) {
bool result = c.startsWith('!');
if (result)
- c = c.mid(1);
+ c.remove(0, 1);
result ^= matchedConditions.contains(c);
if (!result)
@@ -222,7 +223,7 @@ static bool checkCondition(const QByteArray &condition)
}
static bool ignoreAll = false;
-static std::set<QByteArray> *ignoredTests = 0;
+static std::set<QByteArray> *ignoredTests = nullptr;
namespace QTestPrivate {
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 05a3dbbbcb..9ab12c5c68 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -289,7 +289,7 @@ namespace QTest
{
class WatchDog;
-static QObject *currentTestObject = 0;
+static QObject *currentTestObject = nullptr;
static QString mainSourcePath;
#if defined(Q_OS_MACOS)
@@ -301,7 +301,7 @@ class TestMethods {
public:
Q_DISABLE_COPY_MOVE(TestMethods)
- typedef std::vector<QMetaMethod> MetaMethods;
+ using MetaMethods = std::vector<QMetaMethod>;
explicit TestMethods(const QObject *o, const MetaMethods &m = MetaMethods());
@@ -423,7 +423,7 @@ Q_TESTLIB_EXPORT bool printAvailableFunctions = false;
Q_TESTLIB_EXPORT QStringList testFunctions;
Q_TESTLIB_EXPORT QStringList testTags;
-static void qPrintTestSlots(FILE *stream, const char *filter = 0)
+static void qPrintTestSlots(FILE *stream, const char *filter = nullptr)
{
for (int i = 0; i < QTest::currentTestObject->metaObject()->methodCount(); ++i) {
QMetaMethod sl = QTest::currentTestObject->metaObject()->method(i);
@@ -516,7 +516,7 @@ static int qToInt(const char *str)
Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool qml)
{
int logFormat = -1; // Not set
- const char *logFilename = 0;
+ const char *logFilename = nullptr;
QTest::testFunctions.clear();
QTest::testTags.clear();
@@ -574,7 +574,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool
" -nocrashhandler : Disables the crash handler. Useful for debugging crashes.\n"
"\n"
" Benchmarking options:\n"
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
" -callgrind : Use callgrind to time benchmarks\n"
#endif
#ifdef QTESTLIB_USE_PERF_EVENTS
@@ -717,7 +717,7 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool
}
} else if (strcmp(argv[i], "-nocrashhandler") == 0) {
QTest::noCrashHandler = true;
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
} else if (strcmp(argv[i], "-callgrind") == 0) {
if (QBenchmarkValgrindUtils::haveValgrind())
if (QFileInfo(QDir::currentPath()).isWritable()) {
@@ -897,7 +897,7 @@ struct QTestDataSetter
}
~QTestDataSetter()
{
- QTestResult::setCurrentTestData(0);
+ QTestResult::setCurrentTestData(nullptr);
}
};
@@ -974,11 +974,11 @@ void TestMethods::invokeTestOnData(int index) const
if (i == -1) {
QTestLog::info(qPrintable(
QString::fromLatin1("warmup stage result : %1")
- .arg(QBenchmarkTestMethodData::current->result.value)), 0, 0);
+ .arg(QBenchmarkTestMethodData::current->result.value)), nullptr, 0);
} else {
QTestLog::info(qPrintable(
QString::fromLatin1("accumulation stage result: %1")
- .arg(QBenchmarkTestMethodData::current->result.value)), 0, 0);
+ .arg(QBenchmarkTestMethodData::current->result.value)), nullptr, 0);
}
}
}
@@ -1012,14 +1012,14 @@ public:
WatchDog()
{
QMutexLocker locker(&mutex);
- timeout.store(-1);
+ timeout.storeRelaxed(-1);
start();
waitCondition.wait(&mutex);
}
~WatchDog() {
{
QMutexLocker locker(&mutex);
- timeout.store(0);
+ timeout.storeRelaxed(0);
waitCondition.wakeAll();
}
wait();
@@ -1027,21 +1027,21 @@ public:
void beginTest() {
QMutexLocker locker(&mutex);
- timeout.store(defaultTimeout());
+ timeout.storeRelaxed(defaultTimeout());
waitCondition.wakeAll();
}
void testFinished() {
QMutexLocker locker(&mutex);
- timeout.store(-1);
+ timeout.storeRelaxed(-1);
waitCondition.wakeAll();
}
void run() override {
QMutexLocker locker(&mutex);
waitCondition.wakeAll();
- while (1) {
- int t = timeout.load();
+ while (true) {
+ int t = timeout.loadRelaxed();
if (!t)
break;
if (Q_UNLIKELY(!waitCondition.wait(&mutex, t))) {
@@ -1095,7 +1095,7 @@ bool TestMethods::invokeTest(int index, const char *data, WatchDog *watchDog) co
const int globalDataCount = gTable->dataCount();
int curGlobalDataIndex = 0;
- /* For each test function that has a *_data() table/function, do: */
+ /* For each entry in the global data table, do: */
do {
if (!gTable->isEmpty())
QTestResult::setCurrentGlobalTestData(gTable->testData(curGlobalDataIndex));
@@ -1103,50 +1103,49 @@ bool TestMethods::invokeTest(int index, const char *data, WatchDog *watchDog) co
if (curGlobalDataIndex == 0) {
qsnprintf(member, 512, "%s_data()", name.constData());
invokeMethod(QTest::currentTestObject, member);
+ if (QTestResult::skipCurrentTest())
+ break;
}
bool foundFunction = false;
- if (!QTestResult::skipCurrentTest()) {
- int curDataIndex = 0;
- const int dataCount = table.dataCount();
-
- // Data tag requested but none available?
- if (data && !dataCount) {
- // Let empty data tag through.
- if (!*data)
- data = 0;
- else {
- fprintf(stderr, "Unknown testdata for function %s(): '%s'\n", name.constData(), data);
- fprintf(stderr, "Function has no testdata.\n");
- return false;
- }
+ int curDataIndex = 0;
+ const int dataCount = table.dataCount();
+
+ // Data tag requested but none available?
+ if (data && !dataCount) {
+ // Let empty data tag through.
+ if (!*data)
+ data = nullptr;
+ else {
+ fprintf(stderr, "Unknown testdata for function %s(): '%s'\n", name.constData(), data);
+ fprintf(stderr, "Function has no testdata.\n");
+ return false;
}
+ }
- /* For each entry in the data table, do: */
- do {
- QTestResult::setSkipCurrentTest(false);
- QTestResult::setBlacklistCurrentTest(false);
- if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) {
- foundFunction = true;
+ /* For each entry in this test's data table, do: */
+ do {
+ QTestResult::setSkipCurrentTest(false);
+ QTestResult::setBlacklistCurrentTest(false);
+ if (!data || !qstrcmp(data, table.testData(curDataIndex)->dataTag())) {
+ foundFunction = true;
- QTestPrivate::checkBlackLists(name.constData(), dataCount ? table.testData(curDataIndex)->dataTag() : 0);
+ QTestPrivate::checkBlackLists(name.constData(), dataCount ? table.testData(curDataIndex)->dataTag() : nullptr);
- QTestDataSetter s(curDataIndex >= dataCount ? static_cast<QTestData *>(0)
- : table.testData(curDataIndex));
+ QTestDataSetter s(curDataIndex >= dataCount ? nullptr : table.testData(curDataIndex));
- QTestPrivate::qtestMouseButtons = Qt::NoButton;
- if (watchDog)
- watchDog->beginTest();
- invokeTestOnData(index);
- if (watchDog)
- watchDog->testFinished();
+ QTestPrivate::qtestMouseButtons = Qt::NoButton;
+ if (watchDog)
+ watchDog->beginTest();
+ invokeTestOnData(index);
+ if (watchDog)
+ watchDog->testFinished();
- if (data)
- break;
- }
- ++curDataIndex;
- } while (curDataIndex < dataCount);
- }
+ if (data)
+ break;
+ }
+ ++curDataIndex;
+ } while (curDataIndex < dataCount);
if (data && !foundFunction) {
fprintf(stderr, "Unknown testdata for function %s: '%s()'\n", name.constData(), data);
@@ -1156,14 +1155,14 @@ bool TestMethods::invokeTest(int index, const char *data, WatchDog *watchDog) co
return false;
}
- QTestResult::setCurrentGlobalTestData(0);
+ QTestResult::setCurrentGlobalTestData(nullptr);
++curGlobalDataIndex;
} while (curGlobalDataIndex < globalDataCount);
QTestResult::finishedCurrentTestFunction();
QTestResult::setSkipCurrentTest(false);
QTestResult::setBlacklistCurrentTest(false);
- QTestResult::setCurrentTestData(0);
+ QTestResult::setCurrentTestData(nullptr);
return true;
}
@@ -1241,7 +1240,7 @@ char *toHexRepresentation(const char *ba, int length)
* */
const int maxLen = 50;
const int len = qMin(maxLen, length);
- char *result = 0;
+ char *result = nullptr;
if (length > maxLen) {
const int size = len * 3 + 4;
@@ -1274,10 +1273,8 @@ char *toHexRepresentation(const char *ba, int length)
++o;
if (i == len)
break;
- else {
- result[o] = ' ';
- ++o;
- }
+ result[o] = ' ';
+ ++o;
}
return result;
@@ -1459,7 +1456,7 @@ void TestMethods::invokeTests(QObject *testObject) const
QScopedPointer<WatchDog> watchDog;
if (!debuggerPresent()
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
&& QBenchmarkGlobalData::current->mode() != QBenchmarkGlobalData::CallgrindChildProcess
#endif
) {
@@ -1497,10 +1494,10 @@ void TestMethods::invokeTests(QObject *testObject) const
QTestResult::finishedCurrentTestDataCleanup();
}
QTestResult::finishedCurrentTestFunction();
- QTestResult::setCurrentTestFunction(0);
+ QTestResult::setCurrentTestFunction(nullptr);
}
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
class FatalSignalHandler
{
public:
@@ -1567,7 +1564,7 @@ FatalSignalHandler::FatalSignalHandler()
stack.ss_flags = 0;
stack.ss_size = sizeof alternate_stack;
stack.ss_sp = alternate_stack;
- sigaltstack(&stack, 0);
+ sigaltstack(&stack, nullptr);
act.sa_flags |= SA_ONSTACK;
#endif
@@ -1586,7 +1583,7 @@ FatalSignalHandler::FatalSignalHandler()
oldact.sa_flags & SA_SIGINFO ||
#endif
oldact.sa_handler != SIG_DFL) {
- sigaction(fatalSignals[i], &oldact, 0);
+ sigaction(fatalSignals[i], &oldact, nullptr);
} else
{
sigaddset(&handledSignals, fatalSignals[i]);
@@ -1611,7 +1608,7 @@ FatalSignalHandler::~FatalSignalHandler()
// If someone overwrote it in the mean time, put it back
if (oldact.sa_handler != FatalSignalHandler::signal)
- sigaction(i, &oldact, 0);
+ sigaction(i, &oldact, nullptr);
}
}
@@ -1866,7 +1863,7 @@ int QTest::qRun()
{
QTEST_ASSERT(currentTestObject);
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
int callgrindChildExitCode = 0;
#endif
@@ -1886,7 +1883,7 @@ int QTest::qRun()
} // !noCrashHandler
#endif // Q_OS_WIN
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess) {
if (Q_UNLIKELY(!qApp))
qFatal("QtTest: -callgrind option is not available with QTEST_APPLESS_MAIN");
@@ -1900,7 +1897,7 @@ int QTest::qRun()
} else
#endif
{
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
QScopedPointer<FatalSignalHandler> handler;
if (!noCrashHandler)
handler.reset(new FatalSignalHandler);
@@ -1927,7 +1924,7 @@ int QTest::qRun()
QTestResult::addFailure("Caught unhandled exception", __FILE__, __LINE__);
if (QTestResult::currentTestFunction()) {
QTestResult::finishedCurrentTestFunction();
- QTestResult::setCurrentTestFunction(0);
+ QTestResult::setCurrentTestFunction(nullptr);
}
QTestLog::stopLogging();
@@ -1936,7 +1933,7 @@ int QTest::qRun()
IOPMAssertionRelease(powerID);
}
#endif
- currentTestObject = 0;
+ currentTestObject = nullptr;
// Rethrow exception to make debugging easier.
throw;
@@ -1944,7 +1941,7 @@ int QTest::qRun()
}
#endif
-#ifdef QTESTLIB_USE_VALGRIND
+#if QT_CONFIG(valgrind)
if (QBenchmarkGlobalData::current->mode() == QBenchmarkGlobalData::CallgrindParentProcess)
return callgrindChildExitCode;
#endif
@@ -1957,13 +1954,13 @@ int QTest::qRun()
*/
void QTest::qCleanup()
{
- currentTestObject = 0;
+ currentTestObject = nullptr;
QTestTable::clearGlobalTestTable();
QTestLog::stopLogging();
delete QBenchmarkGlobalData::current;
- QBenchmarkGlobalData::current = 0;
+ QBenchmarkGlobalData::current = nullptr;
QSignalDumper::endDump();
@@ -2148,7 +2145,7 @@ QSharedPointer<QTemporaryDir> QTest::qExtractTestData(const QString &dirName)
}
}
- result = qMove(tempDir);
+ result = std::move(tempDir);
return result;
}
@@ -2206,7 +2203,7 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co
}
// 3. relative to test source.
- if (found.isEmpty()) {
+ if (found.isEmpty() && qstrncmp(file, ":/", 2) != 0) {
// srcdir is the directory containing the calling source file.
QFileInfo srcdir = QFileInfo(QFile::decodeName(file)).path();
@@ -2519,13 +2516,28 @@ bool QTest::compare_helper(bool success, const char *failureMsg,
return QTestResult::compare(success, failureMsg, val1, val2, actual, expected, file, line);
}
+template <typename T>
+static bool floatingCompare(const T &t1, const T &t2)
+{
+ switch (qFpClassify(t1))
+ {
+ case FP_INFINITE:
+ return (t1 < 0) == (t2 < 0) && qFpClassify(t2) == FP_INFINITE;
+ case FP_NAN:
+ return qFpClassify(t2) == FP_NAN;
+ default:
+ return qFuzzyCompare(t1, t2);
+ }
+}
+
/*! \fn bool QTest::qCompare(const qfloat16 &t1, const qfloat16 &t2, const char *actual, const char *expected, const char *file, int line)
\internal
*/
bool QTest::qCompare(qfloat16 const &t1, qfloat16 const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- return compare_helper(qFuzzyCompare(t1, t2), "Compared qfloat16s are not the same (fuzzy compare)",
+ return compare_helper(floatingCompare(t1, t2),
+ "Compared qfloat16s are not the same (fuzzy compare)",
toString(t1), toString(t2), actual, expected, file, line);
}
@@ -2535,17 +2547,9 @@ bool QTest::qCompare(qfloat16 const &t1, qfloat16 const &t2, const char *actual,
bool QTest::qCompare(float const &t1, float const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- bool equal = false;
- int cl1 = std::fpclassify(t1);
- int cl2 = std::fpclassify(t2);
- if (cl1 == FP_INFINITE)
- equal = ((t1 < 0) == (t2 < 0)) && cl2 == FP_INFINITE;
- else if (cl1 == FP_NAN)
- equal = (cl2 == FP_NAN);
- else
- equal = qFuzzyCompare(t1, t2);
- return compare_helper(equal, "Compared floats are not the same (fuzzy compare)",
- toString(t1), toString(t2), actual, expected, file, line);
+ return QTestResult::compare(floatingCompare(t1, t2),
+ "Compared floats are not the same (fuzzy compare)",
+ t1, t2, actual, expected, file, line);
}
/*! \fn bool QTest::qCompare(const double &t1, const double &t2, const char *actual, const char *expected, const char *file, int line)
@@ -2554,19 +2558,86 @@ bool QTest::qCompare(float const &t1, float const &t2, const char *actual, const
bool QTest::qCompare(double const &t1, double const &t2, const char *actual, const char *expected,
const char *file, int line)
{
- bool equal = false;
- int cl1 = std::fpclassify(t1);
- int cl2 = std::fpclassify(t2);
- if (cl1 == FP_INFINITE)
- equal = ((t1 < 0) == (t2 < 0)) && cl2 == FP_INFINITE;
- else if (cl1 == FP_NAN)
- equal = (cl2 == FP_NAN);
- else
- equal = qFuzzyCompare(t1, t2);
- return compare_helper(equal, "Compared doubles are not the same (fuzzy compare)",
- toString(t1), toString(t2), actual, expected, file, line);
+ return QTestResult::compare(floatingCompare(t1, t2),
+ "Compared doubles are not the same (fuzzy compare)",
+ t1, t2, actual, expected, file, line);
+}
+
+/*! \fn bool QTest::qCompare(int t1, int t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+bool QTest::qCompare(int t1, int t2, const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return QTestResult::compare(t1 == t2,
+ "Compared values are not the same",
+ t1, t2, actual, expected, file, line);
+}
+
+/*! \fn bool QTest::qCompare(unsigned t1, unsigned t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+bool QTest::qCompare(unsigned t1, unsigned t2, const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return QTestResult::compare(t1 == t2,
+ "Compared values are not the same",
+ t1, t2, actual, expected, file, line);
+}
+
+/*! \fn bool QTest::qCompare(QStringView t1, QStringView t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+bool QTest::qCompare(QStringView t1, QStringView t2, const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return QTestResult::compare(t1 == t2,
+ "Compared values are not the same",
+ t1, t2, actual, expected, file, line);
+}
+
+/*! \fn bool QTest::qCompare(QStringView t1, const QLatin1String &t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+bool QTest::qCompare(QStringView t1, const QLatin1String &t2, const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return QTestResult::compare(t1 == t2,
+ "Compared values are not the same",
+ t1, t2, actual, expected, file, line);
+}
+
+/*! \fn bool QTest::qCompare(const QLatin1String &t1, QStringView t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+bool QTest::qCompare(const QLatin1String &t1, QStringView t2, const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return QTestResult::compare(t1 == t2,
+ "Compared values are not the same",
+ t1, t2, actual, expected, file, line);
}
+/*! \fn bool QTest::qCompare(const QString &t1, const QString &t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+
+/*! \fn bool QTest::qCompare(const QString &t1, const QLatin1String &t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+
+/*! \fn bool QTest::qCompare(const QLatin1String &t1, const QString &t2, const char *actual, const char *expected, const char *file, int line)
+ \internal
+ \since 5.14
+ */
+
/*! \fn bool QTest::qCompare(const double &t1, const float &t2, const char *actual, const char *expected, const char *file, int line)
\internal
*/
@@ -2633,7 +2704,7 @@ static void massageExponent(char *text)
template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE>(const TYPE &t) \
{ \
char *msg = new char[128]; \
- switch (std::fpclassify(t)) { \
+ switch (qFpClassify(t)) { \
case FP_INFINITE: \
qstrncpy(msg, (t < 0 ? "-inf" : "inf"), 128); \
break; \
@@ -2641,22 +2712,16 @@ template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE>(const TYPE &t) \
qstrncpy(msg, "nan", 128); \
break; \
default: \
- qsnprintf(msg, 128, #FORMAT, t); \
+ qsnprintf(msg, 128, #FORMAT, double(t)); \
massageExponent(msg); \
break; \
} \
return msg; \
}
+TO_STRING_FLOAT(qfloat16, %.3g)
TO_STRING_FLOAT(float, %g)
-TO_STRING_FLOAT(double, %.12lg)
-
-template <> Q_TESTLIB_EXPORT char *QTest::toString<qfloat16>(const qfloat16 &t)
-{
- char *msg = new char[16];
- qsnprintf(msg, 16, "%.3g", static_cast<float>(t));
- return msg;
-}
+TO_STRING_FLOAT(double, %.12g)
template <> Q_TESTLIB_EXPORT char *QTest::toString<char>(const char &t)
{
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 19a7975750..e1518708e8 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -189,16 +189,8 @@ do {\
return;\
} while (false)
-#ifdef Q_COMPILER_VARIADIC_MACROS
-
#define QSKIP(statement, ...) QSKIP_INTERNAL(statement)
-#else
-
-#define QSKIP(statement) QSKIP_INTERNAL(statement)
-
-#endif
-
#define QEXPECT_FAIL(dataIndex, comment, mode)\
do {\
if (!QTest::qExpectFail(dataIndex, static_cast<const char *>(comment), QTest::mode, __FILE__, __LINE__))\
@@ -344,7 +336,7 @@ namespace QTest
template <typename T>
inline void addColumn(const char *name, T * = nullptr)
{
- typedef std::is_same<T, const char*> QIsSameTConstChar;
+ using QIsSameTConstChar = std::is_same<T, const char*>;
Q_STATIC_ASSERT_X(!QIsSameTConstChar::value, "const char* is not allowed as a test data format.");
addColumnInternal(qMetaTypeId<T>(), name);
}
@@ -371,6 +363,40 @@ namespace QTest
Q_TESTLIB_EXPORT bool qCompare(double const &t1, double const &t2,
const char *actual, const char *expected, const char *file, int line);
+ Q_TESTLIB_EXPORT bool qCompare(int t1, int t2, const char *actual, const char *expected,
+ const char *file, int line);
+
+ Q_TESTLIB_EXPORT bool qCompare(unsigned t1, unsigned t2, const char *actual, const char *expected,
+ const char *file, int line);
+
+ Q_TESTLIB_EXPORT bool qCompare(QStringView t1, QStringView t2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ Q_TESTLIB_EXPORT bool qCompare(QStringView t1, const QLatin1String &t2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ Q_TESTLIB_EXPORT bool qCompare(const QLatin1String &t1, QStringView t2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ inline bool qCompare(const QString &t1, const QString &t2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+ {
+ return qCompare(QStringView(t1), QStringView(t2), actual, expected, file, line);
+ }
+ inline bool qCompare(const QString &t1, const QLatin1String &t2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+ {
+ return qCompare(QStringView(t1), t2, actual, expected, file, line);
+ }
+ inline bool qCompare(const QLatin1String &t1, const QString &t2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+ {
+ return qCompare(t1, QStringView(t2), actual, expected, file, line);
+ }
+
inline bool compare_ptr_helper(const volatile void *t1, const volatile void *t2, const char *actual,
const char *expected, const char *file, int line)
{
diff --git a/src/testlib/qtestcoreelement_p.h b/src/testlib/qtestcoreelement_p.h
index e79efdd87f..a101ab5ea3 100644
--- a/src/testlib/qtestcoreelement_p.h
+++ b/src/testlib/qtestcoreelement_p.h
@@ -74,13 +74,13 @@ class QTestCoreElement: public QTestCoreList<ElementType>
QTest::LogElementType elementType() const;
private:
- QTestElementAttribute *listOfAttributes;
+ QTestElementAttribute *listOfAttributes = nullptr;
QTest::LogElementType type;
};
template<class ElementType>
QTestCoreElement<ElementType>::QTestCoreElement(int t)
- :listOfAttributes(0), type(QTest::LogElementType(t))
+ : type(QTest::LogElementType(t))
{
}
@@ -114,7 +114,7 @@ const char *QTestCoreElement<ElementType>::attributeValue(QTest::AttributeIndex
if (attrb)
return attrb->value();
- return 0;
+ return nullptr;
}
template <class ElementType>
@@ -124,7 +124,7 @@ const char *QTestCoreElement<ElementType>::attributeName(QTest::AttributeIndex i
if (attrb)
return attrb->name();
- return 0;
+ return nullptr;
}
template <class ElementType>
@@ -145,7 +145,7 @@ const char *QTestCoreElement<ElementType>::elementName() const
if (type != QTest::LET_Undefined)
return xmlElementNames[type];
- return 0;
+ return nullptr;
}
template <class ElementType>
@@ -165,7 +165,7 @@ const QTestElementAttribute *QTestCoreElement<ElementType>::attribute(QTest::Att
iterator = iterator->nextElement();
}
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestcorelist_p.h b/src/testlib/qtestcorelist_p.h
index 4d080f6758..daeb293644 100644
--- a/src/testlib/qtestcorelist_p.h
+++ b/src/testlib/qtestcorelist_p.h
@@ -73,8 +73,8 @@ class QTestCoreList
template <class T>
QTestCoreList<T>::QTestCoreList()
- : next(0)
- , prev(0)
+ : next(nullptr)
+ , prev(nullptr)
{
}
@@ -82,12 +82,12 @@ template <class T>
QTestCoreList<T>::~QTestCoreList()
{
if (prev) {
- prev->next = 0;
+ prev->next = nullptr;
}
delete prev;
if (next) {
- next->prev = 0;
+ next->prev = nullptr;
}
delete next;
}
diff --git a/src/testlib/qtestdata.cpp b/src/testlib/qtestdata.cpp
index a8ee130a7d..3a1c6d7e7b 100644
--- a/src/testlib/qtestdata.cpp
+++ b/src/testlib/qtestdata.cpp
@@ -51,12 +51,10 @@ QT_BEGIN_NAMESPACE
class QTestDataPrivate
{
public:
- QTestDataPrivate() : tag(0), parent(0), data(0), dataCount(0) {}
-
- char *tag;
- QTestTable *parent;
- void **data;
- int dataCount;
+ char *tag = nullptr;
+ QTestTable *parent = nullptr;
+ void **data = nullptr;
+ int dataCount = 0;
};
QTestData::QTestData(const char *tag, QTestTable *parent)
diff --git a/src/testlib/qtestelement.cpp b/src/testlib/qtestelement.cpp
index 622e5344f3..b468295917 100644
--- a/src/testlib/qtestelement.cpp
+++ b/src/testlib/qtestelement.cpp
@@ -43,8 +43,6 @@ QT_BEGIN_NAMESPACE
QTestElement::QTestElement(int type)
: QTestCoreElement<QTestElement>(type)
- , listOfChildren(0)
- , parent(0)
{
}
diff --git a/src/testlib/qtestelement_p.h b/src/testlib/qtestelement_p.h
index dacbe6c106..a6b2791a42 100644
--- a/src/testlib/qtestelement_p.h
+++ b/src/testlib/qtestelement_p.h
@@ -69,8 +69,8 @@ class QTestElement: public QTestCoreElement<QTestElement>
void setParent(const QTestElement *p);
private:
- QTestElement *listOfChildren;
- const QTestElement * parent;
+ QTestElement *listOfChildren = nullptr;
+ const QTestElement * parent = nullptr;
};
diff --git a/src/testlib/qtestelementattribute.cpp b/src/testlib/qtestelementattribute.cpp
index 9d752bf26a..e194ee50f7 100644
--- a/src/testlib/qtestelementattribute.cpp
+++ b/src/testlib/qtestelementattribute.cpp
@@ -104,11 +104,7 @@ QT_BEGIN_NAMESPACE
\value LET_SystemError
*/
-QTestElementAttribute::QTestElementAttribute()
- :attributeValue(0),
- attributeIndex(QTest::AI_Undefined)
-{
-}
+QTestElementAttribute::QTestElementAttribute() = default;
QTestElementAttribute::~QTestElementAttribute()
{
@@ -145,7 +141,7 @@ const char *QTestElementAttribute::name() const
if (attributeIndex != QTest::AI_Undefined)
return AttributeNames[attributeIndex];
- return 0;
+ return nullptr;
}
QTest::AttributeIndex QTestElementAttribute::index() const
@@ -168,7 +164,7 @@ bool QTestElementAttribute::setPair(QTest::AttributeIndex index, const char *val
attributeIndex = index;
attributeValue = qstrdup(value);
- return attributeValue != 0;
+ return attributeValue != nullptr;
}
QT_END_NAMESPACE
diff --git a/src/testlib/qtestelementattribute_p.h b/src/testlib/qtestelementattribute_p.h
index cb4dbb5f16..f3815b72d1 100644
--- a/src/testlib/qtestelementattribute_p.h
+++ b/src/testlib/qtestelementattribute_p.h
@@ -106,8 +106,8 @@ class QTestElementAttribute: public QTestCoreList<QTestElementAttribute>
bool setPair(QTest::AttributeIndex attributeIndex, const char *value);
private:
- char *attributeValue;
- QTest::AttributeIndex attributeIndex;
+ char *attributeValue = nullptr;
+ QTest::AttributeIndex attributeIndex = QTest::AI_Undefined;
};
QT_END_NAMESPACE
diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h
index a77b47cd7f..b194e24c3a 100644
--- a/src/testlib/qtesteventloop.h
+++ b/src/testlib/qtesteventloop.h
@@ -56,8 +56,7 @@ class Q_TESTLIB_EXPORT QTestEventLoop : public QObject
Q_OBJECT
public:
- inline QTestEventLoop(QObject *aParent = nullptr)
- : QObject(aParent), inLoop(false), _timeout(false), timerId(-1), loop(nullptr) {}
+ using QObject::QObject;
inline void enterLoopMSecs(int ms);
inline void enterLoop(int secs) { enterLoopMSecs(secs * 1000); }
@@ -84,10 +83,10 @@ protected:
private:
Q_DECL_UNUSED_MEMBER bool inLoop; // ### Qt 6: remove
- bool _timeout;
- int timerId;
+ bool _timeout = false;
+ int timerId = -1;
- QEventLoop *loop;
+ QEventLoop *loop = nullptr;
};
inline void QTestEventLoop::enterLoopMSecs(int ms)
diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp
index faef3912c4..f3ebf343c5 100644
--- a/src/testlib/qtestlog.cpp
+++ b/src/testlib/qtestlog.cpp
@@ -111,7 +111,7 @@ namespace QTest {
struct IgnoreResultList
{
inline IgnoreResultList(QtMsgType tp, const QVariant &patternIn)
- : type(tp), pattern(patternIn), next(0) {}
+ : type(tp), pattern(patternIn) {}
static inline void clearList(IgnoreResultList *&list)
{
@@ -163,10 +163,10 @@ namespace QTest {
QtMsgType type;
QVariant pattern;
- IgnoreResultList *next;
+ IgnoreResultList *next = nullptr;
};
- static IgnoreResultList *ignoreResultList = 0;
+ static IgnoreResultList *ignoreResultList = nullptr;
static QVector<QAbstractTestLogger*> loggers;
static bool loggerUsingStdout = false;
@@ -181,7 +181,7 @@ namespace QTest {
{
if (!ignoreResultList)
return false;
- IgnoreResultList *last = 0;
+ IgnoreResultList *last = nullptr;
IgnoreResultList *list = ignoreResultList;
while (list) {
if (list->matches(type, message)) {
@@ -191,7 +191,7 @@ namespace QTest {
else if (list->next)
ignoreResultList = list->next;
else
- ignoreResultList = 0;
+ ignoreResultList = nullptr;
delete list;
return true;
@@ -219,7 +219,7 @@ namespace QTest {
}
if (type != QtFatalMsg) {
- if (counter.load() <= 0)
+ if (counter.loadRelaxed() <= 0)
return;
if (!counter.deref()) {
@@ -438,11 +438,11 @@ void QTestLog::stopLogging()
void QTestLog::addLogger(LogMode mode, const char *filename)
{
if (filename && strcmp(filename, "-") == 0)
- filename = 0;
+ filename = nullptr;
if (!filename)
QTest::loggerUsingStdout = true;
- QAbstractTestLogger *logger = 0;
+ QAbstractTestLogger *logger = nullptr;
switch (mode) {
case QTestLog::Plain:
logger = new QPlainTestLogger(filename);
diff --git a/src/testlib/qtestlog_p.h b/src/testlib/qtestlog_p.h
index e63e89a78e..fff36f290d 100644
--- a/src/testlib/qtestlog_p.h
+++ b/src/testlib/qtestlog_p.h
@@ -66,6 +66,10 @@ class QTestData;
class Q_TESTLIB_EXPORT QTestLog
{
public:
+ QTestLog() = delete;
+ ~QTestLog() = delete;
+ Q_DISABLE_COPY_MOVE(QTestLog)
+
enum LogMode {
Plain = 0, XML, LightXML, XunitXML, CSV, TeamCity, TAP
#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
@@ -135,9 +139,6 @@ public:
static qreal msecsFunctionTime() { return QTestLog::nsecsFunctionTime() / 1000000.; }
private:
- QTestLog();
- ~QTestLog();
-
static bool printAvailableTags;
};
diff --git a/src/testlib/qtestresult.cpp b/src/testlib/qtestresult.cpp
index a7a4807e06..88028aac6e 100644
--- a/src/testlib/qtestresult.cpp
+++ b/src/testlib/qtestresult.cpp
@@ -39,42 +39,45 @@
#include <QtTest/private/qtestresult_p.h>
#include <QtCore/qglobal.h>
+#include <QtCore/qstringview.h>
#include <QtTest/private/qtestlog_p.h>
+#include <QtTest/qtest.h> // toString() specializations for QStringView
#include <QtTest/qtestdata.h>
+#include <QtTest/qtestcase.h>
#include <QtTest/qtestassert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-static const char *currentAppName = 0;
+static const char *currentAppName = nullptr;
QT_BEGIN_NAMESPACE
namespace QTest
{
- static QTestData *currentTestData = 0;
- static QTestData *currentGlobalTestData = 0;
- static const char *currentTestFunc = 0;
- static const char *currentTestObjectName = 0;
+ static QTestData *currentTestData = nullptr;
+ static QTestData *currentGlobalTestData = nullptr;
+ static const char *currentTestFunc = nullptr;
+ static const char *currentTestObjectName = nullptr;
static bool failed = false;
static bool skipCurrentTest = false;
static bool blacklistCurrentTest = false;
- static const char *expectFailComment = 0;
+ static const char *expectFailComment = nullptr;
static int expectFailMode = 0;
}
void QTestResult::reset()
{
- QTest::currentTestData = 0;
- QTest::currentGlobalTestData = 0;
- QTest::currentTestFunc = 0;
- QTest::currentTestObjectName = 0;
+ QTest::currentTestData = nullptr;
+ QTest::currentGlobalTestData = nullptr;
+ QTest::currentTestFunc = nullptr;
+ QTest::currentTestObjectName = nullptr;
QTest::failed = false;
- QTest::expectFailComment = 0;
+ QTest::expectFailComment = nullptr;
QTest::expectFailMode = 0;
QTest::blacklistCurrentTest = false;
@@ -126,18 +129,18 @@ static void clearExpectFail()
{
QTest::expectFailMode = 0;
delete [] const_cast<char *>(QTest::expectFailComment);
- QTest::expectFailComment = 0;
+ QTest::expectFailComment = nullptr;
}
void QTestResult::finishedCurrentTestData()
{
if (QTest::expectFailMode)
- addFailure("QEXPECT_FAIL was called without any subsequent verification statements", 0, 0);
+ addFailure("QEXPECT_FAIL was called without any subsequent verification statements", nullptr, 0);
clearExpectFail();
if (!QTest::failed && QTestLog::unhandledIgnoreMessages()) {
QTestLog::printUnhandledIgnoreMessages();
- addFailure("Not all expected messages were received", 0, 0);
+ addFailure("Not all expected messages were received", nullptr, 0);
}
QTestLog::clearIgnoreMessages();
}
@@ -157,7 +160,7 @@ void QTestResult::finishedCurrentTestDataCleanup()
void QTestResult::finishedCurrentTestFunction()
{
- QTest::currentTestFunc = 0;
+ QTest::currentTestFunc = nullptr;
QTest::failed = false;
QTestLog::leaveTestFunction();
@@ -170,14 +173,12 @@ const char *QTestResult::currentTestFunction()
const char *QTestResult::currentDataTag()
{
- return QTest::currentTestData ? QTest::currentTestData->dataTag()
- : static_cast<const char *>(0);
+ return QTest::currentTestData ? QTest::currentTestData->dataTag() : nullptr;
}
const char *QTestResult::currentGlobalDataTag()
{
- return QTest::currentGlobalTestData ? QTest::currentGlobalTestData->dataTag()
- : static_cast<const char *>(0);
+ return QTest::currentGlobalTestData ? QTest::currentGlobalTestData->dataTag() : nullptr;
}
static bool isExpectFailData(const char *dataIndex)
@@ -265,17 +266,54 @@ bool QTestResult::verify(bool statement, const char *statementStr,
return checkStatement(statement, msg, file, line);
}
-bool QTestResult::compare(bool success, const char *failureMsg,
- char *val1, char *val2,
- const char *actual, const char *expected,
- const char *file, int line)
+// Format failures using the toString() template
+template <class Actual, class Expected>
+void formatFailMessage(char *msg, size_t maxMsgLen,
+ const char *failureMsg,
+ const Actual &val1, const Expected &val2,
+ const char *actual, const char *expected)
{
- QTEST_ASSERT(expected);
- QTEST_ASSERT(actual);
+ auto val1S = QTest::toString(val1);
+ auto val2S = QTest::toString(val2);
+
+ size_t len1 = mbstowcs(nullptr, actual, maxMsgLen); // Last parameter is not ignored on QNX
+ size_t len2 = mbstowcs(nullptr, expected, maxMsgLen); // (result is never larger than this).
+ qsnprintf(msg, maxMsgLen, "%s\n Actual (%s)%*s %s\n Expected (%s)%*s %s",
+ failureMsg,
+ actual, qMax(len1, len2) - len1 + 1, ":", val1S ? val1S : "<null>",
+ expected, qMax(len1, len2) - len2 + 1, ":", val2S ? val2S : "<null>");
+
+ delete [] val1S;
+ delete [] val2S;
+}
+
+// Overload to format failures for "const char *" - no need to strdup().
+void formatFailMessage(char *msg, size_t maxMsgLen,
+ const char *failureMsg,
+ const char *val1, const char *val2,
+ const char *actual, const char *expected)
+{
+ size_t len1 = mbstowcs(nullptr, actual, maxMsgLen); // Last parameter is not ignored on QNX
+ size_t len2 = mbstowcs(nullptr, expected, maxMsgLen); // (result is never larger than this).
+ qsnprintf(msg, maxMsgLen, "%s\n Actual (%s)%*s %s\n Expected (%s)%*s %s",
+ failureMsg,
+ actual, qMax(len1, len2) - len1 + 1, ":", val1 ? val1 : "<null>",
+ expected, qMax(len1, len2) - len2 + 1, ":", val2 ? val2 : "<null>");
+}
+template <class Actual, class Expected>
+static bool compareHelper(bool success, const char *failureMsg,
+ const Actual &val1, const Expected &val2,
+ const char *actual, const char *expected,
+ const char *file, int line,
+ bool hasValues = true)
+{
const size_t maxMsgLen = 1024;
char msg[maxMsgLen] = {'\0'};
+ QTEST_ASSERT(expected);
+ QTEST_ASSERT(actual);
+
if (QTestLog::verboseLevel() >= 2) {
qsnprintf(msg, maxMsgLen, "QCOMPARE(%s, %s)", actual, expected);
QTestLog::info(msg, file, line);
@@ -289,20 +327,92 @@ bool QTestResult::compare(bool success, const char *failureMsg,
qsnprintf(msg, maxMsgLen,
"QCOMPARE(%s, %s) returned TRUE unexpectedly.", actual, expected);
}
- } else if (val1 || val2) {
- size_t len1 = mbstowcs(NULL, actual, maxMsgLen); // Last parameter is not ignored on QNX
- size_t len2 = mbstowcs(NULL, expected, maxMsgLen); // (result is never larger than this).
- qsnprintf(msg, maxMsgLen, "%s\n Actual (%s)%*s %s\n Expected (%s)%*s %s",
- failureMsg,
- actual, qMax(len1, len2) - len1 + 1, ":", val1 ? val1 : "<null>",
- expected, qMax(len1, len2) - len2 + 1, ":", val2 ? val2 : "<null>");
- } else
+ return checkStatement(success, msg, file, line);
+ }
+
+
+ if (!hasValues) {
qsnprintf(msg, maxMsgLen, "%s", failureMsg);
+ return checkStatement(success, msg, file, line);
+ }
+
+ formatFailMessage(msg, maxMsgLen, failureMsg, val1, val2, actual, expected);
+
+ return checkStatement(success, msg, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ char *val1, char *val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ const bool result = compareHelper(success, failureMsg,
+ val1 != nullptr ? val1 : "<null>",
+ val2 != nullptr ? val2 : "<null>",
+ actual, expected, file, line,
+ val1 != nullptr && val2 != nullptr);
+ // Our caller got these from QTest::toString()
delete [] val1;
delete [] val2;
- return checkStatement(success, msg, file, line);
+ return result;
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ double val1, double val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ float val1, float val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ int val1, int val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ unsigned val1, unsigned val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ QStringView val1, QStringView val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ QStringView val1, const QLatin1String &val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
+}
+
+bool QTestResult::compare(bool success, const char *failureMsg,
+ const QLatin1String & val1, QStringView val2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return compareHelper(success, failureMsg, val1, val2, actual, expected, file, line);
}
void QTestResult::addFailure(const char *message, const char *file, int line)
diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h
index 4df75b2805..38a3024a0f 100644
--- a/src/testlib/qtestresult_p.h
+++ b/src/testlib/qtestresult_p.h
@@ -55,6 +55,9 @@
QT_BEGIN_NAMESPACE
+class QLatin1String;
+class QStringView;
+
class QTestResultPrivate;
class QTestData;
@@ -79,7 +82,34 @@ public:
char *val1, char *val2,
const char *actual, const char *expected,
const char *file, int line);
-
+ static bool compare(bool success, const char *failureMsg,
+ double val1, double val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ float val1, float val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ int val1, int val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ unsigned val1, unsigned val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ QStringView val1, QStringView val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ const QLatin1String &val1, QStringView val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
+ static bool compare(bool success, const char *failureMsg,
+ QStringView val1, const QLatin1String &val2,
+ const char *actual, const char *expected,
+ const char *file, int line);
static void setCurrentGlobalTestData(QTestData *data);
static void setCurrentTestData(QTestData *data);
static void setCurrentTestFunction(const char *func);
diff --git a/src/testlib/qtesttable.cpp b/src/testlib/qtesttable.cpp
index 8d42668a5b..85dff17017 100644
--- a/src/testlib/qtesttable.cpp
+++ b/src/testlib/qtesttable.cpp
@@ -58,17 +58,17 @@ public:
}
struct Element {
- Element() : name(nullptr), type(0) {}
+ Element() = default;
Element(const char *n, int t) : name(n), type(t) {}
- const char *name;
- int type;
+ const char *name = nullptr;
+ int type = 0;
};
- typedef std::vector<Element> ElementList;
+ using ElementList = std::vector<Element>;
ElementList elementList;
- typedef std::vector<QTestData *> DataList;
+ using DataList = std::vector<QTestData *>;
DataList dataList;
void addColumn(int elemType, const char *elemName) { elementList.push_back(Element(elemName, elemType)); }
@@ -78,8 +78,8 @@ public:
static QTestTable *gTable;
};
-QTestTable *QTestTablePrivate::currentTestTable = 0;
-QTestTable *QTestTablePrivate::gTable = 0;
+QTestTable *QTestTablePrivate::currentTestTable = nullptr;
+QTestTable *QTestTablePrivate::gTable = nullptr;
void QTestTable::addColumn(int type, const char *name)
{
@@ -119,7 +119,7 @@ QTestTable::QTestTable()
QTestTable::~QTestTable()
{
- QTestTablePrivate::currentTestTable = 0;
+ QTestTablePrivate::currentTestTable = nullptr;
delete d;
}
@@ -152,14 +152,12 @@ private:
int QTestTable::indexOf(const char *elementName) const
{
- typedef QTestTablePrivate::ElementList::const_iterator It;
-
QTEST_ASSERT(elementName);
const QTestTablePrivate::ElementList &elementList = d->elementList;
- const It it = std::find_if(elementList.begin(), elementList.end(),
- NamePredicate(elementName));
+ const auto it = std::find_if(elementList.begin(), elementList.end(),
+ NamePredicate(elementName));
return it != elementList.end() ?
int(it - elementList.begin()) : -1;
}
@@ -174,7 +172,7 @@ QTestTable *QTestTable::globalTestTable()
void QTestTable::clearGlobalTestTable()
{
delete QTestTablePrivate::gTable;
- QTestTablePrivate::gTable = 0;
+ QTestTablePrivate::gTable = nullptr;
}
QTestTable *QTestTable::currentTestTable()
diff --git a/src/testlib/qtestxunitstreamer.cpp b/src/testlib/qtestxunitstreamer.cpp
index fe9a6e21cc..bdbdfa9610 100644
--- a/src/testlib/qtestxunitstreamer.cpp
+++ b/src/testlib/qtestxunitstreamer.cpp
@@ -54,8 +54,7 @@ QTestXunitStreamer::QTestXunitStreamer(QXunitTestLogger *logger)
QTEST_ASSERT(testLogger);
}
-QTestXunitStreamer::~QTestXunitStreamer()
-{}
+QTestXunitStreamer::~QTestXunitStreamer() = default;
void QTestXunitStreamer::indentForElement(const QTestElement* element, char* buf, int size)
{
@@ -129,7 +128,7 @@ void QTestXunitStreamer::formatAttributes(const QTestElement* element, const QTe
return;
}
- char const* key = 0;
+ char const* key = nullptr;
if (attrindex == QTest::AI_Description)
key = "message";
else if (attrindex != QTest::AI_File && attrindex != QTest::AI_Line)
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index c47042c3a0..763cea327b 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -107,9 +107,7 @@ QXmlTestLogger::QXmlTestLogger(XmlMode mode, const char *filename)
{
}
-QXmlTestLogger::~QXmlTestLogger()
-{
-}
+QXmlTestLogger::~QXmlTestLogger() = default;
void QXmlTestLogger::startLogging()
{
@@ -182,23 +180,20 @@ inline static bool isEmpty(const char *str)
static const char *incidentFormatString(bool noDescription, bool noTag)
{
if (noDescription) {
- if (noTag)
- return "<Incident type=\"%s\" file=\"%s\" line=\"%d\" />\n";
- else
- return "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ return noTag
+ ? "<Incident type=\"%s\" file=\"%s\" line=\"%d\" />\n"
+ : "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
" <DataTag><![CDATA[%s%s%s%s]]></DataTag>\n"
"</Incident>\n";
- } else {
- if (noTag)
- return "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
- " <Description><![CDATA[%s%s%s%s]]></Description>\n"
- "</Incident>\n";
- else
- return "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
- " <DataTag><![CDATA[%s%s%s]]></DataTag>\n"
- " <Description><![CDATA[%s]]></Description>\n"
- "</Incident>\n";
}
+ return noTag
+ ? "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ " <Description><![CDATA[%s%s%s%s]]></Description>\n"
+ "</Incident>\n"
+ : "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ " <DataTag><![CDATA[%s%s%s]]></DataTag>\n"
+ " <Description><![CDATA[%s]]></Description>\n"
+ "</Incident>\n";
}
static const char *benchmarkResultFormatString()
diff --git a/src/testlib/qxmltestlogger_p.h b/src/testlib/qxmltestlogger_p.h
index b85742f939..04ed57d587 100644
--- a/src/testlib/qxmltestlogger_p.h
+++ b/src/testlib/qxmltestlogger_p.h
@@ -71,11 +71,11 @@ public:
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
static int xmlCdata(QTestCharBuffer *dest, char const* src);
static int xmlQuote(QTestCharBuffer *dest, char const* src);
diff --git a/src/testlib/qxunittestlogger.cpp b/src/testlib/qxunittestlogger.cpp
index 336edb5994..b3cac9cb82 100644
--- a/src/testlib/qxunittestlogger.cpp
+++ b/src/testlib/qxunittestlogger.cpp
@@ -59,13 +59,6 @@ QT_BEGIN_NAMESPACE
QXunitTestLogger::QXunitTestLogger(const char *filename)
: QAbstractTestLogger(filename)
- , listOfTestcases(0)
- , currentLogElement(0)
- , errorLogElement(0)
- , logFormatter(0)
- , testCounter(0)
- , failureCounter(0)
- , errorCounter(0)
{
}
@@ -155,7 +148,7 @@ void QXunitTestLogger::leaveTestFunction()
void QXunitTestLogger::addIncident(IncidentTypes type, const char *description,
const char *file, int line)
{
- const char *typeBuf = 0;
+ const char *typeBuf = nullptr;
char buf[100];
switch (type) {
@@ -299,7 +292,7 @@ void QXunitTestLogger::addTag(QTestElement* element)
void QXunitTestLogger::addMessage(MessageTypes type, const QString &message, const char *file, int line)
{
QTestElement *errorElement = new QTestElement(QTest::LET_Error);
- const char *typeBuf = 0;
+ const char *typeBuf = nullptr;
switch (type) {
case QAbstractTestLogger::Warn:
diff --git a/src/testlib/qxunittestlogger_p.h b/src/testlib/qxunittestlogger_p.h
index 8fb01fbe61..518ba098f4 100644
--- a/src/testlib/qxunittestlogger_p.h
+++ b/src/testlib/qxunittestlogger_p.h
@@ -71,22 +71,22 @@ class QXunitTestLogger : public QAbstractTestLogger
void leaveTestFunction() override;
void addIncident(IncidentTypes type, const char *description,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
void addBenchmarkResult(const QBenchmarkResult &result) override;
void addTag(QTestElement* element);
void addMessage(MessageTypes type, const QString &message,
- const char *file = 0, int line = 0) override;
+ const char *file = nullptr, int line = 0) override;
private:
- QTestElement *listOfTestcases;
- QTestElement *currentLogElement;
- QTestElement *errorLogElement;
- QTestXunitStreamer *logFormatter;
+ QTestElement *listOfTestcases = nullptr;
+ QTestElement *currentLogElement = nullptr;
+ QTestElement *errorLogElement = nullptr;
+ QTestXunitStreamer *logFormatter = nullptr;
- int testCounter;
- int failureCounter;
- int errorCounter;
+ int testCounter = 0;
+ int failureCounter = 0;
+ int errorCounter = 0;
};
QT_END_NAMESPACE
diff --git a/src/testlib/testlib.pro b/src/testlib/testlib.pro
index f52a913a08..530bc6b425 100644
--- a/src/testlib/testlib.pro
+++ b/src/testlib/testlib.pro
@@ -17,7 +17,6 @@ HEADERS = \
qbenchmark_p.h \
qbenchmarkmeasurement_p.h \
qbenchmarktimemeasurers_p.h \
- qbenchmarkvalgrind_p.h \
qbenchmarkevent_p.h \
qbenchmarkperfevents_p.h \
qbenchmarkmetric.h \
@@ -70,7 +69,6 @@ SOURCES = \
qabstracttestlogger.cpp \
qbenchmark.cpp \
qbenchmarkmeasurement.cpp \
- qbenchmarkvalgrind.cpp \
qbenchmarkevent.cpp \
qbenchmarkperfevents.cpp \
qbenchmarkmetric.cpp \
@@ -92,6 +90,13 @@ qtConfig(itemmodeltester) {
qabstractitemmodeltester.cpp
}
+qtConfig(valgrind) {
+ HEADERS += \
+ qbenchmarkvalgrind_p.h
+ SOURCES += \
+ qbenchmarkvalgrind.cpp
+}
+
DEFINES *= QT_NO_CAST_TO_ASCII \
QT_NO_CAST_FROM_ASCII \
QT_NO_FOREACH \
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 01c392f8f9..feecfba8fb 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
@@ -52,6 +52,21 @@
#define QT_POPEN_READ "r"
#endif
+class ActionTimer
+{
+ qint64 started;
+public:
+ ActionTimer() = default;
+ void start()
+ {
+ started = QDateTime::currentMSecsSinceEpoch();
+ }
+ int elapsed()
+ {
+ return int(QDateTime::currentMSecsSinceEpoch() - started);
+ }
+};
+
static const bool mustReadOutputAnyway = true; // pclose seems to return the wrong error code unless we read the output
void deleteRecursively(const QString &dirName)
@@ -76,7 +91,7 @@ FILE *openProcess(const QString &command)
#if defined(Q_OS_WIN32)
QString processedCommand = QLatin1Char('\"') + command + QLatin1Char('\"');
#else
- QString processedCommand = command;
+ const QString& processedCommand = command;
#endif
return popen(processedCommand.toLocal8Bit().constData(), QT_POPEN_READ);
@@ -84,7 +99,7 @@ FILE *openProcess(const QString &command)
struct QtDependency
{
- QtDependency(QString rpath, QString apath) : relativePath(rpath), absolutePath(apath) {}
+ QtDependency(const QString &rpath, const QString &apath) : relativePath(rpath), absolutePath(apath) {}
bool operator==(const QtDependency &other) const
{
@@ -101,19 +116,16 @@ struct Options
: helpRequested(false)
, verbose(false)
, timing(false)
- , generateAssetsFileList(true)
, build(true)
- , gradle(false)
, auxMode(false)
, deploymentMechanism(Bundled)
, releasePackage(false)
- , digestAlg(QLatin1String("SHA1"))
- , sigAlg(QLatin1String("SHA1withRSA"))
+ , digestAlg(QLatin1String("SHA-256"))
+ , sigAlg(QLatin1String("SHA256withRSA"))
, internalSf(false)
, sectionsOnly(false)
, protectedAuthenticationPath(false)
, jarSigner(false)
- , gdbServer(Auto)
, installApk(false)
, uninstallApk(false)
{}
@@ -133,18 +145,14 @@ struct Options
bool helpRequested;
bool verbose;
bool timing;
- bool generateAssetsFileList;
bool build;
- bool gradle;
bool auxMode;
- bool stripLibraries = true;
- QTime timer;
+ ActionTimer timer;
// External tools
QString sdkPath;
QString sdkBuildToolsVersion;
QString ndkPath;
- QString antTool;
QString jdkPath;
// Build paths
@@ -163,22 +171,24 @@ struct Options
// lib c++ path
QString stdCppPath;
- QString stdCppName = QStringLiteral("gnustl_shared");
+ QString stdCppName = QStringLiteral("c++_shared");
// Build information
QString androidPlatform;
- QString architecture;
- QString toolchainVersion;
+ QHash<QString, QString> architectures;
+ QString currentArchitecture;
QString toolchainPrefix;
- QString toolPrefix;
- bool useLLVM = false;
QString ndkHost;
+ bool buildAAB = false;
+
// Package information
DeploymentMechanism deploymentMechanism;
QString packageName;
QStringList extraLibs;
+ QHash<QString, QStringList> archExtraLibs;
QStringList extraPlugins;
+ QHash<QString, QStringList> archExtraPlugins;
// Signing information
bool releasePackage;
@@ -197,26 +207,38 @@ struct Options
bool sectionsOnly;
bool protectedAuthenticationPath;
bool jarSigner;
-
- // Gdbserver
- TriState gdbServer;
+ QString apkPath;
// Installation information
bool installApk;
bool uninstallApk;
QString installLocation;
- // Collected information
+ // Per architecture collected information
+ void clear(const QString &arch)
+ {
+ currentArchitecture = arch;
+ }
typedef QPair<QString, QString> BundledFile;
- QList<BundledFile> bundledFiles;
- QList<QtDependency> qtDependencies;
- QStringList localLibs;
+ QHash<QString, QList<BundledFile>> bundledFiles;
+ QHash<QString, QList<QtDependency>> qtDependencies;
+ QHash<QString, QStringList> localLibs;
+ bool usesOpenGL = false;
+
+ // Per package collected information
QStringList localJars;
QStringList initClasses;
QStringList permissions;
QStringList features;
};
+static const QHash<QByteArray, QByteArray> elfArchitecures = {
+ {"aarch64", "arm64-v8a"},
+ {"arm", "armeabi-v7a"},
+ {"i386", "x86"},
+ {"x86_64", "x86_64"}
+};
+
// Copy-pasted from qmake/library/ioutil.cpp
inline static bool hasSpecialChars(const QString &arg, const uchar (&iqm)[16])
{
@@ -237,7 +259,7 @@ static QString shellQuoteUnix(const QString &arg)
}; // 0-32 \'"$`<>|;&(){}*?#!~[]
if (!arg.length())
- return QString::fromLatin1("\"\"");
+ return QLatin1String("\"\"");
QString ret(arg);
if (hasSpecialChars(ret, iqm)) {
@@ -260,7 +282,7 @@ static QString shellQuoteWin(const QString &arg)
};
if (!arg.length())
- return QString::fromLatin1("\"\"");
+ return QLatin1String("\"\"");
QString ret(arg);
if (hasSpecialChars(ret, iqm)) {
@@ -288,6 +310,59 @@ static QString shellQuote(const QString &arg)
return shellQuoteUnix(arg);
}
+QString architecureFromName(const QString &name)
+{
+ QRegExp architecture(QStringLiteral(".*_(armeabi-v7a|arm64-v8a|x86|x86_64).so"));
+ if (!architecture.exactMatch(name))
+ return {};
+ return architecture.capturedTexts().last();
+}
+
+QString fileArchitecture(const Options &options, const QString &path)
+{
+ auto arch = architecureFromName(path);
+ if (!arch.isEmpty())
+ return arch;
+
+ QString readElf = QLatin1String("%1/toolchains/%2/prebuilt/%3/bin/llvm-readobj").arg(options.ndkPath,
+ options.toolchainPrefix,
+ options.ndkHost);
+#if defined(Q_OS_WIN32)
+ readElf += QLatin1String(".exe");
+#endif
+
+ if (!QFile::exists(readElf)) {
+ fprintf(stderr, "Command does not exist: %s\n", qPrintable(readElf));
+ return {};
+ }
+
+ readElf = QLatin1String("%1 -needed-libs %2").arg(shellQuote(readElf), shellQuote(path));
+
+ FILE *readElfCommand = openProcess(readElf);
+ if (!readElfCommand) {
+ fprintf(stderr, "Cannot execute command %s\n", qPrintable(readElf));
+ return {};
+ }
+
+ char buffer[512];
+ while (fgets(buffer, sizeof(buffer), readElfCommand) != nullptr) {
+ QByteArray line = QByteArray::fromRawData(buffer, qstrlen(buffer));
+ QString library;
+ line = line.trimmed();
+ if (line.startsWith("Arch: ")) {
+ auto it = elfArchitecures.find(line.mid(6));
+ pclose(readElfCommand);
+ return it != elfArchitecures.constEnd() ? QString::fromLatin1(it.value()) : QString{};
+ }
+ }
+ pclose(readElfCommand);
+ return {};
+}
+
+bool checkArchitecture(const Options &options, const QString &fileName)
+{
+ return fileArchitecture(options, fileName) == options.currentArchitecture;
+}
void deleteMissingFiles(const Options &options, const QDir &srcDir, const QDir &dstDir)
{
@@ -337,7 +412,10 @@ Options parseOptions()
options.helpRequested = true;
else
options.inputFileName = arguments.at(++i);
- } else if (argument.compare(QLatin1String("--no-build"), Qt::CaseInsensitive) == 0) {
+ } else if (argument.compare(QLatin1String("--aab"), Qt::CaseInsensitive) == 0) {
+ options.buildAAB = true;
+ options.build = true;
+ } else if (options.buildAAB && argument.compare(QLatin1String("--no-build"), Qt::CaseInsensitive) == 0) {
options.build = false;
} else if (argument.compare(QLatin1String("--install"), Qt::CaseInsensitive) == 0) {
options.installApk = true;
@@ -354,13 +432,6 @@ Options parseOptions()
options.helpRequested = true;
} else if (argument.compare(QLatin1String("--verbose"), Qt::CaseInsensitive) == 0) {
options.verbose = true;
- } else if (argument.compare(QLatin1String("--gradle"), Qt::CaseInsensitive) == 0) {
- options.gradle = true;
- } else if (argument.compare(QLatin1String("--ant"), Qt::CaseInsensitive) == 0) {
- if (i + 1 == arguments.size())
- options.helpRequested = true;
- else
- options.antTool = arguments.at(++i);
} else if (argument.compare(QLatin1String("--deployment"), Qt::CaseInsensitive) == 0) {
if (i + 1 == arguments.size()) {
options.helpRequested = true;
@@ -382,15 +453,16 @@ Options parseOptions()
options.installLocation = arguments.at(++i);
} else if (argument.compare(QLatin1String("--release"), Qt::CaseInsensitive) == 0) {
options.releasePackage = true;
- } else if (argument.compare(QLatin1String("--gdbserver"), Qt::CaseInsensitive) == 0) {
- options.gdbServer = Options::True;
- } else if (argument.compare(QLatin1String("--no-gdbserver"), Qt::CaseInsensitive) == 0) {
- options.gdbServer = Options::False;
} else if (argument.compare(QLatin1String("--jdk"), Qt::CaseInsensitive) == 0) {
if (i + 1 == arguments.size())
options.helpRequested = true;
else
options.jdkPath = arguments.at(++i);
+ } else if (argument.compare(QLatin1String("--apk"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ options.helpRequested = true;
+ else
+ options.apkPath = arguments.at(++i);
} else if (argument.compare(QLatin1String("--sign"), Qt::CaseInsensitive) == 0) {
if (i + 2 >= arguments.size()) {
options.helpRequested = true;
@@ -447,17 +519,13 @@ Options parseOptions()
options.protectedAuthenticationPath = true;
} else if (argument.compare(QLatin1String("--jarsigner"), Qt::CaseInsensitive) == 0) {
options.jarSigner = true;
- } else if (argument.compare(QLatin1String("--no-generated-assets-cache"), Qt::CaseInsensitive) == 0) {
- options.generateAssetsFileList = false;
} else if (argument.compare(QLatin1String("--aux-mode"), Qt::CaseInsensitive) == 0) {
options.auxMode = true;
- } else if (argument.compare(QLatin1String("--no-strip"), Qt::CaseInsensitive) == 0) {
- options.stripLibraries = false;
}
}
if (options.inputFileName.isEmpty())
- options.inputFileName = QString::fromLatin1("android-lib%1.so-deployment-settings.json").arg(QDir::current().dirName());
+ options.inputFileName = QLatin1String("android-lib%1.so-deployment-settings.json").arg(QDir::current().dirName());
options.timing = qEnvironmentVariableIsSet("ANDROIDDEPLOYQT_TIMING_OUTPUT");
@@ -486,6 +554,7 @@ void printHelp()
" --deployment <mechanism>: Supported deployment mechanisms:\n"
" bundled (default): Include Qt files in stand-alone package.\n"
" ministro: Use the Ministro service to manage Qt files.\n"
+ " --aab: Build an Android App Bundle.\n"
" --no-build: Do not build the package, it is useful to just install\n"
" a package previously built.\n"
" --install: Installs apk to device/emulator. By default this step is\n"
@@ -500,9 +569,6 @@ void printHelp()
" --android-platform <platform>: Builds against the given android\n"
" platform. By default, the highest available version will be\n"
" used.\n"
- " --gradle. Use gradle instead of ant to create and install the apk.\n"
- " --ant <path/to/ant>: If unspecified, ant from the PATH will be\n"
- " used.\n"
" --release: Builds a package ready for release. By default, the\n"
" package will be signed with a debug key.\n"
" --sign <url/to/keystore> <alias>: Signs the package with the\n"
@@ -525,10 +591,6 @@ void printHelp()
" --protected: Keystore has protected authentication path.\n"
" --jarsigner: Force jarsigner usage, otherwise apksigner will be\n"
" used if available.\n"
- " --gdbserver: Adds the gdbserver to the package. By default the gdbserver\n"
- " is bundled for debug pacakges.\n"
- " --no-gdbserver: Prevents the gdbserver from being added to the package\n"
- " By default the gdbserver is bundled for debug pacakges.\n"
" --jdk <path/to/jdk>: Used to find the jarsigner tool when used\n"
" in combination with the --release argument. By default,\n"
" an attempt is made to detect the tool using the JAVA_HOME and\n"
@@ -541,7 +603,7 @@ void printHelp()
" --aux-mode: Operate in auxiliary mode. This will only copy the\n"
" dependencies into the build directory and update the XML templates.\n"
" The project will not be built or installed.\n"
- " --no-strip: Do not strip debug symbols from libraries.\n"
+ " --apk <path/where/to/copy/the/apk>: Path where to copy the built apk.\n"
" --help: Displays this information.\n\n",
qPrintable(QCoreApplication::arguments().at(0))
);
@@ -571,9 +633,10 @@ bool alwaysOverwritableFile(const QString &fileName)
|| fileName.endsWith(QLatin1String("/src/org/qtproject/qt5/android/bindings/QtActivity.java")));
}
+
bool copyFileIfNewer(const QString &sourceFileName,
const QString &destinationFileName,
- bool verbose,
+ const Options &options,
bool forceOverwrite = false)
{
if (QFile::exists(destinationFileName)) {
@@ -583,7 +646,7 @@ bool copyFileIfNewer(const QString &sourceFileName,
if (!forceOverwrite
&& sourceFileInfo.lastModified() <= destinationFileInfo.lastModified()
&& !alwaysOverwritableFile(destinationFileName)) {
- if (verbose)
+ if (options.verbose)
fprintf(stdout, " -- Skipping file %s. Same or newer file already in place.\n", qPrintable(sourceFileName));
return true;
} else {
@@ -602,11 +665,10 @@ bool copyFileIfNewer(const QString &sourceFileName,
if (!QFile::exists(destinationFileName) && !QFile::copy(sourceFileName, destinationFileName)) {
fprintf(stderr, "Failed to copy %s to %s.\n", qPrintable(sourceFileName), qPrintable(destinationFileName));
return false;
- } else if (verbose) {
+ } else if (options.verbose) {
fprintf(stdout, " -- Copied %s\n", qPrintable(destinationFileName));
fflush(stdout);
}
-
return true;
}
@@ -699,7 +761,7 @@ QString packageNameFromAndroidManifest(const QString &androidManifestPath)
reader.attributes().value(QLatin1String("package")).toString());
}
}
- return QString();
+ return {};
}
bool readInputFile(Options *options)
@@ -741,13 +803,13 @@ bool readInputFile(Options *options)
{
- const QJsonValue value = jsonObject.value(QStringLiteral("sdkBuildToolsRevision"));
+ const QJsonValue value = jsonObject.value(QLatin1String("sdkBuildToolsRevision"));
if (!value.isUndefined())
options->sdkBuildToolsVersion = value.toString();
}
{
- const QJsonValue qtInstallDirectory = jsonObject.value(QStringLiteral("qt"));
+ const QJsonValue qtInstallDirectory = jsonObject.value(QLatin1String("qt"));
if (qtInstallDirectory.isUndefined()) {
fprintf(stderr, "No Qt directory in json file %s\n", qPrintable(options->inputFileName));
return false;
@@ -764,13 +826,13 @@ bool readInputFile(Options *options)
}
{
- const QJsonValue androidSourcesDirectory = jsonObject.value(QStringLiteral("android-package-source-directory"));
+ const QJsonValue androidSourcesDirectory = jsonObject.value(QLatin1String("android-package-source-directory"));
if (!androidSourcesDirectory.isUndefined())
options->androidSourceDirectory = androidSourcesDirectory.toString();
}
{
- const QJsonValue androidVersionName = jsonObject.value(QStringLiteral("android-version-name"));
+ const QJsonValue androidVersionName = jsonObject.value(QLatin1String("android-version-name"));
if (!androidVersionName.isUndefined())
options->versionName = androidVersionName.toString();
else
@@ -778,7 +840,7 @@ bool readInputFile(Options *options)
}
{
- const QJsonValue androidVersionCode = jsonObject.value(QStringLiteral("android-version-code"));
+ const QJsonValue androidVersionCode = jsonObject.value(QLatin1String("android-version-code"));
if (!androidVersionCode.isUndefined())
options->versionCode = androidVersionCode.toString();
else
@@ -786,55 +848,24 @@ bool readInputFile(Options *options)
}
{
- const QJsonValue applicationBinary = jsonObject.value(QStringLiteral("application-binary"));
- if (applicationBinary.isUndefined()) {
- fprintf(stderr, "No application binary defined in json file.\n");
- return false;
- }
- options->applicationBinary = applicationBinary.toString();
-
- if (!QFile::exists(options->applicationBinary)) {
- fprintf(stderr, "Cannot find application binary %s.\n", qPrintable(options->applicationBinary));
+ const QJsonObject targetArchitectures = jsonObject.value(QLatin1String("architectures")).toObject();
+ if (targetArchitectures.isEmpty()) {
+ fprintf(stderr, "No target architecture defined in json file.\n");
return false;
}
- }
-
- {
- const QJsonValue deploymentDependencies = jsonObject.value(QStringLiteral("deployment-dependencies"));
- if (!deploymentDependencies.isUndefined()) {
- QString deploymentDependenciesString = deploymentDependencies.toString();
- const auto dependencies = deploymentDependenciesString.splitRef(QLatin1Char(','));
- for (const QStringRef &dependency : dependencies) {
- QString path = options->qtInstallDirectory + QLatin1Char('/') + dependency;
- if (QFileInfo(path).isDir()) {
- QDirIterator iterator(path, QDirIterator::Subdirectories);
- while (iterator.hasNext()) {
- iterator.next();
- if (iterator.fileInfo().isFile()) {
- QString subPath = iterator.filePath();
- options->qtDependencies.append(QtDependency(subPath.mid(options->qtInstallDirectory.length() + 1),
- subPath));
- }
- }
- } else {
- options->qtDependencies.append(QtDependency(dependency.toString(), path));
- }
+ for (auto it = targetArchitectures.constBegin(); it != targetArchitectures.constEnd(); ++it) {
+ if (it.value().isUndefined()) {
+ fprintf(stderr, "Invalid architecure.\n");
+ return false;
}
+ if (it.value().isNull())
+ continue;
+ options->architectures.insert(it.key(), it.value().toString());
}
}
-
- {
- const QJsonValue targetArchitecture = jsonObject.value(QStringLiteral("target-architecture"));
- if (targetArchitecture.isUndefined()) {
- fprintf(stderr, "No target architecture defined in json file.\n");
- return false;
- }
- options->architecture = targetArchitecture.toString();
- }
-
{
- const QJsonValue ndk = jsonObject.value(QStringLiteral("ndk"));
+ const QJsonValue ndk = jsonObject.value(QLatin1String("ndk"));
if (ndk.isUndefined()) {
fprintf(stderr, "No NDK path defined in json file.\n");
return false;
@@ -843,12 +874,7 @@ bool readInputFile(Options *options)
}
{
- const QJsonValue value = jsonObject.value(QStringLiteral("useLLVM"));
- options->useLLVM = value.toBool(false);
- }
-
- {
- const QJsonValue toolchainPrefix = jsonObject.value(QStringLiteral("toolchain-prefix"));
+ const QJsonValue toolchainPrefix = jsonObject.value(QLatin1String("toolchain-prefix"));
if (toolchainPrefix.isUndefined()) {
fprintf(stderr, "No toolchain prefix defined in json file.\n");
return false;
@@ -857,26 +883,7 @@ bool readInputFile(Options *options)
}
{
- const QJsonValue toolPrefix = jsonObject.value(QStringLiteral("tool-prefix"));
- if (toolPrefix.isUndefined()) {
- fprintf(stderr, "Warning: No tool prefix defined in json file.\n");
- options->toolPrefix = options->toolchainPrefix;
- } else {
- options->toolPrefix = toolPrefix.toString();
- }
- }
-
- if (!options->useLLVM) {
- const QJsonValue toolchainVersion = jsonObject.value(QStringLiteral("toolchain-version"));
- if (toolchainVersion.isUndefined()) {
- fprintf(stderr, "No toolchain version defined in json file.\n");
- return false;
- }
- options->toolchainVersion = toolchainVersion.toString();
- }
-
- {
- const QJsonValue ndkHost = jsonObject.value(QStringLiteral("ndk-host"));
+ const QJsonValue ndkHost = jsonObject.value(QLatin1String("ndk-host"));
if (ndkHost.isUndefined()) {
fprintf(stderr, "No NDK host defined in json file.\n");
return false;
@@ -884,52 +891,100 @@ bool readInputFile(Options *options)
options->ndkHost = ndkHost.toString();
}
- options->packageName = packageNameFromAndroidManifest(options->androidSourceDirectory + QLatin1String("/AndroidManifest.xml"));
- if (options->packageName.isEmpty())
- options->packageName = cleanPackageName(QString::fromLatin1("org.qtproject.example.%1").arg(QFileInfo(options->applicationBinary).baseName().mid(sizeof("lib") - 1)));
-
{
- const QJsonValue extraLibs = jsonObject.value(QStringLiteral("android-extra-libs"));
+ const QJsonValue extraLibs = jsonObject.value(QLatin1String("android-extra-libs"));
if (!extraLibs.isUndefined())
options->extraLibs = extraLibs.toString().split(QLatin1Char(','), QString::SkipEmptyParts);
}
{
- const QJsonValue extraPlugins = jsonObject.value(QStringLiteral("android-extra-plugins"));
+ const QJsonValue extraPlugins = jsonObject.value(QLatin1String("android-extra-plugins"));
if (!extraPlugins.isUndefined())
options->extraPlugins = extraPlugins.toString().split(QLatin1Char(','));
}
{
- const QJsonValue stdcppPath = jsonObject.value(QStringLiteral("stdcpp-path"));
+ const QJsonValue stdcppPath = jsonObject.value(QLatin1String("stdcpp-path"));
if (stdcppPath.isUndefined()) {
fprintf(stderr, "No stdcpp-path defined in json file.\n");
return false;
}
options->stdCppPath = stdcppPath.toString();
- auto name = QFileInfo(options->stdCppPath).baseName();
- if (!name.startsWith(QLatin1String("lib"))) {
- fprintf(stderr, "Invalid STD C++ library name.\n");
- return false;
- }
- options->stdCppName = name.mid(3);
}
{
- const QJsonValue qmlRootPath = jsonObject.value(QStringLiteral("qml-root-path"));
+ const QJsonValue qmlRootPath = jsonObject.value(QLatin1String("qml-root-path"));
if (!qmlRootPath.isUndefined())
options->rootPath = qmlRootPath.toString();
}
{
- const QJsonValue qmlImportPaths = jsonObject.value(QStringLiteral("qml-import-paths"));
+ const QJsonValue qmlImportPaths = jsonObject.value(QLatin1String("qml-import-paths"));
if (!qmlImportPaths.isUndefined())
options->qmlImportPaths = qmlImportPaths.toString().split(QLatin1Char(','));
}
+
+ {
+ const QJsonValue applicationBinary = jsonObject.value(QLatin1String("application-binary"));
+ if (applicationBinary.isUndefined()) {
+ fprintf(stderr, "No application binary defined in json file.\n");
+ return false;
+ }
+ options->applicationBinary = applicationBinary.toString();
+ if (options->build) {
+ for (auto it = options->architectures.constBegin(); it != options->architectures.constEnd(); ++it) {
+ if (!QFile::exists(QLatin1String("%1/libs/%2/lib%3_%2.so").arg(options->outputDirectory, it.key(), options->applicationBinary))) {
+ fprintf(stderr, "Cannot find application binary %s.\n", qPrintable(options->applicationBinary));
+ return false;
+ }
+ }
+ }
+ }
+
+ {
+ const QJsonValue deploymentDependencies = jsonObject.value(QLatin1String("deployment-dependencies"));
+ if (!deploymentDependencies.isUndefined()) {
+ QString deploymentDependenciesString = deploymentDependencies.toString();
+ const auto dependencies = deploymentDependenciesString.splitRef(QLatin1Char(','));
+ for (const QStringRef &dependency : dependencies) {
+ QString path = options->qtInstallDirectory + QLatin1Char('/') + dependency;
+ if (QFileInfo(path).isDir()) {
+ QDirIterator iterator(path, QDirIterator::Subdirectories);
+ while (iterator.hasNext()) {
+ iterator.next();
+ if (iterator.fileInfo().isFile()) {
+ QString subPath = iterator.filePath();
+ auto arch = fileArchitecture(*options, subPath);
+ if (!arch.isEmpty()) {
+ options->qtDependencies[arch].append(QtDependency(subPath.mid(options->qtInstallDirectory.length() + 1),
+ subPath));
+ } else if (options->verbose) {
+ fprintf(stderr, "Skipping \"%s\", unknown architecture\n", qPrintable(subPath));
+ fflush(stderr);
+ }
+ }
+ }
+ } else {
+ auto arch = fileArchitecture(*options, path);
+ if (!arch.isEmpty()) {
+ options->qtDependencies[arch].append(QtDependency(dependency.toString(), path));
+ } else if (options->verbose) {
+ fprintf(stderr, "Skipping \"%s\", unknown architecture\n", qPrintable(path));
+ fflush(stderr);
+ }
+ }
+ }
+ }
+ }
+
+ options->packageName = packageNameFromAndroidManifest(options->androidSourceDirectory + QLatin1String("/AndroidManifest.xml"));
+ if (options->packageName.isEmpty())
+ options->packageName = cleanPackageName(QLatin1String("org.qtproject.example.%1").arg(options->applicationBinary));
+
return true;
}
-bool copyFiles(const QDir &sourceDirectory, const QDir &destinationDirectory, bool verbose, bool forceOverwrite = false)
+bool copyFiles(const QDir &sourceDirectory, const QDir &destinationDirectory, const Options &options, bool forceOverwrite = false)
{
const QFileInfoList entries = sourceDirectory.entryInfoList(QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs);
for (const QFileInfo &entry : entries) {
@@ -940,11 +995,11 @@ bool copyFiles(const QDir &sourceDirectory, const QDir &destinationDirectory, bo
return false;
}
- if (!copyFiles(dir, QDir(destinationDirectory.path() + QLatin1String("/") + dir.dirName()), verbose, forceOverwrite))
+ if (!copyFiles(dir, QDir(destinationDirectory.path() + QLatin1Char('/') + dir.dirName()), options, forceOverwrite))
return false;
} else {
QString destination = destinationDirectory.absoluteFilePath(entry.fileName());
- if (!copyFileIfNewer(entry.absoluteFilePath(), destination, verbose, forceOverwrite))
+ if (!copyFileIfNewer(entry.absoluteFilePath(), destination, options, forceOverwrite))
return false;
}
}
@@ -984,7 +1039,7 @@ bool copyAndroidTemplate(const Options &options, const QString &androidTemplate,
return false;
}
- return copyFiles(sourceDirectory, QDir(outDir), options.verbose);
+ return copyFiles(sourceDirectory, QDir(outDir), options);
}
bool copyGradleTemplate(const Options &options)
@@ -1001,7 +1056,7 @@ bool copyGradleTemplate(const Options &options)
return false;
}
- return copyFiles(sourceDirectory, QDir(outDir), options.verbose);
+ return copyFiles(sourceDirectory, QDir(outDir), options);
}
bool copyAndroidTemplate(const Options &options)
@@ -1009,16 +1064,13 @@ bool copyAndroidTemplate(const Options &options)
if (options.verbose)
fprintf(stdout, "Copying Android package template.\n");
- if (options.gradle && !copyGradleTemplate(options))
+ if (!copyGradleTemplate(options))
return false;
if (!copyAndroidTemplate(options, QLatin1String("/src/android/templates")))
return false;
- if (options.gradle)
- return true;
-
- return copyAndroidTemplate(options, QLatin1String("/src/android/java"));
+ return true;
}
bool copyAndroidSources(const Options &options)
@@ -1035,38 +1087,42 @@ bool copyAndroidSources(const Options &options)
return false;
}
- return copyFiles(sourceDirectory, QDir(options.outputDirectory), options.verbose, true);
+ return copyFiles(sourceDirectory, QDir(options.outputDirectory), options, true);
}
-bool copyAndroidExtraLibs(const Options &options)
+bool copyAndroidExtraLibs(Options *options)
{
- if (options.extraLibs.isEmpty())
+ if (options->extraLibs.isEmpty())
return true;
- if (options.verbose)
- fprintf(stdout, "Copying %d external libraries to package.\n", options.extraLibs.size());
+ if (options->verbose)
+ fprintf(stdout, "Copying %d external libraries to package.\n", options->extraLibs.size());
- for (const QString &extraLib : options.extraLibs) {
+ for (const QString &extraLib : options->extraLibs) {
QFileInfo extraLibInfo(extraLib);
if (!extraLibInfo.exists()) {
fprintf(stderr, "External library %s does not exist!\n", qPrintable(extraLib));
return false;
}
-
+ if (!checkArchitecture(*options, extraLibInfo.filePath())) {
+ if (options->verbose)
+ fprintf(stdout, "Skipping \"%s\", architecture mismatch.\n", qPrintable(extraLib));
+ continue;
+ }
if (!extraLibInfo.fileName().startsWith(QLatin1String("lib")) || extraLibInfo.suffix() != QLatin1String("so")) {
fprintf(stderr, "The file name of external library %s must begin with \"lib\" and end with the suffix \".so\".\n",
qPrintable(extraLib));
return false;
}
-
- QString destinationFile(options.outputDirectory
+ QString destinationFile(options->outputDirectory
+ QLatin1String("/libs/")
- + options.architecture
+ + options->currentArchitecture
+ QLatin1Char('/')
+ extraLibInfo.fileName());
- if (!copyFileIfNewer(extraLib, destinationFile, options.verbose))
+ if (!copyFileIfNewer(extraLib, destinationFile, *options))
return false;
+ options->archExtraLibs[options->currentArchitecture] += extraLib;
}
return true;
@@ -1087,15 +1143,15 @@ QStringList allFilesInside(const QDir& current, const QDir& rootDir)
return result;
}
-bool copyAndroidExtraResources(const Options &options)
+bool copyAndroidExtraResources(Options *options)
{
- if (options.extraPlugins.isEmpty())
+ if (options->extraPlugins.isEmpty())
return true;
- if (options.verbose)
- fprintf(stdout, "Copying %d external resources to package.\n", options.extraPlugins.size());
+ if (options->verbose)
+ fprintf(stdout, "Copying %d external resources to package.\n", options->extraPlugins.size());
- for (const QString &extraResource : options.extraPlugins) {
+ for (const QString &extraResource : options->extraPlugins) {
QFileInfo extraResourceInfo(extraResource);
if (!extraResourceInfo.exists() || !extraResourceInfo.isDir()) {
fprintf(stderr, "External resource %s does not exist or not a correct directory!\n", qPrintable(extraResource));
@@ -1103,8 +1159,8 @@ bool copyAndroidExtraResources(const Options &options)
}
QDir resourceDir(extraResource);
- QString assetsDir = options.outputDirectory + QStringLiteral("/assets/") + resourceDir.dirName() + QLatin1Char('/');
- QString libsDir = options.outputDirectory + QStringLiteral("/libs/") + options.architecture + QLatin1Char('/');
+ QString assetsDir = options->outputDirectory + QLatin1String("/assets/") + resourceDir.dirName() + QLatin1Char('/');
+ QString libsDir = options->outputDirectory + QLatin1String("/libs/") + options->currentArchitecture + QLatin1Char('/');
const QStringList files = allFilesInside(resourceDir, resourceDir);
for (const QString &resourceFile : files) {
@@ -1113,10 +1169,12 @@ bool copyAndroidExtraResources(const Options &options)
if (!resourceFile.endsWith(QLatin1String(".so"))) {
destinationFile = assetsDir + resourceFile;
} else {
- destinationFile = libsDir + QStringLiteral("/lib") + QString(resourceDir.dirName() + QLatin1Char('/') + resourceFile).replace(QLatin1Char('/'), QLatin1Char('_'));
+ if (!checkArchitecture(*options, originFile))
+ continue;
+ destinationFile = libsDir + resourceFile;
+ options->archExtraPlugins[options->currentArchitecture] += resourceFile;
}
-
- if (!copyFileIfNewer(originFile, destinationFile, options.verbose))
+ if (!copyFileIfNewer(originFile, destinationFile, *options))
return false;
}
}
@@ -1168,75 +1226,88 @@ bool updateFile(const QString &fileName, const QHash<QString, QString> &replacem
}
-bool updateLibsXml(const Options &options)
+bool updateLibsXml(Options *options)
{
- if (options.verbose)
+ if (options->verbose)
fprintf(stdout, " -- res/values/libs.xml\n");
- QString fileName = options.outputDirectory + QLatin1String("/res/values/libs.xml");
+ QString fileName = options->outputDirectory + QLatin1String("/res/values/libs.xml");
if (!QFile::exists(fileName)) {
fprintf(stderr, "Cannot find %s in prepared packaged. This file is required.\n", qPrintable(fileName));
return false;
}
- QString libsPath = QLatin1String("libs/") + options.architecture + QLatin1Char('/');
-
- QString qtLibs = QLatin1String("<item>") + options.stdCppName + QLatin1String("</item>\n");
- QString bundledInLibs;
- QString bundledInAssets;
- for (const Options::BundledFile &bundledFile : options.bundledFiles) {
- if (bundledFile.second.startsWith(QLatin1String("lib/"))) {
- QString s = bundledFile.second.mid(sizeof("lib/lib") - 1);
- s.chop(sizeof(".so") - 1);
- qtLibs += QString::fromLatin1("<item>%1</item>\n").arg(s);
- } else if (bundledFile.first.startsWith(libsPath)) {
- QString s = bundledFile.first.mid(libsPath.length());
- bundledInLibs += QString::fromLatin1("<item>%1:%2</item>\n")
- .arg(s).arg(bundledFile.second);
- } else if (bundledFile.first.startsWith(QLatin1String("assets/"))) {
- QString s = bundledFile.first.mid(sizeof("assets/") - 1);
- bundledInAssets += QString::fromLatin1("<item>%1:%2</item>\n")
- .arg(s).arg(bundledFile.second);
- }
- }
-
- if (!options.extraPlugins.isEmpty()) {
- for (const QString &extraRes : options.extraPlugins) {
- QDir resourceDir(extraRes);
- const QStringList files = allFilesInside(resourceDir, resourceDir);
- for (const QString &file : files) {
- QString destinationPath = resourceDir.dirName() + QLatin1Char('/') + file;
- if (!file.endsWith(QLatin1String(".so"))) {
- bundledInAssets += QStringLiteral("<item>%1:%1</item>\n")
- .arg(destinationPath);
- } else {
- bundledInLibs += QStringLiteral("<item>lib%1:%2</item>\n")
- .arg(QString(destinationPath).replace(QLatin1Char('/'), QLatin1Char('_')))
- .arg(destinationPath);
- }
+ QString qtLibs;
+ QString allLocalLibs;
+ QString extraLibs;
+
+ for (auto it = options->architectures.constBegin(); it != options->architectures.constEnd(); ++it) {
+ QString libsPath = QLatin1String("libs/") + it.key() + QLatin1Char('/');
+
+ qtLibs += QLatin1String(" <item>%1;%2</item>\n").arg(it.key(), options->stdCppName);
+ for (const Options::BundledFile &bundledFile : options->bundledFiles[it.key()]) {
+ if (bundledFile.second.startsWith(QLatin1String("lib/"))) {
+ QString s = bundledFile.second.mid(sizeof("lib/lib") - 1);
+ s.chop(sizeof(".so") - 1);
+ qtLibs += QLatin1String(" <item>%1;%2</item>\n").arg(it.key(), s);
}
}
- }
- QHash<QString, QString> replacements;
- replacements[QLatin1String("<!-- %%INSERT_QT_LIBS%% -->")] = qtLibs;
+ if (!options->archExtraLibs[it.key()].isEmpty()) {
+ for (const QString &extraLib : options->archExtraLibs[it.key()]) {
+ QFileInfo extraLibInfo(extraLib);
+ QString name = extraLibInfo.fileName().mid(sizeof("lib") - 1);
+ name.chop(sizeof(".so") - 1);
+ extraLibs += QLatin1String(" <item>%1;%2</item>\n").arg(it.key(), name);
+ }
+ }
- if (options.deploymentMechanism == Options::Bundled) {
- replacements[QLatin1String("<!-- %%INSERT_BUNDLED_IN_LIB%% -->")] = bundledInLibs;
- replacements[QLatin1String("<!-- %%INSERT_BUNDLED_IN_ASSETS%% -->")] = bundledInAssets;
- }
+ QStringList localLibs;
+ localLibs = options->localLibs[it.key()];
+ // If .pro file overrides dependency detection, we need to see which platform plugin they picked
+ if (localLibs.isEmpty()) {
+ QString plugin;
+ for (const QtDependency &qtDependency : options->qtDependencies[it.key()]) {
+ if (qtDependency.relativePath.endsWith(QLatin1String("libqtforandroid.so"))
+ || qtDependency.relativePath.endsWith(QLatin1String("libqtforandroidGL.so"))) {
+ if (!plugin.isEmpty() && plugin != qtDependency.relativePath) {
+ fprintf(stderr, "Both platform plugins libqtforandroid.so and libqtforandroidGL.so included in package. Please include only one.\n");
+ return false;
+ }
- QString extraLibs;
- if (!options.extraLibs.isEmpty()) {
- for (const QString extraLib : options.extraLibs) {
- QFileInfo extraLibInfo(extraLib);
- QString name = extraLibInfo.fileName().mid(sizeof("lib") - 1);
- name.chop(sizeof(".so") - 1);
+ plugin = qtDependency.relativePath;
+ }
+ if (qtDependency.relativePath.contains(QLatin1String("libQt5OpenGL"))
+ || qtDependency.relativePath.contains(QLatin1String("libQt5Quick"))) {
+ options->usesOpenGL |= true;
+ break;
+ }
+ }
- extraLibs += QLatin1String("<item>") + name + QLatin1String("</item>\n");
+ if (plugin.isEmpty()) {
+ fflush(stdout);
+ fprintf(stderr, "No platform plugin, neither libqtforandroid.so or libqtforandroidGL.so, included in package. Please include one.\n");
+ fflush(stderr);
+ return false;
+ }
+
+ localLibs.append(plugin);
+ if (options->verbose)
+ fprintf(stdout, " -- Using platform plugin %s\n", qPrintable(plugin));
}
+
+ // remove all paths
+ for (auto &lib : localLibs) {
+ if (lib.endsWith(QLatin1String(".so")))
+ lib = lib.mid(lib.lastIndexOf(QLatin1Char('/')) + 1);
+ }
+ allLocalLibs += QLatin1String(" <item>%1;%2</item>\n").arg(it.key(), localLibs.join(QLatin1Char(':')));
}
- replacements[QLatin1String("<!-- %%INSERT_EXTRA_LIBS%% -->")] = extraLibs;
+
+ QHash<QString, QString> replacements;
+ replacements[QStringLiteral("<!-- %%INSERT_QT_LIBS%% -->")] += qtLibs.trimmed();
+ replacements[QStringLiteral("<!-- %%INSERT_LOCAL_LIBS%% -->")] = allLocalLibs.trimmed();
+ replacements[QStringLiteral("<!-- %%INSERT_EXTRA_LIBS%% -->")] = extraLibs.trimmed();
if (!updateFile(fileName, replacements))
return false;
@@ -1250,7 +1321,7 @@ bool updateStringsXml(const Options &options)
fprintf(stdout, " -- res/values/strings.xml\n");
QHash<QString, QString> replacements;
- replacements[QStringLiteral("<!-- %%INSERT_APP_NAME%% -->")] = QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1);
+ replacements[QStringLiteral("<!-- %%INSERT_APP_NAME%% -->")] = options.applicationBinary;
QString fileName = options.outputDirectory + QLatin1String("/res/values/strings.xml");
if (!QFile::exists(fileName)) {
@@ -1262,7 +1333,7 @@ bool updateStringsXml(const Options &options)
return false;
}
file.write(QByteArray("<?xml version='1.0' encoding='utf-8'?><resources><string name=\"app_name\" translatable=\"false\">")
- .append(QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1).toLatin1())
+ .append(options.applicationBinary.toLatin1())
.append("</string></resources>\n"));
return true;
}
@@ -1270,36 +1341,6 @@ bool updateStringsXml(const Options &options)
if (!updateFile(fileName, replacements))
return false;
- if (options.gradle)
- return true;
-
- // ant can't (easily) build multiple res folders,
- // so we need to replace the "<!-- %%INSERT_STRINGS -->" placeholder
- // from the main res folder
- QFile stringsXml(fileName);
- if (!stringsXml.open(QIODevice::ReadOnly)) {
- fprintf(stderr, "Cannot open %s for reading.\n", qPrintable(fileName));
- return false;
- }
-
- QXmlStreamReader reader(&stringsXml);
- while (!reader.atEnd()) {
- reader.readNext();
- if (reader.isStartElement() &&
- reader.name() == QLatin1String("string") &&
- reader.attributes().hasAttribute(QLatin1String("name")) &&
- reader.attributes().value(QLatin1String("name")) == QLatin1String("app_name")) {
- return true;
- }
- }
-
- replacements.clear();
- replacements[QStringLiteral("<!-- %%INSERT_STRINGS -->")] = QString::fromLatin1("<string name=\"app_name\">%1</string>\n")
- .arg(QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1));
-
- if (!updateFile(fileName, replacements))
- return false;
-
return true;
}
@@ -1308,71 +1349,34 @@ bool updateAndroidManifest(Options &options)
if (options.verbose)
fprintf(stdout, " -- AndroidManifest.xml \n");
- QStringList localLibs = options.localLibs;
-
- // If .pro file overrides dependency detection, we need to see which platform plugin they picked
- if (localLibs.isEmpty()) {
- QString plugin;
- for (const QtDependency &qtDependency : qAsConst(options.qtDependencies)) {
- if (qtDependency.relativePath.endsWith(QLatin1String("libqtforandroid.so"))
- || qtDependency.relativePath.endsWith(QLatin1String("libqtforandroidGL.so"))) {
- if (!plugin.isEmpty() && plugin != qtDependency.relativePath) {
- fprintf(stderr, "Both platform plugins libqtforandroid.so and libqtforandroidGL.so included in package. Please include only one.\n");
- return false;
- }
-
- plugin = qtDependency.relativePath;
- }
- }
-
- if (plugin.isEmpty()) {
- fprintf(stderr, "No platform plugin, neither libqtforandroid.so or libqtforandroidGL.so, included in package. Please include one.\n");
- return false;
- }
-
- localLibs.append(plugin);
- if (options.verbose)
- fprintf(stdout, " -- Using platform plugin %s\n", qPrintable(plugin));
- }
-
- bool usesGL = false;
- for (const QtDependency &qtDependency : qAsConst(options.qtDependencies)) {
- if (qtDependency.relativePath.endsWith(QLatin1String("libQt5OpenGL.so"))
- || qtDependency.relativePath.endsWith(QLatin1String("libQt5Quick.so"))) {
- usesGL = true;
- break;
- }
- }
-
options.localJars.removeDuplicates();
options.initClasses.removeDuplicates();
QHash<QString, QString> replacements;
- replacements[QLatin1String("-- %%INSERT_APP_NAME%% --")] = QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1);
- replacements[QLatin1String("-- %%INSERT_APP_LIB_NAME%% --")] = QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1);
- replacements[QLatin1String("-- %%INSERT_LOCAL_LIBS%% --")] = localLibs.join(QLatin1Char(':'));
- replacements[QLatin1String("-- %%INSERT_LOCAL_JARS%% --")] = options.localJars.join(QLatin1Char(':'));
- replacements[QLatin1String("-- %%INSERT_INIT_CLASSES%% --")] = options.initClasses.join(QLatin1Char(':'));
- replacements[QLatin1String("-- %%INSERT_VERSION_NAME%% --")] = options.versionName;
- replacements[QLatin1String("-- %%INSERT_VERSION_CODE%% --")] = options.versionCode;
- replacements[QLatin1String("package=\"org.qtproject.example\"")] = QString::fromLatin1("package=\"%1\"").arg(options.packageName);
- replacements[QLatin1String("-- %%BUNDLE_LOCAL_QT_LIBS%% --")]
- = (options.deploymentMechanism == Options::Bundled) ? QString::fromLatin1("1") : QString::fromLatin1("0");
- replacements[QLatin1String("-- %%USE_LOCAL_QT_LIBS%% --")]
- = (options.deploymentMechanism != Options::Ministro) ? QString::fromLatin1("1") : QString::fromLatin1("0");
+ replacements[QStringLiteral("-- %%INSERT_APP_NAME%% --")] = options.applicationBinary;
+ replacements[QStringLiteral("-- %%INSERT_APP_LIB_NAME%% --")] = options.applicationBinary;
+ replacements[QStringLiteral("-- %%INSERT_LOCAL_JARS%% --")] = options.localJars.join(QLatin1Char(':'));
+ replacements[QStringLiteral("-- %%INSERT_INIT_CLASSES%% --")] = options.initClasses.join(QLatin1Char(':'));
+ replacements[QStringLiteral("-- %%INSERT_VERSION_NAME%% --")] = options.versionName;
+ replacements[QStringLiteral("-- %%INSERT_VERSION_CODE%% --")] = options.versionCode;
+ replacements[QStringLiteral("package=\"org.qtproject.example\"")] = QLatin1String("package=\"%1\"").arg(options.packageName);
+ replacements[QStringLiteral("-- %%BUNDLE_LOCAL_QT_LIBS%% --")]
+ = (options.deploymentMechanism == Options::Bundled) ? QLatin1String("1") : QLatin1String("0");
+ replacements[QStringLiteral("-- %%USE_LOCAL_QT_LIBS%% --")]
+ = (options.deploymentMechanism != Options::Ministro) ? QLatin1String("1") : QLatin1String("0");
QString permissions;
for (const QString &permission : qAsConst(options.permissions))
- permissions += QString::fromLatin1(" <uses-permission android:name=\"%1\" />\n").arg(permission);
- replacements[QLatin1String("<!-- %%INSERT_PERMISSIONS -->")] = permissions;
+ permissions += QLatin1String(" <uses-permission android:name=\"%1\" />\n").arg(permission);
+ replacements[QStringLiteral("<!-- %%INSERT_PERMISSIONS -->")] = permissions.trimmed();
QString features;
for (const QString &feature : qAsConst(options.features))
- features += QStringLiteral(" <uses-feature android:name=\"%1\" android:required=\"false\" />\n").arg(feature);
- if (usesGL)
- features += QStringLiteral(" <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />");
+ features += QLatin1String(" <uses-feature android:name=\"%1\" android:required=\"false\" />\n").arg(feature);
+ if (options.usesOpenGL)
+ features += QLatin1String(" <uses-feature android:glEsVersion=\"0x00020000\" android:required=\"true\" />");
- replacements[QLatin1String("<!-- %%INSERT_FEATURES -->")] = features;
+ replacements[QStringLiteral("<!-- %%INSERT_FEATURES -->")] = features.trimmed();
QString androidManifestPath = options.outputDirectory + QLatin1String("/AndroidManifest.xml");
if (!updateFile(androidManifestPath, replacements))
@@ -1433,7 +1437,7 @@ bool updateAndroidFiles(Options &options)
if (options.verbose)
fprintf(stdout, "Updating Android package files with project settings.\n");
- if (!updateLibsXml(options))
+ if (!updateLibsXml(&options))
return false;
if (!updateAndroidManifest(options))
@@ -1490,7 +1494,7 @@ bool readAndroidDependencyXml(Options *options,
QSet<QString> *usedDependencies,
QSet<QString> *remainingDependencies)
{
- QString androidDependencyName = absoluteFilePath(options, QString::fromLatin1("/lib/%1-android-dependencies.xml").arg(moduleName));
+ QString androidDependencyName = absoluteFilePath(options, QLatin1String("/lib/%1-android-dependencies.xml").arg(moduleName));
QFile androidDependencyFile(androidDependencyName);
if (androidDependencyFile.exists()) {
@@ -1529,7 +1533,7 @@ bool readAndroidDependencyXml(Options *options,
if (options->verbose)
fprintf(stdout, "Appending dependency from xml: %s\n", qPrintable(fileName.relativePath));
- options->qtDependencies.append(fileName);
+ options->qtDependencies[options->currentArchitecture].append(fileName);
}
} else if (reader.name() == QLatin1String("jar")) {
int bundling = reader.attributes().value(QLatin1String("bundling")).toInt();
@@ -1537,7 +1541,7 @@ bool readAndroidDependencyXml(Options *options,
if (bundling == (options->deploymentMechanism == Options::Bundled)) {
QtDependency dependency(fileName, absoluteFilePath(options, fileName));
if (!usedDependencies->contains(dependency.absolutePath)) {
- options->qtDependencies.append(dependency);
+ options->qtDependencies[options->currentArchitecture].append(dependency);
usedDependencies->insert(dependency.absolutePath);
}
}
@@ -1553,15 +1557,15 @@ bool readAndroidDependencyXml(Options *options,
if (reader.attributes().hasAttribute(QLatin1String("replaces"))) {
QString replaces = reader.attributes().value(QLatin1String("replaces")).toString();
for (int i=0; i<options->localLibs.size(); ++i) {
- if (options->localLibs.at(i) == replaces) {
- options->localLibs[i] = fileName;
+ if (options->localLibs[options->currentArchitecture].at(i) == replaces) {
+ options->localLibs[options->currentArchitecture][i] = fileName;
break;
}
}
} else if (!fileName.isEmpty()) {
- options->localLibs.append(fileName);
+ options->localLibs[options->currentArchitecture].append(fileName);
}
- if (fileName.endsWith(QLatin1String(".so"))) {
+ if (fileName.endsWith(QLatin1String(".so")) && checkArchitecture(*options, fileName)) {
remainingDependencies->insert(fileName);
}
} else if (reader.name() == QLatin1String("permission")) {
@@ -1581,24 +1585,17 @@ bool readAndroidDependencyXml(Options *options,
} else if (options->verbose) {
fprintf(stdout, "No android dependencies for %s\n", qPrintable(moduleName));
}
+ options->permissions.removeDuplicates();
+ options->features.removeDuplicates();
return true;
}
QStringList getQtLibsFromElf(const Options &options, const QString &fileName)
{
- QString readElf = options.ndkPath
- + QLatin1String("/toolchains/")
- + options.toolchainPrefix;
-
- if (!options.useLLVM)
- readElf += QLatin1Char('-') + options.toolchainVersion;
-
- readElf += QLatin1String("/prebuilt/")
- + options.ndkHost
- + QLatin1String("/bin/")
- + options.toolPrefix +
- (options.useLLVM ? QLatin1String("-readobj") : QLatin1String("-readelf"));
+ QString readElf = QLatin1String("%1/toolchains/%2/prebuilt/%3/bin/llvm-readobj").arg(options.ndkPath,
+ options.toolchainPrefix,
+ options.ndkHost);
#if defined(Q_OS_WIN32)
readElf += QLatin1String(".exe");
#endif
@@ -1608,14 +1605,11 @@ QStringList getQtLibsFromElf(const Options &options, const QString &fileName)
return QStringList();
}
- if (options.useLLVM)
- readElf = QString::fromLatin1("%1 -needed-libs %2").arg(shellQuote(readElf), shellQuote(fileName));
- else
- readElf = QString::fromLatin1("%1 -d -W %2").arg(shellQuote(readElf), shellQuote(fileName));
+ readElf = QLatin1String("%1 -needed-libs %2").arg(shellQuote(readElf), shellQuote(fileName));
FILE *readElfCommand = openProcess(readElf);
if (!readElfCommand) {
- fprintf(stderr, "Cannot execute command %s", qPrintable(readElf));
+ fprintf(stderr, "Cannot execute command %s\n", qPrintable(readElf));
return QStringList();
}
@@ -1623,22 +1617,25 @@ QStringList getQtLibsFromElf(const Options &options, const QString &fileName)
bool readLibs = false;
char buffer[512];
- while (fgets(buffer, sizeof(buffer), readElfCommand) != 0) {
+ while (fgets(buffer, sizeof(buffer), readElfCommand) != nullptr) {
QByteArray line = QByteArray::fromRawData(buffer, qstrlen(buffer));
QString library;
- if (options.useLLVM) {
- line = line.trimmed();
- if (!readLibs) {
- readLibs = line.startsWith("NeededLibraries");
- continue;
+ line = line.trimmed();
+ if (!readLibs) {
+ if (line.startsWith("Arch: ")) {
+ auto it = elfArchitecures.find(line.mid(6));
+ if (it == elfArchitecures.constEnd() || *it != options.currentArchitecture.toLatin1()) {
+ if (options.verbose)
+ fprintf(stdout, "Skipping \"%s\", architecture mismatch\n", qPrintable(fileName));
+ return {};
+ }
}
- if (!line.startsWith("lib"))
- continue;
- library = QString::fromLatin1(line);
- } else if (line.contains("(NEEDED)") && line.contains("Shared library:")) {
- const int pos = line.lastIndexOf('[') + 1;
- library = QString::fromLatin1(line.mid(pos, line.length() - pos - 2));
+ readLibs = line.startsWith("NeededLibraries");
+ continue;
}
+ if (!line.startsWith("lib"))
+ continue;
+ library = QString::fromLatin1(line);
QString libraryName = QLatin1String("lib/") + library;
if (QFile::exists(absoluteFilePath(&options, libraryName)))
ret += libraryName;
@@ -1677,7 +1674,7 @@ bool readDependenciesFromElf(Options *options,
return false;
}
- options->qtDependencies.append(QtDependency(dependency, absoluteDependencyPath));
+ options->qtDependencies[options->currentArchitecture].append(QtDependency(dependency, absoluteDependencyPath));
if (options->verbose)
fprintf(stdout, "Appending dependency: %s\n", qPrintable(dependency));
dependenciesToCheck.append(dependency);
@@ -1726,9 +1723,8 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
for (const QString &qmlImportPath : qAsConst(options->qmlImportPaths))
importPaths += shellQuote(qmlImportPath);
- qmlImportScanner += QString::fromLatin1(" -rootPath %1 -importPath %2")
- .arg(shellQuote(rootPath))
- .arg(importPaths.join(QLatin1Char(' ')));
+ qmlImportScanner += QLatin1String(" -rootPath %1 -importPath %2")
+ .arg(shellQuote(rootPath), importPaths.join(QLatin1Char(' ')));
if (options->verbose) {
fprintf(stdout, "Running qmlimportscanner with the following command: %s\n",
@@ -1822,9 +1818,9 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
// Put all imports in default import path in assets
fileName.relativePath.prepend(QLatin1String("qml/"));
- options->qtDependencies.append(fileName);
+ options->qtDependencies[options->currentArchitecture].append(fileName);
- if (fileName.absolutePath.endsWith(QLatin1String(".so"))) {
+ if (fileName.absolutePath.endsWith(QLatin1String(".so")) && checkArchitecture(*options, fileName.absolutePath)) {
QSet<QString> remainingDependencies;
if (!readDependenciesFromElf(options, fileName.absolutePath, usedDependencies, &remainingDependencies))
return false;
@@ -1837,13 +1833,77 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
return true;
}
+bool runCommand(const Options &options, const QString &command)
+{
+ if (options.verbose)
+ fprintf(stdout, "Running command '%s'\n", qPrintable(command));
+
+ FILE *runCommand = openProcess(command);
+ if (runCommand == nullptr) {
+ fprintf(stderr, "Cannot run command '%s'\n", qPrintable(command));
+ return false;
+ }
+ char buffer[4096];
+ while (fgets(buffer, sizeof(buffer), runCommand) != nullptr) {
+ if (options.verbose)
+ fprintf(stdout, "%s", buffer);
+ }
+ pclose(runCommand);
+ fflush(stdout);
+ fflush(stderr);
+ return true;
+}
+
+bool createRcc(const Options &options)
+{
+ auto assetsDir = QLatin1String("%1/assets").arg(options.outputDirectory);
+ if (!QDir{QLatin1String("%1/android_rcc_bundle").arg(assetsDir)}.exists()) {
+ fprintf(stdout, "Skipping createRCC\n");
+ return true;
+ }
+
+ if (options.verbose)
+ fprintf(stdout, "Create rcc bundle.\n");
+
+ QString rcc = options.qtInstallDirectory + QLatin1String("/bin/rcc");
+#if defined(Q_OS_WIN32)
+ rcc += QLatin1String(".exe");
+#endif
+
+ if (!QFile::exists(rcc)) {
+ fprintf(stderr, "rcc not found: %s\n", qPrintable(rcc));
+ return false;
+ }
+ auto currentDir = QDir::currentPath();
+ if (!QDir::setCurrent(QLatin1String("%1/android_rcc_bundle").arg(assetsDir))) {
+ fprintf(stderr, "Cannot set current dir to: %s\n", qPrintable(QLatin1String("%1/android_rcc_bundle").arg(assetsDir)));
+ return false;
+ }
+
+ bool res = runCommand(options, QLatin1String("%1 --project -o %2").arg(rcc, shellQuote(QLatin1String("%1/android_rcc_bundle.qrc").arg(assetsDir))));
+ if (!res)
+ return false;
+
+ QFile::rename(QLatin1String("%1/android_rcc_bundle.qrc").arg(assetsDir), QLatin1String("%1/android_rcc_bundle/android_rcc_bundle.qrc").arg(assetsDir));
+
+ res = runCommand(options, QLatin1String("%1 %2 --binary -o %3 android_rcc_bundle.qrc").arg(rcc, shellQuote(QLatin1String("--root=/android_rcc_bundle/")),
+ shellQuote(QLatin1String("%1/android_rcc_bundle.rcc").arg(assetsDir))));
+ if (!QDir::setCurrent(currentDir)) {
+ fprintf(stderr, "Cannot set current dir to: %s\n", qPrintable(currentDir));
+ return false;
+ }
+ QFile::remove(QLatin1String("%1/android_rcc_bundle.qrc").arg(assetsDir));
+ QDir{QLatin1String("%1/android_rcc_bundle").arg(assetsDir)}.removeRecursively();
+ return res;
+}
+
bool readDependencies(Options *options)
{
if (options->verbose)
fprintf(stdout, "Detecting dependencies of application.\n");
// Override set in .pro file
- if (!options->qtDependencies.isEmpty()) {
+ if (!options->qtDependencies[options->currentArchitecture].isEmpty()) {
if (options->verbose)
fprintf(stdout, "\tDependencies explicitly overridden in .pro file. No detection needed.\n");
return true;
@@ -1853,11 +1913,7 @@ bool readDependencies(Options *options)
QSet<QString> remainingDependencies;
// Add dependencies of application binary first
- if (!readDependenciesFromElf(options, options->applicationBinary, &usedDependencies, &remainingDependencies))
- return false;
-
- // Jam in the dependencies of the platform plugin, since the application will crash without it
- if (!readDependenciesFromElf(options, options->qtInstallDirectory + QLatin1String("/plugins/platforms/android/libqtforandroid.so"), &usedDependencies, &remainingDependencies))
+ if (!readDependenciesFromElf(options, QLatin1String("%1/libs/%2/lib%3_%2.so").arg(options->outputDirectory, options->currentArchitecture, options->applicationBinary), &usedDependencies, &remainingDependencies))
return false;
while (!remainingDependencies.isEmpty()) {
@@ -1877,14 +1933,14 @@ bool readDependencies(Options *options)
}
}
- QStringList::iterator it = options->localLibs.begin();
- while (it != options->localLibs.end()) {
+ QStringList::iterator it = options->localLibs[options->currentArchitecture].begin();
+ while (it != options->localLibs[options->currentArchitecture].end()) {
QStringList unmetDependencies;
if (!goodToCopy(options, absoluteFilePath(options, *it), &unmetDependencies)) {
fprintf(stdout, "Skipping %s due to unmet dependencies: %s\n",
qPrintable(*it),
qPrintable(unmetDependencies.join(QLatin1Char(','))));
- it = options->localLibs.erase(it);
+ it = options->localLibs[options->currentArchitecture].erase(it);
} else {
++it;
}
@@ -1896,94 +1952,33 @@ bool readDependencies(Options *options)
return true;
}
-bool stripFile(const Options &options, const QString &fileName)
+bool containsApplicationBinary(Options *options)
{
- QString strip = options.ndkPath
- + QLatin1String("/toolchains/")
- + options.toolchainPrefix;
-
- if (!options.useLLVM)
- strip += QLatin1Char('-') + options.toolchainVersion;
-
- strip += QLatin1String("/prebuilt/")
- + options.ndkHost
- + QLatin1String("/bin/")
- + options.toolPrefix
- + QLatin1String("-strip");
-#if defined(Q_OS_WIN32)
- strip += QLatin1String(".exe");
-#endif
-
- if (!QFile::exists(strip)) {
- fprintf(stderr, "Command does not exist: %s\n", qPrintable(strip));
- return false;
- }
-
- if (options.useLLVM)
- strip = QString::fromLatin1("%1 -strip-all %2").arg(shellQuote(strip), shellQuote(fileName));
- else
- strip = QString::fromLatin1("%1 %2").arg(shellQuote(strip), shellQuote(fileName));
-
- FILE *stripCommand = openProcess(strip);
- if (stripCommand == 0) {
- fprintf(stderr, "Cannot execute command %s", qPrintable(strip));
- return false;
- }
-
- pclose(stripCommand);
-
- return true;
-}
-
-bool stripLibraries(const Options &options)
-{
- if (!options.stripLibraries)
+ if (!options->build)
return true;
- if (options.verbose)
- fprintf(stdout, "Stripping libraries to minimize size.\n");
-
- QString libraryPath = options.outputDirectory
- + QLatin1String("/libs/")
- + options.architecture;
- const QStringList libraries = QDir(libraryPath).entryList(QDir::Files);
- for (const QString &library : libraries) {
- if (library.endsWith(QLatin1String(".so"))) {
- if (!stripFile(options, libraryPath + QLatin1Char('/') + library))
- return false;
- }
- }
-
-
- return true;
-}
-
-bool containsApplicationBinary(const Options &options)
-{
- if (options.verbose)
+ if (options->verbose)
fprintf(stdout, "Checking if application binary is in package.\n");
- QFileInfo applicationBinary(options.applicationBinary);
- QString destinationFileName = options.outputDirectory
- + QLatin1String("/libs/")
- + options.architecture
- + QLatin1Char('/')
- + applicationBinary.fileName();
+ QFileInfo applicationBinary(options->applicationBinary);
+ QString applicationFileName = QLatin1String("lib%1_%2.so").arg(options->applicationBinary,
+ options->currentArchitecture);
- if (!QFile::exists(destinationFileName)) {
+ QString applicationPath = QLatin1String("%1/libs/%2/%3").arg(options->outputDirectory,
+ options->currentArchitecture,
+ applicationFileName);
+ if (!QFile::exists(applicationPath)) {
#if defined(Q_OS_WIN32)
QLatin1String makeTool("mingw32-make"); // Only Mingw host builds supported on Windows currently
#else
QLatin1String makeTool("make");
#endif
-
fprintf(stderr, "Application binary is not in output directory: %s. Please run '%s install INSTALL_ROOT=%s' first.\n",
- qPrintable(destinationFileName),
+ qPrintable(applicationFileName),
qPrintable(makeTool),
- qPrintable(options.outputDirectory));
+ qPrintable(options->outputDirectory));
return false;
}
-
return true;
}
@@ -2002,7 +1997,7 @@ FILE *runAdb(const Options &options, const QString &arguments)
if (!options.installLocation.isEmpty())
installOption = QLatin1String(" -s ") + shellQuote(options.installLocation);
- adb = QString::fromLatin1("%1%2 %3").arg(shellQuote(adb)).arg(installOption).arg(arguments);
+ adb = QLatin1String("%1%2 %3").arg(shellQuote(adb), installOption, arguments);
if (options.verbose)
fprintf(stdout, "Running command \"%s\"\n", adb.toLocal8Bit().constData());
@@ -2021,10 +2016,13 @@ bool goodToCopy(const Options *options, const QString &file, QStringList *unmetD
if (!file.endsWith(QLatin1String(".so")))
return true;
+ if (!checkArchitecture(*options, file))
+ return false;
+
bool ret = true;
const auto libs = getQtLibsFromElf(*options, file);
for (const QString &lib : libs) {
- if (!options->qtDependencies.contains(QtDependency(lib, absoluteFilePath(options, lib)))) {
+ if (!options->qtDependencies[options->currentArchitecture].contains(QtDependency(lib, absoluteFilePath(options, lib)))) {
ret = false;
unmetDependencies->append(lib);
}
@@ -2049,12 +2047,12 @@ bool copyQtFiles(Options *options)
if (!options->build)
return true;
+
QString libsDirectory = QLatin1String("libs/");
// Copy other Qt dependencies
- QString libDestinationDirectory = libsDirectory + options->architecture + QLatin1Char('/');
- QString assetsDestinationDirectory = QLatin1String("assets/--Added-by-androiddeployqt--/");
- for (const QtDependency &qtDependency : qAsConst(options->qtDependencies)) {
+ auto assetsDestinationDirectory = QLatin1String("assets/android_rcc_bundle/");
+ for (const QtDependency &qtDependency : qAsConst(options->qtDependencies[options->currentArchitecture])) {
QString sourceFileName = qtDependency.absolutePath;
QString destinationFileName;
@@ -2063,12 +2061,9 @@ bool copyQtFiles(Options *options)
if (qtDependency.relativePath.startsWith(QLatin1String("lib/"))) {
garbledFileName = qtDependency.relativePath.mid(sizeof("lib/") - 1);
} else {
- garbledFileName = QLatin1String("lib")
- + QString(qtDependency.relativePath).replace(QLatin1Char('/'), QLatin1Char('_'));
-
+ garbledFileName = qtDependency.relativePath.mid(qtDependency.relativePath.lastIndexOf(QLatin1Char('/')) + 1);
}
- destinationFileName = libDestinationDirectory + garbledFileName;
-
+ destinationFileName = libsDirectory + options->currentArchitecture + QLatin1Char('/') + garbledFileName;
} else if (qtDependency.relativePath.startsWith(QLatin1String("jar/"))) {
destinationFileName = libsDirectory + qtDependency.relativePath.mid(sizeof("jar/") - 1);
} else {
@@ -2082,20 +2077,34 @@ bool copyQtFiles(Options *options)
QStringList unmetDependencies;
if (!goodToCopy(options, sourceFileName, &unmetDependencies)) {
- fprintf(stdout, " -- Skipping %s. It has unmet dependencies: %s.\n",
- qPrintable(sourceFileName),
- qPrintable(unmetDependencies.join(QLatin1Char(','))));
+ if (unmetDependencies.isEmpty()) {
+ if (options->verbose) {
+ fprintf(stdout, " -- Skipping %s, architecture mismatch.\n",
+ qPrintable(sourceFileName));
+ }
+ } else {
+ if (unmetDependencies.isEmpty()) {
+ if (options->verbose) {
+ fprintf(stdout, " -- Skipping %s, architecture mismatch.\n",
+ qPrintable(sourceFileName));
+ }
+ } else {
+ fprintf(stdout, " -- Skipping %s. It has unmet dependencies: %s.\n",
+ qPrintable(sourceFileName),
+ qPrintable(unmetDependencies.join(QLatin1Char(','))));
+ }
+ }
continue;
}
if (options->deploymentMechanism == Options::Bundled
&& !copyFileIfNewer(sourceFileName,
options->outputDirectory + QLatin1Char('/') + destinationFileName,
- options->verbose)) {
+ *options)) {
return false;
}
- options->bundledFiles += qMakePair(destinationFileName, qtDependency.relativePath);
+ options->bundledFiles[options->currentArchitecture] += qMakePair(destinationFileName, qtDependency.relativePath);
}
return true;
@@ -2144,7 +2153,7 @@ bool createAndroidProject(const Options &options)
return false;
}
- QString androidTool = QString::fromLatin1("%1 update project --path %2 --target %3 --name QtApp")
+ QString androidTool = QLatin1String("%1 update project --path %2 --target %3 --name QtApp")
.arg(shellQuote(androidToolExecutable))
.arg(shellQuote(options.outputDirectory))
.arg(shellQuote(options.androidPlatform));
@@ -2166,7 +2175,7 @@ bool createAndroidProject(const Options &options)
if (options.verbose)
fprintf(stdout, "Updating subproject %s\n", qPrintable(libraryProject));
- androidTool = QString::fromLatin1("%1 update lib-project --path %2 --target %3")
+ androidTool = QLatin1String("%1 update lib-project --path %2 --target %3")
.arg(shellQuote(androidToolExecutable))
.arg(shellQuote(libraryProject))
.arg(shellQuote(options.androidPlatform));
@@ -2205,64 +2214,6 @@ QString findInPath(const QString &fileName)
return QString();
}
-bool buildAntProject(const Options &options)
-{
- if (options.verbose)
- fprintf(stdout, "Building Android package using ant.\n");
-
- QString antTool = options.antTool;
- if (antTool.isEmpty()) {
-#if defined(Q_OS_WIN32)
- antTool = findInPath(QLatin1String("ant.bat"));
-#else
- antTool = findInPath(QLatin1String("ant"));
-#endif
- }
-
- if (antTool.isEmpty()) {
- fprintf(stderr, "Cannot find ant in PATH. Please use --ant option to pass in the correct path.\n");
- return false;
- }
-
- if (options.verbose)
- fprintf(stdout, "Using ant: %s\n", qPrintable(antTool));
-
- QString oldPath = QDir::currentPath();
- if (!QDir::setCurrent(options.outputDirectory)) {
- fprintf(stderr, "Cannot current path to %s\n", qPrintable(options.outputDirectory));
- return false;
- }
-
- QString ant = QString::fromLatin1("%1 %2").arg(shellQuote(antTool)).arg(options.releasePackage ? QLatin1String(" release") : QLatin1String(" debug"));
-
- FILE *antCommand = openProcess(ant);
- if (antCommand == 0) {
- fprintf(stderr, "Cannot run ant command: %s\n.", qPrintable(ant));
- return false;
- }
-
- char buffer[512];
- while (fgets(buffer, sizeof(buffer), antCommand) != 0) {
- fprintf(stdout, "%s", buffer);
- fflush(stdout);
- }
-
- int errorCode = pclose(antCommand);
- if (errorCode != 0) {
- fprintf(stderr, "Building the android package failed!\n");
- if (!options.verbose)
- fprintf(stderr, " -- For more information, run this command with --verbose.\n");
- return false;
- }
-
- if (!QDir::setCurrent(oldPath)) {
- fprintf(stderr, "Cannot change back to old path: %s\n", qPrintable(oldPath));
- return false;
- }
-
- return true;
-}
-
typedef QMap<QByteArray, QByteArray> GradleProperties;
static GradleProperties readGradleProperties(const QString &path)
@@ -2320,7 +2271,7 @@ static bool mergeGradleProperties(const QString &path, GradleProperties properti
return true;
}
-bool buildGradleProject(const Options &options)
+bool buildAndroidProject(const Options &options)
{
GradleProperties localProperties;
localProperties["sdk.dir"] = options.sdkPath.toLocal8Bit();
@@ -2356,7 +2307,10 @@ bool buildGradleProject(const Options &options)
return false;
}
- QString commandLine = QString::fromLatin1("%1 --no-daemon %2").arg(shellQuote(gradlePath)).arg(options.releasePackage ? QLatin1String(" assembleRelease") : QLatin1String(" assembleDebug"));
+ QString commandLine = QLatin1String("%1 --no-daemon %2").arg(shellQuote(gradlePath), options.releasePackage ? QLatin1String(" assembleRelease") : QLatin1String(" assembleDebug"));
+ if (options.buildAAB)
+ commandLine += QLatin1String(" bundle");
+
if (options.verbose)
commandLine += QLatin1String(" --info");
@@ -2388,12 +2342,6 @@ bool buildGradleProject(const Options &options)
return true;
}
-bool buildAndroidProject(const Options &options)
-{
- return options.gradle ? buildGradleProject(options)
- : buildAntProject(options);
-}
-
bool uninstallApk(const Options &options)
{
if (options.verbose)
@@ -2423,32 +2371,38 @@ bool uninstallApk(const Options &options)
}
enum PackageType {
+ AAB,
UnsignedAPK,
SignedAPK
};
-QString apkPath(const Options &options, PackageType pt)
+QString packagePath(const Options &options, PackageType pt)
{
QString path(options.outputDirectory);
- if (options.gradle) {
- path += QLatin1String("/build/outputs/apk/");
- QString buildType(options.releasePackage ? QLatin1String("release/") : QLatin1String("debug/"));
- if (QDir(path + buildType).exists())
- path += buildType;
- path += QDir(options.outputDirectory).dirName() + QLatin1Char('-');
- } else {
- path += QLatin1String("/bin/QtApp-");
- }
+ path += QLatin1String("/build/outputs/%1/").arg(pt >= UnsignedAPK ? QStringLiteral("apk") : QStringLiteral("bundle"));
+ QString buildType(options.releasePackage ? QLatin1String("release/") : QLatin1String("debug/"));
+ if (QDir(path + buildType).exists())
+ path += buildType;
+ path += QDir(options.outputDirectory).dirName() + QLatin1Char('-');
if (options.releasePackage) {
path += QLatin1String("release-");
- if (pt == UnsignedAPK)
- path += QLatin1String("un");
- path += QLatin1String("signed.apk");
+ if (pt >= UnsignedAPK) {
+ if (pt == UnsignedAPK)
+ path += QLatin1String("un");
+ path += QLatin1String("signed.apk");
+ } else {
+ path.chop(1);
+ path += QLatin1String(".aab");
+ }
} else {
path += QLatin1String("debug");
- if (pt == SignedAPK)
- path += QLatin1String("-signed");
- path += QLatin1String(".apk");
+ if (pt >= UnsignedAPK) {
+ if (pt == SignedAPK)
+ path += QLatin1String("-signed");
+ path += QLatin1String(".apk");
+ } else {
+ path += QLatin1String(".aab");
+ }
}
return shellQuote(path);
}
@@ -2465,7 +2419,7 @@ bool installApk(const Options &options)
FILE *adbCommand = runAdb(options,
QLatin1String(" install -r ")
- + apkPath(options, options.keyStore.isEmpty() ? UnsignedAPK
+ + packagePath(options, options.keyStore.isEmpty() ? UnsignedAPK
: SignedAPK));
if (adbCommand == 0)
return false;
@@ -2488,26 +2442,31 @@ bool installApk(const Options &options)
return true;
}
+bool copyPackage(const Options &options)
+{
+ fflush(stdout);
+ auto from = packagePath(options, options.keyStore.isEmpty() ? UnsignedAPK : SignedAPK);
+ QFile::remove(options.apkPath);
+ return QFile::copy(from, options.apkPath);
+}
+
bool copyStdCpp(Options *options)
{
if (options->verbose)
fprintf(stdout, "Copying STL library\n");
- if (!QFile::exists(options->stdCppPath)) {
- fprintf(stderr, "STL library does not exist at %s\n", qPrintable(options->stdCppPath));
- return false;
- }
-
- const QString destinationDirectory = options->outputDirectory
- + QLatin1String("/libs/") + options->architecture;
-
- if (!copyFileIfNewer(options->stdCppPath, destinationDirectory + QLatin1String("/lib")
- + options->stdCppName + QLatin1String(".so"),
- options->verbose)) {
+ QString stdCppPath = QLatin1String("%1/%2/lib%3.so").arg(options->stdCppPath, options->architectures[options->currentArchitecture], options->stdCppName);
+ if (!QFile::exists(stdCppPath)) {
+ fprintf(stderr, "STL library does not exist at %s\n", qPrintable(stdCppPath));
+ fflush(stdout);
+ fflush(stderr);
return false;
}
- return true;
+ const QString destinationFile = QLatin1String("%1/libs/%2/lib%3.so").arg(options->outputDirectory,
+ options->currentArchitecture,
+ options->stdCppName);
+ return copyFileIfNewer(stdCppPath, destinationFile, *options);
}
bool jarSignerSignPackage(const Options &options)
@@ -2521,9 +2480,9 @@ bool jarSignerSignPackage(const Options &options)
jdkPath = QString::fromLocal8Bit(qgetenv("JAVA_HOME"));
#if defined(Q_OS_WIN32)
- QString jarSignerTool = QString::fromLatin1("jarsigner.exe");
+ QString jarSignerTool = QLatin1String("jarsigner.exe");
#else
- QString jarSignerTool = QString::fromLatin1("jarsigner");
+ QString jarSignerTool = QLatin1String("jarsigner");
#endif
if (jdkPath.isEmpty() || !QFile::exists(jdkPath + QLatin1String("/bin/") + jarSignerTool))
@@ -2536,29 +2495,29 @@ bool jarSignerSignPackage(const Options &options)
return false;
}
- jarSignerTool = QString::fromLatin1("%1 -sigalg %2 -digestalg %3 -keystore %4")
- .arg(shellQuote(jarSignerTool)).arg(shellQuote(options.sigAlg)).arg(shellQuote(options.digestAlg)).arg(shellQuote(options.keyStore));
+ jarSignerTool = QLatin1String("%1 -sigalg %2 -digestalg %3 -keystore %4")
+ .arg(shellQuote(jarSignerTool), shellQuote(options.sigAlg), shellQuote(options.digestAlg), shellQuote(options.keyStore));
if (!options.keyStorePassword.isEmpty())
- jarSignerTool += QString::fromLatin1(" -storepass %1").arg(shellQuote(options.keyStorePassword));
+ jarSignerTool += QLatin1String(" -storepass %1").arg(shellQuote(options.keyStorePassword));
if (!options.storeType.isEmpty())
- jarSignerTool += QString::fromLatin1(" -storetype %1").arg(shellQuote(options.storeType));
+ jarSignerTool += QLatin1String(" -storetype %1").arg(shellQuote(options.storeType));
if (!options.keyPass.isEmpty())
- jarSignerTool += QString::fromLatin1(" -keypass %1").arg(shellQuote(options.keyPass));
+ jarSignerTool += QLatin1String(" -keypass %1").arg(shellQuote(options.keyPass));
if (!options.sigFile.isEmpty())
- jarSignerTool += QString::fromLatin1(" -sigfile %1").arg(shellQuote(options.sigFile));
+ jarSignerTool += QLatin1String(" -sigfile %1").arg(shellQuote(options.sigFile));
if (!options.signedJar.isEmpty())
- jarSignerTool += QString::fromLatin1(" -signedjar %1").arg(shellQuote(options.signedJar));
+ jarSignerTool += QLatin1String(" -signedjar %1").arg(shellQuote(options.signedJar));
if (!options.tsaUrl.isEmpty())
- jarSignerTool += QString::fromLatin1(" -tsa %1").arg(shellQuote(options.tsaUrl));
+ jarSignerTool += QLatin1String(" -tsa %1").arg(shellQuote(options.tsaUrl));
if (!options.tsaCert.isEmpty())
- jarSignerTool += QString::fromLatin1(" -tsacert %1").arg(shellQuote(options.tsaCert));
+ jarSignerTool += QLatin1String(" -tsacert %1").arg(shellQuote(options.tsaCert));
if (options.internalSf)
jarSignerTool += QLatin1String(" -internalsf");
@@ -2569,29 +2528,39 @@ bool jarSignerSignPackage(const Options &options)
if (options.protectedAuthenticationPath)
jarSignerTool += QLatin1String(" -protected");
- jarSignerTool += QString::fromLatin1(" %1 %2")
- .arg(apkPath(options, UnsignedAPK))
- .arg(shellQuote(options.keyStoreAlias));
+ auto signPackage = [&](const QString &file) {
+ fprintf(stdout, "Signing file %s\n", qPrintable(file));
+ fflush(stdout);
+ auto command = jarSignerTool + QLatin1String(" %1 %2")
+ .arg(file)
+ .arg(shellQuote(options.keyStoreAlias));
- FILE *jarSignerCommand = openProcess(jarSignerTool);
- if (jarSignerCommand == 0) {
- fprintf(stderr, "Couldn't run jarsigner.\n");
- return false;
- }
+ FILE *jarSignerCommand = openProcess(command);
+ if (jarSignerCommand == 0) {
+ fprintf(stderr, "Couldn't run jarsigner.\n");
+ return false;
+ }
- if (options.verbose) {
- char buffer[512];
- while (fgets(buffer, sizeof(buffer), jarSignerCommand) != 0)
- fprintf(stdout, "%s", buffer);
- }
+ if (options.verbose) {
+ char buffer[512];
+ while (fgets(buffer, sizeof(buffer), jarSignerCommand) != 0)
+ fprintf(stdout, "%s", buffer);
+ }
- int errorCode = pclose(jarSignerCommand);
- if (errorCode != 0) {
- fprintf(stderr, "jarsigner command failed.\n");
- if (!options.verbose)
- fprintf(stderr, " -- Run with --verbose for more information.\n");
+ int errorCode = pclose(jarSignerCommand);
+ if (errorCode != 0) {
+ fprintf(stderr, "jarsigner command failed.\n");
+ if (!options.verbose)
+ fprintf(stderr, " -- Run with --verbose for more information.\n");
+ return false;
+ }
+ return true;
+ };
+
+ if (!signPackage(packagePath(options, UnsignedAPK)))
+ return false;
+ if (options.buildAAB && !signPackage(packagePath(options, AAB)))
return false;
- }
QString zipAlignTool = options.sdkPath + QLatin1String("/tools/zipalign");
#if defined(Q_OS_WIN32)
@@ -2609,11 +2578,11 @@ bool jarSignerSignPackage(const Options &options)
}
}
- zipAlignTool = QString::fromLatin1("%1%2 -f 4 %3 %4")
- .arg(shellQuote(zipAlignTool))
- .arg(options.verbose ? QString::fromLatin1(" -v") : QString())
- .arg(apkPath(options, UnsignedAPK))
- .arg(apkPath(options, SignedAPK));
+ zipAlignTool = QLatin1String("%1%2 -f 4 %3 %4")
+ .arg(shellQuote(zipAlignTool),
+ options.verbose ? QLatin1String(" -v") : QLatin1String(),
+ packagePath(options, UnsignedAPK),
+ packagePath(options, SignedAPK));
FILE *zipAlignCommand = openProcess(zipAlignTool);
if (zipAlignCommand == 0) {
@@ -2625,7 +2594,7 @@ bool jarSignerSignPackage(const Options &options)
while (fgets(buffer, sizeof(buffer), zipAlignCommand) != 0)
fprintf(stdout, "%s", buffer);
- errorCode = pclose(zipAlignCommand);
+ int errorCode = pclose(zipAlignCommand);
if (errorCode != 0) {
fprintf(stderr, "zipalign command failed.\n");
if (!options.verbose)
@@ -2633,7 +2602,7 @@ bool jarSignerSignPackage(const Options &options)
return false;
}
- return QFile::remove(apkPath(options, UnsignedAPK));
+ return QFile::remove(packagePath(options, UnsignedAPK));
}
bool signPackage(const Options &options)
@@ -2664,11 +2633,11 @@ bool signPackage(const Options &options)
}
}
- zipAlignTool = QString::fromLatin1("%1%2 -f 4 %3 %4")
- .arg(shellQuote(zipAlignTool))
- .arg(options.verbose ? QString::fromLatin1(" -v") : QString())
- .arg(apkPath(options, UnsignedAPK))
- .arg(apkPath(options, SignedAPK));
+ zipAlignTool = QLatin1String("%1%2 -f 4 %3 %4")
+ .arg(shellQuote(zipAlignTool),
+ options.verbose ? QLatin1String(" -v") : QLatin1String(),
+ packagePath(options, UnsignedAPK),
+ packagePath(options, SignedAPK));
FILE *zipAlignCommand = openProcess(zipAlignTool);
if (zipAlignCommand == 0) {
@@ -2688,23 +2657,23 @@ bool signPackage(const Options &options)
return false;
}
- QString apkSignerCommandLine = QString::fromLatin1("%1 sign --ks %2")
- .arg(shellQuote(apksignerTool)).arg(shellQuote(options.keyStore));
+ QString apkSignerCommandLine = QLatin1String("%1 sign --ks %2")
+ .arg(shellQuote(apksignerTool), shellQuote(options.keyStore));
if (!options.keyStorePassword.isEmpty())
- apkSignerCommandLine += QString::fromLatin1(" --ks-pass pass:%1").arg(shellQuote(options.keyStorePassword));
+ apkSignerCommandLine += QLatin1String(" --ks-pass pass:%1").arg(shellQuote(options.keyStorePassword));
if (!options.keyStoreAlias.isEmpty())
- apkSignerCommandLine += QString::fromLatin1(" --ks-key-alias %1").arg(shellQuote(options.keyStoreAlias));
+ apkSignerCommandLine += QLatin1String(" --ks-key-alias %1").arg(shellQuote(options.keyStoreAlias));
if (!options.keyPass.isEmpty())
- apkSignerCommandLine += QString::fromLatin1(" --key-pass pass:%1").arg(shellQuote(options.keyPass));
+ apkSignerCommandLine += QLatin1String(" --key-pass pass:%1").arg(shellQuote(options.keyPass));
if (options.verbose)
apkSignerCommandLine += QLatin1String(" --verbose");
- apkSignerCommandLine += QString::fromLatin1(" %1")
- .arg(apkPath(options, SignedAPK));
+ apkSignerCommandLine += QLatin1String(" %1")
+ .arg(packagePath(options, SignedAPK));
auto apkSignerRunner = [&] {
FILE *apkSignerCommand = openProcess(apkSignerCommandLine);
@@ -2731,111 +2700,11 @@ bool signPackage(const Options &options)
if (!apkSignerRunner())
return false;
- apkSignerCommandLine = QString::fromLatin1("%1 verify --verbose %2")
- .arg(shellQuote(apksignerTool)).arg(apkPath(options, SignedAPK));
+ apkSignerCommandLine = QLatin1String("%1 verify --verbose %2")
+ .arg(shellQuote(apksignerTool), packagePath(options, SignedAPK));
// Verify the package and remove the unsigned apk
- return apkSignerRunner() && QFile::remove(apkPath(options, UnsignedAPK));
-}
-
-bool copyGdbServer(const Options &options)
-{
- if (options.verbose)
- fprintf(stdout, "Copying gdbserver into package.\n");
-
- QString architectureSubDirectory;
- if (options.architecture == QLatin1String("arm64-v8a"))
- architectureSubDirectory = QLatin1String("android-arm64");
- else if (options.architecture.startsWith(QLatin1String("arm")))
- architectureSubDirectory = QLatin1String("android-arm");
- else
- architectureSubDirectory = QLatin1String("android-") + options.architecture;
-
- QString gdbServerBinary = options.ndkPath
- + QLatin1String("/prebuilt/")
- + architectureSubDirectory
- + QLatin1String("/gdbserver/gdbserver");
- if (!QFile::exists(gdbServerBinary)) {
- fprintf(stderr, "Cannot find gdbserver at %s.\n", qPrintable(gdbServerBinary));
- return false;
- }
-
- QString gdbServerTarget = options.outputDirectory + QLatin1String("/libs/") + options.architecture;
-
- if (!copyFileIfNewer(gdbServerBinary,
- gdbServerTarget + QLatin1String("/gdbserver"),
- options.verbose)
- || !copyFileIfNewer(gdbServerBinary,
- gdbServerTarget + QLatin1String("/libgdbserver.so"),
- options.verbose)) {
- return false;
- }
-
- QString addedByAndroidDeployQtPath = options.outputDirectory + QLatin1String("/assets/--Added-by-androiddeployqt--/");
- if (!QDir().mkpath(addedByAndroidDeployQtPath)) {
- fprintf(stderr, "Failed to create directory '%s'", qPrintable(addedByAndroidDeployQtPath));
- return false;
- }
- QFile f(addedByAndroidDeployQtPath + QLatin1String("debugger.command"));
- if (!f.open(QIODevice::WriteOnly)) {
- fprintf(stderr, "Failed to create directory '%s'", qPrintable(addedByAndroidDeployQtPath));
- return false;
- }
- f.write("lib/libgdbserver.so --multi +");
- f.close();
-
- return true;
-}
-
-bool generateAssetsFileList(const Options &options)
-{
- if (options.verbose)
- fprintf(stdout, "Pregenerating entry list for assets file engine.\n");
-
- QString assetsPath = options.outputDirectory + QLatin1String("/assets/");
- QString addedByAndroidDeployQtPath = assetsPath + QLatin1String("--Added-by-androiddeployqt--/");
- if (!QDir().mkpath(addedByAndroidDeployQtPath)) {
- fprintf(stderr, "Failed to create directory '%s'", qPrintable(addedByAndroidDeployQtPath));
- return false;
- }
-
- QFile file(addedByAndroidDeployQtPath + QLatin1String("/qt_cache_pregenerated_file_list"));
- if (file.open(QIODevice::WriteOnly)) {
- QDirIterator dirIterator(assetsPath,
- QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot,
- QDirIterator::Subdirectories);
-
- QHash<QString, QStringList> directoryContents;
- while (dirIterator.hasNext()) {
- const QString name = dirIterator.next().mid(assetsPath.length());
-
- int slashIndex = name.lastIndexOf(QLatin1Char('/'));
- QString pathName = slashIndex >= 0 ? name.left(slashIndex) : QString::fromLatin1("/");
- QString fileName = slashIndex >= 0 ? name.mid(pathName.length() + 1) : name;
-
- if (!fileName.isEmpty() && dirIterator.fileInfo().isDir() && !fileName.endsWith(QLatin1Char('/')))
- fileName += QLatin1Char('/');
-
- if (fileName.isEmpty() && !directoryContents.contains(pathName))
- directoryContents[pathName] = QStringList();
- else if (!fileName.isEmpty())
- directoryContents[pathName].append(fileName);
- }
-
- QDataStream stream(&file);
- stream.setVersion(QDataStream::Qt_5_3);
- for (auto it = directoryContents.cbegin(), end = directoryContents.cend(); it != end; ++it) {
- const QStringList &entryList = it.value();
- stream << it.key() << entryList.size();
- for (const QString &entry : entryList)
- stream << entry;
- }
- } else {
- fprintf(stderr, "Pregenerating entry list for assets file engine failed!\n");
- return false;
- }
-
- return true;
+ return apkSignerRunner() && QFile::remove(packagePath(options, UnsignedAPK));
}
enum ErrorCode
@@ -2848,8 +2717,6 @@ enum ErrorCode
CannotCopyGnuStl = 5,
CannotCopyQtFiles = 6,
CannotFindApplicationBinary = 7,
- CannotCopyGdbServer = 8,
- CannotStripLibraries = 9,
CannotCopyAndroidExtraLibs = 10,
CannotCopyAndroidSources = 11,
CannotUpdateAndroidFiles = 12,
@@ -2857,8 +2724,9 @@ enum ErrorCode
CannotBuildAndroidProject = 14,
CannotSignPackage = 15,
CannotInstallApk = 16,
- CannotGenerateAssetsFileList = 18,
- CannotCopyAndroidExtraResources = 19
+ CannotCopyAndroidExtraResources = 19,
+ CannotCopyApk = 20,
+ CannotCreateRcc = 21
};
int main(int argc, char *argv[])
@@ -2896,27 +2764,8 @@ int main(int argc, char *argv[])
: "No"
);
- if (options.auxMode) {
- if (!readDependencies(&options))
- return CannotReadDependencies;
- if (!copyQtFiles(&options))
- return CannotCopyQtFiles;
- if (!copyAndroidExtraResources(options))
- return CannotCopyAndroidExtraResources;
- if (!copyAndroidExtraLibs(options))
- return CannotCopyAndroidExtraLibs;
- if (!stripLibraries(options))
- return CannotStripLibraries;
- if (!updateAndroidFiles(options))
- return CannotUpdateAndroidFiles;
- if (options.generateAssetsFileList && !generateAssetsFileList(options))
- return CannotGenerateAssetsFileList;
- return 0;
- }
-
- if (options.build) {
- if (options.gradle)
- cleanAndroidFiles(options);
+ if (options.build && !options.auxMode) {
+ cleanAndroidFiles(options);
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Cleaned Android file\n", options.timer.elapsed());
@@ -2927,72 +2776,76 @@ int main(int argc, char *argv[])
fprintf(stdout, "[TIMING] %d ms: Copied Android template\n", options.timer.elapsed());
}
- if (!readDependencies(&options))
- return CannotReadDependencies;
-
- if (Q_UNLIKELY(options.timing))
- fprintf(stdout, "[TIMING] %d ms: Read dependencies\n", options.timer.elapsed());
+ for (auto it = options.architectures.constBegin(); it != options.architectures.constEnd(); ++it) {
+ options.clear(it.key());
- if (options.deploymentMechanism != Options::Ministro && !copyStdCpp(&options))
- return CannotCopyGnuStl;
+ if (!readDependencies(&options))
+ return CannotReadDependencies;
- if (Q_UNLIKELY(options.timing))
- fprintf(stdout, "[TIMING] %d ms: Copied GNU STL\n", options.timer.elapsed());
+ if (Q_UNLIKELY(options.timing))
+ fprintf(stdout, "[TIMING] %d ms: Read dependencies\n", options.timer.elapsed());
- if (!copyQtFiles(&options))
- return CannotCopyQtFiles;
+ if (!copyQtFiles(&options))
+ return CannotCopyQtFiles;
- if (options.build) {
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Copied Qt files\n", options.timer.elapsed());
- if (!containsApplicationBinary(options))
- return CannotFindApplicationBinary;
+ if (!copyAndroidExtraLibs(&options))
+ return CannotCopyAndroidExtraLibs;
if (Q_UNLIKELY(options.timing))
- fprintf(stdout, "[TIMING] %d ms: Checked for application binary\n", options.timer.elapsed());
+ fprintf(stdout, "[TIMING] %d ms: Copied extra libs\n", options.timer.elapsed());
- bool needToCopyGdbServer = options.gdbServer == Options::True
- || (options.gdbServer == Options::Auto && !options.releasePackage);
- if (needToCopyGdbServer && !copyGdbServer(options))
- return CannotCopyGdbServer;
+ if (!copyAndroidExtraResources(&options))
+ return CannotCopyAndroidExtraResources;
if (Q_UNLIKELY(options.timing))
- fprintf(stdout, "[TIMING] %d ms: Copied GDB server\n", options.timer.elapsed());
+ fprintf(stdout, "[TIMING] %d ms: Copied extra resources\n", options.timer.elapsed());
- if (!copyAndroidExtraLibs(options))
- return CannotCopyAndroidExtraLibs;
+ if (!options.auxMode) {
+ if (options.deploymentMechanism != Options::Ministro && !copyStdCpp(&options))
+ return CannotCopyGnuStl;
+
+ if (Q_UNLIKELY(options.timing))
+ fprintf(stdout, "[TIMING] %d ms: Copied GNU STL\n", options.timer.elapsed());
+ }
+
+ if (!containsApplicationBinary(&options))
+ return CannotFindApplicationBinary;
if (Q_UNLIKELY(options.timing))
- fprintf(stdout, "[TIMING] %d ms: Copied extra libs\n", options.timer.elapsed());
+ fprintf(stdout, "[TIMING] %d ms: Checked for application binary\n", options.timer.elapsed());
- if (!copyAndroidExtraResources(options))
- return CannotCopyAndroidExtraResources;
+ if (options.deploymentMechanism != Options::Ministro) {
+ if (Q_UNLIKELY(options.timing))
+ fprintf(stdout, "[TIMING] %d ms: Bundled Qt libs\n", options.timer.elapsed());
+ }
+ }
+ if (!createRcc(options))
+ return CannotCreateRcc;
+
+ if (options.auxMode) {
+ if (!updateAndroidFiles(options))
+ return CannotUpdateAndroidFiles;
+ return 0;
+ }
+
+
+ if (options.build) {
if (!copyAndroidSources(options))
return CannotCopyAndroidSources;
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Copied android sources\n", options.timer.elapsed());
- if (!stripLibraries(options))
- return CannotStripLibraries;
-
- if (Q_UNLIKELY(options.timing))
- fprintf(stdout, "[TIMING] %d ms: Stripped libraries\n", options.timer.elapsed());
-
if (!updateAndroidFiles(options))
return CannotUpdateAndroidFiles;
- if (options.generateAssetsFileList && !generateAssetsFileList(options))
- return CannotGenerateAssetsFileList;
-
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Updated files\n", options.timer.elapsed());
- if (!options.gradle && !createAndroidProject(options))
- return CannotCreateAndroidProject;
-
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Created project\n", options.timer.elapsed());
@@ -3005,6 +2858,9 @@ int main(int argc, char *argv[])
if (!options.keyStore.isEmpty() && !signPackage(options))
return CannotSignPackage;
+ if (!options.apkPath.isEmpty() && !copyPackage(options))
+ return CannotCopyApk;
+
if (Q_UNLIKELY(options.timing))
fprintf(stdout, "[TIMING] %d ms: Signed package\n", options.timer.elapsed());
}
@@ -3020,7 +2876,7 @@ int main(int argc, char *argv[])
if (options.installApk)
fprintf(stdout, " -- It can now be run from the selected device/emulator.\n");
- fprintf(stdout, " -- File: %s\n", qPrintable(apkPath(options, options.keyStore.isEmpty() ? UnsignedAPK
+ fprintf(stdout, " -- File: %s\n", qPrintable(packagePath(options, options.keyStore.isEmpty() ? UnsignedAPK
: SignedAPK)));
fflush(stdout);
return 0;
diff --git a/src/tools/androidtestrunner/androidtestrunner.pro b/src/tools/androidtestrunner/androidtestrunner.pro
new file mode 100644
index 0000000000..641d3e0003
--- /dev/null
+++ b/src/tools/androidtestrunner/androidtestrunner.pro
@@ -0,0 +1,13 @@
+option(host_build)
+CONFIG += console
+
+SOURCES += \
+ main.cpp
+
+# Required for declarations of popen/pclose on Windows
+windows: QMAKE_CXXFLAGS += -U__STRICT_ANSI__
+
+DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
+DEFINES += QT_NO_FOREACH
+
+load(qt_app)
diff --git a/src/tools/androidtestrunner/main.cpp b/src/tools/androidtestrunner/main.cpp
new file mode 100644
index 0000000000..1046c7b7ef
--- /dev/null
+++ b/src/tools/androidtestrunner/main.cpp
@@ -0,0 +1,490 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 BogDan Vatra <bogdan@kde.org>
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include <QDir>
+#include <QHash>
+#include <QRegExp>
+#include <QSystemSemaphore>
+#include <QXmlStreamReader>
+
+#include <algorithm>
+#include <chrono>
+#include <functional>
+#include <thread>
+
+#ifdef Q_CC_MSVC
+#define popen _popen
+#define QT_POPEN_READ "rb"
+#define pclose _pclose
+#else
+#define QT_POPEN_READ "r"
+#endif
+
+struct Options
+{
+ bool helpRequested = false;
+ bool verbose = false;
+ std::chrono::seconds timeout{300}; // 5minutes
+ QString androidDeployQtCommand;
+ QString buildPath;
+ QString adbCommand{QStringLiteral("adb")};
+ QString makeCommand;
+ QString package;
+ QString activity;
+ QStringList testArgsList;
+ QHash<QString, QString> outFiles;
+ QString testArgs;
+ QString apkPath;
+ QHash<QString, std::function<bool(const QByteArray &)>> checkFiles = {
+ {QStringLiteral("txt"), [](const QByteArray &data) -> bool {
+ return data.indexOf("\nFAIL! : ") < 0;
+ }},
+ {QStringLiteral("csv"), [](const QByteArray &/*data*/) -> bool {
+ // It seems csv is broken
+ return true;
+ }},
+ {QStringLiteral("xml"), [](const QByteArray &data) -> bool {
+ QXmlStreamReader reader{data};
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == QStringLiteral("Incident") &&
+ reader.attributes().value(QStringLiteral("type")).toString() == QStringLiteral("fail")) {
+ return false;
+ }
+ }
+ return true;
+ }},
+ {QStringLiteral("lightxml"), [](const QByteArray &data) -> bool {
+ return data.indexOf("\n<Incident type=\"fail\" ") < 0;
+ }},
+ {QStringLiteral("xunitxml"), [](const QByteArray &data) -> bool {
+ QXmlStreamReader reader{data};
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == QStringLiteral("testcase") &&
+ reader.attributes().value(QStringLiteral("result")).toString() == QStringLiteral("fail")) {
+ return false;
+ }
+ }
+ return true;
+ }},
+ {QStringLiteral("teamcity"), [](const QByteArray &data) -> bool {
+ return data.indexOf("' message='Failure! |[Loc: ") < 0;
+ }},
+ {QStringLiteral("tap"), [](const QByteArray &data) -> bool {
+ return data.indexOf("\nnot ok ") < 0;
+ }},
+ };
+};
+
+static Options g_options;
+
+static bool execCommand(const QString &command, QByteArray *output = nullptr, bool verbose = false)
+{
+ if (verbose)
+ fprintf(stdout, "Execute %s\n", command.toUtf8().constData());
+ FILE *process = popen(command.toUtf8().constData(), QT_POPEN_READ);
+
+ if (!process) {
+ fprintf(stderr, "Cannot execute command %s", qPrintable(command));
+ return false;
+ }
+ char buffer[512];
+ while (fgets(buffer, sizeof(buffer), process)) {
+ if (output)
+ output->append(buffer);
+ if (verbose)
+ fprintf(stdout, "%s", buffer);
+ }
+ return pclose(process) == 0;
+}
+
+// Copy-pasted from qmake/library/ioutil.cpp
+inline static bool hasSpecialChars(const QString &arg, const uchar (&iqm)[16])
+{
+ for (int x = arg.length() - 1; x >= 0; --x) {
+ ushort c = arg.unicode()[x].unicode();
+ if ((c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7))))
+ return true;
+ }
+ return false;
+}
+
+static QString shellQuoteUnix(const QString &arg)
+{
+ // Chars that should be quoted (TM). This includes:
+ static const uchar iqm[] = {
+ 0xff, 0xff, 0xff, 0xff, 0xdf, 0x07, 0x00, 0xd8,
+ 0x00, 0x00, 0x00, 0x38, 0x01, 0x00, 0x00, 0x78
+ }; // 0-32 \'"$`<>|;&(){}*?#!~[]
+
+ if (!arg.length())
+ return QStringLiteral("\"\"");
+
+ QString ret(arg);
+ if (hasSpecialChars(ret, iqm)) {
+ ret.replace(QLatin1Char('\''), QStringLiteral("'\\''"));
+ ret.prepend(QLatin1Char('\''));
+ ret.append(QLatin1Char('\''));
+ }
+ return ret;
+}
+
+static QString shellQuoteWin(const QString &arg)
+{
+ // Chars that should be quoted (TM). This includes:
+ // - control chars & space
+ // - the shell meta chars "&()<>^|
+ // - the potential separators ,;=
+ static const uchar iqm[] = {
+ 0xff, 0xff, 0xff, 0xff, 0x45, 0x13, 0x00, 0x78,
+ 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x10
+ };
+
+ if (!arg.length())
+ return QStringLiteral("\"\"");
+
+ QString ret(arg);
+ if (hasSpecialChars(ret, iqm)) {
+ // Quotes are escaped and their preceding backslashes are doubled.
+ // It's impossible to escape anything inside a quoted string on cmd
+ // level, so the outer quoting must be "suspended".
+ ret.replace(QRegExp(QStringLiteral("(\\\\*)\"")), QStringLiteral("\"\\1\\1\\^\"\""));
+ // The argument must not end with a \ since this would be interpreted
+ // as escaping the quote -- rather put the \ behind the quote: e.g.
+ // rather use "foo"\ than "foo\"
+ int i = ret.length();
+ while (i > 0 && ret.at(i - 1) == QLatin1Char('\\'))
+ --i;
+ ret.insert(i, QLatin1Char('"'));
+ ret.prepend(QLatin1Char('"'));
+ }
+ return ret;
+}
+
+static QString shellQuote(const QString &arg)
+{
+ if (QDir::separator() == QLatin1Char('\\'))
+ return shellQuoteWin(arg);
+ else
+ return shellQuoteUnix(arg);
+}
+
+static bool parseOptions()
+{
+ QStringList arguments = QCoreApplication::arguments();
+ int i = 1;
+ for (; i < arguments.size(); ++i) {
+ const QString &argument = arguments.at(i);
+ if (argument.compare(QStringLiteral("--androiddeployqt"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.androidDeployQtCommand = arguments.at(++i).trimmed();
+ } else if (argument.compare(QStringLiteral("--adb"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.adbCommand = arguments.at(++i);
+ } else if (argument.compare(QStringLiteral("--path"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.buildPath = arguments.at(++i);
+ } else if (argument.compare(QStringLiteral("--make"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.makeCommand = arguments.at(++i);
+ } else if (argument.compare(QStringLiteral("--apk"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.apkPath = arguments.at(++i);
+ } else if (argument.compare(QStringLiteral("--activity"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.activity = arguments.at(++i);
+ } else if (argument.compare(QStringLiteral("--timeout"), Qt::CaseInsensitive) == 0) {
+ if (i + 1 == arguments.size())
+ g_options.helpRequested = true;
+ else
+ g_options.timeout = std::chrono::seconds{arguments.at(++i).toInt()};
+ } else if (argument.compare(QStringLiteral("--help"), Qt::CaseInsensitive) == 0) {
+ g_options.helpRequested = true;
+ } else if (argument.compare(QStringLiteral("--verbose"), Qt::CaseInsensitive) == 0) {
+ g_options.verbose = true;
+ } else if (argument.compare(QStringLiteral("--"), Qt::CaseInsensitive) == 0) {
+ ++i;
+ break;
+ } else {
+ g_options.testArgsList << arguments.at(i);
+ }
+ }
+ for (;i < arguments.size(); ++i)
+ g_options.testArgsList << arguments.at(i);
+
+ if (g_options.helpRequested || g_options.androidDeployQtCommand.isEmpty() || g_options.buildPath.isEmpty())
+ return false;
+
+ QString serial = qEnvironmentVariable("ANDROID_DEVICE_SERIAL");
+ if (!serial.isEmpty())
+ g_options.adbCommand += QStringLiteral(" -s %1").arg(serial);
+ return true;
+}
+
+static void printHelp()
+{// "012345678901234567890123456789012345678901234567890123456789012345678901"
+ fprintf(stderr, "Syntax: %s <options> -- [TESTARGS] \n"
+ "\n"
+ " Creates an Android package in a temp directory <destination> and\n"
+ " runs it on the default emulator/device or on the one specified by\n"
+ " \"ANDROID_DEVICE_SERIAL\" environment variable.\n\n"
+ " Mandatory arguments:\n"
+ " --androiddeployqt <androiddeployqt cmd>: The androiddeployqt:\n"
+ " path including its additional arguments.\n"
+ " --path <path>: The path where androiddeployqt will build the .apk.\n"
+ " Optional arguments:\n"
+ " --adb <adb cmd>: The Android ADB command. If missing the one from\n"
+ " $PATH will be used.\n"
+ " --activity <acitvity>: The Activity to run. If missing the first\n"
+ " activity from AndroidManifest.qml file will be used.\n"
+ " --timeout <seconds>: Timeout to run the test.\n"
+ " Default is 5 minutes.\n"
+ " --make <make cmd>: make command, needed to install the qt library.\n"
+ " If make is missing make sure the --path is set.\n"
+ " --apk <apk path>: If the apk is specified and if exists, we'll skip\n"
+ " the package building.\n"
+ " -- arguments that will be passed to the test application.\n"
+ " --verbose: Prints out information during processing.\n"
+ " --help: Displays this information.\n\n",
+ qPrintable(QCoreApplication::arguments().at(0))
+ );
+}
+
+static QString packageNameFromAndroidManifest(const QString &androidManifestPath)
+{
+ QFile androidManifestXml(androidManifestPath);
+ if (androidManifestXml.open(QIODevice::ReadOnly)) {
+ QXmlStreamReader reader(&androidManifestXml);
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == QStringLiteral("manifest"))
+ return reader.attributes().value(QStringLiteral("package")).toString();
+ }
+ }
+ return {};
+}
+
+static QString activityFromAndroidManifest(const QString &androidManifestPath)
+{
+ QFile androidManifestXml(androidManifestPath);
+ if (androidManifestXml.open(QIODevice::ReadOnly)) {
+ QXmlStreamReader reader(&androidManifestXml);
+ while (!reader.atEnd()) {
+ reader.readNext();
+ if (reader.isStartElement() && reader.name() == QStringLiteral("activity"))
+ return reader.attributes().value(QStringLiteral("android:name")).toString();
+ }
+ }
+ return {};
+}
+
+static void setOutputFile(QString file, QString format)
+{
+ if (file.isEmpty())
+ file = QStringLiteral("-");
+ if (format.isEmpty())
+ format = QStringLiteral("txt");
+
+ g_options.outFiles[format] = file;
+}
+
+static bool parseTestArgs()
+{
+ QRegExp newLoggingFormat{QStringLiteral("(.*),(txt|csv|xunitxml|xml|lightxml|teamcity|tap)")};
+ QRegExp oldFormats{QStringLiteral("-(txt|csv|xunitxml|xml|lightxml|teamcity|tap)")};
+
+ QString file;
+ QString logType;
+ QString unhandledArgs;
+ for (int i = 0; i < g_options.testArgsList.size(); ++i) {
+ const QString &arg = g_options.testArgsList[i].trimmed();
+ if (arg == QStringLiteral("-o")) {
+ if (i >= g_options.testArgsList.size() - 1)
+ return false; // missing file argument
+
+ const auto &filePath = g_options.testArgsList[++i];
+ if (!newLoggingFormat.exactMatch(filePath)) {
+ file = filePath;
+ } else {
+ const auto capturedTexts = newLoggingFormat.capturedTexts();
+ setOutputFile(capturedTexts.at(1), capturedTexts.at(2));
+ }
+ } else if (oldFormats.exactMatch(arg)) {
+ logType = oldFormats.capturedTexts().at(1);
+ } else {
+ unhandledArgs += QStringLiteral(" %1").arg(arg);
+ }
+ }
+ if (g_options.outFiles.isEmpty() || !file.isEmpty() || !logType.isEmpty())
+ setOutputFile(file, logType);
+
+ for (const auto &format : g_options.outFiles.keys())
+ g_options.testArgs += QStringLiteral(" -o output.%1,%1").arg(format);
+
+ g_options.testArgs += unhandledArgs;
+ g_options.testArgs = QStringLiteral("shell am start -e applicationArguments \\\"%1\\\" -n %2/%3").arg(shellQuote(g_options.testArgs.trimmed()),
+ g_options.package,
+ g_options.activity);
+ return true;
+}
+
+static bool isRunning() {
+ QByteArray output;
+ if (!execCommand(QStringLiteral("%1 shell \"ps | grep ' %2'\"").arg(g_options.adbCommand,
+ shellQuote(g_options.package)), &output)) {
+
+ return false;
+ }
+ return output.indexOf(" " + g_options.package.toUtf8()) > -1;
+}
+
+static bool waitToFinish()
+{
+ using clock = std::chrono::system_clock;
+ auto start = clock::now();
+ // wait to start
+ while (!isRunning()) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ if ((clock::now() - start) > std::chrono::seconds{10})
+ return false;
+ }
+
+ // Wait to finish
+ while (isRunning()) {
+ std::this_thread::sleep_for(std::chrono::milliseconds(250));
+ if ((clock::now() - start) > g_options.timeout)
+ return false;
+ }
+ return true;
+}
+
+
+static bool pullFiles()
+{
+ bool ret = true;
+ for (auto it = g_options.outFiles.constBegin(); it != g_options.outFiles.end(); ++it) {
+ QByteArray output;
+ if (!execCommand(QStringLiteral("%1 shell run-as %2 cat files/output.%3")
+ .arg(g_options.adbCommand, g_options.package, it.key()), &output)) {
+ return false;
+ }
+ auto checkerIt = g_options.checkFiles.find(it.key());
+ ret = ret && checkerIt != g_options.checkFiles.end() && checkerIt.value()(output);
+ if (it.value() == QStringLiteral("-")){
+ fprintf(stdout, "%s", output.constData());
+ fflush(stdout);
+ } else {
+ QFile out{it.value()};
+ if (!out.open(QIODevice::WriteOnly))
+ return false;
+ out.write(output);
+ }
+ }
+ return ret;
+}
+
+struct RunnerLocker
+{
+ RunnerLocker()
+ {
+ runner.acquire();
+ }
+ ~RunnerLocker()
+ {
+ runner.release();
+ }
+ QSystemSemaphore runner{QStringLiteral("androidtestrunner"), 1, QSystemSemaphore::Open};
+};
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+ if (!parseOptions()) {
+ printHelp();
+ return 1;
+ }
+
+ RunnerLocker lock; // do not install or run packages while another test is running
+ if (!g_options.apkPath.isEmpty() && QFile::exists(g_options.apkPath)) {
+ if (!execCommand(QStringLiteral("%1 install -r %2")
+ .arg(g_options.adbCommand, g_options.apkPath), nullptr, g_options.verbose)) {
+ return 1;
+ }
+ } else {
+ if (!g_options.makeCommand.isEmpty()) {
+ // we need to run make INSTALL_ROOT=path install to install the application file(s) first
+ if (!execCommand(QStringLiteral("%1 INSTALL_ROOT=%2 install")
+ .arg(g_options.makeCommand, QDir::toNativeSeparators(g_options.buildPath)), nullptr, g_options.verbose)) {
+ return 1;
+ }
+ }
+
+ // Run androiddeployqt
+ static auto verbose = g_options.verbose ? QStringLiteral("--verbose") : QStringLiteral();
+ if (!execCommand(QStringLiteral("%1 %3 --reinstall --output %2 --apk %4").arg(g_options.androidDeployQtCommand,
+ g_options.buildPath,
+ verbose,
+ g_options.apkPath), nullptr, true)) {
+ return 1;
+ }
+ }
+
+ QString manifest = g_options.buildPath + QStringLiteral("/AndroidManifest.xml");
+ g_options.package = packageNameFromAndroidManifest(manifest);
+ if (g_options.activity.isEmpty())
+ g_options.activity = activityFromAndroidManifest(manifest);
+
+ // parseTestArgs depends on g_options.package
+ if (!parseTestArgs())
+ return 1;
+
+ // start the tests
+ bool res = execCommand(QStringLiteral("%1 %2").arg(g_options.adbCommand, g_options.testArgs),
+ nullptr, g_options.verbose) && waitToFinish();
+ if (res)
+ res &= pullFiles();
+ res &= execCommand(QStringLiteral("%1 uninstall %2").arg(g_options.adbCommand, g_options.package),
+ nullptr, g_options.verbose);
+ fflush(stdout);
+ return res ? 0 : 1;
+}
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index 83e44ff9a4..9863ff5e69 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -19,8 +19,6 @@ DEFINES += \
QT_NO_FOREACH \
QT_NO_CAST_FROM_ASCII
-DEFINES -= QT_EVAL
-
SOURCES += \
../../corelib/codecs/qlatincodec.cpp \
../../corelib/codecs/qtextcodec.cpp \
@@ -44,6 +42,7 @@ SOURCES += \
../../corelib/io/qfsfileengine.cpp \
../../corelib/io/qfsfileengine_iterator.cpp \
../../corelib/io/qiodevice.cpp \
+ ../../corelib/io/qipaddress.cpp \
../../corelib/io/qfiledevice.cpp \
../../corelib/io/qresource.cpp \
../../corelib/io/qtemporarydir.cpp \
@@ -52,11 +51,17 @@ SOURCES += \
../../corelib/io/qstandardpaths.cpp \
../../corelib/io/qloggingcategory.cpp \
../../corelib/io/qloggingregistry.cpp \
+ ../../corelib/io/qurl.cpp \
+ ../../corelib/io/qurlidna.cpp \
+ ../../corelib/io/qurlquery.cpp \
+ ../../corelib/io/qurlrecode.cpp \
../../corelib/kernel/qcoreapplication.cpp \
../../corelib/kernel/qcoreglobaldata.cpp \
../../corelib/kernel/qmetatype.cpp \
../../corelib/kernel/qvariant.cpp \
../../corelib/kernel/qsystemerror.cpp \
+ ../../corelib/kernel/qsharedmemory.cpp \
+ ../../corelib/kernel/qsystemsemaphore.cpp \
../../corelib/plugin/quuid.cpp \
../../corelib/serialization/qdatastream.cpp \
../../corelib/serialization/qjson.cpp \
@@ -69,36 +74,46 @@ SOURCES += \
../../corelib/serialization/qtextstream.cpp \
../../corelib/serialization/qxmlutils.cpp \
../../corelib/serialization/qxmlstream.cpp \
- ../../corelib/tools/qbitarray.cpp \
- ../../corelib/tools/qbytearray.cpp \
+ ../../corelib/text/qbytearray.cpp \
+ ../../corelib/text/qbytearraylist.cpp \
+ ../../corelib/text/qbytearraymatcher.cpp \
+ ../../corelib/text/qlocale.cpp \
+ ../../corelib/text/qlocale_tools.cpp \
+ ../../corelib/text/qregexp.cpp \
+ ../../corelib/text/qstring.cpp \
+ ../../corelib/text/qstringbuilder.cpp \
+ ../../corelib/text/qstring_compat.cpp \
+ ../../corelib/text/qstringlist.cpp \
+ ../../corelib/text/qstringview.cpp \
+ ../../corelib/text/qvsnprintf.cpp \
+ ../../corelib/time/qcalendar.cpp \
+ ../../corelib/time/qdatetime.cpp \
+ ../../corelib/time/qgregoriancalendar.cpp \
+ ../../corelib/time/qromancalendar.cpp \
../../corelib/tools/qarraydata.cpp \
- ../../corelib/tools/qbytearraymatcher.cpp \
+ ../../corelib/tools/qbitarray.cpp \
../../corelib/tools/qcommandlineparser.cpp \
../../corelib/tools/qcommandlineoption.cpp \
../../corelib/tools/qcryptographichash.cpp \
- ../../corelib/tools/qdatetime.cpp \
../../corelib/tools/qhash.cpp \
../../corelib/tools/qlist.cpp \
- ../../corelib/tools/qlinkedlist.cpp \
- ../../corelib/tools/qlocale.cpp \
- ../../corelib/tools/qlocale_tools.cpp \
../../corelib/tools/qmap.cpp \
- ../../corelib/tools/qregexp.cpp \
../../corelib/tools/qringbuffer.cpp \
../../corelib/tools/qpoint.cpp \
../../corelib/tools/qrect.cpp \
../../corelib/tools/qsize.cpp \
../../corelib/tools/qline.cpp \
- ../../corelib/tools/qstring.cpp \
- ../../corelib/tools/qstringbuilder.cpp \
- ../../corelib/tools/qstring_compat.cpp \
- ../../corelib/tools/qstringlist.cpp \
../../corelib/tools/qversionnumber.cpp \
- ../../corelib/tools/qvsnprintf.cpp \
../../xml/dom/qdom.cpp \
../../xml/sax/qxml.cpp
unix:SOURCES += ../../corelib/kernel/qcore_unix.cpp \
+ ../../corelib/kernel/qsharedmemory_posix.cpp \
+ ../../corelib/kernel/qsharedmemory_systemv.cpp \
+ ../../corelib/kernel/qsharedmemory_unix.cpp \
+ ../../corelib/kernel/qsystemsemaphore_posix.cpp \
+ ../../corelib/kernel/qsystemsemaphore_systemv.cpp \
+ ../../corelib/kernel/qsystemsemaphore_unix.cpp \
../../corelib/io/qfilesystemengine_unix.cpp \
../../corelib/io/qfilesystemiterator_unix.cpp \
../../corelib/io/qfsfileengine_unix.cpp
@@ -108,12 +123,16 @@ win32:SOURCES += ../../corelib/global/qoperatingsystemversion_win.cpp \
../../corelib/io/qfilesystemiterator_win.cpp \
../../corelib/io/qfsfileengine_win.cpp \
../../corelib/kernel/qcoreapplication_win.cpp \
+ ../../corelib/kernel/qsharedmemory_win.cpp \
+ ../../corelib/kernel/qsystemsemaphore_win.cpp \
../../corelib/plugin/qsystemlibrary.cpp \
+ ../../corelib/kernel/qwinregistry.cpp \
mac {
SOURCES += \
../../corelib/kernel/qcoreapplication_mac.cpp \
../../corelib/kernel/qcore_mac.cpp
+
OBJECTIVE_SOURCES += \
../../corelib/global/qoperatingsystemversion_darwin.mm \
../../corelib/kernel/qcore_mac_objc.mm \
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 0640e1b603..6a74e739e6 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -518,10 +518,15 @@ void Generator::generateCode()
}
}
+//
+// Generate meta object link to parent meta objects
+//
+
if (!extraList.isEmpty()) {
- fprintf(out, "static const QMetaObject * const qt_meta_extradata_%s[] = {\n ", qualifiedClassNameIdentifier.constData());
+ fprintf(out, "static const QMetaObject::SuperData qt_meta_extradata_%s[] = {\n",
+ qualifiedClassNameIdentifier.constData());
for (int i = 0; i < extraList.count(); ++i) {
- fprintf(out, " &%s::staticMetaObject,\n", extraList.at(i).constData());
+ fprintf(out, " QMetaObject::SuperData::link<%s::staticMetaObject>(),\n", extraList.at(i).constData());
}
fprintf(out, " nullptr\n};\n\n");
}
@@ -537,7 +542,7 @@ void Generator::generateCode()
if (isQObject)
fprintf(out, " nullptr,\n");
else if (cdef->superclassList.size() && (!cdef->hasQGadget || knownGadgets.contains(purestSuperClass)))
- fprintf(out, " &%s::staticMetaObject,\n", purestSuperClass.constData());
+ fprintf(out, " QMetaObject::SuperData::link<%s::staticMetaObject>(),\n", purestSuperClass.constData());
else
fprintf(out, " nullptr,\n");
fprintf(out, " qt_meta_stringdata_%s.data,\n"
@@ -1652,6 +1657,12 @@ void Generator::generatePluginMetaData()
jsonObjectToCbor(&map, o);
}
+ if (!cdef->pluginData.uri.isEmpty()) {
+ dev.nextItem("\"URI\"");
+ cbor_encode_int(&map, int(QtPluginMetaDataKeys::URI));
+ cbor_encode_text_string(&map, cdef->pluginData.uri.constData(), cdef->pluginData.uri.size());
+ }
+
// Add -M args from the command line:
for (auto it = cdef->pluginData.metaArgs.cbegin(), end = cdef->pluginData.metaArgs.cend(); it != end; ++it) {
const QJsonArray &a = it.value();
diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h
index 134166580b..eae0353199 100644
--- a/src/tools/moc/generator.h
+++ b/src/tools/moc/generator.h
@@ -39,7 +39,7 @@ class Generator
ClassDef *cdef;
QVector<uint> meta_data;
public:
- Generator(ClassDef *classDef, const QVector<QByteArray> &metaTypes, const QHash<QByteArray, QByteArray> &knownQObjectClasses, const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile = 0);
+ Generator(ClassDef *classDef, const QVector<QByteArray> &metaTypes, const QHash<QByteArray, QByteArray> &knownQObjectClasses, const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile = nullptr);
void generateCode();
private:
bool registerableMetaType(const QByteArray &propertyType);
diff --git a/src/tools/moc/keywords.cpp b/src/tools/moc/keywords.cpp
index 07c59d155f..7da8d94efc 100644
--- a/src/tools/moc/keywords.cpp
+++ b/src/tools/moc/keywords.cpp
@@ -30,12 +30,12 @@
// DO NOT EDIT.
static const short keyword_trans[][128] = {
- {0,0,0,0,0,0,0,0,0,561,558,0,0,0,0,0,
+ {0,0,0,0,0,0,0,0,0,568,565,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 561,252,559,562,8,38,239,560,25,26,236,234,30,235,27,237,
+ 568,252,566,569,8,38,239,567,25,26,236,234,30,235,27,237,
22,22,22,22,22,22,22,22,22,22,34,41,23,39,24,43,
0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,21,8,8,8,8,8,8,8,8,8,31,564,32,238,8,
+ 8,21,8,8,8,8,8,8,8,8,8,31,571,32,238,8,
0,1,2,3,4,5,6,7,8,9,8,8,10,11,12,13,
14,8,15,16,17,18,19,20,8,8,8,36,245,37,248,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -116,7 +116,7 @@ static const short keyword_trans[][128] = {
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,290,222,0,0,490,0,0,0,
+ 0,0,0,0,0,0,0,0,290,222,0,0,497,0,0,0,
0,0,0,0,55,0,0,330,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,
@@ -155,7 +155,7 @@ static const short keyword_trans[][128] = {
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,514,0,0,0,0,0,0,0,0,0,0,357,
+ 0,0,0,0,521,0,0,0,0,0,0,0,0,0,0,357,
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,
@@ -177,7 +177,7 @@ static const short keyword_trans[][128] = {
{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,42,0,0,0,28,0,
- 567,567,567,567,567,567,567,567,567,567,0,0,0,0,0,0,
+ 574,574,574,574,574,574,574,574,574,574,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,
@@ -336,7 +336,7 @@ static const short keyword_trans[][128] = {
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,566,0,0,0,0,565,
+ 0,0,0,0,0,0,0,0,0,0,573,0,0,0,0,572,
0,0,0,0,0,0,0,0,0,0,0,0,0,258,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,
@@ -372,29 +372,29 @@ static const short keyword_trans[][128] = {
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,487,0,0,0,300,0,0,0,0,0,0,0,0,0,0,
+ 0,494,0,0,0,300,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,0,0,0,0,0,
- 0,0,0,468,417,401,409,373,0,477,0,0,0,0,364,358,
- 379,0,550,465,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,475,424,408,416,380,0,484,0,0,0,0,364,358,
+ 386,0,557,472,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,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,387,0,0,0,
- 0,0,380,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,394,0,0,0,
+ 0,0,387,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,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,504,0,0,0,0,0,381,
+ 0,0,0,0,0,0,0,0,0,511,0,0,0,0,0,388,
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},
@@ -403,7 +403,7 @@ static const short keyword_trans[][128] = {
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,405,0,0,0,0,0,0,0,0,0,0,0,406,
+ 0,0,0,412,0,0,0,0,0,0,0,0,0,0,0,413,
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,
@@ -411,14 +411,14 @@ static const short keyword_trans[][128] = {
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,413,0,0,0,0,0,0,0,0,0,0,0,414,
+ 0,0,0,420,0,0,0,0,0,0,0,0,0,0,0,421,
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,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,447,425,0,0,430,0,0,0,439,0,0,
+ 0,0,0,0,0,454,432,0,0,437,0,0,0,446,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},
@@ -426,7 +426,7 @@ static const short keyword_trans[][128] = {
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,533,0,466,0,0,0,494,0,0,500,0,0,0,
+ 0,0,0,540,0,473,0,0,0,501,0,0,507,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},
@@ -435,7 +435,7 @@ static const short keyword_trans[][128] = {
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,479,0,526,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,486,0,533,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,
@@ -443,7 +443,7 @@ static const short keyword_trans[][128] = {
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,
- 542,0,0,510,0,0,0,0,0,0,0,0,0,0,0,0,
+ 549,0,0,517,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}
};
@@ -828,197 +828,204 @@ static const struct
{CHARACTER, 0, 65, 370, CHARACTER},
{CHARACTER, 0, 67, 371, CHARACTER},
{CHARACTER, 0, 69, 372, CHARACTER},
- {Q_NAMESPACE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 65, 374, CHARACTER},
- {CHARACTER, 0, 68, 375, CHARACTER},
- {CHARACTER, 0, 71, 376, CHARACTER},
- {CHARACTER, 0, 69, 377, CHARACTER},
- {CHARACTER, 0, 84, 378, CHARACTER},
+ {Q_NAMESPACE_TOKEN, 0, 95, 373, CHARACTER},
+ {CHARACTER, 0, 69, 374, CHARACTER},
+ {CHARACTER, 0, 88, 375, CHARACTER},
+ {CHARACTER, 0, 80, 376, CHARACTER},
+ {CHARACTER, 0, 79, 377, CHARACTER},
+ {CHARACTER, 0, 82, 378, CHARACTER},
+ {CHARACTER, 0, 84, 379, CHARACTER},
+ {Q_NAMESPACE_EXPORT_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 65, 381, CHARACTER},
+ {CHARACTER, 0, 68, 382, CHARACTER},
+ {CHARACTER, 0, 71, 383, CHARACTER},
+ {CHARACTER, 0, 69, 384, CHARACTER},
+ {CHARACTER, 0, 84, 385, CHARACTER},
{Q_GADGET_TOKEN, 0, 0, 0, CHARACTER},
{CHARACTER, 44, 0, 0, CHARACTER},
{CHARACTER, 45, 0, 0, CHARACTER},
- {CHARACTER, 0, 80, 382, CHARACTER},
- {CHARACTER, 0, 69, 383, CHARACTER},
- {CHARACTER, 0, 82, 384, CHARACTER},
- {CHARACTER, 0, 84, 385, CHARACTER},
- {CHARACTER, 0, 89, 386, CHARACTER},
+ {CHARACTER, 0, 80, 389, CHARACTER},
+ {CHARACTER, 0, 69, 390, CHARACTER},
+ {CHARACTER, 0, 82, 391, CHARACTER},
+ {CHARACTER, 0, 84, 392, CHARACTER},
+ {CHARACTER, 0, 89, 393, CHARACTER},
{Q_PROPERTY_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 85, 388, CHARACTER},
- {CHARACTER, 0, 71, 389, CHARACTER},
- {CHARACTER, 0, 73, 390, CHARACTER},
- {CHARACTER, 0, 78, 391, CHARACTER},
- {CHARACTER, 0, 95, 392, CHARACTER},
- {CHARACTER, 0, 77, 393, CHARACTER},
- {CHARACTER, 0, 69, 394, CHARACTER},
- {CHARACTER, 0, 84, 395, CHARACTER},
- {CHARACTER, 0, 65, 396, CHARACTER},
- {CHARACTER, 0, 68, 397, CHARACTER},
- {CHARACTER, 0, 65, 398, CHARACTER},
- {CHARACTER, 0, 84, 399, CHARACTER},
- {CHARACTER, 0, 65, 400, CHARACTER},
+ {CHARACTER, 0, 85, 395, CHARACTER},
+ {CHARACTER, 0, 71, 396, CHARACTER},
+ {CHARACTER, 0, 73, 397, CHARACTER},
+ {CHARACTER, 0, 78, 398, CHARACTER},
+ {CHARACTER, 0, 95, 399, CHARACTER},
+ {CHARACTER, 0, 77, 400, CHARACTER},
+ {CHARACTER, 0, 69, 401, CHARACTER},
+ {CHARACTER, 0, 84, 402, CHARACTER},
+ {CHARACTER, 0, 65, 403, CHARACTER},
+ {CHARACTER, 0, 68, 404, CHARACTER},
+ {CHARACTER, 0, 65, 405, CHARACTER},
+ {CHARACTER, 0, 84, 406, CHARACTER},
+ {CHARACTER, 0, 65, 407, CHARACTER},
{Q_PLUGIN_METADATA_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 402, CHARACTER},
- {CHARACTER, 0, 85, 403, CHARACTER},
- {CHARACTER, 0, 77, 404, CHARACTER},
+ {CHARACTER, 0, 78, 409, CHARACTER},
+ {CHARACTER, 0, 85, 410, CHARACTER},
+ {CHARACTER, 0, 77, 411, CHARACTER},
{Q_ENUM_TOKEN, 46, 0, 0, CHARACTER},
{Q_ENUMS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 407, CHARACTER},
- {CHARACTER, 0, 83, 408, CHARACTER},
+ {CHARACTER, 0, 78, 414, CHARACTER},
+ {CHARACTER, 0, 83, 415, CHARACTER},
{Q_ENUM_NS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 76, 410, CHARACTER},
- {CHARACTER, 0, 65, 411, CHARACTER},
- {CHARACTER, 0, 71, 412, CHARACTER},
+ {CHARACTER, 0, 76, 417, CHARACTER},
+ {CHARACTER, 0, 65, 418, CHARACTER},
+ {CHARACTER, 0, 71, 419, CHARACTER},
{Q_FLAG_TOKEN, 47, 0, 0, CHARACTER},
{Q_FLAGS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 415, CHARACTER},
- {CHARACTER, 0, 83, 416, CHARACTER},
+ {CHARACTER, 0, 78, 422, CHARACTER},
+ {CHARACTER, 0, 83, 423, CHARACTER},
{Q_FLAG_NS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 418, CHARACTER},
- {CHARACTER, 0, 67, 419, CHARACTER},
- {CHARACTER, 0, 76, 420, CHARACTER},
- {CHARACTER, 0, 65, 421, CHARACTER},
- {CHARACTER, 0, 82, 422, CHARACTER},
- {CHARACTER, 0, 69, 423, CHARACTER},
- {CHARACTER, 0, 95, 424, CHARACTER},
+ {CHARACTER, 0, 69, 425, CHARACTER},
+ {CHARACTER, 0, 67, 426, CHARACTER},
+ {CHARACTER, 0, 76, 427, CHARACTER},
+ {CHARACTER, 0, 65, 428, CHARACTER},
+ {CHARACTER, 0, 82, 429, CHARACTER},
+ {CHARACTER, 0, 69, 430, CHARACTER},
+ {CHARACTER, 0, 95, 431, CHARACTER},
{CHARACTER, 48, 0, 0, CHARACTER},
- {CHARACTER, 0, 76, 426, CHARACTER},
- {CHARACTER, 0, 65, 427, CHARACTER},
- {CHARACTER, 0, 71, 428, CHARACTER},
- {CHARACTER, 0, 83, 429, CHARACTER},
+ {CHARACTER, 0, 76, 433, CHARACTER},
+ {CHARACTER, 0, 65, 434, CHARACTER},
+ {CHARACTER, 0, 71, 435, CHARACTER},
+ {CHARACTER, 0, 83, 436, CHARACTER},
{Q_DECLARE_FLAGS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 431, CHARACTER},
- {CHARACTER, 0, 84, 432, CHARACTER},
- {CHARACTER, 0, 69, 433, CHARACTER},
- {CHARACTER, 0, 82, 434, CHARACTER},
- {CHARACTER, 0, 70, 435, CHARACTER},
- {CHARACTER, 0, 65, 436, CHARACTER},
- {CHARACTER, 0, 67, 437, CHARACTER},
- {CHARACTER, 0, 69, 438, CHARACTER},
- {Q_DECLARE_INTERFACE_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 78, 438, CHARACTER},
+ {CHARACTER, 0, 84, 439, CHARACTER},
{CHARACTER, 0, 69, 440, CHARACTER},
- {CHARACTER, 0, 84, 441, CHARACTER},
- {CHARACTER, 0, 65, 442, CHARACTER},
- {CHARACTER, 0, 84, 443, CHARACTER},
- {CHARACTER, 0, 89, 444, CHARACTER},
- {CHARACTER, 0, 80, 445, CHARACTER},
- {CHARACTER, 0, 69, 446, CHARACTER},
+ {CHARACTER, 0, 82, 441, CHARACTER},
+ {CHARACTER, 0, 70, 442, CHARACTER},
+ {CHARACTER, 0, 65, 443, CHARACTER},
+ {CHARACTER, 0, 67, 444, CHARACTER},
+ {CHARACTER, 0, 69, 445, CHARACTER},
+ {Q_DECLARE_INTERFACE_TOKEN, 0, 0, 0, CHARACTER},
+ {CHARACTER, 0, 69, 447, CHARACTER},
+ {CHARACTER, 0, 84, 448, CHARACTER},
+ {CHARACTER, 0, 65, 449, CHARACTER},
+ {CHARACTER, 0, 84, 450, CHARACTER},
+ {CHARACTER, 0, 89, 451, CHARACTER},
+ {CHARACTER, 0, 80, 452, CHARACTER},
+ {CHARACTER, 0, 69, 453, CHARACTER},
{Q_DECLARE_METATYPE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 88, 448, CHARACTER},
- {CHARACTER, 0, 84, 449, CHARACTER},
- {CHARACTER, 0, 69, 450, CHARACTER},
- {CHARACTER, 0, 78, 451, CHARACTER},
- {CHARACTER, 0, 83, 452, CHARACTER},
- {CHARACTER, 0, 73, 453, CHARACTER},
- {CHARACTER, 0, 79, 454, CHARACTER},
- {CHARACTER, 0, 78, 455, CHARACTER},
- {CHARACTER, 0, 95, 456, CHARACTER},
- {CHARACTER, 0, 73, 457, CHARACTER},
+ {CHARACTER, 0, 88, 455, CHARACTER},
+ {CHARACTER, 0, 84, 456, CHARACTER},
+ {CHARACTER, 0, 69, 457, CHARACTER},
{CHARACTER, 0, 78, 458, CHARACTER},
- {CHARACTER, 0, 84, 459, CHARACTER},
- {CHARACTER, 0, 69, 460, CHARACTER},
- {CHARACTER, 0, 82, 461, CHARACTER},
- {CHARACTER, 0, 70, 462, CHARACTER},
- {CHARACTER, 0, 65, 463, CHARACTER},
- {CHARACTER, 0, 67, 464, CHARACTER},
- {CHARACTER, 0, 69, 438, CHARACTER},
- {CHARACTER, 49, 0, 0, CHARACTER},
- {CHARACTER, 0, 84, 467, CHARACTER},
- {CHARACTER, 0, 83, 413, CHARACTER},
- {CHARACTER, 0, 76, 469, CHARACTER},
+ {CHARACTER, 0, 83, 459, CHARACTER},
+ {CHARACTER, 0, 73, 460, CHARACTER},
+ {CHARACTER, 0, 79, 461, CHARACTER},
+ {CHARACTER, 0, 78, 462, CHARACTER},
+ {CHARACTER, 0, 95, 463, CHARACTER},
+ {CHARACTER, 0, 73, 464, CHARACTER},
+ {CHARACTER, 0, 78, 465, CHARACTER},
+ {CHARACTER, 0, 84, 466, CHARACTER},
+ {CHARACTER, 0, 69, 467, CHARACTER},
+ {CHARACTER, 0, 82, 468, CHARACTER},
+ {CHARACTER, 0, 70, 469, CHARACTER},
{CHARACTER, 0, 65, 470, CHARACTER},
- {CHARACTER, 0, 83, 471, CHARACTER},
- {CHARACTER, 0, 83, 472, CHARACTER},
- {CHARACTER, 0, 73, 473, CHARACTER},
- {CHARACTER, 0, 78, 474, CHARACTER},
- {CHARACTER, 0, 70, 475, CHARACTER},
- {CHARACTER, 0, 79, 476, CHARACTER},
+ {CHARACTER, 0, 67, 471, CHARACTER},
+ {CHARACTER, 0, 69, 445, CHARACTER},
+ {CHARACTER, 49, 0, 0, CHARACTER},
+ {CHARACTER, 0, 84, 474, CHARACTER},
+ {CHARACTER, 0, 83, 420, CHARACTER},
+ {CHARACTER, 0, 76, 476, CHARACTER},
+ {CHARACTER, 0, 65, 477, CHARACTER},
+ {CHARACTER, 0, 83, 478, CHARACTER},
+ {CHARACTER, 0, 83, 479, CHARACTER},
+ {CHARACTER, 0, 73, 480, CHARACTER},
+ {CHARACTER, 0, 78, 481, CHARACTER},
+ {CHARACTER, 0, 70, 482, CHARACTER},
+ {CHARACTER, 0, 79, 483, CHARACTER},
{Q_CLASSINFO_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 78, 478, CHARACTER},
+ {CHARACTER, 0, 78, 485, CHARACTER},
{CHARACTER, 50, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 480, CHARACTER},
- {CHARACTER, 0, 82, 481, CHARACTER},
- {CHARACTER, 0, 70, 482, CHARACTER},
- {CHARACTER, 0, 65, 483, CHARACTER},
- {CHARACTER, 0, 67, 484, CHARACTER},
- {CHARACTER, 0, 69, 485, CHARACTER},
- {CHARACTER, 0, 83, 486, CHARACTER},
+ {CHARACTER, 0, 69, 487, CHARACTER},
+ {CHARACTER, 0, 82, 488, CHARACTER},
+ {CHARACTER, 0, 70, 489, CHARACTER},
+ {CHARACTER, 0, 65, 490, CHARACTER},
+ {CHARACTER, 0, 67, 491, CHARACTER},
+ {CHARACTER, 0, 69, 492, CHARACTER},
+ {CHARACTER, 0, 83, 493, CHARACTER},
{Q_INTERFACES_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 108, 488, CHARACTER},
- {CHARACTER, 0, 115, 489, CHARACTER},
+ {CHARACTER, 0, 108, 495, CHARACTER},
+ {CHARACTER, 0, 115, 496, CHARACTER},
{SIGNALS, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 111, 491, CHARACTER},
- {CHARACTER, 0, 116, 492, CHARACTER},
- {CHARACTER, 0, 115, 493, CHARACTER},
+ {CHARACTER, 0, 111, 498, CHARACTER},
+ {CHARACTER, 0, 116, 499, CHARACTER},
+ {CHARACTER, 0, 115, 500, CHARACTER},
{SLOTS, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 71, 495, CHARACTER},
- {CHARACTER, 0, 78, 496, CHARACTER},
- {CHARACTER, 0, 65, 497, CHARACTER},
- {CHARACTER, 0, 76, 498, CHARACTER},
- {Q_SIGNAL_TOKEN, 0, 83, 499, CHARACTER},
+ {CHARACTER, 0, 71, 502, CHARACTER},
+ {CHARACTER, 0, 78, 503, CHARACTER},
+ {CHARACTER, 0, 65, 504, CHARACTER},
+ {CHARACTER, 0, 76, 505, CHARACTER},
+ {Q_SIGNAL_TOKEN, 0, 83, 506, CHARACTER},
{Q_SIGNALS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 79, 501, CHARACTER},
- {CHARACTER, 0, 84, 502, CHARACTER},
- {Q_SLOT_TOKEN, 0, 83, 503, CHARACTER},
+ {CHARACTER, 0, 79, 508, CHARACTER},
+ {CHARACTER, 0, 84, 509, CHARACTER},
+ {Q_SLOT_TOKEN, 0, 83, 510, CHARACTER},
{Q_SLOTS_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 86, 505, CHARACTER},
- {CHARACTER, 0, 65, 506, CHARACTER},
- {CHARACTER, 0, 84, 507, CHARACTER},
- {CHARACTER, 0, 69, 508, CHARACTER},
- {CHARACTER, 0, 95, 509, CHARACTER},
+ {CHARACTER, 0, 86, 512, CHARACTER},
+ {CHARACTER, 0, 65, 513, CHARACTER},
+ {CHARACTER, 0, 84, 514, CHARACTER},
+ {CHARACTER, 0, 69, 515, CHARACTER},
+ {CHARACTER, 0, 95, 516, CHARACTER},
{CHARACTER, 51, 0, 0, CHARACTER},
- {CHARACTER, 0, 76, 511, CHARACTER},
- {CHARACTER, 0, 79, 512, CHARACTER},
- {CHARACTER, 0, 84, 513, CHARACTER},
+ {CHARACTER, 0, 76, 518, CHARACTER},
+ {CHARACTER, 0, 79, 519, CHARACTER},
+ {CHARACTER, 0, 84, 520, CHARACTER},
{Q_PRIVATE_SLOT_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 95, 515, CHARACTER},
- {CHARACTER, 0, 77, 516, CHARACTER},
- {CHARACTER, 0, 79, 517, CHARACTER},
- {CHARACTER, 0, 67, 518, CHARACTER},
- {CHARACTER, 0, 95, 519, CHARACTER},
- {CHARACTER, 0, 67, 520, CHARACTER},
- {CHARACTER, 0, 79, 521, CHARACTER},
- {CHARACTER, 0, 77, 522, CHARACTER},
- {CHARACTER, 0, 80, 523, CHARACTER},
- {CHARACTER, 0, 65, 524, CHARACTER},
- {CHARACTER, 0, 84, 525, CHARACTER},
+ {CHARACTER, 0, 95, 522, CHARACTER},
+ {CHARACTER, 0, 77, 523, CHARACTER},
+ {CHARACTER, 0, 79, 524, CHARACTER},
+ {CHARACTER, 0, 67, 525, CHARACTER},
+ {CHARACTER, 0, 95, 526, CHARACTER},
+ {CHARACTER, 0, 67, 527, CHARACTER},
+ {CHARACTER, 0, 79, 528, CHARACTER},
+ {CHARACTER, 0, 77, 529, CHARACTER},
+ {CHARACTER, 0, 80, 530, CHARACTER},
+ {CHARACTER, 0, 65, 531, CHARACTER},
+ {CHARACTER, 0, 84, 532, CHARACTER},
{Q_MOC_COMPAT_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 79, 527, CHARACTER},
- {CHARACTER, 0, 75, 528, CHARACTER},
- {CHARACTER, 0, 65, 529, CHARACTER},
- {CHARACTER, 0, 66, 530, CHARACTER},
- {CHARACTER, 0, 76, 531, CHARACTER},
- {CHARACTER, 0, 69, 532, CHARACTER},
+ {CHARACTER, 0, 79, 534, CHARACTER},
+ {CHARACTER, 0, 75, 535, CHARACTER},
+ {CHARACTER, 0, 65, 536, CHARACTER},
+ {CHARACTER, 0, 66, 537, CHARACTER},
+ {CHARACTER, 0, 76, 538, CHARACTER},
+ {CHARACTER, 0, 69, 539, CHARACTER},
{Q_INVOKABLE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 82, 534, CHARACTER},
- {CHARACTER, 0, 73, 535, CHARACTER},
- {CHARACTER, 0, 80, 536, CHARACTER},
- {CHARACTER, 0, 84, 537, CHARACTER},
- {CHARACTER, 0, 65, 538, CHARACTER},
- {CHARACTER, 0, 66, 539, CHARACTER},
- {CHARACTER, 0, 76, 540, CHARACTER},
- {CHARACTER, 0, 69, 541, CHARACTER},
+ {CHARACTER, 0, 82, 541, CHARACTER},
+ {CHARACTER, 0, 73, 542, CHARACTER},
+ {CHARACTER, 0, 80, 543, CHARACTER},
+ {CHARACTER, 0, 84, 544, CHARACTER},
+ {CHARACTER, 0, 65, 545, CHARACTER},
+ {CHARACTER, 0, 66, 546, CHARACTER},
+ {CHARACTER, 0, 76, 547, CHARACTER},
+ {CHARACTER, 0, 69, 548, CHARACTER},
{Q_SCRIPTABLE_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 82, 543, CHARACTER},
- {CHARACTER, 0, 79, 544, CHARACTER},
- {CHARACTER, 0, 80, 545, CHARACTER},
- {CHARACTER, 0, 69, 546, CHARACTER},
- {CHARACTER, 0, 82, 547, CHARACTER},
- {CHARACTER, 0, 84, 548, CHARACTER},
- {CHARACTER, 0, 89, 549, CHARACTER},
+ {CHARACTER, 0, 82, 550, CHARACTER},
+ {CHARACTER, 0, 79, 551, CHARACTER},
+ {CHARACTER, 0, 80, 552, CHARACTER},
+ {CHARACTER, 0, 69, 553, CHARACTER},
+ {CHARACTER, 0, 82, 554, CHARACTER},
+ {CHARACTER, 0, 84, 555, CHARACTER},
+ {CHARACTER, 0, 89, 556, CHARACTER},
{Q_PRIVATE_PROPERTY_TOKEN, 0, 0, 0, CHARACTER},
- {CHARACTER, 0, 69, 551, CHARACTER},
- {CHARACTER, 0, 86, 552, CHARACTER},
- {CHARACTER, 0, 73, 553, CHARACTER},
- {CHARACTER, 0, 83, 554, CHARACTER},
- {CHARACTER, 0, 73, 555, CHARACTER},
- {CHARACTER, 0, 79, 556, CHARACTER},
- {CHARACTER, 0, 78, 557, CHARACTER},
+ {CHARACTER, 0, 69, 558, CHARACTER},
+ {CHARACTER, 0, 86, 559, CHARACTER},
+ {CHARACTER, 0, 73, 560, CHARACTER},
+ {CHARACTER, 0, 83, 561, CHARACTER},
+ {CHARACTER, 0, 73, 562, CHARACTER},
+ {CHARACTER, 0, 79, 563, CHARACTER},
+ {CHARACTER, 0, 78, 564, CHARACTER},
{Q_REVISION_TOKEN, 0, 0, 0, CHARACTER},
{NEWLINE, 0, 0, 0, NOTOKEN},
{QUOTE, 0, 0, 0, NOTOKEN},
{SINGLEQUOTE, 0, 0, 0, NOTOKEN},
{WHITESPACE, 0, 0, 0, NOTOKEN},
- {HASH, 0, 35, 563, HASH},
+ {HASH, 0, 35, 570, HASH},
{PP_HASHHASH, 0, 0, 0, NOTOKEN},
{BACKSLASH, 0, 0, 0, NOTOKEN},
{CPP_COMMENT, 0, 0, 0, NOTOKEN},
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 5d777ece2e..50946443be 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -159,6 +159,7 @@ Type Moc::parseType()
bool isVoid = false;
type.firstToken = lookup();
for (;;) {
+ skipCxxAttributes();
switch (next()) {
case SIGNED:
case UNSIGNED:
@@ -188,8 +189,11 @@ Type Moc::parseType()
}
break;
}
+
+ skipCxxAttributes();
test(ENUM) || test(CLASS) || test(STRUCT);
for(;;) {
+ skipCxxAttributes();
switch (next()) {
case IDENTIFIER:
// void mySlot(unsigned myArg)
@@ -281,6 +285,7 @@ bool Moc::parseEnum(EnumDef *def)
break;
next(IDENTIFIER);
def->values += lexem();
+ skipCxxAttributes();
} while (test(EQ) ? until(COMMA) : test(COMMA));
next(RBRACE);
if (isTypdefEnum) {
@@ -356,6 +361,15 @@ bool Moc::testFunctionAttribute(Token tok, FunctionDef *def)
return false;
}
+bool Moc::skipCxxAttributes()
+{
+ auto rewind = index;
+ if (test(LBRACK) && test(LBRACK) && until(RBRACK) && test(RBRACK))
+ return true;
+ index = rewind;
+ return false;
+}
+
bool Moc::testFunctionRevision(FunctionDef *def)
{
if (test(Q_REVISION_TOKEN)) {
@@ -381,7 +395,7 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro)
//skip modifiers and attributes
while (test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) ||
(test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual
- || testFunctionAttribute(def) || testFunctionRevision(def)) {}
+ || skipCxxAttributes() || testFunctionAttribute(def) || testFunctionRevision(def)) {}
bool templateFunction = (lookup() == TEMPLATE);
def->type = parseType();
if (def->type.name.isEmpty()) {
@@ -454,10 +468,11 @@ bool Moc::parseFunction(FunctionDef *def, bool inMacro)
until(RBRACE);
else if ((def->isAbstract = test(EQ)))
until(SEMIC);
+ else if (skipCxxAttributes())
+ until(SEMIC);
else
error();
}
-
if (scopedFunctionName) {
const QByteArray msg = "Function declaration " + def->name
+ " contains extra qualification. Ignoring as signal or slot.";
@@ -475,7 +490,7 @@ bool Moc::parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
//skip modifiers and attributes
while (test(EXPLICIT) || test(INLINE) || (test(STATIC) && (def->isStatic = true) == true) ||
(test(VIRTUAL) && (def->isVirtual = true) == true) //mark as virtual
- || testFunctionAttribute(def) || testFunctionRevision(def)) {}
+ || skipCxxAttributes() || testFunctionAttribute(def) || testFunctionRevision(def)) {}
bool tilde = test(TILDE);
def->type = parseType();
if (def->type.name.isEmpty())
@@ -565,6 +580,7 @@ void Moc::parse()
} else if (!test(SEMIC)) {
NamespaceDef def;
def.classname = nsName;
+ def.doGenerate = currentFilenames.size() <= 1;
next(LBRACE);
def.begin = index - 1;
@@ -572,25 +588,22 @@ void Moc::parse()
def.end = index;
index = def.begin + 1;
- const bool parseNamespace = currentFilenames.size() <= 1;
- if (parseNamespace) {
- for (int i = namespaceList.size() - 1; i >= 0; --i) {
- if (inNamespace(&namespaceList.at(i))) {
- def.qualified.prepend(namespaceList.at(i).classname + "::");
- }
- }
- for (const QByteArray &ns : nested) {
- NamespaceDef parentNs;
- parentNs.classname = ns;
- parentNs.qualified = def.qualified;
- def.qualified += ns + "::";
- parentNs.begin = def.begin;
- parentNs.end = def.end;
- namespaceList += parentNs;
+ for (int i = namespaceList.size() - 1; i >= 0; --i) {
+ if (inNamespace(&namespaceList.at(i))) {
+ def.qualified.prepend(namespaceList.at(i).classname + "::");
}
}
+ for (const QByteArray &ns : nested) {
+ NamespaceDef parentNs;
+ parentNs.classname = ns;
+ parentNs.qualified = def.qualified;
+ def.qualified += ns + "::";
+ parentNs.begin = def.begin;
+ parentNs.end = def.end;
+ namespaceList += parentNs;
+ }
- while (parseNamespace && inNamespace(&def) && hasNext()) {
+ while (inNamespace(&def) && hasNext()) {
switch (next()) {
case NAMESPACE:
if (test(IDENTIFIER)) {
@@ -607,6 +620,13 @@ void Moc::parse()
case Q_NAMESPACE_TOKEN:
def.hasQNamespace = true;
break;
+ case Q_NAMESPACE_EXPORT_TOKEN:
+ next(LPAREN);
+ while (test(IDENTIFIER))
+ {}
+ next(RPAREN);
+ def.hasQNamespace = true;
+ break;
case Q_ENUMS_TOKEN:
case Q_ENUM_NS_TOKEN:
parseEnumOrFlag(&def, false);
@@ -915,7 +935,8 @@ void Moc::parse()
} else {
knownGadgets.insert(def.classname, def.qualified);
knownGadgets.insert(def.qualified, def.qualified);
- classList += def;
+ if (n.doGenerate)
+ classList += def;
}
}
}
@@ -1180,6 +1201,15 @@ void Moc::createPropertyDef(PropertyDef &propDef)
propDef.type = type;
+ auto checkIsFunction = [&](const QByteArray &def, const char *name) {
+ if (def.endsWith(')')) {
+ QByteArray msg = "Providing a function for ";
+ msg += name;
+ msg += " in a property declaration is deprecated and will not be supported in Qt 6 anymore.";
+ warning(msg.constData());
+ }
+ };
+
next();
propDef.name = lexem();
while (test(IDENTIFIER)) {
@@ -1229,11 +1259,13 @@ void Moc::createPropertyDef(PropertyDef &propDef)
error(2);
break;
case 'S':
- if (l == "SCRIPTABLE")
+ if (l == "SCRIPTABLE") {
propDef.scriptable = v + v2;
- else if (l == "STORED")
+ checkIsFunction(propDef.scriptable, "SCRIPTABLE");
+ } else if (l == "STORED") {
propDef.stored = v + v2;
- else
+ checkIsFunction(propDef.stored, "STORED");
+ } else
error(2);
break;
case 'W': if (l != "WRITE") error(2);
@@ -1241,15 +1273,18 @@ void Moc::createPropertyDef(PropertyDef &propDef)
break;
case 'D': if (l != "DESIGNABLE") error(2);
propDef.designable = v + v2;
+ checkIsFunction(propDef.designable, "DESIGNABLE");
break;
case 'E': if (l != "EDITABLE") error(2);
propDef.editable = v + v2;
+ checkIsFunction(propDef.editable, "EDITABLE");
break;
case 'N': if (l != "NOTIFY") error(2);
propDef.notify = v;
break;
case 'U': if (l != "USER") error(2);
propDef.user = v + v2;
+ checkIsFunction(propDef.user, "USER");
break;
default:
error(2);
@@ -1297,6 +1332,9 @@ void Moc::parsePluginData(ClassDef *def)
if (l == "IID") {
next(STRING_LITERAL);
def->pluginData.iid = unquotedLexem();
+ } else if (l == "URI") {
+ next(STRING_LITERAL);
+ def->pluginData.uri = unquotedLexem();
} else if (l == "FILE") {
next(STRING_LITERAL);
QByteArray metaDataFile = unquotedLexem();
@@ -1337,6 +1375,7 @@ void Moc::parsePluginData(ClassDef *def)
+ " does not contain a valid JSON object. Declaration will be ignored";
warning(msg.constData());
def->pluginData.iid = QByteArray();
+ def->pluginData.uri = QByteArray();
return;
}
}
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index d6482f4e44..bb1c9501fe 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -167,6 +167,7 @@ struct ClassDef : BaseDef {
struct PluginData {
QByteArray iid;
+ QByteArray uri;
QMap<QString, QJsonArray> metaArgs;
QJsonDocument metaData;
} pluginData;
@@ -188,6 +189,7 @@ Q_DECLARE_TYPEINFO(ClassDef::Interface, Q_MOVABLE_TYPE);
struct NamespaceDef : BaseDef {
bool hasQNamespace = false;
+ bool doGenerate = false;
};
Q_DECLARE_TYPEINFO(NamespaceDef, Q_MOVABLE_TYPE);
@@ -256,6 +258,8 @@ public:
bool testFunctionAttribute(Token tok, FunctionDef *def);
bool testFunctionRevision(FunctionDef *def);
+ bool skipCxxAttributes();
+
void checkSuperClasses(ClassDef *def);
void checkProperties(ClassDef* cdef);
};
diff --git a/src/tools/moc/parser.h b/src/tools/moc/parser.h
index bedcbbf7e2..63f4cf0d9a 100644
--- a/src/tools/moc/parser.h
+++ b/src/tools/moc/parser.h
@@ -69,9 +69,9 @@ public:
inline const Symbol &symbol() { return symbols.at(index-1);}
Q_NORETURN void error(int rollback);
- Q_NORETURN void error(const char *msg = 0);
- void warning(const char * = 0);
- void note(const char * = 0);
+ Q_NORETURN void error(const char *msg = nullptr);
+ void warning(const char * = nullptr);
+ void note(const char * = nullptr);
};
diff --git a/src/tools/moc/token.h b/src/tools/moc/token.h
index db9d319b78..0cc163f9e4 100644
--- a/src/tools/moc/token.h
+++ b/src/tools/moc/token.h
@@ -155,6 +155,7 @@ QT_BEGIN_NAMESPACE
F(Q_OBJECT_TOKEN) \
F(Q_GADGET_TOKEN) \
F(Q_NAMESPACE_TOKEN) \
+ F(Q_NAMESPACE_EXPORT_TOKEN) \
F(Q_PROPERTY_TOKEN) \
F(Q_PLUGIN_METADATA_TOKEN) \
F(Q_ENUMS_TOKEN) \
diff --git a/src/tools/moc/util/generate_keywords.cpp b/src/tools/moc/util/generate_keywords.cpp
index df850c1bdc..9248e9e2e7 100644
--- a/src/tools/moc/util/generate_keywords.cpp
+++ b/src/tools/moc/util/generate_keywords.cpp
@@ -214,6 +214,7 @@ static const Keyword keywords[] = {
{ "return", "RETURN" },
{ "Q_OBJECT", "Q_OBJECT_TOKEN" },
{ "Q_NAMESPACE", "Q_NAMESPACE_TOKEN" },
+ { "Q_NAMESPACE_EXPORT", "Q_NAMESPACE_EXPORT_TOKEN" },
{ "Q_GADGET", "Q_GADGET_TOKEN" },
{ "Q_PROPERTY", "Q_PROPERTY_TOKEN" },
{ "Q_PLUGIN_METADATA", "Q_PLUGIN_METADATA_TOKEN" },
diff --git a/src/tools/moc/util/generate_keywords.pro b/src/tools/moc/util/generate_keywords.pro
index 2bbc3ced61..e29738c18a 100644
--- a/src/tools/moc/util/generate_keywords.pro
+++ b/src/tools/moc/util/generate_keywords.pro
@@ -1,4 +1,5 @@
CONFIG -= moc
CONFIG += cmdline
+QT = core
SOURCES += generate_keywords.cpp
diff --git a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
index 7c6f0bdeef..522c55593f 100644
--- a/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
+++ b/src/tools/qdbuscpp2xml/qdbuscpp2xml.cpp
@@ -32,7 +32,6 @@
#include <qfile.h>
#include <qlist.h>
#include <qbuffer.h>
-#include <qregexp.h>
#include <qvector.h>
#include <qdebug.h>
diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
index ea410cd257..ce4232f3e8 100644
--- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
+++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp
@@ -161,22 +161,22 @@ static QString moc(const QString &name)
static QTextStream &writeHeader(QTextStream &ts, bool changesWillBeLost)
{
- ts << "/*" << endl
- << " * This file was generated by " PROGRAMNAME " version " PROGRAMVERSION << endl
- << " * Command line was: " << commandLine << endl
- << " *" << endl
- << " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << endl
- << " *" << endl
- << " * This is an auto-generated file." << endl;
+ ts << "/*" << Qt::endl
+ << " * This file was generated by " PROGRAMNAME " version " PROGRAMVERSION << Qt::endl
+ << " * Command line was: " << commandLine << Qt::endl
+ << " *" << Qt::endl
+ << " * " PROGRAMNAME " is " PROGRAMCOPYRIGHT << Qt::endl
+ << " *" << Qt::endl
+ << " * This is an auto-generated file." << Qt::endl;
if (changesWillBeLost)
- ts << " * Do not edit! All changes made to it will be lost." << endl;
+ ts << " * Do not edit! All changes made to it will be lost." << Qt::endl;
else
- ts << " * This file may have been hand-edited. Look for HAND-EDIT comments" << endl
- << " * before re-generating it." << endl;
+ ts << " * This file may have been hand-edited. Look for HAND-EDIT comments" << Qt::endl
+ << " * before re-generating it." << Qt::endl;
- ts << " */" << endl
- << endl;
+ ts << " */" << Qt::endl
+ << Qt::endl;
return ts;
}
@@ -466,66 +466,66 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
}
includeGuard = QString(QLatin1String("%1"))
.arg(includeGuard);
- hs << "#ifndef " << includeGuard << endl
- << "#define " << includeGuard << endl
- << endl;
+ hs << "#ifndef " << includeGuard << Qt::endl
+ << "#define " << includeGuard << Qt::endl
+ << Qt::endl;
// include our stuff:
- hs << "#include <QtCore/QObject>" << endl
+ hs << "#include <QtCore/QObject>" << Qt::endl
<< includeList
- << "#include <QtDBus/QtDBus>" << endl;
+ << "#include <QtDBus/QtDBus>" << Qt::endl;
for (const QString &include : qAsConst(includes)) {
- hs << "#include \"" << include << "\"" << endl;
+ hs << "#include \"" << include << "\"" << Qt::endl;
if (headerName.isEmpty())
- cs << "#include \"" << include << "\"" << endl;
+ cs << "#include \"" << include << "\"" << Qt::endl;
}
- hs << endl;
+ hs << Qt::endl;
if (cppName != headerName) {
if (!headerName.isEmpty() && headerName != QLatin1String("-"))
- cs << "#include \"" << headerName << "\"" << endl << endl;
+ cs << "#include \"" << headerName << "\"" << Qt::endl << Qt::endl;
}
for (const QDBusIntrospection::Interface *interface : interfaces) {
QString className = classNameForInterface(interface->name, Proxy);
// comment:
- hs << "/*" << endl
- << " * Proxy class for interface " << interface->name << endl
- << " */" << endl;
- cs << "/*" << endl
- << " * Implementation of interface class " << className << endl
- << " */" << endl
- << endl;
+ hs << "/*" << Qt::endl
+ << " * Proxy class for interface " << interface->name << Qt::endl
+ << " */" << Qt::endl;
+ cs << "/*" << Qt::endl
+ << " * Implementation of interface class " << className << Qt::endl
+ << " */" << Qt::endl
+ << Qt::endl;
// class header:
- hs << "class " << className << ": public QDBusAbstractInterface" << endl
- << "{" << endl
- << " Q_OBJECT" << endl;
+ hs << "class " << className << ": public QDBusAbstractInterface" << Qt::endl
+ << "{" << Qt::endl
+ << " Q_OBJECT" << Qt::endl;
// the interface name
- hs << "public:" << endl
- << " static inline const char *staticInterfaceName()" << endl
- << " { return \"" << interface->name << "\"; }" << endl
- << endl;
+ hs << "public:" << Qt::endl
+ << " static inline const char *staticInterfaceName()" << Qt::endl
+ << " { return \"" << interface->name << "\"; }" << Qt::endl
+ << Qt::endl;
// constructors/destructors:
- hs << "public:" << endl
- << " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << endl
- << endl
- << " ~" << className << "();" << endl
- << endl;
- cs << className << "::" << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)" << endl
- << " : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)" << endl
- << "{" << endl
- << "}" << endl
- << endl
- << className << "::~" << className << "()" << endl
- << "{" << endl
- << "}" << endl
- << endl;
+ hs << "public:" << Qt::endl
+ << " " << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);" << Qt::endl
+ << Qt::endl
+ << " ~" << className << "();" << Qt::endl
+ << Qt::endl;
+ cs << className << "::" << className << "(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)" << Qt::endl
+ << " : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)" << Qt::endl
+ << "{" << Qt::endl
+ << "}" << Qt::endl
+ << Qt::endl
+ << className << "::~" << className << "()" << Qt::endl
+ << "{" << Qt::endl
+ << "}" << Qt::endl
+ << Qt::endl;
// properties:
for (const QDBusIntrospection::Property &property : interface->properties) {
@@ -545,27 +545,27 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
// it's writeable
hs << " WRITE " << setter;
- hs << ")" << endl;
+ hs << ")" << Qt::endl;
// getter:
if (property.access != QDBusIntrospection::Property::Write) {
- hs << " inline " << type << " " << getter << "() const" << endl
+ hs << " inline " << type << " " << getter << "() const" << Qt::endl
<< " { return qvariant_cast< " << type << " >(property(\""
- << property.name << "\")); }" << endl;
+ << property.name << "\")); }" << Qt::endl;
}
// setter:
if (property.access != QDBusIntrospection::Property::Read) {
- hs << " inline void " << setter << "(" << constRefArg(type) << "value)" << endl
+ hs << " inline void " << setter << "(" << constRefArg(type) << "value)" << Qt::endl
<< " { setProperty(\"" << property.name
- << "\", QVariant::fromValue(value)); }" << endl;
+ << "\", QVariant::fromValue(value)); }" << Qt::endl;
}
- hs << endl;
+ hs << Qt::endl;
}
// methods:
- hs << "public Q_SLOTS: // METHODS" << endl;
+ hs << "public Q_SLOTS: // METHODS" << Qt::endl;
for (const QDBusIntrospection::Method &method : interface->methods) {
bool isDeprecated = method.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) == QLatin1String("true");
bool isNoReply =
@@ -595,26 +595,26 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
QStringList argNames = makeArgNames(method.inputArgs);
writeArgList(hs, argNames, method.annotations, method.inputArgs);
- hs << ")" << endl
- << " {" << endl
- << " QList<QVariant> argumentList;" << endl;
+ hs << ")" << Qt::endl
+ << " {" << Qt::endl
+ << " QList<QVariant> argumentList;" << Qt::endl;
if (!method.inputArgs.isEmpty()) {
hs << " argumentList";
for (int argPos = 0; argPos < method.inputArgs.count(); ++argPos)
hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')';
- hs << ";" << endl;
+ hs << ";" << Qt::endl;
}
if (isNoReply)
hs << " callWithArgumentList(QDBus::NoBlock, "
- << "QStringLiteral(\"" << method.name << "\"), argumentList);" << endl;
+ << "QStringLiteral(\"" << method.name << "\"), argumentList);" << Qt::endl;
else
hs << " return asyncCallWithArgumentList(QStringLiteral(\""
- << method.name << "\"), argumentList);" << endl;
+ << method.name << "\"), argumentList);" << Qt::endl;
// close the function:
- hs << " }" << endl;
+ hs << " }" << Qt::endl;
if (method.outputArgs.count() > 1) {
// generate the old-form QDBusReply methods with multiple incoming parameters
@@ -627,39 +627,39 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
QStringList argNames = makeArgNames(method.inputArgs, method.outputArgs);
writeArgList(hs, argNames, method.annotations, method.inputArgs, method.outputArgs);
- hs << ")" << endl
- << " {" << endl
- << " QList<QVariant> argumentList;" << endl;
+ hs << ")" << Qt::endl
+ << " {" << Qt::endl
+ << " QList<QVariant> argumentList;" << Qt::endl;
int argPos = 0;
if (!method.inputArgs.isEmpty()) {
hs << " argumentList";
for (argPos = 0; argPos < method.inputArgs.count(); ++argPos)
hs << " << QVariant::fromValue(" << argNames.at(argPos) << ')';
- hs << ";" << endl;
+ hs << ";" << Qt::endl;
}
hs << " QDBusMessage reply = callWithArgumentList(QDBus::Block, "
- << "QStringLiteral(\"" << method.name << "\"), argumentList);" << endl;
+ << "QStringLiteral(\"" << method.name << "\"), argumentList);" << Qt::endl;
argPos++;
hs << " if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == "
- << method.outputArgs.count() << ") {" << endl;
+ << method.outputArgs.count() << ") {" << Qt::endl;
// yes, starting from 1
for (int i = 1; i < method.outputArgs.count(); ++i)
hs << " " << argNames.at(argPos++) << " = qdbus_cast<"
<< templateArg(qtTypeName(method.outputArgs.at(i).type, method.annotations, i, "Out"))
- << ">(reply.arguments().at(" << i << "));" << endl;
- hs << " }" << endl
- << " return reply;" << endl
- << " }" << endl;
+ << ">(reply.arguments().at(" << i << "));" << Qt::endl;
+ hs << " }" << Qt::endl
+ << " return reply;" << Qt::endl
+ << " }" << Qt::endl;
}
- hs << endl;
+ hs << Qt::endl;
}
- hs << "Q_SIGNALS: // SIGNALS" << endl;
+ hs << "Q_SIGNALS: // SIGNALS" << Qt::endl;
for (const QDBusIntrospection::Signal &signal : interface->signals_) {
hs << " ";
if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) ==
@@ -671,12 +671,12 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
QStringList argNames = makeArgNames(signal.outputArgs);
writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs);
- hs << ");" << endl; // finished for header
+ hs << ");" << Qt::endl; // finished for header
}
// close the class:
- hs << "};" << endl
- << endl;
+ hs << "};" << Qt::endl
+ << Qt::endl;
}
if (!skipNamespaces) {
@@ -698,17 +698,17 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
// i parts matched
// close last.arguments().count() - i namespaces:
for (int j = i; j < last.count(); ++j)
- hs << QString((last.count() - j - 1 + i) * 2, QLatin1Char(' ')) << "}" << endl;
+ hs << QString((last.count() - j - 1 + i) * 2, QLatin1Char(' ')) << "}" << Qt::endl;
// open current.arguments().count() - i namespaces
for (int j = i; j < current.count(); ++j)
- hs << QString(j * 2, QLatin1Char(' ')) << "namespace " << current.at(j) << " {" << endl;
+ hs << QString(j * 2, QLatin1Char(' ')) << "namespace " << current.at(j) << " {" << Qt::endl;
// add this class:
if (!name.isEmpty()) {
hs << QString(current.count() * 2, QLatin1Char(' '))
<< "typedef ::" << classNameForInterface(it->constData()->name, Proxy)
- << " " << name << ";" << endl;
+ << " " << name << ";" << Qt::endl;
}
if (it == interfaces.constEnd())
@@ -719,12 +719,12 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
}
// close the include guard
- hs << "#endif" << endl;
+ hs << "#endif" << Qt::endl;
QString mocName = moc(filename);
if (includeMocs && !mocName.isEmpty())
- cs << endl
- << "#include \"" << mocName << "\"" << endl;
+ cs << Qt::endl
+ << "#include \"" << mocName << "\"" << Qt::endl;
cs.flush();
hs.flush();
@@ -772,36 +772,36 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
}
includeGuard = QString(QLatin1String("%1"))
.arg(includeGuard);
- hs << "#ifndef " << includeGuard << endl
- << "#define " << includeGuard << endl
- << endl;
+ hs << "#ifndef " << includeGuard << Qt::endl
+ << "#define " << includeGuard << Qt::endl
+ << Qt::endl;
// include our stuff:
- hs << "#include <QtCore/QObject>" << endl;
+ hs << "#include <QtCore/QObject>" << Qt::endl;
if (cppName == headerName)
- hs << "#include <QtCore/QMetaObject>" << endl
- << "#include <QtCore/QVariant>" << endl;
- hs << "#include <QtDBus/QtDBus>" << endl;
+ hs << "#include <QtCore/QMetaObject>" << Qt::endl
+ << "#include <QtCore/QVariant>" << Qt::endl;
+ hs << "#include <QtDBus/QtDBus>" << Qt::endl;
for (const QString &include : qAsConst(includes)) {
- hs << "#include \"" << include << "\"" << endl;
+ hs << "#include \"" << include << "\"" << Qt::endl;
if (headerName.isEmpty())
- cs << "#include \"" << include << "\"" << endl;
+ cs << "#include \"" << include << "\"" << Qt::endl;
}
if (cppName != headerName) {
if (!headerName.isEmpty() && headerName != QLatin1String("-"))
- cs << "#include \"" << headerName << "\"" << endl;
+ cs << "#include \"" << headerName << "\"" << Qt::endl;
- cs << "#include <QtCore/QMetaObject>" << endl
+ cs << "#include <QtCore/QMetaObject>" << Qt::endl
<< includeList
- << endl;
+ << Qt::endl;
hs << forwardDeclarations;
} else {
hs << includeList;
}
- hs << endl;
+ hs << Qt::endl;
QString parent = parentClassName;
if (parentClassName.isEmpty())
@@ -811,47 +811,47 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
QString className = classNameForInterface(interface->name, Adaptor);
// comment:
- hs << "/*" << endl
- << " * Adaptor class for interface " << interface->name << endl
- << " */" << endl;
- cs << "/*" << endl
- << " * Implementation of adaptor class " << className << endl
- << " */" << endl
- << endl;
+ hs << "/*" << Qt::endl
+ << " * Adaptor class for interface " << interface->name << Qt::endl
+ << " */" << Qt::endl;
+ cs << "/*" << Qt::endl
+ << " * Implementation of adaptor class " << className << Qt::endl
+ << " */" << Qt::endl
+ << Qt::endl;
// class header:
- hs << "class " << className << ": public QDBusAbstractAdaptor" << endl
- << "{" << endl
- << " Q_OBJECT" << endl
- << " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << endl
- << " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << endl
+ hs << "class " << className << ": public QDBusAbstractAdaptor" << Qt::endl
+ << "{" << Qt::endl
+ << " Q_OBJECT" << Qt::endl
+ << " Q_CLASSINFO(\"D-Bus Interface\", \"" << interface->name << "\")" << Qt::endl
+ << " Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << Qt::endl
<< stringify(interface->introspection)
- << " \"\")" << endl
- << "public:" << endl
- << " " << className << "(" << parent << " *parent);" << endl
- << " virtual ~" << className << "();" << endl
- << endl;
+ << " \"\")" << Qt::endl
+ << "public:" << Qt::endl
+ << " " << className << "(" << parent << " *parent);" << Qt::endl
+ << " virtual ~" << className << "();" << Qt::endl
+ << Qt::endl;
if (!parentClassName.isEmpty())
- hs << " inline " << parent << " *parent() const" << endl
- << " { return static_cast<" << parent << " *>(QObject::parent()); }" << endl
- << endl;
+ hs << " inline " << parent << " *parent() const" << Qt::endl
+ << " { return static_cast<" << parent << " *>(QObject::parent()); }" << Qt::endl
+ << Qt::endl;
// constructor/destructor
- cs << className << "::" << className << "(" << parent << " *parent)" << endl
- << " : QDBusAbstractAdaptor(parent)" << endl
- << "{" << endl
- << " // constructor" << endl
- << " setAutoRelaySignals(true);" << endl
- << "}" << endl
- << endl
- << className << "::~" << className << "()" << endl
- << "{" << endl
- << " // destructor" << endl
- << "}" << endl
- << endl;
-
- hs << "public: // PROPERTIES" << endl;
+ cs << className << "::" << className << "(" << parent << " *parent)" << Qt::endl
+ << " : QDBusAbstractAdaptor(parent)" << Qt::endl
+ << "{" << Qt::endl
+ << " // constructor" << Qt::endl
+ << " setAutoRelaySignals(true);" << Qt::endl
+ << "}" << Qt::endl
+ << Qt::endl
+ << className << "::~" << className << "()" << Qt::endl
+ << "{" << Qt::endl
+ << " // destructor" << Qt::endl
+ << "}" << Qt::endl
+ << Qt::endl;
+
+ hs << "public: // PROPERTIES" << Qt::endl;
for (const QDBusIntrospection::Property &property : interface->properties) {
QByteArray type = qtTypeName(property.type, property.annotations);
QString constRefType = constRefArg(type);
@@ -863,38 +863,38 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
hs << " READ " << getter;
if (property.access != QDBusIntrospection::Property::Read)
hs << " WRITE " << setter;
- hs << ")" << endl;
+ hs << ")" << Qt::endl;
// getter:
if (property.access != QDBusIntrospection::Property::Write) {
- hs << " " << type << " " << getter << "() const;" << endl;
+ hs << " " << type << " " << getter << "() const;" << Qt::endl;
cs << type << " "
- << className << "::" << getter << "() const" << endl
- << "{" << endl
- << " // get the value of property " << property.name << endl
- << " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << endl
- << "}" << endl
- << endl;
+ << className << "::" << getter << "() const" << Qt::endl
+ << "{" << Qt::endl
+ << " // get the value of property " << property.name << Qt::endl
+ << " return qvariant_cast< " << type <<" >(parent()->property(\"" << property.name << "\"));" << Qt::endl
+ << "}" << Qt::endl
+ << Qt::endl;
}
// setter
if (property.access != QDBusIntrospection::Property::Read) {
- hs << " void " << setter << "(" << constRefType << "value);" << endl;
- cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << endl
- << "{" << endl
- << " // set the value of property " << property.name << endl
+ hs << " void " << setter << "(" << constRefType << "value);" << Qt::endl;
+ cs << "void " << className << "::" << setter << "(" << constRefType << "value)" << Qt::endl
+ << "{" << Qt::endl
+ << " // set the value of property " << property.name << Qt::endl
<< " parent()->setProperty(\"" << property.name << "\", QVariant::fromValue(value";
if (constRefType.contains(QLatin1String("QDBusVariant")))
cs << ".variant()";
- cs << "));" << endl
- << "}" << endl
- << endl;
+ cs << "));" << Qt::endl
+ << "}" << Qt::endl
+ << Qt::endl;
}
- hs << endl;
+ hs << Qt::endl;
}
- hs << "public Q_SLOTS: // METHODS" << endl;
+ hs << "public Q_SLOTS: // METHODS" << Qt::endl;
for (const QDBusIntrospection::Method &method : interface->methods) {
bool isNoReply =
method.annotations.value(QLatin1String(ANNOTATION_NO_WAIT)) == QLatin1String("true");
@@ -930,10 +930,10 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
writeArgList(hs, argNames, method.annotations, method.inputArgs, method.outputArgs);
writeArgList(cs, argNames, method.annotations, method.inputArgs, method.outputArgs);
- hs << ");" << endl; // finished for header
- cs << ")" << endl
- << "{" << endl
- << " // handle method call " << interface->name << "." << methodName(method) << endl;
+ hs << ");" << Qt::endl; // finished for header
+ cs << ")" << Qt::endl
+ << "{" << Qt::endl
+ << " // handle method call " << interface->name << "." << methodName(method) << Qt::endl;
// make the call
bool usingInvokeMethod = false;
@@ -945,7 +945,7 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
// we are using QMetaObject::invokeMethod
if (!returnType.isEmpty())
cs << " " << returnType << " " << argNames.at(method.inputArgs.count())
- << ";" << endl;
+ << ";" << Qt::endl;
static const char invoke[] = " QMetaObject::invokeMethod(parent(), \"";
cs << invoke << name << "\"";
@@ -966,10 +966,10 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
<< argNames.at(i)
<< ")";
- cs << ");" << endl;
+ cs << ");" << Qt::endl;
if (!returnType.isEmpty())
- cs << " return " << argNames.at(method.inputArgs.count()) << ";" << endl;
+ cs << " return " << argNames.at(method.inputArgs.count()) << ";" << Qt::endl;
} else {
if (parentClassName.isEmpty())
cs << " //";
@@ -997,13 +997,13 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
first = false;
}
- cs << ");" << endl;
+ cs << ");" << Qt::endl;
}
- cs << "}" << endl
- << endl;
+ cs << "}" << Qt::endl
+ << Qt::endl;
}
- hs << "Q_SIGNALS: // SIGNALS" << endl;
+ hs << "Q_SIGNALS: // SIGNALS" << Qt::endl;
for (const QDBusIntrospection::Signal &signal : interface->signals_) {
hs << " ";
if (signal.annotations.value(QLatin1String("org.freedesktop.DBus.Deprecated")) ==
@@ -1015,21 +1015,21 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte
QStringList argNames = makeArgNames(signal.outputArgs);
writeSignalArgList(hs, argNames, signal.annotations, signal.outputArgs);
- hs << ");" << endl; // finished for header
+ hs << ");" << Qt::endl; // finished for header
}
// close the class:
- hs << "};" << endl
- << endl;
+ hs << "};" << Qt::endl
+ << Qt::endl;
}
// close the include guard
- hs << "#endif" << endl;
+ hs << "#endif" << Qt::endl;
QString mocName = moc(filename);
if (includeMocs && !mocName.isEmpty())
- cs << endl
- << "#include \"" << mocName << "\"" << endl;
+ cs << Qt::endl
+ << "#include \"" << mocName << "\"" << Qt::endl;
cs.flush();
hs.flush();
diff --git a/src/tools/qfloat16-tables/qfloat16-tables.pro b/src/tools/qfloat16-tables/qfloat16-tables.pro
deleted file mode 100644
index a7d10ac197..0000000000
--- a/src/tools/qfloat16-tables/qfloat16-tables.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-option(host_build)
-
-CONFIG += force_bootstrap
-SOURCES += gen_qfloat16_tables.cpp
-
-load(qt_tool)
-
-lib.CONFIG = dummy_install
-INSTALLS = lib
diff --git a/src/tools/qlalr/cppgenerator.cpp b/src/tools/qlalr/cppgenerator.cpp
index 508db696b1..95f70dc988 100644
--- a/src/tools/qlalr/cppgenerator.cpp
+++ b/src/tools/qlalr/cppgenerator.cpp
@@ -36,6 +36,8 @@
#include <QtCore/qfile.h>
#include <QtCore/qmap.h>
+#include <iterator>
+
namespace {
void generateSeparator(int i, QTextStream &out)
@@ -43,7 +45,7 @@ void generateSeparator(int i, QTextStream &out)
if (!(i % 10)) {
if (i)
out << ",";
- out << endl << " ";
+ out << Qt::endl << " ";
} else {
out << ", ";
}
@@ -126,9 +128,9 @@ QString CppGenerator::endIncludeGuard(const QString &fileName)
void CppGenerator::operator () ()
{
// action table...
- state_count = aut.states.size ();
- terminal_count = grammar.terminals.size ();
- non_terminal_count = grammar.non_terminals.size ();
+ state_count = static_cast<int>(aut.states.size());
+ terminal_count = static_cast<int>(grammar.terminals.size());
+ non_terminal_count = static_cast<int>(grammar.non_terminals.size());
#define ACTION(i, j) table [(i) * terminal_count + (j)]
#define GOTO(i, j) pgoto [(i) * non_terminal_count + (j)]
@@ -156,7 +158,7 @@ void CppGenerator::operator () ()
if (grammar.isNonTerminal (a.key ()))
{
- Q_ASSERT (symbol >= terminal_count && symbol < grammar.names.size ());
+ Q_ASSERT(symbol >= terminal_count && symbol < static_cast<int>(grammar.names.size()));
GOTO (q, symbol - terminal_count) = r;
}
@@ -187,14 +189,14 @@ void CppGenerator::operator () ()
{
if (verbose)
qout() << "*** Warning. Found a reduce/reduce conflict in state " << q << " on token ``" << s << "'' between rule "
- << r << " and " << -u << endl;
+ << r << " and " << -u << Qt::endl;
++reduce_reduce_conflict_count;
u = qMax (u, -r);
if (verbose)
- qout() << "\tresolved using rule " << -u << endl;
+ qout() << "\tresolved using rule " << -u << Qt::endl;
}
else if (u > 0)
@@ -227,7 +229,7 @@ void CppGenerator::operator () ()
++shift_reduce_conflict_count;
if (verbose)
- qout() << "*** Warning. Found a shift/reduce conflict in state " << q << " on token ``" << s << "'' with rule " << r << endl;
+ qout() << "*** Warning. Found a shift/reduce conflict in state " << q << " on token ``" << s << "'' with rule " << r << Qt::endl;
}
}
}
@@ -238,14 +240,14 @@ void CppGenerator::operator () ()
{
if (shift_reduce_conflict_count != grammar.expected_shift_reduce
|| reduce_reduce_conflict_count != grammar.expected_reduce_reduce)
- qerr() << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl;
+ qerr() << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << Qt::endl;
if (verbose)
- qout() << endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << endl
- << endl;
+ qout() << Qt::endl << "*** Conflicts: " << shift_reduce_conflict_count << " shift/reduce, " << reduce_reduce_conflict_count << " reduce/reduce" << Qt::endl
+ << Qt::endl;
}
- QBitArray used_rules (grammar.rules.count ());
+ QBitArray used_rules{static_cast<int>(grammar.rules.size())};
int q = 0;
for (StatePointer state = aut.states.begin (); state != aut.states.end (); ++state, ++q)
@@ -259,14 +261,13 @@ void CppGenerator::operator () ()
}
}
- for (int i = 0; i < used_rules.count (); ++i)
+ auto rule = grammar.rules.begin();
+ for (int i = 0; i < used_rules.count (); ++i, ++rule)
{
if (! used_rules.testBit (i))
{
- RulePointer rule = grammar.rules.begin () + i;
-
if (rule != grammar.goal)
- qerr() << "*** Warning: Rule ``" << *rule << "'' is useless!" << endl;
+ qerr() << "*** Warning: Rule ``" << *rule << "'' is useless!" << Qt::endl;
}
}
@@ -280,7 +281,7 @@ void CppGenerator::operator () ()
if (u >= 0)
continue;
- RulePointer rule = grammar.rules.begin () + (- u - 1);
+ RulePointer rule = std::next(grammar.rules.begin(), - u - 1);
if (state->defaultReduce == rule)
u = 0;
@@ -348,26 +349,26 @@ void CppGenerator::operator () ()
{
out << copyrightHeader()
<< privateCopyrightHeader()
- << endl;
+ << Qt::endl;
}
out << "// This file was generated by qlalr - DO NOT EDIT!\n";
- out << startIncludeGuard(grammar.merged_output) << endl;
+ out << startIncludeGuard(grammar.merged_output) << Qt::endl;
if (copyright) {
- out << "#if defined(ERROR)" << endl
- << "# undef ERROR" << endl
- << "#endif" << endl << endl;
+ out << "#if defined(ERROR)" << Qt::endl
+ << "# undef ERROR" << Qt::endl
+ << "#endif" << Qt::endl << Qt::endl;
}
generateDecl (out);
generateImpl (out);
out << p.decls();
out << p.impls();
- out << endl;
+ out << Qt::endl;
- out << endIncludeGuard(grammar.merged_output) << endl;
+ out << endIncludeGuard(grammar.merged_output) << Qt::endl;
return;
}
@@ -388,24 +389,24 @@ void CppGenerator::operator () ()
{
out << copyrightHeader()
<< privateCopyrightHeader()
- << endl;
+ << Qt::endl;
}
out << "// This file was generated by qlalr - DO NOT EDIT!\n";
- out << "#ifndef " << prot << endl
- << "#define " << prot << endl
- << endl;
+ out << "#ifndef " << prot << Qt::endl
+ << "#define " << prot << Qt::endl
+ << Qt::endl;
if (copyright) {
- out << "#include <QtCore/qglobal.h>" << endl << endl;
- out << "QT_BEGIN_NAMESPACE" << endl << endl;
+ out << "#include <QtCore/qglobal.h>" << Qt::endl << Qt::endl;
+ out << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl;
}
generateDecl (out);
if (copyright)
- out << "QT_END_NAMESPACE" << endl;
+ out << "QT_END_NAMESPACE" << Qt::endl;
- out << "#endif // " << prot << endl << endl;
+ out << "#endif // " << prot << Qt::endl << Qt::endl;
} // end decls
{ // bits...
@@ -419,12 +420,12 @@ void CppGenerator::operator () ()
out << "// This file was generated by qlalr - DO NOT EDIT!\n";
- out << "#include \"" << declFileName << "\"" << endl << endl;
+ out << "#include \"" << declFileName << "\"" << Qt::endl << Qt::endl;
if (copyright)
- out << "QT_BEGIN_NAMESPACE" << endl << endl;
+ out << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl;
generateImpl(out);
if (copyright)
- out << "QT_END_NAMESPACE" << endl;
+ out << "QT_END_NAMESPACE" << Qt::endl;
} // end bits
@@ -455,10 +456,10 @@ QString CppGenerator::debugInfoProt() const
void CppGenerator::generateDecl (QTextStream &out)
{
- out << "class " << grammar.table_name << endl
- << "{" << endl
- << "public:" << endl
- << " enum VariousConstants {" << endl;
+ out << "class " << grammar.table_name << Qt::endl
+ << "{" << Qt::endl
+ << "public:" << Qt::endl
+ << " enum VariousConstants {" << Qt::endl;
for (const Name &t : qAsConst(grammar.terminals))
{
@@ -474,62 +475,62 @@ void CppGenerator::generateDecl (QTextStream &out)
else
name.prepend (grammar.token_prefix);
- out << " " << name << " = " << value << "," << endl;
+ out << " " << name << " = " << value << "," << Qt::endl;
}
- out << endl
- << " ACCEPT_STATE = " << accept_state << "," << endl
- << " RULE_COUNT = " << grammar.rules.size () << "," << endl
- << " STATE_COUNT = " << state_count << "," << endl
- << " TERMINAL_COUNT = " << terminal_count << "," << endl
- << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << endl
- << endl
- << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << endl
- << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << endl
- << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << endl
- << " };" << endl
- << endl
- << " static const char *const spell[];" << endl
- << " static const short lhs[];" << endl
- << " static const short rhs[];" << endl;
+ out << Qt::endl
+ << " ACCEPT_STATE = " << accept_state << "," << Qt::endl
+ << " RULE_COUNT = " << grammar.rules.size () << "," << Qt::endl
+ << " STATE_COUNT = " << state_count << "," << Qt::endl
+ << " TERMINAL_COUNT = " << terminal_count << "," << Qt::endl
+ << " NON_TERMINAL_COUNT = " << non_terminal_count << "," << Qt::endl
+ << Qt::endl
+ << " GOTO_INDEX_OFFSET = " << compressed_action.index.size () << "," << Qt::endl
+ << " GOTO_INFO_OFFSET = " << compressed_action.info.size () << "," << Qt::endl
+ << " GOTO_CHECK_OFFSET = " << compressed_action.check.size () << Qt::endl
+ << " };" << Qt::endl
+ << Qt::endl
+ << " static const char *const spell[];" << Qt::endl
+ << " static const short lhs[];" << Qt::endl
+ << " static const short rhs[];" << Qt::endl;
if (debug_info)
{
QString prot = debugInfoProt();
- out << endl << "#ifndef " << prot << endl
- << " static const int rule_index[];" << endl
- << " static const int rule_info[];" << endl
- << "#endif // " << prot << endl << endl;
+ out << Qt::endl << "#ifndef " << prot << Qt::endl
+ << " static const int rule_index[];" << Qt::endl
+ << " static const int rule_info[];" << Qt::endl
+ << "#endif // " << prot << Qt::endl << Qt::endl;
}
- out << " static const short goto_default[];" << endl
- << " static const short action_default[];" << endl
- << " static const short action_index[];" << endl
- << " static const short action_info[];" << endl
- << " static const short action_check[];" << endl
- << endl
- << " static inline int nt_action (int state, int nt)" << endl
- << " {" << endl
- << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << endl
- << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << endl
- << " return goto_default [nt];" << endl
- << endl
- << " return action_info [GOTO_INFO_OFFSET + yyn];" << endl
- << " }" << endl
- << endl
- << " static inline int t_action (int state, int token)" << endl
- << " {" << endl
- << " const int yyn = action_index [state] + token;" << endl
- << endl
- << " if (yyn < 0 || action_check [yyn] != token)" << endl
- << " return - action_default [state];" << endl
- << endl
- << " return action_info [yyn];" << endl
- << " }" << endl
- << "};" << endl
- << endl
- << endl;
+ out << " static const short goto_default[];" << Qt::endl
+ << " static const short action_default[];" << Qt::endl
+ << " static const short action_index[];" << Qt::endl
+ << " static const short action_info[];" << Qt::endl
+ << " static const short action_check[];" << Qt::endl
+ << Qt::endl
+ << " static inline int nt_action (int state, int nt)" << Qt::endl
+ << " {" << Qt::endl
+ << " const int yyn = action_index [GOTO_INDEX_OFFSET + state] + nt;" << Qt::endl
+ << " if (yyn < 0 || action_check [GOTO_CHECK_OFFSET + yyn] != nt)" << Qt::endl
+ << " return goto_default [nt];" << Qt::endl
+ << Qt::endl
+ << " return action_info [GOTO_INFO_OFFSET + yyn];" << Qt::endl
+ << " }" << Qt::endl
+ << Qt::endl
+ << " static inline int t_action (int state, int token)" << Qt::endl
+ << " {" << Qt::endl
+ << " const int yyn = action_index [state] + token;" << Qt::endl
+ << Qt::endl
+ << " if (yyn < 0 || action_check [yyn] != token)" << Qt::endl
+ << " return - action_default [state];" << Qt::endl
+ << Qt::endl
+ << " return action_info [yyn];" << Qt::endl
+ << " }" << Qt::endl
+ << "};" << Qt::endl
+ << Qt::endl
+ << Qt::endl;
}
void CppGenerator::generateImpl (QTextStream &out)
@@ -568,16 +569,16 @@ void CppGenerator::generateImpl (QTextStream &out)
{
first_nt = false;
QString prot = debugInfoProt();
- out << endl << "#ifndef " << prot << endl;
+ out << Qt::endl << "#ifndef " << prot << Qt::endl;
}
out << "\"" << *t << "\"";
}
}
if (debug_info)
- out << endl << "#endif // " << debugInfoProt() << endl;
+ out << Qt::endl << "#endif // " << debugInfoProt() << Qt::endl;
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::lhs [] = {";
idx = 0;
@@ -587,7 +588,7 @@ void CppGenerator::generateImpl (QTextStream &out)
out << aut.id (rule->lhs);
}
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::rhs [] = {";
idx = 0;
@@ -597,13 +598,13 @@ void CppGenerator::generateImpl (QTextStream &out)
out << rule->rhs.size ();
}
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
if (debug_info)
{
QString prot = debugInfoProt();
- out << endl << "#ifndef " << prot << endl;
+ out << Qt::endl << "#ifndef " << prot << Qt::endl;
out << "const int " << grammar.table_name << "::rule_info [] = {";
idx = 0;
for (auto rule = grammar.rules.cbegin (); rule != grammar.rules.cend (); ++rule, ++idx)
@@ -615,11 +616,11 @@ void CppGenerator::generateImpl (QTextStream &out)
for (const Name &n : rule->rhs)
out << ", " << name_ids.value (n);
}
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const int " << grammar.table_name << "::rule_index [] = {";
idx = 0;
- int offset = 0;
+ size_t offset = 0;
for (RulePointer rule = grammar.rules.begin (); rule != grammar.rules.end (); ++rule, ++idx)
{
generateSeparator(idx, out);
@@ -627,8 +628,8 @@ void CppGenerator::generateImpl (QTextStream &out)
out << offset;
offset += rule->rhs.size () + 1;
}
- out << endl << "};" << endl
- << "#endif // " << prot << endl << endl;
+ out << Qt::endl << "};" << Qt::endl
+ << "#endif // " << prot << Qt::endl << Qt::endl;
}
out << "const short " << grammar.table_name << "::action_default [] = {";
@@ -642,27 +643,27 @@ void CppGenerator::generateImpl (QTextStream &out)
else
out << "0";
}
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::goto_default [] = {";
generateList(defgoto, out);
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::action_index [] = {";
generateList(compressed_action.index, out);
- out << "," << endl;
+ out << "," << Qt::endl;
generateList(compressed_goto.index, out);
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::action_info [] = {";
generateList(compressed_action.info, out);
- out << "," << endl;
+ out << "," << Qt::endl;
generateList(compressed_goto.info, out);
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
out << "const short " << grammar.table_name << "::action_check [] = {";
generateList(compressed_action.check, out);
- out << "," << endl;
+ out << "," << Qt::endl;
generateList(compressed_goto.check, out);
- out << endl << "};" << endl << endl;
+ out << Qt::endl << "};" << Qt::endl << Qt::endl;
}
diff --git a/src/tools/qlalr/dotgraph.cpp b/src/tools/qlalr/dotgraph.cpp
index 1fa0a1ac77..1d479af2b2 100644
--- a/src/tools/qlalr/dotgraph.cpp
+++ b/src/tools/qlalr/dotgraph.cpp
@@ -41,9 +41,9 @@ void DotGraph::operator () (Automaton *aut)
{
Grammar *g = aut->_M_grammar;
- out << "digraph {" << endl << endl;
+ out << "digraph {" << Qt::endl << Qt::endl;
- out << "subgraph Includes {" << endl;
+ out << "subgraph Includes {" << Qt::endl;
for (Automaton::IncludesGraph::iterator incl = Automaton::IncludesGraph::begin_nodes ();
incl != Automaton::IncludesGraph::end_nodes (); ++incl)
{
@@ -53,14 +53,14 @@ void DotGraph::operator () (Automaton *aut)
out << "\t->\t";
out << "\"(" << aut->id ((*edge)->data.state) << ", " << (*edge)->data.nt << ")\"\t";
out << "[label=\"" << incl->data.state->follows [incl->data.nt] << "\"]";
- out << endl;
+ out << Qt::endl;
}
}
- out << "}" << endl << endl;
+ out << "}" << Qt::endl << Qt::endl;
- out << "subgraph LRA {" << endl;
- //out << "node [shape=record];" << endl << endl;
+ out << "subgraph LRA {" << Qt::endl;
+ //out << "node [shape=record];" << Qt::endl << Qt::endl;
for (StatePointer q = aut->states.begin (); q != aut->states.end (); ++q)
{
@@ -74,16 +74,16 @@ void DotGraph::operator () (Automaton *aut)
for (ItemPointer item = q->kernel.begin (); item != q->kernel.end (); ++item)
out << "| <" << index++ << "> " << *item;
- out << "}\"]" << endl;
+ out << "}\"]" << Qt::endl;
for (Bundle::iterator a = q->bundle.begin (); a != q->bundle.end (); ++a)
{
const char *clr = g->isTerminal (a.key ()) ? "blue" : "red";
- out << "\t" << state << "\t->\t" << aut->id (*a) << "\t[color=\"" << clr << "\",label=\"" << a.key () << "\"]" << endl;
+ out << "\t" << state << "\t->\t" << aut->id (*a) << "\t[color=\"" << clr << "\",label=\"" << a.key () << "\"]" << Qt::endl;
}
- out << endl;
+ out << Qt::endl;
}
- out << "}" << endl;
- out << endl << endl << "}" << endl;
+ out << "}" << Qt::endl;
+ out << Qt::endl << Qt::endl << "}" << Qt::endl;
}
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index 541523d49c..c7269bed5f 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -51,7 +51,9 @@ QTextStream &qout()
static QTextStream result(stdout, QIODevice::WriteOnly);
return result;
}
+QT_END_NAMESPACE
+namespace std {
bool operator < (Name a, Name b)
{
return *a < *b;
@@ -66,7 +68,7 @@ bool operator < (StatePointer a, StatePointer b)
{
return &*a < &*b;
}
-QT_END_NAMESPACE
+}
bool Read::operator < (const Read &other) const
{
@@ -319,7 +321,7 @@ void Automaton::buildNullables ()
}
#ifndef QLALR_NO_DEBUG_NULLABLES
- qerr() << "nullables = {" << nullables << endl;
+ qerr() << "nullables = {" << nullables << Qt::endl;
#endif
}
@@ -335,7 +337,7 @@ QPair<StatePointer, bool> Automaton::internState (const State &state)
struct _Bucket
{
- QLinkedList<ItemPointer> items;
+ std::list<ItemPointer> items;
void insert (ItemPointer item)
{ items.push_back (item); }
@@ -344,8 +346,8 @@ struct _Bucket
{
State st (aut->_M_grammar);
- for (QLinkedList<ItemPointer>::iterator item = items.begin (); item != items.end (); ++item)
- st.insert ((*item)->next ());
+ for (auto &item : items)
+ st.insert(item->next());
return st;
}
@@ -462,7 +464,7 @@ void Automaton::buildLookbackSets ()
lookbacks.insert (item, Lookback (p, A));
#ifndef QLALR_NO_DEBUG_LOOKBACKS
- qerr() << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << endl;
+ qerr() << "*** (" << id (q) << ", " << *rule << ") lookback (" << id (p) << ", " << *A << ")" << Qt::endl;
#endif
}
}
@@ -493,7 +495,7 @@ void Automaton::buildDirectReads ()
#ifndef QLALR_NO_DEBUG_DIRECT_READS
for (QMap<Name, NameSet>::iterator dr = q->reads.begin (); dr != q->reads.end (); ++dr)
- qerr() << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << endl;
+ qerr() << "*** DR(" << id (q) << ", " << dr.key () << ") = " << dr.value () << Qt::endl;
#endif
}
}
@@ -526,7 +528,7 @@ void Automaton::buildReadsDigraph ()
dump (qerr(), source);
qerr() << " reads ";
dump (qerr(), target);
- qerr() << endl;
+ qerr() << Qt::endl;
#endif
}
}
@@ -561,7 +563,7 @@ void Automaton::visitReadNode (ReadNode node)
_M_reads_stack.push (node);
#ifndef QLALR_NO_DEBUG_INCLUDES
- // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl;
+ // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << Qt::endl;
#endif
for (ReadsGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
@@ -641,7 +643,7 @@ void Automaton::buildIncludesDigraph ()
source->insertEdge (target);
#ifndef QLALR_NO_DEBUG_INCLUDES
- qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl;
+ qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << Qt::endl;
#endif // QLALR_NO_DEBUG_INCLUDES
continue;
@@ -663,7 +665,7 @@ void Automaton::buildIncludesDigraph ()
source->insertEdge (target);
#ifndef QLALR_NO_DEBUG_INCLUDES
- qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << endl;
+ qerr() << "*** (" << id (p) << ", " << *A << ") includes (" << id (pp) << ", " << *name << ")" << Qt::endl;
#endif // QLALR_NO_DEBUG_INCLUDES
}
}
@@ -680,7 +682,7 @@ void Automaton::visitIncludeNode (IncludeNode node)
_M_includes_stack.push (node);
#ifndef QLALR_NO_DEBUG_INCLUDES
- // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << endl;
+ // qerr() << "*** Debug. visit node (" << id (node->data.state) << ", " << node->data.nt << ") N = " << N << Qt::endl;
#endif
for (IncludesGraph::edge_iterator edge = node->begin (); edge != node->end (); ++edge)
@@ -696,7 +698,7 @@ void Automaton::visitIncludeNode (IncludeNode node)
dump (qerr(), node);
qerr() << " += follows";
dump (qerr(), r);
- qerr() << endl;
+ qerr() << Qt::endl;
#endif
NameSet &dst = node->data.state->follows [node->data.nt];
@@ -732,7 +734,7 @@ void Automaton::buildLookaheads ()
#ifndef QLALR_NO_DEBUG_LOOKAHEADS
qerr() << "(" << id (p) << ", " << *item->rule << ") lookbacks ";
dump (qerr(), lookback);
- qerr() << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << endl;
+ qerr() << " with follows (" << id (q) << ", " << lookback.nt << ") = " << q->follows [lookback.nt] << Qt::endl;
#endif
lookaheads [item].insert (q->follows [lookback.nt].begin (), q->follows [lookback.nt].end ());
@@ -760,7 +762,7 @@ void Automaton::buildDefaultReduceActions ()
if (item->dot != item->end_rhs ())
continue;
- int la = lookaheads.value (item).size ();
+ int la = static_cast<int>(lookaheads.value(item).size());
if (def == state->closure.end () || la > size)
{
def = item;
diff --git a/src/tools/qlalr/lalr.g b/src/tools/qlalr/lalr.g
index 05d30c21fd..a849800dd5 100644
--- a/src/tools/qlalr/lalr.g
+++ b/src/tools/qlalr/lalr.g
@@ -261,7 +261,7 @@ int Recognizer::nextToken()
if (ch == QLatin1Char ('"'))
inp ();
else
- qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << Qt::endl;
_M_current_value = text;
return (token = STRING_LITERAL);
@@ -314,7 +314,7 @@ int Recognizer::nextToken()
return (token = PREC);
else
{
- qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << Qt::endl;
exit (EXIT_FAILURE);
return (token = ERROR);
}
@@ -659,7 +659,7 @@ case $rule_number: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
{
- qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl;
return false;
}
@@ -683,7 +683,7 @@ case $rule_number: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
{
- qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl;
return false;
}
@@ -712,7 +712,7 @@ case $rule_number: {
Name tok = _M_grammar->intern (sym(2));
if (! _M_grammar->isTerminal (tok))
{
- qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << Qt::endl;
_M_current_rule->prec = _M_grammar->names.end ();
}
else
@@ -758,7 +758,7 @@ case $rule_number: {
}
}
- qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << Qt::endl;
return false;
}
diff --git a/src/tools/qlalr/lalr.h b/src/tools/qlalr/lalr.h
index 8eadee400d..473ea89769 100644
--- a/src/tools/qlalr/lalr.h
+++ b/src/tools/qlalr/lalr.h
@@ -39,6 +39,7 @@
#include <algorithm>
#include <functional>
+#include <set>
class Rule;
class State;
@@ -48,121 +49,24 @@ class State;
class Arrow;
class Automaton;
-template <typename _Tp >
-class OrderedSet : protected QMap<_Tp, bool>
-{
- typedef QMap<_Tp, bool> _Base;
-
-public:
- class const_iterator
- {
- typename _Base::const_iterator _M_iterator;
-
- public:
- const_iterator () {}
-
- const_iterator (const typename _Base::iterator &it):
- _M_iterator (typename _Base::const_iterator(it)) {}
- const_iterator (const typename _Base::const_iterator &it):
- _M_iterator (it) {}
-
- const _Tp &operator * () const
- { return _M_iterator.key (); }
-
- const _Tp *operator -> () const
- { return &_M_iterator.key (); }
-
- const_iterator &operator ++ ()
- { ++_M_iterator; return *this; }
-
- const_iterator operator ++ (int) const
- {
- const_iterator me (*this);
- ++_M_iterator;
- return me;
- }
-
- bool operator == (const const_iterator &other) const
- { return _M_iterator == other._M_iterator; }
-
- bool operator != (const const_iterator &other) const
- { return _M_iterator != other._M_iterator; }
- };
-
- typedef const_iterator iterator;
-
-public:
- OrderedSet () {}
-
- const_iterator begin () const
- { return const_iterator (_Base::begin ()); }
-
- const_iterator end () const
- { return const_iterator (_Base::end ()); }
-
- bool isEmpty () const
- { return _Base::isEmpty (); }
-
- int size () const
- { return _Base::size (); }
-
- const_iterator find (const _Tp &elt) const
- { return const_iterator (_Base::find (elt)); }
-
- QPair<const_iterator, bool> insert (const _Tp &elt)
- {
- int elts = _Base::size ();
- const_iterator it (_Base::insert (typename _Base::key_type (elt), true));
- return qMakePair (it, elts != _Base::size ());
- }
-
- QPair<const_iterator, bool> insert (const_iterator, const _Tp &elt)
- {
- int elts = _Base::size ();
- const_iterator it (_Base::insert (typename _Base::key_type (elt), true));
- return qMakePair (it, elts != _Base::size ());
- }
-
- const _Tp &operator [] (const _Tp &elt)
- { return *insert (elt)->first; }
-
- template <typename _InputIterator>
- void insert (_InputIterator first, _InputIterator last)
- {
- for (; first != last; ++first)
- insert (*first);
- }
-};
// names
-typedef QLinkedList<QString>::iterator Name;
-QT_BEGIN_NAMESPACE
-Q_DECLARE_TYPEINFO(QLinkedList<QString>::iterator, Q_PRIMITIVE_TYPE);
-QT_END_NAMESPACE
-typedef QLinkedList<Name> NameList;
-typedef OrderedSet<Name> NameSet;
+typedef std::list<QString>::iterator Name;
+typedef std::list<Name> NameList;
+typedef std::set<Name> NameSet;
// items
-typedef QLinkedList<Item> ItemList;
+typedef std::list<Item> ItemList;
typedef ItemList::iterator ItemPointer;
-QT_BEGIN_NAMESPACE
-Q_DECLARE_TYPEINFO(ItemList::iterator, Q_PRIMITIVE_TYPE);
-QT_END_NAMESPACE
// rules
-typedef QLinkedList<Rule> debug_infot;
+typedef std::list<Rule> debug_infot;
typedef debug_infot::iterator RulePointer;
-QT_BEGIN_NAMESPACE
-Q_DECLARE_TYPEINFO(debug_infot::iterator, Q_PRIMITIVE_TYPE);
-QT_END_NAMESPACE
typedef QMultiMap<Name, RulePointer> RuleMap;
// states
-typedef QLinkedList<State> StateList;
+typedef std::list<State> StateList;
typedef StateList::iterator StatePointer;
-QT_BEGIN_NAMESPACE
-Q_DECLARE_TYPEINFO(StateList::iterator, Q_PRIMITIVE_TYPE);
-QT_END_NAMESPACE
// arrows
typedef QMap<Name, StatePointer> Bundle;
@@ -257,9 +161,9 @@ template <typename _Tp>
class Node
{
public:
- typedef OrderedSet<Node<_Tp> > Repository;
+ typedef std::set<Node<_Tp> > Repository;
typedef typename Repository::iterator iterator;
- typedef typename QLinkedList<iterator>::iterator edge_iterator;
+ typedef typename std::list<iterator>::iterator edge_iterator;
public:
static iterator get (_Tp data);
@@ -297,7 +201,7 @@ public: // attributes
mutable bool root;
mutable int dfn;
mutable _Tp data;
- mutable QLinkedList<iterator> outs;
+ mutable std::list<iterator> outs;
protected:
inline Node () {}
@@ -319,7 +223,7 @@ typename Node<_Tp>::iterator Node<_Tp>::get (_Tp data)
}
template <typename _Tp>
-QPair<typename QLinkedList<typename Node<_Tp>::iterator>::iterator, bool> Node<_Tp>::insertEdge (typename Node<_Tp>::iterator other) const
+QPair<typename std::list<typename Node<_Tp>::iterator>::iterator, bool> Node<_Tp>::insertEdge(typename Node<_Tp>::iterator other) const
{
edge_iterator it = std::find (outs.begin (), outs.end (), other);
@@ -356,7 +260,7 @@ public:
QString decl_file_name;
QString impl_file_name;
QString token_prefix;
- QLinkedList<QString> names;
+ std::list<QString> names;
Name start;
NameSet terminals;
NameSet non_terminals;
@@ -406,9 +310,6 @@ public:
StatePointer state;
Name nt;
};
-QT_BEGIN_NAMESPACE
-Q_DECLARE_TYPEINFO(OrderedSet<Node<Read> >::const_iterator, Q_PRIMITIVE_TYPE);
-QT_END_NAMESPACE
class Include
{
@@ -430,9 +331,6 @@ public:
StatePointer state;
Name nt;
};
-QT_BEGIN_NAMESPACE
-Q_DECLARE_TYPEINFO(OrderedSet<Node<Include> >::const_iterator, Q_PRIMITIVE_TYPE);
-QT_END_NAMESPACE
class Automaton
{
@@ -491,11 +389,11 @@ private:
int _M_includes_dfn;
};
-QT_BEGIN_NAMESPACE
+namespace std {
bool operator < (Name a, Name b);
bool operator < (StatePointer a, StatePointer b);
bool operator < (ItemPointer a, ItemPointer b);
-QT_END_NAMESPACE
+}
QTextStream &operator << (QTextStream &out, const Name &n);
QTextStream &operator << (QTextStream &out, const Rule &r);
diff --git a/src/tools/qlalr/main.cpp b/src/tools/qlalr/main.cpp
index 5971eb201d..6a57c7aa7a 100644
--- a/src/tools/qlalr/main.cpp
+++ b/src/tools/qlalr/main.cpp
@@ -44,15 +44,15 @@
static void help_me ()
{
- qerr() << "Usage: qlalr [options] [input file name]" << endl
- << endl
- << " --help, -h\t\tdisplay this help and exit" << endl
- << " --verbose, -v\t\tverbose output" << endl
- << " --no-debug\t\tno debug information" << endl
- << " --no-lines\t\tno #line directives" << endl
- << " --dot\t\t\tgenerate a graph" << endl
- << " --qt\t\tadd the Qt copyright header and Qt-specific types and macros" << endl
- << endl;
+ qerr() << "Usage: qlalr [options] [input file name]" << Qt::endl
+ << Qt::endl
+ << " --help, -h\t\tdisplay this help and exit" << Qt::endl
+ << " --verbose, -v\t\tverbose output" << Qt::endl
+ << " --no-debug\t\tno debug information" << Qt::endl
+ << " --no-lines\t\tno #line directives" << Qt::endl
+ << " --dot\t\t\tgenerate a graph" << Qt::endl
+ << " --qt\t\tadd the Qt copyright header and Qt-specific types and macros" << Qt::endl
+ << Qt::endl;
exit (0);
}
@@ -91,7 +91,7 @@ int main (int argc, char *argv[])
file_name = arg;
else
- qerr() << "*** Warning. Ignore argument `" << arg << "'" << endl;
+ qerr() << "*** Warning. Ignore argument `" << arg << "'" << Qt::endl;
}
if (file_name.isEmpty ())
@@ -106,15 +106,15 @@ int main (int argc, char *argv[])
if (! p.parse (file_name))
exit (EXIT_FAILURE);
- if (grammar.rules.isEmpty ())
+ if (grammar.rules.empty())
{
- qerr() << "*** Fatal. No rules!" << endl;
+ qerr() << "*** Fatal. No rules!" << Qt::endl;
exit (EXIT_FAILURE);
}
else if (grammar.start == grammar.names.end ())
{
- qerr() << "*** Fatal. No start symbol!" << endl;
+ qerr() << "*** Fatal. No start symbol!" << Qt::endl;
exit (EXIT_FAILURE);
}
diff --git a/src/tools/qlalr/parsetable.cpp b/src/tools/qlalr/parsetable.cpp
index c88ac1291e..9e71acebb4 100644
--- a/src/tools/qlalr/parsetable.cpp
+++ b/src/tools/qlalr/parsetable.cpp
@@ -43,13 +43,13 @@ void ParseTable::operator () (Automaton *aut)
int rindex = 1;
for (RulePointer rule = g->rules.begin (); rule != g->rules.end (); ++rule)
- out << rindex++ << ")\t" << *rule << endl;
- out << endl << endl;
+ out << rindex++ << ")\t" << *rule << Qt::endl;
+ out << Qt::endl << Qt::endl;
int index = 0;
for (StatePointer state = aut->states.begin (); state != aut->states.end (); ++state)
{
- out << "state " << index++ << endl << endl;
+ out << "state " << index++ << Qt::endl << Qt::endl;
for (ItemPointer item = state->kernel.begin (); item != state->kernel.end (); ++item)
{
@@ -58,7 +58,7 @@ void ParseTable::operator () (Automaton *aut)
if (item->dot == item->end_rhs ())
out << " " << aut->lookaheads [item];
- out << endl;
+ out << Qt::endl;
}
bool first = true;
@@ -68,11 +68,11 @@ void ParseTable::operator () (Automaton *aut)
continue;
if (first)
- out << endl;
+ out << Qt::endl;
first = false;
- out << " " << *arrow.key () << " shift, and go to state " << std::distance (aut->states.begin (), *arrow) << endl;
+ out << " " << *arrow.key () << " shift, and go to state " << std::distance (aut->states.begin (), *arrow) << Qt::endl;
}
first = true;
@@ -82,13 +82,13 @@ void ParseTable::operator () (Automaton *aut)
continue;
if (first)
- out << endl;
+ out << Qt::endl;
first = false;
const auto lookaheads = aut->lookaheads.value(item);
for (const Name &la : lookaheads)
- out << " " << *la << " reduce using rule " << aut->id (item->rule) << " (" << *item->rule->lhs << ")" << endl;
+ out << " " << *la << " reduce using rule " << aut->id (item->rule) << " (" << *item->rule->lhs << ")" << Qt::endl;
}
first = true;
@@ -98,19 +98,19 @@ void ParseTable::operator () (Automaton *aut)
continue;
if (first)
- out << endl;
+ out << Qt::endl;
first = false;
- out << " " << *arrow.key () << " go to state " << std::distance (aut->states.begin (), *arrow) << endl;
+ out << " " << *arrow.key () << " go to state " << std::distance (aut->states.begin (), *arrow) << Qt::endl;
}
if (state->defaultReduce != g->rules.end ())
{
- out << endl
- << " $default reduce using rule " << aut->id (state->defaultReduce) << " (" << *state->defaultReduce->lhs << ")" << endl;
+ out << Qt::endl
+ << " $default reduce using rule " << aut->id (state->defaultReduce) << " (" << *state->defaultReduce->lhs << ")" << Qt::endl;
}
- out << endl;
+ out << Qt::endl;
}
}
diff --git a/src/tools/qlalr/recognizer.cpp b/src/tools/qlalr/recognizer.cpp
index ab797c85d0..3da54c0c6a 100644
--- a/src/tools/qlalr/recognizer.cpp
+++ b/src/tools/qlalr/recognizer.cpp
@@ -97,7 +97,7 @@ int Recognizer::nextToken()
if (ch == QLatin1Char ('"'))
inp ();
else
- qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Warning. Expected `\"'" << Qt::endl;
_M_current_value = text;
return (token = STRING_LITERAL);
@@ -150,7 +150,7 @@ int Recognizer::nextToken()
return (token = PREC);
else
{
- qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Unknown keyword `" << text << "'" << Qt::endl;
exit (EXIT_FAILURE);
return (token = ERROR);
}
@@ -405,7 +405,7 @@ case 34: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
{
- qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl;
return false;
}
@@ -420,7 +420,7 @@ case 38: {
if (_M_grammar->terminals.find (_M_current_rule->lhs) != _M_grammar->terminals.end ())
{
- qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Invalid non terminal `" << *_M_current_rule->lhs << "'" << Qt::endl;
return false;
}
@@ -443,7 +443,7 @@ case 40: {
Name tok = _M_grammar->intern (sym(2));
if (! _M_grammar->isTerminal (tok))
{
- qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": `" << *tok << " is not a terminal symbol" << Qt::endl;
_M_current_rule->prec = _M_grammar->names.end ();
}
else
@@ -474,7 +474,7 @@ case 43: {
}
}
- qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << endl;
+ qerr() << _M_input_file << ":" << _M_line << ": Syntax error" << Qt::endl;
return false;
}
diff --git a/src/tools/qvkgen/qvkgen.cpp b/src/tools/qvkgen/qvkgen.cpp
index 059f9413cb..4db3f26161 100644
--- a/src/tools/qvkgen/qvkgen.cpp
+++ b/src/tools/qvkgen/qvkgen.cpp
@@ -192,22 +192,20 @@ QString VkSpecParser::parseName()
QString funcSig(const VkSpecParser::Command &c, const char *className = nullptr)
{
- QString s;
- s.sprintf("%s %s%s%s", qPrintable(c.cmd.type),
- (className ? className : ""), (className ? "::" : ""),
- qPrintable(c.cmd.name));
+ QString s(QString::asprintf("%s %s%s%s", qPrintable(c.cmd.type),
+ (className ? className : ""), (className ? "::" : ""),
+ qPrintable(c.cmd.name)));
if (!c.args.isEmpty()) {
s += QLatin1Char('(');
bool first = true;
for (const VkSpecParser::TypedName &a : c.args) {
- QString argStr;
- argStr.sprintf("%s%s%s%s", qPrintable(a.type), (a.type.endsWith(QLatin1Char('*')) ? "" : " "),
- qPrintable(a.name), qPrintable(a.typeSuffix));
if (!first)
s += QStringLiteral(", ");
else
first = false;
- s += argStr;
+ s += QString::asprintf("%s%s%s%s", qPrintable(a.type),
+ (a.type.endsWith(QLatin1Char('*')) ? "" : " "),
+ qPrintable(a.name), qPrintable(a.typeSuffix));
}
s += QLatin1Char(')');
}
@@ -216,13 +214,12 @@ QString funcSig(const VkSpecParser::Command &c, const char *className = nullptr)
QString funcCall(const VkSpecParser::Command &c, int idx)
{
- QString s;
// template:
// [return] reinterpret_cast<PFN_vkEnumeratePhysicalDevices>(d_ptr->m_funcs[0])(instance, pPhysicalDeviceCount, pPhysicalDevices);
- s.sprintf("%sreinterpret_cast<PFN_%s>(d_ptr->m_funcs[%d])",
- (c.cmd.type == QStringLiteral("void") ? "" : "return "),
- qPrintable(c.cmd.name),
- idx);
+ QString s = QString::asprintf("%sreinterpret_cast<PFN_%s>(d_ptr->m_funcs[%d])",
+ (c.cmd.type == QStringLiteral("void") ? "" : "return "),
+ qPrintable(c.cmd.name),
+ idx);
if (!c.args.isEmpty()) {
s += QLatin1Char('(');
bool first = true;
@@ -338,10 +335,9 @@ bool genVulkanFunctionsH(const QVector<VkSpecParser::Command> &commands, const Q
*dst += QStringLiteral(";\n");
}
- QString str;
- str.sprintf(s, preamble.get(licHeaderFn).constData(), instCmdStr.toUtf8().constData(), devCmdStr.toUtf8().constData());
-
- f.write(str.toUtf8());
+ f.write(QString::asprintf(s, preamble.get(licHeaderFn).constData(),
+ instCmdStr.toUtf8().constData(),
+ devCmdStr.toUtf8().constData()).toUtf8());
return true;
}
@@ -400,10 +396,7 @@ bool genVulkanFunctionsPH(const QVector<VkSpecParser::Command> &commands, const
[](const VkSpecParser::Command &c) { return c.deviceLevel; });
const int instLevelCount = commands.count() - devLevelCount;
- QString str;
- str.sprintf(s, preamble.get(licHeaderFn).constData(), instLevelCount, devLevelCount);
-
- f.write(str.toUtf8());
+ f.write(QString::asprintf(s, preamble.get(licHeaderFn).constData(), instLevelCount, devLevelCount).toUtf8());
return true;
}
@@ -478,10 +471,12 @@ bool genVulkanFunctionsPC(const QVector<VkSpecParser::Command> &commands, const
if (instCmdNamesStr.count() > 2)
instCmdNamesStr = instCmdNamesStr.left(instCmdNamesStr.count() - 2);
- QString str;
- str.sprintf(s, preamble.get(licHeaderFn).constData(),
- instCmdWrapperStr.toUtf8().constData(), instCmdNamesStr.toUtf8().constData(), instIdx,
- devCmdWrapperStr.toUtf8().constData(), devCmdNamesStr.toUtf8().constData(), commands.count() - instIdx);
+ const QString str =
+ QString::asprintf(s, preamble.get(licHeaderFn).constData(),
+ instCmdWrapperStr.toUtf8().constData(),
+ instCmdNamesStr.toUtf8().constData(), instIdx,
+ devCmdWrapperStr.toUtf8().constData(),
+ devCmdNamesStr.toUtf8().constData(), commands.count() - instIdx);
f.write(str.toUtf8());
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp
index 6e8c13be15..ac87e48e39 100644
--- a/src/tools/rcc/main.cpp
+++ b/src/tools/rcc/main.cpp
@@ -99,6 +99,37 @@ int createProject(const QString &outFileName)
return 0;
}
+// Escapes a path for use in a Depfile (Makefile syntax)
+QString makefileEscape(const QString &filepath)
+{
+ // Always use forward slashes
+ QString result = QDir::cleanPath(filepath);
+ // Spaces are escaped with a backslash
+ result.replace(QLatin1Char(' '), QLatin1String("\\ "));
+ // Pipes are escaped with a backslash
+ result.replace(QLatin1Char('|'), QLatin1String("\\|"));
+ // Dollars are escaped with a dollar
+ result.replace(QLatin1Char('$'), QLatin1String("$$"));
+
+ return result;
+}
+
+void writeDepFile(QIODevice &iodev, const QStringList &depsList, const QString &targetName)
+{
+ QTextStream out(&iodev);
+ out << qPrintable(makefileEscape(targetName));
+ out << QLatin1Char(':');
+
+ // Write depfile
+ for (int i = 0; i < depsList.size(); ++i) {
+ out << QLatin1Char(' ');
+
+ out << qPrintable(makefileEscape(depsList.at(i)));
+ }
+
+ out << QLatin1Char('\n');
+}
+
int runRcc(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
@@ -155,6 +186,11 @@ int runRcc(int argc, char *argv[])
QCommandLineOption binaryOption(QStringLiteral("binary"), QStringLiteral("Output a binary file for use as a dynamic resource."));
parser.addOption(binaryOption);
+ QCommandLineOption generatorOption(QStringList{QStringLiteral("g"), QStringLiteral("generator")});
+ generatorOption.setDescription(QStringLiteral("Select generator."));
+ generatorOption.setValueName(QStringLiteral("cpp|python|python2"));
+ parser.addOption(generatorOption);
+
QCommandLineOption passOption(QStringLiteral("pass"), QStringLiteral("Pass number for big resources"), QStringLiteral("number"));
parser.addOption(passOption);
@@ -171,6 +207,10 @@ int runRcc(int argc, char *argv[])
QStringLiteral("Only output a mapping of resource paths to file system paths defined in the .qrc file, do not generate code."));
parser.addOption(mapOption);
+ QCommandLineOption depFileOption(QStringList{QStringLiteral("d"), QStringLiteral("depfile")},
+ QStringLiteral("Write a depfile with the .qrc dependencies to <file>."), QStringLiteral("file"));
+ parser.addOption(depFileOption);
+
QCommandLineOption projectOption(QStringLiteral("project"), QStringLiteral("Output a resource file containing all files from the current directory."));
parser.addOption(projectOption);
@@ -220,6 +260,18 @@ int runRcc(int argc, char *argv[])
library.setCompressThreshold(parser.value(thresholdOption).toInt());
if (parser.isSet(binaryOption))
library.setFormat(RCCResourceLibrary::Binary);
+ if (parser.isSet(generatorOption)) {
+ auto value = parser.value(generatorOption);
+ if (value == QLatin1String("cpp"))
+ library.setFormat(RCCResourceLibrary::C_Code);
+ else if (value == QLatin1String("python"))
+ library.setFormat(RCCResourceLibrary::Python3_Code);
+ else if (value == QLatin1String("python2"))
+ library.setFormat(RCCResourceLibrary::Python2_Code);
+ else
+ errorMsg = QLatin1String("Invalid generator: ") + value;
+ }
+
if (parser.isSet(passOption)) {
if (parser.value(passOption) == QLatin1String("1"))
library.setFormat(RCCResourceLibrary::Pass1);
@@ -249,6 +301,7 @@ int runRcc(int argc, char *argv[])
QString outFilename = parser.value(outputOption);
QString tempFilename = parser.value(tempOption);
+ QString depFilename = parser.value(depFileOption);
if (projectRequested) {
return createProject(outFilename);
@@ -280,6 +333,8 @@ int runRcc(int argc, char *argv[])
switch (library.format()) {
case RCCResourceLibrary::C_Code:
case RCCResourceLibrary::Pass1:
+ case RCCResourceLibrary::Python3_Code:
+ case RCCResourceLibrary::Python2_Code:
mode = QIODevice::WriteOnly | QIODevice::Text;
break;
case RCCResourceLibrary::Pass2:
@@ -333,6 +388,28 @@ int runRcc(int argc, char *argv[])
return 0;
}
+ // Write depfile
+ if (!depFilename.isEmpty()) {
+ QFile depout;
+ depout.setFileName(depFilename);
+
+ if (outFilename.isEmpty() || outFilename == QLatin1String("-")) {
+ const QString msg = QString::fromUtf8("Unable to write depfile when outputting to stdout!\n");
+ errorDevice.write(msg.toUtf8());
+ return 1;
+ }
+
+ if (!depout.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ const QString msg = QString::fromUtf8("Unable to open depfile %1 for writing: %2\n")
+ .arg(depout.fileName(), depout.errorString());
+ errorDevice.write(msg.toUtf8());
+ return 1;
+ }
+
+ writeDepFile(depout, library.dataFiles(), outFilename);
+ depout.close();
+ }
+
QFile temp;
if (!tempFilename.isEmpty()) {
temp.setFileName(tempFilename);
diff --git a/src/tools/rcc/rcc.cpp b/src/tools/rcc/rcc.cpp
index 011a7db810..9acbce25ff 100644
--- a/src/tools/rcc/rcc.cpp
+++ b/src/tools/rcc/rcc.cpp
@@ -37,6 +37,7 @@
#include <qfile.h>
#include <qiodevice.h>
#include <qlocale.h>
+#include <qregexp.h>
#include <qstack.h>
#include <qxmlstream.h>
@@ -66,11 +67,8 @@ enum {
# define CONSTANT_COMPRESSALGO_DEFAULT RCCResourceLibrary::CompressionAlgorithm::None
#endif
-#define writeString(s) write(s, sizeof(s))
-
void RCCResourceLibrary::write(const char *str, int len)
{
- --len; // trailing \0 on string literals...
int n = m_out.size();
m_out.resize(n + len);
memcpy(m_out.data() + n, str, len);
@@ -176,6 +174,8 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
{
const bool text = lib.m_format == RCCResourceLibrary::C_Code;
const bool pass1 = lib.m_format == RCCResourceLibrary::Pass1;
+ const bool python = lib.m_format == RCCResourceLibrary::Python3_Code
+ || lib.m_format == RCCResourceLibrary::Python2_Code;
//some info
if (text || pass1) {
if (m_language != QLocale::C) {
@@ -222,6 +222,8 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
}
if (text || pass1)
lib.writeChar('\n');
+ else if (python)
+ lib.writeString("\\\n");
if (lib.formatVersion() >= 2) {
// last modified time stamp
@@ -236,6 +238,8 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');
+ else if (python)
+ lib.writeString("\\\n");
}
}
@@ -246,6 +250,8 @@ qint64 RCCFileInfo::writeDataBlob(RCCResourceLibrary &lib, qint64 offset,
const bool pass1 = lib.m_format == RCCResourceLibrary::Pass1;
const bool pass2 = lib.m_format == RCCResourceLibrary::Pass2;
const bool binary = lib.m_format == RCCResourceLibrary::Binary;
+ const bool python = lib.m_format == RCCResourceLibrary::Python3_Code
+ || lib.m_format == RCCResourceLibrary::Python2_Code;
//capture the offset
m_dataOffset = offset;
@@ -343,20 +349,24 @@ qint64 RCCFileInfo::writeDataBlob(RCCResourceLibrary &lib, qint64 offset,
}
// write the length
-
- if (text || binary || pass2)
+ if (text || binary || pass2 || python)
lib.writeNumber4(data.size());
if (text || pass1)
lib.writeString("\n ");
+ else if (python)
+ lib.writeString("\\\n");
offset += 4;
// write the payload
const char *p = data.constData();
- if (text) {
+ if (text || python) {
for (int i = data.size(), j = 0; --i >= 0; --j) {
lib.writeHex(*p++);
if (j == 0) {
- lib.writeString("\n ");
+ if (text)
+ lib.writeString("\n ");
+ else
+ lib.writeString("\\\n");
j = 16;
}
}
@@ -368,6 +378,9 @@ qint64 RCCFileInfo::writeDataBlob(RCCResourceLibrary &lib, qint64 offset,
// done
if (text || pass1)
lib.writeString("\n ");
+ else if (python)
+ lib.writeString("\\\n");
+
return offset;
}
@@ -375,6 +388,8 @@ qint64 RCCFileInfo::writeDataName(RCCResourceLibrary &lib, qint64 offset)
{
const bool text = lib.m_format == RCCResourceLibrary::C_Code;
const bool pass1 = lib.m_format == RCCResourceLibrary::Pass1;
+ const bool python = lib.m_format == RCCResourceLibrary::Python3_Code
+ || lib.m_format == RCCResourceLibrary::Python2_Code;
// capture the offset
m_nameOffset = offset;
@@ -390,12 +405,16 @@ qint64 RCCFileInfo::writeDataName(RCCResourceLibrary &lib, qint64 offset)
lib.writeNumber2(m_name.length());
if (text || pass1)
lib.writeString("\n ");
+ else if (python)
+ lib.writeString("\\\n");
offset += 2;
// write the hash
lib.writeNumber4(qt_hash(m_name));
if (text || pass1)
lib.writeString("\n ");
+ else if (python)
+ lib.writeString("\\\n");
offset += 4;
// write the m_name
@@ -404,12 +423,17 @@ qint64 RCCFileInfo::writeDataName(RCCResourceLibrary &lib, qint64 offset)
lib.writeNumber2(unicode[i].unicode());
if ((text || pass1) && i % 16 == 0)
lib.writeString("\n ");
+ else if (python && i % 16 == 0)
+ lib.writeString("\\\n");
}
offset += m_name.length()*2;
// done
if (text || pass1)
lib.writeString("\n ");
+ else if (python)
+ lib.writeString("\\\n");
+
return offset;
}
@@ -956,21 +980,40 @@ void RCCResourceLibrary::writeDecimal(int value)
Q_ASSERT(m_format != RCCResourceLibrary::Binary);
char buf[std::numeric_limits<int>::digits10 + 2];
int n = snprintf(buf, sizeof(buf), "%d", value);
- write(buf, n + 1); // write() takes a size including terminating NUL
+ write(buf, n);
+}
+
+static const char hexDigits[] = "0123456789abcdef";
+
+inline void RCCResourceLibrary::write2HexDigits(quint8 number)
+{
+ writeChar(hexDigits[number >> 4]);
+ writeChar(hexDigits[number & 0xf]);
}
void RCCResourceLibrary::writeHex(quint8 tmp)
{
- const char digits[] = "0123456789abcdef";
- writeChar('0');
- writeChar('x');
- if (tmp < 16) {
- writeChar(digits[tmp]);
- } else {
- writeChar(digits[tmp >> 4]);
- writeChar(digits[tmp & 0xf]);
+ switch (m_format) {
+ case RCCResourceLibrary::Python3_Code:
+ case RCCResourceLibrary::Python2_Code:
+ if (tmp >= 32 && tmp < 127 && tmp != '"' && tmp != '\\') {
+ writeChar(char(tmp));
+ } else {
+ writeChar('\\');
+ writeChar('x');
+ write2HexDigits(tmp);
+ }
+ break;
+ default:
+ writeChar('0');
+ writeChar('x');
+ if (tmp < 16)
+ writeChar(hexDigits[tmp]);
+ else
+ write2HexDigits(tmp);
+ writeChar(',');
+ break;
}
- writeChar(',');
}
void RCCResourceLibrary::writeNumber2(quint16 number)
@@ -1038,7 +1081,9 @@ void RCCResourceLibrary::writeNumber8(quint64 number)
bool RCCResourceLibrary::writeHeader()
{
- if (m_format == C_Code || m_format == Pass1) {
+ switch (m_format) {
+ case C_Code:
+ case Pass1:
writeString("/****************************************************************************\n");
writeString("** Resource object code\n");
writeString("**\n");
@@ -1047,7 +1092,20 @@ bool RCCResourceLibrary::writeHeader()
writeString("\n**\n");
writeString("** WARNING! All changes made in this file will be lost!\n");
writeString( "*****************************************************************************/\n\n");
- } else if (m_format == Binary) {
+ break;
+ case Python3_Code:
+ case Python2_Code:
+ writeString("# Resource object code (Python ");
+ writeChar(m_format == Python3_Code ? '3' : '2');
+ writeString(")\n");
+ writeString("# Created by: object code\n");
+ writeString("# Created by: The Resource Compiler for Qt version ");
+ writeByteArray(QT_VERSION_STR);
+ writeString("\n");
+ writeString("# WARNING! All changes made in this file will be lost!\n\n");
+ writeString("from PySide2 import QtCore\n\n");
+ break;
+ case Binary:
writeString("qres");
writeNumber4(0);
writeNumber4(0);
@@ -1055,6 +1113,9 @@ bool RCCResourceLibrary::writeHeader()
writeNumber4(0);
if (m_formatVersion >= 3)
writeNumber4(m_overallFlags);
+ break;
+ default:
+ break;
}
return true;
}
@@ -1062,10 +1123,21 @@ bool RCCResourceLibrary::writeHeader()
bool RCCResourceLibrary::writeDataBlobs()
{
Q_ASSERT(m_errorDevice);
- if (m_format == C_Code) {
+ switch (m_format) {
+ case C_Code:
writeString("static const unsigned char qt_resource_data[] = {\n");
- } else if (m_format == Binary) {
+ break;
+ case Python3_Code:
+ writeString("qt_resource_data = b\"\\\n");
+ break;
+ case Python2_Code:
+ writeString("qt_resource_data = \"\\\n");
+ break;
+ case Binary:
m_dataOffset = m_out.size();
+ break;
+ default:
+ break;
}
if (!m_root)
@@ -1091,24 +1163,46 @@ bool RCCResourceLibrary::writeDataBlobs()
}
}
}
- if (m_format == C_Code)
+ switch (m_format) {
+ case C_Code:
writeString("\n};\n\n");
- else if (m_format == Pass1) {
+ break;
+ case Python3_Code:
+ case Python2_Code:
+ writeString("\"\n\n");
+ break;
+ case Pass1:
if (offset < 8)
offset = 8;
writeString("\nstatic const unsigned char qt_resource_data[");
writeByteArray(QByteArray::number(offset));
writeString("] = { 'Q', 'R', 'C', '_', 'D', 'A', 'T', 'A' };\n\n");
+ break;
+ default:
+ break;
}
return true;
}
bool RCCResourceLibrary::writeDataNames()
{
- if (m_format == C_Code || m_format == Pass1)
+ switch (m_format) {
+ case C_Code:
+ case Pass1:
writeString("static const unsigned char qt_resource_name[] = {\n");
- else if (m_format == Binary)
+ break;
+ case Python3_Code:
+ writeString("qt_resource_name = b\"\\\n");
+ break;
+ case Python2_Code:
+ writeString("qt_resource_name = \"\\\n");
+ break;
+ case Binary:
m_namesOffset = m_out.size();
+ break;
+ default:
+ break;
+ }
QHash<QString, int> names;
QStack<RCCFileInfo*> pending;
@@ -1133,8 +1227,18 @@ bool RCCResourceLibrary::writeDataNames()
}
}
}
- if (m_format == C_Code || m_format == Pass1)
+ switch (m_format) {
+ case C_Code:
+ case Pass1:
writeString("\n};\n\n");
+ break;
+ case Python3_Code:
+ case Python2_Code:
+ writeString("\"\n\n");
+ break;
+ default:
+ break;
+ }
return true;
}
@@ -1149,10 +1253,24 @@ struct qt_rcc_compare_hash
bool RCCResourceLibrary::writeDataStructure()
{
- if (m_format == C_Code || m_format == Pass1)
+ switch (m_format) {
+ case C_Code:
+ case Pass1:
writeString("static const unsigned char qt_resource_struct[] = {\n");
- else if (m_format == Binary)
+ break;
+ case Python3_Code:
+ writeString("qt_resource_struct = b\"\\\n");
+ break;
+ case Python2_Code:
+ writeString("qt_resource_struct = \"\\\n");
+ break;
+ case Binary:
m_treeOffset = m_out.size();
+ break;
+ default:
+ break;
+ }
+
QStack<RCCFileInfo*> pending;
if (!m_root)
@@ -1196,8 +1314,18 @@ bool RCCResourceLibrary::writeDataStructure()
pending.push(child);
}
}
- if (m_format == C_Code || m_format == Pass1)
+ switch (m_format) {
+ case C_Code:
+ case Pass1:
writeString("\n};\n\n");
+ break;
+ case Python3_Code:
+ case Python2_Code:
+ writeString("\"\n\n");
+ break;
+ default:
+ break;
+ }
return true;
}
@@ -1387,6 +1515,16 @@ bool RCCResourceLibrary::writeInitializer()
p[i++] = (m_overallFlags >> 8) & 0xff;
p[i++] = (m_overallFlags >> 0) & 0xff;
}
+ } else if (m_format == Python3_Code || m_format == Python2_Code) {
+ writeString("def qInitResources():\n");
+ writeString(" QtCore.qRegisterResourceData(0x");
+ write2HexDigits(m_formatVersion);
+ writeString(", qt_resource_struct, qt_resource_name, qt_resource_data)\n\n");
+ writeString("def qCleanupResources():\n");
+ writeString(" QtCore.qUnregisterResourceData(0x");
+ write2HexDigits(m_formatVersion);
+ writeString(", qt_resource_struct, qt_resource_name, qt_resource_data)\n\n");
+ writeString("qInitResources()\n");
}
return true;
}
diff --git a/src/tools/rcc/rcc.h b/src/tools/rcc/rcc.h
index ad1c5cd166..190c37a1f6 100644
--- a/src/tools/rcc/rcc.h
+++ b/src/tools/rcc/rcc.h
@@ -58,7 +58,7 @@ public:
bool readFiles(bool listMode, QIODevice &errorDevice);
- enum Format { Binary, C_Code, Pass1, Pass2 };
+ enum Format { Binary, C_Code, Pass1, Pass2, Python3_Code, Python2_Code };
void setFormat(Format f) { m_format = f; }
Format format() const { return m_format; }
@@ -136,12 +136,14 @@ private:
void writeAddNamespaceFunction(const QByteArray &name);
void writeDecimal(int value);
void writeHex(quint8 number);
+ void write2HexDigits(quint8 number);
void writeNumber2(quint16 number);
void writeNumber4(quint32 number);
void writeNumber8(quint64 number);
void writeChar(char c) { m_out.append(c); }
void writeByteArray(const QByteArray &);
void write(const char *, int len);
+ void writeString(const char *s) { write(s, static_cast<int>(strlen(s))); }
#if QT_CONFIG(zstd)
ZSTD_CCtx *m_zstdCCtx;
diff --git a/src/tools/tracegen/etw.cpp b/src/tools/tracegen/etw.cpp
index e839137915..acd81bd5c1 100644
--- a/src/tools/tracegen/etw.cpp
+++ b/src/tools/tracegen/etw.cpp
@@ -45,7 +45,6 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qtextstream.h>
-#include <qregexp.h>
#include <quuid.h>
static inline QString providerVar(const QString &providerName)
diff --git a/src/tools/tracegen/lttng.cpp b/src/tools/tracegen/lttng.cpp
index f0fbca9e16..1aef1b3d17 100644
--- a/src/tools/tracegen/lttng.cpp
+++ b/src/tools/tracegen/lttng.cpp
@@ -46,7 +46,6 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qtextstream.h>
-#include <qregexp.h>
#include <qdebug.h>
static void writeCtfMacro(QTextStream &stream, const Tracepoint::Field &field)
diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp
index 0ba49627c0..71e02ae9c9 100644
--- a/src/tools/uic/cpp/cppwriteincludes.cpp
+++ b/src/tools/uic/cpp/cppwriteincludes.cpp
@@ -69,7 +69,7 @@ static inline QString moduleHeader(const QString &module, const QString &header)
namespace CPP {
WriteIncludes::WriteIncludes(Uic *uic)
- : m_uic(uic), m_output(uic->output()), m_laidOut(false)
+ : m_uic(uic), m_output(uic->output())
{
// When possible (no namespace) use the "QtModule/QClass" convention
// and create a re-mapping of the old header "qclass.h" to it. Do not do this
diff --git a/src/tools/uic/cpp/cppwriteincludes.h b/src/tools/uic/cpp/cppwriteincludes.h
index e9247f4cc4..9b9ac283fe 100644
--- a/src/tools/uic/cpp/cppwriteincludes.h
+++ b/src/tools/uic/cpp/cppwriteincludes.h
@@ -40,6 +40,7 @@
QT_BEGIN_NAMESPACE
class QTextStream;
+class CustomWidgetsInfo;
class Driver;
class Uic;
@@ -74,11 +75,14 @@ struct WriteIncludes : public TreeWalker
void acceptIncludes(DomIncludes *node) override;
void acceptInclude(DomInclude *node) override;
+protected:
+ QTextStream &output() const { return m_output; }
+
private:
void add(const QString &className, bool determineHeader = true, const QString &header = QString(), bool global = false);
private:
- typedef std::set<QString> OrderedSet;
+ using OrderedSet = std::set<QString>;
void insertIncludeForClass(const QString &className, QString header = QString(), bool global = false);
void insertInclude(const QString &header, bool global);
void writeHeaders(const OrderedSet &headers, bool global);
@@ -93,11 +97,11 @@ private:
QSet<QString> m_knownClasses;
- typedef QMap<QString, QString> StringMap;
+ using StringMap = QMap<QString, QString>;
StringMap m_classToHeader;
StringMap m_oldHeaderToNewHeader;
- bool m_laidOut;
+ bool m_laidOut = false;
};
} // namespace CPP
diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp
index 2fb3e502c5..0349061089 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.cpp
+++ b/src/tools/uic/cpp/cppwriteinitialization.cpp
@@ -71,7 +71,7 @@ namespace {
// Write a statement to create a spacer item.
void writeSpacerItem(const DomSpacer *node, QTextStream &output) {
const QHash<QString, DomProperty *> properties = propertyMap(node->elementProperty());
- output << "new QSpacerItem(";
+ output << language::operatorNew << "QSpacerItem(";
int w = 0;
int h = 0;
@@ -102,11 +102,9 @@ namespace {
if (orientation == QLatin1String("Qt::Vertical") || orientation == QLatin1String("Vertical"))
isVspacer = true;
}
-
- if (isVspacer)
- output << "QSizePolicy::Minimum, " << sizeType << ')';
- else
- output << sizeType << ", QSizePolicy::Minimum)";
+ const QString horizType = isVspacer ? QLatin1String("QSizePolicy::Minimum") : sizeType;
+ const QString vertType = isVspacer ? sizeType : QLatin1String("QSizePolicy::Minimum");
+ output << language::enumValue(horizType) << ", " << language::enumValue(vertType) << ')';
}
@@ -120,7 +118,8 @@ namespace {
// Write object->setFoo(x);
template <class Value>
void writeSetter(const QString &indent, const QString &varName,const QString &setter, Value v, QTextStream &str) {
- str << indent << varName << "->" << setter << '(' << v << ");\n";
+ str << indent << varName << language::derefPointer
+ << setter << '(' << v << ')' << language::eol;
}
static inline bool iconHasStatePixmaps(const DomResourceIcon *i) {
@@ -456,22 +455,20 @@ WriteInitialization::WriteInitialization(Uic *uic) :
m_driver(uic->driver()), m_output(uic->output()), m_option(uic->option()),
m_indent(m_option.indent + m_option.indent),
m_dindent(m_indent + m_option.indent),
- m_stdsetdef(true),
- m_layoutMarginType(TopLevelMargin),
- m_mainFormUsedInRetranslateUi(false),
m_delayedOut(&m_delayedInitialization, QIODevice::WriteOnly),
m_refreshOut(&m_refreshInitialization, QIODevice::WriteOnly),
- m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly),
- m_layoutWidget(false),
- m_firstThemeIcon(true)
+ m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly)
{
}
void WriteInitialization::acceptUI(DomUI *node)
{
- m_actionGroupChain.push(0);
- m_widgetChain.push(0);
- m_layoutChain.push(0);
+ m_actionGroupChain.push(nullptr);
+ m_widgetChain.push(nullptr);
+ m_layoutChain.push(nullptr);
+
+ if (node->hasAttributeConnectslotsbyname())
+ m_connectSlotsByName = node->attributeConnectslotsbyname();
acceptLayoutDefault(node->elementLayoutDefault());
acceptLayoutFunction(node->elementLayoutFunction());
@@ -491,22 +488,21 @@ void WriteInitialization::acceptUI(DomUI *node)
const QString varName = m_driver->findOrInsertWidget(node->elementWidget());
m_mainFormVarName = varName;
- m_registeredWidgets.insert(varName, node->elementWidget()); // register the main widget
const QString widgetClassName = node->elementWidget()->attributeClass();
- m_output << m_option.indent << "void " << "setupUi(" << widgetClassName << " *" << varName << ")\n"
- << m_option.indent << "{\n";
+ const QString parameterType = widgetClassName + QLatin1String(" *");
+ m_output << m_option.indent
+ << language::startFunctionDefinition1("setupUi", parameterType, varName, m_option.indent);
const QStringList connections = m_uic->databaseInfo()->connections();
- for (int i=0; i<connections.size(); ++i) {
- QString connection = connections.at(i);
-
+ for (const auto &connection : connections) {
if (connection == QLatin1String("(default)"))
continue;
const QString varConn = connection + QLatin1String("Connection");
- m_output << m_indent << varConn << " = QSqlDatabase::database(" << fixString(connection, m_dindent) << ");\n";
+ m_output << m_indent << varConn << " = QSqlDatabase::database("
+ << language::charliteral(connection, m_dindent) << ")" << language::eol;
}
acceptWidget(node->elementWidget());
@@ -514,20 +510,16 @@ void WriteInitialization::acceptUI(DomUI *node)
if (!m_buddies.empty())
m_output << language::openQtConfig(shortcutConfigKey());
for (const Buddy &b : qAsConst(m_buddies)) {
- if (!m_registeredWidgets.contains(b.objName)) {
+ const QString buddyVarName = m_driver->widgetVariableName(b.buddyAttributeName);
+ if (buddyVarName.isEmpty()) {
fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
qPrintable(m_option.messagePrefix()),
- b.objName.toLatin1().data());
- continue;
- }
- if (!m_registeredWidgets.contains(b.buddy)) {
- fprintf(stderr, "%s: Warning: Buddy assignment: '%s' is not a valid widget.\n",
- qPrintable(m_option.messagePrefix()),
- b.buddy.toLatin1().data());
+ qPrintable(b.buddyAttributeName));
continue;
}
- m_output << m_indent << b.objName << "->setBuddy(" << b.buddy << ");\n";
+ m_output << m_indent << b.labelVarName << language::derefPointer
+ << "setBuddy(" << buddyVarName << ')' << language::eol;
}
if (!m_buddies.empty())
m_output << language::closeQtConfig(shortcutConfigKey());
@@ -538,7 +530,8 @@ void WriteInitialization::acceptUI(DomUI *node)
if (!m_delayedActionInitialization.isEmpty())
m_output << "\n" << m_delayedActionInitialization;
- m_output << "\n" << m_indent << "retranslateUi(" << varName << ");\n";
+ m_output << "\n" << m_indent << language::self
+ << "retranslateUi(" << varName << ')' << language::eol;
if (node->elementConnections())
acceptConnections(node->elementConnections());
@@ -546,22 +539,25 @@ void WriteInitialization::acceptUI(DomUI *node)
if (!m_delayedInitialization.isEmpty())
m_output << "\n" << m_delayedInitialization << "\n";
- if (m_option.autoConnection)
- m_output << "\n" << m_indent << "QMetaObject::connectSlotsByName(" << varName << ");\n";
+ if (m_option.autoConnection && m_connectSlotsByName) {
+ m_output << "\n" << m_indent << "QMetaObject" << language::qualifier
+ << "connectSlotsByName(" << varName << ')' << language::eol;
+ }
- m_output << m_option.indent << "} // setupUi\n\n";
+ m_output << m_option.indent << language::endFunctionDefinition("setupUi");
- if (!m_mainFormUsedInRetranslateUi) {
+ if (!m_mainFormUsedInRetranslateUi && language::language() == Language::Cpp) {
+ // Mark varName as unused to avoid compiler warnings.
m_refreshInitialization += m_indent;
- m_refreshInitialization += QLatin1String("Q_UNUSED(");
+ m_refreshInitialization += QLatin1String("(void)");
m_refreshInitialization += varName ;
- m_refreshInitialization += QLatin1String(");\n");
+ m_refreshInitialization += language::eol;
}
- m_output << m_option.indent << "void " << "retranslateUi(" << widgetClassName << " *" << varName << ")\n"
- << m_option.indent << "{\n"
+ m_output << m_option.indent
+ << language::startFunctionDefinition1("retranslateUi", parameterType, varName, m_option.indent)
<< m_refreshInitialization
- << m_option.indent << "} // retranslateUi\n\n";
+ << m_option.indent << language::endFunctionDefinition("retranslateUi");
m_layoutChain.pop();
m_widgetChain.pop();
@@ -584,9 +580,11 @@ void WriteInitialization::addWizardPage(const QString &pageVarName, const DomWid
}
}
if (id.isEmpty()) {
- m_output << m_indent << parentWidget << "->addPage(" << pageVarName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << "addPage(" << pageVarName << ')' << language::eol;
} else {
- m_output << m_indent << parentWidget << "->setPage(" << id << ", " << pageVarName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << "setPage(" << id << ", " << pageVarName << ')' << language::eol;
}
}
@@ -595,7 +593,6 @@ void WriteInitialization::acceptWidget(DomWidget *node)
m_layoutMarginType = m_widgetChain.count() == 1 ? TopLevelMargin : ChildMargin;
const QString className = node->attributeClass();
const QString varName = m_driver->findOrInsertWidget(node);
- m_registeredWidgets.insert(varName, node); // register the current widget
QString parentWidget, parentClass;
if (m_widgetChain.top()) {
@@ -611,8 +608,9 @@ void WriteInitialization::acceptWidget(DomWidget *node)
const auto *cwi = m_uic->customWidgetsInfo();
if (m_widgetChain.size() != 1) {
- m_output << m_indent << varName << " = new " << cwi->realClassName(className)
- << '(' << parentWidget << ");\n";
+ m_output << m_indent << varName << " = " << language::operatorNew
+ << language::fixClassName(cwi->realClassName(className))
+ << '(' << parentWidget << ')' << language::eol;
}
parentWidget = savedParentWidget;
@@ -664,26 +662,33 @@ void WriteInitialization::acceptWidget(DomWidget *node)
if (cwi->extends(parentClass, QLatin1String("QMainWindow"))) {
if (cwi->extends(className, QLatin1String("QMenuBar"))) {
- m_output << m_indent << parentWidget << "->setMenuBar(" << varName <<");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << "setMenuBar(" << varName << ')' << language::eol;
} else if (cwi->extends(className, QLatin1String("QToolBar"))) {
- m_output << m_indent << parentWidget << "->addToolBar("
- << toolBarAreaStringFromDOMAttributes(attributes) << varName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer << "addToolBar("
+ << language::enumValue(toolBarAreaStringFromDOMAttributes(attributes)) << varName
+ << ')' << language::eol;
if (const DomProperty *pbreak = attributes.value(QLatin1String("toolBarBreak"))) {
if (pbreak->elementBool() == QLatin1String("true")) {
- m_output << m_indent << parentWidget << "->insertToolBarBreak(" << varName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << "insertToolBarBreak(" << varName << ')' << language::eol;
}
}
} else if (cwi->extends(className, QLatin1String("QDockWidget"))) {
- m_output << m_indent << parentWidget << "->addDockWidget(";
- if (DomProperty *pstyle = attributes.value(QLatin1String("dockWidgetArea")))
- m_output << "Qt::" << language::dockWidgetArea(pstyle->elementNumber()) << ", ";
- m_output << varName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer << "addDockWidget(";
+ if (DomProperty *pstyle = attributes.value(QLatin1String("dockWidgetArea"))) {
+ m_output << "Qt" << language::qualifier
+ << language::dockWidgetArea(pstyle->elementNumber()) << ", ";
+ }
+ m_output << varName << ")" << language::eol;
} else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"))) {
- m_output << m_indent << parentWidget << "->setStatusBar(" << varName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << "setStatusBar(" << varName << ')' << language::eol;
} else {
- m_output << m_indent << parentWidget << "->setCentralWidget(" << varName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << "setCentralWidget(" << varName << ')' << language::eol;
}
}
@@ -692,56 +697,61 @@ void WriteInitialization::acceptWidget(DomWidget *node)
if (addPageMethod.isEmpty())
addPageMethod = cwi->simpleContainerAddPageMethod(parentClass);
if (!addPageMethod.isEmpty()) {
- m_output << m_indent << parentWidget << "->" << addPageMethod << '(' << varName << ");\n";
+ m_output << m_indent << parentWidget << language::derefPointer
+ << addPageMethod << '(' << varName << ')' << language::eol;
} else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QWizard"))) {
addWizardPage(varName, node, parentWidget);
} else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QToolBox"))) {
const DomProperty *plabel = attributes.value(QLatin1String("label"));
- DomString *plabelString = plabel ? plabel->elementString() : 0;
+ DomString *plabelString = plabel ? plabel->elementString() : nullptr;
QString icon;
if (const DomProperty *picon = attributes.value(QLatin1String("icon")))
icon = QLatin1String(", ") + iconCall(picon); // Side effect: Writes icon definition
+ m_output << m_indent << parentWidget << language::derefPointer << "addItem("
+ << varName << icon << ", " << noTrCall(plabelString, pageDefaultString)
+ << ')' << language::eol;
- m_output << m_indent << parentWidget << "->addItem(" << varName << icon
- << ", " << noTrCall(plabelString, pageDefaultString) << ");\n";
-
- autoTrOutput(plabelString, pageDefaultString) << m_indent << parentWidget << "->setItemText("
- << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(plabelString, pageDefaultString) << ");\n";
+ autoTrOutput(plabelString, pageDefaultString) << m_indent << parentWidget
+ << language::derefPointer << "setItemText(" << parentWidget
+ << language::derefPointer << "indexOf(" << varName << "), "
+ << autoTrCall(plabelString, pageDefaultString) << ')' << language::eol;
if (DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) {
autoTrOutput(ptoolTip->elementString())
<< language::openQtConfig(toolTipConfigKey())
- << m_indent << parentWidget << "->setItemToolTip(" << parentWidget
- << "->indexOf(" << varName << "), "
- << autoTrCall(ptoolTip->elementString()) << ");\n"
+ << m_indent << parentWidget << language::derefPointer << "setItemToolTip(" << parentWidget
+ << language::derefPointer << "indexOf(" << varName << "), "
+ << autoTrCall(ptoolTip->elementString()) << ')' << language::eol
<< language::closeQtConfig(toolTipConfigKey());
}
} else if (m_uic->customWidgetsInfo()->extends(parentClass, QLatin1String("QTabWidget"))) {
const DomProperty *ptitle = attributes.value(QLatin1String("title"));
- DomString *ptitleString = ptitle ? ptitle->elementString() : 0;
+ DomString *ptitleString = ptitle ? ptitle->elementString() : nullptr;
QString icon;
if (const DomProperty *picon = attributes.value(QLatin1String("icon")))
icon = QLatin1String(", ") + iconCall(picon); // Side effect: Writes icon definition
- m_output << m_indent << parentWidget << "->addTab(" << varName << icon
- << ", " << "QString());\n";
+ m_output << m_indent << parentWidget << language::derefPointer << "addTab("
+ << varName << icon << ", " << "QString())" << language::eol;
- autoTrOutput(ptitleString, pageDefaultString) << m_indent << parentWidget << "->setTabText("
- << parentWidget << "->indexOf(" << varName << "), " << autoTrCall(ptitleString, pageDefaultString) << ");\n";
+ autoTrOutput(ptitleString, pageDefaultString) << m_indent << parentWidget
+ << language::derefPointer << "setTabText(" << parentWidget
+ << language::derefPointer << "indexOf(" << varName << "), "
+ << autoTrCall(ptitleString, pageDefaultString) << ')' << language::eol;
if (const DomProperty *ptoolTip = attributes.value(QLatin1String("toolTip"))) {
autoTrOutput(ptoolTip->elementString())
<< language::openQtConfig(toolTipConfigKey())
- << m_indent << parentWidget << "->setTabToolTip(" << parentWidget
- << "->indexOf(" << varName << "), "
- << autoTrCall(ptoolTip->elementString()) << ");\n"
+ << m_indent << parentWidget << language::derefPointer << "setTabToolTip("
+ << parentWidget << language::derefPointer << "indexOf(" << varName
+ << "), " << autoTrCall(ptoolTip->elementString()) << ')' << language::eol
<< language::closeQtConfig(toolTipConfigKey());
}
if (const DomProperty *pwhatsThis = attributes.value(QLatin1String("whatsThis"))) {
autoTrOutput(pwhatsThis->elementString())
<< language::openQtConfig(whatsThisConfigKey())
- << m_indent << parentWidget << "->setTabWhatsThis(" << parentWidget
- << "->indexOf(" << varName << "), "
- << autoTrCall(pwhatsThis->elementString()) << ");\n"
+ << m_indent << parentWidget << language::derefPointer << "setTabWhatsThis("
+ << parentWidget << language::derefPointer << "indexOf(" << varName
+ << "), " << autoTrCall(pwhatsThis->elementString()) << ')' << language::eol
<< language::closeQtConfig(whatsThisConfigKey());
}
}
@@ -776,8 +786,9 @@ void WriteInitialization::acceptWidget(DomWidget *node)
headerProperties << fakeProperty;
}
}
- writeProperties(varName + QLatin1String("->header()"), QLatin1String("QHeaderView"),
- headerProperties, WritePropertyIgnoreObjectName);
+ writeProperties(varName + language::derefPointer + QLatin1String("header()"),
+ QLatin1String("QHeaderView"), headerProperties,
+ WritePropertyIgnoreObjectName);
} else if (cwi->extendsOneOf(className, tables)) {
static const QLatin1String headerPrefixes[] = {
@@ -795,8 +806,9 @@ void WriteInitialization::acceptWidget(DomWidget *node)
headerProperties << fakeProperty;
}
}
- writeProperties(varName + QLatin1String("->") + headerPrefix + QLatin1String("()"),
- QLatin1String("QHeaderView"),
+ const QString headerVar = varName + language::derefPointer
+ + headerPrefix + QLatin1String("()");
+ writeProperties(headerVar, QLatin1String("QHeaderView"),
headerProperties, WritePropertyIgnoreObjectName);
}
}
@@ -806,15 +818,15 @@ void WriteInitialization::acceptWidget(DomWidget *node)
const QStringList zOrder = node->elementZOrder();
for (const QString &name : zOrder) {
- if (!m_registeredWidgets.contains(name)) {
+ const QString varName = m_driver->widgetVariableName(name);
+ if (varName.isEmpty()) {
fprintf(stderr, "%s: Warning: Z-order assignment: '%s' is not a valid widget.\n",
qPrintable(m_option.messagePrefix()),
name.toLatin1().data());
- continue;
+ } else {
+ m_output << m_indent << varName << language::derefPointer << "raise()"
+ << language::eol;
}
-
- if (!name.isEmpty())
- m_output << m_indent << name << "->raise();\n";
}
}
@@ -829,7 +841,7 @@ void WriteInitialization::addButtonGroup(const DomWidget *buttonNode, const QStr
const DomButtonGroup *group = m_driver->findButtonGroup(attributeName);
// Legacy feature: Create missing groups on the fly as the UIC button group feature
// was present before the actual Designer support (4.5)
- const bool createGroupOnTheFly = group == 0;
+ const bool createGroupOnTheFly = group == nullptr;
if (createGroupOnTheFly) {
DomButtonGroup *newGroup = new DomButtonGroup;
newGroup->setAttributeName(attributeName);
@@ -845,11 +857,13 @@ void WriteInitialization::addButtonGroup(const DomWidget *buttonNode, const QStr
m_output << m_indent;
if (createGroupOnTheFly)
m_output << className << " *";
- m_output << groupName << " = new " << className << '(' << m_mainFormVarName << ");\n";
+ m_output << groupName << " = " << language::operatorNew
+ << className << '(' << m_mainFormVarName << ')' << language::eol;
m_buttonGroups.insert(groupName);
writeProperties(groupName, className, group->elementProperty());
}
- m_output << m_indent << groupName << "->addButton(" << varName << ");\n";
+ m_output << m_indent << groupName << language::derefPointer << "addButton("
+ << varName << ')' << language::eol;
}
void WriteInitialization::acceptLayout(DomLayout *node)
@@ -862,12 +876,12 @@ void WriteInitialization::acceptLayout(DomLayout *node)
bool isGroupBox = false;
- m_output << m_indent << varName << " = new " << className << '(';
+ m_output << m_indent << varName << " = " << language::operatorNew << className << '(';
if (!m_layoutChain.top() && !isGroupBox)
m_output << m_driver->findOrInsertWidget(m_widgetChain.top());
- m_output << ");\n";
+ m_output << ")" << language::eol;
// Suppress margin on a read child layout
const bool suppressMarginDefault = m_layoutChain.top();
@@ -883,8 +897,7 @@ void WriteInitialization::acceptLayout(DomLayout *node)
if (m_layoutWidget) {
bool left, top, right, bottom;
left = top = right = bottom = false;
- for (int i = 0; i < propList.size(); ++i) {
- const DomProperty *p = propList.at(i);
+ for (const DomProperty *p : propList) {
const QString propertyName = p->attributeName();
if (propertyName == QLatin1String("leftMargin") && p->kind() == DomProperty::Number)
left = true;
@@ -954,16 +967,19 @@ void WriteInitialization::writePropertyList(const QString &varName,
return;
const QStringList list = value.split(QLatin1Char(','));
const int count = list.count();
- for (int i = 0; i < count; i++)
- if (list.at(i) != defaultValue)
- m_output << m_indent << varName << "->" << setFunction << '(' << i << ", " << list.at(i) << ");\n";
+ for (int i = 0; i < count; i++) {
+ if (list.at(i) != defaultValue) {
+ m_output << m_indent << varName << language::derefPointer << setFunction
+ << '(' << i << ", " << list.at(i) << ')' << language::eol;
+ }
+ }
}
void WriteInitialization::acceptSpacer(DomSpacer *node)
{
m_output << m_indent << m_driver->findOrInsertSpacer(node) << " = ";
writeSpacerItem(node, m_output);
- m_output << ";\n";
+ m_output << language::eol;
}
static inline QString formLayoutRole(int column, int colspan)
@@ -1003,7 +1019,7 @@ void WriteInitialization::acceptLayoutItem(DomLayoutItem *node)
const QString layoutName = m_driver->findOrInsertLayout(layout);
const QString itemName = m_driver->findOrInsertLayoutItem(node);
- m_output << "\n" << m_indent << layoutName << "->"
+ m_output << "\n" << m_indent << layoutName << language::derefPointer << ""
<< layoutAddMethod(node->kind(), layout->attributeClass()) << '(';
if (layout->attributeClass() == QLatin1String("QGridLayout")) {
@@ -1014,18 +1030,18 @@ void WriteInitialization::acceptLayoutItem(DomLayoutItem *node)
const int colSpan = node->hasAttributeColSpan() ? node->attributeColSpan() : 1;
m_output << itemName << ", " << row << ", " << col << ", " << rowSpan << ", " << colSpan;
if (!node->attributeAlignment().isEmpty())
- m_output << ", " << node->attributeAlignment();
+ m_output << ", " << language::enumValue(node->attributeAlignment());
} else if (layout->attributeClass() == QLatin1String("QFormLayout")) {
const int row = node->attributeRow();
const int colSpan = node->hasAttributeColSpan() ? node->attributeColSpan() : 1;
const QString role = formLayoutRole(node->attributeColumn(), colSpan);
- m_output << row << ", " << role << ", " << itemName;
+ m_output << row << ", " << language::enumValue(role) << ", " << itemName;
} else {
m_output << itemName;
if (layout->attributeClass().contains(QLatin1String("Box")) && !node->attributeAlignment().isEmpty())
- m_output << ", 0, " << node->attributeAlignment();
+ m_output << ", 0, " << language::enumValue(node->attributeAlignment());
}
- m_output << ");\n\n";
+ m_output << ")" << language::eol << "\n";
}
void WriteInitialization::acceptActionGroup(DomActionGroup *node)
@@ -1036,7 +1052,8 @@ void WriteInitialization::acceptActionGroup(DomActionGroup *node)
if (m_actionGroupChain.top())
varName = m_driver->findOrInsertActionGroup(m_actionGroupChain.top());
- m_output << m_indent << actionName << " = new QActionGroup(" << varName << ");\n";
+ m_output << m_indent << actionName << " = " << language::operatorNew
+ << "QActionGroup(" << varName << ")" << language::eol;
writeProperties(actionName, QLatin1String("QActionGroup"), node->elementProperty());
m_actionGroupChain.push(node);
@@ -1050,13 +1067,13 @@ void WriteInitialization::acceptAction(DomAction *node)
return;
const QString actionName = m_driver->findOrInsertAction(node);
- m_registeredActions.insert(actionName, node);
QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
if (m_actionGroupChain.top())
varName = m_driver->findOrInsertActionGroup(m_actionGroupChain.top());
- m_output << m_indent << actionName << " = new QAction(" << varName << ");\n";
+ m_output << m_indent << actionName << " = " << language::operatorNew
+ << "QAction(" << varName << ')' << language::eol;
writeProperties(actionName, QLatin1String("QAction"), node->elementProperty());
}
@@ -1069,28 +1086,32 @@ void WriteInitialization::acceptActionRef(DomActionRef *node)
}
const QString varName = m_driver->findOrInsertWidget(m_widgetChain.top());
- const bool isSeparator = actionName == QLatin1String("separator");
- bool isMenu = false;
- if (const DomWidget *w = m_driver->widgetByName(actionName)) {
- isMenu = m_uic->isMenu(w->attributeClass());
- } else if (!(m_driver->actionByName(actionName) || isSeparator)) {
- fprintf(stderr, "%s: Warning: action `%s' not declared\n",
- qPrintable(m_option.messagePrefix()),
- actionName.toLatin1().data());
+ if (m_widgetChain.top() && actionName == QLatin1String("separator")) {
+ // separator is always reserved!
+ m_actionOut << m_indent << varName << language::derefPointer
+ << "addSeparator()" << language::eol;
return;
}
- if (m_widgetChain.top() && isSeparator) {
- // separator is always reserved!
- m_actionOut << m_indent << varName << "->addSeparator();\n";
+ const DomWidget *domWidget = m_driver->widgetByName(actionName);
+ if (domWidget && m_uic->isMenu(domWidget->attributeClass())) {
+ m_actionOut << m_indent << varName << language::derefPointer
+ << "addAction(" << m_driver->findOrInsertWidget(domWidget)
+ << language::derefPointer << "menuAction())" << language::eol;
return;
}
- if (isMenu)
- actionName += QLatin1String("->menuAction()");
+ const DomAction *domAction = m_driver->actionByName(actionName);
+ if (!domAction) {
+ fprintf(stderr, "%s: Warning: action `%s' not declared\n",
+ qPrintable(m_option.messagePrefix()), qPrintable(actionName));
+ return;
+ }
- m_actionOut << m_indent << varName << "->addAction(" << actionName << ");\n";
+ m_actionOut << m_indent << varName << language::derefPointer
+ << "addAction(" << m_driver->findOrInsertAction(domAction)
+ << ')' << language::eol;
}
QString WriteInitialization::writeStringListProperty(const DomStringList *list) const
@@ -1107,7 +1128,7 @@ QString WriteInitialization::writeStringListProperty(const DomStringList *list)
str << '\n' << m_indent << " << " << trCall(values.at(i), comment);
} else {
for (int i = 0; i < values.size(); ++i)
- str << " << QString::fromUtf8(" << fixString(values.at(i), m_dindent) << ')';
+ str << " << " << language::qstring(values.at(i), m_dindent);
}
return propertyValue;
}
@@ -1139,19 +1160,32 @@ void WriteInitialization::writeProperties(const QString &varName,
if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QAxWidget"))) {
DomPropertyMap properties = propertyMap(lst);
if (DomProperty *p = properties.value(QLatin1String("control"))) {
- m_output << m_indent << varName << "->setControl(QString::fromUtf8("
- << fixString(toString(p->elementString()), m_dindent) << "));\n";
+ m_output << m_indent << varName << language::derefPointer << "setControl("
+ << language::qstring(toString(p->elementString()), m_dindent)
+ << ')' << language::eol;
}
}
QString indent;
if (!m_widgetChain.top()) {
indent = m_option.indent;
- m_output << m_indent << "if (" << varName << "->objectName().isEmpty())\n";
+ switch (language::language()) {
+ case Language::Cpp:
+ m_output << m_indent << "if (" << varName << "->objectName().isEmpty())\n";
+ break;
+ case Language::Python:
+ m_output << m_indent << "if " << varName << ".objectName():\n";
+ break;
+ }
+ }
+ if (!(flags & WritePropertyIgnoreObjectName)) {
+ QString objectName = varName;
+ if (!language::self.isEmpty() && objectName.startsWith(language::self))
+ objectName.remove(0, language::self.size());
+ m_output << m_indent << indent
+ << varName << language::derefPointer << "setObjectName("
+ << language::qstring(objectName, m_dindent) << ')' << language::eol;
}
- if (!(flags & WritePropertyIgnoreObjectName))
- m_output << m_indent << indent << varName
- << "->setObjectName(QString::fromUtf8(" << fixString(varName, m_dindent) << "));\n";
int leftMargin, topMargin, rightMargin, bottomMargin;
leftMargin = topMargin = rightMargin = bottomMargin = -1;
@@ -1167,13 +1201,14 @@ void WriteInitialization::writeProperties(const QString &varName,
// special case for the property `geometry': Do not use position
if (isTopLevel && propertyName == QLatin1String("geometry") && p->elementRect()) {
const DomRect *r = p->elementRect();
- m_output << m_indent << varName << "->resize(" << r->elementWidth() << ", " << r->elementHeight() << ");\n";
+ m_output << m_indent << varName << language::derefPointer << "resize("
+ << r->elementWidth() << ", " << r->elementHeight() << ')' << language::eol;
continue;
}
if (propertyName == QLatin1String("currentRow") // QListWidget::currentRow
&& m_uic->customWidgetsInfo()->extends(className, QLatin1String("QListWidget"))) {
- m_delayedOut << m_indent << varName << "->setCurrentRow("
- << p->elementNumber() << ");\n";
+ m_delayedOut << m_indent << varName << language::derefPointer
+ << "setCurrentRow(" << p->elementNumber() << ')' << language::eol;
continue;
}
static const QStringList currentIndexWidgets = {
@@ -1182,14 +1217,15 @@ void WriteInitialization::writeProperties(const QString &varName,
};
if (propertyName == QLatin1String("currentIndex") // set currentIndex later
&& (m_uic->customWidgetsInfo()->extendsOneOf(className, currentIndexWidgets))) {
- m_delayedOut << m_indent << varName << "->setCurrentIndex("
- << p->elementNumber() << ");\n";
+ m_delayedOut << m_indent << varName << language::derefPointer
+ << "setCurrentIndex(" << p->elementNumber() << ')' << language::eol;
continue;
}
if (propertyName == QLatin1String("tabSpacing")
&& m_uic->customWidgetsInfo()->extends(className, QLatin1String("QToolBox"))) {
- m_delayedOut << m_indent << varName << "->layout()->setSpacing("
- << p->elementNumber() << ");\n";
+ m_delayedOut << m_indent << varName << language::derefPointer
+ << "layout()" << language::derefPointer << "setSpacing("
+ << p->elementNumber() << ')' << language::eol;
continue;
}
if (propertyName == QLatin1String("control") // ActiveQt support
@@ -1216,10 +1252,15 @@ void WriteInitialization::writeProperties(const QString &varName,
if (p->elementEnum() == QLatin1String("Qt::Vertical"))
shape = QLatin1String("QFrame::VLine");
- m_output << m_indent << varName << "->setFrameShape(" << shape << ");\n";
+ m_output << m_indent << varName << language::derefPointer << "setFrameShape("
+ << language::enumValue(shape) << ')' << language::eol;
// QFrame Default is 'Plain'. Make the line 'Sunken' unless otherwise specified
- if (!frameShadowEncountered)
- m_output << m_indent << varName << "->setFrameShadow(QFrame::Sunken);\n";
+ if (!frameShadowEncountered) {
+ m_output << m_indent << varName << language::derefPointer
+ << "setFrameShadow("
+ << language::enumValue(QLatin1String("QFrame::Sunken"))
+ << ')' << language::eol;
+ }
continue;
} else if ((flags & WritePropertyIgnoreMargin) && propertyName == QLatin1String("margin")) {
continue;
@@ -1251,25 +1292,28 @@ void WriteInitialization::writeProperties(const QString &varName,
QString setFunction;
- if (stdset) {
- setFunction = QLatin1String("->set")
- + propertyName.at(0).toUpper()
- + propertyName.midRef(1)
- + QLatin1Char('(');
- } else {
- setFunction += QLatin1String("->setProperty(\"")
- + propertyName
- + QLatin1String("\", QVariant");
- if (p->kind() == DomProperty::Enum)
- setFunction += QLatin1String("::fromValue");
- setFunction += QLatin1Char('(');
- }
+ {
+ QTextStream str(&setFunction);
+ if (stdset) {
+ str << language::derefPointer <<"set" << propertyName.at(0).toUpper()
+ << propertyName.midRef(1) << '(';
+ } else {
+ str << language::derefPointer << QLatin1String("setProperty(\"")
+ << propertyName << "\", ";
+ if (language::language() == Language::Cpp) {
+ str << "QVariant";
+ if (p->kind() == DomProperty::Enum)
+ str << "::fromValue";
+ str << '(';
+ }
+ }
+ } // QTextStream
QString varNewName = varName;
switch (p->kind()) {
case DomProperty::Bool: {
- propertyValue = p->elementBool();
+ propertyValue = language::boolValue(p->elementBool() == language::cppTrue);
break;
}
case DomProperty::Color:
@@ -1280,13 +1324,12 @@ void WriteInitialization::writeProperties(const QString &varName,
Buddy buddy = { varName, p->elementCstring() };
m_buddies.append(std::move(buddy));
} else {
- if (stdset)
- propertyValue = fixString(p->elementCstring(), m_dindent);
- else {
- propertyValue = QLatin1String("QByteArray(")
- + fixString(p->elementCstring(), m_dindent)
- + QLatin1Char(')');
- }
+ QTextStream str(&propertyValue);
+ if (!stdset)
+ str << "QByteArray(";
+ str << language::charliteral(p->elementCstring(), m_dindent);
+ if (!stdset)
+ str << ')';
}
break;
case DomProperty::Cursor:
@@ -1295,17 +1338,19 @@ void WriteInitialization::writeProperties(const QString &varName,
break;
case DomProperty::CursorShape:
if (p->hasAttributeStdset() && !p->attributeStdset())
- varNewName += QLatin1String("->viewport()");
- propertyValue = QString::fromLatin1("QCursor(Qt::%1)")
- .arg(p->elementCursorShape());
+ varNewName += language::derefPointer + QLatin1String("viewport()");
+ propertyValue = QLatin1String("QCursor(Qt") + language::qualifier
+ + p->elementCursorShape() + QLatin1Char(')');
break;
case DomProperty::Enum:
propertyValue = p->elementEnum();
- if (!propertyValue.contains(QLatin1String("::")))
- propertyValue = className + QLatin1String("::") + propertyValue;
+ if (propertyValue.contains(language::cppQualifier))
+ propertyValue = language::enumValue(propertyValue);
+ else
+ propertyValue.prepend(className + language::qualifier);
break;
case DomProperty::Set:
- propertyValue = p->elementSet();
+ propertyValue = language::enumValue(p->elementSet());
break;
case DomProperty::Font:
propertyValue = writeFontProperties(p->elementFont());
@@ -1319,8 +1364,8 @@ void WriteInitialization::writeProperties(const QString &varName,
case DomProperty::Palette: {
const DomPalette *pal = p->elementPalette();
const QString paletteName = m_driver->unique(QLatin1String("palette"));
- m_output << m_indent << "QPalette " << paletteName << ";\n";
-
+ m_output << m_indent << language::stackVariable("QPalette", paletteName)
+ << language::eol;
writeColorGroup(pal->elementActive(), QLatin1String("QPalette::Active"), paletteName);
writeColorGroup(pal->elementInactive(), QLatin1String("QPalette::Inactive"), paletteName);
writeColorGroup(pal->elementDisabled(), QLatin1String("QPalette::Disabled"), paletteName);
@@ -1356,15 +1401,16 @@ void WriteInitialization::writeProperties(const QString &varName,
}
case DomProperty::Locale: {
const DomLocale *locale = p->elementLocale();
- propertyValue = QString::fromLatin1("QLocale(QLocale::%1, QLocale::%2)")
- .arg(locale->attributeLanguage(), locale->attributeCountry());
+ QTextStream(&propertyValue) << "QLocale(QLocale" << language::qualifier
+ << locale->attributeLanguage() << ", QLocale" << language::qualifier
+ << locale->attributeCountry() << ')';
break;
}
case DomProperty::SizePolicy: {
const QString spName = writeSizePolicy( p->elementSizePolicy());
- m_output << m_indent << spName << QString::fromLatin1(
- ".setHeightForWidth(%1->sizePolicy().hasHeightForWidth());\n")
- .arg(varName);
+ m_output << m_indent << spName << ".setHeightForWidth("
+ << varName << language::derefPointer << "sizePolicy().hasHeightForWidth())"
+ << language::eol;
propertyValue = spName;
break;
@@ -1455,8 +1501,8 @@ void WriteInitialization::writeProperties(const QString &varName,
case DomProperty::Url: {
const DomUrl* u = p->elementUrl();
- propertyValue = QString::fromLatin1("QUrl(QString::fromUtf8(%1))")
- .arg(fixString(u->elementString()->text(), m_dindent));
+ QTextStream(&propertyValue) << "QUrl("
+ << language::qstring(u->elementString()->text(), m_dindent) << ")";
break;
}
case DomProperty::Brush:
@@ -1474,9 +1520,9 @@ void WriteInitialization::writeProperties(const QString &varName,
if (!configKey.isEmpty())
o << language::openQtConfig(configKey);
o << m_indent << varNewName << setFunction << propertyValue;
- if (!stdset)
+ if (!stdset && language::language() == Language::Cpp)
o << ')';
- o << ");\n";
+ o << ')' << language::eol;
if (!configKey.isEmpty())
o << language::closeQtConfig(configKey);
@@ -1488,9 +1534,9 @@ void WriteInitialization::writeProperties(const QString &varName,
}
}
if (leftMargin != -1 || topMargin != -1 || rightMargin != -1 || bottomMargin != -1) {
- m_output << m_indent << varName << "->setContentsMargins("
+ m_output << m_indent << varName << language::derefPointer << "setContentsMargins("
<< leftMargin << ", " << topMargin << ", "
- << rightMargin << ", " << bottomMargin << ");\n";
+ << rightMargin << ", " << bottomMargin << ")" << language::eol;
}
}
@@ -1509,25 +1555,20 @@ QString WriteInitialization::writeSizePolicy(const DomSizePolicy *sp)
const QString spName = m_driver->unique(QLatin1String("sizePolicy"));
m_sizePolicyNameMap.insert(sizePolicyHandle, spName);
- m_output << m_indent << "QSizePolicy " << spName;
- do {
- if (sp->hasElementHSizeType() && sp->hasElementVSizeType()) {
- m_output << "(QSizePolicy::" << language::sizePolicy(sp->elementHSizeType())
- << ", QSizePolicy::" << language::sizePolicy(sp->elementVSizeType()) << ");\n";
- break;
- }
- if (sp->hasAttributeHSizeType() && sp->hasAttributeVSizeType()) {
- m_output << "(QSizePolicy::" << sp->attributeHSizeType() << ", QSizePolicy::"
- << sp->attributeVSizeType() << ");\n";
- break;
- }
- m_output << ";\n";
- } while (false);
+ m_output << m_indent << language::stackVariableWithInitParameters("QSizePolicy", spName);
+ if (sp->hasElementHSizeType() && sp->hasElementVSizeType()) {
+ m_output << "QSizePolicy" << language::qualifier << language::sizePolicy(sp->elementHSizeType())
+ << ", QSizePolicy" << language::qualifier << language::sizePolicy(sp->elementVSizeType());
+ } else if (sp->hasAttributeHSizeType() && sp->hasAttributeVSizeType()) {
+ m_output << "QSizePolicy" << language::qualifier << sp->attributeHSizeType()
+ << ", QSizePolicy" << language::qualifier << sp->attributeVSizeType();
+ }
+ m_output << ')' << language::eol;
m_output << m_indent << spName << ".setHorizontalStretch("
- << sp->elementHorStretch() << ");\n";
+ << sp->elementHorStretch() << ")" << language::eol;
m_output << m_indent << spName << ".setVerticalStretch("
- << sp->elementVerStretch() << ");\n";
+ << sp->elementVerStretch() << ")" << language::eol;
return spName;
}
// Check for a font with the given properties in the FontPropertiesNameMap
@@ -1546,51 +1587,64 @@ QString WriteInitialization::writeFontProperties(const DomFont *f)
const QString fontName = m_driver->unique(QLatin1String("font"));
m_fontPropertiesNameMap.insert(FontHandle(f), fontName);
- m_output << m_indent << "QFont " << fontName << ";\n";
+ m_output << m_indent << language::stackVariable("QFont", fontName)
+ << language::eol;
if (f->hasElementFamily() && !f->elementFamily().isEmpty()) {
- m_output << m_indent << fontName << ".setFamily(QString::fromUtf8("
- << fixString(f->elementFamily(), m_dindent) << "));\n";
+ m_output << m_indent << fontName << ".setFamily("
+ << language::qstring(f->elementFamily(), m_dindent) << ")" << language::eol;
}
if (f->hasElementPointSize() && f->elementPointSize() > 0) {
m_output << m_indent << fontName << ".setPointSize(" << f->elementPointSize()
- << ");\n";
+ << ")" << language::eol;
}
if (f->hasElementBold()) {
m_output << m_indent << fontName << ".setBold("
- << (f->elementBold() ? "true" : "false") << ");\n";
+ << language::boolValue(f->elementBold()) << ')' << language::eol;
}
if (f->hasElementItalic()) {
m_output << m_indent << fontName << ".setItalic("
- << (f->elementItalic() ? "true" : "false") << ");\n";
+ << language::boolValue(f->elementItalic()) << ')' << language::eol;
}
if (f->hasElementUnderline()) {
m_output << m_indent << fontName << ".setUnderline("
- << (f->elementUnderline() ? "true" : "false") << ");\n";
+ << language::boolValue(f->elementUnderline()) << ')' << language::eol;
}
if (f->hasElementWeight() && f->elementWeight() > 0) {
m_output << m_indent << fontName << ".setWeight("
- << f->elementWeight() << ");" << endl;
+ << f->elementWeight() << ");" << Qt::endl;
}
if (f->hasElementStrikeOut()) {
m_output << m_indent << fontName << ".setStrikeOut("
- << (f->elementStrikeOut() ? "true" : "false") << ");\n";
+ << language::boolValue(f->elementStrikeOut()) << ')' << language::eol;
}
if (f->hasElementKerning()) {
m_output << m_indent << fontName << ".setKerning("
- << (f->elementKerning() ? "true" : "false") << ");\n";
+ << language::boolValue(f->elementKerning()) << ')' << language::eol;
}
if (f->hasElementAntialiasing()) {
- m_output << m_indent << fontName << ".setStyleStrategy("
- << (f->elementAntialiasing() ? "QFont::PreferDefault" : "QFont::NoAntialias") << ");\n";
+ m_output << m_indent << fontName << ".setStyleStrategy(QFont"
+ << language::qualifier
+ << (f->elementAntialiasing() ? "PreferDefault" : "NoAntialias")
+ << ')' << language::eol;
}
if (f->hasElementStyleStrategy()) {
- m_output << m_indent << fontName << ".setStyleStrategy(QFont::"
- << f->elementStyleStrategy() << ");\n";
+ m_output << m_indent << fontName << ".setStyleStrategy(QFont"
+ << language::qualifier << f->elementStyleStrategy() << ')' << language::eol;
}
return fontName;
}
+static void writeIconAddFile(QTextStream &output, const QString &indent,
+ const QString &iconName, const QString &fileName,
+ const char *mode, const char *state)
+{
+ output << indent << iconName << ".addFile("
+ << language::qstring(fileName, indent) << ", QSize(), QIcon"
+ << language::qualifier << mode << ", QIcon" << language::qualifier
+ << state << ')' << language::eol;
+}
+
// Post 4.4 write resource icon
static void writeResourceIcon(QTextStream &output,
const QString &iconName,
@@ -1598,91 +1652,92 @@ static void writeResourceIcon(QTextStream &output,
const DomResourceIcon *i)
{
if (i->hasElementNormalOff()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementNormalOff()->text(), indent)
- << "), QSize(), QIcon::Normal, QIcon::Off);\n";
+ writeIconAddFile(output, indent, iconName, i->elementNormalOff()->text(),
+ "Normal", "Off");
}
if (i->hasElementNormalOn()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementNormalOn()->text(), indent)
- << "), QSize(), QIcon::Normal, QIcon::On);\n";
+ writeIconAddFile(output, indent, iconName, i->elementNormalOn()->text(),
+ "Normal", "On");
}
if (i->hasElementDisabledOff()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementDisabledOff()->text(), indent)
- << "), QSize(), QIcon::Disabled, QIcon::Off);\n";
+ writeIconAddFile(output, indent, iconName, i->elementDisabledOff()->text(),
+ "Disabled", "Off");
}
if (i->hasElementDisabledOn()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementDisabledOn()->text(), indent)
- << "), QSize(), QIcon::Disabled, QIcon::On);\n";
+ writeIconAddFile(output, indent, iconName, i->elementDisabledOn()->text(),
+ "Disabled", "On");
}
if (i->hasElementActiveOff()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementActiveOff()->text(), indent)
- << "), QSize(), QIcon::Active, QIcon::Off);\n";
+ writeIconAddFile(output, indent, iconName, i->elementActiveOff()->text(),
+ "Active", "Off");
}
if (i->hasElementActiveOn()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementActiveOn()->text(), indent)
- << "), QSize(), QIcon::Active, QIcon::On);\n";
+ writeIconAddFile(output, indent, iconName, i->elementActiveOn()->text(),
+ "Active", "On");
}
if (i->hasElementSelectedOff()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementSelectedOff()->text(), indent)
- << "), QSize(), QIcon::Selected, QIcon::Off);\n";
+ writeIconAddFile(output, indent, iconName, i->elementSelectedOff()->text(),
+ "Selected", "Off");
}
if (i->hasElementSelectedOn()) {
- output << indent << iconName << ".addFile(QString::fromUtf8("
- << fixString(i->elementSelectedOn()->text(), indent)
- << "), QSize(), QIcon::Selected, QIcon::On);\n";
+ writeIconAddFile(output, indent, iconName, i->elementSelectedOn()->text(),
+ "Selected", "On");
}
}
+static void writeIconAddPixmap(QTextStream &output, const QString &indent,
+ const QString &iconName, const QString &call,
+ const char *mode, const char *state)
+{
+ output << indent << iconName << ".addPixmap(" << call << ", QIcon"
+ << language::qualifier << mode << ", QIcon" << language::qualifier
+ << state << ')' << language::eol;
+}
+
void WriteInitialization::writePixmapFunctionIcon(QTextStream &output,
const QString &iconName,
const QString &indent,
const DomResourceIcon *i) const
{
if (i->hasElementNormalOff()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementNormalOff()->text())
- << ", QIcon::Normal, QIcon::Off);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementNormalOff()->text()),
+ "Normal", "Off");
}
if (i->hasElementNormalOn()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementNormalOn()->text())
- << ", QIcon::Normal, QIcon::On);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementNormalOn()->text()),
+ "Normal", "On");
}
if (i->hasElementDisabledOff()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementDisabledOff()->text())
- << ", QIcon::Disabled, QIcon::Off);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementDisabledOff()->text()),
+ "Disabled", "Off");
}
if (i->hasElementDisabledOn()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementDisabledOn()->text())
- << ", QIcon::Disabled, QIcon::On);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementDisabledOn()->text()),
+ "Disabled", "On");
}
if (i->hasElementActiveOff()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementActiveOff()->text())
- << ", QIcon::Active, QIcon::Off);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementActiveOff()->text()),
+ "Active", "Off");
}
if (i->hasElementActiveOn()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementActiveOn()->text())
- << ", QIcon::Active, QIcon::On);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementActiveOn()->text()),
+ "Active", "On");
}
if (i->hasElementSelectedOff()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementSelectedOff()->text())
- << ", QIcon::Selected, QIcon::Off);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementSelectedOff()->text()),
+ "Selected", "Off");
}
if (i->hasElementSelectedOn()) {
- output << indent << iconName << ".addPixmap("
- << pixCall(QLatin1String("QPixmap"), i->elementSelectedOn()->text())
- << ", QIcon::Selected, QIcon::On);\n";
+ writeIconAddPixmap(output, indent, iconName,
+ pixCall(QLatin1String("QPixmap"), i->elementSelectedOn()->text()),
+ "Selected", "On");
}
}
@@ -1691,57 +1746,76 @@ QString WriteInitialization::writeIconProperties(const DomResourceIcon *i)
// check cache
const IconHandle iconHandle(i);
const IconPropertiesNameMap::const_iterator it = m_iconPropertiesNameMap.constFind(iconHandle);
- if (it != m_iconPropertiesNameMap.constEnd()) {
+ if (it != m_iconPropertiesNameMap.constEnd())
return it.value();
- }
// insert with new name
const QString iconName = m_driver->unique(QLatin1String("icon"));
m_iconPropertiesNameMap.insert(IconHandle(i), iconName);
- if (isIconFormat44(i)) {
- if (i->attributeTheme().isEmpty()) {
- // No theme: Write resource icon as is
- m_output << m_indent << "QIcon " << iconName << ";\n";
- if (m_uic->pixmapFunction().isEmpty())
- writeResourceIcon(m_output, iconName, m_indent, i);
- else
- writePixmapFunctionIcon(m_output, iconName, m_indent, i);
- } else {
- // Theme: Generate code to check the theme and default to resource
- const QString themeIconName = fixString(i->attributeTheme(), QString());
- if (iconHasStatePixmaps(i)) {
- // Theme + default state pixmaps:
- // Generate code to check the theme and default to state pixmaps
- m_output << m_indent << "QIcon " << iconName << ";\n";
- const char themeNameStringVariableC[] = "iconThemeName";
- // Store theme name in a variable
- m_output << m_indent;
- if (m_firstThemeIcon) { // Declare variable string
- m_output << "QString ";
- m_firstThemeIcon = false;
- }
- m_output << themeNameStringVariableC << " = QString::fromUtf8("
- << themeIconName << ");\n";
- m_output << m_indent << "if (QIcon::hasThemeIcon("
- << themeNameStringVariableC
- << ")) {\n"
- << m_dindent << iconName << " = QIcon::fromTheme(" << themeNameStringVariableC << ");\n"
- << m_indent << "} else {\n";
- if (m_uic->pixmapFunction().isEmpty())
- writeResourceIcon(m_output, iconName, m_dindent, i);
- else
- writePixmapFunctionIcon(m_output, iconName, m_dindent, i);
- m_output << m_indent << "}\n";
- } else {
- // Theme, but no state pixmaps: Construct from theme directly.
- m_output << m_indent << "QIcon " << iconName
- << "(QIcon::fromTheme(QString::fromUtf8("
- << themeIconName << ")));\n";
- } // Theme, but not state
- } // >= 4.4
- } else { // pre-4.4 legacy
- m_output << m_indent << "const QIcon " << iconName << " = " << pixCall(QLatin1String("QIcon"), i->text())<< ";\n";
+
+ const bool isCpp = language::language() == Language::Cpp;
+
+ if (Q_UNLIKELY(!isIconFormat44(i))) { // pre-4.4 legacy
+ m_output << m_indent;
+ if (isCpp)
+ m_output << "const QIcon ";
+ m_output << iconName << " = " << pixCall(QLatin1String("QIcon"), i->text())
+ << language::eol;
+ return iconName;
}
+
+ // 4.4 onwards
+ if (i->attributeTheme().isEmpty()) {
+ // No theme: Write resource icon as is
+ m_output << m_indent << language::stackVariable("QIcon", iconName)
+ << language::eol;
+ if (m_uic->pixmapFunction().isEmpty())
+ writeResourceIcon(m_output, iconName, m_indent, i);
+ else
+ writePixmapFunctionIcon(m_output, iconName, m_indent, i);
+ return iconName;
+ }
+
+ // Theme: Generate code to check the theme and default to resource
+ if (iconHasStatePixmaps(i)) {
+ // Theme + default state pixmaps:
+ // Generate code to check the theme and default to state pixmaps
+ m_output << m_indent << language::stackVariable("QIcon", iconName) << language::eol;
+ const char themeNameStringVariableC[] = "iconThemeName";
+ // Store theme name in a variable
+ m_output << m_indent;
+ if (m_firstThemeIcon) { // Declare variable string
+ if (isCpp)
+ m_output << "QString ";
+ m_firstThemeIcon = false;
+ }
+ m_output << themeNameStringVariableC << " = "
+ << language::qstring(i->attributeTheme()) << language::eol;
+ m_output << m_indent << "if ";
+ if (isCpp)
+ m_output << '(';
+ m_output << "QIcon" << language::qualifier << "hasThemeIcon("
+ << themeNameStringVariableC << ')' << (isCpp ? ") {" : ":") << '\n'
+ << m_dindent << iconName << " = QIcon" << language::qualifier << "fromTheme("
+ << themeNameStringVariableC << ')' << language::eol
+ << m_indent << (isCpp ? "} else {" : "else:") << '\n';
+ if (m_uic->pixmapFunction().isEmpty())
+ writeResourceIcon(m_output, iconName, m_dindent, i);
+ else
+ writePixmapFunctionIcon(m_output, iconName, m_dindent, i);
+ m_output << m_indent;
+ if (isCpp)
+ m_output << '}';
+ m_output << '\n';
+ return iconName;
+ }
+
+ // Theme, but no state pixmaps: Construct from theme directly.
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QIcon", iconName)
+ << "QIcon" << language::qualifier << "fromTheme("
+ << language::qstring(i->attributeTheme()) << "))"
+ << language::eol;
return iconName;
}
@@ -1777,9 +1851,9 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
const DomColor *color = colors.at(i);
m_output << m_indent << paletteName << ".setColor(" << group
- << ", QPalette::" << language::paletteColorRole(i)
+ << ", QPalette" << language::qualifier << language::paletteColorRole(i)
<< ", " << domColor2QString(color)
- << ");\n";
+ << ")" << language::eol;
}
// new format
@@ -1794,9 +1868,10 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri
<< versionAdded.majorVersion() << ", " << versionAdded.minorVersion()
<< ", " << versionAdded.microVersion() << ")\n";
}
- m_output << m_indent << paletteName << ".setBrush(" << group
- << ", " << "QPalette::" << roleName
- << ", " << brushName << ");\n";
+ m_output << m_indent << paletteName << ".setBrush("
+ << language::enumValue(group) << ", "
+ << "QPalette" << language::qualifier << roleName
+ << ", " << brushName << ")" << language::eol;
if (!versionAdded.isNull())
m_output << "#endif\n";
}
@@ -1842,31 +1917,36 @@ void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brush
const QString gradientType = gradient->attributeType();
const QString gradientName = m_driver->unique(QLatin1String("gradient"));
if (gradientType == QLatin1String("LinearGradient")) {
- m_output << m_indent << "QLinearGradient " << gradientName
- << '(' << gradient->attributeStartX()
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QLinearGradient", gradientName)
+ << gradient->attributeStartX()
<< ", " << gradient->attributeStartY()
<< ", " << gradient->attributeEndX()
- << ", " << gradient->attributeEndY() << ");\n";
+ << ", " << gradient->attributeEndY() << ')' << language::eol;
} else if (gradientType == QLatin1String("RadialGradient")) {
- m_output << m_indent << "QRadialGradient " << gradientName
- << '(' << gradient->attributeCentralX()
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QRadialGradient", gradientName)
+ << gradient->attributeCentralX()
<< ", " << gradient->attributeCentralY()
<< ", " << gradient->attributeRadius()
<< ", " << gradient->attributeFocalX()
- << ", " << gradient->attributeFocalY() << ");\n";
+ << ", " << gradient->attributeFocalY() << ')' << language::eol;
} else if (gradientType == QLatin1String("ConicalGradient")) {
- m_output << m_indent << "QConicalGradient " << gradientName
- << '(' << gradient->attributeCentralX()
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QConicalGradient", gradientName)
+ << gradient->attributeCentralX()
<< ", " << gradient->attributeCentralY()
- << ", " << gradient->attributeAngle() << ");\n";
+ << ", " << gradient->attributeAngle() << ')' << language::eol;
}
- m_output << m_indent << gradientName << ".setSpread(QGradient::"
- << gradient->attributeSpread() << ");\n";
+ m_output << m_indent << gradientName << ".setSpread(QGradient"
+ << language::qualifier << gradient->attributeSpread()
+ << ')' << language::eol;
if (gradient->hasAttributeCoordinateMode()) {
- m_output << m_indent << gradientName << ".setCoordinateMode(QGradient::"
- << gradient->attributeCoordinateMode() << ");\n";
+ m_output << m_indent << gradientName << ".setCoordinateMode(QGradient"
+ << language::qualifier << gradient->attributeCoordinateMode()
+ << ')' << language::eol;
}
const auto &stops = gradient->elementGradientStop();
@@ -1874,23 +1954,26 @@ void WriteInitialization::writeBrush(const DomBrush *brush, const QString &brush
const DomColor *color = stop->elementColor();
m_output << m_indent << gradientName << ".setColorAt("
<< stop->attributePosition() << ", "
- << domColor2QString(color) << ");\n";
+ << domColor2QString(color) << ')' << language::eol;
}
- m_output << m_indent << "QBrush " << brushName << '('
- << gradientName << ");\n";
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QBrush", brushName)
+ << gradientName << ')' << language::eol;
} else if (style == QLatin1String("TexturePattern")) {
const DomProperty *property = brush->elementTexture();
const QString iconValue = iconCall(property);
- m_output << m_indent << "QBrush " << brushName << " = QBrush("
- << iconValue << ");\n";
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QBrush", brushName)
+ << iconValue << ')' << language::eol;
} else {
const DomColor *color = brush->elementColor();
- m_output << m_indent << "QBrush " << brushName << '('
- << domColor2QString(color) << ");\n";
+ m_output << m_indent
+ << language::stackVariableWithInitParameters("QBrush", brushName)
+ << domColor2QString(color) << ')' << language::eol;
m_output << m_indent << brushName << ".setStyle("
- << "Qt::" << style << ");\n";
+ << language::qtQualifier << style << ')' << language::eol;
}
}
@@ -1910,12 +1993,11 @@ void WriteInitialization::acceptTabStops(DomTabStops *tabStops)
const QStringList l = tabStops->elementTabStop();
for (int i=0; i<l.size(); ++i) {
- const QString &name = l.at(i);
+ const QString name = m_driver->widgetVariableName(l.at(i));
- if (!m_registeredWidgets.contains(name)) {
+ if (name.isEmpty()) {
fprintf(stderr, "%s: Warning: Tab-stop assignment: '%s' is not a valid widget.\n",
- qPrintable(m_option.messagePrefix()),
- name.toLatin1().data());
+ qPrintable(m_option.messagePrefix()), qPrintable(l.at(i)));
continue;
}
@@ -1926,7 +2008,8 @@ void WriteInitialization::acceptTabStops(DomTabStops *tabStops)
if (name.isEmpty() || lastName.isEmpty())
continue;
- m_output << m_indent << "QWidget::setTabOrder(" << lastName << ", " << name << ");\n";
+ m_output << m_indent << "QWidget" << language::qualifier << "setTabOrder("
+ << lastName << ", " << name << ')' << language::eol;
lastName = name;
}
@@ -1968,15 +2051,14 @@ QString WriteInitialization::pixCall(const QString &t, const QString &text) cons
return type;
}
+ QTextStream str(&type);
+ str << '(';
QString pixFunc = m_uic->pixmapFunction();
if (pixFunc.isEmpty())
- pixFunc = QLatin1String("QString::fromUtf8");
-
- type += QLatin1Char('(')
- + pixFunc
- + QLatin1Char('(')
- + fixString(text, m_dindent)
- + QLatin1String("))");
+ str << language::qstring(text, m_dindent);
+ else
+ str << pixFunc << '(' << language::charliteral(text, m_dindent) << ')';
+ str << ')';
return type;
}
@@ -1999,15 +2081,17 @@ void WriteInitialization::initializeComboBox(DomWidget *w)
if (icon)
iconValue = iconCall(icon);
- m_output << m_indent << varName << "->addItem(";
+ m_output << m_indent << varName << language::derefPointer << "addItem(";
if (icon)
m_output << iconValue << ", ";
if (needsTranslation(text->elementString())) {
- m_output << "QString());\n";
- m_refreshOut << m_indent << varName << "->setItemText(" << i << ", " << trCall(text->elementString()) << ");\n";
+ m_output << "QString())" << language::eol;
+ m_refreshOut << m_indent << varName << language::derefPointer
+ << "setItemText(" << i << ", " << trCall(text->elementString())
+ << ')' << language::eol;
} else {
- m_output << noTrCall(text->elementString()) << ");\n";
+ m_output << noTrCall(text->elementString()) << ")" << language::eol;
}
}
m_refreshOut << "\n";
@@ -2020,9 +2104,13 @@ QString WriteInitialization::disableSorting(DomWidget *w, const QString &varName
if (!w->elementItem().isEmpty()) {
tempName = m_driver->unique(QLatin1String("__sortingEnabled"));
m_refreshOut << "\n";
- m_refreshOut << m_indent << "const bool " << tempName
- << " = " << varName << "->isSortingEnabled();\n";
- m_refreshOut << m_indent << varName << "->setSortingEnabled(false);\n";
+ m_refreshOut << m_indent;
+ if (language::language() == Language::Cpp)
+ m_refreshOut << "const bool ";
+ m_refreshOut << tempName << " = " << varName << language::derefPointer
+ << "isSortingEnabled()" << language::eol
+ << m_indent << varName << language::derefPointer
+ << "setSortingEnabled(" << language::boolValue(false) << ')' << language::eol;
}
return tempName;
}
@@ -2030,7 +2118,8 @@ QString WriteInitialization::disableSorting(DomWidget *w, const QString &varName
void WriteInitialization::enableSorting(DomWidget *w, const QString &varName, const QString &tempName)
{
if (!w->elementItem().isEmpty()) {
- m_refreshOut << m_indent << varName << "->setSortingEnabled(" << tempName << ");\n\n";
+ m_refreshOut << m_indent << varName << language::derefPointer
+ << "setSortingEnabled(" << tempName << ')' << language::eol << '\n';
}
}
@@ -2055,7 +2144,7 @@ void WriteInitialization::addInitializer(Item *item,
if (!value.isEmpty()) {
QString setter;
QTextStream str(&setter);
- str << "->set" << name.at(0).toUpper() << name.midRef(1) << '(';
+ str << language::derefPointer << "set" << name.at(0).toUpper() << name.midRef(1) << '(';
if (column >= 0)
str << column << ", ";
str << value << ");";
@@ -2105,10 +2194,11 @@ void WriteInitialization::addQtFlagsInitializer(Item *item,
const DomPropertyMap &properties, const QString &name, int column) const
{
if (const DomProperty *p = properties.value(name)) {
+ const QString orOperator = QLatin1Char('|') + language::qtQualifier;
QString v = p->elementSet();
if (!v.isEmpty()) {
- v.replace(QLatin1Char('|'), QLatin1String("|Qt::"));
- addInitializer(item, name, column, QLatin1String("Qt::") + v);
+ v.replace(QLatin1Char('|'), orOperator);
+ addInitializer(item, name, column, language::qtQualifier + v);
}
}
}
@@ -2123,7 +2213,7 @@ void WriteInitialization::addQtEnumInitializer(Item *item,
if (const DomProperty *p = properties.value(name)) {
QString v = p->elementEnum();
if (!v.isEmpty())
- addInitializer(item, name, column, QLatin1String("Qt::") + v);
+ addInitializer(item, name, column, language::qtQualifier + v);
}
}
@@ -2172,7 +2262,9 @@ void WriteInitialization::initializeListWidget(DomWidget *w)
addCommonInitializers(&item, properties);
item.writeSetupUi(varName);
- item.writeRetranslateUi(varName + QLatin1String("->item(") + QString::number(i) + QLatin1Char(')'));
+ QString parentPath;
+ QTextStream(&parentPath) << varName << language::derefPointer << "item(" << i << ')';
+ item.writeRetranslateUi(parentPath);
}
enableSorting(w, varName, tempName);
}
@@ -2193,14 +2285,19 @@ void WriteInitialization::initializeTreeWidget(DomWidget *w)
if (const DomProperty *p = properties.value(QLatin1String("text"))) {
DomString *str = p->elementString();
- if (str && str->text().isEmpty())
- m_output << m_indent << varName << "->headerItem()->setText(" << i << ", QString());\n";
+ if (str && str->text().isEmpty()) {
+ m_output << m_indent << varName << language::derefPointer
+ << "headerItem()" << language::derefPointer << "setText("
+ << i << ", QString())" << language::eol;
+ }
}
}
const QString itemName = item.writeSetupUi(QString(), Item::DontConstruct);
- item.writeRetranslateUi(varName + QLatin1String("->headerItem()"));
- if (!itemName.isNull())
- m_output << m_indent << varName << "->setHeaderItem(" << itemName << ");\n";
+ item.writeRetranslateUi(varName + language::derefPointer + QLatin1String("headerItem()"));
+ if (!itemName.isNull()) {
+ m_output << m_indent << varName << language::derefPointer
+ << "setHeaderItem(" << itemName << ')' << language::eol;
+ }
if (w->elementItem().empty())
return;
@@ -2211,7 +2308,9 @@ void WriteInitialization::initializeTreeWidget(DomWidget *w)
for (int i = 0; i < items.count(); i++) {
Item *itm = items[i];
itm->writeSetupUi(varName);
- itm->writeRetranslateUi(varName + QLatin1String("->topLevelItem(") + QString::number(i) + QLatin1Char(')'));
+ QString parentPath;
+ QTextStream(&parentPath) << varName << language::derefPointer << "topLevelItem(" << i << ')';
+ itm->writeRetranslateUi(parentPath);
delete itm;
}
@@ -2273,8 +2372,10 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
const auto &columns = w->elementColumn();
if (!columns.empty()) {
- m_output << m_indent << "if (" << varName << "->columnCount() < " << columns.size() << ")\n"
- << m_dindent << varName << "->setColumnCount(" << columns.size() << ");\n";
+ m_output << m_indent << "if (" << varName << language::derefPointer << "columnCount() < "
+ << columns.size() << ")\n"
+ << m_dindent << varName << language::derefPointer << "setColumnCount("
+ << columns.size() << ')' << language::eol;
}
for (int i = 0; i < columns.size(); ++i) {
@@ -2286,8 +2387,12 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
addCommonInitializers(&item, properties);
QString itemName = item.writeSetupUi(QString(), Item::ConstructItemAndVariable);
- item.writeRetranslateUi(varName + QLatin1String("->horizontalHeaderItem(") + QString::number(i) + QLatin1Char(')'));
- m_output << m_indent << varName << "->setHorizontalHeaderItem(" << i << ", " << itemName << ");\n";
+ QString parentPath;
+ QTextStream(&parentPath) << varName << language::derefPointer
+ << "horizontalHeaderItem(" << i << ')';
+ item.writeRetranslateUi(parentPath);
+ m_output << m_indent << varName << language::derefPointer << "setHorizontalHeaderItem("
+ << i << ", " << itemName << ')' << language::eol;
}
}
@@ -2295,8 +2400,9 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
const auto &rows = w->elementRow();
if (!rows.isEmpty()) {
- m_output << m_indent << "if (" << varName << "->rowCount() < " << rows.size() << ")\n"
- << m_dindent << varName << "->setRowCount(" << rows.size() << ");\n";
+ m_output << m_indent << "if (" << varName << language::derefPointer << "rowCount() < " << rows.size() << ")\n"
+ << m_dindent << varName << language::derefPointer << "setRowCount("
+ << rows.size() << ')' << language::eol;
}
for (int i = 0; i < rows.size(); ++i) {
@@ -2308,8 +2414,11 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
addCommonInitializers(&item, properties);
QString itemName = item.writeSetupUi(QString(), Item::ConstructItemAndVariable);
- item.writeRetranslateUi(varName + QLatin1String("->verticalHeaderItem(") + QString::number(i) + QLatin1Char(')'));
- m_output << m_indent << varName << "->setVerticalHeaderItem(" << i << ", " << itemName << ");\n";
+ QString parentPath;
+ QTextStream(&parentPath) << varName << language::derefPointer << "verticalHeaderItem(" << i << ')';
+ item.writeRetranslateUi(parentPath);
+ m_output << m_indent << varName << language::derefPointer << "setVerticalHeaderItem("
+ << i << ", " << itemName << ')' << language::eol;
}
}
@@ -2329,8 +2438,12 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
addCommonInitializers(&item, properties);
QString itemName = item.writeSetupUi(QString(), Item::ConstructItemAndVariable);
- item.writeRetranslateUi(varName + QLatin1String("->item(") + QString::number(r) + QLatin1String(", ") + QString::number(c) + QLatin1Char(')'));
- m_output << m_indent << varName << "->setItem(" << r << ", " << c << ", " << itemName << ");\n";
+ QString parentPath;
+ QTextStream(&parentPath) << varName << language::derefPointer << "item(" << r
+ << ", " << c << ')';
+ item.writeRetranslateUi(parentPath);
+ m_output << m_indent << varName << language::derefPointer << "setItem("
+ << r << ", " << c << ", " << itemName << ')' << language::eol;
}
}
enableSorting(w, varName, tempName);
@@ -2338,32 +2451,37 @@ void WriteInitialization::initializeTableWidget(DomWidget *w)
QString WriteInitialization::trCall(const QString &str, const QString &commentHint, const QString &id) const
{
- if (str.isEmpty())
- return QLatin1String("QString()");
+ if (str.isEmpty()) {
+ return language::language() == Language::Cpp
+ ? QLatin1String("QString()") : QLatin1String("\"\"");
+ }
QString result;
- const QString comment = commentHint.isEmpty() ? QString(QLatin1String("nullptr")) : fixString(commentHint, m_dindent);
+ QTextStream ts(&result);
const bool idBasedTranslations = m_driver->useIdBasedTranslations();
if (m_option.translateFunction.isEmpty()) {
if (idBasedTranslations || m_option.idBased) {
- result += QLatin1String("qtTrId(");
+ ts << "qtTrId(";
} else {
- result += QLatin1String("QCoreApplication::translate(\"")
- + m_generatedClass
- + QLatin1String("\", ");
+ ts << "QCoreApplication" << language::qualifier << "translate("
+ << '"' << m_generatedClass << "\", ";
}
} else {
- result += m_option.translateFunction + QLatin1Char('(');
+ ts << m_option.translateFunction << '(';
}
- result += fixString(idBasedTranslations ? id : str, m_dindent);
+ ts << language::charliteral(idBasedTranslations ? id : str, m_dindent);
if (!idBasedTranslations && !m_option.idBased) {
- result += QLatin1String(", ") + comment;
+ ts << ", ";
+ if (commentHint.isEmpty())
+ ts << language::nullPtr;
+ else
+ ts << language::charliteral(commentHint, m_dindent);
}
- result += QLatin1Char(')');
+ ts << ')';
return result;
}
@@ -2374,7 +2492,8 @@ void WriteInitialization::initializeMenu(DomWidget *w, const QString &/*parentWi
const DomAction *action = m_driver->actionByName(menuAction);
if (action && action->hasAttributeMenu()) {
- m_output << m_indent << menuAction << " = " << menuName << "->menuAction();\n";
+ m_output << m_indent << menuAction << " = " << menuName
+ << language::derefPointer << "menuAction()" << language::eol;
}
}
@@ -2398,9 +2517,9 @@ QString WriteInitialization::noTrCall(DomString *str, const QString &defaultStri
return QString();
if (str)
value = str->text();
- QString ret = QLatin1String("QString::fromUtf8(");
- ret += fixString(value, m_dindent);
- ret += QLatin1Char(')');
+ QString ret;
+ QTextStream ts(&ret);
+ ts << language::qstring(value, m_dindent);
return ret;
}
@@ -2428,36 +2547,42 @@ QTextStream &WriteInitialization::autoTrOutput(const DomString *str, const QStri
return m_output;
}
-QString WriteInitialization::findDeclaration(const QString &name)
+WriteInitialization::Declaration WriteInitialization::findDeclaration(const QString &name)
{
- const QString normalized = Driver::normalizedName(name);
-
- if (const DomWidget *widget = m_driver->widgetByName(normalized))
- return m_driver->findOrInsertWidget(widget);
- if (const DomAction *action = m_driver->actionByName(normalized))
- return m_driver->findOrInsertAction(action);
- if (const DomButtonGroup *group = m_driver->findButtonGroup(normalized))
- return m_driver->findOrInsertButtonGroup(group);
- return QString();
+ if (const DomWidget *widget = m_driver->widgetByName(name))
+ return {m_driver->findOrInsertWidget(widget), widget->attributeClass()};
+ if (const DomAction *action = m_driver->actionByName(name))
+ return {m_driver->findOrInsertAction(action), QStringLiteral("QAction")};
+ if (const DomButtonGroup *group = m_driver->findButtonGroup(name))
+ return {m_driver->findOrInsertButtonGroup(group), QStringLiteral("QButtonGroup")};
+ return {};
}
void WriteInitialization::acceptConnection(DomConnection *connection)
{
- const QString sender = findDeclaration(connection->elementSender());
- const QString receiver = findDeclaration(connection->elementReceiver());
+ const QString senderName = connection->elementSender();
+ const QString receiverName = connection->elementReceiver();
- if (sender.isEmpty() || receiver.isEmpty())
+ const auto senderDecl = findDeclaration(senderName);
+ const auto receiverDecl = findDeclaration(receiverName);
+
+ if (senderDecl.name.isEmpty() || receiverDecl.name.isEmpty()) {
+ QString message;
+ QTextStream(&message) << m_option.messagePrefix()
+ << ": Warning: Invalid signal/slot connection: \""
+ << senderName << "\" -> \"" << receiverName << "\".";
+ fprintf(stderr, "%s\n", qPrintable(message));
return;
+ }
- m_output << m_indent << "QObject::connect("
- << sender
- << ", "
- << "SIGNAL("<<connection->elementSignal()<<')'
- << ", "
- << receiver
- << ", "
- << "SLOT("<<connection->elementSlot()<<')'
- << ");\n";
+ language::SignalSlot theSignal{senderDecl.name, connection->elementSignal(),
+ senderDecl.className};
+ language::SignalSlot theSlot{receiverDecl.name, connection->elementSlot(),
+ receiverDecl.className};
+
+ m_output << m_indent;
+ language::formatConnection(m_output, theSignal, theSlot);
+ m_output << language::eol;
}
static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet<QString> &directives)
@@ -2470,14 +2595,14 @@ static void generateMultiDirectiveBegin(QTextStream &outputStream, const QSet<QS
return;
}
- auto list = directives.toList();
+ auto list = directives.values();
// sort (always generate in the same order):
std::sort(list.begin(), list.end());
outputStream << "#if " << language::qtConfig(list.constFirst());
for (int i = 1, size = list.size(); i < size; ++i)
outputStream << " || " << language::qtConfig(list.at(i));
- outputStream << endl;
+ outputStream << Qt::endl;
}
static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSet<QString> &directives)
@@ -2485,12 +2610,11 @@ static void generateMultiDirectiveEnd(QTextStream &outputStream, const QSet<QStr
if (directives.isEmpty())
return;
- outputStream << "#endif" << endl;
+ outputStream << "#endif" << Qt::endl;
}
WriteInitialization::Item::Item(const QString &itemClassName, const QString &indent, QTextStream &setupUiStream, QTextStream &retranslateUiStream, Driver *driver)
:
- m_parent(0),
m_itemClassName(itemClassName),
m_indent(indent),
m_setupUiStream(setupUiStream),
@@ -2513,7 +2637,8 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp
bool generateMultiDirective = false;
if (emptyItemPolicy == Item::ConstructItemOnly && m_children.isEmpty()) {
if (m_setupUiData.policy == ItemData::DontGenerate) {
- m_setupUiStream << m_indent << "new " << m_itemClassName << '(' << parent << ");\n";
+ m_setupUiStream << m_indent << language::operatorNew << m_itemClassName
+ << '(' << parent << ')' << language::eol;
return QString();
}
if (m_setupUiData.policy == ItemData::GenerateWithMultiDirective)
@@ -2524,11 +2649,17 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp
generateMultiDirectiveBegin(m_setupUiStream, m_setupUiData.directives);
const QString uniqueName = m_driver->unique(QLatin1String("__") + m_itemClassName.toLower());
- m_setupUiStream << m_indent << m_itemClassName << " *" << uniqueName << " = new " << m_itemClassName << '(' << parent << ");\n";
+ m_setupUiStream << m_indent;
+ if (language::language() == Language::Cpp)
+ m_setupUiStream << m_itemClassName << " *";
+ m_setupUiStream << uniqueName
+ << " = " << language::operatorNew << m_itemClassName << '(' << parent
+ << ')' << language::eol;
if (generateMultiDirective) {
m_setupUiStream << "#else\n";
- m_setupUiStream << m_indent << "new " << m_itemClassName << '(' << parent << ");\n";
+ m_setupUiStream << m_indent << language::operatorNew << m_itemClassName
+ << '(' << parent << ')' << language::eol;
generateMultiDirectiveEnd(m_setupUiStream, m_setupUiData.directives);
}
@@ -2536,7 +2667,7 @@ QString WriteInitialization::Item::writeSetupUi(const QString &parent, Item::Emp
while (it != m_setupUiData.setters.constEnd()) {
if (!it.key().isEmpty())
m_setupUiStream << language::openQtConfig(it.key());
- m_setupUiStream << m_indent << uniqueName << it.value() << endl;
+ m_setupUiStream << m_indent << uniqueName << it.value() << Qt::endl;
if (!it.key().isEmpty())
m_setupUiStream << language::closeQtConfig(it.key());
++it;
@@ -2555,7 +2686,10 @@ void WriteInitialization::Item::writeRetranslateUi(const QString &parentPath)
generateMultiDirectiveBegin(m_retranslateUiStream, m_retranslateUiData.directives);
const QString uniqueName = m_driver->unique(QLatin1String("___") + m_itemClassName.toLower());
- m_retranslateUiStream << m_indent << m_itemClassName << " *" << uniqueName << " = " << parentPath << ";\n";
+ m_retranslateUiStream << m_indent;
+ if (language::language() == Language::Cpp)
+ m_retranslateUiStream << m_itemClassName << " *";
+ m_retranslateUiStream << uniqueName << " = " << parentPath << language::eol;
if (m_retranslateUiData.policy == ItemData::GenerateWithMultiDirective)
generateMultiDirectiveEnd(m_retranslateUiStream, m_retranslateUiData.directives);
@@ -2571,14 +2705,17 @@ void WriteInitialization::Item::writeRetranslateUi(const QString &parentPath)
m_retranslateUiStream << language::openQtConfig(newDirective);
oldDirective = newDirective;
}
- m_retranslateUiStream << m_indent << uniqueName << it.value() << endl;
+ m_retranslateUiStream << m_indent << uniqueName << it.value() << Qt::endl;
++it;
}
if (!oldDirective.isEmpty())
m_retranslateUiStream << language::closeQtConfig(oldDirective);
- for (int i = 0; i < m_children.size(); i++)
- m_children[i]->writeRetranslateUi(uniqueName + QLatin1String("->child(") + QString::number(i) + QLatin1Char(')'));
+ for (int i = 0; i < m_children.size(); i++) {
+ QString method;
+ QTextStream(&method) << uniqueName << language::derefPointer << "child(" << i << ')';
+ m_children[i]->writeRetranslateUi(method);
+ }
}
void WriteInitialization::Item::addSetter(const QString &setter, const QString &directive, bool translatable)
diff --git a/src/tools/uic/cpp/cppwriteinitialization.h b/src/tools/uic/cpp/cppwriteinitialization.h
index c408c44b40..6f8e352f6a 100644
--- a/src/tools/uic/cpp/cppwriteinitialization.h
+++ b/src/tools/uic/cpp/cppwriteinitialization.h
@@ -85,8 +85,8 @@ namespace CPP {
struct WriteInitialization : public TreeWalker
{
- typedef QList<DomProperty*> DomPropertyList;
- typedef QHash<QString, DomProperty*> DomPropertyMap;
+ using DomPropertyList = QList<DomProperty*>;
+ using DomPropertyMap = QHash<QString, DomProperty*>;
WriteInitialization(Uic *uic);
@@ -161,7 +161,7 @@ private:
// special initialization
//
class Item {
- Q_DISABLE_COPY(Item)
+ Q_DISABLE_COPY_MOVE(Item)
public:
Item(const QString &itemClassName, const QString &indent, QTextStream &setupUiStream, QTextStream &retranslateUiStream, Driver *driver);
~Item();
@@ -188,7 +188,7 @@ private:
ItemData m_setupUiData;
ItemData m_retranslateUiData;
QList<Item *> m_children;
- Item *m_parent;
+ Item *m_parent = nullptr;
const QString m_itemClassName;
const QString m_indent;
@@ -220,7 +220,13 @@ private:
QString disableSorting(DomWidget *w, const QString &varName);
void enableSorting(DomWidget *w, const QString &varName, const QString &tempName);
- QString findDeclaration(const QString &name);
+ struct Declaration
+ {
+ QString name;
+ QString className;
+ };
+
+ Declaration findDeclaration(const QString &name);
private:
QString writeFontProperties(const DomFont *f);
@@ -238,12 +244,12 @@ private:
const Option &m_option;
QString m_indent;
QString m_dindent;
- bool m_stdsetdef;
+ bool m_stdsetdef = true;
struct Buddy
{
- QString objName;
- QString buddy;
+ QString labelVarName;
+ QString buddyAttributeName;
};
friend class QTypeInfo<Buddy>;
@@ -253,15 +259,13 @@ private:
QVector<Buddy> m_buddies;
QSet<QString> m_buttonGroups;
- QHash<QString, DomWidget*> m_registeredWidgets;
- QHash<QString, DomAction*> m_registeredActions;
- typedef QHash<uint, QString> ColorBrushHash;
+ using ColorBrushHash = QHash<uint, QString>;
ColorBrushHash m_colorBrushHash;
// Map from font properties to font variable name for reuse
// Map from size policy to variable for reuse
- typedef QMap<FontHandle, QString> FontPropertiesNameMap;
- typedef QMap<IconHandle, QString> IconPropertiesNameMap;
- typedef QMap<SizePolicyHandle, QString> SizePolicyNameMap;
+ using FontPropertiesNameMap = QMap<FontHandle, QString>;
+ using IconPropertiesNameMap = QMap<IconHandle, QString>;
+ using SizePolicyNameMap = QMap<SizePolicyHandle, QString>;
FontPropertiesNameMap m_fontPropertiesNameMap;
IconPropertiesNameMap m_iconPropertiesNameMap;
SizePolicyNameMap m_sizePolicyNameMap;
@@ -290,11 +294,11 @@ private:
// layout defaults
LayoutDefaultHandler m_LayoutDefaultHandler;
- int m_layoutMarginType;
+ int m_layoutMarginType = TopLevelMargin;
QString m_generatedClass;
QString m_mainFormVarName;
- bool m_mainFormUsedInRetranslateUi;
+ bool m_mainFormUsedInRetranslateUi = false;
QString m_delayedInitialization;
QTextStream m_delayedOut;
@@ -305,8 +309,9 @@ private:
QString m_delayedActionInitialization;
QTextStream m_actionOut;
- bool m_layoutWidget;
- bool m_firstThemeIcon;
+ bool m_layoutWidget = false;
+ bool m_firstThemeIcon = true;
+ bool m_connectSlotsByName = true;
};
} // namespace CPP
diff --git a/src/tools/uic/customwidgetsinfo.cpp b/src/tools/uic/customwidgetsinfo.cpp
index d6a409152b..c838feaf73 100644
--- a/src/tools/uic/customwidgetsinfo.cpp
+++ b/src/tools/uic/customwidgetsinfo.cpp
@@ -95,7 +95,7 @@ bool CustomWidgetsInfo::extendsOneOf(const QString &classNameIn,
bool CustomWidgetsInfo::isCustomWidgetContainer(const QString &className) const
{
- if (const DomCustomWidget *dcw = m_customWidgets.value(className, 0))
+ if (const DomCustomWidget *dcw = m_customWidgets.value(className, nullptr))
if (dcw->hasElementContainer())
return dcw->elementContainer() != 0;
return false;
@@ -111,7 +111,7 @@ QString CustomWidgetsInfo::realClassName(const QString &className) const
QString CustomWidgetsInfo::customWidgetAddPageMethod(const QString &name) const
{
- if (DomCustomWidget *dcw = m_customWidgets.value(name, 0))
+ if (DomCustomWidget *dcw = m_customWidgets.value(name, nullptr))
return dcw->elementAddPageMethod();
return QString();
}
diff --git a/src/tools/uic/customwidgetsinfo.h b/src/tools/uic/customwidgetsinfo.h
index 8a10999027..a1b24ab042 100644
--- a/src/tools/uic/customwidgetsinfo.h
+++ b/src/tools/uic/customwidgetsinfo.h
@@ -62,7 +62,7 @@ public:
bool isCustomWidgetContainer(const QString &className) const;
private:
- typedef QMap<QString, DomCustomWidget*> NameCustomWidgetMap;
+ using NameCustomWidgetMap = QMap<QString, DomCustomWidget*>;
NameCustomWidgetMap m_customWidgets;
};
diff --git a/src/tools/uic/databaseinfo.cpp b/src/tools/uic/databaseinfo.cpp
index fa5d5f5df0..9b0d1614ab 100644
--- a/src/tools/uic/databaseinfo.cpp
+++ b/src/tools/uic/databaseinfo.cpp
@@ -33,9 +33,7 @@
QT_BEGIN_NAMESPACE
-DatabaseInfo::DatabaseInfo()
-{
-}
+DatabaseInfo::DatabaseInfo() = default;
void DatabaseInfo::acceptUI(DomUI *node)
{
@@ -59,10 +57,9 @@ void DatabaseInfo::acceptWidget(DomWidget *node)
DomProperty *db = properties.value(QLatin1String("database"));
if (db && db->elementStringList()) {
QStringList info = db->elementStringList()->elementString();
-
- QString connection = info.size() > 0 ? info.at(0) : QString();
- if (connection.isEmpty())
+ if (info.isEmpty() || info.constFirst().isEmpty())
return;
+ const QString &connection = info.constFirst();
m_connections.append(connection);
QString table = info.size() > 1 ? info.at(1) : QString();
diff --git a/src/tools/uic/driver.cpp b/src/tools/uic/driver.cpp
index 03fa1e17cf..8b9b4806e6 100644
--- a/src/tools/uic/driver.cpp
+++ b/src/tools/uic/driver.cpp
@@ -30,6 +30,8 @@
#include "uic.h"
#include "ui4.h"
+#include <language.h>
+
#include <qfileinfo.h>
#include <qdebug.h>
@@ -51,18 +53,43 @@ static inline QString actionClass() { return QStringLiteral("QAction"); }
static inline QString buttonGroupClass() { return QStringLiteral("QButtonGroup"); }
template <class DomClass>
+Driver::DomObjectHashConstIt<DomClass>
+ Driver::findByAttributeNameIt(const DomObjectHash<DomClass> &domHash,
+ const QString &name) const
+{
+ const auto end = domHash.cend();
+ for (auto it = domHash.cbegin(); it != end; ++it) {
+ if (it.key()->attributeName() == name)
+ return it;
+ }
+ return end;
+}
+
+template <class DomClass>
+const DomClass *Driver::findByAttributeName(const DomObjectHash<DomClass> &domHash,
+ const QString &name) const
+{
+ auto it = findByAttributeNameIt(domHash, name);
+ return it != domHash.cend() ? it.key() : nullptr;
+}
+
+template <class DomClass>
QString Driver::findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom,
- const QString &className)
+ const QString &className, bool isMember)
{
auto it = domHash->find(dom);
- if (it == domHash->end())
- it = domHash->insert(dom, this->unique(dom->attributeName(), className));
+ if (it == domHash->end()) {
+ const QString name = this->unique(dom->attributeName(), className);
+ it = domHash->insert(dom, isMember ? language::self + name : name);
+ }
return it.value();
}
QString Driver::findOrInsertWidget(const DomWidget *ui_widget)
{
- return findOrInsert(&m_widgets, ui_widget, ui_widget->attributeClass());
+ // Top level is passed into setupUI(), everything else is a member variable
+ const bool isMember = !m_widgets.isEmpty();
+ return findOrInsert(&m_widgets, ui_widget, ui_widget->attributeClass(), isMember);
}
QString Driver::findOrInsertSpacer(const DomSpacer *ui_spacer)
@@ -111,11 +138,7 @@ QString Driver::findOrInsertButtonGroup(const DomButtonGroup *ui_group)
// Find a group by its non-uniqified name
const DomButtonGroup *Driver::findButtonGroup(const QString &attributeName) const
{
- for (auto it = m_buttonGroups.cbegin(), end = m_buttonGroups.cend(); it != end; ++it) {
- if (it.key()->attributeName() == attributeName)
- return it.key();
- }
- return nullptr;
+ return findByAttributeName(m_buttonGroups, attributeName);
}
@@ -233,7 +256,7 @@ bool Driver::uic(const QString &fileName, DomUI *ui, QTextStream *out)
QTextStream *oldOutput = m_output;
- m_output = out != 0 ? out : &m_stdout;
+ m_output = out != nullptr ? out : &m_stdout;
Uic tool(this);
const bool result = tool.write(ui);
@@ -286,19 +309,25 @@ bool Driver::uic(const QString &fileName, QTextStream *out)
return rtn;
}
-const DomWidget *Driver::widgetByName(const QString &name) const
+const DomWidget *Driver::widgetByName(const QString &attributeName) const
+{
+ return findByAttributeName(m_widgets, attributeName);
+}
+
+QString Driver::widgetVariableName(const QString &attributeName) const
{
- return m_widgets.key(name);
+ auto it = findByAttributeNameIt(m_widgets, attributeName);
+ return it != m_widgets.cend() ? it.value() : QString();
}
-const DomActionGroup *Driver::actionGroupByName(const QString &name) const
+const DomActionGroup *Driver::actionGroupByName(const QString &attributeName) const
{
- return m_actionGroups.key(name);
+ return findByAttributeName(m_actionGroups, attributeName);
}
-const DomAction *Driver::actionByName(const QString &name) const
+const DomAction *Driver::actionByName(const QString &attributeName) const
{
- return m_actions.key(name);
+ return findByAttributeName(m_actions, attributeName);
}
QT_END_NAMESPACE
diff --git a/src/tools/uic/driver.h b/src/tools/uic/driver.h
index 1303d0bf8a..45ec23b4aa 100644
--- a/src/tools/uic/driver.h
+++ b/src/tools/uic/driver.h
@@ -56,8 +56,8 @@ public:
// tools
bool printDependencies(const QString &fileName);
- bool uic(const QString &fileName, QTextStream *output = 0);
- bool uic(const QString &fileName, DomUI *ui, QTextStream *output = 0);
+ bool uic(const QString &fileName, QTextStream *output = nullptr);
+ bool uic(const QString &fileName, DomUI *ui, QTextStream *output = nullptr);
// configuration
inline QTextStream &output() const { return *m_output; }
@@ -84,18 +84,28 @@ public:
// Find a group by its non-uniqified name
const DomButtonGroup *findButtonGroup(const QString &attributeName) const;
- const DomWidget *widgetByName(const QString &name) const;
- const DomActionGroup *actionGroupByName(const QString &name) const;
- const DomAction *actionByName(const QString &name) const;
+ const DomWidget *widgetByName(const QString &attributeName) const;
+ QString widgetVariableName(const QString &attributeName) const;
+ const DomActionGroup *actionGroupByName(const QString &attributeName) const;
+ const DomAction *actionByName(const QString &attributeName) const;
bool useIdBasedTranslations() const { return m_idBasedTranslations; }
void setUseIdBasedTranslations(bool u) { m_idBasedTranslations = u; }
private:
template <class DomClass> using DomObjectHash = QHash<const DomClass *, QString>;
+ template <class DomClass> using DomObjectHashConstIt =
+ typename DomObjectHash<DomClass>::ConstIterator;
template <class DomClass>
- QString findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom, const QString &className);
+ DomObjectHashConstIt<DomClass> findByAttributeNameIt(const DomObjectHash<DomClass> &domHash,
+ const QString &name) const;
+ template <class DomClass>
+ const DomClass *findByAttributeName(const DomObjectHash<DomClass> &domHash,
+ const QString &name) const;
+ template <class DomClass>
+ QString findOrInsert(DomObjectHash<DomClass> *domHash, const DomClass *dom, const QString &className,
+ bool isMember = true);
Option m_option;
QTextStream m_stdout;
diff --git a/src/tools/uic/main.cpp b/src/tools/uic/main.cpp
index 0516b854ff..9cf22d502d 100644
--- a/src/tools/uic/main.cpp
+++ b/src/tools/uic/main.cpp
@@ -29,6 +29,7 @@
#include "uic.h"
#include "option.h"
#include "driver.h"
+#include <language.h>
#include <qfile.h>
#include <qdir.h>
@@ -67,6 +68,10 @@ int runUic(int argc, char *argv[])
outputOption.setValueName(QStringLiteral("file"));
parser.addOption(outputOption);
+ QCommandLineOption noAutoConnectionOption(QStringList() << QStringLiteral("a") << QStringLiteral("no-autoconnection"));
+ noAutoConnectionOption.setDescription(QStringLiteral("Do not generate a call to QObject::connectSlotsByName()."));
+ parser.addOption(noAutoConnectionOption);
+
QCommandLineOption noProtOption(QStringList() << QStringLiteral("p") << QStringLiteral("no-protection"));
noProtOption.setDescription(QStringLiteral("Disable header protection."));
parser.addOption(noProtOption);
@@ -96,7 +101,7 @@ int runUic(int argc, char *argv[])
QCommandLineOption generatorOption(QStringList() << QStringLiteral("g") << QStringLiteral("generator"));
generatorOption.setDescription(QStringLiteral("Select generator."));
- generatorOption.setValueName(QStringLiteral("java|cpp"));
+ generatorOption.setValueName(QStringLiteral("python|cpp"));
parser.addOption(generatorOption);
QCommandLineOption idBasedOption(QStringLiteral("idbased"));
@@ -109,6 +114,7 @@ int runUic(int argc, char *argv[])
driver.option().dependencies = parser.isSet(dependenciesOption);
driver.option().outputFile = parser.value(outputOption);
+ driver.option().autoConnection = !parser.isSet(noAutoConnectionOption);
driver.option().headerProtection = !parser.isSet(noProtOption);
driver.option().implicitIncludes = !parser.isSet(noImplicitIncludesOption);
driver.option().idBased = parser.isSet(idBasedOption);
@@ -116,6 +122,13 @@ int runUic(int argc, char *argv[])
driver.option().translateFunction = parser.value(translateOption);
driver.option().includeFile = parser.value(includeOption);
+ Language language = Language::Cpp;
+ if (parser.isSet(generatorOption)) {
+ if (parser.value(generatorOption).compare(QLatin1String("python")) == 0)
+ language = Language::Python;
+ }
+ language::setLanguage(language);
+
if (parser.isSet(noStringLiteralOption))
fprintf(stderr, "The -s, --no-stringliteral option is deprecated and it won't take any effect.\n");
@@ -129,7 +142,7 @@ int runUic(int argc, char *argv[])
return !driver.printDependencies(inputFile);
}
- QTextStream *out = 0;
+ QTextStream *out = nullptr;
QFile f;
if (!driver.option().outputFile.isEmpty()) {
f.setFileName(driver.option().outputFile);
diff --git a/src/tools/uic/python/python.pri b/src/tools/uic/python/python.pri
new file mode 100644
index 0000000000..4dd31160a1
--- /dev/null
+++ b/src/tools/uic/python/python.pri
@@ -0,0 +1,8 @@
+INCLUDEPATH += $$PWD
+
+# Input
+HEADERS += $$PWD/pythonwritedeclaration.h \
+ $$PWD/pythonwriteimports.h
+
+SOURCES += $$PWD/pythonwritedeclaration.cpp \
+ $$PWD/pythonwriteimports.cpp
diff --git a/src/tools/uic/python/pythonwritedeclaration.cpp b/src/tools/uic/python/pythonwritedeclaration.cpp
new file mode 100644
index 0000000000..5122b18e23
--- /dev/null
+++ b/src/tools/uic/python/pythonwritedeclaration.cpp
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "pythonwritedeclaration.h"
+#include <cppwriteinitialization.h>
+#include <language.h>
+#include <driver.h>
+#include <ui4.h>
+#include <uic.h>
+
+#include <QtCore/qtextstream.h>
+#include <QtCore/qdebug.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace Python {
+
+WriteDeclaration::WriteDeclaration(Uic *uic) :
+ m_uic(uic),
+ m_driver(uic->driver()),
+ m_output(uic->output()),
+ m_option(uic->option())
+{
+}
+
+void WriteDeclaration::acceptUI(DomUI *node)
+{
+ // remove any left-over C++ namespaces
+ const QString qualifiedClassName = QLatin1String("Ui_") + node->elementClass()
+ + m_option.postfix;
+ m_output << "class " << language::fixClassName(qualifiedClassName) << "(object):\n";
+
+ TreeWalker::acceptWidget(node->elementWidget());
+ if (const DomButtonGroups *domButtonGroups = node->elementButtonGroups())
+ acceptButtonGroups(domButtonGroups);
+ CPP::WriteInitialization(m_uic).acceptUI(node);
+}
+
+// Register button groups to prevent the on-the-fly creation legacy
+// feature from triggering
+void WriteDeclaration::acceptButtonGroup(const DomButtonGroup *buttonGroup)
+{
+ m_driver->findOrInsertButtonGroup(buttonGroup);
+}
+
+} // namespace Python
+
+QT_END_NAMESPACE
diff --git a/src/tools/uic/python/pythonwritedeclaration.h b/src/tools/uic/python/pythonwritedeclaration.h
new file mode 100644
index 0000000000..a8d50b6fbf
--- /dev/null
+++ b/src/tools/uic/python/pythonwritedeclaration.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PYTHONWRITEDECLARATION_H
+#define PYTHONWRITEDECLARATION_H
+
+#include <treewalker.h>
+
+QT_BEGIN_NAMESPACE
+
+class QTextStream;
+class Driver;
+class Uic;
+
+struct Option;
+
+namespace Python {
+
+struct WriteDeclaration : public TreeWalker
+{
+ WriteDeclaration(Uic *uic);
+
+ void acceptUI(DomUI *node) override;
+ void acceptButtonGroup(const DomButtonGroup *buttonGroup) override;
+
+private:
+ Uic *m_uic;
+ Driver *m_driver;
+ QTextStream &m_output;
+ const Option &m_option;
+};
+
+} // namespace Python
+
+QT_END_NAMESPACE
+
+#endif // PYTHONWRITEDECLARATION_H
diff --git a/src/tools/uic/python/pythonwriteimports.cpp b/src/tools/uic/python/pythonwriteimports.cpp
new file mode 100644
index 0000000000..303615f77b
--- /dev/null
+++ b/src/tools/uic/python/pythonwriteimports.cpp
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "pythonwriteimports.h"
+
+#include <customwidgetsinfo.h>
+#include <uic.h>
+
+#include <ui4.h>
+
+#include <QtCore/qtextstream.h>
+
+QT_BEGIN_NAMESPACE
+
+static const char *standardImports =
+R"I(from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
+ QRect, QSize, QUrl, Qt)
+from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QFont,
+ QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
+ QRadialGradient)
+from PySide2.QtWidgets import *
+)I";
+
+namespace Python {
+
+WriteImports::WriteImports(Uic *uic) : m_uic(uic)
+{
+}
+
+void WriteImports::acceptUI(DomUI *node)
+{
+ auto &output = m_uic->output();
+ output << standardImports << '\n';
+ if (auto customWidgets = node->elementCustomWidgets()) {
+ TreeWalker::acceptCustomWidgets(customWidgets);
+ output << '\n';
+ }
+}
+
+QString WriteImports::qtModuleOf(const DomCustomWidget *node) const
+{
+ if (m_uic->customWidgetsInfo()->extends(node->elementClass(), QLatin1String("QAxWidget")))
+ return QStringLiteral("QtAxContainer");
+ if (const auto headerElement = node->elementHeader()) {
+ const auto &header = headerElement->text();
+ if (header.startsWith(QLatin1String("Qt"))) {
+ const int slash = header.indexOf(QLatin1Char('/'));
+ if (slash != -1)
+ return header.left(slash);
+ }
+ }
+ return QString();
+}
+
+void WriteImports::acceptCustomWidget(DomCustomWidget *node)
+{
+ const auto &className = node->elementClass();
+ if (className.contains(QLatin1String("::")))
+ return; // Exclude namespaced names (just to make tests pass).
+ const QString &qtModule = qtModuleOf(node);
+ auto &output = m_uic->output();
+ if (!qtModule.isEmpty())
+ output << "from PySide2." << qtModule << ' ';
+ output << "import " << className << '\n';
+}
+
+} // namespace Python
+
+QT_END_NAMESPACE
diff --git a/src/tools/uic/python/pythonwriteimports.h b/src/tools/uic/python/pythonwriteimports.h
new file mode 100644
index 0000000000..427cbb48b1
--- /dev/null
+++ b/src/tools/uic/python/pythonwriteimports.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef PYTHONWRITEIMPORTS_H
+#define PYTHONWRITEIMPORTS_H
+
+#include <treewalker.h>
+
+QT_BEGIN_NAMESPACE
+
+class Uic;
+
+namespace Python {
+
+struct WriteImports : public TreeWalker
+{
+public:
+ explicit WriteImports(Uic *uic);
+
+ void acceptUI(DomUI *node) override;
+ void acceptCustomWidget(DomCustomWidget *node) override;
+
+private:
+ QString qtModuleOf(const DomCustomWidget *node) const;
+
+ Uic *const m_uic;
+};
+
+} // namespace Python
+
+QT_END_NAMESPACE
+
+#endif // PYTHONWRITEIMPORTS_H
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index 8e1afa0878..8cebe65a00 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -249,7 +249,7 @@ QT_CLASS_LIB(QLatin1String, QtCore, qstring.h)
QT_CLASS_LIB(QCharRef, QtCore, qstring.h)
QT_CLASS_LIB(QConstString, QtCore, qstring.h)
QT_CLASS_LIB(QStringRef, QtCore, qstring.h)
-QT_CLASS_LIB(QLatin1Literal, QtCore, qstringbuilder.h)
+QT_CLASS_LIB(QLatin1Literal, QtCore, qstring.h)
QT_CLASS_LIB(QAbstractConcatenable, QtCore, qstringbuilder.h)
QT_CLASS_LIB(QConcatenable, QtCore, qstringbuilder.h)
QT_CLASS_LIB(QStringBuilder, QtCore, qstringbuilder.h)
diff --git a/src/tools/uic/shared/language.cpp b/src/tools/uic/shared/language.cpp
index 730e1562bc..235a8ed2fc 100644
--- a/src/tools/uic/shared/language.cpp
+++ b/src/tools/uic/shared/language.cpp
@@ -32,6 +32,50 @@
namespace language {
+static Encoding encoding = Encoding::Utf8;
+static Language _language = Language::Cpp;
+
+Language language() { return _language; }
+
+void setLanguage(Language l)
+{
+ _language = l;
+ switch (_language) {
+ case Language::Cpp:
+ derefPointer = QLatin1String("->");
+ nullPtr = QLatin1String("nullptr");
+ operatorNew = QLatin1String("new ");
+ qtQualifier = QLatin1String("Qt::");
+ qualifier = QLatin1String("::");
+ self = QLatin1String(""); // for testing: change to "this->";
+ eol = QLatin1String(";\n");
+ encoding = Encoding::Utf8;
+ break;
+ case Language::Python:
+ derefPointer = QLatin1String(".");
+ nullPtr = QLatin1String("None");
+ operatorNew = QLatin1String("");
+ qtQualifier = QLatin1String("Qt.");
+ qualifier = QLatin1String(".");
+ self = QLatin1String("self.");
+ eol = QLatin1String("\n");
+ encoding = Encoding::Unicode;
+ break;
+ }
+}
+
+QString derefPointer;
+QString nullPtr;
+QString operatorNew;
+QString qtQualifier;
+QString qualifier;
+QString self;
+QString eol;
+
+QString cppQualifier = QLatin1String("::");
+QString cppTrue = QLatin1String("true");
+QString cppFalse = QLatin1String("false");
+
QTextStream &operator<<(QTextStream &str, const qtConfig &c)
{
str << "QT_CONFIG(" << c.parameter() << ')';
@@ -69,6 +113,13 @@ const char *lookupEnum(const EnumLookup(&array)[N], int value, int defaultIndex
return defaultValue;
}
+QString fixClassName(QString className)
+{
+ if (language() == Language::Python)
+ className.replace(cppQualifier, QLatin1String("_"));
+ return className;
+}
+
const char *toolbarArea(int v)
{
static const EnumLookup toolBarAreas[] =
@@ -141,4 +192,235 @@ const char *paletteColorRole(int v)
return lookupEnum(colorRoles, v);
}
+// Helpers for formatting a character sequences
+
+// Format a special character like '\x0a'
+static int formatEscapedNumber(QTextStream &str, ushort value, int base, int width,
+ char prefix = 0)
+{
+ int length = 1 + width;
+ str << '\\';
+ if (prefix) {
+ str << prefix;
+ ++length;
+ }
+ const auto oldPadChar = str.padChar();
+ const auto oldFieldWidth = str.fieldWidth();
+ const auto oldFieldAlignment = str.fieldAlignment();
+ const auto oldIntegerBase = str.integerBase();
+ str.setPadChar(QLatin1Char('0'));
+ str.setFieldWidth(width);
+ str.setFieldAlignment(QTextStream::AlignRight);
+ str.setIntegerBase(base);
+ str << value;
+ str.setIntegerBase(oldIntegerBase);
+ str.setFieldAlignment(oldFieldAlignment);
+ str.setFieldWidth(oldFieldWidth);
+ str.setPadChar(oldPadChar);
+ return length;
+}
+
+static int formatSpecialCharacter(QTextStream &str, ushort value)
+{
+ int length = 0;
+ switch (value) {
+ case '\\':
+ str << "\\\\";
+ length += 2;
+ break;
+ case '\"':
+ str << "\\\"";
+ length += 2;
+ break;
+ case '\n':
+ str << "\\n\"\n\"";
+ length += 5;
+ break;
+ default:
+ break;
+ }
+ return length;
+}
+
+// Format a sequence of characters for C++ with special characters numerically
+// escaped (non-raw string literals), wrappped at maxSegmentSize. FormattingTraits
+// are used to transform characters into (unsigned) codes, which can be used
+// for either normal escapes or Unicode code points as used in Unicode literals.
+
+enum : int { maxSegmentSize = 1024 };
+
+template <Encoding e>
+struct FormattingTraits
+{
+};
+
+template <>
+struct FormattingTraits<Encoding::Utf8>
+{
+ static ushort code(char c) { return uchar(c); }
+};
+
+template <>
+struct FormattingTraits<Encoding::Unicode>
+{
+ static ushort code(QChar c) { return c.unicode(); }
+};
+
+template <Encoding e, class Iterator>
+static void formatStringSequence(QTextStream &str, Iterator it, Iterator end,
+ const QString &indent,
+ int escapeIntegerBase, int escapeWidth,
+ char escapePrefix = 0)
+{
+ str << '"';
+ int length = 0;
+ while (it != end) {
+ const auto code = FormattingTraits<e>::code(*it);
+ if (code >= 0x80) {
+ length += formatEscapedNumber(str, code, escapeIntegerBase, escapeWidth, escapePrefix);
+ } else if (const int l = formatSpecialCharacter(str, code)) {
+ length += l;
+ } else if (code != '\r') {
+ str << *it;
+ ++length;
+ }
+ ++it;
+ if (it != end && length > maxSegmentSize) {
+ str << "\"\n" << indent << indent << '"';
+ length = 0;
+ }
+ }
+ str << '"';
+}
+
+void _formatString(QTextStream &str, const QString &value, const QString &indent,
+ bool qString)
+{
+ switch (encoding) {
+ // Special characters as 3 digit octal escapes (u8"\303\234mlaut")
+ case Encoding::Utf8: {
+ if (qString && _language == Language::Cpp)
+ str << "QString::fromUtf8(";
+ const QByteArray utf8 = value.toUtf8();
+ formatStringSequence<Encoding::Utf8>(str, utf8.cbegin(), utf8.cend(), indent,
+ 8, 3);
+ if (qString && _language == Language::Cpp)
+ str << ')';
+ }
+ break;
+ // Special characters as 4 digit hex Unicode points (u8"\u00dcmlaut")
+ case Encoding::Unicode:
+ str << 'u'; // Python Unicode literal (would be UTF-16 in C++)
+ formatStringSequence<Encoding::Unicode>(str, value.cbegin(), value.cend(), indent,
+ 16, 4, 'u');
+ break;
+ }
+}
+
+QTextStream &operator<<(QTextStream &str, const repeat &r)
+{
+ for (int i = 0; i < r.m_count; ++i)
+ str << r.m_char;
+ return str;
+}
+
+startFunctionDefinition1::startFunctionDefinition1(const char *name, const QString &parameterType,
+ const QString &parameterName,
+ const QString &indent,
+ const char *returnType) :
+ m_name(name), m_parameterType(parameterType), m_parameterName(parameterName),
+ m_indent(indent), m_return(returnType)
+{
+}
+
+QTextStream &operator<<(QTextStream &str, const startFunctionDefinition1 &f)
+{
+ switch (language()) {
+ case Language::Cpp:
+ str << (f.m_return ? f.m_return : "void") << ' ' << f.m_name << '('
+ << f.m_parameterType;
+ if (f.m_parameterType.cend()->isLetter())
+ str << ' ';
+ str << f.m_parameterName << ')' << '\n' << f.m_indent << "{\n";
+ break;
+ case Language::Python:
+ str << "def " << f.m_name << "(self, " << f.m_parameterName << "):\n";
+ break;
+ }
+ return str;
+}
+
+endFunctionDefinition::endFunctionDefinition(const char *name) : m_name(name)
+{
+}
+
+QTextStream &operator<<(QTextStream &str, const endFunctionDefinition &f)
+{
+ switch (language()) {
+ case Language::Cpp:
+ str << "} // " << f.m_name << "\n\n";
+ break;
+ case Language::Python:
+ str << "# " << f.m_name << "\n\n";
+ break;
+ }
+ return str;
+}
+
+void _formatStackVariable(QTextStream &str, const char *className, QStringView varName,
+ bool withInitParameters)
+{
+ switch (language()) {
+ case Language::Cpp:
+ str << className << ' ' << varName;
+ if (withInitParameters)
+ str << '(';
+ break;
+ case Language::Python:
+ str << varName << " = " << className << '(';
+ if (!withInitParameters)
+ str << ')';
+ break;
+ }
+}
+
+void formatConnection(QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver)
+{
+ switch (language()) {
+ case Language::Cpp:
+ str << "QObject::connect(" << sender.name << ", SIGNAL("<< sender.signature
+ << "), " << receiver.name << ", SLOT("<< receiver.signature << "))";
+ break;
+ case Language::Python:
+ str << sender.name << '.'
+ << sender.signature.leftRef(sender.signature.indexOf(QLatin1Char('(')))
+ << ".connect(" << receiver.name << '.'
+ << receiver.signature.leftRef(receiver.signature.indexOf(QLatin1Char('(')))
+ << ')';
+ break;
+ }
+}
+
+QString boolValue(bool v)
+{
+ switch (language()) {
+ case Language::Cpp:
+ return v ? cppTrue : cppFalse;
+ case Language::Python:
+ return v ? QStringLiteral("True") : QStringLiteral("False");
+ }
+ Q_UNREACHABLE();
+}
+
+static inline QString dot() { return QStringLiteral("."); }
+
+QString enumValue(const QString &value)
+{
+ if (language() == Language::Cpp || !value.contains(cppQualifier))
+ return value;
+ QString fixed = value;
+ fixed.replace(cppQualifier, dot());
+ return fixed;
+}
+
} // namespace language
diff --git a/src/tools/uic/shared/language.h b/src/tools/uic/shared/language.h
index e7201b6529..fc8af9715b 100644
--- a/src/tools/uic/shared/language.h
+++ b/src/tools/uic/shared/language.h
@@ -29,12 +29,31 @@
#ifndef LANGUAGE_H
#define LANGUAGE_H
+#include <QtCore/qstring.h>
#include <QtCore/qstringview.h>
+#include <QtCore/qstring.h>
QT_FORWARD_DECLARE_CLASS(QTextStream)
+enum class Language { Cpp, Python };
+
namespace language {
+Language language();
+void setLanguage(Language);
+
+extern QString derefPointer;
+extern QString nullPtr;
+extern QString operatorNew;
+extern QString qtQualifier;
+extern QString qualifier;
+extern QString self;
+extern QString eol;
+
+extern QString cppQualifier;
+extern QString cppTrue;
+extern QString cppFalse;
+
// Base class for streamable objects with one QStringView parameter
class StringViewStreamable
{
@@ -71,11 +90,119 @@ public:
QTextStream &operator<<(QTextStream &, const closeQtConfig &c);
+QString fixClassName(QString className);
+
const char *toolbarArea(int v);
const char *sizePolicy(int v);
const char *dockWidgetArea(int v);
const char *paletteColorRole(int v);
+enum class Encoding { Utf8, Unicode };
+
+void _formatString(QTextStream &str, const QString &value, const QString &indent,
+ bool qString);
+
+template <bool AsQString>
+class _string
+{
+public:
+ explicit _string(const QString &value, const QString &indent = QString())
+ : m_value(value), m_indent(indent) {}
+
+ void format(QTextStream &str) const
+ { _formatString(str, m_value, m_indent, AsQString); }
+
+private:
+ const QString &m_value;
+ const QString &m_indent;
+};
+
+template <bool AsQString>
+inline QTextStream &operator<<(QTextStream &str, const language::_string<AsQString> &s)
+{
+ s.format(str);
+ return str;
+}
+
+using charliteral = _string<false>;
+using qstring = _string<true>;
+
+class repeat {
+public:
+ explicit repeat(int count, char c) : m_count(count), m_char(c) {}
+
+ friend QTextStream &operator<<(QTextStream &str, const repeat &r);
+
+private:
+ const int m_count;
+ const char m_char;
+};
+
+class startFunctionDefinition1 {
+public:
+ explicit startFunctionDefinition1(const char *name, const QString &parameterType,
+ const QString &parameterName,
+ const QString &indent,
+ const char *returnType = nullptr);
+
+ friend QTextStream &operator<<(QTextStream &str, const startFunctionDefinition1 &f);
+private:
+ const char *m_name;
+ const QString &m_parameterType;
+ const QString &m_parameterName;
+ const QString &m_indent;
+ const char *m_return;
+};
+
+class endFunctionDefinition {
+public:
+ explicit endFunctionDefinition(const char *name);
+
+ friend QTextStream &operator<<(QTextStream &str, const endFunctionDefinition &f);
+private:
+ const char *m_name;
+};
+
+void _formatStackVariable(QTextStream &str, const char *className, QStringView varName, bool withInitParameters);
+
+template <bool withInitParameters>
+class _stackVariable {
+public:
+ explicit _stackVariable(const char *className, QStringView varName) :
+ m_className(className), m_varName(varName) {}
+
+ void format(QTextStream &str) const
+ { _formatStackVariable(str, m_className, m_varName, withInitParameters); }
+
+private:
+ const char *m_className;
+ QStringView m_varName;
+ QStringView m_parameters;
+};
+
+template <bool withInitParameters>
+inline QTextStream &operator<<(QTextStream &str, const _stackVariable<withInitParameters> &s)
+{
+ s.format(str);
+ return str;
+}
+
+using stackVariable = _stackVariable<false>;
+using stackVariableWithInitParameters = _stackVariable<true>;
+
+struct SignalSlot
+{
+ QString name;
+ QString signature;
+ QString className;
+};
+
+void formatConnection(QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver);
+
+QString boolValue(bool v);
+
+QString enumValue(const QString &value);
+
} // namespace language
#endif // LANGUAGE_H
diff --git a/src/tools/uic/treewalker.h b/src/tools/uic/treewalker.h
index 7e8eda57d9..3777229517 100644
--- a/src/tools/uic/treewalker.h
+++ b/src/tools/uic/treewalker.h
@@ -77,6 +77,9 @@ class DomButtonGroup;
struct TreeWalker
{
+ Q_DISABLE_COPY_MOVE(TreeWalker)
+
+ TreeWalker() = default;
inline virtual ~TreeWalker() = default;
virtual void acceptUI(DomUI *ui);
@@ -101,7 +104,7 @@ struct TreeWalker
virtual void acceptTime(DomTime *time);
virtual void acceptDateTime(DomDateTime *dateTime);
virtual void acceptProperty(DomProperty *property);
- typedef QVector<DomWidget *> DomWidgets;
+ using DomWidgets = QVector<DomWidget *>;
virtual void acceptIncludes(DomIncludes *includes);
virtual void acceptInclude(DomInclude *incl);
virtual void acceptAction(DomAction *action);
diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp
index 984ef36274..334ced276d 100644
--- a/src/tools/uic/ui4.cpp
+++ b/src/tools/uic/ui4.cpp
@@ -76,6 +76,10 @@ void DomUI::read(QXmlStreamReader &reader)
setAttributeIdbasedtr(attribute.value() == QLatin1String("true"));
continue;
}
+ if (name == QLatin1String("connectslotsbyname")) {
+ setAttributeConnectslotsbyname(attribute.value() == QLatin1String("true"));
+ continue;
+ }
if (name == QLatin1String("stdsetdef")) {
setAttributeStdsetdef(attribute.value().toInt());
continue;
@@ -209,6 +213,9 @@ void DomUI::write(QXmlStreamWriter &writer, const QString &tagName) const
if (hasAttributeIdbasedtr())
writer.writeAttribute(QStringLiteral("idbasedtr"), (attributeIdbasedtr() ? QLatin1String("true") : QLatin1String("false")));
+ if (hasAttributeConnectslotsbyname())
+ writer.writeAttribute(QStringLiteral("connectslotsbyname"), (attributeConnectslotsbyname() ? QLatin1String("true") : QLatin1String("false")));
+
if (hasAttributeStdsetdef())
writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdsetdef()));
diff --git a/src/tools/uic/ui4.h b/src/tools/uic/ui4.h
index 1710147342..08a3abf490 100644
--- a/src/tools/uic/ui4.h
+++ b/src/tools/uic/ui4.h
@@ -169,6 +169,11 @@ public:
inline void setAttributeIdbasedtr(bool a) { m_attr_idbasedtr = a; m_has_attr_idbasedtr = true; }
inline void clearAttributeIdbasedtr() { m_has_attr_idbasedtr = false; }
+ inline bool hasAttributeConnectslotsbyname() const { return m_has_attr_connectslotsbyname; }
+ inline bool attributeConnectslotsbyname() const { return m_attr_connectslotsbyname; }
+ inline void setAttributeConnectslotsbyname(bool a) { m_attr_connectslotsbyname = a; m_has_attr_connectslotsbyname = true; }
+ inline void clearAttributeConnectslotsbyname() { m_has_attr_connectslotsbyname = false; }
+
inline bool hasAttributeStdsetdef() const { return m_has_attr_stdsetdef; }
inline int attributeStdsetdef() const { return m_attr_stdsetdef; }
inline void setAttributeStdsetdef(int a) { m_attr_stdsetdef = a; m_has_attr_stdsetdef = true; }
@@ -285,6 +290,9 @@ private:
bool m_attr_idbasedtr = false;
bool m_has_attr_idbasedtr = false;
+ bool m_attr_connectslotsbyname = false;
+ bool m_has_attr_connectslotsbyname = false;
+
int m_attr_stdsetdef = 0;
bool m_has_attr_stdsetdef = false;
diff --git a/src/tools/uic/uic.cpp b/src/tools/uic/uic.cpp
index 225dc6aeb2..207356f28d 100644
--- a/src/tools/uic/uic.cpp
+++ b/src/tools/uic/uic.cpp
@@ -35,6 +35,10 @@
#include "cppwriteincludes.h"
#include "cppwritedeclaration.h"
+#include <pythonwritedeclaration.h>
+#include <pythonwriteimports.h>
+
+#include <language.h>
#include <qxmlstream.h>
#include <qfileinfo.h>
@@ -65,7 +69,7 @@ bool Uic::printDependencies()
return false;
}
- DomUI *ui = 0;
+ DomUI *ui = nullptr;
{
QXmlStreamReader reader;
reader.setDevice(&f);
@@ -103,7 +107,7 @@ bool Uic::printDependencies()
return true;
}
-void Uic::writeCopyrightHeader(DomUI *ui)
+void Uic::writeCopyrightHeaderCpp(const DomUI *ui) const
{
QString comment = ui->elementComment();
if (!comment.isEmpty())
@@ -118,6 +122,48 @@ void Uic::writeCopyrightHeader(DomUI *ui)
out << "********************************************************************************/\n\n";
}
+// Format existing UI file comments for Python with some smartness : Replace all
+// leading C++ comment characters by '#' or prepend '#' if needed.
+
+static inline bool isCppCommentChar(QChar c)
+{
+ return c == QLatin1Char('/') || c == QLatin1Char('*');
+}
+
+static int leadingCppCommentCharCount(const QStringRef &s)
+{
+ int i = 0;
+ for (const int size = s.size(); i < size && isCppCommentChar(s.at(i)); ++i) {
+ }
+ return i;
+}
+
+void Uic::writeCopyrightHeaderPython(const DomUI *ui) const
+{
+ QString comment = ui->elementComment();
+ if (!comment.isEmpty()) {
+ const auto lines = comment.splitRef(QLatin1Char('\n'));
+ for (const auto &line : lines) {
+ if (const int leadingCommentChars = leadingCppCommentCharCount(line)) {
+ out << language::repeat(leadingCommentChars, '#')
+ << line.right(line.size() - leadingCommentChars);
+ } else {
+ if (!line.startsWith(QLatin1Char('#')))
+ out << "# ";
+ out << line;
+ }
+ out << '\n';
+ }
+ out << '\n';
+ }
+
+ out << language::repeat(80, '#') << "\n## Form generated from reading UI file '"
+ << QFileInfo(opt.inputFile).fileName()
+ << "'\n##\n## Created by: Qt User Interface Compiler version " << QT_VERSION_STR
+ << "\n##\n## WARNING! All changes made in this file will be lost when recompiling UI file!\n"
+ << language::repeat(80, '#') << "\n\n";
+}
+
// Check the version with a stream reader at the <ui> element.
static double versionFromUiAttribute(QXmlStreamReader &reader)
@@ -132,7 +178,7 @@ static double versionFromUiAttribute(QXmlStreamReader &reader)
DomUI *Uic::parseUiFile(QXmlStreamReader &reader)
{
- DomUI *ui = 0;
+ DomUI *ui = nullptr;
const QString uiElement = QLatin1String("ui");
while (!reader.atEnd()) {
@@ -143,7 +189,7 @@ DomUI *Uic::parseUiFile(QXmlStreamReader &reader)
if (version < 4.0) {
const QString msg = QString::fromLatin1("uic: File generated with too old version of Qt Designer (%1)").arg(version);
fprintf(stderr, "%s\n", qPrintable(msg));
- return 0;
+ return nullptr;
}
ui = new DomUI();
@@ -155,7 +201,7 @@ DomUI *Uic::parseUiFile(QXmlStreamReader &reader)
}
if (reader.hasError()) {
delete ui;
- ui = 0;
+ ui = nullptr;
fprintf(stderr, "%s\n", qPrintable(QString::fromLatin1("uic: Error in line %1, column %2 : %3")
.arg(reader.lineNumber()).arg(reader.columnNumber())
.arg(reader.errorString())));
@@ -195,15 +241,26 @@ bool Uic::write(QIODevice *in)
bool Uic::write(DomUI *ui)
{
- using namespace CPP;
-
if (!ui || !ui->elementWidget())
return false;
- if (opt.copyrightHeader)
- writeCopyrightHeader(ui);
+ const auto lang = language::language();
+
+ if (lang == Language::Python)
+ out << "# -*- coding: utf-8 -*-\n\n";
- if (opt.headerProtection) {
+ if (opt.copyrightHeader) {
+ switch (language::language()) {
+ case Language::Cpp:
+ writeCopyrightHeaderCpp(ui);
+ break;
+ case Language::Python:
+ writeCopyrightHeaderPython(ui);
+ break;
+ }
+ }
+
+ if (opt.headerProtection && lang == Language::Cpp) {
writeHeaderProtectionStart();
out << "\n";
}
@@ -218,13 +275,25 @@ bool Uic::write(DomUI *ui)
info.acceptUI(ui);
cWidgetsInfo.acceptUI(ui);
- WriteIncludes writeIncludes(this);
- writeIncludes.acceptUI(ui);
- Validator(this).acceptUI(ui);
- WriteDeclaration(this).acceptUI(ui);
+ switch (language::language()) {
+ case Language::Cpp: {
+ CPP::WriteIncludes writeIncludes(this);
+ writeIncludes.acceptUI(ui);
+ Validator(this).acceptUI(ui);
+ CPP::WriteDeclaration(this).acceptUI(ui);
+ }
+ break;
+ case Language::Python: {
+ Python::WriteImports writeImports(this);
+ writeImports.acceptUI(ui);
+ Validator(this).acceptUI(ui);
+ Python::WriteDeclaration(this).acceptUI(ui);
+ }
+ break;
+ }
- if (opt.headerProtection)
+ if (opt.headerProtection && lang == Language::Cpp)
writeHeaderProtectionEnd();
return true;
diff --git a/src/tools/uic/uic.h b/src/tools/uic/uic.h
index af5f42c6db..f3dfd49149 100644
--- a/src/tools/uic/uic.h
+++ b/src/tools/uic/uic.h
@@ -91,7 +91,8 @@ public:
private:
// copyright header
- void writeCopyrightHeader(DomUI *ui);
+ void writeCopyrightHeaderCpp(const DomUI *ui) const;
+ void writeCopyrightHeaderPython(const DomUI *ui) const;
DomUI *parseUiFile(QXmlStreamReader &reader);
// header protection
diff --git a/src/tools/uic/uic.pro b/src/tools/uic/uic.pro
index 4469ce50e5..1bf8ef8ad3 100644
--- a/src/tools/uic/uic.pro
+++ b/src/tools/uic/uic.pro
@@ -7,6 +7,7 @@ DEFINES += QT_UIC QT_NO_CAST_FROM_ASCII QT_NO_FOREACH
include(uic.pri)
include(shared/shared.pri)
include(cpp/cpp.pri)
+include(python/python.pri)
HEADERS += uic.h
diff --git a/src/tools/uic/utils.h b/src/tools/uic/utils.h
index 3f32a532ca..34c4ab23d4 100644
--- a/src/tools/uic/utils.h
+++ b/src/tools/uic/utils.h
@@ -42,55 +42,6 @@ inline bool toBool(const QString &str)
inline QString toString(const DomString *str)
{ return str ? str->text() : QString(); }
-inline QString fixString(const QString &str, const QString &indent)
-{
- QString cursegment;
- QStringList result;
- const QByteArray utf8 = str.toUtf8();
- const int utf8Length = utf8.length();
-
- for (int i = 0; i < utf8Length; ++i) {
- const uchar cbyte = utf8.at(i);
- if (cbyte >= 0x80) {
- cursegment += QLatin1Char('\\');
- cursegment += QString::number(cbyte, 8);
- } else {
- switch(cbyte) {
- case '\\':
- cursegment += QLatin1String("\\\\"); break;
- case '\"':
- cursegment += QLatin1String("\\\""); break;
- case '\r':
- break;
- case '\n':
- cursegment += QLatin1String("\\n\"\n\""); break;
- default:
- cursegment += QLatin1Char(cbyte);
- }
- }
-
- if (cursegment.length() > 1024) {
- result << cursegment;
- cursegment.clear();
- }
- }
-
- if (!cursegment.isEmpty())
- result << cursegment;
-
-
- QString joinstr = QLatin1String("\"\n");
- joinstr += indent;
- joinstr += indent;
- joinstr += QLatin1Char('"');
-
- QString rc(QLatin1Char('"'));
- rc += result.join(joinstr);
- rc += QLatin1Char('"');
-
- return rc;
-}
-
inline QHash<QString, DomProperty *> propertyMap(const QList<DomProperty *> &properties)
{
QHash<QString, DomProperty *> map;
diff --git a/src/widgets/accessible/qaccessiblemenu.cpp b/src/widgets/accessible/qaccessiblemenu.cpp
index 507584eb02..7f87288520 100644
--- a/src/widgets/accessible/qaccessiblemenu.cpp
+++ b/src/widgets/accessible/qaccessiblemenu.cpp
@@ -47,6 +47,7 @@
#endif
#include <QtWidgets/QAction>
#include <qstyle.h>
+#include <private/qwidget_p.h>
#ifndef QT_NO_ACCESSIBILITY
@@ -241,15 +242,9 @@ QObject *QAccessibleMenuItem::object() const
/*! \reimp */
QWindow *QAccessibleMenuItem::window() const
{
- QWindow *result = nullptr;
- if (!m_owner.isNull()) {
- result = m_owner->windowHandle();
- if (!result) {
- if (const QWidget *nativeParent = m_owner->nativeParentWidget())
- result = nativeParent->windowHandle();
- }
- }
- return result;
+ return m_owner.isNull()
+ ? nullptr
+ : qt_widget_private(m_owner.data())->windowHandle(QWidgetPrivate::WindowHandleMode::Closest);
}
QRect QAccessibleMenuItem::rect() const
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index c96d213e7b..27e6b09dc7 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -273,22 +273,6 @@ QRect QAccessibleWidget::rect() const
return QRect(wpos.x(), wpos.y(), w->width(), w->height());
}
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <private/qobject_p.h>
-QT_END_INCLUDE_NAMESPACE
-
-class QACConnectionObject : public QObject
-{
- Q_DECLARE_PRIVATE(QObject)
-public:
- inline bool isSender(const QObject *receiver, const char *signal) const
- { return d_func()->isSender(receiver, signal); }
- inline QObjectList receiverList(const char *signal) const
- { return d_func()->receiverList(signal); }
- inline QObjectList senderList() const
- { return d_func()->senderList(); }
-};
-
/*!
Registers \a signal as a controlling signal.
@@ -347,9 +331,9 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
if (match & QAccessible::Controlled) {
QObjectList allReceivers;
- QACConnectionObject *connectionObject = (QACConnectionObject*)object();
+ QObject *connectionObject = object();
for (int sig = 0; sig < d->primarySignals.count(); ++sig) {
- const QObjectList receivers = connectionObject->receiverList(d->primarySignals.at(sig).toLatin1());
+ const QObjectList receivers = connectionObject->d_func()->receiverList(d->primarySignals.at(sig).toLatin1());
allReceivers += receivers;
}
diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp
index 0d87cc486d..52c953ed3a 100644
--- a/src/widgets/accessible/qaccessiblewidgets.cpp
+++ b/src/widgets/accessible/qaccessiblewidgets.cpp
@@ -101,9 +101,9 @@ QString qt_accHotKey(const QString &text);
QList<QWidget*> childWidgets(const QWidget *widget)
{
- if (widget == 0)
- return QList<QWidget*>();
QList<QWidget*> widgets;
+ if (!widget)
+ return widgets;
for (QObject *o : widget->children()) {
QWidget *w = qobject_cast<QWidget *>(o);
if (!w)
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index 716c833fc9..ca74ee4b12 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -779,8 +779,7 @@ int QAccessibleLineEdit::cursorPosition() const
QRect QAccessibleLineEdit::characterRect(int offset) const
{
int x = lineEdit()->d_func()->control->cursorToX(offset);
- int y;
- lineEdit()->getTextMargins(0, &y, 0, 0);
+ int y = lineEdit()->textMargins().top();
QFontMetrics fm(lineEdit()->font());
const QString ch = text(offset, offset + 1);
if (ch.isEmpty())
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index cc9019dfdd..0a68f082a2 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -378,6 +378,7 @@
"label": "QScroller",
"purpose": "Enables kinetic scrolling for any scrolling widget or graphics item.",
"section": "Widgets",
+ "condition": "features.easingcurve",
"output": [ "publicFeature" ]
},
"graphicsview": {
@@ -626,12 +627,6 @@
"condition": "features.listview",
"output": [ "publicFeature", "feature" ]
},
- "paint_debug": {
- "label": "Painting Debug Utilities",
- "purpose": "Enabled debugging painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT.",
- "section": "Painting",
- "output": [ "publicFeature", "feature" ]
- },
"completer": {
"label": "QCompleter",
"purpose": "Provides completions based on an item model.",
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 197d1d940b..d00a600424 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -57,6 +57,11 @@
#include "qpainter.h"
#include "qpixmap.h"
#include "qpushbutton.h"
+#if QT_CONFIG(regularexpression)
+#include <qregularexpression.h>
+#else
+#include <qregexp.h>
+#endif
#if QT_CONFIG(settings)
#include "qsettings.h"
#endif
@@ -1616,7 +1621,7 @@ void QColorDialogPrivate::_q_pickScreenColor()
q->grabMouse();
#endif
-#ifdef Q_OS_WIN32 // excludes WinCE and WinRT
+#ifdef Q_OS_WIN32 // excludes WinRT
// On Windows mouse tracking doesn't work over other processes's windows
updateTimer->start(30);
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index caab6c16ba..3cdd9a5f04 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -270,12 +270,11 @@ void QDialogPrivate::deletePlatformHelper()
The most common way to display a modal dialog is to call its
exec() function. When the user closes the dialog, exec() will
- provide a useful \l{#return}{return value}. Typically,
- to get the dialog to close and return the appropriate value, we
- connect a default button, e.g. \uicontrol OK, to the accept() slot and a
- \uicontrol Cancel button to the reject() slot.
- Alternatively you can call the done() slot with \c Accepted or
- \c Rejected.
+ provide a useful \l{#return}{return value}. To close the dialog
+ and return the appropriate value, you must connect a default button,
+ e.g. an \uicontrol OK button to the accept() slot and a
+ \uicontrol Cancel button to the reject() slot. Alternatively, you
+ can call the done() slot with \c Accepted or \c Rejected.
An alternative is to call setModal(true) or setWindowModality(),
then show(). Unlike exec(), show() returns control to the caller
@@ -283,7 +282,7 @@ void QDialogPrivate::deletePlatformHelper()
progress dialogs, where the user must have the ability to interact
with the dialog, e.g. to cancel a long running operation. If you
use show() and setModal(true) together to perform a long operation,
- you must call QApplication::processEvents() periodically during
+ you must call QCoreApplication::processEvents() periodically during
processing to enable the user to interact with the dialog. (See
QProgressDialog.)
@@ -692,7 +691,7 @@ void QDialog::contextMenuEvent(QContextMenuEvent *e)
if (p.data()->exec(e->globalPos()) == wt) {
QHelpEvent e(QEvent::WhatsThis, w->rect().center(),
w->mapToGlobal(w->rect().center()));
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
}
delete p.data();
}
@@ -827,7 +826,7 @@ QT_WARNING_POP
#endif
if (fw && !fw->hasFocus()) {
QFocusEvent e(QEvent::FocusIn, Qt::TabFocusReason);
- QApplication::sendEvent(fw, &e);
+ QCoreApplication::sendEvent(fw, &e);
}
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 92634f6793..74f775a0bd 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -75,15 +75,15 @@ public:
QDialogPrivate()
:
#if QT_CONFIG(pushbutton)
- mainDef(0),
+ mainDef(nullptr),
#endif
- orientation(Qt::Horizontal),extension(0), doShowExtension(false),
+ orientation(Qt::Horizontal),extension(nullptr), doShowExtension(false),
#if QT_CONFIG(sizegrip)
- resizer(0),
+ resizer(nullptr),
sizeGripEnabled(false),
#endif
- rescode(0), resetModalityTo(-1), wasModalitySet(true), eventLoop(0),
- nativeDialogInUse(false), m_platformHelper(0), m_platformHelperCreated(false)
+ rescode(0), resetModalityTo(-1), wasModalitySet(true), eventLoop(nullptr),
+ nativeDialogInUse(false), m_platformHelper(nullptr), m_platformHelperCreated(false)
{}
~QDialogPrivate();
@@ -140,14 +140,14 @@ class QAutoPointer {
struct internal { void func() {} };
typedef void (internal::*RestrictedBool)();
public:
- explicit QAutoPointer(T *t) Q_DECL_NOTHROW : o(t) {}
+ explicit QAutoPointer(T *t) noexcept : o(t) {}
~QAutoPointer() { delete o; }
- T *operator->() const Q_DECL_NOTHROW { return get(); }
- T *get() const Q_DECL_NOTHROW { return o; }
+ T *operator->() const noexcept { return get(); }
+ T *get() const noexcept { return o; }
T &operator*() const { return *get(); }
- operator RestrictedBool() const Q_DECL_NOTHROW { return o ? &internal::func : nullptr; }
- bool operator!() const Q_DECL_NOTHROW { return !o; }
+ operator RestrictedBool() const noexcept { return o ? &internal::func : nullptr; }
+ bool operator!() const noexcept { return !o; }
private:
Q_DISABLE_COPY(QAutoPointer);
};
diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp
index fd68f19680..f0ec2c0102 100644
--- a/src/widgets/dialogs/qerrormessage.cpp
+++ b/src/widgets/dialogs/qerrormessage.cpp
@@ -295,7 +295,7 @@ QErrorMessage * QErrorMessage::qtHandler()
if (!qtMessageHandler) {
qtMessageHandler = new QErrorMessage(0);
qAddPostRoutine(deleteStaticcQErrorMessage); // clean up
- qtMessageHandler->setWindowTitle(QApplication::applicationName());
+ qtMessageHandler->setWindowTitle(QCoreApplication::applicationName());
qInstallMessageHandler(jump);
}
return qtMessageHandler;
@@ -322,8 +322,8 @@ bool QErrorMessagePrivate::nextPending()
#else
errors->setPlainText(message);
#endif
- currentMessage = qMove(message);
- currentType = qMove(type);
+ currentMessage = std::move(message);
+ currentType = std::move(type);
return true;
}
}
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 2c2d209226..a1b9003c1c 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -44,6 +44,7 @@
#include "qfiledialog.h"
#include "qfiledialog_p.h"
+#include <private/qapplication_p.h>
#include <private/qguiapplication_p.h>
#include <qfontmetrics.h>
#include <qaction.h>
@@ -77,6 +78,8 @@
#include <private/qwasmlocalfileaccess_p.h>
#endif
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
@@ -2445,6 +2448,51 @@ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::funct
}
/*!
+ This is a convenience static function that saves \a fileContent to a file, using
+ a file name and location chosen by the user. \a fileNameHint can be provided to
+ suggest a file name to the user.
+
+ This function is used to save files to the local file system on Qt for WebAssembly, where
+ the web sandbox places restrictions on how such access may happen. Its implementation will
+ make the browser display a native file dialog, where the user makes the file selection.
+
+ It can also be used on other platforms, where it will fall back to using QFileDialog.
+
+ The function is asynchronous and returns immediately.
+
+ \snippet code/src_gui_dialogs_qfiledialog.cpp 16
+ \since 5.14
+*/
+void QFileDialog::saveFileContent(const QByteArray &fileContent, const QString &fileNameHint)
+{
+#ifdef Q_OS_WASM
+ QWasmLocalFileAccess::saveFile(fileContent.constData(), fileContent.size(), fileNameHint.toStdString());
+#else
+ QFileDialog *dialog = new QFileDialog();
+ dialog->setAcceptMode(QFileDialog::AcceptSave);
+ dialog->setFileMode(QFileDialog::AnyFile);
+ dialog->selectFile(fileNameHint);
+
+ auto fileSelected = [=](const QString &fileName) {
+ if (!fileName.isNull()) {
+ QFile selectedFile(fileName);
+ if (selectedFile.open(QIODevice::WriteOnly))
+ selectedFile.write(fileContent);
+ }
+ };
+
+ auto dialogClosed = [=](int code) {
+ Q_UNUSED(code);
+ delete dialog;
+ };
+
+ connect(dialog, &QFileDialog::fileSelected, fileSelected);
+ connect(dialog, &QFileDialog::finished, dialogClosed);
+ dialog->show();
+#endif
+}
+
+/*!
This is a convenience static function that will return a file name selected
by the user. The file does not have to exist.
@@ -3372,6 +3420,18 @@ void QFileDialogPrivate::_q_goHome()
q->setDirectory(QDir::homePath());
}
+
+void QFileDialogPrivate::saveHistorySelection()
+{
+ if (qFileDialogUi.isNull() || currentHistoryLocation < 0 || currentHistoryLocation >= currentHistory.size())
+ return;
+ auto &item = currentHistory[currentHistoryLocation];
+ item.selection.clear();
+ const auto selectedIndexes = qFileDialogUi->listView->selectionModel()->selectedRows();
+ for (const auto &index : selectedIndexes)
+ item.selection.append(QPersistentModelIndex(index));
+}
+
/*!
\internal
@@ -3385,17 +3445,49 @@ void QFileDialogPrivate::_q_pathChanged(const QString &newPath)
qFileDialogUi->sidebar->selectUrl(QUrl::fromLocalFile(newPath));
q->setHistory(qFileDialogUi->lookInCombo->history());
- if (currentHistoryLocation < 0 || currentHistory.value(currentHistoryLocation) != QDir::toNativeSeparators(newPath)) {
+ const QString newNativePath = QDir::toNativeSeparators(newPath);
+
+ // equal paths indicate this was invoked by _q_navigateBack/Forward()
+ if (currentHistoryLocation < 0 || currentHistory.value(currentHistoryLocation).path != newNativePath) {
+ if (currentHistoryLocation >= 0)
+ saveHistorySelection();
while (currentHistoryLocation >= 0 && currentHistoryLocation + 1 < currentHistory.count()) {
currentHistory.removeLast();
}
- currentHistory.append(QDir::toNativeSeparators(newPath));
+ currentHistory.append({newNativePath, PersistentModelIndexList()});
++currentHistoryLocation;
}
qFileDialogUi->forwardButton->setEnabled(currentHistory.size() - currentHistoryLocation > 1);
qFileDialogUi->backButton->setEnabled(currentHistoryLocation > 0);
}
+void QFileDialogPrivate::navigate(HistoryItem &historyItem)
+{
+ Q_Q(QFileDialog);
+ q->setDirectory(historyItem.path);
+ // Restore selection unless something has changed in the file system
+ if (qFileDialogUi.isNull() || historyItem.selection.isEmpty())
+ return;
+ if (std::any_of(historyItem.selection.cbegin(), historyItem.selection.cend(),
+ [](const QPersistentModelIndex &i) { return !i.isValid(); })) {
+ historyItem.selection.clear();
+ return;
+ }
+
+ QAbstractItemView *view = q->viewMode() == QFileDialog::List
+ ? static_cast<QAbstractItemView *>(qFileDialogUi->listView)
+ : static_cast<QAbstractItemView *>(qFileDialogUi->treeView);
+ auto selectionModel = view->selectionModel();
+ const QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::Select
+ | QItemSelectionModel::Rows;
+ selectionModel->select(historyItem.selection.constFirst(),
+ flags | QItemSelectionModel::Clear | QItemSelectionModel::Current);
+ for (int i = 1, size = historyItem.selection.size(); i < size; ++i)
+ selectionModel->select(historyItem.selection.at(i), flags);
+
+ view->scrollTo(historyItem.selection.constFirst());
+}
+
/*!
\internal
@@ -3403,11 +3495,9 @@ void QFileDialogPrivate::_q_pathChanged(const QString &newPath)
*/
void QFileDialogPrivate::_q_navigateBackward()
{
- Q_Q(QFileDialog);
if (!currentHistory.isEmpty() && currentHistoryLocation > 0) {
- --currentHistoryLocation;
- QString previousHistory = currentHistory.at(currentHistoryLocation);
- q->setDirectory(previousHistory);
+ saveHistorySelection();
+ navigate(currentHistory[--currentHistoryLocation]);
}
}
@@ -3418,11 +3508,9 @@ void QFileDialogPrivate::_q_navigateBackward()
*/
void QFileDialogPrivate::_q_navigateForward()
{
- Q_Q(QFileDialog);
if (!currentHistory.isEmpty() && currentHistoryLocation < currentHistory.size() - 1) {
- ++currentHistoryLocation;
- QString nextHistory = currentHistory.at(currentHistoryLocation);
- q->setDirectory(nextHistory);
+ saveHistorySelection();
+ navigate(currentHistory[++currentHistoryLocation]);
}
}
@@ -3633,12 +3721,13 @@ void QFileDialogPrivate::_q_autoCompleteFileName(const QString &text)
if (oldFiles.removeAll(idx) == 0)
newFiles.append(idx);
}
- for (int i = 0; i < newFiles.count(); ++i)
- select(newFiles.at(i));
- if (lineEdit()->hasFocus())
- for (int i = 0; i < oldFiles.count(); ++i)
- qFileDialogUi->listView->selectionModel()->select(oldFiles.at(i),
- QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
+ for (const auto &newFile : qAsConst(newFiles))
+ select(newFile);
+ if (lineEdit()->hasFocus()) {
+ auto *sm = qFileDialogUi->listView->selectionModel();
+ for (const auto &oldFile : qAsConst(oldFiles))
+ sm->select(oldFile, QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
+ }
}
}
@@ -3992,7 +4081,7 @@ bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) {
return true;
case Qt::Key_Back:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
return false;
#endif
case Qt::Key_Left:
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index 95e03618ac..790f52f2e7 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -92,7 +92,9 @@ public:
ShowDirsOnly = 0x00000001,
DontResolveSymlinks = 0x00000002,
DontConfirmOverwrite = 0x00000004,
- DontUseSheet = 0x00000008,
+#if QT_DEPRECATED_SINCE(5, 14)
+ DontUseSheet Q_DECL_ENUMERATOR_DEPRECATED = 0x00000008,
+#endif
DontUseNativeDialog = 0x00000010,
ReadOnly = 0x00000020,
HideNameFilterDetails = 0x00000040,
@@ -282,6 +284,7 @@ public:
static void getOpenFileContent(const QString &nameFilter,
const std::function<void(const QString &, const QByteArray &)> &fileContentsReady);
+ static void saveFileContent(const QByteArray &fileContent, const QString &fileNameHint = QString());
protected:
QFileDialog(const QFileDialogArgs &args);
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index 463c77aa23..dcf147348f 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -98,7 +98,7 @@ class QPlatformDialogHelper;
struct QFileDialogArgs
{
- QFileDialogArgs() : parent(0), mode(QFileDialog::AnyFile) {}
+ QFileDialogArgs() : parent(nullptr), mode(QFileDialog::AnyFile) {}
QWidget *parent;
QString caption;
@@ -116,6 +116,14 @@ class Q_WIDGETS_EXPORT QFileDialogPrivate : public QDialogPrivate
Q_DECLARE_PUBLIC(QFileDialog)
public:
+ using PersistentModelIndexList = QVector<QPersistentModelIndex>;
+
+ struct HistoryItem
+ {
+ QString path;
+ PersistentModelIndexList selection;
+ };
+
QFileDialogPrivate();
QPlatformFileDialogHelper *platformFileDialogHelper() const
@@ -193,9 +201,11 @@ public:
void retranslateWindowTitle();
void retranslateStrings();
void emitFilesSelected(const QStringList &files);
+ void saveHistorySelection();
void _q_goHome();
void _q_pathChanged(const QString &);
+ void navigate(HistoryItem &);
void _q_navigateBackward();
void _q_navigateForward();
void _q_navigateToParent();
@@ -237,7 +247,7 @@ public:
QString setWindowTitle;
- QStringList currentHistory;
+ QList<HistoryItem> currentHistory;
int currentHistoryLocation;
QAction *renameAction;
@@ -292,7 +302,7 @@ private:
class QFileDialogLineEdit : public QLineEdit
{
public:
- QFileDialogLineEdit(QWidget *parent = 0) : QLineEdit(parent), d_ptr(0){}
+ QFileDialogLineEdit(QWidget *parent = nullptr) : QLineEdit(parent), d_ptr(nullptr){}
void setFileDialogPrivate(QFileDialogPrivate *d_pointer) {d_ptr = d_pointer; }
void keyPressEvent(QKeyEvent *e) override;
bool hideOnEsc;
@@ -303,7 +313,7 @@ private:
class QFileDialogComboBox : public QComboBox
{
public:
- QFileDialogComboBox(QWidget *parent = 0) : QComboBox(parent), urlModel(0) {}
+ QFileDialogComboBox(QWidget *parent = nullptr) : QComboBox(parent), urlModel(nullptr) {}
void setFileDialogPrivate(QFileDialogPrivate *d_pointer);
void showPopup() override;
void setHistory(const QStringList &paths);
@@ -319,7 +329,7 @@ private:
class QFileDialogListView : public QListView
{
public:
- QFileDialogListView(QWidget *parent = 0);
+ QFileDialogListView(QWidget *parent = nullptr);
void setFileDialogPrivate(QFileDialogPrivate *d_pointer);
QSize sizeHint() const override;
protected:
diff --git a/src/widgets/dialogs/qfileinfogatherer.cpp b/src/widgets/dialogs/qfileinfogatherer.cpp
index 1e03ad8b06..0beca82f28 100644
--- a/src/widgets/dialogs/qfileinfogatherer.cpp
+++ b/src/widgets/dialogs/qfileinfogatherer.cpp
@@ -54,12 +54,12 @@ QT_BEGIN_NAMESPACE
static QBasicAtomicInt fetchedRoot = Q_BASIC_ATOMIC_INITIALIZER(false);
Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot()
{
- fetchedRoot.store(false);
+ fetchedRoot.storeRelaxed(false);
}
Q_AUTOTEST_EXPORT bool qt_test_isFetchedRoot()
{
- return fetchedRoot.load();
+ return fetchedRoot.loadRelaxed();
}
#endif
@@ -79,30 +79,9 @@ static QString translateDriveName(const QFileInfo &drive)
Creates thread
*/
QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
- : QThread(parent), abort(false),
-#if QT_CONFIG(filesystemwatcher)
- watcher(0),
-#endif
-#ifdef Q_OS_WIN
- m_resolveSymlinks(true),
-#endif
- m_iconProvider(&defaultProvider)
+ : QThread(parent)
+ , m_iconProvider(&defaultProvider)
{
-#if QT_CONFIG(filesystemwatcher)
- watcher = new QFileSystemWatcher(this);
- connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(list(QString)));
- connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString)));
-
-# if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- const QVariant listener = watcher->property("_q_driveListener");
- if (listener.canConvert<QObject *>()) {
- if (QObject *driveListener = listener.value<QObject *>()) {
- connect(driveListener, SIGNAL(driveAdded()), this, SLOT(driveAdded()));
- connect(driveListener, SIGNAL(driveRemoved()), this, SLOT(driveRemoved()));
- }
- }
-# endif // Q_OS_WIN && !Q_OS_WINRT
-#endif
start(LowPriority);
}
@@ -111,7 +90,7 @@ QFileInfoGatherer::QFileInfoGatherer(QObject *parent)
*/
QFileInfoGatherer::~QFileInfoGatherer()
{
- abort.store(true);
+ abort.storeRelaxed(true);
QMutexLocker locker(&mutex);
condition.wakeAll();
locker.unlock();
@@ -183,8 +162,8 @@ void QFileInfoGatherer::fetchExtendedInformation(const QString &path, const QStr
if (files.isEmpty()
&& !path.isEmpty()
&& !path.startsWith(QLatin1String("//")) /*don't watch UNC path*/) {
- if (!watcher->directories().contains(path))
- watcher->addPath(path);
+ if (!watchedDirectories().contains(path))
+ watchPaths(QStringList(path));
}
#endif
}
@@ -201,6 +180,91 @@ void QFileInfoGatherer::updateFile(const QString &filePath)
fetchExtendedInformation(dir, QStringList(fileName));
}
+QStringList QFileInfoGatherer::watchedFiles() const
+{
+#if QT_CONFIG(filesystemwatcher)
+ if (m_watcher)
+ return m_watcher->files();
+#endif
+ return {};
+}
+
+QStringList QFileInfoGatherer::watchedDirectories() const
+{
+#if QT_CONFIG(filesystemwatcher)
+ if (m_watcher)
+ return m_watcher->directories();
+#endif
+ return {};
+}
+
+void QFileInfoGatherer::createWatcher()
+{
+#if QT_CONFIG(filesystemwatcher)
+ m_watcher = new QFileSystemWatcher(this);
+ connect(m_watcher, &QFileSystemWatcher::directoryChanged, this, &QFileInfoGatherer::list);
+ connect(m_watcher, &QFileSystemWatcher::fileChanged, this, &QFileInfoGatherer::updateFile);
+# if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ const QVariant listener = m_watcher->property("_q_driveListener");
+ if (listener.canConvert<QObject *>()) {
+ if (QObject *driveListener = listener.value<QObject *>()) {
+ connect(driveListener, SIGNAL(driveAdded()), this, SLOT(driveAdded()));
+ connect(driveListener, SIGNAL(driveRemoved()), this, SLOT(driveRemoved()));
+ }
+ }
+# endif // Q_OS_WIN && !Q_OS_WINRT
+#endif
+}
+
+void QFileInfoGatherer::watchPaths(const QStringList &paths)
+{
+#if QT_CONFIG(filesystemwatcher)
+ if (m_watching) {
+ if (m_watcher == nullptr)
+ createWatcher();
+ m_watcher->addPaths(paths);
+ }
+#else
+ Q_UNUSED(paths);
+#endif
+}
+
+void QFileInfoGatherer::unwatchPaths(const QStringList &paths)
+{
+#if QT_CONFIG(filesystemwatcher)
+ if (m_watcher)
+ m_watcher->removePaths(paths);
+#else
+ Q_UNUSED(paths);
+#endif
+}
+
+bool QFileInfoGatherer::isWatching() const
+{
+ bool result = false;
+#if QT_CONFIG(filesystemwatcher)
+ QMutexLocker locker(&mutex);
+ result = m_watching;
+#endif
+ return result;
+}
+
+void QFileInfoGatherer::setWatching(bool v)
+{
+#if QT_CONFIG(filesystemwatcher)
+ QMutexLocker locker(&mutex);
+ if (v != m_watching) {
+ if (!v) {
+ delete m_watcher;
+ m_watcher = nullptr;
+ }
+ m_watching = v;
+ }
+#else
+ Q_UNUSED(v);
+#endif
+}
+
/*
List all files in \a directoryPath
@@ -210,8 +274,8 @@ void QFileInfoGatherer::clear()
{
#if QT_CONFIG(filesystemwatcher)
QMutexLocker locker(&mutex);
- watcher->removePaths(watcher->files());
- watcher->removePaths(watcher->directories());
+ unwatchPaths(watchedFiles());
+ unwatchPaths(watchedDirectories());
#endif
}
@@ -224,7 +288,7 @@ void QFileInfoGatherer::removePath(const QString &path)
{
#if QT_CONFIG(filesystemwatcher)
QMutexLocker locker(&mutex);
- watcher->removePath(path);
+ unwatchPaths(QStringList(path));
#else
Q_UNUSED(path);
#endif
@@ -247,9 +311,9 @@ void QFileInfoGatherer::run()
{
forever {
QMutexLocker locker(&mutex);
- while (!abort.load() && path.isEmpty())
+ while (!abort.loadRelaxed() && path.isEmpty())
condition.wait(&mutex);
- if (abort.load())
+ if (abort.loadRelaxed())
return;
const QString thisPath = qAsConst(path).front();
path.pop_front();
@@ -271,12 +335,13 @@ QExtendedInformation QFileInfoGatherer::getInfo(const QFileInfo &fileInfo) const
static const bool watchFiles = qEnvironmentVariableIsSet("QT_FILESYSTEMMODEL_WATCH_FILES");
if (watchFiles) {
if (!fileInfo.exists() && !fileInfo.isSymLink()) {
- watcher->removePath(fileInfo.absoluteFilePath());
+ const_cast<QFileInfoGatherer *>(this)->
+ unwatchPaths(QStringList(fileInfo.absoluteFilePath()));
} else {
const QString path = fileInfo.absoluteFilePath();
if (!path.isEmpty() && fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable()
- && !watcher->files().contains(path)) {
- watcher->addPath(path);
+ && !watchedFiles().contains(path)) {
+ const_cast<QFileInfoGatherer *>(this)->watchPaths(QStringList(path));
}
}
}
@@ -303,7 +368,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
// List drives
if (path.isEmpty()) {
#ifdef QT_BUILD_INTERNAL
- fetchedRoot.store(true);
+ fetchedRoot.storeRelaxed(true);
#endif
QFileInfoList infoList;
if (files.isEmpty()) {
@@ -332,7 +397,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
QStringList allFiles;
if (files.isEmpty()) {
QDirIterator dirIt(path, QDir::AllEntries | QDir::System | QDir::Hidden);
- while (!abort.load() && dirIt.hasNext()) {
+ while (!abort.loadRelaxed() && dirIt.hasNext()) {
dirIt.next();
fileInfo = dirIt.fileInfo();
allFiles.append(fileInfo.fileName());
@@ -343,7 +408,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
emit newListOfFiles(path, allFiles);
QStringList::const_iterator filesIt = filesToCheck.constBegin();
- while (!abort.load() && filesIt != filesToCheck.constEnd()) {
+ while (!abort.loadRelaxed() && filesIt != filesToCheck.constEnd()) {
fileInfo.setFile(path + QDir::separator() + *filesIt);
++filesIt;
fetch(fileInfo, base, firstTime, updatedFiles, path);
diff --git a/src/widgets/dialogs/qfileinfogatherer_p.h b/src/widgets/dialogs/qfileinfogatherer_p.h
index 134a14b7ce..3d30a98d04 100644
--- a/src/widgets/dialogs/qfileinfogatherer_p.h
+++ b/src/widgets/dialogs/qfileinfogatherer_p.h
@@ -166,15 +166,16 @@ Q_SIGNALS:
void directoryLoaded(const QString &path);
public:
- explicit QFileInfoGatherer(QObject *parent = 0);
+ explicit QFileInfoGatherer(QObject *parent = nullptr);
~QFileInfoGatherer();
-#if QT_CONFIG(filesystemwatcher) && defined(Q_OS_WIN)
- QStringList watchedFiles() const { return watcher->files(); }
- QStringList watchedDirectories() const { return watcher->directories(); }
- void watchPaths(const QStringList &paths) { watcher->addPaths(paths); }
- void unwatchPaths(const QStringList &paths) { watcher->removePaths(paths); }
-#endif // filesystemwatcher && Q_OS_WIN
+ QStringList watchedFiles() const;
+ QStringList watchedDirectories() const;
+ void watchPaths(const QStringList &paths);
+ void unwatchPaths(const QStringList &paths);
+
+ bool isWatching() const;
+ void setWatching(bool v);
// only callable from this->thread():
void clear();
@@ -201,6 +202,8 @@ private:
void fetch(const QFileInfo &info, QElapsedTimer &base, bool &firstTime, QVector<QPair<QString, QFileInfo> > &updatedFiles, const QString &path);
private:
+ void createWatcher();
+
mutable QMutex mutex;
// begin protected by mutex
QWaitCondition condition;
@@ -210,13 +213,16 @@ private:
QAtomicInt abort;
#if QT_CONFIG(filesystemwatcher)
- QFileSystemWatcher *watcher;
-#endif
-#ifdef Q_OS_WIN
- bool m_resolveSymlinks; // not accessed by run()
+ QFileSystemWatcher *m_watcher = nullptr;
#endif
QFileIconProvider *m_iconProvider; // not accessed by run()
QFileIconProvider defaultProvider;
+#ifdef Q_OS_WIN
+ bool m_resolveSymlinks = true; // not accessed by run()
+#endif
+#if QT_CONFIG(filesystemwatcher)
+ bool m_watching = true;
+#endif
};
QT_END_NAMESPACE
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index e486037e08..a04189513a 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -57,6 +57,9 @@
#ifdef Q_OS_WIN
# include <QtCore/QVarLengthArray>
# include <qt_windows.h>
+# ifndef Q_OS_WINRT
+# include <shlobj.h>
+# endif
#endif
QT_BEGIN_NAMESPACE
@@ -227,11 +230,9 @@ bool QFileSystemModel::remove(const QModelIndex &aindex)
/*!
Constructs a file system model with the given \a parent.
*/
-QFileSystemModel::QFileSystemModel(QObject *parent)
- : QAbstractItemModel(*new QFileSystemModelPrivate, parent)
+QFileSystemModel::QFileSystemModel(QObject *parent) :
+ QFileSystemModel(*new QFileSystemModelPrivate, parent)
{
- Q_D(QFileSystemModel);
- d->init();
}
/*!
@@ -247,9 +248,7 @@ QFileSystemModel::QFileSystemModel(QFileSystemModelPrivate &dd, QObject *parent)
/*!
Destroys this file system model.
*/
-QFileSystemModel::~QFileSystemModel()
-{
-}
+QFileSystemModel::~QFileSystemModel() = default;
/*!
\reimp
@@ -841,8 +840,8 @@ QString QFileSystemModelPrivate::displayName(const QModelIndex &index) const
{
#if defined(Q_OS_WIN)
QFileSystemNode *dirNode = node(index);
- if (!dirNode->volumeName.isNull())
- return dirNode->volumeName + QLatin1String(" (") + name(index) + QLatin1Char(')');
+ if (!dirNode->volumeName.isEmpty())
+ return dirNode->volumeName;
#endif
return name(index);
}
@@ -1268,6 +1267,107 @@ Qt::DropActions QFileSystemModel::supportedDropActions() const
}
/*!
+ \enum QFileSystemModel::Option
+ \since 5.14
+
+ \value DontWatchForChanges Do not add file watchers to the paths.
+ This reduces overhead when using the model for simple tasks
+ like line edit completion.
+
+ \value DontResolveSymlinks Don't resolve symlinks in the file
+ system model. By default, symlinks are resolved.
+
+ \value DontUseCustomDirectoryIcons Always use the default directory icon.
+ Some platforms allow the user to set a different icon. Custom icon lookup
+ causes a big performance impact over network or removable drives.
+ This sets the QFileIconProvider::DontUseCustomDirectoryIcons
+ option in the icon provider accordingly.
+
+ \sa resolveSymlinks
+*/
+
+/*!
+ \since 5.14
+ Sets the given \a option to be enabled if \a on is true; otherwise,
+ clears the given \a option.
+
+ Options should be set before changing properties.
+
+ \sa options, testOption()
+*/
+void QFileSystemModel::setOption(Option option, bool on)
+{
+ QFileSystemModel::Options previousOptions = options();
+ setOptions(previousOptions.setFlag(option, on));
+}
+
+/*!
+ \since 5.14
+
+ Returns \c true if the given \a option is enabled; otherwise, returns
+ false.
+
+ \sa options, setOption()
+*/
+bool QFileSystemModel::testOption(Option option) const
+{
+ return options().testFlag(option);
+}
+
+/*!
+ \property QFileSystemModel::options
+ \brief the various options that affect the model
+ \since 5.14
+
+ By default, all options are disabled.
+
+ Options should be set before changing properties.
+
+ \sa setOption(), testOption()
+*/
+void QFileSystemModel::setOptions(Options options)
+{
+ const Options changed = (options ^ QFileSystemModel::options());
+
+ if (changed.testFlag(DontResolveSymlinks))
+ setResolveSymlinks(!options.testFlag(DontResolveSymlinks));
+
+#if QT_CONFIG(filesystemwatcher)
+ Q_D(QFileSystemModel);
+ if (changed.testFlag(DontWatchForChanges))
+ d->fileInfoGatherer.setWatching(!options.testFlag(DontWatchForChanges));
+#endif
+
+ if (changed.testFlag(DontUseCustomDirectoryIcons)) {
+ if (auto provider = iconProvider()) {
+ QFileIconProvider::Options providerOptions = provider->options();
+ providerOptions.setFlag(QFileIconProvider::DontUseCustomDirectoryIcons,
+ options.testFlag(QFileSystemModel::DontUseCustomDirectoryIcons));
+ provider->setOptions(providerOptions);
+ } else {
+ qWarning("Setting QFileSystemModel::DontUseCustomDirectoryIcons has no effect when no provider is used");
+ }
+ }
+}
+
+QFileSystemModel::Options QFileSystemModel::options() const
+{
+ QFileSystemModel::Options result;
+ result.setFlag(DontResolveSymlinks, !resolveSymlinks());
+#if QT_CONFIG(filesystemwatcher)
+ Q_D(const QFileSystemModel);
+ result.setFlag(DontWatchForChanges, !d->fileInfoGatherer.isWatching());
+#else
+ result.setFlag(DontWatchForChanges);
+#endif
+ if (auto provider = iconProvider()) {
+ result.setFlag(DontUseCustomDirectoryIcons,
+ provider->options().testFlag(QFileIconProvider::DontUseCustomDirectoryIcons));
+ }
+ return result;
+}
+
+/*!
Returns the path of the item stored in the model under the
\a index given.
*/
@@ -1390,7 +1490,7 @@ QModelIndex QFileSystemModel::setRootPath(const QString &newPath)
if (d->rootDir.path() == longNewPath)
return d->index(rootPath());
- bool showDrives = (longNewPath.isEmpty() || longNewPath == d->myComputer());
+ bool showDrives = (longNewPath.isEmpty() || longNewPath == QFileSystemModelPrivate::myComputer());
if (!showDrives && !newPathDir.exists())
return d->index(rootPath());
@@ -1513,6 +1613,8 @@ QDir::Filters QFileSystemModel::filter() const
This is only relevant on Windows.
By default, this property is \c true.
+
+ \sa QFileSystemModel::Options
*/
void QFileSystemModel::setResolveSymlinks(bool enable)
{
@@ -1674,6 +1776,27 @@ void QFileSystemModelPrivate::_q_directoryChanged(const QString &directory, cons
removeNode(parentNode, toRemove[i]);
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+static QString volumeName(const QString &path)
+{
+ IShellItem *item = nullptr;
+ const QString native = QDir::toNativeSeparators(path);
+ HRESULT hr = SHCreateItemFromParsingName(reinterpret_cast<const wchar_t *>(native.utf16()),
+ nullptr, IID_IShellItem,
+ reinterpret_cast<void **>(&item));
+ if (FAILED(hr))
+ return QString();
+ LPWSTR name = nullptr;
+ hr = item->GetDisplayName(SIGDN_NORMALDISPLAY, &name);
+ if (FAILED(hr))
+ return QString();
+ QString result = QString::fromWCharArray(name);
+ CoTaskMemFree(name);
+ item->Release();
+ return result;
+}
+#endif // Q_OS_WIN && !Q_OS_WINRT
+
/*!
\internal
@@ -1692,15 +1815,8 @@ QFileSystemModelPrivate::QFileSystemNode* QFileSystemModelPrivate::addNode(QFile
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
//The parentNode is "" so we are listing the drives
- if (parentNode->fileName.isEmpty()) {
- wchar_t name[MAX_PATH + 1];
- //GetVolumeInformation requires to add trailing backslash
- const QString nodeName = fileName + QLatin1String("\\");
- BOOL success = ::GetVolumeInformation((wchar_t *)(nodeName.utf16()),
- name, MAX_PATH + 1, NULL, 0, NULL, NULL, 0);
- if (success && name[0])
- node->volumeName = QString::fromWCharArray(name);
- }
+ if (parentNode->fileName.isEmpty())
+ node->volumeName = volumeName(fileName);
#endif
Q_ASSERT(!parentNode->children.contains(fileName));
parentNode->children.insert(fileName, node);
@@ -1847,8 +1963,7 @@ void QFileSystemModelPrivate::_q_fileSystemChanged(const QString &path, const QV
std::sort(rowsToUpdate.begin(), rowsToUpdate.end());
QString min;
QString max;
- for (int i = 0; i < rowsToUpdate.count(); ++i) {
- QString value = rowsToUpdate.at(i);
+ for (const QString &value : qAsConst(rowsToUpdate)) {
//##TODO is there a way to bundle signals with QString as the content of the list?
/*if (min.isEmpty()) {
min = value;
@@ -1946,6 +2061,9 @@ QStringList QFileSystemModelPrivate::unwatchPathsAt(const QModelIndex &index)
void QFileSystemModelPrivate::init()
{
Q_Q(QFileSystemModel);
+
+ delayedSortTimer.setSingleShot(true);
+
qRegisterMetaType<QVector<QPair<QString,QFileInfo> > >();
#if QT_CONFIG(filesystemwatcher)
q->connect(&fileInfoGatherer, SIGNAL(newListOfFiles(QString,QStringList)),
diff --git a/src/widgets/dialogs/qfilesystemmodel.h b/src/widgets/dialogs/qfilesystemmodel.h
index c2c8b8818e..b0f289dfcd 100644
--- a/src/widgets/dialogs/qfilesystemmodel.h
+++ b/src/widgets/dialogs/qfilesystemmodel.h
@@ -61,6 +61,7 @@ class Q_WIDGETS_EXPORT QFileSystemModel : public QAbstractItemModel
Q_PROPERTY(bool resolveSymlinks READ resolveSymlinks WRITE setResolveSymlinks)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
Q_PROPERTY(bool nameFilterDisables READ nameFilterDisables WRITE setNameFilterDisables)
+ Q_PROPERTY(Options options READ options WRITE setOptions)
Q_SIGNALS:
void rootPathChanged(const QString &newPath);
@@ -75,6 +76,15 @@ public:
FilePermissions = Qt::UserRole + 3
};
+ enum Option
+ {
+ DontWatchForChanges = 0x00000001,
+ DontResolveSymlinks = 0x00000002,
+ DontUseCustomDirectoryIcons = 0x00000004
+ };
+ Q_ENUM(Option)
+ Q_DECLARE_FLAGS(Options, Option)
+
explicit QFileSystemModel(QObject *parent = nullptr);
~QFileSystemModel();
@@ -129,6 +139,11 @@ public:
void setNameFilters(const QStringList &filters);
QStringList nameFilters() const;
+ void setOption(Option option, bool on = true);
+ bool testOption(Option option) const;
+ void setOptions(Options options);
+ Options options() const;
+
QString filePath(const QModelIndex &index) const;
bool isDir(const QModelIndex &index) const;
qint64 size(const QModelIndex &index) const;
@@ -165,6 +180,8 @@ inline QString QFileSystemModel::fileName(const QModelIndex &aindex) const
inline QIcon QFileSystemModel::fileIcon(const QModelIndex &aindex) const
{ return qvariant_cast<QIcon>(aindex.data(Qt::DecorationRole)); }
+Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemModel::Options)
+
QT_END_NAMESPACE
#endif // QFILESYSTEMMODEL_H
diff --git a/src/widgets/dialogs/qfilesystemmodel_p.h b/src/widgets/dialogs/qfilesystemmodel_p.h
index 9c432e1ae6..844e417e2d 100644
--- a/src/widgets/dialogs/qfilesystemmodel_p.h
+++ b/src/widgets/dialogs/qfilesystemmodel_p.h
@@ -99,13 +99,13 @@ public:
class QFileSystemNode
{
public:
- explicit QFileSystemNode(const QString &filename = QString(), QFileSystemNode *p = 0)
- : fileName(filename), populatedChildren(false), isVisible(false), dirtyChildrenIndex(-1), parent(p), info(0) {}
+ Q_DISABLE_COPY_MOVE(QFileSystemNode)
+
+ explicit QFileSystemNode(const QString &filename = QString(), QFileSystemNode *p = nullptr)
+ : fileName(filename), parent(p) {}
~QFileSystemNode() {
qDeleteAll(children);
delete info;
- info = 0;
- parent = 0;
}
QString fileName;
@@ -116,7 +116,7 @@ public:
inline qint64 size() const { if (info && !info->isDir()) return info->size(); return 0; }
inline QString type() const { if (info) return info->displayType; return QLatin1String(""); }
inline QDateTime lastModified() const { if (info) return info->lastModified(); return QDateTime(); }
- inline QFile::Permissions permissions() const { if (info) return info->permissions(); return 0; }
+ inline QFile::Permissions permissions() const { if (info) return info->permissions(); return nullptr; }
inline bool isReadable() const { return ((permissions() & QFile::ReadUser) != 0); }
inline bool isWritable() const { return ((permissions() & QFile::WriteUser) != 0); }
inline bool isExecutable() const { return ((permissions() & QFile::ExeUser) != 0); }
@@ -162,7 +162,7 @@ public:
return info && (*info == fileInfo);
}
- inline bool hasInformation() const { return info != 0; }
+ inline bool hasInformation() const { return info != nullptr; }
void populate(const QExtendedInformation &fileInfo) {
if (!info)
@@ -204,31 +204,16 @@ public:
}
}
- bool populatedChildren;
- bool isVisible;
QHash<QFileSystemModelNodePathKey, QFileSystemNode *> children;
QList<QString> visibleChildren;
- int dirtyChildrenIndex;
+ QExtendedInformation *info = nullptr;
QFileSystemNode *parent;
-
-
- QExtendedInformation *info;
-
+ int dirtyChildrenIndex = -1;
+ bool populatedChildren = false;
+ bool isVisible = false;
};
- QFileSystemModelPrivate() :
- forceSort(true),
- sortColumn(0),
- sortOrder(Qt::AscendingOrder),
- readOnly(true),
- setRootPath(false),
- filters(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs),
- nameFilterDisables(true), // false on windows, true on mac and unix
- disableRecursiveSort(false)
- {
- delayedSortTimer.setSingleShot(true);
- }
-
+ QFileSystemModelPrivate() = default;
void init();
/*
\internal
@@ -303,18 +288,7 @@ public:
QFileInfoGatherer fileInfoGatherer;
#endif // filesystemwatcher
QTimer delayedSortTimer;
- bool forceSort;
- int sortColumn;
- Qt::SortOrder sortOrder;
- bool readOnly;
- bool setRootPath;
- QDir::Filters filters;
QHash<const QFileSystemNode*, bool> bypassFilters;
- bool nameFilterDisables;
- //This flag is an optimization for the QFileDialog
- //It enable a sort which is not recursive, it means
- //we sort only what we see.
- bool disableRecursiveSort;
#if QT_CONFIG(regularexpression)
QStringList nameFilters;
#endif
@@ -322,7 +296,6 @@ public:
QFileSystemNode root;
- QBasicTimer fetchingTimer;
struct Fetching {
QString dir;
QString file;
@@ -330,6 +303,18 @@ public:
};
QVector<Fetching> toFetch;
+ QBasicTimer fetchingTimer;
+
+ QDir::Filters filters = QDir::AllEntries | QDir::NoDotAndDotDot | QDir::AllDirs;
+ int sortColumn = 0;
+ Qt::SortOrder sortOrder = Qt::AscendingOrder;
+ bool forceSort = true;
+ bool readOnly = true;
+ bool setRootPath = false;
+ bool nameFilterDisables = true; // false on windows, true on mac and unix
+ // This flag is an optimization for QFileDialog. It enables a sort which is
+ // not recursive, meaning we sort only what we see.
+ bool disableRecursiveSort = false;
};
Q_DECLARE_TYPEINFO(QFileSystemModelPrivate::Fetching, Q_MOVABLE_TYPE);
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index d53d57db86..7e3592e034 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -432,7 +432,7 @@ bool QFontDialog::eventFilter(QObject *o , QEvent *e)
k->key() == Qt::Key_PageDown)) {
int ci = d->sizeList->currentItem();
- (void)QApplication::sendEvent(d->sizeList, k);
+ QCoreApplication::sendEvent(d->sizeList, k);
if (ci != d->sizeList->currentItem()
&& style()->styleHint(QStyle::SH_FontDialog_SelectAssociatedText, 0, this))
@@ -680,7 +680,7 @@ void QFontDialogPrivate::updateSampleFont(const QFont &newFont)
void QFontDialogPrivate::_q_writingSystemHighlighted(int index)
{
writingSystem = QFontDatabase::WritingSystem(index);
- sampleEdit->setText(fdb.writingSystemSample(writingSystem));
+ sampleEdit->setText(QFontDatabase::writingSystemSample(writingSystem));
updateFamilies();
}
diff --git a/src/widgets/dialogs/qfscompleter_p.h b/src/widgets/dialogs/qfscompleter_p.h
index 3b829d4a52..f5110a7622 100644
--- a/src/widgets/dialogs/qfscompleter_p.h
+++ b/src/widgets/dialogs/qfscompleter_p.h
@@ -64,8 +64,8 @@ QT_BEGIN_NAMESPACE
*/
class Q_WIDGETS_EXPORT QFSCompleter : public QCompleter {
public:
- explicit QFSCompleter(QFileSystemModel *model, QObject *parent = 0)
- : QCompleter(model, parent), proxyModel(0), sourceModel(model)
+ explicit QFSCompleter(QFileSystemModel *model, QObject *parent = nullptr)
+ : QCompleter(model, parent), proxyModel(nullptr), sourceModel(model)
{
#if defined(Q_OS_WIN)
setCaseSensitivity(Qt::CaseInsensitive);
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index f143e3b527..8dad212692 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1508,7 +1508,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
if (d->detailsText)
textToCopy += d->detailsText->text() + QLatin1Char('\n') + separator;
#endif
- QApplication::clipboard()->setText(textToCopy);
+ QGuiApplication::clipboard()->setText(textToCopy);
return;
}
#endif // Q_OS_WIN
@@ -2662,14 +2662,9 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
break;
}
if (!tmpIcon.isNull()) {
- QWindow *window = nullptr;
- if (mb) {
- window = mb->windowHandle();
- if (!window) {
- if (const QWidget *nativeParent = mb->nativeParentWidget())
- window = nativeParent->windowHandle();
- }
- }
+ QWindow *window = mb
+ ? qt_widget_private(mb)->windowHandle(QWidgetPrivate::WindowHandleMode::Closest)
+ : nullptr;
return tmpIcon.pixmap(window, QSize(iconSize, iconSize));
}
return QPixmap();
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 078dd6463b..e1a6bce5b1 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -643,7 +643,7 @@ int QProgressDialog::value() const
\warning If the progress dialog is modal
(see QProgressDialog::QProgressDialog()),
- setValue() calls QApplication::processEvents(), so take care that
+ setValue() calls QCoreApplication::processEvents(), so take care that
this does not cause undesirable re-entrancy in your code. For example,
don't use a QProgressDialog inside a paintEvent()!
@@ -659,7 +659,7 @@ void QProgressDialog::setValue(int progress)
if (d->shown_once) {
if (isModal())
- QApplication::processEvents();
+ QCoreApplication::processEvents();
} else {
if ((!d->setValue_called && progress == 0 /* for compat with Qt < 5.4 */) || progress == minimum()) {
d->starttime.start();
diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h
index 4a82f88878..6056f19452 100644
--- a/src/widgets/dialogs/qsidebar_p.h
+++ b/src/widgets/dialogs/qsidebar_p.h
@@ -67,7 +67,7 @@ class QFileSystemModel;
class QSideBarDelegate : public QStyledItemDelegate
{
public:
- QSideBarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
+ QSideBarDelegate(QWidget *parent = nullptr) : QStyledItemDelegate(parent) {}
void initStyleOption(QStyleOptionViewItem *option,
const QModelIndex &index) const override;
};
@@ -82,7 +82,7 @@ public:
EnabledRole = Qt::UserRole + 2
};
- QUrlModel(QObject *parent = 0);
+ QUrlModel(QObject *parent = nullptr);
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
@@ -127,7 +127,7 @@ Q_SIGNALS:
void goToUrl(const QUrl &url);
public:
- QSidebar(QWidget *parent = 0);
+ QSidebar(QWidget *parent = nullptr);
void setModelAndUrls(QFileSystemModel *model, const QList<QUrl> &newUrls);
~QSidebar();
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 5ba48aeff3..0295241a74 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -1299,7 +1299,7 @@ void QWizardPrivate::updateMinMaxSizes(const QWizardLayoutInfo &info)
int extraHeight = 0;
#if QT_CONFIG(style_windowsvista)
if (isVistaThemeEnabled())
- extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset();
+ extraHeight = vistaHelper->titleBarSize() + vistaHelper->topOffset(q);
#endif
QSize minimumSize = mainLayout->totalMinimumSize() + QSize(0, extraHeight);
QSize maximumSize = mainLayout->totalMaximumSize();
@@ -1565,23 +1565,25 @@ bool QWizardPrivate::handleAeroStyleChange()
bool vistaMargins = false;
if (isVistaThemeEnabled()) {
+ const int topOffset = vistaHelper->topOffset(q);
+ const int topPadding = vistaHelper->topPadding(q);
if (isVistaThemeEnabled(QVistaHelper::VistaAero)) {
if (isWindow) {
vistaHelper->setDWMTitleBar(QVistaHelper::ExtendedTitleBar);
q->installEventFilter(vistaHelper);
}
q->setMouseTracking(true);
- antiFlickerWidget->move(0, vistaHelper->titleBarSize() + vistaHelper->topOffset());
+ antiFlickerWidget->move(0, vistaHelper->titleBarSize() + topOffset);
vistaHelper->backButton()->move(
- 0, vistaHelper->topOffset() // ### should ideally work without the '+ 1'
- - qMin(vistaHelper->topOffset(), vistaHelper->topPadding() + 1));
+ 0, topOffset // ### should ideally work without the '+ 1'
+ - qMin(topOffset, topPadding + 1));
vistaMargins = true;
vistaHelper->backButton()->show();
} else {
if (isWindow)
vistaHelper->setDWMTitleBar(QVistaHelper::NormalTitleBar);
q->setMouseTracking(true);
- antiFlickerWidget->move(0, vistaHelper->topOffset());
+ antiFlickerWidget->move(0, topOffset);
vistaHelper->backButton()->move(0, -1); // ### should ideally work with (0, 0)
}
if (isWindow)
@@ -2545,7 +2547,7 @@ void QWizard::setWizardStyle(WizardStyle style)
//Send a resizeevent since the antiflicker widget probably needs a new size
//because of the backbutton in the window title
QResizeEvent ev(geometry().size(), geometry().size());
- QApplication::sendEvent(this, &ev);
+ QCoreApplication::sendEvent(this, &ev);
}
#endif
d->updateLayout();
@@ -3182,7 +3184,7 @@ void QWizard::resizeEvent(QResizeEvent *event)
int heightOffset = 0;
#if QT_CONFIG(style_windowsvista)
if (d->isVistaThemeEnabled()) {
- heightOffset = d->vistaHelper->topOffset();
+ heightOffset = d->vistaHelper->topOffset(this);
if (d->isVistaThemeEnabled(QVistaHelper::VistaAero))
heightOffset += d->vistaHelper->titleBarSize();
}
@@ -3214,7 +3216,7 @@ void QWizard::paintEvent(QPaintEvent * event)
if (d->isVistaThemeEnabled(QVistaHelper::VistaBasic)) {
QPainter painter(this);
QColor color = d->vistaHelper->basicWindowFrameColor();
- painter.fillRect(0, 0, width(), QVistaHelper::topOffset(), color);
+ painter.fillRect(0, 0, width(), QVistaHelper::topOffset(this), color);
}
d->vistaHelper->paintEvent(event);
}
@@ -3227,7 +3229,11 @@ void QWizard::paintEvent(QPaintEvent * event)
/*!
\reimp
*/
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QWizard::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
+# else
bool QWizard::nativeEvent(const QByteArray &eventType, void *message, long *result)
+# endif
{
#if QT_CONFIG(style_windowsvista)
Q_D(QWizard);
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index 0dd837b197..ef71efa0cb 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -188,7 +188,11 @@ protected:
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *event) override;
#if defined(Q_OS_WIN) || defined(Q_CLANG_QDOC)
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
+# else
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
+# endif
#endif
void done(int result) override;
virtual void initializePage(int id);
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index aa9ad7f290..47ac41a791 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -87,7 +87,7 @@ QVistaBackButton::QVistaBackButton(QWidget *widget)
QSize QVistaBackButton::sizeHint() const
{
ensurePolished();
- int size = int(QStyleHelper::dpiScaled(32));
+ int size = int(QStyleHelper::dpiScaled(32, this));
int width = size, height = size;
return QSize(width, height);
}
@@ -156,7 +156,7 @@ QVistaHelper::QVistaHelper(QWizard *wizard)
backButton_ = new QVistaBackButton(wizard);
backButton_->hide();
- iconSpacing = QStyleHelper::dpiScaled(7);
+ iconSpacing = QStyleHelper::dpiScaled(7, wizard);
}
QVistaHelper::~QVistaHelper()
@@ -172,7 +172,7 @@ void QVistaHelper::updateCustomMargins(bool vistaMargins)
const QMargins customMarginsDp = vistaMargins
? QMargins(0, -titleBarSizeDp(), 0, 0)
: QMargins();
- const QVariant customMarginsV = qVariantFromValue(customMarginsDp);
+ const QVariant customMarginsV = QVariant::fromValue(customMarginsDp);
// The dynamic property takes effect when creating the platform window.
window->setProperty("_q_windowsCustomMargins", customMarginsV);
// If a platform window exists, change via native interface.
@@ -229,7 +229,7 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
if (type == NormalTitleBar)
mar.cyTopHeight = 0;
else
- mar.cyTopHeight = (titleBarSize() + topOffset()) * QVistaHelper::m_devicePixelRatio;
+ mar.cyTopHeight = (titleBarSize() + topOffset(wizard)) * QVistaHelper::m_devicePixelRatio;
if (const HWND wizardHandle = wizardHWND())
if (SUCCEEDED(DwmExtendFrameIntoClientArea(wizardHandle, &mar)))
value = true;
@@ -275,7 +275,7 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
if (vistaState() == VistaAero && isWindow)
drawBlackRect(QRect(0, 0, wizard->width(),
- titleBarSize() + topOffset()), hdc);
+ titleBarSize() + topOffset(wizard)), hdc);
// The button is positioned in QWizardPrivate::handleAeroStyleChange(),
// all calculation is relative to it.
const int btnTop = backButton_->mapToParent(QPoint()).y();
@@ -293,9 +293,9 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
int glowOffset = 0;
if (vistaState() == VistaAero) {
- textHeight += 2 * glowSize();
- textWidth += 2 * glowSize();
- glowOffset = glowSize();
+ glowOffset = glowSize(wizard);
+ textHeight += 2 * glowOffset;
+ textWidth += 2 * glowOffset;
}
const int titleLeft = (wizard->layoutDirection() == Qt::LeftToRight
@@ -314,10 +314,10 @@ void QVistaHelper::drawTitleBar(QPainter *painter)
const QIcon windowIcon = wizard->windowIcon();
if (!windowIcon.isNull()) {
- const int size = QVistaHelper::iconSize();
+ const int size = QVistaHelper::iconSize(wizard);
const int iconLeft = (wizard->layoutDirection() == Qt::LeftToRight
- ? leftMargin()
- : wizard->width() - leftMargin() - size);
+ ? leftMargin(wizard)
+ : wizard->width() - leftMargin(wizard) - size);
const QPoint pos(origin.x() + iconLeft, origin.y() + verticalCenter - size / 2);
const QPoint posDp = pos * QVistaHelper::m_devicePixelRatio;
@@ -339,7 +339,11 @@ void QVistaHelper::setTitleBarIconAndCaptionVisible(bool visible)
SetWindowThemeAttribute(handle, WTA_NONCLIENT, &opt, sizeof(WTA_OPTIONS));
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QVistaHelper::winEvent(MSG* msg, qintptr *result)
+#else
bool QVistaHelper::winEvent(MSG* msg, long* result)
+#endif
{
switch (msg->message) {
case WM_NCHITTEST: {
@@ -401,7 +405,11 @@ void QVistaHelper::mouseEvent(QEvent *event)
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QVistaHelper::handleWinEvent(MSG *message, qintptr *result)
+#else
bool QVistaHelper::handleWinEvent(MSG *message, long *result)
+#endif
{
if (message->message == WM_THEMECHANGED || message->message == WM_DWMCOMPOSITIONCHANGED)
cachedVistaState = Dirty;
@@ -419,7 +427,7 @@ void QVistaHelper::resizeEvent(QResizeEvent * event)
{
Q_UNUSED(event);
rtTop = QRect (0, 0, wizard->width(), frameSize());
- int height = captionSize() + topOffset();
+ int height = captionSize() + topOffset(wizard);
if (vistaState() == VistaBasic)
height -= titleBarSize();
rtTitle = QRect (0, frameSize(), wizard->width(), height);
@@ -509,7 +517,11 @@ bool QVistaHelper::eventFilter(QObject *obj, QEvent *event)
if (event->type() == QEvent::MouseMove) {
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result;
+#else
long result;
+#endif
MSG msg;
msg.message = WM_NCHITTEST;
msg.wParam = 0;
@@ -523,7 +535,11 @@ bool QVistaHelper::eventFilter(QObject *obj, QEvent *event)
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
if (mouseEvent->button() == Qt::LeftButton) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result;
+#else
long result;
+#endif
MSG msg;
msg.message = WM_NCHITTEST;
msg.wParam = 0;
@@ -538,7 +554,11 @@ bool QVistaHelper::eventFilter(QObject *obj, QEvent *event)
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
if (mouseEvent->button() == Qt::LeftButton) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ qintptr result;
+#else
long result;
+#endif
MSG msg;
msg.message = WM_NCHITTEST;
msg.wParam = 0;
@@ -617,7 +637,7 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
RECT rctext ={0,0, rectDp.width(), rectDp.height()};
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
- dto.iGlowSize = glowSize();
+ dto.iGlowSize = glowSize(wizard);
DrawThemeTextEx(hTheme, dcMem, 0, 0, reinterpret_cast<LPCWSTR>(text.utf16()), -1, uFormat, &rctext, &dto );
BitBlt(hdc, rectDp.left(), rectDp.top(), rectDp.width(), rectDp.height(), dcMem, 0, 0, SRCCOPY);
@@ -694,27 +714,27 @@ int QVistaHelper::captionSizeDp()
int QVistaHelper::titleOffset()
{
- int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize() + iconSpacing;
- return leftMargin() + iconOffset;
+ int iconOffset = wizard ->windowIcon().isNull() ? 0 : iconSize(wizard) + iconSpacing;
+ return leftMargin(wizard) + iconOffset;
}
-int QVistaHelper::iconSize()
+int QVistaHelper::iconSize(const QPaintDevice *device)
{
- return QStyleHelper::dpiScaled(16); // Standard Aero
+ return QStyleHelper::dpiScaled(16, device); // Standard Aero
}
-int QVistaHelper::glowSize()
+int QVistaHelper::glowSize(const QPaintDevice *device)
{
- return QStyleHelper::dpiScaled(10);
+ return QStyleHelper::dpiScaled(10, device);
}
-int QVistaHelper::topOffset()
+int QVistaHelper::topOffset(const QPaintDevice *device)
{
if (vistaState() != VistaAero)
return titleBarSize() + 3;
static const int aeroOffset =
QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8 ?
- QStyleHelper::dpiScaled(4) : QStyleHelper::dpiScaled(13);
+ QStyleHelper::dpiScaled(4, device) : QStyleHelper::dpiScaled(13, device);
return aeroOffset + titleBarSize();
}
diff --git a/src/widgets/dialogs/qwizard_win_p.h b/src/widgets/dialogs/qwizard_win_p.h
index 02c5e52c2c..2469496b61 100644
--- a/src/widgets/dialogs/qwizard_win_p.h
+++ b/src/widgets/dialogs/qwizard_win_p.h
@@ -93,7 +93,11 @@ public:
bool setDWMTitleBar(TitleBarChangeType type);
void setTitleBarIconAndCaptionVisible(bool visible);
void mouseEvent(QEvent *event);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool handleWinEvent(MSG *message, qintptr *result);
+#else
bool handleWinEvent(MSG *message, long *result);
+#endif
void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *event);
QVistaBackButton *backButton() const { return backButton_; }
@@ -104,10 +108,10 @@ public:
static VistaState vistaState();
static int titleBarSize() { return QVistaHelper::titleBarSizeDp() / QVistaHelper::m_devicePixelRatio; }
static int titleBarSizeDp() { return QVistaHelper::frameSizeDp() + QVistaHelper::captionSizeDp(); }
- static int topPadding() { // padding under text
- return int(QStyleHelper::dpiScaled(4));
+ static int topPadding(const QPaintDevice *device) { // padding under text
+ return int(QStyleHelper::dpiScaled(4, device));
}
- static int topOffset();
+ static int topOffset(const QPaintDevice *device);
static HDC backingStoreDC(const QWidget *wizard, QPoint *offset);
@@ -121,16 +125,22 @@ private:
static int captionSize() { return QVistaHelper::captionSizeDp() / QVistaHelper::m_devicePixelRatio; }
static int captionSizeDp();
- static int backButtonSize() { return int(QStyleHelper::dpiScaled(30)); }
- static int iconSize();
- static int glowSize();
- int leftMargin() { return backButton_->isVisible() ? backButtonSize() + iconSpacing : 0; }
+ static int backButtonSize(const QPaintDevice *device)
+ { return int(QStyleHelper::dpiScaled(30, device)); }
+ static int iconSize(const QPaintDevice *device);
+ static int glowSize(const QPaintDevice *device);
+ int leftMargin(const QPaintDevice *device)
+ { return backButton_->isVisible() ? backButtonSize(device) + iconSpacing : 0; }
int titleOffset();
void drawTitleBar(QPainter *painter);
void setMouseCursor(QPoint pos);
void collapseTopFrameStrut();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool winEvent(MSG *message, qintptr *result);
+#else
bool winEvent(MSG *message, long *result);
+#endif
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
diff --git a/src/widgets/doc/snippets/code/doc_src_styles.cpp b/src/widgets/doc/snippets/code/doc_src_styles.cpp
index a70ed6b11d..3536be6e7b 100644
--- a/src/widgets/doc/snippets/code/doc_src_styles.cpp
+++ b/src/widgets/doc/snippets/code/doc_src_styles.cpp
@@ -81,11 +81,6 @@
state |= QStyle::State_MouseOver;
if (widget->window()->isActiveWindow())
state |= QStyle::State_Active;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
- if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
- state &= ~QStyle::State_Enabled;
-#endif
#ifdef QT_KEYPAD_NAVIGATION
if (widget->hasEditFocus())
state |= QStyle::State_HasEditFocus;
diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
index 39aca459db..7ccd827a04 100644
--- a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
+++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp
@@ -155,3 +155,8 @@ auto fileOpenCompleted = [](const QString &fileName, const QByteArray &fileConte
}
QFileDialog::getOpenFileContent("Images (*.png *.xpm *.jpg)", fileContentReady);
//! [15]
+
+//! [16]
+QByteArray imageData; // obtained from e.g. QImage::save()
+QFileDialog::saveFile("myimage.png", imageData);
+//! [16]
diff --git a/src/widgets/doc/snippets/macmainwindow.mm b/src/widgets/doc/snippets/macmainwindow.mm
deleted file mode 100644
index c63796a3f2..0000000000
--- a/src/widgets/doc/snippets/macmainwindow.mm
+++ /dev/null
@@ -1,290 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "macmainwindow.h"
-#import <AppKit/AppKit.h>
-#include <QtGui>
-
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-
-//![0]
-SearchWidget::SearchWidget(QWidget *parent)
- : QMacCocoaViewContainer(0, parent)
-{
- // Many Cocoa objects create temporary autorelease objects,
- // so create a pool to catch them.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- // Create the NSSearchField, set it on the QCocoaViewContainer.
- NSSearchField *search = [[NSSearchField alloc] init];
- setCocoaView(search);
-
- // Use a Qt menu for the search field menu.
- QMenu *qtMenu = createMenu(this);
- NSMenu *nsMenu = qtMenu->macMenu(0);
- [[search cell] setSearchMenuTemplate:nsMenu];
-
- // Release our reference, since our super class takes ownership and we
- // don't need it anymore.
- [search release];
-
- // Clean up our pool as we no longer need it.
- [pool release];
-}
-//![0]
-
-SearchWidget::~SearchWidget()
-{
-}
-
-QSize SearchWidget::sizeHint() const
-{
- return QSize(150, 40);
-}
-
-QMenu *createMenu(QWidget *parent)
-{
- QMenu *searchMenu = new QMenu(parent);
-
- QAction * indexAction = searchMenu->addAction("Index Search");
- indexAction->setCheckable(true);
- indexAction->setChecked(true);
-
- QAction * fulltextAction = searchMenu->addAction("Full Text Search");
- fulltextAction->setCheckable(true);
-
- QActionGroup *searchActionGroup = new QActionGroup(parent);
- searchActionGroup->addAction(indexAction);
- searchActionGroup->addAction(fulltextAction);
- searchActionGroup->setExclusive(true);
-
- return searchMenu;
-}
-
-SearchWrapper::SearchWrapper(QWidget *parent)
-:QWidget(parent)
-{
- s = new SearchWidget(this);
- s->move(2,2);
- setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
-}
-
-QSize SearchWrapper::sizeHint() const
-{
- return s->sizeHint() + QSize(6, 2);
-}
-
-Spacer::Spacer(QWidget *parent)
-:QWidget(parent)
-{
- QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- setSizePolicy(sizePolicy);
-}
-
-QSize Spacer::sizeHint() const
-{
- return QSize(1, 1);
-}
-
-MacSplitterHandle::MacSplitterHandle(Qt::Orientation orientation, QSplitter *parent)
-: QSplitterHandle(orientation, parent) { }
-
-// Paint the horizontal handle as a gradient, paint
-// the vertical handle as a line.
-void MacSplitterHandle::paintEvent(QPaintEvent *)
-{
- QPainter painter(this);
-
- QColor topColor(145, 145, 145);
- QColor bottomColor(142, 142, 142);
- QColor gradientStart(252, 252, 252);
- QColor gradientStop(223, 223, 223);
-
- if (orientation() == Qt::Vertical) {
- painter.setPen(topColor);
- painter.drawLine(0, 0, width(), 0);
- painter.setPen(bottomColor);
- painter.drawLine(0, height() - 1, width(), height() - 1);
-
- QLinearGradient linearGrad(QPointF(0, 0), QPointF(0, height() -3));
- linearGrad.setColorAt(0, gradientStart);
- linearGrad.setColorAt(1, gradientStop);
- painter.fillRect(QRect(QPoint(0,1), size() - QSize(0, 2)), QBrush(linearGrad));
- } else {
- painter.setPen(topColor);
- painter.drawLine(0, 0, 0, height());
- }
-}
-
-QSize MacSplitterHandle::sizeHint() const
-{
- QSize parent = QSplitterHandle::sizeHint();
- if (orientation() == Qt::Vertical) {
- return parent + QSize(0, 3);
- } else {
- return QSize(1, parent.height());
- }
-}
-
-QSplitterHandle *MacSplitter::createHandle()
-{
- return new MacSplitterHandle(orientation(), this);
-}
-
-MacMainWindow::MacMainWindow()
-{
- QSettings settings;
- restoreGeometry(settings.value("Geometry").toByteArray());
-
- setWindowTitle("Mac Main Window");
-
- splitter = new MacSplitter();
-
- // Set up the left-hand side blue side bar.
- sidebar = new QTreeView();
- sidebar->setFrameStyle(QFrame::NoFrame);
- sidebar->setAttribute(Qt::WA_MacShowFocusRect, false);
- sidebar->setAutoFillBackground(true);
-
- // Set the palette.
- QPalette palette = sidebar->palette();
- QColor macSidebarColor(231, 237, 246);
- QColor macSidebarHighlightColor(168, 183, 205);
- palette.setColor(QPalette::Base, macSidebarColor);
- palette.setColor(QPalette::Highlight, macSidebarHighlightColor);
- sidebar->setPalette(palette);
-
- sidebar->setModel(createItemModel());
- sidebar->header()->hide();
- sidebar->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- sidebar->setTextElideMode(Qt::ElideMiddle);
-
- splitter->addWidget(sidebar);
-
- horizontalSplitter = new MacSplitter();
- horizontalSplitter->setOrientation(Qt::Vertical);
- splitter->addWidget(horizontalSplitter);
-
- splitter->setStretchFactor(0, 0);
- splitter->setStretchFactor(1, 1);
-
- // Set up the top document list view.
- documents = new QListView();
- documents->setFrameStyle(QFrame::NoFrame);
- documents->setAttribute(Qt::WA_MacShowFocusRect, false);
- documents->setModel(createDocumentModel());
- documents->setAlternatingRowColors(true);
- documents->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
- horizontalSplitter->addWidget(documents);
- horizontalSplitter->setStretchFactor(0, 0);
-
- // Set up the text view.
- textedit = new QTextEdit();
- textedit->setFrameStyle(QFrame::NoFrame);
- textedit->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
- textedit->setText("<br><br><br><br><br><br><center><b>This demo shows how to create a \
- Qt main window application that has the same appearance as other \
- OS X applications such as Mail or iTunes. This includes \
- customizing the item views and QSplitter and wrapping native widgets \
- such as the search field.</b></center>");
-
- horizontalSplitter->addWidget(textedit);
-
- setCentralWidget(splitter);
-
- toolBar = addToolBar(tr("Search"));
- toolBar->addWidget(new Spacer());
- toolBar->addWidget(new SearchWrapper());
-
- setUnifiedTitleAndToolBarOnMac(true);
-}
-
-MacMainWindow::~MacMainWindow()
-{
- QSettings settings;
- settings.setValue("Geometry", saveGeometry());
-}
-
-QAbstractItemModel *MacMainWindow::createItemModel()
-{
- QStandardItemModel *model = new QStandardItemModel();
- QStandardItem *parentItem = model->invisibleRootItem();
-
- QStandardItem *documentationItem = new QStandardItem("Documentation");
- parentItem->appendRow(documentationItem);
-
- QStandardItem *assistantItem = new QStandardItem("Qt MainWindow Manual");
- documentationItem->appendRow(assistantItem);
-
- QStandardItem *designerItem = new QStandardItem("Qt Designer Manual");
- documentationItem->appendRow(designerItem);
-
- QStandardItem *qtItem = new QStandardItem("Qt Reference Documentation");
- qtItem->appendRow(new QStandardItem("Classes"));
- qtItem->appendRow(new QStandardItem("Overviews"));
- qtItem->appendRow(new QStandardItem("Tutorial & Examples"));
- documentationItem->appendRow(qtItem);
-
- QStandardItem *bookmarksItem = new QStandardItem("Bookmarks");
- parentItem->appendRow(bookmarksItem);
- bookmarksItem->appendRow(new QStandardItem("QWidget"));
- bookmarksItem->appendRow(new QStandardItem("QObject"));
- bookmarksItem->appendRow(new QStandardItem("QWizard"));
-
- return model;
-}
-
-void MacMainWindow::resizeEvent(QResizeEvent *)
-{
- if (toolBar)
- toolBar->updateGeometry();
-}
-
-QAbstractItemModel *MacMainWindow::createDocumentModel()
-{
- QStandardItemModel *model = new QStandardItemModel();
- QStandardItem *parentItem = model->invisibleRootItem();
- parentItem->appendRow(new QStandardItem("QWidget Class Reference"));
- parentItem->appendRow(new QStandardItem("QObject Class Reference"));
- parentItem->appendRow(new QStandardItem("QListView Class Reference"));
-
- return model;
-}
-
-#endif
diff --git a/src/widgets/doc/snippets/timeline/main.cpp b/src/widgets/doc/snippets/timeline/main.cpp
index 74aa749254..4dfa2400d0 100644
--- a/src/widgets/doc/snippets/timeline/main.cpp
+++ b/src/widgets/doc/snippets/timeline/main.cpp
@@ -48,7 +48,7 @@
**
****************************************************************************/
-#include <QtGui>
+#include <QtWidgets>
#include <math.h>
int main(int argv, char *args[])
@@ -68,7 +68,7 @@ int main(int argv, char *args[])
for (int i = 0; i < 200; ++i)
animation->setPosAt(i / 200.0, QPointF(i, i));
- QGraphicsScene *scene = new QGraphicsScene();
+ QGraphicsScene *scene = new QGraphicsScene;
scene->setSceneRect(0, 0, 250, 250);
scene->addItem(ball);
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 9335ff78c9..236582ef3f 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -1912,7 +1912,7 @@
\section3 Custom sorting models
- QSortFilterProxyModel instances use Qt's built-in qStableSort() function to set up
+ QSortFilterProxyModel instances use std::stable_sort() function to set up
mappings between items in the source model and those in the proxy model, allowing a
sorted hierarchy of items to be exposed to views without modifying the structure of the
source model. To provide custom sorting behavior, reimplement the
diff --git a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
index 12e27a71ad..c8f374a1b1 100644
--- a/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
+++ b/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc
@@ -554,6 +554,10 @@
If the property references an enum declared with Q_ENUMS, you should
reference its constants by name, i.e., not their numeric value.
+ \note Use the qproperty syntax with care, as it modifies the
+ widget that is being painted. Also, the qproperty syntax is evaluated only
+ once, which is when the widget is polished by the style. This means that any
+ attempt to use them in pseudo-states such as QPushButton:hover, will not work.
*/
/*!
diff --git a/src/widgets/effects/qgraphicseffect_p.h b/src/widgets/effects/qgraphicseffect_p.h
index 2f3bd2f7fd..7e342a9f3c 100644
--- a/src/widgets/effects/qgraphicseffect_p.h
+++ b/src/widgets/effects/qgraphicseffect_p.h
@@ -80,11 +80,11 @@ public:
QRectF boundingRect(Qt::CoordinateSystem coordinateSystem = Qt::LogicalCoordinates) const;
QRect deviceRect() const;
QPixmap pixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates,
- QPoint *offset = 0,
+ QPoint *offset = nullptr,
QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToEffectiveBoundingRect) const;
protected:
- QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent = 0);
+ QGraphicsEffectSource(QGraphicsEffectSourcePrivate &dd, QObject *parent = nullptr);
private:
Q_DECLARE_PRIVATE(QGraphicsEffectSource)
@@ -125,7 +125,7 @@ public:
virtual void draw(QPainter *p) = 0;
virtual void update() = 0;
virtual bool isPixmap() const = 0;
- virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0,
+ virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = nullptr,
QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToTransparentBorder) const = 0;
virtual void effectBoundingRectChanged() = 0;
@@ -149,7 +149,7 @@ class Q_WIDGETS_EXPORT QGraphicsEffectPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QGraphicsEffect)
public:
- QGraphicsEffectPrivate() : source(0), isEnabled(1) {}
+ QGraphicsEffectPrivate() : source(nullptr), isEnabled(1) {}
~QGraphicsEffectPrivate();
inline void setGraphicsEffectSource(QGraphicsEffectSource *newSource)
diff --git a/src/widgets/effects/qpixmapfilter_p.h b/src/widgets/effects/qpixmapfilter_p.h
index 0f582bde60..c56acb8a24 100644
--- a/src/widgets/effects/qpixmapfilter_p.h
+++ b/src/widgets/effects/qpixmapfilter_p.h
@@ -100,7 +100,7 @@ class Q_WIDGETS_EXPORT QPixmapConvolutionFilter : public QPixmapFilter
Q_DECLARE_PRIVATE(QPixmapConvolutionFilter)
public:
- QPixmapConvolutionFilter(QObject *parent = 0);
+ QPixmapConvolutionFilter(QObject *parent = nullptr);
~QPixmapConvolutionFilter();
void setConvolutionKernel(const qreal *matrix, int rows, int columns);
@@ -124,7 +124,7 @@ class Q_WIDGETS_EXPORT QPixmapBlurFilter : public QPixmapFilter
Q_DECLARE_PRIVATE(QPixmapBlurFilter)
public:
- QPixmapBlurFilter(QObject *parent = 0);
+ QPixmapBlurFilter(QObject *parent = nullptr);
~QPixmapBlurFilter();
void setRadius(qreal radius);
@@ -148,7 +148,7 @@ class Q_WIDGETS_EXPORT QPixmapColorizeFilter : public QPixmapFilter
Q_DECLARE_PRIVATE(QPixmapColorizeFilter)
public:
- QPixmapColorizeFilter(QObject *parent = 0);
+ QPixmapColorizeFilter(QObject *parent = nullptr);
~QPixmapColorizeFilter();
void setColor(const QColor& color);
@@ -168,7 +168,7 @@ class Q_WIDGETS_EXPORT QPixmapDropShadowFilter : public QPixmapFilter
Q_DECLARE_PRIVATE(QPixmapDropShadowFilter)
public:
- QPixmapDropShadowFilter(QObject *parent = 0);
+ QPixmapDropShadowFilter(QObject *parent = nullptr);
~QPixmapDropShadowFilter();
QRectF boundingRectFor(const QRectF &rect) const override;
diff --git a/src/widgets/graphicsview/graphicsview.pri b/src/widgets/graphicsview/graphicsview.pri
index 7d10244634..d69a6f5c3f 100644
--- a/src/widgets/graphicsview/graphicsview.pri
+++ b/src/widgets/graphicsview/graphicsview.pri
@@ -4,7 +4,6 @@ qtConfig(graphicsview) {
HEADERS += graphicsview/qgraphicsgridlayout.h \
graphicsview/qgraphicsitem.h \
graphicsview/qgraphicsitem_p.h \
- graphicsview/qgraphicsitemanimation.h \
graphicsview/qgraphicslayout.h \
graphicsview/qgraphicslayout_p.h \
graphicsview/qgraphicslayoutitem.h \
@@ -34,7 +33,6 @@ HEADERS += graphicsview/qgraphicsgridlayout.h \
SOURCES += graphicsview/qgraphicsgridlayout.cpp \
graphicsview/qgraphicsitem.cpp \
- graphicsview/qgraphicsitemanimation.cpp \
graphicsview/qgraphicslayout.cpp \
graphicsview/qgraphicslayout_p.cpp \
graphicsview/qgraphicslayoutitem.cpp \
@@ -55,4 +53,9 @@ SOURCES += graphicsview/qgraphicsgridlayout.cpp \
graphicsview/qsimplex_p.cpp \
graphicsview/qgraphicsanchorlayout_p.cpp \
graphicsview/qgraphicsanchorlayout.cpp
+
+ qtConfig(easingcurve) {
+ HEADERS += graphicsview/qgraphicsitemanimation.h
+ SOURCES += graphicsview/qgraphicsitemanimation.cpp
+ }
}
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
index 008560d856..4f44373cad 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -2066,7 +2066,7 @@ QList<AnchorData *> getVariables(const QList<QSimplexConstraint *> &constraints)
for (auto it = c->variables.cbegin(), end = c->variables.cend(); it != end; ++it)
variableSet.insert(static_cast<AnchorData *>(it.key()));
}
- return variableSet.toList();
+ return variableSet.values();
}
/*!
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
index 699ca32bfe..b5f14948ac 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
@@ -89,7 +89,7 @@ struct AnchorVertex {
: m_item(item), m_edge(edge), m_type(Normal) {}
AnchorVertex()
- : m_item(0), m_edge(Qt::AnchorPoint(0)), m_type(Normal) {}
+ : m_item(nullptr), m_edge(Qt::AnchorPoint(0)), m_type(Normal) {}
#ifdef QT_DEBUG
inline QString toString() const;
@@ -123,18 +123,18 @@ struct AnchorData : public QSimplexVariable {
};
AnchorData()
- : QSimplexVariable(), from(0), to(0),
+ : QSimplexVariable(), from(nullptr), to(nullptr),
minSize(0), prefSize(0), maxSize(0),
minPrefSize(0), maxPrefSize(0),
sizeAtMinimum(0), sizeAtPreferred(0),
- sizeAtMaximum(0), item(0), graphicsAnchor(0),
+ sizeAtMaximum(0), item(nullptr), graphicsAnchor(nullptr),
type(Normal), isLayoutAnchor(false),
isCenterAnchor(false), orientation(0),
dependency(Independent) {}
virtual ~AnchorData();
virtual void updateChildrenSizes() {}
- void refreshSizeHints(const QLayoutStyleInfo *styleInfo = 0);
+ void refreshSizeHints(const QLayoutStyleInfo *styleInfo = nullptr);
#ifdef QT_DEBUG
void dump(int indent = 2);
@@ -402,7 +402,7 @@ public:
static QGraphicsAnchorLayoutPrivate *get(QGraphicsAnchorLayout *q)
{
- return q ? q->d_func() : 0;
+ return q ? q->d_func() : nullptr;
}
static Qt::AnchorPoint oppositeEdge(
@@ -443,7 +443,7 @@ public:
Qt::AnchorPoint firstEdge,
QGraphicsLayoutItem *secondItem,
Qt::AnchorPoint secondEdge,
- qreal *spacing = 0);
+ qreal *spacing = nullptr);
// Helper for Anchor Manipulation methods
void addAnchor_helper(QGraphicsLayoutItem *firstItem,
diff --git a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
index 370df9eed7..e98160e40f 100644
--- a/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
+++ b/src/widgets/graphicsview/qgraphicsgridlayoutengine_p.h
@@ -68,7 +68,7 @@ class QGraphicsLayoutPrivate;
class QGraphicsGridLayoutEngineItem : public QGridLayoutItem {
public:
QGraphicsGridLayoutEngineItem(QGraphicsLayoutItem *item, int row, int columns, int rowSpan = 1, int columnSpan = 1,
- Qt::Alignment alignment = 0)
+ Qt::Alignment alignment = nullptr)
: QGridLayoutItem(row, columns, rowSpan, columnSpan, alignment), q_layoutItem(item) {}
virtual QLayoutPolicy::Policy sizePolicy(Qt::Orientation orientation) const override
@@ -115,7 +115,7 @@ public:
{
const int index = indexOf(layoutItem);
if (index < 0)
- return 0;
+ return nullptr;
return static_cast<QGraphicsGridLayoutEngineItem*>(q_items.at(index));
}
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 65708fa1ca..7c0f836156 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -449,8 +449,8 @@
\value ItemSendsGeometryChanges The item enables itemChange()
notifications for ItemPositionChange, ItemPositionHasChanged,
- ItemMatrixChange, ItemTransformChange, ItemTransformHasChanged,
- ItemRotationChange, ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
+ ItemTransformChange, ItemTransformHasChanged, ItemRotationChange,
+ ItemRotationHasChanged, ItemScaleChange, ItemScaleHasChanged,
ItemTransformOriginPointChange, and ItemTransformOriginPointHasChanged. For
performance reasons, these notifications are disabled by default. You must
enable this flag to receive notifications for position and transform
@@ -4550,6 +4550,8 @@ QTransform QGraphicsItem::itemTransform(const QGraphicsItem *other, bool *ok) co
}
#if QT_DEPRECATED_SINCE(5, 13)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
/*!
\obsolete
@@ -4588,6 +4590,7 @@ void QGraphicsItem::setMatrix(const QMatrix &matrix, bool combine)
// Send post-notification.
itemChange(ItemTransformHasChanged, QVariant::fromValue<QTransform>(newTransform));
}
+QT_WARNING_POP
#endif
/*!
@@ -7566,19 +7569,6 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)
*/
void QGraphicsItem::updateMicroFocus()
{
-#if !defined(QT_NO_IM) && 0 /* Used to be included in Qt4 for Q_WS_X11 */
- if (QWidget *fw = QApplication::focusWidget()) {
- if (scene()) {
- for (int i = 0 ; i < scene()->views().count() ; ++i) {
- if (scene()->views().at(i) == fw) {
- if (qApp)
- QGuiApplication::inputMethod()->update(Qt::ImQueryAll);
- break;
- }
- }
- }
- }
-#endif
}
/*!
@@ -11536,9 +11526,14 @@ QDebug operator<<(QDebug debug, QGraphicsItem::GraphicsItemChange change)
case QGraphicsItem::ItemFlagsHaveChanged:
str = "ItemFlagsHaveChanged";
break;
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
case QGraphicsItem::ItemMatrixChange:
str = "ItemMatrixChange";
break;
+QT_WARNING_POP
+#endif
case QGraphicsItem::ItemParentChange:
str = "ItemParentChange";
break;
diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h
index 7dd4441ae9..d66a4917e5 100644
--- a/src/widgets/graphicsview/qgraphicsitem.h
+++ b/src/widgets/graphicsview/qgraphicsitem.h
@@ -110,8 +110,10 @@ public:
enum GraphicsItemChange {
ItemPositionChange,
- ItemMatrixChange,
- ItemVisibleChange,
+#if QT_DEPRECATED_SINCE(5, 14)
+ ItemMatrixChange Q_DECL_ENUMERATOR_DEPRECATED_X("Use ItemTransformChange instead"),
+#endif
+ ItemVisibleChange = 2,
ItemEnabledChange,
ItemSelectedChange,
ItemParentChange,
diff --git a/src/widgets/graphicsview/qgraphicsitem_p.h b/src/widgets/graphicsview/qgraphicsitem_p.h
index 54c25bf6e1..92d85f7125 100644
--- a/src/widgets/graphicsview/qgraphicsitem_p.h
+++ b/src/widgets/graphicsview/qgraphicsitem_p.h
@@ -78,13 +78,13 @@ public:
typedef void (*ClearFunction)(QDeclarativeListProperty<T> *);
QDeclarativeListProperty()
- : object(0), data(0), append(0), count(0), at(0), clear(0), dummy1(0), dummy2(0) {}
+ : object(nullptr), data(nullptr), append(nullptr), count(nullptr), at(nullptr), clear(nullptr), dummy1(nullptr), dummy2(nullptr) {}
QDeclarativeListProperty(QObject *o, QList<T *> &list)
: object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at),
- clear(qlist_clear), dummy1(0), dummy2(0) {}
+ clear(qlist_clear), dummy1(nullptr), dummy2(nullptr) {}
QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = 0, AtFunction t = 0,
ClearFunction r = 0)
- : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(0), dummy2(0) {}
+ : object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(nullptr), dummy2(nullptr) {}
bool operator==(const QDeclarativeListProperty &o) const {
return object == o.object &&
@@ -198,8 +198,8 @@ public:
|| (ancestorFlags & AncestorIgnoresTransformations);
}
- void combineTransformToParent(QTransform *x, const QTransform *viewTransform = 0) const;
- void combineTransformFromParent(QTransform *x, const QTransform *viewTransform = 0) const;
+ void combineTransformToParent(QTransform *x, const QTransform *viewTransform = nullptr) const;
+ void combineTransformFromParent(QTransform *x, const QTransform *viewTransform = nullptr) const;
virtual void updateSceneTransformFromParent();
static bool movableAncestorIsSelected(const QGraphicsItem *item);
@@ -232,7 +232,7 @@ public:
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem);
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
const QRegion &exposedRegion, bool allItems = false) const;
- QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem = 0) const;
+ QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem = nullptr) const;
QRectF sceneEffectiveBoundingRect() const;
QRectF effectiveBoundingRect(const QRectF &rect) const;
@@ -408,8 +408,8 @@ public:
void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide);
void clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel);
- void setSubFocus(QGraphicsItem *rootItem = 0, QGraphicsItem *stopItem = 0);
- void clearSubFocus(QGraphicsItem *rootItem = 0, QGraphicsItem *stopItem = 0);
+ void setSubFocus(QGraphicsItem *rootItem = nullptr, QGraphicsItem *stopItem = nullptr);
+ void clearSubFocus(QGraphicsItem *rootItem = nullptr, QGraphicsItem *stopItem = nullptr);
void resetFocusProxy();
virtual void subFocusItemChange();
virtual void focusScopeItemChange(bool isSubFocusItem);
@@ -541,7 +541,7 @@ struct QGraphicsItemPrivate::TransformData
onlyTransform(true)
{ }
- QTransform computedFullTransform(QTransform *postmultiplyTransform = 0) const
+ QTransform computedFullTransform(QTransform *postmultiplyTransform = nullptr) const
{
if (onlyTransform) {
if (!postmultiplyTransform || postmultiplyTransform->isIdentity())
@@ -595,12 +595,12 @@ class QGraphicsItemEffectSourcePrivate : public QGraphicsEffectSourcePrivate
{
public:
QGraphicsItemEffectSourcePrivate(QGraphicsItem *i)
- : QGraphicsEffectSourcePrivate(), item(i), info(0)
+ : QGraphicsEffectSourcePrivate(), item(i), info(nullptr)
{}
void detach() override
{
- item->d_ptr->graphicsEffect = 0;
+ item->d_ptr->graphicsEffect = nullptr;
item->prepareGeometryChange();
}
@@ -608,7 +608,7 @@ public:
{ return item; }
const QWidget *widget() const override
- { return 0; }
+ { return nullptr; }
void update() override {
item->d_ptr->updateDueToGraphicsEffect = true;
@@ -628,7 +628,7 @@ public:
}
const QStyleOption *styleOption() const override
- { return info ? info->option : 0; }
+ { return info ? info->option : nullptr; }
QRect deviceRect() const override
{
@@ -644,7 +644,7 @@ public:
QPixmap pixmap(Qt::CoordinateSystem system,
QPoint *offset,
QGraphicsEffect::PixmapPadMode mode) const override;
- QRectF paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = 0) const;
+ QRectF paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded = nullptr) const;
QGraphicsItem *item;
QGraphicsItemPaintInfo *info;
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.cpp b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
index 78b91d5c39..ad77e2f260 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.cpp
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
@@ -115,7 +115,7 @@ public:
QGraphicsItem *item;
QPointF startPos;
- QMatrix startMatrix;
+ QTransform startTransform;
qreal step;
@@ -294,23 +294,38 @@ QList<QPair<qreal, QPointF> > QGraphicsItemAnimation::posList() const
return list;
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
Returns the matrix used to transform the item at the specified \a step value.
+
+ \obsolete Use transformAt() instead
*/
QMatrix QGraphicsItemAnimation::matrixAt(qreal step) const
{
check_step_valid(step, "matrixAt");
+ return transformAt(step).toAffine();
+}
+#endif
+
+/*!
+ Returns the transform used for the item at the specified \a step value.
+
+ \since 5.14
+*/
+QTransform QGraphicsItemAnimation::transformAt(qreal step) const
+{
+ check_step_valid(step, "transformAt");
- QMatrix matrix;
+ QTransform transform;
if (!d->rotation.isEmpty())
- matrix.rotate(rotationAt(step));
+ transform.rotate(rotationAt(step));
if (!d->verticalScale.isEmpty())
- matrix.scale(horizontalScaleAt(step), verticalScaleAt(step));
+ transform.scale(horizontalScaleAt(step), verticalScaleAt(step));
if (!d->verticalShear.isEmpty())
- matrix.shear(horizontalShearAt(step), verticalShearAt(step));
+ transform.shear(horizontalShearAt(step), verticalShearAt(step));
if (!d->xTranslation.isEmpty())
- matrix.translate(xTranslationAt(step), yTranslationAt(step));
- return matrix;
+ transform.translate(xTranslationAt(step), yTranslationAt(step));
+ return transform;
}
/*!
@@ -542,7 +557,7 @@ void QGraphicsItemAnimation::setStep(qreal step)
|| !d->horizontalShear.isEmpty()
|| !d->xTranslation.isEmpty()
|| !d->yTranslation.isEmpty()) {
- d->item->setMatrix(d->startMatrix * matrixAt(step));
+ d->item->setTransform(d->startTransform * transformAt(step));
}
}
@@ -562,7 +577,7 @@ void QGraphicsItemAnimation::reset()
if (!d->item)
return;
d->startPos = d->item->pos();
- d->startMatrix = d->item->matrix();
+ d->startTransform = d->item->transform();
}
#endif
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.h b/src/widgets/graphicsview/qgraphicsitemanimation.h
index f983bd8026..3051fb2e2b 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.h
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.h
@@ -51,6 +51,7 @@ class QGraphicsItem;
class QMatrix;
class QPointF;
class QTimeLine;
+class QTransform;
template <class T1, class T2> struct QPair;
class QGraphicsItemAnimationPrivate;
@@ -71,7 +72,11 @@ public:
QList<QPair<qreal, QPointF> > posList() const;
void setPosAt(qreal step, const QPointF &pos);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("Use transformAt() instead")
QMatrix matrixAt(qreal step) const;
+#endif
+ QTransform transformAt(qreal step) const;
qreal rotationAt(qreal step) const;
QList<QPair<qreal, qreal> > rotationList() const;
diff --git a/src/widgets/graphicsview/qgraphicslayout.cpp b/src/widgets/graphicsview/qgraphicslayout.cpp
index ca0aef9e27..8b52b57580 100644
--- a/src/widgets/graphicsview/qgraphicslayout.cpp
+++ b/src/widgets/graphicsview/qgraphicslayout.cpp
@@ -338,7 +338,7 @@ void QGraphicsLayout::invalidate()
}
if (layoutItem && !layoutItem->isLayout()) {
// If a layout has a parent that is not a layout it must be a QGraphicsWidget.
- QApplication::postEvent(static_cast<QGraphicsWidget *>(layoutItem), new QEvent(QEvent::LayoutRequest));
+ QCoreApplication::postEvent(static_cast<QGraphicsWidget *>(layoutItem), new QEvent(QEvent::LayoutRequest));
}
}
}
diff --git a/src/widgets/graphicsview/qgraphicslayout_p.cpp b/src/widgets/graphicsview/qgraphicslayout_p.cpp
index ae1eeffa2b..59ed7acd72 100644
--- a/src/widgets/graphicsview/qgraphicslayout_p.cpp
+++ b/src/widgets/graphicsview/qgraphicslayout_p.cpp
@@ -108,7 +108,7 @@ Qt::LayoutDirection QGraphicsLayoutPrivate::visualDirection() const
if (maybeWidget->isWidget())
return static_cast<QGraphicsWidget*>(maybeWidget)->layoutDirection();
}
- return QApplication::layoutDirection();
+ return QGuiApplication::layoutDirection();
}
static bool removeLayoutItemFromLayout(QGraphicsLayout *lay, QGraphicsLayoutItem *layoutItem)
diff --git a/src/widgets/graphicsview/qgraphicslayout_p.h b/src/widgets/graphicsview/qgraphicslayout_p.h
index 302ad1e116..0d91151e22 100644
--- a/src/widgets/graphicsview/qgraphicslayout_p.h
+++ b/src/widgets/graphicsview/qgraphicslayout_p.h
@@ -91,7 +91,7 @@ public:
m_defaultSpacing[1] = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing);
}
- inline void invalidate() { m_valid = false; m_style = 0; m_widget = 0; }
+ inline void invalidate() { m_valid = false; m_style = nullptr; m_widget = nullptr; }
inline QStyle *style() const { return m_style; }
inline QWidget *widget() const { return m_widget; }
@@ -130,7 +130,7 @@ class Q_AUTOTEST_EXPORT QGraphicsLayoutPrivate : public QGraphicsLayoutItemPriva
Q_DECLARE_PUBLIC(QGraphicsLayout)
public:
- QGraphicsLayoutPrivate() : QGraphicsLayoutItemPrivate(0, true), left(-1.0), top(-1.0), right(-1.0), bottom(-1.0),
+ QGraphicsLayoutPrivate() : QGraphicsLayoutItemPrivate(nullptr, true), left(-1.0), top(-1.0), right(-1.0), bottom(-1.0),
activated(true) { }
void reparentChildItems(QGraphicsItem *newParent);
diff --git a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
index c3af9f4554..9807efb26e 100644
--- a/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
+++ b/src/widgets/graphicsview/qgraphicslayoutstyleinfo_p.h
@@ -84,7 +84,7 @@ public:
virtual void invalidate() override
{
- m_style = 0;
+ m_style = nullptr;
QAbstractLayoutStyleInfo::invalidate();
}
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index e9f092020f..7413a26261 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -342,7 +342,7 @@ void QGraphicsProxyWidgetPrivate::sendWidgetKeyEvent(QKeyEvent *event)
Q_ASSERT(receiver);
do {
- bool res = QApplication::sendEvent(receiver, event);
+ bool res = QCoreApplication::sendEvent(receiver, event);
if ((res && event->isAccepted()) || (q->isWindow() && receiver == widget))
break;
receiver = receiver->parentWidget();
@@ -356,9 +356,9 @@ void QGraphicsProxyWidgetPrivate::removeSubFocusHelper(QWidget *widget, Qt::Focu
{
QFocusEvent event(QEvent::FocusOut, reason);
QPointer<QWidget> widgetGuard = widget;
- QApplication::sendEvent(widget, &event);
+ QCoreApplication::sendEvent(widget, &event);
if (widgetGuard && event.isAccepted())
- QApplication::sendEvent(widget->style(), &event);
+ QCoreApplication::sendEvent(widget->style(), &event);
}
/*!
@@ -404,7 +404,7 @@ void QGraphicsProxyWidgetPrivate::_q_removeWidgetSlot()
{
Q_Q(QGraphicsProxyWidget);
if (!widget.isNull()) {
- if (QWExtra *extra = widget->d_func()->extra)
+ if (const auto &extra = widget->d_func()->extra)
extra->proxyWidget = 0;
}
widget = 0;
@@ -477,8 +477,8 @@ void QGraphicsProxyWidgetPrivate::updateProxyInputMethodAcceptanceFromWidget()
*/
void QGraphicsProxyWidgetPrivate::embedSubWindow(QWidget *subWin)
{
- QWExtra *extra;
- if (!((extra = subWin->d_func()->extra) && extra->proxyWidget)) {
+ const auto &extra = subWin->d_func()->extra;
+ if (!extra || !extra->proxyWidget) {
QGraphicsProxyWidget *subProxy = new QGraphicsProxyWidget(q_func(), subWin->windowFlags());
subProxy->d_func()->setWidget_helper(subWin, false);
}
@@ -631,7 +631,7 @@ void QGraphicsProxyWidgetPrivate::setWidget_helper(QWidget *newWidget, bool auto
if (!newWidget)
return;
if (!newWidget->isWindow()) {
- QWExtra *extra = newWidget->parentWidget()->d_func()->extra;
+ const auto &extra = newWidget->parentWidget()->d_func()->extra;
if (!extra || !extra->proxyWidget) {
qWarning("QGraphicsProxyWidget::setWidget: cannot embed widget %p "
"which is not a toplevel widget, and is not a child of an embedded widget", newWidget);
@@ -641,10 +641,10 @@ void QGraphicsProxyWidgetPrivate::setWidget_helper(QWidget *newWidget, bool auto
// Register this proxy within the widget's private.
// ### This is a bit backdoorish
- QWExtra *extra = newWidget->d_func()->extra;
+ QWExtra *extra = newWidget->d_func()->extra.get();
if (!extra) {
newWidget->d_func()->createExtra();
- extra = newWidget->d_func()->extra;
+ extra = newWidget->d_func()->extra.get();
}
QGraphicsProxyWidget **proxyWidget = &extra->proxyWidget;
if (*proxyWidget) {
@@ -697,9 +697,7 @@ void QGraphicsProxyWidgetPrivate::setWidget_helper(QWidget *newWidget, bool auto
if (!newWidget->testAttribute(Qt::WA_Resized))
newWidget->adjustSize();
- int left, top, right, bottom;
- newWidget->getContentsMargins(&left, &top, &right, &bottom);
- q->setContentsMargins(left, top, right, bottom);
+ q->setContentsMargins(newWidget->contentsMargins());
q->setWindowTitle(newWidget->windowTitle());
// size policies and constraints..
@@ -865,7 +863,7 @@ bool QGraphicsProxyWidget::event(QEvent *event)
case QEvent::ShortcutOverride: {
QWidget *focusWidget = d->widget->focusWidget();
while (focusWidget) {
- QApplication::sendEvent(focusWidget, event);
+ QCoreApplication::sendEvent(focusWidget, event);
if (event->isAccepted())
return true;
focusWidget = focusWidget->parentWidget();
@@ -878,7 +876,7 @@ bool QGraphicsProxyWidget::event(QEvent *event)
if (!(k->modifiers() & (Qt::ControlModifier | Qt::AltModifier))) { //### Add MetaModifier?
QWidget *focusWidget = d->widget->focusWidget();
while (focusWidget) {
- bool res = QApplication::sendEvent(focusWidget, event);
+ const bool res = QCoreApplication::sendEvent(focusWidget, event);
if ((res && event->isAccepted()) || (isWindow() && focusWidget == d->widget)) {
event->accept();
break;
@@ -897,7 +895,7 @@ bool QGraphicsProxyWidget::event(QEvent *event)
QGraphicsSceneHelpEvent *he = static_cast<QGraphicsSceneHelpEvent *>(event);
QPoint pos = d->mapToReceiver(mapFromScene(he->scenePos()), d->lastWidgetUnderMouse).toPoint();
QHelpEvent e(QEvent::ToolTip, pos, he->screenPos());
- QApplication::sendEvent(d->lastWidgetUnderMouse, &e);
+ QCoreApplication::sendEvent(d->lastWidgetUnderMouse, &e);
event->setAccepted(e.isAccepted());
return e.isAccepted();
}
@@ -919,7 +917,7 @@ bool QGraphicsProxyWidget::event(QEvent *event)
if (event->spontaneous())
qt_sendSpontaneousEvent(d->widget, event);
else
- QApplication::sendEvent(d->widget, event);
+ QCoreApplication::sendEvent(d->widget, event);
if (event->isAccepted())
return true;
@@ -1044,7 +1042,7 @@ void QGraphicsProxyWidget::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
// Send mouse event. ### Doesn't propagate the event.
QContextMenuEvent contextMenuEvent(QContextMenuEvent::Reason(event->reason()),
pos.toPoint(), globalPos, event->modifiers());
- QApplication::sendEvent(receiver, &contextMenuEvent);
+ QCoreApplication::sendEvent(receiver, &contextMenuEvent);
event->setAccepted(contextMenuEvent.isAccepted());
}
@@ -1065,7 +1063,7 @@ void QGraphicsProxyWidget::dragEnterEvent(QGraphicsSceneDragDropEvent *event)
QDragEnterEvent proxyDragEnter(event->pos().toPoint(), event->dropAction(), event->mimeData(), event->buttons(), event->modifiers());
proxyDragEnter.setAccepted(event->isAccepted());
- QApplication::sendEvent(d->widget, &proxyDragEnter);
+ QCoreApplication::sendEvent(d->widget, &proxyDragEnter);
event->setAccepted(proxyDragEnter.isAccepted());
if (proxyDragEnter.isAccepted()) // we discard answerRect
event->setDropAction(proxyDragEnter.dropAction());
@@ -1082,7 +1080,7 @@ void QGraphicsProxyWidget::dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
if (!d->widget || !d->dragDropWidget)
return;
QDragLeaveEvent proxyDragLeave;
- QApplication::sendEvent(d->dragDropWidget, &proxyDragLeave);
+ QCoreApplication::sendEvent(d->dragDropWidget, &proxyDragLeave);
d->dragDropWidget = 0;
#endif
}
@@ -1112,7 +1110,7 @@ void QGraphicsProxyWidget::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
// Try to enter before we leave
QDragEnterEvent dragEnter(receiverPos, event->possibleActions(), event->mimeData(), event->buttons(), event->modifiers());
dragEnter.setDropAction(event->proposedAction());
- QApplication::sendEvent(receiver, &dragEnter);
+ QCoreApplication::sendEvent(receiver, &dragEnter);
event->setAccepted(dragEnter.isAccepted());
event->setDropAction(dragEnter.dropAction());
if (!event->isAccepted()) {
@@ -1124,14 +1122,14 @@ void QGraphicsProxyWidget::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
if (d->dragDropWidget) {
QDragLeaveEvent dragLeave;
- QApplication::sendEvent(d->dragDropWidget, &dragLeave);
+ QCoreApplication::sendEvent(d->dragDropWidget, &dragLeave);
}
d->dragDropWidget = receiver;
}
QDragMoveEvent dragMove(receiverPos, event->possibleActions(), event->mimeData(), event->buttons(), event->modifiers());
event->setDropAction(d->lastDropAction);
- QApplication::sendEvent(receiver, &dragMove);
+ QCoreApplication::sendEvent(receiver, &dragMove);
event->setAccepted(dragMove.isAccepted());
event->setDropAction(dragMove.dropAction());
if (event->isAccepted())
@@ -1144,7 +1142,7 @@ void QGraphicsProxyWidget::dragMoveEvent(QGraphicsSceneDragDropEvent *event)
if (d->dragDropWidget) {
// Leave the last drag drop item
QDragLeaveEvent dragLeave;
- QApplication::sendEvent(d->dragDropWidget, &dragLeave);
+ QCoreApplication::sendEvent(d->dragDropWidget, &dragLeave);
d->dragDropWidget = 0;
}
// Propagate
@@ -1165,7 +1163,7 @@ void QGraphicsProxyWidget::dropEvent(QGraphicsSceneDragDropEvent *event)
if (d->widget && d->dragDropWidget) {
QPoint widgetPos = d->mapToReceiver(event->pos(), d->dragDropWidget).toPoint();
QDropEvent dropEvent(widgetPos, event->possibleActions(), event->mimeData(), event->buttons(), event->modifiers());
- QApplication::sendEvent(d->dragDropWidget, &dropEvent);
+ QCoreApplication::sendEvent(d->dragDropWidget, &dropEvent);
event->setAccepted(dropEvent.isAccepted());
d->dragDropWidget = 0;
}
@@ -1293,8 +1291,15 @@ void QGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
pos = d->mapToReceiver(pos, receiver);
// Send mouse event.
- QWheelEvent wheelEvent(pos.toPoint(), event->screenPos(), event->delta(),
- event->buttons(), event->modifiers(), event->orientation());
+ QPoint angleDelta;
+ if (event->orientation() == Qt::Horizontal)
+ angleDelta.setX(event->delta());
+ else
+ angleDelta.setY(event->delta());
+ // pixelDelta, inverted, scrollPhase and source from the original QWheelEvent
+ // were not preserved in the QGraphicsSceneWheelEvent unfortunately
+ QWheelEvent wheelEvent(pos, event->screenPos(), QPoint(), angleDelta,
+ event->buttons(), event->modifiers(), Qt::NoScrollPhase, false);
QPointer<QWidget> focusWidget = d->widget->focusWidget();
extern bool qt_sendSpontaneousEvent(QObject *, QEvent *);
qt_sendSpontaneousEvent(receiver, &wheelEvent);
@@ -1464,7 +1469,7 @@ void QGraphicsProxyWidget::inputMethodEvent(QInputMethodEvent *event)
Q_D(const QGraphicsProxyWidget);
QWidget *focusWidget = d->widget->focusWidget();
if (focusWidget && focusWidget->testAttribute(Qt::WA_InputMethodEnabled))
- QApplication::sendEvent(focusWidget, event);
+ QCoreApplication::sendEvent(focusWidget, event);
}
/*!
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 03717d5d1a..a47d0d879d 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -114,7 +114,7 @@
Another responsibility that QGraphicsScene has, is to propagate events
from QGraphicsView. To send an event to a scene, you construct an event
that inherits QEvent, and then send it using, for example,
- QApplication::sendEvent(). event() is responsible for dispatching
+ QCoreApplication::sendEvent(). event() is responsible for dispatching
the event to the individual items. Some common events are handled by
convenience event handlers. For example, key press events are handled by
keyPressEvent(), and mouse press events are handled by mousePressEvent().
@@ -459,7 +459,7 @@ void QGraphicsScenePrivate::_q_polishItems()
}
if (itemd->isWidget) {
QEvent event(QEvent::Polish);
- QApplication::sendEvent((QGraphicsWidget *)item, &event);
+ QCoreApplication::sendEvent((QGraphicsWidget *)item, &event);
}
}
@@ -782,7 +782,7 @@ void QGraphicsScenePrivate::setActivePanelHelper(QGraphicsItem *item, bool durin
// Update activate state.
activePanel = panel;
QEvent event(QEvent::ActivationChange);
- QApplication::sendEvent(q, &event);
+ QCoreApplication::sendEvent(q, &event);
// Activate
if (panel) {
@@ -1251,7 +1251,7 @@ bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event)
return false;
if (QGraphicsObject *o = item->toGraphicsObject()) {
bool spont = event->spontaneous();
- if (spont ? qt_sendSpontaneousEvent(o, event) : QApplication::sendEvent(o, event))
+ if (spont ? qt_sendSpontaneousEvent(o, event) : QCoreApplication::sendEvent(o, event))
return true;
event->spont = spont;
}
@@ -1577,7 +1577,7 @@ void QGraphicsScenePrivate::updateFont(const QFont &font)
// Send the scene a FontChange event.
QEvent event(QEvent::FontChange);
- QApplication::sendEvent(q, &event);
+ QCoreApplication::sendEvent(q, &event);
}
/*!
@@ -1601,7 +1601,7 @@ void QGraphicsScenePrivate::setPalette_helper(const QPalette &palette)
*/
void QGraphicsScenePrivate::resolvePalette()
{
- QPalette naturalPalette = QApplication::palette();
+ QPalette naturalPalette = QGuiApplication::palette();
naturalPalette.resolve(0);
QPalette resolvedPalette = palette.resolve(naturalPalette);
updatePalette(resolvedPalette);
@@ -1634,7 +1634,7 @@ void QGraphicsScenePrivate::updatePalette(const QPalette &palette)
// Send the scene a PaletteChange event.
QEvent event(QEvent::PaletteChange);
- QApplication::sendEvent(q, &event);
+ QCoreApplication::sendEvent(q, &event);
}
/*!
@@ -3555,10 +3555,10 @@ bool QGraphicsScene::eventFilter(QObject *watched, QEvent *event)
switch (event->type()) {
case QEvent::ApplicationPaletteChange:
- QApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange));
+ QCoreApplication::postEvent(this, new QEvent(QEvent::ApplicationPaletteChange));
break;
case QEvent::ApplicationFontChange:
- QApplication::postEvent(this, new QEvent(QEvent::ApplicationFontChange));
+ QCoreApplication::postEvent(this, new QEvent(QEvent::ApplicationFontChange));
break;
default:
break;
@@ -4177,14 +4177,6 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
wheelEvent->scenePos(),
wheelEvent->widget());
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // On Mac, ignore the event if the first item under the mouse is not the last opened
- // popup (or one of its descendant)
- if (!d->popupWidgets.isEmpty() && !wheelCandidates.isEmpty() && wheelCandidates.first() != d->popupWidgets.back() && !d->popupWidgets.back()->isAncestorOf(wheelCandidates.first())) {
- wheelEvent->accept();
- return;
- }
-#else
// Find the first popup under the mouse (including the popup's descendants) starting from the last.
// Remove all popups after the one found, or all or them if no popup is under the mouse.
// Then continue with the event.
@@ -4194,7 +4186,6 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
break;
d->removePopup(*iter);
}
-#endif
bool hasSetFocus = false;
for (QGraphicsItem *item : wheelCandidates) {
@@ -4416,11 +4407,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte
QGraphicsItem::CacheMode cacheMode = QGraphicsItem::CacheMode(itemd->cacheMode);
// Render directly, using no cache.
- if (cacheMode == QGraphicsItem::NoCache
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- || !X11->use_xrender
-#endif
- ) {
+ if (cacheMode == QGraphicsItem::NoCache) {
_q_paintItem(static_cast<QGraphicsWidget *>(item), painter, option, widget, true, painterStateProtection);
return;
}
@@ -5612,7 +5599,7 @@ void QGraphicsScene::setStyle(QStyle *style)
// Notify the scene.
QEvent event(QEvent::StyleChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
// Notify all widgets that don't have a style explicitly set.
const auto items_ = items();
@@ -5620,7 +5607,7 @@ void QGraphicsScene::setStyle(QStyle *style)
if (item->isWidget()) {
QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item);
if (!widget->testAttribute(Qt::WA_SetStyle))
- QApplication::sendEvent(widget, &event);
+ QCoreApplication::sendEvent(widget, &event);
}
}
}
@@ -5693,7 +5680,7 @@ QPalette QGraphicsScene::palette() const
void QGraphicsScene::setPalette(const QPalette &palette)
{
Q_D(QGraphicsScene);
- QPalette naturalPalette = QApplication::palette();
+ QPalette naturalPalette = QGuiApplication::palette();
naturalPalette.resolve(0);
QPalette resolvedPalette = palette.resolve(naturalPalette);
d->setPalette_helper(resolvedPalette);
@@ -6359,7 +6346,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
<< "delivering override to"
<< item.data() << gestures;
// send gesture override
- QGestureEvent ev(gestures.toList());
+ QGestureEvent ev(gestures.values());
ev.t = QEvent::GestureOverride;
ev.setWidget(event->widget());
// mark event and individual gestures as ignored
@@ -6449,7 +6436,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:"
<< "delivering to"
<< receiver.data() << gestures;
- QGestureEvent ev(gestures.toList());
+ QGestureEvent ev(gestures.values());
ev.setWidget(event->widget());
sendEvent(receiver.data(), &ev);
QSet<QGesture *> ignoredGestures;
@@ -6480,7 +6467,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
// look for new potential targets for gestures that were ignored
// and should be propagated.
- QSet<QGraphicsObject *> targetsSet = cachedTargetItems.toSet();
+ QSet<QGraphicsObject *> targetsSet(cachedTargetItems.constBegin(), cachedTargetItems.constEnd());
if (receiver) {
// first if the gesture should be propagated to parents only
@@ -6512,7 +6499,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
gestureTargetsAtHotSpots(ignoredGestures, Qt::ReceivePartialGestures,
&cachedItemGestures, &targetsSet, 0, 0);
- cachedTargetItems = targetsSet.toList();
+ cachedTargetItems = targetsSet.values();
std::sort(cachedTargetItems.begin(), cachedTargetItems.end(), qt_closestItemFirst);
DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:"
<< "new targets:" << cachedTargetItems;
@@ -6590,7 +6577,7 @@ void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original)
}
Q_ASSERT(target);
- const QList<QGesture *> list = gestures.toList();
+ const QList<QGesture *> list = gestures.values();
QGestureEvent ev(list);
sendEvent(target, &ev);
diff --git a/src/widgets/graphicsview/qgraphicsscene.h b/src/widgets/graphicsview/qgraphicsscene.h
index 3cc00ead08..d36a871533 100644
--- a/src/widgets/graphicsview/qgraphicsscene.h
+++ b/src/widgets/graphicsview/qgraphicsscene.h
@@ -115,7 +115,7 @@ public:
BspTreeIndex,
NoIndex = -1
};
-
+ Q_ENUM(ItemIndexMethod)
enum SceneLayer {
ItemLayer = 0x1,
BackgroundLayer = 0x2,
diff --git a/src/widgets/graphicsview/qgraphicsscene_p.h b/src/widgets/graphicsview/qgraphicsscene_p.h
index 14bafe6678..9ecfca8ebf 100644
--- a/src/widgets/graphicsview/qgraphicsscene_p.h
+++ b/src/widgets/graphicsview/qgraphicsscene_p.h
@@ -241,7 +241,7 @@ public:
void drawSubtreeRecursive(QGraphicsItem *item, QPainter *painter, const QTransform *const,
QRegion *exposedRegion, QWidget *widget, qreal parentOpacity = qreal(1.0),
- const QTransform *const effectTransform = 0);
+ const QTransform *const effectTransform = nullptr);
void draw(QGraphicsItem *, QPainter *, const QTransform *const, const QTransform *const,
QRegion *, QWidget *, qreal, const QTransform *const, bool, bool);
@@ -327,9 +327,9 @@ public:
void gestureTargetsAtHotSpots(const QSet<QGesture *> &gestures,
Qt::GestureFlag flag,
QHash<QGraphicsObject *, QSet<QGesture *> > *targets,
- QSet<QGraphicsObject *> *itemsSet = 0,
- QSet<QGesture *> *normal = 0,
- QSet<QGesture *> *conflicts = 0);
+ QSet<QGraphicsObject *> *itemsSet = nullptr,
+ QSet<QGesture *> *normal = nullptr,
+ QSet<QGesture *> *conflicts = nullptr);
void cancelGesturesForChildren(QGesture *original);
void grabGesture(QGraphicsItem *, Qt::GestureType gesture);
void ungrabGesture(QGraphicsItem *, Qt::GestureType gesture);
diff --git a/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h b/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h
index eb6bbbf49b..7e0e525a6b 100644
--- a/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h
+++ b/src/widgets/graphicsview/qgraphicsscenebsptreeindex_p.h
@@ -74,7 +74,7 @@ class Q_AUTOTEST_EXPORT QGraphicsSceneBspTreeIndex : public QGraphicsSceneIndex
Q_OBJECT
Q_PROPERTY(int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth)
public:
- QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = 0);
+ QGraphicsSceneBspTreeIndex(QGraphicsScene *scene = nullptr);
~QGraphicsSceneBspTreeIndex();
QList<QGraphicsItem *> estimateItems(const QRectF &rect, Qt::SortOrder order) const override;
diff --git a/src/widgets/graphicsview/qgraphicssceneindex_p.h b/src/widgets/graphicsview/qgraphicssceneindex_p.h
index 86637e836b..b494c52671 100644
--- a/src/widgets/graphicsview/qgraphicssceneindex_p.h
+++ b/src/widgets/graphicsview/qgraphicssceneindex_p.h
@@ -77,7 +77,7 @@ class Q_AUTOTEST_EXPORT QGraphicsSceneIndex : public QObject
Q_OBJECT
public:
- QGraphicsSceneIndex(QGraphicsScene *scene = 0);
+ QGraphicsSceneIndex(QGraphicsScene *scene = nullptr);
virtual ~QGraphicsSceneIndex();
QGraphicsScene *scene() const;
diff --git a/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h b/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h
index 07d5d80ef1..ead52c1fb0 100644
--- a/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h
+++ b/src/widgets/graphicsview/qgraphicsscenelinearindex_p.h
@@ -67,7 +67,7 @@ class Q_AUTOTEST_EXPORT QGraphicsSceneLinearIndex : public QGraphicsSceneIndex
Q_OBJECT
public:
- QGraphicsSceneLinearIndex(QGraphicsScene *scene = 0) : QGraphicsSceneIndex(scene), m_numSortedElements(0)
+ QGraphicsSceneLinearIndex(QGraphicsScene *scene = nullptr) : QGraphicsSceneIndex(scene), m_numSortedElements(0)
{ }
QList<QGraphicsItem *> items(Qt::SortOrder order = Qt::DescendingOrder) const override
diff --git a/src/widgets/graphicsview/qgraphicstransform_p.h b/src/widgets/graphicsview/qgraphicstransform_p.h
index e54ee9fb3c..05e12c3e64 100644
--- a/src/widgets/graphicsview/qgraphicstransform_p.h
+++ b/src/widgets/graphicsview/qgraphicstransform_p.h
@@ -66,7 +66,7 @@ public:
Q_DECLARE_PUBLIC(QGraphicsTransform)
QGraphicsTransformPrivate()
- : QObjectPrivate(), item(0) {}
+ : QObjectPrivate(), item(nullptr) {}
~QGraphicsTransformPrivate();
QGraphicsItem *item;
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 6079e41bfc..57be850829 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -667,7 +667,7 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
if (event->spontaneous())
qt_sendSpontaneousEvent(scene, &mouseEvent);
else
- QApplication::sendEvent(scene, &mouseEvent);
+ QCoreApplication::sendEvent(scene, &mouseEvent);
// Remember whether the last event was accepted or not.
lastMouseEvent.setAccepted(mouseEvent.isAccepted());
@@ -1716,7 +1716,7 @@ void QGraphicsView::setScene(QGraphicsScene *scene)
if (isActiveWindow() && isVisible()) {
QEvent windowDeactivate(QEvent::WindowDeactivate);
- QApplication::sendEvent(d->scene, &windowDeactivate);
+ QCoreApplication::sendEvent(d->scene, &windowDeactivate);
}
if(hasFocus())
d->scene->clearFocus();
@@ -1744,7 +1744,7 @@ void QGraphicsView::setScene(QGraphicsScene *scene)
if (isActiveWindow() && isVisible()) {
QEvent windowActivate(QEvent::WindowActivate);
- QApplication::sendEvent(d->scene, &windowActivate);
+ QCoreApplication::sendEvent(d->scene, &windowActivate);
}
} else {
d->recalculateContentSize();
@@ -2809,7 +2809,7 @@ bool QGraphicsView::event(QEvent *event)
switch (event->type()) {
case QEvent::ShortcutOverride:
if (d->scene)
- return QApplication::sendEvent(d->scene, event);
+ return QCoreApplication::sendEvent(d->scene, event);
break;
case QEvent::KeyPress:
if (d->scene) {
@@ -2821,7 +2821,7 @@ bool QGraphicsView::event(QEvent *event)
// and the base implementation will call QGraphicsView's
// focusNextPrevChild() function. If the event is ignored,
// we fall back to standard tab focus handling.
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
if (event->isAccepted())
return true;
// Ensure the event doesn't propagate just because the
@@ -2850,10 +2850,10 @@ bool QGraphicsView::viewportEvent(QEvent *event)
switch (event->type()) {
case QEvent::Enter:
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
break;
case QEvent::WindowActivate:
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
break;
case QEvent::WindowDeactivate:
// ### This is a temporary fix for until we get proper mouse
@@ -2862,19 +2862,19 @@ bool QGraphicsView::viewportEvent(QEvent *event)
// Remove all popups when the scene loses focus.
if (!d->scene->d_func()->popupWidgets.isEmpty())
d->scene->d_func()->removePopup(d->scene->d_func()->popupWidgets.constFirst());
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
break;
case QEvent::Show:
if (d->scene && isActiveWindow()) {
QEvent windowActivate(QEvent::WindowActivate);
- QApplication::sendEvent(d->scene, &windowActivate);
+ QCoreApplication::sendEvent(d->scene, &windowActivate);
}
break;
case QEvent::Hide:
// spontaneous event will generate a WindowDeactivate.
if (!event->spontaneous() && d->scene && isActiveWindow()) {
QEvent windowDeactivate(QEvent::WindowDeactivate);
- QApplication::sendEvent(d->scene, &windowDeactivate);
+ QCoreApplication::sendEvent(d->scene, &windowDeactivate);
}
break;
case QEvent::Leave: {
@@ -2892,7 +2892,7 @@ bool QGraphicsView::viewportEvent(QEvent *event)
Q_ASSERT(event->d == 0);
QScopedValueRollback<QEventPrivate *> rb(event->d);
event->d = reinterpret_cast<QEventPrivate *>(viewport());
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
break;
}
#ifndef QT_NO_TOOLTIP
@@ -2902,7 +2902,7 @@ bool QGraphicsView::viewportEvent(QEvent *event)
helpEvent.setWidget(viewport());
helpEvent.setScreenPos(toolTip->globalPos());
helpEvent.setScenePos(mapToScene(toolTip->pos()));
- QApplication::sendEvent(d->scene, &helpEvent);
+ QCoreApplication::sendEvent(d->scene, &helpEvent);
toolTip->setAccepted(helpEvent.isAccepted());
return true;
}
@@ -2940,7 +2940,7 @@ bool QGraphicsView::viewportEvent(QEvent *event)
QTouchEvent *touchEvent = static_cast<QTouchEvent *>(event);
touchEvent->setTarget(viewport());
QGraphicsViewPrivate::translateTouchEvent(d, touchEvent);
- (void) QApplication::sendEvent(d->scene, touchEvent);
+ QCoreApplication::sendEvent(d->scene, touchEvent);
} else {
event->ignore();
}
@@ -2957,7 +2957,7 @@ bool QGraphicsView::viewportEvent(QEvent *event)
if (d->scene && d->sceneInteractionAllowed) {
QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(event);
gestureEvent->setWidget(viewport());
- (void) QApplication::sendEvent(d->scene, gestureEvent);
+ QCoreApplication::sendEvent(d->scene, gestureEvent);
}
return true;
}
@@ -2992,7 +2992,7 @@ void QGraphicsView::contextMenuEvent(QContextMenuEvent *event)
contextEvent.setModifiers(event->modifiers());
contextEvent.setReason((QGraphicsSceneContextMenuEvent::Reason)(event->reason()));
contextEvent.setAccepted(event->isAccepted());
- QApplication::sendEvent(d->scene, &contextEvent);
+ QCoreApplication::sendEvent(d->scene, &contextEvent);
event->setAccepted(contextEvent.isAccepted());
}
#endif // QT_NO_CONTEXTMENU
@@ -3012,7 +3012,7 @@ void QGraphicsView::dropEvent(QDropEvent *event)
d->populateSceneDragDropEvent(&sceneEvent, event);
// Send it to the scene.
- QApplication::sendEvent(d->scene, &sceneEvent);
+ QCoreApplication::sendEvent(d->scene, &sceneEvent);
// Accept the originating event if the scene accepted the scene event.
event->setAccepted(sceneEvent.isAccepted());
@@ -3043,7 +3043,7 @@ void QGraphicsView::dragEnterEvent(QDragEnterEvent *event)
d->storeDragDropEvent(&sceneEvent);
// Send it to the scene.
- QApplication::sendEvent(d->scene, &sceneEvent);
+ QCoreApplication::sendEvent(d->scene, &sceneEvent);
// Accept the originating event if the scene accepted the scene event.
if (sceneEvent.isAccepted()) {
@@ -3081,7 +3081,7 @@ void QGraphicsView::dragLeaveEvent(QDragLeaveEvent *event)
d->lastDragDropEvent = 0;
// Send it to the scene.
- QApplication::sendEvent(d->scene, &sceneEvent);
+ QCoreApplication::sendEvent(d->scene, &sceneEvent);
// Accept the originating event if the scene accepted the scene event.
if (sceneEvent.isAccepted())
@@ -3105,7 +3105,7 @@ void QGraphicsView::dragMoveEvent(QDragMoveEvent *event)
d->storeDragDropEvent(&sceneEvent);
// Send it to the scene.
- QApplication::sendEvent(d->scene, &sceneEvent);
+ QCoreApplication::sendEvent(d->scene, &sceneEvent);
// Ignore the originating event if the scene ignored the scene event.
event->setAccepted(sceneEvent.isAccepted());
@@ -3123,7 +3123,7 @@ void QGraphicsView::focusInEvent(QFocusEvent *event)
d->updateInputMethodSensitivity();
QAbstractScrollArea::focusInEvent(event);
if (d->scene)
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
// Pass focus on if the scene cannot accept focus.
if (!d->scene || !event->isAccepted())
QAbstractScrollArea::focusInEvent(event);
@@ -3145,7 +3145,7 @@ void QGraphicsView::focusOutEvent(QFocusEvent *event)
Q_D(QGraphicsView);
QAbstractScrollArea::focusOutEvent(event);
if (d->scene)
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
}
/*!
@@ -3158,7 +3158,7 @@ void QGraphicsView::keyPressEvent(QKeyEvent *event)
QAbstractScrollArea::keyPressEvent(event);
return;
}
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
if (!event->isAccepted())
QAbstractScrollArea::keyPressEvent(event);
}
@@ -3171,7 +3171,7 @@ void QGraphicsView::keyReleaseEvent(QKeyEvent *event)
Q_D(QGraphicsView);
if (!d->scene || !d->sceneInteractionAllowed)
return;
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
if (!event->isAccepted())
QAbstractScrollArea::keyReleaseEvent(event);
}
@@ -3210,7 +3210,7 @@ void QGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
if (event->spontaneous())
qt_sendSpontaneousEvent(d->scene, &mouseEvent);
else
- QApplication::sendEvent(d->scene, &mouseEvent);
+ QCoreApplication::sendEvent(d->scene, &mouseEvent);
// Update the original mouse event accepted state.
const bool isAccepted = mouseEvent.isAccepted();
@@ -3261,7 +3261,7 @@ void QGraphicsView::mousePressEvent(QMouseEvent *event)
if (event->spontaneous())
qt_sendSpontaneousEvent(d->scene, &mouseEvent);
else
- QApplication::sendEvent(d->scene, &mouseEvent);
+ QCoreApplication::sendEvent(d->scene, &mouseEvent);
// Update the original mouse event accepted state.
bool isAccepted = mouseEvent.isAccepted();
@@ -3397,7 +3397,7 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)
if (event->spontaneous())
qt_sendSpontaneousEvent(d->scene, &mouseEvent);
else
- QApplication::sendEvent(d->scene, &mouseEvent);
+ QCoreApplication::sendEvent(d->scene, &mouseEvent);
// Update the last mouse event selected state.
d->lastMouseEvent.setAccepted(mouseEvent.isAccepted());
@@ -3426,14 +3426,15 @@ void QGraphicsView::wheelEvent(QWheelEvent *event)
QGraphicsSceneWheelEvent wheelEvent(QEvent::GraphicsSceneWheel);
wheelEvent.setWidget(viewport());
- wheelEvent.setScenePos(mapToScene(event->pos()));
- wheelEvent.setScreenPos(event->globalPos());
+ wheelEvent.setScenePos(mapToScene(event->position().toPoint()));
+ wheelEvent.setScreenPos(event->globalPosition().toPoint());
wheelEvent.setButtons(event->buttons());
wheelEvent.setModifiers(event->modifiers());
- wheelEvent.setDelta(event->delta());
- wheelEvent.setOrientation(event->orientation());
+ const bool horizontal = qAbs(event->angleDelta().x()) > qAbs(event->angleDelta().y());
+ wheelEvent.setDelta(horizontal ? event->angleDelta().x() : event->angleDelta().y());
+ wheelEvent.setOrientation(horizontal ? Qt::Horizontal : Qt::Vertical);
wheelEvent.setAccepted(false);
- QApplication::sendEvent(d->scene, &wheelEvent);
+ QCoreApplication::sendEvent(d->scene, &wheelEvent);
event->setAccepted(wheelEvent.isAccepted());
if (!event->isAccepted())
QAbstractScrollArea::wheelEvent(event);
@@ -3475,11 +3476,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
const QTransform viewTransform = painter.worldTransform();
// Draw background
- if ((d->cacheMode & CacheBackground)
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- && X11->use_xrender
-#endif
- ) {
+ if (d->cacheMode & CacheBackground) {
// Recreate the background pixmap, and flag the whole background as
// exposed.
if (d->mustResizeBackgroundPixmap) {
@@ -3676,11 +3673,7 @@ void QGraphicsView::scrollContentsBy(int dx, int dy)
d->updateLastCenterPoint();
- if ((d->cacheMode & CacheBackground)
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- && X11->use_xrender
-#endif
- ) {
+ if (d->cacheMode & CacheBackground) {
// Below, QPixmap::scroll() works in device pixels, while the delta values
// and backgroundPixmapExposed are in device independent pixels.
const qreal dpr = d->backgroundPixmap.devicePixelRatio();
@@ -3720,7 +3713,7 @@ void QGraphicsView::inputMethodEvent(QInputMethodEvent *event)
{
Q_D(QGraphicsView);
if (d->scene)
- QApplication::sendEvent(d->scene, event);
+ QCoreApplication::sendEvent(d->scene, event);
}
/*!
diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h
index e02fba69c9..1389796c3f 100644
--- a/src/widgets/graphicsview/qgraphicsview.h
+++ b/src/widgets/graphicsview/qgraphicsview.h
@@ -107,7 +107,9 @@ public:
Q_ENUM(ViewportUpdateMode)
enum OptimizationFlag {
- DontClipPainter = 0x1, // obsolete
+#if QT_DEPRECATED_SINCE(5, 14)
+ DontClipPainter Q_DECL_ENUMERATOR_DEPRECATED_X("This flag is unused") = 0x1, // obsolete
+#endif
DontSavePainterState = 0x2,
DontAdjustForAntialiasing = 0x4,
IndirectPainting = 0x8
diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h
index 0428b9ce70..01af61d6ba 100644
--- a/src/widgets/graphicsview/qgraphicsview_p.h
+++ b/src/widgets/graphicsview/qgraphicsview_p.h
@@ -184,24 +184,10 @@ public:
inline void dispatchPendingUpdateRequests()
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // QWidget::update() works slightly different on the Mac without the raster engine;
- // it's not part of our backing store so it needs special threatment.
- if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) {
- // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa)
- // is called, which means there's a pending update request. We want to dispatch it
- // now because otherwise graphics view updates would require two
- // round-trips in the event loop before the item is painted.
- extern void qt_mac_dispatchPendingUpdateRequests(QWidget *);
- qt_mac_dispatchPendingUpdateRequests(viewport->window());
- } else
-#endif
- {
- if (qt_widget_private(viewport)->paintOnScreen())
- QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest);
- else
- QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
- }
+ if (qt_widget_private(viewport)->shouldPaintOnScreen())
+ QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest);
+ else
+ QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
}
void setUpdateClip(QGraphicsItem *);
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp
index ad3be5766d..cf041b9817 100644
--- a/src/widgets/graphicsview/qgraphicswidget.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget.cpp
@@ -390,7 +390,7 @@ void QGraphicsWidget::setGeometry(const QRectF &rect)
QGraphicsSceneMoveEvent event;
event.setOldPos(oldPos);
event.setNewPos(pos());
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
if (wd->inSetPos) {
//set the new pos
d->geom.moveTopLeft(pos());
@@ -413,10 +413,10 @@ void QGraphicsWidget::setGeometry(const QRectF &rect)
QGraphicsLayout *lay = wd->layout;
if (QGraphicsLayout::instantInvalidatePropagation()) {
if (!lay || lay->isActivated()) {
- QApplication::sendEvent(this, &re);
+ QCoreApplication::sendEvent(this, &re);
}
} else {
- QApplication::sendEvent(this, &re);
+ QCoreApplication::sendEvent(this, &re);
}
}
}
@@ -427,7 +427,7 @@ relayoutChildrenAndReturn:
if (QGraphicsLayout *lay = wd->layout) {
if (!lay->isActivated()) {
QEvent layoutRequest(QEvent::LayoutRequest);
- QApplication::sendEvent(this, &layoutRequest);
+ QCoreApplication::sendEvent(this, &layoutRequest);
}
}
}
@@ -473,8 +473,9 @@ relayoutChildrenAndReturn:
*/
/*!
- Sets the widget's contents margins to \a left, \a top, \a right and \a
- bottom.
+ \since 5.14
+
+ Sets the widget's contents margins to \a margins.
Contents margins are used by the assigned layout to define the placement
of subwidgets and layouts. Margins are particularly useful for widgets
@@ -488,23 +489,17 @@ relayoutChildrenAndReturn:
\sa getContentsMargins(), setGeometry()
*/
-void QGraphicsWidget::setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)
+void QGraphicsWidget::setContentsMargins(QMarginsF margins)
{
Q_D(QGraphicsWidget);
- if (!d->margins && left == 0 && top == 0 && right == 0 && bottom == 0)
+ if (!d->margins && margins.isNull())
return;
d->ensureMargins();
- if (left == d->margins[d->Left]
- && top == d->margins[d->Top]
- && right == d->margins[d->Right]
- && bottom == d->margins[d->Bottom])
+ if (*d->margins == margins)
return;
- d->margins[d->Left] = left;
- d->margins[d->Top] = top;
- d->margins[d->Right] = right;
- d->margins[d->Bottom] = bottom;
+ *d->margins = margins;
if (QGraphicsLayout *l = d->layout)
l->invalidate();
@@ -512,7 +507,18 @@ void QGraphicsWidget::setContentsMargins(qreal left, qreal top, qreal right, qre
updateGeometry();
QEvent e(QEvent::ContentsRectChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
+}
+
+/*!
+ \overload
+
+ Sets the widget's contents margins to \a left, \a top, \a right and \a
+ bottom.
+*/
+void QGraphicsWidget::setContentsMargins(qreal left, qreal top, qreal right, qreal bottom)
+{
+ setContentsMargins({left, top, right, bottom});
}
/*!
@@ -528,18 +534,19 @@ void QGraphicsWidget::getContentsMargins(qreal *left, qreal *top, qreal *right,
if (left || top || right || bottom)
d->ensureMargins();
if (left)
- *left = d->margins[d->Left];
+ *left = d->margins->left();
if (top)
- *top = d->margins[d->Top];
+ *top = d->margins->top();
if (right)
- *right = d->margins[d->Right];
+ *right = d->margins->right();
if (bottom)
- *bottom = d->margins[d->Bottom];
+ *bottom = d->margins->bottom();
}
/*!
- Sets the widget's window frame margins to \a left, \a top, \a right and
- \a bottom. The default frame margins are provided by the style, and they
+ \since 5.14
+ Sets the widget's window frame margins to \a margins.
+ The default frame margins are provided by the style, and they
depend on the current window flags.
If you would like to draw your own window decoration, you can set your
@@ -547,30 +554,33 @@ void QGraphicsWidget::getContentsMargins(qreal *left, qreal *top, qreal *right,
\sa unsetWindowFrameMargins(), getWindowFrameMargins(), windowFrameRect()
*/
-void QGraphicsWidget::setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom)
+void QGraphicsWidget::setWindowFrameMargins(QMarginsF margins)
{
Q_D(QGraphicsWidget);
- if (!d->windowFrameMargins && left == 0 && top == 0 && right == 0 && bottom == 0)
+ if (!d->windowFrameMargins && margins.isNull())
return;
d->ensureWindowFrameMargins();
- bool unchanged =
- d->windowFrameMargins[d->Left] == left
- && d->windowFrameMargins[d->Top] == top
- && d->windowFrameMargins[d->Right] == right
- && d->windowFrameMargins[d->Bottom] == bottom;
+ const bool unchanged = *d->windowFrameMargins == margins;
if (d->setWindowFrameMargins && unchanged)
return;
if (!unchanged)
prepareGeometryChange();
- d->windowFrameMargins[d->Left] = left;
- d->windowFrameMargins[d->Top] = top;
- d->windowFrameMargins[d->Right] = right;
- d->windowFrameMargins[d->Bottom] = bottom;
+ *d->windowFrameMargins = margins;
d->setWindowFrameMargins = true;
}
/*!
+ \overload
+ Sets the widget's window frame margins to \a left, \a top, \a right and
+ \a bottom.
+*/
+void QGraphicsWidget::setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom)
+{
+ setWindowFrameMargins({left, top, right, bottom});
+}
+
+/*!
Gets the widget's window frame margins. The margins are stored in \a left,
\a top, \a right and \a bottom as pointers to qreals. Each argument can
be \e {omitted} by passing \nullptr.
@@ -583,13 +593,13 @@ void QGraphicsWidget::getWindowFrameMargins(qreal *left, qreal *top, qreal *righ
if (left || top || right || bottom)
d->ensureWindowFrameMargins();
if (left)
- *left = d->windowFrameMargins[d->Left];
+ *left = d->windowFrameMargins->left();
if (top)
- *top = d->windowFrameMargins[d->Top];
+ *top = d->windowFrameMargins->top();
if (right)
- *right = d->windowFrameMargins[d->Right];
+ *right = d->windowFrameMargins->right();
if (bottom)
- *bottom = d->windowFrameMargins[d->Bottom];
+ *bottom = d->windowFrameMargins->bottom();
}
/*!
@@ -624,8 +634,8 @@ QRectF QGraphicsWidget::windowFrameGeometry() const
{
Q_D(const QGraphicsWidget);
return d->windowFrameMargins
- ? geometry().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top],
- d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom])
+ ? geometry().adjusted(-d->windowFrameMargins->left(), -d->windowFrameMargins->top(),
+ d->windowFrameMargins->right(), d->windowFrameMargins->bottom())
: geometry();
}
@@ -638,8 +648,8 @@ QRectF QGraphicsWidget::windowFrameRect() const
{
Q_D(const QGraphicsWidget);
return d->windowFrameMargins
- ? rect().adjusted(-d->windowFrameMargins[d->Left], -d->windowFrameMargins[d->Top],
- d->windowFrameMargins[d->Right], d->windowFrameMargins[d->Bottom])
+ ? rect().adjusted(-d->windowFrameMargins->left(), -d->windowFrameMargins->top(),
+ d->windowFrameMargins->right(), d->windowFrameMargins->bottom())
: rect();
}
@@ -706,22 +716,6 @@ void QGraphicsWidget::initStyleOption(QStyleOption *option) const
option->state |= QStyle::State_Window;
/*
###
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- extern bool qt_mac_can_clickThrough(const QGraphicsWidget *w); //qwidget_mac.cpp
- if (!(option->state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
- option->state &= ~QStyle::State_Enabled;
-
- switch (QMacStyle::widgetSizePolicy(widget)) {
- case QMacStyle::SizeSmall:
- option->state |= QStyle::State_Small;
- break;
- case QMacStyle::SizeMini:
- option->state |= QStyle::State_Mini;
- break;
- default:
- ;
- }
-#endif
#ifdef QT_KEYPAD_NAVIGATION
if (widget->hasEditFocus())
state |= QStyle::State_HasEditFocus;
@@ -751,8 +745,8 @@ QSizeF QGraphicsWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c
if (d->layout) {
QSizeF marginSize(0,0);
if (d->margins) {
- marginSize = QSizeF(d->margins[d->Left] + d->margins[d->Right],
- d->margins[d->Top] + d->margins[d->Bottom]);
+ marginSize = QSizeF(d->margins->left() + d->margins->right(),
+ d->margins->top() + d->margins->bottom());
}
sh = d->layout->effectiveSizeHint(which, constraint - marginSize);
sh += marginSize;
@@ -953,7 +947,7 @@ void QGraphicsWidget::setStyle(QStyle *style)
// Deliver StyleChange to the widget itself (doesn't propagate).
QEvent event(QEvent::StyleChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
/*!
@@ -1018,7 +1012,7 @@ void QGraphicsWidget::setFont(const QFont &font)
By default, this property contains the application's default palette.
- \sa QApplication::palette(), QGraphicsScene::palette, QPalette::resolve()
+ \sa QGuiApplication::palette(), QGraphicsScene::palette, QPalette::resolve()
*/
QPalette QGraphicsWidget::palette() const
{
@@ -1090,7 +1084,7 @@ void QGraphicsWidget::updateGeometry()
// This is for custom layouting
QGraphicsWidget *parentWid = parentWidget(); //###
if (parentWid->isVisible())
- QApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest));
+ QCoreApplication::postEvent(parentWid, new QEvent(QEvent::LayoutRequest));
} else {
/**
* If this is the topmost widget, post a LayoutRequest event to the widget.
@@ -1098,7 +1092,7 @@ void QGraphicsWidget::updateGeometry()
* widgets in one go. This will make a relayout flicker-free.
*/
if (QGraphicsLayout::instantInvalidatePropagation())
- QApplication::postEvent(static_cast<QGraphicsWidget *>(this), new QEvent(QEvent::LayoutRequest));
+ QCoreApplication::postEvent(static_cast<QGraphicsWidget *>(this), new QEvent(QEvent::LayoutRequest));
}
if (!QGraphicsLayout::instantInvalidatePropagation()) {
bool wasResized = testAttribute(Qt::WA_Resized);
@@ -1135,14 +1129,14 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &
case ItemEnabledHasChanged: {
// Send EnabledChange after the enabled state has changed.
QEvent event(QEvent::EnabledChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
break;
}
case ItemVisibleChange:
if (value.toBool()) {
// Send Show event before the item has been shown.
QShowEvent event;
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
bool resized = testAttribute(Qt::WA_Resized);
if (!resized) {
adjustSize();
@@ -1158,7 +1152,7 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &
if (!value.toBool()) {
// Send Hide event after the item has been hidden.
QHideEvent event;
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
break;
case ItemPositionHasChanged:
@@ -1167,25 +1161,25 @@ QVariant QGraphicsWidget::itemChange(GraphicsItemChange change, const QVariant &
case ItemParentChange: {
// Deliver ParentAboutToChange.
QEvent event(QEvent::ParentAboutToChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
break;
}
case ItemParentHasChanged: {
// Deliver ParentChange.
QEvent event(QEvent::ParentChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
break;
}
case ItemCursorHasChanged: {
// Deliver CursorChange.
QEvent event(QEvent::CursorChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
break;
}
case ItemToolTipHasChanged: {
// Deliver ToolTipChange.
QEvent event(QEvent::ToolTipChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
break;
}
default:
@@ -1320,7 +1314,7 @@ Qt::WindowFrameSection QGraphicsWidget::windowFrameSectionAt(const QPointF &pos)
const qreal cornerMargin = 20;
//### Not sure of this one, it should be the same value for all edges.
const qreal windowFrameWidth = d->windowFrameMargins
- ? d->windowFrameMargins[d->Left] : 0;
+ ? d->windowFrameMargins->left() : 0;
Qt::WindowFrameSection s = Qt::NoSection;
if (x <= left + cornerMargin) {
@@ -1347,7 +1341,7 @@ Qt::WindowFrameSection QGraphicsWidget::windowFrameSectionAt(const QPointF &pos)
if (s == Qt::NoSection) {
QRectF r1 = r;
r1.setHeight(d->windowFrameMargins
- ? d->windowFrameMargins[d->Top] : 0);
+ ? d->windowFrameMargins->top() : 0);
if (r1.contains(pos))
s = Qt::TitleBarArea;
}
@@ -1920,7 +1914,7 @@ int QGraphicsWidget::grabShortcut(const QKeySequence &sequence, Qt::ShortcutCont
if (sequence.isEmpty())
return 0;
// ### setAttribute(Qt::WA_GrabbedShortcut);
- return qApp->d_func()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher);
+ return QGuiApplicationPrivate::instance()->shortcutMap.addShortcut(this, sequence, context, qWidgetShortcutContextMatcher);
}
/*!
@@ -1944,7 +1938,7 @@ void QGraphicsWidget::releaseShortcut(int id)
{
Q_ASSERT(qApp);
if (id)
- qApp->d_func()->shortcutMap.removeShortcut(id, this, 0);
+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(id, this, 0);
}
/*!
@@ -1965,7 +1959,7 @@ void QGraphicsWidget::setShortcutEnabled(int id, bool enabled)
{
Q_ASSERT(qApp);
if (id)
- qApp->d_func()->shortcutMap.setShortcutEnabled(enabled, id, this, 0);
+ QGuiApplicationPrivate::instance()->shortcutMap.setShortcutEnabled(enabled, id, this, 0);
}
/*!
@@ -1980,7 +1974,7 @@ void QGraphicsWidget::setShortcutAutoRepeat(int id, bool enabled)
{
Q_ASSERT(qApp);
if (id)
- qApp->d_func()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0);
+ QGuiApplicationPrivate::instance()->shortcutMap.setShortcutAutoRepeat(enabled, id, this, 0);
}
#endif
@@ -2058,7 +2052,7 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action)
}
QActionEvent e(QEvent::ActionAdded, action, before);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
/*!
@@ -2101,7 +2095,7 @@ void QGraphicsWidget::removeAction(QAction *action)
if (d->actions.removeAll(action)) {
QActionEvent e(QEvent::ActionRemoved, action);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
}
@@ -2394,7 +2388,7 @@ QPainterPath QGraphicsWidget::shape() const
bool QGraphicsWidget::close()
{
QCloseEvent closeEvent;
- QApplication::sendEvent(this, &closeEvent);
+ QCoreApplication::sendEvent(this, &closeEvent);
if (!closeEvent.isAccepted()) {
return false;
}
diff --git a/src/widgets/graphicsview/qgraphicswidget.h b/src/widgets/graphicsview/qgraphicswidget.h
index 481fb55db3..8223b921c9 100644
--- a/src/widgets/graphicsview/qgraphicswidget.h
+++ b/src/widgets/graphicsview/qgraphicswidget.h
@@ -111,9 +111,11 @@ public:
inline QRectF rect() const { return QRectF(QPointF(), size()); }
void setContentsMargins(qreal left, qreal top, qreal right, qreal bottom);
+ void setContentsMargins(QMarginsF margins);
void getContentsMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const override;
void setWindowFrameMargins(qreal left, qreal top, qreal right, qreal bottom);
+ void setWindowFrameMargins(QMarginsF margins);
void getWindowFrameMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const;
void unsetWindowFrameMargins();
QRectF windowFrameGeometry() const;
diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp
index 1514fca456..0156faf8e4 100644
--- a/src/widgets/graphicsview/qgraphicswidget_p.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp
@@ -51,6 +51,8 @@
#include <QtWidgets/QStyleOptionTitleBar>
#include <QtWidgets/QGraphicsSceneMouseEvent>
+#include <private/qmemory_p.h>
+
QT_BEGIN_NAMESPACE
void QGraphicsWidgetPrivate::init(QGraphicsItem *parentItem, Qt::WindowFlags wFlags)
@@ -108,10 +110,6 @@ QGraphicsWidgetPrivate::QGraphicsWidgetPrivate()
QGraphicsWidgetPrivate::~QGraphicsWidgetPrivate()
{
- // Remove any lazily allocated data
- delete[] margins;
- delete[] windowFrameMargins;
- delete windowData;
}
/*!
@@ -122,11 +120,8 @@ QGraphicsWidgetPrivate::~QGraphicsWidgetPrivate()
*/
void QGraphicsWidgetPrivate::ensureMargins() const
{
- if (!margins) {
- margins = new qreal[4];
- for (int i = 0; i < 4; ++i)
- margins[i] = 0;
- }
+ if (!margins)
+ margins = qt_make_unique<QMarginsF>();
}
/*!
@@ -137,11 +132,8 @@ void QGraphicsWidgetPrivate::ensureMargins() const
*/
void QGraphicsWidgetPrivate::ensureWindowFrameMargins() const
{
- if (!windowFrameMargins) {
- windowFrameMargins = new qreal[4];
- for (int i = 0; i < 4; ++i)
- windowFrameMargins[i] = 0;
- }
+ if (!windowFrameMargins)
+ windowFrameMargins = qt_make_unique<QMarginsF>();
}
/*!
@@ -153,7 +145,7 @@ void QGraphicsWidgetPrivate::ensureWindowFrameMargins() const
void QGraphicsWidgetPrivate::ensureWindowData()
{
if (!windowData)
- windowData = new WindowData;
+ windowData = qt_make_unique<WindowData>();
}
void QGraphicsWidgetPrivate::setPalette_helper(const QPalette &palette)
@@ -196,7 +188,7 @@ void QGraphicsWidgetPrivate::updatePalette(const QPalette &palette)
// Notify change.
QEvent event(QEvent::PaletteChange);
- QApplication::sendEvent(q, &event);
+ QCoreApplication::sendEvent(q, &event);
}
void QGraphicsWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction)
@@ -218,7 +210,7 @@ void QGraphicsWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direc
// Send the notification event to this widget item.
QEvent e(QEvent::LayoutDirectionChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
void QGraphicsWidgetPrivate::resolveLayoutDirection()
@@ -232,9 +224,9 @@ void QGraphicsWidgetPrivate::resolveLayoutDirection()
} else if (scene) {
// ### shouldn't the scene have a layoutdirection really? how does
// ### QGraphicsWidget get changes from QApplication::layoutDirection?
- setLayoutDirection_helper(QApplication::layoutDirection());
+ setLayoutDirection_helper(QGuiApplication::layoutDirection());
} else {
- setLayoutDirection_helper(QApplication::layoutDirection());
+ setLayoutDirection_helper(QGuiApplication::layoutDirection());
}
}
@@ -296,7 +288,7 @@ void QGraphicsWidgetPrivate::updateFont(const QFont &font)
return;
// Notify change.
QEvent event(QEvent::FontChange);
- QApplication::sendEvent(q, &event);
+ QCoreApplication::sendEvent(q, &event);
}
QFont QGraphicsWidgetPrivate::naturalWidgetFont() const
@@ -372,8 +364,8 @@ void QGraphicsWidgetPrivate::windowFrameMouseReleaseEvent(QGraphicsSceneMouseEve
bar.rect.setHeight(q->style()->pixelMetric(QStyle::PM_TitleBarHeight, &bar));
QPointF pos = event->pos();
if (windowFrameMargins) {
- pos.rx() += windowFrameMargins[Left];
- pos.ry() += windowFrameMargins[Top];
+ pos.rx() += windowFrameMargins->left();
+ pos.ry() += windowFrameMargins->top();
}
bar.subControls = QStyle::SC_TitleBarCloseButton;
if (q->style()->subControlRect(QStyle::CC_TitleBar, &bar,
@@ -669,8 +661,8 @@ void QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(QGraphicsSceneHoverEvent
QStyleOptionTitleBar bar;
// make sure that the coordinates (rect and pos) we send to the style are positive.
if (windowFrameMargins) {
- pos.rx() += windowFrameMargins[Left];
- pos.ry() += windowFrameMargins[Top];
+ pos.rx() += windowFrameMargins->left();
+ pos.ry() += windowFrameMargins->top();
}
initStyleOptionTitleBar(&bar);
bar.rect = q->windowFrameRect().toRect();
@@ -699,13 +691,6 @@ void QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(QGraphicsSceneHoverEvent
case Qt::TitleBarArea:
windowData->buttonRect = q->style()->subControlRect(
QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarCloseButton, 0);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // On mac we should hover if we are in the 'area' of the buttons
- windowData->buttonRect |= q->style()->subControlRect(
- QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMinButton, 0);
- windowData->buttonRect |= q->style()->subControlRect(
- QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMaxButton, 0);
-#endif
if (windowData->buttonRect.contains(pos.toPoint()))
windowData->buttonMouseOver = true;
event->ignore();
diff --git a/src/widgets/graphicsview/qgraphicswidget_p.h b/src/widgets/graphicsview/qgraphicswidget_p.h
index 505a2a24c0..e4cc2c3016 100644
--- a/src/widgets/graphicsview/qgraphicswidget_p.h
+++ b/src/widgets/graphicsview/qgraphicswidget_p.h
@@ -60,6 +60,8 @@
#include <QtWidgets/qsizepolicy.h>
#include <QtWidgets/qstyle.h>
+#include <memory>
+
QT_REQUIRE_CONFIG(graphicsview);
QT_BEGIN_NAMESPACE
@@ -78,11 +80,10 @@ public:
qreal titleBarHeight(const QStyleOptionTitleBar &options) const;
// Margins
- enum {Left, Top, Right, Bottom};
- mutable qreal *margins;
+ mutable std::unique_ptr<QMarginsF> margins;
void ensureMargins() const;
- void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *oldScene, QGraphicsScene *newScene = 0);
+ void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *oldScene, QGraphicsScene *newScene = nullptr);
void setLayout_helper(QGraphicsLayout *l);
// Layouts
@@ -189,11 +190,12 @@ public:
, buttonMouseOver(false)
, buttonSunken(false)
{}
- } *windowData;
+ };
+ std::unique_ptr<WindowData> windowData;
void ensureWindowData();
bool setWindowFrameMargins;
- mutable qreal *windowFrameMargins;
+ mutable std::unique_ptr<QMarginsF> windowFrameMargins;
void ensureWindowFrameMargins() const;
#ifndef QT_NO_ACTION
diff --git a/src/widgets/graphicsview/qsimplex_p.cpp b/src/widgets/graphicsview/qsimplex_p.cpp
index e6ffa856f1..e18f1fa4c4 100644
--- a/src/widgets/graphicsview/qsimplex_p.cpp
+++ b/src/widgets/graphicsview/qsimplex_p.cpp
@@ -164,7 +164,7 @@ bool QSimplex::setConstraints(const QList<QSimplexConstraint *> &newConstraints)
for (auto it = v.cbegin(), end = v.cend(); it != end; ++it)
variablesSet.insert(it.key());
}
- variables = variablesSet.toList();
+ variables = variablesSet.values();
// Set Variables reverse mapping
// We also need to be able to find the index for a given variable, to do that
diff --git a/src/widgets/graphicsview/qsimplex_p.h b/src/widgets/graphicsview/qsimplex_p.h
index 369f2f5f82..a69cef6115 100644
--- a/src/widgets/graphicsview/qsimplex_p.h
+++ b/src/widgets/graphicsview/qsimplex_p.h
@@ -82,7 +82,7 @@ struct QSimplexVariable
*/
struct QSimplexConstraint
{
- QSimplexConstraint() : constant(0), ratio(Equal), artificial(0) {}
+ QSimplexConstraint() : constant(0), ratio(Equal), artificial(nullptr) {}
enum Ratio {
LessOrEqual = 0,
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 7d5e014dd5..b1557e9af4 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -61,6 +61,7 @@
#include <qstyleditemdelegate.h>
#include <private/qabstractitemview_p.h>
#include <private/qabstractitemmodel_p.h>
+#include <private/qapplication_p.h>
#include <private/qguiapplication_p.h>
#include <private/qscrollbar_p.h>
#ifndef QT_NO_ACCESSIBILITY
@@ -180,7 +181,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
QString statustip = model->data(index, Qt::StatusTipRole).toString();
if (parent && (shouldClearStatusTip || !statustip.isEmpty())) {
QStatusTipEvent tip(statustip);
- QApplication::sendEvent(parent, &tip);
+ QCoreApplication::sendEvent(parent, &tip);
shouldClearStatusTip = !statustip.isEmpty();
}
#endif
@@ -189,7 +190,7 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index
if (parent && shouldClearStatusTip) {
QString emptyString;
QStatusTipEvent tip( emptyString );
- QApplication::sendEvent(parent, &tip);
+ QCoreApplication::sendEvent(parent, &tip);
}
#endif
emit q->viewportEntered();
@@ -521,7 +522,7 @@ void QAbstractItemViewPrivate::_q_scrollerStateChanged()
the mouse was pressed on is specified by \a index. The signal is
only emitted when the index is valid.
- Use the QApplication::mouseButtons() function to get the state
+ Use the QGuiApplication::mouseButtons() function to get the state
of the mouse buttons.
\sa activated(), clicked(), doubleClicked(), entered()
@@ -1713,7 +1714,7 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
if (d->shouldClearStatusTip && d->parent) {
QString empty;
QStatusTipEvent tip(empty);
- QApplication::sendEvent(d->parent, &tip);
+ QCoreApplication::sendEvent(d->parent, &tip);
d->shouldClearStatusTip = false;
}
#endif
@@ -1965,6 +1966,7 @@ void QAbstractItemView::mouseDoubleClickEvent(QMouseEvent *event)
if ((event->button() == Qt::LeftButton) && !edit(persistent, DoubleClicked, event)
&& !style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this))
emit activated(persistent);
+ d->pressedIndex = QModelIndex();
}
#if QT_CONFIG(draganddrop)
@@ -2290,7 +2292,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
#ifdef QT_KEYPAD_NAVIGATION
switch (event->key()) {
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus()) {
setEditFocus(true);
return;
@@ -2298,7 +2300,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
}
break;
case Qt::Key_Back:
- if (QApplication::keypadNavigationEnabled() && hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()) {
setEditFocus(false);
} else {
event->ignore();
@@ -2309,7 +2311,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
// Let's ignore vertical navigation events, only if there is no other widget
// what can take the focus in vertical direction. This means widget can handle navigation events
// even the widget don't have edit focus, and there is no other widget in requested direction.
- if(QApplication::keypadNavigationEnabled() && !hasEditFocus()
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()
&& QWidgetPrivate::canKeypadNavigate(Qt::Vertical)) {
event->ignore();
return;
@@ -2318,14 +2320,14 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
case Qt::Key_Left:
case Qt::Key_Right:
// Similar logic as in up and down events
- if(QApplication::keypadNavigationEnabled() && !hasEditFocus()
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()
&& (QWidgetPrivate::canKeypadNavigate(Qt::Horizontal) || QWidgetPrivate::inTabWidget(this))) {
event->ignore();
return;
}
break;
default:
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
event->ignore();
return;
}
@@ -2338,7 +2340,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
if (d->model)
variant = d->model->data(currentIndex(), Qt::DisplayRole);
if (variant.type() == QVariant::String)
- QApplication::clipboard()->setText(variant.toString());
+ QGuiApplication::clipboard()->setText(variant.toString());
event->accept();
}
#endif
@@ -2413,7 +2415,8 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
case Qt::Key_Down:
case Qt::Key_Up:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && QWidgetPrivate::canKeypadNavigate(Qt::Vertical)) {
+ if (QApplicationPrivate::keypadNavigationEnabled()
+ && QWidgetPrivate::canKeypadNavigate(Qt::Vertical)) {
event->accept(); // don't change focus
break;
}
@@ -2845,7 +2848,7 @@ void QAbstractItemView::closeEditor(QWidget *editor, QAbstractItemDelegate::EndE
}
QPointer<QWidget> ed = editor;
- QApplication::sendPostedEvents(editor, 0);
+ QCoreApplication::sendPostedEvents(editor, 0);
editor = ed;
if (!isPersistent && editor)
@@ -3725,12 +3728,10 @@ QStyleOptionViewItem QAbstractItemView::viewOptions() const
option.state &= ~QStyle::State_MouseOver;
option.font = font();
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
// On mac the focus appearance follows window activation
// not widget activation
if (!hasFocus())
option.state &= ~QStyle::State_Active;
-#endif
option.state &= ~QStyle::State_HasFocus;
if (d->iconSize.isValid()) {
@@ -3957,7 +3958,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand(const QM
keyModifiers = (static_cast<const QInputEvent*>(event))->modifiers();
break;
default:
- keyModifiers = QApplication::keyboardModifiers();
+ keyModifiers = QGuiApplication::keyboardModifiers();
}
}
switch (d->selectionMode) {
@@ -3966,7 +3967,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemView::selectionCommand(const QM
case SingleSelection: // ClearAndSelect on valid index otherwise NoUpdate
if (event && event->type() == QEvent::MouseButtonRelease)
return QItemSelectionModel::NoUpdate;
- if ((keyModifiers & Qt::ControlModifier) && d->selectionModel->isSelected(index))
+ if ((keyModifiers & Qt::ControlModifier) && d->selectionModel->isSelected(index) && event->type() != QEvent::MouseMove)
return QItemSelectionModel::Deselect | d->selectionBehaviorFlags();
else
return QItemSelectionModel::ClearAndSelect | d->selectionBehaviorFlags();
@@ -4015,7 +4016,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::multiSelectionComm
QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionCommand(
const QModelIndex &index, const QEvent *event) const
{
- Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
+ Qt::KeyboardModifiers modifiers = QGuiApplication::keyboardModifiers();
if (event) {
switch (event->type()) {
case QEvent::MouseMove: {
@@ -4425,7 +4426,7 @@ bool QAbstractItemViewPrivate::openEditor(const QModelIndex &index, QEvent *even
w->setFocus();
if (event)
- QApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event);
+ QCoreApplication::sendEvent(w->focusProxy() ? w->focusProxy() : w, event);
return true;
}
@@ -4461,15 +4462,8 @@ QPixmap QAbstractItemViewPrivate::renderToPixmap(const QModelIndexList &indexes,
if (paintPairs.isEmpty())
return QPixmap();
- qreal scale = 1.0f;
-
- Q_Q(const QAbstractItemView);
- QWidget *window = q->window();
- if (window) {
- QWindow *windowHandle = window->windowHandle();
- if (windowHandle)
- scale = windowHandle->devicePixelRatio();
- }
+ QWindow *window = windowHandle(WindowHandleMode::Closest);
+ const qreal scale = window ? window->devicePixelRatio() : qreal(1);
QPixmap pixmap(r->size() * scale);
pixmap.setDevicePixelRatio(scale);
diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h
index 7b36b1f3da..c60579255e 100644
--- a/src/widgets/itemviews/qcolumnview_p.h
+++ b/src/widgets/itemviews/qcolumnview_p.h
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
class QColumnViewPreviewColumn : public QAbstractItemView {
public:
- explicit QColumnViewPreviewColumn(QWidget *parent) : QAbstractItemView(parent), previewWidget(0) {
+ explicit QColumnViewPreviewColumn(QWidget *parent) : QAbstractItemView(parent), previewWidget(nullptr) {
}
void setPreviewWidget(QWidget *widget) {
@@ -186,7 +186,7 @@ class QColumnViewDelegate : public QItemDelegate
{
public:
- explicit QColumnViewDelegate(QObject *parent = 0) : QItemDelegate(parent) {}
+ explicit QColumnViewDelegate(QObject *parent = nullptr) : QItemDelegate(parent) {}
~QColumnViewDelegate() {}
void paint(QPainter *painter,
diff --git a/src/widgets/itemviews/qcolumnviewgrip_p.h b/src/widgets/itemviews/qcolumnviewgrip_p.h
index 5eb8012204..4311edbeb4 100644
--- a/src/widgets/itemviews/qcolumnviewgrip_p.h
+++ b/src/widgets/itemviews/qcolumnviewgrip_p.h
@@ -68,12 +68,12 @@ Q_SIGNALS:
void gripMoved(int offset);
public:
- explicit QColumnViewGrip(QWidget *parent = 0);
+ explicit QColumnViewGrip(QWidget *parent = nullptr);
~QColumnViewGrip();
int moveGrip(int offset);
protected:
- QColumnViewGrip(QColumnViewGripPrivate &, QWidget *parent = 0, Qt::WindowFlags f = 0);
+ QColumnViewGrip(QColumnViewGripPrivate &, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
void paintEvent(QPaintEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp
index b94c31fb42..13a1bbd8eb 100644
--- a/src/widgets/itemviews/qdirmodel.cpp
+++ b/src/widgets/itemviews/qdirmodel.cpp
@@ -1086,7 +1086,7 @@ QString QDirModel::filePath(const QModelIndex &index) const
if (d->indexValid(index)) {
QFileInfo fi = fileInfo(index);
if (d->resolveSymlinks && fi.isSymLink())
- fi = d->resolvedInfo(fi);
+ fi = QDirModelPrivate::resolvedInfo(fi);
return QDir::cleanPath(fi.absoluteFilePath());
}
return QString(); // root path
@@ -1108,7 +1108,7 @@ QString QDirModel::fileName(const QModelIndex &index) const
if (QFileSystemEntry::isRootPath(path))
return path;
if (d->resolveSymlinks && info.isSymLink())
- info = d->resolvedInfo(info);
+ info = QDirModelPrivate::resolvedInfo(info);
return info.fileName();
}
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 1fcd5bdef2..d7bdf6aa4c 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -189,7 +189,7 @@ static const int maxSizeSection = 1048575; // since section size is in a bitfiel
The following values are obsolete:
\value Custom Use Fixed instead.
- \sa setResizeMode(), setSectionResizeMode(), stretchLastSection, minimumSectionSize
+ \sa setSectionResizeMode(), stretchLastSection, minimumSectionSize
*/
/*!
@@ -880,7 +880,7 @@ void QHeaderView::swapSections(int first, int second)
size equal to zero is however not recommended. In that situation hideSection
should be used instead.
- \sa sectionResized(), resizeMode(), sectionSize(), hideSection()
+ \sa sectionResized(), sectionSize(), hideSection()
*/
void QHeaderView::resizeSection(int logical, int size)
@@ -960,7 +960,7 @@ void QHeaderView::resizeSection(int logical, int size)
Resizes the sections according to the given \a mode, ignoring the current
resize mode.
- \sa resizeMode(), sectionResized()
+ \sa sectionResized()
*/
void QHeaderView::resizeSections(QHeaderView::ResizeMode mode)
@@ -1139,16 +1139,6 @@ void QHeaderView::setSectionsMovable(bool movable)
d->movableSections = movable;
}
-// ### Qt 6 - remove this obsolete function
-/*!
- \obsolete
- \fn void QHeaderView::setMovable(bool movable)
-
- Use setSectionsMovable instead.
-
- \sa setSectionsMovable()
-*/
-
/*!
\since 5.0
@@ -1167,16 +1157,6 @@ bool QHeaderView::sectionsMovable() const
return d->movableSections;
}
-// ### Qt 6 - remove this obsolete function
-/*!
- \obsolete
- \fn bool QHeaderView::isMovable() const
-
- Use sectionsMovable instead.
-
- \sa sectionsMovable()
-*/
-
/*!
\property QHeaderView::firstSectionMovable
\brief Whether the first column can be moved by the user
@@ -1223,16 +1203,6 @@ void QHeaderView::setSectionsClickable(bool clickable)
d->clickableSections = clickable;
}
-// ### Qt 6 - remove this obsolete function
-/*!
- \obsolete
- \fn void QHeaderView::setClickable(bool clickable)
-
- Use setSectionsClickable instead.
-
- \sa setSectionsClickable()
-*/
-
/*!
\since 5.0
@@ -1249,16 +1219,6 @@ bool QHeaderView::sectionsClickable() const
return d->clickableSections;
}
-// ### Qt 6 - remove this obsolete function
-/*!
- \obsolete
- \fn bool QHeaderView::isClickable() const
-
- Use sectionsClickable instead.
-
- \sa sectionsClickable()
-*/
-
void QHeaderView::setHighlightSections(bool highlight)
{
Q_D(QHeaderView);
@@ -1277,7 +1237,7 @@ bool QHeaderView::highlightSections() const
Sets the constraints on how the header can be resized to those described
by the given \a mode.
- \sa resizeMode(), length(), sectionResized()
+ \sa length(), sectionResized()
*/
void QHeaderView::setSectionResizeMode(ResizeMode mode)
@@ -1327,26 +1287,6 @@ void QHeaderView::setSectionResizeMode(int logicalIndex, ResizeMode mode)
d->doDelayedResizeSections(); // section sizes may change as a result of the new mode
}
-// ### Qt 6 - remove this obsolete function
-/*!
- \overload
- \obsolete
- \fn void QHeaderView::setResizeMode(int logicalIndex, ResizeMode mode)
-
- Use setSectionResizeMode instead.
-
- \sa setSectionResizeMode()
-*/
-
-/*!
- \obsolete
- \fn void QHeaderView::setResizeMode(ResizeMode mode)
-
- Use setSectionResizeMode instead.
-
- \sa setSectionResizeMode()
-*/
-
/*!
\since 5.0
@@ -1407,16 +1347,6 @@ int QHeaderView::resizeContentsPrecision() const
return d->resizeContentsPrecision;
}
-// ### Qt 6 - remove this obsolete function
-/*!
- \obsolete
- \fn QHeaderView::ResizeMode QHeaderView::resizeMode(int logicalIndex) const
-
- Use sectionResizeMode instead.
-
- \sa sectionResizeMode()
-*/
-
/*!
\since 4.1
@@ -1424,7 +1354,7 @@ int QHeaderView::resizeContentsPrecision() const
views, this can be used to see if the headerview needs to resize the
sections when the view's geometry changes.
- \sa stretchLastSection, resizeMode()
+ \sa stretchLastSection
*/
int QHeaderView::stretchSectionCount() const
@@ -2640,7 +2570,6 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
if (pos < 0 && d->state != QHeaderViewPrivate::SelectSections)
return;
if (e->buttons() == Qt::NoButton) {
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
// Under Cocoa, when the mouse button is released, may include an extra
// simulated mouse moved event. The state of the buttons when this event
// is generated is already "no button" and the code below gets executed
@@ -2648,7 +2577,6 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
// column dragging from working. So this code is disabled under Cocoa.
d->state = QHeaderViewPrivate::NoState;
d->pressed = -1;
-#endif
}
switch (d->state) {
case QHeaderViewPrivate::ResizeSection: {
@@ -2896,7 +2824,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
case QEvent::Wheel: {
QAbstractScrollArea *asa = qobject_cast<QAbstractScrollArea *>(parentWidget());
if (asa)
- return QApplication::sendEvent(asa->viewport(), e);
+ return QCoreApplication::sendEvent(asa->viewport(), e);
break; }
default:
break;
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index d9fc1baec5..766adef36d 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -102,7 +102,7 @@ public:
lastSectionLogicalIdx(-1), // Only trust when we stretch last section
sectionIndicatorOffset(0),
#if QT_CONFIG(label)
- sectionIndicator(0),
+ sectionIndicator(nullptr),
#endif
globalResizeMode(QHeaderView::Interactive),
sectionStartposRecalc(true),
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index 2d49dd4421..8ed2ee5f28 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -570,11 +570,9 @@ void QExpandingLineEdit::changeEvent(QEvent *e)
void QExpandingLineEdit::updateMinimumWidth()
{
- int left, right;
- getTextMargins(&left, 0, &right, 0);
- int width = left + right + 4 /*horizontalMargin in qlineedit.cpp*/;
- getContentsMargins(&left, 0, &right, 0);
- width += left + right;
+ const QMargins tm = textMargins();
+ const QMargins cm = contentsMargins();
+ const int width = tm.left() + tm.right() + cm.left() + cm.right() + 4 /*horizontalMargin in qlineedit.cpp*/;
QStyleOptionFrame opt;
initStyleOption(&opt);
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 568084640a..04cddf2926 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -54,6 +54,7 @@
#if QT_CONFIG(rubberband)
#include <qrubberband.h>
#endif
+#include <private/qapplication_p.h>
#include <private/qlistview_p.h>
#include <private/qscrollbar_p.h>
#include <qdebug.h>
@@ -810,24 +811,24 @@ void QListView::mouseReleaseEvent(QMouseEvent *e)
void QListView::wheelEvent(QWheelEvent *e)
{
Q_D(QListView);
- if (e->orientation() == Qt::Vertical) {
+ if (qAbs(e->angleDelta().y()) > qAbs(e->angleDelta().x())) {
if (e->angleDelta().x() == 0
- && ((d->flow == TopToBottom && d->wrap) || (d->flow == LeftToRight && !d->wrap))
- && d->vbar->minimum() == 0 && d->vbar->maximum() == 0) {
+ && ((d->flow == TopToBottom && d->wrap) || (d->flow == LeftToRight && !d->wrap))
+ && d->vbar->minimum() == 0 && d->vbar->maximum() == 0) {
QPoint pixelDelta(e->pixelDelta().y(), e->pixelDelta().x());
QPoint angleDelta(e->angleDelta().y(), e->angleDelta().x());
- QWheelEvent hwe(e->pos(), e->globalPos(), pixelDelta, angleDelta, e->delta(),
- Qt::Horizontal, e->buttons(), e->modifiers(), e->phase(), e->source(), e->inverted());
+ QWheelEvent hwe(e->position(), e->globalPosition(), pixelDelta, angleDelta,
+ e->buttons(), e->modifiers(), e->phase(), e->inverted(), e->source());
if (e->spontaneous())
qt_sendSpontaneousEvent(d->hbar, &hwe);
else
- QApplication::sendEvent(d->hbar, &hwe);
+ QCoreApplication::sendEvent(d->hbar, &hwe);
e->setAccepted(hwe.isAccepted());
} else {
- QApplication::sendEvent(d->vbar, e);
+ QCoreApplication::sendEvent(d->vbar, e);
}
} else {
- QApplication::sendEvent(d->hbar, e);
+ QCoreApplication::sendEvent(d->hbar, e);
}
}
#endif // QT_CONFIG(wheelevent)
@@ -1185,7 +1186,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
rect.translate(0, -rect.height());
if (rect.bottom() <= 0) {
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
int row = d->batchStartRow() - 1;
while (row >= 0 && d->isHiddenOrDisabled(row))
--row;
@@ -1214,7 +1215,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
rect.translate(0, rect.height());
if (rect.top() >= contents.height()) {
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
int rowCount = d->model->rowCount(d->root);
int row = 0;
while (row < rowCount && d->isHiddenOrDisabled(row))
diff --git a/src/widgets/itemviews/qlistview_p.h b/src/widgets/itemviews/qlistview_p.h
index c6810f8fdc..86331bb862 100644
--- a/src/widgets/itemviews/qlistview_p.h
+++ b/src/widgets/itemviews/qlistview_p.h
@@ -248,7 +248,7 @@ private:
class QIconModeViewBase : public QCommonListViewBase
{
public:
- QIconModeViewBase(QListView *q, QListViewPrivate *d) : QCommonListViewBase(q, d), interSectingVector(0) {}
+ QIconModeViewBase(QListView *q, QListViewPrivate *d) : QCommonListViewBase(q, d), interSectingVector(nullptr) {}
QBspTree tree;
QVector<QListViewItem> items;
diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp
index 37bb370e73..e7dcfac403 100644
--- a/src/widgets/itemviews/qlistwidget.cpp
+++ b/src/widgets/itemviews/qlistwidget.cpp
@@ -930,12 +930,14 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
\sa Qt::AlignmentFlag
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn QColor QListWidgetItem::backgroundColor() const
\obsolete
This function is deprecated. Use background() instead.
*/
+#endif
/*!
\fn QBrush QListWidgetItem::background() const
@@ -946,6 +948,7 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
\sa setBackground(), foreground()
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn QColor QListWidgetItem::textColor() const
\obsolete
@@ -954,6 +957,7 @@ QDataStream &operator>>(QDataStream &in, QListWidgetItem &item)
This function is deprecated. Use foreground() instead.
*/
+#endif
/*!
\fn QBrush QListWidgetItem::foreground() const
@@ -1119,12 +1123,14 @@ void QListWidgetItem::setFlags(Qt::ItemFlags aflags)
\sa background(), setForeground()
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn void QListWidgetItem::setTextColor(const QColor &color)
\obsolete
This function is deprecated. Use setForeground() instead.
*/
+#endif
/*!
\fn void QListWidgetItem::setForeground(const QBrush &brush)
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index b05662f6bc..11c5be10fd 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -51,6 +51,7 @@
#if QT_CONFIG(abstractbutton)
#include <qabstractbutton.h>
#endif
+#include <private/qapplication_p.h>
#include <private/qtableview_p.h>
#include <private/qheaderview_p.h>
#include <private/qscrollbar_p.h>
@@ -58,6 +59,8 @@
#include <qaccessible.h>
#endif
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
/** \internal
@@ -65,7 +68,7 @@ QT_BEGIN_NAMESPACE
*/
void QSpanCollection::addSpan(QSpanCollection::Span *span)
{
- spans.append(span);
+ spans.push_back(span);
Index::iterator it_y = index.lowerBound(-span->top());
if (it_y == index.end() || it_y.key() != -span->top()) {
//there is no spans that starts with the row in the index, so create a sublist for it.
@@ -132,7 +135,7 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
}
if (span->width() == 0 && span->height() == 0) {
- spans.removeOne(span);
+ spans.remove(span);
delete span;
}
}
@@ -169,7 +172,7 @@ void QSpanCollection::clear()
/** \internal
* return a list to all the spans that spans over cells in the given rectangle
*/
-QList<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w, int h) const
+QSet<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w, int h) const
{
QSet<Span *> list;
Index::const_iterator it_y = index.lowerBound(-y);
@@ -191,7 +194,7 @@ QList<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w,
break;
--it_y;
}
- return list.toList();
+ return list;
}
#undef DEBUG_SPAN_UPDATE
@@ -210,17 +213,16 @@ QDebug operator<<(QDebug str, const QSpanCollection::Span &span)
void QSpanCollection::updateInsertedRows(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << start << end << endl << index;
+ qDebug() << start << end << Qt::endl << index;
#endif
- if (spans.isEmpty())
+ if (spans.empty())
return;
int delta = end - start + 1;
#ifdef DEBUG_SPAN_UPDATE
qDebug("Before");
#endif
- for (SpanList::iterator it = spans.begin(); it != spans.end(); ++it) {
- Span *span = *it;
+ for (Span *span : spans) {
#ifdef DEBUG_SPAN_UPDATE
qDebug() << span << *span;
#endif
@@ -258,17 +260,16 @@ void QSpanCollection::updateInsertedRows(int start, int end)
void QSpanCollection::updateInsertedColumns(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << start << end << endl << index;
+ qDebug() << start << end << Qt::endl << index;
#endif
- if (spans.isEmpty())
+ if (spans.empty())
return;
int delta = end - start + 1;
#ifdef DEBUG_SPAN_UPDATE
qDebug("Before");
#endif
- for (SpanList::iterator it = spans.begin(); it != spans.end(); ++it) {
- Span *span = *it;
+ for (Span *span : spans) {
#ifdef DEBUG_SPAN_UPDATE
qDebug() << span << *span;
#endif
@@ -339,9 +340,9 @@ bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int
void QSpanCollection::updateRemovedRows(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << start << end << endl << index;
+ qDebug() << start << end << Qt::endl << index;
#endif
- if (spans.isEmpty())
+ if (spans.empty())
return;
SpanList spansToBeDeleted;
@@ -377,7 +378,7 @@ void QSpanCollection::updateRemovedRows(int start, int end)
if (span->m_top == span->m_bottom && span->m_left == span->m_right)
span->will_be_deleted = true;
if (span->will_be_deleted) {
- spansToBeDeleted.append(span);
+ spansToBeDeleted.push_back(span);
it = spans.erase(it);
} else {
++it;
@@ -389,7 +390,7 @@ void QSpanCollection::updateRemovedRows(int start, int end)
foreach (QSpanCollection::Span *span, spans)
qDebug() << span << *span;
#endif
- if (spans.isEmpty()) {
+ if (spans.empty()) {
qDeleteAll(spansToBeDeleted);
index.clear();
return;
@@ -466,9 +467,9 @@ void QSpanCollection::updateRemovedRows(int start, int end)
void QSpanCollection::updateRemovedColumns(int start, int end)
{
#ifdef DEBUG_SPAN_UPDATE
- qDebug() << start << end << endl << index;
+ qDebug() << start << end << Qt::endl << index;
#endif
- if (spans.isEmpty())
+ if (spans.empty())
return;
SpanList toBeDeleted;
@@ -504,7 +505,7 @@ void QSpanCollection::updateRemovedColumns(int start, int end)
if (span->m_top == span->m_bottom && span->m_left == span->m_right)
span->will_be_deleted = true;
if (span->will_be_deleted) {
- toBeDeleted.append(span);
+ toBeDeleted.push_back(span);
it = spans.erase(it);
} else {
++it;
@@ -516,7 +517,7 @@ void QSpanCollection::updateRemovedColumns(int start, int end)
foreach (QSpanCollection::Span *span, spans)
qDebug() << span << *span;
#endif
- if (spans.isEmpty()) {
+ if (spans.empty()) {
qDeleteAll(toBeDeleted);
index.clear();
return;
@@ -552,13 +553,13 @@ bool QSpanCollection::checkConsistency() const
for (SubIndex::const_iterator it = subIndex.begin(); it != subIndex.end(); ++it) {
int x = -it.key();
Span *span = it.value();
- if (!spans.contains(span) || span->left() != x
- || y < span->top() || y > span->bottom())
+ const bool contains = std::find(spans.begin(), spans.end(), span) != spans.end();
+ if (!contains || span->left() != x || y < span->top() || y > span->bottom())
return false;
}
}
- foreach (const Span *span, spans) {
+ for (const Span *span : spans) {
if (span->width() < 1 || span->height() < 1
|| (span->width() == 1 && span->height() == 1))
return false;
@@ -863,19 +864,17 @@ void QTableViewPrivate::drawAndClipSpans(const QRegion &area, QPainter *painter,
bool alternateBase = false;
QRegion region = viewport->rect();
- QList<QSpanCollection::Span *> visibleSpans;
+ QSet<QSpanCollection::Span *> visibleSpans;
bool sectionMoved = verticalHeader->sectionsMoved() || horizontalHeader->sectionsMoved();
if (!sectionMoved) {
visibleSpans = spans.spansInRect(logicalColumn(firstVisualColumn), logicalRow(firstVisualRow),
lastVisualColumn - firstVisualColumn + 1, lastVisualRow - firstVisualRow + 1);
} else {
- QSet<QSpanCollection::Span *> set;
for(int x = firstVisualColumn; x <= lastVisualColumn; x++)
for(int y = firstVisualRow; y <= lastVisualRow; y++)
- set.insert(spans.spanAt(x,y));
- set.remove(0);
- visibleSpans = set.toList();
+ visibleSpans.insert(spans.spanAt(x,y));
+ visibleSpans.remove(nullptr);
}
for (QSpanCollection::Span *span : qAsConst(visibleSpans)) {
@@ -1712,7 +1711,7 @@ QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifi
case MoveUp: {
int originalRow = visualRow;
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && visualRow == 0)
+ if (QApplicationPrivate::keypadNavigationEnabled() && visualRow == 0)
visualRow = d->visualRow(model()->rowCount() - 1) + 1;
// FIXME? visualRow = bottom + 1;
#endif
@@ -1741,7 +1740,7 @@ QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifi
visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height()));
}
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && visualRow >= bottom)
+ if (QApplicationPrivate::keypadNavigationEnabled() && visualRow >= bottom)
visualRow = -1;
#endif
int r = d->logicalRow(visualRow);
@@ -1925,7 +1924,7 @@ void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionF
int right = qMax(d->visualColumn(tl.column()), d->visualColumn(br.column()));
do {
expanded = false;
- foreach (QSpanCollection::Span *it, d->spans.spans) {
+ for (QSpanCollection::Span *it : d->spans.spans) {
const QSpanCollection::Span &span = *it;
int t = d->visualRow(span.top());
int l = d->visualColumn(span.left());
@@ -3332,7 +3331,7 @@ void QTableViewPrivate::selectRow(int row, bool anchor)
if (q->selectionMode() != QTableView::SingleSelection
&& command.testFlag(QItemSelectionModel::Toggle)) {
if (anchor)
- ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index)
+ ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows(column).contains(index)
? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
command &= ~QItemSelectionModel::Toggle;
command |= ctrlDragSelectionFlag;
diff --git a/src/widgets/itemviews/qtableview_p.h b/src/widgets/itemviews/qtableview_p.h
index d55462c28b..8f174351d2 100644
--- a/src/widgets/itemviews/qtableview_p.h
+++ b/src/widgets/itemviews/qtableview_p.h
@@ -53,12 +53,13 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/QList>
-#include <QtCore/QLinkedList>
#include <QtCore/QMap>
#include <QtCore/QSet>
#include <QtCore/QDebug>
#include "private/qabstractitemview_p.h"
+#include <list>
+
QT_REQUIRE_CONFIG(tableview);
QT_BEGIN_NAMESPACE
@@ -104,7 +105,7 @@ public:
void updateSpan(Span *span, int old_height);
Span *spanAt(int x, int y) const;
void clear();
- QList<Span *> spansInRect(int x, int y, int w, int h) const;
+ QSet<Span *> spansInRect(int x, int y, int w, int h) const;
void updateInsertedRows(int start, int end);
void updateInsertedColumns(int start, int end);
@@ -115,7 +116,7 @@ public:
bool checkConsistency() const;
#endif
- typedef QLinkedList<Span *> SpanList;
+ typedef std::list<Span *> SpanList;
SpanList spans; //lists of all spans
private:
//the indexes are negative so the QMap::lowerBound do what i need.
@@ -137,7 +138,7 @@ public:
: showGrid(true), gridStyle(Qt::SolidLine),
rowSectionAnchor(-1), columnSectionAnchor(-1),
columnResizeTimerID(0), rowResizeTimerID(0),
- horizontalHeader(0), verticalHeader(0),
+ horizontalHeader(nullptr), verticalHeader(nullptr),
sortingEnabled(false), geometryRecursionBlock(false),
visualCursor(QPoint())
{
@@ -210,7 +211,7 @@ public:
return span(row, column).width();
}
inline bool hasSpans() const {
- return !spans.spans.isEmpty();
+ return !spans.spans.empty();
}
inline int rowSpanHeight(int row, int span) const {
return sectionSpanSize(verticalHeader, row, span);
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index 0fb9e28385..a25a582881 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -1251,6 +1251,7 @@ void QTableWidgetItem::setFlags(Qt::ItemFlags aflags)
\sa font(), setText(), setForeground()
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn QColor QTableWidgetItem::backgroundColor() const
\obsolete
@@ -1264,6 +1265,7 @@ void QTableWidgetItem::setFlags(Qt::ItemFlags aflags)
This function is deprecated. Use setBackground() instead.
*/
+#endif
/*!
\fn QBrush QTableWidgetItem::background() const
@@ -1283,6 +1285,7 @@ void QTableWidgetItem::setFlags(Qt::ItemFlags aflags)
\sa setForeground()
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn QColor QTableWidgetItem::textColor() const
\obsolete
@@ -1296,6 +1299,7 @@ void QTableWidgetItem::setFlags(Qt::ItemFlags aflags)
This function is deprecated. Use setForeground() instead.
*/
+#endif
/*!
\fn QBrush QTableWidgetItem::foreground() const
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index e9228edcda..413cc2a9cd 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -55,6 +55,7 @@
#include <qaccessible.h>
#endif
+#include <private/qapplication_p.h>
#include <private/qtreeview_p.h>
#include <private/qheaderview_p.h>
@@ -1942,6 +1943,7 @@ void QTreeView::mouseDoubleClickEvent(QMouseEvent *event)
if (!style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this))
emit activated(persistent);
+ d->pressedIndex = QModelIndex();
d->executePostedLayout(); // we need to make sure viewItems is updated
if (d->itemsExpandable
&& d->expandsOnDoubleClick
@@ -2172,35 +2174,6 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
return QModelIndex();
}
int vi = -1;
-#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(style_mac)
- // Selection behavior is slightly different on the Mac.
- if (d->selectionMode == QAbstractItemView::ExtendedSelection
- && d->selectionModel
- && d->selectionModel->hasSelection()) {
-
- const bool moveUpDown = (cursorAction == MoveUp || cursorAction == MoveDown);
- const bool moveNextPrev = (cursorAction == MoveNext || cursorAction == MovePrevious);
- const bool contiguousSelection = moveUpDown && (modifiers & Qt::ShiftModifier);
-
- // Use the outermost index in the selection as the current index
- if (!contiguousSelection && (moveUpDown || moveNextPrev)) {
-
- // Find outermost index.
- const bool useTopIndex = (cursorAction == MoveUp || cursorAction == MovePrevious);
- int index = useTopIndex ? INT_MAX : INT_MIN;
- const QItemSelection selection = d->selectionModel->selection();
- for (int i = 0; i < selection.count(); ++i) {
- const QItemSelectionRange &range = selection.at(i);
- int candidate = d->viewIndex(useTopIndex ? range.topLeft() : range.bottomRight());
- if (candidate >= 0)
- index = useTopIndex ? qMin(index, candidate) : qMax(index, candidate);
- }
-
- if (index >= 0 && index < INT_MAX)
- vi = index;
- }
- }
-#endif
if (vi < 0)
vi = qMax(0, d->viewIndex(current));
@@ -2214,14 +2187,14 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
case MoveNext:
case MoveDown:
#ifdef QT_KEYPAD_NAVIGATION
- if (vi == d->viewItems.count()-1 && QApplication::keypadNavigationEnabled())
+ if (vi == d->viewItems.count()-1 && QApplicationPrivate::keypadNavigationEnabled())
return d->model->index(0, current.column(), d->root);
#endif
return d->modelIndex(d->below(vi), current.column());
case MovePrevious:
case MoveUp:
#ifdef QT_KEYPAD_NAVIGATION
- if (vi == 0 && QApplication::keypadNavigationEnabled())
+ if (vi == 0 && QApplicationPrivate::keypadNavigationEnabled())
return d->modelIndex(d->viewItems.count() - 1, current.column());
#endif
return d->modelIndex(d->above(vi), current.column());
diff --git a/src/widgets/itemviews/qtreeview.h b/src/widgets/itemviews/qtreeview.h
index e9cc1beedb..bb00f1df07 100644
--- a/src/widgets/itemviews/qtreeview.h
+++ b/src/widgets/itemviews/qtreeview.h
@@ -158,7 +158,7 @@ public Q_SLOTS:
void collapse(const QModelIndex &index);
void resizeColumnToContents(int column);
#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED_X ("Use QTreeeView::sortByColumn(int column, Qt::SortOrder order) instead")
+ QT_DEPRECATED_X ("Use QTreeView::sortByColumn(int column, Qt::SortOrder order) instead")
void sortByColumn(int column);
#endif
void sortByColumn(int column, Qt::SortOrder order);
diff --git a/src/widgets/itemviews/qtreeview_p.h b/src/widgets/itemviews/qtreeview_p.h
index 9666a9f8c2..836d8f0c2d 100644
--- a/src/widgets/itemviews/qtreeview_p.h
+++ b/src/widgets/itemviews/qtreeview_p.h
@@ -87,7 +87,7 @@ public:
QTreeViewPrivate()
: QAbstractItemViewPrivate(),
- header(0), indent(20), lastViewedItem(0), defaultItemHeight(-1),
+ header(nullptr), indent(20), lastViewedItem(0), defaultItemHeight(-1),
uniformRowHeights(false), rootDecoration(true),
itemsExpandable(true), sortingEnabled(false),
expandsOnDoubleClick(true),
@@ -157,7 +157,7 @@ public:
bool checkViewItems() const;
#endif
- int firstVisibleItem(int *offset = 0) const;
+ int firstVisibleItem(int *offset = nullptr) const;
int lastVisibleItem(int firstVisual = -1, int offset = -1) const;
int columnAt(int x) const;
bool hasVisibleChildren( const QModelIndex& parent) const;
diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp
index 6da5ca0f4c..6d0909108b 100644
--- a/src/widgets/itemviews/qtreewidget.cpp
+++ b/src/widgets/itemviews/qtreewidget.cpp
@@ -1254,6 +1254,7 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const
\sa font(), setText(), setForeground()
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn QColor QTreeWidgetItem::backgroundColor(int column) const
\obsolete
@@ -1267,6 +1268,7 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const
This function is deprecated. Use setBackground() instead.
*/
+#endif
/*!
\fn QBrush QTreeWidgetItem::background(int column) const
@@ -1290,6 +1292,7 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const
\sa setForeground()
*/
+#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn QColor QTreeWidgetItem::textColor(int column) const
\obsolete
@@ -1303,6 +1306,7 @@ bool QTreeWidgetItem::isFirstColumnSpanned() const
This function is deprecated. Use setForeground() instead.
*/
+#endif
/*!
\fn QBrush QTreeWidgetItem::foreground(int column) const
diff --git a/src/widgets/itemviews/qtreewidget_p.h b/src/widgets/itemviews/qtreewidget_p.h
index ee4a633468..81e7e86203 100644
--- a/src/widgets/itemviews/qtreewidget_p.h
+++ b/src/widgets/itemviews/qtreewidget_p.h
@@ -78,7 +78,7 @@ class QTreeModel : public QAbstractItemModel
friend class QTreeWidgetItemIteratorPrivate;
public:
- explicit QTreeModel(int columns = 0, QTreeWidget *parent = 0);
+ explicit QTreeModel(int columns = 0, QTreeWidget *parent = nullptr);
~QTreeModel();
inline QTreeWidget *view() const
@@ -140,7 +140,7 @@ public:
{ return createIndex(row, col, item); }
protected:
- QTreeModel(QTreeModelPrivate &, QTreeWidget *parent = 0);
+ QTreeModel(QTreeModelPrivate &, QTreeWidget *parent = nullptr);
void emitDataChanged(QTreeWidgetItem *item, int column, const QVector<int> &roles);
void beginInsertItems(QTreeWidgetItem *parent, int row, int count);
void endInsertItems();
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index c2f6e4ce75..693af7eb80 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -12,7 +12,7 @@ HEADERS += \
kernel/qactiongroup.h \
kernel/qapplication.h \
kernel/qapplication_p.h \
- kernel/qwidgetbackingstore_p.h \
+ kernel/qwidgetrepaintmanager_p.h \
kernel/qboxlayout.h \
kernel/qdesktopwidget.h \
kernel/qgridlayout.h \
@@ -23,7 +23,6 @@ HEADERS += \
kernel/qshortcut.h \
kernel/qsizepolicy.h \
kernel/qstackedlayout.h \
- kernel/qtooltip.h \
kernel/qwidget.h \
kernel/qwidget_p.h \
kernel/qwidgetaction.h \
@@ -42,7 +41,7 @@ SOURCES += \
kernel/qaction.cpp \
kernel/qactiongroup.cpp \
kernel/qapplication.cpp \
- kernel/qwidgetbackingstore.cpp \
+ kernel/qwidgetrepaintmanager.cpp \
kernel/qboxlayout.cpp \
kernel/qgridlayout.cpp \
kernel/qlayout.cpp \
@@ -51,7 +50,6 @@ SOURCES += \
kernel/qshortcut.cpp \
kernel/qsizepolicy.cpp \
kernel/qstackedlayout.cpp \
- kernel/qtooltip.cpp \
kernel/qwidget.cpp \
kernel/qwidgetaction.cpp \
kernel/qgesture.cpp \
@@ -79,6 +77,11 @@ qtConfig(formlayout) {
SOURCES += kernel/qformlayout.cpp
}
+qtConfig(tooltip) {
+ HEADERS += kernel/qtooltip.h
+ SOURCES += kernel/qtooltip.cpp
+}
+
qtConfig(whatsthis) {
HEADERS += kernel/qwhatsthis.h
SOURCES += kernel/qwhatsthis.cpp
diff --git a/src/widgets/kernel/mac.pri b/src/widgets/kernel/mac.pri
index f7e7aa869a..d21e5d4a74 100644
--- a/src/widgets/kernel/mac.pri
+++ b/src/widgets/kernel/mac.pri
@@ -1,4 +1 @@
-macos {
- LIBS_PRIVATE += -framework AppKit -lz
- *-mwerks:INCLUDEPATH += compat
-}
+macos: LIBS_PRIVATE += -framework AppKit -lz
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 1ca5514655..19ad65692b 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -47,15 +47,15 @@
#include "qlist.h"
#include "qstylehints.h"
#include <private/qshortcutmap_p.h>
-#include <private/qapplication_p.h>
+#include <private/qguiapplication_p.h>
#if QT_CONFIG(menu)
#include <private/qmenu_p.h>
#endif
#include <private/qdebug_p.h>
#define QAPP_CHECK(functionName) \
- if (Q_UNLIKELY(!qApp)) { \
- qWarning("QAction: Initialize QApplication before calling '" functionName "'."); \
+ if (Q_UNLIKELY(!QCoreApplication::instance())) { \
+ qWarning("QAction: Initialize Q(Gui)Application before calling '" functionName "'."); \
return; \
}
@@ -75,24 +75,18 @@ static QString qt_strippedText(QString s)
}
-QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0),
- visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false),
- iconVisibleInMenu(-1),
- shortcutVisibleInContextMenu(-1),
- menuRole(QAction::TextHeuristicRole),
- priority(QAction::NormalPriority)
-{
-#ifndef QT_NO_SHORTCUT
- shortcutId = 0;
- shortcutContext = Qt::WindowShortcut;
- autorepeat = true;
+QActionPrivate::QActionPrivate() :
+#if QT_CONFIG(shortcut)
+ autorepeat(1),
#endif
-}
-
-QActionPrivate::~QActionPrivate()
+ enabled(1), forceDisabled(0), visible(1), forceInvisible(0), checkable(0),
+ checked(0), separator(0), fontSet(false),
+ iconVisibleInMenu(-1), shortcutVisibleInContextMenu(-1)
{
}
+QActionPrivate::~QActionPrivate() = default;
+
bool QActionPrivate::showStatusText(QWidget *widget, const QString &str)
{
#if !QT_CONFIG(statustip)
@@ -101,7 +95,7 @@ bool QActionPrivate::showStatusText(QWidget *widget, const QString &str)
#else
if(QObject *object = widget ? widget : parent) {
QStatusTipEvent tip(str);
- QApplication::sendEvent(object, &tip);
+ QCoreApplication::sendEvent(object, &tip);
return true;
}
#endif
@@ -114,20 +108,20 @@ void QActionPrivate::sendDataChanged()
QActionEvent e(QEvent::ActionChanged, q);
for (int i = 0; i < widgets.size(); ++i) {
QWidget *w = widgets.at(i);
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
}
#if QT_CONFIG(graphicsview)
for (int i = 0; i < graphicsWidgets.size(); ++i) {
QGraphicsWidget *w = graphicsWidgets.at(i);
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
}
#endif
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
emit q->changed();
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
void QActionPrivate::redoGrab(QShortcutMap &map)
{
Q_Q(QAction);
@@ -345,7 +339,7 @@ QWidget *QAction::parentWidget() const
QObject *ret = parent();
while (ret && !ret->isWidgetType())
ret = ret->parent();
- return (QWidget*)ret;
+ return static_cast<QWidget*>(ret);
}
/*!
@@ -374,7 +368,7 @@ QList<QGraphicsWidget *> QAction::associatedGraphicsWidgets() const
}
#endif
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
/*!
\property QAction::shortcut
\brief the action's primary shortcut key
@@ -391,7 +385,7 @@ void QAction::setShortcut(const QKeySequence &shortcut)
return;
d->shortcut = shortcut;
- d->redoGrab(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
d->sendDataChanged();
}
@@ -420,8 +414,8 @@ void QAction::setShortcuts(const QList<QKeySequence> &shortcuts)
d->shortcut = primary;
d->alternateShortcuts = listCopy;
- d->redoGrab(qApp->d_func()->shortcutMap);
- d->redoGrabAlternate(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
+ d->redoGrabAlternate(QGuiApplicationPrivate::instance()->shortcutMap);
d->sendDataChanged();
}
@@ -485,8 +479,8 @@ void QAction::setShortcutContext(Qt::ShortcutContext context)
return;
QAPP_CHECK("setShortcutContext");
d->shortcutContext = context;
- d->redoGrab(qApp->d_func()->shortcutMap);
- d->redoGrabAlternate(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
+ d->redoGrabAlternate(QGuiApplicationPrivate::instance()->shortcutMap);
d->sendDataChanged();
}
@@ -513,8 +507,8 @@ void QAction::setAutoRepeat(bool on)
return;
QAPP_CHECK("setAutoRepeat");
d->autorepeat = on;
- d->redoGrab(qApp->d_func()->shortcutMap);
- d->redoGrabAlternate(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
+ d->redoGrabAlternate(QGuiApplicationPrivate::instance()->shortcutMap);
d->sendDataChanged();
}
@@ -573,12 +567,12 @@ QAction::~QAction()
#endif
if (d->group)
d->group->removeAction(this);
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (d->shortcutId && qApp) {
- qApp->d_func()->shortcutMap.removeShortcut(d->shortcutId, this);
+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(d->shortcutId, this);
for(int i = 0; i < d->alternateShortcutIds.count(); ++i) {
const int id = d->alternateShortcutIds.at(i);
- qApp->d_func()->shortcutMap.removeShortcut(id, this);
+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(id, this);
}
}
#endif
@@ -1027,8 +1021,8 @@ void QAction::setEnabled(bool b)
return;
QAPP_CHECK("setEnabled");
d->enabled = b;
-#ifndef QT_NO_SHORTCUT
- d->setShortcutEnabled(b, qApp->d_func()->shortcutMap);
+#if QT_CONFIG(shortcut)
+ d->setShortcutEnabled(b, QGuiApplicationPrivate::instance()->shortcutMap);
#endif
d->sendDataChanged();
}
@@ -1061,8 +1055,8 @@ void QAction::setVisible(bool b)
d->forceInvisible = !b;
d->visible = b;
d->enabled = b && !d->forceDisabled && (!d->group || d->group->isEnabled()) ;
-#ifndef QT_NO_SHORTCUT
- d->setShortcutEnabled(d->enabled, qApp->d_func()->shortcutMap);
+#if QT_CONFIG(shortcut)
+ d->setShortcutEnabled(d->enabled, QGuiApplicationPrivate::instance()->shortcutMap);
#endif
d->sendDataChanged();
}
@@ -1080,7 +1074,7 @@ bool QAction::isVisible() const
bool
QAction::event(QEvent *e)
{
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (e->type() == QEvent::Shortcut) {
QShortcutEvent *se = static_cast<QShortcutEvent *>(e);
Q_ASSERT_X(se->key() == d_func()->shortcut || d_func()->alternateShortcuts.contains(se->key()),
@@ -1153,8 +1147,9 @@ void QAction::activate(ActionEvent event)
if(event == Trigger) {
QPointer<QObject> guard = this;
if(d->checkable) {
- // the checked action of an exclusive group cannot be unchecked
- if (d->checked && (d->group && d->group->isExclusive()
+ // the checked action of an exclusive group may not be unchecked
+ if (d->checked && (d->group
+ && d->group->exclusionPolicy() == QActionGroup::ExclusionPolicy::Exclusive
&& d->group->checkedAction() == this)) {
if (!guard.isNull())
emit triggered(true);
@@ -1284,7 +1279,7 @@ void QAction::setIconVisibleInMenu(bool visible)
d->iconVisibleInMenu = visible;
// Only send data changed if we really need to.
if (oldValue != -1
- || visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus)) {
+ || visible == !QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus)) {
d->sendDataChanged();
}
}
@@ -1294,7 +1289,7 @@ bool QAction::isIconVisibleInMenu() const
{
Q_D(const QAction);
if (d->iconVisibleInMenu == -1) {
- return !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus);
+ return !QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus);
}
return d->iconVisibleInMenu;
}
@@ -1322,7 +1317,7 @@ void QAction::setShortcutVisibleInContextMenu(bool visible)
d->shortcutVisibleInContextMenu = visible;
// Only send data changed if we really need to.
if (oldValue != -1
- || visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowShortcutsInContextMenus)) {
+ || visible == !QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus)) {
d->sendDataChanged();
}
}
@@ -1350,7 +1345,7 @@ Q_WIDGETS_EXPORT QDebug operator<<(QDebug d, const QAction *action)
d << " toolTip=" << action->toolTip();
if (action->isCheckable())
d << " checked=" << action->isChecked();
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (!action->shortcut().isEmpty())
d << " shortcut=" << action->shortcut();
#endif
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h
index 84bf92d2ac..f7693f4dde 100644
--- a/src/widgets/kernel/qaction.h
+++ b/src/widgets/kernel/qaction.h
@@ -72,7 +72,7 @@ class Q_WIDGETS_EXPORT QAction : public QObject
Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip NOTIFY changed)
Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis NOTIFY changed)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed)
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut NOTIFY changed)
Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext NOTIFY changed)
Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY changed)
@@ -129,7 +129,7 @@ public:
void setSeparator(bool b);
bool isSeparator() const;
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
void setShortcut(const QKeySequence &shortcut);
QKeySequence shortcut() const;
diff --git a/src/widgets/kernel/qaction_p.h b/src/widgets/kernel/qaction_p.h
index 19ae47c7b9..6b6ca8076f 100644
--- a/src/widgets/kernel/qaction_p.h
+++ b/src/widgets/kernel/qaction_p.h
@@ -89,15 +89,15 @@ public:
QString tooltip;
QString statustip;
QString whatsthis;
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
QKeySequence shortcut;
QList<QKeySequence> alternateShortcuts;
#endif
QVariant userData;
-#ifndef QT_NO_SHORTCUT
- int shortcutId;
+#if QT_CONFIG(shortcut)
+ int shortcutId = 0;
QVector<int> alternateShortcutIds;
- Qt::ShortcutContext shortcutContext;
+ Qt::ShortcutContext shortcutContext = Qt::WindowShortcut;
uint autorepeat : 1;
#endif
QFont font;
@@ -112,19 +112,17 @@ public:
int iconVisibleInMenu : 2; // Only has values -1, 0, and 1
int shortcutVisibleInContextMenu : 2; // Only has values -1, 0, and 1
- QAction::MenuRole menuRole;
- QAction::Priority priority;
+ QAction::MenuRole menuRole = QAction::TextHeuristicRole;
+ QAction::Priority priority = QAction::NormalPriority;
- QList<QWidget *> widgets;
+ QWidgetList widgets;
#if QT_CONFIG(graphicsview)
QList<QGraphicsWidget *> graphicsWidgets;
#endif
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
void redoGrab(QShortcutMap &map);
void redoGrabAlternate(QShortcutMap &map);
void setShortcutEnabled(bool enable, QShortcutMap &map);
-
- static QShortcutMap *globalMap;
#endif // QT_NO_SHORTCUT
void sendDataChanged();
diff --git a/src/widgets/kernel/qactiongroup.cpp b/src/widgets/kernel/qactiongroup.cpp
index 4786437d7e..1d9213de0c 100644
--- a/src/widgets/kernel/qactiongroup.cpp
+++ b/src/widgets/kernel/qactiongroup.cpp
@@ -42,7 +42,6 @@
#ifndef QT_NO_ACTION
#include "qaction_p.h"
-#include "qapplication.h"
#include "qevent.h"
#include "qlist.h"
@@ -52,12 +51,16 @@ class QActionGroupPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QActionGroup)
public:
- QActionGroupPrivate() : exclusive(1), enabled(1), visible(1) { }
+ QActionGroupPrivate() : enabled(1),
+ visible(1),
+ exclusionPolicy(QActionGroup::ExclusionPolicy::Exclusive)
+ {
+ }
QList<QAction *> actions;
QPointer<QAction> current;
- uint exclusive : 1;
uint enabled : 1;
uint visible : 1;
+ QActionGroup::ExclusionPolicy exclusionPolicy;
private:
void _q_actionTriggered(); //private slot
@@ -69,8 +72,8 @@ void QActionGroupPrivate::_q_actionChanged()
{
Q_Q(QActionGroup);
QAction *action = qobject_cast<QAction*>(q->sender());
- Q_ASSERT_X(action != 0, "QWidgetGroup::_q_actionChanged", "internal error");
- if(exclusive) {
+ Q_ASSERT_X(action != nullptr, "QActionGroup::_q_actionChanged", "internal error");
+ if (exclusionPolicy != QActionGroup::ExclusionPolicy::None) {
if (action->isChecked()) {
if (action != current) {
if(current)
@@ -87,7 +90,7 @@ void QActionGroupPrivate::_q_actionTriggered()
{
Q_Q(QActionGroup);
QAction *action = qobject_cast<QAction*>(q->sender());
- Q_ASSERT_X(action != 0, "QWidgetGroup::_q_actionTriggered", "internal error");
+ Q_ASSERT_X(action != nullptr, "QActionGroup::_q_actionTriggered", "internal error");
emit q->triggered(action);
}
@@ -95,7 +98,7 @@ void QActionGroupPrivate::_q_actionHovered()
{
Q_Q(QActionGroup);
QAction *action = qobject_cast<QAction*>(q->sender());
- Q_ASSERT_X(action != 0, "QWidgetGroup::_q_actionHovered", "internal error");
+ Q_ASSERT_X(action != nullptr, "QActionGroup::_q_actionHovered", "internal error");
emit q->hovered(action);
}
@@ -127,12 +130,17 @@ void QActionGroupPrivate::_q_actionHovered()
actions is chosen. Each action in an action group emits its
triggered() signal as usual.
- As stated above, an action group is \l exclusive by default; it
- ensures that only one checkable action is active at any one time.
+ As stated above, an action group is exclusive by default; it
+ ensures that at most only one checkable action is active at any one time.
If you want to group checkable actions without making them
- exclusive, you can turn of exclusiveness by calling
+ exclusive, you can turn off exclusiveness by calling
setExclusive(false).
+ By default the active action of an exclusive group cannot be unchecked.
+ In some cases it may be useful to allow unchecking all the actions,
+ you can allow this by calling
+ setExclusionPolicy(QActionGroup::ExclusionPolicy::ExclusiveOptional).
+
Actions can be added to an action group using addAction(), but it
is usually more convenient to specify a group when creating
actions; this ensures that actions are automatically created with
@@ -146,10 +154,33 @@ void QActionGroupPrivate::_q_actionHovered()
*/
/*!
+ \enum QActionGroup::ExclusionPolicy
+
+ This enum specifies the different policies that can be used to
+ control how the group performs exclusive checking on checkable actions.
+
+ \value None
+ The actions in the group can be checked independently of each other.
+
+ \value Exclusive
+ Exactly one action can be checked at any one time.
+ This is the default policy.
+
+ \value ExclusiveOptional
+ At most one action can be checked at any one time. The actions
+ can also be all unchecked.
+
+ \sa exclusionPolicy
+ \since 5.14
+*/
+
+/*!
Constructs an action group for the \a parent object.
The action group is exclusive by default. Call setExclusive(false)
- to make the action group non-exclusive.
+ to make the action group non-exclusive. To make the group exclusive
+ but allow unchecking the active action call instead
+ setExclusionPolicy(QActionGroup::ExclusionPolicy::ExclusiveOptional)
*/
QActionGroup::QActionGroup(QObject* parent) : QObject(*new QActionGroupPrivate, parent)
{
@@ -258,26 +289,56 @@ QList<QAction*> QActionGroup::actions() const
}
/*!
- \property QActionGroup::exclusive
- \brief whether the action group does exclusive checking
+ \brief Enable or disable the group exclusion checking
- If exclusive is true, only one checkable action in the action group
- can ever be active at any time. If the user chooses another
- checkable action in the group, the one they chose becomes active and
- the one that was active becomes inactive.
+ This is a convenience method that calls
+ setExclusionPolicy(ExclusionPolicy::Exclusive).
- \sa QAction::checkable
+ \sa QActionGroup::exclusionPolicy
*/
void QActionGroup::setExclusive(bool b)
{
- Q_D(QActionGroup);
- d->exclusive = b;
+ setExclusionPolicy(b ? QActionGroup::ExclusionPolicy::Exclusive
+ : QActionGroup::ExclusionPolicy::None);
}
+/*!
+ \brief Returs true if the group is exclusive
+
+ The group is exclusive if the ExclusionPolicy is either Exclusive
+ or ExclusionOptional.
+
+*/
bool QActionGroup::isExclusive() const
{
+ return exclusionPolicy() != QActionGroup::ExclusionPolicy::None;
+}
+
+/*!
+ \property QActionGroup::exclusionPolicy
+ \brief This property holds the group exclusive checking policy
+
+ If exclusionPolicy is set to Exclusive, only one checkable
+ action in the action group can ever be active at any time. If the user
+ chooses another checkable action in the group, the one they chose becomes
+ active and the one that was active becomes inactive. If exclusionPolicy is
+ set to ExclusionOptional the group is exclusive but the active checkable
+ action in the group can be unchecked leaving the group with no actions
+ checked.
+
+ \sa QAction::checkable
+ \since 5.14
+*/
+void QActionGroup::setExclusionPolicy(QActionGroup::ExclusionPolicy policy)
+{
+ Q_D(QActionGroup);
+ d->exclusionPolicy = policy;
+}
+
+QActionGroup::ExclusionPolicy QActionGroup::exclusionPolicy() const
+{
Q_D(const QActionGroup);
- return d->exclusive;
+ return d->exclusionPolicy;
}
/*!
@@ -301,10 +362,10 @@ void QActionGroup::setEnabled(bool b)
{
Q_D(QActionGroup);
d->enabled = b;
- for(QList<QAction*>::const_iterator it = d->actions.constBegin(); it != d->actions.constEnd(); ++it) {
- if(!(*it)->d_func()->forceDisabled) {
- (*it)->setEnabled(b);
- (*it)->d_func()->forceDisabled = false;
+ for (auto action : qAsConst(d->actions)) {
+ if (!action->d_func()->forceDisabled) {
+ action->setEnabled(b);
+ action->d_func()->forceDisabled = false;
}
}
}
@@ -338,10 +399,10 @@ void QActionGroup::setVisible(bool b)
{
Q_D(QActionGroup);
d->visible = b;
- for(QList<QAction*>::Iterator it = d->actions.begin(); it != d->actions.end(); ++it) {
- if(!(*it)->d_func()->forceInvisible) {
- (*it)->setVisible(b);
- (*it)->d_func()->forceInvisible = false;
+ for (auto action : qAsConst(d->actions)) {
+ if (!action->d_func()->forceInvisible) {
+ action->setVisible(b);
+ action->d_func()->forceInvisible = false;
}
}
}
diff --git a/src/widgets/kernel/qactiongroup.h b/src/widgets/kernel/qactiongroup.h
index 61c90b911d..90f488bedb 100644
--- a/src/widgets/kernel/qactiongroup.h
+++ b/src/widgets/kernel/qactiongroup.h
@@ -55,11 +55,18 @@ class Q_WIDGETS_EXPORT QActionGroup : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QActionGroup)
- Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive)
+ Q_PROPERTY(QActionGroup::ExclusionPolicy exclusionPolicy READ exclusionPolicy WRITE setExclusionPolicy)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible)
public:
+ enum class ExclusionPolicy {
+ None,
+ Exclusive,
+ ExclusiveOptional
+ };
+ Q_ENUM(ExclusionPolicy)
+
explicit QActionGroup(QObject* parent);
~QActionGroup();
@@ -73,6 +80,7 @@ public:
bool isExclusive() const;
bool isEnabled() const;
bool isVisible() const;
+ ExclusionPolicy exclusionPolicy() const;
public Q_SLOTS:
@@ -80,6 +88,7 @@ public Q_SLOTS:
inline void setDisabled(bool b) { setEnabled(!b); }
void setVisible(bool);
void setExclusive(bool);
+ void setExclusionPolicy(ExclusionPolicy policy);
Q_SIGNALS:
void triggered(QAction *);
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 486c424391..dfa1bc23b1 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -111,6 +111,9 @@
#include <qtwidgets_tracepoints_p.h>
+#include <algorithm>
+#include <iterator>
+
//#define ALIEN_DEBUG
static void initResources()
@@ -233,9 +236,6 @@ void QApplicationPrivate::createEventDispatcher()
encapsulated in a QStyle object. This can be changed at runtime
with setStyle().
- \li It specifies how the application is to allocate colors. See
- setColorSpec() for details.
-
\li It provides localization of strings that are visible to the
user via translate().
@@ -296,11 +296,6 @@ void QApplicationPrivate::createEventDispatcher()
setStyle().
\row
- \li Color usage
- \li colorSpec(),
- setColorSpec().
-
- \row
\li Text handling
\li installTranslator(),
removeTranslator()
@@ -334,6 +329,7 @@ void QApplicationPrivate::createEventDispatcher()
\sa QCoreApplication, QAbstractEventDispatcher, QEventLoop, QSettings
*/
+#if QT_DEPRECATED_SINCE(5, 8)
// ### fixme: Qt 6: Remove ColorSpec and accessors.
/*!
\enum QApplication::ColorSpec
@@ -347,15 +343,7 @@ void QApplicationPrivate::createEventDispatcher()
See setColorSpec() for full details.
*/
-
-/*!
- \fn QApplication::setGraphicsSystem(const QString &)
- \obsolete
-
- This call has no effect.
-
- Use the QPA framework instead.
-*/
+#endif
/*!
\fn QWidget *QApplication::topLevelAt(const QPoint &point)
@@ -570,10 +558,6 @@ void QApplicationPrivate::init()
initialize();
eventDispatcher->startingUp();
-#ifdef QT_EVAL
- extern void qt_gui_eval_init(QCoreApplicationPrivate::Type);
- qt_gui_eval_init(application_type);
-#endif
#ifndef QT_NO_ACCESSIBILITY
// factory for accessible interfaces for widgets shipped with Qt
QAccessible::installFactory(&qAccessibleFactory);
@@ -626,7 +610,7 @@ void QApplicationPrivate::initialize()
if (qt_is_gui_used)
initializeMultitouch();
- if (QApplication::desktopSettingsAware())
+ if (QGuiApplication::desktopSettingsAware())
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt();
}
@@ -1176,7 +1160,7 @@ void QApplication::setStyle(QStyle *style)
QWidget *w = *it;
if (w->windowType() != Qt::Desktop && !w->testAttribute(Qt::WA_SetStyle)) {
QEvent e(QEvent::StyleChange);
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
w->update();
}
}
@@ -1193,7 +1177,7 @@ void QApplication::setStyle(QStyle *style)
if (QApplicationPrivate::focus_widget) {
QFocusEvent in(QEvent::FocusIn, Qt::OtherFocusReason);
- QApplication::sendEvent(QApplicationPrivate::focus_widget->style(), &in);
+ QCoreApplication::sendEvent(QApplicationPrivate::focus_widget->style(), &in);
QApplicationPrivate::focus_widget->update();
}
}
@@ -1555,7 +1539,7 @@ void QApplication::setFont(const QFont &font, const char *className)
if (QApplicationPrivate::is_app_running && !QApplicationPrivate::is_app_closing) {
// Send ApplicationFontChange to qApp itself, and to the widgets.
QEvent e(QEvent::ApplicationFontChange);
- QApplication::sendEvent(QApplication::instance(), &e);
+ QCoreApplication::sendEvent(QApplication::instance(), &e);
QWidgetList wids = QApplication::allWidgets();
for (QWidgetList::ConstIterator it = wids.constBegin(), cend = wids.constEnd(); it != cend; ++it) {
@@ -1569,7 +1553,7 @@ void QApplication::setFont(const QFont &font, const char *className)
QList<QGraphicsScene *> &scenes = qApp->d_func()->scene_list;
for (QList<QGraphicsScene *>::ConstIterator it = scenes.constBegin();
it != scenes.constEnd(); ++it) {
- QApplication::sendEvent(*it, &e);
+ QCoreApplication::sendEvent(*it, &e);
}
#endif // QT_CONFIG(graphicsview)
}
@@ -1662,12 +1646,12 @@ void QApplicationPrivate::notifyWindowIconChanged()
QWidgetList QApplication::topLevelWidgets()
{
QWidgetList list;
- QWidgetList all = allWidgets();
-
- for (QWidgetList::ConstIterator it = all.constBegin(), cend = all.constEnd(); it != cend; ++it) {
- QWidget *w = *it;
- if (w->isWindow() && w->windowType() != Qt::Desktop)
- list.append(w);
+ if (QWidgetPrivate::allWidgets != nullptr) {
+ const auto isTopLevelWidget = [] (const QWidget *w) {
+ return w->isWindow() && w->windowType() != Qt::Desktop;
+ };
+ std::copy_if(QWidgetPrivate::allWidgets->cbegin(), QWidgetPrivate::allWidgets->cend(),
+ std::back_inserter(list), isTopLevelWidget);
}
return list;
}
@@ -1688,7 +1672,7 @@ QWidgetList QApplication::topLevelWidgets()
QWidgetList QApplication::allWidgets()
{
if (QWidgetPrivate::allWidgets)
- return QWidgetPrivate::allWidgets->toList();
+ return QWidgetPrivate::allWidgets->values();
return QWidgetList();
}
@@ -1743,16 +1727,16 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason)
#endif
QFocusEvent out(QEvent::FocusOut, reason);
QPointer<QWidget> that = prev;
- QApplication::sendEvent(prev, &out);
+ QCoreApplication::sendEvent(prev, &out);
if (that)
- QApplication::sendEvent(that->style(), &out);
+ QCoreApplication::sendEvent(that->style(), &out);
}
if(focus && QApplicationPrivate::focus_widget == focus) {
QFocusEvent in(QEvent::FocusIn, reason);
QPointer<QWidget> that = focus;
- QApplication::sendEvent(focus, &in);
+ QCoreApplication::sendEvent(focus, &in);
if (that)
- QApplication::sendEvent(that->style(), &in);
+ QCoreApplication::sendEvent(that->style(), &in);
}
emit qApp->focusChanged(prev, focus_widget);
}
@@ -1882,22 +1866,19 @@ void QApplication::aboutQt()
bool QApplication::event(QEvent *e)
{
Q_D(QApplication);
- if(e->type() == QEvent::Close) {
- QCloseEvent *ce = static_cast<QCloseEvent*>(e);
- ce->accept();
+ if (e->type() == QEvent::Quit) {
closeAllWindows();
-
- const QWidgetList list = topLevelWidgets();
- for (auto *w : list) {
+ for (auto *w : topLevelWidgets()) {
if (w->isVisible() && !(w->windowType() == Qt::Desktop) && !(w->windowType() == Qt::Popup) &&
(!(w->windowType() == Qt::Dialog) || !w->parentWidget())) {
- ce->ignore();
- break;
+ e->ignore();
+ return true;
}
}
- if (ce->isAccepted()) {
- return true;
- }
+ // Explicitly call QCoreApplication instead of QGuiApplication so that
+ // we don't let QGuiApplication close any windows we skipped earlier in
+ // closeAllWindows(). FIXME: Unify all this close magic through closeAllWindows.
+ return QCoreApplication::event(e);
#ifndef Q_OS_WIN
} else if (e->type() == QEvent::LocaleChange) {
// on Windows the event propagation is taken care by the
@@ -1928,7 +1909,7 @@ bool QApplication::event(QEvent *e)
}
if (showToolTip) {
QHelpEvent e(QEvent::ToolTip, d->toolTipPos, d->toolTipGlobalPos);
- QApplication::sendEvent(d->toolTipWidget, &e);
+ QCoreApplication::sendEvent(d->toolTipWidget, &e);
if (e.isAccepted()) {
QStyle *s = d->toolTipWidget->style();
int sleepDelay = s->styleHint(QStyle::SH_ToolTip_FallAsleepDelay, 0, d->toolTipWidget, 0);
@@ -1957,13 +1938,6 @@ bool QApplication::event(QEvent *e)
return QGuiApplication::event(e);
}
-/*!
- \fn void QApplication::syncX()
- Was used to synchronize with the X server in 4.x, here for source compatibility.
- \internal
- \obsolete
-*/
-
// ### FIXME: topLevelWindows does not contain QWidgets without a parent
// until QWidgetPrivate::create is called. So we have to override the
// QGuiApplication::notifyLayoutDirectionChange
@@ -2040,7 +2014,7 @@ void QApplication::setActiveWindow(QWidget* act)
QGuiApplication::inputMethod()->commit();
QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, Qt::ActiveWindowFocusReason);
- QApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange);
+ QCoreApplication::sendEvent(QApplicationPrivate::focus_widget, &focusAboutToChange);
}
QApplicationPrivate::active_window = window;
@@ -2115,7 +2089,7 @@ QWidget *qt_tlw_for_window(QWindow *wnd)
wnd = wnd->parent();
}
if (wnd) {
- const auto tlws = qApp->topLevelWidgets();
+ const auto tlws = QApplication::topLevelWidgets();
for (QWidget *tlw : tlws) {
if (tlw->windowHandle() == wnd)
return tlw;
@@ -2209,12 +2183,12 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
#if 0
if (leave) {
QEvent e(QEvent::Leave);
- QApplication::sendEvent(leave, & e);
+ QCoreApplication::sendEvent(leave, & e);
}
if (enter) {
const QPoint windowPos = enter->window()->mapFromGlobal(globalPos);
QEnterEvent e(enter->mapFromGlobal(globalPos), windowPos, globalPos);
- QApplication::sendEvent(enter, & e);
+ QCoreApplication::sendEvent(enter, & e);
}
return;
#endif
@@ -2275,12 +2249,12 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
for (int i = 0; i < leaveList.size(); ++i) {
auto *w = leaveList.at(i);
if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) {
- QApplication::sendEvent(w, &leaveEvent);
+ QCoreApplication::sendEvent(w, &leaveEvent);
if (w->testAttribute(Qt::WA_Hover) &&
(!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) {
Q_ASSERT(instance());
QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos),
- QApplication::keyboardModifiers());
+ QGuiApplication::keyboardModifiers());
qApp->d_func()->notify_helper(w, &he);
}
}
@@ -2296,11 +2270,11 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave, con
if (!QApplication::activeModalWidget() || QApplicationPrivate::tryModalHelper(w, 0)) {
const QPointF localPos = w->mapFromGlobal(globalPos);
QEnterEvent enterEvent(localPos, windowPos, globalPosF);
- QApplication::sendEvent(w, &enterEvent);
+ QCoreApplication::sendEvent(w, &enterEvent);
if (w->testAttribute(Qt::WA_Hover) &&
(!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) {
QHoverEvent he(QEvent::HoverEnter, localPos, QPoint(-1, -1),
- QApplication::keyboardModifiers());
+ QGuiApplication::keyboardModifiers());
qApp->d_func()->notify_helper(w, &he);
}
}
@@ -2648,7 +2622,7 @@ bool QApplicationPrivate::sendMouseEvent(QWidget *receiver, QMouseEvent *event,
if (spontaneous)
result = QApplication::sendSpontaneousEvent(receiver, event);
else
- result = QApplication::sendEvent(receiver, event);
+ result = QCoreApplication::sendEvent(receiver, event);
}
if (!graphicsWidget && leaveAfterRelease && event->type() == QEvent::MouseButtonRelease
@@ -2902,7 +2876,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
#ifndef QT_NO_DEBUG
- d->checkReceiverThread(receiver);
+ QCoreApplicationPrivate::checkReceiverThread(receiver);
#endif
if (receiver->isWindowType()) {
@@ -3241,13 +3215,21 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
if (spontaneous && phase == Qt::ScrollBegin)
QApplicationPrivate::wheel_widget = nullptr;
- const QPoint &relpos = wheel->pos();
+ QPoint relpos = wheel->position().toPoint();
if (spontaneous && (phase == Qt::NoScrollPhase || phase == Qt::ScrollUpdate))
QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos);
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
wheel->modifiers(), phase, wheel->source(), wheel->inverted());
+QT_WARNING_POP
+#else
+ QWheelEvent we(relpos, wheel->globalPosition(), wheel->pixelDelta(), wheel->angleDelta(), wheel->buttons(),
+ wheel->modifiers(), phase, wheel->inverted(), wheel->source());
+#endif
we.setTimestamp(wheel->timestamp());
bool eventAccepted;
do {
@@ -3282,9 +3264,17 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
// is set. Since it accepted the wheel event previously, we continue
// sending those events until we get a ScrollEnd, which signifies
// the end of the natural scrolling sequence.
- const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPos());
+ const QPoint &relpos = QApplicationPrivate::wheel_widget->mapFromGlobal(wheel->globalPosition().toPoint());
+#if QT_DEPRECATED_SINCE(5, 0)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
wheel->modifiers(), wheel->phase(), wheel->source());
+QT_WARNING_POP
+#else
+ QWheelEvent we(relpos, wheel->globalPosition(), wheel->pixelDelta(), wheel->angleDelta(), wheel->buttons(),
+ wheel->modifiers(), wheel->phase(), wheel->inverted(), wheel->source());
+#endif
we.setTimestamp(wheel->timestamp());
we.spont = true;
we.ignore();
@@ -3401,7 +3391,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
#if QT_CONFIG(graphicsview)
// QGraphicsProxyWidget handles its own propagation,
// and we must not change QDragManagers currentTarget.
- QWExtra *extra = w->window()->d_func()->extra;
+ const auto &extra = w->window()->d_func()->extra;
if (extra && extra->proxyWidget) {
res = d->notify_helper(w, dragEvent);
break;
@@ -3429,7 +3419,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
#if QT_CONFIG(graphicsview)
// QGraphicsProxyWidget handles its own propagation,
// and we must not change QDragManagers currentTarget.
- QWExtra *extra = w->window()->d_func()->extra;
+ const auto &extra = w->window()->d_func()->extra;
bool isProxyWidget = extra && extra->proxyWidget;
if (!isProxyWidget)
#endif
@@ -3670,7 +3660,7 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
// send to all application event filters
if (threadRequiresCoreApplication()
- && receiver->d_func()->threadData->thread == mainThread()
+ && receiver->d_func()->threadData->thread.loadAcquire() == mainThread()
&& sendThroughApplicationEventFilters(receiver, e)) {
filtered = true;
return filtered;
@@ -3822,7 +3812,7 @@ void QApplicationPrivate::openPopup(QWidget *popup)
} else if (popupWidgets->count() == 1) { // this was the first popup
if (QWidget *fw = QApplication::focusWidget()) {
QFocusEvent e(QEvent::FocusOut, Qt::PopupFocusReason);
- QApplication::sendEvent(fw, &e);
+ QCoreApplication::sendEvent(fw, &e);
}
}
}
@@ -3834,8 +3824,6 @@ void QApplicationPrivate::openPopup(QWidget *popup)
This feature is available in Qt for Embedded Linux only.
\since 4.6
-
- \sa keypadNavigationEnabled()
*/
void QApplication::setNavigationMode(Qt::NavigationMode mode)
{
@@ -3848,8 +3836,6 @@ void QApplication::setNavigationMode(Qt::NavigationMode mode)
This feature is available in Qt for Embedded Linux only.
\since 4.6
-
- \sa keypadNavigationEnabled()
*/
Qt::NavigationMode QApplication::navigationMode()
{
@@ -3985,15 +3971,6 @@ int QApplication::doubleClickInterval()
}
/*!
- \fn QApplication::keyboardInputDirection()
- \since 4.2
- \deprecated
-
- Returns the current keyboard input direction. Replaced with QInputMethod::inputDirection()
- \sa QInputMethod::inputDirection()
-*/
-
-/*!
\property QApplication::keyboardInputInterval
\brief the time limit in milliseconds that distinguishes a key press
from two consecutive key presses
@@ -4130,14 +4107,6 @@ void QApplication::beep()
\sa QCoreApplication::instance(), qGuiApp
*/
-/*!
- \fn QLocale QApplication::keyboardInputLocale()
- \since 4.2
- \obsolete
-
- Returns the current keyboard input locale. Replaced with QInputMethod::locale()
-*/
-
bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event)
{
return QGuiApplication::sendSpontaneousEvent(receiver, event);
@@ -4387,7 +4356,7 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window,
QTouchEvent touchEvent(eventType,
device,
- QApplication::keyboardModifiers(),
+ QGuiApplication::keyboardModifiers(),
it.value().first,
it.value().second);
bool containsPress = updateTouchPointsForWidget(widget, &touchEvent);
@@ -4430,7 +4399,7 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window,
void QApplicationPrivate::translateTouchCancel(QTouchDevice *device, ulong timestamp)
{
- QTouchEvent touchEvent(QEvent::TouchCancel, device, QApplication::keyboardModifiers());
+ QTouchEvent touchEvent(QEvent::TouchCancel, device, QGuiApplication::keyboardModifiers());
touchEvent.setTimestamp(timestamp);
QHash<ActiveTouchPointsKey, ActiveTouchPointsValue>::const_iterator it
= self->activeTouchPoints.constBegin(), ite = self->activeTouchPoints.constEnd();
@@ -4466,12 +4435,12 @@ void QApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const
const QWidgetList widgets = QApplication::allWidgets();
for (auto widget : widgets) {
if (toAllWidgets || (!className && widget->isWindow()) || (className && widget->inherits(className)))
- QApplication::sendEvent(widget, &event);
+ QCoreApplication::sendEvent(widget, &event);
}
#if QT_CONFIG(graphicsview)
for (auto scene : qAsConst(scene_list))
- QApplication::sendEvent(scene, &event);
+ QCoreApplication::sendEvent(scene, &event);
#endif // QT_CONFIG(graphicsview)
}
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 133279f977..3167bd423f 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -112,52 +112,41 @@ public:
virtual bool shouldQuit() override;
bool tryCloseAllWindows() override;
-#if 0 // Used to be included in Qt4 for Q_WS_X11
-#if QT_CONFIG(settings)
- static bool x11_apply_settings();
-#endif
- static void reset_instance_pointer();
-#endif
static bool autoSipEnabled;
static QString desktopStyleKey();
-
void createEventDispatcher() override;
static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF);
void notifyWindowIconChanged() override;
//modality
- bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const override;
+ bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = nullptr) const override;
static bool isBlockedByModal(QWidget *widget);
static bool modalState();
- static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- static QWidget *tryModalHelper_sys(QWidget *top);
- bool canQuit();
+ static bool tryModalHelper(QWidget *widget, QWidget **rettop = nullptr);
+
+#ifdef QT_KEYPAD_NAVIGATION
+ static bool keypadNavigationEnabled()
+ {
+ return navigationMode == Qt::NavigationModeKeypadTabOrder ||
+ navigationMode == Qt::NavigationModeKeypadDirectional;
+ }
#endif
bool notify_helper(QObject *receiver, QEvent * e);
- void init(
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- Display *dpy = 0, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0
-#endif
- );
+ void init();
void initialize();
void process_cmdline();
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- static void x11_initialize_style();
-#endif
-
static bool inPopupMode();
bool popupActive() override { return inPopupMode(); }
void closePopup(QWidget *popup);
void openPopup(QWidget *popup);
static void setFocusWidget(QWidget *focus, Qt::FocusReason reason);
static QWidget *focusNextPrevChild_helper(QWidget *toplevel, bool next,
- bool *wrappingOccurred = 0);
+ bool *wrappingOccurred = nullptr);
#if QT_CONFIG(graphicsview)
// Maintain a list of all scenes to ensure font and palette propagation to
@@ -205,10 +194,6 @@ public:
static void initializeWidgetFontHash();
static void setSystemFont(const QFont &font);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- static void applyX11SpecificCommandLineArguments(QWidget *main_widget);
-#endif
-
static QApplicationPrivate *instance() { return self; }
#ifdef QT_KEYPAD_NAVIGATION
@@ -216,10 +201,6 @@ public:
static Qt::NavigationMode navigationMode;
#endif
-#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */
- void _q_alertTimeOut();
- QHash<QWidget *, QTimer *> alertTimerHash;
-#endif
#ifndef QT_NO_STYLE_STYLESHEET
static QString styleSheet;
#endif
@@ -238,7 +219,7 @@ public:
return window;
if (const QWidget *nativeParent = widget->nativeParentWidget())
return nativeParent->windowHandle();
- return 0;
+ return nullptr;
}
#ifdef Q_OS_WIN
@@ -256,14 +237,6 @@ public:
QGestureManager *gestureManager;
QWidget *gestureWidget;
#endif
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_WIN */
- QPixmap *move_cursor;
- QPixmap *copy_cursor;
- QPixmap *link_cursor;
-#endif
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- QPixmap *ignore_cursor;
-#endif
static bool updateTouchPointsForWidget(QWidget *widget, QTouchEvent *touchEvent);
void initializeMultitouch();
@@ -292,14 +265,7 @@ private:
static bool isAlien(QWidget *);
};
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- extern void qt_win_set_cursor(QWidget *, bool);
-#elif 0 // Used to be included in Qt4 for Q_WS_X11
- extern void qt_x11_enforce_cursor(QWidget *, bool);
- extern void qt_x11_enforce_cursor(QWidget *);
-#else
- extern void qt_qpa_set_cursor(QWidget * w, bool force);
-#endif
+extern void qt_qpa_set_cursor(QWidget * w, bool force);
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp
index a368f379ad..76d8533271 100644
--- a/src/widgets/kernel/qboxlayout.cpp
+++ b/src/widgets/kernel/qboxlayout.cpp
@@ -172,7 +172,7 @@ void QBoxLayoutPrivate::effectiveMargins(int *left, int *top, int *right, int *b
rightDelta = w->geometry().right() - itm->geometry().right();
}
QWidget *w = q->parentWidget();
- Qt::LayoutDirection layoutDirection = w ? w->layoutDirection() : QApplication::layoutDirection();
+ Qt::LayoutDirection layoutDirection = w ? w->layoutDirection() : QGuiApplication::layoutDirection();
if (layoutDirection == Qt::RightToLeft)
qSwap(leftDelta, rightDelta);
diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp
index d17c7eb36c..9e90adec46 100644
--- a/src/widgets/kernel/qdesktopwidget.cpp
+++ b/src/widgets/kernel/qdesktopwidget.cpp
@@ -111,7 +111,7 @@ const QRect QDesktopWidgetPrivate::availableGeometry(const QWidget *widget)
QDesktopScreenWidget *QDesktopWidgetPrivate::widgetForScreen(QScreen *qScreen) const
{
foreach (QDesktopScreenWidget *widget, screens) {
- if (widget->screen() == qScreen)
+ if (widget->assignedScreen() == qScreen)
return widget;
}
return nullptr;
@@ -211,7 +211,9 @@ QDesktopWidget::QDesktopWidget()
setObjectName(QLatin1String("desktop"));
d->_q_updateScreens();
connect(qApp, SIGNAL(screenAdded(QScreen*)), this, SLOT(_q_updateScreens()));
+#if QT_DEPRECATED_SINCE(5, 11)
connect(qApp, SIGNAL(primaryScreenChanged(QScreen*)), this, SIGNAL(primaryScreenChanged()));
+#endif
}
QDesktopWidget::~QDesktopWidget()
@@ -321,20 +323,12 @@ int QDesktopWidgetPrivate::screenNumber(const QWidget *w)
if (screens.isEmpty()) // This should never happen
return primaryScreen();
- const QWindow *winHandle = w->windowHandle();
- if (!winHandle) {
- if (const QWidget *nativeParent = w->nativeParentWidget())
- winHandle = nativeParent->windowHandle();
- }
-
// If there is more than one virtual desktop
if (screens.count() != screens.constFirst()->virtualSiblings().count()) {
// Find the root widget, get a QScreen from it and use the
// virtual siblings for checking the window position.
- if (winHandle) {
- if (const QScreen *winScreen = winHandle->screen())
- screens = winScreen->virtualSiblings();
- }
+ if (const QScreen *winScreen = qt_widget_private(const_cast<QWidget *>(w))->associatedScreen())
+ screens = winScreen->virtualSiblings();
}
// Get the screen number from window position using screen geometry
diff --git a/src/widgets/kernel/qdesktopwidget_p.h b/src/widgets/kernel/qdesktopwidget_p.h
index 69f87337b3..63949055aa 100644
--- a/src/widgets/kernel/qdesktopwidget_p.h
+++ b/src/widgets/kernel/qdesktopwidget_p.h
@@ -68,7 +68,7 @@ public:
int screenNumber() const;
void setScreenGeometry(const QRect &geometry);
- QScreen *screen() const { return m_screen.data(); }
+ QScreen *assignedScreen() const { return m_screen.data(); }
QRect screenGeometry() const { return m_geometry; }
private:
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index bd0ea2598a..6f7527c013 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -783,7 +783,7 @@ void QFormLayoutPrivate::setupVerticalLayoutData(int width)
vLayouts[vidx].expansive = expanding || (vLayouts[vidx].stretch > 0);
vLayouts[vidx].empty = false;
- if (vLayouts[vidx].stretch > 0)
+ if (vLayouts[vidx].expansive)
addTopBottomStretch = false;
if (vidx > 1)
@@ -2178,7 +2178,7 @@ void QFormLayoutPrivate::arrangeWidgets(const QVector<QLayoutStruct>& layouts, Q
int i;
const int rr = m_matrix.rowCount();
QWidget *w = q->parentWidget();
- Qt::LayoutDirection layoutDirection = w ? w->layoutDirection() : QApplication::layoutDirection();
+ Qt::LayoutDirection layoutDirection = w ? w->layoutDirection() : QGuiApplication::layoutDirection();
Qt::Alignment formAlignment = fixedAlignment(q->formAlignment(), layoutDirection);
int leftOffset = 0;
diff --git a/src/widgets/kernel/qgesture_p.h b/src/widgets/kernel/qgesture_p.h
index 636103c1e1..cbf8d60892 100644
--- a/src/widgets/kernel/qgesture_p.h
+++ b/src/widgets/kernel/qgesture_p.h
@@ -111,7 +111,7 @@ class QPinchGesturePrivate : public QGesturePrivate
public:
QPinchGesturePrivate()
- : totalChangeFlags(0), changeFlags(0),
+ : totalChangeFlags(nullptr), changeFlags(nullptr),
totalScaleFactor(1), lastScaleFactor(1), scaleFactor(1),
totalRotationAngle(0), lastRotationAngle(0), rotationAngle(0),
isNewSequence(true)
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 5d2adc1e1c..d0c6b882b5 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -54,9 +54,6 @@
#ifdef Q_OS_OSX
#include "qmacgesturerecognizer_p.h"
#endif
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && !defined(QT_NO_NATIVE_GESTURES)
-#include "qwinnativepangesturerecognizer_win_p.h"
-#endif
#include "qdebug.h"
#include <QtCore/QLoggingCategory>
@@ -102,14 +99,7 @@ QGestureManager::QGestureManager(QObject *parent)
registerGestureRecognizer(new QSwipeGestureRecognizer);
registerGestureRecognizer(new QTapGestureRecognizer);
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- #if !defined(QT_NO_NATIVE_GESTURES)
- if (QApplicationPrivate::HasTouchSupport)
- registerGestureRecognizer(new QWinNativePanGestureRecognizer);
- #endif
-#else
registerGestureRecognizer(new QTapAndHoldGestureRecognizer);
-#endif
}
QGestureManager::~QGestureManager()
@@ -168,30 +158,26 @@ void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType type)
{
- QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin();
- while (iter != m_objectGestures.end()) {
- ObjectGesture objectGesture = iter.key();
- if (objectGesture.gesture == type && target == objectGesture.object) {
- QSet<QGesture *> gestures = iter.value().toSet();
- for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator
- it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) {
- it.value() -= gestures;
- }
- foreach (QGesture *g, gestures) {
- m_deletedRecognizers.remove(g);
- m_gestureToRecognizer.remove(g);
- m_maybeGestures.remove(g);
- m_activeGestures.remove(g);
- m_gestureOwners.remove(g);
- m_gestureTargets.remove(g);
- m_gesturesToDelete.insert(g);
- }
+ const auto iter = m_objectGestures.find({target, type});
+ if (iter == m_objectGestures.end())
+ return;
- iter = m_objectGestures.erase(iter);
- } else {
- ++iter;
- }
+ const QList<QGesture *> &gestures = iter.value();
+ for (auto &e : m_obsoleteGestures) {
+ for (QGesture *g : gestures)
+ e -= g;
+ }
+ for (QGesture *g : gestures) {
+ m_deletedRecognizers.remove(g);
+ m_gestureToRecognizer.remove(g);
+ m_maybeGestures.remove(g);
+ m_activeGestures.remove(g);
+ m_gestureOwners.remove(g);
+ m_gestureTargets.remove(g);
+ m_gesturesToDelete.insert(g);
}
+
+ m_objectGestures.erase(iter);
}
// get or create a QGesture object that will represent the state for a given object, used by the recognizer
@@ -510,14 +496,14 @@ void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture)
// return true if accepted (consumed)
bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
{
- QMap<Qt::GestureType, int> types;
+ QVarLengthArray<Qt::GestureType, 16> types;
QMultiMap<QObject *, Qt::GestureType> contexts;
QWidget *w = receiver;
typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator;
if (!w->d_func()->gestureContext.isEmpty()) {
for(ContextIterator it = w->d_func()->gestureContext.constBegin(),
e = w->d_func()->gestureContext.constEnd(); it != e; ++it) {
- types.insert(it.key(), 0);
+ types.push_back(it.key());
contexts.insert(w, it.key());
}
}
@@ -529,7 +515,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
e = w->d_func()->gestureContext.constEnd(); it != e; ++it) {
if (!(it.value() & Qt::DontStartGestureOnChildren)) {
if (!types.contains(it.key())) {
- types.insert(it.key(), 0);
+ types.push_back(it.key());
contexts.insert(w, it.key());
}
}
@@ -544,14 +530,14 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
#if QT_CONFIG(graphicsview)
bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
{
- QMap<Qt::GestureType, int> types;
+ QVarLengthArray<Qt::GestureType, 16> types;
QMultiMap<QObject *, Qt::GestureType> contexts;
QGraphicsObject *item = receiver;
if (!item->QGraphicsItem::d_func()->gestureContext.isEmpty()) {
typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator;
for(ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.constBegin(),
e = item->QGraphicsItem::d_func()->gestureContext.constEnd(); it != e; ++it) {
- types.insert(it.key(), 0);
+ types.push_back(it.key());
contexts.insert(item, it.key());
}
}
@@ -564,7 +550,7 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
e = item->QGraphicsItem::d_func()->gestureContext.constEnd(); it != e; ++it) {
if (!(it.value() & Qt::DontStartGestureOnChildren)) {
if (!types.contains(it.key())) {
- types.insert(it.key(), 0);
+ types.push_back(it.key());
contexts.insert(item, it.key());
}
}
@@ -712,7 +698,7 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
foreach(QGesture *g, gestures)
event.setAccepted(g, false);
- QApplication::sendEvent(receiver, &event);
+ QCoreApplication::sendEvent(receiver, &event);
bool eventAccepted = event.isAccepted();
const auto eventGestures = event.gestures();
for (QGesture *gesture : eventGestures) {
@@ -739,7 +725,7 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
qCDebug(lcGestureManager) << "QGestureManager::deliverEvents: sending to" << it.key()
<< "gestures:" << it.value();
QGestureEvent event(it.value());
- QApplication::sendEvent(it.key(), &event);
+ QCoreApplication::sendEvent(it.key(), &event);
bool eventAccepted = event.isAccepted();
const auto eventGestures = event.gestures();
for (QGesture *gesture : eventGestures) {
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index 53c4de49c6..3ce81a390b 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -1040,7 +1040,7 @@ void QLayout::update()
if (layout->d_func()->topLevel) {
Q_ASSERT(layout->parent()->isWidgetType());
QWidget *mw = static_cast<QWidget*>(layout->parent());
- QApplication::postEvent(mw, new QEvent(QEvent::LayoutRequest));
+ QCoreApplication::postEvent(mw, new QEvent(QEvent::LayoutRequest));
break;
}
layout = static_cast<QLayout*>(layout->parent());
@@ -1156,6 +1156,8 @@ QLayoutItem *QLayout::replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOpt
Q_D(QLayout);
if (!from || !to)
return 0;
+ if (from == to) // Do not return a QLayoutItem for \a from, since ownership still
+ return nullptr; // belongs to the layout (since nothing was changed)
int index = -1;
QLayoutItem *item = 0;
@@ -1364,7 +1366,7 @@ QRect QLayout::alignmentRect(const QRect &r) const
y += (r.height() - s.height()) / 2;
QWidget *parent = parentWidget();
- a = QStyle::visualAlignment(parent ? parent->layoutDirection() : QApplication::layoutDirection(), a);
+ a = QStyle::visualAlignment(parent ? parent->layoutDirection() : QGuiApplication::layoutDirection(), a);
if (a & Qt::AlignRight)
x += (r.width() - s.width());
else if (!(a & Qt::AlignLeft))
diff --git a/src/widgets/kernel/qlayout_p.h b/src/widgets/kernel/qlayout_p.h
index 8a1b12a6be..8e1d773355 100644
--- a/src/widgets/kernel/qlayout_p.h
+++ b/src/widgets/kernel/qlayout_p.h
@@ -80,7 +80,7 @@ public:
static QWidgetItem *createWidgetItem(const QLayout *layout, QWidget *widget);
static QSpacerItem *createSpacerItem(const QLayout *layout, int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum);
- virtual QLayoutItem* replaceAt(int index, QLayoutItem *newitem) { Q_UNUSED(index); Q_UNUSED(newitem); return 0; }
+ virtual QLayoutItem* replaceAt(int index, QLayoutItem *newitem) { Q_UNUSED(index); Q_UNUSED(newitem); return nullptr; }
static QWidgetItemFactoryMethod widgetItemFactoryMethod;
static QSpacerItemFactoryMethod spacerItemFactoryMethod;
diff --git a/src/widgets/kernel/qlayoutengine_p.h b/src/widgets/kernel/qlayoutengine_p.h
index 812fa7cf3b..948c2424e6 100644
--- a/src/widgets/kernel/qlayoutengine_p.h
+++ b/src/widgets/kernel/qlayoutengine_p.h
@@ -105,9 +105,9 @@ Q_WIDGETS_EXPORT QSize qSmartMinSize(const QWidgetItem *i);
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QWidget *w);
Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QSize &sizeHint,
const QSize &minSize, const QSize &maxSize,
- const QSizePolicy &sizePolicy, Qt::Alignment align = 0);
-Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QWidgetItem *i, Qt::Alignment align = 0);
-Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QWidget *w, Qt::Alignment align = 0);
+ const QSizePolicy &sizePolicy, Qt::Alignment align = nullptr);
+Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QWidgetItem *i, Qt::Alignment align = nullptr);
+Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QWidget *w, Qt::Alignment align = nullptr);
Q_WIDGETS_EXPORT int qSmartSpacing(const QLayout *layout, QStyle::PixelMetric pm);
diff --git a/src/widgets/kernel/qlayoutitem.cpp b/src/widgets/kernel/qlayoutitem.cpp
index 9e6d1c5eac..0aab0bb06d 100644
--- a/src/widgets/kernel/qlayoutitem.cpp
+++ b/src/widgets/kernel/qlayoutitem.cpp
@@ -502,6 +502,17 @@ void QWidgetItem::setGeometry(const QRect &rect)
else if (!(align & Qt::AlignTop))
y = y + (r.height() - s.height()) / 2;
+ // Make sure we don't move outside of the parent, e.g when styles demand
+ // surplus space that exceeds the available margins (f.ex macOS with QGroupBox)
+ if (x < 0) {
+ s.rwidth() += x;
+ x = 0;
+ }
+ if (y < 0) {
+ s.rheight() += y;
+ y = 0;
+ }
+
wid->setGeometry(x, y, s.width(), s.height());
}
diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp
index a88054a0d0..bc5ca21b97 100644
--- a/src/widgets/kernel/qopenglwidget.cpp
+++ b/src/widgets/kernel/qopenglwidget.cpp
@@ -1335,11 +1335,8 @@ int QOpenGLWidget::metric(QPaintDevice::PaintDeviceMetric metric) const
if (d->inBackingStorePaint)
return QWidget::metric(metric);
- QWidget *tlw = window();
- QWindow *window = tlw ? tlw->windowHandle() : 0;
- QScreen *screen = tlw && tlw->windowHandle() ? tlw->windowHandle()->screen() : 0;
- if (!screen && QGuiApplication::primaryScreen())
- screen = QGuiApplication::primaryScreen();
+ auto window = d->windowHandle(QWidgetPrivate::WindowHandleMode::TopLevel);
+ QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen();
const float dpmx = qt_defaultDpiX() * 100. / 2.54;
const float dpmy = qt_defaultDpiY() * 100. / 2.54;
@@ -1437,7 +1434,7 @@ bool QOpenGLWidget::event(QEvent *e)
Q_D(QOpenGLWidget);
switch (e->type()) {
case QEvent::WindowChangeInternal:
- if (qGuiApp->testAttribute(Qt::AA_ShareOpenGLContexts))
+ if (QCoreApplication::testAttribute(Qt::AA_ShareOpenGLContexts))
break;
if (d->initialized)
d->reset();
@@ -1450,7 +1447,7 @@ bool QOpenGLWidget::event(QEvent *e)
{
// Special case: did grabFramebuffer() for a hidden widget that then became visible.
// Recreate all resources since the context now needs to share with the TLW's.
- if (!qGuiApp->testAttribute(Qt::AA_ShareOpenGLContexts))
+ if (!QCoreApplication::testAttribute(Qt::AA_ShareOpenGLContexts))
d->reset();
}
if (!d->initialized && !size().isEmpty() && window()->windowHandle()) {
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index db06dce042..eec65c8625 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -96,8 +96,7 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
QWindow *qwindow = QGuiApplication::focusWindow();
if (qwindow && qwindow->isActive()) {
while (qwindow) {
- QWidgetWindow *widgetWindow = qobject_cast<QWidgetWindow *>(qwindow);
- if (widgetWindow) {
+ if (auto widgetWindow = qobject_cast<QWidgetWindow *>(qwindow)) {
active_window = widgetWindow->widget();
break;
}
@@ -110,27 +109,25 @@ bool qWidgetShortcutContextMatcher(QObject *object, Qt::ShortcutContext context)
return false;
#ifndef QT_NO_ACTION
- if (QAction *a = qobject_cast<QAction *>(object))
+ if (auto a = qobject_cast<QAction *>(object))
return correctActionContext(context, a, active_window);
#endif
#if QT_CONFIG(graphicsview)
- if (QGraphicsWidget *gw = qobject_cast<QGraphicsWidget *>(object))
+ if (auto gw = qobject_cast<QGraphicsWidget *>(object))
return correctGraphicsWidgetContext(context, gw, active_window);
#endif
- QWidget *w = qobject_cast<QWidget *>(object);
+ auto w = qobject_cast<QWidget *>(object);
if (!w) {
- QShortcut *s = qobject_cast<QShortcut *>(object);
- if (s)
+ if (auto s = qobject_cast<QShortcut *>(object))
w = s->parentWidget();
}
if (!w) {
- QWindow *qwindow = qobject_cast<QWindow *>(object);
+ auto qwindow = qobject_cast<QWindow *>(object);
while (qwindow) {
- QWidgetWindow *widget_window = qobject_cast<QWidgetWindow *>(qwindow);
- if (widget_window) {
+ if (auto widget_window = qobject_cast<QWidgetWindow *>(qwindow)) {
w = widget_window->widget();
break;
}
@@ -148,7 +145,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
{
bool visible = w->isVisible();
#if QT_CONFIG(menubar)
- if (QMenuBar *menuBar = qobject_cast<QMenuBar *>(w)) {
+ if (auto menuBar = qobject_cast<QMenuBar *>(w)) {
if (auto *pmb = menuBar->platformMenuBar()) {
if (menuBar->parentWidget()) {
visible = true;
@@ -166,7 +163,7 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
return false;
if (context == Qt::ApplicationShortcut)
- return QApplicationPrivate::tryModalHelper(w, 0); // true, unless w is shadowed by a modal dialog
+ return QApplicationPrivate::tryModalHelper(w, nullptr); // true, unless w is shadowed by a modal dialog
if (context == Qt::WidgetShortcut)
return w == QApplication::focusWidget();
@@ -181,9 +178,9 @@ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidge
// Below is Qt::WindowShortcut context
QWidget *tlw = w->window();
#if QT_CONFIG(graphicsview)
- if (QWExtra *topData = static_cast<QWidgetPrivate *>(QObjectPrivate::get(tlw))->extra) {
+ if (auto topData = static_cast<QWidgetPrivate *>(QObjectPrivate::get(tlw))->extra.get()) {
if (topData->proxyWidget) {
- bool res = correctGraphicsWidgetContext(context, (QGraphicsWidget *)topData->proxyWidget, active_window);
+ bool res = correctGraphicsWidgetContext(context, topData->proxyWidget, active_window);
return res;
}
}
@@ -233,7 +230,7 @@ static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsW
{
bool visible = w->isVisible();
#if defined(Q_OS_DARWIN) && QT_CONFIG(menubar)
- if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
+ if (!QCoreApplication::testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
visible = true;
#endif
@@ -244,9 +241,9 @@ static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsW
// Applicationwide shortcuts are always reachable unless their owner
// is shadowed by modality. In QGV there's no modality concept, but we
// must still check if all views are shadowed.
- QList<QGraphicsView *> views = w->scene()->views();
- for (int i = 0; i < views.size(); ++i) {
- if (QApplicationPrivate::tryModalHelper(views.at(i), 0))
+ const auto &views = w->scene()->views();
+ for (auto view : views) {
+ if (QApplicationPrivate::tryModalHelper(view, nullptr))
return true;
}
return false;
@@ -258,7 +255,7 @@ static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsW
if (context == Qt::WidgetWithChildrenShortcut) {
const QGraphicsItem *ti = w->scene()->focusItem();
if (ti && ti->isWidget()) {
- const QGraphicsWidget *tw = static_cast<const QGraphicsWidget *>(ti);
+ const auto *tw = static_cast<const QGraphicsWidget *>(ti);
while (tw && tw != w && (tw->windowType() == Qt::Widget || tw->windowType() == Qt::Popup))
tw = tw->parentWidget();
return tw == w;
@@ -269,10 +266,9 @@ static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsW
// Below is Qt::WindowShortcut context
// Find the active view (if any).
- QList<QGraphicsView *> views = w->scene()->views();
- QGraphicsView *activeView = 0;
- for (int i = 0; i < views.size(); ++i) {
- QGraphicsView *view = views.at(i);
+ const auto &views = w->scene()->views();
+ QGraphicsView *activeView = nullptr;
+ for (auto view : views) {
if (view->window() == active_window) {
activeView = view;
break;
@@ -291,15 +287,14 @@ static bool correctGraphicsWidgetContext(Qt::ShortcutContext context, QGraphicsW
#ifndef QT_NO_ACTION
static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidget *active_window)
{
- const QList<QWidget *> &widgets = static_cast<QActionPrivate *>(QObjectPrivate::get(a))->widgets;
+ const QWidgetList &widgets = static_cast<QActionPrivate *>(QObjectPrivate::get(a))->widgets;
#if defined(DEBUG_QSHORTCUTMAP)
if (widgets.isEmpty())
qDebug() << a << "not connected to any widgets; won't trigger";
#endif
- for (int i = 0; i < widgets.size(); ++i) {
- QWidget *w = widgets.at(i);
+ for (auto w : widgets) {
#if QT_CONFIG(menu)
- if (QMenu *menu = qobject_cast<QMenu *>(w)) {
+ if (auto menu = qobject_cast<QMenu *>(w)) {
#ifdef Q_OS_DARWIN
// On Mac, menu item shortcuts are processed before reaching any window.
// That means that if a menu action shortcut has not been already processed
@@ -325,14 +320,13 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge
}
#if QT_CONFIG(graphicsview)
- const QList<QGraphicsWidget *> &graphicsWidgets = static_cast<QActionPrivate *>(QObjectPrivate::get(a))->graphicsWidgets;
+ const auto &graphicsWidgets = static_cast<QActionPrivate *>(QObjectPrivate::get(a))->graphicsWidgets;
#if defined(DEBUG_QSHORTCUTMAP)
if (graphicsWidgets.isEmpty())
qDebug() << a << "not connected to any widgets; won't trigger";
#endif
- for (int i = 0; i < graphicsWidgets.size(); ++i) {
- QGraphicsWidget *w = graphicsWidgets.at(i);
- if (correctGraphicsWidgetContext(context, w, active_window))
+ for (auto graphicsWidget : graphicsWidgets) {
+ if (correctGraphicsWidgetContext(context, graphicsWidget, active_window))
return true;
}
#endif
@@ -433,12 +427,12 @@ class QShortcutPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QShortcut)
public:
- QShortcutPrivate() : sc_context(Qt::WindowShortcut), sc_enabled(true), sc_autorepeat(true), sc_id(0) {}
+ QShortcutPrivate() = default;
QKeySequence sc_sequence;
- Qt::ShortcutContext sc_context;
- bool sc_enabled;
- bool sc_autorepeat;
- int sc_id;
+ Qt::ShortcutContext sc_context = Qt::WindowShortcut;
+ bool sc_enabled = true;
+ bool sc_autorepeat = true;
+ int sc_id = 0;
QString sc_whatsthis;
void redoGrab(QShortcutMap &map);
};
@@ -472,7 +466,7 @@ void QShortcutPrivate::redoGrab(QShortcutMap &map)
QShortcut::QShortcut(QWidget *parent)
: QObject(*new QShortcutPrivate, parent)
{
- Q_ASSERT(parent != 0);
+ Q_ASSERT(parent != nullptr);
}
/*!
@@ -493,7 +487,7 @@ QShortcut::QShortcut(const QKeySequence &key, QWidget *parent,
Q_D(QShortcut);
d->sc_context = context;
d->sc_sequence = key;
- d->redoGrab(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
if (member)
connect(this, SIGNAL(activated()), parent, member);
if (ambiguousMember)
@@ -507,7 +501,7 @@ QShortcut::~QShortcut()
{
Q_D(QShortcut);
if (qApp)
- qApp->d_func()->shortcutMap.removeShortcut(d->sc_id, this);
+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(d->sc_id, this);
}
/*!
@@ -528,7 +522,7 @@ void QShortcut::setKey(const QKeySequence &key)
return;
QAPP_CHECK("setKey");
d->sc_sequence = key;
- d->redoGrab(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
}
QKeySequence QShortcut::key() const
@@ -559,7 +553,7 @@ void QShortcut::setEnabled(bool enable)
return;
QAPP_CHECK("setEnabled");
d->sc_enabled = enable;
- qApp->d_func()->shortcutMap.setShortcutEnabled(enable, d->sc_id, this);
+ QGuiApplicationPrivate::instance()->shortcutMap.setShortcutEnabled(enable, d->sc_id, this);
}
bool QShortcut::isEnabled() const
@@ -587,7 +581,7 @@ void QShortcut::setContext(Qt::ShortcutContext context)
return;
QAPP_CHECK("setContext");
d->sc_context = context;
- d->redoGrab(qApp->d_func()->shortcutMap);
+ d->redoGrab(QGuiApplicationPrivate::instance()->shortcutMap);
}
Qt::ShortcutContext QShortcut::context() const
@@ -639,7 +633,7 @@ void QShortcut::setAutoRepeat(bool on)
return;
QAPP_CHECK("setAutoRepeat");
d->sc_autorepeat = on;
- qApp->d_func()->shortcutMap.setShortcutAutoRepeat(on, d->sc_id, this);
+ QGuiApplicationPrivate::instance()->shortcutMap.setShortcutAutoRepeat(on, d->sc_id, this);
}
bool QShortcut::autoRepeat() const
@@ -666,7 +660,7 @@ bool QShortcut::event(QEvent *e)
{
Q_D(QShortcut);
if (d->sc_enabled && e->type() == QEvent::Shortcut) {
- QShortcutEvent *se = static_cast<QShortcutEvent *>(e);
+ auto se = static_cast<QShortcutEvent *>(e);
if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){
#if QT_CONFIG(whatsthis)
if (QWhatsThis::inWhatsThisMode()) {
diff --git a/src/widgets/kernel/qsizepolicy.cpp b/src/widgets/kernel/qsizepolicy.cpp
index b5a0cd3940..54bf8fe0dc 100644
--- a/src/widgets/kernel/qsizepolicy.cpp
+++ b/src/widgets/kernel/qsizepolicy.cpp
@@ -232,7 +232,7 @@ QT_BEGIN_NAMESPACE
Returns the control type associated with the widget for which
this size policy applies.
*/
-QSizePolicy::ControlType QSizePolicy::controlType() const Q_DECL_NOTHROW
+QSizePolicy::ControlType QSizePolicy::controlType() const noexcept
{
return QSizePolicy::ControlType(1 << bits.ctype);
}
@@ -253,7 +253,7 @@ QSizePolicy::ControlType QSizePolicy::controlType() const Q_DECL_NOTHROW
\sa QStyle::layoutSpacing()
*/
-void QSizePolicy::setControlType(ControlType type) Q_DECL_NOTHROW
+void QSizePolicy::setControlType(ControlType type) noexcept
{
bits.ctype = toControlTypeFieldValue(type);
}
diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h
index dba742dec5..f26923eeb0 100644
--- a/src/widgets/kernel/qsizepolicy.h
+++ b/src/widgets/kernel/qsizepolicy.h
@@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE
class QVariant;
class QSizePolicy;
-Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) Q_DECL_NOTHROW;
+Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) noexcept;
class Q_WIDGETS_EXPORT QSizePolicy
{
@@ -110,60 +110,60 @@ public:
Q_DECLARE_FLAGS(ControlTypes, ControlType)
Q_FLAG(ControlTypes)
- QT_SIZEPOLICY_CONSTEXPR QSizePolicy() Q_DECL_NOTHROW : data(0) { }
+ QT_SIZEPOLICY_CONSTEXPR QSizePolicy() noexcept : data(0) { }
#if defined(Q_COMPILER_UNIFORM_INIT) && !defined(Q_QDOC)
- QT_SIZEPOLICY_CONSTEXPR QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) Q_DECL_NOTHROW
+ QT_SIZEPOLICY_CONSTEXPR QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) noexcept
: bits{0, 0, quint32(horizontal), quint32(vertical),
type == DefaultType ? 0 : toControlTypeFieldValue(type), 0, 0, 0}
{}
#else
- QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) Q_DECL_NOTHROW
+ QSizePolicy(Policy horizontal, Policy vertical, ControlType type = DefaultType) noexcept
: data(0) {
bits.horPolicy = horizontal;
bits.verPolicy = vertical;
setControlType(type);
}
#endif // uniform-init
- QT_SIZEPOLICY_CONSTEXPR Policy horizontalPolicy() const Q_DECL_NOTHROW { return static_cast<Policy>(bits.horPolicy); }
- QT_SIZEPOLICY_CONSTEXPR Policy verticalPolicy() const Q_DECL_NOTHROW { return static_cast<Policy>(bits.verPolicy); }
- ControlType controlType() const Q_DECL_NOTHROW;
+ QT_SIZEPOLICY_CONSTEXPR Policy horizontalPolicy() const noexcept { return static_cast<Policy>(bits.horPolicy); }
+ QT_SIZEPOLICY_CONSTEXPR Policy verticalPolicy() const noexcept { return static_cast<Policy>(bits.verPolicy); }
+ ControlType controlType() const noexcept;
- Q_DECL_RELAXED_CONSTEXPR void setHorizontalPolicy(Policy d) Q_DECL_NOTHROW { bits.horPolicy = d; }
- Q_DECL_RELAXED_CONSTEXPR void setVerticalPolicy(Policy d) Q_DECL_NOTHROW { bits.verPolicy = d; }
- void setControlType(ControlType type) Q_DECL_NOTHROW;
+ Q_DECL_RELAXED_CONSTEXPR void setHorizontalPolicy(Policy d) noexcept { bits.horPolicy = d; }
+ Q_DECL_RELAXED_CONSTEXPR void setVerticalPolicy(Policy d) noexcept { bits.verPolicy = d; }
+ void setControlType(ControlType type) noexcept;
- QT_SIZEPOLICY_CONSTEXPR Qt::Orientations expandingDirections() const Q_DECL_NOTHROW {
+ QT_SIZEPOLICY_CONSTEXPR Qt::Orientations expandingDirections() const noexcept {
return ( (verticalPolicy() & ExpandFlag) ? Qt::Vertical : Qt::Orientations() )
| ( (horizontalPolicy() & ExpandFlag) ? Qt::Horizontal : Qt::Orientations() ) ;
}
- Q_DECL_RELAXED_CONSTEXPR void setHeightForWidth(bool b) Q_DECL_NOTHROW { bits.hfw = b; }
- QT_SIZEPOLICY_CONSTEXPR bool hasHeightForWidth() const Q_DECL_NOTHROW { return bits.hfw; }
- Q_DECL_RELAXED_CONSTEXPR void setWidthForHeight(bool b) Q_DECL_NOTHROW { bits.wfh = b; }
- QT_SIZEPOLICY_CONSTEXPR bool hasWidthForHeight() const Q_DECL_NOTHROW { return bits.wfh; }
+ Q_DECL_RELAXED_CONSTEXPR void setHeightForWidth(bool b) noexcept { bits.hfw = b; }
+ QT_SIZEPOLICY_CONSTEXPR bool hasHeightForWidth() const noexcept { return bits.hfw; }
+ Q_DECL_RELAXED_CONSTEXPR void setWidthForHeight(bool b) noexcept { bits.wfh = b; }
+ QT_SIZEPOLICY_CONSTEXPR bool hasWidthForHeight() const noexcept { return bits.wfh; }
- QT_SIZEPOLICY_CONSTEXPR bool operator==(const QSizePolicy& s) const Q_DECL_NOTHROW { return data == s.data; }
- QT_SIZEPOLICY_CONSTEXPR bool operator!=(const QSizePolicy& s) const Q_DECL_NOTHROW { return data != s.data; }
+ QT_SIZEPOLICY_CONSTEXPR bool operator==(const QSizePolicy& s) const noexcept { return data == s.data; }
+ QT_SIZEPOLICY_CONSTEXPR bool operator!=(const QSizePolicy& s) const noexcept { return data != s.data; }
- friend Q_DECL_CONST_FUNCTION uint qHash(QSizePolicy key, uint seed) Q_DECL_NOTHROW { return qHash(key.data, seed); }
+ friend Q_DECL_CONST_FUNCTION uint qHash(QSizePolicy key, uint seed) noexcept { return qHash(key.data, seed); }
operator QVariant() const;
- QT_SIZEPOLICY_CONSTEXPR int horizontalStretch() const Q_DECL_NOTHROW { return static_cast<int>(bits.horStretch); }
- QT_SIZEPOLICY_CONSTEXPR int verticalStretch() const Q_DECL_NOTHROW { return static_cast<int>(bits.verStretch); }
+ QT_SIZEPOLICY_CONSTEXPR int horizontalStretch() const noexcept { return static_cast<int>(bits.horStretch); }
+ QT_SIZEPOLICY_CONSTEXPR int verticalStretch() const noexcept { return static_cast<int>(bits.verStretch); }
Q_DECL_RELAXED_CONSTEXPR void setHorizontalStretch(int stretchFactor) { bits.horStretch = static_cast<quint32>(qBound(0, stretchFactor, 255)); }
Q_DECL_RELAXED_CONSTEXPR void setVerticalStretch(int stretchFactor) { bits.verStretch = static_cast<quint32>(qBound(0, stretchFactor, 255)); }
- QT_SIZEPOLICY_CONSTEXPR bool retainSizeWhenHidden() const Q_DECL_NOTHROW { return bits.retainSizeWhenHidden; }
- Q_DECL_RELAXED_CONSTEXPR void setRetainSizeWhenHidden(bool retainSize) Q_DECL_NOTHROW { bits.retainSizeWhenHidden = retainSize; }
+ QT_SIZEPOLICY_CONSTEXPR bool retainSizeWhenHidden() const noexcept { return bits.retainSizeWhenHidden; }
+ Q_DECL_RELAXED_CONSTEXPR void setRetainSizeWhenHidden(bool retainSize) noexcept { bits.retainSizeWhenHidden = retainSize; }
- Q_DECL_RELAXED_CONSTEXPR void transpose() Q_DECL_NOTHROW { *this = transposed(); }
+ Q_DECL_RELAXED_CONSTEXPR void transpose() noexcept { *this = transposed(); }
Q_REQUIRED_RESULT
#ifndef Q_QDOC
QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT
#endif
- QSizePolicy transposed() const Q_DECL_NOTHROW
+ QSizePolicy transposed() const noexcept
{
return QSizePolicy(bits.transposed());
}
@@ -173,11 +173,11 @@ private:
friend Q_WIDGETS_EXPORT QDataStream &operator<<(QDataStream &, const QSizePolicy &);
friend Q_WIDGETS_EXPORT QDataStream &operator>>(QDataStream &, QSizePolicy &);
#endif
- QT_SIZEPOLICY_CONSTEXPR QSizePolicy(int i) Q_DECL_NOTHROW : data(i) { }
+ QT_SIZEPOLICY_CONSTEXPR QSizePolicy(int i) noexcept : data(i) { }
struct Bits;
- QT_SIZEPOLICY_CONSTEXPR explicit QSizePolicy(Bits b) Q_DECL_NOTHROW : bits(b) { }
+ QT_SIZEPOLICY_CONSTEXPR explicit QSizePolicy(Bits b) noexcept : bits(b) { }
- static Q_DECL_RELAXED_CONSTEXPR quint32 toControlTypeFieldValue(ControlType type) Q_DECL_NOTHROW
+ static Q_DECL_RELAXED_CONSTEXPR quint32 toControlTypeFieldValue(ControlType type) noexcept
{
/*
The control type is a flag type, with values 0x1, 0x2, 0x4, 0x8, 0x10,
@@ -207,7 +207,7 @@ private:
quint32 retainSizeWhenHidden : 1;
QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT
- Bits transposed() const Q_DECL_NOTHROW
+ Bits transposed() const noexcept
{
return {verStretch, // \ swap
horStretch, // /
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index f81cb471fa..97a279d65d 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -36,12 +36,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-# include <private/qcore_mac_p.h>
-#endif
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <QtWidgets/private/qlabel_p.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
@@ -61,13 +57,9 @@
#ifndef QT_NO_TOOLTIP
#include <qlabel.h>
+#include <QtWidgets/private/qlabel_p.h>
#include <qtooltip.h>
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-# include <private/qcore_mac_p.h>
-#include <private/qt_cocoa_helpers_mac_p.h>
-#endif
-
QT_BEGIN_NAMESPACE
/*!
@@ -317,20 +309,7 @@ void QTipLabel::timerEvent(QTimerEvent *e)
|| e->timerId() == expireTimer.timerId()){
hideTimer.stop();
expireTimer.stop();
-#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effects)
- if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){
- // Fade out tip on mac (makes it invisible).
- // The tip will not be deleted until a new tip is shown.
-
- // DRSWAT - Cocoa
- macWindowFade(qt_mac_window_for(this));
- QTipLabel::instance->fadingOut = true; // will never be false again.
- }
- else
- hideTipImmediately();
-#else
hideTipImmediately();
-#endif
}
}
@@ -420,29 +399,11 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
#endif //QT_NO_STYLE_STYLESHEET
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // When in full screen mode, there is no Dock nor Menu so we can use
- // the whole screen for displaying the tooltip. However when not in
- // full screen mode we need to save space for the dock, so we use
- // availableGeometry instead.
- extern bool qt_mac_app_fullscreen; //qapplication_mac.mm
- QRect screen;
- if(qt_mac_app_fullscreen)
- screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w));
- else
- screen = QDesktopWidgetPrivate::availableGeometry(getTipScreen(pos, w));
-#else
QRect screen = QDesktopWidgetPrivate::screenGeometry(getTipScreen(pos, w));
-#endif
QPoint p = pos;
- p += QPoint(2,
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- 21
-#else
- 16
-#endif
- );
+ p += QPoint(2, 16);
+
if (p.x() + this->width() > screen.x() + screen.width())
p.rx() -= 4 + this->width();
if (p.y() + this->height() > screen.y() + screen.height())
@@ -541,7 +502,7 @@ QT_WARNING_POP
QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label"));
-#if QT_CONFIG(effects) && !0 /* Used to be included in Qt4 for Q_WS_MAC */
+#if QT_CONFIG(effects)
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))
qFadeEffect(QTipLabel::instance);
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h
index edf1de0c1d..1b263a6629 100644
--- a/src/widgets/kernel/qtooltip.h
+++ b/src/widgets/kernel/qtooltip.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
class Q_WIDGETS_EXPORT QToolTip
{
- QToolTip() Q_DECL_EQ_DELETE;
+ QToolTip() = delete;
public:
// ### Qt 6 - merge the three showText functions below
static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr);
diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp
index 4a798a7490..228ca4d38a 100644
--- a/src/widgets/kernel/qwhatsthis.cpp
+++ b/src/widgets/kernel/qwhatsthis.cpp
@@ -263,7 +263,7 @@ void QWhatsThat::mouseReleaseEvent(QMouseEvent* e)
anchor.clear();
if (!href.isEmpty()) {
QWhatsThisClickedEvent e(href);
- if (QApplication::sendEvent(widget, &e))
+ if (QCoreApplication::sendEvent(widget, &e))
return;
}
}
@@ -380,7 +380,7 @@ void QWhatsThisPrivate::notifyToplevels(QEvent *e)
{
const QWidgetList toplevels = QApplication::topLevelWidgets();
for (auto *w : toplevels)
- QApplication::sendEvent(w, e);
+ QCoreApplication::sendEvent(w, e);
}
QWhatsThisPrivate *QWhatsThisPrivate::instance = 0;
@@ -394,7 +394,7 @@ QWhatsThisPrivate::QWhatsThisPrivate()
QPoint pos = QCursor::pos();
if (QWidget *w = QApplication::widgetAt(pos)) {
QHelpEvent e(QEvent::QueryWhatsThis, w->mapFromGlobal(pos), pos);
- bool sentEvent = QApplication::sendEvent(w, &e);
+ const bool sentEvent = QCoreApplication::sendEvent(w, &e);
#ifdef QT_NO_CURSOR
Q_UNUSED(sentEvent);
#else
@@ -439,7 +439,7 @@ bool QWhatsThisPrivate::eventFilter(QObject *o, QEvent *e)
if (me->button() == Qt::RightButton || customWhatsThis)
return false;
QHelpEvent e(QEvent::WhatsThis, me->pos(), me->globalPos());
- if (!QApplication::sendEvent(w, &e) || !e.isAccepted())
+ if (!QCoreApplication::sendEvent(w, &e) || !e.isAccepted())
leaveOnMouseRelease = true;
} break;
@@ -448,12 +448,12 @@ bool QWhatsThisPrivate::eventFilter(QObject *o, QEvent *e)
{
QMouseEvent *me = static_cast<QMouseEvent*>(e);
QHelpEvent e(QEvent::QueryWhatsThis, me->pos(), me->globalPos());
- bool sentEvent = QApplication::sendEvent(w, &e);
+ const bool sentEvent = QCoreApplication::sendEvent(w, &e);
#ifdef QT_NO_CURSOR
Q_UNUSED(sentEvent);
#else
- QApplication::changeOverrideCursor((!sentEvent || !e.isAccepted())?
- Qt::ForbiddenCursor:Qt::WhatsThisCursor);
+ QGuiApplication::changeOverrideCursor((!sentEvent || !e.isAccepted())?
+ Qt::ForbiddenCursor:Qt::WhatsThisCursor);
#endif
Q_FALLTHROUGH();
}
@@ -577,26 +577,12 @@ void QWhatsThisPrivate::say(QWidget * widget, const QString &text, int x, int y)
if (text.size() == 0)
return;
// make a fresh widget, and set it up
- QWhatsThat *whatsThat = new QWhatsThat(
- text,
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR)
- QApplication::desktop()->screen(widget ? widget->x11Info().screen() : QCursor::x11Screen()),
-#else
- 0,
-#endif
- widget
- );
-
+ QWhatsThat *whatsThat = new QWhatsThat(text, 0, widget);
// okay, now to find a suitable location
-
int scr = (widget ?
QDesktopWidgetPrivate::screenNumber(widget) :
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && !defined(QT_NO_CURSOR)
- QCursor::x11Screen()
-#else
QDesktopWidgetPrivate::screenNumber(QPoint(x,y))
-#endif
);
QRect screen = QDesktopWidgetPrivate::screenGeometry(scr);
diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h
index 59c0b01c9b..fa5b97d98a 100644
--- a/src/widgets/kernel/qwhatsthis.h
+++ b/src/widgets/kernel/qwhatsthis.h
@@ -54,7 +54,7 @@ class QAction;
class Q_WIDGETS_EXPORT QWhatsThis
{
- QWhatsThis() Q_DECL_EQ_DELETE;
+ QWhatsThis() = delete;
public:
static void enterWhatsThisMode();
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 048a17364b..e9968e41b4 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -61,13 +61,6 @@
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-# include "qt_mac_p.h"
-# include "qt_cocoa_helpers_mac_p.h"
-# include "qmainwindow.h"
-# include "qtoolbar.h"
-# include <private/qmainwindowlayout_p.h>
-#endif
#include <qpa/qplatformwindow.h>
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
@@ -79,6 +72,7 @@
#include "private/qstylesheetstyle_p.h"
#include "private/qstyle_p.h"
#include "qfileinfo.h"
+#include "qscopeguard.h"
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/qopenglcontext.h>
@@ -89,10 +83,7 @@
#include <private/qgraphicseffect_p.h>
#endif
#include <qbackingstore.h>
-#include <private/qwidgetbackingstore_p.h>
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-# include <private/qpaintengine_mac_p.h>
-#endif
+#include <private/qwidgetrepaintmanager_p.h>
#include <private/qpaintengine_raster_p.h>
#include "qwidget_p.h"
@@ -120,15 +111,15 @@
#include <QtPlatformHeaders/qxcbwindowfunctions.h>
+#include <private/qmemory_p.h>
+
// widget/widget data creation count
//#define QWIDGET_EXTRA_DEBUG
//#define ALIEN_DEBUG
QT_BEGIN_NAMESPACE
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-bool qt_mac_clearDirtyOnWidgetInsideDrawWidget = false;
-#endif
+Q_LOGGING_CATEGORY(lcWidgetPainting, "qt.widgets.painting", QtWarningMsg);
static inline bool qRectIntersects(const QRect &r1, const QRect &r2)
{
@@ -136,101 +127,11 @@ static inline bool qRectIntersects(const QRect &r1, const QRect &r2)
qMax(r1.top(), r2.top()) <= qMin(r1.bottom(), r2.bottom()));
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-# define QT_NO_PAINT_DEBUG
-#endif
-
extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp
extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp
-/*!
- \internal
- \class QWidgetBackingStoreTracker
- \brief Class which allows tracking of which widgets are using a given backing store
-
- QWidgetBackingStoreTracker is a thin wrapper around a QWidgetBackingStore pointer,
- which maintains a list of the QWidgets which are currently using the backing
- store. This list is modified via the registerWidget and unregisterWidget functions.
- */
-
-QWidgetBackingStoreTracker::QWidgetBackingStoreTracker()
- : m_ptr(0)
-{
-
-}
-
-QWidgetBackingStoreTracker::~QWidgetBackingStoreTracker()
-{
- delete m_ptr;
-}
-
-/*!
- \internal
- Destroy the contained QWidgetBackingStore, if not null, and clear the list of
- widgets using the backing store, then create a new QWidgetBackingStore, providing
- the QWidget.
- */
-void QWidgetBackingStoreTracker::create(QWidget *widget)
-{
- destroy();
- m_ptr = new QWidgetBackingStore(widget);
-}
-
-/*!
- \internal
- Destroy the contained QWidgetBackingStore, if not null, and clear the list of
- widgets using the backing store.
- */
-void QWidgetBackingStoreTracker::destroy()
-{
- delete m_ptr;
- m_ptr = 0;
- m_widgets.clear();
-}
-
-/*!
- \internal
- Add the widget to the list of widgets currently using the backing store.
- If the widget was already in the list, this function is a no-op.
- */
-void QWidgetBackingStoreTracker::registerWidget(QWidget *w)
-{
- Q_ASSERT(m_ptr);
- Q_ASSERT(w->internalWinId());
- Q_ASSERT(qt_widget_private(w)->maybeBackingStore() == m_ptr);
- m_widgets.insert(w);
-}
-
-/*!
- \internal
- Remove the widget from the list of widgets currently using the backing store.
- If the widget was in the list, and removing it causes the list to be empty,
- the backing store is deleted.
- If the widget was not in the list, this function is a no-op.
- */
-void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w)
-{
- if (m_widgets.remove(w) && m_widgets.isEmpty()) {
- delete m_ptr;
- m_ptr = 0;
- }
-}
-
-/*!
- \internal
- Recursively remove widget and all of its descendents.
- */
-void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget)
-{
- unregisterWidget(widget);
- foreach (QObject *child, widget->children())
- if (QWidget *childWidget = qobject_cast<QWidget *>(child))
- unregisterWidgetSubtree(childWidget);
-}
-
QWidgetPrivate::QWidgetPrivate(int version)
: QObjectPrivate(version)
- , extra(0)
, focus_next(0)
, focus_prev(0)
, focus_child(0)
@@ -284,17 +185,6 @@ QWidgetPrivate::QWidgetPrivate(int version)
#if defined(Q_OS_WIN)
, noPaintOnScreen(0)
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- , picture(0)
-#elif 0 // Used to be included in Qt4 for Q_WS_WIN
- #ifndef QT_NO_GESTURES
- , nativeGesturePanEnabled(0)
- #endif
-#elif 0 // Used to be included in Qt4 for Q_WS_MAC
- , needWindowChange(0)
- , window_event(0)
- , qd_hd(0)
-#endif
{
if (Q_UNLIKELY(!qApp)) {
qFatal("QWidget: Must construct a QApplication before a QWidget");
@@ -313,16 +203,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
isWidget = true;
memset(high_attributes, 0, sizeof(high_attributes));
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- drawRectOriginalAdded = false;
- originalDrawMethod = true;
- changeMethods = false;
- isInUnifiedToolbar = false;
- unifiedSurface = 0;
- toolbar_ancestor = 0;
- flushRequested = false;
- touchEventsEnabled = false;
-#endif
+
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
qDebug() << "widgets" << ++count;
@@ -358,7 +239,7 @@ void QWidgetPrivate::scrollChildren(int dx, int dy)
w->d_func()->setWSGeometry();
w->d_func()->setDirtyOpaqueRegion();
QMoveEvent e(r.topLeft(), oldp);
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
}
}
}
@@ -392,7 +273,7 @@ QPointer<QWidget> QWidgetPrivate::editingWidget;
This feature is only available in Qt for Embedded Linux.
- \sa setEditFocus(), QApplication::keypadNavigationEnabled()
+ \sa setEditFocus(), QApplication::navigationMode()
*/
bool QWidget::hasEditFocus() const
{
@@ -412,7 +293,7 @@ bool QWidget::hasEditFocus() const
This feature is only available in Qt for Embedded Linux.
- \sa hasEditFocus(), QApplication::keypadNavigationEnabled()
+ \sa hasEditFocus(), QApplication::navigationMode()
*/
void QWidget::setEditFocus(bool on)
{
@@ -434,13 +315,13 @@ void QWidget::setEditFocus(bool on)
if (!on && QWidgetPrivate::editingWidget == f) {
QWidgetPrivate::editingWidget = 0;
QEvent event(QEvent::LeaveEditFocus);
- QApplication::sendEvent(f, &event);
- QApplication::sendEvent(f->style(), &event);
+ QCoreApplication::sendEvent(f, &event);
+ QCoreApplication::sendEvent(f->style(), &event);
} else if (on) {
QWidgetPrivate::editingWidget = f;
QEvent event(QEvent::EnterEditFocus);
- QApplication::sendEvent(f, &event);
- QApplication::sendEvent(f->style(), &event);
+ QCoreApplication::sendEvent(f, &event);
+ QCoreApplication::sendEvent(f->style(), &event);
}
}
#endif
@@ -943,22 +824,6 @@ QWidgetSet *QWidgetPrivate::allWidgets = 0; // widgets with no wid
/*****************************************************************************
- QWidget utility functions
- *****************************************************************************/
-
-QRegion qt_dirtyRegion(QWidget *widget)
-{
- if (!widget)
- return QRegion();
-
- QWidgetBackingStore *bs = qt_widget_private(widget)->maybeBackingStore();
- if (!bs)
- return QRegion();
-
- return bs->dirtyRegion(widget);
-}
-
-/*****************************************************************************
QWidget member functions
*****************************************************************************/
@@ -1083,17 +948,12 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
// Only enable this on non-Mac platforms. Since the old way of doing this would
// interpret WindowSystemMenuHint as a close button and we can't change that behavior
// we can't just add this in.
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
if ((flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint))
# ifdef Q_OS_WIN
&& type != Qt::Dialog // QTBUG-2027, allow for menu-less dialogs.
# endif
) {
flags |= Qt::WindowSystemMenuHint;
-#else
- if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint
- | Qt::WindowSystemMenuHint)) {
-#endif
flags |= Qt::WindowTitleHint;
flags &= ~Qt::FramelessWindowHint;
}
@@ -1123,6 +983,8 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w)
void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
{
Q_Q(QWidget);
+ Q_ASSERT_X(q != parentWidget, Q_FUNC_INFO, "Cannot parent a QWidget to itself");
+
if (Q_UNLIKELY(!qobject_cast<QApplication *>(QCoreApplication::instance())))
qFatal("QWidget: Cannot create a QWidget without QApplication");
@@ -1146,13 +1008,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
}
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (desktopWidget) {
- // make sure the widget is created on the same screen as the
- // programmer specified desktop widget
- xinfo = desktopWidget->d_func()->xinfo;
- }
-#endif
if (targetScreen >= 0) {
topData()->initialScreenIndex = targetScreen;
if (QWindow *window = q->windowHandle())
@@ -1180,9 +1035,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
mustHaveWindowHandle = 1;
q->setAttribute(Qt::WA_NativeWindow);
}
-//#if 0 // Used to be included in Qt4 for Q_WS_MAC
-// q->setAttribute(Qt::WA_NativeWindow);
-//#endif
q->setAttribute(Qt::WA_QuitOnClose); // might be cleared in adjustQuitOnCloseAttribute()
adjustQuitOnCloseAttribute();
@@ -1206,9 +1058,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
setOpaque(q->isWindow() && background.style() != Qt::NoBrush && background.isOpaque());
}
data.fnt = QFont(data.fnt, q);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- data.fnt.x11SetScreen(xinfo.screen());
-#endif
q->setAttribute(Qt::WA_PendingMoveEvent);
q->setAttribute(Qt::WA_PendingResizeEvent);
@@ -1220,24 +1069,12 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f)
q->create();
QEvent e(QEvent::Create);
- QApplication::sendEvent(q, &e);
- QApplication::postEvent(q, new QEvent(QEvent::PolishRequest));
+ QCoreApplication::sendEvent(q, &e);
+ QCoreApplication::postEvent(q, new QEvent(QEvent::PolishRequest));
extraPaintEngine = 0;
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // If we add a child to the unified toolbar, we have to redirect the painting.
- if (parentWidget && parentWidget->d_func() && parentWidget->d_func()->isInUnifiedToolbar) {
- if (parentWidget->d_func()->unifiedSurface) {
- QWidget *toolbar = parentWidget->d_func()->toolbar_ancestor;
- parentWidget->d_func()->unifiedSurface->recursiveRedirect(toolbar, toolbar, toolbar->d_func()->toolbar_offset);
- }
- }
-#endif
}
-
-
void QWidgetPrivate::createRecursively()
{
Q_Q(QWidget);
@@ -1249,6 +1086,35 @@ void QWidgetPrivate::createRecursively()
}
}
+QWindow *QWidgetPrivate::windowHandle(WindowHandleMode mode) const
+{
+ if (mode == WindowHandleMode::Direct || mode == WindowHandleMode::Closest) {
+ if (QTLWExtra *x = maybeTopData()) {
+ if (x->window != nullptr || mode == WindowHandleMode::Direct)
+ return x->window;
+ }
+ }
+ if (mode == WindowHandleMode::Closest) {
+ if (auto nativeParent = q_func()->nativeParentWidget()) {
+ if (auto window = nativeParent->windowHandle())
+ return window;
+ }
+ }
+ if (mode == WindowHandleMode::TopLevel || mode == WindowHandleMode::Closest) {
+ if (auto topLevel = q_func()->topLevelWidget()) {
+ if (auto window = topLevel ->windowHandle())
+ return window;
+ }
+ }
+ return nullptr;
+}
+
+QScreen *QWidgetPrivate::associatedScreen() const
+{
+ if (auto window = windowHandle(WindowHandleMode::Closest))
+ return window->screen();
+ return nullptr;
+}
// ### fixme: Qt 6: Remove parameter window from QWidget::create()
@@ -1315,36 +1181,20 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
<< "Alien?" << !testAttribute(Qt::WA_NativeWindow);
#endif
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ && QT_CONFIG(draganddrop)
- // Unregister the dropsite (if already registered) before we
- // re-create the widget with a native window.
- if (testAttribute(Qt::WA_WState_Created) && !internalWinId() && testAttribute(Qt::WA_NativeWindow)
- && d->extra && d->extra->dropTarget) {
- d->registerDropSite(false);
- }
-#endif
-
d->updateIsOpaque();
setAttribute(Qt::WA_WState_Created); // set created flag
d->create();
- // a real toplevel window needs a backing store
- if (isWindow() && windowType() != Qt::Desktop) {
- d->topData()->backingStoreTracker.destroy();
- d->topData()->backingStoreTracker.create(this);
- }
+ // A real toplevel window needs a paint manager
+ if (isWindow() && windowType() != Qt::Desktop)
+ d->topData()->repaintManager.reset(new QWidgetRepaintManager(this));
d->setModal_sys();
if (!isWindow() && parentWidget() && parentWidget()->testAttribute(Qt::WA_DropSiteRegistered))
setAttribute(Qt::WA_DropSiteRegistered, true);
-#ifdef QT_EVAL
- extern void qt_eval_init_widget(QWidget *w);
- qt_eval_init_widget(this);
-#endif
-
// need to force the resting of the icon after changing parents
if (testAttribute(Qt::WA_SetWindowIcon))
d->setWindowIcon_sys();
@@ -1587,7 +1437,7 @@ QWidget::~QWidget()
// Remove all shortcuts grabbed by this
// widget, unless application is closing
if (!QApplicationPrivate::is_app_closing && testAttribute(Qt::WA_GrabbedShortcut))
- qApp->d_func()->shortcutMap.removeShortcut(0, this, QKeySequence());
+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(0, this, QKeySequence());
#endif
// delete layout while we still are a valid widget
@@ -1611,7 +1461,7 @@ QWidget::~QWidget()
while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
w = w->d_func()->extra->focus_proxy;
QWidget *window = w->window();
- QWExtra *e = window ? window->d_func()->extra : 0;
+ QWExtra *e = window ? window->d_func()->extra.get() : nullptr ;
if (!e || !e->proxyWidget || (w->parentWidget() && w->parentWidget()->d_func()->focus_child == this))
#endif
clearFocus();
@@ -1632,21 +1482,14 @@ QWidget::~QWidget()
// and if that also doesn't work, then give up
}
}
- }
-
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */|| 0 /* Used to be included in Qt4 for Q_WS_MAC */
- else if (!internalWinId() && isVisible()) {
- qApp->d_func()->sendSyntheticEnterLeave(this);
- }
-#endif
- else if (isVisible()) {
+ } else if (isVisible()) {
qApp->d_func()->sendSyntheticEnterLeave(this);
}
- if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
- bs->removeDirtyWidget(this);
+ if (QWidgetRepaintManager *repaintManager = d->maybeRepaintManager()) {
+ repaintManager->removeDirtyWidget(this);
if (testAttribute(Qt::WA_StaticContents))
- bs->removeStaticWidget(this);
+ repaintManager->removeStaticWidget(this);
}
delete d->needsFlush;
@@ -1683,19 +1526,10 @@ QWidget::~QWidget()
d->blockSig = blocked;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // QCocoaView holds a pointer back to this widget. Clear it now
- // to make sure it's not followed later on. The lifetime of the
- // QCocoaView might exceed the lifetime of this widget in cases
- // where Cocoa itself holds references to it.
- extern void qt_mac_clearCocoaViewQWidgetPointers(QWidget *);
- qt_mac_clearCocoaViewQWidgetPointers(this);
-#endif
-
if (!d->children.isEmpty())
d->deleteChildren();
- QApplication::removePostedEvents(this);
+ QCoreApplication::removePostedEvents(this);
QT_TRY {
destroy(); // platform-dependent cleanup
@@ -1738,9 +1572,6 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
const WId oldWinId = data.winid;
data.winid = id;
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- hd = id; // X11: hd == ident
-#endif
if (mapper && id && !userDesktopWidget) {
mapper->insert(data.winid, q);
}
@@ -1756,8 +1587,8 @@ void QWidgetPrivate::createTLExtra()
if (!extra)
createExtra();
if (!extra->topextra) {
- QTLWExtra* x = extra->topextra = new QTLWExtra;
- x->icon = 0;
+ extra->topextra = qt_make_unique<QTLWExtra>();
+ QTLWExtra* x = extra->topextra.get();
x->backingStore = 0;
x->sharedPainter = 0;
x->incw = x->inch = 0;
@@ -1771,11 +1602,8 @@ void QWidgetPrivate::createTLExtra()
x->inTopLevelResize = false;
x->embedded = 0;
x->window = 0;
- x->shareContext = 0;
x->initialScreenIndex = -1;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- x->wasMaximized = false;
-#endif
+
#ifdef QWIDGET_EXTRA_DEBUG
static int count = 0;
qDebug() << "tlextra" << ++count;
@@ -1791,15 +1619,11 @@ void QWidgetPrivate::createTLExtra()
void QWidgetPrivate::createExtra()
{
if (!extra) { // if not exists
- extra = new QWExtra;
+ extra = qt_make_unique<QWExtra>();
extra->glContext = 0;
- extra->topextra = 0;
#if QT_CONFIG(graphicsview)
extra->proxyWidget = 0;
#endif
-#ifndef QT_NO_CURSOR
- extra->curs = 0;
-#endif
extra->minw = 0;
extra->minh = 0;
extra->maxw = QWIDGETSIZE_MAX;
@@ -1833,9 +1657,6 @@ void QWidgetPrivate::createSysExtra()
void QWidgetPrivate::deleteExtra()
{
if (extra) { // if exists
-#ifndef QT_NO_CURSOR
- delete extra->curs;
-#endif
deleteSysExtra();
#ifndef QT_NO_STYLE_STYLESHEET
// dereference the stylesheet style
@@ -1845,12 +1666,9 @@ void QWidgetPrivate::deleteExtra()
if (extra->topextra) {
deleteTLSysExtra();
// extra->topextra->backingStore destroyed in QWidgetPrivate::deleteTLSysExtra()
- delete extra->topextra->icon;
- delete extra->topextra;
}
- delete extra;
// extra->xic destroyed in QWidget::destroy()
- extra = 0;
+ extra.reset();
}
}
@@ -1872,13 +1690,11 @@ void QWidgetPrivate::deleteTLSysExtra()
//the qplatformbackingstore may hold a reference to the window, so the backingstore
//needs to be deleted first.
- extra->topextra->backingStoreTracker.destroy();
+ extra->topextra->repaintManager.reset(nullptr);
deleteBackingStore(this);
#ifndef QT_NO_OPENGL
- qDeleteAll(extra->topextra->widgetTextures);
extra->topextra->widgetTextures.clear();
- delete extra->topextra->shareContext;
- extra->topextra->shareContext = 0;
+ extra->topextra->shareContext.reset();
#endif
//the toplevel might have a context with a "qglcontext associated with it. We need to
@@ -1923,7 +1739,7 @@ QRegion QWidgetPrivate::overlappedRegion(const QRect &rect, bool breakAfterFirst
const QRect siblingRect = sibling->d_func()->effectiveRectFor(sibling->data->crect);
if (qRectIntersects(siblingRect, r)) {
- const QWExtra *siblingExtra = sibling->d_func()->extra;
+ const auto &siblingExtra = sibling->d_func()->extra;
if (siblingExtra && siblingExtra->hasMask && !sibling->d_func()->graphicsEffect
&& !siblingExtra->mask.translated(sibling->data->crect.topLeft()).intersects(r)) {
continue;
@@ -1942,23 +1758,59 @@ QRegion QWidgetPrivate::overlappedRegion(const QRect &rect, bool breakAfterFirst
void QWidgetPrivate::syncBackingStore()
{
- if (paintOnScreen()) {
- repaint_sys(dirty);
+ if (shouldPaintOnScreen()) {
+ paintOnScreen(dirty);
dirty = QRegion();
- } else if (QWidgetBackingStore *bs = maybeBackingStore()) {
- bs->sync();
+ } else if (QWidgetRepaintManager *repaintManager = maybeRepaintManager()) {
+ repaintManager->sync();
}
}
void QWidgetPrivate::syncBackingStore(const QRegion &region)
{
- if (paintOnScreen())
- repaint_sys(region);
- else if (QWidgetBackingStore *bs = maybeBackingStore()) {
- bs->sync(q_func(), region);
+ if (shouldPaintOnScreen())
+ paintOnScreen(region);
+ else if (QWidgetRepaintManager *repaintManager = maybeRepaintManager()) {
+ repaintManager->sync(q_func(), region);
}
}
+void QWidgetPrivate::paintOnScreen(const QRegion &rgn)
+{
+ if (data.in_destructor)
+ return;
+
+ if (shouldDiscardSyncRequest())
+ return;
+
+ Q_Q(QWidget);
+ if (q->testAttribute(Qt::WA_StaticContents)) {
+ if (!extra)
+ createExtra();
+ extra->staticContentsSize = data.crect.size();
+ }
+
+ QPaintEngine *engine = q->paintEngine();
+
+ // QGLWidget does not support partial updates if:
+ // 1) The context is double buffered
+ // 2) The context is single buffered and auto-fill background is enabled.
+ const bool noPartialUpdateSupport = (engine && (engine->type() == QPaintEngine::OpenGL
+ || engine->type() == QPaintEngine::OpenGL2))
+ && (usesDoubleBufferedGLContext || q->autoFillBackground());
+ QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn);
+
+ toBePainted &= clipRect();
+ clipToEffectiveMask(toBePainted);
+ if (toBePainted.isEmpty())
+ return; // Nothing to repaint.
+
+ drawWidget(q, toBePainted, QPoint(), QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawPaintOnScreen, 0);
+
+ if (Q_UNLIKELY(q->paintingActive()))
+ qWarning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
+}
+
void QWidgetPrivate::setUpdatesEnabled_helper(bool enable)
{
Q_Q(QWidget);
@@ -2007,7 +1859,7 @@ void QWidgetPrivate::propagatePaletteChange()
QCoreApplication::testAttribute(Qt::AA_UseStyleSheetPropagationInWidgetStyles);
QEvent pc(QEvent::PaletteChange);
- QApplication::sendEvent(q, &pc);
+ QCoreApplication::sendEvent(q, &pc);
for (int i = 0; i < children.size(); ++i) {
QWidget *w = qobject_cast<QWidget*>(children.at(i));
if (w && (!w->testAttribute(Qt::WA_StyleSheet) || useStyleSheetPropagationInWidgetStyles)
@@ -2183,11 +2035,6 @@ void QWidgetPrivate::subtractOpaqueSiblings(QRegion &sourceRegion, bool *hasDirt
if (disableSubtractOpaqueSiblings || q->isWindow())
return;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (q->d_func()->isInUnifiedToolbar)
- return;
-#endif
-
QRect clipBoundingRect;
bool dirtyClipBoundingRect = true;
@@ -2291,7 +2138,7 @@ void QWidgetPrivate::clipToEffectiveMask(QRegion &region) const
}
}
-bool QWidgetPrivate::paintOnScreen() const
+bool QWidgetPrivate::shouldPaintOnScreen() const
{
#if defined(QT_NO_BACKINGSTORE)
return true;
@@ -2320,13 +2167,6 @@ void QWidgetPrivate::updateIsOpaque()
#endif // QT_CONFIG(graphicseffect)
Q_Q(QWidget);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (q->testAttribute(Qt::WA_X11OpenGLOverlay)) {
- setOpaque(false);
- return;
- }
-#endif
-
if (q->testAttribute(Qt::WA_OpaquePaintEvent) || q->testAttribute(Qt::WA_PaintOnScreen)) {
setOpaque(true);
return;
@@ -2379,20 +2219,9 @@ static inline void fillRegion(QPainter *painter, const QRegion &rgn, const QBrus
Q_ASSERT(painter);
if (brush.style() == Qt::TexturePattern) {
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // Optimize pattern filling on mac by using HITheme directly
- // when filling with the standard widget background.
- // Defined in qmacstyle_mac.cpp
- extern void qt_mac_fill_background(QPainter *painter, const QRegion &rgn, const QBrush &brush);
- qt_mac_fill_background(painter, rgn, brush);
-#else
- {
- const QRect rect(rgn.boundingRect());
- painter->setClipRegion(rgn);
- painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
- }
-#endif
-
+ const QRect rect(rgn.boundingRect());
+ painter->setClipRegion(rgn);
+ painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
} else if (brush.gradient()
&& (brush.gradient()->coordinateMode() == QGradient::ObjectBoundingMode
|| brush.gradient()->coordinateMode() == QGradient::ObjectMode)) {
@@ -2423,7 +2252,7 @@ bool QWidgetPrivate::updateBrushOrigin(QPainter *painter, const QBrush &brush) c
return true;
}
-void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int flags) const
+void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, DrawWidgetFlags flags) const
{
Q_Q(const QWidget);
@@ -2466,11 +2295,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int
visible widgets.
*/
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- extern QPointer<QWidget> qt_button_down;
-#else
- extern QWidget *qt_button_down;
-#endif
+extern QWidget *qt_button_down;
void QWidgetPrivate::deactivateWidgetCleanup()
{
@@ -2656,7 +2481,7 @@ WId QWidget::effectiveWinId() const
\since 5.0
- \sa winId()
+ \sa winId(), screen()
*/
QWindow *QWidget::windowHandle() const
{
@@ -2664,6 +2489,29 @@ QWindow *QWidget::windowHandle() const
return d->windowHandle();
}
+/*!
+ Returns the screen the widget is on.
+
+ \since 5.14
+
+ \sa windowHandle()
+*/
+QScreen *QWidget::screen() const
+{
+ Q_D(const QWidget);
+ if (auto associatedScreen = d->associatedScreen())
+ return associatedScreen;
+ if (auto topLevel = window()) {
+ if (auto topData = qt_widget_private(topLevel)->topData()) {
+ if (auto initialScreen = QGuiApplicationPrivate::screen_list.value(topData->initialScreenIndex))
+ return initialScreen;
+ }
+ if (auto screenByPos = QGuiApplication::screenAt(topLevel->geometry().center()))
+ return screenByPos;
+ }
+ return QGuiApplication::primaryScreen();
+}
+
#ifndef QT_NO_STYLE_STYLESHEET
/*!
@@ -2811,7 +2659,7 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate)
#endif
QEvent e(QEvent::StyleChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
#ifndef QT_NO_STYLE_STYLESHEET
// dereference the old stylesheet style
@@ -3029,7 +2877,7 @@ void QWidget::overrideWindowState(Qt::WindowStates newstate)
{
QWindowStateChangeEvent e(Qt::WindowStates(data->window_state), true);
data->window_state = newstate;
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
/*!
@@ -3066,6 +2914,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
{
Q_D(QWidget);
Qt::WindowStates oldstate = windowState();
+ if (newstate.testFlag(Qt::WindowMinimized)) // QTBUG-46763
+ newstate.setFlag(Qt::WindowActive, false);
if (oldstate == newstate)
return;
if (isWindow() && !testAttribute(Qt::WA_WState_Created))
@@ -3091,7 +2941,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
activateWindow();
QWindowStateChangeEvent e(oldstate);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
/*!
@@ -3139,15 +2989,6 @@ bool QWidget::isFullScreen() const
*/
void QWidget::showFullScreen()
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // If the unified toolbar is enabled, we have to disable it before going fullscreen.
- QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
- if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) {
- mainWindow->setUnifiedTitleAndToolBarOnMac(false);
- QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
- mainLayout->activateUnifiedToolbarAfterFullScreen = true;
- }
-#endif
ensurePolished();
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized))
@@ -3175,18 +3016,6 @@ void QWidget::showMaximized()
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
| Qt::WindowMaximized);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // If the unified toolbar was enabled before going fullscreen, we have to enable it back.
- QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
- if (mainWindow)
- {
- QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
- if (mainLayout->activateUnifiedToolbarAfterFullScreen) {
- mainWindow->setUnifiedTitleAndToolBarOnMac(true);
- mainLayout->activateUnifiedToolbarAfterFullScreen = false;
- }
- }
-#endif
setVisible(true);
}
@@ -3204,18 +3033,6 @@ void QWidget::showNormal()
setWindowState(windowState() & ~(Qt::WindowMinimized
| Qt::WindowMaximized
| Qt::WindowFullScreen));
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // If the unified toolbar was enabled before going fullscreen, we have to enable it back.
- QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
- if (mainWindow)
- {
- QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
- if (mainLayout->activateUnifiedToolbarAfterFullScreen) {
- mainWindow->setUnifiedTitleAndToolBarOnMac(true);
- mainLayout->activateUnifiedToolbarAfterFullScreen = false;
- }
- }
-#endif
setVisible(true);
}
@@ -3317,7 +3134,7 @@ void QWidget::insertAction(QAction *before, QAction *action)
apriv->widgets.append(this);
QActionEvent e(QEvent::ActionAdded, action, before);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
/*!
@@ -3355,7 +3172,7 @@ void QWidget::removeAction(QAction *action)
if (d->actions.removeAll(action)) {
QActionEvent e(QEvent::ActionRemoved, action);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
}
@@ -3431,13 +3248,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
if (w && !w->testAttribute(attribute))
w->d_func()->setEnabled_helper(enable);
}
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) {
- // enforce the windows behavior of clearing the cursor on
- // disabled widgets
- qt_x11_enforce_cursor(q);
- }
-#endif
#ifndef QT_NO_CURSOR
if (q->testAttribute(Qt::WA_SetCursor) || q->isWindow()) {
// enforce the windows behavior of clearing the cursor on
@@ -3445,9 +3255,6 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
qt_qpa_set_cursor(q, false);
}
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- setEnabled_helper_sys(enable);
-#endif
#ifndef QT_NO_IM
if (q->testAttribute(Qt::WA_InputMethodEnabled) && q->hasFocus()) {
QWidget *focusWidget = effectiveFocusWidget();
@@ -3462,7 +3269,7 @@ void QWidgetPrivate::setEnabled_helper(bool enable)
}
#endif //QT_NO_IM
QEvent e(QEvent::EnabledChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
/*!
@@ -3928,7 +3735,7 @@ QSize QWidget::sizeIncrement() const
QSize QWidget::baseSize() const
{
Q_D(const QWidget);
- return (d->extra != 0 && d->extra->topextra != 0)
+ return (d->extra && d->extra->topextra)
? QSize(d->extra->topextra->basew, d->extra->topextra->baseh)
: QSize(0, 0);
}
@@ -4529,7 +4336,7 @@ void QWidget::setForegroundRole(QPalette::ColorRole role)
the "color", "background-color", "selection-color",
"selection-background-color" and "alternate-background-color".
- \sa QApplication::palette(), QWidget::font(), {Qt Style Sheets}
+ \sa QGuiApplication::palette(), QWidget::font(), {Qt Style Sheets}
*/
const QPalette &QWidget::palette() const
{
@@ -4542,13 +4349,7 @@ const QPalette &QWidget::palette() const
) {
data->pal.setCurrentColorGroup(QPalette::Active);
} else {
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- extern bool qt_mac_can_clickThrough(const QWidget *); //qwidget_mac.cpp
- if (qt_mac_can_clickThrough(this))
- data->pal.setCurrentColorGroup(QPalette::Active);
- else
-#endif
- data->pal.setCurrentColorGroup(QPalette::Inactive);
+ data->pal.setCurrentColorGroup(QPalette::Inactive);
}
return data->pal;
}
@@ -4592,7 +4393,7 @@ QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const
)) {
if (QWidget *p = q->parentWidget()) {
if (!p->testAttribute(Qt::WA_StyleSheet) || useStyleSheetPropagationInWidgetStyles) {
- if (!naturalPalette.isCopyOf(QApplication::palette())) {
+ if (!naturalPalette.isCopyOf(QGuiApplication::palette())) {
QPalette inheritedPalette = p->palette();
inheritedPalette.resolve(inheritedMask);
naturalPalette = inheritedPalette.resolve(naturalPalette);
@@ -4811,10 +4612,7 @@ void QWidgetPrivate::updateFont(const QFont &font)
#endif
data.fnt = QFont(font, q);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- // make sure the font set on this widget is associated with the correct screen
- data.fnt.x11SetScreen(xinfo.screen());
-#endif
+
// Combine new mask with natural mask and propagate to children.
#if QT_CONFIG(graphicsview)
if (!q->parentWidget() && extra && extra->proxyWidget) {
@@ -4858,7 +4656,7 @@ void QWidgetPrivate::updateFont(const QFont &font)
#endif
QEvent e(QEvent::FontChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
void QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction)
@@ -4876,14 +4674,14 @@ void QWidgetPrivate::setLayoutDirection_helper(Qt::LayoutDirection direction)
}
}
QEvent e(QEvent::LayoutDirectionChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
void QWidgetPrivate::resolveLayoutDirection()
{
Q_Q(const QWidget);
if (!q->testAttribute(Qt::WA_SetLayoutDirection))
- setLayoutDirection_helper(q->isWindow() ? QApplication::layoutDirection() : q->parentWidget()->layoutDirection());
+ setLayoutDirection_helper(q->isWindow() ? QGuiApplication::layoutDirection() : q->parentWidget()->layoutDirection());
}
/*!
@@ -4988,22 +4786,17 @@ QCursor QWidget::cursor() const
void QWidget::setCursor(const QCursor &cursor)
{
Q_D(QWidget);
-// On Mac we must set the cursor even if it is the ArrowCursor.
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
if (cursor.shape() != Qt::ArrowCursor
|| (d->extra && d->extra->curs))
-#endif
{
d->createExtra();
- QCursor *newCursor = new QCursor(cursor);
- delete d->extra->curs;
- d->extra->curs = newCursor;
+ d->extra->curs = qt_make_unique<QCursor>(cursor);
}
setAttribute(Qt::WA_SetCursor);
d->setCursor_sys(cursor);
QEvent event(QEvent::CursorChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
void QWidgetPrivate::setCursor_sys(const QCursor &cursor)
@@ -5016,16 +4809,14 @@ void QWidgetPrivate::setCursor_sys(const QCursor &cursor)
void QWidget::unsetCursor()
{
Q_D(QWidget);
- if (d->extra) {
- delete d->extra->curs;
- d->extra->curs = 0;
- }
+ if (d->extra)
+ d->extra->curs.reset();
if (!isWindow())
setAttribute(Qt::WA_SetCursor, false);
d->unsetCursor_sys();
QEvent event(QEvent::CursorChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
void QWidgetPrivate::unsetCursor_sys()
@@ -5223,7 +5014,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset,
static void sendResizeEvents(QWidget *target)
{
QResizeEvent e(target->size(), QSize());
- QApplication::sendEvent(target, &e);
+ QCoreApplication::sendEvent(target, &e);
const QObjectList children = target->children();
for (int i = 0; i < children.size(); ++i) {
@@ -5423,11 +5214,9 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
Q_ASSERT(!toBePainted.isEmpty());
Q_Q(QWidget);
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
const QTransform originalTransform = painter->worldTransform();
const bool useDeviceCoordinates = originalTransform.isScaling();
if (!useDeviceCoordinates) {
-#endif
// Render via a pixmap.
const QRect rect = toBePainted.boundingRect();
const QSize size = rect.size();
@@ -5450,7 +5239,6 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
if (restore)
painter->setRenderHints(QPainter::SmoothPixmapTransform, false);
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
} else {
// Render via a pixmap in device coordinates (to avoid pixmap scaling).
QTransform transform = originalTransform;
@@ -5481,26 +5269,29 @@ void QWidgetPrivate::render_helper(QPainter *painter, const QPoint &targetOffset
painter->drawPixmap(deviceRect.topLeft(), pixmap);
painter->setTransform(originalTransform);
}
-#endif
}
-void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags,
- QPainter *sharedPainter, QWidgetBackingStore *backingStore)
+void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags,
+ QPainter *sharedPainter, QWidgetRepaintManager *repaintManager)
{
if (rgn.isEmpty())
return;
+ Q_Q(QWidget);
+
+ qCInfo(lcWidgetPainting) << "Drawing" << rgn << "of" << q << "at" << offset
+ << "into paint device" << pdev << "with" << flags;
+
const bool asRoot = flags & DrawAsRoot;
- bool onScreen = paintOnScreen();
+ bool onScreen = shouldPaintOnScreen();
- Q_Q(QWidget);
#if QT_CONFIG(graphicseffect)
if (graphicsEffect && graphicsEffect->isEnabled()) {
QGraphicsEffectSource *source = graphicsEffect->d_func()->source;
QWidgetEffectSourcePrivate *sourced = static_cast<QWidgetEffectSourcePrivate *>
(source->d_func());
if (!sourced->context) {
- QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, backingStore);
+ QWidgetPaintContext context(pdev, rgn, offset, flags, sharedPainter, repaintManager);
sourced->context = &context;
if (!sharedPainter) {
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), rgn.translated(offset));
@@ -5524,10 +5315,8 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
}
sourced->context = 0;
- // Native widgets need to be marked dirty on screen so painting will be done in correct context
- // Same check as in the no effects case below.
- if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
- backingStore->markDirtyOnScreen(rgn, q, offset);
+ if (repaintManager)
+ repaintManager->markNeedsFlush(q, rgn, offset);
return;
}
@@ -5554,22 +5343,10 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
q->setAttribute(Qt::WA_WState_InPaintEvent);
//clip away the new area
-#ifndef QT_NO_PAINT_DEBUG
- bool flushed = QWidgetBackingStore::flushPaint(q, toBePainted);
-#endif
QPaintEngine *paintEngine = pdev->paintEngine();
if (paintEngine) {
setRedirected(pdev, -offset);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // (Alien support) Special case for Mac when redirecting: If the paint device
- // is of the Widget type we need to set WA_WState_InPaintEvent since painting
- // outside the paint event is not supported on QWidgets. The attributeis
- // restored further down.
- if (pdev->devType() == QInternal::Widget)
- static_cast<QWidget *>(pdev)->setAttribute(Qt::WA_WState_InPaintEvent);
-
-#endif
if (sharedPainter)
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), toBePainted);
else
@@ -5582,7 +5359,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
beginBackingStorePainting();
#endif
QPainter p(q);
- paintBackground(&p, toBePainted, (asRoot || onScreen) ? flags | DrawAsRoot : 0);
+ paintBackground(&p, toBePainted, (asRoot || onScreen) ? (flags | DrawAsRoot) : DrawWidgetFlags());
#ifndef QT_NO_OPENGL
endBackingStorePainting();
#endif
@@ -5617,11 +5394,11 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
// This widget renders into a texture which is composed later. We just need to
// punch a hole in the backingstore, so the texture will be visible.
beginBackingStorePainting();
- if (!q->testAttribute(Qt::WA_AlwaysStackOnTop) && backingStore) {
+ if (!q->testAttribute(Qt::WA_AlwaysStackOnTop) && repaintManager) {
QPainter p(q);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.fillRect(q->rect(), Qt::transparent);
- } else if (!backingStore) {
+ } else if (!repaintManager) {
// We are not drawing to a backingstore: fall back to QImage
QImage img = grabFramebuffer();
// grabFramebuffer() always sets the format to RGB32
@@ -5645,16 +5422,11 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
sendPaintEvent(toBePainted);
}
- // Native widgets need to be marked dirty on screen so painting will be done in correct context
- if (backingStore && !onScreen && !asRoot && (q->internalWinId() || (q->nativeParentWidget() && !q->nativeParentWidget()->isWindow())))
- backingStore->markDirtyOnScreen(toBePainted, q, offset);
+ if (repaintManager)
+ repaintManager->markNeedsFlush(q, toBePainted, offset);
//restore
if (paintEngine) {
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (pdev->devType() == QInternal::Widget)
- static_cast<QWidget *>(pdev)->setAttribute(Qt::WA_WState_InPaintEvent, false);
-#endif
restoreRedirected();
if (!sharedPainter)
paintEngine->d_func()->systemRect = QRect();
@@ -5670,11 +5442,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
if (paintEngine && paintEngine->autoDestruct()) {
delete paintEngine;
}
-
-#ifndef QT_NO_PAINT_DEBUG
- if (flushed)
- QWidgetBackingStore::unflushPaint(q, toBePainted);
-#endif
} else if (q->isWindow()) {
QPaintEngine *engine = pdev->paintEngine();
if (engine) {
@@ -5693,8 +5460,8 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
}
if (recursive && !children.isEmpty()) {
- paintSiblingsRecursive(pdev, children, children.size() - 1, rgn, offset, flags & ~DrawAsRoot
- , sharedPainter, backingStore);
+ paintSiblingsRecursive(pdev, children, children.size() - 1, rgn, offset, flags & ~DrawAsRoot,
+ sharedPainter, repaintManager);
}
}
@@ -5725,7 +5492,6 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset,
if (paintRegion.isEmpty())
return;
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
QPainter *oldSharedPainter = inRenderWithPainter ? sharedPainter() : 0;
// Use the target's shared painter if set (typically set when doing
@@ -5738,7 +5504,6 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset,
setSharedPainter(targetPainter);
}
}
-#endif
// Use the target's redirected device if set and adjust offset and paint
// region accordingly. This is typically the case when people call render
@@ -5765,7 +5530,7 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset,
}
// Set backingstore flags.
- int flags = DrawPaintOnScreen | DrawInvisible;
+ DrawWidgetFlags flags = DrawPaintOnScreen | DrawInvisible;
if (renderFlags & QWidget::DrawWindowBackground)
flags |= DrawAsRoot;
@@ -5785,8 +5550,8 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset,
}
void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& siblings, int index, const QRegion &rgn,
- const QPoint &offset, int flags
- , QPainter *sharedPainter, QWidgetBackingStore *backingStore)
+ const QPoint &offset, DrawWidgetFlags flags
+ , QPainter *sharedPainter, QWidgetRepaintManager *repaintManager)
{
QWidget *w = 0;
QRect boundingRect;
@@ -5821,8 +5586,8 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis
QRegion wr(rgn);
if (wd->isOpaque)
wr -= hasMask ? wd->extra->mask.translated(widgetPos) : w->data->crect;
- paintSiblingsRecursive(pdev, siblings, --index, wr, offset, flags
- , sharedPainter, backingStore);
+ paintSiblingsRecursive(pdev, siblings, --index, wr, offset, flags,
+ sharedPainter, repaintManager);
}
if (w->updatesEnabled()
@@ -5835,7 +5600,7 @@ void QWidgetPrivate::paintSiblingsRecursive(QPaintDevice *pdev, const QObjectLis
wRegion.translate(-widgetPos);
if (hasMask)
wRegion &= wd->extra->mask;
- wd->drawWidget(pdev, wRegion, offset + widgetPos, flags, sharedPainter, backingStore);
+ wd->drawWidget(pdev, wRegion, offset + widgetPos, flags, sharedPainter, repaintManager);
}
}
@@ -5870,7 +5635,7 @@ void QWidgetEffectSourcePrivate::draw(QPainter *painter)
toBePainted &= wd->extra->mask;
wd->drawWidget(context->pdev, toBePainted, context->offset, context->flags,
- context->sharedPainter, context->backingStore);
+ context->sharedPainter, context->repaintManager);
}
QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *offset,
@@ -5932,7 +5697,7 @@ QPixmap QWidgetEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QPoint *
QGraphicsProxyWidget *QWidgetPrivate::nearestGraphicsProxyWidget(const QWidget *origin)
{
if (origin) {
- QWExtra *extra = origin->d_func()->extra;
+ const auto &extra = origin->d_func()->extra;
if (extra && extra->proxyWidget)
return extra->proxyWidget;
return nearestGraphicsProxyWidget(origin->parentWidget());
@@ -5977,7 +5742,7 @@ void QWidgetPrivate::setLocale_helper(const QLocale &loc, bool forceUpdate)
}
}
QEvent e(QEvent::LocaleChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
void QWidget::setLocale(const QLocale &locale)
@@ -6063,13 +5828,7 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg
{
Q_ASSERT(widget);
-#ifdef QT_EVAL
- extern QString qt_eval_adapt_window_title(const QString &title);
- QString cap = qt_eval_adapt_window_title(title);
-#else
QString cap = title;
-#endif
-
if (cap.isEmpty())
return cap;
@@ -6158,7 +5917,7 @@ void QWidget::setWindowIconText(const QString &iconText)
d->setWindowIconText_helper(iconText);
QEvent e(QEvent::IconTextChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
emit windowIconTextChanged(iconText);
}
@@ -6182,7 +5941,7 @@ void QWidget::setWindowTitle(const QString &title)
d->setWindowTitle_helper(title);
QEvent e(QEvent::WindowTitleChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
emit windowTitleChanged(title);
}
@@ -6220,11 +5979,11 @@ void QWidgetPrivate::setWindowIcon_helper()
// QWidgetWindow to the top level QWidget ensures that the event reaches
// the top level anyhow
if (!q->windowHandle())
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
for (int i = 0; i < children.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(children.at(i));
if (w && !w->isWindow())
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
}
}
@@ -6245,8 +6004,9 @@ void QWidget::setWindowIcon(const QIcon &icon)
d->createTLExtra();
if (!d->extra->topextra->icon)
- d->extra->topextra->icon = new QIcon();
- *d->extra->topextra->icon = icon;
+ d->extra->topextra->icon = qt_make_unique<QIcon>(icon);
+ else
+ *d->extra->topextra->icon = icon;
d->setWindowIcon_sys();
d->setWindowIcon_helper();
@@ -6460,7 +6220,7 @@ void QWidget::setFocusProxy(QWidget * w)
QWidget *QWidget::focusProxy() const
{
Q_D(const QWidget);
- return d->extra ? (QWidget *)d->extra->focus_proxy : nullptr;
+ return d->extra ? d->extra->focus_proxy.data() : nullptr;
}
@@ -6483,7 +6243,7 @@ bool QWidget::hasFocus() const
w = w->d_func()->extra->focus_proxy;
#if QT_CONFIG(graphicsview)
if (QWidget *window = w->window()) {
- QWExtra *e = window->d_func()->extra;
+ const auto &e = window->d_func()->extra;
if (e && e->proxyWidget && e->proxyWidget->hasFocus() && window->focusWidget() == w)
return true;
}
@@ -6535,16 +6295,12 @@ void QWidget::setFocus(Qt::FocusReason reason)
if (!f)
f = this;
- if (QApplication::focusWidget() == f
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- && GetFocus() == f->internalWinId()
-#endif
- )
+ if (QApplication::focusWidget() == f)
return;
#if QT_CONFIG(graphicsview)
QWidget *previousProxyFocus = 0;
- if (QWExtra *topData = window()->d_func()->extra) {
+ if (const auto &topData = window()->d_func()->extra) {
if (topData->proxyWidget && topData->proxyWidget->hasFocus()) {
previousProxyFocus = topData->proxyWidget->widget()->focusWidget();
if (previousProxyFocus && previousProxyFocus->focusProxy())
@@ -6557,7 +6313,7 @@ void QWidget::setFocus(Qt::FocusReason reason)
#if QT_CONFIG(graphicsview)
// Update proxy state
- if (QWExtra *topData = window()->d_func()->extra) {
+ if (const auto &topData = window()->d_func()->extra) {
if (topData->proxyWidget && !topData->proxyWidget->hasFocus()) {
f->d_func()->updateFocusChild();
topData->proxyWidget->d_func()->focusFromWidgetToProxy = 1;
@@ -6577,7 +6333,7 @@ void QWidget::setFocus(Qt::FocusReason reason)
if (reason != Qt::NoFocusReason) {
QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange, reason);
- QApplication::sendEvent(prev, &focusAboutToChange);
+ QCoreApplication::sendEvent(prev, &focusAboutToChange);
}
}
@@ -6598,29 +6354,29 @@ void QWidget::setFocus(Qt::FocusReason reason)
}
#endif
#if QT_CONFIG(graphicsview)
- if (QWExtra *topData = window()->d_func()->extra) {
+ if (const auto &topData = window()->d_func()->extra) {
if (topData->proxyWidget) {
if (previousProxyFocus && previousProxyFocus != f) {
// Send event to self
QFocusEvent event(QEvent::FocusOut, reason);
QPointer<QWidget> that = previousProxyFocus;
- QApplication::sendEvent(previousProxyFocus, &event);
+ QCoreApplication::sendEvent(previousProxyFocus, &event);
if (that)
- QApplication::sendEvent(that->style(), &event);
+ QCoreApplication::sendEvent(that->style(), &event);
}
if (!isHidden()) {
#if QT_CONFIG(graphicsview)
// Update proxy state
- if (QWExtra *topData = window()->d_func()->extra)
+ if (const auto &topData = window()->d_func()->extra)
if (topData->proxyWidget && topData->proxyWidget->hasFocus())
topData->proxyWidget->d_func()->updateProxyInputMethodAcceptanceFromWidget();
#endif
// Send event to self
QFocusEvent event(QEvent::FocusIn, reason);
QPointer<QWidget> that = f;
- QApplication::sendEvent(f, &event);
+ QCoreApplication::sendEvent(f, &event);
if (that)
- QApplication::sendEvent(that->style(), &event);
+ QCoreApplication::sendEvent(that->style(), &event);
}
}
}
@@ -6727,7 +6483,7 @@ void QWidget::clearFocus()
QGuiApplication::inputMethod()->commit();
QFocusEvent focusAboutToChange(QEvent::FocusAboutToChange);
- QApplication::sendEvent(this, &focusAboutToChange);
+ QCoreApplication::sendEvent(this, &focusAboutToChange);
}
QWidget *w = this;
@@ -6748,7 +6504,7 @@ void QWidget::clearFocus()
}
#if QT_CONFIG(graphicsview)
- QWExtra *topData = d_func()->extra;
+ const auto &topData = d_func()->extra;
if (topData && topData->proxyWidget)
topData->proxyWidget->clearFocus();
#endif
@@ -6756,17 +6512,10 @@ void QWidget::clearFocus()
if (hasFocus()) {
// Update proxy state
QApplicationPrivate::setFocusWidget(0, Qt::OtherFocusReason);
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- if (!(windowType() == Qt::Popup) && GetFocus() == internalWinId())
- SetFocus(0);
- else
-#endif
- {
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleEvent event(this, QAccessible::Focus);
- QAccessible::updateAccessibility(&event);
+ QAccessibleEvent event(this, QAccessible::Focus);
+ QAccessible::updateAccessibility(&event);
#endif
- }
}
}
@@ -6914,7 +6663,7 @@ bool QWidget::isActiveWindow() const
return true;
#if QT_CONFIG(graphicsview)
- if (QWExtra *tlwExtra = tlw->d_func()->extra) {
+ if (const auto &tlwExtra = tlw->d_func()->extra) {
if (isVisible() && tlwExtra->proxyWidget)
return tlwExtra->proxyWidget->isActiveWindow();
}
@@ -7374,11 +7123,11 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
if (isMove) {
QMoveEvent e(q->pos(), oldPos);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
if (isResize) {
QResizeEvent e(r.size(), olds);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
if (q->windowHandle())
q->update();
}
@@ -7410,18 +7159,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
*/
QByteArray QWidget::saveGeometry() const
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // We check if the window was maximized during this invocation. If so, we need to record the
- // starting position as 0,0.
- Q_D(const QWidget);
- QRect newFramePosition = frameGeometry();
- QRect newNormalPosition = normalGeometry();
- if(d->topData()->wasMaximized && !(windowState() & Qt::WindowMaximized)) {
- // Change the starting position
- newFramePosition.moveTo(0, 0);
- newNormalPosition.moveTo(0, 0);
- }
-#endif
QByteArray array;
QDataStream stream(&array, QIODevice::WriteOnly);
stream.setVersion(QDataStream::Qt_4_0);
@@ -7436,13 +7173,8 @@ QByteArray QWidget::saveGeometry() const
stream << magicNumber
<< majorVersion
<< minorVersion
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- << newFramePosition
- << newNormalPosition
-#else
<< frameGeometry()
<< normalGeometry()
-#endif
<< qint32(screenNumber)
<< quint8(windowState() & Qt::WindowMaximized)
<< quint8(windowState() & Qt::WindowFullScreen)
@@ -7562,11 +7294,6 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
// that would make the window "lost". This happens if:
// - The restored geometry is completely oustside the available geometry
// - The title bar is outside the available geometry.
- // - (Mac only) The window is higher than the available geometry. It must
- // be possible to bring the size grip on screen by moving the window.
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- restoredNormalGeometry.setHeight(qMin(restoredNormalGeometry.height(), availableGeometry.height() - frameHeight));
-#endif
checkRestoredGeometry(availableGeometry, &restoredGeometry, frameHeight);
checkRestoredGeometry(availableGeometry, &restoredNormalGeometry, frameHeight);
@@ -7623,7 +7350,7 @@ bool QWidget::restoreGeometry(const QByteArray &geometry)
Changing the margins will trigger a resizeEvent().
- \sa contentsRect(), getContentsMargins()
+ \sa contentsRect(), contentsMargins()
*/
void QWidget::setContentsMargins(int left, int top, int right, int bottom)
{
@@ -7653,7 +7380,7 @@ void QWidget::setContentsMargins(int left, int top, int right, int bottom)
Changing the margins will trigger a resizeEvent().
- \sa contentsRect(), getContentsMargins()
+ \sa contentsRect(), contentsMargins()
*/
void QWidget::setContentsMargins(const QMargins &margins)
{
@@ -7673,16 +7400,20 @@ void QWidgetPrivate::updateContentsRect()
if (q->isVisible()) {
q->update();
QResizeEvent e(q->data->crect.size(), q->data->crect.size());
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
} else {
q->setAttribute(Qt::WA_PendingResizeEvent, true);
}
QEvent e(QEvent::ContentsRectChange);
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
+ \obsolete
+ Use contentsMargins().
+
Returns the widget's contents margins for \a left, \a top, \a
right, and \a bottom.
@@ -7700,6 +7431,7 @@ void QWidget::getContentsMargins(int *left, int *top, int *right, int *bottom) c
if (bottom)
*bottom = m.bottom();
}
+#endif
// FIXME: Move to qmargins.h for next minor Qt release
QMargins operator|(const QMargins &m1, const QMargins &m2)
@@ -7713,7 +7445,7 @@ QMargins operator|(const QMargins &m1, const QMargins &m2)
\brief The contentsMargins function returns the widget's contents margins.
- \sa getContentsMargins(), setContentsMargins(), contentsRect()
+ \sa setContentsMargins(), contentsRect()
*/
QMargins QWidget::contentsMargins() const
{
@@ -7726,7 +7458,7 @@ QMargins QWidget::contentsMargins() const
/*!
Returns the area inside the widget's margins.
- \sa setContentsMargins(), getContentsMargins()
+ \sa setContentsMargins(), contentsMargins()
*/
QRect QWidget::contentsRect() const
{
@@ -7939,7 +7671,7 @@ void QWidget::show()
else if (defaultState == Qt::WindowMaximized)
showMaximized();
else
- setVisible(true); // FIXME: Why not showNormal(), like QWindow::show()?
+ setVisible(true); // Don't call showNormal() as not to clobber Qt::Window(Max/Min)imized
}
/*! \internal
@@ -7975,13 +7707,13 @@ void QWidgetPrivate::sendPendingMoveAndResizeEvents(bool recursive, bool disable
if (q->testAttribute(Qt::WA_PendingMoveEvent)) {
QMoveEvent e(data.crect.topLeft(), data.crect.topLeft());
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
q->setAttribute(Qt::WA_PendingMoveEvent, false);
}
if (q->testAttribute(Qt::WA_PendingResizeEvent)) {
QResizeEvent e(data.crect.size(), QSize());
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
q->setAttribute(Qt::WA_PendingResizeEvent, false);
}
@@ -8081,17 +7813,9 @@ void QWidgetPrivate::show_helper()
Q_UNUSED(isEmbedded);
#endif
- // On Windows, show the popup now so that our own focus handling
- // stores the correct old focus widget even if it's stolen in the
- // showevent
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */
- if (!isEmbedded && q->windowType() == Qt::Popup)
- qApp->d_func()->openPopup(q);
-#endif
-
// send the show event before showing the window
QShowEvent showEvent;
- QApplication::sendEvent(q, &showEvent);
+ QCoreApplication::sendEvent(q, &showEvent);
show_sys();
@@ -8114,7 +7838,7 @@ void QWidgetPrivate::show_helper()
// is spinnning; otherwise it might not show up on particular platforms.
// This makes QSplashScreen behave the same on all platforms.
if (!qApp->d_func()->in_exec && q->windowType() == Qt::SplashScreen)
- QApplication::processEvents();
+ QCoreApplication::processEvents();
data.in_show = false; // reset qws optimization
}
@@ -8123,7 +7847,7 @@ void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
- QWidgetWindow *window = windowHandle();
+ auto window = qobject_cast<QWidgetWindow *>(windowHandle());
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
invalidateBackingStore(q->rect());
@@ -8140,9 +7864,9 @@ void QWidgetPrivate::show_sys()
}
if (renderToTexture && !q->isWindow())
- QApplication::postEvent(q->parentWidget(), new QUpdateLaterEvent(q->geometry()));
+ QCoreApplication::postEvent(q->parentWidget(), new QUpdateLaterEvent(q->geometry()));
else
- QApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
+ QCoreApplication::postEvent(q, new QUpdateLaterEvent(q->rect()));
if ((!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow))
|| q->testAttribute(Qt::WA_OutsideWSRange)) {
@@ -8213,12 +7937,6 @@ void QWidgetPrivate::hide_helper()
if (!isEmbedded && (q->windowType() == Qt::Popup))
qApp->d_func()->closePopup(q);
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- if (q->isWindow() && !(q->windowType() == Qt::Popup) && q->parentWidget()
- && !q->parentWidget()->isHidden() && q->isActiveWindow())
- q->parentWidget()->activateWindow(); // Activate parent
-#endif
-
q->setAttribute(Qt::WA_Mapped, false);
hide_sys();
@@ -8230,7 +7948,7 @@ void QWidgetPrivate::hide_helper()
}
QHideEvent hideEvent;
- QApplication::sendEvent(q, &hideEvent);
+ QCoreApplication::sendEvent(q, &hideEvent);
hideChildren(false);
// next bit tries to move the focus if the focus widget is now
@@ -8247,8 +7965,8 @@ void QWidgetPrivate::hide_helper()
}
}
- if (QWidgetBackingStore *bs = maybeBackingStore())
- bs->removeDirtyWidget(q);
+ if (QWidgetRepaintManager *repaintManager = maybeRepaintManager())
+ repaintManager->removeDirtyWidget(q);
#ifndef QT_NO_ACCESSIBILITY
if (wasVisible) {
@@ -8262,7 +7980,7 @@ void QWidgetPrivate::hide_sys()
{
Q_Q(QWidget);
- QWidgetWindow *window = windowHandle();
+ auto window = qobject_cast<QWidgetWindow *>(windowHandle());
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
q->setAttribute(Qt::WA_Mapped, false);
@@ -8401,18 +8119,8 @@ void QWidgetPrivate::setVisible(bool visible)
}
QEvent showToParentEvent(QEvent::ShowToParent);
- QApplication::sendEvent(q, &showToParentEvent);
+ QCoreApplication::sendEvent(q, &showToParentEvent);
} else { // hide
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- // reset WS_DISABLED style in a Blocked window
- if(isWindow() && testAttribute(Qt::WA_WState_Created)
- && QApplicationPrivate::isBlockedByModal(this))
- {
- LONG dwStyle = GetWindowLong(winId(), GWL_STYLE);
- dwStyle &= ~WS_DISABLED;
- SetWindowLong(winId(), GWL_STYLE, dwStyle);
- }
-#endif
if (QApplicationPrivate::hidden_focus_widget == q)
QApplicationPrivate::hidden_focus_widget = 0;
@@ -8432,11 +8140,11 @@ void QWidgetPrivate::setVisible(bool visible)
if (q->parentWidget()->d_func()->layout)
q->parentWidget()->d_func()->layout->invalidate();
else if (q->parentWidget()->isVisible())
- QApplication::postEvent(q->parentWidget(), new QEvent(QEvent::LayoutRequest));
+ QCoreApplication::postEvent(q->parentWidget(), new QEvent(QEvent::LayoutRequest));
}
QEvent hideToParentEvent(QEvent::HideToParent);
- QApplication::sendEvent(q, &hideToParentEvent);
+ QCoreApplication::sendEvent(q, &hideToParentEvent);
}
}
@@ -8487,23 +8195,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
QWidget *widget = qobject_cast<QWidget*>(childList.at(i));
if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden))
continue;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // Before doing anything we need to make sure that we don't leave anything in a non-consistent state.
- // When hiding a widget we need to make sure that no mouse_down events are active, because
- // the mouse_up event will never be received by a hidden widget or one of its descendants.
- // The solution is simple, before going through with this we check if there are any mouse_down events in
- // progress, if so we check if it is related to this widget or not. If so, we just reset the mouse_down and
- // then we continue.
- // In X11 and Windows we send a mouse_release event, however we don't do that here because we were already
- // ignoring that from before. I.e. Carbon did not send the mouse release event, so we will not send the
- // mouse release event. There are two ways to interpret this:
- // 1. If we don't send the mouse release event, the widget might get into an inconsistent state, i.e. it
- // might be waiting for a release event that will never arrive.
- // 2. If we send the mouse release event, then the widget might decide to trigger an action that is not
- // supposed to trigger because it is not visible.
- if(widget == qt_button_down)
- qt_button_down = 0;
-#endif
+
if (spontaneous)
widget->setAttribute(Qt::WA_Mapped, false);
else
@@ -8513,7 +8205,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous)
if (spontaneous) {
QApplication::sendSpontaneousEvent(widget, &e);
} else {
- QApplication::sendEvent(widget, &e);
+ QCoreApplication::sendEvent(widget, &e);
if (widget->internalWinId()
&& widget->testAttribute(Qt::WA_DontCreateNativeAncestors)) {
// hide_sys() on an ancestor won't have any affect on this
@@ -8548,7 +8240,7 @@ bool QWidgetPrivate::close_helper(CloseMode mode)
if (mode == CloseWithSpontaneousEvent)
QApplication::sendSpontaneousEvent(q, &e);
else
- QApplication::sendEvent(q, &e);
+ QCoreApplication::sendEvent(q, &e);
if (!that.isNull() && !e.isAccepted()) {
data.is_closing = 0;
return false;
@@ -8738,11 +8430,9 @@ QSize QWidgetPrivate::adjustedSize() const
s.setWidth(qMax(s.width(), 200));
if (exp & Qt::Vertical)
s.setHeight(qMax(s.height(), 100));
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- QRect screen = QDesktopWidgetPrivate::screenGeometry(q->x11Info().screen());
-#else // all others
+
QRect screen = QDesktopWidgetPrivate::screenGeometry(q->pos());
-#endif
+
s.setWidth(qMin(s.width(), screen.width()*2/3));
s.setHeight(qMin(s.height(), screen.height()*2/3));
@@ -8867,26 +8557,6 @@ bool QWidget::isAncestorOf(const QWidget *child) const
return false;
}
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-inline void setDisabledStyle(QWidget *w, bool setStyle)
-{
- // set/reset WS_DISABLED style.
- if(w && w->isWindow() && w->isVisible() && w->isEnabled()) {
- LONG dwStyle = GetWindowLong(w->winId(), GWL_STYLE);
- LONG newStyle = dwStyle;
- if (setStyle)
- newStyle |= WS_DISABLED;
- else
- newStyle &= ~WS_DISABLED;
- if (newStyle != dwStyle) {
- SetWindowLong(w->winId(), GWL_STYLE, newStyle);
- // we might need to repaint in some situations (eg. menu)
- w->repaint();
- }
- }
-}
-#endif
-
/*****************************************************************************
QWidget event handling
*****************************************************************************/
@@ -9063,7 +8733,7 @@ bool QWidget::event(QEvent *event)
setAttribute(Qt::WA_WState_Polished);
if (!QApplication::font(this).isCopyOf(QApplication::font()))
d->resolveFont();
- if (!QApplication::palette(this).isCopyOf(QApplication::palette()))
+ if (!QApplication::palette(this).isCopyOf(QGuiApplication::palette()))
d->resolvePalette();
}
break;
@@ -9087,7 +8757,7 @@ bool QWidget::event(QEvent *event)
#if QT_CONFIG(statustip)
if (d->statusTip.size()) {
QStatusTipEvent tip(d->statusTip);
- QApplication::sendEvent(const_cast<QWidget *>(this), &tip);
+ QCoreApplication::sendEvent(const_cast<QWidget *>(this), &tip);
}
#endif
enterEvent(event);
@@ -9098,7 +8768,7 @@ bool QWidget::event(QEvent *event)
if (d->statusTip.size()) {
QString empty;
QStatusTipEvent tip(empty);
- QApplication::sendEvent(const_cast<QWidget *>(this), &tip);
+ QCoreApplication::sendEvent(const_cast<QWidget *>(this), &tip);
}
#endif
leaveEvent(event);
@@ -9249,7 +8919,7 @@ bool QWidget::event(QEvent *event)
for (int i = 0; i < childList.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(childList.at(i));
if (w && w->isVisible() && !w->isWindow())
- QApplication::sendEvent(w, event);
+ QCoreApplication::sendEvent(w, event);
}
break; }
@@ -9260,7 +8930,7 @@ bool QWidget::event(QEvent *event)
for (int i = 0; i < childList.size(); ++i) {
QObject *o = childList.at(i);
if (o)
- QApplication::sendEvent(o, event);
+ QCoreApplication::sendEvent(o, event);
}
}
update();
@@ -9299,13 +8969,10 @@ bool QWidget::event(QEvent *event)
QWidget *w = static_cast<QWidget *>(o);
// do not forward the event to child windows; QApplication does this for us
if (!w->isWindow())
- QApplication::sendEvent(w, event);
+ QCoreApplication::sendEvent(w, event);
}
}
}
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- setDisabledStyle(this, (event->type() == QEvent::WindowBlocked));
-#endif
break;
#ifndef QT_NO_TOOLTIP
case QEvent::ToolTip:
@@ -9330,9 +8997,6 @@ bool QWidget::event(QEvent *event)
case QEvent::EmbeddingControl:
d->topData()->frameStrut.setCoords(0 ,0, 0, 0);
data->fstrut_dirty = false;
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */
- d->topData()->embedded = 1;
-#endif
break;
#ifndef QT_NO_ACTION
case QEvent::ActionAdded:
@@ -9351,15 +9015,10 @@ bool QWidget::event(QEvent *event)
for (int i = 0; i < childList.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(childList.at(i));
if (w && w->isVisible() && !w->isWindow())
- QApplication::sendEvent(w, event);
+ QCoreApplication::sendEvent(w, event);
}
break;
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- case QEvent::MacGLWindowChange:
- d->needWindowChange = false;
- break;
-#endif
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
@@ -9454,8 +9113,8 @@ void QWidget::changeEvent(QEvent * event)
break;
case QEvent::ThemeChange:
- if (QApplication::desktopSettingsAware() && windowType() != Qt::Desktop
- && qApp && !QApplication::closingDown()) {
+ if (QGuiApplication::desktopSettingsAware() && windowType() != Qt::Desktop
+ && qApp && !QCoreApplication::closingDown()) {
if (testAttribute(Qt::WA_WState_Polished))
QApplication::style()->unpolish(this);
if (testAttribute(Qt::WA_WState_Polished))
@@ -9471,11 +9130,6 @@ void QWidget::changeEvent(QEvent * event)
case QEvent::MacSizeChange:
updateGeometry();
break;
-#elif 0 // Used to be included in Qt4 for Q_WS_MAC
- case QEvent::ToolTipChange:
- case QEvent::MouseTrackingChange:
- qt_mac_update_mouseTracking(this);
- break;
#endif
default:
@@ -9568,9 +9222,11 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
The default implementation calls mousePressEvent().
\note The widget will also receive mouse press and mouse release
- events in addition to the double click event. It is up to the
- developer to ensure that the application interprets these events
- correctly.
+ events in addition to the double click event. And if another widget
+ that overlaps this widget disappears in response to press or
+ release events, then this widget will only receive the double click
+ event. It is up to the developer to ensure that the application
+ interprets these events correctly.
\sa mousePressEvent(), mouseReleaseEvent(), mouseMoveEvent(),
event(), QMouseEvent
@@ -10182,7 +9838,11 @@ void QWidget::hideEvent(QHideEvent *)
\endtable
*/
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QWidget::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)
+#endif
{
Q_UNUSED(eventType);
Q_UNUSED(message);
@@ -10397,7 +10057,7 @@ void QWidget::setSizePolicy(QSizePolicy policy)
d->size_policy = policy;
#if QT_CONFIG(graphicsview)
- if (QWExtra *extra = d->extra) {
+ if (const auto &extra = d->extra) {
if (extra->proxyWidget)
extra->proxyWidget->setSizePolicy(policy);
}
@@ -10518,7 +10178,7 @@ void QWidgetPrivate::updateGeometry_helper(bool forceUpdate)
if (parent->d_func()->layout)
parent->d_func()->layout->invalidate();
else if (parent->isVisible())
- QApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest));
+ QCoreApplication::postEvent(parent, new QEvent(QEvent::LayoutRequest));
}
}
}
@@ -10672,7 +10332,7 @@ static void sendWindowChangeToTextureChildrenRecursively(QWidget *widget)
QWidgetPrivate *d = QWidgetPrivate::get(widget);
if (d->renderToTexture) {
QEvent e(QEvent::WindowChangeInternal);
- QApplication::sendEvent(widget, &e);
+ QCoreApplication::sendEvent(widget, &e);
}
for (int i = 0; i < d->children.size(); ++i) {
@@ -10692,6 +10352,22 @@ static void sendWindowChangeToTextureChildrenRecursively(QWidget *widget)
void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
{
Q_D(QWidget);
+ Q_ASSERT_X(this != parent, Q_FUNC_INFO, "Cannot parent a QWidget to itself");
+#ifdef QT_DEBUG
+ const auto checkForParentChildLoops = qScopeGuard([&](){
+ int depth = 0;
+ auto p = parentWidget();
+ while (p) {
+ if (++depth == QObjectPrivate::CheckForParentChildLoopsWarnDepth) {
+ qWarning("QWidget %p (class: '%s', object name: '%s') may have a loop in its parent-child chain; "
+ "this is undefined behavior",
+ this, metaObject()->className(), qPrintable(objectName()));
+ }
+ p = p->parentWidget();
+ }
+ });
+#endif
+
bool resized = testAttribute(Qt::WA_Resized);
bool wasCreated = testAttribute(Qt::WA_WState_Created);
QWidget *oldtlw = window();
@@ -10705,7 +10381,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
bool newParent = (parent != parentWidget()) || !wasCreated || desktopWidget;
if (newParent && parent && !desktopWidget) {
- if (testAttribute(Qt::WA_NativeWindow) && !qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings))
+ if (testAttribute(Qt::WA_NativeWindow) && !QCoreApplication::testAttribute(Qt::AA_DontCreateNativeWidgetSiblings))
parent->d_func()->enforceNativeChildren();
else if (parent->d_func()->nativeChildrenForced() || parent->testAttribute(Qt::WA_PaintOnScreen))
setAttribute(Qt::WA_NativeWindow);
@@ -10718,22 +10394,14 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
}
if (newParent) {
QEvent e(QEvent::ParentAboutToChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
}
if (newParent && isAncestorOf(focusWidget()))
focusWidget()->clearFocus();
- QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData();
- QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStoreTracker : 0;
-
d->setParent_sys(parent, f);
- QTLWExtra *topExtra = window()->d_func()->maybeTopData();
- QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStoreTracker : 0;
- if (oldBsTracker && oldBsTracker != bsTracker)
- oldBsTracker->unregisterWidgetSubtree(this);
-
if (desktopWidget)
parent = 0;
@@ -10744,12 +10412,12 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
}
#endif
- if (QWidgetBackingStore *oldBs = oldtlw->d_func()->maybeBackingStore()) {
+ if (QWidgetRepaintManager *oldPaintManager = oldtlw->d_func()->maybeRepaintManager()) {
if (newParent)
- oldBs->removeDirtyWidget(this);
+ oldPaintManager->removeDirtyWidget(this);
// Move the widget and all its static children from
// the old backing store to the new one.
- oldBs->moveStaticWidgets(this);
+ oldPaintManager->moveStaticWidgets(this);
}
// ### fixme: Qt 6: Remove AA_ImmediateWidgetCreation.
@@ -10775,7 +10443,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
// (f & Qt::MSWindowsOwnDC) clause (which is set on QGLWidgets on all
// platforms).
if (newParent
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || defined(QT_OPENGL_ES)
+#if defined(QT_OPENGL_ES)
|| (f & Qt::MSWindowsOwnDC)
#endif
) {
@@ -10791,25 +10459,16 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
// send and post remaining QObject events
if (parent && d->sendChildEvents) {
QChildEvent e(QEvent::ChildAdded, this);
- QApplication::sendEvent(parent, &e);
+ QCoreApplication::sendEvent(parent, &e);
}
-//### already hidden above ---> must probably do something smart on the mac
-// #if 0 // Used to be included in Qt4 for Q_WS_MAC
-// extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp
-// if(!qt_mac_is_macdrawer(q)) //special case
-// q->setAttribute(Qt::WA_WState_Hidden);
-// #else
-// q->setAttribute(Qt::WA_WState_Hidden);
-//#endif
-
if (parent && d->sendChildEvents && d->polished) {
QChildEvent e(QEvent::ChildPolished, this);
QCoreApplication::sendEvent(parent, &e);
}
QEvent e(QEvent::ParentChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
#ifndef QT_NO_OPENGL
//renderToTexture widgets also need to know when their top-level window changes
@@ -11103,7 +10762,7 @@ void QWidgetPrivate::repaint(T r)
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore)
- tlwExtra->backingStoreTracker->markDirty(r, q, QWidgetBackingStore::UpdateNow);
+ tlwExtra->repaintManager->markDirty(r, q, QWidgetRepaintManager::UpdateNow);
}
/*!
@@ -11172,13 +10831,13 @@ void QWidgetPrivate::update(T r)
return;
if (q->testAttribute(Qt::WA_WState_InPaintEvent)) {
- QApplication::postEvent(q, new QUpdateLaterEvent(clipped));
+ QCoreApplication::postEvent(q, new QUpdateLaterEvent(clipped));
return;
}
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore)
- tlwExtra->backingStoreTracker->markDirty(clipped, q);
+ tlwExtra->repaintManager->markDirty(clipped, q);
}
/*!
@@ -11209,7 +10868,7 @@ void QWidgetPrivate::macUpdateSizeAttribute()
{
Q_Q(QWidget);
QEvent event(QEvent::MacSizeChange);
- QApplication::sendEvent(q, &event);
+ QCoreApplication::sendEvent(q, &event);
for (int i = 0; i < children.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(children.at(i));
if (w && (!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))
@@ -11265,7 +10924,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
else if (!on && (isWindow() || !parentWidget() || !parentWidget()->testAttribute(Qt::WA_DropSiteRegistered)))
setAttribute(Qt::WA_DropSiteRegistered, false);
QEvent e(QEvent::AcceptDropsChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
break;
}
case Qt::WA_DropSiteRegistered: {
@@ -11284,23 +10943,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
case Qt::WA_NoChildEventsFromChildren:
d->receiveChildEvents = !on;
break;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- case Qt::WA_MacOpaqueSizeGrip:
- d->macUpdateOpaqueSizeGrip();
- break;
- case Qt::WA_MacShowFocusRect:
- if (hasFocus()) {
- clearFocus();
- setFocus();
- }
- break;
- case Qt::WA_Hover:
- qt_mac_update_mouseTracking(this);
- break;
- case Qt::WA_MacAlwaysShowToolWindow:
- d->macUpdateHideOnSuspend();
- break;
-#endif
case Qt::WA_MacNormalSize:
case Qt::WA_MacSmallSize:
case Qt::WA_MacMiniSize:
@@ -11348,11 +10990,11 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
case Qt::WA_MouseTracking: {
QEvent e(QEvent::MouseTrackingChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
break; }
case Qt::WA_TabletTracking: {
QEvent e(QEvent::TabletTrackingChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
break; }
case Qt::WA_NativeWindow: {
d->createTLExtra();
@@ -11365,7 +11007,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
QGuiApplication::inputMethod()->commit();
QGuiApplication::inputMethod()->update(Qt::ImEnabled);
}
- if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget())
+ if (!QCoreApplication::testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget())
parentWidget()->d_func()->enforceNativeChildren();
if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created))
d->createWinId();
@@ -11378,15 +11020,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
}
case Qt::WA_PaintOnScreen:
d->updateIsOpaque();
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_X11 */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */
- // Recreate the widget if it's already created as an alien widget and
- // WA_PaintOnScreen is enabled. Paint on screen widgets must have win id.
- // So must their children.
- if (on) {
- setAttribute(Qt::WA_NativeWindow);
- d->enforceNativeChildren();
- }
-#endif
Q_FALLTHROUGH();
case Qt::WA_OpaquePaintEvent:
d->updateIsOpaque();
@@ -11398,9 +11031,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->updateSystemBackground();
break;
case Qt::WA_TransparentForMouseEvents:
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- d->macUpdateIgnoreMouseEvents();
-#endif
break;
case Qt::WA_InputMethodEnabled: {
#ifndef QT_NO_IM
@@ -11417,20 +11047,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
d->resolveFont();
d->resolveLocale();
break;
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- case Qt::WA_NoX11EventCompression:
- if (!d->extra)
- d->createExtra();
- d->extra->compress_events = on;
- break;
- case Qt::WA_X11OpenGLOverlay:
- d->updateIsOpaque();
- break;
- case Qt::WA_X11DoNotAcceptFocus:
- if (testAttribute(Qt::WA_WState_Created))
- d->updateX11AcceptFocus();
- break;
-#endif
case Qt::WA_DontShowOnScreen: {
if (on && isVisible()) {
// Make sure we keep the current state and only hide the widget
@@ -11459,11 +11075,11 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
case Qt::WA_StaticContents:
- if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
+ if (QWidgetRepaintManager *repaintManager = d->maybeRepaintManager()) {
if (on)
- bs->addStaticWidget(this);
+ repaintManager->addStaticWidget(this);
else
- bs->removeStaticWidget(this);
+ repaintManager->removeStaticWidget(this);
}
break;
case Qt::WA_TranslucentBackground:
@@ -11473,10 +11089,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
break;
case Qt::WA_AcceptTouchEvents:
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ || 0 /* Used to be included in Qt4 for Q_WS_MAC */
- if (on)
- d->registerTouchWindow();
-#endif
break;
default:
break;
@@ -11600,7 +11212,7 @@ void QWidget::setWindowModified(bool mod)
d->setWindowModified_helper();
QEvent e(QEvent::ModifiedChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
void QWidgetPrivate::setWindowModified_helper()
@@ -11646,7 +11258,7 @@ void QWidget::setToolTip(const QString &s)
d->toolTip = s;
QEvent event(QEvent::ToolTipChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
QString QWidget::toolTip() const
@@ -11823,7 +11435,7 @@ int QWidget::grabShortcut(const QKeySequence &key, Qt::ShortcutContext context)
if (key.isEmpty())
return 0;
setAttribute(Qt::WA_GrabbedShortcut);
- return qApp->d_func()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher);
+ return QGuiApplicationPrivate::instance()->shortcutMap.addShortcut(this, key, context, qWidgetShortcutContextMatcher);
}
/*!
@@ -11845,7 +11457,7 @@ void QWidget::releaseShortcut(int id)
{
Q_ASSERT(qApp);
if (id)
- qApp->d_func()->shortcutMap.removeShortcut(id, this, 0);
+ QGuiApplicationPrivate::instance()->shortcutMap.removeShortcut(id, this, 0);
}
/*!
@@ -11864,7 +11476,7 @@ void QWidget::setShortcutEnabled(int id, bool enable)
{
Q_ASSERT(qApp);
if (id)
- qApp->d_func()->shortcutMap.setShortcutEnabled(enable, id, this, 0);
+ QGuiApplicationPrivate::instance()->shortcutMap.setShortcutEnabled(enable, id, this, 0);
}
/*!
@@ -11879,7 +11491,7 @@ void QWidget::setShortcutAutoRepeat(int id, bool enable)
{
Q_ASSERT(qApp);
if (id)
- qApp->d_func()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0);
+ QGuiApplicationPrivate::instance()->shortcutMap.setShortcutAutoRepeat(enable, id, this, 0);
}
#endif // QT_NO_SHORTCUT
@@ -11934,7 +11546,7 @@ void QWidget::raise()
QWindowContainer::parentWasRaised(this);
QEvent e(QEvent::ZOrderChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
void QWidgetPrivate::raise_sys()
@@ -11984,7 +11596,7 @@ void QWidget::lower()
QWindowContainer::parentWasLowered(this);
QEvent e(QEvent::ZOrderChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
void QWidgetPrivate::lower_sys()
@@ -12031,7 +11643,7 @@ void QWidget::stackUnder(QWidget* w)
d->stackUnder_sys(w);
QEvent e(QEvent::ZOrderChange);
- QApplication::sendEvent(this, &e);
+ QCoreApplication::sendEvent(this, &e);
}
void QWidgetPrivate::stackUnder_sys(QWidget*)
@@ -12092,10 +11704,8 @@ QRect QWidgetPrivate::frameStrut() const
}
if (data.fstrut_dirty
-#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
// ### Fix properly for 4.3
&& q->isVisible()
-#endif
&& q->testAttribute(Qt::WA_WState_Created))
const_cast<QWidgetPrivate *>(this)->updateFrameStrut();
@@ -12268,14 +11878,14 @@ void QWidget::setBackingStore(QBackingStore *store)
deleteBackingStore(d);
topData->backingStore = store;
- QWidgetBackingStore *bs = d->maybeBackingStore();
- if (!bs)
+ QWidgetRepaintManager *repaintManager = d->maybeRepaintManager();
+ if (!repaintManager)
return;
if (isTopLevel()) {
- if (bs->store != oldStore && bs->store != store)
- delete bs->store;
- bs->store = store;
+ if (repaintManager->backingStore() != oldStore && repaintManager->backingStore() != store)
+ delete repaintManager->backingStore();
+ repaintManager->setBackingStore(store);
}
}
@@ -12291,9 +11901,8 @@ QBackingStore *QWidget::backingStore() const
if (extra && extra->backingStore)
return extra->backingStore;
- QWidgetBackingStore *bs = d->maybeBackingStore();
-
- return bs ? bs->store : 0;
+ QWidgetRepaintManager *repaintManager = d->maybeRepaintManager();
+ return repaintManager ? repaintManager->backingStore() : nullptr;
}
void QWidgetPrivate::getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const
@@ -12366,19 +11975,18 @@ QOpenGLContext *QWidgetPrivate::shareContext() const
#ifdef QT_NO_OPENGL
return 0;
#else
- if (Q_UNLIKELY(!extra || !extra->topextra || !extra->topextra->window))
+ if (!extra || !extra->topextra || !extra->topextra->window)
return 0;
- QWidgetPrivate *that = const_cast<QWidgetPrivate *>(this);
if (!extra->topextra->shareContext) {
- QOpenGLContext *ctx = new QOpenGLContext;
+ auto ctx = qt_make_unique<QOpenGLContext>();
ctx->setShareContext(qt_gl_global_share_context());
ctx->setFormat(extra->topextra->window->format());
ctx->setScreen(extra->topextra->window->screen());
ctx->create();
- that->extra->topextra->shareContext = ctx;
+ extra->topextra->shareContext = std::move(ctx);
}
- return that->extra->topextra->shareContext;
+ return extra->topextra->shareContext.get();
#endif // QT_NO_OPENGL
}
@@ -13024,10 +12632,8 @@ void QWidget::setMask(const QRegion &newMask)
d->extra->mask = newMask;
d->extra->hasMask = !newMask.isEmpty();
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
if (!testAttribute(Qt::WA_WState_Created))
return;
-#endif
d->setMask_sys(newMask);
@@ -13203,7 +12809,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
if (widget->isWindow())
debug << ", window";
debug << ", " << geometry.width() << 'x' << geometry.height()
- << forcesign << geometry.x() << geometry.y() << noforcesign;
+ << Qt::forcesign << geometry.x() << geometry.y() << Qt::noforcesign;
if (frameGeometry != geometry) {
const QMargins margins(geometry.x() - frameGeometry.x(),
geometry.y() - frameGeometry.y(),
@@ -13213,7 +12819,7 @@ QDebug operator<<(QDebug debug, const QWidget *widget)
}
debug << ", devicePixelRatio=" << widget->devicePixelRatioF();
if (const WId wid = widget->internalWinId())
- debug << ", winId=0x" << hex << wid << dec;
+ debug << ", winId=0x" << Qt::hex << wid << Qt::dec;
}
debug << ')';
} else {
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 4e5ef5a111..83a6e6d4b3 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -85,6 +85,7 @@ class QDragEnterEvent;
class QDragMoveEvent;
class QDragLeaveEvent;
class QDropEvent;
+class QScreen;
class QShowEvent;
class QHideEvent;
class QIcon;
@@ -524,7 +525,10 @@ public:
void setContentsMargins(int left, int top, int right, int bottom);
void setContentsMargins(const QMargins &margins);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("use contentsMargins()")
void getContentsMargins(int *left, int *top, int *right, int *bottom) const;
+#endif
QMargins contentsMargins() const;
QRect contentsRect() const;
@@ -555,7 +559,7 @@ public:
void addAction(QAction *action);
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
void addActions(const QList<QAction*> &actions);
- void insertActions(const QAction *before, const QList<QAction*> &actions);
+ void insertActions(QAction *before, const QList<QAction*> &actions);
#else
void addActions(QList<QAction*> actions);
void insertActions(QAction *before, QList<QAction*> actions);
@@ -598,6 +602,7 @@ public:
QBackingStore *backingStore() const;
QWindow *windowHandle() const;
+ QScreen *screen() const;
static QWidget *createWindowContainer(QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags());
@@ -648,7 +653,12 @@ protected:
virtual void showEvent(QShowEvent *event);
virtual void hideEvent(QHideEvent *event);
+
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
+#else
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result);
+#endif
// Misc. protected functions
virtual void changeEvent(QEvent *);
@@ -689,7 +699,7 @@ private:
QLayout *takeLayout();
friend class QBackingStoreDevice;
- friend class QWidgetBackingStore;
+ friend class QWidgetRepaintManager;
friend class QApplication;
friend class QApplicationPrivate;
friend class QGuiApplication;
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 3dccd00b8b..698928b0b0 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -75,15 +75,20 @@
#include <private/qgesture_p.h>
#include <qpa/qplatformbackingstore.h>
+#include <vector>
+#include <memory>
+
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcWidgetPainting);
+
// Extra QWidget data
// - to minimize memory usage for members that are seldom used.
// - top-level widgets have extra extra data to reduce cost further
class QWidgetWindow;
class QPaintEngine;
class QPixmap;
-class QWidgetBackingStore;
+class QWidgetRepaintManager;
class QGraphicsProxyWidget;
class QWidgetItemV2;
class QOpenGLContext;
@@ -113,60 +118,18 @@ protected:
QRegion m_region;
};
-
-
-class Q_AUTOTEST_EXPORT QWidgetBackingStoreTracker
-{
-
-public:
- QWidgetBackingStoreTracker();
- ~QWidgetBackingStoreTracker();
-
- void create(QWidget *tlw);
- void destroy();
-
- void registerWidget(QWidget *w);
- void unregisterWidget(QWidget *w);
- void unregisterWidgetSubtree(QWidget *w);
-
- inline QWidgetBackingStore* data()
- {
- return m_ptr;
- }
-
- inline QWidgetBackingStore* operator->()
- {
- return m_ptr;
- }
-
- inline QWidgetBackingStore& operator*()
- {
- return *m_ptr;
- }
-
- inline operator bool() const
- {
- return (0 != m_ptr);
- }
-
-private:
- Q_DISABLE_COPY_MOVE(QWidgetBackingStoreTracker)
-
-private:
- QWidgetBackingStore* m_ptr;
- QSet<QWidget *> m_widgets;
-};
-
struct QTLWExtra {
// *************************** Cross-platform variables *****************************
// Regular pointers (keep them together to avoid gaps on 64 bits architectures).
- QIcon *icon; // widget icon
- QWidgetBackingStoreTracker backingStoreTracker;
+ std::unique_ptr<QIcon> icon; // widget icon
+ std::unique_ptr<QWidgetRepaintManager> repaintManager;
QBackingStore *backingStore;
QPainter *sharedPainter;
QWidgetWindow *window;
- QOpenGLContext *shareContext;
+#ifndef QT_NO_OPENGL
+ mutable std::unique_ptr<QOpenGLContext> shareContext;
+#endif
// Implicit pointers (shared_null).
QString caption; // widget caption
@@ -184,7 +147,9 @@ struct QTLWExtra {
// ### TODO replace initialScreenIndex with QScreen *, in case the screens change at runtime
int initialScreenIndex; // Screen number when passing a QDesktop[Screen]Widget as parent.
- QVector<QPlatformTextureList *> widgetTextures;
+#ifndef QT_NO_OPENGL
+ std::vector<std::unique_ptr<QPlatformTextureList>> widgetTextures;
+#endif
// *************************** Cross-platform bit fields ****************************
uint opacity : 8;
@@ -192,41 +157,6 @@ struct QTLWExtra {
uint sizeAdjusted : 1;
uint inTopLevelResize : 1;
uint embedded : 1;
-
- // *************************** Platform specific values (bit fields first) **********
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11
- uint spont_unmapped: 1; // window was spontaneously unmapped
- uint dnd : 1; // DND properties installed
- uint validWMState : 1; // is WM_STATE valid?
- uint waitingForMapNotify : 1; // show() has been called, haven't got the MapNotify yet
- WId parentWinId; // parent window Id (valid after reparenting)
- WId userTimeWindow; // window id that contains user-time timestamp when WM supports a _NET_WM_USER_TIME_WINDOW atom
- QPoint fullScreenOffset;
-#ifndef QT_NO_XSYNC
- WId syncUpdateCounter;
- ulong syncRequestTimestamp;
- qint32 newCounterValueHi;
- quint32 newCounterValueLo;
-#endif
-#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN
- uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered.
- HICON winIconBig; // internal big Windows icon
- HICON winIconSmall; // internal small Windows icon
-#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC
- uint resizer : 4;
- uint isSetGeometry : 1;
- uint isMove : 1;
- quint32 wattr;
- quint32 wclass;
- WindowGroupRef group;
- IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys.
- quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys()
- // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and
- // manually resized.
- // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the
- // starting position as 0,0 instead of the normal starting position.
- bool wasMaximized;
-#endif
};
struct QWExtra {
@@ -234,12 +164,12 @@ struct QWExtra {
// Regular pointers (keep them together to avoid gaps on 64 bits architectures).
void *glContext; // if the widget is hijacked by QGLWindowSurface
- QTLWExtra *topextra; // only useful for TLWs
+ std::unique_ptr<QTLWExtra> topextra; // only useful for TLWs
#if QT_CONFIG(graphicsview)
QGraphicsProxyWidget *proxyWidget; // if the widget is embedded
#endif
#ifndef QT_NO_CURSOR
- QCursor *curs;
+ std::unique_ptr<QCursor> curs;
#endif
QPointer<QStyle> style;
QPointer<QWidget> focus_proxy;
@@ -265,21 +195,6 @@ struct QWExtra {
uint inRenderWithPainter : 1;
uint hasMask : 1;
uint hasWindowContainer : 1;
-
- // *************************** Platform specific values (bit fields first) **********
-#if 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <----------------------------------------------------------- WIN
-#if QT_CONFIG(draganddrop)
- QOleDropTarget *dropTarget; // drop target
- QList<QPointer<QWidget> > oleDropWidgets;
-#endif
-#elif 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <--------------------------------------------------------- X11
- uint compress_events : 1;
- WId xDndProxy; // XDND forwarding to embedded windows
-#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <------------------------------------------------------ MAC
- // Cocoa Mask stuff
- QImage maskBits;
- CGImageRef imageMask;
-#endif
};
/*!
@@ -303,10 +218,11 @@ static inline bool bypassGraphicsProxyWidget(const QWidget *p)
class Q_WIDGETS_EXPORT QWidgetPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QWidget)
+ Q_GADGET
public:
// *************************** Cross-platform ***************************************
- enum DrawWidgetFlags {
+ enum DrawWidgetFlag {
DrawAsRoot = 0x01,
DrawPaintOnScreen = 0x02,
DrawRecursive = 0x04,
@@ -316,12 +232,15 @@ public:
DontDrawNativeChildren = 0x40,
DontSetCompositionMode = 0x80
};
+ Q_DECLARE_FLAGS(DrawWidgetFlags, DrawWidgetFlag)
+ Q_FLAG(DrawWidgetFlags)
enum CloseMode {
CloseNoEvent,
CloseWithEvent,
CloseWithSpontaneousEvent
};
+ Q_ENUM(CloseMode)
enum Direction {
DirectionNorth = 0x01,
@@ -329,6 +248,7 @@ public:
DirectionSouth = 0x02,
DirectionWest = 0x20
};
+ Q_ENUM(Direction)
// Functions.
explicit QWidgetPrivate(int version = QObjectPrivateVersion);
@@ -342,8 +262,16 @@ public:
QTLWExtra *maybeTopData() const;
QPainter *sharedPainter() const;
void setSharedPainter(QPainter *painter);
- QWidgetBackingStore *maybeBackingStore() const;
- QWidgetWindow *windowHandle() const;
+ QWidgetRepaintManager *maybeRepaintManager() const;
+
+ enum class WindowHandleMode {
+ Direct,
+ Closest,
+ TopLevel
+ };
+ QWindow *windowHandle(WindowHandleMode mode = WindowHandleMode::Direct) const;
+
+ QScreen *associatedScreen() const;
template <typename T>
void repaint(T t);
@@ -405,38 +333,38 @@ public:
void setUpdatesEnabled_helper(bool );
bool updateBrushOrigin(QPainter *, const QBrush &brush) const;
- void paintBackground(QPainter *, const QRegion &, int flags = DrawAsRoot) const;
+ void paintBackground(QPainter *, const QRegion &, DrawWidgetFlags flags = DrawAsRoot) const;
bool isAboutToShow() const;
QRegion prepareToRender(const QRegion &region, QWidget::RenderFlags renderFlags);
void render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion,
QWidget::RenderFlags renderFlags);
void render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion,
QWidget::RenderFlags renderFlags);
- void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags,
- QPainter *sharedPainter = 0, QWidgetBackingStore *backingStore = 0);
+ void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags,
+ QPainter *sharedPainter = nullptr, QWidgetRepaintManager *repaintManager = nullptr);
void sendPaintEvent(const QRegion &toBePainted);
void paintSiblingsRecursive(QPaintDevice *pdev, const QObjectList& children, int index,
- const QRegion &rgn, const QPoint &offset, int flags,
- QPainter *sharedPainter, QWidgetBackingStore *backingStore);
+ const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags,
+ QPainter *sharedPainter, QWidgetRepaintManager *repaintManager);
#if QT_CONFIG(graphicsview)
static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin);
#endif
- void repaint_sys(const QRegion &rgn);
+ bool shouldPaintOnScreen() const;
+ void paintOnScreen(const QRegion &rgn);
QRect clipRect() const;
QRegion clipRegion() const;
void setSystemClip(QPaintEngine *paintEngine, qreal devicePixelRatio, const QRegion &region);
void subtractOpaqueChildren(QRegion &rgn, const QRect &clipRect) const;
- void subtractOpaqueSiblings(QRegion &source, bool *hasDirtySiblingsAbove = 0,
+ void subtractOpaqueSiblings(QRegion &source, bool *hasDirtySiblingsAbove = nullptr,
bool alsoNonOpaque = false) const;
void clipToEffectiveMask(QRegion &region) const;
void updateIsOpaque();
void setOpaque(bool opaque);
void updateIsTranslucent();
- bool paintOnScreen() const;
#if QT_CONFIG(graphicseffect)
void invalidateGraphicsEffectsRecursively();
#endif // QT_CONFIG(graphicseffect)
@@ -463,6 +391,8 @@ public:
void syncBackingStore();
void syncBackingStore(const QRegion &region);
+ bool shouldDiscardSyncRequest() const;
+
// tells the input method about the widgets transform
void updateWidgetTransform(QEvent *event);
@@ -527,7 +457,7 @@ public:
void getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const;
void setLayoutItemMargins(int left, int top, int right, int bottom);
- void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0);
+ void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = nullptr);
void updateContentsRect();
QMargins safeAreaMargins() const;
@@ -557,7 +487,7 @@ public:
QGraphicsProxyWidget *ancestorProxy = widget->d_func()->nearestGraphicsProxyWidget(widget);
//It's embedded if it has an ancestor
if (ancestorProxy) {
- if (!bypassGraphicsProxyWidget(widget) && ancestorProxy->scene() != 0) {
+ if (!bypassGraphicsProxyWidget(widget) && ancestorProxy->scene() != nullptr) {
// One view, let be smart and return the viewport rect then the popup is aligned
if (ancestorProxy->scene()->views().size() == 1) {
QGraphicsView *view = ancestorProxy->scene()->views().at(0);
@@ -588,7 +518,7 @@ public:
}
inline void restoreRedirected()
- { redirectDev = 0; }
+ { redirectDev = nullptr; }
inline void enforceNativeChildren()
{
@@ -654,7 +584,7 @@ public:
QOpenGLContext *shareContext() const;
- virtual QObject *focusObject() { return 0; }
+ virtual QObject *focusObject() { return nullptr; }
#ifndef QT_NO_OPENGL
virtual GLuint textureId() const { return 0; }
@@ -662,7 +592,7 @@ public:
Q_Q(QWidget);
return q->testAttribute(Qt::WA_AlwaysStackOnTop)
? QPlatformTextureList::StacksOnTop
- : QPlatformTextureList::Flags(0);
+ : QPlatformTextureList::Flags(nullptr);
}
virtual QImage grabFramebuffer() { return QImage(); }
virtual void beginBackingStorePainting() { }
@@ -698,7 +628,7 @@ public:
// Variables.
// Regular pointers (keep them together to avoid gaps on 64 bit architectures).
- QWExtra *extra;
+ std::unique_ptr<QWExtra> extra;
QWidget *focus_next;
QWidget *focus_prev;
QWidget *focus_child;
@@ -792,109 +722,8 @@ public:
// *************************** Platform specific ************************************
#if defined(Q_OS_WIN)
uint noPaintOnScreen : 1; // see qwidget.cpp ::paintEngine()
-#endif
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ // <----------------------------------------------------------- X11
- Qt::HANDLE picture;
- static QWidget *mouseGrabber;
- static QWidget *keyboardGrabber;
-
- void setWindowRole();
- void sendStartupMessage(const char *message) const;
- void x11UpdateIsOpaque();
- bool isBackgroundInherited() const;
- void updateX11AcceptFocus();
- QPoint mapToGlobal(const QPoint &pos) const;
- QPoint mapFromGlobal(const QPoint &pos) const;
-#elif 0 /* Used to be included in Qt4 for Q_WS_WIN */ // <--------------------------------------------------------- WIN
-#ifndef QT_NO_GESTURES
- uint nativeGesturePanEnabled : 1;
-#endif
- bool shouldShowMaximizeButton();
- void winUpdateIsOpaque();
- void reparentChildren();
-#if QT_CONFIG(draganddrop)
- QOleDropTarget *registerOleDnd(QWidget *widget);
- void unregisterOleDnd(QWidget *widget, QOleDropTarget *target);
-#endif
- void grabMouseWhileInWindow();
- void registerTouchWindow();
- void winSetupGestures();
-#elif defined(Q_OS_MAC) // <--------------------------------------------------------- MAC
+#elif defined(Q_OS_MAC)
void macUpdateSizeAttribute();
-#elif 0 /* Used to be included in Qt4 for Q_WS_MAC */ // <--------------------------------------------------------- MAC (old stuff)
- // This is new stuff
- uint needWindowChange : 1;
-
- // Each wiget keeps a list of all its child and grandchild OpenGL widgets.
- // This list is used to update the gl context whenever a parent and a granparent
- // moves, and also to check for intersections with gl widgets within the window
- // when a widget moves.
- struct GlWidgetInfo
- {
- GlWidgetInfo(QWidget *widget) : widget(widget), lastUpdateWidget(0) { }
- bool operator==(const GlWidgetInfo &other) const { return (widget == other.widget); }
- QWidget * widget;
- QWidget * lastUpdateWidget;
- };
-
- // dirtyOnWidget contains the areas in the widget that needs to be repained,
- // in the same way as dirtyOnScreen does for the window. Areas are added in
- // dirtyWidget_sys and cleared in the paint event. In scroll_sys we then use
- // this information repaint invalid areas when widgets are scrolled.
- QRegion dirtyOnWidget;
- EventHandlerRef window_event;
- QList<GlWidgetInfo> glWidgets;
-
- //these are here just for code compat (HIViews)
- Qt::HANDLE qd_hd;
-
- void macUpdateHideOnSuspend();
- void macUpdateOpaqueSizeGrip();
- void macUpdateIgnoreMouseEvents();
- void macUpdateMetalAttribute();
- void macUpdateIsOpaque();
- void macSetNeedsDisplay(QRegion region);
- void setEnabled_helper_sys(bool enable);
- bool isRealWindow() const;
- void adjustWithinMaxAndMinSize(int &w, int &h);
- void applyMaxAndMinSizeOnWindow();
- void update_sys(const QRect &rect);
- void update_sys(const QRegion &rgn);
- void setGeometry_sys_helper(int, int, int, int, bool);
- void updateMaximizeButton_sys();
- void createWindow_sys();
- void recreateMacWindow();
- void setSubWindowStacking(bool set);
- void setWindowLevel();
- void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef);
- void syncCocoaMask();
- void finishCocoaMaskSetup();
- // Did we add the drawRectOriginal method?
- bool drawRectOriginalAdded;
- // Is the original drawRect method available?
- bool originalDrawMethod;
- // Do we need to change the methods?
- bool changeMethods;
-
- // Unified toolbar variables
- bool isInUnifiedToolbar;
- QUnifiedToolbarSurface *unifiedSurface;
- QPoint toolbar_offset;
- QWidget *toolbar_ancestor;
- bool flushRequested;
- bool touchEventsEnabled;
- void determineWindowClass();
- void transferChildren();
- bool qt_mac_dnd_event(uint, DragRef);
- void toggleDrawers(bool);
- //mac event functions
- static bool qt_create_root_win();
- static void qt_clean_root_win();
- static bool qt_mac_update_sizer(QWidget *, int up = 0);
- static OSStatus qt_window_event(EventHandlerCallRef er, EventRef event, void *);
- static OSStatus qt_widget_event(EventHandlerCallRef er, EventRef event, void *);
- static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool);
- void registerTouchWindow(bool enable = true);
#endif
void setNetWmWindowTypes(bool skipIfMissing = false);
@@ -902,18 +731,20 @@ public:
bool stealMouseGrab(bool grab);
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QWidgetPrivate::DrawWidgetFlags)
+
struct QWidgetPaintContext
{
- inline QWidgetPaintContext(QPaintDevice *d, const QRegion &r, const QPoint &o, int f,
- QPainter *p, QWidgetBackingStore *b)
- : pdev(d), rgn(r), offset(o), flags(f), sharedPainter(p), backingStore(b), painter(0) {}
+ inline QWidgetPaintContext(QPaintDevice *d, const QRegion &r, const QPoint &o, QWidgetPrivate::DrawWidgetFlags f,
+ QPainter *p, QWidgetRepaintManager *rpm)
+ : pdev(d), rgn(r), offset(o), flags(f), sharedPainter(p), repaintManager(rpm), painter(nullptr) {}
QPaintDevice *pdev;
QRegion rgn;
QPoint offset;
- int flags;
+ QWidgetPrivate::DrawWidgetFlags flags;
QPainter *sharedPainter;
- QWidgetBackingStore *backingStore;
+ QWidgetRepaintManager *repaintManager;
QPainter *painter;
};
@@ -922,14 +753,14 @@ class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate
{
public:
QWidgetEffectSourcePrivate(QWidget *widget)
- : QGraphicsEffectSourcePrivate(), m_widget(widget), context(0), updateDueToGraphicsEffect(false)
+ : QGraphicsEffectSourcePrivate(), m_widget(widget), context(nullptr), updateDueToGraphicsEffect(false)
{}
void detach() override
- { m_widget->d_func()->graphicsEffect = 0; }
+ { m_widget->d_func()->graphicsEffect = nullptr; }
const QGraphicsItem *graphicsItem() const override
- { return 0; }
+ { return nullptr; }
const QWidget *widget() const override
{ return m_widget; }
@@ -955,7 +786,7 @@ public:
}
const QStyleOption *styleOption() const override
- { return 0; }
+ { return nullptr; }
QRect deviceRect() const override
{ return m_widget->window()->rect(); }
@@ -974,25 +805,25 @@ public:
inline QWExtra *QWidgetPrivate::extraData() const
{
- return extra;
+ return extra.get();
}
inline QTLWExtra *QWidgetPrivate::topData() const
{
const_cast<QWidgetPrivate *>(this)->createTLExtra();
- return extra->topextra;
+ return extra->topextra.get();
}
inline QTLWExtra *QWidgetPrivate::maybeTopData() const
{
- return extra ? extra->topextra : 0;
+ return extra ? extra->topextra.get() : nullptr;
}
inline QPainter *QWidgetPrivate::sharedPainter() const
{
Q_Q(const QWidget);
QTLWExtra *x = q->window()->d_func()->maybeTopData();
- return x ? x->sharedPainter : 0;
+ return x ? x->sharedPainter : nullptr;
}
inline void QWidgetPrivate::setSharedPainter(QPainter *painter)
@@ -1009,18 +840,11 @@ inline bool QWidgetPrivate::pointInsideRectAndMask(const QPoint &p) const
|| extra->mask.contains(p));
}
-inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const
+inline QWidgetRepaintManager *QWidgetPrivate::maybeRepaintManager() const
{
Q_Q(const QWidget);
QTLWExtra *x = q->window()->d_func()->maybeTopData();
- return x ? x->backingStoreTracker.data() : 0;
-}
-
-inline QWidgetWindow *QWidgetPrivate::windowHandle() const
-{
- if (QTLWExtra *x = maybeTopData())
- return x->window;
- return nullptr;
+ return x ? x->repaintManager.get() : nullptr;
}
QT_END_NAMESPACE
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
deleted file mode 100644
index 4d15ab138e..0000000000
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWidgets module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWIDGETBACKINGSTORE_P_H
-#define QWIDGETBACKINGSTORE_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 <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <QDebug>
-#include <QtWidgets/qwidget.h>
-#include <private/qwidget_p.h>
-#include <QtGui/qbackingstore.h>
-
-QT_BEGIN_NAMESPACE
-
-class QPlatformTextureList;
-class QPlatformTextureListWatcher;
-class QWidgetBackingStore;
-
-struct BeginPaintInfo {
- inline BeginPaintInfo() : wasFlushed(0), nothingToPaint(0), backingStoreRecreated(0) {}
- uint wasFlushed : 1;
- uint nothingToPaint : 1;
- uint backingStoreRecreated : 1;
-};
-
-#ifndef QT_NO_OPENGL
-class QPlatformTextureListWatcher : public QObject
-{
- Q_OBJECT
-
-public:
- QPlatformTextureListWatcher(QWidgetBackingStore *backingStore);
- void watch(QPlatformTextureList *textureList);
- bool isLocked() const;
-
-private slots:
- void onLockStatusChanged(bool locked);
-
-private:
- QHash<QPlatformTextureList *, bool> m_locked;
- QWidgetBackingStore *m_backingStore;
-};
-#endif
-
-class Q_AUTOTEST_EXPORT QWidgetBackingStore
-{
-public:
- enum UpdateTime {
- UpdateNow,
- UpdateLater
- };
-
- enum BufferState{
- BufferValid,
- BufferInvalid
- };
-
- QWidgetBackingStore(QWidget *t);
- ~QWidgetBackingStore();
-
- static void showYellowThing(QWidget *widget, const QRegion &rgn, int msec, bool);
-
- void sync(QWidget *exposedWidget, const QRegion &exposedRegion);
- void sync();
- void flush(QWidget *widget = 0);
-
- QBackingStore *backingStore() const { return store; }
-
- inline bool isDirty() const
- {
- return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && dirtyRenderToTextureWidgets.isEmpty());
- }
-
- template <class T>
- void markDirty(const T &r, QWidget *widget, UpdateTime updateTime = UpdateLater,
- BufferState bufferState = BufferValid);
-
-private:
- QWidget *tlw;
- QRegion dirtyOnScreen; // needsFlush
- QRegion dirty; // needsRepaint
- QRegion dirtyFromPreviousSync;
- QVector<QWidget *> dirtyWidgets;
- QVector<QWidget *> dirtyRenderToTextureWidgets;
- QVector<QWidget *> *dirtyOnScreenWidgets;
- QList<QWidget *> staticWidgets;
- QBackingStore *store;
- uint updateRequestSent : 1;
-
- QPlatformTextureListWatcher *textureListWatcher;
- QElapsedTimer perfTime;
- int perfFrames;
-
- void sendUpdateRequest(QWidget *widget, UpdateTime updateTime);
-
- static bool flushPaint(QWidget *widget, const QRegion &rgn);
- static void unflushPaint(QWidget *widget, const QRegion &rgn);
- static void qt_flush(QWidget *widget, const QRegion &region, QBackingStore *backingStore,
- QWidget *tlw,
- QPlatformTextureList *widgetTextures,
- QWidgetBackingStore *widgetBackingStore);
-
- void doSync();
- bool bltRect(const QRect &rect, int dx, int dy, QWidget *widget);
- void releaseBuffer();
-
- void beginPaint(QRegion &toClean, QWidget *widget, QBackingStore *backingStore,
- BeginPaintInfo *returnInfo, bool toCleanIsInTopLevelCoordinates = true);
- void endPaint(const QRegion &cleaned, QBackingStore *backingStore, BeginPaintInfo *beginPaintInfo);
-
- QRegion dirtyRegion(QWidget *widget = 0) const;
- QRegion staticContents(QWidget *widget = 0, const QRect &withinClipRect = QRect()) const;
-
- void markDirtyOnScreen(const QRegion &dirtyOnScreen, QWidget *widget, const QPoint &topLevelOffset);
-
- void removeDirtyWidget(QWidget *w);
-
- void updateLists(QWidget *widget);
-
- bool syncAllowed();
-
- inline void addDirtyWidget(QWidget *widget, const QRegion &rgn)
- {
- if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {
- QWidgetPrivate *widgetPrivate = widget->d_func();
-#if QT_CONFIG(graphicseffect)
- if (widgetPrivate->graphicsEffect)
- widgetPrivate->dirty = widgetPrivate->effectiveRectFor(rgn.boundingRect());
- else
-#endif // QT_CONFIG(graphicseffect)
- widgetPrivate->dirty = rgn;
- dirtyWidgets.append(widget);
- widgetPrivate->inDirtyList = true;
- }
- }
-
- inline void addDirtyRenderToTextureWidget(QWidget *widget)
- {
- if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {
- QWidgetPrivate *widgetPrivate = widget->d_func();
- Q_ASSERT(widgetPrivate->renderToTexture);
- dirtyRenderToTextureWidgets.append(widget);
- widgetPrivate->inDirtyList = true;
- }
- }
-
- inline void dirtyWidgetsRemoveAll(QWidget *widget)
- {
- int i = 0;
- while (i < dirtyWidgets.size()) {
- if (dirtyWidgets.at(i) == widget)
- dirtyWidgets.remove(i);
- else
- ++i;
- }
- }
-
- inline void addStaticWidget(QWidget *widget)
- {
- if (!widget)
- return;
-
- Q_ASSERT(widget->testAttribute(Qt::WA_StaticContents));
- if (!staticWidgets.contains(widget))
- staticWidgets.append(widget);
- }
-
- inline void removeStaticWidget(QWidget *widget)
- { staticWidgets.removeAll(widget); }
-
- // Move the reparented widget and all its static children from this backing store
- // to the new backing store if reparented into another top-level / backing store.
- inline void moveStaticWidgets(QWidget *reparented)
- {
- Q_ASSERT(reparented);
- QWidgetBackingStore *newBs = reparented->d_func()->maybeBackingStore();
- if (newBs == this)
- return;
-
- int i = 0;
- while (i < staticWidgets.size()) {
- QWidget *w = staticWidgets.at(i);
- if (reparented == w || reparented->isAncestorOf(w)) {
- staticWidgets.removeAt(i);
- if (newBs)
- newBs->addStaticWidget(w);
- } else {
- ++i;
- }
- }
- }
-
- inline QRect topLevelRect() const
- {
- return tlw->data->crect;
- }
-
- inline void appendDirtyOnScreenWidget(QWidget *widget)
- {
- if (!widget)
- return;
-
- if (!dirtyOnScreenWidgets) {
- dirtyOnScreenWidgets = new QVector<QWidget *>;
- dirtyOnScreenWidgets->append(widget);
- } else if (!dirtyOnScreenWidgets->contains(widget)) {
- dirtyOnScreenWidgets->append(widget);
- }
- }
-
- inline void dirtyOnScreenWidgetsRemoveAll(QWidget *widget)
- {
- if (!widget || !dirtyOnScreenWidgets)
- return;
-
- int i = 0;
- while (i < dirtyOnScreenWidgets->size()) {
- if (dirtyOnScreenWidgets->at(i) == widget)
- dirtyOnScreenWidgets->remove(i);
- else
- ++i;
- }
- }
-
- inline void resetWidget(QWidget *widget)
- {
- if (widget) {
- widget->d_func()->inDirtyList = false;
- widget->d_func()->isScrolled = false;
- widget->d_func()->isMoved = false;
- widget->d_func()->dirty = QRegion();
- }
- }
-
- inline void updateStaticContentsSize()
- {
- for (int i = 0; i < staticWidgets.size(); ++i) {
- QWidgetPrivate *wd = staticWidgets.at(i)->d_func();
- if (!wd->extra)
- wd->createExtra();
- wd->extra->staticContentsSize = wd->data.crect.size();
- }
- }
-
- inline bool hasStaticContents() const
- {
-#if defined(Q_OS_WIN)
- return !staticWidgets.isEmpty();
-#else
- return !staticWidgets.isEmpty() && false;
-#endif
- }
-
- friend QRegion qt_dirtyRegion(QWidget *);
- friend class QWidgetPrivate;
- friend class QWidget;
- friend class QBackingStore;
-
- Q_DISABLE_COPY_MOVE(QWidgetBackingStore)
-};
-
-QT_END_NAMESPACE
-
-#endif // QBACKINGSTORE_P_H
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp
index c51527f8bc..c3211e275f 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp
@@ -40,7 +40,7 @@
#include "qplatformdefs.h"
-#include "qwidgetbackingstore_p.h"
+#include "qwidgetrepaintmanager_p.h"
#include <QtCore/qglobal.h>
#include <QtCore/qdebug.h>
@@ -63,459 +63,138 @@
#include <qpa/qplatformbackingstore.h>
-#if defined(Q_OS_WIN) && !defined(QT_NO_PAINT_DEBUG)
-# include <QtCore/qt_windows.h>
-# include <qpa/qplatformnativeinterface.h>
-#endif
+#include <private/qmemory_p.h>
QT_BEGIN_NAMESPACE
-extern QRegion qt_dirtyRegion(QWidget *);
-
#ifndef QT_NO_OPENGL
Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
-#endif
-static bool hasPlatformWindow(QWidget *widget)
-{
- return widget && widget->windowHandle() && widget->windowHandle()->handle();
-}
-
-/**
- * Flushes the contents of the \a backingStore into the screen area of \a widget.
- * \a region is the region to be updated in \a widget coordinates.
- */
-void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBackingStore *backingStore,
- QWidget *tlw, QPlatformTextureList *widgetTextures,
- QWidgetBackingStore *widgetBackingStore)
+// Watches one or more QPlatformTextureLists for changes in the lock state and
+// triggers a backingstore sync when all the registered lists turn into
+// unlocked state. This is essential when a custom composeAndFlush()
+// implementation in a platform plugin is not synchronous and keeps
+// holding on to the textures for some time even after returning from there.
+class QPlatformTextureListWatcher : public QObject
{
-#ifdef QT_NO_OPENGL
- Q_UNUSED(widgetTextures);
- Q_ASSERT(!region.isEmpty());
-#else
- Q_ASSERT(!region.isEmpty() || widgetTextures);
-#endif
- Q_ASSERT(widget);
- Q_ASSERT(backingStore);
- Q_ASSERT(tlw);
-#if !defined(QT_NO_PAINT_DEBUG)
- static int flushUpdate = qEnvironmentVariableIntValue("QT_FLUSH_UPDATE");
- if (flushUpdate > 0)
- QWidgetBackingStore::showYellowThing(widget, region, flushUpdate * 10, false);
-#endif
-
- if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen))
- return;
-
- // Foreign Windows do not have backing store content and must not be flushed
- if (QWindow *widgetWindow = widget->windowHandle()) {
- if (widgetWindow->type() == Qt::ForeignWindow)
- return;
+ Q_OBJECT
+public:
+ QPlatformTextureListWatcher(QWidgetRepaintManager *repaintManager)
+ : m_repaintManager(repaintManager) {}
+
+ void watch(QPlatformTextureList *textureList) {
+ connect(textureList, SIGNAL(locked(bool)), SLOT(onLockStatusChanged(bool)));
+ m_locked[textureList] = textureList->isLocked();
}
- static bool fpsDebug = qEnvironmentVariableIntValue("QT_DEBUG_FPS");
- if (fpsDebug) {
- if (!widgetBackingStore->perfFrames++)
- widgetBackingStore->perfTime.start();
- if (widgetBackingStore->perfTime.elapsed() > 5000) {
- double fps = double(widgetBackingStore->perfFrames * 1000) / widgetBackingStore->perfTime.restart();
- qDebug("FPS: %.1f\n", fps);
- widgetBackingStore->perfFrames = 0;
+ bool isLocked() const {
+ foreach (bool v, m_locked) {
+ if (v)
+ return true;
}
+ return false;
}
- QPoint offset;
- if (widget != tlw)
- offset += widget->mapTo(tlw, QPoint());
-
- QRegion effectiveRegion = region;
-#ifndef QT_NO_OPENGL
- const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive;
- if (!widgetTextures) {
- widget->d_func()->renderToTextureComposeActive = false;
- // Detect the case of falling back to the normal flush path when no
- // render-to-texture widgets are visible anymore. We will force one
- // last flush to go through the OpenGL-based composition to prevent
- // artifacts. The next flush after this one will use the normal path.
- if (compositionWasActive)
- widgetTextures = qt_dummy_platformTextureList;
- } else {
- widget->d_func()->renderToTextureComposeActive = true;
- }
- // When changing the composition status, make sure the dirty region covers
- // the entire widget. Just having e.g. the shown/hidden render-to-texture
- // widget's area marked as dirty is incorrect when changing flush paths.
- if (compositionWasActive != widget->d_func()->renderToTextureComposeActive)
- effectiveRegion = widget->rect();
-
- // re-test since we may have been forced to this path via the dummy texture list above
- if (widgetTextures) {
- qt_window_private(tlw->windowHandle())->compositing = true;
- widget->window()->d_func()->sendComposeStatus(widget->window(), false);
- // A window may have alpha even when the app did not request
- // WA_TranslucentBackground. Therefore the compositor needs to know whether the app intends
- // to rely on translucency, in order to decide if it should clear to transparent or opaque.
- const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground);
- backingStore->handle()->composeAndFlush(widget->windowHandle(), effectiveRegion, offset,
- widgetTextures, translucentBackground);
- widget->window()->d_func()->sendComposeStatus(widget->window(), true);
- } else
-#endif
- backingStore->flush(effectiveRegion, widget->windowHandle(), offset);
-}
-
-#ifndef QT_NO_PAINT_DEBUG
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-
-static void showYellowThing_win(QWidget *widget, const QRegion &region, int msec)
-{
- // We expect to be passed a native parent.
- QWindow *nativeWindow = widget->windowHandle();
- if (!nativeWindow)
- return;
- void *hdcV = QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("getDC"), nativeWindow);
- if (!hdcV)
- return;
- const HDC hdc = reinterpret_cast<HDC>(hdcV);
-
- static const COLORREF colors[] = {RGB(255, 255, 0), RGB(255, 200, 55), RGB(200, 255, 55), RGB(200, 200, 0)};
-
- static size_t i = 0;
- const HBRUSH brush = CreateSolidBrush(colors[i]);
- i = (i + 1) % (sizeof(colors) / sizeof(colors[0]));
-
- for (const QRect &rect : region) {
- RECT winRect;
- SetRect(&winRect, rect.left(), rect.top(), rect.right(), rect.bottom());
- FillRect(hdc, &winRect, brush);
- }
- DeleteObject(brush);
- QGuiApplication::platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("releaseDC"), nativeWindow);
- ::Sleep(msec);
-}
-#endif // defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-
-void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped)
-{
-#ifdef Q_OS_WINRT
- Q_UNUSED(msec)
+private slots:
+ void onLockStatusChanged(bool locked) {
+ QPlatformTextureList *tl = static_cast<QPlatformTextureList *>(sender());
+ m_locked[tl] = locked;
+ if (!isLocked())
+ m_repaintManager->sync();
+ }
+
+private:
+ QHash<QPlatformTextureList *, bool> m_locked;
+ QWidgetRepaintManager *m_repaintManager;
+};
#endif
- QRegion paintRegion = toBePainted;
- QRect widgetRect = widget->rect();
-
- if (!hasPlatformWindow(widget)) {
- QWidget *nativeParent = widget->nativeParentWidget();
- const QPoint offset = widget->mapTo(nativeParent, QPoint(0, 0));
- paintRegion.translate(offset);
- widgetRect.translate(offset);
- widget = nativeParent;
- }
-
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
- Q_UNUSED(unclipped);
- showYellowThing_win(widget, paintRegion, msec);
-#else
- //flags to fool painter
- bool paintUnclipped = widget->testAttribute(Qt::WA_PaintUnclipped);
- if (unclipped && !widget->d_func()->paintOnScreen())
- widget->setAttribute(Qt::WA_PaintUnclipped);
-
- const bool setFlag = !widget->testAttribute(Qt::WA_WState_InPaintEvent);
- if (setFlag)
- widget->setAttribute(Qt::WA_WState_InPaintEvent);
-
- //setup the engine
- QPaintEngine *pe = widget->paintEngine();
- if (pe) {
- pe->setSystemClip(paintRegion);
- {
- QPainter p(widget);
- p.setClipRegion(paintRegion);
- static int i = 0;
- switch (i) {
- case 0:
- p.fillRect(widgetRect, QColor(255,255,0));
- break;
- case 1:
- p.fillRect(widgetRect, QColor(255,200,55));
- break;
- case 2:
- p.fillRect(widgetRect, QColor(200,255,55));
- break;
- case 3:
- p.fillRect(widgetRect, QColor(200,200,0));
- break;
- }
- i = (i+1) & 3;
- p.end();
- }
- }
- if (setFlag)
- widget->setAttribute(Qt::WA_WState_InPaintEvent, false);
-
- //restore
- widget->setAttribute(Qt::WA_PaintUnclipped, paintUnclipped);
-
- if (pe)
- pe->setSystemClip(QRegion());
-
-#if defined(Q_OS_UNIX)
- ::usleep(1000 * msec);
-#endif
-#endif // !Q_OS_WIN
-}
+// ---------------------------------------------------------------------------
-bool QWidgetBackingStore::flushPaint(QWidget *widget, const QRegion &rgn)
+QWidgetRepaintManager::QWidgetRepaintManager(QWidget *topLevel)
+ : tlw(topLevel), store(tlw->backingStore())
{
- if (!widget)
- return false;
-
- int delay = 0;
- if (widget->testAttribute(Qt::WA_WState_InPaintEvent)) {
- static int flushPaintEvent = qEnvironmentVariableIntValue("QT_FLUSH_PAINT_EVENT");
- if (!flushPaintEvent)
- return false;
- delay = flushPaintEvent;
- } else {
- static int flushPaint = qEnvironmentVariableIntValue("QT_FLUSH_PAINT");
- if (!flushPaint)
- return false;
- delay = flushPaint;
- }
+ Q_ASSERT(store);
- QWidgetBackingStore::showYellowThing(widget, rgn, delay * 10, true);
- return true;
+ // Ensure all existing subsurfaces and static widgets are added to their respective lists.
+ updateLists(topLevel);
}
-void QWidgetBackingStore::unflushPaint(QWidget *widget, const QRegion &rgn)
+void QWidgetRepaintManager::updateLists(QWidget *cur)
{
- if (widget->d_func()->paintOnScreen() || rgn.isEmpty())
- return;
-
- QWidget *tlw = widget->window();
- QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
- if (!tlwExtra)
+ if (!cur)
return;
- qt_flush(widget, rgn, tlwExtra->backingStoreTracker->store, tlw, 0, tlw->d_func()->maybeBackingStore());
-}
-#endif // QT_NO_PAINT_DEBUG
-
-/*
- Moves the whole rect by (dx, dy) in widget's coordinate system.
- Doesn't generate any updates.
-*/
-bool QWidgetBackingStore::bltRect(const QRect &rect, int dx, int dy, QWidget *widget)
-{
- const QPoint pos(widget->mapTo(tlw, rect.topLeft()));
- const QRect tlwRect(QRect(pos, rect.size()));
- if (dirty.intersects(tlwRect))
- return false; // We don't want to scroll junk.
- return store->scroll(tlwRect, dx, dy);
-}
-
-void QWidgetBackingStore::releaseBuffer()
-{
- if (store)
- store->resize(QSize());
-}
-
-/*!
- Prepares the window surface to paint a\ toClean region of the \a widget and
- updates the BeginPaintInfo struct accordingly.
-
- The \a toClean region might be clipped by the window surface.
-*/
-void QWidgetBackingStore::beginPaint(QRegion &toClean, QWidget *widget, QBackingStore *backingStore,
- BeginPaintInfo *returnInfo, bool toCleanIsInTopLevelCoordinates)
-{
- Q_UNUSED(widget);
- Q_UNUSED(toCleanIsInTopLevelCoordinates);
-
- // Always flush repainted areas.
- dirtyOnScreen += toClean;
-
-#ifdef QT_NO_PAINT_DEBUG
- backingStore->beginPaint(toClean);
-#else
- returnInfo->wasFlushed = QWidgetBackingStore::flushPaint(tlw, toClean);
- // Avoid deadlock with QT_FLUSH_PAINT: the server will wait for
- // the BackingStore lock, so if we hold that, the server will
- // never release the Communication lock that we are waiting for in
- // sendSynchronousCommand
- if (!returnInfo->wasFlushed)
- backingStore->beginPaint(toClean);
-#endif
-
- Q_UNUSED(returnInfo);
-}
+ QList<QObject*> children = cur->children();
+ for (int i = 0; i < children.size(); ++i) {
+ QWidget *child = qobject_cast<QWidget*>(children.at(i));
+ if (!child || child->isWindow())
+ continue;
-void QWidgetBackingStore::endPaint(const QRegion &cleaned, QBackingStore *backingStore,
- BeginPaintInfo *beginPaintInfo)
-{
-#ifndef QT_NO_PAINT_DEBUG
- if (!beginPaintInfo->wasFlushed)
- backingStore->endPaint();
- else
- QWidgetBackingStore::unflushPaint(tlw, cleaned);
-#else
- Q_UNUSED(beginPaintInfo);
- Q_UNUSED(cleaned);
- backingStore->endPaint();
-#endif
+ updateLists(child);
+ }
- flush();
+ if (cur->testAttribute(Qt::WA_StaticContents))
+ addStaticWidget(cur);
}
-/*!
- Returns the region (in top-level coordinates) that needs repaint and/or flush.
-
- If the widget is non-zero, only the dirty region for the widget is returned
- and the region will be in widget coordinates.
-*/
-QRegion QWidgetBackingStore::dirtyRegion(QWidget *widget) const
+QWidgetRepaintManager::~QWidgetRepaintManager()
{
- const bool widgetDirty = widget && widget != tlw;
- const QRect tlwRect(topLevelRect());
- const QRect surfaceGeometry(tlwRect.topLeft(), store->size());
- if (surfaceGeometry != tlwRect && surfaceGeometry.size() != tlwRect.size()) {
- if (widgetDirty) {
- const QRect dirtyTlwRect = QRect(QPoint(), tlwRect.size());
- const QPoint offset(widget->mapTo(tlw, QPoint()));
- const QRect dirtyWidgetRect(dirtyTlwRect & widget->rect().translated(offset));
- return dirtyWidgetRect.translated(-offset);
- }
- return QRect(QPoint(), tlwRect.size());
- }
-
- // Calculate the region that needs repaint.
- QRegion r(dirty);
- for (int i = 0; i < dirtyWidgets.size(); ++i) {
- QWidget *w = dirtyWidgets.at(i);
- if (widgetDirty && w != widget && !widget->isAncestorOf(w))
- continue;
- r += w->d_func()->dirty.translated(w->mapTo(tlw, QPoint()));
- }
-
- // Append the region that needs flush.
- r += dirtyOnScreen;
-
- if (dirtyOnScreenWidgets) { // Only in use with native child widgets.
- for (int i = 0; i < dirtyOnScreenWidgets->size(); ++i) {
- QWidget *w = dirtyOnScreenWidgets->at(i);
- if (widgetDirty && w != widget && !widget->isAncestorOf(w))
- continue;
- QWidgetPrivate *wd = w->d_func();
- Q_ASSERT(wd->needsFlush);
- r += wd->needsFlush->translated(w->mapTo(tlw, QPoint()));
- }
- }
-
- if (widgetDirty) {
- // Intersect with the widget geometry and translate to its coordinates.
- const QPoint offset(widget->mapTo(tlw, QPoint()));
- r &= widget->rect().translated(offset);
- r.translate(-offset);
- }
- return r;
+ for (int c = 0; c < dirtyWidgets.size(); ++c)
+ resetWidget(dirtyWidgets.at(c));
+ for (int c = 0; c < dirtyRenderToTextureWidgets.size(); ++c)
+ resetWidget(dirtyRenderToTextureWidgets.at(c));
}
/*!
- Returns the static content inside the \a parent if non-zero; otherwise the static content
- for the entire backing store is returned. The content will be clipped to \a withinClipRect
- if non-empty.
+ \internal
+ Invalidates the \a r (in widget's coordinates) of the backing store, i.e.
+ all widgets intersecting with the region will be repainted when the backing
+ store is synced.
*/
-QRegion QWidgetBackingStore::staticContents(QWidget *parent, const QRect &withinClipRect) const
+template <class T>
+void QWidgetPrivate::invalidateBackingStore(const T &r)
{
- if (!parent && tlw->testAttribute(Qt::WA_StaticContents)) {
- const QSize surfaceGeometry(store->size());
- QRect surfaceRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height());
- if (!withinClipRect.isEmpty())
- surfaceRect &= withinClipRect;
- return QRegion(surfaceRect);
- }
-
- QRegion region;
- if (parent && parent->d_func()->children.isEmpty())
- return region;
-
- const bool clipToRect = !withinClipRect.isEmpty();
- const int count = staticWidgets.count();
- for (int i = 0; i < count; ++i) {
- QWidget *w = staticWidgets.at(i);
- QWidgetPrivate *wd = w->d_func();
- if (!wd->isOpaque || !wd->extra || wd->extra->staticContentsSize.isEmpty()
- || !w->isVisible() || (parent && !parent->isAncestorOf(w))) {
- continue;
- }
-
- QRect rect(0, 0, wd->extra->staticContentsSize.width(), wd->extra->staticContentsSize.height());
- const QPoint offset = w->mapTo(parent ? parent : tlw, QPoint());
- if (clipToRect)
- rect &= withinClipRect.translated(-offset);
- if (rect.isEmpty())
- continue;
-
- rect &= wd->clipRect();
- if (rect.isEmpty())
- continue;
+ if (r.isEmpty())
+ return;
- QRegion visible(rect);
- wd->clipToEffectiveMask(visible);
- if (visible.isEmpty())
- continue;
- wd->subtractOpaqueSiblings(visible, 0, /*alsoNonOpaque=*/true);
+ if (QCoreApplication::closingDown())
+ return;
- visible.translate(offset);
- region += visible;
- }
+ Q_Q(QWidget);
+ if (!q->isVisible() || !q->updatesEnabled())
+ return;
- return region;
-}
+ QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
+ if (!tlwExtra || tlwExtra->inTopLevelResize || !tlwExtra->backingStore)
+ return;
-void QWidgetBackingStore::sendUpdateRequest(QWidget *widget, UpdateTime updateTime)
-{
- if (!widget)
+ T clipped(r);
+ clipped &= clipRect();
+ if (clipped.isEmpty())
return;
-#ifndef QT_NO_OPENGL
- // Having every repaint() leading to a sync/flush is bad as it causes
- // compositing and waiting for vsync each and every time. Change to
- // UpdateLater, except for approx. once per frame to prevent starvation in
- // case the control does not get back to the event loop.
- QWidget *w = widget->window();
- if (updateTime == UpdateNow && w && w->windowHandle() && QWindowPrivate::get(w->windowHandle())->compositing) {
- int refresh = 60;
- QScreen *ws = w->windowHandle()->screen();
- if (ws)
- refresh = ws->refreshRate();
- QWindowPrivate *wd = QWindowPrivate::get(w->windowHandle());
- if (wd->lastComposeTime.isValid()) {
- const qint64 elapsed = wd->lastComposeTime.elapsed();
- if (elapsed <= qint64(1000.0f / refresh))
- updateTime = UpdateLater;
- }
- }
-#endif
+ if (!graphicsEffect && extra && extra->hasMask) {
+ QRegion masked(extra->mask);
+ masked &= clipped;
+ if (masked.isEmpty())
+ return;
- switch (updateTime) {
- case UpdateLater:
- updateRequestSent = true;
- QApplication::postEvent(widget, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
- break;
- case UpdateNow: {
- QEvent event(QEvent::UpdateRequest);
- QApplication::sendEvent(widget, &event);
- break;
- }
+ tlwExtra->repaintManager->markDirty(masked, q,
+ QWidgetRepaintManager::UpdateLater, QWidgetRepaintManager::BufferInvalid);
+ } else {
+ tlwExtra->repaintManager->markDirty(clipped, q,
+ QWidgetRepaintManager::UpdateLater, QWidgetRepaintManager::BufferInvalid);
}
}
+// Needed by tst_QWidget
+template Q_AUTOTEST_EXPORT void QWidgetPrivate::invalidateBackingStore<QRect>(const QRect &r);
static inline QRect widgetRectFor(QWidget *, const QRect &r) { return r; }
static inline QRect widgetRectFor(QWidget *widget, const QRegion &) { return widget->rect(); }
/*!
+ \internal
Marks the region of the widget as dirty (if not already marked as dirty) and
posts an UpdateRequest event to the top-level widget (if not already posted).
@@ -527,8 +206,11 @@ static inline QRect widgetRectFor(QWidget *widget, const QRegion &) { return wid
instead of the top-level widget, and bufferState is completely ignored.
*/
template <class T>
-void QWidgetBackingStore::markDirty(const T &r, QWidget *widget, UpdateTime updateTime, BufferState bufferState)
+void QWidgetRepaintManager::markDirty(const T &r, QWidget *widget, UpdateTime updateTime, BufferState bufferState)
{
+ qCInfo(lcWidgetPainting) << "Marking" << r << "of" << widget << "dirty"
+ << "with" << updateTime;
+
Q_ASSERT(tlw->d_func()->extra);
Q_ASSERT(tlw->d_func()->extra->topextra);
Q_ASSERT(!tlw->d_func()->extra->topextra->inTopLevelResize);
@@ -544,7 +226,7 @@ void QWidgetBackingStore::markDirty(const T &r, QWidget *widget, UpdateTime upda
// ---------------------------------------------------------------------------
- if (widget->d_func()->paintOnScreen()) {
+ if (widget->d_func()->shouldPaintOnScreen()) {
if (widget->d_func()->dirty.isEmpty()) {
widget->d_func()->dirty = r;
sendUpdateRequest(widget, updateTime);
@@ -631,70 +313,35 @@ void QWidgetBackingStore::markDirty(const T &r, QWidget *widget, UpdateTime upda
if (updateTime == UpdateNow)
sendUpdateRequest(tlw, updateTime);
}
-template void QWidgetBackingStore::markDirty<QRect>(const QRect &, QWidget *, UpdateTime, BufferState);
-template void QWidgetBackingStore::markDirty<QRegion>(const QRegion &, QWidget *, UpdateTime, BufferState);
+template void QWidgetRepaintManager::markDirty<QRect>(const QRect &, QWidget *, UpdateTime, BufferState);
+template void QWidgetRepaintManager::markDirty<QRegion>(const QRegion &, QWidget *, UpdateTime, BufferState);
-/*!
- Marks the \a region of the \a widget as dirty on screen. The \a region will be copied from
- the backing store to the \a widget's native parent next time flush() is called.
-
- Paint on screen widgets are ignored.
-*/
-void QWidgetBackingStore::markDirtyOnScreen(const QRegion &region, QWidget *widget, const QPoint &topLevelOffset)
+void QWidgetRepaintManager::addDirtyWidget(QWidget *widget, const QRegion &rgn)
{
- if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty())
- return;
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
- dirtyOnScreen += region.translated(topLevelOffset);
- return;
-#endif
-
- // Top-level.
- if (widget == tlw) {
- if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
- dirtyOnScreen += region;
- return;
- }
-
- // Alien widgets.
- if (!hasPlatformWindow(widget) && !widget->isWindow()) {
- QWidget *nativeParent = widget->nativeParentWidget(); // Alien widgets with the top-level as the native parent (common case).
- if (nativeParent == tlw) {
- if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
- dirtyOnScreen += region.translated(topLevelOffset);
- return;
- }
-
- // Alien widgets with native parent != tlw.
- QWidgetPrivate *nativeParentPrivate = nativeParent->d_func();
- if (!nativeParentPrivate->needsFlush)
- nativeParentPrivate->needsFlush = new QRegion;
- const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());
- *nativeParentPrivate->needsFlush += region.translated(nativeParentOffset);
- appendDirtyOnScreenWidget(nativeParent);
- return;
+ if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {
+ QWidgetPrivate *widgetPrivate = widget->d_func();
+#if QT_CONFIG(graphicseffect)
+ if (widgetPrivate->graphicsEffect)
+ widgetPrivate->dirty = widgetPrivate->effectiveRectFor(rgn.boundingRect());
+ else
+#endif // QT_CONFIG(graphicseffect)
+ widgetPrivate->dirty = rgn;
+ dirtyWidgets.append(widget);
+ widgetPrivate->inDirtyList = true;
}
-
- // Native child widgets.
- QWidgetPrivate *widgetPrivate = widget->d_func();
- if (!widgetPrivate->needsFlush)
- widgetPrivate->needsFlush = new QRegion;
- *widgetPrivate->needsFlush += region;
- appendDirtyOnScreenWidget(widget);
}
-void QWidgetBackingStore::removeDirtyWidget(QWidget *w)
+void QWidgetRepaintManager::removeDirtyWidget(QWidget *w)
{
if (!w)
return;
- dirtyWidgetsRemoveAll(w);
- dirtyOnScreenWidgetsRemoveAll(w);
+ dirtyWidgets.removeAll(w);
dirtyRenderToTextureWidgets.removeAll(w);
resetWidget(w);
+ needsFlushWidgets.removeAll(w);
+
QWidgetPrivate *wd = w->d_func();
const int n = wd->children.count();
for (int i = 0; i < n; ++i) {
@@ -703,46 +350,71 @@ void QWidgetBackingStore::removeDirtyWidget(QWidget *w)
}
}
-void QWidgetBackingStore::updateLists(QWidget *cur)
+void QWidgetRepaintManager::resetWidget(QWidget *widget)
{
- if (!cur)
- return;
-
- QList<QObject*> children = cur->children();
- for (int i = 0; i < children.size(); ++i) {
- QWidget *child = qobject_cast<QWidget*>(children.at(i));
- if (!child || child->isWindow())
- continue;
-
- updateLists(child);
+ if (widget) {
+ widget->d_func()->inDirtyList = false;
+ widget->d_func()->isScrolled = false;
+ widget->d_func()->isMoved = false;
+ widget->d_func()->dirty = QRegion();
}
+}
- if (cur->testAttribute(Qt::WA_StaticContents))
- addStaticWidget(cur);
+void QWidgetRepaintManager::addDirtyRenderToTextureWidget(QWidget *widget)
+{
+ if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {
+ QWidgetPrivate *widgetPrivate = widget->d_func();
+ Q_ASSERT(widgetPrivate->renderToTexture);
+ dirtyRenderToTextureWidgets.append(widget);
+ widgetPrivate->inDirtyList = true;
+ }
}
-QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel)
- : tlw(topLevel),
- dirtyOnScreenWidgets(0),
- updateRequestSent(0),
- textureListWatcher(0),
- perfFrames(0)
+void QWidgetRepaintManager::sendUpdateRequest(QWidget *widget, UpdateTime updateTime)
{
- store = tlw->backingStore();
- Q_ASSERT(store);
+ if (!widget)
+ return;
- // Ensure all existing subsurfaces and static widgets are added to their respective lists.
- updateLists(topLevel);
+ qCInfo(lcWidgetPainting) << "Sending update request to" << widget << "with" << updateTime;
+
+#ifndef QT_NO_OPENGL
+ // Having every repaint() leading to a sync/flush is bad as it causes
+ // compositing and waiting for vsync each and every time. Change to
+ // UpdateLater, except for approx. once per frame to prevent starvation in
+ // case the control does not get back to the event loop.
+ QWidget *w = widget->window();
+ if (updateTime == UpdateNow && w && w->windowHandle() && QWindowPrivate::get(w->windowHandle())->compositing) {
+ int refresh = 60;
+ QScreen *ws = w->windowHandle()->screen();
+ if (ws)
+ refresh = ws->refreshRate();
+ QWindowPrivate *wd = QWindowPrivate::get(w->windowHandle());
+ if (wd->lastComposeTime.isValid()) {
+ const qint64 elapsed = wd->lastComposeTime.elapsed();
+ if (elapsed <= qint64(1000.0f / refresh))
+ updateTime = UpdateLater;
+ }
+ }
+#endif
+
+ switch (updateTime) {
+ case UpdateLater:
+ updateRequestSent = true;
+ QCoreApplication::postEvent(widget, new QEvent(QEvent::UpdateRequest), Qt::LowEventPriority);
+ break;
+ case UpdateNow: {
+ QEvent event(QEvent::UpdateRequest);
+ QCoreApplication::sendEvent(widget, &event);
+ break;
+ }
+ }
}
-QWidgetBackingStore::~QWidgetBackingStore()
-{
- for (int c = 0; c < dirtyWidgets.size(); ++c)
- resetWidget(dirtyWidgets.at(c));
- for (int c = 0; c < dirtyRenderToTextureWidgets.size(); ++c)
- resetWidget(dirtyRenderToTextureWidgets.at(c));
+// ---------------------------------------------------------------------------
- delete dirtyOnScreenWidgets;
+static bool hasPlatformWindow(QWidget *widget)
+{
+ return widget && widget->windowHandle() && widget->windowHandle()->handle();
}
static QVector<QRect> getSortedRectsToScroll(const QRegion &region, int dx, int dy)
@@ -810,7 +482,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
invalidateBackingStore((newRect & clipR).translated(-data.crect.topLeft()));
} else {
- QWidgetBackingStore *wbs = x->backingStoreTracker.data();
+ QWidgetRepaintManager *repaintManager = x->repaintManager.get();
QRegion childExpose(newRect & clipR);
QRegion overlappedExpose;
@@ -822,7 +494,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
const QVector<QRect> rectsToScroll
= getSortedRectsToScroll(QRegion(sourceRect) - overlappedExpose, dx, dy);
for (QRect rect : rectsToScroll) {
- if (wbs->bltRect(rect, dx, dy, pw)) {
+ if (repaintManager->bltRect(rect, dx, dy, pw)) {
childExpose -= rect.translated(dx, dy);
}
}
@@ -842,7 +514,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
}
if (!childExpose.isEmpty()) {
childExpose.translate(-data.crect.topLeft());
- wbs->markDirty(childExpose, q);
+ repaintManager->markDirty(childExpose, q);
isMoved = true;
}
}
@@ -853,14 +525,14 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
parentExpose += QRegion(newRect) - extra->mask.translated(data.crect.topLeft());
if (!parentExpose.isEmpty()) {
- wbs->markDirty(parentExpose, pw);
+ repaintManager->markDirty(parentExpose, pw);
pd->isMoved = true;
}
if (childUpdatesEnabled) {
QRegion needsFlush(sourceRect);
needsFlush += destRect;
- wbs->markDirtyOnScreen(needsFlush, pw, toplevelOffset);
+ repaintManager->markNeedsFlush(pw, needsFlush, toplevelOffset);
}
}
}
@@ -874,8 +546,8 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
if (x->inTopLevelResize)
return;
- QWidgetBackingStore *wbs = x->backingStoreTracker.data();
- if (!wbs)
+ QWidgetRepaintManager *repaintManager = x->repaintManager.get();
+ if (!repaintManager)
return;
static const bool accelEnv = qEnvironmentVariableIntValue("QT_NO_FAST_SCROLL") == 0;
@@ -906,7 +578,7 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
const QVector<QRect> rectsToScroll
= getSortedRectsToScroll(QRegion(sourceRect) - overlappedExpose, dx, dy);
for (const QRect &rect : rectsToScroll) {
- if (wbs->bltRect(rect, dx, dy, q)) {
+ if (repaintManager->bltRect(rect, dx, dy, q)) {
childExpose -= rect.translated(dx, dy);
}
}
@@ -933,17 +605,32 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
if (!overlappedExpose.isEmpty())
invalidateBackingStore(overlappedExpose);
if (!childExpose.isEmpty()) {
- wbs->markDirty(childExpose, q);
+ repaintManager->markDirty(childExpose, q);
isScrolled = true;
}
// Instead of using native scroll-on-screen, we copy from
// backingstore, giving only one screen update for each
// scroll, and a solid appearance
- wbs->markDirtyOnScreen(destRect, q, toplevelOffset);
+ repaintManager->markNeedsFlush(q, destRect, toplevelOffset);
}
}
+/*
+ Moves the whole rect by (dx, dy) in widget's coordinate system.
+ Doesn't generate any updates.
+*/
+bool QWidgetRepaintManager::bltRect(const QRect &rect, int dx, int dy, QWidget *widget)
+{
+ const QPoint pos(widget->mapTo(tlw, rect.topLeft()));
+ const QRect tlwRect(QRect(pos, rect.size()));
+ if (dirty.intersects(tlwRect))
+ return false; // We don't want to scroll junk.
+ return store->scroll(tlwRect, dx, dy);
+}
+
+// ---------------------------------------------------------------------------
+
#ifndef QT_NO_OPENGL
static void findTextureWidgetsRecursively(QWidget *tlw, QWidget *widget, QPlatformTextureList *widgetTextures, QVector<QWidget *> *nativeChildren)
{
@@ -969,15 +656,15 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget)
// textureChildSeen does not take native child widgets into account and that's good.
if (QWidgetPrivate::get(widget)->textureChildSeen) {
QVector<QWidget *> nativeChildren;
- QScopedPointer<QPlatformTextureList> tl(new QPlatformTextureList);
+ auto tl = qt_make_unique<QPlatformTextureList>();
// Look for texture widgets (incl. widget itself) from 'widget' down,
// but skip subtrees with a parent of a native child widget.
- findTextureWidgetsRecursively(tlw, widget, tl.data(), &nativeChildren);
+ findTextureWidgetsRecursively(tlw, widget, tl.get(), &nativeChildren);
// tl may be empty regardless of textureChildSeen if we have native or hidden children.
if (!tl->isEmpty())
- QWidgetPrivate::get(tlw)->topData()->widgetTextures.append(tl.take());
+ QWidgetPrivate::get(tlw)->topData()->widgetTextures.push_back(std::move(tl));
// Native child widgets, if there was any, get their own separate QPlatformTextureList.
- foreach (QWidget *ncw, nativeChildren) {
+ for (QWidget *ncw : qAsConst(nativeChildren)) {
if (QWidgetPrivate::get(ncw)->textureChildSeen)
findAllTextureWidgetsRecursively(tlw, ncw);
}
@@ -986,12 +673,12 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget)
static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
{
- foreach (QPlatformTextureList *tl, QWidgetPrivate::get(tlw)->topData()->widgetTextures) {
+ for (const auto &tl : QWidgetPrivate::get(tlw)->topData()->widgetTextures) {
Q_ASSERT(!tl->isEmpty());
for (int i = 0; i < tl->count(); ++i) {
QWidget *w = static_cast<QWidget *>(tl->source(i));
if ((hasPlatformWindow(w) && w == widget) || (!hasPlatformWindow(w) && w->nativeParentWidget() == widget))
- return tl;
+ return tl.get();
}
}
@@ -1011,39 +698,6 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
return 0;
}
-// Watches one or more QPlatformTextureLists for changes in the lock state and
-// triggers a backingstore sync when all the registered lists turn into
-// unlocked state. This is essential when a custom composeAndFlush()
-// implementation in a platform plugin is not synchronous and keeps
-// holding on to the textures for some time even after returning from there.
-QPlatformTextureListWatcher::QPlatformTextureListWatcher(QWidgetBackingStore *backingStore)
- : m_backingStore(backingStore)
-{
-}
-
-void QPlatformTextureListWatcher::watch(QPlatformTextureList *textureList)
-{
- connect(textureList, SIGNAL(locked(bool)), SLOT(onLockStatusChanged(bool)));
- m_locked[textureList] = textureList->isLocked();
-}
-
-bool QPlatformTextureListWatcher::isLocked() const
-{
- foreach (bool v, m_locked) {
- if (v)
- return true;
- }
- return false;
-}
-
-void QPlatformTextureListWatcher::onLockStatusChanged(bool locked)
-{
- QPlatformTextureList *tl = static_cast<QPlatformTextureList *>(sender());
- m_locked[tl] = locked;
- if (!isLocked())
- m_backingStore->sync();
-}
-
#else
static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
@@ -1055,48 +709,19 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
#endif // QT_NO_OPENGL
-static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
-{
- if (!tlw || !tlwExtra || !tlw->testAttribute(Qt::WA_Mapped) || !tlw->isVisible())
- return true;
-
- return false;
-}
-
-bool QWidgetBackingStore::syncAllowed()
-{
-#ifndef QT_NO_OPENGL
- QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
- if (textureListWatcher && !textureListWatcher->isLocked()) {
- textureListWatcher->deleteLater();
- textureListWatcher = 0;
- } else if (!tlwExtra->widgetTextures.isEmpty()) {
- bool skipSync = false;
- foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
- if (tl->isLocked()) {
- if (!textureListWatcher)
- textureListWatcher = new QPlatformTextureListWatcher(this);
- if (!textureListWatcher->isLocked())
- textureListWatcher->watch(tl);
- skipSync = true;
- }
- }
- if (skipSync) // cannot compose due to widget textures being in use
- return false;
- }
-#endif
- return true;
-}
+// ---------------------------------------------------------------------------
/*!
Synchronizes the \a exposedRegion of the \a exposedWidget with the backing store.
- If there's nothing to repaint, the area is flushed and painting does not occur;
- otherwise the area is marked as dirty on screen and will be flushed right after
- we are done with all painting.
+ If there are dirty widgets, including but not limited to the \a exposedWidget,
+ these will be repainted first. The backingstore is then flushed to the screen,
+ regardless of whether or not there were any repaints.
*/
-void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedRegion)
+void QWidgetRepaintManager::sync(QWidget *exposedWidget, const QRegion &exposedRegion)
{
+ qCInfo(lcWidgetPainting) << "Syncing" << exposedRegion << "of" << exposedWidget;
+
QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
if (!tlw->isVisible() || !tlwExtra || tlwExtra->inTopLevelResize)
return;
@@ -1109,28 +734,30 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
// Nothing to repaint.
if (!isDirty() && store->size().isValid()) {
- QPlatformTextureList *tl = widgetTexturesFor(tlw, exposedWidget);
- qt_flush(exposedWidget, tl ? QRegion() : exposedRegion, store, tlw, tl, this);
+ QPlatformTextureList *widgetTextures = widgetTexturesFor(tlw, exposedWidget);
+ flush(exposedWidget, widgetTextures ? QRegion() : exposedRegion, widgetTextures);
return;
}
- if (exposedWidget != tlw)
- markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint()));
- else
- markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
+ // As requests to sync a specific widget typically comes from an expose event
+ // we can't rely solely on our own dirty tracking to decide what to flush, and
+ // need to respect the platform's request to at least flush the entire widget,
+ QPoint offset = exposedWidget != tlw ? exposedWidget->mapTo(tlw, QPoint()) : QPoint();
+ markNeedsFlush(exposedWidget, exposedRegion, offset);
if (syncAllowed())
- doSync();
+ paintAndFlush();
}
/*!
Synchronizes the backing store, i.e. dirty areas are repainted and flushed.
*/
-void QWidgetBackingStore::sync()
+void QWidgetRepaintManager::sync()
{
+ qCInfo(lcWidgetPainting) << "Syncing dirty widgets";
+
updateRequestSent = false;
- QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
- if (discardSyncRequest(tlw, tlwExtra)) {
+ if (qt_widget_private(tlw)->shouldDiscardSyncRequest()) {
// If the top-level is minimized, it's not visible on the screen so we can delay the
// update until it's shown again. In order to do that we must keep the dirty states.
// These will be cleared when we receive the first expose after showNormal().
@@ -1146,16 +773,50 @@ void QWidgetBackingStore::sync()
}
if (syncAllowed())
- doSync();
+ paintAndFlush();
}
-void QWidgetBackingStore::doSync()
+bool QWidgetPrivate::shouldDiscardSyncRequest() const
{
+ Q_Q(const QWidget);
+ return !maybeTopData() || !q->testAttribute(Qt::WA_Mapped) || !q->isVisible();
+}
+
+bool QWidgetRepaintManager::syncAllowed()
+{
+#ifndef QT_NO_OPENGL
+ QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
+ if (textureListWatcher && !textureListWatcher->isLocked()) {
+ textureListWatcher->deleteLater();
+ textureListWatcher = 0;
+ } else if (!tlwExtra->widgetTextures.empty()) {
+ bool skipSync = false;
+ for (const auto &tl : tlwExtra->widgetTextures) {
+ if (tl->isLocked()) {
+ if (!textureListWatcher)
+ textureListWatcher = new QPlatformTextureListWatcher(this);
+ if (!textureListWatcher->isLocked())
+ textureListWatcher->watch(tl.get());
+ skipSync = true;
+ }
+ }
+ if (skipSync) // cannot compose due to widget textures being in use
+ return false;
+ }
+#endif
+ return true;
+}
+
+void QWidgetRepaintManager::paintAndFlush()
+{
+ qCInfo(lcWidgetPainting) << "Painting and flushing dirty"
+ << "top level" << dirty << "and dirty widgets" << dirtyWidgets;
+
const bool updatesDisabled = !tlw->updatesEnabled();
bool repaintAllWidgets = false;
const bool inTopLevelResize = tlw->d_func()->maybeTopData()->inTopLevelResize;
- const QRect tlwRect(topLevelRect());
+ const QRect tlwRect = tlw->data->crect;
const QRect surfaceGeometry(tlwRect.topLeft(), store->size());
if ((inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
if (hasStaticContents() && !store->size().isEmpty() ) {
@@ -1249,10 +910,9 @@ void QWidgetBackingStore::doSync()
// The search is cut at native widget boundaries, meaning that each native child widget
// has its own list for the subtree below it.
QTLWExtra *tlwExtra = tlw->d_func()->topData();
- qDeleteAll(tlwExtra->widgetTextures);
tlwExtra->widgetTextures.clear();
findAllTextureWidgetsRecursively(tlw, tlw);
- qt_window_private(tlw->windowHandle())->compositing = false; // will get updated in qt_flush()
+ qt_window_private(tlw->windowHandle())->compositing = false; // will get updated in flush()
#endif
if (toClean.isEmpty()) {
@@ -1278,10 +938,7 @@ void QWidgetBackingStore::doSync()
if (hasPlatformWindow(w) || (npw && npw != tlw)) {
if (!hasPlatformWindow(w))
w = npw;
- QWidgetPrivate *wPrivate = w->d_func();
- if (!wPrivate->needsFlush)
- wPrivate->needsFlush = new QRegion;
- appendDirtyOnScreenWidget(w);
+ markNeedsFlush(w);
}
}
}
@@ -1295,7 +952,7 @@ void QWidgetBackingStore::doSync()
}
#ifndef QT_NO_OPENGL
- foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
+ for (const auto &tl : tlwExtra->widgetTextures) {
for (int i = 0; i < tl->count(); ++i) {
QWidget *w = static_cast<QWidget *>(tl->source(i));
if (dirtyRenderToTextureWidgets.contains(w)) {
@@ -1324,15 +981,7 @@ void QWidgetBackingStore::doSync()
}
#endif
- BeginPaintInfo beginPaintInfo;
- beginPaint(toClean, tlw, store, &beginPaintInfo);
- if (beginPaintInfo.nothingToPaint) {
- for (int i = 0; i < opaqueNonOverlappedWidgets.size(); ++i)
- resetWidget(opaqueNonOverlappedWidgets[i]);
- dirty = QRegion();
- updateRequestSent = false;
- return;
- }
+ store->beginPaint(toClean);
// Must do this before sending any paint events because
// the size may change in the paint event.
@@ -1346,7 +995,7 @@ void QWidgetBackingStore::doSync()
QWidget *w = opaqueNonOverlappedWidgets[i];
QWidgetPrivate *wd = w->d_func();
- int flags = QWidgetPrivate::DrawRecursive;
+ QWidgetPrivate::DrawWidgetFlags flags = QWidgetPrivate::DrawRecursive;
// Scrolled and moved widgets must draw all children.
if (!wd->isScrolled && !wd->isMoved)
flags |= QWidgetPrivate::DontDrawOpaqueChildren;
@@ -1364,56 +1013,301 @@ void QWidgetBackingStore::doSync()
// Paint the rest with composition.
if (repaintAllWidgets || !dirtyCopy.isEmpty()) {
- const int flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive;
+ QWidgetPrivate::DrawWidgetFlags flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive;
tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, QPoint(), flags, 0, this);
}
- endPaint(toClean, store, &beginPaintInfo);
+ store->endPaint();
+
+ flush();
+}
+
+/*!
+ Marks the \a region of the \a widget as needing a flush. The \a region will be copied from
+ the backing store to the \a widget's native parent next time flush() is called.
+
+ Paint on screen widgets are ignored.
+*/
+void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset)
+{
+ if (!widget || widget->d_func()->shouldPaintOnScreen() || region.isEmpty())
+ return;
+
+ if (widget == tlw) {
+ // Top-level (native)
+ qCInfo(lcWidgetPainting) << "Marking" << region << "of top level"
+ << widget << "as needing flush";
+ topLevelNeedsFlush += region;
+ } else if (!hasPlatformWindow(widget) && !widget->isWindow()) {
+ QWidget *nativeParent = widget->nativeParentWidget();
+ qCInfo(lcWidgetPainting) << "Marking" << region << "of"
+ << widget << "as needing flush in" << nativeParent
+ << "at offset" << topLevelOffset;
+ if (nativeParent == tlw) {
+ // Alien widgets with the top-level as the native parent (common case)
+ topLevelNeedsFlush += region.translated(topLevelOffset);
+ } else {
+ // Alien widgets with native parent != tlw
+ const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());
+ markNeedsFlush(nativeParent, region.translated(nativeParentOffset));
+ }
+ } else {
+ // Native child widgets
+ qCInfo(lcWidgetPainting) << "Marking" << region
+ << "of native child" << widget << "as needing flush";
+ markNeedsFlush(widget, region);
+ }
+}
+
+void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &region)
+{
+ if (!widget)
+ return;
+
+ auto *widgetPrivate = qt_widget_private(widget);
+ if (!widgetPrivate->needsFlush)
+ widgetPrivate->needsFlush = new QRegion;
+
+ *widgetPrivate->needsFlush += region;
+
+ if (!needsFlushWidgets.contains(widget))
+ needsFlushWidgets.append(widget);
}
/*!
Flushes the contents of the backing store into the top-level widget.
- If the \a widget is non-zero, the content is flushed to the \a widget.
- If the \a surface is non-zero, the content of the \a surface is flushed.
*/
-void QWidgetBackingStore::flush(QWidget *widget)
+void QWidgetRepaintManager::flush()
{
- const bool hasDirtyOnScreenWidgets = dirtyOnScreenWidgets && !dirtyOnScreenWidgets->isEmpty();
+ qCInfo(lcWidgetPainting) << "Flushing top level"
+ << topLevelNeedsFlush << "and children" << needsFlushWidgets;
+
+ const bool hasNeedsFlushWidgets = !needsFlushWidgets.isEmpty();
bool flushed = false;
- // Flush the region in dirtyOnScreen.
- if (!dirtyOnScreen.isEmpty()) {
- QWidget *target = widget ? widget : tlw;
- qt_flush(target, dirtyOnScreen, store, tlw, widgetTexturesFor(tlw, tlw), this);
- dirtyOnScreen = QRegion();
+ // Flush the top level widget
+ if (!topLevelNeedsFlush.isEmpty()) {
+ flush(tlw, topLevelNeedsFlush, widgetTexturesFor(tlw, tlw));
+ topLevelNeedsFlush = QRegion();
flushed = true;
}
- // Render-to-texture widgets are not in dirtyOnScreen so flush if we have not done it above.
- if (!flushed && !hasDirtyOnScreenWidgets) {
+ // Render-to-texture widgets are not in topLevelNeedsFlush so flush if we have not done it above.
+ if (!flushed && !hasNeedsFlushWidgets) {
#ifndef QT_NO_OPENGL
- if (!tlw->d_func()->topData()->widgetTextures.isEmpty()) {
- QPlatformTextureList *tl = widgetTexturesFor(tlw, tlw);
- if (tl) {
- QWidget *target = widget ? widget : tlw;
- qt_flush(target, QRegion(), store, tlw, tl, this);
- }
+ if (!tlw->d_func()->topData()->widgetTextures.empty()) {
+ if (QPlatformTextureList *widgetTextures = widgetTexturesFor(tlw, tlw))
+ flush(tlw, QRegion(), widgetTextures);
}
#endif
}
- if (!hasDirtyOnScreenWidgets)
+ if (!hasNeedsFlushWidgets)
return;
- for (int i = 0; i < dirtyOnScreenWidgets->size(); ++i) {
- QWidget *w = dirtyOnScreenWidgets->at(i);
+ for (QWidget *w : qExchange(needsFlushWidgets, {})) {
QWidgetPrivate *wd = w->d_func();
Q_ASSERT(wd->needsFlush);
QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : 0;
- qt_flush(w, *wd->needsFlush, store, tlw, widgetTexturesForNative, this);
+ flush(w, *wd->needsFlush, widgetTexturesForNative);
*wd->needsFlush = QRegion();
}
- dirtyOnScreenWidgets->clear();
+}
+
+/*
+ Flushes the contents of the backingstore into the screen area of \a widget.
+
+ \a region is the region to be updated in \a widget coordinates.
+ */
+void QWidgetRepaintManager::flush(QWidget *widget, const QRegion &region, QPlatformTextureList *widgetTextures)
+{
+#ifdef QT_NO_OPENGL
+ Q_UNUSED(widgetTextures);
+ Q_ASSERT(!region.isEmpty());
+#else
+ Q_ASSERT(!region.isEmpty() || widgetTextures);
+#endif
+ Q_ASSERT(widget);
+ Q_ASSERT(tlw);
+
+ if (tlw->testAttribute(Qt::WA_DontShowOnScreen) || widget->testAttribute(Qt::WA_DontShowOnScreen))
+ return;
+
+ // Foreign Windows do not have backing store content and must not be flushed
+ if (QWindow *widgetWindow = widget->windowHandle()) {
+ if (widgetWindow->type() == Qt::ForeignWindow)
+ return;
+ }
+
+ qCInfo(lcWidgetPainting) << "Flushing" << region << "of" << widget;
+
+ static bool fpsDebug = qEnvironmentVariableIntValue("QT_DEBUG_FPS");
+ if (fpsDebug) {
+ if (!perfFrames++)
+ perfTime.start();
+ if (perfTime.elapsed() > 5000) {
+ double fps = double(perfFrames * 1000) / perfTime.restart();
+ qDebug("FPS: %.1f\n", fps);
+ perfFrames = 0;
+ }
+ }
+
+ QPoint offset;
+ if (widget != tlw)
+ offset += widget->mapTo(tlw, QPoint());
+
+ QRegion effectiveRegion = region;
+#ifndef QT_NO_OPENGL
+ const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive;
+ if (!widgetTextures) {
+ widget->d_func()->renderToTextureComposeActive = false;
+ // Detect the case of falling back to the normal flush path when no
+ // render-to-texture widgets are visible anymore. We will force one
+ // last flush to go through the OpenGL-based composition to prevent
+ // artifacts. The next flush after this one will use the normal path.
+ if (compositionWasActive)
+ widgetTextures = qt_dummy_platformTextureList;
+ } else {
+ widget->d_func()->renderToTextureComposeActive = true;
+ }
+ // When changing the composition status, make sure the dirty region covers
+ // the entire widget. Just having e.g. the shown/hidden render-to-texture
+ // widget's area marked as dirty is incorrect when changing flush paths.
+ if (compositionWasActive != widget->d_func()->renderToTextureComposeActive)
+ effectiveRegion = widget->rect();
+
+ // re-test since we may have been forced to this path via the dummy texture list above
+ if (widgetTextures) {
+ qt_window_private(tlw->windowHandle())->compositing = true;
+ widget->window()->d_func()->sendComposeStatus(widget->window(), false);
+ // A window may have alpha even when the app did not request
+ // WA_TranslucentBackground. Therefore the compositor needs to know whether the app intends
+ // to rely on translucency, in order to decide if it should clear to transparent or opaque.
+ const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground);
+ store->handle()->composeAndFlush(widget->windowHandle(), effectiveRegion, offset,
+ widgetTextures, translucentBackground);
+ widget->window()->d_func()->sendComposeStatus(widget->window(), true);
+ } else
+#endif
+ store->flush(effectiveRegion, widget->windowHandle(), offset);
+}
+
+// ---------------------------------------------------------------------------
+
+void QWidgetRepaintManager::addStaticWidget(QWidget *widget)
+{
+ if (!widget)
+ return;
+
+ Q_ASSERT(widget->testAttribute(Qt::WA_StaticContents));
+ if (!staticWidgets.contains(widget))
+ staticWidgets.append(widget);
+}
+
+// Move the reparented widget and all its static children from this backing store
+// to the new backing store if reparented into another top-level / backing store.
+void QWidgetRepaintManager::moveStaticWidgets(QWidget *reparented)
+{
+ Q_ASSERT(reparented);
+ QWidgetRepaintManager *newPaintManager = reparented->d_func()->maybeRepaintManager();
+ if (newPaintManager == this)
+ return;
+
+ int i = 0;
+ while (i < staticWidgets.size()) {
+ QWidget *w = staticWidgets.at(i);
+ if (reparented == w || reparented->isAncestorOf(w)) {
+ staticWidgets.removeAt(i);
+ if (newPaintManager)
+ newPaintManager->addStaticWidget(w);
+ } else {
+ ++i;
+ }
+ }
+}
+
+void QWidgetRepaintManager::removeStaticWidget(QWidget *widget)
+{
+ staticWidgets.removeAll(widget);
+}
+
+bool QWidgetRepaintManager::hasStaticContents() const
+{
+#if defined(Q_OS_WIN)
+ return !staticWidgets.isEmpty();
+#else
+ return !staticWidgets.isEmpty() && false;
+#endif
+}
+
+/*!
+ Returns the static content inside the \a parent if non-zero; otherwise the static content
+ for the entire backing store is returned. The content will be clipped to \a withinClipRect
+ if non-empty.
+*/
+QRegion QWidgetRepaintManager::staticContents(QWidget *parent, const QRect &withinClipRect) const
+{
+ if (!parent && tlw->testAttribute(Qt::WA_StaticContents)) {
+ const QSize surfaceGeometry(store->size());
+ QRect surfaceRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height());
+ if (!withinClipRect.isEmpty())
+ surfaceRect &= withinClipRect;
+ return QRegion(surfaceRect);
+ }
+
+ QRegion region;
+ if (parent && parent->d_func()->children.isEmpty())
+ return region;
+
+ const bool clipToRect = !withinClipRect.isEmpty();
+ const int count = staticWidgets.count();
+ for (int i = 0; i < count; ++i) {
+ QWidget *w = staticWidgets.at(i);
+ QWidgetPrivate *wd = w->d_func();
+ if (!wd->isOpaque || !wd->extra || wd->extra->staticContentsSize.isEmpty()
+ || !w->isVisible() || (parent && !parent->isAncestorOf(w))) {
+ continue;
+ }
+
+ QRect rect(0, 0, wd->extra->staticContentsSize.width(), wd->extra->staticContentsSize.height());
+ const QPoint offset = w->mapTo(parent ? parent : tlw, QPoint());
+ if (clipToRect)
+ rect &= withinClipRect.translated(-offset);
+ if (rect.isEmpty())
+ continue;
+
+ rect &= wd->clipRect();
+ if (rect.isEmpty())
+ continue;
+
+ QRegion visible(rect);
+ wd->clipToEffectiveMask(visible);
+ if (visible.isEmpty())
+ continue;
+ wd->subtractOpaqueSiblings(visible, 0, /*alsoNonOpaque=*/true);
+
+ visible.translate(offset);
+ region += visible;
+ }
+
+ return region;
+}
+
+void QWidgetRepaintManager::updateStaticContentsSize()
+{
+ for (int i = 0; i < staticWidgets.size(); ++i) {
+ QWidgetPrivate *wd = staticWidgets.at(i)->d_func();
+ if (!wd->extra)
+ wd->createExtra();
+ wd->extra->staticContentsSize = wd->data.crect.size();
+ }
+}
+
+// ---------------------------------------------------------------------------
+
+bool QWidgetRepaintManager::isDirty() const
+{
+ return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && dirtyRenderToTextureWidgets.isEmpty());
}
/*!
@@ -1437,8 +1331,8 @@ void QWidgetPrivate::invalidateBackingStore_resizeHelper(const QPoint &oldPos, c
if (!staticContents || graphicsEffect) {
QRegion staticChildren;
- QWidgetBackingStore *bs = 0;
- if (offset.isNull() && (bs = maybeBackingStore()))
+ QWidgetRepaintManager *bs = 0;
+ if (offset.isNull() && (bs = maybeRepaintManager()))
staticChildren = bs->staticContents(q, oldWidgetRect);
const bool hasStaticChildren = !staticChildren.isEmpty();
@@ -1508,101 +1402,6 @@ void QWidgetPrivate::invalidateBackingStore_resizeHelper(const QPoint &oldPos, c
}
}
-/*!
- Invalidates the \a r (in widget's coordinates) of the backing store, i.e.
- all widgets intersecting with the region will be repainted when the backing
- store is synced.
-*/
-template <class T>
-void QWidgetPrivate::invalidateBackingStore(const T &r)
-{
- if (r.isEmpty())
- return;
-
- if (QApplication::closingDown())
- return;
-
- Q_Q(QWidget);
- if (!q->isVisible() || !q->updatesEnabled())
- return;
-
- QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
- if (!tlwExtra || tlwExtra->inTopLevelResize || !tlwExtra->backingStore)
- return;
-
- T clipped(r);
- clipped &= clipRect();
- if (clipped.isEmpty())
- return;
-
- if (!graphicsEffect && extra && extra->hasMask) {
- QRegion masked(extra->mask);
- masked &= clipped;
- if (masked.isEmpty())
- return;
-
- tlwExtra->backingStoreTracker->markDirty(masked, q,
- QWidgetBackingStore::UpdateLater, QWidgetBackingStore::BufferInvalid);
- } else {
- tlwExtra->backingStoreTracker->markDirty(clipped, q,
- QWidgetBackingStore::UpdateLater, QWidgetBackingStore::BufferInvalid);
- }
-}
-// Needed by tst_QWidget
-template Q_AUTOTEST_EXPORT void QWidgetPrivate::invalidateBackingStore<QRect>(const QRect &r);
-
-void QWidgetPrivate::repaint_sys(const QRegion &rgn)
-{
- if (data.in_destructor)
- return;
-
- Q_Q(QWidget);
- if (discardSyncRequest(q, maybeTopData()))
- return;
-
- if (q->testAttribute(Qt::WA_StaticContents)) {
- if (!extra)
- createExtra();
- extra->staticContentsSize = data.crect.size();
- }
-
- QPaintEngine *engine = q->paintEngine();
-
- // QGLWidget does not support partial updates if:
- // 1) The context is double buffered
- // 2) The context is single buffered and auto-fill background is enabled.
- const bool noPartialUpdateSupport = (engine && (engine->type() == QPaintEngine::OpenGL
- || engine->type() == QPaintEngine::OpenGL2))
- && (usesDoubleBufferedGLContext || q->autoFillBackground());
- QRegion toBePainted(noPartialUpdateSupport ? q->rect() : rgn);
-
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // No difference between update() and repaint() on the Mac.
- update_sys(toBePainted);
- return;
-#endif
-
- toBePainted &= clipRect();
- clipToEffectiveMask(toBePainted);
- if (toBePainted.isEmpty())
- return; // Nothing to repaint.
-
-#ifndef QT_NO_PAINT_DEBUG
- bool flushed = QWidgetBackingStore::flushPaint(q, toBePainted);
-#endif
-
- drawWidget(q, toBePainted, QPoint(), QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawPaintOnScreen, 0);
-
-#ifndef QT_NO_PAINT_DEBUG
- if (flushed)
- QWidgetBackingStore::unflushPaint(q, toBePainted);
-#endif
-
- if (Q_UNLIKELY(q->paintingActive()))
- qWarning("QWidget::repaint: It is dangerous to leave painters active on a widget outside of the PaintEvent");
-}
-
-
QT_END_NAMESPACE
-#include "moc_qwidgetbackingstore_p.cpp"
+#include "qwidgetrepaintmanager.moc"
diff --git a/src/widgets/kernel/qwidgetrepaintmanager_p.h b/src/widgets/kernel/qwidgetrepaintmanager_p.h
new file mode 100644
index 0000000000..58687383f4
--- /dev/null
+++ b/src/widgets/kernel/qwidgetrepaintmanager_p.h
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWidgets module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETREPAINTMANAGER_P_H
+#define QWIDGETREPAINTMANAGER_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 <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QDebug>
+#include <QtWidgets/qwidget.h>
+#include <private/qwidget_p.h>
+#include <QtGui/qbackingstore.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPlatformTextureList;
+class QPlatformTextureListWatcher;
+class QWidgetRepaintManager;
+
+class Q_AUTOTEST_EXPORT QWidgetRepaintManager
+{
+ Q_GADGET
+public:
+ enum UpdateTime {
+ UpdateNow,
+ UpdateLater
+ };
+ Q_ENUM(UpdateTime)
+
+ enum BufferState{
+ BufferValid,
+ BufferInvalid
+ };
+ Q_ENUM(BufferState)
+
+ QWidgetRepaintManager(QWidget *t);
+ ~QWidgetRepaintManager();
+
+ QBackingStore *backingStore() const { return store; }
+ void setBackingStore(QBackingStore *backingStore) { store = backingStore; }
+
+ template <class T>
+ void markDirty(const T &r, QWidget *widget, UpdateTime updateTime = UpdateLater,
+ BufferState bufferState = BufferValid);
+
+ void removeDirtyWidget(QWidget *w);
+
+ void sync(QWidget *exposedWidget, const QRegion &exposedRegion);
+ void sync();
+
+ void markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset);
+
+ void addStaticWidget(QWidget *widget);
+ void moveStaticWidgets(QWidget *reparented);
+ void removeStaticWidget(QWidget *widget);
+ QRegion staticContents(QWidget *widget = nullptr, const QRect &withinClipRect = QRect()) const;
+
+ bool bltRect(const QRect &rect, int dx, int dy, QWidget *widget);
+
+private:
+ void updateLists(QWidget *widget);
+
+ void addDirtyWidget(QWidget *widget, const QRegion &rgn);
+ void resetWidget(QWidget *widget);
+
+ void addDirtyRenderToTextureWidget(QWidget *widget);
+
+ void sendUpdateRequest(QWidget *widget, UpdateTime updateTime);
+
+ bool syncAllowed();
+ void paintAndFlush();
+
+ void markNeedsFlush(QWidget *widget, const QRegion &region = QRegion());
+
+ void flush();
+ void flush(QWidget *widget, const QRegion &region, QPlatformTextureList *widgetTextures);
+
+ bool isDirty() const;
+
+ bool hasStaticContents() const;
+ void updateStaticContentsSize();
+
+ QWidget *tlw = nullptr;
+ QBackingStore *store = nullptr;
+
+ QRegion dirty; // needsRepaint
+ QVector<QWidget *> dirtyWidgets;
+ QVector<QWidget *> dirtyRenderToTextureWidgets;
+
+ QRegion topLevelNeedsFlush;
+ QVector<QWidget *> needsFlushWidgets;
+
+ QList<QWidget *> staticWidgets;
+
+ QPlatformTextureListWatcher *textureListWatcher = nullptr;
+
+ bool updateRequestSent = false;
+
+ QElapsedTimer perfTime;
+ int perfFrames = 0;
+
+ Q_DISABLE_COPY_MOVE(QWidgetRepaintManager)
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETREPAINTMANAGER_P_H
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 878e484ab8..596343c52f 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -46,7 +46,7 @@
#ifndef QT_NO_ACCESSIBILITY
#include <QtGui/qaccessible.h>
#endif
-#include <private/qwidgetbackingstore_p.h>
+#include <private/qwidgetrepaintmanager_p.h>
#include <qpa/qwindowsysteminterface_p.h>
#include <qpa/qplatformtheme.h>
#include <qpa/qplatformwindow.h>
@@ -114,6 +114,7 @@ public:
if (QWidget *widget = q->widget())
QWidgetPrivate::get(widget)->updateContentsRect();
}
+ bool allowClickThrough(const QPoint &) const override;
};
QRectF QWidgetWindowPrivate::closestAcceptableGeometry(const QRectF &rect) const
@@ -162,7 +163,7 @@ QWidgetWindow::QWidgetWindow(QWidget *widget)
// Enable QOpenGLWidget/QQuickWidget children if the platform plugin supports it,
// and the application developer has not explicitly disabled it.
if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface)
- && !QApplication::testAttribute(Qt::AA_ForceRasterWidgets)) {
+ && !QCoreApplication::testAttribute(Qt::AA_ForceRasterWidgets)) {
setSurfaceType(QSurface::RasterGLSurface);
}
connect(widget, &QObject::objectNameChanged, this, &QWidgetWindow::updateObjectName);
@@ -229,6 +230,11 @@ static inline bool shouldBePropagatedToWidget(QEvent *event)
}
}
+bool QWidgetWindowPrivate::allowClickThrough(const QPoint &) const
+{
+ return true;
+}
+
bool QWidgetWindow::event(QEvent *event)
{
if (!m_widget)
@@ -498,8 +504,8 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
static const QEvent::Type contextMenuTrigger =
QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::ContextMenuOnMouseRelease).toBool() ?
QEvent::MouseButtonRelease : QEvent::MouseButtonPress;
- if (qApp->d_func()->inPopupMode()) {
- QWidget *activePopupWidget = qApp->activePopupWidget();
+ if (QApplicationPrivate::inPopupMode()) {
+ QWidget *activePopupWidget = QApplication::activePopupWidget();
QPoint mapped = event->pos();
if (activePopupWidget != m_widget)
mapped = activePopupWidget->mapFromGlobal(event->globalPos());
@@ -579,7 +585,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
}
}
- if (qApp->activePopupWidget() != activePopupWidget
+ if (QApplication::activePopupWidget() != activePopupWidget
&& qt_replay_popup_mouse_event
&& QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ReplayMousePressOutsidePopup).toBool()) {
if (m_widget->windowType() != Qt::Popup)
@@ -594,10 +600,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
w->window()->raise();
}
- QWindow *win = w->windowHandle();
- if (!win)
- win = w->nativeParentWidget()->windowHandle();
- if (win) {
+ if (auto win = qt_widget_private(w)->windowHandle(QWidgetPrivate::WindowHandleMode::Closest)) {
const QRect globalGeometry = win->isTopLevel()
? win->geometry()
: QRect(win->mapToGlobal(QPoint(0, 0)), win->size());
@@ -685,7 +688,7 @@ void QWidgetWindow::handleTouchEvent(QTouchEvent *event)
if (event->type() == QEvent::TouchCancel) {
QApplicationPrivate::translateTouchCancel(event->device(), event->timestamp());
event->accept();
- } else if (qApp->d_func()->inPopupMode()) {
+ } else if (QApplicationPrivate::inPopupMode()) {
// Ignore touch events for popups. This will cause QGuiApplication to synthesise mouse
// events instead, which QWidgetWindow::handleMouseEvent will forward correctly:
event->ignore();
@@ -749,7 +752,7 @@ void QWidgetWindow::updateMargins()
static void sendScreenChangeRecursively(QWidget *widget)
{
QEvent e(QEvent::ScreenChangeInternal);
- QApplication::sendEvent(widget, &e);
+ QCoreApplication::sendEvent(widget, &e);
QWidgetPrivate *d = QWidgetPrivate::get(widget);
for (int i = 0; i < d->children.size(); ++i) {
QWidget *w = qobject_cast<QWidget *>(d->children.at(i));
@@ -775,8 +778,8 @@ void QWidgetWindow::repaintWindow()
QTLWExtra *tlwExtra = m_widget->window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore)
- tlwExtra->backingStoreTracker->markDirty(m_widget->rect(), m_widget,
- QWidgetBackingStore::UpdateNow, QWidgetBackingStore::BufferInvalid);
+ tlwExtra->repaintManager->markDirty(m_widget->rect(), m_widget,
+ QWidgetRepaintManager::UpdateNow, QWidgetRepaintManager::BufferInvalid);
}
// Store normal geometry used for saving application settings.
@@ -808,7 +811,7 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
if (updateSize()) {
QGuiApplication::forwardEvent(m_widget, event);
- if (m_widget->d_func()->paintOnScreen()) {
+ if (m_widget->d_func()->shouldPaintOnScreen()) {
QRegion updateRegion(geometry());
if (m_widget->testAttribute(Qt::WA_StaticContents))
updateRegion -= QRect(0, 0, oldSize.width(), oldSize.height());
@@ -833,14 +836,14 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
return;
QWidget *rootWidget = m_widget;
- QPoint pos = event->pos();
+ QPoint pos = event->position().toPoint();
// Use proper popup window for wheel event. Some QPA sends the wheel
// event to the root menu, so redirect it to the proper popup window.
QWidget *activePopupWidget = QApplication::activePopupWidget();
if (activePopupWidget && activePopupWidget != m_widget) {
rootWidget = activePopupWidget;
- pos = rootWidget->mapFromGlobal(event->globalPos());
+ pos = rootWidget->mapFromGlobal(event->globalPosition().toPoint());
}
// which child should have it?
@@ -851,7 +854,12 @@ void QWidgetWindow::handleWheelEvent(QWheelEvent *event)
QPoint mapped = widget->mapFrom(rootWidget, pos);
+#if QT_DEPRECATED_SINCE(5, 0)
QWheelEvent translated(mapped, event->globalPos(), event->pixelDelta(), event->angleDelta(), event->delta(), event->orientation(), event->buttons(), event->modifiers(), event->phase(), event->source(), event->inverted());
+#else
+ QWheelEvent translated(QPointF(mapped), event->globalPosition(), event->pixelDelta(), event->angleDelta(),
+ event->buttons(), event->modifiers(), event->phase(), event->inverted(), event->source());
+#endif
translated.setTimestamp(event->timestamp());
QGuiApplication::forwardEvent(widget, &translated, event);
}
@@ -1030,7 +1038,11 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event
}
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
+#else
bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long *result)
+#endif
{
return m_widget->nativeEvent(eventType, message, result);
}
@@ -1108,7 +1120,7 @@ void QWidgetWindow::handleContextMenuEvent(QContextMenuEvent *e)
}
}
if (fw && fw->isEnabled()) {
- QPoint pos = fw->inputMethodQuery(Qt::ImMicroFocus).toRect().center();
+ QPoint pos = fw->inputMethodQuery(Qt::ImCursorRectangle).toRect().center();
QContextMenuEvent widgetEvent(QContextMenuEvent::Keyboard, pos, fw->mapToGlobal(pos),
e->modifiers());
QGuiApplication::forwardEvent(fw, &widgetEvent, e);
diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h
index 0728135467..80a345465d 100644
--- a/src/widgets/kernel/qwidgetwindow_p.h
+++ b/src/widgets/kernel/qwidgetwindow_p.h
@@ -103,7 +103,11 @@ protected:
#endif
void handleExposeEvent(QExposeEvent *);
void handleWindowStateChangedEvent(QWindowStateChangeEvent *event);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
+#else
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
+#endif
#if QT_CONFIG(tabletevent)
void handleTabletEvent(QTabletEvent *);
#endif
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 4b289d2d33..fd8581edbb 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -223,7 +223,7 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
// Otherwise we may end up with BadMatch failures on X11.
if (embeddedWindow->surfaceType() == QSurface::RasterSurface
&& QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface)
- && !QApplication::testAttribute(Qt::AA_ForceRasterWidgets))
+ && !QCoreApplication::testAttribute(Qt::AA_ForceRasterWidgets))
embeddedWindow->setSurfaceType(QSurface::RasterGLSurface);
d->window = embeddedWindow;
diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h
index a8754232a8..c6de168c10 100644
--- a/src/widgets/kernel/qwindowcontainer_p.h
+++ b/src/widgets/kernel/qwindowcontainer_p.h
@@ -64,7 +64,7 @@ class Q_WIDGETS_EXPORT QWindowContainer : public QWidget
Q_DECLARE_PRIVATE(QWindowContainer)
public:
- explicit QWindowContainer(QWindow *embeddedWindow, QWidget *parent = 0, Qt::WindowFlags f = 0);
+ explicit QWindowContainer(QWindow *embeddedWindow, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QWindowContainer();
QWindow *containedWindow() const;
diff --git a/src/widgets/kernel/win.pri b/src/widgets/kernel/win.pri
index f6877b02db..3b3170beb1 100644
--- a/src/widgets/kernel/win.pri
+++ b/src/widgets/kernel/win.pri
@@ -2,4 +2,7 @@
# --------------------------------------------------------------------
INCLUDEPATH += ../3rdparty/wintab
-!winrt: LIBS_PRIVATE *= -lshell32 -luxtheme -ldwmapi
+!winrt {
+ LIBS_PRIVATE *= -luxtheme -ldwmapi
+ QMAKE_USE_PRIVATE += shell32
+}
diff --git a/src/widgets/statemachine/qbasickeyeventtransition_p.h b/src/widgets/statemachine/qbasickeyeventtransition_p.h
index 7e1b978bba..f23c078570 100644
--- a/src/widgets/statemachine/qbasickeyeventtransition_p.h
+++ b/src/widgets/statemachine/qbasickeyeventtransition_p.h
@@ -63,11 +63,11 @@ class Q_AUTOTEST_EXPORT QBasicKeyEventTransition : public QAbstractTransition
{
Q_OBJECT
public:
- QBasicKeyEventTransition(QState *sourceState = 0);
- QBasicKeyEventTransition(QEvent::Type type, int key, QState *sourceState = 0);
+ QBasicKeyEventTransition(QState *sourceState = nullptr);
+ QBasicKeyEventTransition(QEvent::Type type, int key, QState *sourceState = nullptr);
QBasicKeyEventTransition(QEvent::Type type, int key,
Qt::KeyboardModifiers modifierMask,
- QState *sourceState = 0);
+ QState *sourceState = nullptr);
~QBasicKeyEventTransition();
QEvent::Type eventType() const;
diff --git a/src/widgets/statemachine/qbasicmouseeventtransition_p.h b/src/widgets/statemachine/qbasicmouseeventtransition_p.h
index 132e223535..dd619d189c 100644
--- a/src/widgets/statemachine/qbasicmouseeventtransition_p.h
+++ b/src/widgets/statemachine/qbasicmouseeventtransition_p.h
@@ -65,9 +65,9 @@ class Q_AUTOTEST_EXPORT QBasicMouseEventTransition : public QAbstractTransition
{
Q_OBJECT
public:
- QBasicMouseEventTransition(QState *sourceState = 0);
+ QBasicMouseEventTransition(QState *sourceState = nullptr);
QBasicMouseEventTransition(QEvent::Type type, Qt::MouseButton button,
- QState *sourceState = 0);
+ QState *sourceState = nullptr);
~QBasicMouseEventTransition();
QEvent::Type eventType() const;
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 35b630cde2..271b43fe89 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -116,10 +116,7 @@
#include <limits.h>
-#if QT_CONFIG(itemviews)
-# include "private/qtextengine_p.h"
-#endif
-
+#include <private/qtextengine_p.h>
#include <private/qstylehelper_p.h>
QT_BEGIN_NAMESPACE
@@ -1256,12 +1253,12 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w
*iconRect = QRect(tr.left() + offsetX, tr.center().y() - tabIconSize.height() / 2,
tabIconSize.width(), tabIconSize.height());
if (!verticalTabs)
- *iconRect = proxyStyle->visualRect(opt->direction, opt->rect, *iconRect);
+ *iconRect = QStyle::visualRect(opt->direction, opt->rect, *iconRect);
tr.setLeft(tr.left() + tabIconSize.width() + 4);
}
if (!verticalTabs)
- tr = proxyStyle->visualRect(opt->direction, opt->rect, tr);
+ tr = QStyle::visualRect(opt->direction, opt->rect, tr);
*textRect = tr;
}
@@ -4250,10 +4247,11 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cb = qstyleoption_cast<const QStyleOptionComboBox *>(opt)) {
+ const qreal dpi = QStyleHelper::dpi(opt);
const int x = cb->rect.x(), y = cb->rect.y(), wi = cb->rect.width(), he = cb->rect.height();
- const int margin = cb->frame ? qRound(QStyleHelper::dpiScaled(3)) : 0;
- const int bmarg = cb->frame ? qRound(QStyleHelper::dpiScaled(2)) : 0;
- const int xpos = x + wi - bmarg - qRound(QStyleHelper::dpiScaled(16));
+ const int margin = cb->frame ? qRound(QStyleHelper::dpiScaled(3, dpi)) : 0;
+ const int bmarg = cb->frame ? qRound(QStyleHelper::dpiScaled(2, dpi)) : 0;
+ const int xpos = x + wi - bmarg - qRound(QStyleHelper::dpiScaled(16, dpi));
switch (sc) {
@@ -4261,10 +4259,10 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
ret = cb->rect;
break;
case SC_ComboBoxArrow:
- ret.setRect(xpos, y + bmarg, qRound(QStyleHelper::dpiScaled(16)), he - 2*bmarg);
+ ret.setRect(xpos, y + bmarg, qRound(QStyleHelper::dpiScaled(16, opt)), he - 2*bmarg);
break;
case SC_ComboBoxEditField:
- ret.setRect(x + margin, y + margin, wi - 2 * margin - qRound(QStyleHelper::dpiScaled(16)), he - 2 * margin);
+ ret.setRect(x + margin, y + margin, wi - 2 * margin - qRound(QStyleHelper::dpiScaled(16, dpi)), he - 2 * margin);
break;
case SC_ComboBoxListBoxPopup:
ret = cb->rect;
@@ -4508,13 +4506,13 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
ret = 0;
break;
case PM_DialogButtonsSeparator:
- ret = int(QStyleHelper::dpiScaled(5.));
+ ret = int(QStyleHelper::dpiScaled(5, opt));
break;
case PM_DialogButtonsButtonWidth:
- ret = int(QStyleHelper::dpiScaled(70.));
+ ret = int(QStyleHelper::dpiScaled(70, opt));
break;
case PM_DialogButtonsButtonHeight:
- ret = int(QStyleHelper::dpiScaled(30.));
+ ret = int(QStyleHelper::dpiScaled(30, opt));
break;
case PM_TitleBarHeight: {
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
@@ -4522,33 +4520,33 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 16);
#if QT_CONFIG(dockwidget)
} else if (qobject_cast<const QDockWidget*>(widget)) {
- ret = qMax(widget->fontMetrics().height(), int(QStyleHelper::dpiScaled(13)));
+ ret = qMax(widget->fontMetrics().height(), int(QStyleHelper::dpiScaled(13, opt)));
#endif
} else {
ret = qMax(widget ? widget->fontMetrics().height() : opt->fontMetrics.height(), 18);
}
} else {
- ret = int(QStyleHelper::dpiScaled(18.));
+ ret = int(QStyleHelper::dpiScaled(18., opt));
}
break; }
case PM_TitleBarButtonSize:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16., opt));
break;
case PM_TitleBarButtonIconSize:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16., opt));
break;
case PM_ScrollBarSliderMin:
- ret = int(QStyleHelper::dpiScaled(9.));
+ ret = int(QStyleHelper::dpiScaled(9., opt));
break;
case PM_ButtonMargin:
- ret = int(QStyleHelper::dpiScaled(6.));
+ ret = int(QStyleHelper::dpiScaled(6., opt));
break;
case PM_DockWidgetTitleBarButtonMargin:
- ret = int(QStyleHelper::dpiScaled(2.));
+ ret = int(QStyleHelper::dpiScaled(2., opt));
break;
case PM_ButtonDefaultIndicator:
@@ -4556,7 +4554,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_MenuButtonIndicator:
- ret = int(QStyleHelper::dpiScaled(12.));
+ ret = int(QStyleHelper::dpiScaled(12, opt));
break;
case PM_ButtonShiftHorizontal:
@@ -4571,15 +4569,15 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
case PM_MenuPanelWidth:
case PM_TabBarBaseOverlap:
case PM_TabBarBaseHeight:
- ret = proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget);
+ ret = proxy()->pixelMetric(PM_DefaultFrameWidth, opt);
break;
case PM_MdiSubWindowFrameWidth:
- ret = int(QStyleHelper::dpiScaled(4.));
+ ret = int(QStyleHelper::dpiScaled(4, opt));
break;
case PM_MdiSubWindowMinimizedWidth:
- ret = int(QStyleHelper::dpiScaled(196.));
+ ret = int(QStyleHelper::dpiScaled(196, opt));
break;
#if QT_CONFIG(scrollbar)
@@ -4590,7 +4588,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
: QApplication::globalStrut().width();
ret = qMax(16, s);
} else {
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16, opt));
}
break;
#endif
@@ -4600,7 +4598,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
#if QT_CONFIG(slider)
case PM_SliderThickness:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16, opt));
break;
case PM_SliderTickmarkOffset:
@@ -4634,11 +4632,11 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
#endif // QT_CONFIG(slider)
#if QT_CONFIG(dockwidget)
case PM_DockWidgetSeparatorExtent:
- ret = int(QStyleHelper::dpiScaled(6.));
+ ret = int(QStyleHelper::dpiScaled(6, opt));
break;
case PM_DockWidgetHandleExtent:
- ret = int(QStyleHelper::dpiScaled(8.));
+ ret = int(QStyleHelper::dpiScaled(8, opt));
break;
case PM_DockWidgetTitleMargin:
ret = 0;
@@ -4667,19 +4665,19 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_ToolBarItemSpacing:
- ret = int(QStyleHelper::dpiScaled(4.));
+ ret = int(QStyleHelper::dpiScaled(4, opt));
break;
case PM_ToolBarHandleExtent:
- ret = int(QStyleHelper::dpiScaled(8.));
+ ret = int(QStyleHelper::dpiScaled(8, opt));
break;
case PM_ToolBarSeparatorExtent:
- ret = int(QStyleHelper::dpiScaled(6.));
+ ret = int(QStyleHelper::dpiScaled(6, opt));
break;
case PM_ToolBarExtensionExtent:
- ret = int(QStyleHelper::dpiScaled(12.));
+ ret = int(QStyleHelper::dpiScaled(12, opt));
break;
#endif // QT_CONFIG(toolbar)
@@ -4689,7 +4687,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_TabBarTabHSpace:
- ret = int(QStyleHelper::dpiScaled(24.));
+ ret = int(QStyleHelper::dpiScaled(24, opt));
break;
case PM_TabBarTabShiftHorizontal:
@@ -4718,27 +4716,27 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_IndicatorWidth:
- ret = int(QStyleHelper::dpiScaled(13.));
+ ret = int(QStyleHelper::dpiScaled(13, opt));
break;
case PM_IndicatorHeight:
- ret = int(QStyleHelper::dpiScaled(13.));
+ ret = int(QStyleHelper::dpiScaled(13, opt));
break;
case PM_ExclusiveIndicatorWidth:
- ret = int(QStyleHelper::dpiScaled(12.));
+ ret = int(QStyleHelper::dpiScaled(12, opt));
break;
case PM_ExclusiveIndicatorHeight:
- ret = int(QStyleHelper::dpiScaled(12.));
+ ret = int(QStyleHelper::dpiScaled(12, opt));
break;
case PM_MenuTearoffHeight:
- ret = int(QStyleHelper::dpiScaled(10.));
+ ret = int(QStyleHelper::dpiScaled(10, opt));
break;
case PM_MenuScrollerHeight:
- ret = int(QStyleHelper::dpiScaled(10.));
+ ret = int(QStyleHelper::dpiScaled(10, opt));
break;
case PM_MenuDesktopFrameWidth:
@@ -4748,22 +4746,22 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_HeaderMargin:
- ret = int(QStyleHelper::dpiScaled(4.));
+ ret = int(QStyleHelper::dpiScaled(4, opt));
break;
case PM_HeaderMarkSize:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16, opt));
break;
case PM_HeaderGripMargin:
- ret = int(QStyleHelper::dpiScaled(4.));
+ ret = int(QStyleHelper::dpiScaled(4, opt));
break;
case PM_HeaderDefaultSectionSizeHorizontal:
- ret = int(QStyleHelper::dpiScaled(100.));
+ ret = int(QStyleHelper::dpiScaled(100, opt));
break;
case PM_HeaderDefaultSectionSizeVertical:
- ret = int(QStyleHelper::dpiScaled(30.));
+ ret = int(QStyleHelper::dpiScaled(30, opt));
break;
case PM_TabBarScrollButtonWidth:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16, opt));
break;
case PM_LayoutLeftMargin:
case PM_LayoutTopMargin:
@@ -4785,13 +4783,13 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_DefaultTopLevelMargin:
- ret = int(QStyleHelper::dpiScaled(11.));
+ ret = int(QStyleHelper::dpiScaled(11, opt));
break;
case PM_DefaultChildMargin:
- ret = int(QStyleHelper::dpiScaled(9.));
+ ret = int(QStyleHelper::dpiScaled(9, opt));
break;
case PM_DefaultLayoutSpacing:
- ret = int(QStyleHelper::dpiScaled(6.));
+ ret = int(QStyleHelper::dpiScaled(6, opt));
break;
case PM_ToolBarIconSize:
@@ -4799,31 +4797,31 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
ret = theme->themeHint(QPlatformTheme::ToolBarIconSize).toInt();
if (ret <= 0)
- ret = int(QStyleHelper::dpiScaled(24.));
+ ret = int(QStyleHelper::dpiScaled(24, opt));
break;
case PM_TabBarIconSize:
- ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
+ ret = proxy()->pixelMetric(PM_SmallIconSize, opt);
break;
case PM_ListViewIconSize:
#if QT_CONFIG(filedialog)
if (qobject_cast<const QSidebar *>(widget))
- ret = int(QStyleHelper::dpiScaled(24.));
+ ret = int(QStyleHelper::dpiScaled(24., opt));
else
#endif
- ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
+ ret = proxy()->pixelMetric(PM_SmallIconSize, opt);
break;
case PM_ButtonIconSize:
case PM_SmallIconSize:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16, opt));
break;
case PM_IconViewIconSize:
- ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget);
+ ret = proxy()->pixelMetric(PM_LargeIconSize, opt);
break;
case PM_LargeIconSize:
- ret = int(QStyleHelper::dpiScaled(32.));
+ ret = int(QStyleHelper::dpiScaled(32, opt));
break;
case PM_ToolTipLabelFrameWidth:
@@ -4831,19 +4829,19 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_CheckBoxLabelSpacing:
case PM_RadioButtonLabelSpacing:
- ret = int(QStyleHelper::dpiScaled(6.));
+ ret = int(QStyleHelper::dpiScaled(6, opt));
break;
case PM_SizeGripSize:
- ret = int(QStyleHelper::dpiScaled(13.));
+ ret = int(QStyleHelper::dpiScaled(13, opt));
break;
case PM_MessageBoxIconSize:
#ifdef Q_OS_MAC
- if (QApplication::desktopSettingsAware()) {
+ if (QGuiApplication::desktopSettingsAware()) {
ret = 64; // No DPI scaling, it's handled elsewhere.
} else
#endif
{
- ret = int(QStyleHelper::dpiScaled(32.));
+ ret = int(QStyleHelper::dpiScaled(32, opt));
}
break;
case PM_TextCursorWidth:
@@ -4854,19 +4852,19 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_TabCloseIndicatorWidth:
case PM_TabCloseIndicatorHeight:
- ret = int(QStyleHelper::dpiScaled(16.));
+ ret = int(QStyleHelper::dpiScaled(16, opt));
break;
case PM_ScrollView_ScrollBarSpacing:
- ret = 2 * proxy()->pixelMetric(PM_DefaultFrameWidth, opt, widget);
+ ret = 2 * proxy()->pixelMetric(PM_DefaultFrameWidth, opt);
break;
case PM_ScrollView_ScrollBarOverlap:
ret = 0;
break;
case PM_SubMenuOverlap:
- ret = -proxy()->pixelMetric(QStyle::PM_MenuPanelWidth, opt, widget);
+ ret = -proxy()->pixelMetric(QStyle::PM_MenuPanelWidth, opt);
break;
case PM_TreeViewIndentation:
- ret = int(QStyleHelper::dpiScaled(20.));
+ ret = int(QStyleHelper::dpiScaled(20, opt));
break;
default:
ret = 0;
@@ -5463,14 +5461,14 @@ static QIcon clearTextIcon(bool rtl)
QPixmap QCommonStyle::standardPixmap(StandardPixmap sp, const QStyleOption *option,
const QWidget *widget) const
{
- const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft());
+ const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QGuiApplication::isRightToLeft());
#ifdef QT_NO_IMAGEFORMAT_PNG
Q_UNUSED(widget);
Q_UNUSED(sp);
#else
QPixmap pixmap;
- if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) {
+ if (QGuiApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) {
switch (sp) {
case SP_DialogYesButton:
case SP_DialogOkButton:
@@ -5832,7 +5830,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
const QWidget *widget) const
{
QIcon icon;
- const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QApplication::isRightToLeft());
+ const bool rtl = (option && option->direction == Qt::RightToLeft) || (!option && QGuiApplication::isRightToLeft());
#ifdef Q_OS_WIN
switch (standardIcon) {
@@ -5884,7 +5882,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
#endif
- if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) {
+ if (QGuiApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty()) {
switch (standardIcon) {
case SP_DirHomeIcon:
icon = QIcon::fromTheme(QLatin1String("user-home"));
@@ -5969,6 +5967,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
case SP_ArrowLeft:
icon = QIcon::fromTheme(QLatin1String("go-previous"));
break;
+ case SP_DialogNoButton:
case SP_DialogCancelButton:
icon = QIcon::fromTheme(QLatin1String("dialog-cancel"),
QIcon::fromTheme(QLatin1String("process-stop")));
@@ -6060,13 +6059,13 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
default:
break;
}
- } // if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty())
+ } // if (QGuiApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty())
if (!icon.isNull())
return icon;
#if defined(Q_OS_MAC)
- if (QApplication::desktopSettingsAware()) {
+ if (QGuiApplication::desktopSettingsAware()) {
switch (standardIcon) {
case SP_DirIcon: {
// A rather special case
@@ -6132,7 +6131,7 @@ QIcon QCommonStyle::standardIcon(StandardPixmap standardIcon, const QStyleOption
default:
break;
}
- } // if (QApplication::desktopSettingsAware())
+ } // if (QGuiApplication::desktopSettingsAware())
#endif // Q_OS_MAC
switch (standardIcon) {
diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h
index 296f89ce5f..4860dfe4c9 100644
--- a/src/widgets/styles/qcommonstyle_p.h
+++ b/src/widgets/styles/qcommonstyle_p.h
@@ -71,7 +71,7 @@ class Q_WIDGETS_EXPORT QCommonStylePrivate : public QStylePrivate
public:
inline QCommonStylePrivate() :
#if QT_CONFIG(itemviews)
- cachedOption(0),
+ cachedOption(nullptr),
#endif
animationFps(30)
{ }
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index 34cc3c93db..b58dc1660a 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -88,6 +88,7 @@
#include <private/qstylehelper_p.h>
#include <private/qdrawhelper_p.h>
#include <private/qapplication_p.h>
+#include <private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -250,8 +251,9 @@ static void qt_fusion_draw_arrow(Qt::ArrowType type, QPainter *painter, const QS
if (rect.isEmpty())
return;
- const int arrowWidth = QStyleHelper::dpiScaled(14);
- const int arrowHeight = QStyleHelper::dpiScaled(8);
+ const qreal dpi = QStyleHelper::dpi(option);
+ const int arrowWidth = int(QStyleHelper::dpiScaled(14, dpi));
+ const int arrowHeight = int(QStyleHelper::dpiScaled(8, dpi));
const int arrowMax = qMin(arrowHeight, arrowWidth);
const int rectMax = qMin(rect.height(), rect.width());
@@ -363,6 +365,11 @@ static void qt_fusion_draw_mdibutton(QPainter *painter, const QStyleOptionTitleB
painter->drawPoint(tmp.right() , tmp.bottom() - 1);
}
+static QWindow *qt_getWindow(const QWidget *widget)
+{
+ return widget ? QWidgetPrivate::get(widget)->windowHandle(QWidgetPrivate::WindowHandleMode::Closest) : nullptr;
+}
+
/*
\internal
*/
@@ -465,15 +472,24 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
switch (elem) {
+#if QT_CONFIG(groupbox)
// No frame drawn
case PE_FrameGroupBox:
{
QPixmap pixmap(QLatin1String(":/qt-project.org/styles/commonstyle/images/fusion_groupbox.png"));
- int topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin;
+ int topMargin = 0;
+ auto control = dynamic_cast<const QGroupBox *>(widget);
+ if (control && !control->isCheckable() && control->title().isEmpty()) {
+ // Shrinking the topMargin if Not checkable AND title is empty
+ topMargin = groupBoxTopMargin;
+ } else {
+ topMargin = qMax(pixelMetric(PM_ExclusiveIndicatorHeight), option->fontMetrics.height()) + groupBoxTopMargin;
+ }
QRect frame = option->rect.adjusted(0, topMargin, 0, 0);
qDrawBorderPixmap(painter, frame, QMargins(6, 6, 6, 6), pixmap);
break;
}
+#endif // QT_CONFIG(groupbox)
case PE_IndicatorBranch: {
if (!(option->state & State_Children))
break;
@@ -779,12 +795,13 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
painter->drawRect(rect.adjusted(checkMarkPadding, checkMarkPadding, -checkMarkPadding, -checkMarkPadding));
} else if (checkbox->state & State_On) {
- qreal penWidth = QStyleHelper::dpiScaled(1.5);
+ const qreal dpi = QStyleHelper::dpi(option);
+ qreal penWidth = QStyleHelper::dpiScaled(1.5, dpi);
penWidth = qMax<qreal>(penWidth, 0.13 * rect.height());
penWidth = qMin<qreal>(penWidth, 0.20 * rect.height());
QPen checkPen = QPen(checkMarkColor, penWidth);
checkMarkColor.setAlpha(210);
- painter->translate(dpiScaled(-0.8), dpiScaled(0.5));
+ painter->translate(dpiScaled(-0.8, dpi), dpiScaled(0.5, dpi));
painter->setPen(checkPen);
painter->setBrush(Qt::NoBrush);
@@ -984,7 +1001,7 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem,
d->tabBarcloseButtonIcon = proxy()->standardIcon(SP_DialogCloseButton, option, widget);
if ((option->state & State_Enabled) && (option->state & State_MouseOver))
proxy()->drawPrimitive(PE_PanelButtonCommand, option, painter, widget);
- QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(QSize(16, 16), QIcon::Normal, QIcon::On);
+ QPixmap pixmap = d->tabBarcloseButtonIcon.pixmap(qt_getWindow(widget), QSize(16, 16), QIcon::Normal, QIcon::On);
proxy()->drawItemPixmap(painter, option->rect, Qt::AlignCenter, pixmap);
}
break;
@@ -1024,7 +1041,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
if (!cb->currentIcon.isNull()) {
QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal
: QIcon::Disabled;
- QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);
+ QPixmap pixmap = cb->currentIcon.pixmap(qt_getWindow(widget), cb->iconSize, mode);
QRect iconRect(editRect);
iconRect.setWidth(cb->iconSize.width() + 4);
iconRect = alignedRect(cb->direction,
@@ -1535,7 +1552,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
QColor highlight = option->palette.highlight().color();
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
int w = 0;
- const int margin = QStyleHelper::dpiScaled(5);
+ const int margin = int(QStyleHelper::dpiScaled(5, option));
if (!menuItem->text.isEmpty()) {
painter->setFont(menuItem->font);
proxy()->drawItemText(painter, menuItem->rect.adjusted(margin, 0, -margin, 0), Qt::AlignLeft | Qt::AlignVCenter,
@@ -1565,7 +1582,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
bool ignoreCheckMark = false;
const int checkColHOffset = windowsItemHMargin + windowsItemFrame - 1;
int checkcol = qMax<int>(menuItem->rect.height() * 0.79,
- qMax<int>(menuItem->maxIconWidth, dpiScaled(21))); // icon checkbox's highlight column width
+ qMax<int>(menuItem->maxIconWidth, dpiScaled(21, option))); // icon checkbox's highlight column width
if (
#if QT_CONFIG(combobox)
qobject_cast<const QComboBox*>(widget) ||
@@ -1575,7 +1592,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
if (!ignoreCheckMark) {
// Check, using qreal and QRectF to avoid error accumulation
- const qreal boxMargin = dpiScaled(3.5);
+ const qreal boxMargin = dpiScaled(3.5, option);
const qreal boxWidth = checkcol - 2 * boxMargin;
QRectF checkRectF(option->rect.left() + boxMargin + checkColHOffset, option->rect.center().y() - boxWidth/2 + 1, boxWidth, boxWidth);
QRect checkRect = checkRectF.toRect();
@@ -1636,9 +1653,9 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
iconSize = combo->iconSize();
#endif
if (checked)
- pixmap = menuItem->icon.pixmap(iconSize, mode, QIcon::On);
+ pixmap = menuItem->icon.pixmap(qt_getWindow(widget), iconSize, mode, QIcon::On);
else
- pixmap = menuItem->icon.pixmap(iconSize, mode);
+ pixmap = menuItem->icon.pixmap(qt_getWindow(widget), iconSize, mode);
const int pixw = pixmap.width() / pixmap.devicePixelRatio();
const int pixh = pixmap.height() / pixmap.devicePixelRatio();
@@ -1772,7 +1789,7 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio
if (button->state & State_On)
state = QIcon::On;
- QPixmap pixmap = button->icon.pixmap(button->iconSize, mode, state);
+ QPixmap pixmap = button->icon.pixmap(qt_getWindow(widget), button->iconSize, mode, state);
int w = pixmap.width() / pixmap.devicePixelRatio();
int h = pixmap.height() / pixmap.devicePixelRatio();
@@ -3175,7 +3192,7 @@ int QFusionStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, co
default:
return QCommonStyle::pixelMetric(metric, option, widget);
}
- return QStyleHelper::dpiScaled(val);
+ return QStyleHelper::dpiScaled(val, option);
}
/*!
@@ -3227,7 +3244,7 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti
if (menuItem->text.contains(QLatin1Char('\t')))
w += tabSpacing;
else if (menuItem->menuItemType == QStyleOptionMenuItem::SubMenu)
- w += 2 * QStyleHelper::dpiScaled(QFusionStylePrivate::menuArrowHMargin);
+ w += 2 * QStyleHelper::dpiScaled(QFusionStylePrivate::menuArrowHMargin, option);
else if (menuItem->menuItemType == QStyleOptionMenuItem::DefaultItem) {
QFontMetrics fm(menuItem->font);
QFont fontBold = menuItem->font;
@@ -3235,9 +3252,10 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti
QFontMetrics fmBold(fontBold);
w += fmBold.horizontalAdvance(menuItem->text) - fm.horizontalAdvance(menuItem->text);
}
- const int checkcol = qMax<int>(maxpmw, QStyleHelper::dpiScaled(QFusionStylePrivate::menuCheckMarkWidth)); // Windows always shows a check column
+ const qreal dpi = QStyleHelper::dpi(option);
+ const int checkcol = qMax<int>(maxpmw, QStyleHelper::dpiScaled(QFusionStylePrivate::menuCheckMarkWidth, dpi)); // Windows always shows a check column
w += checkcol;
- w += QStyleHelper::dpiScaled(int(QFusionStylePrivate::menuRightBorder) + 10);
+ w += QStyleHelper::dpiScaled(int(QFusionStylePrivate::menuRightBorder) + 10, dpi);
newSize.setWidth(w);
if (menuItem->menuItemType == QStyleOptionMenuItem::Separator) {
if (!menuItem->text.isEmpty()) {
@@ -3251,8 +3269,8 @@ QSize QFusionStyle::sizeFromContents(ContentsType type, const QStyleOption *opti
}
#endif
}
- newSize.setWidth(newSize.width() + QStyleHelper::dpiScaled(12));
- newSize.setWidth(qMax<int>(newSize.width(), QStyleHelper::dpiScaled(120)));
+ newSize.setWidth(newSize.width() + int(QStyleHelper::dpiScaled(12, dpi)));
+ newSize.setWidth(qMax<int>(newSize.width(), int(QStyleHelper::dpiScaled(120, dpi))));
}
break;
case CT_SizeGrip:
@@ -3400,7 +3418,7 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
break;
case SC_SliderGroove: {
QPoint grooveCenter = slider->rect.center();
- const int grooveThickness = QStyleHelper::dpiScaled(7);
+ const int grooveThickness = QStyleHelper::dpiScaled(7, option);
if (slider->orientation == Qt::Horizontal) {
rect.setHeight(grooveThickness);
if (slider->tickPosition & QSlider::TicksAbove)
@@ -3429,7 +3447,7 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
int center = spinbox->rect.height() / 2;
int fw = spinbox->frame ? 3 : 0; // Is drawn with 3 pixels width in drawComplexControl, independently from PM_SpinBoxFrameWidth
int y = fw;
- const int buttonWidth = QStyleHelper::dpiScaled(14);
+ const int buttonWidth = QStyleHelper::dpiScaled(14, option);
int x, lx, rx;
x = spinbox->rect.width() - y - buttonWidth + 2;
lx = fw;
@@ -3513,17 +3531,19 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
case CC_ComboBox:
switch (subControl) {
- case SC_ComboBoxArrow:
+ case SC_ComboBoxArrow: {
+ const qreal dpi = QStyleHelper::dpi(option);
rect = visualRect(option->direction, option->rect, rect);
- rect.setRect(rect.right() - QStyleHelper::dpiScaled(18), rect.top() - 2,
- QStyleHelper::dpiScaled(19), rect.height() + 4);
+ rect.setRect(rect.right() - int(QStyleHelper::dpiScaled(18, dpi)), rect.top() - 2,
+ int(QStyleHelper::dpiScaled(19, dpi)), rect.height() + 4);
rect = visualRect(option->direction, option->rect, rect);
+ }
break;
case SC_ComboBoxEditField: {
int frameWidth = 2;
rect = visualRect(option->direction, option->rect, rect);
rect.setRect(option->rect.left() + frameWidth, option->rect.top() + frameWidth,
- option->rect.width() - int(QStyleHelper::dpiScaled(19)) - 2 * frameWidth,
+ option->rect.width() - int(QStyleHelper::dpiScaled(19, option)) - 2 * frameWidth,
option->rect.height() - 2 * frameWidth);
if (const QStyleOptionComboBox *box = qstyleoption_cast<const QStyleOptionComboBox *>(option)) {
if (!box->editable) {
diff --git a/src/widgets/styles/qfusionstyle_p.h b/src/widgets/styles/qfusionstyle_p.h
index e67e792727..cbefe3e1af 100644
--- a/src/widgets/styles/qfusionstyle_p.h
+++ b/src/widgets/styles/qfusionstyle_p.h
@@ -72,28 +72,28 @@ public:
QPalette standardPalette () const override;
void drawPrimitive(PrimitiveElement elem,
const QStyleOption *option,
- QPainter *painter, const QWidget *widget = 0) const override;
+ QPainter *painter, const QWidget *widget = nullptr) const override;
void drawControl(ControlElement ce, const QStyleOption *option, QPainter *painter,
const QWidget *widget) const override;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
QPainter *painter, const QWidget *widget) const override;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption *option,
const QSize &size, const QWidget *widget) const override;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w = 0) const override;
+ const QPoint &pt, const QWidget *w = nullptr) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
SubControl sc, const QWidget *widget) const override;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *opt) const override;
- int styleHint(StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0,
- QStyleHintReturn *returnData = 0) const override;
+ int styleHint(StyleHint hint, const QStyleOption *option = nullptr, const QWidget *widget = nullptr,
+ QStyleHintReturn *returnData = nullptr) const override;
QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const override;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
- const QWidget *widget = 0) const override;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
- const QWidget *widget = 0) const override;
+ const QWidget *widget = nullptr) const override;
void drawItemPixmap(QPainter *painter, const QRect &rect,
int alignment, const QPixmap &pixmap) const override;
void drawItemText(QPainter *painter, const QRect &rect,
diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp
index 976bd2630e..05e8467528 100644
--- a/src/widgets/styles/qpixmapstyle.cpp
+++ b/src/widgets/styles/qpixmapstyle.cpp
@@ -122,9 +122,6 @@ QPixmapStyle::~QPixmapStyle()
void QPixmapStyle::polish(QApplication *application)
{
QCommonStyle::polish(application);
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
-#endif
}
/*!
@@ -188,11 +185,6 @@ void QPixmapStyle::polish(QWidget *widget)
frame->setContentsMargins(pix.margins.left(), desc.margins.top(),
pix.margins.right(), desc.margins.bottom());
frame->setAttribute(Qt::WA_TranslucentBackground);
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- // FramelessWindowHint is needed on windows to make
- // WA_TranslucentBackground work properly
- frame->setWindowFlags(widget->windowFlags() | Qt::FramelessWindowHint);
-#endif
}
}
#endif // QT_CONFIG(combobox)
diff --git a/src/widgets/styles/qpixmapstyle_p.h b/src/widgets/styles/qpixmapstyle_p.h
index 590434d95e..d32631a527 100644
--- a/src/widgets/styles/qpixmapstyle_p.h
+++ b/src/widgets/styles/qpixmapstyle_p.h
@@ -147,7 +147,7 @@ public:
void drawControl(ControlElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget = nullptr) const override;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *option,
- QPainter *painter, const QWidget *widget=0) const override;
+ QPainter *painter, const QWidget *widget=nullptr) const override;
QSize sizeFromContents(ContentsType type, const QStyleOption *option,
const QSize &contentsSize, const QWidget *widget = nullptr) const override;
diff --git a/src/widgets/styles/qproxystyle_p.h b/src/widgets/styles/qproxystyle_p.h
index 2343a03e2a..2321f0fed0 100644
--- a/src/widgets/styles/qproxystyle_p.h
+++ b/src/widgets/styles/qproxystyle_p.h
@@ -67,7 +67,7 @@ public:
void ensureBaseStyle() const;
private:
QProxyStylePrivate() :
- QCommonStylePrivate(), baseStyle(0) {}
+ QCommonStylePrivate(), baseStyle(nullptr) {}
mutable QPointer <QStyle> baseStyle;
};
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index ec5b6df6b3..6cbed34c3a 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -560,7 +560,7 @@ QRect QStyle::itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pi
x += w - pixmapWidth;
else if ((alignment & Qt::AlignHCenter) == Qt::AlignHCenter)
x += w/2 - pixmapWidth/2;
- else if ((alignment & Qt::AlignLeft) != Qt::AlignLeft && QApplication::isRightToLeft())
+ else if ((alignment & Qt::AlignLeft) != Qt::AlignLeft && QGuiApplication::isRightToLeft())
x += w - pixmapWidth;
result = QRect(x, y, pixmapWidth, pixmapHeight);
return result;
@@ -624,7 +624,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
const QPixmap &pixmap) const
{
qreal scale = pixmap.devicePixelRatio();
- QRect aligned = alignedRect(QApplication::layoutDirection(), QFlag(alignment), pixmap.size() / scale, rect);
+ QRect aligned = alignedRect(QGuiApplication::layoutDirection(), QFlag(alignment), pixmap.size() / scale, rect);
QRect inter = aligned.intersected(rect);
painter->drawPixmap(inter.x(), inter.y(), pixmap, inter.x() - aligned.x(), inter.y() - aligned.y(), inter.width() * scale, inter.height() *scale);
@@ -2101,6 +2101,20 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SP_MediaVolume Icon indicating a volume control.
\value SP_MediaVolumeMuted Icon indicating a muted volume control.
\value SP_LineEditClearButton Icon for a standard clear button in a QLineEdit. This enum value was added in Qt 5.2.
+ \value SP_DialogYesToAllButton Icon for a standard YesToAll button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
+ \value SP_DialogNoToAllButton Icon for a standard NoToAll button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
+ \value SP_DialogSaveAllButton Icon for a standard SaveAll button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
+ \value SP_DialogAbortButton Icon for a standard Abort button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
+ \value SP_DialogRetryButton Icon for a standard Retry button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
+ \value SP_DialogIgnoreButton Icon for a standard Ignore button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
+ \value SP_RestoreDefaultsButton Icon for a standard RestoreDefaults button in a QDialogButtonBox.
+ This enum value was added in Qt 5.14.
\value SP_CustomBase Base value for custom standard pixmaps;
custom values must be greater than this value.
diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h
index 5ee37bd8e9..ee234457f5 100644
--- a/src/widgets/styles/qstyle.h
+++ b/src/widgets/styles/qstyle.h
@@ -832,6 +832,13 @@ public:
SP_MediaVolume,
SP_MediaVolumeMuted,
SP_LineEditClearButton,
+ SP_DialogYesToAllButton,
+ SP_DialogNoToAllButton,
+ SP_DialogSaveAllButton,
+ SP_DialogAbortButton,
+ SP_DialogRetryButton,
+ SP_DialogIgnoreButton,
+ SP_RestoreDefaultsButton,
// do not add any values below/greater than this
SP_CustomBase = 0xf0000000
};
diff --git a/src/widgets/styles/qstyle_p.h b/src/widgets/styles/qstyle_p.h
index 5bbde5fe17..7942cafaf7 100644
--- a/src/widgets/styles/qstyle_p.h
+++ b/src/widgets/styles/qstyle_p.h
@@ -66,7 +66,7 @@ class QStylePrivate: public QObjectPrivate
Q_DECLARE_PUBLIC(QStyle)
public:
inline QStylePrivate()
- : layoutSpacingIndex(-1), proxyStyle(0) {}
+ : layoutSpacingIndex(-1), proxyStyle(nullptr) {}
static bool useFullScreenForPopup();
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 0b910d46df..4e61b2d1ec 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -40,6 +40,8 @@
#include <qstyleoption.h>
#include <qpainter.h>
#include <qpixmapcache.h>
+#include <private/qhighdpiscaling_p.h>
+#include <private/qguiapplication_p.h>
#include <private/qmath_p.h>
#include <private/qstyle_p.h>
#include <qmath.h>
@@ -49,6 +51,7 @@
#include <qabstractscrollarea.h>
#include <qwindow.h>
+#include <qmetaobject.h>
#include "qstylehelper_p.h"
#include <qstringbuilder.h>
@@ -79,15 +82,41 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
return tmp;
}
-qreal dpiScaled(qreal value)
-{
-#ifdef Q_OS_MAC
- // On mac the DPI is always 72 so we should not scale it
- return value;
+#ifdef Q_OS_DARWIN
+static const qreal qstyleBaseDpi = 72;
#else
- static const qreal scale = qreal(qt_defaultDpiX()) / 96.0;
- return value * scale;
+static const qreal qstyleBaseDpi = 96;
+#endif
+
+Q_WIDGETS_EXPORT qreal dpi(const QStyleOption *option)
+{
+#ifndef Q_OS_DARWIN
+ // Prioritize the application override, except for on macOS where
+ // we have historically not supported the AA_Use96Dpi flag.
+ if (QCoreApplication::testAttribute(Qt::AA_Use96Dpi))
+ return 96;
#endif
+
+ // Expect that QStyleOption::QFontMetrics::QFont has the correct DPI set
+ if (option)
+ return option->fontMetrics.fontDpi();
+
+ return qstyleBaseDpi;
+}
+
+Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi)
+{
+ return value * dpi / qstyleBaseDpi;
+}
+
+Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, const QPaintDevice *device)
+{
+ return dpiScaled(value, device->logicalDpiX());
+}
+
+Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, const QStyleOption *option)
+{
+ return dpiScaled(value, dpi(option));
}
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h
index d79dfe4288..165608257a 100644
--- a/src/widgets/styles/qstylehelper_p.h
+++ b/src/widgets/styles/qstylehelper_p.h
@@ -40,6 +40,7 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qpoint.h>
#include <QtCore/qstring.h>
+#include <QtGui/qpaintdevice.h>
#include <QtGui/qpolygon.h>
#include <QtCore/qstringbuilder.h>
#include <QtGui/qaccessible.h>
@@ -75,7 +76,13 @@ class QWindow;
namespace QStyleHelper
{
QString uniqueName(const QString &key, const QStyleOption *option, const QSize &size);
- Q_WIDGETS_EXPORT qreal dpiScaled(qreal value);
+
+ Q_WIDGETS_EXPORT qreal dpi(const QStyleOption *option);
+
+ Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, qreal dpi);
+ Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, const QPaintDevice *device);
+ Q_WIDGETS_EXPORT qreal dpiScaled(qreal value, const QStyleOption *option);
+
#if QT_CONFIG(dial)
qreal angle(const QPointF &p1, const QPointF &p2);
QPolygonF calcLines(const QStyleOptionSlider *dial);
@@ -89,11 +96,11 @@ namespace QStyleHelper
Q_WIDGETS_EXPORT bool isInstanceOf(QObject *obj, QAccessible::Role role);
Q_WIDGETS_EXPORT bool hasAncestor(QObject *obj, QAccessible::Role role);
#endif
- Q_WIDGETS_EXPORT QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
+ Q_WIDGETS_EXPORT QColor backgroundColor(const QPalette &pal, const QWidget* widget = nullptr);
enum WidgetSizePolicy { SizeLarge = 0, SizeSmall = 1, SizeMini = 2, SizeDefault = -1 };
- Q_WIDGETS_EXPORT WidgetSizePolicy widgetSizePolicy(const QWidget *w, const QStyleOption *opt = 0);
+ Q_WIDGETS_EXPORT WidgetSizePolicy widgetSizePolicy(const QWidget *w, const QStyleOption *opt = nullptr);
}
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index 88031a9f1e..01cadd9a86 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -151,7 +151,7 @@ QT_BEGIN_NAMESPACE
QStyleOption::QStyleOption(int version, int type)
: version(version), type(type), state(QStyle::State_None),
- direction(QApplication::layoutDirection()), fontMetrics(QFont()), styleObject(0)
+ direction(QGuiApplication::layoutDirection()), fontMetrics(QFont()), styleObject(0)
{
}
@@ -198,11 +198,6 @@ void QStyleOption::init(const QWidget *widget)
state |= QStyle::State_Active;
if (widget->isWindow())
state |= QStyle::State_Window;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
- if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
- state &= ~QStyle::State_Enabled;
-#endif
switch (QStyleHelper::widgetSizePolicy(widget)) {
case QStyleHelper::SizeSmall:
state |= QStyle::State_Small;
@@ -1765,7 +1760,7 @@ QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
\value Exclusive The item is an exclusive check item (like a radio button).
\value NonExclusive The item is a non-exclusive check item (like a check box).
- \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusive
+ \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusionPolicy
*/
/*!
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 98a9f74f5b..3f57992311 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -615,7 +615,7 @@ public:
public:
int features;
QBrush defaultBackground;
- QFont font;
+ QFont font; // Be careful using this font directly. Prefer using font.resolve( )
bool hasFont;
QHash<QString, QVariant> styleHints;
@@ -851,7 +851,7 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget
info.rule = subRule;
info.offset = offsets[where];
info.where = where;
- infos.append(qMove(info));
+ infos.append(std::move(info));
offsets[where] += info.width;
}
@@ -909,7 +909,7 @@ static QStyle::StandardPixmap subControlIcon(int pe)
QRenderRule::QRenderRule(const QVector<Declaration> &declarations, const QObject *object)
: features(0), hasFont(false), pal(0), b(0), bg(0), bd(0), ou(0), geo(0), p(0), img(0), clipset(0)
{
- QPalette palette = QApplication::palette(); // ###: ideally widget's palette
+ QPalette palette = QGuiApplication::palette(); // ###: ideally widget's palette
ValueExtractor v(declarations, palette);
features = v.extractStyleFeatures();
@@ -2734,7 +2734,7 @@ static void updateObjects(const QList<const QObject *>& objects)
for (const QObject *object : objects) {
if (auto widget = qobject_cast<QWidget*>(const_cast<QObject*>(object))) {
widget->style()->polish(widget);
- QApplication::sendEvent(widget, &event);
+ QCoreApplication::sendEvent(widget, &event);
QList<const QObject *> children;
children.reserve(widget->children().size() + 1);
for (auto child: qAsConst(widget->children()))
@@ -3216,7 +3216,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
rule.drawRule(p, opt->rect);
toolOpt.rect = rule.contentsRect(opt->rect);
if (rule.hasFont)
- toolOpt.font = rule.font;
+ toolOpt.font = rule.font.resolve(toolOpt.font);
drawControl(CE_ToolButtonLabel, &toolOpt, p, w);
}
@@ -3451,7 +3451,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
case CE_ToolButtonLabel:
if (const QStyleOptionToolButton *btn = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
if (rule.hasBox() || btn->features & QStyleOptionToolButton::Arrow) {
- QCommonStyle::drawControl(ce, opt, p, w);
+ QWindowsStyle::drawControl(ce, opt, p, w);
} else {
QStyleOptionToolButton butOpt(*btn);
rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
@@ -3519,7 +3519,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
const QFont oldFont = p->font();
if (rule.hasFont)
- p->setFont(rule.font);
+ p->setFont(rule.font.resolve(p->font()));
if (rule.hasPosition() && rule.position()->textAlignment != 0) {
Qt::Alignment textAlignment = rule.position()->textAlignment;
@@ -3683,7 +3683,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
subRule.configurePalette(&mi.palette, QPalette::HighlightedText, QPalette::Highlight);
QFont oldFont = p->font();
if (subRule.hasFont)
- p->setFont(subRule.font.resolve(p->font()));
+ p->setFont(subRule.font.resolve(mi.font));
else
p->setFont(mi.font);
@@ -3825,7 +3825,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if (subRule.hasDrawable()) {
subRule.drawRule(p, opt->rect);
- QCommonStyle::drawControl(ce, &mi, p, w);
+ QCommonStyle::drawControl(ce, &mi, p, w); // deliberate bypass of the base
} else {
if (rule.hasDrawable() && !(opt->state & QStyle::State_Selected)) {
// So that the menu bar background is not hidden by the items
@@ -4089,8 +4089,13 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
subRule.configurePalette(&boxCopy.palette, QPalette::ButtonText, QPalette::Button);
QFont oldFont = p->font();
if (subRule.hasFont)
- p->setFont(subRule.font);
+ p->setFont(subRule.font.resolve(p->font()));
boxCopy.rect = subRule.contentsRect(opt->rect);
+ if (subRule.hasImage()) {
+ // the image is already drawn with CE_ToolBoxTabShape, adjust rect here
+ const int iconExtent = proxy()->pixelMetric(QStyle::PM_SmallIconSize, box, w);
+ boxCopy.rect.setLeft(boxCopy.rect.left() + iconExtent);
+ }
QWindowsStyle::drawControl(ce, &boxCopy, p , w);
if (subRule.hasFont)
p->setFont(oldFont);
@@ -4171,7 +4176,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
subRule.configurePalette(&tabCopy.palette, QPalette::WindowText, QPalette::Base);
QFont oldFont = p->font();
if (subRule.hasFont)
- p->setFont(subRule.font);
+ p->setFont(subRule.font.resolve(p->font()));
if (subRule.hasBox() || !subRule.hasNativeBorder()) {
tabCopy.rect = ce == CE_TabBarTabShape ? subRule.borderRect(r)
: subRule.contentsRect(r);
@@ -5030,13 +5035,25 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
if (subRule.hasGeometry() || subRule.hasBox() || !subRule.hasNativeBorder() || subRule.hasFont) {
sz = subRule.adjustSize(csz);
+ if (!sz.isValid()) {
+ // Try to set the missing values based on the base style.
+ const auto baseSize = baseStyle()->sizeFromContents(ct, opt, sz, w);
+ if (sz.width() < 0)
+ sz.setWidth(baseSize.width());
+ if (sz.height() < 0)
+ sz.setHeight(baseSize.height());
+ }
if (!subRule.hasGeometry()) {
QSize nativeContentsSize;
bool nullIcon = hdr->icon.isNull();
const int margin = pixelMetric(QStyle::PM_HeaderMargin, hdr, w);
int iconSize = nullIcon ? 0 : pixelMetric(QStyle::PM_SmallIconSize, hdr, w);
- const QSize txt = subRule.hasFont ? QFontMetrics(subRule.font).size(0, hdr->text)
- : hdr->fontMetrics.size(0, hdr->text);
+ QFontMetrics fm = hdr->fontMetrics;
+ if (subRule.hasFont) {
+ QFont styleFont = w ? subRule.font.resolve(w->font()) : subRule.font;
+ fm = QFontMetrics(styleFont);
+ }
+ const QSize txt = fm.size(0, hdr->text);
nativeContentsSize.setHeight(margin + qMax(iconSize, txt.height()) + margin);
nativeContentsSize.setWidth((nullIcon ? 0 : margin) + iconSize
+ (hdr->text.isNull() ? 0 : margin) + txt.width() + margin);
@@ -5153,13 +5170,6 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
sz = csz + QSize(vertical ? 0 : spaceForIcon, vertical ? spaceForIcon : 0);
return subRule.boxSize(subRule.adjustSize(sz));
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (baseStyle()->inherits("QMacStyle")) {
- //adjust the size after the call to the style because the mac style ignore the size arguments anyway.
- //this might cause the (max-){width,height} property to include the native style border while they should not.
- return subRule.adjustSize(baseStyle()->sizeFromContents(ct, opt, csz, w));
- }
-#endif
sz = subRule.adjustSize(csz);
break;
}
@@ -6073,7 +6083,7 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
w->d_func()->directFontResolveMask = font.resolve();
QEvent e(QEvent::FontChange);
- QApplication::sendEvent(w, &e);
+ QCoreApplication::sendEvent(w, &e);
}
}
diff --git a/src/widgets/styles/qstylesheetstyle_p.h b/src/widgets/styles/qstylesheetstyle_p.h
index 9c4b87fc32..c5266558af 100644
--- a/src/widgets/styles/qstylesheetstyle_p.h
+++ b/src/widgets/styles/qstylesheetstyle_p.h
@@ -82,40 +82,40 @@ public:
~QStyleSheetStyle();
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *w = 0) const override;
+ const QWidget *w = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const override;
+ const QWidget *w = nullptr) const override;
void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const override;
void drawItemText(QPainter *painter, const QRect& rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole = QPalette::NoRole) const override;
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const override;
+ const QWidget *w = nullptr) const override;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *option) const override;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
- const QPoint &pt, const QWidget *w = 0) const override;
+ const QPoint &pt, const QWidget *w = nullptr) const override;
QRect itemPixmapRect(const QRect &rect, int alignment, const QPixmap &pixmap) const override;
QRect itemTextRect(const QFontMetrics &metrics, const QRect &rect, int alignment, bool enabled,
const QString &text) const override;
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
void polish(QWidget *widget) override;
void polish(QApplication *app) override;
void polish(QPalette &pal) override;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *widget = 0) const override;
+ const QSize &contentsSize, const QWidget *widget = nullptr) const override;
QPalette standardPalette() const override;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = 0,
- const QWidget *widget = 0) const override;
- QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option = 0,
- const QWidget *w = 0 ) const override;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = nullptr,
+ const QWidget *widget = nullptr) const override;
+ QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *option = nullptr,
+ const QWidget *w = nullptr ) const override;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
- Qt::Orientation orientation, const QStyleOption *option = 0,
- const QWidget *widget = 0) const override;
- int styleHint(StyleHint sh, const QStyleOption *opt = 0, const QWidget *w = 0,
- QStyleHintReturn *shret = 0) const override;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const override;
+ Qt::Orientation orientation, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
+ int styleHint(StyleHint sh, const QStyleOption *opt = nullptr, const QWidget *w = nullptr,
+ QStyleHintReturn *shret = nullptr) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
- const QWidget *w = 0) const override;
+ const QWidget *w = nullptr) const override;
// These functions are called from QApplication/QWidget. Be careful.
QStyle *baseStyle() const;
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 4e450813cb..8496a2c223 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -84,6 +84,7 @@
#include <qpa/qplatformscreen.h>
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
+#include <private/qwidget_p.h>
#include <private/qstylehelper_p.h>
#if QT_CONFIG(animation)
@@ -119,10 +120,7 @@ enum QSliderDirection { SlUp, SlDown, SlLeft, SlRight };
\internal
*/
-QWindowsStylePrivate::QWindowsStylePrivate()
- : alt_down(false), menuBarTimer(0)
-{
-}
+QWindowsStylePrivate::QWindowsStylePrivate() = default;
qreal QWindowsStylePrivate::appDevicePixelRatio()
{
@@ -156,7 +154,7 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
QList<QWidget *> l = widget->findChildren<QWidget *>();
auto ignorable = [](QWidget *w) {
return w->isWindow() || !w->isVisible()
- || w->style()->styleHint(SH_UnderlineShortcut, 0, w);
+ || w->style()->styleHint(SH_UnderlineShortcut, nullptr, w);
};
l.erase(std::remove_if(l.begin(), l.end(), ignorable), l.end());
// Update states before repainting
@@ -241,14 +239,15 @@ void QWindowsStyle::polish(QApplication *app)
QCommonStyle::polish(app);
QWindowsStylePrivate *d = const_cast<QWindowsStylePrivate*>(d_func());
// We only need the overhead when shortcuts are sometimes hidden
- if (!proxy()->styleHint(SH_UnderlineShortcut, 0) && app)
+ if (!proxy()->styleHint(SH_UnderlineShortcut, nullptr) && app)
app->installEventFilter(this);
- d->activeCaptionColor = app->palette().highlight().color();
- d->activeGradientCaptionColor = app->palette().highlight() .color();
- d->inactiveCaptionColor = app->palette().dark().color();
- d->inactiveGradientCaptionColor = app->palette().dark().color();
- d->inactiveCaptionText = app->palette().window().color();
+ const auto &palette = QGuiApplication::palette();
+ d->activeGradientCaptionColor = palette.highlight().color();
+ d->activeCaptionColor = d->activeGradientCaptionColor;
+ d->inactiveGradientCaptionColor = palette.dark().color();
+ d->inactiveCaptionColor = d->inactiveGradientCaptionColor;
+ d->inactiveCaptionText = palette.window().color();
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) //fetch native title bar colors
if(app->desktopSettingsAware()){
@@ -341,7 +340,6 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm)
case QStyle::PM_MenuVMargin:
case QStyle::PM_ToolBarItemMargin:
return 1;
- break;
case QStyle::PM_DockWidgetSeparatorExtent:
return 4;
#if QT_CONFIG(tabbar)
@@ -380,23 +378,12 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm)
return QWindowsStylePrivate::InvalidMetric;
}
-static QWindow *windowOf(const QWidget *w)
+static QScreen *screenOf(const QWidget *w)
{
- QWindow *result = nullptr;
if (w) {
- result = w->windowHandle();
- if (!result) {
- if (const QWidget *np = w->nativeParentWidget())
- result = np->windowHandle();
- }
+ if (auto screen = qt_widget_private(const_cast<QWidget *>(w))->associatedScreen())
+ return screen;
}
- return result;
-}
-
-static QScreen *screenOf(const QWidget *w)
-{
- if (const QWindow *window = windowOf(w))
- return window->screen();
return QGuiApplication::primaryScreen();
}
@@ -405,8 +392,6 @@ static QScreen *screenOf(const QWidget *w)
// and account for secondary screens with differing logical DPI.
qreal QWindowsStylePrivate::nativeMetricScaleFactor(const QWidget *widget)
{
- if (!QHighDpiScaling::isActive())
- return 1;
qreal result = qreal(1) / QWindowsStylePrivate::devicePixelRatio(widget);
if (QGuiApplicationPrivate::screen_list.size() > 1) {
const QScreen *primaryScreen = QGuiApplication::primaryScreen();
@@ -432,7 +417,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
ret = QWindowsStylePrivate::fixedPixelMetric(pm);
if (ret != QWindowsStylePrivate::InvalidMetric)
- return int(QStyleHelper::dpiScaled(ret));
+ return int(QStyleHelper::dpiScaled(ret, opt));
ret = 0;
@@ -478,7 +463,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
break;
case PM_SplitterWidth:
- ret = qMax(int(QStyleHelper::dpiScaled(4)), QApplication::globalStrut().width());
+ ret = qMax(int(QStyleHelper::dpiScaled(4, opt)), QApplication::globalStrut().width());
break;
default:
@@ -707,17 +692,17 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
x -= 2;
if (opt->rect.height() > 4) {
qDrawShadePanel(p, x, 2, 3, opt->rect.height() - 4,
- opt->palette, false, 1, 0);
+ opt->palette, false, 1, nullptr);
qDrawShadePanel(p, x + 3, 2, 3, opt->rect.height() - 4,
- opt->palette, false, 1, 0);
+ opt->palette, false, 1, nullptr);
}
} else {
if (opt->rect.width() > 4) {
int y = opt->rect.height() / 2 - 4;
qDrawShadePanel(p, 2, y, opt->rect.width() - 4, 3,
- opt->palette, false, 1, 0);
+ opt->palette, false, 1, nullptr);
qDrawShadePanel(p, 2, y + 3, opt->rect.width() - 4, 3,
- opt->palette, false, 1, 0);
+ opt->palette, false, 1, nullptr);
}
}
p->restore();
@@ -768,7 +753,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
}
} else {
qDrawWinButton(p, opt->rect, opt->palette,
- opt->state & (State_Sunken | State_On), panel ? &fill : 0);
+ opt->state & (State_Sunken | State_On), panel ? &fill : nullptr);
}
} else {
p->fillRect(opt->rect, fill);
@@ -802,8 +787,11 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
QPen oldPen = p->pen();
p->setPen(QPen(opt->palette.shadow().color(), 0));
QRectF rect = opt->rect;
- rect.adjust(QStyleHelper::dpiScaled(0.5), QStyleHelper::dpiScaled(0.5),
- QStyleHelper::dpiScaled(-1.5), QStyleHelper::dpiScaled(-1.5));
+ const qreal dpi = QStyleHelper::dpi(opt);
+ const qreal topLevelAdjustment = QStyleHelper::dpiScaled(0.5, dpi);
+ const qreal bottomRightAdjustment = QStyleHelper::dpiScaled(-1.5, dpi);
+ rect.adjust(topLevelAdjustment, topLevelAdjustment,
+ bottomRightAdjustment, bottomRightAdjustment);
p->drawRect(rect);
p->setPen(oldPen);
break;
@@ -986,7 +974,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
if (opt->state & (State_Raised | State_On | State_Sunken)) {
qDrawWinButton(p, opt->rect, opt->palette, opt->state & (State_Sunken | State_On),
- panel ? &fill : 0);
+ panel ? &fill : nullptr);
} else {
if (panel)
p->fillRect(opt->rect, fill);
@@ -1011,7 +999,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
#endif // QT_CONFIG(dockwidget)
case PE_FrameStatusBarItem:
- qDrawShadePanel(p, opt->rect, opt->palette, true, 1, 0);
+ qDrawShadePanel(p, opt->rect, opt->palette, true, 1, nullptr);
break;
case PE_IndicatorProgressChunk:
@@ -1049,7 +1037,7 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
break;
case PE_FrameTabWidget: {
- qDrawWinButton(p, opt->rect, opt->palette, false, 0);
+ qDrawWinButton(p, opt->rect, opt->palette, false, nullptr);
break;
}
default:
@@ -1591,6 +1579,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
case QStyleOptionToolBar::Beginning:
case QStyleOptionToolBar::OnlyOne:
paintBottomBorder = false;
+ break;
default:
break;
}
@@ -1606,6 +1595,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
case QStyleOptionToolBar::OnlyOne:
paintRightBorder = false;
paintLeftBorder = false;
+ break;
default:
break;
}
@@ -2310,8 +2300,9 @@ QSize QWindowsStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
int defwidth = 0;
if (btn->features & QStyleOptionButton::AutoDefaultButton)
defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, btn, widget);
- int minwidth = int(QStyleHelper::dpiScaled(75.));
- int minheight = int(QStyleHelper::dpiScaled(23.));
+ const qreal dpi = QStyleHelper::dpi(opt);
+ int minwidth = int(QStyleHelper::dpiScaled(75, dpi));
+ int minheight = int(QStyleHelper::dpiScaled(23, dpi));
#ifndef QT_QWS_SMALL_PUSHBUTTON
if (w < minwidth + defwidth && !btn->text.isEmpty())
diff --git a/src/widgets/styles/qwindowsstyle_p.h b/src/widgets/styles/qwindowsstyle_p.h
index 47816ff651..b5f0bd68a1 100644
--- a/src/widgets/styles/qwindowsstyle_p.h
+++ b/src/widgets/styles/qwindowsstyle_p.h
@@ -77,25 +77,25 @@ public:
void polish(QPalette &) override;
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const override;
+ const QWidget *w = nullptr) const override;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
- const QWidget *w = 0) const override;
- QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = 0) const override;
+ const QWidget *w = nullptr) const override;
+ QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = nullptr) const override;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
- const QWidget *w = 0) const override;
+ const QWidget *w = nullptr) const override;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
- const QSize &contentsSize, const QWidget *widget = 0) const override;
+ const QSize &contentsSize, const QWidget *widget = nullptr) const override;
- int pixelMetric(PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0) const override;
+ int pixelMetric(PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const override;
- int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0,
- QStyleHintReturn *returnData = 0) const override;
+ int styleHint(StyleHint hint, const QStyleOption *opt = nullptr, const QWidget *widget = nullptr,
+ QStyleHintReturn *returnData = nullptr) const override;
QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt,
- const QWidget *widget = 0) const override;
+ const QWidget *widget = nullptr) const override;
- QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = 0,
- const QWidget *widget = 0) const override;
+ QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override;
protected:
bool eventFilter(QObject *o, QEvent *e) override;
diff --git a/src/widgets/styles/qwindowsstyle_p_p.h b/src/widgets/styles/qwindowsstyle_p_p.h
index 67fa6a2f86..4f6ffcefc2 100644
--- a/src/widgets/styles/qwindowsstyle_p_p.h
+++ b/src/widgets/styles/qwindowsstyle_p_p.h
@@ -69,17 +69,17 @@ public:
enum { InvalidMetric = -23576 };
QWindowsStylePrivate();
- static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = 0, const QWidget *widget = 0);
+ static int pixelMetricFromSystemDp(QStyle::PixelMetric pm, const QStyleOption *option = nullptr, const QWidget *widget = nullptr);
static int fixedPixelMetric(QStyle::PixelMetric pm);
- static qreal devicePixelRatio(const QWidget *widget = 0)
+ static qreal devicePixelRatio(const QWidget *widget = nullptr)
{ return widget ? widget->devicePixelRatioF() : QWindowsStylePrivate::appDevicePixelRatio(); }
static qreal nativeMetricScaleFactor(const QWidget *widget = nullptr);
bool hasSeenAlt(const QWidget *widget) const;
bool altDown() const { return alt_down; }
- bool alt_down;
+ bool alt_down = false;
QList<const QWidget *> seenAlt;
- int menuBarTimer;
+ int menuBarTimer = 0;
QColor inactiveCaptionText;
QColor activeCaptionColor;
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index e41f7e7573..7b69eff30c 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -145,7 +145,9 @@
#include "QtWidgets/qscrollbar.h"
#include "QtCore/qdir.h"
+#if QT_CONFIG(stringlistmodel)
#include "QtCore/qstringlistmodel.h"
+#endif
#if QT_CONFIG(dirmodel)
#include "QtWidgets/qdirmodel.h"
#endif
@@ -159,6 +161,7 @@
#include "QtWidgets/qapplication.h"
#include "QtGui/qevent.h"
#include "QtWidgets/qdesktopwidget.h"
+#include <private/qapplication_p.h>
#include <private/qdesktopwidget_p.h>
#if QT_CONFIG(lineedit)
#include "QtWidgets/qlineedit.h"
@@ -1414,7 +1417,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
// widget lost focus, hide the popup
if (d->widget && (!d->widget->hasFocus()
#ifdef QT_KEYPAD_NAVIGATION
- || (QApplication::keypadNavigationEnabled() && !d->widget->hasEditFocus())
+ || (QApplicationPrivate::keypadNavigationEnabled() && !d->widget->hasEditFocus())
#endif
))
d->popup->hide();
@@ -1432,7 +1435,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
switch (key) {
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
- if (!QApplication::keypadNavigationEnabled())
+ if (!QApplicationPrivate::keypadNavigationEnabled())
break;
#endif
case Qt::Key_Return:
@@ -1462,7 +1465,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
case QEvent::KeyRelease: {
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
- if (QApplication::keypadNavigationEnabled() && ke->key() == Qt::Key_Back) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && ke->key() == Qt::Key_Back) {
// Send the event to the 'widget'. This is what we did for KeyPress, so we need
// to do the same for KeyRelease, in case the widget's KeyPress event set
// up something (such as a timer) that is relying on also receiving the
@@ -1479,7 +1482,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
case QEvent::MouseButtonPress: {
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// if we've clicked in the widget (or its descendant), let it handle the click
QWidget *source = qobject_cast<QWidget *>(o);
if (source) {
@@ -1504,7 +1507,7 @@ bool QCompleter::eventFilter(QObject *o, QEvent *e)
case QEvent::InputMethod:
case QEvent::ShortcutOverride:
- QApplication::sendEvent(d->widget, e);
+ QCoreApplication::sendEvent(d->widget, e);
break;
default:
diff --git a/src/widgets/util/qcompleter_p.h b/src/widgets/util/qcompleter_p.h
index 21dddf446e..a52e63a6e2 100644
--- a/src/widgets/util/qcompleter_p.h
+++ b/src/widgets/util/qcompleter_p.h
@@ -75,7 +75,7 @@ class QCompleterPrivate : public QObjectPrivate
public:
QCompleterPrivate();
~QCompleterPrivate() { delete popup; }
- void init(QAbstractItemModel *model = 0);
+ void init(QAbstractItemModel *model = nullptr);
QPointer<QWidget> widget;
QCompletionModel *proxy;
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp
index a8b2a00a80..14a30ce7cf 100644
--- a/src/widgets/util/qflickgesture.cpp
+++ b/src/widgets/util/qflickgesture.cpp
@@ -228,7 +228,7 @@ public:
// we did send a press, so we need to fake a release now
// release all pressed mouse buttons
- /* Qt::MouseButtons mouseButtons = QApplication::mouseButtons();
+ /* Qt::MouseButtons mouseButtons = QGuiApplication::mouseButtons();
for (int i = 0; i < 32; ++i) {
if (mouseButtons & (1 << i)) {
Qt::MouseButton b = static_cast<Qt::MouseButton>(1 << i);
@@ -237,7 +237,7 @@ public:
qFGDebug() << "QFG: sending a fake mouse release at far-far-away to " << mouseTarget;
QMouseEvent re(QEvent::MouseButtonRelease, QPoint(), farFarAway,
- b, mouseButtons, QApplication::keyboardModifiers());
+ b, mouseButtons, QGuiApplication::keyboardModifiers());
sendMouseEvent(&re);
}
}*/
@@ -246,8 +246,8 @@ public:
qFGDebug() << "QFG: sending a fake mouse release at far-far-away to " << mouseTarget;
QMouseEvent re(QEvent::MouseButtonRelease, QPoint(), farFarAway, farFarAway,
- mouseButton, QApplication::mouseButtons() & ~mouseButton,
- QApplication::keyboardModifiers(), mouseEventSource);
+ mouseButton, QGuiApplication::mouseButtons() & ~mouseButton,
+ QGuiApplication::keyboardModifiers(), mouseEventSource);
sendMouseEvent(&re, RegrabMouseAfterwards);
// don't clear the mouseTarget just yet, since we need to explicitly ungrab the mouse on release!
}
@@ -462,21 +462,6 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
}
break;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // the only way to distinguish between real mouse wheels and wheel
- // events generated by the native 2 finger swipe gesture is to listen
- // for these events (according to Apple's Cocoa Event-Handling Guide)
-
- case QEvent::NativeGesture: {
- QNativeGestureEvent *nge = static_cast<QNativeGestureEvent *>(event);
- if (nge->gestureType == QNativeGestureEvent::GestureBegin)
- d->macIgnoreWheel = true;
- else if (nge->gestureType == QNativeGestureEvent::GestureEnd)
- d->macIgnoreWheel = false;
- break;
- }
-#endif
-
// consume all wheel events if the scroller is active
case QEvent::Wheel:
if (d->macIgnoreWheel || (scroller->state() != QScroller::Inactive))
diff --git a/src/widgets/util/qflickgesture_p.h b/src/widgets/util/qflickgesture_p.h
index d5ace887ae..0b47516047 100644
--- a/src/widgets/util/qflickgesture_p.h
+++ b/src/widgets/util/qflickgesture_p.h
@@ -71,7 +71,7 @@ class Q_WIDGETS_EXPORT QFlickGesture : public QGesture
Q_DECLARE_PRIVATE(QFlickGesture)
public:
- QFlickGesture(QObject *receiver, Qt::MouseButton button, QObject *parent = 0);
+ QFlickGesture(QObject *receiver, Qt::MouseButton button, QObject *parent = nullptr);
~QFlickGesture();
friend class QFlickGestureRecognizer;
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index 1e84237253..df05bbf71c 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -1031,7 +1031,8 @@ void QScrollerPrivate::setDpi(const QPointF &dpi)
*/
void QScrollerPrivate::setDpiFromWidget(QWidget *widget)
{
- const QScreen *screen = QGuiApplication::screens().at(QApplication::desktop()->screenNumber(widget));
+ const QScreen *screen = widget ? widget->screen() : QGuiApplication::primaryScreen();
+ Q_ASSERT(screen);
setDpi(QPointF(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY()));
}
diff --git a/src/widgets/util/qscrollerproperties.cpp b/src/widgets/util/qscrollerproperties.cpp
index c26fba2cd3..df6b899fe4 100644
--- a/src/widgets/util/qscrollerproperties.cpp
+++ b/src/widgets/util/qscrollerproperties.cpp
@@ -40,9 +40,6 @@
#include <QPointer>
#include <QObject>
#include <QtCore/qmath.h>
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-# include <QLibrary>
-#endif
#include "qscrollerproperties.h"
#include "private/qscrollerproperties_p.h"
@@ -73,10 +70,6 @@ QScrollerPropertiesPrivate *QScrollerPropertiesPrivate::defaults()
spp.overshootDragDistanceFactor = qreal(1);
spp.overshootScrollDistanceFactor = qreal(0.5);
spp.overshootScrollTime = qreal(0.7);
-# if 0 // Used to be included in Qt4 for Q_WS_WIN
- if (QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback"))
- spp.overshootScrollTime = qreal(0.35);
-# endif
spp.hOvershootPolicy = QScrollerProperties::OvershootWhenScrollable;
spp.vOvershootPolicy = QScrollerProperties::OvershootWhenScrollable;
spp.frameRate = QScrollerProperties::Standard;
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index a38a50d3df..fd18888870 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -626,16 +626,6 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
}
QPainterPath path;
-#if defined(QT_NO_XSHAPE) && 0 /* Used to be included in Qt4 for Q_WS_X11 */
- // XShape is required for setting the mask, so we just
- // draw an ugly square when its not available
- path.moveTo(0, 0);
- path.lineTo(sz.width() - 1, 0);
- path.lineTo(sz.width() - 1, sz.height() - 1);
- path.lineTo(0, sz.height() - 1);
- path.lineTo(0, 0);
- move(qMax(pos.x() - sz.width(), scr.left()), pos.y());
-#else
path.moveTo(ml + rc, mt);
if (arrowAtTop && arrowAtLeft) {
if (showArrow) {
@@ -685,7 +675,6 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
painter1.setBrush(QBrush(Qt::color1));
painter1.drawPath(path);
setMask(bitmap);
-#endif
// Draw the border
pixmap = QPixmap(sz);
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index 70e5f3678e..0c7bb94a91 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -151,11 +151,11 @@ bool QSystemTrayIconSys::event(QEvent *e)
{
switch (e->type()) {
case QEvent::ToolTip:
- QApplication::sendEvent(q, e);
+ QCoreApplication::sendEvent(q, e);
break;
#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
- return QApplication::sendEvent(q, e);
+ return QCoreApplication::sendEvent(q, e);
#endif
default:
break;
diff --git a/src/widgets/util/qundostack_p.h b/src/widgets/util/qundostack_p.h
index 04bc381114..05c9e0d27e 100644
--- a/src/widgets/util/qundostack_p.h
+++ b/src/widgets/util/qundostack_p.h
@@ -80,7 +80,7 @@ class QUndoStackPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QUndoStack)
public:
- QUndoStackPrivate() : index(0), clean_index(0), group(0), undo_limit(0) {}
+ QUndoStackPrivate() : index(0), clean_index(0), group(nullptr), undo_limit(0) {}
QList<QUndoCommand*> command_list;
QList<QUndoCommand*> macro_stack;
@@ -98,7 +98,7 @@ class QUndoAction : public QAction
{
Q_OBJECT
public:
- explicit QUndoAction(const QString &prefix, QObject *parent = 0);
+ explicit QUndoAction(const QString &prefix, QObject *parent = nullptr);
void setTextFormat(const QString &textFormat, const QString &defaultText);
public Q_SLOTS:
void setPrefixedText(const QString &text);
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index a3bd8897f1..363291528e 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -54,7 +54,3 @@ qtConfig(xcb) {
} else {
SOURCES += util/qsystemtrayicon_qpa.cpp
}
-
-mac {
- OBJECTIVE_SOURCES += util/qscroller_mac.mm
-}
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index e556cb8b10..6f807e1696 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -32,8 +32,6 @@ qtConfig(graphicseffect) {
QMAKE_LIBS += $$QMAKE_LIBS_GUI
-contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri)
-
QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtWidgets.dynlist
# Code coverage with TestCocoon
diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp
index f30a3bc7b8..d956d2ba23 100644
--- a/src/widgets/widgets/qabstractbutton.cpp
+++ b/src/widgets/widgets/qabstractbutton.cpp
@@ -44,6 +44,7 @@
#endif
#if QT_CONFIG(buttongroup)
#include "qbuttongroup.h"
+#include "private/qapplication_p.h"
#include "private/qbuttongroup_p.h"
#endif
#include "qabstractbutton_p.h"
@@ -319,7 +320,7 @@ void QAbstractButtonPrivate::moveFocus(int key)
if (exclusive
#ifdef QT_KEYPAD_NAVIGATION
- && !QApplication::keypadNavigationEnabled()
+ && !QApplicationPrivate::keypadNavigationEnabled()
#endif
&& candidate
&& fb->d_func()->checked
@@ -1063,7 +1064,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
case Qt::Key_Right:
case Qt::Key_Down: {
#ifdef QT_KEYPAD_NAVIGATION
- if ((QApplication::keypadNavigationEnabled()
+ if ((QApplicationPrivate::keypadNavigationEnabled()
&& (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right))
|| (!QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional
|| (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down))) {
@@ -1159,7 +1160,7 @@ void QAbstractButton::focusInEvent(QFocusEvent *e)
{
Q_D(QAbstractButton);
#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled())
+ if (!QApplicationPrivate::keypadNavigationEnabled())
#endif
d->fixFocusPolicy();
QWidget::focusInEvent(e);
diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp
index 5ea8330db2..d2372a7be9 100644
--- a/src/widgets/widgets/qabstractscrollarea.cpp
+++ b/src/widgets/widgets/qabstractscrollarea.cpp
@@ -62,10 +62,6 @@
#include <private/qapplication_p.h>
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-#include <private/qt_mac_p.h>
-#include <private/qt_cocoa_helpers_mac_p.h>
-#endif
#ifdef Q_OS_WIN
# include <qt_windows.h>
#endif
@@ -169,9 +165,6 @@ QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate()
shownOnce(false), inResize(false), sizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored),
viewport(0), cornerWidget(0), left(0), top(0), right(0), bottom(0),
xoffset(0), yoffset(0), viewportFilter(0)
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- , singleFingerPanEnabled(false)
-#endif
{
}
@@ -322,16 +315,6 @@ void QAbstractScrollAreaPrivate::init()
#endif
}
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on)
-{
- singleFingerPanEnabled = on;
- QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport));
- if (dd)
- dd->winSetupGestures();
-}
-#endif
-
void QAbstractScrollAreaPrivate::layoutChildren()
{
bool needH = false;
@@ -362,38 +345,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol
const int hscrollOverlap = hbar->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, &opt, hbar);
const int vscrollOverlap = vbar->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, &opt, vbar);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- QWidget * const window = q->window();
-
- // Use small scroll bars for tool windows, to match the native size grip.
- bool hbarIsSmall = hbar->testAttribute(Qt::WA_MacSmallSize);
- bool vbarIsSmall = vbar->testAttribute(Qt::WA_MacSmallSize);
- const Qt::WindowType windowType = window->windowType();
- if (windowType == Qt::Tool) {
- if (!hbarIsSmall) {
- hbar->setAttribute(Qt::WA_MacMiniSize, false);
- hbar->setAttribute(Qt::WA_MacNormalSize, false);
- hbar->setAttribute(Qt::WA_MacSmallSize, true);
- }
- if (!vbarIsSmall) {
- vbar->setAttribute(Qt::WA_MacMiniSize, false);
- vbar->setAttribute(Qt::WA_MacNormalSize, false);
- vbar->setAttribute(Qt::WA_MacSmallSize, true);
- }
- } else {
- if (hbarIsSmall) {
- hbar->setAttribute(Qt::WA_MacMiniSize, false);
- hbar->setAttribute(Qt::WA_MacNormalSize, false);
- hbar->setAttribute(Qt::WA_MacSmallSize, false);
- }
- if (vbarIsSmall) {
- vbar->setAttribute(Qt::WA_MacMiniSize, false);
- vbar->setAttribute(Qt::WA_MacNormalSize, false);
- vbar->setAttribute(Qt::WA_MacSmallSize, false);
- }
- }
-#endif
-
const int hsbExt = hbar->sizeHint().height();
const int vsbExt = vbar->sizeHint().width();
const QPoint extPoint(vsbExt, hsbExt);
@@ -403,30 +354,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol
const bool hasCornerWidget = (cornerWidget != 0);
-// If the scroll bars are at the very right and bottom of the window we
-// move their positions to be aligned with the size grip.
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // Check if a native sizegrip is present.
- bool hasMacReverseSizeGrip = false;
- bool hasMacSizeGrip = false;
- bool nativeGripPresent = false;
- if (q->testAttribute(Qt::WA_WState_Created))
- nativeGripPresent = qt_mac_checkForNativeSizeGrip(q);
-
- if (nativeGripPresent) {
- // Look for a native size grip at the visual window bottom right and at the
- // absolute window bottom right. In reverse mode, the native size grip does not
- // swich side, so we need to check if it is on the "wrong side".
- const QPoint scrollAreaBottomRight = q->mapTo(window, widgetRect.bottomRight() - QPoint(frameWidth, frameWidth));
- const QPoint windowBottomRight = window->rect().bottomRight();
- const QPoint visualWindowBottomRight = QStyle::visualPos(opt.direction, opt.rect, windowBottomRight);
- const QPoint offset = windowBottomRight - scrollAreaBottomRight;
- const QPoint visualOffset = visualWindowBottomRight - scrollAreaBottomRight;
- hasMacSizeGrip = (visualOffset.manhattanLength() < vsbExt);
- hasMacReverseSizeGrip = (hasMacSizeGrip == false && (offset.manhattanLength() < hsbExt));
- }
-#endif
-
QPoint cornerOffset((needv && vscrollOverlap == 0) ? vsbExt : 0, (needh && hscrollOverlap == 0) ? hsbExt : 0);
QRect controlsRect;
QRect viewportRect;
@@ -458,12 +385,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol
if (hasCornerWidget && ((needv && vscrollOverlap == 0) || (needh && hscrollOverlap == 0)))
cornerOffset = extPoint;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- // Also move the scroll bars if they are covered by the native Mac size grip.
- if (hasMacSizeGrip)
- cornerOffset = extPoint;
-#endif
-
// The corner point is where the scroll bar rects, the corner widget rect and the
// viewport rect meets.
const QPoint cornerPoint(controlsRect.bottomRight() + QPoint(1, 1) - cornerOffset);
@@ -475,13 +396,6 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol
else
cornerPaintingRect = QRect();
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (hasMacReverseSizeGrip)
- reverseCornerPaintingRect = QRect(controlsRect.bottomRight() + QPoint(1, 1) - extPoint, extSize);
- else
- reverseCornerPaintingRect = QRect();
-#endif
-
// move the scrollbars away from top/left headers
int vHeaderRight = 0;
int hHeaderBottom = 0;
@@ -501,10 +415,7 @@ void QAbstractScrollAreaPrivate::layoutChildren_helper(bool *needHorizontalScrol
#endif // QT_CONFIG(itemviews)
if (needh) {
QRect horizontalScrollBarRect(QPoint(controlsRect.left() + vHeaderRight, cornerPoint.y()), QPoint(cornerPoint.x() - 1, controlsRect.bottom()));
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (hasMacReverseSizeGrip)
- horizontalScrollBarRect.adjust(vsbExt, 0, 0, 0);
-#endif
+
if (!hasCornerWidget && htransient)
horizontalScrollBarRect.adjust(0, 0, cornerOffset.x(), 0);
scrollBarContainers[Qt::Horizontal]->setGeometry(QStyle::visualRect(opt.direction, opt.rect, horizontalScrollBarRect));
@@ -617,11 +528,9 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport->setParent(this);
d->viewport->setFocusProxy(this);
d->viewport->installEventFilter(d->viewportFilter.data());
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
#ifndef QT_NO_GESTURES
d->viewport->grabGesture(Qt::PanGesture);
#endif
-#endif
d->layoutChildren();
#ifndef QT_NO_OPENGL
QWidgetPrivate::get(d->viewport)->initializeViewportFramebuffer();
@@ -1043,13 +952,6 @@ bool QAbstractScrollArea::event(QEvent *e)
QPainter p(this);
style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this);
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (d->reverseCornerPaintingRect.isValid()) {
- option.rect = d->reverseCornerPaintingRect;
- QPainter p(this);
- style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, &p, this);
- }
-#endif
}
QFrame::paintEvent((QPaintEvent*)e);
break;
@@ -1086,7 +988,7 @@ bool QAbstractScrollArea::event(QEvent *e)
QScrollBar *vBar = verticalScrollBar();
QPointF delta = g->delta();
if (!delta.isNull()) {
- if (QApplication::isRightToLeft())
+ if (QGuiApplication::isRightToLeft())
delta.rx() *= -1;
int newX = hBar->value() - delta.x();
int newY = vBar->value() - delta.y();
@@ -1122,38 +1024,10 @@ bool QAbstractScrollArea::event(QEvent *e)
hBar->setValue(se->contentPos().x());
vBar->setValue(se->contentPos().y());
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- typedef BOOL (*PtrBeginPanningFeedback)(HWND);
- typedef BOOL (*PtrUpdatePanningFeedback)(HWND, LONG, LONG, BOOL);
- typedef BOOL (*PtrEndPanningFeedback)(HWND, BOOL);
-
- static PtrBeginPanningFeedback ptrBeginPanningFeedback = 0;
- static PtrUpdatePanningFeedback ptrUpdatePanningFeedback = 0;
- static PtrEndPanningFeedback ptrEndPanningFeedback = 0;
-
- if (!ptrBeginPanningFeedback)
- ptrBeginPanningFeedback = (PtrBeginPanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback");
- if (!ptrUpdatePanningFeedback)
- ptrUpdatePanningFeedback = (PtrUpdatePanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "UpdatePanningFeedback");
- if (!ptrEndPanningFeedback)
- ptrEndPanningFeedback = (PtrEndPanningFeedback) QLibrary::resolve(QLatin1String("UxTheme"), "EndPanningFeedback");
-
- if (ptrBeginPanningFeedback && ptrUpdatePanningFeedback && ptrEndPanningFeedback) {
- WId wid = window()->winId();
-
- if (!se->overshootDistance().isNull() && d->overshoot.isNull())
- ptrBeginPanningFeedback(wid);
- if (!se->overshootDistance().isNull())
- ptrUpdatePanningFeedback(wid, -se->overshootDistance().x(), -se->overshootDistance().y(), false);
- if (se->overshootDistance().isNull() && !d->overshoot.isNull())
- ptrEndPanningFeedback(wid, true);
- } else
-#endif
- {
- QPoint delta = d->overshoot - se->overshootDistance().toPoint();
- if (!delta.isNull())
- viewport()->move(viewport()->pos() + delta);
- }
+ QPoint delta = d->overshoot - se->overshootDistance().toPoint();
+ if (!delta.isNull())
+ viewport()->move(viewport()->pos() + delta);
+
d->overshoot = se->overshootDistance().toPoint();
return true;
@@ -1270,11 +1144,14 @@ void QAbstractScrollArea::paintEvent(QPaintEvent*)
mouse press events for the viewport() widget. The event is passed
in \a e.
+ The default implementation calls QWidget::mousePressEvent() for
+ default popup handling.
+
\sa QWidget::mousePressEvent()
*/
void QAbstractScrollArea::mousePressEvent(QMouseEvent *e)
{
- e->ignore();
+ QWidget::mousePressEvent(e);
}
/*!
@@ -1324,10 +1201,10 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e)
void QAbstractScrollArea::wheelEvent(QWheelEvent *e)
{
Q_D(QAbstractScrollArea);
- if (e->orientation() == Qt::Horizontal)
- QApplication::sendEvent(d->hbar, e);
+ if (qAbs(e->angleDelta().x()) > qAbs(e->angleDelta().y()))
+ QCoreApplication::sendEvent(d->hbar, e);
else
- QApplication::sendEvent(d->vbar, e);
+ QCoreApplication::sendEvent(d->vbar, e);
}
#endif
@@ -1362,7 +1239,7 @@ void QAbstractScrollArea::keyPressEvent(QKeyEvent * e)
#endif
} else {
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
e->ignore();
return;
}
@@ -1376,7 +1253,7 @@ void QAbstractScrollArea::keyPressEvent(QKeyEvent * e)
break;
case Qt::Key_Left:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && hasEditFocus()
+ if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()
&& (!d->hbar->isVisible() || d->hbar->value() == d->hbar->minimum())) {
//if we aren't using the hbar or we are already at the leftmost point ignore
e->ignore();
@@ -1389,7 +1266,7 @@ void QAbstractScrollArea::keyPressEvent(QKeyEvent * e)
break;
case Qt::Key_Right:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && hasEditFocus()
+ if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()
&& (!d->hbar->isVisible() || d->hbar->value() == d->hbar->maximum())) {
//if we aren't using the hbar or we are already at the rightmost point ignore
e->ignore();
@@ -1546,13 +1423,6 @@ void QAbstractScrollAreaPrivate::_q_vslide(int y)
void QAbstractScrollAreaPrivate::_q_showOrHideScrollBars()
{
layoutChildren();
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- // Need to re-subscribe to gestures as the content changes to make sure we
- // enable/disable panning when needed.
- QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport));
- if (dd)
- dd->winSetupGestures();
-#endif
}
QPoint QAbstractScrollAreaPrivate::contentsOffset() const
diff --git a/src/widgets/widgets/qabstractscrollarea_p.h b/src/widgets/widgets/qabstractscrollarea_p.h
index 732a2ab40d..6d78b9db6d 100644
--- a/src/widgets/widgets/qabstractscrollarea_p.h
+++ b/src/widgets/widgets/qabstractscrollarea_p.h
@@ -85,9 +85,7 @@ public:
QWidget *viewport;
QWidget *cornerWidget;
QRect cornerPaintingRect;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- QRect reverseCornerPaintingRect;
-#endif
+
int left, top, right, bottom; // viewport margin
int xoffset, yoffset;
@@ -112,11 +110,6 @@ public:
inline bool viewportEvent(QEvent *event)
{ return q_func()->viewportEvent(event); }
QScopedPointer<QObject> viewportFilter;
-
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- bool singleFingerPanEnabled;
- void setSingleFingerPanEnabled(bool on = true);
-#endif
};
class QAbstractScrollAreaFilter : public QObject
diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp
index 2172ebc99c..dc325ab871 100644
--- a/src/widgets/widgets/qabstractslider.cpp
+++ b/src/widgets/widgets/qabstractslider.cpp
@@ -47,6 +47,8 @@
#endif
#include <limits.h>
+#include <private/qapplication_p.h>
+
QT_BEGIN_NAMESPACE
/*!
@@ -719,15 +721,10 @@ bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::Keyb
offset_accumulated = 0;
offset_accumulated += stepsToScrollF;
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
+
// Don't scroll more than one page in any case:
stepsToScroll = qBound(-pageStep, int(offset_accumulated), pageStep);
-#else
- // Native UI-elements on Mac can scroll hundreds of lines at a time as
- // a result of acceleration. So keep the same behaviour in Qt, and
- // don't restrict stepsToScroll to certain maximum (pageStep):
- stepsToScroll = int(offset_accumulated);
-#endif
+
offset_accumulated -= int(offset_accumulated);
if (stepsToScroll == 0) {
// We moved less than a line, but might still have accumulated partial scroll,
@@ -764,10 +761,11 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
{
Q_D(QAbstractSlider);
e->ignore();
- int delta = e->delta();
+ bool vertical = bool(e->angleDelta().y());
+ int delta = vertical ? e->angleDelta().y() : e->angleDelta().x();
if (e->inverted())
delta = -delta;
- if (d->scrollByDelta(e->orientation(), e->modifiers(), delta))
+ if (d->scrollByDelta(vertical ? Qt::Vertical : Qt::Horizontal, e->modifiers(), delta))
e->accept();
}
@@ -815,13 +813,13 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
switch (ev->key()) {
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
setEditFocus(!hasEditFocus());
else
ev->ignore();
break;
case Qt::Key_Back:
- if (QApplication::keypadNavigationEnabled() && hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()) {
setValue(d->origValue);
setEditFocus(false);
} else
@@ -834,7 +832,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
// In QApplication::KeypadNavigationDirectional, we want to change the slider
// value if there is no left/right navigation possible and if this slider is not
// inside a tab widget.
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& (!hasEditFocus() && QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
|| d->orientation == Qt::Vertical
|| !hasEditFocus()
@@ -842,7 +840,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
ev->ignore();
return;
}
- if (QApplication::keypadNavigationEnabled() && d->orientation == Qt::Vertical)
+ if (QApplicationPrivate::keypadNavigationEnabled() && d->orientation == Qt::Vertical)
action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd;
else
#endif
@@ -854,7 +852,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
case Qt::Key_Right:
#ifdef QT_KEYPAD_NAVIGATION
// Same logic as in Qt::Key_Left
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& (!hasEditFocus() && QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
|| d->orientation == Qt::Vertical
|| !hasEditFocus()
@@ -862,7 +860,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
ev->ignore();
return;
}
- if (QApplication::keypadNavigationEnabled() && d->orientation == Qt::Vertical)
+ if (QApplicationPrivate::keypadNavigationEnabled() && d->orientation == Qt::Vertical)
action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub;
else
#endif
@@ -875,7 +873,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
#ifdef QT_KEYPAD_NAVIGATION
// In QApplication::KeypadNavigationDirectional, we want to change the slider
// value if there is no up/down navigation possible.
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& (QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
|| d->orientation == Qt::Horizontal
|| !hasEditFocus() && QWidgetPrivate::canKeypadNavigate(Qt::Vertical))) {
@@ -888,7 +886,7 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev)
case Qt::Key_Down:
#ifdef QT_KEYPAD_NAVIGATION
// Same logic as in Qt::Key_Up
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& (QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
|| d->orientation == Qt::Horizontal
|| !hasEditFocus() && QWidgetPrivate::canKeypadNavigate(Qt::Vertical))) {
diff --git a/src/widgets/widgets/qabstractslider_p.h b/src/widgets/widgets/qabstractslider_p.h
index 419ce2ba07..1b8c76c7ec 100644
--- a/src/widgets/widgets/qabstractslider_p.h
+++ b/src/widgets/widgets/qabstractslider_p.h
@@ -134,7 +134,7 @@ public:
inline void setAdjustedSliderPosition(int position)
{
Q_Q(QAbstractSlider);
- if (q->style()->styleHint(QStyle::SH_Slider_StopMouseOverSlider, 0, q)) {
+ if (q->style()->styleHint(QStyle::SH_Slider_StopMouseOverSlider, nullptr, q)) {
if ((position > pressValue - 2 * pageStep) && (position < pressValue + 2 * pageStep)) {
repeatAction = QAbstractSlider::SliderNoAction;
q->setSliderPosition(pressValue);
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index f30ea35303..fc19e0793e 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -39,6 +39,7 @@
#include <qplatformdefs.h>
#include <private/qabstractspinbox_p.h>
+#include <private/qapplication_p.h>
#if QT_CONFIG(datetimeparser)
#include <private/qdatetimeparser_p.h>
#endif
@@ -253,7 +254,7 @@ QString QAbstractSpinBox::text() const
All values are displayed with the prefix and suffix (if set), \e
except for the special value, which only shows the special value
- text. This special text is passed in the QSpinBox::valueChanged()
+ text. This special text is passed in the QSpinBox::textChanged()
signal that passes a QString.
To turn off the special-value text display, call this function
@@ -333,7 +334,7 @@ void QAbstractSpinBox::setReadOnly(bool enable)
d->readOnly = enable;
d->edit->setReadOnly(enable);
QEvent event(QEvent::ReadOnlyChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
update();
}
@@ -343,18 +344,18 @@ void QAbstractSpinBox::setReadOnly(bool enable)
\since 4.3
If keyboard tracking is enabled (the default), the spinbox
- emits the valueChanged() signal while the new value is being
- entered from the keyboard.
+ emits the valueChanged() and textChanged() signals while the
+ new value is being entered from the keyboard.
E.g. when the user enters the value 600 by typing 6, 0, and 0,
the spinbox emits 3 signals with the values 6, 60, and 600
respectively.
If keyboard tracking is disabled, the spinbox doesn't emit the
- valueChanged() signal while typing. It emits the signal later,
- when the return key is pressed, when keyboard focus is lost, or
- when other spinbox functionality is used, e.g. pressing an arrow
- key.
+ valueChanged() and textChanged() signals while typing. It emits
+ the signals later, when the return key is pressed, when keyboard
+ focus is lost, or when other spinbox functionality is used, e.g.
+ pressing an arrow key.
*/
bool QAbstractSpinBox::keyboardTracking() const
@@ -574,10 +575,10 @@ QAbstractSpinBox::StepEnabled QAbstractSpinBox::stepEnabled() const
if (d->wrapping)
return StepEnabled(StepUpEnabled | StepDownEnabled);
StepEnabled ret = StepNone;
- if (d->variantCompare(d->value, d->maximum) < 0) {
+ if (QAbstractSpinBoxPrivate::variantCompare(d->value, d->maximum) < 0) {
ret |= StepUpEnabled;
}
- if (d->variantCompare(d->value, d->minimum) > 0) {
+ if (QAbstractSpinBoxPrivate::variantCompare(d->value, d->minimum) > 0) {
ret |= StepDownEnabled;
}
return ret;
@@ -803,7 +804,7 @@ bool QAbstractSpinBox::event(QEvent *event)
#ifdef QT_KEYPAD_NAVIGATION
case QEvent::EnterEditFocus:
case QEvent::LeaveEditFocus:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
const bool b = d->edit->event(event);
d->edit->setSelection(d->edit->displayText().size() - d->suffix.size(),0);
if (event->type() == QEvent::LeaveEditFocus)
@@ -1025,7 +1026,7 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
case Qt::Key_Up:
case Qt::Key_Down: {
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// Reserve up/down for nav - use left/right for edit.
if (!hasEditFocus() && (event->key() == Qt::Key_Up
|| event->key() == Qt::Key_Down)) {
@@ -1061,13 +1062,13 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Left:
case Qt::Key_Right:
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
event->ignore();
return;
}
break;
case Qt::Key_Back:
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
event->ignore();
return;
}
@@ -1085,7 +1086,7 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// Toggles between left/right moving cursor and inc/dec.
setEditFocus(!hasEditFocus());
}
@@ -1221,7 +1222,7 @@ void QAbstractSpinBox::focusOutEvent(QFocusEvent *event)
#ifdef QT_KEYPAD_NAVIGATION
// editingFinished() is already emitted on LeaveEditFocus
- if (!QApplication::keypadNavigationEnabled())
+ if (!QApplicationPrivate::keypadNavigationEnabled())
#endif
emit editingFinished();
}
@@ -1320,6 +1321,9 @@ void QAbstractSpinBox::contextMenuEvent(QContextMenuEvent *event)
d->reset();
QAction *selAll = new QAction(tr("&Select All"), menu);
+#if QT_CONFIG(shortcut)
+ selAll->setShortcut(QKeySequence::SelectAll);
+#endif
menu->insertAction(d->edit->d_func()->selectAllAction,
selAll);
menu->removeAction(d->edit->d_func()->selectAllAction);
@@ -1722,7 +1726,7 @@ void QAbstractSpinBox::initStyleOption(QStyleOptionSpinBox *option) const
option->activeSubControls = d->hoverControl;
}
- option->stepEnabled = style()->styleHint(QStyle::SH_SpinControls_DisableOnBounds)
+ option->stepEnabled = style()->styleHint(QStyle::SH_SpinControls_DisableOnBounds, nullptr, this)
? stepEnabled()
: (QAbstractSpinBox::StepDownEnabled|QAbstractSpinBox::StepUpEnabled);
@@ -2031,8 +2035,8 @@ QVariant operator+(const QVariant &arg1, const QVariant &arg2)
#if QT_CONFIG(datetimeparser)
case QVariant::DateTime: {
QDateTime a2 = arg2.toDateTime();
- QDateTime a1 = arg1.toDateTime().addDays(QDATETIMEEDIT_DATETIME_MIN.daysTo(a2));
- a1.setTime(a1.time().addMSecs(QTime().msecsTo(a2.time())));
+ QDateTime a1 = arg1.toDateTime().addDays(QDATETIMEEDIT_DATE_MIN.daysTo(a2.date()));
+ a1.setTime(a1.time().addMSecs(a2.time().msecsSinceStartOfDay()));
ret = QVariant(a1);
break;
}
@@ -2094,11 +2098,11 @@ QVariant operator*(const QVariant &arg1, double multiplier)
#if QT_CONFIG(datetimeparser)
case QVariant::DateTime: {
double days = QDATETIMEEDIT_DATE_MIN.daysTo(arg1.toDateTime().date()) * multiplier;
- int daysInt = (int)days;
+ const qint64 daysInt = qint64(days);
days -= daysInt;
- long msecs = (long)((QDATETIMEEDIT_TIME_MIN.msecsTo(arg1.toDateTime().time()) * multiplier)
- + (days * (24 * 3600 * 1000)));
- ret = QDateTime(QDate().addDays(int(days)), QTime().addMSecs(msecs));
+ qint64 msecs = qint64(arg1.toDateTime().time().msecsSinceStartOfDay() * multiplier
+ + days * (24 * 3600 * 1000));
+ ret = QDATETIMEEDIT_DATE_MIN.addDays(daysInt).startOfDay().addMSecs(msecs);
break;
}
#endif // datetimeparser
@@ -2128,8 +2132,8 @@ double operator/(const QVariant &arg1, const QVariant &arg2)
case QVariant::DateTime:
a1 = QDATETIMEEDIT_DATE_MIN.daysTo(arg1.toDate());
a2 = QDATETIMEEDIT_DATE_MIN.daysTo(arg2.toDate());
- a1 += (double)QDATETIMEEDIT_TIME_MIN.msecsTo(arg1.toDateTime().time()) / (long)(3600 * 24 * 1000);
- a2 += (double)QDATETIMEEDIT_TIME_MIN.msecsTo(arg2.toDateTime().time()) / (long)(3600 * 24 * 1000);
+ a1 += arg1.toDateTime().time().msecsSinceStartOfDay() / (36e5 * 24);
+ a2 += arg2.toDateTime().time().msecsSinceStartOfDay() / (36e5 * 24);
break;
#endif // datetimeparser
default: break;
diff --git a/src/widgets/widgets/qabstractspinbox_p.h b/src/widgets/widgets/qabstractspinbox_p.h
index fce88e43f4..ad169fde19 100644
--- a/src/widgets/widgets/qabstractspinbox_p.h
+++ b/src/widgets/widgets/qabstractspinbox_p.h
@@ -97,7 +97,7 @@ public:
void init();
void reset();
void updateState(bool up, bool fromKeyboard = false);
- QString stripped(const QString &text, int *pos = 0) const;
+ QString stripped(const QString &text, int *pos = nullptr) const;
bool specialValue() const;
virtual QVariant getZeroVariant() const;
virtual void setRange(const QVariant &min, const QVariant &max);
diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp
index 47c5267c73..8593001f8b 100644
--- a/src/widgets/widgets/qcalendarwidget.cpp
+++ b/src/widgets/widgets/qcalendarwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -54,8 +54,10 @@
#include <qspinbox.h>
#include <qmenu.h>
#include <qapplication.h>
+#include <private/qapplication_p.h>
#include <qbasictimer.h>
#include <qstylepainter.h>
+#include <qcalendar.h>
#include <vector>
@@ -89,16 +91,15 @@ public:
QCalendarDateSectionValidator() {}
virtual ~QCalendarDateSectionValidator() {}
virtual Section handleKey(int key) = 0;
- virtual QDate applyToDate(const QDate &date) const = 0;
- virtual void setDate(const QDate &date) = 0;
+ virtual QDate applyToDate(QDate date, QCalendar cal = QCalendar()) const = 0;
+ virtual void setDate(QDate date, QCalendar cal = QCalendar()) = 0;
virtual QString text() const = 0;
- virtual QString text(const QDate &date, int repeat) const = 0;
+ virtual QString text(QDate date, QCalendar cal, int repeat) const = 0;
QLocale m_locale;
protected:
static QString highlightString(const QString &str, int pos);
-private:
};
QString QCalendarDateSectionValidator::highlightString(const QString &str, int pos)
@@ -116,10 +117,10 @@ class QCalendarDayValidator : public QCalendarDateSectionValidator
public:
QCalendarDayValidator();
virtual Section handleKey(int key) override;
- virtual QDate applyToDate(const QDate &date) const override;
- virtual void setDate(const QDate &date) override;
+ virtual QDate applyToDate(QDate date, QCalendar cal) const override;
+ virtual void setDate(QDate date, QCalendar cal) override;
virtual QString text() const override;
- virtual QString text(const QDate &date, int repeat) const override;
+ virtual QString text(QDate date, QCalendar cal, int repeat) const override;
private:
int m_pos;
int m_day;
@@ -180,21 +181,18 @@ QCalendarDateSectionValidator::Section QCalendarDayValidator::handleKey(int key)
return QCalendarDateSectionValidator::ThisSection;
}
-QDate QCalendarDayValidator::applyToDate(const QDate &date) const
+QDate QCalendarDayValidator::applyToDate(QDate date, QCalendar cal) const
{
- int day = m_day;
- if (day < 1)
- day = 1;
- else if (day > 31)
- day = 31;
- if (day > date.daysInMonth())
- day = date.daysInMonth();
- return QDate(date.year(), date.month(), day);
+ auto parts = cal.partsFromDate(date);
+ if (!parts.isValid())
+ return QDate();
+ parts.day = qMin(qMax(1, m_day), cal.daysInMonth(parts.year, parts.month));
+ return cal.dateFromParts(parts);
}
-void QCalendarDayValidator::setDate(const QDate &date)
+void QCalendarDayValidator::setDate(QDate date, QCalendar cal)
{
- m_day = m_oldDay = date.day();
+ m_day = m_oldDay = date.day(cal);
m_pos = 0;
}
@@ -203,16 +201,16 @@ QString QCalendarDayValidator::text() const
return highlightString(formatNumber(m_day, 2), m_pos);
}
-QString QCalendarDayValidator::text(const QDate &date, int repeat) const
+QString QCalendarDayValidator::text(QDate date, QCalendar cal, int repeat) const
{
if (repeat <= 1) {
- return QString::number(date.day());
+ return QString::number(date.day(cal));
} else if (repeat == 2) {
- return formatNumber(date.day(), 2);
+ return formatNumber(date.day(cal), 2);
} else if (repeat == 3) {
- return m_locale.dayName(date.dayOfWeek(), QLocale::ShortFormat);
+ return m_locale.dayName(date.dayOfWeek(cal), QLocale::ShortFormat);
} else /* repeat >= 4 */ {
- return m_locale.dayName(date.dayOfWeek(), QLocale::LongFormat);
+ return m_locale.dayName(date.dayOfWeek(cal), QLocale::LongFormat);
}
}
@@ -224,10 +222,10 @@ class QCalendarMonthValidator : public QCalendarDateSectionValidator
public:
QCalendarMonthValidator();
virtual Section handleKey(int key) override;
- virtual QDate applyToDate(const QDate &date) const override;
- virtual void setDate(const QDate &date) override;
+ virtual QDate applyToDate(QDate date, QCalendar cal) const override;
+ virtual void setDate(QDate date, QCalendar cal) override;
virtual QString text() const override;
- virtual QString text(const QDate &date, int repeat) const override;
+ virtual QString text(QDate date, QCalendar cal, int repeat) const override;
private:
int m_pos;
int m_month;
@@ -288,23 +286,19 @@ QCalendarDateSectionValidator::Section QCalendarMonthValidator::handleKey(int ke
return QCalendarDateSectionValidator::ThisSection;
}
-QDate QCalendarMonthValidator::applyToDate(const QDate &date) const
+QDate QCalendarMonthValidator::applyToDate(QDate date, QCalendar cal) const
{
- int month = m_month;
- if (month < 1)
- month = 1;
- else if (month > 12)
- month = 12;
- QDate newDate(date.year(), m_month, 1);
- int day = date.day();
- if (day > newDate.daysInMonth())
- day = newDate.daysInMonth();
- return QDate(date.year(), month, day);
+ auto parts = cal.partsFromDate(date);
+ if (!parts.isValid())
+ return QDate();
+ parts.month = qMin(qMax(1, m_month), cal.monthsInYear(parts.year));
+ parts.day = qMin(parts.day, cal.daysInMonth(parts.year, m_month)); // m_month or parts.month ?
+ return cal.dateFromParts(parts);
}
-void QCalendarMonthValidator::setDate(const QDate &date)
+void QCalendarMonthValidator::setDate(QDate date, QCalendar cal)
{
- m_month = m_oldMonth = date.month();
+ m_month = m_oldMonth = date.month(cal);
m_pos = 0;
}
@@ -313,17 +307,19 @@ QString QCalendarMonthValidator::text() const
return highlightString(formatNumber(m_month, 2), m_pos);
}
-QString QCalendarMonthValidator::text(const QDate &date, int repeat) const
+QString QCalendarMonthValidator::text(QDate date, QCalendar cal, int repeat) const
{
- if (repeat <= 1) {
- return QString::number(date.month());
- } else if (repeat == 2) {
- return formatNumber(date.month(), 2);
- } else if (repeat == 3) {
- return m_locale.standaloneMonthName(date.month(), QLocale::ShortFormat);
- } else /*if (repeat >= 4)*/ {
- return m_locale.standaloneMonthName(date.month(), QLocale::LongFormat);
- }
+ const auto parts = cal.partsFromDate(date);
+ // Numeric forms:
+ if (repeat <= 1)
+ return QString::number(parts.month);
+ if (repeat == 2)
+ return formatNumber(parts.month, 2);
+ // Text forms:
+ if (repeat == 3)
+ return cal.standaloneMonthName(m_locale, parts.month, parts.year, QLocale::ShortFormat);
+ /* repeat >= 4 */
+ return cal.standaloneMonthName(m_locale, parts.month, parts.year, QLocale::LongFormat);
}
//////////////////////////////////
@@ -334,10 +330,10 @@ class QCalendarYearValidator : public QCalendarDateSectionValidator
public:
QCalendarYearValidator();
virtual Section handleKey(int key) override;
- virtual QDate applyToDate(const QDate &date) const override;
- virtual void setDate(const QDate &date) override;
+ virtual QDate applyToDate(QDate date, QCalendar cal) const override;
+ virtual void setDate(QDate date, QCalendar cal) override;
virtual QString text() const override;
- virtual QString text(const QDate &date, int repeat) const override;
+ virtual QString text(QDate date, QCalendar cal, int repeat) const override;
private:
int pow10(int n);
int m_pos;
@@ -348,6 +344,8 @@ private:
QCalendarYearValidator::QCalendarYearValidator()
: QCalendarDateSectionValidator(), m_pos(0), m_year(2000), m_oldYear(2000)
{
+ // TODO: What to use (for non-Gregorian calendars) as default year?
+ // Maybe 1360 for Jalali, 1420 for Islamic, etc.
}
int QCalendarYearValidator::pow10(int n)
@@ -396,21 +394,20 @@ QCalendarDateSectionValidator::Section QCalendarYearValidator::handleKey(int key
return QCalendarDateSectionValidator::ThisSection;
}
-QDate QCalendarYearValidator::applyToDate(const QDate &date) const
+QDate QCalendarYearValidator::applyToDate(QDate date, QCalendar cal) const
{
- int year = m_year;
- if (year < 1)
- year = 1;
- QDate newDate(year, date.month(), 1);
- int day = date.day();
- if (day > newDate.daysInMonth())
- day = newDate.daysInMonth();
- return QDate(year, date.month(), day);
+ auto parts = cal.partsFromDate(date);
+ if (!parts.isValid())
+ return QDate();
+ // This widget does not support negative years (some calendars may support)
+ parts.year = qMax(1, m_year);
+ parts.day = qMin(parts.day, cal.daysInMonth(parts.year, parts.month));
+ return cal.dateFromParts(parts);
}
-void QCalendarYearValidator::setDate(const QDate &date)
+void QCalendarYearValidator::setDate(QDate date, QCalendar cal)
{
- m_year = m_oldYear = date.year();
+ m_year = m_oldYear = date.year(cal);
m_pos = 0;
}
@@ -419,11 +416,11 @@ QString QCalendarYearValidator::text() const
return highlightString(formatNumber(m_year, 4), m_pos);
}
-QString QCalendarYearValidator::text(const QDate &date, int repeat) const
+QString QCalendarYearValidator::text(QDate date, QCalendar cal, int repeat) const
{
if (repeat < 4)
- return formatNumber(date.year() % 100, 2);
- return QString::number(date.year());
+ return formatNumber(date.year(cal) % 100, 2);
+ return QString::number(date.year(cal));
}
///////////////////////////////////
@@ -445,18 +442,18 @@ public:
QCalendarDateValidator();
~QCalendarDateValidator();
- void handleKeyEvent(QKeyEvent *keyEvent);
- QString currentText() const;
+ void handleKeyEvent(QKeyEvent *keyEvent, QCalendar cal);
+ QString currentText(QCalendar cal) const;
QDate currentDate() const { return m_currentDate; }
void setFormat(const QString &format);
- void setInitialDate(const QDate &date);
+ void setInitialDate(QDate date, QCalendar cal);
void setLocale(const QLocale &locale);
private:
void toNextToken();
void toPreviousToken();
- void applyToDate();
+ void applyToDate(QCalendar cal);
int countRepeat(const QString &str, int index) const;
void clear();
@@ -506,17 +503,17 @@ int QCalendarDateValidator::countRepeat(const QString &str, int index) const
return count;
}
-void QCalendarDateValidator::setInitialDate(const QDate &date)
+void QCalendarDateValidator::setInitialDate(QDate date, QCalendar cal)
{
- m_yearValidator.setDate(date);
- m_monthValidator.setDate(date);
- m_dayValidator.setDate(date);
+ m_yearValidator.setDate(date, cal);
+ m_monthValidator.setDate(date, cal);
+ m_dayValidator.setDate(date, cal);
m_initialDate = date;
m_currentDate = date;
m_lastSectionMove = QCalendarDateSectionValidator::ThisSection;
}
-QString QCalendarDateValidator::currentText() const
+QString QCalendarDateValidator::currentText(QCalendar cal) const
{
QString str;
const int numSeps = m_separators.size();
@@ -528,7 +525,7 @@ QString QCalendarDateValidator::currentText() const
if (i == m_currentToken)
str += token.validator->text();
else
- str += token.validator->text(m_currentDate, token.repeat);
+ str += token.validator->text(m_currentDate, cal, token.repeat);
}
}
return str;
@@ -590,11 +587,11 @@ void QCalendarDateValidator::setFormat(const QString &format)
m_separators += separator;
}
-void QCalendarDateValidator::applyToDate()
+void QCalendarDateValidator::applyToDate(QCalendar cal)
{
- m_currentDate = m_yearValidator.applyToDate(m_currentDate);
- m_currentDate = m_monthValidator.applyToDate(m_currentDate);
- m_currentDate = m_dayValidator.applyToDate(m_currentDate);
+ m_currentDate = m_yearValidator.applyToDate(m_currentDate, cal);
+ m_currentDate = m_monthValidator.applyToDate(m_currentDate, cal);
+ m_currentDate = m_dayValidator.applyToDate(m_currentDate, cal);
}
void QCalendarDateValidator::toNextToken()
@@ -613,7 +610,7 @@ void QCalendarDateValidator::toPreviousToken()
m_currentToken %= m_tokens.size();
}
-void QCalendarDateValidator::handleKeyEvent(QKeyEvent *keyEvent)
+void QCalendarDateValidator::handleKeyEvent(QKeyEvent *keyEvent,QCalendar cal)
{
if (m_currentToken < 0)
return;
@@ -630,7 +627,7 @@ void QCalendarDateValidator::handleKeyEvent(QKeyEvent *keyEvent)
m_lastSectionMove = m_tokens[m_currentToken].validator->handleKey(key);
- applyToDate();
+ applyToDate(cal);
if (m_lastSectionMove == QCalendarDateSectionValidator::NextSection)
toNextToken();
else if (m_lastSectionMove == QCalendarDateSectionValidator::PrevSection)
@@ -644,7 +641,8 @@ class QCalendarTextNavigator: public QObject
Q_OBJECT
public:
QCalendarTextNavigator(QObject *parent = 0)
- : QObject(parent), m_dateText(0), m_dateFrame(0), m_dateValidator(0), m_widget(0), m_editDelay(1500), m_date(QDate::currentDate()) { }
+ : QObject(parent), m_dateText(0), m_dateFrame(0), m_dateValidator(0),
+ m_widget(0), m_editDelay(1500), m_date(QDate::currentDate()) {}
QWidget *widget() const;
void setWidget(QWidget *widget);
@@ -652,13 +650,13 @@ public:
int dateEditAcceptDelay() const;
void setDateEditAcceptDelay(int delay);
- void setDate(const QDate &date);
+ void setDate(QDate date);
bool eventFilter(QObject *o, QEvent *e) override;
void timerEvent(QTimerEvent *e) override;
signals:
- void dateChanged(const QDate &date);
+ void dateChanged(QDate date);
void editingFinished();
private:
@@ -675,6 +673,7 @@ private:
int m_editDelay;
QDate m_date;
+ const QCalendar m_calendar;
};
QWidget *QCalendarTextNavigator::widget() const
@@ -687,7 +686,7 @@ void QCalendarTextNavigator::setWidget(QWidget *widget)
m_widget = widget;
}
-void QCalendarTextNavigator::setDate(const QDate &date)
+void QCalendarTextNavigator::setDate(QDate date)
{
m_date = date;
}
@@ -699,7 +698,7 @@ void QCalendarTextNavigator::updateDateLabel()
m_acceptTimer.start(m_editDelay, this);
- m_dateText->setText(m_dateValidator->currentText());
+ m_dateText->setText(m_dateValidator->currentText(m_calendar));
QSize s = m_dateFrame->sizeHint();
QRect r = m_widget->geometry(); // later, just the table section
@@ -739,7 +738,7 @@ void QCalendarTextNavigator::createDateLabel()
m_dateValidator = new QCalendarDateValidator();
m_dateValidator->setLocale(m_widget->locale());
m_dateValidator->setFormat(m_widget->locale().dateFormat(QLocale::ShortFormat));
- m_dateValidator->setInitialDate(m_date);
+ m_dateValidator->setInitialDate(m_date, m_calendar);
m_dateFrame->setAutoFillBackground(true);
m_dateFrame->setBackgroundRole(QPalette::Window);
@@ -774,7 +773,7 @@ bool QCalendarTextNavigator::eventFilter(QObject *o, QEvent *e)
#endif
} else if (e->type() == QEvent::KeyPress) {
createDateLabel();
- m_dateValidator->handleKeyEvent(ke);
+ m_dateValidator->handleKeyEvent(ke, m_calendar);
updateDateLabel();
}
ke->accept();
@@ -827,9 +826,9 @@ class StaticDayOfWeekAssociativeArray {
bool contained[7];
T data[7];
- static Q_DECL_CONSTEXPR int day2idx(Qt::DayOfWeek day) Q_DECL_NOTHROW { return int(day) - 1; } // alt: day % 7
+ static Q_DECL_CONSTEXPR int day2idx(Qt::DayOfWeek day) noexcept { return int(day) - 1; } // alt: day % 7
public:
- Q_DECL_CONSTEXPR StaticDayOfWeekAssociativeArray() Q_DECL_NOEXCEPT_EXPR(noexcept(T()))
+ Q_DECL_CONSTEXPR StaticDayOfWeekAssociativeArray() noexcept(noexcept(T()))
#ifdef Q_COMPILER_CONSTEXPR
: contained{}, data{} // arrays require uniform initialization
#else
@@ -837,17 +836,17 @@ public:
#endif
{}
- Q_DECL_CONSTEXPR bool contains(Qt::DayOfWeek day) const Q_DECL_NOTHROW { return contained[day2idx(day)]; }
- Q_DECL_CONSTEXPR const T &value(Qt::DayOfWeek day) const Q_DECL_NOTHROW { return data[day2idx(day)]; }
+ Q_DECL_CONSTEXPR bool contains(Qt::DayOfWeek day) const noexcept { return contained[day2idx(day)]; }
+ Q_DECL_CONSTEXPR const T &value(Qt::DayOfWeek day) const noexcept { return data[day2idx(day)]; }
- Q_DECL_RELAXED_CONSTEXPR T &operator[](Qt::DayOfWeek day) Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR T &operator[](Qt::DayOfWeek day) noexcept
{
const int idx = day2idx(day);
contained[idx] = true;
return data[idx];
}
- Q_DECL_RELAXED_CONSTEXPR void insert(Qt::DayOfWeek day, T v) Q_DECL_NOTHROW
+ Q_DECL_RELAXED_CONSTEXPR void insert(Qt::DayOfWeek day, T v) noexcept
{
operator[](day).swap(v);
}
@@ -894,12 +893,15 @@ public:
}
void showMonth(int year, int month);
- void setDate(const QDate &d);
+ void setDate(QDate d);
- void setMinimumDate(const QDate &date);
- void setMaximumDate(const QDate &date);
+ void setCalendar(QCalendar c);
+ QCalendar calendar() const;
- void setRange(const QDate &min, const QDate &max);
+ void setMinimumDate(QDate date);
+ void setMaximumDate(QDate date);
+
+ void setRange(QDate min, QDate max);
void setHorizontalHeaderFormat(QCalendarWidget::HorizontalHeaderFormat format);
@@ -913,7 +915,7 @@ public:
Qt::DayOfWeek dayOfWeekForColumn(int section) const;
int columnForDayOfWeek(Qt::DayOfWeek day) const;
QDate dateForCell(int row, int column) const;
- void cellForDate(const QDate &date, int *row, int *column) const;
+ void cellForDate(QDate date, int *row, int *column) const;
QString dayName(Qt::DayOfWeek day) const;
void setView(QCalendarView *view)
@@ -921,10 +923,16 @@ public:
void internalUpdate();
QDate referenceDate() const;
- int columnForFirstOfMonth(const QDate &date) const;
+ int columnForFirstOfMonth(QDate date) const;
+
+ QString monthName(const QLocale &locale, int month)
+ {
+ return m_calendar.standaloneMonthName(locale, month, m_shownYear, QLocale::LongFormat);
+ }
int m_firstColumn;
int m_firstRow;
+ QCalendar m_calendar;
QDate m_date;
QDate m_minimumDate;
QDate m_maximumDate;
@@ -950,9 +958,9 @@ public:
virtual void keyboardSearch(const QString & search) override { Q_UNUSED(search) }
signals:
- void showDate(const QDate &date);
- void changeDate(const QDate &date, bool changeMonth);
- void clicked(const QDate &date);
+ void showDate(QDate date);
+ void changeDate(QDate date, bool changeMonth);
+ void clicked(QDate date);
void editingFinished();
protected:
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
@@ -983,8 +991,8 @@ QCalendarModel::QCalendarModel(QObject *parent)
m_date(QDate::currentDate()),
m_minimumDate(QDate::fromJulianDay(1)),
m_maximumDate(9999, 12, 31),
- m_shownYear(m_date.year()),
- m_shownMonth(m_date.month()),
+ m_shownYear(m_date.year(m_calendar)),
+ m_shownMonth(m_date.month(m_calendar)),
m_firstDay(QLocale().firstDayOfWeek()),
m_horizontalHeaderFormat(QCalendarWidget::ShortDayNames),
m_weekNumbersShown(true),
@@ -1027,9 +1035,10 @@ will be rendered in 2nd or 3rd row, showing more dates from previous month.
*/
QDate QCalendarModel::referenceDate() const
{
+ // TODO: Check this
int refDay = 1;
while (refDay <= 31) {
- QDate refDate(m_shownYear, m_shownMonth, refDay);
+ QDate refDate(m_shownYear, m_shownMonth, refDay, m_calendar);
if (refDate.isValid())
return refDate;
refDay += 1;
@@ -1037,9 +1046,10 @@ QDate QCalendarModel::referenceDate() const
return QDate();
}
-int QCalendarModel::columnForFirstOfMonth(const QDate &date) const
+int QCalendarModel::columnForFirstOfMonth(QDate date) const
{
- return (columnForDayOfWeek(static_cast<Qt::DayOfWeek>(date.dayOfWeek())) - (date.day() % 7) + 8) % 7;
+ return (columnForDayOfWeek(static_cast<Qt::DayOfWeek>(m_calendar.dayOfWeek(date)))
+ - (date.day(m_calendar) % 7) + 8) % 7;
}
QDate QCalendarModel::dateForCell(int row, int column) const
@@ -1055,11 +1065,12 @@ QDate QCalendarModel::dateForCell(int row, int column) const
if (columnForFirstOfShownMonth - m_firstColumn < MinimumDayOffset)
row -= 1;
- const int requestedDay = 7 * (row - m_firstRow) + column - columnForFirstOfShownMonth - refDate.day() + 1;
+ const int requestedDay =
+ 7 * (row - m_firstRow) + column - columnForFirstOfShownMonth - refDate.day(m_calendar) + 1;
return refDate.addDays(requestedDay);
}
-void QCalendarModel::cellForDate(const QDate &date, int *row, int *column) const
+void QCalendarModel::cellForDate(QDate date, int *row, int *column) const
{
if (!row && !column)
return;
@@ -1074,7 +1085,8 @@ void QCalendarModel::cellForDate(const QDate &date, int *row, int *column) const
return;
const int columnForFirstOfShownMonth = columnForFirstOfMonth(refDate);
- const int requestedPosition = refDate.daysTo(date) - m_firstColumn + columnForFirstOfShownMonth + refDate.day() - 1;
+ const int requestedPosition = (refDate.daysTo(date) - m_firstColumn +
+ columnForFirstOfShownMonth + refDate.day(m_calendar) - 1);
int c = requestedPosition % 7;
int r = requestedPosition / 7;
@@ -1147,7 +1159,7 @@ QTextCharFormat QCalendarModel::formatForCell(int row, int col) const
format.merge(m_dateFormats.value(date));
if(date < m_minimumDate || date > m_maximumDate)
format.setBackground(pal.brush(cg, QPalette::Window));
- if (m_shownMonth != date.month())
+ if (m_shownMonth != date.month(m_calendar))
format.setForeground(pal.brush(QPalette::Disabled, QPalette::Text));
}
return format;
@@ -1173,7 +1185,7 @@ QVariant QCalendarModel::data(const QModelIndex &index, int role) const
return dayName(dayOfWeekForColumn(column));
QDate date = dateForCell(row, column);
if (date.isValid())
- return date.day();
+ return date.day(m_calendar);
return QString();
}
@@ -1201,7 +1213,7 @@ Qt::ItemFlags QCalendarModel::flags(const QModelIndex &index) const
return QAbstractTableModel::flags(index);
}
-void QCalendarModel::setDate(const QDate &d)
+void QCalendarModel::setDate(QDate d)
{
m_date = d;
if (m_date < m_minimumDate)
@@ -1210,6 +1222,20 @@ void QCalendarModel::setDate(const QDate &d)
m_date = m_maximumDate;
}
+void QCalendarModel::setCalendar(QCalendar c)
+{
+ m_calendar = c;
+ m_shownYear = m_date.year(c);
+ m_shownMonth = m_date.month(c);
+ internalUpdate();
+ m_view->internalUpdate();
+}
+
+QCalendar QCalendarModel::calendar() const
+{
+ return m_calendar;
+}
+
void QCalendarModel::showMonth(int year, int month)
{
if (m_shownYear == year && m_shownMonth == month)
@@ -1221,7 +1247,7 @@ void QCalendarModel::showMonth(int year, int month)
internalUpdate();
}
-void QCalendarModel::setMinimumDate(const QDate &d)
+void QCalendarModel::setMinimumDate(QDate d)
{
if (!d.isValid() || d == m_minimumDate)
return;
@@ -1234,7 +1260,7 @@ void QCalendarModel::setMinimumDate(const QDate &d)
internalUpdate();
}
-void QCalendarModel::setMaximumDate(const QDate &d)
+void QCalendarModel::setMaximumDate(QDate d)
{
if (!d.isValid() || d == m_maximumDate)
return;
@@ -1247,7 +1273,7 @@ void QCalendarModel::setMaximumDate(const QDate &d)
internalUpdate();
}
-void QCalendarModel::setRange(const QDate &min, const QDate &max)
+void QCalendarModel::setRange(QDate min, QDate max)
{
m_minimumDate = min;
m_maximumDate = max;
@@ -1340,6 +1366,8 @@ QModelIndex QCalendarView::moveCursor(CursorAction cursorAction, Qt::KeyboardMod
if (!calendarModel)
return QTableView::moveCursor(cursorAction, modifiers);
+ QCalendar cal = calendarModel->calendar();
+
if (readOnly)
return currentIndex();
@@ -1358,17 +1386,27 @@ QModelIndex QCalendarView::moveCursor(CursorAction cursorAction, Qt::KeyboardMod
case QAbstractItemView::MoveRight:
currentDate = currentDate.addDays(isRightToLeft() ? -1 : 1);
break;
- case QAbstractItemView::MoveHome:
- currentDate = QDate(currentDate.year(), currentDate.month(), 1);
+ case QAbstractItemView::MoveHome: {
+ auto parts = cal.partsFromDate(currentDate);
+ if (parts.isValid()) {
+ parts.day = 1;
+ currentDate = cal.dateFromParts(parts);
+ }
+ }
break;
- case QAbstractItemView::MoveEnd:
- currentDate = QDate(currentDate.year(), currentDate.month(), currentDate.daysInMonth());
+ case QAbstractItemView::MoveEnd: {
+ auto parts = cal.partsFromDate(currentDate);
+ if (parts.isValid()) {
+ parts.day = cal.daysInMonth(parts.year, parts.month);
+ currentDate = cal.dateFromParts(parts);
+ }
+ }
break;
case QAbstractItemView::MovePageUp:
- currentDate = currentDate.addMonths(-1);
+ currentDate = currentDate.addMonths(-1, cal);
break;
case QAbstractItemView::MovePageDown:
- currentDate = currentDate.addMonths(1);
+ currentDate = currentDate.addMonths(1, cal);
break;
case QAbstractItemView::MoveNext:
case QAbstractItemView::MovePrevious:
@@ -1384,14 +1422,14 @@ void QCalendarView::keyPressEvent(QKeyEvent *event)
{
#ifdef QT_KEYPAD_NAVIGATION
if (event->key() == Qt::Key_Select) {
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus()) {
setEditFocus(true);
return;
}
}
} else if (event->key() == Qt::Key_Back) {
- if (QApplication::keypadNavigationEnabled() && hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && hasEditFocus()) {
if (qobject_cast<QCalendarModel *>(model())) {
emit changeDate(origDate, true); //changes selection back to origDate, but doesn't activate
setEditFocus(false);
@@ -1418,11 +1456,12 @@ void QCalendarView::keyPressEvent(QKeyEvent *event)
#if QT_CONFIG(wheelevent)
void QCalendarView::wheelEvent(QWheelEvent *event)
{
- const int numDegrees = event->delta() / 8;
+ const int numDegrees = event->angleDelta().y() / 8;
const int numSteps = numDegrees / 15;
const QModelIndex index = currentIndex();
- QDate currentDate = static_cast<QCalendarModel*>(model())->dateForCell(index.row(), index.column());
- currentDate = currentDate.addMonths(-numSteps);
+ QCalendarModel *calendarModel = static_cast<QCalendarModel*>(model());
+ QDate currentDate = calendarModel->dateForCell(index.row(), index.column());
+ currentDate = currentDate.addMonths(-numSteps, calendarModel->calendar());
emit showDate(currentDate);
}
#endif
@@ -1565,7 +1604,7 @@ public:
{ }
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
- void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const;
+ void paintCell(QPainter *painter, const QRect &rect, QDate date) const;
private:
QCalendarWidgetPrivate *calendarWidgetPrivate;
@@ -1584,7 +1623,6 @@ protected:
{
Q_UNUSED(e)
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
QStyleOptionToolButton opt;
initStyleOption(&opt);
@@ -1597,7 +1635,7 @@ protected:
toolPalette.setColor(QPalette::ButtonText, toolPalette.color(QPalette::HighlightedText));
setPalette(toolPalette);
}
-#endif
+
QToolButton::paintEvent(e);
}
};
@@ -1627,11 +1665,11 @@ public:
void showMonth(int year, int month);
void update();
- void paintCell(QPainter *painter, const QRect &rect, const QDate &date) const;
+ void paintCell(QPainter *painter, const QRect &rect, QDate date) const;
- void _q_slotShowDate(const QDate &date);
- void _q_slotChangeDate(const QDate &date);
- void _q_slotChangeDate(const QDate &date, bool changeMonth);
+ void _q_slotShowDate(QDate date);
+ void _q_slotChangeDate(QDate date);
+ void _q_slotChangeDate(QDate date, bool changeMonth);
void _q_editingFinished();
void _q_monthChanged(QAction*);
void _q_prevMonthClicked();
@@ -1644,7 +1682,7 @@ public:
void updateMonthMenu();
void updateMonthMenuNames();
void updateNavigationBar();
- void updateCurrentPage(const QDate &newDate);
+ void updateCurrentPage(QDate newDate);
inline QDate getCurrentDate();
void setNavigatorEnabled(bool enable);
@@ -1683,7 +1721,7 @@ void QCalendarDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
}
}
-void QCalendarDelegate::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
+void QCalendarDelegate::paintCell(QPainter *painter, const QRect &rect, QDate date) const
{
storedOption.rect = rect;
int row = -1;
@@ -1755,8 +1793,8 @@ void QCalendarWidgetPrivate::createNavigationBar(QWidget *widget)
monthButton->setAutoRaise(true);
monthButton->setPopupMode(QToolButton::InstantPopup);
monthMenu = new QMenu(monthButton);
- for (int i = 1; i <= 12; i++) {
- QString monthName(q->locale().standaloneMonthName(i, QLocale::LongFormat));
+ for (int i = 1, e = m_model->m_calendar.maximumMonthsInYear(); i <= e; i++) {
+ QString monthName(m_model->monthName(q->locale(), i));
QAction *act = monthMenu->addAction(monthName);
act->setData(i);
monthToAction[i] = act;
@@ -1772,8 +1810,8 @@ void QCalendarWidgetPrivate::createNavigationBar(QWidget *widget)
monthButton->setFont(font);
yearButton->setFont(font);
yearEdit->setFrame(false);
- yearEdit->setMinimum(m_model->m_minimumDate.year());
- yearEdit->setMaximum(m_model->m_maximumDate.year());
+ yearEdit->setMinimum(m_model->m_minimumDate.year(m_model->m_calendar));
+ yearEdit->setMaximum(m_model->m_maximumDate.year(m_model->m_calendar));
yearEdit->hide();
spaceHolder = new QSpacerItem(0,0);
@@ -1803,7 +1841,7 @@ void QCalendarWidgetPrivate::createNavigationBar(QWidget *widget)
yearEdit->setObjectName(QLatin1String("qt_calendar_yearedit"));
updateMonthMenu();
- showMonth(m_model->m_date.year(), m_model->m_date.month());
+ showMonth(m_model->m_date.year(m_model->m_calendar), m_model->m_date.month(m_model->m_calendar));
}
void QCalendarWidgetPrivate::updateButtonIcons()
@@ -1815,22 +1853,24 @@ void QCalendarWidgetPrivate::updateButtonIcons()
void QCalendarWidgetPrivate::updateMonthMenu()
{
- int beg = 1, end = 12;
+ int maxMonths = m_model->m_calendar.monthsInYear(m_model->m_shownYear);
+ int beg = 1, end = maxMonths;
bool prevEnabled = true;
bool nextEnabled = true;
- if (m_model->m_shownYear == m_model->m_minimumDate.year()) {
- beg = m_model->m_minimumDate.month();
- if (m_model->m_shownMonth == m_model->m_minimumDate.month())
+ QCalendar cal = m_model->calendar();
+ if (m_model->m_shownYear == m_model->m_minimumDate.year(cal)) {
+ beg = m_model->m_minimumDate.month(cal);
+ if (m_model->m_shownMonth == m_model->m_minimumDate.month(cal))
prevEnabled = false;
}
- if (m_model->m_shownYear == m_model->m_maximumDate.year()) {
- end = m_model->m_maximumDate.month();
- if (m_model->m_shownMonth == m_model->m_maximumDate.month())
+ if (m_model->m_shownYear == m_model->m_maximumDate.year(cal)) {
+ end = m_model->m_maximumDate.month(cal);
+ if (m_model->m_shownMonth == m_model->m_maximumDate.month(cal))
nextEnabled = false;
}
prevMonth->setEnabled(prevEnabled);
nextMonth->setEnabled(nextEnabled);
- for (int i = 1; i <= 12; i++) {
+ for (int i = 1; i <= maxMonths; i++) {
bool monthEnabled = true;
if (i < beg || i > end)
monthEnabled = false;
@@ -1843,14 +1883,15 @@ void QCalendarWidgetPrivate::updateMonthMenuNames()
Q_Q(QCalendarWidget);
for (int i = 1; i <= 12; i++) {
- QString monthName(q->locale().standaloneMonthName(i, QLocale::LongFormat));
+ QString monthName(m_model->monthName(q->locale(), i));
monthToAction[i]->setText(monthName);
}
}
-void QCalendarWidgetPrivate::updateCurrentPage(const QDate &date)
+void QCalendarWidgetPrivate::updateCurrentPage(QDate date)
{
Q_Q(QCalendarWidget);
+ QCalendar cal = m_model->calendar();
QDate newDate = date;
QDate minDate = q->minimumDate();
@@ -1859,7 +1900,7 @@ void QCalendarWidgetPrivate::updateCurrentPage(const QDate &date)
newDate = minDate;
if (maxDate.isValid()&& maxDate.daysTo(newDate) > 0)
newDate = maxDate;
- showMonth(newDate.year(), newDate.month());
+ showMonth(newDate.year(cal), newDate.month(cal));
int row = -1, col = -1;
m_model->cellForDate(newDate, &row, &col);
if (row != -1 && col != -1)
@@ -1873,7 +1914,7 @@ void QCalendarWidgetPrivate::_q_monthChanged(QAction *act)
{
monthButton->setText(act->text());
QDate currentDate = getCurrentDate();
- QDate newDate = currentDate.addMonths(act->data().toInt()-currentDate.month());
+ QDate newDate = currentDate.addMonths(act->data().toInt() - currentDate.month(m_model->m_calendar), m_model->m_calendar);
updateCurrentPage(newDate);
}
@@ -1885,27 +1926,28 @@ QDate QCalendarWidgetPrivate::getCurrentDate()
void QCalendarWidgetPrivate::_q_prevMonthClicked()
{
- QDate currentDate = getCurrentDate().addMonths(-1);
+ QDate currentDate = getCurrentDate().addMonths(-1, m_model->m_calendar);
updateCurrentPage(currentDate);
}
void QCalendarWidgetPrivate::_q_nextMonthClicked()
{
- QDate currentDate = getCurrentDate().addMonths(1);
+ QDate currentDate = getCurrentDate().addMonths(1, m_model->m_calendar);
updateCurrentPage(currentDate);
}
void QCalendarWidgetPrivate::_q_yearEditingFinished()
{
Q_Q(QCalendarWidget);
- yearButton->setText(yearEdit->text());
+ yearButton->setText(q->locale().toString(yearEdit->value()));
yearEdit->hide();
q->setFocusPolicy(oldFocusPolicy);
qApp->removeEventFilter(q);
spaceHolder->changeSize(0, 0);
yearButton->show();
QDate currentDate = getCurrentDate();
- currentDate = currentDate.addYears(yearEdit->text().toInt() - currentDate.year());
+ int newYear = q->locale().toInt(yearEdit->text());
+ currentDate = currentDate.addYears(newYear - currentDate.year(m_model->m_calendar), m_model->m_calendar);
updateCurrentPage(currentDate);
}
@@ -1944,7 +1986,7 @@ void QCalendarWidgetPrivate::updateNavigationBar()
{
Q_Q(QCalendarWidget);
- QString monthName = q->locale().standaloneMonthName(m_model->m_shownMonth, QLocale::LongFormat);
+ QString monthName = m_model->monthName(q->locale(), m_model->m_shownMonth);
monthButton->setText(monthName);
yearEdit->setValue(m_model->m_shownYear);
@@ -1964,29 +2006,29 @@ void QCalendarWidgetPrivate::update()
}
}
-void QCalendarWidgetPrivate::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
+void QCalendarWidgetPrivate::paintCell(QPainter *painter, const QRect &rect, QDate date) const
{
Q_Q(const QCalendarWidget);
q->paintCell(painter, rect, date);
}
-void QCalendarWidgetPrivate::_q_slotShowDate(const QDate &date)
+void QCalendarWidgetPrivate::_q_slotShowDate(QDate date)
{
updateCurrentPage(date);
}
-void QCalendarWidgetPrivate::_q_slotChangeDate(const QDate &date)
+void QCalendarWidgetPrivate::_q_slotChangeDate(QDate date)
{
_q_slotChangeDate(date, true);
}
-void QCalendarWidgetPrivate::_q_slotChangeDate(const QDate &date, bool changeMonth)
+void QCalendarWidgetPrivate::_q_slotChangeDate(QDate date, bool changeMonth)
{
QDate oldDate = m_model->m_date;
m_model->setDate(date);
QDate newDate = m_model->m_date;
if (changeMonth)
- showMonth(newDate.year(), newDate.month());
+ showMonth(newDate.year(m_model->m_calendar), newDate.month(m_model->m_calendar));
if (oldDate != newDate) {
update();
Q_Q(QCalendarWidget);
@@ -2242,7 +2284,7 @@ QSize QCalendarWidget::minimumSizeHint() const
QFontMetrics fm = d->monthButton->fontMetrics();
int monthW = 0;
for (int i = 1; i < 12; i++) {
- QString monthName = locale().standaloneMonthName(i, QLocale::LongFormat);
+ QString monthName = d->m_model->monthName(locale(), i);
monthW = qMax(monthW, fm.boundingRect(monthName).width());
}
const int buttonDecoMargin = d->monthButton->sizeHint().width() - fm.boundingRect(d->monthButton->text()).width();
@@ -2302,7 +2344,8 @@ void QCalendarWidget::setSelectedDate(const QDate &date)
d->m_model->setDate(date);
d->update();
QDate newDate = d->m_model->m_date;
- d->showMonth(newDate.year(), newDate.month());
+ QCalendar cal = d->m_model->m_calendar;
+ d->showMonth(newDate.year(cal), newDate.month(cal));
emit selectionChanged();
}
@@ -2348,14 +2391,15 @@ void QCalendarWidget::setCurrentPage(int year, int month)
{
Q_D(QCalendarWidget);
QDate currentDate = d->getCurrentDate();
- int day = currentDate.day();
- int daysInMonths = QDate(year, month, 1).daysInMonth();
+ QCalendar cal = d->m_model->m_calendar;
+ int day = currentDate.day(cal);
+ int daysInMonths = cal.daysInMonth(year, month);
if (day > daysInMonths)
day = daysInMonths;
d->showMonth(year, month);
- QDate newDate(year, month, day);
+ QDate newDate(year, month, day, d->m_model->m_calendar);
int row = -1, col = -1;
d->m_model->cellForDate(newDate, &row, &col);
if (row != -1 && col != -1) {
@@ -2373,9 +2417,10 @@ void QCalendarWidget::setCurrentPage(int year, int month)
void QCalendarWidget::showNextMonth()
{
+ Q_D(const QCalendarWidget);
int year = yearShown();
int month = monthShown();
- if (month == 12) {
+ if (month == d->m_model->m_calendar.maximumMonthsInYear()) {
++year;
month = 1;
} else {
@@ -2393,11 +2438,13 @@ void QCalendarWidget::showNextMonth()
void QCalendarWidget::showPreviousMonth()
{
+ Q_D(const QCalendarWidget);
+
int year = yearShown();
int month = monthShown();
if (month == 1) {
--year;
- month = 12;
+ month = d->m_model->m_calendar.maximumMonthsInYear();
} else {
--month;
}
@@ -2443,8 +2490,10 @@ void QCalendarWidget::showPreviousYear()
*/
void QCalendarWidget::showSelectedDate()
{
+ Q_D(const QCalendarWidget);
+
QDate currentDate = selectedDate();
- setCurrentPage(currentDate.year(), currentDate.month());
+ setCurrentPage(currentDate.year(d->m_model->m_calendar), currentDate.month(d->m_model->m_calendar));
}
/*!
@@ -2454,8 +2503,10 @@ void QCalendarWidget::showSelectedDate()
*/
void QCalendarWidget::showToday()
{
+ Q_D(const QCalendarWidget);
+
QDate currentDate = QDate::currentDate();
- setCurrentPage(currentDate.year(), currentDate.month());
+ setCurrentPage(currentDate.year(d->m_model->m_calendar), currentDate.month(d->m_model->m_calendar));
}
/*!
@@ -2498,12 +2549,12 @@ void QCalendarWidget::setMinimumDate(const QDate &date)
QDate oldDate = d->m_model->m_date;
d->m_model->setMinimumDate(date);
- d->yearEdit->setMinimum(d->m_model->m_minimumDate.year());
+ d->yearEdit->setMinimum(d->m_model->m_minimumDate.year(d->m_model->m_calendar));
d->updateMonthMenu();
QDate newDate = d->m_model->m_date;
if (oldDate != newDate) {
d->update();
- d->showMonth(newDate.year(), newDate.month());
+ d->showMonth(newDate.year(d->m_model->m_calendar), newDate.month(d->m_model->m_calendar));
d->m_navigator->setDate(newDate);
emit selectionChanged();
}
@@ -2549,12 +2600,12 @@ void QCalendarWidget::setMaximumDate(const QDate &date)
QDate oldDate = d->m_model->m_date;
d->m_model->setMaximumDate(date);
- d->yearEdit->setMaximum(d->m_model->m_maximumDate.year());
+ d->yearEdit->setMaximum(d->m_model->m_maximumDate.year(d->m_model->m_calendar));
d->updateMonthMenu();
QDate newDate = d->m_model->m_date;
if (oldDate != newDate) {
d->update();
- d->showMonth(newDate.year(), newDate.month());
+ d->showMonth(newDate.year(d->m_model->m_calendar), newDate.month(d->m_model->m_calendar));
d->m_navigator->setDate(newDate);
emit selectionChanged();
}
@@ -2589,13 +2640,13 @@ void QCalendarWidget::setDateRange(const QDate &min, const QDate &max)
QDate oldDate = d->m_model->m_date;
d->m_model->setRange(min, max);
- d->yearEdit->setMinimum(d->m_model->m_minimumDate.year());
- d->yearEdit->setMaximum(d->m_model->m_maximumDate.year());
+ d->yearEdit->setMinimum(d->m_model->m_minimumDate.year(d->m_model->m_calendar));
+ d->yearEdit->setMaximum(d->m_model->m_maximumDate.year(d->m_model->m_calendar));
d->updateMonthMenu();
QDate newDate = d->m_model->m_date;
if (oldDate != newDate) {
d->update();
- d->showMonth(newDate.year(), newDate.month());
+ d->showMonth(newDate.year(d->m_model->m_calendar), newDate.month(d->m_model->m_calendar));
d->m_navigator->setDate(newDate);
emit selectionChanged();
}
@@ -2702,6 +2753,22 @@ bool QCalendarWidget::isGridVisible() const
return d->m_view->showGrid();
}
+QCalendar QCalendarWidget::calendar() const
+{
+ Q_D(const QCalendarWidget);
+ return d->m_model->m_calendar;
+}
+
+void QCalendarWidget::setCalendar(QCalendar c)
+{
+ Q_D(QCalendarWidget);
+ d->m_model->setCalendar(c);
+ d->updateMonthMenuNames();
+ d->yearEdit->setMinimum(d->m_model->m_minimumDate.year(d->m_model->m_calendar));
+ d->yearEdit->setMaximum(d->m_model->m_maximumDate.year(d->m_model->m_calendar));
+ d->updateNavigationBar();
+}
+
void QCalendarWidget::setGridVisible(bool show)
{
Q_D(QCalendarWidget);
@@ -3042,6 +3109,9 @@ bool QCalendarWidget::event(QEvent *event)
d->updateMonthMenuNames();
d->updateNavigationBar();
d->m_view->updateGeometry();
+ // TODO: fix this known bug of calendaring API:
+ // Changing locale before calendar works, but reverse order causes
+ // invalid month names (in C Locale apparently).
break;
case QEvent::FontChange:
case QEvent::ApplicationFontChange:
diff --git a/src/widgets/widgets/qcalendarwidget.h b/src/widgets/widgets/qcalendarwidget.h
index 44ba340289..08825a0ff3 100644
--- a/src/widgets/widgets/qcalendarwidget.h
+++ b/src/widgets/widgets/qcalendarwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -112,6 +112,9 @@ public:
bool isNavigationBarVisible() const;
bool isGridVisible() const;
+ QCalendar calendar() const;
+ void setCalendar(QCalendar calendar);
+
SelectionMode selectionMode() const;
void setSelectionMode(SelectionMode mode);
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index 483cfd8c55..9a0e969e1c 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -64,7 +64,9 @@
#include <qheaderview.h>
#include <qmath.h>
#include <qmetaobject.h>
+#if QT_CONFIG(proxymodel)
#include <qabstractproxymodel.h>
+#endif
#include <qstylehints.h>
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
@@ -200,6 +202,7 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt
void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
{
Q_Q(QComboBox);
+#if QT_CONFIG(proxymodel)
if (index.isValid() && q->completer()) {
QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(q->completer()->completionModel());
if (proxy) {
@@ -221,9 +224,10 @@ void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
emitActivated(currentIndex);
}
}
+#endif
# ifdef QT_KEYPAD_NAVIGATION
- if ( QApplication::keypadNavigationEnabled()
+ if ( QApplicationPrivate::keypadNavigationEnabled()
&& q->isEditable()
&& q->completer()
&& q->completer()->completionMode() == QCompleter::UnfilteredPopupCompletion ) {
@@ -443,13 +447,6 @@ void QComboBoxPrivateContainer::paintEvent(QPaintEvent *e)
void QComboBoxPrivateContainer::leaveEvent(QEvent *)
{
-// On Mac using the Mac style we want to clear the selection
-// when the mouse moves outside the popup.
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- QStyleOptionComboBox opt = comboStyleOption();
- if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo))
- view->clearSelection();
-#endif
}
QComboBoxPrivateContainer::QComboBoxPrivateContainer(QAbstractItemView *itemView, QComboBox *parent)
@@ -691,7 +688,7 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e)
setFrameStyle(combo->style()->styleHint(QStyle::SH_ComboBox_PopupFrameStyle, &opt, combo));
}
- QWidget::changeEvent(e);
+ QFrame::changeEvent(e);
}
@@ -865,6 +862,16 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
when the choice is not changed. If you need to know when the
choice actually changes, use signal currentIndexChanged().
+ \obsolete Use QComboBox::textActivated() instead
+*/
+/*!
+ \fn void QComboBox::textActivated(const QString &text)
+ \since 5.14
+
+ This signal is sent when the user chooses an item in the combobox.
+ The item's \a text is passed. Note that this signal is sent even
+ when the choice is not changed. If you need to know when the
+ choice actually changes, use signal currentIndexChanged().
*/
/*!
@@ -879,6 +886,15 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
This signal is sent when an item in the combobox popup list is
highlighted by the user. The item's \a text is passed.
+
+ \obsolete Use textHighlighted() instead
+*/
+/*!
+ \fn void QComboBox::textHighlighted(const QString &text)
+ \since 5.14
+
+ This signal is sent when an item in the combobox popup list is
+ highlighted by the user. The item's \a text is passed.
*/
/*!
@@ -891,7 +907,6 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
currentIndex was reset.
*/
-#if QT_DEPRECATED_SINCE(5, 13)
/*!
\fn void QComboBox::currentIndexChanged(const QString &text)
\since 4.1
@@ -900,7 +915,6 @@ QStyleOptionComboBox QComboBoxPrivateContainer::comboStyleOption() const
changes either through user interaction or programmatically. The
item's \a text is passed.
*/
-#endif
/*!
\fn void QComboBox::currentTextChanged(const QString &text)
@@ -1355,7 +1369,13 @@ void QComboBoxPrivate::emitActivated(const QModelIndex &index)
return;
QString text(itemText(index));
emit q->activated(index.row());
+ emit q->textActivated(text);
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->activated(text);
+QT_WARNING_POP
+#endif
}
void QComboBoxPrivate::_q_emitHighlighted(const QModelIndex &index)
@@ -1365,7 +1385,13 @@ void QComboBoxPrivate::_q_emitHighlighted(const QModelIndex &index)
return;
QString text(itemText(index));
emit q->highlighted(index.row());
+ emit q->textHighlighted(text);
+#if QT_DEPRECATED_SINCE(5, 15)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->highlighted(text);
+QT_WARNING_POP
+#endif
}
void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index)
@@ -1522,7 +1548,7 @@ void QComboBox::setAutoCompletion(bool enable)
Q_D(QComboBox);
#ifdef QT_KEYPAD_NAVIGATION
- if (Q_UNLIKELY(QApplication::keypadNavigationEnabled() && !enable && isEditable()))
+ if (Q_UNLIKELY(QApplicationPrivate::keypadNavigationEnabled() && !enable && isEditable()))
qWarning("QComboBox::setAutoCompletion: auto completion is mandatory when combo box editable");
#endif
@@ -1864,13 +1890,12 @@ void QComboBox::setLineEdit(QLineEdit *edit)
d->updateFocusPolicy();
d->lineEdit->setFocusProxy(this);
d->lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
+#if QT_DEPRECATED_SINCE(5, 13)
#if QT_CONFIG(completer)
setAutoCompletion(d->autoCompletion);
-#endif
#ifdef QT_KEYPAD_NAVIGATION
-#if QT_CONFIG(completer)
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// Editable combo boxes will have a completer that is set to UnfilteredPopupCompletion.
// This means that when the user enters edit mode they are immediately presented with a
// list of possible completions.
@@ -1882,6 +1907,7 @@ void QComboBox::setLineEdit(QLineEdit *edit)
}
#endif
#endif
+#endif
setAttribute(Qt::WA_InputMethodEnabled);
d->updateLayoutDirection();
@@ -2513,21 +2539,6 @@ QSize QComboBox::sizeHint() const
}
#ifdef Q_OS_MAC
-
-namespace {
-struct IndexSetter {
- int index;
- QComboBox *cb;
-
- void operator()(void)
- {
- cb->setCurrentIndex(index);
- emit cb->activated(index);
- emit cb->activated(cb->itemText(index));
- }
-};
-}
-
void QComboBoxPrivate::cleanupNativePopup()
{
if (!m_platformMenu)
@@ -2601,7 +2612,7 @@ bool QComboBoxPrivate::showNativePopup()
// We need to fake one here to un-press the button.
QMouseEvent mouseReleased(QEvent::MouseButtonRelease, q->pos(), Qt::LeftButton,
Qt::MouseButtons(Qt::LeftButton), Qt::KeyboardModifiers());
- qApp->sendEvent(q, &mouseReleased);
+ QCoreApplication::sendEvent(q, &mouseReleased);
#endif
return true;
@@ -2641,7 +2652,7 @@ void QComboBox::showPopup()
#ifdef QT_KEYPAD_NAVIGATION
#if QT_CONFIG(completer)
- if (QApplication::keypadNavigationEnabled() && d->completer) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && d->completer) {
// editable combo box is line edit plus completer
setEditFocus(true);
d->completer->complete(); // show popup
@@ -2702,15 +2713,14 @@ void QComboBox::showPopup()
int heightMargin = container->topMargin() + container->bottomMargin();
// add the frame of the container
- int marginTop, marginBottom;
- container->getContentsMargins(0, &marginTop, 0, &marginBottom);
- heightMargin += marginTop + marginBottom;
+ const QMargins cm = container->contentsMargins();
+ heightMargin += cm.top() + cm.bottom();
//add the frame of the view
- view()->getContentsMargins(0, &marginTop, 0, &marginBottom);
- marginTop += static_cast<QAbstractScrollAreaPrivate *>(QObjectPrivate::get(view()))->top;
- marginBottom += static_cast<QAbstractScrollAreaPrivate *>(QObjectPrivate::get(view()))->bottom;
- heightMargin += marginTop + marginBottom;
+ const QMargins vm = view()->contentsMargins();
+ heightMargin += vm.top() + vm.bottom();
+ heightMargin += static_cast<QAbstractScrollAreaPrivate *>(QObjectPrivate::get(view()))->top;
+ heightMargin += static_cast<QAbstractScrollAreaPrivate *>(QObjectPrivate::get(view()))->bottom;
listRect.setHeight(listRect.height() + heightMargin);
}
@@ -2821,19 +2831,15 @@ void QComboBox::showPopup()
bool startTimer = !container->isVisible();
container->raise();
container->create();
- QWindow *containerWindow = container->window()->windowHandle();
- if (containerWindow) {
- QWindow *win = window()->windowHandle();
- if (win) {
- QScreen *currentScreen = win->screen();
- if (currentScreen && !currentScreen->virtualSiblings().contains(containerWindow->screen())) {
- containerWindow->setScreen(currentScreen);
-
- // This seems to workaround an issue in xcb+multi GPU+multiscreen
- // environment where the window might not always show up when screen
- // is changed.
- container->hide();
- }
+ if (QWindow *containerWindow = qt_widget_private(container)->windowHandle(QWidgetPrivate::WindowHandleMode::TopLevel)) {
+ QScreen *currentScreen = d->associatedScreen();
+ if (currentScreen && !currentScreen->virtualSiblings().contains(containerWindow->screen())) {
+ containerWindow->setScreen(currentScreen);
+
+ // This seems to workaround an issue in xcb+multi GPU+multiscreen
+ // environment where the window might not always show up when screen
+ // is changed.
+ container->hide();
}
}
container->show();
@@ -2851,7 +2857,7 @@ void QComboBox::showPopup()
container->update();
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
view()->setEditFocus(true);
#endif
if (startTimer) {
@@ -2902,7 +2908,7 @@ void QComboBox::hidePopup()
bool didFade = false;
if (needFade) {
#if defined(Q_OS_MAC)
- QPlatformNativeInterface *platformNativeInterface = qApp->platformNativeInterface();
+ QPlatformNativeInterface *platformNativeInterface = QGuiApplication::platformNativeInterface();
int at = platformNativeInterface->metaObject()->indexOfMethod("fadeWindow()");
if (at != -1) {
QMetaMethod windowFade = platformNativeInterface->metaObject()->method(at);
@@ -2923,7 +2929,7 @@ void QComboBox::hidePopup()
d->container->hide();
}
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && isEditable() && hasFocus())
+ if (QApplicationPrivate::keypadNavigationEnabled() && isEditable() && hasFocus())
setEditFocus(true);
#endif
d->_q_resetButton();
@@ -3182,7 +3188,7 @@ void QComboBoxPrivate::showPopupFromMouseEvent(QMouseEvent *e)
}
} else {
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && sc == QStyle::SC_ComboBoxEditField && lineEdit) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && sc == QStyle::SC_ComboBoxEditField && lineEdit) {
lineEdit->event(e); //so lineedit can move cursor, etc
return;
}
@@ -3231,7 +3237,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
Q_FALLTHROUGH();
case Qt::Key_PageUp:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
e->ignore();
else
#endif
@@ -3246,7 +3252,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
Q_FALLTHROUGH();
case Qt::Key_PageDown:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
e->ignore();
else
#endif
@@ -3280,7 +3286,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
break;
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& (!hasEditFocus() || !d->lineEdit)) {
showPopup();
return;
@@ -3288,11 +3294,11 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
break;
case Qt::Key_Left:
case Qt::Key_Right:
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus())
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus())
e->ignore();
break;
case Qt::Key_Back:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus() || !d->lineEdit)
e->ignore();
} else {
@@ -3370,12 +3376,13 @@ void QComboBox::wheelEvent(QWheelEvent *e)
!d->viewContainer()->isVisible()) {
const int rowCount = count();
int newIndex = currentIndex();
+ int delta = e->angleDelta().y();
- if (e->delta() > 0) {
+ if (delta > 0) {
newIndex--;
while ((newIndex >= 0) && !(d->model->flags(d->model->index(newIndex,d->modelColumn,d->root)) & Qt::ItemIsEnabled))
newIndex--;
- } else if (e->delta() < 0) {
+ } else if (delta < 0) {
newIndex++;
while (newIndex < rowCount && !(d->model->index(newIndex, d->modelColumn, d->root).flags() & Qt::ItemIsEnabled))
newIndex++;
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index b2fe921bd8..286772c091 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -223,12 +223,18 @@ public Q_SLOTS:
Q_SIGNALS:
void editTextChanged(const QString &);
void activated(int index);
- void activated(const QString &);
+ void textActivated(const QString &);
void highlighted(int index);
- void highlighted(const QString &);
+ void textHighlighted(const QString &);
void currentIndexChanged(int index);
void currentIndexChanged(const QString &);
void currentTextChanged(const QString &);
+#if QT_DEPRECATED_SINCE(5, 15)
+ QT_DEPRECATED_VERSION_X(5, 15, "Use textActivated() instead")
+ void activated(const QString &);
+ QT_DEPRECATED_VERSION_X(5, 15, "Use textHighlighted() instead")
+ void highlighted(const QString &);
+#endif
protected:
void focusInEvent(QFocusEvent *e) override;
diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h
index 71404964da..5967776a61 100644
--- a/src/widgets/widgets/qcombobox_p.h
+++ b/src/widgets/widgets/qcombobox_p.h
@@ -86,7 +86,7 @@ class QComboBoxListView : public QListView
{
Q_OBJECT
public:
- QComboBoxListView(QComboBox *cmb = 0) : combo(cmb) {}
+ QComboBoxListView(QComboBox *cmb = nullptr) : combo(cmb) {}
protected:
void resizeEvent(QResizeEvent *event) override
@@ -331,7 +331,7 @@ protected:
QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const override {
if (isSeparator(index)) {
- int pm = mCombo->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, mCombo);
+ int pm = mCombo->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, nullptr, mCombo);
return QSize(pm, pm);
}
return QItemDelegate::sizeHint(option, index);
@@ -390,6 +390,16 @@ public:
#ifdef Q_OS_MAC
void cleanupNativePopup();
bool showNativePopup();
+ struct IndexSetter {
+ int index;
+ QComboBox *cb;
+
+ void operator()(void)
+ {
+ cb->setCurrentIndex(index);
+ cb->d_func()->emitActivated(cb->d_func()->currentIndex);
+ }
+ };
#endif
QAbstractItemModel *model;
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 3e6afdb586..e26993fb23 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include <private/qapplication_p.h>
#include <private/qdatetimeedit_p.h>
#include <qabstractspinbox.h>
#include <qapplication.h>
@@ -153,7 +154,7 @@ QDateTimeEdit::QDateTimeEdit(QWidget *parent)
: QAbstractSpinBox(*new QDateTimeEditPrivate, parent)
{
Q_D(QDateTimeEdit);
- d->init(QDateTime(QDATETIMEEDIT_DATE_INITIAL, QDATETIMEEDIT_TIME_MIN));
+ d->init(QDATETIMEEDIT_DATE_INITIAL.startOfDay());
}
/*!
@@ -165,8 +166,7 @@ QDateTimeEdit::QDateTimeEdit(const QDateTime &datetime, QWidget *parent)
: QAbstractSpinBox(*new QDateTimeEditPrivate, parent)
{
Q_D(QDateTimeEdit);
- d->init(datetime.isValid() ? datetime : QDateTime(QDATETIMEEDIT_DATE_INITIAL,
- QDATETIMEEDIT_TIME_MIN));
+ d->init(datetime.isValid() ? datetime : QDATETIMEEDIT_DATE_INITIAL.startOfDay());
}
/*!
@@ -312,6 +312,22 @@ void QDateTimeEdit::setTime(const QTime &time)
}
+QCalendar QDateTimeEdit::calendar() const
+{
+ Q_D(const QDateTimeEdit);
+ return d->calendar;
+}
+
+void QDateTimeEdit::setCalendar(QCalendar calendar)
+{
+ Q_D(QDateTimeEdit);
+ // Set invalid date time to prevent runtime crashes on calendar change
+ QDateTime previousValue = d->value.toDateTime();
+ setDateTime(QDateTime());
+ d->setCalendar(calendar);
+ setDateTime(previousValue);
+}
+
/*!
\property QDateTimeEdit::minimumDateTime
\since 4.4
@@ -342,7 +358,7 @@ QDateTime QDateTimeEdit::minimumDateTime() const
void QDateTimeEdit::clearMinimumDateTime()
{
- setMinimumDateTime(QDateTime(QDATETIMEEDIT_COMPAT_DATE_MIN, QDATETIMEEDIT_TIME_MIN));
+ setMinimumDateTime(QDATETIMEEDIT_COMPAT_DATE_MIN.startOfDay());
}
void QDateTimeEdit::setMinimumDateTime(const QDateTime &dt)
@@ -385,7 +401,7 @@ QDateTime QDateTimeEdit::maximumDateTime() const
void QDateTimeEdit::clearMaximumDateTime()
{
- setMaximumDateTime(QDATETIMEEDIT_DATETIME_MAX);
+ setMaximumDateTime(QDATETIMEEDIT_DATE_MAX.endOfDay());
}
void QDateTimeEdit::setMaximumDateTime(const QDateTime &dt)
@@ -643,10 +659,10 @@ QDateTimeEdit::Section QDateTimeEdit::currentSection() const
{
Q_D(const QDateTimeEdit);
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && d->focusOnButton)
+ if (QApplicationPrivate::keypadNavigationEnabled() && d->focusOnButton)
return NoSection;
#endif
- return d->convertToPublic(d->sectionType(d->currentSectionIndex));
+ return QDateTimeEditPrivate::convertToPublic(d->sectionType(d->currentSectionIndex));
}
void QDateTimeEdit::setCurrentSection(Section section)
@@ -660,7 +676,7 @@ void QDateTimeEdit::setCurrentSection(Section section)
int index = d->currentSectionIndex + 1;
for (int i=0; i<2; ++i) {
while (index < size) {
- if (d->convertToPublic(d->sectionType(index)) == section) {
+ if (QDateTimeEditPrivate::convertToPublic(d->sectionType(index)) == section) {
d->edit->setCursorPosition(d->sectionPos(index));
QDTEDEBUG << d->sectionPos(index);
return;
@@ -686,7 +702,7 @@ QDateTimeEdit::Section QDateTimeEdit::sectionAt(int index) const
Q_D(const QDateTimeEdit);
if (index < 0 || index >= d->sectionNodes.size())
return NoSection;
- return d->convertToPublic(d->sectionType(index));
+ return QDateTimeEditPrivate::convertToPublic(d->sectionType(index));
}
/*!
@@ -880,7 +896,7 @@ void QDateTimeEdit::setDisplayFormat(const QString &format)
}
d->formatExplicitlySet = true;
- d->sections = d->convertSections(d->display);
+ d->sections = QDateTimeEditPrivate::convertSections(d->display);
d->clearCache();
d->currentSectionIndex = qMin(d->currentSectionIndex, d->sectionNodes.size() - 1);
@@ -1056,7 +1072,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
switch (event->key()) {
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_NumberSign: //shortcut to popup calendar
- if (QApplication::keypadNavigationEnabled() && d->calendarPopupEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && d->calendarPopupEnabled()) {
d->initCalendarPopup();
d->positionCalendarPopup();
d->monthCalendar->show();
@@ -1064,7 +1080,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
}
break;
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (hasEditFocus()) {
if (d->focusOnButton) {
d->initCalendarPopup();
@@ -1096,7 +1112,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
return;
default:
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()
&& !event->text().isEmpty() && event->text().at(0).isLetterOrNumber()) {
setEditFocus(true);
@@ -1118,23 +1134,13 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
if (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right) {
if (
#ifdef QT_KEYPAD_NAVIGATION
- QApplication::keypadNavigationEnabled() && !hasEditFocus()
- || !QApplication::keypadNavigationEnabled() &&
+ QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()
+ || !QApplicationPrivate::keypadNavigationEnabled() &&
#endif
!(event->modifiers() & Qt::ControlModifier)) {
select = false;
break;
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- else
-#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled())
-#endif
- {
- select = (event->modifiers() & Qt::ShiftModifier);
- break;
- }
-#endif
}
Q_FALLTHROUGH();
case Qt::Key_Backtab:
@@ -1148,7 +1154,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event)
&& (event->key() != Qt::Key_Tab || !(event->modifiers() & Qt::ShiftModifier));
#ifdef QT_KEYPAD_NAVIGATION
int newSection = d->nextPrevSection(d->currentSectionIndex, forward);
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (d->focusOnButton) {
newSection = forward ? 0 : d->sectionNodes.size() - 1;
d->focusOnButton = false;
@@ -1291,7 +1297,7 @@ void QDateTimeEdit::stepBy(int steps)
Q_D(QDateTimeEdit);
#ifdef QT_KEYPAD_NAVIGATION
// with keypad navigation and not editFocus, left right change the date/time by a fixed amount.
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
// if date based, shift by day. else shift by 15min
if (d->sections & DateSections_Mask) {
setDateTime(dateTime().addDays(steps));
@@ -1354,7 +1360,7 @@ void QDateTimeEdit::stepBy(int steps)
QString QDateTimeEdit::textFromDateTime(const QDateTime &dateTime) const
{
Q_D(const QDateTimeEdit);
- return locale().toString(dateTime, d->displayFormat);
+ return locale().toString(dateTime, d->displayFormat, d->calendar);
}
@@ -1418,7 +1424,7 @@ QDateTimeEdit::StepEnabled QDateTimeEdit::stepEnabled() const
QAbstractSpinBox::StepEnabled ret = 0;
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
if (d->wrapping)
return StepEnabled(StepUpEnabled | StepDownEnabled);
// 3 cases. date, time, datetime. each case look
@@ -1646,7 +1652,7 @@ QDateEdit::~QDateEdit()
QDateTimeEditPrivate::QDateTimeEditPrivate()
- : QDateTimeParser(QVariant::DateTime, QDateTimeParser::DateTimeEdit)
+ : QDateTimeParser(QVariant::DateTime, QDateTimeParser::DateTimeEdit, QCalendar())
{
hasHadFocus = false;
formatExplicitlySet = false;
@@ -1660,8 +1666,8 @@ QDateTimeEditPrivate::QDateTimeEditPrivate()
first.pos = 0;
sections = 0;
calendarPopup = false;
- minimum = QDATETIMEEDIT_COMPAT_DATETIME_MIN;
- maximum = QDATETIMEEDIT_DATETIME_MAX;
+ minimum = QDATETIMEEDIT_COMPAT_DATE_MIN.startOfDay();
+ maximum = QDATETIMEEDIT_DATE_MAX.endOfDay();
arrowState = QStyle::State_None;
monthCalendar = 0;
readLocaleSettings();
@@ -1671,10 +1677,6 @@ QDateTimeEditPrivate::QDateTimeEditPrivate()
#endif
}
-QDateTimeEditPrivate::~QDateTimeEditPrivate()
-{
-}
-
void QDateTimeEditPrivate::updateTimeSpec()
{
minimum = minimum.toDateTime().toTimeSpec(spec);
@@ -1685,8 +1687,8 @@ void QDateTimeEditPrivate::updateTimeSpec()
const bool dateShown = (sections & QDateTimeEdit::DateSections_Mask);
if (!dateShown) {
if (minimum.toTime() >= maximum.toTime()){
- minimum = QDateTime(value.toDate(), QDATETIMEEDIT_TIME_MIN, spec);
- maximum = QDateTime(value.toDate(), QDATETIMEEDIT_TIME_MAX, spec);
+ minimum = value.toDate().startOfDay(spec);
+ maximum = value.toDate().endOfDay(spec);
}
}
}
@@ -1703,7 +1705,7 @@ void QDateTimeEditPrivate::updateEdit()
if (!specialValue()
#ifdef QT_KEYPAD_NAVIGATION
- && !(QApplication::keypadNavigationEnabled() && !edit->hasEditFocus())
+ && !(QApplicationPrivate::keypadNavigationEnabled() && !edit->hasEditFocus())
#endif
) {
int cursor = sectionPos(currentSectionIndex);
@@ -1732,7 +1734,7 @@ void QDateTimeEditPrivate::setSelected(int sectionIndex, bool forward)
{
if (specialValue()
#ifdef QT_KEYPAD_NAVIGATION
- || (QApplication::keypadNavigationEnabled() && !edit->hasEditFocus())
+ || (QApplicationPrivate::keypadNavigationEnabled() && !edit->hasEditFocus())
#endif
) {
edit->selectAll();
@@ -2018,8 +2020,7 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c
val = (wrapping ? min + val - max - 1 : max);
}
-
- const int oldDay = v.date().day();
+ const int oldDay = v.date().day(calendar);
setDigit(v, sectionIndex, val);
// if this sets year or month it will make
@@ -2038,10 +2039,10 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c
if (steps > 0) {
setDigit(v, sectionIndex, min);
if (!(sn.type & DaySectionMask) && sections & DateSectionMask) {
- const int daysInMonth = v.date().daysInMonth();
- if (v.date().day() < oldDay && v.date().day() < daysInMonth) {
+ const int daysInMonth = v.date().daysInMonth(calendar);
+ if (v.date().day(calendar) < oldDay && v.date().day(calendar) < daysInMonth) {
const int adds = qMin(oldDay, daysInMonth);
- v = v.addDays(adds - v.date().day());
+ v = v.addDays(adds - v.date().day(calendar));
}
}
@@ -2053,10 +2054,10 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c
} else {
setDigit(v, sectionIndex, max);
if (!(sn.type & DaySectionMask) && sections & DateSectionMask) {
- const int daysInMonth = v.date().daysInMonth();
- if (v.date().day() < oldDay && v.date().day() < daysInMonth) {
+ const int daysInMonth = v.date().daysInMonth(calendar);
+ if (v.date().day(calendar) < oldDay && v.date().day(calendar) < daysInMonth) {
const int adds = qMin(oldDay, daysInMonth);
- v = v.addDays(adds - v.date().day());
+ v = v.addDays(adds - v.date().day(calendar));
}
}
@@ -2070,7 +2071,7 @@ QDateTime QDateTimeEditPrivate::stepBy(int sectionIndex, int steps, bool test) c
setDigit(v, sectionIndex, (steps > 0 ? localmax : localmin));
}
}
- if (!test && oldDay != v.date().day() && !(sn.type & DaySectionMask)) {
+ if (!test && oldDay != v.date().day(calendar) && !(sn.type & DaySectionMask)) {
// this should not happen when called from stepEnabled
cachedDay = qMax<int>(oldDay, cachedDay);
}
@@ -2402,7 +2403,7 @@ void QDateTimeEditPrivate::init(const QVariant &var)
Q_Q(QDateTimeEdit);
switch (var.type()) {
case QVariant::Date:
- value = QDateTime(var.toDate(), QDATETIMEEDIT_TIME_MIN);
+ value = var.toDate().startOfDay();
updateTimeSpec();
q->setDisplayFormat(defaultDateFormat);
if (sectionNodes.isEmpty()) // ### safeguard for broken locale
@@ -2427,7 +2428,7 @@ void QDateTimeEditPrivate::init(const QVariant &var)
break;
}
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
q->setCalendarPopup(true);
#endif
q->setInputMethodHints(Qt::ImhPreferNumbers);
@@ -2523,7 +2524,7 @@ void QDateTimeEditPrivate::initCalendarPopup(QCalendarWidget *cw)
{
Q_Q(QDateTimeEdit);
if (!monthCalendar) {
- monthCalendar = new QCalendarPopup(q, cw);
+ monthCalendar = new QCalendarPopup(q, cw, calendar);
monthCalendar->setObjectName(QLatin1String("qt_datetimedit_calendar"));
QObject::connect(monthCalendar, SIGNAL(newDateSelected(QDate)), q, SLOT(setDate(QDate)));
QObject::connect(monthCalendar, SIGNAL(hidingCalendar(QDate)), q, SLOT(setDate(QDate)));
@@ -2584,8 +2585,8 @@ void QDateTimeEditPrivate::syncCalendarWidget()
}
}
-QCalendarPopup::QCalendarPopup(QWidget * parent, QCalendarWidget *cw)
- : QWidget(parent, Qt::Popup)
+QCalendarPopup::QCalendarPopup(QWidget *parent, QCalendarWidget *cw, QCalendar ca)
+ : QWidget(parent, Qt::Popup), calendarSystem(ca)
{
setAttribute(Qt::WA_WindowPropagation);
@@ -2601,9 +2602,10 @@ QCalendarWidget *QCalendarPopup::verifyCalendarInstance()
{
if (calendar.isNull()) {
QCalendarWidget *cw = new QCalendarWidget(this);
+ cw->setCalendar(calendarSystem);
cw->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
cw->setHorizontalHeaderFormat(QCalendarWidget::SingleLetterDayNames);
#endif
setCalendarWidget(cw);
@@ -2634,13 +2636,13 @@ void QCalendarPopup::setCalendarWidget(QCalendarWidget *cw)
}
-void QCalendarPopup::setDate(const QDate &date)
+void QCalendarPopup::setDate(QDate date)
{
oldDate = date;
verifyCalendarInstance()->setSelectedDate(date);
}
-void QCalendarPopup::setDateRange(const QDate &min, const QDate &max)
+void QCalendarPopup::setDateRange(QDate min, QDate max)
{
QCalendarWidget *cw = verifyCalendarInstance();
cw->setMinimumDate(min);
@@ -2684,7 +2686,7 @@ void QCalendarPopup::dateSelectionChanged()
dateChanged = true;
emit newDateSelected(verifyCalendarInstance()->selectedDate());
}
-void QCalendarPopup::dateSelected(const QDate &date)
+void QCalendarPopup::dateSelected(QDate date)
{
dateChanged = true;
emit activated(date);
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index b6fb35fc71..03994675ae 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -42,6 +42,7 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qdatetime.h>
+#include <QtCore/qcalendar.h>
#include <QtCore/qvariant.h>
#include <QtWidgets/qabstractspinbox.h>
@@ -102,6 +103,9 @@ public:
QDate date() const;
QTime time() const;
+ QCalendar calendar() const;
+ void setCalendar(QCalendar calendar);
+
QDateTime minimumDateTime() const;
void clearMinimumDateTime();
void setMinimumDateTime(const QDateTime &dt);
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index 1ebc98dedf..dcf8863c8b 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -52,6 +52,7 @@
//
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtCore/qcalendar.h>
#include "QtWidgets/qcalendarwidget.h"
#include "QtWidgets/qspinbox.h"
#include "QtWidgets/qtoolbutton.h"
@@ -70,7 +71,6 @@ class Q_AUTOTEST_EXPORT QDateTimeEditPrivate : public QAbstractSpinBoxPrivate, p
Q_DECLARE_PUBLIC(QDateTimeEdit)
public:
QDateTimeEditPrivate();
- ~QDateTimeEditPrivate();
void init(const QVariant &var);
void readLocaleSettings();
@@ -123,7 +123,7 @@ public:
static QDateTimeEdit::Sections convertSections(QDateTimeParser::Sections s);
static QDateTimeEdit::Section convertToPublic(QDateTimeParser::Section s);
- void initCalendarPopup(QCalendarWidget *cw = 0);
+ void initCalendarPopup(QCalendarWidget *cw = nullptr);
void positionCalendarPopup();
QDateTimeEdit::Sections sections;
@@ -145,21 +145,22 @@ class QCalendarPopup : public QWidget
{
Q_OBJECT
public:
- explicit QCalendarPopup(QWidget *parent = 0, QCalendarWidget *cw = 0);
+ explicit QCalendarPopup(QWidget *parent = nullptr, QCalendarWidget *cw = nullptr,
+ QCalendar ca = QCalendar());
QDate selectedDate() { return verifyCalendarInstance()->selectedDate(); }
- void setDate(const QDate &date);
- void setDateRange(const QDate &min, const QDate &max);
+ void setDate(QDate date);
+ void setDateRange(QDate min, QDate max);
void setFirstDayOfWeek(Qt::DayOfWeek dow) { verifyCalendarInstance()->setFirstDayOfWeek(dow); }
QCalendarWidget *calendarWidget() const { return const_cast<QCalendarPopup*>(this)->verifyCalendarInstance(); }
void setCalendarWidget(QCalendarWidget *cw);
Q_SIGNALS:
- void activated(const QDate &date);
- void newDateSelected(const QDate &newDate);
- void hidingCalendar(const QDate &oldDate);
+ void activated(QDate date);
+ void newDateSelected(QDate newDate);
+ void hidingCalendar(QDate oldDate);
void resetButton();
private Q_SLOTS:
- void dateSelected(const QDate &date);
+ void dateSelected(QDate date);
void dateSelectionChanged();
protected:
@@ -174,6 +175,7 @@ private:
QPointer<QCalendarWidget> calendar;
QDate oldDate;
bool dateChanged;
+ QCalendar calendarSystem;
};
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp
index 26b86f80be..28f6cdc7bd 100644
--- a/src/widgets/widgets/qdialogbuttonbox.cpp
+++ b/src/widgets/widgets/qdialogbuttonbox.cpp
@@ -387,12 +387,25 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
icon = QStyle::SP_DialogNoButton;
break;
case QDialogButtonBox::YesToAll:
+ icon = QStyle::SP_DialogYesToAllButton;
+ break;
case QDialogButtonBox::NoToAll:
+ icon = QStyle::SP_DialogNoToAllButton;
+ break;
case QDialogButtonBox::SaveAll:
+ icon = QStyle::SP_DialogSaveAllButton;
+ break;
case QDialogButtonBox::Abort:
+ icon = QStyle::SP_DialogAbortButton;
+ break;
case QDialogButtonBox::Retry:
+ icon = QStyle::SP_DialogRetryButton;
+ break;
case QDialogButtonBox::Ignore:
+ icon = QStyle::SP_DialogIgnoreButton;
+ break;
case QDialogButtonBox::RestoreDefaults:
+ icon = QStyle::SP_RestoreDefaultsButton;
break;
case QDialogButtonBox::NoButton:
return 0;
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index 54504d124b..5900326087 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -138,11 +138,8 @@ bool QDockAreaLayoutItem::skip() const
QSize QDockAreaLayoutItem::minimumSize() const
{
- if (widgetItem != 0) {
- int left, top, right, bottom;
- widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);
- return widgetItem->minimumSize() + QSize(left+right, top+bottom);
- }
+ if (widgetItem)
+ return widgetItem->minimumSize().grownBy(widgetItem->widget()->contentsMargins());
if (subinfo != 0)
return subinfo->minimumSize();
return QSize(0, 0);
@@ -150,11 +147,8 @@ QSize QDockAreaLayoutItem::minimumSize() const
QSize QDockAreaLayoutItem::maximumSize() const
{
- if (widgetItem != 0) {
- int left, top, right, bottom;
- widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);
- return widgetItem->maximumSize()+ QSize(left+right, top+bottom);
- }
+ if (widgetItem)
+ return widgetItem->maximumSize().grownBy(widgetItem->widget()->contentsMargins());
if (subinfo != 0)
return subinfo->maximumSize();
return QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
@@ -180,11 +174,8 @@ QSize QDockAreaLayoutItem::sizeHint() const
{
if (placeHolderItem != 0)
return QSize(0, 0);
- if (widgetItem != 0) {
- int left, top, right, bottom;
- widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);
- return widgetItem->sizeHint() + QSize(left+right, top+bottom);
- }
+ if (widgetItem)
+ return widgetItem->sizeHint().grownBy(widgetItem->widget()->contentsMargins());
if (subinfo != 0)
return subinfo->sizeHint();
return QSize(-1, -1);
@@ -1678,12 +1669,9 @@ int QDockAreaLayoutInfo::prev(int index) const
return -1;
}
+#if QT_CONFIG(tabbar)
void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem)
{
-#if !QT_CONFIG(tabbar)
- Q_UNUSED(index);
- Q_UNUSED(dockWidgetItem);
-#else
if (tabbed) {
item_list.append(QDockAreaLayoutItem(dockWidgetItem));
updateTabBar();
@@ -1699,8 +1687,8 @@ void QDockAreaLayoutInfo::tab(int index, QLayoutItem *dockWidgetItem)
new_info->updateTabBar();
new_info->setCurrentTab(dockWidgetItem->widget());
}
-#endif // QT_CONFIG(tabbar)
}
+#endif // QT_CONFIG(tabbar)
void QDockAreaLayoutInfo::split(int index, Qt::Orientation orientation,
QLayoutItem *dockWidgetItem)
@@ -1937,11 +1925,6 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
QDockAreaLayoutItem item(new QDockWidgetItem(widget));
if (flags & StateFlagFloating) {
bool drawer = false;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC // drawer support
- extern bool qt_mac_is_macdrawer(const QWidget *); //qwidget_mac.cpp
- extern bool qt_mac_set_drawer_preferred_edge(QWidget *, Qt::DockWidgetArea); //qwidget_mac.cpp
- drawer = qt_mac_is_macdrawer(widget);
-#endif
if (!testing) {
widget->hide();
@@ -1952,13 +1935,6 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
int x, y, w, h;
stream >> x >> y >> w >> h;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC // drawer support
- if (drawer) {
- mainWindow->window()->createWinId();
- widget->window()->createWinId();
- qt_mac_set_drawer_preferred_edge(widget, toDockWidgetArea(dockPos));
- } else
-#endif
if (!testing)
widget->setGeometry(QDockAreaLayout::constrainedRect(QRect(x, y, w, h), widget));
@@ -2052,9 +2028,8 @@ void QDockAreaLayoutInfo::updateSeparatorWidgets() const
}
j++;
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
sepWidget->raise();
-#endif
+
QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2);
sepWidget->setGeometry(sepRect);
sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft())));
@@ -3093,10 +3068,6 @@ bool QDockAreaLayout::restoreDockWidget(QDockWidget *dockWidget)
dockWidget->d_func()->setWindowState(true, true, r);
}
dockWidget->setVisible(!placeHolder->hidden);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (placeHolder->window) // gets rid of the X11BypassWindowManager window flag
- dockWidget->d_func()->setWindowState(true);
-#endif
item->placeHolderItem = 0;
delete placeHolder;
@@ -3137,6 +3108,7 @@ void QDockAreaLayout::addDockWidget(QInternal::DockPosition pos, QDockWidget *do
removePlaceHolder(dockWidget->objectName());
}
+#if QT_CONFIG(tabbar)
void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
{
const QList<int> path = indexOf(first);
@@ -3149,6 +3121,7 @@ void QDockAreaLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
removePlaceHolder(second->objectName());
}
+#endif // QT_CONFIG(tabbar)
void QDockAreaLayout::resizeDocks(const QList<QDockWidget *> &docks,
const QList<int> &sizes, Qt::Orientation o)
@@ -3341,9 +3314,8 @@ void QDockAreaLayout::updateSeparatorWidgets() const
}
j++;
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
sepWidget->raise();
-#endif
+
QRect sepRect = separatorRect(i).adjusted(-2, -2, 2, 2);
sepWidget->setGeometry(sepRect);
sepWidget->setMask( QRegion(separatorRect(i).translated( - sepRect.topLeft())));
diff --git a/src/widgets/widgets/qdockarealayout_p.h b/src/widgets/widgets/qdockarealayout_p.h
index 49bd157179..81384bd1b7 100644
--- a/src/widgets/widgets/qdockarealayout_p.h
+++ b/src/widgets/widgets/qdockarealayout_p.h
@@ -89,7 +89,7 @@ struct QDockAreaLayoutItem
{
enum ItemFlags { NoFlags = 0, GapItem = 1, KeepSize = 2 };
- explicit QDockAreaLayoutItem(QLayoutItem *_widgetItem = 0);
+ explicit QDockAreaLayoutItem(QLayoutItem *_widgetItem = nullptr);
explicit QDockAreaLayoutItem(QDockAreaLayoutInfo *_subinfo);
explicit QDockAreaLayoutItem(QPlaceHolderItem *_placeHolderItem);
QDockAreaLayoutItem(const QDockAreaLayoutItem &other);
@@ -144,7 +144,9 @@ public:
void remove(const QList<int> &path);
void unnest(int index);
void split(int index, Qt::Orientation orientation, QLayoutItem *dockWidgetItem);
+#if QT_CONFIG(tabbar)
void tab(int index, QLayoutItem *dockWidgetItem);
+#endif
QDockAreaLayoutItem &item(const QList<int> &path);
QDockAreaLayoutInfo *info(const QList<int> &path);
QDockAreaLayoutInfo *info(QWidget *widget);
@@ -275,7 +277,9 @@ public:
bool restoreDockWidget(QDockWidget *dockWidget);
void splitDockWidget(QDockWidget *after, QDockWidget *dockWidget,
Qt::Orientation orientation);
+#if QT_CONFIG(tabbar)
void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
+#endif
void resizeDocks(const QList<QDockWidget *> &docks, const QList<int> &sizes, Qt::Orientation o);
void apply(bool animate);
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 4041c730b8..05ec3aface 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -267,9 +267,11 @@ QDockWidgetLayout::~QDockWidgetLayout()
bool QDockWidgetLayout::nativeWindowDeco() const
{
bool floating = parentWidget()->isWindow();
+#if QT_CONFIG(tabbar)
if (auto groupWindow =
qobject_cast<const QDockWidgetGroupWindow *>(parentWidget()->parentWidget()))
floating = floating || groupWindow->tabLayoutInfo();
+#endif
return nativeWindowDeco(floating);
}
@@ -379,11 +381,10 @@ QSize QDockWidgetLayout::sizeFromContent(const QSize &content, bool floating) co
if (content.height() < 0)
result.setHeight(-1);
- int left, top, right, bottom;
- w->getContentsMargins(&left, &top, &right, &bottom);
+ const QMargins margins = w->contentsMargins();
//we need to subtract the contents margin (it will be added by the caller)
- QSize min = w->minimumSize() - QSize(left + right, top + bottom);
- QSize max = w->maximumSize() - QSize(left + right, top + bottom);
+ QSize min = w->minimumSize().shrunkBy(margins);
+ QSize max = w->maximumSize().shrunkBy(margins);
/* A floating dockwidget will automatically get its minimumSize set to the layout's
minimum size + deco. We're *not* interested in this, we only take minimumSize()
@@ -975,11 +976,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
&& (event->pos() - state->pressPos).manhattanLength()
> QApplication::startDragDistance()) {
startDrag();
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- grabMouseWhileInWindow();
-#else
q->grabMouse();
-#endif
ret = true;
}
}
@@ -1027,13 +1024,6 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event)
QWidget *tl = q->topLevelWidget();
QRect geo = tl->geometry();
QRect titleRect = tl->frameGeometry();
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if ((features & QDockWidget::DockWidgetVerticalTitleBar)) {
- titleRect.setTop(geo.top());
- titleRect.setBottom(geo.bottom());
- titleRect.setRight(geo.left() - 1);
- } else
-#endif
{
titleRect.setLeft(geo.left());
titleRect.setRight(geo.right());
@@ -1182,6 +1172,8 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);
if (mwlayout)
emit q->dockLocationChanged(mwlayout->dockWidgetArea(q));
+ } else {
+ emit q->dockLocationChanged(Qt::NoDockWidgetArea);
}
}
@@ -1533,10 +1525,10 @@ bool QDockWidget::event(QEvent *event)
d->toggleViewAction->setChecked(true);
QPoint parentTopLeft(0, 0);
if (isWindow()) {
- if (const QWindow *window = windowHandle())
- parentTopLeft = window->screen()->availableVirtualGeometry().topLeft();
- else
- parentTopLeft = QGuiApplication::primaryScreen()->availableVirtualGeometry().topLeft();
+ const QScreen *screen = d->associatedScreen();
+ parentTopLeft = screen
+ ? screen->availableVirtualGeometry().topLeft()
+ : QGuiApplication::primaryScreen()->availableVirtualGeometry().topLeft();
}
emit visibilityChanged(geometry().right() >= parentTopLeft.x() && geometry().bottom() >= parentTopLeft.y());
}
@@ -1554,8 +1546,10 @@ bool QDockWidget::event(QEvent *event)
const QObjectList &siblings = win->children();
onTop = siblings.count() > 0 && siblings.last() == (QObject*)this;
}
+#if QT_CONFIG(tabbar)
if (!isFloating() && layout != 0 && onTop)
layout->raise(this);
+#endif
break;
}
case QEvent::WindowActivate:
@@ -1582,17 +1576,6 @@ bool QDockWidget::event(QEvent *event)
if (d->mouseMoveEvent(static_cast<QMouseEvent *>(event)))
return true;
break;
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- case QEvent::Leave:
- if (d->state != 0 && d->state->dragging && !d->state->nca) {
- // This is a workaround for loosing the mouse on Vista.
- QPoint pos = QCursor::pos();
- QMouseEvent fake(QEvent::MouseMove, mapFromGlobal(pos), pos, Qt::NoButton,
- QApplication::mouseButtons(), QApplication::keyboardModifiers());
- d->mouseMoveEvent(&fake);
- }
- break;
-#endif
case QEvent::MouseButtonRelease:
if (d->mouseReleaseEvent(static_cast<QMouseEvent *>(event)))
return true;
diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h
index e224ba7143..bc6ac86c45 100644
--- a/src/widgets/widgets/qdockwidget_p.h
+++ b/src/widgets/widgets/qdockwidget_p.h
@@ -138,7 +138,7 @@ class Q_WIDGETS_EXPORT QDockWidgetLayout : public QLayout
{
Q_OBJECT
public:
- QDockWidgetLayout(QWidget *parent = 0);
+ QDockWidgetLayout(QWidget *parent = nullptr);
~QDockWidgetLayout();
void addItem(QLayoutItem *item) override;
QLayoutItem *itemAt(int index) const override;
@@ -196,15 +196,15 @@ inline QLayoutItem *QDockWidgetItem::dockWidgetChildItem() const
{
if (QDockWidgetLayout *layout = dockWidgetLayout())
return layout->itemForRole(QDockWidgetLayout::Content);
- return 0;
+ return nullptr;
}
inline QDockWidgetLayout *QDockWidgetItem::dockWidgetLayout() const
{
QWidget *w = const_cast<QDockWidgetItem*>(this)->widget();
- if (w != 0)
+ if (w != nullptr)
return qobject_cast<QDockWidgetLayout*>(w->layout());
- return 0;
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp
index bcc8d7815d..7069ef0368 100644
--- a/src/widgets/widgets/qeffects.cpp
+++ b/src/widgets/widgets/qeffects.cpp
@@ -99,7 +99,7 @@ static QAlphaWidget* q_blend = 0;
Constructs a QAlphaWidget.
*/
QT_WARNING_PUSH
-QT_WARNING_DISABLE_DEPRECATED // QDesktopWidget::screen()
+QT_WARNING_DISABLE_DEPRECATED // ### Qt 6: Find a replacement for QDesktopWidget::screen()
QAlphaWidget::QAlphaWidget(QWidget* w, Qt::WindowFlags f)
: QWidget(QApplication::desktop()->screen(QDesktopWidgetPrivate::screenNumber(w)), f)
{
@@ -569,8 +569,8 @@ void qScrollEffect(QWidget* w, QEffects::DirFlags orient, int time)
if (!w)
return;
- QApplication::sendPostedEvents(w, QEvent::Move);
- QApplication::sendPostedEvents(w, QEvent::Resize);
+ QCoreApplication::sendPostedEvents(w, QEvent::Move);
+ QCoreApplication::sendPostedEvents(w, QEvent::Resize);
Qt::WindowFlags flags = Qt::ToolTip;
// those can be popups - they would steal the focus, but are disabled
@@ -591,8 +591,8 @@ void qFadeEffect(QWidget* w, int time)
if (!w)
return;
- QApplication::sendPostedEvents(w, QEvent::Move);
- QApplication::sendPostedEvents(w, QEvent::Resize);
+ QCoreApplication::sendPostedEvents(w, QEvent::Move);
+ QCoreApplication::sendPostedEvents(w, QEvent::Resize);
Qt::WindowFlags flags = Qt::ToolTip;
diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp
index 69eac1ebf7..eec794562a 100644
--- a/src/widgets/widgets/qgroupbox.cpp
+++ b/src/widgets/widgets/qgroupbox.cpp
@@ -389,9 +389,13 @@ bool QGroupBox::event(QEvent *e)
void QGroupBox::childEvent(QChildEvent *c)
{
Q_D(QGroupBox);
- if (c->type() != QEvent::ChildAdded || !c->child()->isWidgetType())
+ /*
+ Children might have been enabled after being added to the group box, in which case
+ the childEvent handler ran too early, and we need to disabled children again.
+ */
+ if (!(c->added() || c->polished()) || !c->child()->isWidgetType())
return;
- QWidget *w = (QWidget*)c->child();
+ QWidget *w = static_cast<QWidget*>(c->child());
if (w->isWindow())
return;
if (d->checkable) {
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index a5c0c41ee0..fb67936768 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -84,7 +84,7 @@
#include "qkeysequence.h"
#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowIconsInMenus) \
&& QGuiApplication::styleHints()->showShortcutsInContextMenus()) \
- && !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
+ && !QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(k) ? \
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
#else
#define ACCEL_KEY(k) QString()
@@ -315,7 +315,7 @@ QString QLineEdit::text() const
void QLineEdit::setText(const QString& text)
{
Q_D(QLineEdit);
- d->control->setText(text);
+ d->setText(text);
}
/*!
@@ -684,11 +684,12 @@ QSize QLineEdit::sizeHint() const
ensurePolished();
QFontMetrics fm(font());
const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this);
- int h = qMax(fm.height(), qMax(14, iconSize - 2)) + 2*d->verticalMargin
- + d->topTextMargin + d->bottomTextMargin
+ const QMargins tm = d->effectiveTextMargins();
+ int h = qMax(fm.height(), qMax(14, iconSize - 2)) + 2 * QLineEditPrivate::verticalMargin
+ + tm.top() + tm.bottom()
+ d->topmargin + d->bottommargin;
- int w = fm.horizontalAdvance(QLatin1Char('x')) * 17 + 2*d->horizontalMargin
- + d->effectiveLeftTextMargin() + d->effectiveRightTextMargin()
+ int w = fm.horizontalAdvance(QLatin1Char('x')) * 17 + 2 * QLineEditPrivate::horizontalMargin
+ + tm.left() + tm.right()
+ d->leftmargin + d->rightmargin; // "some"
QStyleOptionFrame opt;
initStyleOption(&opt);
@@ -708,11 +709,12 @@ QSize QLineEdit::minimumSizeHint() const
Q_D(const QLineEdit);
ensurePolished();
QFontMetrics fm = fontMetrics();
- int h = fm.height() + qMax(2*d->verticalMargin, fm.leading())
- + d->topTextMargin + d->bottomTextMargin
+ const QMargins tm = d->effectiveTextMargins();
+ int h = fm.height() + qMax(2 * QLineEditPrivate::verticalMargin, fm.leading())
+ + tm.top() + tm.bottom()
+ d->topmargin + d->bottommargin;
int w = fm.maxWidth()
- + d->effectiveLeftTextMargin() + d->effectiveRightTextMargin()
+ + tm.left() + tm.right()
+ d->leftmargin + d->rightmargin;
QStyleOptionFrame opt;
initStyleOption(&opt);
@@ -1127,17 +1129,11 @@ bool QLineEdit::hasAcceptableInput() const
sizes \a left, \a top, \a right, and \a bottom.
\since 4.5
- See also getTextMargins().
+ See also textMargins().
*/
void QLineEdit::setTextMargins(int left, int top, int right, int bottom)
{
- Q_D(QLineEdit);
- d->leftTextMargin = left;
- d->topTextMargin = top;
- d->rightTextMargin = right;
- d->bottomTextMargin = bottom;
- updateGeometry();
- update();
+ setTextMargins({left, top, right, bottom});
}
/*!
@@ -1148,10 +1144,17 @@ void QLineEdit::setTextMargins(int left, int top, int right, int bottom)
*/
void QLineEdit::setTextMargins(const QMargins &margins)
{
- setTextMargins(margins.left(), margins.top(), margins.right(), margins.bottom());
+ Q_D(QLineEdit);
+ d->textMargins = margins;
+ updateGeometry();
+ update();
}
+#if QT_DEPRECATED_SINCE(5, 14)
/*!
+ \obsolete
+ Use textMargins()
+
Returns the widget's text margins for \a left, \a top, \a right, and \a bottom.
\since 4.5
@@ -1159,16 +1162,17 @@ void QLineEdit::setTextMargins(const QMargins &margins)
*/
void QLineEdit::getTextMargins(int *left, int *top, int *right, int *bottom) const
{
- Q_D(const QLineEdit);
+ QMargins m = textMargins();
if (left)
- *left = d->leftTextMargin;
+ *left = m.left();
if (top)
- *top = d->topTextMargin;
+ *top = m.top();
if (right)
- *right = d->rightTextMargin;
+ *right = m.right();
if (bottom)
- *bottom = d->bottomTextMargin;
+ *bottom = m.bottom();
}
+#endif
/*!
\since 4.6
@@ -1179,7 +1183,7 @@ void QLineEdit::getTextMargins(int *left, int *top, int *right, int *bottom) con
QMargins QLineEdit::textMargins() const
{
Q_D(const QLineEdit);
- return QMargins(d->leftTextMargin, d->topTextMargin, d->rightTextMargin, d->bottomTextMargin);
+ return d->textMargins;
}
/*!
@@ -1481,7 +1485,7 @@ bool QLineEdit::event(QEvent * e)
d->initMouseYThreshold();
}
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (e->type() == QEvent::EnterEditFocus) {
end(false);
d->setCursorVisible(true);
@@ -1489,8 +1493,11 @@ bool QLineEdit::event(QEvent * e)
} else if (e->type() == QEvent::LeaveEditFocus) {
d->setCursorVisible(false);
d->control->setCursorBlinkEnabled(false);
- if (d->control->hasAcceptableInput() || d->control->fixup())
+ if (d->edited && (d->control->hasAcceptableInput()
+ || d->control->fixup())) {
emit editingFinished();
+ d->edited = false;
+ }
}
}
#endif
@@ -1510,7 +1517,7 @@ void QLineEdit::mousePressEvent(QMouseEvent* e)
if (e->button() == Qt::RightButton)
return;
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplication::QApplicationPrivate() && !hasEditFocus()) {
setEditFocus(true);
// Get the completion list to pop up.
if (d->control->completer())
@@ -1603,7 +1610,7 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e)
}
#endif
#ifndef QT_NO_CLIPBOARD
- if (QApplication::clipboard()->supportsSelection()) {
+ if (QGuiApplication::clipboard()->supportsSelection()) {
if (e->button() == Qt::LeftButton) {
d->control->copy(QClipboard::Selection);
} else if (!d->control->isReadOnly() && e->button() == Qt::MidButton) {
@@ -1719,7 +1726,7 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
bool select = false;
switch (event->key()) {
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (hasEditFocus()) {
setEditFocus(false);
if (d->control->completer() && d->control->completer()->popup()->isVisible())
@@ -1730,13 +1737,13 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
break;
case Qt::Key_Back:
case Qt::Key_No:
- if (!QApplication::keypadNavigationEnabled() || !hasEditFocus()) {
+ if (!QApplicationPrivate::keypadNavigationEnabled() || !hasEditFocus()) {
event->ignore();
return;
}
break;
default:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus() && !(event->modifiers() & Qt::ControlModifier)) {
if (!event->text().isEmpty() && event->text().at(0).isPrint()
&& !isReadOnly())
@@ -1751,7 +1758,7 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
- if (QApplication::keypadNavigationEnabled() && !select && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !select && !hasEditFocus()) {
setEditFocus(true);
if (event->key() == Qt::Key_Select)
return; // Just start. No action.
@@ -1798,7 +1805,7 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e)
// Focus in if currently in navigation focus on the widget
// Only focus in on preedits, to allow input methods to
// commit text as they focus out without interfering with focus
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& hasFocus() && !hasEditFocus()
&& !e->preeditString().isEmpty())
setEditFocus(true);
@@ -1871,7 +1878,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
d->clickCausedFocus = 1;
}
#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) {
+ if (!QApplicationPrivate::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) {
#endif
d->control->setBlinkingCursorEnabled(true);
QStyleOptionFrame opt;
@@ -1897,7 +1904,6 @@ void QLineEdit::focusInEvent(QFocusEvent *e)
/*!\reimp
*/
-
void QLineEdit::focusOutEvent(QFocusEvent *e)
{
Q_D(QLineEdit);
@@ -1916,12 +1922,14 @@ void QLineEdit::focusOutEvent(QFocusEvent *e)
d->control->setBlinkingCursorEnabled(false);
#ifdef QT_KEYPAD_NAVIGATION
// editingFinished() is already emitted on LeaveEditFocus
- if (!QApplication::keypadNavigationEnabled())
+ if (!QApplicationPrivate::keypadNavigationEnabled())
#endif
if (reason != Qt::PopupFocusReason
|| !(QApplication::activePopupWidget() && QApplication::activePopupWidget()->parentWidget() == this)) {
- if (hasAcceptableInput() || d->control->fixup())
+ if (d->edited && (hasAcceptableInput() || d->control->fixup())) {
emit editingFinished();
+ d->edited = false;
+ }
}
#ifdef QT_KEYPAD_NAVIGATION
d->control->setCancelText(QString());
@@ -1946,27 +1954,25 @@ void QLineEdit::paintEvent(QPaintEvent *)
initStyleOption(&panel);
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
QRect r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
- r.setX(r.x() + d->effectiveLeftTextMargin());
- r.setY(r.y() + d->topTextMargin);
- r.setRight(r.right() - d->effectiveRightTextMargin());
- r.setBottom(r.bottom() - d->bottomTextMargin);
+ r = r.marginsRemoved(d->effectiveTextMargins());
p.setClipRect(r);
QFontMetrics fm = fontMetrics();
Qt::Alignment va = QStyle::visualAlignment(d->control->layoutDirection(), QFlag(d->alignment));
switch (va & Qt::AlignVertical_Mask) {
case Qt::AlignBottom:
- d->vscroll = r.y() + r.height() - fm.height() - d->verticalMargin;
+ d->vscroll = r.y() + r.height() - fm.height() - QLineEditPrivate::verticalMargin;
break;
case Qt::AlignTop:
- d->vscroll = r.y() + d->verticalMargin;
+ d->vscroll = r.y() + QLineEditPrivate::verticalMargin;
break;
default:
//center
d->vscroll = r.y() + (r.height() - fm.height() + 1) / 2;
break;
}
- QRect lineRect(r.x() + d->horizontalMargin, d->vscroll, r.width() - 2*d->horizontalMargin, fm.height());
+ QRect lineRect(r.x() + QLineEditPrivate::horizontalMargin, d->vscroll,
+ r.width() - 2 * QLineEditPrivate::horizontalMargin, fm.height());
if (d->shouldShowPlaceholderText()) {
if (!d->placeholderText.isEmpty()) {
@@ -2036,7 +2042,7 @@ void QLineEdit::paintEvent(QPaintEvent *)
int flags = QWidgetLineControl::DrawText;
#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled() || hasEditFocus())
+ if (!QApplicationPrivate::keypadNavigationEnabled() || hasEditFocus())
#endif
if (d->control->hasSelectedText() || (d->cursorVisible && !d->control->inputMask().isEmpty() && !d->control->isReadOnly())){
flags |= QWidgetLineControl::DrawSelections;
@@ -2202,7 +2208,7 @@ QMenu *QLineEdit::createStandardContextMenu()
if (!isReadOnly()) {
action = popup->addAction(QLineEdit::tr("&Paste") + ACCEL_KEY(QKeySequence::Paste));
- action->setEnabled(!d->control->isReadOnly() && !QApplication::clipboard()->text().isEmpty());
+ action->setEnabled(!d->control->isReadOnly() && !QGuiApplication::clipboard()->text().isEmpty());
setActionIcon(action, QStringLiteral("edit-paste"));
connect(action, SIGNAL(triggered()), SLOT(paste()));
}
@@ -2220,6 +2226,7 @@ QMenu *QLineEdit::createStandardContextMenu()
action = popup->addAction(QLineEdit::tr("Select All") + ACCEL_KEY(QKeySequence::SelectAll));
action->setEnabled(!d->control->text().isEmpty() && !d->control->allSelected());
+ setActionIcon(action, QStringLiteral("edit-select-all"));
d->selectAllAction = action;
connect(action, SIGNAL(triggered()), SLOT(selectAll()));
diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h
index de82927f74..1cf1f24449 100644
--- a/src/widgets/widgets/qlineedit.h
+++ b/src/widgets/widgets/qlineedit.h
@@ -172,7 +172,10 @@ public:
void setTextMargins(int left, int top, int right, int bottom);
void setTextMargins(const QMargins &margins);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("use textMargins()")
void getTextMargins(int *left, int *top, int *right, int *bottom) const;
+#endif
QMargins textMargins() const;
#if QT_CONFIG(action)
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index 2a5a0c34dc..d2b5f87906 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -127,6 +127,7 @@ void QLineEditPrivate::_q_handleWindowActivate()
void QLineEditPrivate::_q_textEdited(const QString &text)
{
Q_Q(QLineEdit);
+ edited = true;
emit q->textEdited(text);
#if QT_CONFIG(completer)
if (control->completer()
@@ -253,10 +254,7 @@ QRect QLineEditPrivate::adjustedContentsRect() const
QStyleOptionFrame opt;
q->initStyleOption(&opt);
QRect r = q->style()->subElementRect(QStyle::SE_LineEditContents, &opt, q);
- r.setX(r.x() + effectiveLeftTextMargin());
- r.setY(r.y() + topTextMargin);
- r.setRight(r.right() - effectiveRightTextMargin());
- r.setBottom(r.bottom() - bottomTextMargin);
+ r = r.marginsRemoved(effectiveTextMargins());
return r;
}
@@ -272,6 +270,12 @@ void QLineEditPrivate::setCursorVisible(bool visible)
q->update();
}
+void QLineEditPrivate::setText(const QString& text)
+{
+ edited = true;
+ control->setText(text);
+}
+
void QLineEditPrivate::updatePasswordEchoEditing(bool editing)
{
Q_Q(QLineEdit);
@@ -348,9 +352,7 @@ QLineEditPrivate *QLineEditIconButton::lineEditPrivate() const
void QLineEditIconButton::paintEvent(QPaintEvent *)
{
QPainter painter(this);
- QWindow *window = nullptr;
- if (const QWidget *nativeParent = nativeParentWidget())
- window = nativeParent->windowHandle();
+ QWindow *window = qt_widget_private(this)->windowHandle(QWidgetPrivate::WindowHandleMode::Closest);
QIcon::Mode state = QIcon::Disabled;
if (isEnabled())
state = isDown() ? QIcon::Active : QIcon::Normal;
@@ -667,14 +669,12 @@ static int effectiveTextMargin(int defaultMargin, const QLineEditPrivate::SideWi
return e.widget->isVisibleTo(e.widget->parentWidget()); }));
}
-int QLineEditPrivate::effectiveLeftTextMargin() const
-{
- return effectiveTextMargin(leftTextMargin, leftSideWidgetList(), sideWidgetParameters());
-}
-
-int QLineEditPrivate::effectiveRightTextMargin() const
+QMargins QLineEditPrivate::effectiveTextMargins() const
{
- return effectiveTextMargin(rightTextMargin, rightSideWidgetList(), sideWidgetParameters());
+ return {effectiveTextMargin(textMargins.left(), leftSideWidgetList(), sideWidgetParameters()),
+ textMargins.top(),
+ effectiveTextMargin(textMargins.right(), rightSideWidgetList(), sideWidgetParameters()),
+ textMargins.bottom()};
}
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 12a2f1ddfd..a11fea6bbe 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -67,6 +67,7 @@
#endif
#include "QtCore/qpointer.h"
#include "QtCore/qmimedata.h"
+#include <QtCore/qmargins.h>
#include "private/qwidgetlinecontrol_p.h"
@@ -85,7 +86,7 @@ class Q_AUTOTEST_EXPORT QLineEditIconButton : public QToolButton
Q_OBJECT
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
public:
- explicit QLineEditIconButton(QWidget *parent = 0);
+ explicit QLineEditIconButton(QWidget *parent = nullptr);
qreal opacity() const { return m_opacity; }
void setOpacity(qreal value);
@@ -134,7 +135,7 @@ public:
};
struct SideWidgetEntry {
- explicit SideWidgetEntry(QWidget *w = 0, QAction *a = 0, int _flags = 0) : widget(w), action(a), flags(_flags) {}
+ explicit SideWidgetEntry(QWidget *w = nullptr, QAction *a = nullptr, int _flags = 0) : widget(w), action(a), flags(_flags) {}
QWidget *widget;
QAction *action;
@@ -151,9 +152,9 @@ public:
QLineEditPrivate()
: control(0), frame(1), contextMenuEnabled(1), cursorVisible(0),
- dragEnabled(0), clickCausedFocus(0), hscroll(0), vscroll(0),
+ dragEnabled(0), clickCausedFocus(0), edited(0), hscroll(0), vscroll(0),
alignment(Qt::AlignLeading | Qt::AlignVCenter),
- leftTextMargin(0), topTextMargin(0), rightTextMargin(0), bottomTextMargin(0),
+ textMargins{0, 0, 0, 0},
lastTextSize(0), mouseYThreshold(0)
{
}
@@ -176,6 +177,7 @@ public:
bool inSelection(int x) const;
QRect cursorRect() const;
void setCursorVisible(bool visible);
+ void setText(const QString& text);
void updatePasswordEchoEditing(bool);
@@ -202,6 +204,7 @@ public:
uint cursorVisible : 1;
uint dragEnabled : 1;
uint clickCausedFocus : 1;
+ uint edited : 1;
int hscroll;
int vscroll;
uint alignment;
@@ -231,10 +234,7 @@ public:
void _q_textChanged(const QString &);
void _q_clearButtonClicked();
- int leftTextMargin; // use effectiveLeftTextMargin() in case of icon.
- int topTextMargin;
- int rightTextMargin; // use effectiveRightTextMargin() in case of icon.
- int bottomTextMargin;
+ QMargins textMargins; // use effectiveTextMargins() in case of icon.
QString placeholderText;
@@ -250,8 +250,7 @@ public:
inline const SideWidgetEntryList &rightSideWidgetList() const
{ return q_func()->layoutDirection() == Qt::LeftToRight ? trailingSideWidgets : leadingSideWidgets; }
- int effectiveLeftTextMargin() const;
- int effectiveRightTextMargin() const;
+ QMargins effectiveTextMargins() const;
private:
struct SideWidgetLocation {
diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
index 0b64b2a2bb..88baf0410b 100644
--- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
+++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm
@@ -82,8 +82,32 @@
The following is a snippet showing how to subclass QMacCocoaViewContainer
to wrap an NSSearchField.
- \snippet macmainwindow.mm 0
+ \code
+ SearchWidget::SearchWidget(QWidget *parent)
+ : QMacCocoaViewContainer(0, parent)
+ {
+ // Many Cocoa objects create temporary autorelease objects,
+ // so create a pool to catch them.
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ // Create the NSSearchField, set it on the QCocoaViewContainer.
+ NSSearchField *search = [[NSSearchField alloc] init];
+ setCocoaView(search);
+
+ // Use a Qt menu for the search field menu.
+ QMenu *qtMenu = createMenu(this);
+ NSMenu *nsMenu = qtMenu->macMenu(0);
+ [[search cell] setSearchMenuTemplate:nsMenu];
+
+ // Release our reference, since our super class takes ownership and we
+ // don't need it anymore.
+ [search release];
+
+ // Clean up our pool as we no longer need it.
+ [pool release];
+ }
+ \endcode
*/
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 9c4c46f2d6..16ed699137 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -1138,6 +1138,7 @@ void QMainWindow::splitDockWidget(QDockWidget *after, QDockWidget *dockwidget,
d_func()->layout->splitDockWidget(after, dockwidget, orientation);
}
+#if QT_CONFIG(tabbar)
/*!
\fn void QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
@@ -1164,9 +1165,6 @@ void QMainWindow::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
QList<QDockWidget*> QMainWindow::tabifiedDockWidgets(QDockWidget *dockwidget) const
{
QList<QDockWidget*> ret;
-#if !QT_CONFIG(tabbar)
- Q_UNUSED(dockwidget);
-#else
const QDockAreaLayoutInfo *info = d_func()->layout->layoutState.dockAreaLayout.info(dockwidget);
if (info && info->tabbed && info->tabBar) {
for(int i = 0; i < info->item_list.count(); ++i) {
@@ -1180,9 +1178,9 @@ QList<QDockWidget*> QMainWindow::tabifiedDockWidgets(QDockWidget *dockwidget) co
}
}
}
-#endif
return ret;
}
+#endif // QT_CONFIG(tabbar)
/*!
diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h
index 85e3f87d77..c69451fa3e 100644
--- a/src/widgets/widgets/qmainwindow.h
+++ b/src/widgets/widgets/qmainwindow.h
@@ -171,8 +171,10 @@ public:
Qt::Orientation orientation);
void splitDockWidget(QDockWidget *after, QDockWidget *dockwidget,
Qt::Orientation orientation);
+#if QT_CONFIG(tabbar)
void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
QList<QDockWidget*> tabifiedDockWidgets(QDockWidget *dockwidget) const;
+#endif
void removeDockWidget(QDockWidget *dockwidget);
bool restoreDockWidget(QDockWidget *dockwidget);
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index f54835f23b..0fb3a86cf8 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -292,25 +292,31 @@ bool QDockWidgetGroupWindow::event(QEvent *e)
switch (e->type()) {
case QEvent::Close:
+#if QT_CONFIG(tabbar)
// Forward the close to the QDockWidget just as if its close button was pressed
if (QDockWidget *dw = activeTabbedDockWidget()) {
e->ignore();
dw->close();
adjustFlags();
}
+#endif
return true;
case QEvent::Move:
+#if QT_CONFIG(tabbar)
// Let QDockWidgetPrivate::moseEvent handle the dragging
if (QDockWidget *dw = activeTabbedDockWidget())
static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(dw))->moveEvent(static_cast<QMoveEvent*>(e));
+#endif
return true;
case QEvent::NonClientAreaMouseMove:
case QEvent::NonClientAreaMouseButtonPress:
case QEvent::NonClientAreaMouseButtonRelease:
case QEvent::NonClientAreaMouseButtonDblClick:
+#if QT_CONFIG(tabbar)
// Let the QDockWidgetPrivate of the currently visible dock widget handle the drag and drop
if (QDockWidget *dw = activeTabbedDockWidget())
static_cast<QDockWidgetPrivate *>(QObjectPrivate::get(dw))->nonClientAreaMouseEvent(static_cast<QMouseEvent*>(e));
+#endif
return true;
case QEvent::ChildAdded:
if (qobject_cast<QDockWidget *>(static_cast<QChildEvent*>(e)->child()))
@@ -347,6 +353,7 @@ QDockAreaLayoutInfo *QDockWidgetGroupWindow::layoutInfo() const
return static_cast<QDockWidgetGroupLayout *>(layout())->dockAreaLayoutInfo();
}
+#if QT_CONFIG(tabbar)
/*! \internal
If this is a floating tab bar returns the currently the QDockWidgetGroupWindow that contains
tab, otherwise, return nullptr;
@@ -383,7 +390,6 @@ const QDockAreaLayoutInfo *QDockWidgetGroupWindow::tabLayoutInfo() const
QDockWidget *QDockWidgetGroupWindow::activeTabbedDockWidget() const
{
QDockWidget *dw = nullptr;
-#if QT_CONFIG(tabbar)
const QDockAreaLayoutInfo *info = tabLayoutInfo();
if (!info)
return nullptr;
@@ -405,9 +411,9 @@ QDockWidget *QDockWidgetGroupWindow::activeTabbedDockWidget() const
dw = qobject_cast<QDockWidget *>(item.widgetItem->widget());
}
}
-#endif
return dw;
}
+#endif // QT_CONFIG(tabbar)
/*! \internal
Destroy or hide this window if there is no more QDockWidget in it.
@@ -461,7 +467,11 @@ void QDockWidgetGroupWindow::adjustFlags()
Qt::WindowFlags oldFlags = windowFlags();
Qt::WindowFlags flags = oldFlags;
+#if QT_CONFIG(tabbar)
QDockWidget *top = activeTabbedDockWidget();
+#else
+ QDockWidget *top = nullptr;
+#endif
if (!top) { // nested tabs, show window decoration
flags =
((oldFlags & ~Qt::FramelessWindowHint) | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
@@ -507,6 +517,7 @@ void QDockWidgetGroupWindow::adjustFlags()
bool QDockWidgetGroupWindow::hasNativeDecos() const
{
+#if QT_CONFIG(tabbar)
QDockWidget *dw = activeTabbedDockWidget();
if (!dw) // We have a group of nested QDockWidgets (not just floating tabs)
return true;
@@ -515,6 +526,9 @@ bool QDockWidgetGroupWindow::hasNativeDecos() const
return false;
return dw->titleBarWidget() == nullptr;
+#else
+ return true;
+#endif
}
/*
@@ -531,16 +545,18 @@ bool QDockWidgetGroupWindow::hover(QLayoutItem *widgetItem, const QPoint &mouseP
savedState = *layoutInfo();
QMainWindow::DockOptions opts = static_cast<QMainWindow *>(parentWidget())->dockOptions();
+ QDockAreaLayoutInfo newState = savedState;
bool nestingEnabled =
(opts & QMainWindow::AllowNestedDocks) && !(opts & QMainWindow::ForceTabbedDocks);
QDockAreaLayoutInfo::TabMode tabMode =
+#if !QT_CONFIG(tabbar)
+ QDockAreaLayoutInfo::NoTabs;
+#else
nestingEnabled ? QDockAreaLayoutInfo::AllowTabs : QDockAreaLayoutInfo::ForceTabs;
if (auto group = qobject_cast<QDockWidgetGroupWindow *>(widgetItem->widget())) {
if (!group->tabLayoutInfo())
tabMode = QDockAreaLayoutInfo::NoTabs;
}
-
- QDockAreaLayoutInfo newState = savedState;
if (newState.tabbed) {
// insertion into a top-level tab
newState.item_list = { QDockAreaLayoutItem(new QDockAreaLayoutInfo(newState)) };
@@ -548,6 +564,7 @@ bool QDockWidgetGroupWindow::hover(QLayoutItem *widgetItem, const QPoint &mouseP
newState.tabbed = false;
newState.tabBar = nullptr;
}
+#endif
auto newGapPos = newState.gapIndex(mousePos, nestingEnabled, tabMode);
Q_ASSERT(!newGapPos.isEmpty());
@@ -1498,14 +1515,6 @@ void QMainWindowLayout::addDockWidget(Qt::DockWidgetArea area,
invalidate();
}
-void QMainWindowLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
-{
- addChildWidget(second);
- layoutState.dockAreaLayout.tabifyDockWidget(first, second);
- emit second->dockLocationChanged(dockWidgetArea(first));
- invalidate();
-}
-
bool QMainWindowLayout::restoreDockWidget(QDockWidget *dockwidget)
{
addChildWidget(dockwidget);
@@ -1517,6 +1526,14 @@ bool QMainWindowLayout::restoreDockWidget(QDockWidget *dockwidget)
}
#if QT_CONFIG(tabbar)
+void QMainWindowLayout::tabifyDockWidget(QDockWidget *first, QDockWidget *second)
+{
+ addChildWidget(second);
+ layoutState.dockAreaLayout.tabifyDockWidget(first, second);
+ emit second->dockLocationChanged(dockWidgetArea(first));
+ invalidate();
+}
+
bool QMainWindowLayout::documentMode() const
{
return _documentMode;
@@ -1535,20 +1552,15 @@ void QMainWindowLayout::setDocumentMode(bool enabled)
for (QTabBar *bar : qAsConst(unusedTabBars))
bar->setDocumentMode(_documentMode);
}
-#endif // QT_CONFIG(tabbar)
void QMainWindowLayout::setVerticalTabsEnabled(bool enabled)
{
-#if !QT_CONFIG(tabbar)
- Q_UNUSED(enabled);
-#else
if (verticalTabsEnabled == enabled)
return;
verticalTabsEnabled = enabled;
updateTabBarShapes();
-#endif // QT_CONFIG(tabbar)
}
#if QT_CONFIG(tabwidget)
@@ -1609,7 +1621,6 @@ static inline QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWid
}
#endif // QT_CONFIG(tabwidget)
-#if QT_CONFIG(tabbar)
void QMainWindowLayout::updateTabBarShapes()
{
#if QT_CONFIG(tabwidget)
@@ -1851,19 +1862,17 @@ void QMainWindowLayout::tabMoved(int from, int to)
info->moveTab(from, to);
}
-#endif // QT_CONFIG(tabbar)
void QMainWindowLayout::raise(QDockWidget *widget)
{
-#if QT_CONFIG(tabbar)
QDockAreaLayoutInfo *info = dockInfo(widget);
if (info == 0)
return;
if (!info->tabbed)
return;
info->setCurrentTab(widget);
-#endif
}
+#endif // QT_CONFIG(tabbar)
#endif // QT_CONFIG(dockwidget)
@@ -2329,7 +2338,7 @@ void QMainWindowLayout::setDockOptions(QMainWindow::DockOptions opts)
dockOptions = opts;
-#if QT_CONFIG(dockwidget)
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar)
setVerticalTabsEnabled(opts & QMainWindow::VerticalTabs);
#endif
@@ -2413,7 +2422,7 @@ static bool unplugGroup(QMainWindowLayout *layout, QLayoutItem **item,
*/
QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group)
{
-#if QT_CONFIG(dockwidget) && QT_CONFIG(tabbar)
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
auto *groupWindow = qobject_cast<const QDockWidgetGroupWindow *>(widget->parentWidget());
if (!widget->isWindow() && groupWindow) {
if (group && groupWindow->tabLayoutInfo()) {
@@ -2525,10 +2534,10 @@ void QMainWindowLayout::updateGapIndicator()
#endif // QT_CONFIG(rubberband)
}
+#if QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
static QTabBar::Shape tabwidgetPositionToTabBarShape(QWidget *w)
{
QTabBar::Shape result = QTabBar::RoundedSouth;
-#if QT_CONFIG(tabwidget)
if (qobject_cast<QDockWidget *>(w)) {
switch (static_cast<QDockWidgetPrivate *>(qt_widget_private(w))->tabPosition) {
case QTabWidget::North:
@@ -2545,9 +2554,9 @@ static QTabBar::Shape tabwidgetPositionToTabBarShape(QWidget *w)
break;
}
}
-#endif // tabwidget
return result;
}
+#endif // QT_CONFIG(dockwidget) && QT_CONFIG(tabwidget)
void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
{
@@ -2584,13 +2593,14 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
}
}
for (QWidget *w : candidates) {
- QWindow *handle1 = widget->windowHandle();
- QWindow *handle2 = w->windowHandle();
- if (handle1 && handle2 && handle1->screen() != handle2->screen())
+ const QScreen *screen1 = qt_widget_private(widget)->associatedScreen();
+ const QScreen *screen2 = qt_widget_private(w)->associatedScreen();
+ if (screen1 && screen2 && screen1 != screen2)
continue;
if (!w->geometry().contains(mousePos))
continue;
+#if QT_CONFIG(tabwidget)
if (auto dropTo = qobject_cast<QDockWidget *>(w)) {
// dropping to a normal widget, we mutate it in a QDockWidgetGroupWindow with two
// tabs
@@ -2612,6 +2622,7 @@ void QMainWindowLayout::hover(QLayoutItem *widgetItem, const QPoint &mousePos)
w = floatingTabs;
widget->raise(); // raise, as our newly created drop target is now on top
}
+#endif
Q_ASSERT(qobject_cast<QDockWidgetGroupWindow *>(w));
auto group = static_cast<QDockWidgetGroupWindow *>(w);
if (group->hover(widgetItem, group->mapFromGlobal(mousePos))) {
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index a375d856bb..967b713096 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -122,7 +122,7 @@ template <typename Layout>
QCursor QMainWindowLayoutSeparatorHelper<Layout>::separatorCursor(const QList<int> &path)
{
const QDockAreaLayoutInfo *info = layout()->dockAreaLayoutInfo()->info(path);
- Q_ASSERT(info != 0);
+ Q_ASSERT(info != nullptr);
if (path.size() == 1) { // is this the "top-level" separator which separates a dock area
// from the central widget?
switch (path.first()) {
@@ -334,11 +334,13 @@ class QDockWidgetGroupWindow : public QWidget
{
Q_OBJECT
public:
- explicit QDockWidgetGroupWindow(QWidget* parent = 0, Qt::WindowFlags f = 0)
+ explicit QDockWidgetGroupWindow(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr)
: QWidget(parent, f) {}
QDockAreaLayoutInfo *layoutInfo() const;
+#if QT_CONFIG(tabbar)
const QDockAreaLayoutInfo *tabLayoutInfo() const;
QDockWidget *activeTabbedDockWidget() const;
+#endif
void destroyOrHideIfEmpty();
void adjustFlags();
bool hasNativeDecos() const;
@@ -430,7 +432,7 @@ public:
bool isValid() const;
QLayoutItem *plug(const QList<int> &path);
- QLayoutItem *unplug(const QList<int> &path, QMainWindowLayoutState *savedState = 0);
+ QLayoutItem *unplug(const QList<int> &path, QMainWindowLayoutState *savedState = nullptr);
void saveState(QDataStream &stream) const;
bool checkFormat(QDataStream &stream);
@@ -494,13 +496,13 @@ public:
void splitDockWidget(QDockWidget *after,
QDockWidget *dockwidget,
Qt::Orientation orientation);
- void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
Qt::DockWidgetArea dockWidgetArea(QWidget* widget) const;
+ bool restoreDockWidget(QDockWidget *dockwidget);
+#if QT_CONFIG(tabbar)
+ void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
void raise(QDockWidget *widget);
void setVerticalTabsEnabled(bool enabled);
- bool restoreDockWidget(QDockWidget *dockwidget);
-#if QT_CONFIG(tabbar)
QDockAreaLayoutInfo *dockInfo(QWidget *w);
bool _documentMode;
bool documentMode() const;
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 8b201dcf9d..6e3de1b1ff 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -1988,9 +1988,11 @@ QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFla
Q_ASSERT(child->testAttribute(Qt::WA_DeleteOnClose));
}
+ d->appendChild(child);
+
if (childFocus)
childFocus->setFocus();
- d->appendChild(child);
+
return child;
}
@@ -2491,13 +2493,6 @@ bool QMdiArea::event(QEvent *event)
{
Q_D(QMdiArea);
switch (event->type()) {
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- // QWidgetPrivate::hide_helper activates another sub-window when closing a
- // modal dialog on Windows (see activateWindow() inside the ifdef).
- case QEvent::WindowUnblocked:
- d->activateCurrentWindow();
- break;
-#endif
case QEvent::WindowActivate: {
d->isActivated = true;
if (d->childWindows.isEmpty())
@@ -2523,7 +2518,7 @@ bool QMdiArea::event(QEvent *event)
case QEvent::WindowIconChange:
foreach (QMdiSubWindow *window, d->childWindows) {
if (sanityCheck(window, "QMdiArea::WindowIconChange"))
- QApplication::sendEvent(window, event);
+ QCoreApplication::sendEvent(window, event);
}
break;
case QEvent::Hide:
@@ -2555,11 +2550,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
// Ingore key events without a Ctrl modifier (except for press/release on the modifier itself).
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (!(keyEvent->modifiers() & Qt::MetaModifier) && keyEvent->key() != Qt::Key_Meta)
-#else
if (!(keyEvent->modifiers() & Qt::ControlModifier) && keyEvent->key() != Qt::Key_Control)
-#endif
return QAbstractScrollArea::eventFilter(object, event);
// Find closest mdi area (in case we have a nested workspace).
@@ -2574,11 +2565,7 @@ bool QMdiArea::eventFilter(QObject *object, QEvent *event)
// 3) Ctrl-Shift-Tab (Tab, Tab, ...) -> iterate through all windows in the opposite
// direction (activatePreviousSubWindow())
switch (keyEvent->key()) {
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- case Qt::Key_Meta:
-#else
case Qt::Key_Control:
-#endif
if (keyPress)
area->d_func()->startTabToPreviousTimer();
else
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h
index fd00118ec6..0a6368044a 100644
--- a/src/widgets/widgets/qmdiarea_p.h
+++ b/src/widgets/widgets/qmdiarea_p.h
@@ -183,7 +183,7 @@ public:
int tabToPreviousTimerId;
// Slots.
- void _q_deactivateAllWindows(QMdiSubWindow *aboutToActivate = 0);
+ void _q_deactivateAllWindows(QMdiSubWindow *aboutToActivate = nullptr);
void _q_processWindowStateChanged(Qt::WindowStates oldState, Qt::WindowStates newState);
void _q_currentTabChanged(int index);
void _q_closeTab(int index);
@@ -198,7 +198,7 @@ public:
void activateCurrentWindow();
void activateHighlightedWindow();
void emitWindowActivated(QMdiSubWindow *child);
- void resetActiveWindow(QMdiSubWindow *child = 0);
+ void resetActiveWindow(QMdiSubWindow *child = nullptr);
void updateActiveWindow(int removedIndex, bool activeRemoved);
void updateScrollBars();
void internalRaise(QMdiSubWindow *child) const;
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 685c5e159e..d58a1d06db 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -288,13 +288,6 @@ static inline bool isHoverControl(QStyle::SubControl control)
return control != QStyle::SC_None && control != QStyle::SC_TitleBarLabel;
}
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-static inline QRgb colorref2qrgb(COLORREF col)
-{
- return qRgb(GetRValue(col),GetGValue(col),GetBValue(col));
-}
-#endif
-
#ifndef QT_NO_TOOLTIP
static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOptionComplex &opt,
QStyle::ComplexControl complexControl, QStyle::SubControl subControl)
@@ -1826,7 +1819,7 @@ void QMdiSubWindowPrivate::showButtonsInMenuBar(QMenuBar *menuBar)
// Make sure topLevelWindow->contentsRect returns correct geometry.
// topLevelWidget->updateGeoemtry will not do the trick here since it will post the event.
QEvent event(QEvent::LayoutRequest);
- QApplication::sendEvent(topLevelWindow, &event);
+ QCoreApplication::sendEvent(topLevelWindow, &event);
}
}
@@ -1926,43 +1919,7 @@ QPalette QMdiSubWindowPrivate::desktopPalette() const
QPalette newPalette = q->palette();
bool colorsInitialized = false;
-#if 0 // Used to be included in Qt4 for Q_WS_WIN // ask system properties on windows
-#ifndef SPI_GETGRADIENTCAPTIONS
-#define SPI_GETGRADIENTCAPTIONS 0x1008
-#endif
-#ifndef COLOR_GRADIENTACTIVECAPTION
-#define COLOR_GRADIENTACTIVECAPTION 27
-#endif
-#ifndef COLOR_GRADIENTINACTIVECAPTION
-#define COLOR_GRADIENTINACTIVECAPTION 28
-#endif
- if (QApplication::desktopSettingsAware()) {
- newPalette.setColor(QPalette::Active, QPalette::Highlight,
- colorref2qrgb(GetSysColor(COLOR_ACTIVECAPTION)));
- newPalette.setColor(QPalette::Inactive, QPalette::Highlight,
- colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTION)));
- newPalette.setColor(QPalette::Active, QPalette::HighlightedText,
- colorref2qrgb(GetSysColor(COLOR_CAPTIONTEXT)));
- newPalette.setColor(QPalette::Inactive, QPalette::HighlightedText,
- colorref2qrgb(GetSysColor(COLOR_INACTIVECAPTIONTEXT)));
- colorsInitialized = true;
- BOOL hasGradient = false;
- SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &hasGradient, 0);
-
- if (hasGradient) {
- newPalette.setColor(QPalette::Active, QPalette::Base,
- colorref2qrgb(GetSysColor(COLOR_GRADIENTACTIVECAPTION)));
- newPalette.setColor(QPalette::Inactive, QPalette::Base,
- colorref2qrgb(GetSysColor(COLOR_GRADIENTINACTIVECAPTION)));
- } else {
- newPalette.setColor(QPalette::Active, QPalette::Base,
- newPalette.color(QPalette::Active, QPalette::Highlight));
- newPalette.setColor(QPalette::Inactive, QPalette::Base,
- newPalette.color(QPalette::Inactive, QPalette::Highlight));
- }
- }
-#endif
if (!colorsInitialized) {
newPalette.setColor(QPalette::Active, QPalette::Highlight,
newPalette.color(QPalette::Active, QPalette::Highlight));
@@ -1986,7 +1943,7 @@ void QMdiSubWindowPrivate::updateActions()
for (int i = 0; i < NumWindowStateActions; ++i)
setVisible(WindowStateAction(i), false);
-#ifdef Q_OS_MACOS
+#if defined(Q_OS_MACOS) && QT_CONFIG(action)
if (q_func()->style()->inherits("QMacStyle"))
for (int i = 0; i < NumWindowStateActions; ++i)
if (QAction *action = actions[i])
@@ -3050,7 +3007,7 @@ void QMdiSubWindow::closeEvent(QCloseEvent *closeEvent)
d->setActive(false);
if (parentWidget() && testAttribute(Qt::WA_DeleteOnClose)) {
QChildEvent childRemoved(QEvent::ChildRemoved, this);
- QApplication::sendEvent(parentWidget(), &childRemoved);
+ QCoreApplication::sendEvent(parentWidget(), &childRemoved);
}
closeEvent->accept();
}
diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h
index 719984c8d4..d3513b6708 100644
--- a/src/widgets/widgets/qmdisubwindow_p.h
+++ b/src/widgets/widgets/qmdisubwindow_p.h
@@ -78,7 +78,7 @@ template<typename T>
class ControlElement : public T
{
public:
- ControlElement(QMdiSubWindow *child) : T(child, 0)
+ ControlElement(QMdiSubWindow *child) : T(child, nullptr)
{
Q_ASSERT(child);
mdiChild = child;
@@ -88,7 +88,7 @@ public:
{
if (classname && strcmp(classname, "ControlElement") == 0)
return this;
- return 0;
+ return nullptr;
}
QPointer<QMdiSubWindow> mdiChild;
@@ -102,7 +102,7 @@ public:
#if QT_CONFIG(menubar)
void showButtonsInMenuBar(QMenuBar *menuBar);
- void removeButtonsFromMenuBar(QMenuBar *menuBar = 0);
+ void removeButtonsFromMenuBar(QMenuBar *menuBar = nullptr);
QMenuBar *menuBar() const { return m_menuBar; }
#endif
void updateWindowIcon(const QIcon &windowIcon);
@@ -331,7 +331,7 @@ public:
inline bool autoRaise() const
{
Q_Q(const QMdiSubWindow);
- return q->style()->styleHint(QStyle::SH_TitleBar_AutoRaise, 0, q);
+ return q->style()->styleHint(QStyle::SH_TitleBar_AutoRaise, nullptr, q);
}
inline bool isResizeOperation() const
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index c61b68e10a..51b458f03a 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -142,9 +142,7 @@ public:
#endif
if (style() != p->style())
setStyle(p->style());
- int leftMargin, topMargin, rightMargin, bottomMargin;
- p->getContentsMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin);
- setContentsMargins(leftMargin, topMargin, rightMargin, bottomMargin);
+ setContentsMargins(p->contentsMargins());
setLayoutDirection(p->layoutDirection());
//QObject::connect(this, SIGNAL(triggered(QAction*)), this, SLOT(onTrigger(QAction*)));
//QObject::connect(this, SIGNAL(hovered(QAction*)), this, SLOT(onHovered(QAction*)));
@@ -264,7 +262,7 @@ void QMenuPrivate::copyActionToPlatformItem(const QAction *action, QPlatformMenu
item->setIconSize(w->style()->pixelMetric(QStyle::PM_SmallIconSize, &opt, w));
} else {
QStyleOption opt;
- item->setIconSize(qApp->style()->pixelMetric(QStyle::PM_SmallIconSize, &opt, 0));
+ item->setIconSize(QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize, &opt, 0));
}
} else {
item->setIcon(QIcon());
@@ -907,7 +905,7 @@ void QMenuPrivate::updateLayoutDirection()
else if (QWidget *w = q->parentWidget())
setLayoutDirection_helper(w->layoutDirection());
else
- setLayoutDirection_helper(QApplication::layoutDirection());
+ setLayoutDirection_helper(QGuiApplication::layoutDirection());
}
}
@@ -1335,7 +1333,7 @@ bool QMenuPrivate::mouseEventTaken(QMouseEvent *e)
if (e->type() != QEvent::MouseButtonRelease || mouseDown == caused) {
QMouseEvent new_e(e->type(), cpos, caused->mapTo(caused->topLevelWidget(), cpos), e->screenPos(),
e->button(), e->buttons(), e->modifiers(), e->source());
- QApplication::sendEvent(caused, &new_e);
+ QCoreApplication::sendEvent(caused, &new_e);
return true;
}
}
@@ -1543,7 +1541,7 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action)
if (d->currentAction && d->currentAction == action && !d->currentAction->isSeparator()) {
option->state |= QStyle::State_Selected
- | (d->mouseDown ? QStyle::State_Sunken : QStyle::State_None);
+ | (QMenuPrivate::mouseDown ? QStyle::State_Sunken : QStyle::State_None);
}
option->menuHasCheckableItems = d->hasCheckableItems;
@@ -2334,14 +2332,17 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
// However if the QMenu was constructed with a QDesktopScreenWidget as its parent,
// then initialScreenIndex was set, so we should respect that for the lifetime of this menu.
// Use d->popupScreen to remember, because initialScreenIndex will be reset after the first showing.
- const int screenIndex = d->topData()->initialScreenIndex;
- if (screenIndex >= 0)
- d->popupScreen = screenIndex;
- if (auto s = QGuiApplication::screens().value(d->popupScreen)) {
- if (d->setScreen(s))
+ // However if eventLoop exists, then exec() already did this by calling createWinId(); so leave it alone. (QTBUG-76162)
+ if (!d->eventLoop) {
+ const int screenIndex = d->topData()->initialScreenIndex;
+ if (screenIndex >= 0)
+ d->popupScreen = screenIndex;
+ if (auto s = QGuiApplication::screens().value(d->popupScreen)) {
+ if (d->setScreen(s))
+ d->itemsDirty = true;
+ } else if (d->setScreenForPoint(p)) {
d->itemsDirty = true;
- } else if (d->setScreenForPoint(p)) {
- d->itemsDirty = true;
+ }
}
const bool contextMenu = d->isContextMenu();
@@ -2362,7 +2363,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
QRect screen;
#if QT_CONFIG(graphicsview)
- bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this);
+ bool isEmbedded = !bypassGraphicsProxyWidget(this) && QMenuPrivate::nearestGraphicsProxyWidget(this);
if (isEmbedded)
screen = d->popupGeometry();
else
@@ -2392,7 +2393,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
}
#ifdef QT_KEYPAD_NAVIGATION
- if (!atAction && QApplication::keypadNavigationEnabled()) {
+ if (!atAction && QApplicationPrivate::keypadNavigationEnabled()) {
// Try to have one item activated
if (d->defaultAction && d->defaultAction->isEnabled()) {
atAction = d->defaultAction;
@@ -2698,8 +2699,8 @@ void QMenu::hideEvent(QHideEvent *)
if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->causedPopup.widget))
mb->d_func()->setCurrentAction(0);
#endif
- if (d->mouseDown == this)
- d->mouseDown = 0;
+ if (QMenuPrivate::mouseDown == this)
+ QMenuPrivate::mouseDown = nullptr;
d->hasHadMouse = false;
if (d->activeMenu)
d->hideMenu(d->activeMenu);
@@ -2847,8 +2848,8 @@ void QMenu::paintEvent(QPaintEvent *e)
void QMenu::wheelEvent(QWheelEvent *e)
{
Q_D(QMenu);
- if (d->scroll && rect().contains(e->pos()))
- d->scrollMenu(e->delta() > 0 ?
+ if (d->scroll && rect().contains(e->position().toPoint()))
+ d->scrollMenu(e->angleDelta().y() > 0 ?
QMenuPrivate::QMenuScroller::ScrollUp : QMenuPrivate::QMenuScroller::ScrollDown);
}
#endif
@@ -2874,7 +2875,7 @@ void QMenu::mousePressEvent(QMouseEvent *e)
d->hideUpToMenuBar();
return;
}
- d->mouseDown = this;
+ QMenuPrivate::mouseDown = this;
QAction *action = d->actionAt(e->pos());
d->setCurrentAction(action, 20);
@@ -2889,12 +2890,12 @@ void QMenu::mouseReleaseEvent(QMouseEvent *e)
Q_D(QMenu);
if (d->aboutToHide || d->mouseEventTaken(e))
return;
- if(d->mouseDown != this) {
- d->mouseDown = 0;
+ if (QMenuPrivate::mouseDown != this) {
+ QMenuPrivate::mouseDown = nullptr;
return;
}
- d->mouseDown = 0;
+ QMenuPrivate::mouseDown = nullptr;
d->setSyncAction();
QAction *action = d->actionAt(e->pos());
@@ -2995,7 +2996,7 @@ QMenu::event(QEvent *e)
d->updateActionRects();
break; }
case QEvent::Show:
- d->mouseDown = 0;
+ QMenuPrivate::mouseDown = nullptr;
d->updateActionRects();
d->sloppyState.reset();
if (d->currentAction)
@@ -3385,7 +3386,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
#if QT_CONFIG(menubar)
if (QMenuBar *mb = qobject_cast<QMenuBar*>(d->topCausedWidget())) {
QAction *oldAct = mb->d_func()->currentAction;
- QApplication::sendEvent(mb, e);
+ QCoreApplication::sendEvent(mb, e);
if (mb->d_func()->currentAction != oldAct)
key_consumed = true;
}
@@ -3428,7 +3429,7 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
}
if (e->buttons())
- d->mouseDown = this;
+ QMenuPrivate::mouseDown = this;
if (d->activeMenu)
d->activeMenu->d_func()->setCurrentAction(0);
@@ -3593,7 +3594,7 @@ void QMenu::internalDelayedPopup()
QRect screen;
#if QT_CONFIG(graphicsview)
- bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this);
+ bool isEmbedded = !bypassGraphicsProxyWidget(this) && QMenuPrivate::nearestGraphicsProxyWidget(this);
if (isEmbedded)
screen = d->popupGeometry();
else
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index a72592824b..efbbc099a1 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -135,9 +135,9 @@ public:
void initialize(QMenu *menu)
{
m_menu = menu;
- m_uni_directional = menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirection, 0, menu);
- m_uni_dir_fail_at_count = short(menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirectionFailCount, 0, menu));
- m_select_other_actions = menu->style()->styleHint(QStyle::SH_Menu_SubMenuSloppySelectOtherActions, 0 , menu);
+ m_uni_directional = menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirection, nullptr, menu);
+ m_uni_dir_fail_at_count = short(menu->style()->styleHint(QStyle::SH_Menu_SubMenuUniDirectionFailCount, nullptr, menu));
+ m_select_other_actions = menu->style()->styleHint(QStyle::SH_Menu_SubMenuSloppySelectOtherActions, nullptr , menu);
m_timeout = short(menu->style()->styleHint(QStyle::SH_Menu_SubMenuSloppyCloseTimeout));
m_discard_state_when_entering_parent = menu->style()->styleHint(QStyle::SH_Menu_SubMenuResetWhenReenteringParent);
m_dont_start_time_on_leave = menu->style()->styleHint(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave);
@@ -378,7 +378,7 @@ public:
}
void stop()
{
- action = 0;
+ action = nullptr;
timer.stop();
}
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 9a60f1477d..3d31a3b73a 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -404,7 +404,7 @@ void QMenuBarPrivate::setCurrentAction(QAction *action, bool popup, bool activat
} else if (previousAction) {
QString empty;
QStatusTipEvent tip(empty);
- QApplication::sendEvent(q, &tip);
+ QCoreApplication::sendEvent(q, &tip);
#endif
}
if (fw)
@@ -701,7 +701,7 @@ void QMenuBarPrivate::init()
q->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
q->setAttribute(Qt::WA_CustomWhatsThis);
- if (!QApplication::instance()->testAttribute(Qt::AA_DontUseNativeMenuBar))
+ if (!QCoreApplication::testAttribute(Qt::AA_DontUseNativeMenuBar))
platformMenuBar = QGuiApplicationPrivate::platformTheme()->createPlatformMenuBar();
if (platformMenuBar)
diff --git a/src/widgets/widgets/qmenubar_p.h b/src/widgets/widgets/qmenubar_p.h
index c276a4512d..e3db16d190 100644
--- a/src/widgets/widgets/qmenubar_p.h
+++ b/src/widgets/widgets/qmenubar_p.h
@@ -65,9 +65,9 @@ class QMenuBarPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QMenuBar)
public:
- QMenuBarPrivate() : itemsDirty(0), currentAction(0), mouseDown(0),
+ QMenuBarPrivate() : itemsDirty(0), currentAction(nullptr), mouseDown(0),
closePopupMode(0), defaultPopDown(1), popupState(0), keyboardState(0), altPressed(0),
- doChildEffects(false), platformMenuBar(0)
+ doChildEffects(false), platformMenuBar(nullptr)
{ }
~QMenuBarPrivate()
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 4a875975a4..0a81931b57 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -54,6 +54,7 @@
#endif
#include <qstyle.h>
#include <qtimer.h>
+#include "private/qapplication_p.h"
#include "private/qtextdocumentlayout_p.h"
#include "private/qabstracttextdocumentlayout_p.h"
#include "qtextdocument.h"
@@ -824,9 +825,6 @@ void QPlainTextEditPrivate::init(const QString &txt)
viewport->setCursor(Qt::IBeamCursor);
#endif
originalOffsetY = 0;
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- setSingleFingerPanEnabled(true);
-#endif
}
void QPlainTextEditPrivate::_q_textChanged()
@@ -1573,7 +1571,7 @@ bool QPlainTextEdit::event(QEvent *e)
}
#ifdef QT_KEYPAD_NAVIGATION
else if (e->type() == QEvent::EnterEditFocus || e->type() == QEvent::LeaveEditFocus) {
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
d->sendControlEvent(e);
}
#endif
@@ -1588,7 +1586,7 @@ bool QPlainTextEdit::event(QEvent *e)
d->originalOffsetY = vBar->value();
QPointF offset = g->offset();
if (!offset.isNull()) {
- if (QApplication::isRightToLeft())
+ if (QGuiApplication::isRightToLeft())
offset.rx() *= -1;
// QPlainTextEdit scrolls by lines only in vertical direction
QFontMetrics fm(document()->defaultFont());
@@ -1691,7 +1689,7 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
switch (e->key()) {
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!(d->control->textInteractionFlags() & Qt::LinksAccessibleByKeyboard))
setEditFocus(!hasEditFocus());
else {
@@ -1709,14 +1707,14 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
break;
case Qt::Key_Back:
case Qt::Key_No:
- if (!QApplication::keypadNavigationEnabled()
- || (QApplication::keypadNavigationEnabled() && !hasEditFocus())) {
+ if (!QApplicationPrivate::keypadNavigationEnabled()
+ || (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus())) {
e->ignore();
return;
}
break;
default:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus() && !(e->modifiers() & Qt::ControlModifier)) {
if (e->text()[0].isPrint()) {
setEditFocus(true);
@@ -1792,7 +1790,7 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
switch (e->key()) {
case Qt::Key_Up:
case Qt::Key_Down:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// Cursor position didn't change, so we want to leave
// these keys to change focus.
e->ignore();
@@ -1801,7 +1799,7 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
break;
case Qt::Key_Left:
case Qt::Key_Right:
- if (QApplication::keypadNavigationEnabled()
+ if (QApplicationPrivate::keypadNavigationEnabled()
&& QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) {
// Same as for Key_Up and Key_Down.
e->ignore();
@@ -1810,7 +1808,7 @@ void QPlainTextEdit::keyPressEvent(QKeyEvent *e)
break;
case Qt::Key_Back:
if (!e->isAutoRepeat()) {
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (document()->isEmpty()) {
setEditFocus(false);
e->accept();
@@ -1836,7 +1834,7 @@ void QPlainTextEdit::keyReleaseEvent(QKeyEvent *e)
{
#ifdef QT_KEYPAD_NAVIGATION
Q_D(QPlainTextEdit);
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!e->isAutoRepeat() && e->key() == Qt::Key_Back
&& d->deleteAllTimer.isActive()) {
d->deleteAllTimer.stop();
@@ -2080,7 +2078,7 @@ void QPlainTextEdit::mousePressEvent(QMouseEvent *e)
{
Q_D(QPlainTextEdit);
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus())
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus())
setEditFocus(true);
#endif
d->sendControlEvent(e);
@@ -2212,7 +2210,7 @@ void QPlainTextEdit::inputMethodEvent(QInputMethodEvent *e)
Q_D(QPlainTextEdit);
#ifdef QT_KEYPAD_NAVIGATION
if (d->control->textInteractionFlags() & Qt::TextEditable
- && QApplication::keypadNavigationEnabled()
+ && QApplicationPrivate::keypadNavigationEnabled()
&& !hasEditFocus()) {
setEditFocus(true);
selectAll(); // so text is replaced rather than appended to
@@ -2649,7 +2647,7 @@ void QPlainTextEdit::setReadOnly(bool ro)
d->control->setTextInteractionFlags(flags);
setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
QEvent event(QEvent::ReadOnlyChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
/*!
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index b578aa0b18..f48b5706f7 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -684,38 +684,6 @@ bool QPushButton::event(QEvent *e)
return QAbstractButton::event(e);
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-/* \reimp */
-bool QPushButton::hitButton(const QPoint &pos) const
-{
- QStyleOptionButton opt;
- initStyleOption(&opt);
- if (qt_mac_buttonIsRenderedFlat(this, &opt))
- return QAbstractButton::hitButton(pos);
-
- // Now that we know we are using the native style, let's proceed.
- Q_D(const QPushButton);
- QPushButtonPrivate *nonConst = const_cast<QPushButtonPrivate *>(d);
- // In OSX buttons are round, which causes the hit method to be special.
- // We cannot simply relay on detecting if something is inside the rect or not,
- // we need to check if it is inside the "rounded area" or not. A point might
- // be inside the rect but not inside the rounded area.
- // Notice this method is only reimplemented for OSX.
- return nonConst->hitButton(pos);
-}
-
-bool QPushButtonPrivate::hitButton(const QPoint &pos)
-{
- Q_Q(QPushButton);
- QRect roundedRect(q->rect().left() + QMacStylePrivate::PushButtonLeftOffset,
- q->rect().top() + QMacStylePrivate::PushButtonContentPadding,
- q->rect().width() - QMacStylePrivate::PushButtonRightOffset,
- q->rect().height() - QMacStylePrivate::PushButtonBottomOffset);
- return roundedRect.contains(pos);
-}
-#endif
-
-
QT_END_NAMESPACE
#include "moc_qpushbutton.cpp"
diff --git a/src/widgets/widgets/qpushbutton_p.h b/src/widgets/widgets/qpushbutton_p.h
index a58675fe64..439b6e35d6 100644
--- a/src/widgets/widgets/qpushbutton_p.h
+++ b/src/widgets/widgets/qpushbutton_p.h
@@ -73,9 +73,6 @@ public:
inline void init() { resetLayoutItemMargins(); }
static QPushButtonPrivate* get(QPushButton *b) { return b->d_func(); }
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- bool hitButton(const QPoint &pos);
-#endif
#if QT_CONFIG(menu)
QPoint adjustedMenuPosition();
#endif
diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp
index ade8675db8..af730f8023 100644
--- a/src/widgets/widgets/qrubberband.cpp
+++ b/src/widgets/widgets/qrubberband.cpp
@@ -45,10 +45,6 @@
#include "qstyle.h"
#include "qstyleoption.h"
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-# include <private/qt_mac_p.h>
-# include <private/qt_cocoa_helpers_mac_p.h>
-#endif
#include <qdebug.h>
@@ -140,18 +136,9 @@ QRubberBand::QRubberBand(Shape s, QWidget *p)
Q_D(QRubberBand);
d->shape = s;
setAttribute(Qt::WA_TransparentForMouseEvents);
-#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
setAttribute(Qt::WA_NoSystemBackground);
-#endif
setAttribute(Qt::WA_WState_ExplicitShowHide);
setVisible(false);
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (isWindow()) {
- createWinId();
- extern OSWindowRef qt_mac_window_for(const QWidget *); //qwidget_mac.cpp
- macWindowSetHasShadow(qt_mac_window_for(this), false);
- }
-#endif
}
/*!
diff --git a/src/widgets/widgets/qscrollarea.cpp b/src/widgets/widgets/qscrollarea.cpp
index 9994344d79..68aa545082 100644
--- a/src/widgets/widgets/qscrollarea.cpp
+++ b/src/widgets/widgets/qscrollarea.cpp
@@ -46,6 +46,7 @@
#include "qapplication.h"
#include "qvariant.h"
#include "qdebug.h"
+#include "private/qapplication_p.h"
#include "private/qlayoutengine_p.h"
QT_BEGIN_NAMESPACE
@@ -300,7 +301,7 @@ bool QScrollArea::event(QEvent *e)
d->updateScrollBars();
}
#ifdef QT_KEYPAD_NAVIGATION
- else if (QApplication::keypadNavigationEnabled()) {
+ else if (QApplicationPrivate::keypadNavigationEnabled()) {
if (e->type() == QEvent::Show)
QApplication::instance()->installEventFilter(this);
else if (e->type() == QEvent::Hide)
@@ -319,7 +320,7 @@ bool QScrollArea::eventFilter(QObject *o, QEvent *e)
Q_D(QScrollArea);
#ifdef QT_KEYPAD_NAVIGATION
if (d->widget && o != d->widget && e->type() == QEvent::FocusIn
- && QApplication::keypadNavigationEnabled()) {
+ && QApplicationPrivate::keypadNavigationEnabled()) {
if (o->isWidgetType())
ensureWidgetVisible(static_cast<QWidget *>(o));
}
diff --git a/src/widgets/widgets/qscrollarea_p.h b/src/widgets/widgets/qscrollarea_p.h
index fa2e0241cf..2bdf9ed596 100644
--- a/src/widgets/widgets/qscrollarea_p.h
+++ b/src/widgets/widgets/qscrollarea_p.h
@@ -65,7 +65,7 @@ class QScrollAreaPrivate: public QAbstractScrollAreaPrivate
Q_DECLARE_PUBLIC(QScrollArea)
public:
- QScrollAreaPrivate(): resizable(false), alignment(0){}
+ QScrollAreaPrivate(): resizable(false), alignment(nullptr){}
void updateScrollBars();
void updateWidgetPosition();
QPointer<QWidget> widget;
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index b4168268a0..08d771a27a 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -497,16 +497,14 @@ bool QScrollBar::event(QEvent *event)
void QScrollBar::wheelEvent(QWheelEvent *event)
{
event->ignore();
- int delta = event->delta();
// scrollbar is a special case - in vertical mode it reaches minimum
// value in the upper position, however QSlider's minimum value is on
- // the bottom. So we need to invert a value, but since the scrollbar is
- // inverted by default, we need to inverse the delta value for the
+ // the bottom. So we need to invert the value, but since the scrollbar is
+ // inverted by default, we need to invert the delta value only for the
// horizontal orientation.
- if (event->orientation() == Qt::Horizontal)
- delta = -delta;
+ int delta = (orientation() == Qt::Horizontal ? -event->angleDelta().x() : event->angleDelta().y());
Q_D(QScrollBar);
- if (d->scrollByDelta(event->orientation(), event->modifiers(), delta))
+ if (d->scrollByDelta(orientation(), event->modifiers(), delta))
event->accept();
if (event->phase() == Qt::ScrollBegin)
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index dc5a7158dd..835af9c7b8 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -50,10 +50,6 @@
#include "qdebug.h"
#include <QDesktopWidget>
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-#include <private/qt_mac_p.h>
-#endif
-
#include <private/qwidget_p.h>
#include <private/qdesktopwidget_p.h>
#include <QtWidgets/qabstractscrollarea.h>
@@ -81,9 +77,7 @@ public:
Qt::Corner m_corner;
bool gotMousePress;
QPointer<QWidget> tlw;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- void updateMacSizer(bool hide) const;
-#endif
+
Qt::Corner corner() const;
inline bool atBottom() const
{
@@ -119,9 +113,7 @@ public:
updateTopLevelWidget();
if (tlw && showSizeGrip) {
Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
sizeGripNotVisibleState |= Qt::WindowMaximized;
-#endif
// Don't show the size grip if the tlw is maximized or in full screen mode.
showSizeGrip = !(tlw->windowState() & sizeGripNotVisibleState);
}
@@ -141,18 +133,6 @@ QSizeGripPrivate::QSizeGripPrivate()
{
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-void QSizeGripPrivate::updateMacSizer(bool hide) const
-{
- Q_Q(const QSizeGrip);
- if (QApplication::closingDown() || !parent)
- return;
- QWidget *topLevelWindow = qt_sizegrip_topLevelWidget(const_cast<QSizeGrip *>(q));
- if(topLevelWindow && topLevelWindow->isWindow())
- QWidgetPrivate::qt_mac_update_sizer(topLevelWindow, hide ? -1 : 1);
-}
-#endif
-
Qt::Corner QSizeGripPrivate::corner() const
{
Q_Q(const QSizeGrip);
@@ -227,7 +207,7 @@ void QSizeGripPrivate::init()
Q_Q(QSizeGrip);
m_corner = q->isLeftToRight() ? Qt::BottomRightCorner : Qt::BottomLeftCorner;
-#if !defined(QT_NO_CURSOR) && !0 /* Used to be included in Qt4 for Q_WS_MAC */
+#if !defined(QT_NO_CURSOR)
q->setCursor(m_corner == Qt::TopLeftCorner || m_corner == Qt::BottomRightCorner
? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor);
#endif
@@ -440,7 +420,7 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/)
return;
d->m_corner = d->corner();
-#if !defined(QT_NO_CURSOR) && !0 /* Used to be included in Qt4 for Q_WS_MAC */
+#if !defined(QT_NO_CURSOR)
setCursor(d->m_corner == Qt::TopLeftCorner || d->m_corner == Qt::BottomRightCorner
? Qt::SizeFDiagCursor : Qt::SizeBDiagCursor);
#endif
@@ -451,9 +431,6 @@ void QSizeGrip::moveEvent(QMoveEvent * /*moveEvent*/)
*/
void QSizeGrip::showEvent(QShowEvent *showEvent)
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- d_func()->updateMacSizer(false);
-#endif
QWidget::showEvent(showEvent);
}
@@ -462,9 +439,6 @@ void QSizeGrip::showEvent(QShowEvent *showEvent)
*/
void QSizeGrip::hideEvent(QHideEvent *hideEvent)
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- d_func()->updateMacSizer(true);
-#endif
QWidget::hideEvent(hideEvent);
}
@@ -486,9 +460,7 @@ bool QSizeGrip::eventFilter(QObject *o, QEvent *e)
return QWidget::eventFilter(o, e);
}
Qt::WindowStates sizeGripNotVisibleState = Qt::WindowFullScreen;
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
sizeGripNotVisibleState |= Qt::WindowMaximized;
-#endif
// Don't show the size grip if the tlw is maximized or in full screen mode.
setVisible(!(d->tlw->windowState() & sizeGripNotVisibleState));
setAttribute(Qt::WA_WState_ExplicitShowHide, false);
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 47d3b2fb81..161e4ba27a 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -46,6 +46,7 @@
#include "qpainter.h"
#include "qstyle.h"
#include "qstyleoption.h"
+#include "private/qapplication_p.h"
#include "private/qabstractslider_p.h"
#include "qdebug.h"
@@ -360,7 +361,7 @@ void QSlider::mousePressEvent(QMouseEvent *ev)
return;
}
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
setEditFocus(true);
#endif
ev->accept();
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 7d454c6359..61ea81c892 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -128,9 +128,10 @@ public:
manually. The spin box supports integer values but can be extended to
use different strings with validate(), textFromValue() and valueFromText().
- Every time the value changes QSpinBox emits two valueChanged() signals,
- one providing an int and the other a QString. The QString overload
- provides the value with both prefix() and suffix().
+ Every time the value changes QSpinBox emits valueChanged() and
+ textChanged() signals, the former providing a int and the latter
+ a QString. The textChanged() signal provides the value with both
+ prefix() and suffix().
The current value can be fetched with value() and set with setValue().
Clicking the up/down buttons or using the keyboard accelerator's
@@ -183,12 +184,23 @@ public:
*/
/*!
+ \fn void QSpinBox::textChanged(const QString &text)
+ \since 5.14
+
+ This signal is emitted whenever the spin box's text is changed.
+ The new text is passed in \a text with prefix() and suffix().
+*/
+
+#if QT_DEPRECATED_SINCE(5, 14)
+/*!
\fn void QSpinBox::valueChanged(const QString &text)
\overload
+ \obsolete Use textChanged(QString) instead
The new value is passed in \a text with prefix() and suffix().
*/
+#endif
/*!
Constructs a spin box with 0 as minimum value and 99 as maximum value, a
@@ -372,7 +384,7 @@ void QSpinBox::setMinimum(int minimum)
{
Q_D(QSpinBox);
const QVariant m(minimum);
- d->setRange(m, (d->variantCompare(d->maximum, m) > 0 ? d->maximum : m));
+ d->setRange(m, (QSpinBoxPrivate::variantCompare(d->maximum, m) > 0 ? d->maximum : m));
}
/*!
@@ -400,7 +412,7 @@ void QSpinBox::setMaximum(int maximum)
{
Q_D(QSpinBox);
const QVariant m(maximum);
- d->setRange((d->variantCompare(d->minimum, m) < 0 ? d->minimum : m), m);
+ d->setRange((QSpinBoxPrivate::variantCompare(d->minimum, m) < 0 ? d->minimum : m), m);
}
/*!
@@ -594,9 +606,9 @@ void QSpinBox::fixup(QString &input) const
values but can be extended to use different strings with
validate(), textFromValue() and valueFromText().
- Every time the value changes QDoubleSpinBox emits two
- valueChanged() signals, one taking providing a double and the other
- a QString. The QString overload provides the value with both
+ Every time the value changes QDoubleSpinBox emits valueChanged() and
+ textChanged() signals, the former providing a double and the latter
+ a QString. The textChanged() signal provides the value with both
prefix() and suffix(). The current value can be fetched with
value() and set with setValue().
@@ -644,12 +656,23 @@ void QSpinBox::fixup(QString &input) const
*/
/*!
+ \fn void QDoubleSpinBox::textChanged(const QString &text)
+ \since 5.14
+
+ This signal is emitted whenever the spin box's text is changed.
+ The new text is passed in \a text with prefix() and suffix().
+*/
+
+#if QT_DEPRECATED_SINCE(5, 14)
+/*!
\fn void QDoubleSpinBox::valueChanged(const QString &text);
\overload
+ \obsolete Use textChanged(QString) instead
The new value is passed in \a text with prefix() and suffix().
*/
+#endif
/*!
Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
@@ -841,7 +864,7 @@ void QDoubleSpinBox::setMinimum(double minimum)
Q_D(QDoubleSpinBox);
d->actualMin = minimum;
const QVariant m(d->round(minimum));
- d->setRange(m, (d->variantCompare(d->maximum, m) > 0 ? d->maximum : m));
+ d->setRange(m, (QDoubleSpinBoxPrivate::variantCompare(d->maximum, m) > 0 ? d->maximum : m));
}
/*!
@@ -872,7 +895,7 @@ void QDoubleSpinBox::setMaximum(double maximum)
Q_D(QDoubleSpinBox);
d->actualMax = maximum;
const QVariant m(d->round(maximum));
- d->setRange((d->variantCompare(d->minimum, m) < 0 ? d->minimum : m), m);
+ d->setRange((QDoubleSpinBoxPrivate::variantCompare(d->minimum, m) < 0 ? d->minimum : m), m);
}
/*!
@@ -1072,7 +1095,13 @@ void QSpinBoxPrivate::emitSignals(EmitPolicy ep, const QVariant &old)
if (ep != NeverEmit) {
pendingEmit = false;
if (ep == AlwaysEmit || value != old) {
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->valueChanged(edit->displayText());
+QT_WARNING_POP
+#endif
+ emit q->textChanged(edit->displayText());
emit q->valueChanged(value.toInt());
}
}
@@ -1223,7 +1252,13 @@ void QDoubleSpinBoxPrivate::emitSignals(EmitPolicy ep, const QVariant &old)
if (ep != NeverEmit) {
pendingEmit = false;
if (ep == AlwaysEmit || value != old) {
+#if QT_DEPRECATED_SINCE(5, 14)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
emit q->valueChanged(edit->displayText());
+QT_WARNING_POP
+#endif
+ emit q->textChanged(edit->displayText());
emit q->valueChanged(value.toDouble());
}
}
diff --git a/src/widgets/widgets/qspinbox.h b/src/widgets/widgets/qspinbox.h
index d2eac903fb..762dd4a46a 100644
--- a/src/widgets/widgets/qspinbox.h
+++ b/src/widgets/widgets/qspinbox.h
@@ -106,7 +106,11 @@ public Q_SLOTS:
Q_SIGNALS:
void valueChanged(int);
+ void textChanged(const QString &);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("Use textChanged(QString) instead")
void valueChanged(const QString &);
+#endif
private:
Q_DISABLE_COPY(QSpinBox)
@@ -168,7 +172,11 @@ public Q_SLOTS:
Q_SIGNALS:
void valueChanged(double);
+ void textChanged(const QString &);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_X("Use textChanged(QString) instead")
void valueChanged(const QString &);
+#endif
private:
Q_DISABLE_COPY(QDoubleSpinBox)
diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp
index bf6bf1c7c9..e39ef6d1cd 100644
--- a/src/widgets/widgets/qsplashscreen.cpp
+++ b/src/widgets/widgets/qsplashscreen.cpp
@@ -111,7 +111,7 @@ public:
The user can hide the splash screen by clicking on it with the
mouse. Since the splash screen is typically displayed before the
event loop has started running, it is necessary to periodically
- call QApplication::processEvents() to receive the mouse clicks.
+ call QCoreApplication::processEvents() to receive the mouse clicks.
It is sometimes useful to update the splash screen with messages,
for example, announcing connections established or modules loaded
@@ -170,13 +170,13 @@ void QSplashScreen::mousePressEvent(QMouseEvent *)
/*!
This overrides QWidget::repaint(). It differs from the standard repaint
- function in that it also calls QApplication::processEvents() to ensure
+ function in that it also calls QCoreApplication::processEvents() to ensure
the updates are displayed, even when there is no event loop present.
*/
void QSplashScreen::repaint()
{
QWidget::repaint();
- QApplication::processEvents();
+ QCoreApplication::processEvents();
}
/*!
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index de838a8f93..e7a4889996 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -771,14 +771,13 @@ void QSplitterPrivate::setGeo(QSplitterLayoutStruct *sls, int p, int s, bool all
if (!sls->handle->isHidden()) {
QSplitterHandle *h = sls->handle;
QSize hs = h->sizeHint();
- int left, top, right, bottom;
- h->getContentsMargins(&left, &top, &right, &bottom);
+ const QMargins m = h->contentsMargins();
if (orient==Qt::Horizontal) {
if (q->isRightToLeft())
p = contents.width() - p + hs.width();
- h->setGeometry(p-hs.width() - left, contents.y(), hs.width() + left + right, contents.height());
+ h->setGeometry(p-hs.width() - m.left(), contents.y(), hs.width() + m.left() + m.right(), contents.height());
} else {
- h->setGeometry(contents.x(), p-hs.height() - top, contents.width(), hs.height() + top + bottom);
+ h->setGeometry(contents.x(), p-hs.height() - m.top(), contents.width(), hs.height() + m.top() + m.bottom());
}
}
}
@@ -1378,7 +1377,7 @@ bool QSplitter::event(QEvent *e)
default:
;
}
- return QWidget::event(e);
+ return QFrame::event(e);
}
/*!
@@ -1793,7 +1792,7 @@ void QSplitter::setStretchFactor(int index, int stretch)
QTextStream& operator<<(QTextStream& ts, const QSplitter& splitter)
{
- ts << splitter.saveState() << endl;
+ ts << splitter.saveState() << Qt::endl;
return ts;
}
diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h
index f0d621004f..871406a51d 100644
--- a/src/widgets/widgets/qsplitter_p.h
+++ b/src/widgets/widgets/qsplitter_p.h
@@ -70,7 +70,7 @@ public:
QWidget *widget;
QSplitterHandle *handle;
- QSplitterLayoutStruct() : sizer(-1), collapsed(false), collapsible(Default), widget(0), handle(0) {}
+ QSplitterLayoutStruct() : sizer(-1), collapsed(false), collapsible(Default), widget(nullptr), handle(nullptr) {}
~QSplitterLayoutStruct() { delete handle; }
int getWidgetSize(Qt::Orientation orient);
int getHandleSize(Qt::Orientation orient);
@@ -84,7 +84,7 @@ class QSplitterPrivate : public QFramePrivate
public:
QSplitterPrivate() :
#if QT_CONFIG(rubberband)
- rubberBand(0),
+ rubberBand(nullptr),
#endif
opaque(true), firstShow(true),
childrenCollapsible(true), compatMode(false), handleWidth(-1), blockChildAdd(false), opaqueResizeSet(false) {}
@@ -140,7 +140,7 @@ class QSplitterHandlePrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QSplitterHandle)
public:
- QSplitterHandlePrivate() : s(0), orient(Qt::Horizontal), mouseOffset(0), opaq(false), hover(false), pressed(false) {}
+ QSplitterHandlePrivate() : s(nullptr), orient(Qt::Horizontal), mouseOffset(0), opaq(false), hover(false), pressed(false) {}
inline int pick(const QPoint &pos) const
{ return orient == Qt::Horizontal ? pos.x() : pos.y(); }
diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp
index e9044e6cad..39f0f11daf 100644
--- a/src/widgets/widgets/qstatusbar.cpp
+++ b/src/widgets/widgets/qstatusbar.cpp
@@ -90,10 +90,6 @@ public:
int savedStrut;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- QPoint dragStart;
-#endif
-
int indexToLastNonPermanentWidget() const
{
int i = items.size() - 1;
@@ -747,44 +743,7 @@ bool QStatusBar::event(QEvent *e)
}
}
-// On Mac OS X Leopard it is possible to drag the window by clicking
-// on the tool bar on most applications.
-#if 1 // Used to be excluded in Qt4 for Q_WS_MAC
return QWidget::event(e);
-#else
- // Enable drag-click only if the status bar is the status bar for a
- // QMainWindow with a unifed toolbar.
- if (parent() == 0 || qobject_cast<QMainWindow *>(parent()) == 0 ||
- qobject_cast<QMainWindow *>(parent())->unifiedTitleAndToolBarOnMac() == false )
- return QWidget::event(e);
-
- // Check for mouse events.
- QMouseEvent *mouseEvent;
- if (e->type() == QEvent::MouseButtonPress ||
- e->type() == QEvent::MouseMove ||
- e->type() == QEvent::MouseButtonRelease) {
- mouseEvent = static_cast <QMouseEvent*>(e);
- } else {
- return QWidget::event(e);
- }
-
- // The following is a standard mouse drag handler.
- if (e->type() == QEvent::MouseButtonPress && (mouseEvent->button() == Qt::LeftButton)) {
- d->dragStart = mouseEvent->pos();
- } else if (e->type() == QEvent::MouseMove){
- if (d->dragStart == QPoint())
- return QWidget::event(e);
- QPoint pos = mouseEvent->pos();
- QPoint delta = (pos - d->dragStart);
- window()->move(window()->pos() + delta);
- } else if (e->type() == QEvent::MouseButtonRelease && (mouseEvent->button() == Qt::LeftButton)){
- d->dragStart = QPoint();
- } else {
- return QWidget::event(e);
- }
-
- return true;
-#endif
}
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index b13f4da9d2..7e1794efef 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -65,13 +65,9 @@
#endif
#include "qdebug.h"
+#include "private/qapplication_p.h"
#include "private/qtabbar_p.h"
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
-#include <private/qt_mac_p.h>
-#include <private/qt_cocoa_helpers_mac_p.h>
-#endif
-
QT_BEGIN_NAMESPACE
namespace {
@@ -415,7 +411,7 @@ void QTabBarPrivate::init()
QObject::connect(rightB, SIGNAL(clicked()), q, SLOT(_q_scrollTabs()));
rightB->hide();
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
leftB->setFocusPolicy(Qt::NoFocus);
rightB->setFocusPolicy(Qt::NoFocus);
q->setFocusPolicy(Qt::NoFocus);
@@ -843,7 +839,7 @@ void QTabBarPrivate::refresh()
// be safe in case a subclass is also handling move with the tabs
if (pressedIndex != -1
&& movable
- && QApplication::mouseButtons() == Qt::NoButton) {
+ && QGuiApplication::mouseButtons() == Qt::NoButton) {
moveTabFinished(pressedIndex);
if (!validIndex(pressedIndex))
pressedIndex = -1;
@@ -1975,9 +1971,7 @@ void QTabBar::mousePressEvent(QMouseEvent *event)
d->moveTabFinished(d->pressedIndex);
d->pressedIndex = d->indexAtPos(event->pos());
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- d->previousPressedIndex = d->pressedIndex;
-#endif
+
if (d->validIndex(d->pressedIndex)) {
QStyleOptionTabBarBase optTabBase;
optTabBase.init(this);
@@ -2057,17 +2051,6 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
update();
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- } else if (!d->documentMode && event->buttons() == Qt::LeftButton && d->previousPressedIndex != -1) {
- int newPressedIndex = d->indexAtPos(event->pos());
- if (d->pressedIndex == -1 && d->previousPressedIndex == newPressedIndex) {
- d->pressedIndex = d->previousPressedIndex;
- update(tabRect(d->pressedIndex));
- } else if(d->pressedIndex != newPressedIndex) {
- d->pressedIndex = -1;
- update(tabRect(d->previousPressedIndex));
- }
-#endif
}
if (event->buttons() != Qt::LeftButton) {
@@ -2161,9 +2144,7 @@ void QTabBar::mouseReleaseEvent(QMouseEvent *event)
event->ignore();
return;
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- d->previousPressedIndex = -1;
-#endif
+
if (d->movable && d->dragInProgress && d->validIndex(d->pressedIndex)) {
int length = d->tabList[d->pressedIndex].dragOffset;
int width = verticalTabs(d->shape)
@@ -2210,7 +2191,9 @@ void QTabBar::wheelEvent(QWheelEvent *event)
{
#ifndef Q_OS_MAC
Q_D(QTabBar);
- int offset = event->delta() > 0 ? -1 : 1;
+ int delta = (qAbs(event->angleDelta().x()) > qAbs(event->angleDelta().y()) ?
+ event->angleDelta().x() : event->angleDelta().y());
+ int offset = delta > 0 ? -1 : 1;
d->setCurrentNextEnabledIndex(offset);
QWidget::wheelEvent(event);
#else
diff --git a/src/widgets/widgets/qtabbar_p.h b/src/widgets/widgets/qtabbar_p.h
index 9b798e89c9..5552c43548 100644
--- a/src/widgets/widgets/qtabbar_p.h
+++ b/src/widgets/widgets/qtabbar_p.h
@@ -92,10 +92,7 @@ public:
drawBase(true), scrollOffset(0), hoverIndex(-1), elideModeSetByUser(false), useScrollButtonsSetByUser(false), expanding(true), closeButtonOnTabs(false),
selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false),
dragInProgress(false), documentMode(false), autoHide(false), changeCurrentOnDrag(false),
- switchTabCurrentIndex(-1), switchTabTimerId(0), movingTab(0)
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- , previousPressedIndex(-1)
-#endif
+ switchTabCurrentIndex(-1), switchTabTimerId(0), movingTab(nullptr)
{}
int currentIndex;
@@ -182,7 +179,7 @@ public:
int indexAtPos(const QPoint &p) const;
- inline bool isAnimated() const { Q_Q(const QTabBar); return q->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, q) > 0; }
+ inline bool isAnimated() const { Q_Q(const QTabBar); return q->style()->styleHint(QStyle::SH_Widget_Animation_Duration, nullptr, q) > 0; }
inline bool validIndex(int index) const { return index >= 0 && index < tabList.count(); }
void setCurrentNextEnabledIndex(int offset);
@@ -232,9 +229,6 @@ public:
int switchTabTimerId;
QMovableTabWidget *movingTab;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- int previousPressedIndex;
-#endif
// shared by tabwidget and qtabbar
static void initStyleBaseOption(QStyleOptionTabBarBase *optTabBase, QTabBar *tabbar, QSize size)
{
diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp
index 547b8a82f9..4d7b39ae01 100644
--- a/src/widgets/widgets/qtabwidget.cpp
+++ b/src/widgets/widgets/qtabwidget.cpp
@@ -39,6 +39,7 @@
#include "qtabwidget.h"
+#include "private/qapplication_p.h"
#include "private/qwidget_p.h"
#include "private/qtabbar_p.h"
#include "qapplication.h"
@@ -241,7 +242,7 @@ void QTabWidgetPrivate::init()
q->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding,
QSizePolicy::TabWidget));
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
q->setFocusPolicy(Qt::NoFocus);
else
#endif
@@ -1108,14 +1109,14 @@ void QTabWidget::keyPressEvent(QKeyEvent *e)
if (((e->key() == Qt::Key_Tab || e->key() == Qt::Key_Backtab) &&
count() > 1 && e->modifiers() & Qt::ControlModifier)
#ifdef QT_KEYPAD_NAVIGATION
- || QApplication::keypadNavigationEnabled() && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right) && count() > 1
+ || QApplicationPrivate::keypadNavigationEnabled() && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right) && count() > 1
#endif
) {
int pageCount = d->tabs->count();
int page = currentIndex();
int dx = (e->key() == Qt::Key_Backtab || e->modifiers() & Qt::ShiftModifier) ? -1 : 1;
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right))
+ if (QApplicationPrivate::keypadNavigationEnabled() && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right))
dx = e->key() == (isRightToLeft() ? Qt::Key_Right : Qt::Key_Left) ? -1 : 1;
#endif
for (int pass = 0; pass < pageCount; ++pass) {
diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp
index bb9a4fed91..3e49390315 100644
--- a/src/widgets/widgets/qtextbrowser.cpp
+++ b/src/widgets/widgets/qtextbrowser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -42,6 +42,7 @@
#include <qstack.h>
#include <qapplication.h>
+#include <private/qapplication_p.h>
#include <qevent.h>
#include <qdesktopwidget.h>
#include <qdebug.h>
@@ -60,6 +61,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcBrowser, "qt.text.browser")
+
class QTextBrowserPrivate : public QTextEditPrivate
{
Q_DECLARE_PUBLIC(QTextBrowser)
@@ -83,6 +86,7 @@ public:
int hpos;
int vpos;
int focusIndicatorPosition, focusIndicatorAnchor;
+ QTextDocument::ResourceType type = QTextDocument::UnknownResource;
};
HistoryEntry history(int i) const
@@ -119,6 +123,8 @@ public:
bool openExternalLinks;
bool openLinks;
+ QTextDocument::ResourceType currentType;
+
#ifndef QT_NO_CURSOR
QCursor oldCursor;
#endif
@@ -134,7 +140,7 @@ public:
void _q_activateAnchor(const QString &href);
void _q_highlightLink(const QString &href);
- void setSource(const QUrl &url);
+ void setSource(const QUrl &url, QTextDocument::ResourceType type);
// re-imlemented from QTextEditPrivate
virtual QUrl resolveUrl(const QUrl &url) const override;
@@ -271,7 +277,7 @@ void QTextBrowserPrivate::_q_highlightLink(const QString &anchor)
}
}
-void QTextBrowserPrivate::setSource(const QUrl &url)
+void QTextBrowserPrivate::setSource(const QUrl &url, QTextDocument::ResourceType type)
{
Q_Q(QTextBrowser);
#ifndef QT_NO_CURSOR
@@ -288,20 +294,36 @@ void QTextBrowserPrivate::setSource(const QUrl &url)
currentUrlWithoutFragment.setFragment(QString());
QUrl newUrlWithoutFragment = currentURL.resolved(url);
newUrlWithoutFragment.setFragment(QString());
+ QString fileName = url.fileName();
+ if (type == QTextDocument::UnknownResource) {
+#if QT_CONFIG(textmarkdownreader)
+ if (fileName.endsWith(QLatin1String(".md")) ||
+ fileName.endsWith(QLatin1String(".mkd")) ||
+ fileName.endsWith(QLatin1String(".markdown")))
+ type = QTextDocument::MarkdownResource;
+ else
+#endif
+ type = QTextDocument::HtmlResource;
+ }
+ currentType = type;
if (url.isValid()
&& (newUrlWithoutFragment != currentUrlWithoutFragment || forceLoadOnSourceChange)) {
- QVariant data = q->loadResource(QTextDocument::HtmlResource, resolveUrl(url));
+ QVariant data = q->loadResource(type, resolveUrl(url));
if (data.type() == QVariant::String) {
txt = data.toString();
} else if (data.type() == QVariant::ByteArray) {
+ if (type == QTextDocument::HtmlResource) {
#if QT_CONFIG(textcodec)
- QByteArray ba = data.toByteArray();
- QTextCodec *codec = Qt::codecForHtml(ba);
- txt = codec->toUnicode(ba);
+ QByteArray ba = data.toByteArray();
+ QTextCodec *codec = Qt::codecForHtml(ba);
+ txt = codec->toUnicode(ba);
#else
- txt = data.toString();
+ txt = data.toString();
#endif
+ } else {
+ txt = QString::fromUtf8(data.toByteArray());
+ }
}
if (Q_UNLIKELY(txt.isEmpty()))
qWarning("QTextBrowser: No document for %s", url.toString().toLatin1().constData());
@@ -327,9 +349,21 @@ void QTextBrowserPrivate::setSource(const QUrl &url)
home = url;
if (doSetText) {
+ // Setting the base URL helps QTextDocument::resource() to find resources with relative paths.
+ // But don't set it unless it contains the document's path, because QTextBrowserPrivate::resolveUrl()
+ // can already deal with local files on the filesystem in case the base URL was not set.
+ QUrl baseUrl = currentURL.adjusted(QUrl::RemoveFilename);
+ if (!baseUrl.path().isEmpty())
+ q->document()->setBaseUrl(baseUrl);
+ q->document()->setMetaInformation(QTextDocument::DocumentUrl, currentURL.toString());
+ qCDebug(lcBrowser) << "loading" << currentURL << "base" << q->document()->baseUrl() << "type" << type << txt.size() << "chars";
+#if QT_CONFIG(textmarkdownreader)
+ if (type == QTextDocument::MarkdownResource)
+ q->QTextEdit::setMarkdown(txt);
+ else
+#endif
#ifndef QT_NO_TEXTHTMLPARSER
q->QTextEdit::setHtml(txt);
- q->document()->setMetaInformation(QTextDocument::DocumentUrl, currentURL.toString());
#else
q->QTextEdit::setPlainText(txt);
#endif
@@ -551,6 +585,7 @@ QTextBrowserPrivate::HistoryEntry QTextBrowserPrivate::createHistoryEntry() cons
{
HistoryEntry entry;
entry.url = q_func()->source();
+ entry.type = q_func()->sourceType();
entry.title = q_func()->documentTitle();
entry.hpos = hbar->value();
entry.vpos = vbar->value();
@@ -567,7 +602,7 @@ QTextBrowserPrivate::HistoryEntry QTextBrowserPrivate::createHistoryEntry() cons
void QTextBrowserPrivate::restoreHistoryEntry(const HistoryEntry &entry)
{
- setSource(entry.url);
+ setSource(entry.url, entry.type);
hbar->setValue(entry.hpos);
vbar->setValue(entry.vpos);
if (entry.focusIndicatorAnchor != -1 && entry.focusIndicatorPosition != -1) {
@@ -709,7 +744,13 @@ QTextBrowser::~QTextBrowser()
document is displayed as a popup rather than as new document in
the browser window itself. Otherwise, the document is displayed
normally in the text browser with the text set to the contents of
- the named document with setHtml().
+ the named document with \l QTextDocument::setHtml() or
+ \l QTextDocument::setMarkdown(), depending on whether the filename ends
+ with any of the known Markdown file extensions.
+
+ If you would like to avoid automatic type detection
+ and specify the type explicitly, call setSource() rather than
+ setting this property.
By default, this property contains an empty URL.
*/
@@ -723,6 +764,23 @@ QUrl QTextBrowser::source() const
}
/*!
+ \property QTextBrowser::sourceType
+ \brief the type of the displayed document
+
+ This is QTextDocument::UnknownResource if no document is displayed or if
+ the type of the source is unknown. Otherwise it holds the type that was
+ detected, or the type that was specified when setSource() was called.
+*/
+QTextDocument::ResourceType QTextBrowser::sourceType() const
+{
+ Q_D(const QTextBrowser);
+ if (d->stack.isEmpty())
+ return QTextDocument::UnknownResource;
+ else
+ return d->stack.top().type;
+}
+
+/*!
\property QTextBrowser::searchPaths
\brief the search paths used by the text browser to find supporting
content
@@ -752,16 +810,46 @@ void QTextBrowser::reload()
Q_D(QTextBrowser);
QUrl s = d->currentURL;
d->currentURL = QUrl();
- setSource(s);
+ setSource(s, d->currentType);
}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
void QTextBrowser::setSource(const QUrl &url)
{
+ setSource(url, QTextDocument::UnknownResource);
+}
+#endif
+
+/*!
+ Attempts to load the document at the given \a url with the specified \a type.
+
+ If \a type is \l {QTextDocument::ResourceType::UnknownResource}{UnknownResource}
+ (the default), the document type will be detected: that is, if the url ends
+ with an extension of \c{.md}, \c{.mkd} or \c{.markdown}, the document will be
+ loaded via \l QTextDocument::setMarkdown(); otherwise it will be loaded via
+ \l QTextDocument::setHtml(). This detection can be bypassed by specifying
+ the \a type explicitly.
+*/
+void QTextBrowser::setSource(const QUrl &url, QTextDocument::ResourceType type)
+{
+ doSetSource(url, type);
+}
+
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+/*!
+ Attempts to load the document at the given \a url with the specified \a type.
+
+ setSource() calls doSetSource. In Qt 5, setSource(const QUrl &url) was virtual.
+ In Qt 6, doSetSource() is virtual instead, so that it can be overridden in subclasses.
+*/
+#endif
+void QTextBrowser::doSetSource(const QUrl &url, QTextDocument::ResourceType type)
+{
Q_D(QTextBrowser);
const QTextBrowserPrivate::HistoryEntry historyEntry = d->createHistoryEntry();
- d->setSource(url);
+ d->setSource(url, type);
if (!url.isValid())
return;
@@ -775,6 +863,7 @@ void QTextBrowser::setSource(const QUrl &url)
QTextBrowserPrivate::HistoryEntry entry;
entry.url = url;
+ entry.type = d->currentType;
entry.title = documentTitle();
entry.hpos = 0;
entry.vpos = 0;
@@ -928,7 +1017,7 @@ void QTextBrowser::keyPressEvent(QKeyEvent *ev)
Q_D(QTextBrowser);
switch (ev->key()) {
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus()) {
setEditFocus(true);
return;
@@ -943,7 +1032,7 @@ void QTextBrowser::keyPressEvent(QKeyEvent *ev)
}
break;
case Qt::Key_Back:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (hasEditFocus()) {
setEditFocus(false);
ev->accept();
@@ -953,7 +1042,7 @@ void QTextBrowser::keyPressEvent(QKeyEvent *ev)
QTextEdit::keyPressEvent(ev);
return;
default:
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus()) {
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus()) {
ev->ignore();
return;
}
@@ -1086,6 +1175,7 @@ void QTextBrowser::paintEvent(QPaintEvent *e)
\row \li QTextDocument::HtmlResource \li QString or QByteArray
\row \li QTextDocument::ImageResource \li QImage, QPixmap or QByteArray
\row \li QTextDocument::StyleSheetResource \li QString or QByteArray
+ \row \li QTextDocument::MarkdownResource \li QString or QByteArray
\endtable
*/
QVariant QTextBrowser::loadResource(int /*type*/, const QUrl &name)
diff --git a/src/widgets/widgets/qtextbrowser.h b/src/widgets/widgets/qtextbrowser.h
index ea81256f50..33e5b3980c 100644
--- a/src/widgets/widgets/qtextbrowser.h
+++ b/src/widgets/widgets/qtextbrowser.h
@@ -55,6 +55,7 @@ class Q_WIDGETS_EXPORT QTextBrowser : public QTextEdit
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource)
+ Q_PROPERTY(QTextDocument::ResourceType sourceType READ sourceType)
Q_OVERRIDE(bool modified SCRIPTABLE false)
Q_OVERRIDE(bool readOnly DESIGNABLE false SCRIPTABLE false)
Q_OVERRIDE(bool undoRedoEnabled DESIGNABLE false SCRIPTABLE false)
@@ -67,6 +68,7 @@ public:
virtual ~QTextBrowser();
QUrl source() const;
+ QTextDocument::ResourceType sourceType() const;
QStringList searchPaths() const;
void setSearchPaths(const QStringList &paths);
@@ -88,7 +90,12 @@ public:
void setOpenLinks(bool open);
public Q_SLOTS:
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
virtual void setSource(const QUrl &name);
+ void setSource(const QUrl &name, QTextDocument::ResourceType type);
+#else
+ void setSource(const QUrl &name, QTextDocument::ResourceType type = QTextDocument::UnknownResource);
+#endif
virtual void backward();
virtual void forward();
virtual void home();
@@ -112,6 +119,10 @@ protected:
virtual void focusOutEvent(QFocusEvent *ev) override;
virtual bool focusNextPrevChild(bool next) override;
virtual void paintEvent(QPaintEvent *e) override;
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+ virtual
+#endif
+ void doSetSource(const QUrl &name, QTextDocument::ResourceType type = QTextDocument::UnknownResource);
private:
Q_DISABLE_COPY(QTextBrowser)
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 2b3a46ae56..dd2ea3f18f 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -70,6 +70,7 @@
#include <qtextformat.h>
#include <qdatetime.h>
#include <qapplication.h>
+#include <private/qapplication_p.h>
#include <limits.h>
#include <qtexttable.h>
#include <qvariant.h>
@@ -167,6 +168,9 @@ void QTextEditPrivate::init(const QString &html)
QObject::connect(control, SIGNAL(copyAvailable(bool)), q, SIGNAL(copyAvailable(bool)));
QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged()));
QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SLOT(_q_cursorPositionChanged()));
+#if QT_CONFIG(cursor)
+ QObject::connect(control, SIGNAL(blockMarkerHovered(QTextBlock)), q, SLOT(_q_hoveredBlockWithMarkerChanged(QTextBlock)));
+#endif
QObject::connect(control, SIGNAL(textChanged()), q, SLOT(updateMicroFocus()));
@@ -187,6 +191,7 @@ void QTextEditPrivate::init(const QString &html)
vbar->setSingleStep(20);
viewport->setBackgroundRole(QPalette::Base);
+ q->setMouseTracking(true);
q->setAcceptDrops(true);
q->setFocusPolicy(Qt::StrongFocus);
q->setAttribute(Qt::WA_KeyCompression);
@@ -195,9 +200,6 @@ void QTextEditPrivate::init(const QString &html)
#ifndef QT_NO_CURSOR
viewport->setCursor(Qt::IBeamCursor);
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- setSingleFingerPanEnabled(true);
-#endif
}
void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)
@@ -228,6 +230,23 @@ void QTextEditPrivate::_q_cursorPositionChanged()
#endif
}
+#if QT_CONFIG(cursor)
+void QTextEditPrivate::_q_hoveredBlockWithMarkerChanged(const QTextBlock &block)
+{
+ Q_Q(QTextEdit);
+ Qt::CursorShape cursor = cursorToRestoreAfterHover;
+ if (block.isValid() && !q->isReadOnly()) {
+ QTextBlockFormat::MarkerType marker = block.blockFormat().marker();
+ if (marker != QTextBlockFormat::MarkerType::NoMarker) {
+ if (viewport->cursor().shape() != Qt::PointingHandCursor)
+ cursorToRestoreAfterHover = viewport->cursor().shape();
+ cursor = Qt::PointingHandCursor;
+ }
+ }
+ viewport->setCursor(cursor);
+}
+#endif
+
void QTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCursor::MoveMode moveMode)
{
QTextCursor cursor = control->textCursor();
@@ -366,8 +385,8 @@ void QTextEditPrivate::_q_ensureVisible(const QRectF &_rect)
\section1 Introduction and Concepts
QTextEdit is an advanced WYSIWYG viewer/editor supporting rich
- text formatting using HTML-style tags. It is optimized to handle
- large documents and to respond quickly to user input.
+ text formatting using HTML-style tags, or Markdown format. It is optimized
+ to handle large documents and to respond quickly to user input.
QTextEdit works on paragraphs and characters. A paragraph is a
formatted string which is word-wrapped to fit into the width of
@@ -381,7 +400,7 @@ void QTextEditPrivate::_q_ensureVisible(const QRectF &_rect)
QTextEdit can display images, lists and tables. If the text is
too large to view within the text edit's viewport, scroll bars will
appear. The text edit can load both plain text and rich text files.
- Rich text is described using a subset of HTML 4 markup, refer to the
+ Rich text can be described using a subset of HTML 4 markup; refer to the
\l {Supported HTML Subset} page for more information.
If you just need to display a small piece of rich text use QLabel.
@@ -401,12 +420,19 @@ void QTextEditPrivate::_q_ensureVisible(const QRectF &_rect)
QTextEdit can display a large HTML subset, including tables and
images.
- The text is set or replaced using setHtml() which deletes any
+ The text can be set or replaced using \l setHtml() which deletes any
existing text and replaces it with the text passed in the
setHtml() call. If you call setHtml() with legacy HTML, and then
call toHtml(), the text that is returned may have different markup,
but will render the same. The entire text can be deleted with clear().
+ Text can also be set or replaced using \l setMarkdown(), and the same
+ caveats apply: if you then call \l toMarkdown(), the text that is returned
+ may be different, but the meaning is preserved as much as possible.
+ Markdown with some embedded HTML can be parsed, with the same limitations
+ that \l setHtml() has; but \l toMarkdown() only writes "pure" Markdown,
+ without any embedded HTML.
+
Text itself can be inserted using the QTextCursor class or using the
convenience functions insertHtml(), insertPlainText(), append() or
paste(). QTextCursor is also able to insert complex objects like tables
@@ -1089,7 +1115,7 @@ bool QTextEdit::event(QEvent *e)
#endif // QT_NO_CONTEXTMENU
#ifdef QT_KEYPAD_NAVIGATION
if (e->type() == QEvent::EnterEditFocus || e->type() == QEvent::LeaveEditFocus) {
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
d->sendControlEvent(e);
}
#endif
@@ -1214,6 +1240,56 @@ QString QTextEdit::toHtml() const
}
#endif
+#if QT_CONFIG(textmarkdownreader) && QT_CONFIG(textmarkdownwriter)
+/*!
+ \property QTextEdit::markdown
+
+ This property provides a Markdown interface to the text of the text edit.
+
+ \c toMarkdown() returns the text of the text edit as "pure" Markdown,
+ without any embedded HTML formatting. Some features that QTextDocument
+ supports (such as the use of specific colors and named fonts) cannot be
+ expressed in "pure" Markdown, and they will be omitted.
+
+ \c setMarkdown() changes the text of the text edit. Any previous text is
+ removed and the undo/redo history is cleared. The input text is
+ interpreted as rich text in Markdown format.
+
+ Parsing of HTML included in the \a markdown string is handled in the same
+ way as in \l setHtml; however, Markdown formatting inside HTML blocks is
+ not supported.
+
+ Some features of the parser can be enabled or disabled via the \a features
+ argument:
+
+ \value MarkdownNoHTML
+ Any HTML tags in the Markdown text will be discarded
+ \value MarkdownDialectCommonMark
+ The parser supports only the features standardized by CommonMark
+ \value MarkdownDialectGitHub
+ The parser supports the GitHub dialect
+
+ The default is \c MarkdownDialectGitHub.
+
+ \sa plainText, html, QTextDocument::toMarkdown(), QTextDocument::setMarkdown()
+*/
+#endif
+
+#if QT_CONFIG(textmarkdownreader)
+void QTextEdit::setMarkdown(const QString &markdown)
+{
+ Q_D(const QTextEdit);
+ d->control->setMarkdown(markdown);
+}
+#endif
+
+#if QT_CONFIG(textmarkdownwriter)
+QString QTextEdit::toMarkdown(QTextDocument::MarkdownFeatures features) const
+{
+ Q_D(const QTextEdit);
+ return d->control->toMarkdown(features);
+}
+#endif
/*! \reimp
*/
@@ -1224,7 +1300,7 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
switch (e->key()) {
case Qt::Key_Select:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// code assumes linksaccessible + editable isn't meaningful
if (d->control->textInteractionFlags() & Qt::TextEditable) {
setEditFocus(!hasEditFocus());
@@ -1245,14 +1321,14 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
break;
case Qt::Key_Back:
case Qt::Key_No:
- if (!QApplication::keypadNavigationEnabled()
- || (QApplication::keypadNavigationEnabled() && !hasEditFocus())) {
+ if (!QApplicationPrivate::keypadNavigationEnabled()
+ || (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus())) {
e->ignore();
return;
}
break;
default:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!hasEditFocus() && !(e->modifiers() & Qt::ControlModifier)) {
if (e->text()[0].isPrint())
setEditFocus(true);
@@ -1341,7 +1417,7 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
switch (e->key()) {
case Qt::Key_Up:
case Qt::Key_Down:
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
// Cursor position didn't change, so we want to leave
// these keys to change focus.
e->ignore();
@@ -1350,7 +1426,7 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
break;
case Qt::Key_Back:
if (!e->isAutoRepeat()) {
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (document()->isEmpty() || !(d->control->textInteractionFlags() & Qt::TextEditable)) {
setEditFocus(false);
e->accept();
@@ -1376,7 +1452,7 @@ void QTextEdit::keyReleaseEvent(QKeyEvent *e)
{
#ifdef QT_KEYPAD_NAVIGATION
Q_D(QTextEdit);
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (!e->isAutoRepeat() && e->key() == Qt::Key_Back
&& d->deleteAllTimer.isActive()) {
d->deleteAllTimer.stop();
@@ -1588,7 +1664,7 @@ void QTextEdit::mousePressEvent(QMouseEvent *e)
{
Q_D(QTextEdit);
#ifdef QT_KEYPAD_NAVIGATION
- if (QApplication::keypadNavigationEnabled() && !hasEditFocus())
+ if (QApplicationPrivate::keypadNavigationEnabled() && !hasEditFocus())
setEditFocus(true);
#endif
d->sendControlEvent(e);
@@ -1719,7 +1795,7 @@ void QTextEdit::inputMethodEvent(QInputMethodEvent *e)
Q_D(QTextEdit);
#ifdef QT_KEYPAD_NAVIGATION
if (d->control->textInteractionFlags() & Qt::TextEditable
- && QApplication::keypadNavigationEnabled()
+ && QApplicationPrivate::keypadNavigationEnabled()
&& !hasEditFocus())
setEditFocus(true);
#endif
@@ -2187,7 +2263,7 @@ void QTextEdit::setReadOnly(bool ro)
d->control->setTextInteractionFlags(flags);
setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));
QEvent event(QEvent::ReadOnlyChange);
- QApplication::sendEvent(this, &event);
+ QCoreApplication::sendEvent(this, &event);
}
/*!
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index 3aa23aaace..5c8a3c7793 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -71,6 +71,9 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea
QDOC_PROPERTY(QTextOption::WrapMode wordWrapMode READ wordWrapMode WRITE setWordWrapMode)
Q_PROPERTY(int lineWrapColumnOrWidth READ lineWrapColumnOrWidth WRITE setLineWrapColumnOrWidth)
Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
+#if QT_CONFIG(textmarkdownreader) && QT_CONFIG(textmarkdownwriter)
+ Q_PROPERTY(QString markdown READ toMarkdown WRITE setMarkdown NOTIFY textChanged)
+#endif
#ifndef QT_NO_TEXTHTMLPARSER
Q_PROPERTY(QString html READ toHtml WRITE setHtml NOTIFY textChanged USER true)
#endif
@@ -174,6 +177,9 @@ public:
#ifndef QT_NO_TEXTHTMLPARSER
QString toHtml() const;
#endif
+#if QT_CONFIG(textmarkdownwriter)
+ QString toMarkdown(QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub) const;
+#endif
void ensureCursorVisible();
@@ -238,6 +244,9 @@ public Q_SLOTS:
#ifndef QT_NO_TEXTHTMLPARSER
void setHtml(const QString &text);
#endif
+#if QT_CONFIG(textmarkdownreader)
+ void setMarkdown(const QString &markdown);
+#endif
void setText(const QString &text);
#ifndef QT_NO_CLIPBOARD
@@ -322,6 +331,9 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_adjustScrollbars())
Q_PRIVATE_SLOT(d_func(), void _q_ensureVisible(const QRectF &))
Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged())
+#if QT_CONFIG(cursor)
+ Q_PRIVATE_SLOT(d_func(), void _q_hoveredBlockWithMarkerChanged(const QTextBlock &))
+#endif
friend class QTextEditControl;
friend class QTextDocument;
friend class QWidgetTextControl;
diff --git a/src/widgets/widgets/qtextedit_p.h b/src/widgets/widgets/qtextedit_p.h
index c4ee75c78d..f7b4d15318 100644
--- a/src/widgets/widgets/qtextedit_p.h
+++ b/src/widgets/widgets/qtextedit_p.h
@@ -104,6 +104,7 @@ public:
void _q_currentCharFormatChanged(const QTextCharFormat &format);
void _q_cursorPositionChanged();
+ void _q_hoveredBlockWithMarkerChanged(const QTextBlock &block);
void updateDefaultTextOption();
@@ -136,6 +137,8 @@ public:
QString placeholderText;
+ Qt::CursorShape cursorToRestoreAfterHover = Qt::IBeamCursor;
+
#ifdef QT_KEYPAD_NAVIGATION
QBasicTimer deleteAllTimer;
#endif
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp
index bcf5a40ae3..58e9c4fd87 100644
--- a/src/widgets/widgets/qtoolbar.cpp
+++ b/src/widgets/widgets/qtoolbar.cpp
@@ -53,7 +53,6 @@
#if QT_CONFIG(rubberband)
#include <qrubberband.h>
#endif
-#include <qsignalmapper.h>
#include <qstylepainter.h>
#include <qstyleoption.h>
#include <qtoolbutton.h>
@@ -325,13 +324,8 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event)
event->y() >= 0 && event->y() < q->height());
startDrag(moving);
- if (!moving && !wasDragging) {
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- grabMouseWhileInWindow();
-#else
+ if (!moving && !wasDragging)
q->grabMouse();
-#endif
- }
}
if (state->dragging) {
@@ -1172,7 +1166,7 @@ bool QToolBar::event(QEvent *event)
// This is a workaround for loosing the mouse on Vista.
QPoint pos = QCursor::pos();
QMouseEvent fake(QEvent::MouseMove, mapFromGlobal(pos), pos, Qt::NoButton,
- QApplication::mouseButtons(), QApplication::keyboardModifiers());
+ QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers());
d->mouseMoveEvent(&fake);
#endif
} else {
diff --git a/src/widgets/widgets/qtoolbar_p.h b/src/widgets/widgets/qtoolbar_p.h
index 4db75762c8..8cb5850903 100644
--- a/src/widgets/widgets/qtoolbar_p.h
+++ b/src/widgets/widgets/qtoolbar_p.h
@@ -73,7 +73,7 @@ public:
: explicitIconSize(false), explicitToolButtonStyle(false), movable(true), floatable(true),
allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal),
toolButtonStyle(Qt::ToolButtonIconOnly),
- layout(0), state(0)
+ layout(nullptr), state(nullptr)
#ifdef Q_OS_OSX
, macWindowDragging(false)
#endif
diff --git a/src/widgets/widgets/qtoolbararealayout_p.h b/src/widgets/widgets/qtoolbararealayout_p.h
index 17747ef29b..5df95a3038 100644
--- a/src/widgets/widgets/qtoolbararealayout_p.h
+++ b/src/widgets/widgets/qtoolbararealayout_p.h
@@ -69,7 +69,7 @@ class QStyleOptionToolBar;
class QToolBarAreaLayoutItem
{
public:
- QToolBarAreaLayoutItem(QLayoutItem *item = 0)
+ QToolBarAreaLayoutItem(QLayoutItem *item = nullptr)
: widgetItem(item), pos(0), size(-1), preferredSize(-1), gap(false) {}
bool skip() const;
diff --git a/src/widgets/widgets/qtoolbarlayout_p.h b/src/widgets/widgets/qtoolbarlayout_p.h
index a788d30450..b5dc121b93 100644
--- a/src/widgets/widgets/qtoolbarlayout_p.h
+++ b/src/widgets/widgets/qtoolbarlayout_p.h
@@ -79,7 +79,7 @@ class QToolBarLayout : public QLayout
Q_OBJECT
public:
- QToolBarLayout(QWidget *parent = 0);
+ QToolBarLayout(QWidget *parent = nullptr);
~QToolBarLayout();
void addItem(QLayoutItem *item) override;
diff --git a/src/widgets/widgets/qtoolbox.cpp b/src/widgets/widgets/qtoolbox.cpp
index 1c83485bff..4d7f543a99 100644
--- a/src/widgets/widgets/qtoolbox.cpp
+++ b/src/widgets/widgets/qtoolbox.cpp
@@ -50,6 +50,8 @@
#include <qtooltip.h>
#include <qabstractbutton.h>
+#include <private/qmemory_p.h>
+
#include "qframe_p.h"
QT_BEGIN_NAMESPACE
@@ -106,7 +108,7 @@ public:
return widget == other.widget;
}
};
- typedef QList<Page> PageList;
+ typedef std::vector<std::unique_ptr<Page>> PageList;
inline QToolBoxPrivate()
: currentPage(0)
@@ -130,26 +132,27 @@ public:
const QToolBoxPrivate::Page *QToolBoxPrivate::page(const QObject *widget) const
{
if (!widget)
- return 0;
+ return nullptr;
- for (PageList::ConstIterator i = pageList.constBegin(); i != pageList.constEnd(); ++i)
- if ((*i).widget == widget)
- return (const Page*) &(*i);
- return 0;
+ for (const auto &page : pageList) {
+ if (page->widget == widget)
+ return page.get();
+ }
+ return nullptr;
}
QToolBoxPrivate::Page *QToolBoxPrivate::page(int index)
{
- if (index >= 0 && index < pageList.size())
- return &pageList[index];
- return 0;
+ if (index >= 0 && index < static_cast<int>(pageList.size()))
+ return pageList[index].get();
+ return nullptr;
}
const QToolBoxPrivate::Page *QToolBoxPrivate::page(int index) const
{
- if (index >= 0 && index < pageList.size())
- return &pageList.at(index);
- return 0;
+ if (index >= 0 && index < static_cast<int>(pageList.size()))
+ return pageList[index].get();
+ return nullptr;
}
void QToolBoxPrivate::updateTabs()
@@ -157,13 +160,12 @@ void QToolBoxPrivate::updateTabs()
QToolBoxButton *lastButton = currentPage ? currentPage->button : 0;
bool after = false;
int index = 0;
- for (index = 0; index < pageList.count(); ++index) {
- const Page &page = pageList.at(index);
- QToolBoxButton *tB = page.button;
+ for (const auto &page : pageList) {
+ QToolBoxButton *tB = page->button;
// update indexes, since the updates are delayed, the indexes will be correct
// when we actually paint.
tB->setIndex(index);
- QWidget *tW = page.widget;
+ QWidget *tW = page->widget;
if (after) {
QPalette p = tB->palette();
p.setColor(tB->backgroundRole(), tW->palette().color(tW->backgroundRole()));
@@ -174,6 +176,7 @@ void QToolBoxPrivate::updateTabs()
tB->update();
}
after = tB == lastButton;
+ ++index;
}
}
@@ -345,7 +348,8 @@ int QToolBox::insertItem(int index, QWidget *widget, const QIcon &icon, const QS
Q_D(QToolBox);
connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(_q_widgetDestroyed(QObject*)));
- QToolBoxPrivate::Page c;
+ auto newPage = qt_make_unique<QToolBoxPrivate::Page>();
+ auto &c = *newPage;
c.widget = widget;
c.button = new QToolBoxButton(this);
c.button->setObjectName(QLatin1String("qt_toolbox_toolboxbutton"));
@@ -360,15 +364,15 @@ int QToolBox::insertItem(int index, QWidget *widget, const QIcon &icon, const QS
c.setText(text);
c.setIcon(icon);
- if (index < 0 || index >= (int)d->pageList.count()) {
- index = d->pageList.count();
- d->pageList.append(c);
+ if (index < 0 || index >= static_cast<int>(d->pageList.size())) {
+ index = static_cast<int>(d->pageList.size());
+ d->pageList.push_back(std::move(newPage));
d->layout->addWidget(c.button);
d->layout->addWidget(c.sv);
if (index == 0)
setCurrentIndex(index);
} else {
- d->pageList.insert(index, c);
+ d->pageList.insert(d->pageList.cbegin() + index, std::move(newPage));
d->relayout();
if (d->currentPage) {
QWidget *current = d->currentPage->widget;
@@ -391,12 +395,13 @@ void QToolBoxPrivate::_q_buttonClicked()
{
Q_Q(QToolBox);
QToolBoxButton *tb = qobject_cast<QToolBoxButton*>(q->sender());
- QWidget* item = 0;
- for (QToolBoxPrivate::PageList::ConstIterator i = pageList.constBegin(); i != pageList.constEnd(); ++i)
- if ((*i).button == tb) {
- item = (*i).widget;
+ QWidget* item = nullptr;
+ for (const auto &page : pageList) {
+ if (page->button == tb) {
+ item = page->widget;
break;
}
+ }
q->setCurrentIndex(q->indexOf(item));
}
@@ -411,7 +416,7 @@ void QToolBoxPrivate::_q_buttonClicked()
int QToolBox::count() const
{
Q_D(const QToolBox);
- return d->pageList.count();
+ return static_cast<int>(d->pageList.size());
}
void QToolBox::setCurrentIndex(int index)
@@ -438,12 +443,18 @@ void QToolBoxPrivate::relayout()
delete layout;
layout = new QVBoxLayout(q);
layout->setContentsMargins(QMargins());
- for (QToolBoxPrivate::PageList::ConstIterator i = pageList.constBegin(); i != pageList.constEnd(); ++i) {
- layout->addWidget((*i).button);
- layout->addWidget((*i).sv);
+ for (const auto &page : pageList) {
+ layout->addWidget(page->button);
+ layout->addWidget(page->sv);
}
}
+auto pageEquals = [](const QToolBoxPrivate::Page *page) {
+ return [page](const std::unique_ptr<QToolBoxPrivate::Page> &ptr) {
+ return ptr.get() == page;
+ };
+};
+
void QToolBoxPrivate::_q_widgetDestroyed(QObject *object)
{
Q_Q(QToolBox);
@@ -458,9 +469,9 @@ void QToolBoxPrivate::_q_widgetDestroyed(QObject *object)
delete c->button;
bool removeCurrent = c == currentPage;
- pageList.removeAll(*c);
+ pageList.erase(std::remove_if(pageList.begin(), pageList.end(), pageEquals(c)), pageList.end());
- if (!pageList.count()) {
+ if (pageList.empty()) {
currentPage = 0;
emit q->currentChanged(-1);
} else if (removeCurrent) {
@@ -538,9 +549,9 @@ void QToolBox::setCurrentWidget(QWidget *widget)
QWidget *QToolBox::widget(int index) const
{
Q_D(const QToolBox);
- if (index < 0 || index >= (int) d->pageList.size())
+ if (index < 0 || index >= static_cast<int>(d->pageList.size()))
return nullptr;
- return d->pageList.at(index).widget;
+ return d->pageList[index]->widget;
}
/*!
@@ -552,7 +563,12 @@ int QToolBox::indexOf(QWidget *widget) const
{
Q_D(const QToolBox);
const QToolBoxPrivate::Page *c = (widget ? d->page(widget) : 0);
- return c ? d->pageList.indexOf(*c) : -1;
+ if (!c)
+ return -1;
+ const auto it = std::find_if(d->pageList.cbegin(), d->pageList.cend(), pageEquals(c));
+ if (it == d->pageList.cend())
+ return -1;
+ return static_cast<int>(it - d->pageList.cbegin());
}
/*!
@@ -571,7 +587,7 @@ void QToolBox::setItemEnabled(int index, bool enabled)
if (!enabled && c == d->currentPage) {
int curIndexUp = index;
int curIndexDown = curIndexUp;
- const int count = d->pageList.count();
+ const int count = static_cast<int>(d->pageList.size());
while (curIndexUp > 0 || curIndexDown < count-1) {
if (curIndexDown < count-1) {
if (d->page(++curIndexDown)->button->isEnabled()) {
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index cf2d885b52..9cdae4f28f 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -54,6 +54,7 @@
#endif
#include "qapplication.h"
+#include "private/qapplication_p.h"
#if QT_CONFIG(graphicsview)
#include "qgraphicssceneevent.h"
#endif
@@ -77,11 +78,6 @@ int QWidgetLineControl::redoTextLayout() const
QTextLine l = m_textLayout.createLine();
m_textLayout.endLayout();
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (m_threadChecks)
- m_textLayoutThread = QThread::currentThread();
-#endif
-
return qRound(l.ascent());
}
@@ -158,7 +154,7 @@ void QWidgetLineControl::copy(QClipboard::Mode mode) const
{
QString t = selectedText();
if (!t.isEmpty() && m_echoMode == QLineEdit::Normal) {
- QApplication::clipboard()->setText(t, mode);
+ QGuiApplication::clipboard()->setText(t, mode);
}
}
@@ -172,7 +168,7 @@ void QWidgetLineControl::copy(QClipboard::Mode mode) const
*/
void QWidgetLineControl::paste(QClipboard::Mode clipboardMode)
{
- QString clip = QApplication::clipboard()->text(clipboardMode);
+ QString clip = QGuiApplication::clipboard()->text(clipboardMode);
if (!clip.isEmpty() || hasSelectedText()) {
separate(); //make it a separate undo/redo command
insert(clip);
@@ -1524,9 +1520,9 @@ void QWidgetLineControl::setBlinkingCursorEnabled(bool enable)
m_blinkEnabled = enable;
if (enable)
- connect(qApp->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetLineControl::updateCursorBlinking);
+ connect(QGuiApplication::styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetLineControl::updateCursorBlinking);
else
- disconnect(qApp->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetLineControl::updateCursorBlinking);
+ disconnect(QGuiApplication::styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetLineControl::updateCursorBlinking);
updateCursorBlinking();
}
@@ -1662,7 +1658,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
case Qt::Key_F4:
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Select:
- if (!QApplication::keypadNavigationEnabled())
+ if (!QApplicationPrivate::keypadNavigationEnabled())
break;
#endif
if (!m_completer->currentCompletion().isEmpty() && hasSelectedText()
@@ -1680,7 +1676,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
if (hasAcceptableInput() || fixup()) {
- QInputMethod *inputMethod = QApplication::inputMethod();
+ QInputMethod *inputMethod = QGuiApplication::inputMethod();
inputMethod->commit();
QWidget *lineEdit = qobject_cast<QWidget *>(parent());
if (!(lineEdit && lineEdit->inputMethodHints() & Qt::ImhMultiLine))
@@ -1912,7 +1908,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
break;
#ifdef QT_KEYPAD_NAVIGATION
case Qt::Key_Back:
- if (QApplication::keypadNavigationEnabled() && !event->isAutoRepeat()
+ if (QApplicationPrivate::keypadNavigationEnabled() && !event->isAutoRepeat()
&& !isReadOnly()) {
if (text().length() == 0) {
setText(m_cancelText);
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index f4df95865d..8ebed25084 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -91,19 +91,15 @@ public:
m_dragEnabled(0), m_echoMode(0), m_textDirty(0), m_selDirty(0),
m_validInput(1), m_blinkStatus(0), m_blinkEnabled(false), m_blinkTimer(0), m_deleteAllTimer(0),
m_ascent(0), m_maxLength(32767), m_lastCursorPos(-1),
- m_tripleClickTimer(0), m_maskData(0), m_modifiedState(0), m_undoState(0),
+ m_tripleClickTimer(0), m_maskData(nullptr), m_modifiedState(0), m_undoState(0),
m_selstart(0), m_selend(0), m_passwordEchoEditing(false)
, m_passwordEchoTimer(0)
, m_passwordMaskDelay(-1)
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- , m_threadChecks(false)
- , m_textLayoutThread(0)
- #endif
#if defined(QT_BUILD_INTERNAL)
, m_passwordMaskDelayOverride(-1)
#endif
, m_keyboardScheme(0)
- , m_accessibleObject(0)
+ , m_accessibleObject(nullptr)
{
init(txt);
}
@@ -404,25 +400,9 @@ public:
QTextLayout *textLayout() const
{
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- if (m_threadChecks && QThread::currentThread() != m_textLayoutThread)
- redoTextLayout();
-#endif
return &m_textLayout;
}
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- void setThreadChecks(bool threadChecks)
- {
- m_threadChecks = threadChecks;
- }
-
- bool threadChecks() const
- {
- return m_threadChecks;
- }
-#endif
-
private:
void init(const QString &txt);
void removeSelectedText();
@@ -534,10 +514,6 @@ private:
}
int redoTextLayout() const;
-#if 0 // Used to be included in Qt4 for Q_WS_MAC
- bool m_threadChecks;
- mutable QThread *m_textLayoutThread;
-#endif
public:
#if defined(QT_BUILD_INTERNAL)
diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp
index e8d435429f..9dbba12aba 100644
--- a/src/widgets/widgets/qwidgetresizehandler.cpp
+++ b/src/widgets/widgets/qwidgetresizehandler.cpp
@@ -124,21 +124,6 @@ bool QWidgetResizeHandler::eventFilter(QObject *o, QEvent *ee)
if (!widgetRect.contains(cursorPoint))
return false;
if (e->button() == Qt::LeftButton) {
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- /*
- Implicit grabs do not stop the X server from changing
- the cursor in children, which looks *really* bad when
- doing resizingk, so we grab the cursor. Note that we do
- not do this on Windows since double clicks are lost due
- to the grab (see change 198463).
- */
- if (e->spontaneous())
-# if !defined(QT_NO_CURSOR)
- widget->grabMouse(widget->cursor());
-# else
- widget->grabMouse();
-# endif // QT_NO_CURSOR
-#endif
buttonDown = false;
emit activate();
bool me = movingEnabled;
diff --git a/src/widgets/widgets/qwidgetresizehandler_p.h b/src/widgets/widgets/qwidgetresizehandler_p.h
index 89bc759cc2..df3ac7cb8a 100644
--- a/src/widgets/widgets/qwidgetresizehandler_p.h
+++ b/src/widgets/widgets/qwidgetresizehandler_p.h
@@ -73,7 +73,7 @@ public:
Any = Move|Resize
};
- explicit QWidgetResizeHandler(QWidget *parent, QWidget *cw = 0);
+ explicit QWidgetResizeHandler(QWidget *parent, QWidget *cw = nullptr);
void setActive(bool b) { setActive(Any, b); }
void setActive(Action ac, bool b);
bool isActive() const { return isActive(Any); }
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index f86a747b0f..1c169c3325 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -55,6 +55,7 @@
#endif
#include <qstyle.h>
#include <qtimer.h>
+#include "private/qapplication_p.h"
#include "private/qtextdocumentlayout_p.h"
#include "private/qabstracttextdocumentlayout_p.h"
#include "qtextdocument.h"
@@ -97,7 +98,7 @@
#include <qkeysequence.h>
#define ACCEL_KEY(k) ((!QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus) \
&& QGuiApplication::styleHints()->showShortcutsInContextMenus()) \
- && !qApp->d_func()->shortcutMap.hasShortcutForKeySequence(k) ? \
+ && !QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(k) ? \
QLatin1Char('\t') + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
#else
@@ -294,7 +295,7 @@ bool QWidgetTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
bool isNavigationEvent = e->key() == Qt::Key_Up || e->key() == Qt::Key_Down;
#ifdef QT_KEYPAD_NAVIGATION
- ignoreNavigationEvents = ignoreNavigationEvents || QApplication::keypadNavigationEnabled();
+ ignoreNavigationEvents = ignoreNavigationEvents || QApplicationPrivate::keypadNavigationEnabled();
isNavigationEvent = isNavigationEvent ||
(QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional
&& (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right));
@@ -494,6 +495,11 @@ void QWidgetTextControlPrivate::setContent(Qt::TextFormat format, const QString
formatCursor.select(QTextCursor::Document);
formatCursor.setCharFormat(charFormatForInsertion);
formatCursor.endEditBlock();
+#if QT_CONFIG(textmarkdownreader)
+ } else if (format == Qt::MarkdownText) {
+ doc->setMarkdown(text);
+ doc->setUndoRedoEnabled(false);
+#endif
} else {
#ifndef QT_NO_TEXTHTMLPARSER
doc->setHtml(text);
@@ -643,7 +649,7 @@ void QWidgetTextControlPrivate::_q_updateCurrentCharFormatAndSelection()
#ifndef QT_NO_CLIPBOARD
void QWidgetTextControlPrivate::setClipboardSelection()
{
- QClipboard *clipboard = QApplication::clipboard();
+ QClipboard *clipboard = QGuiApplication::clipboard();
if (!cursor.hasSelection() || !clipboard->supportsSelection())
return;
Q_Q(QWidgetTextControl);
@@ -714,9 +720,9 @@ void QWidgetTextControlPrivate::setCursorVisible(bool visible)
updateCursorBlinking();
if (cursorVisible)
- connect(qApp->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetTextControlPrivate::updateCursorBlinking);
+ connect(QGuiApplication::styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetTextControlPrivate::updateCursorBlinking);
else
- disconnect(qApp->styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetTextControlPrivate::updateCursorBlinking);
+ disconnect(QGuiApplication::styleHints(), &QStyleHints::cursorFlashTimeChanged, this, &QWidgetTextControlPrivate::updateCursorBlinking);
}
void QWidgetTextControlPrivate::updateCursorBlinking()
@@ -954,12 +960,12 @@ void QWidgetTextControl::copy()
if (!d->cursor.hasSelection())
return;
QMimeData *data = createMimeDataFromSelection();
- QApplication::clipboard()->setMimeData(data);
+ QGuiApplication::clipboard()->setMimeData(data);
}
void QWidgetTextControl::paste(QClipboard::Mode mode)
{
- const QMimeData *md = QApplication::clipboard()->mimeData(mode);
+ const QMimeData *md = QGuiApplication::clipboard()->mimeData(mode);
if (md)
insertFromMimeData(md);
}
@@ -1154,7 +1160,7 @@ void QWidgetTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget
#ifdef QT_KEYPAD_NAVIGATION
case QEvent::EnterEditFocus:
case QEvent::LeaveEditFocus:
- if (QApplication::keypadNavigationEnabled())
+ if (QApplicationPrivate::keypadNavigationEnabled())
d->editFocusEvent(e);
break;
#endif
@@ -1197,6 +1203,14 @@ void QWidgetTextControl::setPlainText(const QString &text)
d->setContent(Qt::PlainText, text);
}
+#if QT_CONFIG(textmarkdownreader)
+void QWidgetTextControl::setMarkdown(const QString &text)
+{
+ Q_D(QWidgetTextControl);
+ d->setContent(Qt::MarkdownText, text);
+}
+#endif
+
void QWidgetTextControl::setHtml(const QString &text)
{
Q_D(QWidgetTextControl);
@@ -1571,6 +1585,11 @@ void QWidgetTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton butto
e->ignore();
return;
}
+ bool wasValid = blockWithMarkerUnderMouse.isValid();
+ blockWithMarkerUnderMouse = q->blockWithMarkerAt(pos);
+ if (wasValid != blockWithMarkerUnderMouse.isValid())
+ emit q->blockMarkerHovered(blockWithMarkerUnderMouse);
+
cursorIsFocusIndicator = false;
const QTextCursor oldSelection = cursor;
@@ -1589,6 +1608,8 @@ void QWidgetTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton butto
selectedBlockOnTrippleClick = cursor;
anchorOnMousePress = QString();
+ blockWithMarkerUnderMouse = QTextBlock();
+ emit q->blockMarkerHovered(blockWithMarkerUnderMouse);
trippleClickTimer.stop();
} else {
@@ -1728,6 +1749,11 @@ void QWidgetTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button
}
selectionChanged(true);
repaintOldAndNewSelection(oldSelection);
+ } else {
+ bool wasValid = blockWithMarkerUnderMouse.isValid();
+ blockWithMarkerUnderMouse = q->blockWithMarkerAt(mousePos);
+ if (wasValid != blockWithMarkerUnderMouse.isValid())
+ emit q->blockMarkerHovered(blockWithMarkerUnderMouse);
}
sendMouseEventToInputContext(e, QEvent::MouseMove, button, mousePos, modifiers, buttons, globalPos);
@@ -1762,9 +1788,9 @@ void QWidgetTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton but
selectionChanged(true);
} else if (button == Qt::MidButton
&& (interactionFlags & Qt::TextEditable)
- && QApplication::clipboard()->supportsSelection()) {
+ && QGuiApplication::clipboard()->supportsSelection()) {
setCursorPosition(pos);
- const QMimeData *md = QApplication::clipboard()->mimeData(QClipboard::Selection);
+ const QMimeData *md = QGuiApplication::clipboard()->mimeData(QClipboard::Selection);
if (md)
q->insertFromMimeData(md);
#endif
@@ -1777,6 +1803,26 @@ void QWidgetTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton but
emit q->microFocusChanged();
}
+ // toggle any checkbox that the user clicks
+ if ((interactionFlags & Qt::TextEditable) && (button & Qt::LeftButton) &&
+ (blockWithMarkerUnderMouse.isValid()) && !cursor.hasSelection()) {
+ QTextBlock markerBlock = q->blockWithMarkerAt(pos);
+ if (markerBlock == blockWithMarkerUnderMouse) {
+ auto fmt = blockWithMarkerUnderMouse.blockFormat();
+ switch (fmt.marker()) {
+ case QTextBlockFormat::MarkerType::Unchecked :
+ fmt.setMarker(QTextBlockFormat::MarkerType::Checked);
+ break;
+ case QTextBlockFormat::MarkerType::Checked:
+ fmt.setMarker(QTextBlockFormat::MarkerType::Unchecked);
+ break;
+ default:
+ break;
+ }
+ cursor.setBlockFormat(fmt);
+ }
+ }
+
if (interactionFlags & Qt::LinksAccessibleByMouse) {
if (!(button & Qt::LeftButton))
return;
@@ -2173,7 +2219,7 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e)
emit q->updateRequest(q->selectionRect());
if (e->gotFocus()) {
#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason))) {
+ if (!QApplicationPrivate::keypadNavigationEnabled() || (hasEditFocus && (e->reason() == Qt::PopupFocusReason))) {
#endif
cursorOn = (interactionFlags & (Qt::TextSelectableByKeyboard | Qt::TextEditable));
if (interactionFlags & Qt::TextEditable) {
@@ -2214,7 +2260,7 @@ void QWidgetTextControlPrivate::editFocusEvent(QEvent *e)
{
Q_Q(QWidgetTextControl);
- if (QApplication::keypadNavigationEnabled()) {
+ if (QApplicationPrivate::keypadNavigationEnabled()) {
if (e->type() == QEvent::EnterEditFocus && interactionFlags & Qt::TextEditable) {
const QTextCursor oldSelection = cursor;
const int oldCursorPos = cursor.position();
@@ -2316,6 +2362,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
a = menu->addAction(tr("Select All") + ACCEL_KEY(QKeySequence::SelectAll), this, SLOT(selectAll()));
a->setEnabled(!d->doc->isEmpty());
a->setObjectName(QStringLiteral("select-all"));
+ setActionIcon(a, QStringLiteral("edit-select-all"));
}
if ((d->interactionFlags & Qt::TextEditable) && QGuiApplication::styleHints()->useRtlExtensions()) {
@@ -2375,6 +2422,12 @@ QString QWidgetTextControl::anchorAtCursor() const
return d->anchorForCursor(d->cursor);
}
+QTextBlock QWidgetTextControl::blockWithMarkerAt(const QPointF &pos) const
+{
+ Q_D(const QWidgetTextControl);
+ return d->doc->documentLayout()->blockWithMarkerAt(pos);
+}
+
bool QWidgetTextControl::overwriteMode() const
{
Q_D(const QWidgetTextControl);
@@ -2428,10 +2481,10 @@ void QWidgetTextControl::setExtraSelections(const QList<QTextEdit::ExtraSelectio
{
Q_D(QWidgetTextControl);
- QHash<int, int> hash;
+ QMultiHash<int, int> hash;
for (int i = 0; i < d->extraSelections.count(); ++i) {
const QAbstractTextDocumentLayout::Selection &esel = d->extraSelections.at(i);
- hash.insertMulti(esel.cursor.anchor(), i);
+ hash.insert(esel.cursor.anchor(), i);
}
for (int i = 0; i < selections.count(); ++i) {
@@ -2547,7 +2600,7 @@ bool QWidgetTextControl::canPaste() const
#ifndef QT_NO_CLIPBOARD
Q_D(const QWidgetTextControl);
if (d->interactionFlags & Qt::TextEditable) {
- const QMimeData *md = QApplication::clipboard()->mimeData();
+ const QMimeData *md = QGuiApplication::clipboard()->mimeData();
return md && canInsertFromMimeData(md);
}
#endif
@@ -3124,6 +3177,13 @@ QString QWidgetTextControl::toHtml() const
}
#endif
+#if QT_CONFIG(textmarkdownwriter)
+QString QWidgetTextControl::toMarkdown(QTextDocument::MarkdownFeatures features) const
+{
+ return document()->toMarkdown(features);
+}
+#endif
+
void QWidgetTextControlPrivate::append(const QString &text, Qt::TextFormat format)
{
QTextCursor tmp(doc);
@@ -3222,7 +3282,7 @@ QAbstractTextDocumentLayout::PaintContext QWidgetTextControl::getPaintContext(QW
if (!d->dndFeedbackCursor.isNull())
ctx.cursorPosition = d->dndFeedbackCursor.position();
#ifdef QT_KEYPAD_NAVIGATION
- if (!QApplication::keypadNavigationEnabled() || d->hasEditFocus)
+ if (!QApplicationPrivate::keypadNavigationEnabled() || d->hasEditFocus)
#endif
if (d->cursor.hasSelection()) {
QAbstractTextDocumentLayout::Selection selection;
@@ -3273,7 +3333,7 @@ void QWidgetTextControlPrivate::_q_copyLink()
#ifndef QT_NO_CLIPBOARD
QMimeData *md = new QMimeData;
md->setText(linkToCopy);
- QApplication::clipboard()->setMimeData(md);
+ QGuiApplication::clipboard()->setMimeData(md);
#endif
}
diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h
index 202ba36454..59bf5466e6 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -97,9 +97,9 @@ class Q_WIDGETS_EXPORT QWidgetTextControl : public QInputControl
Q_PROPERTY(bool openExternalLinks READ openExternalLinks WRITE setOpenExternalLinks)
Q_PROPERTY(bool ignoreUnusedNavigationEvents READ ignoreUnusedNavigationEvents WRITE setIgnoreUnusedNavigationEvents)
public:
- explicit QWidgetTextControl(QObject *parent = 0);
- explicit QWidgetTextControl(const QString &text, QObject *parent = 0);
- explicit QWidgetTextControl(QTextDocument *doc, QObject *parent = 0);
+ explicit QWidgetTextControl(QObject *parent = nullptr);
+ explicit QWidgetTextControl(const QString &text, QObject *parent = nullptr);
+ explicit QWidgetTextControl(QTextDocument *doc, QObject *parent = nullptr);
virtual ~QWidgetTextControl();
void setDocument(QTextDocument *document);
@@ -116,18 +116,21 @@ public:
void setCurrentCharFormat(const QTextCharFormat &format);
QTextCharFormat currentCharFormat() const;
- bool find(const QString &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QString &exp, QTextDocument::FindFlags options = nullptr);
#ifndef QT_NO_REGEXP
- bool find(const QRegExp &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QRegExp &exp, QTextDocument::FindFlags options = nullptr);
#endif
#if QT_CONFIG(regularexpression)
- bool find(const QRegularExpression &exp, QTextDocument::FindFlags options = 0);
+ bool find(const QRegularExpression &exp, QTextDocument::FindFlags options = nullptr);
#endif
QString toPlainText() const;
#ifndef QT_NO_TEXTHTMLPARSER
QString toHtml() const;
#endif
+#if QT_CONFIG(textmarkdownwriter)
+ QString toMarkdown(QTextDocument::MarkdownFeatures features = QTextDocument::MarkdownDialectGitHub) const;
+#endif
virtual void ensureCursorVisible();
@@ -147,6 +150,8 @@ public:
QString anchorAtCursor() const;
+ QTextBlock blockWithMarkerAt(const QPointF &pos) const;
+
bool overwriteMode() const;
void setOverwriteMode(bool overwrite);
@@ -194,6 +199,9 @@ public:
public Q_SLOTS:
void setPlainText(const QString &text);
+#if QT_CONFIG(textmarkdownreader)
+ void setMarkdown(const QString &text);
+#endif
void setHtml(const QString &text);
#ifndef QT_NO_CLIPBOARD
@@ -236,6 +244,7 @@ Q_SIGNALS:
void microFocusChanged();
void linkActivated(const QString &link);
void linkHovered(const QString &);
+ void blockMarkerHovered(const QTextBlock &block);
void modificationChanged(bool m);
public:
@@ -243,11 +252,11 @@ public:
QPalette palette() const;
void setPalette(const QPalette &pal);
- virtual void processEvent(QEvent *e, const QMatrix &matrix, QWidget *contextWidget = 0);
- void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF(), QWidget *contextWidget = 0);
+ virtual void processEvent(QEvent *e, const QMatrix &matrix, QWidget *contextWidget = nullptr);
+ void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF(), QWidget *contextWidget = nullptr);
// control methods
- void drawContents(QPainter *painter, const QRectF &rect = QRectF(), QWidget *widget = 0);
+ void drawContents(QPainter *painter, const QRectF &rect = QRectF(), QWidget *widget = nullptr);
void setFocus(bool focus, Qt::FocusReason = Qt::OtherFocusReason);
diff --git a/src/widgets/widgets/qwidgettextcontrol_p_p.h b/src/widgets/widgets/qwidgettextcontrol_p_p.h
index 232dab180f..c77a31bedf 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -55,6 +55,7 @@
#include "QtGui/qtextdocumentfragment.h"
#include "QtGui/qtextcursor.h"
#include "QtGui/qtextformat.h"
+#include "QtGui/qtextobject.h"
#if QT_CONFIG(menu)
#include "QtWidgets/qmenu.h"
#endif
@@ -89,9 +90,9 @@ public:
void createAutoBulletList();
void init(Qt::TextFormat format = Qt::RichText, const QString &text = QString(),
- QTextDocument *document = 0);
+ QTextDocument *document = nullptr);
void setContent(Qt::TextFormat format = Qt::RichText, const QString &text = QString(),
- QTextDocument *document = 0);
+ QTextDocument *document = nullptr);
void startDrag();
void paste(const QMimeData *source);
@@ -227,6 +228,7 @@ public:
QString highlightedAnchor; // Anchor below cursor
QString anchorOnMousePress;
+ QTextBlock blockWithMarkerUnderMouse;
bool hadSelectionOnMousePress;
bool ignoreUnusedNavigationEvents;
diff --git a/src/winmain/winmain.pro b/src/winmain/winmain.pro
index 9cb6ab0c59..1f54c846ec 100644
--- a/src/winmain/winmain.pro
+++ b/src/winmain/winmain.pro
@@ -23,7 +23,7 @@ winrt {
} else {
CONFIG -= qt
SOURCES = qtmain_win.cpp
- LIBS += -lshell32
+ QMAKE_USE_PRIVATE += shell32
}
load(qt_installs)
diff --git a/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp b/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp
index 2d18e0e537..f7d81f676f 100644
--- a/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp
+++ b/src/xml/doc/snippets/code/src_xml_dom_qdom.cpp
@@ -74,7 +74,7 @@ QDomNode n = d.firstChild();
while (!n.isNull()) {
if (n.isElement()) {
QDomElement e = n.toElement();
- cout << "Element name: " << e.tagName() << endl;
+ cout << "Element name: " << e.tagName() << Qt::endl;
break;
}
n = n.nextSibling();
@@ -126,10 +126,10 @@ QDomElement element4 = document.createElement("MyElement");
QDomElement e = //...
//...
QDomAttr a = e.attributeNode("href");
-cout << a.value() << endl; // prints "http://qt-project.org"
+cout << a.value() << Qt::endl; // prints "http://qt-project.org"
a.setValue("http://qt-project.org/doc"); // change the node's attribute
QDomAttr a2 = e.attributeNode("href");
-cout << a2.value() << endl; // prints "http://qt-project.org/doc"
+cout << a2.value() << Qt::endl; // prints "http://qt-project.org/doc"
//! [8]
@@ -201,7 +201,7 @@ QDomNode n = docElem.firstChild();
while(!n.isNull()) {
QDomElement e = n.toElement(); // try to convert the node to an element.
if(!e.isNull()) {
- cout << qPrintable(e.tagName()) << endl; // the node really is an element.
+ cout << qPrintable(e.tagName()) << Qt::endl; // the node really is an element.
}
n = n.nextSibling();
}
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 0516d426e5..8d232237bf 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -136,7 +136,7 @@ public:
class QDomNodePrivate
{
public:
- QDomNodePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0);
+ QDomNodePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = nullptr);
QDomNodePrivate(QDomNodePrivate* n, bool deep);
virtual ~QDomNodePrivate();
@@ -159,11 +159,11 @@ public:
virtual void normalize();
virtual void clear();
- inline QDomNodePrivate* parent() const { return hasParent ? ownerNode : 0; }
+ inline QDomNodePrivate* parent() const { return hasParent ? ownerNode : nullptr; }
inline void setParent(QDomNodePrivate *p) { ownerNode = p; hasParent = true; }
void setNoParent() {
- ownerNode = hasParent ? (QDomNodePrivate*)ownerDocument() : 0;
+ ownerNode = hasParent ? (QDomNodePrivate*)ownerDocument() : nullptr;
hasParent = false;
}
@@ -289,7 +289,7 @@ public:
class QDomDocumentTypePrivate : public QDomNodePrivate
{
public:
- QDomDocumentTypePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0);
+ QDomDocumentTypePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = nullptr);
QDomDocumentTypePrivate(QDomDocumentTypePrivate* n, bool deep);
~QDomDocumentTypePrivate();
void init();
@@ -317,7 +317,7 @@ public:
class QDomDocumentFragmentPrivate : public QDomNodePrivate
{
public:
- QDomDocumentFragmentPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0);
+ QDomDocumentFragmentPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = nullptr);
QDomDocumentFragmentPrivate(QDomNodePrivate* n, bool deep);
// Reimplemented from QDomNodePrivate
@@ -907,7 +907,7 @@ QDomImplementationPrivate* QDomImplementationPrivate::clone()
*/
QDomImplementation::QDomImplementation()
{
- impl = 0;
+ impl = nullptr;
}
/*!
@@ -1036,7 +1036,7 @@ QDomDocumentType QDomImplementation::createDocumentType(const QString& qName, co
if (!ok)
return QDomDocumentType();
- QDomDocumentTypePrivate *dt = new QDomDocumentTypePrivate(0);
+ QDomDocumentTypePrivate *dt = new QDomDocumentTypePrivate(nullptr);
dt->name = fixedName;
if (systemId.isNull()) {
dt->publicId.clear();
@@ -1070,7 +1070,7 @@ QDomDocument QDomImplementation::createDocument(const QString& nsURI, const QStr
*/
bool QDomImplementation::isNull()
{
- return (impl == 0);
+ return (impl == nullptr);
}
/*!
@@ -1244,14 +1244,14 @@ void QDomNodeListPrivate::createList()
QDomNodePrivate* QDomNodeListPrivate::item(int index)
{
if (!node_impl)
- return 0;
+ return nullptr;
const QDomDocumentPrivate *const doc = node_impl->ownerDocument();
if (!doc || timestamp != doc->nodeListTime)
createList();
if (index >= list.size())
- return 0;
+ return nullptr;
return list.at(index);
}
@@ -1305,13 +1305,13 @@ int QDomNodeListPrivate::length() const
Creates an empty node list.
*/
QDomNodeList::QDomNodeList()
+ : impl(nullptr)
{
- impl = 0;
}
QDomNodeList::QDomNodeList(QDomNodeListPrivate* p)
+ : impl(p)
{
- impl = p;
}
/*!
@@ -1443,10 +1443,10 @@ QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par)
setParent(par);
else
setOwnerDocument(doc);
- prev = 0;
- next = 0;
- first = 0;
- last = 0;
+ prev = nullptr;
+ next = nullptr;
+ first = nullptr;
+ last = nullptr;
createdWithDom1Interface = true;
lineNumber = -1;
columnNumber = -1;
@@ -1455,10 +1455,10 @@ QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par)
QDomNodePrivate::QDomNodePrivate(QDomNodePrivate *n, bool deep) : ref(1)
{
setOwnerDocument(n->ownerDocument());
- prev = 0;
- next = 0;
- first = 0;
- last = 0;
+ prev = nullptr;
+ next = nullptr;
+ first = nullptr;
+ last = nullptr;
name = n->name;
value = n->value;
@@ -1488,8 +1488,8 @@ QDomNodePrivate::~QDomNodePrivate()
p->setNoParent();
p = n;
}
- first = 0;
- last = 0;
+ first = nullptr;
+ last = nullptr;
}
void QDomNodePrivate::clear()
@@ -1503,8 +1503,8 @@ void QDomNodePrivate::clear()
delete p;
p = n;
}
- first = 0;
- last = 0;
+ first = nullptr;
+ last = nullptr;
}
QDomNodePrivate* QDomNodePrivate::namedItem(const QString &n)
@@ -1515,7 +1515,7 @@ QDomNodePrivate* QDomNodePrivate::namedItem(const QString &n)
return p;
p = p->next;
}
- return 0;
+ return nullptr;
}
@@ -1523,15 +1523,15 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
{
// Error check
if (!newChild)
- return 0;
+ return nullptr;
// Error check
if (newChild == refChild)
- return 0;
+ return nullptr;
// Error check
if (refChild && refChild->parent() != this)
- return 0;
+ return nullptr;
// "mark lists as dirty"
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1542,7 +1542,7 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
// all elements of the fragment instead of the fragment itself.
if (newChild->isDocumentFragment()) {
// Fragment is empty ?
- if (newChild->first == 0)
+ if (newChild->first == nullptr)
return newChild;
// New parent
@@ -1553,7 +1553,7 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
}
// Insert at the beginning ?
- if (!refChild || refChild->prev == 0) {
+ if (!refChild || refChild->prev == nullptr) {
if (first)
first->prev = newChild->last;
newChild->last->next = first;
@@ -1572,8 +1572,8 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
// does not decrease the reference.
// Remove the nodes from the fragment
- newChild->first = 0;
- newChild->last = 0;
+ newChild->first = nullptr;
+ newChild->last = nullptr;
return newChild;
}
@@ -1596,7 +1596,7 @@ QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNo
return newChild;
}
- if (refChild->prev == 0) {
+ if (refChild->prev == nullptr) {
if (first)
first->prev = newChild;
newChild->next = first;
@@ -1618,15 +1618,15 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
{
// Error check
if (!newChild)
- return 0;
+ return nullptr;
// Error check
if (newChild == refChild)
- return 0;
+ return nullptr;
// Error check
if (refChild && refChild->parent() != this)
- return 0;
+ return nullptr;
// "mark lists as dirty"
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1637,7 +1637,7 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
// all elements of the fragment instead of the fragment itself.
if (newChild->isDocumentFragment()) {
// Fragment is empty ?
- if (newChild->first == 0)
+ if (newChild->first == nullptr)
return newChild;
// New parent
@@ -1648,7 +1648,7 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
}
// Insert at the end
- if (!refChild || refChild->next == 0) {
+ if (!refChild || refChild->next == nullptr) {
if (last)
last->next = newChild->first;
newChild->first->prev = last;
@@ -1666,8 +1666,8 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
// does not decrease the reference.
// Remove the nodes from the fragment
- newChild->first = 0;
- newChild->last = 0;
+ newChild->first = nullptr;
+ newChild->last = nullptr;
return newChild;
}
@@ -1692,7 +1692,7 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
return newChild;
}
- if (refChild->next == 0) {
+ if (refChild->next == nullptr) {
if (last)
last->next = newChild;
newChild->prev = last;
@@ -1713,11 +1713,11 @@ QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNod
QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild)
{
if (!newChild || !oldChild)
- return 0;
+ return nullptr;
if (oldChild->parent() != this)
- return 0;
+ return nullptr;
if (newChild == oldChild)
- return 0;
+ return nullptr;
// mark lists as dirty
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1728,7 +1728,7 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
// all elements of the fragment instead of the fragment itself.
if (newChild->isDocumentFragment()) {
// Fragment is empty ?
- if (newChild->first == 0)
+ if (newChild->first == nullptr)
return newChild;
// New parent
@@ -1753,15 +1753,15 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
last = newChild->last;
oldChild->setNoParent();
- oldChild->next = 0;
- oldChild->prev = 0;
+ oldChild->next = nullptr;
+ oldChild->prev = nullptr;
// No need to increase the reference since QDomDocumentFragment
// does not decrease the reference.
// Remove the nodes from the fragment
- newChild->first = 0;
- newChild->last = 0;
+ newChild->first = nullptr;
+ newChild->last = nullptr;
// We are no longer interested in the old node
if (oldChild)
@@ -1794,8 +1794,8 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
last = newChild;
oldChild->setNoParent();
- oldChild->next = 0;
- oldChild->prev = 0;
+ oldChild->next = nullptr;
+ oldChild->prev = nullptr;
// We are no longer interested in the old node
if (oldChild)
@@ -1808,7 +1808,7 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
{
// Error check
if (oldChild->parent() != this)
- return 0;
+ return nullptr;
// "mark lists as dirty"
QDomDocumentPrivate *const doc = ownerDocument();
@@ -1817,8 +1817,8 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
// Perhaps oldChild was just created with "createElement" or that. In this case
// its parent is QDomDocument but it is not part of the documents child list.
- if (oldChild->next == 0 && oldChild->prev == 0 && first != oldChild)
- return 0;
+ if (oldChild->next == nullptr && oldChild->prev == nullptr && first != oldChild)
+ return nullptr;
if (oldChild->next)
oldChild->next->prev = oldChild->prev;
@@ -1831,8 +1831,8 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
first = oldChild->next;
oldChild->setNoParent();
- oldChild->next = 0;
- oldChild->prev = 0;
+ oldChild->next = nullptr;
+ oldChild->prev = nullptr;
// We are no longer interested in the old node
oldChild->ref.deref();
@@ -1843,7 +1843,7 @@ QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild)
QDomNodePrivate* QDomNodePrivate::appendChild(QDomNodePrivate* newChild)
{
// No reference manipulation needed. Done in insertAfter.
- return insertAfter(newChild, 0);
+ return insertAfter(newChild, nullptr);
}
QDomDocumentPrivate* QDomNodePrivate::ownerDocument()
@@ -1869,7 +1869,7 @@ QDomNodePrivate* QDomNodePrivate::cloneNode(bool deep)
static void qNormalizeNode(QDomNodePrivate* n)
{
QDomNodePrivate* p = n->first;
- QDomTextPrivate* t = 0;
+ QDomTextPrivate* t = nullptr;
while (p) {
if (p->isText()) {
@@ -1884,7 +1884,7 @@ static void qNormalizeNode(QDomNodePrivate* n)
}
} else {
p = p->next;
- t = 0;
+ t = nullptr;
}
}
}
@@ -2009,8 +2009,8 @@ void QDomNodePrivate::setLocation(int lineNumber, int columnNumber)
Constructs a \l{isNull()}{null} node.
*/
QDomNode::QDomNode()
+ : impl(nullptr)
{
- impl = 0;
}
/*!
@@ -2619,7 +2619,7 @@ bool QDomNode::hasChildNodes() const
{
if (!impl)
return false;
- return IMPL->first != 0;
+ return IMPL->first != nullptr;
}
/*!
@@ -2628,7 +2628,7 @@ bool QDomNode::hasChildNodes() const
*/
bool QDomNode::isNull() const
{
- return (impl == 0);
+ return (impl == nullptr);
}
/*!
@@ -2641,7 +2641,7 @@ void QDomNode::clear()
{
if (impl && !impl->ref.deref())
delete impl;
- impl = 0;
+ impl = nullptr;
}
/*!
@@ -3094,13 +3094,13 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::namedItemNS(const QString& nsURI, cons
return n;
}
}
- return 0;
+ return nullptr;
}
QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItem(QDomNodePrivate* arg)
{
if (readonly || !arg)
- return 0;
+ return nullptr;
if (appendToParent)
return parent->appendChild(arg);
@@ -3115,7 +3115,7 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItem(QDomNodePrivate* arg)
QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItemNS(QDomNodePrivate* arg)
{
if (readonly || !arg)
- return 0;
+ return nullptr;
if (appendToParent)
return parent->appendChild(arg);
@@ -3136,11 +3136,11 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItemNS(QDomNodePrivate* arg)
QDomNodePrivate* QDomNamedNodeMapPrivate::removeNamedItem(const QString& name)
{
if (readonly)
- return 0;
+ return nullptr;
QDomNodePrivate* p = namedItem(name);
- if (p == 0)
- return 0;
+ if (p == nullptr)
+ return nullptr;
if (appendToParent)
return parent->removeChild(p);
@@ -3153,7 +3153,7 @@ QDomNodePrivate* QDomNamedNodeMapPrivate::removeNamedItem(const QString& name)
QDomNodePrivate* QDomNamedNodeMapPrivate::item(int index) const
{
if (index >= length() || index < 0)
- return 0;
+ return nullptr;
return *(map.constBegin() + index);
}
@@ -3164,12 +3164,12 @@ int QDomNamedNodeMapPrivate::length() const
bool QDomNamedNodeMapPrivate::contains(const QString& name) const
{
- return map.value(name) != 0;
+ return map.contains(name);
}
bool QDomNamedNodeMapPrivate::containsNS(const QString& nsURI, const QString & localName) const
{
- return namedItemNS(nsURI, localName) != 0;
+ return namedItemNS(nsURI, localName) != nullptr;
}
/**************************************************************
@@ -3222,8 +3222,8 @@ bool QDomNamedNodeMapPrivate::containsNS(const QString& nsURI, const QString & l
Constructs an empty named node map.
*/
QDomNamedNodeMap::QDomNamedNodeMap()
+ : impl(nullptr)
{
- impl = 0;
}
/*!
@@ -3570,7 +3570,7 @@ QDomNodePrivate* QDomDocumentTypePrivate::removeChild(QDomNodePrivate* oldChild)
QDomNodePrivate* QDomDocumentTypePrivate::appendChild(QDomNodePrivate* newChild)
{
- return insertAfter(newChild, 0);
+ return insertAfter(newChild, nullptr);
}
static QString quotedValue(const QString &data)
@@ -3598,7 +3598,7 @@ void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const
}
if (entities->length()>0 || notations->length()>0) {
- s << " [" << endl;
+ s << " [" << Qt::endl;
QHash<QString, QDomNodePrivate *>::const_iterator it2 = notations->map.constBegin();
for (; it2 != notations->map.constEnd(); ++it2)
@@ -3611,7 +3611,7 @@ void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const
s << ']';
}
- s << '>' << endl;
+ s << '>' << Qt::endl;
}
/**************************************************************
@@ -4115,7 +4115,7 @@ QDomAttrPrivate::QDomAttrPrivate(QDomAttrPrivate* n, bool deep)
void QDomAttrPrivate::setNodeValue(const QString& v)
{
value = v;
- QDomTextPrivate *t = new QDomTextPrivate(0, this, v);
+ QDomTextPrivate *t = new QDomTextPrivate(nullptr, this, v);
// keep the refcount balanced: appendChild() does a ref anyway.
t->ref.deref();
if (first) {
@@ -4489,7 +4489,7 @@ void QDomElementPrivate::setAttributeNS(const QString& nsURI, const QString& qNa
void QDomElementPrivate::removeAttribute(const QString& aname)
{
QDomNodePrivate* p = m_attr->removeNamedItem(aname);
- if (p && p->ref.load() == 0)
+ if (p && p->ref.loadRelaxed() == 0)
delete p;
}
@@ -4517,7 +4517,7 @@ QDomAttrPrivate* QDomElementPrivate::setAttributeNode(QDomAttrPrivate* newAttr)
QDomAttrPrivate* QDomElementPrivate::setAttributeNodeNS(QDomAttrPrivate* newAttr)
{
- QDomNodePrivate* n = 0;
+ QDomNodePrivate* n = nullptr;
if (!newAttr->prefix.isNull())
n = m_attr->namedItemNS(newAttr->namespaceURI, newAttr->name);
@@ -4627,7 +4627,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
/* -1 disables new lines. */
if (indent != -1)
- s << endl;
+ s << Qt::endl;
}
QDomNodePrivate::save(s, depth + 1, indent); if (!last->isText())
s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' '));
@@ -4639,7 +4639,7 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const
if (!(next && next->isText())) {
/* -1 disables new lines. */
if (indent != -1)
- s << endl;
+ s << Qt::endl;
}
}
@@ -5184,10 +5184,10 @@ QDomTextPrivate* QDomTextPrivate::splitText(int offset)
{
if (!parent()) {
qWarning("QDomText::splitText The node has no parent. So I cannot split");
- return 0;
+ return nullptr;
}
- QDomTextPrivate* t = new QDomTextPrivate(ownerDocument(), 0, value.mid(offset));
+ QDomTextPrivate* t = new QDomTextPrivate(ownerDocument(), nullptr, value.mid(offset));
value.truncate(offset);
parent()->insertAfter(t, this);
@@ -5329,7 +5329,7 @@ void QDomCommentPrivate::save(QTextStream& s, int depth, int indent) const
s << "-->";
if (!(next && next->isText()))
- s << endl;
+ s << Qt::endl;
}
/**************************************************************
@@ -5552,7 +5552,7 @@ void QDomNotationPrivate::save(QTextStream& s, int, int) const
} else {
s << "SYSTEM " << quotedValue(m_sys);
}
- s << '>' << endl;
+ s << '>' << Qt::endl;
}
/**************************************************************
@@ -5733,7 +5733,7 @@ void QDomEntityPrivate::save(QTextStream& s, int, int) const
_name = QLatin1String("% ") + _name.mid(1);
if (m_sys.isNull() && m_pub.isNull()) {
- s << "<!ENTITY " << _name << " \"" << encodeEntity(value.toUtf8()) << "\">" << endl;
+ s << "<!ENTITY " << _name << " \"" << encodeEntity(value.toUtf8()) << "\">" << Qt::endl;
} else {
s << "<!ENTITY " << _name << ' ';
if (m_pub.isNull()) {
@@ -5744,7 +5744,7 @@ void QDomEntityPrivate::save(QTextStream& s, int, int) const
if (! m_notationName.isNull()) {
s << " NDATA " << m_notationName;
}
- s << '>' << endl;
+ s << '>' << Qt::endl;
}
}
@@ -6014,7 +6014,7 @@ QDomNodePrivate* QDomProcessingInstructionPrivate::cloneNode(bool deep)
void QDomProcessingInstructionPrivate::save(QTextStream& s, int, int) const
{
- s << "<?" << name << ' ' << value << "?>" << endl;
+ s << "<?" << name << ' ' << value << "?>" << Qt::endl;
}
/**************************************************************
@@ -6144,7 +6144,7 @@ void QDomProcessingInstruction::setData(const QString& d)
**************************************************************/
QDomDocumentPrivate::QDomDocumentPrivate()
- : QDomNodePrivate(0),
+ : QDomNodePrivate(nullptr),
impl(new QDomImplementationPrivate),
nodeListTime(1)
{
@@ -6155,7 +6155,7 @@ QDomDocumentPrivate::QDomDocumentPrivate()
}
QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname)
- : QDomNodePrivate(0),
+ : QDomNodePrivate(nullptr),
impl(new QDomImplementationPrivate),
nodeListTime(1)
{
@@ -6167,11 +6167,11 @@ QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname)
}
QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentTypePrivate* dt)
- : QDomNodePrivate(0),
+ : QDomNodePrivate(nullptr),
impl(new QDomImplementationPrivate),
nodeListTime(1)
{
- if (dt != 0) {
+ if (dt != nullptr) {
type = dt;
} else {
type = new QDomDocumentTypePrivate(this, this);
@@ -6267,9 +6267,9 @@ QDomElementPrivate* QDomDocumentPrivate::createElement(const QString &tagName)
bool ok;
QString fixedName = fixedXmlName(tagName, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomElementPrivate *e = new QDomElementPrivate(this, 0, fixedName);
+ QDomElementPrivate *e = new QDomElementPrivate(this, nullptr, fixedName);
e->ref.deref();
return e;
}
@@ -6279,16 +6279,16 @@ QDomElementPrivate* QDomDocumentPrivate::createElementNS(const QString &nsURI, c
bool ok;
QString fixedName = fixedXmlName(qName, &ok, true);
if (!ok)
- return 0;
+ return nullptr;
- QDomElementPrivate *e = new QDomElementPrivate(this, 0, nsURI, fixedName);
+ QDomElementPrivate *e = new QDomElementPrivate(this, nullptr, nsURI, fixedName);
e->ref.deref();
return e;
}
QDomDocumentFragmentPrivate* QDomDocumentPrivate::createDocumentFragment()
{
- QDomDocumentFragmentPrivate *f = new QDomDocumentFragmentPrivate(this, (QDomNodePrivate*)0);
+ QDomDocumentFragmentPrivate *f = new QDomDocumentFragmentPrivate(this, (QDomNodePrivate*)nullptr);
f->ref.deref();
return f;
}
@@ -6298,9 +6298,9 @@ QDomTextPrivate* QDomDocumentPrivate::createTextNode(const QString &data)
bool ok;
QString fixedData = fixedCharData(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomTextPrivate *t = new QDomTextPrivate(this, 0, fixedData);
+ QDomTextPrivate *t = new QDomTextPrivate(this, nullptr, fixedData);
t->ref.deref();
return t;
}
@@ -6310,9 +6310,9 @@ QDomCommentPrivate* QDomDocumentPrivate::createComment(const QString &data)
bool ok;
QString fixedData = fixedComment(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomCommentPrivate *c = new QDomCommentPrivate(this, 0, fixedData);
+ QDomCommentPrivate *c = new QDomCommentPrivate(this, nullptr, fixedData);
c->ref.deref();
return c;
}
@@ -6322,9 +6322,9 @@ QDomCDATASectionPrivate* QDomDocumentPrivate::createCDATASection(const QString &
bool ok;
QString fixedData = fixedCDataSection(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomCDATASectionPrivate *c = new QDomCDATASectionPrivate(this, 0, fixedData);
+ QDomCDATASectionPrivate *c = new QDomCDATASectionPrivate(this, nullptr, fixedData);
c->ref.deref();
return c;
}
@@ -6335,13 +6335,13 @@ QDomProcessingInstructionPrivate* QDomDocumentPrivate::createProcessingInstructi
bool ok;
QString fixedData = fixedPIData(data, &ok);
if (!ok)
- return 0;
+ return nullptr;
// [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
QString fixedTarget = fixedXmlName(target, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomProcessingInstructionPrivate *p = new QDomProcessingInstructionPrivate(this, 0, fixedTarget, fixedData);
+ QDomProcessingInstructionPrivate *p = new QDomProcessingInstructionPrivate(this, nullptr, fixedTarget, fixedData);
p->ref.deref();
return p;
}
@@ -6350,9 +6350,9 @@ QDomAttrPrivate* QDomDocumentPrivate::createAttribute(const QString &aname)
bool ok;
QString fixedName = fixedXmlName(aname, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, fixedName);
+ QDomAttrPrivate *a = new QDomAttrPrivate(this, nullptr, fixedName);
a->ref.deref();
return a;
}
@@ -6362,9 +6362,9 @@ QDomAttrPrivate* QDomDocumentPrivate::createAttributeNS(const QString &nsURI, co
bool ok;
QString fixedName = fixedXmlName(qName, &ok, true);
if (!ok)
- return 0;
+ return nullptr;
- QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, nsURI, fixedName);
+ QDomAttrPrivate *a = new QDomAttrPrivate(this, nullptr, nsURI, fixedName);
a->ref.deref();
return a;
}
@@ -6374,16 +6374,16 @@ QDomEntityReferencePrivate* QDomDocumentPrivate::createEntityReference(const QSt
bool ok;
QString fixedName = fixedXmlName(aname, &ok);
if (!ok)
- return 0;
+ return nullptr;
- QDomEntityReferencePrivate *e = new QDomEntityReferencePrivate(this, 0, fixedName);
+ QDomEntityReferencePrivate *e = new QDomEntityReferencePrivate(this, nullptr, fixedName);
e->ref.deref();
return e;
}
QDomNodePrivate* QDomDocumentPrivate::importNode(QDomNodePrivate *importedNode, bool deep)
{
- QDomNodePrivate *node = 0;
+ QDomNodePrivate *node = nullptr;
switch (importedNode->nodeType()) {
case QDomNode::AttributeNode:
node = new QDomAttrPrivate((QDomAttrPrivate*)importedNode, true);
@@ -6435,7 +6435,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod
#if QT_CONFIG(textcodec) && QT_CONFIG(regularexpression)
const QDomNodePrivate* n = first;
- QTextCodec *codec = 0;
+ QTextCodec *codec = nullptr;
if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) {
// we have an XML declaration
@@ -6593,7 +6593,7 @@ void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNod
*/
QDomDocument::QDomDocument()
{
- impl = 0;
+ impl = nullptr;
}
/*!
@@ -6822,7 +6822,7 @@ bool QDomDocument::setContent(QXmlInputSource *source, QXmlReader *reader, QStri
{
if (!impl)
impl = new QDomDocumentPrivate();
- return IMPL->setContent(source, reader, 0, errorMsg, errorLine, errorColumn);
+ return IMPL->setContent(source, reader, nullptr, errorMsg, errorLine, errorColumn);
}
/*!
@@ -7369,7 +7369,7 @@ QDomComment QDomNode::toComment() const
QDomHandler::QDomHandler(QDomDocumentPrivate* adoc, QXmlSimpleReader* areader, bool namespaceProcessing)
: errorLine(0), errorColumn(0), doc(adoc), node(adoc), cdata(false),
- nsProcessing(namespaceProcessing), locator(0), reader(areader)
+ nsProcessing(namespaceProcessing), locator(nullptr), reader(areader)
{
}
@@ -7443,7 +7443,7 @@ bool QDomHandler::characters(const QString& ch)
if (cdata) {
n.reset(doc->createCDATASection(ch));
} else if (!entityName.isEmpty()) {
- QScopedPointer<QDomEntityPrivate> e(new QDomEntityPrivate(doc, 0, entityName,
+ QScopedPointer<QDomEntityPrivate> e(new QDomEntityPrivate(doc, nullptr, entityName,
QString(), QString(), QString()));
e->value = ch;
e->ref.deref();
@@ -7528,7 +7528,7 @@ bool QDomHandler::comment(const QString& ch)
bool QDomHandler::unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString &notationName)
{
- QDomEntityPrivate* e = new QDomEntityPrivate(doc, 0, name,
+ QDomEntityPrivate* e = new QDomEntityPrivate(doc, nullptr, name,
publicId, systemId, notationName);
// keep the refcount balanced: appendChild() does a ref anyway.
e->ref.deref();
@@ -7543,7 +7543,7 @@ bool QDomHandler::externalEntityDecl(const QString &name, const QString &publicI
bool QDomHandler::notationDecl(const QString & name, const QString & publicId, const QString & systemId)
{
- QDomNotationPrivate* n = new QDomNotationPrivate(doc, 0, name, publicId, systemId);
+ QDomNotationPrivate* n = new QDomNotationPrivate(doc, nullptr, name, publicId, systemId);
// keep the refcount balanced: appendChild() does a ref anyway.
n->ref.deref();
doc->doctype()->appendChild(n);
diff --git a/src/xml/qtxmlglobal.h b/src/xml/qtxmlglobal.h
index ed5de8db87..1ce3008f4a 100644
--- a/src/xml/qtxmlglobal.h
+++ b/src/xml/qtxmlglobal.h
@@ -3,7 +3,7 @@
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtCore module of the Qt Toolkit.
+** This file is part of the QtXml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp
index b2fff5b61f..1993073cce 100644
--- a/src/xml/sax/qxml.cpp
+++ b/src/xml/sax/qxml.cpp
@@ -1079,12 +1079,12 @@ void QXmlInputSource::init()
d = new QXmlInputSourcePrivate;
QT_TRY {
- d->inputDevice = 0;
- d->inputStream = 0;
+ d->inputDevice = nullptr;
+ d->inputStream = nullptr;
setData(QString());
#if QT_CONFIG(textcodec)
- d->encMapper = 0;
+ d->encMapper = nullptr;
#endif
d->nextReturnedEndOfData = true; // first call to next() will call fetchData()
@@ -1161,12 +1161,12 @@ QChar QXmlInputSource::next()
d->nextReturnedEndOfData = false;
fetchData();
if (d->pos >= d->length) {
- return EndOfDocument;
+ return QChar(EndOfDocument);
}
return next();
}
d->nextReturnedEndOfData = true;
- return EndOfData;
+ return QChar(EndOfData);
}
// QXmlInputSource has no way to signal encoding errors. The best we can do
@@ -1174,7 +1174,7 @@ QChar QXmlInputSource::next()
// will then just call this function again to get the next char.
QChar c = d->unicode[d->pos++];
if (c.unicode() == EndOfData)
- c = EndOfDocument;
+ c = QChar(EndOfDocument);
return c;
}
@@ -1313,8 +1313,8 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText)
return QString();
while (pos < endPos) {
- ushort uc = text.at(pos).unicode();
- if (uc == '\'' || uc == '"')
+ QChar uc = text.at(pos);
+ if (uc == u'\'' || uc == u'"')
break;
++pos;
}
@@ -1325,8 +1325,8 @@ static QString extractEncodingDecl(const QString &text, bool *needMoreText)
QString encoding;
++pos;
while (pos < endPos) {
- ushort uc = text.at(pos).unicode();
- if (uc == '\'' || uc == '"')
+ QChar uc = text.at(pos);
+ if (uc == u'\'' || uc == u'"')
break;
encoding.append(uc);
++pos;
@@ -1357,13 +1357,13 @@ QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning)
return QString();
if (beginning) {
delete d->encMapper;
- d->encMapper = 0;
+ d->encMapper = nullptr;
}
int mib = 106; // UTF-8
// This is the initial UTF codec we will read the encoding declaration with
- if (d->encMapper == 0) {
+ if (d->encMapper == nullptr) {
d->encodingDeclBytes.clear();
d->encodingDeclChars.clear();
d->lookingForEncodingDecl = true;
@@ -2377,7 +2377,7 @@ bool QXmlDefaultHandler::unparsedEntityDecl(const QString&, const QString&,
bool QXmlDefaultHandler::resolveEntity(const QString&, const QString&,
QXmlInputSource*& ret)
{
- ret = 0;
+ ret = nullptr;
return true;
}
@@ -2520,15 +2520,15 @@ inline void QXmlSimpleReaderPrivate::refClear()
QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader)
{
q_ptr = reader;
- parseStack = 0;
+ parseStack = nullptr;
locator.reset(new QXmlSimpleReaderLocator(reader));
- entityRes = 0;
- dtdHnd = 0;
- contentHnd = 0;
- errorHnd = 0;
- lexicalHnd = 0;
- declHnd = 0;
+ entityRes = nullptr;
+ dtdHnd = nullptr;
+ contentHnd = nullptr;
+ errorHnd = nullptr;
+ lexicalHnd = nullptr;
+ declHnd = nullptr;
// default feature settings
useNamespaces = true;
@@ -2932,7 +2932,7 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const
{
const QXmlSimpleReaderPrivate *d = d_func();
- if (ok != 0)
+ if (ok)
*ok = true;
if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
return d->useNamespaces;
@@ -2946,7 +2946,7 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const
return d->reportEntities;
} else {
qWarning("Unknown feature %s", name.toLatin1().data());
- if (ok != 0)
+ if (ok)
*ok = false;
}
return false;
@@ -3023,9 +3023,9 @@ bool QXmlSimpleReader::hasFeature(const QString& name) const
*/
void* QXmlSimpleReader::property(const QString&, bool *ok) const
{
- if (ok != 0)
+ if (ok)
*ok = false;
- return 0;
+ return nullptr;
}
/*! \reimp
@@ -3206,7 +3206,7 @@ bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental)
d->initIncrementalParsing();
} else {
delete d->parseStack;
- d->parseStack = 0;
+ d->parseStack = nullptr;
}
d->init(input);
@@ -3251,7 +3251,7 @@ bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental)
bool QXmlSimpleReader::parseContinue()
{
Q_D(QXmlSimpleReader);
- if (d->parseStack == 0 || d->parseStack->isEmpty())
+ if (d->parseStack == nullptr || d->parseStack->isEmpty())
return false;
d->initData();
int state = d->parseStack->pop().state;
@@ -3268,7 +3268,7 @@ bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)
if (state==0) {
if (!parseProlog()) {
if (incremental && error.isNull()) {
- pushParseState(0, 0);
+ pushParseState(nullptr, 0);
return true;
} else {
clear(tags);
@@ -3280,7 +3280,7 @@ bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)
if (state==1) {
if (!parseElement()) {
if (incremental && error.isNull()) {
- pushParseState(0, 1);
+ pushParseState(nullptr, 1);
return true;
} else {
clear(tags);
@@ -3293,7 +3293,7 @@ bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)
while (!atEnd()) {
if (!parseMisc()) {
if (incremental && error.isNull()) {
- pushParseState(0, 2);
+ pushParseState(nullptr, 2);
return true;
} else {
clear(tags);
@@ -3303,7 +3303,7 @@ bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)
}
if (!atEndOrig && incremental) {
// we parsed something at all, so be prepared to come back later
- pushParseState(0, 2);
+ pushParseState(nullptr, 2);
return true;
}
// is stack empty?
@@ -3315,7 +3315,7 @@ bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)
// call the handler
if (contentHnd) {
delete parseStack;
- parseStack = 0;
+ parseStack = nullptr;
if (!contentHnd->endDocument()) {
reportParseError(contentHnd->errorString());
return false;
@@ -3350,7 +3350,7 @@ bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental)
signed char state;
signed char input;
-(4) if (d->parseStack == 0 || d->parseStack->isEmpty()) {
+(4) if (d->parseStack == nullptr || d->parseStack->isEmpty()) {
(4a) ...
} else {
(4b) ...
@@ -3440,7 +3440,7 @@ bool QXmlSimpleReaderPrivate::parseProlog()
signed char state;
signed char input;
- if (parseStack == 0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr|| parseStack->isEmpty()) {
xmldecl_possible = true;
doctype_read = false;
state = Init;
@@ -3631,7 +3631,7 @@ bool QXmlSimpleReaderPrivate::parseElement()
int state;
int input;
- if (parseStack == 0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr|| parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -4000,7 +4000,7 @@ bool QXmlSimpleReaderPrivate::parseContent()
signed char state;
signed char input;
- if (parseStack == 0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
contentCharDataRead = false;
state = Init;
} else {
@@ -4303,7 +4303,7 @@ bool QXmlSimpleReaderPrivate::parseMisc()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -4458,7 +4458,7 @@ bool QXmlSimpleReaderPrivate::parsePI()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -4685,7 +4685,7 @@ bool QXmlSimpleReaderPrivate::parseDoctype()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
startDTDwasReported = false;
systemId.clear();
publicId.clear();
@@ -4896,7 +4896,7 @@ bool QXmlSimpleReaderPrivate::parseExternalID()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
systemId.clear();
publicId.clear();
state = Init;
@@ -5060,7 +5060,7 @@ bool QXmlSimpleReaderPrivate::parseMarkupdecl()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -5218,7 +5218,7 @@ bool QXmlSimpleReaderPrivate::parsePEReference()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -5255,7 +5255,7 @@ bool QXmlSimpleReaderPrivate::parsePEReference()
} else if (entityRes) {
QMap<QString,QXmlSimpleReaderPrivate::ExternParameterEntity>::Iterator it2;
it2 = externParameterEntities.find(ref());
- QXmlInputSource *ret = 0;
+ QXmlInputSource *ret = nullptr;
if (it2 != externParameterEntities.end()) {
if (!entityRes->resolveEntity((*it2).publicId, (*it2).systemId, ret)) {
delete ret;
@@ -5396,7 +5396,7 @@ bool QXmlSimpleReaderPrivate::parseAttlistDecl()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -5612,7 +5612,7 @@ bool QXmlSimpleReaderPrivate::parseAttType()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -5833,7 +5833,7 @@ bool QXmlSimpleReaderPrivate::parseAttValue()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -5975,7 +5975,7 @@ bool QXmlSimpleReaderPrivate::parseElementDecl()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -6184,7 +6184,7 @@ bool QXmlSimpleReaderPrivate::parseNotationDecl()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -6328,7 +6328,7 @@ bool QXmlSimpleReaderPrivate::parseChoiceSeq()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -6557,7 +6557,7 @@ bool QXmlSimpleReaderPrivate::parseEntityDecl()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -6832,7 +6832,7 @@ bool QXmlSimpleReaderPrivate::parseEntityValue()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -6951,7 +6951,7 @@ bool QXmlSimpleReaderPrivate::parseComment()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -7063,7 +7063,7 @@ bool QXmlSimpleReaderPrivate::parseAttribute()
int state;
int input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -7162,7 +7162,7 @@ bool QXmlSimpleReaderPrivate::parseName()
};
int state;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -7248,7 +7248,7 @@ bool QXmlSimpleReaderPrivate::parseNmtoken()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
state = Init;
} else {
state = parseStack->pop().state;
@@ -7356,7 +7356,7 @@ bool QXmlSimpleReaderPrivate::parseReference()
signed char state;
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
parseReference_charDataRead = false;
state = Init;
} else {
@@ -7582,7 +7582,7 @@ bool QXmlSimpleReaderPrivate::processReference()
if (parseReference_context == InContent) {
if (contentCharDataRead) {
if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
- if (contentHnd != 0 && !contentHnd->characters(string())) {
+ if (contentHnd != nullptr && !contentHnd->characters(string())) {
reportParseError(contentHnd->errorString());
return false;
}
@@ -7610,7 +7610,7 @@ bool QXmlSimpleReaderPrivate::processReference()
// Included if validating
bool skipIt = true;
if (entityRes) {
- QXmlInputSource *ret = 0;
+ QXmlInputSource *ret = nullptr;
if (!entityRes->resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)) {
delete ret;
reportParseError(entityRes->errorString());
@@ -7696,7 +7696,7 @@ bool QXmlSimpleReaderPrivate::parseString()
signed char state; // state in this function is the position in the string s
signed char input;
- if (parseStack==0 || parseStack->isEmpty()) {
+ if (parseStack == nullptr || parseStack->isEmpty()) {
Done = parseString_s.length();
state = 0;
} else {
@@ -7800,7 +7800,7 @@ void QXmlSimpleReaderPrivate::next()
c = inputSource->next();
// If we are not incremental parsing, we just skip over EndOfData chars to give the
// parser an uninterrupted stream of document chars.
- if (c == QXmlInputSource::EndOfData && parseStack == 0)
+ if (c == QChar(QXmlInputSource::EndOfData) && parseStack == nullptr)
c = inputSource->next();
if (uc == '\n') {
lineNr++;
@@ -7832,7 +7832,7 @@ bool QXmlSimpleReaderPrivate::eat_ws()
}
next();
}
- if (parseStack != 0) {
+ if (parseStack != nullptr) {
unexpectedEof(&QXmlSimpleReaderPrivate::eat_ws, 0);
return false;
}
@@ -7877,7 +7877,7 @@ void QXmlSimpleReaderPrivate::init(const QXmlInputSource *i)
*/
void QXmlSimpleReaderPrivate::initData()
{
- c = QXmlInputSource::EndOfData;
+ c = QChar(QXmlInputSource::EndOfData);
xmlRefStack.clear();
next();
}
@@ -7922,10 +7922,10 @@ void QXmlSimpleReaderPrivate::reportParseError(const QString& error)
*/
void QXmlSimpleReaderPrivate::unexpectedEof(ParseFunction where, int state)
{
- if (parseStack == 0) {
+ if (parseStack == nullptr) {
reportParseError(QLatin1String(XMLERR_UNEXPECTEDEOF));
} else {
- if (c == QXmlInputSource::EndOfDocument) {
+ if (c == QChar(QXmlInputSource::EndOfDocument)) {
reportParseError(QLatin1String(XMLERR_UNEXPECTEDEOF));
} else {
pushParseState(where, state);
@@ -7942,7 +7942,7 @@ void QXmlSimpleReaderPrivate::unexpectedEof(ParseFunction where, int state)
*/
void QXmlSimpleReaderPrivate::parseFailed(ParseFunction where, int state)
{
- if (parseStack!=0 && error.isNull()) {
+ if (parseStack != nullptr && error.isNull()) {
pushParseState(where, state);
}
}
diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h
index 94dc8dfb8e..9be14bd7a9 100644
--- a/src/xml/sax/qxml.h
+++ b/src/xml/sax/qxml.h
@@ -116,16 +116,14 @@ class Q_XML_EXPORT QXmlAttributes
{
public:
QXmlAttributes();
-#ifdef Q_COMPILER_DEFAULT_MEMBERS
QXmlAttributes(const QXmlAttributes &) = default;
- QXmlAttributes(QXmlAttributes &&) Q_DECL_NOTHROW = default;
+ QXmlAttributes(QXmlAttributes &&) noexcept = default;
QXmlAttributes &operator=(const QXmlAttributes &) = default;
- QXmlAttributes &operator=(QXmlAttributes &&) Q_DECL_NOTHROW = default;
-#endif // default members
+ QXmlAttributes &operator=(QXmlAttributes &&) noexcept = default;
QT6_NOT_VIRTUAL ~QXmlAttributes();
- void swap(QXmlAttributes &other) Q_DECL_NOTHROW
+ void swap(QXmlAttributes &other) noexcept
{
qSwap(attList, other.attList);
qSwap(d, other.d);
diff --git a/src/xml/sax/qxml_p.h b/src/xml/sax/qxml_p.h
index 98dc2aea0c..eb6135db04 100644
--- a/src/xml/sax/qxml_p.h
+++ b/src/xml/sax/qxml_p.h
@@ -229,7 +229,7 @@ private:
// for the DTD currently being parsed.
static const int dtdRecursionLimit = 2;
// The maximum amount of characters an entity value may contain, after expansion.
- static const int entityCharacterLimit = 1024;
+ static const int entityCharacterLimit = 4096;
const QString &string();
void stringClear();
diff --git a/sync.profile b/sync.profile
index e6fc285573..fd44197a00 100644
--- a/sync.profile
+++ b/sync.profile
@@ -37,6 +37,9 @@
"QtZlib" => "!>$basedir/src/corelib;$basedir/src/3rdparty/zlib",
"QtOpenGLExtensions" => "$basedir/src/openglextensions",
"QtEglFSDeviceIntegration" => "$basedir/src/plugins/platforms/eglfs",
+ "QtMockPlugins1" => "$basedir/tests/auto/cmake/mockplugins/mockplugins1",
+ "QtMockPlugins2" => "$basedir/tests/auto/cmake/mockplugins/mockplugins2",
+ "QtMockPlugins3" => "$basedir/tests/auto/cmake/mockplugins/mockplugins3",
);
%moduleheaders = ( # restrict the module headers to those found in relative path
"QtEglFSDeviceIntegration" => "api",
diff --git a/tests/auto/android/runtests_androiddeployqt.pl b/tests/auto/android/runtests_androiddeployqt.pl
deleted file mode 100755
index 24b44cf9b2..0000000000
--- a/tests/auto/android/runtests_androiddeployqt.pl
+++ /dev/null
@@ -1,550 +0,0 @@
-#!/usr/bin/perl -w
-#############################################################################
-##
-## Copyright (C) 2012-2013 BogDan Vatra <bogdan@kde.org>
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-use Cwd;
-use Cwd 'abs_path';
-use File::Basename;
-use File::Temp 'tempdir';
-use File::Path 'remove_tree';
-use Getopt::Long;
-use Pod::Usage;
-use XML::Simple;
-use Term::ANSIColor;
-
-### default options
-my @stack = cwd;
-my $device_serial=""; # "-s device_serial";
-my $deployqt_device_serial=""; # "-device device_serial";
-my $log_out="xml";
-my $max_runtime = 5;
-my $className="org.qtproject.qt5.android.bindings.QtActivity";
-my $jobs = 4;
-my $testsubset = "";
-my $man = 0;
-my $help = 0;
-my $make_clean = 0;
-my $stop_on_fail = 0;
-my $time_out=400;
-my $android_toolchain_version = "4.8";
-my $host_arch = "linux-x86";
-my $android_sdk_dir = "$ENV{'ANDROID_SDK_ROOT'}";
-my $android_ndk_dir = "$ENV{'ANDROID_NDK_ROOT'}";
-my $android_to_connect = "$ENV{'ANDROID_DEVICE'}";
-my $ant_tool = `which ant`;
-my $silent = 0;
-chomp $ant_tool;
-my $strip_tool="";
-my $readelf_tool="";
-# for ci usage
-my @failures = '';
-my $total_tests = 0;
-my $total_failed = 0;
-my $failed_insignificants = 0;
-my $ci_use = 0;
-my $start = time();
-my $uninstall = 0;
-
-GetOptions('h|help' => \$help
- , man => \$man
- , 's|serial=s' => \$device_serial
- , 't|test=s' => \$testsubset
- , 'c|clean' => \$make_clean
- , 'j|jobs=i' => \$jobs
- , 'logtype=s' => \$log_out
- , 'runtime=i' => \$max_runtime
- , 'sdk=s' => \$android_sdk_dir
- , 'ndk=s' => \$android_ndk_dir
- , 'toolchain=s' => \$android_toolchain_version
- , 'host=s' => \$host_arch
- , 'ant=s' => \$ant_tool
- , 'strip=s' => \$strip_tool
- , 'readelf=s' => \$readelf_tool
- , 'testcase=s' => \$testcase
- , 'f|fail' => sub { $stop_on_fail = 1 }
- , 'silent' => sub { $silent = 1 }
- , 'ci' => sub { $ci_use = 1 }
- , 'uninstall' => sub { $uninstall = 1 }
- ) or pod2usage(2);
-pod2usage(1) if $help;
-pod2usage(-verbose => 2) if $man;
-
-if ($ci_use){
- use QMake::Project;
-}
-my $adb_tool="$android_sdk_dir/platform-tools/adb";
-
-# For CI. Nodes are connecting to test devices over IP, which is stored to env variable
-if ($android_to_connect ne ""){
- print " Found device to be connected from env: $android_to_connect \n";
- system("$adb_tool disconnect $android_to_connect");
- system("$adb_tool connect $android_to_connect");
- sleep(2);# let it connect
- system("$adb_tool -s $android_to_connect reboot &");# adb bug, it blocks forever
- sleep(15); # wait for the device to come up again
- system("$adb_tool disconnect $android_to_connect");# cleans up the left adb reboot process
- system("$adb_tool connect $android_to_connect");
- $device_serial =$android_to_connect;
-}
-
-system("$adb_tool devices") == 0 or die "No device found, please plug/start at least one device/emulator\n"; # make sure we have at least on device attached
-
-$deployqt_device_serial = "--device $device_serial" if ($device_serial);
-$device_serial = "-s $device_serial" if ($device_serial);
-$testsubset="/$testsubset" if ($testsubset);
-
-$strip_tool="$android_ndk_dir/toolchains/arm-linux-androideabi-$android_toolchain_version/prebuilt/$host_arch/bin/arm-linux-androideabi-strip" unless($strip_tool);
-$readelf_tool="$android_ndk_dir/toolchains/arm-linux-androideabi-$android_toolchain_version/prebuilt/$host_arch/bin/arm-linux-androideabi-readelf" unless($readelf_tool);
-$readelf_tool="$readelf_tool -d -w ";
-
-sub dir
-{
-# print "@stack\n";
-}
-
-sub pushd ($)
-{
- unless ( chdir $_[0] )
- {
- warn "Error: $!\n";
- return;
- }
- unshift @stack, cwd;
- dir;
-}
-
-sub popd ()
-{
- @stack > 1 and shift @stack;
- chdir $stack[0];
- dir;
-}
-
-##############################
-# Read possible insignificance
-# from pro file
-##############################
-sub check_if_insignificant
-{
- return 0 if ( !$ci_use );
- my $case = shift;
- my $insignificant = 0;
- my $prj = QMake::Project->new( 'Makefile' );
- $insignificant = $prj->test( 'insignificant_test' );
- return $insignificant;
-}
-
-##############################
-# Print output from given
-# $testresult.txt file
-##############################
-sub print_output
-{
- my $res_file = shift;
- my $case = shift;
- my $insignificant = shift;
- my $print_all = 0;
- $total_tests++;
- if (-e $res_file) {
- open my $file, $res_file or die "Could not open $res_file: $!";
- while (my $line = <$file>) {
- if ($line =~ m/^FAIL/) {
- print "$line";
- # Pretend to be like the "real" testrunner and print out
- # all steps
- $print_all = 1;
- }
- }
- close $file;
- if ($print_all) {
- # In case we are printing all, the test failed
- system("cat $res_file");
- if ($insignificant) {
- print " Testrunner: $case failed, but it is marked with insignificant_test\n";
- push (@failures ,(basename($case)." [insignificant]"));
- $failed_insignificants++;
- } else {
- $total_failed++;
- push (@failures ,(basename($case)));
- }
- } else {
- my $cmd = "sed -n 'x;\$p' ${res_file}";
- my $summary = qx(${cmd});
- if ($summary =~ m/^Totals/) {
- print "$summary";
- } else {
- print "Error: The log is incomplete. Looks like you have to increase the timeout.";
- # The test log seems inclomplete, considering the test as failed.
- if ($insignificant) {
- print " Testrunner: $case failed, but it is marked with insignificant_test\n";
- push (@failures ,(basename($case)." [insignificant]"));
- $failed_insignificants++;
- } else {
- $total_failed++;
- push (@failures ,(basename($case)));
- }
- }
- }
- } else {
- if ($insignificant) {
- print " Failed to execute $case, but it is marked with insignificant_test\n";
- push (@failures ,(basename($case)." [insignificant]"));
- $failed_insignificants++;
- } else {
- print "Failed to execute $case \n";
- $total_failed++;
- push (@failures ,(basename($case)));
- }
- }
-}
-
-##############################
-# Print summary of test run
-##############################
-
-sub print_summary
-{
- my $total = time()-$start;
- my $h = 0;
- my $m = 0;
- my $s = 0;
- my $exit = 0;
- print "=== Timing: =================== TEST RUN COMPLETED! ============================\n";
- if ($total > 60*60) {
- $h = int($total/60/60);
- $s = int($total - $h*60*60);
-
- $m = int($s/60);
- $s = 0;
- print "Total: $h hours $m minutes\n";
- } elsif ($total > 60) {
- $m = int($total/60);
- $s = int($total - $m*60);
- print "Total: $m minutes $s seconds\n";
- } else {
- $s = int($total);
- print "Total: $s seconds\n";
- }
-
- print "=== Failures: ==================================================================";
- foreach my $failed (@failures) {
- print $failed."\n";
- $exit = 1;
- }
- print "=== Totals: ".$total_tests." tests, ".($total_tests-$total_failed).
- " passes, ".$failed_insignificants.
- " insignificant fails ======================\n";
- return $exit;
-}
-
-
-sub waitForProcess
-{
- my $process=shift;
- my $action=shift;
- my $timeout=shift;
- my $sleepPeriod=shift;
- $sleepPeriod=1 if !defined($sleepPeriod);
- print "Waiting for $process ".$timeout*$sleepPeriod." seconds to" if (!$silent);
- print $action?" start...\n":" die...\n" if (!$silent);
- while ($timeout--)
- {
- my $output = `$adb_tool $device_serial shell ps 2>&1`; # get current processes
- #FIXME check why $output is not matching m/.*S $process\n/ or m/.*S $process$/ (eol)
- my $res=($output =~ m/.*S $process/)?1:0; # check the procress
- if ($action == $res)
- {
- print "... succeed\n" if (!$silent);
- return 1;
- }
- sleep($sleepPeriod);
- print "timeount in ".$timeout*$sleepPeriod." seconds\n" if (!$silent);
- }
- print "... failed\n" if (!$silent);
- return 0;
-}
-
-my $src_dir_qt=abs_path(dirname($0)."/../../..");
-my $quadruplor_dir="$src_dir_qt/tests/auto/android";
-my $qmake_path="$src_dir_qt/bin/qmake";
-my $androiddeployqt_path="$src_dir_qt/bin/androiddeployqt";
-my $tests_dir="$src_dir_qt/tests$testsubset";
-my $temp_dir=tempdir(CLEANUP => 1);
-my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-my $output_dir=$stack[0]."/".(1900+$year)."-$mon-$mday-$hour:$min";
-mkdir($output_dir);
-unlink("latest");
-system(" ln -s $output_dir latest");
-my $sdk_api=0;
-my $output = `$adb_tool $device_serial shell getprop`; # get device properties
-if ($output =~ m/.*\[ro.build.version.sdk\]: \[(\d+)\]/)
-{
- $sdk_api=int($1);
- $sdk_api=5 if ($sdk_api>5 && $sdk_api<8);
- $sdk_api=9 if ($sdk_api>9);
-}
-
-sub checkXMLOutput
-{
- print color 'bold red';
- my $fileName = shift;
- my $XMLOutput = eval { XMLin($fileName, ForceArray => 1) };
- if (!defined($XMLOutput)) {
- print "Can't parse the $fileName file, probably the test crased.\n";
- print color 'reset';
- die "Stopping\n" if $stop_on_fail;
- return;
- }
- my $testName = $XMLOutput->{name};
- my $fail = 0;
- while (my($node_key, $node_valule) = each (%{$XMLOutput})) {
- next if $node_key ne "TestFunction";
- while (my($function_key, $function_valule) = each (%{$node_valule})) {
- while (my($test_key, $test_valule) = each (%{$function_valule})) {
- next if $test_key ne "Incident";
- for my $incident (@{$test_valule}) {
- if (($incident->{type} ne "pass") && ($incident->{type} ne "xfail")) {
- print "test $testName::$function_key failed $incident->{file}:$incident->{line}\n";
- $fail = 1;
- }
- }
- }
- }
- }
- print color 'reset';
- die "Stopping\n" if $stop_on_fail and $fail;
-}
-
-sub startTest
-{
- my $testName = shift;
- my $packageName = "org.qtproject.example.tst_$testName";
- my $intentName = "$packageName/org.qtproject.qt5.android.bindings.QtActivity";
- my $output_file = shift;
- my $insignificance = shift;
- my $get_xml= 0;
- my $get_txt= 0;
- my $testLib ="";
- if ($log_out eq "xml") {
- $testLib="-o /data/data/$packageName/output.xml,xml";
- $get_xml = 1;
- } elsif ($log_out eq "txt") {
- $testLib="-o /data/data/$packageName/output.txt,txt";
- $get_txt = 1;
- } else {
- $testLib="-o /data/data/$packageName/output.xml,xml -o /data/data/$packageName/output.txt,txt";
- $get_xml = 1;
- $get_txt = 1;
- }
-
- my $cmd="${adb_tool} ${device_serial} shell am start -e applicationArguments \"${testLib}\" -n ${intentName}";
- my $res = qx(${cmd});
- print $res if (!$silent);
- #wait to start (if it has not started and quit already)
- waitForProcess($packageName,1,10);
-
- #wait to stop
- unless(waitForProcess($packageName,0,$time_out,5))
- {
- #killProcess($packageName);
- print "Someone should kill $packageName\n";
- system("$adb_tool $device_serial uninstall $packageName") if ($uninstall);
- return 1;
- }
-
- # Wait for three seconds to allow process to write all data
- sleep(3);
-
- system("$adb_tool $device_serial pull /data/data/$packageName/output.xml $output_dir/$output_file.xml") if ($get_xml);
-
- system("$adb_tool $device_serial pull /data/data/$packageName/output.txt $output_dir/$output_file.txt") if ($get_txt);
- if ($get_txt){
- print "Test results for $packageName:\n";
- my $insig =
- print_output("$output_dir/$output_file.txt", $packageName, $insignificance);
- }
- system("$adb_tool $device_serial uninstall $packageName") if ($uninstall);
-
- checkXMLOutput("$output_dir/$output_file.xml") if ($get_xml);
- return 1;
-}
-
-########### build qt tests and benchmarks ###########
-pushd($tests_dir);
-print "Building $tests_dir \n";
-system("make distclean") if ($make_clean);
-system("$qmake_path -r") == 0 or die "Can't run qmake\n"; #exec qmake
-system("make -j$jobs") == 0 or warn "Can't build all tests\n"; #exec make
-
-my $testsFiles = "";
-if ($testcase) {
- $testsFiles=`find . -name libtst_$testcase.so`; # only tests
-} else {
- $testsFiles=`find . -name libtst_*.so`; # only tests
-}
-
-foreach (split("\n",$testsFiles))
-{
- chomp; #remove white spaces
- pushd(abs_path(dirname($_))); # cd to application dir
- my $insig = check_if_insignificant();
- my $cmd="make INSTALL_ROOT=${temp_dir} install";
- my $res = qx(${cmd});
- print $res if (!$silent);
- my $application=basename(cwd);
- if ($silent) {
- $cmd="$androiddeployqt_path --install ${deployqt_device_serial} --output ${temp_dir} --deployment debug --verbose --input android-libtst_${application}.so-deployment-settings.json >/dev/null 2>&1";
- } else {
- $cmd="$androiddeployqt_path --install ${deployqt_device_serial} --output ${temp_dir} --deployment debug --verbose --input android-libtst_${application}.so-deployment-settings.json";
- }
- $res = qx(${cmd});
- print $res if (!$silent);
- my $output_name=dirname($_);
- $output_name =~ s/\.//; # remove first "." character
- $output_name =~ s/\///; # remove first "/" character
- $output_name =~ s/\//_/g; # replace all "/" with "_"
- $output_name=$application unless($output_name);
- $time_out=$max_runtime*60/5; # 5 minutes time out for a normal test
-
- $applicationLibrary = `find $temp_dir -name libtst_bench_$application.so`;
-
- if ($applicationLibrary)
- {
- $time_out=5*60/5; # 10 minutes for a benchmark
- $application = "bench_$application";
- }
- else
- {
- $applicationLibrary = `find $temp_dir -name libtst_$application.so`;
- }
-
- if (!$applicationLibrary)
- {
- print "Can't find application binary libtst_$application.so in $temp_dir!\n";
- }
- else
- {
- startTest($application, "$output_name", $insig) or warn "Can't run $application ...\n";
- }
-
- popd();
- remove_tree( $temp_dir, {keep_root => 1} );
-}
-print_summary() if ($ci_use);
-popd();
-
-__END__
-
-=head1 NAME
-
-Script to run all qt tests/benchmarks to an android device/emulator
-
-=head1 SYNOPSIS
-
-runtests.pl [options]
-
-=head1 OPTIONS
-
-=over 8
-=item B<-f --fail>
-
-Stop the script when test fails. Default 0
-
-=item B<-s --serial = serial>
-
-Device serial number. May be empty if only one device is attached.
-
-=item B<-t --test = test_subset>
-
-Tests subset (e.g. benchmarks, auto, auto/qbuffer, etc.).
-
-=item B<-c --clean>
-
-Clean tests before building them.
-
-=item B<-j --jobs = number>
-
-Make jobs when building tests.
-
-=item B<--sdk = sdk_path>
-
-Android SDK path.
-
-=item B<--ndk = ndk_path>
-
-Android NDK path.
-
-=item B<--ant = ant_tool_path>
-
-Ant tool path.
-
-=item B<--strip = strip_tool_path>
-
-Android strip tool path, used to deploy qt libs.
-
-=item B<--readelf = readelf_tool_path>
-
-Android readelf tool path, used to check if a test application uses qt OpenGL.
-
-=item B<--logtype = xml|txt|both>
-
-The format of log file, default is xml.
-
-=item B<--runtime = minutes>
-
-The timeout period before stopping individual tests from running.
-
-=item B<-silent>
-
-Suppress output of system commands.
-
-=item B<-ci>
-
-Enables checking if test is insignificant or not. Also prints test
-summary after all tests has been executed.
-
-=item B<-uninstall>
-
-Uninstalls the test after has been executed.
-
-=item B<-h --help>
-
-Print a brief help message and exits.
-
-=item B<--man>
-
-Prints the manual page and exits.
-
-=back
-
-=head1 DESCRIPTION
-
-B<This program> will run all qt tests/benchmarks to an android device/emulator.
-
-=cut
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 5b10a74d3f..ed900f7805 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -160,3 +160,5 @@ if (NOT CMAKE_VERSION VERSION_LESS 3.8)
# Reason: SKIP_* properties were added in CMake 3.8 only
expect_pass(test_QTBUG-63422)
endif()
+
+expect_pass(test_import_plugins BINARY ${CMAKE_CTEST_COMMAND})
diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro
index 9c715974f8..06509f4ad3 100644
--- a/tests/auto/cmake/cmake.pro
+++ b/tests/auto/cmake/cmake.pro
@@ -1,7 +1,12 @@
-# Cause make to do nothing.
TEMPLATE = subdirs
+# installed_cmake includes this file, and tries to add the mockplugins
+# directory relative to itself, but doesn't have its own copy of the directory.
+# So, we make the path absolute so it includes this copy of the directory
+# instead.
+SUBDIRS += $$PWD/mockplugins
+
CMAKE_QT_MODULES_UNDER_TEST = core network xml sql testlib
qtHaveModule(dbus): CMAKE_QT_MODULES_UNDER_TEST += dbus
diff --git a/tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.json b/tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.pro b/tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.pro
new file mode 100644
index 0000000000..1ccbe924ae
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock1plugin/mock1plugin.pro
@@ -0,0 +1,9 @@
+TARGET = mock1plugin
+
+HEADERS += qmock1plugin.h
+SOURCES += qmock1plugin.cpp
+QT = mockplugins1
+
+PLUGIN_TYPE = mockplugin
+PLUGIN_CLASS_NAME = QMock1Plugin
+load(qt_plugin)
diff --git a/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp
new file mode 100644
index 0000000000..2ee817d80a
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.cpp
@@ -0,0 +1,10 @@
+#include "qmock1plugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QString QMock1Plugin::pluginName() const
+{
+ return "QMock1Plugin";
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h
new file mode 100644
index 0000000000..e2e114b1d9
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock1plugin/qmock1plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCK1PLUGIN_H
+#define QMOCK1PLUGIN_H
+
+#include <QObject>
+#include <QtMockPlugins1/QMockPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QMock1Plugin : public QObject, public QMockPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QMockPlugin_iid FILE "mock1plugin.json")
+ Q_INTERFACES(QMockPlugin)
+public:
+ QString pluginName() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMOCK1PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.json b/tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.pro b/tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.pro
new file mode 100644
index 0000000000..75dc21cf0a
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock2plugin/mock2plugin.pro
@@ -0,0 +1,10 @@
+TARGET = mock2plugin
+
+HEADERS += qmock2plugin.h
+SOURCES += qmock2plugin.cpp
+QT = mockplugins1
+
+PLUGIN_TYPE = mockplugin
+PLUGIN_CLASS_NAME = QMock2Plugin
+PLUGIN_EXTENDS = mockplugins1
+load(qt_plugin)
diff --git a/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp
new file mode 100644
index 0000000000..5b3280e884
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.cpp
@@ -0,0 +1,10 @@
+#include "qmock2plugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QString QMock2Plugin::pluginName() const
+{
+ return "QMock2Plugin";
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h
new file mode 100644
index 0000000000..be99133dc8
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock2plugin/qmock2plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCK2PLUGIN_H
+#define QMOCK2PLUGIN_H
+
+#include <QObject>
+#include <QtMockPlugins1/QMockPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QMock2Plugin : public QObject, public QMockPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QMockPlugin_iid FILE "mock2plugin.json")
+ Q_INTERFACES(QMockPlugin)
+public:
+ QString pluginName() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMOCK2PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.json b/tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.pro b/tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.pro
new file mode 100644
index 0000000000..ed7df603bb
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock3plugin/mock3plugin.pro
@@ -0,0 +1,10 @@
+TARGET = mock3plugin
+
+HEADERS += qmock3plugin.h
+SOURCES += qmock3plugin.cpp
+QT = mockplugins1
+
+PLUGIN_TYPE = mockplugin
+PLUGIN_CLASS_NAME = QMock3Plugin
+PLUGIN_EXTENDS = mockplugins1 mockplugins2
+load(qt_plugin)
diff --git a/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp
new file mode 100644
index 0000000000..b38f854e4b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.cpp
@@ -0,0 +1,10 @@
+#include "qmock3plugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QString QMock3Plugin::pluginName() const
+{
+ return "QMock3Plugin";
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h
new file mode 100644
index 0000000000..08d1aa68ce
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock3plugin/qmock3plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCK3PLUGIN_H
+#define QMOCK3PLUGIN_H
+
+#include <QObject>
+#include <QtMockPlugins1/QMockPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QMock3Plugin : public QObject, public QMockPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QMockPlugin_iid FILE "mock3plugin.json")
+ Q_INTERFACES(QMockPlugin)
+public:
+ QString pluginName() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMOCK3PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.json b/tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.pro b/tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.pro
new file mode 100644
index 0000000000..4dd2d6c547
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock4plugin/mock4plugin.pro
@@ -0,0 +1,10 @@
+TARGET = mock4plugin
+
+HEADERS += qmock4plugin.h
+SOURCES += qmock4plugin.cpp
+QT = mockplugins1
+
+PLUGIN_TYPE = mockplugin
+PLUGIN_CLASS_NAME = QMock4Plugin
+PLUGIN_EXTENDS = -
+load(qt_plugin)
diff --git a/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp
new file mode 100644
index 0000000000..5deaf7f43f
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.cpp
@@ -0,0 +1,10 @@
+#include "qmock4plugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QString QMock4Plugin::pluginName() const
+{
+ return "QMock4Plugin";
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h
new file mode 100644
index 0000000000..0776bef002
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock4plugin/qmock4plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCK4PLUGIN_H
+#define QMOCK4PLUGIN_H
+
+#include <QObject>
+#include <QtMockPlugins1/QMockPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QMock4Plugin : public QObject, public QMockPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QMockPlugin_iid FILE "mock4plugin.json")
+ Q_INTERFACES(QMockPlugin)
+public:
+ QString pluginName() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMOCK4PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.json b/tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.pro b/tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.pro
new file mode 100644
index 0000000000..29496868fe
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock5plugin/mock5plugin.pro
@@ -0,0 +1,10 @@
+TARGET = mock5plugin
+
+HEADERS += qmock5plugin.h
+SOURCES += qmock5plugin.cpp
+QT = mockplugins3
+
+PLUGIN_TYPE = mockplugin
+PLUGIN_CLASS_NAME = QMock5Plugin
+PLUGIN_EXTENDS = -
+load(qt_plugin)
diff --git a/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp
new file mode 100644
index 0000000000..c5b4620516
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.cpp
@@ -0,0 +1,10 @@
+#include "qmock5plugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QString QMock5Plugin::pluginName() const
+{
+ return "QMock5Plugin";
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h
new file mode 100644
index 0000000000..2f387da203
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock5plugin/qmock5plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCK5PLUGIN_H
+#define QMOCK5PLUGIN_H
+
+#include <QObject>
+#include <QtMockPlugins1/QMockPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QMock5Plugin : public QObject, public QMockPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QMockPlugin_iid FILE "mock5plugin.json")
+ Q_INTERFACES(QMockPlugin)
+public:
+ QString pluginName() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMOCK5PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.json b/tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.json
@@ -0,0 +1 @@
+{}
diff --git a/tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.pro b/tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.pro
new file mode 100644
index 0000000000..140f198811
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock6plugin/mock6plugin.pro
@@ -0,0 +1,9 @@
+TARGET = mock6plugin
+
+HEADERS += qmock6plugin.h
+SOURCES += qmock6plugin.cpp
+QT = mockplugins3
+
+PLUGIN_TYPE = mockauxplugin
+PLUGIN_CLASS_NAME = QMock6Plugin
+load(qt_plugin)
diff --git a/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp
new file mode 100644
index 0000000000..4a0329c68a
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.cpp
@@ -0,0 +1,10 @@
+#include "qmock6plugin.h"
+
+QT_BEGIN_NAMESPACE
+
+QString QMock6Plugin::pluginName() const
+{
+ return "QMock6Plugin";
+}
+
+QT_END_NAMESPACE
diff --git a/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h
new file mode 100644
index 0000000000..6b29b6703b
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mock6plugin/qmock6plugin.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCK6PLUGIN_H
+#define QMOCK6PLUGIN_H
+
+#include <QObject>
+#include <QtMockPlugins3/QMockAuxPlugin>
+
+QT_BEGIN_NAMESPACE
+
+class QMock6Plugin : public QObject, public QMockAuxPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QMockAuxPlugin_iid FILE "mock6plugin.json")
+ Q_INTERFACES(QMockAuxPlugin)
+public:
+ QString pluginName() const override;
+};
+
+QT_END_NAMESPACE
+
+#endif // QMOCK6PLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mockplugins.pro b/tests/auto/cmake/mockplugins/mockplugins.pro
new file mode 100644
index 0000000000..830d130a05
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins.pro
@@ -0,0 +1,36 @@
+TEMPLATE = subdirs
+
+src_mock1plugin.subdir = $$PWD/mock1plugin
+src_mock1plugin.target = sub-mockplugin1
+src_mock1plugin.depends = mockplugins1
+
+src_mock2plugin.subdir = $$PWD/mock2plugin
+src_mock2plugin.target = sub-mockplugin2
+src_mock2plugin.depends = mockplugins1
+
+src_mock3plugin.subdir = $$PWD/mock3plugin
+src_mock3plugin.target = sub-mockplugin3
+src_mock3plugin.depends = mockplugins1
+
+src_mock4plugin.subdir = $$PWD/mock4plugin
+src_mock4plugin.target = sub-mockplugin4
+src_mock4plugin.depends = mockplugins1
+
+src_mock5plugin.subdir = $$PWD/mock5plugin
+src_mock5plugin.target = sub-mockplugin5
+src_mock5plugin.depends = mockplugins3
+
+src_mock6plugin.subdir = $$PWD/mock6plugin
+src_mock6plugin.target = sub-mockplugin6
+src_mock6plugin.depends = mockplugins3
+
+SUBDIRS += \
+ mockplugins1 \
+ mockplugins2 \
+ mockplugins3 \
+ src_mock1plugin \
+ src_mock2plugin \
+ src_mock3plugin \
+ src_mock4plugin \
+ src_mock5plugin \
+ src_mock6plugin
diff --git a/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp b/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp
new file mode 100644
index 0000000000..f95eba6055
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins1/fake.cpp
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtGlobal>
+
+// Empty exported function needed to create .lib on Windows.
+Q_DECL_EXPORT void mockplugins1_foo() {
+
+}
diff --git a/tests/auto/cmake/mockplugins/mockplugins1/mockplugins1.pro b/tests/auto/cmake/mockplugins/mockplugins1/mockplugins1.pro
new file mode 100644
index 0000000000..dd98937ee3
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins1/mockplugins1.pro
@@ -0,0 +1,10 @@
+TARGET = QtMockPlugins1
+QT = core
+MODULE_PLUGIN_TYPES = mockplugin
+
+# Fake a git_build, to force qmake to run syncqt.pl when doing a standalone tests build
+# like it is done in Coin, otherwise module headers would not be generated.
+CONFIG += git_build
+HEADERS += qmockplugin.h
+SOURCES += fake.cpp # Needed to make libtool / ar happy on macOS
+load(qt_module)
diff --git a/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h b/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h
new file mode 100644
index 0000000000..9427ae9212
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins1/qmockplugin.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCKPLUGIN_H
+#define QMOCKPLUGIN_H
+
+#include <QString>
+#include <QtPlugin>
+
+QT_BEGIN_NAMESPACE
+
+#define QMockPlugin_iid "org.qt-project.Qt.Tests.QMockPlugin"
+
+class QMockPlugin
+{
+public:
+ virtual ~QMockPlugin() {}
+ virtual QString pluginName() const = 0;
+};
+
+Q_DECLARE_INTERFACE(QMockPlugin, QMockPlugin_iid)
+
+QT_END_NAMESPACE
+
+#endif // QMOCKPLUGIN_H
diff --git a/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp b/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp
new file mode 100644
index 0000000000..384623d646
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins2/fake.cpp
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtGlobal>
+
+// Empty exported function needed to create .lib on Windows.
+Q_DECL_EXPORT void mockplugins2_foo() {
+
+}
diff --git a/tests/auto/cmake/mockplugins/mockplugins2/mockplugins2.pro b/tests/auto/cmake/mockplugins/mockplugins2/mockplugins2.pro
new file mode 100644
index 0000000000..1dd03391e8
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins2/mockplugins2.pro
@@ -0,0 +1,4 @@
+TARGET = QtMockPlugins2
+QT = core
+SOURCES += fake.cpp # Needed to make libtool / ar happy on macOS
+load(qt_module)
diff --git a/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp b/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp
new file mode 100644
index 0000000000..9ec2b42181
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins3/fake.cpp
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QtGlobal>
+
+// Empty exported function needed to create .lib on Windows.
+Q_DECL_EXPORT void mockplugins3_foo() {
+
+}
diff --git a/tests/auto/cmake/mockplugins/mockplugins3/mockplugins3.pro b/tests/auto/cmake/mockplugins/mockplugins3/mockplugins3.pro
new file mode 100644
index 0000000000..3651abaafa
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins3/mockplugins3.pro
@@ -0,0 +1,11 @@
+TARGET = QtMockPlugins3
+QT = core
+MODULE_PLUGIN_TYPES = mockauxplugin
+
+# Fake a git_build, to force qmake to run syncqt.pl when doing a standalone tests build
+# like it is done in Coin, otherwise module headers would not be generated.
+CONFIG += git_build
+HEADERS += qmockauxplugin.h
+SOURCES += fake.cpp # Needed to make libtool / ar happy on macOS
+
+load(qt_module)
diff --git a/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h b/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h
new file mode 100644
index 0000000000..25e4762bac
--- /dev/null
+++ b/tests/auto/cmake/mockplugins/mockplugins3/qmockauxplugin.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QMOCKAUXPLUGIN_H
+#define QMOCKAUXPLUGIN_H
+
+#include <QString>
+#include <QtPlugin>
+
+QT_BEGIN_NAMESPACE
+
+#define QMockAuxPlugin_iid "org.qt-project.Qt.Tests.QMockAuxPlugin"
+
+class QMockAuxPlugin
+{
+public:
+ virtual ~QMockAuxPlugin() {}
+ virtual QString pluginName() const = 0;
+};
+
+Q_DECLARE_INTERFACE(QMockAuxPlugin, QMockAuxPlugin_iid)
+
+QT_END_NAMESPACE
+
+#endif // QMOCKAUXPLUGIN_H
diff --git a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
index a0b82caee4..b9b9756699 100644
--- a/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
+++ b/tests/auto/cmake/test_QTBUG-63422/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.8)
project(test_dependent_modules)
+# Need to set the policy to link to qtmain.lib automatically.
+cmake_policy(SET CMP0020 NEW)
+
find_package(Qt5Widgets REQUIRED)
set(CMAKE_AUTOMOC ON)
diff --git a/tests/auto/cmake/test_import_plugins/CMakeLists.txt b/tests/auto/cmake/test_import_plugins/CMakeLists.txt
new file mode 100644
index 0000000000..a793fe211d
--- /dev/null
+++ b/tests/auto/cmake/test_import_plugins/CMakeLists.txt
@@ -0,0 +1,111 @@
+
+cmake_minimum_required(VERSION 3.1)
+
+project(import_plugins_advanced)
+enable_testing()
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+ include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+endif()
+
+# Need to find Qt5Core explicitly because the MockPlugins1 and MockPlugins2 config files
+# are in a different directory (the source dir) when doing a standalone tests build,
+# whereas Core is in the installed directory, and due to NO_DEFAULT_PATH being used
+# for the Core dependency call in Qt5MockPlugins, Core would not be found in the source
+# dir.
+find_package(Qt5 COMPONENTS Core REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
+get_target_property(qt_is_static Qt5::Core TYPE)
+
+# For a similar reason, we need to find the MockPlugins packages not via COMPONENTS argument,
+# but directly, because the location of Qt5Config.cmake is in the installed dir, while
+# the MockPlugins are in the source dir, and Qt5Config only looks for packages relative
+# to its own location.
+# The packages are still successfuly found, because the CMAKE_PREFIX_PATH populated by qmake
+# contains both the installed Qt dir, and the Qt source dir.
+find_package(Qt5MockPlugins1 REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
+find_package(Qt5MockPlugins2 REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
+
+function(create_test_executable TARGET_NAME)
+ set(CHECK_FILE ${CMAKE_BINARY_DIR}/${TARGET_NAME}_check.cpp)
+
+ set(EXPECTED_PLUGINS)
+ foreach(_p ${ARGN})
+ string(APPEND EXPECTED_PLUGINS " \"${_p}\",\n")
+ endforeach()
+ configure_file("${CMAKE_SOURCE_DIR}/check.cpp.in" ${CHECK_FILE})
+
+ add_executable(${TARGET_NAME} main.cpp ${CHECK_FILE})
+ target_link_libraries(${TARGET_NAME} Qt5::MockPlugins1)
+ add_test(test_${TARGET_NAME} ${TARGET_NAME})
+endfunction()
+
+create_test_executable(default QMock1Plugin QMock2Plugin)
+# No call to qt5_import_plugins() for the default
+
+# TODO This test is known to fail because CMake currently doesn't have a way to
+# implement its own equivalent of the PLUGIN_EXTENDS mechanism at generate-
+# time (meaning a library only gets linked if a set of other libraries are
+# *also* linked.) CMake 3.14 or beyond may have such a mechanism, but until
+# then, this test is expected to fail, because QMock3Plugin is not being
+# linked even though MockPlugins2 is present.
+create_test_executable(default_link QMock1Plugin QMock2Plugin QMock3Plugin)
+target_link_libraries(default_link Qt5::MockPlugins2)
+set_property(TEST test_default_link PROPERTY DISABLED 1)
+# No call to qt5_import_plugins() for the default
+
+create_test_executable(manual QMock1Plugin QMock2Plugin QMock3Plugin QMock4Plugin)
+qt5_import_plugins(manual
+ INCLUDE Qt5::QMock3Plugin Qt5::QMock4Plugin
+)
+
+create_test_executable(manual_genex QMock1Plugin QMock2Plugin QMock3Plugin)
+qt5_import_plugins(manual_genex
+ INCLUDE $<1:Qt5::QMock3Plugin> $<0:Qt5::QMock4Plugin>
+)
+
+create_test_executable(blacklist QMock1Plugin)
+qt5_import_plugins(blacklist
+ EXCLUDE Qt5::QMock2Plugin Qt5::QMock3Plugin
+)
+
+create_test_executable(blacklist_genex QMock1Plugin)
+qt5_import_plugins(blacklist_genex
+ EXCLUDE $<1:Qt5::QMock2Plugin> $<1:Qt5::QMock3Plugin> $<0:Qt5::QMock1Plugin>
+)
+
+create_test_executable(override QMock3Plugin QMock4Plugin)
+qt5_import_plugins(override
+ INCLUDE_BY_TYPE mockplugin Qt5::QMock3Plugin Qt5::QMock4Plugin
+)
+
+create_test_executable(override_genex QMock3Plugin)
+qt5_import_plugins(override_genex
+ INCLUDE_BY_TYPE mockplugin $<1:Qt5::QMock3Plugin> $<0:Qt5::QMock4Plugin>
+)
+
+create_test_executable(override_mix QMock2Plugin QMock3Plugin)
+qt5_import_plugins(override_mix
+ INCLUDE Qt5::QMock2Plugin
+ INCLUDE_BY_TYPE mockplugin Qt5::QMock3Plugin
+)
+
+if(NOT WIN32)
+ # Compiling an empty static array fails on Windows.
+ create_test_executable(none)
+ qt5_import_plugins(none
+ EXCLUDE_BY_TYPE mockplugin
+ )
+endif()
+
+create_test_executable(none_mix QMock3Plugin QMock4Plugin)
+qt5_import_plugins(none_mix
+ INCLUDE Qt5::QMock3Plugin Qt5::QMock4Plugin
+ EXCLUDE_BY_TYPE mockplugin
+)
+
+create_test_executable(recursive QMock5Plugin QMock6Plugin)
+qt5_import_plugins(recursive
+ INCLUDE_BY_TYPE mockplugin Qt5::QMock5Plugin
+)
diff --git a/tests/auto/cmake/test_import_plugins/check.cpp.in b/tests/auto/cmake/test_import_plugins/check.cpp.in
new file mode 100644
index 0000000000..df6ea03d2d
--- /dev/null
+++ b/tests/auto/cmake/test_import_plugins/check.cpp.in
@@ -0,0 +1,8 @@
+#include <QString>
+#include <cstddef>
+
+QString expectedPlugins[] = {
+@EXPECTED_PLUGINS@
+};
+
+std::size_t numExpectedPlugins = sizeof(expectedPlugins) / sizeof(numExpectedPlugins);
diff --git a/tests/auto/cmake/test_import_plugins/main.cpp b/tests/auto/cmake/test_import_plugins/main.cpp
new file mode 100644
index 0000000000..9fcc81754b
--- /dev/null
+++ b/tests/auto/cmake/test_import_plugins/main.cpp
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Kitware, Inc.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 <QPluginLoader>
+#include <QSet>
+#include <QString>
+#include <QVector>
+
+#include <cstddef>
+#include <iostream>
+
+extern QString expectedPlugins[];
+extern std::size_t numExpectedPlugins;
+
+int main(int argc, char **argv)
+{
+#ifdef QT_STATIC
+ QSet<QString> expectedPluginSet;
+ for (std::size_t i = 0; i < numExpectedPlugins; i++) {
+ expectedPluginSet.insert(expectedPlugins[i]);
+ }
+
+ QVector<QStaticPlugin> plugins = QPluginLoader::staticPlugins();
+ QSet<QString> actualPluginSet;
+ for (QStaticPlugin plugin : plugins) {
+ actualPluginSet.insert(plugin.metaData()["className"].toString());
+ }
+
+ if (expectedPluginSet != actualPluginSet) {
+ std::cerr << "Loaded plugins do not match what was expected!" << std::endl
+ << "Expected plugins:" << std::endl;
+
+ QList<QString> expectedPluginList = expectedPluginSet.toList();
+ expectedPluginList.sort();
+ for (QString plugin : expectedPluginList) {
+ std::cerr << (actualPluginSet.contains(plugin) ? " " : "- ")
+ << plugin.toStdString() << std::endl;
+ }
+
+ std::cerr << std::endl << "Actual plugins:" << std::endl;
+
+ QList<QString> actualPluginList = actualPluginSet.toList();
+ actualPluginList.sort();
+ for (QString plugin : actualPluginList) {
+ std::cerr << (expectedPluginSet.contains(plugin) ? " " : "+ ")
+ << plugin.toStdString() << std::endl;
+ }
+
+ return 1;
+ }
+
+#endif
+ return 0;
+}
diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt
index 2af80ea448..fdd1aacc10 100644
--- a/tests/auto/cmake/test_interface/CMakeLists.txt
+++ b/tests/auto/cmake/test_interface/CMakeLists.txt
@@ -25,6 +25,9 @@ int main(int,char**) { QWidget w; w.show(); return 0; }
"
)
+# Fix try_compile to inherit the parent configuration.
+set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}")
+
# The try_compile works because Qt5::Widgets is listed in the LINK_LIBRARIES,
# which causes the includes, defines and appropriate PIC flag to be used.
try_compile(_TRY_COMPILE_RES "${CMAKE_CURRENT_BINARY_DIR}/try_compile-test"
diff --git a/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt b/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt
index e97ac199e8..f3299060fd 100644
--- a/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt
+++ b/tests/auto/cmake/test_moc_macro_target/CMakeLists.txt
@@ -11,13 +11,13 @@ qt5_generate_moc(main_gen_test.cpp
"${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc"
TARGET Qt5GenerateMacroTest
)
-add_executable(Qt5GenerateMacroTest WIN32 main_gen_test.cpp "${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc")
+add_executable(Qt5GenerateMacroTest main_gen_test.cpp "${CMAKE_CURRENT_BINARY_DIR}/main_gen_test.moc")
target_include_directories(Qt5GenerateMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface")
target_link_libraries(Qt5GenerateMacroTest Qt5::Core)
qt5_wrap_cpp(moc_file mywrapobject.h
TARGET Qt5WrapMacroTest
)
-add_executable(Qt5WrapMacroTest WIN32 main_wrap_test.cpp ${moc_file})
+add_executable(Qt5WrapMacroTest main_wrap_test.cpp ${moc_file})
target_include_directories(Qt5WrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface")
target_link_libraries(Qt5WrapMacroTest Qt5::Core)
diff --git a/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro
index f3684faa61..15345d40db 100644
--- a/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro
+++ b/tests/auto/concurrent/qtconcurrentfilter/qtconcurrentfilter.pro
@@ -3,3 +3,4 @@ TARGET = tst_qtconcurrentfilter
QT = core testlib concurrent
SOURCES = tst_qtconcurrentfilter.cpp
DEFINES += QT_STRICT_ITERATORS
+DEFINES -= QT_NO_LINKED_LIST
diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index 2e698e6615..3c77b1ba0b 100644
--- a/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -88,7 +88,7 @@ QAtomicInt iterations;
class PrintFor : public IterateKernel<TestIterator, void>
{
public:
- PrintFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.store(0); }
+ PrintFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.storeRelaxed(0); }
bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *)
{
iterations.fetchAndAddRelaxed(end - begin);
@@ -107,7 +107,7 @@ public:
class SleepPrintFor : public IterateKernel<TestIterator, void>
{
public:
- SleepPrintFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.store(0); }
+ SleepPrintFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.storeRelaxed(0); }
inline bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *)
{
QTest::qSleep(200);
@@ -127,7 +127,7 @@ public:
void tst_QtConcurrentIterateKernel::instantiate()
{
startThreadEngine(new PrintFor(0, 40)).startBlocking();
- QCOMPARE(iterations.load(), 40);
+ QCOMPARE(iterations.loadRelaxed(), 40);
}
void tst_QtConcurrentIterateKernel::cancel()
@@ -138,8 +138,8 @@ void tst_QtConcurrentIterateKernel::cancel()
f.waitForFinished();
QVERIFY(f.isCanceled());
// the threads might run one iteration each before they are canceled.
- QVERIFY2(iterations.load() <= QThread::idealThreadCount(),
- (QByteArray::number(iterations.load()) + ' ' + QByteArray::number(QThread::idealThreadCount())));
+ QVERIFY2(iterations.loadRelaxed() <= QThread::idealThreadCount(),
+ (QByteArray::number(iterations.loadRelaxed()) + ' ' + QByteArray::number(QThread::idealThreadCount())));
}
}
@@ -147,7 +147,7 @@ QAtomicInt counter;
class CountFor : public IterateKernel<TestIterator, void>
{
public:
- CountFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.store(0); }
+ CountFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.storeRelaxed(0); }
inline bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *)
{
counter.fetchAndAddRelaxed(end - begin);
@@ -164,10 +164,10 @@ void tst_QtConcurrentIterateKernel::stresstest()
const int iterations = 1000;
const int times = 50;
for (int i = 0; i < times; ++i) {
- counter.store(0);
+ counter.storeRelaxed(0);
CountFor f(0, iterations);
f.startBlocking();
- QCOMPARE(counter.load(), iterations);
+ QCOMPARE(counter.loadRelaxed(), iterations);
}
}
@@ -186,7 +186,7 @@ public:
// this class throttles between iterations 100 and 200,
// and then records how many threads that run between
// iterations 140 and 160.
- ThrottleFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.store(0); throttling = false; }
+ ThrottleFor(TestIterator begin, TestIterator end) : IterateKernel<TestIterator, void>(begin, end) { iterations.storeRelaxed(0); throttling = false; }
inline bool runIterations(TestIterator/*beginIterator*/, int begin, int end, void *)
{
if (200 >= begin && 200 < end) {
@@ -217,7 +217,7 @@ public:
bool shouldThrottleThread()
{
- const int load = iterations.load();
+ const int load = iterations.loadRelaxed();
return (load > 100 && load < 200);
}
bool throttling;
@@ -226,14 +226,14 @@ public:
void tst_QtConcurrentIterateKernel::throttling()
{
const int totalIterations = 400;
- iterations.store(0);
+ iterations.storeRelaxed(0);
threads.clear();
ThrottleFor f(0, totalIterations);
f.startBlocking();
- QCOMPARE(iterations.load(), totalIterations);
+ QCOMPARE(iterations.loadRelaxed(), totalIterations);
QCOMPARE(threads.count(), 1);
diff --git a/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro
index fd8fd0a74a..717d103e44 100644
--- a/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro
+++ b/tests/auto/concurrent/qtconcurrentmap/qtconcurrentmap.pro
@@ -3,6 +3,7 @@ TARGET = tst_qtconcurrentmap
QT = core testlib concurrent
SOURCES = tst_qtconcurrentmap.cpp
DEFINES += QT_STRICT_ITERATORS
+DEFINES -= QT_NO_LINKED_LIST
# Force C++17 if available
contains(QT_CONFIG, c++1z): CONFIG += c++1z
diff --git a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
index b864b065e6..383de0b2ce 100644
--- a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -127,14 +127,11 @@ void tst_QtConcurrentMap::map()
QtConcurrent::map(numberList.begin(), numberList.end(), &Number::multiplyBy2).waitForFinished();
QCOMPARE(numberList, QList<Number>() << 4 << 8 << 12);
-#ifdef Q_COMPILER_LAMBDA
// lambda
QtConcurrent::map(list, [](int &x){x *= 2;}).waitForFinished();
QCOMPARE(list, QList<int>() << 128 << 256 << 384);
QtConcurrent::map(list.begin(), list.end(), [](int &x){x *= 2;}).waitForFinished();
QCOMPARE(list, QList<int>() << 256 << 512 << 768);
-#endif
-
}
// functors don't take arguments by reference, making these no-ops
@@ -160,13 +157,11 @@ void tst_QtConcurrentMap::map()
QtConcurrent::map(list.begin(), list.end(), multiplyBy2Immutable).waitForFinished();
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
-#ifdef Q_COMPILER_LAMBDA
// lambda
QtConcurrent::map(list, [](int x){x *= 2;}).waitForFinished();
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
QtConcurrent::map(list.begin(), list.end(), [](int x){x *= 2;}).waitForFinished();
QCOMPARE(list, QList<int>() << 1 << 2 << 3);
-#endif
}
// Linked lists and forward iterators
@@ -2026,12 +2021,12 @@ int fn(int &i)
return i;
}
-int fnConstNoExcept(const int &i) Q_DECL_NOTHROW
+int fnConstNoExcept(const int &i) noexcept
{
return i;
}
-int fnNoExcept(int &i) Q_DECL_NOTHROW
+int fnNoExcept(int &i) noexcept
{
return i;
}
@@ -2046,12 +2041,12 @@ QString changeType(int &)
return QString();
}
-QString changeTypeConstNoExcept(const int &) Q_DECL_NOTHROW
+QString changeTypeConstNoExcept(const int &) noexcept
{
return QString();
}
-QString changeTypeNoExcept(int &) Q_DECL_NOTHROW
+QString changeTypeNoExcept(int &) noexcept
{
return QString();
}
@@ -2066,12 +2061,12 @@ int changeTypeQStringList(QStringList &)
return 0;
}
-int changeTypeQStringListConstNoExcept(const QStringList &) Q_DECL_NOTHROW
+int changeTypeQStringListConstNoExcept(const QStringList &) noexcept
{
return 0;
}
-int changeTypeQStringListNoExcept(QStringList &) Q_DECL_NOTHROW
+int changeTypeQStringListNoExcept(QStringList &) noexcept
{
return 0;
}
@@ -2101,22 +2096,22 @@ public:
return QString();
}
- MemFnTester fnNoExcept() Q_DECL_NOTHROW
+ MemFnTester fnNoExcept() noexcept
{
return MemFnTester();
}
- MemFnTester fnConstNoExcept() const Q_DECL_NOTHROW
+ MemFnTester fnConstNoExcept() const noexcept
{
return MemFnTester();
}
- QString changeTypeNoExcept() Q_DECL_NOTHROW
+ QString changeTypeNoExcept() noexcept
{
return QString();
}
- QString changeTypeConstNoExcept() const Q_DECL_NOTHROW
+ QString changeTypeConstNoExcept() const noexcept
{
return QString();
}
@@ -2186,8 +2181,8 @@ public:
void updatePeak()
{
forever {
- const int localPeak = peakInstanceCount.load();
- const int localCurrent = currentInstanceCount.load();
+ const int localPeak = peakInstanceCount.loadRelaxed();
+ const int localCurrent = currentInstanceCount.loadRelaxed();
if (localCurrent <= localPeak)
break;
if (peakInstanceCount.testAndSetOrdered(localPeak, localCurrent))
@@ -2225,35 +2220,35 @@ void tst_QtConcurrentMap::throttling()
const int allowedTemporaries = QThread::idealThreadCount() * 40;
{
- currentInstanceCount.store(0);
- peakInstanceCount.store(0);
+ currentInstanceCount.storeRelaxed(0);
+ peakInstanceCount.storeRelaxed(0);
QList<InstanceCounter> instances;
for (int i = 0; i < itemcount; ++i)
instances.append(InstanceCounter());
- QCOMPARE(currentInstanceCount.load(), itemcount);
+ QCOMPARE(currentInstanceCount.loadRelaxed(), itemcount);
int results = QtConcurrent::blockingMappedReduced(instances, slowMap, fastReduce);
QCOMPARE(results, itemcount);
- QCOMPARE(currentInstanceCount.load(), itemcount);
- QVERIFY(peakInstanceCount.load() < itemcount + allowedTemporaries);
+ QCOMPARE(currentInstanceCount.loadRelaxed(), itemcount);
+ QVERIFY(peakInstanceCount.loadRelaxed() < itemcount + allowedTemporaries);
}
{
- QCOMPARE(currentInstanceCount.load(), 0);
- peakInstanceCount.store(0);
+ QCOMPARE(currentInstanceCount.loadRelaxed(), 0);
+ peakInstanceCount.storeRelaxed(0);
QList<InstanceCounter> instances;
for (int i = 0; i < itemcount; ++i)
instances.append(InstanceCounter());
- QCOMPARE(currentInstanceCount.load(), itemcount);
+ QCOMPARE(currentInstanceCount.loadRelaxed(), itemcount);
int results = QtConcurrent::blockingMappedReduced(instances, fastMap, slowReduce);
QCOMPARE(results, itemcount);
- QCOMPARE(currentInstanceCount.load(), itemcount);
- QVERIFY(peakInstanceCount.load() < itemcount + allowedTemporaries);
+ QCOMPARE(currentInstanceCount.loadRelaxed(), itemcount);
+ QVERIFY(peakInstanceCount.loadRelaxed() < itemcount + allowedTemporaries);
}
}
@@ -2385,8 +2380,8 @@ InstanceCounter ic_fn(const InstanceCounter & ic)
// assigned over with operator ==
void tst_QtConcurrentMap::qFutureAssignmentLeak()
{
- currentInstanceCount.store(0);
- peakInstanceCount.store(0);
+ currentInstanceCount.storeRelaxed(0);
+ peakInstanceCount.storeRelaxed(0);
QFuture<InstanceCounter> future;
{
QList<InstanceCounter> list;
@@ -2405,9 +2400,9 @@ void tst_QtConcurrentMap::qFutureAssignmentLeak()
// Use QTRY_COMPARE because QtConcurrent::ThreadEngine::asynchronousFinish()
// deletes its internals after signaling finished, so it might still be holding
// on to copies of InstanceCounter for a short while.
- QTRY_COMPARE(currentInstanceCount.load(), 1000);
+ QTRY_COMPARE(currentInstanceCount.loadRelaxed(), 1000);
future = QFuture<InstanceCounter>();
- QTRY_COMPARE(currentInstanceCount.load(), 0);
+ QTRY_COMPARE(currentInstanceCount.loadRelaxed(), 0);
}
inline void increment(int &num)
diff --git a/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
index 1596a9fafd..a4eb2936b5 100644
--- a/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
@@ -48,12 +48,8 @@ private slots:
#ifndef QT_NO_EXCEPTIONS
void exceptions();
#endif
-#ifdef Q_COMPILER_DECLTYPE
void functor();
-#endif
-#ifdef Q_COMPILER_LAMBDA
void lambda();
-#endif
};
void light()
@@ -126,23 +122,23 @@ public:
class ANoExcept
{
public:
- int member0() Q_DECL_NOTHROW { return 10; }
- int member1(int in) Q_DECL_NOTHROW { return in; }
+ int member0() noexcept { return 10; }
+ int member1(int in) noexcept { return in; }
typedef int result_type;
- int operator()() Q_DECL_NOTHROW { return 10; }
- int operator()(int in) Q_DECL_NOTHROW { return in; }
+ int operator()() noexcept { return 10; }
+ int operator()(int in) noexcept { return in; }
};
class AConstNoExcept
{
public:
- int member0() const Q_DECL_NOTHROW { return 10; }
- int member1(int in) const Q_DECL_NOTHROW { return in; }
+ int member0() const noexcept { return 10; }
+ int member1(int in) const noexcept { return in; }
typedef int result_type;
- int operator()() const Q_DECL_NOTHROW { return 10; }
- int operator()(int in) const Q_DECL_NOTHROW { return in; }
+ int operator()() const noexcept { return 10; }
+ int operator()(int in) const noexcept { return in; }
};
void tst_QtConcurrentRun::returnValue()
@@ -510,17 +506,17 @@ void tst_QtConcurrentRun::recursive()
int levels = 15;
for (int i = 0; i < QThread::idealThreadCount(); ++i) {
- count.store(0);
+ count.storeRelaxed(0);
QThreadPool::globalInstance()->setMaxThreadCount(i);
recursiveRun(levels);
- QCOMPARE(count.load(), (int)std::pow(2.0, levels) - 1);
+ QCOMPARE(count.loadRelaxed(), (int)std::pow(2.0, levels) - 1);
}
for (int i = 0; i < QThread::idealThreadCount(); ++i) {
- count.store(0);
+ count.storeRelaxed(0);
QThreadPool::globalInstance()->setMaxThreadCount(i);
recursiveResult(levels);
- QCOMPARE(count.load(), (int)std::pow(2.0, levels) - 1);
+ QCOMPARE(count.loadRelaxed(), (int)std::pow(2.0, levels) - 1);
}
}
@@ -574,7 +570,7 @@ public:
static QAtomicInt cancel;
void run() override {
int iter = 60;
- while (--iter && !cancel.load())
+ while (--iter && !cancel.loadRelaxed())
QThread::currentThread()->msleep(25);
}
};
@@ -642,13 +638,12 @@ void tst_QtConcurrentRun::exceptions()
caught = true;
}
- SlowTask::cancel.store(true);
+ SlowTask::cancel.storeRelaxed(true);
QVERIFY2(caught, "did not get exception");
}
#endif
-#ifdef Q_COMPILER_DECLTYPE
// Compiler supports decltype
struct Functor {
int operator()() { return 42; }
@@ -706,9 +701,7 @@ void tst_QtConcurrentRun::functor()
QtConcurrent::run(&pool, f, 1,2,3,4,5).waitForFinished();
}
}
-#endif
-#ifdef Q_COMPILER_LAMBDA
// Compiler supports lambda
void tst_QtConcurrentRun::lambda()
{
@@ -717,14 +710,12 @@ void tst_QtConcurrentRun::lambda()
QCOMPARE(QtConcurrent::run([](int a, double b){ return a + b; }, 12, 15).result(), double(12+15));
QCOMPARE(QtConcurrent::run([](int a , int, int, int, int b){ return a + b; }, 1, 2, 3, 4, 5).result(), 1 + 5);
-#ifdef Q_COMPILER_INITIALIZER_LISTS
{
QString str { "Hello World Foo" };
QFuture<QStringList> f1 = QtConcurrent::run([&](){ return str.split(' '); });
auto r = f1.result();
QCOMPARE(r, QStringList({"Hello", "World", "Foo"}));
}
-#endif
// and now with explicit pool:
QThreadPool pool;
@@ -733,16 +724,13 @@ void tst_QtConcurrentRun::lambda()
QCOMPARE(QtConcurrent::run(&pool, [](int a, double b){ return a + b; }, 12, 15).result(), double(12+15));
QCOMPARE(QtConcurrent::run(&pool, [](int a , int, int, int, int b){ return a + b; }, 1, 2, 3, 4, 5).result(), 1 + 5);
-#ifdef Q_COMPILER_INITIALIZER_LISTS
{
QString str { "Hello World Foo" };
QFuture<QStringList> f1 = QtConcurrent::run(&pool, [&](){ return str.split(' '); });
auto r = f1.result();
QCOMPARE(r, QStringList({"Hello", "World", "Foo"}));
}
-#endif
}
-#endif
QTEST_MAIN(tst_QtConcurrentRun)
#include "tst_qtconcurrentrun.moc"
diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
index a68f7d5a4e..d4c669cddc 100644
--- a/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
+++ b/tests/auto/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
@@ -28,6 +28,7 @@
#include <qtconcurrentthreadengine.h>
#include <qexception.h>
#include <QThread>
+#include <QElapsedTimer>
#include <QtTest/QtTest>
using namespace QtConcurrent;
@@ -186,7 +187,7 @@ class ThrottleAlwaysUser : public ThreadEngine<void>
public:
ThrottleAlwaysUser()
{
- count.store(initialCount = 100);
+ count.storeRelaxed(initialCount = 100);
finishing = false;
}
@@ -198,7 +199,7 @@ public:
ThreadFunctionResult threadFunction()
{
forever {
- const int local = count.load();
+ const int local = count.loadRelaxed();
if (local == 0) {
finishing = true;
return ThreadFinished;
@@ -223,13 +224,13 @@ void tst_QtConcurrentThreadEngine::throttle()
for (int i = 0; i < repeats; ++i) {
QFuture<void> f = (new ThrottleAlwaysUser())->startAsynchronously();
f.waitForFinished();
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
}
for (int i = 0; i < repeats; ++i) {
ThrottleAlwaysUser t;
t.startBlocking();
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
}
}
@@ -382,7 +383,7 @@ void tst_QtConcurrentThreadEngine::cancelQueuedSlowUser()
{
const int times = 100;
- QTime t;
+ QElapsedTimer t;
t.start();
{
diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST
index b5b37b4498..3e42a737df 100644
--- a/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST
+++ b/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST
@@ -1,3 +1,2 @@
[deleteChildrenWithRunningGroup]
-osx-10.12
osx-10.13
diff --git a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
index e223ec82e2..33cd53d788 100644
--- a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
+++ b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
@@ -1,6 +1,5 @@
[pauseAndPropertyAnimations]
-*
-[multipleSequentialGroups]
osx
-[noTimerUpdates]
+[multipleSequentialGroups]
osx
+
diff --git a/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST b/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST
deleted file mode 100644
index a8719b241a..0000000000
--- a/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-[statesAndSignals:normal animation]
-windows
-[startBackwardWithoutEndValue]
-windows
-[startWithoutStartValue]
-osx
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
index 4c999ff88f..e516c0e826 100644
--- a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
@@ -1,8 +1,6 @@
-[startGroupWithRunningChild]
-windows
[finishWithUncontrolledAnimation]
-windows
-osx-10.12
+windows-10 msvc-2015
osx-10.13
[groupWithZeroDurationAnimations]
-osx
+osx-10.13
+
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index 6cadebfd7f..78b6449a69 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -263,7 +263,7 @@ void tst_QTextCodec::fromUnicode()
If the encoding is a superset of ASCII, test that the byte
array is correct (no off by one, no trailing '\0').
*/
- QByteArray result = codec->fromUnicode(QStringViewLiteral("abc"));
+ QByteArray result = codec->fromUnicode(u"abc");
if (result.startsWith('a')) {
QCOMPARE(result.size(), 3);
QCOMPARE(result, QByteArray("abc"));
diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro
index 44e1c519b0..d696e174aa 100644
--- a/tests/auto/corelib/corelib.pro
+++ b/tests/auto/corelib/corelib.pro
@@ -13,5 +13,7 @@ SUBDIRS = \
plugin \
serialization \
statemachine \
+ text \
thread \
+ time \
tools
diff --git a/tests/auto/corelib/global/global.pro b/tests/auto/corelib/global/global.pro
index 139e073644..0f77d191ee 100644
--- a/tests/auto/corelib/global/global.pro
+++ b/tests/auto/corelib/global/global.pro
@@ -12,3 +12,6 @@ SUBDIRS=\
qtendian \
qglobalstatic \
qhooks
+
+win32:!winrt: SUBDIRS += \
+ qwinregistry
diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
index 72b086350e..1568855032 100644
--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
+++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
@@ -142,7 +142,6 @@ void tst_QFlags::signedness()
std::is_signed<Qt::Alignment::Int>::value));
}
-#if defined(Q_COMPILER_CLASS_ENUM)
enum class MyStrictEnum { StrictZero, StrictOne, StrictTwo, StrictFour=4 };
Q_DECLARE_FLAGS( MyStrictFlags, MyStrictEnum )
Q_DECLARE_OPERATORS_FOR_FLAGS( MyStrictFlags )
@@ -154,11 +153,9 @@ Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isComplex );
Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isStatic );
Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isLarge );
Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isPointer );
-#endif
void tst_QFlags::classEnum()
{
-#if defined(Q_COMPILER_CLASS_ENUM)
// The main aim of the test is making sure it compiles
// The QCOMPARE are there as an extra
MyStrictEnum e1 = MyStrictEnum::StrictOne;
@@ -257,27 +254,19 @@ void tst_QFlags::classEnum()
// Just to make sure it compiles
if (false)
qDebug() << f3;
-#endif
}
void tst_QFlags::initializerLists()
{
-#if defined(Q_COMPILER_INITIALIZER_LISTS)
Qt::MouseButtons bts = { Qt::LeftButton, Qt::RightButton };
QVERIFY(bts.testFlag(Qt::LeftButton));
QVERIFY(bts.testFlag(Qt::RightButton));
QVERIFY(!bts.testFlag(Qt::MiddleButton));
-#if defined(Q_COMPILER_CLASS_ENUM)
MyStrictNoOpFlags flags = { MyStrictNoOpEnum::StrictOne, MyStrictNoOpEnum::StrictFour };
QVERIFY(flags.testFlag(MyStrictNoOpEnum::StrictOne));
QVERIFY(flags.testFlag(MyStrictNoOpEnum::StrictFour));
QVERIFY(!flags.testFlag(MyStrictNoOpEnum::StrictTwo));
-#endif // Q_COMPILER_CLASS_ENUM
-
-#else
- QSKIP("This test requires C++11 initializer_list support.");
-#endif // Q_COMPILER_INITIALIZER_LISTS
}
void tst_QFlags::testSetFlags()
diff --git a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
index b73a297245..94f0afa5ed 100644
--- a/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
+++ b/tests/auto/corelib/global/qfloat16/tst_qfloat16.cpp
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 by Southwest Research Institute (R)
** Contact: https://www.qt.io/licensing/
**
@@ -40,7 +41,8 @@ private slots:
void fuzzyCompare();
void ltgt_data();
void ltgt();
- void qNan();
+ void qNaN();
+ void infinity();
void float_cast();
void float_cast_data();
void promotionTests();
@@ -48,6 +50,10 @@ private slots:
void arithOps();
void floatToFloat16();
void floatFromFloat16();
+ void finite_data();
+ void finite();
+ void properties();
+ void limits();
};
void tst_qfloat16::fuzzyCompare_data()
@@ -101,6 +107,7 @@ void tst_qfloat16::ltgt_data()
QTest::addColumn<float>("val2");
QTest::newRow("zero") << 0.0f << 0.0f;
+ QTest::newRow("-zero") << -0.0f << 0.0f;
QTest::newRow("ten") << 10.0f << 10.0f;
QTest::newRow("large") << 100000.0f << 100000.0f;
QTest::newRow("small") << 0.0000001f << 0.0000001f;
@@ -152,38 +159,66 @@ void tst_qfloat16::ltgt()
# pragma GCC optimize "no-fast-math"
#endif
-void tst_qfloat16::qNan()
+void tst_qfloat16::qNaN()
{
#if defined __FAST_MATH__ && (__GNUC__ * 100 + __GNUC_MINOR__ < 404)
QSKIP("Non-conformant fast math mode is enabled, cannot run test");
#endif
- qfloat16 nan = qQNaN();
- QVERIFY(!(0. > nan));
- QVERIFY(!(0. < nan));
+ using Bounds = std::numeric_limits<qfloat16>;
+ const qfloat16 nan = Bounds::quiet_NaN();
+ const qfloat16 zero(0), one(1);
+ QVERIFY(!(zero > nan));
+ QVERIFY(!(zero < nan));
+ QVERIFY(!(zero == nan));
QVERIFY(!qIsInf(nan));
QVERIFY(qIsNaN(nan));
- QVERIFY(qIsNaN(nan + 1.f));
+ QVERIFY(qIsNaN(nan + one));
QVERIFY(qIsNaN(-nan));
- qfloat16 inf = qInf();
- QVERIFY(inf > qfloat16(0));
- QVERIFY(-inf < qfloat16(0));
- QVERIFY(!qIsNaN(inf));
- QVERIFY(qIsInf(inf));
- QVERIFY(qIsInf(-inf));
- QVERIFY(qIsInf(2.f*inf));
- QVERIFY(qIsInf(inf*2.f));
- // QTBUG-75812: QEMU/arm64 compiler over-optimizes, so flakily fails 1/inf == 0 :-(
- if (qfloat16(9.785e-4f) == qfloat16(9.794e-4f))
- QCOMPARE(qfloat16(1.f) / inf, qfloat16(0.f));
#ifdef Q_CC_INTEL
QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
#endif
- QVERIFY(qIsNaN(nan*0.f));
+ QVERIFY(qIsNaN(nan * zero));
#ifdef Q_CC_INTEL
QEXPECT_FAIL("", "ICC optimizes zero * anything to zero", Continue);
#endif
- QVERIFY(qIsNaN(inf*0.f));
- QVERIFY(qFuzzyCompare(qfloat16(1.f/inf), qfloat16(0.0)));
+ QVERIFY(qIsNaN(Bounds::infinity() * zero));
+
+ QVERIFY(!nan.isNormal());
+ QVERIFY(!qIsFinite(nan));
+ QVERIFY(!(nan == nan));
+ QCOMPARE(nan, nan); // Despite the preceding
+ QCOMPARE(qFpClassify(nan), FP_NAN);
+}
+
+void tst_qfloat16::infinity()
+{
+ const qfloat16 huge = std::numeric_limits<qfloat16>::infinity();
+ const qfloat16 zero(0), one(1), two(2);
+ QVERIFY(huge > -huge);
+ QVERIFY(huge > zero);
+ QVERIFY(-huge < zero);
+ QCOMPARE(huge, huge);
+ QCOMPARE(-huge, -huge);
+
+ // QTBUG-75812 - see overOptimized in the limits() test.
+ if (qfloat16(9.785e-4f) == qfloat16(9.794e-4f)) {
+ QCOMPARE(one / huge, zero);
+ QVERIFY(qFuzzyCompare(one / huge, zero)); // (same thing)
+ }
+
+ QVERIFY(qIsInf(huge));
+ QVERIFY(qIsInf(-huge));
+ QVERIFY(qIsInf(two * huge));
+ QVERIFY(qIsInf(huge * two));
+
+ QVERIFY(!huge.isNormal());
+ QVERIFY(!(-huge).isNormal());
+ QVERIFY(!qIsNaN(huge));
+ QVERIFY(!qIsNaN(-huge));
+ QVERIFY(!qIsFinite(huge));
+ QVERIFY(!qIsFinite(-huge));
+ QCOMPARE(qFpClassify(huge), FP_INFINITE);
+ QCOMPARE(qFpClassify(-huge), FP_INFINITE);
}
void tst_qfloat16::float_cast_data()
@@ -347,5 +382,160 @@ void tst_qfloat16::floatFromFloat16()
QCOMPARE(out[i], expected[i]);
}
+static qfloat16 powf16(qfloat16 base, int raise)
+{
+ const qfloat16 one(1.f);
+ if (raise < 0) {
+ raise = -raise;
+ base = one / base;
+ }
+ qfloat16 answer = (raise & 1) ? base : one;
+ while (raise > 0) {
+ raise >>= 1;
+ base *= base;
+ if (raise & 1)
+ answer *= base;
+ }
+ return answer;
+}
+
+void tst_qfloat16::finite_data()
+{
+ using Bounds = std::numeric_limits<qfloat16>;
+ QTest::addColumn<qfloat16>("value");
+ QTest::addColumn<int>("mode");
+
+ QTest::newRow("zero") << qfloat16(0) << FP_ZERO;
+ QTest::newRow("-zero") << -qfloat16(0) << FP_ZERO;
+ QTest::newRow("one") << qfloat16(1) << FP_NORMAL;
+ QTest::newRow("-one") << qfloat16(-1) << FP_NORMAL;
+ QTest::newRow("ten") << qfloat16(10) << FP_NORMAL;
+ QTest::newRow("-ten") << qfloat16(-10) << FP_NORMAL;
+ QTest::newRow("max") << Bounds::max() << FP_NORMAL;
+ QTest::newRow("lowest") << Bounds::lowest() << FP_NORMAL;
+ QTest::newRow("min") << Bounds::min() << FP_NORMAL;
+ QTest::newRow("-min") << -Bounds::min() << FP_NORMAL;
+ QTest::newRow("denorm_min") << Bounds::denorm_min() << FP_SUBNORMAL;
+ QTest::newRow("-denorm_min") << -Bounds::denorm_min() << FP_SUBNORMAL;
+}
+
+void tst_qfloat16::finite()
+{
+ QFETCH(qfloat16, value);
+ QFETCH(int, mode);
+ QCOMPARE(value.isNormal(), mode != FP_SUBNORMAL);
+ QCOMPARE(value, value); // Fuzzy
+ QVERIFY(value == value); // Exact
+ QVERIFY(qIsFinite(value));
+ QVERIFY(!qIsInf(value));
+ QVERIFY(!qIsNaN(value));
+ QCOMPARE(qFpClassify(value), mode);
+}
+
+void tst_qfloat16::properties()
+{
+ using Bounds = std::numeric_limits<qfloat16>;
+ QVERIFY(Bounds::is_specialized);
+ QVERIFY(Bounds::is_signed);
+ QVERIFY(!Bounds::is_integer);
+ QVERIFY(!Bounds::is_exact);
+ QVERIFY(Bounds::is_iec559);
+ QVERIFY(Bounds::is_bounded);
+ QVERIFY(!Bounds::is_modulo);
+ QVERIFY(!Bounds::traps);
+ QVERIFY(Bounds::has_infinity);
+ QVERIFY(Bounds::has_quiet_NaN);
+ QVERIFY(Bounds::has_signaling_NaN);
+ QCOMPARE(Bounds::has_denorm, std::denorm_present);
+ QCOMPARE(Bounds::round_style, std::round_to_nearest);
+ QCOMPARE(Bounds::radix, 2);
+ // Untested: has_denorm_loss
+}
+
+void tst_qfloat16::limits() // See also: qNaN() and infinity()
+{
+ // *NOT* using QCOMPARE() on finite qfloat16 values, since that uses fuzzy
+ // comparison, and we need exact here.
+ using Bounds = std::numeric_limits<qfloat16>;
+
+ // A few useful values:
+ const qfloat16 zero(0), one(1), ten(10);
+
+ // The specifics of minus zero:
+ // (IEEE 754 seems to want -zero < zero, but -0. == 0. and -0.f == 0.f in C++.)
+ QVERIFY(-zero <= zero);
+ QVERIFY(-zero == zero);
+ QVERIFY(!(-zero > zero));
+
+ // digits in the mantissa, including the implicit 1 before the binary dot at its left:
+ QVERIFY(qfloat16(1 << (Bounds::digits - 1)) + one > qfloat16(1 << (Bounds::digits - 1)));
+ QVERIFY(qfloat16(1 << Bounds::digits) + one == qfloat16(1 << Bounds::digits));
+
+ // There is a wilful of-by-one in how m(ax|in)_exponent are defined; they're
+ // the lowest and highest n for which radix^{n-1} are normal and finite.
+ const qfloat16 two(Bounds::radix);
+ qfloat16 bit = powf16(two, Bounds::max_exponent - 1);
+ QVERIFY(qIsFinite(bit));
+ QVERIFY(qIsInf(bit * two));
+ bit = powf16(two, Bounds::min_exponent - 1);
+ QVERIFY(bit.isNormal());
+ QCOMPARE(qFpClassify(bit), FP_NORMAL);
+ QVERIFY(!(bit / two).isNormal());
+ QCOMPARE(qFpClassify(bit / two), FP_SUBNORMAL);
+ QVERIFY(bit / two > zero);
+
+ // Base ten (with no matching off-by-one idiocy):
+ // the lowest negative number n such that 10^n is a valid normalized value
+ qfloat16 low10(powf16(ten, Bounds::min_exponent10));
+ QVERIFY(low10 > zero);
+ QVERIFY(low10.isNormal());
+ low10 /= ten;
+ QVERIFY(low10 == zero || !low10.isNormal());
+ // the largest positive number n such that 10^n is a representable finite value
+ qfloat16 high10(powf16(ten, Bounds::max_exponent10));
+ QVERIFY(high10 > zero);
+ QVERIFY(qIsFinite(high10));
+ QVERIFY(!qIsFinite(high10 * ten));
+ QCOMPARE(qFpClassify(high10), FP_NORMAL);
+
+ // How many digits are significant ? (Casts avoid linker errors ...)
+ QCOMPARE(int(Bounds::digits10), 3); // 9.79e-4 has enough sigificant digits:
+ qfloat16 below(9.785e-4f), above(9.794e-4f);
+#if 0 // Sadly, the QEMU x-compile for arm64 "optimizes" comparisons:
+ const bool overOptimized = false;
+#else
+ const bool overOptimized = (below != above);
+ if (overOptimized)
+ QEXPECT_FAIL("", "Over-optimized on ARM", Continue);
+#endif // (but it did, so should, pass everywhere else, confirming digits10 is indeed 3).
+ QVERIFY(below == above);
+ QCOMPARE(int(Bounds::max_digits10), 5); // we need 5 to distinguish these two:
+ QVERIFY(qfloat16(1000.5f) != qfloat16(1001.4f));
+
+ // Actual limiting values of the type:
+ const qfloat16 rose(one + Bounds::epsilon());
+ QVERIFY(rose > one);
+ if (overOptimized)
+ QEXPECT_FAIL("", "Over-optimized on ARM", Continue);
+ QVERIFY(one + Bounds::epsilon() / rose == one);
+
+ QVERIFY(Bounds::max() > zero);
+ QVERIFY(qIsInf(Bounds::max() * rose));
+
+ QVERIFY(Bounds::lowest() < zero);
+ QVERIFY(qIsInf(Bounds::lowest() * rose));
+
+ QVERIFY(Bounds::min() > zero);
+ QVERIFY(!(Bounds::min() / rose).isNormal());
+
+ QVERIFY(Bounds::denorm_min() > zero);
+ if (overOptimized)
+ QEXPECT_FAIL("", "Over-optimized on ARM", Continue);
+ QVERIFY(Bounds::denorm_min() / rose == zero);
+ if (overOptimized)
+ QEXPECT_FAIL("", "Over-optimized on ARM", Continue);
+ QVERIFY(-Bounds::denorm_min() / rose == -zero);
+}
+
QTEST_APPLESS_MAIN(tst_qfloat16)
#include "tst_qfloat16.moc"
diff --git a/tests/auto/corelib/global/qglobal/qglobal.c b/tests/auto/corelib/global/qglobal/qglobal.c
index 0719c4b921..c7124454d0 100644
--- a/tests/auto/corelib/global/qglobal/qglobal.c
+++ b/tests/auto/corelib/global/qglobal/qglobal.c
@@ -85,7 +85,7 @@ int tst_QtVersion()
return QT_VERSION;
}
-const char *tst_qVersion() Q_DECL_NOTHROW
+const char *tst_qVersion() Q_DECL_NOEXCEPT
{
#if !defined(QT_NAMESPACE)
return qVersion();
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 7800a101ec..b33dec8a61 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -456,12 +456,8 @@ typedef int (Empty::*memFun) ();
} while (false) \
/**/
-#ifdef Q_COMPILER_RVALUE_REFS
#define TEST_AlignOf_RValueRef(type, alignment) \
TEST_AlignOf_impl(type, alignment)
-#else
-#define TEST_AlignOf_RValueRef(type, alignment) do {} while (false)
-#endif
#define TEST_AlignOf_impl(type, alignment) \
do { \
diff --git a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
index 2d7db813dd..820a0b999b 100644
--- a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
+++ b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
@@ -145,7 +145,7 @@ void tst_QGlobalStatic::exception()
exceptionCaught = true;
}
QVERIFY(exceptionCaught);
- QCOMPARE(Q_QGS_throwingGS::guard.load(), 0);
+ QCOMPARE(Q_QGS_throwingGS::guard.loadRelaxed(), 0);
QVERIFY(!throwingGS.exists());
QVERIFY(!throwingGS.isDestroyed());
}
@@ -154,10 +154,10 @@ QBasicAtomicInt exceptionControlVar = Q_BASIC_ATOMIC_INITIALIZER(1);
Q_GLOBAL_STATIC_WITH_ARGS(ThrowingType, exceptionGS, (exceptionControlVar))
void tst_QGlobalStatic::catchExceptionAndRetry()
{
- if (exceptionControlVar.load() != 1)
+ if (exceptionControlVar.loadRelaxed() != 1)
QSKIP("This test cannot be run more than once");
- ThrowingType::constructedCount.store(0);
- ThrowingType::destructedCount.store(0);
+ ThrowingType::constructedCount.storeRelaxed(0);
+ ThrowingType::destructedCount.storeRelaxed(0);
bool exceptionCaught = false;
try {
@@ -165,11 +165,11 @@ void tst_QGlobalStatic::catchExceptionAndRetry()
} catch (int) {
exceptionCaught = true;
}
- QCOMPARE(ThrowingType::constructedCount.load(), 1);
+ QCOMPARE(ThrowingType::constructedCount.loadRelaxed(), 1);
QVERIFY(exceptionCaught);
exceptionGS();
- QCOMPARE(ThrowingType::constructedCount.load(), 2);
+ QCOMPARE(ThrowingType::constructedCount.loadRelaxed(), 2);
}
QBasicAtomicInt threadStressTestControlVar = Q_BASIC_ATOMIC_INITIALIZER(5);
@@ -194,9 +194,9 @@ void tst_QGlobalStatic::threadStressTest()
}
};
- ThrowingType::constructedCount.store(0);
- ThrowingType::destructedCount.store(0);
- int expectedConstructionCount = threadStressTestControlVar.load() + 1;
+ ThrowingType::constructedCount.storeRelaxed(0);
+ ThrowingType::destructedCount.storeRelaxed(0);
+ int expectedConstructionCount = threadStressTestControlVar.loadRelaxed() + 1;
if (expectedConstructionCount <= 0)
QSKIP("This test cannot be run more than once");
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index d3ed1a6d0d..17d0f86728 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -48,8 +48,10 @@ private slots:
void defaultHandler();
void installMessageHandler();
+#if QT_DEPRECATED_SINCE(5, 0)
void installMsgHandler();
void installBothHandler();
+#endif
#ifdef QT_BUILD_INTERNAL
void cleanupFuncinfo_data();
@@ -112,7 +114,9 @@ void tst_qmessagehandler::initTestCase()
void tst_qmessagehandler::cleanup()
{
+#if QT_DEPRECATED_SINCE(5, 0)
qInstallMsgHandler(0);
+#endif
qInstallMessageHandler((QtMessageHandler)0);
s_type = QtFatalMsg;
s_file = 0;
@@ -143,6 +147,7 @@ void tst_qmessagehandler::installMessageHandler()
QCOMPARE((void*)myHandler, (void*)customMessageHandler);
}
+#if QT_DEPRECATED_SINCE(5, 0)
void tst_qmessagehandler::installMsgHandler()
{
QtMsgHandler oldHandler = qInstallMsgHandler(customMsgHandler);
@@ -172,6 +177,7 @@ void tst_qmessagehandler::installBothHandler()
QCOMPARE(s_function, Q_FUNC_INFO);
QCOMPARE(s_line, line);
}
+#endif
# define ADD(x) QTest::newRow(x) << Q_FUNC_INFO << x;
@@ -254,19 +260,15 @@ public:
int rvalue() && { ADD("TestClass1::rvalue"); return 0; }
int const_rvalue() const && { ADD("TestClass1::const_rvalue"); return 0; }
#endif
-#ifdef Q_COMPILER_DECLTYPE
int decltype_param(int x = 0, decltype(x) = 0) { ADD("TestClass1::decltype_param"); return x; }
template<typename T> int decltype_template_param(T x = 0, decltype(x) = 0)
{ ADD("TestClass1::decltype_template_param"); return x; }
template<typename T> void decltype_template_param2(T x, decltype(x + QString()))
{ ADD("TestClass1::decltype_template_param2"); }
-# ifdef Q_COMPILER_AUTO_FUNCTION
auto decltype_return(int x = 0) -> decltype(x)
{ ADD("TestClass1::decltype_return"); return x; }
template <typename T> auto decltype_template_return(T x = 0) -> decltype(x)
{ ADD("TestClass1::decltype_template_return"); return x; }
-# endif
-#endif
public:
TestClass1()
@@ -323,15 +325,11 @@ public:
std::move(*this).rvalue();
std::move(*this).const_rvalue();
#endif
-#ifdef Q_COMPILER_DECLTYPE
decltype_param();
decltype_template_param(0);
decltype_template_param2(QByteArray(), QString());
-# ifdef Q_COMPILER_AUTO_FUNCTION
decltype_return();
decltype_template_return(0);
-# endif
-#endif
}
};
@@ -878,12 +876,14 @@ void tst_qmessagehandler::setMessagePattern()
#endif
// make sure there is no QT_MESSAGE_PATTERN in the environment
- QStringList environment = m_baseEnvironment;
- QMutableListIterator<QString> iter(environment);
- while (iter.hasNext()) {
- if (iter.next().startsWith("QT_MESSAGE_PATTERN"))
- iter.remove();
- }
+ QStringList environment;
+ environment.reserve(m_baseEnvironment.size());
+ const auto doesNotStartWith = [](QLatin1String s) {
+ return [s](const QString &str) { return !str.startsWith(s); };
+ };
+ std::copy_if(m_baseEnvironment.cbegin(), m_baseEnvironment.cend(),
+ std::back_inserter(environment),
+ doesNotStartWith(QLatin1String("QT_MESSAGE_PATTERN")));
process.setEnvironment(environment);
process.start(appExe);
diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
index 03300c6dbe..e1b8336955 100644
--- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
+++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -35,18 +35,64 @@
#include <math.h>
#include <float.h>
+namespace {
+ template <typename F> struct Fuzzy {};
+ /* Data taken from qglobal.h's implementation of qFuzzyCompare:
+ * qFuzzyCompare conflates values with fractional difference up to (and
+ * including) the given scale.
+ */
+ template <> struct Fuzzy<double> { constexpr static double scale = 1e12; };
+ template <> struct Fuzzy<float> { constexpr static float scale = 1e5f; };
+}
+
class tst_QNumeric: public QObject
{
Q_OBJECT
+ // Support for floating-point:
+ template<typename F> inline void fuzzyCompare_data();
+ template<typename F> inline void fuzzyCompare();
+ template<typename F> inline void checkNaN(F nan);
+ template<typename F> inline void rawNaN_data();
+ template<typename F> inline void rawNaN();
+#if QT_CONFIG(signaling_nan)
+ template<typename F> inline void distinctNaN();
+#endif
+ template<typename F, typename Whole> inline void generalNaN_data();
+ template<typename F, typename Whole> inline void generalNaN();
+ template<typename F> inline void infinity();
+ template<typename F> inline void classifyfp();
+ template<typename F, typename Count> inline void distance_data();
+ template<typename F, typename Count> inline void distance();
+
private slots:
- void fuzzyCompare_data();
- void fuzzyCompare();
- void qNan();
- void floatDistance_data();
- void floatDistance();
- void floatDistance_double_data();
- void floatDistance_double();
+ // Floating-point tests:
+ void fuzzyCompareF_data() { fuzzyCompare_data<float>(); }
+ void fuzzyCompareF() { fuzzyCompare<float>(); }
+ void fuzzyCompareD_data() { fuzzyCompare_data<double>(); }
+ void fuzzyCompareD() { fuzzyCompare<double>(); }
+ void rawNaNF_data() { rawNaN_data<float>(); }
+ void rawNaNF() { rawNaN<float>(); }
+ void rawNaND_data() { rawNaN_data<double>(); }
+ void rawNaND() { rawNaN<double>(); }
+#if QT_CONFIG(signaling_nan)
+ void distinctNaNF();
+ void distinctNaND() { distinctNaN<double>(); }
+#endif
+ void generalNaNd_data() { generalNaN_data<double, quint64>(); }
+ void generalNaNd() { generalNaN<double, quint64>(); }
+ void generalNaNf_data() { generalNaN_data<float, quint32>(); }
+ void generalNaNf() { generalNaN<float, quint32>(); }
+ void infinityF() { infinity<float>(); }
+ void infinityD() { infinity<double>(); }
+ void classifyF() { classifyfp<float>(); }
+ void classifyD() { classifyfp<double>(); }
+ void floatDistance_data() { distance_data<float, quint32>(); }
+ void floatDistance() { distance<float, quint32>(); }
+ void doubleDistance_data() { distance_data<double, quint64>(); }
+ void doubleDistance() { distance<double, quint64>(); }
+
+ // Whole number tests:
void addOverflow_data();
void addOverflow();
void mulOverflow_data();
@@ -54,30 +100,41 @@ private slots:
void signedOverflow();
};
+// Floating-point tests:
+
+template<typename F>
void tst_QNumeric::fuzzyCompare_data()
{
- QTest::addColumn<double>("val1");
- QTest::addColumn<double>("val2");
+ QTest::addColumn<F>("val1");
+ QTest::addColumn<F>("val2");
QTest::addColumn<bool>("isEqual");
-
- QTest::newRow("zero") << 0.0 << 0.0 << true;
- QTest::newRow("ten") << 10.0 << 10.0 << true;
- QTest::newRow("large") << 1000000000.0 << 1000000000.0 << true;
- QTest::newRow("small") << 0.00000000001 << 0.00000000001 << true;
- QTest::newRow("eps") << 10.000000000000001 << 10.00000000000002 << true;
- QTest::newRow("eps2") << 10.000000000000001 << 10.000000000000009 << true;
-
- QTest::newRow("mis1") << 0.0 << 1.0 << false;
- QTest::newRow("mis2") << 0.0 << 10000000.0 << false;
- QTest::newRow("mis3") << 0.0 << 0.000000001 << false;
- QTest::newRow("mis4") << 100000000.0 << 0.000000001 << false;
- QTest::newRow("mis5") << 0.0000000001 << 0.000000001 << false;
+ const F zero(0), one(1), ten(10);
+ const F huge = Fuzzy<F>::scale, tiny = one / huge;
+ const F deci(.1), giga(1e9), nano(1e-9), big(1e7), small(1e-10);
+
+ QTest::newRow("zero") << zero << zero << true;
+ QTest::newRow("ten") << ten << ten << true;
+ QTest::newRow("large") << giga << giga << true;
+ QTest::newRow("small") << small << small << true;
+ QTest::newRow("10+9*tiny==10") << (ten + 9 * tiny) << ten << true;
+ QTest::newRow("huge+.9==huge") << (huge + 9 * deci) << huge << true;
+ QTest::newRow("eps2") << (ten + tiny) << (ten + 2 * tiny) << true;
+ QTest::newRow("eps9") << (ten + tiny) << (ten + 9 * tiny) << true;
+
+ QTest::newRow("0!=1") << zero << one << false;
+ QTest::newRow("0!=big") << zero << big << false;
+ QTest::newRow("0!=nano") << zero << nano << false;
+ QTest::newRow("giga!=nano") << giga << nano << false;
+ QTest::newRow("small!=nano") << small << nano << false;
+ QTest::newRow("huge+1.1!=huge") << (huge + 1 + deci) << huge << false;
+ QTest::newRow("1+1.1*tiny!=1") << (one + tiny * (one + deci)) << one << false;
}
+template<typename F>
void tst_QNumeric::fuzzyCompare()
{
- QFETCH(double, val1);
- QFETCH(double, val2);
+ QFETCH(F, val1);
+ QFETCH(F, val2);
QFETCH(bool, isEqual);
QCOMPARE(::qFuzzyCompare(val1, val2), isEqual);
@@ -91,135 +148,232 @@ void tst_QNumeric::fuzzyCompare()
# pragma GCC optimize "no-fast-math"
#endif
-void tst_QNumeric::qNan()
+template<typename F>
+void tst_QNumeric::checkNaN(F nan)
+{
+#define CHECKNAN(value) \
+ do { \
+ const F v = (value); \
+ QCOMPARE(qFpClassify(v), FP_NAN); \
+ QVERIFY(qIsNaN(v)); \
+ QVERIFY(!qIsFinite(v)); \
+ QVERIFY(!qIsInf(v)); \
+ } while (0)
+
+ QVERIFY(!(0 > nan));
+ QVERIFY(!(0 < nan));
+ QVERIFY(!(0 == nan));
+ QVERIFY(!(nan == nan));
+
+ CHECKNAN(nan);
+ CHECKNAN(nan + 1);
+ CHECKNAN(nan - 1);
+ CHECKNAN(-nan);
+ CHECKNAN(nan * 2.0);
+ CHECKNAN(nan / 2.0);
+ CHECKNAN(1.0 / nan);
+ CHECKNAN(0.0 / nan);
+ CHECKNAN(0.0 * nan);
+
+ // When any NaN is expected, any NaN will do:
+ QCOMPARE(nan, nan);
+ QCOMPARE(nan, -nan);
+ QCOMPARE(nan, qQNaN());
+#undef CHECKNAN
+}
+
+template<typename F>
+void tst_QNumeric::rawNaN_data()
{
#if defined __FAST_MATH__ && (__GNUC__ * 100 + __GNUC_MINOR__ < 404)
QSKIP("Non-conformant fast math mode is enabled, cannot run test");
#endif
- double nan = qQNaN();
- QVERIFY(!(0 > nan));
- QVERIFY(!(0 < nan));
- QVERIFY(qIsNaN(nan));
- QVERIFY(qIsNaN(nan + 1));
- QVERIFY(qIsNaN(-nan));
+ QTest::addColumn<F>("nan");
- Q_STATIC_ASSERT(sizeof(double) == 8);
-#ifdef Q_LITTLE_ENDIAN
- const uchar bytes[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f };
-#else
- const uchar bytes[] = { 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
+ QTest::newRow("quiet") << F(qQNaN());
+#if QT_CONFIG(signaling_nan)
+ QTest::newRow("signaling") << F(qSNaN());
#endif
- memcpy(&nan, bytes, 8);
- QVERIFY(!qIsFinite(nan));
- QVERIFY(!qIsInf(nan));
- QVERIFY(qIsNaN(nan));
-
- double inf = qInf();
- QVERIFY(inf > 0);
- QVERIFY(-inf < 0);
- QVERIFY(qIsInf(inf));
- QVERIFY(qIsInf(-inf));
- QVERIFY(qIsInf(2*inf));
- QCOMPARE(1/inf, 0.0);
- QVERIFY(qIsNaN(0*nan));
- QVERIFY(qIsNaN(0*inf));
- QVERIFY(qFuzzyCompare(1/inf, 0.0));
}
-void tst_QNumeric::floatDistance_data()
+template<typename F>
+void tst_QNumeric::rawNaN()
{
- QTest::addColumn<float>("val1");
- QTest::addColumn<float>("val2");
- QTest::addColumn<quint32>("expectedDistance");
+ QFETCH(F, nan);
+#ifdef Q_OS_WASM
+# ifdef __asmjs
+ QEXPECT_FAIL("", "Fastcomp conflates quiet and signaling NaNs", Continue);
+# endif // but the modern clang compiler handls it fine.
+#endif
+ checkNaN(nan);
+}
- // exponent: 8 bits
- // mantissa: 23 bits
- const quint32 number_of_denormals = (1 << 23) - 1; // Set to 0 if denormals are not included
+#if QT_CONFIG(signaling_nan)
+template<typename F>
+void tst_QNumeric::distinctNaN()
+{
+ const F qnan = qQNaN();
+ const F snan = qSNaN();
+ QVERIFY(memcmp(&qnan, &snan, sizeof(F)) != 0);
+}
- quint32 _0_to_1 = quint32((1 << 23) * 126 + 1 + number_of_denormals); // We need +1 to include the 0
- quint32 _1_to_2 = quint32(1 << 23);
+void tst_QNumeric::distinctNaNF() {
+#ifdef Q_CC_MSVC
+ QEXPECT_FAIL("", "MSVC's float conflates quiet and signaling NaNs", Continue);
+#endif
+ distinctNaN<float>();
+}
+#endif // signaling_nan
- // We don't need +1 because FLT_MAX has all bits set in the mantissa. (Thus mantissa
- // have not wrapped back to 0, which would be the case for 1 in _0_to_1
- quint32 _0_to_FLT_MAX = quint32((1 << 23) * 254) + number_of_denormals;
-
- quint32 _0_to_FLT_MIN = 1 + number_of_denormals;
- QTest::newRow("[0,FLT_MIN]") << 0.F << FLT_MIN << _0_to_FLT_MIN;
- QTest::newRow("[0,FLT_MAX]") << 0.F << FLT_MAX << _0_to_FLT_MAX;
- QTest::newRow("[1,1.5]") << 1.0F << 1.5F << quint32(1 << 22);
- QTest::newRow("[0,1]") << 0.F << 1.0F << _0_to_1;
- QTest::newRow("[0.5,1]") << 0.5F << 1.0F << quint32(1 << 23);
- QTest::newRow("[1,2]") << 1.F << 2.0F << _1_to_2;
- QTest::newRow("[-1,+1]") << -1.F << +1.0F << 2 * _0_to_1;
- QTest::newRow("[-1,0]") << -1.F << 0.0F << _0_to_1;
- QTest::newRow("[-1,FLT_MAX]") << -1.F << FLT_MAX << _0_to_1 + _0_to_FLT_MAX;
- QTest::newRow("[-2,-1") << -2.F << -1.F << _1_to_2;
- QTest::newRow("[-1,-2") << -1.F << -2.F << _1_to_2;
- QTest::newRow("[FLT_MIN,FLT_MAX]") << FLT_MIN << FLT_MAX << _0_to_FLT_MAX - _0_to_FLT_MIN;
- QTest::newRow("[-FLT_MAX,FLT_MAX]") << -FLT_MAX << FLT_MAX << (2*_0_to_FLT_MAX);
- float denormal = FLT_MIN;
- denormal/=2.0F;
- QTest::newRow("denormal") << 0.F << denormal << _0_to_FLT_MIN/2;
+template<typename F, typename Whole>
+void tst_QNumeric::generalNaN_data()
+{
+ Q_STATIC_ASSERT(sizeof(F) == sizeof(Whole));
+ QTest::addColumn<Whole>("whole");
+ // Every value with every bit of the exponent set is a NaN.
+ // Sign and mantissa can be anything without interfering with that.
+ using Bounds = std::numeric_limits<F>;
+ // Bounds::digits is one more than the number of bits used to encode the mantissa:
+ const int mantissaBits = Bounds::digits - 1;
+ // One bit for sign, the rest are mantissa and exponent:
+ const int exponentBits = sizeof(F) * CHAR_BIT - 1 - mantissaBits;
+
+ const Whole exponent = ((Whole(1) << exponentBits) - 1) << mantissaBits;
+ const Whole sign = Whole(1) << (exponentBits + mantissaBits);
+ const Whole mantissaTop = Whole(1) << (mantissaBits - 1);
+
+ QTest::newRow("lowload") << (exponent | 1);
+ QTest::newRow("sign-lowload") << (sign | exponent | 1);
+ QTest::newRow("highload") << (exponent | mantissaTop);
+ QTest::newRow("sign-highload") << (sign | exponent | mantissaTop);
}
-void tst_QNumeric::floatDistance()
+template<typename F, typename Whole>
+void tst_QNumeric::generalNaN()
{
- QFETCH(float, val1);
- QFETCH(float, val2);
- QFETCH(quint32, expectedDistance);
-#ifdef Q_OS_QNX
- QEXPECT_FAIL("denormal", "See QTBUG-37094", Continue);
-#endif
- QCOMPARE(qFloatDistance(val1, val2), expectedDistance);
+ Q_STATIC_ASSERT(sizeof(F) == sizeof(Whole));
+ QFETCH(const Whole, whole);
+ F nan;
+ memcpy(&nan, &whole, sizeof(F));
+ checkNaN(nan);
+}
+
+template<typename F>
+void tst_QNumeric::infinity()
+{
+ const F inf = qInf();
+ const F zero(0), one(1), two(2);
+ QVERIFY(inf > zero);
+ QVERIFY(-inf < zero);
+ QVERIFY(qIsInf(inf));
+ QCOMPARE(inf, inf);
+ QCOMPARE(-inf, -inf);
+ QVERIFY(qIsInf(-inf));
+ QVERIFY(qIsInf(inf + one));
+ QVERIFY(qIsInf(inf - one));
+ QVERIFY(qIsInf(-inf - one));
+ QVERIFY(qIsInf(-inf + one));
+ QVERIFY(qIsInf(inf * two));
+ QVERIFY(qIsInf(-inf * two));
+ QVERIFY(qIsInf(inf / two));
+ QVERIFY(qIsInf(-inf / two));
+ QVERIFY(qFuzzyCompare(one / inf, zero));
+ QCOMPARE(1.0 / inf, 0.0);
+ QVERIFY(qFuzzyCompare(one / -inf, zero));
+ QCOMPARE(one / -inf, zero);
+ QVERIFY(qIsNaN(zero * inf));
+ QVERIFY(qIsNaN(zero * -inf));
+}
+
+template<typename F>
+void tst_QNumeric::classifyfp()
+{
+ using Bounds = std::numeric_limits<F>;
+ const F huge = Bounds::max();
+ const F tiny = Bounds::min();
+ // NaNs already handled, see checkNaN()'s callers.
+ const F one(1), two(2), inf(qInf());
+
+ QCOMPARE(qFpClassify(inf), FP_INFINITE);
+ QCOMPARE(qFpClassify(-inf), FP_INFINITE);
+ QCOMPARE(qFpClassify(huge * two), FP_INFINITE);
+ QCOMPARE(qFpClassify(huge * -two), FP_INFINITE);
+
+ QCOMPARE(qFpClassify(one), FP_NORMAL);
+ QCOMPARE(qFpClassify(huge), FP_NORMAL);
+ QCOMPARE(qFpClassify(-huge), FP_NORMAL);
+ QCOMPARE(qFpClassify(tiny), FP_NORMAL);
+ QCOMPARE(qFpClassify(-tiny), FP_NORMAL);
+ if (Bounds::has_denorm == std::denorm_present) {
+ QCOMPARE(qFpClassify(tiny / two), FP_SUBNORMAL);
+ QCOMPARE(qFpClassify(tiny / -two), FP_SUBNORMAL);
+ }
}
-void tst_QNumeric::floatDistance_double_data()
+template<typename F, typename Count>
+void tst_QNumeric::distance_data()
{
- QTest::addColumn<double>("val1");
- QTest::addColumn<double>("val2");
- QTest::addColumn<quint64>("expectedDistance");
+ using Bounds = std::numeric_limits<F>;
+ const F huge = Bounds::max();
+ const F tiny = Bounds::min();
+
+ QTest::addColumn<F>("from");
+ QTest::addColumn<F>("stop");
+ QTest::addColumn<Count>("expectedDistance");
- // exponent: 11 bits
- // mantissa: 52 bits
- const quint64 number_of_denormals = (Q_UINT64_C(1) << 52) - 1; // Set to 0 if denormals are not included
+ using Bounds = std::numeric_limits<F>;
+ const int mantissaBits = Bounds::digits - 1;
+ const int exponentBits = sizeof(F) * CHAR_BIT - 1 - mantissaBits;
- quint64 _0_to_1 = (Q_UINT64_C(1) << 52) * ((1 << (11-1)) - 2) + 1 + number_of_denormals; // We need +1 to include the 0
- quint64 _1_to_2 = Q_UINT64_C(1) << 52;
+ // Set to 1 and 0 if denormals are not included:
+ const Count count_0_to_tiny = Count(1) << mantissaBits;
+ const Count count_denormals = count_0_to_tiny - 1;
- // We don't need +1 because DBL_MAX has all bits set in the mantissa. (Thus mantissa
+ // We need +1 to include the 0:
+ const Count count_0_to_1
+ = (Count(1) << mantissaBits) * ((Count(1) << (exponentBits - 1)) - 2)
+ + 1 + count_denormals;
+ const Count count_1_to_2 = Count(1) << mantissaBits;
+
+ // We don't need +1 because huge has all bits set in the mantissa. (Thus mantissa
// have not wrapped back to 0, which would be the case for 1 in _0_to_1
- quint64 _0_to_DBL_MAX = quint64((Q_UINT64_C(1) << 52) * ((1 << 11) - 2)) + number_of_denormals;
-
- quint64 _0_to_DBL_MIN = 1 + number_of_denormals;
- QTest::newRow("[0,DBL_MIN]") << 0.0 << DBL_MIN << _0_to_DBL_MIN;
- QTest::newRow("[0,DBL_MAX]") << 0.0 << DBL_MAX << _0_to_DBL_MAX;
- QTest::newRow("[1,1.5]") << 1.0 << 1.5 << (Q_UINT64_C(1) << 51);
- QTest::newRow("[0,1]") << 0.0 << 1.0 << _0_to_1;
- QTest::newRow("[0.5,1]") << 0.5 << 1.0 << (Q_UINT64_C(1) << 52);
- QTest::newRow("[1,2]") << 1.0 << 2.0 << _1_to_2;
- QTest::newRow("[-1,+1]") << -1.0 << +1.0 << 2 * _0_to_1;
- QTest::newRow("[-1,0]") << -1.0 << 0.0 << _0_to_1;
- QTest::newRow("[-1,DBL_MAX]") << -1.0 << DBL_MAX << _0_to_1 + _0_to_DBL_MAX;
- QTest::newRow("[-2,-1") << -2.0 << -1.0 << _1_to_2;
- QTest::newRow("[-1,-2") << -1.0 << -2.0 << _1_to_2;
- QTest::newRow("[DBL_MIN,DBL_MAX]") << DBL_MIN << DBL_MAX << _0_to_DBL_MAX - _0_to_DBL_MIN;
- QTest::newRow("[-DBL_MAX,DBL_MAX]") << -DBL_MAX << DBL_MAX << (2*_0_to_DBL_MAX);
- double denormal = DBL_MIN;
- denormal/=2.0;
- QTest::newRow("denormal") << 0.0 << denormal << _0_to_DBL_MIN/2;
+ const Count count_0_to_huge
+ = (Count(1) << mantissaBits) * ((Count(1) << exponentBits) - 2)
+ + count_denormals;
+
+ const F zero(0), half(.5), one(1), sesqui(1.5), two(2);
+ const F denormal = tiny / two;
+
+ QTest::newRow("[0,tiny]") << zero << tiny << count_0_to_tiny;
+ QTest::newRow("[0,huge]") << zero << huge << count_0_to_huge;
+ QTest::newRow("[1,1.5]") << one << sesqui << (Count(1) << (mantissaBits - 1));
+ QTest::newRow("[0,1]") << zero << one << count_0_to_1;
+ QTest::newRow("[0.5,1]") << half << one << (Count(1) << mantissaBits);
+ QTest::newRow("[1,2]") << one << two << count_1_to_2;
+ QTest::newRow("[-1,+1]") << -one << +one << 2 * count_0_to_1;
+ QTest::newRow("[-1,0]") << -one << zero << count_0_to_1;
+ QTest::newRow("[-1,huge]") << -one << huge << count_0_to_1 + count_0_to_huge;
+ QTest::newRow("[-2,-1") << -two << -one << count_1_to_2;
+ QTest::newRow("[-1,-2") << -one << -two << count_1_to_2;
+ QTest::newRow("[tiny,huge]") << tiny << huge << count_0_to_huge - count_0_to_tiny;
+ QTest::newRow("[-huge,huge]") << -huge << huge << (2 * count_0_to_huge);
+ QTest::newRow("denormal") << zero << denormal << count_0_to_tiny / 2;
}
-void tst_QNumeric::floatDistance_double()
+template<typename F, typename Count>
+void tst_QNumeric::distance()
{
- QFETCH(double, val1);
- QFETCH(double, val2);
- QFETCH(quint64, expectedDistance);
+ QFETCH(F, from);
+ QFETCH(F, stop);
+ QFETCH(Count, expectedDistance);
#ifdef Q_OS_QNX
QEXPECT_FAIL("denormal", "See QTBUG-37094", Continue);
#endif
- QCOMPARE(qFloatDistance(val1, val2), expectedDistance);
+ QCOMPARE(qFloatDistance(from, stop), expectedDistance);
}
+// Whole number tests:
+
void tst_QNumeric::addOverflow_data()
{
QTest::addColumn<int>("size");
@@ -461,13 +615,13 @@ template <typename Int> static void mulOverflow_template()
QCOMPARE(mul_overflow(Int(max / 2), Int(3), &r), true);
QCOMPARE(mul_overflow(mid1, Int(mid2 + 1), &r), true);
QCOMPARE(mul_overflow(Int(max / 2 + 2), Int(2), &r), true);
+ QCOMPARE(mul_overflow(Int(max - max / 2), Int(2), &r), true);
QCOMPARE(mul_overflow(Int(1ULL << (std::numeric_limits<Int>::digits - 1)), Int(2), &r), true);
if (min) {
QCOMPARE(mul_overflow(min, Int(2), &r), true);
QCOMPARE(mul_overflow(Int(min / 2), Int(3), &r), true);
QCOMPARE(mul_overflow(Int(min / 2 - 1), Int(2), &r), true);
- QCOMPARE(mul_overflow(Int(min + min/2), Int(2), &r), true);
}
#endif
}
diff --git a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp
index dca49e9f7e..6f9dcc08f9 100644
--- a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp
+++ b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp
@@ -57,7 +57,7 @@ static const double RandomValueFP = double(0.3010463714599609);
static void setRNGControl(uint v)
{
#ifdef QT_BUILD_INTERNAL
- qt_randomdevice_control.store(v);
+ qt_randomdevice_control.storeRelaxed(v);
#else
Q_UNUSED(v);
#endif
@@ -511,7 +511,7 @@ void tst_QRandomGenerator::generateNonContiguous()
QFETCH(uint, control);
RandomGenerator rng(control);
- QLinkedList<quint64> list = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ std::list<quint64> list(8);
auto longerArrayCheck = [&] {
QRandomGenerator().generate(list.begin(), list.end());
return find_if(list.begin(), list.end(), [&](quint64 cur) {
diff --git a/tests/auto/corelib/global/qwinregistry/qwinregistry.pro b/tests/auto/corelib/global/qwinregistry/qwinregistry.pro
new file mode 100644
index 0000000000..eab5df9dc3
--- /dev/null
+++ b/tests/auto/corelib/global/qwinregistry/qwinregistry.pro
@@ -0,0 +1,8 @@
+CONFIG += testcase
+QT += testlib core-private
+QT -= gui
+
+TARGET = tst_qwinregistry
+CONFIG += console
+
+SOURCES += tst_qwinregistry.cpp
diff --git a/tests/auto/testlib/selftests/alive/tst_alive.cpp b/tests/auto/corelib/global/qwinregistry/tst_qwinregistry.cpp
index eeb77b18c0..ac811de2a1 100644
--- a/tests/auto/testlib/selftests/alive/tst_alive.cpp
+++ b/tests/auto/corelib/global/qwinregistry/tst_qwinregistry.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,59 +26,43 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
-#include <QWidget>
-#include "qtestalive.cpp"
+#include <QtCore/qoperatingsystemversion.h>
+
+#include <QtCore/private/qwinregistry_p.h>
-class tst_Alive: public QObject
+class tst_QWinRegistry : public QObject
{
Q_OBJECT
-private slots:
- void alive();
- void addMouseDClick() const;
+public Q_SLOTS:
+ void initTestCase();
+
+private Q_SLOTS:
+ void values();
};
-void tst_Alive::alive()
+void tst_QWinRegistry::initTestCase()
{
- QTestAlive a;
- a.start();
-
- sleep(5);
- QCoreApplication::processEvents();
- qDebug("CUT");
- sleep(5);
+ if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows10)
+ QSKIP("This test requires registry values present in Windows 10");
}
-void tst_Alive::addMouseDClick() const
+void tst_QWinRegistry::values()
{
- class DClickListener : public QWidget
- {
- public:
- DClickListener() : isTested(false)
- {
- }
-
- bool isTested;
- protected:
- virtual void mouseDoubleClickEvent(QMouseEvent * event)
- {
- isTested = true;
- QCOMPARE(event->type(), QEvent::MouseButtonDblClick);
- }
- };
-
- DClickListener listener;
-
- QTestEventList list;
- list.addMouseDClick(Qt::LeftButton);
-
- list.simulate(&listener);
- /* Check that we have been called at all. */
- QVERIFY(listener.isTested);
+ QWinRegistryKey key(HKEY_LOCAL_MACHINE, LR"(SOFTWARE\Microsoft\Windows NT\CurrentVersion)");
+ QVERIFY(key.isValid());
+ QVERIFY(!key.stringValue(L"ProductName").isEmpty());
+ QVERIFY(key.stringValue(L"NonExistingKey").isEmpty());
+ auto majorVersion = key.dwordValue(L"CurrentMajorVersionNumber");
+ QVERIFY(majorVersion.second);
+ QVERIFY(majorVersion.first > 0);
+ auto nonExistingValue = key.dwordValue(L"NonExistingKey");
+ QVERIFY(!nonExistingValue.second);
+ QCOMPARE(nonExistingValue.first, 0u);
}
-QTEST_MAIN(tst_Alive)
-#include "tst_alive.moc"
+QTEST_APPLESS_MAIN(tst_QWinRegistry);
+
+#include "tst_qwinregistry.moc"
diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index dca7672b8e..e6d2f10c16 100644
--- a/tests/auto/corelib/io/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -28,7 +28,6 @@
#include <QTest>
-#include <QtAlgorithms>
#include <QFile>
#include <QFileInfo>
#include <QRandomGenerator>
@@ -36,6 +35,7 @@
#include <QDebug>
+#include <algorithm>
#include <cstdlib>
#include <cstdio>
@@ -489,13 +489,13 @@ void tst_LargeFile::mapFile()
// Keep full block mapped to facilitate OS and/or internal reuse by Qt.
uchar *baseAddress = largeFile.map(position, blockSize);
QVERIFY( baseAddress );
- QVERIFY( qEqual(block.begin(), block.end(), reinterpret_cast<char*>(baseAddress)) );
+ QVERIFY( std::equal(block.begin(), block.end(), reinterpret_cast<char*>(baseAddress)) );
for (int offset = 1; offset < blockSize; ++offset) {
uchar *address = largeFile.map(position + offset, blockSize - offset);
QVERIFY( address );
- if ( !qEqual(block.begin() + offset, block.end(), reinterpret_cast<char*>(address)) ) {
+ if ( !std::equal(block.begin() + offset, block.end(), reinterpret_cast<char*>(address)) ) {
qDebug() << "Expected:" << block.toHex();
qDebug() << "Actual :" << QByteArray(reinterpret_cast<char*>(address), blockSize).toHex();
QVERIFY(false);
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 7b8b1df166..584e66a7db 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -309,7 +309,7 @@ void tst_QDebug::stateSaver() const
QDebug d = qDebug();
{
QDebugStateSaver saver(d);
- d.nospace() << hex << right << qSetFieldWidth(3) << qSetPadChar('0') << 42;
+ d.nospace() << Qt::hex << Qt::right << qSetFieldWidth(3) << qSetPadChar('0') << 42;
}
d << 42;
}
@@ -327,7 +327,7 @@ void tst_QDebug::stateSaver() const
{
QDebug d = qDebug();
- d.noquote().nospace() << QStringLiteral("Hello") << hex << 42;
+ d.noquote().nospace() << QStringLiteral("Hello") << Qt::hex << 42;
{
QDebugStateSaver saver(d);
d.resetFormat();
@@ -506,7 +506,7 @@ void tst_QDebug::qDebugQStringView() const
{
QLatin1String file, function;
int line = 0;
- const QStringView inView = QStringViewLiteral("input");
+ const QStringView inView = u"input";
MessageHandlerSetter mhs(myMessageHandler);
{ qDebug() << inView; }
@@ -660,7 +660,7 @@ void tst_QDebug::textStreamModifiers() const
QString file, function;
int line = 0;
MessageHandlerSetter mhs(myMessageHandler);
- { qDebug() << hex << short(0xf) << int(0xf) << unsigned(0xf) << long(0xf) << qint64(0xf) << quint64(0xf); }
+ { qDebug() << Qt::hex << short(0xf) << int(0xf) << unsigned(0xf) << long(0xf) << qint64(0xf) << quint64(0xf); }
#ifndef QT_NO_MESSAGELOGCONTEXT
file = __FILE__; line = __LINE__ - 2; function = Q_FUNC_INFO;
#endif
@@ -678,7 +678,7 @@ void tst_QDebug::resetFormat() const
MessageHandlerSetter mhs(myMessageHandler);
{
QDebug d = qDebug();
- d.nospace().noquote() << hex << int(0xf);
+ d.nospace().noquote() << Qt::hex << int(0xf);
d.resetFormat() << int(0xf) << QStringLiteral("foo");
}
#ifndef QT_NO_MESSAGELOGCONTEXT
diff --git a/tests/auto/corelib/io/qdir/Info.plist b/tests/auto/corelib/io/qdir/Info.plist
index 7dc5622bde..e1f6fbe24a 100644
--- a/tests/auto/corelib/io/qdir/Info.plist
+++ b/tests/auto/corelib/io/qdir/Info.plist
@@ -6,8 +6,6 @@
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
- <key>CFBundleGetInfoString</key>
- <string>Created by Qt/QMake</string>
<key>CFBundleIconFile</key>
<string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
<key>CFBundleIdentifier</key>
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index b703a8839f..52e7ebadb1 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -349,21 +349,21 @@ void tst_QDir::mkdirRmdir_data()
QTest::addColumn<QString>("path");
QTest::addColumn<bool>("recurse");
- QStringList dirs;
- dirs << "testdir/one"
- << "testdir/two/three/four"
- << "testdir/../testdir/three";
- QTest::newRow("plain") << QDir::currentPath() + "/" + dirs.at(0) << false;
- QTest::newRow("recursive") << QDir::currentPath() + "/" + dirs.at(1) << true;
- QTest::newRow("with-..") << QDir::currentPath() + "/" + dirs.at(2) << false;
-
- QTest::newRow("relative-plain") << dirs.at(0) << false;
- QTest::newRow("relative-recursive") << dirs.at(1) << true;
- QTest::newRow("relative-with-..") << dirs.at(2) << false;
-
- // Ensure that none of these directories already exist
- for (int i = 0; i < dirs.count(); ++i)
- QVERIFY(!QFile::exists(dirs.at(i)));
+ const struct {
+ const char *name; // shall have a prefix added
+ const char *path; // relative
+ bool recurse;
+ } cases[] = {
+ { "plain", "testdir/one", false },
+ { "recursive", "testdir/two/three/four", true },
+ { "with-..", "testdir/../testdir/three", false },
+ };
+
+ for (const auto &it : cases) {
+ QVERIFY(!QFile::exists(it.path));
+ QTest::addRow("absolute-%s", it.name) << (QDir::currentPath() + "/") + it.path << it.recurse;
+ QTest::addRow("relative-%s", it.name) << QString::fromLatin1(it.path) << it.recurse;
+ }
}
void tst_QDir::mkdirRmdir()
@@ -1268,6 +1268,7 @@ tst_QDir::cleanPath_data()
QTest::newRow("drive-above-root") << "A:/.." << "A:/..";
QTest::newRow("unc-server-up") << "//server/path/.." << "//server";
QTest::newRow("unc-server-above-root") << "//server/.." << "//server/..";
+ QTest::newRow("longpath") << "\\\\?\\d:\\" << "d:/";
#else
QTest::newRow("data15") << "//c:/foo" << "/c:/foo";
#endif // non-windows
@@ -1745,6 +1746,7 @@ void tst_QDir::nativeSeparators()
QCOMPARE(QDir::toNativeSeparators(QLatin1String("\\")), QString("\\"));
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("/")), QString("/"));
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("\\")), QString("/"));
+ QCOMPARE(QDir::fromNativeSeparators(QLatin1String("\\\\?\\C:\\")), QString("C:/"));
#else
QCOMPARE(QDir::toNativeSeparators(QLatin1String("/")), QString("/"));
QCOMPARE(QDir::toNativeSeparators(QLatin1String("\\")), QString("\\"));
diff --git a/tests/auto/corelib/io/qfile/BLACKLIST b/tests/auto/corelib/io/qfile/BLACKLIST
deleted file mode 100644
index 8366667166..0000000000
--- a/tests/auto/corelib/io/qfile/BLACKLIST
+++ /dev/null
@@ -1,7 +0,0 @@
-# QTBUG-48455
-[readLineStdin]
-msvc-2015 ci
-msvc-2017 ci
-[readLineStdin_lineByLine]
-msvc-2015 ci
-msvc-2017 ci
diff --git a/tests/auto/corelib/io/qfile/test.pro b/tests/auto/corelib/io/qfile/test.pro
index 95389ab3e2..7a2767bf3c 100644
--- a/tests/auto/corelib/io/qfile/test.pro
+++ b/tests/auto/corelib/io/qfile/test.pro
@@ -23,4 +23,4 @@ TESTDATA += \
Makefile forCopying.txt forRenaming.txt \
resources/file1.ext1
-win32:!winrt: LIBS += -lole32 -luuid
+win32:!winrt: QMAKE_USE += ole32 uuid
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 678a80c3f7..b8ae95dd93 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -550,6 +550,10 @@ void tst_QFile::exists()
QFile unc(uncPath);
QVERIFY2(unc.exists(), msgFileDoesNotExist(uncPath).constData());
#endif
+
+ QTest::ignoreMessage(QtWarningMsg, "Broken filename passed to function");
+ QVERIFY(!QFile::exists(QDir::currentPath() + QLatin1Char('/') +
+ QChar(QChar::Null) + QLatin1String("x/y")));
}
void tst_QFile::open_data()
@@ -2099,7 +2103,7 @@ void tst_QFile::i18nFileName()
QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts.setCodec("UTF-8");
- ts << fileName << endl;
+ ts << fileName << Qt::endl;
}
{
QFile file(fileName);
@@ -2149,7 +2153,7 @@ void tst_QFile::longFileName()
QFile file(fileName);
QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
- ts << fileName << endl;
+ ts << fileName << Qt::endl;
}
{
QFile file(fileName);
diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
index 496729f9f1..d181d16a3e 100644
--- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
@@ -5,4 +5,4 @@ SOURCES = tst_qfileinfo.cpp
RESOURCES += qfileinfo.qrc \
testdata.qrc
-win32:!winrt: LIBS += -ladvapi32 -lnetapi32
+win32:!winrt: QMAKE_USE += advapi32 netapi32
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 646fb2078a..0597a7d521 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -49,6 +49,7 @@
#ifdef Q_OS_WIN
#include <qt_windows.h>
#if !defined(Q_OS_WINRT)
+#include <private/qwinregistry_p.h>
#include <lm.h>
#endif
#endif
@@ -237,6 +238,15 @@ private slots:
void isSymLink_data();
void isSymLink();
+ void isSymbolicLink_data();
+ void isSymbolicLink();
+
+ void isShortcut_data();
+ void isShortcut();
+
+ void link_data();
+ void link();
+
void isHidden_data();
void isHidden();
#if defined(Q_OS_MAC)
@@ -1036,7 +1046,9 @@ void tst_QFileInfo::systemFiles()
QCOMPARE(fi.metadataChangeTime(), fi.lastModified()); // On Windows, they're the same
QVERIFY(fi.birthTime().isValid());
QVERIFY(fi.birthTime() <= fi.lastModified());
+#if QT_DEPRECATED_SINCE(5, 10)
QCOMPARE(fi.created(), fi.birthTime()); // On Windows, they're the same
+#endif
}
void tst_QFileInfo::compare_data()
@@ -1184,7 +1196,7 @@ void tst_QFileInfo::fileTimes()
QTest::qSleep(sleepTime);
beforeWrite = QDateTime::currentDateTime().addMSecs(-fsClockSkew);
QTextStream ts(&file);
- ts << fileName << endl;
+ ts << fileName << Qt::endl;
}
{
QFileInfo fileInfo(fileName);
@@ -1232,17 +1244,12 @@ void tst_QFileInfo::fileTimes()
//In Vista the last-access timestamp is not updated when the file is accessed/touched (by default).
//To enable this the HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate
//is set to 0, in the test machine.
- HKEY key;
- if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\FileSystem",
- 0, KEY_READ, &key)) {
- DWORD disabledAccessTimes = 0;
- DWORD size = sizeof(DWORD);
- LONG error = RegQueryValueEx(key, L"NtfsDisableLastAccessUpdate"
- , NULL, NULL, (LPBYTE)&disabledAccessTimes, &size);
- if (ERROR_SUCCESS == error && disabledAccessTimes)
- noAccessTime = true;
- RegCloseKey(key);
- }
+ const auto disabledAccessTimes =
+ QWinRegistryKey(HKEY_LOCAL_MACHINE,
+ LR"(SYSTEM\CurrentControlSet\Control\FileSystem)")
+ .dwordValue(L"NtfsDisableLastAccessUpdate");
+ if (disabledAccessTimes.second && disabledAccessTimes.first != 0)
+ noAccessTime = true;
#endif
if (noAccessTime)
@@ -1261,7 +1268,7 @@ void tst_QFileInfo::fakeFileTimes_data()
QTest::newRow("early") << QDateTime(QDate(1901, 12, 14), QTime(12, 0));
// QTBUG-12006 claims XP handled this (2010-Mar-26 8:46:10) wrong due to an MS API bug:
- QTest::newRow("XP-bug") << QDateTime::fromTime_t(1269593170);
+ QTest::newRow("XP-bug") << QDateTime::fromSecsSinceEpoch(1269593170);
}
void tst_QFileInfo::fakeFileTimes()
@@ -1335,6 +1342,176 @@ void tst_QFileInfo::isSymLink()
#endif
}
+void tst_QFileInfo::isShortcut_data()
+{
+ QFile::remove("link.lnk");
+ QFile::remove("symlink.lnk");
+ QFile::remove("link");
+ QFile::remove("symlink");
+ QFile::remove("directory.lnk");
+ QFile::remove("directory");
+
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("isShortcut");
+
+ QFile regularFile(m_sourceFile);
+ QTest::newRow("regular")
+ << regularFile.fileName() << false;
+ QTest::newRow("directory")
+ << QDir::currentPath() << false;
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ // windows shortcuts
+ QVERIFY(regularFile.link("link.lnk"));
+ QTest::newRow("shortcut")
+ << "link.lnk" << true;
+ QVERIFY(regularFile.link("link"));
+ QTest::newRow("invalid-shortcut")
+ << "link" << false;
+ QVERIFY(QFile::link(QDir::currentPath(), "directory.lnk"));
+ QTest::newRow("directory-shortcut")
+ << "directory.lnk" << true;
+#endif
+}
+
+void tst_QFileInfo::isShortcut()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, isShortcut);
+
+ QFileInfo fi(path);
+ QCOMPARE(fi.isShortcut(), isShortcut);
+}
+
+void tst_QFileInfo::isSymbolicLink_data()
+{
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("isSymbolicLink");
+
+ QFile regularFile(m_sourceFile);
+ QTest::newRow("regular")
+ << regularFile.fileName() << false;
+ QTest::newRow("directory")
+ << QDir::currentPath() << false;
+
+#ifndef Q_NO_SYMLINKS
+#if defined(Q_OS_WIN)
+#if !defined(Q_OS_WINRT)
+ QString errorMessage;
+ const DWORD creationResult = createSymbolicLink("symlink", m_sourceFile, &errorMessage);
+ if (creationResult == ERROR_PRIVILEGE_NOT_HELD) {
+ QWARN(msgInsufficientPrivileges(errorMessage));
+ } else {
+ QVERIFY2(creationResult == ERROR_SUCCESS, qPrintable(errorMessage));
+ QTest::newRow("NTFS-symlink")
+ << "symlink" << true;
+ }
+#endif // !Q_OS_WINRT
+#else // Unix:
+ QVERIFY(regularFile.link("symlink.lnk"));
+ QTest::newRow("symlink.lnk")
+ << "symlink.lnk" << true;
+ QVERIFY(regularFile.link("symlink"));
+ QTest::newRow("symlink")
+ << "symlink" << true;
+ QVERIFY(QFile::link(QDir::currentPath(), "directory"));
+ QTest::newRow("directory-symlink")
+ << "directory" << true;
+#endif
+#endif // !Q_NO_SYMLINKS
+}
+
+void tst_QFileInfo::isSymbolicLink()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, isSymbolicLink);
+
+ QFileInfo fi(path);
+ QCOMPARE(fi.isSymbolicLink(), isSymbolicLink);
+}
+
+void tst_QFileInfo::link_data()
+{
+ QFile::remove("link");
+ QFile::remove("link.lnk");
+ QFile::remove("brokenlink");
+ QFile::remove("brokenlink.lnk");
+ QFile::remove("dummyfile");
+ QFile::remove("relative/link");
+
+ QTest::addColumn<QString>("path");
+ QTest::addColumn<bool>("isShortcut");
+ QTest::addColumn<bool>("isSymbolicLink");
+ QTest::addColumn<QString>("linkTarget");
+
+ QFile file1(m_sourceFile);
+ QFile file2("dummyfile");
+ file2.open(QIODevice::WriteOnly);
+
+ QTest::newRow("existent file") << m_sourceFile << false << false << "";
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ // windows shortcuts
+ QVERIFY(file1.link("link.lnk"));
+ QTest::newRow("link.lnk")
+ << "link.lnk" << true << false << QFileInfo(m_sourceFile).absoluteFilePath();
+
+ QVERIFY(file2.link("brokenlink.lnk"));
+ QTest::newRow("broken link.lnk")
+ << "brokenlink.lnk" << true << false << QFileInfo("dummyfile").absoluteFilePath();
+#endif
+
+#ifndef Q_NO_SYMLINKS
+#if defined(Q_OS_WIN)
+#if !defined(Q_OS_WINRT)
+ QString errorMessage;
+ DWORD creationResult = createSymbolicLink("link", m_sourceFile, &errorMessage);
+ if (creationResult == ERROR_PRIVILEGE_NOT_HELD) {
+ QWARN(msgInsufficientPrivileges(errorMessage));
+ } else {
+ QVERIFY2(creationResult == ERROR_SUCCESS, qPrintable(errorMessage));
+ QTest::newRow("link")
+ << "link" << false << true << QFileInfo(m_sourceFile).absoluteFilePath();
+ }
+
+ creationResult = createSymbolicLink("brokenlink", "dummyfile", &errorMessage);
+ if (creationResult == ERROR_PRIVILEGE_NOT_HELD) {
+ QWARN(msgInsufficientPrivileges(errorMessage));
+ } else {
+ QVERIFY2(creationResult == ERROR_SUCCESS, qPrintable(errorMessage));
+ QTest::newRow("broken link")
+ << "brokenlink" << false << true << QFileInfo("dummyfile").absoluteFilePath();
+ }
+#endif // !Q_OS_WINRT
+#else // Unix:
+ QVERIFY(file1.link("link"));
+ QTest::newRow("link")
+ << "link" << false << true << QFileInfo(m_sourceFile).absoluteFilePath();
+
+ QVERIFY(file2.link("brokenlink"));
+ QTest::newRow("broken link")
+ << "brokenlink" << false << true << QFileInfo("dummyfile").absoluteFilePath();
+
+ QDir::current().mkdir("relative");
+ QFile::link("../dummyfile", "relative/link");
+ QTest::newRow("relative link")
+ << "relative/link" << false << true << QFileInfo("dummyfile").absoluteFilePath();
+#endif
+#endif // !Q_NO_SYMLINKS
+ file2.remove();
+}
+
+void tst_QFileInfo::link()
+{
+ QFETCH(QString, path);
+ QFETCH(bool, isShortcut);
+ QFETCH(bool, isSymbolicLink);
+ QFETCH(QString, linkTarget);
+
+ QFileInfo fi(path);
+ QCOMPARE(fi.isShortcut(), isShortcut);
+ QCOMPARE(fi.isSymbolicLink(), isSymbolicLink);
+ QCOMPARE(fi.symLinkTarget(), linkTarget);
+}
+
void tst_QFileInfo::isHidden_data()
{
QTest::addColumn<QString>("path");
@@ -1636,7 +1813,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks()
QVERIFY2(creationResult == ERROR_SUCCESS, qPrintable(errorMessage));
QFileInfo fi(path);
- const bool actualIsSymLink = fi.isSymLink();
+ const bool actualIsSymLink = fi.isSymbolicLink();
const QString actualSymLinkTarget = isSymLink ? fi.symLinkTarget() : QString();
const QString actualCanonicalFilePath = isSymLink ? fi.canonicalFilePath() : QString();
// Ensure that junctions, mountpoints are removed. If this fails, do not remove
@@ -1665,14 +1842,16 @@ void tst_QFileInfo::brokenShortcut()
file.close();
QFileInfo info(linkName);
- QVERIFY(info.isSymLink());
+ QVERIFY(!info.isSymbolicLink());
+ QVERIFY(info.isShortcut());
QVERIFY(!info.exists());
QFile::remove(linkName);
QDir current; // QTBUG-21863
QVERIFY(current.mkdir(linkName));
QFileInfo dirInfo(linkName);
- QVERIFY(!dirInfo.isSymLink());
+ QVERIFY(!dirInfo.isSymbolicLink());
+ QVERIFY(!dirInfo.isShortcut());
QVERIFY(dirInfo.isDir());
current.rmdir(linkName);
}
@@ -1915,7 +2094,7 @@ void tst_QFileInfo::owner()
DWORD bufSize = 1024;
if (GetUserNameW(usernameBuf, &bufSize)) {
userName = QString::fromWCharArray(usernameBuf);
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && IsUserAdmin()) {
+ if (IsUserAdmin()) {
// Special case : If the user is a member of Administrators group, all files
// created by the current user are owned by the Administrators group.
LPLOCALGROUP_USERS_INFO_0 pBuf = NULL;
@@ -2029,7 +2208,8 @@ static void stateCheck(const QFileInfo &info, const QString &dirname, const QStr
QVERIFY(!info.isHidden());
QVERIFY(!info.isFile());
QVERIFY(!info.isDir());
- QVERIFY(!info.isSymLink());
+ QVERIFY(!info.isSymbolicLink());
+ QVERIFY(!info.isShortcut());
QVERIFY(!info.isBundle());
QVERIFY(!info.isRoot());
QCOMPARE(info.isNativePath(), !filename.isEmpty());
@@ -2042,7 +2222,9 @@ static void stateCheck(const QFileInfo &info, const QString &dirname, const QStr
QCOMPARE(info.permissions(), QFile::Permissions());
+#if QT_DEPRECATED_SINCE(5, 10)
QVERIFY(!info.created().isValid());
+#endif
QVERIFY(!info.birthTime().isValid());
QVERIFY(!info.metadataChangeTime().isValid());
QVERIFY(!info.lastRead().isValid());
@@ -2084,5 +2266,6 @@ void tst_QFileInfo::nonExistingFile()
stateCheck(info, dirname, filename);
}
+
QTEST_MAIN(tst_QFileInfo)
#include "tst_qfileinfo.moc"
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST b/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
index 90b714758a..457499591d 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
+++ b/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
@@ -1,6 +1,7 @@
# QTBUG-33574 QTBUG-30943
[signalsEmittedAfterFileMoved]
-windows
+windows-7sp1
+windows-10
[watchFileAndItsDirectory:native backend-testfile]
osx
windows
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 67ffa91e57..cdd1f6361e 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -46,11 +46,13 @@ public:
tst_QFileSystemWatcher();
private slots:
+#ifdef QT_BUILD_INTERNAL
void basicTest_data();
void basicTest();
void watchDirectory_data();
void watchDirectory();
+#endif
void addPath();
void removePath();
@@ -58,8 +60,10 @@ private slots:
void removePaths();
void removePathsFilesInSameDirectory();
+#ifdef QT_BUILD_INTERNAL
void watchFileAndItsDirectory_data() { basicTest_data(); }
void watchFileAndItsDirectory();
+#endif
void nonExistingFile();
@@ -67,8 +71,10 @@ private slots:
void destroyAfterQCoreApplication();
+#ifdef QT_BUILD_INTERNAL
void QTBUG2331();
void QTBUG2331_data() { basicTest_data(); }
+#endif
void signalsEmittedAfterFileMoved();
@@ -90,6 +96,7 @@ tst_QFileSystemWatcher::tst_QFileSystemWatcher()
#endif
}
+#ifdef QT_BUILD_INTERNAL
void tst_QFileSystemWatcher::basicTest_data()
{
QTest::addColumn<QString>("backend");
@@ -360,6 +367,7 @@ void tst_QFileSystemWatcher::watchDirectory()
for (const auto &testDirName : testDirs)
QVERIFY(temporaryDir.rmdir(testDirName));
}
+#endif // QT_BUILD_INTERNAL
void tst_QFileSystemWatcher::addPath()
{
@@ -502,6 +510,7 @@ void tst_QFileSystemWatcher::removePathsFilesInSameDirectory()
QCOMPARE(watcher.files().size(), 0);
}
+#ifdef QT_BUILD_INTERNAL
static QByteArray msgFileOperationFailed(const char *what, const QFile &f)
{
return what + QByteArrayLiteral(" failed on \"")
@@ -601,6 +610,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
QVERIFY(temporaryDir.rmdir(testDirName));
}
+#endif // QT_BUILD_INTERNAL
void tst_QFileSystemWatcher::nonExistingFile()
{
@@ -673,6 +683,7 @@ void tst_QFileSystemWatcher::destroyAfterQCoreApplication()
QTest::qWait(30);
}
+#ifdef QT_BUILD_INTERNAL
// regression test for QTBUG2331.
// essentially, on windows, directories were not unwatched after being deleted
// from the disk, causing all sorts of interesting problems.
@@ -696,6 +707,7 @@ void tst_QFileSystemWatcher::QTBUG2331()
QTRY_COMPARE(changedSpy.count(), 1);
QCOMPARE(watcher.directories(), QStringList());
}
+#endif // QT_BUILD_INTERNAL
class SignalReceiver : public QObject
{
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index eeeb3bc6e2..8703b15dda 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -496,7 +496,7 @@ void tst_QLockFile::noPermissionsWindows()
QSKIP("This test is for desktop Windows only");
#endif
#ifdef Q_OS_WIN
- if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS7)
+ if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows7)
QSKIP("This test requires at least Windows 7");
#endif
if (const int p = processProperties()) {
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
index da2660fd02..e33e22b36f 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.pro
@@ -3,4 +3,4 @@ TARGET = tst_qlockfile
SOURCES += tst_qlockfile.cpp
QT = core-private testlib concurrent
-win32:!winrt:LIBS += -ladvapi32
+win32:!winrt: QMAKE_USE += advapi32
diff --git a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
index 11a9b3f189..79ac6b0fc4 100644
--- a/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
+++ b/tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp
@@ -104,7 +104,7 @@ public:
for (int a = 0; a < _configitemEntryOrder.count(); a++) {
out << _configitemEntryOrder[a]
<< " = "
- << _values.value(_configitemEntryOrder[a]) << endl;
+ << _values.value(_configitemEntryOrder[a]) << Qt::endl;
}
out.flush();
return ret.toLatin1();
@@ -369,11 +369,9 @@ private slots:
}
Q_LOGGING_CATEGORY(TST_MACRO_1, "tst.macro.1")
-#ifdef Q_COMPILER_VARIADIC_MACROS
Q_LOGGING_CATEGORY(TST_MACRO_2, "tst.macro.2", QtDebugMsg)
Q_LOGGING_CATEGORY(TST_MACRO_3, "tst.macro.3", QtFatalMsg)
Q_LOGGING_CATEGORY(TST_MACRO_4, "tst.macro.4", QtInfoMsg)
-#endif
void QLoggingCategoryMacro()
{
@@ -384,7 +382,6 @@ private slots:
QCOMPARE(cat1.isWarningEnabled(), true);
QCOMPARE(cat1.isCriticalEnabled(), true);
-#ifdef Q_COMPILER_VARIADIC_MACROS
const QLoggingCategory &cat2 = TST_MACRO_2();
QCOMPARE(cat2.categoryName(), "tst.macro.2");
QCOMPARE(cat2.isDebugEnabled(), true);
@@ -405,7 +402,6 @@ private slots:
QCOMPARE(cat4.isInfoEnabled(), true);
QCOMPARE(cat4.isWarningEnabled(), true);
QCOMPARE(cat4.isCriticalEnabled(), true);
-#endif
}
void qCDebugMacros()
diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
index 569c610e24..b05c89a8bb 100644
--- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
+++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
@@ -65,7 +65,7 @@ void tst_QNoDebug::noDebugOutput() const
void tst_QNoDebug::streaming() const
{
QDateTime dt(QDate(1,2,3),QTime(4,5,6));
- const QByteArray debugString = dt.toString(QStringViewLiteral("yyyy-MM-dd HH:mm:ss.zzz t")).toLatin1();
+ const QByteArray debugString = dt.toString(u"yyyy-MM-dd HH:mm:ss.zzz t").toLatin1();
const QByteArray message = "QDateTime(" + debugString + " Qt::LocalTime)";
QTest::ignoreMessage(QtWarningMsg, message.constData());
qWarning() << dt;
diff --git a/tests/auto/corelib/io/qprocess/BLACKLIST b/tests/auto/corelib/io/qprocess/BLACKLIST
index b355bb0f75..682bcbc60c 100644
--- a/tests/auto/corelib/io/qprocess/BLACKLIST
+++ b/tests/auto/corelib/io/qprocess/BLACKLIST
@@ -2,8 +2,5 @@
redhatenterpriselinuxworkstation-6.6
# QTBUG-48455
[fileWriterProcess]
-msvc-2015 ci
-msvc-2017 ci
-[softExitInSlots]
-# QTBUG-66903
-windows
+windows-10 msvc-2017
+
diff --git a/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro b/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro
index 935f43630c..e41ed0a425 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro
@@ -1,6 +1,6 @@
win32 {
SOURCES = main_win.cpp
- LIBS += -luser32
+ QMAKE_USE += user32
}
CONFIG -= qt app_bundle
diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro
index 2cfcb4794e..964c47f6ae 100644
--- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro
+++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro
@@ -1,6 +1,6 @@
win32 {
SOURCES = main_win.cpp
- LIBS += -luser32
+ QMAKE_USE += user32
}
unix {
SOURCES = main_unix.cpp
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index c51994c1c1..e799369c8a 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -32,6 +32,7 @@
#include <QtTest/QtTest>
#include <QtCore/QProcess>
#include <QtCore/QDir>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QFile>
#include <QtCore/QThread>
#include <QtCore/QTemporaryDir>
@@ -150,6 +151,13 @@ private slots:
void failToStartEmptyArgs_data();
void failToStartEmptyArgs();
+#if QT_DEPRECATED_SINCE(5, 13)
+ void crashTest2_deprecated();
+ void restartProcessDeadlock_deprecated();
+ void waitForReadyReadInAReadyReadSlot_deprecated();
+ void finishProcessBeforeReadingDone_deprecated();
+#endif
+
protected slots:
void readFromProcess();
void exitLoopSlot();
@@ -186,12 +194,20 @@ void tst_QProcess::getSetCheck()
QProcess obj1;
// ProcessChannelMode QProcess::readChannelMode()
// void QProcess::setProcessChannelMode(ProcessChannelMode)
+#if QT_DEPRECATED_SINCE(5, 13)
obj1.setProcessChannelMode(QProcess::ProcessChannelMode(QProcess::SeparateChannels));
QCOMPARE(QProcess::ProcessChannelMode(QProcess::SeparateChannels), obj1.readChannelMode());
obj1.setProcessChannelMode(QProcess::ProcessChannelMode(QProcess::MergedChannels));
QCOMPARE(QProcess::ProcessChannelMode(QProcess::MergedChannels), obj1.readChannelMode());
obj1.setProcessChannelMode(QProcess::ProcessChannelMode(QProcess::ForwardedChannels));
QCOMPARE(QProcess::ProcessChannelMode(QProcess::ForwardedChannels), obj1.readChannelMode());
+#endif
+ obj1.setProcessChannelMode(QProcess::ProcessChannelMode(QProcess::SeparateChannels));
+ QCOMPARE(QProcess::ProcessChannelMode(QProcess::SeparateChannels), obj1.processChannelMode());
+ obj1.setProcessChannelMode(QProcess::ProcessChannelMode(QProcess::MergedChannels));
+ QCOMPARE(QProcess::ProcessChannelMode(QProcess::MergedChannels), obj1.processChannelMode());
+ obj1.setProcessChannelMode(QProcess::ProcessChannelMode(QProcess::ForwardedChannels));
+ QCOMPARE(QProcess::ProcessChannelMode(QProcess::ForwardedChannels), obj1.processChannelMode());
// ProcessChannel QProcess::readChannel()
// void QProcess::setReadChannel(ProcessChannel)
@@ -334,12 +350,14 @@ void tst_QProcess::crashTest()
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
QSignalSpy spy(process.data(), &QProcess::errorOccurred);
- QSignalSpy spy2(process.data(), static_cast<QProcessErrorSignal>(&QProcess::error));
- QSignalSpy spy3(process.data(), static_cast<QProcessFinishedSignal2>(&QProcess::finished));
-
+ QSignalSpy spy2(process.data(), static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
+
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy spy3(process.data(), static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy3.isValid());
+#endif
QVERIFY(process->waitForFinished(30000));
@@ -347,10 +365,12 @@ void tst_QProcess::crashTest()
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
QCOMPARE(spy2.count(), 1);
- QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy2.at(0).at(0).constData()), QProcess::Crashed);
+ QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit);
+#if QT_DEPRECATED_SINCE(5, 6)
QCOMPARE(spy3.count(), 1);
- QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy3.at(0).at(1).constData()), QProcess::CrashExit);
+ QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy3.at(0).at(0).constData()), QProcess::Crashed);
+#endif
QCOMPARE(process->exitStatus(), QProcess::CrashExit);
@@ -378,7 +398,7 @@ void tst_QProcess::crashTest2()
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
- QObject::connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ QObject::connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
this, &tst_QProcess::exitLoopSlot);
QTestEventLoop::instance().enterLoop(30);
@@ -420,7 +440,7 @@ void tst_QProcess::echoTest()
process.write(input);
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
do {
QVERIFY(process.isOpen());
@@ -479,7 +499,7 @@ void tst_QProcess::echoTest2()
QVERIFY(spy1.isValid());
QVERIFY(spy2.isValid());
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
forever {
QTestEventLoop::instance().enterLoop(1);
@@ -644,9 +664,11 @@ void tst_QProcess::readTimeoutAndThenCrash()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QSignalSpy spy(&process, &QProcess::errorOccurred);
- QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy.isValid());
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy2.isValid());
+#endif
process.kill();
@@ -655,8 +677,10 @@ void tst_QProcess::readTimeoutAndThenCrash()
QCOMPARE(spy.count(), 1);
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
+#if QT_DEPRECATED_SINCE(5, 6)
QCOMPARE(spy2.count(), 1);
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy2.at(0).at(0).constData()), QProcess::Crashed);
+#endif
}
void tst_QProcess::waitForFinished()
@@ -696,12 +720,11 @@ void tst_QProcess::deadWhileReading()
void tst_QProcess::restartProcessDeadlock()
{
-
// The purpose of this test is to detect whether restarting a
// process in the finished() connected slot causes a deadlock
// because of the way QProcessManager uses its locks.
QProcess process;
- connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
this, &tst_QProcess::restartProcess);
process.start("testProcessEcho/testProcessEcho");
@@ -709,7 +732,7 @@ void tst_QProcess::restartProcessDeadlock()
QCOMPARE(process.write("", 1), qlonglong(1));
QVERIFY(process.waitForFinished(5000));
- QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), nullptr, nullptr);
+ QObject::disconnect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished), nullptr, nullptr);
QCOMPARE(process.write("", 1), qlonglong(1));
QVERIFY(process.waitForFinished(5000));
@@ -1026,7 +1049,7 @@ void tst_QProcess::mergedChannels()
{
QProcess process;
process.setProcessChannelMode(QProcess::MergedChannels);
- QCOMPARE(process.readChannelMode(), QProcess::MergedChannels);
+ QCOMPARE(process.processChannelMode(), QProcess::MergedChannels);
process.start("testProcessEcho2/testProcessEcho2");
@@ -1154,7 +1177,7 @@ protected:
exitCode = 90210;
QProcess process;
- connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
this, &TestThread::catchExitCode, Qt::DirectConnection);
process.start("testProcessEcho/testProcessEcho");
@@ -1228,7 +1251,7 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot()
{
QProcess process;
connect(&process, &QIODevice::readyRead, this, &tst_QProcess::waitForReadyReadInAReadyReadSlotSlot);
- connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
this, &tst_QProcess::exitLoopSlot);
bytesAvailable = 0;
@@ -1467,15 +1490,19 @@ void tst_QProcess::failToStart()
QProcess process;
QSignalSpy stateSpy(&process, &QProcess::stateChanged);
QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
- QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
-
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(stateSpy.isValid());
QVERIFY(errorSpy.isValid());
- QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
+
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QVERIFY(errorSpy2.isValid());
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
QVERIFY(finishedSpy2.isValid());
+#endif
// OS X and HP-UX have a really low default process limit (~100), so spawning
// to many processes here will cause test failures later on.
@@ -1490,7 +1517,9 @@ void tst_QProcess::failToStart()
for (int j = 0; j < 8; ++j) {
for (int i = 0; i < attempts; ++i) {
QCOMPARE(errorSpy.count(), j * attempts + i);
+#if QT_DEPRECATED_SINCE(5, 6)
QCOMPARE(errorSpy2.count(), j * attempts + i);
+#endif
process.start("/blurp");
switch (j) {
@@ -1515,9 +1544,13 @@ void tst_QProcess::failToStart()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), j * attempts + i + 1);
- QCOMPARE(errorSpy2.count(), j * attempts + i + 1);
QCOMPARE(finishedSpy.count(), 0);
+#if QT_DEPRECATED_SINCE(5, 6)
+ QCOMPARE(errorSpy2.count(), j * attempts + i + 1);
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
QCOMPARE(finishedSpy2.count(), 0);
+#endif
int it = j * attempts + i + 1;
@@ -1536,14 +1569,18 @@ void tst_QProcess::failToStartWithWait()
QProcess process;
QEventLoop loop;
QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
- QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
-
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
- QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
+
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QVERIFY(errorSpy2.isValid());
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
QVERIFY(finishedSpy2.isValid());
+#endif
for (int i = 0; i < 50; ++i) {
process.start("/blurp", QStringList() << "-v" << "-debug");
@@ -1551,9 +1588,14 @@ void tst_QProcess::failToStartWithWait()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), i + 1);
- QCOMPARE(errorSpy2.count(), i + 1);
QCOMPARE(finishedSpy.count(), 0);
+#if QT_DEPRECATED_SINCE(5, 6)
+ QCOMPARE(errorSpy2.count(), i + 1);
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
QCOMPARE(finishedSpy2.count(), 0);
+#endif
+
}
}
@@ -1565,14 +1607,18 @@ void tst_QProcess::failToStartWithEventLoop()
QProcess process;
QEventLoop loop;
QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
- QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
-
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
- QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
+
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QVERIFY(errorSpy2.isValid());
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
QVERIFY(finishedSpy2.isValid());
+#endif
// The error signal may be emitted before start() returns
connect(&process, &QProcess::errorOccurred, &loop, &QEventLoop::quit, Qt::QueuedConnection);
@@ -1585,9 +1631,13 @@ void tst_QProcess::failToStartWithEventLoop()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), i + 1);
- QCOMPARE(errorSpy2.count(), i + 1);
QCOMPARE(finishedSpy.count(), 0);
+#if QT_DEPRECATED_SINCE(5, 6)
+ QCOMPARE(errorSpy2.count(), i + 1);
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
QCOMPARE(finishedSpy2.count(), 0);
+#endif
}
}
@@ -1605,8 +1655,12 @@ void tst_QProcess::failToStartEmptyArgs()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QProcess process;
- QSignalSpy errorSpy(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy errorSpy(&process, static_cast<QProcessErrorSignal>(&QProcess::errorOccurred));
QVERIFY(errorSpy.isValid());
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QVERIFY(errorSpy2.isValid());
+#endif
switch (startOverload) {
case 0:
@@ -1624,6 +1678,9 @@ void tst_QProcess::failToStartEmptyArgs()
QVERIFY(!process.waitForStarted());
QCOMPARE(errorSpy.count(), 1);
+#if QT_DEPRECATED_SINCE(5, 6)
+ QCOMPARE(errorSpy2.count(), 1);
+#endif
QCOMPARE(process.error(), QProcess::FailedToStart);
}
@@ -1855,24 +1912,32 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
QProcess process;
QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
+ QVERIFY(errorSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
+#if QT_DEPRECATED_SINCE(5, 6)
QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QVERIFY(errorSpy2.isValid());
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
QSignalSpy finishedSpy1(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
-
- QVERIFY(errorSpy.isValid());
- QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy1.isValid());
- QVERIFY(finishedSpy2.isValid());
+#endif
QVERIFY(!process.waitForReadyRead()); // used to crash
process.start("doesntexist");
QVERIFY(!process.waitForReadyRead());
QCOMPARE(errorSpy.count(), 1);
QCOMPARE(errorSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(finishedSpy.count(), 0);
+#if QT_DEPRECATED_SINCE(5, 6)
QCOMPARE(errorSpy2.count(), 1);
QCOMPARE(errorSpy2.at(0).at(0).toInt(), 0);
+#endif
+#if QT_DEPRECATED_SINCE(5, 13)
QCOMPARE(finishedSpy1.count(), 0);
- QCOMPARE(finishedSpy2.count(), 0);
+#endif
}
void tst_QProcess::setStandardInputFile()
@@ -2072,7 +2137,7 @@ void tst_QProcess::fileWriterProcess()
stdinStr += line;
}
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
const QString fileName = m_temporaryDir.path() + QLatin1String("/fileWriterProcess.txt");
const QString binary = QDir::currentPath() + QLatin1String("/fileWriterProcess/fileWriterProcess");
@@ -2303,14 +2368,18 @@ void tst_QProcess::invalidProgramString()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QSignalSpy spy(&process, &QProcess::errorOccurred);
- QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy.isValid());
+#if QT_DEPRECATED_SINCE(5, 6)
+ QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy2.isValid());
+#endif
process.start(programString);
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(spy.count(), 1);
+#if QT_DEPRECATED_SINCE(5, 6)
QCOMPARE(spy2.count(), 1);
+#endif
QVERIFY(!QProcess::startDetached(programString));
}
@@ -2364,7 +2433,7 @@ void tst_QProcess::finishProcessBeforeReadingDone()
QProcess process;
BlockOnReadStdOut blocker(&process);
QEventLoop loop;
- connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ connect(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
&loop, &QEventLoop::quit);
process.start("testProcessOutput/testProcessOutput");
QVERIFY(process.waitForStarted());
@@ -2510,5 +2579,106 @@ void tst_QProcess::processEventsInAReadyReadSlot()
QVERIFY(process.waitForFinished());
}
+#if QT_DEPRECATED_SINCE(5, 13)
+
+void tst_QProcess::crashTest2_deprecated()
+{
+ QProcess process;
+ process.start("testProcessCrash/testProcessCrash");
+ QVERIFY(process.waitForStarted(5000));
+
+ qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
+ qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
+
+ QSignalSpy spy(&process, static_cast<QProcessErrorSignal>(&QProcess::errorOccurred));
+ QSignalSpy spy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
+
+ QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
+
+ QObject::connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::exitLoopSlot);
+
+ QTestEventLoop::instance().enterLoop(30);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Failed to detect crash : operation timed out");
+
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
+
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit);
+
+ QCOMPARE(process.exitStatus(), QProcess::CrashExit);
+}
+
+void tst_QProcess::restartProcessDeadlock_deprecated()
+{
+ // The purpose of this test is to detect whether restarting a
+ // process in the finished() connected slot causes a deadlock
+ // because of the way QProcessManager uses its locks.
+ QProcess process;
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::restartProcess);
+
+ process.start("testProcessEcho/testProcessEcho");
+
+ QCOMPARE(process.write("", 1), qlonglong(1));
+ QVERIFY(process.waitForFinished(5000));
+
+ QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), nullptr, nullptr);
+
+ QCOMPARE(process.write("", 1), qlonglong(1));
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+}
+
+void tst_QProcess::waitForReadyReadInAReadyReadSlot_deprecated()
+{
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::waitForReadyReadInAReadyReadSlotSlot);
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::exitLoopSlot);
+ bytesAvailable = 0;
+
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
+
+ QSignalSpy spy(&process, &QProcess::readyRead);
+ QVERIFY(spy.isValid());
+ process.write("foo");
+ QTestEventLoop::instance().enterLoop(30);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spy.count(), 1);
+
+ process.disconnect();
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ QVERIFY(process.bytesAvailable() > bytesAvailable);
+}
+
+void tst_QProcess::finishProcessBeforeReadingDone_deprecated()
+{
+ QProcess process;
+ BlockOnReadStdOut blocker(&process);
+ QEventLoop loop;
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ &loop, &QEventLoop::quit);
+ process.start("testProcessOutput/testProcessOutput");
+ QVERIFY(process.waitForStarted());
+ loop.exec();
+ QStringList lines = QString::fromLocal8Bit(process.readAllStandardOutput()).split(
+ QRegExp(QStringLiteral("[\r\n]")), QString::SkipEmptyParts);
+ QVERIFY(!lines.isEmpty());
+ QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+}
+
+#endif
+
QTEST_MAIN(tst_QProcess)
#include "tst_qprocess.moc"
diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro
index 3838a72c21..f523116cc9 100644
--- a/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro
+++ b/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro
@@ -22,7 +22,7 @@ android:!android-embedded {
RESOURCES += android_testdata.qrc
}
-win32 {
+win32:debug_and_release {
CONFIG(debug, debug|release): LIBS += -Lstaticplugin/debug
else: LIBS += -Lstaticplugin/release
} else {
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index 0b50c391b8..44c8c4b681 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2018 Intel Corporation.
+** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -55,6 +55,10 @@ private slots:
void checkStructure();
void searchPath_data();
void searchPath();
+#if QT_DEPRECATED_SINCE(5, 13)
+ void searchPath_deprecated_data();
+ void searchPath_deprecated();
+#endif
void doubleSlashInRoot();
void setLocale();
void lastModified();
@@ -420,6 +424,58 @@ void tst_QResourceEngine::checkStructure()
void tst_QResourceEngine::searchPath_data()
{
+ auto searchPath = QFileInfo(QFINDTESTDATA("testqrc")).canonicalFilePath();
+
+ QTest::addColumn<QString>("searchPathPrefix");
+ QTest::addColumn<QString>("searchPath");
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QByteArray>("expected");
+
+ QTest::newRow("no_search_path")
+ << QString()
+ << QString()
+ << ":search_file.txt"
+ << QByteArray("root\n");
+ QTest::newRow("path1")
+ << "searchpath1"
+ << searchPath
+ << "searchpath1:searchpath1/search_file.txt"
+ << QByteArray("path1\n");
+ QTest::newRow("no_search_path2")
+ << QString()
+ << QString()
+ << ":/search_file.txt"
+ << QByteArray("root\n");
+ QTest::newRow("path2")
+ << "searchpath2"
+ << searchPath + "/searchpath2"
+ << "searchpath2:search_file.txt"
+ << QByteArray("path2\n");
+}
+
+void tst_QResourceEngine::searchPath()
+{
+ QFETCH(QString, searchPathPrefix);
+ QFETCH(QString, searchPath);
+ QFETCH(QString, file);
+ QFETCH(QByteArray, expected);
+
+ if (!searchPath.isEmpty())
+ QDir::addSearchPath(searchPathPrefix, searchPath);
+ QFile qf(file);
+ QVERIFY(qf.open(QFile::ReadOnly));
+ QByteArray actual = qf.readAll();
+
+ actual.replace('\r', "");
+
+ QCOMPARE(actual, expected);
+ qf.close();
+}
+
+#if QT_DEPRECATED_SINCE(5, 13)
+
+void tst_QResourceEngine::searchPath_deprecated_data()
+{
QTest::addColumn<QString>("searchPath");
QTest::addColumn<QString>("file");
QTest::addColumn<QByteArray>("expected");
@@ -438,7 +494,7 @@ void tst_QResourceEngine::searchPath_data()
<< QByteArray("path2\n");
}
-void tst_QResourceEngine::searchPath()
+void tst_QResourceEngine::searchPath_deprecated()
{
QFETCH(QString, searchPath);
QFETCH(QString, file);
@@ -456,6 +512,8 @@ void tst_QResourceEngine::searchPath()
qf.close();
}
+#endif
+
void tst_QResourceEngine::checkUnregisterResource_data()
{
QTest::addColumn<QString>("rcc_file");
@@ -505,15 +563,15 @@ void tst_QResourceEngine::setLocale()
// default constructed QResource gets the default locale
QResource resource;
resource.setFileName("aliasdir/aliasdir.txt");
- QVERIFY(!resource.isCompressed());
+ QCOMPARE(resource.compressionAlgorithm(), QResource::NoCompression);
// change the default locale and make sure it doesn't affect the resource
QLocale::setDefault(QLocale("de_CH"));
- QVERIFY(!resource.isCompressed());
+ QCOMPARE(resource.compressionAlgorithm(), QResource::NoCompression);
// then explicitly set the locale on qresource
resource.setLocale(QLocale("de_CH"));
- QVERIFY(resource.isCompressed());
+ QVERIFY(resource.compressionAlgorithm() != QResource::NoCompression);
// the reset the default locale back
QLocale::setDefault(QLocale::system());
diff --git a/tests/auto/corelib/io/qsettings/qsettings.pro b/tests/auto/corelib/io/qsettings/qsettings.pro
index 79552b62df..98ea337e7f 100644
--- a/tests/auto/corelib/io/qsettings/qsettings.pro
+++ b/tests/auto/corelib/io/qsettings/qsettings.pro
@@ -5,7 +5,7 @@ SOURCES = tst_qsettings.cpp
RESOURCES += qsettings.qrc
INCLUDEPATH += $$PWD/../../kernel/qmetatype
-msvc: LIBS += advapi32.lib
+msvc: QMAKE_USE += advapi32
darwin: LIBS += -framework CoreFoundation
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index 8b69518ef7..0f07ba4bb2 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -54,6 +54,9 @@
#if defined(Q_OS_WIN)
#include <QtCore/qt_windows.h>
+#ifndef Q_OS_WINRT
+# include <private/qwinregistry_p.h>
+#endif
#else
#include <unistd.h>
#endif
@@ -311,8 +314,11 @@ void tst_QSettings::initTestCase()
void tst_QSettings::cleanupTestFiles()
{
- QSettings::setSystemIniPath(settingsPath("__system__"));
- QSettings::setUserIniPath(settingsPath("__user__"));
+ QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, settingsPath("__system__"));
+ QSettings::setPath(QSettings::NativeFormat, QSettings::SystemScope, settingsPath("__system__"));
+
+ QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settingsPath("__user__"));
+ QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, settingsPath("__user__"));
QDir settingsDir(settingsPath());
if (settingsDir.exists())
@@ -1363,7 +1369,9 @@ void tst_QSettings::testVariantTypes()
if (format >= QSettings::InvalidFormat) {
testVal("keysequence", QKeySequence(Qt::ControlModifier + Qt::Key_F1), QKeySequence, KeySequence);
} else {
- testVal("keysequence", QKeySequence(Qt::ControlModifier + Qt::Key_F1), QString, String);
+ testVal("keysequence",
+ QKeySequence(Qt::ControlModifier + Qt::Key_F1).toString(QKeySequence::NativeText),
+ QString, String);
}
#undef testVal
@@ -3618,16 +3626,13 @@ void tst_QSettings::recursionBug()
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-static DWORD readKeyType(HKEY handle, const QString &rSubKey)
+static DWORD readKeyType(HKEY handle, QStringView rSubKey)
{
DWORD dataType;
DWORD dataSize;
- LONG res = RegQueryValueEx(handle, reinterpret_cast<const wchar_t *>(rSubKey.utf16()), 0, &dataType, 0, &dataSize);
-
- if (res == ERROR_SUCCESS)
- return dataType;
-
- return 0;
+ LONG res = RegQueryValueEx(handle, reinterpret_cast<const wchar_t *>(rSubKey.utf16()),
+ nullptr, &dataType, nullptr, &dataSize);
+ return res == ERROR_SUCCESS ? dataType : 0;
}
// This is a regression test for QTBUG-13249, where QSettings was storing
@@ -3647,29 +3652,12 @@ void tst_QSettings::consistentRegistryStorage()
QCOMPARE(settings1.value("quint64_value").toULongLong(), (quint64)1024);
settings1.sync();
- HKEY handle;
- LONG res;
- QString keyName = "Software\\software.org\\KillerAPP";
- res = RegOpenKeyEx(HKEY_CURRENT_USER, reinterpret_cast<const wchar_t *>(keyName.utf16()), 0, KEY_READ, &handle);
- if (res == ERROR_SUCCESS)
- {
- DWORD dataType;
- dataType = readKeyType(handle, QString("qint32_value"));
- if (dataType != 0) {
- QCOMPARE((int)REG_DWORD, (int)dataType);
- }
- dataType = readKeyType(handle, QString("quint32_value"));
- if (dataType != 0) {
- QCOMPARE((int)REG_DWORD, (int)dataType);
- }
- dataType = readKeyType(handle, QString("qint64_value"));
- if (dataType != 0) {
- QCOMPARE((int)REG_QWORD, (int)dataType);
- }
- dataType = readKeyType(handle, QString("quint64_value"));
- if (dataType != 0) {
- QCOMPARE((int)REG_QWORD, (int)dataType);
- }
+ QWinRegistryKey handle(HKEY_CURRENT_USER, LR"(Software\software.org\KillerAPP)");
+ if (handle.isValid()) {
+ QCOMPARE(readKeyType(handle, L"qint32_value"), DWORD(REG_DWORD));
+ QCOMPARE(readKeyType(handle, L"quint32_value"), DWORD(REG_DWORD));
+ QCOMPARE(readKeyType(handle, L"qint64_value"), DWORD(REG_QWORD));
+ QCOMPARE(readKeyType(handle, L"quint64_value"), DWORD(REG_QWORD));
RegCloseKey(handle);
}
}
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index 40023d7fea..dae4e66106 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -32,8 +32,8 @@
#include <qstandardpaths.h>
#include <qfileinfo.h>
#include <qsysinfo.h>
-#include <qregexp.h>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE)
+#include <qregularexpression.h>
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
# include <qt_windows.h>
#endif
@@ -131,7 +131,7 @@ static const char * const enumNames[MaxStandardLocation + 1 - int(QStandardPaths
void tst_qstandardpaths::initTestCase()
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && !defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
// Disable WOW64 redirection, see testFindExecutable()
if (QSysInfo::buildCpuArchitecture() != QSysInfo::currentCpuArchitecture()) {
void *oldMode;
@@ -140,7 +140,7 @@ void tst_qstandardpaths::initTestCase()
qErrnoWarning("Wow64DisableWow64FsRedirection() failed");
QVERIFY(disabledDisableWow64FsRedirection);
}
-#endif // Q_OS_WIN && !Q_OS_WINRT && !Q_OS_WINCE
+#endif // Q_OS_WIN && !Q_OS_WINRT
QVERIFY2(m_localConfigTempDir.isValid(), qPrintable(m_localConfigTempDir.errorString()));
QVERIFY2(m_globalConfigTempDir.isValid(), qPrintable(m_globalConfigTempDir.errorString()));
QVERIFY2(m_localAppTempDir.isValid(), qPrintable(m_localAppTempDir.errorString()));
@@ -572,7 +572,8 @@ void tst_qstandardpaths::testAllWritableLocations()
void tst_qstandardpaths::testCleanPath()
{
- const QRegExp filter(QStringLiteral("\\\\"));
+#if QT_CONFIG(regularexpression)
+ const QRegularExpression filter(QStringLiteral("\\\\"));
QVERIFY(filter.isValid());
for (int i = 0; i <= QStandardPaths::GenericCacheLocation; ++i) {
const QStringList paths = QStandardPaths::standardLocations(QStandardPaths::StandardLocation(i));
@@ -580,6 +581,9 @@ void tst_qstandardpaths::testCleanPath()
qPrintable(QString::fromLatin1("Backslash found in %1 %2")
.arg(i).arg(paths.join(QLatin1Char(',')))));
}
+#else
+ QSKIP("regularexpression feature disabled");
+#endif
}
void tst_qstandardpaths::testXdgPathCleanup()
diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
index b8f67c7d37..00417fffa0 100644
--- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -215,7 +215,7 @@ void tst_QTemporaryFile::fileTemplate()
if (!fileTemplate.isEmpty())
file.setFileTemplate(fileTemplate);
- QCOMPARE(file.open(), true);
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QString fileName = QFileInfo(file).fileName();
if (prefix.length())
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 9c106c7f58..ef4325d2ea 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -136,8 +136,8 @@ private slots:
void emptyQueryOrFragment();
void hasFragment_data();
void hasFragment();
- void setEncodedFragment_data();
- void setEncodedFragment();
+ void setFragment_data();
+ void setFragment();
void fromEncoded();
void stripTrailingSlash_data();
void stripTrailingSlash();
@@ -350,15 +350,15 @@ void tst_QUrl::comparison()
// 6.2.2.1 Make sure hexdecimal characters in percent encoding are
// treated case-insensitively
QUrl url5;
- url5.setEncodedQuery("a=%2a");
+ url5.setQuery(QLatin1String("a=%2a"));
QUrl url6;
- url6.setEncodedQuery("a=%2A");
+ url6.setQuery(QLatin1String("a=%2A"));
QCOMPARE(url5, url6);
QUrl url7;
- url7.setEncodedQuery("a=C");
+ url7.setQuery(QLatin1String("a=C"));
QUrl url8;
- url8.setEncodedQuery("a=c");
+ url8.setQuery(QLatin1String("a=c"));
QVERIFY(url7 != url8);
QVERIFY(url7 < url8);
@@ -502,7 +502,7 @@ void tst_QUrl::setUrl()
QVERIFY(url.isValid());
QCOMPARE(url.scheme(), QString::fromLatin1("file"));
QCOMPARE(url.path(), QString::fromLatin1("/"));
- QVERIFY(url.encodedQuery().isEmpty());
+ QVERIFY(url.query().isEmpty());
QVERIFY(url.userInfo().isEmpty());
QVERIFY(url.authority().isEmpty());
QVERIFY(url.fragment().isEmpty());
@@ -517,7 +517,7 @@ void tst_QUrl::setUrl()
QVERIFY(url.isValid());
QCOMPARE(url.scheme(), QString::fromLatin1("http"));
QCOMPARE(url.path(), QString());
- QVERIFY(url.encodedQuery().isEmpty());
+ QVERIFY(url.query().isEmpty());
QVERIFY(url.userInfo().isEmpty());
QVERIFY(url.fragment().isEmpty());
QCOMPARE(url.host(), QString::fromLatin1("www.foo.bar"));
@@ -536,7 +536,7 @@ void tst_QUrl::setUrl()
QVERIFY(url.isValid());
QCOMPARE(url.scheme(), QString::fromLatin1("http"));
QCOMPARE(url.path(), QString());
- QVERIFY(url.encodedQuery().isEmpty());
+ QVERIFY(url.query().isEmpty());
QCOMPARE(url.userName(), QString::fromLatin1("user:"));
QCOMPARE(url.password(), QString::fromLatin1("pass@"));
QCOMPARE(url.userInfo(), QString::fromLatin1("user%3A:pass@"));
@@ -781,7 +781,7 @@ void tst_QUrl::setUrl()
QVERIFY(url.isValid());
QCOMPARE(url.scheme(), QString("http"));
QCOMPARE(url.host(), QString("1.2.3.4"));
- QCOMPARE(url.encodedQuery(), QByteArray("foo"));
+ QCOMPARE(url.query(QUrl::FullyEncoded), QLatin1String("foo"));
}
{
QUrl url;
@@ -798,13 +798,13 @@ void tst_QUrl::setUrl()
QCOMPARE(url.scheme(), QString("data"));
QCOMPARE(url.host(), QString());
QCOMPARE(url.path(), QString("text/javascript,d5 = 'five\\u0027s';"));
- QCOMPARE(url.encodedPath().constData(), "text/javascript,d5%20%3D%20'five%5Cu0027s'%3B");
+ QCOMPARE(url.path(QUrl::FullyEncoded), QLatin1String("text/javascript,d5%20%3D%20'five%5Cu0027s'%3B"));
}
{
// invalid port number
QUrl url;
- url.setEncodedUrl("foo://tel:2147483648");
+ url.setUrl(QLatin1String("foo://tel:2147483648"), QUrl::StrictMode);
QVERIFY(!url.isValid());
}
@@ -1144,7 +1144,7 @@ void tst_QUrl::toString_constructed_data()
QTest::addColumn<QString>("host");
QTest::addColumn<int>("port");
QTest::addColumn<QString>("path");
- QTest::addColumn<QByteArray>("query");
+ QTest::addColumn<QString>("query");
QTest::addColumn<QString>("fragment");
QTest::addColumn<QString>("asString");
QTest::addColumn<QByteArray>("asEncoded");
@@ -1153,19 +1153,19 @@ void tst_QUrl::toString_constructed_data()
QString n("");
QTest::newRow("data1") << n << n << n << QString::fromLatin1("qt-project.org") << -1 << QString::fromLatin1("/index.html")
- << QByteArray() << n << QString::fromLatin1("//qt-project.org/index.html")
+ << QString() << n << QString::fromLatin1("//qt-project.org/index.html")
<< QByteArray("//qt-project.org/index.html") << 0u;
- QTest::newRow("data2") << QString::fromLatin1("file") << n << n << n << -1 << QString::fromLatin1("/root") << QByteArray()
+ QTest::newRow("data2") << QString::fromLatin1("file") << n << n << n << -1 << QString::fromLatin1("/root") << QString()
<< n << QString::fromLatin1("file:///root") << QByteArray("file:///root") << 0u;
QTest::newRow("userAndPass") << QString::fromLatin1("http") << QString::fromLatin1("dfaure") << QString::fromLatin1("kde")
- << "kde.org" << 443 << QString::fromLatin1("/") << QByteArray() << n
+ << "kde.org" << 443 << QString::fromLatin1("/") << QString() << n
<< QString::fromLatin1("http://dfaure:kde@kde.org:443/") << QByteArray("http://dfaure:kde@kde.org:443/")
<< 0u;
QTest::newRow("PassWithoutUser") << QString::fromLatin1("http") << n << QString::fromLatin1("kde")
- << "kde.org" << 443 << QString::fromLatin1("/") << QByteArray() << n
+ << "kde.org" << 443 << QString::fromLatin1("/") << QString() << n
<< QString::fromLatin1("http://:kde@kde.org:443/") << QByteArray("http://:kde@kde.org:443/") << 0u;
QTest::newRow("PassWithoutUser-RemovePassword") << QString::fromLatin1("http") << n << QString::fromLatin1("kde")
- << "kde.org" << 443 << QString::fromLatin1("/") << QByteArray() << n
+ << "kde.org" << 443 << QString::fromLatin1("/") << QString() << n
<< QString::fromLatin1("http://kde.org:443/") << QByteArray("http://kde.org:443/")
<< uint(QUrl::RemovePassword);
}
@@ -1178,7 +1178,7 @@ void tst_QUrl::toString_constructed()
QFETCH(QString, host);
QFETCH(int, port);
QFETCH(QString, path);
- QFETCH(QByteArray, query);
+ QFETCH(QString, query);
QFETCH(QString, fragment);
QFETCH(QString, asString);
QFETCH(QByteArray, asEncoded);
@@ -1198,7 +1198,7 @@ void tst_QUrl::toString_constructed()
if (!path.isEmpty())
url.setPath(path);
if (!query.isEmpty())
- url.setEncodedQuery(query);
+ url.setQuery(query, QUrl::StrictMode);
if (!fragment.isEmpty())
url.setFragment(fragment);
@@ -1757,7 +1757,7 @@ void tst_QUrl::symmetry()
QCOMPARE(url.host(QUrl::EncodeUnicode | QUrl::EncodeSpaces), QString::fromUtf8("www.xn--rksmrgs-5wao1o.se"));
QCOMPARE(url.path(), QString::fromLatin1("/pub"));
// this will be encoded ...
- QCOMPARE(url.encodedQuery().constData(), QString::fromLatin1("a=b&a=d%C3%B8&a=f").toLatin1().constData());
+ QCOMPARE(url.query(QUrl::FullyEncoded), QLatin1String("a=b&a=d%C3%B8&a=f"));
QCOMPARE(url.fragment(), QString::fromUtf8("vræl"));
QUrl onlyHost("//qt-project.org");
@@ -2009,7 +2009,7 @@ void tst_QUrl::hasQuery()
QUrl qurl(url);
QCOMPARE(qurl.hasQuery(), trueFalse);
- QCOMPARE(qurl.encodedQuery().isNull(), !trueFalse);
+ QCOMPARE(qurl.query().isNull(), !trueFalse);
}
void tst_QUrl::nameprep()
@@ -2192,10 +2192,12 @@ void tst_QUrl::schemeValidator_data()
QTest::newRow("percent-encoded") << "%68%74%%74%70://example.com" << false << "%68%74%%74%70";
static const char controls[] = "!\"$&'()*,;<=>[\\]^_`{|}~";
- for (size_t i = 0; i < sizeof(controls) - 1; ++i)
- QTest::newRow(("with-" + QByteArray(1, controls[i])).constData())
- << QString("pre%1post://example.com/").arg(QLatin1Char(controls[i]))
- << false << QString("pre%1post").arg(QLatin1Char(controls[i]));
+ for (char control : controls) {
+ const QString scheme = QLatin1String("pre") + QLatin1Char(control) + QLatin1String("post");
+ QTest::newRow((QByteArrayLiteral("with-") + control).constData())
+ << (scheme + QLatin1String("://example.com/"))
+ << false << scheme;
+ }
}
void tst_QUrl::schemeValidator()
@@ -2342,7 +2344,7 @@ void tst_QUrl::tolerantParser()
QVERIFY(url.isValid());
QVERIFY(!url.toString().isEmpty());
QCOMPARE(url.path(), QString("/path with spaces.html"));
- url.setEncodedUrl("http://www.example.com/path%20with spaces.html", QUrl::StrictMode);
+ url.setUrl(QLatin1String("http://www.example.com/path%20with spaces.html"), QUrl::StrictMode);
QVERIFY(!url.isValid());
QVERIFY(url.toString().isEmpty());
}
@@ -2392,36 +2394,36 @@ void tst_QUrl::tolerantParser()
QCOMPARE(url.toEncoded(), QByteArray("%25hello.com/f%25"));
QCOMPARE(url.toString(), QString("%25hello.com/f%25"));
- url.setEncodedUrl("http://www.host.com/foo.php?P0=[2006-3-8]");
+ url.setUrl(QLatin1String("http://www.host.com/foo.php?P0=[2006-3-8]"), QUrl::StrictMode);
QVERIFY(url.isValid());
QVERIFY(!url.toString().isEmpty());
- url.setEncodedUrl("http://foo.bar/[image][1].jpg");
+ url.setUrl(QLatin1String("http://foo.bar/[image][1].jpg"), QUrl::StrictMode);
QVERIFY(url.isValid());
QCOMPARE(url.toString(QUrl::FullyEncoded), QString("http://foo.bar/[image][1].jpg"));
QCOMPARE(url.toEncoded(), QByteArray("http://foo.bar/[image][1].jpg"));
QCOMPARE(url.toString(), QString("http://foo.bar/[image][1].jpg"));
- url.setEncodedUrl("http://foo.bar/%5Bimage%5D%5B1%5D.jpg");
+ url.setUrl(QLatin1String("http://foo.bar/%5Bimage%5D%5B1%5D.jpg"), QUrl::StrictMode);
QVERIFY(url.isValid());
QCOMPARE(url.toString(QUrl::FullyEncoded), QString("http://foo.bar/%5Bimage%5D%5B1%5D.jpg"));
QCOMPARE(url.toEncoded(), QByteArray("http://foo.bar/%5Bimage%5D%5B1%5D.jpg"));
QCOMPARE(url.toString(), QString("http://foo.bar/%5Bimage%5D%5B1%5D.jpg"));
- url.setEncodedUrl("//[::56:56:56:56:56:56:56]");
+ url.setUrl(QLatin1String("//[::56:56:56:56:56:56:56]"), QUrl::StrictMode);
QCOMPARE(url.toString(QUrl::FullyEncoded), QString("//[0:56:56:56:56:56:56:56]"));
QCOMPARE(url.toEncoded(), QByteArray("//[0:56:56:56:56:56:56:56]"));
- url.setEncodedUrl("data:text/css,div%20{%20border-right:%20solid;%20}");
+ url.setUrl(QLatin1String("data:text/css,div%20{%20border-right:%20solid;%20}"), QUrl::TolerantMode);
QCOMPARE(url.toString(QUrl::FullyEncoded), QString("data:text/css,div%20%7B%20border-right:%20solid;%20%7D"));
QCOMPARE(url.toEncoded(), QByteArray("data:text/css,div%20%7B%20border-right:%20solid;%20%7D"));
QCOMPARE(url.toString(), QString("data:text/css,div %7B border-right: solid; %7D"));
}
{
- QByteArray tsdgeos("http://google.com/c?c=Translation+%C2%BB+trunk|");
+ const QString tsdgeos = QLatin1String("http://google.com/c?c=Translation+%C2%BB+trunk|");
QUrl tsdgeosQUrl;
- tsdgeosQUrl.setEncodedUrl(tsdgeos, QUrl::TolerantMode);
+ tsdgeosQUrl.setUrl(tsdgeos, QUrl::TolerantMode);
QVERIFY(tsdgeosQUrl.isValid()); // failed in Qt-4.4, works in Qt-4.5
QByteArray tsdgeosExpected("http://google.com/c?c=Translation+%C2%BB+trunk%7C");
QCOMPARE(QString(tsdgeosQUrl.toEncoded()), QString(tsdgeosExpected));
@@ -2626,31 +2628,31 @@ void tst_QUrl::emptyQueryOrFragment()
// start with an empty one
QUrl url("http://www.foo.bar/baz");
QVERIFY(!url.hasQuery());
- QVERIFY(url.encodedQuery().isNull());
+ QVERIFY(url.query().isNull());
// add encodedQuery
url.setQuery("abc=def");
QVERIFY(url.hasQuery());
QCOMPARE(url.query(), QString(QLatin1String("abc=def")));
QCOMPARE(url.toString(), QString(QLatin1String("http://www.foo.bar/baz?abc=def")));
- url.setEncodedQuery("abc=def");
+ url.setQuery(QLatin1String("abc=def"));
QCOMPARE(url.toString(), QString(QLatin1String("http://www.foo.bar/baz?abc=def")));
// remove encodedQuery
url.setQuery(QString());
QVERIFY(!url.hasQuery());
- QVERIFY(url.encodedQuery().isNull());
+ QVERIFY(url.query().isNull());
QCOMPARE(url.toString(), QString(QLatin1String("http://www.foo.bar/baz")));
- url.setEncodedQuery(QByteArray());
+ url.setQuery(QString());
QCOMPARE(url.toString(), QString(QLatin1String("http://www.foo.bar/baz")));
// add empty encodedQuery
url.setQuery("");
QVERIFY(url.hasQuery());
- QVERIFY(url.encodedQuery().isEmpty());
- QVERIFY(!url.encodedQuery().isNull());
+ QVERIFY(url.query().isEmpty());
+ QVERIFY(!url.query().isNull());
QCOMPARE(url.toString(), QString(QLatin1String("http://www.foo.bar/baz?")));
- url.setEncodedQuery("");
+ url.setQuery(QLatin1String(""));
QCOMPARE(url.toString(), QString(QLatin1String("http://www.foo.bar/baz?")));
}
}
@@ -2682,35 +2684,33 @@ void tst_QUrl::hasFragment()
QCOMPARE(qurl.fragment().isNull(), !trueFalse);
}
-void tst_QUrl::setEncodedFragment_data()
+void tst_QUrl::setFragment_data()
{
- QTest::addColumn<QByteArray>("base");
- QTest::addColumn<QByteArray>("fragment");
- QTest::addColumn<QByteArray>("expected");
+ QTest::addColumn<QString>("base");
+ QTest::addColumn<QString>("fragment");
+ QTest::addColumn<QString>("expected");
- typedef QByteArray BA;
- QTest::newRow("null") << BA("http://www.kde.org") << BA() << BA("http://www.kde.org");
- QTest::newRow("empty") << BA("http://www.kde.org") << BA("") << BA("http://www.kde.org#");
- QTest::newRow("basic test") << BA("http://www.kde.org") << BA("abc") << BA("http://www.kde.org#abc");
- QTest::newRow("initial url has fragment") << BA("http://www.kde.org#old") << BA("new") << BA("http://www.kde.org#new");
- QTest::newRow("encoded fragment") << BA("http://www.kde.org") << BA("a%20c") << BA("http://www.kde.org#a%20c");
- QTest::newRow("with #") << BA("http://www.kde.org") << BA("a#b") << BA("http://www.kde.org#a%23b"); // toString uses "a#b"
- QTest::newRow("unicode") << BA("http://www.kde.org") << BA("\xc3\xa9") << BA("http://www.kde.org#%C3%A9");
- QTest::newRow("binary") << BA("http://www.kde.org") << BA("\x00\xc0\x80", 3) << BA("http://www.kde.org#%00%C0%80");
+ QTest::newRow("null") << QString::fromLatin1("http://www.kde.org") << QString() << QString::fromLatin1("http://www.kde.org");
+ QTest::newRow("empty") << QString::fromLatin1("http://www.kde.org") << QString::fromLatin1("") << QString::fromLatin1("http://www.kde.org#");
+ QTest::newRow("basic test") << QString::fromLatin1("http://www.kde.org") << QString::fromLatin1("abc") << QString::fromLatin1("http://www.kde.org#abc");
+ QTest::newRow("initial url has fragment") << QString::fromLatin1("http://www.kde.org#old") << QString::fromLatin1("new") << QString::fromLatin1("http://www.kde.org#new");
+ QTest::newRow("encoded fragment") << QString::fromLatin1("http://www.kde.org") << QString::fromLatin1("a%20c") << QString::fromLatin1("http://www.kde.org#a%20c");
+ QTest::newRow("with #") << QString::fromLatin1("http://www.kde.org") << QString::fromLatin1("a#b") << QString::fromLatin1("http://www.kde.org#a%23b"); // toString uses "a#b"
+ QTest::newRow("unicode") << QString::fromLatin1("http://www.kde.org") << QString::fromUtf8("\xc3\xa9") << QString::fromLatin1("http://www.kde.org#%C3%A9");
}
-void tst_QUrl::setEncodedFragment()
+void tst_QUrl::setFragment()
{
- QFETCH(QByteArray, base);
- QFETCH(QByteArray, fragment);
- QFETCH(QByteArray, expected);
+ QFETCH(QString, base);
+ QFETCH(QString, fragment);
+ QFETCH(QString, expected);
QUrl u;
- u.setEncodedUrl(base, QUrl::TolerantMode);
+ u.setUrl(base, QUrl::TolerantMode);
QVERIFY(u.isValid());
- u.setEncodedFragment(fragment);
+ u.setFragment(fragment);
QVERIFY(u.isValid());
QCOMPARE(!fragment.isNull(), u.hasFragment());
- QCOMPARE(QString::fromLatin1(u.toEncoded()), QString::fromLatin1(expected));
+ QCOMPARE(QString::fromUtf8(u.toEncoded()), expected);
}
void tst_QUrl::fromEncoded()
@@ -3258,14 +3258,14 @@ void tst_QUrl::isEmptyForEncodedUrl()
{
{
QUrl url;
- url.setEncodedUrl("LABEL=USB_STICK", QUrl::TolerantMode);
+ url.setUrl(QLatin1String("LABEL=USB_STICK"), QUrl::TolerantMode);
QVERIFY( url.isValid() );
QCOMPARE( url.path(), QString("LABEL=USB_STICK") );
QVERIFY( !url.isEmpty() );
}
{
QUrl url;
- url.setEncodedUrl("LABEL=USB_STICK", QUrl::TolerantMode);
+ url.setUrl(QLatin1String("LABEL=USB_STICK"), QUrl::TolerantMode);
QVERIFY( url.isValid() );
QVERIFY( !url.isEmpty() );
QCOMPARE( url.path(), QString("LABEL=USB_STICK") );
@@ -3277,7 +3277,7 @@ void tst_QUrl::isEmptyForEncodedUrl()
void tst_QUrl::toEncodedNotUsingUninitializedPath()
{
QUrl url;
- url.setEncodedPath("/test.txt");
+ url.setPath(QLatin1String("/test.txt"));
url.setHost("example.com");
QCOMPARE(url.toEncoded().constData(), "//example.com/test.txt");
@@ -3389,8 +3389,15 @@ void tst_QUrl::acceptEmptyAuthoritySegments()
void tst_QUrl::effectiveTLDs_data()
{
+ // See also: tst_QNetworkCookieJar::setCookiesFromUrl().
+ // in tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
QTest::addColumn<QUrl>("domain");
QTest::addColumn<QString>("TLD");
+ // TODO: autogenerate test-cases from:
+ // https://raw.githubusercontent.com/publicsuffix/list/master/tests/test_psl.txt
+ // checkPublicSuffix(domain, tail) appears in the list if
+ // either tail is null and domain is public or
+ // tail is the "registrable" part of domain; i.e. its minimal non-public tail.
QTest::newRow("yes0") << QUrl::fromEncoded("http://test.co.uk") << ".co.uk";
QTest::newRow("yes1") << QUrl::fromEncoded("http://test.com") << ".com";
@@ -3657,17 +3664,6 @@ void tst_QUrl::componentEncodings()
QCOMPARE(url.toString(formatting),
(((QString(toString ))))); // the weird () and space is to align the output
- if (formatting == QUrl::FullyEncoded) {
- QCOMPARE(url.encodedUserName(), userName.toUtf8());
- QCOMPARE(url.encodedPassword(), password.toUtf8());
- // no encodedUserInfo
- QCOMPARE(url.encodedHost(), host.toUtf8());
- // no encodedAuthority
- QCOMPARE(url.encodedPath(), path.toUtf8());
- QCOMPARE(url.encodedQuery(), query.toUtf8());
- QCOMPARE(url.encodedFragment(), fragment.toUtf8());
- }
-
// repeat with the URL we got from toString
QUrl url2(toString);
QCOMPARE(url2.userName(formatting), userName);
@@ -4087,13 +4083,12 @@ public:
QVector<QUrl> m_urls;
};
-static const UrlStorage * s_urlStorage = 0;
+static const UrlStorage * s_urlStorage = nullptr;
void tst_QUrl::testThreadingHelper()
{
const UrlStorage* storage = s_urlStorage;
- for (int i = 0 ; i < storage->m_urls.size(); ++i ) {
- const QUrl& u = storage->m_urls.at(i);
+ for (const auto &u : storage->m_urls) {
// QVERIFY/QCOMPARE trigger race conditions in helgrind
if (!u.isValid())
qFatal("invalid url");
diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index b960ca9220..f305edb2c5 100644
--- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -309,7 +309,8 @@ bool QtTestModel::moveColumns(const QModelIndex &sourceParent, int src, int cnt,
void QtTestModel::reset()
{
- QAbstractItemModel::reset();
+ QAbstractItemModel::beginResetModel();
+ QAbstractItemModel::endResetModel();
}
bool QtTestModel::canDropMimeData(const QMimeData *data, Qt::DropAction action,
@@ -1785,13 +1786,12 @@ class ModelWithCustomRole : public QStringListModel
{
Q_OBJECT
public:
- ModelWithCustomRole(QObject *parent = 0)
- : QStringListModel(parent)
- {
- QHash<int, QByteArray> roleNames_ = roleNames();
- roleNames_.insert(Qt::UserRole + 1, "custom");
- setRoleNames(roleNames_);
- }
+ using QStringListModel::QStringListModel;
+
+ QHash<int, QByteArray> roleNames() const override
+ {
+ return {{Qt::UserRole + 1, QByteArrayLiteral("custom")}};
+ }
};
ListenerObject::ListenerObject(QAbstractProxyModel *parent)
@@ -1830,7 +1830,7 @@ void ListenerObject::slotAboutToBeReset()
void ListenerObject::slotReset()
{
- foreach (const QModelIndex &idx, m_persistentIndexes) {
+ for (const auto &idx : qAsConst(m_persistentIndexes)) {
QVERIFY(!idx.isValid());
}
}
diff --git a/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp b/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp
index 886941bff6..adb93b7a75 100644
--- a/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp
@@ -313,11 +313,12 @@ public:
CustomRole2
};
- StandardItemModelWithCustomRoleNames() {
- QHash<int, QByteArray> _roleNames = roleNames();
- _roleNames.insert(CustomRole1, "custom1");
- _roleNames.insert(CustomRole2, "custom2");
- setRoleNames(_roleNames);
+ QHash<int, QByteArray> roleNames() const override
+ {
+ auto result = QStandardItemModel::roleNames();
+ result.insert(CustomRole1, QByteArrayLiteral("custom1"));
+ result.insert(CustomRole2, QByteArrayLiteral("custom2"));
+ return result;
}
};
@@ -329,11 +330,10 @@ public:
AnotherCustomRole2
};
- AnotherStandardItemModelWithCustomRoleNames() {
- QHash<int, QByteArray> _roleNames = roleNames();
- _roleNames.insert(AnotherCustomRole1, "another_custom1");
- _roleNames.insert(AnotherCustomRole2, "another_custom2");
- setRoleNames(_roleNames);
+ QHash<int, QByteArray> roleNames() const override
+ {
+ return {{AnotherCustomRole1, QByteArrayLiteral("another_custom1")},
+ {AnotherCustomRole2, QByteArrayLiteral("another_custom2")}};
}
};
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
index dbc7173028..354190e754 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
@@ -153,7 +153,7 @@ QAbstractItemModel *ModelsToTest::createModel(const QString &modelType)
QStandardItemModel *standardItemModel = new QStandardItemModel;
model->setSourceModel(standardItemModel);
populateTestArea(model);
- model->setFilterRegExp(QRegExp("(^$|I.*)"));
+ model->setFilterRegularExpression(QRegularExpression("(^$|I.*)"));
return model;
}
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 6fbaa28d69..c74101928a 100644
--- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -32,6 +32,9 @@
#include <algorithm>
+Q_DECLARE_METATYPE(QItemSelectionModel::SelectionFlag)
+Q_DECLARE_METATYPE(Qt::SortOrder)
+
class tst_QItemSelectionModel : public QObject
{
Q_OBJECT
@@ -1463,7 +1466,7 @@ void tst_QItemSelectionModel::persistentselections()
QFETCH(IntList, insertColumns);
QFETCH(IntList, deleteRows);
QFETCH(IntList, deleteColumns);
- QFETCH(PairList, expectedList);
+ QFETCH(const PairList, expectedList);
// make sure the model is sane (5x5)
QCOMPARE(model->rowCount(QModelIndex()), 5);
@@ -1504,7 +1507,7 @@ void tst_QItemSelectionModel::persistentselections()
// check that the selected items are the correct number and indexes
QModelIndexList selectedList = selection->selectedIndexes();
QCOMPARE(selectedList.count(), expectedList.count());
- foreach(IntPair pair, expectedList) {
+ for (const auto &pair : expectedList) {
QModelIndex index = model->index(pair.first, pair.second, QModelIndex());
QVERIFY(selectedList.contains(index));
}
@@ -1679,7 +1682,7 @@ void tst_QItemSelectionModel::modelLayoutChanged_data()
{
QTest::addColumn<IntListList>("items");
QTest::addColumn<IntPairPairList>("initialSelectedRanges");
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<int>("sortColumn");
QTest::addColumn<IntPairPairList>("expectedSelectedRanges");
@@ -1689,7 +1692,7 @@ void tst_QItemSelectionModel::modelLayoutChanged_data()
<< (IntList() << 3 << 2 << 1 << 0))
<< (IntPairPairList()
<< IntPairPair(IntPair(0, 0), IntPair(3, 1)))
- << int(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< 0
<< (IntPairPairList()
<< IntPairPair(IntPair(0, 0), IntPair(3, 1)));
@@ -1699,7 +1702,7 @@ void tst_QItemSelectionModel::modelLayoutChanged_data()
<< (IntList() << 3 << 2 << 1 << 0))
<< (IntPairPairList()
<< IntPairPair(IntPair(0, 0), IntPair(1, 1)))
- << int(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< 0
<< (IntPairPairList()
<< IntPairPair(IntPair(2, 0), IntPair(3, 1)));
@@ -1709,7 +1712,7 @@ void tst_QItemSelectionModel::modelLayoutChanged_data()
<< (IntList() << 3 << 2 << 1 << 0))
<< (IntPairPairList()
<< IntPairPair(IntPair(1, 0), IntPair(2, 1)))
- << int(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< 0
<< (IntPairPairList()
<< IntPairPair(IntPair(1, 0), IntPair(2, 1)));
@@ -1720,7 +1723,7 @@ void tst_QItemSelectionModel::modelLayoutChanged_data()
<< (IntPairPairList()
<< IntPairPair(IntPair(1, 0), IntPair(1, 1))
<< IntPairPair(IntPair(3, 0), IntPair(3, 1)))
- << int(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (IntPairPairList()
<< IntPairPair(IntPair(0, 0), IntPair(0, 1))
@@ -1730,8 +1733,8 @@ void tst_QItemSelectionModel::modelLayoutChanged_data()
void tst_QItemSelectionModel::modelLayoutChanged()
{
QFETCH(IntListList, items);
- QFETCH(IntPairPairList, initialSelectedRanges);
- QFETCH(int, sortOrder);
+ QFETCH(const IntPairPairList, initialSelectedRanges);
+ QFETCH(Qt::SortOrder, sortOrder);
QFETCH(int, sortColumn);
QFETCH(IntPairPairList, expectedSelectedRanges);
@@ -1746,9 +1749,9 @@ void tst_QItemSelectionModel::modelLayoutChanged()
// select initial ranges
QItemSelectionModel selectionModel(&model);
- foreach (IntPairPair range, initialSelectedRanges) {
- IntPair tl = range.first;
- IntPair br = range.second;
+ for (const auto &range : initialSelectedRanges) {
+ const auto &tl = range.first;
+ const auto &br = range.second;
QItemSelection selection(
model.index(tl.first, tl.second),
model.index(br.first, br.second));
@@ -1756,7 +1759,7 @@ void tst_QItemSelectionModel::modelLayoutChanged()
}
// sort the model
- model.sort(sortColumn, Qt::SortOrder(sortOrder));
+ model.sort(sortColumn, sortOrder);
// verify that selection is as expected
QItemSelection selection = selectionModel.selection();
@@ -2126,43 +2129,43 @@ void tst_QItemSelectionModel::merge_data()
{
QTest::addColumn<QItemSelection>("init");
QTest::addColumn<QItemSelection>("other");
- QTest::addColumn<int>("command");
+ QTest::addColumn<QItemSelectionModel::SelectionFlag>("command");
QTest::addColumn<QItemSelection>("result");
QTest::newRow("Simple select")
<< QItemSelection()
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
- << int(QItemSelectionModel::Select)
+ << QItemSelectionModel::Select
<< QItemSelection(model->index(2, 1) , model->index(3, 4));
QTest::newRow("Simple deselect")
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
- << int(QItemSelectionModel::Deselect)
+ << QItemSelectionModel::Deselect
<< QItemSelection();
QTest::newRow("Simple Toggle deselect")
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
- << int(QItemSelectionModel::Toggle)
+ << QItemSelectionModel::Toggle
<< QItemSelection();
QTest::newRow("Simple Toggle select")
<< QItemSelection()
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
- << int(QItemSelectionModel::Toggle)
+ << QItemSelectionModel::Toggle
<< QItemSelection(model->index(2, 1) , model->index(3, 4));
QTest::newRow("Add select")
<< QItemSelection(model->index(2, 1) , model->index(3, 3))
<< QItemSelection(model->index(2, 2) , model->index(3, 4))
- << int(QItemSelectionModel::Select)
+ << QItemSelectionModel::Select
<< QItemSelection(model->index(2, 1) , model->index(3, 4));
QTest::newRow("Deselect")
<< QItemSelection(model->index(2, 1) , model->index(3, 4))
<< QItemSelection(model->index(2, 2) , model->index(3, 4))
- << int(QItemSelectionModel::Deselect)
+ << QItemSelectionModel::Deselect
<< QItemSelection(model->index(2, 1) , model->index(3, 1));
QItemSelection r1(model->index(2, 1) , model->index(3, 1));
@@ -2170,7 +2173,7 @@ void tst_QItemSelectionModel::merge_data()
QTest::newRow("Toggle")
<< QItemSelection(model->index(2, 1) , model->index(3, 3))
<< QItemSelection(model->index(2, 2) , model->index(3, 4))
- << int(QItemSelectionModel::Toggle)
+ << QItemSelectionModel::Toggle
<< r1;
}
@@ -2178,15 +2181,18 @@ void tst_QItemSelectionModel::merge()
{
QFETCH(QItemSelection, init);
QFETCH(QItemSelection, other);
- QFETCH(int, command);
+ QFETCH(QItemSelectionModel::SelectionFlag, command);
QFETCH(QItemSelection, result);
- init.merge(other, QItemSelectionModel::SelectionFlags(command));
+ init.merge(other, command);
- foreach(const QModelIndex &idx, init.indexes())
- QVERIFY(result.contains(idx));
- foreach(const QModelIndex &idx, result.indexes())
- QVERIFY(init.contains(idx));
+ auto verify = [](const QModelIndexList &a, const QItemSelection &b)
+ {
+ for (const QModelIndex &idx : a)
+ QVERIFY(b.contains(idx));
+ };
+ verify(init.indexes(), result);
+ verify(result.indexes(), init);
}
void tst_QItemSelectionModel::isRowSelected()
@@ -2211,8 +2217,8 @@ void tst_QItemSelectionModel::childrenDeselectionSignal()
}
QModelIndex root = model.index(0,0);
- QModelIndex par = root.child(0,0);
- QModelIndex sel = par.child(0,0);
+ QModelIndex par = model.index(0, 0, root);
+ QModelIndex sel = model.index(0, 0, par);
QItemSelectionModel selectionModel(&model);
selectionModel.select(sel, QItemSelectionModel::SelectCurrent);
@@ -2240,9 +2246,9 @@ void tst_QItemSelectionModel::childrenDeselectionSignal()
}
}
- sel = model.index(0, 0).child(0, 0);
+ sel = model.index(0, 0, model.index(0, 0));
selectionModel.select(sel, QItemSelectionModel::Select);
- QModelIndex sel2 = model.index(1, 0).child(0, 0);
+ QModelIndex sel2 = model.index(0, 0, model.index(1, 0));
selectionModel.select(sel2, QItemSelectionModel::Select);
QVERIFY(selectionModel.selection().contains(sel));
@@ -2264,24 +2270,23 @@ void tst_QItemSelectionModel::layoutChangedWithAllSelected1()
QCOMPARE(model.rowCount(), 3);
QCOMPARE(proxy.rowCount(), 3);
- proxy.setFilterRegExp( QRegExp("f"));
+ proxy.setFilterRegularExpression(QRegularExpression("f"));
QCOMPARE(proxy.rowCount(), 2);
- QList<QPersistentModelIndex> indexList;
- indexList << proxy.index(0,0) << proxy.index(1,0);
- selection.select( QItemSelection(indexList.first(), indexList.last()), QItemSelectionModel::Select);
+ const QList<QPersistentModelIndex> indexList({proxy.index(0,0), proxy.index(1,0)});
+ selection.select(QItemSelection(indexList.first(), indexList.last()), QItemSelectionModel::Select);
//let's check the selection hasn't changed
QCOMPARE(selection.selectedIndexes().count(), indexList.count());
- foreach(QPersistentModelIndex index, indexList)
+ for (const auto &index : indexList)
QVERIFY(selection.isSelected(index));
- proxy.setFilterRegExp(QRegExp());
+ proxy.setFilterRegularExpression(QRegularExpression());
QCOMPARE(proxy.rowCount(), 3);
//let's check the selection hasn't changed
QCOMPARE(selection.selectedIndexes().count(), indexList.count());
- foreach(QPersistentModelIndex index, indexList)
+ for (const auto &index : indexList)
QVERIFY(selection.isSelected(index));
}
@@ -2321,9 +2326,8 @@ void tst_QItemSelectionModel::layoutChangedWithAllSelected2()
selection.select( QItemSelection(proxy.index(0,0), proxy.index(proxy.rowCount() - 1, proxy.columnCount() - 1)), QItemSelectionModel::Select);
- QList<QPersistentModelIndex> indexList;
- foreach(const QModelIndex &id, selection.selectedIndexes())
- indexList << id;
+ const auto selIndexes = selection.selectedIndexes();
+ const QList<QPersistentModelIndex> indexList(selIndexes.begin(), selIndexes.end());
proxy.filtering = false;
proxy.invalidate();
@@ -2331,7 +2335,7 @@ void tst_QItemSelectionModel::layoutChangedWithAllSelected2()
//let's check the selection hasn't changed
QCOMPARE(selection.selectedIndexes().count(), indexList.count());
- foreach(QPersistentModelIndex index, indexList)
+ for (const auto &index : indexList)
QVERIFY(selection.isSelected(index));
}
@@ -2375,7 +2379,8 @@ public:
public slots:
void selectionChanged(const QItemSelection & /* selected */, const QItemSelection &deselected)
{
- foreach(const QModelIndex &index, deselected.indexes()) {
+ const auto deselIndexes = deselected.indexes();
+ for (const auto &index : deselIndexes) {
QVERIFY(!m_itemSelectionModel->selection().contains(index));
}
QCOMPARE(m_itemSelectionModel->selection().size(), 2);
@@ -2633,9 +2638,9 @@ private slots:
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
{
- foreach(const QItemSelectionRange &range, selected)
+ for (const auto &range : selected)
QVERIFY(range.isValid());
- foreach(const QItemSelectionRange &range, deselected)
+ for (const auto &range : deselected)
QVERIFY(range.isValid());
}
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
index ccce5a44e5..624187349b 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
@@ -829,7 +829,7 @@ void tst_QSortFilterProxyModel::removeRows_data()
void tst_QSortFilterProxyModel::removeRows()
{
- QFETCH(QStringList, initial);
+ QFETCH(const QStringList, initial);
QFETCH(int, sortOrder);
QFETCH(QString, filter);
QFETCH(int, position);
@@ -843,7 +843,7 @@ void tst_QSortFilterProxyModel::removeRows()
proxy.setSourceModel(&model);
// prepare model
- foreach (QString s, initial)
+ for (const auto &s : initial)
model.appendRow(new QStandardItem(s));
if (sortOrder != -1)
@@ -3035,15 +3035,15 @@ void tst_QSortFilterProxyModel::removeRowsRecursive()
QList<QPersistentModelIndex> sourceIndexes;
QList<QPersistentModelIndex> proxyIndexes;
- foreach (QStandardItem *item, items) {
+ for (const auto item : qAsConst(items)) {
QModelIndex idx = item->index();
sourceIndexes << idx;
proxyIndexes << proxy.mapFromSource(idx);
}
- foreach (const QPersistentModelIndex &pidx, sourceIndexes)
+ for (const auto &pidx : qAsConst(sourceIndexes))
QVERIFY(pidx.isValid());
- foreach (const QPersistentModelIndex &pidx, proxyIndexes)
+ for (const auto &pidx : qAsConst(proxyIndexes))
QVERIFY(pidx.isValid());
QList<QStandardItem*> itemRow = pItem1->takeRow(0);
@@ -3051,9 +3051,9 @@ void tst_QSortFilterProxyModel::removeRowsRecursive()
QCOMPARE(itemRow.count(), 1);
QCOMPARE(itemRow.first(), pItem11);
- foreach (const QPersistentModelIndex &pidx, sourceIndexes)
+ for (const auto &pidx : qAsConst(sourceIndexes))
QVERIFY(!pidx.isValid());
- foreach (const QPersistentModelIndex &pidx, proxyIndexes)
+ for (const auto &pidx : qAsConst(proxyIndexes))
QVERIFY(!pidx.isValid());
delete pItem11;
@@ -3280,10 +3280,8 @@ void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection()
static bool isValid(const QItemSelection &selection)
{
- foreach (const QItemSelectionRange &range, selection)
- if (!range.isValid())
- return false;
- return true;
+ return std::all_of(selection.begin(), selection.end(),
+ [](const QItemSelectionRange &range) { return range.isValid(); });
}
void tst_QSortFilterProxyModel::mapSelectionFromSource()
@@ -3737,14 +3735,16 @@ void tst_QSortFilterProxyModel::testParentLayoutChanged()
QVERIFY(beforeParents.first() == proxy.mapFromSource(model.indexFromItem(model.invisibleRootItem()->child(1))));
- QList<QPersistentModelIndex> proxy2BeforeList = proxy2ParentsAboutToBeChangedSpy.first().first().value<QList<QPersistentModelIndex> >();
- QList<QPersistentModelIndex> proxy2AfterList = proxy2ParentsChangedSpy.first().first().value<QList<QPersistentModelIndex> >();
+ const QList<QPersistentModelIndex> proxy2BeforeList =
+ proxy2ParentsAboutToBeChangedSpy.first().first().value<QList<QPersistentModelIndex> >();
+ const QList<QPersistentModelIndex> proxy2AfterList =
+ proxy2ParentsChangedSpy.first().first().value<QList<QPersistentModelIndex> >();
QCOMPARE(proxy2BeforeList.size(), beforeParents.size());
QCOMPARE(proxy2AfterList.size(), afterParents.size());
- foreach (const QPersistentModelIndex &idx, proxy2BeforeList)
+ for (const QPersistentModelIndex &idx : proxy2BeforeList)
QVERIFY(beforeParents.contains(proxy2.mapToSource(idx)));
- foreach (const QPersistentModelIndex &idx, proxy2AfterList)
+ for (const QPersistentModelIndex &idx : proxy2AfterList)
QVERIFY(afterParents.contains(proxy2.mapToSource(idx)));
}
@@ -3977,7 +3977,7 @@ void tst_QSortFilterProxyModel::hierarchyFilterInvalidation()
QTreeView view;
view.setModel(&proxy);
- view.setCurrentIndex(proxy.index(2, 0).child(0, 0));
+ view.setCurrentIndex(proxy.index(0, 0, proxy.index(2, 0)));
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index 0b8686560c..3919472b96 100644
--- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -333,7 +333,7 @@ template <class C>
C sorted(C c)
{
std::sort(c.begin(), c.end());
- return qMove(c);
+ return std::move(c);
}
void tst_QStringListModel::setData_emits_both_roles()
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 6adb393ddd..39c90f69b4 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -611,7 +611,7 @@ void tst_QCoreApplication::processEventsAlwaysSendsPostedEvents()
TestApplication app(argc, argv);
ProcessEventsAlwaysSendsPostedEventsObject object;
- QTime t;
+ QElapsedTimer t;
t.start();
int i = 1;
do {
@@ -775,49 +775,49 @@ private slots:
QCoreApplicationPrivate *privateClass = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(qApp));
{
- QCOMPARE(privateClass->quitLockRef.load(), 0);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 0);
// Test with a lock active so that the refcount doesn't drop to zero during these tests, causing a quit.
// (until we exit the scope)
QEventLoopLocker locker;
- QCOMPARE(privateClass->quitLockRef.load(), 1);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 1);
JobObject *job1 = new JobObject(this);
- QCOMPARE(privateClass->quitLockRef.load(), 2);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 2);
delete job1;
- QCOMPARE(privateClass->quitLockRef.load(), 1);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 1);
job1 = new JobObject(this);
- QCOMPARE(privateClass->quitLockRef.load(), 2);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 2);
JobObject *job2 = new JobObject(this);
- QCOMPARE(privateClass->quitLockRef.load(), 3);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 3);
delete job1;
- QCOMPARE(privateClass->quitLockRef.load(), 2);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 2);
JobObject *job3 = new JobObject(job2);
Q_UNUSED(job3);
- QCOMPARE(privateClass->quitLockRef.load(), 3);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 3);
JobObject *job4 = new JobObject(job2);
Q_UNUSED(job4);
- QCOMPARE(privateClass->quitLockRef.load(), 4);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 4);
delete job2;
- QCOMPARE(privateClass->quitLockRef.load(), 1);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 1);
}
- QCOMPARE(privateClass->quitLockRef.load(), 0);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 0);
}
};
diff --git a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST
index 4dd71ca9f4..569880e1db 100644
--- a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST
+++ b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST
@@ -1,4 +1,3 @@
[elapsed]
-windows
-osx-10.12
osx-10.13
+windows-10
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
deleted file mode 100644
index 06588188d4..0000000000
--- a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-[sendPostedEvents]
-windows
-[registerTimer]
-windows
-winrt
-osx
diff --git a/tests/auto/corelib/kernel/qeventloop/BLACKLIST b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
deleted file mode 100644
index 6ea6314b0a..0000000000
--- a/tests/auto/corelib/kernel/qeventloop/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[testQuitLock]
-windows
diff --git a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
index 295a42aa9c..159761c0c6 100644
--- a/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
+++ b/tests/auto/corelib/kernel/qeventloop/qeventloop.pro
@@ -3,6 +3,6 @@ TARGET = tst_qeventloop
QT = core network testlib core-private
SOURCES = $$PWD/tst_qeventloop.cpp
-win32:!winrt: LIBS += -luser32
+win32:!winrt: QMAKE_USE += user32
qtConfig(glib): DEFINES += HAVE_GLIB
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
index 482ed8d130..1f0b8d4b4e 100644
--- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
@@ -638,16 +638,16 @@ void tst_QEventLoop::testQuitLock()
QEventLoopPrivate* privateClass = static_cast<QEventLoopPrivate*>(QObjectPrivate::get(&eventLoop));
- QCOMPARE(privateClass->quitLockRef.load(), 0);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 0);
JobObject *job1 = new JobObject(&eventLoop, this);
job1->start(500);
- QCOMPARE(privateClass->quitLockRef.load(), 1);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 1);
eventLoop.exec();
- QCOMPARE(privateClass->quitLockRef.load(), 0);
+ QCOMPARE(privateClass->quitLockRef.loadRelaxed(), 0);
job1 = new JobObject(&eventLoop, this);
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
index 89a06b358e..60000316cc 100644
--- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
@@ -507,6 +507,7 @@ public slots:
{ QObject::moveToThread(t); }
void slotWithUnregisteredParameterType(MyUnregisteredType);
+ void slotWithOneUnregisteredParameterType(QString a1, MyUnregisteredType a2);
CountedStruct throwingSlot(const CountedStruct &, CountedStruct s2) {
#ifndef QT_NO_EXCEPTIONS
@@ -520,7 +521,7 @@ public slots:
QVector<QtTestObject *> o5, QList<QtTestObject *> o6)
{
slotResult = QLatin1String("slotWithRegistrableArgument:") + o1->slotResult + o2->slotResult
- + o3->slotResult + o4.data()->slotResult + QString::number(o5.size())
+ + o3->slotResult + o4.toStrongRef()->slotResult + QString::number(o5.size())
+ QString::number(o6.size());
}
@@ -604,6 +605,9 @@ void QtTestObject::testSender()
void QtTestObject::slotWithUnregisteredParameterType(MyUnregisteredType)
{ slotResult = "slotWithUnregisteredReturnType"; }
+void QtTestObject::slotWithOneUnregisteredParameterType(QString a1, MyUnregisteredType)
+{ slotResult = "slotWithUnregisteredReturnType-" + a1; }
+
void QtTestObject::staticFunction0()
{
staticResult = "staticFunction0";
@@ -885,6 +889,16 @@ void tst_QMetaObject::invokeQueuedMetaMember()
QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithUnregisteredParameterType", Qt::QueuedConnection, Q_ARG(MyUnregisteredType, t)));
QVERIFY(obj.slotResult.isEmpty());
}
+
+ obj.slotResult.clear();
+ {
+ QString a1("Cannot happen");
+ MyUnregisteredType t;
+ QTest::ignoreMessage(QtWarningMsg, "QMetaMethod::invoke: Unable to handle unregistered datatype 'MyUnregisteredType'");
+ QVERIFY(!QMetaObject::invokeMethod(&obj, "slotWithOneUnregisteredParameterType", Qt::QueuedConnection,
+ Q_ARG(QString, a1), Q_ARG(MyUnregisteredType, t)));
+ QVERIFY(obj.slotResult.isEmpty());
+ }
}
void tst_QMetaObject::invokeQueuedPointer()
diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 56623773a2..9fe7d63727 100644
--- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -1322,8 +1322,8 @@ bool tst_QMetaObjectBuilder::sameMetaObject
return false;
}
- const QMetaObject * const *objects1 = meta1->d.relatedMetaObjects;
- const QMetaObject * const *objects2 = meta2->d.relatedMetaObjects;
+ const auto *objects1 = meta1->d.relatedMetaObjects;
+ const auto *objects2 = meta2->d.relatedMetaObjects;
if (objects1 && !objects2)
return false;
if (objects2 && !objects1)
@@ -1391,7 +1391,7 @@ private:
};
QMetaObject TestObject::staticMetaObject = {
- { 0, 0, 0, 0, 0, 0 }
+ { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
};
TestObject::TestObject(QObject *parent)
diff --git a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
index 681a5d0146..cc67fc7884 100644
--- a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
+++ b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
@@ -130,7 +130,7 @@ public:
QString m_value;
void setValue(const QString &value) { m_value = value; }
QString getValue() { return m_value; }
- void resetValue() { m_value = QLatin1Literal("reset"); }
+ void resetValue() { m_value = QLatin1String("reset"); }
};
void tst_QMetaProperty::gadget()
@@ -140,7 +140,7 @@ void tst_QMetaProperty::gadget()
QVERIFY(valueProp.isValid());
{
MyGadget g;
- QString hello = QLatin1Literal("hello");
+ QString hello = QLatin1String("hello");
QVERIFY(valueProp.writeOnGadget(&g, hello));
QCOMPARE(g.m_value, QLatin1String("hello"));
QCOMPARE(valueProp.readOnGadget(&g), QVariant(hello));
@@ -242,7 +242,7 @@ void tst_QMetaProperty::conversion()
QCOMPARE(custom.str, QString());
// or reset resetable
QVERIFY(value7P.write(this, QVariant()));
- QCOMPARE(value7, QLatin1Literal("reset"));
+ QCOMPARE(value7, QLatin1String("reset"));
}
QTEST_MAIN(tst_QMetaProperty)
diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
index 56b8c071c3..4856b138c3 100644
--- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
+++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
@@ -5,6 +5,7 @@ INCLUDEPATH += $$PWD/../../../other/qvariant_common
SOURCES = tst_qmetatype.cpp
TESTDATA=./typeFlags.bin
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+DEFINES -= QT_NO_LINKED_LIST
msvc|winrt {
# Prevents "fatal error C1128: number of sections exceeded object file format limit".
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index e2bb7dab2a..12c29a6e13 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1499,7 +1499,7 @@ public:
typedef MyObject* MyObjectPtr;
Q_DECLARE_METATYPE(MyObjectPtr)
-#if defined(Q_COMPILER_VARIADIC_MACROS) && !defined(TST_QMETATYPE_BROKEN_COMPILER)
+#if !defined(TST_QMETATYPE_BROKEN_COMPILER)
static QByteArray createTypeName(const char *begin, const char *va)
{
QByteArray tn(begin);
@@ -1697,7 +1697,7 @@ void tst_QMetaType::automaticTemplateRegistration()
QVERIFY(qRegisterMetaType<UnregisteredTypeList>("UnregisteredTypeList") > 0);
}
-#if defined(Q_COMPILER_VARIADIC_MACROS) && !defined(TST_QMETATYPE_BROKEN_COMPILER)
+#if !defined(TST_QMETATYPE_BROKEN_COMPILER)
#define FOR_EACH_STATIC_PRIMITIVE_TYPE(F) \
F(bool) \
@@ -1776,7 +1776,7 @@ void tst_QMetaType::automaticTemplateRegistration()
CREATE_AND_VERIFY_CONTAINER(QHash, void*, void*)
CREATE_AND_VERIFY_CONTAINER(QHash, const void*, const void*)
-#endif // Q_COMPILER_VARIADIC_MACROS
+#endif // !defined(TST_QMETATYPE_BROKEN_COMPILER)
#define TEST_OWNING_SMARTPOINTER(SMARTPOINTER, ELEMENT_TYPE, FLAG_TEST, FROMVARIANTFUNCTION) \
{ \
@@ -1807,16 +1807,36 @@ void tst_QMetaType::automaticTemplateRegistration()
QCOMPARE(extractedPtr.data()->objectName(), sp.data()->objectName()); \
}
+#if QT_DEPRECATED_SINCE(5, 0)
TEST_NONOWNING_SMARTPOINTER(QWeakPointer, QObject, WeakPointerToQObject, qWeakPointerFromVariant)
TEST_NONOWNING_SMARTPOINTER(QWeakPointer, QFile, WeakPointerToQObject, qWeakPointerFromVariant)
TEST_NONOWNING_SMARTPOINTER(QWeakPointer, QTemporaryFile, WeakPointerToQObject, qWeakPointerFromVariant)
TEST_NONOWNING_SMARTPOINTER(QWeakPointer, MyObject, WeakPointerToQObject, qWeakPointerFromVariant)
+#endif
TEST_NONOWNING_SMARTPOINTER(QPointer, QObject, TrackingPointerToQObject, qPointerFromVariant)
TEST_NONOWNING_SMARTPOINTER(QPointer, QFile, TrackingPointerToQObject, qPointerFromVariant)
TEST_NONOWNING_SMARTPOINTER(QPointer, QTemporaryFile, TrackingPointerToQObject, qPointerFromVariant)
TEST_NONOWNING_SMARTPOINTER(QPointer, MyObject, TrackingPointerToQObject, qPointerFromVariant)
#undef TEST_NONOWNING_SMARTPOINTER
+
+
+#define TEST_WEAK_SMARTPOINTER(ELEMENT_TYPE, FLAG_TEST) \
+ { \
+ ELEMENT_TYPE elem; \
+ QSharedPointer < ELEMENT_TYPE > shared(new ELEMENT_TYPE); \
+ QWeakPointer < ELEMENT_TYPE > sp(shared); \
+ sp.toStrongRef()->setObjectName("Test name"); \
+ QVariant v = QVariant::fromValue(sp); \
+ QCOMPARE(v.typeName(), "QWeakPointer<" #ELEMENT_TYPE ">"); \
+ QVERIFY(QMetaType::typeFlags(::qMetaTypeId<QWeakPointer < ELEMENT_TYPE > >()) & QMetaType::FLAG_TEST); \
+ }
+
+ TEST_WEAK_SMARTPOINTER(QObject, WeakPointerToQObject)
+ TEST_WEAK_SMARTPOINTER(QFile, WeakPointerToQObject)
+ TEST_WEAK_SMARTPOINTER(QTemporaryFile, WeakPointerToQObject)
+ TEST_WEAK_SMARTPOINTER(MyObject, WeakPointerToQObject)
+#undef TEST_WEAK_SMARTPOINTER
}
template <typename T>
@@ -2565,9 +2585,7 @@ Q_DECLARE_METATYPE(UndefinedFunction0);
Q_DECLARE_METATYPE(UndefinedFunction1);
Q_DECLARE_METATYPE(UndefinedFunction2);
Q_DECLARE_METATYPE(UndefinedFunction3);
-#ifdef Q_COMPILER_VARIADIC_TEMPLATES
Q_DECLARE_METATYPE(UndefinedFunction4);
-#endif
QTEST_MAIN(tst_QMetaType)
#include "tst_qmetatype.moc"
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h
index 6bda9638f7..22bcb69ac9 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h
@@ -236,7 +236,7 @@ template<> struct TestValueFactory<QMetaType::QRegExp> {
template<> struct TestValueFactory<QMetaType::QRegularExpression> {
static QRegularExpression *create()
{
-#ifndef QT_NO_REGEXP
+#if QT_CONFIG(regularexpression)
return new QRegularExpression("abc.*def");
#else
return 0;
diff --git a/tests/auto/corelib/kernel/qobject/BLACKLIST b/tests/auto/corelib/kernel/qobject/BLACKLIST
deleted file mode 100644
index 0887a73b4c..0000000000
--- a/tests/auto/corelib/kernel/qobject/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[moveToThread]
-windows
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 31268c5cf3..a805bfb747 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -32,7 +32,6 @@
#include <qcoreapplication.h>
#include <qpointer.h>
#include <qtimer.h>
-#include <qregexp.h>
#include <qregularexpression.h>
#include <qmetaobject.h>
#include <qvariant.h>
@@ -82,7 +81,9 @@ private slots:
void senderTest();
void declareInterface();
void qpointerResetBeforeDestroyedSignal();
+#ifndef QT_NO_USERDATA
void testUserData();
+#endif
void childDeletesItsSibling();
void dynamicProperties();
void floatProperty();
@@ -154,6 +155,8 @@ private slots:
void mutableFunctor();
void checkArgumentsForNarrowing();
void nullReceiver();
+ void functorReferencesConnection();
+ void disconnectDisconnects();
};
struct QObjectCreatedOnShutdown
@@ -535,91 +538,91 @@ void tst_QObject::findChildren()
QObject *op = 0;
- op = qFindChild<QObject*>(&o, "o1");
+ op = o.findChild<QObject*>("o1");
QCOMPARE(op, &o1);
- op = qFindChild<QObject*>(&o, "o2");
+ op = o.findChild<QObject*>("o2");
QCOMPARE(op, &o2);
- op = qFindChild<QObject*>(&o, "o11");
+ op = o.findChild<QObject*>("o11");
QCOMPARE(op, &o11);
- op = qFindChild<QObject*>(&o, "o12");
+ op = o.findChild<QObject*>("o12");
QCOMPARE(op, &o12);
- op = qFindChild<QObject*>(&o, "o111");
+ op = o.findChild<QObject*>("o111");
QCOMPARE(op, &o111);
- op = qFindChild<QObject*>(&o, "t1");
+ op = o.findChild<QObject*>("t1");
QCOMPARE(op, static_cast<QObject *>(&t1));
- op = qFindChild<QObject*>(&o, "t121");
+ op = o.findChild<QObject*>("t121");
QCOMPARE(op, static_cast<QObject *>(&t121));
- op = qFindChild<QTimer*>(&o, "t1");
+ op = o.findChild<QTimer*>("t1");
QCOMPARE(op, static_cast<QObject *>(&t1));
- op = qFindChild<QTimer*>(&o, "t121");
+ op = o.findChild<QTimer*>("t121");
QCOMPARE(op, static_cast<QObject *>(&t121));
- op = qFindChild<QTimer*>(&o, "o12");
+ op = o.findChild<QTimer*>("o12");
QCOMPARE(op, static_cast<QObject *>(0));
- op = qFindChild<QObject*>(&o, "o");
+ op = o.findChild<QObject*>("o");
QCOMPARE(op, static_cast<QObject *>(0));
- op = qFindChild<QObject*>(&o, "harry");
+ op = o.findChild<QObject*>("harry");
QCOMPARE(op, static_cast<QObject *>(0));
- op = qFindChild<QObject*>(&o, "o1");
+ op = o.findChild<QObject*>("o1");
QCOMPARE(op, &o1);
QList<QObject*> l;
QList<QTimer*> tl;
- l = qFindChildren<QObject*>(&o, "o1");
+ l = o.findChildren<QObject*>("o1");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o1);
- l = qFindChildren<QObject*>(&o, "o2");
+ l = o.findChildren<QObject*>("o2");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o2);
- l = qFindChildren<QObject*>(&o, "o11");
+ l = o.findChildren<QObject*>("o11");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o11);
- l = qFindChildren<QObject*>(&o, "o12");
+ l = o.findChildren<QObject*>("o12");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o12);
- l = qFindChildren<QObject*>(&o, "o111");
+ l = o.findChildren<QObject*>("o111");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o111);
- l = qFindChildren<QObject*>(&o, "t1");
+ l = o.findChildren<QObject*>("t1");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), static_cast<QObject *>(&t1));
- l = qFindChildren<QObject*>(&o, "t121");
+ l = o.findChildren<QObject*>("t121");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), static_cast<QObject *>(&t121));
- tl = qFindChildren<QTimer*>(&o, "t1");
+ tl = o.findChildren<QTimer*>("t1");
QCOMPARE(tl.size(), 1);
QCOMPARE(tl.at(0), &t1);
- tl = qFindChildren<QTimer*>(&o, "t121");
+ tl = o.findChildren<QTimer*>("t121");
QCOMPARE(tl.size(), 1);
QCOMPARE(tl.at(0), &t121);
- l = qFindChildren<QObject*>(&o, "o");
+ l = o.findChildren<QObject*>("o");
QCOMPARE(l.size(), 0);
- l = qFindChildren<QObject*>(&o, "harry");
+ l = o.findChildren<QObject*>("harry");
QCOMPARE(l.size(), 0);
- tl = qFindChildren<QTimer*>(&o, "o12");
+ tl = o.findChildren<QTimer*>("o12");
QCOMPARE(tl.size(), 0);
- l = qFindChildren<QObject*>(&o, "o1");
+ l = o.findChildren<QObject*>("o1");
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o1);
- l = qFindChildren<QObject*>(&o, QRegExp("o.*"));
+ l = o.findChildren<QObject*>(QRegularExpression("^o.*$"));
QCOMPARE(l.size(), 5);
QVERIFY(l.contains(&o1));
QVERIFY(l.contains(&o2));
QVERIFY(l.contains(&o11));
QVERIFY(l.contains(&o12));
QVERIFY(l.contains(&o111));
- l = qFindChildren<QObject*>(&o, QRegExp("t.*"));
+ l = o.findChildren<QObject*>(QRegularExpression("t.*"));
QCOMPARE(l.size(), 2);
QVERIFY(l.contains(&t1));
QVERIFY(l.contains(&t121));
- tl = qFindChildren<QTimer*>(&o, QRegExp(".*"));
+ tl = o.findChildren<QTimer*>(QRegularExpression("^.*$"));
QCOMPARE(tl.size(), 3);
QVERIFY(tl.contains(&t1));
QVERIFY(tl.contains(&t121));
- tl = qFindChildren<QTimer*>(&o, QRegExp("o.*"));
+ tl = o.findChildren<QTimer*>(QRegularExpression("^o.*$"));
QCOMPARE(tl.size(), 0);
- l = qFindChildren<QObject*>(&o, QRegExp("harry"));
+ l = o.findChildren<QObject*>(QRegularExpression("^harry$"));
QCOMPARE(l.size(), 0);
l = o.findChildren<QObject*>(QRegularExpression("o.*"));
@@ -643,18 +646,18 @@ void tst_QObject::findChildren()
QCOMPARE(l.size(), 0);
// empty and null string check
- op = qFindChild<QObject*>(&o);
+ op = o.findChild<QObject*>();
QCOMPARE(op, &o1);
- op = qFindChild<QObject*>(&o, "");
+ op = o.findChild<QObject*>("");
QCOMPARE(op, &unnamed);
- op = qFindChild<QObject*>(&o, "unnamed");
+ op = o.findChild<QObject*>("unnamed");
QCOMPARE(op, static_cast<QObject *>(0));
- l = qFindChildren<QObject*>(&o);
+ l = o.findChildren<QObject*>();
QCOMPARE(l.size(), 9);
- l = qFindChildren<QObject*>(&o, "");
+ l = o.findChildren<QObject*>("");
QCOMPARE(l.size(), 2);
- l = qFindChildren<QObject*>(&o, "unnamed");
+ l = o.findChildren<QObject*>("unnamed");
QCOMPARE(l.size(), 0);
tl = o.findChildren<QTimer *>("t1");
@@ -722,19 +725,19 @@ void tst_QObject::findChildren()
QCOMPARE(l.size(), 1);
QCOMPARE(l.at(0), &o1);
- l = o.findChildren<QObject*>(QRegExp("o.*"), Qt::FindDirectChildrenOnly);
+ l = o.findChildren<QObject*>(QRegularExpression("^o.*$"), Qt::FindDirectChildrenOnly);
QCOMPARE(l.size(), 2);
QVERIFY(l.contains(&o1));
QVERIFY(l.contains(&o2));
- l = o.findChildren<QObject*>(QRegExp("t.*"), Qt::FindDirectChildrenOnly);
+ l = o.findChildren<QObject*>(QRegularExpression("^t.*$"), Qt::FindDirectChildrenOnly);
QCOMPARE(l.size(), 1);
QVERIFY(l.contains(&t1));
- tl = o.findChildren<QTimer*>(QRegExp(".*"), Qt::FindDirectChildrenOnly);
+ tl = o.findChildren<QTimer*>(QRegularExpression("^.*$"), Qt::FindDirectChildrenOnly);
QCOMPARE(tl.size(), 2);
QVERIFY(tl.contains(&t1));
- tl = o.findChildren<QTimer*>(QRegExp("o.*"), Qt::FindDirectChildrenOnly);
+ tl = o.findChildren<QTimer*>(QRegularExpression("^o.*$"), Qt::FindDirectChildrenOnly);
QCOMPARE(tl.size(), 0);
- l = o.findChildren<QObject*>(QRegExp("harry"), Qt::FindDirectChildrenOnly);
+ l = o.findChildren<QObject*>(QRegularExpression("^harry$"), Qt::FindDirectChildrenOnly);
QCOMPARE(l.size(), 0);
// empty and null string check
@@ -1033,18 +1036,16 @@ public Q_SLOTS:
void tst_QObject::connectNotify_connectSlotsByName()
{
ConnectByNameNotifyReceiverObject testObject;
- QList<ConnectByNameNotifySenderObject *> senders =
- qFindChildren<ConnectByNameNotifySenderObject *>(&testObject);
- for (int i = 0; i < senders.size(); ++i) {
- ConnectByNameNotifySenderObject *o = senders.at(i);
+ const QList<ConnectByNameNotifySenderObject *> senders =
+ testObject.findChildren<ConnectByNameNotifySenderObject *>();
+ for (ConnectByNameNotifySenderObject *o : senders) {
QVERIFY(o->connectedSignals.isEmpty());
QVERIFY(o->disconnectedSignals.isEmpty());
}
QMetaObject::connectSlotsByName(&testObject);
- for (int i = 0; i < senders.size(); ++i) {
- ConnectByNameNotifySenderObject *o = senders.at(i);
+ for (ConnectByNameNotifySenderObject *o : senders) {
QCOMPARE(o->connectedSignals.size(), 1);
QCOMPARE(o->connectedSignals.at(0), QMetaMethod::fromSignal(&ConnectByNameNotifySenderObject::signal1));
QVERIFY(o->disconnectedSignals.isEmpty());
@@ -1400,6 +1401,7 @@ struct CustomType
CustomType(const CustomType &other): i1(other.i1), i2(other.i2), i3(other.i3)
{ ++instanceCount; playWithObjects(); }
~CustomType() { --instanceCount; playWithObjects(); }
+ CustomType &operator=(const CustomType &) = default;
int i1, i2, i3;
int value() { return i1 + i2 + i3; }
@@ -1629,7 +1631,7 @@ void tst_QObject::thread()
QObject object;
// thread affinity for objects with no parent should be the
// current thread
- QVERIFY(object.thread() != 0);
+ QVERIFY(object.thread() != nullptr);
QCOMPARE(object.thread(), currentThread);
// children inherit their parent's thread
QObject child(&object);
@@ -1641,7 +1643,7 @@ void tst_QObject::thread()
{
TestThread thr;
- QVERIFY(thr.thread() != 0);
+ QVERIFY(thr.thread() != nullptr);
QCOMPARE(thr.thread(), currentThread);
thr.object = &object;
@@ -1800,8 +1802,8 @@ void tst_QObject::moveToThread()
QMetaObject::invokeMethod(object, "deleteLater", Qt::QueuedConnection);
thread.wait();
- QVERIFY(opointer == 0);
- QVERIFY(cpointer == 0);
+ QVERIFY(opointer == nullptr);
+ QVERIFY(cpointer == nullptr);
}
{
@@ -2339,6 +2341,7 @@ void tst_QObject::declareInterface()
}
+#ifndef QT_NO_USERDATA
class CustomData : public QObjectUserData
{
public:
@@ -2377,10 +2380,11 @@ void tst_QObject::testUserData()
for (int i=0; i<USER_DATA_COUNT; ++i) {
int id = user_data_ids[i];
CustomData *data = static_cast<CustomData *>(my_test_object.userData(id));
- QVERIFY(data != 0);
+ QVERIFY(data != nullptr);
QCOMPARE(data->id, id);
}
}
+#endif // QT_NO_USERDATA
class DestroyedListener : public QObject
{
@@ -3409,12 +3413,11 @@ void tst_QObject::disconnectSelfInSlotAndDeleteAfterEmit()
void tst_QObject::dumpObjectInfo()
{
QObject a, b;
- QObject::connect(&a, SIGNAL(destroyed(QObject*)), &b, SLOT(deleteLater()));
- a.disconnect(&b);
+ QObject::connect(&a, &QObject::destroyed, &b, &QObject::deleteLater);
QTest::ignoreMessage(QtDebugMsg, "OBJECT QObject::unnamed");
QTest::ignoreMessage(QtDebugMsg, " SIGNALS OUT");
QTest::ignoreMessage(QtDebugMsg, " signal: destroyed(QObject*)");
- QTest::ignoreMessage(QtDebugMsg, " <Disconnected receiver>");
+ QTest::ignoreMessage(QtDebugMsg, " <functor or function pointer>");
QTest::ignoreMessage(QtDebugMsg, " SIGNALS IN");
QTest::ignoreMessage(QtDebugMsg, " <None>");
a.dumpObjectInfo(); // should not crash
@@ -3626,7 +3629,7 @@ class OverloadObject : public QObject
void sig(int i, int j = 12);
void sig(QObject *o, QObject *p, QObject *q = 0, QObject *r = 0) const;
void other(int a = 0);
- void sig(QObject *o, OverloadObject *p = 0, QObject *q = 0, QObject *r = 0);
+ void sig(QObject *o, OverloadObject *p = 0, QObject *q = 0, QObject *r = nullptr);
void sig(double r = 0.5);
public slots:
void slo(int i, int j = 43)
@@ -4793,13 +4796,13 @@ class LotsOfSignalsAndSlots: public QObject
public slots:
void slot_v() {}
- void slot_v_noexcept() Q_DECL_NOTHROW {}
+ void slot_v_noexcept() noexcept {}
void slot_vi(int) {}
- void slot_vi_noexcept() Q_DECL_NOTHROW {}
+ void slot_vi_noexcept() noexcept {}
void slot_vii(int, int) {}
void slot_viii(int, int, int) {}
int slot_i() { return 0; }
- int slot_i_noexcept() Q_DECL_NOTHROW { return 0; }
+ int slot_i_noexcept() noexcept { return 0; }
int slot_ii(int) { return 0; }
int slot_iii(int, int) { return 0; }
int slot_iiii(int, int, int) { return 0; }
@@ -4813,18 +4816,18 @@ class LotsOfSignalsAndSlots: public QObject
void slot_vPFvvE(fptr) {}
void const_slot_v() const {};
- void const_slot_v_noexcept() const Q_DECL_NOTHROW {}
+ void const_slot_v_noexcept() const noexcept {}
void const_slot_vi(int) const {};
- void const_slot_vi_noexcept(int) const Q_DECL_NOTHROW {}
+ void const_slot_vi_noexcept(int) const noexcept {}
static void static_slot_v() {}
- static void static_slot_v_noexcept() Q_DECL_NOTHROW {}
+ static void static_slot_v_noexcept() noexcept {}
static void static_slot_vi(int) {}
- static void static_slot_vi_noexcept(int) Q_DECL_NOTHROW {}
+ static void static_slot_vi_noexcept(int) noexcept {}
static void static_slot_vii(int, int) {}
static void static_slot_viii(int, int, int) {}
static int static_slot_i() { return 0; }
- static int static_slot_i_noexcept() Q_DECL_NOTHROW { return 0; }
+ static int static_slot_i_noexcept() noexcept { return 0; }
static int static_slot_ii(int) { return 0; }
static int static_slot_iii(int, int) { return 0; }
static int static_slot_iiii(int, int, int) { return 0; }
@@ -4987,11 +4990,11 @@ void tst_QObject::connectCxx0xTypeMatching()
}
-void receiverFunction_noexcept() Q_DECL_NOTHROW {}
-struct Functor_noexcept { void operator()() Q_DECL_NOTHROW {} };
+void receiverFunction_noexcept() noexcept {}
+struct Functor_noexcept { void operator()() noexcept {} };
void tst_QObject::connectCxx17Noexcept()
{
- // this is about connecting signals to slots with the Q_DECL_NOTHROW qualifier
+ // this is about connecting signals to slots with the noexcept qualifier
// as semantics changed due to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html
typedef LotsOfSignalsAndSlots Foo;
Foo obj;
@@ -5981,7 +5984,7 @@ void ConnectToPrivateSlot::test(SenderObject* obj1) {
obj1->signal1();
QCOMPARE(d->receivedCount, 1);
QCOMPARE(d->receivedValue, QVariant());
- obj1->signal7(666, QLatin1Literal("_"));
+ obj1->signal7(666, QLatin1String("_"));
QCOMPARE(d->receivedCount, 2);
QCOMPARE(d->receivedValue, QVariant(666));
QVERIFY(QObjectPrivate::connect(obj1, &SenderObject::signal2, d, &ConnectToPrivateSlotPrivate::thisIsAPrivateSlot, Qt::UniqueConnection));
@@ -6028,7 +6031,6 @@ void tst_QObject::connectFunctorArgDifference()
QStringListModel model;
connect(&model, &QStringListModel::rowsInserted, SlotFunctor());
-#if defined(Q_COMPILER_LAMBDA)
connect(&timer, &QTimer::timeout, [=](){});
connect(&timer, &QTimer::objectNameChanged, [=](const QString &){});
connect(qApp, &QCoreApplication::aboutToQuit, [=](){});
@@ -6036,7 +6038,6 @@ void tst_QObject::connectFunctorArgDifference()
connect(&timer, &QTimer::objectNameChanged, [=](){});
connect(&model, &QStringListModel::rowsInserted, [=](){});
connect(&model, &QStringListModel::rowsInserted, [=](const QModelIndex &){});
-#endif
QVERIFY(true);
}
@@ -6074,7 +6075,6 @@ void tst_QObject::connectFunctorQueued()
e.exec();
QCOMPARE(status, 2);
-#if defined(Q_COMPILER_LAMBDA)
status = 1;
connect(&obj, &SenderObject::signal1, this, [&status] { status = 2; }, Qt::QueuedConnection);
@@ -6082,7 +6082,6 @@ void tst_QObject::connectFunctorQueued()
QCOMPARE(status, 1);
e.exec();
QCOMPARE(status, 2);
-#endif
}
void tst_QObject::connectFunctorWithContext()
@@ -6116,7 +6115,6 @@ void tst_QObject::connectFunctorWithContext()
e.exec();
QCOMPARE(status, 2);
-#if defined(Q_COMPILER_LAMBDA)
status = 1;
connect(&obj, &SenderObject::signal1, this, [this, &status, &obj] { status = 2; QCOMPARE(sender(), &obj); }, Qt::QueuedConnection);
@@ -6124,7 +6122,6 @@ void tst_QObject::connectFunctorWithContext()
QCOMPARE(status, 1);
e.exec();
QCOMPARE(status, 2);
-#endif
// Free
context->deleteLater();
@@ -6434,7 +6431,7 @@ void connectFunctorOverload_impl(Signal signal, int expOverload, QList<QVariant>
void tst_QObject::connectFunctorOverloads()
{
-#if defined (Q_COMPILER_DECLTYPE) && defined (Q_COMPILER_VARIADIC_TEMPLATES)
+#if defined (Q_COMPILER_VARIADIC_TEMPLATES)
connectFunctorOverload_impl<ComplexFunctor>(&FunctorArgDifferenceObject::signal_ii, 1,
(QList<QVariant>() << 1 << 2));
connectFunctorOverload_impl<ComplexFunctor>(&FunctorArgDifferenceObject::signal_iiS, 1,
@@ -6608,7 +6605,6 @@ void tst_QObject::disconnectDoesNotLeakFunctor()
}
QCOMPARE(countedStructObjectsCount, 0);
{
-#if defined(Q_COMPILER_LAMBDA)
CountedStruct s;
QCOMPARE(countedStructObjectsCount, 1);
QTimer timer;
@@ -6618,7 +6614,6 @@ void tst_QObject::disconnectDoesNotLeakFunctor()
QCOMPARE(countedStructObjectsCount, 2);
QVERIFY(QObject::disconnect(c));
QCOMPARE(countedStructObjectsCount, 1);
-#endif // Q_COMPILER_LAMBDA
}
QCOMPARE(countedStructObjectsCount, 0);
}
@@ -6666,7 +6661,6 @@ void tst_QObject::contextDoesNotLeakFunctor()
}
QCOMPARE(countedStructObjectsCount, 0);
{
-#if defined(Q_COMPILER_LAMBDA)
CountedStruct s;
QEventLoop e;
ContextObject *context = new ContextObject;
@@ -6679,7 +6673,6 @@ void tst_QObject::contextDoesNotLeakFunctor()
context->deleteLater();
e.exec();
QCOMPARE(countedStructObjectsCount, 1);
-#endif // Q_COMPILER_LAMBDA
}
QCOMPARE(countedStructObjectsCount, 0);
}
@@ -7487,6 +7480,167 @@ void tst_QObject::nullReceiver()
QVERIFY(!connect(&o, SIGNAL(destroyed()), nullObj, SLOT(deleteLater())));
}
+void tst_QObject::functorReferencesConnection()
+{
+ countedStructObjectsCount = 0;
+ QMetaObject::Connection globalCon;
+ {
+ GetSenderObject obj;
+ CountedStruct counted(&obj);
+ QCOMPARE(countedStructObjectsCount, 1);
+ auto c = QSharedPointer<QMetaObject::Connection>::create();
+ int slotCalled = 0;
+ *c = connect(&obj, &GetSenderObject::aSignal, &obj, [&slotCalled, c, counted] {
+ QObject::disconnect(*c);
+ slotCalled++;
+ });
+ globalCon = *c; // keep a handle to the connection somewhere;
+ QVERIFY(globalCon);
+ QCOMPARE(countedStructObjectsCount, 2);
+ obj.triggerSignal();
+ QCOMPARE(slotCalled, 1);
+ QCOMPARE(countedStructObjectsCount, 1);
+ QVERIFY(!globalCon);
+ obj.triggerSignal();
+ QCOMPARE(slotCalled, 1);
+ QCOMPARE(countedStructObjectsCount, 1);
+ }
+ QCOMPARE(countedStructObjectsCount, 0);
+
+ {
+ GetSenderObject obj;
+ CountedStruct counted(&obj);
+ QCOMPARE(countedStructObjectsCount, 1);
+ auto *rec = new QObject;
+ int slotCalled = 0;
+ globalCon = connect(&obj, &GetSenderObject::aSignal, rec, [&slotCalled, rec, counted] {
+ delete rec;
+ slotCalled++;
+ });
+ QCOMPARE(countedStructObjectsCount, 2);
+ obj.triggerSignal();
+ QCOMPARE(slotCalled, 1);
+ QCOMPARE(countedStructObjectsCount, 1);
+ QVERIFY(!globalCon);
+ obj.triggerSignal();
+ QCOMPARE(slotCalled, 1);
+ QCOMPARE(countedStructObjectsCount, 1);
+ }
+ QCOMPARE(countedStructObjectsCount, 0);
+ {
+ int slotCalled = 0;
+ QEventLoop eventLoop;
+ {
+ // Sender will be destroyed when the labda goes out of scope lambda, so it will exit the event loop
+ auto sender = QSharedPointer<GetSenderObject>::create();
+ connect(sender.data(), &QObject::destroyed, &eventLoop, &QEventLoop::quit, Qt::QueuedConnection);
+ globalCon = connect(sender.data(), &GetSenderObject::aSignal, this, [&slotCalled, sender, &globalCon, this] {
+ ++slotCalled;
+ // This signal will be connected, but should never be called as the sender will be destroyed before
+ auto c2 = connect(sender.data(), &GetSenderObject::aSignal, [] { QFAIL("Should not be called"); });
+ QVERIFY(c2);
+ QVERIFY(QObject::disconnect(sender.data(), nullptr, this, nullptr));
+ QVERIFY(!globalCon); // this connection has been disconnected
+ QVERIFY(c2); // sender should not have been deleted yet, only after the emission is done
+ });
+ QMetaObject::invokeMethod(sender.data(), &GetSenderObject::triggerSignal, Qt::QueuedConnection);
+ QMetaObject::invokeMethod(sender.data(), &GetSenderObject::triggerSignal, Qt::QueuedConnection);
+ QMetaObject::invokeMethod(sender.data(), &GetSenderObject::triggerSignal, Qt::QueuedConnection);
+ }
+ eventLoop.exec();
+ QCOMPARE(slotCalled, 1);
+ }
+
+ {
+ GetSenderObject obj;
+ CountedStruct counted(&obj);
+ QCOMPARE(countedStructObjectsCount, 1);
+ auto c1 = QSharedPointer<QMetaObject::Connection>::create();
+ auto c2 = QSharedPointer<QMetaObject::Connection>::create();
+ int slot1Called = 0;
+ int slot3Called = 0;
+ *c1 = connect(&obj, &GetSenderObject::aSignal, &obj, [&slot1Called, &slot3Called, &obj, c1, c2, counted] {
+ auto c3 = connect(&obj, &GetSenderObject::aSignal, [counted, &slot3Called] {
+ slot3Called++;
+ });
+ // top-level + the one in the 3 others lambdas
+ QCOMPARE(countedStructObjectsCount, 4);
+ QObject::disconnect(*c2);
+ slot1Called++;
+ });
+ connect(&obj, &GetSenderObject::aSignal, [] {}); // just a dummy signal to fill the connection list
+ *c2 = connect(&obj, &GetSenderObject::aSignal, [counted, c2] { QFAIL("should not be called"); });
+ QVERIFY(c1 && c2);
+ QCOMPARE(countedStructObjectsCount, 3); // top-level + c1 + c2
+ obj.triggerSignal();
+ QCOMPARE(slot1Called, 1);
+ QCOMPARE(slot3Called, 0);
+ QCOMPARE(countedStructObjectsCount, 3); // top-level + c1 + c3
+ QObject::disconnect(*c1);
+ QCOMPARE(countedStructObjectsCount, 2); // top-level + c3
+ obj.triggerSignal();
+ QCOMPARE(slot1Called, 1);
+ QCOMPARE(slot3Called, 1);
+ }
+ {
+ struct DestroyEmit {
+ Q_DISABLE_COPY(DestroyEmit);
+ explicit DestroyEmit(SenderObject *obj) : obj(obj) {}
+ SenderObject *obj;
+ ~DestroyEmit() {
+ obj->emitSignal1();
+ }
+ };
+ SenderObject obj;
+ int slot1Called = 0;
+ int slot2Called = 0;
+ int slot3Called = 0;
+ auto c1 = QSharedPointer<QMetaObject::Connection>::create();
+ auto de = QSharedPointer<DestroyEmit>::create(&obj);
+ *c1 = connect(&obj, &SenderObject::signal1, [&slot1Called, &slot3Called, de, c1, &obj] {
+ connect(&obj, &SenderObject::signal1, [&slot3Called] { slot3Called++; });
+ slot1Called++;
+ QObject::disconnect(*c1);
+ });
+ de.clear();
+ connect(&obj, &SenderObject::signal1, [&slot2Called] { slot2Called++; });
+ obj.emitSignal1();
+ QCOMPARE(slot1Called, 1);
+ QCOMPARE(slot2Called, 2); // because also called from ~DestroyEmit
+ QCOMPARE(slot3Called, 1);
+ }
+}
+
+void tst_QObject::disconnectDisconnects()
+{
+ // Test what happens if the destructor of an functor slot also disconnects more slot;
+
+ SenderObject s1;
+ QScopedPointer<QObject> receiver(new QObject);
+
+ auto s2 = QSharedPointer<SenderObject>::create();
+ QPointer<QObject> s2_tracker = s2.data();
+ int count = 0;
+ connect(&s1, &SenderObject::signal1, [&count] { count++; }); // α
+ connect(&s1, &SenderObject::signal1, receiver.data(), [s2] { QFAIL("!!"); }); // β
+ connect(s2.data(), &SenderObject::signal1, receiver.data(), [] { QFAIL("!!"); });
+ connect(&s1, &SenderObject::signal2, receiver.data(), [] { QFAIL("!!"); });
+ connect(s2.data(), &SenderObject::signal2, receiver.data(), [] { QFAIL("!!"); });
+ connect(&s1, &SenderObject::signal1, [&count] { count++; }); // γ
+ connect(&s1, &SenderObject::signal2, [&count] { count++; }); // δ
+ s2.clear();
+
+ QVERIFY(s2_tracker);
+ receiver
+ .reset(); // this will delete the receiver which must also delete s2 as β is disconnected
+ QVERIFY(!s2_tracker);
+ // test that the data structures are still in order
+ s1.emitSignal1();
+ QCOMPARE(count, 2); // α + γ
+ s1.emitSignal2();
+ QCOMPARE(count, 3); // + δ
+}
+
// Test for QtPrivate::HasQ_OBJECT_Macro
Q_STATIC_ASSERT(QtPrivate::HasQ_OBJECT_Macro<tst_QObject>::Value);
Q_STATIC_ASSERT(!QtPrivate::HasQ_OBJECT_Macro<SiblingDeleter>::Value);
diff --git a/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp
index 55deb8eb1a..fa2d5e3723 100644
--- a/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp
+++ b/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp
@@ -34,6 +34,7 @@
#include <QSharedMemory>
#include <QTest>
#include <QThread>
+#include <QElapsedTimer>
#define EXISTING_SHARE "existing"
#define EXISTING_SIZE 1024
@@ -645,7 +646,7 @@ public:
char *memory = (char*)producer.data();
memory[1] = '0';
- QTime timer;
+ QElapsedTimer timer;
timer.start();
int i = 0;
while (i < 5 && timer.elapsed() < 5000) {
diff --git a/tests/auto/corelib/kernel/qsignalblocker/tst_qsignalblocker.cpp b/tests/auto/corelib/kernel/qsignalblocker/tst_qsignalblocker.cpp
index fd18f00cd0..39b03ade61 100644
--- a/tests/auto/corelib/kernel/qsignalblocker/tst_qsignalblocker.cpp
+++ b/tests/auto/corelib/kernel/qsignalblocker/tst_qsignalblocker.cpp
@@ -66,7 +66,6 @@ void tst_QSignalBlocker::signalBlocking()
void tst_QSignalBlocker::moveAssignment()
{
-#ifdef Q_COMPILER_RVALUE_REFS
QObject o1, o2;
// move-assignment: both block other objects
@@ -157,10 +156,6 @@ void tst_QSignalBlocker::moveAssignment()
QVERIFY(!o1.signalsBlocked());
QVERIFY(!o2.signalsBlocked());
-
-#else
- QSKIP("This compiler is not in C++11 mode or doesn't support move semantics");
-#endif // Q_COMPILER_RVALUE_REFS
}
QTEST_MAIN(tst_QSignalBlocker)
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
index e68bf84268..f2e5e78592 100644
--- a/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
+++ b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
@@ -1,3 +1,3 @@
[unexpectedDisconnection]
-windows
-osx
+windows-7sp1
+windows-10 msvc-2015
diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST
deleted file mode 100644
index 16cbab4587..0000000000
--- a/tests/auto/corelib/kernel/qtimer/BLACKLIST
+++ /dev/null
@@ -1,5 +0,0 @@
-[remainingTime]
-windows
-osx
-[basic_chrono]
-osx
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index 3b10547dc4..8e0bdac520 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -38,6 +38,7 @@
#include <qtimer.h>
#include <qthread.h>
+#include <qelapsedtimer.h>
#if defined Q_OS_UNIX
#include <unistd.h>
@@ -46,7 +47,11 @@
class tst_QTimer : public QObject
{
Q_OBJECT
+public:
+ static void initMain();
+
private slots:
+ void cleanupTestCase();
void zeroTimer();
void singleShotTimeout();
void timeout();
@@ -73,7 +78,12 @@ private slots:
void recurseOnTimeoutAndStopTimer();
void singleShotToFunctors();
void singleShot_chrono();
+ void singleShot_static();
void crossThreadSingleShotToFunctor();
+ void timerOrder();
+ void timerOrder_data();
+ void timerOrderBackgroundThread();
+ void timerOrderBackgroundThread_data() { timerOrder_data(); }
void dontBlockEvents();
void postedEventsShouldNotStarveTimers();
@@ -521,7 +531,7 @@ public:
QBasicTimer m_timer;
int m_interval;
- QTime m_startedTime;
+ QElapsedTimer m_elapsedTimer;
QEventLoop eventLoop;
inline RestartedTimerFiresTooSoonObject()
@@ -533,7 +543,7 @@ public:
static int interval = 1000;
m_interval = interval;
- m_startedTime.start();
+ m_elapsedTimer.start();
m_timer.start(interval, this);
// alternate between single-shot and 1 sec
@@ -547,7 +557,7 @@ public:
m_timer.stop();
- int elapsed = m_startedTime.elapsed();
+ int elapsed = m_elapsedTimer.elapsed();
if (elapsed < m_interval / 2) {
// severely too early!
@@ -585,10 +595,10 @@ public:
public slots:
void longLastingSlot()
{
- // Don't use timers for this, because we are testing them.
- QTime time;
- time.start();
- while (time.elapsed() < 200) {
+ // Don't use QTimer for this, because we are testing it.
+ QElapsedTimer control;
+ control.start();
+ while (control.elapsed() < 200) {
for (int c = 0; c < 100000; c++) {} // Mindless looping.
}
if (++count >= 2) {
@@ -768,7 +778,7 @@ public:
quitEventLoop_noexcept();
}
- static void quitEventLoop_noexcept() Q_DECL_NOTHROW
+ static void quitEventLoop_noexcept() noexcept
{
QVERIFY(!_e.isNull());
_e->quit();
@@ -1033,5 +1043,126 @@ void tst_QTimer::callOnTimeout()
QVERIFY(!connection);
}
+class OrderHelper : public QObject
+{
+ Q_OBJECT
+public:
+ enum CallType
+ {
+ String,
+ PMF,
+ Functor,
+ FunctorNoCtx
+ };
+ Q_ENUM(CallType)
+ QVector<CallType> calls;
+
+ void triggerCall(CallType callType)
+ {
+ switch (callType)
+ {
+ case String:
+ QTimer::singleShot(0, this, SLOT(stringSlot()));
+ break;
+ case PMF:
+ QTimer::singleShot(0, this, &OrderHelper::pmfSlot);
+ break;
+ case Functor:
+ QTimer::singleShot(0, this, [this]() { functorSlot(); });
+ break;
+ case FunctorNoCtx:
+ QTimer::singleShot(0, [this]() { functorNoCtxSlot(); });
+ break;
+ }
+ }
+
+public slots:
+ void stringSlot() { calls << String; }
+ void pmfSlot() { calls << PMF; }
+ void functorSlot() { calls << Functor; }
+ void functorNoCtxSlot() { calls << FunctorNoCtx; }
+};
+
+Q_DECLARE_METATYPE(OrderHelper::CallType)
+
+void tst_QTimer::timerOrder()
+{
+ QFETCH(QVector<OrderHelper::CallType>, calls);
+
+ OrderHelper helper;
+
+ for (const auto call : calls)
+ helper.triggerCall(call);
+
+ QTRY_COMPARE(helper.calls, calls);
+}
+
+void tst_QTimer::timerOrder_data()
+{
+ QTest::addColumn<QVector<OrderHelper::CallType>>("calls");
+
+ QVector<OrderHelper::CallType> calls = {
+ OrderHelper::String, OrderHelper::PMF,
+ OrderHelper::Functor, OrderHelper::FunctorNoCtx
+ };
+ std::sort(calls.begin(), calls.end());
+
+ int permutation = 0;
+ do {
+ QTest::addRow("permutation=%d", permutation) << calls;
+ ++permutation;
+ } while (std::next_permutation(calls.begin(), calls.end()));
+}
+
+void tst_QTimer::timerOrderBackgroundThread()
+{
+#if !QT_CONFIG(cxx11_future)
+ QSKIP("This test requires QThread::create");
+#else
+ auto *thread = QThread::create([this]() { timerOrder(); });
+ thread->start();
+ QVERIFY(thread->wait());
+ delete thread;
+#endif
+}
+
+struct StaticSingleShotUser
+{
+ StaticSingleShotUser()
+ {
+ for (auto call : calls())
+ helper.triggerCall(call);
+ }
+ OrderHelper helper;
+
+ static QVector<OrderHelper::CallType> calls()
+ {
+ return {OrderHelper::String, OrderHelper::PMF,
+ OrderHelper::Functor, OrderHelper::FunctorNoCtx};
+ }
+};
+
+// NOTE: to prevent any static initialization order fiasco, we implement
+// initMain() to instantiate staticSingleShotUser before qApp
+
+static StaticSingleShotUser *s_staticSingleShotUser = nullptr;
+
+void tst_QTimer::initMain()
+{
+ s_staticSingleShotUser = new StaticSingleShotUser;
+}
+
+void tst_QTimer::cleanupTestCase()
+{
+ delete s_staticSingleShotUser;
+}
+
+void tst_QTimer::singleShot_static()
+{
+ QCoreApplication::processEvents();
+ QCOMPARE(s_staticSingleShotUser->helper.calls, s_staticSingleShotUser->calls());
+}
+
QTEST_MAIN(tst_QTimer)
+
#include "tst_qtimer.moc"
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
index 40a29c723c..b3efa97dbd 100644
--- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
@@ -310,7 +310,7 @@ struct TranslateThread : public QThread
void run() {
bool startSignalled = false;
- while (terminate.load() == 0) {
+ while (terminate.loadRelaxed() == 0) {
const QString result = QCoreApplication::translate("QPushButton", "Hello %n world(s)!", 0, 0);
if (!startSignalled) {
diff --git a/tests/auto/corelib/kernel/qvariant/qvariant.pro b/tests/auto/corelib/kernel/qvariant/qvariant.pro
index a620be0091..0b5280df86 100644
--- a/tests/auto/corelib/kernel/qvariant/qvariant.pro
+++ b/tests/auto/corelib/kernel/qvariant/qvariant.pro
@@ -5,6 +5,7 @@ INCLUDEPATH += $$PWD/../../../other/qvariant_common
SOURCES = tst_qvariant.cpp
RESOURCES += qvariant.qrc
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+DEFINES -= QT_NO_LINKED_LIST
qtConfig(c++14): CONFIG += c++14
qtConfig(c++1z): CONFIG += c++1z
!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index 4da34c407e..074cb07092 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -59,12 +59,6 @@
class CustomNonQObject;
-#if defined(Q_COMPILER_CLASS_ENUM)
-#define ENUM_SIZE(X) : X
-#else
-#define ENUM_SIZE(X)
-#endif
-
class tst_QVariant : public QObject
{
Q_OBJECT
@@ -82,15 +76,15 @@ public:
enum MetaEnumTest_Enum1 : qint64 { MetaEnumTest_Enum1_value = 42, MetaEnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 };
Q_ENUM(MetaEnumTest_Enum1)
- enum MetaEnumTest_Enum3 ENUM_SIZE(qint64) { MetaEnumTest_Enum3_value = -47, MetaEnumTest_Enum3_bigValue = (Q_INT64_C(1) << 56) + 5, MetaEnumTest_Enum3_bigNegValue = -(Q_INT64_C(1) << 56) - 3 };
+ enum MetaEnumTest_Enum3 : qint64 { MetaEnumTest_Enum3_value = -47, MetaEnumTest_Enum3_bigValue = (Q_INT64_C(1) << 56) + 5, MetaEnumTest_Enum3_bigNegValue = -(Q_INT64_C(1) << 56) - 3 };
Q_ENUM(MetaEnumTest_Enum3)
- enum MetaEnumTest_Enum4 ENUM_SIZE(quint64) { MetaEnumTest_Enum4_value = 47, MetaEnumTest_Enum4_bigValue = (Q_INT64_C(1) << 52) + 45 };
+ enum MetaEnumTest_Enum4 : quint64 { MetaEnumTest_Enum4_value = 47, MetaEnumTest_Enum4_bigValue = (Q_INT64_C(1) << 52) + 45 };
Q_ENUM(MetaEnumTest_Enum4)
- enum MetaEnumTest_Enum5 ENUM_SIZE(uint) { MetaEnumTest_Enum5_value = 47 };
+ enum MetaEnumTest_Enum5 : uint { MetaEnumTest_Enum5_value = 47 };
Q_ENUM(MetaEnumTest_Enum5)
- enum MetaEnumTest_Enum6 ENUM_SIZE(uchar) { MetaEnumTest_Enum6_value = 47 };
+ enum MetaEnumTest_Enum6 : uchar { MetaEnumTest_Enum6_value = 47 };
Q_ENUM(MetaEnumTest_Enum6)
- enum MetaEnumTest_Enum8 ENUM_SIZE(short) { MetaEnumTest_Enum8_value = 47 };
+ enum MetaEnumTest_Enum8 : short { MetaEnumTest_Enum8_value = 47 };
Q_ENUM(MetaEnumTest_Enum8)
private slots:
@@ -385,9 +379,13 @@ void tst_QVariant::isNull()
QString str1;
QVariant var1( str1 );
QVERIFY( var1.isNull() );
-
+#if QT_DEPRECATED_SINCE(5, 9)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QVariant var2( QString::null );
+QT_WARNING_POP
QVERIFY( var2.isNull() );
+#endif
QVariant var3( QString( "blah" ) );
QVERIFY( !var3.isNull() );
@@ -406,10 +404,19 @@ void tst_QVariant::isNull()
QVERIFY( var6.isNull() );
QVariant varLL( (qlonglong)0 );
QVERIFY( !varLL.isNull() );
+
+#if QT_DEPRECATED_SINCE(5, 9)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QVariant var7(QString::null);
+QT_WARNING_POP
QVERIFY(var7.isNull());
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
var7 = QVariant::fromValue<QString>(QString::null);
+QT_WARNING_POP
QVERIFY(var7.isNull());
+#endif
QVariant var8(QMetaType::Nullptr, nullptr);
QVERIFY(var8.isNull());
@@ -431,6 +438,9 @@ void tst_QVariant::isNull()
QVERIFY(var11.isNull());
QVERIFY(QVariant::fromValue<int*>(nullptr).isNull());
+
+ QVariant var12(QVariant::fromValue<QString>(QString()));
+ QVERIFY(var12.isNull());
}
void tst_QVariant::swap()
@@ -1728,281 +1738,281 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("bool3") << QVariant(false) << QVariant(true) << -1;
QTest::newRow("bool4") << QVariant(true) << QVariant(false) << +1;
- QTest::newRow("char1") << qVariantFromValue(char(0)) << qVariantFromValue(char(0)) << 0;
- QTest::newRow("char2") << qVariantFromValue(CHAR_MAX) << qVariantFromValue(CHAR_MAX) << 0;
- QTest::newRow("char3") << qVariantFromValue(CHAR_MIN) << qVariantFromValue(CHAR_MIN) << 0;
- QTest::newRow("char4") << qVariantFromValue(CHAR_MIN) << qVariantFromValue(CHAR_MAX) << -1;
- QTest::newRow("char5") << qVariantFromValue(CHAR_MAX) << qVariantFromValue(CHAR_MIN) << +1;
-
- QTest::newRow("schar1") << qVariantFromValue(schar(0)) << qVariantFromValue(schar(0)) << 0;
- QTest::newRow("schar2") << qVariantFromValue(SCHAR_MAX) << qVariantFromValue(SCHAR_MAX) << 0;
- QTest::newRow("schar3") << qVariantFromValue(SCHAR_MIN) << qVariantFromValue(SCHAR_MIN) << 0;
- QTest::newRow("schar4") << qVariantFromValue(SCHAR_MIN) << qVariantFromValue(SCHAR_MAX) << -1;
- QTest::newRow("schar5") << qVariantFromValue(SCHAR_MAX) << qVariantFromValue(SCHAR_MIN) << +1;
-
- QTest::newRow("uchar1") << qVariantFromValue(uchar(0)) << qVariantFromValue(uchar(0)) << 0;
- QTest::newRow("uchar2") << qVariantFromValue(UCHAR_MAX) << qVariantFromValue(UCHAR_MAX) << 0;
- QTest::newRow("uchar3") << qVariantFromValue(uchar(0)) << qVariantFromValue(UCHAR_MAX) << -1;
- QTest::newRow("uchar4") << qVariantFromValue(UCHAR_MAX) << qVariantFromValue(uchar(0)) << +1;
-
- QTest::newRow("short1") << qVariantFromValue(short(0)) << qVariantFromValue(short(0)) << 0;
- QTest::newRow("short2") << qVariantFromValue(SHRT_MAX) << qVariantFromValue(SHRT_MAX) << 0;
- QTest::newRow("short3") << qVariantFromValue(SHRT_MIN) << qVariantFromValue(SHRT_MIN) << 0;
- QTest::newRow("short4") << qVariantFromValue(SHRT_MIN) << qVariantFromValue(SHRT_MAX) << -1;
- QTest::newRow("short5") << qVariantFromValue(SHRT_MAX) << qVariantFromValue(SHRT_MIN) << +1;
-
- QTest::newRow("ushort1") << qVariantFromValue(ushort(0)) << qVariantFromValue(ushort(0)) << 0;
- QTest::newRow("ushort2") << qVariantFromValue(USHRT_MAX) << qVariantFromValue(USHRT_MAX) << 0;
- QTest::newRow("ushort3") << qVariantFromValue(ushort(0)) << qVariantFromValue(USHRT_MAX) << -1;
- QTest::newRow("ushort4") << qVariantFromValue(USHRT_MAX) << qVariantFromValue(ushort(0)) << +1;
-
- QTest::newRow("int1") << qVariantFromValue(int(0)) << qVariantFromValue(int(0)) << 0;
- QTest::newRow("int2") << qVariantFromValue(INT_MAX) << qVariantFromValue(INT_MAX) << 0;
- QTest::newRow("int3") << qVariantFromValue(INT_MIN) << qVariantFromValue(INT_MIN) << 0;
- QTest::newRow("int4") << qVariantFromValue(INT_MIN) << qVariantFromValue(INT_MAX) << -1;
- QTest::newRow("int5") << qVariantFromValue(INT_MAX) << qVariantFromValue(INT_MIN) << +1;
-
- QTest::newRow("uint1") << qVariantFromValue(uint(0)) << qVariantFromValue(uint(0)) << 0;
- QTest::newRow("uint2") << qVariantFromValue(UINT_MAX) << qVariantFromValue(UINT_MAX) << 0;
- QTest::newRow("uint3") << qVariantFromValue(uint(0)) << qVariantFromValue(UINT_MAX) << -1;
- QTest::newRow("uint4") << qVariantFromValue(UINT_MAX) << qVariantFromValue(uint(0)) << +1;
-
- QTest::newRow("long1") << qVariantFromValue(long(0)) << qVariantFromValue(long(0)) << 0;
- QTest::newRow("long2") << qVariantFromValue(LONG_MAX) << qVariantFromValue(LONG_MAX) << 0;
- QTest::newRow("long3") << qVariantFromValue(LONG_MIN) << qVariantFromValue(LONG_MIN) << 0;
- QTest::newRow("long4") << qVariantFromValue(LONG_MIN) << qVariantFromValue(LONG_MAX) << -1;
- QTest::newRow("long5") << qVariantFromValue(LONG_MAX) << qVariantFromValue(LONG_MIN) << +1;
-
- QTest::newRow("ulong1") << qVariantFromValue(ulong(0)) << qVariantFromValue(ulong(0)) << 0;
- QTest::newRow("ulong2") << qVariantFromValue(ULONG_MAX) << qVariantFromValue(ULONG_MAX) << 0;
- QTest::newRow("ulong3") << qVariantFromValue(ulong(0)) << qVariantFromValue(ULONG_MAX) << -1;
- QTest::newRow("ulong4") << qVariantFromValue(ULONG_MAX) << qVariantFromValue(ulong(0)) << +1;
-
- QTest::newRow("llong1") << qVariantFromValue(qlonglong(0)) << qVariantFromValue(qlonglong(0)) << 0;
- QTest::newRow("llong2") << qVariantFromValue(LLONG_MAX) << qVariantFromValue(LLONG_MAX) << 0;
- QTest::newRow("llong3") << qVariantFromValue(LLONG_MIN) << qVariantFromValue(LLONG_MIN) << 0;
- QTest::newRow("llong4") << qVariantFromValue(LLONG_MIN) << qVariantFromValue(LLONG_MAX) << -1;
- QTest::newRow("llong5") << qVariantFromValue(LLONG_MAX) << qVariantFromValue(LLONG_MIN) << +1;
-
- QTest::newRow("ullong1") << qVariantFromValue(qulonglong(0)) << qVariantFromValue(qulonglong(0)) << 0;
- QTest::newRow("ullong2") << qVariantFromValue(ULLONG_MAX) << qVariantFromValue(ULLONG_MAX) << 0;
- QTest::newRow("ullong3") << qVariantFromValue(qulonglong(0)) << qVariantFromValue(ULLONG_MAX) << -1;
- QTest::newRow("ullong4") << qVariantFromValue(ULLONG_MAX) << qVariantFromValue(qulonglong(0)) << +1;
-
- QTest::newRow("float1") << qVariantFromValue(0.f) << qVariantFromValue(0.f) << 0;
- QTest::newRow("float2") << qVariantFromValue(-1.f) << qVariantFromValue(0.f) << -1;
- QTest::newRow("float3") << qVariantFromValue(0.f) << qVariantFromValue(-1.f) << +1;
- QTest::newRow("float4") << qVariantFromValue(-float(qInf())) << qVariantFromValue(0.f) << -1;
- QTest::newRow("float5") << qVariantFromValue(0.f) << qVariantFromValue(-float(qInf())) << +1;
- QTest::newRow("float6") << qVariantFromValue(-float(qInf())) << qVariantFromValue(-float(qInf())) << 0;
- QTest::newRow("float7") << qVariantFromValue(float(qInf())) << qVariantFromValue(float(qInf())) << 0;
-
- QTest::newRow("double1") << qVariantFromValue(0.) << qVariantFromValue(0.) << 0;
- QTest::newRow("double2") << qVariantFromValue(-1.) << qVariantFromValue(0.) << -1;
- QTest::newRow("double3") << qVariantFromValue(0.) << qVariantFromValue(-1.) << +1;
- QTest::newRow("double4") << qVariantFromValue(-qInf()) << qVariantFromValue(0.) << -1;
- QTest::newRow("double5") << qVariantFromValue(0.) << qVariantFromValue(-qInf()) << +1;
- QTest::newRow("double6") << qVariantFromValue(-double(qInf())) << qVariantFromValue(-qInf()) << 0;
- QTest::newRow("double7") << qVariantFromValue(qInf()) << qVariantFromValue(qInf()) << 0;
- QTest::newRow("double8") << qVariantFromValue(-qInf()) << qVariantFromValue(qInf()) << -1;
- QTest::newRow("double9") << qVariantFromValue(qQNaN()) << qVariantFromValue(0.) << INT_MAX;
- QTest::newRow("double10") << qVariantFromValue(0.) << qVariantFromValue(qQNaN()) << INT_MAX;
- QTest::newRow("double11") << qVariantFromValue(qQNaN()) << qVariantFromValue(qQNaN()) << INT_MAX;
+ QTest::newRow("char1") << QVariant::fromValue(char(0)) << QVariant::fromValue(char(0)) << 0;
+ QTest::newRow("char2") << QVariant::fromValue(CHAR_MAX) << QVariant::fromValue(CHAR_MAX) << 0;
+ QTest::newRow("char3") << QVariant::fromValue(CHAR_MIN) << QVariant::fromValue(CHAR_MIN) << 0;
+ QTest::newRow("char4") << QVariant::fromValue(CHAR_MIN) << QVariant::fromValue(CHAR_MAX) << -1;
+ QTest::newRow("char5") << QVariant::fromValue(CHAR_MAX) << QVariant::fromValue(CHAR_MIN) << +1;
+
+ QTest::newRow("schar1") << QVariant::fromValue(schar(0)) << QVariant::fromValue(schar(0)) << 0;
+ QTest::newRow("schar2") << QVariant::fromValue(SCHAR_MAX) << QVariant::fromValue(SCHAR_MAX) << 0;
+ QTest::newRow("schar3") << QVariant::fromValue(SCHAR_MIN) << QVariant::fromValue(SCHAR_MIN) << 0;
+ QTest::newRow("schar4") << QVariant::fromValue(SCHAR_MIN) << QVariant::fromValue(SCHAR_MAX) << -1;
+ QTest::newRow("schar5") << QVariant::fromValue(SCHAR_MAX) << QVariant::fromValue(SCHAR_MIN) << +1;
+
+ QTest::newRow("uchar1") << QVariant::fromValue(uchar(0)) << QVariant::fromValue(uchar(0)) << 0;
+ QTest::newRow("uchar2") << QVariant::fromValue(UCHAR_MAX) << QVariant::fromValue(UCHAR_MAX) << 0;
+ QTest::newRow("uchar3") << QVariant::fromValue(uchar(0)) << QVariant::fromValue(UCHAR_MAX) << -1;
+ QTest::newRow("uchar4") << QVariant::fromValue(UCHAR_MAX) << QVariant::fromValue(uchar(0)) << +1;
+
+ QTest::newRow("short1") << QVariant::fromValue(short(0)) << QVariant::fromValue(short(0)) << 0;
+ QTest::newRow("short2") << QVariant::fromValue(SHRT_MAX) << QVariant::fromValue(SHRT_MAX) << 0;
+ QTest::newRow("short3") << QVariant::fromValue(SHRT_MIN) << QVariant::fromValue(SHRT_MIN) << 0;
+ QTest::newRow("short4") << QVariant::fromValue(SHRT_MIN) << QVariant::fromValue(SHRT_MAX) << -1;
+ QTest::newRow("short5") << QVariant::fromValue(SHRT_MAX) << QVariant::fromValue(SHRT_MIN) << +1;
+
+ QTest::newRow("ushort1") << QVariant::fromValue(ushort(0)) << QVariant::fromValue(ushort(0)) << 0;
+ QTest::newRow("ushort2") << QVariant::fromValue(USHRT_MAX) << QVariant::fromValue(USHRT_MAX) << 0;
+ QTest::newRow("ushort3") << QVariant::fromValue(ushort(0)) << QVariant::fromValue(USHRT_MAX) << -1;
+ QTest::newRow("ushort4") << QVariant::fromValue(USHRT_MAX) << QVariant::fromValue(ushort(0)) << +1;
+
+ QTest::newRow("int1") << QVariant::fromValue(int(0)) << QVariant::fromValue(int(0)) << 0;
+ QTest::newRow("int2") << QVariant::fromValue(INT_MAX) << QVariant::fromValue(INT_MAX) << 0;
+ QTest::newRow("int3") << QVariant::fromValue(INT_MIN) << QVariant::fromValue(INT_MIN) << 0;
+ QTest::newRow("int4") << QVariant::fromValue(INT_MIN) << QVariant::fromValue(INT_MAX) << -1;
+ QTest::newRow("int5") << QVariant::fromValue(INT_MAX) << QVariant::fromValue(INT_MIN) << +1;
+
+ QTest::newRow("uint1") << QVariant::fromValue(uint(0)) << QVariant::fromValue(uint(0)) << 0;
+ QTest::newRow("uint2") << QVariant::fromValue(UINT_MAX) << QVariant::fromValue(UINT_MAX) << 0;
+ QTest::newRow("uint3") << QVariant::fromValue(uint(0)) << QVariant::fromValue(UINT_MAX) << -1;
+ QTest::newRow("uint4") << QVariant::fromValue(UINT_MAX) << QVariant::fromValue(uint(0)) << +1;
+
+ QTest::newRow("long1") << QVariant::fromValue(long(0)) << QVariant::fromValue(long(0)) << 0;
+ QTest::newRow("long2") << QVariant::fromValue(LONG_MAX) << QVariant::fromValue(LONG_MAX) << 0;
+ QTest::newRow("long3") << QVariant::fromValue(LONG_MIN) << QVariant::fromValue(LONG_MIN) << 0;
+ QTest::newRow("long4") << QVariant::fromValue(LONG_MIN) << QVariant::fromValue(LONG_MAX) << -1;
+ QTest::newRow("long5") << QVariant::fromValue(LONG_MAX) << QVariant::fromValue(LONG_MIN) << +1;
+
+ QTest::newRow("ulong1") << QVariant::fromValue(ulong(0)) << QVariant::fromValue(ulong(0)) << 0;
+ QTest::newRow("ulong2") << QVariant::fromValue(ULONG_MAX) << QVariant::fromValue(ULONG_MAX) << 0;
+ QTest::newRow("ulong3") << QVariant::fromValue(ulong(0)) << QVariant::fromValue(ULONG_MAX) << -1;
+ QTest::newRow("ulong4") << QVariant::fromValue(ULONG_MAX) << QVariant::fromValue(ulong(0)) << +1;
+
+ QTest::newRow("llong1") << QVariant::fromValue(qlonglong(0)) << QVariant::fromValue(qlonglong(0)) << 0;
+ QTest::newRow("llong2") << QVariant::fromValue(LLONG_MAX) << QVariant::fromValue(LLONG_MAX) << 0;
+ QTest::newRow("llong3") << QVariant::fromValue(LLONG_MIN) << QVariant::fromValue(LLONG_MIN) << 0;
+ QTest::newRow("llong4") << QVariant::fromValue(LLONG_MIN) << QVariant::fromValue(LLONG_MAX) << -1;
+ QTest::newRow("llong5") << QVariant::fromValue(LLONG_MAX) << QVariant::fromValue(LLONG_MIN) << +1;
+
+ QTest::newRow("ullong1") << QVariant::fromValue(qulonglong(0)) << QVariant::fromValue(qulonglong(0)) << 0;
+ QTest::newRow("ullong2") << QVariant::fromValue(ULLONG_MAX) << QVariant::fromValue(ULLONG_MAX) << 0;
+ QTest::newRow("ullong3") << QVariant::fromValue(qulonglong(0)) << QVariant::fromValue(ULLONG_MAX) << -1;
+ QTest::newRow("ullong4") << QVariant::fromValue(ULLONG_MAX) << QVariant::fromValue(qulonglong(0)) << +1;
+
+ QTest::newRow("float1") << QVariant::fromValue(0.f) << QVariant::fromValue(0.f) << 0;
+ QTest::newRow("float2") << QVariant::fromValue(-1.f) << QVariant::fromValue(0.f) << -1;
+ QTest::newRow("float3") << QVariant::fromValue(0.f) << QVariant::fromValue(-1.f) << +1;
+ QTest::newRow("float4") << QVariant::fromValue(-float(qInf())) << QVariant::fromValue(0.f) << -1;
+ QTest::newRow("float5") << QVariant::fromValue(0.f) << QVariant::fromValue(-float(qInf())) << +1;
+ QTest::newRow("float6") << QVariant::fromValue(-float(qInf())) << QVariant::fromValue(-float(qInf())) << 0;
+ QTest::newRow("float7") << QVariant::fromValue(float(qInf())) << QVariant::fromValue(float(qInf())) << 0;
+
+ QTest::newRow("double1") << QVariant::fromValue(0.) << QVariant::fromValue(0.) << 0;
+ QTest::newRow("double2") << QVariant::fromValue(-1.) << QVariant::fromValue(0.) << -1;
+ QTest::newRow("double3") << QVariant::fromValue(0.) << QVariant::fromValue(-1.) << +1;
+ QTest::newRow("double4") << QVariant::fromValue(-qInf()) << QVariant::fromValue(0.) << -1;
+ QTest::newRow("double5") << QVariant::fromValue(0.) << QVariant::fromValue(-qInf()) << +1;
+ QTest::newRow("double6") << QVariant::fromValue(-double(qInf())) << QVariant::fromValue(-qInf()) << 0;
+ QTest::newRow("double7") << QVariant::fromValue(qInf()) << QVariant::fromValue(qInf()) << 0;
+ QTest::newRow("double8") << QVariant::fromValue(-qInf()) << QVariant::fromValue(qInf()) << -1;
+ QTest::newRow("double9") << QVariant::fromValue(qQNaN()) << QVariant::fromValue(0.) << INT_MAX;
+ QTest::newRow("double10") << QVariant::fromValue(0.) << QVariant::fromValue(qQNaN()) << INT_MAX;
+ QTest::newRow("double11") << QVariant::fromValue(qQNaN()) << QVariant::fromValue(qQNaN()) << INT_MAX;
// mixed comparisons
// fp + fp
- QTest::newRow("float+double1") << qVariantFromValue(0.f) << qVariantFromValue(0.) << 0;
- QTest::newRow("float+double2") << qVariantFromValue(-1.f) << qVariantFromValue(0.) << -1;
- QTest::newRow("float+double3") << qVariantFromValue(0.f) << qVariantFromValue(-1.) << +1;
- QTest::newRow("float+double4") << qVariantFromValue(-float(qInf())) << qVariantFromValue(0.) << -1;
- QTest::newRow("float+double5") << qVariantFromValue(0.f) << qVariantFromValue(-qInf()) << +1;
- QTest::newRow("float+double6") << qVariantFromValue(-float(qInf())) << qVariantFromValue(-qInf()) << 0;
- QTest::newRow("float+double7") << qVariantFromValue(float(qInf())) << qVariantFromValue(qInf()) << 0;
- QTest::newRow("float+double8") << qVariantFromValue(-float(qInf())) << qVariantFromValue(qInf()) << -1;
- QTest::newRow("float+double9") << qVariantFromValue(qQNaN()) << qVariantFromValue(0.) << INT_MAX;
- QTest::newRow("float+double10") << qVariantFromValue(0.) << qVariantFromValue(qQNaN()) << INT_MAX;
- QTest::newRow("float+double11") << qVariantFromValue(qQNaN()) << qVariantFromValue(qQNaN()) << INT_MAX;
+ QTest::newRow("float+double1") << QVariant::fromValue(0.f) << QVariant::fromValue(0.) << 0;
+ QTest::newRow("float+double2") << QVariant::fromValue(-1.f) << QVariant::fromValue(0.) << -1;
+ QTest::newRow("float+double3") << QVariant::fromValue(0.f) << QVariant::fromValue(-1.) << +1;
+ QTest::newRow("float+double4") << QVariant::fromValue(-float(qInf())) << QVariant::fromValue(0.) << -1;
+ QTest::newRow("float+double5") << QVariant::fromValue(0.f) << QVariant::fromValue(-qInf()) << +1;
+ QTest::newRow("float+double6") << QVariant::fromValue(-float(qInf())) << QVariant::fromValue(-qInf()) << 0;
+ QTest::newRow("float+double7") << QVariant::fromValue(float(qInf())) << QVariant::fromValue(qInf()) << 0;
+ QTest::newRow("float+double8") << QVariant::fromValue(-float(qInf())) << QVariant::fromValue(qInf()) << -1;
+ QTest::newRow("float+double9") << QVariant::fromValue(qQNaN()) << QVariant::fromValue(0.) << INT_MAX;
+ QTest::newRow("float+double10") << QVariant::fromValue(0.) << QVariant::fromValue(qQNaN()) << INT_MAX;
+ QTest::newRow("float+double11") << QVariant::fromValue(qQNaN()) << QVariant::fromValue(qQNaN()) << INT_MAX;
// fp + int
- QTest::newRow("float+int1") << qVariantFromValue(0.f) << qVariantFromValue(0) << 0;
- QTest::newRow("double+int1") << qVariantFromValue(0.) << qVariantFromValue(0) << 0;
- QTest::newRow("float+int2") << qVariantFromValue(-1.f) << qVariantFromValue(0) << -1;
- QTest::newRow("double+int2") << qVariantFromValue(-1.) << qVariantFromValue(0) << -1;
- QTest::newRow("float+int3") << qVariantFromValue(0.f) << qVariantFromValue(-1) << +1;
- QTest::newRow("double+int3") << qVariantFromValue(0.) << qVariantFromValue(-1) << +1;
- QTest::newRow("float+int4") << qVariantFromValue(1.5f) << qVariantFromValue(1) << +1;
- QTest::newRow("double+int4") << qVariantFromValue(1.5) << qVariantFromValue(1) << +1;
- QTest::newRow("double+int5") << qVariantFromValue(qInf()) << qVariantFromValue(1) << +1;
+ QTest::newRow("float+int1") << QVariant::fromValue(0.f) << QVariant::fromValue(0) << 0;
+ QTest::newRow("double+int1") << QVariant::fromValue(0.) << QVariant::fromValue(0) << 0;
+ QTest::newRow("float+int2") << QVariant::fromValue(-1.f) << QVariant::fromValue(0) << -1;
+ QTest::newRow("double+int2") << QVariant::fromValue(-1.) << QVariant::fromValue(0) << -1;
+ QTest::newRow("float+int3") << QVariant::fromValue(0.f) << QVariant::fromValue(-1) << +1;
+ QTest::newRow("double+int3") << QVariant::fromValue(0.) << QVariant::fromValue(-1) << +1;
+ QTest::newRow("float+int4") << QVariant::fromValue(1.5f) << QVariant::fromValue(1) << +1;
+ QTest::newRow("double+int4") << QVariant::fromValue(1.5) << QVariant::fromValue(1) << +1;
+ QTest::newRow("double+int5") << QVariant::fromValue(qInf()) << QVariant::fromValue(1) << +1;
// fp + uint
- QTest::newRow("float+uint1") << qVariantFromValue(0.f) << qVariantFromValue(0U) << 0;
- QTest::newRow("double+uint1") << qVariantFromValue(0.) << qVariantFromValue(0U) << 0;
- QTest::newRow("float+uint2") << qVariantFromValue(-1.f) << qVariantFromValue(0U) << -1;
- QTest::newRow("double+uint2") << qVariantFromValue(-1.) << qVariantFromValue(0U) << -1;
- QTest::newRow("float+uint3") << qVariantFromValue(0.f) << qVariantFromValue(1U) << -1;
- QTest::newRow("double+uint3") << qVariantFromValue(0.) << qVariantFromValue(1U) << -1;
- QTest::newRow("float+uint4") << qVariantFromValue(1.5f) << qVariantFromValue(1U) << +1;
- QTest::newRow("double+uint4") << qVariantFromValue(1.5) << qVariantFromValue(1U) << +1;
+ QTest::newRow("float+uint1") << QVariant::fromValue(0.f) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("double+uint1") << QVariant::fromValue(0.) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("float+uint2") << QVariant::fromValue(-1.f) << QVariant::fromValue(0U) << -1;
+ QTest::newRow("double+uint2") << QVariant::fromValue(-1.) << QVariant::fromValue(0U) << -1;
+ QTest::newRow("float+uint3") << QVariant::fromValue(0.f) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("double+uint3") << QVariant::fromValue(0.) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("float+uint4") << QVariant::fromValue(1.5f) << QVariant::fromValue(1U) << +1;
+ QTest::newRow("double+uint4") << QVariant::fromValue(1.5) << QVariant::fromValue(1U) << +1;
// lower ranked + int
- QTest::newRow("bool+int1") << qVariantFromValue(false) << qVariantFromValue(0) << 0;
- QTest::newRow("bool+int2") << qVariantFromValue(false) << qVariantFromValue(1) << -1;
- QTest::newRow("bool+int3") << qVariantFromValue(true) << qVariantFromValue(0) << +1;
- QTest::newRow("bool+int4") << qVariantFromValue(true) << qVariantFromValue(1) << 0;
- QTest::newRow("bool+int5") << qVariantFromValue(true) << qVariantFromValue(2) << -1;
-
- QTest::newRow("char+int1") << qVariantFromValue(char(0)) << qVariantFromValue(0) << 0;
- QTest::newRow("char+int2") << qVariantFromValue(char(0)) << qVariantFromValue(1) << -1;
- QTest::newRow("char+int3") << qVariantFromValue(char(1)) << qVariantFromValue(0) << +1;
- QTest::newRow("char+int4") << qVariantFromValue(char(1)) << qVariantFromValue(1) << 0;
+ QTest::newRow("bool+int1") << QVariant::fromValue(false) << QVariant::fromValue(0) << 0;
+ QTest::newRow("bool+int2") << QVariant::fromValue(false) << QVariant::fromValue(1) << -1;
+ QTest::newRow("bool+int3") << QVariant::fromValue(true) << QVariant::fromValue(0) << +1;
+ QTest::newRow("bool+int4") << QVariant::fromValue(true) << QVariant::fromValue(1) << 0;
+ QTest::newRow("bool+int5") << QVariant::fromValue(true) << QVariant::fromValue(2) << -1;
+
+ QTest::newRow("char+int1") << QVariant::fromValue(char(0)) << QVariant::fromValue(0) << 0;
+ QTest::newRow("char+int2") << QVariant::fromValue(char(0)) << QVariant::fromValue(1) << -1;
+ QTest::newRow("char+int3") << QVariant::fromValue(char(1)) << QVariant::fromValue(0) << +1;
+ QTest::newRow("char+int4") << QVariant::fromValue(char(1)) << QVariant::fromValue(1) << 0;
if (std::numeric_limits<char>::is_signed) {
- QTest::newRow("char+int5") << qVariantFromValue(char(-1)) << qVariantFromValue(0) << -1;
- QTest::newRow("char+int6") << qVariantFromValue(char(-1)) << qVariantFromValue(-1) << 0;
- }
-
- QTest::newRow("schar+int1") << qVariantFromValue(schar(0)) << qVariantFromValue(0) << 0;
- QTest::newRow("schar+int2") << qVariantFromValue(schar(0)) << qVariantFromValue(1) << -1;
- QTest::newRow("schar+int3") << qVariantFromValue(schar(1)) << qVariantFromValue(0) << +1;
- QTest::newRow("schar+int4") << qVariantFromValue(schar(1)) << qVariantFromValue(1) << 0;
- QTest::newRow("schar+int5") << qVariantFromValue(schar(-1)) << qVariantFromValue(0) << -1;
- QTest::newRow("schar+int6") << qVariantFromValue(schar(-1)) << qVariantFromValue(-1) << 0;
-
- QTest::newRow("uchar+int1") << qVariantFromValue(uchar(0)) << qVariantFromValue(0) << 0;
- QTest::newRow("uchar+int2") << qVariantFromValue(uchar(0)) << qVariantFromValue(1) << -1;
- QTest::newRow("uchar+int3") << qVariantFromValue(uchar(1)) << qVariantFromValue(0) << +1;
- QTest::newRow("uchar+int4") << qVariantFromValue(uchar(1)) << qVariantFromValue(1) << 0;
-
- QTest::newRow("short+int1") << qVariantFromValue(short(0)) << qVariantFromValue(0) << 0;
- QTest::newRow("short+int2") << qVariantFromValue(short(0)) << qVariantFromValue(1) << -1;
- QTest::newRow("short+int3") << qVariantFromValue(short(1)) << qVariantFromValue(0) << +1;
- QTest::newRow("short+int4") << qVariantFromValue(short(1)) << qVariantFromValue(1) << 0;
- QTest::newRow("short+int5") << qVariantFromValue(short(-1)) << qVariantFromValue(0) << -1;
- QTest::newRow("short+int6") << qVariantFromValue(short(-1)) << qVariantFromValue(-1) << 0;
-
- QTest::newRow("ushort+int1") << qVariantFromValue(ushort(0)) << qVariantFromValue(0) << 0;
- QTest::newRow("ushort+int2") << qVariantFromValue(ushort(0)) << qVariantFromValue(1) << -1;
- QTest::newRow("ushort+int3") << qVariantFromValue(ushort(1)) << qVariantFromValue(0) << +1;
- QTest::newRow("ushort+int4") << qVariantFromValue(ushort(1)) << qVariantFromValue(1) << 0;
+ QTest::newRow("char+int5") << QVariant::fromValue(char(-1)) << QVariant::fromValue(0) << -1;
+ QTest::newRow("char+int6") << QVariant::fromValue(char(-1)) << QVariant::fromValue(-1) << 0;
+ }
+
+ QTest::newRow("schar+int1") << QVariant::fromValue(schar(0)) << QVariant::fromValue(0) << 0;
+ QTest::newRow("schar+int2") << QVariant::fromValue(schar(0)) << QVariant::fromValue(1) << -1;
+ QTest::newRow("schar+int3") << QVariant::fromValue(schar(1)) << QVariant::fromValue(0) << +1;
+ QTest::newRow("schar+int4") << QVariant::fromValue(schar(1)) << QVariant::fromValue(1) << 0;
+ QTest::newRow("schar+int5") << QVariant::fromValue(schar(-1)) << QVariant::fromValue(0) << -1;
+ QTest::newRow("schar+int6") << QVariant::fromValue(schar(-1)) << QVariant::fromValue(-1) << 0;
+
+ QTest::newRow("uchar+int1") << QVariant::fromValue(uchar(0)) << QVariant::fromValue(0) << 0;
+ QTest::newRow("uchar+int2") << QVariant::fromValue(uchar(0)) << QVariant::fromValue(1) << -1;
+ QTest::newRow("uchar+int3") << QVariant::fromValue(uchar(1)) << QVariant::fromValue(0) << +1;
+ QTest::newRow("uchar+int4") << QVariant::fromValue(uchar(1)) << QVariant::fromValue(1) << 0;
+
+ QTest::newRow("short+int1") << QVariant::fromValue(short(0)) << QVariant::fromValue(0) << 0;
+ QTest::newRow("short+int2") << QVariant::fromValue(short(0)) << QVariant::fromValue(1) << -1;
+ QTest::newRow("short+int3") << QVariant::fromValue(short(1)) << QVariant::fromValue(0) << +1;
+ QTest::newRow("short+int4") << QVariant::fromValue(short(1)) << QVariant::fromValue(1) << 0;
+ QTest::newRow("short+int5") << QVariant::fromValue(short(-1)) << QVariant::fromValue(0) << -1;
+ QTest::newRow("short+int6") << QVariant::fromValue(short(-1)) << QVariant::fromValue(-1) << 0;
+
+ QTest::newRow("ushort+int1") << QVariant::fromValue(ushort(0)) << QVariant::fromValue(0) << 0;
+ QTest::newRow("ushort+int2") << QVariant::fromValue(ushort(0)) << QVariant::fromValue(1) << -1;
+ QTest::newRow("ushort+int3") << QVariant::fromValue(ushort(1)) << QVariant::fromValue(0) << +1;
+ QTest::newRow("ushort+int4") << QVariant::fromValue(ushort(1)) << QVariant::fromValue(1) << 0;
// lower ranked + uint (without sign change)
- QTest::newRow("bool+uint1") << qVariantFromValue(false) << qVariantFromValue(0U) << 0;
- QTest::newRow("bool+uint2") << qVariantFromValue(false) << qVariantFromValue(1U) << -1;
- QTest::newRow("bool+uint3") << qVariantFromValue(true) << qVariantFromValue(0U) << +1;
- QTest::newRow("bool+uint4") << qVariantFromValue(true) << qVariantFromValue(1U) << 0;
- QTest::newRow("bool+uint5") << qVariantFromValue(true) << qVariantFromValue(2U) << -1;
-
- QTest::newRow("char+uint1") << qVariantFromValue(char(0)) << qVariantFromValue(0U) << 0;
- QTest::newRow("char+uint2") << qVariantFromValue(char(0)) << qVariantFromValue(1U) << -1;
- QTest::newRow("char+uint3") << qVariantFromValue(char(1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("char+uint4") << qVariantFromValue(char(1)) << qVariantFromValue(1U) << 0;
-
- QTest::newRow("schar+uint1") << qVariantFromValue(schar(0)) << qVariantFromValue(0U) << 0;
- QTest::newRow("schar+uint2") << qVariantFromValue(schar(0)) << qVariantFromValue(1U) << -1;
- QTest::newRow("schar+uint3") << qVariantFromValue(schar(1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("schar+uint4") << qVariantFromValue(schar(1)) << qVariantFromValue(1U) << 0;
-
- QTest::newRow("uchar+uint1") << qVariantFromValue(uchar(0)) << qVariantFromValue(0U) << 0;
- QTest::newRow("uchar+uint2") << qVariantFromValue(uchar(0)) << qVariantFromValue(1U) << -1;
- QTest::newRow("uchar+uint3") << qVariantFromValue(uchar(1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("uchar+uint4") << qVariantFromValue(uchar(1)) << qVariantFromValue(1U) << 0;
-
- QTest::newRow("short+uint1") << qVariantFromValue(short(0)) << qVariantFromValue(0U) << 0;
- QTest::newRow("short+uint2") << qVariantFromValue(short(0)) << qVariantFromValue(1U) << -1;
- QTest::newRow("short+uint3") << qVariantFromValue(short(1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("short+uint4") << qVariantFromValue(short(1)) << qVariantFromValue(1U) << 0;
-
- QTest::newRow("ushort+uint1") << qVariantFromValue(ushort(0)) << qVariantFromValue(0U) << 0;
- QTest::newRow("ushort+uint2") << qVariantFromValue(ushort(0)) << qVariantFromValue(1U) << -1;
- QTest::newRow("ushort+uint3") << qVariantFromValue(ushort(1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("ushort+uint4") << qVariantFromValue(ushort(1)) << qVariantFromValue(1U) << 0;
+ QTest::newRow("bool+uint1") << QVariant::fromValue(false) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("bool+uint2") << QVariant::fromValue(false) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("bool+uint3") << QVariant::fromValue(true) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("bool+uint4") << QVariant::fromValue(true) << QVariant::fromValue(1U) << 0;
+ QTest::newRow("bool+uint5") << QVariant::fromValue(true) << QVariant::fromValue(2U) << -1;
+
+ QTest::newRow("char+uint1") << QVariant::fromValue(char(0)) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("char+uint2") << QVariant::fromValue(char(0)) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("char+uint3") << QVariant::fromValue(char(1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("char+uint4") << QVariant::fromValue(char(1)) << QVariant::fromValue(1U) << 0;
+
+ QTest::newRow("schar+uint1") << QVariant::fromValue(schar(0)) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("schar+uint2") << QVariant::fromValue(schar(0)) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("schar+uint3") << QVariant::fromValue(schar(1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("schar+uint4") << QVariant::fromValue(schar(1)) << QVariant::fromValue(1U) << 0;
+
+ QTest::newRow("uchar+uint1") << QVariant::fromValue(uchar(0)) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("uchar+uint2") << QVariant::fromValue(uchar(0)) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("uchar+uint3") << QVariant::fromValue(uchar(1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("uchar+uint4") << QVariant::fromValue(uchar(1)) << QVariant::fromValue(1U) << 0;
+
+ QTest::newRow("short+uint1") << QVariant::fromValue(short(0)) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("short+uint2") << QVariant::fromValue(short(0)) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("short+uint3") << QVariant::fromValue(short(1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("short+uint4") << QVariant::fromValue(short(1)) << QVariant::fromValue(1U) << 0;
+
+ QTest::newRow("ushort+uint1") << QVariant::fromValue(ushort(0)) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("ushort+uint2") << QVariant::fromValue(ushort(0)) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("ushort+uint3") << QVariant::fromValue(ushort(1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("ushort+uint4") << QVariant::fromValue(ushort(1)) << QVariant::fromValue(1U) << 0;
// int + qlonglong
- QTest::newRow("int+qlonglong1") << qVariantFromValue(0) << qVariantFromValue(Q_INT64_C(0)) << 0;
- QTest::newRow("int+qlonglong2") << qVariantFromValue(1) << qVariantFromValue(Q_INT64_C(0)) << +1;
- QTest::newRow("int+qlonglong3") << qVariantFromValue(0) << qVariantFromValue(Q_INT64_C(1)) << -1;
- QTest::newRow("int+qlonglong4") << qVariantFromValue(1) << qVariantFromValue(Q_INT64_C(1)) << 0;
- QTest::newRow("int+qlonglong5") << qVariantFromValue(0) << qVariantFromValue(Q_INT64_C(-1)) << +1;
- QTest::newRow("int+qlonglong6") << qVariantFromValue(-1) << qVariantFromValue(Q_INT64_C(0)) << -1;
- QTest::newRow("int+qlonglong7") << qVariantFromValue(-1) << qVariantFromValue(Q_INT64_C(-1)) << 0;
+ QTest::newRow("int+qlonglong1") << QVariant::fromValue(0) << QVariant::fromValue(Q_INT64_C(0)) << 0;
+ QTest::newRow("int+qlonglong2") << QVariant::fromValue(1) << QVariant::fromValue(Q_INT64_C(0)) << +1;
+ QTest::newRow("int+qlonglong3") << QVariant::fromValue(0) << QVariant::fromValue(Q_INT64_C(1)) << -1;
+ QTest::newRow("int+qlonglong4") << QVariant::fromValue(1) << QVariant::fromValue(Q_INT64_C(1)) << 0;
+ QTest::newRow("int+qlonglong5") << QVariant::fromValue(0) << QVariant::fromValue(Q_INT64_C(-1)) << +1;
+ QTest::newRow("int+qlonglong6") << QVariant::fromValue(-1) << QVariant::fromValue(Q_INT64_C(0)) << -1;
+ QTest::newRow("int+qlonglong7") << QVariant::fromValue(-1) << QVariant::fromValue(Q_INT64_C(-1)) << 0;
// uint + qulonglong
- QTest::newRow("uint+qulonglong1") << qVariantFromValue(0U) << qVariantFromValue(Q_UINT64_C(0)) << 0;
- QTest::newRow("uint+qulonglong2") << qVariantFromValue(1U) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("uint+qulonglong3") << qVariantFromValue(0U) << qVariantFromValue(Q_UINT64_C(1)) << -1;
- QTest::newRow("uint+qulonglong4") << qVariantFromValue(1U) << qVariantFromValue(Q_UINT64_C(1)) << 0;
+ QTest::newRow("uint+qulonglong1") << QVariant::fromValue(0U) << QVariant::fromValue(Q_UINT64_C(0)) << 0;
+ QTest::newRow("uint+qulonglong2") << QVariant::fromValue(1U) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("uint+qulonglong3") << QVariant::fromValue(0U) << QVariant::fromValue(Q_UINT64_C(1)) << -1;
+ QTest::newRow("uint+qulonglong4") << QVariant::fromValue(1U) << QVariant::fromValue(Q_UINT64_C(1)) << 0;
// int + uint (without sign change)
- QTest::newRow("int+uint1") << qVariantFromValue(0) << qVariantFromValue(0U) << 0;
- QTest::newRow("int+uint2") << qVariantFromValue(1) << qVariantFromValue(0U) << +1;
- QTest::newRow("int+uint3") << qVariantFromValue(0) << qVariantFromValue(1U) << -1;
- QTest::newRow("int+uint4") << qVariantFromValue(1) << qVariantFromValue(1U) << 0;
+ QTest::newRow("int+uint1") << QVariant::fromValue(0) << QVariant::fromValue(0U) << 0;
+ QTest::newRow("int+uint2") << QVariant::fromValue(1) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("int+uint3") << QVariant::fromValue(0) << QVariant::fromValue(1U) << -1;
+ QTest::newRow("int+uint4") << QVariant::fromValue(1) << QVariant::fromValue(1U) << 0;
// uint + qlonglong
- QTest::newRow("uint+qlonglong1") << qVariantFromValue(0U) << qVariantFromValue(Q_INT64_C(0)) << 0;
- QTest::newRow("uint+qlonglong2") << qVariantFromValue(1U) << qVariantFromValue(Q_INT64_C(0)) << +1;
- QTest::newRow("uint+qlonglong3") << qVariantFromValue(0U) << qVariantFromValue(Q_INT64_C(1)) << -1;
- QTest::newRow("uint+qlonglong4") << qVariantFromValue(1U) << qVariantFromValue(Q_INT64_C(1)) << 0;
- QTest::newRow("uint+qlonglong5") << qVariantFromValue(0U) << qVariantFromValue(Q_INT64_C(-1)) << +1;
+ QTest::newRow("uint+qlonglong1") << QVariant::fromValue(0U) << QVariant::fromValue(Q_INT64_C(0)) << 0;
+ QTest::newRow("uint+qlonglong2") << QVariant::fromValue(1U) << QVariant::fromValue(Q_INT64_C(0)) << +1;
+ QTest::newRow("uint+qlonglong3") << QVariant::fromValue(0U) << QVariant::fromValue(Q_INT64_C(1)) << -1;
+ QTest::newRow("uint+qlonglong4") << QVariant::fromValue(1U) << QVariant::fromValue(Q_INT64_C(1)) << 0;
+ QTest::newRow("uint+qlonglong5") << QVariant::fromValue(0U) << QVariant::fromValue(Q_INT64_C(-1)) << +1;
// boundary conditions
- QTest::newRow("charmax+intmax") << qVariantFromValue(CHAR_MAX) << qVariantFromValue(INT_MAX) << -1;
- QTest::newRow("charmax+uintmax") << qVariantFromValue(CHAR_MAX) << qVariantFromValue(UINT_MAX) << -1;
- QTest::newRow("scharmax+intmax") << qVariantFromValue(SCHAR_MAX) << qVariantFromValue(INT_MAX) << -1;
- QTest::newRow("scharmax+uintmax") << qVariantFromValue(SCHAR_MAX) << qVariantFromValue(UINT_MAX) << -1;
- QTest::newRow("ucharmax+intmax") << qVariantFromValue(UCHAR_MAX) << qVariantFromValue(INT_MAX) << -1;
- QTest::newRow("ucharmax+uintmax") << qVariantFromValue(UCHAR_MAX) << qVariantFromValue(UINT_MAX) << -1;
- QTest::newRow("shortmax+intmax") << qVariantFromValue(SHRT_MAX) << qVariantFromValue(INT_MAX) << -1;
- QTest::newRow("shortmax+uintmax") << qVariantFromValue(SHRT_MAX) << qVariantFromValue(UINT_MAX) << -1;
- QTest::newRow("ushortmax+intmax") << qVariantFromValue(USHRT_MAX) << qVariantFromValue(INT_MAX) << -1;
- QTest::newRow("ushortmax+uintmax") << qVariantFromValue(USHRT_MAX) << qVariantFromValue(UINT_MAX) << -1;
-
- QTest::newRow("intmin+qlonglongmin") << qVariantFromValue(INT_MIN) << qVariantFromValue(LLONG_MIN) << +1;
- QTest::newRow("intmax+uintmax") << qVariantFromValue(INT_MAX) << qVariantFromValue(UINT_MAX) << -1;
- QTest::newRow("intmax+qlonglongmax") << qVariantFromValue(INT_MAX) << qVariantFromValue(LLONG_MAX) << -1;
- QTest::newRow("uintmax+qlonglongmax") << qVariantFromValue(UINT_MAX) << qVariantFromValue(LLONG_MAX) << -1;
- QTest::newRow("intmax+qulonglongmax") << qVariantFromValue(INT_MAX) << qVariantFromValue(ULLONG_MAX) << -1;
- QTest::newRow("qlonglongmax+qulonglongmax") << qVariantFromValue(LLONG_MAX) << qVariantFromValue(ULLONG_MAX) << -1;
- QTest::newRow("uintmax+qlonglongmin") << qVariantFromValue(UINT_MAX) << qVariantFromValue(LLONG_MIN) << +1;
+ QTest::newRow("charmax+intmax") << QVariant::fromValue(CHAR_MAX) << QVariant::fromValue(INT_MAX) << -1;
+ QTest::newRow("charmax+uintmax") << QVariant::fromValue(CHAR_MAX) << QVariant::fromValue(UINT_MAX) << -1;
+ QTest::newRow("scharmax+intmax") << QVariant::fromValue(SCHAR_MAX) << QVariant::fromValue(INT_MAX) << -1;
+ QTest::newRow("scharmax+uintmax") << QVariant::fromValue(SCHAR_MAX) << QVariant::fromValue(UINT_MAX) << -1;
+ QTest::newRow("ucharmax+intmax") << QVariant::fromValue(UCHAR_MAX) << QVariant::fromValue(INT_MAX) << -1;
+ QTest::newRow("ucharmax+uintmax") << QVariant::fromValue(UCHAR_MAX) << QVariant::fromValue(UINT_MAX) << -1;
+ QTest::newRow("shortmax+intmax") << QVariant::fromValue(SHRT_MAX) << QVariant::fromValue(INT_MAX) << -1;
+ QTest::newRow("shortmax+uintmax") << QVariant::fromValue(SHRT_MAX) << QVariant::fromValue(UINT_MAX) << -1;
+ QTest::newRow("ushortmax+intmax") << QVariant::fromValue(USHRT_MAX) << QVariant::fromValue(INT_MAX) << -1;
+ QTest::newRow("ushortmax+uintmax") << QVariant::fromValue(USHRT_MAX) << QVariant::fromValue(UINT_MAX) << -1;
+
+ QTest::newRow("intmin+qlonglongmin") << QVariant::fromValue(INT_MIN) << QVariant::fromValue(LLONG_MIN) << +1;
+ QTest::newRow("intmax+uintmax") << QVariant::fromValue(INT_MAX) << QVariant::fromValue(UINT_MAX) << -1;
+ QTest::newRow("intmax+qlonglongmax") << QVariant::fromValue(INT_MAX) << QVariant::fromValue(LLONG_MAX) << -1;
+ QTest::newRow("uintmax+qlonglongmax") << QVariant::fromValue(UINT_MAX) << QVariant::fromValue(LLONG_MAX) << -1;
+ QTest::newRow("intmax+qulonglongmax") << QVariant::fromValue(INT_MAX) << QVariant::fromValue(ULLONG_MAX) << -1;
+ QTest::newRow("qlonglongmax+qulonglongmax") << QVariant::fromValue(LLONG_MAX) << QVariant::fromValue(ULLONG_MAX) << -1;
+ QTest::newRow("uintmax+qlonglongmin") << QVariant::fromValue(UINT_MAX) << QVariant::fromValue(LLONG_MIN) << +1;
// check for no sign-extension issues
- QTest::newRow("ushortmax+intzero") << qVariantFromValue(USHRT_MAX) << qVariantFromValue(0) << +1;
- QTest::newRow("ushortmax+qlonglongzero") << qVariantFromValue(USHRT_MAX) << qVariantFromValue(Q_INT64_C(0)) << +1;
- QTest::newRow("uintmax+qlonglongzero") << qVariantFromValue(UINT_MAX) << qVariantFromValue(Q_INT64_C(0)) << +1;
+ QTest::newRow("ushortmax+intzero") << QVariant::fromValue(USHRT_MAX) << QVariant::fromValue(0) << +1;
+ QTest::newRow("ushortmax+qlonglongzero") << QVariant::fromValue(USHRT_MAX) << QVariant::fromValue(Q_INT64_C(0)) << +1;
+ QTest::newRow("uintmax+qlonglongzero") << QVariant::fromValue(UINT_MAX) << QVariant::fromValue(Q_INT64_C(0)) << +1;
// sign changes
// the tests below check that a signed negative number sign-changes to a non-zero unsigned number and that
// signed -1 sign-changes to unsigned maximum (all bits set, ~0). This works on two's complement machines
// (all that Qt supports), and would also work on one's complement.
if (std::numeric_limits<char>::is_signed) {
- QTest::newRow("signchange-char+uint") << qVariantFromValue(char(-1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-char+uintmax") << qVariantFromValue(char(-1)) << qVariantFromValue(UINT_MAX) << 0;
- QTest::newRow("signchange-charmin+uint") << qVariantFromValue(CHAR_MIN) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-char+qulonglong") << qVariantFromValue(char(-1)) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-char+qulonglongmax") << qVariantFromValue(char(-1)) << qVariantFromValue(ULLONG_MAX) << 0;
- QTest::newRow("signchange-charmin+qulonglong") << qVariantFromValue(CHAR_MIN) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- }
- QTest::newRow("signchange-schar+uint") << qVariantFromValue(schar(-1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-schar+uintmax") << qVariantFromValue(schar(-1)) << qVariantFromValue(UINT_MAX) << 0;
- QTest::newRow("signchange-scharmin+uint") << qVariantFromValue(SCHAR_MIN) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-schar+qulonglong") << qVariantFromValue(schar(-1)) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-schar+qulonglongmax") << qVariantFromValue(schar(-1)) << qVariantFromValue(ULLONG_MAX) << 0;
- QTest::newRow("signchange-scharmin+qulonglong") << qVariantFromValue(SCHAR_MIN) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-short+uint") << qVariantFromValue(short(-1)) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-short+uintmax") << qVariantFromValue(short(-1)) << qVariantFromValue(UINT_MAX) << 0;
- QTest::newRow("signchange-shortmin+uint") << qVariantFromValue(SHRT_MIN) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-short+qulonglong") << qVariantFromValue(short(-1)) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-short+qulonglongmax") << qVariantFromValue(short(-1)) << qVariantFromValue(ULLONG_MAX) << 0;
- QTest::newRow("signchange-shortmin+qulonglong") << qVariantFromValue(SHRT_MIN) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-int+uint") << qVariantFromValue(-1) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-int+uintmax") << qVariantFromValue(-1) << qVariantFromValue(UINT_MAX) << 0;
- QTest::newRow("signchange-intmin+uint") << qVariantFromValue(INT_MIN) << qVariantFromValue(0U) << +1;
- QTest::newRow("signchange-int+qulonglong") << qVariantFromValue(-1) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-int+qulonglongmax") << qVariantFromValue(-1) << qVariantFromValue(ULLONG_MAX) << 0;
- QTest::newRow("signchange-intmin+qulonglong") << qVariantFromValue(INT_MIN) << qVariantFromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-char+uint") << QVariant::fromValue(char(-1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-char+uintmax") << QVariant::fromValue(char(-1)) << QVariant::fromValue(UINT_MAX) << 0;
+ QTest::newRow("signchange-charmin+uint") << QVariant::fromValue(CHAR_MIN) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-char+qulonglong") << QVariant::fromValue(char(-1)) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-char+qulonglongmax") << QVariant::fromValue(char(-1)) << QVariant::fromValue(ULLONG_MAX) << 0;
+ QTest::newRow("signchange-charmin+qulonglong") << QVariant::fromValue(CHAR_MIN) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ }
+ QTest::newRow("signchange-schar+uint") << QVariant::fromValue(schar(-1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-schar+uintmax") << QVariant::fromValue(schar(-1)) << QVariant::fromValue(UINT_MAX) << 0;
+ QTest::newRow("signchange-scharmin+uint") << QVariant::fromValue(SCHAR_MIN) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-schar+qulonglong") << QVariant::fromValue(schar(-1)) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-schar+qulonglongmax") << QVariant::fromValue(schar(-1)) << QVariant::fromValue(ULLONG_MAX) << 0;
+ QTest::newRow("signchange-scharmin+qulonglong") << QVariant::fromValue(SCHAR_MIN) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-short+uint") << QVariant::fromValue(short(-1)) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-short+uintmax") << QVariant::fromValue(short(-1)) << QVariant::fromValue(UINT_MAX) << 0;
+ QTest::newRow("signchange-shortmin+uint") << QVariant::fromValue(SHRT_MIN) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-short+qulonglong") << QVariant::fromValue(short(-1)) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-short+qulonglongmax") << QVariant::fromValue(short(-1)) << QVariant::fromValue(ULLONG_MAX) << 0;
+ QTest::newRow("signchange-shortmin+qulonglong") << QVariant::fromValue(SHRT_MIN) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-int+uint") << QVariant::fromValue(-1) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-int+uintmax") << QVariant::fromValue(-1) << QVariant::fromValue(UINT_MAX) << 0;
+ QTest::newRow("signchange-intmin+uint") << QVariant::fromValue(INT_MIN) << QVariant::fromValue(0U) << +1;
+ QTest::newRow("signchange-int+qulonglong") << QVariant::fromValue(-1) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-int+qulonglongmax") << QVariant::fromValue(-1) << QVariant::fromValue(ULLONG_MAX) << 0;
+ QTest::newRow("signchange-intmin+qulonglong") << QVariant::fromValue(INT_MIN) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
// no qlonglong+uint, since that should promote to qlonglong and then the comparison is signed (tested above)
- QTest::newRow("signchange-qlonglong+qulonglong") << qVariantFromValue(Q_INT64_C(-1)) << qVariantFromValue(Q_UINT64_C(0)) << +1;
- QTest::newRow("signchange-qlonglong+qulonglongmax") << qVariantFromValue(Q_INT64_C(-1)) << qVariantFromValue(ULLONG_MAX) << 0;
- QTest::newRow("signchange-qlonglongmin+qulonglong") << qVariantFromValue(LLONG_MIN) << qVariantFromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-qlonglong+qulonglong") << QVariant::fromValue(Q_INT64_C(-1)) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
+ QTest::newRow("signchange-qlonglong+qulonglongmax") << QVariant::fromValue(Q_INT64_C(-1)) << QVariant::fromValue(ULLONG_MAX) << 0;
+ QTest::newRow("signchange-qlonglongmin+qulonglong") << QVariant::fromValue(LLONG_MIN) << QVariant::fromValue(Q_UINT64_C(0)) << +1;
}
void tst_QVariant::compareNumbers() const
@@ -2761,6 +2771,14 @@ void tst_QVariant::qvariant_cast_QObject_derived()
QCOMPARE(data.value<CustomQObjectDerived *>(), object);
QCOMPARE(data.value<CustomQObject *>(), object);
}
+ {
+ QObject *object = new CustomQObjectDerivedNoMetaType(this);
+ QVariant data = QVariant::fromValue(object);
+ QVERIFY(data.canConvert<CustomQObjectDerivedNoMetaType*>());
+ QVERIFY(data.convert(qMetaTypeId<CustomQObjectDerivedNoMetaType*>()));
+ QCOMPARE(data.value<CustomQObjectDerivedNoMetaType*>(), object);
+ QCOMPARE(data.isNull(), false);
+ }
}
struct QObjectWrapper
@@ -2861,13 +2879,26 @@ void tst_QVariant::qvariant_cast_QObject_wrapper()
QVERIFY(spVar.canConvert<QObject*>());
QCOMPARE(f, spVar.value<QObject*>());
}
+#if QT_DEPRECATED_SINCE(5, 0)
{
QFile *f = new QFile(this);
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QWeakPointer<QFile> sp(f);
+QT_WARNING_POP
QVariant spVar = QVariant::fromValue(sp);
QVERIFY(spVar.canConvert<QObject*>());
QCOMPARE(f, spVar.value<QObject*>());
}
+#endif
+ {
+ QFile *f = new QFile(this);
+ QSharedPointer<QObject> sp(f);
+ QWeakPointer<QObject> wp = sp;
+ QVariant wpVar = QVariant::fromValue(wp);
+ QVERIFY(wpVar.canConvert<QObject*>());
+ QCOMPARE(f, wpVar.value<QObject*>());
+ }
{
QFile *f = new QFile(this);
QSharedPointer<QFile> sp(f);
@@ -3943,7 +3974,7 @@ void tst_QVariant::userConversion()
QVERIFY(!(QMetaType::hasRegisteredConverterFunction<QString, Convertible>()));
Convertible c = { 123 };
- QVariant v = qVariantFromValue(c);
+ QVariant v = QVariant::fromValue(c);
bool ok;
v.toInt(&ok);
@@ -3977,7 +4008,7 @@ void tst_QVariant::userConversion()
QVERIFY(!(QMetaType::hasRegisteredConverterFunction<QString, BigConvertible>()));
BigConvertible c = { 123, 0, 0 };
- QVariant v = qVariantFromValue(c);
+ QVariant v = QVariant::fromValue(c);
bool ok;
v.toInt(&ok);
@@ -4692,7 +4723,6 @@ Q_DECLARE_METATYPE(EnumTest_Enum0)
enum EnumTest_Enum1 : qint64 { EnumTest_Enum1_value = 42, EnumTest_Enum1_bigValue = (Q_INT64_C(1) << 33) + 50 };
Q_DECLARE_METATYPE(EnumTest_Enum1)
-#if defined(Q_COMPILER_CLASS_ENUM)
enum EnumTest_Enum3 : qint64 { EnumTest_Enum3_value = -47, EnumTest_Enum3_bigValue = (Q_INT64_C(1) << 56) + 5 };
Q_DECLARE_METATYPE(EnumTest_Enum3)
enum EnumTest_Enum4 : quint64 { EnumTest_Enum4_value = 47, EnumTest_Enum4_bigValue = (Q_INT64_C(1) << 52) + 45 };
@@ -4705,7 +4735,6 @@ enum class EnumTest_Enum7 { EnumTest_Enum7_value = 47, ensureSignedEnum7 = -1 };
Q_DECLARE_METATYPE(EnumTest_Enum7)
enum EnumTest_Enum8 : short { EnumTest_Enum8_value = 47 };
Q_DECLARE_METATYPE(EnumTest_Enum8)
-#endif
template<typename Enum> void testVariant(Enum value, bool *ok)
{
@@ -4764,7 +4793,6 @@ void tst_QVariant::enums()
QVERIFY(ok);
testVariant(EnumTest_Enum1_bigValue, &ok);
QVERIFY(ok);
-#if defined(Q_COMPILER_CLASS_ENUM)
testVariant(EnumTest_Enum3::EnumTest_Enum3_value, &ok);
QVERIFY(ok);
testVariant(EnumTest_Enum3::EnumTest_Enum3_bigValue, &ok);
@@ -4783,7 +4811,6 @@ void tst_QVariant::enums()
QVERIFY(ok);
testVariant(EnumTest_Enum3::EnumTest_Enum3_value, &ok);
QVERIFY(ok);
-#endif
}
template<typename Enum> void testVariantMeta(Enum value, bool *ok, const char *string)
diff --git a/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp b/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp
index c74bce3b5b..e1357245f3 100644
--- a/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp
+++ b/tests/auto/corelib/mimetypes/qmimetype/tst_qmimetype.cpp
@@ -91,11 +91,7 @@ static QStringList qMimeTypeGlobPatterns()
// ------------------------------------------------------------------------------------------------
-#ifndef Q_COMPILER_RVALUE_REFS
-QMIMETYPE_BUILDER
-#else
QMIMETYPE_BUILDER_FROM_RVALUE_REFS
-#endif
// ------------------------------------------------------------------------------------------------
diff --git a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro
index c44cd46597..2c3305e872 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib/lib.pro
+++ b/tests/auto/corelib/plugin/qlibrary/lib/lib.pro
@@ -12,7 +12,7 @@ msvc: DEFINES += WIN32_MSVC
target.path = $$[QT_INSTALL_TESTS]/tst_qlibrary
INSTALLS += target
-win32 {
+win32:debug_and_release {
CONFIG(debug, debug|release) {
DESTDIR = ../debug/
} else {
diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro
index bfda0e0194..3db4bed973 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro
+++ b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro
@@ -13,12 +13,18 @@ msvc: DEFINES += WIN32_MSVC
# We want to test if we can load a shared library with *any* filename...
win32 {
- CONFIG(debug, debug|release) {
- BUILD_FOLDER = debug
+
+ debug_and_release {
+ CONFIG(debug, debug|release)) {
+ BUILD_FOLDER = debug
+ } else {
+ BUILD_FOLDER = release
+ }
+ DESTDIR = ../$$BUILD_FOLDER/
} else {
- BUILD_FOLDER = release
+ BUILD_FOLDER =
+ DESTDIR = ../
}
- DESTDIR = ../$$BUILD_FOLDER/
# vcproj and Makefile generators refer to target differently
contains(TEMPLATE,vc.*) {
diff --git a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro
index 56bef14405..5894bee9d5 100644
--- a/tests/auto/corelib/plugin/qlibrary/tst/tst.pro
+++ b/tests/auto/corelib/plugin/qlibrary/tst/tst.pro
@@ -3,7 +3,7 @@ TARGET = ../tst_qlibrary
QT = core testlib
SOURCES = ../tst_qlibrary.cpp
-win32 {
+win32:debug_and_release {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qlibrary
} else {
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
index c9c9202a80..e0d09b0813 100644
--- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
@@ -30,7 +30,7 @@
#include <QtTest/QtTest>
#include <qdir.h>
#include <qlibrary.h>
-#include <QtCore/QRegExp>
+#include <QtCore/QRegularExpression>
// Helper macros to let us know if some suffixes and prefixes are valid
@@ -414,10 +414,12 @@ void tst_QLibrary::errorString()
QFAIL(qPrintable(QString("Unknown operation: %1").arg(operation)));
break;
}
- QRegExp re(errorString);
+#if QT_CONFIG(regularexpression)
+ QRegularExpression re(QRegularExpression::anchoredPattern(errorString));
QString libErrorString = lib.errorString();
+ QVERIFY2(re.match(libErrorString).hasMatch(), qPrintable(libErrorString));
+#endif
QVERIFY(!lib.isLoaded() || lib.unload());
- QVERIFY2(re.exactMatch(libErrorString), qPrintable(libErrorString));
QCOMPARE(ok, success);
}
diff --git a/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp b/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp
index d891839b1e..6d163ea336 100644
--- a/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/staticplugin/main.cpp
@@ -31,7 +31,7 @@
class StaticPlugin : public QObject
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID "SomeIID")
+ Q_PLUGIN_METADATA(IID "SomeIID" URI "qt.test.pluginloader.staticplugin")
public:
StaticPlugin() {}
};
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
index a3885f4134..d49bff14fd 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
+++ b/tests/auto/corelib/plugin/qpluginloader/tst/tst.pro
@@ -5,7 +5,7 @@ qtConfig(private_tests): QT += core-private
SOURCES = ../tst_qpluginloader.cpp ../fakeplugin.cpp
HEADERS = ../theplugin/plugininterface.h
-win32 {
+win32:debug_and_release {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qpluginloader
LIBS += -L../staticplugin/debug
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index 85763b0388..c4a366d7c6 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -553,6 +553,7 @@ void tst_QPluginLoader::staticPlugins()
QCOMPARE(metaData.value("version").toInt() / 0x100, QT_VERSION / 0x100);
QCOMPARE(metaData.value("IID").toString(), "SomeIID");
QCOMPARE(metaData.value("ExtraMetaData"), QJsonArray({ "StaticPlugin", "foo" }));
+ QCOMPARE(metaData.value("URI").toString(), "qt.test.pluginloader.staticplugin");
}
diff --git a/tests/auto/corelib/serialization/json/tst_qtjson.cpp b/tests/auto/corelib/serialization/json/tst_qtjson.cpp
index 8907704a33..57aa67c142 100644
--- a/tests/auto/corelib/serialization/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/serialization/json/tst_qtjson.cpp
@@ -436,6 +436,8 @@ void tst_QtJson::testObjectSimple()
object.insert("boolean", true);
QCOMPARE(object.value("boolean").toBool(), true);
QCOMPARE(object.value(QLatin1String("boolean")).toBool(), true);
+ QJsonObject object2 = object;
+ QJsonObject object3 = object;
QStringList keys = object.keys();
QVERIFY2(keys.contains("number"), "key number not found");
@@ -461,6 +463,40 @@ void tst_QtJson::testObjectSimple()
object.insert("string", QString::fromLatin1("foo"));
QVERIFY2(object.value(QLatin1String("string")).toString() != before, "value should have been updated");
+ // same tests again but with QStringView keys
+ object2.insert(QStringView(u"value"), value);
+ QCOMPARE(object2.value("value"), value);
+
+ size = object2.size();
+ object2.remove(QStringView(u"boolean"));
+ QCOMPARE(object2.size(), size - 1);
+ QVERIFY2(!object2.contains(QStringView(u"boolean")), "key boolean should have been removed");
+
+ taken = object2.take(QStringView(u"value"));
+ QCOMPARE(taken, value);
+ QVERIFY2(!object2.contains("value"), "key value should have been removed");
+
+ before = object2.value("string").toString();
+ object2.insert(QStringView(u"string"), QString::fromLatin1("foo"));
+ QVERIFY2(object2.value(QStringView(u"string")).toString() != before, "value should have been updated");
+
+ // same tests again but with QLatin1String keys
+ object3.insert(QLatin1String("value"), value);
+ QCOMPARE(object3.value("value"), value);
+
+ size = object3.size();
+ object3.remove(QLatin1String("boolean"));
+ QCOMPARE(object3.size(), size - 1);
+ QVERIFY2(!object3.contains("boolean"), "key boolean should have been removed");
+
+ taken = object3.take(QLatin1String("value"));
+ QCOMPARE(taken, value);
+ QVERIFY2(!object3.contains("value"), "key value should have been removed");
+
+ before = object3.value("string").toString();
+ object3.insert(QLatin1String("string"), QString::fromLatin1("foo"));
+ QVERIFY2(object3.value(QLatin1String("string")).toString() != before, "value should have been updated");
+
size = object.size();
QJsonObject subobject;
subobject.insert("number", 42);
@@ -1096,6 +1132,8 @@ void tst_QtJson::undefinedValues()
QJsonObject object;
object.insert("Key", QJsonValue(QJsonValue::Undefined));
QCOMPARE(object.size(), 0);
+ object["Key"] = QJsonValue(QJsonValue::Undefined);
+ QCOMPARE(object.size(), 0);
object.insert("Key", QLatin1String("Value"));
QCOMPARE(object.size(), 1);
@@ -2698,6 +2736,8 @@ void tst_QtJson::longStrings()
// test around 15 and 16 bit boundaries, as these are limits
// in the data structures (for Latin1String in qjson_p.h)
QString s(0x7ff0, 'a');
+ QByteArray ba(0x7ff0, 'a');
+ ba.append(0x8010 - 0x7ff0, 'c');
for (int i = 0x7ff0; i < 0x8010; i++) {
s.append(QLatin1Char('c'));
@@ -2714,9 +2754,21 @@ void tst_QtJson::longStrings()
/* ... and a QByteArray from the QJsonDocument */
QByteArray a2 = d2.toJson();
QCOMPARE(a1, a2);
+
+ // Test long keys
+ QJsonObject o1, o2;
+ o1[s] = 42;
+ o2[QLatin1String(ba.data(), i + 1)] = 42;
+ d1.setObject(o1);
+ d2.setObject(o2);
+ a1 = d1.toJson();
+ a2 = d2.toJson();
+ QCOMPARE(a1, a2);
}
s = QString(0xfff0, 'a');
+ ba = QByteArray(0xfff0, 'a');
+ ba.append(0x10010 - 0xfff0, 'c');
for (int i = 0xfff0; i < 0x10010; i++) {
s.append(QLatin1Char('c'));
@@ -2733,6 +2785,16 @@ void tst_QtJson::longStrings()
/* ... and a QByteArray from the QJsonDocument */
QByteArray a2 = d2.toJson();
QCOMPARE(a1, a2);
+
+ // Test long keys
+ QJsonObject o1, o2;
+ o1[s] = 42;
+ o2[QLatin1String(ba.data(), i + 1)] = 42;
+ d1.setObject(o1);
+ d2.setObject(o2);
+ a1 = d1.toJson();
+ a2 = d2.toJson();
+ QCOMPARE(a1, a2);
}
}
@@ -2755,9 +2817,6 @@ void tst_QtJson::testJsonValueRefDefault()
void tst_QtJson::arrayInitializerList()
{
-#ifndef Q_COMPILER_INITIALIZER_LISTS
- QSKIP("initializer_list is enabled only with c++11 support");
-#else
QVERIFY(QJsonArray{}.isEmpty());
QCOMPARE(QJsonArray{"one"}.count(), 1);
QCOMPARE(QJsonArray{1}.count(), 1);
@@ -2803,14 +2862,10 @@ void tst_QtJson::arrayInitializerList()
QCOMPARE(QJsonValue(a43["one"]), QJsonValue(1));
}
}
-#endif
}
void tst_QtJson::objectInitializerList()
{
-#ifndef Q_COMPILER_INITIALIZER_LISTS
- QSKIP("initializer_list is enabled only with c++11 support");
-#else
QVERIFY(QJsonObject{}.isEmpty());
{ // one property
@@ -2850,7 +2905,6 @@ void tst_QtJson::objectInitializerList()
QCOMPARE(QJsonValue(nested[0]), QJsonValue("innerValue"));
QCOMPARE(QJsonValue(nested[1]), QJsonValue(2.1));
}
-#endif
}
void tst_QtJson::unicodeKeys()
diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp
index 6fa82ea681..c6733205e5 100644
--- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp
+++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp
@@ -1413,10 +1413,12 @@ void tst_QCborValue::toCbor_data()
// The rest of these tests are conversions whose decoding does not yield
// back the same QCborValue.
+#if QT_CONFIG(signaling_nan)
// Signalling NaN get normalized to quiet ones
QTest::newRow("Double:snan") << QCborValue(qSNaN()) << raw("\xfb\x7f\xf8\0""\0\0\0\0\0") << QCborValue::EncodingOptions();
QTest::newRow("Float:snan") << QCborValue(qSNaN()) << raw("\xfa\x7f\xc0\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
QTest::newRow("Float16:snan") << QCborValue(qSNaN()) << raw("\xf9\x7e\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+#endif
// Floating point written as integers are read back as integers
QTest::newRow("UseInteger:0") << QCborValue(0.) << raw("\x00") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
diff --git a/tests/auto/corelib/serialization/qdatastream/qdatastream.pro b/tests/auto/corelib/serialization/qdatastream/qdatastream.pro
index 25f8b889a0..469d689f3f 100644
--- a/tests/auto/corelib/serialization/qdatastream/qdatastream.pro
+++ b/tests/auto/corelib/serialization/qdatastream/qdatastream.pro
@@ -3,6 +3,8 @@ TARGET = tst_qdatastream
QT += testlib
SOURCES = tst_qdatastream.cpp
+DEFINES -= QT_NO_LINKED_LIST
+
TESTDATA += datastream.q42
android:!android-embedded {
diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
index 3ad1794176..8197c386c5 100644
--- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
@@ -113,6 +113,11 @@ private slots:
void stream_QRegExp_data();
void stream_QRegExp();
+#if QT_CONFIG(regularexpression)
+ void stream_QRegularExpression_data();
+ void stream_QRegularExpression();
+#endif
+
void stream_Map_data();
void stream_Map();
@@ -181,6 +186,8 @@ private slots:
void streamRealDataTypes();
+ void enumTest();
+
void floatingPointPrecision();
void compatibility_Qt5();
@@ -219,6 +226,9 @@ private:
void writeQSize(QDataStream *s);
void writeQString(QDataStream* dev);
void writeQRegExp(QDataStream* dev);
+#if QT_CONFIG(regularexpression)
+ void writeQRegularExpression(QDataStream *dev);
+#endif
void writeMap(QDataStream* dev);
void writeHash(QDataStream* dev);
void writeqint64(QDataStream *s);
@@ -248,6 +258,9 @@ private:
void readQSize(QDataStream *s);
void readQString(QDataStream *s);
void readQRegExp(QDataStream *s);
+#if QT_CONFIG(regularexpression)
+ void readQRegularExpression(QDataStream *s);
+#endif
void readMap(QDataStream *s);
void readHash(QDataStream *s);
void readqint64(QDataStream *s);
@@ -559,6 +572,69 @@ void tst_QDataStream::readQRegExp(QDataStream *s)
// ************************************
+#if QT_CONFIG(regularexpression)
+static QRegularExpression QRegularExpressionData(int index)
+{
+ switch (index) {
+ case 0: return QRegularExpression();
+ case 1: return QRegularExpression("");
+ case 2: return QRegularExpression("A", QRegularExpression::CaseInsensitiveOption);
+ case 3: return QRegularExpression(QRegularExpression::wildcardToRegularExpression("ABCDE FGHI"));
+ case 4: return QRegularExpression(QRegularExpression::anchoredPattern("This is a long string"), QRegularExpression::CaseInsensitiveOption);
+ case 5: return QRegularExpression("And again a string with a \nCRLF", QRegularExpression::CaseInsensitiveOption);
+ case 6: return QRegularExpression("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRESTUVWXYZ 1234567890 ~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", QRegularExpression::InvertedGreedinessOption);
+ }
+ return QRegularExpression("foo");
+}
+#define MAX_QREGULAREXPRESSION_DATA 7
+
+void tst_QDataStream::stream_QRegularExpression_data()
+{
+ stream_data(MAX_QREGULAREXPRESSION_DATA);
+}
+
+void tst_QDataStream::stream_QRegularExpression()
+{
+ STREAM_IMPL(QRegularExpression);
+}
+
+void tst_QDataStream::writeQRegularExpression(QDataStream* s)
+{
+ QRegularExpression test(QRegularExpressionData(dataIndex(QTest::currentDataTag())));
+ *s << test;
+ *s << QString("Her er det noe tekst");
+ *s << test;
+ *s << QString("nonempty");
+ *s << test;
+ *s << QVariant(test);
+}
+
+void tst_QDataStream::readQRegularExpression(QDataStream *s)
+{
+ QRegularExpression R;
+ QString S;
+ QVariant V;
+ QRegularExpression test(QRegularExpressionData(dataIndex(QTest::currentDataTag())));
+
+ *s >> R;
+
+ QCOMPARE(R, test);
+ *s >> S;
+ QCOMPARE(S, QString("Her er det noe tekst"));
+ *s >> R;
+ QCOMPARE(R, test);
+ *s >> S;
+ QCOMPARE(S, QString("nonempty"));
+ *s >> R;
+ QCOMPARE(R, test);
+ *s >> V;
+ QCOMPARE(V.type(), QVariant::RegularExpression);
+ QCOMPARE(V.toRegularExpression(), test);
+}
+#endif //QT_CONFIG(regularexpression)
+
+// ************************************
+
typedef QMap<int, QString> Map;
static Map MapData(int index)
@@ -2315,10 +2391,10 @@ void tst_QDataStream::setVersion()
if (vers == 1) {
for (int grp = 0; grp < (int)QPalette::NColorGroups; ++grp) {
- QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Foreground)
- == inPal1.color((QPalette::ColorGroup)grp, QPalette::Foreground));
- QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Background)
- == inPal1.color((QPalette::ColorGroup)grp, QPalette::Background));
+ QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::WindowText)
+ == inPal1.color((QPalette::ColorGroup)grp, QPalette::WindowText));
+ QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Window)
+ == inPal1.color((QPalette::ColorGroup)grp, QPalette::Window));
QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Light)
== inPal1.color((QPalette::ColorGroup)grp, QPalette::Light));
QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Dark)
@@ -3441,6 +3517,90 @@ void tst_QDataStream::floatingPointNaN()
}
}
+void tst_QDataStream::enumTest()
+{
+ QByteArray ba;
+
+ enum class E1 : qint8
+ {
+ A,
+ B,
+ C
+ };
+ {
+ QDataStream stream(&ba, QIODevice::WriteOnly);
+ stream << E1::A;
+ QCOMPARE(ba.size(), int(sizeof(E1)));
+ }
+ {
+ QDataStream stream(ba);
+ E1 e;
+ stream >> e;
+ QCOMPARE(e, E1::A);
+ }
+ ba.clear();
+
+ enum class E2 : qint16
+ {
+ A,
+ B,
+ C
+ };
+ {
+ QDataStream stream(&ba, QIODevice::WriteOnly);
+ stream << E2::B;
+ QCOMPARE(ba.size(), int(sizeof(E2)));
+ }
+ {
+ QDataStream stream(ba);
+ E2 e;
+ stream >> e;
+ QCOMPARE(e, E2::B);
+ }
+ ba.clear();
+
+ enum class E4 : qint32
+ {
+ A,
+ B,
+ C
+ };
+ {
+ QDataStream stream(&ba, QIODevice::WriteOnly);
+ stream << E4::C;
+ QCOMPARE(ba.size(), int(sizeof(E4)));
+ }
+ {
+ QDataStream stream(ba);
+ E4 e;
+ stream >> e;
+ QCOMPARE(e, E4::C);
+ }
+ ba.clear();
+
+
+ enum E
+ {
+ A,
+ B,
+ C,
+ D
+ };
+ {
+ QDataStream stream(&ba, QIODevice::WriteOnly);
+ stream << E::D;
+ QCOMPARE(ba.size(), 4);
+ }
+ {
+ QDataStream stream(ba);
+ E e;
+ stream >> e;
+ QCOMPARE(e, E::D);
+ }
+ ba.clear();
+
+}
+
void tst_QDataStream::floatingPointPrecision()
{
QByteArray ba;
diff --git a/tests/auto/corelib/serialization/qtextstream/BLACKLIST b/tests/auto/corelib/serialization/qtextstream/BLACKLIST
index b54b53cd74..674569e204 100644
--- a/tests/auto/corelib/serialization/qtextstream/BLACKLIST
+++ b/tests/auto/corelib/serialization/qtextstream/BLACKLIST
@@ -1,3 +1,3 @@
[stillOpenWhenAtEnd]
-windows
+windows-7sp1
winrt
diff --git a/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/main.cpp b/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/main.cpp
index 41ea5e56f0..2d4aa452ca 100644
--- a/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/main.cpp
+++ b/tests/auto/corelib/serialization/qtextstream/readLineStdinProcess/main.cpp
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
do {
line = qin.readLine();
if (!line.isNull())
- qerr << line << flush;
+ qerr << line << Qt::flush;
} while (!line.isNull());
return 0;
}
diff --git a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp
index 8bb35554c8..6381ce5ed0 100644
--- a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp
@@ -35,6 +35,7 @@
#include <QBuffer>
#include <QByteArray>
#include <QDebug>
+#include <QElapsedTimer>
#include <QFile>
#include <QTcpSocket>
#include <QTemporaryDir>
@@ -245,7 +246,7 @@ private:
void runOnExit()
{
QByteArray buffer;
- QTextStream(&buffer) << "This will try to use QTextCodec::codecForLocale" << endl;
+ QTextStream(&buffer) << "This will try to use QTextCodec::codecForLocale" << Qt::endl;
}
Q_DESTRUCTOR_FUNCTION(runOnExit)
@@ -996,7 +997,7 @@ struct CompareIndicesForArray
void tst_QTextStream::performance()
{
// Phase #1 - test speed of reading a huge text file with QFile.
- QTime stopWatch;
+ QElapsedTimer stopWatch;
const int N = 3;
const char * readMethods[N] = {
@@ -1102,7 +1103,7 @@ void tst_QTextStream::hexTest()
QByteArray array;
QTextStream stream(&array);
- stream << showbase << hex << number;
+ stream << Qt::showbase << Qt::hex << number;
stream.flush();
QCOMPARE(array, data);
}
@@ -1132,7 +1133,7 @@ void tst_QTextStream::binTest()
QByteArray array;
QTextStream stream(&array);
- stream << showbase << bin << number;
+ stream << Qt::showbase << Qt::bin << number;
stream.flush();
QCOMPARE(array.constData(), data.constData());
}
@@ -1155,7 +1156,7 @@ void tst_QTextStream::octTest()
QByteArray array;
QTextStream stream(&array);
- stream << showbase << oct << number;
+ stream << Qt::showbase << Qt::oct << number;
stream.flush();
QCOMPARE(array, data);
}
@@ -1196,7 +1197,7 @@ void tst_QTextStream::ws_manipulator()
QTextStream stream(&string);
char a, b, c, d;
- stream >> a >> ws >> b >> ws >> c >> ws >> d;
+ stream >> a >> Qt::ws >> b >> Qt::ws >> c >> Qt::ws >> d;
QCOMPARE(a, 'a');
QCOMPARE(b, 'b');
QCOMPARE(c, 'c');
@@ -1506,9 +1507,9 @@ void tst_QTextStream::readStdin()
stdinProcess.setReadChannel(QProcess::StandardError);
QTextStream stream(&stdinProcess);
- stream << "1" << endl;
- stream << "2" << endl;
- stream << "3" << endl;
+ stream << "1" << Qt::endl;
+ stream << "2" << Qt::endl;
+ stream << "3" << Qt::endl;
stdinProcess.closeWriteChannel();
@@ -1534,7 +1535,7 @@ void tst_QTextStream::readAllFromStdin()
QTextStream stream(&stdinProcess);
stream.setCodec("ISO-8859-1");
- stream << "hello world" << flush;
+ stream << "hello world" << Qt::flush;
stdinProcess.closeWriteChannel();
@@ -1623,18 +1624,18 @@ void tst_QTextStream::forcePoint()
{
QString str;
QTextStream stream(&str);
- stream << fixed << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1;
+ stream << Qt::fixed << Qt::forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1;
QCOMPARE(str, QString("1.000000 1 0 -1.000000 -1"));
str.clear();
stream.seek(0);
- stream << scientific << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1;
+ stream << Qt::scientific << Qt::forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1;
QCOMPARE(str, QString("1.000000e+00 1 0 -1.000000e+00 -1"));
str.clear();
stream.seek(0);
stream.setRealNumberNotation(QTextStream::SmartNotation);
- stream << forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1;
+ stream << Qt::forcepoint << 1.0 << ' ' << 1 << ' ' << 0 << ' ' << -1.0 << ' ' << -1;
QCOMPARE(str, QString("1.00000 1 0 -1.00000 -1"));
}
@@ -1644,7 +1645,7 @@ void tst_QTextStream::forceSign()
{
QString str;
QTextStream stream(&str);
- stream << forcesign << 1.2 << ' ' << -1.2 << ' ' << 0;
+ stream << Qt::forcesign << 1.2 << ' ' << -1.2 << ' ' << 0;
QCOMPARE(str, QString("+1.2 -1.2 +0"));
}
@@ -1663,19 +1664,22 @@ void tst_QTextStream::read0d0d0a()
Q_DECLARE_METATYPE(QTextStreamFunction);
+// Also tests that we can have namespaces that conflict with our QTextStream constants.
+namespace ws {
QTextStream &noop(QTextStream &s) { return s; }
+}
void tst_QTextStream::numeralCase_data()
{
- QTextStreamFunction noop_ = noop;
- QTextStreamFunction bin_ = bin;
- QTextStreamFunction oct_ = oct;
- QTextStreamFunction hex_ = hex;
- QTextStreamFunction base = showbase;
- QTextStreamFunction ucb = uppercasebase;
- QTextStreamFunction lcb = lowercasebase;
- QTextStreamFunction ucd = uppercasedigits;
- QTextStreamFunction lcd = lowercasedigits;
+ QTextStreamFunction noop_ = ws::noop;
+ QTextStreamFunction bin = Qt::bin;
+ QTextStreamFunction oct = Qt::oct;
+ QTextStreamFunction hex = Qt::hex;
+ QTextStreamFunction base = Qt::showbase;
+ QTextStreamFunction ucb = Qt::uppercasebase;
+ QTextStreamFunction lcb = Qt::lowercasebase;
+ QTextStreamFunction ucd = Qt::uppercasedigits;
+ QTextStreamFunction lcd = Qt::lowercasedigits;
QTest::addColumn<QTextStreamFunction>("func1");
QTest::addColumn<QTextStreamFunction>("func2");
@@ -1686,30 +1690,30 @@ void tst_QTextStream::numeralCase_data()
QTest::newRow("dec 1") << noop_ << noop_ << noop_ << noop_ << 31 << "31";
QTest::newRow("dec 2") << noop_ << base << noop_ << noop_ << 31 << "31";
- QTest::newRow("hex 1") << hex_ << noop_ << noop_ << noop_ << 31 << "1f";
- QTest::newRow("hex 2") << hex_ << noop_ << noop_ << lcd << 31 << "1f";
- QTest::newRow("hex 3") << hex_ << noop_ << ucb << noop_ << 31 << "1f";
- QTest::newRow("hex 4") << hex_ << noop_ << noop_ << ucd << 31 << "1F";
- QTest::newRow("hex 5") << hex_ << noop_ << lcb << ucd << 31 << "1F";
- QTest::newRow("hex 6") << hex_ << noop_ << ucb << ucd << 31 << "1F";
- QTest::newRow("hex 7") << hex_ << base << noop_ << noop_ << 31 << "0x1f";
- QTest::newRow("hex 8") << hex_ << base << lcb << lcd << 31 << "0x1f";
- QTest::newRow("hex 9") << hex_ << base << ucb << noop_ << 31 << "0X1f";
- QTest::newRow("hex 10") << hex_ << base << ucb << lcd << 31 << "0X1f";
- QTest::newRow("hex 11") << hex_ << base << noop_ << ucd << 31 << "0x1F";
- QTest::newRow("hex 12") << hex_ << base << lcb << ucd << 31 << "0x1F";
- QTest::newRow("hex 13") << hex_ << base << ucb << ucd << 31 << "0X1F";
-
- QTest::newRow("bin 1") << bin_ << noop_ << noop_ << noop_ << 31 << "11111";
- QTest::newRow("bin 2") << bin_ << base << noop_ << noop_ << 31 << "0b11111";
- QTest::newRow("bin 3") << bin_ << base << lcb << noop_ << 31 << "0b11111";
- QTest::newRow("bin 4") << bin_ << base << ucb << noop_ << 31 << "0B11111";
- QTest::newRow("bin 5") << bin_ << base << noop_ << ucd << 31 << "0b11111";
- QTest::newRow("bin 6") << bin_ << base << lcb << ucd << 31 << "0b11111";
- QTest::newRow("bin 7") << bin_ << base << ucb << ucd << 31 << "0B11111";
-
- QTest::newRow("oct 1") << oct_ << noop_ << noop_ << noop_ << 31 << "37";
- QTest::newRow("oct 2") << oct_ << base << noop_ << noop_ << 31 << "037";
+ QTest::newRow("hex 1") << hex << noop_ << noop_ << noop_ << 31 << "1f";
+ QTest::newRow("hex 2") << hex << noop_ << noop_ << lcd << 31 << "1f";
+ QTest::newRow("hex 3") << hex << noop_ << ucb << noop_ << 31 << "1f";
+ QTest::newRow("hex 4") << hex << noop_ << noop_ << ucd << 31 << "1F";
+ QTest::newRow("hex 5") << hex << noop_ << lcb << ucd << 31 << "1F";
+ QTest::newRow("hex 6") << hex << noop_ << ucb << ucd << 31 << "1F";
+ QTest::newRow("hex 7") << hex << base << noop_ << noop_ << 31 << "0x1f";
+ QTest::newRow("hex 8") << hex << base << lcb << lcd << 31 << "0x1f";
+ QTest::newRow("hex 9") << hex << base << ucb << noop_ << 31 << "0X1f";
+ QTest::newRow("hex 10") << hex << base << ucb << lcd << 31 << "0X1f";
+ QTest::newRow("hex 11") << hex << base << noop_ << ucd << 31 << "0x1F";
+ QTest::newRow("hex 12") << hex << base << lcb << ucd << 31 << "0x1F";
+ QTest::newRow("hex 13") << hex << base << ucb << ucd << 31 << "0X1F";
+
+ QTest::newRow("bin 1") << bin << noop_ << noop_ << noop_ << 31 << "11111";
+ QTest::newRow("bin 2") << bin << base << noop_ << noop_ << 31 << "0b11111";
+ QTest::newRow("bin 3") << bin << base << lcb << noop_ << 31 << "0b11111";
+ QTest::newRow("bin 4") << bin << base << ucb << noop_ << 31 << "0B11111";
+ QTest::newRow("bin 5") << bin << base << noop_ << ucd << 31 << "0b11111";
+ QTest::newRow("bin 6") << bin << base << lcb << ucd << 31 << "0b11111";
+ QTest::newRow("bin 7") << bin << base << ucb << ucd << 31 << "0B11111";
+
+ QTest::newRow("oct 1") << oct << noop_ << noop_ << noop_ << 31 << "37";
+ QTest::newRow("oct 2") << oct << base << noop_ << noop_ << 31 << "037";
}
void tst_QTextStream::numeralCase()
@@ -1782,9 +1786,9 @@ void tst_QTextStream::nanInf()
QString s;
QTextStream out(&s);
out << qInf() << ' ' << -qInf() << ' ' << qQNaN()
- << uppercasedigits << ' '
+ << Qt::uppercasedigits << ' '
<< qInf() << ' ' << -qInf() << ' ' << qQNaN()
- << flush;
+ << Qt::flush;
QCOMPARE(s, QString("inf -inf nan INF -INF NAN"));
}
@@ -1821,7 +1825,7 @@ void tst_QTextStream::utf8IncompleteAtBufferBoundary()
out.setFieldWidth(3);
for (int i = 0; i < 1000; ++i) {
- out << i << lineContents << endl;
+ out << i << lineContents << Qt::endl;
}
}
data.close();
@@ -1859,9 +1863,9 @@ void tst_QTextStream::writeSeekWriteNoBOM()
int number = 0;
QString sizeStr = QLatin1String("Size=")
+ QString::number(number).rightJustified(10, QLatin1Char('0'));
- stream << sizeStr << endl;
- stream << "Version=" << QString::number(14) << endl;
- stream << "blah blah blah" << endl;
+ stream << sizeStr << Qt::endl;
+ stream << "Version=" << QString::number(14) << Qt::endl;
+ stream << "blah blah blah" << Qt::endl;
stream.flush();
QCOMPARE(out.buffer().constData(), "Size=0000000000\nVersion=14\nblah blah blah\n");
@@ -1871,7 +1875,7 @@ void tst_QTextStream::writeSeekWriteNoBOM()
stream.seek(0);
sizeStr = QLatin1String("Size=")
+ QString::number(number).rightJustified(10, QLatin1Char('0'));
- stream << sizeStr << endl;
+ stream << sizeStr << Qt::endl;
stream.flush();
// Check buffer is still OK
@@ -2582,7 +2586,7 @@ void tst_QTextStream::stringview_write_operator_ToDevice()
QBuffer buf;
buf.open(QBuffer::WriteOnly);
QTextStream stream(&buf);
- const QStringView expected = QStringViewLiteral("expectedStringView");
+ const QStringView expected = u"expectedStringView";
stream << expected;
stream.flush();
QCOMPARE(buf.buffer().constData(), "expectedStringView");
@@ -2723,7 +2727,7 @@ void tst_QTextStream::generateBOM()
QTextStream stream(&file);
stream.setCodec(QTextCodec::codecForName("UTF-16LE"));
- stream << "Hello" << endl;
+ stream << "Hello" << Qt::endl;
file.close();
QVERIFY(file.open(QFile::ReadOnly));
@@ -2737,7 +2741,7 @@ void tst_QTextStream::generateBOM()
QTextStream stream(&file);
stream.setCodec(QTextCodec::codecForName("UTF-16LE"));
- stream << bom << "Hello" << endl;
+ stream << Qt::bom << "Hello" << Qt::endl;
file.close();
QVERIFY(file.open(QFile::ReadOnly));
diff --git a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
index 8fdf91b090..92a0d8bbfa 100644
--- a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
@@ -115,7 +115,7 @@ static QByteArray makeCanonical(const QString &filename,
writeDtd << "<!DOCTYPE ";
writeDtd << docType;
writeDtd << " [";
- writeDtd << endl;
+ writeDtd << Qt::endl;
for (const QXmlStreamNotationDeclaration &notation : sorted_by_name(notationDeclarations)) {
writeDtd << "<!NOTATION ";
writeDtd << notation.name().toString();
@@ -134,11 +134,11 @@ static QByteArray makeCanonical(const QString &filename,
}
}
writeDtd << '>';
- writeDtd << endl;
+ writeDtd << Qt::endl;
}
writeDtd << "]>";
- writeDtd << endl;
+ writeDtd << Qt::endl;
writer.writeDTD(dtd);
}
} else if (reader.isStartElement()) {
@@ -253,7 +253,7 @@ public:
qFatal("%s: aId must not be an empty string", Q_FUNC_INFO);
}
- void swap(MissedBaseline &other) Q_DECL_NOTHROW
+ void swap(MissedBaseline &other) noexcept
{
qSwap(id, other.id);
qSwap(expected, other.expected);
@@ -740,7 +740,7 @@ QByteArray tst_QXmlStream::readFile(const QString &filename)
const auto attributes = reader.attributes();
if (attributes.size()) {
for (const QXmlStreamAttribute &attribute : attributes) {
- writer << endl << " Attribute(";
+ writer << Qt::endl << " Attribute(";
if (!attribute.name().isEmpty())
writer << " name=\"" << attribute.name().toString() << '"';
if (!attribute.namespaceUri().isEmpty())
@@ -751,37 +751,37 @@ QByteArray tst_QXmlStream::readFile(const QString &filename)
writer << " prefix=\"" << attribute.prefix().toString() << '"';
if (!attribute.value().isEmpty())
writer << " value=\"" << attribute.value().toString() << '"';
- writer << " )" << endl;
+ writer << " )" << Qt::endl;
}
}
const auto namespaceDeclarations = reader.namespaceDeclarations();
if (namespaceDeclarations.size()) {
for (const QXmlStreamNamespaceDeclaration &namespaceDeclaration : namespaceDeclarations) {
- writer << endl << " NamespaceDeclaration(";
+ writer << Qt::endl << " NamespaceDeclaration(";
if (!namespaceDeclaration.prefix().isEmpty())
writer << " prefix=\"" << namespaceDeclaration.prefix().toString() << '"';
if (!namespaceDeclaration.namespaceUri().isEmpty())
writer << " namespaceUri=\"" << namespaceDeclaration.namespaceUri().toString() << '"';
- writer << " )" << endl;
+ writer << " )" << Qt::endl;
}
}
const auto notationDeclarations = reader.notationDeclarations();
if (notationDeclarations.size()) {
for (const QXmlStreamNotationDeclaration &notationDeclaration : notationDeclarations) {
- writer << endl << " NotationDeclaration(";
+ writer << Qt::endl << " NotationDeclaration(";
if (!notationDeclaration.name().isEmpty())
writer << " name=\"" << notationDeclaration.name().toString() << '"';
if (!notationDeclaration.systemId().isEmpty())
writer << " systemId=\"" << notationDeclaration.systemId().toString() << '"';
if (!notationDeclaration.publicId().isEmpty())
writer << " publicId=\"" << notationDeclaration.publicId().toString() << '"';
- writer << " )" << endl;
+ writer << " )" << Qt::endl;
}
}
const auto entityDeclarations = reader.entityDeclarations();
if (entityDeclarations.size()) {
for (const QXmlStreamEntityDeclaration &entityDeclaration : entityDeclarations) {
- writer << endl << " EntityDeclaration(";
+ writer << Qt::endl << " EntityDeclaration(";
if (!entityDeclaration.name().isEmpty())
writer << " name=\"" << entityDeclaration.name().toString() << '"';
if (!entityDeclaration.notationName().isEmpty())
@@ -792,13 +792,13 @@ QByteArray tst_QXmlStream::readFile(const QString &filename)
writer << " publicId=\"" << entityDeclaration.publicId().toString() << '"';
if (!entityDeclaration.value().isEmpty())
writer << " value=\"" << entityDeclaration.value().toString() << '"';
- writer << " )" << endl;
+ writer << " )" << Qt::endl;
}
}
- writer << " )" << endl;
+ writer << " )" << Qt::endl;
}
if (reader.hasError())
- writer << "ERROR: " << reader.errorString() << endl;
+ writer << "ERROR: " << reader.errorString() << Qt::endl;
return outarray;
}
@@ -1169,7 +1169,7 @@ int main(int argc, char *argv[])
bool error = false;
QByteArray canonical = makeCanonical(argv[2], "doc", error);
QTextStream myStdOut(stdout);
- myStdOut << canonical << endl;
+ myStdOut << canonical << Qt::endl;
exit(0);
}
diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
index 810698fb4e..4b13ac45cc 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
@@ -336,7 +336,9 @@ void tst_QStateMachine::transitionToRootState()
TEST_ACTIVE_CHANGED(initialState, 1);
machine.postEvent(new QEvent(QEvent::User));
- QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 'initial'");
+ QTest::ignoreMessage(QtWarningMsg,
+ "Unrecoverable error detected in running state machine: "
+ "Child mode of state machine 'machine' is not 'ExclusiveStates'.");
QCoreApplication::processEvents();
QVERIFY(machine.configuration().isEmpty());
QVERIFY(!machine.isRunning());
@@ -1061,7 +1063,8 @@ void tst_QStateMachine::transitionToStateNotInGraph()
initialState->addTransition(&independentState);
machine.start();
- QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 'initialState'");
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: "
+ "Child mode of state machine '' is not 'ExclusiveStates'.");
QCoreApplication::processEvents();
QCOMPARE(machine.isRunning(), false);
@@ -1734,13 +1737,13 @@ protected:
if (e->type() != QEvent::Type(QEvent::User+2))
return false;
StringEvent *se = static_cast<StringEvent*>(e);
- return (m_value == se->value) && (!m_cond.isValid() || (m_cond.indexIn(m_value) != -1));
+ return (m_value == se->value) && (!m_cond.isValid() || m_cond.match(m_value).hasMatch());
}
virtual void onTransition(QEvent *) {}
private:
QString m_value;
- QRegExp m_cond;
+ QRegularExpression m_cond;
};
class StringEventPoster : public QState
@@ -2099,6 +2102,8 @@ void tst_QStateMachine::parallelRootState()
QSignalSpy finishedSpy(&machine, &QStateMachine::finished);
QVERIFY(finishedSpy.isValid());
machine.start();
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: "
+ "Child mode of state machine '' is not 'ExclusiveStates'.");
QTRY_COMPARE(startedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 4);
QVERIFY(machine.configuration().contains(s1));
@@ -3310,14 +3315,15 @@ void tst_QStateMachine::targetStateWithNoParent()
QVERIFY(runningSpy.isValid());
machine.start();
- QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 's1'");
+ QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: "
+ "Child mode of state machine '' is not 'ExclusiveStates'.");
TEST_ACTIVE_CHANGED(s1, 2);
QTRY_COMPARE(startedSpy.count(), 1);
QCOMPARE(machine.isRunning(), false);
QCOMPARE(stoppedSpy.count(), 1);
QCOMPARE(finishedSpy.count(), 0);
TEST_RUNNING_CHANGED_STARTED_STOPPED;
- QCOMPARE(machine.error(), QStateMachine::NoCommonAncestorForTransitionError);
+ QCOMPARE(machine.error(), QStateMachine::StateMachineChildModeSetToParallelError);
}
void tst_QStateMachine::targetStateDeleted()
@@ -6680,13 +6686,13 @@ void tst_QStateMachine::dontProcessSlotsWhenMachineIsNotRunning()
} emitter;
initialState.addTransition(&emitter, &Emitter::signalWithNoArg, &finalState);
- QTimer::singleShot(0, [&]() {
- metaObject()->invokeMethod(&emitter, "emitSignalWithNoArg");
- metaObject()->invokeMethod(&emitter, "emitSignalWithNoArg");
- });
machine.addState(&initialState);
machine.addState(&finalState);
machine.setInitialState(&initialState);
+ connect(&machine, &QStateMachine::started, &emitter, [&]() {
+ metaObject()->invokeMethod(&emitter, "emitSignalWithNoArg");
+ metaObject()->invokeMethod(&emitter, "emitSignalWithNoArg");
+ });
connect(&machine, &QStateMachine::finished, &emitter.thread, &QThread::quit);
machine.start();
QSignalSpy emittedSpy(&emitter, &SignalEmitter::signalWithNoArg);
diff --git a/tests/auto/corelib/tools/qbytearray/.gitattributes b/tests/auto/corelib/text/qbytearray/.gitattributes
index e04709aa2e..e04709aa2e 100644
--- a/tests/auto/corelib/tools/qbytearray/.gitattributes
+++ b/tests/auto/corelib/text/qbytearray/.gitattributes
diff --git a/tests/auto/corelib/tools/qbytearray/.gitignore b/tests/auto/corelib/text/qbytearray/.gitignore
index 3de7c3fab5..3de7c3fab5 100644
--- a/tests/auto/corelib/tools/qbytearray/.gitignore
+++ b/tests/auto/corelib/text/qbytearray/.gitignore
diff --git a/tests/auto/corelib/tools/qbytearray/android_testdata.qrc b/tests/auto/corelib/text/qbytearray/android_testdata.qrc
index 5d42f0f627..5d42f0f627 100644
--- a/tests/auto/corelib/tools/qbytearray/android_testdata.qrc
+++ b/tests/auto/corelib/text/qbytearray/android_testdata.qrc
diff --git a/tests/auto/corelib/tools/qbytearray/qbytearray.pro b/tests/auto/corelib/text/qbytearray/qbytearray.pro
index c2101b0611..c2101b0611 100644
--- a/tests/auto/corelib/tools/qbytearray/qbytearray.pro
+++ b/tests/auto/corelib/text/qbytearray/qbytearray.pro
diff --git a/tests/auto/corelib/tools/qbytearray/rfc3252.txt b/tests/auto/corelib/text/qbytearray/rfc3252.txt
index b80c61bf0a..b80c61bf0a 100644
--- a/tests/auto/corelib/tools/qbytearray/rfc3252.txt
+++ b/tests/auto/corelib/text/qbytearray/rfc3252.txt
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
index 1ed41793dc..90dfcaef25 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray.cpp
@@ -138,9 +138,7 @@ private slots:
void reserveExtended();
void movablity_data();
void movablity();
-#if defined(Q_COMPILER_LAMBDA)
void literals();
-#endif
void toUpperLower_data();
void toUpperLower();
void isUpper();
@@ -1361,6 +1359,9 @@ void tst_QByteArray::toDouble_data()
QTest::newRow("trailing spaces") << QByteArray("1.2345 \n\r\t") << 1.2345 << true;
QTest::newRow("leading junk") << QByteArray("x1.2345") << 0.0 << false;
QTest::newRow("trailing junk") << QByteArray("1.2345x") << 0.0 << false;
+
+ QTest::newRow("raw, null plus junk") << QByteArray::fromRawData("1.2\0 junk", 9) << 0.0 << false;
+ QTest::newRow("raw, null-terminator not included") << QByteArray::fromRawData("2.3", 3) << 2.3 << true;
}
void tst_QByteArray::toDouble()
@@ -1934,7 +1935,7 @@ void tst_QByteArray::repeatedSignature() const
{
/* repated() should be a const member. */
const QByteArray string;
- string.repeated(3);
+ (void)string.repeated(3);
}
void tst_QByteArray::repeated() const
@@ -2126,7 +2127,7 @@ void tst_QByteArray::movablity()
{
QFETCH(QByteArray, array);
- QVERIFY(!QTypeInfo<QByteArray>::isStatic);
+ Q_STATIC_ASSERT(!QTypeInfo<QByteArray>::isStatic);
const int size = array.size();
const bool isEmpty = array.isEmpty();
@@ -2138,7 +2139,7 @@ void tst_QByteArray::movablity()
// we need only memory space not the instance
memSpace.~QByteArray();
// move array -> memSpace
- memcpy(&memSpace, &array, sizeof(QByteArray));
+ memcpy((void *)&memSpace, (const void *)&array, sizeof(QByteArray));
// reconstruct empty QByteArray
new (&array) QByteArray;
@@ -2148,8 +2149,8 @@ void tst_QByteArray::movablity()
QCOMPARE(memSpace.capacity(), capacity);
// try to not crash
- memSpace.toLower();
- memSpace.toUpper();
+ (void)memSpace.toLower();
+ (void)memSpace.toUpper();
memSpace.prepend('a');
memSpace.append("b", 1);
memSpace.squeeze();
@@ -2165,7 +2166,7 @@ void tst_QByteArray::movablity()
// move back memSpace -> array
array.~QByteArray();
- memcpy(&array, &memSpace, sizeof(QByteArray));
+ memcpy((void *)&array, (const void *)&memSpace, sizeof(QByteArray));
// reconstruct empty QByteArray
new (&memSpace) QByteArray;
@@ -2189,7 +2190,6 @@ void tst_QByteArray::movablity()
QVERIFY(true);
}
-#if defined(Q_COMPILER_LAMBDA)
// Only tested on c++0x compliant compiler or gcc
void tst_QByteArray::literals()
{
@@ -2210,7 +2210,6 @@ void tst_QByteArray::literals()
QVERIFY(str2.constData() == s);
QVERIFY(str2.data() != s);
}
-#endif
void tst_QByteArray::toUpperLower_data()
{
@@ -2242,28 +2241,28 @@ void tst_QByteArray::toUpperLower()
QCOMPARE(input.toLower(), lower);
QByteArray copy = input;
- QCOMPARE(qMove(copy).toUpper(), upper);
+ QCOMPARE(std::move(copy).toUpper(), upper);
copy = input;
copy.detach();
- QCOMPARE(qMove(copy).toUpper(), upper);
+ QCOMPARE(std::move(copy).toUpper(), upper);
copy = input;
- QCOMPARE(qMove(copy).toLower(), lower);
+ QCOMPARE(std::move(copy).toLower(), lower);
copy = input;
copy.detach();
- QCOMPARE(qMove(copy).toLower(), lower);
+ QCOMPARE(std::move(copy).toLower(), lower);
copy = lower;
- QCOMPARE(qMove(copy).toLower(), lower);
+ QCOMPARE(std::move(copy).toLower(), lower);
copy = lower;
copy.detach();
- QCOMPARE(qMove(copy).toLower(), lower);
+ QCOMPARE(std::move(copy).toLower(), lower);
copy = upper;
- QCOMPARE(qMove(copy).toUpper(), upper);
+ QCOMPARE(std::move(copy).toUpper(), upper);
copy = upper;
copy.detach();
- QCOMPARE(qMove(copy).toUpper(), upper);
+ QCOMPARE(std::move(copy).toUpper(), upper);
}
void tst_QByteArray::isUpper()
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm b/tests/auto/corelib/text/qbytearray/tst_qbytearray_mac.mm
index 98146e3525..98146e3525 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
+++ b/tests/auto/corelib/text/qbytearray/tst_qbytearray_mac.mm
diff --git a/tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro b/tests/auto/corelib/text/qbytearraylist/qbytearraylist.pro
index 6c05c288cf..6c05c288cf 100644
--- a/tests/auto/corelib/tools/qbytearraylist/qbytearraylist.pro
+++ b/tests/auto/corelib/text/qbytearraylist/qbytearraylist.pro
diff --git a/tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp b/tests/auto/corelib/text/qbytearraylist/tst_qbytearraylist.cpp
index 2d2c536453..09ce41337e 100644
--- a/tests/auto/corelib/tools/qbytearraylist/tst_qbytearraylist.cpp
+++ b/tests/auto/corelib/text/qbytearraylist/tst_qbytearraylist.cpp
@@ -194,22 +194,22 @@ void tst_QByteArrayList::operator_plus() const
{
QByteArrayList bal1 = lhs;
const QByteArrayList bal2 = rhs;
- QCOMPARE(qMove(bal1) + bal2, expectedResult);
+ QCOMPARE(std::move(bal1) + bal2, expectedResult);
}
{
QList<QByteArray> lba1 = lhs;
const QByteArrayList bal2 = rhs;
- QCOMPARE(qMove(lba1) + bal2, expectedResult);
+ QCOMPARE(std::move(lba1) + bal2, expectedResult);
}
{
QByteArrayList bal1 = lhs;
const QList<QByteArray> lba2 = rhs;
- QCOMPARE(qMove(bal1) + lba2, expectedResult);
+ QCOMPARE(std::move(bal1) + lba2, expectedResult);
}
{
QList<QByteArray> lba1 = lhs;
const QList<QByteArray> lba2 = rhs;
- QCOMPARE(qMove(lba1) + lba2, QList<QByteArray>(expectedResult)); // check we don't mess with old code
+ QCOMPARE(std::move(lba1) + lba2, QList<QByteArray>(expectedResult)); // check we don't mess with old code
}
// operator += for const lvalues
@@ -232,7 +232,7 @@ void tst_QByteArrayList::operator_plus() const
QByteArrayList t1 = lhs;
QByteArrayList t2 = rhs;
- QCOMPARE(qMove(t1) + t2, expectedResult);
+ QCOMPARE(std::move(t1) + t2, expectedResult);
}
void tst_QByteArrayList::operator_plus_data() const
@@ -287,7 +287,6 @@ void tst_QByteArrayList::indexOf() const
void tst_QByteArrayList::initializerList() const
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
// constructor
QByteArrayList v1 = {QByteArray("hello"),"world",QByteArray("plop")};
QCOMPARE(v1, (QByteArrayList() << "hello" << "world" << "plop"));
@@ -296,9 +295,6 @@ void tst_QByteArrayList::initializerList() const
QByteArrayList v2;
v2 = {QByteArray("hello"),"world",QByteArray("plop")};
QCOMPARE(v2, v1);
-#else
- QSKIP("This test requires C++11 initializer_list support in the compiler.");
-#endif
}
QTEST_APPLESS_MAIN(tst_QByteArrayList)
diff --git a/tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro b/tests/auto/corelib/text/qbytearraymatcher/qbytearraymatcher.pro
index 9d4d5964c9..9d4d5964c9 100644
--- a/tests/auto/corelib/tools/qbytearraymatcher/qbytearraymatcher.pro
+++ b/tests/auto/corelib/text/qbytearraymatcher/qbytearraymatcher.pro
diff --git a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp
index 647a3ae379..647a3ae379 100644
--- a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp
+++ b/tests/auto/corelib/text/qbytearraymatcher/tst_qbytearraymatcher.cpp
diff --git a/tests/auto/corelib/tools/qbytedatabuffer/.gitignore b/tests/auto/corelib/text/qbytedatabuffer/.gitignore
index 3024a4dba2..3024a4dba2 100644
--- a/tests/auto/corelib/tools/qbytedatabuffer/.gitignore
+++ b/tests/auto/corelib/text/qbytedatabuffer/.gitignore
diff --git a/tests/auto/corelib/tools/qbytedatabuffer/qbytedatabuffer.pro b/tests/auto/corelib/text/qbytedatabuffer/qbytedatabuffer.pro
index e23018f96a..e23018f96a 100644
--- a/tests/auto/corelib/tools/qbytedatabuffer/qbytedatabuffer.pro
+++ b/tests/auto/corelib/text/qbytedatabuffer/qbytedatabuffer.pro
diff --git a/tests/auto/corelib/tools/qbytedatabuffer/tst_qbytedatabuffer.cpp b/tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp
index 59f4d153e6..59f4d153e6 100644
--- a/tests/auto/corelib/tools/qbytedatabuffer/tst_qbytedatabuffer.cpp
+++ b/tests/auto/corelib/text/qbytedatabuffer/tst_qbytedatabuffer.cpp
diff --git a/tests/auto/corelib/tools/qchar/.gitignore b/tests/auto/corelib/text/qchar/.gitignore
index 341b3e6c3f..341b3e6c3f 100644
--- a/tests/auto/corelib/tools/qchar/.gitignore
+++ b/tests/auto/corelib/text/qchar/.gitignore
diff --git a/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt b/tests/auto/corelib/text/qchar/data/NormalizationTest.txt
index 0290080998..0290080998 100644
--- a/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
+++ b/tests/auto/corelib/text/qchar/data/NormalizationTest.txt
diff --git a/tests/auto/corelib/tools/qchar/qchar.pro b/tests/auto/corelib/text/qchar/qchar.pro
index 70c1222988..70c1222988 100644
--- a/tests/auto/corelib/tools/qchar/qchar.pro
+++ b/tests/auto/corelib/text/qchar/qchar.pro
diff --git a/tests/auto/corelib/tools/qchar/testdata.qrc b/tests/auto/corelib/text/qchar/testdata.qrc
index 7b3fb2461c..7b3fb2461c 100644
--- a/tests/auto/corelib/tools/qchar/testdata.qrc
+++ b/tests/auto/corelib/text/qchar/testdata.qrc
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/text/qchar/tst_qchar.cpp
index cf4f6d21e2..cf4f6d21e2 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/text/qchar/tst_qchar.cpp
diff --git a/tests/auto/corelib/tools/qcollator/qcollator.pro b/tests/auto/corelib/text/qcollator/qcollator.pro
index 2f3995a75f..b7aa256ded 100644
--- a/tests/auto/corelib/tools/qcollator/qcollator.pro
+++ b/tests/auto/corelib/text/qcollator/qcollator.pro
@@ -3,4 +3,3 @@ TARGET = tst_qcollator
QT = core-private testlib
SOURCES = tst_qcollator.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-qtConfig(icu): DEFINES += QT_USE_ICU
diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp
index 72f88a235d..2ae9c6e159 100644
--- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
+++ b/tests/auto/corelib/text/qcollator/tst_qcollator.cpp
@@ -47,7 +47,6 @@ private Q_SLOTS:
void state();
};
-#ifdef Q_COMPILER_RVALUE_REFS
static bool dpointer_is_null(QCollator &c)
{
char mem[sizeof c];
@@ -58,11 +57,9 @@ static bool dpointer_is_null(QCollator &c)
return false;
return true;
}
-#endif
void tst_QCollator::moveSemantics()
{
-#ifdef Q_COMPILER_RVALUE_REFS
const QLocale de_AT(QLocale::German, QLocale::Austria);
QCollator c1(de_AT);
@@ -78,9 +75,6 @@ void tst_QCollator::moveSemantics()
c1 = std::move(c2);
QCOMPARE(c1.locale(), de_AT);
QVERIFY(dpointer_is_null(c2));
-#else
- QSKIP("The compiler is not in C++11 mode or does not support move semantics.");
-#endif
}
diff --git a/tests/auto/corelib/tools/qlatin1string/.gitignore b/tests/auto/corelib/text/qlatin1string/.gitignore
index dddf56b2df..dddf56b2df 100644
--- a/tests/auto/corelib/tools/qlatin1string/.gitignore
+++ b/tests/auto/corelib/text/qlatin1string/.gitignore
diff --git a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro b/tests/auto/corelib/text/qlatin1string/qlatin1string.pro
index 61054b40e4..61054b40e4 100644
--- a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
+++ b/tests/auto/corelib/text/qlatin1string/qlatin1string.pro
diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp
index dcfb0aa042..0427c81b85 100644
--- a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
+++ b/tests/auto/corelib/text/qlatin1string/tst_qlatin1string.cpp
@@ -45,6 +45,7 @@ class tst_QLatin1String : public QObject
private Q_SLOTS:
void at();
+ void arg() const;
void midLeftRight();
void nullString();
void emptyString();
@@ -63,6 +64,47 @@ void tst_QLatin1String::at()
QCOMPARE(l1[l1.size() - 1], QLatin1Char('d'));
}
+void tst_QLatin1String::arg() const
+{
+#define CHECK1(pattern, arg1, expected) \
+ do { \
+ auto p = QLatin1String(pattern); \
+ QCOMPARE(p.arg(QLatin1String(arg1)), expected); \
+ QCOMPARE(p.arg(u"" arg1), expected); \
+ QCOMPARE(p.arg(QStringLiteral(arg1)), expected); \
+ QCOMPARE(p.arg(QString(QLatin1String(arg1))), expected); \
+ } while (false) \
+ /*end*/
+#define CHECK2(pattern, arg1, arg2, expected) \
+ do { \
+ auto p = QLatin1String(pattern); \
+ QCOMPARE(p.arg(QLatin1String(arg1), QLatin1String(arg2)), expected); \
+ QCOMPARE(p.arg(u"" arg1, QLatin1String(arg2)), expected); \
+ QCOMPARE(p.arg(QLatin1String(arg1), u"" arg2), expected); \
+ QCOMPARE(p.arg(u"" arg1, u"" arg2), expected); \
+ } while (false) \
+ /*end*/
+
+ CHECK1("", "World", "");
+ CHECK1("%1", "World", "World");
+ CHECK1("!%1?", "World", "!World?");
+ CHECK1("%1%1", "World", "WorldWorld");
+ CHECK1("%1%2", "World", "World%2");
+ CHECK1("%2%1", "World", "%2World");
+
+ CHECK2("", "Hello", "World", "");
+ CHECK2("%1", "Hello", "World", "Hello");
+ CHECK2("!%1, %2?", "Hello", "World", "!Hello, World?");
+ CHECK2("%1%1", "Hello", "World", "HelloHello");
+ CHECK2("%1%2", "Hello", "World", "HelloWorld");
+ CHECK2("%2%1", "Hello", "World", "WorldHello");
+
+#undef CHECK2
+#undef CHECK1
+
+ QCOMPARE(QLatin1String(" %2 %2 %1 %3 ").arg(QLatin1Char('c'), QChar::CarriageReturn, u'C'), " \r \r c C ");
+}
+
void tst_QLatin1String::midLeftRight()
{
const QLatin1String l1("Hello World");
diff --git a/tests/auto/corelib/tools/qlocale/.gitignore b/tests/auto/corelib/text/qlocale/.gitignore
index 21ab80a2af..21ab80a2af 100644
--- a/tests/auto/corelib/tools/qlocale/.gitignore
+++ b/tests/auto/corelib/text/qlocale/.gitignore
diff --git a/tests/auto/corelib/tools/qlocale/qlocale.pro b/tests/auto/corelib/text/qlocale/qlocale.pro
index 5161200260..5161200260 100644
--- a/tests/auto/corelib/tools/qlocale/qlocale.pro
+++ b/tests/auto/corelib/text/qlocale/qlocale.pro
diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp b/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp
index 1e1bcc8c5f..1e1bcc8c5f 100644
--- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp
+++ b/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.cpp
diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro b/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.pro
index 3e283c05a4..3e283c05a4 100644
--- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.pro
+++ b/tests/auto/corelib/text/qlocale/syslocaleapp/syslocaleapp.pro
diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/text/qlocale/test/test.pro
index f7243e99a7..f7243e99a7 100644
--- a/tests/auto/corelib/tools/qlocale/test/test.pro
+++ b/tests/auto/corelib/text/qlocale/test/test.pro
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index be2e2a2e08..3aa3d97dbc 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -423,6 +423,7 @@ void tst_QLocale::defaulted_ctor()
}
QLocale::setDefault(QLocale(QLocale::C));
+ const QString empty;
TEST_CTOR("C", C, AnyCountry)
TEST_CTOR("bla", C, AnyCountry)
@@ -431,7 +432,7 @@ void tst_QLocale::defaulted_ctor()
TEST_CTOR("zz...", C, AnyCountry)
TEST_CTOR("", C, AnyCountry)
TEST_CTOR("en/", C, AnyCountry)
- TEST_CTOR(QString::null, C, AnyCountry)
+ TEST_CTOR(empty, C, AnyCountry)
TEST_CTOR("en", English, UnitedStates)
TEST_CTOR("en", English, UnitedStates)
TEST_CTOR("en.", English, UnitedStates)
@@ -1458,8 +1459,8 @@ void tst_QLocale::dayOfWeek()
QCOMPARE(QLocale::c().toString(date, "ddd"), shortName);
QCOMPARE(QLocale::c().toString(date, "dddd"), longName);
- QCOMPARE(QLocale::c().toString(date, QStringViewLiteral("ddd")), shortName);
- QCOMPARE(QLocale::c().toString(date, QStringViewLiteral("dddd")), longName);
+ QCOMPARE(QLocale::c().toString(date, u"ddd"), shortName);
+ QCOMPARE(QLocale::c().toString(date, u"dddd"), longName);
}
void tst_QLocale::formatDate_data()
@@ -2458,9 +2459,9 @@ void tst_QLocale::timeFormat()
QCOMPARE(c.timeFormat(QLocale::NarrowFormat), c.timeFormat(QLocale::ShortFormat));
const QLocale no("no_NO");
- QCOMPARE(no.timeFormat(QLocale::NarrowFormat), QLatin1String("HH.mm"));
- QCOMPARE(no.timeFormat(QLocale::ShortFormat), QLatin1String("HH.mm"));
- QCOMPARE(no.timeFormat(QLocale::LongFormat), QLatin1String("HH.mm.ss t"));
+ QCOMPARE(no.timeFormat(QLocale::NarrowFormat), QLatin1String("HH:mm"));
+ QCOMPARE(no.timeFormat(QLocale::ShortFormat), QLatin1String("HH:mm"));
+ QCOMPARE(no.timeFormat(QLocale::LongFormat), QLatin1String("HH:mm:ss t"));
const QLocale id("id_ID");
QCOMPARE(id.timeFormat(QLocale::ShortFormat), QLatin1String("HH.mm"));
@@ -2482,9 +2483,9 @@ void tst_QLocale::dateTimeFormat()
QCOMPARE(c.dateTimeFormat(QLocale::NarrowFormat), c.dateTimeFormat(QLocale::ShortFormat));
const QLocale no("no_NO");
- QCOMPARE(no.dateTimeFormat(QLocale::NarrowFormat), QLatin1String("dd.MM.yyyy HH.mm"));
- QCOMPARE(no.dateTimeFormat(QLocale::ShortFormat), QLatin1String("dd.MM.yyyy HH.mm"));
- QCOMPARE(no.dateTimeFormat(QLocale::LongFormat), QLatin1String("dddd d. MMMM yyyy HH.mm.ss t"));
+ QCOMPARE(no.dateTimeFormat(QLocale::NarrowFormat), QLatin1String("dd.MM.yyyy HH:mm"));
+ QCOMPARE(no.dateTimeFormat(QLocale::ShortFormat), QLatin1String("dd.MM.yyyy HH:mm"));
+ QCOMPARE(no.dateTimeFormat(QLocale::LongFormat), QLatin1String("dddd d. MMMM yyyy HH:mm:ss t"));
}
void tst_QLocale::monthName()
diff --git a/tests/auto/corelib/tools/qregexp/.gitignore b/tests/auto/corelib/text/qregexp/.gitignore
index e6e629ee2c..e6e629ee2c 100644
--- a/tests/auto/corelib/tools/qregexp/.gitignore
+++ b/tests/auto/corelib/text/qregexp/.gitignore
diff --git a/tests/auto/corelib/tools/qregexp/qregexp.pro b/tests/auto/corelib/text/qregexp/qregexp.pro
index 5f6ff0a71c..5f6ff0a71c 100644
--- a/tests/auto/corelib/tools/qregexp/qregexp.pro
+++ b/tests/auto/corelib/text/qregexp/qregexp.pro
diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/text/qregexp/tst_qregexp.cpp
index a8111af6c1..a8111af6c1 100644
--- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
+++ b/tests/auto/corelib/text/qregexp/tst_qregexp.cpp
diff --git a/tests/auto/corelib/tools/qregularexpression/.gitignore b/tests/auto/corelib/text/qregularexpression/.gitignore
index 4650b4454e..4650b4454e 100644
--- a/tests/auto/corelib/tools/qregularexpression/.gitignore
+++ b/tests/auto/corelib/text/qregularexpression/.gitignore
diff --git a/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro b/tests/auto/corelib/text/qregularexpression/qregularexpression.pro
index ec8189717e..ec8189717e 100644
--- a/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
+++ b/tests/auto/corelib/text/qregularexpression/qregularexpression.pro
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp
index c02756d76a..c02756d76a 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp
diff --git a/tests/auto/corelib/tools/qstring/.gitignore b/tests/auto/corelib/text/qstring/.gitignore
index c2ea8d0336..c2ea8d0336 100644
--- a/tests/auto/corelib/tools/qstring/.gitignore
+++ b/tests/auto/corelib/text/qstring/.gitignore
diff --git a/tests/auto/corelib/tools/qstring/double_data.h b/tests/auto/corelib/text/qstring/double_data.h
index 0d59ecb5ff..0d59ecb5ff 100644
--- a/tests/auto/corelib/tools/qstring/double_data.h
+++ b/tests/auto/corelib/text/qstring/double_data.h
diff --git a/tests/auto/corelib/tools/qstring/qstring.pro b/tests/auto/corelib/text/qstring/qstring.pro
index ec8a9b5df5..5fff5530b7 100644
--- a/tests/auto/corelib/tools/qstring/qstring.pro
+++ b/tests/auto/corelib/text/qstring/qstring.pro
@@ -2,8 +2,7 @@ CONFIG += testcase
TARGET = tst_qstring
QT = core-private testlib
SOURCES = tst_qstring.cpp
-DEFINES += QT_NO_CAST_TO_ASCII
-qtConfig(icu): DEFINES += QT_USE_ICU
+# DEFINES += QT_NO_CAST_TO_ASCII # actively #undef-ed by tst_qstring.cpp
qtConfig(c++11): CONFIG += c++11
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index e8ed22e427..2108e99f20 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -37,6 +37,7 @@
# undef QT_ASCII_CAST_WARNINGS
#endif
+#include <private/qglobal_p.h> // for the icu feature test
#include <QtTest/QtTest>
#include <qregexp.h>
#include <qregularexpression.h>
@@ -482,8 +483,8 @@ private slots:
void indexOf2();
void indexOf3_data();
// void indexOf3();
- void sprintf();
- void sprintfS();
+ void asprintf();
+ void asprintfS();
void fill();
void truncate();
void chop_data();
@@ -521,7 +522,9 @@ private slots:
void stringRef_local8Bit_data();
void stringRef_local8Bit();
void fromLatin1();
+#if QT_DEPRECATED_SINCE(5, 0)
void fromAscii();
+#endif
void fromUcs4();
void toUcs4();
void arg();
@@ -575,10 +578,10 @@ private slots:
void repeated_data() const;
void compareRef();
void arg_locale();
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
void toUpperLower_icu();
#endif
-#if !defined(QT_NO_UNICODE_LITERAL) && defined(Q_COMPILER_LAMBDA)
+#if !defined(QT_NO_UNICODE_LITERAL)
void literals();
#endif
void eightBitLiterals_data();
@@ -612,7 +615,7 @@ QString verifyZeroTermination(const QString &str)
int strSize = str.size();
QChar strTerminator = str.constData()[strSize];
if (QChar('\0') != strTerminator)
- return QString::fromAscii(
+ return QString::fromLatin1(
"*** Result ('%1') not null-terminated: 0x%2 ***").arg(str)
.arg(strTerminator.unicode(), 4, 16, QChar('0'));
@@ -625,11 +628,11 @@ QString verifyZeroTermination(const QString &str)
const_cast<QChar *>(strData)[strSize] = QChar('x');
if (QChar('x') != str.constData()[strSize]) {
- return QString::fromAscii("*** Failed to replace null-terminator in "
+ return QString::fromLatin1("*** Failed to replace null-terminator in "
"result ('%1') ***").arg(str);
}
if (str != strCopy) {
- return QString::fromAscii( "*** Result ('%1') differs from its copy "
+ return QString::fromLatin1( "*** Result ('%1') differs from its copy "
"after null-terminator was replaced ***").arg(str);
}
const_cast<QChar *>(strData)[strSize] = QChar('\0'); // Restore sanity
@@ -1075,9 +1078,8 @@ void tst_QString::isNull()
QString a;
QVERIFY(a.isNull());
- const char *zero = 0;
- a.sprintf( zero );
- QVERIFY(!a.isNull());
+ const char *zero = nullptr;
+ QVERIFY(!QString::asprintf(zero).isNull());
}
QT_WARNING_POP
@@ -1263,75 +1265,66 @@ static inline const void *ptrValue(quintptr v)
return reinterpret_cast<const void *>(v);
}
-void tst_QString::sprintf()
+void tst_QString::asprintf()
{
QString a;
- a.sprintf("COMPARE");
- QCOMPARE(a, QLatin1String("COMPARE"));
- a.sprintf("%%%d",1);
- QCOMPARE(a, QLatin1String("%1"));
- QCOMPARE(a.sprintf("X%dY",2), QLatin1String("X2Y"));
- QCOMPARE(a.sprintf("X%9iY", 50000 ), QLatin1String("X 50000Y"));
- QCOMPARE(a.sprintf("X%-9sY","hello"), QLatin1String("Xhello Y"));
- QCOMPARE(a.sprintf("X%-9iY", 50000 ), QLatin1String("X50000 Y"));
- QCOMPARE(a.sprintf("%lf", 1.23), QLatin1String("1.230000"));
- QCOMPARE(a.sprintf("%lf", 1.23456789), QLatin1String("1.234568"));
- QCOMPARE(a.sprintf("%p", ptrValue(0xbfffd350)), QLatin1String("0xbfffd350"));
- QCOMPARE(a.sprintf("%p", ptrValue(0)), QLatin1String("0x0"));
+ QCOMPARE(QString::asprintf("COMPARE"), QLatin1String("COMPARE"));
+ QCOMPARE(QString::asprintf("%%%d", 1), QLatin1String("%1"));
+ QCOMPARE(QString::asprintf("X%dY",2), QLatin1String("X2Y"));
+ QCOMPARE(QString::asprintf("X%9iY", 50000 ), QLatin1String("X 50000Y"));
+ QCOMPARE(QString::asprintf("X%-9sY","hello"), QLatin1String("Xhello Y"));
+ QCOMPARE(QString::asprintf("X%-9iY", 50000 ), QLatin1String("X50000 Y"));
+ QCOMPARE(QString::asprintf("%lf", 1.23), QLatin1String("1.230000"));
+ QCOMPARE(QString::asprintf("%lf", 1.23456789), QLatin1String("1.234568"));
+ QCOMPARE(QString::asprintf("%p", ptrValue(0xbfffd350)), QLatin1String("0xbfffd350"));
+ QCOMPARE(QString::asprintf("%p", ptrValue(0)), QLatin1String("0x0"));
int i = 6;
long l = -2;
float f = 4.023f;
- QString S1;
- S1.sprintf("%d %ld %f",i,l,f);
- QCOMPARE(S1, QLatin1String("6 -2 4.023000"));
+ QCOMPARE(QString::asprintf("%d %ld %f", i, l, f), QLatin1String("6 -2 4.023000"));
double d = -514.25683;
- S1.sprintf("%f",d);
- QCOMPARE(S1, QLatin1String("-514.256830"));
+ QCOMPARE(QString::asprintf("%f", d), QLatin1String("-514.256830"));
}
-void tst_QString::sprintfS()
+void tst_QString::asprintfS()
{
- QString a;
- QCOMPARE(a.sprintf("%.3s", "Hello" ), QLatin1String("Hel"));
- QCOMPARE(a.sprintf("%10.3s", "Hello" ), QLatin1String(" Hel"));
- QCOMPARE(a.sprintf("%.10s", "Hello" ), QLatin1String("Hello"));
- QCOMPARE(a.sprintf("%10.10s", "Hello" ), QLatin1String(" Hello"));
- QCOMPARE(a.sprintf("%-10.10s", "Hello" ), QLatin1String("Hello "));
- QCOMPARE(a.sprintf("%-10.3s", "Hello" ), QLatin1String("Hel "));
- QCOMPARE(a.sprintf("%-5.5s", "Hello" ), QLatin1String("Hello"));
+ QCOMPARE(QString::asprintf("%.3s", "Hello" ), QLatin1String("Hel"));
+ QCOMPARE(QString::asprintf("%10.3s", "Hello" ), QLatin1String(" Hel"));
+ QCOMPARE(QString::asprintf("%.10s", "Hello" ), QLatin1String("Hello"));
+ QCOMPARE(QString::asprintf("%10.10s", "Hello" ), QLatin1String(" Hello"));
+ QCOMPARE(QString::asprintf("%-10.10s", "Hello" ), QLatin1String("Hello "));
+ QCOMPARE(QString::asprintf("%-10.3s", "Hello" ), QLatin1String("Hel "));
+ QCOMPARE(QString::asprintf("%-5.5s", "Hello" ), QLatin1String("Hello"));
// Check utf8 conversion for %s
- QCOMPARE(a.sprintf("%s", "\303\266\303\244\303\274\303\226\303\204\303\234\303\270\303\246\303\245\303\230\303\206\303\205"), QString::fromLatin1("\366\344\374\326\304\334\370\346\345\330\306\305"));
+ QCOMPARE(QString::asprintf("%s", "\303\266\303\244\303\274\303\226\303\204\303\234\303\270\303\246\303\245\303\230\303\206\303\205"), QString::fromLatin1("\366\344\374\326\304\334\370\346\345\330\306\305"));
int n1;
- a.sprintf("%s%n%s", "hello", &n1, "goodbye");
+ QCOMPARE(QString::asprintf("%s%n%s", "hello", &n1, "goodbye"), QString("hellogoodbye"));
QCOMPARE(n1, 5);
- QCOMPARE(a, QString("hellogoodbye"));
qlonglong n2;
- a.sprintf("%s%s%lln%s", "foo", "bar", &n2, "whiz");
+ QCOMPARE(QString::asprintf("%s%s%lln%s", "foo", "bar", &n2, "whiz"), QString("foobarwhiz"));
QCOMPARE((int)n2, 6);
- QCOMPARE(a, QString("foobarwhiz"));
{ // %ls
- QCOMPARE(a.sprintf("%.3ls", qUtf16Printable("Hello")), QLatin1String("Hel"));
- QCOMPARE(a.sprintf("%10.3ls", qUtf16Printable("Hello")), QLatin1String(" Hel"));
- QCOMPARE(a.sprintf("%.10ls", qUtf16Printable("Hello")), QLatin1String("Hello"));
- QCOMPARE(a.sprintf("%10.10ls", qUtf16Printable("Hello")), QLatin1String(" Hello"));
- QCOMPARE(a.sprintf("%-10.10ls", qUtf16Printable("Hello")), QLatin1String("Hello "));
- QCOMPARE(a.sprintf("%-10.3ls", qUtf16Printable("Hello")), QLatin1String("Hel "));
- QCOMPARE(a.sprintf("%-5.5ls", qUtf16Printable("Hello")), QLatin1String("Hello"));
+ QCOMPARE(QString::asprintf("%.3ls", qUtf16Printable("Hello")), QLatin1String("Hel"));
+ QCOMPARE(QString::asprintf("%10.3ls", qUtf16Printable("Hello")), QLatin1String(" Hel"));
+ QCOMPARE(QString::asprintf("%.10ls", qUtf16Printable("Hello")), QLatin1String("Hello"));
+ QCOMPARE(QString::asprintf("%10.10ls", qUtf16Printable("Hello")), QLatin1String(" Hello"));
+ QCOMPARE(QString::asprintf("%-10.10ls", qUtf16Printable("Hello")), QLatin1String("Hello "));
+ QCOMPARE(QString::asprintf("%-10.3ls", qUtf16Printable("Hello")), QLatin1String("Hel "));
+ QCOMPARE(QString::asprintf("%-5.5ls", qUtf16Printable("Hello")), QLatin1String("Hello"));
// Check utf16 is preserved for %ls
- QCOMPARE(a.sprintf("%ls",
+ QCOMPARE(QString::asprintf("%ls",
qUtf16Printable("\303\266\303\244\303\274\303\226\303\204\303\234\303\270\303\246\303\245\303\230\303\206\303\205")),
QLatin1String("\366\344\374\326\304\334\370\346\345\330\306\305"));
int n;
- a.sprintf("%ls%n%s", qUtf16Printable("hello"), &n, "goodbye");
+ QCOMPARE(QString::asprintf("%ls%n%s", qUtf16Printable("hello"), &n, "goodbye"), QLatin1String("hellogoodbye"));
QCOMPARE(n, 5);
- QCOMPARE(a, QLatin1String("hellogoodbye"));
}
}
@@ -2212,12 +2205,12 @@ void tst_QString::toUpper()
// call rvalue-ref while shared (the original mustn't change)
QString copy = s;
- QCOMPARE(qMove(copy).toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(std::move(copy).toUpper(), QString("GROSSSTRASSE"));
QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
// call rvalue-ref version on detached case
copy.clear();
- QCOMPARE(qMove(s).toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(std::move(s).toUpper(), QString("GROSSSTRASSE"));
}
QString lower, upper;
@@ -2243,7 +2236,7 @@ void tst_QString::toUpper()
upper += QChar(QChar::highSurrogate(0x10428));
QCOMPARE(lower.toUpper(), upper);
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
// test doesn't work with ICU support, since QChar is unaware of any locale
QEXPECT_FAIL("", "test doesn't work with ICU support, since QChar is unaware of any locale", Continue);
QVERIFY(false);
@@ -2255,7 +2248,7 @@ void tst_QString::toUpper()
if (upper.length() == 1)
QVERIFY(upper == QString(1, QChar(i).toUpper()));
}
-#endif
+#endif // icu
}
void tst_QString::toLower()
@@ -2303,7 +2296,7 @@ void tst_QString::toLower()
upper += QChar(QChar::highSurrogate(0x10400));
QCOMPARE( upper.toLower(), lower);
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
// test doesn't work with ICU support, since QChar is unaware of any locale
QEXPECT_FAIL("", "test doesn't work with ICU support, since QChar is unaware of any locale", Continue);
QVERIFY(false);
@@ -2315,7 +2308,7 @@ void tst_QString::toLower()
if (lower.length() == 1)
QVERIFY(str.toLower() == QString(1, QChar(i).toLower()));
}
-#endif
+#endif // icu
}
void tst_QString::isUpper()
@@ -2427,11 +2420,11 @@ void tst_QString::trimmed()
QCOMPARE(a.trimmed(), QLatin1String("a"));
a="Text";
- QCOMPARE(qMove(a).trimmed(), QLatin1String("Text"));
+ QCOMPARE(std::move(a).trimmed(), QLatin1String("Text"));
a=" ";
- QCOMPARE(qMove(a).trimmed(), QLatin1String(""));
+ QCOMPARE(std::move(a).trimmed(), QLatin1String(""));
a=" a ";
- QCOMPARE(qMove(a).trimmed(), QLatin1String("a"));
+ QCOMPARE(std::move(a).trimmed(), QLatin1String("a"));
}
void tst_QString::simplified_data()
@@ -2486,13 +2479,13 @@ void tst_QString::simplified()
// without detaching:
QString copy1 = full;
- QCOMPARE(qMove(full).simplified(), simple);
+ QCOMPARE(std::move(full).simplified(), simple);
QCOMPARE(full, orig_full);
// force a detach
if (!full.isEmpty())
full[0] = full[0];
- QCOMPARE(qMove(full).simplified(), simple);
+ QCOMPARE(std::move(full).simplified(), simple);
}
void tst_QString::insert_data(bool emptyIsNoop)
@@ -3789,7 +3782,7 @@ void tst_QString::startsWith()
QVERIFY( !a.startsWith("C") );
QVERIFY( !a.startsWith("ABCDEF") );
QVERIFY( a.startsWith("") );
- QVERIFY( a.startsWith(QString::null) );
+ QVERIFY( a.startsWith(QString()) );
QVERIFY( a.startsWith('A') );
QVERIFY( a.startsWith(QLatin1Char('A')) );
QVERIFY( a.startsWith(QChar('A')) );
@@ -3816,7 +3809,7 @@ void tst_QString::startsWith()
QVERIFY( !a.startsWith("c", Qt::CaseInsensitive) );
QVERIFY( !a.startsWith("abcdef", Qt::CaseInsensitive) );
QVERIFY( a.startsWith("", Qt::CaseInsensitive) );
- QVERIFY( a.startsWith(QString::null, Qt::CaseInsensitive) );
+ QVERIFY( a.startsWith(QString(), Qt::CaseInsensitive) );
QVERIFY( a.startsWith('a', Qt::CaseInsensitive) );
QVERIFY( a.startsWith('A', Qt::CaseInsensitive) );
QVERIFY( a.startsWith(QLatin1Char('a'), Qt::CaseInsensitive) );
@@ -3855,7 +3848,7 @@ void tst_QString::startsWith()
a = "";
QVERIFY( a.startsWith("") );
- QVERIFY( a.startsWith(QString::null) );
+ QVERIFY( a.startsWith(QString()) );
QVERIFY( !a.startsWith("ABC") );
QVERIFY( a.startsWith(QLatin1String("")) );
@@ -3868,7 +3861,7 @@ void tst_QString::startsWith()
a = QString();
QVERIFY( !a.startsWith("") );
- QVERIFY( a.startsWith(QString::null) );
+ QVERIFY( a.startsWith(QString()) );
QVERIFY( !a.startsWith("ABC") );
QVERIFY( !a.startsWith(QLatin1String("")) );
@@ -3897,7 +3890,7 @@ void tst_QString::endsWith()
QVERIFY( !a.endsWith("C") );
QVERIFY( !a.endsWith("ABCDEF") );
QVERIFY( a.endsWith("") );
- QVERIFY( a.endsWith(QString::null) );
+ QVERIFY( a.endsWith(QString()) );
QVERIFY( a.endsWith('B') );
QVERIFY( a.endsWith(QLatin1Char('B')) );
QVERIFY( a.endsWith(QChar('B')) );
@@ -3924,7 +3917,7 @@ void tst_QString::endsWith()
QVERIFY( !a.endsWith("c", Qt::CaseInsensitive) );
QVERIFY( !a.endsWith("abcdef", Qt::CaseInsensitive) );
QVERIFY( a.endsWith("", Qt::CaseInsensitive) );
- QVERIFY( a.endsWith(QString::null, Qt::CaseInsensitive) );
+ QVERIFY( a.endsWith(QString(), Qt::CaseInsensitive) );
QVERIFY( a.endsWith('b', Qt::CaseInsensitive) );
QVERIFY( a.endsWith('B', Qt::CaseInsensitive) );
QVERIFY( a.endsWith(QLatin1Char('b'), Qt::CaseInsensitive) );
@@ -3966,7 +3959,7 @@ void tst_QString::endsWith()
a = "";
QVERIFY( a.endsWith("") );
- QVERIFY( a.endsWith(QString::null) );
+ QVERIFY( a.endsWith(QString()) );
QVERIFY( !a.endsWith("ABC") );
QVERIFY( !a.endsWith(QLatin1Char(0)) );
QVERIFY( !a.endsWith(QLatin1Char('x')) );
@@ -3978,7 +3971,7 @@ void tst_QString::endsWith()
a = QString();
QVERIFY( !a.endsWith("") );
- QVERIFY( a.endsWith(QString::null) );
+ QVERIFY( a.endsWith(QString()) );
QVERIFY( !a.endsWith("ABC") );
QVERIFY( !a.endsWith(QLatin1String("")) );
@@ -4294,9 +4287,9 @@ void tst_QString::fromLocal8Bit_data()
//QTest::newRow("null5") << QByteArray() << 5 << QString();
//QTest::newRow("empty-1") << QByteArray("\0abcd", 5) << -1 << QString();
//QTest::newRow("empty0") << QByteArray() << 0 << QString();
- //QTest::newRow("empty5") << QByteArray("\0abcd", 5) << 5 << QString::fromAscii("\0abcd", 5);
- //QTest::newRow("other-1") << QByteArray("ab\0cd", 5) << -1 << QString::fromAscii("ab");
- //QTest::newRow("other5") << QByteArray("ab\0cd", 5) << 5 << QString::fromAscii("ab\0cd", 5);
+ //QTest::newRow("empty5") << QByteArray("\0abcd", 5) << 5 << QString::fromLatin1("\0abcd", 5);
+ //QTest::newRow("other-1") << QByteArray("ab\0cd", 5) << -1 << QString::fromLatin1("ab");
+ //QTest::newRow("other5") << QByteArray("ab\0cd", 5) << 5 << QString::fromLatin1("ab\0cd", 5);
}
void tst_QString::fromLocal8Bit()
@@ -4534,7 +4527,7 @@ void tst_QString::toLatin1Roundtrip()
// try the rvalue version of toLatin1()
QString s = unicodesrc;
- QCOMPARE(qMove(s).toLatin1(), latin1);
+ QCOMPARE(std::move(s).toLatin1(), latin1);
// and verify that the moved-from object can still be used
s = "foo";
@@ -4600,6 +4593,9 @@ void tst_QString::fromLatin1()
QVERIFY(a.size() == 5);
}
+#if QT_DEPRECATED_SINCE(5, 0)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
void tst_QString::fromAscii()
{
QString a;
@@ -4620,6 +4616,8 @@ void tst_QString::fromAscii()
a = QString::fromAscii("\0abcd", 5);
QVERIFY(a.size() == 5);
}
+QT_WARNING_POP
+#endif
void tst_QString::fromUcs4()
{
@@ -4769,7 +4767,7 @@ void tst_QString::arg()
QCOMPARE( s4.arg("foo"), QLatin1String("[foo]") );
QCOMPARE( s5.arg(QLatin1String("foo")), QLatin1String("[foo]") );
- QCOMPARE( s6.arg(QStringViewLiteral("foo")), QLatin1String("[foo]") );
+ QCOMPARE( s6.arg(u"foo"), QLatin1String("[foo]") );
QCOMPARE( s7.arg("foo"), QLatin1String("[foo]") );
QCOMPARE( s8.arg("foo"), QLatin1String("[foo %1]") );
QCOMPARE( s8.arg("foo").arg("bar"), QLatin1String("[foo bar]") );
@@ -4831,14 +4829,14 @@ void tst_QString::arg()
QCOMPARE( QString("%1").arg("hello", -10), QLatin1String("hello ") );
QCOMPARE( QString("%1").arg(QLatin1String("hello"), -5), QLatin1String("hello") );
- QCOMPARE( QString("%1").arg(QStringViewLiteral("hello"), -2), QLatin1String("hello") );
+ QCOMPARE( QString("%1").arg(u"hello", -2), QLatin1String("hello") );
QCOMPARE( QString("%1").arg("hello", 0), QLatin1String("hello") );
QCOMPARE( QString("%1").arg(QLatin1String("hello"), 2), QLatin1String("hello") );
- QCOMPARE( QString("%1").arg(QStringViewLiteral("hello"), 5), QLatin1String("hello") );
+ QCOMPARE( QString("%1").arg(u"hello", 5), QLatin1String("hello") );
QCOMPARE( QString("%1").arg("hello", 10), QLatin1String(" hello") );
QCOMPARE( QString("%1%1").arg("hello"), QLatin1String("hellohello") );
QCOMPARE( QString("%2%1").arg("hello"), QLatin1String("%2hello") );
- QCOMPARE( QString("%1%1").arg(QString::null), QLatin1String("") );
+ QCOMPARE( QString("%1%1").arg(QString()), QLatin1String("") );
QCOMPARE( QString("%2%1").arg(""), QLatin1String("%2") );
QCOMPARE( QString("%2 %L1").arg(12345.6789).arg(12345.6789),
@@ -4934,9 +4932,7 @@ void tst_QString::doubleOut()
QCOMPARE(QString::number(micro), expect);
QCOMPARE(QString("%1").arg(micro), expect);
{
- QString text;
- text.sprintf("%g", micro);
- QCOMPARE(text, expect);
+ QCOMPARE(QString::asprintf("%g", micro), expect);
}
{
QString text;
@@ -5480,8 +5476,6 @@ void tst_QString::tortureSprintfDouble()
{
const SprintfDoubleData *data = g_sprintf_double_data;
- QString s;
-
for (; data->fmt != 0; ++data) {
double d;
char *buff = (char *)&d;
@@ -5496,7 +5490,7 @@ void tst_QString::tortureSprintfDouble()
for (uint i = 0; i < 8; ++i)
buff[7 - i] = data->bytes[i];
# endif
- s.sprintf(data->fmt, d);
+ const QString s = QString::asprintf(data->fmt, d);
#ifdef QT_NO_FPU // reduced precision when running with hardfloats in qemu
if (d - 0.1 < 1e12)
QSKIP("clib sprintf doesn't fill with 0's on this platform");
@@ -5630,7 +5624,7 @@ void tst_QString::localeAwareCompare()
QStringRef r2(&s2, 0, s2.length());
if (!locale.isEmpty()) {
-#if defined (Q_OS_DARWIN) || defined(QT_USE_ICU)
+#if defined (Q_OS_DARWIN) || QT_CONFIG(icu)
QSKIP("Setting the locale is not supported on OS X or ICU (you can set the C locale, but that won't affect localeAwareCompare)");
#else
const char *newLocale = setlocale(LC_ALL, locale.toLatin1());
@@ -5638,10 +5632,10 @@ void tst_QString::localeAwareCompare()
setlocale(LC_ALL, "");
QSKIP("Please install the proper locale on this machine to test properly");
}
-#endif
+#endif // Darwin || icu
}
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
// ### for c1, ICU disagrees with libc on how to compare
QEXPECT_FAIL("c1", "ICU disagrees with test", Abort);
#endif
@@ -6450,32 +6444,24 @@ void tst_QString::QCharRefDetaching() const
void tst_QString::sprintfZU() const
{
{
- QString string;
size_t s = 6;
- string.sprintf("%zu", s);
- QCOMPARE(string, QString::fromLatin1("6"));
+ QCOMPARE(QString::asprintf("%zu", s), QString::fromLatin1("6"));
}
{
- QString string;
- string.sprintf("%s\n", "foo");
- QCOMPARE(string, QString::fromLatin1("foo\n"));
+ QCOMPARE(QString::asprintf("%s\n", "foo"), QString::fromLatin1("foo\n"));
}
{
/* This code crashed. I don't know how to reduce it further. In other words,
* both %zu and %s needs to be present. */
size_t s = 6;
- QString string;
- string.sprintf("%zu%s", s, "foo");
- QCOMPARE(string, QString::fromLatin1("6foo"));
+ QCOMPARE(QString::asprintf("%zu%s", s, "foo"), QString::fromLatin1("6foo"));
}
{
size_t s = 6;
- QString string;
- string.sprintf("%zu %s\n", s, "foo");
- QCOMPARE(string, QString::fromLatin1("6 foo\n"));
+ QCOMPARE(QString::asprintf("%zu %s\n", s, "foo"), QString::fromLatin1("6 foo\n"));
}
}
@@ -6607,7 +6593,7 @@ void tst_QString::arg_locale()
}
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
// Qt has to be built with ICU support
void tst_QString::toUpperLower_icu()
{
@@ -6641,9 +6627,9 @@ void tst_QString::toUpperLower_icu()
QCOMPARE(l.toLower(sup), sup);
QCOMPARE(l.toLower(QString::fromLatin1("i")), QString::fromLatin1("i"));
}
-#endif
+#endif // icu
-#if !defined(QT_NO_UNICODE_LITERAL) && defined(Q_COMPILER_LAMBDA)
+#if !defined(QT_NO_UNICODE_LITERAL)
// Only tested on c++0x compliant compiler or gcc
void tst_QString::literals()
{
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm b/tests/auto/corelib/text/qstring/tst_qstring_mac.mm
index 60bd3f9b15..60bd3f9b15 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
+++ b/tests/auto/corelib/text/qstring/tst_qstring_mac.mm
diff --git a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro b/tests/auto/corelib/text/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro
index 14dbe779db..14dbe779db 100644
--- a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro
+++ b/tests/auto/corelib/text/qstring_no_cast_from_bytearray/qstring_no_cast_from_bytearray.pro
diff --git a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/tst_qstring_no_cast_from_bytearray.cpp b/tests/auto/corelib/text/qstring_no_cast_from_bytearray/tst_qstring_no_cast_from_bytearray.cpp
index 47fbeb6069..47fbeb6069 100644
--- a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/tst_qstring_no_cast_from_bytearray.cpp
+++ b/tests/auto/corelib/text/qstring_no_cast_from_bytearray/tst_qstring_no_cast_from_bytearray.cpp
diff --git a/tests/auto/corelib/tools/qstringapisymmetry/.gitignore b/tests/auto/corelib/text/qstringapisymmetry/.gitignore
index d28de05438..d28de05438 100644
--- a/tests/auto/corelib/tools/qstringapisymmetry/.gitignore
+++ b/tests/auto/corelib/text/qstringapisymmetry/.gitignore
diff --git a/tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro b/tests/auto/corelib/text/qstringapisymmetry/qstringapisymmetry.pro
index a4e91e38bd..a4e91e38bd 100644
--- a/tests/auto/corelib/tools/qstringapisymmetry/qstringapisymmetry.pro
+++ b/tests/auto/corelib/text/qstringapisymmetry/qstringapisymmetry.pro
diff --git a/tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
index 82d58becfe..24382a2b61 100644
--- a/tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp
+++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Copyright (C) 2019 Mail.ru Group.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -48,6 +49,14 @@ QString toQString(const T &t) { return QString(t); }
QString toQString(const QStringRef &ref) { return ref.toString(); }
QString toQString(QStringView view) { return view.toString(); }
+template <typename Iterable>
+QStringList toQStringList(const Iterable &i) {
+ QStringList result;
+ for (auto &e : i)
+ result.push_back(toQString(e));
+ return result;
+}
+
// FIXME: these are missing at the time of writing, add them, then remove the dummies here:
#define MAKE_RELOP(op, A1, A2) \
static bool operator op (A1 lhs, A2 rhs) \
@@ -293,6 +302,26 @@ private Q_SLOTS:
void endsWith_QLatin1String_QChar() { endsWith_impl<QLatin1String, QChar>(); }
private:
+ void split_data(bool rhsHasVariableLength = true);
+ template <typename Haystack, typename Needle> void split_impl() const;
+
+private Q_SLOTS:
+ // test all combinations of {QString, QStringRef} x {QString, QLatin1String, QChar}:
+ void split_QString_QString_data() { split_data(); }
+ void split_QString_QString() { split_impl<QString, QString>(); }
+ void split_QString_QLatin1String_data() { split_data(); }
+ void split_QString_QLatin1String() { split_impl<QString, QLatin1String>(); }
+ void split_QString_QChar_data() { split_data(false); }
+ void split_QString_QChar() { split_impl<QString, QChar>(); }
+
+ void split_QStringRef_QString_data() { split_data(); }
+ void split_QStringRef_QString() { split_impl<QStringRef, QString>(); }
+ void split_QStringRef_QLatin1String_data() { split_data(); }
+ void split_QStringRef_QLatin1String() { split_impl<QStringRef, QLatin1String>(); }
+ void split_QStringRef_QChar_data() { split_data(false); }
+ void split_QStringRef_QChar() { split_impl<QStringRef, QChar>(); }
+
+private:
void mid_data();
template <typename String> void mid_impl();
@@ -416,6 +445,129 @@ private Q_SLOTS:
void toUcs4_QStringRef() { toUcs4_impl<QStringRef>(); }
void toUcs4_QStringView_data() { toUcs4_data(); }
void toUcs4_QStringView() { toUcs4_impl<QStringView>(); }
+
+private:
+ template <typename Haystack, typename Needle> void indexOf_impl() const;
+ void indexOf_data();
+
+private Q_SLOTS:
+ void indexOf_QString_QString_data() { indexOf_data(); }
+ void indexOf_QString_QString() { indexOf_impl<QString, QString>(); }
+ void indexOf_QString_QLatin1String_data() { indexOf_data(); }
+ void indexOf_QString_QLatin1String() { indexOf_impl<QString, QLatin1String>(); }
+ void indexOf_QString_QStringRef_data() { indexOf_data(); }
+ void indexOf_QString_QStringRef() { indexOf_impl<QString, QStringRef>(); }
+ void indexOf_QString_QStringView_data() { indexOf_data(); }
+ void indexOf_QString_QStringView() { indexOf_impl<QString, QStringView>(); }
+
+ void indexOf_QLatin1String_QString_data() { indexOf_data(); }
+ void indexOf_QLatin1String_QString() { indexOf_impl<QLatin1String, QString>(); }
+ void indexOf_QLatin1String_QLatin1String_data() { indexOf_data(); }
+ void indexOf_QLatin1String_QLatin1String() { indexOf_impl<QLatin1String, QLatin1String>(); }
+ void indexOf_QLatin1String_QStringRef_data() { indexOf_data(); }
+ void indexOf_QLatin1String_QStringRef() { indexOf_impl<QLatin1String, QStringRef>(); }
+ void indexOf_QLatin1String_QStringView_data() { indexOf_data(); }
+ void indexOf_QLatin1String_QStringView() { indexOf_impl<QLatin1String, QStringView>(); }
+
+ void indexOf_QStringRef_QString_data() { indexOf_data(); }
+ void indexOf_QStringRef_QString() { indexOf_impl<QStringRef, QString>(); }
+ void indexOf_QStringRef_QLatin1String_data() { indexOf_data(); }
+ void indexOf_QStringRef_QLatin1String() { indexOf_impl<QStringRef, QLatin1String>(); }
+ void indexOf_QStringRef_QStringRef_data() { indexOf_data(); }
+ void indexOf_QStringRef_QStringRef() { indexOf_impl<QStringRef, QStringRef>(); }
+ void indexOf_QStringRef_QStringView_data() { indexOf_data(); }
+ void indexOf_QStringRef_QStringView() { indexOf_impl<QStringRef, QStringView>(); }
+
+ void indexOf_QStringView_QString_data() { indexOf_data(); }
+ void indexOf_QStringView_QString() { indexOf_impl<QStringView, QString>(); }
+ void indexOf_QStringView_QLatin1String_data() { indexOf_data(); }
+ void indexOf_QStringView_QLatin1String() { indexOf_impl<QStringView, QLatin1String>(); }
+ void indexOf_QStringView_QStringRef_data() { indexOf_data(); }
+ void indexOf_QStringView_QStringRef() { indexOf_impl<QStringView, QStringRef>(); }
+ void indexOf_QStringView_QStringView_data() { indexOf_data(); }
+ void indexOf_QStringView_QStringView() { indexOf_impl<QStringView, QStringView>(); }
+
+private:
+ template <typename Haystack, typename Needle> void contains_impl() const;
+ void contains_data();
+
+private Q_SLOTS:
+ void contains_QString_QString_data() { contains_data(); }
+ void contains_QString_QString() { contains_impl<QString, QString>(); }
+ void contains_QString_QLatin1String_data() { contains_data(); }
+ void contains_QString_QLatin1String() { contains_impl<QString, QLatin1String>(); }
+ void contains_QString_QStringRef_data() { contains_data(); }
+ void contains_QString_QStringRef() { contains_impl<QString, QStringRef>(); }
+ void contains_QString_QStringView_data() { contains_data(); }
+ void contains_QString_QStringView() { contains_impl<QString, QStringView>(); }
+
+ void contains_QLatin1String_QString_data() { contains_data(); }
+ void contains_QLatin1String_QString() { contains_impl<QLatin1String, QString>(); }
+ void contains_QLatin1String_QLatin1String_data() { contains_data(); }
+ void contains_QLatin1String_QLatin1String() { contains_impl<QLatin1String, QLatin1String>(); }
+ void contains_QLatin1String_QStringRef_data() { contains_data(); }
+ void contains_QLatin1String_QStringRef() { contains_impl<QLatin1String, QStringRef>(); }
+ void contains_QLatin1String_QStringView_data() { contains_data(); }
+ void contains_QLatin1String_QStringView() { contains_impl<QLatin1String, QStringView>(); }
+
+ void contains_QStringRef_QString_data() { contains_data(); }
+ void contains_QStringRef_QString() { contains_impl<QStringRef, QString>(); }
+ void contains_QStringRef_QLatin1String_data() { contains_data(); }
+ void contains_QStringRef_QLatin1String() { contains_impl<QStringRef, QLatin1String>(); }
+ void contains_QStringRef_QStringRef_data() { contains_data(); }
+ void contains_QStringRef_QStringRef() { contains_impl<QStringRef, QStringRef>(); }
+ void contains_QStringRef_QStringView_data() { contains_data(); }
+ void contains_QStringRef_QStringView() { contains_impl<QStringRef, QStringView>(); }
+
+ void contains_QStringView_QString_data() { contains_data(); }
+ void contains_QStringView_QString() { contains_impl<QStringView, QString>(); }
+ void contains_QStringView_QLatin1String_data() { contains_data(); }
+ void contains_QStringView_QLatin1String() { contains_impl<QStringView, QLatin1String>(); }
+ void contains_QStringView_QStringRef_data() { contains_data(); }
+ void contains_QStringView_QStringRef() { contains_impl<QStringView, QStringRef>(); }
+ void contains_QStringView_QStringView_data() { contains_data(); }
+ void contains_QStringView_QStringView() { contains_impl<QStringView, QStringView>(); }
+
+private:
+ template <typename Haystack, typename Needle> void lastIndexOf_impl() const;
+ void lastIndexOf_data();
+
+private Q_SLOTS:
+ void lastIndexOf_QString_QString_data() { lastIndexOf_data(); }
+ void lastIndexOf_QString_QString() { lastIndexOf_impl<QString, QString>(); }
+ void lastIndexOf_QString_QLatin1String_data() { lastIndexOf_data(); }
+ void lastIndexOf_QString_QLatin1String() { lastIndexOf_impl<QString, QLatin1String>(); }
+ void lastIndexOf_QString_QStringRef_data() { lastIndexOf_data(); }
+ void lastIndexOf_QString_QStringRef() { lastIndexOf_impl<QString, QStringRef>(); }
+ void lastIndexOf_QString_QStringView_data() { lastIndexOf_data(); }
+ void lastIndexOf_QString_QStringView() { lastIndexOf_impl<QString, QStringView>(); }
+
+ void lastIndexOf_QLatin1String_QString_data() { lastIndexOf_data(); }
+ void lastIndexOf_QLatin1String_QString() { lastIndexOf_impl<QLatin1String, QString>(); }
+ void lastIndexOf_QLatin1String_QLatin1String_data() { lastIndexOf_data(); }
+ void lastIndexOf_QLatin1String_QLatin1String() { lastIndexOf_impl<QLatin1String, QLatin1String>(); }
+ void lastIndexOf_QLatin1String_QStringRef_data() { lastIndexOf_data(); }
+ void lastIndexOf_QLatin1String_QStringRef() { lastIndexOf_impl<QLatin1String, QStringRef>(); }
+ void lastIndexOf_QLatin1String_QStringView_data() { lastIndexOf_data(); }
+ void lastIndexOf_QLatin1String_QStringView() { lastIndexOf_impl<QLatin1String, QStringView>(); }
+
+ void lastIndexOf_QStringRef_QString_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringRef_QString() { lastIndexOf_impl<QStringRef, QString>(); }
+ void lastIndexOf_QStringRef_QLatin1String_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringRef_QLatin1String() { lastIndexOf_impl<QStringRef, QLatin1String>(); }
+ void lastIndexOf_QStringRef_QStringRef_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringRef_QStringRef() { lastIndexOf_impl<QStringRef, QStringRef>(); }
+ void lastIndexOf_QStringRef_QStringView_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringRef_QStringView() { lastIndexOf_impl<QStringRef, QStringView>(); }
+
+ void lastIndexOf_QStringView_QString_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringView_QString() { lastIndexOf_impl<QStringView, QString>(); }
+ void lastIndexOf_QStringView_QLatin1String_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringView_QLatin1String() { lastIndexOf_impl<QStringView, QLatin1String>(); }
+ void lastIndexOf_QStringView_QStringRef_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringView_QStringRef() { lastIndexOf_impl<QStringView, QStringRef>(); }
+ void lastIndexOf_QStringView_QStringView_data() { lastIndexOf_data(); }
+ void lastIndexOf_QStringView_QStringView() { lastIndexOf_impl<QStringView, QStringView>(); }
};
void tst_QStringApiSymmetry::compare_data(bool hasConceptOfNullAndEmpty)
@@ -540,6 +692,7 @@ void tst_QStringApiSymmetry::compare_impl() const
}
static QString empty = QLatin1String("");
+static QString null;
// the tests below rely on the fact that these objects' names match their contents:
static QString a = QStringLiteral("a");
static QString A = QStringLiteral("A");
@@ -547,6 +700,14 @@ static QString b = QStringLiteral("b");
static QString B = QStringLiteral("B");
static QString c = QStringLiteral("c");
static QString C = QStringLiteral("C");
+static QString d = QStringLiteral("d");
+static QString D = QStringLiteral("D");
+static QString e = QStringLiteral("e");
+static QString E = QStringLiteral("E");
+static QString f = QStringLiteral("f");
+static QString F = QStringLiteral("F");
+static QString g = QStringLiteral("g");
+static QString G = QStringLiteral("G");
static QString ab = QStringLiteral("ab");
static QString aB = QStringLiteral("aB");
static QString Ab = QStringLiteral("Ab");
@@ -738,6 +899,119 @@ void tst_QStringApiSymmetry::endsWith_impl() const
QCOMPARE(haystack.endsWith(needle, Qt::CaseInsensitive), resultCIS);
}
+void tst_QStringApiSymmetry::split_data(bool rhsHasVariableLength)
+{
+ QTest::addColumn<QStringRef>("haystackU16");
+ QTest::addColumn<QLatin1String>("haystackL1");
+ QTest::addColumn<QStringRef>("needleU16");
+ QTest::addColumn<QLatin1String>("needleL1");
+ QTest::addColumn<QStringList>("resultCS");
+ QTest::addColumn<QStringList>("resultCIS");
+
+ if (rhsHasVariableLength) {
+ QTest::addRow("null ~= null$") << QStringRef{} << QLatin1String{}
+ << QStringRef{} << QLatin1String{}
+ << QStringList{{}, {}} << QStringList{{}, {}};
+ QTest::addRow("empty ~= null$") << QStringRef{&empty} << QLatin1String("")
+ << QStringRef{} << QLatin1String{}
+ << QStringList{empty, empty} << QStringList{empty, empty};
+ QTest::addRow("a ~= null$") << QStringRef{&a} << QLatin1String{"a"}
+ << QStringRef{} << QLatin1String{}
+ << QStringList{empty, a, empty} << QStringList{empty, a, empty};
+ QTest::addRow("null ~= empty$") << QStringRef{} << QLatin1String{}
+ << QStringRef{&empty} << QLatin1String{""}
+ << QStringList{{}, {}} << QStringList{{}, {}};
+ QTest::addRow("a ~= empty$") << QStringRef{&a} << QLatin1String{"a"}
+ << QStringRef{&empty} << QLatin1String{""}
+ << QStringList{empty, a, empty} << QStringList{empty, a, empty};
+ QTest::addRow("empty ~= empty$") << QStringRef{&empty} << QLatin1String{""}
+ << QStringRef{&empty} << QLatin1String{""}
+ << QStringList{empty, empty} << QStringList{empty, empty};
+ }
+ QTest::addRow("null ~= a$") << QStringRef{} << QLatin1String{}
+ << QStringRef{&a} << QLatin1String{"a"}
+ << QStringList{{}} << QStringList{{}};
+ QTest::addRow("empty ~= a$") << QStringRef{&empty} << QLatin1String{""}
+ << QStringRef{&a} << QLatin1String{"a"}
+ << QStringList{empty} << QStringList{empty};
+
+#define ROW(h, n, cs, cis) \
+ QTest::addRow("%s ~= %s$", #h, #n) << QStringRef(&h) << QLatin1String(#h) \
+ << QStringRef(&n) << QLatin1String(#n) \
+ << QStringList cs << QStringList cis
+ ROW(a, a, ({empty, empty}), ({empty, empty}));
+ ROW(a, A, {a}, ({empty, empty}));
+ ROW(a, b, {a}, {a});
+
+ if (rhsHasVariableLength)
+ ROW(b, ab, {b}, {b});
+
+ ROW(ab, b, ({a, empty}), ({a, empty}));
+ if (rhsHasVariableLength) {
+ ROW(ab, ab, ({empty, empty}), ({empty, empty}));
+ ROW(ab, aB, {ab}, ({empty, empty}));
+ ROW(ab, Ab, {ab}, ({empty, empty}));
+ }
+ ROW(ab, c, {ab}, {ab});
+
+ if (rhsHasVariableLength)
+ ROW(bc, abc, {bc}, {bc});
+
+ ROW(Abc, c, ({Ab, empty}), ({Ab, empty}));
+#if 0
+ if (rhsHasVariableLength) {
+ ROW(Abc, bc, 1, 1);
+ ROW(Abc, bC, 0, 1);
+ ROW(Abc, Bc, 0, 1);
+ ROW(Abc, BC, 0, 1);
+ ROW(aBC, bc, 0, 1);
+ ROW(aBC, bC, 0, 1);
+ ROW(aBC, Bc, 0, 1);
+ ROW(aBC, BC, 1, 1);
+ }
+#endif
+ ROW(ABC, b, {ABC}, ({A, C}));
+ ROW(ABC, a, {ABC}, ({empty, BC}));
+#undef ROW
+}
+
+static QStringList skipped(const QStringList &sl)
+{
+ QStringList result;
+ result.reserve(sl.size());
+ for (const QString &s : sl) {
+ if (!s.isEmpty())
+ result.push_back(s);
+ }
+ return result;
+}
+
+template <typename Haystack, typename Needle>
+void tst_QStringApiSymmetry::split_impl() const
+{
+ QFETCH(const QStringRef, haystackU16);
+ QFETCH(const QLatin1String, haystackL1);
+ QFETCH(const QStringRef, needleU16);
+ QFETCH(const QLatin1String, needleL1);
+ QFETCH(const QStringList, resultCS);
+ QFETCH(const QStringList, resultCIS);
+
+ const QStringList skippedResultCS = skipped(resultCS);
+ const QStringList skippedResultCIS = skipped(resultCIS);
+
+ const auto haystackU8 = haystackU16.toUtf8();
+ const auto needleU8 = needleU16.toUtf8();
+
+ const auto haystack = make<Haystack>(haystackU16, haystackL1, haystackU8);
+ const auto needle = make<Needle>(needleU16, needleL1, needleU8);
+
+ QCOMPARE(toQStringList(haystack.split(needle)), resultCS);
+ QCOMPARE(toQStringList(haystack.split(needle, Qt::KeepEmptyParts, Qt::CaseSensitive)), resultCS);
+ QCOMPARE(toQStringList(haystack.split(needle, Qt::KeepEmptyParts, Qt::CaseInsensitive)), resultCIS);
+ QCOMPARE(toQStringList(haystack.split(needle, Qt::SkipEmptyParts, Qt::CaseSensitive)), skippedResultCS);
+ QCOMPARE(toQStringList(haystack.split(needle, Qt::SkipEmptyParts, Qt::CaseInsensitive)), skippedResultCIS);
+}
+
void tst_QStringApiSymmetry::mid_data()
{
QTest::addColumn<QStringRef>("unicode");
@@ -1216,6 +1490,296 @@ void tst_QStringApiSymmetry::toUcs4_impl()
QCOMPARE(unicode.isEmpty(), ucs4.isEmpty());
}
+void tst_QStringApiSymmetry::indexOf_data()
+{
+ QTest::addColumn<QString>("haystackU16");
+ QTest::addColumn<QLatin1String>("haystackL1");
+ QTest::addColumn<QString>("needleU16");
+ QTest::addColumn<QLatin1String>("needleL1");
+ QTest::addColumn<qsizetype>("startpos");
+ QTest::addColumn<qsizetype>("resultCS");
+ QTest::addColumn<qsizetype>("resultCIS");
+
+ constexpr qsizetype zeroPos = 0;
+ constexpr qsizetype minus1Pos = -1;
+
+ QTest::addRow("haystack: null, needle: null") << null << QLatin1String()
+ << null << QLatin1String() << zeroPos << zeroPos << zeroPos;
+ QTest::addRow("haystack: empty, needle: null") << empty << QLatin1String("")
+ << null << QLatin1String() << zeroPos << zeroPos << zeroPos;
+ QTest::addRow("haystack: a, needle: null") << a << QLatin1String("a")
+ << null << QLatin1String() << zeroPos << zeroPos << zeroPos;
+ QTest::addRow("haystack: null, needle: empty") << null << QLatin1String()
+ << empty << QLatin1String("") << zeroPos << zeroPos << zeroPos;
+ QTest::addRow("haystack: a, needle: empty") << a << QLatin1String("a")
+ << empty << QLatin1String("") << zeroPos << zeroPos << zeroPos;
+ QTest::addRow("haystack: empty, needle: empty") << empty << QLatin1String("")
+ << empty << QLatin1String("") << zeroPos << zeroPos << zeroPos;
+ QTest::addRow("haystack: empty, needle: a") << empty << QLatin1String("")
+ << a << QLatin1String("a") << zeroPos << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: null, needle: a") << null << QLatin1String()
+ << a << QLatin1String("a") << zeroPos << minus1Pos << minus1Pos;
+
+
+#define ROW(h, n, st, cs, cis) \
+ QTest::addRow("haystack: %s, needle: %s", #h, #n) << h << QLatin1String(#h) \
+ << n << QLatin1String(#n) \
+ << qsizetype(st) << qsizetype(cs) << qsizetype(cis)
+
+ ROW(abc, a, 0, 0, 0);
+ ROW(abc, A, 0, -1, 0);
+ ROW(abc, a, 1, -1, -1);
+ ROW(abc, A, 1, -1, -1);
+ ROW(abc, b, 0, 1, 1);
+ ROW(abc, B, 0, -1, 1);
+ ROW(abc, b, 1, 1, 1);
+ ROW(abc, B, 1, -1, 1);
+ ROW(abc, B, 2, -1, -1);
+
+ ROW(ABC, A, 0, 0, 0);
+ ROW(ABC, a, 0, -1, 0);
+ ROW(ABC, A, 1, -1, -1);
+ ROW(ABC, a, 1, -1, -1);
+ ROW(ABC, B, 0, 1, 1);
+ ROW(ABC, b, 0, -1, 1);
+ ROW(ABC, B, 1, 1, 1);
+ ROW(ABC, b, 1, -1, 1);
+ ROW(ABC, B, 2, -1, -1);
+
+ ROW(aBc, bc, 0, -1, 1);
+ ROW(aBc, Bc, 0, 1, 1);
+ ROW(aBc, bC, 0, -1, 1);
+ ROW(aBc, BC, 0, -1, 1);
+
+ ROW(AbC, bc, 0, -1, 1);
+ ROW(AbC, Bc, 0, -1, 1);
+ ROW(AbC, bC, 0, 1, 1);
+ ROW(AbC, BC, 0, -1, 1);
+ ROW(AbC, BC, 1, -1, 1);
+ ROW(AbC, BC, 2, -1, -1);
+#undef ROW
+
+}
+
+template <typename Haystack, typename Needle>
+void tst_QStringApiSymmetry::indexOf_impl() const
+{
+ QFETCH(const QString, haystackU16);
+ QFETCH(const QLatin1String, haystackL1);
+ QFETCH(const QString, needleU16);
+ QFETCH(const QLatin1String, needleL1);
+ QFETCH(const qsizetype, startpos);
+ QFETCH(const qsizetype, resultCS);
+ QFETCH(const qsizetype, resultCIS);
+
+ const auto haystackU8 = haystackU16.toUtf8();
+ const auto needleU8 = needleU16.toUtf8();
+
+ const auto haystack = make<Haystack>(QStringRef(&haystackU16), haystackL1, haystackU8);
+ const auto needle = make<Needle>(QStringRef(&needleU16), needleL1, needleU8);
+
+ using size_type = typename Haystack::size_type;
+
+ QCOMPARE(haystack.indexOf(needle, startpos), size_type(resultCS));
+ QCOMPARE(haystack.indexOf(needle, startpos, Qt::CaseSensitive), size_type(resultCS));
+ QCOMPARE(haystack.indexOf(needle, startpos, Qt::CaseInsensitive), size_type(resultCIS));
+
+ if (needle.size() == 1)
+ {
+ QCOMPARE(haystack.indexOf(needle[0], startpos), size_type(resultCS));
+ QCOMPARE(haystack.indexOf(needle[0], startpos, Qt::CaseSensitive), size_type(resultCS));
+ QCOMPARE(haystack.indexOf(needle[0], startpos, Qt::CaseInsensitive), size_type(resultCIS));
+ }
+}
+
+static QString ABCDEFGHIEfGEFG = QStringLiteral("ABCDEFGHIEfGEFG");
+static QString EFG = QStringLiteral("EFG");
+static QString efg = QStringLiteral("efg");
+static QString asd = QStringLiteral("asd");
+static QString asdf = QStringLiteral("asdf");
+static QString Z = QStringLiteral("Z");
+
+void tst_QStringApiSymmetry::contains_data()
+{
+ QTest::addColumn<QString>("haystackU16");
+ QTest::addColumn<QLatin1String>("haystackL1");
+ QTest::addColumn<QString>("needleU16");
+ QTest::addColumn<QLatin1String>("needleL1");
+ QTest::addColumn<bool>("resultCS");
+ QTest::addColumn<bool>("resultCIS");
+
+ QTest::addRow("haystack: null, needle: null") << null << QLatin1String()
+ << null << QLatin1String() << true << true;
+ QTest::addRow("haystack: empty, needle: null") << empty << QLatin1String("")
+ << null << QLatin1String() << true << true;
+ QTest::addRow("haystack: a, needle: null") << a << QLatin1String("a")
+ << null << QLatin1String() << true << true;
+ QTest::addRow("haystack: null, needle: empty") << null << QLatin1String()
+ << empty << QLatin1String("") << true << true;
+ QTest::addRow("haystack: a, needle: empty") << a << QLatin1String("a")
+ << empty << QLatin1String("") << true << true;;
+ QTest::addRow("haystack: empty, needle: empty") << empty << QLatin1String("")
+ << empty << QLatin1String("") << true << true;
+ QTest::addRow("haystack: empty, needle: a") << empty << QLatin1String("")
+ << a << QLatin1String("a") << false << false;
+ QTest::addRow("haystack: null, needle: a") << null << QLatin1String()
+ << a << QLatin1String("a") << false << false;
+
+#define ROW(h, n, cs, cis) \
+ QTest::addRow("haystack: %s, needle: %s", #h, #n) << h << QLatin1String(#h) \
+ << n << QLatin1String(#n) \
+ << cs << cis
+
+ ROW(ABCDEFGHIEfGEFG, A, true, true);
+ ROW(ABCDEFGHIEfGEFG, a, false, true);
+ ROW(ABCDEFGHIEfGEFG, Z, false, false);
+ ROW(ABCDEFGHIEfGEFG, EFG, true, true);
+ ROW(ABCDEFGHIEfGEFG, efg, false, true);
+ ROW(ABCDEFGHIEfGEFG, E, true, true);
+ ROW(ABCDEFGHIEfGEFG, e, false, true);
+#undef ROW
+}
+
+template <typename Haystack, typename Needle>
+void tst_QStringApiSymmetry::contains_impl() const
+{
+ QFETCH(const QString, haystackU16);
+ QFETCH(const QLatin1String, haystackL1);
+ QFETCH(const QString, needleU16);
+ QFETCH(const QLatin1String, needleL1);
+ QFETCH(const bool, resultCS);
+ QFETCH(const bool, resultCIS);
+
+ const auto haystackU8 = haystackU16.toUtf8();
+ const auto needleU8 = needleU16.toUtf8();
+
+ const auto haystack = make<Haystack>(QStringRef(&haystackU16), haystackL1, haystackU8);
+ const auto needle = make<Needle>(QStringRef(&needleU16), needleL1, needleU8);
+
+ QCOMPARE(haystack.contains(needle), resultCS);
+ QCOMPARE(haystack.contains(needle, Qt::CaseSensitive), resultCS);
+ QCOMPARE(haystack.contains(needle, Qt::CaseInsensitive), resultCIS);
+
+ if (needle.size() == 1)
+ {
+ QCOMPARE(haystack.contains(needle[0]), resultCS);
+ QCOMPARE(haystack.contains(needle[0], Qt::CaseSensitive), resultCS);
+ QCOMPARE(haystack.contains(needle[0], Qt::CaseInsensitive), resultCIS);
+ }
+}
+
+void tst_QStringApiSymmetry::lastIndexOf_data()
+{
+ QTest::addColumn<QString>("haystackU16");
+ QTest::addColumn<QLatin1String>("haystackL1");
+ QTest::addColumn<QString>("needleU16");
+ QTest::addColumn<QLatin1String>("needleL1");
+ QTest::addColumn<qsizetype>("startpos");
+ QTest::addColumn<qsizetype>("resultCS");
+ QTest::addColumn<qsizetype>("resultCIS");
+
+ constexpr qsizetype zeroPos = 0;
+ constexpr qsizetype minus1Pos = -1;
+
+ QTest::addRow("haystack: null, needle: null") << null << QLatin1String()
+ << null << QLatin1String() << minus1Pos << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: empty, needle: null") << empty << QLatin1String("")
+ << null << QLatin1String() << minus1Pos << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: a, needle: null") << a << QLatin1String("a")
+ << null << QLatin1String() << minus1Pos << zeroPos << zeroPos;
+ QTest::addRow("haystack: null, needle: empty") << null << QLatin1String()
+ << empty << QLatin1String("") << minus1Pos << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: a, needle: empty") << a << QLatin1String("a")
+ << empty << QLatin1String("") << minus1Pos << zeroPos << zeroPos;
+ QTest::addRow("haystack: empty, needle: empty") << empty << QLatin1String("")
+ << empty << QLatin1String("") << minus1Pos << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: empty, needle: a") << empty << QLatin1String("")
+ << a << QLatin1String("a") << minus1Pos << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: null, needle: a") << null << QLatin1String()
+ << a << QLatin1String("a") << minus1Pos << minus1Pos << minus1Pos;
+
+ QTest::addRow("haystack: a, needle: null") << a << QLatin1String("a")
+ << null << QLatin1String() << qsizetype(1) << qsizetype(1) << qsizetype(1);
+ QTest::addRow("haystack: a, needle: empty") << a << QLatin1String("a")
+ << empty << QLatin1String("") << qsizetype(1) << qsizetype(1) << qsizetype(1);
+ QTest::addRow("haystack: a, needle: null") << a << QLatin1String("a")
+ << null << QLatin1String() << qsizetype(2) << minus1Pos << minus1Pos;
+ QTest::addRow("haystack: a, needle: empty") << a << QLatin1String("a")
+ << empty << QLatin1String("") << qsizetype(2) << minus1Pos << minus1Pos;
+
+#define ROW(h, n, st, cs, cis) \
+ QTest::addRow("haystack: %s, needle: %s", #h, #n) << h << QLatin1String(#h) \
+ << n << QLatin1String(#n) \
+ << qsizetype(st) << qsizetype(cs) << qsizetype(cis)
+
+ ROW(asd, asdf, -1, -1, -1);
+
+ ROW(ABCDEFGHIEfGEFG, G, -1, 14, 14);
+ ROW(ABCDEFGHIEfGEFG, g, -1, -1, 14);
+ ROW(ABCDEFGHIEfGEFG, G, -3, 11, 11);
+ ROW(ABCDEFGHIEfGEFG, g, -3, -1, 11);
+ ROW(ABCDEFGHIEfGEFG, G, -5, 6, 6);
+ ROW(ABCDEFGHIEfGEFG, g, -5, -1, 6);
+ ROW(ABCDEFGHIEfGEFG, G, 14, 14, 14);
+ ROW(ABCDEFGHIEfGEFG, g, 14, -1, 14);
+ ROW(ABCDEFGHIEfGEFG, G, 13, 11, 11);
+ ROW(ABCDEFGHIEfGEFG, g, 13, -1, 11);
+ ROW(ABCDEFGHIEfGEFG, G, 15, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, g, 15, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, B, 14, 1, 1);
+ ROW(ABCDEFGHIEfGEFG, b, 14, -1, 1);
+ ROW(ABCDEFGHIEfGEFG, B, -1, 1, 1);
+ ROW(ABCDEFGHIEfGEFG, b, -1, -1, 1);
+ ROW(ABCDEFGHIEfGEFG, B, 1, 1, 1);
+ ROW(ABCDEFGHIEfGEFG, b, 1, -1, 1);
+ ROW(ABCDEFGHIEfGEFG, B, 0, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, b, 0, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, A, 0, 0, 0);
+ ROW(ABCDEFGHIEfGEFG, a, 0, -1, 0);
+ ROW(ABCDEFGHIEfGEFG, A, -15, 0, 0);
+ ROW(ABCDEFGHIEfGEFG, a, -15, -1, 0);
+
+ ROW(ABCDEFGHIEfGEFG, efg, 0, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, efg, 15, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, efg, -15, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, efg, 14, -1, 12);
+ ROW(ABCDEFGHIEfGEFG, efg, 12, -1, 12);
+ ROW(ABCDEFGHIEfGEFG, efg, -12, -1, -1);
+ ROW(ABCDEFGHIEfGEFG, efg, 11, -1, 9);
+#undef ROW
+}
+
+template <typename Haystack, typename Needle>
+void tst_QStringApiSymmetry::lastIndexOf_impl() const
+{
+ QFETCH(const QString, haystackU16);
+ QFETCH(const QLatin1String, haystackL1);
+ QFETCH(const QString, needleU16);
+ QFETCH(const QLatin1String, needleL1);
+ QFETCH(const qsizetype, startpos);
+ QFETCH(const qsizetype, resultCS);
+ QFETCH(const qsizetype, resultCIS);
+
+ const auto haystackU8 = haystackU16.toUtf8();
+ const auto needleU8 = needleU16.toUtf8();
+
+ const auto haystack = make<Haystack>(QStringRef(&haystackU16), haystackL1, haystackU8);
+ const auto needle = make<Needle>(QStringRef(&needleU16), needleL1, needleU8);
+
+ using size_type = typename Haystack::size_type;
+
+ QCOMPARE(haystack.lastIndexOf(needle, startpos), size_type(resultCS));
+ QCOMPARE(haystack.lastIndexOf(needle, startpos, Qt::CaseSensitive), size_type(resultCS));
+ QCOMPARE(haystack.lastIndexOf(needle, startpos, Qt::CaseInsensitive), size_type(resultCIS));
+
+ if (needle.size() == 1)
+ {
+ QCOMPARE(haystack.lastIndexOf(needle[0], startpos), size_type(resultCS));
+ QCOMPARE(haystack.lastIndexOf(needle[0], startpos, Qt::CaseSensitive), size_type(resultCS));
+ QCOMPARE(haystack.lastIndexOf(needle[0], startpos, Qt::CaseInsensitive), size_type(resultCIS));
+ }
+}
+
QTEST_APPLESS_MAIN(tst_QStringApiSymmetry)
#include "tst_qstringapisymmetry.moc"
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder.pro b/tests/auto/corelib/text/qstringbuilder/qstringbuilder.pro
index d73d541502..d73d541502 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder.pro
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder.pro
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/qstringbuilder1.pro
index d9cdad1bf5..d9cdad1bf5 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/qstringbuilder1.pro
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/qstringbuilder1.pro
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
index ac7f439248..ac7f439248 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/stringbuilder.cpp
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
index 2d320748f2..2d320748f2 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro b/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/qstringbuilder2.pro
index e134c5d934..e134c5d934 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/qstringbuilder2.pro
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/qstringbuilder2.pro
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp
index 669990c9bc..669990c9bc 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro b/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/qstringbuilder3.pro
index 29607551c3..29607551c3 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/qstringbuilder3.pro
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/qstringbuilder3.pro
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp
index 397e3326bf..397e3326bf 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/qstringbuilder4.pro
index e55848e4bd..e55848e4bd 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/qstringbuilder4.pro
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/qstringbuilder4.pro
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp
index 05ce334c82..05ce334c82 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp
+++ b/tests/auto/corelib/text/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp
diff --git a/tests/auto/corelib/tools/qstringiterator/qstringiterator.pro b/tests/auto/corelib/text/qstringiterator/qstringiterator.pro
index 3a1678b5f3..3a1678b5f3 100644
--- a/tests/auto/corelib/tools/qstringiterator/qstringiterator.pro
+++ b/tests/auto/corelib/text/qstringiterator/qstringiterator.pro
diff --git a/tests/auto/corelib/tools/qstringiterator/tst_qstringiterator.cpp b/tests/auto/corelib/text/qstringiterator/tst_qstringiterator.cpp
index 7d5504c22c..7d5504c22c 100644
--- a/tests/auto/corelib/tools/qstringiterator/tst_qstringiterator.cpp
+++ b/tests/auto/corelib/text/qstringiterator/tst_qstringiterator.cpp
diff --git a/tests/auto/corelib/tools/qstringlist/.gitignore b/tests/auto/corelib/text/qstringlist/.gitignore
index 3e0cdc952f..3e0cdc952f 100644
--- a/tests/auto/corelib/tools/qstringlist/.gitignore
+++ b/tests/auto/corelib/text/qstringlist/.gitignore
diff --git a/tests/auto/corelib/tools/qstringlist/qstringlist.pro b/tests/auto/corelib/text/qstringlist/qstringlist.pro
index a87257decb..a87257decb 100644
--- a/tests/auto/corelib/tools/qstringlist/qstringlist.pro
+++ b/tests/auto/corelib/text/qstringlist/qstringlist.pro
diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/text/qstringlist/tst_qstringlist.cpp
index 42bdf62a93..66d4744454 100644
--- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
+++ b/tests/auto/corelib/text/qstringlist/tst_qstringlist.cpp
@@ -30,13 +30,17 @@
#include <qregexp.h>
#include <qregularexpression.h>
#include <qstringlist.h>
+#include <qvector.h>
#include <locale.h>
+#include <algorithm>
+
class tst_QStringList : public QObject
{
Q_OBJECT
private slots:
+ void constructors();
void sort();
void filter();
void replaceInStrings();
@@ -59,13 +63,44 @@ private slots:
void joinChar() const;
void joinChar_data() const;
-#ifdef Q_COMPILER_INITIALIZER_LISTS
void initializeList() const;
-#endif
};
extern const char email[];
+void tst_QStringList::constructors()
+{
+ {
+ QStringList list;
+ QVERIFY(list.isEmpty());
+ QCOMPARE(list.size(), 0);
+ QVERIFY(list == QStringList());
+ }
+ {
+ QString str = "abc";
+ QStringList list(str);
+ QVERIFY(!list.isEmpty());
+ QCOMPARE(list.size(), 1);
+ QCOMPARE(list.at(0), str);
+ }
+ {
+ QStringList list{ "a", "b", "c" };
+ QVERIFY(!list.isEmpty());
+ QCOMPARE(list.size(), 3);
+ QCOMPARE(list.at(0), "a");
+ QCOMPARE(list.at(1), "b");
+ QCOMPARE(list.at(2), "c");
+ }
+ {
+ const QVector<QString> reference{ "a", "b", "c" };
+ QCOMPARE(reference.size(), 3);
+
+ QStringList list(reference.cbegin(), reference.cend());
+ QCOMPARE(list.size(), reference.size());
+ QVERIFY(std::equal(list.cbegin(), list.cend(), reference.cbegin()));
+ }
+}
+
void tst_QStringList::indexOf_regExp()
{
QStringList list;
@@ -224,6 +259,12 @@ void tst_QStringList::filter()
list5 = list5.filter( QRegularExpression("[i]ll") );
list6 << "Bill Gates" << "Bill Clinton";
QCOMPARE( list5, list6 );
+
+ QStringList list7, list8;
+ list7 << "Bill Gates" << "Joe Blow" << "Bill Clinton";
+ list7 = list7.filter( QStringView(QString("Bill")) );
+ list8 << "Bill Gates" << "Bill Clinton";
+ QCOMPARE( list7, list8 );
}
void tst_QStringList::sort()
@@ -281,6 +322,16 @@ void tst_QStringList::replaceInStrings()
list10 << "Bill Clinton" << "Bill Gates";
list9.replaceInStrings( QRegularExpression("^(.*), (.*)$"), "\\2 \\1" );
QCOMPARE( list9, list10 );
+
+ QStringList list11, list12, list13, list14;
+ list11 << "alpha" << "beta" << "gamma" << "epsilon";
+ list12 << "alpha" << "beta" << "gamma" << "epsilon";
+ list13 << "alpha" << "beta" << "gamma" << "epsilon";
+ list11.replaceInStrings( QStringView(QString("a")), QStringView(QString("o")) );
+ list12.replaceInStrings( QStringView(QString("a")), QString("o") );
+ list13.replaceInStrings( QString("a"), QStringView(QString("o")) );
+ list14 << "olpho" << "beto" << "gommo" << "epsilon";
+ QCOMPARE( list11, list12 );
}
void tst_QStringList::contains()
@@ -392,6 +443,7 @@ void tst_QStringList::join() const
QCOMPARE(input.join(separator), expectedResult);
QCOMPARE(input.join(QLatin1String(separator.toLatin1())), expectedResult);
+ QCOMPARE(input.join(QStringView(separator)), expectedResult);
}
void tst_QStringList::join_data() const
@@ -482,8 +534,6 @@ void tst_QStringList::joinEmptiness() const
QVERIFY(string.isNull());
}
-#ifdef Q_COMPILER_INITIALIZER_LISTS
-// C++0x support is required
void tst_QStringList::initializeList() const
{
@@ -491,7 +541,6 @@ void tst_QStringList::initializeList() const
QCOMPARE(v1, (QStringList() << "hello" << "world" << "plop"));
QCOMPARE(v1, (QStringList{"hello","world","plop"}));
}
-#endif
QTEST_APPLESS_MAIN(tst_QStringList)
#include "tst_qstringlist.moc"
diff --git a/tests/auto/corelib/tools/qstringmatcher/.gitignore b/tests/auto/corelib/text/qstringmatcher/.gitignore
index 3c7caf8490..3c7caf8490 100644
--- a/tests/auto/corelib/tools/qstringmatcher/.gitignore
+++ b/tests/auto/corelib/text/qstringmatcher/.gitignore
diff --git a/tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro b/tests/auto/corelib/text/qstringmatcher/qstringmatcher.pro
index e34928776f..e34928776f 100644
--- a/tests/auto/corelib/tools/qstringmatcher/qstringmatcher.pro
+++ b/tests/auto/corelib/text/qstringmatcher/qstringmatcher.pro
diff --git a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp b/tests/auto/corelib/text/qstringmatcher/tst_qstringmatcher.cpp
index 8a55f54449..2d577bb0ab 100644
--- a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp
+++ b/tests/auto/corelib/text/qstringmatcher/tst_qstringmatcher.cpp
@@ -100,6 +100,11 @@ void tst_QStringMatcher::indexIn()
matcher.setPattern(needle);
QCOMPARE(matcher.indexIn(haystack, from), indexIn);
+
+ const auto needleSV = QStringView(needle);
+ QStringMatcher matcherSV(needleSV);
+
+ QCOMPARE(matcherSV.indexIn(QStringView(haystack), from), indexIn);
}
void tst_QStringMatcher::setCaseSensitivity_data()
@@ -128,6 +133,7 @@ void tst_QStringMatcher::setCaseSensitivity()
matcher.setCaseSensitivity(static_cast<Qt::CaseSensitivity> (cs));
QCOMPARE(matcher.indexIn(haystack, from), indexIn);
+ QCOMPARE(matcher.indexIn(QStringView(haystack), from), indexIn);
}
void tst_QStringMatcher::assignOperator()
diff --git a/tests/auto/corelib/tools/qstringref/qstringref.pro b/tests/auto/corelib/text/qstringref/qstringref.pro
index 04f3ba6a92..04f3ba6a92 100644
--- a/tests/auto/corelib/tools/qstringref/qstringref.pro
+++ b/tests/auto/corelib/text/qstringref/qstringref.pro
diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/text/qstringref/tst_qstringref.cpp
index 581e9152e6..6f01947131 100644
--- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
+++ b/tests/auto/corelib/text/qstringref/tst_qstringref.cpp
@@ -596,7 +596,10 @@ void tst_QStringRef::startsWith()
QVERIFY(!ref.startsWith("C"));
QVERIFY(!ref.startsWith("ABCDEF"));
QVERIFY(ref.startsWith(""));
+ QVERIFY(ref.startsWith(QString()));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.startsWith(QString::null));
+#endif
QVERIFY(ref.startsWith('A'));
QVERIFY(ref.startsWith(QLatin1Char('A')));
QVERIFY(ref.startsWith(QChar('A')));
@@ -623,7 +626,10 @@ void tst_QStringRef::startsWith()
QVERIFY(!ref.startsWith("c", Qt::CaseInsensitive));
QVERIFY(!ref.startsWith("abcdef", Qt::CaseInsensitive));
QVERIFY(ref.startsWith("", Qt::CaseInsensitive));
+ QVERIFY(ref.startsWith(QString(), Qt::CaseInsensitive));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.startsWith(QString::null, Qt::CaseInsensitive));
+#endif
QVERIFY(ref.startsWith('a', Qt::CaseInsensitive));
QVERIFY(ref.startsWith('A', Qt::CaseInsensitive));
QVERIFY(ref.startsWith(QLatin1Char('a'), Qt::CaseInsensitive));
@@ -656,7 +662,10 @@ void tst_QStringRef::startsWith()
const QString a = QString::fromLatin1("");
CREATE_REF(a);
QVERIFY(ref.startsWith(""));
+ QVERIFY(ref.startsWith(QString()));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.startsWith(QString::null));
+#endif
QVERIFY(!ref.startsWith("ABC"));
QVERIFY(ref.startsWith(QLatin1String("")));
@@ -670,7 +679,10 @@ void tst_QStringRef::startsWith()
{
const QStringRef ref;
QVERIFY(!ref.startsWith(""));
+ QVERIFY(ref.startsWith(QString()));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.startsWith(QString::null));
+#endif
QVERIFY(!ref.startsWith("ABC"));
QVERIFY(!ref.startsWith(QLatin1String("")));
@@ -693,7 +705,10 @@ void tst_QStringRef::endsWith()
QVERIFY(!ref.endsWith("C"));
QVERIFY(!ref.endsWith("ABCDEF"));
QVERIFY(ref.endsWith(""));
+ QVERIFY(ref.endsWith(QString()));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.endsWith(QString::null));
+#endif
QVERIFY(ref.endsWith('B'));
QVERIFY(ref.endsWith(QLatin1Char('B')));
QVERIFY(ref.endsWith(QChar('B')));
@@ -720,7 +735,10 @@ void tst_QStringRef::endsWith()
QVERIFY(!ref.endsWith("c", Qt::CaseInsensitive));
QVERIFY(!ref.endsWith("abcdef", Qt::CaseInsensitive));
QVERIFY(ref.endsWith("", Qt::CaseInsensitive));
+ QVERIFY(ref.endsWith(QString(), Qt::CaseInsensitive));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.endsWith(QString::null, Qt::CaseInsensitive));
+#endif
QVERIFY(ref.endsWith('b', Qt::CaseInsensitive));
QVERIFY(ref.endsWith('B', Qt::CaseInsensitive));
QVERIFY(ref.endsWith(QLatin1Char('b'), Qt::CaseInsensitive));
@@ -754,7 +772,10 @@ void tst_QStringRef::endsWith()
const QString a = QString::fromLatin1("");
CREATE_REF(a);
QVERIFY(ref.endsWith(""));
+ QVERIFY(ref.endsWith(QString()));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.endsWith(QString::null));
+#endif
QVERIFY(!ref.endsWith("ABC"));
QVERIFY(!ref.endsWith(QLatin1Char(0)));
QVERIFY(!ref.endsWith(QLatin1Char('x')));
@@ -768,7 +789,10 @@ void tst_QStringRef::endsWith()
{
QStringRef ref;
QVERIFY(!ref.endsWith(""));
+ QVERIFY(ref.endsWith(QString()));
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(ref.endsWith(QString::null));
+#endif
QVERIFY(!ref.endsWith("ABC"));
QVERIFY(!ref.endsWith(QLatin1String("")));
diff --git a/tests/auto/corelib/tools/qstringview/.gitignore b/tests/auto/corelib/text/qstringview/.gitignore
index 5f757d448a..5f757d448a 100644
--- a/tests/auto/corelib/tools/qstringview/.gitignore
+++ b/tests/auto/corelib/text/qstringview/.gitignore
diff --git a/tests/auto/corelib/tools/qstringview/qstringview.pro b/tests/auto/corelib/text/qstringview/qstringview.pro
index e0e9973c91..e0e9973c91 100644
--- a/tests/auto/corelib/tools/qstringview/qstringview.pro
+++ b/tests/auto/corelib/text/qstringview/qstringview.pro
diff --git a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
index e800a0d794..47ce9a6f63 100644
--- a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
+++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp
@@ -134,6 +134,8 @@ private Q_SLOTS:
void literals() const;
void at() const;
+ void arg() const;
+
void fromQString() const;
void fromQStringRef() const;
@@ -249,7 +251,7 @@ void tst_QStringView::constExpr() const
Q_STATIC_ASSERT(sv2.empty());
}
{
- constexpr QStringView sv = QStringViewLiteral("");
+ constexpr QStringView sv = u"";
Q_STATIC_ASSERT(sv.size() == 0);
Q_STATIC_ASSERT(!sv.isNull());
Q_STATIC_ASSERT(sv.empty());
@@ -261,7 +263,7 @@ void tst_QStringView::constExpr() const
Q_STATIC_ASSERT(sv2.empty());
}
{
- constexpr QStringView sv = QStringViewLiteral("Hello");
+ constexpr QStringView sv = u"Hello";
Q_STATIC_ASSERT(sv.size() == 5);
Q_STATIC_ASSERT(!sv.empty());
Q_STATIC_ASSERT(!sv.isEmpty());
@@ -425,6 +427,47 @@ void tst_QStringView::at() const
QCOMPARE(sv.at(4), QChar('o')); QCOMPARE(sv[4], QChar('o'));
}
+void tst_QStringView::arg() const
+{
+#define CHECK1(pattern, arg1, expected) \
+ do { \
+ auto p = QStringView(u"" pattern); \
+ QCOMPARE(p.arg(QLatin1String(arg1)), expected); \
+ QCOMPARE(p.arg(u"" arg1), expected); \
+ QCOMPARE(p.arg(QStringLiteral(arg1)), expected); \
+ QCOMPARE(p.arg(QString(QLatin1String(arg1))), expected); \
+ } while (false) \
+ /*end*/
+#define CHECK2(pattern, arg1, arg2, expected) \
+ do { \
+ auto p = QStringView(u"" pattern); \
+ QCOMPARE(p.arg(QLatin1String(arg1), QLatin1String(arg2)), expected); \
+ QCOMPARE(p.arg(u"" arg1, QLatin1String(arg2)), expected); \
+ QCOMPARE(p.arg(QLatin1String(arg1), u"" arg2), expected); \
+ QCOMPARE(p.arg(u"" arg1, u"" arg2), expected); \
+ } while (false) \
+ /*end*/
+
+ CHECK1("", "World", "");
+ CHECK1("%1", "World", "World");
+ CHECK1("!%1?", "World", "!World?");
+ CHECK1("%1%1", "World", "WorldWorld");
+ CHECK1("%1%2", "World", "World%2");
+ CHECK1("%2%1", "World", "%2World");
+
+ CHECK2("", "Hello", "World", "");
+ CHECK2("%1", "Hello", "World", "Hello");
+ CHECK2("!%1, %2?", "Hello", "World", "!Hello, World?");
+ CHECK2("%1%1", "Hello", "World", "HelloHello");
+ CHECK2("%1%2", "Hello", "World", "HelloWorld");
+ CHECK2("%2%1", "Hello", "World", "WorldHello");
+
+#undef CHECK2
+#undef CHECK1
+
+ QCOMPARE(QStringView(u" %2 %2 %1 %3 ").arg(QLatin1Char('c'), QChar::CarriageReturn, u'C'), " \r \r c C ");
+}
+
void tst_QStringView::fromQString() const
{
QString null;
@@ -619,9 +662,9 @@ void tst_QStringView::conversion_tests(String string) const
void tst_QStringView::comparison()
{
- const QStringView aa = QStringViewLiteral("aa");
- const QStringView upperAa = QStringViewLiteral("AA");
- const QStringView bb = QStringViewLiteral("bb");
+ const QStringView aa = u"aa";
+ const QStringView upperAa = u"AA";
+ const QStringView bb = u"bb";
QVERIFY(aa == aa);
QVERIFY(aa != bb);
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/.gitignore b/tests/auto/corelib/text/qtextboundaryfinder/.gitignore
index bd0df58233..bd0df58233 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/.gitignore
+++ b/tests/auto/corelib/text/qtextboundaryfinder/.gitignore
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt b/tests/auto/corelib/text/qtextboundaryfinder/data/GraphemeBreakTest.txt
index d7d8f90de0..d7d8f90de0 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
+++ b/tests/auto/corelib/text/qtextboundaryfinder/data/GraphemeBreakTest.txt
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt b/tests/auto/corelib/text/qtextboundaryfinder/data/LineBreakTest.txt
index 6715446aba..6715446aba 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
+++ b/tests/auto/corelib/text/qtextboundaryfinder/data/LineBreakTest.txt
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt b/tests/auto/corelib/text/qtextboundaryfinder/data/SentenceBreakTest.txt
index 2985b84cf8..2985b84cf8 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
+++ b/tests/auto/corelib/text/qtextboundaryfinder/data/SentenceBreakTest.txt
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt b/tests/auto/corelib/text/qtextboundaryfinder/data/WordBreakTest.txt
index 63761026ce..63761026ce 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
+++ b/tests/auto/corelib/text/qtextboundaryfinder/data/WordBreakTest.txt
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro b/tests/auto/corelib/text/qtextboundaryfinder/qtextboundaryfinder.pro
index 3c9f03842d..3c9f03842d 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/qtextboundaryfinder.pro
+++ b/tests/auto/corelib/text/qtextboundaryfinder/qtextboundaryfinder.pro
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc b/tests/auto/corelib/text/qtextboundaryfinder/testdata.qrc
index 0cc4ccaa57..0cc4ccaa57 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/testdata.qrc
+++ b/tests/auto/corelib/text/qtextboundaryfinder/testdata.qrc
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
index 5701335b4a..a46011ff6c 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
+++ b/tests/auto/corelib/text/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
@@ -192,7 +192,7 @@ static void doTestData(const QString &testString, const QList<int> &expectedBrea
// test toPreviousBoundary()
{
QList<int> expectedBreakPositionsRev = expectedBreakPositions;
- std::sort(expectedBreakPositionsRev.begin(), expectedBreakPositionsRev.end(), qGreater<int>());
+ std::sort(expectedBreakPositionsRev.begin(), expectedBreakPositionsRev.end(), std::greater<int>());
QList<int> actualBreakPositions;
boundaryFinder.toEnd();
diff --git a/tests/auto/corelib/text/text.pro b/tests/auto/corelib/text/text.pro
new file mode 100644
index 0000000000..09d58bd74c
--- /dev/null
+++ b/tests/auto/corelib/text/text.pro
@@ -0,0 +1,23 @@
+TEMPLATE = subdirs
+
+SUBDIRS = \
+ qbytearray \
+ qbytearraylist \
+ qbytearraymatcher \
+ qbytedatabuffer \
+ qchar \
+ qcollator \
+ qlatin1string \
+ qlocale \
+ qregexp \
+ qregularexpression \
+ qstring \
+ qstring_no_cast_from_bytearray \
+ qstringapisymmetry \
+ qstringbuilder \
+ qstringiterator \
+ qstringlist \
+ qstringmatcher \
+ qstringref \
+ qstringview \
+ qtextboundaryfinder
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
index cc197cabba..bef491d5f0 100644
--- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
@@ -31,6 +31,7 @@
#include <QAtomicInt>
#include <QCoreApplication>
+#include <QElapsedTimer>
#include <limits.h>
@@ -104,12 +105,12 @@ static void warningFreeHelperTemplate()
assemblyMarker<1>(&i);
// the loads sometimes generate no assembly output
- i.load();
+ i.loadRelaxed();
assemblyMarker<11>(&i);
i.loadAcquire();
assemblyMarker<12>(&i);
- i.store(newValue);
+ i.storeRelaxed(newValue);
assemblyMarker<21>(&i);
i.storeRelease(newValue);
assemblyMarker<22>(&i);
@@ -281,9 +282,9 @@ void tst_QAtomicInt::constructor()
{
QFETCH(int, value);
QAtomicInt atomic1(value);
- QCOMPARE(atomic1.load(), value);
+ QCOMPARE(atomic1.loadRelaxed(), value);
QAtomicInt atomic2 = value;
- QCOMPARE(atomic2.load(), value);
+ QCOMPARE(atomic2.loadRelaxed(), value);
}
void tst_QAtomicInt::copy_constructor_data()
@@ -293,16 +294,16 @@ void tst_QAtomicInt::copy_constructor()
{
QFETCH(int, value);
QAtomicInt atomic1(value);
- QCOMPARE(atomic1.load(), value);
+ QCOMPARE(atomic1.loadRelaxed(), value);
QAtomicInt atomic2(atomic1);
- QCOMPARE(atomic2.load(), value);
+ QCOMPARE(atomic2.loadRelaxed(), value);
QAtomicInt atomic3 = atomic1;
- QCOMPARE(atomic3.load(), value);
+ QCOMPARE(atomic3.loadRelaxed(), value);
QAtomicInt atomic4(atomic2);
- QCOMPARE(atomic4.load(), value);
+ QCOMPARE(atomic4.loadRelaxed(), value);
QAtomicInt atomic5 = atomic2;
- QCOMPARE(atomic5.load(), value);
+ QCOMPARE(atomic5.loadRelaxed(), value);
}
void tst_QAtomicInt::assignment_operator_data()
@@ -326,13 +327,13 @@ void tst_QAtomicInt::assignment_operator()
{
QAtomicInt atomic1 = value;
atomic1 = newval;
- QCOMPARE(atomic1.load(), newval);
+ QCOMPARE(atomic1.loadRelaxed(), newval);
atomic1 = value;
- QCOMPARE(atomic1.load(), value);
+ QCOMPARE(atomic1.loadRelaxed(), value);
QAtomicInt atomic2 = newval;
atomic1 = atomic2;
- QCOMPARE(atomic1.load(), atomic2.load());
+ QCOMPARE(atomic1.loadRelaxed(), atomic2.loadRelaxed());
}
}
@@ -400,7 +401,7 @@ void tst_QAtomicInt::ref()
QFETCH(int, value);
QAtomicInt x = value;
QTEST(x.ref() ? 1 : 0, "result");
- QTEST(x.load(), "expected");
+ QTEST(x.loadRelaxed(), "expected");
}
void tst_QAtomicInt::deref_data()
@@ -419,7 +420,7 @@ void tst_QAtomicInt::deref()
QFETCH(int, value);
QAtomicInt x = value;
QTEST(x.deref() ? 1 : 0, "result");
- QTEST(x.load(), "expected");
+ QTEST(x.loadRelaxed(), "expected");
}
void tst_QAtomicInt::isTestAndSetNative()
@@ -635,25 +636,25 @@ void tst_QAtomicInt::fetchAndStore()
{
QAtomicInt atomic = value;
QCOMPARE(atomic.fetchAndStoreRelaxed(newval), value);
- QCOMPARE(atomic.load(), newval);
+ QCOMPARE(atomic.loadRelaxed(), newval);
}
{
QAtomicInt atomic = value;
QCOMPARE(atomic.fetchAndStoreAcquire(newval), value);
- QCOMPARE(atomic.load(), newval);
+ QCOMPARE(atomic.loadRelaxed(), newval);
}
{
QAtomicInt atomic = value;
QCOMPARE(atomic.fetchAndStoreRelease(newval), value);
- QCOMPARE(atomic.load(), newval);
+ QCOMPARE(atomic.loadRelaxed(), newval);
}
{
QAtomicInt atomic = value;
QCOMPARE(atomic.fetchAndStoreOrdered(newval), value);
- QCOMPARE(atomic.load(), newval);
+ QCOMPARE(atomic.loadRelaxed(), newval);
}
}
@@ -772,28 +773,28 @@ void tst_QAtomicInt::fetchAndAdd()
QAtomicInt atomic = value1;
result = atomic.fetchAndAddRelaxed(value2);
QCOMPARE(result, value1);
- QCOMPARE(atomic.load(), value1 + value2);
+ QCOMPARE(atomic.loadRelaxed(), value1 + value2);
}
{
QAtomicInt atomic = value1;
result = atomic.fetchAndAddAcquire(value2);
QCOMPARE(result, value1);
- QCOMPARE(atomic.load(), value1 + value2);
+ QCOMPARE(atomic.loadRelaxed(), value1 + value2);
}
{
QAtomicInt atomic = value1;
result = atomic.fetchAndAddRelease(value2);
QCOMPARE(result, value1);
- QCOMPARE(atomic.load(), value1 + value2);
+ QCOMPARE(atomic.loadRelaxed(), value1 + value2);
}
{
QAtomicInt atomic = value1;
result = atomic.fetchAndAddOrdered(value2);
QCOMPARE(result, value1);
- QCOMPARE(atomic.load(), value1 + value2);
+ QCOMPARE(atomic.loadRelaxed(), value1 + value2);
}
}
@@ -851,14 +852,14 @@ void tst_QAtomicInt::operators()
void tst_QAtomicInt::testAndSet_loop()
{
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
int iterations = 10000000;
QAtomicInt val=0;
for (int i = 0; i < iterations; ++i) {
- int v = val.load();
+ int v = val.loadRelaxed();
QVERIFY(val.testAndSetRelaxed(v, v+1));
if ((i % 1000) == 999) {
if (stopWatch.elapsed() > 60 * 1000) {
@@ -881,7 +882,7 @@ void tst_QAtomicInt::fetchAndAdd_loop()
QAtomicInt val=0;
for (int i = 0; i < iterations; ++i) {
const int prev = val.fetchAndAddRelaxed(1);
- QCOMPARE(prev, val.load() -1);
+ QCOMPARE(prev, val.loadRelaxed() -1);
}
}
@@ -919,7 +920,7 @@ void tst_QAtomicInt::fetchAndAdd_threadedLoop()
t1.wait();
t2.wait();
- QCOMPARE(val.load(), 0);
+ QCOMPARE(val.loadRelaxed(), 0);
}
QTEST_MAIN(tst_QAtomicInt)
diff --git a/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp b/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
index 32e5b8ee56..bfe2a60088 100644
--- a/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
+++ b/tests/auto/corelib/thread/qatomicinteger/tst_qatomicinteger.cpp
@@ -270,13 +270,13 @@ void tst_QAtomicIntegerXX::constructor()
QFETCH(LargeInt, value);
QAtomicInteger<T> atomic(value);
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QAtomicInteger<T> atomic2 = value;
- QCOMPARE(atomic2.load(), T(value));
+ QCOMPARE(atomic2.loadRelaxed(), T(value));
- QVERIFY(atomic.load() >= std::numeric_limits<T>::min());
- QVERIFY(atomic.load() <= std::numeric_limits<T>::max());
+ QVERIFY(atomic.loadRelaxed() >= std::numeric_limits<T>::min());
+ QVERIFY(atomic.loadRelaxed() <= std::numeric_limits<T>::max());
}
void tst_QAtomicIntegerXX::copy()
@@ -285,17 +285,17 @@ void tst_QAtomicIntegerXX::copy()
QAtomicInteger<T> atomic(value);
QAtomicInteger<T> copy(atomic);
- QCOMPARE(copy.load(), atomic.load());
+ QCOMPARE(copy.loadRelaxed(), atomic.loadRelaxed());
QAtomicInteger<T> copy2 = atomic;
- QCOMPARE(copy2.load(), atomic.load());
+ QCOMPARE(copy2.loadRelaxed(), atomic.loadRelaxed());
// move
- QAtomicInteger<T> copy3(qMove(copy));
- QCOMPARE(copy3.load(), atomic.load());
+ QAtomicInteger<T> copy3(std::move(copy));
+ QCOMPARE(copy3.loadRelaxed(), atomic.loadRelaxed());
- QAtomicInteger<T> copy4 = qMove(copy2);
- QCOMPARE(copy4.load(), atomic.load());
+ QAtomicInteger<T> copy4 = std::move(copy2);
+ QCOMPARE(copy4.loadRelaxed(), atomic.loadRelaxed());
}
void tst_QAtomicIntegerXX::assign()
@@ -305,24 +305,24 @@ void tst_QAtomicIntegerXX::assign()
QAtomicInteger<T> atomic(value);
QAtomicInteger<T> copy;
copy = atomic;
- QCOMPARE(copy.load(), atomic.load());
+ QCOMPARE(copy.loadRelaxed(), atomic.loadRelaxed());
QAtomicInteger<T> copy2;
copy2 = atomic; // operator=(const QAtomicInteger &)
- QCOMPARE(copy2.load(), atomic.load());
+ QCOMPARE(copy2.loadRelaxed(), atomic.loadRelaxed());
QAtomicInteger<T> copy2bis;
- copy2bis = atomic.load(); // operator=(T)
- QCOMPARE(copy2bis.load(), atomic.load());
+ copy2bis = atomic.loadRelaxed(); // operator=(T)
+ QCOMPARE(copy2bis.loadRelaxed(), atomic.loadRelaxed());
// move
QAtomicInteger<T> copy3;
- copy3 = qMove(copy);
- QCOMPARE(copy3.load(), atomic.load());
+ copy3 = std::move(copy);
+ QCOMPARE(copy3.loadRelaxed(), atomic.loadRelaxed());
QAtomicInteger<T> copy4;
- copy4 = qMove(copy2);
- QCOMPARE(copy4.load(), atomic.load());
+ copy4 = std::move(copy2);
+ QCOMPARE(copy4.loadRelaxed(), atomic.loadRelaxed());
}
void tst_QAtomicIntegerXX::operatorInteger()
@@ -331,7 +331,7 @@ void tst_QAtomicIntegerXX::operatorInteger()
QAtomicInteger<T> atomic(value);
T val2 = atomic;
- QCOMPARE(val2, atomic.load());
+ QCOMPARE(val2, atomic.loadRelaxed());
QCOMPARE(val2, T(value));
}
@@ -346,7 +346,7 @@ void tst_QAtomicIntegerXX::loadAcquireStoreRelease()
QCOMPARE(atomic.loadAcquire(), T(~value));
atomic.storeRelease(value);
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
}
void tst_QAtomicIntegerXX::refDeref()
@@ -364,16 +364,16 @@ void tst_QAtomicIntegerXX::refDeref()
QAtomicInteger<T> atomic(value);
if (!needToPreventOverflow) {
QCOMPARE(atomic.ref(), (nextValue != 0));
- QCOMPARE(atomic.load(), nextValue);
+ QCOMPARE(atomic.loadRelaxed(), nextValue);
QCOMPARE(atomic.deref(), (value != 0));
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventUnderflow) {
QCOMPARE(atomic.deref(), (prevValue != 0));
- QCOMPARE(atomic.load(), prevValue);
+ QCOMPARE(atomic.loadRelaxed(), prevValue);
QCOMPARE(atomic.ref(), (value != 0));
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventOverflow) {
QCOMPARE(++atomic, nextValue);
@@ -392,7 +392,7 @@ void tst_QAtomicIntegerXX::refDeref()
QCOMPARE(atomic--, T(value));
QCOMPARE(atomic++, prevValue);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
}
void tst_QAtomicIntegerXX::testAndSet()
@@ -402,16 +402,16 @@ void tst_QAtomicIntegerXX::testAndSet()
QAtomicInteger<T> atomic(value);
QVERIFY(atomic.testAndSetRelaxed(value, newValue));
- QCOMPARE(atomic.load(), newValue);
+ QCOMPARE(atomic.loadRelaxed(), newValue);
QVERIFY(!atomic.testAndSetRelaxed(value, newValue));
QVERIFY(atomic.testAndSetRelaxed(newValue, value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QVERIFY(atomic.testAndSetAcquire(value, newValue));
- QCOMPARE(atomic.load(), newValue);
+ QCOMPARE(atomic.loadRelaxed(), newValue);
QVERIFY(!atomic.testAndSetAcquire(value, newValue));
QVERIFY(atomic.testAndSetAcquire(newValue, value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QVERIFY(atomic.testAndSetRelease(value, newValue));
QCOMPARE(atomic.loadAcquire(), newValue);
@@ -434,18 +434,18 @@ void tst_QAtomicIntegerXX::testAndSet3()
QAtomicInteger<T> atomic(value);
QVERIFY(atomic.testAndSetRelaxed(value, newValue, oldValue));
- QCOMPARE(atomic.load(), newValue);
+ QCOMPARE(atomic.loadRelaxed(), newValue);
QVERIFY(!atomic.testAndSetRelaxed(value, newValue, oldValue));
QCOMPARE(oldValue, newValue);
QVERIFY(atomic.testAndSetRelaxed(newValue, value, oldValue));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QVERIFY(atomic.testAndSetAcquire(value, newValue, oldValue));
- QCOMPARE(atomic.load(), newValue);
+ QCOMPARE(atomic.loadRelaxed(), newValue);
QVERIFY(!atomic.testAndSetAcquire(value, newValue, oldValue));
QCOMPARE(oldValue, newValue);
QVERIFY(atomic.testAndSetAcquire(newValue, value, oldValue));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QVERIFY(atomic.testAndSetRelease(value, newValue, oldValue));
QCOMPARE(atomic.loadAcquire(), newValue);
@@ -469,14 +469,14 @@ void tst_QAtomicIntegerXX::fetchAndStore()
QAtomicInteger<T> atomic(value);
QCOMPARE(atomic.fetchAndStoreRelaxed(newValue), T(value));
- QCOMPARE(atomic.load(), newValue);
+ QCOMPARE(atomic.loadRelaxed(), newValue);
QCOMPARE(atomic.fetchAndStoreRelaxed(value), newValue);
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndStoreAcquire(newValue), T(value));
- QCOMPARE(atomic.load(), newValue);
+ QCOMPARE(atomic.loadRelaxed(), newValue);
QCOMPARE(atomic.fetchAndStoreAcquire(value), newValue);
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndStoreRelease(newValue), T(value));
QCOMPARE(atomic.loadAcquire(), newValue);
@@ -509,29 +509,29 @@ void tst_QAtomicIntegerXX::fetchAndAdd()
if (!needToPreventOverflow) {
QCOMPARE(atomic.fetchAndAddRelaxed(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
+ QCOMPARE(atomic.loadRelaxed(), newValue1);
QCOMPARE(atomic.fetchAndAddRelaxed(parcel2), newValue1);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventUnderflow) {
QCOMPARE(atomic.fetchAndAddRelaxed(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
+ QCOMPARE(atomic.loadRelaxed(), newValue2);
QCOMPARE(atomic.fetchAndAddRelaxed(parcel1), newValue2);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventOverflow) {
QCOMPARE(atomic.fetchAndAddAcquire(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
+ QCOMPARE(atomic.loadRelaxed(), newValue1);
QCOMPARE(atomic.fetchAndAddAcquire(parcel2), newValue1);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventUnderflow) {
QCOMPARE(atomic.fetchAndAddAcquire(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
+ QCOMPARE(atomic.loadRelaxed(), newValue2);
QCOMPARE(atomic.fetchAndAddAcquire(parcel1), newValue2);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventOverflow) {
QCOMPARE(atomic.fetchAndAddRelease(parcel1), T(value));
@@ -590,29 +590,29 @@ void tst_QAtomicIntegerXX::fetchAndSub()
if (!needToPreventUnderflow) {
QCOMPARE(atomic.fetchAndSubRelaxed(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
+ QCOMPARE(atomic.loadRelaxed(), newValue1);
QCOMPARE(atomic.fetchAndSubRelaxed(parcel2), newValue1);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventOverflow) {
QCOMPARE(atomic.fetchAndSubRelaxed(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
+ QCOMPARE(atomic.loadRelaxed(), newValue2);
QCOMPARE(atomic.fetchAndSubRelaxed(parcel1), newValue2);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventUnderflow) {
QCOMPARE(atomic.fetchAndSubAcquire(parcel1), T(value));
- QCOMPARE(atomic.load(), newValue1);
+ QCOMPARE(atomic.loadRelaxed(), newValue1);
QCOMPARE(atomic.fetchAndSubAcquire(parcel2), newValue1);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventOverflow) {
QCOMPARE(atomic.fetchAndSubAcquire(parcel2), T(value));
- QCOMPARE(atomic.load(), newValue2);
+ QCOMPARE(atomic.loadRelaxed(), newValue2);
QCOMPARE(atomic.fetchAndSubAcquire(parcel1), newValue2);
}
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
if (!needToPreventUnderflow) {
QCOMPARE(atomic.fetchAndSubRelease(parcel1), T(value));
@@ -662,32 +662,32 @@ void tst_QAtomicIntegerXX::fetchAndOr()
QCOMPARE(atomic.fetchAndOrRelaxed(zero), T(value));
QCOMPARE(atomic.fetchAndOrRelaxed(one), T(value));
- QCOMPARE(atomic.load(), T(value | 1));
+ QCOMPARE(atomic.loadRelaxed(), T(value | 1));
QCOMPARE(atomic.fetchAndOrRelaxed(minusOne), T(value | 1));
- QCOMPARE(atomic.load(), minusOne);
+ QCOMPARE(atomic.loadRelaxed(), minusOne);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic.fetchAndOrAcquire(zero), T(value));
QCOMPARE(atomic.fetchAndOrAcquire(one), T(value));
- QCOMPARE(atomic.load(), T(value | 1));
+ QCOMPARE(atomic.loadRelaxed(), T(value | 1));
QCOMPARE(atomic.fetchAndOrAcquire(minusOne), T(value | 1));
- QCOMPARE(atomic.load(), minusOne);
+ QCOMPARE(atomic.loadRelaxed(), minusOne);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic.fetchAndOrRelease(zero), T(value));
QCOMPARE(atomic.fetchAndOrRelease(one), T(value));
- QCOMPARE(atomic.load(), T(value | 1));
+ QCOMPARE(atomic.loadRelaxed(), T(value | 1));
QCOMPARE(atomic.fetchAndOrRelease(minusOne), T(value | 1));
- QCOMPARE(atomic.load(), minusOne);
+ QCOMPARE(atomic.loadRelaxed(), minusOne);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic.fetchAndOrOrdered(zero), T(value));
QCOMPARE(atomic.fetchAndOrOrdered(one), T(value));
- QCOMPARE(atomic.load(), T(value | 1));
+ QCOMPARE(atomic.loadRelaxed(), T(value | 1));
QCOMPARE(atomic.fetchAndOrOrdered(minusOne), T(value | 1));
- QCOMPARE(atomic.load(), minusOne);
+ QCOMPARE(atomic.loadRelaxed(), minusOne);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic |= zero, T(value));
QCOMPARE(atomic |= one, T(value | 1));
QCOMPARE(atomic |= minusOne, minusOne);
@@ -703,37 +703,37 @@ void tst_QAtomicIntegerXX::fetchAndAnd()
T minusOne = T(~0);
QCOMPARE(atomic.fetchAndAndRelaxed(minusOne), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndAndRelaxed(f), T(value));
- QCOMPARE(atomic.load(), T(value & 0xf));
+ QCOMPARE(atomic.loadRelaxed(), T(value & 0xf));
QCOMPARE(atomic.fetchAndAndRelaxed(zero), T(value & 0xf));
- QCOMPARE(atomic.load(), zero);
+ QCOMPARE(atomic.loadRelaxed(), zero);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic.fetchAndAndAcquire(minusOne), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndAndAcquire(f), T(value));
- QCOMPARE(atomic.load(), T(value & 0xf));
+ QCOMPARE(atomic.loadRelaxed(), T(value & 0xf));
QCOMPARE(atomic.fetchAndAndAcquire(zero), T(value & 0xf));
- QCOMPARE(atomic.load(), zero);
+ QCOMPARE(atomic.loadRelaxed(), zero);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic.fetchAndAndRelease(minusOne), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndAndRelease(f), T(value));
- QCOMPARE(atomic.load(), T(value & 0xf));
+ QCOMPARE(atomic.loadRelaxed(), T(value & 0xf));
QCOMPARE(atomic.fetchAndAndRelease(zero), T(value & 0xf));
- QCOMPARE(atomic.load(), zero);
+ QCOMPARE(atomic.loadRelaxed(), zero);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic.fetchAndAndOrdered(minusOne), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndAndOrdered(f), T(value));
- QCOMPARE(atomic.load(), T(value & 0xf));
+ QCOMPARE(atomic.loadRelaxed(), T(value & 0xf));
QCOMPARE(atomic.fetchAndAndOrdered(zero), T(value & 0xf));
- QCOMPARE(atomic.load(), zero);
+ QCOMPARE(atomic.loadRelaxed(), zero);
- atomic.store(value);
+ atomic.storeRelaxed(value);
QCOMPARE(atomic &= minusOne, T(value));
QCOMPARE(atomic &= f, T(value & 0xf));
QCOMPARE(atomic &= zero, zero);
@@ -749,48 +749,48 @@ void tst_QAtomicIntegerXX::fetchAndXor()
T minusOne = T(~0);
QCOMPARE(atomic.fetchAndXorRelaxed(zero), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorRelaxed(pattern), T(value));
- QCOMPARE(atomic.load(), T(value ^ pattern));
+ QCOMPARE(atomic.loadRelaxed(), T(value ^ pattern));
QCOMPARE(atomic.fetchAndXorRelaxed(pattern), T(value ^ pattern));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorRelaxed(minusOne), T(value));
- QCOMPARE(atomic.load(), T(~value));
+ QCOMPARE(atomic.loadRelaxed(), T(~value));
QCOMPARE(atomic.fetchAndXorRelaxed(minusOne), T(~value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorAcquire(zero), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorAcquire(pattern), T(value));
- QCOMPARE(atomic.load(), T(value ^ pattern));
+ QCOMPARE(atomic.loadRelaxed(), T(value ^ pattern));
QCOMPARE(atomic.fetchAndXorAcquire(pattern), T(value ^ pattern));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorAcquire(minusOne), T(value));
- QCOMPARE(atomic.load(), T(~value));
+ QCOMPARE(atomic.loadRelaxed(), T(~value));
QCOMPARE(atomic.fetchAndXorAcquire(minusOne), T(~value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorRelease(zero), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorRelease(pattern), T(value));
- QCOMPARE(atomic.load(), T(value ^ pattern));
+ QCOMPARE(atomic.loadRelaxed(), T(value ^ pattern));
QCOMPARE(atomic.fetchAndXorRelease(pattern), T(value ^ pattern));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorRelease(minusOne), T(value));
- QCOMPARE(atomic.load(), T(~value));
+ QCOMPARE(atomic.loadRelaxed(), T(~value));
QCOMPARE(atomic.fetchAndXorRelease(minusOne), T(~value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorOrdered(zero), T(value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorOrdered(pattern), T(value));
- QCOMPARE(atomic.load(), T(value ^ pattern));
+ QCOMPARE(atomic.loadRelaxed(), T(value ^ pattern));
QCOMPARE(atomic.fetchAndXorOrdered(pattern), T(value ^ pattern));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic.fetchAndXorOrdered(minusOne), T(value));
- QCOMPARE(atomic.load(), T(~value));
+ QCOMPARE(atomic.loadRelaxed(), T(~value));
QCOMPARE(atomic.fetchAndXorOrdered(minusOne), T(~value));
- QCOMPARE(atomic.load(), T(value));
+ QCOMPARE(atomic.loadRelaxed(), T(value));
QCOMPARE(atomic ^= zero, T(value));
QCOMPARE(atomic ^= pattern, T(value ^ pattern));
diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
index 0200473cae..a699cf6202 100644
--- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
+++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
@@ -75,7 +75,7 @@ void tst_QAtomicPointer::warningFreeHelper()
QBasicAtomicPointer<WFHC> p = Q_BASIC_ATOMIC_INITIALIZER(0);
- p.load()->bar();
+ p.loadRelaxed()->bar();
WFHC *expectedValue = 0;
WFHC *newValue = 0;
@@ -119,15 +119,15 @@ void tst_QAtomicPointer::constructor()
{
void *one = this;
QAtomicPointer<void> atomic1 = one;
- QCOMPARE(atomic1.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), one);
void *two = &one;
QAtomicPointer<void> atomic2 = two;
- QCOMPARE(atomic2.load(), two);
+ QCOMPARE(atomic2.loadRelaxed(), two);
void *three = &two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic3.loadRelaxed(), three);
}
void tst_QAtomicPointer::copy_constructor()
@@ -135,20 +135,20 @@ void tst_QAtomicPointer::copy_constructor()
void *one = this;
QAtomicPointer<void> atomic1 = one;
QAtomicPointer<void> atomic1_copy = atomic1;
- QCOMPARE(atomic1_copy.load(), one);
- QCOMPARE(atomic1_copy.load(), atomic1.load());
+ QCOMPARE(atomic1_copy.loadRelaxed(), one);
+ QCOMPARE(atomic1_copy.loadRelaxed(), atomic1.loadRelaxed());
void *two = &one;
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic2_copy = atomic2;
- QCOMPARE(atomic2_copy.load(), two);
- QCOMPARE(atomic2_copy.load(), atomic2.load());
+ QCOMPARE(atomic2_copy.loadRelaxed(), two);
+ QCOMPARE(atomic2_copy.loadRelaxed(), atomic2.loadRelaxed());
void *three = &two;
QAtomicPointer<void> atomic3 = three;
QAtomicPointer<void> atomic3_copy = atomic3;
- QCOMPARE(atomic3_copy.load(), three);
- QCOMPARE(atomic3_copy.load(), atomic3.load());
+ QCOMPARE(atomic3_copy.loadRelaxed(), three);
+ QCOMPARE(atomic3_copy.loadRelaxed(), atomic3.loadRelaxed());
}
void tst_QAtomicPointer::assignment_operator()
@@ -161,17 +161,17 @@ void tst_QAtomicPointer::assignment_operator()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
atomic1 = two;
atomic2 = three;
atomic3 = one;
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
void tst_QAtomicPointer::isTestAndSetNative()
@@ -234,17 +234,17 @@ void tst_QAtomicPointer::testAndSet()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QVERIFY(atomic1.testAndSetRelaxed(one, two));
QVERIFY(atomic2.testAndSetRelaxed(two, three));
QVERIFY(atomic3.testAndSetRelaxed(three, one));
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
{
@@ -252,17 +252,17 @@ void tst_QAtomicPointer::testAndSet()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QVERIFY(atomic1.testAndSetAcquire(one, two));
QVERIFY(atomic2.testAndSetAcquire(two, three));
QVERIFY(atomic3.testAndSetAcquire(three, one));
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
{
@@ -270,17 +270,17 @@ void tst_QAtomicPointer::testAndSet()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QVERIFY(atomic1.testAndSetRelease(one, two));
QVERIFY(atomic2.testAndSetRelease(two, three));
QVERIFY(atomic3.testAndSetRelease(three, one));
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
{
@@ -288,17 +288,17 @@ void tst_QAtomicPointer::testAndSet()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QVERIFY(atomic1.testAndSetOrdered(one, two));
QVERIFY(atomic2.testAndSetOrdered(two, three));
QVERIFY(atomic3.testAndSetOrdered(three, one));
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
}
@@ -362,17 +362,17 @@ void tst_QAtomicPointer::fetchAndStore()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QCOMPARE(atomic1.fetchAndStoreRelaxed(two), one);
QCOMPARE(atomic2.fetchAndStoreRelaxed(three), two);
QCOMPARE(atomic3.fetchAndStoreRelaxed(one), three);
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
{
@@ -380,17 +380,17 @@ void tst_QAtomicPointer::fetchAndStore()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QCOMPARE(atomic1.fetchAndStoreAcquire(two), one);
QCOMPARE(atomic2.fetchAndStoreAcquire(three), two);
QCOMPARE(atomic3.fetchAndStoreAcquire(one), three);
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
{
@@ -398,17 +398,17 @@ void tst_QAtomicPointer::fetchAndStore()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QCOMPARE(atomic1.fetchAndStoreRelease(two), one);
QCOMPARE(atomic2.fetchAndStoreRelease(three), two);
QCOMPARE(atomic3.fetchAndStoreRelease(one), three);
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
{
@@ -416,17 +416,17 @@ void tst_QAtomicPointer::fetchAndStore()
QAtomicPointer<void> atomic2 = two;
QAtomicPointer<void> atomic3 = three;
- QCOMPARE(atomic1.load(), one);
- QCOMPARE(atomic2.load(), two);
- QCOMPARE(atomic3.load(), three);
+ QCOMPARE(atomic1.loadRelaxed(), one);
+ QCOMPARE(atomic2.loadRelaxed(), two);
+ QCOMPARE(atomic3.loadRelaxed(), three);
QCOMPARE(atomic1.fetchAndStoreOrdered(two), one);
QCOMPARE(atomic2.fetchAndStoreOrdered(three), two);
QCOMPARE(atomic3.fetchAndStoreOrdered(one), three);
- QCOMPARE(atomic1.load(), two);
- QCOMPARE(atomic2.load(), three);
- QCOMPARE(atomic3.load(), one);
+ QCOMPARE(atomic1.loadRelaxed(), two);
+ QCOMPARE(atomic2.loadRelaxed(), three);
+ QCOMPARE(atomic3.loadRelaxed(), one);
}
}
@@ -530,60 +530,60 @@ void tst_QAtomicPointer::fetchAndAdd()
// cast to void* in order to avoid QCOMPARE to compare string content of the char*
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddRelaxed(valueToAdd)), static_cast<void*>(pc));
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddRelaxed(-valueToAdd)), static_cast<void*>(pc + valueToAdd));
- QCOMPARE(static_cast<void*>(pointer1.load()), static_cast<void*>(pc));
+ QCOMPARE(static_cast<void*>(pointer1.loadRelaxed()), static_cast<void*>(pc));
QAtomicPointer<short> pointer2 = ps;
QCOMPARE(pointer2.fetchAndAddRelaxed(valueToAdd), ps);
QCOMPARE(pointer2.fetchAndAddRelaxed(-valueToAdd), ps + valueToAdd);
- QCOMPARE(pointer2.load(), ps);
+ QCOMPARE(pointer2.loadRelaxed(), ps);
QAtomicPointer<int> pointer3 = pi;
QCOMPARE(pointer3.fetchAndAddRelaxed(valueToAdd), pi);
QCOMPARE(pointer3.fetchAndAddRelaxed(-valueToAdd), pi + valueToAdd);
- QCOMPARE(pointer3.load(), pi);
+ QCOMPARE(pointer3.loadRelaxed(), pi);
}
{
QAtomicPointer<char> pointer1 = pc;
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddAcquire(valueToAdd)), static_cast<void*>(pc));
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddAcquire(-valueToAdd)), static_cast<void*>(pc + valueToAdd));
- QCOMPARE(static_cast<void*>(pointer1.load()), static_cast<void*>(pc));
+ QCOMPARE(static_cast<void*>(pointer1.loadRelaxed()), static_cast<void*>(pc));
QAtomicPointer<short> pointer2 = ps;
QCOMPARE(pointer2.fetchAndAddAcquire(valueToAdd), ps);
QCOMPARE(pointer2.fetchAndAddAcquire(-valueToAdd), ps + valueToAdd);
- QCOMPARE(pointer2.load(), ps);
+ QCOMPARE(pointer2.loadRelaxed(), ps);
QAtomicPointer<int> pointer3 = pi;
QCOMPARE(pointer3.fetchAndAddAcquire(valueToAdd), pi);
QCOMPARE(pointer3.fetchAndAddAcquire(-valueToAdd), pi + valueToAdd);
- QCOMPARE(pointer3.load(), pi);
+ QCOMPARE(pointer3.loadRelaxed(), pi);
}
{
QAtomicPointer<char> pointer1 = pc;
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddRelease(valueToAdd)), static_cast<void*>(pc));
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddRelease(-valueToAdd)), static_cast<void*>(pc + valueToAdd));
- QCOMPARE(static_cast<void*>(pointer1.load()), static_cast<void*>(pc));
+ QCOMPARE(static_cast<void*>(pointer1.loadRelaxed()), static_cast<void*>(pc));
QAtomicPointer<short> pointer2 = ps;
QCOMPARE(pointer2.fetchAndAddRelease(valueToAdd), ps);
QCOMPARE(pointer2.fetchAndAddRelease(-valueToAdd), ps + valueToAdd);
- QCOMPARE(pointer2.load(), ps);
+ QCOMPARE(pointer2.loadRelaxed(), ps);
QAtomicPointer<int> pointer3 = pi;
QCOMPARE(pointer3.fetchAndAddRelease(valueToAdd), pi);
QCOMPARE(pointer3.fetchAndAddRelease(-valueToAdd), pi + valueToAdd);
- QCOMPARE(pointer3.load(), pi);
+ QCOMPARE(pointer3.loadRelaxed(), pi);
}
{
QAtomicPointer<char> pointer1 = pc;
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddOrdered(valueToAdd)), static_cast<void*>(pc));
QCOMPARE(static_cast<void*>(pointer1.fetchAndAddOrdered(-valueToAdd)), static_cast<void*>(pc + valueToAdd));
- QCOMPARE(static_cast<void*>(pointer1.load()), static_cast<void*>(pc));
+ QCOMPARE(static_cast<void*>(pointer1.loadRelaxed()), static_cast<void*>(pc));
QAtomicPointer<short> pointer2 = ps;
QCOMPARE(pointer2.fetchAndAddOrdered(valueToAdd), ps);
QCOMPARE(pointer2.fetchAndAddOrdered(-valueToAdd), ps + valueToAdd);
- QCOMPARE(pointer2.load(), ps);
+ QCOMPARE(pointer2.loadRelaxed(), ps);
QAtomicPointer<int> pointer3 = pi;
QCOMPARE(pointer3.fetchAndAddOrdered(valueToAdd), pi);
QCOMPARE(pointer3.fetchAndAddOrdered(-valueToAdd), pi + valueToAdd);
- QCOMPARE(pointer3.load(), pi);
+ QCOMPARE(pointer3.loadRelaxed(), pi);
}
}
@@ -598,34 +598,34 @@ template <typename T> void constAndVolatile_helper()
QAtomicPointer<T> atomic2 = two;
QAtomicPointer<T> atomic3 = three;
- QVERIFY(atomic1.load() == one);
- QVERIFY(atomic2.load() == two);
- QVERIFY(atomic3.load() == three);
+ QVERIFY(atomic1.loadRelaxed() == one);
+ QVERIFY(atomic2.loadRelaxed() == two);
+ QVERIFY(atomic3.loadRelaxed() == three);
QVERIFY(atomic1.fetchAndStoreRelaxed(two) == one);
QVERIFY(atomic2.fetchAndStoreRelaxed(three) == two);
QVERIFY(atomic3.fetchAndStoreRelaxed(one) == three);
- QVERIFY(atomic1.load() == two);
- QVERIFY(atomic2.load() == three);
- QVERIFY(atomic3.load() == one);
+ QVERIFY(atomic1.loadRelaxed() == two);
+ QVERIFY(atomic2.loadRelaxed() == three);
+ QVERIFY(atomic3.loadRelaxed() == one);
}
{
QAtomicPointer<T> atomic1 = one;
QAtomicPointer<T> atomic2 = two;
QAtomicPointer<T> atomic3 = three;
- QVERIFY(atomic1.load() == one);
- QVERIFY(atomic2.load() == two);
- QVERIFY(atomic3.load() == three);
+ QVERIFY(atomic1.loadRelaxed() == one);
+ QVERIFY(atomic2.loadRelaxed() == two);
+ QVERIFY(atomic3.loadRelaxed() == three);
QVERIFY(atomic1.testAndSetRelaxed(one, two));
QVERIFY(atomic2.testAndSetRelaxed(two, three));
QVERIFY(atomic3.testAndSetRelaxed(three, one));
- QVERIFY(atomic1.load() == two);
- QVERIFY(atomic2.load() == three);
- QVERIFY(atomic3.load() == one);
+ QVERIFY(atomic1.loadRelaxed() == two);
+ QVERIFY(atomic2.loadRelaxed() == three);
+ QVERIFY(atomic3.loadRelaxed() == one);
}
}
diff --git a/tests/auto/corelib/thread/qfuture/qfuture.pro b/tests/auto/corelib/thread/qfuture/qfuture.pro
index b1667760d6..1f21130af7 100644
--- a/tests/auto/corelib/thread/qfuture/qfuture.pro
+++ b/tests/auto/corelib/thread/qfuture/qfuture.pro
@@ -3,3 +3,4 @@ TARGET = tst_qfuture
QT = core core-private testlib
SOURCES = tst_qfuture.cpp
DEFINES += QT_STRICT_ITERATORS
+DEFINES -= QT_NO_JAVA_STYLE_ITERATORS
diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
index b8c82c2ea0..a42454124e 100644
--- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
@@ -49,6 +49,24 @@ struct ResultStoreInt : QtPrivate::ResultStoreBase
~ResultStoreInt() { clear<int>(); }
};
+class LambdaThread : public QThread
+{
+public:
+ LambdaThread(std::function<void ()> fn)
+ :m_fn(fn)
+ {
+
+ }
+
+ void run() override
+ {
+ m_fn();
+ }
+
+private:
+ std::function<void ()> m_fn;
+};
+
class tst_QFuture: public QObject
{
Q_OBJECT
@@ -67,6 +85,7 @@ private slots:
void resultsAsList();
void implicitConversions();
void iterators();
+ void iteratorsThread();
void pause();
void throttling();
void voidConversions();
@@ -1144,6 +1163,54 @@ void tst_QFuture::iterators()
}
}
}
+void tst_QFuture::iteratorsThread()
+{
+ const int expectedResultCount = 10;
+ const int delay = 10;
+ QFutureInterface<int> futureInterface;
+
+ // Create result producer thread. The results are
+ // produced with delays in order to make the consumer
+ // wait.
+ QSemaphore sem;
+ LambdaThread thread = {[=, &futureInterface, &sem](){
+ for (int i = 1; i <= expectedResultCount; i += 2) {
+ int result = i;
+ futureInterface.reportResult(&result);
+ result = i + 1;
+ futureInterface.reportResult(&result);
+ }
+
+ sem.acquire(2);
+ futureInterface.reportFinished();
+ }};
+
+ futureInterface.reportStarted();
+ QFuture<int> future = futureInterface.future();
+
+ // Iterate over results while the thread is producing them.
+ thread.start();
+ int resultCount = 0;
+ int resultSum = 0;
+ for (int result : future) {
+ sem.release();
+ ++resultCount;
+ resultSum += result;
+ }
+ thread.wait();
+
+ QCOMPARE(resultCount, expectedResultCount);
+ QCOMPARE(resultSum, expectedResultCount * (expectedResultCount + 1) / 2);
+
+ // Reverse iterate
+ resultSum = 0;
+ QFutureIterator<int> it(future);
+ it.toBack();
+ while (it.hasPrevious())
+ resultSum += it.previous();
+
+ QCOMPARE(resultSum, expectedResultCount * (expectedResultCount + 1) / 2);
+}
class SignalSlotObject : public QObject
{
diff --git a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
index b2ef516b4e..a322a1c11d 100644
--- a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -27,6 +27,7 @@
****************************************************************************/
#include <QCoreApplication>
#include <QDebug>
+#include <QElapsedTimer>
#include <QtTest/QtTest>
#include <QtConcurrent>
@@ -878,7 +879,7 @@ void tst_QFutureWatcher::incrementalFilterResults()
void tst_QFutureWatcher::qfutureSynchronizer()
{
int taskCount = 1000;
- QTime t;
+ QElapsedTimer t;
t.start();
{
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
index 7fb9a861d7..749aa45916 100644
--- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
@@ -69,7 +69,8 @@ private slots:
static const int iterations = 100;
QAtomicInt lockCount(0);
-QMutex normalMutex, recursiveMutex(QMutex::Recursive);
+QMutex normalMutex;
+QRecursiveMutex recursiveMutex;
QSemaphore testsTurn;
QSemaphore threadsTurn;
@@ -993,9 +994,9 @@ public:
QMutex mutex;
QWaitCondition cond;
- QMutex &test_mutex;
+ QRecursiveMutex &test_mutex;
- inline rmutex_Thread(QMutex &m) : test_mutex(m) { }
+ inline rmutex_Thread(QRecursiveMutex &m) : test_mutex(m) { }
void run()
{
@@ -1024,7 +1025,7 @@ void tst_QMutex::lock_unlock_locked_tryLock()
QMutex mutex;
mutex_Thread thread(mutex);
- QMutex rmutex(QMutex::Recursive);
+ QRecursiveMutex rmutex;
rmutex_Thread rthread(rmutex);
for (int i = 0; i < iterations; ++i) {
@@ -1132,7 +1133,7 @@ void tst_QMutex::stressTest()
for (int i = 1; i < threadCount; ++i)
QVERIFY(threads[i].wait(10000));
QCOMPARE(StressTestThread::errorCount, 0);
- qDebug("locked %d times", int(StressTestThread::lockCount.load()));
+ qDebug("locked %d times", int(StressTestThread::lockCount.loadRelaxed()));
}
class TryLockRaceThread : public QThread
@@ -1286,28 +1287,28 @@ public:
quint64 i = 0;
while (t.elapsed() < one_minute) {
i++;
- uint nb = (i * 9 + lockCount.load() * 13) % threadCount;
+ uint nb = (i * 9 + lockCount.loadRelaxed() * 13) % threadCount;
QMutexLocker locker(&mutex[nb]);
- if (sentinel[nb].load()) errorCount.ref();
+ if (sentinel[nb].loadRelaxed()) errorCount.ref();
if (sentinel[nb].fetchAndAddRelaxed(5)) errorCount.ref();
if (!sentinel[nb].testAndSetRelaxed(5, 0)) errorCount.ref();
- if (sentinel[nb].load()) errorCount.ref();
+ if (sentinel[nb].loadRelaxed()) errorCount.ref();
lockCount.ref();
- nb = (nb * 17 + i * 5 + lockCount.load() * 3) % threadCount;
+ nb = (nb * 17 + i * 5 + lockCount.loadRelaxed() * 3) % threadCount;
if (mutex[nb].tryLock()) {
- if (sentinel[nb].load()) errorCount.ref();
+ if (sentinel[nb].loadRelaxed()) errorCount.ref();
if (sentinel[nb].fetchAndAddRelaxed(16)) errorCount.ref();
if (!sentinel[nb].testAndSetRelaxed(16, 0)) errorCount.ref();
- if (sentinel[nb].load()) errorCount.ref();
+ if (sentinel[nb].loadRelaxed()) errorCount.ref();
lockCount.ref();
mutex[nb].unlock();
}
- nb = (nb * 15 + i * 47 + lockCount.load() * 31) % threadCount;
+ nb = (nb * 15 + i * 47 + lockCount.loadRelaxed() * 31) % threadCount;
if (mutex[nb].tryLock(2)) {
- if (sentinel[nb].load()) errorCount.ref();
+ if (sentinel[nb].loadRelaxed()) errorCount.ref();
if (sentinel[nb].fetchAndAddRelaxed(53)) errorCount.ref();
if (!sentinel[nb].testAndSetRelaxed(53, 0)) errorCount.ref();
- if (sentinel[nb].load()) errorCount.ref();
+ if (sentinel[nb].loadRelaxed()) errorCount.ref();
lockCount.ref();
mutex[nb].unlock();
}
@@ -1327,8 +1328,8 @@ void tst_QMutex::moreStress()
QVERIFY(threads[0].wait(one_minute + 10000));
for (int i = 1; i < threadCount; ++i)
QVERIFY(threads[i].wait(10000));
- qDebug("locked %d times", MoreStressTestThread::lockCount.load());
- QCOMPARE(MoreStressTestThread::errorCount.load(), 0);
+ qDebug("locked %d times", MoreStressTestThread::lockCount.loadRelaxed());
+ QCOMPARE(MoreStressTestThread::errorCount.loadRelaxed(), 0);
}
diff --git a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp
index 67db5d1458..c83e186ca7 100644
--- a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp
+++ b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp
@@ -36,7 +36,7 @@
class tst_QMutexLockerThread : public QThread
{
public:
- QMutex mutex;
+ QRecursiveMutex mutex;
QSemaphore semaphore, testSemaphore;
void waitForTest()
@@ -45,10 +45,6 @@ public:
testSemaphore.acquire();
}
- tst_QMutexLockerThread()
- : mutex(QMutex::Recursive)
- {
- }
};
class tst_QMutexLocker : public QObject
diff --git a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index 8e97229752..47bae585a1 100644
--- a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <qcoreapplication.h>
#include <qreadwritelock.h>
+#include <qelapsedtimer.h>
#include <qmutex.h>
#include <qthread.h>
#include <qwaitcondition.h>
@@ -237,7 +238,7 @@ void tst_QReadWriteLock::tryReadLock()
testsTurn.release();
threadsTurn.acquire();
- QTime timer;
+ QElapsedTimer timer;
timer.start();
QVERIFY(!readWriteLock.tryLockForRead(1000));
QVERIFY(timer.elapsed() >= 1000);
@@ -457,7 +458,7 @@ public:
void run()
{
testRwlock.lockForWrite();
- while(release.load()==false) {
+ while (release.loadRelaxed() == false) {
RWTESTSLEEP
}
testRwlock.unlock();
@@ -477,7 +478,7 @@ public:
void run()
{
testRwlock.lockForRead();
- while(release.load()==false) {
+ while (release.loadRelaxed() == false) {
RWTESTSLEEP
}
testRwlock.unlock();
@@ -500,7 +501,7 @@ public:
int holdTime;
int waitTime;
bool print;
- QTime t;
+ QElapsedTimer t;
inline ReadLockLoopThread(QReadWriteLock &l, int runTime, int holdTime=0, int waitTime=0, bool print=false)
:testRwlock(l)
,runTime(runTime)
@@ -536,7 +537,7 @@ public:
int holdTime;
int waitTime;
bool print;
- QTime t;
+ QElapsedTimer t;
inline WriteLockLoopThread(QReadWriteLock &l, int runTime, int holdTime=0, int waitTime=0, bool print=false)
:testRwlock(l)
,runTime(runTime)
@@ -574,7 +575,7 @@ public:
int runTime;
int waitTime;
int maxval;
- QTime t;
+ QElapsedTimer t;
inline WriteLockCountThread(QReadWriteLock &l, int runTime, int waitTime, int maxval)
:testRwlock(l)
,runTime(runTime)
@@ -615,7 +616,7 @@ public:
QReadWriteLock &testRwlock;
int runTime;
int waitTime;
- QTime t;
+ QElapsedTimer t;
inline ReadLockCountThread(QReadWriteLock &l, int runTime, int waitTime)
:testRwlock(l)
,runTime(runTime)
@@ -676,7 +677,7 @@ void tst_QReadWriteLock::multipleReadersBlockRelease()
{
QReadWriteLock testLock;
- release.store(false);
+ release.storeRelaxed(false);
threadDone=false;
ReadLockReleasableThread rlt1(testLock);
ReadLockReleasableThread rlt2(testLock);
@@ -686,7 +687,7 @@ void tst_QReadWriteLock::multipleReadersBlockRelease()
WriteLockThread wlt(testLock);
wlt.start();
sleep(1);
- release.store(true);
+ release.storeRelaxed(true);
wlt.wait();
rlt1.wait();
rlt2.wait();
@@ -873,7 +874,7 @@ void tst_QReadWriteLock::deleteOnUnlock()
DeleteOnUnlockThread thread2(&lock, &startup, &waitMutex);
- QTime t;
+ QElapsedTimer t;
t.start();
while(t.elapsed() < 4000) {
lock = new QReadWriteLock();
@@ -899,7 +900,7 @@ void tst_QReadWriteLock::uncontendedLocks()
uint count=0;
int millisecs=1000;
{
- QTime t;
+ QElapsedTimer t;
t.start();
while(t.elapsed() <millisecs)
{
@@ -908,7 +909,7 @@ void tst_QReadWriteLock::uncontendedLocks()
}
{
QReadWriteLock rwlock;
- QTime t;
+ QElapsedTimer t;
t.start();
while(t.elapsed() <millisecs)
{
@@ -919,7 +920,7 @@ void tst_QReadWriteLock::uncontendedLocks()
}
{
QReadWriteLock rwlock;
- QTime t;
+ QElapsedTimer t;
t.start();
while(t.elapsed() <millisecs)
{
diff --git a/tests/auto/corelib/thread/qsemaphore/BLACKLIST b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
index 0786f50417..d7af5c420b 100644
--- a/tests/auto/corelib/thread/qsemaphore/BLACKLIST
+++ b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
@@ -1,3 +1,5 @@
+[tryAcquireWithTimeout]
+osx
[tryAcquireWithTimeout:0.2s]
windows
osx-10.12
diff --git a/tests/auto/corelib/thread/qthread/BLACKLIST b/tests/auto/corelib/thread/qthread/BLACKLIST
index d75249454f..c683154da1 100644
--- a/tests/auto/corelib/thread/qthread/BLACKLIST
+++ b/tests/auto/corelib/thread/qthread/BLACKLIST
@@ -1,2 +1,5 @@
[wait3_slowDestructor]
-windows
+windows-10
+[sleep]
+windows-7sp1
+
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index d73dcc1b6d..7be2f48758 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -29,7 +29,7 @@
#include <QtTest/QtTest>
#include <qcoreapplication.h>
-#include <qdatetime.h>
+#include <qelapsedtimer.h>
#include <qmutex.h>
#include <qthread.h>
#include <qtimer.h>
@@ -110,6 +110,12 @@ private slots:
enum { one_minute = 60 * 1000, five_minutes = 5 * one_minute };
+template <class Int>
+static QString msgElapsed(Int elapsed)
+{
+ return QString::fromLatin1("elapsed: %1").arg(elapsed);
+}
+
class SignalRecorder : public QObject
{
Q_OBJECT
@@ -121,7 +127,7 @@ public:
{ }
bool wasActivated()
- { return activationCount.load() > 0; }
+ { return activationCount.loadRelaxed() > 0; }
public slots:
void slot();
@@ -244,8 +250,8 @@ public:
QMutexLocker locker(&mutex);
elapsed = 0;
- QTime time;
- time.start();
+ QElapsedTimer timer;
+ timer.start();
switch (sleepType) {
case Second:
sleep(interval);
@@ -257,7 +263,7 @@ public:
usleep(interval);
break;
}
- elapsed = time.elapsed();
+ elapsed = timer.elapsed();
cond.wakeOne();
}
@@ -591,7 +597,7 @@ void tst_QThread::sleep()
thread.interval = 2;
thread.start();
QVERIFY(thread.wait(five_minutes));
- QVERIFY(thread.elapsed >= 2000);
+ QVERIFY2(thread.elapsed >= 2000, qPrintable(msgElapsed(thread.elapsed)));
}
void tst_QThread::msleep()
@@ -601,11 +607,10 @@ void tst_QThread::msleep()
thread.interval = 120;
thread.start();
QVERIFY(thread.wait(five_minutes));
-#if defined (Q_OS_WIN)
- // Since the resolution of QTime is so coarse...
- QVERIFY(thread.elapsed >= 100);
+#if defined (Q_OS_WIN) // May no longer be needed
+ QVERIFY2(thread.elapsed >= 100, qPrintable(msgElapsed(thread.elapsed)));
#else
- QVERIFY(thread.elapsed >= 120);
+ QVERIFY2(thread.elapsed >= 120, qPrintable(msgElapsed(thread.elapsed)));
#endif
}
@@ -616,11 +621,10 @@ void tst_QThread::usleep()
thread.interval = 120000;
thread.start();
QVERIFY(thread.wait(five_minutes));
-#if defined (Q_OS_WIN)
- // Since the resolution of QTime is so coarse...
- QVERIFY(thread.elapsed >= 100);
+#if defined (Q_OS_WIN) // May no longer be needed
+ QVERIFY2(thread.elapsed >= 100, qPrintable(msgElapsed(thread.elapsed)));
#else
- QVERIFY(thread.elapsed >= 120);
+ QVERIFY2(thread.elapsed >= 120, qPrintable(msgElapsed(thread.elapsed)));
#endif
}
@@ -902,7 +906,7 @@ void tst_QThread::adoptMultipleThreads()
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(recorder.activationCount.load(), numThreads);
+ QCOMPARE(recorder.activationCount.loadRelaxed(), numThreads);
}
void tst_QThread::adoptMultipleThreadsOverlap()
@@ -939,7 +943,7 @@ void tst_QThread::adoptMultipleThreadsOverlap()
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(recorder.activationCount.load(), numThreads);
+ QCOMPARE(recorder.activationCount.loadRelaxed(), numThreads);
}
// Disconnects on WinCE
@@ -948,9 +952,9 @@ void tst_QThread::stressTest()
if (EmulationDetector::isRunningArmOnX86())
QSKIP("Qemu uses too much memory for each thread. Test would run out of memory.");
- QTime t;
- t.start();
- while (t.elapsed() < one_minute) {
+ QElapsedTimer timer;
+ timer.start();
+ while (timer.elapsed() < one_minute) {
Current_Thread t;
t.start();
t.wait(one_minute);
@@ -1067,13 +1071,15 @@ void tst_QThread::wait2()
timer.start();
QVERIFY(!thread.wait(Waiting_Thread::WaitTime));
qint64 elapsed = timer.elapsed(); // On Windows, we sometimes get (WaitTime - 9).
- QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 10, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed)));
+ QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 10,
+ qPrintable(msgElapsed(elapsed)));
timer.start();
thread.cond1.wakeOne();
QVERIFY(thread.wait(/*Waiting_Thread::WaitTime * 1.4*/));
elapsed = timer.elapsed();
- QVERIFY2(elapsed - Waiting_Thread::WaitTime >= -1, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed)));
+ QVERIFY2(elapsed - Waiting_Thread::WaitTime >= -1,
+ qPrintable(msgElapsed(elapsed)));
}
@@ -1210,7 +1216,7 @@ class DummyEventDispatcher : public QAbstractEventDispatcher {
public:
DummyEventDispatcher() : QAbstractEventDispatcher() {}
bool processEvents(QEventLoop::ProcessEventsFlags) {
- visited.store(true);
+ visited.storeRelaxed(true);
emit awake();
QCoreApplication::sendPostedEvents();
return false;
@@ -1272,7 +1278,7 @@ void tst_QThread::customEventDispatcher()
QMetaObject::invokeMethod(&obj, "visit", Qt::QueuedConnection);
loop.exec();
// test that the ED has really been used
- QVERIFY(ed->visited.load());
+ QVERIFY(ed->visited.loadRelaxed());
QPointer<DummyEventDispatcher> weak_ed(ed);
QVERIFY(!weak_ed.isNull());
@@ -1330,6 +1336,8 @@ void tst_QThread::quitLock()
QCOMPARE(job->thread(), &thread);
loop.exec();
QVERIFY(exitThreadCalled);
+
+ delete job;
}
void tst_QThread::create()
diff --git a/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
index d27884197a..3826fa148e 100644
--- a/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
+++ b/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
@@ -32,7 +32,7 @@
#include "qmutex.h"
-Q_GLOBAL_STATIC_WITH_ARGS(QMutex, onceInitializationMutex, (QMutex::Recursive))
+Q_GLOBAL_STATIC(QRecursiveMutex, onceInitializationMutex)
enum QOnceExtra {
MustRunCode = 0x01,
diff --git a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
index a9af182ed8..710288af9e 100644
--- a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
+++ b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
@@ -56,7 +56,7 @@ class SingletonObject: public QObject
Q_OBJECT
public:
static int runCount;
- SingletonObject() { val.store(42); ++runCount; }
+ SingletonObject() { val.storeRelaxed(42); ++runCount; }
~SingletonObject() { }
QBasicAtomicInt val;
@@ -112,7 +112,7 @@ void tst_QThreadOnce::sameThread()
QCOMPARE(controlVariable, 1);
static QSingleton<SingletonObject> s;
- QTEST((int)s->val.load(), "expectedValue");
+ QTEST((int)s->val.loadRelaxed(), "expectedValue");
s->val.ref();
QCOMPARE(SingletonObject::runCount, 1);
@@ -134,7 +134,7 @@ void tst_QThreadOnce::multipleThreads()
QCOMPARE(controlVariable, 0); // nothing must have set them yet
SingletonObject::runCount = 0;
- IncrementThread::runCount.store(0);
+ IncrementThread::runCount.storeRelaxed(0);
// wait for all of them to be ready
sem2.acquire(NumberOfThreads);
@@ -145,7 +145,7 @@ void tst_QThreadOnce::multipleThreads()
delete parent;
QCOMPARE(controlVariable, 1);
- QCOMPARE((int)IncrementThread::runCount.load(), NumberOfThreads);
+ QCOMPARE((int)IncrementThread::runCount.loadRelaxed(), NumberOfThreads);
QCOMPARE(SingletonObject::runCount, 1);
}
diff --git a/tests/auto/corelib/thread/qthreadpool/BLACKLIST b/tests/auto/corelib/thread/qthreadpool/BLACKLIST
index fc49731687..b8c1f3bf3f 100644
--- a/tests/auto/corelib/thread/qthreadpool/BLACKLIST
+++ b/tests/auto/corelib/thread/qthreadpool/BLACKLIST
@@ -1,3 +1,4 @@
[expiryTimeoutRace]
-osx
-linux
+opensuse-leap
+ubuntu
+rhel
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index 838431cd5a..60e8d8cba2 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -27,7 +27,7 @@
**
****************************************************************************/
#include <QtTest/QtTest>
-#include <qdatetime.h>
+#include <qelapsedtimer.h>
#include <qthreadpool.h>
#include <qstring.h>
#include <qmutex.h>
@@ -92,7 +92,9 @@ private slots:
void priorityStart();
void waitForDone();
void clear();
+#if QT_DEPRECATED_SINCE(5, 9)
void cancel();
+#endif
void tryTake();
void waitForDoneTimeout();
void destroyingWaitsForTasksToFinish();
@@ -220,16 +222,16 @@ class TestTask : public QRunnable
public:
void run()
{
- ran.store(true);
+ ran.storeRelaxed(true);
}
};
void tst_QThreadPool::runTask()
{
QThreadPool manager;
- ran.store(false);
+ ran.storeRelaxed(false);
manager.start(new TestTask());
- QTRY_VERIFY(ran.load());
+ QTRY_VERIFY(ran.loadRelaxed());
}
/*
@@ -237,9 +239,9 @@ void tst_QThreadPool::runTask()
*/
void tst_QThreadPool::singleton()
{
- ran.store(false);
+ ran.storeRelaxed(false);
QThreadPool::globalInstance()->start(new TestTask());
- QTRY_VERIFY(ran.load());
+ QTRY_VERIFY(ran.loadRelaxed());
}
QAtomicInt *value = 0;
@@ -344,7 +346,7 @@ void tst_QThreadPool::expiryTimeout()
// run the task
threadPool.start(&task);
QVERIFY(task.semaphore.tryAcquire(1, 10000));
- QCOMPARE(task.runCount.load(), 1);
+ QCOMPARE(task.runCount.loadRelaxed(), 1);
QVERIFY(!task.thread->wait(100));
// thread should expire
QThread *firstThread = task.thread;
@@ -353,7 +355,7 @@ void tst_QThreadPool::expiryTimeout()
// run task again, thread should be restarted
threadPool.start(&task);
QVERIFY(task.semaphore.tryAcquire(1, 10000));
- QCOMPARE(task.runCount.load(), 2);
+ QCOMPARE(task.runCount.loadRelaxed(), 2);
QVERIFY(!task.thread->wait(100));
// thread should expire again
QVERIFY(task.thread->wait(10000));
@@ -382,7 +384,7 @@ void tst_QThreadPool::expiryTimeoutRace() // QTBUG-3786
QThread::msleep(50); // exactly the same as the expiry timeout
}
QVERIFY(task.semaphore.tryAcquire(numTasks, 10000));
- QCOMPARE(task.runCount.load(), numTasks);
+ QCOMPARE(task.runCount.loadRelaxed(), numTasks);
QVERIFY(threadPool.waitForDone(2000));
}
@@ -685,7 +687,7 @@ void tst_QThreadPool::reserveAndStart() // QTBUG-21051
QCOMPARE(threadpool->activeThreadCount(), 2);
task->waitForStarted.acquire();
task->waitBeforeDone.release();
- QTRY_COMPARE(task->count.load(), 1);
+ QTRY_COMPARE(task->count.loadRelaxed(), 1);
QTRY_COMPARE(threadpool->activeThreadCount(), 1);
// now the thread is waiting, but tryStart() will fail since activeThreadCount() >= maxThreadCount()
@@ -698,7 +700,7 @@ void tst_QThreadPool::reserveAndStart() // QTBUG-21051
QTRY_COMPARE(threadpool->activeThreadCount(), 2);
task->waitForStarted.acquire();
task->waitBeforeDone.release();
- QTRY_COMPARE(task->count.load(), 2);
+ QTRY_COMPARE(task->count.loadRelaxed(), 2);
QTRY_COMPARE(threadpool->activeThreadCount(), 1);
threadpool->releaseThread();
@@ -721,14 +723,14 @@ class CountingRunnable : public QRunnable
void tst_QThreadPool::start()
{
const int runs = 1000;
- count.store(0);
+ count.storeRelaxed(0);
{
QThreadPool threadPool;
for (int i = 0; i< runs; ++i) {
threadPool.start(new CountingRunnable());
}
}
- QCOMPARE(count.load(), runs);
+ QCOMPARE(count.loadRelaxed(), runs);
}
void tst_QThreadPool::tryStart()
@@ -747,7 +749,7 @@ void tst_QThreadPool::tryStart()
}
};
- count.store(0);
+ count.storeRelaxed(0);
WaitingTask task;
QThreadPool threadPool;
@@ -757,7 +759,7 @@ void tst_QThreadPool::tryStart()
QVERIFY(!threadPool.tryStart(&task));
task.semaphore.release(threadPool.maxThreadCount());
threadPool.waitForDone();
- QCOMPARE(count.load(), threadPool.maxThreadCount());
+ QCOMPARE(count.loadRelaxed(), threadPool.maxThreadCount());
}
QMutex mutex;
@@ -775,7 +777,7 @@ void tst_QThreadPool::tryStartPeakThreadCount()
{
QMutexLocker lock(&mutex);
activeThreads.ref();
- peakActiveThreads.store(qMax(peakActiveThreads.load(), activeThreads.load()));
+ peakActiveThreads.storeRelaxed(qMax(peakActiveThreads.loadRelaxed(), activeThreads.loadRelaxed()));
}
QTest::qWait(100);
@@ -793,13 +795,13 @@ void tst_QThreadPool::tryStartPeakThreadCount()
if (threadPool.tryStart(&task) == false)
QTest::qWait(10);
}
- QCOMPARE(peakActiveThreads.load(), QThread::idealThreadCount());
+ QCOMPARE(peakActiveThreads.loadRelaxed(), QThread::idealThreadCount());
for (int i = 0; i < 20; ++i) {
if (threadPool.tryStart(&task) == false)
QTest::qWait(10);
}
- QCOMPARE(peakActiveThreads.load(), QThread::idealThreadCount());
+ QCOMPARE(peakActiveThreads.loadRelaxed(), QThread::idealThreadCount());
}
void tst_QThreadPool::tryStartCount()
@@ -877,27 +879,27 @@ void tst_QThreadPool::priorityStart()
sem.release();
QVERIFY(threadPool.waitForDone());
- QCOMPARE(firstStarted.load(), expected);
+ QCOMPARE(firstStarted.loadRelaxed(), expected);
}
void tst_QThreadPool::waitForDone()
{
- QTime total, pass;
+ QElapsedTimer total, pass;
total.start();
QThreadPool threadPool;
while (total.elapsed() < 10000) {
int runs;
- count.store(runs = 0);
+ count.storeRelaxed(runs = 0);
pass.restart();
while (pass.elapsed() < 100) {
threadPool.start(new CountingRunnable());
++runs;
}
threadPool.waitForDone();
- QCOMPARE(count.load(), runs);
+ QCOMPARE(count.loadRelaxed(), runs);
- count.store(runs = 0);
+ count.storeRelaxed(runs = 0);
pass.restart();
while (pass.elapsed() < 100) {
threadPool.start(new CountingRunnable());
@@ -905,7 +907,7 @@ void tst_QThreadPool::waitForDone()
runs += 2;
}
threadPool.waitForDone();
- QCOMPARE(count.load(), runs);
+ QCOMPARE(count.loadRelaxed(), runs);
}
}
@@ -953,16 +955,17 @@ void tst_QThreadPool::clear()
QThreadPool threadPool;
threadPool.setMaxThreadCount(10);
int runs = 2 * threadPool.maxThreadCount();
- count.store(0);
+ count.storeRelaxed(0);
for (int i = 0; i <= runs; i++) {
threadPool.start(new BlockingRunnable(sem));
}
threadPool.clear();
sem.release(threadPool.maxThreadCount());
threadPool.waitForDone();
- QCOMPARE(count.load(), threadPool.maxThreadCount());
+ QCOMPARE(count.loadRelaxed(), threadPool.maxThreadCount());
}
+#if QT_DEPRECATED_SINCE(5, 9)
void tst_QThreadPool::cancel()
{
QSemaphore sem(0);
@@ -1008,7 +1011,7 @@ void tst_QThreadPool::cancel()
// and cause an early return:
const QSemaphoreReleaser semReleaser(sem, runs);
- count.store(0);
+ count.storeRelaxed(0);
QAtomicInt dtorCounter = 0;
QAtomicInt runCounter = 0;
for (int i = 0; i < runs; i++) {
@@ -1025,15 +1028,16 @@ void tst_QThreadPool::cancel()
}
runnables[0]->dummy = 0; //valgrind will catch this if cancel() is crazy enough to delete currently running jobs
runnables[runs-1]->dummy = 0;
- QCOMPARE(dtorCounter.load(), runs - threadPool.maxThreadCount() - 1);
+ QCOMPARE(dtorCounter.loadRelaxed(), runs - threadPool.maxThreadCount() - 1);
sem.release(threadPool.maxThreadCount());
threadPool.waitForDone();
- QCOMPARE(runCounter.load(), threadPool.maxThreadCount());
- QCOMPARE(count.load(), threadPool.maxThreadCount());
- QCOMPARE(dtorCounter.load(), runs - 2);
+ QCOMPARE(runCounter.loadRelaxed(), threadPool.maxThreadCount());
+ QCOMPARE(count.loadRelaxed(), threadPool.maxThreadCount());
+ QCOMPARE(dtorCounter.loadRelaxed(), runs - 2);
delete runnables[0]; //if the pool deletes them then we'll get double-free crash
delete runnables[runs-1];
}
+#endif
void tst_QThreadPool::tryTake()
{
@@ -1080,7 +1084,7 @@ void tst_QThreadPool::tryTake()
// and cause an early return:
const QSemaphoreReleaser semReleaser(sem, Runs);
- count.store(0);
+ count.storeRelaxed(0);
QAtomicInt dtorCounter = 0;
QAtomicInt runCounter = 0;
for (int i = 0; i < Runs; i++) {
@@ -1102,23 +1106,23 @@ void tst_QThreadPool::tryTake()
}
runnables[0]->dummy = 0; // valgrind will catch this if tryTake() is crazy enough to delete currently running jobs
- QCOMPARE(dtorCounter.load(), int(Runs - MaxThreadCount));
+ QCOMPARE(dtorCounter.loadRelaxed(), int(Runs - MaxThreadCount));
sem.release(MaxThreadCount);
threadPool.waitForDone();
- QCOMPARE(runCounter.load(), int(MaxThreadCount));
- QCOMPARE(count.load(), int(MaxThreadCount));
- QCOMPARE(dtorCounter.load(), int(Runs - 1));
+ QCOMPARE(runCounter.loadRelaxed(), int(MaxThreadCount));
+ QCOMPARE(count.loadRelaxed(), int(MaxThreadCount));
+ QCOMPARE(dtorCounter.loadRelaxed(), int(Runs - 1));
delete runnables[0]; // if the pool deletes them then we'll get double-free crash
}
void tst_QThreadPool::destroyingWaitsForTasksToFinish()
{
- QTime total, pass;
+ QElapsedTimer total, pass;
total.start();
while (total.elapsed() < 10000) {
int runs;
- count.store(runs = 0);
+ count.storeRelaxed(runs = 0);
{
QThreadPool threadPool;
pass.restart();
@@ -1127,9 +1131,9 @@ void tst_QThreadPool::destroyingWaitsForTasksToFinish()
++runs;
}
}
- QCOMPARE(count.load(), runs);
+ QCOMPARE(count.loadRelaxed(), runs);
- count.store(runs = 0);
+ count.storeRelaxed(runs = 0);
{
QThreadPool threadPool;
pass.restart();
@@ -1139,7 +1143,7 @@ void tst_QThreadPool::destroyingWaitsForTasksToFinish()
runs += 2;
}
}
- QCOMPARE(count.load(), runs);
+ QCOMPARE(count.loadRelaxed(), runs);
}
}
@@ -1204,7 +1208,7 @@ void tst_QThreadPool::stressTest()
}
};
- QTime total;
+ QElapsedTimer total;
total.start();
while (total.elapsed() < 30000) {
Task t;
@@ -1322,6 +1326,7 @@ void tst_QThreadPool::waitForDoneAfterTake()
QRunnable *runnable = createTask(emptyFunct);
manager.start(runnable);
QVERIFY(manager.tryTake(runnable));
+ delete runnable;
}
// Add another runnable that will not be removed
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index ef5d3452d5..3538d90803 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -359,7 +359,7 @@ void tst_QThreadStorage::leakInDestructor()
QVERIFY(tls.hasLocalData());
}
};
- int c = SPointer::count.load();
+ int c = SPointer::count.loadRelaxed();
QThreadStorage<ThreadStorageLocalDataTester *> tls;
@@ -383,7 +383,7 @@ void tst_QThreadStorage::leakInDestructor()
QVERIFY(t3.wait());
//check all the constructed things have been destructed
- QCOMPARE(int(SPointer::count.load()), c);
+ QCOMPARE(int(SPointer::count.loadRelaxed()), c);
}
class ThreadStorageResetLocalDataTester {
@@ -411,7 +411,7 @@ void tst_QThreadStorage::resetInDestructor()
QVERIFY(ThreadStorageResetLocalDataTesterTls()->hasLocalData());
}
};
- int c = SPointer::count.load();
+ int c = SPointer::count.loadRelaxed();
Thread t1;
Thread t2;
@@ -424,7 +424,7 @@ void tst_QThreadStorage::resetInDestructor()
QVERIFY(t3.wait());
//check all the constructed things have been destructed
- QCOMPARE(int(SPointer::count.load()), c);
+ QCOMPARE(int(SPointer::count.loadRelaxed()), c);
}
@@ -475,7 +475,7 @@ void tst_QThreadStorage::valueBased()
QThreadStorage<QString> tlsString;
QThreadStorage<int> tlsInt;
- int c = SPointer::count.load();
+ int c = SPointer::count.loadRelaxed();
Thread t1(tlsSPointer, tlsString, tlsInt);
Thread t2(tlsSPointer, tlsString, tlsInt);
@@ -495,7 +495,7 @@ void tst_QThreadStorage::valueBased()
QVERIFY(t2.wait());
QVERIFY(t3.wait());
- QCOMPARE(c, int(SPointer::count.load()));
+ QCOMPARE(c, int(SPointer::count.loadRelaxed()));
}
diff --git a/tests/auto/corelib/thread/qwaitcondition/BLACKLIST b/tests/auto/corelib/thread/qwaitcondition/BLACKLIST
deleted file mode 100644
index 3ff336576b..0000000000
--- a/tests/auto/corelib/thread/qwaitcondition/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[wakeOne]
-windows
diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index 126cb6b180..5363231895 100644
--- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -481,7 +481,7 @@ void tst_QWaitCondition::wakeOne()
}
mutex.unlock();
- QCOMPARE(count.load(), ThreadCount);
+ QCOMPARE(count.loadRelaxed(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; ++x) {
@@ -502,10 +502,10 @@ void tst_QWaitCondition::wakeOne()
}
QCOMPARE(exited, 1);
- QCOMPARE(count.load(), ThreadCount - (x + 1));
+ QCOMPARE(count.loadRelaxed(), ThreadCount - (x + 1));
}
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
@@ -530,7 +530,7 @@ void tst_QWaitCondition::wakeOne()
}
readWriteLock.unlock();
- QCOMPARE(count.load(), ThreadCount);
+ QCOMPARE(count.loadRelaxed(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; ++x) {
@@ -551,10 +551,10 @@ void tst_QWaitCondition::wakeOne()
}
QCOMPARE(exited, 1);
- QCOMPARE(count.load(), ThreadCount - (x + 1));
+ QCOMPARE(count.loadRelaxed(), ThreadCount - (x + 1));
}
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
}
// wake up threads, two at a time
@@ -585,7 +585,7 @@ void tst_QWaitCondition::wakeOne()
}
mutex.unlock();
- QCOMPARE(count.load(), ThreadCount);
+ QCOMPARE(count.loadRelaxed(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; x += 2) {
@@ -608,10 +608,10 @@ void tst_QWaitCondition::wakeOne()
}
QCOMPARE(exited, 2);
- QCOMPARE(count.load(), ThreadCount - (x + 2));
+ QCOMPARE(count.loadRelaxed(), ThreadCount - (x + 2));
}
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
@@ -636,7 +636,7 @@ void tst_QWaitCondition::wakeOne()
}
readWriteLock.unlock();
- QCOMPARE(count.load(), ThreadCount);
+ QCOMPARE(count.loadRelaxed(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; x += 2) {
@@ -659,10 +659,10 @@ void tst_QWaitCondition::wakeOne()
}
QCOMPARE(exited, 2);
- QCOMPARE(count.load(), ThreadCount - (x + 2));
+ QCOMPARE(count.loadRelaxed(), ThreadCount - (x + 2));
}
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
}
}
@@ -692,7 +692,7 @@ void tst_QWaitCondition::wakeAll()
}
mutex.unlock();
- QCOMPARE(count.load(), ThreadCount);
+ QCOMPARE(count.loadRelaxed(), ThreadCount);
// wake up all threads at once
mutex.lock();
@@ -707,7 +707,7 @@ void tst_QWaitCondition::wakeAll()
}
QCOMPARE(exited, ThreadCount);
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
@@ -728,7 +728,7 @@ void tst_QWaitCondition::wakeAll()
}
readWriteLock.unlock();
- QCOMPARE(count.load(), ThreadCount);
+ QCOMPARE(count.loadRelaxed(), ThreadCount);
// wake up all threads at once
readWriteLock.lockForWrite();
@@ -743,7 +743,7 @@ void tst_QWaitCondition::wakeAll()
}
QCOMPARE(exited, ThreadCount);
- QCOMPARE(count.load(), 0);
+ QCOMPARE(count.loadRelaxed(), 0);
}
}
diff --git a/tests/auto/corelib/time/qcalendar/qcalendar.pro b/tests/auto/corelib/time/qcalendar/qcalendar.pro
new file mode 100644
index 0000000000..94e8fe8606
--- /dev/null
+++ b/tests/auto/corelib/time/qcalendar/qcalendar.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase
+TARGET = tst_qcalendar
+QT = core testlib
+SOURCES = \
+ tst_qcalendar.cpp
diff --git a/tests/auto/corelib/time/qcalendar/tst_qcalendar.cpp b/tests/auto/corelib/time/qcalendar/tst_qcalendar.cpp
new file mode 100644
index 0000000000..9b41014394
--- /dev/null
+++ b/tests/auto/corelib/time/qcalendar/tst_qcalendar.cpp
@@ -0,0 +1,236 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <QCalendar>
+Q_DECLARE_METATYPE(QCalendar::System)
+
+class tst_QCalendar : public QObject
+{
+ Q_OBJECT
+private:
+ void checkYear(const QCalendar &cal, int year, bool normal=false);
+
+private slots:
+ void basic_data();
+ void basic();
+ void nameCase();
+ void specific_data();
+ void specific();
+ void daily_data() { basic_data(); }
+ void daily();
+};
+
+// Support for basic():
+void tst_QCalendar::checkYear(const QCalendar &cal, int year, bool normal)
+{
+ const int moons = cal.monthsInYear(year);
+ // Months are numbered from 1 to moons:
+ QVERIFY(moons > 0);
+ QVERIFY(!cal.isDateValid(year, moons + 1, 1));
+ QVERIFY(!cal.isDateValid(year, 0, 1));
+ QVERIFY(moons <= cal.maximumMonthsInYear());
+
+ const int days = cal.daysInYear(year);
+ QVERIFY(days > 0);
+
+ int sum = 0;
+ const int longest = cal.maximumDaysInMonth();
+ for (int i = moons; i > 0; i--) {
+ const int last = cal.daysInMonth(i, year);
+ sum += last;
+ // Valid month has some days and no more than max:
+ QVERIFY(last > 0);
+ QVERIFY(last <= longest);
+ // Days are numbered from 1 to last:
+ QVERIFY(cal.isDateValid(year, i, 1));
+ QVERIFY(cal.isDateValid(year, i, last));
+ QVERIFY(!cal.isDateValid(year, i, 0));
+ QVERIFY(!cal.isDateValid(year, i, last + 1));
+ if (normal) // Unspecified year gets same daysInMonth():
+ QCOMPARE(cal.daysInMonth(i), last);
+ }
+ // Months add up to the whole year:
+ QCOMPARE(sum, days);
+}
+
+#define CHECKYEAR(cal, year) checkYear(cal, year); \
+ if (QTest::currentTestFailed()) \
+ return
+
+#define NORMALYEAR(cal, year) checkYear(cal, year, true); \
+ if (QTest::currentTestFailed()) \
+ return
+
+void tst_QCalendar::basic_data()
+{
+ QTest::addColumn<QCalendar::System>("system");
+
+ QMetaEnum e = QCalendar::staticMetaObject.enumerator(0);
+ Q_ASSERT(qstrcmp(e.name(), "System") == 0);
+
+ for (int i = 0; i <= int(QCalendar::System::Last); ++i) {
+ // There may be gaps in the enum's numbering; and Last is a duplicate:
+ if (e.value(i) != -1 && qstrcmp(e.key(i), "Last"))
+ QTest::newRow(e.key(i)) << QCalendar::System(e.value(i));
+ }
+}
+
+void tst_QCalendar::basic()
+{
+ QFETCH(QCalendar::System, system);
+ QCalendar cal(system);
+ QVERIFY(cal.isValid());
+ QCOMPARE(QCalendar(cal.name()).isGregorian(), cal.isGregorian());
+ QCOMPARE(QCalendar(cal.name()).name(), cal.name());
+
+ if (cal.hasYearZero()) {
+ CHECKYEAR(cal, 0);
+ } else {
+ QCOMPARE(cal.monthsInYear(0), 0);
+ QCOMPARE(cal.daysInYear(0), 0);
+ QVERIFY(!cal.isDateValid(0, 1, 1));
+ }
+
+ if (cal.isProleptic()) {
+ CHECKYEAR(cal, -1);
+ } else {
+ QCOMPARE(cal.monthsInYear(-1), 0);
+ QCOMPARE(cal.daysInYear(-1), 0);
+ QVERIFY(!cal.isDateValid(-1, 1, 1));
+ }
+
+ // Look for a leap year in the last decade.
+ int year = QDate::currentDate().year(cal);
+ for (int i = 10; i > 0 && !cal.isLeapYear(year); --i)
+ --year;
+ if (cal.isLeapYear(year)) {
+ // ... and a non-leap year within a decade before it.
+ int leap = year--;
+ for (int i = 10; i > 0 && cal.isLeapYear(year); --i)
+ year--;
+ if (!cal.isLeapYear(year))
+ QVERIFY(cal.daysInYear(year) < cal.daysInYear(leap));
+
+ CHECKYEAR(cal, leap);
+ }
+ // Either year is non-leap or we have a decade of leap years together;
+ // expect daysInMonth() to treat year the same as unspecified.
+ NORMALYEAR(cal, year);
+}
+
+void tst_QCalendar::nameCase()
+{
+ QVERIFY(QCalendar::availableCalendars().contains(QStringLiteral("Gregorian")));
+}
+
+void tst_QCalendar::specific_data()
+{
+ QTest::addColumn<QCalendar::System>("system");
+ // Date in that system:
+ QTest::addColumn<int>("sysyear");
+ QTest::addColumn<int>("sysmonth");
+ QTest::addColumn<int>("sysday");
+ // Gregorian equivalent:
+ QTest::addColumn<int>("gregyear");
+ QTest::addColumn<int>("gregmonth");
+ QTest::addColumn<int>("gregday");
+
+#define ADDROW(cal, year, month, day, gy, gm, gd) \
+ QTest::newRow(#cal) << QCalendar::System::cal << year << month << day << gy << gm << gd
+
+ ADDROW(Gregorian, 1970, 1, 1, 1970, 1, 1);
+
+ // One known specific date, for each calendar
+#ifndef QT_BOOTSTRAPPED
+ // Julian 1582-10-4 was followed by Gregorian 1582-10-15
+ ADDROW(Julian, 1582, 10, 4, 1582, 10, 14);
+ // Milankovic matches Gregorian for a few centuries
+ ADDROW(Milankovic, 1923, 3, 20, 1923, 3, 20);
+#endif
+
+#if QT_CONFIG(jalalicalendar)
+ // Jalali year 1355 started on Gregorian 1976-3-21:
+ ADDROW(Jalali, 1355, 1, 1, 1976, 3, 21);
+#endif // jalali
+#if QT_CONFIG(islamiccivilcalendar)
+ // TODO: confirm this is correct
+ ADDROW(IslamicCivil, 1, 1, 1, 622, 7, 19);
+#endif
+
+#undef ADDROW
+}
+
+void tst_QCalendar::specific()
+{
+ QFETCH(QCalendar::System, system);
+ QFETCH(int, sysyear);
+ QFETCH(int, sysmonth);
+ QFETCH(int, sysday);
+ QFETCH(int, gregyear);
+ QFETCH(int, gregmonth);
+ QFETCH(int, gregday);
+
+ const QCalendar cal(system);
+ const QDate date(sysyear, sysmonth, sysday, cal), gregory(gregyear, gregmonth, gregday);
+ QCOMPARE(date, gregory);
+ QCOMPARE(gregory.year(cal), sysyear);
+ QCOMPARE(gregory.month(cal), sysmonth);
+ QCOMPARE(gregory.day(cal), sysday);
+ QCOMPARE(date.year(), gregyear);
+ QCOMPARE(date.month(), gregmonth);
+ QCOMPARE(date.day(), gregday);
+}
+
+void tst_QCalendar::daily()
+{
+ QFETCH(QCalendar::System, system);
+ QCalendar calendar(system);
+ const quint64 startJDN = 0, endJDN = 2488070;
+ // Iterate from -4713-01-01 (Julian calendar) to 2100-01-01
+ for (quint64 expect = startJDN; expect <= endJDN; ++expect)
+ {
+ QDate date = QDate::fromJulianDay(expect);
+ auto parts = calendar.partsFromDate(date);
+ if (!parts.isValid())
+ continue;
+
+ const int year = date.year(calendar);
+ QCOMPARE(year, parts.year);
+ const int month = date.month(calendar);
+ QCOMPARE(month, parts.month);
+ const int day = date.day(calendar);
+ QCOMPARE(day, parts.day);
+ const quint64 actual = QDate(year, month, day, calendar).toJulianDay();
+ QCOMPARE(actual, expect);
+ }
+}
+
+QTEST_APPLESS_MAIN(tst_QCalendar)
+#include "tst_qcalendar.moc"
diff --git a/tests/auto/corelib/tools/qdate/.gitignore b/tests/auto/corelib/time/qdate/.gitignore
index 70945d4a86..70945d4a86 100644
--- a/tests/auto/corelib/tools/qdate/.gitignore
+++ b/tests/auto/corelib/time/qdate/.gitignore
diff --git a/tests/auto/corelib/tools/qdate/qdate.pro b/tests/auto/corelib/time/qdate/qdate.pro
index dd7c6cb888..925c3b4c78 100644
--- a/tests/auto/corelib/tools/qdate/qdate.pro
+++ b/tests/auto/corelib/time/qdate/qdate.pro
@@ -1,4 +1,4 @@
CONFIG += testcase
TARGET = tst_qdate
-QT = core testlib
+QT = core-private testlib
SOURCES = tst_qdate.cpp
diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/time/qdate/tst_qdate.cpp
index ce1e5730dd..73384c35f4 100644
--- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp
+++ b/tests/auto/corelib/time/qdate/tst_qdate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -27,6 +27,7 @@
**
****************************************************************************/
+#include <private/qglobal_p.h> // for the icu feature test
#include <QtTest/QtTest>
#include <qdatetime.h>
#include <qlocale.h>
@@ -54,6 +55,13 @@ private slots:
void weekNumber_invalid();
void weekNumber_data();
void weekNumber();
+#if QT_CONFIG(timezone)
+ void startOfDay_endOfDay_data();
+ void startOfDay_endOfDay();
+#endif
+ void startOfDay_endOfDay_fixed_data();
+ void startOfDay_endOfDay_fixed();
+ void startOfDay_endOfDay_bounds();
void julianDaysLimits();
void addDays_data();
void addDays();
@@ -83,6 +91,7 @@ private slots:
void negativeYear() const;
void printNegativeYear() const;
void roundtripGermanLocale() const;
+#if QT_CONFIG(textdate) && QT_DEPRECATED_SINCE(5, 10)
void shortDayName() const;
void standaloneShortDayName() const;
void longDayName() const;
@@ -91,6 +100,7 @@ private slots:
void standaloneShortMonthName() const;
void longMonthName() const;
void standaloneLongMonthName() const;
+#endif // textdate
void roundtrip() const;
void qdebug() const;
private:
@@ -456,6 +466,164 @@ void tst_QDate::weekNumber_invalid()
QCOMPARE( dt.weekNumber( &yearNumber ), 0 );
}
+#if QT_CONFIG(timezone)
+void tst_QDate::startOfDay_endOfDay_data()
+{
+ QTest::addColumn<QDate>("date"); // Typically a spring-forward.
+ // A zone in which that date's start and end are worth checking:
+ QTest::addColumn<QByteArray>("zoneName");
+ // The start and end times in that zone:
+ QTest::addColumn<QTime>("start");
+ QTest::addColumn<QTime>("end");
+
+ const QTime initial(0, 0), final(23, 59, 59, 999), invalid(QDateTime().time());
+
+ QTest::newRow("epoch")
+ << QDate(1970, 1, 1) << QByteArray("UTC")
+ << initial << final;
+ QTest::newRow("Brazil")
+ << QDate(2008, 10, 19) << QByteArray("America/Sao_Paulo")
+ << QTime(1, 0) << final;
+#if QT_CONFIG(icu) || !defined(Q_OS_WIN) // MS's TZ APIs lack data
+ QTest::newRow("Sofia")
+ << QDate(1994, 3, 27) << QByteArray("Europe/Sofia")
+ << QTime(1, 0) << final;
+#endif
+ QTest::newRow("Kiritimati")
+ << QDate(1994, 12, 31) << QByteArray("Pacific/Kiritimati")
+ << invalid << invalid;
+ QTest::newRow("Samoa")
+ << QDate(2011, 12, 30) << QByteArray("Pacific/Apia")
+ << invalid << invalid;
+ // TODO: find other zones with transitions at/crossing midnight.
+}
+
+void tst_QDate::startOfDay_endOfDay()
+{
+ QFETCH(QDate, date);
+ QFETCH(QByteArray, zoneName);
+ QFETCH(QTime, start);
+ QFETCH(QTime, end);
+ const QTimeZone zone(zoneName);
+ const bool isSystem = QTimeZone::systemTimeZone() == zone;
+ QDateTime front(date.startOfDay(zone)), back(date.endOfDay(zone));
+ if (end.isValid())
+ QCOMPARE(date.addDays(1).startOfDay(zone).addMSecs(-1), back);
+ if (start.isValid())
+ QCOMPARE(date.addDays(-1).endOfDay(zone).addMSecs(1), front);
+ do { // Avoids duplicating these tests for local-time when it *is* zone:
+ if (start.isValid()) {
+ QCOMPARE(front.date(), date);
+ QCOMPARE(front.time(), start);
+ }
+ if (end.isValid()) {
+ QCOMPARE(back.date(), date);
+ QCOMPARE(back.time(), end);
+ }
+ if (front.timeSpec() == Qt::LocalTime)
+ break;
+ front = date.startOfDay(Qt::LocalTime);
+ back = date.endOfDay(Qt::LocalTime);
+ } while (isSystem);
+ if (end.isValid())
+ QCOMPARE(date.addDays(1).startOfDay(Qt::LocalTime).addMSecs(-1), back);
+ if (start.isValid())
+ QCOMPARE(date.addDays(-1).endOfDay(Qt::LocalTime).addMSecs(1), front);
+ if (!isSystem) {
+ // These might fail if system zone coincides with zone; but only if it
+ // did something similarly unusual on the date picked for this test.
+ if (start.isValid()) {
+ QCOMPARE(front.date(), date);
+ QCOMPARE(front.time(), QTime(0, 0));
+ }
+ if (end.isValid()) {
+ QCOMPARE(back.date(), date);
+ QCOMPARE(back.time(), QTime(23, 59, 59, 999));
+ }
+ }
+}
+#endif // timezone
+
+void tst_QDate::startOfDay_endOfDay_fixed_data()
+{
+ const qint64 kilo(1000);
+ using Bounds = std::numeric_limits<qint64>;
+ const QDateTime
+ first(QDateTime::fromMSecsSinceEpoch(Bounds::min() + 1, Qt::UTC)),
+ start32sign(QDateTime::fromMSecsSinceEpoch(-0x80000000L * kilo, Qt::UTC)),
+ end32sign(QDateTime::fromMSecsSinceEpoch(0x80000000L * kilo, Qt::UTC)),
+ end32unsign(QDateTime::fromMSecsSinceEpoch(0x100000000L * kilo, Qt::UTC)),
+ last(QDateTime::fromMSecsSinceEpoch(Bounds::max(), Qt::UTC));
+
+ const struct {
+ const char *name;
+ QDate date;
+ } data[] = {
+ { "epoch", QDate(1970, 1, 1) },
+ { "y2k-leap-day", QDate(2000, 2, 29) },
+ // Just outside the start and end of 32-bit time_t:
+ { "pre-sign32", QDate(start32sign.date().year(), 1, 1) },
+ { "post-sign32", QDate(end32sign.date().year(), 12, 31) },
+ { "post-uint32", QDate(end32unsign.date().year(), 12, 31) },
+ // Just inside the start and end of QDateTime's range:
+ { "first-full", first.date().addDays(1) },
+ { "last-full", last.date().addDays(-1) }
+ };
+
+ QTest::addColumn<QDate>("date");
+ for (const auto &r : data)
+ QTest::newRow(r.name) << r.date;
+}
+
+void tst_QDate::startOfDay_endOfDay_fixed()
+{
+ const QTime early(0, 0), late(23, 59, 59, 999);
+ QFETCH(QDate, date);
+
+ QDateTime start(date.startOfDay(Qt::UTC));
+ QDateTime end(date.endOfDay(Qt::UTC));
+ QCOMPARE(start.date(), date);
+ QCOMPARE(end.date(), date);
+ QCOMPARE(start.time(), early);
+ QCOMPARE(end.time(), late);
+ QCOMPARE(date.addDays(1).startOfDay(Qt::UTC).addMSecs(-1), end);
+ QCOMPARE(date.addDays(-1).endOfDay(Qt::UTC).addMSecs(1), start);
+ for (int offset = -60 * 16; offset <= 60 * 16; offset += 65) {
+ start = date.startOfDay(Qt::OffsetFromUTC, offset);
+ end = date.endOfDay(Qt::OffsetFromUTC, offset);
+ QCOMPARE(start.date(), date);
+ QCOMPARE(end.date(), date);
+ QCOMPARE(start.time(), early);
+ QCOMPARE(end.time(), late);
+ QCOMPARE(date.addDays(1).startOfDay(Qt::OffsetFromUTC, offset).addMSecs(-1), end);
+ QCOMPARE(date.addDays(-1).endOfDay(Qt::OffsetFromUTC, offset).addMSecs(1), start);
+ }
+}
+
+void tst_QDate::startOfDay_endOfDay_bounds()
+{
+ // Check the days in which QDateTime's range starts and ends:
+ using Bounds = std::numeric_limits<qint64>;
+ const QDateTime
+ first(QDateTime::fromMSecsSinceEpoch(Bounds::min(), Qt::UTC)),
+ last(QDateTime::fromMSecsSinceEpoch(Bounds::max(), Qt::UTC)),
+ epoch(QDateTime::fromMSecsSinceEpoch(0, Qt::UTC));
+ // First, check these *are* the start and end of QDateTime's range:
+ QVERIFY(first.isValid());
+ QVERIFY(last.isValid());
+ QVERIFY(first < epoch);
+ QVERIFY(last > epoch);
+ // QDateTime's addMSecs doesn't check against {und,ov}erflow ...
+ QVERIFY(!first.addMSecs(-1).isValid() || first.addMSecs(-1) > first);
+ QVERIFY(!last.addMSecs(1).isValid() || last.addMSecs(1) < last);
+
+ // Now test start/end methods with them:
+ QCOMPARE(first.date().endOfDay(Qt::UTC).time(), QTime(23, 59, 59, 999));
+ QCOMPARE(last.date().startOfDay(Qt::UTC).time(), QTime(0, 0));
+ QVERIFY(!first.date().startOfDay(Qt::UTC).isValid());
+ QVERIFY(!last.date().endOfDay(Qt::UTC).isValid());
+}
+
void tst_QDate::julianDaysLimits()
{
qint64 min = std::numeric_limits<qint64>::min();
@@ -1038,18 +1206,18 @@ void tst_QDate::fromStringFormat_data()
// Undo this (inline the C-locale versions) for ### Qt 6
// Get localized names:
- QString january = QDate::longMonthName(1);
- QString february = QDate::longMonthName(2);
- QString march = QDate::longMonthName(3);
- QString august = QDate::longMonthName(8);
- QString mon = QDate::shortDayName(1);
- QString monday = QDate::longDayName(1);
- QString tuesday = QDate::longDayName(2);
- QString wednesday = QDate::longDayName(3);
- QString thursday = QDate::longDayName(4);
- QString friday = QDate::longDayName(5);
- QString saturday = QDate::longDayName(6);
- QString sunday = QDate::longDayName(7);
+ QString january = QLocale::system().monthName(1, QLocale::LongFormat);
+ QString february = QLocale::system().monthName(2, QLocale::LongFormat);
+ QString march = QLocale::system().monthName(3, QLocale::LongFormat);
+ QString august = QLocale::system().monthName(8, QLocale::LongFormat);
+ QString mon = QLocale::system().dayName(1, QLocale::ShortFormat);
+ QString monday = QLocale::system().dayName(1, QLocale::LongFormat);
+ QString tuesday = QLocale::system().dayName(2, QLocale::LongFormat);
+ QString wednesday = QLocale::system().dayName(3, QLocale::LongFormat);
+ QString thursday = QLocale::system().dayName(4, QLocale::LongFormat);
+ QString friday = QLocale::system().dayName(5, QLocale::LongFormat);
+ QString saturday = QLocale::system().dayName(6, QLocale::LongFormat);
+ QString sunday = QLocale::system().dayName(7, QLocale::LongFormat);
QTest::newRow("data0") << QString("") << QString("") << defDate();
QTest::newRow("data1") << QString(" ") << QString("") << invalidDate();
@@ -1305,6 +1473,10 @@ void tst_QDate::roundtripGermanLocale() const
theDateTime.fromString(theDateTime.toString(Qt::TextDate), Qt::TextDate);
}
+#if QT_CONFIG(textdate) && QT_DEPRECATED_SINCE(5, 10)
+QT_WARNING_PUSH // the methods tested here are all deprecated
+QT_WARNING_DISABLE_GCC("-Wdeprecated-declarations")
+
void tst_QDate::shortDayName() const
{
QCOMPARE(QDate::shortDayName(0), QString());
@@ -1432,6 +1604,8 @@ void tst_QDate::standaloneLongMonthName() const
QCOMPARE(QDate::longMonthName(i, QDate::StandaloneFormat), locale.standaloneMonthName(i, QLocale::LongFormat));
}
}
+QT_WARNING_POP
+#endif // textdate
void tst_QDate::roundtrip() const
{
diff --git a/tests/auto/corelib/tools/qdatetime/.gitignore b/tests/auto/corelib/time/qdatetime/.gitignore
index 7784f3a3eb..7784f3a3eb 100644
--- a/tests/auto/corelib/tools/qdatetime/.gitignore
+++ b/tests/auto/corelib/time/qdatetime/.gitignore
diff --git a/tests/auto/corelib/tools/qdatetime/qdatetime.pro b/tests/auto/corelib/time/qdatetime/qdatetime.pro
index 742eb47075..742eb47075 100644
--- a/tests/auto/corelib/tools/qdatetime/qdatetime.pro
+++ b/tests/auto/corelib/time/qdatetime/qdatetime.pro
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
index 544eadd3a2..216ae1f79e 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
@@ -61,6 +61,10 @@ private slots:
void timeSpec();
void toSecsSinceEpoch_data();
void toSecsSinceEpoch();
+#if QT_DEPRECATED_SINCE(5, 8)
+ void toTime_t_data();
+ void toTime_t();
+#endif
void daylightSavingsTimeChange_data();
void daylightSavingsTimeChange();
void springForward_data();
@@ -147,6 +151,7 @@ private slots:
void systemTimeZoneChange() const;
void invalid() const;
+ void range() const;
void macTypes();
@@ -355,6 +360,7 @@ void tst_QDateTime::ctor()
void tst_QDateTime::operator_eq()
{
+ QVERIFY(QDateTime() != QDateTime(QDate(1970, 1, 1), QTime(0, 0))); // QTBUG-79006
QDateTime dt1(QDate(2004, 3, 24), QTime(23, 45, 57), Qt::UTC);
QDateTime dt2(QDate(2005, 3, 11), QTime(), Qt::UTC);
dt2 = dt1;
@@ -1005,7 +1011,6 @@ void tst_QDateTime::toString_enumformat()
{
QDateTime dt1(QDate(1995, 5, 20), QTime(12, 34, 56));
-
QString str1 = dt1.toString(Qt::TextDate);
QVERIFY(!str1.isEmpty()); // It's locale dependent everywhere
@@ -1671,6 +1676,36 @@ void tst_QDateTime::currentDateTimeUtc2()
void tst_QDateTime::toSecsSinceEpoch_data()
{
QTest::addColumn<QString>("dateTimeStr");
+ QTest::addColumn<bool>("valid");
+
+ QTest::newRow( "data1" ) << str( 1800, 1, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data2" ) << str( 1969, 1, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data3" ) << str( 2002, 1, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data4" ) << str( 2002, 6, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data5" ) << QString("INVALID") << false;
+ QTest::newRow( "data6" ) << str( 2038, 1, 1, 12, 0, 0 ) << true;
+ QTest::newRow( "data7" ) << str( 2063, 4, 5, 12, 0, 0 ) << true; // the day of First Contact
+ QTest::newRow( "data8" ) << str( 2107, 1, 1, 12, 0, 0 ) << true;
+}
+
+void tst_QDateTime::toSecsSinceEpoch()
+{
+ QFETCH(const QString, dateTimeStr);
+ const QDateTime datetime = dt(dateTimeStr);
+ QFETCH(const bool, valid);
+ QCOMPARE(datetime.isValid(), valid);
+
+ if (valid) {
+ const qint64 asSecsSinceEpoch = datetime.toSecsSinceEpoch();
+ QCOMPARE(asSecsSinceEpoch, datetime.toMSecsSinceEpoch() / 1000);
+ QCOMPARE(QDateTime::fromSecsSinceEpoch(asSecsSinceEpoch), datetime);
+ }
+}
+
+#if QT_DEPRECATED_SINCE(5, 8)
+void tst_QDateTime::toTime_t_data()
+{
+ QTest::addColumn<QString>("dateTimeStr");
QTest::addColumn<bool>("res");
QTest::newRow( "data1" ) << str( 1800, 1, 1, 12, 0, 0 ) << false;
@@ -1681,31 +1716,24 @@ void tst_QDateTime::toSecsSinceEpoch_data()
QTest::newRow( "data6" ) << str( 2038, 1, 1, 12, 0, 0 ) << true;
QTest::newRow( "data7" ) << str( 2063, 4, 5, 12, 0, 0 ) << true; // the day of First Contact
QTest::newRow( "data8" ) << str( 2107, 1, 1, 12, 0, 0 )
- << bool( sizeof(uint) > 32 && sizeof(time_t) > 32 );
+ << bool( sizeof(uint) > 32 && sizeof(time_t) > 32 );
}
-void tst_QDateTime::toSecsSinceEpoch()
+void tst_QDateTime::toTime_t()
{
QFETCH( QString, dateTimeStr );
QDateTime datetime = dt( dateTimeStr );
- qint64 asSecsSinceEpoch = datetime.toSecsSinceEpoch();
uint asTime_t = datetime.toTime_t();
QFETCH( bool, res );
if (res) {
- QVERIFY( asTime_t != (uint)-1 );
+ QVERIFY(asTime_t != uint(-1));
+ QCOMPARE(QDateTime::fromTime_t(asTime_t), datetime);
} else {
- QVERIFY( asTime_t == (uint)-1 );
+ QCOMPARE(asTime_t, uint(-1));
}
- QCOMPARE(asSecsSinceEpoch, datetime.toMSecsSinceEpoch() / 1000);
-
- if ( asTime_t != (uint) -1 ) {
- QDateTime datetime2 = QDateTime::fromTime_t( asTime_t );
- QCOMPARE(datetime, datetime2);
- }
- QDateTime datetime2 = QDateTime::fromSecsSinceEpoch(asSecsSinceEpoch);
- QCOMPARE(datetime, datetime2);
}
+#endif
void tst_QDateTime::daylightSavingsTimeChange_data()
{
@@ -1899,8 +1927,8 @@ void tst_QDateTime::operator_eqeq_data()
QDateTime dateTime1(QDate(2012, 6, 20), QTime(14, 33, 2, 500));
QDateTime dateTime1a = dateTime1.addMSecs(1);
- QDateTime dateTime2(QDate(2012, 20, 6), QTime(14, 33, 2, 500));
- QDateTime dateTime2a = dateTime2.addMSecs(-1);
+ QDateTime dateTime2(QDate(2012, 20, 6), QTime(14, 33, 2, 500)); // Invalid
+ QDateTime dateTime2a = dateTime2.addMSecs(-1); // Still invalid
QDateTime dateTime3(QDate(1970, 1, 1), QTime(0, 0, 0, 0), Qt::UTC); // UTC epoch
QDateTime dateTime3a = dateTime3.addDays(1);
QDateTime dateTime3b = dateTime3.addDays(-1);
@@ -1916,7 +1944,7 @@ void tst_QDateTime::operator_eqeq_data()
QTest::newRow("data2") << dateTime1a << dateTime1a << true << false;
QTest::newRow("data3") << dateTime1 << dateTime2 << false << false;
QTest::newRow("data4") << dateTime1 << dateTime1a << false << false;
- QTest::newRow("data5") << dateTime2 << dateTime2a << false << false;
+ QTest::newRow("data5") << dateTime2 << dateTime2a << true << false;
QTest::newRow("data6") << dateTime2 << dateTime3 << false << false;
QTest::newRow("data7") << dateTime3 << dateTime3a << false << false;
QTest::newRow("data8") << dateTime3 << dateTime3b << false << false;
@@ -2779,9 +2807,9 @@ void tst_QDateTime::getDate()
int y = -33, m = -44, d = -55;
QDate date;
date.getDate(&y, &m, &d);
- QVERIFY(date.year() == y);
- QVERIFY(date.month() == m);
- QVERIFY(date.day() == d);
+ QCOMPARE(date.year(), y);
+ QCOMPARE(date.month(), m);
+ QCOMPARE(date.day(), d);
date.getDate(0, 0, 0);
}
@@ -2793,9 +2821,9 @@ void tst_QDateTime::getDate()
date.getDate(&y, 0, 0);
date.getDate(0, 0, &d);
- QVERIFY(date.year() == y);
- QVERIFY(date.month() == m);
- QVERIFY(date.day() == d);
+ QCOMPARE(date.year(), y);
+ QCOMPARE(date.month(), m);
+ QCOMPARE(date.day(), d);
}
}
@@ -3322,6 +3350,14 @@ void tst_QDateTime::timeZones() const
QCOMPARE(dt3.timeSpec(), dt1.timeSpec());
QCOMPARE(dt3.timeZone(), dt1.timeZone());
+ // The start of year 1 should be *describable* in any zone (QTBUG-78051)
+ dt3 = QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), ausTz);
+ QVERIFY(dt3.isValid());
+ // Likewise the end of year -1 (a.k.a. 1 BCE).
+ dt3 = dt3.addMSecs(-1);
+ QVERIFY(dt3.isValid());
+ QCOMPARE(dt3, QDateTime(QDate(-1, 12, 31), QTime(23, 59, 59, 999), ausTz));
+
// Check datastream serialises the time zone
QByteArray tmp;
{
@@ -3476,6 +3512,15 @@ void tst_QDateTime::invalid() const
QCOMPARE(tzDate.timeSpec(), Qt::TimeZone);
}
+void tst_QDateTime::range() const
+{
+ using Bounds = std::numeric_limits<qint64>;
+ QCOMPARE(QDateTime::fromMSecsSinceEpoch(Bounds::min() + 1, Qt::UTC).date().year(),
+ int(QDateTime::YearRange::First));
+ QCOMPARE(QDateTime::fromMSecsSinceEpoch(Bounds::max() - 1, Qt::UTC).date().year(),
+ int(QDateTime::YearRange::Last));
+}
+
void tst_QDateTime::macTypes()
{
#ifndef Q_OS_MAC
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm b/tests/auto/corelib/time/qdatetime/tst_qdatetime_mac.mm
index f73c7b9d5d..f73c7b9d5d 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
+++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime_mac.mm
diff --git a/tests/auto/corelib/tools/qtime/.gitignore b/tests/auto/corelib/time/qtime/.gitignore
index 26a4c65cc2..26a4c65cc2 100644
--- a/tests/auto/corelib/tools/qtime/.gitignore
+++ b/tests/auto/corelib/time/qtime/.gitignore
diff --git a/tests/auto/corelib/tools/qtime/qtime.pro b/tests/auto/corelib/time/qtime/qtime.pro
index 0973b7a9ef..0973b7a9ef 100644
--- a/tests/auto/corelib/tools/qtime/qtime.pro
+++ b/tests/auto/corelib/time/qtime/qtime.pro
diff --git a/tests/auto/corelib/tools/qtime/tst_qtime.cpp b/tests/auto/corelib/time/qtime/tst_qtime.cpp
index 3e5724213e..3403c5bf7f 100644
--- a/tests/auto/corelib/tools/qtime/tst_qtime.cpp
+++ b/tests/auto/corelib/time/qtime/tst_qtime.cpp
@@ -95,8 +95,9 @@ void tst_QTime::addSecs_data()
QTest::newRow("Data0") << QTime(0,0,0) << 200 << QTime(0,3,20);
QTest::newRow("Data1") << QTime(0,0,0) << 20 << QTime(0,0,20);
- QTest::newRow("overflow") << QTime(0,0,0) << (INT_MAX / 1000 + 1)
- << QTime(0,0,0).addSecs((INT_MAX / 1000 + 1) % 86400);
+ QTest::newRow("overflow")
+ << QTime(0,0,0) << (INT_MAX / 1000 + 1)
+ << QTime::fromMSecsSinceStartOfDay(((INT_MAX / 1000 + 1) % 86400) * 1000);
}
void tst_QTime::addSecs()
diff --git a/tests/auto/corelib/tools/qtimezone/BLACKLIST b/tests/auto/corelib/time/qtimezone/BLACKLIST
index 840c3b1181..840c3b1181 100644
--- a/tests/auto/corelib/tools/qtimezone/BLACKLIST
+++ b/tests/auto/corelib/time/qtimezone/BLACKLIST
diff --git a/tests/auto/corelib/tools/qtimezone/qtimezone.pro b/tests/auto/corelib/time/qtimezone/qtimezone.pro
index 5ec8d008e7..5ec8d008e7 100644
--- a/tests/auto/corelib/tools/qtimezone/qtimezone.pro
+++ b/tests/auto/corelib/time/qtimezone/qtimezone.pro
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
index bb6c48a2ed..9904719f7c 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
@@ -480,11 +480,10 @@ void tst_QTimeZone::transitionEachZone_data()
{ 1288488600, -4, 8, 2010 } // 2010-10-31 01:30 UTC; Europe, Russia
};
- QString name;
const auto zones = QTimeZone::availableTimeZoneIds();
for (int k = sizeof(table) / sizeof(table[0]); k-- > 0; ) {
for (const QByteArray &zone : zones) {
- name.sprintf("%s@%d", zone.constData(), table[k].year);
+ const QString name = QString::asprintf("%s@%d", zone.constData(), table[k].year);
QTest::newRow(name.toUtf8().constData())
<< zone
<< table[k].baseSecs
@@ -916,6 +915,14 @@ void tst_QTimeZone::tzTest()
QTzTimeZonePrivate tzp("Europe/Berlin");
QVERIFY(tzp.isValid());
+ // Test POSIX-format value for $TZ:
+ QTzTimeZonePrivate tzposix("MET-1METDST-2,M3.5.0/02:00:00,M10.5.0/03:00:00");
+ QVERIFY(tzposix.isValid());
+
+ QTimeZone tzBrazil("BRT+3"); // parts of Northern Brazil, as a POSIX rule
+ QVERIFY(tzBrazil.isValid());
+ QCOMPARE(tzBrazil.offsetFromUtc(QDateTime(QDate(1111, 11, 11).startOfDay())), -10800);
+
// Test display names by type, either ICU or abbreviation only
QLocale enUS("en_US");
// Only test names in debug mode, names used can vary by ICU version installed
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone_darwin.mm b/tests/auto/corelib/time/qtimezone/tst_qtimezone_darwin.mm
index de801e55d0..de801e55d0 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone_darwin.mm
+++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone_darwin.mm
diff --git a/tests/auto/corelib/time/time.pro b/tests/auto/corelib/time/time.pro
new file mode 100644
index 0000000000..6f1ee9a8bd
--- /dev/null
+++ b/tests/auto/corelib/time/time.pro
@@ -0,0 +1,7 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ qcalendar \
+ qdate \
+ qdatetime \
+ qtime \
+ qtimezone
diff --git a/tests/auto/corelib/tools/collections/collections.pro b/tests/auto/corelib/tools/collections/collections.pro
index 5c04515fa0..e0f9f0a0ea 100644
--- a/tests/auto/corelib/tools/collections/collections.pro
+++ b/tests/auto/corelib/tools/collections/collections.pro
@@ -4,4 +4,6 @@ SOURCES += tst_collections.cpp
QT = core testlib
# This test does not work with strict iterators
+DEFINES -= QT_NO_LINKED_LIST
DEFINES -= QT_STRICT_ITERATORS
+DEFINES -= QT_NO_JAVA_STYLE_ITERATORS
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index b40b1f0624..e79a4dba29 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -67,7 +67,6 @@ void foo()
#include <algorithm>
-#include "qalgorithms.h"
#include "qbitarray.h"
#include "qbytearray.h"
#include "qcache.h"
@@ -76,7 +75,7 @@ void foo()
#include "qlist.h"
#include "qmap.h"
#include "qpair.h"
-#include "qregexp.h"
+#include "qregularexpression.h"
#include "qset.h"
#include "qstack.h"
#include "qstring.h"
@@ -105,7 +104,9 @@ private slots:
void map();
void bitArray();
void cache();
+#if QT_CONFIG(regularexpression)
void regexp();
+#endif
void pair();
void sharableQList();
void sharableQLinkedList();
@@ -189,16 +190,6 @@ void tst_Collections::list()
QVERIFY(list.size() == 6);
QVERIFY(list.end() - list.begin() == list.size());
-#if !defined(Q_CC_MSVC) && !defined(Q_CC_SUN)
- QVERIFY(std::binary_search(list.begin(), list.end(), 2) == true);
- QVERIFY(std::binary_search(list.begin(), list.end(), 9) == false);
-#endif
- QVERIFY(qBinaryFind(list.begin(), list.end(), 2) == list.begin() + 1);
- QVERIFY(qLowerBound(list.begin(), list.end(), 2) == list.begin() + 1);
- QVERIFY(qUpperBound(list.begin(), list.end(), 2) == list.begin() + 2);
- QVERIFY(qBinaryFind(list.begin(), list.end(), 9) == list.end());
- QVERIFY(qLowerBound(list.begin(), list.end(), 9) == list.end());
- QVERIFY(qUpperBound(list.begin(), list.end(), 9) == list.end());
{
int sum = 0;
QListIterator<int> i(list);
@@ -580,73 +571,73 @@ void tst_Collections::list()
list1 << 0 << 1 << 2 << 3;
list1.removeFirst();
- list1.swap(0, 0);
+ list1.swapItemsAt(0, 0);
QVERIFY(list1 == QList<int>() << 1 << 2 << 3);
- list1.swap(1, 1);
+ list1.swapItemsAt(1, 1);
QVERIFY(list1 == QList<int>() << 1 << 2 << 3);
- list1.swap(2, 2);
+ list1.swapItemsAt(2, 2);
QVERIFY(list1 == QList<int>() << 1 << 2 << 3);
- list1.swap(0, 1);
+ list1.swapItemsAt(0, 1);
QVERIFY(list1 == QList<int>() << 2 << 1 << 3);
- list1.swap(0, 2);
+ list1.swapItemsAt(0, 2);
QVERIFY(list1 == QList<int>() << 3 << 1 << 2);
- list1.swap(1, 2);
+ list1.swapItemsAt(1, 2);
QVERIFY(list1 == QList<int>() << 3 << 2 << 1);
- list1.swap(1, 2);
+ list1.swapItemsAt(1, 2);
QVERIFY(list1 == QList<int>() << 3 << 1 << 2);
QList<QString> list2;
list2 << "1" << "2" << "3";
- list2.swap(0, 0);
+ list2.swapItemsAt(0, 0);
QVERIFY(list2 == QList<QString>() << "1" << "2" << "3");
- list2.swap(1, 1);
+ list2.swapItemsAt(1, 1);
QVERIFY(list2 == QList<QString>() << "1" << "2" << "3");
- list2.swap(2, 2);
+ list2.swapItemsAt(2, 2);
QVERIFY(list2 == QList<QString>() << "1" << "2" << "3");
- list2.swap(0, 1);
+ list2.swapItemsAt(0, 1);
QVERIFY(list2 == QList<QString>() << "2" << "1" << "3");
- list2.swap(0, 2);
+ list2.swapItemsAt(0, 2);
QVERIFY(list2 == QList<QString>() << "3" << "1" << "2");
- list2.swap(1, 2);
+ list2.swapItemsAt(1, 2);
QVERIFY(list2 == QList<QString>() << "3" << "2" << "1");
- list2.swap(1, 2);
+ list2.swapItemsAt(1, 2);
QVERIFY(list2 == QList<QString>() << "3" << "1" << "2");
QList<double> list3;
list3 << 1.0 << 2.0 << 3.0;
- list3.swap(0, 0);
+ list3.swapItemsAt(0, 0);
QVERIFY(list3 == QList<double>() << 1.0 << 2.0 << 3.0);
- list3.swap(1, 1);
+ list3.swapItemsAt(1, 1);
QVERIFY(list3 == QList<double>() << 1.0 << 2.0 << 3.0);
- list3.swap(2, 2);
+ list3.swapItemsAt(2, 2);
QVERIFY(list3 == QList<double>() << 1.0 << 2.0 << 3.0);
- list3.swap(0, 1);
+ list3.swapItemsAt(0, 1);
QVERIFY(list3 == QList<double>() << 2.0 << 1.0 << 3.0);
- list3.swap(0, 2);
+ list3.swapItemsAt(0, 2);
QVERIFY(list3 == QList<double>() << 3.0 << 1.0 << 2.0);
- list3.swap(1, 2);
+ list3.swapItemsAt(1, 2);
QVERIFY(list3 == QList<double>() << 3.0 << 2.0 << 1.0);
- list3.swap(1, 2);
+ list3.swapItemsAt(1, 2);
QVERIFY(list3 == QList<double>() << 3.0 << 1.0 << 2.0);
}
@@ -994,16 +985,8 @@ void tst_Collections::vector()
v.append(2);
QVERIFY(*v.begin() == 2);
v.prepend(1);
-
- v << 3 << 4 << 5 << 6;
- QVERIFY(std::binary_search(v.begin(), v.end(), 2) == true);
- QVERIFY(std::binary_search(v.begin(), v.end(), 9) == false);
- QVERIFY(qBinaryFind(v.begin(), v.end(), 2) == v.begin() + 1);
- QVERIFY(qLowerBound(v.begin(), v.end(), 2) == v.begin() + 1);
- QVERIFY(qUpperBound(v.begin(), v.end(), 2) == v.begin() + 2);
- QVERIFY(qBinaryFind(v.begin(), v.end(), 9) == v.end());
- QVERIFY(qLowerBound(v.begin(), v.end(), 9) == v.end());
- QVERIFY(qUpperBound(v.begin(), v.end(), 9) == v.end());
+ QVERIFY(*v.begin() == 1);
+ QVERIFY(*(v.begin() + 1) == 2);
v.clear();
v << 1 << 2 << 3;
@@ -1368,7 +1351,7 @@ void tst_Collections::hash()
{
typedef QHash<QString, QString> Hash;
Hash hash;
- QString key;
+ QString key = QLatin1String(" ");
for (int i = 0; i < 10; ++i) {
key[0] = i + '0';
for (int j = 0; j < 10; ++j) {
@@ -2011,13 +1994,17 @@ void tst_Collections::qstring()
QString nonNull = "";
QVERIFY(null.left(10).isNull());
QVERIFY(null.mid(0).isNull());
+ QVERIFY(null.isNull());
+ QVERIFY(!nonNull.isNull());
+#if QT_DEPRECATED_SINCE(5, 9)
QVERIFY(null == QString::null);
QVERIFY(QString::null == null);
QVERIFY(nonNull != QString::null);
QVERIFY(QString::null != nonNull);
QVERIFY(null == nonNull);
QVERIFY(QString::null == QString::null);
+#endif
QString fill = "123";
fill.fill('a');
@@ -2285,13 +2272,15 @@ void tst_Collections::cache()
}
+#if QT_CONFIG(regularexpression)
void tst_Collections::regexp()
{
- QRegExp rx("^\\d\\d?$");
- QVERIFY(rx.indexIn("123") == -1);
- QVERIFY(rx.indexIn("-6") == -1);
- QVERIFY(rx.indexIn("6") == 0) ;
+ QRegularExpression rx("^\\d\\d?$");
+ QVERIFY(!rx.match("123").hasMatch());
+ QVERIFY(!rx.match("-6").hasMatch());
+ QVERIFY(rx.match("6").hasMatch()) ;
}
+#endif
void tst_Collections::pair()
{
@@ -2425,7 +2414,7 @@ void testContainer()
c1 = newInstance<Container>();
QVERIFY(c1.size() == 4);
QVERIFY(c1 == newInstance<Container>());
- Container c2 = qMove(c1);
+ Container c2 = std::move(c1);
QVERIFY(c2.size() == 4);
QVERIFY(c2 == newInstance<Container>());
}
@@ -2531,14 +2520,18 @@ void tst_Collections::conversions()
QCOMPARE(list2.size(), 4);
QVERIFY(list2 == (QList<QString>() << STUFF));
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QSet<QString> set1 = list1.toSet();
+#else
+ QSet<QString> set1(list1.begin(), list1.end());
+#endif
QCOMPARE(set1.size(), 3);
QVERIFY(set1.contains("A"));
QVERIFY(set1.contains("B"));
QVERIFY(set1.contains("C"));
QVERIFY(!set1.contains("D"));
- QList<QString> list3 = set1.toList();
+ QList<QString> list3 = set1.values();
QCOMPARE(list3.size(), 3);
QVERIFY(list3.contains("A"));
QVERIFY(list3.contains("B"));
@@ -2546,9 +2539,11 @@ void tst_Collections::conversions()
QVERIFY(!list3.contains("D"));
QVERIFY(QList<int>().toVector().isEmpty());
- QVERIFY(QList<int>().toSet().isEmpty());
QVERIFY(QVector<int>().toList().isEmpty());
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ QVERIFY(QList<int>().toSet().isEmpty());
QVERIFY(QSet<int>().toList().isEmpty());
+#endif
}
{
@@ -2563,14 +2558,22 @@ void tst_Collections::conversions()
QCOMPARE(list2.size(), 4);
QVERIFY(list2 == (QList<QString>() << STUFF));
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QSet<QString> set1 = QSet<QString>::fromList(list1);
+#else
+ QSet<QString> set1(list1.begin(), list1.end());
+#endif
QCOMPARE(set1.size(), 3);
QVERIFY(set1.contains("A"));
QVERIFY(set1.contains("B"));
QVERIFY(set1.contains("C"));
QVERIFY(!set1.contains("D"));
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QList<QString> list3 = QList<QString>::fromSet(set1);
+#else
+ QList<QString> list3 = set1.values();
+#endif
QCOMPARE(list3.size(), 3);
QVERIFY(list3.contains("A"));
QVERIFY(list3.contains("B"));
@@ -2578,9 +2581,11 @@ void tst_Collections::conversions()
QVERIFY(!list3.contains("D"));
QVERIFY(QVector<int>::fromList(QList<int>()).isEmpty());
- QVERIFY(QSet<int>::fromList(QList<int>()).isEmpty());
QVERIFY(QList<int>::fromVector(QVector<int>()).isEmpty());
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ QVERIFY(QSet<int>::fromList(QList<int>()).isEmpty());
QVERIFY(QList<int>::fromSet(QSet<int>()).isEmpty());
+#endif
}
#undef STUFF
}
@@ -2776,15 +2781,21 @@ void tst_Collections::vector_stl()
for (int i = 0; i < elements.count(); ++i)
vector << elements.at(i);
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
std::vector<QString> stdVector = vector.toStdVector();
-
+#else
+ std::vector<QString> stdVector(vector.begin(), vector.end());
+#endif
QCOMPARE(int(stdVector.size()), elements.size());
std::vector<QString>::const_iterator it = stdVector.begin();
for (uint j = 0; j < stdVector.size() && it != stdVector.end(); ++j, ++it)
QCOMPARE(*it, vector[j]);
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QCOMPARE(QVector<QString>::fromStdVector(stdVector), vector);
+#endif
+ QCOMPARE(QVector<QString>(stdVector.begin(), stdVector.end()), vector);
}
void tst_Collections::linkedlist_stl_data()
@@ -2830,7 +2841,11 @@ void tst_Collections::list_stl()
for (int i = 0; i < elements.count(); ++i)
list << elements.at(i);
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
std::list<QString> stdList = list.toStdList();
+#else
+ std::list<QString> stdList(list.begin(), list.end());
+#endif
QCOMPARE(int(stdList.size()), elements.size());
@@ -2838,7 +2853,10 @@ void tst_Collections::list_stl()
for (uint j = 0; j < stdList.size() && it != stdList.end(); ++j, ++it)
QCOMPARE(*it, list[j]);
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QCOMPARE(QList<QString>::fromStdList(stdList), list);
+#endif
+ QCOMPARE(QList<QString>(stdList.begin(), stdList.end()), list);
}
template <typename T>
diff --git a/tests/auto/corelib/tools/containerapisymmetry/containerapisymmetry.pro b/tests/auto/corelib/tools/containerapisymmetry/containerapisymmetry.pro
index 30dc8026ef..e46d51761e 100644
--- a/tests/auto/corelib/tools/containerapisymmetry/containerapisymmetry.pro
+++ b/tests/auto/corelib/tools/containerapisymmetry/containerapisymmetry.pro
@@ -5,3 +5,4 @@ QT = core testlib
# This test does not work with strict iterators
DEFINES -= QT_STRICT_ITERATORS
+DEFINES -= QT_NO_LINKED_LIST
diff --git a/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp b/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp
index 3b8111f1a3..4b085d387d 100644
--- a/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp
+++ b/tests/auto/corelib/tools/containerapisymmetry/tst_containerapisymmetry.cpp
@@ -34,13 +34,446 @@
#include "qstring.h"
#include "qvarlengtharray.h"
#include "qvector.h"
+#include "qhash.h"
+#include "qdebug.h"
+#include <algorithm>
+#include <functional>
#include <vector> // for reference
+#include <list>
+#include <set>
+#include <map>
+
+// MSVC has these containers from the Standard Library, but it lacks
+// a __has_include mechanism (that we need to use for other stdlibs).
+// For the sake of increasing our test coverage, work around the issue.
+
+#ifdef Q_CC_MSVC
+#define COMPILER_HAS_STDLIB_INCLUDE(x) 1
+#else
+#define COMPILER_HAS_STDLIB_INCLUDE(x) QT_HAS_INCLUDE(x)
+#endif
+
+#if COMPILER_HAS_STDLIB_INCLUDE(<forward_list>)
+#include <forward_list>
+#endif
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+#include <unordered_set>
+#endif
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+#include <unordered_map>
+#endif
+
+struct Movable
+{
+ explicit Movable(int i = 0) Q_DECL_NOTHROW
+ : i(i)
+ {
+ ++instanceCount;
+ }
+
+ Movable(const Movable &m)
+ : i(m.i)
+ {
+ ++instanceCount;
+ }
+
+ ~Movable()
+ {
+ --instanceCount;
+ }
+
+ int i;
+ static int instanceCount;
+};
+
+int Movable::instanceCount = 0;
+bool operator==(Movable lhs, Movable rhs) Q_DECL_NOTHROW { return lhs.i == rhs.i; }
+bool operator!=(Movable lhs, Movable rhs) Q_DECL_NOTHROW { return lhs.i != rhs.i; }
+bool operator<(Movable lhs, Movable rhs) Q_DECL_NOTHROW { return lhs.i < rhs.i; }
+
+uint qHash(Movable m, uint seed = 0) Q_DECL_NOTHROW { return qHash(m.i, seed); }
+QDebug &operator<<(QDebug &d, Movable m)
+{
+ const QDebugStateSaver saver(d);
+ return d.nospace() << "Movable(" << m.i << ")";
+}
+
+QT_BEGIN_NAMESPACE
+Q_DECLARE_TYPEINFO(Movable, Q_MOVABLE_TYPE);
+QT_END_NAMESPACE
+
+struct Complex
+{
+ explicit Complex(int i = 0) Q_DECL_NOTHROW
+ : i(i)
+ {
+ ++instanceCount;
+ }
+
+ Complex(const Complex &c)
+ : i(c.i)
+ {
+ ++instanceCount;
+ }
+
+ ~Complex()
+ {
+ --instanceCount;
+ }
+
+ int i;
+ static int instanceCount;
+};
+
+int Complex::instanceCount = 0;
+bool operator==(Complex lhs, Complex rhs) Q_DECL_NOTHROW { return lhs.i == rhs.i; }
+bool operator!=(Complex lhs, Complex rhs) Q_DECL_NOTHROW { return lhs.i != rhs.i; }
+bool operator<(Complex lhs, Complex rhs) Q_DECL_NOTHROW { return lhs.i < rhs.i; }
+
+uint qHash(Complex c, uint seed = 0) Q_DECL_NOTHROW { return qHash(c.i, seed); }
+QDebug &operator<<(QDebug &d, Complex c)
+{
+ const QDebugStateSaver saver(d);
+ return d.nospace() << "Complex(" << c.i << ")";
+}
+
+
+struct DuplicateStrategyTestType
+{
+ explicit DuplicateStrategyTestType(int i = 0) Q_DECL_NOTHROW
+ : i(i),
+ j(++counter)
+ {
+ }
+
+ int i;
+ int j;
+
+ static int counter;
+};
+
+int DuplicateStrategyTestType::counter = 0;
+
+// only look at the i member, not j. j allows us to identify which instance
+// gets inserted in containers that don't allow for duplicates
+bool operator==(DuplicateStrategyTestType lhs, DuplicateStrategyTestType rhs) Q_DECL_NOTHROW
+{
+ return lhs.i == rhs.i;
+}
+
+bool operator!=(DuplicateStrategyTestType lhs, DuplicateStrategyTestType rhs) Q_DECL_NOTHROW
+{
+ return lhs.i != rhs.i;
+}
+
+bool operator<(DuplicateStrategyTestType lhs, DuplicateStrategyTestType rhs) Q_DECL_NOTHROW
+{
+ return lhs.i < rhs.i;
+}
+
+uint qHash(DuplicateStrategyTestType c, uint seed = 0) Q_DECL_NOTHROW
+{
+ return qHash(c.i, seed);
+}
+
+bool reallyEqual(DuplicateStrategyTestType lhs, DuplicateStrategyTestType rhs) Q_DECL_NOTHROW
+{
+ return lhs.i == rhs.i && lhs.j == rhs.j;
+}
+
+QDebug &operator<<(QDebug &d, DuplicateStrategyTestType c)
+{
+ const QDebugStateSaver saver(d);
+ return d.nospace() << "DuplicateStrategyTestType(" << c.i << "," << c.j << ")";
+}
+
+
+namespace std {
+template<>
+struct hash<Movable>
+{
+ std::size_t operator()(Movable m) const Q_DECL_NOTHROW
+ {
+ return hash<int>()(m.i);
+ }
+};
+
+template<>
+struct hash<Complex>
+{
+ std::size_t operator()(Complex m) const Q_DECL_NOTHROW
+ {
+ return hash<int>()(m.i);
+ }
+};
+
+template<>
+struct hash<DuplicateStrategyTestType>
+{
+ std::size_t operator()(DuplicateStrategyTestType m) const Q_DECL_NOTHROW
+ {
+ return hash<int>()(m.i);
+ }
+};
+}
+
+// work around the fact that QVarLengthArray has a non-type
+// template parameter, and that breaks non_associative_container_duplicates_strategy
+template<typename T>
+class VarLengthArray : public QVarLengthArray<T>
+{
+public:
+#ifdef Q_COMPILER_INHERITING_CONSTRUCTORS
+ using QVarLengthArray<T>::QVarLengthArray;
+#else
+ template<typename InputIterator>
+ VarLengthArray(InputIterator first, InputIterator last)
+ : QVarLengthArray<T>(first, last)
+ {
+ }
+
+ VarLengthArray(std::initializer_list<T> args)
+ : QVarLengthArray<T>(args)
+ {
+ }
+#endif
+};
class tst_ContainerApiSymmetry : public QObject
{
Q_OBJECT
+ int m_movableInstanceCount;
+ int m_complexInstanceCount;
+
+private Q_SLOTS:
+ void init();
+ void cleanup();
+
+private:
+ template <typename Container>
+ void ranged_ctor_non_associative_impl() const;
+
+ template<template<typename ... T> class Container>
+ void non_associative_container_duplicates_strategy() const;
+
+ template <typename Container>
+ void ranged_ctor_associative_impl() const;
+
+private Q_SLOTS:
+ // non associative
+ void ranged_ctor_std_vector_int() { ranged_ctor_non_associative_impl<std::vector<int>>(); }
+ void ranged_ctor_std_vector_char() { ranged_ctor_non_associative_impl<std::vector<char>>(); }
+ void ranged_ctor_std_vector_QChar() { ranged_ctor_non_associative_impl<std::vector<QChar>>(); }
+ void ranged_ctor_std_vector_Movable() { ranged_ctor_non_associative_impl<std::vector<Movable>>(); }
+ void ranged_ctor_std_vector_Complex() { ranged_ctor_non_associative_impl<std::vector<Complex>>(); }
+ void ranged_ctor_std_vector_duplicates_strategy() { non_associative_container_duplicates_strategy<std::vector>(); }
+
+ void ranged_ctor_QVector_int() { ranged_ctor_non_associative_impl<QVector<int>>(); }
+ void ranged_ctor_QVector_char() { ranged_ctor_non_associative_impl<QVector<char>>(); }
+ void ranged_ctor_QVector_QChar() { ranged_ctor_non_associative_impl<QVector<QChar>>(); }
+ void ranged_ctor_QVector_Movable() { ranged_ctor_non_associative_impl<QVector<Movable>>(); }
+ void ranged_ctor_QVector_Complex() { ranged_ctor_non_associative_impl<QVector<Complex>>(); }
+ void ranged_ctor_QVector_duplicates_strategy() { non_associative_container_duplicates_strategy<QVector>(); }
+
+ void ranged_ctor_QVarLengthArray_int() { ranged_ctor_non_associative_impl<QVarLengthArray<int>>(); }
+ void ranged_ctor_QVarLengthArray_Movable() { ranged_ctor_non_associative_impl<QVarLengthArray<Movable>>(); }
+ void ranged_ctor_QVarLengthArray_Complex() { ranged_ctor_non_associative_impl<QVarLengthArray<Complex>>(); }
+ void ranged_ctor_QVarLengthArray_duplicates_strategy() { non_associative_container_duplicates_strategy<VarLengthArray>(); } // note the VarLengthArray passed
+
+ void ranged_ctor_QList_int() { ranged_ctor_non_associative_impl<QList<int>>(); }
+ void ranged_ctor_QList_Movable() { ranged_ctor_non_associative_impl<QList<Movable>>(); }
+ void ranged_ctor_QList_Complex() { ranged_ctor_non_associative_impl<QList<Complex>>(); }
+ void ranged_ctor_QList_duplicates_strategy() { non_associative_container_duplicates_strategy<QList>(); }
+
+ void ranged_ctor_std_list_int() { ranged_ctor_non_associative_impl<std::list<int>>(); }
+ void ranged_ctor_std_list_Movable() { ranged_ctor_non_associative_impl<std::list<Movable>>(); }
+ void ranged_ctor_std_list_Complex() { ranged_ctor_non_associative_impl<std::list<Complex>>(); }
+ void ranged_ctor_std_list_duplicates_strategy() { non_associative_container_duplicates_strategy<std::list>(); }
+
+ void ranged_ctor_std_forward_list_int() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<forward_list>)
+ ranged_ctor_non_associative_impl<std::forward_list<int>>();
+#else
+ QSKIP("<forward_list> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_forward_list_Movable() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<forward_list>)
+ ranged_ctor_non_associative_impl<std::forward_list<Movable>>();
+#else
+ QSKIP("<forward_list> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_forward_list_Complex() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<forward_list>)
+ ranged_ctor_non_associative_impl<std::forward_list<Complex>>();
+#else
+ QSKIP("<forward_list> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_forward_list_duplicates_strategy() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<forward_list>)
+ non_associative_container_duplicates_strategy<std::forward_list>();
+#else
+ QSKIP("<forward_list> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_QLinkedList_int() { ranged_ctor_non_associative_impl<QLinkedList<int>>(); }
+ void ranged_ctor_QLinkedList_Movable() { ranged_ctor_non_associative_impl<QLinkedList<Movable>>(); }
+ void ranged_ctor_QLinkedList_Complex() { ranged_ctor_non_associative_impl<QLinkedList<Complex>>(); }
+ void ranged_ctor_QLinkedList_duplicates_strategy() { non_associative_container_duplicates_strategy<QLinkedList>(); }
+
+ void ranged_ctor_std_set_int() { ranged_ctor_non_associative_impl<std::set<int>>(); }
+ void ranged_ctor_std_set_Movable() { ranged_ctor_non_associative_impl<std::set<Movable>>(); }
+ void ranged_ctor_std_set_Complex() { ranged_ctor_non_associative_impl<std::set<Complex>>(); }
+ void ranged_ctor_std_set_duplicates_strategy() { non_associative_container_duplicates_strategy<std::set>(); }
+
+ void ranged_ctor_std_multiset_int() { ranged_ctor_non_associative_impl<std::multiset<int>>(); }
+ void ranged_ctor_std_multiset_Movable() { ranged_ctor_non_associative_impl<std::multiset<Movable>>(); }
+ void ranged_ctor_std_multiset_Complex() { ranged_ctor_non_associative_impl<std::multiset<Complex>>(); }
+ void ranged_ctor_std_multiset_duplicates_strategy() { non_associative_container_duplicates_strategy<std::multiset>(); }
+
+ void ranged_ctor_std_unordered_set_int() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ ranged_ctor_non_associative_impl<std::unordered_set<int>>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_unordered_set_Movable() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ ranged_ctor_non_associative_impl<std::unordered_set<Movable>>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_unordered_set_Complex() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ ranged_ctor_non_associative_impl<std::unordered_set<Complex>>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_unordered_set_duplicates_strategy() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ non_associative_container_duplicates_strategy<std::unordered_set>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+
+ void ranged_ctor_std_unordered_multiset_int() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ ranged_ctor_non_associative_impl<std::unordered_multiset<int>>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_unordered_multiset_Movable() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ ranged_ctor_non_associative_impl<std::unordered_multiset<Movable>>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_unordered_multiset_Complex() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ ranged_ctor_non_associative_impl<std::unordered_multiset<Complex>>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_std_unordered_multiset_duplicates_strategy() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+ non_associative_container_duplicates_strategy<std::unordered_multiset>();
+#else
+ QSKIP("<unordered_set> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_QSet_int() { ranged_ctor_non_associative_impl<QSet<int>>(); }
+ void ranged_ctor_QSet_Movable() { ranged_ctor_non_associative_impl<QSet<Movable>>(); }
+ void ranged_ctor_QSet_Complex() { ranged_ctor_non_associative_impl<QSet<Complex>>(); }
+ void ranged_ctor_QSet_duplicates_strategy() { non_associative_container_duplicates_strategy<QSet>(); }
+
+ // associative
+ void ranged_ctor_std_map_int() { ranged_ctor_associative_impl<std::map<int, int>>(); }
+ void ranged_ctor_std_map_Movable() { ranged_ctor_associative_impl<std::map<Movable, int>>(); }
+ void ranged_ctor_std_map_Complex() { ranged_ctor_associative_impl<std::map<Complex, int>>(); }
+
+ void ranged_ctor_std_multimap_int() { ranged_ctor_associative_impl<std::multimap<int, int>>(); }
+ void ranged_ctor_std_multimap_Movable() { ranged_ctor_associative_impl<std::multimap<Movable, int>>(); }
+ void ranged_ctor_std_multimap_Complex() { ranged_ctor_associative_impl<std::multimap<Complex, int>>(); }
+
+ void ranged_ctor_unordered_map_int() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+ ranged_ctor_associative_impl<std::unordered_map<int, int>>();
+#else
+ QSKIP("<unordered_map> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_unordered_map_Movable() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+ ranged_ctor_associative_impl<std::unordered_map<Movable, Movable>>();
+#else
+ QSKIP("<unordered_map> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_unordered_map_Complex() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+ ranged_ctor_associative_impl<std::unordered_map<Complex, Complex>>();
+#else
+ QSKIP("<unordered_map> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_QHash_int() { ranged_ctor_associative_impl<QHash<int, int>>(); }
+ void ranged_ctor_QHash_Movable() { ranged_ctor_associative_impl<QHash<Movable, int>>(); }
+ void ranged_ctor_QHash_Complex() { ranged_ctor_associative_impl<QHash<Complex, int>>(); }
+
+ void ranged_ctor_unordered_multimap_int() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+ ranged_ctor_associative_impl<std::unordered_multimap<int, int>>();
+#else
+ QSKIP("<unordered_map> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_unordered_multimap_Movable() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+ ranged_ctor_associative_impl<std::unordered_multimap<Movable, Movable>>();
+#else
+ QSKIP("<unordered_map> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_unordered_multimap_Complex() {
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_map>)
+ ranged_ctor_associative_impl<std::unordered_multimap<Complex, Complex>>();
+#else
+ QSKIP("<unordered_map> is needed for this test");
+#endif
+ }
+
+ void ranged_ctor_QMultiHash_int() { ranged_ctor_associative_impl<QMultiHash<int, int>>(); }
+ void ranged_ctor_QMultiHash_Movable() { ranged_ctor_associative_impl<QMultiHash<Movable, int>>(); }
+ void ranged_ctor_QMultiHash_Complex() { ranged_ctor_associative_impl<QMultiHash<Complex, int>>(); }
+
private:
template <typename Container>
void front_back_impl() const;
@@ -58,6 +491,296 @@ private Q_SLOTS:
void front_back_QByteArray() { front_back_impl<QByteArray>(); }
};
+void tst_ContainerApiSymmetry::init()
+{
+ m_movableInstanceCount = Movable::instanceCount;
+ m_complexInstanceCount = Complex::instanceCount;
+}
+
+void tst_ContainerApiSymmetry::cleanup()
+{
+ // very simple leak check
+ QCOMPARE(Movable::instanceCount, m_movableInstanceCount);
+ QCOMPARE(Complex::instanceCount, m_complexInstanceCount);
+}
+
+template <typename Container>
+Container createContainerReference()
+{
+ using V = typename Container::value_type;
+
+ return {V(0), V(1), V(2), V(0)};
+}
+
+template <typename Container>
+void tst_ContainerApiSymmetry::ranged_ctor_non_associative_impl() const
+{
+ using V = typename Container::value_type;
+
+ // the double V(0) is deliberate
+ const auto reference = createContainerReference<Container>();
+
+ // plain array
+ const V values1[] = { V(0), V(1), V(2), V(0) };
+
+ const Container c1(values1, values1 + sizeof(values1)/sizeof(values1[0]));
+
+ // from QList
+ QList<V> l2;
+ l2 << V(0) << V(1) << V(2) << V(0);
+
+ const Container c2a(l2.begin(), l2.end());
+ const Container c2b(l2.cbegin(), l2.cend());
+
+ // from std::list
+ std::list<V> l3;
+ l3.push_back(V(0));
+ l3.push_back(V(1));
+ l3.push_back(V(2));
+ l3.push_back(V(0));
+ const Container c3a(l3.begin(), l3.end());
+
+ // from const std::list
+ const std::list<V> l3c = l3;
+ const Container c3b(l3c.begin(), l3c.end());
+
+ // from itself
+ const Container c4(reference.begin(), reference.end());
+
+ QCOMPARE(c1, reference);
+ QCOMPARE(c2a, reference);
+ QCOMPARE(c2b, reference);
+ QCOMPARE(c3a, reference);
+ QCOMPARE(c3b, reference);
+ QCOMPARE(c4, reference);
+}
+
+
+// type traits for detecting whether a non-associative container
+// accepts duplicated values, and if it doesn't, whether construction/insertion
+// prefer the new values (overwriting) or the old values (rejecting)
+
+struct ContainerAcceptsDuplicateValues {};
+struct ContainerOverwritesDuplicateValues {};
+struct ContainerRejectsDuplicateValues {};
+
+template<typename Container>
+struct ContainerDuplicatedValuesStrategy {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::vector<T...>> : ContainerAcceptsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<QVector<T...>> : ContainerAcceptsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<QVarLengthArray<T...>> : ContainerAcceptsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<VarLengthArray<T...>> : ContainerAcceptsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<QList<T...>> : ContainerAcceptsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::list<T...>> : ContainerAcceptsDuplicateValues {};
+
+#if COMPILER_HAS_STDLIB_INCLUDE(<forward_list>)
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::forward_list<T...>> : ContainerAcceptsDuplicateValues {};
+#endif
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<QLinkedList<T...>> : ContainerAcceptsDuplicateValues {};
+
+// assuming https://cplusplus.github.io/LWG/lwg-active.html#2844 resolution
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::set<T...>> : ContainerRejectsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::multiset<T...>> : ContainerAcceptsDuplicateValues {};
+
+#if COMPILER_HAS_STDLIB_INCLUDE(<unordered_set>)
+// assuming https://cplusplus.github.io/LWG/lwg-active.html#2844 resolution
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::unordered_set<T...>> : ContainerRejectsDuplicateValues {};
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<std::unordered_multiset<T...>> : ContainerAcceptsDuplicateValues {};
+#endif
+
+template<typename ... T>
+struct ContainerDuplicatedValuesStrategy<QSet<T...>> : ContainerRejectsDuplicateValues {};
+
+template<typename Container>
+void non_associative_container_check_duplicates_impl(const std::initializer_list<DuplicateStrategyTestType> &reference, const Container &c, ContainerAcceptsDuplicateValues)
+{
+ // do a deep check for equality, not ordering
+ QVERIFY(std::distance(reference.begin(), reference.end()) == std::distance(c.begin(), c.end()));
+ QVERIFY(std::is_permutation(reference.begin(), reference.end(), c.begin(), &reallyEqual));
+}
+
+enum class IterationOnReference
+{
+ ForwardIteration,
+ ReverseIteration
+};
+
+template<typename Container>
+void non_associative_container_check_duplicates_impl_no_duplicates(const std::initializer_list<DuplicateStrategyTestType> &reference, const Container &c, IterationOnReference ior)
+{
+ std::vector<DuplicateStrategyTestType> valuesAlreadySeen;
+
+ // iterate on reference forward or backwards, depending on ior. this will give
+ // us the expected semantics when checking for duplicated values into c
+ auto it = [&reference, ior]() {
+ switch (ior) {
+ case IterationOnReference::ForwardIteration: return reference.begin();
+ case IterationOnReference::ReverseIteration: return reference.end() - 1;
+ };
+ return std::initializer_list<DuplicateStrategyTestType>::const_iterator();
+ }();
+
+ const auto &end = [&reference, ior]() {
+ switch (ior) {
+ case IterationOnReference::ForwardIteration: return reference.end();
+ case IterationOnReference::ReverseIteration: return reference.begin() - 1;
+ };
+ return std::initializer_list<DuplicateStrategyTestType>::const_iterator();
+ }();
+
+ while (it != end) {
+ const auto &value = *it;
+
+ // check that there is indeed the same value in the container (using operator==)
+ const auto &valueInContainerIterator = std::find(c.begin(), c.end(), value);
+ QVERIFY(valueInContainerIterator != c.end());
+ QVERIFY(value == *valueInContainerIterator);
+
+ // if the value is a duplicate, we don't expect to find it in the container
+ // (when doing a deep comparison). otherwise it should be there
+
+ const auto &valuesAlreadySeenIterator = std::find(valuesAlreadySeen.cbegin(), valuesAlreadySeen.cend(), value);
+ const bool valueIsDuplicated = (valuesAlreadySeenIterator != valuesAlreadySeen.cend());
+
+ const auto &reallyEqualCheck = [&value](const DuplicateStrategyTestType &v) { return reallyEqual(value, v); };
+ QCOMPARE(std::find_if(c.begin(), c.end(), reallyEqualCheck) == c.end(), valueIsDuplicated);
+
+ valuesAlreadySeen.push_back(value);
+
+ switch (ior) {
+ case IterationOnReference::ForwardIteration:
+ ++it;
+ break;
+ case IterationOnReference::ReverseIteration:
+ --it;
+ break;
+ };
+ }
+
+}
+
+template<typename Container>
+void non_associative_container_check_duplicates_impl(const std::initializer_list<DuplicateStrategyTestType> &reference, const Container &c, ContainerRejectsDuplicateValues)
+{
+ non_associative_container_check_duplicates_impl_no_duplicates(reference, c, IterationOnReference::ForwardIteration);
+}
+
+template<typename Container>
+void non_associative_container_check_duplicates_impl(const std::initializer_list<DuplicateStrategyTestType> &reference, const Container &c, ContainerOverwritesDuplicateValues)
+{
+ non_associative_container_check_duplicates_impl_no_duplicates(reference, c, IterationOnReference::ReverseIteration);
+}
+
+template<typename Container>
+void non_associative_container_check_duplicates(const std::initializer_list<DuplicateStrategyTestType> &reference, const Container &c)
+{
+ non_associative_container_check_duplicates_impl(reference, c, ContainerDuplicatedValuesStrategy<Container>());
+}
+
+template<template<class ... T> class Container>
+void tst_ContainerApiSymmetry::non_associative_container_duplicates_strategy() const
+{
+ // first and last are "duplicates" -- they compare equal for operator==,
+ // but they differ when using reallyEqual
+ const std::initializer_list<DuplicateStrategyTestType> reference{ DuplicateStrategyTestType{0},
+ DuplicateStrategyTestType{1},
+ DuplicateStrategyTestType{2},
+ DuplicateStrategyTestType{0} };
+ Container<DuplicateStrategyTestType> c1{reference};
+ non_associative_container_check_duplicates(reference, c1);
+
+ Container<DuplicateStrategyTestType> c2{reference.begin(), reference.end()};
+ non_associative_container_check_duplicates(reference, c2);
+}
+
+template <typename Container>
+void tst_ContainerApiSymmetry::ranged_ctor_associative_impl() const
+{
+ using K = typename Container::key_type;
+ using V = typename Container::mapped_type;
+
+ // The double K(0) is deliberate. The order of the elements matters:
+ // * for unique-key STL containers, the first one should be the one inserted (cf. LWG 2844)
+ // * for unique-key Qt containers, the last one should be the one inserted
+ // * for multi-key sorted containers, the order of insertion of identical keys is also the
+ // iteration order (which establishes the equality of the containers)
+ // (although nothing of this is being tested here, that deserves its own testing)
+ const Container reference{
+ { K(0), V(1000) },
+ { K(1), V(1001) },
+ { K(2), V(1002) },
+ { K(0), V(1003) }
+ };
+
+ // Note that using anything not convertible to std::pair doesn't work for
+ // std containers. Their ranged construction is defined in terms of
+ // insert(value_type), which for std associative containers is
+ // std::pair<const K, T>.
+
+ // plain array
+ const std::pair<K, V> values1[] = {
+ std::make_pair(K(0), V(1000)),
+ std::make_pair(K(1), V(1001)),
+ std::make_pair(K(2), V(1002)),
+ std::make_pair(K(0), V(1003))
+ };
+
+ const Container c1(values1, values1 + sizeof(values1)/sizeof(values1[0]));
+
+ // from QList
+ QList<std::pair<K, V>> l2;
+ l2 << std::make_pair(K(0), V(1000))
+ << std::make_pair(K(1), V(1001))
+ << std::make_pair(K(2), V(1002))
+ << std::make_pair(K(0), V(1003));
+
+ const Container c2a(l2.begin(), l2.end());
+ const Container c2b(l2.cbegin(), l2.cend());
+
+ // from std::list
+ std::list<std::pair<K, V>> l3;
+ l3.push_back(std::make_pair(K(0), V(1000)));
+ l3.push_back(std::make_pair(K(1), V(1001)));
+ l3.push_back(std::make_pair(K(2), V(1002)));
+ l3.push_back(std::make_pair(K(0), V(1003)));
+ const Container c3a(l3.begin(), l3.end());
+
+ // from const std::list
+ const std::list<std::pair<K, V>> l3c = l3;
+ const Container c3b(l3c.begin(), l3c.end());
+
+ // from itself
+ const Container c4(reference.begin(), reference.end());
+
+ QCOMPARE(c1, reference);
+ QCOMPARE(c2a, reference);
+ QCOMPARE(c2b, reference);
+ QCOMPARE(c3a, reference);
+ QCOMPARE(c3b, reference);
+ QCOMPARE(c4, reference);
+}
+
template <typename Container>
Container make(int size)
{
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 72299402f0..18432e51a6 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -48,6 +48,11 @@ class tst_QAlgorithms : public QObject
{
Q_OBJECT
private slots:
+ void swap();
+ void swap2();
+ void convenienceAPI();
+
+#if QT_DEPRECATED_SINCE(5, 2)
void test_qLowerBound_data();
void test_qLowerBound();
void test_qUpperBound_data();
@@ -55,19 +60,23 @@ private slots:
void test_qBinaryFind_data();
void test_qBinaryFind();
void qBinaryFindOneEntry();
- void swap();
- void swap2();
void sortEmptyList();
void sortedList();
void sortAPItest();
void stableSortTest();
void stableSortCorrectnessTest_data();
void stableSortCorrectnessTest();
- void convenienceAPI();
+ void convenienceAPI_deprecated();
void qCountIterators() const;
void qCountContainer() const;
void binaryFindOnLargeContainer() const;
+#if Q_TEST_PERFORMANCE
+ void performance();
+#endif
+
+#endif // QT_DEPRECATED_SINCE(5, 2)
+
void popCount08_data() { popCount_data_impl(sizeof(quint8 )); }
void popCount16_data() { popCount_data_impl(sizeof(quint16)); }
void popCount32_data() { popCount_data_impl(sizeof(quint32)); }
@@ -96,9 +105,6 @@ private slots:
void countLeading64() { countLeading_impl<quint64>(); }
private:
-#if Q_TEST_PERFORMANCE
- void performance();
-#endif
void popCount_data_impl(size_t sizeof_T_Int);
template <typename T_Int>
void popCount_impl();
@@ -112,6 +118,8 @@ private:
void countLeading_impl();
};
+#if QT_DEPRECATED_SINCE(5, 2)
+
class TestInt
{
public:
@@ -172,7 +180,7 @@ ResultSet testRun(ContainerType &container, Algorithm &algorithm, int millisecs)
{
TestInt::lessThanRefCount = 0;
int count = 0;
- QTime t;
+ QElapsedTimer t;
t.start();
while(t.elapsed() < millisecs) {
++count;
@@ -208,7 +216,7 @@ void printHeader(QStringList &headers)
for (int h = 0; h < headers.count(); ++h) {
cout << setw(20) << setiosflags(ios_base::left) << headers.at(h).toLatin1().constData();
}
- cout << endl;
+ cout << Qt::endl;
}
template <typename ContainerType>
@@ -220,7 +228,7 @@ void print(ContainerType testContainer)
cout << value << " ";
}
- cout << endl;
+ cout << Qt::endl;
}
template <typename Algorithm, typename DataType>
@@ -252,11 +260,13 @@ void testAlgorithm(Algorithm algorithm, QStringList &dataSetTypes)
lessThan << setiosflags(ios_base::left) << setw(10) << result.lessThanRefCount / result.numSorts;
cout << numSorts.str() << lessThan.str();
}
- cout << endl;
+ cout << Qt::endl;
}
}
#endif
+#endif // QT_DEPRECATED_SINCE(5, 2)
+
void tst_QAlgorithms::swap()
{
{
@@ -391,6 +401,17 @@ void tst_QAlgorithms::swap2()
}
}
+void tst_QAlgorithms::convenienceAPI()
+{
+ // Compile-test for QAlgorithm convenience functions.
+
+ QList<int *> pointerList;
+ qDeleteAll(pointerList);
+ qDeleteAll(pointerList.begin(), pointerList.end());
+}
+
+#if QT_DEPRECATED_SINCE(5, 2)
+
void tst_QAlgorithms::sortEmptyList()
{
// Only test if it crashes
@@ -676,7 +697,7 @@ void tst_QAlgorithms::stableSortCorrectnessTest()
QVERIFY(isSorted(sorted));
}
-void tst_QAlgorithms::convenienceAPI()
+void tst_QAlgorithms::convenienceAPI_deprecated()
{
// Compile-test for QAlgorithm convenience functions.
QList<int> list, list2;
@@ -716,10 +737,6 @@ void tst_QAlgorithms::convenienceAPI()
qBinaryFind(list, 1);
qBinaryFind(list.begin(), list.end(), 1);
qBinaryFind(list.begin(), list.end(), 1, qLess<int>());
-
- QList<int *> pointerList;
- qDeleteAll(pointerList);
- qDeleteAll(pointerList.begin(), pointerList.end());
}
template <typename DataType>
@@ -765,21 +782,21 @@ public:
#if Q_TEST_PERFORMANCE
void tst_QAlgorithms::performance()
{
- cout << endl << "Quick sort" << endl;
+ cout << Qt::endl << "Quick sort" << Qt::endl;
testAlgorithm<QuickSortHelper<TestInt>, TestInt>(QuickSortHelper<TestInt>(), dataSetTypes);
- cout << endl << "stable sort" << endl;
+ cout << Qt::endl << "stable sort" << Qt::endl;
testAlgorithm<StableSortHelper<TestInt>, TestInt>(StableSortHelper<TestInt>(), dataSetTypes);
- cout << endl << "std::sort" << endl;
+ cout << Qt::endl << "std::sort" << Qt::endl;
testAlgorithm<StlSortHelper<TestInt>, TestInt>(StlSortHelper<TestInt>(), dataSetTypes);
- cout << endl << "std::stable_sort" << endl;
+ cout << Qt::endl << "std::stable_sort" << Qt::endl;
testAlgorithm<StlStableSortHelper<TestInt>, TestInt>(StlStableSortHelper<TestInt>(), dataSetTypes);
/*
- cout << endl << "Sorting lists of ints" << endl;
- cout << endl << "Quick sort" << endl;
+ cout << Qt::endl << "Sorting lists of ints" << Qt::endl;
+ cout << Qt::endl << "Quick sort" << Qt::endl;
testAlgorithm<QuickSortHelper<int>, int>(QuickSortHelper<int>(), dataSetTypes);
- cout << endl << "std::sort" << endl;
+ cout << Qt::endl << "std::sort" << Qt::endl;
testAlgorithm<StlSortHelper<int>, int>(StlSortHelper<int>(), dataSetTypes);
- cout << endl << "std::stable_sort" << endl;
+ cout << Qt::endl << "std::stable_sort" << Qt::endl;
testAlgorithm<StlStableSortHelper<int>, int>(StlStableSortHelper<int>(), dataSetTypes);
*/
}
@@ -1041,6 +1058,8 @@ void tst_QAlgorithms::binaryFindOnLargeContainer() const
QCOMPARE(foundIt.pos(), 1073987655);
}
+#endif // QT_DEPRECATED_SINCE(5, 2)
+
// alternative implementation of qPopulationCount for comparison:
static Q_DECL_CONSTEXPR const uint bitsSetInNibble[] = {
0, 1, 1, 2, 1, 2, 2, 3,
diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
index a00c962510..25e2f21d03 100644
--- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
+++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
@@ -78,12 +78,8 @@ private slots:
void fromRawData_data();
void fromRawData();
void literals();
-#if defined(Q_COMPILER_VARIADIC_MACROS) && defined(Q_COMPILER_LAMBDA)
void variadicLiterals();
-#endif
-#ifdef Q_COMPILER_RVALUE_REFS
void rValueReferences();
-#endif
void grow();
};
@@ -95,7 +91,7 @@ void tst_QArrayData::referenceCounting()
// Reference counting initialized to 1 (owned)
QArrayData array = { { Q_BASIC_ATOMIC_INITIALIZER(1) }, 0, 0, 0, 0 };
- QCOMPARE(array.ref.atomic.load(), 1);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 1);
QVERIFY(!array.ref.isStatic());
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
@@ -103,19 +99,19 @@ void tst_QArrayData::referenceCounting()
#endif
QVERIFY(array.ref.ref());
- QCOMPARE(array.ref.atomic.load(), 2);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 2);
QVERIFY(array.ref.deref());
- QCOMPARE(array.ref.atomic.load(), 1);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 1);
QVERIFY(array.ref.ref());
- QCOMPARE(array.ref.atomic.load(), 2);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 2);
QVERIFY(array.ref.deref());
- QCOMPARE(array.ref.atomic.load(), 1);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 1);
QVERIFY(!array.ref.deref());
- QCOMPARE(array.ref.atomic.load(), 0);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 0);
// Now would be a good time to free/release allocated data
}
@@ -125,17 +121,17 @@ void tst_QArrayData::referenceCounting()
// Reference counting initialized to 0 (non-sharable)
QArrayData array = { { Q_BASIC_ATOMIC_INITIALIZER(0) }, 0, 0, 0, 0 };
- QCOMPARE(array.ref.atomic.load(), 0);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 0);
QVERIFY(!array.ref.isStatic());
QVERIFY(!array.ref.isSharable());
QVERIFY(!array.ref.ref());
// Reference counting fails, data should be copied
- QCOMPARE(array.ref.atomic.load(), 0);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 0);
QVERIFY(!array.ref.deref());
- QCOMPARE(array.ref.atomic.load(), 0);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), 0);
// Free/release data
}
@@ -145,7 +141,7 @@ void tst_QArrayData::referenceCounting()
// Reference counting initialized to -1 (static read-only data)
QArrayData array = { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, 0, 0 };
- QCOMPARE(array.ref.atomic.load(), -1);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), -1);
QVERIFY(array.ref.isStatic());
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
@@ -153,10 +149,10 @@ void tst_QArrayData::referenceCounting()
#endif
QVERIFY(array.ref.ref());
- QCOMPARE(array.ref.atomic.load(), -1);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), -1);
QVERIFY(array.ref.deref());
- QCOMPARE(array.ref.atomic.load(), -1);
+ QCOMPARE(array.ref.atomic.loadRelaxed(), -1);
}
}
@@ -172,8 +168,8 @@ void tst_QArrayData::sharedNullEmpty()
QVERIFY(empty->ref.isStatic());
QVERIFY(empty->ref.isShared());
- QCOMPARE(null->ref.atomic.load(), -1);
- QCOMPARE(empty->ref.atomic.load(), -1);
+ QCOMPARE(null->ref.atomic.loadRelaxed(), -1);
+ QCOMPARE(empty->ref.atomic.loadRelaxed(), -1);
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
QVERIFY(null->ref.isSharable());
@@ -183,14 +179,14 @@ void tst_QArrayData::sharedNullEmpty()
QVERIFY(null->ref.ref());
QVERIFY(empty->ref.ref());
- QCOMPARE(null->ref.atomic.load(), -1);
- QCOMPARE(empty->ref.atomic.load(), -1);
+ QCOMPARE(null->ref.atomic.loadRelaxed(), -1);
+ QCOMPARE(empty->ref.atomic.loadRelaxed(), -1);
QVERIFY(null->ref.deref());
QVERIFY(empty->ref.deref());
- QCOMPARE(null->ref.atomic.load(), -1);
- QCOMPARE(empty->ref.atomic.load(), -1);
+ QCOMPARE(null->ref.atomic.loadRelaxed(), -1);
+ QCOMPARE(empty->ref.atomic.loadRelaxed(), -1);
QVERIFY(null != empty);
@@ -1618,9 +1614,7 @@ void tst_QArrayData::literals()
QCOMPARE(v.size(), size_t(11));
// v.capacity() is unspecified, for now
-#if defined(Q_COMPILER_VARIADIC_MACROS) && defined(Q_COMPILER_LAMBDA)
QVERIFY(v.isStatic());
-#endif
#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
QVERIFY(v.isSharable());
@@ -1631,9 +1625,20 @@ void tst_QArrayData::literals()
QCOMPARE(const_(v)[i], char('A' + i));
QCOMPARE(const_(v)[10], char('\0'));
}
+
+ {
+ struct LiteralType {
+ int value;
+ Q_DECL_CONSTEXPR LiteralType(int v = 0) : value(v) {}
+ };
+
+ QArrayDataPointer<LiteralType> d = Q_ARRAY_LITERAL(LiteralType, LiteralType(0), LiteralType(1), LiteralType(2));
+ QCOMPARE(d->size, 3);
+ for (int i = 0; i < 3; ++i)
+ QCOMPARE(d->data()[i].value, i);
+ }
}
-#if defined(Q_COMPILER_VARIADIC_MACROS) && defined(Q_COMPILER_LAMBDA)
// Variadic Q_ARRAY_LITERAL need to be available in the current configuration.
void tst_QArrayData::variadicLiterals()
{
@@ -1682,9 +1687,7 @@ void tst_QArrayData::variadicLiterals()
QCOMPARE(const_(v)[i], i);
}
}
-#endif
-#ifdef Q_COMPILER_RVALUE_REFS
// std::remove_reference is in C++11, but requires library support
template <class T> struct RemoveReference { typedef T Type; };
template <class T> struct RemoveReference<T &> { typedef T Type; };
@@ -1767,7 +1770,6 @@ void tst_QArrayData::rValueReferences()
QCOMPARE(v3.size(), size_t(1));
QCOMPARE(v3.front(), 42);
}
-#endif
void tst_QArrayData::grow()
{
diff --git a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
index b9bcecd607..513c811788 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
@@ -74,10 +74,12 @@ int main(int argc, char *argv[])
hiddenOption.setDescription(QStringLiteral("THIS SHOULD NEVER APPEAR"));
hiddenOption.setFlags(QCommandLineOption::HiddenFromHelp);
parser.addOption(hiddenOption);
+#if QT_DEPRECATED_SINCE(5, 8)
QCommandLineOption hiddenOption2(QStringList() << QStringLiteral("hidden2"));
hiddenOption2.setDescription(QStringLiteral("NEITHER SHOULD THIS"));
hiddenOption2.setHidden(true);
parser.addOption(hiddenOption2);
+#endif
// This program supports different options depending on the "command" (first argument).
// Call parse() to find out the positional arguments.
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index 7980f1f8f4..1e87c76d2f 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -44,6 +44,7 @@ private slots:
// In-process tests
void testInvalidOptions();
+ void testDuplicateOption();
void testPositionalArguments();
void testBooleanOption_data();
void testBooleanOption();
@@ -75,6 +76,8 @@ private slots:
void testHelpOption();
void testQuoteEscaping();
void testUnknownOption();
+ void testHelpAll_data();
+ void testHelpAll();
};
static char *empty_argv[] = { 0 };
@@ -104,6 +107,15 @@ void tst_QCommandLineParser::testInvalidOptions()
QVERIFY(!parser.addOption(QCommandLineOption(QStringLiteral("-v"), QStringLiteral("Displays version information."))));
}
+void tst_QCommandLineParser::testDuplicateOption()
+{
+ QCoreApplication app(empty_argc, empty_argv);
+ QCommandLineParser parser;
+ QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("h"), QStringLiteral("Hostname."), QStringLiteral("hostname"))));
+ QTest::ignoreMessage(QtWarningMsg, "QCommandLineParser: already having an option named \"h\"");
+ parser.addHelpOption();
+}
+
void tst_QCommandLineParser::testPositionalArguments()
{
QCoreApplication app(empty_argc, empty_argv);
@@ -489,7 +501,7 @@ void tst_QCommandLineParser::testSingleDashWordOptionModes()
void tst_QCommandLineParser::testCpp11StyleInitialization()
{
-#if defined(Q_COMPILER_INITIALIZER_LISTS) && defined(Q_COMPILER_UNIFORM_INIT)
+#if defined(Q_COMPILER_UNIFORM_INIT)
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
@@ -532,7 +544,8 @@ void tst_QCommandLineParser::testVersionOption()
static const char expectedOptionsHelp[] =
"Options:\n"
- " -h, --help Displays this help.\n"
+ " -h, --help Displays help on commandline options.\n"
+ " --help-all Displays help including Qt specific options.\n"
" -v, --version Displays version information.\n"
" --load <url> Load file from URL.\n"
" -o, --output <file> Set output file.\n"
@@ -566,8 +579,8 @@ void tst_QCommandLineParser::testHelpOption_data()
" parsingMode The parsing mode to test.\n"
" command The command to execute.\n");
#ifdef Q_OS_WIN
- expectedOutput.replace(" -h, --help Displays this help.\n",
- " -?, -h, --help Displays this help.\n");
+ expectedOutput.replace(" -h, --help Displays help on commandline options.\n",
+ " -?, -h, --help Displays help on commandline options.\n");
expectedOutput.replace("testhelper/", "testhelper\\");
#endif
@@ -615,8 +628,8 @@ void tst_QCommandLineParser::testHelpOption()
"Arguments:\n"
" resize Resize the object to a new size.\n";
#ifdef Q_OS_WIN
- expectedResizeHelp.replace(" -h, --help Displays this help.\n",
- " -?, -h, --help Displays this help.\n");
+ expectedResizeHelp.replace(" -h, --help Displays help on commandline options.\n",
+ " -?, -h, --help Displays help on commandline options.\n");
expectedResizeHelp.replace("testhelper/", "testhelper\\");
#endif
QCOMPARE(output, QString(expectedResizeHelp));
@@ -670,6 +683,60 @@ void tst_QCommandLineParser::testUnknownOption()
#endif // QT_CONFIG(process)
}
+void tst_QCommandLineParser::testHelpAll_data()
+{
+ QTest::addColumn<QCommandLineParser::SingleDashWordOptionMode>("parsingMode");
+ QTest::addColumn<QString>("expectedHelpOutput");
+
+ QString expectedOutput = QString::fromLatin1(
+ "Usage: testhelper/qcommandlineparser_test_helper [options] parsingMode command\n"
+ "Test helper\n"
+ "\n")
+ + QString::fromLatin1(expectedOptionsHelp) +
+ QString::fromLatin1(
+ " --qmljsdebugger <value> Activates the QML/JS debugger with a specified\n"
+ " port. The value must be of format\n"
+ " port:1234[,block]. \"block\" makes the application\n"
+ " wait for a connection.\n"
+ "\n"
+ "Arguments:\n"
+ " parsingMode The parsing mode to test.\n"
+ " command The command to execute.\n");
+#ifdef Q_OS_WIN
+ expectedOutput.replace(" -h, --help Displays help on commandline options.\n",
+ " -?, -h, --help Displays help on commandline options.\n");
+ expectedOutput.replace("testhelper/", "testhelper\\");
+#endif
+
+ QTest::newRow("collapsed") << QCommandLineParser::ParseAsCompactedShortOptions << expectedOutput;
+ QTest::newRow("long") << QCommandLineParser::ParseAsLongOptions << expectedOutput;
+}
+
+void tst_QCommandLineParser::testHelpAll()
+{
+#if !QT_CONFIG(process)
+ QSKIP("This test requires QProcess support");
+#else
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+ QSKIP("Deploying executable applications to file system on Android not supported.");
+#endif
+
+ QFETCH(QCommandLineParser::SingleDashWordOptionMode, parsingMode);
+ QFETCH(QString, expectedHelpOutput);
+ QCoreApplication app(empty_argc, empty_argv);
+ QProcess process;
+ process.start("testhelper/qcommandlineparser_test_helper", QStringList() << QString::number(parsingMode) << "--help-all");
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QString output = process.readAll();
+#ifdef Q_OS_WIN
+ output.replace(QStringLiteral("\r\n"), QStringLiteral("\n"));
+#endif
+ QCOMPARE(output.split('\n'), expectedHelpOutput.split('\n')); // easier to debug than the next line, on failure
+ QCOMPARE(output, expectedHelpOutput);
+#endif // QT_CONFIG(process)
+}
+
QTEST_APPLESS_MAIN(tst_QCommandLineParser)
#include "tst_qcommandlineparser.moc"
diff --git a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
index 31a5f93822..f305d63d46 100644
--- a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
+++ b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
@@ -68,7 +68,7 @@ void tst_QContiguousCache::assignment()
// copy:
cc1 = cc2;
// move:
- cc1 = qMove(cc2);
+ cc1 = std::move(cc2);
}
void tst_QContiguousCache::empty()
@@ -244,7 +244,7 @@ public:
return *this;
}
- int refCount() const { return d->ref.load(); }
+ int refCount() const { return d->ref.loadRelaxed(); }
private:
RefCountingClassData *d;
};
diff --git a/tests/auto/corelib/tools/qdatetime/BLACKLIST b/tests/auto/corelib/tools/qdatetime/BLACKLIST
deleted file mode 100644
index 3a42ee066b..0000000000
--- a/tests/auto/corelib/tools/qdatetime/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[timeZoneAbbreviation]
-osx
diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
index 0196dd2d23..2a9c1e1e41 100644
--- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
@@ -30,9 +30,7 @@
#include <qeasingcurve.h>
-#ifdef Q_COMPILER_RVALUE_REFS // cpp11() slot
-# include <utility> // for std::move()
-#endif
+#include <utility> // for std::move()
class tst_QEasingCurve : public QObject
{
@@ -55,6 +53,8 @@ private slots:
void testCbrtFloat();
void cpp11();
void quadraticEquation();
+ void streamInOut_data();
+ void streamInOut();
};
void tst_QEasingCurve::type()
@@ -404,6 +404,11 @@ void tst_QEasingCurve::valueForProgress()
const qreal error = qAbs(ex - curve.valueForProgress(at.at(i)/qreal(100)));
QVERIFY(error <= errorBound);
}
+
+ if (type != QEasingCurve::SineCurve && type != QEasingCurve::CosineCurve) {
+ QVERIFY( !(curve.valueForProgress(0) > 0) );
+ QVERIFY( !(curve.valueForProgress(1) < 1) );
+ }
#endif
}
@@ -632,6 +637,9 @@ void tst_QEasingCurve::bezierSpline()
QCOMPARE(value, ex);
QVERIFY(error <= errorBound);
}
+
+ QVERIFY( !(bezierEasingCurve.valueForProgress(0) > 0) );
+ QVERIFY( !(bezierEasingCurve.valueForProgress(1) < 1) );
}
void tst_QEasingCurve::tcbSpline_data()
@@ -691,6 +699,9 @@ void tst_QEasingCurve::tcbSpline()
QCOMPARE(value, ex);
QVERIFY(error <= errorBound);
}
+
+ QVERIFY( !(tcbEasingCurve.valueForProgress(0) > 0) );
+ QVERIFY( !(tcbEasingCurve.valueForProgress(1) < 1) );
}
/*This is single precision code for a cubic root used inside the spline easing curve.
@@ -792,7 +803,6 @@ void tst_QEasingCurve::testCbrtFloat()
void tst_QEasingCurve::cpp11()
{
-#ifdef Q_COMPILER_RVALUE_REFS
{
QEasingCurve ec( QEasingCurve::InOutBack );
QEasingCurve copy = std::move(ec); // move ctor
@@ -807,7 +817,6 @@ void tst_QEasingCurve::cpp11()
QCOMPARE( copy.type(), QEasingCurve::InOutBack );
QCOMPARE( ec.type(), type );
}
-#endif
}
void tst_QEasingCurve::quadraticEquation() {
@@ -879,5 +888,36 @@ void tst_QEasingCurve::quadraticEquation() {
}
}
+void tst_QEasingCurve::streamInOut_data()
+{
+ QTest::addColumn<int>("version");
+ QTest::addColumn<bool>("equality");
+
+ QTest::newRow("5.11") << int(QDataStream::Qt_5_11) << false;
+ QTest::newRow("5.13") << int(QDataStream::Qt_5_13) << true;
+}
+
+void tst_QEasingCurve::streamInOut()
+{
+ QFETCH(int, version);
+ QFETCH(bool, equality);
+
+ QEasingCurve orig;
+ orig.addCubicBezierSegment(QPointF(0.43, 0.0025), QPointF(0.38, 0.51), QPointF(0.57, 0.99));
+
+ QEasingCurve copy;
+
+ QByteArray data;
+ QDataStream dsw(&data,QIODevice::WriteOnly);
+ QDataStream dsr(&data,QIODevice::ReadOnly);
+
+ dsw.setVersion(version);
+ dsr.setVersion(version);
+ dsw << orig;
+ dsr >> copy;
+
+ QCOMPARE(copy == orig, equality);
+}
+
QTEST_MAIN(tst_QEasingCurve)
#include "tst_qeasingcurve.moc"
diff --git a/tests/auto/corelib/tools/qhash/qhash.pro b/tests/auto/corelib/tools/qhash/qhash.pro
index 79ffd4e9d1..e96c0d1bf1 100644
--- a/tests/auto/corelib/tools/qhash/qhash.pro
+++ b/tests/auto/corelib/tools/qhash/qhash.pro
@@ -2,3 +2,5 @@ CONFIG += testcase
TARGET = tst_qhash
QT = core testlib
SOURCES = $$PWD/tst_qhash.cpp
+
+DEFINES -= QT_NO_JAVA_STYLE_ITERATORS
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 0015efacfa..f0aaad98bd 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -273,7 +273,7 @@ void tst_QHash::insert1()
{
typedef QHash<QString, QString> Hash;
Hash hash;
- QString key;
+ QString key = QLatin1String(" ");
for (int i = 0; i < 10; ++i) {
key[0] = i + '0';
for (int j = 0; j < 10; ++j) {
@@ -1480,7 +1480,6 @@ void tst_QHash::twoArguments_qHash()
void tst_QHash::initializerList()
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QHash<int, QString> hash = {{1, "bar"}, {1, "hello"}, {2, "initializer_list"}};
QCOMPARE(hash.count(), 2);
QCOMPARE(hash[1], QString("hello"));
@@ -1507,9 +1506,6 @@ void tst_QHash::initializerList()
QMultiHash<int, float> emptyPairs2{{}, {}};
QVERIFY(!emptyPairs2.isEmpty());
-#else
- QSKIP("Compiler doesn't support initializer lists");
-#endif
}
void tst_QHash::eraseValidIteratorOnSharedHash()
diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
index 124e3cdf00..f76f3aa0c6 100644
--- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
+++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
@@ -34,6 +34,8 @@
#include <sstream>
#include <algorithm>
+#include <unordered_set>
+
class tst_QHashFunctions : public QObject
{
Q_OBJECT
@@ -59,6 +61,8 @@ private Q_SLOTS:
void range();
void rangeCommutative();
+ void stdHash();
+
void setGlobalQHashSeed();
};
@@ -281,6 +285,38 @@ void tst_QHashFunctions::rangeCommutative()
(void)qHashRangeCommutative(hashables, hashables + numHashables, seed);
}
+void tst_QHashFunctions::stdHash()
+{
+ {
+ std::unordered_set<QString> s = {QStringLiteral("Hello"), QStringLiteral("World")};
+ QCOMPARE(s.size(), 2UL);
+ s.insert(QStringLiteral("Hello"));
+ QCOMPARE(s.size(), 2UL);
+ }
+
+ {
+ std::unordered_set<QStringView> s = {QStringLiteral("Hello"), QStringLiteral("World")};
+ QCOMPARE(s.size(), 2UL);
+ s.insert(QStringLiteral("Hello"));
+ QCOMPARE(s.size(), 2UL);
+ }
+
+ {
+ std::unordered_set<QLatin1String> s = {QLatin1String("Hello"), QLatin1String("World")};
+ QCOMPARE(s.size(), 2UL);
+ s.insert(QLatin1String("Hello"));
+ QCOMPARE(s.size(), 2UL);
+ }
+
+ {
+ std::unordered_set<QByteArray> s = {QByteArrayLiteral("Hello"), QByteArrayLiteral("World")};
+ QCOMPARE(s.size(), 2UL);
+ s.insert(QByteArray("Hello"));
+ QCOMPARE(s.size(), 2UL);
+ }
+
+}
+
void tst_QHashFunctions::setGlobalQHashSeed()
{
// Setter works as advertised
diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp
index ae65d8f697..31aa5b4e0c 100644
--- a/tests/auto/corelib/tools/qline/tst_qline.cpp
+++ b/tests/auto/corelib/tools/qline/tst_qline.cpp
@@ -53,8 +53,10 @@ private slots:
void testNormalVector();
void testNormalVector_data();
+#if QT_DEPRECATED_SINCE(5, 14)
void testAngle();
void testAngle_data();
+#endif
void testAngle2();
void testAngle2_data();
@@ -205,7 +207,10 @@ void tst_QLine::testIntersection()
QPointF ip;
- QLineF::IntersectType itype = a.intersect(b, &ip);
+ QLineF::IntersectionType itype = a.intersects(b, &ip);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QCOMPARE(a.intersect(b, &ip), itype);
+#endif
QCOMPARE(int(itype), type);
if (type != QLineF::NoIntersection) {
@@ -378,6 +383,7 @@ void tst_QLine::testNormalVector()
QCOMPARE(n.dy(), qreal(nvy));
}
+#if QT_DEPRECATED_SINCE(5, 14)
void tst_QLine::testAngle_data()
{
QTest::addColumn<double>("xa1");
@@ -426,6 +432,7 @@ void tst_QLine::testAngle()
double resultAngle = a.angle(b);
QCOMPARE(qRound(resultAngle), qRound(angle));
}
+#endif
void tst_QLine::testAngle2_data()
{
diff --git a/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro b/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro
index 80630f78ad..c53d553d6d 100644
--- a/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro
+++ b/tests/auto/corelib/tools/qlinkedlist/qlinkedlist.pro
@@ -1,4 +1,7 @@
CONFIG += testcase
TARGET = tst_qlinkedlist
QT = core testlib
+qtConfig(c++14): CONFIG += c++14
+qtConfig(c++1z): CONFIG += c++1z
SOURCES = tst_qlinkedlist.cpp
+DEFINES -= QT_NO_LINKED_LIST
diff --git a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
index f17d6695f0..df42b5dea9 100644
--- a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
+++ b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
@@ -187,6 +187,7 @@ private slots:
void countInt() const;
void countMovable() const;
void countComplex() const;
+ void cpp17ctad() const;
void emptyInt() const;
void emptyMovable() const;
void emptyComplex() const;
@@ -594,6 +595,33 @@ void tst_QLinkedList::countComplex() const
QCOMPARE(liveCount, Complex::getLiveCount());
}
+void tst_QLinkedList::cpp17ctad() const
+{
+#ifdef __cpp_deduction_guides
+#define QVERIFY_IS_LIST_OF(obj, Type) \
+ QVERIFY2((std::is_same<decltype(obj), QLinkedList<Type>>::value), \
+ QMetaType::typeName(qMetaTypeId<decltype(obj)::value_type>()))
+#define CHECK(Type, One, Two, Three) \
+ do { \
+ const Type v[] = {One, Two, Three}; \
+ QLinkedList v1 = {One, Two, Three}; \
+ QVERIFY_IS_LIST_OF(v1, Type); \
+ QLinkedList v2(v1.begin(), v1.end()); \
+ QVERIFY_IS_LIST_OF(v2, Type); \
+ QLinkedList v3(std::begin(v), std::end(v)); \
+ QVERIFY_IS_LIST_OF(v3, Type); \
+ } while (false) \
+ /*end*/
+ CHECK(int, 1, 2, 3);
+ CHECK(double, 1.0, 2.0, 3.0);
+ CHECK(QString, QStringLiteral("one"), QStringLiteral("two"), QStringLiteral("three"));
+#undef QVERIFY_IS_LIST_OF
+#undef CHECK
+#else
+ QSKIP("This test requires C++17 Constructor Template Argument Deduction support enabled in the compiler.");
+#endif
+}
+
template<typename T>
void tst_QLinkedList::empty() const
{
@@ -1005,7 +1033,6 @@ void tst_QLinkedList::testSTLIteratorsComplex() const
void tst_QLinkedList::initializeList() const
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QLinkedList<int> v1 { 2, 3, 4 };
QCOMPARE(v1, QLinkedList<int>() << 2 << 3 << 4);
QCOMPARE(v1, (QLinkedList<int> { 2, 3, 4}));
@@ -1014,7 +1041,6 @@ void tst_QLinkedList::initializeList() const
QLinkedList<QLinkedList<int>> v3;
v3 << v1 << (QLinkedList<int>() << 1) << QLinkedList<int>() << v1;
QCOMPARE(v3, v2);
-#endif
}
diff --git a/tests/auto/corelib/tools/qlist/qlist.pro b/tests/auto/corelib/tools/qlist/qlist.pro
index 47f0140abb..118c607880 100644
--- a/tests/auto/corelib/tools/qlist/qlist.pro
+++ b/tests/auto/corelib/tools/qlist/qlist.pro
@@ -1,4 +1,6 @@
CONFIG += testcase
TARGET = tst_qlist
QT = core testlib
+qtConfig(c++14): CONFIG += c++14
+qtConfig(c++1z): CONFIG += c++1z
SOURCES = $$PWD/tst_qlist.cpp
diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
index b3f8130d27..cc9a3a16d1 100644
--- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp
+++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
@@ -310,6 +310,7 @@ private slots:
void lastComplex() const;
void constFirst() const;
void constLast() const;
+ void cpp17ctad() const;
void beginOptimal() const;
void beginMovable() const;
void beginComplex() const;
@@ -364,12 +365,14 @@ private slots:
void takeLastOptimal() const;
void takeLastMovable() const;
void takeLastComplex() const;
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
void toSetOptimal() const;
void toSetMovable() const;
void toSetComplex() const;
void toStdListOptimal() const;
void toStdListMovable() const;
void toStdListComplex() const;
+#endif
void toVectorOptimal() const;
void toVectorMovable() const;
void toVectorComplex() const;
@@ -426,8 +429,10 @@ private:
template<typename T> void takeAt() const;
template<typename T> void takeFirst() const;
template<typename T> void takeLast() const;
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
template<typename T> void toSet() const;
template<typename T> void toStdList() const;
+#endif
template<typename T> void toVector() const;
template<typename T> void value() const;
@@ -860,6 +865,33 @@ void tst_QList::constLast() const
QVERIFY(listCopy.isSharedWith(list));
}
+void tst_QList::cpp17ctad() const
+{
+#ifdef __cpp_deduction_guides
+#define QVERIFY_IS_LIST_OF(obj, Type) \
+ QVERIFY2((std::is_same<decltype(obj), QList<Type>>::value), \
+ QMetaType::typeName(qMetaTypeId<decltype(obj)::value_type>()))
+#define CHECK(Type, One, Two, Three) \
+ do { \
+ const Type v[] = {One, Two, Three}; \
+ QList v1 = {One, Two, Three}; \
+ QVERIFY_IS_LIST_OF(v1, Type); \
+ QList v2(v1.begin(), v1.end()); \
+ QVERIFY_IS_LIST_OF(v2, Type); \
+ QList v3(std::begin(v), std::end(v)); \
+ QVERIFY_IS_LIST_OF(v3, Type); \
+ } while (false) \
+ /*end*/
+ CHECK(int, 1, 2, 3);
+ CHECK(double, 1.0, 2.0, 3.0);
+ CHECK(QString, QStringLiteral("one"), QStringLiteral("two"), QStringLiteral("three"));
+#undef QVERIFY_IS_LIST_OF
+#undef CHECK
+#else
+ QSKIP("This test requires C++17 Constructor Template Argument Deduction support enabled in the compiler.");
+#endif
+}
+
template<typename T>
void tst_QList::last() const
{
@@ -1457,11 +1489,11 @@ void tst_QList::swap() const
list << T_FOO << T_BAR << T_BAZ;
// swap
- list.swap(0, 2);
+ list.swapItemsAt(0, 2);
QCOMPARE(list, QList<T>() << T_BAZ << T_BAR << T_FOO);
// swap again
- list.swap(1, 2);
+ list.swapItemsAt(1, 2);
QCOMPARE(list, QList<T>() << T_BAZ << T_FOO << T_BAR);
QList<T> list2;
@@ -1595,6 +1627,7 @@ void tst_QList::takeLastComplex() const
QCOMPARE(liveCount, Complex::getLiveCount());
}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
template<typename T>
void tst_QList::toSet() const
{
@@ -1669,6 +1702,7 @@ void tst_QList::toStdListComplex() const
toStdList<Complex>();
QCOMPARE(liveCount, Complex::getLiveCount());
}
+#endif
template<typename T>
void tst_QList::toVector() const
@@ -1871,7 +1905,6 @@ void tst_QList::testSTLIteratorsComplex() const
void tst_QList::initializeList() const
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QList<int> v1{2,3,4};
QCOMPARE(v1, QList<int>() << 2 << 3 << 4);
QCOMPARE(v1, (QList<int>{2,3,4}));
@@ -1880,7 +1913,6 @@ void tst_QList::initializeList() const
QList<QList<int>> v3;
v3 << v1 << (QList<int>() << 1) << QList<int>() << v1;
QCOMPARE(v3, v2);
-#endif
}
template<typename T>
diff --git a/tests/auto/corelib/tools/qlocale/BLACKLIST b/tests/auto/corelib/tools/qlocale/BLACKLIST
deleted file mode 100644
index 3eac7c10ed..0000000000
--- a/tests/auto/corelib/tools/qlocale/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[formatTimeZone]
-osx
diff --git a/tests/auto/corelib/tools/qmap/qmap.pro b/tests/auto/corelib/tools/qmap/qmap.pro
index 27820a76c8..2cc772720d 100644
--- a/tests/auto/corelib/tools/qmap/qmap.pro
+++ b/tests/auto/corelib/tools/qmap/qmap.pro
@@ -2,3 +2,5 @@ CONFIG += testcase
TARGET = tst_qmap
QT = core testlib
SOURCES = $$PWD/tst_qmap.cpp
+
+DEFINES -= QT_NO_JAVA_STYLE_ITERATORS
diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
index b39444e76f..d66fd28779 100644
--- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp
+++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
@@ -1319,7 +1319,6 @@ void tst_QMap::checkMostLeftNode()
void tst_QMap::initializerList()
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QMap<int, QString> map = {{1, "bar"}, {1, "hello"}, {2, "initializer_list"}};
QCOMPARE(map.count(), 2);
QCOMPARE(map[1], QString("hello"));
@@ -1346,9 +1345,6 @@ void tst_QMap::initializerList()
QMultiMap<float, float> emptyPairs2{{}, {}};
QVERIFY(!emptyPairs2.isEmpty());
-#else
- QSKIP("Compiler doesn't support initializer lists");
-#endif
}
void tst_QMap::testInsertWithHint()
diff --git a/tests/auto/corelib/tools/qpair/qpair.pro b/tests/auto/corelib/tools/qpair/qpair.pro
index 659be887d3..d684a24a57 100644
--- a/tests/auto/corelib/tools/qpair/qpair.pro
+++ b/tests/auto/corelib/tools/qpair/qpair.pro
@@ -2,3 +2,6 @@ CONFIG += testcase
TARGET = tst_qpair
QT = core testlib
SOURCES = tst_qpair.cpp
+
+# Force C++17 if available (needed due to Q_COMPILER_DEDUCTION_GUIDES)
+contains(QT_CONFIG, c++1z): CONFIG += c++1z
diff --git a/tests/auto/corelib/tools/qpair/tst_qpair.cpp b/tests/auto/corelib/tools/qpair/tst_qpair.cpp
index dedc353e67..3c972329bc 100644
--- a/tests/auto/corelib/tools/qpair/tst_qpair.cpp
+++ b/tests/auto/corelib/tools/qpair/tst_qpair.cpp
@@ -39,6 +39,7 @@ private Q_SLOTS:
void testConstexpr();
void testConversions();
void taskQTBUG_48780_pairContainingCArray();
+ void testDeducationRules();
};
class C { C() {} char _[4]; };
@@ -202,5 +203,30 @@ void tst_QPair::taskQTBUG_48780_pairContainingCArray()
Q_UNUSED(pair);
}
+void tst_QPair::testDeducationRules()
+{
+#if defined(__cpp_deduction_guides) && __cpp_deduction_guides >= 201606
+ QPair p1{1, 2};
+ static_assert(std::is_same<decltype(p1)::first_type, decltype(1)>::value);
+ static_assert(std::is_same<decltype(p1)::second_type, decltype(2)>::value);
+ QCOMPARE(p1.first, 1);
+ QCOMPARE(p1.second, 2);
+
+ QPair p2{QString("string"), 2};
+ static_assert(std::is_same<decltype(p2)::first_type, QString>::value);
+ static_assert(std::is_same<decltype(p2)::second_type, decltype(2)>::value);
+ QCOMPARE(p2.first, "string");
+ QCOMPARE(p2.second, 2);
+
+ QPair p3(p2);
+ static_assert(std::is_same<decltype(p3)::first_type, decltype(p2)::first_type>::value);
+ static_assert(std::is_same<decltype(p3)::second_type, decltype(p2)::second_type>::value);
+ QCOMPARE(p3.first, "string");
+ QCOMPARE(p3.second, 2);
+#else
+ QSKIP("Unsupported");
+#endif
+}
+
QTEST_APPLESS_MAIN(tst_QPair)
#include "tst_qpair.moc"
diff --git a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
index 8e184f3ef3..f25492d2db 100644
--- a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
+++ b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
@@ -42,6 +42,8 @@ private slots:
void getSet_data();
void getSet();
+ void transposed();
+
void rx();
void ry();
@@ -126,6 +128,11 @@ void tst_QPoint::getSet()
QCOMPARE(point.y(), i);
}
+void tst_QPoint::transposed()
+{
+ QCOMPARE(QPoint(1, 2).transposed(), QPoint(2, 1));
+}
+
void tst_QPoint::rx()
{
const QPoint originalPoint(-1, 0);
diff --git a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
index d4ccdf7ba6..e78a8e3082 100644
--- a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
+++ b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp
@@ -46,6 +46,8 @@ private slots:
void getSet_data();
void getSet();
+ void transposed();
+
void rx();
void ry();
@@ -154,6 +156,11 @@ void tst_QPointF::getSet()
QCOMPARE(point.y(), r);
}
+void tst_QPointF::transposed()
+{
+ QCOMPARE(QPointF(1, 2).transposed(), QPointF(2, 1));
+}
+
void tst_QPointF::rx()
{
const QPointF originalPoint(-1, 0);
diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
index b943b04e23..ea94cc2999 100644
--- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
+++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
@@ -327,7 +327,7 @@ struct RefCounted
~RefCounted()
{
- QVERIFY( ref.load() == 0 );
+ QVERIFY( ref.loadRelaxed() == 0 );
instanceCount.deref();
}
@@ -369,13 +369,13 @@ void scopedPointerComparisonTest(const A1 &a1, const A2 &a2, const B &b)
void tst_QScopedPointer::comparison()
{
- QCOMPARE( RefCounted::instanceCount.load(), 0 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 0 );
{
RefCounted *a = new RefCounted;
RefCounted *b = new RefCounted;
- QCOMPARE( RefCounted::instanceCount.load(), 2 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 2 );
QScopedPointer<RefCounted> pa1(a);
QScopedPointer<RefCounted> pa2(a);
@@ -387,16 +387,16 @@ void tst_QScopedPointer::comparison()
pa2.take();
- QCOMPARE( RefCounted::instanceCount.load(), 2 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 2 );
}
- QCOMPARE( RefCounted::instanceCount.load(), 0 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 0 );
{
RefCounted *a = new RefCounted[42];
RefCounted *b = new RefCounted[43];
- QCOMPARE( RefCounted::instanceCount.load(), 85 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 85 );
QScopedArrayPointer<RefCounted> pa1(a);
QScopedArrayPointer<RefCounted> pa2(a);
@@ -406,10 +406,10 @@ void tst_QScopedPointer::comparison()
pa2.take();
- QCOMPARE( RefCounted::instanceCount.load(), 85 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 85 );
}
- QCOMPARE( RefCounted::instanceCount.load(), 0 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 0 );
{
// QScopedSharedPointer is an internal helper class -- it is unsupported!
@@ -417,42 +417,42 @@ void tst_QScopedPointer::comparison()
RefCounted *a = new RefCounted;
RefCounted *b = new RefCounted;
- QCOMPARE( RefCounted::instanceCount.load(), 2 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 2 );
QSharedDataPointer<RefCounted> pa1(a);
QSharedDataPointer<RefCounted> pa2(a);
QSharedDataPointer<RefCounted> pb(b);
- QCOMPARE( a->ref.load(), 2 );
- QCOMPARE( b->ref.load(), 1 );
- QCOMPARE( RefCounted::instanceCount.load(), 2 );
+ QCOMPARE( a->ref.loadRelaxed(), 2 );
+ QCOMPARE( b->ref.loadRelaxed(), 1 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 2 );
scopedPointerComparisonTest(pa1, pa2, pb);
- QCOMPARE( RefCounted::instanceCount.load(), 2 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 2 );
}
- QCOMPARE( RefCounted::instanceCount.load(), 0 );
+ QCOMPARE( RefCounted::instanceCount.loadRelaxed(), 0 );
}
void tst_QScopedPointer::array()
{
- int instCount = RefCounted::instanceCount.load();
+ int instCount = RefCounted::instanceCount.loadRelaxed();
{
QScopedArrayPointer<RefCounted> array;
array.reset(new RefCounted[42]);
- QCOMPARE(instCount + 42, RefCounted::instanceCount.load());
+ QCOMPARE(instCount + 42, RefCounted::instanceCount.loadRelaxed());
}
- QCOMPARE(instCount, RefCounted::instanceCount.load());
+ QCOMPARE(instCount, RefCounted::instanceCount.loadRelaxed());
{
QScopedArrayPointer<RefCounted> array(new RefCounted[42]);
- QCOMPARE(instCount + 42, RefCounted::instanceCount.load());
+ QCOMPARE(instCount + 42, RefCounted::instanceCount.loadRelaxed());
array.reset(new RefCounted[28]);
- QCOMPARE(instCount + 28, RefCounted::instanceCount.load());
+ QCOMPARE(instCount + 28, RefCounted::instanceCount.loadRelaxed());
array.reset(0);
- QCOMPARE(instCount, RefCounted::instanceCount.load());
+ QCOMPARE(instCount, RefCounted::instanceCount.loadRelaxed());
}
- QCOMPARE(instCount, RefCounted::instanceCount.load());
+ QCOMPARE(instCount, RefCounted::instanceCount.loadRelaxed());
}
diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
index 656dd6a6e3..9b607db608 100644
--- a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
+++ b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
@@ -46,6 +46,7 @@ private Q_SLOTS:
void rollbackToPreviousCommit();
void exceptions();
void earlyExitScope();
+ void moveOnly();
private:
void earlyExitScope_helper(int exitpoint, int &member);
};
@@ -190,5 +191,17 @@ void tst_QScopedValueRollback::earlyExitScope_helper(int exitpoint, int& member)
r.commit();
}
+void tst_QScopedValueRollback::moveOnly()
+{
+ std::unique_ptr<int> uniquePtr;
+ std::unique_ptr<int> newVal(new int(5));
+ QVERIFY(!uniquePtr);
+ {
+ QScopedValueRollback<std::unique_ptr<int>> r(uniquePtr, std::move(newVal));
+ QVERIFY(uniquePtr);
+ }
+ QVERIFY(!uniquePtr);
+}
+
QTEST_MAIN(tst_QScopedValueRollback)
#include "tst_qscopedvaluerollback.moc"
diff --git a/tests/auto/corelib/tools/qset/qset.pro b/tests/auto/corelib/tools/qset/qset.pro
index 10ae3307d1..3ae4bc4805 100644
--- a/tests/auto/corelib/tools/qset/qset.pro
+++ b/tests/auto/corelib/tools/qset/qset.pro
@@ -1,4 +1,8 @@
CONFIG += testcase
TARGET = tst_qset
QT = core testlib
+qtConfig(c++14): CONFIG += c++14
+qtConfig(c++1z): CONFIG += c++1z
SOURCES = tst_qset.cpp
+
+DEFINES -= QT_NO_JAVA_STYLE_ITERATORS
diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp
index 0b60350380..8a545712a2 100644
--- a/tests/auto/corelib/tools/qset/tst_qset.cpp
+++ b/tests/auto/corelib/tools/qset/tst_qset.cpp
@@ -54,6 +54,7 @@ private slots:
void detach();
void isDetached();
void clear();
+ void cpp17ctad();
void remove();
void contains();
void containsSet();
@@ -325,6 +326,33 @@ void tst_QSet::clear()
QVERIFY(set2.size() == 0);
}
+void tst_QSet::cpp17ctad()
+{
+#ifdef __cpp_deduction_guides
+#define QVERIFY_IS_SET_OF(obj, Type) \
+ QVERIFY2((std::is_same<decltype(obj), QSet<Type>>::value), \
+ QMetaType::typeName(qMetaTypeId<decltype(obj)::value_type>()))
+#define CHECK(Type, One, Two, Three) \
+ do { \
+ const Type v[] = {One, Two, Three}; \
+ QSet v1 = {One, Two, Three}; \
+ QVERIFY_IS_SET_OF(v1, Type); \
+ QSet v2(v1.begin(), v1.end()); \
+ QVERIFY_IS_SET_OF(v2, Type); \
+ QSet v3(std::begin(v), std::end(v)); \
+ QVERIFY_IS_SET_OF(v3, Type); \
+ } while (false) \
+ /*end*/
+ CHECK(int, 1, 2, 3);
+ CHECK(double, 1.0, 2.0, 3.0);
+ CHECK(QString, QStringLiteral("one"), QStringLiteral("two"), QStringLiteral("three"));
+#undef QVERIFY_IS_SET_OF
+#undef CHECK
+#else
+ QSKIP("This test requires C++17 Constructor Template Argument Deduction support enabled in the compiler.");
+#endif
+}
+
void tst_QSet::remove()
{
QSet<QString> set1;
@@ -955,7 +983,6 @@ void tst_QSet::makeSureTheComfortFunctionsCompile()
void tst_QSet::initializerList()
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QSet<int> set = {1, 1, 2, 3, 4, 5};
QCOMPARE(set.count(), 5);
QVERIFY(set.contains(1));
@@ -976,9 +1003,6 @@ void tst_QSet::initializerList()
QSet<int> set3{{}, {}, {}};
QVERIFY(!set3.isEmpty());
-#else
- QSKIP("Compiler doesn't support initializer lists");
-#endif
}
void tst_QSet::qhash()
@@ -1011,15 +1035,7 @@ void tst_QSet::qhash()
// check that sets of sets work:
//
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QSet<QSet<int> > intSetSet = { { 0, 1, 2 }, { 0, 1 }, { 1, 2 } };
-#else
- QSet<QSet<int> > intSetSet;
- QSet<int> intSet01, intSet12;
- intSet01 << 0 << 1;
- intSet12 << 1 << 2;
- intSetSet << intSet01 << intSet12 << (intSet01|intSet12);
-#endif
QCOMPARE(intSetSet.size(), 3);
}
}
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 0fe24ed5cb..a9fd282ac9 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -76,10 +76,13 @@ private slots:
void functionCallDownCast();
void upCast();
void qobjectWeakManagement();
+#if QT_DEPRECATED_SINCE(5, 0)
void noSharedPointerFromWeakQObject();
void sharedPointerFromQObjectWithWeak();
+#endif
void weakQObjectFromSharedPointer();
void objectCast();
+ void objectCastStdSharedPtr();
void differentPointers();
void virtualBaseDifferentPointers();
#ifndef QTEST_NO_RTTI
@@ -91,9 +94,7 @@ private slots:
#endif
void constCorrectness();
void customDeleter();
-#ifdef Q_COMPILER_LAMBDA
void lambdaCustomDeleter();
-#endif
void creating();
void creatingCvQualified();
void creatingVariadic();
@@ -231,7 +232,6 @@ struct NoDefaultConstructorConstRef2
NoDefaultConstructorConstRef2(const QByteArray &ba, int i = 42) : str(QString::fromLatin1(ba)), i(i) {}
};
-#ifdef Q_COMPILER_RVALUE_REFS
struct NoDefaultConstructorRRef1
{
int &i;
@@ -243,7 +243,6 @@ struct NoDefaultConstructorRRef2
std::unique_ptr<int> i;
NoDefaultConstructorRRef2(std::unique_ptr<int> &&i) : i(std::move(i)) {}
};
-#endif
void tst_QSharedPointer::basics_data()
{
@@ -301,8 +300,8 @@ void tst_QSharedPointer::basics()
QVERIFY(! (ptr == otherData));
QVERIFY(! (otherData == ptr));
}
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.load() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.loadRelaxed() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.loadRelaxed() == 1);
{
// create another object:
@@ -314,8 +313,8 @@ void tst_QSharedPointer::basics()
// otherData is deleted here
}
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.load() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.loadRelaxed() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.loadRelaxed() == 1);
{
// create a copy:
@@ -332,8 +331,8 @@ void tst_QSharedPointer::basics()
QCOMPARE(copy.get(), aData);
QVERIFY(copy == aData);
}
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.load() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.loadRelaxed() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.loadRelaxed() == 1);
{
// create a weak reference:
@@ -365,8 +364,8 @@ void tst_QSharedPointer::basics()
QCOMPARE(strong.data(), aData);
QCOMPARE(strong.get(), aData);
}
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.load() == 1);
- QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.load() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->weakref.loadRelaxed() == 1);
+ QVERIFY(!refCountData(ptr) || refCountData(ptr)->strongref.loadRelaxed() == 1);
// aData is deleted here
}
@@ -512,7 +511,6 @@ void tst_QSharedPointer::swap()
void tst_QSharedPointer::moveSemantics()
{
-#ifdef Q_COMPILER_RVALUE_REFS
QSharedPointer<int> p1, p2(new int(42)), control = p2;
QVERIFY(p1 != control);
QVERIFY(p1.isNull());
@@ -565,9 +563,6 @@ void tst_QSharedPointer::moveSemantics()
QVERIFY(w1.isNull());
QVERIFY(w2.isNull());
QVERIFY(w3.isNull());
-#else
- QSKIP("This test requires C++11 rvalue/move semantics support in the compiler.");
-#endif
}
void tst_QSharedPointer::useOfForwardDeclared()
@@ -584,10 +579,10 @@ void tst_QSharedPointer::useOfForwardDeclared()
// move assignment:
QSharedPointer<ForwardDeclared> sp4;
- sp4 = qMove(sp);
+ sp4 = std::move(sp);
// and move constuction:
- QSharedPointer<ForwardDeclared> sp5 = qMove(sp2);
+ QSharedPointer<ForwardDeclared> sp5 = std::move(sp2);
// swapping:
sp4.swap(sp3);
@@ -854,15 +849,15 @@ void tst_QSharedPointer::upCast()
QVERIFY(baseptr == derivedptr);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QWeakPointer<DerivedData> derivedptr = qWeakPointerCast<DerivedData>(baseptr);
QVERIFY(baseptr == derivedptr);
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QWeakPointer<Data> weakptr = baseptr;
@@ -870,16 +865,16 @@ void tst_QSharedPointer::upCast()
QVERIFY(baseptr == derivedptr);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QSharedPointer<DerivedData> derivedptr = baseptr.staticCast<DerivedData>();
QVERIFY(baseptr == derivedptr);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
}
class OtherObject: public QObject
@@ -893,6 +888,78 @@ void tst_QSharedPointer::qobjectWeakManagement()
QWeakPointer<QObject> weak;
weak = QWeakPointer<QObject>();
QVERIFY(weak.isNull());
+ QVERIFY(weak.toStrongRef().isNull());
+ }
+
+ {
+ QObject *obj = new QObject;
+ QSharedPointer<QObject> shared(obj);
+ QWeakPointer<QObject> weak(shared);
+ QVERIFY(!weak.isNull());
+ QVERIFY(weak.toStrongRef() == obj);
+
+ // now delete
+ shared.reset();
+ QVERIFY(weak.isNull());
+ }
+ safetyCheck();
+
+ {
+ // same, bit with operator=
+ QObject *obj = new QObject;
+ QSharedPointer<QObject> shared(obj);
+ QWeakPointer<QObject> weak;
+ weak = shared;
+ QVERIFY(!weak.isNull());
+ QVERIFY(weak.toStrongRef() == obj);
+
+ // now delete
+ shared.reset();
+ QVERIFY(weak.isNull());
+ }
+ safetyCheck();
+
+ {
+ // with two QWeakPointers
+ QObject *obj = new QObject;
+ QSharedPointer<QObject> shared(obj);
+ QWeakPointer<QObject> weak(shared);
+
+ {
+ QWeakPointer<QObject> weak2(shared);
+ QVERIFY(!weak2.isNull());
+ QVERIFY(weak == weak2);
+ }
+ QVERIFY(!weak.isNull());
+
+ shared.reset();
+ QVERIFY(weak.isNull());
+ }
+ safetyCheck();
+
+ {
+ // same, but delete the pointer while two QWeakPointers exist
+ QObject *obj = new QObject;
+ QSharedPointer<QObject> shared(obj);
+ QWeakPointer<QObject> weak(shared);
+
+ {
+ QWeakPointer<QObject> weak2(shared);
+ QVERIFY(!weak2.isNull());
+
+ shared.reset();
+ QVERIFY(weak.isNull());
+ QVERIFY(weak2.isNull());
+ }
+ QVERIFY(weak.isNull());
+ }
+ safetyCheck();
+
+#if QT_DEPRECATED_SINCE(5, 0)
+ {
+ QWeakPointer<QObject> weak;
+ weak = QWeakPointer<QObject>();
+ QVERIFY(weak.isNull());
QVERIFY(!weak.data());
}
@@ -983,8 +1050,10 @@ void tst_QSharedPointer::qobjectWeakManagement()
QVERIFY(weak.isNull());
}
safetyCheck();
+#endif
}
+#if QT_DEPRECATED_SINCE(5, 0)
void tst_QSharedPointer::noSharedPointerFromWeakQObject()
{
// you're not allowed to create a QSharedPointer from an unmanaged QObject
@@ -1018,18 +1087,32 @@ void tst_QSharedPointer::sharedPointerFromQObjectWithWeak()
}
QVERIFY(weak.isNull());
}
+#endif
void tst_QSharedPointer::weakQObjectFromSharedPointer()
{
- // this is the inverse of the above: you're allowed to create a QWeakPointer
- // from a managed QObject
- QSharedPointer<QObject> shared(new QObject);
- QWeakPointer<QObject> weak = shared.data();
- QVERIFY(!weak.isNull());
+#if QT_DEPRECATED_SINCE(5, 0)
+ {
+ // this is the inverse of the above: you're allowed to create a QWeakPointer
+ // from a managed QObject
+ QSharedPointer<QObject> shared(new QObject);
+ QWeakPointer<QObject> weak = shared.data();
+ QVERIFY(!weak.isNull());
- // delete:
- shared.clear();
- QVERIFY(weak.isNull());
+ // delete:
+ shared.clear();
+ QVERIFY(weak.isNull());
+ }
+#endif
+ {
+ QSharedPointer<QObject> shared(new QObject);
+ QWeakPointer<QObject> weak = shared;
+ QVERIFY(!weak.isNull());
+
+ // delete:
+ shared.clear();
+ QVERIFY(weak.isNull());
+ }
}
void tst_QSharedPointer::objectCast()
@@ -1126,6 +1209,60 @@ void tst_QSharedPointer::objectCast()
safetyCheck();
}
+
+void tst_QSharedPointer::objectCastStdSharedPtr()
+{
+ {
+ OtherObject *data = new OtherObject;
+ std::shared_ptr<QObject> baseptr = std::shared_ptr<QObject>(data);
+ QVERIFY(baseptr.get() == data);
+
+ // perform successful object cast
+ std::shared_ptr<OtherObject> ptr = qobject_pointer_cast<OtherObject>(baseptr);
+ QVERIFY(ptr.get());
+ QVERIFY(ptr.get() == data);
+
+ QVERIFY(baseptr.get() == data);
+ }
+
+ {
+ OtherObject *data = new OtherObject;
+ std::shared_ptr<QObject> baseptr = std::shared_ptr<QObject>(data);
+ QVERIFY(baseptr.get() == data);
+
+ // perform successful object cast
+ std::shared_ptr<OtherObject> ptr = qobject_pointer_cast<OtherObject>(std::move(baseptr));
+ QVERIFY(ptr.get());
+ QVERIFY(ptr.get() == data);
+
+ QVERIFY(!baseptr.get());
+ }
+
+ {
+ QObject *data = new QObject;
+ std::shared_ptr<QObject> baseptr = std::shared_ptr<QObject>(data);
+ QVERIFY(baseptr.get() == data);
+
+ // perform unsuccessful object cast
+ std::shared_ptr<OtherObject> ptr = qobject_pointer_cast<OtherObject>(baseptr);
+ QVERIFY(!ptr.get());
+
+ QVERIFY(baseptr.get() == data);
+ }
+
+ {
+ QObject *data = new QObject;
+ std::shared_ptr<QObject> baseptr = std::shared_ptr<QObject>(data);
+ QVERIFY(baseptr.get() == data);
+
+ // perform unsuccessful object cast
+ std::shared_ptr<OtherObject> ptr = qobject_pointer_cast<OtherObject>(std::move(baseptr));
+ QVERIFY(!ptr.get());
+
+ QVERIFY(baseptr.get() == data);
+ }
+}
+
void tst_QSharedPointer::differentPointers()
{
{
@@ -1254,8 +1391,8 @@ void tst_QSharedPointer::dynamicCast()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QWeakPointer<Data> weakptr = baseptr;
@@ -1264,8 +1401,8 @@ void tst_QSharedPointer::dynamicCast()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QSharedPointer<DerivedData> derivedptr = baseptr.dynamicCast<DerivedData>();
@@ -1273,8 +1410,8 @@ void tst_QSharedPointer::dynamicCast()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
}
void tst_QSharedPointer::dynamicCastDifferentPointers()
@@ -1289,8 +1426,8 @@ void tst_QSharedPointer::dynamicCastDifferentPointers()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QWeakPointer<Data> weakptr = baseptr;
@@ -1299,8 +1436,8 @@ void tst_QSharedPointer::dynamicCastDifferentPointers()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QSharedPointer<DiffPtrDerivedData> derivedptr = baseptr.dynamicCast<DiffPtrDerivedData>();
@@ -1308,8 +1445,8 @@ void tst_QSharedPointer::dynamicCastDifferentPointers()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
Stuffing *nakedptr = dynamic_cast<Stuffing *>(baseptr.data());
@@ -1334,8 +1471,8 @@ void tst_QSharedPointer::dynamicCastVirtualBase()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QWeakPointer<Data> weakptr = baseptr;
@@ -1344,8 +1481,8 @@ void tst_QSharedPointer::dynamicCastVirtualBase()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QSharedPointer<VirtualDerived> derivedptr = baseptr.dynamicCast<VirtualDerived>();
@@ -1353,8 +1490,8 @@ void tst_QSharedPointer::dynamicCastVirtualBase()
QCOMPARE(derivedptr.data(), aData);
QCOMPARE(static_cast<Data *>(derivedptr.data()), baseptr.data());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
}
void tst_QSharedPointer::dynamicCastFailure()
@@ -1366,15 +1503,15 @@ void tst_QSharedPointer::dynamicCastFailure()
QSharedPointer<DerivedData> derivedptr = qSharedPointerDynamicCast<DerivedData>(baseptr);
QVERIFY(derivedptr.isNull());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
{
QSharedPointer<DerivedData> derivedptr = baseptr.dynamicCast<DerivedData>();
QVERIFY(derivedptr.isNull());
}
- QCOMPARE(int(refCountData(baseptr)->weakref.load()), 1);
- QCOMPARE(int(refCountData(baseptr)->strongref.load()), 1);
+ QCOMPARE(int(refCountData(baseptr)->weakref.loadRelaxed()), 1);
+ QCOMPARE(int(refCountData(baseptr)->strongref.loadRelaxed()), 1);
}
void tst_QSharedPointer::dynamicCastFailureNoLeak()
@@ -1681,7 +1818,6 @@ void tst_QSharedPointer::customDeleter()
safetyCheck();
}
-#ifdef Q_COMPILER_LAMBDA
// The compiler needs to be in C++11 mode and to support lambdas
void tst_QSharedPointer::lambdaCustomDeleter()
{
@@ -1709,7 +1845,6 @@ void tst_QSharedPointer::lambdaCustomDeleter()
}
safetyCheck();
}
-#endif
void customQObjectDeleterFn(QObject *obj)
{
@@ -1745,8 +1880,8 @@ void tst_QSharedPointer::creating()
QCOMPARE(Data::destructorCounter, 1);
// valgrind will complain here if something happened to the pointer
- QVERIFY(d->weakref.load() == 1);
- QVERIFY(d->strongref.load() == 0);
+ QVERIFY(d->weakref.loadRelaxed() == 1);
+ QVERIFY(d->strongref.loadRelaxed() == 0);
}
safetyCheck();
@@ -1981,7 +2116,7 @@ void tst_QSharedPointer::threadStressTest()
for (int r = 0; r < 5; ++r) {
QVector<QThread*> allThreads(6 * qMax(strongThreadCount, weakThreadCount) + 3, 0);
QSharedPointer<ThreadData> base = QSharedPointer<ThreadData>(new ThreadData(&counter));
- counter.store(0);
+ counter.storeRelaxed(0);
// set the pointers
for (int i = 0; i < strongThreadCount; ++i) {
@@ -2015,8 +2150,8 @@ void tst_QSharedPointer::threadStressTest()
// verify that the count is the right range
int minValue = strongThreadCount;
int maxValue = strongThreadCount + weakThreadCount;
- QVERIFY(counter.load() >= minValue);
- QVERIFY(counter.load() <= maxValue);
+ QVERIFY(counter.loadRelaxed() >= minValue);
+ QVERIFY(counter.loadRelaxed() <= maxValue);
}
}
@@ -2249,11 +2384,9 @@ void tst_QSharedPointer::invalidConstructs_data()
<< &QTest::QExternalTest::tryCompileFail
<< "struct IncompatibleCustomDeleter { void operator()(int *); };\n"
"QSharedPointer<Data> ptr(new Data, IncompatibleCustomDeleter());\n";
-#ifdef Q_COMPILER_LAMBDA
QTest::newRow("incompatible-custom-lambda-deleter")
<< &QTest::QExternalTest::tryCompileFail
<< "QSharedPointer<Data> ptr(new Data, [](int *) {});\n";
-#endif
QTest::newRow("incompatible-overload")
<< &QTest::QExternalTest::tryCompileFail
@@ -2342,6 +2475,7 @@ void tst_QSharedPointer::qvariantCast()
// Intentionally does not compile.
// QSharedPointer<int> sop = qSharedPointerFromVariant<int>(v);
+#if QT_DEPRECATED_SINCE(5, 0)
v = QVariant::fromValue(sp.toWeakRef());
{
@@ -2385,6 +2519,7 @@ void tst_QSharedPointer::qvariantCast()
QWeakPointer<QThread> other = qWeakPointerFromVariant<QThread>(v);
QVERIFY(!other);
}
+#endif
}
class SomeClass : public QEnableSharedFromThis<SomeClass>
diff --git a/tests/auto/corelib/tools/qsize/tst_qsize.cpp b/tests/auto/corelib/tools/qsize/tst_qsize.cpp
index 385ff18ce5..6824bad9c8 100644
--- a/tests/auto/corelib/tools/qsize/tst_qsize.cpp
+++ b/tests/auto/corelib/tools/qsize/tst_qsize.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <qsize.h>
+Q_DECLARE_METATYPE(QMargins)
class tst_QSize : public QObject
{
@@ -43,6 +44,9 @@ private slots:
void boundedTo_data();
void boundedTo();
+ void grownOrShrunkBy_data();
+ void grownOrShrunkBy();
+
void transpose_data();
void transpose();
};
@@ -186,6 +190,46 @@ void tst_QSize::boundedTo()
QCOMPARE( input1.boundedTo(input2), expected);
}
+void tst_QSize::grownOrShrunkBy_data()
+{
+ QTest::addColumn<QSize>("input");
+ QTest::addColumn<QMargins>("margins");
+ QTest::addColumn<QSize>("grown");
+ QTest::addColumn<QSize>("shrunk");
+
+ auto row = [](QSize i, QMargins m, QSize g, QSize s) {
+ QTest::addRow("{%d,%d}/{%d,%d,%d,%d}", i.width(), i.height(),
+ m.left(), m.top(), m.right(), m.bottom())
+ << i << m << g << s;
+ };
+
+ const QSize zero = {0, 0};
+ const QSize some = {100, 200};
+ const QMargins zeroMargins = {};
+ const QMargins negative = {-1, -2, -3, -4};
+ const QMargins positive = { 1, 2, 3, 4};
+
+ row(zero, zeroMargins, zero, zero);
+ row(zero, negative, {-4, -6}, { 4, 6});
+ row(zero, positive, { 4, 6}, {-4, -6});
+ row(some, zeroMargins, some, some);
+ row(some, negative, { 96, 194}, {104, 206});
+ row(some, positive, {104, 206}, { 96, 194});
+}
+
+void tst_QSize::grownOrShrunkBy()
+{
+ QFETCH(const QSize, input);
+ QFETCH(const QMargins, margins);
+ QFETCH(const QSize, grown);
+ QFETCH(const QSize, shrunk);
+
+ QCOMPARE(input.grownBy(margins), grown);
+ QCOMPARE(input.shrunkBy(margins), shrunk);
+ QCOMPARE(grown.shrunkBy(margins), input);
+ QCOMPARE(shrunk.grownBy(margins), input);
+}
+
void tst_QSize::transpose_data()
{
QTest::addColumn<QSize>("input1");
diff --git a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
index 42801d63a9..bbffa74a62 100644
--- a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
+++ b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <qsize.h>
+Q_DECLARE_METATYPE(QMarginsF)
class tst_QSizeF : public QObject
{
@@ -45,6 +46,9 @@ private slots:
void boundedTo_data();
void boundedTo();
+ void grownOrShrunkBy_data();
+ void grownOrShrunkBy();
+
void transpose_data();
void transpose();
};
@@ -152,6 +156,46 @@ void tst_QSizeF::boundedTo() {
QCOMPARE( input1.boundedTo(input2), expected);
}
+void tst_QSizeF::grownOrShrunkBy_data()
+{
+ QTest::addColumn<QSizeF>("input");
+ QTest::addColumn<QMarginsF>("margins");
+ QTest::addColumn<QSizeF>("grown");
+ QTest::addColumn<QSizeF>("shrunk");
+
+ auto row = [](QSizeF i, QMarginsF m, QSizeF g, QSizeF s) {
+ QTest::addRow("{%g,%g}/{%g,%g,%g,%g}", i.width(), i.height(),
+ m.left(), m.top(), m.right(), m.bottom())
+ << i << m << g << s;
+ };
+
+ const QSizeF zero = {0, 0};
+ const QSizeF some = {100, 200};
+ const QMarginsF zeroMargins = {};
+ const QMarginsF negative = {-1, -2, -3, -4};
+ const QMarginsF positive = { 1, 2, 3, 4};
+
+ row(zero, zeroMargins, zero, zero);
+ row(zero, negative, {-4, -6}, { 4, 6});
+ row(zero, positive, { 4, 6}, {-4, -6});
+ row(some, zeroMargins, some, some);
+ row(some, negative, { 96, 194}, {104, 206});
+ row(some, positive, {104, 206}, { 96, 194});
+}
+
+void tst_QSizeF::grownOrShrunkBy()
+{
+ QFETCH(const QSizeF, input);
+ QFETCH(const QMarginsF, margins);
+ QFETCH(const QSizeF, grown);
+ QFETCH(const QSizeF, shrunk);
+
+ QCOMPARE(input.grownBy(margins), grown);
+ QCOMPARE(input.shrunkBy(margins), shrunk);
+ QCOMPARE(grown.shrunkBy(margins), input);
+ QCOMPARE(shrunk.grownBy(margins), input);
+}
+
void tst_QSizeF::transpose_data() {
QTest::addColumn<QSizeF>("input1");
QTest::addColumn<QSizeF>("expected");
diff --git a/tests/auto/corelib/tools/qtimeline/BLACKLIST b/tests/auto/corelib/tools/qtimeline/BLACKLIST
index 5611969b4d..9794b0059f 100644
--- a/tests/auto/corelib/tools/qtimeline/BLACKLIST
+++ b/tests/auto/corelib/tools/qtimeline/BLACKLIST
@@ -1,9 +1,7 @@
[interpolation]
-windows
-osx-10.12
-osx-10.13
-[duration]
-windows
+windows-10 msvc-2015
+osx
[frameRate]
osx-10.12
osx-10.13
+
diff --git a/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro b/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro
index 108fb33db5..14b2bc213b 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro
+++ b/tests/auto/corelib/tools/qvarlengtharray/qvarlengtharray.pro
@@ -1,4 +1,6 @@
CONFIG += testcase
TARGET = tst_qvarlengtharray
QT = core testlib
+qtConfig(c++14): CONFIG += c++14
+qtConfig(c++1z): CONFIG += c++1z
SOURCES = tst_qvarlengtharray.cpp
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
index 5737db760c..a1d0100f96 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -44,6 +44,7 @@ private slots:
void realloc();
void reverseIterators();
void count();
+ void cpp17ctad();
void first();
void last();
void squeeze();
@@ -57,27 +58,28 @@ private slots:
void initializeListComplex();
void insertMove();
void nonCopyable();
+ void implicitDefaultCtor();
private:
template<typename T>
void initializeList();
};
-int fooCtor = 0;
-int fooDtor = 0;
-
-struct Foo
+struct Tracker
{
- int *p;
-
- Foo() { p = new int; ++fooCtor; }
- Foo(const Foo &/*other*/) { p = new int; ++fooCtor; }
+ static int count;
+ Tracker() { ++count; }
+ Tracker(const Tracker &) { ++count; }
+ Tracker(Tracker &&) { ++count; }
- void operator=(const Foo & /* other */) { }
+ Tracker &operator=(const Tracker &) = default;
+ Tracker &operator=(Tracker &&) = default;
- ~Foo() { delete p; ++fooDtor; }
+ ~Tracker() { --count; }
};
+int Tracker::count = 0;
+
void tst_QVarLengthArray::append()
{
QVarLengthArray<QString, 2> v;
@@ -129,6 +131,23 @@ void tst_QVarLengthArray::removeLast()
v.removeLast();
QCOMPARE(v.size(), 2);
}
+
+ {
+ Tracker t;
+ QCOMPARE(Tracker::count, 1);
+ QVarLengthArray<Tracker, 2> v;
+ v.append(t);
+ v.append({});
+ QCOMPARE(Tracker::count, 3);
+ v.removeLast();
+ QCOMPARE(Tracker::count, 2);
+ v.append(t);
+ v.append({});
+ QCOMPARE(Tracker::count, 4);
+ v.removeLast();
+ QCOMPARE(Tracker::count, 3);
+ }
+ QCOMPARE(Tracker::count, 0);
}
void tst_QVarLengthArray::oldTests()
@@ -699,6 +718,34 @@ void tst_QVarLengthArray::count()
}
}
+void tst_QVarLengthArray::cpp17ctad()
+{
+#ifdef __cpp_deduction_guides
+#define QVERIFY_IS_VLA_OF(obj, Type) \
+ QVERIFY2((std::is_same<decltype(obj), QVarLengthArray<Type>>::value), \
+ QMetaType::typeName(qMetaTypeId<decltype(obj)::value_type>()))
+#define CHECK(Type, One, Two, Three) \
+ do { \
+ const Type v[] = {One, Two, Three}; \
+ QVarLengthArray v1 = {One, Two, Three}; \
+ QVERIFY_IS_VLA_OF(v1, Type); \
+ QVarLengthArray v2(v1.begin(), v1.end()); \
+ QVERIFY_IS_VLA_OF(v2, Type); \
+ QVarLengthArray v3(std::begin(v), std::end(v)); \
+ QVERIFY_IS_VLA_OF(v3, Type); \
+ } while (false) \
+ /*end*/
+ CHECK(int, 1, 2, 3);
+ CHECK(double, 1.0, 2.0, 3.0);
+ CHECK(QString, QStringLiteral("one"), QStringLiteral("two"), QStringLiteral("three"));
+#undef QVERIFY_IS_VLA_OF
+#undef CHECK
+#else
+ QSKIP("This test requires C++17 Constructor Template Argument Deduction support enabled in the compiler.");
+#endif
+
+}
+
void tst_QVarLengthArray::first()
{
// append some items, make sure it stays sane
@@ -908,7 +955,6 @@ void tst_QVarLengthArray::initializeListComplex()
template<typename T>
void tst_QVarLengthArray::initializeList()
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
T val1(110);
T val2(105);
T val3(101);
@@ -945,9 +991,6 @@ void tst_QVarLengthArray::initializeList()
v6 = {}; // assign empty
QCOMPARE(v6.size(), 0);
-#else
- QSKIP("This tests requires a compiler that supports initializer lists.");
-#endif
}
void tst_QVarLengthArray::insertMove()
@@ -1082,5 +1125,11 @@ void tst_QVarLengthArray::nonCopyable()
QVERIFY(ptr6 == vec.at(5).get());
}
+void tst_QVarLengthArray::implicitDefaultCtor()
+{
+ QVarLengthArray<int> def = {};
+ QCOMPARE(def.size(), 0);
+}
+
QTEST_APPLESS_MAIN(tst_QVarLengthArray)
#include "tst_qvarlengtharray.moc"
diff --git a/tests/auto/corelib/tools/qvector/qvector.pro b/tests/auto/corelib/tools/qvector/qvector.pro
index b9a4ae747b..689d9b87a2 100644
--- a/tests/auto/corelib/tools/qvector/qvector.pro
+++ b/tests/auto/corelib/tools/qvector/qvector.pro
@@ -1,5 +1,7 @@
CONFIG += testcase
qtConfig(c++11): CONFIG += c++11
+qtConfig(c++14): CONFIG += c++14
+qtConfig(c++1z): CONFIG += c++1z
TARGET = tst_qvector
QT = core testlib
SOURCES = $$PWD/tst_qvector.cpp
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 383318979d..08d5a8cd50 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -206,6 +206,9 @@ private slots:
void assignmentInt() const;
void assignmentMovable() const;
void assignmentCustom() const;
+ void assignFromInitializerListInt() const;
+ void assignFromInitializerListMovable() const;
+ void assignFromInitializerListCustom() const;
void addInt() const;
void addMovable() const;
void addCustom() const;
@@ -227,6 +230,7 @@ private slots:
void countInt() const;
void countMovable() const;
void countCustom() const;
+ void cpp17ctad() const;
void data() const;
void emptyInt() const;
void emptyMovable() const;
@@ -255,7 +259,6 @@ private slots:
void fromListInt() const;
void fromListMovable() const;
void fromListCustom() const;
- void fromStdVector() const;
void indexOf() const;
void insertInt() const;
void insertMovable() const;
@@ -294,7 +297,10 @@ private slots:
void swapMovable() const;
void swapCustom() const;
void toList() const;
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
+ void fromStdVector() const;
void toStdVector() const;
+#endif
void value() const;
void testOperators() const;
@@ -327,10 +333,13 @@ private slots:
void insertMove() const;
+ void swapItemsAt() const;
+
private:
template<typename T> void copyConstructor() const;
template<typename T> void add() const;
template<typename T> void append() const;
+ template<typename T> void assignFromInitializerList() const;
template<typename T> void capacity() const;
template<typename T> void clear() const;
template<typename T> void count() const;
@@ -544,6 +553,40 @@ void tst_QVector::assignmentCustom() const
}
template<typename T>
+void tst_QVector::assignFromInitializerList() const
+{
+ T val1(SimpleValue<T>::at(1));
+ T val2(SimpleValue<T>::at(2));
+ T val3(SimpleValue<T>::at(3));
+
+ QVector<T> v1 = {val1, val2, val3};
+ QCOMPARE(v1, QVector<T>() << val1 << val2 << val3);
+ QCOMPARE(v1, (QVector<T> {val1, val2, val3}));
+
+ v1 = {};
+ QCOMPARE(v1.size(), 0);
+}
+
+void tst_QVector::assignFromInitializerListInt() const
+{
+ assignFromInitializerList<int>();
+}
+
+void tst_QVector::assignFromInitializerListMovable() const
+{
+ const int instancesCount = Movable::counter.loadAcquire();
+ assignFromInitializerList<Movable>();
+ QCOMPARE(instancesCount, Movable::counter.loadAcquire());
+}
+
+void tst_QVector::assignFromInitializerListCustom() const
+{
+ const int instancesCount = Custom::counter.loadAcquire();
+ assignFromInitializerList<Custom>();
+ QCOMPARE(instancesCount, Custom::counter.loadAcquire());
+}
+
+template<typename T>
void tst_QVector::add() const
{
{
@@ -668,7 +711,6 @@ void tst_QVector::appendCustom() const
void tst_QVector::appendRvalue() const
{
-#ifdef Q_COMPILER_RVALUE_REFS
QVector<QString> v;
v.append("hello");
QString world = "world";
@@ -676,9 +718,6 @@ void tst_QVector::appendRvalue() const
QVERIFY(world.isEmpty());
QCOMPARE(v.front(), QString("hello"));
QCOMPARE(v.back(), QString("world"));
-#else
- QSKIP("This test requires that C++11 move semantics support is enabled in the compiler");
-#endif
}
void tst_QVector::at() const
@@ -876,6 +915,33 @@ void tst_QVector::countCustom() const
QCOMPARE(instancesCount, Custom::counter.loadAcquire());
}
+void tst_QVector::cpp17ctad() const
+{
+#ifdef __cpp_deduction_guides
+#define QVERIFY_IS_VECTOR_OF(obj, Type) \
+ QVERIFY2((std::is_same<decltype(obj), QVector<Type>>::value), \
+ QMetaType::typeName(qMetaTypeId<decltype(obj)::value_type>()))
+#define CHECK(Type, One, Two, Three) \
+ do { \
+ const Type v[] = {One, Two, Three}; \
+ QVector v1 = {One, Two, Three}; \
+ QVERIFY_IS_VECTOR_OF(v1, Type); \
+ QVector v2(v1.begin(), v1.end()); \
+ QVERIFY_IS_VECTOR_OF(v2, Type); \
+ QVector v3(std::begin(v), std::end(v)); \
+ QVERIFY_IS_VECTOR_OF(v3, Type); \
+ } while (false) \
+ /*end*/
+ CHECK(int, 1, 2, 3);
+ CHECK(double, 1.0, 2.0, 3.0);
+ CHECK(QString, QStringLiteral("one"), QStringLiteral("two"), QStringLiteral("three"));
+#undef QVERIFY_IS_VECTOR_OF
+#undef CHECK
+#else
+ QSKIP("This test requires C++17 Constructor Template Argument Deduction support enabled in the compiler.");
+#endif
+}
+
void tst_QVector::data() const
{
QVector<int> myvec;
@@ -1403,6 +1469,7 @@ void tst_QVector::fromListCustom() const
QCOMPARE(instancesCount, Custom::counter.loadAcquire());
}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
void tst_QVector::fromStdVector() const
{
// stl = :(
@@ -1416,6 +1483,7 @@ void tst_QVector::fromStdVector() const
// test it converts ok
QCOMPARE(myvec, QVector<QString>() << "aaa" << "bbb" << "ninjas" << "pirates");
}
+#endif
void tst_QVector::indexOf() const
{
@@ -2308,6 +2376,7 @@ void tst_QVector::toList() const
QCOMPARE(myvec, QVector<QString>() << "A" << "B" << "C");
}
+#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
void tst_QVector::toStdVector() const
{
QVector<QString> myvec;
@@ -2320,6 +2389,7 @@ void tst_QVector::toStdVector() const
QCOMPARE(myvec, QVector<QString>() << "A" << "B" << "C");
}
+#endif
void tst_QVector::value() const
{
@@ -2526,7 +2596,6 @@ void tst_QVector::reallocAfterCopy()
template<typename T>
void tst_QVector::initializeList()
{
-#ifdef Q_COMPILER_INITIALIZER_LISTS
T val1(SimpleValue<T>::at(1));
T val2(SimpleValue<T>::at(2));
T val3(SimpleValue<T>::at(3));
@@ -2543,7 +2612,6 @@ void tst_QVector::initializeList()
QVector<T> v4({});
QCOMPARE(v4.size(), 0);
-#endif
}
void tst_QVector::initializeListInt()
@@ -2853,7 +2921,7 @@ void tst_QVector::detachThreadSafety() const
struct : QThread {
void run() override
{
- QVector<T> copy(*detachThreadSafetyData<T>()->load());
+ QVector<T> copy(*detachThreadSafetyData<T>()->loadRelaxed());
QVERIFY(!copy.isDetached());
detachThreadSafetyLock.release();
detachThreadSafetyLock.acquire(100);
@@ -2963,5 +3031,22 @@ void tst_QVector::insertMove() const
QCOMPARE(Movable::counter.loadAcquire(), instancesCount);
}
+void tst_QVector::swapItemsAt() const
+{
+ QVector<int> v;
+ v << 0 << 1 << 2 << 3;
+
+ v.swapItemsAt(0, 2);
+ QCOMPARE(v.at(0), 2);
+ QCOMPARE(v.at(2), 0);
+
+ auto copy = v;
+ copy.swapItemsAt(0, 2);
+ QCOMPARE(v.at(0), 2);
+ QCOMPARE(v.at(2), 0);
+ QCOMPARE(copy.at(0), 0);
+ QCOMPARE(copy.at(2), 2);
+}
+
QTEST_MAIN(tst_QVector)
#include "tst_qvector.moc"
diff --git a/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp b/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
index 05579dce6e..7c4d1071ce 100644
--- a/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
+++ b/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
@@ -260,12 +260,10 @@ void tst_QVersionNumber::constructorExplicit()
QCOMPARE(v5.segments(), v6.segments());
-#ifdef Q_COMPILER_INITIALIZER_LISTS
QVersionNumber v7(4, 5, 6);
QVersionNumber v8 = {4, 5, 6};
QCOMPARE(v7.segments(), v8.segments());
-#endif
}
void tst_QVersionNumber::constructorCopy_data()
@@ -436,7 +434,7 @@ void tst_QVersionNumber::normalized()
QFETCH(QVersionNumber, expected);
QCOMPARE(version.normalized(), expected);
- QCOMPARE(qMove(version).normalized(), expected);
+ QCOMPARE(std::move(version).normalized(), expected);
}
void tst_QVersionNumber::isNormalized_data()
@@ -586,30 +584,28 @@ void tst_QVersionNumber::serialize()
void tst_QVersionNumber::moveSemantics()
{
-#ifdef Q_COMPILER_RVALUE_REFS
// QVersionNumber(QVersionNumber &&)
{
QVersionNumber v1(1, 2, 3);
- QVersionNumber v2 = qMove(v1);
+ QVersionNumber v2 = std::move(v1);
QCOMPARE(v2, QVersionNumber(1, 2, 3));
}
// QVersionNumber &operator=(QVersionNumber &&)
{
QVersionNumber v1(1, 2, 3);
QVersionNumber v2;
- v2 = qMove(v1);
+ v2 = std::move(v1);
QCOMPARE(v2, QVersionNumber(1, 2, 3));
}
// QVersionNumber(QVector<int> &&)
{
QVector<int> segments = QVector<int>() << 1 << 2 << 3;
QVersionNumber v1(segments);
- QVersionNumber v2(qMove(segments));
+ QVersionNumber v2(std::move(segments));
QVERIFY(!v1.isNull());
QVERIFY(!v2.isNull());
QCOMPARE(v1, v2);
}
-#endif
#ifdef Q_COMPILER_REF_QUALIFIERS
// normalized()
{
@@ -620,7 +616,7 @@ void tst_QVersionNumber::moveSemantics()
QVERIFY(!v.isNull());
QVERIFY(!nv.isNull());
QVERIFY(nv.isNormalized());
- nv = qMove(v).normalized();
+ nv = std::move(v).normalized();
QVERIFY(!nv.isNull());
QVERIFY(nv.isNormalized());
}
@@ -632,13 +628,10 @@ void tst_QVersionNumber::moveSemantics()
segments = v.segments();
QVERIFY(!v.isNull());
QVERIFY(!segments.empty());
- segments = qMove(v).segments();
+ segments = std::move(v).segments();
QVERIFY(!segments.empty());
}
#endif
-#if !defined(Q_COMPILER_RVALUE_REFS) && !defined(Q_COMPILER_REF_QUALIFIERS)
- QSKIP("This test requires C++11 move semantics support in the compiler.");
-#endif
}
void tst_QVersionNumber::qtVersion()
diff --git a/tests/auto/corelib/tools/tools.pro b/tests/auto/corelib/tools/tools.pro
index 2a975e67d1..49b2a1f075 100644
--- a/tests/auto/corelib/tools/tools.pro
+++ b/tests/auto/corelib/tools/tools.pro
@@ -6,30 +6,20 @@ SUBDIRS=\
qarraydata \
qarraydata_strictiterators \
qbitarray \
- qbytearray \
- qbytearraylist \
- qbytearraymatcher \
- qbytedatabuffer \
qcache \
- qchar \
- qcollator \
qcommandlineparser \
qcontiguouscache \
qcryptographichash \
- qdate \
- qdatetime \
qeasingcurve \
qexplicitlyshareddatapointer \
qfreelist \
qhash \
qhash_strictiterators \
qhashfunctions \
- qlatin1string \
qline \
qlinkedlist \
qlist \
qlist_strictiterators \
- qlocale \
qmakearray \
qmap \
qmap_strictiterators \
@@ -41,28 +31,15 @@ SUBDIRS=\
qpointf \
qqueue \
qrect \
- qregexp \
- qregularexpression \
qringbuffer \
qscopedpointer \
qscopedvaluerollback \
+ qscopeguard \
qset \
qsharedpointer \
qsize \
qsizef \
qstl \
- qstring \
- qstring_no_cast_from_bytearray \
- qstringapisymmetry \
- qstringbuilder \
- qstringiterator \
- qstringlist \
- qstringmatcher \
- qstringref \
- qstringview \
- qtextboundaryfinder \
- qtime \
- qtimezone \
qtimeline \
qvarlengtharray \
qvector \
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/BLACKLIST
diff --git a/tests/auto/dbus/qdbusconnection_spyhook/BLACKLIST b/tests/auto/dbus/qdbusconnection_spyhook/BLACKLIST
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_spyhook/BLACKLIST
diff --git a/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp b/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
index 018b7c2a35..b4690268c8 100644
--- a/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
+++ b/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
@@ -197,8 +197,8 @@ tst_QDBusThreading::tst_QDBusThreading()
void tst_QDBusThreading::joinThreads()
{
- threadJoin.acquire(threadJoinCount.load());
- threadJoinCount.store(0);
+ threadJoin.acquire(threadJoinCount.loadRelaxed());
+ threadJoinCount.storeRelaxed(0);
}
bool tst_QDBusThreading::waitForSignal(QObject *obj, const char *signal, int delay)
diff --git a/tests/auto/gui/gui.pro b/tests/auto/gui/gui.pro
index e0c8123f26..c90fc48251 100644
--- a/tests/auto/gui/gui.pro
+++ b/tests/auto/gui/gui.pro
@@ -13,6 +13,7 @@ SUBDIRS = \
text \
util \
itemmodels \
+ rhi
!qtConfig(opengl)|winrt: SUBDIRS -= qopengl qopenglconfig
diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
index 2dbb078ae0..fe12175081 100644
--- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
+++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
@@ -164,7 +164,7 @@ void tst_QIcoImageFormat::imageCount_data()
QTest::newRow("16px,32px - 16 colors") << "valid/TIMER01.ICO" << 2;
QTest::newRow("16px16c, 32px32c, 32px256c 1") << "valid/WORLD.ico" << 3;
QTest::newRow("16px16c, 32px32c, 32px256c 2") << "valid/WORLDH.ico" << 3;
- QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << 0;
+ QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << -1;
QTest::newRow("includes 32BPP w/alpha") << "valid/semitransparent.ico" << 9;
QTest::newRow("PNG compression") << "valid/Qt.ico" << 4;
QTest::newRow("CUR file") << "valid/yellow.cur" << 1;
@@ -177,7 +177,6 @@ void tst_QIcoImageFormat::imageCount()
QImageReader reader(m_IconPath + QLatin1Char('/') + fileName);
QCOMPARE(reader.imageCount(), count);
-
}
void tst_QIcoImageFormat::jumpToNextImage_data()
@@ -218,7 +217,7 @@ void tst_QIcoImageFormat::loopCount_data()
QTest::addColumn<int>("count");
QTest::newRow("floppy (16px,32px - 16 colors)") << "valid/35FLOPPY.ICO" << 0;
- QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << 0;
+ QTest::newRow("invalid floppy (first 8 bytes = 0xff)") << "invalid/35floppy.ico" << -1;
}
void tst_QIcoImageFormat::loopCount()
@@ -228,6 +227,7 @@ void tst_QIcoImageFormat::loopCount()
QImageReader reader(m_IconPath + QLatin1Char('/') + fileName);
QCOMPARE(reader.loopCount(), count);
+ QCOMPARE(reader.canRead(), count < 0 ? false : true);
}
void tst_QIcoImageFormat::nextImageDelay_data()
@@ -256,7 +256,7 @@ void tst_QIcoImageFormat::nextImageDelay()
QImageReader reader(m_IconPath + QLatin1Char('/') + fileName);
if (count == -1) {
- QCOMPARE(reader.nextImageDelay(), 0);
+ QCOMPARE(reader.nextImageDelay(), -1);
} else {
int i;
for (i = 0; i < count; i++) {
diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro
index b40866892e..0593cfbc23 100644
--- a/tests/auto/gui/image/qimage/qimage.pro
+++ b/tests/auto/gui/image/qimage/qimage.pro
@@ -7,7 +7,7 @@ qtConfig(c++11): CONFIG += c++11
android:!android-embedded: RESOURCES += qimage.qrc
-win32:!winrt: LIBS += -lgdi32 -luser32
+win32:!winrt: QMAKE_USE += user32 gdi32
darwin: LIBS += -framework CoreGraphics
TESTDATA += images/*
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 4d41b5e873..e9aa9aad30 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -303,6 +303,8 @@ static QLatin1String formatToString(QImage::Format format)
return QLatin1String("RGBA64pm");
case QImage::Format_Grayscale16:
return QLatin1String("Grayscale16");
+ case QImage::Format_BGR888:
+ return QLatin1String("BGR888");
default:
break;
};
@@ -844,6 +846,13 @@ void tst_QImage::convertToFormat_data()
QTest::newRow("blue rgb32 -> rgb888") << int(QImage::Format_RGB32) << 0xff0000ff
<< int(QImage::Format_RGB888) << 0xff0000ff;
+ QTest::newRow("red rgb32 -> bgr888") << int(QImage::Format_RGB32) << 0xffff0000
+ << int(QImage::Format_BGR888) << 0xffff0000;
+ QTest::newRow("green rgb32 -> bgr888") << int(QImage::Format_RGB32) << 0xff00ff00
+ << int(QImage::Format_BGR888) << 0xff00ff00;
+ QTest::newRow("blue rgb32 -> bgr888") << int(QImage::Format_RGB32) << 0xff0000ff
+ << int(QImage::Format_BGR888) << 0xff0000ff;
+
QTest::newRow("red rgb16 -> rgb888") << int(QImage::Format_RGB16) << 0xffff0000
<< int(QImage::Format_RGB888) << 0xffff0000;
QTest::newRow("green rgb16 -> rgb888") << int(QImage::Format_RGB16) << 0xff00ff00
@@ -858,6 +867,13 @@ void tst_QImage::convertToFormat_data()
QTest::newRow("blue rgb888 -> argb32") << int(QImage::Format_RGB888) << 0xff0000ff
<< int(QImage::Format_ARGB32) << 0xff0000ff;
+ QTest::newRow("red bgr888 -> argb32") << int(QImage::Format_RGB888) << 0xffff0000
+ << int(QImage::Format_ARGB32) << 0xffff0000;
+ QTest::newRow("green bgr888 -> argb32") << int(QImage::Format_RGB888) << 0xff00ff00
+ << int(QImage::Format_ARGB32) << 0xff00ff00;
+ QTest::newRow("blue bgr888 -> argb32") << int(QImage::Format_RGB888) << 0xff0000ff
+ << int(QImage::Format_ARGB32) << 0xff0000ff;
+
QTest::newRow("red rgb888 -> rgbx8888") << int(QImage::Format_RGB888) << 0xffff0000
<< int(QImage::Format_RGBX8888) << 0xffff0000;
QTest::newRow("green rgb888 -> rgbx8888") << int(QImage::Format_RGB888) << 0xff00ff00
@@ -908,6 +924,9 @@ void tst_QImage::convertToFormat_data()
QTest::newRow("blue rgb30 -> argb32") << int(QImage::Format_RGB30) << 0xff0000ff
<< int(QImage::Format_ARGB32) << 0xff0000ff;
+ QTest::newRow("semigray argb32 -> a2rgb30 pm") << int(QImage::Format_ARGB32) << 0x4c646565u
+ << int(QImage::Format_A2RGB30_Premultiplied) << 0x55212222u;
+
QTest::newRow("white gray8 -> argb pm") << int(QImage::Format_Grayscale8) << 0xfffffeffu
<< int(QImage::Format_ARGB32_Premultiplied) << 0xfffefefeu;
QTest::newRow("gray gray8 -> argb pm") << int(QImage::Format_Grayscale8) << 0xff565557u
@@ -1338,6 +1357,12 @@ void tst_QImage::setPixel_data()
<< 0xff00ff00 << 0x00ff00u;
QTest::newRow("RGB888 blue") << int(QImage::Format_RGB888)
<< 0xff0000ff << 0x0000ffu;
+ QTest::newRow("BGR888 red") << int(QImage::Format_BGR888)
+ << 0xffff0000 << 0x0000ffu;
+ QTest::newRow("BGR888 green") << int(QImage::Format_BGR888)
+ << 0xff00ff00 << 0x00ff00u;
+ QTest::newRow("BGR888 blue") << int(QImage::Format_BGR888)
+ << 0xff0000ff << 0xff0000u;
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
QTest::newRow("RGBA8888 red") << int(QImage::Format_RGBA8888)
<< 0xffff0000u << 0xff0000ffu;
@@ -1425,6 +1450,7 @@ void tst_QImage::setPixel()
case int(QImage::Format_ARGB8565_Premultiplied):
case int(QImage::Format_ARGB8555_Premultiplied):
case int(QImage::Format_RGB888):
+ case int(QImage::Format_BGR888):
{
for (int y = 0; y < h; ++y) {
const quint24 *row = (const quint24*)(img.scanLine(y));
@@ -1852,7 +1878,9 @@ void tst_QImage::smoothScale4_data()
QTest::addColumn<QImage::Format>("format");
QTest::newRow("RGB32") << QImage::Format_RGB32;
+#if QT_CONFIG(raster_64bit)
QTest::newRow("RGBx64") << QImage::Format_RGBX64;
+#endif
}
void tst_QImage::smoothScale4()
@@ -2107,6 +2135,12 @@ void tst_QImage::paintEngine()
QCOMPARE(engine, img.paintEngine());
QCOMPARE(img, expected);
+
+ {
+ QImage img1(16, 16, QImage::Format_ARGB32);
+ QImage img2 = img1;
+ QVERIFY(img2.paintEngine());
+ }
}
void tst_QImage::setAlphaChannelWhilePainting()
@@ -2443,6 +2477,7 @@ void tst_QImage::mirrored_data()
QTest::newRow("Format_RGB555, vertical") << QImage::Format_RGB555 << true << false << 16 << 16;
QTest::newRow("Format_ARGB8555_Premultiplied, vertical") << QImage::Format_ARGB8555_Premultiplied << true << false << 16 << 16;
QTest::newRow("Format_RGB888, vertical") << QImage::Format_RGB888 << true << false << 16 << 16;
+ QTest::newRow("Format_BGR888, vertical") << QImage::Format_BGR888 << true << false << 16 << 16;
QTest::newRow("Format_RGB444, vertical") << QImage::Format_RGB444 << true << false << 16 << 16;
QTest::newRow("Format_RGBX8888, vertical") << QImage::Format_RGBX8888 << true << false << 16 << 16;
QTest::newRow("Format_RGBA8888_Premultiplied, vertical") << QImage::Format_RGBA8888_Premultiplied << true << false << 16 << 16;
@@ -3403,7 +3438,7 @@ void tst_QImage::ditherGradient_data()
QTest::newRow("rgb32 -> rgb666 (dithering)") << rgb32 << QImage::Format_RGB666 << int(Qt::PreferDither | Qt::OrderedDither) << 129;
// Test we get the same results for opaque input in the ARGBPM implementation.
- rgb32 = qMove(rgb32).convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ rgb32 = std::move(rgb32).convertToFormat(QImage::Format_ARGB32_Premultiplied);
QTest::newRow("argb32pm -> argb4444pm (no dither)") << rgb32 << QImage::Format_ARGB4444_Premultiplied << 0 << 16;
QTest::newRow("argb32pm -> rgb444 (dithering)") << rgb32 << QImage::Format_RGB444 << int(Qt::PreferDither | Qt::OrderedDither) << 33;
QTest::newRow("argb32pm -> argb4444pm (dithering)") << rgb32 << QImage::Format_ARGB4444_Premultiplied << int(Qt::PreferDither | Qt::OrderedDither) << 33;
@@ -3412,6 +3447,7 @@ void tst_QImage::ditherGradient_data()
QTest::newRow("argb32pm -> argb6666pm (no dither)") << rgb32 << QImage::Format_ARGB6666_Premultiplied << 0 << 64;
QTest::newRow("argb32pm -> argb6666pm (dithering)") << rgb32 << QImage::Format_ARGB6666_Premultiplied << int(Qt::PreferDither | Qt::OrderedDither) << 129;
+#if QT_CONFIG(raster_64bit)
QImage rgb30(1024, 16, QImage::Format_RGB30);
QLinearGradient gradient30(QRectF(rgb30.rect()).topLeft(), QRectF(rgb30.rect()).topRight());
gradient30.setColorAt(0.0, QColor(0, 0, 0));
@@ -3424,6 +3460,7 @@ void tst_QImage::ditherGradient_data()
QTest::newRow("rgb30 -> rgb32 (dithering)") << rgb30 << QImage::Format_RGB32 << int(Qt::PreferDither | Qt::OrderedDither) << 513;
QTest::newRow("rgb30 -> rgb888 (no dither)") << rgb30 << QImage::Format_RGB888 << 0 << 256;
QTest::newRow("rgb30 -> rgb888 (dithering)") << rgb30 << QImage::Format_RGB888 << int(Qt::PreferDither | Qt::OrderedDither) << 513;
+#endif
}
void tst_QImage::ditherGradient()
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index d17a171728..22d96e76f9 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -30,6 +30,7 @@
#include <QtTest/QtTest>
#include <QBuffer>
+#include <QColorSpace>
#include <QDebug>
#include <QImage>
#include <QImageReader>
@@ -158,6 +159,9 @@ private slots:
void saveFormat_data();
void saveFormat();
+ void saveColorSpace_data();
+ void saveColorSpace();
+
void readText_data();
void readText();
@@ -1859,6 +1863,7 @@ void tst_QImageReader::saveFormat_data()
QTest::newRow("Format_RGB555") << QImage::Format_RGB555;
QTest::newRow("Format_ARGB8555_Premultiplied") << QImage::Format_ARGB8555_Premultiplied;
QTest::newRow("Format_RGB888") << QImage::Format_RGB888;
+ QTest::newRow("Format_BGR888") << QImage::Format_BGR888;
QTest::newRow("Format_RGB444") << QImage::Format_RGB444;
QTest::newRow("Format_ARGB4444_Premultiplied") << QImage::Format_ARGB4444_Premultiplied;
QTest::newRow("Format_RGBA64") << QImage::Format_RGBA64;
@@ -1883,6 +1888,40 @@ void tst_QImageReader::saveFormat()
QCOMPARE(stored, converted);
}
+void tst_QImageReader::saveColorSpace_data()
+{
+ QTest::addColumn<QColorSpace::NamedColorSpace>("namedColorSpace");
+
+ QTest::newRow("sRGB") << QColorSpace::SRgb;
+ QTest::newRow("sRGB(linear)") << QColorSpace::SRgbLinear;
+ QTest::newRow("AdobeRGB") << QColorSpace::AdobeRgb;
+ QTest::newRow("DisplayP3") << QColorSpace::DisplayP3;
+ QTest::newRow("ProPhotoRgb") << QColorSpace::ProPhotoRgb;
+}
+
+void tst_QImageReader::saveColorSpace()
+{
+ QFETCH(QColorSpace::NamedColorSpace, namedColorSpace);
+
+ QImage orig(":/images/kollada.png");
+
+ orig.setColorSpace(namedColorSpace);
+ QBuffer buf;
+ buf.open(QIODevice::WriteOnly);
+ QVERIFY(orig.save(&buf, "png"));
+ buf.close();
+ QImage stored = QImage::fromData(buf.buffer(), "png");
+
+ QCOMPARE(stored, orig);
+ QCOMPARE(stored.colorSpace(), orig.colorSpace());
+
+ buf.open(QIODevice::WriteOnly);
+ QVERIFY(orig.save(&buf, "jpeg"));
+ buf.close();
+ stored = QImage::fromData(buf.buffer(), "jpeg");
+
+ QCOMPARE(stored.colorSpace(), orig.colorSpace());
+}
void tst_QImageReader::readText_data()
{
diff --git a/tests/auto/gui/image/qpixmap/qpixmap.pro b/tests/auto/gui/image/qpixmap/qpixmap.pro
index e6a020af1a..c9219dad1d 100644
--- a/tests/auto/gui/image/qpixmap/qpixmap.pro
+++ b/tests/auto/gui/image/qpixmap/qpixmap.pro
@@ -5,7 +5,7 @@ QT += core-private gui-private testlib
qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpixmap.cpp
-win32:!winrt:LIBS += -lgdi32 -luser32
+win32:!winrt: QMAKE_USE += user32 gdi32
RESOURCES += qpixmap.qrc
TESTDATA += convertFromImage/* convertFromToHICON/* loadFromData/* images/*
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 4d31d80246..ba5df809f2 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -267,10 +267,6 @@ void tst_QPixmap::fromImage()
image.fill(0x7f7f7f7f);
const QPixmap pixmap = QPixmap::fromImage(image);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
const QImage result = pixmap.toImage();
image = image.convertToFormat(result.format());
QCOMPARE(result, image);
@@ -491,11 +487,6 @@ void tst_QPixmap::fill()
else
pm = QPixmap(400, 400);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (!bitmap && pm.handle()->classId() == QPlatformPixmap::X11Class && !pm.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
-
pm.fill(color);
if (syscolor && !bitmap && pm.depth() < 24) {
QSKIP("Test does not work on displays without true color");
@@ -521,10 +512,6 @@ void tst_QPixmap::fill()
void tst_QPixmap::fill_transparent()
{
QPixmap pixmap(10, 10);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
pixmap.fill(Qt::transparent);
QVERIFY(pixmap.hasAlphaChannel());
}
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index 158530428d..3158883ef5 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -104,18 +104,28 @@ void tst_QPixmapCache::cacheLimit()
void tst_QPixmapCache::setCacheLimit()
{
+ QPixmap res;
QPixmap *p1 = new QPixmap(2, 3);
QPixmapCache::insert("P1", *p1);
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(QPixmapCache::find("P1") != 0);
+#endif
+ QVERIFY(QPixmapCache::find("P1", &res));
delete p1;
QPixmapCache::setCacheLimit(0);
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(!QPixmapCache::find("P1"));
+#endif
+ QVERIFY(!QPixmapCache::find("P1", &res));
p1 = new QPixmap(2, 3);
QPixmapCache::setCacheLimit(1000);
QPixmapCache::insert("P1", *p1);
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(QPixmapCache::find("P1") != 0);
+#endif
+ QVERIFY(QPixmapCache::find("P1", &res));
delete p1;
@@ -200,6 +210,7 @@ void tst_QPixmapCache::find()
QVERIFY(QPixmapCache::insert("P1", p1));
QPixmap p2;
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(QPixmapCache::find("P1", p2));
QCOMPARE(p2.width(), 10);
QCOMPARE(p2.height(), 10);
@@ -209,6 +220,12 @@ void tst_QPixmapCache::find()
QPixmap *p3 = QPixmapCache::find("P1");
QVERIFY(p3);
QCOMPARE(p1, *p3);
+#endif
+
+ QVERIFY(QPixmapCache::find("P1", &p2));
+ QCOMPARE(p2.width(), 10);
+ QCOMPARE(p2.height(), 10);
+ QCOMPARE(p1, p2);
//The int part of the API
QPixmapCache::Key key = QPixmapCache::insert(p1);
@@ -261,6 +278,7 @@ void tst_QPixmapCache::insert()
}
int num = 0;
+#if QT_DEPRECATED_SINCE(5, 13)
for (int k = 0; k < numberOfKeys; ++k) {
if (QPixmapCache::find(QString::number(k)))
++num;
@@ -268,6 +286,16 @@ void tst_QPixmapCache::insert()
if (QPixmapCache::find("0"))
++num;
+ num = 0;
+#endif
+ QPixmap res;
+ for (int k = 0; k < numberOfKeys; ++k) {
+ if (QPixmapCache::find(QString::number(k), &res))
+ ++num;
+ }
+
+ if (QPixmapCache::find("0", &res))
+ ++num;
QVERIFY(num <= estimatedNum);
QPixmap p3;
@@ -340,17 +368,17 @@ void tst_QPixmapCache::remove()
p1.fill(Qt::yellow);
QPixmap p2;
- QVERIFY(QPixmapCache::find("red", p2));
+ QVERIFY(QPixmapCache::find("red", &p2));
QVERIFY(p1.toImage() != p2.toImage());
QVERIFY(p1.toImage() == p1.toImage()); // sanity check
QPixmapCache::remove("red");
- QVERIFY(!QPixmapCache::find("red"));
+ QVERIFY(!QPixmapCache::find("red", &p2));
QPixmapCache::remove("red");
- QVERIFY(!QPixmapCache::find("red"));
+ QVERIFY(!QPixmapCache::find("red", &p2));
QPixmapCache::remove("green");
- QVERIFY(!QPixmapCache::find("green"));
+ QVERIFY(!QPixmapCache::find("green", &p2));
//The int part of the API
QPixmapCache::clear();
@@ -392,7 +420,7 @@ void tst_QPixmapCache::remove()
key = QPixmapCache::insert(p1);
QPixmapCache::remove(key);
QVERIFY(QPixmapCache::find(key, &p1) == 0);
- QVERIFY(QPixmapCache::find("red") != 0);
+ QVERIFY(QPixmapCache::find("red", &p1) != 0);
}
void tst_QPixmapCache::clear()
@@ -408,14 +436,14 @@ void tst_QPixmapCache::clear()
const int numberOfKeys = estimatedNum + 1000;
for (int i = 0; i < numberOfKeys; ++i)
- QVERIFY(QPixmapCache::find("x" + QString::number(i)) == 0);
+ QVERIFY(!QPixmapCache::find("x" + QString::number(i), &p1));
for (int j = 0; j < numberOfKeys; ++j)
QPixmapCache::insert(QString::number(j), p1);
int num = 0;
for (int k = 0; k < numberOfKeys; ++k) {
- if (QPixmapCache::find(QString::number(k), p1))
+ if (QPixmapCache::find(QString::number(k), &p1))
++num;
}
QVERIFY(num > 0);
@@ -423,7 +451,7 @@ void tst_QPixmapCache::clear()
QPixmapCache::clear();
for (int k = 0; k < numberOfKeys; ++k)
- QVERIFY(!QPixmapCache::find(QString::number(k)));
+ QVERIFY(!QPixmapCache::find(QString::number(k), &p1));
//The int part of the API
QPixmap p2(10, 10);
diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
index 2deb84fa5f..b6921fc0bb 100644
--- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
@@ -311,12 +311,14 @@ void tst_QStandardItem::getSetFlags()
item.setCheckable(true);
QCOMPARE(item.checkState(), Qt::Checked);
+#if QT_DEPRECATED_SINCE(5, 6)
// deprecated API
item.setTristate(true);
QVERIFY(item.isTristate());
QVERIFY(item.flags() & Qt::ItemIsTristate);
item.setTristate(false);
QVERIFY(!(item.flags() & Qt::ItemIsTristate));
+#endif
}
void tst_QStandardItem::getSetRowAndColumnCount()
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index 550f70890e..bc8bc38da6 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -734,7 +734,7 @@ void tst_QStandardItemModel::data()
currentRoles.clear();
// bad args
m_model->setData(QModelIndex(), "bla", Qt::DisplayRole);
- QCOMPARE(currentRoles, {});
+ QCOMPARE(currentRoles, QVector<int>{});
QIcon icon;
for (int r=0; r < m_model->rowCount(); ++r) {
@@ -742,9 +742,9 @@ void tst_QStandardItemModel::data()
m_model->setData(m_model->index(r,c), "initialitem", Qt::DisplayRole);
QCOMPARE(currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
m_model->setData(m_model->index(r,c), "tooltip", Qt::ToolTipRole);
- QCOMPARE(currentRoles, {Qt::ToolTipRole});
+ QCOMPARE(currentRoles, QVector<int>{Qt::ToolTipRole});
m_model->setData(m_model->index(r,c), icon, Qt::DecorationRole);
- QCOMPARE(currentRoles, {Qt::DecorationRole});
+ QCOMPARE(currentRoles, QVector<int>{Qt::DecorationRole});
}
}
@@ -761,7 +761,7 @@ void tst_QStandardItemModel::clearItemData()
{
currentRoles.clear();
QVERIFY(!m_model->clearItemData(QModelIndex()));
- QCOMPARE(currentRoles, {});
+ QCOMPARE(currentRoles, QVector<int>{});
const QModelIndex idx = m_model->index(0, 0);
const QMap<int, QVariant> oldData = m_model->itemData(idx);
m_model->setData(idx, QLatin1String("initialitem"), Qt::DisplayRole);
@@ -773,7 +773,7 @@ void tst_QStandardItemModel::clearItemData()
QCOMPARE(idx.data(Qt::ToolTipRole), QVariant());
QCOMPARE(idx.data(Qt::DisplayRole), QVariant());
QCOMPARE(idx.data(Qt::EditRole), QVariant());
- QCOMPARE(currentRoles, {});
+ QCOMPARE(currentRoles, QVector<int>{});
m_model->setItemData(idx, oldData);
currentRoles.clear();
}
diff --git a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
index 7e98704aea..293a6a8581 100644
--- a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
+++ b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
@@ -5,4 +5,4 @@ QT += core-private network gui-private testlib
SOURCES += tst_noqteventloop.cpp
-qtConfig(dynamicgl):win32:!winrt: LIBS += -luser32
+qtConfig(dynamicgl):win32:!winrt: QMAKE_USE += user32
diff --git a/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp b/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
index 4fca9a07fc..3d1876f00f 100644
--- a/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
+++ b/tests/auto/gui/kernel/noqteventloop/tst_noqteventloop.cpp
@@ -36,6 +36,7 @@
#include <QtNetwork/qtcpserver.h>
#include <QtNetwork/qtcpsocket.h>
#include <QtCore/qelapsedtimer.h>
+#include <QtCore/qtimer.h>
#include <QtCore/qt_windows.h>
@@ -49,7 +50,7 @@ class tst_NoQtEventLoop : public QObject
private slots:
void consumeMouseEvents();
void consumeSocketEvents();
-
+ void deliverEventsInLivelock();
};
class Window : public QRasterWindow
@@ -258,8 +259,8 @@ void tst_NoQtEventLoop::consumeMouseEvents()
::SetWindowPos(mainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- Window *childWindow = new Window;
- childWindow->setParent(QWindow::fromWinId((WId)mainWnd));
+ QWindow *mainWindow = QWindow::fromWinId(reinterpret_cast<WId>(mainWnd));
+ Window *childWindow = new Window(mainWindow);
childWindow->setGeometry(margin, topVerticalMargin,
width - 2 * margin, height - margin - topVerticalMargin);
childWindow->show();
@@ -276,6 +277,7 @@ void tst_NoQtEventLoop::consumeMouseEvents()
if (g_exit)
break;
}
+ delete mainWindow;
QCOMPARE(testThread->passed(), true);
@@ -311,6 +313,34 @@ void tst_NoQtEventLoop::consumeSocketEvents()
QVERIFY(server.hasPendingConnections());
}
+void tst_NoQtEventLoop::deliverEventsInLivelock()
+{
+ int argc = 1;
+ char *argv[] = { const_cast<char *>("test"), 0 };
+ QGuiApplication app(argc, argv);
+
+ QTimer livelockTimer;
+ livelockTimer.start(0);
+ QTimer::singleShot(100, Qt::CoarseTimer, &livelockTimer, &QTimer::stop);
+
+ QElapsedTimer elapsedTimer;
+ elapsedTimer.start();
+
+ // Exec own message loop
+ MSG msg;
+ forever {
+ if (elapsedTimer.hasExpired(3000) || !livelockTimer.isActive())
+ break;
+
+ if (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }
+ }
+
+ QVERIFY(!livelockTimer.isActive());
+}
+
#include <tst_noqteventloop.moc>
QTEST_APPLESS_MAIN(tst_NoQtEventLoop)
diff --git a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
index 68852f5a3f..d67b17fd43 100644
--- a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
+++ b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
@@ -68,10 +68,17 @@ void tst_QDrag::getSetCheck()
QCOMPARE((QMimeData *)0, obj1.mimeData());
// delete var1; // No delete, since QDrag takes ownership
- Qt::DropAction result = obj1.start();
+ Qt::DropAction result = obj1.exec();
+ QCOMPARE(result, Qt::IgnoreAction);
+ result = obj1.exec(Qt::MoveAction | Qt::LinkAction);
+ QCOMPARE(result, Qt::IgnoreAction);
+
+#if QT_DEPRECATED_SINCE(5, 13)
+ result = obj1.start();
QCOMPARE(result, Qt::IgnoreAction);
result = obj1.start(Qt::MoveAction | Qt::LinkAction);
QCOMPARE(result, Qt::IgnoreAction);
+#endif
}
QTEST_MAIN(tst_QDrag)
diff --git a/tests/auto/gui/kernel/qguiapplication/BLACKLIST b/tests/auto/gui/kernel/qguiapplication/BLACKLIST
index 9a670237b7..e6ffe78ae3 100644
--- a/tests/auto/gui/kernel/qguiapplication/BLACKLIST
+++ b/tests/auto/gui/kernel/qguiapplication/BLACKLIST
@@ -1,4 +1,3 @@
[focusObject]
-opensuse
-opensuse-leap
-ubuntu
+ubuntu-16.04
+opensuse-42.3
diff --git a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
index 895c2a0307..34b75a8397 100644
--- a/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
+++ b/tests/auto/gui/kernel/qguiapplication/qguiapplication.pro
@@ -6,6 +6,7 @@ INCLUDEPATH += $$CORE_TEST_PATH
TARGET = tst_qguiapplication
QT += gui-private
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050E00
SOURCES += tst_qguiapplication.cpp
RESOURCES = tst_qguiapplication.qrc
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index a304981cd1..5ee25677bf 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -184,7 +184,7 @@ void tst_QGuiApplication::windowIcon()
class DummyWindow : public QWindow
{
public:
- DummyWindow() : m_focusObject(0) {}
+ DummyWindow() : m_focusObject(nullptr) {}
virtual QObject *focusObject() const
{
@@ -204,7 +204,7 @@ public:
void tst_QGuiApplication::focusObject()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
QSKIP("QWindow::requestActivate() is not supported.");
@@ -271,15 +271,15 @@ void tst_QGuiApplication::focusObject()
void tst_QGuiApplication::allWindows()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
QWindow *window1 = new QWindow;
QWindow *window2 = new QWindow(window1);
QVERIFY(app.allWindows().contains(window1));
QVERIFY(app.allWindows().contains(window2));
QCOMPARE(app.allWindows().count(), 2);
delete window1;
- window1 = 0;
- window2 = 0;
+ window1 = nullptr;
+ window2 = nullptr;
QVERIFY(!app.allWindows().contains(window2));
QVERIFY(!app.allWindows().contains(window1));
QCOMPARE(app.allWindows().count(), 0);
@@ -288,15 +288,15 @@ void tst_QGuiApplication::allWindows()
void tst_QGuiApplication::topLevelWindows()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
QWindow *window1 = new QWindow;
QWindow *window2 = new QWindow(window1);
QVERIFY(app.topLevelWindows().contains(window1));
QVERIFY(!app.topLevelWindows().contains(window2));
QCOMPARE(app.topLevelWindows().count(), 1);
delete window1;
- window1 = 0;
- window2 = 0;
+ window1 = nullptr;
+ window2 = nullptr;
QVERIFY(!app.topLevelWindows().contains(window2));
QVERIFY(!app.topLevelWindows().contains(window1));
QCOMPARE(app.topLevelWindows().count(), 0);
@@ -306,7 +306,7 @@ class ShowCloseShowWindow : public QWindow
{
Q_OBJECT
public:
- ShowCloseShowWindow(bool showAgain, QWindow *parent = 0)
+ ShowCloseShowWindow(bool showAgain, QWindow *parent = nullptr)
: QWindow(parent), showAgain(showAgain)
{
QTimer::singleShot(0, this, SLOT(doClose()));
@@ -331,7 +331,7 @@ private:
void tst_QGuiApplication::abortQuitOnShow()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
QScopedPointer<QWindow> window1(new ShowCloseShowWindow(false));
@@ -366,7 +366,7 @@ protected:
}
public:
- FocusChangeWindow() : QWindow(), windowDuringFocusAboutToChange(0), windowDuringFocusOut(0) {}
+ FocusChangeWindow() : QWindow(), windowDuringFocusAboutToChange(nullptr), windowDuringFocusOut(nullptr) {}
QWindow *windowDuringFocusAboutToChange;
QWindow *windowDuringFocusOut;
@@ -378,7 +378,7 @@ void tst_QGuiApplication::changeFocusWindow()
QSKIP("WinRt does not support multiple native windows.");
#endif
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
QSKIP("QWindow::requestActivate() is not supported.");
@@ -430,7 +430,7 @@ void tst_QGuiApplication::changeFocusWindow()
void tst_QGuiApplication::keyboardModifiers()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
QScopedPointer<QWindow> window(new QWindow);
@@ -564,7 +564,7 @@ public:
int leaves;
int enters;
- inline explicit BlockableWindow(QWindow *parent = 0)
+ inline explicit BlockableWindow(QWindow *parent = nullptr)
: QWindow(parent), blocked(false), leaves(0), enters(0) {}
bool event(QEvent *e)
@@ -601,7 +601,7 @@ void tst_QGuiApplication::modalWindow()
QSKIP("WinRt does not support multiple native windows.");
#endif
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
int x = screenGeometry.left() + spacing;
@@ -654,7 +654,7 @@ void tst_QGuiApplication::modalWindow()
window2->show();
QVERIFY(QTest::qWaitForWindowExposed(window1.data()));
QVERIFY(QTest::qWaitForWindowExposed(window2.data()));
- QCOMPARE(app.modalWindow(), static_cast<QWindow *>(0));
+ QCOMPARE(app.modalWindow(), static_cast<QWindow *>(nullptr));
QCOMPARE(window1->blocked, 0);
QCOMPARE(childWindow1->blocked, 0);
QCOMPARE(window2->blocked, 0);
@@ -698,7 +698,7 @@ void tst_QGuiApplication::modalWindow()
// everything is unblocked when applicationModalWindow1 is hidden
applicationModalWindow1->hide();
- QCOMPARE(app.modalWindow(), static_cast<QWindow *>(0));
+ QCOMPARE(app.modalWindow(), static_cast<QWindow *>(nullptr));
QCOMPARE(window1->blocked, 0);
QCOMPARE(childWindow1->blocked, 0); // QTBUG-32242, blocked status needs to be set on children as well.
QCOMPARE(window2->blocked, 0);
@@ -750,7 +750,7 @@ void tst_QGuiApplication::modalWindow()
// hide windowModalWindow2, windowModalWindow1 and window1 are unblocked
windowModalWindow2->hide();
- QCOMPARE(app.modalWindow(), static_cast<QWindow *>(0));
+ QCOMPARE(app.modalWindow(), static_cast<QWindow *>(nullptr));
QCOMPARE(window1->blocked, 0);
QCOMPARE(window2->blocked, 0);
QCOMPARE(windowModalWindow1->blocked, 0);
@@ -815,7 +815,7 @@ void tst_QGuiApplication::modalWindow()
// hide windowModalWindow1, everything is unblocked
windowModalWindow1->hide();
- QCOMPARE(app.modalWindow(), static_cast<QWindow *>(0));
+ QCOMPARE(app.modalWindow(), static_cast<QWindow *>(nullptr));
QCOMPARE(window1->blocked, 0);
QCOMPARE(window2->blocked, 0);
QCOMPARE(windowModalWindow1->blocked, 0);
@@ -829,7 +829,7 @@ void tst_QGuiApplication::modalWindow()
void tst_QGuiApplication::quitOnLastWindowClosed()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
QTimer timer;
@@ -869,7 +869,7 @@ void tst_QGuiApplication::quitOnLastWindowClosed()
void tst_QGuiApplication::quitOnLastWindowClosedMulti()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
QTimer timer;
@@ -909,7 +909,7 @@ void tst_QGuiApplication::quitOnLastWindowClosedMulti()
void tst_QGuiApplication::dontQuitOnLastWindowClosed()
{
int argc = 0;
- QGuiApplication app(argc, 0);
+ QGuiApplication app(argc, nullptr);
app.setQuitOnLastWindowClosed(false);
QTimer timer;
@@ -959,7 +959,7 @@ public:
{
if (key == "testplugin")
return new TestPlugin;
- return 0;
+ return nullptr;
}
};
@@ -989,9 +989,13 @@ void tst_QGuiApplication::genericPluginsAndWindowSystemEvents()
QCoreApplication::postEvent(&testReceiver, new QEvent(QEvent::User));
QCOMPARE(testReceiver.customEvents, 0);
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QStaticPlugin testPluginInfo(qt_plugin_instance, qt_plugin_query_metadata);
+#else
QStaticPlugin testPluginInfo;
testPluginInfo.instance = qt_plugin_instance;
testPluginInfo.rawMetaData = qt_plugin_query_metadata;
+#endif
qRegisterStaticPluginFunction(testPluginInfo);
int argc = 3;
char *argv[] = { const_cast<char*>(QTest::currentAppName()), const_cast<char*>("-plugin"), const_cast<char*>("testplugin") };
@@ -1065,7 +1069,7 @@ void tst_QGuiApplication::testSetPaletteAttribute()
QVERIFY(!QCoreApplication::testAttribute(Qt::AA_SetPalette));
QPalette palette;
- palette.setColor(QPalette::Foreground, Qt::red);
+ palette.setColor(QPalette::WindowText, Qt::red);
QGuiApplication::setPalette(palette);
QVERIFY(QCoreApplication::testAttribute(Qt::AA_SetPalette));
@@ -1122,7 +1126,7 @@ void tst_QGuiApplication::settableStyleHints()
int argc = 0;
QScopedPointer<QGuiApplication> app;
if (appInstance)
- app.reset(new QGuiApplication(argc, 0));
+ app.reset(new QGuiApplication(argc, nullptr));
const int keyboardInputInterval = 555;
QGuiApplication::styleHints()->setKeyboardInputInterval(keyboardInputInterval);
diff --git a/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST b/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST
index b1590a5ccf..d2c51922a8 100644
--- a/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST
+++ b/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST
@@ -1,5 +1,3 @@
-[sendPostedEvents]
-windows
[registerTimer]
-windows
winrt
+
diff --git a/tests/auto/gui/kernel/qguieventloop/BLACKLIST b/tests/auto/gui/kernel/qguieventloop/BLACKLIST
deleted file mode 100644
index 03acb2f5b0..0000000000
--- a/tests/auto/gui/kernel/qguieventloop/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[testQuitLock]
-osx-10.12
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index b2572188b9..3ce65a6785 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -191,7 +191,7 @@ template<> struct TestValueFactory<QMetaType::QTextLength> {
static QTextLength *create() { return new QTextLength(QTextLength::PercentageLength, 50); }
};
template<> struct TestValueFactory<QMetaType::QTextFormat> {
- static QTextFormat *create() { return new QTextFormat(QTextFormat::TableFormat); }
+ static QTextFormat *create() { return new QTextFormat(QTextFormat::FrameFormat); }
};
template<> struct TestValueFactory<QMetaType::QMatrix> {
static QMatrix *create() { return new QMatrix(10, 20, 30, 40, 50, 60); }
diff --git a/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp b/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp
index bad021c3b0..87a47bd93b 100644
--- a/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp
+++ b/tests/auto/gui/kernel/qkeyevent/tst_qkeyevent.cpp
@@ -121,7 +121,7 @@ static QByteArray modifiersTestRowName(const QString &keySequence)
if (uc > 32 && uc < 128)
str << '"' << c << '"';
else
- str << "U+" << hex << uc << dec;
+ str << "U+" << Qt::hex << uc << Qt::dec;
if (i < size - 1)
str << ',';
}
@@ -155,7 +155,7 @@ void tst_QKeyEvent::modifiers_data()
modifierCombinations.append(modifierCombination);
}
- qSort(modifierCombinations.begin(), modifierCombinations.end(), orderByModifier);
+ std::sort(modifierCombinations.begin(), modifierCombinations.end(), orderByModifier);
QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
foreach (const QVector<int> combination, modifierCombinations) {
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index f8b6bf064a..874468c954 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -86,7 +86,7 @@ static const MacSpecialKey * const MacSpecialKeyEntriesEnd = entries + NumEntrie
static QChar macSymbolForQtKey(int key)
{
- const MacSpecialKey *i = qBinaryFind(entries, MacSpecialKeyEntriesEnd, key);
+ const MacSpecialKey *i = std::lower_bound(entries, MacSpecialKeyEntriesEnd, key);
if (i == MacSpecialKeyEntriesEnd)
return QChar();
return QChar(i->macSymbol);
diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
index 7f29b1c24e..6ce6422f48 100644
--- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
@@ -141,21 +141,20 @@ void tst_QPalette::copySemantics()
void tst_QPalette::moveSemantics()
{
-#ifdef Q_COMPILER_RVALUE_REFS
QPalette src(Qt::red), dst;
const QPalette control = src;
QVERIFY(src != dst);
QCOMPARE(src, control);
QVERIFY(!dst.isCopyOf(src));
QVERIFY(!dst.isCopyOf(control));
- dst = qMove(src); // move assignment
+ dst = std::move(src); // move assignment
QVERIFY(!dst.isCopyOf(src)); // isCopyOf() works on moved-from palettes, too
QVERIFY(dst.isCopyOf(control));
QCOMPARE(dst, control);
src = control; // check moved-from 'src' can still be assigned to (doesn't crash)
QVERIFY(src.isCopyOf(dst));
QVERIFY(src.isCopyOf(control));
- QPalette dst2(qMove(src)); // move construction
+ QPalette dst2(std::move(src)); // move construction
QVERIFY(!src.isCopyOf(dst));
QVERIFY(!src.isCopyOf(dst2));
QVERIFY(!src.isCopyOf(control));
@@ -163,9 +162,6 @@ void tst_QPalette::moveSemantics()
QVERIFY(dst2.isCopyOf(dst));
QVERIFY(dst2.isCopyOf(control));
// check moved-from 'src' can still be destroyed (doesn't crash)
-#else
- QSKIP("Compiler doesn't support C++11 move semantics");
-#endif
}
void tst_QPalette::setBrush()
diff --git a/tests/auto/gui/kernel/qtouchevent/BLACKLIST b/tests/auto/gui/kernel/qtouchevent/BLACKLIST
index 8e78d7e41f..dcda77bce7 100644
--- a/tests/auto/gui/kernel/qtouchevent/BLACKLIST
+++ b/tests/auto/gui/kernel/qtouchevent/BLACKLIST
@@ -1,6 +1,2 @@
-[basicRawEventTranslation]
-linux
[multiPointRawEventTranslationOnTouchScreen]
-linux
-[multiPointRawEventTranslationOnTouchPad]
-linux
+ubuntu-16.04
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index 13dc924f93..54bb8fe0bd 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#include <QtWidgets/QDesktopWidget>
+#include <QtGui/QScreen>
#include <QtWidgets/QGraphicsItem>
#include <QtWidgets/QGraphicsScene>
#include <QtWidgets/QGraphicsView>
@@ -617,7 +617,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
QPointF pos = touchWidget.rect().center();
QPointF screenPos = touchWidget.mapToGlobal(pos.toPoint());
QPointF delta(10, 10);
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QTouchEvent::TouchPoint rawTouchPoint;
rawTouchPoint.setId(0);
@@ -753,7 +753,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
QPointF leftScreenPos = leftWidget.mapToGlobal(leftPos.toPoint());
QPointF rightScreenPos = rightWidget.mapToGlobal(rightPos.toPoint());
QPointF centerScreenPos = touchWidget.mapToGlobal(centerPos.toPoint());
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QList<QTouchEvent::TouchPoint> rawTouchPoints;
rawTouchPoints.append(QTouchEvent::TouchPoint(0));
@@ -968,7 +968,7 @@ void tst_QTouchEvent::touchOnMultipleTouchscreens()
QPointF pos = touchWidget.rect().center();
QPointF screenPos = touchWidget.mapToGlobal(pos.toPoint());
QPointF delta(10, 10);
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QVector<QTouchEvent::TouchPoint> rawTouchPoints(3);
rawTouchPoints[0].setId(0);
@@ -1131,7 +1131,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
QPointF leftScreenPos = leftWidget.mapToGlobal(leftPos.toPoint());
QPointF rightScreenPos = rightWidget.mapToGlobal(rightPos.toPoint());
QPointF centerScreenPos = touchWidget.mapToGlobal(centerPos.toPoint());
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QList<QTouchEvent::TouchPoint> rawTouchPoints;
rawTouchPoints.append(QTouchEvent::TouchPoint(0));
@@ -1348,7 +1348,7 @@ void tst_QTouchEvent::basicRawEventTranslationOfIds()
screenPos << touchWidget.mapToGlobal(pos[i].toPoint());
}
QPointF delta(10, 10);
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QVector<QPointF> rawPosList;
rawPosList << QPointF(12, 34) << QPointF(56, 78);
@@ -1629,7 +1629,7 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
QPointF leftScreenPos = leftWidget->mapToGlobal(leftPos.toPoint());
QPointF centerScreenPos = centerWidget->mapToGlobal(centerPos.toPoint());
QPointF rightScreenPos = rightWidget->mapToGlobal(rightPos.toPoint());
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QList<QTouchEvent::TouchPoint> rawTouchPoints;
rawTouchPoints.append(QTouchEvent::TouchPoint(0));
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index 1820499a53..27463adf99 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -1,3 +1,5 @@
+[positioning]
+opensuse-leap
[positioning:default]
linux
osx-10.12 ci
@@ -5,39 +7,19 @@ winrt
[positioning:fake]
osx-10.12 ci
[modalWithChildWindow]
-ubuntu-16.04
# QTBUG-66851
-opensuse
-opensuse-leap
# QTBUG-69160
-android
+opensuse-leap
[setVisible]
# QTBUG-69154
android
[modalWindowEnterEventOnHide_QTBUG35109]
-ubuntu-16.04
-osx ci
+osx
[spuriousMouseMove]
-windows ci
# QTBUG-69162
-android
-[modalDialogClosingOneOfTwoModal]
-osx
-[modalWindowModallity]
-osx
-# QTBUG-69163
-android
-[visibility]
-osx-10.12 ci
-
+windows-10
[testInputEvents]
rhel-7.4
-[isActive]
-# QTBUG-67768
-ubuntu
-# QTBUG-69157
-android
-
[exposeEventOnShrink_QTBUG54040]
# QTBUG-69155
android
diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro
index 844b3e8507..e7931ca773 100644
--- a/tests/auto/gui/kernel/qwindow/qwindow.pro
+++ b/tests/auto/gui/kernel/qwindow/qwindow.pro
@@ -5,4 +5,4 @@ QT += core-private gui-private testlib
SOURCES += tst_qwindow.cpp
-qtConfig(dynamicgl):win32:!winrt: LIBS += -luser32
+qtConfig(dynamicgl):win32:!winrt: QMAKE_USE += user32
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 4f26950192..60f89fcb4e 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -893,7 +893,13 @@ void tst_QWindow::isActive()
QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::FocusOut), 1);
- QTRY_COMPARE(window.received(QEvent::FocusIn), 3);
+ // We should be checking for exactly three, but since this is a try-compare _loop_, we might
+ // loose and regain focus multiple times in the event of a system popup. This has been observed
+ // to fail on Windows, see QTBUG-77769.
+ QTRY_VERIFY2(window.received(QEvent::FocusIn) >= 3,
+ qPrintable(
+ QStringLiteral("Expected more than three focus in events, received: %1")
+ .arg(window.received(QEvent::FocusIn))));
QVERIFY(window.isActive());
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index 96d983c8f7..e19f76d830 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -2861,8 +2861,10 @@ void tst_QMatrixNxN::convertGeneric()
QMatrix4x4 m4(m1);
QVERIFY(isSame(m4, unique4x4));
+#if QT_DEPRECATED_SINCE(5, 0)
QMatrix4x4 m5 = qGenericMatrixToMatrix4x4(m1);
QVERIFY(isSame(m5, unique4x4));
+#endif
static float const conv4x4[12] = {
1.0f, 2.0f, 3.0f, 4.0f,
@@ -2874,8 +2876,10 @@ void tst_QMatrixNxN::convertGeneric()
QMatrix4x3 m10 = m9.toGenericMatrix<4, 3>();
QVERIFY(isSame(m10, conv4x4));
+#if QT_DEPRECATED_SINCE(5, 0)
QMatrix4x3 m11 = qGenericMatrixFromMatrix4x4<4, 3>(m9);
QVERIFY(isSame(m11, conv4x4));
+#endif
}
// Copy of "flagBits" in qmatrix4x4.h.
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index 097dd111d3..8041fb5439 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -778,7 +778,10 @@ void tst_QQuaternion::conjugate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(w1, -x1, -y1, -z1);
+#if QT_DEPRECATED_SINCE(5, 5)
QCOMPARE(v1.conjugate(), v2);
+#endif
+ QCOMPARE(v1.conjugated(), v2);
}
// Test quaternion creation from an axis and an angle.
diff --git a/tests/auto/gui/painting/painting.pro b/tests/auto/gui/painting/painting.pro
index 831fffab30..26e84c1b15 100644
--- a/tests/auto/gui/painting/painting.pro
+++ b/tests/auto/gui/painting/painting.pro
@@ -3,6 +3,7 @@ SUBDIRS=\
qpainterpath \
qpainterpathstroker \
qcolor \
+ qcolorspace \
qbrush \
qregion \
qpagelayout \
diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
index ce6ce15767..f35d4f330b 100644
--- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
+++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
@@ -338,9 +338,9 @@ void tst_QBrush::gradientPresets()
QCOMPARE(lg->finalStop(), QPointF(1, 0));
QCOMPARE(lg->stops().size(), 3);
- QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1Literal("#ff9a9e"))));
- QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1Literal("#fad0c4"))));
- QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1Literal("#fad0c4"))));
+ QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1String("#ff9a9e"))));
+ QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1String("#fad0c4"))));
+ QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1String("#fad0c4"))));
QGradient invalidPreset(QGradient::Preset(-1));
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 17289e0b85..07c820dc86 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -33,7 +33,7 @@
#include <qcolor.h>
#include <qdebug.h>
-#include <private/qcolorprofile_p.h>
+#include <private/qcolortrclut_p.h>
#include <private/qdrawingprimitive_sse2_p.h>
#include <qrgba64.h>
@@ -64,12 +64,17 @@ private slots:
void globalColors_data();
void globalColors();
+#if defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT)
+ void colorConstants_data();
+ void colorConstants();
+#endif
void setRed();
void setGreen();
void setBlue();
void setRgb();
+ void setRgbF();
void setRgba();
void setHsv();
void setCmyk();
@@ -93,8 +98,8 @@ private slots:
void convertTo();
- void light();
- void dark();
+ void lighter();
+ void darker();
void specConstructor_data();
void specConstructor();
@@ -110,10 +115,6 @@ private slots:
void qcolorprofile_data();
void qcolorprofile();
-
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- void setallowX11ColorNames();
-#endif
};
// Testing get/set functions
@@ -187,28 +188,28 @@ void tst_QColor::getSetCheck()
// void QColor::setRedF(qreal)
obj1.setRedF(0.0);
QCOMPARE(obj1.redF(), qreal(0.0));
- obj1.setRedF(-0.2);
- QCOMPARE(obj1.redF(), qreal(0.0)); // range<0.0, 1.0
- obj1.setRedF(1.1);
- QCOMPARE(obj1.redF(), qreal(1.0)); // range<0.0, 1.0
+ obj1.setRedF(-0.25);
+ QCOMPARE(obj1.redF(), qreal(-0.25));
+ obj1.setRedF(1.25);
+ QCOMPARE(obj1.redF(), qreal(1.25));
// qreal QColor::greenF()
// void QColor::setGreenF(qreal)
obj1.setGreenF(0.0);
QCOMPARE(obj1.greenF(), qreal(0.0));
- obj1.setGreenF(-0.2);
- QCOMPARE(obj1.greenF(), qreal(0.0)); // range<0.0, 1.0
- obj1.setGreenF(1.1);
- QCOMPARE(obj1.greenF(), qreal(1.0)); // range<0.0, 1.0
+ obj1.setGreenF(-0.25);
+ QCOMPARE(obj1.greenF(), qreal(-0.25));
+ obj1.setGreenF(1.5);
+ QCOMPARE(obj1.greenF(), qreal(1.5));
// qreal QColor::blueF()
// void QColor::setBlueF(qreal)
obj1.setBlueF(0.0);
QCOMPARE(obj1.blueF(), qreal(0.0));
- obj1.setBlueF(-0.2);
- QCOMPARE(obj1.blueF(), qreal(0.0)); // range<0.0, 1.0
- obj1.setBlueF(1.1);
- QCOMPARE(obj1.blueF(), qreal(1.0)); // range<0.0, 1.0
+ obj1.setBlueF(-0.5);
+ QCOMPARE(obj1.blueF(), qreal(-0.5));
+ obj1.setBlueF(2.0);
+ QCOMPARE(obj1.blueF(), qreal(2.0));
// QRgb QColor::rgba()
// void QColor::setRgba(QRgb)
@@ -367,6 +368,191 @@ void tst_QColor::globalColors()
QCOMPARE(color.rgba(), argb);
}
+#if defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT)
+void tst_QColor::colorConstants_data()
+{
+ QTest::addColumn<QColor>("color");
+ QTest::addColumn<QRgb>("argb");
+
+ QTest::newRow("invalid") << QColor() << 0xff000000;
+ QTest::newRow("global color color0") << QColorConstants::Color0 << 0xff000000u;
+ QTest::newRow("global color color1") << QColorConstants::Color1 << 0xffffffffu;
+ QTest::newRow("global color black") << QColorConstants::Black << 0xff000000u;
+ QTest::newRow("global color white") << QColorConstants::White << 0xffffffffu;
+ QTest::newRow("global color darkGray") << QColorConstants::DarkGray << 0xff808080u;
+ QTest::newRow("global color gray") << QColorConstants::Gray << 0xffa0a0a4u;
+ QTest::newRow("global color lightGray") << QColorConstants::LightGray << 0xffc0c0c0u;
+ QTest::newRow("global color red") << QColorConstants::Red << 0xffff0000u;
+ QTest::newRow("global color green") << QColorConstants::Green << 0xff00ff00u;
+ QTest::newRow("global color blue") << QColorConstants::Blue << 0xff0000ffu;
+ QTest::newRow("global color cyan") << QColorConstants::Cyan << 0xff00ffffu;
+ QTest::newRow("global color magenta") << QColorConstants::Magenta << 0xffff00ffu;
+ QTest::newRow("global color yellow") << QColorConstants::Yellow << 0xffffff00u;
+ QTest::newRow("global color darkRed") << QColorConstants::DarkRed << 0xff800000u;
+ QTest::newRow("global color darkGreen") << QColorConstants::DarkGreen << 0xff008000u;
+ QTest::newRow("global color darkBlue") << QColorConstants::DarkBlue << 0xff000080u;
+ QTest::newRow("global color darkCyan") << QColorConstants::DarkCyan << 0xff008080u;
+ QTest::newRow("global color darkMagenta") << QColorConstants::DarkMagenta << 0xff800080u;
+ QTest::newRow("global color darkYellow") << QColorConstants::DarkYellow << 0xff808000u;
+ QTest::newRow("global color transparent") << QColorConstants::Transparent << 0x00000000u;
+
+ QTest::newRow("SVG aliceblue") << QColorConstants::Svg::aliceblue << 0xfff0f8ffu;
+ QTest::newRow("SVG antiquewhite") << QColorConstants::Svg::antiquewhite << 0xfffaebd7u;
+ QTest::newRow("SVG aqua") << QColorConstants::Svg::aqua << 0xff00ffffu;
+ QTest::newRow("SVG aquamarine") << QColorConstants::Svg::aquamarine << 0xff7fffd4u;
+ QTest::newRow("SVG azure") << QColorConstants::Svg::azure << 0xfff0ffffu;
+ QTest::newRow("SVG beige") << QColorConstants::Svg::beige << 0xfff5f5dcu;
+ QTest::newRow("SVG bisque") << QColorConstants::Svg::bisque << 0xffffe4c4u;
+ QTest::newRow("SVG black") << QColorConstants::Svg::black << 0xff000000u;
+ QTest::newRow("SVG blanchedalmond") << QColorConstants::Svg::blanchedalmond << 0xffffebcdu;
+ QTest::newRow("SVG blue") << QColorConstants::Svg::blue << 0xff0000ffu;
+ QTest::newRow("SVG blueviolet") << QColorConstants::Svg::blueviolet << 0xff8a2be2u;
+ QTest::newRow("SVG brown") << QColorConstants::Svg::brown << 0xffa52a2au;
+ QTest::newRow("SVG burlywood") << QColorConstants::Svg::burlywood << 0xffdeb887u;
+ QTest::newRow("SVG cadetblue") << QColorConstants::Svg::cadetblue << 0xff5f9ea0u;
+ QTest::newRow("SVG chartreuse") << QColorConstants::Svg::chartreuse << 0xff7fff00u;
+ QTest::newRow("SVG chocolate") << QColorConstants::Svg::chocolate << 0xffd2691eu;
+ QTest::newRow("SVG coral") << QColorConstants::Svg::coral << 0xffff7f50u;
+ QTest::newRow("SVG cornflowerblue") << QColorConstants::Svg::cornflowerblue << 0xff6495edu;
+ QTest::newRow("SVG cornsilk") << QColorConstants::Svg::cornsilk << 0xfffff8dcu;
+ QTest::newRow("SVG crimson") << QColorConstants::Svg::crimson << 0xffdc143cu;
+ QTest::newRow("SVG cyan") << QColorConstants::Svg::cyan << 0xff00ffffu;
+ QTest::newRow("SVG darkblue") << QColorConstants::Svg::darkblue << 0xff00008bu;
+ QTest::newRow("SVG darkcyan") << QColorConstants::Svg::darkcyan << 0xff008b8bu;
+ QTest::newRow("SVG darkgoldenrod") << QColorConstants::Svg::darkgoldenrod << 0xffb8860bu;
+ QTest::newRow("SVG darkgray") << QColorConstants::Svg::darkgray << 0xffa9a9a9u;
+ QTest::newRow("SVG darkgreen") << QColorConstants::Svg::darkgreen << 0xff006400u;
+ QTest::newRow("SVG darkgrey") << QColorConstants::Svg::darkgrey << 0xffa9a9a9u;
+ QTest::newRow("SVG darkkhaki") << QColorConstants::Svg::darkkhaki << 0xffbdb76bu;
+ QTest::newRow("SVG darkmagenta") << QColorConstants::Svg::darkmagenta << 0xff8b008bu;
+ QTest::newRow("SVG darkolivegreen") << QColorConstants::Svg::darkolivegreen << 0xff556b2fu;
+ QTest::newRow("SVG darkorange") << QColorConstants::Svg::darkorange << 0xffff8c00u;
+ QTest::newRow("SVG darkorchid") << QColorConstants::Svg::darkorchid << 0xff9932ccu;
+ QTest::newRow("SVG darkred") << QColorConstants::Svg::darkred << 0xff8b0000u;
+ QTest::newRow("SVG darksalmon") << QColorConstants::Svg::darksalmon << 0xffe9967au;
+ QTest::newRow("SVG darkseagreen") << QColorConstants::Svg::darkseagreen << 0xff8fbc8fu;
+ QTest::newRow("SVG darkslateblue") << QColorConstants::Svg::darkslateblue << 0xff483d8bu;
+ QTest::newRow("SVG darkslategray") << QColorConstants::Svg::darkslategray << 0xff2f4f4fu;
+ QTest::newRow("SVG darkslategrey") << QColorConstants::Svg::darkslategrey << 0xff2f4f4fu;
+ QTest::newRow("SVG darkturquoise") << QColorConstants::Svg::darkturquoise << 0xff00ced1u;
+ QTest::newRow("SVG darkviolet") << QColorConstants::Svg::darkviolet << 0xff9400d3u;
+ QTest::newRow("SVG deeppink") << QColorConstants::Svg::deeppink << 0xffff1493u;
+ QTest::newRow("SVG deepskyblue") << QColorConstants::Svg::deepskyblue << 0xff00bfffu;
+ QTest::newRow("SVG dimgray") << QColorConstants::Svg::dimgray << 0xff696969u;
+ QTest::newRow("SVG dimgrey") << QColorConstants::Svg::dimgrey << 0xff696969u;
+ QTest::newRow("SVG dodgerblue") << QColorConstants::Svg::dodgerblue << 0xff1e90ffu;
+ QTest::newRow("SVG firebrick") << QColorConstants::Svg::firebrick << 0xffb22222u;
+ QTest::newRow("SVG floralwhite") << QColorConstants::Svg::floralwhite << 0xfffffaf0u;
+ QTest::newRow("SVG forestgreen") << QColorConstants::Svg::forestgreen << 0xff228b22u;
+ QTest::newRow("SVG fuchsia") << QColorConstants::Svg::fuchsia << 0xffff00ffu;
+ QTest::newRow("SVG gainsboro") << QColorConstants::Svg::gainsboro << 0xffdcdcdcu;
+ QTest::newRow("SVG ghostwhite") << QColorConstants::Svg::ghostwhite << 0xfff8f8ffu;
+ QTest::newRow("SVG gold") << QColorConstants::Svg::gold << 0xffffd700u;
+ QTest::newRow("SVG goldenrod") << QColorConstants::Svg::goldenrod << 0xffdaa520u;
+ QTest::newRow("SVG gray") << QColorConstants::Svg::gray << 0xff808080u;
+ QTest::newRow("SVG green") << QColorConstants::Svg::green << 0xff008000u;
+ QTest::newRow("SVG greenyellow") << QColorConstants::Svg::greenyellow << 0xffadff2fu;
+ QTest::newRow("SVG grey") << QColorConstants::Svg::grey << 0xff808080u;
+ QTest::newRow("SVG honeydew") << QColorConstants::Svg::honeydew << 0xfff0fff0u;
+ QTest::newRow("SVG hotpink") << QColorConstants::Svg::hotpink << 0xffff69b4u;
+ QTest::newRow("SVG indianred") << QColorConstants::Svg::indianred << 0xffcd5c5cu;
+ QTest::newRow("SVG indigo") << QColorConstants::Svg::indigo << 0xff4b0082u;
+ QTest::newRow("SVG ivory") << QColorConstants::Svg::ivory << 0xfffffff0u;
+ QTest::newRow("SVG khaki") << QColorConstants::Svg::khaki << 0xfff0e68cu;
+ QTest::newRow("SVG lavender") << QColorConstants::Svg::lavender << 0xffe6e6fau;
+ QTest::newRow("SVG lavenderblush") << QColorConstants::Svg::lavenderblush << 0xfffff0f5u;
+ QTest::newRow("SVG lawngreen") << QColorConstants::Svg::lawngreen << 0xff7cfc00u;
+ QTest::newRow("SVG lemonchiffon") << QColorConstants::Svg::lemonchiffon << 0xfffffacdu;
+ QTest::newRow("SVG lightblue") << QColorConstants::Svg::lightblue << 0xffadd8e6u;
+ QTest::newRow("SVG lightcoral") << QColorConstants::Svg::lightcoral << 0xfff08080u;
+ QTest::newRow("SVG lightcyan") << QColorConstants::Svg::lightcyan << 0xffe0ffffu;
+ QTest::newRow("SVG lightgoldenrodyellow") << QColorConstants::Svg::lightgoldenrodyellow << 0xfffafad2u;
+ QTest::newRow("SVG lightgray") << QColorConstants::Svg::lightgray << 0xffd3d3d3u;
+ QTest::newRow("SVG lightgreen") << QColorConstants::Svg::lightgreen << 0xff90ee90u;
+ QTest::newRow("SVG lightgrey") << QColorConstants::Svg::lightgrey << 0xffd3d3d3u;
+ QTest::newRow("SVG lightpink") << QColorConstants::Svg::lightpink << 0xffffb6c1u;
+ QTest::newRow("SVG lightsalmon") << QColorConstants::Svg::lightsalmon << 0xffffa07au;
+ QTest::newRow("SVG lightseagreen") << QColorConstants::Svg::lightseagreen << 0xff20b2aau;
+ QTest::newRow("SVG lightskyblue") << QColorConstants::Svg::lightskyblue << 0xff87cefau;
+ QTest::newRow("SVG lightslategray") << QColorConstants::Svg::lightslategray << 0xff778899u;
+ QTest::newRow("SVG lightslategrey") << QColorConstants::Svg::lightslategrey << 0xff778899u;
+ QTest::newRow("SVG lightsteelblue") << QColorConstants::Svg::lightsteelblue << 0xffb0c4deu;
+ QTest::newRow("SVG lightyellow") << QColorConstants::Svg::lightyellow << 0xffffffe0u;
+ QTest::newRow("SVG lime") << QColorConstants::Svg::lime << 0xff00ff00u;
+ QTest::newRow("SVG limegreen") << QColorConstants::Svg::limegreen << 0xff32cd32u;
+ QTest::newRow("SVG linen") << QColorConstants::Svg::linen << 0xfffaf0e6u;
+ QTest::newRow("SVG magenta") << QColorConstants::Svg::magenta << 0xffff00ffu;
+ QTest::newRow("SVG maroon") << QColorConstants::Svg::maroon << 0xff800000u;
+ QTest::newRow("SVG mediumaquamarine") << QColorConstants::Svg::mediumaquamarine << 0xff66cdaau;
+ QTest::newRow("SVG mediumblue") << QColorConstants::Svg::mediumblue << 0xff0000cdu;
+ QTest::newRow("SVG mediumorchid") << QColorConstants::Svg::mediumorchid << 0xffba55d3u;
+ QTest::newRow("SVG mediumpurple") << QColorConstants::Svg::mediumpurple << 0xff9370dbu;
+ QTest::newRow("SVG mediumseagreen") << QColorConstants::Svg::mediumseagreen << 0xff3cb371u;
+ QTest::newRow("SVG mediumslateblue") << QColorConstants::Svg::mediumslateblue << 0xff7b68eeu;
+ QTest::newRow("SVG mediumspringgreen") << QColorConstants::Svg::mediumspringgreen << 0xff00fa9au;
+ QTest::newRow("SVG mediumturquoise") << QColorConstants::Svg::mediumturquoise << 0xff48d1ccu;
+ QTest::newRow("SVG mediumvioletred") << QColorConstants::Svg::mediumvioletred << 0xffc71585u;
+ QTest::newRow("SVG midnightblue") << QColorConstants::Svg::midnightblue << 0xff191970u;
+ QTest::newRow("SVG mintcream") << QColorConstants::Svg::mintcream << 0xfff5fffau;
+ QTest::newRow("SVG mistyrose") << QColorConstants::Svg::mistyrose << 0xffffe4e1u;
+ QTest::newRow("SVG moccasin") << QColorConstants::Svg::moccasin << 0xffffe4b5u;
+ QTest::newRow("SVG navajowhite") << QColorConstants::Svg::navajowhite << 0xffffdeadu;
+ QTest::newRow("SVG navy") << QColorConstants::Svg::navy << 0xff000080u;
+ QTest::newRow("SVG oldlace") << QColorConstants::Svg::oldlace << 0xfffdf5e6u;
+ QTest::newRow("SVG olive") << QColorConstants::Svg::olive << 0xff808000u;
+ QTest::newRow("SVG olivedrab") << QColorConstants::Svg::olivedrab << 0xff6b8e23u;
+ QTest::newRow("SVG orange") << QColorConstants::Svg::orange << 0xffffa500u;
+ QTest::newRow("SVG orangered") << QColorConstants::Svg::orangered << 0xffff4500u;
+ QTest::newRow("SVG orchid") << QColorConstants::Svg::orchid << 0xffda70d6u;
+ QTest::newRow("SVG palegoldenrod") << QColorConstants::Svg::palegoldenrod << 0xffeee8aau;
+ QTest::newRow("SVG palegreen") << QColorConstants::Svg::palegreen << 0xff98fb98u;
+ QTest::newRow("SVG paleturquoise") << QColorConstants::Svg::paleturquoise << 0xffafeeeeu;
+ QTest::newRow("SVG palevioletred") << QColorConstants::Svg::palevioletred << 0xffdb7093u;
+ QTest::newRow("SVG papayawhip") << QColorConstants::Svg::papayawhip << 0xffffefd5u;
+ QTest::newRow("SVG peachpuff") << QColorConstants::Svg::peachpuff << 0xffffdab9u;
+ QTest::newRow("SVG peru") << QColorConstants::Svg::peru << 0xffcd853fu;
+ QTest::newRow("SVG pink") << QColorConstants::Svg::pink << 0xffffc0cbu;
+ QTest::newRow("SVG plum") << QColorConstants::Svg::plum << 0xffdda0ddu;
+ QTest::newRow("SVG powderblue") << QColorConstants::Svg::powderblue << 0xffb0e0e6u;
+ QTest::newRow("SVG purple") << QColorConstants::Svg::purple << 0xff800080u;
+ QTest::newRow("SVG red") << QColorConstants::Svg::red << 0xffff0000u;
+ QTest::newRow("SVG rosybrown") << QColorConstants::Svg::rosybrown << 0xffbc8f8fu;
+ QTest::newRow("SVG royalblue") << QColorConstants::Svg::royalblue << 0xff4169e1u;
+ QTest::newRow("SVG saddlebrown") << QColorConstants::Svg::saddlebrown << 0xff8b4513u;
+ QTest::newRow("SVG salmon") << QColorConstants::Svg::salmon << 0xfffa8072u;
+ QTest::newRow("SVG sandybrown") << QColorConstants::Svg::sandybrown << 0xfff4a460u;
+ QTest::newRow("SVG seagreen") << QColorConstants::Svg::seagreen << 0xff2e8b57u;
+ QTest::newRow("SVG seashell") << QColorConstants::Svg::seashell << 0xfffff5eeu;
+ QTest::newRow("SVG sienna") << QColorConstants::Svg::sienna << 0xffa0522du;
+ QTest::newRow("SVG silver") << QColorConstants::Svg::silver << 0xffc0c0c0u;
+ QTest::newRow("SVG skyblue") << QColorConstants::Svg::skyblue << 0xff87ceebu;
+ QTest::newRow("SVG slateblue") << QColorConstants::Svg::slateblue << 0xff6a5acdu;
+ QTest::newRow("SVG slategray") << QColorConstants::Svg::slategray << 0xff708090u;
+ QTest::newRow("SVG slategrey") << QColorConstants::Svg::slategrey << 0xff708090u;
+ QTest::newRow("SVG snow") << QColorConstants::Svg::snow << 0xfffffafau;
+ QTest::newRow("SVG springgreen") << QColorConstants::Svg::springgreen << 0xff00ff7fu;
+ QTest::newRow("SVG steelblue") << QColorConstants::Svg::steelblue << 0xff4682b4u;
+ QTest::newRow("SVG tan") << QColorConstants::Svg::tan << 0xffd2b48cu;
+ QTest::newRow("SVG teal") << QColorConstants::Svg::teal << 0xff008080u;
+ QTest::newRow("SVG thistle") << QColorConstants::Svg::thistle << 0xffd8bfd8u;
+ QTest::newRow("SVG tomato") << QColorConstants::Svg::tomato << 0xffff6347u;
+ QTest::newRow("SVG turquoise") << QColorConstants::Svg::turquoise << 0xff40e0d0u;
+ QTest::newRow("SVG violet") << QColorConstants::Svg::violet << 0xffee82eeu;
+ QTest::newRow("SVG wheat") << QColorConstants::Svg::wheat << 0xfff5deb3u;
+ QTest::newRow("SVG white") << QColorConstants::Svg::white << 0xffffffffu;
+ QTest::newRow("SVG whitesmoke") << QColorConstants::Svg::whitesmoke << 0xfff5f5f5u;
+ QTest::newRow("SVG yellow") << QColorConstants::Svg::yellow << 0xffffff00u;
+ QTest::newRow("SVG yellowgreen") << QColorConstants::Svg::yellowgreen << 0xff9acd32u;
+}
+
+void tst_QColor::colorConstants()
+{
+ QFETCH(QColor, color);
+ QFETCH(QRgb, argb);
+ QCOMPARE(color.rgba(), argb);
+}
+#endif // defined(Q_COMPILER_CONSTEXPR) & defined(Q_COMPILER_UNIFORM_INIT)
+
/*
CSS color names = SVG 1.0 color names + transparent (rgba(0,0,0,0))
*/
@@ -677,30 +863,81 @@ void tst_QColor::setRgb()
{
QColor color;
- for (int A = 0; A <= USHRT_MAX; ++A) {
- {
- // 0-255
- int a = A >> 8;
- QRgb rgb = qRgba(0, 0, 0, a);
+ for (int a = 0; a <= 255; ++a) {
+ QRgb rgb = qRgba(0, 0, 0, a);
- color.setRgb(0, 0, 0, a);
- QCOMPARE(color.alpha(), a);
- QCOMPARE(color.rgb(), qRgb(0, 0, 0));
+ color.setRgb(0, 0, 0, a);
+ QCOMPARE(color.alpha(), a);
+ QCOMPARE(color.rgb(), qRgb(0, 0, 0));
- color.setRgb(rgb);
- QCOMPARE(color.alpha(), 255);
- QCOMPARE(color.rgb(), qRgb(0, 0, 0));
+ color.setRgb(rgb);
+ QCOMPARE(color.alpha(), 255);
+ QCOMPARE(color.rgb(), qRgb(0, 0, 0));
- int r, g, b, a2;
- color.setRgb(0, 0, 0, a);
- color.getRgb(&r, &g, &b, &a2);
- QCOMPARE(a2, a);
+ int r, g, b, a2;
+ color.setRgb(0, 0, 0, a);
+ color.getRgb(&r, &g, &b, &a2);
+ QCOMPARE(a2, a);
- QColor c(0, 0, 0);
- c.setAlpha(a);
- QCOMPARE(c.alpha(), a);
- }
+ QColor c(0, 0, 0);
+ c.setAlpha(a);
+ QCOMPARE(c.alpha(), a);
+ }
+
+ for (int r = 0; r <= 255; ++r) {
+ QRgb rgb = qRgb(r, 0, 0);
+ color.setRgb(r, 0, 0);
+ QCOMPARE(color.red(), r);
+ QCOMPARE(color.rgb(), rgb);
+
+ color.setRgb(rgb);
+ QCOMPARE(color.red(), r);
+ QCOMPARE(color.rgb(), rgb);
+
+ int r2, g, b, a;
+ color.getRgb(&r2, &g, &b, &a);
+ QCOMPARE(r2, r);
+ }
+
+ for (int g = 0; g <= 255; ++g) {
+ QRgb rgb = qRgb(0, g, 0);
+
+ color.setRgb(0, g, 0);
+ QCOMPARE(color.green(), g);
+ QCOMPARE(color.rgb(), rgb);
+
+ color.setRgb(rgb);
+ QCOMPARE(color.green(), g);
+ QCOMPARE(color.rgb(), rgb);
+
+ int r, g2, b, a;
+ color.getRgb(&r, &g2, &b, &a);
+ QCOMPARE(g2, g);
+ }
+
+ for (int b = 0; b <= 255; ++b) {
+ QRgb rgb = qRgb(0, 0, b);
+
+ color.setRgb(0, 0, b);
+ QCOMPARE(color.blue(), b);
+ QCOMPARE(color.rgb(), rgb);
+
+ color.setRgb(rgb);
+ QCOMPARE(color.blue(), b);
+ QCOMPARE(color.rgb(), rgb);
+
+ int r, g, b2, a;
+ color.getRgb(&r, &g, &b2, &a);
+ QCOMPARE(b2, b);
+ }
+}
+
+void tst_QColor::setRgbF()
+{
+ QColor color;
+
+ for (int A = 0; A <= USHRT_MAX; ++A) {
{
// 0.0-1.0
qreal a = A / qreal(USHRT_MAX);
@@ -720,24 +957,6 @@ void tst_QColor::setRgb()
for (int R = 0; R <= USHRT_MAX; ++R) {
{
- // 0-255
- int r = R >> 8;
- QRgb rgb = qRgb(r, 0, 0);
-
- color.setRgb(r, 0, 0);
- QCOMPARE(color.red(), r);
- QCOMPARE(color.rgb(), rgb);
-
- color.setRgb(rgb);
- QCOMPARE(color.red(), r);
- QCOMPARE(color.rgb(), rgb);
-
- int r2, g, b, a;
- color.getRgb(&r2, &g, &b, &a);
- QCOMPARE(r2, r);
- }
-
- {
// 0.0-1.0
qreal r = R / qreal(USHRT_MAX);
color.setRgbF(r, 0.0, 0.0);
@@ -751,24 +970,6 @@ void tst_QColor::setRgb()
for (int G = 0; G <= USHRT_MAX; ++G) {
{
- // 0-255
- int g = G >> 8;
- QRgb rgb = qRgb(0, g, 0);
-
- color.setRgb(0, g, 0);
- QCOMPARE(color.green(), g);
- QCOMPARE(color.rgb(), rgb);
-
- color.setRgb(rgb);
- QCOMPARE(color.green(), g);
- QCOMPARE(color.rgb(), rgb);
-
- int r, g2, b, a;
- color.getRgb(&r, &g2, &b, &a);
- QCOMPARE(g2, g);
- }
-
- {
// 0.0-1.0
qreal g = G / qreal(USHRT_MAX);
color.setRgbF(0.0, g, 0.0);
@@ -782,32 +983,53 @@ void tst_QColor::setRgb()
for (int B = 0; B <= USHRT_MAX; ++B) {
{
- // 0-255
- int b = B >> 8;
- QRgb rgb = qRgb(0, 0, b);
+ // 0.0-1.0
+ qreal b = B / qreal(USHRT_MAX);
+ color.setRgbF(0.0, 0.0, b);
+ QCOMPARE(color.blueF(), b);
- color.setRgb(0, 0, b);
- QCOMPARE(color.blue(), b);
- QCOMPARE(color.rgb(), rgb);
+ qreal r, g, b2, a;
+ color.getRgbF(&r, &g, &b2, &a);
+ QCOMPARE(b2, b);
+ }
+ }
- color.setRgb(rgb);
- QCOMPARE(color.blue(), b);
- QCOMPARE(color.rgb(), rgb);
+ for (int R = -128; R <= 512; ++R) {
+ {
+ // extended RGB
+ qreal r = R / qreal(256);
+ color.setRgbF(r, 0.0, 0.0);
+ QCOMPARE(qfloat16(color.redF()), qfloat16(r));
- int r, g, b2, a;
- color.getRgb(&r, &g, &b2, &a);
- QCOMPARE(b2, b);
+ qreal r2, g, b, a;
+ color.getRgbF(&r2, &g, &b, &a);
+ QCOMPARE(qfloat16(r2), qfloat16(r));
}
+ }
+ for (int G = -128; G <= 512; ++G) {
{
- // 0.0-1.0
- qreal b = B / qreal(USHRT_MAX);
+ // extended RGB
+ qreal g = G / qreal(256);
+ color.setRgbF(0.0, g, 0.0);
+ QCOMPARE(qfloat16(color.greenF()), qfloat16(g));
+
+ qreal r, g2, b, a;
+ color.getRgbF(&r, &g2, &b, &a);
+ QCOMPARE(qfloat16(g2), qfloat16(g));
+ }
+ }
+
+ for (int B = -128; B <= 512; ++B) {
+ {
+ // extended RGB
+ qreal b = B / qreal(256);
color.setRgbF(0.0, 0.0, b);
- QCOMPARE(color.blueF(), b);
+ QCOMPARE(qfloat16(color.blueF()), qfloat16(b));
qreal r, g, b2, a;
color.getRgbF(&r, &g, &b2, &a);
- QCOMPARE(b2, b);
+ QCOMPARE(qfloat16(b2), qfloat16(b));
}
}
}
@@ -1382,17 +1604,17 @@ void tst_QColor::convertTo()
QCOMPARE(invalid.spec(), QColor::Invalid);
}
-void tst_QColor::light()
+void tst_QColor::lighter()
{
QColor gray(Qt::gray);
- QColor lighter = gray.light();
+ QColor lighter = gray.lighter();
QVERIFY(lighter.value() > gray.value());
}
-void tst_QColor::dark()
+void tst_QColor::darker()
{
QColor gray(Qt::gray);
- QColor darker = gray.dark();
+ QColor darker = gray.darker();
QVERIFY(darker.value() < gray.value());
}
@@ -1423,62 +1645,6 @@ void tst_QColor::achromaticHslHue()
QCOMPARE(hsl.hslHue(), -1);
}
-#if 0 // Used to be included in Qt4 for Q_WS_X11
-void tst_QColor::setallowX11ColorNames()
-{
- RGBData x11RgbTbl[] = {
- // a few standard X11 color names
- { "DodgerBlue1", qRgb(30, 144, 255) },
- { "DodgerBlue2", qRgb(28, 134, 238) },
- { "DodgerBlue3", qRgb(24, 116, 205) },
- { "DodgerBlue4", qRgb(16, 78, 139) },
- { "SteelBlue1", qRgb(99, 184, 255) },
- { "SteelBlue2", qRgb(92, 172, 238) },
- { "SteelBlue3", qRgb(79, 148, 205) },
- { "SteelBlue4", qRgb(54, 100, 139) },
- { "DeepSkyBlue1", qRgb(0, 191, 255) },
- { "DeepSkyBlue2", qRgb(0, 178, 238) },
- { "DeepSkyBlue3", qRgb(0, 154, 205) },
- { "DeepSkyBlue4", qRgb(0, 104, 139) },
- { "SkyBlue1", qRgb(135, 206, 255) },
- { "SkyBlue2", qRgb(126, 192, 238) },
- { "SkyBlue3", qRgb(108, 166, 205) },
- { "SkyBlue4", qRgb(74, 112, 139) }
- };
- static const int x11RgbTblSize = sizeof(x11RgbTbl) / sizeof(RGBData);
-
- // X11 color names should not work by default
- QVERIFY(!QColor::allowX11ColorNames());
- for (int i = 0; i < x11RgbTblSize; ++i) {
- QString colorName = QLatin1String(x11RgbTbl[i].name);
- QColor color;
- color.setNamedColor(colorName);
- QVERIFY(!color.isValid());
- }
-
- // enable X11 color names
- QColor::setAllowX11ColorNames(true);
- QVERIFY(QColor::allowX11ColorNames());
- for (int i = 0; i < x11RgbTblSize; ++i) {
- QString colorName = QLatin1String(x11RgbTbl[i].name);
- QColor color;
- color.setNamedColor(colorName);
- QColor expected(x11RgbTbl[i].value);
- QCOMPARE(color, expected);
- }
-
- // should be able to turn off X11 color names
- QColor::setAllowX11ColorNames(false);
- QVERIFY(!QColor::allowX11ColorNames());
- for (int i = 0; i < x11RgbTblSize; ++i) {
- QString colorName = QLatin1String(x11RgbTbl[i].name);
- QColor color;
- color.setNamedColor(colorName);
- QVERIFY(!color.isValid());
- }
-}
-#endif
-
void tst_QColor::premultiply()
{
// Tests that qPremultiply(qUnpremultiply(x)) returns x.
@@ -1632,14 +1798,13 @@ void tst_QColor::qcolorprofile_data()
QTest::newRow("gamma=1.7") << qreal(1.7) << 2;
QTest::newRow("gamma=2.0") << qreal(2.0) << 8;
QTest::newRow("gamma=2.31") << qreal(2.31) << 33;
- QTest::newRow("SRgb") << qreal(0.0) << 7;
}
void tst_QColor::qcolorprofile()
{
QFETCH(qreal, gammaC);
QFETCH(int, tolerance);
- QColorProfile *cp = (gammaC == 0) ? QColorProfile::fromSRgb(): QColorProfile::fromGamma(gammaC);
+ QColorTrcLut *cp = QColorTrcLut::fromGamma(gammaC);
// Test we are accurate for most values after converting through gamma-correction.
int error = 0;
diff --git a/tests/auto/gui/painting/qcolorspace/qcolorspace.pro b/tests/auto/gui/painting/qcolorspace/qcolorspace.pro
new file mode 100644
index 0000000000..14bd699bf7
--- /dev/null
+++ b/tests/auto/gui/painting/qcolorspace/qcolorspace.pro
@@ -0,0 +1,9 @@
+CONFIG += testcase
+QT += testlib gui-private core-private
+
+TARGET = tst_qcolorspace
+SOURCES += tst_qcolorspace.cpp
+
+RESOURCES += $$files(resources/*)
+
+TESTDATA += resources/*
diff --git a/tests/auto/gui/painting/qcolorspace/resources/HP_ZR30w.icc b/tests/auto/gui/painting/qcolorspace/resources/HP_ZR30w.icc
new file mode 100644
index 0000000000..b3f860714c
--- /dev/null
+++ b/tests/auto/gui/painting/qcolorspace/resources/HP_ZR30w.icc
Binary files differ
diff --git a/tests/auto/gui/painting/qcolorspace/resources/ProPhoto.jpg b/tests/auto/gui/painting/qcolorspace/resources/ProPhoto.jpg
new file mode 100644
index 0000000000..481d35ca8e
--- /dev/null
+++ b/tests/auto/gui/painting/qcolorspace/resources/ProPhoto.jpg
Binary files differ
diff --git a/tests/auto/gui/painting/qcolorspace/resources/sRGB2014.icc b/tests/auto/gui/painting/qcolorspace/resources/sRGB2014.icc
new file mode 100644
index 0000000000..49afbfef10
--- /dev/null
+++ b/tests/auto/gui/painting/qcolorspace/resources/sRGB2014.icc
Binary files differ
diff --git a/tests/auto/gui/painting/qcolorspace/tst_qcolorspace.cpp b/tests/auto/gui/painting/qcolorspace/tst_qcolorspace.cpp
new file mode 100644
index 0000000000..531e14d25b
--- /dev/null
+++ b/tests/auto/gui/painting/qcolorspace/tst_qcolorspace.cpp
@@ -0,0 +1,448 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+
+#include <qcolorspace.h>
+#include <qimage.h>
+#include <qimagereader.h>
+
+#include <private/qcolorspace_p.h>
+
+Q_DECLARE_METATYPE(QColorSpace::NamedColorSpace)
+Q_DECLARE_METATYPE(QColorSpace::Primaries)
+Q_DECLARE_METATYPE(QColorSpace::TransferFunction)
+
+class tst_QColorSpace : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QColorSpace();
+
+private slots:
+ void movable();
+ void namedColorSpaces_data();
+ void namedColorSpaces();
+
+ void toIccProfile_data();
+ void toIccProfile();
+
+ void fromIccProfile_data();
+ void fromIccProfile();
+
+ void imageConversion_data();
+ void imageConversion();
+
+ void loadImage();
+
+ void primaries();
+ void primariesXyz();
+
+#ifdef QT_BUILD_INTERNAL
+ void primaries2_data();
+ void primaries2();
+#endif
+
+ void invalidPrimaries();
+
+ void changeTransferFunction();
+ void changePrimaries();
+};
+
+tst_QColorSpace::tst_QColorSpace()
+{ }
+
+
+void tst_QColorSpace::movable()
+{
+ QColorSpace cs1 = QColorSpace::SRgb;
+ QColorSpace cs2 = QColorSpace::SRgbLinear;
+ QVERIFY(cs1.isValid());
+ QVERIFY(cs2.isValid());
+ QCOMPARE(cs1, QColorSpace::SRgb);
+
+ cs2 = std::move(cs1);
+ QVERIFY(!cs1.isValid());
+ QVERIFY(cs2.isValid());
+ QCOMPARE(cs2, QColorSpace::SRgb);
+ QVERIFY(cs1 != QColorSpace::SRgb);
+ QCOMPARE(cs1, QColorSpace());
+
+ QColorSpace cs3(std::move(cs2));
+ QVERIFY(!cs2.isValid());
+ QVERIFY(cs3.isValid());
+ QCOMPARE(cs3, QColorSpace::SRgb);
+ QCOMPARE(cs2, QColorSpace());
+}
+
+void tst_QColorSpace::namedColorSpaces_data()
+{
+ QTest::addColumn<QColorSpace::NamedColorSpace>("namedColorSpace");
+ QTest::addColumn<QColorSpace::Primaries>("primariesId");
+ QTest::addColumn<QColorSpace::TransferFunction>("transferFunctionId");
+
+ QTest::newRow("sRGB") << QColorSpace::SRgb
+ << QColorSpace::Primaries::SRgb
+ << QColorSpace::TransferFunction::SRgb;
+ QTest::newRow("sRGB Linear") << QColorSpace::SRgbLinear
+ << QColorSpace::Primaries::SRgb
+ << QColorSpace::TransferFunction::Linear;
+ QTest::newRow("Adobe RGB") << QColorSpace::AdobeRgb
+ << QColorSpace::Primaries::AdobeRgb
+ << QColorSpace::TransferFunction::Gamma;
+ QTest::newRow("Display-P3") << QColorSpace::DisplayP3
+ << QColorSpace::Primaries::DciP3D65
+ << QColorSpace::TransferFunction::SRgb;
+ QTest::newRow("ProPhoto RGB") << QColorSpace::ProPhotoRgb
+ << QColorSpace::Primaries::ProPhotoRgb
+ << QColorSpace::TransferFunction::ProPhotoRgb;
+}
+
+void tst_QColorSpace::namedColorSpaces()
+{
+ QFETCH(QColorSpace::NamedColorSpace, namedColorSpace);
+ QFETCH(QColorSpace::Primaries, primariesId);
+ QFETCH(QColorSpace::TransferFunction, transferFunctionId);
+
+ QColorSpace colorSpace = namedColorSpace;
+
+ QVERIFY(colorSpace.isValid());
+
+ QCOMPARE(colorSpace, namedColorSpace);
+ QCOMPARE(colorSpace.primaries(), primariesId);
+ QCOMPARE(colorSpace.transferFunction(), transferFunctionId);
+}
+
+
+void tst_QColorSpace::toIccProfile_data()
+{
+ namedColorSpaces_data();
+}
+
+void tst_QColorSpace::toIccProfile()
+{
+ QFETCH(QColorSpace::NamedColorSpace, namedColorSpace);
+ QFETCH(QColorSpace::Primaries, primariesId);
+ QFETCH(QColorSpace::TransferFunction, transferFunctionId);
+
+ Q_UNUSED(primariesId);
+ Q_UNUSED(transferFunctionId);
+
+ QColorSpace colorSpace = namedColorSpace;
+ QByteArray iccProfile = colorSpace.iccProfile();
+ QVERIFY(!iccProfile.isEmpty());
+
+ QColorSpace colorSpace2 = QColorSpace::fromIccProfile(iccProfile);
+ QVERIFY(colorSpace2.isValid());
+
+ QCOMPARE(colorSpace2, colorSpace);
+
+ QByteArray iccProfile2 = colorSpace2.iccProfile();
+ QVERIFY(!iccProfile2.isEmpty());
+
+ QCOMPARE(iccProfile2, iccProfile);
+}
+
+void tst_QColorSpace::fromIccProfile_data()
+{
+ QTest::addColumn<QString>("testProfile");
+ QTest::addColumn<QColorSpace::NamedColorSpace>("namedColorSpace");
+ QTest::addColumn<QColorSpace::TransferFunction>("transferFunction");
+ QTest::addColumn<QString>("description");
+
+ QString prefix = QFINDTESTDATA("resources/");
+ // Read the official sRGB ICCv2 profile:
+ QTest::newRow("sRGB2014 (ICCv2)") << prefix + "sRGB2014.icc" << QColorSpace::SRgb
+ << QColorSpace::TransferFunction::SRgb << QString("sRGB2014");
+ // My monitor's profile:
+ QTest::newRow("HP ZR30w (ICCv4)") << prefix + "HP_ZR30w.icc" << QColorSpace::NamedColorSpace(0)
+ << QColorSpace::TransferFunction::Gamma << QString("HP Z30i");
+}
+
+void tst_QColorSpace::fromIccProfile()
+{
+ QFETCH(QString, testProfile);
+ QFETCH(QColorSpace::NamedColorSpace, namedColorSpace);
+ QFETCH(QColorSpace::TransferFunction, transferFunction);
+ QFETCH(QString, description);
+
+ QFile file(testProfile);
+ file.open(QIODevice::ReadOnly);
+ QByteArray iccProfile = file.readAll();
+ QColorSpace fileColorSpace = QColorSpace::fromIccProfile(iccProfile);
+ QVERIFY(fileColorSpace.isValid());
+
+ if (namedColorSpace)
+ QCOMPARE(fileColorSpace, namedColorSpace);
+
+ QCOMPARE(fileColorSpace.transferFunction(), transferFunction);
+ QCOMPARE(QColorSpacePrivate::get(fileColorSpace)->description, description);
+}
+
+void tst_QColorSpace::imageConversion_data()
+{
+ QTest::addColumn<QColorSpace::NamedColorSpace>("fromColorSpace");
+ QTest::addColumn<QColorSpace::NamedColorSpace>("toColorSpace");
+ QTest::addColumn<int>("tolerance");
+
+ QTest::newRow("sRGB -> Display-P3") << QColorSpace::SRgb << QColorSpace::DisplayP3 << 0;
+ QTest::newRow("sRGB -> Adobe RGB") << QColorSpace::SRgb << QColorSpace::AdobeRgb << 2;
+ QTest::newRow("Display-P3 -> sRGB") << QColorSpace::DisplayP3 << QColorSpace::SRgb << 0;
+ QTest::newRow("Adobe RGB -> sRGB") << QColorSpace::AdobeRgb << QColorSpace::SRgb << 2;
+ QTest::newRow("Display-P3 -> Adobe RGB") << QColorSpace::DisplayP3 << QColorSpace::AdobeRgb << 2;
+ QTest::newRow("sRGB -> sRGB Linear") << QColorSpace::SRgb << QColorSpace::SRgbLinear << 0;
+}
+
+void tst_QColorSpace::imageConversion()
+{
+ QFETCH(QColorSpace::NamedColorSpace, fromColorSpace);
+ QFETCH(QColorSpace::NamedColorSpace, toColorSpace);
+ QFETCH(int, tolerance);
+
+ QImage testImage(256, 1, QImage::Format_RGB32);
+
+ for (int i = 0; i < 256; ++i)
+ testImage.setPixel(i, 0, qRgb(i, i, i));
+
+ testImage.setColorSpace(fromColorSpace);
+ QCOMPARE(testImage.colorSpace(), QColorSpace(fromColorSpace));
+
+ testImage.convertToColorSpace(toColorSpace);
+ QCOMPARE(testImage.colorSpace(), QColorSpace(toColorSpace));
+
+ int lastRed = 0;
+ int lastGreen = 0;
+ int lastBlue = 0;
+ for (int i = 0; i < 256; ++i) {
+ QRgb p = testImage.pixel(i, 0);
+ QVERIFY(qRed(p) >= lastRed);
+ QVERIFY(qGreen(p) >= lastGreen);
+ QVERIFY(qBlue(p) >= lastBlue);
+ lastRed = qRed(p);
+ lastGreen = qGreen(p);
+ lastBlue = qBlue(p);
+ }
+
+ lastRed = 0;
+ lastGreen = 0;
+ lastBlue = 0;
+ testImage.convertToColorSpace(fromColorSpace);
+ QCOMPARE(testImage.colorSpace(), QColorSpace(fromColorSpace));
+ for (int i = 0; i < 256; ++i) {
+ QRgb p = testImage.pixel(i, 0);
+ QVERIFY(qAbs(qRed(p) - qGreen(p)) <= tolerance);
+ QVERIFY(qAbs(qRed(p) - qBlue(p)) <= tolerance);
+ QVERIFY((lastRed - qRed(p)) <= (tolerance / 2));
+ QVERIFY((lastGreen - qGreen(p)) <= (tolerance / 2));
+ QVERIFY((lastBlue - qBlue(p)) <= (tolerance / 2));
+ lastRed = qRed(p);
+ lastGreen = qGreen(p);
+ lastBlue = qBlue(p);
+ }
+}
+
+
+void tst_QColorSpace::loadImage()
+{
+ QString prefix = QFINDTESTDATA("resources/");
+ QImageReader reader(prefix + "ProPhoto.jpg");
+ QImage image = reader.read();
+
+ QVERIFY(!image.isNull());
+ QVERIFY(image.colorSpace().isValid());
+ QCOMPARE(image.colorSpace(), QColorSpace::ProPhotoRgb);
+ QVERIFY(!image.colorSpace().iccProfile().isEmpty());
+
+ QColorSpace defaultProPhotoRgb = QColorSpace::ProPhotoRgb;
+ QVERIFY(!defaultProPhotoRgb.iccProfile().isEmpty());
+
+ // Test the iccProfile getter returns the ICC profile from the image
+ // which since we didn't write it, isn't identical to our defaults.
+ QVERIFY(defaultProPhotoRgb.iccProfile() != image.colorSpace().iccProfile());
+
+ QColorTransform transform = image.colorSpace().transformationToColorSpace(QColorSpace::SRgb);
+ qreal maxRed = 0;
+ qreal maxBlue = 0;
+ qreal maxRed2 = 0;
+ qreal maxBlue2 = 0;
+ for (int y = 0; y < image.height(); ++y) {
+ for (int x = 0; x < image.width(); ++x) {
+ QColor p = image.pixelColor(x, y);
+ maxRed = std::max(maxRed, p.redF());
+ maxBlue = std::max(maxBlue, p.blueF());
+ p = transform.map(p);
+ maxRed2 = std::max(maxRed2, p.redF());
+ maxBlue2 = std::max(maxBlue2, p.blueF());
+
+ }
+ }
+ // ProPhotoRgb can be a lot more red and blue than SRgb can, so it will have lower values.
+ QVERIFY(maxRed2 > maxRed);
+ QVERIFY(maxBlue2 > maxBlue);
+}
+
+void tst_QColorSpace::primaries()
+{
+ QColor black = QColor::fromRgbF(0.0, 0.0, 0.0);
+ QColor white = QColor::fromRgbF(1.0, 1.0, 1.0);
+ QColor red = QColor::fromRgbF(1.0, 0.0, 0.0);
+ QColor green = QColor::fromRgbF(0.0, 1.0, 0.0);
+ QColor blue = QColor::fromRgbF(0.0, 0.0, 1.0);
+
+ QColorTransform toAdobeRgb = QColorSpace(QColorSpace::SRgb).transformationToColorSpace(QColorSpace::AdobeRgb);
+
+ QColor tblack = toAdobeRgb.map(black);
+ QColor twhite = toAdobeRgb.map(white);
+ QColor tred = toAdobeRgb.map(red);
+ QColor tgreen = toAdobeRgb.map(green);
+ QColor tblue = toAdobeRgb.map(blue);
+
+ // Black is black
+ QCOMPARE(tblack, black);
+
+ // This white hasn't changed
+ QCOMPARE(twhite, white);
+
+ // Adobe's red and blue gamut corners are the same as sRGB's
+ // So, a color in the red corner, will stay in the red corner
+ // the same for blue, but not for green.
+ QVERIFY(tred.greenF() < 0.001);
+ QVERIFY(tred.blueF() < 0.001);
+ QVERIFY(tblue.redF() < 0.001);
+ QVERIFY(tblue.greenF() < 0.001);
+ QVERIFY(tgreen.redF() > 0.2);
+ QVERIFY(tgreen.blueF() > 0.2);
+}
+
+void tst_QColorSpace::primariesXyz()
+{
+ QColorSpace sRgb = QColorSpace::SRgb;
+ QColorSpace adobeRgb = QColorSpace::AdobeRgb;
+ QColorSpace displayP3 = QColorSpace::DisplayP3;
+ QColorSpace proPhotoRgb = QColorSpace::ProPhotoRgb;
+
+ // Check if our calculated matrices, match the precalculated ones.
+ QCOMPARE(QColorSpacePrivate::get(sRgb)->toXyz, QColorMatrix::toXyzFromSRgb());
+ QCOMPARE(QColorSpacePrivate::get(adobeRgb)->toXyz, QColorMatrix::toXyzFromAdobeRgb());
+ QCOMPARE(QColorSpacePrivate::get(displayP3)->toXyz, QColorMatrix::toXyzFromDciP3D65());
+ QCOMPARE(QColorSpacePrivate::get(proPhotoRgb)->toXyz, QColorMatrix::toXyzFromProPhotoRgb());
+}
+
+#ifdef QT_BUILD_INTERNAL
+void tst_QColorSpace::primaries2_data()
+{
+ QTest::addColumn<QColorSpace::Primaries>("primariesId");
+
+ QTest::newRow("sRGB") << QColorSpace::Primaries::SRgb;
+ QTest::newRow("DCI-P3 (D65)") << QColorSpace::Primaries::DciP3D65;
+ QTest::newRow("Adobe RGB (1998)") << QColorSpace::Primaries::AdobeRgb;
+ QTest::newRow("ProPhoto RGB") << QColorSpace::Primaries::ProPhotoRgb;
+}
+
+void tst_QColorSpace::primaries2()
+{
+ QFETCH(QColorSpace::Primaries, primariesId);
+ QColorSpacePrimaries primaries(primariesId);
+
+ QColorSpace original(primariesId, QColorSpace::TransferFunction::Linear);
+ QColorSpace custom1(primaries.whitePoint, primaries.redPoint,
+ primaries.greenPoint, primaries.bluePoint, QColorSpace::TransferFunction::Linear);
+ QCOMPARE(original, custom1);
+
+ // A custom color swizzled color-space:
+ QColorSpace custom2(primaries.whitePoint, primaries.bluePoint,
+ primaries.greenPoint, primaries.redPoint, QColorSpace::TransferFunction::Linear);
+
+ QVERIFY(custom1 != custom2);
+ QColor color1(255, 127, 63);
+ QColor color2 = custom1.transformationToColorSpace(custom2).map(color1);
+ QCOMPARE(color2.red(), color1.blue());
+ QCOMPARE(color2.green(), color1.green());
+ QCOMPARE(color2.blue(), color1.red());
+ QCOMPARE(color2.alpha(), color1.alpha());
+ QColor color3 = custom2.transformationToColorSpace(custom1).map(color2);
+ QCOMPARE(color3.red(), color1.red());
+ QCOMPARE(color3.green(), color1.green());
+ QCOMPARE(color3.blue(), color1.blue());
+ QCOMPARE(color3.alpha(), color1.alpha());
+}
+#endif
+
+void tst_QColorSpace::invalidPrimaries()
+{
+ QColorSpace custom(QPointF(), QPointF(), QPointF(), QPointF(), QColorSpace::TransferFunction::Linear);
+ QVERIFY(!custom.isValid());
+}
+
+void tst_QColorSpace::changeTransferFunction()
+{
+ QColorSpace sRgb = QColorSpace::SRgb;
+
+ QColorSpace sRgbLinear = sRgb.withTransferFunction(QColorSpace::TransferFunction::Linear);
+ QCOMPARE(sRgbLinear.transferFunction(), QColorSpace::TransferFunction::Linear);
+ QCOMPARE(sRgbLinear.gamma(), 1.0f);
+ QCOMPARE(sRgbLinear.primaries(), QColorSpace::Primaries::SRgb);
+ QCOMPARE(sRgbLinear, QColorSpace::SRgbLinear);
+ QCOMPARE(sRgbLinear, QColorSpace(QColorSpace::SRgbLinear));
+ QVERIFY(sRgbLinear != sRgb);
+ QCOMPARE(sRgbLinear.withTransferFunction(QColorSpace::TransferFunction::SRgb), sRgb);
+
+ QColorSpace aRgb = QColorSpace::AdobeRgb;
+ aRgb.setTransferFunction(QColorSpace::TransferFunction::SRgb);
+ QCOMPARE(aRgb.transferFunction(), QColorSpace::TransferFunction::SRgb);
+ QCOMPARE(aRgb.primaries(), QColorSpace::Primaries::AdobeRgb);
+ QVERIFY(aRgb != QColorSpace(QColorSpace::AdobeRgb));
+ QVERIFY(aRgb != sRgb);
+ QCOMPARE(aRgb.withTransferFunction(QColorSpace::TransferFunction::Gamma, 2.2f),
+ QColorSpace(QColorSpace::AdobeRgb));
+ QVERIFY(aRgb != QColorSpace(QColorSpace::AdobeRgb));
+ aRgb.setTransferFunction(QColorSpace::TransferFunction::Gamma, 2.2f);
+ QVERIFY(aRgb == QColorSpace(QColorSpace::AdobeRgb));
+
+ QColorSpace undefined;
+ QCOMPARE(undefined.withTransferFunction(QColorSpace::TransferFunction::Linear), undefined);
+ undefined.setTransferFunction(QColorSpace::TransferFunction::SRgb);
+ QCOMPARE(undefined, QColorSpace());
+}
+
+void tst_QColorSpace::changePrimaries()
+{
+ QColorSpace cs = QColorSpace::SRgb;
+ cs.setPrimaries(QColorSpace::Primaries::DciP3D65);
+ QVERIFY(cs.isValid());
+ QCOMPARE(cs, QColorSpace(QColorSpace::DisplayP3));
+ cs.setTransferFunction(QColorSpace::TransferFunction::Linear);
+ cs.setPrimaries(QPointF(0.3127, 0.3290), QPointF(0.640, 0.330),
+ QPointF(0.3000, 0.6000), QPointF(0.150, 0.060));
+ QCOMPARE(cs, QColorSpace(QColorSpace::SRgbLinear));
+}
+
+QTEST_MAIN(tst_QColorSpace)
+#include "tst_qcolorspace.moc"
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index bc0baed15c..6e48439944 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -123,14 +123,18 @@ private slots:
void drawPath2();
void drawPath3();
+#if QT_DEPRECATED_SINCE(5, 13)
void drawRoundRect_data() { fillData(); }
void drawRoundRect();
+#endif
+ void drawRoundedRect_data() { fillData(); }
+ void drawRoundedRect();
void qimageFormats_data();
void qimageFormats();
void textOnTransparentImage();
-#ifndef QT_NO_WIDGETS
+#if !defined(QT_NO_WIDGETS) && QT_DEPRECATED_SINCE(5, 13)
void initFrom();
#endif
@@ -153,10 +157,10 @@ private slots:
void clippedLines();
void clippedPolygon_data();
void clippedPolygon();
-
void clippedText();
void clipBoundingRect();
+ void transformedClip();
void setOpacity_data();
void setOpacity();
@@ -185,10 +189,12 @@ private slots:
void gradientPixelFormat_data();
void gradientPixelFormat();
+#if QT_CONFIG(raster_64bit)
void linearGradientRgb30_data();
void linearGradientRgb30();
void radialGradientRgb30_data();
void radialGradientRgb30();
+#endif
void fpe_pixmapTransform();
void fpe_zeroLengthLines();
@@ -368,10 +374,10 @@ void tst_QPainter::getSetCheck()
// bool QPainter::matrixEnabled()
// void QPainter::setMatrixEnabled(bool)
- obj1.setMatrixEnabled(false);
- QCOMPARE(false, obj1.matrixEnabled());
- obj1.setMatrixEnabled(true);
- QCOMPARE(true, obj1.matrixEnabled());
+ obj1.setWorldMatrixEnabled(false);
+ QCOMPARE(false, obj1.worldMatrixEnabled());
+ obj1.setWorldMatrixEnabled(true);
+ QCOMPARE(true, obj1.worldMatrixEnabled());
// bool QPainter::viewTransformEnabled()
// void QPainter::setViewTransformEnabled(bool)
@@ -455,11 +461,6 @@ void tst_QPainter::drawPixmap_comp()
destPm.fill(c1);
srcPm.fill(c2);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (!destPm.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
-
QPainter p(&destPm);
p.drawPixmap(0, 0, srcPm);
p.end();
@@ -677,12 +678,14 @@ static QRect getPaintedSize(const QPixmap &pm, const QColor &background)
}
#ifndef QT_NO_WIDGETS
+
+#if QT_DEPRECATED_SINCE(5, 13)
void tst_QPainter::initFrom()
{
QWidget *widget = new QWidget();
QPalette pal = widget->palette();
- pal.setColor(QPalette::Foreground, QColor(255, 0, 0));
- pal.setBrush(QPalette::Background, QColor(0, 255, 0));
+ pal.setColor(QPalette::WindowText, QColor(255, 0, 0));
+ pal.setBrush(QPalette::Window, QColor(0, 255, 0));
widget->setPalette(pal);
widget->show();
@@ -696,11 +699,12 @@ void tst_QPainter::initFrom()
p.initFrom(widget);
QCOMPARE(p.font(), font);
- QCOMPARE(p.pen().color(), pal.color(QPalette::Foreground));
- QCOMPARE(p.background(), pal.background());
+ QCOMPARE(p.pen().color(), pal.color(QPalette::WindowText));
+ QCOMPARE(p.background(), pal.window());
delete widget;
}
+#endif
void tst_QPainter::drawBorderPixmap()
{
@@ -1544,6 +1548,7 @@ void tst_QPainter::drawClippedEllipse()
}
+#if QT_DEPRECATED_SINCE(5, 13)
void tst_QPainter::drawRoundRect()
{
QFETCH(QRect, rect);
@@ -1578,6 +1583,42 @@ void tst_QPainter::drawRoundRect()
QCOMPARE(painted.height(), rect.height() + increment);
}
}
+#endif
+
+void tst_QPainter::drawRoundedRect()
+{
+ QFETCH(QRect, rect);
+ QFETCH(bool, usePen);
+
+#ifdef Q_OS_DARWIN
+ if (QTest::currentDataTag() == QByteArray("rect(6, 12, 3, 14) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(6, 17, 3, 25) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(10, 6, 10, 3) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(10, 12, 10, 14) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(13, 45, 17, 80) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(13, 50, 17, 91) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(17, 6, 24, 3) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(24, 12, 38, 14) with pen"))
+ QSKIP("The Mac paint engine is off-by-one on certain rect sizes");
+#endif
+ QPixmap pixmap(rect.x() + rect.width() + 10,
+ rect.y() + rect.height() + 10);
+ {
+ pixmap.fill(Qt::white);
+ QPainter p(&pixmap);
+ p.setRenderHint(QPainter::Qt4CompatiblePainting);
+ p.setPen(usePen ? QPen(Qt::black) : QPen(Qt::NoPen));
+ p.setBrush(Qt::black);
+ p.drawRoundedRect(rect, 25, 25, Qt::RelativeSize);
+ p.end();
+
+ int increment = usePen ? 1 : 0;
+
+ const QRect painted = getPaintedSize(pixmap, Qt::white);
+ QCOMPARE(painted.width(), rect.width() + increment);
+ QCOMPARE(painted.height(), rect.height() + increment);
+ }
+}
void tst_QPainter::qimageFormats_data()
{
@@ -1591,6 +1632,7 @@ void tst_QPainter::qimageFormats_data()
QTest::newRow("Qimage::Format_RGB555") << QImage::Format_RGB555;
QTest::newRow("Qimage::Format_ARGB8555_Premultiplied") << QImage::Format_ARGB8555_Premultiplied;
QTest::newRow("Qimage::Format_RGB888") << QImage::Format_RGB888;
+ QTest::newRow("Qimage::Format_BGR888") << QImage::Format_BGR888;
QTest::newRow("Qimage::Format_A2RGB30_Premultiplied") << QImage::Format_A2RGB30_Premultiplied;
QTest::newRow("Qimage::Format_RGB30") << QImage::Format_RGB30;
}
@@ -1660,9 +1702,13 @@ void tst_QPainter::combinedMatrix()
p.translate(0.5, 0.5);
+ QTransform ct = p.combinedTransform();
+#if QT_DEPRECATED_SINCE(5, 13)
QMatrix cm = p.combinedMatrix();
+ QCOMPARE(cm, ct.toAffine());
+#endif
- QPointF pt = QPointF(0, 0) * cm;
+ QPointF pt = QPointF(0, 0) * ct.toAffine();
QCOMPARE(pt.x(), 48.0);
QCOMPARE(pt.y(), 16.0);
@@ -1977,7 +2023,7 @@ void tst_QPainter::clippedFillPath_data()
<< pen2;
path = QPainterPath();
- path.addRoundRect(QRect(15, 15, 50, 50), 20);
+ path.addRoundedRect(QRect(15, 15, 50, 50), 20, Qt::RelativeSize);
QTest::newRow("round rect 0") << QSize(100, 100) << path
<< QRect(15, 15, 49, 49)
<< QBrush(Qt::NoBrush)
@@ -3195,7 +3241,7 @@ void tst_QPainter::largeImagePainting()
p.translate(4, 0);
}
- p.resetMatrix();
+ p.resetTransform();
for (int i = 4; i < img.height(); i += 4) {
p.translate(0, 4);
@@ -3946,6 +3992,7 @@ void tst_QPainter::gradientInterpolation()
}
}
+#if QT_CONFIG(raster_64bit)
void tst_QPainter::linearGradientRgb30_data()
{
QTest::addColumn<QColor>("stop0");
@@ -4004,6 +4051,7 @@ void tst_QPainter::radialGradientRgb30()
QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
}
}
+#endif
void tst_QPainter::drawPolygon()
{
@@ -4084,14 +4132,18 @@ void tst_QPainter::inactivePainter()
p.setClipRegion(region);
p.setClipping(true);
+#if QT_DEPRECATED_SINCE(5, 13)
p.combinedMatrix();
+#endif
p.combinedTransform();
p.compositionMode();
p.setCompositionMode(QPainter::CompositionMode_Plus);
p.device();
+#if QT_DEPRECATED_SINCE(5, 13)
p.deviceMatrix();
+#endif
p.deviceTransform();
p.font();
@@ -4115,7 +4167,9 @@ void tst_QPainter::inactivePainter()
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, false);
+#if QT_DEPRECATED_SINCE(5, 13)
p.resetMatrix();
+#endif
p.resetTransform();
p.rotate(1);
p.scale(2, 2);
@@ -4131,8 +4185,10 @@ void tst_QPainter::inactivePainter()
p.window();
p.setWindow(QRect(10, 10, 620, 460));
+#if QT_DEPRECATED_SINCE(5, 13)
p.worldMatrix();
p.setWorldMatrix(QMatrix().translate(43, 21), true);
+#endif
p.setWorldMatrixEnabled(true);
p.transform();
@@ -4533,6 +4589,53 @@ void tst_QPainter::clipBoundingRect()
}
+void tst_QPainter::transformedClip()
+{
+ QImage img(8, 4, QImage::Format_ARGB32_Premultiplied);
+ QImage img2(img.size(), img.format());
+ QRect clip(0, 0, 2, 1);
+ QTransform xf;
+ xf.translate(0.2, 0);
+ xf.scale(2.2, 1);
+ // setClipRect(QRectF)
+ {
+ img.fill(Qt::green);
+ QPainter p(&img);
+ p.setTransform(xf);
+ p.setClipRect(QRectF(clip));
+ p.fillRect(img.rect(), Qt::white);
+ }
+ // setClipRect(QRect)
+ {
+ img2.fill(Qt::green);
+ QPainter p(&img2);
+ p.setTransform(xf);
+ p.setClipRect(clip);
+ p.fillRect(img2.rect(), Qt::white);
+ QCOMPARE(img, img2);
+ }
+ // setClipRegion
+ {
+ img2.fill(Qt::green);
+ QPainter p(&img2);
+ p.setTransform(xf);
+ p.setClipRegion(QRegion(clip) + QRect(0, 3, 1, 1)); // dummy extra rect to avoid single-rect codepath
+ p.fillRect(img2.rect(), Qt::white);
+ QCOMPARE(img.copy(0, 0, 8, 2), img2.copy(0, 0, 8, 2));
+ }
+ // setClipPath
+ {
+ img2.fill(Qt::green);
+ QPainter p(&img2);
+ p.setTransform(xf);
+ QPainterPath path;
+ path.addRect(clip);
+ p.setClipPath(path);
+ p.fillRect(img2.rect(), Qt::white);
+ QCOMPARE(img, img2);
+ }
+}
+
#if defined(Q_OS_MAC)
// Only Mac supports sub pixel positions in raster engine currently
void tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053()
@@ -4884,14 +4987,18 @@ void tst_QPainter::blendARGBonRGB_data()
<< QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 85) << 85;
QTest::newRow("ARGB_PM over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceOver << qRgba(85, 0, 0, 85) << 85;
+#if QT_CONFIG(raster_64bit)
QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
<< QPainter::CompositionMode_Source << qRgba(255, 0, 0, 85) << 85;
QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
<< QPainter::CompositionMode_Source << qRgba(255, 0, 0, 120) << 85;
+#endif
QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_Source << qRgba(85, 0, 0, 85) << 85;
+#if QT_CONFIG(raster_64bit)
QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_Source << qRgba(180, 0, 0, 180) << 170;
+#endif
QTest::newRow("ARGB source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 85) << 85;
QTest::newRow("ARGB_PM source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 67cf9a321a..86a8965cec 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -88,7 +88,9 @@ private slots:
void testToFillPolygons();
+#if QT_CONFIG(signaling_nan)
void testNaNandInfinites();
+#endif
void closing();
@@ -1228,6 +1230,7 @@ void tst_QPainterPath::testToFillPolygons()
QCOMPARE(polygons.first().count(QPointF(70, 50)), 0);
}
+#if QT_CONFIG(signaling_nan)
void tst_QPainterPath::testNaNandInfinites()
{
QPainterPath path1;
@@ -1271,6 +1274,7 @@ void tst_QPainterPath::testNaNandInfinites()
path1.lineTo(QPointF(1, 1));
QVERIFY(path1 != path2);
}
+#endif // signaling_nan
void tst_QPainterPath::connectPathDuplicatePoint()
{
diff --git a/tests/auto/gui/painting/qpathclipper/paths.cpp b/tests/auto/gui/painting/qpathclipper/paths.cpp
index 077527e1a0..1328befd1b 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.cpp
+++ b/tests/auto/gui/painting/qpathclipper/paths.cpp
@@ -578,7 +578,7 @@ QPainterPath Paths::node()
m_rect.setHeight(100);
QPainterPath shape;
- shape.addRoundRect(m_rect, 25);
+ shape.addRoundedRect(m_rect, 25, Qt::RelativeSize);
const int conWidth = 10;
const int xOffset = 7;
diff --git a/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp b/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
index c1a8f7f0de..9e9b0db366 100644
--- a/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
+++ b/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
@@ -154,12 +154,7 @@ void tst_QPdfWriter::testPageMetrics()
if (setMargins) {
// Setup the given margins
- QPdfWriter::Margins margins;
- margins.left = leftMMf;
- margins.right = rightMMf;
- margins.top = topMMf;
- margins.bottom = bottomMMf;
- writer.setMargins(margins);
+ writer.setPageMargins({leftMMf, topMMf, rightMMf, bottomMMf}, QPageLayout::Millimeter);
QCOMPARE(writer.margins().left, leftMMf);
QCOMPARE(writer.margins().right, rightMMf);
QCOMPARE(writer.margins().top, topMMf);
@@ -169,7 +164,7 @@ void tst_QPdfWriter::testPageMetrics()
// Set the given size, in Portrait mode
if (pageSize < 0) {
- writer.setPageSizeMM(sizeMMf);
+ writer.setPageSize(QPageSize(sizeMMf, QPageSize::Millimeter));
QCOMPARE(writer.pageSize(), QPdfWriter::Custom);
QCOMPARE(writer.pageLayout().pageSize().id(), QPageSize::Custom);
} else {
@@ -221,7 +216,7 @@ void tst_QPdfWriter::testPageMetrics()
// Now while in Landscape mode, set the size again, results should be the same
if (pageSize < 0) {
- writer.setPageSizeMM(sizeMMf);
+ writer.setPageSize(QPageSize(sizeMMf, QPageSize::Millimeter));
QCOMPARE(writer.pageSize(), QPdfWriter::Custom);
QCOMPARE(writer.pageLayout().pageSize().id(), QPageSize::Custom);
} else {
@@ -255,7 +250,7 @@ void tst_QPdfWriter::qtbug59443()
QTemporaryFile file;
QVERIFY2(file.open(), qPrintable(file.errorString()));
QPdfWriter writer(file.fileName());
- writer.setPageSize(QPdfWriter::A4);
+ writer.setPageSize(QPageSize(QPageSize::A4));
QTextDocument doc;
doc.documentLayout()->setPaintDevice(&writer);
diff --git a/tests/auto/gui/painting/qpen/tst_qpen.cpp b/tests/auto/gui/painting/qpen/tst_qpen.cpp
index ef65d653ce..295ae27d17 100644
--- a/tests/auto/gui/painting/qpen/tst_qpen.cpp
+++ b/tests/auto/gui/painting/qpen/tst_qpen.cpp
@@ -95,7 +95,7 @@ void tst_QPen::move()
QPen p1(Qt::black);
// check that moving does the right thing:
- QPen p2 = qMove(p1); // could be move or copy construction, so don't check p1's state
+ QPen p2 = std::move(p1); // could be move or copy construction, so don't check p1's state
QCOMPARE(p2.color(), QColor(Qt::black));
// this, executed ehre, would crash:
@@ -110,7 +110,7 @@ void tst_QPen::move()
QCOMPARE(p1.color(), QColor(Qt::yellow));
// check that moved-from QPens p2, p3 can still be safely destroyed:
- QPen p5 = qMove(p2);
+ QPen p5 = std::move(p2);
// intentionally no more statements beyond this point
}
@@ -120,7 +120,7 @@ void tst_QPen::move_assign()
QPen p1(Qt::black), p2(Qt::white);
// check that moving does the right thing:
- p2 = qMove(p1); // could be move or copy assignment, so don't check p1's state
+ p2 = std::move(p1); // could be move or copy assignment, so don't check p1's state
QCOMPARE(p2.color(), QColor(Qt::black));
// check that move-assigned-from QPen p1 can still be used, albeit
@@ -137,7 +137,7 @@ void tst_QPen::move_assign()
// check that moved-from QPens p2, p3 can still be safely destroyed:
QPen p5;
- p5 = qMove(p2);
+ p5 = std::move(p2);
// intentionally no more statements beyond this point
}
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index 24c4583819..d1ea7706b9 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -33,9 +33,6 @@
#include <qbitmap.h>
#include <qpainter.h>
#include <qpolygon.h>
-#if 0 // Used to be included in Qt4 for Q_WS_X11
-#include <private/qt_x11_p.h>
-#endif
class tst_QRegion : public QObject
{
@@ -79,9 +76,6 @@ private slots:
void isEmpty_data();
void isEmpty();
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL)
- void clipRectangles();
-#endif
void regionFromPath();
void scaleRegions_data();
@@ -910,24 +904,6 @@ void tst_QRegion::isEmpty()
#endif
}
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL)
-void tst_QRegion::clipRectangles()
-{
- QRegion region(30, 30, 30, 30);
- int num = 0;
- qt_getClipRects(region, num);
- QCOMPARE(num, 1);
-
- region += QRegion(10, 10, 10, 10);
- XRectangle *rects2 = static_cast<XRectangle *>(qt_getClipRects(region, num));
- QCOMPARE(num, 2);
-
- // Here's the important part (Y-sorted):
- QCOMPARE(int(rects2[0].y), 10);
- QCOMPARE(int(rects2[1].y), 30);
-}
-#endif
-
void tst_QRegion::regionFromPath()
{
{
diff --git a/tests/auto/gui/qopengl/BLACKLIST b/tests/auto/gui/qopengl/BLACKLIST
index a036106c57..10e0520bd9 100644
--- a/tests/auto/gui/qopengl/BLACKLIST
+++ b/tests/auto/gui/qopengl/BLACKLIST
@@ -1,10 +1,2 @@
-[fboRendering]
-windows
-[QTBUG15621_triangulatingStrokerDivZero]
-windows
-[imageFormatPainting]
-windows
-[openGLPaintDevice]
-windows
[wglContextWrap]
windows
diff --git a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
index f8dfdbd3b0..b82b277781 100644
--- a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
+++ b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
@@ -200,7 +200,7 @@ static void dumpGlConfiguration(QOpenGLContext &context, QTextStream &str)
<< "\nShading language : " << reinterpret_cast<const char *>(functions.glGetString(GL_SHADING_LANGUAGE_VERSION))
<< "\nFormat : " << context.format();
- QList<QByteArray> extensionList = context.extensions().toList();
+ QList<QByteArray> extensionList = context.extensions().values();
std::sort(extensionList.begin(), extensionList.end());
const int extensionCount = extensionList.size();
str << "\n\nFound " << extensionCount << " extensions:\n";
@@ -233,9 +233,9 @@ void tst_QOpenGlConfig::testGlConfiguration()
static inline QByteArray msgSetMismatch(const QSet<QString> &expected,
const QSet<QString> &actual)
{
- const QString result = QStringList(expected.toList()).join(QLatin1Char(','))
+ const QString result = QStringList(expected.values()).join(QLatin1Char(','))
+ QLatin1String(" != ")
- + QStringList(actual.toList()).join(QLatin1Char(','));
+ + QStringList(actual.values()).join(QLatin1Char(','));
return result.toLatin1();
}
diff --git a/tests/auto/gui/rhi/qrhi/data/compile.bat b/tests/auto/gui/rhi/qrhi/data/compile.bat
new file mode 100644
index 0000000000..5b8a77b833
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/compile.bat
@@ -0,0 +1,48 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::
+:: Copyright (C) 2019 The Qt Company Ltd.
+:: Contact: https://www.qt.io/licensing/
+::
+:: This file is part of the QtQuick module of the Qt Toolkit.
+::
+:: $QT_BEGIN_LICENSE:LGPL$
+:: Commercial License Usage
+:: Licensees holding valid commercial Qt licenses may use this file in
+:: accordance with the commercial license agreement provided with the
+:: Software or, alternatively, in accordance with the terms contained in
+:: a written agreement between you and The Qt Company. For licensing terms
+:: and conditions see https://www.qt.io/terms-conditions. For further
+:: information use the contact form at https://www.qt.io/contact-us.
+::
+:: GNU Lesser General Public License Usage
+:: Alternatively, this file may be used under the terms of the GNU Lesser
+:: General Public License version 3 as published by the Free Software
+:: Foundation and appearing in the file LICENSE.LGPL3 included in the
+:: packaging of this file. Please review the following information to
+:: ensure the GNU Lesser General Public License version 3 requirements
+:: will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+::
+:: GNU General Public License Usage
+:: Alternatively, this file may be used under the terms of the GNU
+:: General Public License version 2.0 or (at your option) the GNU General
+:: Public license version 3 or any later version approved by the KDE Free
+:: Qt Foundation. The licenses are as published by the Free Software
+:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+:: included in the packaging of this file. Please review the following
+:: information to ensure the GNU General Public License requirements will
+:: be met: https://www.gnu.org/licenses/gpl-2.0.html and
+:: https://www.gnu.org/licenses/gpl-3.0.html.
+::
+:: $QT_END_LICENSE$
+::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:: Note the -c argument: we do not want runtime HLSL compilation since that is
+:: not an option on UWP (WinRT). This means that running qsb must happen on Windows.
+
+qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o simple.vert.qsb simple.vert
+qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o simple.frag.qsb simple.frag
+qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o simpletextured.vert.qsb simpletextured.vert
+qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o simpletextured.frag.qsb simpletextured.frag
+qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o textured.vert.qsb textured.vert
+qsb --glsl "150,120,100 es" --hlsl 50 -c --msl 12 -o textured.frag.qsb textured.frag
diff --git a/tests/auto/gui/rhi/qrhi/data/qt256.png b/tests/auto/gui/rhi/qrhi/data/qt256.png
new file mode 100644
index 0000000000..30c621c9c6
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/qt256.png
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/data/simple.frag b/tests/auto/gui/rhi/qrhi/data/simple.frag
new file mode 100644
index 0000000000..2aa500e09a
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simple.frag
@@ -0,0 +1,8 @@
+#version 440
+
+layout(location = 0) out vec4 fragColor;
+
+void main()
+{
+ fragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/tests/auto/gui/rhi/qrhi/data/simple.frag.qsb b/tests/auto/gui/rhi/qrhi/data/simple.frag.qsb
new file mode 100644
index 0000000000..264b71ec0f
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simple.frag.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/data/simple.vert b/tests/auto/gui/rhi/qrhi/data/simple.vert
new file mode 100644
index 0000000000..16ee61beca
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simple.vert
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ gl_Position = position;
+}
diff --git a/tests/auto/gui/rhi/qrhi/data/simple.vert.qsb b/tests/auto/gui/rhi/qrhi/data/simple.vert.qsb
new file mode 100644
index 0000000000..59080b60c6
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simple.vert.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/data/simpletextured.frag b/tests/auto/gui/rhi/qrhi/data/simpletextured.frag
new file mode 100644
index 0000000000..630df7b807
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simpletextured.frag
@@ -0,0 +1,13 @@
+#version 440
+
+layout(location = 0) in vec2 uv;
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 0) uniform sampler2D tex;
+
+void main()
+{
+ vec4 c = texture(tex, uv);
+ c.rgb *= c.a;
+ fragColor = c;
+}
diff --git a/tests/auto/gui/rhi/qrhi/data/simpletextured.frag.qsb b/tests/auto/gui/rhi/qrhi/data/simpletextured.frag.qsb
new file mode 100644
index 0000000000..f302702aa9
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simpletextured.frag.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/data/simpletextured.vert b/tests/auto/gui/rhi/qrhi/data/simpletextured.vert
new file mode 100644
index 0000000000..1dd204f84d
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simpletextured.vert
@@ -0,0 +1,14 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 1) in vec2 texcoord;
+
+layout(location = 0) out vec2 uv;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ uv = texcoord;
+ gl_Position = position;
+}
diff --git a/tests/auto/gui/rhi/qrhi/data/simpletextured.vert.qsb b/tests/auto/gui/rhi/qrhi/data/simpletextured.vert.qsb
new file mode 100644
index 0000000000..e4f12bfb9e
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/simpletextured.vert.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/data/textured.frag b/tests/auto/gui/rhi/qrhi/data/textured.frag
new file mode 100644
index 0000000000..605410b028
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/textured.frag
@@ -0,0 +1,19 @@
+#version 440
+
+layout(location = 0) in vec2 uv;
+layout(location = 0) out vec4 fragColor;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 matrix;
+ float opacity;
+} ubuf;
+
+layout(binding = 1) uniform sampler2D tex;
+
+void main()
+{
+ vec4 c = texture(tex, uv);
+ c.a *= ubuf.opacity;
+ c.rgb *= c.a;
+ fragColor = c;
+}
diff --git a/tests/auto/gui/rhi/qrhi/data/textured.frag.qsb b/tests/auto/gui/rhi/qrhi/data/textured.frag.qsb
new file mode 100644
index 0000000000..0a039137ec
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/textured.frag.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/data/textured.vert b/tests/auto/gui/rhi/qrhi/data/textured.vert
new file mode 100644
index 0000000000..f1ccf2ee50
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/textured.vert
@@ -0,0 +1,19 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 1) in vec2 texcoord;
+
+layout(location = 0) out vec2 uv;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 matrix;
+ float opacity;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ uv = texcoord;
+ gl_Position = ubuf.matrix * position;
+}
diff --git a/tests/auto/gui/rhi/qrhi/data/textured.vert.qsb b/tests/auto/gui/rhi/qrhi/data/textured.vert.qsb
new file mode 100644
index 0000000000..7853f77943
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/data/textured.vert.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qrhi/qrhi.pro b/tests/auto/gui/rhi/qrhi/qrhi.pro
new file mode 100644
index 0000000000..58000ed514
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/qrhi.pro
@@ -0,0 +1,8 @@
+TARGET = tst_qrhi
+CONFIG += testcase
+
+QT += testlib gui-private
+
+SOURCES += tst_qrhi.cpp
+
+RESOURCES += qrhi.qrc
diff --git a/tests/auto/gui/rhi/qrhi/qrhi.qrc b/tests/auto/gui/rhi/qrhi/qrhi.qrc
new file mode 100644
index 0000000000..f161d8aad6
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/qrhi.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>data</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
new file mode 100644
index 0000000000..533d6b17b1
--- /dev/null
+++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp
@@ -0,0 +1,1732 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QThread>
+#include <QFile>
+#include <QOffscreenSurface>
+#include <QPainter>
+
+#include <QtGui/private/qrhi_p.h>
+#include <QtGui/private/qrhinull_p.h>
+
+#if QT_CONFIG(opengl)
+# include <QOpenGLContext>
+# include <QtGui/private/qrhigles2_p.h>
+# define TST_GL
+#endif
+
+#if QT_CONFIG(vulkan)
+# include <QVulkanInstance>
+# include <QtGui/private/qrhivulkan_p.h>
+# define TST_VK
+#endif
+
+#ifdef Q_OS_WIN
+#include <QtGui/private/qrhid3d11_p.h>
+# define TST_D3D11
+#endif
+
+#ifdef Q_OS_DARWIN
+# include <QtGui/private/qrhimetal_p.h>
+# define TST_MTL
+#endif
+
+Q_DECLARE_METATYPE(QRhi::Implementation)
+Q_DECLARE_METATYPE(QRhiInitParams *)
+
+class tst_QRhi : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void initTestCase();
+ void cleanupTestCase();
+
+ void rhiTestData();
+ void create_data();
+ void create();
+ void nativeHandles_data();
+ void nativeHandles();
+ void resourceUpdateBatchBuffer_data();
+ void resourceUpdateBatchBuffer();
+ void resourceUpdateBatchRGBATextureUpload_data();
+ void resourceUpdateBatchRGBATextureUpload();
+ void resourceUpdateBatchRGBATextureCopy_data();
+ void resourceUpdateBatchRGBATextureCopy();
+ void resourceUpdateBatchRGBATextureMip_data();
+ void resourceUpdateBatchRGBATextureMip();
+ void invalidPipeline_data();
+ void invalidPipeline();
+ void renderToTextureSimple_data();
+ void renderToTextureSimple();
+ void renderToTextureTexturedQuad_data();
+ void renderToTextureTexturedQuad();
+ void renderToTextureTexturedQuadAndUniformBuffer_data();
+ void renderToTextureTexturedQuadAndUniformBuffer();
+ void renderToWindowSimple_data();
+ void renderToWindowSimple();
+
+private:
+ struct {
+ QRhiNullInitParams null;
+#ifdef TST_GL
+ QRhiGles2InitParams gl;
+#endif
+#ifdef TST_VK
+ QRhiVulkanInitParams vk;
+#endif
+#ifdef TST_D3D11
+ QRhiD3D11InitParams d3d;
+#endif
+#ifdef TST_MTL
+ QRhiMetalInitParams mtl;
+#endif
+ } initParams;
+
+#ifdef TST_VK
+ QVulkanInstance vulkanInstance;
+#endif
+ QOffscreenSurface *fallbackSurface = nullptr;
+};
+
+void tst_QRhi::initTestCase()
+{
+#ifdef TST_GL
+ fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
+ initParams.gl.fallbackSurface = fallbackSurface;
+#endif
+
+#ifdef TST_VK
+#ifndef Q_OS_ANDROID
+ vulkanInstance.setLayers({ QByteArrayLiteral("VK_LAYER_LUNARG_standard_validation") });
+#else
+ vulkanInstance.setLayers({ QByteArrayLiteral("VK_LAYER_GOOGLE_threading"),
+ QByteArrayLiteral("VK_LAYER_LUNARG_parameter_validation"),
+ QByteArrayLiteral("VK_LAYER_LUNARG_object_tracker"),
+ QByteArrayLiteral("VK_LAYER_LUNARG_core_validation"),
+ QByteArrayLiteral("VK_LAYER_LUNARG_image"),
+ QByteArrayLiteral("VK_LAYER_LUNARG_swapchain"),
+ QByteArrayLiteral("VK_LAYER_GOOGLE_unique_objects") });
+#endif
+ vulkanInstance.setExtensions(QByteArrayList()
+ << "VK_KHR_get_physical_device_properties2");
+ vulkanInstance.create();
+ initParams.vk.inst = &vulkanInstance;
+#endif
+
+#ifdef TST_D3D11
+ initParams.d3d.enableDebugLayer = true;
+#endif
+}
+
+void tst_QRhi::cleanupTestCase()
+{
+#ifdef TST_VK
+ vulkanInstance.destroy();
+#endif
+
+ delete fallbackSurface;
+}
+
+void tst_QRhi::rhiTestData()
+{
+ QTest::addColumn<QRhi::Implementation>("impl");
+ QTest::addColumn<QRhiInitParams *>("initParams");
+
+ QTest::newRow("Null") << QRhi::Null << static_cast<QRhiInitParams *>(&initParams.null);
+#ifdef TST_GL
+ QTest::newRow("OpenGL") << QRhi::OpenGLES2 << static_cast<QRhiInitParams *>(&initParams.gl);
+#endif
+#ifdef TST_VK
+ if (vulkanInstance.isValid())
+ QTest::newRow("Vulkan") << QRhi::Vulkan << static_cast<QRhiInitParams *>(&initParams.vk);
+#endif
+#ifdef TST_D3D11
+ QTest::newRow("Direct3D 11") << QRhi::D3D11 << static_cast<QRhiInitParams *>(&initParams.d3d);
+#endif
+#ifdef TST_MTL
+ QTest::newRow("Metal") << QRhi::Metal << static_cast<QRhiInitParams *>(&initParams.mtl);
+#endif
+}
+
+void tst_QRhi::create_data()
+{
+ rhiTestData();
+}
+
+static int aligned(int v, int a)
+{
+ return (v + a - 1) & ~(a - 1);
+}
+
+void tst_QRhi::create()
+{
+ // Merely attempting to create a QRhi should survive, with an error when
+ // not supported. (of course, there is always a chance we encounter a crash
+ // due to some random graphics stack...)
+
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+
+ if (rhi) {
+ QCOMPARE(rhi->backend(), impl);
+ QCOMPARE(rhi->thread(), QThread::currentThread());
+
+ // do a basic smoke test for the apis that do not directly render anything
+
+ int cleanupOk = 0;
+ QRhi *rhiPtr = rhi.data();
+ auto cleanupFunc = [rhiPtr, &cleanupOk](QRhi *dyingRhi) {
+ if (rhiPtr == dyingRhi)
+ cleanupOk += 1;
+ };
+ rhi->addCleanupCallback(cleanupFunc);
+ rhi->runCleanup();
+ QCOMPARE(cleanupOk, 1);
+ cleanupOk = 0;
+ rhi->addCleanupCallback(cleanupFunc);
+
+ QRhiResourceUpdateBatch *resUpd = rhi->nextResourceUpdateBatch();
+ QVERIFY(resUpd);
+ resUpd->release();
+
+ QVERIFY(!rhi->supportedSampleCounts().isEmpty());
+ QVERIFY(rhi->supportedSampleCounts().contains(1));
+
+ QVERIFY(rhi->ubufAlignment() > 0);
+ QCOMPARE(rhi->ubufAligned(123), aligned(123, rhi->ubufAlignment()));
+
+ QCOMPARE(rhi->mipLevelsForSize(QSize(512, 300)), 10);
+ QCOMPARE(rhi->sizeForMipLevel(0, QSize(512, 300)), QSize(512, 300));
+ QCOMPARE(rhi->sizeForMipLevel(1, QSize(512, 300)), QSize(256, 150));
+ QCOMPARE(rhi->sizeForMipLevel(2, QSize(512, 300)), QSize(128, 75));
+ QCOMPARE(rhi->sizeForMipLevel(9, QSize(512, 300)), QSize(1, 1));
+
+ const bool fbUp = rhi->isYUpInFramebuffer();
+ const bool ndcUp = rhi->isYUpInNDC();
+ const bool d0to1 = rhi->isClipDepthZeroToOne();
+ const QMatrix4x4 corrMat = rhi->clipSpaceCorrMatrix();
+ if (impl == QRhi::OpenGLES2) {
+ QVERIFY(fbUp);
+ QVERIFY(ndcUp);
+ QVERIFY(!d0to1);
+ QVERIFY(corrMat.isIdentity());
+ } else if (impl == QRhi::Vulkan) {
+ QVERIFY(!fbUp);
+ QVERIFY(!ndcUp);
+ QVERIFY(d0to1);
+ QVERIFY(!corrMat.isIdentity());
+ } else if (impl == QRhi::D3D11) {
+ QVERIFY(!fbUp);
+ QVERIFY(ndcUp);
+ QVERIFY(d0to1);
+ QVERIFY(!corrMat.isIdentity());
+ } else if (impl == QRhi::Metal) {
+ QVERIFY(!fbUp);
+ QVERIFY(ndcUp);
+ QVERIFY(d0to1);
+ QVERIFY(!corrMat.isIdentity());
+ }
+
+ const int texMin = rhi->resourceLimit(QRhi::TextureSizeMin);
+ const int texMax = rhi->resourceLimit(QRhi::TextureSizeMax);
+ const int maxAtt = rhi->resourceLimit(QRhi::MaxColorAttachments);
+ const int framesInFlight = rhi->resourceLimit(QRhi::FramesInFlight);
+ QVERIFY(texMin >= 1);
+ QVERIFY(texMax >= texMin);
+ QVERIFY(maxAtt >= 1);
+ QVERIFY(framesInFlight >= 1);
+
+ QVERIFY(rhi->nativeHandles());
+ QVERIFY(rhi->profiler());
+
+ const QRhi::Feature features[] = {
+ QRhi::MultisampleTexture,
+ QRhi::MultisampleRenderBuffer,
+ QRhi::DebugMarkers,
+ QRhi::Timestamps,
+ QRhi::Instancing,
+ QRhi::CustomInstanceStepRate,
+ QRhi::PrimitiveRestart,
+ QRhi::NonDynamicUniformBuffers,
+ QRhi::NonFourAlignedEffectiveIndexBufferOffset,
+ QRhi::NPOTTextureRepeat,
+ QRhi::RedOrAlpha8IsRed,
+ QRhi::ElementIndexUint,
+ QRhi::Compute,
+ QRhi::WideLines,
+ QRhi::VertexShaderPointSize,
+ QRhi::BaseVertex,
+ QRhi::BaseInstance,
+ QRhi::TriangleFanTopology,
+ QRhi::ReadBackNonUniformBuffer,
+ QRhi::ReadBackNonBaseMipLevel
+ };
+ for (size_t i = 0; i <sizeof(features) / sizeof(QRhi::Feature); ++i)
+ rhi->isFeatureSupported(features[i]);
+
+ QVERIFY(rhi->isTextureFormatSupported(QRhiTexture::RGBA8));
+
+ rhi->releaseCachedResources();
+
+ QVERIFY(!rhi->isDeviceLost());
+
+ rhi.reset();
+ QCOMPARE(cleanupOk, 1);
+ }
+}
+
+void tst_QRhi::nativeHandles_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::nativeHandles()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing native handles");
+
+ // QRhi::nativeHandles()
+ {
+ const QRhiNativeHandles *rhiHandles = rhi->nativeHandles();
+ Q_ASSERT(rhiHandles);
+
+ switch (impl) {
+ case QRhi::Null:
+ break;
+#ifdef TST_VK
+ case QRhi::Vulkan:
+ {
+ const QRhiVulkanNativeHandles *vkHandles = static_cast<const QRhiVulkanNativeHandles *>(rhiHandles);
+ QVERIFY(vkHandles->physDev);
+ QVERIFY(vkHandles->dev);
+ QVERIFY(vkHandles->gfxQueueFamilyIdx >= 0);
+ QVERIFY(vkHandles->gfxQueue);
+ QVERIFY(vkHandles->cmdPool);
+ QVERIFY(vkHandles->vmemAllocator);
+ }
+ break;
+#endif
+#ifdef TST_GL
+ case QRhi::OpenGLES2:
+ {
+ const QRhiGles2NativeHandles *glHandles = static_cast<const QRhiGles2NativeHandles *>(rhiHandles);
+ QVERIFY(glHandles->context);
+ QVERIFY(glHandles->context->isValid());
+ glHandles->context->doneCurrent();
+ QVERIFY(!QOpenGLContext::currentContext());
+ rhi->makeThreadLocalNativeContextCurrent();
+ QVERIFY(QOpenGLContext::currentContext() == glHandles->context);
+ }
+ break;
+#endif
+#ifdef TST_D3D11
+ case QRhi::D3D11:
+ {
+ const QRhiD3D11NativeHandles *d3dHandles = static_cast<const QRhiD3D11NativeHandles *>(rhiHandles);
+ QVERIFY(d3dHandles->dev);
+ QVERIFY(d3dHandles->context);
+ }
+ break;
+#endif
+#ifdef TST_MTL
+ case QRhi::Metal:
+ {
+ const QRhiMetalNativeHandles *mtlHandles = static_cast<const QRhiMetalNativeHandles *>(rhiHandles);
+ QVERIFY(mtlHandles->dev);
+ QVERIFY(mtlHandles->cmdQueue);
+ }
+ break;
+#endif
+ default:
+ Q_ASSERT(false);
+ }
+ }
+
+ // QRhiTexture::nativeHandles()
+ {
+ QScopedPointer<QRhiTexture> tex(rhi->newTexture(QRhiTexture::RGBA8, QSize(512, 256)));
+ QVERIFY(tex->build());
+
+ const QRhiNativeHandles *texHandles = tex->nativeHandles();
+ QVERIFY(texHandles);
+
+ switch (impl) {
+ case QRhi::Null:
+ break;
+#ifdef TST_VK
+ case QRhi::Vulkan:
+ {
+ const QRhiVulkanTextureNativeHandles *vkHandles = static_cast<const QRhiVulkanTextureNativeHandles *>(texHandles);
+ QVERIFY(vkHandles->image);
+ QVERIFY(vkHandles->layout >= 1); // VK_IMAGE_LAYOUT_GENERAL
+ QVERIFY(vkHandles->layout <= 8); // VK_IMAGE_LAYOUT_PREINITIALIZED
+ }
+ break;
+#endif
+#ifdef TST_GL
+ case QRhi::OpenGLES2:
+ {
+ const QRhiGles2TextureNativeHandles *glHandles = static_cast<const QRhiGles2TextureNativeHandles *>(texHandles);
+ QVERIFY(glHandles->texture);
+ }
+ break;
+#endif
+#ifdef TST_D3D11
+ case QRhi::D3D11:
+ {
+ const QRhiD3D11TextureNativeHandles *d3dHandles = static_cast<const QRhiD3D11TextureNativeHandles *>(texHandles);
+ QVERIFY(d3dHandles->texture);
+ }
+ break;
+#endif
+#ifdef TST_MTL
+ case QRhi::Metal:
+ {
+ const QRhiMetalTextureNativeHandles *mtlHandles = static_cast<const QRhiMetalTextureNativeHandles *>(texHandles);
+ QVERIFY(mtlHandles->texture);
+ }
+ break;
+#endif
+ default:
+ Q_ASSERT(false);
+ }
+ }
+
+ // QRhiCommandBuffer::nativeHandles()
+ {
+ QRhiCommandBuffer *cb = nullptr;
+ QRhi::FrameOpResult result = rhi->beginOffscreenFrame(&cb);
+ QVERIFY(result == QRhi::FrameOpSuccess);
+ QVERIFY(cb);
+
+ const QRhiNativeHandles *cbHandles = cb->nativeHandles();
+ // no null check here, backends where not applicable will return null
+
+ switch (impl) {
+ case QRhi::Null:
+ break;
+#ifdef TST_VK
+ case QRhi::Vulkan:
+ {
+ const QRhiVulkanCommandBufferNativeHandles *vkHandles = static_cast<const QRhiVulkanCommandBufferNativeHandles *>(cbHandles);
+ QVERIFY(vkHandles);
+ QVERIFY(vkHandles->commandBuffer);
+ }
+ break;
+#endif
+#ifdef TST_GL
+ case QRhi::OpenGLES2:
+ break;
+#endif
+#ifdef TST_D3D11
+ case QRhi::D3D11:
+ break;
+#endif
+#ifdef TST_MTL
+ case QRhi::Metal:
+ {
+ const QRhiMetalCommandBufferNativeHandles *mtlHandles = static_cast<const QRhiMetalCommandBufferNativeHandles *>(cbHandles);
+ QVERIFY(mtlHandles);
+ QVERIFY(mtlHandles->commandBuffer);
+ QVERIFY(!mtlHandles->encoder);
+
+ QScopedPointer<QRhiTexture> tex(rhi->newTexture(QRhiTexture::RGBA8, QSize(512, 512), 1, QRhiTexture::RenderTarget));
+ QVERIFY(tex->build());
+ QScopedPointer<QRhiTextureRenderTarget> rt(rhi->newTextureRenderTarget({ tex.data() }));
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(rt->newCompatibleRenderPassDescriptor());
+ QVERIFY(rpDesc);
+ rt->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(rt->build());
+ cb->beginPass(rt.data(), Qt::red, { 1.0f, 0 });
+ QVERIFY(static_cast<const QRhiMetalCommandBufferNativeHandles *>(cb->nativeHandles())->encoder);
+ cb->endPass();
+ }
+ break;
+#endif
+ default:
+ Q_ASSERT(false);
+ }
+
+ rhi->endOffscreenFrame();
+ }
+
+ // QRhiRenderPassDescriptor::nativeHandles()
+ {
+ QScopedPointer<QRhiTexture> tex(rhi->newTexture(QRhiTexture::RGBA8, QSize(512, 512), 1, QRhiTexture::RenderTarget));
+ QVERIFY(tex->build());
+ QScopedPointer<QRhiTextureRenderTarget> rt(rhi->newTextureRenderTarget({ tex.data() }));
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(rt->newCompatibleRenderPassDescriptor());
+ QVERIFY(rpDesc);
+ rt->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(rt->build());
+
+ const QRhiNativeHandles *rpHandles = rpDesc->nativeHandles();
+ switch (impl) {
+ case QRhi::Null:
+ break;
+#ifdef TST_VK
+ case QRhi::Vulkan:
+ {
+ const QRhiVulkanRenderPassNativeHandles *vkHandles = static_cast<const QRhiVulkanRenderPassNativeHandles *>(rpHandles);
+ QVERIFY(vkHandles);
+ QVERIFY(vkHandles->renderPass);
+ }
+ break;
+#endif
+#ifdef TST_GL
+ case QRhi::OpenGLES2:
+ break;
+#endif
+#ifdef TST_D3D11
+ case QRhi::D3D11:
+ break;
+#endif
+#ifdef TST_MTL
+ case QRhi::Metal:
+ break;
+#endif
+ default:
+ Q_ASSERT(false);
+ }
+ }
+}
+
+static bool submitResourceUpdates(QRhi *rhi, QRhiResourceUpdateBatch *batch)
+{
+ QRhiCommandBuffer *cb = nullptr;
+ QRhi::FrameOpResult result = rhi->beginOffscreenFrame(&cb);
+ if (result != QRhi::FrameOpSuccess) {
+ qWarning("beginOffscreenFrame returned %d", result);
+ return false;
+ }
+ if (!cb) {
+ qWarning("No command buffer from beginOffscreenFrame");
+ return false;
+ }
+ cb->resourceUpdate(batch);
+ rhi->endOffscreenFrame();
+ return true;
+}
+
+void tst_QRhi::resourceUpdateBatchBuffer_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::resourceUpdateBatchBuffer()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing buffer resource updates");
+
+ const int bufferSize = 23;
+ const QByteArray a(bufferSize, 'A');
+ const QByteArray b(bufferSize, 'B');
+
+ // dynamic buffer, updates, readback
+ {
+ QScopedPointer<QRhiBuffer> dynamicBuffer(rhi->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, bufferSize));
+ QVERIFY(dynamicBuffer->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+ QVERIFY(batch);
+
+ batch->updateDynamicBuffer(dynamicBuffer.data(), 10, bufferSize - 10, a.constData());
+ batch->updateDynamicBuffer(dynamicBuffer.data(), 0, 12, b.constData());
+
+ QRhiBufferReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackBuffer(dynamicBuffer.data(), 5, 10, &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+
+ // Offscreen frames are synchronous, so the readback must have
+ // completed at this point. With swapchain frames this would not be the
+ // case.
+ QVERIFY(readCompleted);
+ QVERIFY(readResult.data.size() == 10);
+ QCOMPARE(readResult.data.left(7), QByteArrayLiteral("BBBBBBB"));
+ QCOMPARE(readResult.data.mid(7), QByteArrayLiteral("AAA"));
+ }
+
+ // static buffer, updates, readback
+ {
+ QScopedPointer<QRhiBuffer> dynamicBuffer(rhi->newBuffer(QRhiBuffer::Static, QRhiBuffer::VertexBuffer, bufferSize));
+ QVERIFY(dynamicBuffer->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+ QVERIFY(batch);
+
+ batch->uploadStaticBuffer(dynamicBuffer.data(), 10, bufferSize - 10, a.constData());
+ batch->uploadStaticBuffer(dynamicBuffer.data(), 0, 12, b.constData());
+
+ QRhiBufferReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+
+ if (rhi->isFeatureSupported(QRhi::ReadBackNonUniformBuffer))
+ batch->readBackBuffer(dynamicBuffer.data(), 5, 10, &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+
+ if (rhi->isFeatureSupported(QRhi::ReadBackNonUniformBuffer)) {
+ QVERIFY(readCompleted);
+ QVERIFY(readResult.data.size() == 10);
+ QCOMPARE(readResult.data.left(7), QByteArrayLiteral("BBBBBBB"));
+ QCOMPARE(readResult.data.mid(7), QByteArrayLiteral("AAA"));
+ } else {
+ qDebug("Skipping verifying buffer contents because readback is not supported");
+ }
+ }
+}
+
+inline bool imageRGBAEquals(const QImage &a, const QImage &b)
+{
+ const int maxFuzz = 1;
+
+ if (a.size() != b.size())
+ return false;
+
+ const QImage image0 = a.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
+ const QImage image1 = b.convertToFormat(QImage::Format_RGBA8888_Premultiplied);
+
+ const int width = image0.width();
+ const int height = image0.height();
+ for (int y = 0; y < height; ++y) {
+ const quint32 *p0 = reinterpret_cast<const quint32 *>(image0.constScanLine(y));
+ const quint32 *p1 = reinterpret_cast<const quint32 *>(image1.constScanLine(y));
+ int x = width - 1;
+ while (x-- >= 0) {
+ const QRgb c0(*p0++);
+ const QRgb c1(*p1++);
+ const int red = qAbs(qRed(c0) - qRed(c1));
+ const int green = qAbs(qGreen(c0) - qGreen(c1));
+ const int blue = qAbs(qBlue(c0) - qBlue(c1));
+ const int alpha = qAbs(qAlpha(c0) - qAlpha(c1));
+ if (red > maxFuzz || green > maxFuzz || blue > maxFuzz || alpha > maxFuzz)
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void tst_QRhi::resourceUpdateBatchRGBATextureUpload_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::resourceUpdateBatchRGBATextureUpload()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing texture resource updates");
+
+ QImage image(234, 123, QImage::Format_RGBA8888_Premultiplied);
+ image.fill(Qt::red);
+ QPainter painter;
+ const QPoint greenRectPos(35, 50);
+ const QSize greenRectSize(100, 50);
+ painter.begin(&image);
+ painter.fillRect(QRect(greenRectPos, greenRectSize), Qt::green);
+ painter.end();
+
+ // simple image upload; uploading and reading back RGBA8 is supported by the Null backend even
+ {
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, image.size(),
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+ batch->uploadTexture(texture.data(), image);
+
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(texture.data(), &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ // like with buffers, the readback is now complete due to endOffscreenFrame()
+ QVERIFY(readCompleted);
+ QCOMPARE(readResult.format, QRhiTexture::RGBA8);
+ QCOMPARE(readResult.pixelSize, image.size());
+
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ image.format());
+
+ QVERIFY(imageRGBAEquals(image, wrapperImage));
+ }
+
+ // the same with raw data
+ {
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, image.size(),
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+
+ QRhiTextureUploadEntry upload(0, 0, { image.constBits(), int(image.sizeInBytes()) });
+ QRhiTextureUploadDescription uploadDesc(upload);
+ batch->uploadTexture(texture.data(), uploadDesc);
+
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(texture.data(), &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ QCOMPARE(readResult.format, QRhiTexture::RGBA8);
+ QCOMPARE(readResult.pixelSize, image.size());
+
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ image.format());
+
+ QVERIFY(imageRGBAEquals(image, wrapperImage));
+ }
+
+ // partial image upload at a non-zero destination position
+ {
+ const QSize copySize(30, 40);
+ const int gap = 10;
+ const QSize fullSize(copySize.width() + gap, copySize.height() + gap);
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, fullSize,
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+
+ QImage clearImage(fullSize, image.format());
+ clearImage.fill(Qt::black);
+ batch->uploadTexture(texture.data(), clearImage);
+
+ // copy green pixels of copySize to (gap, gap), leaving a black bar of
+ // gap pixels on the left and top
+ QRhiTextureSubresourceUploadDescription desc;
+ desc.setImage(image);
+ desc.setSourceSize(copySize);
+ desc.setDestinationTopLeft(QPoint(gap, gap));
+ desc.setSourceTopLeft(greenRectPos);
+
+ batch->uploadTexture(texture.data(), QRhiTextureUploadDescription({ 0, 0, desc }));
+
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(texture.data(), &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ QCOMPARE(readResult.format, QRhiTexture::RGBA8);
+ QCOMPARE(readResult.pixelSize, clearImage.size());
+
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ image.format());
+
+ QVERIFY(!imageRGBAEquals(clearImage, wrapperImage));
+
+ QImage expectedImage = clearImage;
+ QPainter painter(&expectedImage);
+ painter.fillRect(QRect(QPoint(gap, gap), QSize(copySize)), Qt::green);
+ painter.end();
+
+ QVERIFY(imageRGBAEquals(expectedImage, wrapperImage));
+ }
+
+ // the same (partial upload) with raw data as source
+ {
+ const QSize copySize(30, 40);
+ const int gap = 10;
+ const QSize fullSize(copySize.width() + gap, copySize.height() + gap);
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, fullSize,
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+
+ QImage clearImage(fullSize, image.format());
+ clearImage.fill(Qt::black);
+ batch->uploadTexture(texture.data(), clearImage);
+
+ // SourceTopLeft is not supported for non-QImage-based uploads.
+ const QImage im = image.copy(QRect(greenRectPos, copySize));
+ QRhiTextureSubresourceUploadDescription desc;
+ desc.setData(QByteArray::fromRawData(reinterpret_cast<const char *>(im.constBits()),
+ int(im.sizeInBytes())));
+ desc.setSourceSize(copySize);
+ desc.setDestinationTopLeft(QPoint(gap, gap));
+
+ batch->uploadTexture(texture.data(), QRhiTextureUploadDescription({ 0, 0, desc }));
+
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(texture.data(), &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ QCOMPARE(readResult.format, QRhiTexture::RGBA8);
+ QCOMPARE(readResult.pixelSize, clearImage.size());
+
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ image.format());
+
+ QVERIFY(!imageRGBAEquals(clearImage, wrapperImage));
+
+ QImage expectedImage = clearImage;
+ QPainter painter(&expectedImage);
+ painter.fillRect(QRect(QPoint(gap, gap), QSize(copySize)), Qt::green);
+ painter.end();
+
+ QVERIFY(imageRGBAEquals(expectedImage, wrapperImage));
+ }
+
+ // now a QImage from an actual file
+ {
+ QImage inputImage;
+ inputImage.load(QLatin1String(":/data/qt256.png"));
+ QVERIFY(!inputImage.isNull());
+ inputImage = std::move(inputImage).convertToFormat(image.format());
+
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, inputImage.size(),
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+ batch->uploadTexture(texture.data(), inputImage);
+
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(texture.data(), &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ inputImage.format());
+
+ QVERIFY(imageRGBAEquals(inputImage, wrapperImage));
+ }
+}
+
+void tst_QRhi::resourceUpdateBatchRGBATextureCopy_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::resourceUpdateBatchRGBATextureCopy()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing texture resource updates");
+
+ QImage red(256, 256, QImage::Format_RGBA8888_Premultiplied);
+ red.fill(Qt::red);
+
+ QImage green(35, 73, red.format());
+ green.fill(Qt::green);
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+
+ QScopedPointer<QRhiTexture> redTexture(rhi->newTexture(QRhiTexture::RGBA8, red.size(),
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(redTexture->build());
+ batch->uploadTexture(redTexture.data(), red);
+
+ QScopedPointer<QRhiTexture> greenTexture(rhi->newTexture(QRhiTexture::RGBA8, green.size(),
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(greenTexture->build());
+ batch->uploadTexture(greenTexture.data(), green);
+
+ // 1. simple copy red -> texture; 2. subimage copy green -> texture; 3. partial subimage copy green -> texture
+ {
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, red.size(),
+ 1, QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ // 1.
+ batch->copyTexture(texture.data(), redTexture.data());
+
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(texture.data(), &readResult);
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ red.format());
+ QVERIFY(imageRGBAEquals(red, wrapperImage));
+
+ batch = rhi->nextResourceUpdateBatch();
+ readCompleted = false;
+
+ // 2.
+ QRhiTextureCopyDescription copyDesc;
+ copyDesc.setDestinationTopLeft(QPoint(15, 23));
+ batch->copyTexture(texture.data(), greenTexture.data(), copyDesc);
+
+ batch->readBackTexture(texture.data(), &readResult);
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ wrapperImage = QImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ red.format());
+
+ QImage expectedImage = red;
+ QPainter painter(&expectedImage);
+ painter.drawImage(copyDesc.destinationTopLeft(), green);
+ painter.end();
+
+ QVERIFY(imageRGBAEquals(expectedImage, wrapperImage));
+
+ batch = rhi->nextResourceUpdateBatch();
+ readCompleted = false;
+
+ // 3.
+ copyDesc.setDestinationTopLeft(QPoint(125, 89));
+ copyDesc.setSourceTopLeft(QPoint(5, 5));
+ copyDesc.setPixelSize(QSize(26, 45));
+ batch->copyTexture(texture.data(), greenTexture.data(), copyDesc);
+
+ batch->readBackTexture(texture.data(), &readResult);
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+ wrapperImage = QImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ red.format());
+
+ painter.begin(&expectedImage);
+ painter.drawImage(copyDesc.destinationTopLeft(), green,
+ QRect(copyDesc.sourceTopLeft(), copyDesc.pixelSize()));
+ painter.end();
+
+ QVERIFY(imageRGBAEquals(expectedImage, wrapperImage));
+ }
+}
+
+void tst_QRhi::resourceUpdateBatchRGBATextureMip_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::resourceUpdateBatchRGBATextureMip()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing texture resource updates");
+
+
+ QImage red(512, 512, QImage::Format_RGBA8888_Premultiplied);
+ red.fill(Qt::red);
+
+ const QRhiTexture::Flags textureFlags =
+ QRhiTexture::UsedAsTransferSource
+ | QRhiTexture::MipMapped
+ | QRhiTexture::UsedWithGenerateMips;
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, red.size(), 1, textureFlags));
+ QVERIFY(texture->build());
+
+ QRhiResourceUpdateBatch *batch = rhi->nextResourceUpdateBatch();
+ batch->uploadTexture(texture.data(), red);
+ batch->generateMips(texture.data());
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+
+ const int levelCount = rhi->mipLevelsForSize(red.size());
+ QCOMPARE(levelCount, 10);
+ for (int level = 0; level < levelCount; ++level) {
+ batch = rhi->nextResourceUpdateBatch();
+
+ QRhiReadbackDescription readDesc(texture.data());
+ readDesc.setLevel(level);
+ QRhiReadbackResult readResult;
+ bool readCompleted = false;
+ readResult.completed = [&readCompleted] { readCompleted = true; };
+ batch->readBackTexture(readDesc, &readResult);
+
+ QVERIFY(submitResourceUpdates(rhi.data(), batch));
+ QVERIFY(readCompleted);
+
+ const QSize expectedSize = rhi->sizeForMipLevel(level, texture->pixelSize());
+ QCOMPARE(readResult.pixelSize, expectedSize);
+
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ red.format());
+ QImage expectedImage;
+ if (level == 0 || rhi->isFeatureSupported(QRhi::ReadBackNonBaseMipLevel)) {
+ // Compare to a scaled version; we can do this safely only because we
+ // only have plain red pixels in the source image.
+ expectedImage = red.scaled(expectedSize);
+ } else {
+ qDebug("Expecting all-zero image for level %d because reading back a level other than 0 is not supported", level);
+ expectedImage = QImage(readResult.pixelSize, red.format());
+ expectedImage.fill(0);
+ }
+ QVERIFY(imageRGBAEquals(expectedImage, wrapperImage));
+ }
+}
+
+static QShader loadShader(const char *name)
+{
+ QFile f(QString::fromUtf8(name));
+ if (f.open(QIODevice::ReadOnly)) {
+ const QByteArray contents = f.readAll();
+ return QShader::fromSerialized(contents);
+ }
+ return QShader();
+}
+
+void tst_QRhi::invalidPipeline_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::invalidPipeline()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing empty shader");
+
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, QSize(256, 256), 1, QRhiTexture::RenderTarget));
+ QVERIFY(texture->build());
+ QScopedPointer<QRhiTextureRenderTarget> rt(rhi->newTextureRenderTarget({ texture.data() }));
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(rt->newCompatibleRenderPassDescriptor());
+ rt->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(rt->build());
+
+ QRhiCommandBuffer *cb = nullptr;
+ QVERIFY(rhi->beginOffscreenFrame(&cb) == QRhi::FrameOpSuccess);
+ QVERIFY(cb);
+
+ QScopedPointer<QRhiShaderResourceBindings> srb(rhi->newShaderResourceBindings());
+ QVERIFY(srb->build());
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({ { 2 * sizeof(float) } });
+ inputLayout.setAttributes({ { 0, 0, QRhiVertexInputAttribute::Float2, 0 } });
+
+ // no stages
+ QScopedPointer<QRhiGraphicsPipeline> pipeline(rhi->newGraphicsPipeline());
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(!pipeline->build());
+
+ QShader vs;
+ QShader fs;
+
+ // no shaders in the stages
+ pipeline.reset(rhi->newGraphicsPipeline());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(!pipeline->build());
+
+ vs = loadShader(":/data/simple.vert.qsb");
+ QVERIFY(vs.isValid());
+ fs = loadShader(":/data/simple.frag.qsb");
+ QVERIFY(fs.isValid());
+
+ // no vertex stage
+ pipeline.reset(rhi->newGraphicsPipeline());
+ pipeline->setShaderStages({ { QRhiShaderStage::Fragment, fs } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(!pipeline->build());
+
+ // no vertex inputs
+ pipeline.reset(rhi->newGraphicsPipeline());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+ pipeline->setShaderResourceBindings(srb.data());
+ QVERIFY(!pipeline->build());
+
+ // no renderpass descriptor
+ pipeline.reset(rhi->newGraphicsPipeline());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ QVERIFY(!pipeline->build());
+
+ // no shader resource bindings
+ pipeline.reset(rhi->newGraphicsPipeline());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(!pipeline->build());
+
+ // correct
+ pipeline.reset(rhi->newGraphicsPipeline());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+ pipeline->setShaderResourceBindings(srb.data());
+ QVERIFY(pipeline->build());
+}
+
+void tst_QRhi::renderToTextureSimple_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::renderToTextureSimple()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing rendering");
+
+ const QSize outputSize(1920, 1080);
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, outputSize, 1,
+ QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QScopedPointer<QRhiTextureRenderTarget> rt(rhi->newTextureRenderTarget({ texture.data() }));
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(rt->newCompatibleRenderPassDescriptor());
+ rt->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(rt->build());
+
+ QRhiCommandBuffer *cb = nullptr;
+ QVERIFY(rhi->beginOffscreenFrame(&cb) == QRhi::FrameOpSuccess);
+ QVERIFY(cb);
+
+ QRhiResourceUpdateBatch *updates = rhi->nextResourceUpdateBatch();
+
+ static const float vertices[] = {
+ -1.0f, -1.0f,
+ 1.0f, -1.0f,
+ 0.0f, 1.0f
+ };
+ QScopedPointer<QRhiBuffer> vbuf(rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertices)));
+ QVERIFY(vbuf->build());
+ updates->uploadStaticBuffer(vbuf.data(), vertices);
+
+ QScopedPointer<QRhiShaderResourceBindings> srb(rhi->newShaderResourceBindings());
+ QVERIFY(srb->build());
+
+ QScopedPointer<QRhiGraphicsPipeline> pipeline(rhi->newGraphicsPipeline());
+ QShader vs = loadShader(":/data/simple.vert.qsb");
+ QVERIFY(vs.isValid());
+ QShader fs = loadShader(":/data/simple.frag.qsb");
+ QVERIFY(fs.isValid());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({ { 2 * sizeof(float) } });
+ inputLayout.setAttributes({ { 0, 0, QRhiVertexInputAttribute::Float2, 0 } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+
+ QVERIFY(pipeline->build());
+
+ cb->beginPass(rt.data(), Qt::blue, { 1.0f, 0 }, updates);
+ cb->setGraphicsPipeline(pipeline.data());
+ cb->setViewport({ 0, 0, float(outputSize.width()), float(outputSize.height()) });
+ QRhiCommandBuffer::VertexInput vbindings(vbuf.data(), 0);
+ cb->setVertexInput(0, 1, &vbindings);
+ cb->draw(3);
+
+ QRhiReadbackResult readResult;
+ QImage result;
+ readResult.completed = [&readResult, &result] {
+ result = QImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ QImage::Format_RGBA8888_Premultiplied); // non-owning, no copy needed because readResult outlives result
+ };
+ QRhiResourceUpdateBatch *readbackBatch = rhi->nextResourceUpdateBatch();
+ readbackBatch->readBackTexture({ texture.data() }, &readResult);
+ cb->endPass(readbackBatch);
+
+ rhi->endOffscreenFrame();
+ // Offscreen frames are synchronous, so the readback is guaranteed to
+ // complete at this point. This would not be the case with swapchain-based
+ // frames.
+ QCOMPARE(result.size(), texture->pixelSize());
+
+ if (impl == QRhi::Null)
+ return;
+
+ // Now we have a red rectangle on blue background.
+ const int y = 100;
+ const quint32 *p = reinterpret_cast<const quint32 *>(result.constScanLine(y));
+ int x = result.width() - 1;
+ int redCount = 0;
+ int blueCount = 0;
+ const int maxFuzz = 1;
+ while (x-- >= 0) {
+ const QRgb c(*p++);
+ if (qRed(c) >= (255 - maxFuzz) && qGreen(c) == 0 && qBlue(c) == 0)
+ ++redCount;
+ else if (qRed(c) == 0 && qGreen(c) == 0 && qBlue(c) >= (255 - maxFuzz))
+ ++blueCount;
+ else
+ QFAIL("Encountered a pixel that is neither red or blue");
+ }
+
+ QCOMPARE(redCount + blueCount, texture->pixelSize().width());
+
+ // The triangle is "pointing up" in the resulting image with OpenGL
+ // (because Y is up both in normalized device coordinates and in images)
+ // and Vulkan (because Y is down in both and the vertex data was specified
+ // with Y up in mind), but "pointing down" with D3D (because Y is up in NDC
+ // but down in images).
+ if (rhi->isYUpInFramebuffer() == rhi->isYUpInNDC())
+ QVERIFY(redCount < blueCount);
+ else
+ QVERIFY(redCount > blueCount);
+}
+
+void tst_QRhi::renderToTextureTexturedQuad_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::renderToTextureTexturedQuad()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing rendering");
+
+ QImage inputImage;
+ inputImage.load(QLatin1String(":/data/qt256.png"));
+ QVERIFY(!inputImage.isNull());
+
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, inputImage.size(), 1,
+ QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QScopedPointer<QRhiTextureRenderTarget> rt(rhi->newTextureRenderTarget({ texture.data() }));
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(rt->newCompatibleRenderPassDescriptor());
+ rt->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(rt->build());
+
+ QRhiCommandBuffer *cb = nullptr;
+ QVERIFY(rhi->beginOffscreenFrame(&cb) == QRhi::FrameOpSuccess);
+ QVERIFY(cb);
+
+ QRhiResourceUpdateBatch *updates = rhi->nextResourceUpdateBatch();
+
+ static const float verticesUvs[] = {
+ -1.0f, -1.0f, 0.0f, 0.0f,
+ 1.0f, -1.0f, 1.0f, 0.0f,
+ -1.0f, 1.0f, 0.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f, 1.0f
+ };
+ QScopedPointer<QRhiBuffer> vbuf(rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(verticesUvs)));
+ QVERIFY(vbuf->build());
+ updates->uploadStaticBuffer(vbuf.data(), verticesUvs);
+
+ QScopedPointer<QRhiTexture> inputTexture(rhi->newTexture(QRhiTexture::RGBA8, inputImage.size()));
+ QVERIFY(inputTexture->build());
+ updates->uploadTexture(inputTexture.data(), inputImage);
+
+ QScopedPointer<QRhiSampler> sampler(rhi->newSampler(QRhiSampler::Nearest, QRhiSampler::Nearest, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge));
+ QVERIFY(sampler->build());
+
+ QScopedPointer<QRhiShaderResourceBindings> srb(rhi->newShaderResourceBindings());
+ srb->setBindings({
+ QRhiShaderResourceBinding::sampledTexture(0, QRhiShaderResourceBinding::FragmentStage, inputTexture.data(), sampler.data())
+ });
+ QVERIFY(srb->build());
+
+ QScopedPointer<QRhiGraphicsPipeline> pipeline(rhi->newGraphicsPipeline());
+ pipeline->setTopology(QRhiGraphicsPipeline::TriangleStrip);
+ QShader vs = loadShader(":/data/simpletextured.vert.qsb");
+ QVERIFY(vs.isValid());
+ QShader fs = loadShader(":/data/simpletextured.frag.qsb");
+ QVERIFY(fs.isValid());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({ { 4 * sizeof(float) } });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+
+ QVERIFY(pipeline->build());
+
+ cb->beginPass(rt.data(), Qt::black, { 1.0f, 0 }, updates);
+ cb->setGraphicsPipeline(pipeline.data());
+ cb->setShaderResources();
+ cb->setViewport({ 0, 0, float(texture->pixelSize().width()), float(texture->pixelSize().height()) });
+ QRhiCommandBuffer::VertexInput vbindings(vbuf.data(), 0);
+ cb->setVertexInput(0, 1, &vbindings);
+ cb->draw(4);
+
+ QRhiReadbackResult readResult;
+ QImage result;
+ readResult.completed = [&readResult, &result] {
+ result = QImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ QImage::Format_RGBA8888_Premultiplied);
+ };
+ QRhiResourceUpdateBatch *readbackBatch = rhi->nextResourceUpdateBatch();
+ readbackBatch->readBackTexture({ texture.data() }, &readResult);
+ cb->endPass(readbackBatch);
+
+ rhi->endOffscreenFrame();
+
+ QVERIFY(!result.isNull());
+
+ if (impl == QRhi::Null)
+ return;
+
+ // Flip with D3D and Metal because these have Y down in images. Vulkan does
+ // not need this because there Y is down both in images and in NDC, which
+ // just happens to give correct results with our OpenGL-targeted vertex and
+ // UV data.
+ if (rhi->isYUpInFramebuffer() != rhi->isYUpInNDC())
+ result = std::move(result).mirrored();
+
+ // check a few points that are expected to match regardless of the implementation
+ QRgb white = qRgba(255, 255, 255, 255);
+ QCOMPARE(result.pixel(79, 77), white);
+ QCOMPARE(result.pixel(124, 81), white);
+ QCOMPARE(result.pixel(128, 149), white);
+ QCOMPARE(result.pixel(120, 189), white);
+ QCOMPARE(result.pixel(116, 185), white);
+
+ QRgb empty = qRgba(0, 0, 0, 0);
+ QCOMPARE(result.pixel(11, 45), empty);
+ QCOMPARE(result.pixel(246, 202), empty);
+ QCOMPARE(result.pixel(130, 18), empty);
+ QCOMPARE(result.pixel(4, 227), empty);
+
+ QVERIFY(qGreen(result.pixel(32, 52)) > 2 * qRed(result.pixel(32, 52)));
+ QVERIFY(qGreen(result.pixel(32, 52)) > 2 * qBlue(result.pixel(32, 52)));
+ QVERIFY(qGreen(result.pixel(214, 191)) > 2 * qRed(result.pixel(214, 191)));
+ QVERIFY(qGreen(result.pixel(214, 191)) > 2 * qBlue(result.pixel(214, 191)));
+}
+
+void tst_QRhi::renderToTextureTexturedQuadAndUniformBuffer_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::renderToTextureTexturedQuadAndUniformBuffer()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing rendering");
+
+ QImage inputImage;
+ inputImage.load(QLatin1String(":/data/qt256.png"));
+ QVERIFY(!inputImage.isNull());
+
+ QScopedPointer<QRhiTexture> texture(rhi->newTexture(QRhiTexture::RGBA8, inputImage.size(), 1,
+ QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource));
+ QVERIFY(texture->build());
+
+ QScopedPointer<QRhiTextureRenderTarget> rt(rhi->newTextureRenderTarget({ texture.data() }));
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(rt->newCompatibleRenderPassDescriptor());
+ rt->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(rt->build());
+
+ QRhiCommandBuffer *cb = nullptr;
+ QVERIFY(rhi->beginOffscreenFrame(&cb) == QRhi::FrameOpSuccess);
+ QVERIFY(cb);
+
+ QRhiResourceUpdateBatch *updates = rhi->nextResourceUpdateBatch();
+
+ static const float verticesUvs[] = {
+ -1.0f, -1.0f, 0.0f, 0.0f,
+ 1.0f, -1.0f, 1.0f, 0.0f,
+ -1.0f, 1.0f, 0.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f, 1.0f
+ };
+ QScopedPointer<QRhiBuffer> vbuf(rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(verticesUvs)));
+ QVERIFY(vbuf->build());
+ updates->uploadStaticBuffer(vbuf.data(), verticesUvs);
+
+ // There will be two renderpasses. One renders with no transformation and
+ // an opacity of 0.5, the second has a rotation. Bake the uniform data for
+ // both into a single buffer.
+
+ const int UNIFORM_BLOCK_SIZE = 64 + 4; // matrix + opacity
+ const int secondUbufOffset = rhi->ubufAligned(UNIFORM_BLOCK_SIZE);
+ const int UBUF_SIZE = secondUbufOffset + UNIFORM_BLOCK_SIZE;
+
+ QScopedPointer<QRhiBuffer> ubuf(rhi->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, UBUF_SIZE));
+ QVERIFY(ubuf->build());
+
+ QMatrix4x4 matrix;
+ updates->updateDynamicBuffer(ubuf.data(), 0, 64, matrix.constData());
+ float opacity = 0.5f;
+ updates->updateDynamicBuffer(ubuf.data(), 64, 4, &opacity);
+
+ // rotation by 45 degrees around the Z axis
+ matrix.rotate(45, 0, 0, 1);
+ updates->updateDynamicBuffer(ubuf.data(), secondUbufOffset, 64, matrix.constData());
+ updates->updateDynamicBuffer(ubuf.data(), secondUbufOffset + 64, 4, &opacity);
+
+ QScopedPointer<QRhiTexture> inputTexture(rhi->newTexture(QRhiTexture::RGBA8, inputImage.size()));
+ QVERIFY(inputTexture->build());
+ updates->uploadTexture(inputTexture.data(), inputImage);
+
+ QScopedPointer<QRhiSampler> sampler(rhi->newSampler(QRhiSampler::Nearest, QRhiSampler::Nearest, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge));
+ QVERIFY(sampler->build());
+
+ const QRhiShaderResourceBinding::StageFlags commonVisibility = QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage;
+ QScopedPointer<QRhiShaderResourceBindings> srb0(rhi->newShaderResourceBindings());
+ srb0->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, commonVisibility, ubuf.data(), 0, UNIFORM_BLOCK_SIZE),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, inputTexture.data(), sampler.data())
+ });
+ QVERIFY(srb0->build());
+
+ QScopedPointer<QRhiShaderResourceBindings> srb1(rhi->newShaderResourceBindings());
+ srb1->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, commonVisibility, ubuf.data(), secondUbufOffset, UNIFORM_BLOCK_SIZE),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, inputTexture.data(), sampler.data())
+ });
+ QVERIFY(srb1->build());
+ QVERIFY(srb1->isLayoutCompatible(srb0.data())); // hence no need for a second pipeline
+
+ QScopedPointer<QRhiGraphicsPipeline> pipeline(rhi->newGraphicsPipeline());
+ pipeline->setTopology(QRhiGraphicsPipeline::TriangleStrip);
+ QShader vs = loadShader(":/data/textured.vert.qsb");
+ QVERIFY(vs.isValid());
+ QShaderDescription shaderDesc = vs.description();
+ QVERIFY(!shaderDesc.uniformBlocks().isEmpty());
+ QCOMPARE(shaderDesc.uniformBlocks().first().size, UNIFORM_BLOCK_SIZE);
+
+ QShader fs = loadShader(":/data/textured.frag.qsb");
+ QVERIFY(fs.isValid());
+ shaderDesc = fs.description();
+ QVERIFY(!shaderDesc.uniformBlocks().isEmpty());
+ QCOMPARE(shaderDesc.uniformBlocks().first().size, UNIFORM_BLOCK_SIZE);
+
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({ { 4 * sizeof(float) } });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb0.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+
+ QVERIFY(pipeline->build());
+
+ cb->beginPass(rt.data(), Qt::black, { 1.0f, 0 }, updates);
+ cb->setGraphicsPipeline(pipeline.data());
+ cb->setShaderResources();
+ cb->setViewport({ 0, 0, float(texture->pixelSize().width()), float(texture->pixelSize().height()) });
+ QRhiCommandBuffer::VertexInput vbindings(vbuf.data(), 0);
+ cb->setVertexInput(0, 1, &vbindings);
+ cb->draw(4);
+
+ QRhiReadbackResult readResult0;
+ QImage result0;
+ readResult0.completed = [&readResult0, &result0] {
+ result0 = QImage(reinterpret_cast<const uchar *>(readResult0.data.constData()),
+ readResult0.pixelSize.width(), readResult0.pixelSize.height(),
+ QImage::Format_RGBA8888_Premultiplied);
+ };
+ QRhiResourceUpdateBatch *readbackBatch = rhi->nextResourceUpdateBatch();
+ readbackBatch->readBackTexture({ texture.data() }, &readResult0);
+ cb->endPass(readbackBatch);
+
+ // second pass (rotated)
+ cb->beginPass(rt.data(), Qt::black, { 1.0f, 0 });
+ cb->setGraphicsPipeline(pipeline.data());
+ cb->setShaderResources(srb1.data()); // sources data from a different offset in ubuf
+ cb->setViewport({ 0, 0, float(texture->pixelSize().width()), float(texture->pixelSize().height()) });
+ cb->setVertexInput(0, 1, &vbindings);
+ cb->draw(4);
+
+ QRhiReadbackResult readResult1;
+ QImage result1;
+ readResult1.completed = [&readResult1, &result1] {
+ result1 = QImage(reinterpret_cast<const uchar *>(readResult1.data.constData()),
+ readResult1.pixelSize.width(), readResult1.pixelSize.height(),
+ QImage::Format_RGBA8888_Premultiplied);
+ };
+ readbackBatch = rhi->nextResourceUpdateBatch();
+ readbackBatch->readBackTexture({ texture.data() }, &readResult1);
+ cb->endPass(readbackBatch);
+
+ rhi->endOffscreenFrame();
+
+ QVERIFY(!result0.isNull());
+ QVERIFY(!result1.isNull());
+
+ if (rhi->isYUpInFramebuffer() != rhi->isYUpInNDC()) {
+ result0 = std::move(result0).mirrored();
+ result1 = std::move(result1).mirrored();
+ }
+
+ if (impl == QRhi::Null)
+ return;
+
+ // opacity 0.5 (premultiplied)
+ static const auto checkSemiWhite = [](const QRgb &c) {
+ QRgb semiWhite127 = qPremultiply(qRgba(255, 255, 255, 127));
+ QRgb semiWhite128 = qPremultiply(qRgba(255, 255, 255, 128));
+ return c == semiWhite127 || c == semiWhite128;
+ };
+ QVERIFY(checkSemiWhite(result0.pixel(79, 77)));
+ QVERIFY(checkSemiWhite(result0.pixel(124, 81)));
+ QVERIFY(checkSemiWhite(result0.pixel(128, 149)));
+ QVERIFY(checkSemiWhite(result0.pixel(120, 189)));
+ QVERIFY(checkSemiWhite(result0.pixel(116, 185)));
+ QVERIFY(checkSemiWhite(result0.pixel(191, 172)));
+
+ QRgb empty = qRgba(0, 0, 0, 0);
+ QCOMPARE(result0.pixel(11, 45), empty);
+ QCOMPARE(result0.pixel(246, 202), empty);
+ QCOMPARE(result0.pixel(130, 18), empty);
+ QCOMPARE(result0.pixel(4, 227), empty);
+
+ // also rotated 45 degrees around Z
+ QRgb black = qRgba(0, 0, 0, 255);
+ QCOMPARE(result1.pixel(20, 23), black);
+ QCOMPARE(result1.pixel(47, 5), black);
+ QCOMPARE(result1.pixel(238, 22), black);
+ QCOMPARE(result1.pixel(250, 203), black);
+ QCOMPARE(result1.pixel(224, 237), black);
+ QCOMPARE(result1.pixel(12, 221), black);
+
+ QVERIFY(checkSemiWhite(result1.pixel(142, 67)));
+ QVERIFY(checkSemiWhite(result1.pixel(81, 79)));
+ QVERIFY(checkSemiWhite(result1.pixel(79, 168)));
+ QVERIFY(checkSemiWhite(result1.pixel(146, 204)));
+ QVERIFY(checkSemiWhite(result1.pixel(186, 156)));
+
+ QCOMPARE(result1.pixel(204, 45), empty);
+ QCOMPARE(result1.pixel(28, 178), empty);
+}
+
+void tst_QRhi::renderToWindowSimple_data()
+{
+ rhiTestData();
+}
+
+void tst_QRhi::renderToWindowSimple()
+{
+ QFETCH(QRhi::Implementation, impl);
+ QFETCH(QRhiInitParams *, initParams);
+
+#ifdef Q_OS_WINRT
+ if (impl == QRhi::D3D11)
+ QSKIP("Skipping window-based QRhi rendering on WinRT as the platform and the D3D11 backend are not prepared for this yet");
+#endif
+
+ QScopedPointer<QRhi> rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr));
+ if (!rhi)
+ QSKIP("QRhi could not be created, skipping testing rendering");
+
+ QScopedPointer<QWindow> window(new QWindow);
+ switch (impl) {
+ case QRhi::OpenGLES2:
+#if QT_CONFIG(opengl)
+ window->setFormat(QRhiGles2InitParams::adjustedFormat());
+#endif
+ Q_FALLTHROUGH();
+ case QRhi::D3D11:
+ window->setSurfaceType(QSurface::OpenGLSurface);
+ break;
+ case QRhi::Metal:
+ window->setSurfaceType(QSurface::MetalSurface);
+ break;
+ case QRhi::Vulkan:
+ window->setSurfaceType(QSurface::VulkanSurface);
+#if QT_CONFIG(vulkan)
+ window->setVulkanInstance(&vulkanInstance);
+#endif
+ break;
+ default:
+ break;
+ }
+
+ window->setGeometry(0, 0, 640, 480);
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+
+ QScopedPointer<QRhiSwapChain> swapChain(rhi->newSwapChain());
+ swapChain->setWindow(window.data());
+ swapChain->setFlags(QRhiSwapChain::UsedAsTransferSource);
+ QScopedPointer<QRhiRenderPassDescriptor> rpDesc(swapChain->newCompatibleRenderPassDescriptor());
+ swapChain->setRenderPassDescriptor(rpDesc.data());
+ QVERIFY(swapChain->buildOrResize());
+
+ QRhiResourceUpdateBatch *updates = rhi->nextResourceUpdateBatch();
+
+ static const float vertices[] = {
+ -1.0f, -1.0f,
+ 1.0f, -1.0f,
+ 0.0f, 1.0f
+ };
+ QScopedPointer<QRhiBuffer> vbuf(rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertices)));
+ QVERIFY(vbuf->build());
+ updates->uploadStaticBuffer(vbuf.data(), vertices);
+
+ QScopedPointer<QRhiShaderResourceBindings> srb(rhi->newShaderResourceBindings());
+ QVERIFY(srb->build());
+
+ QScopedPointer<QRhiGraphicsPipeline> pipeline(rhi->newGraphicsPipeline());
+ QShader vs = loadShader(":/data/simple.vert.qsb");
+ QVERIFY(vs.isValid());
+ QShader fs = loadShader(":/data/simple.frag.qsb");
+ QVERIFY(fs.isValid());
+ pipeline->setShaderStages({ { QRhiShaderStage::Vertex, vs }, { QRhiShaderStage::Fragment, fs } });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({ { 2 * sizeof(float) } });
+ inputLayout.setAttributes({ { 0, 0, QRhiVertexInputAttribute::Float2, 0 } });
+ pipeline->setVertexInputLayout(inputLayout);
+ pipeline->setShaderResourceBindings(srb.data());
+ pipeline->setRenderPassDescriptor(rpDesc.data());
+
+ QVERIFY(pipeline->build());
+
+ const int framesInFlight = rhi->resourceLimit(QRhi::FramesInFlight);
+ QVERIFY(framesInFlight >= 1);
+ const int FRAME_COUNT = framesInFlight + 1;
+ bool readCompleted = false;
+ QRhiReadbackResult readResult;
+ QImage result;
+ int readbackWidth = 0;
+
+ for (int frameNo = 0; frameNo < FRAME_COUNT; ++frameNo) {
+ QVERIFY(rhi->beginFrame(swapChain.data()) == QRhi::FrameOpSuccess);
+ QRhiCommandBuffer *cb = swapChain->currentFrameCommandBuffer();
+ QRhiRenderTarget *rt = swapChain->currentFrameRenderTarget();
+ const QSize outputSize = swapChain->currentPixelSize();
+ QCOMPARE(rt->pixelSize(), outputSize);
+ QRhiViewport viewport(0, 0, float(outputSize.width()), float(outputSize.height()));
+
+ cb->beginPass(rt, Qt::blue, { 1.0f, 0 }, updates);
+ updates = nullptr;
+ cb->setGraphicsPipeline(pipeline.data());
+ cb->setViewport(viewport);
+ QRhiCommandBuffer::VertexInput vbindings(vbuf.data(), 0);
+ cb->setVertexInput(0, 1, &vbindings);
+ cb->draw(3);
+
+ if (frameNo == 0) {
+ readResult.completed = [&readCompleted, &readResult, &result, &rhi] {
+ readCompleted = true;
+ QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
+ readResult.pixelSize.width(), readResult.pixelSize.height(),
+ QImage::Format_ARGB32_Premultiplied);
+ if (readResult.format == QRhiTexture::RGBA8)
+ wrapperImage = wrapperImage.rgbSwapped();
+ if (rhi->isYUpInFramebuffer() == rhi->isYUpInNDC())
+ result = wrapperImage.mirrored();
+ else
+ result = wrapperImage.copy();
+ };
+ QRhiResourceUpdateBatch *readbackBatch = rhi->nextResourceUpdateBatch();
+ readbackBatch->readBackTexture({}, &readResult); // read back the current backbuffer
+ readbackWidth = outputSize.width();
+ cb->endPass(readbackBatch);
+ } else {
+ cb->endPass();
+ }
+
+ rhi->endFrame(swapChain.data());
+ }
+
+ // The readback is asynchronous here. However it is guaranteed that it
+ // finished at latest after rendering QRhi::FramesInFlight frames after the
+ // one that enqueues the readback.
+ QVERIFY(readCompleted);
+ QVERIFY(readbackWidth > 0);
+
+ if (impl == QRhi::Null)
+ return;
+
+ // Now we have a red rectangle on blue background.
+ const int y = 50;
+ const quint32 *p = reinterpret_cast<const quint32 *>(result.constScanLine(y));
+ int x = result.width() - 1;
+ int redCount = 0;
+ int blueCount = 0;
+ const int maxFuzz = 1;
+ while (x-- >= 0) {
+ const QRgb c(*p++);
+ if (qRed(c) >= (255 - maxFuzz) && qGreen(c) == 0 && qBlue(c) == 0)
+ ++redCount;
+ else if (qRed(c) == 0 && qGreen(c) == 0 && qBlue(c) >= (255 - maxFuzz))
+ ++blueCount;
+ else
+ QFAIL("Encountered a pixel that is neither red or blue");
+ }
+
+ QCOMPARE(redCount + blueCount, readbackWidth);
+ QVERIFY(redCount < blueCount);
+}
+
+#include <tst_qrhi.moc>
+QTEST_MAIN(tst_QRhi)
diff --git a/tests/auto/gui/rhi/qshader/data/color.vert b/tests/auto/gui/rhi/qshader/data/color.vert
new file mode 100644
index 0000000000..c92f71b9e1
--- /dev/null
+++ b/tests/auto/gui/rhi/qshader/data/color.vert
@@ -0,0 +1,18 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 1) in vec3 color;
+layout(location = 0) out vec3 v_color;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ float opacity;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ v_color = color;
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/auto/gui/rhi/qshader/data/color.vert.qsb b/tests/auto/gui/rhi/qshader/data/color.vert.qsb
new file mode 100644
index 0000000000..7d02d823d2
--- /dev/null
+++ b/tests/auto/gui/rhi/qshader/data/color.vert.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qshader/data/color_simple.vert.qsb b/tests/auto/gui/rhi/qshader/data/color_simple.vert.qsb
new file mode 100644
index 0000000000..c82ba7e8e7
--- /dev/null
+++ b/tests/auto/gui/rhi/qshader/data/color_simple.vert.qsb
Binary files differ
diff --git a/tests/auto/gui/rhi/qshader/qshader.pro b/tests/auto/gui/rhi/qshader/qshader.pro
new file mode 100644
index 0000000000..5d9ef8304d
--- /dev/null
+++ b/tests/auto/gui/rhi/qshader/qshader.pro
@@ -0,0 +1,8 @@
+TARGET = tst_qshader
+CONFIG += testcase
+
+QT += testlib gui-private
+
+SOURCES += tst_qshader.cpp
+
+RESOURCES += qshader.qrc
diff --git a/tests/auto/gui/rhi/qshader/qshader.qrc b/tests/auto/gui/rhi/qshader/qshader.qrc
new file mode 100644
index 0000000000..f161d8aad6
--- /dev/null
+++ b/tests/auto/gui/rhi/qshader/qshader.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>data</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/rhi/qshader/tst_qshader.cpp b/tests/auto/gui/rhi/qshader/tst_qshader.cpp
new file mode 100644
index 0000000000..21f0cc7895
--- /dev/null
+++ b/tests/auto/gui/rhi/qshader/tst_qshader.cpp
@@ -0,0 +1,233 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QFile>
+#include <QtGui/private/qshaderdescription_p_p.h>
+#include <QtGui/private/qshader_p_p.h>
+
+class tst_QShader : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void simpleCompileCheckResults();
+ void genVariants();
+ void shaderDescImplicitSharing();
+ void bakedShaderImplicitSharing();
+};
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+void tst_QShader::simpleCompileCheckResults()
+{
+ QShader s = getShader(QLatin1String(":/data/color_simple.vert.qsb"));
+ QVERIFY(s.isValid());
+ QCOMPARE(s.availableShaders().count(), 1);
+
+ const QShaderCode shader = s.shader(QShaderKey(QShader::SpirvShader,
+ QShaderVersion(100)));
+ QVERIFY(!shader.shader().isEmpty());
+ QCOMPARE(shader.entryPoint(), QByteArrayLiteral("main"));
+
+ const QShaderDescription desc = s.description();
+ QVERIFY(desc.isValid());
+ QCOMPARE(desc.inputVariables().count(), 2);
+ for (const QShaderDescription::InOutVariable &v : desc.inputVariables()) {
+ switch (v.location) {
+ case 0:
+ QCOMPARE(v.name, QLatin1String("position"));
+ QCOMPARE(v.type, QShaderDescription::Vec4);
+ break;
+ case 1:
+ QCOMPARE(v.name, QLatin1String("color"));
+ QCOMPARE(v.type, QShaderDescription::Vec3);
+ break;
+ default:
+ QVERIFY(false);
+ break;
+ }
+ }
+ QCOMPARE(desc.outputVariables().count(), 1);
+ for (const QShaderDescription::InOutVariable &v : desc.outputVariables()) {
+ switch (v.location) {
+ case 0:
+ QCOMPARE(v.name, QLatin1String("v_color"));
+ QCOMPARE(v.type, QShaderDescription::Vec3);
+ break;
+ default:
+ QVERIFY(false);
+ break;
+ }
+ }
+ QCOMPARE(desc.uniformBlocks().count(), 1);
+ const QShaderDescription::UniformBlock blk = desc.uniformBlocks().first();
+ QCOMPARE(blk.blockName, QLatin1String("buf"));
+ QCOMPARE(blk.structName, QLatin1String("ubuf"));
+ QCOMPARE(blk.size, 68);
+ QCOMPARE(blk.binding, 0);
+ QCOMPARE(blk.descriptorSet, 0);
+ QCOMPARE(blk.members.count(), 2);
+ for (int i = 0; i < blk.members.count(); ++i) {
+ const QShaderDescription::BlockVariable v = blk.members[i];
+ switch (i) {
+ case 0:
+ QCOMPARE(v.offset, 0);
+ QCOMPARE(v.size, 64);
+ QCOMPARE(v.name, QLatin1String("mvp"));
+ QCOMPARE(v.type, QShaderDescription::Mat4);
+ QCOMPARE(v.matrixStride, 16);
+ break;
+ case 1:
+ QCOMPARE(v.offset, 64);
+ QCOMPARE(v.size, 4);
+ QCOMPARE(v.name, QLatin1String("opacity"));
+ QCOMPARE(v.type, QShaderDescription::Float);
+ break;
+ default:
+ QVERIFY(false);
+ break;
+ }
+ }
+}
+
+void tst_QShader::genVariants()
+{
+ QShader s = getShader(QLatin1String(":/data/color.vert.qsb"));
+ // spirv, glsl 100, glsl 330, glsl 120, hlsl 50, msl 12
+ // + batchable variants
+ QVERIFY(s.isValid());
+ QCOMPARE(s.availableShaders().count(), 2 * 6);
+
+ int batchableVariantCount = 0;
+ int batchableGlslVariantCount = 0;
+ for (const QShaderKey &key : s.availableShaders()) {
+ if (key.sourceVariant() == QShader::BatchableVertexShader) {
+ ++batchableVariantCount;
+ if (key.source() == QShader::GlslShader) {
+ ++batchableGlslVariantCount;
+ const QByteArray src = s.shader(key).shader();
+ QVERIFY(src.contains(QByteArrayLiteral("_qt_order * ")));
+ }
+ }
+ }
+ QCOMPARE(batchableVariantCount, 6);
+ QCOMPARE(batchableGlslVariantCount, 3);
+}
+
+void tst_QShader::shaderDescImplicitSharing()
+{
+ QShader s = getShader(QLatin1String(":/data/color_simple.vert.qsb"));
+ QVERIFY(s.isValid());
+ QCOMPARE(s.availableShaders().count(), 1);
+ QVERIFY(s.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+
+ QShaderDescription d0 = s.description();
+ QVERIFY(d0.isValid());
+ QCOMPARE(d0.inputVariables().count(), 2);
+ QCOMPARE(d0.outputVariables().count(), 1);
+ QCOMPARE(d0.uniformBlocks().count(), 1);
+
+ QShaderDescription d1 = d0;
+ QVERIFY(QShaderDescriptionPrivate::get(&d0) == QShaderDescriptionPrivate::get(&d1));
+ QCOMPARE(d0.inputVariables().count(), 2);
+ QCOMPARE(d0.outputVariables().count(), 1);
+ QCOMPARE(d0.uniformBlocks().count(), 1);
+ QCOMPARE(d1.inputVariables().count(), 2);
+ QCOMPARE(d1.outputVariables().count(), 1);
+ QCOMPARE(d1.uniformBlocks().count(), 1);
+
+ d1.detach();
+ QVERIFY(QShaderDescriptionPrivate::get(&d0) != QShaderDescriptionPrivate::get(&d1));
+ QCOMPARE(d0.inputVariables().count(), 2);
+ QCOMPARE(d0.outputVariables().count(), 1);
+ QCOMPARE(d0.uniformBlocks().count(), 1);
+ QCOMPARE(d1.inputVariables().count(), 2);
+ QCOMPARE(d1.outputVariables().count(), 1);
+ QCOMPARE(d1.uniformBlocks().count(), 1);
+}
+
+void tst_QShader::bakedShaderImplicitSharing()
+{
+ QShader s0 = getShader(QLatin1String(":/data/color_simple.vert.qsb"));
+ QVERIFY(s0.isValid());
+ QCOMPARE(s0.availableShaders().count(), 1);
+ QVERIFY(s0.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+
+ {
+ QShader s1 = s0;
+ QVERIFY(QShaderPrivate::get(&s0) == QShaderPrivate::get(&s1));
+ QCOMPARE(s0.availableShaders().count(), 1);
+ QVERIFY(s0.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+ QCOMPARE(s1.availableShaders().count(), 1);
+ QVERIFY(s1.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+ QCOMPARE(s0.stage(), s1.stage());
+ QCOMPARE(s0, s1);
+
+ s1.detach();
+ QVERIFY(QShaderPrivate::get(&s0) != QShaderPrivate::get(&s1));
+ QCOMPARE(s0.availableShaders().count(), 1);
+ QVERIFY(s0.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+ QCOMPARE(s1.availableShaders().count(), 1);
+ QVERIFY(s1.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+ QCOMPARE(s0.stage(), s1.stage());
+ QCOMPARE(s0, s1);
+ }
+
+ {
+ QShader s1 = s0;
+ QVERIFY(QShaderPrivate::get(&s0) == QShaderPrivate::get(&s1));
+ QCOMPARE(s0.stage(), s1.stage());
+
+ s1.setStage(QShader::FragmentStage); // call a setter to trigger a detach
+ QVERIFY(QShaderPrivate::get(&s0) != QShaderPrivate::get(&s1));
+ QCOMPARE(s0.availableShaders().count(), 1);
+ QVERIFY(s0.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+ QCOMPARE(s1.availableShaders().count(), 1);
+ QVERIFY(s1.availableShaders().contains(QShaderKey(QShader::SpirvShader, QShaderVersion(100))));
+ QShaderDescription d0 = s0.description();
+ QCOMPARE(d0.inputVariables().count(), 2);
+ QCOMPARE(d0.outputVariables().count(), 1);
+ QCOMPARE(d0.uniformBlocks().count(), 1);
+ QShaderDescription d1 = s1.description();
+ QCOMPARE(d1.inputVariables().count(), 2);
+ QCOMPARE(d1.outputVariables().count(), 1);
+ QCOMPARE(d1.uniformBlocks().count(), 1);
+ QVERIFY(s0 != s1);
+ }
+}
+
+#include <tst_qshader.moc>
+QTEST_MAIN(tst_QShader)
diff --git a/tests/auto/gui/rhi/rhi.pro b/tests/auto/gui/rhi/rhi.pro
new file mode 100644
index 0000000000..cc548b7b8a
--- /dev/null
+++ b/tests/auto/gui/rhi/rhi.pro
@@ -0,0 +1,4 @@
+TEMPLATE=subdirs
+SUBDIRS= \
+ qshader \
+ qrhi
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index 7dbeb13aa7..7764a716ca 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -78,6 +78,8 @@ private slots:
void extractBorder();
void noTextDecoration();
void quotedAndUnquotedIdentifiers();
+ void whitespaceValues_data();
+ void whitespaceValues();
};
void tst_QCssParser::scanner_data()
@@ -1746,6 +1748,33 @@ void tst_QCssParser::quotedAndUnquotedIdentifiers()
QCOMPARE(decls.at(1).d->values.first().toString(), QLatin1String("bold"));
}
+void tst_QCssParser::whitespaceValues_data()
+{
+ QTest::addColumn<QString>("value");
+
+ QTest::newRow("normal") << "normal";
+ QTest::newRow("inherit") << "inherit";
+ QTest::newRow("nowrap") << "nowrap";
+ QTest::newRow("pre") << "pre";
+ QTest::newRow("pre-wrap") << "pre-wrap";
+ QTest::newRow("pre-line") << "pre-line";
+}
+
+void tst_QCssParser::whitespaceValues()
+{
+ QFETCH(QString, value);
+ QCss::Parser parser(QString("foo { white-space: %1 }").arg(value));
+ QCss::StyleSheet sheet;
+ QVERIFY(parser.parse(&sheet));
+
+ QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ?
+ sheet.styleRules.at(0) : *sheet.nameIndex.begin();
+ QCOMPARE(rule.declarations.size(), 1);
+
+ QCOMPARE(rule.declarations.at(0).d->property, QLatin1String("white-space"));
+ QCOMPARE(rule.declarations.at(0).d->values.first().toString(), value);
+}
+
QTEST_MAIN(tst_QCssParser)
#include "tst_qcssparser.moc"
diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST
deleted file mode 100644
index 42cb8408f4..0000000000
--- a/tests/auto/gui/text/qfont/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[defaultFamily]
-b2qt
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index bb047d5461..9487436336 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -58,7 +58,9 @@ private slots:
void insertAndRemoveSubstitutions();
void serialize_data();
void serialize();
+#if QT_DEPRECATED_SINCE(5, 13)
void lastResortFont();
+#endif
void styleName();
void defaultFamily_data();
void defaultFamily();
@@ -493,6 +495,7 @@ void tst_QFont::serialize()
}
}
+#if QT_DEPRECATED_SINCE(5, 13)
// QFont::lastResortFont() may abort with qFatal() on QWS/QPA
// if absolutely no font is found. Just as ducumented for QFont::lastResortFont().
// This happens on our CI machines which run QWS autotests.
@@ -503,6 +506,7 @@ void tst_QFont::lastResortFont()
QFont font;
QVERIFY(!font.lastResortFont().isEmpty());
}
+#endif
void tst_QFont::styleName()
{
@@ -544,10 +548,10 @@ void tst_QFont::defaultFamily_data()
QTest::addColumn<QStringList>("acceptableFamilies");
QTest::newRow("serif") << QFont::Serif << (QStringList() << "Times New Roman" << "Times" << "Droid Serif" << getPlatformGenericFont("serif").split(","));
- QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(","));
+ QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << "Menlo" << "Droid Sans Mono" << getPlatformGenericFont("monospace").split(","));
QTest::newRow("cursive") << QFont::Cursive << (QStringList() << "Comic Sans MS" << "Apple Chancery" << "Roboto" << "Droid Sans" << getPlatformGenericFont("cursive").split(","));
QTest::newRow("fantasy") << QFont::Fantasy << (QStringList() << "Impact" << "Zapfino" << "Roboto" << "Droid Sans" << getPlatformGenericFont("fantasy").split(","));
- QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(","));
+ QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << "Helvetica" << "Roboto" << "Droid Sans" << "Segoe UI" << getPlatformGenericFont("sans-serif").split(","));
}
void tst_QFont::defaultFamily()
@@ -637,37 +641,37 @@ void tst_QFont::sharing()
QFont f;
f.setStyleHint(QFont::Serif);
f.exactMatch(); // loads engine
- QCOMPARE(QFontPrivate::get(f)->ref.load(), 1);
+ QCOMPARE(QFontPrivate::get(f)->ref.loadRelaxed(), 1);
QVERIFY(QFontPrivate::get(f)->engineData);
- QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1 + refs_by_cache);
+ QCOMPARE(QFontPrivate::get(f)->engineData->ref.loadRelaxed(), 1 + refs_by_cache);
QFont f2(f);
QCOMPARE(QFontPrivate::get(f2), QFontPrivate::get(f));
- QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
+ QCOMPARE(QFontPrivate::get(f2)->ref.loadRelaxed(), 2);
QVERIFY(QFontPrivate::get(f2)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
- QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache);
+ QCOMPARE(QFontPrivate::get(f2)->engineData->ref.loadRelaxed(), 1 + refs_by_cache);
f2.setKerning(!f.kerning());
QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f));
- QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1);
+ QCOMPARE(QFontPrivate::get(f2)->ref.loadRelaxed(), 1);
QVERIFY(QFontPrivate::get(f2)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
- QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2 + refs_by_cache);
+ QCOMPARE(QFontPrivate::get(f2)->engineData->ref.loadRelaxed(), 2 + refs_by_cache);
f2 = f;
QCOMPARE(QFontPrivate::get(f2), QFontPrivate::get(f));
- QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
+ QCOMPARE(QFontPrivate::get(f2)->ref.loadRelaxed(), 2);
QVERIFY(QFontPrivate::get(f2)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
- QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache);
+ QCOMPARE(QFontPrivate::get(f2)->engineData->ref.loadRelaxed(), 1 + refs_by_cache);
if (f.pointSize() > 0)
f2.setPointSize(f.pointSize() * 2 / 3);
else
f2.setPixelSize(f.pixelSize() * 2 / 3);
QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f));
- QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1);
+ QCOMPARE(QFontPrivate::get(f2)->ref.loadRelaxed(), 1);
QVERIFY(!QFontPrivate::get(f2)->engineData);
QVERIFY(QFontPrivate::get(f2)->engineData != QFontPrivate::get(f)->engineData);
}
diff --git a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
index 785cc3fef2..3d3211c7a2 100644
--- a/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
+++ b/tests/auto/gui/text/qfontcache/tst_qfontcache.cpp
@@ -217,7 +217,7 @@ void tst_QFontCache::clear()
#ifdef QT_BUILD_INTERNAL
QList<QFontEngine *> leakedEngines = QFontEngine_stopCollectingEngines();
-for (int i = 0; i < leakedEngines.size(); ++i) qWarning() << i << leakedEngines.at(i) << leakedEngines.at(i)->ref.load();
+for (int i = 0; i < leakedEngines.size(); ++i) qWarning() << i << leakedEngines.at(i) << leakedEngines.at(i)->ref.loadRelaxed();
// and we are not leaking!
QCOMPARE(leakedEngines.size(), 0);
#endif
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index 064e37f73c..2b69801b59 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -211,8 +211,8 @@ void tst_QFontDatabase::widthTwoTimes()
f.setPixelSize(pixelSize);
QFontMetrics fm(f);
- int w1 = fm.charWidth(text, 0);
- int w2 = fm.charWidth(text, 0);
+ int w1 = fm.horizontalAdvance(text, 0);
+ int w2 = fm.horizontalAdvance(text, 0);
QCOMPARE(w1, w2);
}
diff --git a/tests/auto/gui/text/qglyphrun/BLACKLIST b/tests/auto/gui/text/qglyphrun/BLACKLIST
index d8dbdabb4b..57f32c683d 100644
--- a/tests/auto/gui/text/qglyphrun/BLACKLIST
+++ b/tests/auto/gui/text/qglyphrun/BLACKLIST
@@ -1,4 +1,3 @@
[mixedScripts]
ubuntu-18.04
b2qt
-windows
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
index d00dc251d8..b091edb64d 100644
--- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
@@ -681,7 +681,7 @@ static bool checkPixels(const QImage &image,
if (pixel != expectedRgb1 && pixel != expectedRgb2) {
QString message;
QDebug(&message) << "Color mismatch in image" << image
- << "at" << x << ',' << y << ':' << showbase << hex << pixel
+ << "at" << x << ',' << y << ':' << Qt::showbase << Qt::hex << pixel
<< "(expected: " << expectedRgb1 << ',' << expectedRgb2 << ')';
*errorMessage = message.toLocal8Bit();
return false;
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index 58810f73c1..52e56feb5a 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -50,6 +50,7 @@
#include <QDomDocument>
#include "common.h"
+// #define DEBUG_WRITE_OUTPUT
QT_FORWARD_DECLARE_CLASS(QTextDocument)
@@ -196,6 +197,7 @@ private:
void backgroundImage_checkExpectedHtml(const QTextDocument &doc);
void buildRegExpData();
static QString cssFontSizeString(const QFont &font);
+ void writeActualAndExpected(const char* testTag, const QString &actual, const QString &expected);
QTextDocument *doc;
QTextCursor cursor;
@@ -224,6 +226,27 @@ QString tst_QTextDocument::cssFontSizeString(const QFont &font)
: QString::number(font.pixelSize()) + QStringLiteral("px");
}
+void tst_QTextDocument::writeActualAndExpected(const char *testTag, const QString &actual, const QString &expected)
+{
+#ifdef DEBUG_WRITE_OUTPUT
+ {
+ QFile out(QDir::temp().absoluteFilePath(QLatin1String(testTag) + QLatin1String("-actual.html")));
+ out.open(QFile::WriteOnly);
+ out.write(actual.toUtf8());
+ out.close();
+ } {
+ QFile out(QDir::temp().absoluteFilePath(QLatin1String(testTag) + QLatin1String("-expected.html")));
+ out.open(QFile::WriteOnly);
+ out.write(expected.toUtf8());
+ out.close();
+ }
+#else
+ Q_UNUSED(testTag)
+ Q_UNUSED(actual)
+ Q_UNUSED(expected)
+#endif
+}
+
// Testing get/set functions
void tst_QTextDocument::getSetCheck()
{
@@ -1765,6 +1788,8 @@ void tst_QTextDocument::toHtml()
QString output = doc->toHtml();
+ writeActualAndExpected(QTest::currentDataTag(), output, expectedOutput);
+
QCOMPARE(output, expectedOutput);
QDomDocument document;
@@ -1962,6 +1987,8 @@ void tst_QTextDocument::toHtmlRootFrameProperties()
expectedOutput.replace("DEFAULTBLOCKSTYLE", "style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"");
expectedOutput.append(htmlTail);
+ writeActualAndExpected(QTest::currentTestFunction(), doc.toHtml(), expectedOutput);
+
QCOMPARE(doc.toHtml(), expectedOutput);
}
@@ -2734,6 +2761,8 @@ void tst_QTextDocument::backgroundImage_checkExpectedHtml(const QTextDocument &d
.arg(defaultFont.weight() * 8)
.arg((defaultFont.italic() ? "italic" : "normal"));
+ writeActualAndExpected(QTest::currentTestFunction(), doc.toHtml(), expectedHtml);
+
QCOMPARE(doc.toHtml(), expectedHtml);
}
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index fe0b6dae49..b6917f1208 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -34,6 +34,7 @@
#include <qtextdocumentfragment.h>
#include <qtexttable.h>
#include <qtextlist.h>
+#include <qregularexpression.h>
#include <qdebug.h>
#include <private/qtextdocument_p.h>
@@ -180,6 +181,11 @@ private slots:
void html_tableCellBackground();
void css_bodyBackground();
void css_tableCellBackground();
+ void css_tableCellBorder();
+ void css_tableCellBorderShorthand();
+ void css_tableCellAllBordersShorthand();
+ void css_tableCellOverrideOneBorder();
+ void css_tableBorderCollapse();
void css_fontWeight();
void css_float();
void css_textIndent();
@@ -944,7 +950,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments3()
QCOMPARE(it.fragment().text(), QString::fromLatin1("T"));
QVERIFY(it.fragment().charFormat().isAnchor());
- QCOMPARE(it.fragment().charFormat().anchorName(), QString("target"));
+ QCOMPARE(it.fragment().charFormat().anchorNames().constFirst(), QLatin1String("target"));
QStringList targets; targets << "target" << "target2";
QCOMPARE(it.fragment().charFormat().anchorNames(), targets);
@@ -1271,11 +1277,11 @@ void tst_QTextDocumentFragment::html_whitespace_data()
QTest::newRow("2") << QString("<span> </span><span>nowhitespacehereplease</span>")
<< QString::fromLatin1("nowhitespacehereplease");
- QTest::newRow("3") << QString("<span style=\"white-space: pre;\"> white space here </span>")
- << QString::fromLatin1(" white space here ");
+ QTest::newRow("3") << QString("<span style=\"white-space: pre;\"> white space \n\n here </span>")
+ << QString::fromLatin1(" white space \n\n here ");
- QTest::newRow("4") << QString("<span style=\"white-space: pre-wrap;\"> white space here </span>")
- << QString::fromLatin1(" white space here ");
+ QTest::newRow("4") << QString("<span style=\"white-space: pre-wrap;\"> white space \n\n here </span>")
+ << QString::fromLatin1(" white space \n\n here ");
QTest::newRow("5") << QString("<a href=\"One.html\">One</a> <a href=\"Two.html\">Two</a> <b>Three</b>\n"
"<b>Four</b>")
@@ -1290,6 +1296,12 @@ void tst_QTextDocumentFragment::html_whitespace_data()
QTest::newRow("8") << QString("<table><tr><td><i>Blah</i></td></tr></table> <i>Blub</i>")
<< QString("\nBlah\nBlub");
+ QTest::newRow("9") << QString("<span style=\"white-space: nowrap;\"> white space \n\n here </span>")
+ << QString::fromLatin1("white space here ");
+
+ QTest::newRow("10") << QString("<span style=\"white-space: pre-line;\"> white space \n\n here </span>")
+ << QString::fromLatin1("white space\n\nhere ");
+
QTest::newRow("task116492") << QString("<p>a<font=\"Times\"> b </font>c</p>")
<< QString("a b c");
@@ -1746,6 +1758,135 @@ void tst_QTextDocumentFragment::css_tableCellBackground()
QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
+void tst_QTextDocumentFragment::css_tableCellBorder()
+{
+ const char html[] = "<body><table><tr><td style=\"border-width:8px;border-color:green;border-style:groove;border-left-style:dashed;border-left-color:red;border-left-width:4px\">Foo</td></tr></table></body>";
+ doc->setHtml(html);
+
+ cursor.movePosition(QTextCursor::Start);
+ cursor.movePosition(QTextCursor::NextBlock);
+ QTextTable *table = cursor.currentTable();
+ QVERIFY(table);
+
+ QTextTableCell cell = table->cellAt(0, 0);
+ QTextTableCellFormat cellFormat = cell.format().toTableCellFormat();
+ QCOMPARE(cellFormat.leftBorder(), qreal(4));
+ QCOMPARE(cellFormat.leftBorderBrush(), QBrush(QColor("red")));
+ QCOMPARE(cellFormat.leftBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.rightBorder(), qreal(8));
+ QCOMPARE(cellFormat.rightBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.rightBorderStyle(), QTextFrameFormat::BorderStyle_Groove);
+
+ QCOMPARE(cellFormat.bottomBorder(), qreal(8));
+ QCOMPARE(cellFormat.bottomBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.bottomBorderStyle(), QTextFrameFormat::BorderStyle_Groove);
+
+ QCOMPARE(cellFormat.topBorder(), qreal(8));
+ QCOMPARE(cellFormat.topBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.topBorderStyle(), QTextFrameFormat::BorderStyle_Groove);
+}
+
+void tst_QTextDocumentFragment::css_tableCellBorderShorthand()
+{
+ const char html[] = "<body><table><tr><td style=\"border-left:1px solid green;border-right:2px dashed red;border-bottom:3px dotted yellow;border-top:4px dot-dash blue\">Foo</td></tr></table></body>";
+ doc->setHtml(html);
+
+ cursor.movePosition(QTextCursor::Start);
+ cursor.movePosition(QTextCursor::NextBlock);
+ QTextTable *table = cursor.currentTable();
+ QVERIFY(table);
+
+ QTextTableCell cell = table->cellAt(0, 0);
+ QTextTableCellFormat cellFormat = cell.format().toTableCellFormat();
+ QCOMPARE(cellFormat.leftBorder(), qreal(1));
+ QCOMPARE(cellFormat.leftBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.leftBorderStyle(), QTextFrameFormat::BorderStyle_Solid);
+
+ QCOMPARE(cellFormat.rightBorder(), qreal(2));
+ QCOMPARE(cellFormat.rightBorderBrush(), QBrush(QColor("red")));
+ QCOMPARE(cellFormat.rightBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.bottomBorder(), qreal(3));
+ QCOMPARE(cellFormat.bottomBorderBrush(), QBrush(QColor("yellow")));
+ QCOMPARE(cellFormat.bottomBorderStyle(), QTextFrameFormat::BorderStyle_Dotted);
+
+ QCOMPARE(cellFormat.topBorder(), qreal(4));
+ QCOMPARE(cellFormat.topBorderBrush(), QBrush(QColor("blue")));
+ QCOMPARE(cellFormat.topBorderStyle(), QTextFrameFormat::BorderStyle_DotDash);
+}
+
+void tst_QTextDocumentFragment::css_tableCellAllBordersShorthand()
+{
+ const char html[] = "<body><table><tr><td style=\"border:2px dashed green\">Foo</td></tr></table></body>";
+ doc->setHtml(html);
+
+ cursor.movePosition(QTextCursor::Start);
+ cursor.movePosition(QTextCursor::NextBlock);
+ QTextTable *table = cursor.currentTable();
+ QVERIFY(table);
+
+ QTextTableCell cell = table->cellAt(0, 0);
+ QTextTableCellFormat cellFormat = cell.format().toTableCellFormat();
+ QCOMPARE(cellFormat.leftBorder(), qreal(2));
+ QCOMPARE(cellFormat.leftBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.leftBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.rightBorder(), qreal(2));
+ QCOMPARE(cellFormat.rightBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.rightBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.bottomBorder(), qreal(2));
+ QCOMPARE(cellFormat.bottomBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.bottomBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.topBorder(), qreal(2));
+ QCOMPARE(cellFormat.topBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.topBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+}
+
+void tst_QTextDocumentFragment::css_tableCellOverrideOneBorder()
+{
+ const char html[] = "<body><table><tr><td style=\"border:2px dashed green;border-left:4px solid red\">Foo</td></tr></table></body>";
+ doc->setHtml(html);
+
+ cursor.movePosition(QTextCursor::Start);
+ cursor.movePosition(QTextCursor::NextBlock);
+ QTextTable *table = cursor.currentTable();
+ QVERIFY(table);
+
+ QTextTableCell cell = table->cellAt(0, 0);
+ QTextTableCellFormat cellFormat = cell.format().toTableCellFormat();
+ QCOMPARE(cellFormat.leftBorder(), qreal(4));
+ QCOMPARE(cellFormat.leftBorderBrush(), QBrush(QColor("red")));
+ QCOMPARE(cellFormat.leftBorderStyle(), QTextFrameFormat::BorderStyle_Solid);
+
+ QCOMPARE(cellFormat.rightBorder(), qreal(2));
+ QCOMPARE(cellFormat.rightBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.rightBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.bottomBorder(), qreal(2));
+ QCOMPARE(cellFormat.bottomBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.bottomBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+
+ QCOMPARE(cellFormat.topBorder(), qreal(2));
+ QCOMPARE(cellFormat.topBorderBrush(), QBrush(QColor("green")));
+ QCOMPARE(cellFormat.topBorderStyle(), QTextFrameFormat::BorderStyle_Dashed);
+}
+
+void tst_QTextDocumentFragment::css_tableBorderCollapse()
+{
+ const char html[] = "<body><table style=\"border-collapse:collapse\"><tr><td>Foo</td></tr></table></body>";
+ doc->setHtml(html);
+
+ cursor.movePosition(QTextCursor::Start);
+ cursor.movePosition(QTextCursor::NextBlock);
+ QTextTable *table = cursor.currentTable();
+ QVERIFY(table);
+
+ QCOMPARE(table->format().borderCollapse(), true);
+}
+
void tst_QTextDocumentFragment::css_cellPaddings()
{
const char html[] = "<body><table><tr><td style=\"padding-left:1\">Foo</td>"
@@ -1925,7 +2066,7 @@ void tst_QTextDocumentFragment::html_nobr()
QString text = doc->begin().begin().fragment().text();
QString expectedText = input;
- expectedText.replace(QRegExp("\\s+"), QString(QChar::Nbsp));
+ expectedText.replace(QRegularExpression("\\s+"), QString(QChar::Nbsp));
QCOMPARE(text, expectedText);
}
diff --git a/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST b/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
index b13b2497d3..5c81e74aa0 100644
--- a/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
+++ b/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
@@ -1,2 +1,4 @@
[imageAtRightAlignedTab]
-linux
+rhel-6.6
+rhel-7.4
+rhel-7.6
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index f0a32c2ed4..2dcca0209e 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -138,6 +138,7 @@ private slots:
void noModificationOfInputString();
void superscriptCrash_qtbug53911();
void showLineAndParagraphSeparatorsCrash();
+ void koreanWordWrap();
void tooManyDirectionalCharctersCrash_qtbug77819();
private:
@@ -2067,7 +2068,12 @@ void tst_QTextLayout::cursorInLigatureWithMultipleLines()
void tst_QTextLayout::xToCursorForLigatures()
{
+#if defined(Q_OS_WIN32)
+ QTextLayout layout("fi", QFont("Calibri", 20));
+#else
QTextLayout layout("fi", QFont("Times", 20));
+#endif
+
layout.setCacheEnabled(true);
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -2228,7 +2234,6 @@ void tst_QTextLayout::superscriptCrash_qtbug53911()
for (int j = 0; j < 4; ++j) {
QTextLayout* newTextLayout = new QTextLayout();
newTextLayout->setText(layoutText);
- QList<QTextLayout::FormatRange> formatRanges;
QTextLayout::FormatRange formatRange;
formatRange.format.setFont(QFont());
@@ -2257,8 +2262,7 @@ void tst_QTextLayout::superscriptCrash_qtbug53911()
formatRange.start = 0;
formatRange.length = layoutText.size();
- formatRanges << formatRange;
- newTextLayout->setAdditionalFormats(formatRanges);
+ newTextLayout->setFormats({formatRange});
textLayouts.push_front(newTextLayout);
}
@@ -2289,10 +2293,7 @@ void tst_QTextLayout::nbspWithFormat()
formatRange.length = 1;
formatRange.format.setFontUnderline(true);
- QList<QTextLayout::FormatRange> overrides;
- overrides.append(formatRange);
-
- layout.setAdditionalFormats(overrides);
+ layout.setFormats({formatRange});
layout.beginLayout();
forever {
@@ -2310,6 +2311,31 @@ void tst_QTextLayout::nbspWithFormat()
QCOMPARE(layout.lineAt(1).textLength(), s2.length() + 1 + s3.length());
}
+void tst_QTextLayout::koreanWordWrap()
+{
+ QString s = QString::fromUtf8("안녕하세요 여러분!");
+ QTextLayout layout;
+ QTextOption option = layout.textOption();
+ option.setWrapMode(QTextOption::WordWrap);
+ option.setFlags(QTextOption::Flag(QTextOption::IncludeTrailingSpaces));
+ layout.setTextOption(option);
+ layout.setText(s);
+
+ QFontMetrics metrics(layout.font());
+
+ layout.beginLayout();
+ forever {
+ QTextLine line = layout.createLine();
+ if (!line.isValid())
+ break;
+ line.setLineWidth(metrics.horizontalAdvance(s) * 0.8);
+ }
+ layout.endLayout();
+ QCOMPARE(layout.lineCount(), 2);
+ QCOMPARE(layout.lineAt(0).textLength(), 6);
+ QCOMPARE(layout.lineAt(1).textLength(), 4);
+}
+
void tst_QTextLayout::tooManyDirectionalCharctersCrash_qtbug77819()
{
QString data;
diff --git a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
index d623ce4044..93e40e7f23 100644
--- a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
+++ b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
@@ -314,7 +314,7 @@ void tst_QTextList::partialRemoval()
selection.deleteChar(); // deletes the second list
QVERIFY(!secondList);
- QVERIFY(!firstList->isEmpty());
+ QVERIFY(firstList->count() > 0);
doc->undo();
}
diff --git a/tests/auto/gui/text/qtextmarkdownimporter/data/headingBulletsContinuations.md b/tests/auto/gui/text/qtextmarkdownimporter/data/headingBulletsContinuations.md
new file mode 100644
index 0000000000..99eb633d17
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownimporter/data/headingBulletsContinuations.md
@@ -0,0 +1,28 @@
+# heading
+- bullet 1
+ continuation line 1, indented via tab
+- bullet 2
+ continuation line 2, indented via 4 spaces
+- bullet 3
+
+ continuation paragraph 3, indented via tab
+
+ - bullet 3.1
+
+ continuation paragraph 3.1, indented via 4 spaces
+
+ - bullet 3.2
+ continuation line, indented via 2 tabs
+- bullet 4
+
+ continuation paragraph 4, indented via 4 spaces
+ and continuing onto another line too
+
+- bullet 5
+
+ continuation paragraph 5, indented via 2 spaces and continuing onto another
+ line too
+
+- bullet 6
+
+plain old paragraph at the end
diff --git a/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md b/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md
new file mode 100644
index 0000000000..7a0d5388ad
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownimporter/data/thematicBreaks.md
@@ -0,0 +1,17 @@
+Heading
+-------
+***
+stars
+- bullet
+ ** not a bullet or a rule, just two stars
+- [ ] unchecked
+
+ --- indented too far, so not a rule
+* * *
+stars with tabs between
+***
+stars with whitespace after
+---
+hyphens with whitespace after
+_____
+underscores with whitespace after
diff --git a/tests/auto/gui/text/qtextmarkdownimporter/qtextmarkdownimporter.pro b/tests/auto/gui/text/qtextmarkdownimporter/qtextmarkdownimporter.pro
new file mode 100644
index 0000000000..7b7fb61244
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownimporter/qtextmarkdownimporter.pro
@@ -0,0 +1,9 @@
+CONFIG += testcase
+TARGET = tst_qtextmarkdownimporter
+QT += core-private gui-private testlib
+SOURCES += tst_qtextmarkdownimporter.cpp
+TESTDATA += \
+ data/thematicBreaks.md \
+ data/headingBulletsContinuations.md \
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp b/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp
new file mode 100644
index 0000000000..2f0b877799
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownimporter/tst_qtextmarkdownimporter.cpp
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QTextDocument>
+#include <QTextCursor>
+#include <QTextBlock>
+#include <QTextList>
+#include <QTextTable>
+#include <QBuffer>
+#include <QDebug>
+
+#include <private/qtextmarkdownimporter_p.h>
+
+// #define DEBUG_WRITE_HTML
+
+Q_LOGGING_CATEGORY(lcTests, "qt.text.tests")
+
+static const QChar LineBreak = QChar(0x2028);
+static const QChar Tab = QLatin1Char('\t');
+static const QChar Space = QLatin1Char(' ');
+static const QChar Period = QLatin1Char('.');
+
+class tst_QTextMarkdownImporter : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void headingBulletsContinuations();
+ void thematicBreaks();
+ void lists_data();
+ void lists();
+};
+
+void tst_QTextMarkdownImporter::headingBulletsContinuations()
+{
+ const QStringList expectedBlocks = QStringList() <<
+ "" << // we could do without this blank line before the heading, but currently it happens
+ "heading" <<
+ "bullet 1 continuation line 1, indented via tab" <<
+ "bullet 2 continuation line 2, indented via 4 spaces" <<
+ "bullet 3" <<
+ "continuation paragraph 3, indented via tab" <<
+ "bullet 3.1" <<
+ "continuation paragraph 3.1, indented via 4 spaces" <<
+ "bullet 3.2 continuation line, indented via 2 tabs" <<
+ "bullet 4" <<
+ "continuation paragraph 4, indented via 4 spaces and continuing onto another line too" <<
+ "bullet 5" <<
+ // indenting by only 2 spaces is perhaps non-standard but currently is OK
+ "continuation paragraph 5, indented via 2 spaces and continuing onto another line too" <<
+ "bullet 6" <<
+ "plain old paragraph at the end";
+
+ QFile f(QFINDTESTDATA("data/headingBulletsContinuations.md"));
+ QVERIFY(f.open(QFile::ReadOnly | QIODevice::Text));
+ QString md = QString::fromUtf8(f.readAll());
+ f.close();
+
+ QTextDocument doc;
+ QTextMarkdownImporter(QTextMarkdownImporter::DialectGitHub).import(&doc, md);
+ QTextFrame::iterator iterator = doc.rootFrame()->begin();
+ QTextFrame *currentFrame = iterator.currentFrame();
+ QStringList::const_iterator expectedIt = expectedBlocks.constBegin();
+ int i = 0;
+ while (!iterator.atEnd()) {
+ // There are no child frames
+ QCOMPARE(iterator.currentFrame(), currentFrame);
+ // Check whether we got the right child block
+ QTextBlock block = iterator.currentBlock();
+ QCOMPARE(block.text().contains(LineBreak), false);
+ QCOMPARE(block.text().contains(Tab), false);
+ QVERIFY(!block.text().startsWith(Space));
+ int expectedIndentation = 0;
+ if (block.text().contains(QLatin1String("continuation paragraph")))
+ expectedIndentation = (block.text().contains(Period) ? 2 : 1);
+ qCDebug(lcTests) << i << "child block" << block.text() << "indentation" << block.blockFormat().indent();
+ QVERIFY(expectedIt != expectedBlocks.constEnd());
+ QCOMPARE(block.text(), *expectedIt);
+ if (i > 2)
+ QCOMPARE(block.blockFormat().indent(), expectedIndentation);
+ ++iterator;
+ ++expectedIt;
+ ++i;
+ }
+ QCOMPARE(expectedIt, expectedBlocks.constEnd());
+
+#ifdef DEBUG_WRITE_HTML
+ {
+ QFile out("/tmp/headingBulletsContinuations.html");
+ out.open(QFile::WriteOnly);
+ out.write(doc.toHtml().toLatin1());
+ out.close();
+ }
+#endif
+}
+
+void tst_QTextMarkdownImporter::thematicBreaks()
+{
+ int horizontalRuleCount = 0;
+ int textLinesCount = 0;
+
+ QFile f(QFINDTESTDATA("data/thematicBreaks.md"));
+ QVERIFY(f.open(QFile::ReadOnly | QIODevice::Text));
+ QString md = QString::fromUtf8(f.readAll());
+ f.close();
+
+ QTextDocument doc;
+ QTextMarkdownImporter(QTextMarkdownImporter::DialectGitHub).import(&doc, md);
+ QTextFrame::iterator iterator = doc.rootFrame()->begin();
+ QTextFrame *currentFrame = iterator.currentFrame();
+ int i = 0;
+ while (!iterator.atEnd()) {
+ // There are no child frames
+ QCOMPARE(iterator.currentFrame(), currentFrame);
+ // Check whether the block is text or a horizontal rule
+ QTextBlock block = iterator.currentBlock();
+ if (block.blockFormat().hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth))
+ ++horizontalRuleCount;
+ else if (!block.text().isEmpty())
+ ++textLinesCount;
+ qCDebug(lcTests) << i << (block.blockFormat().hasProperty(QTextFormat::BlockTrailingHorizontalRulerWidth) ? QLatin1String("- - -") : block.text());
+ ++iterator;
+ ++i;
+ }
+ QCOMPARE(horizontalRuleCount, 5);
+ QCOMPARE(textLinesCount, 9);
+
+#ifdef DEBUG_WRITE_HTML
+ {
+ QFile out("/tmp/thematicBreaks.html");
+ out.open(QFile::WriteOnly);
+ out.write(doc.toHtml().toLatin1());
+ out.close();
+ }
+#endif
+}
+
+void tst_QTextMarkdownImporter::lists_data()
+{
+ QTest::addColumn<QString>("input");
+ QTest::addColumn<int>("expectedItemCount");
+ QTest::addColumn<bool>("expectedEmptyItems");
+ QTest::addColumn<QString>("rewrite");
+
+ // Some of these cases show odd behavior, which is subject to change
+ // as the importer and the writer are tweaked to fix bugs over time.
+ QTest::newRow("dot newline") << ".\n" << 0 << true << ".\n\n";
+ QTest::newRow("number dot newline") << "1.\n" << 1 << true << "1. \n";
+ QTest::newRow("star newline") << "*\n" << 1 << true << "* \n";
+ QTest::newRow("hyphen newline") << "-\n" << 1 << true << "- \n";
+ QTest::newRow("hyphen space newline") << "- \n" << 1 << true << "- \n";
+ QTest::newRow("hyphen space letter newline") << "- a\n" << 1 << false << "- a\n";
+ QTest::newRow("hyphen nbsp newline") <<
+ QString::fromUtf8("-\u00A0\n") << 0 << true << "-\u00A0\n\n";
+ QTest::newRow("nested empty lists") << "*\n *\n *\n" << 1 << true << " * \n";
+ QTest::newRow("list nested in empty list") << "-\n * a\n" << 2 << false << "- \n * a\n";
+ QTest::newRow("lists nested in empty lists")
+ << "-\n * a\n * b\n- c\n *\n + d\n" << 5 << false
+ << "- \n * a\n * b\n- c *\n + d\n";
+ QTest::newRow("numeric lists nested in empty lists")
+ << "- \n 1. a\n 2. b\n- c\n 1.\n + d\n" << 4 << false
+ << "- \n 1. a\n 2. b\n- c 1. + d\n";
+}
+
+void tst_QTextMarkdownImporter::lists()
+{
+ QFETCH(QString, input);
+ QFETCH(int, expectedItemCount);
+ QFETCH(bool, expectedEmptyItems);
+ QFETCH(QString, rewrite);
+
+ QTextDocument doc;
+ doc.setMarkdown(input); // QTBUG-78870 : don't crash
+ QTextFrame::iterator iterator = doc.rootFrame()->begin();
+ QTextFrame *currentFrame = iterator.currentFrame();
+ int i = 0;
+ int itemCount = 0;
+ bool emptyItems = true;
+ while (!iterator.atEnd()) {
+ // There are no child frames
+ QCOMPARE(iterator.currentFrame(), currentFrame);
+ // Check whether the block is text or a horizontal rule
+ QTextBlock block = iterator.currentBlock();
+ if (block.textList()) {
+ ++itemCount;
+ if (!block.text().isEmpty())
+ emptyItems = false;
+ }
+ qCDebug(lcTests, "%d %s%s", i,
+ (block.textList() ? "<li>" : "<p>"), qPrintable(block.text()));
+ ++iterator;
+ ++i;
+ }
+ QCOMPARE(itemCount, expectedItemCount);
+ QCOMPARE(emptyItems, expectedEmptyItems);
+ QCOMPARE(doc.toMarkdown(), rewrite);
+}
+
+QTEST_MAIN(tst_QTextMarkdownImporter)
+#include "tst_qtextmarkdownimporter.moc"
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/BLACKLIST b/tests/auto/gui/text/qtextmarkdownwriter/BLACKLIST
new file mode 100644
index 0000000000..0ce46130ce
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/BLACKLIST
@@ -0,0 +1,2 @@
+[rewriteDocument]
+winrt
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/blockquotes.md b/tests/auto/gui/text/qtextmarkdownwriter/data/blockquotes.md
new file mode 100644
index 0000000000..6336d0219f
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/blockquotes.md
@@ -0,0 +1,62 @@
+In 1958, Mahatma Gandhi was quoted as follows:
+
+> The Earth provides enough to satisfy every man's need but not for every man's
+> greed.
+
+In [The CommonMark Specification](https://spec.commonmark.org/0.29/) John
+MacFarlane writes:
+
+> What distinguishes Markdown from many other lightweight markup syntaxes,
+> which are often easier to write, is its readability. As Gruber writes:
+
+> > The overriding design goal for Markdown's formatting syntax is to make it
+> > as readable as possible. The idea is that a Markdown-formatted document should
+> > be publishable as-is, as plain text, without looking like it's been marked up
+> > with tags or formatting instructions. (
+> > [http://daringfireball.net/projects/markdown/](http://daringfireball.net/projects/markdown/)
+> > )
+
+> The point can be illustrated by comparing a sample of AsciiDoc with an
+> equivalent sample of Markdown. Here is a sample of AsciiDoc from the AsciiDoc
+> manual:
+
+> ``` AsciiDoc
+> 1. List item one.
+> +
+> List item one continued with a second paragraph followed by an
+> Indented block.
+> +
+> .................
+> $ ls *.sh
+> $ mv *.sh ~/tmp
+> .................
+> +
+> List item continued with a third paragraph.
+>
+> 2. List item two continued with an open block.
+> ...
+> ```
+The quotation includes an embedded quotation and a code quotation and ends with
+an ellipsis due to being incomplete.
+
+Now let's have an indented code block:
+
+ #include <stdio.h>
+
+ int main(void)
+ {
+ printf("# hello markdown\n");
+ return 0;
+ }
+
+and end with a fenced code block:
+~~~ pseudocode
+#include <something.h>
+#include <else.h>
+
+a block {
+ a statement;
+ another statement;
+}
+~~~
+
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/example.md b/tests/auto/gui/text/qtextmarkdownwriter/data/example.md
new file mode 100644
index 0000000000..0c3f34e09d
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/example.md
@@ -0,0 +1,95 @@
+# QTextEdit
+
+The QTextEdit widget is an advanced editor that supports formatted rich text.
+It can be used to display HTML and other rich document formats. Internally,
+QTextEdit uses the QTextDocument class to describe both the high-level
+structure of each document and the low-level formatting of paragraphs.
+
+If you are viewing this document in the textedit example, you can edit this
+document to explore Qt's rich text editing features. We have included some
+comments in each of the following sections to encourage you to experiment.
+
+## Font and Paragraph Styles
+
+QTextEdit supports **bold**, *italic*, and ~~strikethrough~~ font styles, and can
+display multicolored text. Font families such as Times New Roman and `Courier`
+can also be used directly. *If you place the cursor in a region of styled text,
+the controls in the tool bars will change to reflect the current style.*
+
+Paragraphs can be formatted so that the text is left-aligned, right-aligned,
+centered, or fully justified.
+
+*Try changing the alignment of some text and resize the editor to see how the
+text layout changes.*
+
+## Lists
+
+Different kinds of lists can be included in rich text documents. Standard
+bullet lists can be nested, using different symbols for each level of the list:
+
+- Disc symbols are typically used for top-level list items.
+ * Circle symbols can be used to distinguish between items in lower-level
+ lists.
+ + Square symbols provide a reasonable alternative to discs and circles.
+
+Ordered lists can be created that can be used for tables of contents. Different
+characters can be used to enumerate items, and we can use both Roman and Arabic
+numerals in the same list structure:
+
+1. Introduction
+2. Qt Tools
+ 1) Qt Assistant
+ 2) Qt Designer
+ 1. Form Editor
+ 2. Component Architecture
+ 3) Qt Linguist
+
+The list will automatically be renumbered if you add or remove items. *Try
+adding new sections to the above list or removing existing item to see the
+numbers change.*
+
+## Images
+
+Inline images are treated like ordinary ranges of characters in the text
+editor, so they flow with the surrounding text. Images can also be selected in
+the same way as text, making it easy to cut, copy, and paste them.
+
+![image](images/logo32.png) *Try to select this image by clicking and dragging
+over it with the mouse, or use the text cursor to select it by holding down
+Shift and using the arrow keys. You can then cut or copy it, and paste it into
+different parts of this document.*
+
+## Tables
+
+QTextEdit can arrange and format tables, supporting features such as row and
+column spans, text formatting within cells, and size constraints for columns.
+
+
+| |Development Tools |Programming Techniques |Graphical User Interfaces|
+|-------------|------------------------------------|---------------------------|-------------------------|
+|9:00 - 11:00 |Introduction to Qt |||
+|11:00 - 13:00|Using qmake |Object-oriented Programming|Layouts in Qt |
+|13:00 - 15:00|Qt Designer Tutorial |Extreme Programming |Writing Custom Styles |
+|15:00 - 17:00|Qt Linguist and Internationalization|  |  |
+
+*Try adding text to the cells in the table and experiment with the alignment of
+the paragraphs.*
+
+## Hyperlinks
+
+QTextEdit is designed to support hyperlinks between documents, and this feature
+is used extensively in
+[Qt Assistant](http://doc.qt.io/qt-5/qtassistant-index.html). Hyperlinks are
+automatically created when an HTML file is imported into an editor. Since the
+rich text framework supports hyperlinks natively, they can also be created
+programatically.
+
+## Undo and Redo
+
+Full support for undo and redo operations is built into QTextEdit and the
+underlying rich text framework. Operations on a document can be packaged
+together to make editing a more comfortable experience for the user.
+
+*Try making changes to this document and press `Ctrl+Z` to undo them. You can
+always recover the original contents of the document.*
+
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/headingsAndLists.md b/tests/auto/gui/text/qtextmarkdownwriter/data/headingsAndLists.md
new file mode 100644
index 0000000000..d5d14fb168
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/headingsAndLists.md
@@ -0,0 +1,12 @@
+# heading 1
+
+- list item 1
+- list item 2
+
+## heading 2
+
+1) list item 1
+2) list item 2
+
+the end paragraph
+
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/data/wordWrap.md b/tests/auto/gui/text/qtextmarkdownwriter/data/wordWrap.md
new file mode 100644
index 0000000000..dacb0acf77
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/data/wordWrap.md
@@ -0,0 +1,13 @@
+[The CommonMark Specification](https://spec.commonmark.org/0.29/) is the
+conservative formal specification of the Markdown format, while
+[GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown)
+adds extra features such as task lists and tables.
+
+Qt owes thanks to the authors of the [MD4C parser](https://github.com/mity/md4c)
+for making markdown import possible. The QTextMarkdownWriter class does not
+have such dependencies, and also has not yet been tested as extensively, so we
+do not yet guarantee that we are able to rewrite every Markdown document that
+you are able to read and display with Text or QTextEdit. But you are free to
+write [bugs](https://bugreports.qt.io) about any troublesome cases that you
+encounter.
+
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/qtextmarkdownwriter.pro b/tests/auto/gui/text/qtextmarkdownwriter/qtextmarkdownwriter.pro
new file mode 100644
index 0000000000..6144710b99
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/qtextmarkdownwriter.pro
@@ -0,0 +1,9 @@
+CONFIG += testcase
+TARGET = tst_qtextmarkdownwriter
+QT += core-private gui-private testlib
+SOURCES += tst_qtextmarkdownwriter.cpp
+TESTDATA += \
+ data/example.md \
+ data/blockquotes.md \
+
+DEFINES += SRCDIR=\\\"$$PWD\\\"
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
new file mode 100644
index 0000000000..d15e856a20
--- /dev/null
+++ b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp
@@ -0,0 +1,473 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QTextDocument>
+#include <QTextCursor>
+#include <QTextBlock>
+#include <QTextList>
+#include <QTextTable>
+#include <QBuffer>
+#include <QDebug>
+
+#include <private/qtextmarkdownwriter_p.h>
+
+// #define DEBUG_WRITE_OUTPUT
+
+class tst_QTextMarkdownWriter : public QObject
+{
+ Q_OBJECT
+public slots:
+ void init();
+ void cleanup();
+
+private slots:
+ void testWriteParagraph_data();
+ void testWriteParagraph();
+ void testWriteList();
+ void testWriteEmptyList();
+ void testWriteNestedBulletLists_data();
+ void testWriteNestedBulletLists();
+ void testWriteNestedNumericLists();
+ void testWriteTable();
+ void rewriteDocument_data();
+ void rewriteDocument();
+ void fromHtml_data();
+ void fromHtml();
+
+private:
+ QString documentToUnixMarkdown();
+
+private:
+ QTextDocument *document;
+};
+
+void tst_QTextMarkdownWriter::init()
+{
+ document = new QTextDocument();
+}
+
+void tst_QTextMarkdownWriter::cleanup()
+{
+ delete document;
+}
+
+void tst_QTextMarkdownWriter::testWriteParagraph_data()
+{
+ QTest::addColumn<QString>("input");
+ QTest::addColumn<QString>("output");
+
+ QTest::newRow("empty") << "" <<
+ "";
+ QTest::newRow("spaces") << "foobar word" <<
+ "foobar word\n\n";
+ QTest::newRow("starting spaces") << " starting spaces" <<
+ " starting spaces\n\n";
+ QTest::newRow("trailing spaces") << "trailing spaces " <<
+ "trailing spaces \n\n";
+ QTest::newRow("tab") << "word\ttab x" <<
+ "word\ttab x\n\n";
+ QTest::newRow("tab2") << "word\t\ttab\tx" <<
+ "word\t\ttab\tx\n\n";
+ QTest::newRow("misc") << "foobar word\ttab x" <<
+ "foobar word\ttab x\n\n";
+ QTest::newRow("misc2") << "\t \tFoo" <<
+ "\t \tFoo\n\n";
+}
+
+void tst_QTextMarkdownWriter::testWriteParagraph()
+{
+ QFETCH(QString, input);
+ QFETCH(QString, output);
+
+ QTextCursor cursor(document);
+ cursor.insertText(input);
+
+ QCOMPARE(documentToUnixMarkdown(), output);
+}
+
+void tst_QTextMarkdownWriter::testWriteList()
+{
+ QTextCursor cursor(document);
+ QTextList *list = cursor.createList(QTextListFormat::ListDisc);
+ cursor.insertText("ListItem 1");
+ list->add(cursor.block());
+ cursor.insertBlock();
+ cursor.insertText("ListItem 2");
+ list->add(cursor.block());
+
+ QCOMPARE(documentToUnixMarkdown(), QString::fromLatin1(
+ "- ListItem 1\n- ListItem 2\n"));
+}
+
+void tst_QTextMarkdownWriter::testWriteEmptyList()
+{
+ QTextCursor cursor(document);
+ cursor.createList(QTextListFormat::ListDisc);
+
+ QCOMPARE(documentToUnixMarkdown(), QString::fromLatin1("- \n"));
+}
+
+void tst_QTextMarkdownWriter::testWriteNestedBulletLists_data()
+{
+ QTest::addColumn<bool>("checkbox");
+ QTest::addColumn<bool>("checked");
+ QTest::addColumn<bool>("continuationLine");
+ QTest::addColumn<bool>("continuationParagraph");
+ QTest::addColumn<QString>("expectedOutput");
+
+ QTest::newRow("plain bullets") << false << false << false << false <<
+ "- ListItem 1\n * ListItem 2\n + ListItem 3\n- ListItem 4\n * ListItem 5\n";
+ QTest::newRow("bullets with continuation lines") << false << false << true << false <<
+ "- ListItem 1\n * ListItem 2\n + ListItem 3 with text that won't fit on one line and thus needs a\n continuation\n- ListItem 4\n * ListItem 5 with text that won't fit on one line and thus needs a\n continuation\n";
+ QTest::newRow("bullets with continuation paragraphs") << false << false << false << true <<
+ "- ListItem 1\n\n * ListItem 2\n + ListItem 3\n\n continuation\n\n- ListItem 4\n\n * ListItem 5\n\n continuation\n\n";
+ QTest::newRow("unchecked") << true << false << false << false <<
+ "- [ ] ListItem 1\n * [ ] ListItem 2\n + [ ] ListItem 3\n- [ ] ListItem 4\n * [ ] ListItem 5\n";
+ QTest::newRow("checked") << true << true << false << false <<
+ "- [x] ListItem 1\n * [x] ListItem 2\n + [x] ListItem 3\n- [x] ListItem 4\n * [x] ListItem 5\n";
+ QTest::newRow("checked with continuation lines") << true << true << true << false <<
+ "- [x] ListItem 1\n * [x] ListItem 2\n + [x] ListItem 3 with text that won't fit on one line and thus needs a\n continuation\n- [x] ListItem 4\n * [x] ListItem 5 with text that won't fit on one line and thus needs a\n continuation\n";
+ QTest::newRow("checked with continuation paragraphs") << true << true << false << true <<
+ "- [x] ListItem 1\n\n * [x] ListItem 2\n + [x] ListItem 3\n\n continuation\n\n- [x] ListItem 4\n\n * [x] ListItem 5\n\n continuation\n\n";
+}
+
+void tst_QTextMarkdownWriter::testWriteNestedBulletLists()
+{
+ QFETCH(bool, checkbox);
+ QFETCH(bool, checked);
+ QFETCH(bool, continuationParagraph);
+ QFETCH(bool, continuationLine);
+ QFETCH(QString, expectedOutput);
+
+ QTextCursor cursor(document);
+ QTextBlockFormat blockFmt = cursor.blockFormat();
+ if (checkbox) {
+ blockFmt.setMarker(checked ? QTextBlockFormat::MarkerType::Checked : QTextBlockFormat::MarkerType::Unchecked);
+ cursor.setBlockFormat(blockFmt);
+ }
+
+ QTextList *list1 = cursor.createList(QTextListFormat::ListDisc);
+ cursor.insertText("ListItem 1");
+ list1->add(cursor.block());
+
+ QTextListFormat fmt2;
+ fmt2.setStyle(QTextListFormat::ListCircle);
+ fmt2.setIndent(2);
+ QTextList *list2 = cursor.insertList(fmt2);
+ cursor.insertText("ListItem 2");
+
+ QTextListFormat fmt3;
+ fmt3.setStyle(QTextListFormat::ListSquare);
+ fmt3.setIndent(3);
+ cursor.insertList(fmt3);
+ cursor.insertText(continuationLine ?
+ "ListItem 3 with text that won't fit on one line and thus needs a continuation" :
+ "ListItem 3");
+ if (continuationParagraph) {
+ QTextBlockFormat blockFmt;
+ blockFmt.setIndent(2);
+ cursor.insertBlock(blockFmt);
+ cursor.insertText("continuation");
+ }
+
+ cursor.insertBlock(blockFmt);
+ cursor.insertText("ListItem 4");
+ list1->add(cursor.block());
+
+ cursor.insertBlock();
+ cursor.insertText(continuationLine ?
+ "ListItem 5 with text that won't fit on one line and thus needs a continuation" :
+ "ListItem 5");
+ list2->add(cursor.block());
+ if (continuationParagraph) {
+ QTextBlockFormat blockFmt;
+ blockFmt.setIndent(2);
+ cursor.insertBlock(blockFmt);
+ cursor.insertText("continuation");
+ }
+
+ QString output = documentToUnixMarkdown();
+#ifdef DEBUG_WRITE_OUTPUT
+ {
+ QFile out("/tmp/" + QLatin1String(QTest::currentDataTag()) + ".md");
+ out.open(QFile::WriteOnly);
+ out.write(output.toUtf8());
+ out.close();
+ }
+#endif
+ QCOMPARE(documentToUnixMarkdown(), expectedOutput);
+}
+
+void tst_QTextMarkdownWriter::testWriteNestedNumericLists()
+{
+ QTextCursor cursor(document);
+
+ QTextList *list1 = cursor.createList(QTextListFormat::ListDecimal);
+ cursor.insertText("ListItem 1");
+ list1->add(cursor.block());
+
+ QTextListFormat fmt2;
+ fmt2.setStyle(QTextListFormat::ListLowerAlpha);
+ fmt2.setNumberSuffix(QLatin1String(")"));
+ fmt2.setIndent(2);
+ QTextList *list2 = cursor.insertList(fmt2);
+ cursor.insertText("ListItem 2");
+
+ QTextListFormat fmt3;
+ fmt3.setStyle(QTextListFormat::ListDecimal);
+ fmt3.setIndent(3);
+ cursor.insertList(fmt3);
+ cursor.insertText("ListItem 3");
+
+ cursor.insertBlock();
+ cursor.insertText("ListItem 4");
+ list1->add(cursor.block());
+
+ cursor.insertBlock();
+ cursor.insertText("ListItem 5");
+ list2->add(cursor.block());
+
+ // There's no QTextList API to set the starting number so we hard-coded all lists to start at 1 (QTBUG-65384)
+ QCOMPARE(documentToUnixMarkdown(), QString::fromLatin1(
+ "1. ListItem 1\n 1) ListItem 2\n 1. ListItem 3\n2. ListItem 4\n 2) ListItem 5\n"));
+}
+
+void tst_QTextMarkdownWriter::testWriteTable()
+{
+ QTextCursor cursor(document);
+ QTextTable * table = cursor.insertTable(4, 3);
+ cursor = table->cellAt(0, 0).firstCursorPosition();
+ // valid Markdown tables need headers, but QTextTable doesn't make that distinction
+ // so QTextMarkdownWriter assumes the first row of any table is a header
+ cursor.insertText("one");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("two");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("three");
+ cursor.movePosition(QTextCursor::NextCell);
+
+ cursor.insertText("alice");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("bob");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("carl");
+ cursor.movePosition(QTextCursor::NextCell);
+
+ cursor.insertText("dennis");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("eric");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("fiona");
+ cursor.movePosition(QTextCursor::NextCell);
+
+ cursor.insertText("gina");
+ /*
+ |one |two |three|
+ |------|----|-----|
+ |alice |bob |carl |
+ |dennis|eric|fiona|
+ |gina | | |
+ */
+
+ QString md = documentToUnixMarkdown();
+
+#ifdef DEBUG_WRITE_OUTPUT
+ {
+ QFile out("/tmp/table.md");
+ out.open(QFile::WriteOnly);
+ out.write(md.toUtf8());
+ out.close();
+ }
+#endif
+
+ QString expected = QString::fromLatin1(
+ "\n|one |two |three|\n|------|----|-----|\n|alice |bob |carl |\n|dennis|eric|fiona|\n|gina | | |\n\n");
+ QCOMPARE(md, expected);
+
+ // create table with merged cells
+ document->clear();
+ cursor = QTextCursor(document);
+ table = cursor.insertTable(3, 3);
+ table->mergeCells(0, 0, 1, 2);
+ table->mergeCells(1, 1, 1, 2);
+ cursor = table->cellAt(0, 0).firstCursorPosition();
+ cursor.insertText("a");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("b");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("c");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("d");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("e");
+ cursor.movePosition(QTextCursor::NextCell);
+ cursor.insertText("f");
+ /*
+ +---+-+
+ |a |b|
+ +---+-+
+ |c| d|
+ +-+-+-+
+ |e|f| |
+ +-+-+-+
+
+ generates
+
+ |a ||b|
+ |-|-|-|
+ |c|d ||
+ |e|f| |
+
+ */
+
+ md = documentToUnixMarkdown();
+
+#ifdef DEBUG_WRITE_OUTPUT
+ {
+ QFile out("/tmp/table-merged-cells.md");
+ out.open(QFile::WriteOnly);
+ out.write(md.toUtf8());
+ out.close();
+ }
+#endif
+
+ QCOMPARE(md, QString::fromLatin1("\n|a ||b|\n|-|-|-|\n|c|d ||\n|e|f| |\n\n"));
+}
+
+void tst_QTextMarkdownWriter::rewriteDocument_data()
+{
+ QTest::addColumn<QString>("inputFile");
+
+ QTest::newRow("block quotes") << "blockquotes.md";
+ QTest::newRow("example") << "example.md";
+ QTest::newRow("list items after headings") << "headingsAndLists.md";
+ QTest::newRow("word wrap") << "wordWrap.md";
+}
+
+void tst_QTextMarkdownWriter::rewriteDocument()
+{
+ QFETCH(QString, inputFile);
+ QTextDocument doc;
+ QFile f(QFINDTESTDATA("data/" + inputFile));
+ QVERIFY(f.open(QFile::ReadOnly | QIODevice::Text));
+ QString orig = QString::fromUtf8(f.readAll());
+ f.close();
+ doc.setMarkdown(orig);
+ QString md = doc.toMarkdown();
+
+#ifdef DEBUG_WRITE_OUTPUT
+ QFile out("/tmp/rewrite-" + inputFile);
+ out.open(QFile::WriteOnly);
+ out.write(md.toUtf8());
+ out.close();
+#endif
+
+ QCOMPARE(md, orig);
+}
+
+void tst_QTextMarkdownWriter::fromHtml_data()
+{
+ QTest::addColumn<QString>("expectedInput");
+ QTest::addColumn<QString>("expectedOutput");
+
+ QTest::newRow("long URL") <<
+ "<span style=\"font-style:italic;\">https://www.example.com/dir/subdir/subsubdir/subsubsubdir/subsubsubsubdir/subsubsubsubsubdir/</span>" <<
+ "*https://www.example.com/dir/subdir/subsubdir/subsubsubdir/subsubsubsubdir/subsubsubsubsubdir/*\n\n";
+ QTest::newRow("non-emphasis inline asterisk") << "3 * 4" << "3 * 4\n\n";
+ QTest::newRow("arithmetic") << "(2 * a * x + b)^2 = b^2 - 4 * a * c" << "(2 * a * x + b)^2 = b^2 - 4 * a * c\n\n";
+ QTest::newRow("escaped asterisk after newline") <<
+ "The first sentence of this paragraph holds 80 characters, then there's a star. * This is wrapped, but is <em>not</em> a bullet point." <<
+ "The first sentence of this paragraph holds 80 characters, then there's a star.\n\\* This is wrapped, but is *not* a bullet point.\n\n";
+ QTest::newRow("escaped plus after newline") <<
+ "The first sentence of this paragraph holds 80 characters, then there's a plus. + This is wrapped, but is <em>not</em> a bullet point." <<
+ "The first sentence of this paragraph holds 80 characters, then there's a plus.\n\\+ This is wrapped, but is *not* a bullet point.\n\n";
+ QTest::newRow("escaped hyphen after newline") <<
+ "The first sentence of this paragraph holds 80 characters, then there's a minus. - This is wrapped, but is <em>not</em> a bullet point." <<
+ "The first sentence of this paragraph holds 80 characters, then there's a minus.\n\\- This is wrapped, but is *not* a bullet point.\n\n";
+ QTest::newRow("list items with indented continuations") <<
+ "<ul><li>bullet<p>continuation paragraph</p></li><li>another bullet<br/>continuation line</li></ul>" <<
+ "- bullet\n\n continuation paragraph\n\n- another bullet\n continuation line\n";
+ QTest::newRow("nested list items with continuations") <<
+ "<ul><li>bullet<p>continuation paragraph</p></li><li>another bullet<br/>continuation line</li><ul><li>bullet<p>continuation paragraph</p></li><li>another bullet<br/>continuation line</li></ul></ul>" <<
+ "- bullet\n\n continuation paragraph\n\n- another bullet\n continuation line\n\n - bullet\n\n continuation paragraph\n\n - another bullet\n continuation line\n";
+ QTest::newRow("nested ordered list items with continuations") <<
+ "<ol><li>item<p>continuation paragraph</p></li><li>another item<br/>continuation line</li><ol><li>item<p>continuation paragraph</p></li><li>another item<br/>continuation line</li></ol><li>another</li><li>another</li></ol>" <<
+ "1. item\n\n continuation paragraph\n\n2. another item\n continuation line\n\n 1. item\n\n continuation paragraph\n\n 2. another item\n continuation line\n\n3. another\n4. another\n";
+ QTest::newRow("thematic break") <<
+ "something<hr/>something else" <<
+ "something\n\n- - -\nsomething else\n\n";
+ QTest::newRow("block quote") <<
+ "<p>In 1958, Mahatma Gandhi was quoted as follows:</p><blockquote>The Earth provides enough to satisfy every man's need but not for every man's greed.</blockquote>" <<
+ "In 1958, Mahatma Gandhi was quoted as follows:\n\n> The Earth provides enough to satisfy every man's need but not for every man's\n> greed.\n\n";
+ QTest::newRow("image") <<
+ "<img src=\"/url\" alt=\"foo\" title=\"title\"/>" <<
+ "![foo](/url \"title\")\n\n";
+ QTest::newRow("code") <<
+ "<pre class=\"language-pseudocode\">\n#include \"foo.h\"\n\nblock {\n statement();\n}\n\n</pre>" <<
+ "``` pseudocode\n#include \"foo.h\"\n\nblock {\n statement();\n}\n```\n\n";
+ // TODO
+// QTest::newRow("escaped number and paren after double newline") <<
+// "<p>(The first sentence of this paragraph is a line, the next paragraph has a number</p>13) but that's not part of an ordered list" <<
+// "(The first sentence of this paragraph is a line, the next paragraph has a number\n\n13\\) but that's not part of an ordered list\n\n";
+// QTest::newRow("preformats with embedded backticks") <<
+// "<pre>none `one` ``two``</pre><pre>```three``` ````four````</pre>plain" <<
+// "``` none `one` ``two`` ```\n\n````` ```three``` ````four```` `````\n\nplain\n\n";
+}
+
+void tst_QTextMarkdownWriter::fromHtml()
+{
+ QFETCH(QString, expectedInput);
+ QFETCH(QString, expectedOutput);
+
+ document->setHtml(expectedInput);
+ QString output = documentToUnixMarkdown();
+
+#ifdef DEBUG_WRITE_OUTPUT
+ {
+ QFile out("/tmp/" + QLatin1String(QTest::currentDataTag()) + ".md");
+ out.open(QFile::WriteOnly);
+ out.write(output.toUtf8());
+ out.close();
+ }
+#endif
+
+ QCOMPARE(output, expectedOutput);
+}
+
+QString tst_QTextMarkdownWriter::documentToUnixMarkdown()
+{
+ QString ret;
+ QTextStream ts(&ret, QIODevice::WriteOnly);
+ QTextMarkdownWriter writer(ts, QTextDocument::MarkdownDialectGitHub);
+ writer.writeAll(document);
+ return ret;
+}
+
+QTEST_MAIN(tst_QTextMarkdownWriter)
+#include "tst_qtextmarkdownwriter.moc"
diff --git a/tests/auto/gui/text/qtexttable/qtexttable.pro b/tests/auto/gui/text/qtexttable/qtexttable.pro
index 2faadfcb0d..73e94d5735 100644
--- a/tests/auto/gui/text/qtexttable/qtexttable.pro
+++ b/tests/auto/gui/text/qtexttable/qtexttable.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qtexttable
-QT += testlib
+QT += testlib gui-private
qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtexttable.cpp
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index 22f00c677d..7b2ff4cc10 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -44,11 +44,14 @@
#include <QPainter>
#include <QPaintEngine>
#endif
+#include <private/qpagedpaintdevice_p.h>
typedef QList<int> IntList;
QT_FORWARD_DECLARE_CLASS(QTextDocument)
+Q_DECLARE_METATYPE(QTextFrameFormat::BorderStyle);
+
class tst_QTextTable : public QObject
{
Q_OBJECT
@@ -91,9 +94,11 @@ private slots:
void QTBUG11282_insertBeforeMergedEnding();
#endif
void QTBUG22011_insertBeforeRowSpan();
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && defined(QT_BUILD_INTERNAL)
void QTBUG31330_renderBackground();
#endif
+ void checkBorderAttributes_data();
+ void checkBorderAttributes();
private:
QTextTable *create2x2Table();
@@ -1025,7 +1030,7 @@ void tst_QTextTable::QTBUG22011_insertBeforeRowSpan()
QCOMPARE(table->columns(), 6);
}
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && defined(QT_BUILD_INTERNAL)
namespace {
class QTBUG31330_PaintDevice : public QPagedPaintDevice
{
@@ -1065,11 +1070,46 @@ public:
{}
};
+ class QDummyPagedPaintDevicePrivate : public QPagedPaintDevicePrivate
+ {
+ bool setPageLayout(const QPageLayout &newPageLayout) override
+ {
+ m_pageLayout = newPageLayout;
+ return m_pageLayout.isEquivalentTo(newPageLayout);
+ }
+
+ bool setPageSize(const QPageSize &pageSize) override
+ {
+ m_pageLayout.setPageSize(pageSize);
+ return m_pageLayout.pageSize().isEquivalentTo(pageSize);
+ }
+
+ bool setPageOrientation(QPageLayout::Orientation orientation) override
+ {
+ m_pageLayout.setOrientation(orientation);
+ return m_pageLayout.orientation() == orientation;
+ }
+
+ bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) override
+ {
+ m_pageLayout.setUnits(units);
+ m_pageLayout.setMargins(margins);
+ return m_pageLayout.margins() == margins && m_pageLayout.units() == units;
+ }
+
+ QPageLayout pageLayout() const override
+ {
+ return m_pageLayout;
+ }
+
+ QPageLayout m_pageLayout;
+ };
+
int pages;
QPaintEngine* engine;
QTBUG31330_PaintDevice(QPaintEngine* engine)
- : pages(1), engine(engine)
+ : QPagedPaintDevice(new QDummyPagedPaintDevicePrivate), pages(1), engine(engine)
{
QPageLayout layout = pageLayout();
layout.setUnits(QPageLayout::Point);
@@ -1134,5 +1174,109 @@ void tst_QTextTable::QTBUG31330_renderBackground()
}
#endif
+void tst_QTextTable::checkBorderAttributes_data()
+{
+ QTest::addColumn<QString>("html");
+ QTest::addColumn<qreal>("topBorderWidth");
+ QTest::addColumn<qreal>("bottomBorderWidth");
+ QTest::addColumn<qreal>("leftBorderWidth");
+ QTest::addColumn<qreal>("rightBorderWidth");
+ QTest::addColumn<QTextFrameFormat::BorderStyle>("topBorderStyle");
+ QTest::addColumn<QTextFrameFormat::BorderStyle>("bottomBorderStyle");
+ QTest::addColumn<QTextFrameFormat::BorderStyle>("leftBorderStyle");
+ QTest::addColumn<QTextFrameFormat::BorderStyle>("rightBorderStyle");
+ QTest::addColumn<QBrush>("topBorderBrush");
+ QTest::addColumn<QBrush>("bottomBorderBrush");
+ QTest::addColumn<QBrush>("leftBorderBrush");
+ QTest::addColumn<QBrush>("rightBorderBrush");
+
+ const QString tableHtmlStart = QStringLiteral("<html><head><style>");
+ const QString tableHtmlEnd = QStringLiteral("</style></head><body>"
+ "<table border=\"1\"><tr><td>One</td><td>Two</td></tr>"
+ "<tr><td>Three</td><td>Four</td></tr></table></body></html>");
+ QTest::newRow("1px-solid-colors")
+ << QString("%1"
+ "td {"
+ "border-top: 1px solid red;"
+ "border-bottom: 1px solid blue;"
+ "border-left: 1px solid green;"
+ "border-right: 1px solid yellow;"
+ "}"
+ "%2").arg(tableHtmlStart).arg(tableHtmlEnd)
+ << 1.0 << 1.0 << 1.0 << 1.0
+ << QTextFrameFormat::BorderStyle_Solid << QTextFrameFormat::BorderStyle_Solid
+ << QTextFrameFormat::BorderStyle_Solid << QTextFrameFormat::BorderStyle_Solid
+ << QBrush(Qt::red) << QBrush(Qt::blue) << QBrush(Qt::darkGreen) << QBrush(Qt::yellow);
+ QTest::newRow("MixedWidth-solid-colors")
+ << QString("%1"
+ "td {"
+ "border-top: 1px solid red;"
+ "border-bottom: 2px solid blue;"
+ "border-left: 3px solid green;"
+ "border-right: 4px solid yellow;"
+ "}"
+ "%2").arg(tableHtmlStart).arg(tableHtmlEnd)
+ << 1.0 << 2.0 << 3.0 << 4.0
+ << QTextFrameFormat::BorderStyle_Solid << QTextFrameFormat::BorderStyle_Solid
+ << QTextFrameFormat::BorderStyle_Solid << QTextFrameFormat::BorderStyle_Solid
+ << QBrush(Qt::red) << QBrush(Qt::blue) << QBrush(Qt::darkGreen) << QBrush(Qt::yellow);
+ QTest::newRow("MixedWidth-MixedStyle-colors")
+ << QString("%1"
+ "td {"
+ "border-top: 1px solid red;"
+ "border-bottom: 2px dotted blue;"
+ "border-left: 3px dashed green;"
+ "border-right: 4px inset yellow;"
+ "}"
+ "%2").arg(tableHtmlStart).arg(tableHtmlEnd)
+ << 1.0 << 2.0 << 3.0 << 4.0
+ << QTextFrameFormat::BorderStyle_Solid << QTextFrameFormat::BorderStyle_Dotted
+ << QTextFrameFormat::BorderStyle_Dashed << QTextFrameFormat::BorderStyle_Inset
+ << QBrush(Qt::red) << QBrush(Qt::blue) << QBrush(Qt::darkGreen) << QBrush(Qt::yellow);
+}
+
+void tst_QTextTable::checkBorderAttributes()
+{
+ QFETCH(QString, html);
+ QFETCH(qreal, topBorderWidth);
+ QFETCH(qreal, bottomBorderWidth);
+ QFETCH(qreal, leftBorderWidth);
+ QFETCH(qreal, rightBorderWidth);
+ QFETCH(QTextFrameFormat::BorderStyle, topBorderStyle);
+ QFETCH(QTextFrameFormat::BorderStyle, bottomBorderStyle);
+ QFETCH(QTextFrameFormat::BorderStyle, leftBorderStyle);
+ QFETCH(QTextFrameFormat::BorderStyle, rightBorderStyle);
+ QFETCH(QBrush, topBorderBrush);
+ QFETCH(QBrush, bottomBorderBrush);
+ QFETCH(QBrush, leftBorderBrush);
+ QFETCH(QBrush, rightBorderBrush);
+
+ QTextDocument doc;
+ doc.setHtml(html);
+ QTextCursor cursor(doc.firstBlock());
+ cursor.movePosition(QTextCursor::Right);
+
+ QTextTable *currentTable = cursor.currentTable();
+ QVERIFY(currentTable);
+ for (int row = 0; row < 2; row++) {
+ for (int column = 0; column < 2; column++) {
+ QTextTableCell cell = currentTable->cellAt(row, column);
+ QTextCharFormat cellFormat = cell.format();
+ QCOMPARE(cellFormat.doubleProperty(QTextFormat::TableCellTopBorder), topBorderWidth);
+ QCOMPARE(cellFormat.doubleProperty(QTextFormat::TableCellBottomBorder), bottomBorderWidth);
+ QCOMPARE(cellFormat.doubleProperty(QTextFormat::TableCellLeftBorder), leftBorderWidth);
+ QCOMPARE(cellFormat.doubleProperty(QTextFormat::TableCellRightBorder), rightBorderWidth);
+ QCOMPARE(cellFormat.property(QTextFormat::TableCellTopBorderStyle), topBorderStyle);
+ QCOMPARE(cellFormat.property(QTextFormat::TableCellBottomBorderStyle), bottomBorderStyle);
+ QCOMPARE(cellFormat.property(QTextFormat::TableCellLeftBorderStyle), leftBorderStyle);
+ QCOMPARE(cellFormat.property(QTextFormat::TableCellRightBorderStyle), rightBorderStyle);
+ QCOMPARE(cellFormat.brushProperty(QTextFormat::TableCellTopBorderBrush), topBorderBrush);
+ QCOMPARE(cellFormat.brushProperty(QTextFormat::TableCellBottomBorderBrush), bottomBorderBrush);
+ QCOMPARE(cellFormat.brushProperty(QTextFormat::TableCellLeftBorderBrush), leftBorderBrush);
+ QCOMPARE(cellFormat.brushProperty(QTextFormat::TableCellRightBorderBrush), rightBorderBrush);
+ }
+ }
+}
+
QTEST_MAIN(tst_QTextTable)
#include "tst_qtexttable.moc"
diff --git a/tests/auto/gui/text/text.pro b/tests/auto/gui/text/text.pro
index 6b033fb506..794d9ea8d3 100644
--- a/tests/auto/gui/text/text.pro
+++ b/tests/auto/gui/text/text.pro
@@ -28,12 +28,16 @@ SUBDIRS=\
win32:SUBDIRS -= qtextpiecetable
+qtConfig(textmarkdownreader): SUBDIRS += qtextmarkdownimporter
+qtConfig(textmarkdownwriter): SUBDIRS += qtextmarkdownwriter
+
!qtConfig(private_tests): SUBDIRS -= \
qfontcache \
qcssparser \
qtextlayout \
qtextpiecetable \
qzip \
+ qtextmarkdownwriter \
qtextodfwriter
!qtHaveModule(xml): SUBDIRS -= \
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index add23d46cf..4d95345de9 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -39,7 +39,9 @@ class tst_qdesktopservices : public QObject
private slots:
void openUrl();
void handlers();
+#if QT_DEPRECATED_SINCE(5, 0)
void testDataLocation();
+#endif
};
void tst_qdesktopservices::openUrl()
@@ -89,6 +91,7 @@ void tst_qdesktopservices::handlers()
#define Q_XDG_PLATFORM
#endif
+#if QT_DEPRECATED_SINCE(5, 0)
void tst_qdesktopservices::testDataLocation()
{
// This is the one point where QDesktopServices and QStandardPaths differ.
@@ -115,6 +118,7 @@ void tst_qdesktopservices::testDataLocation()
#endif
}
}
+#endif
QTEST_MAIN(tst_qdesktopservices)
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index f162c3ae9f..77298342af 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -72,15 +72,20 @@ public:
}
#ifdef QT_NETWORK_LIB
- static QHostAddress serverIP()
+ static QHostAddress getServerIpImpl(const QString &serverName)
{
- const QHostInfo info = QHostInfo::fromName(serverName());
+ const QHostInfo info = QHostInfo::fromName(serverName);
if (info.error()) {
QTest::qFail(qPrintable(info.errorString()), __FILE__, __LINE__);
return QHostAddress();
}
return info.addresses().constFirst();
}
+
+ static QHostAddress serverIP()
+ {
+ return getServerIpImpl(serverName());
+ }
#endif
static bool compareReplyIMAP(QByteArray const& actual)
@@ -104,8 +109,8 @@ public:
static bool compareReplyFtp(QByteArray const& actual)
{
// output would be e.g. "220 (vsFTPd 2.3.5)\r\n221 Goodbye.\r\n"
- QRegExp ftpVersion(QStringLiteral("220 \\(vsFTPd \\d+\\.\\d+.\\d+\\)\\r\\n221 Goodbye.\\r\\n"));
- return ftpVersion.exactMatch(actual);
+ QRegularExpression ftpVersion(QRegularExpression::anchoredPattern(QStringLiteral("220 \\(vsFTPd \\d+\\.\\d+.\\d+\\)\\r\\n221 Goodbye.\\r\\n")));
+ return ftpVersion.match(actual).hasMatch();
}
static bool hasIPv6()
@@ -214,4 +219,67 @@ public:
return serverName();
#endif
}
+ static QString imapServerName()
+ {
+#ifdef QT_TEST_SERVER_NAME
+ return QString("cyrus.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+
+ static QString echoServerName()
+ {
+#ifdef QT_TEST_SERVER_NAME
+ return QString("echo.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+
+ static QString firewallServerName()
+ {
+#ifdef QT_TEST_SERVER_NAME
+ return QString("iptables.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+
+#ifdef QT_NETWORK_LIB
+ static QHostAddress imapServerIp()
+ {
+ return getServerIpImpl(imapServerName());
+ }
+
+ static QHostAddress httpServerIp()
+ {
+ return getServerIpImpl(httpServerName());
+ }
+
+ static QHostAddress httpProxyServerIp()
+ {
+ return getServerIpImpl(httpProxyServerName());
+ }
+
+ static QHostAddress socksProxyServerIp()
+ {
+ return getServerIpImpl(socksProxyServerName());
+ }
+
+ static QHostAddress ftpProxyServerIp()
+ {
+ return getServerIpImpl(ftpProxyServerName());
+ }
+
+ static QHostAddress ftpServerIp()
+ {
+ return getServerIpImpl(ftpServerName());
+ }
+
+ static QHostAddress firewallServerIp()
+ {
+ return getServerIpImpl(firewallServerName());
+ }
+#endif
};
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp
index 5a99d4e50c..a8eebf5a24 100644
--- a/tests/auto/network/access/http2/http2srv.cpp
+++ b/tests/auto/network/access/http2/http2srv.cpp
@@ -76,7 +76,7 @@ void fill_push_header(const HttpHeader &originalRequest, HttpHeader &promisedReq
}
-Http2Server::Http2Server(H2Type type, const Http2::RawSettings &ss, const Http2::RawSettings &cs)
+Http2Server::Http2Server(H2Type type, const RawSettings &ss, const RawSettings &cs)
: connectionType(type),
serverSettings(ss),
expectedClientSettings(cs)
@@ -218,7 +218,7 @@ void Http2Server::sendDATA(quint32 streamID, quint32 windowSize)
quint32 bytesToSend = std::min<quint32>(windowSize, responseBody.size() - offset);
quint32 bytesSent = 0;
- const quint32 frameSizeLimit(clientSetting(Settings::MAX_FRAME_SIZE_ID, Http2::maxFrameSize));
+ const quint32 frameSizeLimit(clientSetting(Settings::MAX_FRAME_SIZE_ID, Http2::minPayloadLimit));
const uchar *src = reinterpret_cast<const uchar *>(responseBody.constData() + offset);
const bool last = offset + bytesToSend == quint32(responseBody.size());
@@ -236,6 +236,10 @@ void Http2Server::sendDATA(quint32 streamID, quint32 windowSize)
src += chunkSize;
bytesToSend -= chunkSize;
bytesSent += chunkSize;
+ if (frameSizeLimit != Http2::minPayloadLimit) {
+ // Our test is probably interested in how many DATA frames were sent.
+ emit sendingData();
+ }
}
if (interrupted.loadAcquire())
@@ -767,7 +771,7 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody)
Q_ASSERT(activeRequests.find(streamID) != activeRequests.end());
const quint32 maxFrameSize(clientSetting(Settings::MAX_FRAME_SIZE_ID,
- Http2::maxFrameSize));
+ Http2::maxPayloadSize));
if (pushPromiseEnabled) {
// A real server supporting PUSH_PROMISE will probably first send
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index 4ef4b25101..3105684d59 100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -42,6 +42,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qatomic.h>
#include <QtCore/qglobal.h>
+#include <QtCore/qmap.h>
#include <vector>
#include <map>
@@ -69,13 +70,15 @@ enum class H2Type {
h2cDirect, // Clear text direct
};
+using RawSettings = QMap<Http2::Settings, quint32>;
+
class Http2Server : public QTcpServer
{
Q_OBJECT
public:
- Http2Server(H2Type type, const Http2::RawSettings &serverSettings,
- const Http2::RawSettings &clientSettings);
+ Http2Server(H2Type type, const RawSettings &serverSettings,
+ const RawSettings &clientSettings);
~Http2Server();
@@ -125,6 +128,7 @@ Q_SIGNALS:
void receivedRequest(quint32 streamID);
void receivedData(quint32 streamID);
void windowUpdate(quint32 streamID);
+ void sendingData();
private slots:
void connectionEstablished();
@@ -147,8 +151,8 @@ private:
bool settingsSent = false;
bool waitingClientAck = false;
- Http2::RawSettings serverSettings;
- Http2::RawSettings expectedClientSettings;
+ RawSettings serverSettings;
+ RawSettings expectedClientSettings;
bool connectionError = false;
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index ea939dfdea..c264956d7b 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -32,8 +32,10 @@
#include <QtNetwork/private/http2protocol_p.h>
#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtNetwork/qhttp2configuration.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkreply.h>
+
#include <QtCore/qglobal.h>
#include <QtCore/qobject.h>
#include <QtCore/qthread.h>
@@ -66,6 +68,26 @@ Q_DECLARE_METATYPE(QNetworkRequest::Attribute)
QT_BEGIN_NAMESPACE
+QHttp2Configuration qt_defaultH2Configuration()
+{
+ QHttp2Configuration config;
+ config.setStreamReceiveWindowSize(Http2::qtDefaultStreamReceiveWindowSize);
+ config.setSessionReceiveWindowSize(Http2::maxSessionReceiveWindowSize);
+ config.setServerPushEnabled(false);
+ return config;
+}
+
+RawSettings qt_H2ConfigurationToSettings(const QHttp2Configuration &config = qt_defaultH2Configuration())
+{
+ RawSettings settings;
+ settings[Http2::Settings::ENABLE_PUSH_ID] = config.serverPushEnabled();
+ settings[Http2::Settings::INITIAL_WINDOW_SIZE_ID] = config.streamReceiveWindowSize();
+ if (config.maxFrameSize() != Http2::minPayloadLimit)
+ settings[Http2::Settings::MAX_FRAME_SIZE_ID] = config.maxFrameSize();
+ return settings;
+}
+
+
class tst_Http2 : public QObject
{
Q_OBJECT
@@ -87,6 +109,7 @@ private slots:
void earlyResponse();
void connectToHost_data();
void connectToHost();
+ void maxFrameSize();
protected slots:
// Slots to listen to our in-process server:
@@ -110,12 +133,13 @@ private:
// small payload.
void runEventLoop(int ms = 5000);
void stopEventLoop();
- Http2Server *newServer(const Http2::RawSettings &serverSettings, H2Type connectionType,
- const Http2::ProtocolParameters &clientSettings = {});
+ Http2Server *newServer(const RawSettings &serverSettings, H2Type connectionType,
+ const RawSettings &clientSettings = qt_H2ConfigurationToSettings());
// Send a get or post request, depending on a payload (empty or not).
void sendRequest(int streamNumber,
QNetworkRequest::Priority priority = QNetworkRequest::NormalPriority,
- const QByteArray &payload = QByteArray());
+ const QByteArray &payload = QByteArray(),
+ const QHttp2Configuration &clientConfiguration = qt_defaultH2Configuration());
QUrl requestUrl(H2Type connnectionType) const;
quint16 serverPort = 0;
@@ -131,14 +155,14 @@ private:
bool prefaceOK = false;
bool serverGotSettingsACK = false;
- static const Http2::RawSettings defaultServerSettings;
+ static const RawSettings defaultServerSettings;
};
#define STOP_ON_FAILURE \
if (QTest::currentTestFailed()) \
return;
-const Http2::RawSettings tst_Http2::defaultServerSettings{{Http2::Settings::MAX_CONCURRENT_STREAMS_ID, 100}};
+const RawSettings tst_Http2::defaultServerSettings{{Http2::Settings::MAX_CONCURRENT_STREAMS_ID, 100}};
namespace {
@@ -308,18 +332,15 @@ void tst_Http2::flowControlClientSide()
nRequests = 10;
windowUpdates = 0;
- Http2::ProtocolParameters params;
+ QHttp2Configuration params;
// A small window size for a session, and even a smaller one per stream -
// this will result in WINDOW_UPDATE frames both on connection stream and
// per stream.
- params.maxSessionReceiveWindowSize = Http2::defaultSessionWindowSize * 5;
- params.settingsFrameData[Settings::INITIAL_WINDOW_SIZE_ID] = Http2::defaultSessionWindowSize;
- // Inform our manager about non-default settings:
- manager->setProperty(Http2::http2ParametersPropertyName, QVariant::fromValue(params));
-
- const Http2::RawSettings serverSettings = {{Settings::MAX_CONCURRENT_STREAMS_ID, quint32(3)}};
- ServerPtr srv(newServer(serverSettings, defaultConnectionType(), params));
+ params.setSessionReceiveWindowSize(Http2::defaultSessionWindowSize * 5);
+ params.setStreamReceiveWindowSize(Http2::defaultSessionWindowSize);
+ const RawSettings serverSettings = {{Settings::MAX_CONCURRENT_STREAMS_ID, quint32(3)}};
+ ServerPtr srv(newServer(serverSettings, defaultConnectionType(), qt_H2ConfigurationToSettings(params)));
const QByteArray respond(int(Http2::defaultSessionWindowSize * 10), 'x');
srv->setResponseBody(respond);
@@ -330,7 +351,7 @@ void tst_Http2::flowControlClientSide()
QVERIFY(serverPort != 0);
for (int i = 0; i < nRequests; ++i)
- sendRequest(i);
+ sendRequest(i, QNetworkRequest::NormalPriority, {}, params);
runEventLoop(120000);
STOP_ON_FAILURE
@@ -359,7 +380,7 @@ void tst_Http2::flowControlServerSide()
serverPort = 0;
nRequests = 10;
- const Http2::RawSettings serverSettings = {{Settings::MAX_CONCURRENT_STREAMS_ID, 7}};
+ const RawSettings serverSettings = {{Settings::MAX_CONCURRENT_STREAMS_ID, 7}};
ServerPtr srv(newServer(serverSettings, defaultConnectionType()));
@@ -392,12 +413,11 @@ void tst_Http2::pushPromise()
serverPort = 0;
nRequests = 1;
- Http2::ProtocolParameters params;
+ QHttp2Configuration params;
// Defaults are good, except ENABLE_PUSH:
- params.settingsFrameData[Settings::ENABLE_PUSH_ID] = 1;
- manager->setProperty(Http2::http2ParametersPropertyName, QVariant::fromValue(params));
+ params.setServerPushEnabled(true);
- ServerPtr srv(newServer(defaultServerSettings, defaultConnectionType(), params));
+ ServerPtr srv(newServer(defaultServerSettings, defaultConnectionType(), qt_H2ConfigurationToSettings(params)));
srv->enablePushPromise(true, QByteArray("/script.js"));
QMetaObject::invokeMethod(srv.data(), "startServer", Qt::QueuedConnection);
@@ -410,6 +430,7 @@ void tst_Http2::pushPromise()
QNetworkRequest request(url);
request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, QVariant(true));
+ request.setHttp2Configuration(params);
auto reply = manager->get(request);
connect(reply, &QNetworkReply::finished, this, &tst_Http2::replyFinished);
@@ -681,6 +702,73 @@ void tst_Http2::connectToHost()
QVERIFY(reply->isFinished());
}
+void tst_Http2::maxFrameSize()
+{
+#if !QT_CONFIG(ssl)
+ QSKIP("TLS support is needed for this test");
+#endif // QT_CONFIG(ssl)
+
+ // Here we test we send 'MAX_FRAME_SIZE' setting in our
+ // 'SETTINGS'. If done properly, our server will not chunk
+ // the payload into several DATA frames.
+
+#if QT_CONFIG(securetransport)
+ // Normally on macOS we use plain text only for SecureTransport
+ // does not support ALPN on the server side. With 'direct encrytped'
+ // we have to use TLS sockets (== private key) and thus suppress a
+ // keychain UI asking for permission to use a private key.
+ // Our CI has this, but somebody testing locally - will have a problem.
+ qputenv("QT_SSL_USE_TEMPORARY_KEYCHAIN", QByteArray("1"));
+ auto envRollback = qScopeGuard([](){
+ qunsetenv("QT_SSL_USE_TEMPORARY_KEYCHAIN");
+ });
+#endif // QT_CONFIG(securetransport)
+
+ auto connectionType = H2Type::h2Alpn;
+ auto attribute = QNetworkRequest::HTTP2AllowedAttribute;
+ if (clearTextHTTP2) {
+ connectionType = H2Type::h2Direct;
+ attribute = QNetworkRequest::Http2DirectAttribute;
+ }
+
+ auto h2Config = qt_defaultH2Configuration();
+ h2Config.setMaxFrameSize(Http2::minPayloadLimit * 3);
+
+ serverPort = 0;
+ nRequests = 1;
+
+ ServerPtr srv(newServer(defaultServerSettings, connectionType,
+ qt_H2ConfigurationToSettings(h2Config)));
+ srv->setResponseBody(QByteArray(Http2::minPayloadLimit * 2, 'q'));
+ QMetaObject::invokeMethod(srv.data(), "startServer", Qt::QueuedConnection);
+ runEventLoop();
+ QVERIFY(serverPort != 0);
+
+ const QSignalSpy frameCounter(srv.data(), &Http2Server::sendingData);
+ auto url = requestUrl(connectionType);
+ url.setPath(QString("/stream1.html"));
+
+ QNetworkRequest request(url);
+ request.setAttribute(attribute, QVariant(true));
+ request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/plain"));
+ request.setHttp2Configuration(h2Config);
+
+ QNetworkReply *reply = manager->get(request);
+ reply->ignoreSslErrors();
+ connect(reply, &QNetworkReply::finished, this, &tst_Http2::replyFinished);
+
+ runEventLoop();
+ STOP_ON_FAILURE
+
+ // Normally, with a 16kb limit, our server would split such
+ // a response into 3 'DATA' frames (16kb + 16kb + 0|END_STREAM).
+ QCOMPARE(frameCounter.count(), 1);
+
+ QVERIFY(nRequests == 0);
+ QVERIFY(prefaceOK);
+ QVERIFY(serverGotSettingsACK);
+}
+
void tst_Http2::serverStarted(quint16 port)
{
serverPort = port;
@@ -692,7 +780,6 @@ void tst_Http2::clearHTTP2State()
windowUpdates = 0;
prefaceOK = false;
serverGotSettingsACK = false;
- manager->setProperty(Http2::http2ParametersPropertyName, QVariant());
}
void tst_Http2::runEventLoop(int ms)
@@ -705,12 +792,11 @@ void tst_Http2::stopEventLoop()
eventLoop.exitLoop();
}
-Http2Server *tst_Http2::newServer(const Http2::RawSettings &serverSettings, H2Type connectionType,
- const Http2::ProtocolParameters &clientSettings)
+Http2Server *tst_Http2::newServer(const RawSettings &serverSettings, H2Type connectionType,
+ const RawSettings &clientSettings)
{
using namespace Http2;
- auto srv = new Http2Server(connectionType, serverSettings,
- clientSettings.settingsFrameData);
+ auto srv = new Http2Server(connectionType, serverSettings, clientSettings);
using Srv = Http2Server;
using Cl = tst_Http2;
@@ -732,7 +818,8 @@ Http2Server *tst_Http2::newServer(const Http2::RawSettings &serverSettings, H2Ty
void tst_Http2::sendRequest(int streamNumber,
QNetworkRequest::Priority priority,
- const QByteArray &payload)
+ const QByteArray &payload,
+ const QHttp2Configuration &h2Config)
{
auto url = requestUrl(defaultConnectionType());
url.setPath(QString("/stream%1.html").arg(streamNumber));
@@ -742,6 +829,7 @@ void tst_Http2::sendRequest(int streamNumber,
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, QVariant(true));
request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("text/plain"));
request.setPriority(priority);
+ request.setHttp2Configuration(h2Config);
QNetworkReply *reply = nullptr;
if (payload.size())
diff --git a/tests/auto/network/access/qabstractnetworkcache/BLACKLIST b/tests/auto/network/access/qabstractnetworkcache/BLACKLIST
deleted file mode 100644
index 2ad52f8b31..0000000000
--- a/tests/auto/network/access/qabstractnetworkcache/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[cacheControl]
-windows
diff --git a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro
index 1874f001ab..c722100ead 100644
--- a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro
+++ b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qabstractnetworkcache.cpp
TESTDATA += tests/*
+CONFIG += unsupported/testserver
+QT_TEST_SERVER_LIST = apache2
diff --git a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index b8d9adf7a1..182e3e9547 100644
--- a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -39,7 +39,7 @@
#include <algorithm>
-#define TESTFILE QLatin1String("http://") + QtNetworkSettings::serverName() + QLatin1String("/qtest/cgi-bin/")
+#define TESTFILE QLatin1String("http://") + QtNetworkSettings::httpServerName() + QLatin1String("/qtest/cgi-bin/")
class tst_QAbstractNetworkCache : public QObject
{
@@ -127,8 +127,13 @@ Q_DECLARE_METATYPE(QNetworkRequest::CacheLoadControl)
void tst_QAbstractNetworkCache::initTestCase()
{
+#if defined(QT_TEST_SERVER)
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80));
+#else
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
+#endif
+
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
networkConfiguration = netConfMan->defaultConfiguration();
diff --git a/tests/auto/network/access/qftp/BLACKLIST b/tests/auto/network/access/qftp/BLACKLIST
index 96d9274653..0a99f3eb00 100644
--- a/tests/auto/network/access/qftp/BLACKLIST
+++ b/tests/auto/network/access/qftp/BLACKLIST
@@ -6,5 +6,11 @@ redhatenterpriselinuxworkstation-6.6
[activeMode:WithoutProxyWithSession]
redhatenterpriselinuxworkstation-6.6
+[list]
+opensuse-leap
+windows-7sp1
+windows-10 msvc-2015
+ubuntu
+osx
[list:epsvNotSupported]
*
diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro
index 1959c1acac..c78020c5f8 100644
--- a/tests/auto/network/access/qftp/qftp.pro
+++ b/tests/auto/network/access/qftp/qftp.pro
@@ -4,3 +4,6 @@ SOURCES += tst_qftp.cpp
requires(qtConfig(private_tests))
QT = core network network-private testlib
+
+CONFIG += unsupported/testserver
+QT_TEST_SERVER_LIST = vsftpd ftp-proxy squid danted
diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp
index 1a8f264c28..2068738a67 100644
--- a/tests/auto/network/access/qftp/tst_qftp.cpp
+++ b/tests/auto/network/access/qftp/tst_qftp.cpp
@@ -43,6 +43,7 @@
#include <QtNetwork/private/qnetworksession_p.h>
#include <QTcpServer>
#include <QHostInfo>
+#include <QElapsedTimer>
#include <QTcpSocket>
#include "../../../network-settings.h"
@@ -208,7 +209,14 @@ void tst_QFtp::initTestCase_data()
void tst_QFtp::initTestCase()
{
+#if defined(QT_TEST_SERVER)
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpServerName(), 21));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpProxyServerName(), 2121));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager manager;
networkSessionImplicit = QSharedPointer<QNetworkSession>::create(manager.defaultConfiguration());
@@ -235,9 +243,9 @@ void tst_QFtp::init()
if (setProxy) {
#ifndef QT_NO_NETWORKPROXY
if (proxyType == QNetworkProxy::Socks5Proxy) {
- QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
+ QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080));
} else if (proxyType == QNetworkProxy::HttpProxy) {
- QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
+ QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3128));
}
#else // !QT_NO_NETWORKPROXY
Q_UNUSED(proxyType);
@@ -316,8 +324,8 @@ void tst_QFtp::connectToHost_data()
QTest::addColumn<uint>("port");
QTest::addColumn<int>("state");
- QTest::newRow( "ok01" ) << QtNetworkSettings::serverName() << (uint)21 << (int)QFtp::Connected;
- QTest::newRow( "error01" ) << QtNetworkSettings::serverName() << (uint)2222 << (int)QFtp::Unconnected;
+ QTest::newRow( "ok01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << (int)QFtp::Connected;
+ QTest::newRow( "error01" ) << QtNetworkSettings::ftpServerName() << (uint)2222 << (int)QFtp::Unconnected;
QTest::newRow( "error02" ) << QString("foo.bar") << (uint)21 << (int)QFtp::Unconnected;
}
@@ -402,13 +410,13 @@ void tst_QFtp::login_data()
QTest::addColumn<QString>("password");
QTest::addColumn<int>("success");
- QTest::newRow( "ok01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << 1;
- QTest::newRow( "ok02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("") << 1;
- QTest::newRow( "ok03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << 1;
- QTest::newRow( "ok04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << 1;
+ QTest::newRow( "ok01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << 1;
+ QTest::newRow( "ok02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftp") << QString("") << 1;
+ QTest::newRow( "ok03" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftp") << QString("foo") << 1;
+ QTest::newRow( "ok04" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << 1;
- QTest::newRow( "error01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("foo") << QString("") << 0;
- QTest::newRow( "error02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("foo") << QString("bar") << 0;
+ QTest::newRow( "error01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("foo") << QString("") << 0;
+ QTest::newRow( "error02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("foo") << QString("bar") << 0;
}
void tst_QFtp::login()
@@ -448,12 +456,12 @@ void tst_QFtp::close_data()
QTest::addColumn<QString>("password");
QTest::addColumn<bool>("login");
- QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << true;
- QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << true;
- QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << true;
- QTest::newRow( "login04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << true;
+ QTest::newRow( "login01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << true;
+ QTest::newRow( "login02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftp") << QString() << true;
+ QTest::newRow( "login03" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftp") << QString("foo") << true;
+ QTest::newRow( "login04" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << true;
- QTest::newRow( "no-login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("") << QString("") << false;
+ QTest::newRow( "no-login01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("") << QString("") << false;
}
void tst_QFtp::close()
@@ -503,17 +511,17 @@ void tst_QFtp::list_data()
flukeQtest << "rfc3252.txt";
flukeQtest << "upload";
- QTest::newRow( "workDir01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString() << 1 << flukeRoot;
- QTest::newRow( "workDir02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString() << 1 << flukeRoot;
+ QTest::newRow( "workDir01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString() << 1 << flukeRoot;
+ QTest::newRow( "workDir02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString() << 1 << flukeRoot;
- QTest::newRow( "relPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("qtest") << 1 << flukeQtest;
- QTest::newRow( "relPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString("qtest") << 1 << flukeQtest;
+ QTest::newRow( "relPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("qtest") << 1 << flukeQtest;
+ QTest::newRow( "relPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString("qtest") << 1 << flukeQtest;
- QTest::newRow( "absPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("/qtest") << 1 << flukeQtest;
- QTest::newRow( "absPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString("/var/ftp/qtest") << 1 << flukeQtest;
+ QTest::newRow( "absPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("/qtest") << 1 << flukeQtest;
+ QTest::newRow( "absPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString("/var/ftp/qtest") << 1 << flukeQtest;
- QTest::newRow( "nonExist01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("foo") << 1 << QStringList();
- QTest::newRow( "nonExist02" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("/foo") << 1 << QStringList();
+ QTest::newRow( "nonExist01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("foo") << 1 << QStringList();
+ QTest::newRow( "nonExist02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("/foo") << 1 << QStringList();
// ### The microsoft server does not seem to work properly at the moment --
// I am also not able to open a data connection with other, non-Qt FTP
// clients to it.
@@ -573,14 +581,14 @@ void tst_QFtp::cd_data()
flukeQtest << "rfc3252.txt";
flukeQtest << "upload";
- QTest::newRow( "relPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("qtest") << 1 << flukeQtest;
- QTest::newRow( "relPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString("qtest") << 1 << flukeQtest;
+ QTest::newRow( "relPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("qtest") << 1 << flukeQtest;
+ QTest::newRow( "relPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString("qtest") << 1 << flukeQtest;
- QTest::newRow( "absPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("/qtest") << 1 << flukeQtest;
- QTest::newRow( "absPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString("/var/ftp/qtest") << 1 << flukeQtest;
+ QTest::newRow( "absPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("/qtest") << 1 << flukeQtest;
+ QTest::newRow( "absPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString("/var/ftp/qtest") << 1 << flukeQtest;
- QTest::newRow( "nonExist01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("foo") << 0 << QStringList();
- QTest::newRow( "nonExist03" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("/foo") << 0 << QStringList();
+ QTest::newRow( "nonExist01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("foo") << 0 << QStringList();
+ QTest::newRow( "nonExist03" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("/foo") << 0 << QStringList();
}
void tst_QFtp::cd()
@@ -635,19 +643,19 @@ void tst_QFtp::get_data()
// test the two get() overloads in one routine
for ( int i=0; i<2; i++ ) {
const QByteArray iB = QByteArray::number(i);
- QTest::newRow(("relPath01_" + iB).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow(("relPath01_" + iB).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< "qtest/rfc3252" << 1 << rfc3252 << (bool)(i==1);
- QTest::newRow(("relPath02_" + iB).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow(("relPath02_" + iB).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< "qtest/rfc3252" << 1 << rfc3252 << (bool)(i==1);
- QTest::newRow(("absPath01_" + iB).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow(("absPath01_" + iB).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< "/qtest/rfc3252" << 1 << rfc3252 << (bool)(i==1);
- QTest::newRow(("absPath02_" + iB).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow(("absPath02_" + iB).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< "/var/ftp/qtest/rfc3252" << 1 << rfc3252 << (bool)(i==1);
- QTest::newRow(("nonExist01_" + iB).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow(("nonExist01_" + iB).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< QString("foo") << 0 << QByteArray() << (bool)(i==1);
- QTest::newRow(("nonExist02_" + iB).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow(("nonExist02_" + iB).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< QString("/foo") << 0 << QByteArray() << (bool)(i==1);
}
}
@@ -727,31 +735,31 @@ void tst_QFtp::put_data()
// test the two put() overloads in one routine with a file name containing
// U+0x00FC (latin small letter u with diaeresis) for QTBUG-52303, testing UTF-8
for ( int i=0; i<2; i++ ) {
- QTest::newRow(("relPath01_" + QByteArray::number(i)).constData()) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow(("relPath01_" + QByteArray::number(i)).constData()) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< (QLatin1String("qtest/upload/rel01_") + QChar(0xfc) + QLatin1String("%1")) << rfc3252
<< (bool)(i==1) << 1;
/*
- QTest::newRow( QString("relPath02_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( QString("relPath02_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< QString("qtest/upload/rel02_%1") << rfc3252
<< (bool)(i==1) << 1;
- QTest::newRow( QString("relPath03_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( QString("relPath03_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< QString("qtest/upload/rel03_%1") << QByteArray()
<< (bool)(i==1) << 1;
- QTest::newRow( QString("relPath04_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( QString("relPath04_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< QString("qtest/upload/rel04_%1") << bigData
<< (bool)(i==1) << 1;
- QTest::newRow( QString("absPath01_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow( QString("absPath01_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< QString("/qtest/upload/abs01_%1") << rfc3252
<< (bool)(i==1) << 1;
- QTest::newRow( QString("absPath02_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( QString("absPath02_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< QString("/srv/ftp/qtest/upload/abs02_%1") << rfc3252
<< (bool)(i==1) << 1;
- QTest::newRow( QString("nonExist01_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow( QString("nonExist01_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< QString("foo") << QByteArray()
<< (bool)(i==1) << 0;
- QTest::newRow( QString("nonExist02_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow( QString("nonExist02_%1").arg(i).toLatin1().constData() ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< QString("/foo") << QByteArray()
<< (bool)(i==1) << 0;
*/
@@ -877,22 +885,22 @@ void tst_QFtp::mkdir_data()
QTest::addColumn<QString>("dirToCreate");
QTest::addColumn<int>("success");
- QTest::newRow( "relPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow( "relPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< "qtest/upload" << QString("rel01_%1") << 1;
- QTest::newRow( "relPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( "relPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< "qtest/upload" << QString("rel02_%1") << 1;
- QTest::newRow( "relPath03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( "relPath03" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< "qtest/upload" << QString("rel03_%1") << 1;
- QTest::newRow( "absPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow( "absPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< "." << QString("/qtest/upload/abs01_%1") << 1;
- QTest::newRow( "absPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password")
+ QTest::newRow( "absPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password")
<< "." << QString("/var/ftp/qtest/upload/abs02_%1") << 1;
- // QTest::newRow( "nonExist01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("foo") << 0;
- QTest::newRow( "nonExist01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ // QTest::newRow( "nonExist01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("foo") << 0;
+ QTest::newRow( "nonExist01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< "." << QString("foo") << 0;
- QTest::newRow( "nonExist02" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString()
+ QTest::newRow( "nonExist02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString()
<< "." << QString("/foo") << 0;
}
@@ -979,7 +987,7 @@ void tst_QFtp::mkdir()
void tst_QFtp::mkdir2()
{
ftp = new QFtp;
- ftp->connectToHost(QtNetworkSettings::serverName());
+ ftp->connectToHost(QtNetworkSettings::ftpServerName());
ftp->login();
current_id = ftp->cd("kake/test");
@@ -1026,39 +1034,39 @@ void tst_QFtp::rename_data()
QTest::addColumn<QString>("renamedFile");
QTest::addColumn<int>("success");
- QTest::newRow("relPath01") << QtNetworkSettings::serverName() << QString() << QString()
+ QTest::newRow("relPath01") << QtNetworkSettings::ftpServerName() << QString() << QString()
<< "qtest/upload"
<< QString("rel_old01_%1") << QString("rel_new01_%1")
<< QString("qtest/upload/rel_old01_%1") << QString("qtest/upload/rel_new01_%1")
<< 1;
- QTest::newRow("relPath02") << QtNetworkSettings::serverName() << QString("ftptest") << "password"
+ QTest::newRow("relPath02") << QtNetworkSettings::ftpServerName() << QString("ftptest") << "password"
<< "qtest/upload"
<< QString("rel_old02_%1") << QString("rel_new02_%1")
<< QString("qtest/upload/rel_old02_%1") << QString("qtest/upload/rel_new02_%1")
<< 1;
- QTest::newRow("relPath03") << QtNetworkSettings::serverName() << QString("ftptest") << "password"
+ QTest::newRow("relPath03") << QtNetworkSettings::ftpServerName() << QString("ftptest") << "password"
<< "qtest/upload"
<< QString("rel_old03_%1")<< QString("rel_new03_%1")
<< QString("qtest/upload/rel_old03_%1") << QString("qtest/upload/rel_new03_%1")
<< 1;
- QTest::newRow("absPath01") << QtNetworkSettings::serverName() << QString() << QString()
+ QTest::newRow("absPath01") << QtNetworkSettings::ftpServerName() << QString() << QString()
<< QString()
<< QString("/qtest/upload/abs_old01_%1") << QString("/qtest/upload/abs_new01_%1")
<< QString("/qtest/upload/abs_old01_%1") << QString("/qtest/upload/abs_new01_%1")
<< 1;
- QTest::newRow("absPath02") << QtNetworkSettings::serverName() << QString("ftptest") << "password"
+ QTest::newRow("absPath02") << QtNetworkSettings::ftpServerName() << QString("ftptest") << "password"
<< QString()
<< QString("/var/ftp/qtest/upload/abs_old02_%1") << QString("/var/ftp/qtest/upload/abs_new02_%1")
<< QString("/var/ftp/qtest/upload/abs_old02_%1") << QString("/var/ftp/qtest/upload/abs_new02_%1")
<< 1;
- QTest::newRow("nonExist01") << QtNetworkSettings::serverName() << QString() << QString()
+ QTest::newRow("nonExist01") << QtNetworkSettings::ftpServerName() << QString() << QString()
<< QString()
<< QString("foo") << "new_foo"
<< QString() << QString()
<< 0;
- QTest::newRow("nonExist02") << QtNetworkSettings::serverName() << QString() << QString()
+ QTest::newRow("nonExist02") << QtNetworkSettings::ftpServerName() << QString() << QString()
<< QString()
<< QString("/foo") << QString("/new_foo")
<< QString() << QString()
@@ -1220,7 +1228,7 @@ void tst_QFtp::commandSequence_data()
{
// some "constants"
QStringList argConnectToHost01;
- argConnectToHost01 << QtNetworkSettings::serverName() << "21";
+ argConnectToHost01 << QtNetworkSettings::ftpServerName() << "21";
QStringList argLogin01, argLogin02, argLogin03, argLogin04;
argLogin01 << QString() << QString();
@@ -1351,13 +1359,13 @@ void tst_QFtp::abort_data()
QTest::addColumn<QString>("file");
QTest::addColumn<QByteArray>("uploadData");
- QTest::newRow( "get_fluke01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/bigfile") << QByteArray();
- QTest::newRow( "get_fluke02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/rfc3252") << QByteArray();
+ QTest::newRow( "get_fluke01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("qtest/bigfile") << QByteArray();
+ QTest::newRow( "get_fluke02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("qtest/rfc3252") << QByteArray();
// Qt/CE test environment has too little memory for this test
QByteArray bigData( 10*1024*1024, 0 );
bigData.fill( 'B' );
- QTest::newRow( "put_fluke01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/upload/abort_put") << bigData;
+ QTest::newRow( "put_fluke01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("qtest/upload/abort_put") << bigData;
}
void tst_QFtp::abort()
@@ -1402,7 +1410,7 @@ void tst_QFtp::abort()
if ( it.value().success ) {
// The FTP server on fluke is sadly returning a success, even when
// the operation was aborted. So we have to use some heuristics.
- if ( host == QtNetworkSettings::serverName() ) {
+ if ( host == QtNetworkSettings::ftpServerName() ) {
if ( cmd == QFtp::Get ) {
QVERIFY2(bytesDone <= bytesTotal, msgComparison(bytesDone, "<=", bytesTotal));
} else {
@@ -1449,11 +1457,11 @@ void tst_QFtp::bytesAvailable_data()
QTest::addColumn<qlonglong>("bytesAvailFinished");
QTest::addColumn<qlonglong>("bytesAvailDone");
- QTest::newRow( "fluke01" ) << QtNetworkSettings::serverName() << QString("qtest/bigfile") << 0 << (qlonglong)519240 << (qlonglong)519240 << (qlonglong)519240;
- QTest::newRow( "fluke02" ) << QtNetworkSettings::serverName() << QString("qtest/rfc3252") << 0 << (qlonglong)25962 << (qlonglong)25962 << (qlonglong)25962;
+ QTest::newRow( "fluke01" ) << QtNetworkSettings::ftpServerName() << QString("qtest/bigfile") << 0 << (qlonglong)519240 << (qlonglong)519240 << (qlonglong)519240;
+ QTest::newRow( "fluke02" ) << QtNetworkSettings::ftpServerName() << QString("qtest/rfc3252") << 0 << (qlonglong)25962 << (qlonglong)25962 << (qlonglong)25962;
- QTest::newRow( "fluke03" ) << QtNetworkSettings::serverName() << QString("qtest/bigfile") << 1 << (qlonglong)519240 << (qlonglong)0 << (qlonglong)0;
- QTest::newRow( "fluke04" ) << QtNetworkSettings::serverName() << QString("qtest/rfc3252") << 1 << (qlonglong)25962 << (qlonglong)0 << (qlonglong)0;
+ QTest::newRow( "fluke03" ) << QtNetworkSettings::ftpServerName() << QString("qtest/bigfile") << 1 << (qlonglong)519240 << (qlonglong)0 << (qlonglong)0;
+ QTest::newRow( "fluke04" ) << QtNetworkSettings::ftpServerName() << QString("qtest/rfc3252") << 1 << (qlonglong)25962 << (qlonglong)0 << (qlonglong)0;
}
void tst_QFtp::bytesAvailable()
@@ -1498,7 +1506,7 @@ void tst_QFtp::activeMode()
file.open(QIODevice::ReadWrite);
QFtp ftp;
ftp.setTransferMode(QFtp::Active);
- ftp.connectToHost(QtNetworkSettings::serverName(), 21);
+ ftp.connectToHost(QtNetworkSettings::ftpServerName(), 21);
ftp.login();
ftp.list();
ftp.get("/qtest/rfc3252.txt", &file);
@@ -1534,14 +1542,14 @@ void tst_QFtp::proxy_data()
flukeQtest << "rfc3252.txt";
flukeQtest << "upload";
- QTest::newRow( "proxy_relPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("qtest") << 1 << flukeQtest;
- QTest::newRow( "proxy_relPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString("qtest") << 1 << flukeQtest;
+ QTest::newRow( "proxy_relPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("qtest") << 1 << flukeQtest;
+ QTest::newRow( "proxy_relPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString("qtest") << 1 << flukeQtest;
- QTest::newRow( "proxy_absPath01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("/qtest") << 1 << flukeQtest;
- QTest::newRow( "proxy_absPath02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << QString("/var/ftp/qtest") << 1 << flukeQtest;
+ QTest::newRow( "proxy_absPath01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("/qtest") << 1 << flukeQtest;
+ QTest::newRow( "proxy_absPath02" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString("ftptest") << QString("password") << QString("/var/ftp/qtest") << 1 << flukeQtest;
- QTest::newRow( "proxy_nonExist01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("foo") << 0 << QStringList();
- QTest::newRow( "proxy_nonExist03" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << QString("/foo") << 0 << QStringList();
+ QTest::newRow( "proxy_nonExist01" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("foo") << 0 << QStringList();
+ QTest::newRow( "proxy_nonExist03" ) << QtNetworkSettings::ftpServerName() << (uint)21 << QString() << QString() << QString("/foo") << 0 << QStringList();
}
void tst_QFtp::proxy()
@@ -1553,7 +1561,7 @@ void tst_QFtp::proxy()
QFETCH( QString, dir );
ftp = newFtp();
- addCommand( QFtp::SetProxy, ftp->setProxy( QtNetworkSettings::serverName(), 2121 ) );
+ addCommand( QFtp::SetProxy, ftp->setProxy( QtNetworkSettings::ftpProxyServerName(), 2121 ) );
addCommand( QFtp::ConnectToHost, ftp->connectToHost( host, port ) );
addCommand( QFtp::Login, ftp->login( user, password ) );
addCommand( QFtp::Cd, ftp->cd( dir ) );
@@ -1589,7 +1597,7 @@ void tst_QFtp::binaryAscii()
init();
ftp = newFtp();
- addCommand(QFtp::ConnectToHost, ftp->connectToHost(QtNetworkSettings::serverName(), 21));
+ addCommand(QFtp::ConnectToHost, ftp->connectToHost(QtNetworkSettings::ftpServerName(), 21));
addCommand(QFtp::Login, ftp->login("ftptest", "password"));
addCommand(QFtp::Cd, ftp->cd("qtest/upload"));
addCommand(QFtp::Put, ftp->put(putData, file, QFtp::Ascii));
@@ -1599,7 +1607,7 @@ void tst_QFtp::binaryAscii()
delete ftp;
ftp = 0;
if ( QTestEventLoop::instance().timeout() )
- QFAIL( msgTimedOut(QtNetworkSettings::serverName()) );
+ QFAIL( msgTimedOut(QtNetworkSettings::ftpServerName()) );
ResMapIt it = resultMap.find(QFtp::Put);
QVERIFY(it != resultMap.end());
@@ -1611,7 +1619,7 @@ void tst_QFtp::binaryAscii()
init();
ftp = newFtp();
- addCommand(QFtp::ConnectToHost, ftp->connectToHost(QtNetworkSettings::serverName(), 21));
+ addCommand(QFtp::ConnectToHost, ftp->connectToHost(QtNetworkSettings::ftpServerName(), 21));
addCommand(QFtp::Login, ftp->login("ftptest", "password"));
addCommand(QFtp::Cd, ftp->cd("qtest/upload"));
addCommand(QFtp::Get, ftp->get(file, &getBuf, QFtp::Binary));
@@ -1621,7 +1629,7 @@ void tst_QFtp::binaryAscii()
delete ftp;
ftp = 0;
if ( QTestEventLoop::instance().timeout() )
- QFAIL( msgTimedOut(QtNetworkSettings::serverName()) );
+ QFAIL( msgTimedOut(QtNetworkSettings::ftpServerName()) );
ResMapIt it2 = resultMap.find(QFtp::Get);
QVERIFY(it2 != resultMap.end());
@@ -1634,7 +1642,7 @@ void tst_QFtp::binaryAscii()
// cleanup (i.e. remove the file) -- this also tests the remove command
init();
ftp = newFtp();
- addCommand(QFtp::ConnectToHost, ftp->connectToHost(QtNetworkSettings::serverName(), 21));
+ addCommand(QFtp::ConnectToHost, ftp->connectToHost(QtNetworkSettings::ftpServerName(), 21));
addCommand(QFtp::Login, ftp->login("ftptest", "password"));
addCommand(QFtp::Cd, ftp->cd("qtest/upload"));
addCommand(QFtp::Remove, ftp->remove(file));
@@ -1644,13 +1652,13 @@ void tst_QFtp::binaryAscii()
delete ftp;
ftp = 0;
if ( QTestEventLoop::instance().timeout() )
- QFAIL( msgTimedOut(QtNetworkSettings::serverName()) );
+ QFAIL( msgTimedOut(QtNetworkSettings::ftpServerName()) );
it = resultMap.find( QFtp::Remove );
QVERIFY( it != resultMap.end() );
QCOMPARE( it.value().success, 1 );
- QVERIFY(!fileExists(QtNetworkSettings::serverName(), 21, "ftptest", "password", file));
+ QVERIFY(!fileExists(QtNetworkSettings::ftpServerName(), 21, "ftptest", "password", file));
}
@@ -2067,7 +2075,7 @@ void tst_QFtp::doneSignal()
QFtp ftp;
QSignalSpy spy(&ftp, SIGNAL(done(bool)));
- ftp.connectToHost(QtNetworkSettings::serverName());
+ ftp.connectToHost(QtNetworkSettings::ftpServerName());
ftp.login("anonymous");
ftp.list();
ftp.close();
@@ -2137,7 +2145,7 @@ void tst_QFtp::qtbug7359Crash()
QFtp ftp;
ftp.connectToHost("127.0.0.1");
- QTime t;
+ QElapsedTimer t;
int elapsed;
t.start();
diff --git a/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro
index d32b651b86..84e6f857a1 100644
--- a/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro
+++ b/tests/auto/network/access/qhttpnetworkconnection/qhttpnetworkconnection.pro
@@ -4,3 +4,6 @@ SOURCES += tst_qhttpnetworkconnection.cpp
requires(qtConfig(private_tests))
QT = core-private network-private testlib
+
+CONFIG += unsupported/testserver
+QT_TEST_SERVER_LIST = apache2
diff --git a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index 84766f5484..0a9320118d 100644
--- a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -50,6 +50,7 @@ private:
bool finishedCalled;
bool finishedWithErrorCalled;
QNetworkReply::NetworkError netErrorCode;
+ QString (*httpServerName)() = QtNetworkSettings::httpServerName;
private Q_SLOTS:
void initTestCase();
@@ -101,7 +102,11 @@ private Q_SLOTS:
void tst_QHttpNetworkConnection::initTestCase()
{
+#if defined(QT_TEST_SERVER)
+ QVERIFY(QtNetworkSettings::verifyConnection(httpServerName(), 80));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif
}
void tst_QHttpNetworkConnection::options_data()
@@ -126,10 +131,9 @@ void tst_QHttpNetworkConnection::head_data()
QTest::addColumn<QString>("statusString");
QTest::addColumn<int>("contentLength");
- QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962;
-
- QTest::newRow("failure-path") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1;
- QTest::newRow("failure-protocol") << "" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1;
+ QTest::newRow("success-internal") << "http://" << httpServerName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962;
+ QTest::newRow("failure-path") << "http://" << httpServerName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1;
+ QTest::newRow("failure-protocol") << "" << httpServerName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1;
}
void tst_QHttpNetworkConnection::head()
@@ -175,10 +179,10 @@ void tst_QHttpNetworkConnection::get_data()
QTest::addColumn<int>("contentLength");
QTest::addColumn<int>("downloadSize");
- QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962 << 25962;
+ QTest::newRow("success-internal") << "http://" << httpServerName() << "/qtest/rfc3252.txt" << ushort(80) << false << 200 << "OK" << 25962 << 25962;
- QTest::newRow("failure-path") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1 << -1;
- QTest::newRow("failure-protocol") << "" << QtNetworkSettings::serverName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1 << -1;
+ QTest::newRow("failure-path") << "http://" << httpServerName() << "/t" << ushort(80) << false << 404 << "Not Found" << -1 << -1;
+ QTest::newRow("failure-protocol") << "" << httpServerName() << "/qtest/rfc3252.txt" << ushort(80) << false << 400 << "Bad Request" << -1 << -1;
}
void tst_QHttpNetworkConnection::get()
@@ -244,8 +248,8 @@ void tst_QHttpNetworkConnection::put_data()
QTest::addColumn<QString>("data");
QTest::addColumn<bool>("succeed");
- QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/dav/file1.txt" << ushort(80) << false << "Hello World\nEnd of file\n"<<true;
- QTest::newRow("fail-internal") << "http://" << QtNetworkSettings::serverName() << "/dav2/file1.txt" << ushort(80) << false << "Hello World\nEnd of file\n"<<false;
+ QTest::newRow("success-internal") << "http://" << httpServerName() << "/dav/file1.txt" << ushort(80) << false << "Hello World\nEnd of file\n"<<true;
+ QTest::newRow("fail-internal") << "http://" << httpServerName() << "/dav2/file1.txt" << ushort(80) << false << "Hello World\nEnd of file\n"<<false;
QTest::newRow("fail-host") << "http://" << "invalid.test.qt-project.org" << "/dav2/file1.txt" << ushort(80) << false << "Hello World\nEnd of file\n"<<false;
}
@@ -324,8 +328,8 @@ void tst_QHttpNetworkConnection::post_data()
QTest::addColumn<int>("contentLength");
QTest::addColumn<int>("downloadSize");
- QTest::newRow("success-internal") << "http://" << QtNetworkSettings::serverName() << "/qtest/cgi-bin/echo.cgi" << ushort(80) << false << "7 bytes" << 200 << "OK" << 7 << 7;
- QTest::newRow("failure-internal") << "http://" << QtNetworkSettings::serverName() << "/t" << ushort(80) << false << "Hello World" << 404 << "Not Found" << -1 << -1;
+ QTest::newRow("success-internal") << "http://" << httpServerName() << "/qtest/cgi-bin/echo.cgi" << ushort(80) << false << "7 bytes" << 200 << "OK" << 7 << 7;
+ QTest::newRow("failure-internal") << "http://" << httpServerName() << "/t" << ushort(80) << false << "Hello World" << 404 << "Not Found" << -1 << -1;
}
void tst_QHttpNetworkConnection::post()
@@ -449,11 +453,11 @@ void tst_QHttpNetworkConnection::get401_data()
QTest::addColumn<QString>("password");
QTest::addColumn<int>("statusCode");
- QTest::newRow("no-credentials") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfcs-auth/index.html" << ushort(80) << false << false << "" << ""<<401;
- QTest::newRow("invalid-credentials") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfcs-auth/index.html" << ushort(80) << false << true << "test" << "test"<<401;
- QTest::newRow("valid-credentials") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfcs-auth/index.html" << ushort(80) << false << true << "httptest" << "httptest"<<200;
- QTest::newRow("digest-authentication-invalid") << "http://" << QtNetworkSettings::serverName() << "/qtest/auth-digest/index.html" << ushort(80) << false << true << "wrong" << "wrong"<<401;
- QTest::newRow("digest-authentication-valid") << "http://" << QtNetworkSettings::serverName() << "/qtest/auth-digest/index.html" << ushort(80) << false << true << "httptest" << "httptest"<<200;
+ QTest::newRow("no-credentials") << "http://" << httpServerName() << "/qtest/rfcs-auth/index.html" << ushort(80) << false << false << "" << ""<<401;
+ QTest::newRow("invalid-credentials") << "http://" << httpServerName() << "/qtest/rfcs-auth/index.html" << ushort(80) << false << true << "test" << "test"<<401;
+ QTest::newRow("valid-credentials") << "http://" << httpServerName() << "/qtest/rfcs-auth/index.html" << ushort(80) << false << true << "httptest" << "httptest"<<200;
+ QTest::newRow("digest-authentication-invalid") << "http://" << httpServerName() << "/qtest/auth-digest/index.html" << ushort(80) << false << true << "wrong" << "wrong"<<401;
+ QTest::newRow("digest-authentication-valid") << "http://" << httpServerName() << "/qtest/auth-digest/index.html" << ushort(80) << false << true << "httptest" << "httptest"<<200;
}
void tst_QHttpNetworkConnection::get401()
@@ -508,9 +512,9 @@ void tst_QHttpNetworkConnection::compression_data()
QTest::addColumn<bool>("autoCompress");
QTest::addColumn<QString>("contentCoding");
- QTest::newRow("success-autogzip-temp") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfcs/rfc2616.html" << ushort(80) << false << 200 << "OK" << -1 << 418321 << true << "";
- QTest::newRow("success-nogzip-temp") << "http://" << QtNetworkSettings::serverName() << "/qtest/rfcs/rfc2616.html" << ushort(80) << false << 200 << "OK" << 418321 << 418321 << false << "identity";
- QTest::newRow("success-manualgzip-temp") << "http://" << QtNetworkSettings::serverName() << "/qtest/deflate/rfc2616.html" << ushort(80) << false << 200 << "OK" << 119124 << 119124 << false << "gzip";
+ QTest::newRow("success-autogzip-temp") << "http://" << httpServerName() << "/qtest/rfcs/rfc2616.html" << ushort(80) << false << 200 << "OK" << -1 << 418321 << true << "";
+ QTest::newRow("success-nogzip-temp") << "http://" << httpServerName() << "/qtest/rfcs/rfc2616.html" << ushort(80) << false << 200 << "OK" << 418321 << 418321 << false << "identity";
+ QTest::newRow("success-manualgzip-temp") << "http://" << httpServerName() << "/qtest/deflate/rfc2616.html" << ushort(80) << false << 200 << "OK" << 119124 << 119124 << false << "gzip";
}
@@ -586,9 +590,9 @@ void tst_QHttpNetworkConnection::ignoresslerror_data()
// fluke's certificate is signed by a non-standard authority.
// Since we don't introduce that CA into the SSL verification chain,
// connecting should fail.
- QTest::newRow("success-init") << "https://" << QtNetworkSettings::serverName() << "/" << ushort(443) << true << true << false << 200;
- QTest::newRow("success-fromSignal") << "https://" << QtNetworkSettings::serverName() << "/" << ushort(443) << true << false << true << 200;
- QTest::newRow("failure") << "https://" << QtNetworkSettings::serverName() << "/" << ushort(443) << true << false << false << 100;
+ QTest::newRow("success-init") << "https://" << httpServerName() << "/" << ushort(443) << true << true << false << 200;
+ QTest::newRow("success-fromSignal") << "https://" << httpServerName() << "/" << ushort(443) << true << false << true << 200;
+ QTest::newRow("failure") << "https://" << httpServerName() << "/" << ushort(443) << true << false << false << 100;
}
void tst_QHttpNetworkConnection::ignoresslerror()
@@ -635,7 +639,7 @@ void tst_QHttpNetworkConnection::nossl_data()
QTest::addColumn<bool>("encrypt");
QTest::addColumn<QNetworkReply::NetworkError>("networkError");
- QTest::newRow("protocol-error") << "https://" << QtNetworkSettings::serverName() << "/" << ushort(443) << true <<QNetworkReply::ProtocolUnknownError;
+ QTest::newRow("protocol-error") << "https://" << httpServerName() << "/" << ushort(443) << true <<QNetworkReply::ProtocolUnknownError;
}
void tst_QHttpNetworkConnection::nossl()
@@ -696,7 +700,7 @@ void tst_QHttpNetworkConnection::getMultiple()
QFETCH(bool, pipeliningAllowed);
QFETCH(int, requestCount);
- QHttpNetworkConnection connection(connectionCount, QtNetworkSettings::serverName());
+ QHttpNetworkConnection connection(connectionCount, httpServerName());
QList<QHttpNetworkRequest*> requests;
QList<QHttpNetworkReply*> replies;
@@ -705,7 +709,7 @@ void tst_QHttpNetworkConnection::getMultiple()
// depending on what you use the results will vary.
// for the "real" results, use a URL that has "internet latency" for you. Then (6 connections, pipelining) will win.
// for LAN latency, you will possibly get that (1 connection, no pipelining) is the fastest
- QHttpNetworkRequest *request = new QHttpNetworkRequest("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QHttpNetworkRequest *request = new QHttpNetworkRequest("http://" + httpServerName() + "/qtest/rfc3252.txt");
if (pipeliningAllowed)
request->setPipeliningAllowed(true);
requests.append(request);
@@ -723,7 +727,7 @@ void tst_QHttpNetworkConnection::getMultipleWithPipeliningAndMultiplePriorities(
quint16 requestCount = 100;
// use 2 connections.
- QHttpNetworkConnection connection(2, QtNetworkSettings::serverName());
+ QHttpNetworkConnection connection(2, httpServerName());
QList<QHttpNetworkRequest*> requests;
QList<QHttpNetworkReply*> replies;
@@ -731,9 +735,9 @@ void tst_QHttpNetworkConnection::getMultipleWithPipeliningAndMultiplePriorities(
for (int i = 0; i < requestCount; i++) {
QHttpNetworkRequest *request = 0;
if (i % 3)
- request = new QHttpNetworkRequest("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt", QHttpNetworkRequest::Get);
+ request = new QHttpNetworkRequest("http://" + httpServerName() + "/qtest/rfc3252.txt", QHttpNetworkRequest::Get);
else
- request = new QHttpNetworkRequest("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt", QHttpNetworkRequest::Head);
+ request = new QHttpNetworkRequest("http://" + httpServerName() + "/qtest/rfc3252.txt", QHttpNetworkRequest::Head);
if (i % 2 || i % 3)
request->setPipeliningAllowed(true);
@@ -800,9 +804,9 @@ void tst_QHttpNetworkConnection::getMultipleWithPriorities()
{
quint16 requestCount = 100;
// use 2 connections.
- QHttpNetworkConnection connection(2, QtNetworkSettings::serverName());
+ QHttpNetworkConnection connection(2, httpServerName());
GetMultipleWithPrioritiesReceiver receiver(requestCount);
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QUrl url("http://" + httpServerName() + "/qtest/rfc3252.txt");
QList<QHttpNetworkRequest*> requests;
QList<QHttpNetworkReply*> replies;
@@ -854,10 +858,10 @@ void tst_QHttpNetworkConnection::getEmptyWithPipelining()
{
quint16 requestCount = 50;
// use 2 connections.
- QHttpNetworkConnection connection(2, QtNetworkSettings::serverName());
+ QHttpNetworkConnection connection(2, httpServerName());
GetEmptyWithPipeliningReceiver receiver(requestCount);
- QUrl url("http://" + QtNetworkSettings::serverName() + "/cgi-bin/echo.cgi"); // a get on this = getting an empty file
+ QUrl url("http://" + httpServerName() + "/cgi-bin/echo.cgi"); // a get on this = getting an empty file
QList<QHttpNetworkRequest*> requests;
QList<QHttpNetworkReply*> replies;
@@ -901,8 +905,8 @@ void tst_QHttpNetworkConnection::getAndEverythingShouldBePipelined()
{
quint16 requestCount = 100;
// use 1 connection.
- QHttpNetworkConnection connection(1, QtNetworkSettings::serverName());
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QHttpNetworkConnection connection(1, httpServerName());
+ QUrl url("http://" + httpServerName() + "/qtest/rfc3252.txt");
QList<QHttpNetworkRequest*> requests;
QList<QHttpNetworkReply*> replies;
@@ -937,8 +941,8 @@ void tst_QHttpNetworkConnection::getAndThenDeleteObject_data()
void tst_QHttpNetworkConnection::getAndThenDeleteObject()
{
// yes, this will leak if the testcase fails. I don't care. It must not fail then :P
- QHttpNetworkConnection *connection = new QHttpNetworkConnection(QtNetworkSettings::serverName());
- QHttpNetworkRequest request("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile");
+ QHttpNetworkConnection *connection = new QHttpNetworkConnection(httpServerName());
+ QHttpNetworkRequest request("http://" + httpServerName() + "/qtest/bigfile");
QHttpNetworkReply *reply = connection->sendRequest(request);
reply->setDownstreamLimited(true);
diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
index 6c3443a735..0924b1e223 100644
--- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
+++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
@@ -60,12 +60,13 @@ private slots:
class MyCookieJar: public QNetworkCookieJar
{
public:
- inline QList<QNetworkCookie> allCookies() const
- { return QNetworkCookieJar::allCookies(); }
- inline void setAllCookies(const QList<QNetworkCookie> &cookieList)
- { QNetworkCookieJar::setAllCookies(cookieList); }
+ ~MyCookieJar() override;
+ using QNetworkCookieJar::allCookies;
+ using QNetworkCookieJar::setAllCookies;
};
+MyCookieJar::~MyCookieJar() = default;
+
void tst_QNetworkCookieJar::getterSetter()
{
MyCookieJar jar;
@@ -165,6 +166,10 @@ void tst_QNetworkCookieJar::setCookiesFromUrl_data()
// 2. anything .ck is an effective TLD ('*.ck'), but 'www.ck' is an exception
result.clear();
preset.clear();
+ cookie.setDomain(".ck");
+ QTest::newRow("effective-tld.ck-denied") << preset << cookie << "http://foo.ck" << result << false;
+ result.clear();
+ preset.clear();
cookie.setDomain(".foo.ck");
result += cookie;
QTest::newRow("effective-tld2-accepted2") << preset << cookie << "http://foo.ck" << result << true;
diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST
index 4d29a830e9..2a0651f96f 100644
--- a/tests/auto/network/access/qnetworkreply/BLACKLIST
+++ b/tests/auto/network/access/qnetworkreply/BLACKLIST
@@ -1,47 +1,128 @@
# See qtbase/src/testlib/qtestblacklist.cpp for format
-osx
[authenticationCacheAfterCancel]
-windows
-[httpAbort]
-*
+windows-7sp1
+windows-10 msvc-2015
+[backgroundRequestInterruption]
+opensuse-leap
+windows-10 msvc-2015
+b2qt
+ubuntu
+osx
[backgroundRequestInterruption:ftp, bg, nobg]
*
[getErrors:ftp-host]
linux
# QTBUG-71953
+[getFromHttp]
+* !android !winrt
[getFromHttp:success-external]
*
[getFromHttpIntoBuffer]
-windows
+osx
[getFromHttpIntoBuffer2]
-windows
+windows-10
[headFromHttp]
-windows
-[ioGetFromHttpWithSocksProxy]
-windows
+windows-10 msvc-2017
[ioPostToHttpFromSocket]
-windows
# QTBUG-66247
+windows-7sp1
+windows-10 msvc-2017
+osx
[ioHttpRedirect]
-windows
# QTBUG-66602
+windows-10
[ioHttpRedirectMultipartPost]
-*
# QTBUG-66247
+b2qt
+windows-10 msvc-2015
+ubuntu
+rhel
[ioHttpRedirectPolicy]
-*
-[ioHttpRedirectPostPut]
-linux
-windows
+opensuse-leap
+b2qt
+ubuntu
+windows-10
[putToFtp]
-windows ci
-[putToFtpWithInvalidCredentials]
-windows ci
+windows-10
[putWithServerClosingConnectionImmediately]
-windows
-[qtbug28035browserDoesNotLoadQtProjectOrgCorrectly]
-windows
-[getFromUnreachableIp]
-windows msvc-2017
-[ioHttpRedirectErrors:too-many-redirects]
-rhel-6.6 ci
+windows-7sp1
+windows-10
+osx
+[backgroundRequest]
+osx-10.12
+[connectToIPv6Address]
+osx-10.12
+[deleteFromHttp]
+osx-10.12
+[downloadProgress]
+osx-10.12
+[encrypted]
+osx-10.13
+[httpCanReadLine]
+osx-10.12
+[httpRecursiveCreation]
+osx
+[httpWithNoCredentialUsage]
+osx-10.12
+[ignoreSslErrorsList]
+osx
+[ignoreSslErrorsListWithSlot]
+osx
+[ioGetFromBuiltinHttp]
+osx
+[ioGetFromHttp]
+osx-10.12
+[ioPostToHttpFromFile]
+osx-10.13
+[ioPostToHttpFromSocketSynchronous]
+osx
+[ioPostToHttpUploadProgress]
+osx
+[ioPutToHttpFromFile]
+osx-10.13
+[lastModifiedHeaderForHttp]
+osx-10.12
+[multipartSkipIndices]
+osx-10.12
+[nestedEventLoops]
+osx
+[postToHttp]
+osx-10.12
+[postToHttpMultipart]
+osx-10.12
+[postToHttpSynchronous]
+osx-10.12
+[postToHttps]
+osx
+[postToHttpsMultipart]
+osx
+[postToHttpsSynchronous]
+osx
+[putGetDeleteGetFromHttp]
+osx-10.12
+[putToHttpSynchronous]
+osx-10.12
+[putToHttps]
+osx
+[putToHttpsSynchronous]
+osx
+[putWithRateLimiting]
+osx-10.13
+[qtbug13431replyThrottling]
+osx-10.12
+[receiveCookiesFromHttp]
+osx
+[receiveCookiesFromHttpSynchronous]
+osx
+[sendCookies]
+osx
+[sendCookiesSynchronous]
+osx
+[sendCustomRequestToHttp]
+osx-10.12
+[sslConfiguration]
+osx
+[synchronousRequest]
+osx
+[backgroundRequestConnectInBackground]
+osx
diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro
index 9d36352abc..4cc1f6431e 100644
--- a/tests/auto/network/access/qnetworkreply/test/test.pro
+++ b/tests/auto/network/access/qnetworkreply/test/test.pro
@@ -15,5 +15,5 @@ TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \
!android:!winrt: TEST_HELPER_INSTALLS = ../echo/echo
+CONFIG += unsupported/testserver
QT_TEST_SERVER_LIST = vsftpd apache2 ftp-proxy danted squid
-include($$dirname(_QMAKE_CONF_)/tests/auto/testserver.pri)
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 8627a37e12..418e1caf68 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -32,8 +32,11 @@
#include <QtCore/QDataStream>
#include <QtCore/QUrl>
#include <QtCore/QEventLoop>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QFile>
#include <QtCore/QRandomGenerator>
+#include <QtCore/QRegularExpression>
+#include <QtCore/QRegularExpressionMatch>
#include <QtCore/QSharedPointer>
#include <QtCore/QScopedPointer>
#include <QtCore/QTemporaryFile>
@@ -123,7 +126,7 @@ class tst_QNetworkReply: public QObject
if (!seedCreated) {
seedCreated = true; // not thread-safe, but who cares
}
- return QString::number(QTime(0, 0, 0).msecsTo(QTime::currentTime()))
+ return QString::number(QTime::currentTime().msecsSinceStartOfDay())
+ QLatin1Char('-') + QString::number(QCoreApplication::applicationPid())
+ QLatin1Char('-') + QString::number(QRandomGenerator::global()->generate());
}
@@ -503,6 +506,11 @@ private Q_SLOTS:
void putWithServerClosingConnectionImmediately();
#endif
+ void autoDeleteRepliesAttribute_data();
+ void autoDeleteRepliesAttribute();
+ void autoDeleteReplies_data();
+ void autoDeleteReplies();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
private:
@@ -1142,7 +1150,7 @@ protected:
}
// now write in "blocking mode", this is where the rate measuring starts
- QTime timer;
+ QElapsedTimer timer;
timer.start();
//const qint64 writtenBefore = dataIndex;
//qint64 measuredTotalBytes = wantedSize - writtenBefore;
@@ -1241,7 +1249,7 @@ protected:
}
qint64 bytesRead = 0;
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
do {
if (device->bytesAvailable() == 0) {
@@ -1552,7 +1560,7 @@ void tst_QNetworkReply::initTestCase()
QDir::setSearchPaths("testdata", QStringList() << testDataDir);
#ifndef QT_NO_SSL
- QSslSocket::defaultCaCertificates(); //preload certificates
+ QSslConfiguration::defaultConfiguration().caCertificates(); //preload certificates
#endif
#ifndef QT_NO_BEARERMANAGEMENT
netConfMan = new QNetworkConfigurationManager(this);
@@ -4142,10 +4150,10 @@ void tst_QNetworkReply::ioGetFromHttpWithCache()
request.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false);
QFETCH(QStringList, extraHttpHeaders);
- QStringListIterator it(extraHttpHeaders);
- while (it.hasNext()) {
- QString header = it.next();
- QString value = it.next();
+ QVERIFY(extraHttpHeaders.size() % 2 == 0);
+ for (auto it = extraHttpHeaders.cbegin(), end = extraHttpHeaders.cend(); it != end; /*double-stepping*/) {
+ QString header = *it++;
+ QString value = *it++;
request.setRawHeader(header.toLatin1(), value.toLatin1()); // To latin1? Deal with it!
}
@@ -5143,8 +5151,8 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp()
const int rate = 200; // in kB per sec
RateControlledReader reader(server, reply.data(), rate, bufferSize);
- QTime loopTime;
- loopTime.start();
+ QElapsedTimer loopTimer;
+ loopTimer.start();
const int result = waitForFinish(reply);
if (notEnoughDataForFastSender) {
@@ -5154,7 +5162,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp()
QVERIFY2(result == Success, msgWaitForFinished(reply));
- const int elapsedTime = loopTime.elapsed();
+ const int elapsedTime = loopTimer.elapsed();
server.wait();
reader.wrapUp();
@@ -5440,12 +5448,12 @@ void tst_QNetworkReply::rateControl()
RateControlledReader reader(sender, reply.data(), rate, 20);
// this test is designed to run for 25 seconds at most
- QTime loopTime;
- loopTime.start();
+ QElapsedTimer loopTimer;
+ loopTimer.start();
QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
- int elapsedTime = loopTime.elapsed();
+ int elapsedTime = loopTimer.elapsed();
if (!errorSpy.isEmpty()) {
qDebug() << "ERROR!" << errorSpy[0][0] << reply->errorString();
@@ -6115,8 +6123,8 @@ void tst_QNetworkReply::httpConnectionCount()
}
int pendingConnectionCount = 0;
- QTime time;
- time.start();
+ QElapsedTimer timer;
+ timer.start();
while(pendingConnectionCount <= 20) {
QTestEventLoop::instance().enterLoop(1);
@@ -6128,7 +6136,7 @@ void tst_QNetworkReply::httpConnectionCount()
}
// at max. wait 10 sec
- if (time.elapsed() > 10000)
+ if (timer.elapsed() > 10000)
break;
}
@@ -6418,7 +6426,8 @@ void tst_QNetworkReply::abortOnEncrypted()
QSKIP("Server fails to listen. Skipping since QTcpServer is covered in another test.");
server.connect(&server, &SslServer::newEncryptedConnection, [&server]() {
- connect(server.socket, &QTcpSocket::readyRead, server.socket, []() {
+ // MSVC 201X C4573-misunderstands connect() or QObject::connect(), so use server.connect():
+ server.connect(server.socket, &QTcpSocket::readyRead, server.socket, []() {
// This slot must not be invoked!
QVERIFY(false);
});
@@ -6466,8 +6475,8 @@ void tst_QNetworkReply::sslSessionSharing_data()
void tst_QNetworkReply::sslSessionSharing()
{
-#ifdef QT_SECURETRANSPORT
- QSKIP("Not implemented with SecureTransport");
+#if QT_CONFIG(schannel) || defined(QT_SECURETRANSPORT)
+ QSKIP("Not implemented with SecureTransport/Schannel");
#endif
QString urlString("https://" + QtNetworkSettings::httpServerName());
@@ -6534,8 +6543,8 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession_data()
void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
{
-#ifdef QT_SECURETRANSPORT
- QSKIP("Not implemented with SecureTransport");
+#if QT_CONFIG(schannel) || defined(QT_SECURETRANSPORT)
+ QSKIP("Not implemented with SecureTransport/Schannel");
#endif
QString urlString("https://" + QtNetworkSettings::httpServerName());
@@ -7905,9 +7914,10 @@ void tst_QNetworkReply::synchronousAuthenticationCache()
"Content-Type: text/plain\r\n"
"\r\n"
"auth";
- QRegExp rx("Authorization: Basic ([^\r\n]*)\r\n");
- if (rx.indexIn(receivedData) > 0) {
- if (QByteArray::fromBase64(rx.cap(1).toLatin1()) == "login:password") {
+ QRegularExpression rx("Authorization: Basic ([^\r\n]*)\r\n");
+ QRegularExpressionMatch match = rx.match(receivedData);
+ if (match.hasMatch()) {
+ if (QByteArray::fromBase64(match.captured(1).toLatin1()) == "login:password") {
dataToTransmit =
"HTTP/1.0 200 OK\r\n"
"Content-Type: text/plain\r\n"
@@ -8143,16 +8153,17 @@ void tst_QNetworkReply::backgroundRequest()
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
- const QWeakPointer<const QNetworkSession> session = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
- QVERIFY(session);
- QNetworkSession::UsagePolicies original = session.data()->usagePolicies();
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), QNetworkSession::UsagePolicies(policy));
+ const QWeakPointer<const QNetworkSession> sessionWeakPtr = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
+ QVERIFY(!sessionWeakPtr.isNull());
+ auto session = const_cast<QNetworkSession *>(sessionWeakPtr.toStrongRef().data());
+ QNetworkSession::UsagePolicies original = session->usagePolicies();
+ QNetworkSessionPrivate::setUsagePolicies(*session, QNetworkSession::UsagePolicies(policy));
QNetworkReplyPtr reply(manager.get(request));
QVERIFY(waitForFinish(reply) != Timeout);
if (session)
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), original);
+ QNetworkSessionPrivate::setUsagePolicies(*session, original);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), error);
@@ -8190,6 +8201,9 @@ void tst_QNetworkReply::backgroundRequestInterruption_data()
void tst_QNetworkReply::backgroundRequestInterruption()
{
#ifndef QT_NO_BEARERMANAGEMENT
+ if (QNetworkStatusMonitor::isEnabled() && QByteArray(QTest::currentDataTag()).startsWith("http"))
+ QSKIP("This test (currently) doesn't make any sense when QNetworkStatusMonitor is enabled");
+
QFETCH(QUrl, url);
QFETCH(bool, background);
QFETCH(QNetworkReply::NetworkError, error);
@@ -8207,10 +8221,11 @@ void tst_QNetworkReply::backgroundRequestInterruption()
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
- const QWeakPointer<const QNetworkSession> session = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
- QVERIFY(session);
- QNetworkSession::UsagePolicies original = session.data()->usagePolicies();
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), QNetworkSession::NoPolicy);
+ const QWeakPointer<const QNetworkSession> sessionWeakPtr = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
+ QVERIFY(!sessionWeakPtr.isNull());
+ auto session = const_cast<QNetworkSession *>(sessionWeakPtr.toStrongRef().data());
+ QNetworkSession::UsagePolicies original = session->usagePolicies();
+ QNetworkSessionPrivate::setUsagePolicies(*session, QNetworkSession::NoPolicy);
request.setAttribute(QNetworkRequest::MaximumDownloadBufferSizeAttribute, 8192);
QNetworkReplyPtr reply(manager.get(request));
@@ -8219,14 +8234,14 @@ void tst_QNetworkReply::backgroundRequestInterruption()
QSignalSpy spy(reply.data(), SIGNAL(readyRead()));
QTRY_VERIFY(spy.count() > 0);
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), QNetworkSession::NoBackgroundTrafficPolicy);
+ QNetworkSessionPrivate::setUsagePolicies(*session, QNetworkSession::NoBackgroundTrafficPolicy);
// After we have changed the policy we can download at full speed.
reply->setReadBufferSize(0);
QVERIFY(waitForFinish(reply) != Timeout);
if (session)
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), original);
+ QNetworkSessionPrivate::setUsagePolicies(*session, original);
QVERIFY(reply->isFinished());
QCOMPARE(reply->error(), error);
@@ -8266,8 +8281,8 @@ void tst_QNetworkReply::backgroundRequestConnectInBackground()
QWeakPointer<const QNetworkSession> session = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
//force QNAM to reopen the session.
- if (session && session.data()->isOpen()) {
- const_cast<QNetworkSession *>(session.data())->close();
+ if (session && session.toStrongRef().data()->isOpen()) {
+ const_cast<QNetworkSession *>(session.toStrongRef().data())->close();
QCoreApplication::processEvents(); //let signals propagate inside QNAM
}
@@ -8276,19 +8291,19 @@ void tst_QNetworkReply::backgroundRequestConnectInBackground()
session = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
QVERIFY(session);
- QNetworkSession::UsagePolicies original = session.data()->usagePolicies();
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), QNetworkSession::NoPolicy);
+ QNetworkSession::UsagePolicies original = session.toStrongRef().data()->usagePolicies();
+ QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.toStrongRef().data()), QNetworkSession::NoPolicy);
QNetworkReplyPtr reply(manager.get(request));
QVERIFY(waitForFinish(reply) != Timeout);
session = QNetworkAccessManagerPrivate::getNetworkSession(&manager);
if (session) {
- QVariant cib = session.data()->sessionProperty(QStringLiteral("ConnectInBackground"));
+ QVariant cib = session.toStrongRef().data()->sessionProperty(QStringLiteral("ConnectInBackground"));
if (!cib.isValid())
QSKIP("inconclusive - ConnectInBackground session property not supported by the bearer plugin");
QCOMPARE(cib.toBool(), background);
- QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.data()), original);
+ QNetworkSessionPrivate::setUsagePolicies(*const_cast<QNetworkSession *>(session.toStrongRef().data()), original);
} else {
QSKIP("inconclusive - network session has been destroyed");
}
@@ -9167,6 +9182,166 @@ void tst_QNetworkReply::putWithServerClosingConnectionImmediately()
#endif
+void tst_QNetworkReply::autoDeleteRepliesAttribute_data()
+{
+ QTest::addColumn<QUrl>("destination");
+
+ QTest::newRow("http") << QUrl("http://QInvalidDomain.qt/test");
+ QTest::newRow("https") << QUrl("https://QInvalidDomain.qt/test");
+ QTest::newRow("ftp") << QUrl("ftp://QInvalidDomain.qt/test");
+ QTest::newRow("file") << QUrl("file:///thisfolderdoesn'texist/probably.txt");
+#ifdef Q_OS_WIN
+ // Only supported on windows.
+ QTest::newRow("remote-file") << QUrl("file://QInvalidHost/thisfolderdoesn'texist/probably.txt");
+#endif
+ QTest::newRow("qrc") << QUrl("qrc:///path/to/nowhere");
+ QTest::newRow("data") << QUrl("data:,Some%20plaintext%20data");
+}
+
+void tst_QNetworkReply::autoDeleteRepliesAttribute()
+{
+ QFETCH(QUrl, destination);
+ {
+ // Get
+ QNetworkRequest request(destination);
+ request.setAttribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute, true);
+ QNetworkReply *reply = manager.get(request);
+ QSignalSpy finishedSpy(reply, &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply, &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QVERIFY(destroyedSpy.wait());
+ }
+ {
+ // Post
+ QNetworkRequest request(destination);
+ request.setAttribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute, true);
+ QNetworkReply *reply = manager.post(request, QByteArrayLiteral("datastring"));
+ QSignalSpy finishedSpy(reply, &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply, &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QVERIFY(destroyedSpy.wait());
+ }
+ // Now repeated, but without the attribute to make sure it does not get deleted automatically.
+ // We need two calls to processEvents to test that the QNetworkReply doesn't get deleted.
+ // The first call executes a metacall event which adds the deleteLater meta event which
+ // would be executed in the second call. But that shouldn't happen without the attribute.
+ {
+ // Get
+ QNetworkRequest request(destination);
+ QScopedPointer<QNetworkReply> reply(manager.get(request));
+ QSignalSpy finishedSpy(reply.data(), &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply.data(), &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
+ QCOMPARE(destroyedSpy.count(), 0);
+ }
+ {
+ // Post
+ QNetworkRequest request(destination);
+ QScopedPointer<QNetworkReply> reply(manager.post(request, QByteArrayLiteral("datastring")));
+ QSignalSpy finishedSpy(reply.data(), &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply.data(), &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
+ QCOMPARE(destroyedSpy.count(), 0);
+ }
+}
+
+void tst_QNetworkReply::autoDeleteReplies_data()
+{
+ autoDeleteRepliesAttribute_data();
+}
+
+void tst_QNetworkReply::autoDeleteReplies()
+{
+ QFETCH(QUrl, destination);
+ manager.setAutoDeleteReplies(true);
+ auto cleanup = qScopeGuard([this] { manager.setAutoDeleteReplies(false); });
+ {
+ // Get
+ QNetworkRequest request(destination);
+ QNetworkReply *reply = manager.get(request);
+ QSignalSpy finishedSpy(reply, &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply, &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QVERIFY(destroyedSpy.wait());
+ }
+ {
+ // Post
+ QNetworkRequest request(destination);
+ QNetworkReply *reply = manager.post(request, QByteArrayLiteral("datastring"));
+ QSignalSpy finishedSpy(reply, &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply, &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QVERIFY(destroyedSpy.wait());
+ }
+ // Here we repeat the test, but override the auto-deletion in the QNetworkRequest
+ // We need two calls to processEvents to test that the QNetworkReply doesn't get deleted.
+ // The first call executes a metacall event which adds the deleteLater meta event which
+ // would be executed in the second call. But that shouldn't happen in this case.
+ {
+ // Get
+ QNetworkRequest request(destination);
+ request.setAttribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute, false);
+ QScopedPointer<QNetworkReply> reply(manager.get(request));
+ QSignalSpy finishedSpy(reply.data(), &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply.data(), &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
+ QCOMPARE(destroyedSpy.count(), 0);
+ }
+ {
+ // Post
+ QNetworkRequest request(destination);
+ request.setAttribute(QNetworkRequest::AutoDeleteReplyOnFinishAttribute, false);
+ QScopedPointer<QNetworkReply> reply(manager.post(request, QByteArrayLiteral("datastring")));
+ QSignalSpy finishedSpy(reply.data(), &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply.data(), &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
+ QCOMPARE(destroyedSpy.count(), 0);
+ }
+ // Now we repeat the test with autoDeleteReplies set to false
+ cleanup.dismiss();
+ manager.setAutoDeleteReplies(false);
+ {
+ // Get
+ QNetworkRequest request(destination);
+ QScopedPointer<QNetworkReply> reply(manager.get(request));
+ QSignalSpy finishedSpy(reply.data(), &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply.data(), &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
+ QCOMPARE(destroyedSpy.count(), 0);
+ }
+ {
+ // Post
+ QNetworkRequest request(destination);
+ QScopedPointer<QNetworkReply> reply(manager.post(request, QByteArrayLiteral("datastring")));
+ QSignalSpy finishedSpy(reply.data(), &QNetworkReply::finished);
+ QSignalSpy destroyedSpy(reply.data(), &QObject::destroyed);
+ QVERIFY(finishedSpy.wait());
+ QCOMPARE(destroyedSpy.count(), 0);
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
+ QCOMPARE(destroyedSpy.count(), 0);
+ }
+}
+
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
{
diff --git a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
index 7a3def410a..6637be0174 100644
--- a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
+++ b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
@@ -41,6 +41,7 @@ class tst_QNetworkRequest: public QObject
private slots:
void ctor_data();
void ctor();
+ void implicitDefaultCtor();
void setUrl_data();
void setUrl();
void setRawHeader_data();
@@ -78,6 +79,12 @@ void tst_QNetworkRequest::ctor()
}
}
+void tst_QNetworkRequest::implicitDefaultCtor()
+{
+ QNetworkRequest r = {};
+ Q_UNUSED(r);
+}
+
void tst_QNetworkRequest::setUrl_data()
{
ctor_data();
diff --git a/tests/auto/network/access/spdy/BLACKLIST b/tests/auto/network/access/spdy/BLACKLIST
index b13eae1000..5cf79327be 100644
--- a/tests/auto/network/access/spdy/BLACKLIST
+++ b/tests/auto/network/access/spdy/BLACKLIST
@@ -1,4 +1,7 @@
[download]
-linux
+opensuse-leap
[upload]
-linux
+opensuse-leap
+ubuntu-18.04
+b2qt
+
diff --git a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
index 55053842dc..8cef351554 100644
--- a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
+++ b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
@@ -93,7 +93,7 @@ void tst_QAuthenticator::basicAuth()
QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
- QCOMPARE(priv->calculateResponse("GET", "/").constData(), QByteArray("Basic " + expectedReply).constData());
+ QCOMPARE(priv->calculateResponse("GET", "/", "").constData(), QByteArray("Basic " + expectedReply).constData());
}
void tst_QAuthenticator::ntlmAuth_data()
@@ -133,9 +133,9 @@ void tst_QAuthenticator::ntlmAuth()
headers << qMakePair<QByteArray, QByteArray>("WWW-Authenticate", "NTLM");
priv->parseHttpResponse(headers, /*isProxy = */ false);
if (sso)
- QVERIFY(priv->calculateResponse("GET", "/").startsWith("NTLM "));
+ QVERIFY(priv->calculateResponse("GET", "/", "").startsWith("NTLM "));
else
- QCOMPARE(priv->calculateResponse("GET", "/").constData(), "NTLM TlRMTVNTUAABAAAABYIIAAAAAAAAAAAAAAAAAAAAAAA=");
+ QCOMPARE(priv->calculateResponse("GET", "/", "").constData(), "NTLM TlRMTVNTUAABAAAABYIIAAAAAAAAAAAAAAAAAAAAAAA=");
// NTLM phase 2: challenge
headers.clear();
@@ -146,7 +146,7 @@ void tst_QAuthenticator::ntlmAuth()
QEXPECT_FAIL("with-realm-sso", "NTLM authentication code doesn't extract the realm", Continue);
QCOMPARE(auth.realm(), realm);
- QVERIFY(priv->calculateResponse("GET", "/").startsWith("NTLM "));
+ QVERIFY(priv->calculateResponse("GET", "/", "").startsWith("NTLM "));
}
void tst_QAuthenticator::equalityOperators()
diff --git a/tests/auto/network/kernel/qdnslookup/BLACKLIST b/tests/auto/network/kernel/qdnslookup/BLACKLIST
index edf6436384..f07a8ce9a3 100644
--- a/tests/auto/network/kernel/qdnslookup/BLACKLIST
+++ b/tests/auto/network/kernel/qdnslookup/BLACKLIST
@@ -1,2 +1,2 @@
[lookup]
-ci
+*
diff --git a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro
index b5d6ea6459..d170d879e6 100644
--- a/tests/auto/network/kernel/qhostaddress/qhostaddress.pro
+++ b/tests/auto/network/kernel/qhostaddress/qhostaddress.pro
@@ -4,4 +4,4 @@ SOURCES += tst_qhostaddress.cpp
QT = core network-private testlib
-win32:LIBS += -lws2_32
+win32: QMAKE_USE += ws2_32
diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
index 224e4d61a9..48f05a4604 100644
--- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
@@ -375,11 +375,14 @@ QT_WARNING_DISABLE_DEPRECATED
void tst_QHostAddress::assignment()
{
QHostAddress address;
+
+#if QT_DEPRECATED_SINCE(5, 8)
address = "127.0.0.1";
QCOMPARE(address, QHostAddress("127.0.0.1"));
address = "::1";
QCOMPARE(address, QHostAddress("::1"));
+#endif
// WinRT does not support sockaddr_in
#ifndef Q_OS_WINRT
diff --git a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
index 3d8457dd46..d358cdf52c 100644
--- a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
@@ -6,6 +6,6 @@ SOURCES += tst_qhostinfo.cpp
requires(qtConfig(private_tests))
QT = core-private network-private testlib
-win32:LIBS += -lws2_32
+win32: QMAKE_USE += ws2_32
winrt: WINRT_MANIFEST.capabilities += internetClientServer
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index 7640d52583..a603b2d879 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -180,7 +180,6 @@ void tst_QHostInfo::staticInformation()
void tst_QHostInfo::initTestCase()
{
- QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
#ifndef QT_NO_BEARERMANAGEMENT
//start the default network
netConfMan = new QNetworkConfigurationManager(this);
@@ -241,8 +240,6 @@ void tst_QHostInfo::lookupIPv4_data()
QTest::addColumn<QString>("addresses");
QTest::addColumn<int>("err");
- // Test server lookup
- QTest::newRow("lookup_01") << QtNetworkSettings::serverName() << QtNetworkSettings::serverIP().toString() << int(QHostInfo::NoError);
QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound);
QTest::newRow("single_ip4") << "a-single" TEST_DOMAIN << "192.0.2.1" << int(QHostInfo::NoError);
diff --git a/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp b/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp
index 5eedd1043b..cd6019090f 100644
--- a/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp
+++ b/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp
@@ -131,7 +131,7 @@ void tst_QNetworkDatagram::makeReply()
QNetworkDatagram copy = dgram;
copy.setData(copy.data());
{
- QNetworkDatagram reply = qMove(copy).makeReply("World");
+ QNetworkDatagram reply = std::move(copy).makeReply("World");
QCOMPARE(reply.data(), QByteArray("World"));
QCOMPARE(reply.senderAddress(), QHostAddress(localAddress));
QCOMPARE(reply.senderPort(), localAddress.isEmpty() ? -1 : dgram.destinationPort());
diff --git a/tests/auto/network/socket/platformsocketengine/BLACKLIST b/tests/auto/network/socket/platformsocketengine/BLACKLIST
index 8e1a55995e..f1f88d26d1 100644
--- a/tests/auto/network/socket/platformsocketengine/BLACKLIST
+++ b/tests/auto/network/socket/platformsocketengine/BLACKLIST
@@ -1 +1,11 @@
+[tcpLoopbackPerformance]
+windows-10 msvc-2015
+windows-7sp1
+[receiveUrgentData]
+windows-10 msvc-2015
+windows-7sp1
+[serverTest]
+windows-10 msvc-2015
+windows-7sp1
+[tcpLoopbackPerformance]
windows
diff --git a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
index 46c722deba..868439de6a 100644
--- a/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
+++ b/tests/auto/network/socket/platformsocketengine/platformsocketengine.pri
@@ -4,7 +4,7 @@ QNETWORK_SRC = $$QT_SOURCE_TREE/src/network
INCLUDEPATH += $$QNETWORK_SRC
-win32:LIBS += -lws2_32
+win32: QMAKE_USE += ws2_32
unix:qtConfig(reduce_exports) {
SOURCES += $$QNETWORK_SRC/socket/qnativesocketengine_unix.cpp
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index 01168cc0d6..ffc63ee46a 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -32,7 +32,7 @@
#include <qcoreapplication.h>
#include <qdatastream.h>
#include <qhostaddress.h>
-#include <qdatetime.h>
+#include <qelapsedtimer.h>
#ifdef Q_OS_UNIX
#include <unistd.h>
@@ -403,7 +403,7 @@ void tst_PlatformSocketEngine::udpLoopbackPerformance()
QHostAddress localhost = QHostAddress::LocalHost;
qlonglong readBytes = 0;
- QTime timer;
+ QElapsedTimer timer;
timer.start();
while (timer.elapsed() < 5000) {
udpSocket2.write(message1.data(), message1.size());
@@ -462,7 +462,7 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
QByteArray message1(messageSize, '@');
QByteArray answer(messageSize, '@');
- QTime timer;
+ QElapsedTimer timer;
timer.start();
qlonglong readBytes = 0;
while (timer.elapsed() < 5000) {
diff --git a/tests/auto/network/socket/qhttpsocketengine/BLACKLIST b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
index 8e1a55995e..ceb3b7862e 100644
--- a/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
+++ b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
@@ -1 +1,5 @@
+[downloadBigFile]
+windows-10 msvc-2015
+windows-7sp1
+[ensureEofTriggersNotification]
windows
diff --git a/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro b/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro
index 56a4fb8aee..63f41f4eb7 100644
--- a/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro
+++ b/tests/auto/network/socket/qhttpsocketengine/qhttpsocketengine.pro
@@ -10,3 +10,8 @@ MOC_DIR=tmp
requires(qtConfig(private_tests))
QT = core-private network-private testlib
+# TODO: For now linux-only, because cyrus is linux-only atm ...
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = squid danted cyrus apache2
+}
diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 68f3ea059b..64241014d7 100644
--- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -38,6 +38,7 @@
#include <qhostaddress.h>
#include <qtcpsocket.h>
#include <qdebug.h>
+#include <qelapsedtimer.h>
#include <qtcpserver.h>
#include "../../../network-settings.h"
@@ -122,7 +123,14 @@ public slots:
void tst_QHttpSocketEngine::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif
}
void tst_QHttpSocketEngine::init()
@@ -171,7 +179,7 @@ void tst_QHttpSocketEngine::errorTest_data()
QTest::newRow("proxy-host-not-found") << "this-host-does-not-exist." << 1080 << QString()
<< QString()
<< int(QAbstractSocket::ProxyNotFoundError);
- QTest::newRow("proxy-connection-refused") << QtNetworkSettings::serverName() << 2 << QString()
+ QTest::newRow("proxy-connection-refused") << QtNetworkSettings::socksProxyServerName() << 2 << QString()
<< QString()
<< int(QAbstractSocket::ProxyConnectionRefusedError);
@@ -278,13 +286,12 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
-
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
- QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::imapServerIp());
QVERIFY(!socketDevice.localAddress().isNull());
QVERIFY(socketDevice.localPort() > 0);
@@ -292,10 +299,10 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
// Read the greeting
- qint64 available = socketDevice.bytesAvailable();
+ qint64 available = int(socketDevice.bytesAvailable());
QVERIFY(available > 0);
QByteArray array;
- array.resize(available);
+ array.resize(int(available));
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
// Check that the greeting is what we expect it to be
@@ -310,9 +317,9 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
// Wait for the response
QVERIFY(socketDevice.waitForRead());
- available = socketDevice.bytesAvailable();
+ available = int(socketDevice.bytesAvailable());
QVERIFY(available > 0);
- array.resize(available);
+ array.resize(int(available));
QVERIFY(socketDevice.read(array.data(), array.size()) == available);
// Check that the greeting is what we expect it to be
@@ -321,7 +328,7 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
// Wait for the response
QVERIFY(socketDevice.waitForRead());
char c;
- QCOMPARE(socketDevice.read(&c, sizeof(c)), (qint64) -1);
+ QCOMPARE(socketDevice.read(&c, sizeof(c)), qint64(-1));
QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
@@ -335,10 +342,10 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3128));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088));
+ QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::socksProxyServerName()), 8088));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(30000)) {
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState ||
@@ -391,7 +398,7 @@ void tst_QHttpSocketEngine::tcpLoopbackPerformance()
QByteArray message1(messageSize, '@');
QByteArray answer(messageSize, '@');
- QTime timer;
+ QElapsedTimer timer;
timer.start();
qlonglong readBytes = 0;
while (timer.elapsed() < 30000) {
@@ -422,7 +429,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest()
QTcpSocket socket;
// Connect
- socket.connectToHost(QtNetworkSettings::serverName(), 143);
+ socket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket.waitForConnected());
QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
@@ -479,7 +486,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
tcpSocketNonBlocking_socket = &socket;
// Connect
- socket.connectToHost(QtNetworkSettings::serverName(), 143);
+ socket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket.state() == QTcpSocket::HostLookupState ||
socket.state() == QTcpSocket::ConnectingState);
@@ -607,13 +614,13 @@ void tst_QHttpSocketEngine::downloadBigFile()
connect(tmpSocket, SIGNAL(connected()), SLOT(exitLoopSlot()));
connect(tmpSocket, SIGNAL(readyRead()), SLOT(downloadBigFileSlot()));
- tmpSocket->connectToHost(QtNetworkSettings::serverName(), 80);
+ tmpSocket->connectToHost(QtNetworkSettings::httpServerName(), 80);
QTestEventLoop::instance().enterLoop(30);
if (QTestEventLoop::instance().timeout())
QFAIL("Network operation timed out");
- QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
+ QByteArray hostName = QtNetworkSettings::httpServerName().toLatin1();
QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("Host: ") > 0);
@@ -623,7 +630,7 @@ void tst_QHttpSocketEngine::downloadBigFile()
bytesAvailable = 0;
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
QTestEventLoop::instance().enterLoop(60);
@@ -664,13 +671,13 @@ void tst_QHttpSocketEngine::passwordAuth()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password"));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3128, "qsockstest", "password"));
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
- QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::imapServerIp());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 45ab275510..732f7eef00 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -32,6 +32,7 @@
#include <qtextstream.h>
#include <qdatastream.h>
+#include <qelapsedtimer.h>
#include <QtNetwork/qlocalsocket.h>
#include <QtNetwork/qlocalserver.h>
@@ -552,7 +553,7 @@ void tst_QLocalSocket::sendData()
QCOMPARE(serverSocket->state(), QLocalSocket::ConnectedState);
QTextStream out(serverSocket);
QTextStream in(&socket);
- out << testLine << endl;
+ out << testLine << Qt::endl;
bool wrote = serverSocket->waitForBytesWritten(3000);
if (!socket.canReadLine()) {
@@ -877,7 +878,7 @@ public:
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
QTextStream out(serverSocket);
- out << testLine << endl;
+ out << testLine << Qt::endl;
QCOMPARE(serverSocket->state(), QLocalSocket::ConnectedState);
QVERIFY2(serverSocket->waitForBytesWritten(), serverSocket->errorString().toLatin1().constData());
QCOMPARE(serverSocket->errorString(), QString("Unknown error"));
@@ -1031,7 +1032,7 @@ void tst_QLocalSocket::waitForDisconnect()
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
socket.disconnectFromServer();
- QTime timer;
+ QElapsedTimer timer;
timer.start();
QVERIFY(serverSocket->waitForDisconnected(3000));
QVERIFY(timer.elapsed() < 2000);
diff --git a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
index 60526827bf..61fff6ee00 100644
--- a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
+++ b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
@@ -1,8 +1,11 @@
[udpTest]
*
[passwordAuth]
-*
-[serverTest]
-windows
+ubuntu-18.04
+# QTBUG-74162
+[passwordAuth2]
+ubuntu
[downloadBigFile]
-windows
+windows-10 msvc-2015
+windows-7sp1
+
diff --git a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
index 71ceafa133..243eab9480 100644
--- a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
+++ b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
@@ -11,3 +11,9 @@ MOC_DIR=tmp
QT = core-private network-private testlib
requires(qtConfig(private_tests))
+
+# Only on Linux until cyrus has been added to docker-compose-for-{windows,macOS}.yml and tested
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = danted apache2 cyrus
+}
diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
index 1212ea20e5..464054f8a6 100644
--- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -137,7 +137,13 @@ private slots:
void tst_QSocks5SocketEngine::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif
}
//---------------------------------------------------------------------------
@@ -293,13 +299,13 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080));
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
- QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::imapServerIp());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -347,10 +353,10 @@ void tst_QSocks5SocketEngine::simpleErrorsAndStates()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- QVERIFY(!socketDevice.connectToHost(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first(), 8088));
+ QVERIFY(!socketDevice.connectToHost(QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses().first(), 8088));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(15000)) {
QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState ||
@@ -433,7 +439,7 @@ void tst_QSocks5SocketEngine::serverTest()
// Initialize a Tcp socket
QVERIFY(server.initialize(QAbstractSocket::TcpSocket));
- QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080);
+ QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080);
server.setProxy(proxy);
@@ -510,7 +516,7 @@ void tst_QSocks5SocketEngine::udpTest()
QVERIFY(udpSocket.initialize(QAbstractSocket::UdpSocket));
QVERIFY(udpSocket.isValid());
- QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080);
+ QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080);
udpSocket.setProxy(proxy);
@@ -564,7 +570,7 @@ void tst_QSocks5SocketEngine::tcpSocketBlockingTest()
QTcpSocket socket;
// Connect
- socket.connectToHost(QtNetworkSettings::serverName(), 143);
+ socket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket.waitForConnected());
QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
@@ -635,7 +641,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
});
// Connect
- socket.connectToHost(QtNetworkSettings::serverName(), 143);
+ socket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket.state() == QTcpSocket::HostLookupState ||
socket.state() == QTcpSocket::ConnectingState);
@@ -754,13 +760,13 @@ void tst_QSocks5SocketEngine::downloadBigFile()
<< " (" << stopWatch.elapsed() << "ms)";
});
- socket.connectToHost(QtNetworkSettings::serverName(), 80);
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 80);
QTestEventLoop::instance().enterLoop(30);
if (QTestEventLoop::instance().timeout())
QFAIL("Network operation timed out");
- QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
+ QByteArray hostName = QtNetworkSettings::httpServerName().toLatin1();
QCOMPARE(socket.state(), QAbstractSocket::ConnectedState);
QVERIFY(socket.write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(socket.write("HOST: ") > 0);
@@ -791,13 +797,13 @@ void tst_QSocks5SocketEngine::passwordAuth()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080, "qsockstest", "password"));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080, "qsockstest", "password"));
// Connect to imap.trolltech.com's IP
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- if (!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)) {
+ if (!socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143)) {
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
}
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
@@ -857,19 +863,19 @@ void tst_QSocks5SocketEngine::passwordAuth2()
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
- socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081));
+ socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081));
socketDevice.setReceiver(this);
- QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
+ QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143));
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
while (socketDevice.state() == QAbstractSocket::ConnectingState) {
QVERIFY(socketDevice.waitForWrite());
- socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
+ socketDevice.connectToHost(QtNetworkSettings::imapServerIp(), 143);
}
if (socketDevice.state() != QAbstractSocket::ConnectedState)
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
- QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::imapServerIp());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
diff --git a/tests/auto/network/socket/qtcpserver/BLACKLIST b/tests/auto/network/socket/qtcpserver/BLACKLIST
index f8b61808cc..e268468bdb 100644
--- a/tests/auto/network/socket/qtcpserver/BLACKLIST
+++ b/tests/auto/network/socket/qtcpserver/BLACKLIST
@@ -1,13 +1,16 @@
-windows
-[linkLocal]
-linux
[listenWhileListening:WithSocks5Proxy]
linux
windows
+[ipv6Server]
+windows-7sp1
+windows-10 msvc-2017
[ipv6Server:WithoutProxy]
windows
osx
-[clientServerLoop:WithSocks5Proxy]
-linux
-[crashTests:WithSocks5Proxy]
-linux
+[eagainBlockingAccept]
+windows-7sp1
+windows-10
+[serverAddress]
+windows-7sp1
+windows-10
+
diff --git a/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp b/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp
index 1a8e7920d3..5c66ef6520 100644
--- a/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp
+++ b/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp
@@ -29,14 +29,14 @@
#include <QtCore>
#include <QtNetwork>
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) && defined(Q_CC_MSVC)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && defined(Q_CC_MSVC)
# include <crtdbg.h>
#endif
int main(int argc, char *argv[])
{
// Windows: Suppress crash notification dialog.
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) && defined(Q_CC_MSVC)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) && defined(Q_CC_MSVC)
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG);
#endif
QCoreApplication app(argc, argv);
diff --git a/tests/auto/network/socket/qtcpserver/test/test.pro b/tests/auto/network/socket/qtcpserver/test/test.pro
index 4491523383..7e2e60a1e3 100644
--- a/tests/auto/network/socket/qtcpserver/test/test.pro
+++ b/tests/auto/network/socket/qtcpserver/test/test.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
SOURCES += ../tst_qtcpserver.cpp
-win32:LIBS += -lws2_32
+win32: QMAKE_USE += ws2_32
TARGET = ../tst_qtcpserver
@@ -16,3 +16,9 @@ win32 {
QT = core network testlib
MOC_DIR=tmp
+
+# Only on Linux until cyrus has been added to docker-compose-for-{windows,macOS}.yml and tested
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = danted cyrus squid ftp-proxy
+}
diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
index 161d94d642..849d8b0ed1 100644
--- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -160,8 +160,15 @@ void tst_QTcpServer::initTestCase_data()
void tst_QTcpServer::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpProxyServerName(), 2121));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143));
+#else
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
+#endif
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager man;
networkSession = new QNetworkSession(man.defaultConfiguration(), this);
@@ -177,7 +184,7 @@ void tst_QTcpServer::init()
#ifndef QT_NO_NETWORKPROXY
QFETCH_GLOBAL(int, proxyType);
if (proxyType == QNetworkProxy::Socks5Proxy) {
- QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
+ QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080));
}
#else // !QT_NO_NETWORKPROXY
QSKIP("No proxy support");
@@ -513,7 +520,7 @@ void tst_QTcpServer::waitForConnectionTest()
}
QTcpSocket findLocalIpSocket;
- findLocalIpSocket.connectToHost(QtNetworkSettings::serverName(), 143);
+ findLocalIpSocket.connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(findLocalIpSocket.waitForConnected(5000));
QTcpServer server;
@@ -668,16 +675,18 @@ void tst_QTcpServer::invalidProxy_data()
QTest::addColumn<int>("port");
QTest::addColumn<int>("expectedError");
- QString fluke = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
- QTest::newRow("ftp-proxy") << int(QNetworkProxy::FtpCachingProxy) << fluke << 143
+ const QString imapIp = QtNetworkSettings::imapServerIp().toString();
+ const QString httpProxyIp = QtNetworkSettings::httpProxyServerIp().toString();
+ const QString socksIp = QtNetworkSettings::socksProxyServerIp().toString();
+ QTest::newRow("ftp-proxy") << int(QNetworkProxy::FtpCachingProxy) << imapIp << 143
<< int(QAbstractSocket::UnsupportedSocketOperationError);
- QTest::newRow("http-proxy") << int(QNetworkProxy::HttpProxy) << fluke << 3128
+ QTest::newRow("http-proxy") << int(QNetworkProxy::HttpProxy) << httpProxyIp << 3128
<< int(QAbstractSocket::UnsupportedSocketOperationError);
QTest::newRow("no-such-host") << int(QNetworkProxy::Socks5Proxy)
<< "invalid.test.qt-project.org" << 1080
<< int(QAbstractSocket::ProxyNotFoundError);
- QTest::newRow("socks5-on-http") << int(QNetworkProxy::Socks5Proxy) << fluke << 3128
+ QTest::newRow("socks5-on-http") << int(QNetworkProxy::Socks5Proxy) << httpProxyIp << 3128
<< int(QAbstractSocket::SocketTimeoutError);
}
@@ -740,48 +749,48 @@ void tst_QTcpServer::proxyFactory_data()
// tests that do get to listen
- proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080);
+ proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080);
QTest::newRow("socks5")
<< proxyList << proxyList.at(0)
<< false << int(QAbstractSocket::UnknownSocketError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3128)
- << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3128)
+ << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080);
QTest::newRow("cachinghttp+socks5")
<< proxyList << proxyList.at(1)
<< false << int(QAbstractSocket::UnknownSocketError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3128)
- << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3128)
+ << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080);
QTest::newRow("ftp+cachinghttp+socks5")
<< proxyList << proxyList.at(2)
<< false << int(QAbstractSocket::UnknownSocketError);
// tests that fail to listen
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3128);
QTest::newRow("http")
<< proxyList << proxyList.at(0)
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3128);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3128);
QTest::newRow("cachinghttp")
<< proxyList << QNetworkProxy()
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121);
QTest::newRow("ftp")
<< proxyList << QNetworkProxy()
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3128);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3128);
QTest::newRow("ftp+cachinghttp")
<< proxyList << QNetworkProxy()
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
@@ -872,11 +881,6 @@ void tst_QTcpServer::serverAddress_data()
{
QTest::addColumn<QHostAddress>("listenAddress");
QTest::addColumn<QHostAddress>("serverAddress");
-#ifdef Q_OS_WIN
- if (QSysInfo::windowsVersion() < QSysInfo::WV_6_0)
- QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << QHostAddress(QHostAddress::AnyIPv4); //windows XP doesn't support dual stack sockets
- else
-#endif
if (QtNetworkSettings::hasIPv6())
QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << QHostAddress(QHostAddress::Any);
else
diff --git a/tests/auto/network/socket/qtcpsocket/BLACKLIST b/tests/auto/network/socket/qtcpsocket/BLACKLIST
index d724897b74..07532710b3 100644
--- a/tests/auto/network/socket/qtcpsocket/BLACKLIST
+++ b/tests/auto/network/socket/qtcpsocket/BLACKLIST
@@ -1,13 +1,11 @@
-[bindThenResolveHost:first-fail]
-windows
+[bind]
+windows-10 msvc-2015
+windows-7sp1
[bind:[::]]
windows
[bind:[::]:randomport]
windows
-[invalidProxy:socks5-on-http]
-windows
[timeoutConnect:ip]
windows
# QTBUG-66247
-[taskQtBug5799ConnectionErrorEventLoop]
-windows
+
diff --git a/tests/auto/network/socket/qtcpsocket/test/test.pro b/tests/auto/network/socket/qtcpsocket/test/test.pro
index 337e75b372..4c07b1ec66 100644
--- a/tests/auto/network/socket/qtcpsocket/test/test.pro
+++ b/tests/auto/network/socket/qtcpsocket/test/test.pro
@@ -2,8 +2,8 @@ CONFIG += testcase
QT = core-private network-private testlib
SOURCES += ../tst_qtcpsocket.cpp
-win32:LIBS += -lws2_32
+win32: QMAKE_USE += ws2_32
TARGET = tst_qtcpsocket
win32 {
@@ -15,3 +15,9 @@ win32 {
} else {
DESTDIR = ../
}
+
+# Only on Linux until cyrus has been added to docker-compose-for-{windows,macOS}.yml and tested
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = danted squid apache2 ftp-proxy vsftpd iptables cyrus
+}
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index 10b09629bc..75b9b23259 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -66,7 +66,7 @@
#endif
#include <QTextStream>
#include <QThread>
-#include <QTime>
+#include <QElapsedTimer>
#include <QTimer>
#include <QDebug>
// RVCT compiles also unused inline methods
@@ -236,7 +236,6 @@ private:
qint64 bytesAvailable;
qint64 expectedLength;
bool readingBody;
- QTime timer;
QByteArray expectedReplyIMAP_cached;
@@ -316,7 +315,7 @@ tst_QTcpSocket::tst_QTcpSocket()
connect(earlyConstructedSockets->endPoints[1], SIGNAL(bytesWritten(qint64)), this, SLOT(earlySocketBytesSent(qint64)));
earlyConstructedSockets->endPoints[1]->write("hello work");
- firstFailInfo.setAddresses(QList<QHostAddress>() << QHostAddress("224.0.0.0") << QtNetworkSettings::serverIP());
+ firstFailInfo.setAddresses(QList<QHostAddress>() << QHostAddress("224.0.0.0") << QtNetworkSettings::httpServerIp());
}
void tst_QTcpSocket::initTestCase_data()
@@ -325,7 +324,6 @@ void tst_QTcpSocket::initTestCase_data()
QTest::addColumn<int>("proxyType");
QTest::addColumn<bool>("ssl");
- qDebug() << QtNetworkSettings::serverName();
QTest::newRow("WithoutProxy") << false << 0 << false;
QTest::newRow("WithSocks5Proxy") << true << int(Socks5Proxy) << false;
QTest::newRow("WithSocks5ProxyAuth") << true << int(Socks5Proxy | AuthBasic) << false;
@@ -351,7 +349,17 @@ void tst_QTcpSocket::initTestCase_data()
void tst_QTcpSocket::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 143));
+ //QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::firewallServerName(), 1357));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpServerName(), 21));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpProxyServerName(), 2121));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif
}
void tst_QTcpSocket::init()
@@ -360,30 +368,33 @@ void tst_QTcpSocket::init()
if (setProxy) {
#ifndef QT_NO_NETWORKPROXY
QFETCH_GLOBAL(int, proxyType);
- QList<QHostAddress> addresses = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses();
- QVERIFY2(addresses.count() > 0, "failed to get ip address for test server");
- QString fluke = addresses.first().toString();
+ QList<QHostAddress> socks5Addresses = QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses();
+ QList<QHostAddress> httpProxyAddresses = QHostInfo::fromName(QtNetworkSettings::httpProxyServerName()).addresses();
+ QVERIFY2(socks5Addresses.count() > 0, "failed to get ip address for SOCKS5 proxy server");
+ QVERIFY2(httpProxyAddresses.count() > 0, "failed to get ip address for HTTP proxy server");
+ QString socks5Address = socks5Addresses.first().toString();
+ QString httpProxyAddress = httpProxyAddresses.first().toString();
QNetworkProxy proxy;
switch (proxyType) {
case Socks5Proxy:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, fluke, 1080);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socks5Address, 1080);
break;
case Socks5Proxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, fluke, 1081);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socks5Address, 1081);
break;
case HttpProxy | NoAuth:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, fluke, 3128);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, httpProxyAddress, 3128);
break;
case HttpProxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, fluke, 3129);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, httpProxyAddress, 3129);
break;
case HttpProxy | AuthNtlm:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, fluke, 3130);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, httpProxyAddress, 3130);
break;
}
QNetworkProxy::setApplicationProxy(proxy);
@@ -643,8 +654,8 @@ void tst_QTcpSocket::bind()
void tst_QTcpSocket::bindThenResolveHost_data()
{
QTest::addColumn<QString>("hostName");
- QTest::newRow("ip-literal") << QtNetworkSettings::serverIP().toString();
- QTest::newRow("name") << QtNetworkSettings::serverName();
+ QTest::newRow("ip-literal") << QtNetworkSettings::httpServerIp().toString();
+ QTest::newRow("name") << QtNetworkSettings::httpServerName();
QTest::newRow("first-fail") << firstFailName;
}
@@ -714,7 +725,7 @@ void tst_QTcpSocket::setSocketDescriptor()
#ifdef Q_OS_WIN
// need the dummy to ensure winsock is started
QTcpSocket *dummy = newSocket();
- dummy->connectToHost(QtNetworkSettings::serverName(), 143);
+ dummy->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(dummy->waitForConnected());
SOCKET sock = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -736,7 +747,7 @@ void tst_QTcpSocket::setSocketDescriptor()
QCOMPARE(socket->socketDescriptor(), (qintptr)sock);
qt_qhostinfo_clear_cache(); //avoid the HostLookupState being skipped due to address being in cache from previous test.
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
QCOMPARE(socket->state(), QTcpSocket::HostLookupState);
QCOMPARE(socket->socketDescriptor(), (qintptr)sock);
QVERIFY(socket->waitForConnected(10000));
@@ -757,7 +768,7 @@ void tst_QTcpSocket::socketDescriptor()
QTcpSocket *socket = newSocket();
QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->state() == QAbstractSocket::HostLookupState ||
socket->state() == QAbstractSocket::ConnectingState);
QVERIFY(socket->waitForConnected(10000));
@@ -774,7 +785,7 @@ void tst_QTcpSocket::blockingIMAP()
QTcpSocket *socket = newSocket();
// Connect
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(10000));
QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
QVERIFY(socket->isValid());
@@ -851,6 +862,15 @@ void tst_QTcpSocket::hostNotFound()
socket->connectToHost("nosuchserver.qt-project.org", 80);
QVERIFY(!socket->waitForConnected());
QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
+#ifdef QT_TEST_SERVER
+ QFETCH_GLOBAL(bool, setProxy);
+ QFETCH_GLOBAL(int, proxyType);
+ if (setProxy && (proxyType & HttpProxy) == HttpProxy) {
+ QEXPECT_FAIL("", "QTBUG-73953: The version of Squid in the docker container behaves "
+ "differently to the one in the network testing server, returning 503 "
+ "when we expect 404", Continue);
+ }
+#endif
QCOMPARE(int(socket->error()), int(QTcpSocket::HostNotFoundError));
delete socket;
@@ -860,8 +880,8 @@ void tst_QTcpSocket::hostNotFound()
void tst_QTcpSocket::timeoutConnect_data()
{
QTest::addColumn<QString>("address");
- QTest::newRow("host") << QtNetworkSettings::serverName();
- QTest::newRow("ip") << QtNetworkSettings::serverIP().toString();
+ QTest::newRow("host") << QtNetworkSettings::firewallServerName();
+ QTest::newRow("ip") << QtNetworkSettings::firewallServerIp().toString();
}
void tst_QTcpSocket::timeoutConnect()
@@ -909,7 +929,7 @@ void tst_QTcpSocket::nonBlockingIMAP()
nonBlockingIMAP_socket = socket;
// Connect
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->state() == QTcpSocket::HostLookupState ||
socket->state() == QTcpSocket::ConnectingState);
@@ -1035,7 +1055,7 @@ void tst_QTcpSocket::delayedClose()
connect(socket, SIGNAL(connected()), SLOT(nonBlockingIMAP_connected()));
connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
enterLoop(30);
if (timeout())
@@ -1081,7 +1101,7 @@ QByteArray tst_QTcpSocket::expectedReplyIMAP()
void tst_QTcpSocket::fetchExpectedReplyIMAP()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY2(socket->waitForConnected(10000), qPrintable(socket->errorString()));
QVERIFY2(socket->state() == QTcpSocket::ConnectedState, qPrintable(socket->errorString()));
@@ -1100,7 +1120,7 @@ void tst_QTcpSocket::fetchExpectedReplyIMAP()
void tst_QTcpSocket::partialRead()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(10000));
QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
char buf[512];
@@ -1124,7 +1144,7 @@ void tst_QTcpSocket::partialRead()
void tst_QTcpSocket::unget()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(10000));
QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
char buf[512];
@@ -1161,7 +1181,7 @@ void tst_QTcpSocket::readRegularFile_readyRead()
void tst_QTcpSocket::readAllAfterClose()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
connect(socket, SIGNAL(readyRead()), SLOT(readRegularFile_readyRead()));
enterLoop(10);
if (timeout())
@@ -1201,7 +1221,7 @@ void tst_QTcpSocket::openCloseOpenClose()
QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(10000));
socket->close();
}
@@ -1224,7 +1244,7 @@ void tst_QTcpSocket::connectDisconnectConnectDisconnect()
QCOMPARE(int(socket->peerPort()), 0);
QCOMPARE(socket->peerAddress(), QHostAddress());
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForReadyRead(10000));
QCOMPARE(QString::fromLatin1(socket->read(4)), QString("* OK"));
@@ -1428,7 +1448,7 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
// just connect and disconnect, then make sure nothing weird happened
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 21);
+ socket->connectToHost(QtNetworkSettings::ftpServerName(), 21);
// check that connect is in progress
QVERIFY(socket->state() != QAbstractSocket::UnconnectedState);
@@ -1476,7 +1496,7 @@ void tst_QTcpSocket::downloadBigFile()
connect(tmpSocket, SIGNAL(readyRead()), SLOT(downloadBigFileSlot()));
connect(tmpSocket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
- tmpSocket->connectToHost(QtNetworkSettings::serverName(), 80);
+ tmpSocket->connectToHost(QtNetworkSettings::httpServerName(), 80);
enterLoop(30);
if (timeout()) {
@@ -1485,7 +1505,7 @@ void tst_QTcpSocket::downloadBigFile()
QFAIL("Network operation timed out");
}
- QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
+ QByteArray hostName = QtNetworkSettings::httpServerName().toLatin1();
QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("HOST: ") > 0);
@@ -1497,7 +1517,7 @@ void tst_QTcpSocket::downloadBigFile()
expectedLength = 0;
readingBody = false;
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
enterLoop(600);
@@ -1551,7 +1571,7 @@ void tst_QTcpSocket::downloadBigFileSlot()
void tst_QTcpSocket::readLine()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(5000));
while (!socket->canReadLine())
@@ -1600,7 +1620,7 @@ void tst_QTcpSocket::readLine()
void tst_QTcpSocket::readLineString()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForReadyRead(10000));
QByteArray arr = socket->readLine();
@@ -1613,7 +1633,7 @@ void tst_QTcpSocket::readLineString()
void tst_QTcpSocket::readChunks()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(10000));
QVERIFY(socket->waitForReadyRead(5000));
@@ -1633,7 +1653,7 @@ void tst_QTcpSocket::readChunks()
void tst_QTcpSocket::waitForBytesWritten()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
QVERIFY(socket->waitForConnected(10000));
socket->write("GET / HTTP/1.0\r\n\r\n");
@@ -1651,7 +1671,7 @@ void tst_QTcpSocket::waitForBytesWrittenMinusOne()
QSKIP("QTBUG-24451 - indefinite wait may hang");
#endif
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
QVERIFY(socket->waitForConnected(10000));
socket->write("GET / HTTP/1.0\r\n\r\n");
@@ -1666,7 +1686,7 @@ void tst_QTcpSocket::waitForBytesWrittenMinusOne()
void tst_QTcpSocket::waitForReadyRead()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
socket->write("GET / HTTP/1.0\r\n\r\n");
QVERIFY(socket->waitForReadyRead(5000));
delete socket;
@@ -1679,7 +1699,7 @@ void tst_QTcpSocket::waitForReadyReadMinusOne()
QSKIP("QTBUG-24451 - indefinite wait may hang");
#endif
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
socket->write("GET / HTTP/1.0\r\n\r\n");
QVERIFY(socket->waitForReadyRead(-1));
delete socket;
@@ -1692,7 +1712,7 @@ void tst_QTcpSocket::flush()
socket->flush();
connect(socket, SIGNAL(connected()), SLOT(exitLoopSlot()));
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
enterLoop(60);
QVERIFY(socket->isOpen());
@@ -1709,7 +1729,7 @@ void tst_QTcpSocket::flush()
void tst_QTcpSocket::synchronousApi()
{
QTcpSocket *ftpSocket = newSocket();
- ftpSocket->connectToHost(QtNetworkSettings::serverName(), 21);
+ ftpSocket->connectToHost(QtNetworkSettings::ftpServerName(), 21);
ftpSocket->write("QUIT\r\n");
QVERIFY(ftpSocket->waitForDisconnected(10000));
QVERIFY(ftpSocket->bytesAvailable() > 0);
@@ -1756,10 +1776,10 @@ void tst_QTcpSocket::recursiveReadyRead()
QSignalSpy spy(testSocket, SIGNAL(readyRead()));
- testSocket->connectToHost(QtNetworkSettings::serverName(), 143);
+ testSocket->connectToHost(QtNetworkSettings::imapServerName(), 143);
enterLoop(30);
QVERIFY2(!timeout(),
- "Timed out when connecting to QtNetworkSettings::serverName().");
+ "Timed out when connecting to QtNetworkSettings::imapServerName().");
enterLoop(30);
QVERIFY2(!timeout(),
@@ -1793,7 +1813,7 @@ void tst_QTcpSocket::recursiveReadyReadSlot()
void tst_QTcpSocket::atEnd()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 21);
+ socket->connectToHost(QtNetworkSettings::ftpServerName(), 21);
QVERIFY(socket->waitForReadyRead(15000));
QTextStream stream(socket);
@@ -1801,9 +1821,15 @@ void tst_QTcpSocket::atEnd()
QString greeting = stream.readLine();
QVERIFY(stream.atEnd());
+#ifdef QT_TEST_SERVER
+ // Test server must use some vsFTPd 3.x.x version
+ QVERIFY2(greeting.length() == sizeof("220 (vsFTPd 3.x.x)")-1, qPrintable(greeting));
+ QVERIFY2(greeting.startsWith("220 (vsFTPd 3."), qPrintable(greeting));
+#else
// Test server must use some vsFTPd 2.x.x version
QVERIFY2(greeting.length() == sizeof("220 (vsFTPd 2.x.x)")-1, qPrintable(greeting));
QVERIFY2(greeting.startsWith("220 (vsFTPd 2."), qPrintable(greeting));
+#endif
QVERIFY2(greeting.endsWith(QLatin1Char(')')), qPrintable(greeting));
delete socket;
@@ -1834,7 +1860,7 @@ protected:
connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), Qt::DirectConnection);
- socket->connectToHost(QtNetworkSettings::serverName(), 21);
+ socket->connectToHost(QtNetworkSettings::ftpServerName(), 21);
socket->write("QUIT\r\n");
exec();
@@ -1908,7 +1934,7 @@ void tst_QTcpSocket::waitForReadyReadInASlot()
tmpSocket = socket;
connect(socket, SIGNAL(connected()), this, SLOT(waitForReadyReadInASlotSlot()));
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
socket->write("GET / HTTP/1.0\r\n\r\n");
enterLoop(30);
@@ -2092,7 +2118,7 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot()
timer.start(15000);
connect(tmpSocket, SIGNAL(hostFound()), this, SLOT(hostLookupSlot()));
- tmpSocket->connectToHost(QtNetworkSettings::serverName(), 143);
+ tmpSocket->connectToHost(QtNetworkSettings::imapServerName(), 143);
// only execute the loop if not already connected
if (tmpSocket->state() != QAbstractSocket::ConnectedState)
@@ -2147,7 +2173,7 @@ public slots:
inline void doIt()
{
attemptedToConnect = true;
- sock->connectToHost(QtNetworkSettings::serverName(), 80);
+ sock->connectToHost(QtNetworkSettings::httpServerName(), 80);
#if defined(Q_OS_MAC)
pthread_yield_np();
@@ -2198,7 +2224,7 @@ void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead()
QSignalSpy readyReadSpy(socket, SIGNAL(readyRead()));
// Connect
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
// Wait for the read
QVERIFY(socket->waitForReadyRead(10000));
@@ -2334,7 +2360,7 @@ void tst_QTcpSocket::localAddressEmptyOnBSD()
void tst_QTcpSocket::zeroAndMinusOneReturns()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 80);
socket->write("GET / HTTP/1.0\r\nConnection: keep-alive\r\n\r\n");
QVERIFY(socket->waitForReadyRead(15000));
@@ -2395,7 +2421,7 @@ void tst_QTcpSocket::connectionRefused()
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
&QTestEventLoop::instance(), SLOT(exitLoop()));
- socket->connectToHost(QtNetworkSettings::serverName(), 144);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 144);
enterLoop(10);
disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
@@ -2475,7 +2501,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect()
QEventLoop loop;
connect(&serverProcess, SIGNAL(finished(int)), &loop, SLOT(quit()));
connect(&clientProcess, SIGNAL(finished(int)), &loop, SLOT(quit()));
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
QTimer::singleShot(20000, &loop, SLOT(quit()));
@@ -2515,7 +2541,7 @@ void tst_QTcpSocket::connectToMultiIP()
// rationale: this domain resolves to 3 A-records, 2 of them are
// invalid. QTcpSocket should never spend more than 30 seconds per IP, and
// 30s*2 = 60s.
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
socket->connectToHost("multi.dev.qt-project.org", 80);
QVERIFY(socket->waitForConnected(60500));
@@ -2542,7 +2568,7 @@ void tst_QTcpSocket::moveToThread0()
{
// Case 1: Moved after connecting, before waiting for connection.
QTcpSocket *socket = newSocket();;
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
socket->moveToThread(0);
QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
@@ -2554,7 +2580,7 @@ void tst_QTcpSocket::moveToThread0()
// Case 2: Moved before connecting
QTcpSocket *socket = newSocket();
socket->moveToThread(0);
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
QVERIFY(socket->waitForBytesWritten(5000));
@@ -2564,7 +2590,7 @@ void tst_QTcpSocket::moveToThread0()
{
// Case 3: Moved after writing, while waiting for bytes to be written.
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
socket->moveToThread(0);
@@ -2575,7 +2601,7 @@ void tst_QTcpSocket::moveToThread0()
{
// Case 4: Moved after writing, while waiting for response.
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 143);
+ socket->connectToHost(QtNetworkSettings::imapServerName(), 143);
QVERIFY(socket->waitForConnected(5000));
socket->write("XXX LOGOUT\r\n");
QVERIFY(socket->waitForBytesWritten(5000));
@@ -2706,8 +2732,8 @@ void tst_QTcpSocket::taskQtBug5799ConnectionErrorWaitForConnected()
// use waitForConnected, e.g. this should use a synchronous select() on the OS level
QTcpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 12346);
- QTime timer;
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 12346);
+ QElapsedTimer timer;
timer.start();
socket.waitForConnected(10000);
QVERIFY2(timer.elapsed() < 9900, "Connection to closed port timed out instead of refusing, something is wrong");
@@ -2726,7 +2752,7 @@ void tst_QTcpSocket::taskQtBug5799ConnectionErrorEventLoop()
// This testcase uses an event loop
QTcpSocket socket;
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- socket.connectToHost(QtNetworkSettings::serverName(), 12346);
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 12346);
QTestEventLoop::instance().enterLoop(10);
QVERIFY2(!QTestEventLoop::instance().timeout(), "Connection to closed port timed out instead of refusing, something is wrong");
@@ -2739,7 +2765,7 @@ void tst_QTcpSocket::taskQtBug7054TimeoutErrorResetting()
{
QTcpSocket *socket = newSocket();
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QVERIFY(socket->waitForConnected(5*1000));
QCOMPARE(socket->error(), QAbstractSocket::UnknownSocketError);
@@ -2768,10 +2794,12 @@ void tst_QTcpSocket::invalidProxy_data()
QTest::addColumn<bool>("failsAtConnect");
QTest::addColumn<int>("expectedError");
- QString fluke = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
- QTest::newRow("ftp-proxy") << int(QNetworkProxy::FtpCachingProxy) << fluke << 21 << true
+ const QString ftpAddress = QtNetworkSettings::ftpServerIp().toString();
+ const QString httpProxyAddress = QtNetworkSettings::httpProxyServerIp().toString();
+ const QString socksProxyAddress = QtNetworkSettings::socksProxyServerIp().toString();
+ QTest::newRow("ftp-proxy") << int(QNetworkProxy::FtpCachingProxy) << ftpAddress << 21 << true
<< int(QAbstractSocket::UnsupportedSocketOperationError);
- QTest::newRow("http-caching-proxy") << int(QNetworkProxy::HttpCachingProxy) << fluke << 3128 << true
+ QTest::newRow("http-caching-proxy") << int(QNetworkProxy::HttpCachingProxy) << httpProxyAddress << 3128 << true
<< int(QAbstractSocket::UnsupportedSocketOperationError);
QTest::newRow("no-such-host-socks5") << int(QNetworkProxy::Socks5Proxy)
<< "this-host-will-never-exist.qt-project.org" << 1080 << false
@@ -2779,9 +2807,9 @@ void tst_QTcpSocket::invalidProxy_data()
QTest::newRow("no-such-host-http") << int(QNetworkProxy::HttpProxy)
<< "this-host-will-never-exist.qt-project.org" << 3128 << false
<< int(QAbstractSocket::ProxyNotFoundError);
- QTest::newRow("http-on-socks5") << int(QNetworkProxy::HttpProxy) << fluke << 1080 << false
+ QTest::newRow("http-on-socks5") << int(QNetworkProxy::HttpProxy) << socksProxyAddress << 1080 << false
<< int(QAbstractSocket::ProxyConnectionClosedError);
- QTest::newRow("socks5-on-http") << int(QNetworkProxy::Socks5Proxy) << fluke << 3128 << false
+ QTest::newRow("socks5-on-http") << int(QNetworkProxy::Socks5Proxy) << httpProxyAddress << 3128 << false
<< int(QAbstractSocket::SocketTimeoutError);
}
@@ -2800,7 +2828,7 @@ void tst_QTcpSocket::invalidProxy()
QTcpSocket *socket = newSocket();
socket->setProxy(proxy);
- socket->connectToHost(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString(), 80);
+ socket->connectToHost(QtNetworkSettings::httpServerIp().toString(), 80);
if (failsAtConnect) {
QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
@@ -2852,48 +2880,48 @@ void tst_QTcpSocket::proxyFactory_data()
// tests that do connect
- proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("http")
<< proxyList << proxyList.at(0)
<< false << int(QAbstractSocket::UnknownSocketError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("socks5")
<< proxyList << proxyList.at(0)
<< false << int(QAbstractSocket::UnknownSocketError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("cachinghttp+socks5")
<< proxyList << proxyList.at(1)
<< false << int(QAbstractSocket::UnknownSocketError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("ftp+cachinghttp+socks5")
<< proxyList << proxyList.at(2)
<< false << int(QAbstractSocket::UnknownSocketError);
// tests that fail to connect
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("cachinghttp")
<< proxyList << QNetworkProxy()
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121);
QTest::newRow("ftp")
<< proxyList << QNetworkProxy()
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("ftp+cachinghttp")
<< proxyList << QNetworkProxy()
<< true << int(QAbstractSocket::UnsupportedSocketOperationError);
@@ -2914,7 +2942,7 @@ void tst_QTcpSocket::proxyFactory()
QNetworkProxyFactory::setApplicationProxyFactory(factory);
QTcpSocket *socket = newSocket();
- QString host = QtNetworkSettings::serverName();
+ QString host = QtNetworkSettings::httpServerName();
socket->connectToHost(host, 80);
// Verify that the factory was called properly
diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST
index 0d56f6c827..bc6068d695 100644
--- a/tests/auto/network/socket/qudpsocket/BLACKLIST
+++ b/tests/auto/network/socket/qudpsocket/BLACKLIST
@@ -1,26 +1,10 @@
[writeDatagramToNonExistingPeer]
-windows
-osx
-[asyncReadDatagram]
-osx
-[multicastLeaveAfterClose]
-osx
-[readyRead]
-osx
+windows-10 msvc-2017
+windows-10 msvc-2015
+windows-7sp1
[readyReadForEmptyDatagram]
-osx
+opensuse-leap
[echo]
-linux
-osx
-[ipv6Loop]
-osx
-[loop]
-osx
-[broadcasting]
-osx
-[zeroLengthDatagram]
-osx
-[linkLocalIPv6]
-linux
+opensuse-42.3
[readyReadForEmptyDatagram]
linux
diff --git a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
index cc3e90671a..8172cd4f6f 100644
--- a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
+++ b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
@@ -54,7 +54,7 @@ public:
printf("ok\n");
break;
case UnconnectedClient:
- peerAddress = host;
+ peerAddress = QHostAddress(host);
peerPort = port;
if (bind(QHostAddress::Any, port + 1, ShareAddress | ReuseAddressHint)) {
startTimer(250);
diff --git a/tests/auto/network/socket/qudpsocket/test/test.pro b/tests/auto/network/socket/qudpsocket/test/test.pro
index e856776ddc..994b360370 100644
--- a/tests/auto/network/socket/qudpsocket/test/test.pro
+++ b/tests/auto/network/socket/qudpsocket/test/test.pro
@@ -6,7 +6,7 @@ QT = core network testlib
MOC_DIR=tmp
-win32 {
+win32:debug_and_release {
CONFIG(debug, debug|release) {
DESTDIR = ../debug
} else {
@@ -17,3 +17,9 @@ win32 {
}
TARGET = tst_qudpsocket
+
+# Only on Linux until 'echo' has been added to docker-compose-for-{windows,macOS}.yml and tested
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = danted echo
+}
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 707c1acf48..0f419e9de4 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -40,6 +40,7 @@
#include <qhostinfo.h>
#include <qtcpsocket.h>
#include <qmap.h>
+#include <qelapsedtimer.h>
#include <qnetworkdatagram.h>
#include <QNetworkProxy>
#include <QNetworkInterface>
@@ -235,6 +236,7 @@ void tst_QUdpSocket::initTestCase_data()
// hack: we only enable the Socks5 over UDP tests on the old
// test server, because they fail on the new one. See QTBUG-35490
bool newTestServer = true;
+#ifndef QT_TEST_SERVER
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 22);
if (socket.waitForConnected(10000)) {
@@ -244,6 +246,7 @@ void tst_QUdpSocket::initTestCase_data()
newTestServer = false;
socket.disconnectFromHost();
}
+#endif
QTest::addColumn<bool>("setProxy");
QTest::addColumn<int>("proxyType");
@@ -257,8 +260,13 @@ void tst_QUdpSocket::initTestCase_data()
void tst_QUdpSocket::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::echoServerName(), 7));
+#else
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
+#endif
allAddresses = QNetworkInterface::allAddresses();
m_skipUnsupportedIPv6Tests = shouldSkipIpv6TestsForBrokenSetsockopt();
@@ -300,7 +308,7 @@ void tst_QUdpSocket::init()
#if QT_CONFIG(socks5)
QFETCH_GLOBAL(int, proxyType);
if (proxyType == QNetworkProxy::Socks5Proxy) {
- QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
+ QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080));
}
#else
QSKIP("No proxy support");
@@ -915,7 +923,7 @@ void tst_QUdpSocket::performance()
client.connectToHost(serverAddress, server.localPort());
QVERIFY(client.waitForConnected(10000));
- QTime stopWatch;
+ QElapsedTimer stopWatch;
stopWatch.start();
qint64 nbytes = 0;
@@ -981,7 +989,7 @@ void tst_QUdpSocket::writeDatagramToNonExistingPeer_data()
QTest::addColumn<bool>("bind");
QTest::addColumn<QHostAddress>("peerAddress");
QHostAddress localhost(QHostAddress::LocalHost);
- QList<QHostAddress> serverAddresses(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses());
+ QList<QHostAddress> serverAddresses(QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses());
if (serverAddresses.isEmpty())
return;
@@ -995,7 +1003,7 @@ void tst_QUdpSocket::writeDatagramToNonExistingPeer_data()
void tst_QUdpSocket::writeDatagramToNonExistingPeer()
{
- if (QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().isEmpty())
+ if (QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses().isEmpty())
QFAIL("Could not find test server address");
QFETCH(bool, bind);
QFETCH(QHostAddress, peerAddress);
@@ -1015,7 +1023,7 @@ void tst_QUdpSocket::writeToNonExistingPeer_data()
{
QTest::addColumn<QHostAddress>("peerAddress");
QHostAddress localhost(QHostAddress::LocalHost);
- QList<QHostAddress> serverAddresses(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses());
+ QList<QHostAddress> serverAddresses(QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses());
if (serverAddresses.isEmpty())
return;
@@ -1028,7 +1036,7 @@ void tst_QUdpSocket::writeToNonExistingPeer_data()
void tst_QUdpSocket::writeToNonExistingPeer()
{
QSKIP("Connected-mode UDP sockets and their behaviour are erratic");
- if (QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().isEmpty())
+ if (QHostInfo::fromName(QtNetworkSettings::socksProxyServerName()).addresses().isEmpty())
QFAIL("Could not find test server address");
QFETCH(QHostAddress, peerAddress);
quint16 peerPort = 34534;
@@ -1551,7 +1559,7 @@ void tst_QUdpSocket::echo_data()
void tst_QUdpSocket::echo()
{
QFETCH(bool, connect);
- QHostInfo info = QHostInfo::fromName(QtNetworkSettings::serverName());
+ QHostInfo info = QHostInfo::fromName(QtNetworkSettings::echoServerName());
QVERIFY(info.addresses().count());
QHostAddress remote = info.addresses().first();
diff --git a/tests/auto/network/ssl/qsslcertificate/BLACKLIST b/tests/auto/network/ssl/qsslcertificate/BLACKLIST
index 25509a5ca8..9494ee2278 100644
--- a/tests/auto/network/ssl/qsslcertificate/BLACKLIST
+++ b/tests/auto/network/ssl/qsslcertificate/BLACKLIST
@@ -1,3 +1,13 @@
# OpenSSL version is too new. Rich will fix :)
[subjectAndIssuerAttributes]
-*
+ubuntu-16.04
+rhel-7.6
+opensuse-leap
+windows-7sp1
+ubuntu-18.04
+rhel-7.4
+b2qt
+windows-10 msvc-2017
+windows-10 msvc-2015
+opensuse-42.3
+
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index 88be13f41d..efc0c26076 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -401,9 +401,7 @@ void tst_QSslCertificate::subjectAlternativeNames()
certificate.subjectAlternativeNames();
// verify that each entry in subjAltNames is present in fileContents
- QMapIterator<QSsl::AlternativeNameEntryType, QString> it(altSubjectNames);
- while (it.hasNext()) {
- it.next();
+ for (auto it = altSubjectNames.cbegin(), end = altSubjectNames.cend(); it != end; ++it) {
QByteArray type;
if (it.key() == QSsl::EmailEntry)
type = "email";
@@ -814,7 +812,7 @@ void tst_QSslCertificate::task256066toPem()
void tst_QSslCertificate::nulInCN()
{
-#if defined(QT_SECURETRANSPORT) || defined(Q_OS_WINRT) || QT_CONFIG(schannel)
+#if QT_CONFIG(securetransport) || defined(Q_OS_WINRT) || QT_CONFIG(schannel)
QSKIP("Generic QSslCertificatePrivate fails this test");
#endif
QList<QSslCertificate> certList =
@@ -833,7 +831,7 @@ void tst_QSslCertificate::nulInCN()
void tst_QSslCertificate::nulInSan()
{
-#if defined(QT_SECURETRANSPORT) || defined(Q_OS_WINRT) || QT_CONFIG(schannel)
+#if QT_CONFIG(securetransport) || defined(Q_OS_WINRT) || QT_CONFIG(schannel)
QSKIP("Generic QSslCertificatePrivate fails this test");
#endif
QList<QSslCertificate> certList =
@@ -968,7 +966,7 @@ void tst_QSslCertificate::subjectAndIssuerAttributes()
void tst_QSslCertificate::verify()
{
-#ifdef QT_SECURETRANSPORT
+#if QT_CONFIG(securetransport)
QSKIP("Not implemented in SecureTransport");
#endif
QList<QSslError> errors;
diff --git a/tests/auto/network/ssl/qsslkey/BLACKLIST b/tests/auto/network/ssl/qsslkey/BLACKLIST
index f9bc0af6de..19fb15cd1f 100644
--- a/tests/auto/network/ssl/qsslkey/BLACKLIST
+++ b/tests/auto/network/ssl/qsslkey/BLACKLIST
@@ -1,2 +1,9 @@
-redhatenterpriselinuxworkstation
+[constructor]
rhel
+[length]
+rhel
+[toEncryptedPemOrDer]
+rhel
+[toPemOrDer]
+rhel
+
diff --git a/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes128.pem b/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes128.pem
new file mode 100644
index 0000000000..1a8751874e
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes128.pem
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,A2A6F6BA67CFB2A992BA4FD3A0984B59
+
+L5G1mwcXwW30lFty1HaEHlswFXAGk9+qf0TdYYNAAvVrsTMgfMq/6xM5XWo3IgbN
+gG4K6T57gQkAywn+upqMHobB+7qc3DRzYlrm89gb74gHOe95l/iUJp4ii+ROLcmY
+fg/vNmDSB/D0eM91WfwId7ticYD29+BUbbnqSYyY2S7K7DytYLpXqg3u335GYCdT
+JwOsgcgbOICytkgK6c9ZDF3IrkzvWospVuiG5IfpLQkUXlJO3YGJ/oGf1BXnRd/b
+kTzUiimUVunX62muHaUXKkAmXS8FCdB0puI+52pzLJ5FHdFxCcnwSG09TmoXbwwa
+KoNM+IshNHPBGM7QxflVbSDxDaF1FWLwWSb8+Fhb2fTpfEGMxRCQ8HB1ZeMV4E5W
+DSiNhih8ziC0k957ZYv8iuLanoM1YYIdToHeBwjyBJA836eIcq/ElY2QtKUq5PRw
++sU1BdG+f9rf4iAPHpgWZAKFmJ42ya71bEEVAmfysAOPuc4hpn3SsDTtihm9RKc9
+l7LWJHaTnTu6yJA+vMJwAmPWg+IdG5vntbb93X4cgl5ZadBySRtv37wWyQPnQcFh
+ytX8z2CJNIFJb0ik8bXc39zOxExoTu/o86IuVJ87jFdS1wz3PRek6dJdl15icx76
+yAT0YB2/ZlRcRrO9hSm0D6P+sLOh//dyhhFAlUrDxqrKngI3KF4kgIrSlva3wmx2
+t16SiUKu6FGQZk6/KYOV27Cy+8UJEqlrNJzy+wSFi26d6e6xWTIR2ItzQCxhYDmq
+Tpx0Mh0ml2+bgrKRoDAL5z6UNy0Pc6bYQjvMznIeiuGvL8bAKTDUFwbmrZqNScsl
+tW7yNZG9iSJnAZGMTxuOhSvJRpQkxIcLICd+lsUxWZ2YvFxtSORuRNSwaC7oxtTD
+gIXV08ayoDbDmcguqTXWuCxtguxNANjhsUOetNHL8iP8QFrzAd5Ith9FgASCIBJJ
+3X7vL2YGc3E6DlAJE01loqySU/cnu6/zQapLB9BIzdtoLliwdrJ7PS8FSsBDfZ2X
+i6/7gb1jxYkJAS1NqrUMJw6BphRAwF8ny+FtPJ23Oaf+1vRIGiHsh8qw6XBfwFw9
+vtsUUL19r+8zMpvIB6gf34TLuM7AW7idu3c/486EWgZBDL3mOTd3fsyADKv/HCk7
+c8M2dsafxI6QkTlWsB8G5vkZ8lCGKHjrmPWjfD7NXi+CvXIrDY+gOeVN3PlQCU/2
+zF2vIxKtR0CXuxLzIjFhIgTYR5G5ZnddMmHeVkZdPRl7szGtrxOA4QGJQ6ZT4W2e
+O1whVU2KB0aBYskhClimapM5ypRkcNQ97cUR6/iNgdgSLqxGHCGeMR9bEyLl7/wr
+M0XeDjdVfm/Tj548oHgb0SKLsfL6nnKwqB2viKj81moK9A/wO1Ec9RNaw0jtp2j3
+VIUnPj0GqEjnkHc2jWY2yt4SD6e2AZHwLyWi1q3pixZo1CFiEgFXxwNyYwyeJ6jV
+CJHPRzoNjZ8dkvgRjsXdnWwN316JBNVcH8k7CCmg/8Gq3yAojXG1z8VJZ06GHckd
+meCL1t89OgwIAmIsysKu7+DrKtSlhkQclZmdG6IrQzuPKaHzTPTDgg3ef3jQ4YQO
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes192.pem b/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes192.pem
new file mode 100644
index 0000000000..db74877a5a
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes192.pem
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-192-CBC,B408346ADE790F8CF0C902A4F0712B34
+
+SwzPBGxmwW2JddOyug1LrWjlZn8siSp5yezjK1x/z2+J2r/vvH8OjGnA387tFtae
+WVTmhT1ixQXMDI1UJuKx0gzrG2449c+BUVe2VXFPLZ2ocSgoXbBpVkfhEqtLAn91
+MSOpQMxvobQKltKhxgXGvuBJwhwfT7yK5HamohFGbxLUh4Dh+NBXwoYH4Qt+kM7C
+kV8VIKvkr/QAL/SRxNoY8rVResPgYvUjdtiGSNZ6CZhNRu42Q2FqbH817cE0NDsN
+il/xvWu4T/6VY1KpwMad/v6BhO45EeKz7YjbF/3Y5jj2JV9r45uf79lM9htMBw0d
+L+Cc3YHeFffgU8NZo0+iUoroXcb7mjWNmgYksbkaZPbLG383YXAXwbkQS7zDMVIx
+QhXn9w+78hNmEV/7PQ8mGXHEFwnfSR05phXoj8IyL5v0grRMA2dsjfxCgfQjH+kc
+Miwr5pD/Flw175OpPFCb2qladdTKoIWiVShspbteoRC0EuiWHzkl5z6Tneyb/sam
+yduLmSYD+RA6OBgUPY95Xm4AowlFFsuV/fxYZ53rFf4cZn9Z6VBVmvIEmapV7CtB
+JzyIVclocwM0ag5u/esdEt/jndJq9chZlIsDS30y3gP6Rlqk5mj90DAs98l28FVG
+WY9jP0babk8mxjYCcnAy7ikUc0D+vJVO6OTmfO3dkGjLpMBM6OlvfhN/0qeXrMDI
+nU2qOshUrVna2kRe6FrcvosFTD8wvQ1/BjmCp1iWWsGdc/q1BqI3pgOlgq3TYfl6
+iUJoji3V2iexH+GPkHsrs+kii1clsO2tgIP7doIooSVkcTsRTHHxKeeHn3qL2028
+pTvieIFD/T4biLZ9Q8sX3XWiHNmXZlCx8lX8MDjTavWES8gY4H5Sr6FjRMy1qpZY
+5w1aAyJ9YZ0J/jLPmFxt8mWgqHPiPlrQkryBBE3l1MSQ/hCEwlf9dP8a+ayINfd7
+3yNkHKjZ5fuoA+TZUQb/fyVM5o1zJ8ML01PaXWrMEgr3b36QL+Ivo2Rpnp9FpwuH
+E405cwCEy5fNSyhHFqqatCbsPl80nkP8OpW6jdWvNy9u0Ap9PS+MbHGq/pfkaazl
+fbKGOckrENzEXi6Uj/yY/0sMtbTJuC70n09X3edHyhl/RJPPUoNnwDM5W1FHfS3r
+qqSOl/r3y5pEErRdBpR4wEgB7DCLBALGDPfXNAAga4ez/Z2X9Zj234+4ZbUzWoLN
+1ER0QYyxLN7oz1qMA15J7nRyRIhDXNlXjyISOqy26T6/d4X0M+6RhNWfT/MHAjJ8
+6ogoGlQUITV3gPO4R6+FGZMF4R6zZXuKVtOXyzRwWnCLfo4gzBHmq+5mmCjGWRq8
+rSSkc6334bYuZOaEoR5EM5sh6ewkjSDPRrKR7EHO02YbiscyT/99TwT5pdIOPK3u
+2T6/40fSmCWQyBLuWxV9CMD+rB/q8Ja5KisEseck7PgI2pMmHfiD5yQXhKR9eDrB
+sRqZxjgRYxup+/0CIBshL8s1R88xelhXyIKyqFfVudM09yAZxEJLQhpDZ27g45ea
+FMX2Ve+ah2NjYBgzAhwKouWg5RyWb6X99NsrCEU75fn/ek86LGs3FxRgB4Uv7Udv
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes256.pem b/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes256.pem
new file mode 100644
index 0000000000..3d96b3166e
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/rsa-with-passphrase-aes256.pem
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-256-CBC,0F2F4695C8FFA35F4076FA0273A3A4E3
+
+GCnMcAhhGuNkJ7SSMBrgNOaDfRtG22J0mdf/0VbrMOJF40P13YBjN3Kd6LpTqBya
+TCIaxQqtfjH1ffhJk8qhwG7uJFGgcY9i0dkrEYklgThzTVqHp7FsQ2jjgJs5HKpc
+euuVD1bxtuc9qI2hq4miA7Z/uDe3M34n+3xcpqccWS1dLFNFZ+fIDwIazfDCu3ah
+fUQHDeWLwOqYiQxhUjjrHpZkI1FE2JYZFaf4zIagIIgzI2O+33fgbrTSoeN5meRs
+F7V2fhDpyEoIlchwAmp6HE6ngtKP4Ecju00yn99AO42fn097yEVwvGFClQTaIzur
+aPEtuKZ4kdc/lmzL2tqNcZckq28ZxpeMq0Fgdcpeg5sDcut811scOjQLFs551On1
+j3E1WfiLoBLKgd9cgmCrZb8hMO+UjcCaV7Jv3T9vDrbvhWs/YhTTwo8UFVplh7Vx
+R1h3cKfzlbtOC5WHXGNK5dBu7SnpEk0+pscY5cxTrzN0odjMbbsjZQmKDZXbmZON
+USzG3Qtafm6Nw/jwQeIjeqaxSho6xGdadTteGaURw6iGio3h0c6/dHayCsxye4tk
+vODa0ZdJASwVh1605qDk9n/iYUT5B46KJCYwO/iN2kUmOcUcZeBqEfV1GfRmepZJ
+bwM4sipzE15hOJ5DKSkHWnSlByRMAdSrMxZWraKUczn5frEBAqEFLlBAvf/FnjWa
+yZJitgryCI2Y2bww1DEMnTCX345kUQIFmmjbzTIXnM28gW+fR3Br9dCf2FAsLNKr
+tru1cYXocPaCUHEqS+XZqVb6BQVQ11YAAde0+x9RknJgsBc9Y7TLobaDBvrV5/nK
+T3vm8el08upum6qPTPh6Z0zBbjx4sp6DYT977N1dYeH4n+0JqcSwIeZg/VAdG0RL
+GzgZVADpiRlStmy65W95KExBjbO0tRTVk/nB1U1nfLbsswp9EKxXgwtpE/ECeTOi
+hzeJBSsXGZ/ZXu/y+NlIu0B/GasFbfrHKslSSrUPTjGEtaEbLNiOEu2Etu3lRcMZ
+oDtMxgNR0TUgCS5nte8lLauYYfB6IuxZXpvJdcI5ushqdOJvvYgJ9Yb2ZPlY8Bt5
+C92Ga69aPcMYk24BPpe15eBbXMsFF8RF+CprVoUPCc+PcuROtxdt+rqoqjQeZPmV
+WQqq+pT2bychpwD7U5jxQnu4u2m+zeBXyk80euBbwEld9BCgfk9mFj6CdBJSEiGV
+qL0ivxd3mDaIKPGd5tcbrOMK2uD7duZY7FrQpAYgryoQJoUHccL7cr9fDC75akHg
+AbrG1+vAYEla/y+SlOg5VTHhiuIl17ZGMViXSqh7iqnnD0dNsZ/HDvk3XouhNxQy
+RQmfdqyIqLuAcfWwQxCQ2E/oMUIHjNhyYmfLVLVGsfxuevMa1eJv7rZ5vIkD2Vpe
+4VveZkNDSpCCNqnvub8+bMW+UXyzbxEZbK5PLkRp7cvtKdA5CUbTlT4060IV0YZ1
+vfMtzXRw8JDD9c1F1WF14afk+y9kvZN88XOH12bSKj+Re06Xx7OzuYU8fclq/pZB
+UZVtRETFnLgb8neMuz3vCoPWK/DSHDZGAAicxq7vTljyoU/QP71Dw7UJIAuYx6Mc
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index 28476fce5b..f94756ed73 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -30,6 +30,7 @@
#include <QtTest/QtTest>
#include <qsslkey.h>
#include <qsslsocket.h>
+#include <QScopeGuard>
#include <QtNetwork/qhostaddress.h>
#include <QtNetwork/qnetworkproxy.h>
@@ -233,15 +234,50 @@ void tst_QSslKey::constructorHandle()
QByteArray passphrase;
if (QByteArray(QTest::currentDataTag()).contains("-pkcs8-"))
passphrase = "1234";
+
BIO* bio = q_BIO_new(q_BIO_s_mem());
q_BIO_write(bio, pem.constData(), pem.length());
- QSslKey key(func(bio, nullptr, nullptr, static_cast<void *>(passphrase.data())), type);
+ EVP_PKEY *origin = func(bio, nullptr, nullptr, static_cast<void *>(passphrase.data()));
+#if QT_CONFIG(opensslv11)
+ q_EVP_PKEY_up_ref(origin);
+#endif
+ QSslKey key(origin, type);
+#if !QT_CONFIG(opensslv11)
+ q_BIO_write(bio, pem.constData(), pem.length());
+ origin = func(bio, nullptr, nullptr, static_cast<void *>(passphrase.data()));
+#endif
q_BIO_free(bio);
+ EVP_PKEY *handle = q_EVP_PKEY_new();
+ switch (algorithm) {
+ case QSsl::Rsa:
+ q_EVP_PKEY_set1_RSA(handle, static_cast<RSA *>(key.handle()));
+ break;
+ case QSsl::Dsa:
+ q_EVP_PKEY_set1_DSA(handle, static_cast<DSA *>(key.handle()));
+ break;
+ case QSsl::Dh:
+ q_EVP_PKEY_set1_DH(handle, static_cast<DH *>(key.handle()));
+ break;
+#ifndef OPENSSL_NO_EC
+ case QSsl::Ec:
+ q_EVP_PKEY_set1_EC_KEY(handle, static_cast<EC_KEY *>(key.handle()));
+ break;
+#endif
+ default:
+ break;
+ }
+
+ auto cleanup = qScopeGuard([origin, handle] {
+ q_EVP_PKEY_free(origin);
+ q_EVP_PKEY_free(handle);
+ });
+
QVERIFY(!key.isNull());
QCOMPARE(key.algorithm(), algorithm);
QCOMPARE(key.type(), type);
QCOMPARE(key.length(), length);
+ QCOMPARE(q_EVP_PKEY_cmp(origin, handle), 1);
#endif
}
@@ -430,15 +466,25 @@ void tst_QSslKey::toEncryptedPemOrDer()
void tst_QSslKey::passphraseChecks_data()
{
QTest::addColumn<QString>("fileName");
-
- QTest::newRow("DES") << (testDataDir + "rsa-with-passphrase-des.pem");
- QTest::newRow("3DES") << (testDataDir + "rsa-with-passphrase-3des.pem");
- QTest::newRow("RC2") << (testDataDir + "rsa-with-passphrase-rc2.pem");
+ QTest::addColumn<QByteArray>("passphrase");
+
+ const QByteArray pass("123");
+ const QByteArray aesPass("1234");
+
+ QTest::newRow("DES") << QString(testDataDir + "rsa-with-passphrase-des.pem") << pass;
+ QTest::newRow("3DES") << QString(testDataDir + "rsa-with-passphrase-3des.pem") << pass;
+ QTest::newRow("RC2") << QString(testDataDir + "rsa-with-passphrase-rc2.pem") << pass;
+#if (!defined(QT_NO_OPENSSL) && !defined(OPENSSL_NO_AES)) || (defined(QT_NO_OPENSSL) && QT_CONFIG(ssl))
+ QTest::newRow("AES128") << QString(testDataDir + "rsa-with-passphrase-aes128.pem") << aesPass;
+ QTest::newRow("AES192") << QString(testDataDir + "rsa-with-passphrase-aes192.pem") << aesPass;
+ QTest::newRow("AES256") << QString(testDataDir + "rsa-with-passphrase-aes256.pem") << aesPass;
+#endif // (OpenSSL && AES) || generic backend
}
void tst_QSslKey::passphraseChecks()
{
QFETCH(QString, fileName);
+ QFETCH(QByteArray, passphrase);
QFile keyFile(fileName);
QVERIFY(keyFile.exists());
@@ -471,7 +517,7 @@ void tst_QSslKey::passphraseChecks()
keyFile.open(QIODevice::ReadOnly);
else
keyFile.reset();
- QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, "123");
+ QSslKey key(&keyFile,QSsl::Rsa,QSsl::Pem, QSsl::PrivateKey, passphrase);
QVERIFY(!key.isNull()); // correct passphrase
}
}
@@ -516,79 +562,135 @@ void tst_QSslKey::encrypt_data()
QTest::addColumn<QByteArray>("key");
QTest::addColumn<QByteArray>("plainText");
QTest::addColumn<QByteArray>("cipherText");
+ QTest::addColumn<QByteArray>("iv");
+ QByteArray iv("abcdefgh");
QTest::newRow("DES-CBC, length 0")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray()
- << QByteArray::fromHex("956585228BAF9B1F");
+ << QByteArray::fromHex("956585228BAF9B1F")
+ << iv;
QTest::newRow("DES-CBC, length 1")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(1, 'a')
- << QByteArray::fromHex("E6880AF202BA3C12");
+ << QByteArray::fromHex("E6880AF202BA3C12")
+ << iv;
QTest::newRow("DES-CBC, length 2")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(2, 'a')
- << QByteArray::fromHex("A82492386EED6026");
+ << QByteArray::fromHex("A82492386EED6026")
+ << iv;
QTest::newRow("DES-CBC, length 3")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(3, 'a')
- << QByteArray::fromHex("90B76D5B79519CBA");
+ << QByteArray::fromHex("90B76D5B79519CBA")
+ << iv;
QTest::newRow("DES-CBC, length 4")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(4, 'a')
- << QByteArray::fromHex("63E3DD6FED87052A");
+ << QByteArray::fromHex("63E3DD6FED87052A")
+ << iv;
QTest::newRow("DES-CBC, length 5")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(5, 'a')
- << QByteArray::fromHex("03ACDB0EACBDFA94");
+ << QByteArray::fromHex("03ACDB0EACBDFA94")
+ << iv;
QTest::newRow("DES-CBC, length 6")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(6, 'a')
- << QByteArray::fromHex("7D95024E42A3A88A");
+ << QByteArray::fromHex("7D95024E42A3A88A")
+ << iv;
QTest::newRow("DES-CBC, length 7")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(7, 'a')
- << QByteArray::fromHex("5003436B8A8E42E9");
+ << QByteArray::fromHex("5003436B8A8E42E9")
+ << iv;
QTest::newRow("DES-CBC, length 8")
<< QSslKeyPrivate::DesCbc << QByteArray("01234567")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("E4C1F054BF5521C0A4A0FD4A2BC6C1B1");
+ << QByteArray::fromHex("E4C1F054BF5521C0A4A0FD4A2BC6C1B1")
+ << iv;
QTest::newRow("DES-EDE3-CBC, length 0")
<< QSslKeyPrivate::DesEde3Cbc << QByteArray("0123456789abcdefghijklmn")
<< QByteArray()
- << QByteArray::fromHex("3B2B4CD0B0FD495F");
+ << QByteArray::fromHex("3B2B4CD0B0FD495F")
+ << iv;
QTest::newRow("DES-EDE3-CBC, length 8")
<< QSslKeyPrivate::DesEde3Cbc << QByteArray("0123456789abcdefghijklmn")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("F2A5A87763C54A72A3224103D90CDB03");
+ << QByteArray::fromHex("F2A5A87763C54A72A3224103D90CDB03")
+ << iv;
QTest::newRow("RC2-40-CBC, length 0")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234")
<< QByteArray()
- << QByteArray::fromHex("6D05D52392FF6E7A");
+ << QByteArray::fromHex("6D05D52392FF6E7A")
+ << iv;
QTest::newRow("RC2-40-CBC, length 8")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("75768E64C5749072A5D168F3AFEB0005");
+ << QByteArray::fromHex("75768E64C5749072A5D168F3AFEB0005")
+ << iv;
QTest::newRow("RC2-64-CBC, length 0")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234567")
<< QByteArray()
- << QByteArray::fromHex("ADAE6BF70F420130");
+ << QByteArray::fromHex("ADAE6BF70F420130")
+ << iv;
QTest::newRow("RC2-64-CBC, length 8")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("01234567")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("C7BF5C80AFBE9FBEFBBB9FD935F6D0DF");
+ << QByteArray::fromHex("C7BF5C80AFBE9FBEFBBB9FD935F6D0DF")
+ << iv;
QTest::newRow("RC2-128-CBC, length 0")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("012345679abcdefg")
<< QByteArray()
- << QByteArray::fromHex("1E965D483A13C8FB");
+ << QByteArray::fromHex("1E965D483A13C8FB")
+ << iv;
QTest::newRow("RC2-128-CBC, length 8")
<< QSslKeyPrivate::Rc2Cbc << QByteArray("012345679abcdefg")
<< QByteArray(8, 'a')
- << QByteArray::fromHex("5AEC1A5B295660B02613454232F7DECE");
+ << QByteArray::fromHex("5AEC1A5B295660B02613454232F7DECE")
+ << iv;
+
+#if (!defined(QT_NO_OPENSSL) && !defined(OPENSSL_NO_AES)) || (defined(QT_NO_OPENSSL) && QT_CONFIG(ssl))
+ // AES needs a longer IV
+ iv = QByteArray("abcdefghijklmnop");
+ QTest::newRow("AES-128-CBC, length 0")
+ << QSslKeyPrivate::Aes128Cbc << QByteArray("012345679abcdefg")
+ << QByteArray()
+ << QByteArray::fromHex("28DE1A9AA26601C30DD2527407121D1A")
+ << iv;
+ QTest::newRow("AES-128-CBC, length 8")
+ << QSslKeyPrivate::Aes128Cbc << QByteArray("012345679abcdefg")
+ << QByteArray(8, 'a')
+ << QByteArray::fromHex("08E880B1BA916F061C1E801D7F44D0EC")
+ << iv;
+
+ QTest::newRow("AES-192-CBC, length 0")
+ << QSslKeyPrivate::Aes192Cbc << QByteArray("0123456789abcdefghijklmn")
+ << QByteArray()
+ << QByteArray::fromHex("E169E0E205CDC2BA895B7CF6097673B1")
+ << iv;
+ QTest::newRow("AES-192-CBC, length 8")
+ << QSslKeyPrivate::Aes192Cbc << QByteArray("0123456789abcdefghijklmn")
+ << QByteArray(8, 'a')
+ << QByteArray::fromHex("3A227D6A3A13237316D30AA17FF9B0A7")
+ << iv;
+
+ QTest::newRow("AES-256-CBC, length 0")
+ << QSslKeyPrivate::Aes256Cbc << QByteArray("0123456789abcdefghijklmnopqrstuv")
+ << QByteArray()
+ << QByteArray::fromHex("4BAACAA0D22199C97DE206C465B7B14A")
+ << iv;
+ QTest::newRow("AES-256-CBC, length 8")
+ << QSslKeyPrivate::Aes256Cbc << QByteArray("0123456789abcdefghijklmnopqrstuv")
+ << QByteArray(8, 'a')
+ << QByteArray::fromHex("879C8C25EC135CDF0B14490A0A7C2F67")
+ << iv;
+#endif // (OpenSSL && AES) || generic backend
}
void tst_QSslKey::encrypt()
@@ -597,7 +699,7 @@ void tst_QSslKey::encrypt()
QFETCH(QByteArray, key);
QFETCH(QByteArray, plainText);
QFETCH(QByteArray, cipherText);
- QByteArray iv("abcdefgh");
+ QFETCH(QByteArray, iv);
#if defined(Q_OS_WINRT) || QT_CONFIG(schannel)
QEXPECT_FAIL("RC2-40-CBC, length 0", "WinRT/Schannel treats RC2 as 128-bit", Abort);
diff --git a/tests/auto/network/ssl/qsslsocket/BLACKLIST b/tests/auto/network/ssl/qsslsocket/BLACKLIST
index 555822d1e6..7b4a29f463 100644
--- a/tests/auto/network/ssl/qsslsocket/BLACKLIST
+++ b/tests/auto/network/ssl/qsslsocket/BLACKLIST
@@ -1,7 +1,11 @@
+[deprecatedProtocols]
windows
+[spontaneousWrite]
+windows-7sp1
[connectToHostEncrypted]
osx-10.13
[setSslConfiguration]
-osx-10.13
+windows-10 msvc-2015
+windows-7sp1
[connectToHostEncryptedWithVerificationPeerName]
osx-10.13
diff --git a/tests/auto/network/ssl/qsslsocket/certs/qt-test-server-cert.pem b/tests/auto/network/ssl/qsslsocket/certs/qt-test-server-cert.pem
new file mode 100644
index 0000000000..43c8794ce2
--- /dev/null
+++ b/tests/auto/network/ssl/qsslsocket/certs/qt-test-server-cert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIIClTCCAf4CCQC2xMhNhwvATDANBgkqhkiG9w0BAQQFADCBjjELMAkGA1UEChMC
+UXQxGTAXBgNVBAsTEENvcmUgQW5kIE5ldHdvcmsxGzAZBgkqhkiG9w0BCQEWDG5v
+Ym9keS5xdC5pbzENMAsGA1UEBxMET3NsbzENMAsGA1UECBMET3NsbzELMAkGA1UE
+BhMCTk8xHDAaBgNVBAMUEyoudGVzdC1uZXQucXQubG9jYWwwHhcNMTgwNzAxMTgz
+NjI3WhcNNDgwNjIzMTgzNjI3WjCBjjELMAkGA1UEChMCUXQxGTAXBgNVBAsTEENv
+cmUgQW5kIE5ldHdvcmsxGzAZBgkqhkiG9w0BCQEWDG5vYm9keS5xdC5pbzENMAsG
+A1UEBxMET3NsbzENMAsGA1UECBMET3NsbzELMAkGA1UEBhMCTk8xHDAaBgNVBAMU
+EyoudGVzdC1uZXQucXQubG9jYWwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AM2q22/WNMmn8cC+5EEYGeICySLmp9W6Ay6eKHr0Xxp3X3epETuPfvAuxp7rOtkS
+18EMUegkUj8jw0IMEcbyHKFC/rTCaYOt93CxGBXMIChiMPAsFeYzGa/D6xzAkfcR
+aJRQ+Ek3CDLXPnXfo7xpABXezYcPXAJrgsgBfWrwHdxzAgMBAAEwDQYJKoZIhvcN
+AQEEBQADgYEAZu/lQPy8PXeyyYGamOVms/FZKJ48BH1y8KC3BeBU5FYnhvgG7pz8
+Wz9JKvt2t/r45wQeAkNL6HnGUBhPJsHMjPHl5KktqN+db3D+FQygBeS2V1+zmC0X
+UZNRE4aWiHvt1Lq+pTx89SOMOpfqWfh4qTQKiE5jC2V4DeCNQ3u7uI8=
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
index 1260dc9410..51fcff9a8d 100644
--- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
+++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
@@ -18,3 +18,10 @@ TESTDATA += certs
DEFINES += SRCDIR=\\\"$$PWD/\\\"
requires(qtConfig(private_tests))
+
+# DOCKERTODO: it's 'linux' because it requires cyrus, which
+# is linux-only for now ...
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = squid danted cyrus apache2 echo
+}
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 79ea505d11..e599ebf199 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -29,6 +29,7 @@
#include <QtCore/qglobal.h>
#include <QtCore/qthread.h>
+#include <QtCore/qelapsedtimer.h>
#include <QtNetwork/qhostaddress.h>
#include <QtNetwork/qhostinfo.h>
#include <QtNetwork/qnetworkproxy.h>
@@ -312,6 +313,21 @@ Q_DECLARE_METATYPE(tst_QSslSocket::PskConnectTestType)
int tst_QSslSocket::loopLevel = 0;
+namespace {
+
+QString httpServerCertChainPath()
+{
+ // DOCKERTODO: note how we use CA certificate on the real server. The docker container
+ // is using a different cert with a "special" CN. Check if it's important!
+#ifdef QT_TEST_SERVER
+ return tst_QSslSocket::testDataDir + QStringLiteral("certs/qt-test-server-cert.pem");
+#else
+ return tst_QSslSocket::testDataDir + QStringLiteral("certs/qt-test-server-cacert.pem");
+#endif // QT_TEST_SERVER
+}
+
+} // unnamed namespace
+
tst_QSslSocket::tst_QSslSocket()
{
#ifndef QT_NO_SSL
@@ -365,8 +381,19 @@ void tst_QSslSocket::initTestCase()
qDebug("Using SSL library %s (%ld)",
qPrintable(QSslSocket::sslLibraryVersionString()),
QSslSocket::sslLibraryVersionNumber());
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1081));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3129));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3130));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 443));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::imapServerName(), 993));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::echoServerName(), 13));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
-#endif
+#endif // QT_TEST_SERVER
+#endif // QT_NO_SSL
}
void tst_QSslSocket::init()
@@ -375,28 +402,29 @@ void tst_QSslSocket::init()
if (setProxy) {
#ifndef QT_NO_NETWORKPROXY
QFETCH_GLOBAL(int, proxyType);
- QString fluke = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
+ const QString socksProxyAddr = QtNetworkSettings::socksProxyServerIp().toString();
+ const QString httpProxyAddr = QtNetworkSettings::httpProxyServerIp().toString();
QNetworkProxy proxy;
switch (proxyType) {
case Socks5Proxy:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, fluke, 1080);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socksProxyAddr, 1080);
break;
case Socks5Proxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, fluke, 1081);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socksProxyAddr, 1081);
break;
case HttpProxy | NoAuth:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, fluke, 3128);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, httpProxyAddr, 3128);
break;
case HttpProxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, fluke, 3129);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, httpProxyAddr, 3129);
break;
case HttpProxy | AuthNtlm:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, fluke, 3130);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, httpProxyAddr, 3130);
break;
}
QNetworkProxy::setApplicationProxy(proxy);
@@ -520,6 +548,7 @@ void tst_QSslSocket::constructing()
// verify that changing the default config doesn't affect this socket
// (on Unix, the ca certs might be empty, depending on whether we load
// them on demand or not, so set them explicitly)
+#if QT_DEPRECATED_SINCE(5, 5)
socket.setCaCertificates(QSslSocket::systemCaCertificates());
QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
QSslSocket::setDefaultCiphers(QList<QSslCipher>());
@@ -531,6 +560,25 @@ void tst_QSslSocket::constructing()
QVERIFY(QSslConfiguration::defaultConfiguration().ciphers().isEmpty());
QSslConfiguration::setDefaultConfiguration(savedDefault);
+#endif
+
+ auto sslConfig = socket.sslConfiguration();
+ sslConfig.setCaCertificates(QSslConfiguration::systemCaCertificates());
+ socket.setSslConfiguration(sslConfig);
+
+ auto defaultConfig = QSslConfiguration::defaultConfiguration();
+ defaultConfig.setCaCertificates(QList<QSslCertificate>());
+ defaultConfig.setCiphers(QList<QSslCipher>());
+ QSslConfiguration::setDefaultConfiguration(defaultConfig);
+
+ QVERIFY(!socket.sslConfiguration().caCertificates().isEmpty());
+ QVERIFY(!socket.sslConfiguration().ciphers().isEmpty());
+
+ // verify the default as well:
+ QVERIFY(QSslConfiguration::defaultConfiguration().caCertificates().isEmpty());
+ QVERIFY(QSslConfiguration::defaultConfiguration().ciphers().isEmpty());
+
+ QSslConfiguration::setDefaultConfiguration(savedDefault);
}
void tst_QSslSocket::simpleConnect()
@@ -557,7 +605,7 @@ void tst_QSslSocket::simpleConnect()
connect(&socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(exitLoop()));
// Start connecting
- socket.connectToHost(QtNetworkSettings::serverName(), 993);
+ socket.connectToHost(QtNetworkSettings::imapServerName(), 993);
QCOMPARE(socket.state(), QAbstractSocket::HostLookupState);
enterLoop(10);
@@ -612,7 +660,7 @@ void tst_QSslSocket::simpleConnectWithIgnore()
connect(&socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(exitLoop()));
// Start connecting
- socket.connectToHost(QtNetworkSettings::serverName(), 993);
+ socket.connectToHost(QtNetworkSettings::imapServerName(), 993);
QVERIFY(socket.state() != QAbstractSocket::UnconnectedState); // something must be in progress
enterLoop(10);
@@ -644,7 +692,7 @@ void tst_QSslSocket::sslErrors_data()
QString name = QtNetworkSettings::serverLocalName();
QTest::newRow(qPrintable(name)) << name << 993;
- name = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
+ name = QtNetworkSettings::httpServerIp().toString();
QTest::newRow(qPrintable(name)) << name << 443;
}
@@ -661,7 +709,20 @@ void tst_QSslSocket::sslErrors()
QSignalSpy sslErrorsSpy(socket.data(), SIGNAL(sslErrors(QList<QSslError>)));
QSignalSpy peerVerifyErrorSpy(socket.data(), SIGNAL(peerVerifyError(QSslError)));
- socket->connectToHostEncrypted(host, port);
+#ifdef QT_TEST_SERVER
+ // On the old test server we had the same certificate on different services.
+ // The idea of this test is to fail with 'HostNameMismatch', when we're using
+ // either serverLocalName() or IP address directly. With Docker we connect
+ // to IMAP server, and we have to connect using imapServerName() and passing
+ // 'host' as peerVerificationName to the overload of connectToHostEncrypted().
+ if (port == 993) {
+ socket->connectToHostEncrypted(QtNetworkSettings::imapServerName(), port, host);
+ } else
+#endif // QT_TEST_SERVER
+ {
+ socket->connectToHostEncrypted(host, port);
+ }
+
if (!socket->waitForConnected())
QSKIP("Skipping flaky test - See QTBUG-29941");
socket->waitForEncrypted(10000);
@@ -672,7 +733,7 @@ void tst_QSslSocket::sslErrors()
const auto socketSslErrors = socket->sslErrors();
for (const QSslError &err : socketSslErrors)
sslErrors << err.error();
- qSort(sslErrors);
+ std::sort(sslErrors.begin(), sslErrors.end());
QVERIFY(sslErrors.contains(QSslError::HostNameMismatch));
QVERIFY(sslErrors.contains(FLUKE_CERTIFICATE_ERROR));
@@ -682,7 +743,7 @@ void tst_QSslSocket::sslErrors()
const auto sslErrorsSpyErrors = qvariant_cast<QList<QSslError> >(qAsConst(sslErrorsSpy).first().first());
for (const QSslError &err : sslErrorsSpyErrors)
emittedErrors << err.error();
- qSort(emittedErrors);
+ std::sort(emittedErrors.begin(), emittedErrors.end());
QCOMPARE(sslErrors, emittedErrors);
// check the same errors were emitted by peerVerifyError
@@ -691,7 +752,7 @@ void tst_QSslSocket::sslErrors()
const QList<QVariantList> &peerVerifyList = peerVerifyErrorSpy;
for (const QVariantList &args : peerVerifyList)
peerErrors << qvariant_cast<QSslError>(args.first()).error();
- qSort(peerErrors);
+ std::sort(peerErrors.begin(), peerErrors.end());
QCOMPARE(sslErrors, peerErrors);
}
@@ -717,18 +778,41 @@ void tst_QSslSocket::ciphers()
{
if (!QSslSocket::supportsSsl())
return;
-
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ QSslSocket socket;
+ QCOMPARE(socket.ciphers(), QSslSocket::defaultCiphers());
+ socket.setCiphers(QList<QSslCipher>());
+ QVERIFY(socket.ciphers().isEmpty());
+ socket.setCiphers(socket.defaultCiphers());
+ QCOMPARE(socket.ciphers(), QSslSocket::defaultCiphers());
+ socket.setCiphers(socket.defaultCiphers());
+ QCOMPARE(socket.ciphers(), QSslSocket::defaultCiphers());
+
+ // Task 164356
+ socket.setCiphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
+ }
+#endif
QSslSocket socket;
- QCOMPARE(socket.ciphers(), QSslSocket::defaultCiphers());
- socket.setCiphers(QList<QSslCipher>());
- QVERIFY(socket.ciphers().isEmpty());
- socket.setCiphers(socket.defaultCiphers());
- QCOMPARE(socket.ciphers(), QSslSocket::defaultCiphers());
- socket.setCiphers(socket.defaultCiphers());
- QCOMPARE(socket.ciphers(), QSslSocket::defaultCiphers());
+ QCOMPARE(socket.sslConfiguration().ciphers(), QSslConfiguration::defaultConfiguration().ciphers());
+
+ auto sslConfig = socket.sslConfiguration();
+ sslConfig.setCiphers(QList<QSslCipher>());
+ socket.setSslConfiguration(sslConfig);
+ QVERIFY(socket.sslConfiguration().ciphers().isEmpty());
+
+ sslConfig.setCiphers(QSslConfiguration::defaultConfiguration().ciphers());
+ socket.setSslConfiguration(sslConfig);
+ QCOMPARE(socket.sslConfiguration().ciphers(), QSslConfiguration::defaultConfiguration().ciphers());
+
+ sslConfig.setCiphers(QSslConfiguration::defaultConfiguration().ciphers());
+ socket.setSslConfiguration(sslConfig);
+ QCOMPARE(socket.sslConfiguration().ciphers(), QSslConfiguration::defaultConfiguration().ciphers());
// Task 164356
- socket.setCiphers("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
+ sslConfig.setCiphers({QSslCipher("ALL"), QSslCipher("!ADH"), QSslCipher("!LOW"),
+ QSslCipher("!EXP"), QSslCipher("!MD5"), QSslCipher("@STRENGTH")});
+ socket.setSslConfiguration(sslConfig);
}
void tst_QSslSocket::connectToHostEncrypted()
@@ -741,13 +825,13 @@ void tst_QSslSocket::connectToHostEncrypted()
socket->setProtocol(QSsl::SslProtocol::TlsV1_1);
#endif
this->socket = socket.data();
- QVERIFY(socket->addCaCertificates(testDataDir + "certs/qt-test-server-cacert.pem"));
+ QVERIFY(socket->addCaCertificates(httpServerCertChainPath()));
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket.data(), SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
// This should pass unconditionally when using fluke's CA certificate.
// or use untrusted certificate workaround
@@ -760,7 +844,7 @@ void tst_QSslSocket::connectToHostEncrypted()
QCOMPARE(socket->mode(), QSslSocket::SslClientMode);
- socket->connectToHost(QtNetworkSettings::serverName(), 13);
+ socket->connectToHost(QtNetworkSettings::echoServerName(), 13);
QCOMPARE(socket->mode(), QSslSocket::UnencryptedMode);
@@ -778,14 +862,18 @@ void tst_QSslSocket::connectToHostEncryptedWithVerificationPeerName()
#endif
this->socket = socket.data();
- socket->addCaCertificates(testDataDir + "certs/qt-test-server-cacert.pem");
+ socket->addCaCertificates(httpServerCertChainPath());
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket.data(), SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
- // connect to the server with its local name, but use the full name for verification.
- socket->connectToHostEncrypted(QtNetworkSettings::serverLocalName(), 443, QtNetworkSettings::serverName());
+#ifdef QT_TEST_SERVER
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443, QtNetworkSettings::httpServerName());
+#else
+ // Connect to the server with its local name, but use the full name for verification.
+ socket->connectToHostEncrypted(QtNetworkSettings::serverLocalName(), 443, QtNetworkSettings::httpServerName());
+#endif
// This should pass unconditionally when using fluke's CA certificate.
QFETCH_GLOBAL(bool, setProxy);
@@ -807,7 +895,7 @@ void tst_QSslSocket::sessionCipher()
this->socket = socket.data();
connect(socket.data(), SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
QVERIFY(socket->sessionCipher().isNull());
- socket->connectToHost(QtNetworkSettings::serverName(), 443 /* https */);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443 /* https */);
QVERIFY2(socket->waitForConnected(10000), qPrintable(socket->errorString()));
QVERIFY(socket->sessionCipher().isNull());
socket->startClientEncryption();
@@ -815,11 +903,14 @@ void tst_QSslSocket::sessionCipher()
QSKIP("Skipping flaky test - See QTBUG-29941");
QVERIFY(!socket->sessionCipher().isNull());
- qDebug() << "Supported Ciphers:" << QSslSocket::supportedCiphers();
- qDebug() << "Default Ciphers:" << QSslSocket::defaultCiphers();
+ qDebug() << "Supported Ciphers:" << QSslConfiguration::supportedCiphers();
+ qDebug() << "Default Ciphers:" << QSslConfiguration::defaultConfiguration().ciphers();
qDebug() << "Session Cipher:" << socket->sessionCipher();
+#if QT_DEPRECATED_SINCE(5, 5)
QVERIFY(QSslSocket::supportedCiphers().contains(socket->sessionCipher()));
+#endif
+ QVERIFY(QSslConfiguration::supportedCiphers().contains(socket->sessionCipher()));
socket->disconnectFromHost();
QVERIFY(socket->waitForDisconnected());
}
@@ -842,12 +933,16 @@ void tst_QSslSocket::localCertificate()
// values. This test should just run the codepath inside qsslsocket_openssl.cpp
QSslSocketPtr socket = newSocket();
- QList<QSslCertificate> localCert = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
- socket->setCaCertificates(localCert);
+ QList<QSslCertificate> localCert = QSslCertificate::fromPath(httpServerCertChainPath());
+
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCaCertificates(localCert);
+ socket->setSslConfiguration(sslConfig);
+
socket->setLocalCertificate(testDataDir + "certs/fluke.cert");
socket->setPrivateKey(testDataDir + "certs/fluke.key");
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && !socket->waitForEncrypted(10000))
QSKIP("Skipping flaky test - See QTBUG-29941");
@@ -870,8 +965,7 @@ void tst_QSslSocket::peerCertificateChain()
QSslSocketPtr socket = newSocket();
this->socket = socket.data();
-
- QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(httpServerCertChainPath());
QCOMPARE(caCertificates.count(), 1);
socket->addCaCertificates(caCertificates);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
@@ -879,7 +973,7 @@ void tst_QSslSocket::peerCertificateChain()
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
#endif
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QCOMPARE(socket->mode(), QSslSocket::UnencryptedMode);
QVERIFY(socket->peerCertificateChain().isEmpty());
QFETCH_GLOBAL(bool, setProxy);
@@ -908,7 +1002,7 @@ void tst_QSslSocket::peerCertificateChain()
QVERIFY(socket->waitForDisconnected());
// now do it again back to the original server
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QCOMPARE(socket->mode(), QSslSocket::UnencryptedMode);
QVERIFY(socket->peerCertificateChain().isEmpty());
QVERIFY2(socket->waitForConnected(10000), qPrintable(socket->errorString()));
@@ -947,13 +1041,17 @@ void tst_QSslSocket::privateKeyOpaque()
// values. This test should just run the codepath inside qsslsocket_openssl.cpp
QSslSocketPtr socket = newSocket();
- QList<QSslCertificate> localCert = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
- socket->setCaCertificates(localCert);
+ QList<QSslCertificate> localCert = QSslCertificate::fromPath(httpServerCertChainPath());
+
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCaCertificates(localCert);
+ socket->setSslConfiguration(sslConfig);
+
socket->setLocalCertificate(testDataDir + "certs/fluke.cert");
socket->setPrivateKey(QSslKey(reinterpret_cast<Qt::HANDLE>(pkey)));
socket->setPeerVerifyMode(QSslSocket::QueryPeer);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && !socket->waitForEncrypted(10000))
QSKIP("Skipping flaky test - See QTBUG-29941");
@@ -967,9 +1065,12 @@ void tst_QSslSocket::protocol()
QSslSocketPtr socket = newSocket();
this->socket = socket.data();
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(httpServerCertChainPath());
+
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCaCertificates(certs);
+ socket->setSslConfiguration(sslConfig);
- socket->setCaCertificates(certs);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(untrustedWorkaroundSlot(QList<QSslError>)));
@@ -981,13 +1082,13 @@ void tst_QSslSocket::protocol()
// qt-test-server allows TLSV1.
socket->setProtocol(QSsl::TlsV1_0);
QCOMPARE(socket->protocol(), QSsl::TlsV1_0);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForEncrypted())
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->protocol(), QSsl::TlsV1_0);
socket->abort();
QCOMPARE(socket->protocol(), QSsl::TlsV1_0);
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
socket->startClientEncryption();
if (setProxy && !socket->waitForEncrypted())
@@ -1000,13 +1101,13 @@ void tst_QSslSocket::protocol()
// qt-test-server probably doesn't allow TLSV1.1
socket->setProtocol(QSsl::TlsV1_1);
QCOMPARE(socket->protocol(), QSsl::TlsV1_1);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForEncrypted())
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->protocol(), QSsl::TlsV1_1);
socket->abort();
QCOMPARE(socket->protocol(), QSsl::TlsV1_1);
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
socket->startClientEncryption();
if (setProxy && !socket->waitForEncrypted())
@@ -1018,13 +1119,13 @@ void tst_QSslSocket::protocol()
// qt-test-server probably doesn't allows TLSV1.2
socket->setProtocol(QSsl::TlsV1_2);
QCOMPARE(socket->protocol(), QSsl::TlsV1_2);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForEncrypted())
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->protocol(), QSsl::TlsV1_2);
socket->abort();
QCOMPARE(socket->protocol(), QSsl::TlsV1_2);
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
socket->startClientEncryption();
if (setProxy && !socket->waitForEncrypted())
@@ -1038,13 +1139,13 @@ void tst_QSslSocket::protocol()
// qt-test-server probably doesn't allow TLSV1.3
socket->setProtocol(QSsl::TlsV1_3);
QCOMPARE(socket->protocol(), QSsl::TlsV1_3);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForEncrypted())
QSKIP("TLS 1.3 is not supported by the test server or the test is flaky - see QTBUG-29941");
QCOMPARE(socket->protocol(), QSsl::TlsV1_3);
socket->abort();
QCOMPARE(socket->protocol(), QSsl::TlsV1_3);
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
socket->startClientEncryption();
if (setProxy && !socket->waitForEncrypted())
@@ -1057,13 +1158,13 @@ void tst_QSslSocket::protocol()
// qt-test-server allows SSLV3, so it allows AnyProtocol.
socket->setProtocol(QSsl::AnyProtocol);
QCOMPARE(socket->protocol(), QSsl::AnyProtocol);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForEncrypted())
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->protocol(), QSsl::AnyProtocol);
socket->abort();
QCOMPARE(socket->protocol(), QSsl::AnyProtocol);
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
socket->startClientEncryption();
if (setProxy && !socket->waitForEncrypted())
@@ -1075,13 +1176,13 @@ void tst_QSslSocket::protocol()
// qt-test-server allows TlsV1, so it allows TlsV1SslV3
socket->setProtocol(QSsl::TlsV1SslV3);
QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForEncrypted())
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
socket->abort();
QCOMPARE(socket->protocol(), QSsl::TlsV1SslV3);
- socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ socket->connectToHost(QtNetworkSettings::httpServerName(), 443);
if (setProxy && !socket->waitForConnected())
QSKIP("Skipping flaky test - See QTBUG-29941");
socket->startClientEncryption();
@@ -1117,7 +1218,7 @@ public:
QString m_keyFile;
QString m_certFile;
QString m_interFile;
- QString ciphers;
+ QList<QSslCipher> ciphers;
signals:
void socketError(QAbstractSocket::SocketError);
@@ -1167,7 +1268,9 @@ protected:
}
if (!ciphers.isEmpty()) {
- socket->setCiphers(ciphers);
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCiphers(ciphers);
+ socket->setSslConfiguration(sslConfig);
}
QVERIFY(socket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState));
@@ -1317,7 +1420,7 @@ void tst_QSslSocket::serverCipherPreferences()
// First using the default (server preference)
{
SslServer server;
- server.ciphers = QString("AES128-SHA:AES256-SHA");
+ server.ciphers = {QSslCipher("AES128-SHA"), QSslCipher("AES256-SHA")};
QVERIFY(server.listen());
QEventLoop loop;
@@ -1325,7 +1428,10 @@ void tst_QSslSocket::serverCipherPreferences()
QSslSocket client;
socket = &client;
- socket->setCiphers("AES256-SHA:AES128-SHA");
+
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCiphers({QSslCipher("AES256-SHA"), QSslCipher("AES128-SHA")});
+ socket->setSslConfiguration(sslConfig);
// upon SSL wrong version error, error will be triggered, not sslErrors
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
@@ -1346,7 +1452,7 @@ void tst_QSslSocket::serverCipherPreferences()
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setSslOption(QSsl::SslOptionDisableServerCipherPreference, true);
server.config = config;
- server.ciphers = QString("AES128-SHA:AES256-SHA");
+ server.ciphers = {QSslCipher("AES128-SHA"), QSslCipher("AES256-SHA")};
QVERIFY(server.listen());
QEventLoop loop;
@@ -1354,7 +1460,10 @@ void tst_QSslSocket::serverCipherPreferences()
QSslSocket client;
socket = &client;
- socket->setCiphers("AES256-SHA:AES128-SHA");
+
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCiphers({QSslCipher("AES256-SHA"), QSslCipher("AES128-SHA")});
+ socket->setSslConfiguration(sslConfig);
// upon SSL wrong version error, error will be triggered, not sslErrors
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
@@ -1378,12 +1487,30 @@ void tst_QSslSocket::setCaCertificates()
if (!QSslSocket::supportsSsl())
return;
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ QSslSocket socket;
+ QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
+ socket.setCaCertificates(QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem"));
+ QCOMPARE(socket.caCertificates().size(), 1);
+ socket.setCaCertificates(socket.defaultCaCertificates());
+ QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
+ }
+#endif
QSslSocket socket;
- QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
- socket.setCaCertificates(QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem"));
- QCOMPARE(socket.caCertificates().size(), 1);
- socket.setCaCertificates(socket.defaultCaCertificates());
- QCOMPARE(socket.caCertificates(), QSslSocket::defaultCaCertificates());
+ QCOMPARE(socket.sslConfiguration().caCertificates(),
+ QSslConfiguration::defaultConfiguration().caCertificates());
+
+ auto sslConfig = socket.sslConfiguration();
+ sslConfig.setCaCertificates(
+ QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem"));
+ socket.setSslConfiguration(sslConfig);
+ QCOMPARE(socket.sslConfiguration().caCertificates().size(), 1);
+
+ sslConfig.setCaCertificates(QSslConfiguration::defaultConfiguration().caCertificates());
+ socket.setSslConfiguration(sslConfig);
+ QCOMPARE(socket.sslConfiguration().caCertificates(),
+ QSslConfiguration::defaultConfiguration().caCertificates());
}
void tst_QSslSocket::setLocalCertificate()
@@ -1493,7 +1620,7 @@ void tst_QSslSocket::setSslConfiguration_data()
QTest::newRow("empty") << QSslConfiguration() << false;
QSslConfiguration conf = QSslConfiguration::defaultConfiguration();
QTest::newRow("default") << conf << false; // does not contain test server cert
- QList<QSslCertificate> testServerCert = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> testServerCert = QSslCertificate::fromPath(httpServerCertChainPath());
conf.setCaCertificates(testServerCert);
QTest::newRow("set-root-cert") << conf << true;
conf.setProtocol(QSsl::SecureProtocols);
@@ -1512,7 +1639,7 @@ void tst_QSslSocket::setSslConfiguration()
socket->setProtocol(QSsl::SslProtocol::TlsV1_1);
#endif
this->socket = socket.data();
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH(bool, works);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && (socket->waitForEncrypted(10000) != works))
@@ -1532,7 +1659,7 @@ void tst_QSslSocket::waitForEncrypted()
this->socket = socket.data();
connect(this->socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && !socket->waitForEncrypted(10000))
@@ -1551,7 +1678,7 @@ void tst_QSslSocket::waitForEncryptedMinusOne()
this->socket = socket.data();
connect(this->socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && !socket->waitForEncrypted(-1))
@@ -1567,7 +1694,7 @@ void tst_QSslSocket::waitForConnectedEncryptedReadyRead()
this->socket = socket.data();
connect(this->socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
+ socket->connectToHostEncrypted(QtNetworkSettings::imapServerName(), 993);
QVERIFY2(socket->waitForConnected(10000), qPrintable(socket->errorString()));
QFETCH_GLOBAL(bool, setProxy);
@@ -1596,19 +1723,43 @@ void tst_QSslSocket::addDefaultCaCertificate()
if (!QSslSocket::supportsSsl())
return;
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ // Reset the global CA chain
+ QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+
+ QList<QSslCertificate> flukeCerts = QSslCertificate::fromPath(httpServerCertChainPath());
+ QCOMPARE(flukeCerts.size(), 1);
+ QList<QSslCertificate> globalCerts = QSslSocket::defaultCaCertificates();
+ QVERIFY(!globalCerts.contains(flukeCerts.first()));
+ QSslSocket::addDefaultCaCertificate(flukeCerts.first());
+ QCOMPARE(QSslSocket::defaultCaCertificates().size(), globalCerts.size() + 1);
+ QVERIFY(QSslSocket::defaultCaCertificates().contains(flukeCerts.first()));
+
+ // Restore the global CA chain
+ QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+ }
+#endif
+
// Reset the global CA chain
- QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+ auto sslConfig = QSslConfiguration::defaultConfiguration();
+ sslConfig.setCaCertificates(QSslConfiguration::systemCaCertificates());
+ QSslConfiguration::setDefaultConfiguration(sslConfig);
- QList<QSslCertificate> flukeCerts = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> flukeCerts = QSslCertificate::fromPath(httpServerCertChainPath());
QCOMPARE(flukeCerts.size(), 1);
- QList<QSslCertificate> globalCerts = QSslSocket::defaultCaCertificates();
+ QList<QSslCertificate> globalCerts = QSslConfiguration::defaultConfiguration().caCertificates();
QVERIFY(!globalCerts.contains(flukeCerts.first()));
QSslSocket::addDefaultCaCertificate(flukeCerts.first());
- QCOMPARE(QSslSocket::defaultCaCertificates().size(), globalCerts.size() + 1);
- QVERIFY(QSslSocket::defaultCaCertificates().contains(flukeCerts.first()));
+ QCOMPARE(QSslConfiguration::defaultConfiguration().caCertificates().size(),
+ globalCerts.size() + 1);
+ QVERIFY(QSslConfiguration::defaultConfiguration().caCertificates()
+ .contains(flukeCerts.first()));
// Restore the global CA chain
- QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+ sslConfig = QSslConfiguration::defaultConfiguration();
+ sslConfig.setCaCertificates(QSslConfiguration::systemCaCertificates());
+ QSslConfiguration::setDefaultConfiguration(sslConfig);
}
void tst_QSslSocket::addDefaultCaCertificates()
@@ -1624,9 +1775,16 @@ void tst_QSslSocket::defaultCaCertificates()
if (!QSslSocket::supportsSsl())
return;
- QList<QSslCertificate> certs = QSslSocket::defaultCaCertificates();
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ QList<QSslCertificate> certs = QSslSocket::defaultCaCertificates();
+ QVERIFY(certs.size() > 1);
+ QCOMPARE(certs, QSslSocket::systemCaCertificates());
+ }
+#endif
+ QList<QSslCertificate> certs = QSslConfiguration::defaultConfiguration().caCertificates();
QVERIFY(certs.size() > 1);
- QCOMPARE(certs, QSslSocket::systemCaCertificates());
+ QCOMPARE(certs, QSslConfiguration::systemCaCertificates());
}
void tst_QSslSocket::defaultCiphers()
@@ -1634,12 +1792,22 @@ void tst_QSslSocket::defaultCiphers()
if (!QSslSocket::supportsSsl())
return;
- QList<QSslCipher> ciphers = QSslSocket::defaultCiphers();
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ QList<QSslCipher> ciphers = QSslSocket::defaultCiphers();
+ QVERIFY(ciphers.size() > 1);
+
+ QSslSocket socket;
+ QCOMPARE(socket.defaultCiphers(), ciphers);
+ QCOMPARE(socket.ciphers(), ciphers);
+ }
+#endif
+ QList<QSslCipher> ciphers = QSslConfiguration::defaultConfiguration().ciphers();
QVERIFY(ciphers.size() > 1);
QSslSocket socket;
- QCOMPARE(socket.defaultCiphers(), ciphers);
- QCOMPARE(socket.ciphers(), ciphers);
+ QCOMPARE(socket.sslConfiguration().defaultConfiguration().ciphers(), ciphers);
+ QCOMPARE(socket.sslConfiguration().ciphers(), ciphers);
}
void tst_QSslSocket::resetDefaultCiphers()
@@ -1659,11 +1827,21 @@ void tst_QSslSocket::supportedCiphers()
if (!QSslSocket::supportsSsl())
return;
- QList<QSslCipher> ciphers = QSslSocket::supportedCiphers();
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ QList<QSslCipher> ciphers = QSslSocket::supportedCiphers();
+ QVERIFY(ciphers.size() > 1);
+
+ QSslSocket socket;
+ QCOMPARE(socket.supportedCiphers(), ciphers);
+ }
+#endif
+
+ QList<QSslCipher> ciphers = QSslConfiguration::supportedCiphers();
QVERIFY(ciphers.size() > 1);
QSslSocket socket;
- QCOMPARE(socket.supportedCiphers(), ciphers);
+ QCOMPARE(socket.sslConfiguration().supportedCiphers(), ciphers);
}
void tst_QSslSocket::systemCaCertificates()
@@ -1671,9 +1849,16 @@ void tst_QSslSocket::systemCaCertificates()
if (!QSslSocket::supportsSsl())
return;
- QList<QSslCertificate> certs = QSslSocket::systemCaCertificates();
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ QList<QSslCertificate> certs = QSslSocket::systemCaCertificates();
+ QVERIFY(certs.size() > 1);
+ QCOMPARE(certs, QSslSocket::defaultCaCertificates());
+ }
+#endif
+ QList<QSslCertificate> certs = QSslConfiguration::systemCaCertificates();
QVERIFY(certs.size() > 1);
- QCOMPARE(certs, QSslSocket::defaultCaCertificates());
+ QCOMPARE(certs, QSslConfiguration::defaultConfiguration().systemCaCertificates());
}
void tst_QSslSocket::wildcardCertificateNames()
@@ -1948,7 +2133,7 @@ public slots:
QTestEventLoop::instance().exitLoop();
}
void waitSomeMore(QSslSocket *socket) {
- QTime t;
+ QElapsedTimer t;
t.start();
while (!socket->encryptedBytesAvailable()) {
QCoreApplication::processEvents(QEventLoop::AllEvents | QEventLoop::WaitForMoreEvents, 250);
@@ -1970,7 +2155,7 @@ void tst_QSslSocket::setReadBufferSize_task_250027()
QSslSocketPtr socket = newSocket();
socket->setReadBufferSize(1000); // limit to 1 kb/sec
socket->ignoreSslErrors();
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
socket->ignoreSslErrors();
QVERIFY2(socket->waitForConnected(10*1000), qPrintable(socket->errorString()));
if (setProxy && !socket->waitForEncrypted(10*1000))
@@ -1983,7 +2168,7 @@ void tst_QSslSocket::setReadBufferSize_task_250027()
// provoke a response by sending a request
socket->write("GET /qtest/fluke.gif HTTP/1.0\n"); // this file is 27 KB
socket->write("Host: ");
- socket->write(QtNetworkSettings::serverName().toLocal8Bit().constData());
+ socket->write(QtNetworkSettings::httpServerName().toLocal8Bit().constData());
socket->write("\n");
socket->write("Connection: close\n");
socket->write("\n");
@@ -2234,7 +2419,7 @@ void tst_QSslSocket::verifyMode()
socket.setPeerVerifyMode(QSslSocket::VerifyPeer);
QCOMPARE(socket.peerVerifyMode(), QSslSocket::VerifyPeer);
- socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
if (socket.waitForEncrypted())
QSKIP("Skipping flaky test - See QTBUG-29941");
@@ -2273,7 +2458,7 @@ void tst_QSslSocket::verifyDepth()
void tst_QSslSocket::disconnectFromHostWhenConnecting()
{
QSslSocketPtr socket = newSocket();
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
+ socket->connectToHostEncrypted(QtNetworkSettings::imapServerName(), 993);
socket->ignoreSslErrors();
socket->write("XXXX LOGOUT\r\n");
QAbstractSocket::SocketState state = socket->state();
@@ -2302,7 +2487,7 @@ void tst_QSslSocket::disconnectFromHostWhenConnecting()
void tst_QSslSocket::disconnectFromHostWhenConnected()
{
QSslSocketPtr socket = newSocket();
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
+ socket->connectToHostEncrypted(QtNetworkSettings::imapServerName(), 993);
socket->ignoreSslErrors();
if (!socket->waitForEncrypted(5000))
QSKIP("Skipping flaky test - See QTBUG-29941");
@@ -2389,13 +2574,13 @@ void tst_QSslSocket::resetProxy()
// make sure the connection works, and then set a nonsense proxy, and then
// make sure it does not work anymore
QSslSocket socket;
- socket.addCaCertificates(testDataDir + "certs/qt-test-server-cacert.pem");
+ socket.addCaCertificates(httpServerCertChainPath());
socket.setProxy(goodProxy);
- socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket.waitForConnected(10000), qPrintable(socket.errorString()));
socket.abort();
socket.setProxy(badProxy);
- socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QVERIFY(! socket.waitForConnected(10000));
// don't forget to login
@@ -2408,13 +2593,13 @@ void tst_QSslSocket::resetProxy()
// set the nonsense proxy and make sure the connection does not work,
// and then set the right proxy and make sure it works
QSslSocket socket2;
- socket2.addCaCertificates(testDataDir + "certs/qt-test-server-cacert.pem");
+ socket2.addCaCertificates(httpServerCertChainPath());
socket2.setProxy(badProxy);
- socket2.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket2.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QVERIFY(! socket2.waitForConnected(10000));
socket2.abort();
socket2.setProxy(goodProxy);
- socket2.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket2.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QVERIFY2(socket2.waitForConnected(10000), qPrintable(socket.errorString()));
#endif // QT_NO_NETWORKPROXY
}
@@ -2427,7 +2612,7 @@ void tst_QSslSocket::ignoreSslErrorsList_data()
// construct the list of errors that we will get with the SSL handshake and that we will ignore
QList<QSslError> expectedSslErrors;
// fromPath gives us a list of certs, but it actually only contains one
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(httpServerCertChainPath());
QSslError rightError(FLUKE_CERTIFICATE_ERROR, certs.at(0));
QSslError wrongError(FLUKE_CERTIFICATE_ERROR);
@@ -2458,7 +2643,7 @@ void tst_QSslSocket::ignoreSslErrorsList()
QFETCH(int, expectedSslErrorSignalCount);
QSignalSpy sslErrorsSpy(&socket, SIGNAL(error(QAbstractSocket::SocketError)));
- socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
bool expectEncryptionSuccess = (expectedSslErrorSignalCount == 0);
if (socket.waitForEncrypted(10000) != expectEncryptionSuccess)
@@ -2489,7 +2674,7 @@ void tst_QSslSocket::ignoreSslErrorsListWithSlot()
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
connect(&socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(ignoreErrorListSlot(QList<QSslError>)));
- socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH(int, expectedSslErrorSignalCount);
bool expectEncryptionSuccess = (expectedSslErrorSignalCount == 0);
@@ -2531,14 +2716,14 @@ void tst_QSslSocket::readFromClosedSocket()
socket->setProtocol(QSsl::SslProtocol::TlsV1_1);
#endif
socket->ignoreSslErrors();
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
socket->ignoreSslErrors();
socket->waitForConnected();
socket->waitForEncrypted();
// provoke a response by sending a request
socket->write("GET /qtest/fluke.gif HTTP/1.1\n");
socket->write("Host: ");
- socket->write(QtNetworkSettings::serverName().toLocal8Bit().constData());
+ socket->write(QtNetworkSettings::httpServerName().toLocal8Bit().constData());
socket->write("\n");
socket->write("\n");
socket->waitForBytesWritten();
@@ -2562,7 +2747,7 @@ void tst_QSslSocket::writeBigChunk()
this->socket = socket.data();
connect(this->socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QByteArray data;
data.resize(1024*1024*10); // 10 MB
@@ -2721,7 +2906,9 @@ void tst_QSslSocket::resume_data()
QTest::newRow("DoNotIgnoreErrors") << false << QList<QSslError>() << false;
QTest::newRow("ignoreAllErrors") << true << QList<QSslError>() << true;
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "certs/qt-test-server-cacert.pem");
+ // Note, httpServerCertChainPath() it's ... because we use the same certificate on
+ // different services. We'll be actually connecting to IMAP server.
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(httpServerCertChainPath());
QSslError rightError(FLUKE_CERTIFICATE_ERROR, certs.at(0));
QSslError wrongError(FLUKE_CERTIFICATE_ERROR);
errorsList.append(wrongError);
@@ -2735,7 +2922,9 @@ void tst_QSslSocket::resume()
{
// make sure the server certificate is not in the list of accepted certificates,
// we want to trigger the sslErrors signal
- QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+ auto sslConfig = QSslConfiguration::defaultConfiguration();
+ sslConfig.setCaCertificates(QSslConfiguration::systemCaCertificates());
+ QSslConfiguration::setDefaultConfiguration(sslConfig);
QFETCH(bool, ignoreErrorsAfterPause);
QFETCH(QList<QSslError>, errorsToIgnore);
@@ -2754,7 +2943,7 @@ void tst_QSslSocket::resume()
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- socket.connectToHostEncrypted(QtNetworkSettings::serverName(), 993);
+ socket.connectToHostEncrypted(QtNetworkSettings::imapServerName(), 993);
QTestEventLoop::instance().enterLoop(10);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && QTestEventLoop::instance().timeout())
@@ -3055,7 +3244,7 @@ void tst_QSslSocket::dhServer()
return;
SslServer server;
- server.ciphers = QLatin1String("DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA");
+ server.ciphers = {QSslCipher("DHE-RSA-AES256-SHA"), QSslCipher("DHE-DSS-AES256-SHA")};
QVERIFY(server.listen());
QEventLoop loop;
@@ -3084,7 +3273,7 @@ void tst_QSslSocket::dhServerCustomParamsNull()
return;
SslServer server;
- server.ciphers = QLatin1String("DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA");
+ server.ciphers = {QSslCipher("DHE-RSA-AES256-SHA"), QSslCipher("DHE-DSS-AES256-SHA")};
QSslConfiguration cfg = server.config;
cfg.setDiffieHellmanParameters(QSslDiffieHellmanParameters());
@@ -3120,7 +3309,7 @@ void tst_QSslSocket::dhServerCustomParams()
return;
SslServer server;
- server.ciphers = QLatin1String("DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA");
+ server.ciphers = {QSslCipher("DHE-RSA-AES256-SHA"), QSslCipher("DHE-DSS-AES256-SHA")};
QSslConfiguration cfg = server.config;
@@ -3169,7 +3358,7 @@ void tst_QSslSocket::ecdhServer()
return;
SslServer server;
- server.ciphers = QLatin1String("ECDHE-RSA-AES128-SHA");
+ server.ciphers = {QSslCipher("ECDHE-RSA-AES128-SHA")};
QVERIFY(server.listen());
QEventLoop loop;
@@ -3257,14 +3446,14 @@ void tst_QSslSocket::verifyClientCertificate_data()
void tst_QSslSocket::verifyClientCertificate()
{
-#ifdef QT_SECURETRANSPORT
+#if QT_CONFIG(securetransport)
// We run both client and server on the same machine,
// this means, client can update keychain with client's certificates,
// and server later will use the same certificates from the same
// keychain thus making tests fail (wrong number of certificates,
// success instead of failure etc.).
QSKIP("This test can not work with Secure Transport");
-#endif
+#endif // QT_CONFIG(securetransport)
#ifdef Q_OS_WINRT
QSKIP("Server-side encryption is not implemented on WinRT.");
#endif
@@ -3346,7 +3535,7 @@ void tst_QSslSocket::verifyClientCertificate()
void tst_QSslSocket::readBufferMaxSize()
{
-#if defined(QT_SECURETRANSPORT) || QT_CONFIG(schannel)
+#if QT_CONFIG(securetransport) || QT_CONFIG(schannel)
// QTBUG-55170:
// SecureTransport back-end was ignoring read-buffer
// size limit, resulting (potentially) in a constantly
@@ -3403,7 +3592,7 @@ void tst_QSslSocket::readBufferMaxSize()
QCOMPARE(client->bytesAvailable() + readSoFar, message.size());
#else
// Not needed, QSslSocket works correctly with other back-ends.
-#endif
+#endif // QT_CONFIG(securetransport) || QT_CONFIG(schannel)
}
void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last, as it has some side effects
@@ -3420,7 +3609,7 @@ void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last,
socket = client.data();
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
- socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ socket->connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
QFETCH_GLOBAL(bool, setProxy);
if (setProxy && socket->waitForEncrypted(4000))
QSKIP("Skipping flaky test - See QTBUG-29941");
@@ -3539,7 +3728,7 @@ public:
bool ignoreSslErrors;
QSslSocket::PeerVerifyMode peerVerifyMode;
QSsl::SslProtocol protocol;
- QString ciphers;
+ QList<QSslCipher> ciphers;
PskProvider m_pskProvider;
protected:
@@ -3553,7 +3742,9 @@ protected:
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
if (!ciphers.isEmpty()) {
- socket->setCiphers(ciphers);
+ auto sslConfig = socket->sslConfiguration();
+ sslConfig.setCiphers(ciphers);
+ socket->setSslConfiguration(sslConfig);
}
QVERIFY(socket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState));
@@ -3595,7 +3786,7 @@ void tst_QSslSocket::simplePskConnect()
QSKIP("No SSL support");
bool pskCipherFound = false;
- const QList<QSslCipher> supportedCiphers = QSslSocket::supportedCiphers();
+ const QList<QSslCipher> supportedCiphers = QSslConfiguration::supportedCiphers();
for (const QSslCipher &cipher : supportedCiphers) {
if (cipher.name() == PSK_CIPHER_WITHOUT_AUTH) {
pskCipherFound = true;
@@ -3647,7 +3838,9 @@ void tst_QSslSocket::simplePskConnect()
connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(exitLoop()));
// force a PSK cipher w/o auth
- socket.setCiphers(PSK_CIPHER_WITHOUT_AUTH);
+ auto sslConfig = socket.sslConfiguration();
+ sslConfig.setCiphers({QSslCipher(PSK_CIPHER_WITHOUT_AUTH)});
+ socket.setSslConfiguration(sslConfig);
PskProvider provider;
@@ -3916,7 +4109,9 @@ void tst_QSslSocket::pskServer()
connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(exitLoop()));
// force a PSK cipher w/o auth
- socket.setCiphers(PSK_CIPHER_WITHOUT_AUTH);
+ auto sslConfig = socket.sslConfiguration();
+ sslConfig.setCiphers({QSslCipher(PSK_CIPHER_WITHOUT_AUTH)});
+ socket.setSslConfiguration(sslConfig);
PskProvider provider;
provider.setIdentity(PSK_CLIENT_IDENTITY);
@@ -4119,7 +4314,7 @@ void tst_QSslSocket::forwardReadChannelFinished()
});
connect(&socket, &QSslSocket::readChannelFinished,
&QTestEventLoop::instance(), &QTestEventLoop::exitLoop);
- socket.connectToHostEncrypted(QtNetworkSettings::serverLocalName(), 443);
+ socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443);
enterLoop(10);
QVERIFY(readChannelFinishedSpy.count());
}
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
index 05755ff606..8585a3c861 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
@@ -17,3 +17,9 @@ win32 {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
requires(qtConfig(private_tests))
+
+# DOCKERTODO: linux, docker is disabled on macOS/Windows.
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = squid danted
+}
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
index 25c2701f69..3b28e7a803 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
@@ -102,7 +102,15 @@ void tst_QSslSocket_onDemandCertificates_member::initTestCase_data()
void tst_QSslSocket_onDemandCertificates_member::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1081));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3129));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3130));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif // QT_TEST_SERVER
}
void tst_QSslSocket_onDemandCertificates_member::init()
@@ -110,28 +118,29 @@ void tst_QSslSocket_onDemandCertificates_member::init()
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
QFETCH_GLOBAL(int, proxyType);
- QString testServer = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
+ const auto socksAddr = QtNetworkSettings::socksProxyServerIp().toString();
+ const auto squidAddr = QtNetworkSettings::httpProxyServerIp().toString();
QNetworkProxy proxy;
switch (proxyType) {
case Socks5Proxy:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1080);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socksAddr, 1080);
break;
case Socks5Proxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1081);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socksAddr, 1081);
break;
case HttpProxy | NoAuth:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3128);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, squidAddr, 3128);
break;
case HttpProxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3129);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, squidAddr, 3129);
break;
case HttpProxy | AuthNtlm:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3130);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, squidAddr, 3130);
break;
}
QNetworkProxy::setApplicationProxy(proxy);
@@ -202,10 +211,23 @@ void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMe
{
const QString host("www.qt.io");
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ // not using any root certs -> should not work
+ QSslSocketPtr socket2 = newSocket();
+ this->socket = socket2.data();
+ socket2->setCaCertificates(QList<QSslCertificate>());
+ socket2->connectToHostEncrypted(host, 443);
+ QVERIFY(!waitForEncrypted(socket2.data()));
+ }
+#endif
+
// not using any root certs -> should not work
QSslSocketPtr socket2 = newSocket();
this->socket = socket2.data();
- socket2->setCaCertificates(QList<QSslCertificate>());
+ auto sslConfig = socket2->sslConfiguration();
+ sslConfig.setCaCertificates(QList<QSslCertificate>());
+ socket2->setSslConfiguration(sslConfig);
socket2->connectToHostEncrypted(host, 443);
QVERIFY(!waitForEncrypted(socket2.data()));
@@ -215,10 +237,23 @@ void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMe
socket->connectToHostEncrypted(host, 443);
QVERIFY2(waitForEncrypted(socket.data()), qPrintable(socket->errorString()));
+#if QT_DEPRECATED_SINCE(5, 5)
+ {
+ // not using any root certs again -> should not work
+ QSslSocketPtr socket3 = newSocket();
+ this->socket = socket3.data();
+ socket3->setCaCertificates(QList<QSslCertificate>());
+ socket3->connectToHostEncrypted(host, 443);
+ QVERIFY(!waitForEncrypted(socket3.data()));
+ }
+#endif
+
// not using any root certs again -> should not work
QSslSocketPtr socket3 = newSocket();
this->socket = socket3.data();
- socket3->setCaCertificates(QList<QSslCertificate>());
+ sslConfig = socket3->sslConfiguration();
+ sslConfig.setCaCertificates(QList<QSslCertificate>());
+ socket3->setSslConfiguration(sslConfig);
socket3->connectToHostEncrypted(host, 443);
QVERIFY(!waitForEncrypted(socket3.data()));
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
index c345d7379f..158ecbee37 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
@@ -16,3 +16,9 @@ win32 {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
requires(qtConfig(private_tests))
+
+#DOCKERTODO Linux, docker is disabled on macOS and Windows.
+linux {
+ CONFIG += unsupported/testserver
+ QT_TEST_SERVER_LIST = squid danted
+}
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
index 503edc0bff..a441d13619 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
@@ -98,7 +98,15 @@ void tst_QSslSocket_onDemandCertificates_static::initTestCase_data()
void tst_QSslSocket_onDemandCertificates_static::initTestCase()
{
+#ifdef QT_TEST_SERVER
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1081));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3129));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3130));
+#else
QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
+#endif // QT_TEST_SERVER
}
void tst_QSslSocket_onDemandCertificates_static::init()
@@ -106,28 +114,30 @@ void tst_QSslSocket_onDemandCertificates_static::init()
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
QFETCH_GLOBAL(int, proxyType);
- QString testServer = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first().toString();
+ const auto socksAddr = QtNetworkSettings::socksProxyServerIp().toString();
+ const auto squidAddr = QtNetworkSettings::httpProxyServerIp().toString();
+
QNetworkProxy proxy;
switch (proxyType) {
case Socks5Proxy:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1080);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socksAddr, 1080);
break;
case Socks5Proxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, testServer, 1081);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, socksAddr, 1081);
break;
case HttpProxy | NoAuth:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3128);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, squidAddr, 3128);
break;
case HttpProxy | AuthBasic:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3129);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, squidAddr, 3129);
break;
case HttpProxy | AuthNtlm:
- proxy = QNetworkProxy(QNetworkProxy::HttpProxy, testServer, 3130);
+ proxy = QNetworkProxy(QNetworkProxy::HttpProxy, squidAddr, 3130);
break;
}
QNetworkProxy::setApplicationProxy(proxy);
@@ -168,6 +178,7 @@ void tst_QSslSocket_onDemandCertificates_static::onDemandRootCertLoadingStaticMe
{
QString host("www.qt.io");
+#if QT_DEPRECATED_SINCE(5, 5)
// not using any root certs -> should not work
QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
QSslSocketPtr socket = newSocket();
@@ -190,6 +201,7 @@ void tst_QSslSocket_onDemandCertificates_static::onDemandRootCertLoadingStaticMe
QVERIFY(!socket3->waitForEncrypted());
QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+#endif
// setting empty default configuration -> should not work
QSslConfiguration conf;
diff --git a/tests/auto/opengl/qgl/BLACKLIST b/tests/auto/opengl/qgl/BLACKLIST
index d3165a51e5..ec75ea16eb 100644
--- a/tests/auto/opengl/qgl/BLACKLIST
+++ b/tests/auto/opengl/qgl/BLACKLIST
@@ -1,25 +1,8 @@
-[glWidgetRendering]
-windows
-winrt
-[glFBORendering]
-windows
-winrt
-[multipleFBOInterleavedRendering]
-windows
-winrt
-[glPBufferRendering]
-windows
-winrt
-[replaceClipping]
-windows
-winrt
-[clipTest]
-windows
-winrt
[graphicsViewClipping]
-windows
-winrt
-linux ci
-[glFBOUseInGLWidget]
-windows
-winrt
+ubuntu-16.04
+rhel-7.6
+opensuse-leap
+ubuntu-18.04
+rhel-7.4
+opensuse-42.3
+
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 053c4b026b..3cc9592fb1 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -60,6 +60,8 @@ public:
tst_QGL();
virtual ~tst_QGL();
+ static void initMain();
+
private slots:
void initTestCase();
void getSetCheck();
@@ -101,6 +103,11 @@ tst_QGL::~tst_QGL()
{
}
+void tst_QGL::initMain()
+{
+ QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
+}
+
void tst_QGL::initTestCase()
{
QGLWidget glWidget;
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index b7b5b505a0..e12f6d9c18 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -33,6 +33,7 @@
#include <qpa/qplatformintegration.h>
#include <QtWidgets/QApplication>
#include <QtOpenGL/QtOpenGL>
+#include <qelapsedtimer.h>
#include "tst_qglthreads.h"
#ifndef QT_OPENGL_ES_2
@@ -74,9 +75,9 @@ public:
}
void run() {
- QTime time;
- time.start();
- while (time.elapsed() < RUNNING_TIME) {
+ QElapsedTimer timer;
+ timer.start();
+ while (timer.elapsed() < RUNNING_TIME) {
lock();
waitForReadyToSwap();
@@ -291,11 +292,11 @@ public:
}
void run() {
- QTime time;
- time.start();
+ QElapsedTimer timer;
+ timer.start();
failure = false;
- while (time.elapsed() < RUNNING_TIME && !failure) {
+ while (timer.elapsed() < RUNNING_TIME && !failure) {
m_widget->makeCurrent();
@@ -466,13 +467,13 @@ public:
public slots:
void draw() {
bool beginFailed = false;
- QTime time;
- time.start();
+ QElapsedTimer timer;
+ timer.start();
int rotAngle = 10;
device->prepareDevice();
QPaintDevice *paintDevice = device->realPaintDevice();
QSize s(paintDevice->width(), paintDevice->height());
- while (time.elapsed() < RUNNING_TIME) {
+ while (timer.elapsed() < RUNNING_TIME) {
QPainter p;
if (!p.begin(paintDevice)) {
beginFailed = true;
@@ -605,9 +606,6 @@ void tst_QGLThreads::painterOnPixmapInThread()
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)
|| !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps))
QSKIP("No platformsupport for ThreadedOpenGL or ThreadedPixmaps");
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- QSKIP("Drawing text in threads onto X11 drawables currently crashes on some X11 servers.");
-#endif
PaintThreadManager<PixmapWrapper> painterThreads(5);
painterThreads.start();
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index b2b45bb237..de15f4c62d 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -842,7 +842,7 @@ void tst_Compiler::cxx11_constexpr()
static constexpr QBasicAtomicInt atomic = Q_BASIC_ATOMIC_INITIALIZER(1);
static constexpr int i = constexprValue();
QCOMPARE(i, constexprValue());
- QCOMPARE(atomic.load(), 1);
+ QCOMPARE(atomic.loadRelaxed(), 1);
#endif
}
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
index c465ff316e..2af5d40359 100644
--- a/tests/auto/other/gestures/BLACKLIST
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -3,17 +3,25 @@ rhel-7.4
rhel-7.6
ubuntu-18.04
[customGesture]
-# QTBUG-67254
-ubuntu
-opensuse
opensuse-leap
+# QTBUG-67254
+opensuse-42.3
[graphicsItemGesture]
ubuntu-18.04
+rhel-7.4
+rhel-7.6
[graphicsItemTreeGesture]
ubuntu-18.04
[graphicsView]
ubuntu-18.04
+rhel-7.4
+rhel-7.6
[explicitGraphicsObjectTarget]
ubuntu-18.04
+rhel-7.4
+rhel-7.6
[autoCancelGestures2]
ubuntu-18.04
+rhel-7.4
+rhel-7.6
+
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 8fd22caa16..215a4c2a29 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -365,6 +365,7 @@ void PaintCommands::staticInit()
"^gradient_setCoordinateMode\\s+(\\w*)$",
"gradient_setCoordinateMode <coordinate method enum>",
"gradient_setCoordinateMode ObjectBoundingMode");
+
DECL_PAINTCOMMANDSECTION("drawing ops");
DECL_PAINTCOMMAND("drawPoint", command_drawPoint,
"^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
@@ -454,6 +455,14 @@ void PaintCommands::staticInit()
"\n - where t means tile"
"\n - and s is an offset in the tile",
"drawTiledPixmap :/images/alpha.png ");
+ DECL_PAINTCOMMAND("fillRect", command_fillRect,
+ "^fillRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(\\w*)?$",
+ "fillRect <x> <y> <w> <h> [color]\n - Uses current brush if no color given",
+ "fillRect 10 10 20 20 blue");
+ DECL_PAINTCOMMAND("fillRectF", command_fillRectF,
+ "^fillRectF\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s+(-?[.\\w]*)\\s*(\\w*)?$",
+ "fillRectF <x> <y> <w> <h> [color]\n - Uses current brush if no color given",
+ "fillRectF 10.5 10.5 20.2 20.2 blue");
DECL_PAINTCOMMANDSECTION("painterPaths");
DECL_PAINTCOMMAND("path_moveTo", command_path_moveTo,
@@ -1208,7 +1217,7 @@ void PaintCommands::command_drawRoundRect(QRegularExpressionMatch re)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
- m_painter->drawRoundRect(x, y, w, h, xs, ys);
+ m_painter->drawRoundedRect(x, y, w, h, xs, ys, Qt::RelativeSize);
QT_WARNING_POP
}
@@ -1331,6 +1340,46 @@ void PaintCommands::command_drawTextDocument(QRegularExpressionMatch re)
m_painter->restore();
}
+/***************************************************************************************************/
+void PaintCommands::command_fillRect(QRegularExpressionMatch re)
+{
+ QStringList caps = re.capturedTexts();
+ int x = convertToInt(caps.at(1));
+ int y = convertToInt(caps.at(2));
+ int w = convertToInt(caps.at(3));
+ int h = convertToInt(caps.at(4));
+
+ if (!caps.at(5).isEmpty()) {
+ QColor color = convertToColor(caps.at(5));
+ if (m_verboseMode)
+ printf(" -(lance) fillRect(%d, %d, %d, %d, %s)\n", x, y, w, h, qPrintable(color.name()));
+ m_painter->fillRect(x, y, w, h, color);
+ } else {
+ if (m_verboseMode)
+ printf(" -(lance) fillRect(%d, %d, %d, %d)\n", x, y, w, h);
+ m_painter->fillRect(x, y, w, h, m_painter->brush());
+ }
+}
+
+void PaintCommands::command_fillRectF(QRegularExpressionMatch re)
+{
+ QStringList caps = re.capturedTexts();
+ double x = convertToDouble(caps.at(1));
+ double y = convertToDouble(caps.at(2));
+ double w = convertToDouble(caps.at(3));
+ double h = convertToDouble(caps.at(4));
+
+ if (!caps.at(5).isEmpty()) {
+ QColor color = convertToColor(caps.at(5));
+ if (m_verboseMode)
+ printf(" -(lance) fillRectF(%.2f, %.2f, %.2f, %.2f, %s)\n", x, y, w, h, qPrintable(color.name()));
+ m_painter->fillRect(QRectF(x, y, w, h), color);
+ } else {
+ if (m_verboseMode)
+ printf(" -(lance) fillRectF(%.2f, %.2f, %.2f, %.2f)\n", x, y, w, h);
+ m_painter->fillRect(QRectF(x, y, w, h), m_painter->brush());
+ }
+}
/***************************************************************************************************/
void PaintCommands::command_noop(QRegularExpressionMatch)
@@ -2484,12 +2533,6 @@ void PaintCommands::command_surface_begin(QRegularExpressionMatch re)
m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent);
m_painter->restore();
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- } else if (m_type == WidgetType) {
- m_surface_pixmap = QPixmap(qRound(w), qRound(h));
- m_surface_pixmap.fill(Qt::transparent);
- m_painter = new QPainter(&m_surface_pixmap);
-#endif
} else {
QImage::Format surface_format;
if (QImage::toPixelFormat(m_format).alphaUsage() != QPixelFormat::UsesAlpha)
@@ -2541,11 +2584,6 @@ void PaintCommands::command_surface_end(QRegularExpressionMatch)
m_painter->beginNativePainting();
m_painter->endNativePainting();
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- } else if (m_type == WidgetType) {
- m_painter->drawPixmap(m_surface_rect.topLeft(), m_surface_pixmap);
- m_surface_pixmap = QPixmap();
-#endif
} else {
m_painter->drawImage(m_surface_rect, m_surface_image);
m_surface_image = QImage();
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 79bdab634a..816ecd6fa2 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -200,6 +200,10 @@ private:
void command_drawStaticText(QRegularExpressionMatch re);
void command_drawTextDocument(QRegularExpressionMatch re);
void command_drawTiledPixmap(QRegularExpressionMatch re);
+ void command_fillRect(QRegularExpressionMatch re);
+ void command_fillRectF(QRegularExpressionMatch re);
+
+ // paths
void command_path_addEllipse(QRegularExpressionMatch re);
void command_path_addPolygon(QRegularExpressionMatch re);
void command_path_addRect(QRegularExpressionMatch re);
diff --git a/tests/auto/other/lancelot/scripts/fillrect.qps b/tests/auto/other/lancelot/scripts/fillrect.qps
new file mode 100644
index 0000000000..103ef2646a
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/fillrect.qps
@@ -0,0 +1,121 @@
+setRenderHint Antialiasing false
+
+# offscreen
+translate 0 -200
+
+begin_block rects
+# int API
+fillRect 10 10 20 20 green
+fillRect 40 10 20 20
+drawRect 70 10 20 20
+
+# float API, int values
+fillRectF 10.0 40.0 20.0 20.0 green
+fillRectF 40.0 40.0 20.0 20.0
+drawRect 70.0 40.0 20.0 20.0
+
+# float API, float values
+fillRectF 10.0 70.0 20.5 20.5 green
+fillRectF 40.0 70.0 20.5 20.5
+drawRect 70.0 70.0 20.5 20.5
+
+# alignment, int api, color
+fillRect 10 100 10 10 green
+fillRect 20 100 10 10 green
+fillRect 10 110 10 10 green
+fillRect 20 110 10 10 green
+
+# alignment, int api, brush
+fillRect 40 100 10 10
+fillRect 50 100 10 10
+fillRect 40 110 10 10
+fillRect 50 110 10 10
+
+# alignment comparison
+drawRect 70 100 10 10
+drawRect 80 100 10 10
+drawRect 70 110 10 10
+drawRect 80 110 10 10
+
+# alignment, float api, color
+fillRectF 10.0 130.0 10.0 10.0 green
+fillRectF 20.0 130.0 10.0 10.0 green
+fillRectF 10.0 140.0 10.0 10.0 green
+fillRectF 20.0 140.0 10.0 10.0 green
+
+# alignment, float api, brush
+fillRectF 40.0 130.0 10.0 10.0
+fillRectF 50.0 130.0 10.0 10.0
+fillRectF 40.0 140.0 10.0 10.0
+fillRectF 50.0 140.0 10.0 10.0
+
+# alignment comparison
+drawRect 70.0 130.0 10.0 10.0
+drawRect 80.0 130.0 10.0 10.0
+drawRect 70.0 140.0 10.0 10.0
+drawRect 80.0 140.0 10.0 10.0
+
+end_block
+
+begin_block row
+
+repeat_block rects
+
+save
+translate 100.2 0.2
+repeat_block rects
+restore
+
+save
+translate 200.5 0.5
+repeat_block rects
+restore
+
+save
+translate 300.7 0.7
+repeat_block rects
+restore
+
+end_block
+
+# end of block defs
+
+resetMatrix
+
+setPen NoPen
+setBrush green
+repeat_block row
+
+save
+translate 500 50
+scale 0.42 0.42
+repeat_block row
+restore
+
+save
+translate 0 160
+scale 1.8 0.8
+repeat_block row
+restore
+
+save
+translate 650 320
+rotate 80
+repeat_block row
+restore
+
+save
+setBrush green Dense2Pattern
+translate 0 400
+repeat_block row
+restore
+
+save
+gradient_clearStops
+gradient_appendStop 0 green
+gradient_appendStop 1 blue
+gradient_setCoordinateMode ObjectBoundingMode
+gradient_setLinear 0.0 0.0 1.0 1.0
+translate 0 600
+repeat_block row
+restore
diff --git a/tests/auto/other/lancelot/scripts/fillrect_aa.qps b/tests/auto/other/lancelot/scripts/fillrect_aa.qps
new file mode 100644
index 0000000000..3232899661
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/fillrect_aa.qps
@@ -0,0 +1,121 @@
+setRenderHint Antialiasing true
+
+# offscreen
+translate 0 -200
+
+begin_block rects
+# int API
+fillRect 10 10 20 20 green
+fillRect 40 10 20 20
+drawRect 70 10 20 20
+
+# float API, int values
+fillRectF 10.0 40.0 20.0 20.0 green
+fillRectF 40.0 40.0 20.0 20.0
+drawRect 70.0 40.0 20.0 20.0
+
+# float API, float values
+fillRectF 10.0 70.0 20.5 20.5 green
+fillRectF 40.0 70.0 20.5 20.5
+drawRect 70.0 70.0 20.5 20.5
+
+# alignment, int api, color
+fillRect 10 100 10 10 green
+fillRect 20 100 10 10 green
+fillRect 10 110 10 10 green
+fillRect 20 110 10 10 green
+
+# alignment, int api, brush
+fillRect 40 100 10 10
+fillRect 50 100 10 10
+fillRect 40 110 10 10
+fillRect 50 110 10 10
+
+# alignment comparison
+drawRect 70 100 10 10
+drawRect 80 100 10 10
+drawRect 70 110 10 10
+drawRect 80 110 10 10
+
+# alignment, float api, color
+fillRectF 10.0 130.0 10.0 10.0 green
+fillRectF 20.0 130.0 10.0 10.0 green
+fillRectF 10.0 140.0 10.0 10.0 green
+fillRectF 20.0 140.0 10.0 10.0 green
+
+# alignment, float api, brush
+fillRectF 40.0 130.0 10.0 10.0
+fillRectF 50.0 130.0 10.0 10.0
+fillRectF 40.0 140.0 10.0 10.0
+fillRectF 50.0 140.0 10.0 10.0
+
+# alignment comparison
+drawRect 70.0 130.0 10.0 10.0
+drawRect 80.0 130.0 10.0 10.0
+drawRect 70.0 140.0 10.0 10.0
+drawRect 80.0 140.0 10.0 10.0
+
+end_block
+
+begin_block row
+
+repeat_block rects
+
+save
+translate 100.2 0.2
+repeat_block rects
+restore
+
+save
+translate 200.5 0.5
+repeat_block rects
+restore
+
+save
+translate 300.7 0.7
+repeat_block rects
+restore
+
+end_block
+
+# end of block defs
+
+resetMatrix
+
+setPen NoPen
+setBrush green
+repeat_block row
+
+save
+translate 500 50
+scale 0.42 0.42
+repeat_block row
+restore
+
+save
+translate 0 160
+scale 1.8 0.8
+repeat_block row
+restore
+
+save
+translate 650 320
+rotate 80
+repeat_block row
+restore
+
+save
+setBrush green Dense2Pattern
+translate 0 400
+repeat_block row
+restore
+
+save
+gradient_clearStops
+gradient_appendStop 0 green
+gradient_appendStop 1 blue
+gradient_setCoordinateMode ObjectBoundingMode
+gradient_setLinear 0.0 0.0 1.0 1.0
+translate 0 600
+repeat_block row
+restore
diff --git a/tests/auto/other/macplist/tst_macplist.cpp b/tests/auto/other/macplist/tst_macplist.cpp
index 755cc462f5..dec63b1b66 100644
--- a/tests/auto/other/macplist/tst_macplist.cpp
+++ b/tests/auto/other/macplist/tst_macplist.cpp
@@ -59,8 +59,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -77,8 +75,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -97,8 +93,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -117,8 +111,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
@@ -137,8 +129,6 @@ void tst_MacPlist::test_plist_data()
" <string></string>\n"
" <key>CFBundlePackageType</key>\n"
" <string>APPL</string>\n"
-" <key>CFBundleGetInfoString</key>\n"
-" <string>Created by Qt/QMake</string>\n"
" <key>CFBundleExecutable</key>\n"
" <string>app</string>\n"
" <key>CFBundleIdentifier</key>\n"
diff --git a/tests/auto/other/networkselftest/BLACKLIST b/tests/auto/other/networkselftest/BLACKLIST
index 4a958b43a5..55ebad985d 100644
--- a/tests/auto/other/networkselftest/BLACKLIST
+++ b/tests/auto/other/networkselftest/BLACKLIST
@@ -1,4 +1,5 @@
# QTBUG-27571
[ftpProxyServer]
-windows 32bit
-windows 64bit
+windows-7sp1
+windows-10
+
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index dc353d2090..1b125d8825 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <QtCore/QDateTime>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QTextStream>
#include <QtCore/QRandomGenerator>
#include <QtCore/QStandardPaths>
@@ -195,7 +196,7 @@ static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
#ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
#endif
- QTime timer;
+ QElapsedTimer timer;
timer.start();
int t = timeout;
forever {
@@ -421,7 +422,7 @@ void tst_NetworkSelfTest::serverReachability()
QTcpSocket socket;
socket.connectToHost(QtNetworkSettings::serverName(), 12346);
- QTime timer;
+ QElapsedTimer timer;
timer.start();
socket.waitForConnected(10000);
QVERIFY2(timer.elapsed() < 9900, "Connection to closed port timed out instead of refusing, something is wrong");
diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp
index fc979bce2d..ecc95d30b6 100644
--- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp
+++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.cpp
@@ -80,13 +80,9 @@ qint64 DynamicTreeModel::findParentId(qint64 searchId) const
if (searchId <= 0)
return -1;
- QHashIterator<qint64, QList<QList<qint64> > > i(m_childItems);
- while (i.hasNext()) {
- i.next();
- QListIterator<QList<qint64> > j(i.value());
- while (j.hasNext()) {
- QList<qint64> l = j.next();
- if (l.contains(searchId))
+ for (auto i = m_childItems.cbegin(), end = m_childItems.cend(); i != end; ++i) {
+ for (const auto &list : i.value()) {
+ if (list.contains(searchId))
return i.key();
}
}
@@ -163,13 +159,12 @@ ModelChangeCommand::ModelChangeCommand(DynamicTreeModel *model, QObject *parent)
{
}
-QModelIndex ModelChangeCommand::findIndex(QList<int> rows)
+QModelIndex ModelChangeCommand::findIndex(const QList<int> &rows) const
{
const int col = 0;
QModelIndex parent = QModelIndex();
- QListIterator<int> i(rows);
- while (i.hasNext()) {
- parent = m_model->index(i.next(), col, parent);
+ for (int row : rows) {
+ parent = m_model->index(row, col, parent);
if (!parent.isValid())
qFatal("%s: parent must be valid", Q_FUNC_INFO);
}
@@ -233,7 +228,7 @@ void ModelMoveCommand::doCommand()
if (srcParent == destParent)
d = m_destRow - (m_endRow - m_startRow + 1);
else
- d = m_destRow - (m_endRow - m_startRow) + 1;
+ d = m_destRow;
}
foreach (const qint64 id, l)
diff --git a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
index 709751dd27..0807ffbe94 100644
--- a/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
+++ b/tests/auto/other/qabstractitemmodelutils/dynamictreemodel.h
@@ -97,7 +97,7 @@ public:
m_rowNumbers = rowNumbers;
}
- QModelIndex findIndex(QList<int> rows);
+ QModelIndex findIndex(const QList<int> &rows) const;
void setStartRow(int row)
{
diff --git a/tests/auto/other/qaccessibility/qaccessibility.pro b/tests/auto/other/qaccessibility/qaccessibility.pro
index 3587c38e76..6f3740a24f 100644
--- a/tests/auto/other/qaccessibility/qaccessibility.pro
+++ b/tests/auto/other/qaccessibility/qaccessibility.pro
@@ -11,5 +11,6 @@ win32 {
!winrt {
QT += windowsuiautomation_support-private
}
- LIBS += -luuid -loleacc -loleaut32 -lole32
+ LIBS += -loleacc -loleaut32
+ QMAKE_USE += ole32 uuid
}
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index bc45487599..7d7fa6403b 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -2580,6 +2580,7 @@ void tst_QAccessibility::dialogButtonBoxTest()
case QDialogButtonBox::GnomeLayout:
case QDialogButtonBox::KdeLayout:
case QDialogButtonBox::MacLayout:
+ case QDialogButtonBox::AndroidLayout:
expectedOrder << QDialogButtonBox::tr("Help")
<< QDialogButtonBox::tr("Reset")
<< QDialogButtonBox::tr("OK");
diff --git a/tests/auto/other/qaccessibilitymac/BLACKLIST b/tests/auto/other/qaccessibilitymac/BLACKLIST
deleted file mode 100644
index f53fa7e853..0000000000
--- a/tests/auto/other/qaccessibilitymac/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[hierarchyTest]
-osx-10.12 ci
diff --git a/tests/auto/other/qfocusevent/BLACKLIST b/tests/auto/other/qfocusevent/BLACKLIST
deleted file mode 100644
index 0b03472587..0000000000
--- a/tests/auto/other/qfocusevent/BLACKLIST
+++ /dev/null
@@ -1,6 +0,0 @@
-[checkReason_Shortcut]
-osx-10.12 ci
-[checkReason_ActiveWindow]
-osx-10.12 ci
-winrt
-
diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/BLACKLIST b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/BLACKLIST
index aea819fc2e..6173488c00 100644
--- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/BLACKLIST
+++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/BLACKLIST
@@ -1,2 +1,4 @@
+[downloadCheck]
+windows-10
[downloadCheck:with-zeroCopy]
windows
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
index 0d656e223c..e09d304ff3 100644
--- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
@@ -85,7 +85,7 @@ class RaceThread : public QThread
{
Q_OBJECT
RaceObject *object;
- QTime stopWatch;
+ QElapsedTimer stopWatch;
public:
RaceThread()
@@ -378,6 +378,10 @@ public:
connect(timer, &QTimer::timeout, this, &DeleteReceiverRaceReceiver::onTimeout);
timer->start(1);
}
+ ~DeleteReceiverRaceReceiver()
+ {
+ delete receiver;
+ }
void onTimeout()
{
@@ -410,7 +414,7 @@ void tst_QObjectRace::disconnectRace()
{
enum { ThreadCount = 20, TimeLimit = 3000 };
- QCOMPARE(countedStructObjectsCount.load(), 0u);
+ QCOMPARE(countedStructObjectsCount.loadRelaxed(), 0u);
{
QScopedPointer<DisconnectRaceSenderObject> sender(new DisconnectRaceSenderObject());
@@ -428,15 +432,15 @@ void tst_QObjectRace::disconnectRace()
for (int i = 0; i < ThreadCount; ++i) {
threads[i]->requestInterruption();
- QVERIFY(threads[i]->wait(300));
+ QVERIFY(threads[i]->wait());
delete threads[i];
}
senderThread->quit();
- QVERIFY(senderThread->wait(300));
+ QVERIFY(senderThread->wait());
}
- QCOMPARE(countedStructObjectsCount.load(), 0u);
+ QCOMPARE(countedStructObjectsCount.loadRelaxed(), 0u);
{
QScopedPointer<DisconnectRaceSenderObject> sender(new DisconnectRaceSenderObject());
@@ -453,16 +457,16 @@ void tst_QObjectRace::disconnectRace()
QTest::qWait(TimeLimit);
senderThread->requestInterruption();
- QVERIFY(senderThread->wait(300));
+ QVERIFY(senderThread->wait());
for (int i = 0; i < ThreadCount; ++i) {
threads[i]->quit();
- QVERIFY(threads[i]->wait(300));
+ QVERIFY(threads[i]->wait());
delete threads[i];
}
}
- QCOMPARE(countedStructObjectsCount.load(), 0u);
+ QCOMPARE(countedStructObjectsCount.loadRelaxed(), 0u);
}
QTEST_MAIN(tst_QObjectRace)
diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp
index f31a755f9e..ab7bca8322 100644
--- a/tests/auto/other/toolsupport/tst_toolsupport.cpp
+++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp
@@ -126,20 +126,20 @@ void tst_toolsupport::offsets_data()
#ifdef Q_PROCESSOR_X86
// x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in
// qglobal.h for more details.
- data << 168 << 248;
+ data << 152 << 224;
#else
- data << 172 << 248;
+ data << 156 << 224;
#endif
}
#endif
{
QTest::newRow("QDateTimePrivate::m_msecs")
- << pmm_to_offsetof(&QDateTimePrivate::m_msecs) << 0 << 0;
+ << pmm_to_offsetof(&QDateTimePrivate::m_msecs) << 8 << 8;
QTest::newRow("QDateTimePrivate::m_status")
- << pmm_to_offsetof(&QDateTimePrivate::m_status) << 8 << 8;
+ << pmm_to_offsetof(&QDateTimePrivate::m_status) << 4 << 4;
QTest::newRow("QDateTimePrivate::m_offsetFromUtc")
- << pmm_to_offsetof(&QDateTimePrivate::m_offsetFromUtc) << 12 << 12;
+ << pmm_to_offsetof(&QDateTimePrivate::m_offsetFromUtc) << 16 << 16;
QTest::newRow("QDateTimePrivate::m_timeZone")
<< pmm_to_offsetof(&QDateTimePrivate::m_timeZone) << 20 << 24;
}
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index abe4325278..7529bad833 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -1315,7 +1315,9 @@ void tst_QPrinter::pageSize()
// Test set/get
QPrinter::PaperSize expected = QPrinter::A4;
QPrinterInfo info = QPrinterInfo::printerInfo(native.printerName());
- foreach (QPrinter::PaperSize supported, info.supportedPaperSizes()) {
+ const auto &pageSizes = info.supportedPageSizes();
+ for (const auto &pageSize : pageSizes) {
+ const QPrinter::PaperSize supported = QPrinter::PaperSize(pageSize.id());
if (supported != QPrinter::Custom && supported != native.paperSize()) {
expected = supported;
break;
@@ -1359,7 +1361,9 @@ void tst_QPrinter::paperSize()
// Test set/get
QPrinter::PaperSize expected = QPrinter::A4;
QPrinterInfo info = QPrinterInfo::printerInfo(native.printerName());
- foreach (QPrinter::PaperSize supported, info.supportedPaperSizes()) {
+ const auto &pageSizes = info.supportedPageSizes();
+ for (const auto &pageSize : pageSizes) {
+ const QPrinter::PaperSize supported = QPrinter::PaperSize(pageSize.id());
if (supported != QPrinter::Custom && supported != native.paperSize()) {
expected = supported;
break;
diff --git a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
index 92a06cda00..81b49a3a87 100644
--- a/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp
@@ -94,17 +94,16 @@ QString tst_QPrinterInfo::getDefaultPrinterFromSystem()
command << "lpstat" << "-d";
QString output = getOutputFromCommand(command);
- QRegExp noDefaultReg("[^:]*no .*default");
- int pos = noDefaultReg.indexIn(output);
- if (pos >= 0) {
+ QRegularExpression noDefaultReg("[^:]*no .*default");
+ QRegularExpressionMatch match;
+ match = noDefaultReg.match(output);
+ if (match.hasMatch())
return QString();
- }
- QRegExp defaultReg("default.*: *([a-zA-Z0-9_-]+)");
- defaultReg.indexIn(output);
- printer = defaultReg.cap(1);
+ QRegularExpression defaultReg("default.*: *([a-zA-Z0-9_-]+)");
+ match = defaultReg.match(output);
+ printer = match.captured(1);
#endif // Q_OS_UNIX
-
return printer;
}
@@ -121,10 +120,12 @@ QStringList tst_QPrinterInfo::getPrintersFromSystem()
QString output = getOutputFromCommand(command);
QStringList list = output.split(QChar::fromLatin1('\n'));
- QRegExp reg("^[Pp]rinter ([.a-zA-Z0-9-_@]+)");
+ QRegularExpression reg("^[Pp]rinter ([.a-zA-Z0-9-_@]+)");
+ QRegularExpressionMatch match;
for (int c = 0; c < list.size(); ++c) {
- if (reg.indexIn(list[c]) >= 0) {
- QString printer = reg.cap(1);
+ match = reg.match(list[c]);
+ if (match.hasMatch()) {
+ QString printer = match.captured(1);
ans << printer;
}
}
@@ -300,8 +301,13 @@ void tst_QPrinterInfo::testConstructors()
QCOMPARE(copy1.supportsCustomPageSizes(), printers.at(i).supportsCustomPageSizes());
QCOMPARE(copy1.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
QCOMPARE(copy1.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
- QCOMPARE(copy1.supportedPaperSizes(), printers.at(i).supportedPaperSizes());
+ QCOMPARE(copy1.supportedPageSizes(), printers.at(i).supportedPageSizes());
+#if QT_DEPRECATED_SINCE(5, 3)
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
QCOMPARE(copy1.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames());
+QT_WARNING_POP
+#endif
QCOMPARE(copy1.supportedResolutions(), printers.at(i).supportedResolutions());
QCOMPARE(copy1.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
QCOMPARE(copy1.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
@@ -321,8 +327,13 @@ void tst_QPrinterInfo::testConstructors()
QCOMPARE(copy2.supportsCustomPageSizes(), printers.at(i).supportsCustomPageSizes());
QCOMPARE(copy2.minimumPhysicalPageSize(), printers.at(i).minimumPhysicalPageSize());
QCOMPARE(copy2.maximumPhysicalPageSize(), printers.at(i).maximumPhysicalPageSize());
- QCOMPARE(copy2.supportedPaperSizes(), printers.at(i).supportedPaperSizes());
+ QCOMPARE(copy2.supportedPageSizes(), printers.at(i).supportedPageSizes());
+#if QT_DEPRECATED_SINCE(5, 3)
+ QT_WARNING_PUSH
+ QT_WARNING_DISABLE_DEPRECATED
QCOMPARE(copy2.supportedSizesWithNames(), printers.at(i).supportedSizesWithNames());
+ QT_WARNING_POP
+#endif
QCOMPARE(copy2.supportedResolutions(), printers.at(i).supportedResolutions());
QCOMPARE(copy2.defaultDuplexMode(), printers.at(i).defaultDuplexMode());
QCOMPARE(copy2.supportedDuplexModes(), printers.at(i).supportedDuplexModes());
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
index 55875359ff..174db2863e 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
@@ -34,7 +34,8 @@
#include <QSqlDriver>
#include <QSqlError>
#include <QSqlQuery>
-#include <QRegExp>
+#include <QRegularExpression>
+#include <QRegularExpressionMatch>
#include <QDir>
#include <QScopedPointer>
#include <QVariant>
@@ -511,13 +512,13 @@ public:
QSqlQuery q( "SELECT banner FROM v$version", db );
q.next();
- QRegExp vers( "([0-9]+)\\.[0-9\\.]+[0-9]" );
-
- if ( vers.indexIn( q.value( 0 ).toString() ) ) {
+ QRegularExpression vers("([0-9]+)\\.[0-9\\.]+[0-9]");
+ QRegularExpressionMatch match = vers.match(q.value(0).toString());
+ if (match.hasMatch()) {
bool ok;
- ver = vers.cap( 1 ).toInt( &ok );
+ ver = match.captured(1).toInt(&ok);
- if ( !ok )
+ if (!ok)
ver = -1;
}
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
index f309231b10..c59250e36e 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
@@ -34,7 +34,7 @@
#include <qsqlrecord.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
-#include <qregexp.h>
+#include <qregularexpression.h>
#include <qvariant.h>
#include <qdatetime.h>
#include <qdebug.h>
@@ -228,7 +228,7 @@ struct FieldDef {
QString fieldName() const
{
QString rt = typeName;
- rt.replace(QRegExp("\\s"), QString("_"));
+ rt.replace(QRegularExpression("\\s"), QString("_"));
int i = rt.indexOf(QLatin1Char('('));
if (i == -1)
i = rt.length();
diff --git a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
index 08c6039e37..871ac24be4 100644
--- a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
+++ b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
@@ -42,10 +42,13 @@ public:
virtual ~tst_QSqlError();
private slots:
+#if QT_DEPRECATED_SINCE(5, 1)
void getSetCheck();
+#endif
void construction();
void moveOperator();
void operators();
+ void qtbug_74575();
};
tst_QSqlError::tst_QSqlError()
@@ -56,6 +59,7 @@ tst_QSqlError::~tst_QSqlError()
{
}
+#if QT_DEPRECATED_SINCE(5, 1)
// Testing get/set functions
void tst_QSqlError::getSetCheck()
{
@@ -82,14 +86,28 @@ void tst_QSqlError::getSetCheck()
obj1.setNumber(INT_MAX);
QCOMPARE(INT_MAX, obj1.number());
}
+#endif
void tst_QSqlError::construction()
{
- QSqlError obj1("drivertext", "databasetext", QSqlError::UnknownError, 123);
+#if QT_DEPRECATED_SINCE(5, 3)
+ {
+ QSqlError obj1("drivertext", "databasetext", QSqlError::UnknownError, 123);
+ QCOMPARE(obj1.driverText(), QString("drivertext"));
+ QCOMPARE(obj1.databaseText(), QString("databasetext"));
+ QCOMPARE(obj1.type(), QSqlError::UnknownError);
+ QCOMPARE(obj1.number(), 123);
+ QCOMPARE(obj1.nativeErrorCode(), QStringLiteral("123"));
+ QVERIFY(obj1.isValid());
+ }
+#endif
+ QSqlError obj1("drivertext", "databasetext", QSqlError::UnknownError, QStringLiteral("123"));
QCOMPARE(obj1.driverText(), QString("drivertext"));
QCOMPARE(obj1.databaseText(), QString("databasetext"));
QCOMPARE(obj1.type(), QSqlError::UnknownError);
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj1.number(), 123);
+#endif
QCOMPARE(obj1.nativeErrorCode(), QStringLiteral("123"));
QVERIFY(obj1.isValid());
@@ -97,7 +115,9 @@ void tst_QSqlError::construction()
QCOMPARE(obj2.driverText(), obj1.driverText());
QCOMPARE(obj2.databaseText(), obj1.databaseText());
QCOMPARE(obj2.type(), obj1.type());
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj2.number(), obj1.number());
+#endif
QCOMPARE(obj2.nativeErrorCode(), obj1.nativeErrorCode());
QVERIFY(obj2.isValid());
@@ -105,7 +125,9 @@ void tst_QSqlError::construction()
QCOMPARE(obj3.driverText(), obj2.driverText());
QCOMPARE(obj3.databaseText(), obj2.databaseText());
QCOMPARE(obj3.type(), obj2.type());
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj3.number(), obj2.number());
+#endif
QCOMPARE(obj3.nativeErrorCode(), obj2.nativeErrorCode());
QVERIFY(obj3.isValid());
@@ -113,8 +135,11 @@ void tst_QSqlError::construction()
QVERIFY(!obj4.isValid());
QCOMPARE(obj4.driverText(), QString());
QCOMPARE(obj4.databaseText(), QString());
+ QCOMPARE(obj4.text(), QString());
QCOMPARE(obj4.type(), QSqlError::NoError);
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj4.number(), -1);
+#endif
QCOMPARE(obj4.nativeErrorCode(), QString());
QSqlError obj5(QStringLiteral("drivertext"), QStringLiteral("databasetext"),
@@ -122,7 +147,9 @@ void tst_QSqlError::construction()
QCOMPARE(obj5.driverText(), QString("drivertext"));
QCOMPARE(obj5.databaseText(), QString("databasetext"));
QCOMPARE(obj5.type(), QSqlError::UnknownError);
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj5.number(), 123);
+#endif
QCOMPARE(obj5.nativeErrorCode(), QStringLiteral("123"));
QVERIFY(obj5.isValid());
@@ -131,17 +158,31 @@ void tst_QSqlError::construction()
QCOMPARE(obj6.driverText(), QString("drivertext"));
QCOMPARE(obj6.databaseText(), QString("databasetext"));
QCOMPARE(obj6.type(), QSqlError::UnknownError);
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj6.number(), 0);
+#endif
QCOMPARE(obj6.nativeErrorCode(), QStringLiteral("Err123"));
QVERIFY(obj6.isValid());
- // Default constructed object as constructed before Qt 5.3
- QSqlError obj7(QString(), QString(), QSqlError::NoError, -1);
+#if QT_DEPRECATED_SINCE(5, 3)
+ {
+ // Default constructed object as constructed before Qt 5.3
+ QSqlError obj7(QString(), QString(), QSqlError::NoError, -1);
+ QVERIFY(!obj7.isValid());
+ QCOMPARE(obj7.driverText(), QString());
+ QCOMPARE(obj7.databaseText(), QString());
+ QCOMPARE(obj7.type(), QSqlError::NoError);
+ QCOMPARE(obj7.number(), -1);
+ QCOMPARE(obj7.nativeErrorCode(), QString());
+ }
+#endif
+
+ // Default constructed object
+ QSqlError obj7;
QVERIFY(!obj7.isValid());
QCOMPARE(obj7.driverText(), QString());
QCOMPARE(obj7.databaseText(), QString());
QCOMPARE(obj7.type(), QSqlError::NoError);
- QCOMPARE(obj7.number(), -1);
QCOMPARE(obj7.nativeErrorCode(), QString());
// Move constructor
@@ -149,37 +190,59 @@ void tst_QSqlError::construction()
QCOMPARE(obj8.driverText(), obj2.driverText());
QCOMPARE(obj8.databaseText(), obj2.databaseText());
QCOMPARE(obj8.type(), obj2.type());
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj8.number(), obj2.number());
+#endif
QCOMPARE(obj8.nativeErrorCode(), obj2.nativeErrorCode());
QVERIFY(obj8.isValid());
}
void tst_QSqlError::moveOperator()
{
- QSqlError obj1("drivertext", "databasetext", QSqlError::UnknownError, 123), obj2;
+ QSqlError obj1("drivertext", "databasetext", QSqlError::UnknownError, QStringLiteral("123")), obj2;
obj2 = std::move(obj1);
QCOMPARE(obj2.driverText(), QString("drivertext"));
QCOMPARE(obj2.databaseText(), QString("databasetext"));
QCOMPARE(obj2.type(), QSqlError::UnknownError);
+#if QT_DEPRECATED_SINCE(5, 3)
QCOMPARE(obj2.number(), 123);
+#endif
QCOMPARE(obj2.nativeErrorCode(), QStringLiteral("123"));
QVERIFY(obj2.isValid());
}
void tst_QSqlError::operators()
{
- QSqlError error1;
- QSqlError error2;
- QSqlError error3;
-
- error1.setType(QSqlError::NoError);
- error2.setType(QSqlError::NoError);
- error3.setType(QSqlError::UnknownError);
+ QSqlError error1(QString(), QString(), QSqlError::NoError);
+ QSqlError error2(QString(), QString(), QSqlError::NoError);
+ QSqlError error3(QString(), QString(), QSqlError::UnknownError);
QCOMPARE(error1, error2);
QVERIFY(error1 != error3);
}
+void tst_QSqlError::qtbug_74575()
+{
+ const QString driverText(QStringLiteral("drivertext"));
+ const QString databaseText(QStringLiteral("databasetext"));
+ const QString databaseTextNewline(QStringLiteral("databasetext\n"));
+
+ QSqlError error1(driverText, databaseText,
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error1.text(), databaseText + QLatin1Char(' ') + driverText);
+
+ QSqlError error2(QString(), databaseText,
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error2.text(), databaseText);
+
+ QSqlError error3(driverText, QString(),
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error3.text(), driverText);
+
+ QSqlError error4(driverText, databaseTextNewline,
+ QSqlError::UnknownError, QStringLiteral("123"));
+ QCOMPARE(error4.text(), databaseTextNewline + driverText);
+}
QTEST_MAIN(tst_QSqlError)
#include "tst_qsqlerror.moc"
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index fd7f24f308..c75767a513 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -185,12 +185,6 @@ private slots:
void mysql_timeType_data() { generic_data("QMYSQL"); }
void mysql_timeType();
-#ifdef NOT_READY_YET
- void task_229811();
- void task_229811_data() { generic_data(); }
- void task_234422_data() { generic_data(); }
- void task_234422();
-#endif
void task_217003_data() { generic_data(); }
void task_217003();
@@ -3462,90 +3456,6 @@ void tst_QSqlQuery::crashQueryOnCloseDatabase()
}
}
-#ifdef NOT_READY_YET
-// For task: 229811
-void tst_QSqlQuery::task_229811()
-{
- QFETCH( QString, dbName );
- QSqlDatabase db = QSqlDatabase::database( dbName );
- CHECK_DATABASE( db );
-
- if (!db.driverName().startsWith( "QODBC" )) return;
-
- QSqlQuery q( db );
-
- const QString tableName(qTableName("task_229811", __FILE__, db));
-
- if ( !q.exec( "CREATE TABLE " + tableName + " (Word varchar(20))" ) ) {
- qDebug() << "Warning" << q.lastError();
- }
-
- QVERIFY_SQL( q, exec( "INSERT INTO " + tableName + " values ('Albert')" ) );
- QVERIFY_SQL( q, exec( "INSERT INTO " + tableName + " values ('Beehive')" ) );
- QVERIFY_SQL( q, exec( "INSERT INTO " + tableName + " values ('Alimony')" ) );
- QVERIFY_SQL( q, exec( "INSERT INTO " + tableName + " values ('Bohemian')" ) );
- QVERIFY_SQL( q, exec( "INSERT INTO " + tableName + " values ('AllStars')" ) );
-
-
- QString stmt = "SELECT * FROM " + tableName + " WHERE Word LIKE :name";
- QVERIFY_SQL(q,prepare(stmt));
- q.bindValue(":name", "A%");
- QVERIFY_SQL(q,exec());
-
- QVERIFY(q.isActive());
- QVERIFY(q.isSelect());
- QVERIFY(q.first());
-
- QSqlRecord rec = q.record();
- QCOMPARE(rec.field(0).value().toString(), QString("Albert"));
- QVERIFY(q.next());
- rec = q.record();
- QCOMPARE(rec.field(0).value().toString(), QString("Alimony"));
- QVERIFY(q.next());
- rec = q.record();
- QCOMPARE(rec.field(0).value().toString(),QString("AllStars"));
-
- q.exec("DROP TABLE " + tableName );
-}
-
-void tst_QSqlQuery::task_234422()
-{
- QFETCH( QString, dbName );
- QSqlDatabase db = QSqlDatabase::database( dbName );
- CHECK_DATABASE( db );
-
- QSqlQuery query(db);
- QStringList m_airlines;
- QStringList m_countries;
-
- m_airlines << "Lufthansa" << "SAS" << "United" << "KLM" << "Aeroflot";
- m_countries << "DE" << "SE" << "US" << "NL" << "RU";
-
- const QString tableName(qTableName("task_234422", __FILE__, db));
-
- QVERIFY_SQL(query,exec("CREATE TABLE " + tableName + " (id int primary key, "
- "name varchar(20), homecountry varchar(2))"));
- for (int i = 0; i < m_airlines.count(); ++i) {
- QVERIFY(query.exec(QString("INSERT INTO " + tableName + " values(%1, '%2', '%3')")
- .arg(i).arg(m_airlines[i], m_countries[i])));
- }
-
- QVERIFY_SQL(query, exec("SELECT name FROM " + tableName));
- QVERIFY(query.isSelect());
- QVERIFY(query.first());
- QVERIFY(query.next());
- QCOMPARE(query.at(), 1);
-
- QSqlQuery query2(query);
-
- QVERIFY_SQL(query2,exec());
- QVERIFY(query2.first());
- QCOMPARE(query2.at(), 0);
- QCOMPARE(query.at(), 1);
-}
-
-#endif
-
void tst_QSqlQuery::task_233829()
{
QFETCH( QString, dbName );
diff --git a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
index 09a842eb83..aa2cc05b56 100644
--- a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
+++ b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
@@ -345,7 +345,7 @@ void tst_QSqlThread::cleanupTestCase()
void tst_QSqlThread::init()
{
threadFinishedCount = 0;
- counter.store(4);
+ counter.storeRelaxed(4);
}
void tst_QSqlThread::cleanup()
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
index b617151a36..44dd4a74cf 100644
--- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -32,6 +32,7 @@
#include <QtSql>
#include <QtSql/private/qsqltablemodel_p.h>
#include <QThread>
+#include <QElapsedTimer>
const QString test(qTableName("test", __FILE__, QSqlDatabase())),
test2(qTableName("test2", __FILE__, QSqlDatabase())),
@@ -1804,12 +1805,12 @@ void tst_QSqlTableModel::sqlite_bigTable()
QSqlQuery q(db);
QVERIFY_SQL( q, exec("create table "+bigtable+"(id int primary key, name varchar)"));
QVERIFY_SQL( q, prepare("insert into "+bigtable+"(id, name) values (?, ?)"));
- QTime startTime;
- startTime.start();
+ QElapsedTimer timing;
+ timing.start();
for (int i = 0; i < 10000; ++i) {
q.addBindValue(i);
q.addBindValue(QString::number(i));
- if(i%1000 == 0 && startTime.elapsed() > 5000)
+ if (i % 1000 == 0 && timing.elapsed() > 5000)
qDebug() << i << "records written";
QVERIFY_SQL( q, exec());
}
diff --git a/tests/auto/testlib/initmain/initmain.pro b/tests/auto/testlib/initmain/initmain.pro
new file mode 100644
index 0000000000..4c12aba08d
--- /dev/null
+++ b/tests/auto/testlib/initmain/initmain.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase
+SOURCES += tst_initmain.cpp
+QT = core testlib
+
+TARGET = tst_initmain
diff --git a/tests/auto/testlib/initmain/tst_initmain.cpp b/tests/auto/testlib/initmain/tst_initmain.cpp
new file mode 100644
index 0000000000..f08f82c5ec
--- /dev/null
+++ b/tests/auto/testlib/initmain/tst_initmain.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtCore/QCoreApplication>
+#include <QtTest/QtTest>
+
+class tst_InitMain : public QObject
+{
+ Q_OBJECT
+
+public:
+ static void initMain() { m_initMainCalled = true; }
+
+private slots:
+ void testcase();
+
+private:
+ static bool m_initMainCalled;
+};
+
+bool tst_InitMain::m_initMainCalled = false;
+
+void tst_InitMain::testcase()
+{
+ QVERIFY(m_initMainCalled);
+}
+
+QTEST_MAIN(tst_InitMain)
+
+#include "tst_initmain.moc"
diff --git a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
index 60aa350145..b305eee0ec 100644
--- a/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
+++ b/tests/auto/testlib/qabstractitemmodeltester/tst_qabstractitemmodeltester.cpp
@@ -63,7 +63,7 @@ void tst_QAbstractItemModelTester::stringListModel()
model.setStringList(QStringList() << "a" << "e" << "plop" << "b" << "c");
proxy.setDynamicSortFilter(true);
- proxy.setFilterRegExp(QRegExp("[^b]"));
+ proxy.setFilterRegularExpression(QRegularExpression("[^b]"));
}
void tst_QAbstractItemModelTester::treeWidgetModel()
diff --git a/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp b/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
index df241c030e..9555c2a844 100644
--- a/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
+++ b/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
@@ -65,6 +65,11 @@ private slots:
void waitFunctionPointer_signalEmittedLater();
void waitFunctionPointer_signalEmittedTooLate();
void waitFunctionPointer_signalEmittedMultipleTimes();
+
+ void spyOnMetaMethod();
+
+ void spyOnMetaMethod_invalid();
+ void spyOnMetaMethod_invalid_data();
};
class QtTestObject: public QObject
@@ -432,5 +437,52 @@ void tst_QSignalSpy::waitFunctionPointer_signalEmittedMultipleTimes()
QCOMPARE(spy.count(), 3);
}
+void tst_QSignalSpy::spyOnMetaMethod()
+{
+ QObject obj;
+ auto mo = obj.metaObject();
+
+ auto signalIndex = mo->indexOfSignal("objectNameChanged(QString)");
+ QVERIFY(signalIndex != -1);
+
+ auto signal = mo->method(signalIndex);
+ QVERIFY(signal.isValid());
+ QCOMPARE(signal.methodType(), QMetaMethod::Signal);
+
+ QSignalSpy spy(&obj, signal);
+ QVERIFY(spy.isValid());
+
+ obj.setObjectName("A new object name");
+ QCOMPARE(spy.count(), 1);
+}
+
+Q_DECLARE_METATYPE(QMetaMethod);
+void tst_QSignalSpy::spyOnMetaMethod_invalid()
+{
+ QFETCH(QObject*, object);
+ QFETCH(QMetaMethod, signal);
+
+ QSignalSpy spy(object, signal);
+ QVERIFY(!spy.isValid());
+}
+
+void tst_QSignalSpy::spyOnMetaMethod_invalid_data()
+{
+ QTest::addColumn<QObject*>("object");
+ QTest::addColumn<QMetaMethod>("signal");
+
+ QTest::addRow("Invalid object")
+ << static_cast<QObject*>(nullptr)
+ << QMetaMethod();
+
+ QTest::addRow("Empty signal")
+ << new QObject(this)
+ << QMetaMethod();
+
+ QTest::addRow("Method is not a signal")
+ << new QObject(this)
+ << QObject::staticMetaObject.method(QObject::staticMetaObject.indexOfMethod("deleteLater()"));
+}
+
QTEST_MAIN(tst_QSignalSpy)
#include "tst_qsignalspy.moc"
diff --git a/tests/auto/testlib/selftests/alive/.gitignore b/tests/auto/testlib/selftests/alive/.gitignore
deleted file mode 100644
index 561285c5d0..0000000000
--- a/tests/auto/testlib/selftests/alive/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tst_alive
diff --git a/tests/auto/testlib/selftests/alive/alive.pro b/tests/auto/testlib/selftests/alive/alive.pro
deleted file mode 100644
index bda0db2282..0000000000
--- a/tests/auto/testlib/selftests/alive/alive.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-SOURCES += tst_alive.cpp
-QT = core testlib
-
-mac:CONFIG -= app_bundle
-CONFIG -= debug_and_release_target
-
-
-TARGET = alive
-
-include($$QT_SOURCE_TREE/src/testlib/selfcover.pri)
diff --git a/tests/auto/testlib/selftests/alive/qtestalive.cpp b/tests/auto/testlib/selftests/alive/qtestalive.cpp
deleted file mode 100644
index 0200f2a563..0000000000
--- a/tests/auto/testlib/selftests/alive/qtestalive.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include <qcoreapplication.h>
-#include <qcoreevent.h>
-#include <qthread.h>
-
-class QTestAliveEvent: public QEvent
-{
-public:
-
- enum { AliveEventType = QEvent::User + 422 };
-
- explicit inline QTestAliveEvent(int aSequenceId)
- : QEvent(QEvent::Type(AliveEventType)), seqId(aSequenceId)
- {}
- inline int sequenceId() const { return seqId; }
-
-private:
- int seqId;
-};
-
-class QTestAlivePinger: public QObject
-{
-public:
- QTestAlivePinger(QObject *receiver, QObject *parent = 0);
- bool event(QEvent *e);
-
-protected:
- void timerEvent(QTimerEvent *event);
-
-private:
- QObject *rec;
- int timerId;
- int currentSequenceId;
- int lastSequenceId;
-};
-
-QTestAlivePinger::QTestAlivePinger(QObject *receiver, QObject *parent)
- : QObject(parent), rec(receiver), currentSequenceId(0), lastSequenceId(0)
-{
- if (!rec)
- qFatal("Null receiver object passed to QTestAlivePinger::QTestAlivePinger()");
- timerId = startTimer(850);
-}
-
-bool QTestAlivePinger::event(QEvent *event)
-{
- // pong received
- if (int(event->type()) == QTestAliveEvent::AliveEventType) {
- QTestAliveEvent *e = static_cast<QTestAliveEvent *>(event);
- //qDebug("PONG %d received", e->sequenceId());
- // if the events are not delivered in order, we don't care.
- if (e->sequenceId() > lastSequenceId)
- lastSequenceId = e->sequenceId();
- return true;
- }
- return QObject::event(event);
-}
-
-void QTestAlivePinger::timerEvent(QTimerEvent *event)
-{
- if (event->timerId() != timerId)
- return;
-
- if (lastSequenceId < currentSequenceId - 2) {
- qWarning("TEST LAGS %d PINGS behind!", currentSequenceId - lastSequenceId);
- }
- ++currentSequenceId;
- //qDebug("PING %d", currentSequenceId);
- QCoreApplication::postEvent(rec, new QTestAliveEvent(currentSequenceId));
-}
-
-class QTestAlive: public QThread
-{
-public:
- QTestAlive(QObject *parent = 0);
- ~QTestAlive();
- void run();
-
- bool event(QEvent *e);
-
-private:
- QTestAlivePinger *pinger;
-};
-
-QTestAlive::QTestAlive(QObject *parent)
- : QThread(parent), pinger(0)
-{
-}
-
-QTestAlive::~QTestAlive()
-{
- quit();
- while (isRunning());
-}
-
-bool QTestAlive::event(QEvent *e)
-{
- if (int(e->type()) == QTestAliveEvent::AliveEventType && pinger) {
- // ping received, send back the pong
- //qDebug("PONG %d", static_cast<QTestAliveEvent *>(e)->sequenceId());
- QCoreApplication::postEvent(pinger,
- new QTestAliveEvent(static_cast<QTestAliveEvent *>(e)->sequenceId()));
- return true;
- }
- return QThread::event(e);
-}
-
-void QTestAlive::run()
-{
- if (!QCoreApplication::instance())
- qFatal("QTestAlive::run(): Cannot start QTestAlive without a QCoreApplication instance.");
-
- QTestAlivePinger p(this);
- pinger = &p;
- exec();
- pinger = 0;
-}
-
-
diff --git a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
index 2f6d633e9d..49c08982ad 100644
--- a/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
+++ b/tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
@@ -75,6 +75,17 @@ void tst_Blacklisted::xpass()
QVERIFY2(true, "This test should BXPASS");
}
+#ifndef Q_OS_WIN
+#include <signal.h>
+#include <setjmp.h>
+
+static jmp_buf state;
+static void abort_handler(int signal)
+{
+ longjmp(state, 1);
+}
+#endif
+
void tst_Blacklisted::messages()
{
qWarning("This is a warning that should not appear in silent test output");
@@ -83,7 +94,15 @@ void tst_Blacklisted::messages()
qCritical("This is a critical message that should not appear in silent test output");
qInfo("This is an info message that should not appear in silent test output");
QTestLog::info("This is an internal testlib info message that should not appear in silent test output", __FILE__, __LINE__);
- qFatal("This is a fatal error message that should still appear in silent test output");
+
+#ifndef Q_OS_WIN
+ // We're testing qFatal, but we don't want to actually std::abort() !
+ auto prior = signal(SIGABRT, abort_handler);
+ if (setjmp(state))
+ signal(SIGABRT, prior);
+ else
+#endif
+ qFatal("This is a fatal error message that should still appear in silent test output");
}
QTEST_MAIN(tst_Blacklisted)
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
index 8e2c7694a5..fb01b19d16 100644
--- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
@@ -256,7 +256,7 @@ void tst_Cmptest::compare_boolfuncs()
namespace {
template <typename T>
-T *null() Q_DECL_NOTHROW { return nullptr; }
+T *null() noexcept { return nullptr; }
}
void tst_Cmptest::compare_to_nullptr()
@@ -466,6 +466,8 @@ void tst_Cmptest::compareQPixmaps_data()
const QPixmap pixmap1(xpmPixmapData1);
const QPixmap pixmap2(xpmPixmapData2);
const QPixmap pixmap3(xpmPixmapData3);
+ QPixmap pixmapWrongDpr = pixmap1.scaled(2, 2);
+ pixmapWrongDpr.setDevicePixelRatio(2);
QTest::newRow("both null") << QPixmap() << QPixmap();
QTest::newRow("one null") << QPixmap() << pixmap1;
@@ -473,6 +475,7 @@ void tst_Cmptest::compareQPixmaps_data()
QTest::newRow("equal") << pixmap1 << pixmap1;
QTest::newRow("different size") << pixmap1 << pixmap3;
QTest::newRow("different pixels") << pixmap1 << pixmap2;
+ QTest::newRow("different dpr") << pixmap1 << pixmapWrongDpr;
}
void tst_Cmptest::compareQPixmaps()
@@ -492,6 +495,8 @@ void tst_Cmptest::compareQImages_data()
const QImage image2(QPixmap(xpmPixmapData2).toImage());
const QImage image1Indexed = image1.convertToFormat(QImage::Format_Indexed8);
const QImage image3(QPixmap(xpmPixmapData3).toImage());
+ QImage imageWrongDpr = image1.scaled(2, 2);
+ imageWrongDpr.setDevicePixelRatio(2);
QTest::newRow("both null") << QImage() << QImage();
QTest::newRow("one null") << QImage() << image1;
@@ -500,6 +505,7 @@ void tst_Cmptest::compareQImages_data()
QTest::newRow("different size") << image1 << image3;
QTest::newRow("different format") << image1 << image1Indexed;
QTest::newRow("different pixels") << image1 << image2;
+ QTest::newRow("different dpr") << image1 << imageWrongDpr;
}
void tst_Cmptest::compareQImages()
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index 58b5a5e530..f108933585 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -209,6 +209,12 @@
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[different dpr]]></DataTag>
+ <Description><![CDATA[Compared QPixmaps differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2]]></Description>
+</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQImages">
@@ -246,6 +252,12 @@
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[different dpr]]></DataTag>
+ <Description><![CDATA[Compared QImages differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2]]></Description>
+</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQRegion">
diff --git a/tests/auto/testlib/selftests/expected_cmptest.tap b/tests/auto/testlib/selftests/expected_cmptest.tap
index 238db2fc2b..dc9cb5c950 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.tap
+++ b/tests/auto/testlib/selftests/expected_cmptest.tap
@@ -245,9 +245,9 @@ not ok 32 - compareQPixmaps(one null)
found: 1 (opA).isNull()
expected: 0 (opB).isNull()
actual: 1 (opA).isNull()
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 483
+ line: 486
...
not ok 33 - compareQPixmaps(other null)
---
@@ -257,9 +257,9 @@ not ok 33 - compareQPixmaps(other null)
found: 0 (opA).isNull()
expected: 1 (opB).isNull()
actual: 0 (opA).isNull()
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 483
+ line: 486
...
ok 34 - compareQPixmaps(equal)
not ok 35 - compareQPixmaps(different size)
@@ -270,19 +270,31 @@ not ok 35 - compareQPixmaps(different size)
found: 11x20 (opA)
expected: 20x20 (opB)
actual: 11x20 (opA)
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 483
+ line: 486
...
not ok 36 - compareQPixmaps(different pixels)
---
# Compared values are not the same
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 483
+ line: 486
...
-ok 37 - compareQImages(both null)
-not ok 38 - compareQImages(one null)
+not ok 37 - compareQPixmaps(different dpr)
+ ---
+ type: QCOMPARE
+ message: Compared QPixmaps differ in device pixel ratio.
+ wanted: 2 (opB)
+ found: 1 (opA)
+ expected: 2 (opB)
+ actual: 1 (opA)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 486
+ ...
+ok 38 - compareQImages(both null)
+not ok 39 - compareQImages(one null)
---
type: QCOMPARE
message: Compared QImages differ.
@@ -290,11 +302,11 @@ not ok 38 - compareQImages(one null)
found: 1 (opA).isNull()
expected: 0 (opB).isNull()
actual: 1 (opA).isNull()
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 510
+ line: 516
...
-not ok 39 - compareQImages(other null)
+not ok 40 - compareQImages(other null)
---
type: QCOMPARE
message: Compared QImages differ.
@@ -302,12 +314,12 @@ not ok 39 - compareQImages(other null)
found: 0 (opA).isNull()
expected: 1 (opB).isNull()
actual: 0 (opA).isNull()
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 510
+ line: 516
...
-ok 40 - compareQImages(equal)
-not ok 41 - compareQImages(different size)
+ok 41 - compareQImages(equal)
+not ok 42 - compareQImages(different size)
---
type: QCOMPARE
message: Compared QImages differ in size.
@@ -315,11 +327,11 @@ not ok 41 - compareQImages(different size)
found: 11x20 (opA)
expected: 20x20 (opB)
actual: 11x20 (opA)
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 510
+ line: 516
...
-not ok 42 - compareQImages(different format)
+not ok 43 - compareQImages(different format)
---
type: QCOMPARE
message: Compared QImages differ in format.
@@ -327,19 +339,31 @@ not ok 42 - compareQImages(different format)
found: 6 (opA)
expected: 3 (opB)
actual: 6 (opA)
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 510
+ line: 516
...
-not ok 43 - compareQImages(different pixels)
+not ok 44 - compareQImages(different pixels)
---
# Compared values are not the same
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 516
+ ...
+not ok 45 - compareQImages(different dpr)
+ ---
+ type: QCOMPARE
+ message: Compared QImages differ in device pixel ratio.
+ wanted: 2 (opB)
+ found: 1 (opA)
+ expected: 2 (opB)
+ actual: 1 (opA)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 510
+ line: 516
...
-ok 44 - compareQRegion(equal-empty)
-not ok 45 - compareQRegion(1-empty)
+ok 46 - compareQRegion(equal-empty)
+not ok 47 - compareQRegion(1-empty)
---
type: QCOMPARE
message: Compared values are not the same
@@ -347,12 +371,12 @@ not ok 45 - compareQRegion(1-empty)
found: QRegion(200x50+10+10) (rA)
expected: QRegion(null) (rB)
actual: QRegion(200x50+10+10) (rA)
- at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:533)
+ at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:539)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 533
+ line: 539
...
-ok 46 - compareQRegion(equal)
-not ok 47 - compareQRegion(different lists)
+ok 48 - compareQRegion(equal)
+not ok 49 - compareQRegion(different lists)
---
type: QCOMPARE
message: Compared values are not the same
@@ -360,11 +384,11 @@ not ok 47 - compareQRegion(different lists)
found: QRegion(200x50+10+10) (rA)
expected: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB)
actual: QRegion(200x50+10+10) (rA)
- at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:533)
+ at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:539)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 533
+ line: 539
...
-not ok 48 - compareQVector2D()
+not ok 50 - compareQVector2D()
---
type: QCOMPARE
message: Compared values are not the same
@@ -372,11 +396,11 @@ not ok 48 - compareQVector2D()
found: QVector2D(1, 2) (v2a)
expected: QVector2D(1, 3) (v2b)
actual: QVector2D(1, 2) (v2a)
- at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:542)
+ at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:548)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 542
+ line: 548
...
-not ok 49 - compareQVector3D()
+not ok 51 - compareQVector3D()
---
type: QCOMPARE
message: Compared values are not the same
@@ -384,11 +408,11 @@ not ok 49 - compareQVector3D()
found: QVector3D(1, 2, 3) (v3a)
expected: QVector3D(1, 3, 3) (v3b)
actual: QVector3D(1, 2, 3) (v3a)
- at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:551)
+ at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:557)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 551
+ line: 557
...
-not ok 50 - compareQVector4D()
+not ok 52 - compareQVector4D()
---
type: QCOMPARE
message: Compared values are not the same
@@ -396,11 +420,11 @@ not ok 50 - compareQVector4D()
found: QVector4D(1, 2, 3, 4) (v4a)
expected: QVector4D(1, 3, 3, 4) (v4b)
actual: QVector4D(1, 2, 3, 4) (v4a)
- at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:560)
+ at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:566)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 560
+ line: 566
...
-not ok 51 - verify()
+not ok 53 - verify()
---
type: QVERIFY
message: Verification failed
@@ -408,11 +432,11 @@ not ok 51 - verify()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:572)
+ at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:578)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 572
+ line: 578
...
-not ok 52 - verify2()
+not ok 54 - verify2()
---
type: QVERIFY
message: 42
@@ -420,11 +444,11 @@ not ok 52 - verify2()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:578)
+ at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:584)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 578
+ line: 584
...
-not ok 53 - tryVerify()
+not ok 55 - tryVerify()
---
type: QVERIFY
message: Verification failed
@@ -432,11 +456,11 @@ not ok 53 - tryVerify()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:584)
+ at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 584
+ line: 590
...
-not ok 54 - tryVerify2()
+not ok 56 - tryVerify2()
---
type: QVERIFY
message: 42
@@ -444,13 +468,13 @@ not ok 54 - tryVerify2()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590)
+ at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:596)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 590
+ line: 596
...
-ok 55 - verifyExplicitOperatorBool()
-ok 56 - cleanupTestCase()
-1..56
-# tests 56
+ok 57 - verifyExplicitOperatorBool()
+ok 58 - cleanupTestCase()
+1..58
+# tests 58
# pass 18
-# fail 38
+# fail 40
diff --git a/tests/auto/testlib/selftests/expected_cmptest.teamcity b/tests/auto/testlib/selftests/expected_cmptest.teamcity
index 422d0cbfdf..426fddb20f 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.teamcity
+++ b/tests/auto/testlib/selftests/expected_cmptest.teamcity
@@ -95,6 +95,9 @@
##teamcity[testStarted name='compareQPixmaps(different pixels)' flowId='tst_Cmptest']
##teamcity[testFailed name='compareQPixmaps(different pixels)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQPixmaps(different pixels)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQPixmaps(different dpr)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQPixmaps(different dpr)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared QPixmaps differ in device pixel ratio.|n Actual (opA): 1|n Expected (opB): 2' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQPixmaps(different dpr)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQImages(both null)' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQImages(both null)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQImages(one null)' flowId='tst_Cmptest']
@@ -114,6 +117,9 @@
##teamcity[testStarted name='compareQImages(different pixels)' flowId='tst_Cmptest']
##teamcity[testFailed name='compareQImages(different pixels)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQImages(different pixels)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQImages(different dpr)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQImages(different dpr)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared QImages differ in device pixel ratio.|n Actual (opA): 1|n Expected (opB): 2' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQImages(different dpr)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQRegion(equal-empty)' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQRegion(equal-empty)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQRegion(1-empty)' flowId='tst_Cmptest']
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index e1aa81c1a1..08877ef74d 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -104,6 +104,10 @@ FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ i
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQPixmaps(different dpr) Compared QPixmaps differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::compareQImages(both null)
FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ.
Actual (opA).isNull(): 1
@@ -124,6 +128,10 @@ FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ i
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQImages(different dpr) Compared QImages differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::compareQRegion(equal-empty)
FAIL! : tst_Cmptest::compareQRegion(1-empty) Compared values are not the same
Actual (rA): QRegion(200x50+10+10)
@@ -156,5 +164,5 @@ FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::verifyExplicitOperatorBool()
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 18 passed, 38 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 18 passed, 40 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Cmptest *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index 1c5a17631a..daf2560f1b 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -211,6 +211,12 @@
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[different dpr]]></DataTag>
+ <Description><![CDATA[Compared QPixmaps differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2]]></Description>
+</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQImages">
@@ -248,6 +254,12 @@
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[different dpr]]></DataTag>
+ <Description><![CDATA[Compared QImages differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2]]></Description>
+</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQRegion">
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
index 99823d1c1c..397db4c3e4 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="38" tests="26" name="tst_Cmptest">
+<testsuite errors="0" failures="40" tests="26" name="tst_Cmptest">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -98,6 +98,9 @@
Actual (opA): 11x20
Expected (opB): 20x20" result="fail"/>
<failure tag="different pixels" message="Compared values are not the same" result="fail"/>
+ <failure tag="different dpr" message="Compared QPixmaps differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2" result="fail"/>
</testcase>
<testcase result="fail" name="compareQImages">
<failure tag="one null" message="Compared QImages differ.
@@ -113,6 +116,9 @@
Actual (opA): 6
Expected (opB): 3" result="fail"/>
<failure tag="different pixels" message="Compared values are not the same" result="fail"/>
+ <failure tag="different dpr" message="Compared QImages differ in device pixel ratio.
+ Actual (opA): 1
+ Expected (opB): 2" result="fail"/>
</testcase>
<testcase result="fail" name="compareQRegion">
<failure tag="1&#x002D;empty" message="Compared values are not the same
diff --git a/tests/auto/testlib/selftests/expected_crashes_5.txt b/tests/auto/testlib/selftests/expected_crashes_5.txt
new file mode 100644
index 0000000000..088b9c5324
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_crashes_5.txt
@@ -0,0 +1,5 @@
+********* Start testing of tst_Crashes *********
+Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+PASS : tst_Crashes::initTestCase()
+QFATAL : tst_Crashes::crash() Received signal 11
+ Function time: ms Total time: ms
diff --git a/tests/auto/testlib/selftests/expected_float.lightxml b/tests/auto/testlib/selftests/expected_float.lightxml
index 458f2277e6..5f5114bb2e 100644
--- a/tests/auto/testlib/selftests/expected_float.lightxml
+++ b/tests/auto/testlib/selftests/expected_float.lightxml
@@ -8,15 +8,15 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="doubleComparisons">
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[should PASS 1]]></DataTag>
-</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 1]]></DataTag>
<Description><![CDATA[Compared doubles are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3]]></Description>
</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 1]]></DataTag>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 2]]></DataTag>
<Description><![CDATA[Compared doubles are not the same (fuzzy compare)
@@ -428,21 +428,24 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="float16Comparisons">
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[should SUCCEED 1]]></DataTag>
-</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 1]]></DataTag>
<Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3]]></Description>
</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 1]]></DataTag>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 2]]></DataTag>
<Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 0.0001
Expected (operandRight): 0.0003]]></Description>
</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 2]]></DataTag>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 3]]></DataTag>
<Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
@@ -450,7 +453,187 @@
Expected (operandRight): 99]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[should SUCCEED 2]]></DataTag>
+ <DataTag><![CDATA[should PASS 3]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 4]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.93e-05
+ Expected (operandRight): 5.87e-05]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 4]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 5]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.94e+04
+ Expected (operandRight): 5.88e+04]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS: NaN == NaN]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: NaN != 0]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 0]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 0 != NaN]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: NaN != 1]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 1]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 1 != NaN]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS: inf == inf]]></DataTag>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS: -inf == -inf]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != nan]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: nan != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != nan]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: nan != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != 0]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 0]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 0 != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != 0]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 0]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 0 != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != 1]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 1]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 1 != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != 1]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 1]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 1 != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != -max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): -6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: max != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -max != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -6.55e+04
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != -max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): -6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: max != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -max != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -6.55e+04
+ Expected (operandRight): -inf]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_float.tap b/tests/auto/testlib/selftests/expected_float.tap
index 277dd2b1d4..9da51b93b3 100644
--- a/tests/auto/testlib/selftests/expected_float.tap
+++ b/tests/auto/testlib/selftests/expected_float.tap
@@ -1,8 +1,7 @@
TAP version 13
# tst_float
ok 1 - initTestCase()
-ok 2 - doubleComparisons(should PASS 1)
-not ok 3 - doubleComparisons(should FAIL 1)
+not ok 2 - doubleComparisons(should FAIL 1)
---
type: QCOMPARE
message: Compared doubles are not the same (fuzzy compare)
@@ -10,10 +9,11 @@ not ok 3 - doubleComparisons(should FAIL 1)
found: 1 (operandLeft)
expected: 3 (operandRight)
actual: 1 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
+ok 3 - doubleComparisons(should PASS 1)
not ok 4 - doubleComparisons(should FAIL 2)
---
type: QCOMPARE
@@ -22,9 +22,9 @@ not ok 4 - doubleComparisons(should FAIL 2)
found: 1e-07 (operandLeft)
expected: 3e-07 (operandRight)
actual: 1e-07 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
ok 5 - doubleComparisons(should PASS 2)
not ok 6 - doubleComparisons(should FAIL 3)
@@ -35,9 +35,9 @@ not ok 6 - doubleComparisons(should FAIL 3)
found: 999999999999 (operandLeft)
expected: 999999999998 (operandRight)
actual: 999999999999 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
ok 7 - doubleComparisons(should PASS 3)
not ok 8 - doubleComparisons(should FAIL 4)
@@ -48,9 +48,9 @@ not ok 8 - doubleComparisons(should FAIL 4)
found: 9.99999999999e-311 (operandLeft)
expected: 9.99999999997e-311 (operandRight)
actual: 9.99999999999e-311 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
ok 9 - doubleComparisons(should PASS 4)
not ok 10 - doubleComparisons(should FAIL 5)
@@ -61,9 +61,9 @@ not ok 10 - doubleComparisons(should FAIL 5)
found: 9.99999999999e+306 (operandLeft)
expected: 9.99999999997e+306 (operandRight)
actual: 9.99999999999e+306 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
ok 11 - doubleComparisons(should PASS: NaN == NaN)
not ok 12 - doubleComparisons(should FAIL: NaN != 0)
@@ -74,9 +74,9 @@ not ok 12 - doubleComparisons(should FAIL: NaN != 0)
found: nan (operandLeft)
expected: 0 (operandRight)
actual: nan (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 13 - doubleComparisons(should FAIL: 0 != NaN)
---
@@ -86,9 +86,9 @@ not ok 13 - doubleComparisons(should FAIL: 0 != NaN)
found: 0 (operandLeft)
expected: nan (operandRight)
actual: 0 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 14 - doubleComparisons(should FAIL: NaN != 1)
---
@@ -98,9 +98,9 @@ not ok 14 - doubleComparisons(should FAIL: NaN != 1)
found: nan (operandLeft)
expected: 1 (operandRight)
actual: nan (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 15 - doubleComparisons(should FAIL: 1 != NaN)
---
@@ -110,9 +110,9 @@ not ok 15 - doubleComparisons(should FAIL: 1 != NaN)
found: 1 (operandLeft)
expected: nan (operandRight)
actual: 1 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
ok 16 - doubleComparisons(should PASS: inf == inf)
ok 17 - doubleComparisons(should PASS: -inf == -inf)
@@ -124,9 +124,9 @@ not ok 18 - doubleComparisons(should FAIL: inf != -inf)
found: inf (operandLeft)
expected: -inf (operandRight)
actual: inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 19 - doubleComparisons(should FAIL: -inf != inf)
---
@@ -136,9 +136,9 @@ not ok 19 - doubleComparisons(should FAIL: -inf != inf)
found: -inf (operandLeft)
expected: inf (operandRight)
actual: -inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 20 - doubleComparisons(should FAIL: inf != nan)
---
@@ -148,9 +148,9 @@ not ok 20 - doubleComparisons(should FAIL: inf != nan)
found: inf (operandLeft)
expected: nan (operandRight)
actual: inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 21 - doubleComparisons(should FAIL: nan != inf)
---
@@ -160,9 +160,9 @@ not ok 21 - doubleComparisons(should FAIL: nan != inf)
found: nan (operandLeft)
expected: inf (operandRight)
actual: nan (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 22 - doubleComparisons(should FAIL: -inf != nan)
---
@@ -172,9 +172,9 @@ not ok 22 - doubleComparisons(should FAIL: -inf != nan)
found: -inf (operandLeft)
expected: nan (operandRight)
actual: -inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 23 - doubleComparisons(should FAIL: nan != -inf)
---
@@ -184,9 +184,9 @@ not ok 23 - doubleComparisons(should FAIL: nan != -inf)
found: nan (operandLeft)
expected: -inf (operandRight)
actual: nan (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 24 - doubleComparisons(should FAIL: inf != 0)
---
@@ -196,9 +196,9 @@ not ok 24 - doubleComparisons(should FAIL: inf != 0)
found: inf (operandLeft)
expected: 0 (operandRight)
actual: inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 25 - doubleComparisons(should FAIL: 0 != inf)
---
@@ -208,9 +208,9 @@ not ok 25 - doubleComparisons(should FAIL: 0 != inf)
found: 0 (operandLeft)
expected: inf (operandRight)
actual: 0 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 26 - doubleComparisons(should FAIL: -inf != 0)
---
@@ -220,9 +220,9 @@ not ok 26 - doubleComparisons(should FAIL: -inf != 0)
found: -inf (operandLeft)
expected: 0 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 27 - doubleComparisons(should FAIL: 0 != -inf)
---
@@ -232,9 +232,9 @@ not ok 27 - doubleComparisons(should FAIL: 0 != -inf)
found: 0 (operandLeft)
expected: -inf (operandRight)
actual: 0 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 28 - doubleComparisons(should FAIL: inf != 1)
---
@@ -244,9 +244,9 @@ not ok 28 - doubleComparisons(should FAIL: inf != 1)
found: inf (operandLeft)
expected: 1 (operandRight)
actual: inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 29 - doubleComparisons(should FAIL: 1 != inf)
---
@@ -256,9 +256,9 @@ not ok 29 - doubleComparisons(should FAIL: 1 != inf)
found: 1 (operandLeft)
expected: inf (operandRight)
actual: 1 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 30 - doubleComparisons(should FAIL: -inf != 1)
---
@@ -268,9 +268,9 @@ not ok 30 - doubleComparisons(should FAIL: -inf != 1)
found: -inf (operandLeft)
expected: 1 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 31 - doubleComparisons(should FAIL: 1 != -inf)
---
@@ -280,9 +280,9 @@ not ok 31 - doubleComparisons(should FAIL: 1 != -inf)
found: 1 (operandLeft)
expected: -inf (operandRight)
actual: 1 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 32 - doubleComparisons(should FAIL: inf != max)
---
@@ -292,9 +292,9 @@ not ok 32 - doubleComparisons(should FAIL: inf != max)
found: inf (operandLeft)
expected: 1.79769313486e+308 (operandRight)
actual: inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 33 - doubleComparisons(should FAIL: inf != -max)
---
@@ -304,9 +304,9 @@ not ok 33 - doubleComparisons(should FAIL: inf != -max)
found: inf (operandLeft)
expected: -1.79769313486e+308 (operandRight)
actual: inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 34 - doubleComparisons(should FAIL: max != inf)
---
@@ -316,9 +316,9 @@ not ok 34 - doubleComparisons(should FAIL: max != inf)
found: 1.79769313486e+308 (operandLeft)
expected: inf (operandRight)
actual: 1.79769313486e+308 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 35 - doubleComparisons(should FAIL: -max != inf)
---
@@ -328,9 +328,9 @@ not ok 35 - doubleComparisons(should FAIL: -max != inf)
found: -1.79769313486e+308 (operandLeft)
expected: inf (operandRight)
actual: -1.79769313486e+308 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 36 - doubleComparisons(should FAIL: -inf != max)
---
@@ -340,9 +340,9 @@ not ok 36 - doubleComparisons(should FAIL: -inf != max)
found: -inf (operandLeft)
expected: 1.79769313486e+308 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 37 - doubleComparisons(should FAIL: -inf != -max)
---
@@ -352,9 +352,9 @@ not ok 37 - doubleComparisons(should FAIL: -inf != -max)
found: -inf (operandLeft)
expected: -1.79769313486e+308 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 38 - doubleComparisons(should FAIL: max != -inf)
---
@@ -364,9 +364,9 @@ not ok 38 - doubleComparisons(should FAIL: max != -inf)
found: 1.79769313486e+308 (operandLeft)
expected: -inf (operandRight)
actual: 1.79769313486e+308 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 39 - doubleComparisons(should FAIL: -max != -inf)
---
@@ -376,9 +376,9 @@ not ok 39 - doubleComparisons(should FAIL: -max != -inf)
found: -1.79769313486e+308 (operandLeft)
expected: -inf (operandRight)
actual: -1.79769313486e+308 (operandLeft)
- at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:54)
+ at: tst_float::doubleComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:103)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 54
+ line: 103
...
not ok 40 - floatComparisons(should FAIL 1)
---
@@ -388,9 +388,9 @@ not ok 40 - floatComparisons(should FAIL 1)
found: 1 (operandLeft)
expected: 3 (operandRight)
actual: 1 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
ok 41 - floatComparisons(should PASS 1)
not ok 42 - floatComparisons(should FAIL 2)
@@ -401,9 +401,9 @@ not ok 42 - floatComparisons(should FAIL 2)
found: 1e-07 (operandLeft)
expected: 3e-07 (operandRight)
actual: 1e-07 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
ok 43 - floatComparisons(should PASS 2)
not ok 44 - floatComparisons(should FAIL 3)
@@ -414,9 +414,9 @@ not ok 44 - floatComparisons(should FAIL 3)
found: 99999 (operandLeft)
expected: 99998 (operandRight)
actual: 99999 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
ok 45 - floatComparisons(should PASS 3)
not ok 46 - floatComparisons(should FAIL 4)
@@ -427,9 +427,9 @@ not ok 46 - floatComparisons(should FAIL 4)
found: 9.9999e-40 (operandLeft)
expected: 9.99971e-40 (operandRight)
actual: 9.9999e-40 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
ok 47 - floatComparisons(should PASS 4)
not ok 48 - floatComparisons(should FAIL 5)
@@ -440,9 +440,9 @@ not ok 48 - floatComparisons(should FAIL 5)
found: 9.9999e+37 (operandLeft)
expected: 9.9997e+37 (operandRight)
actual: 9.9999e+37 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
ok 49 - floatComparisons(should PASS: NaN == NaN)
not ok 50 - floatComparisons(should FAIL: NaN != 0)
@@ -453,9 +453,9 @@ not ok 50 - floatComparisons(should FAIL: NaN != 0)
found: nan (operandLeft)
expected: 0 (operandRight)
actual: nan (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 51 - floatComparisons(should FAIL: 0 != NaN)
---
@@ -465,9 +465,9 @@ not ok 51 - floatComparisons(should FAIL: 0 != NaN)
found: 0 (operandLeft)
expected: nan (operandRight)
actual: 0 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 52 - floatComparisons(should FAIL: NaN != 1)
---
@@ -477,9 +477,9 @@ not ok 52 - floatComparisons(should FAIL: NaN != 1)
found: nan (operandLeft)
expected: 1 (operandRight)
actual: nan (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 53 - floatComparisons(should FAIL: 1 != NaN)
---
@@ -489,9 +489,9 @@ not ok 53 - floatComparisons(should FAIL: 1 != NaN)
found: 1 (operandLeft)
expected: nan (operandRight)
actual: 1 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
ok 54 - floatComparisons(should PASS: inf == inf)
ok 55 - floatComparisons(should PASS: -inf == -inf)
@@ -503,9 +503,9 @@ not ok 56 - floatComparisons(should FAIL: inf != -inf)
found: inf (operandLeft)
expected: -inf (operandRight)
actual: inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 57 - floatComparisons(should FAIL: -inf != inf)
---
@@ -515,9 +515,9 @@ not ok 57 - floatComparisons(should FAIL: -inf != inf)
found: -inf (operandLeft)
expected: inf (operandRight)
actual: -inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 58 - floatComparisons(should FAIL: inf != nan)
---
@@ -527,9 +527,9 @@ not ok 58 - floatComparisons(should FAIL: inf != nan)
found: inf (operandLeft)
expected: nan (operandRight)
actual: inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 59 - floatComparisons(should FAIL: nan != inf)
---
@@ -539,9 +539,9 @@ not ok 59 - floatComparisons(should FAIL: nan != inf)
found: nan (operandLeft)
expected: inf (operandRight)
actual: nan (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 60 - floatComparisons(should FAIL: -inf != nan)
---
@@ -551,9 +551,9 @@ not ok 60 - floatComparisons(should FAIL: -inf != nan)
found: -inf (operandLeft)
expected: nan (operandRight)
actual: -inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 61 - floatComparisons(should FAIL: nan != -inf)
---
@@ -563,9 +563,9 @@ not ok 61 - floatComparisons(should FAIL: nan != -inf)
found: nan (operandLeft)
expected: -inf (operandRight)
actual: nan (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 62 - floatComparisons(should FAIL: inf != 0)
---
@@ -575,9 +575,9 @@ not ok 62 - floatComparisons(should FAIL: inf != 0)
found: inf (operandLeft)
expected: 0 (operandRight)
actual: inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 63 - floatComparisons(should FAIL: 0 != inf)
---
@@ -587,9 +587,9 @@ not ok 63 - floatComparisons(should FAIL: 0 != inf)
found: 0 (operandLeft)
expected: inf (operandRight)
actual: 0 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 64 - floatComparisons(should FAIL: -inf != 0)
---
@@ -599,9 +599,9 @@ not ok 64 - floatComparisons(should FAIL: -inf != 0)
found: -inf (operandLeft)
expected: 0 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 65 - floatComparisons(should FAIL: 0 != -inf)
---
@@ -611,9 +611,9 @@ not ok 65 - floatComparisons(should FAIL: 0 != -inf)
found: 0 (operandLeft)
expected: -inf (operandRight)
actual: 0 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 66 - floatComparisons(should FAIL: inf != 1)
---
@@ -623,9 +623,9 @@ not ok 66 - floatComparisons(should FAIL: inf != 1)
found: inf (operandLeft)
expected: 1 (operandRight)
actual: inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 67 - floatComparisons(should FAIL: 1 != inf)
---
@@ -635,9 +635,9 @@ not ok 67 - floatComparisons(should FAIL: 1 != inf)
found: 1 (operandLeft)
expected: inf (operandRight)
actual: 1 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 68 - floatComparisons(should FAIL: -inf != 1)
---
@@ -647,9 +647,9 @@ not ok 68 - floatComparisons(should FAIL: -inf != 1)
found: -inf (operandLeft)
expected: 1 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 69 - floatComparisons(should FAIL: 1 != -inf)
---
@@ -659,9 +659,9 @@ not ok 69 - floatComparisons(should FAIL: 1 != -inf)
found: 1 (operandLeft)
expected: -inf (operandRight)
actual: 1 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 70 - floatComparisons(should FAIL: inf != max)
---
@@ -671,9 +671,9 @@ not ok 70 - floatComparisons(should FAIL: inf != max)
found: inf (operandLeft)
expected: 3.40282e+38 (operandRight)
actual: inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 71 - floatComparisons(should FAIL: inf != -max)
---
@@ -683,9 +683,9 @@ not ok 71 - floatComparisons(should FAIL: inf != -max)
found: inf (operandLeft)
expected: -3.40282e+38 (operandRight)
actual: inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 72 - floatComparisons(should FAIL: max != inf)
---
@@ -695,9 +695,9 @@ not ok 72 - floatComparisons(should FAIL: max != inf)
found: 3.40282e+38 (operandLeft)
expected: inf (operandRight)
actual: 3.40282e+38 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 73 - floatComparisons(should FAIL: -max != inf)
---
@@ -707,9 +707,9 @@ not ok 73 - floatComparisons(should FAIL: -max != inf)
found: -3.40282e+38 (operandLeft)
expected: inf (operandRight)
actual: -3.40282e+38 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 74 - floatComparisons(should FAIL: -inf != max)
---
@@ -719,9 +719,9 @@ not ok 74 - floatComparisons(should FAIL: -inf != max)
found: -inf (operandLeft)
expected: 3.40282e+38 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 75 - floatComparisons(should FAIL: -inf != -max)
---
@@ -731,9 +731,9 @@ not ok 75 - floatComparisons(should FAIL: -inf != -max)
found: -inf (operandLeft)
expected: -3.40282e+38 (operandRight)
actual: -inf (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 76 - floatComparisons(should FAIL: max != -inf)
---
@@ -743,9 +743,9 @@ not ok 76 - floatComparisons(should FAIL: max != -inf)
found: 3.40282e+38 (operandLeft)
expected: -inf (operandRight)
actual: 3.40282e+38 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
not ok 77 - floatComparisons(should FAIL: -max != -inf)
---
@@ -755,12 +755,11 @@ not ok 77 - floatComparisons(should FAIL: -max != -inf)
found: -3.40282e+38 (operandLeft)
expected: -inf (operandRight)
actual: -3.40282e+38 (operandLeft)
- at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:127)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:137)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 127
+ line: 137
...
-ok 78 - float16Comparisons(should SUCCEED 1)
-not ok 79 - float16Comparisons(should FAIL 1)
+not ok 78 - float16Comparisons(should FAIL 1)
---
type: QCOMPARE
message: Compared qfloat16s are not the same (fuzzy compare)
@@ -768,10 +767,11 @@ not ok 79 - float16Comparisons(should FAIL 1)
found: 1 (operandLeft)
expected: 3 (operandRight)
actual: 1 (operandLeft)
- at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:200)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 200
+ line: 171
...
+ok 79 - float16Comparisons(should PASS 1)
not ok 80 - float16Comparisons(should FAIL 2)
---
type: QCOMPARE
@@ -780,11 +780,12 @@ not ok 80 - float16Comparisons(should FAIL 2)
found: 0.0001 (operandLeft)
expected: 0.0003 (operandRight)
actual: 0.0001 (operandLeft)
- at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:200)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 200
+ line: 171
...
-not ok 81 - float16Comparisons(should FAIL 3)
+ok 81 - float16Comparisons(should PASS 2)
+not ok 82 - float16Comparisons(should FAIL 3)
---
type: QCOMPARE
message: Compared qfloat16s are not the same (fuzzy compare)
@@ -792,12 +793,352 @@ not ok 81 - float16Comparisons(should FAIL 3)
found: 98 (operandLeft)
expected: 99 (operandRight)
actual: 98 (operandLeft)
- at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:200)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 200
+ line: 171
...
-ok 82 - float16Comparisons(should SUCCEED 2)
-not ok 83 - compareFloatTests(1e0)
+ok 83 - float16Comparisons(should PASS 3)
+not ok 84 - float16Comparisons(should FAIL 4)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 5.87e-05 (operandRight)
+ found: 5.93e-05 (operandLeft)
+ expected: 5.87e-05 (operandRight)
+ actual: 5.93e-05 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+ok 85 - float16Comparisons(should PASS 4)
+not ok 86 - float16Comparisons(should FAIL 5)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 5.88e+04 (operandRight)
+ found: 5.94e+04 (operandLeft)
+ expected: 5.88e+04 (operandRight)
+ actual: 5.94e+04 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+ok 87 - float16Comparisons(should PASS: NaN == NaN)
+not ok 88 - float16Comparisons(should FAIL: NaN != 0)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 0 (operandRight)
+ found: nan (operandLeft)
+ expected: 0 (operandRight)
+ actual: nan (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 89 - float16Comparisons(should FAIL: 0 != NaN)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: nan (operandRight)
+ found: 0 (operandLeft)
+ expected: nan (operandRight)
+ actual: 0 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 90 - float16Comparisons(should FAIL: NaN != 1)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 1 (operandRight)
+ found: nan (operandLeft)
+ expected: 1 (operandRight)
+ actual: nan (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 91 - float16Comparisons(should FAIL: 1 != NaN)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: nan (operandRight)
+ found: 1 (operandLeft)
+ expected: nan (operandRight)
+ actual: 1 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+ok 92 - float16Comparisons(should PASS: inf == inf)
+ok 93 - float16Comparisons(should PASS: -inf == -inf)
+not ok 94 - float16Comparisons(should FAIL: inf != -inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -inf (operandRight)
+ found: inf (operandLeft)
+ expected: -inf (operandRight)
+ actual: inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 95 - float16Comparisons(should FAIL: -inf != inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: inf (operandRight)
+ found: -inf (operandLeft)
+ expected: inf (operandRight)
+ actual: -inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 96 - float16Comparisons(should FAIL: inf != nan)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: nan (operandRight)
+ found: inf (operandLeft)
+ expected: nan (operandRight)
+ actual: inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 97 - float16Comparisons(should FAIL: nan != inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: inf (operandRight)
+ found: nan (operandLeft)
+ expected: inf (operandRight)
+ actual: nan (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 98 - float16Comparisons(should FAIL: -inf != nan)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: nan (operandRight)
+ found: -inf (operandLeft)
+ expected: nan (operandRight)
+ actual: -inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 99 - float16Comparisons(should FAIL: nan != -inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -inf (operandRight)
+ found: nan (operandLeft)
+ expected: -inf (operandRight)
+ actual: nan (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 100 - float16Comparisons(should FAIL: inf != 0)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 0 (operandRight)
+ found: inf (operandLeft)
+ expected: 0 (operandRight)
+ actual: inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 101 - float16Comparisons(should FAIL: 0 != inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: inf (operandRight)
+ found: 0 (operandLeft)
+ expected: inf (operandRight)
+ actual: 0 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 102 - float16Comparisons(should FAIL: -inf != 0)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 0 (operandRight)
+ found: -inf (operandLeft)
+ expected: 0 (operandRight)
+ actual: -inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 103 - float16Comparisons(should FAIL: 0 != -inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -inf (operandRight)
+ found: 0 (operandLeft)
+ expected: -inf (operandRight)
+ actual: 0 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 104 - float16Comparisons(should FAIL: inf != 1)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 1 (operandRight)
+ found: inf (operandLeft)
+ expected: 1 (operandRight)
+ actual: inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 105 - float16Comparisons(should FAIL: 1 != inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: inf (operandRight)
+ found: 1 (operandLeft)
+ expected: inf (operandRight)
+ actual: 1 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 106 - float16Comparisons(should FAIL: -inf != 1)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 1 (operandRight)
+ found: -inf (operandLeft)
+ expected: 1 (operandRight)
+ actual: -inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 107 - float16Comparisons(should FAIL: 1 != -inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -inf (operandRight)
+ found: 1 (operandLeft)
+ expected: -inf (operandRight)
+ actual: 1 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 108 - float16Comparisons(should FAIL: inf != max)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 6.55e+04 (operandRight)
+ found: inf (operandLeft)
+ expected: 6.55e+04 (operandRight)
+ actual: inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 109 - float16Comparisons(should FAIL: inf != -max)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -6.55e+04 (operandRight)
+ found: inf (operandLeft)
+ expected: -6.55e+04 (operandRight)
+ actual: inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 110 - float16Comparisons(should FAIL: max != inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: inf (operandRight)
+ found: 6.55e+04 (operandLeft)
+ expected: inf (operandRight)
+ actual: 6.55e+04 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 111 - float16Comparisons(should FAIL: -max != inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: inf (operandRight)
+ found: -6.55e+04 (operandLeft)
+ expected: inf (operandRight)
+ actual: -6.55e+04 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 112 - float16Comparisons(should FAIL: -inf != max)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: 6.55e+04 (operandRight)
+ found: -inf (operandLeft)
+ expected: 6.55e+04 (operandRight)
+ actual: -inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 113 - float16Comparisons(should FAIL: -inf != -max)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -6.55e+04 (operandRight)
+ found: -inf (operandLeft)
+ expected: -6.55e+04 (operandRight)
+ actual: -inf (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 114 - float16Comparisons(should FAIL: max != -inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -inf (operandRight)
+ found: 6.55e+04 (operandLeft)
+ expected: -inf (operandRight)
+ actual: 6.55e+04 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 115 - float16Comparisons(should FAIL: -max != -inf)
+ ---
+ type: QCOMPARE
+ message: Compared qfloat16s are not the same (fuzzy compare)
+ wanted: -inf (operandRight)
+ found: -6.55e+04 (operandLeft)
+ expected: -inf (operandRight)
+ actual: -6.55e+04 (operandLeft)
+ at: tst_float::float16Comparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 171
+ ...
+not ok 116 - compareFloatTests(1e0)
---
type: QCOMPARE
message: Compared floats are not the same (fuzzy compare)
@@ -805,11 +1146,11 @@ not ok 83 - compareFloatTests(1e0)
found: 1 (t1)
expected: 3 (t3)
actual: 1 (t1)
- at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:245)
+ at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:210)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 245
+ line: 210
...
-not ok 84 - compareFloatTests(1e-7)
+not ok 117 - compareFloatTests(1e-7)
---
type: QCOMPARE
message: Compared floats are not the same (fuzzy compare)
@@ -817,11 +1158,11 @@ not ok 84 - compareFloatTests(1e-7)
found: 1e-07 (t1)
expected: 3e-07 (t3)
actual: 1e-07 (t1)
- at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:245)
+ at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:210)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 245
+ line: 210
...
-not ok 85 - compareFloatTests(1e+7)
+not ok 118 - compareFloatTests(1e+7)
---
type: QCOMPARE
message: Compared floats are not the same (fuzzy compare)
@@ -829,12 +1170,12 @@ not ok 85 - compareFloatTests(1e+7)
found: 1e+07 (t1)
expected: 3e+07 (t3)
actual: 1e+07 (t1)
- at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:245)
+ at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:210)
file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
- line: 245
+ line: 210
...
-ok 86 - cleanupTestCase()
-1..86
-# tests 86
-# pass 18
-# fail 68
+ok 119 - cleanupTestCase()
+1..119
+# tests 119
+# pass 23
+# fail 96
diff --git a/tests/auto/testlib/selftests/expected_float.teamcity b/tests/auto/testlib/selftests/expected_float.teamcity
index e23bc722b1..af81296c42 100644
--- a/tests/auto/testlib/selftests/expected_float.teamcity
+++ b/tests/auto/testlib/selftests/expected_float.teamcity
@@ -1,11 +1,11 @@
##teamcity[testSuiteStarted name='tst_float' flowId='tst_float']
##teamcity[testStarted name='initTestCase()' flowId='tst_float']
##teamcity[testFinished name='initTestCase()' flowId='tst_float']
-##teamcity[testStarted name='doubleComparisons(should PASS 1)' flowId='tst_float']
-##teamcity[testFinished name='doubleComparisons(should PASS 1)' flowId='tst_float']
##teamcity[testStarted name='doubleComparisons(should FAIL 1)' flowId='tst_float']
##teamcity[testFailed name='doubleComparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float']
##teamcity[testFinished name='doubleComparisons(should FAIL 1)' flowId='tst_float']
+##teamcity[testStarted name='doubleComparisons(should PASS 1)' flowId='tst_float']
+##teamcity[testFinished name='doubleComparisons(should PASS 1)' flowId='tst_float']
##teamcity[testStarted name='doubleComparisons(should FAIL 2)' flowId='tst_float']
##teamcity[testFailed name='doubleComparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared doubles are not the same (fuzzy compare)|n Actual (operandLeft) : 1e-07|n Expected (operandRight): 3e-07' flowId='tst_float']
##teamcity[testFinished name='doubleComparisons(should FAIL 2)' flowId='tst_float']
@@ -215,19 +215,113 @@
##teamcity[testStarted name='floatComparisons(should FAIL: -max != -inf)' flowId='tst_float']
##teamcity[testFailed name='floatComparisons(should FAIL: -max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (operandLeft) : -3.40282e+38|n Expected (operandRight): -inf' flowId='tst_float']
##teamcity[testFinished name='floatComparisons(should FAIL: -max != -inf)' flowId='tst_float']
-##teamcity[testStarted name='float16Comparisons(should SUCCEED 1)' flowId='tst_float']
-##teamcity[testFinished name='float16Comparisons(should SUCCEED 1)' flowId='tst_float']
##teamcity[testStarted name='float16Comparisons(should FAIL 1)' flowId='tst_float']
##teamcity[testFailed name='float16Comparisons(should FAIL 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): 3' flowId='tst_float']
##teamcity[testFinished name='float16Comparisons(should FAIL 1)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS 1)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS 1)' flowId='tst_float']
##teamcity[testStarted name='float16Comparisons(should FAIL 2)' flowId='tst_float']
##teamcity[testFailed name='float16Comparisons(should FAIL 2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0.0001|n Expected (operandRight): 0.0003' flowId='tst_float']
##teamcity[testFinished name='float16Comparisons(should FAIL 2)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS 2)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS 2)' flowId='tst_float']
##teamcity[testStarted name='float16Comparisons(should FAIL 3)' flowId='tst_float']
##teamcity[testFailed name='float16Comparisons(should FAIL 3)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 98|n Expected (operandRight): 99' flowId='tst_float']
##teamcity[testFinished name='float16Comparisons(should FAIL 3)' flowId='tst_float']
-##teamcity[testStarted name='float16Comparisons(should SUCCEED 2)' flowId='tst_float']
-##teamcity[testFinished name='float16Comparisons(should SUCCEED 2)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS 3)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS 3)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL 4)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL 4)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 5.93e-05|n Expected (operandRight): 5.87e-05' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL 4)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS 4)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS 4)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL 5)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL 5)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 5.94e+04|n Expected (operandRight): 5.88e+04' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL 5)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS: NaN == NaN)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS: NaN == NaN)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: NaN != 0)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: NaN != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): 0' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: NaN != 0)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: 0 != NaN)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: 0 != NaN)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): nan' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: 0 != NaN)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: NaN != 1)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: NaN != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): 1' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: NaN != 1)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: 1 != NaN)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: 1 != NaN)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): nan' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: 1 != NaN)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS: inf == inf)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS: inf == inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should PASS: -inf == -inf)' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should PASS: -inf == -inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: inf != -inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: inf != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): -inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: inf != -inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -inf != inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -inf != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -inf != inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: inf != nan)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: inf != nan)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): nan' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: inf != nan)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: nan != inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: nan != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: nan != inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -inf != nan)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -inf != nan)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): nan' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -inf != nan)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: nan != -inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: nan != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : nan|n Expected (operandRight): -inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: nan != -inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: inf != 0)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: inf != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 0' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: inf != 0)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: 0 != inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: 0 != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: 0 != inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -inf != 0)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -inf != 0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 0' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -inf != 0)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: 0 != -inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: 0 != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 0|n Expected (operandRight): -inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: 0 != -inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: inf != 1)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: inf != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 1' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: inf != 1)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: 1 != inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: 1 != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: 1 != inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -inf != 1)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -inf != 1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 1' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -inf != 1)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: 1 != -inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: 1 != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 1|n Expected (operandRight): -inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: 1 != -inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: inf != max)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: inf != max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): 6.55e+04' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: inf != max)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: inf != -max)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: inf != -max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : inf|n Expected (operandRight): -6.55e+04' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: inf != -max)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: max != inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: max != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 6.55e+04|n Expected (operandRight): inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: max != inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -max != inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -max != inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -6.55e+04|n Expected (operandRight): inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -max != inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -inf != max)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -inf != max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): 6.55e+04' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -inf != max)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -inf != -max)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -inf != -max)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -inf|n Expected (operandRight): -6.55e+04' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -inf != -max)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: max != -inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : 6.55e+04|n Expected (operandRight): -inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: max != -inf)' flowId='tst_float']
+##teamcity[testStarted name='float16Comparisons(should FAIL: -max != -inf)' flowId='tst_float']
+##teamcity[testFailed name='float16Comparisons(should FAIL: -max != -inf)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared qfloat16s are not the same (fuzzy compare)|n Actual (operandLeft) : -6.55e+04|n Expected (operandRight): -inf' flowId='tst_float']
+##teamcity[testFinished name='float16Comparisons(should FAIL: -max != -inf)' flowId='tst_float']
##teamcity[testStarted name='compareFloatTests(1e0)' flowId='tst_float']
##teamcity[testFailed name='compareFloatTests(1e0)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)|]' details='Compared floats are not the same (fuzzy compare)|n Actual (t1): 1|n Expected (t3): 3' flowId='tst_float']
##teamcity[testFinished name='compareFloatTests(1e0)' flowId='tst_float']
diff --git a/tests/auto/testlib/selftests/expected_float.txt b/tests/auto/testlib/selftests/expected_float.txt
index 6419a13f86..d22a52a63d 100644
--- a/tests/auto/testlib/selftests/expected_float.txt
+++ b/tests/auto/testlib/selftests/expected_float.txt
@@ -1,11 +1,11 @@
********* Start testing of tst_float *********
Config: Using QtTest library
PASS : tst_float::initTestCase()
-PASS : tst_float::doubleComparisons(should PASS 1)
FAIL! : tst_float::doubleComparisons(should FAIL 1) Compared doubles are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+PASS : tst_float::doubleComparisons(should PASS 1)
FAIL! : tst_float::doubleComparisons(should FAIL 2) Compared doubles are not the same (fuzzy compare)
Actual (operandLeft) : 1e-07
Expected (operandRight): 3e-07
@@ -263,20 +263,137 @@ FAIL! : tst_float::floatComparisons(should FAIL: -max != -inf) Compared floats
Actual (operandLeft) : -3.40282e+38
Expected (operandRight): -inf
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
-PASS : tst_float::float16Comparisons(should SUCCEED 1)
FAIL! : tst_float::float16Comparisons(should FAIL 1) Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+PASS : tst_float::float16Comparisons(should PASS 1)
FAIL! : tst_float::float16Comparisons(should FAIL 2) Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 0.0001
Expected (operandRight): 0.0003
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+PASS : tst_float::float16Comparisons(should PASS 2)
FAIL! : tst_float::float16Comparisons(should FAIL 3) Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 98
Expected (operandRight): 99
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
-PASS : tst_float::float16Comparisons(should SUCCEED 2)
+PASS : tst_float::float16Comparisons(should PASS 3)
+FAIL! : tst_float::float16Comparisons(should FAIL 4) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.93e-05
+ Expected (operandRight): 5.87e-05
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+PASS : tst_float::float16Comparisons(should PASS 4)
+FAIL! : tst_float::float16Comparisons(should FAIL 5) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.94e+04
+ Expected (operandRight): 5.88e+04
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+PASS : tst_float::float16Comparisons(should PASS: NaN == NaN)
+FAIL! : tst_float::float16Comparisons(should FAIL: NaN != 0) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 0
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: 0 != NaN) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): nan
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: NaN != 1) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 1
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: 1 != NaN) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): nan
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+PASS : tst_float::float16Comparisons(should PASS: inf == inf)
+PASS : tst_float::float16Comparisons(should PASS: -inf == -inf)
+FAIL! : tst_float::float16Comparisons(should FAIL: inf != -inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): -inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -inf != inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: inf != nan) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): nan
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: nan != inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -inf != nan) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): nan
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: nan != -inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): -inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: inf != 0) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 0
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: 0 != inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -inf != 0) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 0
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: 0 != -inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): -inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: inf != 1) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 1
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: 1 != inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -inf != 1) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 1
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: 1 != -inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): -inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: inf != max) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 6.55e+04
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: inf != -max) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): -6.55e+04
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: max != inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -max != inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -6.55e+04
+ Expected (operandRight): inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -inf != max) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 6.55e+04
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -inf != -max) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): -6.55e+04
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: max != -inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): -inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
+FAIL! : tst_float::float16Comparisons(should FAIL: -max != -inf) Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -6.55e+04
+ Expected (operandRight): -inf
+ Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
FAIL! : tst_float::compareFloatTests(1e0) Compared floats are not the same (fuzzy compare)
Actual (t1): 1
Expected (t3): 3
@@ -290,5 +407,5 @@ FAIL! : tst_float::compareFloatTests(1e+7) Compared floats are not the same (fu
Expected (t3): 3e+07
Loc: [qtbase/tests/auto/testlib/selftests/float/tst_float.cpp(0)]
PASS : tst_float::cleanupTestCase()
-Totals: 18 passed, 68 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 23 passed, 96 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_float *********
diff --git a/tests/auto/testlib/selftests/expected_float.xml b/tests/auto/testlib/selftests/expected_float.xml
index 65d2c5ad96..247bce9577 100644
--- a/tests/auto/testlib/selftests/expected_float.xml
+++ b/tests/auto/testlib/selftests/expected_float.xml
@@ -10,15 +10,15 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="doubleComparisons">
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[should PASS 1]]></DataTag>
-</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 1]]></DataTag>
<Description><![CDATA[Compared doubles are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3]]></Description>
</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 1]]></DataTag>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 2]]></DataTag>
<Description><![CDATA[Compared doubles are not the same (fuzzy compare)
@@ -430,21 +430,24 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="float16Comparisons">
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[should SUCCEED 1]]></DataTag>
-</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 1]]></DataTag>
<Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 1
Expected (operandRight): 3]]></Description>
</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 1]]></DataTag>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 2]]></DataTag>
<Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 0.0001
Expected (operandRight): 0.0003]]></Description>
</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 2]]></DataTag>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
<DataTag><![CDATA[should FAIL 3]]></DataTag>
<Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
@@ -452,7 +455,187 @@
Expected (operandRight): 99]]></Description>
</Incident>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[should SUCCEED 2]]></DataTag>
+ <DataTag><![CDATA[should PASS 3]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 4]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.93e-05
+ Expected (operandRight): 5.87e-05]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS 4]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL 5]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.94e+04
+ Expected (operandRight): 5.88e+04]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS: NaN == NaN]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: NaN != 0]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 0]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 0 != NaN]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: NaN != 1]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 1]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 1 != NaN]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS: inf == inf]]></DataTag>
+</Incident>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[should PASS: -inf == -inf]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != nan]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: nan != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != nan]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): nan]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: nan != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != 0]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 0]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 0 != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != 0]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 0]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 0 != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != 1]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 1]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 1 != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != 1]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 1]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: 1 != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: inf != -max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): -6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: max != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -max != inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -6.55e+04
+ Expected (operandRight): inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): 6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -inf != -max]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -inf
+ Expected (operandRight): -6.55e+04]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: max != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): -inf]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/float/tst_float.cpp" line="0">
+ <DataTag><![CDATA[should FAIL: -max != -inf]]></DataTag>
+ <Description><![CDATA[Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : -6.55e+04
+ Expected (operandRight): -inf]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_float.xunitxml b/tests/auto/testlib/selftests/expected_float.xunitxml
index 9b2af9b616..602f9252a4 100644
--- a/tests/auto/testlib/selftests/expected_float.xunitxml
+++ b/tests/auto/testlib/selftests/expected_float.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="68" tests="6" name="tst_float">
+<testsuite errors="0" failures="96" tests="6" name="tst_float">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -206,6 +206,90 @@
<failure tag="should FAIL 3" message="Compared qfloat16s are not the same (fuzzy compare)
Actual (operandLeft) : 98
Expected (operandRight): 99" result="fail"/>
+ <failure tag="should FAIL 4" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.93e&#x002D;05
+ Expected (operandRight): 5.87e&#x002D;05" result="fail"/>
+ <failure tag="should FAIL 5" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 5.94e+04
+ Expected (operandRight): 5.88e+04" result="fail"/>
+ <failure tag="should FAIL: NaN != 0" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 0" result="fail"/>
+ <failure tag="should FAIL: 0 != NaN" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): nan" result="fail"/>
+ <failure tag="should FAIL: NaN != 1" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): 1" result="fail"/>
+ <failure tag="should FAIL: 1 != NaN" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): nan" result="fail"/>
+ <failure tag="should FAIL: inf != &#x002D;inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): &#x002D;inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;inf != inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;inf
+ Expected (operandRight): inf" result="fail"/>
+ <failure tag="should FAIL: inf != nan" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): nan" result="fail"/>
+ <failure tag="should FAIL: nan != inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;inf != nan" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;inf
+ Expected (operandRight): nan" result="fail"/>
+ <failure tag="should FAIL: nan != &#x002D;inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : nan
+ Expected (operandRight): &#x002D;inf" result="fail"/>
+ <failure tag="should FAIL: inf != 0" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 0" result="fail"/>
+ <failure tag="should FAIL: 0 != inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;inf != 0" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;inf
+ Expected (operandRight): 0" result="fail"/>
+ <failure tag="should FAIL: 0 != &#x002D;inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 0
+ Expected (operandRight): &#x002D;inf" result="fail"/>
+ <failure tag="should FAIL: inf != 1" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 1" result="fail"/>
+ <failure tag="should FAIL: 1 != inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;inf != 1" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;inf
+ Expected (operandRight): 1" result="fail"/>
+ <failure tag="should FAIL: 1 != &#x002D;inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 1
+ Expected (operandRight): &#x002D;inf" result="fail"/>
+ <failure tag="should FAIL: inf != max" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): 6.55e+04" result="fail"/>
+ <failure tag="should FAIL: inf != &#x002D;max" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : inf
+ Expected (operandRight): &#x002D;6.55e+04" result="fail"/>
+ <failure tag="should FAIL: max != inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;max != inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;6.55e+04
+ Expected (operandRight): inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;inf != max" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;inf
+ Expected (operandRight): 6.55e+04" result="fail"/>
+ <failure tag="should FAIL: &#x002D;inf != &#x002D;max" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;inf
+ Expected (operandRight): &#x002D;6.55e+04" result="fail"/>
+ <failure tag="should FAIL: max != &#x002D;inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : 6.55e+04
+ Expected (operandRight): &#x002D;inf" result="fail"/>
+ <failure tag="should FAIL: &#x002D;max != &#x002D;inf" message="Compared qfloat16s are not the same (fuzzy compare)
+ Actual (operandLeft) : &#x002D;6.55e+04
+ Expected (operandRight): &#x002D;inf" result="fail"/>
</testcase>
<testcase result="fail" name="compareFloatTests">
<failure tag="1e0" message="Compared floats are not the same (fuzzy compare)
diff --git a/tests/auto/testlib/selftests/expected_globaldata.lightxml b/tests/auto/testlib/selftests/expected_globaldata.lightxml
index f66c4c552d..1212e4b364 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.lightxml
+++ b/tests/auto/testlib/selftests/expected_globaldata.lightxml
@@ -12,174 +12,195 @@
</TestFunction>
<TestFunction name="testGlobal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1]]></DataTag>
+ <DataTag><![CDATA[global=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipLocal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipSingle">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
-<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[global: false local: true]]></Description>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
-</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[skipping]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_globaldata.tap b/tests/auto/testlib/selftests/expected_globaldata.tap
index 580cf3a7a8..4d61b7437b 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.tap
+++ b/tests/auto/testlib/selftests/expected_globaldata.tap
@@ -2,51 +2,56 @@ TAP version 13
# tst_globaldata
# initTestCase initTestCase (null)
ok 1 - initTestCase()
-# init testGlobal local 1
+# init testGlobal local=false
# global: false
# local: false
-# cleanup testGlobal local 1
-ok 2 - testGlobal(1:local 1)
-# init testGlobal local 2
+# cleanup testGlobal local=false
+ok 2 - testGlobal(global=false:local=false)
+# init testGlobal local=true
# global: false
# local: true
-# cleanup testGlobal local 2
-ok 3 - testGlobal(1:local 2)
-# init testGlobal local 1
+# cleanup testGlobal local=true
+ok 3 - testGlobal(global=false:local=true)
+# init testGlobal local=false
# global: true
# local: false
-# cleanup testGlobal local 1
-ok 4 - testGlobal(2:local 1)
-# init testGlobal local 2
+# cleanup testGlobal local=false
+ok 4 - testGlobal(global=true:local=false)
+# init testGlobal local=true
# global: true
# local: true
-# cleanup testGlobal local 2
-ok 5 - testGlobal(2:local 2)
-ok 6 - skip(1) # SKIP skipping
-# init skipLocal local 1
-ok 7 - skipLocal(1:local 1) # SKIP skipping
-# cleanup skipLocal local 1
-# init skipLocal local 2
-ok 8 - skipLocal(1:local 2) # SKIP skipping
-# cleanup skipLocal local 2
-# init skipSingle local 1
+# cleanup testGlobal local=true
+ok 5 - testGlobal(global=true:local=true)
+ok 6 - skip(global=false) # SKIP skipping
+# init skipLocal local=false
+ok 7 - skipLocal(global=false:local=false) # SKIP skipping
+# cleanup skipLocal local=false
+# init skipLocal local=true
+ok 8 - skipLocal(global=false:local=true) # SKIP skipping
+# cleanup skipLocal local=true
+# init skipLocal local=false
+ok 9 - skipLocal(global=true:local=false) # SKIP skipping
+# cleanup skipLocal local=false
+# init skipLocal local=true
+ok 10 - skipLocal(global=true:local=true) # SKIP skipping
+# cleanup skipLocal local=true
+# init skipSingle local=false
# global: false local: false
-# cleanup skipSingle local 1
-ok 9 - skipSingle(1:local 1)
-# init skipSingle local 2
-# global: false local: true
-# cleanup skipSingle local 2
-ok 10 - skipSingle(1:local 2)
-# init skipSingle local 1
-ok 11 - skipSingle(2:local 1) # SKIP skipping
-# cleanup skipSingle local 1
-# init skipSingle local 2
+# cleanup skipSingle local=false
+ok 11 - skipSingle(global=false:local=false)
+# init skipSingle local=true
+ok 12 - skipSingle(global=false:local=true) # SKIP Skipping
+# cleanup skipSingle local=true
+# init skipSingle local=false
+ok 13 - skipSingle(global=true:local=false) # SKIP Skipping
+# cleanup skipSingle local=false
+# init skipSingle local=true
# global: true local: true
-# cleanup skipSingle local 2
-ok 12 - skipSingle(2:local 2)
+# cleanup skipSingle local=true
+ok 14 - skipSingle(global=true:local=true)
# cleanupTestCase cleanupTestCase (null)
-ok 13 - cleanupTestCase()
-1..13
-# tests 13
-# pass 9
+ok 15 - cleanupTestCase()
+1..15
+# tests 15
+# pass 8
# fail 0
diff --git a/tests/auto/testlib/selftests/expected_globaldata.teamcity b/tests/auto/testlib/selftests/expected_globaldata.teamcity
index 5d623a3285..f76f6090ba 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.teamcity
+++ b/tests/auto/testlib/selftests/expected_globaldata.teamcity
@@ -2,30 +2,31 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_globaldata']
##teamcity[testStdOut name='initTestCase()' out='QDEBUG: initTestCase initTestCase (null)' flowId='tst_globaldata']
##teamcity[testFinished name='initTestCase()' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 1)' out='QDEBUG: init testGlobal local 1|nQDEBUG: global: false|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local 1' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 2)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 2)' out='QDEBUG: init testGlobal local 2|nQDEBUG: global: false|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 2)' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 1)' out='QDEBUG: init testGlobal local 1|nQDEBUG: global: true|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local 1' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 1)' flowId='tst_globaldata']
-##teamcity[testStarted name='testGlobal(local 2)' flowId='tst_globaldata']
-##teamcity[testStdOut name='testGlobal(local 2)' out='QDEBUG: init testGlobal local 2|nQDEBUG: global: true|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='testGlobal(local 2)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=false)' out='QDEBUG: init testGlobal local=false|nQDEBUG: global: false|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local=false' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=true)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=true)' out='QDEBUG: init testGlobal local=true|nQDEBUG: global: false|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local=true' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=true)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=false)' out='QDEBUG: init testGlobal local=false|nQDEBUG: global: true|nQDEBUG: local: false|nQDEBUG: cleanup testGlobal local=false' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=false)' flowId='tst_globaldata']
+##teamcity[testStarted name='testGlobal(local=true)' flowId='tst_globaldata']
+##teamcity[testStdOut name='testGlobal(local=true)' out='QDEBUG: init testGlobal local=true|nQDEBUG: global: true|nQDEBUG: local: true|nQDEBUG: cleanup testGlobal local=true' flowId='tst_globaldata']
+##teamcity[testFinished name='testGlobal(local=true)' flowId='tst_globaldata']
##teamcity[testIgnored name='skip()' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipLocal(local 1)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipLocal(local 2)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testStarted name='skipSingle(local 1)' flowId='tst_globaldata']
-##teamcity[testStdOut name='skipSingle(local 1)' out='QDEBUG: init skipLocal local 1|nQDEBUG: cleanup skipLocal local 1|nQDEBUG: init skipLocal local 2|nQDEBUG: cleanup skipLocal local 2|nQDEBUG: init skipSingle local 1|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local 1' flowId='tst_globaldata']
-##teamcity[testFinished name='skipSingle(local 1)' flowId='tst_globaldata']
-##teamcity[testStarted name='skipSingle(local 2)' flowId='tst_globaldata']
-##teamcity[testStdOut name='skipSingle(local 2)' out='QDEBUG: init skipSingle local 2|nQDEBUG: global: false local: true|nQDEBUG: cleanup skipSingle local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='skipSingle(local 2)' flowId='tst_globaldata']
-##teamcity[testIgnored name='skipSingle(local 1)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
-##teamcity[testStdOut name='skipSingle(local 2)' out='QDEBUG: init skipSingle local 1|nQDEBUG: cleanup skipSingle local 1|nQDEBUG: init skipSingle local 2|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local 2' flowId='tst_globaldata']
-##teamcity[testFinished name='skipSingle(local 2)' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=false)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipLocal(local=true)' message='skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testStarted name='skipSingle(local=false)' flowId='tst_globaldata']
+##teamcity[testStdOut name='skipSingle(local=false)' out='QDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipLocal local=false|nQDEBUG: cleanup skipLocal local=false|nQDEBUG: init skipLocal local=true|nQDEBUG: cleanup skipLocal local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: global: false local: false|nQDEBUG: cleanup skipSingle local=false' flowId='tst_globaldata']
+##teamcity[testFinished name='skipSingle(local=false)' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipSingle(local=true)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testIgnored name='skipSingle(local=false)' message='Skipping |[Loc: qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)|]' flowId='tst_globaldata']
+##teamcity[testStarted name='skipSingle(local=true)' flowId='tst_globaldata']
+##teamcity[testStdOut name='skipSingle(local=true)' out='QDEBUG: init skipSingle local=true|nQDEBUG: cleanup skipSingle local=true|nQDEBUG: init skipSingle local=false|nQDEBUG: cleanup skipSingle local=false|nQDEBUG: init skipSingle local=true|nQDEBUG: global: true local: true|nQDEBUG: cleanup skipSingle local=true' flowId='tst_globaldata']
+##teamcity[testFinished name='skipSingle(local=true)' flowId='tst_globaldata']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_globaldata']
##teamcity[testStdOut name='cleanupTestCase()' out='QDEBUG: cleanupTestCase cleanupTestCase (null)' flowId='tst_globaldata']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_globaldata']
diff --git a/tests/auto/testlib/selftests/expected_globaldata.txt b/tests/auto/testlib/selftests/expected_globaldata.txt
index b12f4a2a69..016b5e8299 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.txt
+++ b/tests/auto/testlib/selftests/expected_globaldata.txt
@@ -2,53 +2,61 @@
Config: Using QtTest library
QDEBUG : tst_globaldata::initTestCase() initTestCase initTestCase (null)
PASS : tst_globaldata::initTestCase()
-QDEBUG : tst_globaldata::testGlobal(1:local 1) init testGlobal local 1
-QDEBUG : tst_globaldata::testGlobal(1:local 1) global: false
-QDEBUG : tst_globaldata::testGlobal(1:local 1) local: false
-QDEBUG : tst_globaldata::testGlobal(1:local 1) cleanup testGlobal local 1
-PASS : tst_globaldata::testGlobal(1:local 1)
-QDEBUG : tst_globaldata::testGlobal(1:local 2) init testGlobal local 2
-QDEBUG : tst_globaldata::testGlobal(1:local 2) global: false
-QDEBUG : tst_globaldata::testGlobal(1:local 2) local: true
-QDEBUG : tst_globaldata::testGlobal(1:local 2) cleanup testGlobal local 2
-PASS : tst_globaldata::testGlobal(1:local 2)
-QDEBUG : tst_globaldata::testGlobal(2:local 1) init testGlobal local 1
-QDEBUG : tst_globaldata::testGlobal(2:local 1) global: true
-QDEBUG : tst_globaldata::testGlobal(2:local 1) local: false
-QDEBUG : tst_globaldata::testGlobal(2:local 1) cleanup testGlobal local 1
-PASS : tst_globaldata::testGlobal(2:local 1)
-QDEBUG : tst_globaldata::testGlobal(2:local 2) init testGlobal local 2
-QDEBUG : tst_globaldata::testGlobal(2:local 2) global: true
-QDEBUG : tst_globaldata::testGlobal(2:local 2) local: true
-QDEBUG : tst_globaldata::testGlobal(2:local 2) cleanup testGlobal local 2
-PASS : tst_globaldata::testGlobal(2:local 2)
-SKIP : tst_globaldata::skip(1) skipping
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) init testGlobal local=false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) global: false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) local: false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=false) cleanup testGlobal local=false
+PASS : tst_globaldata::testGlobal(global=false:local=false)
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) init testGlobal local=true
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) global: false
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) local: true
+QDEBUG : tst_globaldata::testGlobal(global=false:local=true) cleanup testGlobal local=true
+PASS : tst_globaldata::testGlobal(global=false:local=true)
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) init testGlobal local=false
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) global: true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) local: false
+QDEBUG : tst_globaldata::testGlobal(global=true:local=false) cleanup testGlobal local=false
+PASS : tst_globaldata::testGlobal(global=true:local=false)
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) init testGlobal local=true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) global: true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) local: true
+QDEBUG : tst_globaldata::testGlobal(global=true:local=true) cleanup testGlobal local=true
+PASS : tst_globaldata::testGlobal(global=true:local=true)
+SKIP : tst_globaldata::skip(global=false) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipLocal(1:local 1) init skipLocal local 1
-SKIP : tst_globaldata::skipLocal(1:local 1) skipping
+QDEBUG : tst_globaldata::skipLocal(global=false:local=false) init skipLocal local=false
+SKIP : tst_globaldata::skipLocal(global=false:local=false) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipLocal(1:local 1) cleanup skipLocal local 1
-QDEBUG : tst_globaldata::skipLocal(1:local 2) init skipLocal local 2
-SKIP : tst_globaldata::skipLocal(1:local 2) skipping
+QDEBUG : tst_globaldata::skipLocal(global=false:local=false) cleanup skipLocal local=false
+QDEBUG : tst_globaldata::skipLocal(global=false:local=true) init skipLocal local=true
+SKIP : tst_globaldata::skipLocal(global=false:local=true) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipLocal(1:local 2) cleanup skipLocal local 2
-QDEBUG : tst_globaldata::skipSingle(1:local 1) init skipSingle local 1
-QDEBUG : tst_globaldata::skipSingle(1:local 1) global: false local: false
-QDEBUG : tst_globaldata::skipSingle(1:local 1) cleanup skipSingle local 1
-PASS : tst_globaldata::skipSingle(1:local 1)
-QDEBUG : tst_globaldata::skipSingle(1:local 2) init skipSingle local 2
-QDEBUG : tst_globaldata::skipSingle(1:local 2) global: false local: true
-QDEBUG : tst_globaldata::skipSingle(1:local 2) cleanup skipSingle local 2
-PASS : tst_globaldata::skipSingle(1:local 2)
-QDEBUG : tst_globaldata::skipSingle(2:local 1) init skipSingle local 1
-SKIP : tst_globaldata::skipSingle(2:local 1) skipping
+QDEBUG : tst_globaldata::skipLocal(global=false:local=true) cleanup skipLocal local=true
+QDEBUG : tst_globaldata::skipLocal(global=true:local=false) init skipLocal local=false
+SKIP : tst_globaldata::skipLocal(global=true:local=false) skipping
Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
-QDEBUG : tst_globaldata::skipSingle(2:local 1) cleanup skipSingle local 1
-QDEBUG : tst_globaldata::skipSingle(2:local 2) init skipSingle local 2
-QDEBUG : tst_globaldata::skipSingle(2:local 2) global: true local: true
-QDEBUG : tst_globaldata::skipSingle(2:local 2) cleanup skipSingle local 2
-PASS : tst_globaldata::skipSingle(2:local 2)
+QDEBUG : tst_globaldata::skipLocal(global=true:local=false) cleanup skipLocal local=false
+QDEBUG : tst_globaldata::skipLocal(global=true:local=true) init skipLocal local=true
+SKIP : tst_globaldata::skipLocal(global=true:local=true) skipping
+ Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
+QDEBUG : tst_globaldata::skipLocal(global=true:local=true) cleanup skipLocal local=true
+QDEBUG : tst_globaldata::skipSingle(global=false:local=false) init skipSingle local=false
+QDEBUG : tst_globaldata::skipSingle(global=false:local=false) global: false local: false
+QDEBUG : tst_globaldata::skipSingle(global=false:local=false) cleanup skipSingle local=false
+PASS : tst_globaldata::skipSingle(global=false:local=false)
+QDEBUG : tst_globaldata::skipSingle(global=false:local=true) init skipSingle local=true
+SKIP : tst_globaldata::skipSingle(global=false:local=true) Skipping
+ Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
+QDEBUG : tst_globaldata::skipSingle(global=false:local=true) cleanup skipSingle local=true
+QDEBUG : tst_globaldata::skipSingle(global=true:local=false) init skipSingle local=false
+SKIP : tst_globaldata::skipSingle(global=true:local=false) Skipping
+ Loc: [qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp(0)]
+QDEBUG : tst_globaldata::skipSingle(global=true:local=false) cleanup skipSingle local=false
+QDEBUG : tst_globaldata::skipSingle(global=true:local=true) init skipSingle local=true
+QDEBUG : tst_globaldata::skipSingle(global=true:local=true) global: true local: true
+QDEBUG : tst_globaldata::skipSingle(global=true:local=true) cleanup skipSingle local=true
+PASS : tst_globaldata::skipSingle(global=true:local=true)
QDEBUG : tst_globaldata::cleanupTestCase() cleanupTestCase cleanupTestCase (null)
PASS : tst_globaldata::cleanupTestCase()
-Totals: 9 passed, 0 failed, 4 skipped, 0 blacklisted, 0ms
+Totals: 8 passed, 0 failed, 7 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_globaldata *********
diff --git a/tests/auto/testlib/selftests/expected_globaldata.xml b/tests/auto/testlib/selftests/expected_globaldata.xml
index 0f705ef352..9aa48c8f16 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.xml
+++ b/tests/auto/testlib/selftests/expected_globaldata.xml
@@ -14,174 +14,195 @@
</TestFunction>
<TestFunction name="testGlobal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[global: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init testGlobal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
<Description><![CDATA[local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init testGlobal local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup testGlobal local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup testGlobal local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skip">
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1]]></DataTag>
+ <DataTag><![CDATA[global=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipLocal">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
<Description><![CDATA[skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipLocal local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipLocal local=false]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=false]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipLocal local=true]]></Description>
+</Message>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[skipping]]></Description>
+</Message>
+<Message type="qdebug" file="" line="0">
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipLocal local=true]]></Description>
</Message>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="skipSingle">
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
<Description><![CDATA[global: false local: false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 1]]></DataTag>
+ <DataTag><![CDATA[global=false:local=false]]></DataTag>
</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
-<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[global: false local: true]]></Description>
+<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=false:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
-<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[1:local 2]]></DataTag>
-</Incident>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[init skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[init skipSingle local=false]]></Description>
</Message>
<Message type="skip" file="qtbase/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[skipping]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[Skipping]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 1]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 1]]></Description>
+ <DataTag><![CDATA[global=true:local=false]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=false]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[init skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[init skipSingle local=true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
<Description><![CDATA[global: true local: true]]></Description>
</Message>
<Message type="qdebug" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
- <Description><![CDATA[cleanup skipSingle local 2]]></Description>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
+ <Description><![CDATA[cleanup skipSingle local=true]]></Description>
</Message>
<Incident type="pass" file="" line="0">
- <DataTag><![CDATA[2:local 2]]></DataTag>
+ <DataTag><![CDATA[global=true:local=true]]></DataTag>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_globaldata.xunitxml b/tests/auto/testlib/selftests/expected_globaldata.xunitxml
index bdd7e3f00a..de184c2fdd 100644
--- a/tests/auto/testlib/selftests/expected_globaldata.xunitxml
+++ b/tests/auto/testlib/selftests/expected_globaldata.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="37" failures="0" tests="6" name="tst_globaldata">
+<testsuite errors="43" failures="0" tests="6" name="tst_globaldata">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -9,88 +9,100 @@
<!-- message="initTestCase initTestCase (null)" type="qdebug" -->
</testcase>
<testcase result="pass" name="testGlobal">
- <!-- tag="1:local 1" message="init testGlobal local 1" type="qdebug" -->
- <!-- tag="1:local 1" message="global: false" type="qdebug" -->
- <!-- tag="1:local 1" message="local: false" type="qdebug" -->
- <!-- tag="1:local 1" message="cleanup testGlobal local 1" type="qdebug" -->
- <!-- tag="1:local 2" message="init testGlobal local 2" type="qdebug" -->
- <!-- tag="1:local 2" message="global: false" type="qdebug" -->
- <!-- tag="1:local 2" message="local: true" type="qdebug" -->
- <!-- tag="1:local 2" message="cleanup testGlobal local 2" type="qdebug" -->
- <!-- tag="2:local 1" message="init testGlobal local 1" type="qdebug" -->
- <!-- tag="2:local 1" message="global: true" type="qdebug" -->
- <!-- tag="2:local 1" message="local: false" type="qdebug" -->
- <!-- tag="2:local 1" message="cleanup testGlobal local 1" type="qdebug" -->
- <!-- tag="2:local 2" message="init testGlobal local 2" type="qdebug" -->
- <!-- tag="2:local 2" message="global: true" type="qdebug" -->
- <!-- tag="2:local 2" message="local: true" type="qdebug" -->
- <!-- tag="2:local 2" message="cleanup testGlobal local 2" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="init testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="global: false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="local: false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="cleanup testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="init testGlobal local=true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="global: false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="local: true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="cleanup testGlobal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="init testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="global: true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="local: false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="cleanup testGlobal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="init testGlobal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="global: true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="local: true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="cleanup testGlobal local=true" type="qdebug" -->
</testcase>
<testcase name="skip">
- <!-- tag="1" message="skipping" type="skip" -->
+ <!-- tag="global=false" message="skipping" type="skip" -->
</testcase>
<testcase name="skipLocal">
- <!-- tag="1:local 1" message="init skipLocal local 1" type="qdebug" -->
- <!-- tag="1:local 1" message="skipping" type="skip" -->
- <!-- tag="1:local 1" message="cleanup skipLocal local 1" type="qdebug" -->
- <!-- tag="1:local 2" message="init skipLocal local 2" type="qdebug" -->
- <!-- tag="1:local 2" message="skipping" type="skip" -->
- <!-- tag="1:local 2" message="cleanup skipLocal local 2" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="init skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="skipping" type="skip" -->
+ <!-- tag="global=false:local=false" message="cleanup skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="init skipLocal local=true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="skipping" type="skip" -->
+ <!-- tag="global=false:local=true" message="cleanup skipLocal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="init skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="skipping" type="skip" -->
+ <!-- tag="global=true:local=false" message="cleanup skipLocal local=false" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="init skipLocal local=true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="skipping" type="skip" -->
+ <!-- tag="global=true:local=true" message="cleanup skipLocal local=true" type="qdebug" -->
</testcase>
<testcase result="pass" name="skipSingle">
- <!-- tag="1:local 1" message="init skipSingle local 1" type="qdebug" -->
- <!-- tag="1:local 1" message="global: false local: false" type="qdebug" -->
- <!-- tag="1:local 1" message="cleanup skipSingle local 1" type="qdebug" -->
- <!-- tag="1:local 2" message="init skipSingle local 2" type="qdebug" -->
- <!-- tag="1:local 2" message="global: false local: true" type="qdebug" -->
- <!-- tag="1:local 2" message="cleanup skipSingle local 2" type="qdebug" -->
- <!-- tag="2:local 1" message="init skipSingle local 1" type="qdebug" -->
- <!-- tag="2:local 1" message="skipping" type="skip" -->
- <!-- tag="2:local 1" message="cleanup skipSingle local 1" type="qdebug" -->
- <!-- tag="2:local 2" message="init skipSingle local 2" type="qdebug" -->
- <!-- tag="2:local 2" message="global: true local: true" type="qdebug" -->
- <!-- tag="2:local 2" message="cleanup skipSingle local 2" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="init skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="global: false local: false" type="qdebug" -->
+ <!-- tag="global=false:local=false" message="cleanup skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="init skipSingle local=true" type="qdebug" -->
+ <!-- tag="global=false:local=true" message="Skipping" type="skip" -->
+ <!-- tag="global=false:local=true" message="cleanup skipSingle local=true" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="init skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=true:local=false" message="Skipping" type="skip" -->
+ <!-- tag="global=true:local=false" message="cleanup skipSingle local=false" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="init skipSingle local=true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="global: true local: true" type="qdebug" -->
+ <!-- tag="global=true:local=true" message="cleanup skipSingle local=true" type="qdebug" -->
</testcase>
<testcase result="pass" name="cleanupTestCase">
<!-- message="cleanupTestCase cleanupTestCase (null)" type="qdebug" -->
</testcase>
<system-err>
<![CDATA[initTestCase initTestCase (null)]]>
-<![CDATA[init testGlobal local 1]]>
+<![CDATA[init testGlobal local=false]]>
<![CDATA[global: false]]>
<![CDATA[local: false]]>
-<![CDATA[cleanup testGlobal local 1]]>
-<![CDATA[init testGlobal local 2]]>
+<![CDATA[cleanup testGlobal local=false]]>
+<![CDATA[init testGlobal local=true]]>
<![CDATA[global: false]]>
<![CDATA[local: true]]>
-<![CDATA[cleanup testGlobal local 2]]>
-<![CDATA[init testGlobal local 1]]>
+<![CDATA[cleanup testGlobal local=true]]>
+<![CDATA[init testGlobal local=false]]>
<![CDATA[global: true]]>
<![CDATA[local: false]]>
-<![CDATA[cleanup testGlobal local 1]]>
-<![CDATA[init testGlobal local 2]]>
+<![CDATA[cleanup testGlobal local=false]]>
+<![CDATA[init testGlobal local=true]]>
<![CDATA[global: true]]>
<![CDATA[local: true]]>
-<![CDATA[cleanup testGlobal local 2]]>
+<![CDATA[cleanup testGlobal local=true]]>
<![CDATA[skipping]]>
-<![CDATA[init skipLocal local 1]]>
+<![CDATA[init skipLocal local=false]]>
<![CDATA[skipping]]>
-<![CDATA[cleanup skipLocal local 1]]>
-<![CDATA[init skipLocal local 2]]>
+<![CDATA[cleanup skipLocal local=false]]>
+<![CDATA[init skipLocal local=true]]>
<![CDATA[skipping]]>
-<![CDATA[cleanup skipLocal local 2]]>
-<![CDATA[init skipSingle local 1]]>
-<![CDATA[global: false local: false]]>
-<![CDATA[cleanup skipSingle local 1]]>
-<![CDATA[init skipSingle local 2]]>
-<![CDATA[global: false local: true]]>
-<![CDATA[cleanup skipSingle local 2]]>
-<![CDATA[init skipSingle local 1]]>
+<![CDATA[cleanup skipLocal local=true]]>
+<![CDATA[init skipLocal local=false]]>
+<![CDATA[skipping]]>
+<![CDATA[cleanup skipLocal local=false]]>
+<![CDATA[init skipLocal local=true]]>
<![CDATA[skipping]]>
-<![CDATA[cleanup skipSingle local 1]]>
-<![CDATA[init skipSingle local 2]]>
+<![CDATA[cleanup skipLocal local=true]]>
+<![CDATA[init skipSingle local=false]]>
+<![CDATA[global: false local: false]]>
+<![CDATA[cleanup skipSingle local=false]]>
+<![CDATA[init skipSingle local=true]]>
+<![CDATA[Skipping]]>
+<![CDATA[cleanup skipSingle local=true]]>
+<![CDATA[init skipSingle local=false]]>
+<![CDATA[Skipping]]>
+<![CDATA[cleanup skipSingle local=false]]>
+<![CDATA[init skipSingle local=true]]>
<![CDATA[global: true local: true]]>
-<![CDATA[cleanup skipSingle local 2]]>
+<![CDATA[cleanup skipSingle local=true]]>
<![CDATA[cleanupTestCase cleanupTestCase (null)]]>
</system-err>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.lightxml b/tests/auto/testlib/selftests/expected_signaldumper.lightxml
new file mode 100644
index 0000000000..443f649bb6
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.lightxml
@@ -0,0 +1,585 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: QThread(_POINTER_) started ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="noConnections">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlot">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlotOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlots">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlotsOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwarding">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwardingOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignal">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignalOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) emitSecondSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="variousTypes">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="deletingSender">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[ Signal: QThread(_POINTER_) finished ()]]></Description>
+</Message>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.tap b/tests/auto/testlib/selftests/expected_signaldumper.tap
new file mode 100644
index 0000000000..e2d664f4f1
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.tap
@@ -0,0 +1,153 @@
+TAP version 13
+# tst_Signaldumper
+# Signal: QThread(_POINTER_) started ()
+ok 1 - initTestCase()
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+ok 2 - noConnections()
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 3 - oneSlot(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 4 - oneSlot(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 5 - oneSlotOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 6 - oneSlotOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 7 - twoSlots(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 8 - twoSlots(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+# Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 9 - twoSlotsOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 10 - twoSlotsOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 11 - signalForwarding(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 12 - signalForwarding(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) nestedSignal()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Slot: SignalSlotClass(_POINTER_) nestedSignal()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 13 - signalForwardingOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+# Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 14 - signalForwardingOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 15 - slotEmittingSignal(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 16 - slotEmittingSignal(queued)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Slot: SignalSlotClass(_POINTER_) emitSecondSignal()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+ok 17 - slotEmittingSignalOldSyntax(direct)
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+# Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+# Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+ok 18 - slotEmittingSignalOldSyntax(queued)
+# Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))
+# Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)
+# Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))
+# Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))
+# Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())
+# Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())
+# Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)
+# Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())
+# Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)
+# Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()
+# Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+# Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+ok 19 - variousTypes()
+# Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+ok 20 - deletingSender()
+ok 21 - cleanupTestCase()
+# Signal: QThread(_POINTER_) finished ()
+1..21
+# tests 21
+# pass 21
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.teamcity b/tests/auto/testlib/selftests/expected_signaldumper.teamcity
new file mode 100644
index 0000000000..0fc568e086
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.teamcity
@@ -0,0 +1,64 @@
+##teamcity[testSuiteStarted name='tst_Signaldumper' flowId='tst_Signaldumper']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='initTestCase()' out='INFO: Signal: QThread(_POINTER_) started ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='noConnections()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='noConnections()' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))' flowId='tst_Signaldumper']
+##teamcity[testFinished name='noConnections()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlot(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlot(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlot(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlot(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlot(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlot(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlotOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlotOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlotOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='oneSlotOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='oneSlotOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='oneSlotOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlots(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlots(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlots(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlots(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlots(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlots(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlotsOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlotsOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlotsOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='twoSlotsOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='twoSlotsOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='twoSlotsOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwarding(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwarding(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwarding(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwarding(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwarding(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwarding(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwardingOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwardingOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Slot: SignalSlotClass(_POINTER_) nestedSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwardingOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='signalForwardingOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='signalForwardingOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))|nINFO: Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='signalForwardingOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignal(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignal(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignal(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignal(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignal(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignal(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignalOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignalOldSyntax(direct)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Slot: SignalSlotClass(_POINTER_) emitSecondSignal()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignalOldSyntax(direct)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='slotEmittingSignalOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='slotEmittingSignalOldSyntax(queued)' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()|nINFO: Signal: QEventDispatcherPlatform(_POINTER_) awake ()|nINFO: Signal: SignalSlotClass(_POINTER_) nestedSignal ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='slotEmittingSignalOldSyntax(queued)' flowId='tst_Signaldumper']
+##teamcity[testStarted name='variousTypes()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='variousTypes()' out='INFO: Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))|nINFO: Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))|nINFO: Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))|nINFO: Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)|nINFO: Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()|nINFO: Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())|nINFO: Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())' flowId='tst_Signaldumper']
+##teamcity[testFinished name='variousTypes()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='deletingSender()' flowId='tst_Signaldumper']
+##teamcity[testStdOut name='deletingSender()' out='INFO: Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='deletingSender()' flowId='tst_Signaldumper']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Signaldumper']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Signaldumper']
+##teamcity[testSuiteFinished name='tst_Signaldumper' flowId='tst_Signaldumper']
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.txt b/tests/auto/testlib/selftests/expected_signaldumper.txt
new file mode 100644
index 0000000000..0ee8cd38a2
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.txt
@@ -0,0 +1,151 @@
+********* Start testing of tst_Signaldumper *********
+Config: Using QtTest library
+INFO : tst_Signaldumper::initTestCase() Signal: QThread(_POINTER_) started ()
+PASS : tst_Signaldumper::initTestCase()
+INFO : tst_Signaldumper::noConnections() Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::noConnections() Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+PASS : tst_Signaldumper::noConnections()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlot(direct)
+INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlot(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlot(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlot(queued)
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::oneSlotOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlotOldSyntax(direct)
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::oneSlotOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::oneSlotOldSyntax(queued)
+INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlots(direct)
+INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlots(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlots(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlots(queued)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlotsOldSyntax(direct)
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::twoSlotsOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::twoSlotsOldSyntax(queued)
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwarding(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::signalForwarding(direct)
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwarding(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::signalForwarding(queued)
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignal()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) nestedSignal()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::signalForwardingOldSyntax(direct)
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::signalForwardingOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::signalForwardingOldSyntax(queued)
+INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::slotEmittingSignal(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::slotEmittingSignal(direct)
+INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::slotEmittingSignal(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::slotEmittingSignal(queued)
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Slot: SignalSlotClass(_POINTER_) emitSecondSignal()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(direct) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+PASS : tst_Signaldumper::slotEmittingSignalOldSyntax(direct)
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: QEventDispatcherPlatform(_POINTER_) awake ()
+INFO : tst_Signaldumper::slotEmittingSignalOldSyntax(queued) Signal: SignalSlotClass(_POINTER_) nestedSignal ()
+PASS : tst_Signaldumper::slotEmittingSignalOldSyntax(queued)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+INFO : tst_Signaldumper::variousTypes() Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())
+PASS : tst_Signaldumper::variousTypes()
+INFO : tst_Signaldumper::deletingSender() Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()
+PASS : tst_Signaldumper::deletingSender()
+PASS : tst_Signaldumper::cleanupTestCase()
+INFO : tst_Signaldumper::UnknownTestFunc() Signal: QThread(_POINTER_) finished ()
+Totals: 21 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_Signaldumper *********
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.xml b/tests/auto/testlib/selftests/expected_signaldumper.xml
new file mode 100644
index 0000000000..f11a0c3ce6
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.xml
@@ -0,0 +1,588 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Signaldumper">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: QThread(_POINTER_) started ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="noConnections">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlot">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="oneSlotOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlots">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="twoSlotsOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwarding">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="signalForwardingOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignal">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="slotEmittingSignalOldSyntax">
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Slot: SignalSlotClass(_POINTER_) emitSecondSignal()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[direct]]></DataTag>
+</Incident>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[queued]]></DataTag>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="variousTypes">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="deletingSender">
+<Message type="info" file="" line="0">
+ <Description><![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]></Description>
+</Message>
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Message type="info" file="" line="0">
+ <Description><![CDATA[ Signal: QThread(_POINTER_) finished ()]]></Description>
+</Message>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_signaldumper.xunitxml b/tests/auto/testlib/selftests/expected_signaldumper.xunitxml
new file mode 100644
index 0000000000..cbf7075ba1
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_signaldumper.xunitxml
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="126" failures="0" tests="13" name="tst_Signaldumper">
+ <properties>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
+ <property value="" name="QtBuild"/>
+ </properties>
+ <testcase result="pass" name="initTestCase">
+ <!-- message="Signal: QThread(_POINTER_) started ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="noConnections">
+ <!-- message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ </testcase>
+ <testcase result="pass" name="oneSlot">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="oneSlotOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="twoSlots">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="twoSlotsOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="signalForwarding">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="signalForwardingOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) nestedSignal()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) nestedSignal()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="slotEmittingSignal">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="slotEmittingSignalOldSyntax">
+ <!-- tag="direct" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="direct" message=" Slot: SignalSlotClass(_POINTER_) emitSecondSignal()" type="info" -->
+ <!-- tag="direct" message=" Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ <!-- tag="direct" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ <!-- tag="queued" message="Signal: QEventDispatcherPlatform(_POINTER_) awake ()" type="info" -->
+ <!-- tag="queued" message="Signal: SignalSlotClass(_POINTER_) nestedSignal ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="variousTypes">
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&amp;)@_POINTER_)" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qListSignal (QList&lt;int&gt;())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector&lt;int&gt;())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector&lt;int&gt;&amp;)@_POINTER_)" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector&lt;int&gt;())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector&lt;int&gt;*)_POINTER_)" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())" type="info" -->
+ <!-- message="Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())" type="info" -->
+ </testcase>
+ <testcase result="pass" name="deletingSender">
+ <!-- message="Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()" type="info" -->
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase">
+ <!-- message=" Signal: QThread(_POINTER_) finished ()" type="info" -->
+ </testcase>
+ <system-err>
+<![CDATA[Signal: QThread(_POINTER_) started ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithParameters(int,char)]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) slotWithoutParameters()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignalWithParameters(int,char)]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) nestedSignal()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithParameters (int(242), char(m))]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Slot: SignalSlotClass(_POINTER_) emitSecondSignal()]]>
+<![CDATA[ Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[Signal: QEventDispatcherPlatform(_POINTER_) awake ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) nestedSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qStringSignal (QString(Test string))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@_POINTER_)]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qStringConstRefSignal (QString(Test string))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qByteArraySignal (QByteArray(Test bytearray))]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qListSignal (QList<int>())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorSignal (QVector<int>())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorRefSignal ((QVector<int>&)@_POINTER_)]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstRefSignal (QVector<int>())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorConstPointerSignal ((const QVector<int>*)_POINTER_)]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVectorPointerConstSignal ()]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) qVariantSignal (QVariant())]]>
+<![CDATA[Signal: SignalSlotClass(_POINTER_) signalWithoutParameters ()]]>
+<![CDATA[ Signal: QThread(_POINTER_) finished ()]]>
+ </system-err>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/float/tst_float.cpp b/tests/auto/testlib/selftests/float/tst_float.cpp
index 49d00ac0e0..cefd8a57c4 100644
--- a/tests/auto/testlib/selftests/float/tst_float.cpp
+++ b/tests/auto/testlib/selftests/float/tst_float.cpp
@@ -46,6 +46,55 @@ private slots:
void compareFloatTests_data() const;
};
+template<typename F>
+static void nonFinite_data(F zero, F one)
+{
+ using Bounds = std::numeric_limits<F>;
+
+ // QCOMPARE special-cases non-finite values
+ if (Bounds::has_quiet_NaN) {
+ const F nan = Bounds::quiet_NaN();
+ QTest::newRow("should PASS: NaN == NaN") << nan << nan;
+ QTest::newRow("should FAIL: NaN != 0") << nan << zero;
+ QTest::newRow("should FAIL: 0 != NaN") << zero << nan;
+ QTest::newRow("should FAIL: NaN != 1") << nan << one;
+ QTest::newRow("should FAIL: 1 != NaN") << one << nan;
+ }
+
+ if (Bounds::has_infinity) {
+ const F uge = Bounds::infinity();
+ QTest::newRow("should PASS: inf == inf") << uge << uge;
+ QTest::newRow("should PASS: -inf == -inf") << -uge << -uge;
+ QTest::newRow("should FAIL: inf != -inf") << uge << -uge;
+ QTest::newRow("should FAIL: -inf != inf") << -uge << uge;
+ if (Bounds::has_quiet_NaN) {
+ const F nan = Bounds::quiet_NaN();
+ QTest::newRow("should FAIL: inf != nan") << uge << nan;
+ QTest::newRow("should FAIL: nan != inf") << nan << uge;
+ QTest::newRow("should FAIL: -inf != nan") << -uge << nan;
+ QTest::newRow("should FAIL: nan != -inf") << nan << -uge;
+ }
+ QTest::newRow("should FAIL: inf != 0") << uge << zero;
+ QTest::newRow("should FAIL: 0 != inf") << zero << uge;
+ QTest::newRow("should FAIL: -inf != 0") << -uge << zero;
+ QTest::newRow("should FAIL: 0 != -inf") << zero << -uge;
+ QTest::newRow("should FAIL: inf != 1") << uge << one;
+ QTest::newRow("should FAIL: 1 != inf") << one << uge;
+ QTest::newRow("should FAIL: -inf != 1") << -uge << one;
+ QTest::newRow("should FAIL: 1 != -inf") << one << -uge;
+
+ const F big = Bounds::max();
+ QTest::newRow("should FAIL: inf != max") << uge << big;
+ QTest::newRow("should FAIL: inf != -max") << uge << -big;
+ QTest::newRow("should FAIL: max != inf") << big << uge;
+ QTest::newRow("should FAIL: -max != inf") << -big << uge;
+ QTest::newRow("should FAIL: -inf != max") << -uge << big;
+ QTest::newRow("should FAIL: -inf != -max") << -uge << -big;
+ QTest::newRow("should FAIL: max != -inf") << big << -uge;
+ QTest::newRow("should FAIL: -max != -inf") << -big << -uge;
+ }
+}
+
void tst_float::doubleComparisons() const
{
QFETCH(double, operandLeft);
@@ -58,65 +107,26 @@ void tst_float::doubleComparisons_data() const
{
QTest::addColumn<double>("operandLeft");
QTest::addColumn<double>("operandRight");
+ double zero(0.), one(1.);
- QTest::newRow("should PASS 1") << 0. << 0.;
- QTest::newRow("should FAIL 1") << 1.00000 << 3.00000;
- QTest::newRow("should FAIL 2") << 1.00000e-7 << 3.00000e-7;
+ QTest::newRow("should FAIL 1") << one << 3.;
+ QTest::newRow("should PASS 1") << zero << zero;
+ QTest::newRow("should FAIL 2") << 1.e-7 << 3.e-7;
// QCOMPARE for doubles uses qFuzzyCompare(), which succeeds if the numbers
// differ by no more than 1e-12 times the smaller value. Thus
// QCOMPARE(1e12-2, 1e12-1) should fail, while QCOMPARE(1e12+1, 1e12+2)
// should pass.
- QTest::newRow("should PASS 2") << 1e12 + 1. << 1e12 + 2.;
- QTest::newRow("should FAIL 3") << 1e12 - 1. << 1e12 - 2.;
+ QTest::newRow("should PASS 2") << 1e12 + one << 1e12 + 2.;
+ QTest::newRow("should FAIL 3") << 1e12 - one << 1e12 - 2.;
// ... but rounding makes that a bit unrelaible when scaled close to the bounds.
QTest::newRow("should PASS 3") << 1e-310 + 1e-322 << 1e-310 + 2e-322;
QTest::newRow("should FAIL 4") << 1e-310 - 1e-322 << 1e-310 - 3e-322;
QTest::newRow("should PASS 4") << 1e307 + 1e295 << 1e307 + 2e295;
QTest::newRow("should FAIL 5") << 1e307 - 1e295 << 1e307 - 3e295;
- // QCOMPARE special-cases non-finite values
- if (std::numeric_limits<double>::has_quiet_NaN) {
- const double nan = std::numeric_limits<double>::quiet_NaN();
- QTest::newRow("should PASS: NaN == NaN") << nan << nan;
- QTest::newRow("should FAIL: NaN != 0") << nan << 0.;
- QTest::newRow("should FAIL: 0 != NaN") << 0. << nan;
- QTest::newRow("should FAIL: NaN != 1") << nan << 1.;
- QTest::newRow("should FAIL: 1 != NaN") << 1. << nan;
- }
- if (std::numeric_limits<double>::has_infinity) {
- const double uge = std::numeric_limits<double>::infinity();
- QTest::newRow("should PASS: inf == inf") << uge << uge;
- QTest::newRow("should PASS: -inf == -inf") << -uge << -uge;
- QTest::newRow("should FAIL: inf != -inf") << uge << -uge;
- QTest::newRow("should FAIL: -inf != inf") << -uge << uge;
- if (std::numeric_limits<double>::has_quiet_NaN) {
- const double nan = std::numeric_limits<double>::quiet_NaN();
- QTest::newRow("should FAIL: inf != nan") << uge << nan;
- QTest::newRow("should FAIL: nan != inf") << nan << uge;
- QTest::newRow("should FAIL: -inf != nan") << -uge << nan;
- QTest::newRow("should FAIL: nan != -inf") << nan << -uge;
- }
- QTest::newRow("should FAIL: inf != 0") << uge << 0.;
- QTest::newRow("should FAIL: 0 != inf") << 0. << uge;
- QTest::newRow("should FAIL: -inf != 0") << -uge << 0.;
- QTest::newRow("should FAIL: 0 != -inf") << 0. << -uge;
- QTest::newRow("should FAIL: inf != 1") << uge << 1.;
- QTest::newRow("should FAIL: 1 != inf") << 1. << uge;
- QTest::newRow("should FAIL: -inf != 1") << -uge << 1.;
- QTest::newRow("should FAIL: 1 != -inf") << 1. << -uge;
-
- const double big = std::numeric_limits<double>::max();
- QTest::newRow("should FAIL: inf != max") << uge << big;
- QTest::newRow("should FAIL: inf != -max") << uge << -big;
- QTest::newRow("should FAIL: max != inf") << big << uge;
- QTest::newRow("should FAIL: -max != inf") << -big << uge;
- QTest::newRow("should FAIL: -inf != max") << -uge << big;
- QTest::newRow("should FAIL: -inf != -max") << -uge << -big;
- QTest::newRow("should FAIL: max != -inf") << big << -uge;
- QTest::newRow("should FAIL: -max != -inf") << -big << -uge;
- }
+ nonFinite_data(zero, one);
}
void tst_float::floatComparisons() const
@@ -131,65 +141,26 @@ void tst_float::floatComparisons_data() const
{
QTest::addColumn<float>("operandLeft");
QTest::addColumn<float>("operandRight");
+ float zero(0.f), one(1.f);
- QTest::newRow("should FAIL 1") << 1.00000f << 3.00000f;
- QTest::newRow("should PASS 1") << 0.f << 0.f;
- QTest::newRow("should FAIL 2") << 1.00000e-7f << 3.00000e-7f;
+ QTest::newRow("should FAIL 1") << one << 3.f;
+ QTest::newRow("should PASS 1") << zero << zero;
+ QTest::newRow("should FAIL 2") << 1.e-7f << 3.e-7f;
// QCOMPARE for floats uses qFuzzyCompare(), which succeeds if the numbers
// differ by no more than 1e-5 times the smaller value. Thus
// QCOMPARE(1e5-2, 1e5-1) should fail, while QCOMPARE(1e5+1, 1e5+2)
// should pass.
- QTest::newRow("should PASS 2") << 1e5f + 1.f << 1e5f + 2.f;
- QTest::newRow("should FAIL 3") << 1e5f - 1.f << 1e5f - 2.f;
+ QTest::newRow("should PASS 2") << 1e5f + one << 1e5f + 2.f;
+ QTest::newRow("should FAIL 3") << 1e5f - one << 1e5f - 2.f;
// ... but rounding makes that a bit unrelaible when scaled close to the bounds.
QTest::newRow("should PASS 3") << 1e-39f + 1e-44f << 1e-39f + 2e-44f;
QTest::newRow("should FAIL 4") << 1e-39f - 1e-44f << 1e-39f - 3e-44f;
QTest::newRow("should PASS 4") << 1e38f + 1e33f << 1e38f + 2e33f;
QTest::newRow("should FAIL 5") << 1e38f - 1e33f << 1e38f - 3e33f;
- // QCOMPARE special-cases non-finite values
- if (std::numeric_limits<float>::has_quiet_NaN) {
- const float nan = std::numeric_limits<float>::quiet_NaN();
- QTest::newRow("should PASS: NaN == NaN") << nan << nan;
- QTest::newRow("should FAIL: NaN != 0") << nan << 0.f;
- QTest::newRow("should FAIL: 0 != NaN") << 0.f << nan;
- QTest::newRow("should FAIL: NaN != 1") << nan << 1.f;
- QTest::newRow("should FAIL: 1 != NaN") << 1.f << nan;
- }
- if (std::numeric_limits<float>::has_infinity) {
- const float uge = std::numeric_limits<float>::infinity();
- QTest::newRow("should PASS: inf == inf") << uge << uge;
- QTest::newRow("should PASS: -inf == -inf") << -uge << -uge;
- QTest::newRow("should FAIL: inf != -inf") << uge << -uge;
- QTest::newRow("should FAIL: -inf != inf") << -uge << uge;
- if (std::numeric_limits<float>::has_quiet_NaN) {
- const float nan = std::numeric_limits<float>::quiet_NaN();
- QTest::newRow("should FAIL: inf != nan") << uge << nan;
- QTest::newRow("should FAIL: nan != inf") << nan << uge;
- QTest::newRow("should FAIL: -inf != nan") << -uge << nan;
- QTest::newRow("should FAIL: nan != -inf") << nan << -uge;
- }
- QTest::newRow("should FAIL: inf != 0") << uge << 0.f;
- QTest::newRow("should FAIL: 0 != inf") << 0.f << uge;
- QTest::newRow("should FAIL: -inf != 0") << -uge << 0.f;
- QTest::newRow("should FAIL: 0 != -inf") << 0.f << -uge;
- QTest::newRow("should FAIL: inf != 1") << uge << 1.f;
- QTest::newRow("should FAIL: 1 != inf") << 1.f << uge;
- QTest::newRow("should FAIL: -inf != 1") << -uge << 1.f;
- QTest::newRow("should FAIL: 1 != -inf") << 1.f << -uge;
-
- const float big = std::numeric_limits<float>::max();
- QTest::newRow("should FAIL: inf != max") << uge << big;
- QTest::newRow("should FAIL: inf != -max") << uge << -big;
- QTest::newRow("should FAIL: max != inf") << big << uge;
- QTest::newRow("should FAIL: -max != inf") << -big << uge;
- QTest::newRow("should FAIL: -inf != max") << -uge << big;
- QTest::newRow("should FAIL: -inf != -max") << -uge << -big;
- QTest::newRow("should FAIL: max != -inf") << big << -uge;
- QTest::newRow("should FAIL: -max != -inf") << -big << -uge;
- }
+ nonFinite_data(zero, one);
}
void tst_float::float16Comparisons() const
@@ -204,28 +175,22 @@ void tst_float::float16Comparisons_data() const
{
QTest::addColumn<qfloat16>("operandLeft");
QTest::addColumn<qfloat16>("operandRight");
+ qfloat16 zero(0), one(1);
- QTest::newRow("should SUCCEED 1")
- << qfloat16(0)
- << qfloat16(0);
-
- QTest::newRow("should FAIL 1")
- << qfloat16(1.000)
- << qfloat16(3.000);
-
- QTest::newRow("should FAIL 2")
- << qfloat16(1.000e-4f)
- << qfloat16(3.000e-4f);
+ QTest::newRow("should FAIL 1") << one << qfloat16(3);
+ QTest::newRow("should PASS 1") << zero << zero;
+ QTest::newRow("should FAIL 2") << qfloat16(1e-4f) << qfloat16(3e-4f);
// QCOMPARE for qfloat16s uses qFuzzyCompare()
-
- QTest::newRow("should FAIL 3")
- << qfloat16(98)
- << qfloat16(99);
-
- QTest::newRow("should SUCCEED 2")
- << qfloat16(1001)
- << qfloat16(1002);
+ QTest::newRow("should PASS 2") << qfloat16(1001) << qfloat16(1002);
+ QTest::newRow("should FAIL 3") << qfloat16(98) << qfloat16(99);
+ // ... which gets a bit unreliable near to the type's bounds
+ QTest::newRow("should PASS 3") << qfloat16(6e-5f) + qfloat16(6e-7f) << qfloat16(6e-5f) + qfloat16(11e-7f);
+ QTest::newRow("should FAIL 4") << qfloat16(6e-5f) - qfloat16(7e-7f) << qfloat16(6e-5f) - qfloat16(13e-7f);
+ QTest::newRow("should PASS 4") << qfloat16(6e4) + qfloat16(700) << qfloat16(6e4) + qfloat16(1200);
+ QTest::newRow("should FAIL 5") << qfloat16(6e4) - qfloat16(600) << qfloat16(6e4) - qfloat16(1200);
+
+ nonFinite_data(zero, one);
}
void tst_float::compareFloatTests() const
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index 9ec87c8fc6..48ecbf0289 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -92,6 +92,17 @@ class Cleaner (object):
(r'(Loc: \[[^[\]()]+)\(\d+\)', r'\1(0)'), # txt
(r'(\[Loc: [^[\]()]+)\(\d+\)', r'\1(0)'), # teamcity
(r'(<(?:Incident|Message)\b.*\bfile=.*\bline=)"\d+"', r'\1"0"'), # lightxml, xml
+ # Pointers printed by signal dumper:
+ (r'\(\b[a-f0-9]{8,}\b\)', r'(_POINTER_)'),
+ # Example/for reference:
+ # ((QString&)@55f5fbb8dd40)
+ # ((const QVector<int>*)7ffd671d4558)
+ (r'\((\((?:const )?\w+(?:<[^>]+>)?[*&]*\)@?)\b[a-f\d]{8,}\b\)', r'(\1_POINTER_)'),
+ # For xml output there is no '<', '>' or '&', so we need an alternate version for that:
+ # ((QVector&lt;int&gt;&amp;)@5608b455e640)
+ (r'\((\((?:const )?\w+(?:&lt;(?:[^&]|&(?!gt;))*&gt;)?(?:\*|&amp;)?\)@?)[a-z\d]+\b\)', r'(\1_POINTER_)'),
+ # QEventDispatcher{Glib,Win32,etc.}
+ (r'\bQEventDispatcher\w+\b', r'QEventDispatcherPlatform'),
),
precook = re.compile):
"""Private implementation details of __init__()."""
@@ -296,6 +307,7 @@ def generateTestData(testname, clean,
"benchlibcounting": "-eventcounter",
"printdatatags": "-datatags",
"printdatatagswithglobaltags": "-datatags",
+ "signaldumper": "-vs",
"silent": "-silent",
"verbose1": "-v1",
"verbose2": "-v2",
diff --git a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
index 6c0ae1f43c..3c5c2c8f37 100644
--- a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
+++ b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
@@ -66,9 +66,10 @@ void tst_globaldata::initTestCase()
void tst_globaldata::initTestCase_data()
{
- QTest::addColumn<bool>("booli");
- QTest::newRow("1") << false;
- QTest::newRow("2") << true;
+ // QFETCH_GLOBAL shall iterate these, for every test:
+ QTest::addColumn<bool>("global");
+ QTest::newRow("global=false") << false;
+ QTest::newRow("global=true") << true;
}
void tst_globaldata::cleanupTestCase()
@@ -94,41 +95,42 @@ void tst_globaldata::cleanup()
void tst_globaldata::testGlobal_data()
{
- QTest::addColumn<bool>("booll");
- QTest::newRow("local 1") << false;
- QTest::newRow("local 2") << true;
+ QTest::addColumn<bool>("local");
+ QTest::newRow("local=false") << false;
+ QTest::newRow("local=true") << true;
}
void tst_globaldata::testGlobal()
{
- QFETCH_GLOBAL(bool, booli);
- qDebug() << "global:" << booli;
- QFETCH(bool, booll);
- qDebug() << "local:" << booll;
+ QFETCH_GLOBAL(bool, global);
+ qDebug() << "global:" << global;
+ QFETCH(bool, local);
+ qDebug() << "local:" << local;
}
void tst_globaldata::skip_data()
{
- QTest::addColumn<bool>("booll");
- QTest::newRow("local 1") << false;
- QTest::newRow("local 2") << true;
-
+ testGlobal_data();
QSKIP("skipping");
}
void tst_globaldata::skip()
{
- qDebug() << "this line should never be reached";
+ // A skip in _data() causes the whole test to be skipped, for all global rows.
+ QVERIFY(!"This line should never be reached.");
}
void tst_globaldata::skipSingle()
{
- QFETCH_GLOBAL(bool, booli);
- QFETCH(bool, booll);
-
- if (booli && !booll)
- QSKIP("skipping");
- qDebug() << "global:" << booli << "local:" << booll;
+ QFETCH_GLOBAL(bool, global);
+ QFETCH(bool, local);
+
+ // A skip in the last run of one global row used to suppress the test in the
+ // next global row (where a skip in an earlier run of the first row did not).
+ if (global ^ local)
+ QSKIP("Skipping");
+ qDebug() << "global:" << global << "local:" << local;
+ QCOMPARE(global, local);
}
void tst_globaldata::skipLocal()
diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri
index b4568dd3e1..2cad0b7e17 100644
--- a/tests/auto/testlib/selftests/selftests.pri
+++ b/tests/auto/testlib/selftests/selftests.pri
@@ -1,5 +1,4 @@
SUBPROGRAMS = \
- #alive \
assert \
badxml \
benchlibcallgrind \
@@ -37,6 +36,7 @@ SUBPROGRAMS = \
printdatatagswithglobaltags \
qexecstringlist \
silent \
+ signaldumper \
singleskip \
skip \
skipcleanup \
diff --git a/tests/auto/testlib/selftests/signaldumper/signaldumper.pro b/tests/auto/testlib/selftests/signaldumper/signaldumper.pro
new file mode 100644
index 0000000000..8780b18419
--- /dev/null
+++ b/tests/auto/testlib/selftests/signaldumper/signaldumper.pro
@@ -0,0 +1,9 @@
+SOURCES += tst_signaldumper.cpp
+QT = core testlib-private
+
+macos:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = signaldumper
+
+include($$QT_SOURCE_TREE/src/testlib/selfcover.pri)
diff --git a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp
new file mode 100644
index 0000000000..08592e222d
--- /dev/null
+++ b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp
@@ -0,0 +1,428 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QCoreApplication>
+#include <QtTest/QtTest>
+#include <private/qtestlog_p.h>
+
+class tst_Signaldumper : public QObject
+{
+ Q_OBJECT
+
+ void addConnectionTypeData();
+
+private slots:
+ void noConnections();
+ void oneSlot_data();
+ void oneSlot();
+ void oneSlotOldSyntax_data();
+ void oneSlotOldSyntax();
+ void twoSlots_data();
+ void twoSlots();
+ void twoSlotsOldSyntax_data();
+ void twoSlotsOldSyntax();
+ void signalForwarding_data();
+ void signalForwarding();
+ void signalForwardingOldSyntax_data();
+ void signalForwardingOldSyntax();
+ void slotEmittingSignal_data();
+ void slotEmittingSignal();
+ void slotEmittingSignalOldSyntax_data();
+ void slotEmittingSignalOldSyntax();
+
+ void variousTypes();
+
+ void deletingSender();
+};
+
+void tst_Signaldumper::addConnectionTypeData()
+{
+ QTest::addColumn<Qt::ConnectionType>("connectionType");
+ QTest::newRow("direct") << Qt::ConnectionType::DirectConnection;
+ QTest::newRow("queued") << Qt::ConnectionType::QueuedConnection;
+}
+
+/*
+ Simple class to keep the slots and signals separate from the test
+*/
+class SignalSlotClass : public QObject
+{
+ Q_OBJECT
+
+public:
+ SignalSlotClass();
+
+public slots:
+ void slotWithoutParameters() {}
+ void slotWithParameters(int i, char c) { Q_UNUSED(i); Q_UNUSED(c); }
+ void emitSecondSignal() { emit nestedSignal(); }
+
+signals:
+ void signalWithoutParameters();
+ void signalWithParameters(int i, char c);
+
+ void nestedSignal();
+ void nestedSignalWithParameters(int i, char c);
+
+ // For the "variousTypes" test
+ void qStringSignal(QString string);
+ void qStringRefSignal(QString &string);
+ void qStringConstRefSignal(const QString &string);
+ void qByteArraySignal(QByteArray byteArray);
+ void qListSignal(QList<int> list);
+ void qVectorSignal(QVector<int> vector);
+ void qVectorRefSignal(QVector<int> &vector);
+ void qVectorConstRefSignal(const QVector<int> &vector);
+ void qVectorConstPointerSignal(const QVector<int> *vector);
+ void qVectorPointerConstSignal(QVector<int> *const vector);
+ void qVariantSignal(QVariant variant);
+};
+
+SignalSlotClass::SignalSlotClass()
+{
+ // For printing signal argument in "variousTypes" test
+ qRegisterMetaType<QVector<int>>();
+ qRegisterMetaType<QList<int>>();
+}
+
+void tst_Signaldumper::noConnections()
+{
+ SignalSlotClass signalSlotOwner;
+
+ emit signalSlotOwner.signalWithoutParameters();
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+}
+
+void tst_Signaldumper::oneSlot_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::oneSlot()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::oneSlotOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::oneSlotOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::twoSlots_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::twoSlots()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ // Now, instead of creating two slots or two objects, we will just do the same connection twice.
+ // The same slot will then be invoked twice.
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ auto connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType);
+ connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ connection2 = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::slotWithoutParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+}
+
+void tst_Signaldumper::twoSlotsOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::twoSlotsOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ // Now, instead of creating two slots or two objects, we will just do the same connection twice.
+ // The same slot will then be invoked twice.
+
+ SignalSlotClass signalSlotOwner;
+ // parameterless to parameterless
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ auto connection2 = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType);
+ connection2 = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithParameters(int, char)), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+
+ // parameters to no parameters
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ connection2 = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SLOT(slotWithoutParameters()), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+ disconnect(connection2);
+}
+
+void tst_Signaldumper::signalForwarding_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::signalForwarding()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ // parameterless signal to parameterless signal
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::nestedSignal, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameter(full) signal
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::nestedSignalWithParameters, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameterless signal
+ connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithParameters,
+ &signalSlotOwner, &SignalSlotClass::nestedSignal, connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::signalForwardingOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::signalForwardingOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ // parameterless signal to parameterless signal
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SIGNAL(nestedSignal()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameter(full) signal
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SIGNAL(nestedSignalWithParameters(int, char)), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+
+ // parameter(full) signal to parameterless signal
+ connection = connect(&signalSlotOwner, SIGNAL(signalWithParameters(int, char)),
+ &signalSlotOwner, SIGNAL(nestedSignal()), connectionType);
+ emit signalSlotOwner.signalWithParameters(242, 'm');
+
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::slotEmittingSignal_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::slotEmittingSignal()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ auto connection = connect(&signalSlotOwner, &SignalSlotClass::signalWithoutParameters,
+ &signalSlotOwner, &SignalSlotClass::emitSecondSignal, connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::slotEmittingSignalOldSyntax_data()
+{
+ addConnectionTypeData();
+}
+
+void tst_Signaldumper::slotEmittingSignalOldSyntax()
+{
+ QFETCH(Qt::ConnectionType, connectionType);
+
+ SignalSlotClass signalSlotOwner;
+
+ auto connection = connect(&signalSlotOwner, SIGNAL(signalWithoutParameters()),
+ &signalSlotOwner, SLOT(emitSecondSignal()), connectionType);
+ emit signalSlotOwner.signalWithoutParameters();
+ QCoreApplication::processEvents();
+ disconnect(connection);
+}
+
+void tst_Signaldumper::variousTypes()
+{
+ SignalSlotClass signalSlotOwner;
+ QString string = QString::fromLatin1("Test string");
+ emit signalSlotOwner.qStringSignal(string);
+ emit signalSlotOwner.qStringRefSignal(string);
+ emit signalSlotOwner.qStringConstRefSignal(string);
+ emit signalSlotOwner.qByteArraySignal(QByteArray("Test bytearray"));
+
+ QList<int> list{1, 2, 3, 242};
+ emit signalSlotOwner.qListSignal(list);
+
+ QVector<int> vector{1, 2, 3, 242};
+ emit signalSlotOwner.qVectorSignal(vector);
+ emit signalSlotOwner.qVectorRefSignal(vector);
+ emit signalSlotOwner.qVectorConstRefSignal(vector);
+ emit signalSlotOwner.qVectorConstPointerSignal(&vector);
+ emit signalSlotOwner.qVectorPointerConstSignal(&vector);
+
+ QVariant variant = 24;
+ emit signalSlotOwner.qVariantSignal(variant);
+ variant = QVariant(string);
+ emit signalSlotOwner.qVariantSignal(variant);
+}
+
+void tst_Signaldumper::deletingSender()
+{
+ SignalSlotClass *signalSlotOwner = new SignalSlotClass();
+ connect(signalSlotOwner, &SignalSlotClass::signalWithoutParameters, [signalSlotOwner]() {
+ delete signalSlotOwner;
+ });
+ emit signalSlotOwner->signalWithoutParameters();
+}
+
+QTEST_MAIN(tst_Signaldumper)
+#include "tst_signaldumper.moc"
diff --git a/tests/auto/testlib/selftests/silent/tst_silent.cpp b/tests/auto/testlib/selftests/silent/tst_silent.cpp
index 97fbbfd30a..cf3c35dec4 100644
--- a/tests/auto/testlib/selftests/silent/tst_silent.cpp
+++ b/tests/auto/testlib/selftests/silent/tst_silent.cpp
@@ -72,6 +72,17 @@ void tst_Silent::xpass()
QVERIFY2(true, "This test should XPASS");
}
+#ifndef Q_OS_WIN
+#include <signal.h>
+#include <setjmp.h>
+
+static jmp_buf state;
+static void abort_handler(int signal)
+{
+ longjmp(state, 1);
+}
+#endif
+
void tst_Silent::messages()
{
qWarning("This is a warning that should not appear in silent test output");
@@ -80,7 +91,15 @@ void tst_Silent::messages()
qCritical("This is a critical message that should not appear in silent test output");
qInfo("This is an info message that should not appear in silent test output");
QTestLog::info("This is an internal testlib info message that should not appear in silent test output", __FILE__, __LINE__);
- qFatal("This is a fatal error message that should still appear in silent test output");
+
+#ifndef Q_OS_WIN
+ // We're testing qFatal, but we don't want to actually std::abort() !
+ auto prior = signal(SIGABRT, abort_handler);
+ if (setjmp(state))
+ signal(SIGABRT, prior);
+ else
+#endif
+ qFatal("This is a fatal error message that should still appear in silent test output");
}
QTEST_MAIN(tst_Silent)
diff --git a/tests/auto/testlib/selftests/sleep/tst_sleep.cpp b/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
index b7b141afd0..95cb68521d 100644
--- a/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
+++ b/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
@@ -28,6 +28,7 @@
#include <QtCore/QCoreApplication>
+#include <QtCore/QElapsedTimer>
#include <QtTest/QtTest>
class tst_Sleep: public QObject
@@ -41,7 +42,7 @@ private slots:
void tst_Sleep::sleep()
{
- QTime t;
+ QElapsedTimer t;
t.start();
QTest::qSleep(100);
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index e8d6fe228b..331ae48135 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -439,7 +439,6 @@ void tst_Selftests::runSubTest_data()
QTest::addColumn<bool>("crashes");
QStringList tests = QStringList()
-// << "alive" // timer dependent
#if !defined(Q_OS_WIN)
// On windows, assert does nothing in release mode and blocks execution
// with a popup window in debug mode.
@@ -488,6 +487,7 @@ void tst_Selftests::runSubTest_data()
<< "printdatatags"
<< "printdatatagswithglobaltags"
<< "qexecstringlist"
+ << "signaldumper"
<< "silent"
<< "singleskip"
<< "skip"
@@ -553,6 +553,9 @@ void tst_Selftests::runSubTest_data()
else if (subtest == "printdatatagswithglobaltags") {
arguments << "-datatags";
}
+ else if (subtest == "signaldumper") {
+ arguments << "-vs";
+ }
else if (subtest == "silent") {
arguments << "-silent";
}
@@ -950,6 +953,29 @@ bool tst_Selftests::compareLine(const QString &logger, const QString &subdir,
if (actualLine.startsWith(QLatin1String("Totals:")) && expectedLine.startsWith(QLatin1String("Totals:")))
return true;
+ const QLatin1String pointerPlaceholder("_POINTER_");
+ if (expectedLine.contains(pointerPlaceholder)
+ && (expectedLine.contains(QLatin1String("Signal: "))
+ || expectedLine.contains(QLatin1String("Slot: ")))) {
+ QString actual = actualLine;
+ // We don't care about the pointer of the object to whom the signal belongs, so we
+ // replace it with _POINTER_, e.g.:
+ // Signal: SignalSlotClass(7ffd72245410) signalWithoutParameters ()
+ // Signal: QThread(7ffd72245410) started ()
+ // After this instance pointer we may have further pointers and
+ // references (with an @ prefix) as parameters of the signal or
+ // slot being invoked.
+ // Signal: SignalSlotClass(_POINTER_) qStringRefSignal ((QString&)@55f5fbb8dd40)
+ actual.replace(QRegularExpression("\\b[a-f0-9]{8,}\\b"), pointerPlaceholder);
+ // Also change QEventDispatcher{Glib,Win32,etc.} to QEventDispatcherPlatform
+ actual.replace(QRegularExpression("\\b(QEventDispatcher)\\w+\\b"), QLatin1String("\\1Platform"));
+ if (actual != expectedLine) {
+ *errorMessage = msgMismatch(actual, expectedLine);
+ return false;
+ }
+ return true;
+ }
+
*errorMessage = msgMismatch(actualLine, expectedLine);
return false;
}
diff --git a/tests/auto/testlib/testlib.pro b/tests/auto/testlib/testlib.pro
index 587c76a189..55f1f9b87b 100644
--- a/tests/auto/testlib/testlib.pro
+++ b/tests/auto/testlib/testlib.pro
@@ -1,5 +1,6 @@
TEMPLATE = subdirs
SUBDIRS = \
+ initmain \
outformat \
qsignalspy \
selftests \
diff --git a/tests/auto/tools/moc/cxx-attributes.h b/tests/auto/tools/moc/cxx-attributes.h
new file mode 100644
index 0000000000..eff6a3ec41
--- /dev/null
+++ b/tests/auto/tools/moc/cxx-attributes.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CXXATTRIBUTE_H
+#define CXXATTRIBUTE_H
+
+#include <QtCore/QObject>
+
+class CppAttribute : public QObject
+{
+ Q_OBJECT
+signals:
+ [[deprecated]] void deprecatedSignal();
+
+public slots:
+ [[deprecated]] void deprecatedSlot() {}
+ [[deprecated]] [[tst_moc::maybe_unused]] int deprecatedSlot2() { return 42; }
+ [[deprecated("reason")]] void deprecatedReason() {}
+ [[deprecated("reason[")]] void deprecatedReasonWithLBRACK() {}
+ [[deprecated("reason[[")]] void deprecatedReasonWith2LBRACK() {}
+ [[deprecated("reason]")]] void deprecatedReasonWithRBRACK() {}
+ [[deprecated("reason]]")]] void deprecatedReasonWith2RBRACK() {}
+ void slotWithArguments([[tst_moc::maybe_unused]] int) {}
+#if !defined(_MSC_VER) || _MSC_VER >= 1912
+ // On MSVC it causes:
+ // moc_cxx-attributes.cpp(133): fatal error C1001: An internal error has occurred in the compiler.
+ Q_INVOKABLE [[tst_moc::noreturn]] void noreturnSlot() { throw "unused"; }
+ [[tst_moc::noreturn]] Q_SCRIPTABLE void noreturnSlot2() { throw "unused"; }
+ [[deprecated]] int returnInt() { return 0; }
+ Q_SLOT [[tst_moc::noreturn]] [[deprecated]] void noreturnDeprecatedSlot() { throw "unused"; }
+ Q_INVOKABLE void noreturnSlot3() [[tst_moc::noreturn]] { throw "unused"; }
+#endif
+};
+
+#ifdef Q_MOC_RUN
+# define TEST_COMPILER_DEPRECATION [[deprecated]]
+# define TEST_COMPILER_DEPRECATION_X(x) [[deprecated(x)]]
+#else
+# define TEST_COMPILER_DEPRECATION Q_DECL_ENUMERATOR_DEPRECATED
+# define TEST_COMPILER_DEPRECATION_X(x) Q_DECL_ENUMERATOR_DEPRECATED_X(x)
+#endif
+
+namespace TestQNamespaceDeprecated {
+ Q_NAMESPACE
+ enum class TestEnum1 {
+ Key1 = 11,
+ Key2 TEST_COMPILER_DEPRECATION,
+ Key3 TEST_COMPILER_DEPRECATION_X("reason"),
+ Key4 TEST_COMPILER_DEPRECATION_X("reason["),
+ Key5 TEST_COMPILER_DEPRECATION_X("reason[["),
+ Key6 TEST_COMPILER_DEPRECATION_X("reason]"),
+ Key7 TEST_COMPILER_DEPRECATION_X("reason]]"),
+ };
+ Q_ENUM_NS(TestEnum1)
+
+ // try to dizzy moc by adding a struct in between
+ struct TestGadget {
+ Q_GADGET
+ public:
+ enum class TestGEnum1 {
+ Key1 = 13,
+ Key2 TEST_COMPILER_DEPRECATION,
+ Key3 TEST_COMPILER_DEPRECATION_X("reason")
+ };
+ Q_ENUM(TestGEnum1)
+ };
+
+ enum class TestFlag1 {
+ None = 0,
+ Flag1 = 1,
+ Flag2 TEST_COMPILER_DEPRECATION = 2,
+ Flag3 TEST_COMPILER_DEPRECATION_X("reason") = 3,
+ Any = Flag1 | Flag2 | Flag3
+ };
+ Q_FLAG_NS(TestFlag1)
+}
+
+#endif // CXXATTRIBUTE_H
diff --git a/tests/auto/tools/moc/cxx11-enums.h b/tests/auto/tools/moc/cxx11-enums.h
index cc14c0acda..d5bd228f12 100644
--- a/tests/auto/tools/moc/cxx11-enums.h
+++ b/tests/auto/tools/moc/cxx11-enums.h
@@ -30,7 +30,6 @@
#define CXX11_ENUMS_H
#include <QtCore/QObject>
-#if defined(Q_COMPILER_CLASS_ENUM) || defined(Q_MOC_RUN)
class CXX11Enums
{
Q_GADGET
@@ -73,21 +72,4 @@ public:
Q_FLAGS(ClassFlags)
};
-#else
-//workaround to get the moc compiled code to compile
-class CXX11Enums
-{
- Q_GADGET
-public:
- struct EnumClass { enum { A0, A1, A2, A3 }; };
- struct TypedEnumClass { enum { C0, C1, C2, C3 }; };
- enum NormalEnum { D2 = 2, D3, D0 =0 , D1 };
- enum TypedEnum { B0, B1 , B2, B3 };
-};
-
-class CXX11Enums2 : public CXX11Enums
-{
- Q_GADGET
-};
-#endif
#endif // CXX11_ENUMS_H
diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro
index 3cbc9ebb5e..ad8c093add 100644
--- a/tests/auto/tools/moc/moc.pro
+++ b/tests/auto/tools/moc/moc.pro
@@ -29,7 +29,8 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n
non-gadget-parent-class.h grand-parent-gadget-class.h \
related-metaobjects-in-gadget.h \
related-metaobjects-name-conflict.h \
- namespace.h cxx17-namespaces.h
+ namespace.h cxx17-namespaces.h \
+ cxx-attributes.h
if(*-g++*|*-icc*|*-clang*|*-llvm):!win32-*: HEADERS += os9-newlines.h win-newlines.h
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index 7b0fa29d7c..bd22b0b9af 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -51,7 +51,6 @@
#define PD_CLASSINFO Q_CLASSINFO
-#if defined(Q_COMPILER_VARIADIC_MACROS) || defined (Q_MOC_RUN)
#define PD_VARARG(x, ...) x(__VA_ARGS__)
#if defined(Q_CC_GNU) || defined(Q_MOC_RUN)
@@ -61,7 +60,6 @@
#define PD_VARARGEXT(x, ...) x(__VA_ARGS__)
#endif
-#endif
#define PD_ADD_SUFFIX(x) PD_DEFINE1(x,_SUFFIX)
#define PD_DEFINE_ITSELF PD_ADD_SUFFIX(PD_DEFINE_ITSELF)
@@ -100,7 +98,6 @@ public slots:
PD_TEST_IDENTIFIER_ARG(void, combined6()) {}
-#if defined(Q_COMPILER_VARIADIC_MACROS) || defined (Q_MOC_RUN)
PD_VARARG(void vararg1) {}
PD_VARARG(void vararg2, int) {}
PD_VARARG(void vararg3, int, int) {}
@@ -108,14 +105,6 @@ public slots:
PD_VARARGEXT(void vararg4) {}
PD_VARARGEXT(void vararg5, int) {}
PD_VARARGEXT(void vararg6, int, int) {}
-#else
- void vararg1() {}
- void vararg2(int) {}
- void vararg3(int,int) {}
- void vararg4() {}
- void vararg5(int) {}
- void vararg6(int,int) {}
-#endif
#define OUTERFUNCTION(x) x
#define INNERFUNCTION(x) OUTERFUNCTION(x)
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 50321c322b..89f563f11d 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -71,6 +71,7 @@
#include "grand-parent-gadget-class.h"
#include "namespace.h"
#include "cxx17-namespaces.h"
+#include "cxx-attributes.h"
#ifdef Q_MOC_RUN
// check that moc can parse these constructs, they are being used in Windows winsock2.h header
@@ -148,6 +149,17 @@ namespace TestQNamespace {
Q_FLAG_NS(TestFlag2)
}
+
+#define TESTEXPORTMACRO Q_DECL_EXPORT
+
+namespace TestExportNamespace {
+ Q_NAMESPACE_EXPORT(TESTEXPORTMACRO)
+ enum class MyEnum {
+ Key1, Key2
+ };
+ Q_ENUM_NS(MyEnum)
+}
+
QT_USE_NAMESPACE
template <bool b> struct QTBUG_31218 {};
@@ -704,6 +716,7 @@ private slots:
void optionsFileError();
void testQNamespace();
void cxx17Namespaces();
+ void cxxAttributes();
signals:
void sigWithUnsignedArg(unsigned foo);
@@ -1040,7 +1053,7 @@ void tst_Moc::testExtraDataForEnum()
const QMetaObject *mobjUser = &EnumUserClass::staticMetaObject;
QCOMPARE(mobjUser->enumeratorCount(), 0);
- const QMetaObject * const *objects = mobjUser->d.relatedMetaObjects;
+ const auto *objects = mobjUser->d.relatedMetaObjects;
QVERIFY(objects);
QCOMPARE(objects[0], mobjSource);
QVERIFY(!objects[1]);
@@ -1424,6 +1437,16 @@ void tst_Moc::environmentIncludePaths()
// plugin_metadata.h contains a plugin which we register here. Since we're not building this
// application as a plugin, we need top copy some of the initializer code found in qplugin.h:
extern "C" QObject *qt_plugin_instance();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+extern "C" QPluginMetaData qt_plugin_query_metadata();
+class StaticPluginInstance{
+public:
+ StaticPluginInstance() {
+ QStaticPlugin plugin(qt_plugin_instance, qt_plugin_query_metadata);
+ qRegisterStaticPluginFunction(plugin);
+ }
+};
+#else
extern "C" const char *qt_plugin_query_metadata();
class StaticPluginInstance{
public:
@@ -1432,6 +1455,7 @@ public:
qRegisterStaticPluginFunction(plugin);
}
};
+#endif
static StaticPluginInstance staticInstance;
void tst_Moc::specifyMetaTagsFromCmdline() {
@@ -3555,10 +3579,9 @@ namespace QTBUG32933_relatedObjectsDontIncludeItself {
void tst_Moc::QTBUG32933_relatedObjectsDontIncludeItself()
{
const QMetaObject *mo = &QTBUG32933_relatedObjectsDontIncludeItself::NS::Obj::staticMetaObject;
- const QMetaObject * const *objects = mo->d.relatedMetaObjects;
+ const auto *objects = mo->d.relatedMetaObjects;
// the related objects should be empty because the enums is in the same object.
QVERIFY(!objects);
-
}
class UnrelatedClass : public QObject
@@ -3664,7 +3687,7 @@ void tst_Moc::relatedMetaObjectsNameConflict()
// load all specified metaobjects int a set
QSet<const QMetaObject*> dependency;
- const QMetaObject *const *i = dependingObject->d.relatedMetaObjects;
+ const auto *i = dependingObject->d.relatedMetaObjects;
while (*i) {
dependency.insert(*i);
++i;
@@ -3848,6 +3871,14 @@ static void checkEnum(const QMetaEnum &enumerator, const QByteArray &name, const
}
}
+class EnumFromNamespaceClass : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(FooNamespace::Enum1 prop READ prop CONSTANT)
+public:
+ FooNamespace::Enum1 prop() { return FooNamespace::Enum1::Key2; }
+};
+
void tst_Moc::testQNamespace()
{
QCOMPARE(TestQNamespace::staticMetaObject.enumeratorCount(), 4);
@@ -3872,9 +3903,18 @@ void tst_Moc::testQNamespace()
QCOMPARE(meta.enclosingMetaObject(), &TestQNamespace::staticMetaObject);
QCOMPARE(meta.keyCount(), 2);
+ QCOMPARE(TestExportNamespace::staticMetaObject.enumeratorCount(), 1);
+ checkEnum(TestExportNamespace::staticMetaObject.enumerator(0), "MyEnum",
+ {{"Key1", 0}, {"Key2", 1}});
+
QCOMPARE(FooNamespace::staticMetaObject.enumeratorCount(), 1);
QCOMPARE(FooNamespace::FooNestedNamespace::staticMetaObject.enumeratorCount(), 2);
QCOMPARE(FooNamespace::FooNestedNamespace::FooMoreNestedNamespace::staticMetaObject.enumeratorCount(), 1);
+
+ EnumFromNamespaceClass obj;
+ const QVariant prop = obj.property("prop");
+ QCOMPARE(prop.type(), QMetaType::Int);
+ QCOMPARE(prop.toInt(), int(FooNamespace::Enum1::Key2));
}
void tst_Moc::cxx17Namespaces()
@@ -3896,6 +3936,41 @@ void tst_Moc::cxx17Namespaces()
QCOMPARE(QMetaEnum::fromType<CXX17Namespace::A::B::C::D::ClassInNamespace::GadEn>().value(0), 3);
}
+void tst_Moc::cxxAttributes()
+{
+ auto so = CppAttribute::staticMetaObject;
+ QCOMPARE(so.className(), "CppAttribute");
+ QCOMPARE(so.enumeratorCount(), 0);
+ QVERIFY(so.indexOfSignal("deprecatedSignal") != 1);
+ for (auto a: {"deprecatedSlot", "deprecatedSlot2", "deprecatedReason", "deprecatedReasonWithLBRACK",
+ "deprecatedReasonWith2LBRACK", "deprecatedReasonWithRBRACK", "deprecatedReasonWith2RBRACK",
+ "slotWithArguments"
+#if !defined(_MSC_VER) || _MSC_VER >= 1912
+ , "noreturnSlot", "noreturnSlot2", "returnInt", "noreturnDeprecatedSlot",
+ "noreturnSlot3"
+#endif
+ }) {
+ QVERIFY(so.indexOfSlot(a) != 1);
+ }
+
+ QCOMPARE(TestQNamespaceDeprecated::staticMetaObject.enumeratorCount(), 2);
+ checkEnum(TestQNamespaceDeprecated::staticMetaObject.enumerator(0), "TestEnum1",
+ {{"Key1", 11}, {"Key2", 12}, {"Key3", 13}, {"Key4", 14}, {"Key5", 15}, {"Key6", 16},
+ {"Key7", 17}});
+ checkEnum(TestQNamespaceDeprecated::staticMetaObject.enumerator(1), "TestFlag1",
+ {{"None", 0}, {"Flag1", 1}, {"Flag2", 2}, {"Flag3", 3}, {"Any", 1 | 2 | 3}});
+
+ QCOMPARE(TestQNamespaceDeprecated::TestGadget::staticMetaObject.enumeratorCount(), 1);
+ checkEnum(TestQNamespaceDeprecated::TestGadget::staticMetaObject.enumerator(0), "TestGEnum1",
+ {{"Key1", 13}, {"Key2", 14}, {"Key3", 15}});
+
+ QMetaEnum meta = QMetaEnum::fromType<TestQNamespaceDeprecated::TestEnum1>();
+ QVERIFY(meta.isValid());
+ QCOMPARE(meta.name(), "TestEnum1");
+ QCOMPARE(meta.enclosingMetaObject(), &TestQNamespaceDeprecated::staticMetaObject);
+ QCOMPARE(meta.keyCount(), 7);
+}
+
QTEST_MAIN(tst_Moc)
// the generated code must compile with QT_NO_KEYWORDS
diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp
index e769f955c4..8ab8d5d721 100644
--- a/tests/auto/tools/qmake/testcompiler.cpp
+++ b/tests/auto/tools/qmake/testcompiler.cpp
@@ -164,15 +164,17 @@ bool TestCompiler::runCommand(const QString &cmd, const QStringList &args, bool
return errorOut();
}
- child.setReadChannel(QProcess::StandardError);
child.waitForFinished(-1);
bool ok = child.exitStatus() == QProcess::NormalExit && (expectFail ^ (child.exitCode() == 0));
- foreach (const QByteArray &output, child.readAllStandardError().split('\n')) {
- testOutput_.append(QString::fromLocal8Bit(output));
-
- if (output.startsWith("Project MESSAGE: FAILED"))
- ok = false;
+ for (auto channel : { QProcess::StandardOutput, QProcess::StandardError }) {
+ child.setReadChannel(channel);
+ while (!child.atEnd()) {
+ const QString output = QString::fromLocal8Bit(child.readLine());
+ if (output.startsWith("Project MESSAGE: FAILED"))
+ ok = false;
+ testOutput_.append(output);
+ }
}
return ok ? true : errorOut();
@@ -292,8 +294,10 @@ bool TestCompiler::make( const QString &workPath, const QString &target, bool ex
D.setCurrent( workPath );
QStringList args = makeArgs_;
- if (makeCmd_.contains("nmake", Qt::CaseInsensitive))
+ if (makeCmd_.contains("nmake", Qt::CaseInsensitive) ||
+ makeCmd_.contains("jom", Qt::CaseInsensitive)) {
args << "/NOLOGO";
+ }
if (!target.isEmpty())
args << target;
diff --git a/tests/auto/tools/qmake/testcompiler.h b/tests/auto/tools/qmake/testcompiler.h
index e22a2c6c3d..d80cd8d53a 100644
--- a/tests/auto/tools/qmake/testcompiler.h
+++ b/tests/auto/tools/qmake/testcompiler.h
@@ -73,13 +73,17 @@ public:
bool removeProject( const QString &workPath, const QString &project );
// removes the file specified by 'fileName' on the 'workPath'
bool removeFile( const QString &workPath, const QString &fileName );
- // returns each line of stdout of the last command append with a "new line" character(s) to suit the platform
+
+ // Returns each line of stdout/stderr of the last commands
+ // separated by platform-specific line endings.
QString commandOutput() const;
+
// clear the results of storage of stdout for running previous commands
void clearCommandOutput();
-private:
bool runCommand(const QString &cmd, const QStringList &args, bool expectFail = false);
+
+private:
bool errorOut();
QString makeCmd_;
diff --git a/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro b/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro
new file mode 100644
index 0000000000..bd0d4d824a
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/conflicting_targets/conflicting_targets.pro
@@ -0,0 +1,5 @@
+TEMPLATE = app
+CONFIG += debug_and_release build_all
+TARGET = bah
+DESTDIR = shu
+SOURCES += main.cpp
diff --git a/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp b/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp
new file mode 100644
index 0000000000..39de28135a
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/conflicting_targets/main.cpp
@@ -0,0 +1,4 @@
+int main(int, char **)
+{
+ return 0;
+}
diff --git a/tests/auto/tools/qmake/testdata/windows_resources/inter.inc b/tests/auto/tools/qmake/testdata/windows_resources/inter.inc
new file mode 100644
index 0000000000..0c2594214e
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/windows_resources/inter.inc
@@ -0,0 +1 @@
+#include "version.inc"
diff --git a/tests/auto/tools/qmake/testdata/windows_resources/main.cpp b/tests/auto/tools/qmake/testdata/windows_resources/main.cpp
new file mode 100644
index 0000000000..237c8ce181
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/windows_resources/main.cpp
@@ -0,0 +1 @@
+int main() {}
diff --git a/tests/auto/tools/qmake/testdata/windows_resources/version.inc b/tests/auto/tools/qmake/testdata/windows_resources/version.inc
new file mode 100644
index 0000000000..b797c9acce
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/windows_resources/version.inc
@@ -0,0 +1,28 @@
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGS 0x0L
+ FILEFLAGSMASK 0x3fL
+ FILEOS 0x00040004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "CompanyName", "The Qt Company Ltd"
+ VALUE "FileDescription", "A Good File"
+ VALUE "FileVersion", "1.0.0.0"
+ VALUE "LegalCopyright", "Copyright (C) 2019 The Qt Company Ltd."
+ VALUE "InternalName", "foo"
+ VALUE "OriginalFilename", "foo.exe"
+ VALUE "ProductName", "A Good Product"
+ VALUE "ProductVersion", "1.0.0.0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/tests/auto/tools/qmake/testdata/windows_resources/windows_resources.pro b/tests/auto/tools/qmake/testdata/windows_resources/windows_resources.pro
new file mode 100644
index 0000000000..80a5e5c19a
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/windows_resources/windows_resources.pro
@@ -0,0 +1,4 @@
+QT = core
+SOURCES = main.cpp
+RC_FILE = windows_resources.rc
+TEMPLATE = app
diff --git a/tests/auto/tools/qmake/testdata/windows_resources/windows_resources.rc b/tests/auto/tools/qmake/testdata/windows_resources/windows_resources.rc
new file mode 100644
index 0000000000..4df652de35
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/windows_resources/windows_resources.rc
@@ -0,0 +1,2 @@
+#include "winver.h"
+#include "inter.inc"
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index 09e725f98a..9b434a7b5b 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -33,6 +33,7 @@
#include <QDir>
#include <QDirIterator>
#include <QObject>
+#include <QRegularExpression>
#include <QStandardPaths>
#include <QTemporaryDir>
@@ -75,14 +76,17 @@ private slots:
void findMocs();
void findDeps();
void rawString();
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_DARWIN)
void bundle_spaces();
+#elif defined(Q_OS_WIN)
+ void windowsResources();
#endif
void substitutes();
void project();
void proFileCache();
void qinstall();
void resources();
+ void conflictingTargets();
private:
TestCompiler test_compiler;
@@ -423,7 +427,7 @@ void tst_qmake::prompt()
{
#if 0
QProcess qmake;
- qmake.setReadChannelMode(QProcess::MergedChannels);
+ qmake.setProcessChannelMode(QProcess::MergedChannels);
qmake.setWorkingDirectory(QLatin1String("testdata/prompt"));
qmake.start(QLatin1String("qmake CONFIG-=debug_and_release CONFIG-=debug CONFIG+=release"),
QIODevice::Text | QIODevice::ReadWrite);
@@ -511,7 +515,8 @@ struct TempFile
}
};
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_DARWIN)
+
void tst_qmake::bundle_spaces()
{
QString workDir = base_path + "/testdata/bundle-spaces";
@@ -542,7 +547,34 @@ void tst_qmake::bundle_spaces()
QVERIFY( !non_existing_file.exists() );
QVERIFY( test_compiler.removeMakefile(workDir) );
}
-#endif // defined(Q_OS_MAC)
+
+#elif defined(Q_OS_WIN) // defined(Q_OS_DARWIN)
+
+void tst_qmake::windowsResources()
+{
+ QString workDir = base_path + "/testdata/windows_resources";
+ QVERIFY(test_compiler.qmake(workDir, "windows_resources"));
+ QVERIFY(test_compiler.make(workDir));
+
+ // Another "make" must not rebuild the .res file
+ test_compiler.clearCommandOutput();
+ QVERIFY(test_compiler.make(workDir));
+ QVERIFY(!test_compiler.commandOutput().contains("windows_resources.rc"));
+ test_compiler.clearCommandOutput();
+
+ // Wait a second to make sure we get a new timestamp in the touch below
+ QTest::qWait(1000);
+
+ // Touch the deepest include of the .rc file
+ QVERIFY(test_compiler.runCommand("cmd", QStringList{"/c",
+ "echo.>>" + QDir::toNativeSeparators(workDir + "/version.inc")}));
+
+ // The next "make" must rebuild the .res file
+ QVERIFY(test_compiler.make(workDir));
+ QVERIFY(test_compiler.commandOutput().contains("windows_resources.rc"));
+}
+
+#endif // defined(Q_OS_WIN)
void tst_qmake::substitutes()
{
@@ -717,5 +749,18 @@ void tst_qmake::resources()
QVERIFY(test_compiler.make(workDir));
}
+void tst_qmake::conflictingTargets()
+{
+ QString workDir = base_path + "/testdata/conflicting_targets";
+ QVERIFY(test_compiler.qmake(workDir, "conflicting_targets"));
+ const QRegularExpression rex("Targets of builds '([^']+)' and '([^']+)' conflict");
+ auto match = rex.match(test_compiler.commandOutput());
+ QVERIFY(match.hasMatch());
+ QStringList builds = { match.captured(1), match.captured(2) };
+ std::sort(builds.begin(), builds.end());
+ const QStringList expectedBuilds{"Debug", "Release"};
+ QCOMPARE(builds, expectedBuilds);
+}
+
QTEST_MAIN(tst_qmake)
#include "tst_qmake.moc"
diff --git a/tests/auto/tools/qmakelib/qmakelib.pro b/tests/auto/tools/qmakelib/qmakelib.pro
index 29f17f6a14..5e9e9fe637 100644
--- a/tests/auto/tools/qmakelib/qmakelib.pro
+++ b/tests/auto/tools/qmakelib/qmakelib.pro
@@ -1,7 +1,7 @@
CONFIG += testcase
TARGET = tst_qmakelib
QT = core testlib
-win32: LIBS += -ladvapi32
+win32: QMAKE_USE += advapi32
INCLUDEPATH += ../../../../qmake/library
VPATH += ../../../../qmake/library
diff --git a/tests/auto/tools/rcc/data/depfile/simple.d.expected b/tests/auto/tools/rcc/data/depfile/simple.d.expected
new file mode 100644
index 0000000000..a89b61bdc7
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/simple.d.expected
@@ -0,0 +1 @@
+simple.qrc.cpp: ../images/images/circle.png ../images/images/square.png
diff --git a/tests/auto/tools/rcc/data/depfile/simple.qrc b/tests/auto/tools/rcc/data/depfile/simple.qrc
new file mode 100644
index 0000000000..521dc4d4a0
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/simple.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>../images/images/circle.png</file>
+ <file>../images/images/square.png</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/data/depfile/specialchar$file.txt b/tests/auto/tools/rcc/data/depfile/specialchar$file.txt
new file mode 100644
index 0000000000..5da849b5c6
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/specialchar$file.txt
@@ -0,0 +1 @@
+ABC
diff --git a/tests/auto/tools/rcc/data/depfile/specialchar.d.expected b/tests/auto/tools/rcc/data/depfile/specialchar.d.expected
new file mode 100644
index 0000000000..9dd1af0958
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/specialchar.d.expected
@@ -0,0 +1 @@
+specialchar.qrc.cpp: specialchar$$file.txt ../images/images/subdir/triangle.png
diff --git a/tests/auto/tools/rcc/data/depfile/specialchar.qrc b/tests/auto/tools/rcc/data/depfile/specialchar.qrc
new file mode 100644
index 0000000000..133cbc7655
--- /dev/null
+++ b/tests/auto/tools/rcc/data/depfile/specialchar.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>../images/images/subdir/triangle.png</file>
+ <file>specialchar$file.txt</file>
+</qresource>
+</RCC>
diff --git a/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected
new file mode 100644
index 0000000000..9dcd131af5
--- /dev/null
+++ b/tests/auto/tools/rcc/data/sizes/size-2-0-35-1_python.expected
@@ -0,0 +1,68 @@
+# Resource object code (Python 3)
+# Created by: object code
+# Created by: The Resource Compiler for Qt version 5.14.0
+# WARNING! All changes made in this file will be lost!
+
+from PySide2 import QtCore
+
+qt_resource_data = b"\
+\x00\x00\x00\x02\
+0\
+1\
+\x00\x00\x00#\
+0\
+123456789 012345\
+6789 0123456789 \
+12\
+\x00\x00\x00\x01\
+@\
+\
+\x00\x00\x00\x00\
+\
+"
+
+qt_resource_name = b"\
+\x00\x04\
+\x00\x06\xa8\xa1\
+\x00d\
+\x00a\x00t\x00a\
+\x00\x0a\
+\x04\x08\x0a\xb4\
+\x00d\
+\x00a\x00t\x00a\x00-\x002\x00.\x00t\x00x\x00t\
+\x00\x0b\
+\x00\xb5Ot\
+\x00d\
+\x00a\x00t\x00a\x00-\x003\x005\x00.\x00t\x00x\x00t\
+\x00\x0a\
+\x04\x11\x0a\xb4\
+\x00d\
+\x00a\x00t\x00a\x00-\x001\x00.\x00t\x00x\x00t\
+\x00\x0a\
+\x04\x0e\x0a\xb4\
+\x00d\
+\x00a\x00t\x00a\x00-\x000\x00.\x00t\x00x\x00t\
+"
+
+qt_resource_struct = b"\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
+\x00\x00\x00\x00\x00\x00\x00\x00\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x02\
+\x00\x00\x00\x00\x00\x00\x00\x00\
+\x00\x00\x00(\x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\
+IGNORE: (time stamp)
+\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
+IGNORE: (time stamp)
+\x00\x00\x00^\x00\x00\x00\x00\x00\x01\x00\x00\x002\
+IGNORE: (time stamp)
+\x00\x00\x00D\x00\x00\x00\x00\x00\x01\x00\x00\x00-\
+IGNORE: (time stamp)
+"
+
+def qInitResources():
+ QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+def qCleanupResources():
+ QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+qInitResources()
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp
index c810c6e364..42a4134e5f 100644
--- a/tests/auto/tools/rcc/tst_rcc.cpp
+++ b/tests/auto/tools/rcc/tst_rcc.cpp
@@ -46,6 +46,33 @@
typedef QMap<QString, QString> QStringMap;
Q_DECLARE_METATYPE(QStringMap)
+static QByteArray msgProcessStartFailed(const QProcess &p)
+{
+ const QString result = QLatin1String("Could not start \"")
+ + QDir::toNativeSeparators(p.program()) + QLatin1String("\": ")
+ + p.errorString();
+ return result.toLocal8Bit();
+}
+
+static QByteArray msgProcessTimeout(const QProcess &p)
+{
+ return '"' + QDir::toNativeSeparators(p.program()).toLocal8Bit()
+ + "\" timed out.";
+}
+
+static QByteArray msgProcessCrashed(QProcess &p)
+{
+ return '"' + QDir::toNativeSeparators(p.program()).toLocal8Bit()
+ + "\" crashed.\n" + p.readAllStandardError();
+}
+
+static QByteArray msgProcessFailed(QProcess &p)
+{
+ return '"' + QDir::toNativeSeparators(p.program()).toLocal8Bit()
+ + "\" returned " + QByteArray::number(p.exitCode()) + ":\n"
+ + p.readAllStandardError();
+}
+
class tst_rcc : public QObject
{
Q_OBJECT
@@ -62,10 +89,16 @@ private slots:
void readback_data();
void readback();
+ void depFileGeneration_data();
+ void depFileGeneration();
+
+ void python();
+
void cleanupTestCase();
private:
QString m_rcc;
+ QString m_dataPath;
};
void tst_rcc::initTestCase()
@@ -74,20 +107,19 @@ void tst_rcc::initTestCase()
// we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078
QVERIFY(qputenv("QT_RCC_TEST", "1"));
m_rcc = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/rcc");
-}
-QString findExpectedFile(const QString &base)
-{
- QString expectedrccfile = base;
+ m_dataPath = QFINDTESTDATA("data");
+ QVERIFY(!m_dataPath.isEmpty());
+}
- // Must be updated with each minor release.
- if (QFileInfo(expectedrccfile + QLatin1String(".450")).exists())
- expectedrccfile += QLatin1String(".450");
- return expectedrccfile;
+static inline bool isPythonComment(const QString &line)
+{
+ return line.startsWith(QLatin1Char('#'));
}
-static QString doCompare(const QStringList &actual, const QStringList &expected)
+static QString doCompare(const QStringList &actual, const QStringList &expected,
+ const QString &timeStampPath)
{
if (actual.size() != expected.size()) {
return QString("Length count different: actual: %1, expected: %2")
@@ -95,13 +127,21 @@ static QString doCompare(const QStringList &actual, const QStringList &expected)
}
QByteArray ba;
+ const bool isPython = isPythonComment(expected.constFirst());
for (int i = 0, n = expected.size(); i != n; ++i) {
QString expectedLine = expected.at(i);
if (expectedLine.startsWith("IGNORE:"))
continue;
+ if (isPython && isPythonComment(expectedLine) && isPythonComment(actual.at(i)))
+ continue;
if (expectedLine.startsWith("TIMESTAMP:")) {
const QString relativePath = expectedLine.mid(strlen("TIMESTAMP:"));
- const quint64 timeStamp = QFileInfo(relativePath).lastModified().toMSecsSinceEpoch();
+ const QFileInfo fi(timeStampPath + QLatin1Char('/') + relativePath);
+ if (!fi.isFile()) {
+ ba.append("File " + fi.absoluteFilePath().toUtf8() + " does not exist!");
+ break;
+ }
+ const quint64 timeStamp = quint64(fi.lastModified().toMSecsSinceEpoch());
expectedLine.clear();
for (int shift = 56; shift >= 0; shift -= 8) {
expectedLine.append(QLatin1String("0x"));
@@ -110,7 +150,7 @@ static QString doCompare(const QStringList &actual, const QStringList &expected)
}
}
if (expectedLine != actual.at(i)) {
- qDebug() << "LINES" << i << "DIFFER";
+ qDebug() << "LINES" << (i + 1) << "DIFFER";
ba.append(
"\n<<<<<< actual\n" + actual.at(i) + "\n======\n" + expectedLine
+ "\n>>>>>> expected\n"
@@ -126,49 +166,53 @@ void tst_rcc::rcc_data()
QTest::addColumn<QString>("qrcfile");
QTest::addColumn<QString>("expected");
- QString dataPath = QFINDTESTDATA("data/images/");
- if (dataPath.isEmpty())
- QFAIL("data path not found");
- QTest::newRow("images") << dataPath << "images.qrc" << "images.expected";
+ const QString imagesPath = m_dataPath + QLatin1String("/images");
+ QTest::newRow("images") << imagesPath << "images.qrc" << "images.expected";
- QString sizesPath = QFINDTESTDATA("data/sizes/");
- if (sizesPath.isEmpty())
- QFAIL("data path not found");
+ const QString sizesPath = m_dataPath + QLatin1String("/sizes");
QTest::newRow("size-0") << sizesPath << "size-0.qrc" << "size-0.expected";
QTest::newRow("size-1") << sizesPath << "size-1.qrc" << "size-1.expected";
QTest::newRow("size-2-0-35-1") << sizesPath << "size-2-0-35-1.qrc" << "size-2-0-35-1.expected";
}
+static QStringList readLinesFromFile(const QString &fileName,
+ QString::SplitBehavior splitBehavior)
+{
+ QFile file(fileName);
+
+ bool ok = file.open(QIODevice::ReadOnly | QIODevice::Text);
+ if (!ok) {
+ QWARN(qPrintable(QString::fromLatin1("Could not open testdata file %1: %2")
+ .arg(fileName, file.errorString())));
+ }
+
+ return QString::fromUtf8(file.readAll()).split(QLatin1Char('\n'), splitBehavior);
+}
+
void tst_rcc::rcc()
{
QFETCH(QString, directory);
QFETCH(QString, qrcfile);
QFETCH(QString, expected);
- if (!QDir::setCurrent(directory)) {
- QString message = QString::fromLatin1("Unable to cd from '%1' to '%2'").arg(QDir::currentPath(), directory);
- QFAIL(qPrintable(message));
- }
-
// If the file expectedoutput.txt exists, compare the
// console output with the content of that file
- const QString expected2 = findExpectedFile(expected);
- QFile expectedFile(expected2);
- if (!expectedFile.exists()) {
- qDebug() << "NO EXPECTATIONS? " << expected2;
- return;
- }
// Launch; force no compression, otherwise the output would be different
// depending on the compression algorithm we're using
QProcess process;
+ process.setWorkingDirectory(directory);
process.start(m_rcc, { "-no-compress", qrcfile });
+ QVERIFY2(process.waitForStarted(), msgProcessStartFailed(process).constData());
if (!process.waitForFinished()) {
- const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
- QString message = QString::fromLatin1("'%1' could not be found when run from '%2'. Path: '%3' ").
- arg(m_rcc, QDir::currentPath(), path);
- QFAIL(qPrintable(message));
+ process.kill();
+ QFAIL(msgProcessTimeout(process).constData());
}
+ QVERIFY2(process.exitStatus() == QProcess::NormalExit,
+ msgProcessCrashed(process).constData());
+ QVERIFY2(process.exitCode() == 0,
+ msgProcessFailed(process).constData());
+
const QChar cr = QLatin1Char('\r');
const QString err = QString::fromLocal8Bit(process.readAllStandardError()).remove(cr);
const QString out = QString::fromLatin1(process.readAllStandardOutput()).remove(cr);
@@ -181,63 +225,20 @@ void tst_rcc::rcc()
const QChar nl = QLatin1Char('\n');
const QStringList actualLines = out.split(nl);
- QVERIFY(expectedFile.open(QIODevice::ReadOnly|QIODevice::Text));
- const QStringList expectedLines = QString::fromLatin1(expectedFile.readAll()).split(nl);
+ const QStringList expectedLines =
+ readLinesFromFile(directory + QLatin1Char('/') + expected, QString::KeepEmptyParts);
+ QVERIFY(!expectedLines.isEmpty());
- const QString diff = doCompare(actualLines, expectedLines);
+ const QString diff = doCompare(actualLines, expectedLines, directory);
if (diff.size())
QFAIL(qPrintable(diff));
}
-
-
-static void createRccBinaryData(const QString &rcc, const QString &baseDir,
- const QString &qrcFileName, const QString &rccFileName)
-{
- QString currentDir = QDir::currentPath();
- QDir::setCurrent(baseDir);
-
- // same as above: force no compression
- QProcess rccProcess;
- rccProcess.start(rcc, { "-binary", "-no-compress", "-o", rccFileName, qrcFileName });
- bool ok = rccProcess.waitForFinished();
- if (!ok) {
- QString errorString = QString::fromLatin1("Could not start rcc (is it in PATH?): %1").arg(rccProcess.errorString());
- QFAIL(qPrintable(errorString));
- }
-
- QByteArray output = rccProcess.readAllStandardOutput();
- if (!output.isEmpty()) {
- QString errorMessage = QString::fromLatin1("rcc stdout: %1").arg(QString::fromLocal8Bit(output));
- QWARN(qPrintable(errorMessage));
- }
-
- output = rccProcess.readAllStandardError();
- if (!output.isEmpty()) {
- QString errorMessage = QString::fromLatin1("rcc stderr: %1").arg(QString::fromLocal8Bit(output));
- QWARN(qPrintable(errorMessage));
- }
-
- QDir::setCurrent(currentDir);
-}
-
-static QStringList readLinesFromFile(const QString &fileName)
-{
- QFile file(fileName);
-
- bool ok = file.open(QIODevice::ReadOnly | QIODevice::Text);
- if (!ok)
- QWARN(qPrintable(QString::fromLatin1("Could not open testdata file %1: %2").arg(fileName, file.errorString())));
-
- QStringList lines = QString::fromUtf8(file.readAll()).split(QLatin1Char('\n'), QString::SkipEmptyParts);
- return lines;
-}
-
static QStringMap readExpectedFiles(const QString &fileName)
{
QStringMap expectedFiles;
- QStringList lines = readLinesFromFile(fileName);
+ QStringList lines = readLinesFromFile(fileName, QString::SkipEmptyParts);
foreach (const QString &line, lines) {
QString resourceFileName = line.section(QLatin1Char(' '), 0, 0, QString::SectionSkipEmpty);
QString actualFileName = line.section(QLatin1Char(' '), 1, 1, QString::SectionSkipEmpty);
@@ -268,9 +269,7 @@ void tst_rcc::binary_data()
QTest::addColumn<QString>("baseDirectory");
QTest::addColumn<QStringMap>("expectedFiles");
- QString dataPath = QFINDTESTDATA("data/binary/");
- if (dataPath.isEmpty())
- QFAIL("data path not found");
+ QString dataPath = m_dataPath + QLatin1String("/binary/");
QDirIterator iter(dataPath, QStringList() << QLatin1String("*.qrc"));
while (iter.hasNext())
@@ -279,12 +278,33 @@ void tst_rcc::binary_data()
QFileInfo qrcFileInfo = iter.fileInfo();
QString absoluteBaseName = QFileInfo(qrcFileInfo.absolutePath(), qrcFileInfo.baseName()).absoluteFilePath();
QString rccFileName = absoluteBaseName + QLatin1String(".rcc");
- createRccBinaryData(m_rcc, dataPath, qrcFileInfo.absoluteFilePath(), rccFileName);
+
+ // same as above: force no compression
+ QProcess rccProcess;
+ rccProcess.setWorkingDirectory(dataPath);
+ rccProcess.start(m_rcc, { "-binary", "-no-compress", "-o", rccFileName, qrcFileInfo.absoluteFilePath() });
+ QVERIFY2(rccProcess.waitForStarted(), msgProcessStartFailed(rccProcess).constData());
+ if (!rccProcess.waitForFinished()) {
+ rccProcess.kill();
+ QFAIL(msgProcessTimeout(rccProcess).constData());
+ }
+ QVERIFY2(rccProcess.exitStatus() == QProcess::NormalExit,
+ msgProcessCrashed(rccProcess).constData());
+ QVERIFY2(rccProcess.exitCode() == 0,
+ msgProcessFailed(rccProcess).constData());
+
+ QByteArray output = rccProcess.readAllStandardOutput();
+ if (!output.isEmpty())
+ qWarning("rcc stdout: %s", output.constData());
+
+ output = rccProcess.readAllStandardError();
+ if (!output.isEmpty())
+ qWarning("rcc stderr: %s", output.constData());
QString localeFileName = absoluteBaseName + QLatin1String(".locale");
QFile localeFile(localeFileName);
if (localeFile.exists()) {
- QStringList locales = readLinesFromFile(localeFileName);
+ QStringList locales = readLinesFromFile(localeFileName, QString::SkipEmptyParts);
foreach (const QString &locale, locales) {
QString expectedFileName = QString::fromLatin1("%1.%2.%3").arg(absoluteBaseName, locale, QLatin1String("expected"));
QStringMap expectedFiles = readExpectedFiles(expectedFileName);
@@ -386,16 +406,12 @@ void tst_rcc::readback()
QFETCH(QString, resourceName);
QFETCH(QString, fileSystemName);
- QString dataPath = QFINDTESTDATA("data/");
- if (dataPath.isEmpty())
- QFAIL("data path not found");
-
QFile resourceFile(resourceName);
QVERIFY(resourceFile.open(QIODevice::ReadOnly));
QByteArray resourceData = resourceFile.readAll();
resourceFile.close();
- QFile fileSystemFile(dataPath + fileSystemName);
+ QFile fileSystemFile(m_dataPath + QLatin1Char('/') + fileSystemName);
QVERIFY(fileSystemFile.open(QIODevice::ReadOnly));
QByteArray fileSystemData = fileSystemFile.readAll();
fileSystemFile.close();
@@ -403,13 +419,85 @@ void tst_rcc::readback()
QCOMPARE(resourceData, fileSystemData);
}
+void tst_rcc::depFileGeneration_data()
+{
+ QTest::addColumn<QString>("qrcfile");
+ QTest::addColumn<QString>("depfile");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("simple") << "simple.qrc" << "simple.d" << "simple.d.expected";
+ QTest::newRow("specialchar") << "specialchar.qrc" << "specialchar.d" << "specialchar.d.expected";
+}
+
+void tst_rcc::depFileGeneration()
+{
+ QFETCH(QString, qrcfile);
+ QFETCH(QString, depfile);
+ QFETCH(QString, expected);
+ const QString directory = m_dataPath + QLatin1String("/depfile");
+
+ QProcess process;
+ process.setWorkingDirectory(directory);
+ process.start(m_rcc, { "-d", depfile, "-o", qrcfile + ".cpp", qrcfile });
+ QVERIFY2(process.waitForStarted(), msgProcessStartFailed(process).constData());
+ if (!process.waitForFinished()) {
+ process.kill();
+ QFAIL(msgProcessTimeout(process).constData());
+ }
+ QVERIFY2(process.exitStatus() == QProcess::NormalExit,
+ msgProcessCrashed(process).constData());
+ QVERIFY2(process.exitCode() == 0,
+ msgProcessFailed(process).constData());
+
+ QFile depFileOutput(directory + QLatin1String("/") + depfile);
+ QVERIFY(depFileOutput.open(QIODevice::ReadOnly | QIODevice::Text));
+ QByteArray depFileData = depFileOutput.readAll();
+ depFileOutput.close();
+
+ QFile depFileExpected(directory + QLatin1String("/") + expected);
+ QVERIFY(depFileExpected.open(QIODevice::ReadOnly | QIODevice::Text));
+ QByteArray expectedData = depFileExpected.readAll();
+ depFileExpected.close();
+
+ QCOMPARE(depFileData, expectedData);
+}
+
+void tst_rcc::python()
+{
+ const QString path = m_dataPath + QLatin1String("/sizes");
+ const QString testFileRoot = path + QLatin1String("/size-2-0-35-1");
+ const QString qrcFile = testFileRoot + QLatin1String(".qrc");
+ const QString expectedFile = testFileRoot + QLatin1String("_python.expected");
+ const QString actualFile = testFileRoot + QLatin1String(".rcc");
+
+ QProcess process;
+ process.setWorkingDirectory(path);
+ process.start(m_rcc, { "-g", "python", "-o", actualFile, qrcFile});
+ QVERIFY2(process.waitForStarted(), msgProcessStartFailed(process).constData());
+ if (!process.waitForFinished()) {
+ process.kill();
+ QFAIL(msgProcessTimeout(process).constData());
+ }
+ QVERIFY2(process.exitStatus() == QProcess::NormalExit,
+ msgProcessCrashed(process).constData());
+ QVERIFY2(process.exitCode() == 0,
+ msgProcessFailed(process).constData());
+
+ const auto actualLines = readLinesFromFile(actualFile, QString::KeepEmptyParts);
+ QVERIFY(!actualLines.isEmpty());
+ const auto expectedLines = readLinesFromFile(expectedFile, QString::KeepEmptyParts);
+ QVERIFY(!expectedLines.isEmpty());
+ const QString diff = doCompare(actualLines, expectedLines, path);
+ if (!diff.isEmpty())
+ QFAIL(qPrintable(diff));
+}
+
void tst_rcc::cleanupTestCase()
{
- QString dataPath = QFINDTESTDATA("data/binary/");
- if (dataPath.isEmpty())
- return;
- QDir dataDir(dataPath);
+ QDir dataDir(m_dataPath + QLatin1String("/binary"));
QFileInfoList entries = dataDir.entryInfoList(QStringList() << QLatin1String("*.rcc"));
+ QDir dataDepDir(m_dataPath + QLatin1String("/depfile"));
+ entries += dataDepDir.entryInfoList({QLatin1String("*.d"), QLatin1String("*.qrc.cpp")});
foreach (const QFileInfo &entry, entries)
QFile::remove(entry.absoluteFilePath());
}
diff --git a/tests/auto/tools/uic/baseline/dialog.ui b/tests/auto/tools/uic/baseline/dialog.ui
index e99d6fb3c4..936cc2eee8 100644
--- a/tests/auto/tools/uic/baseline/dialog.ui
+++ b/tests/auto/tools/uic/baseline/dialog.ui
@@ -1,4 +1,4 @@
-<ui version="4.0" >
+<ui version="4.0" connectslotsbyname="false">
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
diff --git a/tests/auto/tools/uic/baseline/dialog.ui.h b/tests/auto/tools/uic/baseline/dialog.ui.h
index aeed71d058..cd6449873e 100644
--- a/tests/auto/tools/uic/baseline/dialog.ui.h
+++ b/tests/auto/tools/uic/baseline/dialog.ui.h
@@ -52,8 +52,6 @@ public:
retranslateUi(Dialog);
-
- QMetaObject::connectSlotsByName(Dialog);
} // setupUi
void retranslateUi(QDialog *Dialog)
diff --git a/tests/auto/tools/uic/baseline/qfiledialog.ui.h b/tests/auto/tools/uic/baseline/qfiledialog.ui.h
index 9e51ee6a7c..52f8d25c75 100644
--- a/tests/auto/tools/uic/baseline/qfiledialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qfiledialog.ui.h
@@ -291,7 +291,7 @@ public:
detailModeButton->setToolTip(QCoreApplication::translate("QFileDialog", "Detail View", nullptr));
#endif // QT_CONFIG(tooltip)
fileTypeLabel->setText(QCoreApplication::translate("QFileDialog", "Files of type:", nullptr));
- Q_UNUSED(QFileDialog);
+ (void)QFileDialog;
} // retranslateUi
};
diff --git a/tests/auto/tools/uic/tst_uic.cpp b/tests/auto/tools/uic/tst_uic.cpp
index f9553028fe..5b2f1f008b 100644
--- a/tests/auto/tools/uic/tst_uic.cpp
+++ b/tests/auto/tools/uic/tst_uic.cpp
@@ -36,17 +36,27 @@
#include <QtCore/QTemporaryDir>
#include <QtCore/QRegularExpression>
#include <QtCore/QStandardPaths>
+#include <QtCore/QVector>
#include <cstdio>
static const char keepEnvVar[] = "UIC_KEEP_GENERATED_FILES";
static const char diffToStderrEnvVar[] = "UIC_STDERR_DIFF";
+struct TestEntry
+{
+ QByteArray name;
+ QString baselineBaseName;
+ QString generatedFileName;
+};
+
class tst_uic : public QObject
{
Q_OBJECT
public:
+ using TestEntries = QVector<TestEntry>;
+
tst_uic();
private Q_SLOTS:
@@ -63,13 +73,20 @@ private Q_SLOTS:
void compare();
void compare_data() const;
+ void python();
+ void python_data() const;
+
void runCompare();
private:
+ void populateTestEntries();
+
const QString m_command;
QString m_baseline;
QTemporaryDir m_generated;
+ TestEntries m_testEntries;
QRegularExpression m_versionRegexp;
+ QString m_python;
};
tst_uic::tst_uic()
@@ -85,6 +102,32 @@ static QByteArray msgProcessStartFailed(const QString &command, const QString &w
return result.toLocal8Bit();
}
+// Locate Python and check whether PySide2 is installed
+static QString locatePython(QTemporaryDir &generatedDir)
+{
+ QString python = QStandardPaths::findExecutable(QLatin1String("python"));
+ if (python.isEmpty()) {
+ qWarning("Cannot locate python, skipping tests");
+ return QString();
+ }
+ QFile importTestFile(generatedDir.filePath(QLatin1String("import_test.py")));
+ if (!importTestFile.open(QIODevice::WriteOnly| QIODevice::Text))
+ return QString();
+ importTestFile.write("import PySide2.QtCore\n");
+ importTestFile.close();
+ QProcess process;
+ process.start(python, {importTestFile.fileName()});
+ if (!process.waitForStarted() || !process.waitForFinished())
+ return QString();
+ if (process.exitStatus() != QProcess::NormalExit || process.exitCode() != 0) {
+ const QString stdErr = QString::fromLocal8Bit(process.readAllStandardError()).simplified();
+ qWarning("PySide2 is not installed (%s)", qPrintable(stdErr));
+ return QString();
+ }
+ importTestFile.remove();
+ return python;
+}
+
void tst_uic::initTestCase()
{
QVERIFY2(m_generated.isValid(), qPrintable(m_generated.errorString()));
@@ -105,7 +148,28 @@ void tst_uic::initTestCase()
arg(QDir::currentPath());
if (!outLines.empty())
msg += outLines.front();
+ populateTestEntries();
+ QVERIFY(!m_testEntries.isEmpty());
qDebug("%s", qPrintable(msg));
+
+ m_python = locatePython(m_generated);
+}
+
+void tst_uic::populateTestEntries()
+{
+ const QString generatedPrefix = m_generated.path() + QLatin1Char('/');
+ QDir baseline(m_baseline);
+ const QString baseLinePrefix = baseline.path() + QLatin1Char('/');
+ const QFileInfoList baselineFiles =
+ baseline.entryInfoList(QStringList(QString::fromLatin1("*.ui")), QDir::Files);
+ m_testEntries.reserve(baselineFiles.size());
+ for (const QFileInfo &baselineFile : baselineFiles) {
+ const QString baseName = baselineFile.baseName();
+ const QString baselineBaseName = baseLinePrefix + baseName;
+ const QString generatedFile = generatedPrefix + baselineFile.fileName()
+ + QLatin1String(".h");
+ m_testEntries.append(TestEntry{baseName.toLocal8Bit(), baselineBaseName, generatedFile});
+ }
}
static const char helpFormat[] = R"(
@@ -171,22 +235,12 @@ void tst_uic::run_data() const
QTest::addColumn<QString>("generatedFile");
QTest::addColumn<QStringList>("options");
- QDir generated(m_generated.path());
- QDir baseline(m_baseline);
- const QFileInfoList baselineFiles = baseline.entryInfoList(QStringList("*.ui"), QDir::Files);
- foreach (const QFileInfo &baselineFile, baselineFiles) {
- const QString generatedFile = generated.absolutePath()
- + QLatin1Char('/') + baselineFile.fileName()
- + QLatin1String(".h");
-
+ for (const TestEntry &te : m_testEntries) {
QStringList options;
- if (baselineFile.fileName() == QLatin1String("qttrid.ui"))
+ if (te.name == QByteArrayLiteral("qttrid"))
options << QStringList(QLatin1String("-idbased"));
-
- QTest::newRow(qPrintable(baselineFile.baseName()))
- << baselineFile.absoluteFilePath()
- << generatedFile
- << options;
+ QTest::newRow(te.name.constData()) << (te.baselineBaseName + QLatin1String(".ui"))
+ << te.generatedFileName << options;
}
}
@@ -264,15 +318,9 @@ void tst_uic::compare_data() const
QTest::addColumn<QString>("originalFile");
QTest::addColumn<QString>("generatedFile");
- QDir generated(m_generated.path());
- QDir baseline(m_baseline);
- const QFileInfoList baselineFiles = baseline.entryInfoList(QStringList("*.h"), QDir::Files);
- foreach (const QFileInfo &baselineFile, baselineFiles) {
- const QString generatedFile = generated.absolutePath()
- + QLatin1Char('/') + baselineFile.fileName();
- QTest::newRow(qPrintable(baselineFile.baseName()))
- << baselineFile.absoluteFilePath()
- << generatedFile;
+ for (const TestEntry &te : m_testEntries) {
+ QTest::newRow(te.name.constData()) << (te.baselineBaseName + QLatin1String(".ui.h"))
+ << te.generatedFileName;
}
}
@@ -280,7 +328,7 @@ void tst_uic::runTranslation()
{
QProcess process;
- QDir baseline(m_baseline);
+ const QDir baseline(m_baseline);
QDir generated(m_generated.path());
generated.mkdir(QLatin1String("translation"));
@@ -327,5 +375,75 @@ void tst_uic::runCompare()
QCOMPARE(generatedFileContents, originalFileContents);
}
+// Let uic generate Python code and verify that it is syntactically
+// correct by compiling it into .pyc. This test is executed only
+// when python with an installed Qt for Python is detected (see locatePython()).
+
+static inline QByteArray msgCompilePythonFailed(const QByteArray &error)
+{
+ // If there is a line with blanks and caret indicating an error in the line
+ // above, insert the cursor into the offending line and remove the caret.
+ QByteArrayList lines = error.trimmed().split('\n');
+ for (int i = lines.size() - 1; i > 0; --i) {
+ const auto &line = lines.at(i);
+ const int caret = line.indexOf('^');
+ if (caret == 0 || (caret > 0 && line.at(caret - 1) == ' ')) {
+ lines.removeAt(i);
+ lines[i - 1].insert(caret, '|');
+ break;
+ }
+ }
+ return lines.join('\n');
+}
+
+void tst_uic::python_data() const
+{
+ QTest::addColumn<QString>("originalFile");
+ QTest::addColumn<QString>("generatedFile");
+
+ const int size = m_python.isEmpty()
+ ? qMin(1, m_testEntries.size()) : m_testEntries.size();
+ for (int i = 0; i < size; ++i) {
+ const TestEntry &te = m_testEntries.at(i);
+ // qprintsettingsoutput: variable named 'from' clashes with Python
+ if (!te.baselineBaseName.endsWith(QLatin1String("/qprintsettingsoutput"))) {
+ QString generatedFile = te.generatedFileName;
+ generatedFile.chop(1); // foo.h -> foo.py
+ generatedFile.append(QLatin1String("py"));
+ QTest::newRow(te.name.constData())
+ << (te.baselineBaseName + QLatin1String(".ui"))
+ << generatedFile;
+ }
+ }
+}
+
+void tst_uic::python()
+{
+ QFETCH(QString, originalFile);
+ QFETCH(QString, generatedFile);
+ if (m_python.isEmpty())
+ QSKIP("Python was not found");
+
+ QStringList uicArguments{QLatin1String("-g"), QLatin1String("python"),
+ originalFile, QLatin1String("-o"), generatedFile};
+ QProcess process;
+ process.setWorkingDirectory(m_generated.path());
+ process.start(m_command, uicArguments);
+ QVERIFY2(process.waitForStarted(), msgProcessStartFailed(m_command, process.errorString()));
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ QVERIFY(QFileInfo::exists(generatedFile));
+
+ // Test Python code generation by compiling the file
+ QStringList compileArguments{QLatin1String("-m"), QLatin1String("py_compile"), generatedFile};
+ process.start(m_python, compileArguments);
+ QVERIFY2(process.waitForStarted(), msgProcessStartFailed(m_command, process.errorString()));
+ QVERIFY(process.waitForFinished());
+ const bool compiled = process.exitStatus() == QProcess::NormalExit
+ && process.exitCode() == 0;
+ QVERIFY2(compiled, msgCompilePythonFailed(process.readAllStandardError()).constData());
+}
+
QTEST_MAIN(tst_uic)
#include "tst_uic.moc"
diff --git a/tests/auto/widgets/dialogs/qdialog/BLACKLIST b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
index dd6a8bfff9..72e3dff6dd 100644
--- a/tests/auto/widgets/dialogs/qdialog/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
@@ -1,4 +1,4 @@
[snapToDefaultButton]
-osx
+osx-10.14
[showFullScreen]
osx-10.13 ci
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index c840dabc1a..a494d7119a 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -52,7 +52,9 @@ class DummyDialog : public QDialog
{
public:
DummyDialog(): QDialog() {}
+#if QT_DEPRECATED_SINCE(5, 13)
using QDialog::showExtension;
+#endif
};
class tst_QDialog : public QObject
@@ -64,8 +66,10 @@ public:
private slots:
void cleanup();
void getSetCheck();
+#if QT_DEPRECATED_SINCE(5, 13)
void showExtension_data();
void showExtension();
+#endif
void defaultButtons();
void showMaximized();
void showMinimized();
@@ -76,6 +80,9 @@ private slots:
void deleteInExec();
#if QT_CONFIG(sizegrip)
void showSizeGrip();
+#if QT_DEPRECATED_SINCE(5, 13)
+ void showSizeGrip_deprecated();
+#endif
#endif
void setVisible();
void reject();
@@ -89,6 +96,7 @@ private slots:
void tst_QDialog::getSetCheck()
{
QDialog obj1;
+#if QT_DEPRECATED_SINCE(5, 13)
// QWidget* QDialog::extension()
// void QDialog::setExtension(QWidget*)
QWidget *var1 = new QWidget;
@@ -97,6 +105,7 @@ void tst_QDialog::getSetCheck()
obj1.setExtension((QWidget *)0);
QCOMPARE((QWidget *)0, obj1.extension());
// No delete var1, since setExtension takes ownership
+#endif
// int QDialog::result()
// void QDialog::setResult(int)
@@ -146,6 +155,7 @@ void tst_QDialog::cleanup()
QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
+#if QT_DEPRECATED_SINCE(5, 13)
void tst_QDialog::showExtension_data()
{
QTest::addColumn<QSize>("dlgSize");
@@ -197,6 +207,7 @@ void tst_QDialog::showExtension()
testWidget.setExtension( 0 );
}
+#endif
void tst_QDialog::defaultButtons()
{
@@ -422,9 +433,37 @@ void tst_QDialog::deleteInExec()
}
#if QT_CONFIG(sizegrip)
+
// From Task 124269
void tst_QDialog::showSizeGrip()
{
+ QDialog dialog(nullptr);
+ dialog.show();
+ QWidget *ext = new QWidget(&dialog);
+ QVERIFY(!dialog.isSizeGripEnabled());
+
+ dialog.setSizeGripEnabled(true);
+ QPointer<QSizeGrip> sizeGrip = dialog.findChild<QSizeGrip *>();
+ QVERIFY(sizeGrip);
+ QVERIFY(sizeGrip->isVisible());
+ QVERIFY(dialog.isSizeGripEnabled());
+
+ dialog.setSizeGripEnabled(false);
+ QVERIFY(!dialog.isSizeGripEnabled());
+
+ dialog.setSizeGripEnabled(true);
+ sizeGrip = dialog.findChild<QSizeGrip *>();
+ QVERIFY(sizeGrip);
+ QVERIFY(sizeGrip->isVisible());
+ sizeGrip->hide();
+ dialog.hide();
+ dialog.show();
+ QVERIFY(!sizeGrip->isVisible());
+}
+
+#if QT_DEPRECATED_SINCE(5, 13)
+void tst_QDialog::showSizeGrip_deprecated()
+{
QDialog dialog(0);
dialog.show();
QWidget *ext = new QWidget(&dialog);
@@ -476,7 +515,9 @@ void tst_QDialog::showSizeGrip()
dialog.show();
QVERIFY(!sizeGrip->isVisible());
}
-#endif
+#endif // QT_DEPRECATED_SINCE(5, 13)
+
+#endif // QT_CONFIG(sizegrip)
void tst_QDialog::setVisible()
{
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 748c8aaa84..2131e45f29 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -800,7 +800,10 @@ void tst_QFiledialog::isReadOnly()
QAction* renameAction = fd.findChild<QAction*>("qt_rename_action");
QAction* deleteAction = fd.findChild<QAction*>("qt_delete_action");
+#if QT_DEPRECATED_SINCE(5, 13)
QCOMPARE(fd.isReadOnly(), false);
+#endif
+ QCOMPARE(fd.testOption(QFileDialog::ReadOnly), false);
// This is dependent upon the file/dir, find cross platform way to test
//fd.setDirectory(QDir::home());
@@ -1421,6 +1424,16 @@ void tst_QFiledialog::clearLineEdit()
QTRY_VERIFY(fd.directory().absolutePath() != workDirPath);
QVERIFY(lineEdit->text().isEmpty());
+
+ // QTBUG-71415: When pressing back, the selection (activated
+ // directory) should be restored.
+ QToolButton *backButton = fd.findChild<QToolButton*>("backButton");
+ QVERIFY(backButton);
+ QTreeView *treeView = fd.findChildren<QTreeView*>("treeView").value(0);
+ QVERIFY(treeView);
+ backButton->click();
+ QTRY_COMPARE(treeView->selectionModel()->selectedIndexes().value(0).data().toString(),
+ dirName);
}
void tst_QFiledialog::enableChooseButton()
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST b/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST
index e0887d8ad1..875855b59e 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST
@@ -1,2 +1,4 @@
[QTBUG4419_lineEditSelectAll]
-osx
+osx-10.12
+osx-10.14
+osx-10.13
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index 869418371c..40eff1e4c3 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -378,24 +378,24 @@ void tst_QFileDialog2::task143519_deleteAndRenameActionBehavior()
// defaults
QVERIFY(openContextMenu(fd));
QCOMPARE(fd.selectedFiles(), QStringList(ctx.file.fileName()));
- QCOMPARE(rm->isEnabled(), !fd.isReadOnly());
- QCOMPARE(mv->isEnabled(), !fd.isReadOnly());
+ QCOMPARE(rm->isEnabled(), !fd.testOption(QFileDialog::ReadOnly));
+ QCOMPARE(mv->isEnabled(), !fd.testOption(QFileDialog::ReadOnly));
// change to non-defaults:
- fd.setReadOnly(!fd.isReadOnly());
+ fd.setOption(QFileDialog::ReadOnly, !fd.testOption(QFileDialog::ReadOnly));
QVERIFY(openContextMenu(fd));
QCOMPARE(fd.selectedFiles().size(), 1);
- QCOMPARE(rm->isEnabled(), !fd.isReadOnly());
- QCOMPARE(mv->isEnabled(), !fd.isReadOnly());
+ QCOMPARE(rm->isEnabled(), !fd.testOption(QFileDialog::ReadOnly));
+ QCOMPARE(mv->isEnabled(), !fd.testOption(QFileDialog::ReadOnly));
// and changed back to defaults:
- fd.setReadOnly(!fd.isReadOnly());
+ fd.setOption(QFileDialog::ReadOnly, !fd.testOption(QFileDialog::ReadOnly));
QVERIFY(openContextMenu(fd));
QCOMPARE(fd.selectedFiles().size(), 1);
- QCOMPARE(rm->isEnabled(), !fd.isReadOnly());
- QCOMPARE(mv->isEnabled(), !fd.isReadOnly());
+ QCOMPARE(rm->isEnabled(), !fd.testOption(QFileDialog::ReadOnly));
+ QCOMPARE(mv->isEnabled(), !fd.testOption(QFileDialog::ReadOnly));
}
#endif // !QT_NO_CONTEXTMENU && !QT_NO_MENU
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST b/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST
index f78d23c6b1..aae2cacc3b 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST
@@ -1,13 +1,16 @@
winrt
+[sort]
+winrt
[sort:QFileDialog usage]
ubuntu
b2qt
[specialFiles]
-ubuntu
b2qt
[dirsBeforeFiles]
-ubuntu
+winrt
b2qt
-windows
+ubuntu
+windows-10
rhel
-suse-leap
+[drives]
+winrt
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 665a116a3a..590b3502f1 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -65,18 +65,18 @@
} \
} while(0)
-class tst_QFileSystemModel : public QObject {
- Q_OBJECT
+Q_DECLARE_METATYPE(QDir::Filters)
+Q_DECLARE_METATYPE(QFileDevice::Permissions)
-public:
- tst_QFileSystemModel();
+Q_LOGGING_CATEGORY(lcFileSystemModel, "qt.widgets.tests.qfilesystemmodel")
-public Q_SLOTS:
- void init();
- void cleanup();
+class tst_QFileSystemModel : public QObject {
+ Q_OBJECT
private slots:
void initTestCase();
+ void cleanup();
+
void indexPath();
void rootPath();
@@ -128,48 +128,33 @@ private slots:
void fileInfo();
protected:
- bool createFiles(const QString &test_path, const QStringList &initial_files, int existingFileCount = 0, const QStringList &intial_dirs = QStringList());
- QModelIndex prepareTestModelRoot(const QString &test_path, QSignalSpy **spy2 = nullptr,
- QSignalSpy **spy3 = nullptr);
+ bool createFiles(QFileSystemModel *model, const QString &test_path,
+ const QStringList &initial_files, int existingFileCount = 0,
+ const QStringList &initial_dirs = QStringList());
+ QModelIndex prepareTestModelRoot(QFileSystemModel *model, const QString &test_path,
+ QSignalSpy **spy2 = nullptr, QSignalSpy **spy3 = nullptr);
private:
- QFileSystemModel *model;
QString flatDirTestPath;
QTemporaryDir m_tempDir;
};
-tst_QFileSystemModel::tst_QFileSystemModel() : model(0)
-{
-}
-
-void tst_QFileSystemModel::init()
-{
- cleanup();
- QCOMPARE(model, nullptr);
- model = new QFileSystemModel;
-}
-
void tst_QFileSystemModel::cleanup()
{
- delete model;
- model = 0;
- QString tmp = flatDirTestPath;
- QDir dir(tmp);
- if (dir.exists(tmp)) {
- QStringList list = dir.entryList(QDir::AllEntries | QDir::System | QDir::Hidden | QDir::NoDotAndDotDot);
- for (int i = 0; i < list.count(); ++i) {
- QFileInfo fi(dir.path() + '/' + list.at(i));
- if (fi.exists() && fi.isFile()) {
- QFile p(fi.absoluteFilePath());
- p.setPermissions(QFile::ReadUser | QFile::ReadOwner | QFile::ExeOwner | QFile::ExeUser | QFile::WriteUser | QFile::WriteOwner | QFile::WriteOther);
- QFile dead(dir.path() + '/' + list.at(i));
- dead.remove();
+ QDir dir(flatDirTestPath);
+ if (dir.exists()) {
+ const QDir::Filters filters = QDir::AllEntries | QDir::System | QDir::Hidden | QDir::NoDotAndDotDot;
+ const QFileInfoList list = dir.entryInfoList(filters);
+ for (const QFileInfo &fi : list) {
+ if (fi.isDir()) {
+ QVERIFY(dir.rmdir(fi.fileName()));
+ } else {
+ QFile dead(fi.absoluteFilePath());
+ dead.setPermissions(QFile::ReadUser | QFile::ReadOwner | QFile::ExeOwner | QFile::ExeUser | QFile::WriteUser | QFile::WriteOwner | QFile::WriteOther);
+ QVERIFY(dead.remove());
}
- if (fi.exists() && fi.isDir())
- QVERIFY(dir.rmdir(list.at(i)));
}
- list = dir.entryList(QDir::AllEntries | QDir::System | QDir::Hidden | QDir::NoDotAndDotDot);
- QCOMPARE(list.count(), 0);
+ QVERIFY(dir.entryInfoList(filters).isEmpty());
}
}
@@ -182,6 +167,7 @@ void tst_QFileSystemModel::initTestCase()
void tst_QFileSystemModel::indexPath()
{
#if !defined(Q_OS_WIN)
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
int depth = QDir::currentPath().count('/');
model->setRootPath(QDir::currentPath());
QString backPath;
@@ -195,9 +181,10 @@ void tst_QFileSystemModel::indexPath()
void tst_QFileSystemModel::rootPath()
{
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QCOMPARE(model->rootPath(), QString(QDir().path()));
- QSignalSpy rootChanged(model, SIGNAL(rootPathChanged(QString)));
+ QSignalSpy rootChanged(model.data(), &QFileSystemModel::rootPathChanged);
QModelIndex root = model->setRootPath(model->rootPath());
root = model->setRootPath("this directory shouldn't exist");
QCOMPARE(rootChanged.count(), 0);
@@ -243,6 +230,7 @@ void tst_QFileSystemModel::rootPath()
void tst_QFileSystemModel::readOnly()
{
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QCOMPARE(model->isReadOnly(), true);
QTemporaryFile file(flatDirTestPath + QStringLiteral("/XXXXXX.dat"));
QVERIFY2(file.open(), qPrintable(file.errorString()));
@@ -263,19 +251,21 @@ void tst_QFileSystemModel::readOnly()
class CustomFileIconProvider : public QFileIconProvider
{
public:
- CustomFileIconProvider() : QFileIconProvider() {
- mb = qApp->style()->standardIcon(QStyle::SP_MessageBoxCritical);
- dvd = qApp->style()->standardIcon(QStyle::SP_DriveDVDIcon);
+ CustomFileIconProvider() : QFileIconProvider()
+ {
+ auto style = QApplication::style();
+ mb = style->standardIcon(QStyle::SP_MessageBoxCritical);
+ dvd = style->standardIcon(QStyle::SP_DriveDVDIcon);
}
- virtual QIcon icon(const QFileInfo &info) const
+ QIcon icon(const QFileInfo &info) const override
{
if (info.isDir())
return mb;
return QFileIconProvider::icon(info);
}
- virtual QIcon icon(IconType type) const
+ QIcon icon(IconType type) const override
{
if (type == QFileIconProvider::Folder)
return dvd;
@@ -289,69 +279,67 @@ private:
void tst_QFileSystemModel::iconProvider()
{
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QVERIFY(model->iconProvider());
- QFileIconProvider *p = new QFileIconProvider();
- model->setIconProvider(p);
- QCOMPARE(model->iconProvider(), p);
- model->setIconProvider(0);
- delete p;
+ QScopedPointer<QFileIconProvider> provider(new QFileIconProvider);
+ model->setIconProvider(provider.data());
+ QCOMPARE(model->iconProvider(), provider.data());
+ model->setIconProvider(nullptr);
+ provider.reset();
- QFileSystemModel *myModel = new QFileSystemModel();
+ QScopedPointer<QFileSystemModel> myModel(new QFileSystemModel);
const QStringList documentPaths = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
QVERIFY(!documentPaths.isEmpty());
- const QString documentPath = documentPaths.front();
- myModel->setRootPath(documentPath);
+ myModel->setRootPath(documentPaths.constFirst());
//We change the provider, icons must be updated
- CustomFileIconProvider *custom = new CustomFileIconProvider();
- myModel->setIconProvider(custom);
+ provider.reset(new CustomFileIconProvider);
+ myModel->setIconProvider(provider.data());
- QPixmap mb = qApp->style()->standardIcon(QStyle::SP_MessageBoxCritical).pixmap(50, 50);
+ QPixmap mb = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical).pixmap(50, 50);
QCOMPARE(myModel->fileIcon(myModel->index(QDir::homePath())).pixmap(50, 50), mb);
- delete myModel;
- delete custom;
}
-bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringList &initial_files, int existingFileCount, const QStringList &initial_dirs)
+bool tst_QFileSystemModel::createFiles(QFileSystemModel *model, const QString &test_path,
+ const QStringList &initial_files, int existingFileCount,
+ const QStringList &initial_dirs)
{
- //qDebug() << (model->rowCount(model->index(test_path))) << existingFileCount << initial_files;
+ qCDebug(lcFileSystemModel) << (model->rowCount(model->index(test_path))) << existingFileCount << initial_files;
bool timedOut = false;
TRY_WAIT((model->rowCount(model->index(test_path)) == existingFileCount), &timedOut);
if (timedOut)
return false;
- for (int i = 0; i < initial_dirs.count(); ++i) {
- QDir dir(test_path);
- if (!dir.exists()) {
- qWarning() << "error" << test_path << "doesn't exists";
- return false;
- }
- if(!dir.mkdir(initial_dirs.at(i))) {
- qWarning() << "error" << "failed to make" << initial_dirs.at(i);
+ QDir dir(test_path);
+ if (!dir.exists()) {
+ qWarning() << "error" << test_path << "doesn't exist";
+ return false;
+ }
+ for (const auto &initial_dir : initial_dirs) {
+ if (!dir.mkdir(initial_dir)) {
+ qWarning() << "error" << "failed to make" << initial_dir;
return false;
}
- //qDebug() << test_path + '/' + initial_dirs.at(i) << (QFile::exists(test_path + '/' + initial_dirs.at(i)));
+ qCDebug(lcFileSystemModel) << test_path + '/' + initial_dir << (QFile::exists(test_path + '/' + initial_dir));
}
- for (int i = 0; i < initial_files.count(); ++i) {
- QFile file(test_path + '/' + initial_files.at(i));
+ for (const auto &initial_file : initial_files) {
+ QFile file(test_path + '/' + initial_file);
if (!file.open(QIODevice::WriteOnly | QIODevice::Append)) {
- qDebug() << "failed to open file" << initial_files.at(i);
+ qDebug() << "failed to open file" << initial_file;
return false;
}
if (!file.resize(1024 + file.size())) {
- qDebug() << "failed to resize file" << initial_files.at(i);
+ qDebug() << "failed to resize file" << initial_file;
return false;
}
if (!file.flush()) {
- qDebug() << "failed to flush file" << initial_files.at(i);
+ qDebug() << "failed to flush file" << initial_file;
return false;
}
file.close();
#if defined(Q_OS_WIN)
- if (initial_files.at(i)[0] == '.') {
- QString hiddenFile = QDir::toNativeSeparators(file.fileName());
- wchar_t nativeHiddenFile[MAX_PATH];
- memset(nativeHiddenFile, 0, sizeof(nativeHiddenFile));
- hiddenFile.toWCharArray(nativeHiddenFile);
+ if (initial_file[0] == '.') {
+ const QString hiddenFile = QDir::toNativeSeparators(file.fileName());
+ const auto nativeHiddenFile = reinterpret_cast<const wchar_t *>(hiddenFile.utf16());
#ifndef Q_OS_WINRT
DWORD currentAttributes = ::GetFileAttributes(nativeHiddenFile);
#else // !Q_OS_WINRT
@@ -370,13 +358,13 @@ bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringLi
}
}
#endif
- //qDebug() << test_path + '/' + initial_files.at(i) << (QFile::exists(test_path + '/' + initial_files.at(i)));
+ qCDebug(lcFileSystemModel) << test_path + '/' + initial_file << (QFile::exists(test_path + '/' + initial_file));
}
return true;
}
-QModelIndex tst_QFileSystemModel::prepareTestModelRoot(const QString &test_path, QSignalSpy **spy2,
- QSignalSpy **spy3)
+QModelIndex tst_QFileSystemModel::prepareTestModelRoot(QFileSystemModel *model, const QString &test_path,
+ QSignalSpy **spy2, QSignalSpy **spy3)
{
if (model->rowCount(model->index(test_path)) != 0)
return QModelIndex();
@@ -387,9 +375,8 @@ QModelIndex tst_QFileSystemModel::prepareTestModelRoot(const QString &test_path,
*spy3 = new QSignalSpy(model, &QFileSystemModel::rowsAboutToBeInserted);
QStringList files = { "b", "d", "f", "h", "j", ".a", ".c", ".e", ".g" };
- QString l = "b,d,f,h,j,.a,.c,.e,.g";
- if (!createFiles(test_path, files))
+ if (!createFiles(model, test_path, files))
return QModelIndex();
QModelIndex root = model->setRootPath(test_path);
@@ -406,10 +393,10 @@ QModelIndex tst_QFileSystemModel::prepareTestModelRoot(const QString &test_path,
void tst_QFileSystemModel::rowCount()
{
- const QString tmp = flatDirTestPath;
QSignalSpy *spy2 = nullptr;
QSignalSpy *spy3 = nullptr;
- QModelIndex root = prepareTestModelRoot(flatDirTestPath, &spy2, &spy3);
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QModelIndex root = prepareTestModelRoot(model.data(), flatDirTestPath, &spy2, &spy3);
QVERIFY(root.isValid());
QVERIFY(spy2 && spy2->count() > 0);
@@ -419,11 +406,11 @@ void tst_QFileSystemModel::rowCount()
void tst_QFileSystemModel::rowsInserted_data()
{
QTest::addColumn<int>("count");
- QTest::addColumn<int>("ascending");
+ QTest::addColumn<Qt::SortOrder>("ascending");
for (int i = 0; i < 4; ++i) {
const QByteArray iB = QByteArray::number(i);
- QTest::newRow(("Qt::AscendingOrder " + iB).constData()) << i << (int)Qt::AscendingOrder;
- QTest::newRow(("Qt::DescendingOrder " + iB).constData()) << i << (int)Qt::DescendingOrder;
+ QTest::newRow(("Qt::AscendingOrder " + iB).constData()) << i << Qt::AscendingOrder;
+ QTest::newRow(("Qt::DescendingOrder " + iB).constData()) << i << Qt::DescendingOrder;
}
}
@@ -436,20 +423,21 @@ static inline QString lastEntry(const QModelIndex &root)
void tst_QFileSystemModel::rowsInserted()
{
const QString tmp = flatDirTestPath;
- QModelIndex root = prepareTestModelRoot(tmp);
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QModelIndex root = prepareTestModelRoot(model.data(), tmp);
QVERIFY(root.isValid());
- QFETCH(int, ascending);
+ QFETCH(Qt::SortOrder, ascending);
QFETCH(int, count);
- model->sort(0, (Qt::SortOrder)ascending);
+ model->sort(0, ascending);
- QSignalSpy spy0(model, SIGNAL(rowsInserted(QModelIndex,int,int)));
- QSignalSpy spy1(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
+ QSignalSpy spy0(model.data(), &QAbstractItemModel::rowsInserted);
+ QSignalSpy spy1(model.data(), &QAbstractItemModel::rowsAboutToBeInserted);
int oldCount = model->rowCount(root);
QStringList files;
for (int i = 0; i < count; ++i)
files.append(QLatin1Char('c') + QString::number(i));
- QVERIFY(createFiles(tmp, files, 5));
+ QVERIFY(createFiles(model.data(), tmp, files, 5));
QTRY_COMPARE(model->rowCount(root), oldCount + count);
int totalRowsInserted = 0;
for (int i = 0; i < spy0.count(); ++i) {
@@ -469,7 +457,7 @@ void tst_QFileSystemModel::rowsInserted()
}
if (count == 0) QCOMPARE(spy1.count(), 0); else QVERIFY(spy1.count() >= 1);
- QVERIFY(createFiles(tmp, QStringList(".hidden_file"), 5 + count));
+ QVERIFY(createFiles(model.data(), tmp, QStringList(".hidden_file"), 5 + count));
if (count != 0)
QTRY_VERIFY(spy0.count() >= 1);
@@ -489,19 +477,21 @@ void tst_QFileSystemModel::rowsRemoved_data()
void tst_QFileSystemModel::rowsRemoved()
{
const QString tmp = flatDirTestPath;
- QModelIndex root = prepareTestModelRoot(tmp);
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QModelIndex root = prepareTestModelRoot(model.data(), tmp);
QVERIFY(root.isValid());
QFETCH(int, count);
- QFETCH(int, ascending);
- model->sort(0, (Qt::SortOrder)ascending);
+ QFETCH(Qt::SortOrder, ascending);
+ model->sort(0, ascending);
- QSignalSpy spy0(model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
- QSignalSpy spy1(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy spy0(model.data(), &QAbstractItemModel::rowsRemoved);
+ QSignalSpy spy1(model.data(), &QAbstractItemModel::rowsAboutToBeRemoved);
int oldCount = model->rowCount(root);
for (int i = count - 1; i >= 0; --i) {
- //qDebug() << "removing" << model->index(i, 0, root).data().toString();
- QVERIFY(QFile::remove(tmp + '/' + model->index(i, 0, root).data().toString()));
+ const QString fileName = model->index(i, 0, root).data().toString();
+ qCDebug(lcFileSystemModel) << "removing" << fileName;
+ QVERIFY(QFile::remove(tmp + QLatin1Char('/') + fileName));
}
for (int i = 0 ; i < 10; ++i) {
if (count != 0) {
@@ -520,18 +510,23 @@ void tst_QFileSystemModel::rowsRemoved()
lst.append(model->index(i, 0, root).data().toString());
if (model->rowCount(root) == oldCount - count)
break;
- qDebug() << "still have:" << lst << QFile::exists(tmp + '/' + QString(".a"));
+ qCDebug(lcFileSystemModel) << "still have:" << lst << QFile::exists(tmp + QLatin1String("/.a"));
QDir tmpLister(tmp);
- qDebug() << tmpLister.entryList();
+ qCDebug(lcFileSystemModel) << tmpLister.entryList();
}
QTRY_COMPARE(model->rowCount(root), oldCount - count);
- QVERIFY(QFile::exists(tmp + '/' + QString(".a")));
- QVERIFY(QFile::remove(tmp + '/' + QString(".a")));
- QVERIFY(QFile::remove(tmp + '/' + QString(".c")));
+ QVERIFY(QFile::exists(tmp + QLatin1String("/.a")));
+ QVERIFY(QFile::remove(tmp + QLatin1String("/.a")));
+ QVERIFY(QFile::remove(tmp + QLatin1String("/.c")));
- if (count != 0) QVERIFY(spy0.count() >= 1); else QCOMPARE(spy0.count(), 0);
- if (count != 0) QVERIFY(spy1.count() >= 1); else QCOMPARE(spy1.count(), 0);
+ if (count != 0) {
+ QVERIFY(spy0.count() >= 1);
+ QVERIFY(spy1.count() >= 1);
+ } else {
+ QCOMPARE(spy0.count(), 0);
+ QCOMPARE(spy1.count(), 0);
+ }
}
void tst_QFileSystemModel::dataChanged_data()
@@ -544,18 +539,19 @@ void tst_QFileSystemModel::dataChanged()
QSKIP("This can't be tested right now since we don't watch files, only directories.");
const QString tmp = flatDirTestPath;
- QModelIndex root = prepareTestModelRoot(tmp);
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QModelIndex root = prepareTestModelRoot(model.data(), tmp);
QVERIFY(root.isValid());
QFETCH(int, count);
- QFETCH(int, assending);
- model->sort(0, (Qt::SortOrder)assending);
+ QFETCH(Qt::SortOrder, ascending);
+ model->sort(0, ascending);
- QSignalSpy spy(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
+ QSignalSpy spy(model.data(), &QAbstractItemModel::dataChanged);
QStringList files;
for (int i = 0; i < count; ++i)
files.append(model->index(i, 0, root).data().toString());
- createFiles(tmp, files);
+ createFiles(model.data(), tmp, files);
QTest::qWait(WAITTIME);
@@ -566,64 +562,68 @@ void tst_QFileSystemModel::filters_data()
{
QTest::addColumn<QStringList>("files");
QTest::addColumn<QStringList>("dirs");
- QTest::addColumn<int>("dirFilters");
+ QTest::addColumn<QDir::Filters>("dirFilters");
QTest::addColumn<QStringList>("nameFilters");
QTest::addColumn<int>("rowCount");
- QTest::newRow("no dirs") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs) << QStringList() << 2;
- QTest::newRow("no dirs - dot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 1;
- QTest::newRow("no dirs - dotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
- QTest::newRow("no dirs - dotanddotdot") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 0;
- QTest::newRow("one dir - dot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDot) << QStringList() << 2;
- QTest::newRow("one dir - dotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotDot) << QStringList() << 2;
- QTest::newRow("one dir - dotanddotdot") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1;
- QTest::newRow("one dir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") << (int)(QDir::Dirs) << QStringList() << 3;
- QTest::newRow("no dir + hidden") << (QStringList() << "a" << "b" << "c") << QStringList() << (int)(QDir::Dirs | QDir::Hidden) << QStringList() << 2;
- QTest::newRow("dir+hid+files") << (QStringList() << "a" << "b" << "c") << QStringList() <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden) << QStringList() << 5;
- QTest::newRow("dir+file+hid-dot .A") << (QStringList() << "a" << "b" << "c") << (QStringList() << ".A") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList() << 4;
- QTest::newRow("dir+files+hid+dot A") << (QStringList() << "a" << "b" << "c") << (QStringList() << "AFolder") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << (QStringList() << "A*") << 2;
- QTest::newRow("dir+files+hid+dot+cas1") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "Z") << 1;
- QTest::newRow("dir+files+hid+dot+cas2") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << (QStringList() << "a") << 1;
- QTest::newRow("dir+files+hid+dot+cas+alldir") << (QStringList() << "a" << "b" << "c") << (QStringList() << "Z") <<
- (int)(QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive | QDir::AllDirs) << (QStringList() << "Z") << 1;
-
- QTest::newRow("case sensitive") << (QStringList() << "Antiguagdb" << "Antiguamtd"
- << "Antiguamtp" << "afghanistangdb" << "afghanistanmtd")
- << QStringList() << (int)(QDir::Files) << QStringList() << 5;
+
+ const QStringList abcList{QLatin1String("a"), QLatin1String("b"), QLatin1String("c")};
+ const QStringList zList{QLatin1String("Z")};
+
+ QTest::newRow("no dirs") << abcList << QStringList() << QDir::Filters(QDir::Dirs) << QStringList() << 2;
+ QTest::newRow("no dirs - dot") << abcList << QStringList() << (QDir::Dirs | QDir::NoDot) << QStringList() << 1;
+ QTest::newRow("no dirs - dotdot") << abcList << QStringList() << (QDir::Dirs | QDir::NoDotDot) << QStringList() << 1;
+ QTest::newRow("no dirs - dotanddotdot") << abcList << QStringList() << (QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 0;
+ QTest::newRow("one dir - dot") << abcList << zList << (QDir::Dirs | QDir::NoDot) << QStringList() << 2;
+ QTest::newRow("one dir - dotdot") << abcList << zList << (QDir::Dirs | QDir::NoDotDot) << QStringList() << 2;
+ QTest::newRow("one dir - dotanddotdot") << abcList << zList << (QDir::Dirs | QDir::NoDotAndDotDot) << QStringList() << 1;
+ QTest::newRow("one dir") << abcList << zList << QDir::Filters(QDir::Dirs) << QStringList() << 3;
+ QTest::newRow("no dir + hidden") << abcList << QStringList() << (QDir::Dirs | QDir::Hidden) << QStringList() << 2;
+ QTest::newRow("dir+hid+files") << abcList << QStringList() <<
+ (QDir::Dirs | QDir::Files | QDir::Hidden) << QStringList() << 5;
+ QTest::newRow("dir+file+hid-dot .A") << abcList << QStringList{QLatin1String(".A")} <<
+ (QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList() << 4;
+ QTest::newRow("dir+files+hid+dot A") << abcList << QStringList{QLatin1String("AFolder")} <<
+ (QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot) << QStringList{QLatin1String("A*")} << 2;
+ QTest::newRow("dir+files+hid+dot+cas1") << abcList << zList <<
+ (QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << zList << 1;
+ QTest::newRow("dir+files+hid+dot+cas2") << abcList << zList <<
+ (QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive) << QStringList{QLatin1String("a")} << 1;
+ QTest::newRow("dir+files+hid+dot+cas+alldir") << abcList << zList <<
+ (QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoDotAndDotDot | QDir::CaseSensitive | QDir::AllDirs) << zList << 1;
+
+ QTest::newRow("case sensitive") << QStringList{QLatin1String("Antiguagdb"), QLatin1String("Antiguamtd"),
+ QLatin1String("Antiguamtp"), QLatin1String("afghanistangdb"), QLatin1String("afghanistanmtd")}
+ << QStringList() << QDir::Filters(QDir::Files) << QStringList() << 5;
}
void tst_QFileSystemModel::filters()
{
QString tmp = flatDirTestPath;
- QVERIFY(createFiles(tmp, QStringList()));
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QVERIFY(createFiles(model.data(), tmp, QStringList()));
QModelIndex root = model->setRootPath(tmp);
QFETCH(QStringList, files);
QFETCH(QStringList, dirs);
- QFETCH(int, dirFilters);
+ QFETCH(QDir::Filters, dirFilters);
QFETCH(QStringList, nameFilters);
QFETCH(int, rowCount);
if (nameFilters.count() > 0)
model->setNameFilters(nameFilters);
model->setNameFilterDisables(false);
- model->setFilter((QDir::Filters)dirFilters);
+ model->setFilter(dirFilters);
- QVERIFY(createFiles(tmp, files, 0, dirs));
+ QVERIFY(createFiles(model.data(), tmp, files, 0, dirs));
QTRY_COMPARE(model->rowCount(root), rowCount);
// Make sure that we do what QDir does
QDir xFactor(tmp);
- QDir::Filters filters = (QDir::Filters)dirFilters;
QStringList dirEntries;
if (nameFilters.count() > 0)
- dirEntries = xFactor.entryList(nameFilters, filters);
+ dirEntries = xFactor.entryList(nameFilters, dirFilters);
else
- dirEntries = xFactor.entryList(filters);
+ dirEntries = xFactor.entryList(dirFilters);
QCOMPARE(dirEntries.count(), rowCount);
@@ -667,12 +667,13 @@ void tst_QFileSystemModel::nameFilters()
{
QStringList list;
list << "a" << "b" << "c";
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
model->setNameFilters(list);
model->setNameFilterDisables(false);
QCOMPARE(model->nameFilters(), list);
QString tmp = flatDirTestPath;
- QVERIFY(createFiles(tmp, list));
+ QVERIFY(createFiles(model.data(), tmp, list));
QModelIndex root = model->setRootPath(tmp);
QTRY_COMPARE(model->rowCount(root), 3);
@@ -693,15 +694,17 @@ void tst_QFileSystemModel::setData_data()
<< QDir::temp().absolutePath() + '/' + "a"
<< false;
*/
+
+ const QStringList abcList{QLatin1String("a"), QLatin1String("b"), QLatin1String("c")};
QTest::newRow("in current dir")
<< QString()
- << (QStringList() << "a" << "b" << "c")
+ << abcList
<< "a"
<< "d"
<< true;
QTest::newRow("in subdir")
<< "s"
- << (QStringList() << "a" << "b" << "c")
+ << abcList
<< "a"
<< "d"
<< true;
@@ -709,7 +712,8 @@ void tst_QFileSystemModel::setData_data()
void tst_QFileSystemModel::setData()
{
- QSignalSpy spy(model, SIGNAL(fileRenamed(QString,QString,QString)));
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QSignalSpy spy(model.data(), &QFileSystemModel::fileRenamed);
QFETCH(QString, subdirName);
QFETCH(QStringList, files);
QFETCH(QString, oldFileName);
@@ -722,7 +726,7 @@ void tst_QFileSystemModel::setData()
QVERIFY(dir.mkdir(subdirName));
tmp.append('/' + subdirName);
}
- QVERIFY(createFiles(tmp, files));
+ QVERIFY(createFiles(model.data(), tmp, files));
QModelIndex tmpIdx = model->setRootPath(flatDirTestPath);
if (!subdirName.isEmpty()) {
tmpIdx = model->index(tmp);
@@ -760,6 +764,7 @@ void tst_QFileSystemModel::sortPersistentIndex()
const QFileInfo fileInfo(file.fileName());
file.close();
QTRY_VERIFY(QDir(flatDirTestPath).entryInfoList().contains(fileInfo));
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QModelIndex root = model->setRootPath(flatDirTestPath);
QTRY_VERIFY(model->rowCount(root) > 0);
@@ -786,8 +791,9 @@ void tst_QFileSystemModel::sort()
{
QFETCH(bool, fileDialogMode);
- MyFriendFileSystemModel *myModel = new MyFriendFileSystemModel();
- QTreeView *tree = new QTreeView();
+ QScopedPointer<MyFriendFileSystemModel> myModel(new MyFriendFileSystemModel);
+ QTreeView tree;
+ tree.setWindowTitle(QTest::currentTestFunction());
if (fileDialogMode && EmulationDetector::isRunningArmOnX86())
QSKIP("Crashes in QEMU. QTBUG-70572");
@@ -816,24 +822,23 @@ void tst_QFileSystemModel::sort()
myModel->setRootPath("");
myModel->setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
- tree->setSortingEnabled(true);
- tree->setModel(myModel);
- tree->show();
- tree->resize(800, 800);
- QVERIFY(QTest::qWaitForWindowActive(tree));
- tree->header()->setSortIndicator(1,Qt::DescendingOrder);
- tree->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+ tree.setSortingEnabled(true);
+ tree.setModel(myModel.data());
+ tree.show();
+ tree.resize(800, 800);
+ QVERIFY(QTest::qWaitForWindowActive(&tree));
+ tree.header()->setSortIndicator(1, Qt::DescendingOrder);
+ tree.header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
QStringList dirsToOpen;
- do
- {
- dirsToOpen<<dir.absolutePath();
+ do {
+ dirsToOpen << dir.absolutePath();
} while (dir.cdUp());
for (int i = dirsToOpen.size() -1 ; i > 0 ; --i) {
QString path = dirsToOpen[i];
- tree->expand(myModel->index(path, 0));
+ tree.expand(myModel->index(path, 0));
}
- tree->expand(myModel->index(dirPath, 0));
+ tree.expand(myModel->index(dirPath, 0));
QModelIndex parent = myModel->index(dirPath, 0);
QList<QString> expectedOrder;
expectedOrder << tempFile2.fileName() << tempFile.fileName() << dirPath + QChar('/') + ".." << dirPath + QChar('/') + ".";
@@ -859,15 +864,13 @@ void tst_QFileSystemModel::sort()
QTRY_COMPARE(dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString(), expectedOrder.at(i));
}
}
-
- delete tree;
- delete myModel;
}
void tst_QFileSystemModel::mkdir()
{
QString tmp = flatDirTestPath;
QString newFolderPath = QDir::toNativeSeparators(tmp + '/' + "NewFoldermkdirtest4");
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QModelIndex tmpDir = model->index(tmp);
QVERIFY(tmpDir.isValid());
QDir bestatic(newFolderPath);
@@ -902,6 +905,7 @@ void tst_QFileSystemModel::deleteFile()
qWarning() << "unable to create" << newFilePath;
}
newFile.close();
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QModelIndex idx = model->index(newFilePath);
QVERIFY(idx.isValid());
QVERIFY(model->remove(idx));
@@ -963,7 +967,8 @@ void tst_QFileSystemModel::caseSensitivity()
QString tmp = flatDirTestPath;
QStringList files;
files << "a" << "c" << "C";
- QVERIFY(createFiles(tmp, files));
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QVERIFY(createFiles(model.data(), tmp, files));
QModelIndex root = model->index(tmp);
QStringList paths;
QModelIndexList indexes;
@@ -1013,26 +1018,25 @@ void tst_QFileSystemModel::dirsBeforeFiles()
const int itemCount = 3;
for (int i = 0; i < itemCount; ++i) {
- QLatin1Char c('a' + i);
- dir.mkdir(c + QLatin1String("-dir"));
+ QLatin1Char c('a' + char(i));
+ QVERIFY(dir.mkdir(c + QLatin1String("-dir")));
QFile file(flatDirTestPath + QLatin1Char('/') + c + QLatin1String("-file"));
- file.open(QIODevice::ReadWrite);
+ QVERIFY(file.open(QIODevice::ReadWrite));
file.close();
}
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
QModelIndex root = model->setRootPath(flatDirTestPath);
// Wait for model to be notified by the file system watcher
QTRY_COMPARE(model->rowCount(root), 2 * itemCount);
- // ensure that no file occurs before a directory
- for (int i = 0; i < model->rowCount(root); ++i) {
+ // Ensure that no file occurs before any directory:
+ for (int i = 1; i < model->rowCount(root); ++i) {
#ifndef Q_OS_MAC
- QVERIFY(i == 0 ||
- !(model->fileInfo(model->index(i - 1, 0, root)).isFile()
+ QVERIFY(!(model->fileInfo(model->index(i - 1, 0, root)).isFile()
&& model->fileInfo(model->index(i, 0, root)).isDir()));
#else
- QVERIFY(i == 0 ||
- model->fileInfo(model->index(i - 1, 0, root)).fileName() <
+ QVERIFY(model->fileInfo(model->index(i - 1, 0, root)).fileName() <
model->fileInfo(model->index(i, 0, root)).fileName());
#endif
}
@@ -1073,7 +1077,7 @@ static inline QByteArray permissionRowName(bool readOnly, int permission)
void tst_QFileSystemModel::permissions_data()
{
- QTest::addColumn<int>("permissions");
+ QTest::addColumn<QFileDevice::Permissions>("permissions");
QTest::addColumn<bool>("readOnly");
static const int permissions[] = {
@@ -1081,22 +1085,23 @@ void tst_QFileSystemModel::permissions_data()
QFile::ReadOwner,
QFile::WriteOwner|QFile::ReadOwner,
};
- for (size_t i = 0; i < sizeof permissions / sizeof *permissions; ++i) {
- QTest::newRow(permissionRowName(false, permissions[i]).constData()) << permissions[i] << false;
- QTest::newRow(permissionRowName(true, permissions[i]).constData()) << permissions[i] << true;
+ for (int permission : permissions) {
+ QTest::newRow(permissionRowName(false, permission).constData()) << QFileDevice::Permissions(permission) << false;
+ QTest::newRow(permissionRowName(true, permission).constData()) << QFileDevice::Permissions(permission) << true;
}
}
void tst_QFileSystemModel::permissions() // checks QTBUG-20503
{
- QFETCH(int, permissions);
+ QFETCH(QFileDevice::Permissions, permissions);
QFETCH(bool, readOnly);
const QString tmp = flatDirTestPath;
const QString file = tmp + QLatin1String("/f");
- QVERIFY(createFiles(tmp, QStringList() << "f"));
+ QScopedPointer<QFileSystemModel> model(new QFileSystemModel);
+ QVERIFY(createFiles(model.data(), tmp, QStringList{QLatin1String("f")}));
- QVERIFY(QFile::setPermissions(file, QFile::Permissions(permissions)));
+ QVERIFY(QFile::setPermissions(file, permissions));
const QModelIndex root = model->setRootPath(tmp);
diff --git a/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST b/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST
index da52809aad..8d8a7c2105 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qmessagebox/BLACKLIST
@@ -1,2 +1,4 @@
[defaultButton]
-*
+opensuse-leap
+rhel-7.6
+ubuntu
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
index 1789f51507..2b784414cd 100644
--- a/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
@@ -1,2 +1,2 @@
[autoShow]
-osx ci
+osx-10.13
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
index 2ada4fedb6..6f527e7b6b 100644
--- a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
+++ b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
@@ -252,7 +252,7 @@ class QTestTranslator : public QTranslator
{
const QString m_str;
public:
- explicit QTestTranslator(QString str) : m_str(qMove(str)) {}
+ explicit QTestTranslator(QString str) : m_str(std::move(str)) {}
QString translate(const char *, const char *sourceText, const char *, int) const override
{ return m_str + sourceText + m_str; }
@@ -265,7 +265,7 @@ class QTranslatorGuard {
Translator t;
public:
template <typename Arg>
- explicit QTranslatorGuard(Arg a) : t(qMove(a))
+ explicit QTranslatorGuard(Arg a) : t(std::move(a))
{ qApp->installTranslator(&t); }
~QTranslatorGuard()
{ qApp->removeTranslator(&t); }
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 24cbd2e35c..6091975acb 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -417,7 +417,7 @@ void tst_QWizard::setPixmap()
QVERIFY(wizard.pixmap(QWizard::BannerPixmap).isNull());
QVERIFY(wizard.pixmap(QWizard::LogoPixmap).isNull());
QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).isNull());
- if (QSysInfo::macVersion() <= Q_MV_OSX(10, 13))
+ if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::MacOSHighSierra)
QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull());
else
QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull());
@@ -425,7 +425,7 @@ void tst_QWizard::setPixmap()
QVERIFY(page->pixmap(QWizard::BannerPixmap).isNull());
QVERIFY(page->pixmap(QWizard::LogoPixmap).isNull());
QVERIFY(page->pixmap(QWizard::WatermarkPixmap).isNull());
- if (QSysInfo::macVersion() <= Q_MV_OSX(10, 13))
+ if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::MacOSHighSierra)
QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull());
else
QVERIFY(page->pixmap(QWizard::BackgroundPixmap).isNull());
diff --git a/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST b/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST
index 4833af527f..64a92d18aa 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST
+++ b/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST
@@ -1,3 +1,2 @@
[prepareGeometryChangeInvalidateCache]
-opensuse
-opensuse-leap
+opensuse-42.3
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
index ae6de48195..16818a98f9 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/qgraphicsitem.pro
@@ -5,4 +5,4 @@ QT += core-private gui-private
SOURCES += tst_qgraphicsitem.cpp
DEFINES += QT_NO_CAST_TO_ASCII
-win32:!winrt: LIBS += -luser32
+win32:!winrt: QMAKE_USE += user32
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 670dc0b808..af0dd9b0f0 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -272,6 +272,9 @@ class tst_QGraphicsItem : public QObject
{
Q_OBJECT
+public:
+ static void initMain();
+
private slots:
void construction();
void constructionWithParent();
@@ -474,6 +477,14 @@ private:
QTouchDevice *m_touchDevice = nullptr;
};
+void tst_QGraphicsItem::initMain()
+{
+#ifdef Q_OS_WIN
+ // Ensure minimum size constraints of framed windows on High DPI screens
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
+}
+
void tst_QGraphicsItem::construction()
{
for (int i = 0; i < 7; ++i) {
@@ -4440,15 +4451,19 @@ protected:
break;
case QGraphicsItem::ItemPositionHasChanged:
break;
+#if QT_DEPRECATED_SINCE(5, 14)
case QGraphicsItem::ItemMatrixChange: {
+#if QT_DEPRECATED_SINCE(5, 13)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QVariant variant;
variant.setValue<QMatrix>(matrix());
oldValues << variant;
QT_WARNING_POP
+#endif
}
break;
+#endif
case QGraphicsItem::ItemTransformChange: {
QVariant variant;
variant.setValue<QTransform>(transform());
@@ -4566,6 +4581,7 @@ void tst_QGraphicsItem::itemChange()
QCOMPARE(tester.oldValues.last(), QVariant(true));
QCOMPARE(tester.isEnabled(), true);
}
+#if QT_DEPRECATED_SINCE(5, 13)
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED // QDesktopWidget::screen()
@@ -4585,6 +4601,7 @@ QT_WARNING_DISABLE_DEPRECATED // QDesktopWidget::screen()
QCOMPARE(tester.matrix(), QMatrix().rotate(90));
QT_WARNING_POP
}
+#endif
{
tester.resetTransform();
++changeCount;
@@ -8397,7 +8414,7 @@ void tst_QGraphicsItem::focusProxy()
QString err;
QTextStream stream(&err);
stream << "QGraphicsItem::setFocusProxy: "
- << (void*)item << " is already in the focus proxy chain" << flush;
+ << (void*)item << " is already in the focus proxy chain" << Qt::flush;
QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData());
item2->setFocusProxy(item); // fails
QCOMPARE(item->focusProxy(), (QGraphicsItem *)item2);
@@ -10960,7 +10977,7 @@ static QList<QTouchEvent::TouchPoint>
tp.setStartScreenPos(screenPos);
tp.setLastScreenPos(screenPos);
tp.setEllipseDiameters(ellipseDiameters);
- const QSizeF screenSize = QApplication::desktop()->screenGeometry(&view).size();
+ const QSizeF screenSize = view.screen()->geometry().size();
tp.setNormalizedPos(QPointF(screenPos.x() / screenSize.width(), screenPos.y() / screenSize.height()));
return QList<QTouchEvent::TouchPoint>() << tp;
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
index dfb2752ee0..ed79904ed8 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
@@ -54,9 +54,9 @@ void tst_QGraphicsItemAnimation::construction()
QCOMPARE(animation.posAt(0), QPointF());
QCOMPARE(animation.posAt(0.5), QPointF());
QCOMPARE(animation.posAt(1), QPointF());
- QCOMPARE(animation.matrixAt(0), QMatrix());
- QCOMPARE(animation.matrixAt(0.5), QMatrix());
- QCOMPARE(animation.matrixAt(1), QMatrix());
+ QCOMPARE(animation.transformAt(0), QTransform());
+ QCOMPARE(animation.transformAt(0.5), QTransform());
+ QCOMPARE(animation.transformAt(1), QTransform());
QCOMPARE(animation.rotationAt(0), qreal(0.0));
QCOMPARE(animation.rotationAt(0.5), qreal(0.0));
QCOMPARE(animation.rotationAt(1), qreal(0.0));
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 4a301337ef..a437b05479 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -330,7 +330,7 @@ public:
{
// Make sure QGraphicsProxyWidget::paint does not modify the render hints set on the painter.
painter->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform
- | QPainter::NonCosmeticDefaultPen | QPainter::TextAntialiasing);
+ | QPainter::TextAntialiasing);
const QPainter::RenderHints oldRenderHints = painter->renderHints();
QGraphicsProxyWidget::paint(painter, option, widget);
QCOMPARE(painter->renderHints(), oldRenderHints);
@@ -463,14 +463,13 @@ void tst_QGraphicsProxyWidget::setWidget()
QCOMPARE(proxy->focusPolicy(), Qt::WheelFocus);
QVERIFY(proxy->acceptDrops());
QCOMPARE(proxy->acceptHoverEvents(), true); // to get widget enter events
- int left, top, right, bottom;
- widget->getContentsMargins(&left, &top, &right, &bottom);
+ const QMarginsF margins = QMarginsF{widget->contentsMargins()};
qreal rleft, rtop, rright, rbottom;
proxy->getContentsMargins(&rleft, &rtop, &rright, &rbottom);
- QCOMPARE((qreal)left, rleft);
- QCOMPARE((qreal)top, rtop);
- QCOMPARE((qreal)right, rright);
- QCOMPARE((qreal)bottom, rbottom);
+ QCOMPARE(margins.left(), rleft);
+ QCOMPARE(margins.top(), rtop);
+ QCOMPARE(margins.right(), rright);
+ QCOMPARE(margins.bottom(), rbottom);
} else {
// proxy shouldn't mess with the widget if it can't insert it.
QCOMPARE(proxy->widget(), nullptr);
@@ -2769,9 +2768,6 @@ void tst_QGraphicsProxyWidget::windowOpacity()
// disabled on platforms without alpha channel support in QPixmap (e.g.,
// X11 without XRender).
int paints = 0;
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- paints = !X11->use_xrender;
-#endif
QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0);
QTRY_COMPARE(eventSpy.counts[QEvent::Paint], paints);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
index b8b427b3dd..c3797c9d57 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
@@ -1,13 +1,5 @@
[isActive]
opensuse-42.3 ci
-[removeFullyTransparentItem]
-osx-10.12
[tabFocus_sceneWithNestedFocusWidgets]
-opensuse
-opensuse-leap
-[inputMethod]
-opensuse
-opensuse-leap
-[hoverEvents_parentChild]
-ubuntu
+opensuse-42.3
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
index 351cecd92e..2f648a2212 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/qgraphicsscene.pro
@@ -4,7 +4,7 @@ QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += tst_qgraphicsscene.cpp
RESOURCES += images.qrc
-win32:!winrt: LIBS += -luser32
+win32:!winrt: QMAKE_USE += user32
DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 4f8741a5aa..4d24814724 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,11 +26,24 @@
**
****************************************************************************/
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QDial>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QGraphicsView>
+#include <QtWidgets/QGraphicsScene>
+#include <QtWidgets/QGraphicsPixmapItem>
+#include <QtWidgets/QStyle>
+#include <QtWidgets/QStyleFactory>
+#include <QtWidgets/QVBoxLayout>
+
+#include <QtGui/QScreen>
#include <QtTest/QtTest>
-#include <QtGui>
-#include <QtWidgets>
+#include <QtCore/QDebug>
+#include <QtCore/QLoggingCategory>
+
#include <private/qgraphicsscene_p.h>
#include <private/qgraphicssceneindex_p.h>
#include <math.h>
@@ -39,7 +52,7 @@
#include <private/qinputmethod_p.h>
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-#include <windows.h>
+#include <QtCore/qt_windows.h>
#define Q_CHECK_PAINTEVENTS \
if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \
QSKIP("The Graphics View doesn't get the paint events");
@@ -51,6 +64,7 @@ Q_DECLARE_METATYPE(Qt::FocusReason)
Q_DECLARE_METATYPE(QPainterPath)
Q_DECLARE_METATYPE(Qt::AspectRatioMode)
Q_DECLARE_METATYPE(Qt::ItemSelectionMode)
+Q_DECLARE_METATYPE(QGraphicsItem::GraphicsItemFlags)
static const int randomX[] = {276, 40, 250, 864, -56, 426, 855, 825, 184, 955, -798, -804, 773,
282, 489, 686, 780, -220, 50, 749, -856, -205, 81, 492, -819, 518,
@@ -95,14 +109,16 @@ static const int randomY[] = {603, 70, -318, 843, 450, -637, 199, -527, 407, 964
-588, 864, 234, 225, -303, 493, 246, 153, 338, -378, 377, -819, 140, 136,
467, -849, -326, -533, 166, 252, -994, -699, 904, -566, 621, -752};
+Q_LOGGING_CATEGORY(lcTests, "qt.widgets.tests")
+
class HoverItem : public QGraphicsRectItem
{
public:
HoverItem()
- : QGraphicsRectItem(QRectF(-10, -10, 20, 20)), isHovered(false)
+ : QGraphicsRectItem(QRectF(-10, -10, 20, 20))
{ setAcceptHoverEvents(true); }
- bool isHovered;
+ bool isHovered = false;
protected:
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
@@ -128,13 +144,13 @@ class EventSpy : public QGraphicsWidget
Q_OBJECT
public:
EventSpy(QObject *watched, QEvent::Type type)
- : _count(0), spied(type)
+ : spied(type)
{
watched->installEventFilter(this);
}
EventSpy(QGraphicsScene *scene, QGraphicsItem *watched, QEvent::Type type)
- : _count(0), spied(type)
+ : spied(type)
{
scene->addItem(this);
watched->installSceneEventFilter(this);
@@ -143,7 +159,7 @@ public:
int count() const { return _count; }
protected:
- bool eventFilter(QObject *watched, QEvent *event)
+ bool eventFilter(QObject *watched, QEvent *event) override
{
Q_UNUSED(watched);
if (event->type() == spied)
@@ -151,7 +167,7 @@ protected:
return false;
}
- bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
+ bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
{
Q_UNUSED(watched);
if (event->type() == spied)
@@ -159,13 +175,17 @@ protected:
return false;
}
- int _count;
- QEvent::Type spied;
+ int _count = 0;
+ const QEvent::Type spied;
};
class tst_QGraphicsScene : public QObject
{
Q_OBJECT
+public:
+ tst_QGraphicsScene();
+ static void initMain() { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); }
+
public slots:
void cleanup();
@@ -268,13 +288,26 @@ private slots:
void taskQTBUG_15977_renderWithDeviceCoordinateCache();
void taskQTBUG_16401_focusItem();
void taskQTBUG_42915_focusNextPrevChild();
+
+private:
+ QRect m_availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
+ QSize m_testSize;
};
+tst_QGraphicsScene::tst_QGraphicsScene()
+{
+ const int testSize = qMax(200, m_availableGeometry.width() / 10);
+ m_testSize.setWidth(testSize);
+ m_testSize.setHeight(testSize);
+}
+
void tst_QGraphicsScene::cleanup()
{
// ensure not even skipped tests with custom input context leave it dangling
- QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
- inputMethodPrivate->testContext = 0;
+ QInputMethodPrivate *inputMethodPrivate =
+ QInputMethodPrivate::get(QGuiApplication::inputMethod());
+ inputMethodPrivate->testContext = nullptr;
+ QTRY_VERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QGraphicsScene::construction()
@@ -287,7 +320,7 @@ void tst_QGraphicsScene::construction()
QVERIFY(scene.items(QPolygonF()).isEmpty());
QVERIFY(scene.items(QPainterPath()).isEmpty());
QTest::ignoreMessage(QtWarningMsg, "QGraphicsScene::collidingItems: cannot find collisions for null item");
- QVERIFY(scene.collidingItems(0).isEmpty());
+ QVERIFY(scene.collidingItems(nullptr).isEmpty());
QVERIFY(scene.items(QPointF()).isEmpty());
QVERIFY(scene.selectedItems().isEmpty());
QVERIFY(!scene.focusItem());
@@ -301,7 +334,7 @@ static inline const QGraphicsItem *itemAt(const QGraphicsScene &scene, qreal x,
void tst_QGraphicsScene::sceneRect()
{
QGraphicsScene scene;
- QSignalSpy sceneRectChanged(&scene, SIGNAL(sceneRectChanged(QRectF)));
+ QSignalSpy sceneRectChanged(&scene, &QGraphicsScene::sceneRectChanged);
QCOMPARE(scene.sceneRect(), QRectF());
QCOMPARE(sceneRectChanged.count(), 0);
@@ -435,9 +468,9 @@ void tst_QGraphicsScene::items()
scene.removeItem(items.at(5));
delete items.at(5);
- QVERIFY(!scene.items().contains(0));
+ QVERIFY(!scene.items().contains(nullptr));
delete items.at(7);
- QVERIFY(!scene.items().contains(0));
+ QVERIFY(!scene.items().contains(nullptr));
}
{
QGraphicsScene scene;
@@ -516,7 +549,7 @@ void tst_QGraphicsScene::itemsBoundingRect()
QGraphicsScene scene;
- foreach (QRectF rect, rects) {
+ for (const auto &rect : qAsConst(rects)) {
QPainterPath path;
path.addRect(rect);
QGraphicsPathItem *item = scene.addPath(path);
@@ -581,7 +614,7 @@ void tst_QGraphicsScene::items_QPointF()
int n = 0;
QList<QGraphicsItem *> addedItems;
- foreach(QRectF rect, items) {
+ for (const auto &rect : qAsConst(items)) {
QPainterPath path;
path.addRect(0, 0, rect.width(), rect.height());
@@ -593,7 +626,8 @@ void tst_QGraphicsScene::items_QPointF()
}
QList<int> itemIndexes;
- foreach (QGraphicsItem *item, scene.items(point))
+ const auto &actualItemsAtPoint = scene.items(point);
+ for (QGraphicsItem *item : actualItemsAtPoint)
itemIndexes << addedItems.indexOf(item);
QCOMPARE(itemIndexes, itemsAtPoint);
@@ -912,12 +946,11 @@ void tst_QGraphicsScene::items_QPainterPath_2()
class CustomView : public QGraphicsView
{
public:
- CustomView() : repaints(0)
- { }
+ using QGraphicsView::QGraphicsView;
- int repaints;
+ int repaints = 0;
protected:
- void paintEvent(QPaintEvent *event)
+ void paintEvent(QPaintEvent *event) override
{
++repaints;
QGraphicsView::paintEvent(event);
@@ -927,7 +960,7 @@ protected:
void tst_QGraphicsScene::selectionChanged()
{
QGraphicsScene scene(0, 0, 1000, 1000);
- QSignalSpy spy(&scene, SIGNAL(selectionChanged()));
+ QSignalSpy spy(&scene, &QGraphicsScene::selectionChanged);
QCOMPARE(spy.count(), 0);
QPainterPath path;
@@ -997,7 +1030,7 @@ void tst_QGraphicsScene::selectionChanged()
void tst_QGraphicsScene::selectionChanged2()
{
QGraphicsScene scene;
- QSignalSpy spy(&scene, SIGNAL(selectionChanged()));
+ QSignalSpy spy(&scene, &QGraphicsScene::selectionChanged);
QGraphicsItem *item1 = scene.addRect(0, 0, 100, 100);
QGraphicsItem *item2 = scene.addRect(100, 100, 100, 100);
@@ -1009,13 +1042,13 @@ void tst_QGraphicsScene::selectionChanged2()
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
event.setScenePos(QPointF(50, 50));
event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
}
{
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseRelease);
event.setScenePos(QPointF(50, 50));
event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
}
QVERIFY(item1->isSelected());
QVERIFY(!item2->isSelected());
@@ -1024,13 +1057,13 @@ void tst_QGraphicsScene::selectionChanged2()
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
event.setScenePos(QPointF(150, 150));
event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
}
{
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseRelease);
event.setScenePos(QPointF(150, 150));
event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
}
QVERIFY(!item1->isSelected());
QVERIFY(item2->isSelected());
@@ -1040,7 +1073,7 @@ void tst_QGraphicsScene::selectionChanged2()
event.setScenePos(QPointF(50, 50));
event.setButton(Qt::LeftButton);
event.setModifiers(Qt::ControlModifier);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
}
QVERIFY(!item1->isSelected());
QVERIFY(item2->isSelected());
@@ -1049,7 +1082,7 @@ void tst_QGraphicsScene::selectionChanged2()
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMouseRelease);
event.setScenePos(QPointF(50, 50));
event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
}
QVERIFY(item1->isSelected());
QVERIFY(!item2->isSelected());
@@ -1065,10 +1098,12 @@ void tst_QGraphicsScene::addItem()
QGraphicsScene scene;
CustomView view;
+ view.setWindowTitle(QTest::currentTestFunction());
view.setScene(&scene);
+ view.resize(m_testSize);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- qApp->processEvents();
+ QCoreApplication::processEvents();
view.repaints = 0;
scene.addItem(path);
@@ -1115,14 +1150,14 @@ void tst_QGraphicsScene::addEllipse()
QCOMPARE(ellipse->pen(), QPen(Qt::red));
QCOMPARE(ellipse->brush(), QBrush(Qt::blue));
QCOMPARE(ellipse->rect(), QRectF(-10, -10, 20, 20));
- QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)ellipse);
+ QCOMPARE(itemAt(scene, 0, 0), ellipse);
QVERIFY(scene.items(QPointF(-10, -10)).isEmpty());
- QCOMPARE(itemAt(scene, -9.9, 0), (QGraphicsItem *)ellipse);
+ QCOMPARE(itemAt(scene, -9.9, 0), ellipse);
QVERIFY(scene.items(QPointF(-10, 10)).isEmpty());
- QCOMPARE(itemAt(scene, 0, -9.9), (QGraphicsItem *)ellipse);
- QCOMPARE(itemAt(scene, 0, 9.9), (QGraphicsItem *)ellipse);
+ QCOMPARE(itemAt(scene, 0, -9.9), ellipse);
+ QCOMPARE(itemAt(scene, 0, 9.9), ellipse);
QVERIFY(scene.items(QPointF(10, -10)).isEmpty());
- QCOMPARE(itemAt(scene, 9.9, 0), (QGraphicsItem *)ellipse);
+ QCOMPARE(itemAt(scene, 9.9, 0), ellipse);
QVERIFY(scene.items(QPointF(10, 10)).isEmpty());
}
@@ -1136,15 +1171,15 @@ void tst_QGraphicsScene::addLine()
QCOMPARE(line->pos(), QPointF());
QCOMPARE(line->pen(), pen);
QCOMPARE(line->line(), QLineF(-10, -10, 20, 20));
- QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)line);
- QCOMPARE(itemAt(scene, -10, -10), (QGraphicsItem *)line);
+ QCOMPARE(itemAt(scene, 0, 0), line);
+ QCOMPARE(itemAt(scene, -10, -10), line);
QVERIFY(scene.items(QPointF(-9.9, 0)).isEmpty());
QVERIFY(scene.items(QPointF(-10, 10)).isEmpty());
QVERIFY(scene.items(QPointF(0, -9.9)).isEmpty());
QVERIFY(scene.items(QPointF(0, 9.9)).isEmpty());
QVERIFY(scene.items(QPointF(10, -10)).isEmpty());
QVERIFY(scene.items(QPointF(9.9, 0)).isEmpty());
- QCOMPARE(itemAt(scene, 10, 10), (QGraphicsItem *)line);
+ QCOMPARE(itemAt(scene, 10, 10), line);
}
void tst_QGraphicsScene::addPath()
@@ -1162,16 +1197,16 @@ void tst_QGraphicsScene::addPath()
path->setPen(QPen(Qt::red, 0));
- QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, -9.9, 0), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 9.9, 0), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 0, -9.9), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 0, 9.9), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 0, 30), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, -9.9, 30), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 9.9, 30), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 0, 20.1), (QGraphicsItem *)path);
- QCOMPARE(itemAt(scene, 0, 39.9), (QGraphicsItem *)path);
+ QCOMPARE(itemAt(scene, 0, 0), path);
+ QCOMPARE(itemAt(scene, -9.9, 0), path);
+ QCOMPARE(itemAt(scene, 9.9, 0), path);
+ QCOMPARE(itemAt(scene, 0, -9.9), path);
+ QCOMPARE(itemAt(scene, 0, 9.9), path);
+ QCOMPARE(itemAt(scene, 0, 30), path);
+ QCOMPARE(itemAt(scene, -9.9, 30), path);
+ QCOMPARE(itemAt(scene, 9.9, 30), path);
+ QCOMPARE(itemAt(scene, 0, 20.1), path);
+ QCOMPARE(itemAt(scene, 0, 39.9), path);
QVERIFY(scene.items(QPointF(-10, -10)).isEmpty());
QVERIFY(scene.items(QPointF(10, -10)).isEmpty());
QVERIFY(scene.items(QPointF(-10, 10)).isEmpty());
@@ -1193,10 +1228,10 @@ void tst_QGraphicsScene::addPixmap()
QCOMPARE(pixmap->pos(), QPointF());
QCOMPARE(pixmap->pixmap(), pix);
- QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)pixmap);
- QCOMPARE(itemAt(scene, pix.width() - 1, 0), (QGraphicsItem *)pixmap);
- QCOMPARE(itemAt(scene, 0, pix.height() - 1), (QGraphicsItem *)pixmap);
- QCOMPARE(itemAt(scene, pix.width() - 1, pix.height() - 1), (QGraphicsItem *)pixmap);
+ QCOMPARE(itemAt(scene, 0, 0), pixmap);
+ QCOMPARE(itemAt(scene, pix.width() - 1, 0), pixmap);
+ QCOMPARE(itemAt(scene, 0, pix.height() - 1), pixmap);
+ QCOMPARE(itemAt(scene, pix.width() - 1, pix.height() - 1), pixmap);
QVERIFY(scene.items(QPointF(-1, -1)).isEmpty());
QVERIFY(scene.items(QPointF(pix.width() - 1, -1)).isEmpty());
@@ -1218,14 +1253,14 @@ void tst_QGraphicsScene::addRect()
rect->setPen(QPen(Qt::red, 0));
- QCOMPARE(itemAt(scene, 0, 0), (QGraphicsItem *)rect);
- QCOMPARE(itemAt(scene, -10, -10), (QGraphicsItem *)rect);
- QCOMPARE(itemAt(scene, -9.9, 0), (QGraphicsItem *)rect);
+ QCOMPARE(itemAt(scene, 0, 0),rect);
+ QCOMPARE(itemAt(scene, -10, -10), rect);
+ QCOMPARE(itemAt(scene, -9.9, 0), rect);
QVERIFY(scene.items(QPointF(-10, 10)).isEmpty());
- QCOMPARE(itemAt(scene, 0, -9.9), (QGraphicsItem *)rect);
- QCOMPARE(itemAt(scene, 0, 9.9), (QGraphicsItem *)rect);
+ QCOMPARE(itemAt(scene, 0, -9.9), rect);
+ QCOMPARE(itemAt(scene, 0, 9.9), rect);
QVERIFY(scene.items(QPointF(10, -10)).isEmpty());
- QCOMPARE(itemAt(scene, 9.9, 0), (QGraphicsItem *)rect);
+ QCOMPARE(itemAt(scene, 9.9, 0), rect);
QVERIFY(scene.items(QPointF(10, 10)).isEmpty());
}
@@ -1271,6 +1306,7 @@ void tst_QGraphicsScene::removeItem()
scene.setSceneRect(-50, -50, 100, 100);
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
view.setFixedSize(150, 150);
view.show();
QApplication::setActiveWindow(&view);
@@ -1342,7 +1378,7 @@ void tst_QGraphicsScene::focusItem()
class FocusItem : public QGraphicsTextItem
{
protected:
- void focusOutEvent(QFocusEvent *)
+ void focusOutEvent(QFocusEvent *) override
{
QVERIFY(!scene()->focusItem());
}
@@ -1359,14 +1395,14 @@ void tst_QGraphicsScene::focusItemLostFocus()
scene.addItem(item);
item->setFocus();
- QCOMPARE(scene.focusItem(), (QGraphicsItem *)item);
+ QCOMPARE(scene.focusItem(), item);
item->clearFocus();
}
class ClearTestItem : public QGraphicsRectItem
{
public:
- ClearTestItem(QGraphicsItem *parent = 0) : QGraphicsRectItem(parent) {}
+ using QGraphicsRectItem::QGraphicsRectItem;
~ClearTestItem() { qDeleteAll(items); }
QList<QGraphicsItem *> items;
};
@@ -1389,7 +1425,7 @@ void tst_QGraphicsScene::clear()
scene.setItemIndexMethod(QGraphicsScene::NoIndex);
scene.addItem(firstItem);
scene.addItem(secondItem);
- QCOMPARE(scene.items().at(0), (QGraphicsItem*)firstItem);
+ QCOMPARE(scene.items().at(0), firstItem);
QCOMPARE(scene.items().at(1), secondItem);
ClearTestItem *thirdItem = new ClearTestItem(firstItem);
@@ -1441,7 +1477,7 @@ void tst_QGraphicsScene::setFocusItem()
QVERIFY(item->hasFocus());
QVERIFY(!item2->hasFocus());
- scene.setFocusItem(0);
+ scene.setFocusItem(nullptr);
QVERIFY(!item->hasFocus());
QVERIFY(!item2->hasFocus());
@@ -1562,26 +1598,26 @@ void tst_QGraphicsScene::hoverEvents_siblings()
Q_CHECK_PAINTEVENTS
QGraphicsScene scene;
- QGraphicsItem *lastItem = 0;
+ QGraphicsItem *lastItem = nullptr;
QList<HoverItem *> items;
for (int i = 0; i < 15; ++i) {
- QGraphicsItem *item = new HoverItem;
+ auto item = new HoverItem;
scene.addItem(item);
- items << (HoverItem *)item;
- if (lastItem) {
+ items << item;
+ if (lastItem)
item->setPos(lastItem->pos() + QPointF(sin(i / 3.0) * 17, cos(i / 3.0) * 17));
- }
item->setZValue(i);
lastItem = item;
}
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
view.setRenderHint(QPainter::Antialiasing, true);
view.setMinimumSize(400, 300);
view.rotate(10);
view.scale(1.7, 1.7);
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
view.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -1604,8 +1640,8 @@ void tst_QGraphicsScene::hoverEvents_siblings()
mouseEvent.setScenePos(items.at(i)->mapToScene(0, 0));
QApplication::sendEvent(&scene, &mouseEvent);
- qApp->processEvents(); // this posts updates from the scene to the view
- qApp->processEvents(); // which trigger a repaint here
+ QCoreApplication::processEvents(); // this posts updates from the scene to the view
+ QCoreApplication::processEvents(); // which trigger a repaint here
QTRY_VERIFY(items.at(i)->isHovered);
if (j && i > 0)
@@ -1621,8 +1657,8 @@ void tst_QGraphicsScene::hoverEvents_siblings()
mouseEvent.setScenePos(QPointF(-1000, -1000));
QApplication::sendEvent(&scene, &mouseEvent);
- qApp->processEvents(); // this posts updates from the scene to the view
- qApp->processEvents(); // which trigger a repaint here
+ QCoreApplication::processEvents(); // this posts updates from the scene to the view
+ QCoreApplication::processEvents(); // which trigger a repaint here
}
}
@@ -1631,12 +1667,12 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
Q_CHECK_PAINTEVENTS
QGraphicsScene scene;
- QGraphicsItem *lastItem = 0;
+ QGraphicsItem *lastItem = nullptr;
QList<HoverItem *> items;
for (int i = 0; i < 15; ++i) {
- QGraphicsItem *item = new HoverItem;
+ auto item = new HoverItem;
scene.addItem(item);
- items << (HoverItem *)item;
+ items << item;
if (lastItem) {
item->setParentItem(lastItem);
item->setPos(sin(i / 3.0) * 17, cos(i / 3.0) * 17);
@@ -1645,12 +1681,13 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
}
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
view.setRenderHint(QPainter::Antialiasing, true);
view.setMinimumSize(400, 300);
view.rotate(10);
view.scale(1.7, 1.7);
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QGraphicsSceneMouseEvent mouseEvent(QEvent::GraphicsSceneMouseMove);
@@ -1669,8 +1706,8 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
mouseEvent.setScenePos(items.at(i)->mapToScene(0, 0));
QApplication::sendEvent(&scene, &mouseEvent);
- qApp->processEvents(); // this posts updates from the scene to the view
- qApp->processEvents(); // which trigger a repaint here
+ QCoreApplication::processEvents(); // this posts updates from the scene to the view
+ QCoreApplication::processEvents(); // which trigger a repaint here
QTRY_VERIFY(items.at(i)->isHovered);
if (i < 14)
@@ -1683,8 +1720,8 @@ void tst_QGraphicsScene::hoverEvents_parentChild()
mouseEvent.setScenePos(QPointF(-1000, -1000));
QApplication::sendEvent(&scene, &mouseEvent);
- qApp->processEvents(); // this posts updates from the scene to the view
- qApp->processEvents(); // which trigger a repaint here
+ QCoreApplication::processEvents(); // this posts updates from the scene to the view
+ QCoreApplication::processEvents(); // which trigger a repaint here
}
}
@@ -1712,23 +1749,23 @@ void tst_QGraphicsScene::createItemGroup()
// All items in children1 are children of parent1
QGraphicsItem *parent1 = scene.addRect(QRectF(-10, -10, 20, 20));
- foreach (QGraphicsItem *item, children1)
+ for (QGraphicsItem *item : qAsConst(children1))
item->setParentItem(parent1);
QGraphicsItemGroup *group = scene.createItemGroup(children1);
QCOMPARE(group->parentItem(), parent1);
- QCOMPARE(children1.first()->parentItem(), (QGraphicsItem *)group);
+ QCOMPARE(children1.first()->parentItem(), group);
scene.destroyItemGroup(group);
QCOMPARE(children1.first()->parentItem(), parent1);
group = scene.createItemGroup(children1);
QCOMPARE(group->parentItem(), parent1);
- QCOMPARE(children1.first()->parentItem(), (QGraphicsItem *)group);
+ QCOMPARE(children1.first()->parentItem(), group);
scene.destroyItemGroup(group);
QCOMPARE(children1.first()->parentItem(), parent1);
// All items in children2 are children of parent2
QGraphicsItem *parent2 = scene.addRect(QRectF(-10, -10, 20, 20));
- foreach (QGraphicsItem *item, children2)
+ for (QGraphicsItem *item : qAsConst(children2))
item->setParentItem(parent2);
// Now make parent2 a child of parent1, so all children2 are also children
@@ -1738,21 +1775,21 @@ void tst_QGraphicsScene::createItemGroup()
// The children2 group should still have parent2 as their common ancestor.
group = scene.createItemGroup(children2);
QCOMPARE(group->parentItem(), parent2);
- QCOMPARE(children2.first()->parentItem(), (QGraphicsItem *)group);
+ QCOMPARE(children2.first()->parentItem(), group);
scene.destroyItemGroup(group);
QCOMPARE(children2.first()->parentItem(), parent2);
// But the set of both children2 and children1 share only parent1.
group = scene.createItemGroup(children2 + children1);
QCOMPARE(group->parentItem(), parent1);
- QCOMPARE(children1.first()->parentItem(), (QGraphicsItem *)group);
- QCOMPARE(children2.first()->parentItem(), (QGraphicsItem *)group);
+ QCOMPARE(children1.first()->parentItem(), group);
+ QCOMPARE(children2.first()->parentItem(), group);
scene.destroyItemGroup(group);
QCOMPARE(children1.first()->parentItem(), parent1);
QCOMPARE(children2.first()->parentItem(), parent1);
// Fixup the parent-child chain
- foreach (QGraphicsItem *item, children2)
+ for (QGraphicsItem *item : qAsConst(children2))
item->setParentItem(parent2);
// These share no common parent
@@ -1762,7 +1799,7 @@ void tst_QGraphicsScene::createItemGroup()
// Make children3 children of parent3
QGraphicsItem *parent3 = scene.addRect(QRectF(-10, -10, 20, 20));
- foreach (QGraphicsItem *item, children3)
+ for (QGraphicsItem *item : qAsConst(children3))
item->setParentItem(parent3);
// These should have parent3 as a parent
@@ -1794,15 +1831,14 @@ void tst_QGraphicsScene::createItemGroup()
class EventTester : public QGraphicsEllipseItem
{
public:
- EventTester()
- : QGraphicsEllipseItem(QRectF(-10, -10, 20, 20)), ignoreMouse(false)
+ EventTester() : QGraphicsEllipseItem(QRectF(-10, -10, 20, 20))
{ }
- bool ignoreMouse;
- QList<QEvent::Type> eventTypes;
+ bool ignoreMouse = false;
+ QVector<QEvent::Type> eventTypes;
protected:
- bool sceneEvent(QEvent *event)
+ bool sceneEvent(QEvent *event) override
{
eventTypes << QEvent::Type(event->type());
switch (event->type()) {
@@ -1813,6 +1849,7 @@ protected:
event->ignore();
return true;
}
+ break;
default:
break;
}
@@ -1867,7 +1904,7 @@ void tst_QGraphicsScene::mouseEventPropagation()
QCOMPARE(c->eventTypes.size(), 0);
QCOMPARE(b->eventTypes.size(), 0);
QCOMPARE(a->eventTypes.size(), 0);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)d);
+ QCOMPARE(scene.mouseGrabberItem(), d);
// Send a move
QApplication::sendEvent(&scene, &moveEvent);
@@ -1876,7 +1913,7 @@ void tst_QGraphicsScene::mouseEventPropagation()
QCOMPARE(c->eventTypes.size(), 0);
QCOMPARE(b->eventTypes.size(), 0);
QCOMPARE(a->eventTypes.size(), 0);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)d);
+ QCOMPARE(scene.mouseGrabberItem(), d);
// Send a release
QApplication::sendEvent(&scene, &releaseEvent);
@@ -1898,7 +1935,7 @@ void tst_QGraphicsScene::mouseEventPropagation()
QCOMPARE(c->eventTypes.at(1), QEvent::GraphicsSceneMousePress);
QCOMPARE(b->eventTypes.size(), 0);
QCOMPARE(a->eventTypes.size(), 0);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)c);
+ QCOMPARE(scene.mouseGrabberItem(), c);
// Send another press, with a button that isn't actually accepted
QApplication::sendEvent(&scene, &pressEvent);
@@ -1908,7 +1945,7 @@ void tst_QGraphicsScene::mouseEventPropagation()
QCOMPARE(c->eventTypes.at(2), QEvent::GraphicsSceneMousePress);
QCOMPARE(b->eventTypes.size(), 0);
QCOMPARE(a->eventTypes.size(), 0);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)c);
+ QCOMPARE(scene.mouseGrabberItem(), c);
// Send a move
QApplication::sendEvent(&scene, &moveEvent);
@@ -1917,7 +1954,7 @@ void tst_QGraphicsScene::mouseEventPropagation()
QCOMPARE(c->eventTypes.at(3), QEvent::GraphicsSceneMouseMove);
QCOMPARE(b->eventTypes.size(), 0);
QCOMPARE(a->eventTypes.size(), 0);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)c);
+ QCOMPARE(scene.mouseGrabberItem(), c);
// Send a release
QApplication::sendEvent(&scene, &releaseEvent);
@@ -1950,7 +1987,7 @@ void tst_QGraphicsScene::mouseEventPropagation()
QCOMPARE(c->eventTypes.at(7), QEvent::GraphicsSceneMousePress);
QCOMPARE(b->eventTypes.size(), 0);
QCOMPARE(a->eventTypes.size(), 0);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)c);
+ QCOMPARE(scene.mouseGrabberItem(), c);
// Clicking outside the items removes the mouse grabber
}
@@ -1999,7 +2036,7 @@ void tst_QGraphicsScene::mouseEventPropagation_ignore()
QCOMPARE(d->eventTypes.at(0), QEvent::GrabMouse);
QCOMPARE(d->eventTypes.at(1), QEvent::GraphicsSceneMousePress);
QCOMPARE(d->eventTypes.at(2), QEvent::UngrabMouse);
- QCOMPARE(scene.mouseGrabberItem(), (QGraphicsItem *)a);
+ QCOMPARE(scene.mouseGrabberItem(), a);
a->ignoreMouse = true;
@@ -2115,7 +2152,7 @@ public:
QVector<QPointF> mouseMovePoints;
protected:
- void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
{
mouseMovePoints << event->scenePos();
}
@@ -2140,22 +2177,17 @@ void tst_QGraphicsScene::mouseEventPropagation_mouseMove()
class DndTester : public QGraphicsEllipseItem
{
public:
- DndTester(const QRectF &rect)
- : QGraphicsEllipseItem(rect), lastEvent(0),
- ignoresDragEnter(false), ignoresDragMove(false)
-
- {
- }
+ using QGraphicsEllipseItem::QGraphicsEllipseItem;
~DndTester()
{
delete lastEvent;
}
- QGraphicsSceneDragDropEvent *lastEvent;
+ QGraphicsSceneDragDropEvent *lastEvent = nullptr;
QList<QEvent::Type> eventList;
- bool ignoresDragEnter;
- bool ignoresDragMove;
+ bool ignoresDragEnter = false;
+ bool ignoresDragMove = false;
protected:
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
@@ -2218,21 +2250,21 @@ void tst_QGraphicsScene::dragAndDrop_simple()
QMimeData mimeData;
// Initial drag enter for the scene
- QDragEnterEvent dragEnter(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragEnterEvent dragEnter(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragEnter);
QVERIFY(dragEnter.isAccepted());
QCOMPARE(dragEnter.dropAction(), Qt::CopyAction);
{
// Move outside the item
- QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
}
{
// Move inside the item without setAcceptDrops
- QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2241,7 +2273,7 @@ void tst_QGraphicsScene::dragAndDrop_simple()
item->setAcceptDrops(true);
{
// Move inside the item with setAcceptDrops
- QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2255,7 +2287,7 @@ void tst_QGraphicsScene::dragAndDrop_simple()
}
{
// Another move inside the item
- QDragMoveEvent dragMove(view.mapFromScene(item->mapToScene(5, 5)), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->mapToScene(5, 5)), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2268,7 +2300,7 @@ void tst_QGraphicsScene::dragAndDrop_simple()
}
{
// Move outside the item
- QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2281,7 +2313,7 @@ void tst_QGraphicsScene::dragAndDrop_simple()
}
{
// Move inside the item again
- QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2295,7 +2327,7 @@ void tst_QGraphicsScene::dragAndDrop_simple()
}
{
// Drop inside the item
- QDropEvent drop(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDropEvent drop(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &drop);
QVERIFY(drop.isAccepted());
QCOMPARE(drop.dropAction(), Qt::CopyAction);
@@ -2322,13 +2354,13 @@ void tst_QGraphicsScene::dragAndDrop_disabledOrInvisible()
QMimeData mimeData;
// Initial drag enter for the scene
- QDragEnterEvent dragEnter(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragEnterEvent dragEnter(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragEnter);
QVERIFY(dragEnter.isAccepted());
QCOMPARE(dragEnter.dropAction(), Qt::CopyAction);
{
// Move inside the item
- QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2338,7 +2370,7 @@ void tst_QGraphicsScene::dragAndDrop_disabledOrInvisible()
}
{
// Move outside the item
- QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2353,7 +2385,7 @@ void tst_QGraphicsScene::dragAndDrop_disabledOrInvisible()
{
// Move inside the item
- QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2369,7 +2401,7 @@ void tst_QGraphicsScene::dragAndDrop_disabledOrInvisible()
{
// Move inside the item
- QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(item->scenePos()), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2378,7 +2410,7 @@ void tst_QGraphicsScene::dragAndDrop_disabledOrInvisible()
}
// Dummy drop event to keep the Mac from crashing.
- QDropEvent dropEvent(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDropEvent dropEvent(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dropEvent);
}
@@ -2405,14 +2437,14 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
QMimeData mimeData;
// Initial drag enter for the scene
- QDragEnterEvent dragEnter(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragEnterEvent dragEnter(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragEnter);
QVERIFY(dragEnter.isAccepted());
QCOMPARE(dragEnter.dropAction(), Qt::CopyAction);
{
// Move outside the items
- QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2421,7 +2453,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
}
{
// Move inside item1
- QDragMoveEvent dragMove(view.mapFromScene(-5, -5), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(-5, -5), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2432,7 +2464,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
{
// Move into the intersection item1-item2
- QDragMoveEvent dragMove(view.mapFromScene(5, 5), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(5, 5), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted()); // move does not propagate, (ignoresDragMove = true)
QCOMPARE(item1->eventList.size(), 3);
@@ -2443,7 +2475,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
}
{
// Move into the item2
- QDragMoveEvent dragMove(view.mapFromScene(15, 15), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(15, 15), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(!dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::CopyAction);
@@ -2453,7 +2485,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
}
{
// Move inside item1
- QDragMoveEvent dragMove(view.mapFromScene(-5, -5), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(-5, -5), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted());
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2467,7 +2499,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
{
item2->ignoresDragEnter = true;
// Move into the intersection item1-item2
- QDragMoveEvent dragMove(view.mapFromScene(5, 5), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDragMoveEvent dragMove(view.mapFromScene(5, 5), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dragMove);
QVERIFY(dragMove.isAccepted()); // dragEnter propagates down to item1, which then accepts the move event.
QCOMPARE(dragMove.dropAction(), Qt::IgnoreAction);
@@ -2480,7 +2512,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
{
item2->ignoresDragEnter = false;
// Drop on the intersection item1-item2
- QDropEvent drop(view.mapFromScene(5, 5), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDropEvent drop(view.mapFromScene(5, 5), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &drop);
QVERIFY(drop.isAccepted());
QCOMPARE(drop.dropAction(), Qt::CopyAction);
@@ -2491,7 +2523,7 @@ void tst_QGraphicsScene::dragAndDrop_propagate()
}
// Dummy drop event to keep the Mac from crashing.
- QDropEvent dropEvent(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, 0);
+ QDropEvent dropEvent(QPoint(0, 0), Qt::CopyAction, &mimeData, Qt::LeftButton, {});
QApplication::sendEvent(view.viewport(), &dropEvent);
}
#endif
@@ -2580,6 +2612,8 @@ void tst_QGraphicsScene::render()
pix.fill(Qt::blue);
QGraphicsView view;
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
QGraphicsScene scene(&view);
scene.addEllipse(QRectF(-10, -10, 20, 20), QPen(Qt::black, 0), QBrush(Qt::white));
scene.addEllipse(QRectF(-2, -7, 4, 4), QPen(Qt::black, 0), QBrush(Qt::yellow))->setZValue(1);
@@ -2642,6 +2676,7 @@ void tst_QGraphicsScene::render()
gridLayout->addWidget(newLabel, 2, 0);
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setLayout(gridLayout);
widget.show();
@@ -2660,33 +2695,32 @@ void tst_QGraphicsScene::renderItemsWithNegativeWidthOrHeight()
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) || defined(Q_OS_WINRT)
QSKIP("Test only works on platforms with resizable windows");
#endif
-
- QGraphicsScene scene(0, 0, 150, 150);
+ QGraphicsScene scene(0, 0, m_testSize.width(), m_testSize.height());
// Add item with negative width.
- QGraphicsRectItem *item1 = new QGraphicsRectItem(0, 0, -150, 50);
+ QGraphicsRectItem *item1 = new QGraphicsRectItem(0, 0, -m_testSize.width(), 50);
item1->setBrush(Qt::red);
- item1->setPos(150, 50);
+ item1->setPos(m_testSize.width(), 50);
scene.addItem(item1);
// Add item with negative height.
- QGraphicsRectItem *item2 = new QGraphicsRectItem(0, 0, 50, -150);
+ QGraphicsRectItem *item2 = new QGraphicsRectItem(0, 0, 50, -m_testSize.height());
item2->setBrush(Qt::blue);
- item2->setPos(50, 150);
+ item2->setPos(50, m_testSize.height());
scene.addItem(item2);
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
view.setFrameStyle(QFrame::NoFrame);
- view.resize(150, 150);
view.show();
- QCOMPARE(view.viewport()->size(), QSize(150, 150));
+ QTRY_COMPARE(view.viewport()->size(), m_testSize);
QImage expected(view.viewport()->size(), QImage::Format_RGB32);
view.viewport()->render(&expected);
// Make sure the scene background is the same as the viewport background.
scene.setBackgroundBrush(view.viewport()->palette().brush(view.viewport()->backgroundRole()));
- QImage actual(150, 150, QImage::Format_RGB32);
+ QImage actual(m_testSize, QImage::Format_RGB32);
QPainter painter(&actual);
scene.render(&painter);
painter.end();
@@ -2710,6 +2744,8 @@ void tst_QGraphicsScene::contextMenuEvent()
QVERIFY(scene.hasFocus());
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
view.show();
view.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -2726,11 +2762,11 @@ void tst_QGraphicsScene::contextMenuEvent()
class ContextMenuItem : public QGraphicsRectItem
{
public:
- ContextMenuItem() : QGraphicsRectItem(0, 0, 100, 100)
+ ContextMenuItem(const QSize &s) : QGraphicsRectItem(0, 0, s.width(), s.height())
{ setBrush(Qt::red); }
protected:
- void contextMenuEvent(QGraphicsSceneContextMenuEvent *)
+ void contextMenuEvent(QGraphicsSceneContextMenuEvent *) override
{ /* just accept */ }
};
@@ -2740,26 +2776,30 @@ void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations()
QSKIP("Test fails on some Android devices (QTBUG-44430)");
#endif
- QGraphicsScene scene(0, 0, 200, 200);
- ContextMenuItem *item = new ContextMenuItem;
+ QGraphicsScene scene(0, 0, m_testSize.width(), m_testSize.height());
+ const QSize itemSize = m_testSize / 2;
+ ContextMenuItem *item = new ContextMenuItem(itemSize);
item->setFlag(QGraphicsItem::ItemIgnoresTransformations);
scene.addItem(item);
QWidget topLevel;
+ topLevel.setWindowTitle(QTest::currentTestFunction());
+ topLevel.resize(m_testSize);
QGraphicsView view(&scene, &topLevel);
- view.resize(200, 200);
topLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
+
+
{
- QPoint pos(50, 50);
+ QPoint pos(itemSize.width() / 2, itemSize.height() / 2);
QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos));
event.ignore();
QApplication::sendEvent(view.viewport(), &event);
QVERIFY(event.isAccepted());
}
{
- QPoint pos(150, 150);
+ QPoint pos(itemSize.width() * 3 / 2, itemSize.height() * 3 / 2);
QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos));
event.ignore();
QApplication::sendEvent(view.viewport(), &event);
@@ -2767,14 +2807,14 @@ void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations()
}
view.scale(1.5, 1.5);
{
- QPoint pos(25, 25);
+ QPoint pos(itemSize.width() / 4, itemSize.height() / 4);
QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos));
event.ignore();
QApplication::sendEvent(view.viewport(), &event);
QVERIFY(event.isAccepted());
}
{
- QPoint pos(55, 55);
+ QPoint pos(itemSize.width() / 2 + 5, itemSize.height() / 2 + 5);
QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos));
event.ignore();
QApplication::sendEvent(view.viewport(), &event);
@@ -2790,14 +2830,14 @@ void tst_QGraphicsScene::update()
QGraphicsRectItem *rect = new QGraphicsRectItem(0, 0, 100, 100);
rect->setPen(QPen(Qt::black, 0));
scene.addItem(rect);
- qApp->processEvents();
+ QCoreApplication::processEvents();
rect->setPos(-100, -100);
// This function forces indexing
itemAt(scene, 0, 0);
qRegisterMetaType<QList<QRectF> >("QList<QRectF>");
- QSignalSpy spy(&scene, SIGNAL(changed(QList<QRectF>)));
+ QSignalSpy spy(&scene, &QGraphicsScene::changed);
// We update the scene.
scene.update();
@@ -2806,12 +2846,13 @@ void tst_QGraphicsScene::update()
itemAt(scene, 0, 0);
// This will process the pending update
- QApplication::instance()->processEvents();
+ QCoreApplication::processEvents();
// Check that the update region is correct
QCOMPARE(spy.count(), 1);
QRectF region;
- foreach (QRectF rectF, qvariant_cast<QList<QRectF> >(spy.at(0).at(0)))
+ const auto &rects = qvariant_cast<QList<QRectF> >(spy.at(0).at(0));
+ for (const auto &rectF : rects)
region |= rectF;
QCOMPARE(region, QRectF(-100, -100, 200, 200));
}
@@ -2821,9 +2862,11 @@ void tst_QGraphicsScene::update2()
QGraphicsScene scene;
scene.setSceneRect(-200, -200, 200, 200);
CustomView view;
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
view.setScene(&scene);
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.repaints >= 1);
view.repaints = 0;
@@ -2831,13 +2874,13 @@ void tst_QGraphicsScene::update2()
// Make sure QGraphicsScene::update only requires one event-loop iteration
// before the view is updated.
scene.update();
- qApp->processEvents();
+ QCoreApplication::processEvents();
QTRY_COMPARE(view.repaints, 1);
view.repaints = 0;
// The same for partial scene updates.
scene.update(QRectF(-100, -100, 100, 100));
- qApp->processEvents();
+ QCoreApplication::processEvents();
QCOMPARE(view.repaints, 1);
}
@@ -2853,7 +2896,7 @@ void tst_QGraphicsScene::views()
QCOMPARE(scene.views().size(), 2);
QVERIFY(scene.views().contains(&view1));
- view.setScene(0);
+ view.setScene(nullptr);
QCOMPARE(scene.views().size(), 1);
QCOMPARE(scene.views().at(0), &view1);
@@ -2871,12 +2914,12 @@ void tst_QGraphicsScene::views()
class CustomScene : public QGraphicsScene
{
public:
- CustomScene() : gotTimerEvent(false)
+ CustomScene()
{ startTimer(10); }
- bool gotTimerEvent;
+ bool gotTimerEvent = false;
protected:
- void timerEvent(QTimerEvent *)
+ void timerEvent(QTimerEvent *) override
{
gotTimerEvent = true;
}
@@ -2893,7 +2936,7 @@ void tst_QGraphicsScene::testEvent()
class DisabledItemTester : public QGraphicsRectItem
{
public:
- DisabledItemTester(const QRectF &rect, QGraphicsItem *parent = 0)
+ DisabledItemTester(const QRectF &rect, QGraphicsItem *parent = nullptr)
: QGraphicsRectItem(rect, parent)
{ }
@@ -2901,13 +2944,13 @@ public:
QList<QEvent::Type> receivedSceneEventFilters;
protected:
- bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
+ bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override
{
receivedSceneEventFilters << event->type();
return QGraphicsRectItem::sceneEventFilter(watched, event);
}
- bool sceneEvent(QEvent *event)
+ bool sceneEvent(QEvent *event) override
{
receivedSceneEvents << event->type();
return QGraphicsRectItem::sceneEvent(event);
@@ -2965,11 +3008,9 @@ void tst_QGraphicsScene::eventsToDisabledItems()
class ExposedPixmapItem : public QGraphicsPixmapItem
{
public:
- ExposedPixmapItem(QGraphicsItem *item = 0)
- : QGraphicsPixmapItem(item)
- { }
+ using QGraphicsPixmapItem::QGraphicsPixmapItem;
- void paint(QPainter *, const QStyleOptionGraphicsItem *option, QWidget *)
+ void paint(QPainter *, const QStyleOptionGraphicsItem *option, QWidget *) override
{
exposed = option->exposedRect;
}
@@ -3013,8 +3054,9 @@ void tst_QGraphicsScene::tabFocus_emptyScene()
QWidget widget;
widget.setLayout(layout);
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
@@ -3060,9 +3102,10 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems()
layout->addWidget(dial2);
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setLayout(layout);
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
@@ -3112,18 +3155,18 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems()
QVERIFY(!view->viewport()->hasFocus());
QVERIFY(!scene.hasFocus());
QVERIFY(!item->hasFocus());
- QCOMPARE(scene.focusItem(), static_cast<QGraphicsItem *>(item));
+ QCOMPARE(scene.focusItem(), item);
// Check that the correct item regains focus.
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
QVERIFY(view->hasFocus());
QTRY_VERIFY(scene.isActive());
QVERIFY(view->viewport()->hasFocus());
QVERIFY(scene.hasFocus());
- QCOMPARE(scene.focusItem(), static_cast<QGraphicsItem *>(item));
+ QCOMPARE(scene.focusItem(), item);
QVERIFY(item->hasFocus());
}
@@ -3131,14 +3174,13 @@ class FocusWidget : public QGraphicsWidget
{
Q_OBJECT
public:
- FocusWidget(QGraphicsItem *parent = 0)
- : QGraphicsWidget(parent), tabs(0), backTabs(0)
+ FocusWidget(QGraphicsItem *parent = nullptr) : QGraphicsWidget(parent)
{
setFocusPolicy(Qt::StrongFocus);
resize(100, 100);
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) override
{
if (option->state & QStyle::State_HasFocus) {
painter->fillRect(rect(), Qt::blue);
@@ -3152,11 +3194,11 @@ public:
}
}
- int tabs;
- int backTabs;
+ int tabs = 0;
+ int backTabs = 0;
protected:
- bool sceneEvent(QEvent *event)
+ bool sceneEvent(QEvent *event) override
{
if (event->type() == QEvent::KeyPress) {
QKeyEvent *k = static_cast<QKeyEvent *>(event);
@@ -3168,9 +3210,9 @@ protected:
return QGraphicsWidget::sceneEvent(event);
}
- void focusInEvent(QFocusEvent *)
+ void focusInEvent(QFocusEvent *) override
{ update(); }
- void focusOutEvent(QFocusEvent *)
+ void focusOutEvent(QFocusEvent *) override
{ update(); }
};
@@ -3195,9 +3237,10 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets()
layout->addWidget(dial2);
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setLayout(layout);
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
@@ -3236,7 +3279,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets()
widget.hide();
QTest::qWait(15);
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
QTRY_VERIFY(widget1->hasFocus());
@@ -3279,9 +3322,10 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets()
layout->addWidget(dial2);
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setLayout(layout);
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
@@ -3366,7 +3410,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets()
widget.hide();
QTest::qWait(12);
widget.show();
- qApp->setActiveWindow(&widget);
+ QApplication::setActiveWindow(&widget);
widget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&widget));
QTRY_VERIFY(widget1->hasFocus());
@@ -3390,11 +3434,11 @@ void tst_QGraphicsScene::style()
QCOMPARE(sceneSpy.count(), 1);
QCOMPARE(proxySpy.count(), 1);
QCOMPARE(editSpy.count(), 1);
- QCOMPARE(scene.style(), (QStyle *)windowsStyle);
- QCOMPARE(proxy->style(), (QStyle *)windowsStyle);
- QCOMPARE(edit->style(), (QStyle *)windowsStyle);
+ QCOMPARE(scene.style(), windowsStyle.data());
+ QCOMPARE(proxy->style(), windowsStyle.data());
+ QCOMPARE(edit->style(), windowsStyle.data());
- scene.setStyle(0);
+ scene.setStyle(nullptr);
QCOMPARE(sceneSpy.count(), 2);
QCOMPARE(proxySpy.count(), 2);
QCOMPARE(editSpy.count(), 2);
@@ -3411,11 +3455,12 @@ void tst_QGraphicsScene::task139710_bspTreeCrash()
for (int i = 0; i < 2; ++i) {
// trigger delayed item indexing
- qApp->processEvents();
+ QCoreApplication::processEvents();
scene.setSceneRect(0, 0, 10000, 10000);
// delete all items in the scene - pointers are now likely to be recycled
- foreach (QGraphicsItem *item, scene.items()) {
+ const auto &items = scene.items();
+ for (QGraphicsItem *item : items) {
scene.removeItem(item);
delete item;
}
@@ -3427,7 +3472,7 @@ void tst_QGraphicsScene::task139710_bspTreeCrash()
}
// trigger delayed item indexing for the first 1000 items
- qApp->processEvents();
+ QCoreApplication::processEvents();
// add 1000 more items - the BSP tree is now resized
for (int i = 0; i < 1000; ++i) {
@@ -3437,7 +3482,8 @@ void tst_QGraphicsScene::task139710_bspTreeCrash()
// get items from the BSP tree and use them. there was junk in the tree
// the second time this happened.
- foreach (QGraphicsItem *item, scene.items(QRectF(0, 0, 1000, 1000)))
+ const auto &itemsWithin = scene.items(QRectF(0, 0, 1000, 1000));
+ for (QGraphicsItem *item : itemsWithin)
item->moveBy(0, 0);
}
}
@@ -3446,7 +3492,7 @@ void tst_QGraphicsScene::task139782_containsItemBoundingRect()
{
// The item in question has a scene bounding rect of (10, 10, 50, 50)
QGraphicsScene scene(0.0, 0.0, 200.0, 200.0);
- QGraphicsRectItem *item = new QGraphicsRectItem(0.0, 0.0, 50.0, 50.0, 0);
+ QGraphicsRectItem *item = new QGraphicsRectItem(0.0, 0.0, 50.0, 50.0, nullptr);
scene.addItem(item);
item->setPos(10.0, 10.0);
@@ -3476,7 +3522,8 @@ void tst_QGraphicsScene::task160653_selectionChanged()
QGraphicsScene scene(0, 0, 100, 100);
scene.addItem(new QGraphicsRectItem(0, 0, 20, 20));
scene.addItem(new QGraphicsRectItem(30, 30, 20, 20));
- foreach (QGraphicsItem *item, scene.items()) {
+ const auto &items = scene.items();
+ for (QGraphicsItem *item : items) {
item->setFlags(
item->flags() | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable);
item->setSelected(true);
@@ -3484,12 +3531,14 @@ void tst_QGraphicsScene::task160653_selectionChanged()
QVERIFY(scene.items().size() > 1);
QCOMPARE(scene.items().size(), scene.selectedItems().size());
- QSignalSpy spy(&scene, SIGNAL(selectionChanged()));
+ QSignalSpy spy(&scene, &QGraphicsScene::selectionChanged);
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
QTest::mouseClick(
- view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.items().first()->scenePos()));
+ view.viewport(), Qt::LeftButton, {}, view.mapFromScene(scene.items().first()->scenePos()));
QCOMPARE(spy.count(), 1);
}
@@ -3574,17 +3623,21 @@ void tst_QGraphicsScene::sorting()
scene.addItem(t_1);
- foreach (QGraphicsItem *item, scene.items())
+ const auto &items = scene.items();
+ for (QGraphicsItem *item : items)
item->setFlag(QGraphicsItem::ItemIsSelectable);
// QGraphicsView view(&scene);
// view.setDragMode(QGraphicsView::RubberBandDrag);
// view.show();
- qDebug() << "items: {";
- foreach (QGraphicsItem *item, scene.items(QRectF(32, 31, 4, 55)))
- qDebug() << "\t" << item->data(0).toString();
- qDebug() << "}";
+ if (lcTests().isDebugEnabled()) {
+ qCDebug(lcTests) << "items: {";
+ const auto &itemsWithin = scene.items(QRectF(32, 31, 4, 55));
+ for (QGraphicsItem *item : itemsWithin)
+ qCDebug(lcTests).nospace() << '\t' << item->data(0).toString();
+ qCDebug(lcTests) << '}';
+ }
QCOMPARE(scene.items(QRectF(32, 31, 4, 55)),
QList<QGraphicsItem *>()
@@ -3664,11 +3717,11 @@ void tst_QGraphicsScene::changedSignal()
QFETCH(bool, withView);
QGraphicsScene scene;
ChangedListener cl;
- connect(&scene, SIGNAL(changed(QList<QRectF>)), &cl, SLOT(changed(QList<QRectF>)));
+ connect(&scene, &QGraphicsScene::changed, &cl, &ChangedListener::changed);
- QGraphicsView *view = 0;
+ QScopedPointer<QGraphicsView> view;
if (withView)
- view = new QGraphicsView(&scene);
+ view.reset(new QGraphicsView(&scene));
QGraphicsRectItem *rect = new QGraphicsRectItem(0, 0, 10, 10);
rect->setPen(QPen(Qt::black, 0));
@@ -3682,14 +3735,11 @@ void tst_QGraphicsScene::changedSignal()
rect->setPos(20, 0);
QCOMPARE(cl.changes.size(), 1);
- qApp->processEvents();
+ QCoreApplication::processEvents();
QCOMPARE(cl.changes.size(), 2);
QCOMPARE(cl.changes.at(1).size(), 2);
QCOMPARE(scene.sceneRect(), QRectF(0, 0, 30, 10));
-
- if (withView)
- delete view;
}
void tst_QGraphicsScene::stickyFocus_data()
@@ -3716,7 +3766,7 @@ void tst_QGraphicsScene::stickyFocus()
QGraphicsSceneMouseEvent event(QEvent::GraphicsSceneMousePress);
event.setScenePos(QPointF(-10, -10)); // outside item
event.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
QCOMPARE(text->hasFocus(), sticky);
}
@@ -3734,43 +3784,51 @@ void tst_QGraphicsScene::sendEvent()
void tst_QGraphicsScene::inputMethod_data()
{
- QTest::addColumn<int>("flags");
+ QTest::addColumn<QGraphicsItem::GraphicsItemFlags>("flags");
QTest::addColumn<bool>("callFocusItem");
- QTest::newRow("0") << 0 << false;
- QTest::newRow("1") << (int)QGraphicsItem::ItemAcceptsInputMethod << false;
- QTest::newRow("2") << (int)QGraphicsItem::ItemIsFocusable << false;
+ QTest::newRow("0") << QGraphicsItem::GraphicsItemFlags() << false;
+ QTest::newRow("1") << QGraphicsItem::GraphicsItemFlags(QGraphicsItem::ItemAcceptsInputMethod) << false;
+ QTest::newRow("2") << QGraphicsItem::GraphicsItemFlags(QGraphicsItem::ItemIsFocusable) << false;
QTest::newRow("3") <<
- (int)(QGraphicsItem::ItemAcceptsInputMethod|QGraphicsItem::ItemIsFocusable) << true;
+ (QGraphicsItem::ItemAcceptsInputMethod|QGraphicsItem::ItemIsFocusable) << true;
}
class InputMethodTester : public QGraphicsRectItem
{
- void inputMethodEvent(QInputMethodEvent *) { ++eventCalls; }
- QVariant inputMethodQuery(Qt::InputMethodQuery) const { ++queryCalls; return QVariant(); }
+ void inputMethodEvent(QInputMethodEvent *) override { ++eventCalls; }
+ QVariant inputMethodQuery(Qt::InputMethodQuery) const override
+ {
+ ++queryCalls;
+ return QVariant();
+ }
+
public:
- int eventCalls;
- mutable int queryCalls;
+ int eventCalls = 0;
+ mutable int queryCalls = 0;
};
void tst_QGraphicsScene::inputMethod()
{
PlatformInputContext inputContext;
- QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod());
+ QInputMethodPrivate *inputMethodPrivate =
+ QInputMethodPrivate::get(QGuiApplication::inputMethod());
inputMethodPrivate->testContext = &inputContext;
- QFETCH(int, flags);
+ QFETCH(QGraphicsItem::GraphicsItemFlags, flags);
QFETCH(bool, callFocusItem);
InputMethodTester *item = new InputMethodTester;
- item->setFlags((QGraphicsItem::GraphicsItemFlags)flags);
+ item->setFlags(flags);
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.resize(m_testSize);
view.show();
+ view.setWindowTitle(QTest::currentTestFunction());
QApplication::setActiveWindow(&view);
view.setFocus();
QVERIFY(QTest::qWaitForWindowActive(&view));
- QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+ QCOMPARE(QApplication::activeWindow(), &view);
inputContext.m_resetCallCount = 0;
inputContext.m_commitCallCount = 0;
@@ -3782,25 +3840,25 @@ void tst_QGraphicsScene::inputMethod()
QCOMPARE(inputContext.m_resetCallCount, 0);
item->eventCalls = 0;
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
QCOMPARE(item->eventCalls, callFocusItem ? 1 : 0);
item->queryCalls = 0;
- scene.inputMethodQuery((Qt::InputMethodQuery)0);
+ scene.inputMethodQuery(Qt::InputMethodQuery(0));
QCOMPARE(item->queryCalls, callFocusItem ? 1 : 0);
- scene.setFocusItem(0);
+ scene.setFocusItem(nullptr);
// the input context is reset twice, once because an item has lost focus and again because
// the Qt::WA_InputMethodEnabled flag is cleared because no item has focus.
QCOMPARE(inputContext.m_resetCallCount + inputContext.m_commitCallCount, callFocusItem ? 2 : 0);
QCOMPARE(item->queryCalls, callFocusItem ? 1 : 0); // verify that value is unaffected
item->eventCalls = 0;
- qApp->sendEvent(&scene, &event);
+ QCoreApplication::sendEvent(&scene, &event);
QCOMPARE(item->eventCalls, 0);
item->queryCalls = 0;
- scene.inputMethodQuery((Qt::InputMethodQuery)0);
+ scene.inputMethodQuery(Qt::InputMethodQuery(0));
QCOMPARE(item->queryCalls, 0);
}
@@ -3824,18 +3882,18 @@ void tst_QGraphicsScene::dispatchHoverOnPress()
me.setButtons(Qt::LeftButton);
QGraphicsSceneMouseEvent me2(QEvent::GraphicsSceneMouseRelease);
me2.setButton(Qt::LeftButton);
- qApp->sendEvent(&scene, &me);
- qApp->sendEvent(&scene, &me2);
- QCOMPARE(tester1->eventTypes, QList<QEvent::Type>()
+ QCoreApplication::sendEvent(&scene, &me);
+ QCoreApplication::sendEvent(&scene, &me2);
+ QCOMPARE(tester1->eventTypes, QVector<QEvent::Type>()
<< QEvent::GraphicsSceneHoverEnter
<< QEvent::GraphicsSceneHoverMove
<< QEvent::GrabMouse
<< QEvent::GraphicsSceneMousePress
<< QEvent::UngrabMouse);
tester1->eventTypes.clear();
- qApp->sendEvent(&scene, &me);
- qApp->sendEvent(&scene, &me2);
- QCOMPARE(tester1->eventTypes, QList<QEvent::Type>()
+ QCoreApplication::sendEvent(&scene, &me);
+ QCoreApplication::sendEvent(&scene, &me2);
+ QCOMPARE(tester1->eventTypes, QVector<QEvent::Type>()
<< QEvent::GraphicsSceneHoverMove
<< QEvent::GrabMouse
<< QEvent::GraphicsSceneMousePress
@@ -3850,21 +3908,21 @@ void tst_QGraphicsScene::dispatchHoverOnPress()
me2.setScenePos(QPointF(30, 30));
me2.setButton(Qt::LeftButton);
tester1->eventTypes.clear();
- qApp->sendEvent(&scene, &me);
- qApp->sendEvent(&scene, &me2);
- qDebug() << tester1->eventTypes;
- QCOMPARE(tester1->eventTypes, QList<QEvent::Type>()
+ QCoreApplication::sendEvent(&scene, &me);
+ QCoreApplication::sendEvent(&scene, &me2);
+ qCDebug(lcTests) << tester1->eventTypes;
+ QCOMPARE(tester1->eventTypes, QVector<QEvent::Type>()
<< QEvent::GraphicsSceneHoverLeave);
- QCOMPARE(tester2->eventTypes, QList<QEvent::Type>()
+ QCOMPARE(tester2->eventTypes, QVector<QEvent::Type>()
<< QEvent::GraphicsSceneHoverEnter
<< QEvent::GraphicsSceneHoverMove
<< QEvent::GrabMouse
<< QEvent::GraphicsSceneMousePress
<< QEvent::UngrabMouse);
tester2->eventTypes.clear();
- qApp->sendEvent(&scene, &me);
- qApp->sendEvent(&scene, &me2);
- QCOMPARE(tester2->eventTypes, QList<QEvent::Type>()
+ QCoreApplication::sendEvent(&scene, &me);
+ QCoreApplication::sendEvent(&scene, &me2);
+ QCOMPARE(tester2->eventTypes, QVector<QEvent::Type>()
<< QEvent::GraphicsSceneHoverMove
<< QEvent::GrabMouse
<< QEvent::GraphicsSceneMousePress
@@ -3913,7 +3971,7 @@ void tst_QGraphicsScene::initialFocus()
if (activeScene) {
QEvent windowActivate(QEvent::WindowActivate);
- qApp->sendEvent(&scene, &windowActivate);
+ QCoreApplication::sendEvent(&scene, &windowActivate);
scene.setFocus();
}
@@ -3921,7 +3979,7 @@ void tst_QGraphicsScene::initialFocus()
if (!activeScene) {
QEvent windowActivate(QEvent::WindowActivate);
- qApp->sendEvent(&scene, &windowActivate);
+ QCoreApplication::sendEvent(&scene, &windowActivate);
scene.setFocus();
}
@@ -3931,14 +3989,13 @@ void tst_QGraphicsScene::initialFocus()
class PolishItem : public QGraphicsTextItem
{
public:
- PolishItem(QGraphicsItem *parent = 0)
- : QGraphicsTextItem(parent), polished(false), deleteChildrenInPolish(true), addChildrenInPolish(false) { }
+ using QGraphicsTextItem::QGraphicsTextItem;
- bool polished;
- bool deleteChildrenInPolish;
- bool addChildrenInPolish;
+ bool polished = false;
+ bool deleteChildrenInPolish = true;
+ bool addChildrenInPolish = false;
protected:
- QVariant itemChange(GraphicsItemChange change, const QVariant& value)
+ QVariant itemChange(GraphicsItemChange change, const QVariant& value) override
{
if (change == ItemVisibleChange) {
polished = true;
@@ -3977,19 +4034,19 @@ void tst_QGraphicsScene::polishItems2()
// Wait for the polish event to be delivered.
QVERIFY(!item->polished);
- QApplication::sendPostedEvents(&scene, QEvent::MetaCall);
+ QCoreApplication::sendPostedEvents(&scene, QEvent::MetaCall);
QVERIFY(item->polished);
// We deleted the children we added above, but we also
// added 10 new children. These should be polished in the next
// event loop iteration.
- QList<QGraphicsItem *> children = item->childItems();
+ const QList<QGraphicsItem *> children = item->childItems();
QCOMPARE(children.count(), 10);
- foreach (QGraphicsItem *child, children)
+ for (QGraphicsItem *child : children)
QVERIFY(!static_cast<PolishItem *>(child)->polished);
- QApplication::sendPostedEvents(&scene, QEvent::MetaCall);
- foreach (QGraphicsItem *child, children)
+ QCoreApplication::sendPostedEvents(&scene, QEvent::MetaCall);
+ for (QGraphicsItem *child : children)
QVERIFY(static_cast<PolishItem *>(child)->polished);
}
@@ -4006,6 +4063,8 @@ void tst_QGraphicsScene::isActive()
{
QWidget toplevel1;
+ toplevel1.setWindowTitle(QTest::currentTestFunction());
+ toplevel1.resize(m_testSize);
QHBoxLayout *layout = new QHBoxLayout;
toplevel1.setLayout(layout);
QGraphicsView *view1 = new QGraphicsView(&scene1);
@@ -4071,8 +4130,9 @@ void tst_QGraphicsScene::isActive()
{
- const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
QWidget toplevel2;
+ toplevel2.setWindowTitle(QTest::currentTestFunction());
+ toplevel2.resize(m_testSize);
QHBoxLayout *layout = new QHBoxLayout;
toplevel2.setLayout(layout);
QGraphicsView *view1 = new QGraphicsView(&scene1);
@@ -4085,7 +4145,7 @@ void tst_QGraphicsScene::isActive()
QVERIFY(!scene1.hasFocus());
QVERIFY(!scene2.hasFocus());
- toplevel2.move(availableGeometry.topLeft() + QPoint(50, 50));
+ toplevel2.move(m_availableGeometry.topLeft() + QPoint(50, 50));
toplevel2.show();
QApplication::setActiveWindow(&toplevel2);
QVERIFY(QTest::qWaitForWindowActive(&toplevel2));
@@ -4134,12 +4194,13 @@ void tst_QGraphicsScene::isActive()
QVERIFY(!scene2.hasFocus());
QGraphicsView topLevelView;
- topLevelView.move(availableGeometry.topLeft() + QPoint(500, 50));
+ topLevelView.move(toplevel2.geometry().topRight() + QPoint(100, 50));
+ topLevelView.resize(m_testSize);
topLevelView.show();
QApplication::setActiveWindow(&topLevelView);
topLevelView.setFocus();
QVERIFY(QTest::qWaitForWindowActive(&topLevelView));
- QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&topLevelView));
+ QCOMPARE(QApplication::activeWindow(), &topLevelView);
QVERIFY(!scene1.isActive());
QVERIFY(!scene2.isActive());
@@ -4180,6 +4241,7 @@ void tst_QGraphicsScene::isActive()
{
QWidget toplevel3;
+ toplevel3.resize(m_testSize);
QHBoxLayout *layout = new QHBoxLayout;
toplevel3.setLayout(layout);
QGraphicsView *view1 = new QGraphicsView(&scene1);
@@ -4209,7 +4271,7 @@ void tst_QGraphicsScene::isActive()
QVERIFY(scene1.hasFocus());
QVERIFY(!scene2.hasFocus());
- view1->setParent(0);
+ view1->setParent(nullptr);
QVERIFY(!scene1.isActive());
QVERIFY(scene2.isActive());
QVERIFY(!scene1.hasFocus());
@@ -4241,7 +4303,7 @@ void tst_QGraphicsScene::siblingIndexAlwaysValid()
scene.addItem(parent2);
//Then we make the child a top level
- child->setParentItem(0);
+ child->setParentItem(nullptr);
//This is trigerred by a repaint...
QGraphicsScenePrivate::get(&scene)->index->estimateTopLevelItems(QRectF(), Qt::AscendingOrder);
@@ -4257,6 +4319,8 @@ void tst_QGraphicsScene::siblingIndexAlwaysValid()
scene2.setItemIndexMethod(QGraphicsScene::NoIndex);
QGraphicsView view2(&scene2);
+ view2.setWindowTitle(QTest::currentTestFunction());
+ view2.resize(m_testSize);
// first add the blue rect
QGraphicsRectItem* const item1 = new QGraphicsRectItem(QRect( 10, 10, 10, 10 ));
@@ -4300,9 +4364,11 @@ void tst_QGraphicsScene::removeFullyTransparentItem()
child->setParentItem(parent);
CustomView view;
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
view.setScene(&scene);
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
QCoreApplication::processEvents(); // Process all queued paint events
@@ -4351,33 +4417,35 @@ void tst_QGraphicsScene::taskQTBUG_5904_crashWithDeviceCoordinateCache()
void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
{
// Test using DeviceCoordinateCache and opaque item
- QWidget *w = new QWidget();
+ QScopedPointer<QWidget> w(new QWidget);
w->setPalette(QColor(0, 0, 255));
w->setGeometry(0, 0, 50, 50);
QGraphicsScene *scene = new QGraphicsScene();
- CustomView *view = new CustomView;
- view->setScene(scene);
+ CustomView view;
+ view.resize(m_testSize);
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.setScene(scene);
- QGraphicsProxyWidget *proxy = scene->addWidget(w);
+ QGraphicsProxyWidget *proxy = scene->addWidget(w.data());
proxy->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
proxy->setTransform(QTransform().rotate(15), true);
- view->show();
- QVERIFY(QTest::qWaitForWindowExposed(view));
- view->repaints = 0;
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ view.repaints = 0;
proxy->update(10, 10, 10, 10);
- QTRY_VERIFY(view->repaints > 0);
+ QTRY_VERIFY(view.repaints > 0);
QPixmap pix;
QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(proxy);
- QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->deviceData.value(view->viewport()).key, &pix));
+ QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->deviceData.value(view.viewport()).key, &pix));
QTransform t = proxy->sceneTransform();
// Map from scene coordinates to pixmap coordinates.
// X origin in the pixmap is the most-left point
// of the item's boundingRect in the scene.
- qreal adjust = t.mapRect(proxy->boundingRect().toRect()).left();
+ const int adjust = t.mapRect(proxy->boundingRect().toRect()).left();
QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
QPixmap subpix = pix.copy(rect);
@@ -4386,8 +4454,6 @@ void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
for(int j = 0; j < im.height(); j++)
QCOMPARE(qAlpha(im.pixel(i, j)), 255);
}
-
- delete w;
}
void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
@@ -4401,28 +4467,30 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
rectItem->setParentItem(backItem);
QGraphicsScene *scene = new QGraphicsScene();
- CustomView *view = new CustomView;
- view->setScene(scene);
+ CustomView view;
+ view.resize(m_testSize);
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.setScene(scene);
scene->addItem(backItem);
rectItem->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
backItem->setTransform(QTransform().rotate(15), true);
- view->show();
- QVERIFY(QTest::qWaitForWindowExposed(view));
- view->repaints = 0;
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ view.repaints = 0;
rectItem->update(10, 10, 10, 10);
- QTRY_VERIFY(view->repaints > 0);
+ QTRY_VERIFY(view.repaints > 0);
QPixmap pix;
QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(rectItem);
- QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->deviceData.value(view->viewport()).key, &pix));
+ QTRY_VERIFY(QPixmapCache::find(itemp->extraItemCache()->deviceData.value(view.viewport()).key, &pix));
QTransform t = rectItem->sceneTransform();
// Map from scene coordinates to pixmap coordinates.
// X origin in the pixmap is the most-left point
// of the item's boundingRect in the scene.
- qreal adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
+ const int adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
QPixmap subpix = pix.copy(rect);
@@ -4432,8 +4500,6 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
QCOMPARE(qAlpha(im.pixel(i, j)), 125);
}
}
-
- delete view;
}
// Test using ItemCoordinateCache and opaque item
@@ -4442,18 +4508,20 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
rectItem->setBrush(QColor(0, 0, 255));
QGraphicsScene *scene = new QGraphicsScene();
- CustomView *view = new CustomView;
- view->setScene(scene);
+ CustomView view;
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
+ view.setScene(scene);
scene->addItem(rectItem);
rectItem->setCacheMode(QGraphicsItem::ItemCoordinateCache);
rectItem->setTransform(QTransform().rotate(15), true);
- view->show();
- QVERIFY(QTest::qWaitForWindowExposed(view));
- view->repaints = 0;
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ view.repaints = 0;
rectItem->update(10, 10, 10, 10);
- QTRY_VERIFY(view->repaints > 0);
+ QTRY_VERIFY(view.repaints > 0);
QPixmap pix;
QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(rectItem);
@@ -4463,7 +4531,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
// Map from scene coordinates to pixmap coordinates.
// X origin in the pixmap is the most-left point
// of the item's boundingRect in the scene.
- qreal adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
+ const int adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
QPixmap subpix = pix.copy(rect);
@@ -4472,8 +4540,6 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
for(int j = 0; j < im.height(); j++)
QCOMPARE(qAlpha(im.pixel(i, j)), 255);
}
-
- delete view;
}
// Test using ItemCoordinateCache and semi-transparent item
@@ -4482,18 +4548,20 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
rectItem->setBrush(QColor(0, 0, 255, 125));
QGraphicsScene *scene = new QGraphicsScene();
- CustomView *view = new CustomView;
- view->setScene(scene);
+ CustomView view;
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
+ view.setScene(scene);
scene->addItem(rectItem);
rectItem->setCacheMode(QGraphicsItem::ItemCoordinateCache);
rectItem->setTransform(QTransform().rotate(15), true);
- view->show();
- QVERIFY(QTest::qWaitForWindowExposed(view));
- view->repaints = 0;
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ view.repaints = 0;
rectItem->update(10, 10, 10, 10);
- QTRY_VERIFY(view->repaints > 0);
+ QTRY_VERIFY(view.repaints > 0);
QPixmap pix;
QGraphicsItemPrivate* itemp = QGraphicsItemPrivate::get(rectItem);
@@ -4503,7 +4571,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
// Map from scene coordinates to pixmap coordinates.
// X origin in the pixmap is the most-left point
// of the item's boundingRect in the scene.
- qreal adjust = t.mapRect(rectItem->boundingRect().toRect()).left();
+ const int adjust = int(t.mapRect(rectItem->boundingRect().toRect()).left());
QRect rect = t.mapRect(QRect(10, 10, 10, 10)).adjusted(-adjust, 0, -adjust + 1, 1);
QPixmap subpix = pix.copy(rect);
@@ -4512,8 +4580,6 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
for(int j = 0; j < im.height(); j++)
QCOMPARE(qAlpha(im.pixel(i, j)), 125);
}
-
- delete view;
}
}
@@ -4544,7 +4610,7 @@ void tst_QGraphicsScene::zeroScale()
QGraphicsView view(&scene);
ChangedListener cl;
- connect(&scene, SIGNAL(changed(QList<QRectF>)), &cl, SLOT(changed(QList<QRectF>)));
+ connect(&scene, &QGraphicsScene::changed, &cl, &ChangedListener::changed);
QGraphicsRectItem *rect1 = new QGraphicsRectItem(0, 0, 0.0000001, 0.00000001);
scene.addItem(rect1);
@@ -4567,13 +4633,13 @@ void tst_QGraphicsScene::focusItemChangedSignal()
qRegisterMetaType<Qt::FocusReason>("Qt::FocusReason");
QGraphicsScene scene;
- QSignalSpy spy(&scene, SIGNAL(focusItemChanged(QGraphicsItem *, QGraphicsItem *, Qt::FocusReason)));
+ QSignalSpy spy(&scene, &QGraphicsScene::focusItemChanged);
QVERIFY(spy.isValid());
QCOMPARE(spy.count(), 0);
scene.setFocus();
QCOMPARE(spy.count(), 0);
QEvent activateEvent(QEvent::WindowActivate);
- qApp->sendEvent(&scene, &activateEvent);
+ QCoreApplication::sendEvent(&scene, &activateEvent);
QCOMPARE(spy.count(), 0);
QGraphicsRectItem *topLevelItem1 = new QGraphicsRectItem;
@@ -4590,7 +4656,7 @@ void tst_QGraphicsScene::focusItemChangedSignal()
QCOMPARE(spy.count(), 1);
QList<QVariant> arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), topLevelItem2);
QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), nullptr);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::OtherFocusReason);
QVERIFY(topLevelItem2->hasFocus());
@@ -4600,14 +4666,14 @@ void tst_QGraphicsScene::focusItemChangedSignal()
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), nullptr);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), topLevelItem2);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::OtherFocusReason);
scene.setFocus(Qt::MenuBarFocusReason);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), topLevelItem2);
QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), nullptr);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::MenuBarFocusReason);
@@ -4615,15 +4681,15 @@ void tst_QGraphicsScene::focusItemChangedSignal()
topLevelItem1->setFocus(Qt::TabFocusReason);
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem1);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), topLevelItem1);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), topLevelItem2);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::TabFocusReason);
topLevelItem2->setFocus(Qt::TabFocusReason);
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)topLevelItem2);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem1);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), topLevelItem2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), topLevelItem1);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::TabFocusReason);
}
@@ -4631,10 +4697,10 @@ void tst_QGraphicsScene::focusItemChangedSignal()
// when the scene activation changes) breaks quite a few tests so leave this fix
// for some future release. See QTBUG-28346.
QEvent deactivateEvent(QEvent::WindowDeactivate);
- qApp->sendEvent(&scene, &deactivateEvent);
+ QCoreApplication::sendEvent(&scene, &deactivateEvent);
QEXPECT_FAIL("", "QTBUG-28346", Continue);
QCOMPARE(spy.count(), 1);
- qApp->sendEvent(&scene, &activateEvent);
+ QCoreApplication::sendEvent(&scene, &activateEvent);
QEXPECT_FAIL("", "QTBUG-28346", Continue);
QCOMPARE(spy.count(), 1);
@@ -4645,8 +4711,8 @@ void tst_QGraphicsScene::focusItemChangedSignal()
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel1);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)topLevelItem2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), panel1);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), topLevelItem2);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason);
QGraphicsRectItem *panel2 = new QGraphicsRectItem;
@@ -4659,16 +4725,16 @@ void tst_QGraphicsScene::focusItemChangedSignal()
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel2);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)panel1);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), panel2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), panel1);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason);
scene.setActivePanel(panel1);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
QCOMPARE(arguments.size(), 3);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), (QGraphicsItem *)panel1);
- QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), (QGraphicsItem *)panel2);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(0)), panel1);
+ QCOMPARE(qvariant_cast<QGraphicsItem *>(arguments.at(1)), panel2);
QCOMPARE(qvariant_cast<Qt::FocusReason>(arguments.at(2)), Qt::ActiveWindowFocusReason);
}
@@ -4677,14 +4743,15 @@ void tst_QGraphicsScene::focusItemChangedSignal()
class ItemCountsPaintCalls : public QGraphicsRectItem
{
public:
- ItemCountsPaintCalls(const QRectF & rect, QGraphicsItem *parent = 0)
- : QGraphicsRectItem(rect, parent), repaints(0) {}
- void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 )
+ using QGraphicsRectItem::QGraphicsRectItem;
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget = nullptr) override
{
QGraphicsRectItem::paint(painter, option, widget);
++repaints;
}
- int repaints;
+ int repaints = 0;
};
void tst_QGraphicsScene::minimumRenderSize()
@@ -4698,10 +4765,12 @@ void tst_QGraphicsScene::minimumRenderSize()
scene.addItem(bigParent);
CustomView view;
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
view.setScene(&scene);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- qApp->processEvents();
+ QCoreApplication::processEvents();
// Initially, everything should be repainted the same number of times
int viewRepaints = 0;
@@ -4714,7 +4783,7 @@ void tst_QGraphicsScene::minimumRenderSize()
// Setting a minimum render size should cause a repaint
scene.setMinimumRenderSize(0.5);
- qApp->processEvents();
+ QCoreApplication::processEvents();
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
@@ -4725,7 +4794,7 @@ void tst_QGraphicsScene::minimumRenderSize()
// Scaling should cause a repaint of big items only.
view.scale(0.1, 0.1);
- qApp->processEvents();
+ QCoreApplication::processEvents();
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
@@ -4736,7 +4805,7 @@ void tst_QGraphicsScene::minimumRenderSize()
// Scaling further should cause even fewer items to be repainted
view.scale(0.1, 0.1); // Stacks with previous scale
- qApp->processEvents();
+ QCoreApplication::processEvents();
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
@@ -4750,6 +4819,8 @@ void tst_QGraphicsScene::focusOnTouch()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
scene.setSceneRect(0, 0, 100, 100);
QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
rect->setFlag(QGraphicsItem::ItemIsFocusable, true);
@@ -4807,6 +4878,7 @@ void tst_QGraphicsScene::taskQTBUG_16401_focusItem()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.resize(m_testSize);
QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
rect->setFlag(QGraphicsItem::ItemIsFocusable);
@@ -4837,6 +4909,8 @@ void tst_QGraphicsScene::taskQTBUG_42915_focusNextPrevChild()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
+ view.resize(m_testSize);
scene.setSceneRect(1, 1, 198, 198);
view.setFocus();
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
index ee13a37212..9b76ea02ff 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
@@ -1,20 +1,16 @@
[task255529_transformationAnchorMouseAndViewportMargins]
-xcb
+opensuse-leap
[cursor]
-xcb
+opensuse-leap
[cursor2]
-xcb
-windows
-[rubberBandExtendSelection]
-xcb
-[rotated_rubberBand]
-xcb
+ubuntu-16.04
[sendEvent]
-xcb
-[forwardMousePress]
-xcb
+ubuntu-16.04
+opensuse-42.3
[resizeAnchor]
-xcb
+opensuse-leap
+rhel-7.6
+ubuntu
[update2]
opensuse-42.3
[itemsInRect_cosmeticAdjust]
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 1442219bea..e21b1b889a 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -352,8 +352,8 @@ void tst_QGraphicsView::renderHints()
view.setScene(&scene);
- view.setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing | QPainter::NonCosmeticDefaultPen);
- QCOMPARE(view.renderHints(), QPainter::TextAntialiasing | QPainter::Antialiasing | QPainter::NonCosmeticDefaultPen);
+ view.setRenderHints(QPainter::TextAntialiasing | QPainter::Antialiasing);
+ QCOMPARE(view.renderHints(), QPainter::TextAntialiasing | QPainter::Antialiasing);
QCOMPARE(item->hints, 0);
view.show();
@@ -361,8 +361,8 @@ void tst_QGraphicsView::renderHints()
view.repaint();
QTRY_COMPARE(item->hints, view.renderHints());
- view.setRenderHints(QPainter::Antialiasing | QPainter::NonCosmeticDefaultPen);
- QCOMPARE(view.renderHints(), QPainter::Antialiasing | QPainter::NonCosmeticDefaultPen);
+ view.setRenderHints(QPainter::Antialiasing);
+ QCOMPARE(view.renderHints(), QPainter::Antialiasing);
view.repaint();
QTRY_COMPARE(item->hints, view.renderHints());
@@ -2219,7 +2219,7 @@ void tst_QGraphicsView::wheelEvent()
{
QWheelEvent event(view.mapFromScene(widget->boundingRect().center()),
view.mapToGlobal(view.mapFromScene(widget->boundingRect().center())),
- 120, 0, 0, Qt::Horizontal);
+ QPoint(), QPoint(120, 0), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QApplication::sendEvent(view.viewport(), &event);
QCOMPARE(scene.orientation, Qt::Horizontal);
}
@@ -2228,7 +2228,7 @@ void tst_QGraphicsView::wheelEvent()
{
QWheelEvent event(view.mapFromScene(widget->boundingRect().center()),
view.mapToGlobal(view.mapFromScene(widget->boundingRect().center())),
- 120, 0, 0, Qt::Vertical);
+ QPoint(), QPoint(0, 120), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QApplication::sendEvent(view.viewport(), &event);
QCOMPARE(scene.orientation, Qt::Vertical);
}
@@ -2526,9 +2526,8 @@ void tst_QGraphicsView::viewportUpdateMode2()
view.setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);
view.setScene(&dummyScene);
view.ensurePolished(); // make sure we get the right content margins
- int left, top, right, bottom;
- view.getContentsMargins(&left, &top, &right, &bottom);
- view.resize(200 + left + right, 200 + top + bottom);
+ const QMargins margins = view.contentsMargins();
+ view.resize(200 + margins.left() + margins.right(), 200 + margins.top() + margins.bottom());
toplevel.show();
qApp->setActiveWindow(&toplevel);
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
@@ -2611,11 +2610,6 @@ void tst_QGraphicsView::optimizationFlags()
QGraphicsView view;
QVERIFY(!view.optimizationFlags());
- view.setOptimizationFlag(QGraphicsView::DontClipPainter);
- QVERIFY(view.optimizationFlags() & QGraphicsView::DontClipPainter);
- view.setOptimizationFlag(QGraphicsView::DontClipPainter, false);
- QVERIFY(!view.optimizationFlags());
-
view.setOptimizationFlag(QGraphicsView::DontSavePainterState);
QVERIFY(view.optimizationFlags() & QGraphicsView::DontSavePainterState);
view.setOptimizationFlag(QGraphicsView::DontSavePainterState, false);
@@ -2626,10 +2620,8 @@ void tst_QGraphicsView::optimizationFlags()
view.setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing, false);
QVERIFY(!view.optimizationFlags());
- view.setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing
- | QGraphicsView::DontClipPainter);
- QCOMPARE(view.optimizationFlags(), QGraphicsView::OptimizationFlags(QGraphicsView::DontAdjustForAntialiasing
- | QGraphicsView::DontClipPainter));
+ view.setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing);
+ QCOMPARE(view.optimizationFlags(), QGraphicsView::OptimizationFlags(QGraphicsView::DontAdjustForAntialiasing));
}
class MessUpPainterItem : public QGraphicsRectItem
@@ -4043,9 +4035,8 @@ void tst_QGraphicsView::update()
CustomView view(0, &toplevel);
view.setScene(&dummyScene);
view.ensurePolished(); // must ensure polished to get content margins right
- int left, top, right, bottom;
- view.getContentsMargins(&left, &top, &right, &bottom);
- view.resize(200 + left + right, 200 + top + bottom);
+ const QMargins margins = view.contentsMargins();
+ view.resize(200 + margins.left() + margins.right(), 200 + margins.top() + margins.bottom());
toplevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
@@ -4857,7 +4848,7 @@ void tst_QGraphicsView::QTBUG_16063_microFocusRect()
scene.setFocusItem(item);
view.setFocus();
- QRectF mfv = view.inputMethodQuery(Qt::ImMicroFocus).toRectF();
+ QRectF mfv = view.inputMethodQuery(Qt::ImCursorRectangle).toRectF();
QCOMPARE(mfv, IMItem::mf.translated(-view.mapToScene(view.sceneRect().toRect()).boundingRect().topLeft()));
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 85b42e54fe..d3477be986 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -2905,7 +2905,7 @@ public:
Q_UNUSED(widget);
qreal w = rect().width();
QRectF box(0, 0, w, 2400/w);
- painter->drawRoundRect(box);
+ painter->drawRoundedRect(box, 25, 25, Qt::RelativeSize);
painter->drawLine(box.topLeft(), box.bottomRight());
painter->drawLine(box.bottomLeft(), box.topRight());
}
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 6f7dca86eb..bcfc477733 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -1024,9 +1024,6 @@ void tst_QAbstractItemView::setItemDelegate()
centerOnScreen(&v);
moveCursorAway(&v);
v.show();
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- QCursor::setPos(v.geometry().center());
-#endif
QApplication::setActiveWindow(&v);
QVERIFY(QTest::qWaitForWindowActive(&v));
diff --git a/tests/auto/widgets/itemviews/qcolumnview/BLACKLIST b/tests/auto/widgets/itemviews/qcolumnview/BLACKLIST
deleted file mode 100644
index bda01c700c..0000000000
--- a/tests/auto/widgets/itemviews/qcolumnview/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[scrollTo:reverse]
-osx
diff --git a/tests/auto/widgets/itemviews/qheaderview/BLACKLIST b/tests/auto/widgets/itemviews/qheaderview/BLACKLIST
index efb813f7d2..4eceaae0d3 100644
--- a/tests/auto/widgets/itemviews/qheaderview/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qheaderview/BLACKLIST
@@ -1,3 +1,2 @@
[stretchAndRestoreLastSection]
-opensuse
opensuse-leap
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 1b3e1e1f34..0b120985ee 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -85,8 +85,8 @@ class XResetModel : public QStandardItemModel
blockSignals(true);
bool r = QStandardItemModel::removeRows(row, count, parent);
blockSignals(false);
- emit beginResetModel();
- emit endResetModel();
+ beginResetModel();
+ endResetModel();
return r;
}
virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex())
@@ -94,8 +94,8 @@ class XResetModel : public QStandardItemModel
blockSignals(true);
bool r = QStandardItemModel::insertRows(row, count, parent);
blockSignals(false);
- emit beginResetModel();
- emit endResetModel();
+ beginResetModel();
+ endResetModel();
return r;
}
};
@@ -106,6 +106,7 @@ class tst_QHeaderView : public QObject
public:
tst_QHeaderView();
+ static void initMain();
private slots:
void initTestCase();
@@ -215,6 +216,7 @@ private slots:
void QTBUG14242_hideSectionAutoSize();
void QTBUG50171_visualRegionForSwappedItems();
void QTBUG53221_assertShiftHiddenRow();
+ void QTBUG75615_sizeHintWithStylesheet();
void ensureNoIndexAtLength();
void offsetConsistent();
@@ -265,6 +267,14 @@ protected:
QElapsedTimer timer;
};
+void tst_QHeaderView::initMain()
+{
+#ifdef Q_OS_WIN
+ // Ensure minimum size constraints of framed windows on High DPI screens
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+#endif
+}
+
class QtTestModel: public QAbstractTableModel
{
@@ -2597,6 +2607,26 @@ void tst_QHeaderView::QTBUG53221_assertShiftHiddenRow()
QCOMPARE(tableView.verticalHeader()->isSectionHidden(2), true);
}
+void tst_QHeaderView::QTBUG75615_sizeHintWithStylesheet()
+{
+ QTableView tableView;
+ QStandardItemModel model(1, 1);
+ tableView.setModel(&model);
+ tableView.show();
+
+ const auto headerView = tableView.horizontalHeader();
+ const auto oldSizeHint = headerView->sizeHint();
+ QVERIFY(oldSizeHint.isValid());
+
+ tableView.setStyleSheet("QTableView QHeaderView::section { height: 100px;}");
+ QCOMPARE(headerView->sizeHint().width(), oldSizeHint.width());
+ QCOMPARE(headerView->sizeHint().height(), 100);
+
+ tableView.setStyleSheet("QTableView QHeaderView::section { width: 100px;}");
+ QCOMPARE(headerView->sizeHint().height(), oldSizeHint.height());
+ QCOMPARE(headerView->sizeHint().width(), 100);
+}
+
void protected_QHeaderView::testVisualRegionForSelection()
{
QRegion r = visualRegionForSelection(QItemSelection(model()->index(1, 0), model()->index(1, 2)));
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
index 10cd1dcc54..916694fd0f 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
+++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
@@ -3,4 +3,4 @@ TARGET = tst_qitemdelegate
QT += widgets widgets-private testlib
SOURCES += tst_qitemdelegate.cpp
-win32:!winrt: LIBS += -luser32
+win32:!winrt: QMAKE_USE += user32
diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
index 75f45ab432..c3e19adc81 100644
--- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro
+++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
@@ -2,4 +2,4 @@ CONFIG += testcase
TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib testlib-private
SOURCES += tst_qlistview.cpp
-win32:!winrt: LIBS += -luser32
+win32:!winrt: QMAKE_USE += user32
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 0b828b8484..3a60b3b7c6 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -2516,9 +2516,9 @@ void tst_QListView::horizontalScrollingByVerticalWheelEvents()
QPoint globalPos = lv.geometry().center();
QPoint pos = lv.viewport()->geometry().center();
- QWheelEvent wheelDownEvent(pos, globalPos, QPoint(0, 0), QPoint(0, -120), -120, Qt::Vertical, 0, 0);
- QWheelEvent wheelUpEvent(pos, globalPos, QPoint(0, 0), QPoint(0, 120), 120, Qt::Vertical, 0, 0);
- QWheelEvent wheelLeftDownEvent(pos, globalPos, QPoint(0, 0), QPoint(120, -120), -120, Qt::Vertical, 0, 0);
+ QWheelEvent wheelDownEvent(pos, globalPos, QPoint(0, 0), QPoint(0, -120), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
+ QWheelEvent wheelUpEvent(pos, globalPos, QPoint(0, 0), QPoint(0, 120), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
+ QWheelEvent wheelLeftDownEvent(pos, globalPos, QPoint(0, 0), QPoint(120, -120), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
int hValue = lv.horizontalScrollBar()->value();
QApplication::sendEvent(lv.viewport(), &wheelDownEvent);
diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
index 91088aeeca..fe2ede4183 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
@@ -1525,11 +1525,11 @@ void tst_QListWidget::itemData()
item.setData(Qt::DisplayRole, QString("0"));
QCOMPARE(widget.currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
item.setData(Qt::CheckStateRole, Qt::PartiallyChecked);
- QCOMPARE(widget.currentRoles, {Qt::CheckStateRole});
+ QCOMPARE(widget.currentRoles, QVector<int>{Qt::CheckStateRole});
for (int i = 0; i < 4; ++i)
{
item.setData(Qt::UserRole + i, QString::number(i + 1));
- QCOMPARE(widget.currentRoles, {Qt::UserRole + i});
+ QCOMPARE(widget.currentRoles, QVector<int>{Qt::UserRole + i});
}
QMap<int, QVariant> flags = widget.model()->itemData(widget.model()->index(0, 0));
QCOMPARE(flags.count(), 6);
diff --git a/tests/auto/widgets/itemviews/qtableview/BLACKLIST b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
index be90475a6f..9648cef3de 100644
--- a/tests/auto/widgets/itemviews/qtableview/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
@@ -1,4 +1,3 @@
[moveCursorBiggerJump]
osx
-[columnViewportPosition]
-winrt # QTBUG-72853
+
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index c8eecd3693..3e0d2539b4 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -26,16 +26,24 @@
**
****************************************************************************/
-
-#include <QtGui/QtGui>
-#include <QtWidgets/QtWidgets>
+#include <QIdentityProxyModel>
+#include <QLabel>
+#include <QLineEdit>
+#include <QScrollBar>
+#include <QSignalSpy>
+#include <QSortFilterProxyModel>
+#include <QStandardItemModel>
+#include <QStringListModel>
+#include <QStyledItemDelegate>
+#include <QTableView>
+#include <QTest>
+#include <private/qapplication_p.h>
#include <private/qtablewidget_p.h>
-#include <QtTest/QtTest>
-#include "private/qapplication_p.h"
-
-#include <algorithm>
+#include <private/qtesthelpers_p.h>
+#if QT_CONFIG(textmarkdownwriter)
+#include <private/qtextmarkdownwriter_p.h>
+#endif
-#include <QtTest/private/qtesthelpers_p.h>
using namespace QTestPrivate;
@@ -46,14 +54,241 @@ using namespace QTestPrivate;
#define VERIFY_SPANS_CONSISTENCY(TEST_VIEW_) (void)false
#endif
-typedef QList<int> IntList;
+Q_DECLARE_METATYPE(Qt::Key);
+Q_DECLARE_METATYPE(Qt::KeyboardModifier);
+Q_DECLARE_METATYPE(QItemSelectionModel::SelectionFlag);
+using BoolList = QVector<bool>;
+using IntList = QVector<int>;
+using KeyList = QVector<Qt::Key>;
+using SpanList = QVector<QRect>;
+
+class QtTestTableModel: public QAbstractTableModel
+{
+ Q_OBJECT
+
+signals:
+ void invalidIndexEncountered() const;
+
+public slots:
+ bool submit() override { ++submit_count; return QAbstractTableModel::submit(); }
+
+public:
+ QtTestTableModel(int rows = 0, int columns = 0, QObject *parent = nullptr)
+ : QAbstractTableModel(parent), row_count(rows), column_count(columns)
+ {}
+
+ int rowCount(const QModelIndex& = QModelIndex()) const override
+ {
+ return row_count;
+ }
+
+ int columnCount(const QModelIndex& = QModelIndex()) const override
+ {
+ return column_count;
+ }
+
+ bool isEditable(const QModelIndex &) const { return true; }
+
+ Qt::ItemFlags flags(const QModelIndex &index) const override
+ {
+ Qt::ItemFlags index_flags = QAbstractTableModel::flags(index);
+ if (disabled_rows.contains(index.row())
+ || disabled_columns.contains(index.column()))
+ index_flags &= ~Qt::ItemIsEnabled;
+ return index_flags;
+ }
+
+ void disableRow(int row)
+ {
+ disabled_rows.insert(row);
+ }
+
+ void enableRow(int row)
+ {
+ disabled_rows.remove(row);
+ }
+
+ void disableColumn(int column)
+ {
+ disabled_columns.insert(column);
+ }
+
+ void enableColumn(int column)
+ {
+ disabled_columns.remove(column);
+ }
+
+ QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override
+ {
+ if (!idx.isValid() || idx.row() >= row_count || idx.column() >= column_count) {
+ qWarning() << "Invalid modelIndex [%d,%d,%p]" << idx;
+ emit invalidIndexEncountered();
+ return QVariant();
+ }
+
+ if (role == Qt::DisplayRole || role == Qt::EditRole) {
+ return QLatin1Char('[') + QString::number(idx.row()) + QLatin1Char(',')
+ + QString::number(idx.column()) + QLatin1String(",0]");
+ }
-typedef QList<bool> BoolList;
+ return QVariant();
+ }
+
+ bool insertRows(int start, int count, const QModelIndex &parent = QModelIndex()) override
+ {
+ if (start < 0 || start > row_count)
+ return false;
+
+ beginInsertRows(parent, start, start + count - 1);
+ row_count += count;
+ endInsertRows();
+ return true;
+ }
+
+ bool removeRows(int start, int count, const QModelIndex &parent = QModelIndex()) override
+ {
+ if (start < 0 || start >= row_count || row_count < count)
+ return false;
+
+ beginRemoveRows(parent, start, start + count - 1);
+ row_count -= count;
+ endRemoveRows();
+ return true;
+ }
+
+ void removeLastRow()
+ {
+ beginRemoveRows(QModelIndex(), row_count - 1, row_count - 1);
+ --row_count;
+ endRemoveRows();
+ }
+
+ void removeAllRows()
+ {
+ beginRemoveRows(QModelIndex(), 0, row_count - 1);
+ row_count = 0;
+ endRemoveRows();
+ }
+
+ bool insertColumns(int start, int count, const QModelIndex &parent = QModelIndex()) override
+ {
+ if (start < 0 || start > column_count)
+ return false;
+
+ beginInsertColumns(parent, start, start + count - 1);
+ column_count += count;
+ endInsertColumns();
+ return true;
+ }
+
+ bool removeColumns(int start, int count, const QModelIndex &parent = QModelIndex()) override
+ {
+ if (start < 0 || start >= column_count || column_count < count)
+ return false;
+
+ beginRemoveColumns(parent, start, start + count - 1);
+ column_count -= count;
+ endRemoveColumns();
+ return true;
+ }
+
+ void removeLastColumn()
+ {
+ beginRemoveColumns(QModelIndex(), column_count - 1, column_count - 1);
+ --column_count;
+ endRemoveColumns();
+ }
+
+ void removeAllColumns()
+ {
+ beginRemoveColumns(QModelIndex(), 0, column_count - 1);
+ column_count = 0;
+ endRemoveColumns();
+ }
+
+ bool canFetchMore(const QModelIndex &) const override
+ {
+ return can_fetch_more;
+ }
+
+ void fetchMore(const QModelIndex &) override
+ {
+ ++fetch_more_count;
+ }
+
+ QSet<int> disabled_rows;
+ QSet<int> disabled_columns;
+ int row_count;
+ int column_count;
+ int submit_count = 0;
+ int fetch_more_count = 0;
+ bool can_fetch_more = false;
+};
+
+class QtTestTableView : public QTableView
+{
+ Q_OBJECT
+public:
+ using QTableView::QTableView;
+
+ void setModel(QAbstractItemModel *model) override
+ {
+ QTableView::setModel(model);
+ connect(selectionModel(), &QItemSelectionModel::currentChanged,
+ this, &QtTestTableView::slotCurrentChanged);
+ connect(selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &QtTestTableView::itemSelectionChanged);
+ // Allow small sections in this test, since this test was made before we correctly enforced minimum sizes.
+ horizontalHeader()->setMinimumSectionSize(0);
+ verticalHeader()->setMinimumSectionSize(0);
+ }
+
+ using QTableView::moveCursor;
+ using QTableView::isIndexHidden;
+ using QTableView::setSelection;
+ using QTableView::selectedIndexes;
+ using QTableView::sizeHintForRow;
+ using QTableView::viewOptions;
+
+ bool checkSignalOrder = false;
+public slots:
+ void slotCurrentChanged(QModelIndex, QModelIndex) {
+ hasCurrentChanged++;
+ if (checkSignalOrder)
+ QVERIFY(hasCurrentChanged > hasSelectionChanged);
+ }
+
+ void itemSelectionChanged(QItemSelection , QItemSelection ) {
+ hasSelectionChanged++;
+ if (checkSignalOrder)
+ QVERIFY(hasCurrentChanged >= hasSelectionChanged);
+ }
+private:
+ int hasCurrentChanged = 0;
+ int hasSelectionChanged = 0;
+
+ friend class tst_QTableView;
+ friend struct QMetaTypeId<QtTestTableView::CursorAction>;
+};
+Q_DECLARE_METATYPE(QtTestTableView::CursorAction);
+
+class QtTestItemDelegate : public QStyledItemDelegate
+{
+public:
+ QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override
+ {
+ return hint;
+ }
+
+ QSize hint;
+};
class tst_QTableView : public QObject
{
Q_OBJECT
+private:
+ using CursorActionList = QVector<QtTestTableView::CursorAction>;
private slots:
void getSetCheck();
@@ -183,6 +418,7 @@ private slots:
void taskQTBUG_10169_sizeHintForRow();
void taskQTBUG_30653_doItemsLayout();
void taskQTBUG_50171_selectRowAfterSwapColumns();
+ void deselectRow();
#if QT_CONFIG(wheelevent)
void mouseWheel_data();
@@ -196,6 +432,10 @@ private slots:
void viewOptions();
void taskQTBUG_7232_AllowUserToControlSingleStep();
+
+#if QT_CONFIG(textmarkdownwriter)
+ void markdownWriter();
+#endif
};
// Testing get/set functions
@@ -229,14 +469,14 @@ void tst_QTableView::getSetCheck()
QHeaderView *var1 = new QHeaderView(Qt::Horizontal);
obj1.setHorizontalHeader(var1);
QCOMPARE(var1, obj1.horizontalHeader());
- obj1.setHorizontalHeader((QHeaderView *)0);
+ obj1.setHorizontalHeader(nullptr);
QCOMPARE(var1, obj1.horizontalHeader());
delete var1;
QHeaderView *var2 = new QHeaderView(Qt::Vertical);
obj1.setVerticalHeader(var2);
QCOMPARE(var2, obj1.verticalHeader());
- obj1.setVerticalHeader((QHeaderView *)0);
+ obj1.setVerticalHeader(nullptr);
QCOMPARE(var2, obj1.verticalHeader());
delete var2;
@@ -244,283 +484,12 @@ void tst_QTableView::getSetCheck()
obj1.setCornerButtonEnabled(false);
QCOMPARE(obj1.isCornerButtonEnabled(), false);
}
-
-class QtTestTableModel: public QAbstractTableModel
-{
- Q_OBJECT
-
-signals:
- void invalidIndexEncountered() const;
-
-public slots:
- bool submit() { ++submit_count; return QAbstractTableModel::submit(); }
-
-public:
- QtTestTableModel(int rows = 0, int columns = 0, QObject *parent = 0)
- : QAbstractTableModel(parent),
- row_count(rows),
- column_count(columns),
- submit_count(0),
- can_fetch_more(false),
- fetch_more_count(0),
- disabled_rows(),
- disabled_columns() {}
-
- int rowCount(const QModelIndex& = QModelIndex()) const { return row_count; }
- int columnCount(const QModelIndex& = QModelIndex()) const { return column_count; }
- bool isEditable(const QModelIndex &) const { return true; }
-
- Qt::ItemFlags flags(const QModelIndex &index) const
- {
- Qt::ItemFlags index_flags = QAbstractTableModel::flags(index);
- if (disabled_rows.contains(index.row())
- || disabled_columns.contains(index.column()))
- index_flags &= ~Qt::ItemIsEnabled;
- return index_flags;
- }
-
- void disableRow(int row)
- {
- disabled_rows.insert(row);
- }
-
- void enableRow(int row)
- {
- disabled_rows.remove(row);
- }
-
- void disableColumn(int column)
- {
- disabled_columns.insert(column);
- }
-
- void enableColumn(int column)
- {
- disabled_columns.remove(column);
- }
-
- QVariant data(const QModelIndex &idx, int role) const
- {
- if (!idx.isValid() || idx.row() >= row_count || idx.column() >= column_count) {
- qWarning() << "Invalid modelIndex [%d,%d,%p]" << idx;
- emit invalidIndexEncountered();
- return QVariant();
- }
-
- if (role == Qt::DisplayRole || role == Qt::EditRole) {
- return QLatin1Char('[') + QString::number(idx.row()) + QLatin1Char(',')
- + QString::number(idx.column()) + QLatin1String(",0]");
- }
-
- return QVariant();
- }
-
- bool insertRows(int start, int count, const QModelIndex &parent = QModelIndex())
- {
- if (start < 0 || start > row_count)
- return false;
-
- beginInsertRows(parent, start, start + count - 1);
- row_count += count;
- endInsertRows();
- return true;
- }
-
- bool removeRows(int start, int count, const QModelIndex &parent = QModelIndex())
- {
- if (start < 0 || start >= row_count || row_count < count)
- return false;
-
- beginRemoveRows(parent, start, start + count - 1);
- row_count -= count;
- endRemoveRows();
- return true;
- }
-
- void removeLastRow()
- {
- beginRemoveRows(QModelIndex(), row_count - 1, row_count - 1);
- --row_count;
- endRemoveRows();
- }
-
- void removeAllRows()
- {
- beginRemoveRows(QModelIndex(), 0, row_count - 1);
- row_count = 0;
- endRemoveRows();
- }
-
- bool insertColumns(int start, int count, const QModelIndex &parent = QModelIndex())
- {
- if (start < 0 || start > column_count)
- return false;
-
- beginInsertColumns(parent, start, start + count - 1);
- column_count += count;
- endInsertColumns();
- return true;
- }
-
- bool removeColumns(int start, int count, const QModelIndex &parent = QModelIndex())
- {
- if (start < 0 || start >= column_count || column_count < count)
- return false;
-
- beginRemoveColumns(parent, start, start + count - 1);
- column_count -= count;
- endRemoveColumns();
- return true;
- }
-
- void removeLastColumn()
- {
- beginRemoveColumns(QModelIndex(), column_count - 1, column_count - 1);
- --column_count;
- endRemoveColumns();
- }
-
- void removeAllColumns()
- {
- beginRemoveColumns(QModelIndex(), 0, column_count - 1);
- column_count = 0;
- endRemoveColumns();
- }
-
- bool canFetchMore(const QModelIndex &) const
- {
- return can_fetch_more;
- }
-
- void fetchMore(const QModelIndex &)
- {
- ++fetch_more_count;
- }
-
- void reset()
- {
- beginResetModel();
- endResetModel();
- }
-
- int row_count;
- int column_count;
- int submit_count;
- bool can_fetch_more;
- int fetch_more_count;
- QSet<int> disabled_rows;
- QSet<int> disabled_columns;
-};
-
-class QtTestTableView : public QTableView
-{
-Q_OBJECT
-
-public:
- QtTestTableView(QWidget *parent = 0) : QTableView(parent), checkSignalOrder(false), hasCurrentChanged(0), hasSelectionChanged(0) {}
-
- void setModel(QAbstractItemModel *model)
- {
- QTableView::setModel(model);
- connect(selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
- this, SLOT(slotCurrentChanged(QModelIndex,QModelIndex)));
- connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
- this, SLOT(itemSelectionChanged(QItemSelection,QItemSelection)));
- // Allow small sections in this test, since this test was made before we correctly enforced minimum sizes.
- horizontalHeader()->setMinimumSectionSize(0);
- verticalHeader()->setMinimumSectionSize(0);
- }
-
- // enum CursorAction and moveCursor() are protected in QTableView.
- enum CursorAction {
- MoveUp = QAbstractItemView::MoveUp,
- MoveDown = QAbstractItemView::MoveDown,
- MoveLeft = QAbstractItemView::MoveLeft,
- MoveRight = QAbstractItemView::MoveRight,
- MoveHome = QAbstractItemView::MoveHome,
- MoveEnd = QAbstractItemView::MoveEnd,
- MovePageUp = QAbstractItemView::MovePageUp,
- MovePageDown = QAbstractItemView::MovePageDown,
- MoveNext = QAbstractItemView::MoveNext,
- MovePrevious = QAbstractItemView::MovePrevious
- };
-
- QModelIndex doMoveCursor(QtTestTableView::CursorAction cursorAction,
- Qt::KeyboardModifiers modifiers)
- {
- return QTableView::moveCursor((QAbstractItemView::CursorAction)cursorAction, modifiers);
- }
-
- int columnWidthHint(int column) const
- {
- return sizeHintForColumn(column);
- }
-
- int rowHeightHint(int row) const
- {
- return sizeHintForRow(row);
- }
-
- bool isIndexHidden(const QModelIndex &index) const
- {
- return QTableView::isIndexHidden(index);
- }
-
- void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)
- {
- QTableView::setSelection(rect, command);
- }
-
- QModelIndexList selectedIndexes() const
- {
- return QTableView::selectedIndexes();
- }
-
- int sizeHintForRow(int row) const
- {
- return QTableView::sizeHintForRow(row);
- }
-
- QStyleOptionViewItem viewOptions() const {
- return QTableView::viewOptions();
- }
-
- bool checkSignalOrder;
-public slots:
- void slotCurrentChanged(QModelIndex, QModelIndex) {
- hasCurrentChanged++;
- if (checkSignalOrder)
- QVERIFY(hasCurrentChanged > hasSelectionChanged);
- }
-
- void itemSelectionChanged(QItemSelection , QItemSelection ) {
- hasSelectionChanged++;
- if (checkSignalOrder)
- QVERIFY(hasCurrentChanged >= hasSelectionChanged);
- }
-private:
- int hasCurrentChanged;
- int hasSelectionChanged;
-
-};
-
-class QtTestItemDelegate : public QItemDelegate
-{
-public:
- QSize sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const
- {
- return hint;
- }
-
- QSize hint;
-};
-
void tst_QTableView::noDelegate()
{
QtTestTableModel model(3, 3);
QTableView view;
view.setModel(&model);
- view.setItemDelegate(0);
+ view.setItemDelegate(nullptr);
view.show();
}
@@ -534,7 +503,7 @@ void tst_QTableView::emptyModel()
{
QtTestTableModel model;
QTableView view;
- QSignalSpy spy(&model, SIGNAL(invalidIndexEncountered()));
+ QSignalSpy spy(&model, &QtTestTableModel::invalidIndexEncountered);
view.setModel(&model);
view.show();
QCOMPARE(spy.count(), 0);
@@ -555,7 +524,7 @@ void tst_QTableView::removeRows()
QFETCH(int, columnCount);
QtTestTableModel model(rowCount, columnCount);
- QSignalSpy spy(&model, SIGNAL(invalidIndexEncountered()));
+ QSignalSpy spy(&model, &QtTestTableModel::invalidIndexEncountered);
QTableView view;
view.setModel(&model);
@@ -583,7 +552,7 @@ void tst_QTableView::removeColumns()
QFETCH(int, columnCount);
QtTestTableModel model(rowCount, columnCount);
- QSignalSpy spy(&model, SIGNAL(invalidIndexEncountered()));
+ QSignalSpy spy(&model, &QtTestTableModel::invalidIndexEncountered);
QTableView view;
view.setModel(&model);
@@ -601,58 +570,18 @@ void tst_QTableView::keyboardNavigation_data()
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
QTest::addColumn<bool>("tabKeyNavigation");
- QTest::addColumn<IntList>("keyPresses");
-
- QTest::newRow("16x16 model") << 16 << 16 << true
- << (IntList()
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Right
- << Qt::Key_Right
- << Qt::Key_Up
- << Qt::Key_Left
- << Qt::Key_Left
- << Qt::Key_Up
- << Qt::Key_Down
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Left
- << Qt::Key_Left
- << Qt::Key_Up
- << Qt::Key_Down
- << Qt::Key_Down
- << Qt::Key_Tab
- << Qt::Key_Backtab);
-
-
- QTest::newRow("no tab") << 8 << 8 << false
- << (IntList()
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Right
- << Qt::Key_Right
- << Qt::Key_Up
- << Qt::Key_Left
- << Qt::Key_Left
- << Qt::Key_Up
- << Qt::Key_Down
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Up
- << Qt::Key_Left
- << Qt::Key_Left
- << Qt::Key_Up
- << Qt::Key_Down
- << Qt::Key_Down
- << Qt::Key_Tab
- << Qt::Key_Backtab);
+ QTest::addColumn<KeyList>("keyPresses");
+
+ const KeyList keyList {
+ Qt::Key_Up, Qt::Key_Up, Qt::Key_Right, Qt::Key_Right,
+ Qt::Key_Up, Qt::Key_Left, Qt::Key_Left, Qt::Key_Up,
+ Qt::Key_Down, Qt::Key_Up, Qt::Key_Up, Qt::Key_Up,
+ Qt::Key_Up, Qt::Key_Up, Qt::Key_Up, Qt::Key_Left,
+ Qt::Key_Left, Qt::Key_Up, Qt::Key_Down, Qt::Key_Down,
+ Qt::Key_Tab, Qt::Key_Backtab};
+
+ QTest::newRow("16x16 model") << 16 << 16 << true << keyList;
+ QTest::newRow("no tab") << 8 << 8 << false << keyList;
}
void tst_QTableView::keyboardNavigation()
@@ -660,7 +589,7 @@ void tst_QTableView::keyboardNavigation()
QFETCH(int, rowCount);
QFETCH(int, columnCount);
QFETCH(bool, tabKeyNavigation);
- QFETCH(IntList, keyPresses);
+ QFETCH(const KeyList, keyPresses);
QtTestTableModel model(rowCount, columnCount);
QTableView view;
@@ -671,14 +600,12 @@ void tst_QTableView::keyboardNavigation()
view.setCurrentIndex(index);
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
int row = rowCount - 1;
int column = columnCount - 1;
- for (int i = 0; i < keyPresses.count(); ++i) {
-
- Qt::Key key = (Qt::Key)keyPresses.at(i);
+ for (Qt::Key key : keyPresses) {
switch (key) {
case Qt::Key_Up:
@@ -778,8 +705,8 @@ void tst_QTableView::moveCursor_data()
QTest::addColumn<int>("startRow");
QTest::addColumn<int>("startColumn");
- QTest::addColumn<int>("cursorMoveAction");
- QTest::addColumn<int>("modifier");
+ QTest::addColumn<QtTestTableView::CursorAction>("cursorMoveAction");
+ QTest::addColumn<Qt::KeyboardModifier>("modifier");
QTest::addColumn<int>("expectedRow");
QTest::addColumn<int>("expectedColumn");
@@ -790,346 +717,346 @@ void tst_QTableView::moveCursor_data()
QTest::newRow("MoveRight (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveRight) << int(Qt::NoModifier)
+ << QtTestTableView::MoveRight << Qt::NoModifier
<< 0 << 1 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveRight (3,0)")
<< 4 << 4 << -1 << -1
<< 3 << 0
- << int(QtTestTableView::MoveRight) << int(Qt::NoModifier)
+ << QtTestTableView::MoveRight << Qt::NoModifier
<< 3 << 1 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveRight (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveRight) << int(Qt::NoModifier)
+ << QtTestTableView::MoveRight << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0); // ###
QTest::newRow("MoveRight, hidden column 1 (0,0)")
<< 4 << 4 << -1 << 1
<< 0 << 0
- << int(QtTestTableView::MoveRight) << int(Qt::NoModifier)
+ << QtTestTableView::MoveRight << Qt::NoModifier
<< 0 << 2 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveRight, hidden column 3 (0,2)")
<< 4 << 4 << -1 << 3
<< 0 << 2
- << int(QtTestTableView::MoveRight) << int(Qt::NoModifier)
+ << QtTestTableView::MoveRight << Qt::NoModifier
<< 0 << 2 << IntPair(0,0) << IntPair(0,0); // ###
// MoveNext should in addition wrap
QTest::newRow("MoveNext (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 0 << 1 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext (0,2)")
<< 4 << 4 << -1 << -1
<< 0 << 2
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 0 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, wrap (0,3)")
<< 4 << 4 << -1 << -1
<< 0 << 3
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 1 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, wrap (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, hidden column 1 (0,0)")
<< 4 << 4 << -1 << 1
<< 0 << 0
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 0 << 2 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, wrap, hidden column 3 (0,2)")
<< 4 << 4 << -1 << 3
<< 0 << 2
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 1 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, wrap, hidden column 3 (3,2)")
<< 4 << 4 << -1 << 3
<< 3 << 2
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, wrapy, wrapx, hidden column 3, hidden row 3 (2,2)")
<< 4 << 4 << 3 << 3
<< 2 << 2
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveNext, wrap, hidden column 2, moved column from 3 to 0. (0,2)")
<< 4 << 4 << -1 << 2
<< 0 << 2
- << int(QtTestTableView::MoveNext) << int(Qt::NoModifier)
+ << QtTestTableView::MoveNext << Qt::NoModifier
<< 1 << 3 << IntPair(0,0) << IntPair(3,0);
// MoveLeft
QTest::newRow("MoveLeft (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveLeft) << int(Qt::NoModifier)
+ << QtTestTableView::MoveLeft << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveLeft (0,3)")
<< 4 << 4 << -1 << -1
<< 0 << 3
- << int(QtTestTableView::MoveLeft) << int(Qt::NoModifier)
+ << QtTestTableView::MoveLeft << Qt::NoModifier
<< 0 << 2 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveLeft (1,0)")
<< 4 << 4 << -1 << -1
<< 1 << 0
- << int(QtTestTableView::MoveLeft) << int(Qt::NoModifier)
+ << QtTestTableView::MoveLeft << Qt::NoModifier
<< 1 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveLeft, hidden column 0 (0,2)")
<< 4 << 4 << -1 << 1
<< 0 << 2
- << int(QtTestTableView::MoveLeft) << int(Qt::NoModifier)
+ << QtTestTableView::MoveLeft << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveLeft, hidden column 0 (0,1)")
<< 4 << 4 << -1 << 0
<< 0 << 1
- << int(QtTestTableView::MoveLeft) << int(Qt::NoModifier)
+ << QtTestTableView::MoveLeft << Qt::NoModifier
<< 0 << 1 << IntPair(0,0) << IntPair(0,0);
// MovePrevious should in addition wrap
QTest::newRow("MovePrevious (0,3)")
<< 4 << 4 << -1 << -1
<< 0 << 3
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 0 << 2 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious (0,1)")
<< 4 << 4 << -1 << -1
<< 0 << 1
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, wrap (1,0)")
<< 4 << 4 << -1 << -1
<< 1 << 0
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 0 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, wrap, (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, hidden column 1 (0,2)")
<< 4 << 4 << -1 << 1
<< 0 << 2
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, wrap, hidden column 3 (0,2)")
<< 4 << 4 << -1 << 3
<< 0 << 2
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 0 << 1 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, wrapy, hidden column 0 (0,1)")
<< 4 << 4 << -1 << 0
<< 0 << 1
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, wrap, hidden column 0, hidden row 0 (1,1)")
<< 4 << 4 << 0 << 0
<< 1 << 1
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePrevious, wrap, hidden column 1, moved column from 0 to 3. (1,2)")
<< 4 << 4 << -1 << 1
<< 1 << 2
- << int(QtTestTableView::MovePrevious) << int(Qt::NoModifier)
+ << QtTestTableView::MovePrevious << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,3);
// MoveDown
QTest::newRow("MoveDown (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveDown) << int(Qt::NoModifier)
+ << QtTestTableView::MoveDown << Qt::NoModifier
<< 1 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveDown (3,0)")
<< 4 << 4 << -1 << -1
<< 3 << 0
- << int(QtTestTableView::MoveDown) << int(Qt::NoModifier)
+ << QtTestTableView::MoveDown << Qt::NoModifier
<< 3 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveDown (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveDown) << int(Qt::NoModifier)
+ << QtTestTableView::MoveDown << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveDown, hidden row 1 (0,0)")
<< 4 << 4 << 1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveDown) << int(Qt::NoModifier)
+ << QtTestTableView::MoveDown << Qt::NoModifier
<< 2 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveDown, hidden row 3 (2,0)")
<< 4 << 4 << 3 << -1
<< 2 << 0
- << int(QtTestTableView::MoveDown) << int(Qt::NoModifier)
+ << QtTestTableView::MoveDown << Qt::NoModifier
<< 2 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveDown, hidden row 0 hidden column 0 (0,0)")
<< 4 << 4 << 0 << 0
<< 0 << 0
- << int(QtTestTableView::MoveDown) << int(Qt::NoModifier)
+ << QtTestTableView::MoveDown << Qt::NoModifier
<< 1 << 1 << IntPair(0,0) << IntPair(0,0);
// MoveUp
QTest::newRow("MoveUp (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveUp) << int(Qt::NoModifier)
+ << QtTestTableView::MoveUp << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveUp (3, 0)")
<< 4 << 4 << -1 << -1
<< 3 << 0
- << int(QtTestTableView::MoveUp) << int(Qt::NoModifier)
+ << QtTestTableView::MoveUp << Qt::NoModifier
<< 2 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveUp (0,1)")
<< 4 << 4 << -1 << -1
<< 0 << 1
- << int(QtTestTableView::MoveUp) << int(Qt::NoModifier)
+ << QtTestTableView::MoveUp << Qt::NoModifier
<< 0 << 1 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveUp, hidden row 1 (2,0)")
<< 4 << 4 << 1 << -1
<< 2 << 0
- << int(QtTestTableView::MoveUp) << int(Qt::NoModifier)
+ << QtTestTableView::MoveUp << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveUp, hidden row (1,0)")
<< 4 << 4 << 0 << -1
<< 1 << 0
- << int(QtTestTableView::MoveUp) << int(Qt::NoModifier)
+ << QtTestTableView::MoveUp << Qt::NoModifier
<< 1 << 0 << IntPair(0,0) << IntPair(0,0);
// MoveHome
QTest::newRow("MoveHome (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveHome) << int(Qt::NoModifier)
+ << QtTestTableView::MoveHome << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveHome (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveHome) << int(Qt::NoModifier)
+ << QtTestTableView::MoveHome << Qt::NoModifier
<< 3 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveHome, hidden column 0 (3,3)")
<< 4 << 4 << -1 << 0
<< 3 << 3
- << int(QtTestTableView::MoveHome) << int(Qt::NoModifier)
+ << QtTestTableView::MoveHome << Qt::NoModifier
<< 3 << 1 << IntPair(0,0) << IntPair(0,0);
// Use Ctrl modifier
QTest::newRow("MoveHome + Ctrl (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveHome) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveHome << Qt::ControlModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveHome + Ctrl (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveHome) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveHome << Qt::ControlModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveHome + Ctrl, hidden column 0, hidden row 0 (3,3)")
<< 4 << 4 << 0 << 0
<< 3 << 3
- << int(QtTestTableView::MoveHome) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveHome << Qt::ControlModifier
<< 1 << 1 << IntPair(0,0) << IntPair(0,0);
// MoveEnd
QTest::newRow("MoveEnd (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveEnd) << int(Qt::NoModifier)
+ << QtTestTableView::MoveEnd << Qt::NoModifier
<< 0 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveEnd (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveEnd) << int(Qt::NoModifier)
+ << QtTestTableView::MoveEnd << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveEnd, hidden column (0,0)")
<< 4 << 4 << -1 << 3
<< 0 << 0
- << int(QtTestTableView::MoveEnd) << int(Qt::NoModifier)
+ << QtTestTableView::MoveEnd << Qt::NoModifier
<< 0<< 2 << IntPair(0,0) << IntPair(0,0);
// Use Ctrl modifier
QTest::newRow("MoveEnd + Ctrl (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MoveEnd) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveEnd << Qt::ControlModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveEnd + Ctrl (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MoveEnd) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveEnd << Qt::ControlModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveEnd + Ctrl, hidden column 3 (0,0)")
<< 4 << 4 << -1 << 3
<< 0 << 0
- << int(QtTestTableView::MoveEnd) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveEnd << Qt::ControlModifier
<< 3 << 2 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MoveEnd + Ctrl, hidden column 3, hidden row 3 (0,0)")
<< 4 << 4 << 3 << 3
<< 0 << 0
- << int(QtTestTableView::MoveEnd) << int(Qt::ControlModifier)
+ << QtTestTableView::MoveEnd << Qt::ControlModifier
<< 2 << 2 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePageUp (0,0)")
<< 4 << 4 << -1 << -1
<< 0 << 0
- << int(QtTestTableView::MovePageUp) << 0
+ << QtTestTableView::MovePageUp << Qt::NoModifier
<< 0 << 0 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePageUp (3,3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MovePageUp) << 0
+ << QtTestTableView::MovePageUp << Qt::NoModifier
<< 0 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePageDown (3, 3)")
<< 4 << 4 << -1 << -1
<< 3 << 3
- << int(QtTestTableView::MovePageDown) << 0
+ << QtTestTableView::MovePageDown << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
QTest::newRow("MovePageDown (0, 3)")
<< 4 << 4 << -1 << -1
<< 0 << 3
- << int(QtTestTableView::MovePageDown) << 0
+ << QtTestTableView::MovePageDown << Qt::NoModifier
<< 3 << 3 << IntPair(0,0) << IntPair(0,0);
}
@@ -1141,8 +1068,8 @@ void tst_QTableView::moveCursor()
QFETCH(int, hideColumn);
QFETCH(int, startRow);
QFETCH(int, startColumn);
- QFETCH(int, cursorMoveAction);
- QFETCH(int, modifier);
+ QFETCH(QtTestTableView::CursorAction, cursorMoveAction);
+ QFETCH(Qt::KeyboardModifier, modifier);
QFETCH(int, expectedRow);
QFETCH(int, expectedColumn);
QFETCH(IntPair, moveRow);
@@ -1167,8 +1094,7 @@ void tst_QTableView::moveCursor()
QModelIndex index = model.index(startRow, startColumn);
view.setCurrentIndex(index);
- QModelIndex newIndex = view.doMoveCursor((QtTestTableView::CursorAction)cursorMoveAction,
- (Qt::KeyboardModifiers)modifier);
+ QModelIndex newIndex = view.moveCursor(cursorMoveAction, modifier);
// expected fails, task 119433
if(newIndex.row() == -1)
return;
@@ -1186,7 +1112,7 @@ void tst_QTableView::moveCursorStrikesBack_data()
QTest::addColumn<int>("startRow");
QTest::addColumn<int>("startColumn");
- QTest::addColumn<IntList>("cursorMoveActions");
+ QTest::addColumn<CursorActionList>("cursorMoveActions");
QTest::addColumn<int>("expectedRow");
QTest::addColumn<int>("expectedColumn");
@@ -1194,70 +1120,84 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< IntList()
<< (IntList() << 6)
<< QRect()
- << 0 << 5 << (IntList() << int(QtTestTableView::MoveNext))
+ << 0 << 5
+ << CursorActionList{QtTestTableView::MoveNext}
<< 1 << 0;
QTest::newRow("Last column disabled 2. Task QTBUG-3878") << -1 << -1
<< IntList()
<< (IntList() << 6)
<< QRect()
- << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << 1 << 0
+ << CursorActionList{QtTestTableView::MovePrevious}
<< 0 << 5;
QTest::newRow("Span, anchor column hidden") << -1 << 1
<< IntList()
<< IntList()
<< QRect(1, 2, 2, 3)
- << 2 << 0 << (IntList() << int(QtTestTableView::MoveNext))
+ << 2 << 0
+ << CursorActionList{QtTestTableView::MoveNext}
<< 2 << 1;
QTest::newRow("Span, anchor column disabled") << -1 << -1
<< IntList()
<< (IntList() << 1)
<< QRect(1, 2, 2, 3)
- << 2 << 0 << (IntList() << int(QtTestTableView::MoveNext))
+ << 2 << 0
+ << CursorActionList{QtTestTableView::MoveNext}
<< 2 << 1;
QTest::newRow("Span, anchor row hidden") << 2 << -1
<< IntList()
<< IntList()
<< QRect(1, 2, 2, 3)
- << 1 << 2 << (IntList() << int(QtTestTableView::MoveDown))
+ << 1 << 2
+ << CursorActionList{QtTestTableView::MoveDown}
<< 2 << 1;
QTest::newRow("Span, anchor row disabled") << -1 << -1
<< (IntList() << 2)
<< IntList()
<< QRect(1, 2, 2, 3)
- << 1 << 2 << (IntList() << int(QtTestTableView::MoveDown))
+ << 1 << 2
+ << CursorActionList{QtTestTableView::MoveDown}
<< 2 << 1;
QTest::newRow("Move through span right") << -1 << -1
<< IntList()
<< IntList()
<< QRect(1, 2, 2, 3)
- << 3 << 0 << (IntList() << int(QtTestTableView::MoveRight) << int(QtTestTableView::MoveRight))
+ << 3 << 0
+ << CursorActionList{QtTestTableView::MoveRight,
+ QtTestTableView::MoveRight}
<< 3 << 3;
QTest::newRow("Move through span left") << -1 << -1
<< IntList()
<< IntList()
<< QRect(1, 2, 2, 3)
- << 3 << 3 << (IntList() << int(QtTestTableView::MoveLeft) << int(QtTestTableView::MoveLeft))
+ << 3 << 3
+ << CursorActionList{QtTestTableView::MoveLeft,
+ QtTestTableView::MoveLeft}
<< 3 << 0;
QTest::newRow("Move through span down") << -1 << -1
<< IntList()
<< IntList()
<< QRect(1, 2, 2, 3)
- << 1 << 2 << (IntList() << int(QtTestTableView::MoveDown) << int(QtTestTableView::MoveDown))
+ << 1 << 2
+ << CursorActionList{QtTestTableView::MoveDown,
+ QtTestTableView::MoveDown}
<< 5 << 2;
QTest::newRow("Move through span up") << -1 << -1
<< IntList()
<< IntList()
<< QRect(1, 2, 2, 3)
- << 5 << 2 << (IntList() << int(QtTestTableView::MoveUp) << int(QtTestTableView::MoveUp))
+ << 5 << 2
+ << CursorActionList{QtTestTableView::MoveUp,
+ QtTestTableView::MoveUp}
<< 1 << 2;
IntList fullList;
@@ -1268,42 +1208,48 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< fullList
<< fullList
<< QRect()
- << 1 << 0 << (IntList() << int(QtTestTableView::MoveNext))
+ << 1 << 0
+ << CursorActionList{QtTestTableView::MoveNext}
<< -1 << -1;
QTest::newRow("All disabled, wrap backwards. => invalid index") << -1 << -1
<< fullList
<< fullList
<< QRect()
- << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << 1 << 0
+ << CursorActionList{QtTestTableView::MovePrevious}
<< -1 << -1;
QTest::newRow("Last column disabled, MoveEnd. QTBUG-72400") << -1 << -1
<< IntList()
<< (IntList() << 6)
<< QRect()
- << 0 << 0 << (IntList() << int(QtTestTableView::MoveEnd))
+ << 0 << 0
+ << CursorActionList{QtTestTableView::MoveEnd}
<< 0 << 5;
QTest::newRow("First column disabled, MoveHome. QTBUG-72400") << -1 << -1
<< IntList()
<< (IntList() << 0)
<< QRect()
- << 0 << 6 << (IntList() << int(QtTestTableView::MoveHome))
+ << 0 << 6
+ << CursorActionList{QtTestTableView::MoveHome}
<< 0 << 1;
QTest::newRow("First row disabled, MovePageUp. QTBUG-72400") << -1 << -1
<< (IntList() << 0)
<< IntList()
<< QRect()
- << 2 << 0 << (IntList() << int(QtTestTableView::MovePageUp))
+ << 2 << 0
+ << CursorActionList{QtTestTableView::MovePageUp}
<< 1 << 0;
QTest::newRow("Last row disabled, MovePageDown. QTBUG-72400") << -1 << -1
<< (IntList() << 6)
<< IntList()
<< QRect()
- << 4 << 0 << (IntList() << int(QtTestTableView::MovePageDown))
+ << 4 << 0
+ << CursorActionList{QtTestTableView::MovePageDown}
<< 5 << 0;
}
@@ -1311,13 +1257,13 @@ void tst_QTableView::moveCursorStrikesBack()
{
QFETCH(int, hideRow);
QFETCH(int, hideColumn);
- QFETCH(IntList, disableRows);
- QFETCH(IntList, disableColumns);
+ QFETCH(const IntList, disableRows);
+ QFETCH(const IntList, disableColumns);
QFETCH(QRect, span);
QFETCH(int, startRow);
QFETCH(int, startColumn);
- QFETCH(IntList, cursorMoveActions);
+ QFETCH(const CursorActionList, cursorMoveActions);
QFETCH(int, expectedRow);
QFETCH(int, expectedColumn);
@@ -1337,15 +1283,15 @@ void tst_QTableView::moveCursorStrikesBack()
QModelIndex index = model.index(startRow, startColumn);
view.setCurrentIndex(index);
- foreach (int row, disableRows)
+ for (int row : disableRows)
model.disableRow(row);
- foreach (int column, disableColumns)
+ for (int column : disableColumns)
model.disableColumn(column);
int newRow = -1;
int newColumn = -1;
- foreach (int cursorMoveAction, cursorMoveActions) {
- QModelIndex newIndex = view.doMoveCursor((QtTestTableView::CursorAction)cursorMoveAction, 0);
+ for (auto cursorMoveAction : cursorMoveActions) {
+ QModelIndex newIndex = view.moveCursor(cursorMoveAction, nullptr);
view.setCurrentIndex(newIndex);
newRow = newIndex.row();
newColumn = newIndex.column();
@@ -1516,7 +1462,7 @@ void tst_QTableView::selection_data()
QTest::addColumn<int>("y");
QTest::addColumn<int>("width");
QTest::addColumn<int>("height");
- QTest::addColumn<int>("command");
+ QTest::addColumn<QItemSelectionModel::SelectionFlag>("command");
QTest::addColumn<int>("selectedCount"); // ### make this more detailed
QTest::newRow("no span, no hidden, no moved, 3x3 select")
@@ -1528,7 +1474,7 @@ void tst_QTableView::selection_data()
<< -1 << -1 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 9; // selected count
QTest::newRow("row span, no hidden, no moved, 3x3 select")
@@ -1540,7 +1486,7 @@ void tst_QTableView::selection_data()
<< -1 << -1 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 8; // selected count
QTest::newRow("col span, no hidden, no moved, 3x3 select")
@@ -1552,7 +1498,7 @@ void tst_QTableView::selection_data()
<< -1 << -1 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 8; // selected count
QTest::newRow("no span, row hidden, no moved, 3x3 select")
@@ -1564,7 +1510,7 @@ void tst_QTableView::selection_data()
<< -1 << -1 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 9; // selected count
QTest::newRow("no span, col hidden, no moved, 3x3 select")
@@ -1576,7 +1522,7 @@ void tst_QTableView::selection_data()
<< -1 << -1 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 9; // selected count
QTest::newRow("no span, no hidden, row moved, 3x3 select")
@@ -1588,7 +1534,7 @@ void tst_QTableView::selection_data()
<< -1 << -1 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 9; // selected count
QTest::newRow("no span, no hidden, col moved, 3x3 select")
@@ -1600,7 +1546,7 @@ void tst_QTableView::selection_data()
<< 1 << 3 // move col
<< 40 << 40 // cell size
<< 20 << 20 << 80 << 80 // rect
- << int(QItemSelectionModel::Select) // command
+ << QItemSelectionModel::Select // command
<< 9; // selected count
}
@@ -1624,7 +1570,7 @@ void tst_QTableView::selection()
QFETCH(int, y);
QFETCH(int, width);
QFETCH(int, height);
- QFETCH(int, command);
+ QFETCH(QItemSelectionModel::SelectionFlag, command);
QFETCH(int, selectedCount);
QtTestTableModel model(rowCount, columnCount);
@@ -1646,8 +1592,7 @@ void tst_QTableView::selection()
for (int c = 0; c < columnCount; ++c)
view.setColumnWidth(c, columnWidth);
- view.setSelection(QRect(x, y, width, height),
- QItemSelectionModel::SelectionFlags(command));
+ view.setSelection(QRect(x, y, width, height), command);
QCOMPARE(view.selectedIndexes().count(), selectedCount);
}
@@ -1657,92 +1602,92 @@ void tst_QTableView::selectRow_data()
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
QTest::addColumn<int>("row");
- QTest::addColumn<int>("mode");
- QTest::addColumn<int>("behavior");
+ QTest::addColumn<QAbstractItemView::SelectionMode>("mode");
+ QTest::addColumn<QAbstractItemView::SelectionBehavior>("behavior");
QTest::addColumn<int>("selectedItems");
QTest::newRow("SingleSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::SingleSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::SingleSelection
+ << QAbstractItemView::SelectItems
<< 0;
QTest::newRow("SingleSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::SingleSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::SingleSelection
+ << QAbstractItemView::SelectRows
<< 10;
QTest::newRow("SingleSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::SingleSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::SingleSelection
+ << QAbstractItemView::SelectColumns
<< 0;
QTest::newRow("MultiSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::MultiSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::MultiSelection
+ << QAbstractItemView::SelectItems
<< 10;
QTest::newRow("MultiSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::MultiSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::MultiSelection
+ << QAbstractItemView::SelectRows
<< 10;
QTest::newRow("MultiSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::MultiSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::MultiSelection
+ << QAbstractItemView::SelectColumns
<< 0;
QTest::newRow("ExtendedSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ExtendedSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::ExtendedSelection
+ << QAbstractItemView::SelectItems
<< 10;
QTest::newRow("ExtendedSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ExtendedSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::ExtendedSelection
+ << QAbstractItemView::SelectRows
<< 10;
QTest::newRow("ExtendedSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ExtendedSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::ExtendedSelection
+ << QAbstractItemView::SelectColumns
<< 0;
QTest::newRow("ContiguousSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ContiguousSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::ContiguousSelection
+ << QAbstractItemView::SelectItems
<< 10;
QTest::newRow("ContiguousSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ContiguousSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::ContiguousSelection
+ << QAbstractItemView::SelectRows
<< 10;
QTest::newRow("ContiguousSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ContiguousSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::ContiguousSelection
+ << QAbstractItemView::SelectColumns
<< 0;
}
@@ -1751,16 +1696,16 @@ void tst_QTableView::selectRow()
QFETCH(int, rowCount);
QFETCH(int, columnCount);
QFETCH(int, row);
- QFETCH(int, mode);
- QFETCH(int, behavior);
+ QFETCH(QAbstractItemView::SelectionMode, mode);
+ QFETCH(QAbstractItemView::SelectionBehavior, behavior);
QFETCH(int, selectedItems);
QtTestTableModel model(rowCount, columnCount);
QTableView view;
view.setModel(&model);
- view.setSelectionMode((QAbstractItemView::SelectionMode)mode);
- view.setSelectionBehavior((QAbstractItemView::SelectionBehavior)behavior);
+ view.setSelectionMode(mode);
+ view.setSelectionBehavior(behavior);
QCOMPARE(view.selectionModel()->selectedIndexes().count(), 0);
@@ -1778,92 +1723,92 @@ void tst_QTableView::selectColumn_data()
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
QTest::addColumn<int>("column");
- QTest::addColumn<int>("mode");
- QTest::addColumn<int>("behavior");
+ QTest::addColumn<QAbstractItemView::SelectionMode>("mode");
+ QTest::addColumn<QAbstractItemView::SelectionBehavior>("behavior");
QTest::addColumn<int>("selectedItems");
QTest::newRow("SingleSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::SingleSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::SingleSelection
+ << QAbstractItemView::SelectItems
<< 0;
QTest::newRow("SingleSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::SingleSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::SingleSelection
+ << QAbstractItemView::SelectRows
<< 0;
QTest::newRow("SingleSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::SingleSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::SingleSelection
+ << QAbstractItemView::SelectColumns
<< 10;
QTest::newRow("MultiSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::MultiSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::MultiSelection
+ << QAbstractItemView::SelectItems
<< 10;
QTest::newRow("MultiSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::MultiSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::MultiSelection
+ << QAbstractItemView::SelectRows
<< 0;
QTest::newRow("MultiSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::MultiSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::MultiSelection
+ << QAbstractItemView::SelectColumns
<< 10;
QTest::newRow("ExtendedSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ExtendedSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::ExtendedSelection
+ << QAbstractItemView::SelectItems
<< 10;
QTest::newRow("ExtendedSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ExtendedSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::ExtendedSelection
+ << QAbstractItemView::SelectRows
<< 0;
QTest::newRow("ExtendedSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ExtendedSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::ExtendedSelection
+ << QAbstractItemView::SelectColumns
<< 10;
QTest::newRow("ContiguousSelection and SelectItems")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ContiguousSelection
- << (int)QAbstractItemView::SelectItems
+ << QAbstractItemView::ContiguousSelection
+ << QAbstractItemView::SelectItems
<< 10;
QTest::newRow("ContiguousSelection and SelectRows")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ContiguousSelection
- << (int)QAbstractItemView::SelectRows
+ << QAbstractItemView::ContiguousSelection
+ << QAbstractItemView::SelectRows
<< 0;
QTest::newRow("ContiguousSelection and SelectColumns")
<< 10 << 10
<< 0
- << (int)QAbstractItemView::ContiguousSelection
- << (int)QAbstractItemView::SelectColumns
+ << QAbstractItemView::ContiguousSelection
+ << QAbstractItemView::SelectColumns
<< 10;
}
@@ -1872,16 +1817,16 @@ void tst_QTableView::selectColumn()
QFETCH(int, rowCount);
QFETCH(int, columnCount);
QFETCH(int, column);
- QFETCH(int, mode);
- QFETCH(int, behavior);
+ QFETCH(QAbstractItemView::SelectionMode, mode);
+ QFETCH(QAbstractItemView::SelectionBehavior, behavior);
QFETCH(int, selectedItems);
QtTestTableModel model(rowCount, columnCount);
QTableView view;
view.setModel(&model);
- view.setSelectionMode((QAbstractItemView::SelectionMode)mode);
- view.setSelectionBehavior((QAbstractItemView::SelectionBehavior)behavior);
+ view.setSelectionMode(mode);
+ view.setSelectionBehavior(behavior);
QCOMPARE(view.selectionModel()->selectedIndexes().count(), 0);
@@ -1981,9 +1926,9 @@ void tst_QTableView::selectall_data()
<< 100; // selected count
}
-void QTest__keySequence(QWidget* widget, QKeySequence ks)
+void QTest__keySequence(QWidget* widget, const QKeySequence &ks)
{
- for (int i=0; i<ks.count(); ++i)
+ for (int i = 0; i < ks.count(); ++i)
{
Qt::Key key = Qt::Key(ks[i] & ~Qt::KeyboardModifierMask);
Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(ks[i] & Qt::KeyboardModifierMask);
@@ -2221,7 +2166,7 @@ void tst_QTableView::resizeRowsToContents()
QFETCH(int, cellHeight);
QFETCH(int, rowHeight);
QFETCH(int, columnWidth);
- Q_UNUSED(columnWidth);
+ Q_UNUSED(columnWidth)
QtTestTableModel model(rowCount, columnCount);
QtTestTableView view;
@@ -2233,13 +2178,12 @@ void tst_QTableView::resizeRowsToContents()
delegate.hint = QSize(cellWidth, cellHeight);
- QSignalSpy resizedSpy(view.verticalHeader(), SIGNAL(sectionResized(int,int,int)));
+ QSignalSpy resizedSpy(view.verticalHeader(), &QHeaderView::sectionResized);
view.resizeRowsToContents();
QCOMPARE(resizedSpy.count(), model.rowCount());
- for (int r = 0; r < model.rowCount(); ++r) {
+ for (int r = 0; r < model.rowCount(); ++r)
QCOMPARE(view.rowHeight(r), rowHeight);
- }
}
void tst_QTableView::resizeColumnsToContents_data()
@@ -2268,7 +2212,7 @@ void tst_QTableView::resizeColumnsToContents()
QFETCH(int, cellHeight);
QFETCH(int, rowHeight);
QFETCH(int, columnWidth);
- Q_UNUSED(rowHeight);
+ Q_UNUSED(rowHeight)
QtTestTableModel model(rowCount, columnCount);
QtTestTableView view;
@@ -2280,7 +2224,7 @@ void tst_QTableView::resizeColumnsToContents()
delegate.hint = QSize(cellWidth, cellHeight);
- QSignalSpy resizedSpy(view.horizontalHeader(), SIGNAL(sectionResized(int,int,int)));
+ QSignalSpy resizedSpy(view.horizontalHeader(), &QHeaderView::sectionResized);
view.resizeColumnsToContents();
QCOMPARE(resizedSpy.count(), model.columnCount());
@@ -2293,51 +2237,51 @@ void tst_QTableView::rowViewportPosition_data()
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("rowHeight");
QTest::addColumn<int>("row");
- QTest::addColumn<int>("verticalScrollMode");
+ QTest::addColumn<QAbstractItemView::ScrollMode>("verticalScrollMode");
QTest::addColumn<int>("verticalScrollValue");
QTest::addColumn<int>("rowViewportPosition");
QTest::newRow("row 0, scroll per item 0")
- << 10 << 40 << 0 << int(QAbstractItemView::ScrollPerItem) << 0 << 0;
+ << 10 << 40 << 0 << QAbstractItemView::ScrollPerItem << 0 << 0;
QTest::newRow("row 1, scroll per item, 0")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerItem) << 0 << 1 * 40;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerItem << 0 << 1 * 40;
QTest::newRow("row 1, scroll per item, 1")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerItem) << 1 << 0;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerItem << 1 << 0;
QTest::newRow("row 5, scroll per item, 0")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerItem) << 0 << 5 * 40;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerItem << 0 << 5 * 40;
QTest::newRow("row 5, scroll per item, 5")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerItem) << 5 << 0;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerItem << 5 << 0;
QTest::newRow("row 9, scroll per item, 0")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerItem) << 0 << 9 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerItem << 0 << 9 * 40;
QTest::newRow("row 9, scroll per item, 5")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerItem) << 5 << 4 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerItem << 5 << 4 * 40;
QTest::newRow("row 0, scroll per pixel 0")
- << 10 << 40 << 0 << int(QAbstractItemView::ScrollPerPixel) << 0 << 0;
+ << 10 << 40 << 0 << QAbstractItemView::ScrollPerPixel << 0 << 0;
QTest::newRow("row 1, scroll per pixel, 0")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerPixel) << 0 << 1 * 40;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerPixel << 0 << 1 * 40;
QTest::newRow("row 1, scroll per pixel, 1")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerPixel) << 1 * 40 << 0;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerPixel << 1 * 40 << 0;
QTest::newRow("row 5, scroll per pixel, 0")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerPixel) << 0 << 5 * 40;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerPixel << 0 << 5 * 40;
QTest::newRow("row 5, scroll per pixel, 5")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerPixel) << 5 * 40 << 0;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerPixel << 5 * 40 << 0;
QTest::newRow("row 9, scroll per pixel, 0")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerPixel) << 0 << 9 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerPixel << 0 << 9 * 40;
QTest::newRow("row 9, scroll per pixel, 5")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerPixel) << 5 * 40 << 4 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerPixel << 5 * 40 << 4 * 40;
}
void tst_QTableView::rowViewportPosition()
@@ -2345,7 +2289,7 @@ void tst_QTableView::rowViewportPosition()
QFETCH(int, rowCount);
QFETCH(int, rowHeight);
QFETCH(int, row);
- QFETCH(int, verticalScrollMode);
+ QFETCH(QAbstractItemView::ScrollMode, verticalScrollMode);
QFETCH(int, verticalScrollValue);
QFETCH(int, rowViewportPosition);
@@ -2359,7 +2303,7 @@ void tst_QTableView::rowViewportPosition()
for (int r = 0; r < rowCount; ++r)
view.setRowHeight(r, rowHeight);
- view.setVerticalScrollMode((QAbstractItemView::ScrollMode)verticalScrollMode);
+ view.setVerticalScrollMode(verticalScrollMode);
view.verticalScrollBar()->setValue(verticalScrollValue);
#ifdef Q_OS_WINRT
@@ -2464,51 +2408,51 @@ void tst_QTableView::columnViewportPosition_data()
QTest::addColumn<int>("columnCount");
QTest::addColumn<int>("columnWidth");
QTest::addColumn<int>("column");
- QTest::addColumn<int>("horizontalScrollMode");
+ QTest::addColumn<QAbstractItemView::ScrollMode>("horizontalScrollMode");
QTest::addColumn<int>("horizontalScrollValue");
QTest::addColumn<int>("columnViewportPosition");
QTest::newRow("column 0, scroll per item 0")
- << 10 << 40 << 0 << int(QAbstractItemView::ScrollPerItem) << 0 << 0;
+ << 10 << 40 << 0 << QAbstractItemView::ScrollPerItem << 0 << 0;
QTest::newRow("column 1, scroll per item, 0")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerItem) << 0 << 1 * 40;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerItem << 0 << 1 * 40;
QTest::newRow("column 1, scroll per item, 1")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerItem) << 1 << 0;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerItem << 1 << 0;
QTest::newRow("column 5, scroll per item, 0")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerItem) << 0 << 5 * 40;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerItem << 0 << 5 * 40;
QTest::newRow("column 5, scroll per item, 5")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerItem) << 5 << 0;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerItem << 5 << 0;
QTest::newRow("column 9, scroll per item, 0")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerItem) << 0 << 9 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerItem << 0 << 9 * 40;
QTest::newRow("column 9, scroll per item, 5")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerItem) << 5 << 4 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerItem << 5 << 4 * 40;
QTest::newRow("column 0, scroll per pixel 0")
- << 10 << 40 << 0 << int(QAbstractItemView::ScrollPerPixel) << 0 << 0;
+ << 10 << 40 << 0 << QAbstractItemView::ScrollPerPixel << 0 << 0;
QTest::newRow("column 1, scroll per pixel 0")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerPixel) << 0 << 1 * 40;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerPixel << 0 << 1 * 40;
QTest::newRow("column 1, scroll per pixel 1")
- << 10 << 40 << 1 << int(QAbstractItemView::ScrollPerPixel) << 1 * 40 << 0;
+ << 10 << 40 << 1 << QAbstractItemView::ScrollPerPixel << 1 * 40 << 0;
QTest::newRow("column 5, scroll per pixel 0")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerPixel) << 0 << 5 * 40;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerPixel << 0 << 5 * 40;
QTest::newRow("column 5, scroll per pixel 5")
- << 10 << 40 << 5 << int(QAbstractItemView::ScrollPerPixel) << 5 * 40 << 0;
+ << 10 << 40 << 5 << QAbstractItemView::ScrollPerPixel << 5 * 40 << 0;
QTest::newRow("column 9, scroll per pixel 0")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerPixel) << 0 << 9 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerPixel << 0 << 9 * 40;
QTest::newRow("column 9, scroll per pixel 5")
- << 10 << 40 << 9 << int(QAbstractItemView::ScrollPerPixel) << 5 * 40 << 4 * 40;
+ << 10 << 40 << 9 << QAbstractItemView::ScrollPerPixel << 5 * 40 << 4 * 40;
}
void tst_QTableView::columnViewportPosition()
@@ -2516,7 +2460,7 @@ void tst_QTableView::columnViewportPosition()
QFETCH(int, columnCount);
QFETCH(int, columnWidth);
QFETCH(int, column);
- QFETCH(int, horizontalScrollMode);
+ QFETCH(QAbstractItemView::ScrollMode, horizontalScrollMode);
QFETCH(int, horizontalScrollValue);
QFETCH(int, columnViewportPosition);
@@ -2530,7 +2474,7 @@ void tst_QTableView::columnViewportPosition()
for (int c = 0; c < columnCount; ++c)
view.setColumnWidth(c, columnWidth);
- view.setHorizontalScrollMode((QAbstractItemView::ScrollMode)horizontalScrollMode);
+ view.setHorizontalScrollMode(horizontalScrollMode);
view.horizontalScrollBar()->setValue(horizontalScrollValue);
#ifdef Q_OS_WINRT
@@ -2730,8 +2674,8 @@ void tst_QTableView::sortingEnabled()
void tst_QTableView::scrollTo_data()
{
- QTest::addColumn<int>("verticalScrollMode");
- QTest::addColumn<int>("horizontalScrollMode");
+ QTest::addColumn<QAbstractItemView::ScrollMode>("verticalScrollMode");
+ QTest::addColumn<QAbstractItemView::ScrollMode>("horizontalScrollMode");
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
QTest::addColumn<int>("rowHeight");
@@ -2744,51 +2688,51 @@ void tst_QTableView::scrollTo_data()
QTest::addColumn<int>("columnSpan");
QTest::addColumn<int>("horizontalScroll");
QTest::addColumn<int>("verticalScroll");
- QTest::addColumn<int>("scrollHint");
+ QTest::addColumn<QAbstractItemView::ScrollHint>("scrollHint");
QTest::addColumn<int>("expectedHorizontalScroll");
QTest::addColumn<int>("expectedVerticalScroll");
QTest::newRow("no hidden, no span, no scroll, per item")
- << (int)QAbstractItemView::ScrollPerItem
- << (int)QAbstractItemView::ScrollPerItem
+ << QAbstractItemView::ScrollPerItem
+ << QAbstractItemView::ScrollPerItem
<< 10 << 10 // table
<< 80 << 80 // size
<< -1 << -1 // hide
<< 0 << 0 // cell
<< 1 << 1 // span
<< 0 << 0 // scroll
- << (int)QAbstractItemView::PositionAtTop
+ << QAbstractItemView::PositionAtTop
<< 0 << 0; // expected
QTest::newRow("no hidden, no span, no scroll, per pixel")
- << (int)QAbstractItemView::ScrollPerPixel
- << (int)QAbstractItemView::ScrollPerPixel
+ << QAbstractItemView::ScrollPerPixel
+ << QAbstractItemView::ScrollPerPixel
<< 10 << 10 // table
<< 80 << 80 // size
<< -1 << -1 // hide
<< 0 << 0 // cell
<< 1 << 1 // span
<< 0 << 0 // scroll
- << (int)QAbstractItemView::PositionAtTop
+ << QAbstractItemView::PositionAtTop
<< 0 << 0; // expected
QTest::newRow("hidden, no span, no scroll, per item")
- << (int)QAbstractItemView::ScrollPerItem
- << (int)QAbstractItemView::ScrollPerItem
+ << QAbstractItemView::ScrollPerItem
+ << QAbstractItemView::ScrollPerItem
<< 10 << 10 // table
<< 80 << 80 // size
<< 3 << 3 // hide
<< 5 << 5 // cell
<< 1 << 1 // span
<< 0 << 0 // scroll
- << (int)QAbstractItemView::PositionAtTop
+ << QAbstractItemView::PositionAtTop
<< 4 << 4; // expected
}
void tst_QTableView::scrollTo()
{
- QFETCH(int, horizontalScrollMode);
- QFETCH(int, verticalScrollMode);
+ QFETCH(QAbstractItemView::ScrollMode, horizontalScrollMode);
+ QFETCH(QAbstractItemView::ScrollMode, verticalScrollMode);
QFETCH(int, rowCount);
QFETCH(int, columnCount);
QFETCH(int, rowHeight);
@@ -2801,7 +2745,7 @@ void tst_QTableView::scrollTo()
QFETCH(int, columnSpan);
QFETCH(int, horizontalScroll);
QFETCH(int, verticalScroll);
- QFETCH(int, scrollHint);
+ QFETCH(QAbstractItemView::ScrollHint, scrollHint);
QFETCH(int, expectedHorizontalScroll);
QFETCH(int, expectedVerticalScroll);
@@ -2821,8 +2765,8 @@ void tst_QTableView::scrollTo()
view.setSpan(row, column, rowSpan, columnSpan);
view.hideRow(hiddenRow);
view.hideColumn(hiddenColumn);
- view.setHorizontalScrollMode((QAbstractItemView::ScrollMode)horizontalScrollMode);
- view.setVerticalScrollMode((QAbstractItemView::ScrollMode)verticalScrollMode);
+ view.setHorizontalScrollMode(horizontalScrollMode);
+ view.setVerticalScrollMode(verticalScrollMode);
for (int r = 0; r < rowCount; ++r)
view.setRowHeight(r, rowHeight);
@@ -2834,7 +2778,7 @@ void tst_QTableView::scrollTo()
QModelIndex index = model.index(row, column);
QVERIFY(index.isValid());
- view.scrollTo(index, (QAbstractItemView::ScrollHint)scrollHint);
+ view.scrollTo(index, scrollHint);
QTRY_COMPARE(view.verticalScrollBar()->value(), expectedVerticalScroll);
QTRY_COMPARE(view.horizontalScrollBar()->value(), expectedHorizontalScroll);
}
@@ -3139,8 +3083,6 @@ void tst_QTableView::span()
VERIFY_SPANS_CONSISTENCY(&view);
}
-typedef QVector<QRect> SpanList;
-
void tst_QTableView::spans_data()
{
QTest::addColumn<int>("rows");
@@ -3268,7 +3210,7 @@ void tst_QTableView::spans()
{
QFETCH(int, rows);
QFETCH(int, columns);
- QFETCH(SpanList, spans);
+ QFETCH(const SpanList, spans);
QFETCH(bool, hideRowLastRowOfFirstSpan);
QFETCH(QPoint, pos);
QFETCH(int, expectedRowSpan);
@@ -3280,10 +3222,8 @@ void tst_QTableView::spans()
view.setModel(&model);
view.show();
- for (int i = 0; i < spans.count(); ++i) {
- QRect sp = spans.at(i);
+ for (const auto &sp : spans)
view.setSpan(sp.x(), sp.y(), sp.width(), sp.height());
- }
if (hideRowLastRowOfFirstSpan) {
view.setRowHidden(spans.at(0).bottom(), true);
@@ -3377,32 +3317,34 @@ void tst_QTableView::spansAfterRowRemoval()
QtTestTableView view;
view.setModel(&model);
- QList<QRect> spans;
- spans << QRect(0, 1, 1, 2)
- << QRect(1, 2, 1, 2)
- << QRect(2, 2, 1, 5)
- << QRect(2, 8, 1, 2)
- << QRect(3, 4, 1, 2)
- << QRect(4, 4, 1, 4)
- << QRect(5, 6, 1, 3)
- << QRect(6, 7, 1, 3);
- foreach (QRect span, spans)
+ static const QRect spans[] = {
+ {0, 1, 1, 2},
+ {1, 2, 1, 2},
+ {2, 2, 1, 5},
+ {2, 8, 1, 2},
+ {3, 4, 1, 2},
+ {4, 4, 1, 4},
+ {5, 6, 1, 3},
+ {6, 7, 1, 3}
+ };
+ for (const QRect &span : spans)
view.setSpan(span.top(), span.left(), span.height(), span.width());
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
view.model()->removeRows(3, 3);
- QList<QRect> expectedSpans;
- expectedSpans << QRect(0, 1, 1, 2)
- << QRect(1, 2, 1, 1)
- << QRect(2, 2, 1, 2)
- << QRect(2, 5, 1, 2)
- << QRect(3, 4, 1, 1)
- << QRect(4, 3, 1, 2)
- << QRect(5, 3, 1, 3)
- << QRect(6, 4, 1, 3);
- foreach (QRect span, expectedSpans) {
+ static const QRect expectedSpans[] = {
+ {0, 1, 1, 2},
+ {1, 2, 1, 1},
+ {2, 2, 1, 2},
+ {2, 5, 1, 2},
+ {3, 4, 1, 1},
+ {4, 3, 1, 2},
+ {5, 3, 1, 3},
+ {6, 4, 1, 3}
+ };
+ for (const QRect &span : expectedSpans) {
QCOMPARE(view.columnSpan(span.top(), span.left()), span.width());
QCOMPARE(view.rowSpan(span.top(), span.left()), span.height());
}
@@ -3417,32 +3359,34 @@ void tst_QTableView::spansAfterColumnRemoval()
view.setModel(&model);
// Same set as above just swapping columns and rows.
- QList<QRect> spans;
- spans << QRect(0, 1, 1, 2)
- << QRect(1, 2, 1, 2)
- << QRect(2, 2, 1, 5)
- << QRect(2, 8, 1, 2)
- << QRect(3, 4, 1, 2)
- << QRect(4, 4, 1, 4)
- << QRect(5, 6, 1, 3)
- << QRect(6, 7, 1, 3);
- foreach (QRect span, spans)
- view.setSpan(span.left(), span.top(), span.width(), span.height());
+ static const QRect spans[] = {
+ {0, 1, 1, 2},
+ {1, 2, 1, 2},
+ {2, 2, 1, 5},
+ {2, 8, 1, 2},
+ {3, 4, 1, 2},
+ {4, 4, 1, 4},
+ {5, 6, 1, 3},
+ {6, 7, 1, 3}
+ };
+ for (const QRect &span : spans)
+ view.setSpan(span.left(), span.top(), span.width(), span.height());
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
view.model()->removeColumns(3, 3);
- QList<QRect> expectedSpans;
- expectedSpans << QRect(0, 1, 1, 2)
- << QRect(1, 2, 1, 1)
- << QRect(2, 2, 1, 2)
- << QRect(2, 5, 1, 2)
- << QRect(3, 4, 1, 1)
- << QRect(4, 3, 1, 2)
- << QRect(5, 3, 1, 3)
- << QRect(6, 4, 1, 3);
- foreach (QRect span, expectedSpans) {
+ static const QRect expectedSpans[] = {
+ {0, 1, 1, 2},
+ {1, 2, 1, 1},
+ {2, 2, 1, 2},
+ {2, 5, 1, 2},
+ {3, 4, 1, 1},
+ {4, 3, 1, 2},
+ {5, 3, 1, 3},
+ {6, 4, 1, 3}
+ };
+ for (const QRect &span : expectedSpans) {
QCOMPARE(view.columnSpan(span.left(), span.top()), span.height());
QCOMPARE(view.rowSpan(span.left(), span.top()), span.width());
}
@@ -3450,12 +3394,10 @@ void tst_QTableView::spansAfterColumnRemoval()
VERIFY_SPANS_CONSISTENCY(&view);
}
-Q_DECLARE_METATYPE(Qt::Key)
-
void tst_QTableView::editSpanFromDirections_data()
{
- QTest::addColumn<QList<Qt::Key> >("keyPresses");
- QTest::addColumn<QSharedPointer<QStandardItemModel> >("model");
+ QTest::addColumn<KeyList>("keyPresses");
+ QTest::addColumn<QSharedPointer<QStandardItemModel>>("model");
QTest::addColumn<int>("row");
QTest::addColumn<int>("column");
QTest::addColumn<int>("rowSpan");
@@ -3474,8 +3416,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+
| | ^ |
+---+---+ */
- QList<Qt::Key> keyPresses;
- keyPresses << Qt::Key_Right << Qt::Key_PageDown << Qt::Key_Up;
+ KeyList keyPresses {Qt::Key_Right, Qt::Key_PageDown, Qt::Key_Up};
QSharedPointer<QStandardItemModel> model(new QStandardItemModel(4, 2));
QTest::newRow("row span, bottom up")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1);
@@ -3489,8 +3430,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+
| | |
+---+---+ */
- keyPresses.clear();
- keyPresses << Qt::Key_Right << Qt::Key_Down;
+ keyPresses = {Qt::Key_Right, Qt::Key_Down};
model = QSharedPointer<QStandardItemModel>::create(4, 2);
QTest::newRow("row span, top down")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1);
@@ -3502,8 +3442,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+ +---+
| | | |
+---+---+---+ */
- keyPresses.clear();
- keyPresses << Qt::Key_End << Qt::Key_Down << Qt::Key_Left;
+ keyPresses = {Qt::Key_End, Qt::Key_Down, Qt::Key_Left};
model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("row span, right to left")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1);
@@ -3515,8 +3454,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+ +---+
| > | c | |
+---+---+---+ */
- keyPresses.clear();
- keyPresses << Qt::Key_PageDown << Qt::Key_Right;
+ keyPresses = {Qt::Key_PageDown, Qt::Key_Right};
model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("row span, left to right")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1);
@@ -3528,8 +3466,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+
| ^ | | |
+---+---+---+ */
- keyPresses.clear();
- keyPresses << Qt::Key_PageDown << Qt::Key_Up;
+ keyPresses = {Qt::Key_PageDown, Qt::Key_Up};
model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, bottom up")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 0) << model->index(1, 0);
@@ -3541,8 +3478,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+
| | ^ | |
+---+---+---+ */
- keyPresses.clear();
- keyPresses << Qt::Key_PageDown << Qt::Key_Right << Qt::Key_Up;
+ keyPresses = {Qt::Key_PageDown, Qt::Key_Right, Qt::Key_Up};
model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, bottom up #2")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 1) << model->index(1, 0);
@@ -3554,8 +3490,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+
| | | |
+---+---+---+ */
- keyPresses.clear();
- keyPresses << Qt::Key_End << Qt::Key_Down;
+ keyPresses = {Qt::Key_End, Qt::Key_Down};
model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, top down")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0);
@@ -3564,12 +3499,10 @@ void tst_QTableView::editSpanFromDirections_data()
class TableViewWithCursorExposed : public QTableView
{
public:
- TableViewWithCursorExposed() :
- QTableView() {
- }
+ using QTableView::QTableView;
-public:
- QModelIndex visualCursorIndex() {
+ QModelIndex visualCursorIndex()
+ {
QTableViewPrivate *d = static_cast<QTableViewPrivate*>(qt_widget_private(this));
return d->model->index(d->visualCursor.y(), d->visualCursor.x());
}
@@ -3577,7 +3510,7 @@ public:
void tst_QTableView::editSpanFromDirections()
{
- QFETCH(QList<Qt::Key>, keyPresses);
+ QFETCH(const KeyList, keyPresses);
QFETCH(QSharedPointer<QStandardItemModel>, model);
QFETCH(int, row);
QFETCH(int, column);
@@ -3595,9 +3528,8 @@ void tst_QTableView::editSpanFromDirections()
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
- foreach (Qt::Key key, keyPresses) {
+ for (Qt::Key key : keyPresses)
QTest::keyClick(&view, key);
- }
QCOMPARE(view.visualCursorIndex(), expectedVisualCursorIndex);
QCOMPARE(view.selectionModel()->currentIndex(), expectedEditedIndex);
@@ -3606,21 +3538,21 @@ void tst_QTableView::editSpanFromDirections()
QTRY_COMPARE(view.model()->data(expectedEditedIndex).toString(), QLatin1String("x"));
}
-class Model : public QAbstractTableModel {
-
-Q_OBJECT
-
+class Model : public QAbstractTableModel
+{
+ Q_OBJECT
public:
- Model(QObject * parent = 0) : QAbstractTableModel(parent) {
- }
+ using QAbstractTableModel::QAbstractTableModel;
- int rowCount(const QModelIndex &) const {
+ int rowCount(const QModelIndex &) const override
+ {
return rows;
}
- int columnCount(const QModelIndex &) const {
+ int columnCount(const QModelIndex &) const override
+ {
return columns;
}
- QVariant data(const QModelIndex &, int) const
+ QVariant data(const QModelIndex &, int) const override
{
return QVariant();
}
@@ -3630,8 +3562,8 @@ public:
endResetModel();
}
- int rows;
- int columns;
+ int rows = 0;
+ int columns = 0;
};
void tst_QTableView::checkHeaderReset()
@@ -3655,7 +3587,7 @@ void tst_QTableView::checkHeaderMinSize()
//viewport.
QTableView view;
QStringListModel m;
- m.setStringList( QStringList() << QLatin1String("one cell is enough"));
+ m.setStringList({QLatin1String("one cell is enough")});
view.setModel(&m);
//setting the minimum height on the horizontal header
@@ -3686,31 +3618,29 @@ void tst_QTableView::resizeToContents()
table2.verticalHeader()->setVisible(false);
- for(int i = 0;i<table.columnCount();i++) {
+ for (int i = 0; i < table.columnCount(); i++)
table.resizeColumnToContents(i);
- }
- for(int i = 0;i<table.rowCount();i++) {
+ for (int i = 0; i < table.rowCount(); i++)
table.resizeRowToContents(i);
- }
table2.resizeColumnsToContents();
table2.resizeRowsToContents();
table3.resizeColumnsToContents();
table3.resizeRowsToContents();
//now let's check the row/col sizes
- for(int i = 0;i<table.columnCount();i++) {
- QCOMPARE( table.columnWidth(i), table2.columnWidth(i));
- QCOMPARE( table2.columnWidth(i), table3.columnWidth(i));
+ for (int i = 0; i < table.columnCount(); i++) {
+ QCOMPARE(table.columnWidth(i), table2.columnWidth(i));
+ QCOMPARE(table2.columnWidth(i), table3.columnWidth(i));
}
- for(int i = 0;i<table.rowCount();i++) {
- QCOMPARE( table.rowHeight(i), table2.rowHeight(i));
- QCOMPARE( table2.rowHeight(i), table3.rowHeight(i));
+ for (int i = 0; i < table.rowCount(); i++) {
+ QCOMPARE(table.rowHeight(i), table2.rowHeight(i));
+ QCOMPARE(table2.rowHeight(i), table3.rowHeight(i));
}
}
QT_BEGIN_NAMESPACE
-extern bool Q_GUI_EXPORT qt_tab_all_widgets(); // qapplication.cpp
+extern bool Q_WIDGETS_EXPORT qt_tab_all_widgets(); // qapplication.cpp
QT_END_NAMESPACE
void tst_QTableView::tabFocus()
@@ -3740,57 +3670,57 @@ void tst_QTableView::tabFocus()
for (int i = 0; i < 2; ++i) {
// tab to view
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
QTRY_VERIFY(!window.hasFocus());
QVERIFY(view->hasFocus());
QVERIFY(!edit->hasFocus());
// tab to edit
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
}
// backtab to view
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QTRY_VERIFY(view->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!edit->hasFocus());
// backtab to edit
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- QStandardItemModel *model = new QStandardItemModel;
- view->setModel(model);
+ QStandardItemModel model;
+ view->setModel(&model);
// backtab to view
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QTRY_VERIFY(view->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!edit->hasFocus());
// backtab to edit
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- model->insertRow(0, new QStandardItem("Hei"));
- model->insertRow(0, new QStandardItem("Hei"));
- model->insertRow(0, new QStandardItem("Hei"));
+ model.insertRow(0, new QStandardItem("Hei"));
+ model.insertRow(0, new QStandardItem("Hei"));
+ model.insertRow(0, new QStandardItem("Hei"));
// backtab to view
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QTRY_VERIFY(view->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!edit->hasFocus());
// backtab to edit doesn't work
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QVERIFY(!window.hasFocus());
QVERIFY(view->hasFocus());
QVERIFY(!edit->hasFocus());
@@ -3798,41 +3728,38 @@ void tst_QTableView::tabFocus()
view->setTabKeyNavigation(false);
// backtab to edit
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Backtab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Backtab);
QTRY_VERIFY(edit->hasFocus());
QVERIFY(!window.hasFocus());
QVERIFY(!view->hasFocus());
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
QTRY_VERIFY(view->hasFocus());
- QTest::keyPress(qApp->focusWidget(), Qt::Key_Tab);
+ QTest::keyPress(QApplication::focusWidget(), Qt::Key_Tab);
QTRY_VERIFY(edit->hasFocus());
-
- delete model;
}
class BigModel : public QAbstractTableModel
{
Q_OBJECT
public:
- virtual QVariant data(const QModelIndex &index,
- int role = Qt::DisplayRole) const
+ QVariant data(const QModelIndex &index,
+ int role = Qt::DisplayRole) const override
{
if (role == Qt::DisplayRole)
return QString::number(index.column()) + QLatin1String(" - ") + QString::number(index.row());
return QVariant();
}
-
- int rowCount(const QModelIndex & parent = QModelIndex()) const
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override
{
- Q_UNUSED(parent);
+ Q_UNUSED(parent)
return 10000000;
}
- int columnCount(const QModelIndex & parent = QModelIndex()) const
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override
{
- Q_UNUSED(parent);
+ Q_UNUSED(parent)
return 20000000;
}
};
@@ -3861,7 +3788,7 @@ void tst_QTableView::selectionSignal()
view.resize(200, 200);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(model.index(2, 0)).center());
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {}, view.visualRect(model.index(2, 0)).center());
}
void tst_QTableView::setCurrentIndex()
@@ -3887,14 +3814,14 @@ void tst_QTableView::setCurrentIndex()
class task173773_EventFilter : public QObject
{
- int paintEventCount_;
+ int paintEventCount_ = 0;
public:
- task173773_EventFilter() : paintEventCount_(0) {}
+ using QObject::QObject;
int paintEventCount() const { return paintEventCount_; }
private:
- bool eventFilter(QObject *obj, QEvent *e)
+ bool eventFilter(QObject *obj, QEvent *e) override
{
- Q_UNUSED(obj);
+ Q_UNUSED(obj)
if (e->type() == QEvent::Paint)
++paintEventCount_;
return false;
@@ -4023,25 +3950,25 @@ void tst_QTableView::task248688_autoScrollNavigation()
#if QT_CONFIG(wheelevent)
void tst_QTableView::mouseWheel_data()
{
- QTest::addColumn<int>("scrollMode");
+ QTest::addColumn<QAbstractItemView::ScrollMode>("scrollMode");
QTest::addColumn<int>("delta");
QTest::addColumn<int>("horizontalPositon");
QTest::addColumn<int>("verticalPosition");
QTest::newRow("scroll up per item")
- << int(QAbstractItemView::ScrollPerItem) << 120
- << 10 - qApp->wheelScrollLines() << 10 - qApp->wheelScrollLines();
+ << QAbstractItemView::ScrollPerItem << 120
+ << 10 - QApplication::wheelScrollLines() << 10 - QApplication::wheelScrollLines();
QTest::newRow("scroll down per item")
- << int(QAbstractItemView::ScrollPerItem) << -120
- << 10 + qApp->wheelScrollLines() << 10 + qApp->wheelScrollLines();
+ << QAbstractItemView::ScrollPerItem << -120
+ << 10 + QApplication::wheelScrollLines() << 10 + QApplication::wheelScrollLines();
QTest::newRow("scroll down per pixel")
- << int(QAbstractItemView::ScrollPerPixel) << -120
- << 10 + qApp->wheelScrollLines() * 91 << 10 + qApp->wheelScrollLines() * 46;
+ << QAbstractItemView::ScrollPerPixel << -120
+ << 10 + QApplication::wheelScrollLines() * 91 << 10 + QApplication::wheelScrollLines() * 46;
}
void tst_QTableView::mouseWheel()
{
- QFETCH(int, scrollMode);
+ QFETCH(QAbstractItemView::ScrollMode, scrollMode);
QFETCH(int, delta);
QFETCH(int, horizontalPositon);
QFETCH(int, verticalPosition);
@@ -4061,14 +3988,16 @@ void tst_QTableView::mouseWheel()
for (int c = 0; c < 100; ++c)
view.setColumnWidth(c, 100);
- view.setHorizontalScrollMode((QAbstractItemView::ScrollMode)scrollMode);
- view.setVerticalScrollMode((QAbstractItemView::ScrollMode)scrollMode);
+ view.setHorizontalScrollMode(scrollMode);
+ view.setVerticalScrollMode(scrollMode);
view.horizontalScrollBar()->setValue(10);
view.verticalScrollBar()->setValue(10);
QPoint pos = view.viewport()->geometry().center();
- QWheelEvent verticalEvent(pos, delta, 0, 0, Qt::Vertical);
- QWheelEvent horizontalEvent(pos, delta, 0, 0, Qt::Horizontal);
+ QWheelEvent verticalEvent(pos, view.mapToGlobal(pos), QPoint(), QPoint(0, delta),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
+ QWheelEvent horizontalEvent(pos, view.mapToGlobal(pos), QPoint(), QPoint(delta, 0),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QApplication::sendEvent(view.viewport(), &horizontalEvent);
QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 15);
QApplication::sendEvent(view.viewport(), &verticalEvent);
@@ -4159,15 +4088,15 @@ void tst_QTableView::task191545_dragSelectRows()
QWidget *vHeaderVp = vHeader->viewport();
QPoint rowPos(cellRect.center());
QMouseEvent rowPressEvent(QEvent::MouseButtonPress, rowPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(vHeaderVp, &rowPressEvent);
+ QCoreApplication::sendEvent(vHeaderVp, &rowPressEvent);
for (int i = 0; i < 4; ++i) {
rowPos.setY(rowPos.y() + cellRect.height());
QMouseEvent moveEvent(QEvent::MouseMove, rowPos, Qt::NoButton, Qt::LeftButton, Qt::ControlModifier);
- qApp->sendEvent(vHeaderVp, &moveEvent);
+ QCoreApplication::sendEvent(vHeaderVp, &moveEvent);
}
QMouseEvent rowReleaseEvent(QEvent::MouseButtonRelease, rowPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(vHeaderVp, &rowReleaseEvent);
+ QCoreApplication::sendEvent(vHeaderVp, &rowReleaseEvent);
for (int i = 0; i < 4; ++i) {
QModelIndex index = model.index(3 + i, 0, table.rootIndex());
@@ -4181,15 +4110,15 @@ void tst_QTableView::task191545_dragSelectRows()
QWidget *hHeaderVp = hHeader->viewport();
QPoint colPos((cellRect.left() + cellRect.right()) / 2, 5);
QMouseEvent colPressEvent(QEvent::MouseButtonPress, colPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(hHeaderVp, &colPressEvent);
+ QCoreApplication::sendEvent(hHeaderVp, &colPressEvent);
for (int i = 0; i < 4; ++i) {
colPos.setX(colPos.x() + cellRect.width());
QMouseEvent moveEvent(QEvent::MouseMove, colPos, Qt::NoButton, Qt::LeftButton, Qt::ControlModifier);
- qApp->sendEvent(hHeaderVp, &moveEvent);
+ QCoreApplication::sendEvent(hHeaderVp, &moveEvent);
}
QMouseEvent colReleaseEvent(QEvent::MouseButtonRelease, colPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(hHeaderVp, &colReleaseEvent);
+ QCoreApplication::sendEvent(hHeaderVp, &colReleaseEvent);
for (int i = 0; i < 4; ++i) {
QModelIndex index = model.index(0, 3 + i, table.rootIndex());
@@ -4202,22 +4131,23 @@ void tst_QTableView::task191545_dragSelectRows()
QWidget *tableVp = table.viewport();
QPoint cellPos = cellRect.center();
QMouseEvent cellPressEvent(QEvent::MouseButtonPress, cellPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(tableVp, &cellPressEvent);
+ QCoreApplication::sendEvent(tableVp, &cellPressEvent);
for (int i = 0; i < 6; ++i) {
cellPos.setX(cellPos.x() + cellRect.width());
cellPos.setY(cellPos.y() + cellRect.height());
QMouseEvent moveEvent(QEvent::MouseMove, cellPos, Qt::NoButton, Qt::LeftButton, Qt::ControlModifier);
- qApp->sendEvent(tableVp, &moveEvent);
+ QCoreApplication::sendEvent(tableVp, &moveEvent);
}
QMouseEvent cellReleaseEvent(QEvent::MouseButtonRelease, cellPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(tableVp, &cellReleaseEvent);
+ QCoreApplication::sendEvent(tableVp, &cellReleaseEvent);
- for (int i = 0; i < 6; ++i)
+ for (int i = 0; i < 6; ++i) {
for (int j = 0; j < 6; ++j) {
QModelIndex index = model.index(2 + i, 2 + j, table.rootIndex());
QVERIFY(table.selectionModel()->isSelected(index));
}
+ }
}
{
@@ -4225,23 +4155,24 @@ void tst_QTableView::task191545_dragSelectRows()
QWidget *tableVp = table.viewport();
QPoint cellPos = cellRect.center();
QMouseEvent cellPressEvent(QEvent::MouseButtonPress, cellPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(tableVp, &cellPressEvent);
+ QCoreApplication::sendEvent(tableVp, &cellPressEvent);
for (int i = 0; i < 6; ++i) {
cellPos.setX(cellPos.x() + cellRect.width());
cellPos.setY(cellPos.y() + cellRect.height());
QMouseEvent moveEvent(QEvent::MouseMove, cellPos, Qt::NoButton, Qt::LeftButton, Qt::ControlModifier);
- qApp->sendEvent(tableVp, &moveEvent);
+ QCoreApplication::sendEvent(tableVp, &moveEvent);
}
QMouseEvent cellReleaseEvent(QEvent::MouseButtonRelease, cellPos, Qt::LeftButton, Qt::NoButton, Qt::ControlModifier);
- qApp->sendEvent(tableVp, &cellReleaseEvent);
+ QCoreApplication::sendEvent(tableVp, &cellReleaseEvent);
QTest::qWait(200);
- for (int i = 0; i < 6; ++i)
+ for (int i = 0; i < 6; ++i) {
for (int j = 0; j < 6; ++j) {
QModelIndex index = model.index(3 + i, 3 + j, table.rootIndex());
QVERIFY(!table.selectionModel()->isSelected(index));
}
+ }
}
}
@@ -4319,8 +4250,6 @@ void tst_QTableView::taskQTBUG_4516_clickOnRichTextLabel()
QTest::mouseClick(&label, Qt::LeftButton);
QCOMPARE(view.currentIndex(), model.index(1,1));
-
-
}
@@ -4353,21 +4282,23 @@ void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader()
int sbValueBefore = view.verticalScrollBar()->value();
QHeaderView *header = view.verticalHeader();
QTest::mouseMove(header);
- QWheelEvent wheelEvent(header->geometry().center(), -720, 0, 0);
+ QPoint pos = header->geometry().center();
+ QWheelEvent wheelEvent(pos, header->viewport()->mapToGlobal(pos), QPoint(), QPoint(0, -720),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QApplication::sendEvent(header->viewport(), &wheelEvent);
int sbValueAfter = view.verticalScrollBar()->value();
QVERIFY(sbValueBefore != sbValueAfter);
}
#endif
-class TestTableView : public QTableView {
-Q_OBJECT
+class TestTableView : public QTableView
+{
+ Q_OBJECT
public:
- TestTableView(QWidget *parent = 0) : QTableView(parent)
+ TestTableView(QWidget *parent = nullptr) : QTableView(parent)
{
- connect(this, SIGNAL(entered(QModelIndex)), this, SLOT(openEditor(QModelIndex)));
+ connect(this, &QTableView::entered, this, &TestTableView::openPersistentEditor);
}
- ~TestTableView(){}
public slots:
void onDataChanged()
{
@@ -4375,9 +4306,6 @@ public slots:
setRowHidden(i, model()->data(model()->index(i, 0)).toBool());
}
}
-
- void openEditor(const QModelIndex& index)
- { openPersistentEditor(index); }
};
@@ -4385,15 +4313,13 @@ void tst_QTableView::taskQTBUG_8585_crashForNoGoodReason()
{
QStandardItemModel model;
model.insertColumn(0, QModelIndex());
- for(int i = 0; i < 20; i++)
- {
+ for (int i = 0; i < 20; i++)
model.insertRow(i);
- }
TestTableView w;
w.setMouseTracking(true);
w.setModel(&model);
- connect(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), &w, SLOT(onDataChanged()));
+ connect(&model, &QStandardItemModel::dataChanged, &w, &TestTableView::onDataChanged);
w.show();
QVERIFY(QTest::qWaitForWindowExposed(&w));
for (int i = 0; i < 10; i++)
@@ -4407,10 +4333,7 @@ void tst_QTableView::taskQTBUG_8585_crashForNoGoodReason()
class TableView7774 : public QTableView
{
public:
- QRegion visualRegionForSelection(const QItemSelection &selection) const
- {
- return QTableView::visualRegionForSelection(selection);
- }
+ using QTableView::visualRegionForSelection;
};
void tst_QTableView::taskQTBUG_7774_RtoLVisualRegionForSelection()
@@ -4570,5 +4493,58 @@ void tst_QTableView::taskQTBUG_50171_selectRowAfterSwapColumns()
}
}
+class DeselectTableWidget : public QTableWidget
+{
+public:
+ using QTableWidget::QTableWidget;
+ QItemSelectionModel::SelectionFlags selectionCommand(const QModelIndex &,
+ const QEvent * = nullptr) const override
+ {
+ return QItemSelectionModel::Toggle;
+ }
+};
+
+void tst_QTableView::deselectRow()
+{
+ DeselectTableWidget tw(20, 20);
+ tw.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&tw));
+ tw.hideColumn(0);
+ QVERIFY(tw.isColumnHidden(0));
+ tw.selectRow(1);
+ QVERIFY(tw.selectionModel()->isRowSelected(1, QModelIndex()));
+ tw.selectRow(1);
+ // QTBUG-79092 - deselection was not possible when column 0 was hidden
+ QVERIFY(!tw.selectionModel()->isRowSelected(1, QModelIndex()));
+}
+
+// This has nothing to do with QTableView, but it's convenient to reuse the QtTestTableModel
+#if QT_CONFIG(textmarkdownwriter)
+
+// #define DEBUG_WRITE_OUTPUT
+
+void tst_QTableView::markdownWriter()
+{
+ QtTestTableModel model(2, 3);
+ QString md;
+ {
+ QTextStream stream(&md);
+ QTextMarkdownWriter writer(stream, QTextDocument::MarkdownDialectGitHub);
+ writer.writeTable(&model);
+ }
+
+#ifdef DEBUG_WRITE_OUTPUT
+ {
+ QFile out("/tmp/table.md");
+ out.open(QFile::WriteOnly);
+ out.write(md.toUtf8());
+ out.close();
+ }
+#endif
+
+ QCOMPARE(md, QString::fromLatin1("|1 |2 |3 |\n|-------|-------|-------|\n|[0,0,0]|[0,1,0]|[0,2,0]|\n|[1,0,0]|[1,1,0]|[1,2,0]|\n"));
+}
+#endif
+
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"
diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
index c2de5c2761..f640996690 100644
--- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
@@ -26,15 +26,12 @@
**
****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qeventloop.h>
-#include <qlist.h>
-#include <qpair.h>
-#include <qheaderview.h>
-#include <qlineedit.h>
-
-#include <qtablewidget.h>
+#include <QHeaderView>
+#include <QLineEdit>
+#include <QMimeData>
+#include <QSignalSpy>
+#include <QTableWidget>
+#include <QTest>
class QObjectTableItem : public QObject, public QTableWidgetItem
{
@@ -46,11 +43,10 @@ class tst_QTableWidget : public QObject
Q_OBJECT
public:
- tst_QTableWidget();
+ using QObject::QObject;
private slots:
void initTestCase();
- void cleanupTestCase();
void init();
void getSetCheck();
void clear();
@@ -97,12 +93,12 @@ private slots:
#endif
private:
- QTableWidget *testWidget;
+ std::unique_ptr<QTableWidget> testWidget;
};
-typedef QPair<int, int> IntPair;
-typedef QList<int> IntList;
-typedef QList<IntPair> IntIntList;
+using IntPair = QPair<int, int>;
+using IntList = QVector<int>;
+using IntIntList = QVector<IntPair>;
Q_DECLARE_METATYPE(QTableWidgetSelectionRange)
@@ -143,45 +139,36 @@ void tst_QTableWidget::getSetCheck()
obj1.setItem(3, 3, new QTableWidgetItem("3,3"));
obj1.setCurrentItem(var3);
QCOMPARE(var3, obj1.currentItem());
- obj1.setCurrentItem((QTableWidgetItem *)0);
- QCOMPARE((QTableWidgetItem *)0, obj1.currentItem());
- obj1.setItem(0, 0, 0);
- QCOMPARE((QTableWidgetItem *)0, obj1.item(0, 0));
+ obj1.setCurrentItem(nullptr);
+ QCOMPARE(obj1.currentItem(), nullptr);
+ obj1.setItem(0, 0, nullptr);
+ QCOMPARE(obj1.item(0, 0), nullptr);
// const QTableWidgetItem * QTableWidget::itemPrototype()
// void QTableWidget::setItemPrototype(const QTableWidgetItem *)
const QTableWidgetItem *var4 = new QTableWidgetItem;
obj1.setItemPrototype(var4);
QCOMPARE(var4, obj1.itemPrototype());
- obj1.setItemPrototype((QTableWidgetItem *)0);
- QCOMPARE((const QTableWidgetItem *)0, obj1.itemPrototype());
-}
-
-tst_QTableWidget::tst_QTableWidget(): testWidget(0)
-{
+ obj1.setItemPrototype(nullptr);
+ QCOMPARE(obj1.itemPrototype(), nullptr);
}
void tst_QTableWidget::initTestCase()
{
- testWidget = new QTableWidget();
+ testWidget.reset(new QTableWidget);
testWidget->show();
QApplication::setKeyboardInputInterval(100);
}
-void tst_QTableWidget::cleanupTestCase()
-{
- delete testWidget;
-}
-
void tst_QTableWidget::init()
{
testWidget->clear();
testWidget->setRowCount(5);
testWidget->setColumnCount(5);
- for (int row=0; row < testWidget->rowCount(); ++row)
+ for (int row = 0; row < testWidget->rowCount(); ++row)
testWidget->showRow(row);
- for (int column=0; column < testWidget->columnCount(); ++column)
+ for (int column = 0; column < testWidget->columnCount(); ++column)
testWidget->showColumn(column);
}
@@ -319,13 +306,15 @@ void tst_QTableWidget::item()
QCOMPARE(testWidget->rowCount(), rowCount);
QCOMPARE(testWidget->columnCount(), columnCount);
- for (int r = 0; r < testWidget->rowCount(); ++r)
+ for (int r = 0; r < testWidget->rowCount(); ++r) {
for (int c = 0; c < testWidget->columnCount(); ++c)
testWidget->setItem(r, c, new QTableWidgetItem(QString::number(r * c + c)));
+ }
- for (int r = 0; r < testWidget->rowCount(); ++r)
+ for (int r = 0; r < testWidget->rowCount(); ++r) {
for (int c = 0; c < testWidget->columnCount(); ++c)
QCOMPARE(testWidget->item(r, c)->text(), QString::number(r * c + c));
+ }
QTableWidgetItem *item = testWidget->item(row, column);
QCOMPARE(!!item, expectItem);
@@ -361,15 +350,17 @@ void tst_QTableWidget::takeItem()
QCOMPARE(testWidget->rowCount(), rowCount);
QCOMPARE(testWidget->columnCount(), columnCount);
- for (int r = 0; r < testWidget->rowCount(); ++r)
+ for (int r = 0; r < testWidget->rowCount(); ++r) {
for (int c = 0; c < testWidget->columnCount(); ++c)
testWidget->setItem(r, c, new QTableWidgetItem(QString::number(r * c + c)));
+ }
- for (int r = 0; r < testWidget->rowCount(); ++r)
+ for (int r = 0; r < testWidget->rowCount(); ++r) {
for (int c = 0; c < testWidget->columnCount(); ++c)
QCOMPARE(testWidget->item(r, c)->text(), QString::number(r * c + c));
+ }
- QSignalSpy spy(testWidget, &QTableWidget::cellChanged);
+ QSignalSpy spy(testWidget.get(), &QTableWidget::cellChanged);
QTableWidgetItem *item = testWidget->takeItem(row, column);
QCOMPARE(!!item, expectItem);
if (expectItem) {
@@ -516,11 +507,11 @@ void tst_QTableWidget::selectedItems()
{
QFETCH(int, rowCount);
QFETCH(int, columnCount);
- QFETCH(IntIntList, createItems);
- QFETCH(IntList, hiddenRows);
- QFETCH(IntList, hiddenColumns);
- QFETCH(QTableWidgetSelectionRange, selectionRange);
- QFETCH(IntIntList, expectedItems);
+ QFETCH(const IntIntList, createItems);
+ QFETCH(const IntList, hiddenRows);
+ QFETCH(const IntList, hiddenColumns);
+ QFETCH(const QTableWidgetSelectionRange, selectionRange);
+ QFETCH(const IntIntList, expectedItems);
// set dimensions and test they are ok
testWidget->setRowCount(rowCount);
@@ -529,15 +520,15 @@ void tst_QTableWidget::selectedItems()
QCOMPARE(testWidget->columnCount(), columnCount);
// create and set items
- foreach (IntPair intPair, createItems) {
+ for (const auto &intPair : createItems) {
testWidget->setItem(intPair.first, intPair.second,
new QTableWidgetItem(QString("Item %1 %2")
.arg(intPair.first).arg(intPair.second)));
}
// hide rows/columns
- foreach (int row, hiddenRows)
+ for (int row : hiddenRows)
testWidget->setRowHidden(row, true);
- foreach (int column, hiddenColumns)
+ for (int column : hiddenColumns)
testWidget->setColumnHidden(column, true);
// make sure we don't have any previous selections hanging around
@@ -557,31 +548,18 @@ void tst_QTableWidget::selectedItems()
}
// check that the correct number of items and the expected items are there
- QList<QTableWidgetItem *> selectedItems = testWidget->selectedItems();
+ const QList<QTableWidgetItem *> selectedItems = testWidget->selectedItems();
QCOMPARE(selectedItems.count(), expectedItems.count());
- foreach (IntPair intPair, expectedItems)
+ for (const auto &intPair : expectedItems)
QVERIFY(selectedItems.contains(testWidget->item(intPair.first, intPair.second)));
// check that setItemSelected agrees with selectedItems
- for (int row = 0; row<testWidget->rowCount(); ++row) {
- bool hidden = false;
- foreach (int hiddenRow, hiddenRows){
- if(hiddenRow == row){
- hidden = true;
- break;
- }
- }
- if (hidden)
+ for (int row = 0; row < testWidget->rowCount(); ++row) {
+ if (hiddenRows.contains(row))
continue;
- for (int column = 0; column<testWidget->columnCount(); ++column) {
- foreach (int hiddenColumn, hiddenColumns){
- if(hiddenColumn == column){
- hidden = true;
- break;
- }
- }
- if (hidden)
+ for (int column = 0; column < testWidget->columnCount(); ++column) {
+ if (hiddenColumns.contains(column))
continue;
QTableWidgetItem *item = testWidget->item(row, column);
@@ -621,11 +599,13 @@ void tst_QTableWidget::removeRow()
QCOMPARE(testWidget->columnCount(), columnCount);
// fill table with items
- for (int r = 0; r < rowCount; ++r)
- for (int c = 0; c < columnCount; ++c)
+ for (int r = 0; r < rowCount; ++r) {
+ const QString rRow = QString::number(r) + QLatin1Char(':');
+ for (int c = 0; c < columnCount; ++c) {
testWidget->setItem(r, c,
- new QTableWidgetItem(
- QString::number(r) + ":" + QString::number(c)));
+ new QTableWidgetItem(rRow + QString::number(c)));
+ }
+ }
// remove and compare the results
testWidget->removeRow(row);
@@ -633,14 +613,18 @@ void tst_QTableWidget::removeRow()
QCOMPARE(testWidget->columnCount(), expectedColumnCount);
// check if the correct items were removed
- for (int r = 0; r < expectedRowCount; ++r)
- for (int c = 0; c < expectedColumnCount; ++c)
+ for (int r = 0; r < expectedRowCount; ++r) {
+ const QString rRow = QString::number(r < row ? r : r + 1) +
+ QLatin1Char(':');
+ for (int c = 0; c < expectedColumnCount; ++c) {
if (r < row)
QCOMPARE(testWidget->item(r, c)->text(),
- QString::number(r) + ":" + QString::number(c));
+ rRow + QString::number(c));
else
QCOMPARE(testWidget->item(r, c)->text(),
- QString::number(r + 1) + ":" + QString::number(c));
+ rRow + QString::number(c));
+ }
+ }
}
void tst_QTableWidget::removeColumn_data()
@@ -673,11 +657,14 @@ void tst_QTableWidget::removeColumn()
QCOMPARE(testWidget->columnCount(), columnCount);
// fill table with items
- for (int r = 0; r < rowCount; ++r)
- for (int c = 0; c < columnCount; ++c)
+ for (int r = 0; r < rowCount; ++r) {
+ const QString rStr = QString::number(r) + QLatin1Char(':');
+ for (int c = 0; c < columnCount; ++c) {
testWidget->setItem(r, c,
new QTableWidgetItem(
- QString::number(r) + ":" + QString::number(c)));
+ rStr + QString::number(c)));
+ }
+ }
// remove and compare the results
testWidget->removeColumn(column);
@@ -686,14 +673,17 @@ void tst_QTableWidget::removeColumn()
// check if the correct items were removed
- for (int r = 0; r < expectedRowCount; ++r)
- for (int c = 0; c < expectedColumnCount; ++c)
+ for (int r = 0; r < expectedRowCount; ++r) {
+ const QString rStr = QString::number(r) + QLatin1Char(':');
+ for (int c = 0; c < expectedColumnCount; ++c) {
if (c < column)
QCOMPARE(testWidget->item(r, c)->text(),
- QString::number(r) + ":" + QString::number(c));
+ rStr + QString::number(c));
else
QCOMPARE(testWidget->item(r, c)->text(),
- QString::number(r) + ":" + QString::number(c + 1));
+ rStr + QString::number(c + 1));
+ }
+ }
}
void tst_QTableWidget::insertRow_data()
@@ -819,7 +809,7 @@ void tst_QTableWidget::itemOwnership()
item = new QObjectTableItem();
testWidget->setItem(0, 0, item);
delete item;
- QCOMPARE(testWidget->item(0, 0), (QTableWidgetItem *)0);
+ QCOMPARE(testWidget->item(0, 0), nullptr);
//delete vertical headeritem from outside
headerItem = new QObjectTableItem();
@@ -887,7 +877,7 @@ void tst_QTableWidget::sortItems_data()
{
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<int>("sortColumn");
QTest::addColumn<QStringList>("initial");
QTest::addColumn<QStringList>("expected");
@@ -897,7 +887,7 @@ void tst_QTableWidget::sortItems_data()
QTest::newRow("ascending")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
<< "0" << "a" << "o" << "8" << "k"
@@ -915,7 +905,7 @@ void tst_QTableWidget::sortItems_data()
QTest::newRow("descending")
<< 4 << 5
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< 0
<< (QStringList()
<< "0" << "a" << "o" << "8" << "k"
@@ -933,154 +923,151 @@ void tst_QTableWidget::sortItems_data()
QTest::newRow("empty table")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
- << 0 << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0)
+ << QString() << QString() << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString())
<< (QStringList()
- << 0 << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0)
+ << QString() << QString() << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString())
<< IntList()
<< IntList()
<< IntList();
-
QTest::newRow("half-empty table")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
- << "0" << 0 << 0 << 0 << 0
- << "3" << "d" << 0 << 0 << 0
- << "2" << "c" << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0)
+ << "0" << QString() << QString() << QString() << QString()
+ << "3" << "d" << QString() << QString() << QString()
+ << "2" << "c" << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString())
<< (QStringList()
- << "0" << 0 << 0 << 0 << 0
- << "2" << "c" << 0 << 0 << 0
- << "3" << "d" << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0)
+ << "0" << QString() << QString() << QString() << QString()
+ << "2" << "c" << QString() << QString() << QString()
+ << "3" << "d" << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString())
<< (IntList() << 0 << 2 << 1)
<< IntList()
<< IntList();
QTest::newRow("empty column, should not sort.")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 3
<< (QStringList()
- << "0" << 0 << 0 << 0 << 0
- << "3" << "d" << 0 << 0 << 0
- << "2" << "c" << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0)
+ << "0" << QString() << QString() << QString() << QString()
+ << "3" << "d" << QString() << QString() << QString()
+ << "2" << "c" << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString())
<< (QStringList()
- << "0" << 0 << 0 << 0 << 0
- << "3" << "d" << 0 << 0 << 0
- << "2" << "c" << 0 << 0 << 0
- << 0 << 0 << 0 << 0 << 0)
+ << "0" << QString() << QString() << QString() << QString()
+ << "3" << "d" << QString() << QString() << QString()
+ << "2" << "c" << QString() << QString() << QString()
+ << QString() << QString() << QString() << QString() << QString())
<< IntList()
<< IntList()
<< IntList();
QTest::newRow("descending with null cell, the null cell should be placed at the bottom")
<< 4 << 5
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< 0
<< (QStringList()
- << "0" << "a" << "o" << "8" << "k"
- << "3" << "d" << "k" << "o" << "6"
- << "2" << "c" << "9" << "y" << "8"
- << 0 << "b" << "7" << "3" << "u")
+ << "0" << "a" << "o" << "8" << "k"
+ << "3" << "d" << "k" << "o" << "6"
+ << "2" << "c" << "9" << "y" << "8"
+ << QString() << "b" << "7" << "3" << "u")
<< (QStringList()
- << "3" << "d" << "k" << "o" << "6"
- << "2" << "c" << "9" << "y" << "8"
- << "0" << "a" << "o" << "8" << "k"
- << 0 << "b" << "7" << "3" << "u")
+ << "3" << "d" << "k" << "o" << "6"
+ << "2" << "c" << "9" << "y" << "8"
+ << "0" << "a" << "o" << "8" << "k"
+ << QString() << "b" << "7" << "3" << "u")
<< (IntList() << 2 << 0 << 1)
<< IntList()
<< IntList();
QTest::newRow("ascending with null cell, the null cell should be placed at the bottom")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
- << "0" << "a" << "o" << "8" << "k"
- << "3" << "d" << "k" << "o" << "6"
- << "2" << "c" << "9" << "y" << "8"
- << 0 << "b" << "7" << "3" << "u")
+ << "0" << "a" << "o" << "8" << "k"
+ << "3" << "d" << "k" << "o" << "6"
+ << "2" << "c" << "9" << "y" << "8"
+ << QString() << "b" << "7" << "3" << "u")
<< (QStringList()
- << "0" << "a" << "o" << "8" << "k"
- << "2" << "c" << "9" << "y" << "8"
- << "3" << "d" << "k" << "o" << "6"
- << 0 << "b" << "7" << "3" << "u")
+ << "0" << "a" << "o" << "8" << "k"
+ << "2" << "c" << "9" << "y" << "8"
+ << "3" << "d" << "k" << "o" << "6"
+ << QString() << "b" << "7" << "3" << "u")
<< (IntList() << 0 << 2 << 1)
<< IntList()
<< IntList();
QTest::newRow("ascending with null cells, the null cells should be placed at the bottom")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
- << "3" << "d" << "k" << "o" << "6"
- << "0" << "a" << "o" << "8" << "k"
- << 0 << "c" << "9" << "y" << "8"
- << 0 << "b" << "7" << "3" << "u")
+ << "3" << "d" << "k" << "o" << "6"
+ << "0" << "a" << "o" << "8" << "k"
+ << QString() << "c" << "9" << "y" << "8"
+ << QString() << "b" << "7" << "3" << "u")
<< (QStringList()
- << "0" << "a" << "o" << "8" << "k"
- << "3" << "d" << "k" << "o" << "6"
- << 0 << "c" << "9" << "y" << "8"
- << 0 << "b" << "7" << "3" << "u")
+ << "0" << "a" << "o" << "8" << "k"
+ << "3" << "d" << "k" << "o" << "6"
+ << QString() << "c" << "9" << "y" << "8"
+ << QString() << "b" << "7" << "3" << "u")
<< (IntList() << 1 << 0)
<< IntList()
<< IntList();
QTest::newRow("ascending... Check a bug in PersistentIndexes")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
<< "3" << "c" << "9" << "y" << "8"
<< "2" << "b" << "7" << "3" << "u"
<< "4" << "d" << "k" << "o" << "6"
- << "1" << "a" << "o" << "8" << "k"
- )
+ << "1" << "a" << "o" << "8" << "k")
<< (QStringList()
<< "1" << "a" << "o" << "8" << "k"
<< "2" << "b" << "7" << "3" << "u"
<< "3" << "c" << "9" << "y" << "8"
- << "4" << "d" << "k" << "o" << "6"
- )
+ << "4" << "d" << "k" << "o" << "6")
<< (IntList() << 2 << 1 << 3 << 0)
<< IntList()
<< IntList();
QTest::newRow("ascending with some null cells inbetween")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
- << 0 << "a" << "o" << "8" << "k"
- << "2" << "c" << "9" << "y" << "8"
- << 0 << "d" << "k" << "o" << "6"
- << "1" << "b" << "7" << "3" << "u")
+ << QString() << "a" << "o" << "8" << "k"
+ << "2" << "c" << "9" << "y" << "8"
+ << QString() << "d" << "k" << "o" << "6"
+ << "1" << "b" << "7" << "3" << "u")
<< (QStringList()
- << "1" << "b" << "7" << "3" << "u"
- << "2" << "c" << "9" << "y" << "8"
- << 0 << "a" << "o" << "8" << "k"
- << 0 << "d" << "k" << "o" << "6")
+ << "1" << "b" << "7" << "3" << "u"
+ << "2" << "c" << "9" << "y" << "8"
+ << QString() << "a" << "o" << "8" << "k"
+ << QString() << "d" << "k" << "o" << "6")
<< (IntList() << 1 << 0)
<< IntList()
<< IntList();
QTest::newRow("ascending hidden")
<< 4 << 5
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< 0
<< (QStringList()
<< "0" << "a" << "o" << "8" << "k"
@@ -1098,7 +1085,7 @@ void tst_QTableWidget::sortItems_data()
QTest::newRow("descending hidden")
<< 4 << 5
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< 0
<< (QStringList()
<< "0" << "a" << "o" << "8" << "k"
@@ -1119,7 +1106,7 @@ void tst_QTableWidget::sortItems()
{
QFETCH(int, rowCount);
QFETCH(int, columnCount);
- QFETCH(int, sortOrder);
+ QFETCH(Qt::SortOrder, sortOrder);
QFETCH(int, sortColumn);
QFETCH(QStringList, initial);
QFETCH(QStringList, expected);
@@ -1131,13 +1118,13 @@ void tst_QTableWidget::sortItems()
testWidget->setColumnCount(columnCount);
QAbstractItemModel *model = testWidget->model();
- QList<QPersistentModelIndex> persistent;
+ QVector<QPersistentModelIndex> persistent;
int ti = 0;
for (int r = 0; r < rowCount; ++r) {
for (int c = 0; c < columnCount; ++c) {
- QString str = initial.at(ti++);
- if (!str.isNull()) {
+ QString str = initial.at(ti++);
+ if (!str.isEmpty()) {
testWidget->setItem(r, c, new QTableWidgetItem(str));
}
}
@@ -1150,7 +1137,7 @@ void tst_QTableWidget::sortItems()
QCOMPARE(testWidget->verticalHeader()->hiddenSectionCount(), initialHidden.count());
- testWidget->sortItems(sortColumn, static_cast<Qt::SortOrder>(sortOrder));
+ testWidget->sortItems(sortColumn, sortOrder);
int te = 0;
for (int i = 0; i < rows.count(); ++i) {
@@ -1175,7 +1162,7 @@ void tst_QTableWidget::setItemWithSorting_data()
{
QTest::addColumn<int>("rowCount");
QTest::addColumn<int>("columnCount");
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<int>("sortColumn");
QTest::addColumn<QStringList>("initialValues");
QTest::addColumn<int>("row");
@@ -1187,7 +1174,7 @@ void tst_QTableWidget::setItemWithSorting_data()
QTest::newRow("2x1 no change (ascending)")
<< 2 << 1
- << static_cast<int>(Qt::AscendingOrder) << 0
+ << Qt::AscendingOrder << 0
<< (QStringList() << "0" << "1")
<< 1 << 0 << "2"
<< (QStringList() << "0" << "2")
@@ -1195,7 +1182,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< false;
QTest::newRow("2x1 no change (descending)")
<< 2 << 1
- << static_cast<int>(Qt::DescendingOrder) << 0
+ << Qt::DescendingOrder << 0
<< (QStringList() << "1" << "0")
<< 0 << 0 << "2"
<< (QStringList() << "2" << "0")
@@ -1203,7 +1190,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< false;
QTest::newRow("2x1 reorder (ascending)")
<< 2 << 1
- << static_cast<int>(Qt::AscendingOrder) << 0
+ << Qt::AscendingOrder << 0
<< (QStringList() << "0" << "1")
<< 0 << 0 << "2"
<< (QStringList() << "1" << "2")
@@ -1211,7 +1198,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< true;
QTest::newRow("2x1 reorder (descending)")
<< 2 << 1
- << static_cast<int>(Qt::DescendingOrder) << 0
+ << Qt::DescendingOrder << 0
<< (QStringList() << "1" << "0")
<< 1 << 0 << "2"
<< (QStringList() << "2" << "1")
@@ -1219,7 +1206,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< true;
QTest::newRow("2x2 no change (ascending)")
<< 2 << 2
- << static_cast<int>(Qt::AscendingOrder) << 0
+ << Qt::AscendingOrder << 0
<< (QStringList()
<< "0" << "00"
<< "1" << "11")
@@ -1231,7 +1218,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< false;
QTest::newRow("2x2 reorder (ascending)")
<< 2 << 2
- << static_cast<int>(Qt::AscendingOrder) << 0
+ << Qt::AscendingOrder << 0
<< (QStringList()
<< "0" << "00"
<< "1" << "11")
@@ -1243,7 +1230,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< true;
QTest::newRow("2x2 reorder (ascending, sortColumn = 1)")
<< 2 << 2
- << static_cast<int>(Qt::AscendingOrder) << 1
+ << Qt::AscendingOrder << 1
<< (QStringList()
<< "00" << "0"
<< "11" << "1")
@@ -1255,7 +1242,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< true;
QTest::newRow("2x2 no change (column != sortColumn)")
<< 2 << 2
- << static_cast<int>(Qt::AscendingOrder) << 1
+ << Qt::AscendingOrder << 1
<< (QStringList()
<< "00" << "0"
<< "11" << "1")
@@ -1267,7 +1254,7 @@ void tst_QTableWidget::setItemWithSorting_data()
<< false;
QTest::newRow("8x4 reorder (ascending, sortColumn = 3)")
<< 8 << 4
- << static_cast<int>(Qt::AscendingOrder) << 3
+ << Qt::AscendingOrder << 3
<< (QStringList()
<< "q" << "v" << "u" << "0"
<< "e" << "j" << "i" << "10"
@@ -1293,9 +1280,13 @@ void tst_QTableWidget::setItemWithSorting_data()
void tst_QTableWidget::setItemWithSorting()
{
+ static int dummy1 = qRegisterMetaType<QList<QPersistentModelIndex>>();
+ static int dummy2 = qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>();
+ Q_UNUSED(dummy1);
+ Q_UNUSED(dummy2);
QFETCH(int, rowCount);
QFETCH(int, columnCount);
- QFETCH(int, sortOrder);
+ QFETCH(Qt::SortOrder, sortOrder);
QFETCH(int, sortColumn);
QFETCH(QStringList, initialValues);
QFETCH(int, row);
@@ -1309,7 +1300,7 @@ void tst_QTableWidget::setItemWithSorting()
QTableWidget w(rowCount, columnCount);
QAbstractItemModel *model = w.model();
- QList<QPersistentModelIndex> persistent;
+ QVector<QPersistentModelIndex> persistent;
int ti = 0;
for (int r = 0; r < rowCount; ++r) {
@@ -1320,11 +1311,11 @@ void tst_QTableWidget::setItemWithSorting()
persistent << model->index(r, sortColumn);
}
- w.sortItems(sortColumn, static_cast<Qt::SortOrder>(sortOrder));
+ w.sortItems(sortColumn, sortOrder);
w.setSortingEnabled(true);
- QSignalSpy dataChangedSpy(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
- QSignalSpy layoutChangedSpy(model, SIGNAL(layoutChanged()));
+ QSignalSpy dataChangedSpy(model, &QAbstractItemModel::dataChanged);
+ QSignalSpy layoutChangedSpy(model, &QAbstractItemModel::layoutChanged);
if (i == 0) {
// set a new item
@@ -1376,18 +1367,18 @@ public:
void tst_QTableWidget::itemData()
{
QTableWidgetDataChanged widget(2, 2);
- widget.setItem(0, 0, new QTableWidgetItem());
+ widget.setItem(0, 0, new QTableWidgetItem);
QTableWidgetItem *item = widget.item(0, 0);
QVERIFY(item);
item->setFlags(item->flags() | Qt::ItemIsEditable);
item->setData(Qt::DisplayRole, QString("0"));
QCOMPARE(widget.currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
item->setData(Qt::CheckStateRole, Qt::PartiallyChecked);
- QCOMPARE(widget.currentRoles, {Qt::CheckStateRole});
+ QCOMPARE(widget.currentRoles, QVector<int>{Qt::CheckStateRole});
for (int i = 0; i < 4; ++i)
{
item->setData(Qt::UserRole + i, QString::number(i + 1));
- QCOMPARE(widget.currentRoles, {Qt::UserRole + i});
+ QCOMPARE(widget.currentRoles, QVector<int>{Qt::UserRole + i});
}
QMap<int, QVariant> flags = widget.model()->itemData(widget.model()->index(0, 0));
QCOMPARE(flags.count(), 6);
@@ -1399,7 +1390,7 @@ void tst_QTableWidget::setItemData()
{
QTableWidgetDataChanged table(10, 10);
table.setSortingEnabled(false);
- QSignalSpy dataChangedSpy(table.model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)));
+ QSignalSpy dataChangedSpy(table.model(), &QAbstractItemModel::dataChanged);
QTableWidgetItem *item = new QTableWidgetItem;
table.setItem(0, 0, item);
@@ -1432,11 +1423,11 @@ void tst_QTableWidget::cellWidget()
QTableWidget table(10, 10);
QWidget widget;
- QCOMPARE(table.cellWidget(5, 5), static_cast<QWidget*>(0));
+ QCOMPARE(table.cellWidget(5, 5), nullptr);
table.setCellWidget(5, 5, &widget);
QCOMPARE(table.cellWidget(5, 5), &widget);
table.removeCellWidget(5, 5);
- QCOMPARE(table.cellWidget(5, 5), static_cast<QWidget*>(0));
+ QCOMPARE(table.cellWidget(5, 5), nullptr);
}
void tst_QTableWidget::cellWidgetGeometry()
@@ -1463,27 +1454,29 @@ void tst_QTableWidget::cellWidgetGeometry()
void tst_QTableWidget::sizeHint_data()
{
- QTest::addColumn<int>("scrollBarPolicy");
+ QTest::addColumn<Qt::ScrollBarPolicy>("scrollBarPolicy");
QTest::addColumn<QSize>("viewSize");
- QTest::newRow("ScrollBarAlwaysOn") << static_cast<int>(Qt::ScrollBarAlwaysOn) << QSize();
- QTest::newRow("ScrollBarAlwaysOff") << static_cast<int>(Qt::ScrollBarAlwaysOff) << QSize();
+ QTest::newRow("ScrollBarAlwaysOn") << Qt::ScrollBarAlwaysOn << QSize();
+ QTest::newRow("ScrollBarAlwaysOff") << Qt::ScrollBarAlwaysOff << QSize();
// make sure the scrollbars are shown by resizing the view to 40x40
- QTest::newRow("ScrollBarAsNeeded (40x40)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(40, 40);
- QTest::newRow("ScrollBarAsNeeded (1000x1000)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(1000, 1000);
+ QTest::newRow("ScrollBarAsNeeded (40x40)") << Qt::ScrollBarAsNeeded << QSize(40, 40);
+ QTest::newRow("ScrollBarAsNeeded (1000x1000)") << Qt::ScrollBarAsNeeded << QSize(1000, 1000);
}
void tst_QTableWidget::sizeHint()
{
- QFETCH(int, scrollBarPolicy);
+ QFETCH(Qt::ScrollBarPolicy, scrollBarPolicy);
QFETCH(QSize, viewSize);
QTableWidget view(2, 2);
view.setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
- view.setVerticalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy));
- view.setHorizontalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy));
- for (int r = 0 ; r < view.rowCount(); ++r)
+ view.setVerticalScrollBarPolicy(scrollBarPolicy);
+ view.setHorizontalScrollBarPolicy(scrollBarPolicy);
+ for (int r = 0 ; r < view.rowCount(); ++r) {
+ const QString rStr = QString::number(r) + QLatin1Char('/');
for (int c = 0 ; c < view.columnCount(); ++c)
- view.setItem(r, c, new QTableWidgetItem(QString("%1/%2").arg(r).arg(c)));
+ view.setItem(r, c, new QTableWidgetItem(rStr + QString::number(c)));
+ }
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
@@ -1520,7 +1513,7 @@ void tst_QTableWidget::task231094()
if (y == 1)
twi->setFlags(Qt::ItemIsEnabled);
else
- twi->setFlags(0);
+ twi->setFlags({});
tw.setItem(y, x, twi);
}
}
@@ -1558,15 +1551,15 @@ void tst_QTableWidget::task262056_sortDuplicate()
testWidget->setColumnCount(2);
testWidget->setRowCount(8);
testWidget->setSortingEnabled(true);
- QStringList items = (QStringList() << "AAA" << "BBB" << "CCC" << "CCC" << "DDD"\
- << "EEE" << "FFF" << "GGG");
- for (int i = 0; i<8; i++ ) {
+ const QStringList items({"AAA", "BBB", "CCC", "CCC", "DDD",
+ "EEE", "FFF", "GGG"});
+ for (int i = 0; i < 8; i++ ) {
QTableWidgetItem *twi = new QTableWidgetItem(items.at(i));
- testWidget->setItem(i,0,twi);
- testWidget->setItem(i,1,new QTableWidgetItem(QLatin1String("item ") + QString::number(i)));
+ testWidget->setItem(i, 0, twi);
+ testWidget->setItem(i, 1, new QTableWidgetItem(QLatin1String("item ") + QString::number(i)));
}
testWidget->sortItems(0, Qt::AscendingOrder);
- QSignalSpy layoutChangedSpy(testWidget->model(), SIGNAL(layoutChanged()));
+ QSignalSpy layoutChangedSpy(testWidget->model(), &QAbstractItemModel::layoutChanged);
testWidget->item(3,0)->setBackground(Qt::red);
QCOMPARE(layoutChangedSpy.count(),0);
@@ -1586,18 +1579,14 @@ void tst_QTableWidget::itemWithHeaderItems()
QTableWidgetItem *item1_0 = new QTableWidgetItem(QTableWidgetItem::UserType);
table.setItem(1, 0, item1_0);
- QCOMPARE(table.item(0, 1), static_cast<QTableWidgetItem *>(0));
+ QCOMPARE(table.item(0, 1), nullptr);
}
class TestTableWidget : public QTableWidget
{
Q_OBJECT
public:
- TestTableWidget(int rows, int columns, QWidget *parent = 0)
- : QTableWidget(rows, columns, parent)
- {
- }
-
+ using QTableWidget::QTableWidget;
using QTableWidget::mimeData;
using QTableWidget::indexFromItem;
using QTableWidget::keyPressEvent;
@@ -1661,18 +1650,19 @@ void tst_QTableWidget::selectedRowAfterSorting()
{
TestTableWidget table(3,3);
table.setSelectionBehavior(QAbstractItemView::SelectRows);
- for (int r = 0; r < 3; r++)
+ for (int r = 0; r < 3; r++) {
for (int c = 0; c < 3; c++)
- table.setItem(r,c,new QTableWidgetItem(QStringLiteral("0")));
+ table.setItem(r, c, new QTableWidgetItem(QStringLiteral("0")));
+ }
QHeaderView *localHorizontalHeader = table.horizontalHeader();
localHorizontalHeader->setSortIndicator(1,Qt::DescendingOrder);
table.setProperty("sortingEnabled",true);
table.selectRow(1);
table.item(1,1)->setText("9");
QCOMPARE(table.selectedItems().count(),3);
- foreach (QTableWidgetItem *item, table.selectedItems()) {
- QCOMPARE(item->row(),0);
- }
+ const auto selectedItems = table.selectedItems();
+ for (QTableWidgetItem *item : selectedItems)
+ QCOMPARE(item->row(), 0);
}
void tst_QTableWidget::search()
@@ -1717,10 +1707,11 @@ void tst_QTableWidget::search()
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void tst_QTableWidget::clearItemData()
{
- QTableWidget table(3,3);
- for (int r = 0; r < 3; r++)
+ QTableWidget table(3, 3);
+ for (int r = 0; r < 3; r++) {
for (int c = 0; c < 3; c++)
- table.setItem(r,c,new QTableWidgetItem(QStringLiteral("0")));
+ table.setItem(r, c, new QTableWidgetItem(QStringLiteral("0")));
+ }
QSignalSpy dataChangeSpy(table.model(), &QAbstractItemModel::dataChanged);
QVERIFY(dataChangeSpy.isValid());
QVERIFY(!table.model()->clearItemData(QModelIndex()));
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 2a1163ec66..44195d3b25 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -27,13 +27,28 @@
****************************************************************************/
#include "../../../../shared/fakedirmodel.h"
-#include <qabstractitemview.h>
-#include <QtTest/QtTest>
-#include <QtGui/QtGui>
-#include <QtWidgets/QtWidgets>
-#include <private/qtreeview_p.h>
-#include <QtTest/private/qtesthelpers_p.h>
+#include <QDesktopWidget>
+#include <QHeaderView>
+#include <QLabel>
+#include <QLineEdit>
+#include <QMainWindow>
+#include <QProxyStyle>
+#include <QPushButton>
+#include <QScrollBar>
+#include <QSignalSpy>
+#include <QSortFilterProxyModel>
+#include <QStatusBar>
+#include <QStringListModel>
+#include <QStyledItemDelegate>
+#include <QTextEdit>
+#include <QTimer>
+#include <QToolButton>
+#include <QTreeWidget>
+#include <QTest>
+#include <QVBoxLayout>
+#include <private/qtreeview_p.h>
+#include <private/qtesthelpers_p.h>
using namespace QTestPrivate;
@@ -43,6 +58,7 @@ Q_DECLARE_METATYPE(QAbstractItemView::DragDropMode)
Q_DECLARE_METATYPE(QAbstractItemView::EditTriggers)
Q_DECLARE_METATYPE(QAbstractItemView::EditTrigger)
+using IntBounds = std::numeric_limits<int>;
static void initStandardTreeModel(QStandardItemModel *model)
{
QStandardItem *item;
@@ -206,18 +222,11 @@ private slots:
class QtTestModel: public QAbstractItemModel
{
+ Q_OBJECT
public:
- QtTestModel(QObject *parent = 0): QAbstractItemModel(parent),
- fetched(false), rows(0), cols(0), levels(INT_MAX), wrongIndex(false) { init(); }
-
- QtTestModel(int _rows, int _cols, QObject *parent = 0): QAbstractItemModel(parent),
- fetched(false), rows(_rows), cols(_cols), levels(INT_MAX), wrongIndex(false) { init(); }
-
- void init()
- {
- decorationsEnabled = false;
- statusTipsEnabled = false;
- }
+ QtTestModel(int _rows, int _cols, QObject *parent = nullptr)
+ : QAbstractItemModel(parent), rows(_rows), cols(_cols)
+ {}
inline qint32 level(const QModelIndex &index) const
{
@@ -264,7 +273,7 @@ public:
if (row < 0 || column < 0 || (level(parent) > levels) || column >= cols || row >= rows) {
return QModelIndex();
}
- QModelIndex i = createIndex(row, column, level(parent) + 1);
+ QModelIndex i = createIndex(row, column, quintptr(level(parent) + 1));
parentHash[i] = parent;
return i;
}
@@ -361,13 +370,14 @@ public:
decorationsEnabled = enable;
}
- mutable bool fetched;
- bool decorationsEnabled;
- bool statusTipsEnabled;
- int rows, cols;
- int levels;
- mutable bool wrongIndex;
mutable QMap<QModelIndex,QModelIndex> parentHash;
+ int rows = 0;
+ int cols = 0;
+ int levels = IntBounds::max();
+ mutable bool wrongIndex = false;
+ mutable bool fetched = false;
+ bool decorationsEnabled = false;
+ bool statusTipsEnabled = false;
};
// Testing get/set functions
@@ -377,14 +387,15 @@ void tst_QTreeView::getSetCheck()
// int QTreeView::indentation()
// void QTreeView::setIndentation(int)
- const int styledIndentation = obj1.style()->pixelMetric(QStyle::PM_TreeViewIndentation, 0, &obj1);
+ const int styledIndentation = obj1.style()->pixelMetric(
+ QStyle::PM_TreeViewIndentation, nullptr, &obj1);
QCOMPARE(obj1.indentation(), styledIndentation);
obj1.setIndentation(0);
QCOMPARE(obj1.indentation(), 0);
- obj1.setIndentation(INT_MIN);
- QCOMPARE(obj1.indentation(), INT_MIN);
- obj1.setIndentation(INT_MAX);
- QCOMPARE(obj1.indentation(), INT_MAX);
+ obj1.setIndentation(IntBounds::min());
+ QCOMPARE(obj1.indentation(), IntBounds::min());
+ obj1.setIndentation(IntBounds::max());
+ QCOMPARE(obj1.indentation(), IntBounds::max());
// bool QTreeView::rootIsDecorated()
// void QTreeView::setRootIsDecorated(bool)
@@ -477,7 +488,8 @@ void tst_QTreeView::construction()
QCOMPARE(view.sizeHintForRow(1), -1);
QVERIFY(!view.tabKeyNavigation());
QCOMPARE(view.textElideMode(), Qt::ElideRight);
- QCOMPARE(static_cast<int>(view.verticalScrollMode()), view.style()->styleHint(QStyle::SH_ItemView_ScrollMode, 0, &view));
+ QCOMPARE(static_cast<int>(view.verticalScrollMode()),
+ view.style()->styleHint(QStyle::SH_ItemView_ScrollMode, nullptr, &view));
QCOMPARE(view.visualRect(QModelIndex()), QRect());
// QTreeView properties
@@ -493,8 +505,8 @@ void tst_QTreeView::construction()
QCOMPARE(view.columnWidth(0), 0);
QCOMPARE(view.columnWidth(1), 0);
QVERIFY(view.header());
- const int styledIndentation = view.style()->pixelMetric(QStyle::PM_TreeViewIndentation, 0, &view);
- QCOMPARE(view.indentation(), styledIndentation);
+ QCOMPARE(view.indentation(),
+ view.style()->pixelMetric(QStyle::PM_TreeViewIndentation, nullptr, &view));
QCOMPARE(view.indexAbove(QModelIndex()), QModelIndex());
QCOMPARE(view.indexBelow(QModelIndex()), QModelIndex());
QVERIFY(!view.isAnimated());
@@ -781,17 +793,17 @@ void tst_QTreeView::editTriggers()
break;
case QAbstractItemView::DoubleClicked:
// Doubleclick the center of the current cell
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0,
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {},
view.visualRect(view.model()->index(0, 0)).center());
- QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0,
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, {},
view.visualRect(view.model()->index(0, 0)).center());
break;
case QAbstractItemView::SelectedClicked:
// Click the center of the current cell
view.selectionModel()->select(view.model()->index(0, 0), QItemSelectionModel::Select);
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0,
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {},
view.visualRect(view.model()->index(0, 0)).center());
- QTest::qWait(int(QApplication::doubleClickInterval() * 1.5));
+ QTest::qWait(qRound(QApplication::doubleClickInterval() * 1.5));
break;
case QAbstractItemView::EditKeyPressed:
view.setFocus();
@@ -808,7 +820,7 @@ void tst_QTreeView::editTriggers()
}
// Check if we got an editor
- QTRY_COMPARE(view.findChild<QLineEdit *>(QString()) != 0, editorOpened);
+ QTRY_COMPARE(view.findChild<QLineEdit *>(QString()) != nullptr, editorOpened);
}
void tst_QTreeView::hasAutoScroll()
@@ -860,11 +872,11 @@ void tst_QTreeView::horizontalScrollMode()
class RepaintTreeView : public QTreeView
{
public:
- RepaintTreeView() : repainted(false) { }
- bool repainted;
+ using QTreeView::QTreeView;
+ bool repainted = false;
protected:
- void paintEvent(QPaintEvent *event)
+ void paintEvent(QPaintEvent *event) override
{ repainted = true; QTreeView::paintEvent(event); }
};
@@ -902,8 +914,7 @@ void tst_QTreeView::iconSize()
void tst_QTreeView::indexAt()
{
- QtTestModel model;
- model.rows = model.cols = 5;
+ QtTestModel model(5, 5);
QTreeView view;
QCOMPARE(view.indexAt(QPoint()), QModelIndex());
@@ -985,21 +996,21 @@ void tst_QTreeView::indexWidget()
void tst_QTreeView::itemDelegate()
{
QPointer<QAbstractItemDelegate> oldDelegate;
- QPointer<QItemDelegate> otherItemDelegate;
+ QPointer<QStyledItemDelegate> otherItemDelegate;
{
QTreeView view;
QVERIFY(qobject_cast<QStyledItemDelegate *>(view.itemDelegate()));
QPointer<QAbstractItemDelegate> oldDelegate = view.itemDelegate();
- otherItemDelegate = new QItemDelegate;
+ otherItemDelegate = new QStyledItemDelegate;
view.setItemDelegate(otherItemDelegate);
QVERIFY(!otherItemDelegate->parent());
QVERIFY(oldDelegate);
- QCOMPARE(view.itemDelegate(), (QAbstractItemDelegate *)otherItemDelegate);
+ QCOMPARE(view.itemDelegate(), otherItemDelegate);
- view.setItemDelegate(0);
+ view.setItemDelegate(nullptr);
QVERIFY(!view.itemDelegate()); // <- view does its own drawing?
QVERIFY(otherItemDelegate);
}
@@ -1038,29 +1049,29 @@ void tst_QTreeView::itemDelegateForColumnOrRow()
QCOMPARE(view.itemDelegate(QModelIndex()), defaultDelegate);
QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), defaultDelegate);
- QPointer<QAbstractItemDelegate> rowDelegate = new QItemDelegate;
+ QPointer<QAbstractItemDelegate> rowDelegate = new QStyledItemDelegate;
view.setItemDelegateForRow(0, rowDelegate);
QVERIFY(!rowDelegate->parent());
- QCOMPARE(view.itemDelegateForRow(0), (QAbstractItemDelegate *)rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), (QAbstractItemDelegate *)rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 1)), (QAbstractItemDelegate *)rowDelegate);
+ QCOMPARE(view.itemDelegateForRow(0), rowDelegate);
+ QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), rowDelegate);
+ QCOMPARE(view.itemDelegate(view.model()->index(0, 1)), rowDelegate);
QCOMPARE(view.itemDelegate(view.model()->index(1, 0)), defaultDelegate);
QCOMPARE(view.itemDelegate(view.model()->index(1, 1)), defaultDelegate);
- QPointer<QAbstractItemDelegate> columnDelegate = new QItemDelegate;
+ QPointer<QAbstractItemDelegate> columnDelegate = new QStyledItemDelegate;
view.setItemDelegateForColumn(1, columnDelegate);
QVERIFY(!columnDelegate->parent());
- QCOMPARE(view.itemDelegateForColumn(1), (QAbstractItemDelegate *)columnDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), (QAbstractItemDelegate *)rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 1)), (QAbstractItemDelegate *)rowDelegate); // row wins
+ QCOMPARE(view.itemDelegateForColumn(1), columnDelegate);
+ QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), rowDelegate);
+ QCOMPARE(view.itemDelegate(view.model()->index(0, 1)), rowDelegate); // row wins
QCOMPARE(view.itemDelegate(view.model()->index(1, 0)), defaultDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(1, 1)), (QAbstractItemDelegate *)columnDelegate);
+ QCOMPARE(view.itemDelegate(view.model()->index(1, 1)), columnDelegate);
- view.setItemDelegateForRow(0, 0);
+ view.setItemDelegateForRow(0, nullptr);
QVERIFY(!view.itemDelegateForRow(0));
QVERIFY(rowDelegate); // <- wasn't deleted
- view.setItemDelegateForColumn(1, 0);
+ view.setItemDelegateForColumn(1, nullptr);
QVERIFY(!view.itemDelegateForColumn(1));
QVERIFY(columnDelegate); // <- wasn't deleted
@@ -1130,12 +1141,9 @@ void tst_QTreeView::keyboardSearch()
QTest::qWait(QApplication::keyboardInputInterval() * 2);
model.clear();
view.setCurrentIndex(QModelIndex());
- QList<QStandardItem *> items = { new QStandardItem("Andreas"), new QStandardItem("Alicia") };
- model.appendRow(items);
- items = { new QStandardItem("Baldrian"), new QStandardItem("Belinda") };
- model.appendRow(items);
- items = { new QStandardItem("Cecilie"), new QStandardItem("Claire") };
- model.appendRow(items);
+ model.appendRow({ new QStandardItem("Andreas"), new QStandardItem("Alicia") });
+ model.appendRow({ new QStandardItem("Baldrian"), new QStandardItem("Belinda") });
+ model.appendRow({ new QStandardItem("Cecilie"), new QStandardItem("Claire") });
QVERIFY(!view.selectionModel()->hasSelection());
QVERIFY(!view.selectionModel()->isSelected(model.index(0, 0)));
@@ -1166,8 +1174,7 @@ void tst_QTreeView::keyboardSearch()
QCOMPARE(view.currentIndex(), model.index(1, 1));
// Test that it wraps round
- items = { new QStandardItem("Andy"), new QStandardItem("Adele") };
- model.appendRow(items);
+ model.appendRow({ new QStandardItem("Andy"), new QStandardItem("Adele") });
QTest::qWait(QApplication::keyboardInputInterval() * 2);
view.keyboardSearch(QLatin1String("A"));
QVERIFY(view.selectionModel()->isSelected(model.index(3, 1)));
@@ -1202,17 +1209,16 @@ void tst_QTreeView::keyboardSearch()
void tst_QTreeView::keyboardSearchMultiColumn()
{
QTreeView view;
-
QStandardItemModel model(4, 2);
model.setItem(0, 0, new QStandardItem("1")); model.setItem(0, 1, new QStandardItem("green"));
- model.setItem(1, 0, new QStandardItem("bad")); model.setItem(1, 1, new QStandardItem("eggs"));
- model.setItem(2, 0, new QStandardItem("moof")); model.setItem(2, 1, new QStandardItem("and"));
- model.setItem(3, 0, new QStandardItem("elf")); model.setItem(3, 1, new QStandardItem("ham"));
+ model.setItem(1, 0, new QStandardItem("bad")); model.setItem(1, 1, new QStandardItem("eggs"));
+ model.setItem(2, 0, new QStandardItem("moof")); model.setItem(2, 1, new QStandardItem("and"));
+ model.setItem(3, 0, new QStandardItem("elf")); model.setItem(3, 1, new QStandardItem("ham"));
view.setModel(&model);
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
view.setCurrentIndex(model.index(0, 1));
@@ -1240,22 +1246,22 @@ void tst_QTreeView::setModel()
for (int x = 0; x < 2; ++x) {
QtTestModel *model = new QtTestModel(10, 8);
QAbstractItemModel *oldModel = view.model();
- QSignalSpy modelDestroyedSpy(oldModel ? oldModel : model, SIGNAL(destroyed()));
+ QSignalSpy modelDestroyedSpy(oldModel ? oldModel : model, &QObject::destroyed);
// set the same model twice
for (int i = 0; i < 2; ++i) {
QItemSelectionModel *oldSelectionModel = view.selectionModel();
QItemSelectionModel *dummy = new QItemSelectionModel(model);
QSignalSpy selectionModelDestroyedSpy(
- oldSelectionModel ? oldSelectionModel : dummy, SIGNAL(destroyed()));
+ oldSelectionModel ? oldSelectionModel : dummy, &QObject::destroyed);
view.setModel(model);
// QCOMPARE(selectionModelDestroyedSpy.count(), (x == 0 || i == 1) ? 0 : 1);
- QCOMPARE(view.model(), (QAbstractItemModel *)model);
- QCOMPARE(view.header()->model(), (QAbstractItemModel *)model);
+ QCOMPARE(view.model(), model);
+ QCOMPARE(view.header()->model(), model);
QCOMPARE(view.selectionModel() != oldSelectionModel, (i == 0));
}
QTRY_COMPARE(modelDestroyedSpy.count(), 0);
- view.setModel(0);
+ view.setModel(nullptr);
QCOMPARE(view.model(), nullptr);
// ### shouldn't selectionModel also be 0 now?
// QCOMPARE(view.selectionModel(), nullptr);
@@ -1278,7 +1284,7 @@ void tst_QTreeView::openPersistentEditor()
view.closePersistentEditor(view.model()->index(0, 0));
QVERIFY(!view.viewport()->findChild<QLineEdit *>()->isVisible());
- qApp->sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
QVERIFY(!view.viewport()->findChild<QLineEdit *>());
}
@@ -1300,21 +1306,20 @@ void tst_QTreeView::rootIndex()
void tst_QTreeView::setHeader()
{
QTreeView view;
- QVERIFY(view.header() != 0);
+ QVERIFY(view.header() != nullptr);
QCOMPARE(view.header()->orientation(), Qt::Horizontal);
- QCOMPARE(view.header()->parent(), (QObject *)&view);
+ QCOMPARE(view.header()->parent(), &view);
for (int x = 0; x < 2; ++x) {
- QSignalSpy destroyedSpy(view.header(), SIGNAL(destroyed()));
+ QSignalSpy destroyedSpy(view.header(), &QObject::destroyed);
Qt::Orientation orient = x ? Qt::Vertical : Qt::Horizontal;
QHeaderView *head = new QHeaderView(orient);
view.setHeader(head);
QCOMPARE(destroyedSpy.count(), 1);
- QCOMPARE(head->parent(), (QObject *)&view);
+ QCOMPARE(head->parent(), &view);
QCOMPARE(view.header(), head);
view.setHeader(head);
QCOMPARE(view.header(), head);
- // Itemviews in Qt < 4.2 have asserts for this. Qt >= 4.2 should handle this gracefully
- view.setHeader((QHeaderView *)0);
+ view.setHeader(nullptr);
QCOMPARE(view.header(), head);
}
}
@@ -1328,13 +1333,13 @@ void tst_QTreeView::columnHidden()
for (int c = 0; c < model.columnCount(); ++c)
QCOMPARE(view.isColumnHidden(c), false);
// hide even columns
- for (int c = 0; c < model.columnCount(); c+=2)
+ for (int c = 0; c < model.columnCount(); c += 2)
view.setColumnHidden(c, true);
for (int c = 0; c < model.columnCount(); ++c)
QCOMPARE(view.isColumnHidden(c), (c & 1) == 0);
view.update();
// hide odd columns too
- for (int c = 1; c < model.columnCount(); c+=2)
+ for (int c = 1; c < model.columnCount(); c += 2)
view.setColumnHidden(c, true);
for (int c = 0; c < model.columnCount(); ++c)
QCOMPARE(view.isColumnHidden(c), true);
@@ -1418,7 +1423,7 @@ void tst_QTreeView::noDelegate()
QtTestModel model(10, 7);
QTreeView view;
view.setModel(&model);
- view.setItemDelegate(0);
+ view.setItemDelegate(nullptr);
QCOMPARE(view.itemDelegate(), nullptr);
}
@@ -1427,11 +1432,13 @@ void tst_QTreeView::noModel()
QTreeView view;
view.show();
view.setRowHidden(0, QModelIndex(), true);
+ // no model -> not able to hide a row
+ QVERIFY(!view.isRowHidden(0, QModelIndex()));
}
void tst_QTreeView::emptyModel()
{
- QtTestModel model;
+ QtTestModel model(0, 0);
QTreeView view;
view.setModel(&model);
view.show();
@@ -1486,7 +1493,7 @@ void tst_QTreeView::limitedExpand()
QTreeView view;
view.setModel(&model);
- QSignalSpy spy(&view, SIGNAL(expanded(QModelIndex)));
+ QSignalSpy spy(&view, &QTreeView::expanded);
QVERIFY(spy.isValid());
view.expand(model.index(0, 0));
@@ -1500,7 +1507,7 @@ void tst_QTreeView::limitedExpand()
QTreeView view;
view.setModel(&model);
- QSignalSpy spy(&view, SIGNAL(expanded(QModelIndex)));
+ QSignalSpy spy(&view, &QTreeView::expanded);
QVERIFY(spy.isValid());
view.expand(model.index(0, 0));
@@ -1515,7 +1522,6 @@ void tst_QTreeView::expandAndCollapse_data()
QTest::addColumn<bool>("animationEnabled");
QTest::newRow("normal") << false;
QTest::newRow("animated") << true;
-
}
void tst_QTreeView::expandAndCollapse()
@@ -1533,8 +1539,8 @@ void tst_QTreeView::expandAndCollapse()
QModelIndex a = model.index(0, 0, QModelIndex());
QModelIndex b = model.index(0, 0, a);
- QSignalSpy expandedSpy(&view, SIGNAL(expanded(QModelIndex)));
- QSignalSpy collapsedSpy(&view, SIGNAL(collapsed(QModelIndex)));
+ QSignalSpy expandedSpy(&view, &QTreeView::expanded);
+ QSignalSpy collapsedSpy(&view, &QTreeView::collapsed);
QVariantList args;
for (int y = 0; y < 2; ++y) {
@@ -1744,7 +1750,7 @@ void tst_QTreeView::expandAndCollapseAll()
void tst_QTreeView::expandWithNoChildren()
{
QTreeView tree;
- QStandardItemModel model(1,1);
+ QStandardItemModel model(1, 1);
tree.setModel(&model);
tree.setAnimated(true);
tree.doItemsLayout();
@@ -1765,14 +1771,15 @@ void tst_QTreeView::keyboardNavigation()
view.setModel(&model);
view.show();
- QVector<Qt::Key> keymoves;
- keymoves << Qt::Key_Down << Qt::Key_Right << Qt::Key_Right << Qt::Key_Right
- << Qt::Key_Down << Qt::Key_Down << Qt::Key_Down << Qt::Key_Down
- << Qt::Key_Right << Qt::Key_Right << Qt::Key_Right
- << Qt::Key_Left << Qt::Key_Up << Qt::Key_Left << Qt::Key_Left
- << Qt::Key_Up << Qt::Key_Down << Qt::Key_Up << Qt::Key_Up
- << Qt::Key_Up << Qt::Key_Up << Qt::Key_Up << Qt::Key_Up
- << Qt::Key_Left << Qt::Key_Left << Qt::Key_Up << Qt::Key_Down;
+ const auto keymoves = {
+ Qt::Key_Down, Qt::Key_Right, Qt::Key_Right, Qt::Key_Right,
+ Qt::Key_Down, Qt::Key_Down, Qt::Key_Down, Qt::Key_Down,
+ Qt::Key_Right, Qt::Key_Right, Qt::Key_Right,
+ Qt::Key_Left, Qt::Key_Up, Qt::Key_Left, Qt::Key_Left,
+ Qt::Key_Up, Qt::Key_Down, Qt::Key_Up, Qt::Key_Up,
+ Qt::Key_Up, Qt::Key_Up, Qt::Key_Up, Qt::Key_Up,
+ Qt::Key_Left, Qt::Key_Left, Qt::Key_Up, Qt::Key_Down
+ };
int row = 0;
int column = 0;
@@ -1780,8 +1787,7 @@ void tst_QTreeView::keyboardNavigation()
view.setCurrentIndex(index);
QCOMPARE(view.currentIndex(), index);
- for (int i = 0; i < keymoves.size(); ++i) {
- Qt::Key key = keymoves.at(i);
+ for (Qt::Key key : keymoves) {
QTest::keyClick(&view, key);
switch (key) {
@@ -1838,10 +1844,10 @@ void tst_QTreeView::keyboardNavigation()
class Dmodel : public QtTestModel
{
+ Q_OBJECT
public:
- Dmodel() : QtTestModel(10, 10){}
-
- int columnCount(const QModelIndex &parent) const
+ using QtTestModel::QtTestModel;
+ int columnCount(const QModelIndex &parent) const override
{
if (parent.row() == 5)
return 1;
@@ -1851,7 +1857,7 @@ public:
void tst_QTreeView::headerSections()
{
- Dmodel model;
+ Dmodel model(10, 10);
QTreeView view;
QHeaderView *header = view.header();
@@ -1895,7 +1901,8 @@ void tst_QTreeView::moveCursor()
view.setColumnHidden(0, true);
QVERIFY(view.isColumnHidden(0));
view.show();
- qApp->setActiveWindow(&view);
+ QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowActive(&view));
//here the first visible index should be selected
//because the view got the focus
@@ -1938,73 +1945,60 @@ void tst_QTreeView::moveCursor()
QCOMPARE(view.currentIndex(), expected);
}
-class TestDelegate : public QItemDelegate
+class TestDelegate : public QStyledItemDelegate
{
+ Q_OBJECT
public:
- TestDelegate(QObject *parent) : QItemDelegate(parent) {}
- QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { return QSize(200, 50); }
+ using QStyledItemDelegate::QStyledItemDelegate;
+ QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const override
+ { return QSize(200, 50); }
};
-typedef QList<QPoint> PointList;
+typedef QVector<QPoint> PointList;
void tst_QTreeView::setSelection_data()
{
QTest::addColumn<QRect>("selectionRect");
- QTest::addColumn<int>("selectionMode");
- QTest::addColumn<int>("selectionCommand");
+ QTest::addColumn<QAbstractItemView::SelectionMode>("selectionMode");
+ QTest::addColumn<QItemSelectionModel::SelectionFlags>("selectionCommand");
QTest::addColumn<PointList>("expectedItems");
QTest::addColumn<int>("verticalOffset");
- QTest::newRow("(0,0,50,20),rows") << QRect(0,0,50,20)
- << int(QAbstractItemView::SingleSelection)
- << int(QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows)
- << (PointList()
- << QPoint(0,0) << QPoint(1,0) << QPoint(2,0) << QPoint(3,0) << QPoint(4,0)
- )
- << 0;
-
- QTest::newRow("(0,0,50,90),rows") << QRect(0,0,50,90)
- << int(QAbstractItemView::ExtendedSelection)
- << int(QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows)
- << (PointList()
- << QPoint(0,0) << QPoint(1,0) << QPoint(2,0) << QPoint(3,0) << QPoint(4,0)
- << QPoint(0,1) << QPoint(1,1) << QPoint(2,1) << QPoint(3,1) << QPoint(4,1)
- )
- << 0;
-
- QTest::newRow("(50,0,0,90),rows,invalid rect") << QRect(QPoint(50, 0), QPoint(0, 90))
- << int(QAbstractItemView::ExtendedSelection)
- << int(QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows)
- << (PointList()
- << QPoint(0,0) << QPoint(1,0) << QPoint(2,0) << QPoint(3,0) << QPoint(4,0)
- << QPoint(0,1) << QPoint(1,1) << QPoint(2,1) << QPoint(3,1) << QPoint(4,1)
- )
- << 0;
-
- QTest::newRow("(0,-20,20,50),rows") << QRect(0,-20,20,50)
- << int(QAbstractItemView::ExtendedSelection)
- << int(QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows)
- << (PointList()
- << QPoint(0,0) << QPoint(1,0) << QPoint(2,0) << QPoint(3,0) << QPoint(4,0)
- << QPoint(0,1) << QPoint(1,1) << QPoint(2,1) << QPoint(3,1) << QPoint(4,1)
- )
- << 1;
- QTest::newRow("(0,-50,20,90),rows") << QRect(0,-50,20,90)
- << int(QAbstractItemView::ExtendedSelection)
- << int(QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows)
- << (PointList()
- << QPoint(0,0) << QPoint(1,0) << QPoint(2,0) << QPoint(3,0) << QPoint(4,0)
- << QPoint(0,1) << QPoint(1,1) << QPoint(2,1) << QPoint(3,1) << QPoint(4,1)
- )
- << 1;
-
+ const PointList pl1{QPoint(0, 0), QPoint(1, 0), QPoint(2, 0), QPoint(3, 0), QPoint(4, 0)};
+ const PointList pl2{QPoint(0, 0), QPoint(1, 0), QPoint(2, 0), QPoint(3, 0), QPoint(4, 0),
+ QPoint(0, 1), QPoint(1, 1), QPoint(2, 1), QPoint(3, 1), QPoint(4, 1)};
+ const QItemSelectionModel::SelectionFlags selFlags(QItemSelectionModel::ClearAndSelect |
+ QItemSelectionModel::Rows);
+ QTest::newRow("(0,0,50,20),rows")
+ << QRect(0, 0, 50, 20)
+ << QAbstractItemView::SingleSelection
+ << selFlags << pl1 << 0;
+
+ QTest::newRow("(0,0,50,90),rows")
+ << QRect(0, 0, 50, 90)
+ << QAbstractItemView::ExtendedSelection
+ << selFlags << pl2 << 0;
+
+ QTest::newRow("(50,0,0,90),rows,invalid rect")
+ << QRect(QPoint(50, 0), QPoint(0, 90))
+ << QAbstractItemView::ExtendedSelection
+ << selFlags << pl2 << 0;
+
+ QTest::newRow("(0,-20,20,50),rows")
+ << QRect(0, -20, 20, 50)
+ << QAbstractItemView::ExtendedSelection
+ << selFlags << pl2 << 1;
+ QTest::newRow("(0,-50,20,90),rows")
+ << QRect(0, -50, 20, 90)
+ << QAbstractItemView::ExtendedSelection
+ << selFlags << pl2 << 1;
}
void tst_QTreeView::setSelection()
{
QFETCH(QRect, selectionRect);
- QFETCH(int, selectionMode);
- QFETCH(int, selectionCommand);
+ QFETCH(QAbstractItemView::SelectionMode, selectionMode);
+ QFETCH(QItemSelectionModel::SelectionFlags, selectionCommand);
QFETCH(PointList, expectedItems);
QFETCH(int, verticalOffset);
@@ -2016,25 +2010,23 @@ void tst_QTreeView::setSelection()
view.show();
view.setRootIsDecorated(false);
view.setItemDelegate(new TestDelegate(&view));
- view.setSelectionMode(QAbstractItemView::SelectionMode(selectionMode));
+ view.setSelectionMode(selectionMode);
view.setModel(&model);
view.setUniformRowHeights(true);
view.setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
view.scrollTo(model.index(verticalOffset, 0), QAbstractItemView::PositionAtTop);
- view.setSelection(selectionRect, QItemSelectionModel::SelectionFlags(selectionCommand));
+ view.setSelection(selectionRect, selectionCommand);
QItemSelectionModel *selectionModel = view.selectionModel();
QVERIFY(selectionModel);
- QModelIndexList selectedIndexes = selectionModel->selectedIndexes();
+ const QModelIndexList selectedIndexes = selectionModel->selectedIndexes();
#ifdef Q_OS_WINRT
QEXPECT_FAIL("(0,-20,20,50),rows", "Fails on WinRT - QTBUG-68297", Abort);
QEXPECT_FAIL("(0,-50,20,90),rows", "Fails on WinRT - QTBUG-68297", Abort);
#endif
QCOMPARE(selectedIndexes.count(), expectedItems.count());
- for (int i = 0; i < selectedIndexes.count(); ++i) {
- QModelIndex idx = selectedIndexes.at(i);
+ for (const QModelIndex &idx : selectedIndexes)
QVERIFY(expectedItems.contains(QPoint(idx.column(), idx.row())));
- }
}
void tst_QTreeView::indexAbove()
@@ -2134,7 +2126,7 @@ void tst_QTreeView::clicked()
QModelIndex index = view.indexAt(p);
if (!index.isValid())
continue;
- QSignalSpy spy(&view, SIGNAL(clicked(QModelIndex)));
+ QSignalSpy spy(&view, &QTreeView::clicked);
QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, p);
QTRY_COMPARE(spy.count(), 1);
}
@@ -2149,9 +2141,9 @@ void tst_QTreeView::mouseDoubleClick()
for (int i = 0; i < model.rowCount(); i++) {
QModelIndex index = model.index(i, 0, QModelIndex());
model.insertRows(0, 20, index);
- model.insertColumns(0,2,index);
+ model.insertColumns(0, 2,index);
for (int i1 = 0; i1 < model.rowCount(index); i1++) {
- (void)model.index(i1, 0, index);
+ QVERIFY(model.index(i1, 0, index).isValid());
}
}
@@ -2159,8 +2151,8 @@ void tst_QTreeView::mouseDoubleClick()
view.setModel(&model);
// make sure the viewport height is smaller than the contents height.
- view.resize(200,200);
- view.move(0,0);
+ view.resize(200, 200);
+ view.move(0, 0);
view.show();
QModelIndex index = model.index(0, 0, QModelIndex());
view.setCurrentIndex(index);
@@ -2170,9 +2162,8 @@ void tst_QTreeView::mouseDoubleClick()
view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
// Make sure all items are collapsed
- for (int i = 0; i < model.rowCount(QModelIndex()); i++) {
- view.setExpanded(model.index(i,0, QModelIndex()), false);
- }
+ for (int i = 0; i < model.rowCount(QModelIndex()); i++)
+ view.setExpanded(model.index(i, 0, QModelIndex()), false);
int maximum = view.verticalScrollBar()->maximum();
@@ -2210,14 +2201,13 @@ void tst_QTreeView::rowsAboutToBeRemoved()
view.setCurrentIndex(index);
view.setExpanded(model.index(0,0, QModelIndex()), true);
- for (int i = 0; i < model.rowCount(QModelIndex()); i++) {
- view.setExpanded(model.index(i,0, QModelIndex()), true);
- }
+ for (int i = 0; i < model.rowCount(QModelIndex()); i++)
+ view.setExpanded(model.index(i, 0, QModelIndex()), true);
- QSignalSpy spy1(&model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
+ QSignalSpy spy1(&model, &QAbstractItemModel::rowsAboutToBeRemoved);
model.removeRows(1,1);
- QCOMPARE(int(view.state()), 0);
+ QCOMPARE((view.state()), 0);
// Should not be 5 (or any other number for that sake :)
QCOMPARE(spy1.count(), 1);
@@ -2241,8 +2231,7 @@ void tst_QTreeView::headerSections_unhideSection()
void tst_QTreeView::columnAt()
{
- QtTestModel model;
- model.rows = model.cols = 10;
+ QtTestModel model(10, 10);
QTreeView view;
view.resize(500,500);
view.setModel(&model);
@@ -2256,8 +2245,7 @@ void tst_QTreeView::scrollTo()
#define CHECK_VISIBLE(ROW,COL) QVERIFY(QRect(QPoint(),view.viewport()->size()).contains(\
view.visualRect(model.index((ROW),(COL),QModelIndex()))))
- QtTestModel model;
- model.rows = model.cols = 100;
+ QtTestModel model(100, 100);
QTreeView view;
view.setUniformRowHeights(true);
view.scrollTo(QModelIndex(), QTreeView::PositionAtTop);
@@ -2268,19 +2256,18 @@ void tst_QTreeView::scrollTo()
// ### create a data function for this test
view.scrollTo(QModelIndex());
- view.scrollTo(model.index(0,0,QModelIndex()));
- view.scrollTo(model.index(0,0,QModelIndex()), QTreeView::PositionAtTop);
- view.scrollTo(model.index(0,0,QModelIndex()), QTreeView::PositionAtBottom);
-
- //
+ view.scrollTo(model.index(0, 0, QModelIndex()));
+ view.scrollTo(model.index(0, 0, QModelIndex()), QTreeView::PositionAtTop);
+ view.scrollTo(model.index(0, 0, QModelIndex()), QTreeView::PositionAtBottom);
view.show();
view.setVerticalScrollMode(QAbstractItemView::ScrollPerItem); //some styles change that in Polish
-
view.resize(300, 200);
+
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
//view.verticalScrollBar()->setValue(0);
- view.scrollTo(model.index(0,0,QModelIndex()));
+ view.scrollTo(model.index(0, 0, QModelIndex()));
CHECK_VISIBLE(0,0);
QCOMPARE(view.verticalScrollBar()->value(), 0);
@@ -2305,22 +2292,23 @@ void tst_QTreeView::rowsAboutToBeRemoved_move()
QTreeView view;
view.setModel(&model);
QModelIndex indexThatWantsToLiveButWillDieDieITellYou;
- QModelIndex parent = model.index(2, 0 );
+ QModelIndex parent = model.index(2, 0);
view.expand(parent);
for (int i = 0; i < 6; ++i) {
model.insertRows(0, 1, parent);
model.insertColumns(0, 1, parent);
QModelIndex index = model.index(0, 0, parent);
view.expand(index);
- if ( i == 3 )
+ if (i == 3)
indexThatWantsToLiveButWillDieDieITellYou = index;
model.setData(index, i);
parent = index;
}
view.resize(600,800);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
view.doItemsLayout();
- static_cast<QTreeView *>(&view)->executeDelayedItemsLayout();
+ view.executeDelayedItemsLayout();
parent = indexThatWantsToLiveButWillDieDieITellYou.parent();
QCOMPARE(view.isExpanded(indexThatWantsToLiveButWillDieDieITellYou), true);
QCOMPARE(parent.isValid(), true);
@@ -2354,7 +2342,8 @@ void tst_QTreeView::resizeColumnToContents()
QTreeView view;
view.setModel(&model);
view.show();
- qApp->processEvents(); //must have this, or else it will not scroll
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
view.scrollToBottom();
view.resizeColumnToContents(0);
int oldColumnSize = view.header()->sectionSize(0);
@@ -2365,11 +2354,12 @@ void tst_QTreeView::resizeColumnToContents()
void tst_QTreeView::insertAfterSelect()
{
- QtTestModel model;
- model.rows = model.cols = 10;
+ QtTestModel model(10, 10);
QTreeView view;
view.setModel(&model);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
QModelIndex firstIndex = model.index(0, 0, QModelIndex());
QVERIFY(firstIndex.isValid());
int itemOffset = view.visualRect(firstIndex).width() / 2;
@@ -2382,11 +2372,12 @@ void tst_QTreeView::insertAfterSelect()
void tst_QTreeView::removeAfterSelect()
{
- QtTestModel model;
- model.rows = model.cols = 10;
+ QtTestModel model(10, 10);
QTreeView view;
view.setModel(&model);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
QModelIndex firstIndex = model.index(0, 0, QModelIndex());
QVERIFY(firstIndex.isValid());
int itemOffset = view.visualRect(firstIndex).width() / 2;
@@ -2399,17 +2390,17 @@ void tst_QTreeView::removeAfterSelect()
void tst_QTreeView::hiddenItems()
{
- QtTestModel model;
- model.rows = model.cols = 10;
+ QtTestModel model(10, 10);
QTreeView view;
view.setModel(&model);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QModelIndex firstIndex = model.index(1, 0, QModelIndex());
QVERIFY(firstIndex.isValid());
if (model.canFetchMore(firstIndex))
model.fetchMore(firstIndex);
- for (int i=0; i < model.rowCount(firstIndex); i++)
+ for (int i = 0; i < model.rowCount(firstIndex); i++)
view.setRowHidden(i , firstIndex, true );
int itemOffset = view.visualRect(firstIndex).width() / 2;
@@ -2419,18 +2410,18 @@ void tst_QTreeView::hiddenItems()
QTest::mouseDClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, p);
QCOMPARE(view.isExpanded(firstIndex), false);
- p.setX( 5 );
+ p.setX(5);
QTest::mouseClick(view.viewport(), Qt::LeftButton, Qt::NoModifier, p);
QCOMPARE(view.isExpanded(firstIndex), false);
}
void tst_QTreeView::spanningItems()
{
- QtTestModel model;
- model.rows = model.cols = 10;
+ QtTestModel model(10, 10);
QTreeView view;
view.setModel(&model);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
int itemWidth = view.header()->sectionSize(0);
int itemHeight = view.visualRect(model.index(0, 0, QModelIndex())).height();
@@ -2470,7 +2461,7 @@ void tst_QTreeView::spanningItems()
void tst_QTreeView::selectionOrderTest()
{
- QVERIFY(((QItemSelectionModel*)sender())->currentIndex().row() != -1);
+ QVERIFY(static_cast<QItemSelectionModel*>(sender())->currentIndex().row() != -1);
}
void tst_QTreeView::selection()
@@ -2489,12 +2480,11 @@ void tst_QTreeView::selection()
treeView.setSelectionBehavior(QAbstractItemView::SelectRows);
treeView.setSelectionMode(QAbstractItemView::ExtendedSelection);
- connect(treeView.selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
- this, SLOT(selectionOrderTest()));
-
- treeView.show();
+ connect(treeView.selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &tst_QTreeView::selectionOrderTest);
- QTest::mousePress(treeView.viewport(), Qt::LeftButton, 0, treeView.visualRect(m.index(1, 0)).center());
+ QTest::mousePress(treeView.viewport(), Qt::LeftButton, {},
+ treeView.visualRect(m.index(1, 0)).center());
QTest::keyPress(treeView.viewport(), Qt::Key_Down);
auto selectedRows = treeView.selectionModel()->selectedRows();
QCOMPARE(selectedRows.size(), 1);
@@ -2509,23 +2499,21 @@ void tst_QTreeView::selection()
void tst_QTreeView::selectionWithHiddenItems()
{
QStandardItemModel model;
- for (int i = 0; i < model.rowCount(); ++i)
- model.setData(model.index(i,0), QLatin1String("row ") + QString::number(i));
QStandardItem item0("row 0");
QStandardItem item1("row 1");
QStandardItem item2("row 2");
QStandardItem item3("row 3");
- model.appendColumn( QList<QStandardItem*>() << &item0 << &item1 << &item2 << &item3);
+ model.appendColumn({&item0, &item1, &item2, &item3});
QStandardItem child("child");
- item1.appendRow( &child);
+ item1.appendRow(&child);
QTreeView view;
view.setModel(&model);
view.setSelectionMode(QAbstractItemView::ExtendedSelection);
view.show();
- qApp->processEvents();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
//child should not be selected as it is hidden (its parent is not expanded)
view.selectAll();
@@ -2548,12 +2536,11 @@ void tst_QTreeView::selectionWithHiddenItems()
//we hide the node with a child (there should then be 3 items selected in 2 ranges)
view.setRowHidden(1, QModelIndex(), true);
QVERIFY(view.isExpanded(item1.index()));
- qApp->processEvents();
view.selectAll();
QCOMPARE(view.selectionModel()->selection().count(), 2);
QCOMPARE(view.selectionModel()->selectedRows().count(), 3);
- QVERIFY( !view.selectionModel()->isSelected(model.indexFromItem(&item1)));
- QVERIFY( !view.selectionModel()->isSelected(model.indexFromItem(&child)));
+ QVERIFY(!view.selectionModel()->isSelected(model.indexFromItem(&item1)));
+ QVERIFY(!view.selectionModel()->isSelected(model.indexFromItem(&child)));
view.setRowHidden(1, QModelIndex(), false);
QVERIFY(view.isExpanded(item1.index()));
@@ -2561,7 +2548,6 @@ void tst_QTreeView::selectionWithHiddenItems()
//we hide a node without children (there should then be 4 items selected in 3 ranges)
view.setRowHidden(2, QModelIndex(), true);
- qApp->processEvents();
QVERIFY(view.isExpanded(item1.index()));
view.selectAll();
QVERIFY(view.isExpanded(item1.index()));
@@ -2575,7 +2561,7 @@ void tst_QTreeView::selectionWithHiddenItems()
void tst_QTreeView::selectAll()
{
- QStandardItemModel model(4,4);
+ QStandardItemModel model(4, 4);
QTreeView view2;
view2.setModel(&model);
view2.setSelectionMode(QAbstractItemView::ExtendedSelection);
@@ -2619,7 +2605,8 @@ void tst_QTreeView::extendedSelection()
view.setModel(&model);
view.setSelectionMode(QAbstractItemView::ExtendedSelection);
topLevel.show();
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0, mousePressPos);
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
+ QTest::mousePress(view.viewport(), Qt::LeftButton, {}, mousePressPos);
QCOMPARE(view.selectionModel()->selectedIndexes().count(), selectedCount);
}
@@ -2627,21 +2614,22 @@ void tst_QTreeView::rowSizeHint()
{
//tests whether the correct visible columns are taken into account when
//calculating the height of a line
- QStandardItemModel model(1,3);
- model.setData( model.index(0,0), QSize(20,40), Qt::SizeHintRole);
- model.setData( model.index(0,1), QSize(20,10), Qt::SizeHintRole);
- model.setData( model.index(0,2), QSize(20,10), Qt::SizeHintRole);
+ QStandardItemModel model(1, 3);
+ model.setData(model.index(0, 0), QSize(20, 40), Qt::SizeHintRole);
+ model.setData(model.index(0, 1), QSize(20, 10), Qt::SizeHintRole);
+ model.setData(model.index(0, 2), QSize(20, 10), Qt::SizeHintRole);
QTreeView view;
view.setModel(&model);
view.header()->moveSection(1, 0); //the 2nd column goes to the 1st place
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
//it must be 40 since the tallest item that defines the height of a line
- QCOMPARE( view.visualRect(model.index(0,0)).height(), 40);
- QCOMPARE( view.visualRect(model.index(0,1)).height(), 40);
- QCOMPARE( view.visualRect(model.index(0,2)).height(), 40);
+ QCOMPARE(view.visualRect(model.index(0,0)).height(), 40);
+ QCOMPARE(view.visualRect(model.index(0,1)).height(), 40);
+ QCOMPARE(view.visualRect(model.index(0,2)).height(), 40);
}
@@ -2651,7 +2639,7 @@ void tst_QTreeView::rowSizeHint()
void tst_QTreeView::setSortingEnabledTopLevel()
{
QTreeView view;
- QStandardItemModel model(1,1);
+ QStandardItemModel model(1, 1);
view.setModel(&model);
const int size = view.header()->sectionSize(0);
view.setSortingEnabled(true);
@@ -2665,7 +2653,7 @@ void tst_QTreeView::setSortingEnabledChild()
QMainWindow win;
QTreeView view;
// two columns to not get in trouble with stretchLastSection
- QStandardItemModel model(1,2);
+ QStandardItemModel model(1, 2);
view.setModel(&model);
view.header()->setDefaultSectionSize(92);
win.setCentralWidget(&view);
@@ -2690,16 +2678,18 @@ void tst_QTreeView::headerHidden()
class TestTreeViewStyle : public QProxyStyle
{
+ Q_OBJECT
public:
- TestTreeViewStyle() : indentation(20) {}
- int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const override
+ using QProxyStyle::QProxyStyle;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr) const override
{
if (metric == QStyle::PM_TreeViewIndentation)
return indentation;
else
return QProxyStyle::pixelMetric(metric, option, widget);
}
- int indentation;
+ int indentation = 20;
};
void tst_QTreeView::indentation()
@@ -2745,7 +2735,7 @@ void tst_QTreeView::removeAndInsertExpandedCol0()
model.insertColumns(0, 1);
view.show();
- qApp->processEvents();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
}
void tst_QTreeView::disabledButCheckable()
@@ -2782,7 +2772,7 @@ void tst_QTreeView::sortByColumn()
{
QFETCH(bool, sortingEnabled);
QTreeView view;
- QStandardItemModel model(4,2);
+ QStandardItemModel model(4, 2);
QSortFilterProxyModel sfpm; // default QStandardItemModel does not support 'unsorted' state
sfpm.setSourceModel(&model);
model.setItem(0, 0, new QStandardItem("b"));
@@ -2825,11 +2815,13 @@ void tst_QTreeView::sortByColumn()
*/
class EvilModel: public QAbstractItemModel
{
-
+ Q_OBJECT
public:
- class Node {
+ class Node
+ {
public:
- Node(Node *p = 0, int level = 0) : parent(p), isDead(false) {
+ Node(Node *p = nullptr, int level = 0) : parent(p)
+ {
populate(level);
}
~Node()
@@ -2838,20 +2830,23 @@ public:
qDeleteAll(deadChildren.begin(), deadChildren.end());
}
- void populate(int level = 0) {
- if (level < 4)
+ void populate(int level = 0)
+ {
+ if (level < 4) {
for (int i = 0; i < 5; ++i)
children.append(new Node(this, level + 1));
+ }
}
- void kill() {
+ void kill()
+ {
for (int i = children.count() -1; i >= 0; --i) {
children.at(i)->kill();
- if (parent == 0) {
+ if (parent == nullptr) {
deadChildren.append(children.at(i));
children.removeAt(i);
}
}
- if (parent == 0) {
+ if (parent == nullptr) {
if (!children.isEmpty())
qFatal("%s: children should be empty when parent is null", Q_FUNC_INFO);
populate();
@@ -2860,17 +2855,16 @@ public:
}
}
- QList<Node*> children;
- QList<Node*> deadChildren;
+ QVector<Node *> children;
+ QVector<Node *> deadChildren;
Node *parent;
- bool isDead;
+ bool isDead = false;
};
Node *root;
- EvilModel(QObject *parent = 0): QAbstractItemModel(parent), root(new Node)
- {
- }
+ EvilModel(QObject *parent = nullptr): QAbstractItemModel(parent), root(new Node)
+ {}
~EvilModel()
{
delete root;
@@ -2880,7 +2874,7 @@ public:
{
emit layoutAboutToBeChanged();
QModelIndexList oldList = persistentIndexList();
- QList<QStack<int> > oldListPath;
+ QVector<QStack<int>> oldListPath;
for (int i = 0; i < oldList.count(); ++i) {
QModelIndex idx = oldList.at(i);
QStack<int> path;
@@ -2893,12 +2887,10 @@ public:
root->kill();
QModelIndexList newList;
- for (int i = 0; i < oldListPath.count(); ++i) {
- QStack<int> path = oldListPath[i];
+ for (auto path : qAsConst(oldListPath)) {
QModelIndex idx;
- while(!path.isEmpty()) {
+ while (!path.isEmpty())
idx = index(path.pop(), 0, idx);
- }
newList.append(idx);
}
@@ -2906,7 +2898,8 @@ public:
emit layoutChanged();
}
- int rowCount(const QModelIndex& parent = QModelIndex()) const {
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override
+ {
Node *parentNode = root;
if (parent.isValid()) {
parentNode = static_cast<Node*>(parent.internalPointer());
@@ -2915,13 +2908,12 @@ public:
}
return parentNode->children.count();
}
- int columnCount(const QModelIndex& parent = QModelIndex()) const {
- if (parent.column() > 0)
- return 0;
- return 1;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override
+ {
+ return parent.column() > 0 ? 0 : 1;
}
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override
{
Node *grandparentNode = static_cast<Node*>(parent.internalPointer());
Node *parentNode = root;
@@ -2935,7 +2927,7 @@ public:
return createIndex(row, column, parentNode);
}
- QModelIndex parent(const QModelIndex &index) const
+ QModelIndex parent(const QModelIndex &index) const override
{
Node *parent = static_cast<Node*>(index.internalPointer());
Node *grandparent = parent->parent;
@@ -2944,7 +2936,7 @@ public:
return createIndex(grandparent->children.indexOf(parent), 0, grandparent);
}
- QVariant data(const QModelIndex &idx, int role) const
+ QVariant data(const QModelIndex &idx, int role) const override
{
if (idx.isValid() && role == Qt::DisplayRole) {
Node *parentNode = root;
@@ -2987,7 +2979,6 @@ void tst_QTreeView::evilModel()
view.setRowHidden(0, firstLevel, true);
model.change();
- return;
view.setFirstColumnSpanned(1, QModelIndex(), true);
model.change();
@@ -3167,7 +3158,7 @@ void tst_QTreeView::filterProxyModelCrash()
QTreeView view;
view.setModel(&proxy);
view.show();
- QTest::qWait(30);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
proxy.invalidate();
view.verticalScrollBar()->setValue(15);
QTest::qWait(20);
@@ -3190,7 +3181,7 @@ void tst_QTreeView::renderToPixmap()
QStandardItemModel model;
model.appendRow(new QStandardItem("Spanning"));
- model.appendRow(QList<QStandardItem*>() << new QStandardItem("Not") << new QStandardItem("Spanning"));
+ model.appendRow({ new QStandardItem("Not"), new QStandardItem("Spanning") });
view.setModel(&model);
view.setFirstColumnSpanned(0, QModelIndex(), true);
@@ -3211,57 +3202,60 @@ void tst_QTreeView::styleOptionViewItem()
{
class MyDelegate : public QStyledItemDelegate
{
- static QString posToString(QStyleOptionViewItem::ViewItemPosition pos) {
+ static QString posToString(QStyleOptionViewItem::ViewItemPosition pos)
+ {
static const char* s_pos[] = { "Invalid", "Beginning", "Middle", "End", "OnlyOne" };
return s_pos[pos];
}
public:
- MyDelegate()
- : QStyledItemDelegate(),
- count(0),
- allCollapsed(false)
- {}
-
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
- {
- QStyleOptionViewItem opt(option);
- initStyleOption(&opt, index);
+ using QStyledItemDelegate::QStyledItemDelegate;
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override
+ {
+ QStyleOptionViewItem opt(option);
+ initStyleOption(&opt, index);
- QVERIFY(!opt.text.isEmpty());
- QCOMPARE(opt.index, index);
- //qDebug() << index << opt.text;
+ QVERIFY(!opt.text.isEmpty());
+ QCOMPARE(opt.index, index);
+ //qDebug() << index << opt.text;
- if (allCollapsed)
- QCOMPARE(!(opt.features & QStyleOptionViewItem::Alternate), !(index.row() % 2));
- QCOMPARE(!(opt.features & QStyleOptionViewItem::HasCheckIndicator), !opt.text.contains("Checkable"));
+ if (allCollapsed) {
+ QCOMPARE(!opt.features.testFlag(QStyleOptionViewItem::Alternate),
+ !(index.row() % 2));
+ }
+ QCOMPARE(!opt.features.testFlag(QStyleOptionViewItem::HasCheckIndicator),
+ !opt.text.contains("Checkable"));
- if (opt.text.contains("Beginning"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::Beginning));
+ const QString posStr(posToString(opt.viewItemPosition));
+ if (opt.text.contains("Beginning"))
+ QCOMPARE(posStr, posToString(QStyleOptionViewItem::Beginning));
- if (opt.text.contains("Middle"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::Middle));
+ if (opt.text.contains("Middle"))
+ QCOMPARE(posStr, posToString(QStyleOptionViewItem::Middle));
- if (opt.text.contains("End"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::End));
+ if (opt.text.contains("End"))
+ QCOMPARE(posStr, posToString(QStyleOptionViewItem::End));
- if (opt.text.contains("OnlyOne"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::OnlyOne));
+ if (opt.text.contains("OnlyOne"))
+ QCOMPARE(posStr, posToString(QStyleOptionViewItem::OnlyOne));
- if (opt.text.contains("Checked"))
- QCOMPARE(opt.checkState, Qt::Checked);
- else
- QCOMPARE(opt.checkState, Qt::Unchecked);
+ if (opt.text.contains("Checked"))
+ QCOMPARE(opt.checkState, Qt::Checked);
+ else
+ QCOMPARE(opt.checkState, Qt::Unchecked);
- QCOMPARE(!(opt.state & QStyle::State_Children) , !opt.text.contains("HasChildren"));
- QCOMPARE(!!(opt.state & QStyle::State_Sibling) , !opt.text.contains("Last"));
+ QCOMPARE(!opt.state.testFlag(QStyle::State_Children),
+ !opt.text.contains("HasChildren"));
+ QCOMPARE(opt.state.testFlag(QStyle::State_Sibling),
+ !opt.text.contains("Last"));
- QVERIFY(!opt.text.contains("Assert"));
+ QVERIFY(!opt.text.contains("Assert"));
- QStyledItemDelegate::paint(painter, option, index);
- count++;
- }
- mutable int count;
- bool allCollapsed;
+ QStyledItemDelegate::paint(painter, option, index);
+ count++;
+ }
+ mutable int count = 0;
+ bool allCollapsed = false;
};
QTreeView view;
@@ -3269,39 +3263,68 @@ void tst_QTreeView::styleOptionViewItem()
view.setModel(&model);
MyDelegate delegate;
view.setItemDelegate(&delegate);
- model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Hidden") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ model.appendRow({ new QStandardItem("Beginning"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Middle"),
+ new QStandardItem("Middle"),
+ new QStandardItem("End") });
QStandardItem *par1 = new QStandardItem("Beginning HasChildren");
- model.appendRow(QList<QStandardItem*>()
- << par1 << new QStandardItem("Hidden") << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
- model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("OnlyOne") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") );
+ model.appendRow({ par1,
+ new QStandardItem("Hidden"),
+ new QStandardItem("Middle HasChildren"),
+ new QStandardItem("Middle HasChildren"),
+ new QStandardItem("End HasChildren") });
+ model.appendRow({ new QStandardItem("OnlyOne"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Assert"),
+ new QStandardItem("Assert"),
+ new QStandardItem("Assert") });
QStandardItem *checkable = new QStandardItem("Checkable");
checkable->setCheckable(true);
QStandardItem *checked = new QStandardItem("Checkable Checked");
checked->setCheckable(true);
checked->setCheckState(Qt::Checked);
- model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Hidden") << checkable << checked << new QStandardItem("End") );
- model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning Last") << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
-
- par1->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Hidden") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ model.appendRow({ new QStandardItem("Beginning"),
+ new QStandardItem("Hidden"),
+ checkable, checked,
+ new QStandardItem("End") });
+ model.appendRow({ new QStandardItem("Beginning Last"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Middle Last"),
+ new QStandardItem("Middle Last"),
+ new QStandardItem("End Last") });
+ par1->appendRow({ new QStandardItem("Beginning"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Middle"),
+ new QStandardItem("Middle"),
+ new QStandardItem("End") });
QStandardItem *par2 = new QStandardItem("Beginning HasChildren");
- par1->appendRow(QList<QStandardItem*>()
- << par2 << new QStandardItem("Hidden") << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
- par2->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning Last") << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
-
+ par1->appendRow({ par2,
+ new QStandardItem("Hidden"),
+ new QStandardItem("Middle HasChildren"),
+ new QStandardItem("Middle HasChildren"),
+ new QStandardItem("End HasChildren") });
+ par2->appendRow({ new QStandardItem("Beginning Last"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Middle Last"),
+ new QStandardItem("Middle Last"),
+ new QStandardItem("End Last") });
QStandardItem *par3 = new QStandardItem("Beginning Last");
- par1->appendRow(QList<QStandardItem*>()
- << par3 << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
- par3->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Assert") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
+ par1->appendRow({ par3, new QStandardItem("Hidden"),
+ new QStandardItem("Middle Last"),
+ new QStandardItem("Middle Last"),
+ new QStandardItem("End Last") });
+ par3->appendRow({ new QStandardItem("Assert"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Assert"),
+ new QStandardItem("Assert"),
+ new QStandardItem("Asser") });
view.setRowHidden(0, par3->index(), true);
- par1->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Assert") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
+ par1->appendRow({ new QStandardItem("Assert"),
+ new QStandardItem("Hidden"),
+ new QStandardItem("Assert"),
+ new QStandardItem("Assert"),
+ new QStandardItem("Asser") });
view.setRowHidden(3, par1->index(), true);
view.setColumnHidden(1, true);
@@ -3331,16 +3354,14 @@ void tst_QTreeView::styleOptionViewItem()
delegate.count = 0;
delegate.allCollapsed = true;
view.showMaximized();
- QApplication::processEvents();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QTRY_VERIFY(delegate.count >= 13);
delegate.count = 0;
delegate.allCollapsed = false;
view.expandAll();
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 13);
delegate.count = 0;
view.collapse(par2->index());
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 4);
// test that the rendering of drag pixmap sets the correct options too (QTBUG-15834)
@@ -3360,96 +3381,73 @@ void tst_QTreeView::styleOptionViewItem()
delegate.count = 0;
QStandardItemModel model2;
QStandardItem *item0 = new QStandardItem("OnlyOne Last");
- model2.appendRow(QList<QStandardItem*>() << item0);
+ model2.appendRow(item0);
view.setModel(&model2);
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 1);
- QApplication::processEvents();
QStandardItem *item00 = new QStandardItem("OnlyOne Last");
- item0->appendRow(QList<QStandardItem*>() << item00);
+ item0->appendRow(item00);
item0->setText("OnlyOne Last HasChildren");
- QApplication::processEvents();
delegate.count = 0;
view.expandAll();
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 2);
- QApplication::processEvents();
QStandardItem *item1 = new QStandardItem("OnlyOne Last");
delegate.count = 0;
item0->setText("OnlyOne HasChildren");
- model2.appendRow(QList<QStandardItem*>() << item1);
- QApplication::processEvents();
+ model2.appendRow(item1);
QTRY_VERIFY(delegate.count >= 3);
- QApplication::processEvents();
QStandardItem *item01 = new QStandardItem("OnlyOne Last");
delegate.count = 0;
item00->setText("OnlyOne");
- item0->appendRow(QList<QStandardItem*>() << item01);
- QApplication::processEvents();
+ item0->appendRow(item01);
QTRY_VERIFY(delegate.count >= 4);
- QApplication::processEvents();
QStandardItem *item000 = new QStandardItem("OnlyOne Last");
delegate.count = 0;
item00->setText("OnlyOne HasChildren");
- item00->appendRow(QList<QStandardItem*>() << item000);
- QApplication::processEvents();
+ item00->appendRow(item000);
QTRY_VERIFY(delegate.count >= 5);
- QApplication::processEvents();
delegate.count = 0;
item0->removeRow(0);
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 3);
- QApplication::processEvents();
item00 = new QStandardItem("OnlyOne");
- item0->insertRow(0, QList<QStandardItem*>() << item00);
- QApplication::processEvents();
+ item0->insertRow(0, item00);
+
delegate.count = 0;
view.expandAll();
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 4);
- QApplication::processEvents();
delegate.count = 0;
item0->removeRow(1);
item00->setText("OnlyOne Last");
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 3);
- QApplication::processEvents();
delegate.count = 0;
item0->removeRow(0);
item0->setText("OnlyOne");
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 2);
- QApplication::processEvents();
//with hidden items
item0->setText("OnlyOne HasChildren");
item00 = new QStandardItem("OnlyOne");
- item0->appendRow(QList<QStandardItem*>() << item00);
+ item0->appendRow(item00);
item01 = new QStandardItem("Assert");
- item0->appendRow(QList<QStandardItem*>() << item01);
+ item0->appendRow(item01);
view.setRowHidden(1, item0->index(), true);
view.expandAll();
QStandardItem *item02 = new QStandardItem("OnlyOne Last");
- item0->appendRow(QList<QStandardItem*>() << item02);
+ item0->appendRow(item02);
delegate.count = 0;
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 4);
- QApplication::processEvents();
item0->removeRow(2);
item00->setText("OnlyOne Last");
delegate.count = 0;
- QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 3);
- QApplication::processEvents();
item00->setText("OnlyOne");
item0->insertRow(2, new QStandardItem("OnlyOne Last"));
@@ -3457,13 +3455,11 @@ void tst_QTreeView::styleOptionViewItem()
item0->removeRow(0);
delegate.count = 0;
QTRY_VERIFY(delegate.count >= 2);
- QApplication::processEvents();
item0->removeRow(1);
item0->setText("OnlyOne");
delegate.count = 0;
QTRY_VERIFY(delegate.count >= 2);
- QApplication::processEvents();
}
}
@@ -3471,10 +3467,10 @@ class task174627_TreeView : public QTreeView
{
Q_OBJECT
protected slots:
- void currentChanged(const QModelIndex &current, const QModelIndex &)
- { emit currentChanged(current); }
+ void currentChanged(const QModelIndex &current, const QModelIndex &) override
+ { emit signalCurrentChanged(current); }
signals:
- void currentChanged(const QModelIndex &);
+ void signalCurrentChanged(const QModelIndex &);
};
void tst_QTreeView::task174627_moveLeftToRoot()
@@ -3490,7 +3486,7 @@ void tst_QTreeView::task174627_moveLeftToRoot()
view.setRootIndex(item1->index());
view.setCurrentIndex(item2->index());
- QSignalSpy spy(&view, SIGNAL(currentChanged(QModelIndex)));
+ QSignalSpy spy(&view, &task174627_TreeView::signalCurrentChanged);
QTest::keyClick(&view, Qt::Key_Left);
QCOMPARE(spy.count(), 0);
}
@@ -3503,9 +3499,9 @@ void tst_QTreeView::task171902_expandWith1stColHidden()
subitem("subitem"), subitem2("subitem"),
subsubitem("subsubitem"), subsubitem2("subsubitem");
- model.appendRow( QList<QStandardItem *>() << &root << &root2);
- root.appendRow( QList<QStandardItem *>() << &subitem << &subitem2);
- subitem.appendRow( QList<QStandardItem *>() << &subsubitem << &subsubitem2);
+ model.appendRow({ &root, &root2 });
+ root.appendRow({ &subitem, &subitem2 });
+ subitem.appendRow({ &subsubitem, &subsubitem2 });
QTreeView view;
view.setModel(&model);
@@ -3523,18 +3519,18 @@ void tst_QTreeView::task171902_expandWith1stColHidden()
void tst_QTreeView::task203696_hidingColumnsAndRowsn()
{
QTreeView view;
- QStandardItemModel *model = new QStandardItemModel(0, 3, &view);
+ QStandardItemModel model(0, 3);
for (int i = 0; i < 3; ++i) {
const QString prefix = QLatin1String("row ") + QString::number(i) + QLatin1String(" col ");
- model->insertRow(model->rowCount());
- for (int j = 0; j < model->columnCount(); ++j)
- model->setData(model->index(i, j), prefix + QString::number(j));
+ model.insertRow(model.rowCount());
+ for (int j = 0; j < model.columnCount(); ++j)
+ model.setData(model.index(i, j), prefix + QString::number(j));
}
- view.setModel(model);
+ view.setModel(&model);
view.show();
view.setColumnHidden(0, true);
view.setRowHidden(0, QModelIndex(), true);
- QCOMPARE(view.indexAt(QPoint(0, 0)), model->index(1, 1));
+ QCOMPARE(view.indexAt(QPoint(0, 0)), model.index(1, 1));
}
@@ -3547,27 +3543,23 @@ void tst_QTreeView::addRowsWhileSectionsAreHidden()
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
- int i;
- for (i = 0; i < 3; ++i)
+ for (int i = 0; i < 3; ++i)
{
model->insertRow(model->rowCount());
const QString prefix = QLatin1String("row ") + QString::number(i) + QLatin1String(" col ");
- for (int j = 0; j < model->columnCount(); ++j) {
+ for (int j = 0; j < model->columnCount(); ++j)
model->setData(model->index(i, j), prefix + QString::number(j));
- }
}
- int col;
- for (col = 0; col < pass; ++col)
+ for (int col = 0; col < pass; ++col)
view.setColumnHidden(col, true);
- for (i = 3; i < 6; ++i)
+ for (int i = 3; i < 6; ++i)
{
model->insertRow(model->rowCount());
const QString prefix = QLatin1String("row ") + QString::number(i) + QLatin1String(" col ");
- for (int j = 0; j < model->columnCount(); ++j) {
+ for (int j = 0; j < model->columnCount(); ++j)
model->setData(model->index(i, j), prefix + QString::number(j));
- }
}
- for (col = 0; col < pass; ++col)
+ for (int col = 0; col < pass; ++col)
view.setColumnHidden(col, false);
auto allVisualRectsValid = [](QTreeView *view, QStandardItemModel *model) {
@@ -3585,24 +3577,25 @@ void tst_QTreeView::addRowsWhileSectionsAreHidden()
void tst_QTreeView::task216717_updateChildren()
{
- class Tree : public QTreeWidget {
+ class Tree : public QTreeWidget
+ {
protected:
- void paintEvent(QPaintEvent *e)
+ void paintEvent(QPaintEvent *e) override
{
QTreeWidget::paintEvent(e);
- refreshed=true;
+ refreshed = true;
}
public:
- bool refreshed;
+ bool refreshed = false;
} tree;
tree.show();
QVERIFY(QTest::qWaitForWindowExposed(&tree));
tree.refreshed = false;
- QTreeWidgetItem *parent = new QTreeWidgetItem(QStringList() << "parent");
+ QTreeWidgetItem *parent = new QTreeWidgetItem({ "parent" });
tree.addTopLevelItem(parent);
QTRY_VERIFY(tree.refreshed);
tree.refreshed = false;
- parent->addChild(new QTreeWidgetItem(QStringList() << "child"));
+ parent->addChild(new QTreeWidgetItem({ "child" }));
QTRY_VERIFY(tree.refreshed);
}
@@ -3611,13 +3604,14 @@ void tst_QTreeView::task220298_selectColumns()
{
//this is a very simple 3x3 model where the internalId of the index are different for each cell
class Model : public QAbstractTableModel
- { public:
- virtual int columnCount ( const QModelIndex & parent = QModelIndex() ) const
+ {
+ public:
+ int columnCount(const QModelIndex & parent = QModelIndex()) const override
{ return parent.isValid() ? 0 : 3; }
- virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const
+ int rowCount(const QModelIndex & parent = QModelIndex()) const override
{ return parent.isValid() ? 0 : 3; }
- virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const
+ QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override
{
if (role == Qt::DisplayRole) {
return QVariant(QString::number(index.column()) + QLatin1Char('-')
@@ -3626,18 +3620,21 @@ void tst_QTreeView::task220298_selectColumns()
return QVariant();
}
- virtual QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const
+ QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const override
{
- return hasIndex(row, column, parent) ? createIndex(row, column, column*10+row) : QModelIndex();
+ return hasIndex(row, column, parent) ? createIndex(row, column, quintptr(column * 10 + row)) : QModelIndex();
}
};
- class TreeView : public QTreeView { public: QModelIndexList selectedIndexes () const { return QTreeView::selectedIndexes(); } } view;
+ class TreeView : public QTreeView {
+ public:
+ using QTreeView::selectedIndexes;
+ } view;
Model model;
view.setModel(&model);
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0,
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {},
view.visualRect(view.model()->index(1, 1)).center());
QTRY_VERIFY(view.selectedIndexes().contains(view.model()->index(1, 2)));
QVERIFY(view.selectedIndexes().contains(view.model()->index(1, 1)));
@@ -3653,8 +3650,8 @@ void tst_QTreeView::task224091_appendColumns()
QTreeView *treeView = new QTreeView(topLevel);
treeView->setModel(model);
topLevel->show();
- treeView->resize(50,50);
- qApp->setActiveWindow(topLevel);
+ treeView->resize(50, 50);
+ QApplication::setActiveWindow(topLevel);
QVERIFY(QTest::qWaitForWindowActive(topLevel));
QVERIFY(!treeView->verticalScrollBar()->isVisible());
@@ -3705,9 +3702,8 @@ void tst_QTreeView::task211293_removeRootIndex()
view.setCurrentIndex(model.indexFromItem(E11314));
view.setExpanded(model.indexFromItem(E11314), true);
view.show();
- qApp->processEvents();
- model.removeRows(0, 1);
- qApp->processEvents();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(model.removeRows(0, 1));
}
void tst_QTreeView::task225539_deleteModel()
@@ -3716,8 +3712,8 @@ void tst_QTreeView::task225539_deleteModel()
treeView.show();
QStandardItemModel *model = new QStandardItemModel(&treeView);
- QStandardItem* parentItem = model->invisibleRootItem();
- QStandardItem* item = new QStandardItem(QString("item"));
+ QStandardItem *parentItem = model->invisibleRootItem();
+ QStandardItem *item = new QStandardItem(QString("item"));
parentItem->appendRow(item);
treeView.setModel(model);
@@ -3767,7 +3763,7 @@ void tst_QTreeView::task230123_setItemsExpandable()
QTest::keyClick(&tree, Qt::Key_Right);
QVERIFY(root.isExpanded());
- const bool navToChild = tree.style()->styleHint(QStyle::SH_ItemView_ArrowKeysNavigateIntoChildren, 0, &tree);
+ const bool navToChild = tree.style()->styleHint(QStyle::SH_ItemView_ArrowKeysNavigateIntoChildren, nullptr, &tree);
QTest::keyClick(&tree, Qt::Key_Right);
QCOMPARE(tree.currentItem(), navToChild ? &child : &root);
@@ -3784,13 +3780,13 @@ void tst_QTreeView::task230123_setItemsExpandable()
void tst_QTreeView::task202039_closePersistentEditor()
{
- QStandardItemModel model(1,1);
+ QStandardItemModel model(1, 1);
QTreeView view;
view.setModel(&model);
QModelIndex current = model.index(0,0);
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.visualRect(current).center());
- QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(current).center());
+ QTest::mousePress(view.viewport(), Qt::LeftButton, {}, view.visualRect(current).center());
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, {}, view.visualRect(current).center());
QCOMPARE(view.currentIndex(), current);
QVERIFY(view.indexWidget(current));
@@ -3799,8 +3795,8 @@ void tst_QTreeView::task202039_closePersistentEditor()
//here was the bug: closing the persistent editor would not reset the state
//and it was impossible to go into editinon again
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.visualRect(current).center());
- QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(current).center());
+ QTest::mousePress(view.viewport(), Qt::LeftButton, {}, view.visualRect(current).center());
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, {}, view.visualRect(current).center());
QCOMPARE(view.currentIndex(), current);
QVERIFY(view.indexWidget(current));
}
@@ -3824,13 +3820,12 @@ void tst_QTreeView::task238873_avoidAutoReopening()
view.expandAll();
QVERIFY(QTest::qWaitForWindowActive(&view));
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(child.index()).center());
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {}, view.visualRect(child.index()).center());
QTRY_COMPARE(view.currentIndex(), child.index());
view.setExpanded(item1.index(), false);
- QTest::qWait(500); //enough to trigger the delayedAutoScroll timer
- QVERIFY(!view.isExpanded(item1.index()));
+ QTRY_VERIFY(!view.isExpanded(item1.index()));
}
void tst_QTreeView::task244304_clickOnDecoration()
@@ -3841,39 +3836,38 @@ void tst_QTreeView::task244304_clickOnDecoration()
QStandardItem item00("row 0");
item0.appendRow(&item00);
QStandardItem item1("row 1");
- model.appendColumn(QList<QStandardItem*>() << &item0 << &item1);
+ model.appendColumn({ &item0, &item1 });
view.setModel(&model);
QVERIFY(!view.currentIndex().isValid());
QRect rect = view.visualRect(item0.index());
//we click on the decoration
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, rect.topLeft()+QPoint(-rect.left()/2,rect.height()/2));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {},
+ rect.topLeft() + QPoint(-rect.left() / 2, rect.height() / 2));
QVERIFY(!view.currentIndex().isValid());
QVERIFY(view.isExpanded(item0.index()));
rect = view.visualRect(item1.index());
//the item has no decoration, it should get selected
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, rect.topLeft()+QPoint(-rect.left()/2,rect.height()/2));
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {},
+ rect.topLeft() + QPoint(-rect.left() / 2, rect.height() / 2));
QCOMPARE(view.currentIndex(), item1.index());
}
void tst_QTreeView::task246536_scrollbarsNotWorking()
{
- struct MyObject : public QObject
+ class MyObject : public QObject
{
- MyObject() : count(0)
- {
- }
-
- bool eventFilter(QObject*, QEvent *e)
+ public:
+ using QObject::QObject;
+ bool eventFilter(QObject*, QEvent *e) override
{
if (e->type() == QEvent::Paint)
count++;
return false;
}
-
- int count;
+ int count = 0;
};
QTreeView tree;
MyObject o;
@@ -3883,11 +3877,11 @@ void tst_QTreeView::task246536_scrollbarsNotWorking()
tree.show();
QVERIFY(QTest::qWaitForWindowExposed(&tree));
QList<QStandardItem *> items;
- for(int i=0; i<100; ++i){
+ for (int i = 0; i < 100; ++i)
items << new QStandardItem(QLatin1String("item ") + QString::number(i));
- }
+ o.count = 0;
model.invisibleRootItem()->appendColumn(items);
- QTest::qWait(100);
+ QTRY_VERIFY(o.count > 0);
o.count = 0;
tree.verticalScrollBar()->setValue(50);
QTRY_VERIFY(o.count > 0);
@@ -3915,12 +3909,12 @@ void tst_QTreeView::task239271_addRowsWithFirstColumnHidden()
class MyDelegate : public QStyledItemDelegate
{
public:
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override
{
paintedIndexes << index;
QStyledItemDelegate::paint(painter, option, index);
}
-
mutable QSet<QModelIndex> paintedIndexes;
};
@@ -3953,15 +3947,15 @@ void tst_QTreeView::task254234_proxySort()
//based on tst_QTreeView::sortByColumn
// it used not to work when setting the source of a proxy after enabling sorting
QTreeView view;
- QStandardItemModel model(4,2);
- model.setItem(0,0,new QStandardItem("b"));
- model.setItem(1,0,new QStandardItem("d"));
- model.setItem(2,0,new QStandardItem("c"));
- model.setItem(3,0,new QStandardItem("a"));
- model.setItem(0,1,new QStandardItem("e"));
- model.setItem(1,1,new QStandardItem("g"));
- model.setItem(2,1,new QStandardItem("h"));
- model.setItem(3,1,new QStandardItem("f"));
+ QStandardItemModel model(4, 2);
+ model.setItem(0, 0, new QStandardItem("b"));
+ model.setItem(1, 0, new QStandardItem("d"));
+ model.setItem(2, 0, new QStandardItem("c"));
+ model.setItem(3, 0, new QStandardItem("a"));
+ model.setItem(0, 1, new QStandardItem("e"));
+ model.setItem(1, 1, new QStandardItem("g"));
+ model.setItem(2, 1, new QStandardItem("h"));
+ model.setItem(3, 1, new QStandardItem("f"));
view.sortByColumn(1, Qt::DescendingOrder);
view.setSortingEnabled(true);
@@ -3971,8 +3965,8 @@ void tst_QTreeView::task254234_proxySort()
view.setModel(&proxy);
proxy.setSourceModel(&model);
QCOMPARE(view.header()->sortIndicatorSection(), 1);
- QCOMPARE(view.model()->data(view.model()->index(0,1)).toString(), QString::fromLatin1("h"));
- QCOMPARE(view.model()->data(view.model()->index(1,1)).toString(), QString::fromLatin1("g"));
+ QCOMPARE(view.model()->data(view.model()->index(0, 1)).toString(), QString::fromLatin1("h"));
+ QCOMPARE(view.model()->data(view.model()->index(1, 1)).toString(), QString::fromLatin1("g"));
}
class TreeView : public QTreeView
@@ -3984,7 +3978,8 @@ public slots:
//let's select the last item
QModelIndex idx = model()->index(0, 0);
selectionModel()->select(QItemSelection(idx, idx), QItemSelectionModel::Select);
- disconnect(selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(handleSelectionChanged()));
+ disconnect(selectionModel(), &QItemSelectionModel::selectionChanged,
+ this, &TreeView::handleSelectionChanged);
}
};
@@ -3993,12 +3988,14 @@ void tst_QTreeView::task248022_changeSelection()
//we check that changing the selection between the mouse press and the mouse release
//works correctly
TreeView view;
- QStringList list = QStringList() << "1" << "2";
+ const QStringList list({"1", "2"});
QStringListModel model(list);
view.setSelectionMode(QAbstractItemView::ExtendedSelection);
view.setModel(&model);
- view.connect(view.selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(handleSelectionChanged()));
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(model.index(1)).center());
+ connect(view.selectionModel(), &QItemSelectionModel::selectionChanged,
+ &view, &TreeView::handleSelectionChanged);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {},
+ view.visualRect(model.index(1)).center());
QCOMPARE(view.selectionModel()->selectedIndexes().count(), list.count());
}
@@ -4012,8 +4009,9 @@ void tst_QTreeView::task245654_changeModelAndExpandAll()
model->appendRow(top);
view.setModel(model.data());
view.expandAll();
- QApplication::processEvents();
- QVERIFY(view.isExpanded(top->index()));
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QTRY_VERIFY(view.isExpanded(top->index()));
//now let's try to delete the model
//then repopulate and expand again
@@ -4024,9 +4022,7 @@ void tst_QTreeView::task245654_changeModelAndExpandAll()
model->appendRow(top);
view.setModel(model.data());
view.expandAll();
- QApplication::processEvents();
- QVERIFY(view.isExpanded(top->index()));
-
+ QTRY_VERIFY(view.isExpanded(top->index()));
}
void tst_QTreeView::doubleClickedWithSpans()
@@ -4042,10 +4038,10 @@ void tst_QTreeView::doubleClickedWithSpans()
QPoint p(10, 10);
QCOMPARE(view.indexAt(p), model.index(0, 0));
- QSignalSpy spy(&view, SIGNAL(doubleClicked(QModelIndex)));
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0, p);
- QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, p);
- QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, p);
+ QSignalSpy spy(&view, &QAbstractItemView::doubleClicked);
+ QTest::mousePress(view.viewport(), Qt::LeftButton, {}, p);
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, {}, p);
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, {}, p);
QCOMPARE(spy.count(), 1);
//let's click on the 2nd column
@@ -4053,10 +4049,10 @@ void tst_QTreeView::doubleClickedWithSpans()
QCOMPARE(view.indexAt(p), model.index(0, 0));
//end the previous edition
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, p);
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0, p);
- QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, p);
- QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, p);
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, {}, p);
+ QTest::mousePress(view.viewport(), Qt::LeftButton, {}, p);
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, {}, p);
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, {}, p);
QTRY_COMPARE(spy.count(), 2);
}
@@ -4069,7 +4065,8 @@ void tst_QTreeView::taskQTBUG_6450_selectAllWith1stColumnHidden()
const int nrRows = 10;
for (int i = 0; i < nrRows; ++i) {
const QString text = QLatin1String("item: ") + QString::number(i);
- items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(text)));
+ items.append(new QTreeWidgetItem(static_cast<QTreeWidget *>(nullptr),
+ QStringList(text)));
items.last()->setText(1, QString("is an item"));
}
tree.insertTopLevelItems(0, items);
@@ -4086,15 +4083,15 @@ class TreeViewQTBUG_9216 : public QTreeView
{
Q_OBJECT
public:
- void paintEvent(QPaintEvent *event)
+ void paintEvent(QPaintEvent *event) override
{
if (doCompare)
QCOMPARE(event->rect(), viewport()->rect());
QTreeView::paintEvent(event);
painted++;
}
- int painted;
- bool doCompare;
+ int painted = 0;
+ bool doCompare = false;
};
void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint()
@@ -4128,7 +4125,7 @@ void tst_QTreeView::keyboardNavigationWithDisabled()
QStandardItemModel model(90, 0);
for (int i = 0; i < 90; i ++) {
model.setItem(i, new QStandardItem(QString::number(i)));
- model.item(i)->setEnabled(i%6 == 0);
+ model.item(i)->setEnabled(i % 6 == 0);
}
view.setModel(&model);
@@ -4179,6 +4176,7 @@ void tst_QTreeView::keyboardNavigationWithDisabled()
class RemoveColumnOne : public QSortFilterProxyModel
{
+ Q_OBJECT
public:
bool filterAcceptsColumn(int source_column, const QModelIndex &) const override
{
@@ -4200,9 +4198,9 @@ void tst_QTreeView::saveRestoreState()
{
QStandardItemModel model;
for (int i = 0; i < 100; i++) {
- QList<QStandardItem *> items;
- items << new QStandardItem(QLatin1String("item ") + QString::number(i)) << new QStandardItem(QStringLiteral("hidden by proxy")) << new QStandardItem(QStringLiteral("hidden by user"));
- model.appendRow(items);
+ model.appendRow({new QStandardItem(QStringLiteral("item ") + QString::number(i)),
+ new QStandardItem(QStringLiteral("hidden by proxy")),
+ new QStandardItem(QStringLiteral("hidden by user")) });
}
QCOMPARE(model.columnCount(), 3);
@@ -4233,32 +4231,29 @@ class Model_11466 : public QAbstractItemModel
{
Q_OBJECT
public:
- Model_11466(QObject * /* parent */) :
- m_block(false)
+ Model_11466(QObject *parent = nullptr) : QAbstractItemModel(parent)
+ , m_selectionModel(new QItemSelectionModel(this, this))
{
- // set up the model to have two top level items and a few others
- m_selectionModel = new QItemSelectionModel(this, this); // owned by this
-
- connect(m_selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)),
- this, SLOT(slotCurrentChanged(QModelIndex,QModelIndex)));
- };
+ connect(m_selectionModel, &QItemSelectionModel::currentChanged,
+ this, &Model_11466::slotCurrentChanged);
+ }
- int rowCount(const QModelIndex &parent) const
+ int rowCount(const QModelIndex &parent) const override
{
if (parent.isValid())
return (parent.internalId() == 0) ? 4 : 0;
return 2; // two top level items
}
- int columnCount(const QModelIndex & /* parent */) const
+ int columnCount(const QModelIndex & /* parent */) const override
{
return 2;
}
- QVariant data(const QModelIndex &index, int role) const
+ QVariant data(const QModelIndex &index, int role) const override
{
if (role == Qt::DisplayRole && index.isValid()) {
- qint64 parentRowPlusOne = index.internalId();
+ qint64 parentRowPlusOne = qint64(index.internalId());
QString str;
QTextStream stream(&str);
if (parentRowPlusOne > 0)
@@ -4270,10 +4265,10 @@ public:
return QVariant();
}
- QModelIndex parent(const QModelIndex &index) const
+ QModelIndex parent(const QModelIndex &index) const override
{
if (index.isValid()) {
- qint64 parentRowPlusOne = index.internalId();
+ qint64 parentRowPlusOne = qint64(index.internalId());
if (parentRowPlusOne > 0) {
int row = static_cast<int>(parentRowPlusOne - 1);
return createIndex(row, 0);
@@ -4294,9 +4289,9 @@ public:
delete oldModel;
}
- QModelIndex index(int row, int column, const QModelIndex &parent) const
+ QModelIndex index(int row, int column, const QModelIndex &parent) const override
{
- return createIndex(row, column, parent.isValid() ? (quintptr)(parent.row() + 1) : (quintptr)0);
+ return createIndex(row, column, parent.isValid() ? quintptr(parent.row() + 1) : quintptr(0));
}
public slots:
@@ -4333,7 +4328,7 @@ public slots:
}
private:
- bool m_block;
+ bool m_block = false;
QItemSelectionModel *m_selectionModel;
};
@@ -4388,9 +4383,9 @@ void tst_QTreeView::taskQTBUG_25333_adjustViewOptionsForIndex()
QStandardItem *data3 = new QStandardItem("Data3");
// Create a treeview
- model.appendRow(QList<QStandardItem*>() << item1 << data1 );
- model.appendRow(QList<QStandardItem*>() << item2 << data2 );
- model.appendRow(QList<QStandardItem*>() << item3 << data3 );
+ model.appendRow({ item1, data1 });
+ model.appendRow({ item2, data2 });
+ model.appendRow({ item3, data3 });
view.setModel(&model);
@@ -4414,6 +4409,9 @@ void tst_QTreeView::taskQTBUG_25333_adjustViewOptionsForIndex()
void tst_QTreeView::taskQTBUG_18539_emitLayoutChanged()
{
+ qRegisterMetaType<QList<QPersistentModelIndex>>();
+ qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>();
+
QTreeView view;
QStandardItem* item = new QStandardItem("Orig");
@@ -4430,14 +4428,14 @@ void tst_QTreeView::taskQTBUG_18539_emitLayoutChanged()
replacementItem->setChild(0, 0, replacementChild);
- QSignalSpy beforeSpy(&model, SIGNAL(layoutAboutToBeChanged()));
- QSignalSpy afterSpy(&model, SIGNAL(layoutChanged()));
+ QSignalSpy beforeSpy(&model, &QAbstractItemModel::layoutAboutToBeChanged);
+ QSignalSpy afterSpy(&model, &QAbstractItemModel::layoutChanged);
- QSignalSpy beforeRISpy(&model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
- QSignalSpy afterRISpy(&model, SIGNAL(rowsInserted(QModelIndex,int,int)));
+ QSignalSpy beforeRISpy(&model, &QAbstractItemModel::rowsAboutToBeInserted);
+ QSignalSpy afterRISpy(&model, &QAbstractItemModel::rowsInserted);
- QSignalSpy beforeRRSpy(&model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
- QSignalSpy afterRRSpy(&model, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QSignalSpy beforeRRSpy(&model, &QAbstractItemModel::rowsAboutToBeRemoved);
+ QSignalSpy afterRRSpy(&model, &QAbstractItemModel::rowsRemoved);
model.setItem(0, 0, replacementItem);
@@ -4460,7 +4458,7 @@ void tst_QTreeView::taskQTBUG_8176_emitOnExpandAll()
new QTreeWidgetItem(item2, QStringList(QString("item 4")));
QTreeWidgetItem *item5 = new QTreeWidgetItem(&tw, QStringList(QString("item 5")));
new QTreeWidgetItem(item5, QStringList(QString("item 6")));
- QSignalSpy spy(&tw, SIGNAL(expanded(const QModelIndex&)));
+ QSignalSpy spy(&tw, &QTreeView::expanded);
// expand all
tw.expandAll();
@@ -4473,7 +4471,7 @@ void tst_QTreeView::taskQTBUG_8176_emitOnExpandAll()
QCOMPARE(spy.size(), 5);
// collapse all
- QSignalSpy spy2(&tw, SIGNAL(collapsed(const QModelIndex&)));
+ QSignalSpy spy2(&tw, &QTreeView::collapsed);
tw.collapseAll();
QCOMPARE(spy2.size(), 6);
tw.expandAll();
@@ -4496,14 +4494,13 @@ void tst_QTreeView::testInitialFocus()
{
QTreeWidget treeWidget;
treeWidget.setColumnCount(5);
- new QTreeWidgetItem(&treeWidget, QStringList(QString("1;2;3;4;5").split(QLatin1Char(';'))));
+ new QTreeWidgetItem(&treeWidget, QString("1;2;3;4;5").split(QLatin1Char(';')));
treeWidget.setTreePosition(2);
treeWidget.header()->hideSection(0); // make sure we skip hidden section(s)
treeWidget.header()->swapSections(1, 2); // make sure that we look for first visual index (and not first logical)
treeWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&treeWidget));
- QApplication::processEvents();
- QCOMPARE(treeWidget.currentIndex().column(), 2);
+ QTRY_COMPARE(treeWidget.currentIndex().column(), 2);
}
#if QT_CONFIG(animation)
@@ -4534,9 +4531,8 @@ void tst_QTreeView::quickExpandCollapse()
tree.collapse(rootIndex);
QCOMPARE(tree.state(), QTreeView::AnimatingState);
- QTest::qWait(500); //the animation lasts for 250ms max so 500 should be enough
-
- QCOMPARE(tree.state(), initialState);
+ //the animation lasts for 250ms max so 5000 (default) should be enough
+ QTRY_COMPARE(tree.state(), initialState);
}
#endif // animation
@@ -4576,7 +4572,7 @@ class Qtbug45697TestWidget : public QWidget
public:
static const int columnCount = 3;
- explicit Qtbug45697TestWidget();
+ explicit Qtbug45697TestWidget(QWidget *parent = nullptr);
int timerTick() const { return m_timerTick; }
public slots:
@@ -4586,14 +4582,13 @@ private:
QTreeView *m_treeView;
QStandardItemModel *m_model;
QSortFilterProxyModel *m_sortFilterProxyModel;
- int m_timerTick;
+ int m_timerTick = 0;
};
-Qtbug45697TestWidget::Qtbug45697TestWidget()
- : m_treeView(new QTreeView(this))
+Qtbug45697TestWidget::Qtbug45697TestWidget(QWidget *parent)
+ : QWidget(parent), m_treeView(new QTreeView(this))
, m_model(new QStandardItemModel(0, Qtbug45697TestWidget::columnCount, this))
, m_sortFilterProxyModel(new QSortFilterProxyModel(this))
- , m_timerTick(0)
{
QVBoxLayout *vBoxLayout = new QVBoxLayout(this);
vBoxLayout->addWidget(m_treeView);
@@ -4611,7 +4606,7 @@ Qtbug45697TestWidget::Qtbug45697TestWidget()
m_treeView->setModel(m_sortFilterProxyModel);
QHeaderView *headerView = m_treeView->header();
- for (int s = 1, lastSection = headerView->count() - 1; s < lastSection; ++s )
+ for (int s = 1, lastSection = headerView->count() - 1; s < lastSection; ++s)
headerView->setSectionResizeMode(s, QHeaderView::ResizeToContents);
QTimer *timer = new QTimer(this);
@@ -4697,9 +4692,8 @@ void tst_QTreeView::statusTip()
{
QFETCH(bool, intermediateParent);
QMainWindow mw;
- QtTestModel model;
+ QtTestModel model(5, 5);
model.statusTipsEnabled = true;
- model.rows = model.cols = 5;
QTreeView *view = new QTreeView;
view->setModel(&model);
view->viewport()->setMouseTracking(true);
@@ -4717,7 +4711,7 @@ void tst_QTreeView::statusTip()
mw.setGeometry(QRect(QPoint(QApplication::desktop()->geometry().center() - QPoint(250, 250)),
QSize(500, 500)));
mw.show();
- qApp->setActiveWindow(&mw);
+ QApplication::setActiveWindow(&mw);
QVERIFY(QTest::qWaitForWindowActive(&mw));
// Ensure it is moved away first and then moved to the relevant section
QTest::mouseMove(mw.windowHandle(), view->mapTo(&mw, view->rect().bottomLeft() + QPoint(20, 20)));
@@ -4736,8 +4730,9 @@ void tst_QTreeView::statusTip()
class FetchMoreModel : public QStandardItemModel
{
+ Q_OBJECT
public:
- FetchMoreModel() : QStandardItemModel(), canFetchReady(false)
+ FetchMoreModel(QObject *parent = nullptr) : QStandardItemModel(parent)
{
for (int i = 0; i < 20; ++i) {
QStandardItem *item = new QStandardItem("Row");
@@ -4757,9 +4752,9 @@ public:
{
QStandardItem *item = itemFromIndex(parent);
for (int i = 0; i < 19; ++i)
- item->appendRow(new QStandardItem(QString("New Child %1").arg(i)));
+ item->appendRow(new QStandardItem(QStringLiteral("New Child ") + QString::number(i)));
}
- bool canFetchReady;
+ bool canFetchReady = false;
};
void tst_QTreeView::fetchMoreOnScroll()
@@ -4865,12 +4860,12 @@ void tst_QTreeView::taskQTBUG_61476()
const QRect rect = priv->itemDecorationRect(mi);
const QPoint pos = rect.center();
- QTest::mousePress(tv.viewport(), Qt::LeftButton, 0, pos);
- if (tv.style()->styleHint(QStyle::SH_ListViewExpand_SelectMouseType, 0, &tv) ==
+ QTest::mousePress(tv.viewport(), Qt::LeftButton, {}, pos);
+ if (tv.style()->styleHint(QStyle::SH_ListViewExpand_SelectMouseType, nullptr, &tv) ==
QEvent::MouseButtonPress)
QTRY_VERIFY(!tv.isExpanded(mi));
- QTest::mouseRelease(tv.viewport(), Qt::LeftButton, 0, pos);
+ QTest::mouseRelease(tv.viewport(), Qt::LeftButton, nullptr, pos);
QTRY_VERIFY(!tv.isExpanded(mi));
QCOMPARE(lastTopLevel->checkState(), Qt::Checked);
}
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 33d4f3bf91..6b8beccbdc 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -27,36 +27,22 @@
****************************************************************************/
-#include <QtTest/QtTest>
-#include <qtreewidget.h>
-#include <qtreewidgetitemiterator.h>
-#include <qapplication.h>
-#include <qeventloop.h>
-#include <qdebug.h>
-#include <qheaderview.h>
-#include <qlineedit.h>
+#include <QApplication>
+#include <QHeaderView>
+#include <QLineEdit>
#include <QScrollBar>
+#include <QSignalSpy>
#include <QStyledItemDelegate>
-
-class CustomTreeWidget : public QTreeWidget
-{
- Q_OBJECT
-public:
- QModelIndex indexFromItem(QTreeWidgetItem *item, int column = 0) const
- { return QTreeWidget::indexFromItem(item, column); }
-
- QMimeData * mimeData(const QList<QTreeWidgetItem*> items) const
- { return QTreeWidget::mimeData(items); }
-};
+#include <QTreeWidget>
+#include <QTreeWidgetItemIterator>
+#include <QTest>
class tst_QTreeWidget : public QObject
{
Q_OBJECT
public:
- tst_QTreeWidget();
- ~tst_QTreeWidget();
-
+ tst_QTreeWidget() = default;
public slots:
void initTestCase();
@@ -173,8 +159,25 @@ public slots:
void itemSelectionChanged();
void emitDataChanged();
+public:
+ class PublicTreeWidget : public QTreeWidget
+ {
+ public:
+ using QTreeWidget::indexFromItem;
+ using QTreeWidget::mimeData;
+ using QTreeWidget::sizeHintForColumn;
+ void deleteCurrent() { delete currentItem(); }
+ };
+
+ class PublicTreeItem : public QTreeWidgetItem
+ {
+ public:
+ using QTreeWidgetItem::QTreeWidgetItem;
+ using QTreeWidgetItem::emitDataChanged;
+ };
+
private:
- CustomTreeWidget *testWidget;
+ PublicTreeWidget *testWidget = nullptr;
};
// Testing get/set functions
@@ -186,7 +189,7 @@ void tst_QTreeWidget::getSetCheck()
obj1.setColumnCount(0);
QCOMPARE(obj1.columnCount(), 0);
- obj1.setColumnCount(INT_MIN);
+ obj1.setColumnCount(std::numeric_limits<int>::min());
QCOMPARE(obj1.columnCount(), 0);
//obj1.setColumnCount(INT_MAX);
@@ -202,7 +205,7 @@ void tst_QTreeWidget::getSetCheck()
obj1.setHeaderItem(var2);
QCOMPARE(obj1.headerItem(), var2);
- obj1.setHeaderItem((QTreeWidgetItem *)0);
+ obj1.setHeaderItem(nullptr);
// QCOMPARE(obj1.headerItem(), nullptr);
// QTreeWidgetItem * QTreeWidget::currentItem()
@@ -211,36 +214,28 @@ void tst_QTreeWidget::getSetCheck()
obj1.setCurrentItem(var3);
QCOMPARE(obj1.currentItem(), var3);
- obj1.setCurrentItem((QTreeWidgetItem *)0);
+ obj1.setCurrentItem(nullptr);
QCOMPARE(obj1.currentItem(), nullptr);
}
-typedef QList<int> IntList;
-typedef QList<IntList> ListIntList;
+using IntList = QVector<int>;
+using ListIntList = QVector<IntList>;
+using PersistentModelIndexVec = QVector<QPersistentModelIndex>;
+using TreeItem = QTreeWidgetItem;
+using TreeItemList = QVector<TreeItem*>;
Q_DECLARE_METATYPE(Qt::Orientation)
-
-typedef QTreeWidgetItem TreeItem;
-typedef QList<TreeItem*> TreeItemList;
-
Q_DECLARE_METATYPE(QTreeWidgetItem*)
Q_DECLARE_METATYPE(TreeItemList)
-tst_QTreeWidget::tst_QTreeWidget(): testWidget(0)
-{
-}
-
-tst_QTreeWidget::~tst_QTreeWidget()
-{
-}
-
void tst_QTreeWidget::initTestCase()
{
- qMetaTypeId<QModelIndex>();
qMetaTypeId<Qt::Orientation>();
qRegisterMetaType<QTreeWidgetItem*>("QTreeWidgetItem*");
+ qRegisterMetaType<QList<QPersistentModelIndex>>("QList<QPersistentModelIndex>");
+ qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>("QAbstractItemModel::LayoutChangeHint");
- testWidget = new CustomTreeWidget();
+ testWidget = new PublicTreeWidget();
testWidget->show();
QVERIFY(QTest::qWaitForWindowExposed(testWidget));
}
@@ -261,18 +256,19 @@ void tst_QTreeWidget::cleanup()
{
}
-TreeItem *operator<<(TreeItem *parent, const TreeItemList &children) {
- for (int i = 0; i < children.count(); ++i)
- parent->addChild(children.at(i));
+TreeItem *operator<<(TreeItem *parent, const TreeItemList &children)
+{
+ for (TreeItem *child : children)
+ parent->addChild(child);
return parent;
}
static void populate(QTreeWidget *widget, const TreeItemList &topLevelItems,
- TreeItem *headerItem = 0)
+ TreeItem *headerItem = nullptr)
{
widget->clear();
widget->setHeaderItem(headerItem);
- foreach (TreeItem *item, topLevelItems)
+ for (TreeItem *item : topLevelItems)
widget->addTopLevelItem(item);
}
@@ -282,12 +278,12 @@ void tst_QTreeWidget::addTopLevelItem()
QCOMPARE(tree.topLevelItemCount(), 0);
// try to add 0
- tree.addTopLevelItem(0);
+ tree.addTopLevelItem(nullptr);
QCOMPARE(tree.topLevelItemCount(), 0);
- QCOMPARE(tree.indexOfTopLevelItem(0), -1);
+ QCOMPARE(tree.indexOfTopLevelItem(nullptr), -1);
// add one at a time
- QList<TreeItem*> tops;
+ QList<TreeItem *> tops;
for (int i = 0; i < 10; ++i) {
TreeItem *ti = new TreeItem();
QCOMPARE(tree.indexOfTopLevelItem(ti), -1);
@@ -362,19 +358,19 @@ void tst_QTreeWidget::currentItem_data()
QTest::newRow("only top-level items, 2 columns")
<< (TreeItemList()
- << new TreeItem(QStringList() << "a" << "b")
- << new TreeItem(QStringList() << "c" << "d"));
+ << new TreeItem({"a", "b"})
+ << new TreeItem({"c", "d"}));
TreeItemList lst;
- lst << (new TreeItem(QStringList() << "a" << "b")
+ lst << (new TreeItem({"a", "b"})
<< (TreeItemList()
- << new TreeItem(QStringList() << "c" << "d")
- << new TreeItem(QStringList() << "c" << "d")
+ << new TreeItem({"c", "d"})
+ << new TreeItem({"c", "d"})
)
)
- << (new TreeItem(QStringList() << "e" << "f")
+ << (new TreeItem({"e", "f"})
<< (TreeItemList()
- << new TreeItem(QStringList() << "g" << "h")
- << new TreeItem(QStringList() << "g" << "h")
+ << new TreeItem({"g", "h"})
+ << new TreeItem({"g", "h"})
)
);
QTest::newRow("hierarchy, 2 columns") << lst;
@@ -386,15 +382,15 @@ void tst_QTreeWidget::currentItem()
QTreeWidget tree;
tree.show();
- populate(&tree, topLevelItems, new TreeItem(QStringList() << "1" << "2"));
- QTreeWidgetItem *previous = 0;
+ populate(&tree, topLevelItems, new TreeItem({"1", "2"}));
+ QTreeWidgetItem *previous = nullptr;
for (int x = 0; x < 2; ++x) {
tree.setSelectionBehavior(x ? QAbstractItemView::SelectItems
: QAbstractItemView::SelectRows);
QSignalSpy currentItemChangedSpy(
- &tree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
+ &tree, &QTreeWidget::currentItemChanged);
QSignalSpy itemSelectionChangedSpy(
- &tree, SIGNAL(itemSelectionChanged()));
+ &tree, &QTreeWidget::itemSelectionChanged);
QTreeWidgetItemIterator it(&tree);
// do all items
@@ -468,8 +464,7 @@ void tst_QTreeWidget::editItem()
tree.show();
QVERIFY(QTest::qWaitForWindowActive(&tree));
- QSignalSpy itemChangedSpy(
- &tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)));
+ QSignalSpy itemChangedSpy(&tree, &QTreeWidget::itemChanged);
QTreeWidgetItemIterator it(&tree);
while (QTreeWidgetItem *item = (*it++)) {
@@ -477,18 +472,18 @@ void tst_QTreeWidget::editItem()
if (!(item->flags() & Qt::ItemIsEditable))
QTest::ignoreMessage(QtWarningMsg, "edit: editing failed");
tree.editItem(item, col);
- QApplication::instance()->processEvents();
- QApplication::instance()->processEvents();
+ QCoreApplication::processEvents();
+ QCoreApplication::processEvents();
QLineEdit *editor = tree.findChild<QLineEdit*>();
if (editor) {
QVERIFY(item->flags() & Qt::ItemIsEditable);
QCOMPARE(editor->selectedText(), editor->text());
QTest::keyClick(editor, Qt::Key_A);
QTest::keyClick(editor, Qt::Key_Enter);
- QApplication::instance()->processEvents();
+ QCoreApplication::processEvents();
QCOMPARE(itemChangedSpy.count(), 1);
QVariantList args = itemChangedSpy.takeFirst();
- QCOMPARE(qvariant_cast<QTreeWidgetItem*>(args.at(0)), item);
+ QCOMPARE(qvariant_cast<QTreeWidgetItem *>(args.at(0)), item);
QCOMPARE(qvariant_cast<int>(args.at(1)), col);
} else {
QVERIFY(!(item->flags() & Qt::ItemIsEditable));
@@ -522,10 +517,10 @@ void tst_QTreeWidget::takeItem()
QFETCH(bool, topLevel);
QFETCH(bool, outOfBounds);
- for (int i=0; i<3; ++i) {
+ for (int i = 0; i < 3; ++i) {
QTreeWidgetItem *top = new QTreeWidgetItem(testWidget);
top->setText(0, QStringLiteral("top") + QString::number(i));
- for (int j=0; j<3; ++j) {
+ for (int j = 0; j < 3; ++j) {
QTreeWidgetItem *child = new QTreeWidgetItem(top);
child->setText(0, QStringLiteral("child") + QString::number(j));
}
@@ -635,27 +630,23 @@ void tst_QTreeWidget::setItemHidden()
parent->setHidden(true);
parent->setHidden(false);
QVERIFY(!parent->isHidden());
-
-
}
void tst_QTreeWidget::setItemHidden2()
{
// From Task 78587
- QStringList hl;
- hl << "ID" << "Desc";
+ const QStringList hl({"ID", "Desc"});
testWidget->setColumnCount(hl.count());
testWidget->setHeaderLabels(hl);
testWidget->setSortingEnabled(true);
QTreeWidgetItem *top = new QTreeWidgetItem(testWidget);
- QTreeWidgetItem *leaf = 0;
top->setText(0, "ItemList");
for (int i = 1; i <= 4; i++) {
- leaf = new QTreeWidgetItem(top);
- leaf->setText(0, QString::asprintf("%d", i));
- leaf->setText(1, QString::asprintf("Item %d", i));
+ auto leaf = new QTreeWidgetItem(top);
+ leaf->setText(0, QString::number(i));
+ leaf->setText(1, QStringLiteral("Item %1").arg(i));
}
if (testWidget->topLevelItemCount() > 0) {
@@ -666,11 +657,10 @@ void tst_QTreeWidget::setItemHidden2()
if (testWidget->topLevelItemCount() > 0) {
top = testWidget->topLevelItem(0);
for (int i = 0; i < top->childCount(); i++) {
- leaf = top->child(i);
+ auto leaf = top->child(i);
if (leaf->text(0).toInt() % 2 == 0) {
- if (!leaf->isHidden()) {
+ if (!leaf->isHidden())
leaf->setHidden(true);
- }
}
}
}
@@ -799,25 +789,25 @@ void tst_QTreeWidget::selectedItems()
QFETCH(int, topLevel);
QFETCH(int, children);
QFETCH(bool, closeTopLevel);
- QFETCH(ListIntList, selectedItems);
- QFETCH(ListIntList, hiddenItems);
- QFETCH(ListIntList, expectedItems);
+ QFETCH(const ListIntList, selectedItems);
+ QFETCH(const ListIntList, hiddenItems);
+ QFETCH(const ListIntList, expectedItems);
// create items
- for (int t=0; t<topLevel; ++t) {
+ for (int t = 0; t < topLevel; ++t) {
QTreeWidgetItem *top = new QTreeWidgetItem(testWidget);
const QString topS = QLatin1String("top") + QString::number(t);
top->setText(0, topS);
- for (int c=0; c<children; ++c) {
+ for (int c = 0; c < children; ++c) {
QTreeWidgetItem *child = new QTreeWidgetItem(top);
child->setText(0, topS + QLatin1String("child") + QString::number(c));
}
}
// set selected
- foreach (IntList itemPath, selectedItems) {
- QTreeWidgetItem *item = 0;
- foreach(int index, itemPath) {
+ for (const auto &itemPath : selectedItems) {
+ QTreeWidgetItem *item = nullptr;
+ for (int index : itemPath) {
if (!item)
item = testWidget->topLevelItem(index);
else
@@ -827,9 +817,9 @@ void tst_QTreeWidget::selectedItems()
}
// hide rows
- foreach (IntList itemPath, hiddenItems) {
- QTreeWidgetItem *item = 0;
- foreach(int index, itemPath) {
+ for (const auto &itemPath : hiddenItems) {
+ QTreeWidgetItem *item = nullptr;
+ for (int index : itemPath) {
if (!item)
item = testWidget->topLevelItem(index);
else
@@ -839,7 +829,7 @@ void tst_QTreeWidget::selectedItems()
}
// open/close toplevel
- for (int i=0; i<testWidget->topLevelItemCount(); ++i) {
+ for (int i = 0; i < testWidget->topLevelItemCount(); ++i) {
if (closeTopLevel)
testWidget->collapseItem(testWidget->topLevelItem(i));
else
@@ -847,26 +837,26 @@ void tst_QTreeWidget::selectedItems()
}
// check selectedItems
- QList<QTreeWidgetItem*> sel = testWidget->selectedItems();
+ const auto sel = testWidget->selectedItems();
QCOMPARE(sel.count(), expectedItems.count());
- foreach (IntList itemPath, expectedItems) {
- QTreeWidgetItem *item = 0;
- foreach(int index, itemPath) {
+ for (const auto &itemPath : expectedItems) {
+ QTreeWidgetItem *item = nullptr;
+ for (int index : itemPath) {
if (!item)
item = testWidget->topLevelItem(index);
else
item = item->child(index);
}
if (item)
- QVERIFY(sel.contains(item));
+ QVERIFY(sel.contains(item));
}
// compare isSelected
- for (int t=0; t<testWidget->topLevelItemCount(); ++t) {
+ for (int t = 0; t < testWidget->topLevelItemCount(); ++t) {
QTreeWidgetItem *top = testWidget->topLevelItem(t);
if (top->isSelected() && !top->isHidden())
QVERIFY(sel.contains(top));
- for (int c=0; c<top->childCount(); ++c) {
+ for (int c = 0; c < top->childCount(); ++c) {
QTreeWidgetItem *child = top->child(c);
if (child->isSelected() && !child->isHidden())
QVERIFY(sel.contains(child));
@@ -883,9 +873,9 @@ QT_WARNING_POP
#endif
// unselect
- foreach (IntList itemPath, selectedItems) {
- QTreeWidgetItem *item = 0;
- foreach(int index, itemPath) {
+ for (const auto &itemPath : selectedItems) {
+ QTreeWidgetItem *item = nullptr;
+ for (int index : itemPath) {
if (!item)
item = testWidget->topLevelItem(index);
else
@@ -903,7 +893,7 @@ void tst_QTreeWidget::itemAssignment()
QTreeWidgetItem *parent = new QTreeWidgetItem(&grandParent);
parent->setText(0, "foo");
parent->setText(1, "bar");
- for (int i=0; i<5; ++i) {
+ for (int i = 0; i < 5; ++i) {
QTreeWidgetItem *child = new QTreeWidgetItem(parent);
child->setText(0, "bingo");
child->setText(1, "bango");
@@ -919,7 +909,7 @@ void tst_QTreeWidget::itemAssignment()
QTreeWidgetItem item(testWidget);
item.setText(0, "baz");
QVERIFY(!item.parent());
- QCOMPARE(item.treeWidget(), static_cast<QTreeWidget *>(testWidget));
+ QCOMPARE(item.treeWidget(), testWidget);
QCOMPARE(item.columnCount(), 1);
QCOMPARE(item.text(0), QString("baz"));
QCOMPARE(item.childCount(), 0);
@@ -959,16 +949,16 @@ void tst_QTreeWidget::clone()
QFETCH(int, column);
QFETCH(int, topLevelIndex);
QFETCH(int, childIndex);
- QFETCH(QStringList, topLevelText);
- QFETCH(QStringList, childText);
+ QFETCH(const QStringList, topLevelText);
+ QFETCH(const QStringList, childText);
QFETCH(bool, cloneChild);
- for (int i = 0; i < topLevelText.count(); ++i) {
+ for (const QString &tl : topLevelText) {
QTreeWidgetItem *item = new QTreeWidgetItem(testWidget);
- item->setText(column, topLevelText.at(i));
- for (int j = 0; j < childText.count(); ++j) {
+ item->setText(column, tl);
+ for (const QString &cl : childText) {
QTreeWidgetItem *child = new QTreeWidgetItem(item);
- child->setText(column, childText.at(j));
+ child->setText(column, cl);
}
}
@@ -984,7 +974,7 @@ void tst_QTreeWidget::clone()
QVERIFY(copiedChild != originalChild);
QCOMPARE(copiedChild->text(column), originalChild->text(column));
QCOMPARE(copiedChild->childCount(), originalChild->childCount());
- QCOMPARE(copiedChild->parent(), cloneChild ? 0 : copy);
+ QCOMPARE(copiedChild->parent(), cloneChild ? nullptr : copy);
QVERIFY(!copiedChild->treeWidget());
if (cloneChild)
delete copiedChild;
@@ -1109,18 +1099,18 @@ void tst_QTreeWidget::findItems_data()
void tst_QTreeWidget::findItems()
{
QFETCH(int, column);
- QFETCH(QStringList, topLevelText);
- QFETCH(QStringList, childText);
+ QFETCH(const QStringList, topLevelText);
+ QFETCH(const QStringList, childText);
QFETCH(QString, pattern);
QFETCH(int, resultCount);
- QFETCH(QStringList, resultText);
+ QFETCH(const QStringList, resultText);
- for (int i = 0; i < topLevelText.count(); ++i) {
+ for (const QString &tl : topLevelText) {
QTreeWidgetItem *item = new QTreeWidgetItem(testWidget);
- item->setText(column, topLevelText.at(i));
- for (int j = 0; j < childText.count(); ++j) {
+ item->setText(column, tl);
+ for (const QString &cl : childText) {
QTreeWidgetItem *child = new QTreeWidgetItem(item);
- child->setText(column, childText.at(j));
+ child->setText(column, cl);
}
}
@@ -1152,7 +1142,7 @@ void tst_QTreeWidget::findItemsInColumn()
void tst_QTreeWidget::sortItems_data()
{
QTest::addColumn<int>("column");
- QTest::addColumn<int>("order");
+ QTest::addColumn<Qt::SortOrder>("order");
QTest::addColumn<QStringList>("topLevelText");
QTest::addColumn<QStringList>("childText");
QTest::addColumn<QStringList>("topLevelResult");
@@ -1162,7 +1152,7 @@ void tst_QTreeWidget::sortItems_data()
QTest::newRow("ascending order")
<< 0
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "c" << "d" << "a" << "b")
<< (QStringList() << "e" << "h" << "g" << "f")
<< (QStringList() << "a" << "b" << "c" << "d")
@@ -1172,7 +1162,7 @@ void tst_QTreeWidget::sortItems_data()
QTest::newRow("descending order")
<< 0
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< (QStringList() << "c" << "d" << "a" << "b")
<< (QStringList() << "e" << "h" << "g" << "f")
<< (QStringList() << "d" << "c" << "b" << "a")
@@ -1184,7 +1174,7 @@ void tst_QTreeWidget::sortItems_data()
void tst_QTreeWidget::sortItems()
{
QFETCH(int, column);
- QFETCH(int, order);
+ QFETCH(Qt::SortOrder, order);
QFETCH(QStringList, topLevelText);
QFETCH(QStringList, childText);
QFETCH(QStringList, topLevelResult);
@@ -1193,28 +1183,24 @@ void tst_QTreeWidget::sortItems()
QFETCH(IntList, expectedChildRows);
testWidget->setSortingEnabled(false);
- for (int i = 0; i < topLevelText.count(); ++i) {
+ for (const QString &tl : topLevelText) {
QTreeWidgetItem *item = new QTreeWidgetItem(testWidget);
- item->setText(column, topLevelText.at(i));
- for (int j = 0; j < childText.count(); ++j) {
+ item->setText(column, tl);
+ for (const QString &cl : childText) {
QTreeWidgetItem *child = new QTreeWidgetItem(item);
- child->setText(column, childText.at(j));
+ child->setText(column, cl);
}
}
QAbstractItemModel *model = testWidget->model();
- QList<QPersistentModelIndex> tops;
- for (int r = 0; r < model->rowCount(QModelIndex()); ++r) {
- QPersistentModelIndex p = model->index(r, 0, QModelIndex());
- tops << p;
- }
- QList<QPersistentModelIndex> children;
- for (int s = 0; s < model->rowCount(tops.first()); ++s) {
- QPersistentModelIndex c = model->index(s, 0, tops.first());
- children << c;
- }
-
- testWidget->sortItems(column, static_cast<Qt::SortOrder>(order));
+ PersistentModelIndexVec tops;
+ for (int r = 0; r < model->rowCount(QModelIndex()); ++r)
+ tops.push_back(model->index(r, 0, QModelIndex()));
+ PersistentModelIndexVec children;
+ for (int s = 0; s < model->rowCount(tops.constFirst()); ++s)
+ children.push_back(model->index(s, 0, tops.constFirst()));
+
+ testWidget->sortItems(column, order);
QCOMPARE(testWidget->sortColumn(), column);
for (int k = 0; k < topLevelResult.count(); ++k) {
@@ -1382,8 +1368,8 @@ void tst_QTreeWidget::insertTopLevelItems_data()
QTest::addColumn<int>("insertChildIndex");
QTest::addColumn<int>("expectedChildIndex");
- QStringList initial = (QStringList() << "foo" << "bar");
- QStringList insert = (QStringList() << "baz");
+ const QStringList initial{ "foo", "bar" };
+ const QStringList insert{ "baz" };
QTest::newRow("Insert at count") << initial << insert
<< initial.count() << initial.count()
@@ -1434,7 +1420,7 @@ void tst_QTreeWidget::insertTopLevelItems()
delete topsy;
} else {
QTreeWidgetItem *item = testWidget->topLevelItem(expectedTopLevelIndex);
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QCOMPARE(item->text(0), insertText.at(0));
QCOMPARE(testWidget->indexOfTopLevelItem(item), expectedTopLevelIndex);
}
@@ -1442,7 +1428,7 @@ void tst_QTreeWidget::insertTopLevelItems()
{ // test adding more children
QTreeWidgetItem *topLevel = testWidget->topLevelItem(0);
- QVERIFY(topLevel != 0);
+ QVERIFY(topLevel != nullptr);
QTreeWidgetItem *child = new QTreeWidgetItem(QStringList(insertText.at(0)));
topLevel->insertChild(insertChildIndex, child);
if (expectedChildIndex == -1) {
@@ -1450,7 +1436,7 @@ void tst_QTreeWidget::insertTopLevelItems()
delete child;
} else {
QTreeWidgetItem *item = topLevel->child(expectedChildIndex);
- QVERIFY(item != 0);
+ QVERIFY(item != nullptr);
QCOMPARE(item->text(0), insertText.at(0));
}
}
@@ -1486,37 +1472,33 @@ void tst_QTreeWidget::keyboardNavigation()
fillTreeWidget(testWidget, rows);
- QVector<Qt::Key> keymoves;
- keymoves << Qt::Key_Down << Qt::Key_Right << Qt::Key_Left
- << Qt::Key_Down << Qt::Key_Down << Qt::Key_Down << Qt::Key_Down
- << Qt::Key_Right
- << Qt::Key_Up << Qt::Key_Left << Qt::Key_Left
- << Qt::Key_Up << Qt::Key_Down << Qt::Key_Up << Qt::Key_Up
- << Qt::Key_Up << Qt::Key_Up << Qt::Key_Up << Qt::Key_Up
- << Qt::Key_Down << Qt::Key_Right << Qt::Key_Down << Qt::Key_Down
- << Qt::Key_Down << Qt::Key_Right << Qt::Key_Down << Qt::Key_Down
- << Qt::Key_Left << Qt::Key_Left << Qt::Key_Up << Qt::Key_Down
- << Qt::Key_Up << Qt::Key_Up << Qt::Key_Up << Qt::Key_Left
- << Qt::Key_Down << Qt::Key_Right << Qt::Key_Right << Qt::Key_Right
- << Qt::Key_Left << Qt::Key_Left << Qt::Key_Right << Qt::Key_Left;
-
- int row = 0;
+ const QVector<Qt::Key> keymoves {
+ Qt::Key_Down, Qt::Key_Right, Qt::Key_Left,
+ Qt::Key_Down, Qt::Key_Down, Qt::Key_Down, Qt::Key_Down,
+ Qt::Key_Right,
+ Qt::Key_Up, Qt::Key_Left, Qt::Key_Left,
+ Qt::Key_Up, Qt::Key_Down, Qt::Key_Up, Qt::Key_Up,
+ Qt::Key_Up, Qt::Key_Up, Qt::Key_Up, Qt::Key_Up,
+ Qt::Key_Down, Qt::Key_Right, Qt::Key_Down, Qt::Key_Down,
+ Qt::Key_Down, Qt::Key_Right, Qt::Key_Down, Qt::Key_Down,
+ Qt::Key_Left, Qt::Key_Left, Qt::Key_Up, Qt::Key_Down,
+ Qt::Key_Up, Qt::Key_Up, Qt::Key_Up, Qt::Key_Left,
+ Qt::Key_Down, Qt::Key_Right, Qt::Key_Right, Qt::Key_Right,
+ Qt::Key_Left, Qt::Key_Left, Qt::Key_Right, Qt::Key_Left
+ };
+
+ int row = 0;
QTreeWidgetItem *item = testWidget->topLevelItem(0);
testWidget->setCurrentItem(item);
QCOMPARE(testWidget->currentItem(), item);
- QApplication::instance()->processEvents();
+ QCoreApplication::processEvents();
QScrollBar *scrollBar = testWidget->horizontalScrollBar();
- bool checkScroll = false;
- for (int i = 0; i < keymoves.size(); ++i) {
- Qt::Key key = keymoves.at(i);
+ for (const Qt::Key key : keymoves) {
int valueBeforeClick = scrollBar->value();
- if (valueBeforeClick >= scrollBar->singleStep())
- checkScroll = true;
- else
- checkScroll = false;
+ const bool checkScroll = (valueBeforeClick >= scrollBar->singleStep());
QTest::keyClick(testWidget, key);
- QApplication::instance()->processEvents();
+ QCoreApplication::processEvents();
switch (key) {
case Qt::Key_Up:
@@ -1611,15 +1593,15 @@ void tst_QTreeWidget::scrollToItem()
// Check if all parent nodes of the item found are expanded.
// Reported in task #78761
QTreeWidgetItem *search = nullptr;
- for (int i=0; i<2; ++i) {
+ for (int i = 0; i < 2; ++i) {
QTreeWidgetItem *bar = new QTreeWidgetItem(testWidget);
bar->setText(0, QString::number(i));
- for (int j=0; j<2; ++j) {
+ for (int j = 0; j < 2; ++j) {
QTreeWidgetItem *foo = new QTreeWidgetItem(bar);
foo->setText(0, bar->text(0) + QString::number(j));
- for (int k=0; k<2; ++k) {
+ for (int k = 0; k < 2; ++k) {
search = new QTreeWidgetItem(foo);
search->setText(0, foo->text(0) + QString::number(k));
}
@@ -1639,8 +1621,7 @@ void tst_QTreeWidget::scrollToItem()
// From task #85413
void tst_QTreeWidget::setSortingEnabled()
{
- QStringList hl;
- hl << "ID";
+ const QStringList hl{ "ID" };
testWidget->setColumnCount(hl.count());
testWidget->setHeaderLabels(hl);
@@ -1682,14 +1663,14 @@ void tst_QTreeWidget::addChild()
{
QTreeWidget tree;
for (int x = 0; x < 2; ++x) {
- QTreeWidget *view = x ? &tree : static_cast<QTreeWidget*>(0);
- QTreeWidgetItem *item = new QTreeWidgetItem((QTreeWidget*)view);
+ QTreeWidget *view = x ? &tree : static_cast<QTreeWidget*>(nullptr);
+ QTreeWidgetItem *item = new QTreeWidgetItem(view);
QCOMPARE(item->childCount(), 0);
// try to add 0
- item->addChild(0);
+ item->addChild(nullptr);
QCOMPARE(item->childCount(), 0);
- QCOMPARE(item->indexOfChild(0), -1);
+ QCOMPARE(item->indexOfChild(nullptr), -1);
// add one at a time
QList<QTreeWidgetItem*> children;
@@ -1762,11 +1743,11 @@ void tst_QTreeWidget::setData()
testWidget->setHeaderItem(headerItem);
QSignalSpy headerDataChangedSpy(
- testWidget->model(), SIGNAL(headerDataChanged(Qt::Orientation,int,int)));
+ testWidget->model(), &QAbstractItemModel::headerDataChanged);
QSignalSpy dataChangedSpy(
- testWidget->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)));
+ testWidget->model(), &QAbstractItemModel::dataChanged);
QSignalSpy itemChangedSpy(
- testWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)));
+ testWidget, &QTreeWidget::itemChanged);
headerItem->setText(0, "test");
QCOMPARE(dataChangedSpy.count(), 0);
QCOMPARE(headerDataChangedSpy.count(), 1);
@@ -1777,7 +1758,7 @@ void tst_QTreeWidget::setData()
{
QSignalSpy itemChangedSpy(
- testWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)));
+ testWidget, &QTreeWidget::itemChanged);
QTreeWidgetItem *item = new QTreeWidgetItem();
testWidget->addTopLevelItem(item);
for (int x = 0; x < 2; ++x) {
@@ -1999,10 +1980,10 @@ void tst_QTreeWidget::itemData()
item.setData(0, Qt::DisplayRole, QString("0"));
QCOMPARE(widget.currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
item.setData(0, Qt::CheckStateRole, Qt::PartiallyChecked);
- QCOMPARE(widget.currentRoles, {Qt::CheckStateRole});
+ QCOMPARE(widget.currentRoles, QVector<int>{Qt::CheckStateRole});
for (int i = 0; i < 4; ++i) {
item.setData(0, Qt::UserRole + i, QString::number(i + 1));
- QCOMPARE(widget.currentRoles, {Qt::UserRole + i});
+ QCOMPARE(widget.currentRoles, QVector<int>{Qt::UserRole + i});
}
QMap<int, QVariant> flags = widget.model()->itemData(widget.model()->index(0, 0));
QCOMPARE(flags.count(), 6);
@@ -2069,7 +2050,7 @@ void tst_QTreeWidget::setHeaderLabels()
void tst_QTreeWidget::setHeaderItem()
{
- testWidget->setHeaderItem(0);
+ testWidget->setHeaderItem(nullptr);
QTreeWidgetItem *headerItem = new QTreeWidgetItem();
testWidget->setColumnCount(0);
@@ -2118,7 +2099,7 @@ void tst_QTreeWidget::itemWidget()
QFETCH(TreeItemList, topLevelItems);
QTreeWidget tree;
- populate(&tree, topLevelItems, new TreeItem(QStringList() << "1" << "2"));
+ populate(&tree, topLevelItems, new TreeItem({"1", "2"}));
tree.show();
for (int x = 0; x < 2; ++x) {
@@ -2126,18 +2107,18 @@ void tst_QTreeWidget::itemWidget()
while (QTreeWidgetItem *item = (*it++)) {
for (int col = 0; col < item->columnCount(); ++col) {
if (x == 0) {
- QCOMPARE(tree.itemWidget(item, col), static_cast<QWidget*>(0));
+ QCOMPARE(tree.itemWidget(item, col), nullptr);
QWidget *editor = new QLineEdit();
tree.setItemWidget(item, col, editor);
QCOMPARE(tree.itemWidget(item, col), editor);
tree.removeItemWidget(item, col);
- QCOMPARE(tree.itemWidget(item, col), static_cast<QWidget*>(0));
+ QCOMPARE(tree.itemWidget(item, col), nullptr);
} else {
// ### should you really be able to open a persistent
// editor for an item that isn't editable??
tree.openPersistentEditor(item, col);
QWidget *editor = tree.findChild<QLineEdit*>();
- QVERIFY(editor != 0);
+ QVERIFY(editor != nullptr);
tree.closePersistentEditor(item, col);
}
}
@@ -2147,50 +2128,50 @@ void tst_QTreeWidget::itemWidget()
void tst_QTreeWidget::insertItemsWithSorting_data()
{
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<QStringList>("initialItems");
QTest::addColumn<QStringList>("insertItems");
QTest::addColumn<QStringList>("expectedItems");
QTest::addColumn<IntList>("expectedRows");
QTest::newRow("() + (a) = (a)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< QStringList()
<< (QStringList() << "a")
<< (QStringList() << "a")
<< IntList();
QTest::newRow("() + (c, b, a) = (a, b, c)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< QStringList()
<< (QStringList() << "c" << "b" << "a")
<< (QStringList() << "a" << "b" << "c")
<< IntList();
QTest::newRow("() + (a, b, c) = (c, b, a)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< QStringList()
<< (QStringList() << "a" << "b" << "c")
<< (QStringList() << "c" << "b" << "a")
<< IntList();
QTest::newRow("(a) + (b) = (a, b)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< QStringList("a")
<< (QStringList() << "b")
<< (QStringList() << "a" << "b")
<< (IntList() << 0);
QTest::newRow("(a) + (b) = (b, a)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< QStringList("a")
<< (QStringList() << "b")
<< (QStringList() << "b" << "a")
<< (IntList() << 1);
QTest::newRow("(a, c, b) + (d) = (a, b, c, d)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "b")
<< (QStringList() << "d")
<< (QStringList() << "a" << "b" << "c" << "d")
<< (IntList() << 0 << 1 << 2);
QTest::newRow("(b, c, a) + (d) = (d, c, b, a)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< (QStringList() << "b" << "c" << "a")
<< (QStringList() << "d")
<< (QStringList() << "d" << "c" << "b" << "a")
@@ -2200,38 +2181,38 @@ void tst_QTreeWidget::insertItemsWithSorting_data()
IntList reverseRows;
QStringList ascendingItems;
QStringList reverseItems;
- for (int i = 'a'; i <= 'z'; ++i) {
+ for (char i = 'a'; i <= 'z'; ++i) {
ascendingItems << QString(1, QLatin1Char(i));
reverseItems << QString(1, QLatin1Char('z' - i + 'a'));
ascendingRows << i - 'a';
reverseRows << 'z' - i + 'a';
}
QTest::newRow("() + (sorted items) = (sorted items)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< QStringList()
<< ascendingItems
<< ascendingItems
<< IntList();
QTest::newRow("(sorted items) + () = (sorted items)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< ascendingItems
<< QStringList()
<< ascendingItems
<< ascendingRows;
QTest::newRow("() + (ascending items) = (reverse items)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< QStringList()
<< ascendingItems
<< reverseItems
<< IntList();
QTest::newRow("(reverse items) + () = (ascending items)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< reverseItems
<< QStringList()
<< ascendingItems
<< ascendingRows;
QTest::newRow("(reverse items) + () = (reverse items)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< reverseItems
<< QStringList()
<< reverseItems
@@ -2241,57 +2222,57 @@ void tst_QTreeWidget::insertItemsWithSorting_data()
void tst_QTreeWidget::insertItemsWithSorting()
{
- QFETCH(int, sortOrder);
- QFETCH(QStringList, initialItems);
- QFETCH(QStringList, insertItems);
- QFETCH(QStringList, expectedItems);
+ QFETCH(Qt::SortOrder, sortOrder);
+ QFETCH(const QStringList, initialItems);
+ QFETCH(const QStringList, insertItems);
+ QFETCH(const QStringList, expectedItems);
QFETCH(IntList, expectedRows);
for (int method = 0; method < 5; ++method) {
QTreeWidget w;
w.setSortingEnabled(true);
- w.sortItems(0, static_cast<Qt::SortOrder>(sortOrder));
- for (int i = 0; i < initialItems.count(); ++i)
- w.addTopLevelItem(new QTreeWidgetItem(QStringList() << initialItems.at(i)));
+ w.sortItems(0, sortOrder);
+ for (const QString &initialItem : initialItems)
+ w.addTopLevelItem(new QTreeWidgetItem({initialItem}));
QAbstractItemModel *model = w.model();
- QList<QPersistentModelIndex> persistent;
+ PersistentModelIndexVec persistent;
for (int j = 0; j < model->rowCount(QModelIndex()); ++j)
persistent << model->index(j, 0, QModelIndex());
switch (method) {
case 0:
// insert using item constructor
- for (int i = 0; i < insertItems.size(); ++i)
- new QTreeWidgetItem(&w, QStringList() << insertItems.at(i));
+ for (const QString &txt : insertItems)
+ new QTreeWidgetItem(&w, { txt });
break;
case 1:
{
// insert using insertTopLevelItems()
QList<QTreeWidgetItem*> lst;
- for (int i = 0; i < insertItems.size(); ++i)
- lst << new QTreeWidgetItem(QStringList() << insertItems.at(i));
+ for (const QString &txt : insertItems)
+ lst << new QTreeWidgetItem({ txt });
w.insertTopLevelItems(0, lst);
break;
}
case 2:
// insert using insertTopLevelItem()
- for (int i = 0; i < insertItems.size(); ++i)
- w.insertTopLevelItem(0, new QTreeWidgetItem(QStringList() << insertItems.at(i)));
+ for (const QString &txt : insertItems)
+ w.insertTopLevelItem(0, new QTreeWidgetItem({ txt }));
break;
case 3:
{
// insert using addTopLevelItems()
QList<QTreeWidgetItem*> lst;
- for (int i = 0; i < insertItems.size(); ++i)
- lst << new QTreeWidgetItem(QStringList() << insertItems.at(i));
+ for (const QString &txt : insertItems)
+ lst << new QTreeWidgetItem({ txt });
w.addTopLevelItems(lst);
break;
}
case 4:
// insert using addTopLevelItem()
- for (int i = 0; i < insertItems.size(); ++i)
- w.addTopLevelItem(new QTreeWidgetItem(QStringList() << insertItems.at(i)));
+ for (const QString &txt : insertItems)
+ w.addTopLevelItem(new QTreeWidgetItem({ txt }));
break;
}
QCOMPARE(w.topLevelItemCount(), expectedItems.count());
@@ -2305,8 +2286,8 @@ void tst_QTreeWidget::insertItemsWithSorting()
void tst_QTreeWidget::insertExpandedItemsWithSorting_data()
{
- QTest::addColumn<QStringList>("parentText");
- QTest::addColumn<QStringList>("childText");
+ QTest::addColumn<QStringList>("parentTexts");
+ QTest::addColumn<QStringList>("childTexts");
QTest::addColumn<QStringList>("parentResult");
QTest::addColumn<QStringList>("childResult");
QTest::newRow("test 1")
@@ -2319,36 +2300,36 @@ void tst_QTreeWidget::insertExpandedItemsWithSorting_data()
// From Task 134978
void tst_QTreeWidget::insertExpandedItemsWithSorting()
{
- QFETCH(QStringList, parentText);
- QFETCH(QStringList, childText);
- QFETCH(QStringList, parentResult);
- QFETCH(QStringList, childResult);
+ QFETCH(const QStringList, parentTexts);
+ QFETCH(const QStringList, childTexts);
+ QFETCH(const QStringList, parentResult);
+ QFETCH(const QStringList, childResult);
// create a tree with autosorting enabled
- CustomTreeWidget tree;
+ PublicTreeWidget tree;
tree.setSortingEnabled(true);
// insert expanded items in unsorted order
- QList<QTreeWidgetItem *> items;
- for (int i = 0; i < parentText.count(); ++i) {
- QTreeWidgetItem *parent = new QTreeWidgetItem(&tree, QStringList(parentText.at(i)));
+ QVector<QTreeWidgetItem *> items;
+ for (const QString &text : parentTexts) {
+ QTreeWidgetItem *parent = new QTreeWidgetItem(&tree, {text});
parent->setExpanded(true);
QVERIFY(parent->isExpanded());
items << parent;
- for (int j = 0; j < childText.count(); ++j) {
- QTreeWidgetItem *child = new QTreeWidgetItem(parent, QStringList(childText.at(j)));
+ for (const QString &text : childTexts) {
+ QTreeWidgetItem *child = new QTreeWidgetItem(parent, {text});
items << child;
}
- QCOMPARE(parent->childCount(), childText.count());
+ QCOMPARE(parent->childCount(), childTexts.count());
QVERIFY(parent->isExpanded());
}
- QCOMPARE(tree.model()->rowCount(), parentText.count());
+ QCOMPARE(tree.model()->rowCount(), parentTexts.count());
// verify that the items are still expanded
- foreach (QTreeWidgetItem *item, items) {
+ for (const QTreeWidgetItem *item : qAsConst(items)) {
if (item->childCount() > 0)
QVERIFY(item->isExpanded());
- QModelIndex idx = tree.indexFromItem(const_cast<QTreeWidgetItem *>(item));
+ QModelIndex idx = tree.indexFromItem(item);
QVERIFY(idx.isValid());
//QRect rect = tree.visualRect(idx);
//QVERIFY(rect.isValid());
@@ -2357,16 +2338,12 @@ void tst_QTreeWidget::insertExpandedItemsWithSorting()
// verify that the tree is sorted
QAbstractItemModel *model = tree.model();
- QList<QPersistentModelIndex> parents;
- for (int i = 0; i < model->rowCount(QModelIndex()); ++i) {
- QPersistentModelIndex parent = model->index(i, 0, QModelIndex());
- parents << parent;
- }
- QList<QPersistentModelIndex> children;
- for (int i = 0; i < model->rowCount(parents.first()); ++i) {
- QPersistentModelIndex child = model->index(i, 0, parents.first());
- children << child;
- }
+ PersistentModelIndexVec parents;
+ for (int i = 0; i < model->rowCount(QModelIndex()); ++i)
+ parents.push_back(model->index(i, 0, QModelIndex()));
+ PersistentModelIndexVec children;
+ for (int i = 0; i < model->rowCount(parents.constFirst()); ++i)
+ children.push_back(model->index(i, 0, parents.constFirst()));
for (int i = 0; i < parentResult.count(); ++i) {
QTreeWidgetItem *item = tree.topLevelItem(i);
QCOMPARE(item->text(0), parentResult.at(i));
@@ -2377,7 +2354,7 @@ void tst_QTreeWidget::insertExpandedItemsWithSorting()
void tst_QTreeWidget::changeDataWithSorting_data()
{
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<QStringList>("initialItems");
QTest::addColumn<int>("itemIndex");
QTest::addColumn<QString>("newValue");
@@ -2386,49 +2363,49 @@ void tst_QTreeWidget::changeDataWithSorting_data()
QTest::addColumn<bool>("reorderingExpected");
QTest::newRow("change a to b in (a)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a")
<< 0 << "b"
<< (QStringList() << "b")
<< (IntList() << 0)
<< false;
QTest::newRow("change a to b in (a, c)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c")
<< 0 << "b"
<< (QStringList() << "b" << "c")
<< (IntList() << 0 << 1)
<< false;
QTest::newRow("change a to c in (a, b)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "b")
<< 0 << "c"
<< (QStringList() << "b" << "c")
<< (IntList() << 1 << 0)
<< true;
QTest::newRow("change c to a in (c, b)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< (QStringList() << "c" << "b")
<< 0 << "a"
<< (QStringList() << "b" << "a")
<< (IntList() << 1 << 0)
<< true;
QTest::newRow("change e to i in (a, c, e, g)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "e" << "g")
<< 2 << "i"
<< (QStringList() << "a" << "c" << "g" << "i")
<< (IntList() << 0 << 1 << 3 << 2)
<< true;
QTest::newRow("change e to a in (c, e, g, i)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "c" << "e" << "g" << "i")
<< 1 << "a"
<< (QStringList() << "a" << "c" << "g" << "i")
<< (IntList() << 1 << 0 << 2 << 3)
<< true;
QTest::newRow("change e to f in (c, e, g, i)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "c" << "e" << "g" << "i")
<< 1 << "f"
<< (QStringList() << "c" << "f" << "g" << "i")
@@ -2438,35 +2415,35 @@ void tst_QTreeWidget::changeDataWithSorting_data()
void tst_QTreeWidget::changeDataWithSorting()
{
- QFETCH(int, sortOrder);
- QFETCH(QStringList, initialItems);
+ QFETCH(Qt::SortOrder, sortOrder);
+ QFETCH(const QStringList, initialItems);
QFETCH(int, itemIndex);
- QFETCH(QString, newValue);
- QFETCH(QStringList, expectedItems);
- QFETCH(IntList, expectedRows);
+ QFETCH(const QString, newValue);
+ QFETCH(const QStringList, expectedItems);
+ QFETCH(const IntList, expectedRows);
QFETCH(bool, reorderingExpected);
QTreeWidget w;
w.setSortingEnabled(true);
- w.sortItems(0, static_cast<Qt::SortOrder>(sortOrder));
- for (int i = 0; i < initialItems.count(); ++i)
- w.addTopLevelItem(new QTreeWidgetItem(QStringList() << initialItems.at(i)));
+ w.sortItems(0, sortOrder);
+ for (const QString &str : initialItems)
+ w.addTopLevelItem(new QTreeWidgetItem({ str }));
QAbstractItemModel *model = w.model();
- QList<QPersistentModelIndex> persistent;
+ PersistentModelIndexVec persistent;
for (int j = 0; j < model->rowCount(QModelIndex()); ++j)
persistent << model->index(j, 0, QModelIndex());
- QSignalSpy dataChangedSpy(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
- QSignalSpy layoutChangedSpy(model, SIGNAL(layoutChanged()));
+ QSignalSpy dataChangedSpy(model, &QAbstractItemModel::dataChanged);
+ QSignalSpy layoutChangedSpy(model, &QAbstractItemModel::layoutChanged);
QTreeWidgetItem *item = w.topLevelItem(itemIndex);
item->setText(0, newValue);
for (int i = 0; i < expectedItems.count(); ++i) {
QCOMPARE(w.topLevelItem(i)->text(0), expectedItems.at(i));
- for (int j = 0; j < persistent.count(); ++j) {
- if (persistent.at(j).row() == i) // the same toplevel row
- QCOMPARE(persistent.at(j).internalPointer(), (void *)w.topLevelItem(i));
+ for (const QPersistentModelIndex &p : qAsConst(persistent)) {
+ if (p.row() == i) // the same toplevel row
+ QCOMPARE(p.internalPointer(), static_cast<void *>(w.topLevelItem(i)));
}
}
@@ -2479,7 +2456,7 @@ void tst_QTreeWidget::changeDataWithSorting()
void tst_QTreeWidget::changeDataWithStableSorting_data()
{
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<QStringList>("initialItems");
QTest::addColumn<int>("itemIndex");
QTest::addColumn<QString>("newValue");
@@ -2489,7 +2466,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
QTest::addColumn<bool>("forceChange");
QTest::newRow("change a to c in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 0 << "c"
<< (QStringList() << "c" << "c" << "c" << "c" << "e")
@@ -2497,7 +2474,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< false;
QTest::newRow("change e to c in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 4 << "c"
<< (QStringList() << "a" << "c" << "c" << "c" << "c")
@@ -2505,7 +2482,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< false;
QTest::newRow("change 1st c to c in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 1 << "c"
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
@@ -2513,7 +2490,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< true;
QTest::newRow("change 2nd c to c in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 2 << "c"
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
@@ -2521,7 +2498,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< true;
QTest::newRow("change 3rd c to c in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 3 << "c"
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
@@ -2529,7 +2506,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< true;
QTest::newRow("change 1st c to c in (e, c, c, c, a)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< (QStringList() << "e" << "c" << "c" << "c" << "a")
<< 1 << "c"
<< (QStringList() << "e" << "c" << "c" << "c" << "a")
@@ -2537,7 +2514,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< true;
QTest::newRow("change 2nd c to c in (e, c, c, c, a)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< (QStringList() << "e" << "c" << "c" << "c" << "a")
<< 2 << "c"
<< (QStringList() << "e" << "c" << "c" << "c" << "a")
@@ -2545,7 +2522,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< true;
QTest::newRow("change 3rd c to c in (e, c, c, c, a)")
- << static_cast<int>(Qt::DescendingOrder)
+ << Qt::DescendingOrder
<< (QStringList() << "e" << "c" << "c" << "c" << "a")
<< 3 << "c"
<< (QStringList() << "e" << "c" << "c" << "c" << "a")
@@ -2553,7 +2530,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< true;
QTest::newRow("change 1st c to b in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 1 << "b"
<< (QStringList() << "a" << "b" << "c" << "c" << "e")
@@ -2561,7 +2538,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< false
<< false;
QTest::newRow("change 2nd c to b in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 2 << "b"
<< (QStringList() << "a" << "b" << "c" << "c" << "e")
@@ -2569,7 +2546,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< true
<< false;
QTest::newRow("change 3rd c to b in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 3 << "b"
<< (QStringList() << "a" << "b" << "c" << "c" << "e")
@@ -2577,7 +2554,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< true
<< false;
QTest::newRow("change 1st c to d in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 1 << "d"
<< (QStringList() << "a" << "c" << "c" << "d" << "e")
@@ -2585,7 +2562,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< true
<< false;
QTest::newRow("change 2nd c to d in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 2 << "d"
<< (QStringList() << "a" << "c" << "c" << "d" << "e")
@@ -2593,7 +2570,7 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
<< true
<< false;
QTest::newRow("change 3rd c to d in (a, c, c, c, e)")
- << static_cast<int>(Qt::AscendingOrder)
+ << Qt::AscendingOrder
<< (QStringList() << "a" << "c" << "c" << "c" << "e")
<< 3 << "d"
<< (QStringList() << "a" << "c" << "c" << "d" << "e")
@@ -2604,47 +2581,38 @@ void tst_QTreeWidget::changeDataWithStableSorting_data()
void tst_QTreeWidget::changeDataWithStableSorting()
{
- QFETCH(int, sortOrder);
- QFETCH(QStringList, initialItems);
+ QFETCH(Qt::SortOrder, sortOrder);
+ QFETCH(const QStringList, initialItems);
QFETCH(int, itemIndex);
- QFETCH(QString, newValue);
- QFETCH(QStringList, expectedItems);
- QFETCH(IntList, expectedRows);
+ QFETCH(const QString, newValue);
+ QFETCH(const QStringList, expectedItems);
+ QFETCH(const IntList, expectedRows);
QFETCH(bool, reorderingExpected);
QFETCH(bool, forceChange);
- class StableItem : public QTreeWidgetItem
- {
- public:
- StableItem(const QStringList &strings) : QTreeWidgetItem(strings, QTreeWidgetItem::UserType) {}
- void forceChangeData() {
- emitDataChanged();
- }
- };
-
QTreeWidget w;
w.setSortingEnabled(true);
- w.sortItems(0, static_cast<Qt::SortOrder>(sortOrder));
- for (int i = 0; i < initialItems.count(); ++i)
- w.addTopLevelItem(new StableItem(QStringList() << initialItems.at(i)));
+ w.sortItems(0, sortOrder);
+ for (const QString &str : initialItems)
+ w.addTopLevelItem(new PublicTreeItem({ str }));
QAbstractItemModel *model = w.model();
- QList<QPersistentModelIndex> persistent;
+ PersistentModelIndexVec persistent;
for (int j = 0; j < model->rowCount(QModelIndex()); ++j)
persistent << model->index(j, 0, QModelIndex());
- QSignalSpy dataChangedSpy(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
- QSignalSpy layoutChangedSpy(model, SIGNAL(layoutChanged()));
+ QSignalSpy dataChangedSpy(model, &QAbstractItemModel::dataChanged);
+ QSignalSpy layoutChangedSpy(model, &QAbstractItemModel::layoutChanged);
- StableItem *item = static_cast<StableItem *>(w.topLevelItem(itemIndex));
+ auto *item = static_cast<PublicTreeItem *>(w.topLevelItem(itemIndex));
item->setText(0, newValue);
if (forceChange)
- item->forceChangeData();
+ item->emitDataChanged();
for (int i = 0; i < expectedItems.count(); ++i) {
QCOMPARE(w.topLevelItem(i)->text(0), expectedItems.at(i));
- for (int j = 0; j < persistent.count(); ++j) {
- if (persistent.at(j).row() == i) // the same toplevel row
- QCOMPARE(persistent.at(j).internalPointer(), (void *)w.topLevelItem(i));
+ for (const QPersistentModelIndex &p : qAsConst(persistent)) {
+ if (p.row() == i) // the same toplevel row
+ QCOMPARE(p.internalPointer(), static_cast<void *>(w.topLevelItem(i)));
}
}
@@ -2657,24 +2625,24 @@ void tst_QTreeWidget::changeDataWithStableSorting()
void tst_QTreeWidget::sizeHint_data()
{
- QTest::addColumn<int>("scrollBarPolicy");
+ QTest::addColumn<Qt::ScrollBarPolicy>("scrollBarPolicy");
QTest::addColumn<QSize>("viewSize");
- QTest::newRow("ScrollBarAlwaysOn") << static_cast<int>(Qt::ScrollBarAlwaysOn) << QSize();
- QTest::newRow("ScrollBarAlwaysOff") << static_cast<int>(Qt::ScrollBarAlwaysOff) << QSize();
+ QTest::newRow("ScrollBarAlwaysOn") << Qt::ScrollBarAlwaysOn << QSize();
+ QTest::newRow("ScrollBarAlwaysOff") << Qt::ScrollBarAlwaysOff << QSize();
// make sure the scrollbars are shown by resizing the view to 40x40
- QTest::newRow("ScrollBarAsNeeded (40x40)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(40, 40);
- QTest::newRow("ScrollBarAsNeeded (1000x1000)") << static_cast<int>(Qt::ScrollBarAsNeeded) << QSize(1000, 1000);
+ QTest::newRow("ScrollBarAsNeeded (40x40)") << Qt::ScrollBarAsNeeded << QSize(40, 40);
+ QTest::newRow("ScrollBarAsNeeded (1000x1000)") << Qt::ScrollBarAsNeeded << QSize(1000, 1000);
}
void tst_QTreeWidget::sizeHint()
{
- QFETCH(int, scrollBarPolicy);
+ QFETCH(Qt::ScrollBarPolicy, scrollBarPolicy);
QFETCH(QSize, viewSize);
QTreeWidget view;
view.setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
- view.setVerticalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy));
- view.setHorizontalScrollBarPolicy(static_cast<Qt::ScrollBarPolicy>(scrollBarPolicy));
+ view.setVerticalScrollBarPolicy(scrollBarPolicy);
+ view.setHorizontalScrollBarPolicy(scrollBarPolicy);
view.setColumnCount(2);
for (int i = 0 ; i < view.columnCount(); ++i)
view.addTopLevelItem(new QTreeWidgetItem(QStringList{"foo","bar"}));
@@ -2726,36 +2694,36 @@ void tst_QTreeWidget::itemOperatorLessThan()
void tst_QTreeWidget::sortedIndexOfChild_data()
{
- QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<Qt::SortOrder>("sortOrder");
QTest::addColumn<QStringList>("itemTexts");
- QTest::addColumn<QList<int> >("expectedIndexes");
+ QTest::addColumn<IntList>("expectedIndexes");
QTest::newRow("three ascending")
- << int(Qt::AscendingOrder)
- << (QStringList() << "A" << "B" << "C")
- << (QList<int>() << 0 << 1 << 2);
+ << Qt::AscendingOrder
+ << (QStringList{"A", "B", "C"})
+ << (IntList{0, 1, 2});
QTest::newRow("three descending")
- << int(Qt::DescendingOrder)
- << (QStringList() << "A" << "B" << "C")
- << (QList<int>() << 2 << 1 << 0);
+ << Qt::DescendingOrder
+ << (QStringList{"A", "B", "C"})
+ << (IntList{2, 1, 0});
}
void tst_QTreeWidget::sortedIndexOfChild()
{
- QFETCH(int, sortOrder);
- QFETCH(QStringList, itemTexts);
- QFETCH(QList<int>, expectedIndexes);
+ QFETCH(Qt::SortOrder, sortOrder);
+ QFETCH(const QStringList, itemTexts);
+ QFETCH(const IntList, expectedIndexes);
QTreeWidget tw;
- QList<QTreeWidgetItem*> itms;
- QTreeWidgetItem *top = new QTreeWidgetItem(&tw, QStringList() << "top");
+ QVector<QTreeWidgetItem *> itms;
+ auto *top = new QTreeWidgetItem(&tw, {"top"});
- for (int i = 0; i < itemTexts.count(); ++i)
- itms << new QTreeWidgetItem(top, QStringList() << itemTexts.at(i));
+ for (const QString &str : itemTexts)
+ itms << new QTreeWidgetItem(top, {str});
- tw.sortItems(0, (Qt::SortOrder)sortOrder);
+ tw.sortItems(0, sortOrder);
tw.expandAll();
QCOMPARE(itms.count(), expectedIndexes.count());
@@ -2773,8 +2741,8 @@ void tst_QTreeWidget::expandAndCallapse()
for (int j = 0; j < 10; ++j)
new QTreeWidgetItem(p, QStringList(QString::number(j)));
}
- QSignalSpy spy0(&tw, SIGNAL(itemExpanded(QTreeWidgetItem*)));
- QSignalSpy spy1(&tw, SIGNAL(itemCollapsed(QTreeWidgetItem*)));
+ QSignalSpy spy0(&tw, &QTreeWidget::itemExpanded);
+ QSignalSpy spy1(&tw, &QTreeWidget::itemCollapsed);
tw.expandItem(p);
@@ -2909,20 +2877,12 @@ void tst_QTreeWidget::removeSelectedItem()
QCOMPARE(selModel->isSelected(w->model()->index(0,0)), false);
}
-class AnotherTreeWidget : public QTreeWidget
-{
- Q_OBJECT
-public:
- AnotherTreeWidget(QWidget *parent = 0) : QTreeWidget(parent) {}
- void deleteCurrent() { if (currentItem()) delete currentItem(); }
-};
-
void tst_QTreeWidget::removeCurrentItem()
{
- AnotherTreeWidget widget;
- QObject::connect(widget.selectionModel(),
- SIGNAL(currentChanged(QModelIndex,QModelIndex)),
- &widget, SLOT(clear()));
+ PublicTreeWidget widget;
+ connect(widget.selectionModel(),
+ &QItemSelectionModel::currentChanged,
+ &widget, &PublicTreeWidget::clear);
QTreeWidgetItem *item = new QTreeWidgetItem(&widget);
widget.setCurrentItem(item);
widget.deleteCurrent();
@@ -2930,9 +2890,9 @@ void tst_QTreeWidget::removeCurrentItem()
void tst_QTreeWidget::removeCurrentItem_task186451()
{
- AnotherTreeWidget widget;
- QTreeWidgetItem *item = new QTreeWidgetItem(&widget, QStringList() << "1");
- QTreeWidgetItem *item2 = new QTreeWidgetItem(&widget, QStringList() << "2");
+ PublicTreeWidget widget;
+ QTreeWidgetItem *item = new QTreeWidgetItem(&widget, {"1"});
+ QTreeWidgetItem *item2 = new QTreeWidgetItem(&widget, {"2"});
widget.setCurrentItem(item);
widget.deleteCurrent();
@@ -2940,19 +2900,6 @@ void tst_QTreeWidget::removeCurrentItem_task186451()
QCOMPARE(item2, widget.currentItem());
}
-
-class TreeWidget : QTreeWidget {
-
-public:
- QModelIndex indexFromItem(QTreeWidgetItem *item, int column = 0) const {
- return QTreeWidget::indexFromItem(item, column);
- }
- QTreeWidgetItem *itemFromIndex(const QModelIndex &index) const {
- return QTreeWidget::itemFromIndex(index);
- }
-};
-
-
void tst_QTreeWidget::randomExpand()
{
QTreeWidget tree;
@@ -2970,9 +2917,8 @@ void tst_QTreeWidget::randomExpand()
\- item4
*/
- QTreeWidgetItem *newItem1 = 0;
for (int i = 0; i < 100; i++) {
- newItem1 = new QTreeWidgetItem(&tree, item1);
+ auto newItem1 = new QTreeWidgetItem(&tree, item1);
newItem1->setExpanded(true);
QCOMPARE(newItem1->isExpanded(), true);
@@ -2982,35 +2928,34 @@ void tst_QTreeWidget::randomExpand()
QCOMPARE(newItem1->isExpanded(), true);
}
-
}
void tst_QTreeWidget::crashTest()
{
- QTreeWidget *tree = new QTreeWidget();
- tree->setColumnCount(1);
- tree->show();
+ QTreeWidget tree;
+ tree.setColumnCount(1);
+ tree.show();
- QTreeWidgetItem *item1 = new QTreeWidgetItem(tree);
+ QTreeWidgetItem *item1 = new QTreeWidgetItem(&tree);
item1->setText(0, "item1");
item1->setExpanded(true);
QTreeWidgetItem *item2 = new QTreeWidgetItem(item1);
item2->setText(0, "item2");
- QTreeWidgetItem *item3 = new QTreeWidgetItem(tree, item1);
+ QTreeWidgetItem *item3 = new QTreeWidgetItem(&tree, item1);
item3->setText(0, "item3");
item3->setExpanded(true);
QTreeWidgetItem *item4 = new QTreeWidgetItem(item3);
item4->setText(0, "item4");
- QTreeWidgetItem *item5 = new QTreeWidgetItem(tree, item3);
+ QTreeWidgetItem *item5 = new QTreeWidgetItem(&tree, item3);
item5->setText(0, "item5");
item5->setExpanded(true);
QTreeWidgetItem *item6 = new QTreeWidgetItem(item5);
item6->setText(0, "item6");
for (int i = 0; i < 1000; i++) {
- QTreeWidgetItem *newItem1 = new QTreeWidgetItem(tree, item1);
+ QTreeWidgetItem *newItem1 = new QTreeWidgetItem(&tree, item1);
newItem1->setText(0, "newItem");
QTreeWidgetItem *newItem2 = new QTreeWidgetItem(newItem1);
newItem2->setText(0, "subItem1");
@@ -3019,23 +2964,23 @@ void tst_QTreeWidget::crashTest()
delete item3;
item3 = newItem1;
}
- QApplication::instance()->processEvents();
-
- delete tree;
+ QCoreApplication::processEvents();
}
class CrashWidget : public QTreeWidget
{
public:
- CrashWidget(QWidget *parent = 0) : QTreeWidget(parent), i(0) {
+ CrashWidget(QWidget *parent = nullptr) : QTreeWidget(parent)
+ {
setSortingEnabled(true);
timerId = startTimer(10);
}
- int i;
+ int i = 0;
protected:
- void timerEvent(QTimerEvent * event) {
+ void timerEvent(QTimerEvent * event) override
+ {
if (event->timerId() == timerId) {
- QTreeWidgetItem *newItem = new QTreeWidgetItem((QStringList() << QString::number(i++)));
+ auto newItem = new QTreeWidgetItem({QString::number(i++)});
m_list.append(newItem);
insertTopLevelItem(0, newItem);
while (m_list.count() > 10)
@@ -3045,7 +2990,7 @@ protected:
}
private:
int timerId;
- QList<QTreeWidgetItem*> m_list;
+ QVector<QTreeWidgetItem*> m_list;
};
void tst_QTreeWidget::sortAndSelect()
@@ -3068,12 +3013,13 @@ void tst_QTreeWidget::defaultRowSizes()
const QScopedPointer<QTreeWidget> tw(new QTreeWidget);
tw->setIconSize(QSize(50, 50));
tw->setColumnCount(6);
- for (int i=0; i<10; ++i) {
+ for (int i = 0; i < 10; ++i) {
auto it = new QTreeWidgetItem(tw.data());
- for (int j=0; j<tw->columnCount() - 1; ++j) {
+ for (int j = 0; j < tw->columnCount() - 1; ++j)
it->setText(j, "This is a test");
- }
- QPixmap icon = tw->style()->standardPixmap((QStyle::StandardPixmap)(i + QStyle::SP_TitleBarMenuButton));
+ auto sp = static_cast<QStyle::StandardPixmap>(i + QStyle::SP_TitleBarMenuButton);
+ QPixmap icon = tw->style()->standardPixmap(sp);
+
if (icon.isNull())
QSKIP("No pixmap found on current style, skipping this test.");
it->setIcon(tw->columnCount() - 1,
@@ -3089,8 +3035,8 @@ void tst_QTreeWidget::defaultRowSizes()
void tst_QTreeWidget::task191552_rtl()
{
- Qt::LayoutDirection oldDir = qApp->layoutDirection();
- qApp->setLayoutDirection(Qt::RightToLeft);
+ Qt::LayoutDirection oldDir = QGuiApplication::layoutDirection();
+ QGuiApplication::setLayoutDirection(Qt::RightToLeft);
QTreeWidget tw;
tw.setColumnCount(1);
@@ -3111,7 +3057,7 @@ void tst_QTreeWidget::task191552_rtl()
QTest::mouseClick(tw.viewport(), Qt::LeftButton, Qt::NoModifier, checkRect.center());
QCOMPARE(item->checkState(0), Qt::Unchecked);
- qApp->setLayoutDirection(oldDir);
+ QGuiApplication::setLayoutDirection(oldDir);
}
void tst_QTreeWidget::task203673_selection()
@@ -3210,7 +3156,7 @@ void tst_QTreeWidget::task253109_itemHeight()
QTreeWidgetItem item(&treeWidget);
class MyWidget : public QWidget
{
- virtual QSize sizeHint() const { return QSize(200,100); }
+ QSize sizeHint() const override { return QSize(200, 100); }
} w;
treeWidget.setItemWidget(&item, 0, &w);
@@ -3230,24 +3176,23 @@ void tst_QTreeWidget::task206367_duplication()
treeWidget.setHeaderHidden(true);
treeWidget.setSortingEnabled(true);
- QTreeWidgetItem* rootItem = new QTreeWidgetItem( &treeWidget, QStringList("root") );
+ QTreeWidgetItem* rootItem = new QTreeWidgetItem(&treeWidget, QStringList("root"));
for (int nFile = 0; nFile < 2; nFile++ ) {
- QTreeWidgetItem* itemFile = new QTreeWidgetItem(rootItem, QStringList(QString::number(nFile)));
+ QTreeWidgetItem* itemFile = new QTreeWidgetItem(rootItem, {QString::number(nFile)});
for (int nRecord = 0; nRecord < 2; nRecord++)
- new QTreeWidgetItem(itemFile , QStringList(QString::number(nRecord)));
+ new QTreeWidgetItem(itemFile, {QString::number(nRecord)});
itemFile->setExpanded(true);
}
rootItem->setExpanded(true);
//there should be enough room for 2x2 items. If there is a scrollbar, it means the items are duplicated
QTRY_VERIFY(!treeWidget.verticalScrollBar()->isVisible());
-
}
void tst_QTreeWidget::itemSelectionChanged()
{
QVERIFY(testWidget);
- if(testWidget->topLevelItem(0))
+ if (testWidget->topLevelItem(0))
QVERIFY(testWidget->topLevelItem(0)->isSelected());
}
@@ -3255,14 +3200,18 @@ void tst_QTreeWidget::selectionOrder()
{
testWidget->setColumnCount(1);
QList<QTreeWidgetItem *> items;
- for (int i = 0; i < 10; ++i)
- items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QLatin1String("item: ") + QString::number(i))));
+ for (int i = 0; i < 10; ++i) {
+ items.append(new QTreeWidgetItem(static_cast<QTreeWidget *>(nullptr),
+ {QStringLiteral("item: %1").arg(i)}));
+ }
testWidget->insertTopLevelItems(0, items);
- QModelIndex idx = testWidget->indexFromItem(items[0]);
- connect(testWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged()));
+ QModelIndex idx = testWidget->indexFromItem(items.at(0));
+ connect(testWidget, &QTreeWidget::itemSelectionChanged,
+ this, &tst_QTreeWidget::itemSelectionChanged);
testWidget->selectionModel()->select(idx, QItemSelectionModel::SelectCurrent);
- disconnect(testWidget, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged()));
+ disconnect(testWidget, &QTreeWidget::itemSelectionChanged,
+ this, &tst_QTreeWidget::itemSelectionChanged);
}
void tst_QTreeWidget::setSelectionModel()
@@ -3271,7 +3220,7 @@ void tst_QTreeWidget::setSelectionModel()
for(int i = 0; i < 3; ++i)
new QTreeWidgetItem(&tree, QStringList(QString::number(i)));
QItemSelectionModel selection(tree.model());
- selection.select(tree.model()->index(1,0), QItemSelectionModel::Select);
+ selection.select(tree.model()->index(1, 0), QItemSelectionModel::Select);
tree.setSelectionModel(&selection);
QCOMPARE(tree.topLevelItem(1)->isSelected(), true);
}
@@ -3301,9 +3250,9 @@ void tst_QTreeWidget::task217309()
void tst_QTreeWidget::nonEditableTristate()
{
// A tree with checkable items, the parent is tristate
- QTreeWidget *tree = new QTreeWidget;
- QTreeWidgetItem *item = new QTreeWidgetItem();
- tree->insertTopLevelItem(0, item);
+ QTreeWidget tree;
+ QTreeWidgetItem *item = new QTreeWidgetItem;
+ tree.insertTopLevelItem(0, item);
item->setFlags(item->flags() | Qt::ItemIsAutoTristate);
item->setCheckState(0, Qt::Unchecked);
QTreeWidgetItem *subitem1 = new QTreeWidgetItem(item);
@@ -3311,53 +3260,46 @@ void tst_QTreeWidget::nonEditableTristate()
QTreeWidgetItem *subitem2 = new QTreeWidgetItem(item);
subitem2->setCheckState(0, Qt::Unchecked);
QCOMPARE(int(item->checkState(0)), int(Qt::Unchecked));
- tree->show();
+ tree.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&tree));
// Test clicking on the parent item, it should become Checked (not PartiallyChecked)
QStyleOptionViewItem option;
- option.rect = tree->visualRect(tree->model()->index(0, 0));
+ option.rect = tree.visualRect(tree.model()->index(0, 0));
option.state |= QStyle::State_Enabled;
option.features |= QStyleOptionViewItem::HasCheckIndicator | QStyleOptionViewItem::HasDisplay;
option.checkState = item->checkState(0);
- const int checkMargin = qApp->style()->pixelMetric(QStyle::PM_FocusFrameHMargin, 0, 0) + 1;
- QPoint pos = qApp->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &option, 0).center() + QPoint(checkMargin, 0);
- QTest::mouseClick(tree->viewport(), Qt::LeftButton, Qt::NoModifier, pos);
- QCOMPARE(int(item->checkState(0)), int(Qt::Checked));
+ auto appStyle = QApplication::style();
+ const int checkMargin = appStyle->pixelMetric(
+ QStyle::PM_FocusFrameHMargin, nullptr, nullptr) + 1;
+ QPoint pos = appStyle->subElementRect(
+ QStyle::SE_ItemViewItemCheckIndicator, &option, nullptr).center();
+ pos.rx() += checkMargin;
+ QTest::mouseClick(tree.viewport(), Qt::LeftButton, Qt::NoModifier, pos);
+ QCOMPARE(item->checkState(0), Qt::Checked);
// Click again, it should become Unchecked.
- QTest::mouseClick(tree->viewport(), Qt::LeftButton, Qt::NoModifier, pos);
- QCOMPARE(int(item->checkState(0)), int(Qt::Unchecked));
-
- delete tree;
+ QTest::mouseClick(tree.viewport(), Qt::LeftButton, Qt::NoModifier, pos);
+ QCOMPARE(item->checkState(0), Qt::Unchecked);
}
-class TreeWidgetItem : public QTreeWidgetItem
-{
-
-public:
- void _emitDataChanged() { emitDataChanged(); }
-
-};
-
void tst_QTreeWidget::emitDataChanged()
{
-
- QTreeWidget *tree = new QTreeWidget;
- QSignalSpy spy(tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)));
- TreeWidgetItem *item = new TreeWidgetItem();
- tree->insertTopLevelItem(0, item);
- item->_emitDataChanged();
+ QTreeWidget tree;
+ QSignalSpy spy(&tree, &QTreeWidget::itemChanged);
+ auto item = new PublicTreeItem;
+ tree.insertTopLevelItem(0, item);
+ item->emitDataChanged();
QCOMPARE(spy.count(), 1);
-
}
void tst_QTreeWidget::setCurrentItemExpandsParent()
{
QTreeWidget w;
w.setColumnCount(1);
- QTreeWidgetItem *i1 = new QTreeWidgetItem(&w, QStringList() << "parent");
- QTreeWidgetItem *i2 = new QTreeWidgetItem(i1, QStringList() << "child");
+ QTreeWidgetItem *i1 = new QTreeWidgetItem(&w, {"parent"});
+ QTreeWidgetItem *i2 = new QTreeWidgetItem(i1, {"child"});
QVERIFY(!i2->isExpanded());
QVERIFY(!w.currentItem());
w.setCurrentItem(i2);
@@ -3373,13 +3315,13 @@ void tst_QTreeWidget::task239150_editorWidth()
QStyleOptionFrame opt;
opt.init(&tree);
const int minWidth = tree.style()->sizeFromContents(QStyle::CT_LineEdit, &opt, QSize(0, 0).
- expandedTo(QApplication::globalStrut()), 0).width();
+ expandedTo(QApplication::globalStrut()), nullptr).width();
{
QTreeWidgetItem item;
item.setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
tree.addTopLevelItem(&item);
- QVERIFY(tree.itemWidget(&item, 0) == 0);
+ QVERIFY(tree.itemWidget(&item, 0) == nullptr);
tree.editItem(&item);
QVERIFY(tree.itemWidget(&item, 0));
QVERIFY(tree.itemWidget(&item, 0)->width() >= minWidth);
@@ -3391,7 +3333,7 @@ void tst_QTreeWidget::task239150_editorWidth()
item.setText(0, "foooooooooooooooooooooooo");
item.setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
tree.addTopLevelItem(&item);
- QVERIFY(tree.itemWidget(&item, 0) == 0);
+ QVERIFY(tree.itemWidget(&item, 0) == nullptr);
tree.editItem(&item);
QVERIFY(tree.itemWidget(&item, 0));
QVERIFY(tree.itemWidget(&item, 0)->width() >= minWidth + tree.fontMetrics().horizontalAdvance(item.text(0)));
@@ -3408,23 +3350,21 @@ void tst_QTreeWidget::setTextUpdate()
class MyItemDelegate : public QStyledItemDelegate
{
public:
- MyItemDelegate() : numPaints(0) { }
- void paint(QPainter *painter,
- const QStyleOptionViewItem &option, const QModelIndex &index) const
+ using QStyledItemDelegate::QStyledItemDelegate;
+ void paint(QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override
{
numPaints++;
QStyledItemDelegate::paint(painter, option, index);
}
- mutable int numPaints;
+ mutable int numPaints = 0;
} delegate;
treeWidget.setItemDelegate(&delegate);
treeWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&treeWidget));
- QStringList strList;
- strList << "variable1" << "0";
- QTreeWidgetItem *item = new QTreeWidgetItem(strList);
+ QTreeWidgetItem *item = new QTreeWidgetItem({ "variable1", "0" });
treeWidget.insertTopLevelItem(0, item);
QTRY_VERIFY(delegate.numPaints > 0);
delegate.numPaints = 0;
@@ -3435,7 +3375,7 @@ void tst_QTreeWidget::setTextUpdate()
void tst_QTreeWidget::taskQTBUG2844_visualItemRect()
{
- CustomTreeWidget tree;
+ PublicTreeWidget tree;
tree.resize(150, 100);
tree.setColumnCount(3);
QTreeWidgetItem item(&tree);
@@ -3457,15 +3397,17 @@ void tst_QTreeWidget::setChildIndicatorPolicy()
class MyItemDelegate : public QStyledItemDelegate
{
public:
- MyItemDelegate() : numPaints(0), expectChildren(false) { }
- void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+ using QStyledItemDelegate::QStyledItemDelegate;
+ void paint(QPainter *painter,
+ const QStyleOptionViewItem &option,
+ const QModelIndex &index) const override
{
numPaints++;
QCOMPARE(!(option.state & QStyle::State_Children), !expectChildren);
QStyledItemDelegate::paint(painter, option, index);
}
- mutable int numPaints;
- bool expectChildren;
+ mutable int numPaints = 0;
+ bool expectChildren = false;
} delegate;
treeWidget.setItemDelegate(&delegate);
@@ -3503,19 +3445,15 @@ void tst_QTreeWidget::setChildIndicatorPolicy()
// The test passes simply if it doesn't crash.
void tst_QTreeWidget::taskQTBUG_34717_collapseAtBottom()
{
- struct PublicTreeWidget: public QTreeWidget
- {
- inline int sizeHintForColumn(int column) const { return QTreeWidget::sizeHintForColumn(column); }
- };
PublicTreeWidget treeWidget;
treeWidget.header()->setSectionResizeMode(QHeaderView::ResizeToContents);
treeWidget.setColumnCount(2);
- QTreeWidgetItem *mainItem = new QTreeWidgetItem(&treeWidget, QStringList() << "Root");
+ QTreeWidgetItem *mainItem = new QTreeWidgetItem(&treeWidget, { "Root" });
for (int i = 0; i < 200; ++i) {
- QTreeWidgetItem *item = new QTreeWidgetItem(mainItem, QStringList(QString("Item")));
- new QTreeWidgetItem(item, QStringList() << "Child" << "1");
- new QTreeWidgetItem(item, QStringList() << "Child" << "2");
- new QTreeWidgetItem(item, QStringList() << "Child" << "3");
+ QTreeWidgetItem *item = new QTreeWidgetItem(mainItem, { "Item" });
+ new QTreeWidgetItem(item, { "Child", "1" });
+ new QTreeWidgetItem(item, { "Child", "2" });
+ new QTreeWidgetItem(item, { "Child", "3" });
}
treeWidget.show();
treeWidget.expandAll();
@@ -3545,11 +3483,8 @@ void tst_QTreeWidget::task20345_sortChildren()
tw.setSortingEnabled(true);
tw.show();
- QTreeWidgetItem *rootItem = 0;
- QTreeWidgetItem *childItem = 0;
-
- rootItem = new QTreeWidgetItem(&tw, QStringList("a"));
- childItem = new QTreeWidgetItem(rootItem);
+ auto rootItem = new QTreeWidgetItem(&tw, QStringList("a"));
+ auto childItem = new QTreeWidgetItem(rootItem);
childItem->setText(1, "3");
childItem = new QTreeWidgetItem(rootItem);
childItem->setText(1, "1");
@@ -3558,10 +3493,10 @@ void tst_QTreeWidget::task20345_sortChildren()
tw.setCurrentItem(tw.topLevelItem(0));
- QTreeWidgetItem * curItem = tw.currentItem();
+ QTreeWidgetItem *curItem = tw.currentItem();
int childCount = curItem->childCount() + 1;
- QTreeWidgetItem * newItem = new QTreeWidgetItem(curItem);
+ QTreeWidgetItem *newItem = new QTreeWidgetItem(curItem);
newItem->setText(1, QString::number(childCount));
rootItem->sortChildren(1, Qt::AscendingOrder);
QVERIFY(1);
@@ -3569,7 +3504,7 @@ void tst_QTreeWidget::task20345_sortChildren()
void tst_QTreeWidget::getMimeDataWithInvalidItem()
{
- CustomTreeWidget w;
+ PublicTreeWidget w;
QTest::ignoreMessage(QtWarningMsg, "QTreeWidget::mimeData: Null-item passed");
QMimeData *md = w.mimeData(QList<QTreeWidgetItem*>() << nullptr);
QVERIFY(!md);
diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
index 76ca148d3f..68d149fc6e 100644
--- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
@@ -27,20 +27,19 @@
****************************************************************************/
-#include <QtTest/QtTest>
+#include <QTreeWidget>
+#include <QTreeWidgetItemIterator>
+#include <QTest>
-#include <qtreewidget.h>
-#include <qtreewidgetitemiterator.h>
-#include <qapplication.h>
-#include <qeventloop.h>
-#include <qdebug.h>
+Q_DECLARE_METATYPE(QTreeWidgetItemIterator::IteratorFlag)
+Q_DECLARE_METATYPE(QTreeWidgetItemIterator::IteratorFlags)
class tst_QTreeWidgetItemIterator : public QObject
{
Q_OBJECT
public:
- tst_QTreeWidgetItemIterator();
+ using QObject::QObject;
private slots:
void initTestCase();
@@ -65,13 +64,9 @@ private slots:
void initializeIterator();
void sortingEnabled();
private:
- QTreeWidget *testWidget;
+ QTreeWidget *testWidget = nullptr;
};
-tst_QTreeWidgetItemIterator::tst_QTreeWidgetItemIterator(): testWidget(0)
-{
-}
-
void tst_QTreeWidgetItemIterator::initTestCase()
{
testWidget = new QTreeWidget();
@@ -90,7 +85,7 @@ void tst_QTreeWidgetItemIterator::initTestCase()
* |Qt::ItemIsDropEnabled
*
*/
- for (int i=0; i <= 16; ++i) {
+ for (int i = 0; i <= 16; ++i) {
QTreeWidgetItem *top = new QTreeWidgetItem(testWidget);
const QString topS = QLatin1String("top") + QString::number(i);
top->setText(0, topS);
@@ -111,9 +106,7 @@ void tst_QTreeWidgetItemIterator::initTestCase()
case 9: top->setFlags(Qt::ItemIsEnabled);break;
case 10: top->setFlags(Qt::ItemIsEnabled);break;
- case 11:
- top->setFlags(0);
- break;
+ case 11: top->setFlags({});break;
case 12: top->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);break;
case 13: top->setFlags(Qt::ItemIsEnabled);break;
@@ -142,7 +135,7 @@ void tst_QTreeWidgetItemIterator::initTestCase()
case 9: child->setFlags(Qt::ItemIsEnabled);break;
case 10: child->setFlags(Qt::ItemIsEnabled);break;
- case 11: child->setFlags(0);break;
+ case 11: child->setFlags({});break;
case 12: child->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable);break;
case 13: child->setFlags(Qt::ItemIsEnabled);break;
@@ -188,10 +181,10 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
NotEditable = 0x00020000
*/
QTest::addColumn<int>("start");
- QTest::addColumn<int>("iteratorflags");
+ QTest::addColumn<QTreeWidgetItemIterator::IteratorFlags>("iteratorflags");
QTest::addColumn<QStringList>("matches");
- QTest::newRow("Match all") << 0 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Match all") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::All)
<< (QStringList()
<< "top0" << "top0,child0" << "top0,child1" << "top0,child2" << "top0,child3"
<< "top0,child4" << "top0,child5" << "top0,child6" << "top0,child7"
@@ -279,7 +272,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16,child12" << "top16,child13" << "top16,child14" << "top16,child15"
<< "top16,child16");
- QTest::newRow("Match hidden") << 0 << (int)QTreeWidgetItemIterator::Hidden
+ QTest::newRow("Match hidden") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::Hidden)
<< (QStringList()
<< "top0" << "top0,child0" // fails due to hidden row
<< "top1,child0"
@@ -299,7 +292,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top15,child0"
<< "top16,child0");
- QTest::newRow("Match not hidden") << 0 << (int)QTreeWidgetItemIterator::NotHidden
+ QTest::newRow("Match not hidden") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::NotHidden)
<< (QStringList()
<< "top0,child1" << "top0,child2" << "top0,child3"
<< "top0,child4" << "top0,child5" << "top0,child6" << "top0,child7"
@@ -387,7 +380,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16,child12" << "top16,child13" << "top16,child14" << "top16,child15"
<< "top16,child16");
- QTest::newRow("Match selected") << 0 << (int)QTreeWidgetItemIterator::Selected
+ QTest::newRow("Match selected") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::Selected)
<< (QStringList()
<< "top0,child2"
<< "top1,child2"
@@ -407,7 +400,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top15,child2"
<< "top16,child2");
- QTest::newRow("Match selectable") << 0 << (int)QTreeWidgetItemIterator::Selectable
+ QTest::newRow("Match selectable") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::Selectable)
<< (QStringList()
<< "top0" << "top0,child0" << "top0,child1" << "top0,child2" << "top0,child3"
<< "top0,child4"
@@ -479,7 +472,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16,child16");
- QTest::newRow("Match DragEnabled") << 0 << (int)QTreeWidgetItemIterator::DragEnabled
+ QTest::newRow("Match DragEnabled") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::DragEnabled)
<< (QStringList()
<< "top0" << "top0,child0" << "top0,child1" << "top0,child2" << "top0,child3"
<< "top0,child6"
@@ -550,7 +543,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16,child14" << "top16,child15"
<< "top16,child16");
- QTest::newRow("Match DragDisabled") << 0 << (int)QTreeWidgetItemIterator::DragDisabled
+ QTest::newRow("Match DragDisabled") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::DragDisabled)
<< (QStringList()
/* top0 */
@@ -623,7 +616,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16,child13" );
- QTest::newRow("Match DropEnabled") << 0 << (int)QTreeWidgetItemIterator::DropEnabled
+ QTest::newRow("Match DropEnabled") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::DropEnabled)
<< (QStringList()
<< "top0" << "top0,child0" << "top0,child1" << "top0,child2" << "top0,child3"
<< "top0,child8"
@@ -694,12 +687,12 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16,child14" << "top16,child15"
<< "top16,child16");
- QTest::newRow("Match HasChildren") << 0 << (int)QTreeWidgetItemIterator::HasChildren
+ QTest::newRow("Match HasChildren") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::HasChildren)
<< (QStringList() << "top0" << "top1" << "top2" << "top3" << "top4" << "top5"
<< "top6" << "top7" << "top8" << "top9" << "top10" << "top11" << "top12"
<< "top13" << "top14" << "top15" << "top16");
- QTest::newRow("Match Checked") << 0 << (int)QTreeWidgetItemIterator::Checked
+ QTest::newRow("Match Checked") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::Checked)
<< (QStringList()
<< "top0,child14" << "top0,child16"
<< "top1,child14" << "top1,child16"
@@ -721,7 +714,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top16"
<< "top16,child14" << "top16,child16");
- QTest::newRow("Match NotChecked") << 0 << (int)QTreeWidgetItemIterator::NotChecked
+ QTest::newRow("Match NotChecked") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::NotChecked)
<< (QStringList()
<< "top0" << "top0,child0" << "top0,child1" << "top0,child2" << "top0,child3"
<< "top0,child4" << "top0,child5" << "top0,child6" << "top0,child7"
@@ -810,7 +803,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
- QTest::newRow("Match Disabled") << 0 << (int)QTreeWidgetItemIterator::Disabled
+ QTest::newRow("Match Disabled") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::Disabled)
<< (QStringList()
<< "top0,child11"
<< "top1,child11"
@@ -848,7 +841,7 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top15,child11"
<< "top16,child11");
- QTest::newRow("Match Editable") << 0 << (int)QTreeWidgetItemIterator::Editable
+ QTest::newRow("Match Editable") << 0 << QTreeWidgetItemIterator::IteratorFlags(QTreeWidgetItemIterator::Editable)
<< (QStringList()
<< "top0,child12"
<< "top1,child12"
@@ -869,34 +862,34 @@ void tst_QTreeWidgetItemIterator::iteratorflags_data()
<< "top15,child12"
<< "top16,child12");
- QTest::newRow("Match mutually exclusive Hidden|NotHidden") << 0 << (int)(QTreeWidgetItemIterator::Hidden|QTreeWidgetItemIterator::NotHidden)
+ QTest::newRow("Match mutually exclusive Hidden|NotHidden") << 0 << (QTreeWidgetItemIterator::Hidden|QTreeWidgetItemIterator::NotHidden)
<< QStringList();
- QTest::newRow("Match mutually exclusive Selected|Unselected") << 0 << (int)(QTreeWidgetItemIterator::Selected|QTreeWidgetItemIterator::Unselected)
+ QTest::newRow("Match mutually exclusive Selected|Unselected") << 0 << (QTreeWidgetItemIterator::Selected|QTreeWidgetItemIterator::Unselected)
<< QStringList();
- QTest::newRow("Match mutually exclusive Selectable|NotSelectable") << 0 << (int)(QTreeWidgetItemIterator::Selectable|QTreeWidgetItemIterator::NotSelectable)
+ QTest::newRow("Match mutually exclusive Selectable|NotSelectable") << 0 << (QTreeWidgetItemIterator::Selectable|QTreeWidgetItemIterator::NotSelectable)
<< QStringList();
- QTest::newRow("Match mutually exclusive DragEnabled|DragDisabled") << 0 << (int)(QTreeWidgetItemIterator::DragEnabled|QTreeWidgetItemIterator::DragDisabled)
+ QTest::newRow("Match mutually exclusive DragEnabled|DragDisabled") << 0 << (QTreeWidgetItemIterator::DragEnabled|QTreeWidgetItemIterator::DragDisabled)
<< QStringList();
- QTest::newRow("Match mutually exclusive DropEnabled|DropDisabled") << 0 << (int)(QTreeWidgetItemIterator::DropEnabled|QTreeWidgetItemIterator::DropDisabled)
+ QTest::newRow("Match mutually exclusive DropEnabled|DropDisabled") << 0 << (QTreeWidgetItemIterator::DropEnabled|QTreeWidgetItemIterator::DropDisabled)
<< QStringList();
- QTest::newRow("Match mutually exclusive HasChildren|NoChildren") << 0 << (int)(QTreeWidgetItemIterator::HasChildren|QTreeWidgetItemIterator::NoChildren)
+ QTest::newRow("Match mutually exclusive HasChildren|NoChildren") << 0 << (QTreeWidgetItemIterator::HasChildren|QTreeWidgetItemIterator::NoChildren)
<< QStringList();
- QTest::newRow("Match mutually exclusive Checked|NotChecked") << 0 << (int)(QTreeWidgetItemIterator::Checked|QTreeWidgetItemIterator::NotChecked)
+ QTest::newRow("Match mutually exclusive Checked|NotChecked") << 0 << (QTreeWidgetItemIterator::Checked|QTreeWidgetItemIterator::NotChecked)
<< QStringList();
- QTest::newRow("Match mutually exclusive Disabled|Enabled") << 0 << (int)(QTreeWidgetItemIterator::Disabled|QTreeWidgetItemIterator::Enabled)
+ QTest::newRow("Match mutually exclusive Disabled|Enabled") << 0 << (QTreeWidgetItemIterator::Disabled|QTreeWidgetItemIterator::Enabled)
<< QStringList();
- QTest::newRow("Match mutually exclusive Editable|NotEditable") << 0 << (int)(QTreeWidgetItemIterator::Editable|QTreeWidgetItemIterator::NotEditable)
+ QTest::newRow("Match mutually exclusive Editable|NotEditable") << 0 << (QTreeWidgetItemIterator::Editable|QTreeWidgetItemIterator::NotEditable)
<< QStringList();
}
void tst_QTreeWidgetItemIterator::iteratorflags()
{
QFETCH(int, start);
- QFETCH(int, iteratorflags);
+ QFETCH(QTreeWidgetItemIterator::IteratorFlags, iteratorflags);
QFETCH(QStringList, matches);
- QTreeWidgetItemIterator it(testWidget, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
- it+=start;
+ QTreeWidgetItemIterator it(testWidget, iteratorflags);
+ it += start;
int iMatch = 0;
while (*it && iMatch < matches.count()) {
QTreeWidgetItem *item = *it;
@@ -953,26 +946,26 @@ void tst_QTreeWidgetItemIterator::plus_eq_data()
{
QTest::addColumn<int>("start");
QTest::addColumn<int>("addition");
- QTest::addColumn<int>("iteratorflags");
+ QTest::addColumn<QTreeWidgetItemIterator::IteratorFlag>("iteratorflags");
QTest::addColumn<QString>("expecteditem");
- QTest::newRow("+=0") << 0 << 0 << (int)QTreeWidgetItemIterator::All << QString("top0");
- QTest::newRow("+=1") << 0 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
- QTest::newRow("+=2") << 0 << 2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
- QTest::newRow("+=(-1)") << 1 << -1 << (int)QTreeWidgetItemIterator::All << QString("top0");
- QTest::newRow("+=(-2)") << 3 << -2 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
+ QTest::newRow("+=0") << 0 << 0 << QTreeWidgetItemIterator::All << QString("top0");
+ QTest::newRow("+=1") << 0 << 1 << QTreeWidgetItemIterator::All << QString("top0,child0");
+ QTest::newRow("+=2") << 0 << 2 << QTreeWidgetItemIterator::All << QString("top0,child1");
+ QTest::newRow("+=(-1)") << 1 << -1 << QTreeWidgetItemIterator::All << QString("top0");
+ QTest::newRow("+=(-2)") << 3 << -2 << QTreeWidgetItemIterator::All << QString("top0,child0");
}
void tst_QTreeWidgetItemIterator::plus_eq()
{
QFETCH(int, start);
QFETCH(int, addition);
- QFETCH(int, iteratorflags);
+ QFETCH(QTreeWidgetItemIterator::IteratorFlag, iteratorflags);
QFETCH(QString, expecteditem);
- QTreeWidgetItemIterator it(testWidget, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
- it+=start;
- it+=addition;
+ QTreeWidgetItemIterator it(testWidget, iteratorflags);
+ it += start;
+ it += addition;
QTreeWidgetItem *item = *it;
QVERIFY(item);
@@ -984,28 +977,28 @@ void tst_QTreeWidgetItemIterator::minus_eq_data()
{
QTest::addColumn<int>("start");
QTest::addColumn<int>("subtraction");
- QTest::addColumn<int>("iteratorflags");
+ QTest::addColumn<QTreeWidgetItemIterator::IteratorFlag>("iteratorflags");
QTest::addColumn<QString>("expecteditem");
- QTest::newRow("0-=0") << 0 << 0 << (int)QTreeWidgetItemIterator::All << QString("top0");
- QTest::newRow("2-=1") << 2 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
- QTest::newRow("4-=2") << 4 << 2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
- QTest::newRow("0-=(-1)") << 0 << -1 << (int)QTreeWidgetItemIterator::All << QString("top0,child0");
- QTest::newRow("0-=(-2)") << 0 << -2 << (int)QTreeWidgetItemIterator::All << QString("top0,child1");
- QTest::newRow("18-=1") << 18 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0,child16");
- QTest::newRow("1-=1") << 1 << 1 << (int)QTreeWidgetItemIterator::All << QString("top0");
+ QTest::newRow("0-=0") << 0 << 0 << QTreeWidgetItemIterator::All << QString("top0");
+ QTest::newRow("2-=1") << 2 << 1 << QTreeWidgetItemIterator::All << QString("top0,child0");
+ QTest::newRow("4-=2") << 4 << 2 << QTreeWidgetItemIterator::All << QString("top0,child1");
+ QTest::newRow("0-=(-1)") << 0 << -1 << QTreeWidgetItemIterator::All << QString("top0,child0");
+ QTest::newRow("0-=(-2)") << 0 << -2 << QTreeWidgetItemIterator::All << QString("top0,child1");
+ QTest::newRow("18-=1") << 18 << 1 << QTreeWidgetItemIterator::All << QString("top0,child16");
+ QTest::newRow("1-=1") << 1 << 1 << QTreeWidgetItemIterator::All << QString("top0");
}
void tst_QTreeWidgetItemIterator::minus_eq()
{
QFETCH(int, start);
QFETCH(int, subtraction);
- QFETCH(int, iteratorflags);
+ QFETCH(QTreeWidgetItemIterator::IteratorFlag, iteratorflags);
QFETCH(QString, expecteditem);
- QTreeWidgetItemIterator it(testWidget, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
- it+=start;
- it-=subtraction;
+ QTreeWidgetItemIterator it(testWidget, iteratorflags);
+ it += start;
+ it -= subtraction;
QTreeWidgetItem *item = *it;
// should be the first one
QVERIFY(item);
@@ -1017,41 +1010,41 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget_data()
QTest::addColumn<int>("topLevelItems");
QTest::addColumn<int>("childItems");
QTest::addColumn<int>("grandChildItems");
- QTest::addColumn<int>("iteratorflags");
+ QTest::addColumn<QTreeWidgetItemIterator::IteratorFlag>("iteratorflags");
QTest::addColumn<int>("removeindex");
QTest::addColumn<int>("expecteditemindex");
QTest::addColumn<QString>("expecteditemvalue");
QTest::addColumn<QString>("expectedUpdatedCurrent");
QTest::addColumn<int>("expecteditemIsNull");
- QTest::newRow("Remove 3, check 1") << 3 << 3 << 0 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove 3, check 1") << 3 << 3 << 0 << QTreeWidgetItemIterator::All
<< 3 << 1 << QString("top0,child0") << QString("top1") << 0;
- QTest::newRow("Remove 1, check 0") << 3 << 3 << 0 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove 1, check 0") << 3 << 3 << 0 << QTreeWidgetItemIterator::All
<< 1 << 0 << QString("top0") << QString("top0,child1") << 0;
- QTest::newRow("Remove 2, check 2") << 3 << 3 << 0 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove 2, check 2") << 3 << 3 << 0 << QTreeWidgetItemIterator::All
<< 2 << 2 << QString("top0,child2") << QString("top0,child2") << 0;
- QTest::newRow("Remove 0, check 0") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove 0, check 0") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 0 << 0 << QString("top1") << QString("top1") << 0;
- QTest::newRow("Remove top1, check top1") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove top1, check top1") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 13 << 13 << QString("top2") << QString("top2") << 0;
- QTest::newRow("Remove top0, check top1") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove top0, check top1") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 0 << 13 << QString("top1") << QString("top1") << 0;
- QTest::newRow("Remove (top0,child1), check (top0,child1)") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove (top0,child1), check (top0,child1)") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 5 << 5 << QString("top0,child2") << QString("top0,child2") << 0;
- QTest::newRow("Remove (t0,c0) check (t0,c0)") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove (t0,c0) check (t0,c0)") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 1 << 1 << QString("top0,child1") << QString("top0,child1") << 0;
- QTest::newRow("Remove (t0,c1) check (t0,c1)") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove (t0,c1) check (t0,c1)") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 5 << 5 << QString("top0,child2") << QString("top0,child2") << 0;
- QTest::newRow("Remove (t0) check (t0,c1)") << 3 << 3 << 0 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove (t0) check (t0,c1)") << 3 << 3 << 0 << QTreeWidgetItemIterator::All
<< 0 << 4 << QString("top1") << QString("top1") << 0;
- QTest::newRow("Remove (t0) check (t0,c0,g1)") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove (t0) check (t0,c0,g1)") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 0 << 3 << QString("top1") << QString("top1") << 0;
- QTest::newRow("Remove (top2), check if top2 is null") << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All
+ QTest::newRow("Remove (top2), check if top2 is null") << 3 << 3 << 3 << QTreeWidgetItemIterator::All
<< 2*13 << 2*13 << QString() << QString() << 1;
QTest::newRow("Remove last item, check if iterator::current returns 0")
- << 3 << 0 << 0 << (int)QTreeWidgetItemIterator::All << 2 << 2 << QString() << QString() << 1;
+ << 3 << 0 << 0 << QTreeWidgetItemIterator::All << 2 << 2 << QString() << QString() << 1;
QTest::newRow("remove 1, iterator points to 3, should move to 1")
- << 3 << 3 << 3 << (int)QTreeWidgetItemIterator::All << 1 << 3 << QString("top0,child1") << QString("top0,child1") << 0;
+ << 3 << 3 << 3 << QTreeWidgetItemIterator::All << 1 << 3 << QString("top0,child1") << QString("top0,child1") << 0;
}
static void populate3Levels(QTreeWidget &tw, int topLevelItems, int childItems, int grandChildItems)
@@ -1077,7 +1070,7 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget()
QFETCH(int, topLevelItems);
QFETCH(int, childItems);
QFETCH(int, grandChildItems);
- QFETCH(int, iteratorflags);
+ QFETCH(QTreeWidgetItemIterator::IteratorFlag, iteratorflags);
QFETCH(int, removeindex);
QFETCH(int, expecteditemindex);
QFETCH(QString, expecteditemvalue);
@@ -1089,12 +1082,11 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget()
tw.setColumnCount(2);
populate3Levels(tw, topLevelItems, childItems, grandChildItems);
- QTreeWidgetItemIterator it(&tw, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
+ QTreeWidgetItemIterator it(&tw, iteratorflags);
it+=expecteditemindex;
- QTreeWidgetItem *item = 0;
QTreeWidgetItemIterator itRemove(&tw, QTreeWidgetItemIterator::IteratorFlags(iteratorflags));
itRemove+=removeindex;
- item = *itRemove;
+ QTreeWidgetItem *item = *itRemove;
QVERIFY(item);
delete item;
item = *it;
@@ -1104,11 +1096,10 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget()
QVERIFY(item);
QCOMPARE(item->text(0), expecteditemvalue);
item = *itRemove;
- if (expectedUpdatedCurrent.isNull()) {
+ if (expectedUpdatedCurrent.isNull())
QVERIFY(!item);
- } else {
+ else
QCOMPARE(item->text(0), expectedUpdatedCurrent);
- }
}
}
@@ -1152,38 +1143,36 @@ void tst_QTreeWidgetItemIterator::updateIteratorAfterDeletedItem_and_ContinueIte
QTreeWidgetItemIterator it(&tw, QTreeWidgetItemIterator::All);
it += iterator_initial_index;
- QTreeWidgetItem *item = 0;
QTreeWidgetItemIterator itRemove(&tw, QTreeWidgetItemIterator::All);
itRemove+=removeindex;
- item = *itRemove;
+ QTreeWidgetItem *item = *itRemove;
QVERIFY(item);
delete item;
it+=iterator_advance_after_removal;
- if (iterator_new_value.isNull()) {
+ if (iterator_new_value.isNull())
QCOMPARE((*it), nullptr);
- } else {
+ else
QCOMPARE((*it)->text(0), iterator_new_value);
- }
}
void tst_QTreeWidgetItemIterator::constructIteratorWithItem_data()
{
QTest::addColumn<int>("indextoitem");
- QTest::addColumn<int>("iteratorflags");
+ QTest::addColumn<QTreeWidgetItemIterator::IteratorFlag>("iteratorflags");
QTest::addColumn<QString>("expecteditem");
- QTest::newRow("index 0") << 0 << 0 << QString("top0");
- QTest::newRow("index 1") << 1 << 0 << QString("top0,child0");
- QTest::newRow("index 2") << 2 << 0 << QString("top0,child1");
- QTest::newRow("index 30") << 30 << 0 << QString("top1,child11");
- QTest::newRow("305 (last item)") << 305 << 0 << QString("top16,child16");
- QTest::newRow("index 0, advance to next matching node") << 0 << (int)QTreeWidgetItemIterator::NotHidden << QString("top0,child1");
+ QTest::newRow("index 0") << 0 << QTreeWidgetItemIterator::All << QString("top0");
+ QTest::newRow("index 1") << 1 << QTreeWidgetItemIterator::All << QString("top0,child0");
+ QTest::newRow("index 2") << 2 << QTreeWidgetItemIterator::All << QString("top0,child1");
+ QTest::newRow("index 30") << 30 << QTreeWidgetItemIterator::All << QString("top1,child11");
+ QTest::newRow("305 (last item)") << 305 << QTreeWidgetItemIterator::All << QString("top16,child16");
+ QTest::newRow("index 0, advance to next matching node") << 0 << QTreeWidgetItemIterator::NotHidden << QString("top0,child1");
}
void tst_QTreeWidgetItemIterator::constructIteratorWithItem()
{
QFETCH(int, indextoitem);
- QFETCH(int, iteratorflags);
+ QFETCH(QTreeWidgetItemIterator::IteratorFlag, iteratorflags);
QFETCH(QString, expecteditem);
QTreeWidgetItemIterator it(testWidget);
diff --git a/tests/auto/widgets/kernel/kernel.pro b/tests/auto/widgets/kernel/kernel.pro
index 73fd934502..af85a2bd13 100644
--- a/tests/auto/widgets/kernel/kernel.pro
+++ b/tests/auto/widgets/kernel/kernel.pro
@@ -22,5 +22,3 @@ SUBDIRS=\
darwin:SUBDIRS -= \ # Uses native recognizers
qgesturerecognizer \
-
-SUBDIRS -= qsound
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 3d68e42baf..0d62c2cd4b 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -70,7 +70,7 @@ private slots:
void shortcutFromKeyEvent(); // QTBUG-48325
private:
- int m_lastEventType;
+ QEvent::Type m_lastEventType;
const int m_keyboardScheme;
QAction *m_lastAction;
};
@@ -82,7 +82,7 @@ tst_QAction::tst_QAction()
void tst_QAction::init()
{
- m_lastEventType = 0;
+ m_lastEventType = QEvent::None;
m_lastAction = nullptr;
}
@@ -94,23 +94,23 @@ void tst_QAction::cleanup()
// Testing get/set functions
void tst_QAction::getSetCheck()
{
- QAction obj1(0);
+ QAction obj1(nullptr);
// QActionGroup * QAction::actionGroup()
// void QAction::setActionGroup(QActionGroup *)
- QActionGroup *var1 = new QActionGroup(0);
+ QActionGroup *var1 = new QActionGroup(nullptr);
obj1.setActionGroup(var1);
QCOMPARE(var1, obj1.actionGroup());
- obj1.setActionGroup((QActionGroup *)0);
- QCOMPARE((QActionGroup *)0, obj1.actionGroup());
+ obj1.setActionGroup(nullptr);
+ QCOMPARE(obj1.actionGroup(), nullptr);
delete var1;
// QMenu * QAction::menu()
// void QAction::setMenu(QMenu *)
- QMenu *var2 = new QMenu(0);
+ QMenu *var2 = new QMenu(nullptr);
obj1.setMenu(var2);
QCOMPARE(var2, obj1.menu());
- obj1.setMenu((QMenu *)0);
- QCOMPARE((QMenu *)0, obj1.menu());
+ obj1.setMenu(nullptr);
+ QCOMPARE(obj1.menu(), nullptr);
delete var2;
QCOMPARE(obj1.priority(), QAction::NormalPriority);
@@ -148,7 +148,7 @@ void tst_QAction::setText()
{
QFETCH(QString, text);
- QAction action(0);
+ QAction action(nullptr);
action.setText(text);
QCOMPARE(action.text(), text);
@@ -161,7 +161,7 @@ void tst_QAction::setIconText()
{
QFETCH(QString, iconText);
- QAction action(0);
+ QAction action(nullptr);
action.setIconText(iconText);
QCOMPARE(action.iconText(), iconText);
@@ -171,7 +171,7 @@ void tst_QAction::setIconText()
void tst_QAction::setUnknownFont() // QTBUG-42728
{
- QAction action(0);
+ QAction action(nullptr);
QFont font("DoesNotExist", 11);
action.setFont(font);
@@ -182,17 +182,17 @@ void tst_QAction::setUnknownFont() // QTBUG-42728
void tst_QAction::updateState(QActionEvent *e)
{
if (!e) {
- m_lastEventType = 0;
- m_lastAction = 0;
+ m_lastEventType = QEvent::None;
+ m_lastAction = nullptr;
} else {
- m_lastEventType = (int)e->type();
+ m_lastEventType = e->type();
m_lastAction = e->action();
}
}
void tst_QAction::actionEvent()
{
- QAction a(0);
+ QAction a(nullptr);
a.setText("action text");
// add action
@@ -202,33 +202,33 @@ void tst_QAction::actionEvent()
testWidget.addAction(&a);
qApp->processEvents();
- QCOMPARE(m_lastEventType, (int)QEvent::ActionAdded);
+ QCOMPARE(m_lastEventType, QEvent::ActionAdded);
QCOMPARE(m_lastAction, &a);
// change action
a.setText("new action text");
qApp->processEvents();
- QCOMPARE(m_lastEventType, (int)QEvent::ActionChanged);
+ QCOMPARE(m_lastEventType, QEvent::ActionChanged);
QCOMPARE(m_lastAction, &a);
// remove action
testWidget.removeAction(&a);
qApp->processEvents();
- QCOMPARE(m_lastEventType, (int)QEvent::ActionRemoved);
+ QCOMPARE(m_lastEventType, QEvent::ActionRemoved);
QCOMPARE(m_lastAction, &a);
}
//basic testing of standard keys
void tst_QAction::setStandardKeys()
{
- QAction act(0);
+ QAction act(nullptr);
act.setShortcut(QKeySequence("CTRL+L"));
QList<QKeySequence> list;
act.setShortcuts(list);
act.setShortcuts(QKeySequence::Copy);
- QCOMPARE(act.shortcut(), act.shortcuts().first());
+ QCOMPARE(act.shortcut(), act.shortcuts().constFirst());
QList<QKeySequence> expected;
const QKeySequence ctrlC = QKeySequence(QStringLiteral("CTRL+C"));
@@ -263,7 +263,7 @@ void tst_QAction::alternateShortcuts()
QList<QKeySequence> shlist = QList<QKeySequence>() << QKeySequence("CTRL+P") << QKeySequence("CTRL+A");
act.setShortcuts(shlist);
- QSignalSpy spy(&act, SIGNAL(triggered()));
+ QSignalSpy spy(&act, &QAction::triggered);
act.setAutoRepeat(true);
QTest::keyClick(&testWidget, Qt::Key_A, Qt::ControlModifier);
@@ -322,7 +322,7 @@ void tst_QAction::enabledVisibleInteraction()
testWidget.show();
QApplication::setActiveWindow(&testWidget);
- QAction act(0);
+ QAction act(nullptr);
// check defaults
QVERIFY(act.isEnabled());
QVERIFY(act.isVisible());
@@ -370,7 +370,7 @@ void tst_QAction::task229128TriggeredSignalWithoutActiongroup()
{
// test without a group
const QScopedPointer<QAction> actionWithoutGroup(new QAction("Test", nullptr));
- QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), SIGNAL(triggered(bool)));
+ QSignalSpy spyWithoutGroup(actionWithoutGroup.data(), QOverload<bool>::of(&QAction::triggered));
QCOMPARE(spyWithoutGroup.count(), 0);
actionWithoutGroup->trigger();
// signal should be emitted
@@ -388,7 +388,7 @@ void tst_QAction::task229128TriggeredSignalWithoutActiongroup()
void tst_QAction::task229128TriggeredSignalWhenInActiongroup()
{
- QActionGroup ag(0);
+ QActionGroup ag(nullptr);
QAction *action = new QAction("Test", &ag);
QAction *checkedAction = new QAction("Test 2", &ag);
ag.addAction(action);
@@ -397,8 +397,8 @@ void tst_QAction::task229128TriggeredSignalWhenInActiongroup()
checkedAction->setCheckable(true);
checkedAction->setChecked(true);
- QSignalSpy actionSpy(checkedAction, SIGNAL(triggered(bool)));
- QSignalSpy actionGroupSpy(&ag, SIGNAL(triggered(QAction*)));
+ QSignalSpy actionSpy(checkedAction, QOverload<bool>::of(&QAction::triggered));
+ QSignalSpy actionGroupSpy(&ag, QOverload<QAction*>::of(&QActionGroup::triggered));
QCOMPARE(actionGroupSpy.count(), 0);
QCOMPARE(actionSpy.count(), 0);
checkedAction->trigger();
@@ -513,10 +513,10 @@ void tst_QAction::disableShortcutsWithBlockedWidgets()
class ShortcutOverrideWidget : public QWidget
{
public:
- ShortcutOverrideWidget(QWidget *parent = 0) : QWidget(parent), shortcutOverrideCount(0) {}
- int shortcutOverrideCount;
+ using QWidget::QWidget;
+ int shortcutOverrideCount = 0;
protected:
- bool event(QEvent *e)
+ bool event(QEvent *e) override
{
if (e->type() == QEvent::ShortcutOverride)
++shortcutOverrideCount;
diff --git a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
index 52ca10d31f..524040d003 100644
--- a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
@@ -41,6 +41,7 @@ private slots:
void enabledPropagation();
void visiblePropagation();
void exclusive();
+ void exclusiveOptional();
void separators();
void testActionInTwoQActionGroup();
void unCheckCurrentAction();
@@ -48,11 +49,11 @@ private slots:
void tst_QActionGroup::enabledPropagation()
{
- QActionGroup testActionGroup( 0 );
+ QActionGroup testActionGroup(nullptr);
QAction* childAction = new QAction( &testActionGroup );
QAction* anotherChildAction = new QAction( &testActionGroup );
- QAction* freeAction = new QAction(0);
+ QAction* freeAction = new QAction(nullptr);
QVERIFY( testActionGroup.isEnabled() );
QVERIFY( childAction->isEnabled() );
@@ -87,11 +88,11 @@ void tst_QActionGroup::enabledPropagation()
void tst_QActionGroup::visiblePropagation()
{
- QActionGroup testActionGroup( 0 );
+ QActionGroup testActionGroup(nullptr);
QAction* childAction = new QAction( &testActionGroup );
QAction* anotherChildAction = new QAction( &testActionGroup );
- QAction* freeAction = new QAction(0);
+ QAction* freeAction = new QAction(nullptr);
QVERIFY( testActionGroup.isVisible() );
QVERIFY( childAction->isVisible() );
@@ -124,7 +125,7 @@ void tst_QActionGroup::visiblePropagation()
void tst_QActionGroup::exclusive()
{
- QActionGroup group(0);
+ QActionGroup group(nullptr);
group.setExclusive(false);
QVERIFY( !group.isExclusive() );
@@ -151,6 +152,52 @@ void tst_QActionGroup::exclusive()
QVERIFY( !actThree->isChecked() );
}
+void tst_QActionGroup::exclusiveOptional()
+{
+ QActionGroup group(0);
+ group.setExclusive(true);
+ QVERIFY( group.isExclusive() );
+
+ QAction* actOne = new QAction( &group );
+ actOne->setCheckable( true );
+ QAction* actTwo = new QAction( &group );
+ actTwo->setCheckable( true );
+ QAction* actThree = new QAction( &group );
+ actThree->setCheckable( true );
+
+ QVERIFY( !actOne->isChecked() );
+ QVERIFY( !actTwo->isChecked() );
+ QVERIFY( !actThree->isChecked() );
+
+ actOne->trigger();
+ QVERIFY( actOne->isChecked() );
+ QVERIFY( !actTwo->isChecked() );
+ QVERIFY( !actThree->isChecked() );
+
+ actOne->trigger();
+ QVERIFY( actOne->isChecked() );
+ QVERIFY( !actTwo->isChecked() );
+ QVERIFY( !actThree->isChecked() );
+
+ group.setExclusionPolicy( QActionGroup::ExclusionPolicy::ExclusiveOptional );
+ QVERIFY( group.isExclusive() );
+
+ actOne->trigger();
+ QVERIFY( !actOne->isChecked() );
+ QVERIFY( !actTwo->isChecked() );
+ QVERIFY( !actThree->isChecked() );
+
+ actTwo->trigger();
+ QVERIFY( !actOne->isChecked() );
+ QVERIFY( actTwo->isChecked() );
+ QVERIFY( !actThree->isChecked() );
+
+ actTwo->trigger();
+ QVERIFY( !actOne->isChecked() );
+ QVERIFY( !actTwo->isChecked() );
+ QVERIFY( !actThree->isChecked() );
+}
+
void tst_QActionGroup::separators()
{
QMainWindow mw;
@@ -166,26 +213,24 @@ void tst_QActionGroup::separators()
separator->setSeparator(true);
actGroup.addAction(separator);
- QListIterator<QAction*> it(actGroup.actions());
- while (it.hasNext())
- menu.addAction(it.next());
+ menu.addActions(actGroup.actions());
- QCOMPARE((int)menu.actions().size(), 2);
+ QCOMPARE(menu.actions().size(), 2);
- it = QListIterator<QAction*>(actGroup.actions());
- while (it.hasNext())
- menu.removeAction(it.next());
+ const auto removeActions = [&menu](const QList<QAction *> &actions) {
+ for (QAction *action : actions)
+ menu.removeAction(action);
+ };
+ removeActions(actGroup.actions());
- QCOMPARE((int)menu.actions().size(), 0);
+ QCOMPARE(menu.actions().size(), 0);
action = new QAction(&actGroup);
action->setText("test two");
- it = QListIterator<QAction*>(actGroup.actions());
- while (it.hasNext())
- menu.addAction(it.next());
+ menu.addActions(actGroup.actions());
- QCOMPARE((int)menu.actions().size(), 3);
+ QCOMPARE(menu.actions().size(), 3);
}
void tst_QActionGroup::testActionInTwoQActionGroup()
@@ -205,7 +250,7 @@ void tst_QActionGroup::testActionInTwoQActionGroup()
void tst_QActionGroup::unCheckCurrentAction()
{
- QActionGroup group(0);
+ QActionGroup group(nullptr);
QAction action1(&group) ,action2(&group);
action1.setCheckable(true);
action2.setCheckable(true);
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST
index d7de7bf16e..c68c7d6b14 100644
--- a/tests/auto/widgets/kernel/qapplication/BLACKLIST
+++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST
@@ -1,4 +1,3 @@
[touchEventPropagation]
# QTBUG-66745
-opensuse
opensuse-leap
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 7ee085b81c..367a5767c4 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -890,7 +890,9 @@ void tst_QApplication::libraryPaths()
QStringList actual = QApplication::libraryPaths();
actual.sort();
- QStringList expected = QSet<QString>::fromList((QStringList() << testDir << appDirPath)).toList();
+ QStringList expected;
+ expected << testDir << appDirPath;
+ expected = QSet<QString>(expected.constBegin(), expected.constEnd()).values();
expected.sort();
QVERIFY2(isPathListIncluded(actual, expected),
@@ -907,7 +909,9 @@ void tst_QApplication::libraryPaths()
QStringList actual = QApplication::libraryPaths();
actual.sort();
- QStringList expected = QSet<QString>::fromList((QStringList() << installPathPlugins << appDirPath)).toList();
+ QStringList expected;
+ expected << installPathPlugins << appDirPath;
+ expected = QSet<QString>(expected.constBegin(), expected.constEnd()).values();
expected.sort();
#ifdef Q_OS_WINRT
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index b2650d1f32..00bde3cb25 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -47,6 +47,7 @@ private slots:
void sizeConstraints();
void setGeometry();
void setStyleShouldChangeSpacing();
+ void widgetSurplus();
void testLayoutEngine_data();
void testLayoutEngine();
@@ -193,7 +194,7 @@ void tst_QBoxLayout::setGeometry()
setFrameless(&toplevel);
QWidget w(&toplevel);
QVBoxLayout *lay = new QVBoxLayout;
- lay->setMargin(0);
+ lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
QHBoxLayout *lay2 = new QHBoxLayout;
QDial *dial = new QDial;
@@ -236,6 +237,69 @@ void tst_QBoxLayout::setStyleShouldChangeSpacing()
QTRY_COMPARE(spacing(), 10);
}
+class MarginEatingStyle : public QProxyStyle
+{
+public:
+ MarginEatingStyle() : QProxyStyle(QStyleFactory::create("windows"))
+ {
+ }
+
+ virtual QRect subElementRect(SubElement sr, const QStyleOption *opt,
+ const QWidget *widget) const
+ {
+ QRect rect = opt->rect;
+ switch (sr) {
+ case SE_GroupBoxLayoutItem:
+ // this is a simplifed version of what the macOS style does
+ rect.setTop(rect.top() + 20);
+ rect.setLeft(rect.left() + 20);
+ rect.setRight(rect.right() - 20);
+ rect.setBottom(rect.bottom() - 20);
+ break;
+ default:
+ return QProxyStyle::subElementRect(sr, opt, widget);
+ }
+
+ return rect;
+ }
+};
+
+void tst_QBoxLayout::widgetSurplus()
+{
+ // Test case for QTBUG-67608 - a style requests space in the margin
+
+ QDialog window;
+ QScopedPointer<MarginEatingStyle> marginEater(new MarginEatingStyle);
+ QVBoxLayout *vbox = new QVBoxLayout(&window);
+ vbox->setContentsMargins(0, 0, 0, 0);
+ vbox->setSpacing(0);
+
+ QLabel *hiddenLabel = new QLabel(tr("Invisible label"));
+ hiddenLabel->setVisible(false);
+
+ QGroupBox *groupBox = new QGroupBox(tr("Groupbox Title"));
+ groupBox->setStyle(marginEater.data());
+ groupBox->setObjectName("Test group box");
+ QPushButton *button1 = new QPushButton(tr("Button 1"));
+ QPushButton *button2 = new QPushButton(tr("Button 2"));
+ QVBoxLayout *groupLayout = new QVBoxLayout;
+ groupLayout->addWidget(button1);
+ groupLayout->addWidget(button2);
+ groupBox->setLayout(groupLayout);
+
+ QLabel *label = new QLabel(tr("Visible label"));
+
+ vbox->addWidget(hiddenLabel);
+ vbox->addWidget(groupBox);
+ vbox->addWidget(label);
+ window.setLayout(vbox);
+
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+ QCOMPARE(groupBox->y(), 0);
+ QCOMPARE(groupBox->x(), 0);
+}
+
void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
{
QLabel *label = new QLabel("Qt uses standard C++, but makes extensive use of the C pre-processor to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling.");
@@ -507,6 +571,10 @@ void tst_QBoxLayout::replaceWidget()
QCOMPARE(boxLayout->indexOf(replaceFrom), 1);
QCOMPARE(boxLayout->indexOf(replaceTo), -1);
+ QCOMPARE(boxLayout->count(), 3);
+ boxLayout->replaceWidget(replaceFrom, replaceFrom);
+ QCOMPARE(boxLayout->count(), 3);
+
delete boxLayout->replaceWidget(replaceFrom, replaceTo);
QCOMPARE(boxLayout->indexOf(replaceFrom), -1);
diff --git a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
index 90776dfcb2..a29e8408a3 100644
--- a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -42,10 +42,12 @@ class tst_QDesktopWidget : public QObject
private slots:
void cleanup();
+#if QT_DEPRECATED_SINCE(5, 11)
void numScreens();
void primaryScreen();
- void screenNumberForQWidget();
void screenNumberForQPoint();
+#endif
+ void screenNumberForQWidget();
void availableGeometry();
void screenGeometry();
void topLevels();
@@ -56,6 +58,7 @@ void tst_QDesktopWidget::cleanup()
QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
+#if QT_DEPRECATED_SINCE(5, 11)
void tst_QDesktopWidget::numScreens()
{
QDesktopWidget desktop;
@@ -68,14 +71,17 @@ void tst_QDesktopWidget::primaryScreen()
QVERIFY(desktop.primaryScreen() >= 0);
QVERIFY(desktop.primaryScreen() < desktop.numScreens());
}
+#endif
void tst_QDesktopWidget::availableGeometry()
{
QDesktopWidget desktop;
QTest::ignoreMessage(QtWarningMsg, "QDesktopWidget::availableGeometry(): Attempt "
"to get the available geometry of a null widget");
- desktop.availableGeometry((QWidget *)0);
+ QRect r = desktop.availableGeometry(nullptr);
+ QVERIFY(r.isNull());
+#if QT_DEPRECATED_SINCE(5, 11)
QRect total;
QRect available;
@@ -90,13 +96,14 @@ void tst_QDesktopWidget::availableGeometry()
QVERIFY(total.contains(available));
QCOMPARE(desktop.availableGeometry(desktop.primaryScreen()), available);
QCOMPARE(desktop.screenGeometry(desktop.primaryScreen()), total);
+#endif
}
void tst_QDesktopWidget::screenNumberForQWidget()
{
QDesktopWidget desktop;
- QCOMPARE(desktop.screenNumber(0), 0);
+ QCOMPARE(desktop.screenNumber(nullptr), 0);
QWidget widget;
widget.show();
@@ -105,9 +112,10 @@ void tst_QDesktopWidget::screenNumberForQWidget()
int widgetScreen = desktop.screenNumber(&widget);
QVERIFY(widgetScreen > -1);
- QVERIFY(widgetScreen < desktop.numScreens());
+ QVERIFY(widgetScreen < QGuiApplication::screens().size());
}
+#if QT_DEPRECATED_SINCE(5, 11)
void tst_QDesktopWidget::screenNumberForQPoint()
{
// make sure QDesktopWidget::screenNumber(QPoint) returns the correct screen
@@ -131,25 +139,28 @@ void tst_QDesktopWidget::screenNumberForQPoint()
screen = desktopWidget->screenNumber(allScreens.bottomRight() + QPoint(1, 1));
QVERIFY(screen >= 0 && screen < desktopWidget->numScreens());
}
+#endif
void tst_QDesktopWidget::screenGeometry()
{
QDesktopWidget *desktopWidget = QApplication::desktop();
QTest::ignoreMessage(QtWarningMsg, "QDesktopWidget::screenGeometry(): Attempt "
"to get the screen geometry of a null widget");
- QRect r = desktopWidget->screenGeometry((QWidget *)0);
+ QRect r = desktopWidget->screenGeometry(nullptr);
QVERIFY(r.isNull());
QWidget widget;
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
r = desktopWidget->screenGeometry(&widget);
+#if QT_DEPRECATED_SINCE(5, 11)
QRect total;
QRect available;
for (int i = 0; i < desktopWidget->screenCount(); ++i) {
total = desktopWidget->screenGeometry(i);
available = desktopWidget->availableGeometry(i);
}
+#endif
}
void tst_QDesktopWidget::topLevels()
diff --git a/tests/auto/widgets/kernel/qformlayout/qformlayout.pro b/tests/auto/widgets/kernel/qformlayout/qformlayout.pro
index 617183fee6..0766b50f68 100644
--- a/tests/auto/widgets/kernel/qformlayout/qformlayout.pro
+++ b/tests/auto/widgets/kernel/qformlayout/qformlayout.pro
@@ -1,4 +1,4 @@
CONFIG += testcase
TARGET = tst_qformlayout
-QT += widgets testlib testlib-private
+QT += widgets widgets-private testlib testlib-private
SOURCES += tst_qformlayout.cpp
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index cff3dad35e..c6760000f4 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -38,6 +38,9 @@
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
+
+#include <private/qdialog_p.h>
+
#include <QStyleFactory>
#include <QSharedPointer>
@@ -52,7 +55,7 @@ using namespace QTestPrivate;
Q_CONSTEXPR QFormLayout::ItemRole invalidRole = QFormLayout::ItemRole(3);
struct QFormLayoutTakeRowResultHolder {
- QFormLayoutTakeRowResultHolder(QFormLayout::TakeRowResult result) Q_DECL_NOTHROW
+ QFormLayoutTakeRowResultHolder(QFormLayout::TakeRowResult result) noexcept
: labelItem(result.labelItem),
fieldItem(result.fieldItem)
{
@@ -66,20 +69,20 @@ struct QFormLayoutTakeRowResultHolder {
if (fieldItem)
disposer.setItem(0, QFormLayout::FieldRole, fieldItem);
}
- QFormLayoutTakeRowResultHolder(QFormLayoutTakeRowResultHolder &&other) Q_DECL_NOTHROW
+ QFormLayoutTakeRowResultHolder(QFormLayoutTakeRowResultHolder &&other) noexcept
: labelItem(other.labelItem),
fieldItem(other.fieldItem)
{
other.labelItem = nullptr;
other.fieldItem = nullptr;
}
- QFormLayoutTakeRowResultHolder &operator=(QFormLayoutTakeRowResultHolder &&other) Q_DECL_NOTHROW
+ QFormLayoutTakeRowResultHolder &operator=(QFormLayoutTakeRowResultHolder &&other) noexcept
{
swap(other);
return *this;
}
- void swap(QFormLayoutTakeRowResultHolder &other) Q_DECL_NOTHROW
+ void swap(QFormLayoutTakeRowResultHolder &other) noexcept
{
qSwap(labelItem, other.labelItem);
qSwap(fieldItem, other.fieldItem);
@@ -1196,22 +1199,20 @@ void tst_QFormLayout::layoutAlone()
void tst_QFormLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
{
QSharedPointer<QFormLayout> outer(new QFormLayout);
- QPointer<QFormLayout> inner = new QFormLayout;
+ QAutoPointer<QFormLayout> holder{new QFormLayout};
+ auto inner = holder.get();
outer->addRow(inner);
QCOMPARE(outer->count(), 1);
QCOMPARE(inner->parent(), outer.data());
QLayoutItem *item = outer->takeAt(0);
- QCOMPARE(item->layout(), inner.data());
+ QCOMPARE(item->layout(), inner);
QVERIFY(!item->layout()->parent());
outer.reset();
- if (inner)
- delete item; // success: a taken item/layout should not be deleted when the old parent is deleted
- else
- QVERIFY(!inner.isNull());
+ QVERIFY(holder); // a taken item/layout should not be deleted when the old parent is deleted
}
void tst_QFormLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 5e0327319b..1d63d140fb 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -219,9 +219,9 @@ void tst_QGridLayout::badDistributionBug()
QDialog dialog;
Ui::SortDialog ui;
ui.setupUi(&dialog);
- ui.gridLayout->setMargin(0);
+ ui.gridLayout->setContentsMargins(0, 0, 0, 0);
ui.gridLayout->setSpacing(0);
- ui.vboxLayout->setMargin(0);
+ ui.vboxLayout->setContentsMargins(0, 0, 0, 0);
ui.vboxLayout->setSpacing(0);
ui.okButton->setFixedHeight(20);
ui.moreButton->setFixedHeight(20);
@@ -237,7 +237,7 @@ void tst_QGridLayout::setMinAndMaxSize()
QWidget widget;
setFrameless(&widget);
QGridLayout layout(&widget);
- layout.setMargin(0);
+ layout.setContentsMargins(0, 0, 0, 0);
layout.setSpacing(0);
layout.setSizeConstraint(QLayout::SetMinAndMaxSize);
widget.show();
@@ -396,7 +396,7 @@ void tst_QGridLayout::spacingAndSpacers()
QWidget widget;
setFrameless(&widget);
QGridLayout layout(&widget);
- layout.setMargin(0);
+ layout.setContentsMargins(0, 0, 0, 0);
layout.setSpacing(0);
widget.show();
@@ -1541,7 +1541,7 @@ void tst_QGridLayout::spacerWithSpacing()
QWidget window;
QGridLayout layout(&window);
layout.setSpacing(1);
- layout.setMargin(0);
+ layout.setContentsMargins(0, 0, 0, 0);
populate(&layout, 0, i);
populate(&layout, 1, j);
populate(&layout, 2, k);
@@ -1651,7 +1651,7 @@ void tst_QGridLayout::taskQTBUG_52357_spacingWhenItemIsHidden()
QWidget widget;
setFrameless(&widget);
QGridLayout layout(&widget);
- layout.setMargin(0);
+ layout.setContentsMargins(0, 0, 0, 0);
layout.setSpacing(5);
QPushButton button1;
layout.addWidget(&button1, 0, 0);
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index 936f581d89..140a367afe 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -308,7 +308,7 @@ void tst_QLayout::controlTypes2()
{
QWidget main;
QVBoxLayout *const layout = new QVBoxLayout(&main);
- layout->setMargin(0);
+ layout->setContentsMargins(0, 0, 0, 0);
QComboBox *combo = new QComboBox(&main);
layout->addWidget(combo);
QCOMPARE(layout->controlTypes(), QSizePolicy::ComboBox);
@@ -319,7 +319,7 @@ void tst_QLayout::adjustSizeShouldMakeSureLayoutIsActivated()
QWidget main;
QVBoxLayout *const layout = new QVBoxLayout(&main);
- layout->setMargin(0);
+ layout->setContentsMargins(0, 0, 0, 0);
SizeHinterFrame *frame = new SizeHinterFrame(QSize(200, 10), QSize(200, 8));
frame->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
layout->addWidget(frame);
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 53753e195a..84120c70e9 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -41,7 +41,6 @@
#include <qshortcut.h>
#include <qscreen.h>
-class AccelForm;
QT_BEGIN_NAMESPACE
class QMainWindow;
class QTextEdit;
@@ -51,15 +50,14 @@ class tst_QShortcut : public QObject
{
Q_OBJECT
public:
- tst_QShortcut();
- virtual ~tst_QShortcut();
-
enum Action {
SetupAccel,
TestAccel,
- ClearAll
- } currentAction;
+ ClearAll,
+ TestEnd
+ };
+ Q_ENUM(Action)
enum Widget {
NoWidget,
@@ -70,8 +68,8 @@ public:
TriggerSlot5,
TriggerSlot6,
TriggerSlot7,
- SendKeyEvent
};
+ Q_ENUM(Widget)
enum Result {
NoResult,
@@ -84,7 +82,8 @@ public:
Slot7Triggered,
SentKeyEvent,
Ambiguous
- } currentResult;
+ } currentResult = NoResult;
+ Q_ENUM(Result)
public slots:
void slotTrig1() { currentResult = Slot1Triggered; }
@@ -101,16 +100,9 @@ public slots:
void ambigSlot5() { currentResult = Ambiguous; ambigResult = Slot5Triggered; }
void ambigSlot6() { currentResult = Ambiguous; ambigResult = Slot6Triggered; }
void ambigSlot7() { currentResult = Ambiguous; ambigResult = Slot7Triggered; }
- void statusMessage( const QString& message ) { sbText = message; }
- void shortcutDestroyed(QObject* obj);
- void sendKeyEvent() { sendKeyEvents(edit, Qt::CTRL + Qt::Key_B, 0); currentResult = SentKeyEvent; }
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void cleanup() { QCOMPARE(QApplication::topLevelWidgets().size(), 1); }
private slots:
+ void cleanup();
void number_data();
void number();
void text_data();
@@ -129,29 +121,19 @@ protected:
static Qt::KeyboardModifiers toButtons( int key );
void defElements();
- void clearAllShortcuts();
- QShortcut *setupShortcut(int testWidget, const QKeySequence &ks);
- QShortcut *setupShortcut(int testWidget, const QString &txt, int k1 = 0, int k2 = 0, int k3 = 0, int k4 = 0);
-
- QShortcut *setupShortcut(QWidget *parent, const char *name, int testWidget, const QString &txt, int k1 = 0, int k2 = 0, int k3 = 0, int k4 = 0);
- QShortcut *setupShortcut(QWidget *parent, const char *name, int testWidget, const QKeySequence &ks, Qt::ShortcutContext context = Qt::WindowShortcut);
+ QShortcut *setupShortcut(QWidget *parent, const QString &name, const QKeySequence &ks,
+ Qt::ShortcutContext context = Qt::WindowShortcut);
+ QShortcut *setupShortcut(QWidget *parent, const QString &name, Widget testWidget,
+ const QKeySequence &ks, Qt::ShortcutContext context = Qt::WindowShortcut);
- void sendKeyEvents(QWidget *w, int k1, QChar c1 = 0, int k2 = 0, QChar c2 = 0, int k3 = 0, QChar c3 = 0, int k4 = 0, QChar c4 = 0);
- void sendKeyEvents(int k1, QChar c1 = 0, int k2 = 0, QChar c2 = 0, int k3 = 0, QChar c3 = 0, int k4 = 0, QChar c4 = 0);
+ static void sendKeyEvents(QWidget *w, int k1, QChar c1 = 0, int k2 = 0, QChar c2 = 0,
+ int k3 = 0, QChar c3 = 0, int k4 = 0, QChar c4 = 0);
void testElement();
- QMainWindow *mainW;
- QList<QShortcut*> shortcuts;
- QTextEdit *edit;
- QString sbText;
Result ambigResult;
};
-Q_DECLARE_METATYPE(tst_QShortcut::Widget);
-Q_DECLARE_METATYPE(tst_QShortcut::Result);
-Q_DECLARE_METATYPE(tst_QShortcut::Action);
-
class TestEdit : public QTextEdit
{
Q_OBJECT
@@ -163,7 +145,8 @@ public:
}
protected:
- bool event(QEvent *e) {
+ bool event(QEvent *e) override
+ {
// Make testedit allow any Ctrl+Key as shortcut
if (e->type() == QEvent::ShortcutOverride) {
QKeyEvent *ke = static_cast<QKeyEvent*>(e);
@@ -196,33 +179,28 @@ protected:
}
};
-tst_QShortcut::tst_QShortcut(): mainW( 0 )
+class MainWindow : public QMainWindow
{
-}
+public:
+ MainWindow();
-tst_QShortcut::~tst_QShortcut()
-{
- clearAllShortcuts();
-}
+ TestEdit *testEdit() const { return m_testEdit; }
-void tst_QShortcut::initTestCase()
+private:
+ TestEdit *m_testEdit;
+};
+
+MainWindow::MainWindow()
{
- currentResult = NoResult;
- mainW = new QMainWindow(0);
- mainW->setWindowFlags(Qt::X11BypassWindowManagerHint);
- edit = new TestEdit(mainW, "test_edit");
- mainW->setFixedSize( 200, 200 );
- mainW->setCentralWidget( edit );
- mainW->show();
- mainW->activateWindow();
- QVERIFY(QTest::qWaitForWindowActive(mainW));
- connect( mainW->statusBar(), SIGNAL(messageChanged(QString)),
- this, SLOT(statusMessage(QString)) );
+ setWindowFlags(Qt::X11BypassWindowManagerHint);
+ m_testEdit = new TestEdit(this, "test_edit");
+ setCentralWidget(m_testEdit);
+ setFixedSize(200, 200);
}
-void tst_QShortcut::cleanupTestCase()
+void tst_QShortcut::cleanup()
{
- delete mainW;
+ QVERIFY(QApplication::topLevelWidgets().size() <= 1); // The data driven tests keep a widget around
}
Qt::KeyboardModifiers tst_QShortcut::toButtons( int key )
@@ -277,7 +255,7 @@ void tst_QShortcut::number_data()
defElements();
// Clear all
- QTest::newRow("N00 - clear") << ClearAll << NoWidget <<QString("")<<0<<0<<0<<0<<0<<0<<0<<0<<NoResult;
+ QTest::newRow("N00 - clear") << ClearAll << NoWidget <<QString()<<0<<0<<0<<0<<0<<0<<0<<0<<NoResult;
//===========================================
// [Shift + key] on non-shift shortcuts testing
@@ -289,15 +267,15 @@ void tst_QShortcut::number_data()
Shift + Qt::Key_Plus on Qt::Key_Pluss
Qt::Key_Plus on Qt::Key_Pluss
*/
- QTest::newRow("N001 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N001 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("N001:Shift + M - [M]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N001:M - [M]") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N001 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ //QTest::newRow("N001:Shift + M - [M]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N001:M - [M]") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N001 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("N001:Shift++ [+]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N001:+ [+]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N001 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ //QTest::newRow("N001:Shift++ [+]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N001:+ [+]") << TestAccel << NoWidget << QString() << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N001 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Qt::Key_M on Shift + Qt::Key_M
@@ -305,32 +283,32 @@ void tst_QShortcut::number_data()
Shift + Qt::Key_Plus on Shift + Qt::Key_Pluss
Qt::Key_Plus on Shift + Qt::Key_Pluss
*/
- QTest::newRow("N002 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N002:Shift+M - [Shift+M]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N002:M - [Shift+M]") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N002 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::SHIFT + Qt::Key_Plus) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N002:Shift++ [Shift++]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N002:+ [Shift++]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N002 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N002 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::SHIFT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N002:Shift+M - [Shift+M]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N002:M - [Shift+M]") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N002 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::SHIFT + Qt::Key_Plus) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N002:Shift++ [Shift++]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N002:+ [Shift++]") << TestAccel << NoWidget << QString() << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N002 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Qt::Key_F1 on Qt::Key_F1
Qt::Key_F1 on Qt::Key_F1
*/
- QTest::newRow("N003 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N003 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("N003:Shift+F1 - [F1]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N003:F1 - [F1]") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N003 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ //QTest::newRow("N003:Shift+F1 - [F1]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N003:F1 - [F1]") << TestAccel << NoWidget << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N003 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Qt::Key_F1 on Shift + Qt::Key_F1
Qt::Key_F1 on Shift + Qt::Key_F1
*/
- QTest::newRow("N004 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N004:Shift+F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N004:F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N004 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N004 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N004:Shift+F1 - [Shift+F1]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N004:F1 - [Shift+F1]") << TestAccel << NoWidget << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N004 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Qt::Key_Tab on Qt::Key_Tab
@@ -338,14 +316,14 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Qt::Key_Tab
Shift + Qt::Key_Backtab on Qt::Key_Tab
*/
- QTest::newRow("N005a - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N005a:Tab - [Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N005a - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N005a:Tab - [Tab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("N005a:Shift+Tab - [Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ //QTest::newRow("N005a:Shift+Tab - [Tab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
// (Shift+)BackTab != Tab, but Shift+BackTab == Shift+Tab
- QTest::newRow("N005a:Backtab - [Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N005a:Shift+Backtab - [Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N005a - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N005a:Backtab - [Tab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N005a:Shift+Backtab - [Tab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N005a - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Qt::Key_Tab on Shift + Qt::Key_Tab
@@ -353,12 +331,12 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Shift + Qt::Key_Tab
Shift + Qt::Key_Backtab on Shift + Qt::Key_Tab
*/
- QTest::newRow("N005b - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N005b:Tab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N005b:Shift+Tab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N005b:BackTab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N005b:Shift+BackTab - [Shift+Tab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N005b - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N005b - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N005b:Tab - [Shift+Tab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N005b:Shift+Tab - [Shift+Tab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N005b:BackTab - [Shift+Tab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N005b:Shift+BackTab - [Shift+Tab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N005b - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Qt::Key_Tab on Qt::Key_Backtab
@@ -366,15 +344,15 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Qt::Key_Backtab
Shift + Qt::Key_Backtab on Qt::Key_Backtab
*/
- QTest::newRow("N006a - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N006a:Tab - [BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N006a - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N006a:Tab - [BackTab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
// This should work, since platform dependent code will transform the
// Shift+Tab into a Shift+BackTab, which should trigger the shortcut
- QTest::newRow("N006a:Shift+Tab - [BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered; //XFAIL
- QTest::newRow("N006a:BackTab - [BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N006a:Shift+Tab - [BackTab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered; //XFAIL
+ QTest::newRow("N006a:BackTab - [BackTab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("N006a:Shift+BackTab - [BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N006a - clear") << ClearAll << NoWidget<< QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ //QTest::newRow("N006a:Shift+BackTab - [BackTab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N006a - clear") << ClearAll << NoWidget<< QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Qt::Key_Tab on Shift + Qt::Key_Backtab
@@ -382,12 +360,12 @@ void tst_QShortcut::number_data()
Qt::Key_Backtab on Shift + Qt::Key_Backtab
Shift + Qt::Key_Backtab on Shift + Qt::Key_Backtab
*/
- QTest::newRow("N006b - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N006b:Tab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N006b:Shift+Tab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N006b:BackTab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N006b:Shift+BackTab - [Shift+BackTab]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered; //XFAIL
- QTest::newRow("N006b - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N006b - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N006b:Tab - [Shift+BackTab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N006b:Shift+Tab - [Shift+BackTab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Tab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N006b:BackTab - [Shift+BackTab]") << TestAccel << NoWidget << QString() << int(Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N006b:Shift+BackTab - [Shift+BackTab]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Backtab) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered; //XFAIL
+ QTest::newRow("N006b - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
//===========================================
// [Shift + key] and [key] on shortcuts with
@@ -398,11 +376,11 @@ void tst_QShortcut::number_data()
Qt::Key_F1
Shift + Qt::Key_F1
*/
- QTest::newRow("N007 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N007 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N007:F1") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N007:Shift + F1") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N007 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N007 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N007 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N007:F1") << TestAccel << NoWidget << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N007:Shift + F1") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N007 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Qt::Key_M
@@ -410,51 +388,51 @@ void tst_QShortcut::number_data()
Ctrl + Qt::Key_M
Alt + Qt::Key_M
*/
- QTest::newRow("N01 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N02 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N03 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::CTRL + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N04 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::ALT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N:Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N:Shift+Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N:Ctrl+Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::CTRL + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N:Alt+Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::ALT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N01 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N02 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N03 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::CTRL + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N04 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::ALT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N:Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N:Shift+Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N:Ctrl+Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::CTRL + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N:Alt+Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::ALT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
/* Testing Single Sequence Ambiguity
Qt::Key_M on shortcut2
*/
- QTest::newRow("N05 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N:Qt::Key_M on slot") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Ambiguous;
- QTest::newRow("N05 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N05 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N:Qt::Key_M on slot") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Ambiguous;
+ QTest::newRow("N05 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Specialkeys
Qt::Key_aring
Qt::Key_Aring
Qt::UNICODE_ACCEL + Qt::Key_K
*/
- QTest::newRow("N06 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N07 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N08 - slot2") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N06 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N07 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N08 - slot2") << SetupAccel << TriggerSlot1 << QString() << int(Qt::UNICODE_ACCEL + Qt::Key_K) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N:Qt::Key_aring") << TestAccel << NoWidget << QString("") << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N:Qt::Key_Aring") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N:Qt::Key_aring - Text Form") << TestAccel << NoWidget << QString("") << 0 << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N:Qt::Key_Aring - Text Form") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+0) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N:Qt::UNICODE_ACCEL + Qt::Key_K")<< TestAccel << NoWidget << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N09 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N:Qt::Key_aring") << TestAccel << NoWidget << QString() << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N:Qt::Key_Aring") << TestAccel << NoWidget << QString() << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N:Qt::Key_aring - Text Form") << TestAccel << NoWidget << QString() << 0 << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N:Qt::Key_Aring - Text Form") << TestAccel << NoWidget << QString() << int(Qt::SHIFT+0) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N:Qt::UNICODE_ACCEL + Qt::Key_K")<< TestAccel << NoWidget << QString() << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N09 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Multiple Sequences
Qt::Key_M
Qt::Key_I, Qt::Key_M
Shift+Qt::Key_I, Qt::Key_M
*/
- QTest::newRow("N10 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N11 - slot2") << SetupAccel << TriggerSlot2 << QString("") << int(Qt::Key_I) << 0 << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("N12 - slot1") << SetupAccel << TriggerSlot1 << QString("") << int(Qt::SHIFT + Qt::Key_I) << 0 << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << NoResult;
-
- QTest::newRow("N:Qt::Key_M (2)") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N:Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::Key_I) << int('i') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("N:Shift+Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_I) << int('I') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("N13 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("N10 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N11 - slot2") << SetupAccel << TriggerSlot2 << QString() << int(Qt::Key_I) << 0 << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("N12 - slot1") << SetupAccel << TriggerSlot1 << QString() << int(Qt::SHIFT + Qt::Key_I) << 0 << int(Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << NoResult;
+
+ QTest::newRow("N:Qt::Key_M (2)") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N:Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::Key_I) << int('i') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("N:Shift+Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_I) << int('I') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("N:end") << TestEnd << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
}
// ------------------------------------------------------------------
@@ -464,7 +442,7 @@ void tst_QShortcut::text_data()
{
defElements();
// Clear all
- QTest::newRow("T00 - clear") << ClearAll << NoWidget <<QString("")<<0<<0<<0<<0<<0<<0<<0<<0<< NoResult;
+ QTest::newRow("T00 - clear") << ClearAll << NoWidget <<QString()<<0<<0<<0<<0<<0<<0<<0<<0<< NoResult;
//===========================================
// [Shift + key] on non-shift shortcuts testing
@@ -478,13 +456,13 @@ void tst_QShortcut::text_data()
*/
QTest::newRow("T001 - slot1") << SetupAccel << TriggerSlot1 << QString("M") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("T001:Shift+M - [M]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T001:M - [M]") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ //QTest::newRow("T001:Shift+M - [M]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T001:M - [M]") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
QTest::newRow("T001 - slot2") << SetupAccel << TriggerSlot2 << QString("+") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("T001:Shift++ [+]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T001:+ [+]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T001 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ //QTest::newRow("T001:Shift++ [+]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T001:+ [+]") << TestAccel << NoWidget << QString() << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T001 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Qt::Key_M on Shift + Qt::Key_M
@@ -495,12 +473,12 @@ void tst_QShortcut::text_data()
Ctrl + Qt::Key_Plus on Ctrl + Qt::Key_Pluss
*/
QTest::newRow("T002 - slot1") << SetupAccel << TriggerSlot1 << QString("Shift+M") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T002:Shift+M - [Shift+M]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T002:M - [Shift+M]") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("T002:Shift+M - [Shift+M]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T002:M - [Shift+M]") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T002 - slot2") << SetupAccel << TriggerSlot2 << QString("Shift++") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T002:Shift++ [Shift++]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T002:+ [Shift++]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T002 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("T002:Shift++ [Shift++]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T002:+ [Shift++]") << TestAccel << NoWidget << QString() << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("T002 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Ctrl + Qt::Key_Plus on Ctrl + Qt::Key_Plus
@@ -509,10 +487,10 @@ void tst_QShortcut::text_data()
*/
QTest::newRow("T002b - slot1") << SetupAccel << TriggerSlot1 << QString("Ctrl++") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("T002b:Shift+Ctrl++ [Ctrl++]")<< TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::CTRL + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T002b:Ctrl++ [Ctrl++]") << TestAccel << NoWidget << QString("") << int(Qt::CTRL + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T002b:+ [Ctrl++]") << TestAccel << NoWidget << QString("") << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T002b - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ //QTest::newRow("T002b:Shift+Ctrl++ [Ctrl++]")<< TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::CTRL + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T002b:Ctrl++ [Ctrl++]") << TestAccel << NoWidget << QString() << int(Qt::CTRL + Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T002b:+ [Ctrl++]") << TestAccel << NoWidget << QString() << int(Qt::Key_Plus) << int('+') << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("T002b - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Qt::Key_F1 on Qt::Key_F1
@@ -520,18 +498,18 @@ void tst_QShortcut::text_data()
*/
QTest::newRow("T003 - slot1") << SetupAccel << TriggerSlot1 << QString("F1") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
//commented out because the behaviour changed, those tests should be updated
- //QTest::newRow("T003:Shift+F1 - [F1]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T003:F1 - [F1]") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T003 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ //QTest::newRow("T003:Shift+F1 - [F1]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T003:F1 - [F1]") << TestAccel << NoWidget << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T003 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Shift + Qt::Key_F1 on Shift + Qt::Key_F1
Qt::Key_F1 on Shift + Qt::Key_F1
*/
QTest::newRow("T004 - slot1") << SetupAccel << TriggerSlot1 << QString("Shift+F1") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T004:Shift+F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T004:F1 - [Shift+F1]") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T004 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("T004:Shift+F1 - [Shift+F1]") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T004:F1 - [Shift+F1]") << TestAccel << NoWidget << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+ QTest::newRow("T004 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
//===========================================
// [Shift + key] and [key] on shortcuts with
@@ -544,9 +522,9 @@ void tst_QShortcut::text_data()
*/
QTest::newRow("T007 - slot1") << SetupAccel << TriggerSlot1 << QString("F1") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T007 - slot2") << SetupAccel << TriggerSlot2 << QString("Shift+F1") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T007:F1") << TestAccel << NoWidget << QString("") << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T007:Shift + F1") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T007 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("T007:F1") << TestAccel << NoWidget << QString() << int(Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T007:Shift + F1") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_F1) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T007 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Sequences
Qt::Key_M
@@ -559,17 +537,17 @@ void tst_QShortcut::text_data()
QTest::newRow("T03 - slot1") << SetupAccel << TriggerSlot1 << QString("Ctrl+M") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T04 - slot2") << SetupAccel << TriggerSlot2 << QString("Alt+M") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T:Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T:Shift + Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T:Ctrl + Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::CTRL + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T:Alt + Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::ALT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T:Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T:Shift + Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_M) << int('M') << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T:Ctrl + Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::CTRL + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T:Alt + Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::ALT + Qt::Key_M) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
/* Testing Single Sequence Ambiguity
Qt::Key_M on shortcut2
*/
QTest::newRow("T05 - slot2") << SetupAccel << TriggerSlot2 << QString("M") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T:Qt::Key_M on TriggerSlot2") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Ambiguous;
- QTest::newRow("T06 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("T:Qt::Key_M on TriggerSlot2") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Ambiguous;
+ QTest::newRow("T06 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Single Specialkeys
Qt::Key_aring
@@ -580,12 +558,12 @@ void tst_QShortcut::text_data()
QTest::newRow("T06 - slot1") << SetupAccel << TriggerSlot1 << QString::fromLatin1("\x0C5")<< 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T07 - slot2") << SetupAccel << TriggerSlot2 << QString::fromLatin1("Shift+\x0C5")<< 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T08 - slot2") << SetupAccel << TriggerSlot1 << QString("K") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T:Qt::Key_aring") << TestAccel << NoWidget << QString("") << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T:Qt::Key_Aring") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T:Qt::Key_aring - Text Form") << TestAccel << NoWidget << QString("") << 0 << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T:Qt::Key_Aring - Text Form") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT+0) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T:Qt::UNICODE_ACCEL + Qt::Key_K")<< TestAccel << NoWidget << QString("") << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T09 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("T:Qt::Key_aring") << TestAccel << NoWidget << QString() << int(Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T:Qt::Key_Aring") << TestAccel << NoWidget << QString() << int(Qt::SHIFT+Qt::Key_Aring) << 0 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T:Qt::Key_aring - Text Form") << TestAccel << NoWidget << QString() << 0 << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T:Qt::Key_Aring - Text Form") << TestAccel << NoWidget << QString() << int(Qt::SHIFT+0) << 0xC5 << 0 << 0 << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T:Qt::UNICODE_ACCEL + Qt::Key_K")<< TestAccel << NoWidget << QString() << int(Qt::UNICODE_ACCEL + Qt::Key_K) << int('k') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T09 - clear") << ClearAll << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
/* Testing Multiple Sequences
Qt::Key_M
@@ -595,10 +573,38 @@ void tst_QShortcut::text_data()
QTest::newRow("T10 - slot1") << SetupAccel << TriggerSlot1 << QString("M") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T11 - slot2") << SetupAccel << TriggerSlot2 << QString("I, M")<< 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
QTest::newRow("T12 - slot1") << SetupAccel << TriggerSlot1 << QString("Shift+I, M")<< 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
- QTest::newRow("T:Qt::Key_M (2)") << TestAccel << NoWidget << QString("") << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T:Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::Key_I) << int('i') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot2Triggered;
- QTest::newRow("T:Shift+Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString("") << int(Qt::SHIFT + Qt::Key_I) << int('I') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot1Triggered;
- QTest::newRow("T13 - clear") << ClearAll << NoWidget << QString("") << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult; // Clear all
+ QTest::newRow("T:Qt::Key_M (2)") << TestAccel << NoWidget << QString() << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T:Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::Key_I) << int('i') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot2Triggered;
+ QTest::newRow("T:Shift+Qt::Key_I, Qt::Key_M") << TestAccel << NoWidget << QString() << int(Qt::SHIFT + Qt::Key_I) << int('I') << int(Qt::Key_M) << int('m') << 0 << 0 << 0 << 0 << Slot1Triggered;
+ QTest::newRow("T:end") << TestEnd << NoWidget << QString() << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << NoResult;
+}
+
+class ButtonWidget : public QWidget
+{
+public:
+ ButtonWidget();
+
+ QPushButton *pushButton1() const { return m_pb1; }
+ QPushButton *pushButton2() const { return m_pb2; }
+
+private:
+ QPushButton *m_pb1;
+ QPushButton *m_pb2;
+};
+
+ButtonWidget::ButtonWidget()
+{
+ // Setup two identical shortcuts on different pushbuttons
+ QString name = QLatin1String("pushbutton-1");
+ m_pb1 = new QPushButton(name, this);
+ m_pb1->setObjectName(name);
+ name = QLatin1String("pushbutton-2");
+ m_pb2 = new QPushButton(name, this);
+ m_pb2->setObjectName(name);
+ auto hLayout = new QHBoxLayout(this);
+ hLayout->addWidget(m_pb1);
+ hLayout->addWidget(m_pb2);
+ hLayout->addStretch();
}
// ------------------------------------------------------------------
@@ -606,9 +612,11 @@ void tst_QShortcut::text_data()
// ------------------------------------------------------------------
void tst_QShortcut::disabledItems()
{
- clearAllShortcuts();
- mainW->activateWindow();
- QVERIFY(QTest::qWaitForWindowActive(mainW));
+ ButtonWidget mainW;
+ mainW.setWindowTitle(QTest::currentTestFunction());
+ mainW.show();
+ mainW.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&mainW));
/* Testing Disabled Shortcuts
Qt::Key_M on slot1
@@ -618,27 +626,27 @@ void tst_QShortcut::disabledItems()
*/
// Setup two identical shortcuts on different pushbuttons
- QPushButton pb1(mainW);
- QPushButton pb2(mainW);
- pb1.setObjectName("pushbutton-1");
- pb2.setObjectName("pushbutton-2");
- pb1.show(); // Must be show for QShortcutMap::correctSubWindow to trigger
- pb2.show();
-
- QShortcut *cut1 = setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, "M");
- QShortcut *cut2 = setupShortcut(&pb1, "shortcut2-pb1", TriggerSlot1, "Shift+M");
- QShortcut *cut3 = setupShortcut(&pb2, "shortcut3-pb2", TriggerSlot2, "M");
- QShortcut *cut4 = setupShortcut(&pb2, "shortcut4-pb2", TriggerSlot2, "Shift+M");
+ auto pb1 = mainW.pushButton1();
+ auto pb2 = mainW.pushButton2();
+ const int shiftM = Qt::SHIFT + Qt::Key_M;
+ QShortcut *cut1 = setupShortcut(pb1, "shortcut1-pb1", TriggerSlot1,
+ QKeySequence(Qt::Key_M));
+ QShortcut *cut2 = setupShortcut(pb1, "shortcut2-pb1", TriggerSlot1,
+ QKeySequence(shiftM));
+ QShortcut *cut3 = setupShortcut(pb2, "shortcut3-pb2", TriggerSlot2,
+ QKeySequence(Qt::Key_M));
+ QShortcut *cut4 = setupShortcut(pb2, "shortcut4-pb2", TriggerSlot2,
+ QKeySequence(shiftM));
cut3->setEnabled(false);
cut4->setEnabled(false);
currentResult = NoResult;
- sendKeyEvents(Qt::Key_M, 'm');
+ sendKeyEvents(&mainW, Qt::Key_M, 'm');
QCOMPARE(currentResult, Slot1Triggered);
currentResult = NoResult;
- sendKeyEvents(Qt::SHIFT+Qt::Key_M, 'M');
+ sendKeyEvents(&mainW, shiftM, 'M');
QCOMPARE(currentResult, Slot1Triggered);
cut2->setEnabled(false);
@@ -651,11 +659,11 @@ void tst_QShortcut::disabledItems()
Shift + Qt::Key_M on slot2
*/
currentResult = NoResult;
- sendKeyEvents( Qt::Key_M, 'm' );
+ sendKeyEvents(&mainW, Qt::Key_M, 'm' );
QCOMPARE( currentResult, Slot1Triggered );
currentResult = NoResult;
- sendKeyEvents( Qt::SHIFT+Qt::Key_M, 'M' );
+ sendKeyEvents(&mainW, shiftM, 'M' );
QCOMPARE( currentResult, Slot2Triggered );
@@ -663,67 +671,34 @@ void tst_QShortcut::disabledItems()
Qt::Key_F5 on slot1
Shift + Qt::Key_F5 on slot2 (disabled)
*/
- clearAllShortcuts();
- cut1 = setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, "F5");
- cut4 = setupShortcut(&pb2, "shortcut4-pb2", TriggerSlot2, "Shift+F5");
-
- cut1->setKey(QKeySequence("F5"));
- cut4->setKey(QKeySequence("Shift+F5"));
+ qDeleteAll(mainW.findChildren<QShortcut *>());
+ const int shiftF5 = Qt::SHIFT + Qt::Key_F5;
+ cut1 = setupShortcut(pb1, "shortcut1-pb1", TriggerSlot1, QKeySequence(Qt::Key_F5));
+ cut4 = setupShortcut(pb2, "shortcut4-pb2", TriggerSlot2, QKeySequence(shiftF5));
cut1->setEnabled(true);
cut4->setEnabled(false);
currentResult = NoResult;
- sendKeyEvents( Qt::Key_F5, 0 );
+ sendKeyEvents(&mainW, Qt::Key_F5, 0 );
QCOMPARE( currentResult, Slot1Triggered );
currentResult = NoResult;
- sendKeyEvents( Qt::SHIFT+Qt::Key_F5, 0 );
- QCOMPARE( currentResult, NoResult );
-
-#if 0
- qFatal("Not testing statusbar text feedback yet, since not implemented");
- /* Testing Disabled Accel, and the corresponding statusbar feedback
- Ctrl + Qt::Key_K, Ctrl + Qt::Key_L on slot1
- Ctrl + Qt::Key_K, Ctrl + Qt::Key_M on slot2 (disabled)
- */
- cut1->setKey(QKeySequence("Ctrl+K, Ctrl+L"));
- cut4->setKey(QKeySequence("Ctrl+K, Ctrl+M"));
-
- cut1->setEnabled(true);
- cut4->setEnabled(false);
-
- currentResult = NoResult;
- sendKeyEvents( Qt::CTRL+Qt::Key_K, 0 );
- sendKeyEvents( Qt::CTRL+Qt::Key_Q, 0 );
- QCOMPARE( currentResult, NoResult );
- if (over_330)
- QCOMPARE( sbText, QString("Ctrl+K, Ctrl+Q not defined") );
-
- currentResult = NoResult;
- sendKeyEvents( Qt::CTRL+Qt::Key_K, 0 );
- sendKeyEvents( Qt::CTRL+Qt::Key_M, 0 );
+ sendKeyEvents(&mainW, shiftF5, 0 );
QCOMPARE( currentResult, NoResult );
- if (over_330)
- QCOMPARE( sbText, QString() );
-
- currentResult = NoResult;
- sendKeyEvents( Qt::CTRL+Qt::Key_K, 0 );
- sendKeyEvents( Qt::CTRL+Qt::Key_L, 0 );
- QCOMPARE( currentResult, Slot1Triggered );
- if (over_330)
- QCOMPARE( sbText, QString() );
-#endif
- clearAllShortcuts();
- cut1 = 0;
- cut4 = 0;
}
// ------------------------------------------------------------------
// Ambiguous Elements -----------------------------------------------
// ------------------------------------------------------------------
void tst_QShortcut::ambiguousRotation()
{
- clearAllShortcuts();
+ MainWindow mainW;
+ const QString name = QLatin1String(QTest::currentTestFunction());
+ mainW.setWindowTitle(name);
+ mainW.show();
+ mainW.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&mainW));
+
/* Testing Shortcut rotation scheme
Ctrl + Qt::Key_A on slot1 (disabled)
Ctrl + Qt::Key_A on slot2 (disabled)
@@ -733,13 +708,15 @@ void tst_QShortcut::ambiguousRotation()
Ctrl + Qt::Key_A on slot6
Ctrl + Qt::Key_A on slot7 (disabled)
*/
- QShortcut *cut1 = setupShortcut(TriggerSlot1, "Ctrl+A");
- QShortcut *cut2 = setupShortcut(TriggerSlot2, "Ctrl+A");
- QShortcut *cut3 = setupShortcut(TriggerSlot3, "Ctrl+A");
- QShortcut *cut4 = setupShortcut(TriggerSlot4, "Ctrl+A");
- QShortcut *cut5 = setupShortcut(TriggerSlot5, "Ctrl+A");
- QShortcut *cut6 = setupShortcut(TriggerSlot6, "Ctrl+A");
- QShortcut *cut7 = setupShortcut(TriggerSlot7, "Ctrl+A");
+ const int ctrlA = Qt::CTRL + Qt::Key_A;
+ QKeySequence ctrlA_Sequence(ctrlA);
+ QShortcut *cut1 = setupShortcut(&mainW, name, TriggerSlot1, ctrlA_Sequence);
+ QShortcut *cut2 = setupShortcut(&mainW, name, TriggerSlot2, ctrlA_Sequence);
+ QShortcut *cut3 = setupShortcut(&mainW, name, TriggerSlot3, ctrlA_Sequence);
+ QShortcut *cut4 = setupShortcut(&mainW, name, TriggerSlot4, ctrlA_Sequence);
+ QShortcut *cut5 = setupShortcut(&mainW, name, TriggerSlot5, ctrlA_Sequence);
+ QShortcut *cut6 = setupShortcut(&mainW, name, TriggerSlot6, ctrlA_Sequence);
+ QShortcut *cut7 = setupShortcut(&mainW, name, TriggerSlot7, ctrlA_Sequence);
cut1->setEnabled(false);
cut2->setEnabled(false);
@@ -753,37 +730,37 @@ void tst_QShortcut::ambiguousRotation()
// Continue...
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot3Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot4Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot6Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot3Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot4Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot6Triggered);
@@ -808,94 +785,87 @@ void tst_QShortcut::ambiguousRotation()
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot1Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot2Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot5Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot7Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot1Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot2Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot5Triggered);
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(Qt::CTRL+Qt::Key_A);
+ sendKeyEvents(&mainW, ctrlA);
QCOMPARE(currentResult, Ambiguous);
QCOMPARE(ambigResult, Slot7Triggered);
-
- clearAllShortcuts();
- cut1 = 0; cut2 = 0;
- cut3 = 0; cut4 = 0;
- cut5 = 0; cut6 = 0;
- cut7 = 0;
}
void tst_QShortcut::ambiguousItems()
{
- clearAllShortcuts();
+ ButtonWidget mainW;
+ mainW.setWindowTitle(QTest::currentTestFunction());
+ mainW.show();
+ mainW.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&mainW));
+
/* Testing Ambiguous Shortcuts
Qt::Key_M on Pushbutton 1
Qt::Key_M on Pushbutton 2
*/
// Setup two identical shortcuts on different pushbuttons
- QPushButton pb1(mainW);
- QPushButton pb2(mainW);
- pb1.setObjectName("pushbutton-1");
- pb2.setObjectName("pushbutton-2");
- pb1.show(); // Must be show for QShortcutMap::correctSubWindow to trigger
- pb2.show();
+ auto pb1 = mainW.pushButton1();
+ auto pb2 = mainW.pushButton2();
- setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, "M");
- setupShortcut(&pb1, "shortcut2-pb2", TriggerSlot2, "M");
+ setupShortcut(pb1, "shortcut1-pb1", TriggerSlot1, QKeySequence(Qt::Key_M));
+ setupShortcut(pb2, "shortcut2-pb2", TriggerSlot2, QKeySequence(Qt::Key_M));
currentResult = NoResult;
- sendKeyEvents( Qt::Key_M, 'm' );
+ sendKeyEvents(&mainW, Qt::Key_M, 'm' );
QCOMPARE( currentResult, Ambiguous );
QCOMPARE( ambigResult, Slot1Triggered );
currentResult = NoResult;
- sendKeyEvents( Qt::Key_M, 'm' );
+ sendKeyEvents(&mainW, Qt::Key_M, 'm' );
QCOMPARE( currentResult, Ambiguous );
QCOMPARE( ambigResult, Slot2Triggered );
currentResult = NoResult;
- sendKeyEvents( Qt::Key_M, 'm' );
+ sendKeyEvents(&mainW, Qt::Key_M, 'm' );
QCOMPARE( currentResult, Ambiguous );
QCOMPARE( ambigResult, Slot1Triggered );
-
- clearAllShortcuts();
}
@@ -904,32 +874,31 @@ void tst_QShortcut::ambiguousItems()
// ------------------------------------------------------------------
void tst_QShortcut::unicodeCompare()
{
- clearAllShortcuts();
+ ButtonWidget mainW;
+ mainW.setWindowTitle(QTest::currentTestFunction());
+ mainW.show();
+ mainW.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&mainW));
+
/* Testing Unicode/non-Unicode Shortcuts
Qt::Key_M on Pushbutton 1
Qt::Key_M on Pushbutton 2
*/
- QPushButton pb1(mainW);
- QPushButton pb2(mainW);
- pb1.setObjectName("pushbutton-1");
- pb2.setObjectName("pushbutton-2");
- pb1.show(); // Must be show for QShortcutMap::correctSubWindow to trigger
- pb2.show();
+ auto pb1 = mainW.pushButton1();
+ auto pb2 = mainW.pushButton2();
QKeySequence ks1("Ctrl+M"); // Unicode
QKeySequence ks2(Qt::CTRL+Qt::Key_M); // non-Unicode
- setupShortcut(&pb1, "shortcut1-pb1", TriggerSlot1, ks1);
- setupShortcut(&pb1, "shortcut2-pb2", TriggerSlot2, ks2);
+ setupShortcut(pb1, "shortcut1-pb1", TriggerSlot1, ks1);
+ setupShortcut(pb2, "shortcut2-pb2", TriggerSlot2, ks2);
currentResult = NoResult;
- sendKeyEvents( Qt::CTRL+Qt::Key_M, 0 );
+ sendKeyEvents(&mainW, Qt::CTRL + Qt::Key_M, 0);
QCOMPARE( currentResult, Ambiguous );
// They _are_ ambiguous, so the QKeySequence operator==
// should indicate the same
QVERIFY( ks1 == ks2 );
QVERIFY( !(ks1 != ks2) );
-
- clearAllShortcuts();
}
// ------------------------------------------------------------------
@@ -937,25 +906,29 @@ void tst_QShortcut::unicodeCompare()
// ------------------------------------------------------------------
void tst_QShortcut::keypressConsumption()
{
- clearAllShortcuts();
- edit->clear();
- QCOMPARE(edit->toPlainText().size(), 0);
+ MainWindow mainW;
+ mainW.setWindowTitle(QTest::currentTestFunction());
+ mainW.show();
+ mainW.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&mainW));
+ auto edit = mainW.testEdit();
- QShortcut *cut1 = setupShortcut(edit, "shortcut1-line", TriggerSlot1, "Ctrl+I, A");
- QShortcut *cut2 = setupShortcut(edit, "shortcut1-line", TriggerSlot2, "Ctrl+I, B");
+ const int ctrlI = Qt::CTRL + Qt::Key_I;
+ QShortcut *cut1 = setupShortcut(edit, "shortcut1-line", TriggerSlot1, QKeySequence(ctrlI, Qt::Key_A));
+ QShortcut *cut2 = setupShortcut(edit, "shortcut1-line", TriggerSlot2, QKeySequence(ctrlI, Qt::Key_B));
currentResult = NoResult;
ambigResult = NoResult;
- sendKeyEvents(edit, Qt::CTRL + Qt::Key_I, 0); // Send key to edit
+ sendKeyEvents(edit, ctrlI, 0); // Send key to edit
QCOMPARE( currentResult, NoResult );
QCOMPARE( ambigResult, NoResult );
- QCOMPARE(edit->toPlainText(), QString(""));
+ QCOMPARE(edit->toPlainText(), QString());
// Make sure next keypress is eaten (failing multiple keysequence)
sendKeyEvents(edit, Qt::Key_C, 'c'); // Send key to edit
QCOMPARE( currentResult, NoResult );
QCOMPARE( ambigResult, NoResult );
- QCOMPARE(edit->toPlainText(), QString(""));
+ QCOMPARE(edit->toPlainText(), QString());
// Next keypress should be normal
sendKeyEvents(edit, Qt::Key_C, 'c'); // Send key to edit
@@ -983,11 +956,15 @@ void tst_QShortcut::keypressConsumption()
QCOMPARE( ambigResult, NoResult );
QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>a"));
- clearAllShortcuts();
+ qDeleteAll(mainW.findChildren<QShortcut *>());
edit->clear();
QCOMPARE(edit->toPlainText().size(), 0);
- setupShortcut(edit, "first", SendKeyEvent, "Ctrl+A");
+ auto cut = setupShortcut(edit, QLatin1String("first"), QKeySequence(Qt::CTRL + Qt::Key_A));
+ connect(cut, &QShortcut::activated, edit, [this, edit] () {
+ this->sendKeyEvents(edit, Qt::CTRL + Qt::Key_B, 0);
+ this->currentResult = tst_QShortcut::SentKeyEvent;
+ });
// Verify reentrancy when a non-shortcut is triggered as part
// of shortcut processing.
@@ -996,7 +973,7 @@ void tst_QShortcut::keypressConsumption()
sendKeyEvents(edit, Qt::CTRL + Qt::Key_A, 0);
QCOMPARE(currentResult, SentKeyEvent);
QCOMPARE(ambigResult, NoResult);
- QCOMPARE(edit->toPlainText(), QString(QString("<Ctrl+B>")));
+ QCOMPARE(edit->toPlainText(), QLatin1String("<Ctrl+B>"));
}
// ------------------------------------------------------------------
@@ -1004,12 +981,17 @@ void tst_QShortcut::keypressConsumption()
// ------------------------------------------------------------------
void tst_QShortcut::context()
{
- clearAllShortcuts();
+ const QString name = QLatin1String(QTest::currentTestFunction());
+ MainWindow mainW;
+ mainW.setWindowTitle(name + QLatin1String("_Helper"));
+ mainW.show();
+ auto edit = mainW.testEdit();
QWidget myBox;
- TestEdit *other1 = new TestEdit(&myBox, "test_edit_other1");
- TestEdit *other2 = new TestEdit(&myBox, "test_edit_other2");
- QHBoxLayout *layout = new QHBoxLayout(&myBox);
+ myBox.setWindowTitle(name);
+ auto other1 = new TestEdit(&myBox, "test_edit_other1");
+ auto other2 = new TestEdit(&myBox, "test_edit_other2");
+ auto layout = new QHBoxLayout(&myBox);
layout->addWidget(other1);
layout->addWidget(other2);
myBox.show();
@@ -1034,8 +1016,8 @@ void tst_QShortcut::context()
// Focus on 'other1' edit, so Active Window context should trigger
other1->activateWindow(); // <---
QApplication::setActiveWindow(other1);
- QCOMPARE(qApp->activeWindow(), other1->window());
- QCOMPARE(qApp->focusWidget(), (QWidget *)other1);
+ QCOMPARE(QApplication::activeWindow(), other1->window());
+ QCOMPARE(QApplication::focusWidget(), static_cast<QWidget *>(other1));
currentResult = NoResult;
ambigResult = NoResult;
@@ -1043,13 +1025,13 @@ void tst_QShortcut::context()
other1->clear();
other2->clear();
- QCOMPARE(qApp->focusWidget(), (QWidget *)other1);
+ QCOMPARE(QApplication::focusWidget(), static_cast<QWidget *>(other1));
sendKeyEvents(other1, Qt::ALT+Qt::Key_1);
QCOMPARE(currentResult, Slot1Triggered);
QCOMPARE(ambigResult, NoResult);
- QCOMPARE(edit->toPlainText(), QString(""));
- QCOMPARE(other1->toPlainText(), QString(""));
- QCOMPARE(other2->toPlainText(), QString(""));
+ QCOMPARE(edit->toPlainText(), QString());
+ QCOMPARE(other1->toPlainText(), QString());
+ QCOMPARE(other2->toPlainText(), QString());
// ..but not Focus context on 'other2'..
currentResult = NoResult;
@@ -1061,9 +1043,9 @@ void tst_QShortcut::context()
sendKeyEvents(other1, Qt::ALT+Qt::Key_2);
QCOMPARE(currentResult, NoResult);
QCOMPARE(ambigResult, NoResult);
- QCOMPARE(edit->toPlainText(), QString(""));
+ QCOMPARE(edit->toPlainText(), QString());
QCOMPARE(other1->toPlainText(), QString("<Alt+2>"));
- QCOMPARE(other2->toPlainText(), QString(""));
+ QCOMPARE(other2->toPlainText(), QString());
// ..however, application global context on 'edit' should..
currentResult = NoResult;
@@ -1075,15 +1057,15 @@ void tst_QShortcut::context()
sendKeyEvents(other1, Qt::ALT+Qt::Key_3);
QCOMPARE(currentResult, Slot3Triggered);
QCOMPARE(ambigResult, NoResult);
- QCOMPARE(edit->toPlainText(), QString(""));
- QCOMPARE(other1->toPlainText(), QString(""));
- QCOMPARE(other2->toPlainText(), QString(""));
+ QCOMPARE(edit->toPlainText(), QString());
+ QCOMPARE(other1->toPlainText(), QString());
+ QCOMPARE(other2->toPlainText(), QString());
// Changing focus to 'other2' should make the Focus context there work
other2->activateWindow();
other2->setFocus(); // ###
- QTRY_COMPARE(qApp->activeWindow(), other2->window());
- QCOMPARE(qApp->focusWidget(), (QWidget *)other2);
+ QTRY_COMPARE(QApplication::activeWindow(), other2->window());
+ QCOMPARE(QApplication::focusWidget(), static_cast<QWidget *>(other2));
currentResult = NoResult;
ambigResult = NoResult;
@@ -1094,20 +1076,18 @@ void tst_QShortcut::context()
sendKeyEvents(other2, Qt::ALT+Qt::Key_2);
QCOMPARE(currentResult, Slot2Triggered);
QCOMPARE(ambigResult, NoResult);
- QCOMPARE(edit->toPlainText(), QString(""));
- QCOMPARE(other1->toPlainText(), QString(""));
- QCOMPARE(other2->toPlainText(), QString(""));
-
- clearAllShortcuts();
+ QCOMPARE(edit->toPlainText(), QString());
+ QCOMPARE(other1->toPlainText(), QString());
+ QCOMPARE(other2->toPlainText(), QString());
}
// QTBUG-38986, do not generate duplicated QEvent::ShortcutOverride in event processing.
class OverrideCountingWidget : public QWidget
{
public:
- OverrideCountingWidget(QWidget *parent = 0) : QWidget(parent), overrideCount(0) {}
+ using QWidget::QWidget;
- int overrideCount;
+ int overrideCount = 0;
bool event(QEvent *e) override
{
@@ -1131,95 +1111,55 @@ void tst_QShortcut::duplicatedShortcutOverride()
QCOMPARE(w.overrideCount, 1);
}
-// ------------------------------------------------------------------
-// Element Testing helper functions ---------------------------------
-// ------------------------------------------------------------------
-void tst_QShortcut::clearAllShortcuts()
-{
- QList<QShortcut *> shortcutsCpy = shortcuts;
- qDeleteAll(shortcutsCpy);
- shortcuts.clear();
-}
-
-QShortcut *tst_QShortcut::setupShortcut(int testWidget, const QKeySequence &ks)
-{
- return setupShortcut(mainW, QTest::currentDataTag() ? QTest::currentDataTag() : "", testWidget, ks);
-}
-
-QShortcut *tst_QShortcut::setupShortcut(int testWidget, const QString &txt, int k1, int k2, int k3, int k4)
-{
- return setupShortcut(mainW, QTest::currentDataTag() ? QTest::currentDataTag() : "", testWidget,
- (txt.isEmpty() ? QKeySequence(k1, k2, k3, k4) : QKeySequence(txt)));
-}
-
-QShortcut *tst_QShortcut::setupShortcut(QWidget *parent, const char *name, int testWidget, const QString &txt, int k1, int k2, int k3, int k4)
+QShortcut *tst_QShortcut::setupShortcut(QWidget *parent, const QString &name, const QKeySequence &ks, Qt::ShortcutContext context)
{
- return setupShortcut(parent, name, testWidget,
- (txt.isEmpty() ? QKeySequence(k1, k2, k3, k4) : QKeySequence(txt)));
+ // Set up shortcut for next test
+ auto cut = new QShortcut(ks, parent, nullptr, nullptr, context);
+ cut->setObjectName(name);
+ return cut;
}
-QShortcut *tst_QShortcut::setupShortcut(QWidget *parent, const char *name, int testWidget,
+QShortcut *tst_QShortcut::setupShortcut(QWidget *parent, const QString &name, Widget testWidget,
const QKeySequence &ks, Qt::ShortcutContext context)
{
// Set up shortcut for next test
- QShortcut *cut = new QShortcut(QKeySequence(), parent, 0, 0, context);
- cut->setObjectName(name);
- cut->setKey(ks);
+ auto cut = setupShortcut(parent, name, ks, context);
- const char *normal = 0;
- const char *ambig = 0;
- switch(testWidget)
- {
+ switch (testWidget) {
case TriggerSlot1:
- normal = SLOT(slotTrig1());
- ambig = SLOT(ambigSlot1());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig1);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot1);
break;
case TriggerSlot2:
- normal = SLOT(slotTrig2());
- ambig = SLOT(ambigSlot2());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig2);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot2);
break;
case TriggerSlot3:
- normal = SLOT(slotTrig3());
- ambig = SLOT(ambigSlot3());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig3);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot3);
break;
case TriggerSlot4:
- normal = SLOT(slotTrig4());
- ambig = SLOT(ambigSlot4());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig4);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot4);
break;
case TriggerSlot5:
- normal = SLOT(slotTrig5());
- ambig = SLOT(ambigSlot5());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig5);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot5);
break;
case TriggerSlot6:
- normal = SLOT(slotTrig6());
- ambig = SLOT(ambigSlot6());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig6);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot6);
break;
case TriggerSlot7:
- normal = SLOT(slotTrig7());
- ambig = SLOT(ambigSlot7());
+ connect(cut, &QShortcut::activated, this, &tst_QShortcut::slotTrig7);
+ connect(cut, &QShortcut::activatedAmbiguously, this, &tst_QShortcut::ambigSlot7);
+ break;
+ case NoWidget:
break;
- case SendKeyEvent:
- normal = SLOT(sendKeyEvent());
}
- connect(cut, SIGNAL(activated()), this, normal);
- if (ambig)
- connect(cut, SIGNAL(activatedAmbiguously()), this, ambig);
- connect(cut, SIGNAL(destroyed(QObject*)), this, SLOT(shortcutDestroyed(QObject*)));
- shortcuts.append(cut);
return cut;
}
-void tst_QShortcut::shortcutDestroyed(QObject* obj)
-{
- shortcuts.erase(std::remove(shortcuts.begin(), shortcuts.end(), obj),
- shortcuts.end());
-}
-
-void tst_QShortcut::sendKeyEvents(int k1, QChar c1, int k2, QChar c2, int k3, QChar c3, int k4, QChar c4)
-{
- sendKeyEvents(mainW, k1, c1, k2, c2, k3, c3, k4, c4);
-}
-
void tst_QShortcut::sendKeyEvents(QWidget *w, int k1, QChar c1, int k2, QChar c2, int k3, QChar c3, int k4, QChar c4)
{
Qt::KeyboardModifiers b1 = toButtons( k1 );
@@ -1259,6 +1199,8 @@ void tst_QShortcut::sendKeyEvents(QWidget *w, int k1, QChar c1, int k2, QChar c2
void tst_QShortcut::testElement()
{
+ static QScopedPointer<MainWindow> mainW;
+
currentResult = NoResult;
QFETCH(tst_QShortcut::Action, action);
QFETCH(tst_QShortcut::Widget, testWidget);
@@ -1273,13 +1215,29 @@ void tst_QShortcut::testElement()
QFETCH(int, c4);
QFETCH(tst_QShortcut::Result, result);
- if (action == ClearAll) {
- clearAllShortcuts();
- } else if (action == SetupAccel) {
- setupShortcut(testWidget, txt, k1, k2, k3, k4);
- } else {
- sendKeyEvents(k1, c1, k2, c2, k3, c3, k4, c4);
- QCOMPARE((int)currentResult, (int)result);
+ if (mainW.isNull()) {
+ mainW.reset(new MainWindow);
+ mainW->setWindowTitle(QTest::currentTestFunction());
+ mainW->show();
+ mainW->activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(mainW.data()));
+ }
+
+ switch (action) {
+ case ClearAll:
+ qDeleteAll(mainW->findChildren<QShortcut *>());
+ break;
+ case SetupAccel:
+ setupShortcut(mainW.data(), txt, testWidget, txt.isEmpty()
+ ? QKeySequence(k1, k2, k3, k4) : QKeySequence::fromString(txt));
+ break;
+ case TestAccel:
+ sendKeyEvents(mainW.data(), k1, c1, k2, c2, k3, c3, k4, c4);
+ QCOMPARE(currentResult, result);
+ break;
+ case TestEnd:
+ mainW.reset();
+ break;
}
}
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 03bec4286b..26f9ce1b85 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -2,30 +2,31 @@
[normalGeometry]
ubuntu-16.04
[saveRestoreGeometry]
-xcb
+opensuse-leap
+ubuntu-16.04
b2qt
+opensuse-42.3
[restoreVersion1Geometry]
-osx
-[updateWhileMinimized]
ubuntu-16.04
+[updateWhileMinimized]
ubuntu-18.04
rhel-7.4
+ubuntu-16.04
rhel-7.6
-osx
[focusProxyAndInputMethods]
-linux
+rhel-7.6
+opensuse-leap
+ubuntu
[raise]
-# QTBUG-68175
-opensuse
opensuse-leap
-[setWindowGeometry]
-osx
-[windowMoveResize]
-osx
+# QTBUG-68175
+opensuse-42.3
[childEvents]
osx ci
[renderInvisible]
-osx
+osx-10.12
+osx-10.11
+osx-10.14
[optimizedResizeMove]
osx
[optimizedResize_topLevel]
@@ -40,12 +41,11 @@ opensuse
opensuse-leap
[moveInResizeEvent]
ubuntu-16.04
-[moveChild:right]
-osx
-[activateWindow]
-osx-10.12 ci
[multipleToplevelFocusCheck]
-linux
+rhel-7.6
+opensuse-leap
+ubuntu
[windowState]
# QTBUG-75270
winrt
+
diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro
index c1908af2a2..d3fbd6d0d9 100644
--- a/tests/auto/widgets/kernel/qwidget/qwidget.pro
+++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro
@@ -16,4 +16,4 @@ mac {
OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
}
-win32:!winrt: LIBS += -luser32 -lgdi32
+win32:!winrt: QMAKE_USE += user32 gdi32
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index ebf08883fd..882323ba4f 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -46,6 +46,7 @@
#include <qstylefactory.h>
#include <qdesktopwidget.h>
#include <private/qwidget_p.h>
+#include <private/qwidgetrepaintmanager_p.h>
#include <private/qapplication_p.h>
#include <private/qhighdpiscaling_p.h>
#include <qcalendarwidget.h>
@@ -54,6 +55,7 @@
#include <qrandom.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
+#include <QtCore/qoperatingsystemversion.h>
#include <QtGui/qpaintengine.h>
#include <QtGui/qbackingstore.h>
#include <QtGui/qguiapplication.h>
@@ -1138,6 +1140,7 @@ void tst_QWidget::visible()
QVERIFY( !childWidget->isVisible() );
testWidget->show();
+ QVERIFY(testWidget->screen());
QVERIFY( testWidget->isVisible() );
QVERIFY( childWidget->isVisible() );
@@ -2528,8 +2531,8 @@ void tst_QWidget::showMinimizedKeepsFocus()
{
if (m_platform == QStringLiteral("xcb"))
QSKIP("QTBUG-26424");
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported.");
if (m_platform == QStringLiteral("offscreen"))
QSKIP("Platform offscreen does not support showMinimized()");
@@ -2740,8 +2743,8 @@ void tst_QWidget::icon()
void tst_QWidget::hideWhenFocusWidgetIsChild()
{
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported.");
QScopedPointer<QWidget> testWidget(new QWidget);
testWidget->setWindowTitle(__FUNCTION__);
@@ -5381,7 +5384,7 @@ void tst_QWidget::moveChild()
parent.setStyle(style.data());
ColorWidget child(&parent, Qt::Widget, Qt::blue);
- parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()) + QPoint(50, 50),
+ parent.setGeometry(QRect(parent.screen()->availableGeometry().topLeft() + QPoint(50, 50),
QSize(200, 200)));
child.setGeometry(25, 25, 50, 50);
#ifndef QT_NO_CURSOR // Try to make sure the cursor is not in a taskbar area to prevent tooltips or window highlighting
@@ -5428,8 +5431,7 @@ void tst_QWidget::showAndMoveChild()
const QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("Windows")));
parent.setStyle(style.data());
- QDesktopWidget desktop;
- QRect desktopDimensions = desktop.availableGeometry(&parent);
+ QRect desktopDimensions = parent.screen()->availableGeometry();
desktopDimensions = desktopDimensions.adjusted(64, 64, -64, -64);
#ifndef QT_NO_CURSOR // Try to make sure the cursor is not in a taskbar area to prevent tooltips or window highlighting
@@ -5542,8 +5544,8 @@ void tst_QWidget::multipleToplevelFocusCheck()
QSKIP("QTBUG-52974");
#endif
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
else if (m_platform == QStringLiteral("winrt"))
QSKIP("Winrt: Sometimes crashes in QTextLayout. - QTBUG-68297");
TopLevelFocusCheck w1;
@@ -6257,7 +6259,11 @@ public:
return false;
}
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEvent(const QByteArray &eventType, void *message, qintptr *) override
+#else
bool nativeEvent(const QByteArray &eventType, void *message, long *) override
+#endif
{
if (isMapNotify(eventType, message))
gotExpectedMapNotify = true;
@@ -6265,7 +6271,11 @@ public:
}
// QAbstractNativeEventFilter interface
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *) override
+#else
bool nativeEventFilter(const QByteArray &eventType, void *message, long *) override
+#endif
{
if (isMapNotify(eventType, message))
gotExpectedGlobalEvent = true;
@@ -7096,7 +7106,7 @@ void tst_QWidget::renderWithPainter()
// Make sure QWidget::render does not modify the render hints set on the painter.
painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform
- | QPainter::NonCosmeticDefaultPen | QPainter::TextAntialiasing);
+ | QPainter::TextAntialiasing);
QPainter::RenderHints oldRenderHints = painter.renderHints();
widget.render(&painter);
QCOMPARE(painter.renderHints(), oldRenderHints);
@@ -7694,13 +7704,11 @@ void tst_QWidget::moveWindowInShowEvent()
void tst_QWidget::repaintWhenChildDeleted()
{
#ifdef Q_OS_WIN
- if (QSysInfo::WindowsVersion & QSysInfo::WV_VISTA) {
- QTest::qWait(1000);
- }
+ QTest::qWait(1000);
#endif
ColorWidget w(nullptr, Qt::FramelessWindowHint, Qt::red);
w.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
- QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
+ QPoint startPoint = w.screen()->availableGeometry().topLeft();
startPoint.rx() += 50;
startPoint.ry() += 50;
w.setGeometry(QRect(startPoint, QSize(100, 100)));
@@ -7725,7 +7733,7 @@ void tst_QWidget::hideOpaqueChildWhileHidden()
{
ColorWidget w(nullptr, Qt::FramelessWindowHint, Qt::red);
w.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
- QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft();
+ QPoint startPoint = w.screen()->availableGeometry().topLeft();
startPoint.rx() += 50;
startPoint.ry() += 50;
w.setGeometry(QRect(startPoint, QSize(100, 100)));
@@ -8065,7 +8073,7 @@ public:
sp.setHeightForWidth(hfwLayout);
QVBoxLayout *vbox = new QVBoxLayout;
- vbox->setMargin(0);
+ vbox->setContentsMargins(0, 0, 0, 0);
vbox->addWidget(new ASWidget(sizeHint + QSize(30, 20), sp, false, false));
setLayout(vbox);
}
@@ -8893,13 +8901,13 @@ void tst_QWidget::translucentWidget()
#ifdef Q_OS_WIN
QWidget *desktopWidget = QApplication::desktop()->screen(0);
- if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
- widgetSnapshot = grabWindow(desktopWidget->windowHandle(), labelPos.x(), labelPos.y(), label.width(), label.height());
- else
+ widgetSnapshot = grabWindow(desktopWidget->windowHandle(), labelPos.x(), labelPos.y(), label.width(), label.height());
+#else
+ widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
#endif
- widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
- const QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size());
+ QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size());
+ expected.setDevicePixelRatio(label.devicePixelRatioF());
if (m_platform == QStringLiteral("winrt"))
QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QCOMPARE(actual.size(),expected.size());
@@ -9556,7 +9564,7 @@ void tst_QWidget::destroyBackingStore()
QTRY_VERIFY(w.numPaintEvents > 0);
w.reset();
w.update();
- qt_widget_private(&w)->topData()->backingStoreTracker.create(&w);
+ qt_widget_private(&w)->topData()->repaintManager.reset(new QWidgetRepaintManager(&w));
w.update();
QApplication::processEvents();
@@ -9571,14 +9579,14 @@ void tst_QWidget::destroyBackingStore()
#endif // QT_BUILD_INTERNAL
// Helper function
-QWidgetBackingStore* backingStore(QWidget &widget)
+QWidgetRepaintManager* repaintManager(QWidget &widget)
{
- QWidgetBackingStore *backingStore = nullptr;
+ QWidgetRepaintManager *repaintManager = nullptr;
#ifdef QT_BUILD_INTERNAL
if (QTLWExtra *topExtra = qt_widget_private(&widget)->maybeTopData())
- backingStore = topExtra->backingStoreTracker.data();
+ repaintManager = topExtra->repaintManager.get();
#endif
- return backingStore;
+ return repaintManager;
}
// Tables of 5000 elements do not make sense on Windows Mobile.
@@ -9593,8 +9601,7 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
palette.setColor(QPalette::Window, Qt::red);
main.setPalette(palette);
- QDesktopWidget desktop;
- QRect desktopDimensions = desktop.availableGeometry(&main);
+ QRect desktopDimensions = main.screen()->availableGeometry();
QSize mainSize(400, 400);
mainSize = mainSize.boundedTo(desktopDimensions.size());
main.resize(mainSize);
@@ -9675,8 +9682,8 @@ void tst_QWidget::setGraphicsEffect()
void tst_QWidget::activateWindow()
{
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported.");
// Test case for QTBUG-26711
@@ -9744,8 +9751,8 @@ void tst_QWidget::openModal_taskQTBUG_5804()
void tst_QWidget::focusProxyAndInputMethods()
{
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported.");
QScopedPointer<QWidget> toplevel(new QWidget(nullptr, Qt::X11BypassWindowManagerHint));
toplevel->setWindowTitle(QLatin1String(QTest::currentTestFunction()));
toplevel->resize(200, 200);
@@ -9776,12 +9783,12 @@ class scrollWidgetWBS : public QWidget
public:
void deleteBackingStore()
{
- static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStoreTracker.destroy();
+ static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->repaintManager.reset(nullptr);
}
void enableBackingStore()
{
- if (!static_cast<QWidgetPrivate*>(d_ptr.data())->maybeBackingStore()) {
- static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStoreTracker.create(this);
+ if (!static_cast<QWidgetPrivate*>(d_ptr.data())->maybeRepaintManager()) {
+ static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->repaintManager.reset(new QWidgetRepaintManager(this));
static_cast<QWidgetPrivate*>(d_ptr.data())->invalidateBackingStore(this->rect());
repaint();
}
@@ -10112,7 +10119,7 @@ void tst_QWidget::grabMouse()
w.setObjectName(QLatin1String("tst_qwidget_grabMouse"));
w.setWindowTitle(w.objectName());
QLayout *layout = new QVBoxLayout(&w);
- layout->setMargin(50);
+ layout->setContentsMargins(50, 50, 50, 50);
GrabLoggerWidget *grabber = new GrabLoggerWidget(&log, &w);
const QString grabberObjectName = QLatin1String("tst_qwidget_grabMouse_grabber");
grabber->setObjectName(grabberObjectName);
diff --git a/tests/auto/widgets/kernel/qwidget_window/BLACKLIST b/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
index 934f2e8025..39d7b695f6 100644
--- a/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
@@ -2,7 +2,7 @@
# QTBUG-66345
opensuse-42.3
ubuntu-16.04
-ubuntu-18.04
[setWindowState]
ubuntu-18.04
-rhel
+rhel-7.6
+
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/button.png b/tests/auto/widgets/styles/qstyle/images/mac/button.png
deleted file mode 100644
index 7b11325e87..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/button.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/combobox.png b/tests/auto/widgets/styles/qstyle/images/mac/combobox.png
deleted file mode 100644
index ded0b11f29..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/combobox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/lineedit.png b/tests/auto/widgets/styles/qstyle/images/mac/lineedit.png
deleted file mode 100644
index 8d2861b65b..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/lineedit.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/mdi.png b/tests/auto/widgets/styles/qstyle/images/mac/mdi.png
deleted file mode 100644
index 8c09ae4338..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/mdi.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/menu.png b/tests/auto/widgets/styles/qstyle/images/mac/menu.png
deleted file mode 100644
index 5dd9111d69..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/menu.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/radiobutton.png b/tests/auto/widgets/styles/qstyle/images/mac/radiobutton.png
deleted file mode 100644
index 8828e220a2..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/radiobutton.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/slider.png b/tests/auto/widgets/styles/qstyle/images/mac/slider.png
deleted file mode 100644
index fc65035631..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/slider.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/mac/spinbox.png b/tests/auto/widgets/styles/qstyle/images/mac/spinbox.png
deleted file mode 100644
index ee88441ecb..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/mac/spinbox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/button.png b/tests/auto/widgets/styles/qstyle/images/vista/button.png
deleted file mode 100644
index a6c45276ca..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/button.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/combobox.png b/tests/auto/widgets/styles/qstyle/images/vista/combobox.png
deleted file mode 100644
index 9b82f64d32..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/combobox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/lineedit.png b/tests/auto/widgets/styles/qstyle/images/vista/lineedit.png
deleted file mode 100644
index b2c6ac1ae4..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/lineedit.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/menu.png b/tests/auto/widgets/styles/qstyle/images/vista/menu.png
deleted file mode 100644
index b114099cc3..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/menu.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/radiobutton.png b/tests/auto/widgets/styles/qstyle/images/vista/radiobutton.png
deleted file mode 100644
index c8aa7864df..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/radiobutton.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/slider.png b/tests/auto/widgets/styles/qstyle/images/vista/slider.png
deleted file mode 100644
index 7c156ded9d..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/slider.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/images/vista/spinbox.png b/tests/auto/widgets/styles/qstyle/images/vista/spinbox.png
deleted file mode 100644
index b8d0823ab2..0000000000
--- a/tests/auto/widgets/styles/qstyle/images/vista/spinbox.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro
index 9ad0940245..4dc0525c49 100644
--- a/tests/auto/widgets/styles/qstyle/qstyle.pro
+++ b/tests/auto/widgets/styles/qstyle/qstyle.pro
@@ -2,8 +2,3 @@ CONFIG += testcase
TARGET = tst_qstyle
QT += widgets testlib testlib-private
SOURCES += tst_qstyle.cpp
-
-android:!android-embedded {
- RESOURCES += \
- testdata.qrc
-}
diff --git a/tests/auto/widgets/styles/qstyle/testdata.qrc b/tests/auto/widgets/styles/qstyle/testdata.qrc
deleted file mode 100644
index 29bb46726e..0000000000
--- a/tests/auto/widgets/styles/qstyle/testdata.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>images/mac/button.png</file>
- <file>images/mac/combobox.png</file>
- <file>images/mac/lineedit.png</file>
- <file>images/mac/mdi.png</file>
- <file>images/mac/menu.png</file>
- <file>images/mac/radiobutton.png</file>
- <file>images/mac/slider.png</file>
- <file>images/mac/spinbox.png</file>
- <file>images/vista/button.png</file>
- <file>images/vista/combobox.png</file>
- <file>images/vista/lineedit.png</file>
- <file>images/vista/menu.png</file>
- <file>images/vista/radiobutton.png</file>
- <file>images/vista/slider.png</file>
- <file>images/vista/spinbox.png</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index a552c91928..ae084310b1 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -73,7 +73,6 @@ public:
private:
bool testAllFunctions(QStyle *);
bool testScrollBarSubControls();
- void testPainting(QStyle *style, const QString &platform);
private slots:
void drawItemPixmap();
void init();
@@ -333,138 +332,15 @@ void tst_QStyle::testWindowsStyle()
delete wstyle;
}
-void writeImage(const QString &fileName, QImage image)
-{
- QImageWriter imageWriter(fileName);
- imageWriter.setFormat("png");
- qDebug() << "result " << imageWriter.write(image);
-}
-
-QImage readImage(const QString &fileName)
-{
- QImageReader reader(fileName);
- return reader.read();
-}
-
-
#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) && !defined(Q_OS_WINRT)
void tst_QStyle::testWindowsVistaStyle()
{
QStyle *vistastyle = QStyleFactory::create("WindowsVista");
QVERIFY(testAllFunctions(vistastyle));
-
- if (QSysInfo::WindowsVersion == QSysInfo::WV_VISTA)
- testPainting(vistastyle, "vista");
delete vistastyle;
}
#endif
-void comparePixmap(const QString &filename, const QPixmap &pixmap)
-{
- QImage oldFile = readImage(filename);
- QPixmap oldPixmap = QPixmap::fromImage(oldFile);
- if (!oldFile.isNull())
- QCOMPARE(pixmap, oldPixmap);
- else
- writeImage(filename, pixmap.toImage());
-}
-
-void tst_QStyle::testPainting(QStyle *style, const QString &platform)
-{
-qDebug("TEST PAINTING");
- //Test Menu
- QString fileName = "images/" + platform + "/menu.png";
- QMenu menu;
- menu.setStyle(style);
- menu.show();
- menu.addAction(new QAction("Test 1", &menu));
- menu.addAction(new QAction("Test 2", &menu));
- QPixmap pixmap = menu.grab();
- comparePixmap(fileName, pixmap);
-
- //Push button
- fileName = "images/" + platform + "/button.png";
- QPushButton button("OK");
- button.setStyle(style);
- button.show();
- pixmap = button.grab();
- button.hide();
- comparePixmap(fileName, pixmap);
-
- //Push button
- fileName = "images/" + platform + "/radiobutton.png";
- QRadioButton radiobutton("Check");
- radiobutton.setStyle(style);
- radiobutton.show();
- pixmap = radiobutton.grab();
- radiobutton.hide();
- comparePixmap(fileName, pixmap);
-
- //Combo box
- fileName = "images/" + platform + "/combobox.png";
- QComboBox combobox;
- combobox.setStyle(style);
- combobox.addItem("Test 1");
- combobox.addItem("Test 2");
- combobox.show();
- pixmap = combobox.grab();
- combobox.hide();
- comparePixmap(fileName, pixmap);
-
- //Spin box
- fileName = "images/" + platform + "/spinbox.png";
- QDoubleSpinBox spinbox;
- spinbox.setLocale(QLocale(QLocale::English, QLocale::UnitedStates));
- spinbox.setStyle(style);
- spinbox.show();
- pixmap = spinbox.grab();
- spinbox.hide();
- comparePixmap(fileName, pixmap);
- QLocale::setDefault(QLocale::system());
-
- //Slider
- fileName = "images/" + platform + "/slider.png";
- QSlider slider;
- slider.setStyle(style);
- slider.show();
- pixmap = slider.grab();
- slider.hide();
- comparePixmap(fileName, pixmap);
-
- //Line edit
- fileName = "images/" + platform + "/lineedit.png";
- QLineEdit lineedit("Test text");
- lineedit.setStyle(style);
- lineedit.show();
- pixmap = lineedit.grab();
- lineedit.hide();
- comparePixmap(fileName, pixmap);
-
- //MDI
- fileName = "images/" + platform + "/mdi.png";
- QMdiArea mdiArea;
- mdiArea.addSubWindow(new QWidget(&mdiArea));
- mdiArea.resize(200, 200);
- mdiArea.setStyle(style);
- mdiArea.show();
- pixmap = mdiArea.grab();
- mdiArea.hide();
- comparePixmap(fileName, pixmap);
-
- // QToolButton
- fileName = "images/" + platform + "/toolbutton.png";
- QToolButton tb;
- tb.setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
- tb.setText("AaQqPpXx");
- tb.setIcon(style->standardPixmap(QStyle::SP_DirHomeIcon));
- tb.setStyle(style);
- tb.show();
- pixmap = tb.grab();
- tb.hide();
- comparePixmap(fileName, pixmap);
-
-}
-
#ifdef Q_OS_MAC
void tst_QStyle::testMacStyle()
{
diff --git a/tests/auto/widgets/util/qcompleter/BLACKLIST b/tests/auto/widgets/util/qcompleter/BLACKLIST
index fdc424b6ac..367270fdf2 100644
--- a/tests/auto/widgets/util/qcompleter/BLACKLIST
+++ b/tests/auto/widgets/util/qcompleter/BLACKLIST
@@ -1,2 +1,6 @@
[QTBUG_14292_filesystem]
-linux
+ubuntu-16.04
+opensuse-leap
+rhel-7.4
+rhel-6.6
+opensuse-42.3
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index 5a51f15008..27ae41fc4f 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -1765,7 +1765,7 @@ void tst_QCompleter::QTBUG_52028_tabAutoCompletes()
auto le = new QLineEdit;
w.layout()->addWidget(le);
- const auto pos = QApplication::desktop()->availableGeometry(&w).topLeft() + QPoint(200,200);
+ const auto pos = w.screen()->availableGeometry().topLeft() + QPoint(200,200);
w.move(pos);
w.show();
QApplication::setActiveWindow(&w);
@@ -1806,7 +1806,7 @@ void tst_QCompleter::QTBUG_51889_activatedSentTwice()
w.layout()->addWidget(new QLineEdit);
- const auto pos = QApplication::desktop()->availableGeometry(&w).topLeft() + QPoint(200,200);
+ const auto pos = w.screen()->availableGeometry().topLeft() + QPoint(200,200);
w.move(pos);
w.show();
QApplication::setActiveWindow(&w);
diff --git a/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp b/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
index 007825d39c..a17a9f6c33 100644
--- a/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
@@ -124,13 +124,19 @@ void tst_QAbstractScrollArea::scrollBarWidgets()
QCOMPARE(area.scrollBarWidgets(Qt::AlignTop), QWidgetList());
QCOMPARE(area.scrollBarWidgets(Qt::AlignBottom), w2List);
+ auto sort = [](const QWidgetList l) {
+ QWidgetList list = l;
+ std::sort(list.begin(), list.end());
+ return list;
+ };
+
// two widgets at Bottom.
area.addScrollBarWidget(w3, Qt::AlignBottom);
- QCOMPARE(area.scrollBarWidgets(all).toSet(), allList.toSet());
+ QCOMPARE(sort(area.scrollBarWidgets(all)), sort(allList));
QCOMPARE(area.scrollBarWidgets(Qt::AlignLeft), w1List);
QCOMPARE(area.scrollBarWidgets(Qt::AlignRight), QWidgetList());
QCOMPARE(area.scrollBarWidgets(Qt::AlignTop), QWidgetList());
- QCOMPARE(area.scrollBarWidgets(Qt::AlignBottom).toSet(), (w2List + w3List).toSet());
+ QCOMPARE(sort(area.scrollBarWidgets(Qt::AlignBottom)), sort(w2List + w3List));
//delete
delete w1;
diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
index 1a0d7a9289..f77efe036a 100644
--- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
+++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
@@ -33,7 +33,7 @@
#include <QSlider>
#include <QStyle>
#include <QStyleOption>
-#include <QTime>
+#include <QElapsedTimer>
#include <QDebug>
#include <QtTest/private/qtesthelpers_p.h>
@@ -91,7 +91,7 @@ private slots:
void connectedSliders();
private:
- void waitUntilTimeElapsed(const QTime& t, int ms);
+ void waitUntilTimeElapsed(const QElapsedTimer &t, int ms);
QWidget *topLevel;
Slider *slider;
@@ -1662,8 +1662,12 @@ void tst_QAbstractSlider::wheelEvent()
slider->setOrientation(sliderOrientation);
Qt::KeyboardModifier k = withModifiers ? Qt::ControlModifier : Qt::NoModifier;
- QWheelEvent event(slider->rect().bottomRight() + distanceFromBottomRight, WHEEL_DELTA * deltaMultiple,
- Qt::NoButton, k, wheelOrientation);
+
+ const QPoint wheelPoint = slider->rect().bottomRight() + distanceFromBottomRight;
+ const QPoint angleDelta(wheelOrientation == Qt::Horizontal ? WHEEL_DELTA * deltaMultiple : 0,
+ wheelOrientation == Qt::Vertical ? WHEEL_DELTA * deltaMultiple : 0);
+ QWheelEvent event(wheelPoint, slider->mapToGlobal(wheelPoint), QPoint(), angleDelta,
+ Qt::NoButton, k, Qt::NoScrollPhase, false);
QVERIFY(applicationInstance->sendEvent(slider,&event));
#ifdef Q_OS_MAC
QEXPECT_FAIL("Normal data page", "QTBUG-23679", Continue);
@@ -1674,8 +1678,8 @@ void tst_QAbstractSlider::wheelEvent()
slider->setSliderPosition(initialSliderPosition);
k = withModifiers ? Qt::ShiftModifier : Qt::NoModifier;
- event = QWheelEvent(slider->rect().bottomRight() + distanceFromBottomRight, WHEEL_DELTA * deltaMultiple,
- Qt::NoButton, k, wheelOrientation);
+ event = QWheelEvent(wheelPoint, slider->mapToGlobal(wheelPoint), QPoint(), angleDelta,
+ Qt::NoButton, k, Qt::NoScrollPhase, false);
QSignalSpy spy1(slider, SIGNAL(actionTriggered(int)));
QSignalSpy spy2(slider, SIGNAL(valueChanged(int)));
QVERIFY(applicationInstance->sendEvent(slider,&event));
@@ -1715,16 +1719,16 @@ void tst_QAbstractSlider::fineGrainedWheelEvent()
slider->setSliderPosition(0);
const int singleStepDelta = invertedControls ? (-WHEEL_DELTA / 3) : (WHEEL_DELTA / 3);
-
- QWheelEvent eventDown(slider->rect().bottomRight(), singleStepDelta / 2,
- Qt::NoButton, Qt::NoModifier, Qt::Vertical);
+ const QPoint wheelPoint = slider->rect().bottomRight();
+ QWheelEvent eventDown(wheelPoint, slider->mapToGlobal(wheelPoint), QPoint(), QPoint(0, singleStepDelta / 2),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QVERIFY(applicationInstance->sendEvent(slider,&eventDown));
QCOMPARE(slider->sliderPosition(), 0);
QVERIFY(applicationInstance->sendEvent(slider,&eventDown));
QCOMPARE(slider->sliderPosition(), 1);
- QWheelEvent eventUp(slider->rect().bottomRight(), -singleStepDelta / 2,
- Qt::NoButton, Qt::NoModifier, Qt::Vertical);
+ QWheelEvent eventUp(wheelPoint, slider->mapToGlobal(wheelPoint), QPoint(), QPoint(0, -singleStepDelta / 2),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QVERIFY(applicationInstance->sendEvent(slider,&eventUp));
QCOMPARE(slider->sliderPosition(), 1);
QVERIFY(applicationInstance->sendEvent(slider,&eventUp));
@@ -2053,11 +2057,11 @@ void tst_QAbstractSlider::setValue()
QVERIFY(sliderMovedTimeStamp < valueChangedTimeStamp);
}
-void tst_QAbstractSlider::waitUntilTimeElapsed(const QTime& t, int ms)
+void tst_QAbstractSlider::waitUntilTimeElapsed(const QElapsedTimer &t, int ms)
{
const int eps = 80;
while (t.elapsed() < ms + eps)
- QTest::qWait(qMax(ms - t.elapsed() + eps, 25));
+ QTest::qWait(qMax(int(ms - t.elapsed() + eps), 25));
}
void tst_QAbstractSlider::setRepeatAction()
@@ -2073,7 +2077,7 @@ void tst_QAbstractSlider::setRepeatAction()
QCOMPARE(spy.count(), 0);
QCOMPARE(slider->value(), 55);
- QTime t;
+ QElapsedTimer t;
t.start();
QTest::qWait(300);
QCOMPARE(spy.count(), 0);
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index a576770811..b7869a0653 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -34,7 +34,6 @@
#include <qpa/qplatformtheme.h>
#include <qfontcombobox.h>
-#include <qdesktopwidget.h>
#include <qapplication.h>
#include <qpushbutton.h>
#include <qdialog.h>
@@ -254,12 +253,22 @@ void tst_QComboBox::getSetCheck()
obj1.setMaxCount(INT_MAX);
QCOMPARE(INT_MAX, obj1.maxCount());
+ // QCompleter *QComboBox::completer()
+ // void QComboBox::setCompleter(QCompleter *)
+ obj1.setCompleter(nullptr);
+ QCOMPARE(nullptr, obj1.completer());
+ QCompleter completer;
+ obj1.setCompleter(&completer);
+ QVERIFY(obj1.completer() == nullptr); // no QLineEdit is set
+
+#if QT_DEPRECATED_SINCE(5, 13)
// bool QComboBox::autoCompletion()
// void QComboBox::setAutoCompletion(bool)
obj1.setAutoCompletion(false);
QCOMPARE(false, obj1.autoCompletion());
obj1.setAutoCompletion(true);
QCOMPARE(true, obj1.autoCompletion());
+#endif
// bool QComboBox::duplicatesEnabled()
// void QComboBox::setDuplicatesEnabled(bool)
@@ -317,6 +326,9 @@ void tst_QComboBox::getSetCheck()
QCOMPARE(var8, obj1.lineEdit());
// delete var8; // No delete, since QComboBox takes ownership
+ // After setting a line edit, completer() should not return nullptr anymore
+ QVERIFY(obj1.completer() != nullptr);
+
// const QValidator * QComboBox::validator()
// void QComboBox::setValidator(const QValidator *)
QIntValidator *var9 = new QIntValidator(0);
@@ -777,7 +789,9 @@ void tst_QComboBox::virtualAutocompletion()
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
QComboBox *testWidget = topLevel.comboBox();
testWidget->clear();
+#if QT_DEPRECATED_SINCE(5, 13)
testWidget->setAutoCompletion(true);
+#endif
testWidget->addItem("Foo");
testWidget->addItem("Bar");
testWidget->addItem("Boat");
@@ -837,7 +851,9 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
QCOMPARE(qApp->focusWidget(), (QWidget *)testWidget);
testWidget->clear();
+#if QT_DEPRECATED_SINCE(5, 13)
testWidget->setAutoCompletion(true);
+#endif
testWidget->addItem("Cow");
testWidget->addItem("irrelevant1");
testWidget->addItem("aww");
@@ -2102,7 +2118,9 @@ void tst_QComboBox::mouseWheel()
box.setEditable(i==0?false:true);
box.setCurrentIndex(startIndex);
- QWheelEvent event = QWheelEvent(box.rect().bottomRight() , WHEEL_DELTA * wheelDirection, Qt::NoButton, Qt::NoModifier);
+ const QPoint wheelPoint = box.rect().bottomRight();
+ QWheelEvent event(wheelPoint, box.mapToGlobal(wheelPoint), QPoint(), QPoint(0, WHEEL_DELTA * wheelDirection),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QVERIFY(applicationInstance->sendEvent(&box,&event));
QCOMPARE(box.currentIndex(), expectedIndex);
@@ -2131,7 +2149,9 @@ void tst_QComboBox::popupWheelHandling()
comboBox->showPopup();
QTRY_VERIFY(comboBox->view() && comboBox->view()->isVisible());
const QPoint popupPos = comboBox->view()->pos();
- QWheelEvent event(QPointF(10, 10), WHEEL_DELTA, Qt::NoButton, Qt::NoModifier);
+ const QPoint wheelPoint(10, 10);
+ QWheelEvent event(wheelPoint, scrollArea.mapToGlobal(wheelPoint), QPoint(), QPoint(0, WHEEL_DELTA),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
QVERIFY(QCoreApplication::sendEvent(scrollArea.windowHandle(), &event));
QCoreApplication::processEvents();
QVERIFY(comboBox->view()->isVisible());
@@ -2191,15 +2211,13 @@ void tst_QComboBox::itemListPosition()
QFontComboBox combo(&topLevel);
layout->addWidget(&combo);
- //the code to get the available screen space is copied from QComboBox code
- const int scrNumber = QApplication::desktop()->screenNumber(&combo);
bool useFullScreenForPopupMenu = false;
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
useFullScreenForPopupMenu = theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool();
const QRect screen = useFullScreenForPopupMenu ?
- QApplication::screens().at(scrNumber)->geometry() :
- QApplication::screens().at(scrNumber)->availableGeometry();
+ combo.screen()->geometry() :
+ combo.screen()->availableGeometry();
topLevel.move(screen.width() - topLevel.sizeHint().width() - 10, 0); //puts the combo to the top-right corner
@@ -2419,8 +2437,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
#if defined QT_BUILD_INTERNAL
QFrame *container = comboBox.findChild<QComboBoxPrivateContainer *>();
QVERIFY(container);
- QDesktopWidget desktop;
- QTRY_VERIFY(desktop.screenGeometry(container).contains(container->geometry()));
+ QTRY_VERIFY(container->screen()->geometry().contains(container->geometry()));
#endif
}
@@ -3050,7 +3067,9 @@ void tst_QComboBox::task_QTBUG_31146_popupCompletion()
{
QComboBox comboBox;
comboBox.setEditable(true);
+#if QT_DEPRECATED_SINCE(5, 13)
comboBox.setAutoCompletion(true);
+#endif
comboBox.setInsertPolicy(QComboBox::NoInsert);
comboBox.completer()->setCaseSensitivity(Qt::CaseInsensitive);
comboBox.completer()->setCompletionMode(QCompleter::PopupCompletion);
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index b5ef454b14..26b4b7d020 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -307,19 +307,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
{
switch (modifier) {
case Qt::NoModifier:
- return QLatin1Literal("No");
+ return QLatin1String("No");
break;
case Qt::ControlModifier:
- return QLatin1Literal("Ctrl");
+ return QLatin1String("Ctrl");
break;
case Qt::ShiftModifier:
- return QLatin1Literal("Shift");
+ return QLatin1String("Shift");
break;
case Qt::AltModifier:
- return QLatin1Literal("Alt");
+ return QLatin1String("Alt");
break;
case Qt::MetaModifier:
- return QLatin1Literal("Meta");
+ return QLatin1String("Meta");
break;
default:
qFatal("Unexpected keyboard modifier");
@@ -331,25 +331,24 @@ static QLatin1String sectionToName(const QDateTimeEdit::Section section)
{
switch (section) {
case QDateTimeEdit::SecondSection:
- return QLatin1Literal("Second");
+ return QLatin1String("Second");
case QDateTimeEdit::MinuteSection:
- return QLatin1Literal("Minute");
+ return QLatin1String("Minute");
case QDateTimeEdit::HourSection:
- return QLatin1Literal("Hours");
+ return QLatin1String("Hours");
case QDateTimeEdit::DaySection:
- return QLatin1Literal("Day");
+ return QLatin1String("Day");
case QDateTimeEdit::MonthSection:
- return QLatin1Literal("Month");
+ return QLatin1String("Month");
case QDateTimeEdit::YearSection:
- return QLatin1Literal("Year");
+ return QLatin1String("Year");
default:
qFatal("Unexpected section");
return QLatin1String();
}
}
-static QDate stepDate(const QDate& startDate, const QDateTimeEdit::Section section,
- const int steps)
+static QDate stepDate(QDate startDate, const QDateTimeEdit::Section section, const int steps)
{
switch (section) {
case QDateTimeEdit::DaySection:
@@ -364,8 +363,7 @@ static QDate stepDate(const QDate& startDate, const QDateTimeEdit::Section secti
}
}
-static QTime stepTime(const QTime& startTime, const QDateTimeEdit::Section section,
- const int steps)
+static QTime stepTime(QTime startTime, const QDateTimeEdit::Section section, const int steps)
{
switch (section) {
case QDateTimeEdit::SecondSection:
@@ -3141,7 +3139,6 @@ void tst_QDateTimeEdit::wheelEvent_data()
{
#if QT_CONFIG(wheelevent)
QTest::addColumn<QPoint>("angleDelta");
- QTest::addColumn<int>("qt4Delta");
QTest::addColumn<int>("stepModifier");
QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
QTest::addColumn<Qt::MouseEventSource>("source");
@@ -3217,16 +3214,16 @@ void tst_QDateTimeEdit::wheelEvent_data()
QLatin1String sourceName;
switch (source) {
case Qt::MouseEventNotSynthesized:
- sourceName = QLatin1Literal("NotSynthesized");
+ sourceName = QLatin1String("NotSynthesized");
break;
case Qt::MouseEventSynthesizedBySystem:
- sourceName = QLatin1Literal("SynthesizedBySystem");
+ sourceName = QLatin1String("SynthesizedBySystem");
break;
case Qt::MouseEventSynthesizedByQt:
- sourceName = QLatin1Literal("SynthesizedByQt");
+ sourceName = QLatin1String("SynthesizedByQt");
break;
case Qt::MouseEventSynthesizedByApplication:
- sourceName = QLatin1Literal("SynthesizedByApplication");
+ sourceName = QLatin1String("SynthesizedByApplication");
break;
default:
qFatal("Unexpected wheel event source");
@@ -3255,7 +3252,6 @@ void tst_QDateTimeEdit::wheelEvent_data()
modifierName.latin1(),
sourceName.latin1())
<< angleDelta
- << units
<< static_cast<int>(stepModifier)
<< modifiers
<< source
@@ -3277,7 +3273,6 @@ void tst_QDateTimeEdit::wheelEvent()
{
#if QT_CONFIG(wheelevent)
QFETCH(QPoint, angleDelta);
- QFETCH(int, qt4Delta);
QFETCH(int, stepModifier);
QFETCH(Qt::KeyboardModifiers, modifiers);
QFETCH(Qt::MouseEventSource, source);
@@ -3294,9 +3289,8 @@ void tst_QDateTimeEdit::wheelEvent()
style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
edit.setStyle(style.data());
- QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta, qt4Delta,
- Qt::Vertical, Qt::NoButton, modifiers, Qt::NoScrollPhase,
- source);
+ QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta,
+ Qt::NoButton, modifiers, Qt::NoScrollPhase, false, source);
QCOMPARE(edit.date(), startDate);
for (QDate expected : expectedDates) {
@@ -3454,7 +3448,7 @@ void tst_QDateTimeEdit::timeSpec()
}
QVERIFY(edit.minimumTime() != min.time());
QVERIFY(edit.minimumDateTime().timeSpec() != min.timeSpec());
- QCOMPARE(edit.minimumDateTime().toTime_t(), min.toTime_t());
+ QCOMPARE(edit.minimumDateTime().toSecsSinceEpoch(), min.toSecsSinceEpoch());
} else {
QSKIP("Not tested in the GMT timezone");
}
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index f8ce6a2c0a..625116654d 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -670,7 +670,11 @@ void tst_QDockWidget::dockLocationChanged()
spy.clear();
dw.setFloating(true);
- QTest::qWait(100);
+ QTRY_COMPARE(spy.count(), 1);
+ QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
+ Qt::NoDockWidgetArea);
+ spy.clear();
+
dw.setFloating(false);
QTRY_COMPARE(spy.count(), 1);
QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST b/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST
index c1b6c9693e..8f5648d0f9 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST
+++ b/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST
@@ -1,2 +1,4 @@
[editingFinished]
-*
+osx-10.12
+osx-10.14
+osx-10.13
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
index 954ee6471d..c760d9cc99 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -221,19 +221,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
{
switch (modifier) {
case Qt::NoModifier:
- return QLatin1Literal("No");
+ return QLatin1String("No");
break;
case Qt::ControlModifier:
- return QLatin1Literal("Ctrl");
+ return QLatin1String("Ctrl");
break;
case Qt::ShiftModifier:
- return QLatin1Literal("Shift");
+ return QLatin1String("Shift");
break;
case Qt::AltModifier:
- return QLatin1Literal("Alt");
+ return QLatin1String("Alt");
break;
case Qt::MetaModifier:
- return QLatin1Literal("Meta");
+ return QLatin1String("Meta");
break;
default:
qFatal("Unexpected keyboard modifier");
@@ -1377,7 +1377,6 @@ void tst_QDoubleSpinBox::wheelEvents_data()
{
#if QT_CONFIG(wheelevent)
QTest::addColumn<QPoint>("angleDelta");
- QTest::addColumn<int>("qt4Delta");
QTest::addColumn<int>("stepModifier");
QTest::addColumn<Qt::KeyboardModifiers>("modifier");
QTest::addColumn<Qt::MouseEventSource>("source");
@@ -1448,16 +1447,16 @@ void tst_QDoubleSpinBox::wheelEvents_data()
QLatin1String sourceName;
switch (source) {
case Qt::MouseEventNotSynthesized:
- sourceName = QLatin1Literal("NotSynthesized");
+ sourceName = QLatin1String("NotSynthesized");
break;
case Qt::MouseEventSynthesizedBySystem:
- sourceName = QLatin1Literal("SynthesizedBySystem");
+ sourceName = QLatin1String("SynthesizedBySystem");
break;
case Qt::MouseEventSynthesizedByQt:
- sourceName = QLatin1Literal("SynthesizedByQt");
+ sourceName = QLatin1String("SynthesizedByQt");
break;
case Qt::MouseEventSynthesizedByApplication:
- sourceName = QLatin1Literal("SynthesizedByApplication");
+ sourceName = QLatin1String("SynthesizedByApplication");
break;
default:
qFatal("Unexpected wheel event source");
@@ -1476,7 +1475,6 @@ void tst_QDoubleSpinBox::wheelEvents_data()
modifierName.latin1(),
sourceName.latin1())
<< angleDelta
- << units
<< static_cast<int>(stepModifier)
<< modifiers
<< source
@@ -1496,7 +1494,6 @@ void tst_QDoubleSpinBox::wheelEvents()
{
#if QT_CONFIG(wheelevent)
QFETCH(QPoint, angleDelta);
- QFETCH(int, qt4Delta);
QFETCH(int, stepModifier);
QFETCH(Qt::KeyboardModifiers, modifier);
QFETCH(Qt::MouseEventSource, source);
@@ -1512,9 +1509,8 @@ void tst_QDoubleSpinBox::wheelEvents()
style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
spinBox.setStyle(style.data());
- QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta, qt4Delta,
- Qt::Vertical, Qt::NoButton, modifier, Qt::NoScrollPhase,
- source);
+ QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta,
+ Qt::NoButton, modifier, Qt::NoScrollPhase, false, source);
for (int expected : expectedValues) {
qApp->sendEvent(&spinBox, &event);
QCOMPARE(spinBox.value(), expected);
diff --git a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
index 1813e5ad5f..5392d36ae0 100644
--- a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
+++ b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
@@ -108,7 +108,7 @@ void tst_QFontComboBox::currentFont()
QFont oldCurrentFont = box.currentFont();
box.setCurrentFont(currentFont);
- QRegExp foundry(" \\[.*\\]");
+ QRegularExpression foundry(" \\[.*\\]");
if (!box.currentFont().family().contains(foundry)) {
QCOMPARE(box.currentFont(), currentFont);
}
diff --git a/tests/auto/widgets/widgets/qframe/tst_qframe.cpp b/tests/auto/widgets/widgets/qframe/tst_qframe.cpp
index 432f4474c5..05f9cd2e4a 100644
--- a/tests/auto/widgets/widgets/qframe/tst_qframe.cpp
+++ b/tests/auto/widgets/widgets/qframe/tst_qframe.cpp
@@ -37,6 +37,10 @@
class tst_QFrame : public QObject
{
Q_OBJECT
+
+public:
+ static void initMain() { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); }
+
private slots:
void testDefaults();
void testInitStyleOption_data();
diff --git a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp
index 420ef56106..1b477fbbd0 100644
--- a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp
@@ -295,6 +295,12 @@ void tst_QGroupBox::enabledChildPropagation()
QVERIFY(!childWidget->isEnabled());
dialog = new QDialog(&testWidget);
QVERIFY(dialog->isEnabled());
+
+ // children that are enabled after adding should still be disabled before
+ // they are shown
+ childWidget->setEnabled(true);
+ testWidget.show();
+ QVERIFY(!childWidget->isEnabled());
}
void tst_QGroupBox::sizeHint()
diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
index 34862f6810..f599ac73c6 100644
--- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
+++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
@@ -461,7 +461,7 @@ void tst_QLabel::unicodeText()
QVBoxLayout *layout = new QVBoxLayout();
QLabel *label = new QLabel(text, &frame);
layout->addWidget(label);
- layout->setMargin(8);
+ layout->setContentsMargins(8, 8, 8, 8);
frame.setLayout(layout);
frame.show();
QVERIFY(QTest::qWaitForWindowExposed(&frame));
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 27cc385df4..0cfbc651ad 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -3530,6 +3530,13 @@ void tst_QLineEdit::textMargin()
centerOnScreen(&tlw);
tlw.show();
+ const QMargins margins = testWidget.textMargins();
+ QCOMPARE(left, margins.left());
+ QCOMPARE(top, margins.top());
+ QCOMPARE(right, margins.right());
+ QCOMPARE(bottom, margins.bottom());
+
+#if QT_DEPRECATED_SINCE(5, 14)
int l;
int t;
int r;
@@ -3539,6 +3546,7 @@ void tst_QLineEdit::textMargin()
QCOMPARE(top, t);
QCOMPARE(right, r);
QCOMPARE(bottom, b);
+#endif
QTest::mouseClick(&testWidget, Qt::LeftButton, 0, mousePressPos);
QTRY_COMPARE(testWidget.cursorPosition(), cursorPosition);
@@ -3615,6 +3623,14 @@ void tst_QLineEdit::task174640_editingFinished()
le2->setFocus();
QTRY_VERIFY(le2->hasFocus());
+ // editingFinished will not be emitted anew because no editing happened
+ QCOMPARE(editingFinishedSpy.count(), 0);
+
+ le1->setFocus();
+ QTRY_VERIFY(le1->hasFocus());
+ QTest::keyPress(le1, Qt::Key_Plus);
+ le2->setFocus();
+ QTRY_VERIFY(le2->hasFocus());
QCOMPARE(editingFinishedSpy.count(), 1);
editingFinishedSpy.clear();
@@ -3632,6 +3648,8 @@ void tst_QLineEdit::task174640_editingFinished()
delete testMenu1;
QCOMPARE(editingFinishedSpy.count(), 0);
QTRY_VERIFY(le1->hasFocus());
+ // Ensure le1 has been edited
+ QTest::keyPress(le1, Qt::Key_Plus);
QMenu *testMenu2 = new QMenu(le2);
testMenu2->addAction("foo2");
@@ -3986,7 +4004,7 @@ void tst_QLineEdit::QTBUG7174_inputMaskCursorBlink()
edit.setFocus();
edit.setText(QLatin1String("AAAA"));
edit.show();
- QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QRect cursorRect = edit.inputMethodQuery(Qt::ImCursorRectangle).toRect();
QVERIFY(QTest::qWaitForWindowExposed(&edit));
edit.updateRegion = QRegion();
QTest::qWait(QApplication::cursorFlashTime());
diff --git a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
index b1c8d7dfde..1dd876ea97 100644
--- a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
@@ -1,7 +1,16 @@
-[updateScrollBars]
-osx
[tileSubWindows]
-osx
-xcb
+ubuntu-16.04
+rhel-7.6
+opensuse-leap
+osx-10.11
+osx-10.13
+ubuntu-18.04
+osx-10.14
+rhel-7.4
+osx-10.12
+opensuse-42.3
[resizeTimer]
-osx
+osx-10.12
+osx-10.14
+osx-10.13
+
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index 67b79e3faf..6d38dc262f 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -333,6 +333,7 @@ void tst_QMdiArea::subWindowActivated()
for ( i = 0; i < count; ++i ) {
QWidget *widget = new QWidget(workspace, 0);
widget->setAttribute(Qt::WA_DeleteOnClose);
+ widget->setFocus();
workspace->addSubWindow(widget)->show();
widget->show();
qApp->processEvents();
@@ -478,9 +479,6 @@ void tst_QMdiArea::subWindowActivated2()
// Check that we only emit _one_ signal and the active window
// is unchanged after hide/show.
mdiArea.hide();
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- qt_x11_wait_for_window_manager(&mdiArea);
-#endif
QTest::qWait(100);
QTRY_COMPARE(spy.count(), 1);
QVERIFY(!mdiArea.activeSubWindow());
@@ -879,7 +877,7 @@ void tst_QMdiArea::minimumSizeHint()
{
QMdiArea workspace;
workspace.show();
- QSize expectedSize(workspace.style()->pixelMetric(QStyle::PM_MDIMinimizedWidth),
+ QSize expectedSize(workspace.style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth),
workspace.style()->pixelMetric(QStyle::PM_TitleBarHeight));
qApp->processEvents();
QAbstractScrollArea dummyScrollArea;
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST b/tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST
deleted file mode 100644
index 26d1776b0d..0000000000
--- a/tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[setOpaqueResizeAndMove]
-osx-10.12
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 2b59a227b3..3ee9c72209 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -52,9 +52,7 @@
#include <QVector>
QT_BEGIN_NAMESPACE
-#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
extern bool qt_tab_all_widgets();
-#endif
QT_END_NAMESPACE
static inline bool tabAllWidgets()
@@ -613,7 +611,7 @@ void tst_QMdiSubWindow::showShaded()
// Calculate mouse position for bottom right corner and simulate a
// vertical resize with the mouse.
- int offset = window->style()->pixelMetric(QStyle::PM_MDIFrameWidth) / 2;
+ int offset = window->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth) / 2;
QPoint mousePosition(window->width() - qMax(offset, 2), window->height() - qMax(offset, 2));
QWidget *mouseReceiver = nullptr;
#ifdef Q_OS_MAC
@@ -759,7 +757,7 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
QTRY_COMPARE(priv->resizeTimerId, -1);
// Enter resize mode.
- int offset = window->style()->pixelMetric(QStyle::PM_MDIFrameWidth) / 2;
+ int offset = window->style()->pixelMetric(QStyle::PM_MdiSubWindowFrameWidth) / 2;
QPoint mousePosition(mouseReceiver->width() - qMax(offset, 2), mouseReceiver->height() - qMax(offset, 2));
sendMouseMove(mouseReceiver, mousePosition, Qt::NoButton);
sendMousePress(mouseReceiver, mousePosition);
@@ -1762,7 +1760,8 @@ void tst_QMdiSubWindow::fixedMinMaxSize()
int minimizedHeight = subWindow->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options);
if (!subWindow->style()->styleHint(QStyle::SH_TitleBar_NoBorder, &options, subWindow))
minimizedHeight += 8;
- int minimizedWidth = subWindow->style()->pixelMetric(QStyle::PM_MDIMinimizedWidth, &options);
+ int minimizedWidth = subWindow->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth,
+ &options);
const QSize minimizedSize = QSize(minimizedWidth, minimizedHeight);
// Even though the sub window has a minimum size set, it should be possible
diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST
index bac14ea225..ad6d2f340c 100644
--- a/tests/auto/widgets/widgets/qmenu/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST
@@ -1,13 +1,13 @@
[task258920_mouseBorder]
-osx
-[submenuTearOffDontClose]
-osx-10.12 ci
+osx-10.14
+osx-10.13
[layoutDirection]
+osx-10.12
+osx-10.13
# Fails when enabling synchronous expose events QTBUG-62092
-osx ci
[pushButtonPopulateOnAboutToShow]
-osx
+osx-10.13
[tearOff]
-osx
+osx-10.14
[activeSubMenuPosition]
winrt
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 3bfbe754ef..9c40c0bd57 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -610,7 +610,7 @@ void tst_QMenu::widgetActionFocus()
static QMenu *getTornOffMenu()
{
- foreach (QWidget *w, QApplication::allWidgets()) {
+ for (QWidget *w : QApplication::allWidgets()) {
if (w->isVisible() && w->inherits("QTornOffMenu"))
return static_cast<QMenu *>(w);
}
@@ -948,30 +948,28 @@ void tst_QMenu::menuSizeHint()
{
QMenu menu;
//this is a list of arbitrary strings so that we check the geometry
- QStringList list = QStringList() << "trer" << "ezrfgtgvqd" << "sdgzgzerzerzer" << "eerzertz" << "er";
- foreach (QString str, list)
+ for (auto str : {"trer", "ezrfgtgvqd", "sdgzgzerzerzer", "eerzertz", "er"})
menu.addAction(str);
- int left, top, right, bottom;
- menu.getContentsMargins(&left, &top, &right, &bottom);
+ const QMargins cm = menu.contentsMargins();
const int panelWidth = menu.style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, &menu);
const int hmargin = menu.style()->pixelMetric(QStyle::PM_MenuHMargin, 0, &menu),
vmargin = menu.style()->pixelMetric(QStyle::PM_MenuVMargin, 0, &menu);
int maxWidth =0;
QRect result;
- foreach (QAction *action, menu.actions()) {
+ for (QAction *action : menu.actions()) {
maxWidth = qMax(maxWidth, menu.actionGeometry(action).width());
result |= menu.actionGeometry(action);
- QCOMPARE(result.x(), left + hmargin + panelWidth);
- QCOMPARE(result.y(), top + vmargin + panelWidth);
+ QCOMPARE(result.x(), cm.left() + hmargin + panelWidth);
+ QCOMPARE(result.y(), cm.top() + vmargin + panelWidth);
}
QStyleOption opt(0);
opt.rect = menu.rect();
opt.state = QStyle::State_None;
- QSize resSize = QSize(result.x(), result.y()) + result.size() + QSize(hmargin + right + panelWidth, vmargin + top + panelWidth);
+ QSize resSize = QSize(result.x(), result.y()) + result.size() + QSize(hmargin + cm.right() + panelWidth, vmargin + cm.top() + panelWidth);
resSize = menu.style()->sizeFromContents(QStyle::CT_Menu, &opt,
resSize.expandedTo(QApplication::globalStrut()), &menu);
@@ -1572,8 +1570,7 @@ void tst_QMenu::menuSize_Scrolling()
int hmargin = style()->pixelMetric(QStyle::PM_MenuHMargin, nullptr, this);
int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, nullptr, this);
- int leftMargin, topMargin, rightMargin, bottomMargin;
- getContentsMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin);
+ const QMargins cm = contentsMargins();
QRect lastItem = actionGeometry(actions().at(actions().length() - 1));
QSize s = size();
#ifdef Q_OS_WINRT
@@ -1586,7 +1583,7 @@ void tst_QMenu::menuSize_Scrolling()
return;
}
- QCOMPARE( s.width(), lastItem.right() + fw + hmargin + rightMargin + 1);
+ QCOMPARE( s.width(), lastItem.right() + fw + hmargin + cm.right() + 1);
QMenu::showEvent(e);
}
diff --git a/tests/auto/widgets/widgets/qmenubar/BLACKLIST b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
index f897797f00..c9e15e531c 100644
--- a/tests/auto/widgets/widgets/qmenubar/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
@@ -3,6 +3,6 @@ ubuntu-16.04
#QTBUG-66255
ubuntu-18.04
[activatedCount]
-*
+opensuse-42.3
[QTBUG_65488_hiddenActionTriggered]
winrt
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index cb829c81a6..417d6e3124 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -34,7 +34,6 @@
#include <qstyle.h>
#include <qproxystyle.h>
#include <qstylefactory.h>
-#include <qdesktopwidget.h>
#include <qaction.h>
#include <qstyleoption.h>
#include <QVBoxLayout>
@@ -113,10 +112,7 @@ private slots:
void check_escKey();
#endif
-#ifndef Q_OS_WINCE
void allowActiveAndDisabled();
-#endif
-
void taskQTBUG56860_focus();
void check_endKey();
void check_homeKey();
@@ -1152,8 +1148,8 @@ void tst_QMenuBar::check_menuPosition()
Menu menu;
menu.setTitle("&menu");
- QRect availRect = QApplication::desktop()->availableGeometry(&w);
- QRect screenRect = QApplication::desktop()->screenGeometry(&w);
+ QRect availRect = w.screen()->availableGeometry();
+ QRect screenRect = w.screen()->geometry();
while(menu.sizeHint().height() < (screenRect.height()*2/3)) {
menu.addAction("item");
diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
index b67c8354e8..b281eca3bf 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
+++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
@@ -1,5 +1,3 @@
-[clearAndGrab]
-ubuntu
-
[stackWidgetOpaqueChildIsVisible]
-windows
+windows-10 msvc-2017
+
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index 21c9f41646..76f8ebc804 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -49,6 +49,9 @@ class tst_QOpenGLWidget : public QObject
{
Q_OBJECT
+public:
+ static void initMain() { QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); }
+
private slots:
void initTestCase();
void create();
diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
index df5ff9d448..f2f9cfc009 100644
--- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
@@ -171,11 +171,8 @@ void tst_QProgressBar::format()
bar.setFormat("%v of %m (%p%)");
qApp->processEvents();
-#ifndef Q_OS_MAC
+#if !defined(Q_OS_MACOS) && !defined(Q_OS_WIN)
// Animated scroll bars get paint events all the time
-#ifdef Q_OS_WIN
- if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA)
-#endif
QVERIFY(!bar.repainted);
#endif
diff --git a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
index d1923e4bb0..9f08bd337b 100644
--- a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
@@ -87,7 +87,7 @@ public:
protected:
QVariant inputMethodQuery(Qt::InputMethodQuery query) const
{
- if (query == Qt::ImMicroFocus)
+ if (query == Qt::ImCursorRectangle)
return QRect(width() / 2, height() / 2, 5, 5);
return QWidget::inputMethodQuery(query);
}
@@ -110,7 +110,7 @@ void tst_QScrollArea::ensureMicroFocusVisible_Task_167838()
parent->resize(300, 300);
scrollArea.setWidget(parent);
scrollArea.ensureWidgetVisible(child, 10, 10);
- QRect microFocus = child->inputMethodQuery(Qt::ImMicroFocus).toRect();
+ QRect microFocus = child->inputMethodQuery(Qt::ImCursorRectangle).toRect();
QPoint p = child->mapTo(scrollArea.viewport(), microFocus.topLeft());
microFocus.translate(p - microFocus.topLeft());
QVERIFY(scrollArea.viewport()->rect().contains(microFocus));
diff --git a/tests/auto/widgets/widgets/qscrollbar/BLACKLIST b/tests/auto/widgets/widgets/qscrollbar/BLACKLIST
deleted file mode 100644
index 277ae4d260..0000000000
--- a/tests/auto/widgets/widgets/qscrollbar/BLACKLIST
+++ /dev/null
@@ -1,3 +0,0 @@
-#QTBUG-66321
-[QTBUG_42871]
-macos
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index 278f5cdd68..339ff293f4 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
@@ -151,8 +151,11 @@ void tst_QScrollBar::QTBUG_27308()
testWidget.setValue(testWidget.minimum());
testWidget.setEnabled(false);
- QWheelEvent event(testWidget.rect().center(),
- -WHEEL_DELTA, Qt::NoButton, Qt::NoModifier, testWidget.orientation());
+ const QPoint wheelPoint = testWidget.rect().center();
+ const QPoint angleDelta(testWidget.orientation() == Qt::Horizontal ? -WHEEL_DELTA : 0,
+ testWidget.orientation() == Qt::Vertical ? -WHEEL_DELTA : 0);
+ QWheelEvent event(wheelPoint, testWidget.mapToGlobal(wheelPoint), QPoint(), angleDelta,
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
qApp->sendEvent(&testWidget, &event);
QCOMPARE(testWidget.value(), testWidget.minimum());
}
diff --git a/tests/auto/widgets/widgets/qspinbox/BLACKLIST b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
index a38511bfb4..96a7732165 100644
--- a/tests/auto/widgets/widgets/qspinbox/BLACKLIST
+++ b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
@@ -1,3 +1,2 @@
[stepModifierPressAndHold]
-opensuse ci # QTBUG-69492
-opensuse-leap ci
+opensuse-42.3
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 52d7dad7cf..d75e701d1c 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -206,7 +206,7 @@ private slots:
void stepModifierPressAndHold_data();
void stepModifierPressAndHold();
public slots:
- void valueChangedHelper(const QString &);
+ void textChangedHelper(const QString &);
void valueChangedHelper(int);
private:
QStringList actualTexts;
@@ -222,19 +222,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
{
switch (modifier) {
case Qt::NoModifier:
- return QLatin1Literal("No");
+ return QLatin1String("No");
break;
case Qt::ControlModifier:
- return QLatin1Literal("Ctrl");
+ return QLatin1String("Ctrl");
break;
case Qt::ShiftModifier:
- return QLatin1Literal("Shift");
+ return QLatin1String("Shift");
break;
case Qt::AltModifier:
- return QLatin1Literal("Alt");
+ return QLatin1String("Alt");
break;
case Qt::MetaModifier:
- return QLatin1Literal("Meta");
+ return QLatin1String("Meta");
break;
default:
qFatal("Unexpected keyboard modifier");
@@ -490,7 +490,7 @@ void tst_QSpinBox::setPrefixSuffix()
}
}
-void tst_QSpinBox::valueChangedHelper(const QString &text)
+void tst_QSpinBox::textChangedHelper(const QString &text)
{
actualTexts << text;
}
@@ -568,7 +568,7 @@ void tst_QSpinBox::setTracking()
QSpinBox spin(0);
spin.setKeyboardTracking(tracking);
spin.show();
- connect(&spin, SIGNAL(valueChanged(QString)), this, SLOT(valueChangedHelper(QString)));
+ connect(&spin, &QSpinBox::textChanged, this, &tst_QSpinBox::textChangedHelper);
keys.simulate(&spin);
QCOMPARE(actualTexts, texts);
@@ -1331,7 +1331,6 @@ void tst_QSpinBox::wheelEvents_data()
{
#if QT_CONFIG(wheelevent)
QTest::addColumn<QPoint>("angleDelta");
- QTest::addColumn<int>("qt4Delta");
QTest::addColumn<int>("stepModifier");
QTest::addColumn<Qt::KeyboardModifiers>("modifier");
QTest::addColumn<Qt::MouseEventSource>("source");
@@ -1402,16 +1401,16 @@ void tst_QSpinBox::wheelEvents_data()
QLatin1String sourceName;
switch (source) {
case Qt::MouseEventNotSynthesized:
- sourceName = QLatin1Literal("NotSynthesized");
+ sourceName = QLatin1String("NotSynthesized");
break;
case Qt::MouseEventSynthesizedBySystem:
- sourceName = QLatin1Literal("SynthesizedBySystem");
+ sourceName = QLatin1String("SynthesizedBySystem");
break;
case Qt::MouseEventSynthesizedByQt:
- sourceName = QLatin1Literal("SynthesizedByQt");
+ sourceName = QLatin1String("SynthesizedByQt");
break;
case Qt::MouseEventSynthesizedByApplication:
- sourceName = QLatin1Literal("SynthesizedByApplication");
+ sourceName = QLatin1String("SynthesizedByApplication");
break;
default:
qFatal("Unexpected wheel event source");
@@ -1430,7 +1429,6 @@ void tst_QSpinBox::wheelEvents_data()
modifierName.latin1(),
sourceName.latin1())
<< angleDelta
- << units
<< static_cast<int>(stepModifier)
<< modifiers
<< source
@@ -1450,7 +1448,6 @@ void tst_QSpinBox::wheelEvents()
{
#if QT_CONFIG(wheelevent)
QFETCH(QPoint, angleDelta);
- QFETCH(int, qt4Delta);
QFETCH(int, stepModifier);
QFETCH(Qt::KeyboardModifiers, modifier);
QFETCH(Qt::MouseEventSource, source);
@@ -1466,9 +1463,8 @@ void tst_QSpinBox::wheelEvents()
style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
spinBox.setStyle(style.data());
- QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta, qt4Delta,
- Qt::Vertical, Qt::NoButton, modifier, Qt::NoScrollPhase,
- source);
+ QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta,
+ Qt::NoButton, modifier, Qt::NoScrollPhase, false, source);
for (int expected : expectedValues) {
qApp->sendEvent(&spinBox, &event);
QCOMPARE(spinBox.value(), expected);
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index 8b45ac20b7..cbeb77a25e 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -599,7 +599,7 @@ void tst_QSplitter::testShowHide()
QWidget widget(&topLevel);
widget.resize(400 + split->handleWidth(), 200);
QVBoxLayout *lay=new QVBoxLayout(&widget);
- lay->setMargin(0);
+ lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
split->addWidget(new QWidget);
split->addWidget(new QWidget);
diff --git a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
index 6523209c32..b61cc8fa13 100644
--- a/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
+++ b/tests/auto/widgets/widgets/qtabwidget/qtabwidget.pro
@@ -8,4 +8,4 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qtabwidget.cpp
-win32:!winrt: LIBS += -luser32
+win32:!winrt: QMAKE_USE += user32
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index cbf5196bb9..feade7d443 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -620,7 +620,7 @@ void tst_QTabWidget::heightForWidth()
QWidget *window = new QWidget;
QVBoxLayout *lay = new QVBoxLayout(window);
- lay->setMargin(0);
+ lay->setContentsMargins(0, 0, 0, 0);
lay->setSpacing(0);
QTabWidget *tabWid = new QTabWidget(window);
QWidget *w = new QWidget;
@@ -637,7 +637,7 @@ void tst_QTabWidget::heightForWidth()
);
label->setWordWrap(true);
lay2->addWidget(label);
- lay2->setMargin(0);
+ lay2->setContentsMargins(0, 0, 0, 0);
lay->addWidget(tabWid);
int h = window->heightForWidth(160);
diff --git a/tests/auto/widgets/widgets/qtextbrowser/heading.html b/tests/auto/widgets/widgets/qtextbrowser/heading.html
new file mode 100644
index 0000000000..8b23807f65
--- /dev/null
+++ b/tests/auto/widgets/widgets/qtextbrowser/heading.html
@@ -0,0 +1,2 @@
+<h3>this is a heading</h3>
+<p>this is a paragraph</p>
diff --git a/tests/auto/widgets/widgets/qtextbrowser/markdown.md b/tests/auto/widgets/widgets/qtextbrowser/markdown.md
new file mode 100644
index 0000000000..be56aef234
--- /dev/null
+++ b/tests/auto/widgets/widgets/qtextbrowser/markdown.md
@@ -0,0 +1,2 @@
+### this is a heading
+this is a paragraph
diff --git a/tests/auto/widgets/widgets/qtextbrowser/markdown.really b/tests/auto/widgets/widgets/qtextbrowser/markdown.really
new file mode 100644
index 0000000000..be56aef234
--- /dev/null
+++ b/tests/auto/widgets/widgets/qtextbrowser/markdown.really
@@ -0,0 +1,2 @@
+### this is a heading
+this is a paragraph
diff --git a/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro b/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro
index 9680ffd871..dfdcf26497 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro
@@ -4,6 +4,6 @@ SOURCES += tst_qtextbrowser.cpp
QT += widgets testlib
-TESTDATA += *.html subdir/*
+TESTDATA += *.html *.md markdown.really subdir/*
builtin_testdata: DEFINES += BUILTIN_TESTDATA
diff --git a/tests/auto/widgets/widgets/qtextbrowser/quotesAndFractions.md b/tests/auto/widgets/widgets/qtextbrowser/quotesAndFractions.md
new file mode 100644
index 0000000000..6bad9cb95b
--- /dev/null
+++ b/tests/auto/widgets/widgets/qtextbrowser/quotesAndFractions.md
@@ -0,0 +1 @@
+you’ll hope to see ❝quotes❞ ﹠1½ ⅔ ¼ ⅗ ⅚ ⅝ some “vulgar” fractions (pardon my «French»)
diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
index 8a1b228c71..27bf0ce7be 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -38,7 +38,7 @@
class TestBrowser : public QTextBrowser
{
public:
- inline TestBrowser() : htmlLoadAttempts(0) {
+ inline TestBrowser() {
show();
QApplication::setActiveWindow(this);
activateWindow();
@@ -47,11 +47,12 @@ public:
QVERIFY(hasFocus());
}
- virtual QVariant loadResource(int type, const QUrl &name);
+ QVariant loadResource(int type, const QUrl &name) override;
- int htmlLoadAttempts;
+ int htmlLoadAttempts = 0;
QUrl lastResource;
QUrl sourceInsideLoadResource;
+ QUrl baseInsideLoadResource;
};
QVariant TestBrowser::loadResource(int type, const QUrl &name)
@@ -60,6 +61,7 @@ QVariant TestBrowser::loadResource(int type, const QUrl &name)
htmlLoadAttempts++;
lastResource = name;
sourceInsideLoadResource = source();
+ baseInsideLoadResource = document()->baseUrl();
return QTextBrowser::loadResource(type, name);
}
@@ -90,6 +92,10 @@ private slots:
void focusIndicator();
void focusHistory();
void urlEncoding();
+ void sourceType_data();
+ void sourceType();
+ void unicode_data();
+ void unicode();
private:
TestBrowser *browser;
@@ -108,7 +114,7 @@ void tst_QTextBrowser::init()
void tst_QTextBrowser::cleanup()
{
delete browser;
- browser = 0;
+ browser = nullptr;
}
void tst_QTextBrowser::noReloadOnAnchorJump()
@@ -428,11 +434,18 @@ void tst_QTextBrowser::sourceInsideLoadResource()
#ifdef Q_OS_WINRT
QSKIP("Paths cannot be compared if applications are sandboxed.");
#endif
- QUrl url = QUrl::fromLocalFile("pagewithimage.html");
+ QUrl url = QUrl::fromLocalFile("pagewithimage.html"); // "file://pagewithimage.html"
browser->setSource(url);
QCOMPARE(browser->lastResource, QUrl::fromLocalFile(QDir::current().filePath("foobar.png")));
+ // baseUrl was not set because the source URL was a relative one
+ QCOMPARE(browser->baseInsideLoadResource, QUrl());
QEXPECT_FAIL("", "This is currently not supported", Continue);
QCOMPARE(browser->sourceInsideLoadResource.toString(), url.toString());
+ url = QUrl::fromLocalFile(QDir::current().filePath("pagewithimage.html")); // "file:///home/user/path/to/pagewithimage.html"
+ browser->setSource(url);
+ QCOMPARE(browser->lastResource, QUrl::fromLocalFile(QDir::current().filePath("foobar.png")));
+ // baseUrl has the full path, and that's where relative-path resources come from
+ QCOMPARE(browser->baseInsideLoadResource, QUrl::fromLocalFile(QDir::currentPath() + QLatin1Char('/')));
}
void tst_QTextBrowser::textInteractionFlags_vs_readOnly()
@@ -669,5 +682,72 @@ void tst_QTextBrowser::urlEncoding()
delete browser;
}
+void tst_QTextBrowser::sourceType_data()
+{
+ QTest::addColumn<QString>("sourceFile");
+ QTest::addColumn<QTextDocument::ResourceType>("sourceType");
+ QTest::addColumn<int>("expectedMaxHeadingLevel");
+ QTest::addColumn<QTextDocument::ResourceType>("expectedSourceType");
+
+#if QT_CONFIG(textmarkdownreader)
+ const int maxMdHeadingLevel = 3;
+ const QTextDocument::ResourceType mdExpectedType = QTextDocument::MarkdownResource;
+#else
+ // If Qt doesn't support markdown, and we read a MD document anyway, it won't have any H3's.
+ const int maxMdHeadingLevel = 0;
+ const QTextDocument::ResourceType mdExpectedType = QTextDocument::HtmlResource;
+#endif
+ QTest::newRow("markdown detected") << "markdown.md" << QTextDocument::UnknownResource << maxMdHeadingLevel << mdExpectedType;
+ QTest::newRow("markdown specified") << "markdown.really" << QTextDocument::MarkdownResource << maxMdHeadingLevel << mdExpectedType;
+ QTest::newRow("markdown not identified") << "markdown.really" << QTextDocument::UnknownResource << 0 << QTextDocument::HtmlResource;
+ QTest::newRow("html detected") << "heading.html" << QTextDocument::UnknownResource << 3 << QTextDocument::HtmlResource;
+ QTest::newRow("html specified") << "heading.html" << QTextDocument::HtmlResource << 3 << QTextDocument::HtmlResource;
+}
+
+void tst_QTextBrowser::sourceType()
+{
+ QFETCH(QString, sourceFile);
+ QFETCH(QTextDocument::ResourceType, sourceType);
+ QFETCH(int, expectedMaxHeadingLevel);
+ QFETCH(QTextDocument::ResourceType, expectedSourceType);
+ if (sourceType == QTextDocument::UnknownResource)
+ // verify that the property setter works, with its default parameter for sourceType
+ browser->setProperty("source", QUrl::fromLocalFile(QFINDTESTDATA(sourceFile)));
+ else
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA(sourceFile)), sourceType);
+ QCOMPARE(browser->sourceType(), expectedSourceType);
+ QTextFrame::iterator iterator = browser->document()->rootFrame()->begin();
+ int maxHeadingLevel = -1;
+ while (!iterator.atEnd())
+ maxHeadingLevel = qMax(iterator++.currentBlock().blockFormat().intProperty(QTextFormat::HeadingLevel), maxHeadingLevel);
+ QCOMPARE(maxHeadingLevel, expectedMaxHeadingLevel);
+}
+
+void tst_QTextBrowser::unicode_data()
+{
+ QTest::addColumn<QString>("sourceFile");
+ QTest::addColumn<QTextDocument::ResourceType>("sourceType");
+ QTest::addColumn<QString>("expectedText");
+
+#if QT_CONFIG(textmarkdownreader)
+ QTest::newRow("markdown with quotes and fractions") << "quotesAndFractions.md" << QTextDocument::MarkdownResource <<
+ "you\u2019ll hope to see \u275Dquotes\u275E \uFE601\u00BD \u2154 \u00BC \u2157 \u215A \u215D some \u201Cvulgar\u201D fractions (pardon my \u00ABFrench\u00BB)";
+#endif
+}
+
+void tst_QTextBrowser::unicode()
+{
+ QFETCH(QString, sourceFile);
+ QFETCH(QTextDocument::ResourceType, sourceType);
+ QFETCH(QString, expectedText);
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA(sourceFile)), sourceType);
+ QTextFrame::iterator iterator = browser->document()->rootFrame()->begin();
+ while (!iterator.atEnd()) {
+ QString blockText = iterator++.currentBlock().text();
+ if (!blockText.isEmpty())
+ QCOMPARE(blockText, expectedText);
+ }
+}
+
QTEST_MAIN(tst_QTextBrowser)
#include "tst_qtextbrowser.moc"
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 3669935823..b31e230893 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -160,6 +160,7 @@ private slots:
void selectionChanged();
#ifndef QT_NO_CLIPBOARD
void copyPasteBackgroundImage();
+ void copyPasteForegroundImage();
#endif
void setText();
void cursorRect();
@@ -1904,6 +1905,36 @@ void tst_QTextEdit::copyPasteBackgroundImage()
ba.texture().cacheKey() == bb.texture().cacheKey());
QFile::remove(QLatin1String("foo.png"));
}
+
+void tst_QTextEdit::copyPasteForegroundImage()
+{
+ ed->clear();
+
+ QPixmap pix(20, 20);
+ pix.fill(Qt::blue);
+
+ QTextCharFormat fmt;
+ {
+ QBrush textureBrush;
+ {
+ textureBrush.setTexture(pix);
+ }
+ textureBrush.setStyle(Qt::TexturePattern);
+ fmt.setForeground(textureBrush);
+ }
+ ed->textCursor().insertText("Foobar", fmt);
+
+ ed->moveCursor(QTextCursor::Start);
+ ed->moveCursor(QTextCursor::End, QTextCursor::KeepAnchor);
+
+ ed->copy();
+ ed->clear();
+ ed->paste();
+
+ QBrush brush = ed->textCursor().charFormat().foreground();
+ QCOMPARE(brush.style(), Qt::TexturePattern);
+ QCOMPARE(brush.texture().cacheKey(), pix.cacheKey());
+}
#endif
void tst_QTextEdit::setText()
@@ -1947,8 +1978,23 @@ void tst_QTextEdit::fullWidthSelection_data()
#endif
#ifdef QT_BUILD_INTERNAL
+
+// With the fix for QTBUG-78318 scaling of documentMargin is added. The testing framework
+// forces qt_defaultDpi() to always return 96 DPI. For systems where the actual DPI differs
+// (typically 72 DPI) this would now cause scaling of the documentMargin when
+// drawing QTextEdit into QImage. In order to avoid the need of multiple reference PNGs
+// for comparison we disable the Qt::AA_Use96Dpi attribute for these tests.
+
+struct ForceSystemDpiHelper {
+ ForceSystemDpiHelper() { QCoreApplication::setAttribute(Qt::AA_Use96Dpi, false); }
+ ~ForceSystemDpiHelper() { QCoreApplication::setAttribute(Qt::AA_Use96Dpi, old); }
+ bool old = QCoreApplication::testAttribute(Qt::AA_Use96Dpi);
+};
+
void tst_QTextEdit::fullWidthSelection()
{
+ ForceSystemDpiHelper useSystemDpi;
+
QFETCH(int, cursorFrom);
QFETCH(int, cursorTo);
QFETCH(QString, imageFileName);
@@ -2017,6 +2063,8 @@ void tst_QTextEdit::fullWidthSelection()
#ifdef QT_BUILD_INTERNAL
void tst_QTextEdit::fullWidthSelection2()
{
+ ForceSystemDpiHelper useSystemDpi;
+
QPalette myPalette;
myPalette.setColor(QPalette::All, QPalette::HighlightedText, QColor(0,0,0,0));
myPalette.setColor(QPalette::All, QPalette::Highlight, QColor(239,221,85));
@@ -2638,12 +2686,14 @@ void tst_QTextEdit::wheelEvent()
ed.setReadOnly(true);
float defaultFontSize = ed.font().pointSizeF();
- QWheelEvent wheelUp(QPointF(), QPointF(), QPoint(), QPoint(0, 120), 120, Qt::Vertical, Qt::NoButton, Qt::ControlModifier);
+ QWheelEvent wheelUp(QPointF(), QPointF(), QPoint(), QPoint(0, 120),
+ Qt::NoButton, Qt::ControlModifier, Qt::NoScrollPhase, Qt::MouseEventNotSynthesized);
ed.wheelEvent(&wheelUp);
QCOMPARE(defaultFontSize + 1, ed.font().pointSizeF());
- QWheelEvent wheelHalfDown(QPointF(), QPointF(), QPoint(), QPoint(0, -60), -60, Qt::Vertical, Qt::NoButton, Qt::ControlModifier);
+ QWheelEvent wheelHalfDown(QPointF(), QPointF(), QPoint(), QPoint(0, -60),
+ Qt::NoButton, Qt::ControlModifier, Qt::NoScrollPhase, Qt::MouseEventNotSynthesized);
ed.wheelEvent(&wheelHalfDown);
QCOMPARE(defaultFontSize + 0.5, ed.font().pointSizeF());
diff --git a/tests/auto/widgets/widgets/qtoolbutton/BLACKLIST b/tests/auto/widgets/widgets/qtoolbutton/BLACKLIST
index df4fda196f..52ba36562f 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/BLACKLIST
+++ b/tests/auto/widgets/widgets/qtoolbutton/BLACKLIST
@@ -1,2 +1,2 @@
[task176137_autoRepeatOfAction]
-osx ci
+osx-10.13
diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
index 752e39c23f..d40c8c2fd6 100644
--- a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
+++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
@@ -34,6 +34,7 @@
#include <QTcpServer>
#include <QTcpSocket>
#include <QTimer>
+#include <QElapsedTimer>
#include <QtDebug>
#include <QtTest/QtTest>
#include <QXmlDefaultHandler>
@@ -259,7 +260,7 @@ public:
// Delibrately wait a maximum of 10 seconds for the sake
// of the test, so it doesn't unduly hang
const int waitTime = qMax(10000, msecs);
- QTime t;
+ QElapsedTimer t;
t.start();
while (t.elapsed() < waitTime) {
QCoreApplication::processEvents();
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
index 15f10232bd..b5d9fea315 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
@@ -72,7 +72,7 @@ int main(int argc, const char *argv[])
QFile in_file(file_name);
if (!in_file.open(QIODevice::ReadOnly)) {
- qerr << "Could not open " << file_name << ": " << strerror(errno) << endl;
+ qerr << "Could not open " << file_name << ": " << strerror(errno) << Qt::endl;
return 1;
}
@@ -87,7 +87,7 @@ int main(int argc, const char *argv[])
} else {
_out_file.setFileName(out_file_name);
if (!_out_file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
- qerr << "Could not open " << out_file_name << ": " << strerror(errno) << endl;
+ qerr << "Could not open " << out_file_name << ": " << strerror(errno) << Qt::endl;
return 1;
}
_out_stream.setDevice(&_out_file);
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
index 17351883c3..556603a681 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
@@ -28,7 +28,7 @@
#include <qxml.h>
-#include <qregexp.h>
+#include <qregularexpression.h>
#include "parser.h"
@@ -139,11 +139,11 @@ bool ContentHandler::startElement(const QString &namespaceURI,
QString ContentHandler::escapeStr(const QString &s)
{
QString result = s;
- result.replace(QRegExp("\""), "\\\"");
- result.replace(QRegExp("\\"), "\\\\");
- result.replace(QRegExp("\n"), "\\n");
- result.replace(QRegExp("\r"), "\\r");
- result.replace(QRegExp("\t"), "\\t");
+ result.replace(QRegularExpression("\""), "\\\"");
+ result.replace(QRegularExpression("\\"), "\\\\");
+ result.replace(QRegularExpression("\n"), "\\n");
+ result.replace(QRegularExpression("\r"), "\\r");
+ result.replace(QRegularExpression("\t"), "\\t");
return result;
}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak
deleted file mode 100644
index 2d80c8f3fb..0000000000
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/sa/089.xml.bak
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE doc [
-<!ENTITY e "&#x10000;&#x10FFFD;&#x10FFFF;">
-<!ELEMENT doc (#PCDATA)>
-]>
-<doc>&e;</doc>
diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp
index c9f9cd9bd2..aa496d6c54 100644
--- a/tests/baselineserver/shared/baselineprotocol.cpp
+++ b/tests/baselineserver/shared/baselineprotocol.cpp
@@ -38,6 +38,7 @@
#include <QDir>
#include <QTime>
#include <QPointer>
+#include <QRegExp>
const QString PI_Project(QLS("Project"));
const QString PI_TestCase(QLS("TestCase"));
@@ -291,7 +292,8 @@ void ImageItem::writeImageToStream(QDataStream &out) const
out << quint8('Q') << quint8(image.format());
out << quint8(QSysInfo::ByteOrder) << quint8(0); // pad to multiple of 4 bytes
out << quint32(image.width()) << quint32(image.height()) << quint32(image.bytesPerLine());
- out << qCompress((const uchar *)image.constBits(), image.byteCount());
+ out << qCompress(reinterpret_cast<const uchar *>(image.constBits()),
+ int(image.sizeInBytes()));
//# can be followed by colormap for formats that use it
}
diff --git a/tests/benchmarks/corelib/corelib.pro b/tests/benchmarks/corelib/corelib.pro
index b5781ad49e..010abd7751 100644
--- a/tests/benchmarks/corelib/corelib.pro
+++ b/tests/benchmarks/corelib/corelib.pro
@@ -4,7 +4,9 @@ SUBDIRS = \
json \
mimetypes \
kernel \
+ text \
thread \
+ time \
tools \
codecs \
plugin
diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
index e71daccf7d..eae752d99a 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
@@ -78,24 +78,22 @@ void tst_qdiriterator::data()
}
#ifdef Q_OS_WIN
-static int posix_helper(const wchar_t *dirpath)
+static int posix_helper(const wchar_t *dirpath, size_t length)
{
int count = 0;
HANDLE hSearch;
WIN32_FIND_DATA fd;
- const size_t origDirPathLength = wcslen(dirpath);
-
wchar_t appendedPath[MAX_PATH];
- wcscpy(appendedPath, dirpath);
- wcscat(appendedPath, L"\\*");
+ Q_ASSERT(MAX_PATH > length + 3);
+ wcsncpy(appendedPath, dirpath, length);
+ wcscpy(appendedPath + length, L"\\*");
#ifndef Q_OS_WINRT
hSearch = FindFirstFile(appendedPath, &fd);
#else
hSearch = FindFirstFileEx(appendedPath, FindExInfoStandard, &fd,
FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH);
#endif
- appendedPath[origDirPathLength] = 0;
if (hSearch == INVALID_HANDLE_VALUE) {
qWarning("FindFirstFile failed");
@@ -107,10 +105,12 @@ static int posix_helper(const wchar_t *dirpath)
!(fd.cFileName[0] == L'.' && fd.cFileName[1] == L'.' && fd.cFileName[2] == 0))
{
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- wcscat(appendedPath, L"\\");
- wcscat(appendedPath, fd.cFileName);
- count += posix_helper(appendedPath);
- appendedPath[origDirPathLength] = 0;
+ // newLength will "point" to where we put a * earlier, so we overwrite that.
+ size_t newLength = length + 1; // "+ 1" for directory separator
+ Q_ASSERT(newLength + wcslen(fd.cFileName) + 1 < MAX_PATH); // "+ 1" for null-terminator
+ wcscpy(appendedPath + newLength, fd.cFileName);
+ newLength += wcslen(fd.cFileName);
+ count += posix_helper(appendedPath, newLength);
}
else {
++count;
@@ -164,8 +164,8 @@ void tst_qdiriterator::posix()
QBENCHMARK {
#ifdef Q_OS_WIN
wchar_t wPath[MAX_PATH];
- path.toWCharArray(wPath);
- count = posix_helper(wPath);
+ const int end = path.toWCharArray(wPath);
+ count = posix_helper(wPath, end);
#else
count = posix_helper(dirpath.constData());
#endif
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
index d68264b78f..6ee8b4e93b 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
@@ -218,8 +218,9 @@ void QFileSystemIteratorPrivate::pushSubDirectory(const QByteArray &path)
#ifdef Q_OS_WIN
wchar_t szSearchPath[MAX_PATH];
- QString::fromLatin1(path).toWCharArray(szSearchPath);
- wcscat(szSearchPath, L"\\*");
+ const int end = QString::fromLatin1(path + "\\*").toWCharArray(szSearchPath);
+ Q_ASSERT(end < MAX_PATH);
+ szSearchPath[end] = L'\0';
#ifndef Q_OS_WINRT
HANDLE dir = FindFirstFile(szSearchPath, &m_fileSearchResult);
#else
diff --git a/tests/benchmarks/corelib/kernel/kernel.pro b/tests/benchmarks/corelib/kernel/kernel.pro
index 02eeeaa254..92f7174419 100644
--- a/tests/benchmarks/corelib/kernel/kernel.pro
+++ b/tests/benchmarks/corelib/kernel/kernel.pro
@@ -5,7 +5,8 @@ SUBDIRS = \
qmetatype \
qobject \
qvariant \
- qcoreapplication
+ qcoreapplication \
+ qtimer_vs_qmetaobject
!qtHaveModule(widgets): SUBDIRS -= \
qmetaobject \
diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
index 66a29780f0..6af5b8d586 100644
--- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
+++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
@@ -28,6 +28,7 @@
#include <QtCore>
#include <QtTest/QtTest>
+#include <QThread>
#define INVOKE_COUNT 10000
@@ -35,8 +36,10 @@ class qtimer_vs_qmetaobject : public QObject
{
Q_OBJECT
private slots:
- void testZeroTimerSingleShot();
- void testQueuedInvokeMethod();
+ void bench();
+ void bench_data();
+ void benchBackgroundThread();
+ void benchBackgroundThread_data() { bench_data(); }
};
class InvokeCounter : public QObject {
@@ -47,36 +50,89 @@ public slots:
void invokeSlot() {
count++;
if (count == INVOKE_COUNT)
- QTestEventLoop::instance().exitLoop();
+ emit allInvoked();
}
+signals:
+ void allInvoked();
protected:
int count;
};
-void qtimer_vs_qmetaobject::testZeroTimerSingleShot()
+void qtimer_vs_qmetaobject::bench()
{
+ QFETCH(int, type);
+
+ std::function<void(InvokeCounter*)> invoke;
+ if (type == 0) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, invokeCounter, SLOT(invokeSlot()));
+ };
+ } else if (type == 1) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, invokeCounter, &InvokeCounter::invokeSlot);
+ };
+ } else if (type == 2) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, invokeCounter, [invokeCounter]() {
+ invokeCounter->invokeSlot();
+ });
+ };
+ } else if (type == 3) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QTimer::singleShot(0, [invokeCounter]() {
+ invokeCounter->invokeSlot();
+ });
+ };
+ } else if (type == 4) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QMetaObject::invokeMethod(invokeCounter, "invokeSlot", Qt::QueuedConnection);
+ };
+ } else if (type == 5) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QMetaObject::invokeMethod(invokeCounter, &InvokeCounter::invokeSlot, Qt::QueuedConnection);
+ };
+ } else if (type == 6) {
+ invoke = [](InvokeCounter* invokeCounter) {
+ QMetaObject::invokeMethod(invokeCounter, [invokeCounter]() {
+ invokeCounter->invokeSlot();
+ }, Qt::QueuedConnection);
+ };
+ } else {
+ QFAIL("unhandled data tag");
+ }
+
QBENCHMARK {
InvokeCounter invokeCounter;
+ QSignalSpy spy(&invokeCounter, &InvokeCounter::allInvoked);
for(int i = 0; i < INVOKE_COUNT; ++i) {
- QTimer::singleShot(0, &invokeCounter, SLOT(invokeSlot()));
+ invoke(&invokeCounter);
}
- QTestEventLoop::instance().enterLoop(10);
- QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(spy.wait(10000));
}
}
-void qtimer_vs_qmetaobject::testQueuedInvokeMethod()
+void qtimer_vs_qmetaobject::bench_data()
{
- QBENCHMARK {
- InvokeCounter invokeCounter;
- for(int i = 0; i < INVOKE_COUNT; ++i) {
- QMetaObject::invokeMethod(&invokeCounter, "invokeSlot", Qt::QueuedConnection);
- }
- QTestEventLoop::instance().enterLoop(10);
- QVERIFY(!QTestEventLoop::instance().timeout());
- }
+ QTest::addColumn<int>("type");
+ QTest::addRow("singleShot_slot") << 0;
+ QTest::addRow("singleShot_pmf") << 1;
+ QTest::addRow("singleShot_functor") << 2;
+ QTest::addRow("singleShot_functor_noctx") << 3;
+ QTest::addRow("invokeMethod_string") << 4;
+ QTest::addRow("invokeMethod_pmf") << 5;
+ QTest::addRow("invokeMethod_functor") << 6;
}
+void qtimer_vs_qmetaobject::benchBackgroundThread()
+{
+#if !QT_CONFIG(cxx11_future)
+ QSKIP("This test requires QThread::create");
+#else
+ QScopedPointer<QThread> thread(QThread::create([this]() { bench(); }));
+ thread->start();
+ QVERIFY(thread->wait());
+#endif
+}
QTEST_MAIN(qtimer_vs_qmetaobject)
diff --git a/tests/benchmarks/corelib/tools/qbytearray/main.cpp b/tests/benchmarks/corelib/text/qbytearray/main.cpp
index e421e7436b..e421e7436b 100644
--- a/tests/benchmarks/corelib/tools/qbytearray/main.cpp
+++ b/tests/benchmarks/corelib/text/qbytearray/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro b/tests/benchmarks/corelib/text/qbytearray/qbytearray.pro
index cf28b0247f..cf28b0247f 100644
--- a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
+++ b/tests/benchmarks/corelib/text/qbytearray/qbytearray.pro
diff --git a/tests/benchmarks/corelib/tools/qchar/main.cpp b/tests/benchmarks/corelib/text/qchar/main.cpp
index 4dcf86786d..4dcf86786d 100644
--- a/tests/benchmarks/corelib/tools/qchar/main.cpp
+++ b/tests/benchmarks/corelib/text/qchar/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qchar/qchar.pro b/tests/benchmarks/corelib/text/qchar/qchar.pro
index 80a9861f48..80a9861f48 100644
--- a/tests/benchmarks/corelib/tools/qchar/qchar.pro
+++ b/tests/benchmarks/corelib/text/qchar/qchar.pro
diff --git a/tests/benchmarks/corelib/tools/qlocale/main.cpp b/tests/benchmarks/corelib/text/qlocale/main.cpp
index 38d94af143..38d94af143 100644
--- a/tests/benchmarks/corelib/tools/qlocale/main.cpp
+++ b/tests/benchmarks/corelib/text/qlocale/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qlocale/qlocale.pro b/tests/benchmarks/corelib/text/qlocale/qlocale.pro
index e56bbe0341..e56bbe0341 100644
--- a/tests/benchmarks/corelib/tools/qlocale/qlocale.pro
+++ b/tests/benchmarks/corelib/text/qlocale/qlocale.pro
diff --git a/tests/benchmarks/corelib/tools/qregexp/main.cpp b/tests/benchmarks/corelib/text/qregexp/main.cpp
index 798b23f2b0..798b23f2b0 100644
--- a/tests/benchmarks/corelib/tools/qregexp/main.cpp
+++ b/tests/benchmarks/corelib/text/qregexp/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro b/tests/benchmarks/corelib/text/qregexp/qregexp.pro
index f64ae781a2..f64ae781a2 100644
--- a/tests/benchmarks/corelib/tools/qregexp/qregexp.pro
+++ b/tests/benchmarks/corelib/text/qregexp/qregexp.pro
diff --git a/tests/benchmarks/corelib/tools/qregexp/qregexp.qrc b/tests/benchmarks/corelib/text/qregexp/qregexp.qrc
index a7fe13c035..a7fe13c035 100644
--- a/tests/benchmarks/corelib/tools/qregexp/qregexp.qrc
+++ b/tests/benchmarks/corelib/text/qregexp/qregexp.qrc
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/text/qstring/main.cpp
index 826a843c10..826a843c10 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/text/qstring/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qstring/qstring.pro b/tests/benchmarks/corelib/text/qstring/qstring.pro
index 9f5e34b915..9f5e34b915 100644
--- a/tests/benchmarks/corelib/tools/qstring/qstring.pro
+++ b/tests/benchmarks/corelib/text/qstring/qstring.pro
diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp b/tests/benchmarks/corelib/text/qstringbuilder/main.cpp
index d0dfe3b1a7..0de6d33846 100644
--- a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp
+++ b/tests/benchmarks/corelib/text/qstringbuilder/main.cpp
@@ -401,7 +401,7 @@ private slots:
}
private:
- const QLatin1Literal l1literal;
+ const QLatin1String l1literal;
const QLatin1String l1string;
const QByteArray ba;
const QString string;
diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro b/tests/benchmarks/corelib/text/qstringbuilder/qstringbuilder.pro
index fa4cbe3c13..fa4cbe3c13 100644
--- a/tests/benchmarks/corelib/tools/qstringbuilder/qstringbuilder.pro
+++ b/tests/benchmarks/corelib/text/qstringbuilder/qstringbuilder.pro
diff --git a/tests/benchmarks/corelib/tools/qstringlist/.gitignore b/tests/benchmarks/corelib/text/qstringlist/.gitignore
index 3e0cdc952f..3e0cdc952f 100644
--- a/tests/benchmarks/corelib/tools/qstringlist/.gitignore
+++ b/tests/benchmarks/corelib/text/qstringlist/.gitignore
diff --git a/tests/benchmarks/corelib/tools/qstringlist/main.cpp b/tests/benchmarks/corelib/text/qstringlist/main.cpp
index ae355a8b89..ae355a8b89 100644
--- a/tests/benchmarks/corelib/tools/qstringlist/main.cpp
+++ b/tests/benchmarks/corelib/text/qstringlist/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro b/tests/benchmarks/corelib/text/qstringlist/qstringlist.pro
index 5803e7da0e..5803e7da0e 100644
--- a/tests/benchmarks/corelib/tools/qstringlist/qstringlist.pro
+++ b/tests/benchmarks/corelib/text/qstringlist/qstringlist.pro
diff --git a/tests/benchmarks/corelib/text/text.pro b/tests/benchmarks/corelib/text/text.pro
new file mode 100644
index 0000000000..a2397b37fe
--- /dev/null
+++ b/tests/benchmarks/corelib/text/text.pro
@@ -0,0 +1,9 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ qbytearray \
+ qchar \
+ qlocale \
+ qstringbuilder \
+ qstringlist
+
+*g++*: SUBDIRS += qstring
diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro b/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro
index 86102adecd..a1827d0276 100644
--- a/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro
+++ b/tests/benchmarks/corelib/thread/qreadwritelock/qreadwritelock.pro
@@ -1,6 +1,7 @@
TEMPLATE = app
TARGET = tst_bench_qreadwritelock
-QT = core testlib
+QT = core-private testlib
SOURCES += tst_qreadwritelock.cpp
CONFIG += c++14 # for std::shared_timed_mutex
+CONFIG += c++1z # for std::shared_mutex
diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index fcf600a059..1d47d98657 100644
--- a/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -28,12 +28,14 @@
#include <QtCore/QtCore>
#include <QtTest/QtTest>
+#include <QtCore/private/qmemory_p.h>
#include <mutex>
#if QT_HAS_INCLUDE(<shared_mutex>)
#if __cplusplus > 201103L
#include <shared_mutex>
#endif
#endif
+#include <vector>
// Wrapers that take pointers instead of reference to have the same interface as Qt
template <typename T>
@@ -63,6 +65,8 @@ private slots:
void uncontended();
void readOnly_data();
void readOnly();
+ void writeOnly_data();
+ void writeOnly();
// void readWrite();
};
@@ -106,6 +110,14 @@ void tst_QReadWriteLock::uncontended_data()
<< FunctionPtrHolder(testUncontended<QReadWriteLock, QWriteLocker>);
QTest::newRow("std::mutex") << FunctionPtrHolder(
testUncontended<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
+#ifdef __cpp_lib_shared_mutex
+ QTest::newRow("std::shared_mutex, read") << FunctionPtrHolder(
+ testUncontended<std::shared_mutex,
+ LockerWrapper<std::shared_lock<std::shared_mutex>>>);
+ QTest::newRow("std::shared_mutex, write") << FunctionPtrHolder(
+ testUncontended<std::shared_mutex,
+ LockerWrapper<std::unique_lock<std::shared_mutex>>>);
+#endif
#if defined __cpp_lib_shared_timed_mutex
QTest::newRow("std::shared_timed_mutex, read") << FunctionPtrHolder(
testUncontended<std::shared_timed_mutex,
@@ -130,7 +142,7 @@ void testReadOnly()
struct Thread : QThread
{
Mutex *lock;
- void run()
+ void run() override
{
for (int i = 0; i < Iterations; ++i) {
QString s = QString::number(i); // Do something outside the lock
@@ -140,21 +152,20 @@ void testReadOnly()
}
};
Mutex lock;
- QVector<QThread *> threads;
+ std::vector<std::unique_ptr<Thread>> threads;
for (int i = 0; i < threadCount; ++i) {
- auto t = new Thread;
+ auto t = qt_make_unique<Thread>();
t->lock = &lock;
- threads.append(t);
+ threads.push_back(std::move(t));
}
QBENCHMARK {
- for (auto t : threads) {
+ for (auto &t : threads) {
t->start();
}
- for (auto t : threads) {
+ for (auto &t : threads) {
t->wait();
}
}
- qDeleteAll(threads);
}
void tst_QReadWriteLock::readOnly_data()
@@ -166,6 +177,11 @@ void tst_QReadWriteLock::readOnly_data()
QTest::newRow("QReadWriteLock") << FunctionPtrHolder(testReadOnly<QReadWriteLock, QReadLocker>);
QTest::newRow("std::mutex") << FunctionPtrHolder(
testReadOnly<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
+#ifdef __cpp_lib_shared_mutex
+ QTest::newRow("std::shared_mutex") << FunctionPtrHolder(
+ testReadOnly<std::shared_mutex,
+ LockerWrapper<std::shared_lock<std::shared_mutex>>>);
+#endif
#if defined __cpp_lib_shared_timed_mutex
QTest::newRow("std::shared_timed_mutex") << FunctionPtrHolder(
testReadOnly<std::shared_timed_mutex,
@@ -179,5 +195,66 @@ void tst_QReadWriteLock::readOnly()
holder.value();
}
+static QString global_string;
+
+template <typename Mutex, typename Locker>
+void testWriteOnly()
+{
+ struct Thread : QThread
+ {
+ Mutex *lock;
+ void run() override
+ {
+ for (int i = 0; i < Iterations; ++i) {
+ QString s = QString::number(i); // Do something outside the lock
+ Locker locker(lock);
+ global_string = s;
+ }
+ }
+ };
+ Mutex lock;
+ std::vector<std::unique_ptr<Thread>> threads;
+ for (int i = 0; i < threadCount; ++i) {
+ auto t = qt_make_unique<Thread>();
+ t->lock = &lock;
+ threads.push_back(std::move(t));
+ }
+ QBENCHMARK {
+ for (auto &t : threads) {
+ t->start();
+ }
+ for (auto &t : threads) {
+ t->wait();
+ }
+ }
+}
+
+void tst_QReadWriteLock::writeOnly_data()
+{
+ QTest::addColumn<FunctionPtrHolder>("holder");
+
+ // QTest::newRow("nothing") << FunctionPtrHolder(testWriteOnly<int, FakeLock>);
+ QTest::newRow("QMutex") << FunctionPtrHolder(testWriteOnly<QMutex, QMutexLocker>);
+ QTest::newRow("QReadWriteLock") << FunctionPtrHolder(testWriteOnly<QReadWriteLock, QWriteLocker>);
+ QTest::newRow("std::mutex") << FunctionPtrHolder(
+ testWriteOnly<std::mutex, LockerWrapper<std::unique_lock<std::mutex>>>);
+#ifdef __cpp_lib_shared_mutex
+ QTest::newRow("std::shared_mutex") << FunctionPtrHolder(
+ testWriteOnly<std::shared_mutex,
+ LockerWrapper<std::unique_lock<std::shared_mutex>>>);
+#endif
+#if defined __cpp_lib_shared_timed_mutex
+ QTest::newRow("std::shared_timed_mutex") << FunctionPtrHolder(
+ testWriteOnly<std::shared_timed_mutex,
+ LockerWrapper<std::unique_lock<std::shared_timed_mutex>>>);
+#endif
+}
+
+void tst_QReadWriteLock::writeOnly()
+{
+ QFETCH(FunctionPtrHolder, holder);
+ holder.value();
+}
+
QTEST_MAIN(tst_QReadWriteLock)
#include "tst_qreadwritelock.moc"
diff --git a/tests/benchmarks/corelib/time/qdate/qdate.pro b/tests/benchmarks/corelib/time/qdate/qdate.pro
new file mode 100644
index 0000000000..a655917135
--- /dev/null
+++ b/tests/benchmarks/corelib/time/qdate/qdate.pro
@@ -0,0 +1,4 @@
+TARGET = tst_bench_qdate
+QT = core testlib
+
+SOURCES += tst_bench_qdate.cpp
diff --git a/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp b/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp
new file mode 100644
index 0000000000..10c013c080
--- /dev/null
+++ b/tests/benchmarks/corelib/time/qdate/tst_bench_qdate.cpp
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDate>
+#include <QTest>
+#include <QVector>
+
+class tst_QDate : public QObject
+{
+ Q_OBJECT
+
+ enum : qint64
+ {
+ JULIAN_DAY_2010 = 2455198,
+ JULIAN_DAY_2011 = 2455563,
+ JULIAN_DAY_2020 = 2458850,
+ };
+
+ static QVector<QDate> daily(qint64 start, qint64 end);
+ static QVector<QDate> yearly(qint32 first, qint32 last);
+
+private Q_SLOTS:
+ void create();
+ void year();
+ void month();
+ void day();
+ void dayOfWeek();
+ void dayOfYear();
+ void monthLengths(); // isValid() and daysInMonth()
+ void daysInYear();
+ void isLeapYear();
+ void getSetDate();
+ void addDays();
+ void addMonths();
+ void addYears();
+};
+
+QVector<QDate> tst_QDate::daily(qint64 start, qint64 end)
+{
+ QVector<QDate> list;
+ list.reserve(end - start);
+ for (qint64 jd = start; jd < end; ++jd)
+ list.append(QDate::fromJulianDay(jd));
+ return list;
+}
+
+QVector<QDate> tst_QDate::yearly(qint32 first, qint32 last)
+{
+ QVector<QDate> list;
+ list.reserve(last + 1 - first);
+ for (qint32 year = first; year <= last; ++year)
+ list.append(QDate(year, 3, 21));
+ return list;
+}
+
+void tst_QDate::create()
+{
+ QDate test;
+ QBENCHMARK {
+ for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
+ test = QDate::fromJulianDay(jd);
+ }
+ Q_UNUSED(test);
+}
+
+void tst_QDate::year()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDate &test : list)
+ test.year();
+ }
+}
+
+void tst_QDate::month()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDate &test : list)
+ test.month();
+ }
+}
+
+void tst_QDate::day()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDate &test : list)
+ test.day();
+ }
+}
+
+void tst_QDate::dayOfWeek()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDate &test : list)
+ test.dayOfWeek();
+ }
+}
+
+void tst_QDate::dayOfYear()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDate &test : list)
+ test.dayOfYear();
+ }
+}
+
+void tst_QDate::monthLengths()
+{
+ bool check = true;
+ QBENCHMARK {
+ for (int year = 1900; year <= 2100; year++) {
+ for (int month = 1; month <= 12; month++)
+ check = QDate::isValid(year, month, QDate(year, month, 1).daysInMonth());
+ }
+ }
+ Q_UNUSED(check);
+}
+
+void tst_QDate::daysInYear()
+{
+ const auto list = yearly(1601, 2401);
+ QBENCHMARK {
+ for (const QDate date : list)
+ date.daysInYear();
+ }
+}
+
+void tst_QDate::isLeapYear()
+{
+ QBENCHMARK {
+ for (qint32 year = 1601; year <= 2401; year++)
+ QDate::isLeapYear(year);
+ }
+}
+
+void tst_QDate::getSetDate()
+{
+ QDate store;
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const auto test : list) {
+ int year, month, day;
+ test.getDate(&year, &month, &day);
+ store.setDate(year, month, day);
+ }
+ }
+ Q_UNUSED(store);
+}
+
+void tst_QDate::addDays()
+{
+ QDate store;
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const auto test : list)
+ store = test.addDays(17);
+ }
+ Q_UNUSED(store);
+}
+
+void tst_QDate::addMonths()
+{
+ QDate store;
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const auto test : list)
+ store = test.addMonths(17);
+ }
+ Q_UNUSED(store);
+}
+
+void tst_QDate::addYears()
+{
+ QDate store;
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const auto test : list)
+ store = test.addYears(17);
+ }
+ Q_UNUSED(store);
+}
+
+QTEST_MAIN(tst_QDate)
+#include "tst_bench_qdate.moc"
diff --git a/tests/benchmarks/corelib/time/qdatetime/main.cpp b/tests/benchmarks/corelib/time/qdatetime/main.cpp
new file mode 100644
index 0000000000..740e08cc46
--- /dev/null
+++ b/tests/benchmarks/corelib/time/qdatetime/main.cpp
@@ -0,0 +1,574 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QDateTime>
+#include <QTimeZone>
+#include <QTest>
+#include <QVector>
+#include <qdebug.h>
+
+class tst_QDateTime : public QObject
+{
+ Q_OBJECT
+
+ enum : qint64
+ {
+ SECS_PER_DAY = 86400,
+ MSECS_PER_DAY = 86400000,
+ JULIAN_DAY_1950 = 2433283,
+ JULIAN_DAY_1960 = 2436935,
+ JULIAN_DAY_1970 = 2440588, // Epoch
+ JULIAN_DAY_2010 = 2455198,
+ JULIAN_DAY_2011 = 2455563,
+ JULIAN_DAY_2020 = 2458850,
+ JULIAN_DAY_2050 = 2469808,
+ JULIAN_DAY_2060 = 2473460
+ };
+
+ static QVector<QDateTime> daily(qint64 start, qint64 end);
+ static QVector<QDateTime> norse(qint64 start, qint64 end);
+
+private Q_SLOTS:
+ void create();
+ void isNull();
+ void isValid();
+ void date();
+ void time();
+ void timeSpec();
+ void offsetFromUtc();
+ void timeZoneAbbreviation();
+ void toMSecsSinceEpoch();
+ void toMSecsSinceEpoch1950();
+ void toMSecsSinceEpoch2050();
+ void toMSecsSinceEpochTz();
+ void toMSecsSinceEpoch1950Tz();
+ void toMSecsSinceEpoch2050Tz();
+ void setDate();
+ void setTime();
+ void setTimeSpec();
+ void setOffsetFromUtc();
+ void setMSecsSinceEpoch();
+ void setMSecsSinceEpochTz();
+ void toString();
+ void toStringTextFormat();
+ void toStringIsoFormat();
+ void addDays();
+ void addDaysTz();
+ void addMSecs();
+ void addMSecsTz();
+ void toTimeSpec();
+ void toOffsetFromUtc();
+ void daysTo();
+ void msecsTo();
+ void equivalent();
+ void equivalentUtc();
+ void lessThan();
+ void lessThanUtc();
+ void currentDateTime();
+ void currentDate();
+ void currentTime();
+ void currentDateTimeUtc();
+ void currentMSecsSinceEpoch();
+ void fromString();
+ void fromStringText();
+ void fromStringIso();
+ void fromMSecsSinceEpoch();
+ void fromMSecsSinceEpochUtc();
+ void fromMSecsSinceEpochTz();
+};
+
+QVector<QDateTime> tst_QDateTime::daily(qint64 start, qint64 end)
+{
+ QVector<QDateTime> list;
+ list.reserve(end - start);
+ for (int jd = start; jd < end; ++jd)
+ list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
+ return list;
+}
+
+QVector<QDateTime> tst_QDateTime::norse(qint64 start, qint64 end)
+{
+ const QTimeZone cet("Europe/Oslo");
+ QVector<QDateTime> list;
+ list.reserve(end - start);
+ for (int jd = start; jd < end; ++jd)
+ list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
+ return list;
+}
+
+void tst_QDateTime::create()
+{
+ QBENCHMARK {
+ for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd) {
+ QDateTime test(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0));
+ Q_UNUSED(test)
+ }
+ }
+}
+
+void tst_QDateTime::isNull()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.isNull();
+ }
+}
+
+void tst_QDateTime::isValid()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.isValid();
+ }
+}
+
+void tst_QDateTime::date()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.date();
+ }
+}
+
+void tst_QDateTime::time()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.time();
+ }
+}
+
+void tst_QDateTime::timeSpec()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.timeSpec();
+ }
+}
+
+void tst_QDateTime::offsetFromUtc()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.offsetFromUtc();
+ }
+}
+
+void tst_QDateTime::timeZoneAbbreviation()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.timeZoneAbbreviation();
+ }
+}
+
+void tst_QDateTime::toMSecsSinceEpoch()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toMSecsSinceEpoch();
+ }
+}
+
+void tst_QDateTime::toMSecsSinceEpoch1950()
+{
+ const auto list = daily(JULIAN_DAY_1950, JULIAN_DAY_1960);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toMSecsSinceEpoch();
+ }
+}
+
+void tst_QDateTime::toMSecsSinceEpoch2050()
+{
+ const auto list = daily(JULIAN_DAY_2050, JULIAN_DAY_2060);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toMSecsSinceEpoch();
+ }
+}
+
+void tst_QDateTime::toMSecsSinceEpochTz()
+{
+ qint64 result;
+ const auto list = norse(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = test.toMSecsSinceEpoch();
+ }
+ Q_UNUSED(result);
+}
+
+void tst_QDateTime::toMSecsSinceEpoch1950Tz()
+{
+ qint64 result;
+ const auto list = norse(JULIAN_DAY_1950, JULIAN_DAY_1960);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = test.toMSecsSinceEpoch();
+ }
+ Q_UNUSED(result);
+}
+
+void tst_QDateTime::toMSecsSinceEpoch2050Tz()
+{
+ qint64 result;
+ const auto list = norse(JULIAN_DAY_2050, JULIAN_DAY_2060);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = test.toMSecsSinceEpoch();
+ }
+ Q_UNUSED(result);
+}
+
+void tst_QDateTime::setDate()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (QDateTime test : list)
+ test.setDate(QDate::fromJulianDay(JULIAN_DAY_2010));
+ }
+}
+
+void tst_QDateTime::setTime()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (QDateTime test : list)
+ test.setTime(QTime(12, 0, 0));
+ }
+}
+
+void tst_QDateTime::setTimeSpec()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (QDateTime test : list)
+ test.setTimeSpec(Qt::UTC);
+ }
+}
+
+void tst_QDateTime::setOffsetFromUtc()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (QDateTime test : list)
+ test.setOffsetFromUtc(3600);
+ }
+}
+
+void tst_QDateTime::setMSecsSinceEpoch()
+{
+ qint64 msecs = qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970 + 180) * MSECS_PER_DAY;
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (QDateTime test : list)
+ test.setMSecsSinceEpoch(msecs);
+ }
+}
+
+void tst_QDateTime::setMSecsSinceEpochTz()
+{
+ const qint64 msecs = qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970 + 180) * MSECS_PER_DAY;
+ const auto list = norse(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (QDateTime test : list)
+ test.setMSecsSinceEpoch(msecs);
+ }
+}
+
+void tst_QDateTime::toString()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2011);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toString(QStringLiteral("yyy-MM-dd hh:mm:ss.zzz t"));
+ }
+}
+
+void tst_QDateTime::toStringTextFormat()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2011);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toString(Qt::TextDate);
+ }
+}
+
+void tst_QDateTime::toStringIsoFormat()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2011);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toString(Qt::ISODate);
+ }
+}
+
+void tst_QDateTime::addDays()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QDateTime next;
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ next = test.addDays(1);
+ }
+ Q_UNUSED(next);
+}
+
+void tst_QDateTime::addDaysTz()
+{
+ const auto list = norse(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ QDateTime result = test.addDays(1);
+ }
+}
+
+void tst_QDateTime::addMSecs()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QDateTime next;
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ next = test.addMSecs(1);
+ }
+ Q_UNUSED(next);
+}
+
+void tst_QDateTime::addMSecsTz()
+{
+ const auto list = norse(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ QDateTime result = test.addMSecs(1);
+ }
+}
+
+void tst_QDateTime::toTimeSpec()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toTimeSpec(Qt::UTC);
+ }
+}
+
+void tst_QDateTime::toOffsetFromUtc()
+{
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.toOffsetFromUtc(3600);
+ }
+}
+
+void tst_QDateTime::daysTo()
+{
+ const QDateTime other = QDateTime::fromMSecsSinceEpoch(
+ qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970) * MSECS_PER_DAY);
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.daysTo(other);
+ }
+}
+
+void tst_QDateTime::msecsTo()
+{
+ const QDateTime other = QDateTime::fromMSecsSinceEpoch(
+ qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970) * MSECS_PER_DAY);
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ test.msecsTo(other);
+ }
+}
+
+void tst_QDateTime::equivalent()
+{
+ bool result;
+ const QDateTime other = QDateTime::fromMSecsSinceEpoch(
+ qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970) * MSECS_PER_DAY);
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = (test == other);
+ }
+ Q_UNUSED(result)
+}
+
+void tst_QDateTime::equivalentUtc()
+{
+ bool result = false;
+ const QDateTime other = QDateTime::fromMSecsSinceEpoch(
+ qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970) * MSECS_PER_DAY, Qt::UTC);
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = (test == other);
+ }
+ Q_UNUSED(result)
+}
+
+void tst_QDateTime::lessThan()
+{
+ bool result = false;
+ const QDateTime other = QDateTime::fromMSecsSinceEpoch(
+ qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970) * MSECS_PER_DAY);
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = (test < other);
+ }
+ Q_UNUSED(result)
+}
+
+void tst_QDateTime::lessThanUtc()
+{
+ bool result = false;
+ const QDateTime other = QDateTime::fromMSecsSinceEpoch(
+ qint64(JULIAN_DAY_2010 - JULIAN_DAY_1970) * MSECS_PER_DAY, Qt::UTC);
+ const auto list = daily(JULIAN_DAY_2010, JULIAN_DAY_2020);
+ QBENCHMARK {
+ for (const QDateTime &test : list)
+ result = (test < other);
+ }
+ Q_UNUSED(result)
+}
+
+void tst_QDateTime::currentDateTime()
+{
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDateTime::currentDateTime();
+ }
+}
+
+void tst_QDateTime::currentDate()
+{
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDate::currentDate();
+ }
+}
+
+void tst_QDateTime::currentTime()
+{
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QTime::currentTime();
+ }
+}
+
+void tst_QDateTime::currentDateTimeUtc()
+{
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDateTime::currentDateTimeUtc();
+ }
+}
+
+void tst_QDateTime::currentMSecsSinceEpoch()
+{
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDateTime::currentMSecsSinceEpoch();
+ }
+}
+
+void tst_QDateTime::fromString()
+{
+ QString format = "yyyy-MM-dd hh:mm:ss.zzz";
+ QString input = "2010-01-01 13:12:11.999";
+ QVERIFY(QDateTime::fromString(input, format).isValid());
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDateTime::fromString(input, format);
+ }
+}
+
+void tst_QDateTime::fromStringText()
+{
+ QString input = "Wed Jan 2 01:02:03.000 2013 GMT";
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDateTime::fromString(input, Qt::TextDate);
+ }
+}
+
+void tst_QDateTime::fromStringIso()
+{
+ QString input = "2010-01-01T13:28:34.999Z";
+ QBENCHMARK {
+ for (int i = 0; i < 1000; ++i)
+ QDateTime::fromString(input, Qt::ISODate);
+ }
+}
+
+void tst_QDateTime::fromMSecsSinceEpoch()
+{
+ const int start = JULIAN_DAY_2010 - JULIAN_DAY_1970;
+ const int end = JULIAN_DAY_2020 - JULIAN_DAY_1970;
+ QBENCHMARK {
+ for (int jd = start; jd < end; ++jd)
+ QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, Qt::LocalTime);
+ }
+}
+
+void tst_QDateTime::fromMSecsSinceEpochUtc()
+{
+ const int start = JULIAN_DAY_2010 - JULIAN_DAY_1970;
+ const int end = JULIAN_DAY_2020 - JULIAN_DAY_1970;
+ QBENCHMARK {
+ for (int jd = start; jd < end; ++jd)
+ QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, Qt::UTC);
+ }
+}
+
+void tst_QDateTime::fromMSecsSinceEpochTz()
+{
+ const int start = JULIAN_DAY_2010 - JULIAN_DAY_1970;
+ const int end = JULIAN_DAY_2020 - JULIAN_DAY_1970;
+ const QTimeZone cet("Europe/Oslo");
+ QBENCHMARK {
+ for (int jd = start; jd < end; ++jd)
+ QDateTime test = QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, cet);
+ }
+}
+
+QTEST_MAIN(tst_QDateTime)
+
+#include "main.moc"
diff --git a/tests/benchmarks/corelib/tools/qdatetime/qdatetime.pro b/tests/benchmarks/corelib/time/qdatetime/qdatetime.pro
index a85e7346c6..a85e7346c6 100644
--- a/tests/benchmarks/corelib/tools/qdatetime/qdatetime.pro
+++ b/tests/benchmarks/corelib/time/qdatetime/qdatetime.pro
diff --git a/tests/benchmarks/corelib/tools/qtimezone/main.cpp b/tests/benchmarks/corelib/time/qtimezone/main.cpp
index 65455a7261..65455a7261 100644
--- a/tests/benchmarks/corelib/tools/qtimezone/main.cpp
+++ b/tests/benchmarks/corelib/time/qtimezone/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qtimezone/qtimezone.pro b/tests/benchmarks/corelib/time/qtimezone/qtimezone.pro
index d0531b568b..d0531b568b 100644
--- a/tests/benchmarks/corelib/tools/qtimezone/qtimezone.pro
+++ b/tests/benchmarks/corelib/time/qtimezone/qtimezone.pro
diff --git a/tests/benchmarks/corelib/time/time.pro b/tests/benchmarks/corelib/time/time.pro
new file mode 100644
index 0000000000..b5184845d9
--- /dev/null
+++ b/tests/benchmarks/corelib/time/time.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ qdate \
+ qdatetime \
+ qtimezone
diff --git a/tests/benchmarks/corelib/tools/qdatetime/main.cpp b/tests/benchmarks/corelib/tools/qdatetime/main.cpp
deleted file mode 100644
index 2c1e3d97ae..0000000000
--- a/tests/benchmarks/corelib/tools/qdatetime/main.cpp
+++ /dev/null
@@ -1,604 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QDateTime>
-#include <QTimeZone>
-#include <QTest>
-#include <qdebug.h>
-
-class tst_QDateTime : public QObject
-{
- Q_OBJECT
-
- enum
-#if defined(Q_COMPILER_CLASS_ENUM) || (defined(Q_CC_MSVC) && _MSC_VER >= 1700)
- : qint64
-#endif
- {
- SECS_PER_DAY = 86400,
- MSECS_PER_DAY = 86400000,
- JULIAN_DAY_1950 = 2433283,
- JULIAN_DAY_1960 = 2436935,
- JULIAN_DAY_2010 = 2455198,
- JULIAN_DAY_2011 = 2455563,
- JULIAN_DAY_2020 = 2458850,
- JULIAN_DAY_2050 = 2469808,
- JULIAN_DAY_2060 = 2473460
- };
-
-private Q_SLOTS:
- void create();
- void isNull();
- void isValid();
- void date();
- void time();
- void timeSpec();
- void offsetFromUtc();
- void timeZoneAbbreviation();
- void toMSecsSinceEpoch();
- void toMSecsSinceEpoch1950();
- void toMSecsSinceEpoch2050();
- void toMSecsSinceEpochTz();
- void toMSecsSinceEpoch1950Tz();
- void toMSecsSinceEpoch2050Tz();
- void setDate();
- void setTime();
- void setTimeSpec();
- void setOffsetFromUtc();
- void setMSecsSinceEpoch();
- void setMSecsSinceEpochTz();
- void toString();
- void toStringTextFormat();
- void toStringIsoFormat();
- void addDays();
- void addDaysTz();
- void addMSecs();
- void addMSecsTz();
- void toTimeSpec();
- void toOffsetFromUtc();
- void daysTo();
- void msecsTo();
- void equivalent();
- void equivalentUtc();
- void lessThan();
- void lessThanUtc();
- void currentDateTime();
- void currentDate();
- void currentTime();
- void currentDateTimeUtc();
- void currentMSecsSinceEpoch();
- void fromString();
- void fromStringText();
- void fromStringIso();
- void fromMSecsSinceEpoch();
- void fromMSecsSinceEpochUtc();
- void fromMSecsSinceEpochTz();
-};
-
-void tst_QDateTime::create()
-{
- QBENCHMARK {
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd) {
- QDateTime test(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0));
- Q_UNUSED(test)
- }
- }
-}
-
-void tst_QDateTime::isNull()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.isNull();
- }
-}
-
-void tst_QDateTime::isValid()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.isValid();
- }
-}
-
-void tst_QDateTime::date()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.date();
- }
-}
-
-void tst_QDateTime::time()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.time();
- }
-}
-
-void tst_QDateTime::timeSpec()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.timeSpec();
- }
-}
-
-void tst_QDateTime::offsetFromUtc()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.offsetFromUtc();
- }
-}
-
-void tst_QDateTime::timeZoneAbbreviation()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.timeZoneAbbreviation();
- }
-}
-
-void tst_QDateTime::toMSecsSinceEpoch()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::toMSecsSinceEpoch1950()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_1950; jd < JULIAN_DAY_1960; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::toMSecsSinceEpoch2050()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2050; jd < JULIAN_DAY_2060; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::toMSecsSinceEpochTz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- qint64 result = test.toMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::toMSecsSinceEpoch1950Tz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_1950; jd < JULIAN_DAY_1960; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- qint64 result = test.toMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::toMSecsSinceEpoch2050Tz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2050; jd < JULIAN_DAY_2060; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- qint64 result = test.toMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::setDate()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (QDateTime test, list)
- test.setDate(QDate::fromJulianDay(JULIAN_DAY_2010));
- }
-}
-
-void tst_QDateTime::setTime()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (QDateTime test, list)
- test.setTime(QTime(12, 0, 0));
- }
-}
-
-void tst_QDateTime::setTimeSpec()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (QDateTime test, list)
- test.setTimeSpec(Qt::UTC);
- }
-}
-
-void tst_QDateTime::setOffsetFromUtc()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (QDateTime test, list)
- test.setOffsetFromUtc(3600);
- }
-}
-
-void tst_QDateTime::setMSecsSinceEpoch()
-{
- qint64 msecs = qint64(JULIAN_DAY_2010 + 180) * MSECS_PER_DAY;
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (QDateTime test, list)
- test.setMSecsSinceEpoch(msecs);
- }
-}
-
-void tst_QDateTime::setMSecsSinceEpochTz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
- QBENCHMARK {
- foreach (QDateTime test, list)
- test.setMSecsSinceEpoch((JULIAN_DAY_2010 + 180) * MSECS_PER_DAY);
- }
-}
-
-void tst_QDateTime::toString()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2011; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toString(QStringLiteral("yyy-MM-dd hh:mm:ss.zzz t"));
- }
-}
-
-void tst_QDateTime::toStringTextFormat()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2011; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toString(Qt::TextDate);
- }
-}
-
-void tst_QDateTime::toStringIsoFormat()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2011; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toString(Qt::ISODate);
- }
-}
-
-void tst_QDateTime::addDays()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.addDays(1);
- }
-}
-
-void tst_QDateTime::addDaysTz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- QDateTime result = test.addDays(1);
- }
-}
-
-void tst_QDateTime::addMSecs()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.addMSecs(1);
- }
-}
-
-void tst_QDateTime::addMSecsTz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0), cet));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- QDateTime result = test.addMSecs(1);
- }
-}
-
-void tst_QDateTime::toTimeSpec()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toTimeSpec(Qt::UTC);
- }
-}
-
-void tst_QDateTime::toOffsetFromUtc()
-{
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.toOffsetFromUtc(3600);
- }
-}
-
-void tst_QDateTime::daysTo()
-{
- QDateTime other = QDateTime::fromMSecsSinceEpoch(qint64(JULIAN_DAY_2010) * MSECS_PER_DAY);
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.daysTo(other);
- }
-}
-
-void tst_QDateTime::msecsTo()
-{
- QDateTime other = QDateTime::fromMSecsSinceEpoch(qint64(JULIAN_DAY_2010) * MSECS_PER_DAY);
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- test.msecsTo(other);
- }
-}
-
-void tst_QDateTime::equivalent()
-{
- bool result;
- QDateTime other = QDateTime::fromMSecsSinceEpoch(qint64(JULIAN_DAY_2010) * MSECS_PER_DAY);
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- result = (test == other);
- }
- Q_UNUSED(result)
-}
-
-void tst_QDateTime::equivalentUtc()
-{
- bool result = false;
- QDateTime other = QDateTime::fromMSecsSinceEpoch(qint64(JULIAN_DAY_2010) * MSECS_PER_DAY, Qt::UTC);
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- result = (test == other);
- }
- Q_UNUSED(result)
-}
-
-void tst_QDateTime::lessThan()
-{
- bool result = false;
- QDateTime other = QDateTime::fromMSecsSinceEpoch(qint64(JULIAN_DAY_2010) * MSECS_PER_DAY);
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- result = (test < other);
- }
- Q_UNUSED(result)
-}
-
-void tst_QDateTime::lessThanUtc()
-{
- bool result = false;
- QDateTime other = QDateTime::fromMSecsSinceEpoch(qint64(JULIAN_DAY_2010) * MSECS_PER_DAY, Qt::UTC);
- QList<QDateTime> list;
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- list.append(QDateTime(QDate::fromJulianDay(jd), QTime::fromMSecsSinceStartOfDay(0)));
- QBENCHMARK {
- foreach (const QDateTime &test, list)
- result = (test < other);
- }
- Q_UNUSED(result)
-}
-
-void tst_QDateTime::currentDateTime()
-{
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDateTime::currentDateTime();
- }
-}
-
-void tst_QDateTime::currentDate()
-{
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDate::currentDate();
- }
-}
-
-void tst_QDateTime::currentTime()
-{
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QTime::currentTime();
- }
-}
-
-void tst_QDateTime::currentDateTimeUtc()
-{
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDateTime::currentDateTimeUtc();
- }
-}
-
-void tst_QDateTime::currentMSecsSinceEpoch()
-{
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDateTime::currentMSecsSinceEpoch();
- }
-}
-
-void tst_QDateTime::fromString()
-{
- QString format = "yyyy-MM-dd hh:mm:ss.zzz";
- QString input = "2010-01-01 13:12:11.999";
- QVERIFY(QDateTime::fromString(input, format).isValid());
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDateTime::fromString(input, format);
- }
-}
-
-void tst_QDateTime::fromStringText()
-{
- QString input = "Wed Jan 2 01:02:03.000 2013 GMT";
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDateTime::fromString(input, Qt::TextDate);
- }
-}
-
-void tst_QDateTime::fromStringIso()
-{
- QString input = "2010-01-01T13:28:34.999Z";
- QBENCHMARK {
- for (int i = 0; i < 1000; ++i)
- QDateTime::fromString(input, Qt::ISODate);
- }
-}
-
-void tst_QDateTime::fromMSecsSinceEpoch()
-{
- QBENCHMARK {
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, Qt::LocalTime);
- }
-}
-
-void tst_QDateTime::fromMSecsSinceEpochUtc()
-{
- QBENCHMARK {
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, Qt::UTC);
- }
-}
-
-void tst_QDateTime::fromMSecsSinceEpochTz()
-{
- QTimeZone cet = QTimeZone("Europe/Oslo");
- QBENCHMARK {
- for (int jd = JULIAN_DAY_2010; jd < JULIAN_DAY_2020; ++jd)
- QDateTime test = QDateTime::fromMSecsSinceEpoch(jd * MSECS_PER_DAY, cet);
- }
-}
-
-QTEST_MAIN(tst_QDateTime)
-
-#include "main.moc"
diff --git a/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt b/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt
index d5acd28820..662285296f 100644
--- a/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt
+++ b/tests/benchmarks/corelib/tools/qhash/paths_small_data.txt
@@ -47,13 +47,38 @@
./codecs/.obj/debug-shared
./.pch
./.pch/debug-shared
+./text
+./text/text.pro
+./text/qregexp
+./text/qregexp/qregexp.qrc
+./text/qregexp/main.cpp
+./text/qregexp/Makefile
+./text/qregexp/qregexp.pro
+./text/qstringbuilder
+./text/qstringbuilder/main.cpp
+./text/qstringbuilder/Makefile
+./text/qstringbuilder/qstringbuilder.pro
+./text/qstring
+./text/qstring/generatelist.pl
+./text/qstring/data.h
+./text/qstring/qstring.pro
+./text/qstring/main.cpp
+./text/qstring/data.cpp
+./text/qstring/Makefile
+./text/qstring/utf-8.txt
+./text/qstringlist
+./text/qstringlist/qstringlist.pro
+./text/qstringlist/main.cpp
+./text/qstringlist/.gitignore
+./text/qstringlist/Makefile
+./text/qbytearray
+./text/qbytearray/qbytearray.pro
+./text/qbytearray/main.cpp
+./text/qbytearray/Makefile
+./text/.pch
+./text/.pch/debug-shared
./tools
./tools/tools.pro
-./tools/qregexp
-./tools/qregexp/qregexp.qrc
-./tools/qregexp/main.cpp
-./tools/qregexp/Makefile
-./tools/qregexp/qregexp.pro
./tools/qvector
./tools/qvector/tst_vector
./tools/qvector/.pch
@@ -72,31 +97,10 @@
./tools/qvector/qvector.pro
./tools/.pch
./tools/.pch/debug-shared
-./tools/qstringbuilder
-./tools/qstringbuilder/main.cpp
-./tools/qstringbuilder/Makefile
-./tools/qstringbuilder/qstringbuilder.pro
./tools/containers-sequential
./tools/containers-sequential/containers-sequential.pro
./tools/containers-sequential/main.cpp
./tools/containers-sequential/Makefile
-./tools/qstring
-./tools/qstring/generatelist.pl
-./tools/qstring/data.h
-./tools/qstring/qstring.pro
-./tools/qstring/main.cpp
-./tools/qstring/data.cpp
-./tools/qstring/Makefile
-./tools/qstring/utf-8.txt
-./tools/qstringlist
-./tools/qstringlist/qstringlist.pro
-./tools/qstringlist/main.cpp
-./tools/qstringlist/.gitignore
-./tools/qstringlist/Makefile
-./tools/qbytearray
-./tools/qbytearray/qbytearray.pro
-./tools/qbytearray/main.cpp
-./tools/qbytearray/Makefile
./tools/containers-associative
./tools/containers-associative/containers-associative.pro
./tools/containers-associative/main.cpp
diff --git a/tests/benchmarks/corelib/tools/qvector/qrawvector.h b/tests/benchmarks/corelib/tools/qvector/qrawvector.h
index c7173b5b8d..16a911c63a 100644
--- a/tests/benchmarks/corelib/tools/qvector/qrawvector.h
+++ b/tests/benchmarks/corelib/tools/qvector/qrawvector.h
@@ -32,7 +32,6 @@
#include <QtCore/qiterator.h>
#include <QtCore/qdebug.h>
#include <QtCore/qatomic.h>
-#include <QtCore/qalgorithms.h>
#include <QtCore/qlist.h>
#include <QtCore/private/qtools_p.h>
@@ -263,9 +262,9 @@ public:
//static QRawVector<T> fromList(const QList<T> &list);
static inline QRawVector<T> fromStdVector(const std::vector<T> &vector)
- { QRawVector<T> tmp; qCopy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
+ { QRawVector<T> tmp; std::copy(vector.begin(), vector.end(), std::back_inserter(tmp)); return tmp; }
inline std::vector<T> toStdVector() const
- { std::vector<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
+ { std::vector<T> tmp; std::copy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
private:
T *allocate(int alloc);
@@ -568,7 +567,7 @@ typename QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator
int l = int(aend - m_begin);
int n = l - f;
if (QTypeInfo<T>::isComplex) {
- qCopy(m_begin + l, m_begin + m_size, m_begin + f);
+ std::copy(m_begin + l, m_begin + m_size, m_begin + f);
T *i = m_begin + m_size;
T *b = m_begin + m_size - n;
while (i != b) {
diff --git a/tests/benchmarks/corelib/tools/tools.pro b/tests/benchmarks/corelib/tools/tools.pro
index ca9c0a6f89..b4ee0520a6 100644
--- a/tests/benchmarks/corelib/tools/tools.pro
+++ b/tests/benchmarks/corelib/tools/tools.pro
@@ -2,21 +2,12 @@ TEMPLATE = subdirs
SUBDIRS = \
containers-associative \
containers-sequential \
- qbytearray \
qcontiguouscache \
qcryptographichash \
- qdatetime \
qlist \
- qlocale \
qmap \
qrect \
qringbuffer \
qstack \
- qstring \
- qstringbuilder \
- qstringlist \
- qtimezone \
qvector \
qalgorithms
-
-!*g++*: SUBDIRS -= qstring
diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
index 605df100ee..b8afb3bc05 100644
--- a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
+++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
@@ -183,6 +183,7 @@ void tst_QImageConversion::convertRgb32_data()
QTest::newRow("rgb32 -> rgb30") << rgb32 << QImage::Format_RGB30;
QTest::newRow("rgb32 -> a2bgr30") << rgb32 << QImage::Format_A2BGR30_Premultiplied;
QTest::newRow("rgb32 -> rgb888") << rgb32 << QImage::Format_RGB888;
+ QTest::newRow("rgb32 -> bgr888") << rgb32 << QImage::Format_BGR888;
QTest::newRow("rgb32 -> rgb666") << rgb32 << QImage::Format_RGB666;
QTest::newRow("rgb32 -> rgb555") << rgb32 << QImage::Format_RGB555;
QTest::newRow("rgb32 -> argb8565pm") << rgb32 << QImage::Format_ARGB8565_Premultiplied;
@@ -196,6 +197,7 @@ void tst_QImageConversion::convertRgb32_data()
QTest::newRow("argb32 -> rgb30") << argb32 << QImage::Format_RGB30;
QTest::newRow("argb32 -> a2bgr30") << argb32 << QImage::Format_A2BGR30_Premultiplied;
QTest::newRow("argb32 -> rgb888") << argb32 << QImage::Format_RGB888;
+ QTest::newRow("argb32 -> bgr888") << argb32 << QImage::Format_BGR888;
QTest::newRow("argb32 -> rgb666") << argb32 << QImage::Format_RGB666;
QTest::newRow("argb32 -> argb8565pm") << argb32 << QImage::Format_ARGB8565_Premultiplied;
QTest::newRow("argb32 -> argb4444pm") << argb32 << QImage::Format_ARGB4444_Premultiplied;
@@ -212,6 +214,7 @@ void tst_QImageConversion::convertRgb32_data()
QTest::newRow("argb32pm -> rgb30") << argb32pm << QImage::Format_RGB30;
QTest::newRow("argb32pm -> a2bgr30") << argb32pm << QImage::Format_A2BGR30_Premultiplied;
QTest::newRow("argb32pm -> rgb888") << argb32pm << QImage::Format_RGB888;
+ QTest::newRow("argb32pm -> bgr888") << argb32pm << QImage::Format_BGR888;
QTest::newRow("argb32pm -> rgb666") << argb32pm << QImage::Format_RGB666;
QTest::newRow("argb32pm -> argb8565pm") << argb32pm << QImage::Format_ARGB8565_Premultiplied;
QTest::newRow("argb32pm -> argb4444pm") << argb32pm << QImage::Format_ARGB4444_Premultiplied;
@@ -242,6 +245,8 @@ void tst_QImageConversion::convertGeneric_data()
QImage rgb666 = rgb32.convertToFormat(QImage::Format_RGB666);
QImage argb4444 = argb32.convertToFormat(QImage::Format_ARGB4444_Premultiplied);
QImage rgba64pm = argb32.convertToFormat(QImage::Format_RGBA64_Premultiplied);
+ QImage rgb888 = rgb32.convertToFormat(QImage::Format_RGB888);
+ QImage bgr888 = rgb32.convertToFormat(QImage::Format_BGR888);
QTest::newRow("indexed8 -> rgb32") << i8 << QImage::Format_RGB32;
QTest::newRow("indexed8 -> argb32") << i8 << QImage::Format_ARGB32;
@@ -299,6 +304,20 @@ void tst_QImageConversion::convertGeneric_data()
QTest::newRow("rgba64pm -> rgb30") << rgba64pm << QImage::Format_RGB30;
QTest::newRow("rgba64pm -> a2bgr30") << rgba64pm << QImage::Format_A2BGR30_Premultiplied;
QTest::newRow("rgba64pm -> rgba64") << rgba64pm << QImage::Format_RGBA64;
+
+ QTest::newRow("rgb888 -> rgb32") << rgb888 << QImage::Format_RGB32;
+ QTest::newRow("rgb888 -> argb32") << rgb888 << QImage::Format_ARGB32;
+ QTest::newRow("rgb888 -> argb32pm") << rgb888 << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("rgb888 -> rgbx8888") << rgb888 << QImage::Format_RGBX8888;
+ QTest::newRow("rgb888 -> rgba8888pm") << rgb888 << QImage::Format_RGBA8888_Premultiplied;
+ QTest::newRow("rgb888 -> bgr888") << rgb888 << QImage::Format_BGR888;
+
+ QTest::newRow("bgr888 -> rgb32") << bgr888 << QImage::Format_RGB32;
+ QTest::newRow("bgr888 -> argb32") << bgr888 << QImage::Format_ARGB32;
+ QTest::newRow("bgr888 -> argb32pm") << bgr888 << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("bgr888 -> rgbx8888") << bgr888 << QImage::Format_RGBX8888;
+ QTest::newRow("bgr888 -> rgba8888pm") << bgr888 << QImage::Format_RGBA8888_Premultiplied;
+ QTest::newRow("bgr888 -> rgb888") << bgr888 << QImage::Format_RGB888;
}
void tst_QImageConversion::convertGeneric()
@@ -323,6 +342,8 @@ void tst_QImageConversion::convertGenericInplace_data()
QImage argb6666 = argb32.convertToFormat(QImage::Format_ARGB6666_Premultiplied);
QImage argb4444 = argb32.convertToFormat(QImage::Format_ARGB4444_Premultiplied);
QImage rgb16 = argb32.convertToFormat(QImage::Format_RGB16);
+ QImage rgb30 = argb32.convertToFormat(QImage::Format_RGB30);
+ QImage rgb888 = argb32.convertToFormat(QImage::Format_RGB888);
QTest::newRow("argb32 -> argb32pm -> argb32") << argb32 << QImage::Format_ARGB32_Premultiplied;
QTest::newRow("argb32 -> rgb32 -> argb32") << argb32 << QImage::Format_RGB32;
@@ -349,6 +370,9 @@ void tst_QImageConversion::convertGenericInplace_data()
QTest::newRow("rgb16 -> rgb555 -> rgb16") << rgb16 << QImage::Format_RGB555;
QTest::newRow("rgb16 -> rgb444 -> rgb16") << rgb16 << QImage::Format_RGB444;
QTest::newRow("rgb16 -> argb4444pm -> rgb16") << rgb16 << QImage::Format_ARGB4444_Premultiplied;
+
+ QTest::newRow("rgb30 -> bgr30 -> rgb30") << rgb30 << QImage::Format_BGR30;
+ QTest::newRow("rgb888 -> bgr888 -> rgb888") << rgb888 << QImage::Format_BGR888;
}
void tst_QImageConversion::convertGenericInplace()
@@ -357,10 +381,10 @@ void tst_QImageConversion::convertGenericInplace()
QFETCH(QImage::Format, outputFormat);
QImage::Format inputFormat = inputImage.format();
- QImage tmpImage = qMove(inputImage);
+ QImage tmpImage = std::move(inputImage);
QBENCHMARK {
- tmpImage = (qMove(tmpImage).convertToFormat(outputFormat)).convertToFormat(inputFormat);
+ tmpImage = (std::move(tmpImage).convertToFormat(outputFormat)).convertToFormat(inputFormat);
}
}
diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
index 29f7f6b16e..3454cf1474 100644
--- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
+++ b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
@@ -8,3 +8,5 @@ SOURCES += tst_qimagereader.cpp
qtConfig(gif): DEFINES += QTEST_HAVE_GIF
qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
+
+TESTDATA += images/*
diff --git a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
index d81d5bb01a..48e838148f 100644
--- a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
@@ -51,6 +51,7 @@ public:
virtual ~tst_QImageReader();
public slots:
+ void initTestCase();
void init();
void cleanup();
@@ -69,6 +70,7 @@ private slots:
private:
QList< QPair<QString, QByteArray> > images; // filename, format
+ QString prefix;
};
tst_QImageReader::tst_QImageReader()
@@ -102,6 +104,13 @@ tst_QImageReader::~tst_QImageReader()
{
}
+void tst_QImageReader::initTestCase()
+{
+ prefix = QFINDTESTDATA("images/");
+ if (prefix.isEmpty())
+ QFAIL("Can't find images directory!");
+}
+
void tst_QImageReader::init()
{
}
@@ -128,7 +137,7 @@ void tst_QImageReader::readImage()
QFETCH(QByteArray, format);
QBENCHMARK {
- QImageReader io("images/" + fileName, format);
+ QImageReader io(prefix + fileName, format);
QImage image = io.read();
QVERIFY(!image.isNull());
}
@@ -159,7 +168,7 @@ void tst_QImageReader::setScaledSize()
QFETCH(QByteArray, format);
QBENCHMARK {
- QImageReader reader("images/" + fileName, format);
+ QImageReader reader(prefix + fileName, format);
reader.setScaledSize(newSize);
QImage image = reader.read();
QCOMPARE(image.size(), newSize);
@@ -186,7 +195,7 @@ void tst_QImageReader::setClipRect()
QFETCH(QByteArray, format);
QBENCHMARK {
- QImageReader reader("images/" + fileName, format);
+ QImageReader reader(prefix + fileName, format);
reader.setClipRect(newRect);
QImage image = reader.read();
QCOMPARE(image.rect(), newRect);
@@ -205,7 +214,7 @@ void tst_QImageReader::setScaledClipRect()
QFETCH(QByteArray, format);
QBENCHMARK {
- QImageReader reader("images/" + fileName, format);
+ QImageReader reader(prefix + fileName, format);
reader.setScaledSize(QSize(300, 300));
reader.setScaledClipRect(newRect);
QImage image = reader.read();
diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index d4be85b5ad..2ded426cdd 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -106,7 +106,7 @@ void tst_QPixmapCache::find()
if (cacheType) {
QBENCHMARK {
for (int i = 0 ; i <= 10000 ; i++)
- QPixmapCache::find(QString::asprintf("my-key-%d", i), p);
+ QPixmapCache::find(QString::asprintf("my-key-%d", i), &p);
}
} else {
QBENCHMARK {
@@ -155,7 +155,7 @@ void tst_QPixmapCache::styleUseCaseComplexKey()
QPixmapCache::insert(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), p);
for (int i = 0 ; i <= 10000 ; i++)
- QPixmapCache::find(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), p);
+ QPixmapCache::find(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), &p);
}
} else {
QHash<styleStruct, QPixmapCache::Key> hash;
diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
index d7a7f383ac..12e85d4842 100644
--- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
@@ -167,9 +167,7 @@ void tst_QTransform::func##_data() \
{ \
QTest::addColumn<QTransform>("transform"); \
QMap<const char *, QTransform> x = generateTransforms(); \
- QMapIterator<const char *, QTransform> it(x); \
- while (it.hasNext()) { \
- it.next(); \
+ for (auto it = x.begin(), end = x.end(); it != end; ++it) { \
QTest::newRow(it.key()) << it.value(); \
} \
}
@@ -180,14 +178,10 @@ void tst_QTransform::func##_data() \
QTest::addColumn<QTransform>("x1"); \
QTest::addColumn<QTransform>("x2"); \
QMap<const char *, QTransform> x = generateTransforms(); \
- QMapIterator<const char *, QTransform> it(x); \
- while (it.hasNext()) { \
- it.next(); \
+ for (auto it = x.cbegin(), end = x.cend(); it != end; ++it) { \
const char *key1 = it.key(); \
QTransform x1 = it.value(); \
- QMapIterator<const char *, QTransform> it2(x); \
- while (it2.hasNext()) { \
- it2.next(); \
+ for (auto it2 = x.cbegin(), end = x.cend(); it2 != end; ++it2) { \
QTest::newRow(QString("%1 + %2").arg(key1).arg(it2.key()).toLatin1().constData()) \
<< x1 << it2.value(); \
} \
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
index b2f4cbd7ba..c182ef7ebf 100644
--- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -908,7 +908,7 @@ void tst_qnetworkreply::httpsRequestChain()
qint64 average = (elapsed / count);
- qSort(helper.timeList);
+ std::sort(helper.timeList.begin(), helper.timeList.end());
qint64 median = helper.timeList.at(5);
qDebug() << "Total:" << elapsed << " Average:" << average << " Median:" << median;
diff --git a/tests/benchmarks/opengl/main.cpp b/tests/benchmarks/opengl/main.cpp
index 5008f1592b..0886c0e55b 100644
--- a/tests/benchmarks/opengl/main.cpp
+++ b/tests/benchmarks/opengl/main.cpp
@@ -76,7 +76,6 @@ void OpenGLBench::initTestCase()
QPainter p(pb);
p.setRenderHint(QPainter::Antialiasing);
- p.setRenderHint(QPainter::HighQualityAntialiasing);
p.drawImage(0, 0, QImage(256, 256, QImage::Format_ARGB32_Premultiplied));
}
@@ -120,7 +119,6 @@ void OpenGLBench::imageDrawing()
QPainter p(pb);
p.setRenderHint(QPainter::SmoothPixmapTransform, smoothPixmapTransform);
p.setRenderHint(QPainter::Antialiasing, highQualityAntialiasing);
- p.setRenderHint(QPainter::HighQualityAntialiasing, highQualityAntialiasing);
QBENCHMARK {
if (pixmap) {
@@ -182,7 +180,6 @@ void OpenGLBench::pathDrawing()
dummy.addRect(-1, -1, 2, 2);
QPainter p(pb);
p.setRenderHint(QPainter::Antialiasing, highQualityAntialiasing);
- p.setRenderHint(QPainter::HighQualityAntialiasing, highQualityAntialiasing);
p.translate(pb->width() / 2, pb->height() / 2);
p.rotate(30);
p.drawPath(dummy);
@@ -196,7 +193,6 @@ void OpenGLBench::pathDrawing()
QBENCHMARK {
p.setRenderHint(QPainter::Antialiasing, highQualityAntialiasing);
- p.setRenderHint(QPainter::HighQualityAntialiasing, highQualityAntialiasing);
p.rotate(0.01);
p.drawPath(path);
@@ -227,7 +223,6 @@ void OpenGLBench::startupCost()
QGLPixelBuffer buffer(512, 512);
QPainter p(&buffer);
p.setRenderHint(QPainter::Antialiasing, highQualityAntialiasing);
- p.setRenderHint(QPainter::HighQualityAntialiasing, highQualityAntialiasing);
p.translate(buffer.width() / 2, buffer.height() / 2);
p.drawPath(path);
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
index c8ccb60dbb..8f7736010d 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
@@ -270,7 +270,6 @@ void MainView::construct()
// Turn off automatic background
setAttribute(Qt::WA_OpaquePaintEvent);
- setAttribute(Qt::WA_NoBackground);
setAttribute(Qt::WA_NoSystemBackground);
setAutoFillBackground(false);
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index b15aad04cd..e0c5a7f683 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -60,7 +60,7 @@ public:
{
Q_UNUSED(option);
Q_UNUSED(widget);
- painter->drawRoundRect(rect());
+ painter->drawRoundedRect(rect(), 25, 25, Qt::RelativeSize);
painter->drawLine(rect().topLeft(), rect().bottomRight());
painter->drawLine(rect().bottomLeft(), rect().topRight());
}
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
index 5c97d7f738..caf5455a80 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -53,7 +53,7 @@ public:
{
Q_UNUSED(option);
Q_UNUSED(widget);
- painter->drawRoundRect(rect());
+ painter->drawRoundedRect(rect(), 25, 25, Qt::RelativeSize);
painter->drawLine(rect().topLeft(), rect().bottomRight());
painter->drawLine(rect().bottomLeft(), rect().topRight());
}
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp
index 57ab62b1c3..2277ae0f14 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp
@@ -38,7 +38,7 @@ Chip::Chip(const QColor &color, int x, int y)
setZValue((x + y) % 2);
setFlags(ItemIsSelectable | ItemIsMovable);
- setAcceptsHoverEvents(true);
+ setAcceptHoverEvents(true);
}
QRectF Chip::boundingRect() const
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
index de4e9e5ad7..6e0ac445a6 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
@@ -30,12 +30,7 @@
#include <QtGui>
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-#define CALLGRIND_START_INSTRUMENTATION {}
-#define CALLGRIND_STOP_INSTRUMENTATION {}
-#else
#include "valgrind/callgrind.h"
-#endif
#ifndef QT_NO_OPENGL
#include <QtOpenGL>
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
index e0cc0f8eb4..140278b8f6 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
@@ -27,16 +27,7 @@
****************************************************************************/
#include <QtGui>
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-#define CALLGRIND_START_INSTRUMENTATION {}
-#define CALLGRIND_STOP_INSTRUMENTATION {}
-#else
#include "valgrind/callgrind.h"
-#endif
-
-#if 0 // Used to be included in Qt4 for Q_WS_X11
-extern void qt_x11_wait_for_window_manager(QWidget *);
-#endif
class View : public QGraphicsView
{
@@ -89,9 +80,6 @@ int main(int argc, char *argv[])
View view(&scene, item);
view.resize(300, 300);
view.show();
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
return app.exec();
}
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
index 1fbb229cd8..566d16ca51 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
@@ -27,12 +27,7 @@
****************************************************************************/
#include <QtGui>
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
-#define CALLGRIND_START_INSTRUMENTATION {}
-#define CALLGRIND_STOP_INSTRUMENTATION {}
-#else
#include "valgrind/callgrind.h"
-#endif
class ItemMover : public QObject
{
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp
index cf82282bfe..21eb622f15 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/chiptester/chip.cpp
@@ -57,9 +57,9 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
{
Q_UNUSED(widget);
- QColor fillColor = (option->state & QStyle::State_Selected) ? color.dark(150) : color;
+ QColor fillColor = (option->state & QStyle::State_Selected) ? color.darker(150) : color;
if (option->state & QStyle::State_MouseOver)
- fillColor = fillColor.light(125);
+ fillColor = fillColor.lighter(125);
if (option->levelOfDetail < 0.2) {
if (option->levelOfDetail < 0.125) {
@@ -82,7 +82,7 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
pen.setWidth(width);
QBrush b = painter->brush();
- painter->setBrush(QBrush(fillColor.dark(option->state & QStyle::State_Sunken ? 120 : 100)));
+ painter->setBrush(QBrush(fillColor.darker(option->state & QStyle::State_Sunken ? 120 : 100)));
painter->drawRect(QRect(14, 14, 79, 39));
painter->setBrush(b);
diff --git a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp
index 5a60c78cb5..7b73e6e952 100644
--- a/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp
+++ b/tests/libfuzzer/corelib/serialization/qxmlstream/qxmlstreamreader/readnext/main.cpp
@@ -29,7 +29,7 @@
#include <QXmlStreamReader>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
- QXmlStreamReader reader(QByteArray(Data, Size));
+ QXmlStreamReader reader(QByteArray::fromRawData(Data, Size));
while (!reader.atEnd())
reader.readNext();
return 0;
diff --git a/tests/libfuzzer/gui/iccparser/iccparser.pro b/tests/libfuzzer/gui/iccparser/iccparser.pro
new file mode 100644
index 0000000000..bf4037eae7
--- /dev/null
+++ b/tests/libfuzzer/gui/iccparser/iccparser.pro
@@ -0,0 +1,3 @@
+QT += gui
+SOURCES += main.cpp
+LIBS += -fsanitize=fuzzer
diff --git a/tests/libfuzzer/gui/iccparser/main.cpp b/tests/libfuzzer/gui/iccparser/main.cpp
new file mode 100644
index 0000000000..1db43d2e25
--- /dev/null
+++ b/tests/libfuzzer/gui/iccparser/main.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QColorSpace>
+
+extern "C" int LLVMFuzzerTestOneInput(const char *data, size_t size) {
+ static int c = 0;
+ static QGuiApplication a(c, nullptr);
+ QColorSpace cs = QColorSpace::fromIccProfile(QByteArray::fromRawData(data, size));
+ return 0;
+}
diff --git a/tests/libfuzzer/gui/text/qtextdocument/setHtml/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/setHtml/main.cpp
index c9b33d0f88..51fa3c9e0f 100644
--- a/tests/libfuzzer/gui/text/qtextdocument/setHtml/main.cpp
+++ b/tests/libfuzzer/gui/text/qtextdocument/setHtml/main.cpp
@@ -32,6 +32,6 @@
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
static int c = 0;
static QApplication a(c, nullptr);
- QTextDocument().setHtml(QByteArray(Data, Size));
+ QTextDocument().setHtml(QByteArray::fromRawData(Data, Size));
return 0;
}
diff --git a/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp
new file mode 100644
index 0000000000..66ddf738f2
--- /dev/null
+++ b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/main.cpp
@@ -0,0 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QTextDocument>
+
+extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
+ QTextDocument().setMarkdown(QByteArray::fromRawData(Data, Size));
+ return 0;
+}
diff --git a/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro
new file mode 100644
index 0000000000..4a2dfa51b9
--- /dev/null
+++ b/tests/libfuzzer/gui/text/qtextdocument/setMarkdown/setMarkdown.pro
@@ -0,0 +1,4 @@
+CONFIG += console
+CONFIG -= app_bundle
+SOURCES += main.cpp
+LIBS += -fsanitize=fuzzer
diff --git a/tests/libfuzzer/gui/text/qtextlayout/beginLayout/beginLayout.pro b/tests/libfuzzer/gui/text/qtextlayout/beginLayout/beginLayout.pro
new file mode 100644
index 0000000000..c9b14f6caf
--- /dev/null
+++ b/tests/libfuzzer/gui/text/qtextlayout/beginLayout/beginLayout.pro
@@ -0,0 +1,3 @@
+QT += widgets
+SOURCES += main.cpp
+LIBS += -fsanitize=fuzzer
diff --git a/tests/libfuzzer/gui/text/qtextlayout/beginLayout/main.cpp b/tests/libfuzzer/gui/text/qtextlayout/beginLayout/main.cpp
new file mode 100644
index 0000000000..dfb9559241
--- /dev/null
+++ b/tests/libfuzzer/gui/text/qtextlayout/beginLayout/main.cpp
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QTextLayout>
+
+extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
+ QTextLayout tl(QByteArray::fromRawData(Data, Size));
+ tl.beginLayout();
+ tl.endLayout();
+ return 0;
+}
diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri
index 9f10167136..b57ee75841 100644
--- a/tests/manual/diaglib/diaglib.pri
+++ b/tests/manual/diaglib/diaglib.pri
@@ -12,7 +12,7 @@ HEADERS += \
win32:!winrt: {
SOURCES += $$PWD/nativewindowdump_win.cpp
- LIBS *= -luser32
+ QMAKE_USE += user32
} else {
SOURCES += $$PWD/nativewindowdump.cpp
}
diff --git a/tests/manual/diaglib/nativewindowdump_win.cpp b/tests/manual/diaglib/nativewindowdump_win.cpp
index aae8746413..d91e673d1c 100644
--- a/tests/manual/diaglib/nativewindowdump_win.cpp
+++ b/tests/manual/diaglib/nativewindowdump_win.cpp
@@ -32,6 +32,7 @@
#include <QtCore/QTextStream>
#include <QtCore/QSharedPointer>
#include <QtCore/QDebug>
+#include <QtCore/QRect>
#include <QtCore/QVector>
#include <QtCore/qt_windows.h>
@@ -54,14 +55,76 @@ struct DumpContext {
if (style & styleConstant) \
str << ' ' << #styleConstant;
+static QTextStream &operator<<(QTextStream &str, const QPoint &p)
+{
+ str << p.x() << ", " << p.y();
+ return str;
+}
+
+static QTextStream &operator<<(QTextStream &str, const QSize &s)
+{
+ str << s.width() << 'x' << s.height();
+ return str;
+}
+
+static QTextStream &operator<<(QTextStream &str, const QRect &rect)
+{
+ str << rect.size() << forcesign << rect.x() << rect.y() << noforcesign;
+ return str;
+}
+
+static inline QSize qsizeFromRECT(const RECT &rect)
+{
+ return QSize(rect.right -rect.left, rect.bottom - rect.top);
+}
+
+static inline QRect qrectFromRECT(const RECT &rect)
+{
+ return QRect(QPoint(rect.left, rect.top), qsizeFromRECT(rect));
+}
+
+static QRect getFrameGeometry(HWND hwnd)
+{
+ RECT rect;
+ return GetWindowRect(hwnd, &rect) ? qrectFromRECT(rect) : QRect();
+}
+
+static QPoint getClientAreaScreenPos(HWND hwnd)
+{
+ POINT clientPos{0, 0};
+ return ClientToScreen(hwnd, &clientPos) ? QPoint(clientPos.x, clientPos.y) : QPoint();
+}
+
+static QRect getClientAreaGeometry(HWND hwnd)
+{
+ RECT clientRect;
+ return GetClientRect(hwnd, &clientRect)
+ ? QRect(getClientAreaScreenPos(hwnd), qsizeFromRECT(clientRect)) : QRect();
+}
+
+static bool isTopLevel(HWND hwnd)
+{
+ auto parent = GetParent(hwnd);
+ return !parent || parent == GetDesktopWindow();
+}
+
static void formatNativeWindow(HWND hwnd, QTextStream &str)
{
str << hex << showbase << quintptr(hwnd) << noshowbase << dec;
- RECT rect;
- if (GetWindowRect(hwnd, &rect)) {
- str << ' ' << (rect.right - rect.left) << 'x' << (rect.bottom - rect.top)
- << forcesign << rect.left << rect.top << noforcesign;
+
+ const bool topLevel = isTopLevel(hwnd);
+ if (topLevel)
+ str << " [top]";
+ const auto frameGeometry = getFrameGeometry(hwnd);
+ const auto clientGeometry = getClientAreaGeometry(hwnd);
+ str << ' ' << frameGeometry;
+ if (!topLevel)
+ str << " local: " << (clientGeometry.topLeft() - getClientAreaScreenPos(GetParent(hwnd)));
+ if (clientGeometry != frameGeometry) {
+ str << " client: " << clientGeometry << " frame: "
+ << (clientGeometry.topLeft() - frameGeometry.topLeft());
}
+
if (IsWindowVisible(hwnd))
str << " [visible]";
diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp
index 8bb899783b..383ec4edb0 100644
--- a/tests/manual/diaglib/textdump.cpp
+++ b/tests/manual/diaglib/textdump.cpp
@@ -44,6 +44,9 @@ static const EnumLookup specialCharactersEnumLookup[] =
#if QT_VERSION >= 0x050000
{QChar::Tabulation, "Tabulation"},
{QChar::LineFeed, "LineFeed"},
+# if QT_VERSION >= 0x050e00
+ {QChar::FormFeed, "FormFeed"},
+# endif
{QChar::CarriageReturn, "CarriageReturn"},
{QChar::Space, "Space"},
#endif
diff --git a/tests/manual/dialogs/printdialogpanel.cpp b/tests/manual/dialogs/printdialogpanel.cpp
index 8d64d2f6a6..b7447e3d64 100644
--- a/tests/manual/dialogs/printdialogpanel.cpp
+++ b/tests/manual/dialogs/printdialogpanel.cpp
@@ -710,8 +710,7 @@ void PrintDialogPanel::showPreviewDialog()
applySettings(m_printer.data());
PrintPreviewDialog dialog(m_printer.data(), this);
#if QT_VERSION >= 0x050000
- const int screenNumber = QApplication::desktop()->screenNumber(this);
- const QSize availableSize = QGuiApplication::screens().at(screenNumber)->availableSize();
+ const QSize availableSize = screen()->availableSize();
#else
const QSize availableSize = QApplication::desktop()->availableGeometry().size();
#endif
diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp
index 46a8ea8090..11bbc1d127 100644
--- a/tests/manual/highdpi/dragwidget.cpp
+++ b/tests/manual/highdpi/dragwidget.cpp
@@ -110,7 +110,7 @@ void DragWidget::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasText()) {
const QMimeData *mime = event->mimeData();
- QStringList pieces = mime->text().split(QRegExp("\\s+"),
+ QStringList pieces = mime->text().split(QRegularExpression("\\s+"),
QString::SkipEmptyParts);
QPoint position = event->pos();
QPoint hotSpot;
diff --git a/tests/manual/highdpi/highdpi.pro b/tests/manual/highdpi/highdpi.pro
index 9db083cd82..2de8ed3bb5 100644
--- a/tests/manual/highdpi/highdpi.pro
+++ b/tests/manual/highdpi/highdpi.pro
@@ -15,3 +15,4 @@ HEADERS += \
RESOURCES += \
highdpi.qrc
+DEFINES += HAVE_SCREEN_BASE_DPI
diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp
index bb01ab785d..51a7026e85 100644
--- a/tests/manual/highdpi/main.cpp
+++ b/tests/manual/highdpi/main.cpp
@@ -37,10 +37,12 @@
#include <QPushButton>
#include <QButtonGroup>
#include <QLineEdit>
+#include <QPlainTextEdit>
#include <QScrollBar>
#include <QSlider>
#include <QSpinBox>
#include <QTabBar>
+#include <QTextBrowser>
#include <QIcon>
#include <QPainter>
#include <QWindow>
@@ -55,9 +57,16 @@
#include <QCommandLineOption>
#include <QDebug>
#include <private/qhighdpiscaling_p.h>
+#include <qpa/qplatformscreen.h>
#include "dragwidget.h"
+static QTextStream &operator<<(QTextStream &str, const QRect &r)
+{
+ str << r.width() << 'x' << r.height() << forcesign << r.x() << r.y() << noforcesign;
+ return str;
+}
+
class DemoContainerBase
{
public:
@@ -1176,6 +1185,85 @@ public:
}
};
+class MetricsTest : public QWidget
+{
+ QPlainTextEdit *m_textEdit;
+
+public:
+ MetricsTest()
+ {
+ qDebug() << R"(
+MetricsTest
+Relevant environment variables are:
+QT_FONT_DPI=N
+QT_SCALE_FACTOR=n
+QT_ENABLE_HIGHDPI_SCALING=0|1
+QT_USE_PHYSICAL_DPI=0|1
+QT_SCREEN_SCALE_FACTORS=N;N;N or QT_SCREEN_SCALE_FACTORS=name:N
+QT_SCALE_FACTOR_ROUNDING_POLICY=Round|Ceil|Floor|RoundPreferFloor|PassThrough
+QT_DPI_ADJUSTMENT_POLICY=AdjustDpi|DontAdjustDpi|AdjustUpOnly)";
+
+ resize(480, 360);
+
+ QVBoxLayout *layout = new QVBoxLayout();
+ setLayout(layout);
+
+ m_textEdit = new QPlainTextEdit;
+ m_textEdit->setReadOnly(true);
+ layout->addWidget(m_textEdit);
+ }
+
+ void updateMetrics()
+ {
+ QString text;
+ QTextStream str(&text);
+
+ auto currentScreen = windowHandle()->screen();
+ const auto screens = QGuiApplication::screens();
+ for (int i = 0, size = screens.size(); i < size; ++i) {
+ auto screen = screens.at(i);
+ auto platformScreen = screen->handle();
+ str << "Screen #" << i << " \"" << screen->name() << '"';
+ if (screen == currentScreen)
+ str << " [current]";
+ if (screen == QGuiApplication::primaryScreen())
+ str << " [primary]";
+ str << "\n screen geometry: " << screen->geometry()
+ << "\n platform screen geometry: " << platformScreen->geometry()
+ << "\n platform screen logicalDpi: " << platformScreen->logicalDpi().first;
+
+#ifdef HAVE_SCREEN_BASE_DPI
+ str << "\n platform screen logicalBaseDpi: " << platformScreen->logicalBaseDpi().first;
+#endif
+ str << "\n platform screen devicePixelRatio: " <<platformScreen->devicePixelRatio()
+ << "\n platform screen physicalDpi: " << screen->physicalDotsPerInch()
+ << "\n\n";
+ }
+
+ str << "widget devicePixelRatio: " << this->devicePixelRatioF()
+ << "\nwidget logicalDpi: " << this->logicalDpiX()
+ << "\n\nQT_FONT_DPI: " << qgetenv("QT_FONT_DPI")
+ << "\nQT_SCALE_FACTOR: " << qgetenv("QT_SCALE_FACTOR")
+ << "\nQT_ENABLE_HIGHDPI_SCALING: " << qgetenv("QT_ENABLE_HIGHDPI_SCALING")
+ << "\nQT_SCREEN_SCALE_FACTORS: " << qgetenv("QT_SCREEN_SCALE_FACTORS")
+ << "\nQT_USE_PHYSICAL_DPI: " << qgetenv("QT_USE_PHYSICAL_DPI")
+ << "\nQT_SCALE_FACTOR_ROUNDING_POLICY: " << qgetenv("QT_SCALE_FACTOR_ROUNDING_POLICY")
+ << "\nQT_DPI_ADJUSTMENT_POLICY: " << qgetenv("QT_DPI_ADJUSTMENT_POLICY")
+ << '\n';
+
+ m_textEdit->setPlainText(text);
+ }
+
+ void paintEvent(QPaintEvent *ev)
+ {
+ // We get a paint event on screen change, so this is a convenient place
+ // to update the metrics, at the possible risk of doing something else
+ // than painting in a paint event.
+ updateMetrics();
+ QWidget::paintEvent(ev);
+ }
+};
+
int main(int argc, char **argv)
{
QApplication app(argc, argv);
@@ -1212,6 +1300,7 @@ int main(int argc, char **argv)
demoList << new DemoContainer<ScreenDisplayer>("screens", "Test screen and window positioning");
demoList << new DemoContainer<PhysicalSizeTest>("physicalsize", "Test manual highdpi support using physicalDotsPerInch");
demoList << new DemoContainer<GraphicsViewCaching>("graphicsview", "Test QGraphicsView caching");
+ demoList << new DemoContainer<MetricsTest>("metrics", "Show display metrics");
foreach (DemoContainerBase *demo, demoList)
parser.addOption(demo->option());
diff --git a/tests/manual/keypadnavigation/main.cpp b/tests/manual/keypadnavigation/main.cpp
index 67986a9cc9..dad4376514 100644
--- a/tests/manual/keypadnavigation/main.cpp
+++ b/tests/manual/keypadnavigation/main.cpp
@@ -33,7 +33,6 @@
#include <QFontDialog>
#include <QInputDialog>
#include <QMessageBox>
-#include <QSignalMapper>
#include "ui_keypadnavigation.h"
class KeypadNavigation : public QMainWindow
@@ -48,7 +47,7 @@ public:
ui->setupUi(this);
const struct {
- QObject *action;
+ QAction *action;
QWidget *page;
} layoutMappings[] = {
{ui->m_actionLayoutVerticalSimple, ui->m_pageVerticalSimple},
@@ -58,15 +57,16 @@ public:
{ui->m_actionLayoutChaos, ui->m_pageChaos},
{ui->m_actionLayoutDialogs, ui->m_pageDialogs}
};
- for (int i = 0; i < int(sizeof layoutMappings / sizeof layoutMappings[0]); ++i) {
- connect(layoutMappings[i].action, SIGNAL(triggered()), &m_layoutSignalMapper, SLOT(map()));
- m_layoutSignalMapper.setMapping(layoutMappings[i].action, layoutMappings[i].page);
+ for (auto layoutMapping : layoutMappings) {
+ const auto page = layoutMapping.page;
+ connect(layoutMapping.action, &QAction::triggered, ui->m_stackWidget,
+ [this, page]()
+ { ui->m_stackWidget->setCurrentWidget(page); });
}
- connect(&m_layoutSignalMapper, SIGNAL(mapped(QWidget*)), ui->m_stackWidget, SLOT(setCurrentWidget(QWidget*)));
#ifdef QT_KEYPAD_NAVIGATION
const struct {
- QObject *action;
+ QAction *action;
Qt::NavigationMode mode;
} modeMappings[] = {
{ui->m_actionModeNone, Qt::NavigationModeNone},
@@ -75,17 +75,17 @@ public:
{ui->m_actionModeCursorAuto, Qt::NavigationModeCursorAuto},
{ui->m_actionModeCursorForceVisible, Qt::NavigationModeCursorForceVisible}
};
- for (int i = 0; i < int(sizeof modeMappings / sizeof modeMappings[0]); ++i) {
- connect(modeMappings[i].action, SIGNAL(triggered()), &m_modeSignalMapper, SLOT(map()));
- m_modeSignalMapper.setMapping(modeMappings[i].action, int(modeMappings[i].mode));
+ for (auto modeMapping : modeMappings) {
+ const auto mode = modeMapping.mode;
+ connect(modeMapping.action, &QAction::triggered, this,
+ [this, mode]() { setNavigationMode(mode); });
}
- connect(&m_modeSignalMapper, SIGNAL(mapped(int)), SLOT(setNavigationMode(int)));
#else // QT_KEYPAD_NAVIGATION
ui->m_menuNavigation_mode->deleteLater();
#endif // QT_KEYPAD_NAVIGATION
const struct {
- QObject *button;
+ QPushButton *button;
Dialog dialog;
} openDialogMappings[] = {
{ui->m_buttonGetOpenFileName, DialogGetOpenFileName},
@@ -97,11 +97,11 @@ public:
{ui->m_buttonAboutQt, DialogAboutQt},
{ui->m_buttonGetItem, DialogGetItem}
};
- for (int i = 0; i < int(sizeof openDialogMappings / sizeof openDialogMappings[0]); ++i) {
- connect(openDialogMappings[i].button, SIGNAL(clicked()), &m_dialogSignalMapper, SLOT(map()));
- m_dialogSignalMapper.setMapping(openDialogMappings[i].button, int(openDialogMappings[i].dialog));
+ for (auto openDialogMapping : openDialogMappings) {
+ const auto dialog = openDialogMapping.dialog;
+ connect(openDialogMapping.button, &QPushButton::clicked, this,
+ [this, dialog]() { openDialog(dialog); });
}
- connect(&m_dialogSignalMapper, SIGNAL(mapped(int)), SLOT(openDialog(int)));
}
~KeypadNavigation()
@@ -162,11 +162,6 @@ private:
};
Ui_KeypadNavigation *ui;
- QSignalMapper m_layoutSignalMapper;
-#ifdef QT_KEYPAD_NAVIGATION
- QSignalMapper m_modeSignalMapper;
-#endif // QT_KEYPAD_NAVIGATION
- QSignalMapper m_dialogSignalMapper;
};
int main(int argc, char *argv[])
diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp
index 7f5af2d908..6dc5e2076a 100644
--- a/tests/manual/lance/main.cpp
+++ b/tests/manual/lance/main.cpp
@@ -334,20 +334,7 @@ int main(int argc, char **argv)
checkers_background = false;
}
} else {
-#if 0 // Used to be included in Qt4 for Q_WS_WIN
- QString input = QString::fromLocal8Bit(argv[i]);
- if (input.indexOf('*') >= 0) {
- QFileInfo info(input);
- QDir dir = info.dir();
- QFileInfoList infos = dir.entryInfoList(QStringList(info.fileName()));
- for (int ii=0; ii<infos.size(); ++ii)
- files.append(infos.at(ii).absoluteFilePath());
- } else {
- files.append(input);
- }
-#else
files.append(QString(argv[i]));
-#endif
}
}
scaledWidth = int(width * scalefactor);
diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h
index 46c55f4c16..09b2c3e667 100644
--- a/tests/manual/lance/widgets.h
+++ b/tests/manual/lance/widgets.h
@@ -43,7 +43,6 @@
#include <QFileDialog>
#include <QTextStream>
#include <QPaintEngine>
-#include <QSignalMapper>
#include <QAction>
#include <QDebug>
diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro
index ab00a5ef60..42f9878e44 100644
--- a/tests/manual/manual.pro
+++ b/tests/manual/manual.pro
@@ -23,6 +23,7 @@ qimagereader \
qlayout \
qlocale \
qmimedatabase \
+qnetconmonitor \
qnetworkaccessmanager/qget \
qnetworkconfigurationmanager \
qnetworkconfiguration \
@@ -34,6 +35,7 @@ qsslsocket \
qsysinfo \
qtabletevent \
qtexteditlist \
+qtexttableborders \
qtbug-8933 \
qtbug-52641 \
qtouchevent \
@@ -53,7 +55,8 @@ shortcuts \
dialogs \
windowtransparency \
unc \
-qtabbar
+qtabbar \
+rhi
!qtConfig(openssl): SUBDIRS -= qssloptions
diff --git a/tests/manual/markdown/html2md.cpp b/tests/manual/markdown/html2md.cpp
new file mode 100644
index 0000000000..19d6ff06af
--- /dev/null
+++ b/tests/manual/markdown/html2md.cpp
@@ -0,0 +1,64 @@
+/****************************************************************************
+ **
+ ** Copyright (C) 2019 The Qt Company Ltd.
+ ** Contact: https://www.qt.io/licensing/
+ **
+ ** This file is part of the test suite of the Qt Toolkit.
+ **
+ ** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+ ** Commercial License Usage
+ ** Licensees holding valid commercial Qt licenses may use this file in
+ ** accordance with the commercial license agreement provided with the
+ ** Software or, alternatively, in accordance with the terms contained in
+ ** a written agreement between you and The Qt Company. For licensing terms
+ ** and conditions see https://www.qt.io/terms-conditions. For further
+ ** information use the contact form at https://www.qt.io/contact-us.
+ **
+ ** GNU General Public License Usage
+ ** Alternatively, this file may be used under the terms of the GNU
+ ** General Public License version 3 as published by the Free Software
+ ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+ ** included in the packaging of this file. Please review the following
+ ** information to ensure the GNU General Public License requirements will
+ ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+ **
+ ** $QT_END_LICENSE$
+ **
+ ****************************************************************************/
+
+#include <QCommandLineParser>
+#include <QDebug>
+#include <QFile>
+#include <QGuiApplication>
+#include <QTextDocument>
+
+int main(int argc, char **argv)
+{
+ QGuiApplication app(argc, argv);
+ QGuiApplication::setApplicationVersion(QT_VERSION_STR);
+ QCommandLineParser parser;
+ parser.setApplicationDescription("Converts the Qt-supported subset of HTML to Markdown.");
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addPositionalArgument(QGuiApplication::translate("main", "input"),
+ QGuiApplication::translate("main", "input file"));
+ parser.addPositionalArgument(QGuiApplication::translate("main", "output"),
+ QGuiApplication::translate("main", "output file"));
+ parser.process(app);
+ if (parser.positionalArguments().count() != 2)
+ parser.showHelp(1);
+
+ QFile inFile(parser.positionalArguments().first());
+ if (!inFile.open(QIODevice::ReadOnly)) {
+ qFatal("failed to open %s for reading", parser.positionalArguments().first().toLocal8Bit().data());
+ exit(2);
+ }
+ QFile outFile(parser.positionalArguments().at(1));
+ if (!outFile.open(QIODevice::WriteOnly)) {
+ qFatal("failed to open %s for writing", parser.positionalArguments().at(1).toLocal8Bit().data());
+ exit(2);
+ }
+ QTextDocument doc;
+ doc.setHtml(QString::fromUtf8(inFile.readAll()));
+ outFile.write(doc.toMarkdown().toUtf8());
+}
diff --git a/tests/manual/markdown/html2md.pro b/tests/manual/markdown/html2md.pro
new file mode 100644
index 0000000000..4d6254e5a0
--- /dev/null
+++ b/tests/manual/markdown/html2md.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = html2md
+INCLUDEPATH += .
+#QT += gui-private
+SOURCES += html2md.cpp
+
diff --git a/tests/manual/qcursor/qcursorhighdpi/main.cpp b/tests/manual/qcursor/qcursorhighdpi/main.cpp
index 4a7646c39d..e70be333fd 100644
--- a/tests/manual/qcursor/qcursorhighdpi/main.cpp
+++ b/tests/manual/qcursor/qcursorhighdpi/main.cpp
@@ -183,7 +183,7 @@ private:
void DraggableLabel::mousePressEvent(QMouseEvent *)
{
QMimeData *mimeData = new QMimeData;
- mimeData->setImageData(qVariantFromValue(m_pixmap));
+ mimeData->setImageData(QVariant::fromValue(m_pixmap));
QDrag *drag = new QDrag(this);
QPixmap pixmap = m_pixmap;
if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
@@ -218,7 +218,7 @@ protected:
VerticalRuler::VerticalRuler(QWidget *parent) : QWidget(parent)
{
- const int screenWidth = QApplication::desktop()->screenGeometry(this).width();
+ const int screenWidth = screen()->geometry().width();
setFixedWidth(screenWidth / 48); // 1920 pixel monitor ->40
}
@@ -356,15 +356,12 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindowPtrList windows;
-
- QDesktopWidget *desktopWidget = app.desktop();
-
const int lastScreen = arguments.contains("-p")
? 0 // Primary screen only
- : desktopWidget->screenCount() - 1; // All screens
+ : QGuiApplication::screens().size() - 1; // All screens
for (int s = lastScreen; s >= 0; --s) {
- MainWindowPtr window(new MainWindow(desktopWidget->screen(s)));
- const QPoint pos = desktopWidget->screenGeometry(s).center() - QPoint(200, 100);
+ MainWindowPtr window(new MainWindow());
+ const QPoint pos = QGuiApplication::screens().at(s)->geometry().center() - QPoint(200, 100);
window->move(pos);
windows.append(window);
window->show();
diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp
index f4c82c5f72..978dc62b0e 100644
--- a/tests/manual/qdesktopwidget/main.cpp
+++ b/tests/manual/qdesktopwidget/main.cpp
@@ -34,6 +34,7 @@
class DesktopView : public QGraphicsView
{
+#if QT_DEPRECATED_SINCE(5, 11)
Q_OBJECT
public:
DesktopView()
@@ -195,6 +196,7 @@ private:
QGraphicsScene *scene;
QGraphicsRectItem *that;
QPoint thatRoot;
+#endif
};
#include "main.moc"
diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h
index 22a53585d1..c49b82704e 100644
--- a/tests/manual/qgraphicslayout/flicker/window.h
+++ b/tests/manual/qgraphicslayout/flicker/window.h
@@ -107,7 +107,7 @@ public:
Q_UNUSED(option);
Q_UNUSED(widget);
painter->setBrush(m_brush);
- painter->drawRoundRect(rect());
+ painter->drawRoundedRect(rect(), 25, 25, Qt::RelativeSize);
painter->drawLine(rect().topLeft(), rect().bottomRight());
painter->drawLine(rect().bottomLeft(), rect().topRight());
}
diff --git a/tests/manual/qnetconmonitor/qnetconmonitor.pro b/tests/manual/qnetconmonitor/qnetconmonitor.pro
new file mode 100644
index 0000000000..dda88c4cd7
--- /dev/null
+++ b/tests/manual/qnetconmonitor/qnetconmonitor.pro
@@ -0,0 +1,4 @@
+TEMPLATE = app
+QT = network-private testlib
+CONFIG += console
+SOURCES += tst_qnetconmonitor.cpp
diff --git a/tests/manual/qnetconmonitor/tst_qnetconmonitor.cpp b/tests/manual/qnetconmonitor/tst_qnetconmonitor.cpp
new file mode 100644
index 0000000000..92daee3348
--- /dev/null
+++ b/tests/manual/qnetconmonitor/tst_qnetconmonitor.cpp
@@ -0,0 +1,220 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qcoreapplication.h>
+#include <QtCore/qdeadlinetimer.h>
+
+#include <QtNetwork/qhostinfo.h>
+#include <QtNetwork/private/qnetconmonitor_p.h>
+
+#include <QtTest/qsignalspy.h>
+
+void testDetectDisconnection();
+void testDetectRouteDisrupted();
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+
+ if (!QNetworkStatusMonitor::isEnabled()) {
+ qWarning("QNetworkStatusMonitor is not enabled for this platform!");
+ return 0;
+ }
+
+ while (true) {
+
+ QByteArray indent(" ");
+ {
+ QTextStream writer(stdout);
+ writer << "Manual test for QNetwork{Status|Connection}Monitor\n"
+ << "The tests are grouped by what they test. Run them in any order\n"
+ << "- QNetworkStatusMonitor tests:\n"
+ << indent << "c" << indent << "Test connection and disconnection detection.\n"
+ << "- QNetworkConnectionMonitor tests:\n"
+ << indent << "r" << indent << "Test detection of disruption of route to target.\n"
+ << "- General\n"
+ << indent << "q" << indent << "Quit the test.\n"
+ << "> ";
+ }
+
+ auto getCommand = []() {
+ char ch;
+ QTextStream reader(stdin);
+ reader >> ch;
+ return ch;
+ };
+
+ switch (getCommand()) {
+ case 'c':
+ testDetectDisconnection();
+ break;
+ case 'r':
+ testDetectRouteDisrupted();
+ break;
+ case 'q':
+ return 0;
+ }
+ }
+ Q_UNREACHABLE();
+ return 0;
+}
+
+bool ensureNetworkAccessible(QNetworkStatusMonitor &status, QTextStream &writer)
+{
+ if (!status.isNetworkAccessible()) {
+ writer << "Network currently not accessible, please make sure you have an internet "
+ "connection. Will wait for a connection for 20 seconds.\n";
+ writer.flush();
+ QDeadlineTimer timer{ 20 * 1000 };
+ while (!timer.hasExpired() && !status.isNetworkAccessible())
+ QCoreApplication::processEvents();
+ if (!status.isNetworkAccessible()) {
+ writer << "Error: No network in 20 seconds, ending now!\n";
+ return false;
+ }
+ writer << "Network successfully connected, thanks!\n";
+ }
+ return true;
+}
+
+void testDetectDisconnection()
+{
+ QTextStream writer(stdout);
+ QNetworkStatusMonitor status;
+
+ if (!status.start()) {
+ writer << "Error: Failed to start";
+ return;
+ }
+
+ if (!ensureNetworkAccessible(status, writer))
+ return;
+
+ QSignalSpy onlineStateSpy(&status, &QNetworkStatusMonitor::onlineStateChanged);
+
+ writer << "Please disconnect from the internet within 20 seconds\n";
+ writer.flush();
+ QDeadlineTimer timer{ 20 * 1000 };
+ while (!timer.hasExpired() && status.isNetworkAccessible())
+ QCoreApplication::processEvents();
+ if (status.isNetworkAccessible()) {
+ writer << "Error: Still connected after 20 seconds, ending now!\n";
+ return;
+ }
+ if (onlineStateSpy.count() == 0) {
+ writer << "Error: There was a disconnection but there was no signal emitted!\n";
+ return;
+ }
+ // Get the final parameter of the final signal emission and make sure it is false.
+ if (onlineStateSpy.last().last().toBool()) {
+ writer << "Error: There was a disconnection but the latest signal emitted says we are online!\n";
+ return;
+ }
+ writer << "Success, connection loss was detected!\n";
+}
+
+void testDetectRouteDisrupted()
+{
+ QTextStream writer(stdout);
+
+ {
+ QNetworkStatusMonitor status;
+ if (!status.start()) {
+ writer << "Error: Failed to start";
+ return;
+ }
+ if (!ensureNetworkAccessible(status, writer))
+ return;
+ }
+
+ QNetworkConnectionMonitor connection;
+
+ auto readLineFromStdin = []() -> QString {
+ QTextStream in(stdin);
+ return in.readLine();
+ };
+
+ writer << "Type your local IP address: ";
+ writer.flush();
+ const QHostAddress local{ readLineFromStdin() };
+ if (local.isNull()) {
+ writer << "Error: The address is invalid!\n";
+ return;
+ }
+
+ const QHostAddress defaultAddress{ QString::fromLatin1("1.1.1.1") };
+ QHostAddress remote;
+ do {
+ writer << "Type a remote IP address [" << defaultAddress.toString() << "]: ";
+ writer.flush();
+ QString address = readLineFromStdin();
+ if (address.isEmpty()) {
+ remote = defaultAddress;
+ } else {
+ QHostAddress remoteTemp{ address };
+ if (remoteTemp.isNull()) {
+ writer << "Invalid address\n";
+ } else {
+ remote = remoteTemp;
+ }
+ }
+ } while (remote.isNull());
+
+ if (!connection.setTargets(local, remote)) {
+ writer << "Error: Failed to set the targets!\n";
+ return;
+ }
+ if (!connection.isReachable()) {
+ writer << "Error: Target is not reachable!\n";
+ return;
+ }
+ if (!connection.startMonitoring()) {
+ writer << "Error: Failed to start monitoring!\n";
+ return;
+ }
+
+ QSignalSpy reachabilitySpy(&connection, &QNetworkConnectionMonitor::reachabilityChanged);
+
+ writer << "QNetworkConnectionMonitor might assume the target is initially reachable.\n"
+ "If it is not reachable then this test might not work correctly.\n"
+ "Please disrupt the connection between your machine and the target within 20 "
+ "seconds\n";
+ writer.flush();
+ reachabilitySpy.wait(20 * 1000);
+ if (reachabilitySpy.count() == 0) {
+ writer << "Error: There was a disconnection but there was no signal emitted!\n";
+ return;
+ }
+ // Get the final parameter of the final signal emission and make sure it is false.
+ if (reachabilitySpy.last().last().toBool()) {
+ writer << "Error: There was a disconnection but the latest signal emitted says the target is "
+ "reachable!\n";
+ return;
+ }
+ writer << "Success, connection disruption was detected!\n";
+}
diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp
index 6fba872b12..0728d66bf9 100644
--- a/tests/manual/qscreen/main.cpp
+++ b/tests/manual/qscreen/main.cpp
@@ -61,8 +61,10 @@ public:
QLatin1String("Left-click to test QGuiApplication::topLevelAt(click pos)\nRight-click to ungrab\n") :
QLatin1String("Left-click to grab mouse\n");
if (!m_cursorPos.isNull()) {
+ const auto screen = QGuiApplication::screenAt(m_cursorPos);
+ const auto screenNum = screen ? QGuiApplication::screens().indexOf(screen) : 0;
txt += QString(QLatin1String("Current mouse position: %1, %2 on screen %3\n"))
- .arg(m_cursorPos.x()).arg(m_cursorPos.y()).arg(QApplication::desktop()->screenNumber(m_cursorPos));
+ .arg(m_cursorPos.x()).arg(m_cursorPos.y()).arg(screenNum);
if (QGuiApplication::mouseButtons() & Qt::LeftButton) {
QWindow *win = QGuiApplication::topLevelAt(m_cursorPos);
txt += QString(QLatin1String("Top-level window found? %1\n"))
@@ -234,6 +236,7 @@ void screenAdded(QScreen* screen)
QList<QScreen *> screens = QGuiApplication::screens();
int screenNumber = screens.indexOf(screen);
Q_ASSERT(screenNumber >= 0);
+ // ### Qt 6: Find a replacement for QDesktopWidget::screen()
w->setParent(qApp->desktop()->screen(screenNumber));
w->show();
diff --git a/tests/manual/qtexttableborders/main.cpp b/tests/manual/qtexttableborders/main.cpp
new file mode 100644
index 0000000000..a8fdf7becc
--- /dev/null
+++ b/tests/manual/qtexttableborders/main.cpp
@@ -0,0 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "widget.h"
+#include <QApplication>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ Widget w;
+ w.show();
+
+ return a.exec();
+}
diff --git a/tests/manual/qtexttableborders/qtexttableborders.pro b/tests/manual/qtexttableborders/qtexttableborders.pro
new file mode 100644
index 0000000000..7e454f978d
--- /dev/null
+++ b/tests/manual/qtexttableborders/qtexttableborders.pro
@@ -0,0 +1,10 @@
+#This project can be used to verify QTBUG-36152 case.
+QT += core gui printsupport
+CONFIG += c++11
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+TARGET = qtexttableborders
+TEMPLATE = app
+SOURCES += main.cpp widget.cpp
+HEADERS += widget.h
+FORMS += widget.ui
+RESOURCES += resources.qrc
diff --git a/tests/manual/qtexttableborders/resources.qrc b/tests/manual/qtexttableborders/resources.qrc
new file mode 100644
index 0000000000..a7000a73e3
--- /dev/null
+++ b/tests/manual/qtexttableborders/resources.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>table-border-test-header.html</file>
+ <file>table-border-test.html</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/qtexttableborders/table-border-test-header.html b/tests/manual/qtexttableborders/table-border-test-header.html
new file mode 100644
index 0000000000..cb29d0a41d
--- /dev/null
+++ b/tests/manual/qtexttableborders/table-border-test-header.html
@@ -0,0 +1,129 @@
+<html>
+ <body>
+
+ <h2>Printable table with repeated header</h2>
+
+ <p>
+ Please print (to PDF, save the trees) this table and compare this to the
+ print results of Chrome/Firefox.
+ <ul>
+ <li>Firefox fails to render the first repeated header correctly
+ <li>Chrome fails to render the Cell B top edge (should be red, except the first row after header
+ <li>Qt: Could do slightly better with the last row on each page (although both Firefox and Chrome don't work perfect here as well)
+ </ul>
+ </p>
+
+ <table border=1 bordercolor="#aaaaaa" style="border-collapse:collapse">
+ <thead>
+ <tr>
+ <th style="border-bottom: 1px solid blue">Header A</th>
+ <th style="border-bottom: 4px solid blue">Header B</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ <tr><td>Cell A</td><td style="border-top: 1px solid red">Cell B</td></tr>
+ </tbody>
+ </table>
+
+ </body>
+</html>
diff --git a/tests/manual/qtexttableborders/table-border-test.html b/tests/manual/qtexttableborders/table-border-test.html
new file mode 100644
index 0000000000..0339f80d0f
--- /dev/null
+++ b/tests/manual/qtexttableborders/table-border-test.html
@@ -0,0 +1,171 @@
+<html>
+ <body>
+
+ <h1>Working Test Cases</h1>
+
+ <h2>border-collapse: separate</h2>
+
+ <h3>TC-A1: table no border</h3>
+ <table>
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-A2: table attribute controlled border (1px, red)</h3>
+ <table border=1 bordercolor="red">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-A3: table attribute controlled border (4px, blue)</h3>
+ <table border=4 bordercolor="blue">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+ Note: Real browsers render the inner cells border with 1px, but QTextDocument's rendering has always been like this.
+
+ <h2>border-collapse: collapse</h2>
+
+ <h3>TC-B1: table no border</h3>
+ <table style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-B2: table attribute + css controlled grid (outer border 1px)</h3>
+ <table border=1 bordercolor="red" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-B3: table attribute + css controlled grid (outer border 4px)</h3>
+ <table border=4 bordercolor="red" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-B4: table attribute + css controlled grid (one cell with custom edge)</h3>
+ <table border=4 bordercolor="red" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td style="border-right: 8px solid green">Cell 1B (border-right: 8px solid green)</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-B5: table with single decorated cell</h3>
+ <table style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td style="border: 2px solid red">Cell 1B (border: 2px solid red)</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>cells with competing rules</h3>
+
+ <h4>TC-C1: vertical edge (pink, 6px) wins over horizontal edge (red|blue, 6px)</h4>
+ <table border=1 bordercolor="#999999" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td style="border-right: 4px solid green; border-bottom: 6px solid red">Cell 1A</td>
+ <td style="border-left: 6px solid pink; border-bottom: 6px solid blue">Cell 2B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h4>TC-C2: vertical edge (pink, 6px) loses over horizontal edge (red|blue, 8px)</h4>
+ <table border=1 bordercolor="#999999" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td style="border-right: 4px solid green; border-bottom: 8px solid red">Cell 1A</td>
+ <td style="border-left: 6px solid pink; border-bottom: 8px solid blue">Cell 2B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h4>TC-C3: cells with span and competing rules</h4>
+ <table border=1 bordercolor="#999999" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td colspan=2 style="border-bottom: 4px solid red">Cell 1A/B spans over two columns (border-bottom: red)</td>
+ </tr>
+ <tr>
+ <td style="border-top: 1px solid green">Cell 2A (border-top loses -> red)</td>
+ <td style="border-top: 10px solid green">Cell 2B (border-top wins -> green)</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h1>Non-Working Test Cases</h1>
+
+ <h2>border-collapse: separate</h2>
+
+ <h3>TC-X1: table css border (red via style)</h3>
+ <table style="border: 1px solid red">
+ <tbody>
+ <tr>
+ <td>Cell 1A</td>
+ <td>Cell 1B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h2>border-collapse: collapse</h2>
+
+ <h3>TC-X2: tr css border</h3>
+ <table border=1 style="border-collapse: collapse">
+ <tbody>
+ <tr style="border-bottom: 2px solid red">
+ <td>Cell 1A (border-bottom should be red)</td>
+ <td>Cell 1B (border-bottom should be red)</td>
+ </tr>
+ <tr style="border-left: 2px solid red">
+ <td>Cell 2A (border-left should be red)</td>
+ <td>Cell 2B</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h3>TC-X3: cells with competing rules and colspan</h3>
+ <table border=1 bordercolor="#999999" style="border-collapse: collapse">
+ <tbody>
+ <tr>
+ <td colspan=2 style="border-bottom: 4px solid red; border-right: 15px solid pink">Cell 1A/B spans over two columns (border-bottom: red, border-right pink)</td>
+ </tr>
+ <tr>
+ <td style="border-top: 1px solid green">Cell 2A (border-top loses -> red)</td>
+ <td style="border-top: 10px solid green">Cell 2B (border-top wins -> green)</td>
+ </tr>
+ </tbody>
+ </table>
+ This is currently not 100% correct but admittedly a constructed corner case (and Chrome failes here, too).
+
+ </body>
+</html>
diff --git a/tests/manual/qtexttableborders/widget.cpp b/tests/manual/qtexttableborders/widget.cpp
new file mode 100644
index 0000000000..21d958ce81
--- /dev/null
+++ b/tests/manual/qtexttableborders/widget.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "widget.h"
+#include "ui_widget.h"
+
+#include <QScrollBar>
+#include <QFile>
+#include <QDir>
+#include <QTemporaryFile>
+
+#ifndef QT_NO_DESKTOPSERVICES
+#include <QDesktopServices>
+#endif
+
+#ifndef QT_NO_PRINTER
+#include <QPrinter>
+#include <QPrintDialog>
+#include <QPrintPreviewDialog>
+#endif
+
+// This manual test allows checking the QTextTable border logic (QTBUG-36152)
+
+Widget::Widget(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::Widget)
+{
+ ui->setupUi(this);
+ resize(1400, 800);
+
+ connect(ui->docComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &Widget::onDocumentSelected);
+ connect(ui->printButton, &QPushButton::clicked, this, &Widget::onPrint);
+ connect(ui->previewButton, &QPushButton::clicked, this, &Widget::onPreview);
+ connect(ui->openBrowserButton, &QPushButton::clicked, this, &Widget::onOpenBrowser);
+
+ connect(ui->sourceEdit, &QTextEdit::textChanged, this,
+ [this]() {
+ // make this a world class HTML IDE
+ auto pos = ui->htmlEdit->verticalScrollBar()->value();
+ ui->htmlEdit->setHtml(ui->sourceEdit->toPlainText());
+ ui->htmlEdit->verticalScrollBar()->setValue(pos);
+ });
+
+ ui->docComboBox->addItem(tr("Table Border Test"), ":/table-border-test.html");
+ ui->docComboBox->addItem(tr("Table Border Header Test"), ":/table-border-test-header.html");
+
+ ui->docComboBox->setCurrentIndex(0);
+}
+
+Widget::~Widget()
+{
+ delete ui;
+}
+
+void Widget::onDocumentSelected()
+{
+ QString url = ui->docComboBox->itemData(ui->docComboBox->currentIndex()).toString();
+ QFile f(url);
+ if (f.open(QFile::ReadOnly)) {
+ ui->sourceEdit->setPlainText(QString::fromUtf8(f.readAll()));
+ // preview HTML is set via textChanged signal
+ }
+}
+
+void Widget::onPrint()
+{
+#ifndef QT_NO_PRINTER
+ QPrinter printer(QPrinter::HighResolution);
+ QPrintDialog dlg(&printer, this);
+ if (ui->htmlEdit->textCursor().hasSelection())
+ dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection);
+ dlg.setWindowTitle(tr("Print Document"));
+ if (dlg.exec() == QDialog::Accepted) {
+ ui->htmlEdit->print(&printer);
+ }
+#endif
+}
+
+void Widget::onPreview()
+{
+#ifndef QT_NO_PRINTER
+ QPrinter printer(QPrinter::HighResolution);
+ QPrintPreviewDialog preview(&printer, this);
+ connect(&preview, &QPrintPreviewDialog::paintRequested, ui->htmlEdit, &QTextEdit::print);
+ preview.exec();
+#endif
+}
+
+void Widget::onOpenBrowser()
+{
+ // write the current html to a temp file and open the system browser
+#ifndef QT_NO_DESKTOPSERVICES
+ auto tf = new QTemporaryFile(QDir::tempPath() + "/XXXXXX.html", this);
+ if (tf->open()) {
+ tf->write(ui->sourceEdit->toPlainText().toUtf8());
+ tf->close();
+ QDesktopServices::openUrl(QUrl::fromLocalFile(tf->fileName()));
+ }
+#endif
+}
diff --git a/tests/manual/qtexttableborders/widget.h b/tests/manual/qtexttableborders/widget.h
new file mode 100644
index 0000000000..9cf459e1cd
--- /dev/null
+++ b/tests/manual/qtexttableborders/widget.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include <QWidget>
+
+namespace Ui {
+class Widget;
+}
+
+class Widget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit Widget(QWidget *parent = nullptr);
+ ~Widget();
+
+private slots:
+ void onDocumentSelected();
+ void onPrint();
+ void onPreview();
+ void onOpenBrowser();
+
+private:
+ Ui::Widget *ui;
+};
+
+#endif // WIDGET_H
diff --git a/tests/manual/qtexttableborders/widget.ui b/tests/manual/qtexttableborders/widget.ui
new file mode 100644
index 0000000000..95c23be69e
--- /dev/null
+++ b/tests/manual/qtexttableborders/widget.ui
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Widget</class>
+ <widget class="QWidget" name="Widget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>606</width>
+ <height>522</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>QTextTable Border Manual Test</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QComboBox" name="docComboBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="printButton">
+ <property name="text">
+ <string>Print</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="previewButton">
+ <property name="text">
+ <string>Preview</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="openBrowserButton">
+ <property name="text">
+ <string>Open Browser</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QSplitter" name="splitter">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QTextEdit" name="htmlEdit"/>
+ <widget class="QTextEdit" name="sourceEdit"/>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <tabstops>
+ <tabstop>docComboBox</tabstop>
+ <tabstop>printButton</tabstop>
+ <tabstop>previewButton</tabstop>
+ <tabstop>openBrowserButton</tabstop>
+ <tabstop>htmlEdit</tabstop>
+ </tabstops>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp
new file mode 100644
index 0000000000..af454c2487
--- /dev/null
+++ b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp
@@ -0,0 +1,200 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include "../shared/cube.h"
+#include "../shared/dds_bc1.h"
+
+struct {
+ QRhiBuffer *vbuf = nullptr;
+ bool vbufReady = false;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+
+ float rotation = 0;
+
+ QByteArrayList compressedData;
+} d;
+
+void Window::customInit()
+{
+ if (!m_r->isTextureFormatSupported(QRhiTexture::BC1))
+ qFatal("This backend does not support BC1");
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ d.vbuf->build();
+ d.vbufReady = false;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.ubuf->build();
+
+ QSize imageSize;
+ d.compressedData = loadBC1(QLatin1String(":/qt256_bc1_9mips.dds"), &imageSize);
+ qDebug() << d.compressedData.count() << imageSize << m_r->mipLevelsForSize(imageSize);
+
+ d.tex = m_r->newTexture(QRhiTexture::BC1, imageSize, 1, QRhiTexture::MipMapped);
+ d.tex->build();
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::Linear,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+
+ d.ps->setDepthTest(true);
+ d.ps->setDepthWrite(true);
+ d.ps->setDepthOp(QRhiGraphicsPipeline::Less);
+
+ d.ps->setCullMode(QRhiGraphicsPipeline::Back);
+ d.ps->setFrontFace(QRhiGraphicsPipeline::CCW);
+
+ const QShader vs = getShader(QLatin1String(":/texture.vert.qsb"));
+ if (!vs.isValid())
+ qFatal("Failed to load shader pack (vertex)");
+ const QShader fs = getShader(QLatin1String(":/texture.frag.qsb"));
+ if (!fs.isValid())
+ qFatal("Failed to load shader pack (fragment)");
+
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+
+ d.ps->build();
+}
+
+void Window::customRelease()
+{
+ delete d.ps;
+ d.ps = nullptr;
+
+ delete d.srb;
+ d.srb = nullptr;
+
+ delete d.ubuf;
+ d.ubuf = nullptr;
+
+ delete d.vbuf;
+ d.vbuf = nullptr;
+
+ delete d.sampler;
+ d.sampler = nullptr;
+
+ delete d.tex;
+ d.tex = nullptr;
+}
+
+void Window::customRender()
+{
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (!d.vbufReady) {
+ d.vbufReady = true;
+ u->uploadStaticBuffer(d.vbuf, cube);
+ qint32 flip = 0;
+ u->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+ }
+ if (!d.compressedData.isEmpty()) {
+ QVarLengthArray<QRhiTextureUploadEntry, 16> descEntries;
+ for (int i = 0; i < d.compressedData.count(); ++i) {
+ QRhiTextureSubresourceUploadDescription image(d.compressedData[i].constData(), d.compressedData[i].size());
+ descEntries.append({ 0, i, image });
+ }
+ QRhiTextureUploadDescription desc;
+ desc.setEntries(descEntries.cbegin(), descEntries.cend());
+ u->uploadTexture(d.tex, desc);
+ d.compressedData.clear();
+ }
+ d.rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(0.5f);
+ mvp.rotate(d.rotation, 0, 1, 0);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { d.vbuf, 0 },
+ { d.vbuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ cb->draw(36);
+
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.pro b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.pro
new file mode 100644
index 0000000000..d185aa6b9a
--- /dev/null
+++ b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ compressedtexture_bc1.cpp
+
+RESOURCES = compressedtexture_bc1.qrc
diff --git a/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.qrc b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.qrc
new file mode 100644
index 0000000000..a83259a7d3
--- /dev/null
+++ b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="qt256_bc1_9mips.dds">../shared/qt256_bc1_9mips.dds</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp
new file mode 100644
index 0000000000..4931c8eaa1
--- /dev/null
+++ b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include "../shared/cube.h"
+#include "../shared/dds_bc1.h"
+
+struct {
+ QRhiBuffer *vbuf = nullptr;
+ bool vbufReady = false;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+
+ float rotation = 0;
+
+ QByteArrayList compressedData;
+ QByteArrayList compressedData2;
+} d;
+
+void Window::customInit()
+{
+ if (!m_r->isTextureFormatSupported(QRhiTexture::BC1))
+ qFatal("This backend does not support BC1");
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ d.vbuf->build();
+ d.vbufReady = false;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.ubuf->build();
+
+ QSize imageSize;
+ d.compressedData = loadBC1(QLatin1String(":/qt256_bc1_9mips.dds"), &imageSize);
+ Q_ASSERT(imageSize == QSize(256, 256));
+
+ d.tex = m_r->newTexture(QRhiTexture::BC1, imageSize);
+ d.tex->build();
+
+ d.compressedData2 = loadBC1(QLatin1String(":/bwqt224_64_nomips.dds"), &imageSize);
+ Q_ASSERT(imageSize == QSize(224, 64));
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None, // no mipmapping here
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+
+ d.ps->setDepthTest(true);
+ d.ps->setDepthWrite(true);
+ d.ps->setDepthOp(QRhiGraphicsPipeline::Less);
+
+ d.ps->setCullMode(QRhiGraphicsPipeline::Back);
+ d.ps->setFrontFace(QRhiGraphicsPipeline::CCW);
+
+ const QShader vs = getShader(QLatin1String(":/texture.vert.qsb"));
+ if (!vs.isValid())
+ qFatal("Failed to load shader pack (vertex)");
+ const QShader fs = getShader(QLatin1String(":/texture.frag.qsb"));
+ if (!fs.isValid())
+ qFatal("Failed to load shader pack (fragment)");
+
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+
+ d.ps->build();
+}
+
+void Window::customRelease()
+{
+ delete d.ps;
+ d.ps = nullptr;
+
+ delete d.srb;
+ d.srb = nullptr;
+
+ delete d.ubuf;
+ d.ubuf = nullptr;
+
+ delete d.vbuf;
+ d.vbuf = nullptr;
+
+ delete d.sampler;
+ d.sampler = nullptr;
+
+ delete d.tex;
+ d.tex = nullptr;
+}
+
+void Window::customRender()
+{
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (!d.vbufReady) {
+ d.vbufReady = true;
+ u->uploadStaticBuffer(d.vbuf, cube);
+ qint32 flip = 0;
+ u->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+ }
+ if (!d.compressedData.isEmpty()) {
+ {
+ QRhiTextureUploadDescription desc({ 0, 0, { d.compressedData[0].constData(), d.compressedData[0].size() } });
+ u->uploadTexture(d.tex, desc);
+ d.compressedData.clear();
+ }
+
+ // now exercise uploading a smaller compressed image into the same texture
+ {
+ QRhiTextureSubresourceUploadDescription image(d.compressedData2[0].constData(), d.compressedData2[0].size());
+ // positions and sizes must be multiples of 4 here (for BC1)
+ image.setDestinationTopLeft(QPoint(16, 32));
+ // the image is smaller than the subresource size (224x64 vs
+ // 256x256) so the size must be specified manually
+ image.setSourceSize(QSize(224, 64));
+ QRhiTextureUploadDescription desc({ 0, 0, image });
+ u->uploadTexture(d.tex, desc);
+ d.compressedData2.clear();
+ }
+ }
+ d.rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(0.5f);
+ mvp.rotate(d.rotation, 0, 1, 0);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { d.vbuf, 0 },
+ { d.vbuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ cb->draw(36);
+
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.pro b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.pro
new file mode 100644
index 0000000000..a1184fc754
--- /dev/null
+++ b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ compressedtexture_bc1_subupload.cpp
+
+RESOURCES = compressedtexture_bc1_subupload.qrc
diff --git a/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.qrc b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.qrc
new file mode 100644
index 0000000000..859a0a79f6
--- /dev/null
+++ b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="qt256_bc1_9mips.dds">../shared/qt256_bc1_9mips.dds</file>
+ <file alias="bwqt224_64_nomips.dds">../shared/bwqt224_64_nomips.dds</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/computebuffer/buffer.comp b/tests/manual/rhi/computebuffer/buffer.comp
new file mode 100644
index 0000000000..a0d0350e37
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/buffer.comp
@@ -0,0 +1,41 @@
+#version 440
+
+layout (local_size_x = 256) in;
+
+struct Data
+{
+ vec2 pos;
+ float dir;
+};
+
+layout(std140, binding = 0) buffer StorageBuffer
+{
+ Data d[];
+} buf;
+
+layout(std140, binding = 1) uniform UniformBuffer
+{
+ float step;
+ uint count;
+} ubuf;
+
+void main()
+{
+ uint index = gl_GlobalInvocationID.x;
+ if (index < ubuf.count) {
+ vec2 p = buf.d[index].pos;
+ float dir = buf.d[index].dir;
+
+ p.x += dir * ubuf.step * 0.01;
+ if (p.x > 1.0) {
+ p.x = 1.0;
+ buf.d[index].dir *= -1.0;
+ }
+ if (p.x < -1.0) {
+ p.x = -1.0;
+ buf.d[index].dir *= -1.0;
+ }
+
+ buf.d[index].pos = p;
+ }
+}
diff --git a/tests/manual/rhi/computebuffer/buffer.comp.qsb b/tests/manual/rhi/computebuffer/buffer.comp.qsb
new file mode 100644
index 0000000000..b1a666f185
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/buffer.comp.qsb
Binary files differ
diff --git a/tests/manual/rhi/computebuffer/buildshaders.bat b/tests/manual/rhi/computebuffer/buildshaders.bat
new file mode 100755
index 0000000000..2768273b70
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/buildshaders.bat
@@ -0,0 +1,3 @@
+qsb --glsl "310 es,430" --hlsl 50 --msl 12 buffer.comp -o buffer.comp.qsb
+qsb --glsl "310 es,430" --hlsl 50 --msl 12 main.vert -o main.vert.qsb
+qsb --glsl "310 es,430" --hlsl 50 --msl 12 main.frag -o main.frag.qsb
diff --git a/tests/manual/rhi/computebuffer/computebuffer.cpp b/tests/manual/rhi/computebuffer/computebuffer.cpp
new file mode 100644
index 0000000000..c991a11438
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/computebuffer.cpp
@@ -0,0 +1,205 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include <QRandomGenerator>
+
+// Compute shader example. Writes to a storage buffer from a compute shader,
+// then uses the same buffer as vertex buffer in the vertex stage. This would
+// be typical when implementing particles for example. Here we just simply move
+// the positions back and forth along the X axis.
+
+// Note that the example relies on gl_PointSize which is not supported
+// everywhere. So in some cases the points will be of size 1.
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *sbuf = nullptr;
+ QRhiBuffer *computeUniBuf = nullptr;
+ QRhiShaderResourceBindings *computeBindings = nullptr;
+ QRhiComputePipeline *computePipeline = nullptr;
+ QRhiShaderResourceBindings *graphicsBindings = nullptr;
+ QRhiGraphicsPipeline *graphicsPipeline = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ float step = 0.2f;
+} d;
+
+// these struct must match the std140 packing rules
+struct Data {
+ float pos[2];
+ float dir;
+ quint32 pad[1];
+};
+struct ComputeUBuf {
+ float step;
+ quint32 count;
+};
+
+const int DATA_COUNT = 256 * 128;
+
+const int COMPUTE_UBUF_SIZE = 8;
+
+void Window::customInit()
+{
+ if (!m_r->isFeatureSupported(QRhi::Compute))
+ qFatal("Compute is not supported");
+
+ if (!m_r->isFeatureSupported(QRhi::VertexShaderPointSize))
+ qWarning("Point sizes other than 1 not supported");
+
+ // compute pass
+
+ d.sbuf = m_r->newBuffer(QRhiBuffer::Immutable,
+ QRhiBuffer::StorageBuffer | QRhiBuffer::VertexBuffer,
+ sizeof(Data) * DATA_COUNT);
+ d.sbuf->build();
+ d.releasePool << d.sbuf;
+
+ d.computeUniBuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, COMPUTE_UBUF_SIZE);
+ d.computeUniBuf->build();
+ d.releasePool << d.computeUniBuf;
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+
+ QByteArray data;
+ data.resize(sizeof(Data) * DATA_COUNT);
+ Data *p = reinterpret_cast<Data *>(data.data());
+ QRandomGenerator *rgen = QRandomGenerator::global();
+ for (int i = 0; i < DATA_COUNT; ++i) {
+ p->pos[0] = rgen->bounded(1000) / 500.0f - 1.0f;
+ p->pos[1] = rgen->bounded(1000) / 500.0f - 1.0f;
+ p->dir = rgen->bounded(2) ? 1 : -1;
+ ++p;
+ }
+ d.initialUpdates->uploadStaticBuffer(d.sbuf, data.constData());
+
+ ComputeUBuf ud;
+ ud.step = d.step;
+ ud.count = DATA_COUNT;
+ d.initialUpdates->updateDynamicBuffer(d.computeUniBuf, 0, COMPUTE_UBUF_SIZE, &ud);
+
+ d.computeBindings = m_r->newShaderResourceBindings();
+ d.computeBindings->setBindings({
+ QRhiShaderResourceBinding::bufferLoadStore(0, QRhiShaderResourceBinding::ComputeStage, d.sbuf),
+ QRhiShaderResourceBinding::uniformBuffer(1, QRhiShaderResourceBinding::ComputeStage, d.computeUniBuf)
+ });
+ d.computeBindings->build();
+ d.releasePool << d.computeBindings;
+
+ d.computePipeline = m_r->newComputePipeline();
+ d.computePipeline->setShaderResourceBindings(d.computeBindings);
+ d.computePipeline->setShaderStage({ QRhiShaderStage::Compute, getShader(QLatin1String(":/buffer.comp.qsb")) });
+ d.computePipeline->build();
+ d.releasePool << d.computePipeline;
+
+ // graphics pass
+
+ d.graphicsBindings = m_r->newShaderResourceBindings();
+ d.graphicsBindings->build();
+ d.releasePool << d.graphicsBindings;
+
+ d.graphicsPipeline = m_r->newGraphicsPipeline();
+ d.graphicsPipeline->setTopology(QRhiGraphicsPipeline::Points);
+ d.graphicsPipeline->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/main.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/main.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ });
+ d.graphicsPipeline->setVertexInputLayout(inputLayout);
+ d.graphicsPipeline->setShaderResourceBindings(d.graphicsBindings);
+ d.graphicsPipeline->setRenderPassDescriptor(m_rp);
+ d.graphicsPipeline->build();
+ d.releasePool << d.graphicsPipeline;
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+#if 0
+ u->updateDynamicBuffer(d.computeUniBuf, 0, sizeof(float), &d.step);
+ d.step += 0.01f;
+#endif
+
+ // compute pass
+ cb->beginComputePass(u);
+ cb->setComputePipeline(d.computePipeline);
+ cb->setShaderResources();
+ cb->dispatch(DATA_COUNT / 256, 1, 1);
+ cb->endComputePass();
+
+ // graphics pass
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.graphicsPipeline);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ QRhiCommandBuffer::VertexInput vbufBinding(d.sbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(DATA_COUNT);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/computebuffer/computebuffer.pro b/tests/manual/rhi/computebuffer/computebuffer.pro
new file mode 100644
index 0000000000..ab3c8001f1
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/computebuffer.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ computebuffer.cpp
+
+RESOURCES = computebuffer.qrc
diff --git a/tests/manual/rhi/computebuffer/computebuffer.qrc b/tests/manual/rhi/computebuffer/computebuffer.qrc
new file mode 100644
index 0000000000..d9e877a15d
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/computebuffer.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>buffer.comp.qsb</file>
+ <file>main.vert.qsb</file>
+ <file>main.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/computebuffer/main.frag b/tests/manual/rhi/computebuffer/main.frag
new file mode 100644
index 0000000000..4785a404d3
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/main.frag
@@ -0,0 +1,8 @@
+#version 440
+
+layout(location = 0) out vec4 fragColor;
+
+void main()
+{
+ fragColor = vec4(1.0);
+}
diff --git a/tests/manual/rhi/computebuffer/main.frag.qsb b/tests/manual/rhi/computebuffer/main.frag.qsb
new file mode 100644
index 0000000000..f05da411e5
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/main.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/computebuffer/main.vert b/tests/manual/rhi/computebuffer/main.vert
new file mode 100644
index 0000000000..5dfb778d2e
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/main.vert
@@ -0,0 +1,11 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+
+out gl_PerVertex { vec4 gl_Position; float gl_PointSize; };
+
+void main()
+{
+ gl_PointSize = 4.0; // required with Vulkan when drawing points
+ gl_Position = position;
+}
diff --git a/tests/manual/rhi/computebuffer/main.vert.qsb b/tests/manual/rhi/computebuffer/main.vert.qsb
new file mode 100644
index 0000000000..944645ffbf
--- /dev/null
+++ b/tests/manual/rhi/computebuffer/main.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/computeimage/buildshaders.bat b/tests/manual/rhi/computeimage/buildshaders.bat
new file mode 100755
index 0000000000..41a324d2b2
--- /dev/null
+++ b/tests/manual/rhi/computeimage/buildshaders.bat
@@ -0,0 +1 @@
+qsb --glsl "310 es,430" --hlsl 50 --msl 12 image.comp -o image.comp.qsb
diff --git a/tests/manual/rhi/computeimage/computeimage.cpp b/tests/manual/rhi/computeimage/computeimage.cpp
new file mode 100644
index 0000000000..a6c860f8ee
--- /dev/null
+++ b/tests/manual/rhi/computeimage/computeimage.cpp
@@ -0,0 +1,228 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+
+// Compute shader example with image load/store. The texture sampled in the
+// fragment shader is generated by the compute shader.
+
+struct {
+ QVector<QRhiResource *> releasePool;
+
+ QRhiTexture *texIn = nullptr;
+ QRhiTexture *texOut = nullptr;
+ QRhiBuffer *computeUBuf = nullptr;
+ QRhiShaderResourceBindings *computeBindings = nullptr;
+ QRhiComputePipeline *computePipeline = nullptr;
+
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ibuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ QSize imageSize;
+ QMatrix4x4 winProj;
+ float factor = 1.0f;
+} d;
+
+static float quadVertexData[] =
+{ // Y up, CCW
+ -0.5f, 0.5f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 1.0f, 1.0f,
+ 0.5f, 0.5f, 1.0f, 0.0f
+};
+
+static quint16 quadIndexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+void Window::customInit()
+{
+ if (!m_r->isFeatureSupported(QRhi::Compute))
+ qFatal("Compute is not supported");
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+
+ // compute pass
+
+ const QImage image = QImage(QLatin1String(":/qt256.png")).convertToFormat(QImage::Format_RGBA8888);
+ d.imageSize = image.size();
+ d.texIn = m_r->newTexture(QRhiTexture::RGBA8, d.imageSize, 1, QRhiTexture::UsedWithLoadStore);
+ d.texIn->build();
+ d.releasePool << d.texIn;
+
+ d.texOut = m_r->newTexture(QRhiTexture::RGBA8, d.imageSize, 1, QRhiTexture::UsedWithLoadStore);
+ d.texOut->build();
+ d.releasePool << d.texOut;
+
+ d.initialUpdates->uploadTexture(d.texIn, image);
+
+ d.computeUBuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 4);
+ d.computeUBuf->build();
+ d.releasePool << d.computeUBuf;
+
+ d.computeBindings = m_r->newShaderResourceBindings();
+ d.computeBindings->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::ComputeStage, d.computeUBuf),
+ QRhiShaderResourceBinding::imageLoad(1, QRhiShaderResourceBinding::ComputeStage, d.texIn, 0),
+ QRhiShaderResourceBinding::imageStore(2, QRhiShaderResourceBinding::ComputeStage, d.texOut, 0)
+ });
+ d.computeBindings->build();
+ d.releasePool << d.computeBindings;
+
+ d.computePipeline = m_r->newComputePipeline();
+ d.computePipeline->setShaderResourceBindings(d.computeBindings);
+ d.computePipeline->setShaderStage({ QRhiShaderStage::Compute, getShader(QLatin1String(":/image.comp.qsb")) });
+ d.computePipeline->build();
+ d.releasePool << d.computePipeline;
+
+ // graphics pass
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(quadVertexData));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, quadVertexData);
+
+ d.ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(quadIndexData));
+ d.ibuf->build();
+ d.releasePool << d.ibuf;
+
+ d.initialUpdates->uploadStaticBuffer(d.ibuf, quadIndexData);
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ qint32 flip = 0; // regardless of isYUpInFramebuffer() since the input is not flipped so the end result is good for GL too
+ d.initialUpdates->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.texOut, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 4 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+ d.ps->build();
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ if (d.winProj != m_proj) {
+ d.winProj = m_proj;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(2.5f);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ }
+
+ u->updateDynamicBuffer(d.computeUBuf, 0, 4, &d.factor);
+ d.factor += 0.1f;
+ if (d.factor >= 50.0f)
+ d.factor = 1.0f;
+
+ cb->beginComputePass(u);
+ cb->setComputePipeline(d.computePipeline);
+ cb->setShaderResources();
+ cb->dispatch(d.imageSize.width() / 16, d.imageSize.height() / 16, 1);
+ cb->endComputePass();
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding, d.ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ cb->drawIndexed(6);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/computeimage/computeimage.pro b/tests/manual/rhi/computeimage/computeimage.pro
new file mode 100644
index 0000000000..291a4e91b1
--- /dev/null
+++ b/tests/manual/rhi/computeimage/computeimage.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ computeimage.cpp
+
+RESOURCES = computeimage.qrc
diff --git a/tests/manual/rhi/computeimage/computeimage.qrc b/tests/manual/rhi/computeimage/computeimage.qrc
new file mode 100644
index 0000000000..5299e1ae22
--- /dev/null
+++ b/tests/manual/rhi/computeimage/computeimage.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>image.comp.qsb</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+ <file alias="qt256.png">../shared/qt256.png</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/computeimage/image.comp b/tests/manual/rhi/computeimage/image.comp
new file mode 100644
index 0000000000..9826ed7c6c
--- /dev/null
+++ b/tests/manual/rhi/computeimage/image.comp
@@ -0,0 +1,20 @@
+#version 440
+
+layout (local_size_x = 16, local_size_y = 16) in;
+
+layout(std140, binding = 0) uniform UniformBuffer
+{
+ float factor;
+} ubuf;
+
+layout (binding = 1, rgba8) uniform readonly image2D texIn;
+layout (binding = 2, rgba8) uniform writeonly image2D texOut;
+
+void main()
+{
+ ivec2 pos = ivec2(gl_GlobalInvocationID.xy);
+ ivec2 d = ivec2(1, 1);
+ vec4 diff = imageLoad(texIn, pos + d) - imageLoad(texIn, pos - d);
+ float c = (diff.x + diff.y + diff.z) / ubuf.factor + 0.5f;
+ imageStore(texOut, pos, vec4(c, c, c, 1.0));
+}
diff --git a/tests/manual/rhi/computeimage/image.comp.qsb b/tests/manual/rhi/computeimage/image.comp.qsb
new file mode 100644
index 0000000000..725629f7ab
--- /dev/null
+++ b/tests/manual/rhi/computeimage/image.comp.qsb
Binary files differ
diff --git a/tests/manual/rhi/cubemap/buildshaders.bat b/tests/manual/rhi/cubemap/buildshaders.bat
new file mode 100644
index 0000000000..ebf673875d
--- /dev/null
+++ b/tests/manual/rhi/cubemap/buildshaders.bat
@@ -0,0 +1,2 @@
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c cubemap.vert -o cubemap.vert.qsb
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c cubemap.frag -o cubemap.frag.qsb
diff --git a/tests/manual/rhi/cubemap/c.png b/tests/manual/rhi/cubemap/c.png
new file mode 100644
index 0000000000..7b00455e53
--- /dev/null
+++ b/tests/manual/rhi/cubemap/c.png
Binary files differ
diff --git a/tests/manual/rhi/cubemap/cubemap.cpp b/tests/manual/rhi/cubemap/cubemap.cpp
new file mode 100644
index 0000000000..fe6ac9762e
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.cpp
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include "../shared/cube.h"
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+} d;
+
+void Window::customInit()
+{
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ const QSize cubeMapSize(512, 512);
+ d.tex = m_r->newTexture(QRhiTexture::RGBA8, cubeMapSize, 1, QRhiTexture::CubeMap);
+ d.releasePool << d.tex;
+ d.tex->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, cube);
+
+ QImage img = QImage(":/c.png").mirrored().convertToFormat(QImage::Format_RGBA8888);
+ // just use the same image for all faces for now
+ QRhiTextureSubresourceUploadDescription subresDesc(img);
+ QRhiTextureUploadDescription desc({
+ { 0, 0, subresDesc }, // +X
+ { 1, 0, subresDesc }, // -X
+ { 2, 0, subresDesc }, // +Y
+ { 3, 0, subresDesc }, // -Y
+ { 4, 0, subresDesc }, // +Z
+ { 5, 0, subresDesc } // -Z
+ });
+ d.initialUpdates->uploadTexture(d.tex, desc);
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::Repeat, QRhiSampler::Repeat);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+
+ d.ps->setDepthTest(true);
+ d.ps->setDepthWrite(true);
+ d.ps->setDepthOp(QRhiGraphicsPipeline::LessOrEqual);
+
+ d.ps->setCullMode(QRhiGraphicsPipeline::Front); // we are inside the cube so cull front, not back
+ d.ps->setFrontFace(QRhiGraphicsPipeline::CCW); // front is ccw in the cube data
+
+ QShader vs = getShader(QLatin1String(":/cubemap.vert.qsb"));
+ Q_ASSERT(vs.isValid());
+ QShader fs = getShader(QLatin1String(":/cubemap.frag.qsb"));
+ Q_ASSERT(fs.isValid());
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 }
+ });
+
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+
+ d.ps->build();
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ QMatrix4x4 mvp = m_r->clipSpaceCorrMatrix();
+ mvp.perspective(90.0f, outputSizeInPixels.width() / (float) outputSizeInPixels.height(), 0.01f, 1000.0f);
+ // cube vertices go from -1..1
+ mvp.scale(10);
+ static float rx = 0;
+ mvp.rotate(rx, 1, 0, 0);
+ rx += 0.5f;
+ // no translation
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport(QRhiViewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()));
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(36);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/cubemap/cubemap.frag b/tests/manual/rhi/cubemap/cubemap.frag
new file mode 100644
index 0000000000..13a365ed0c
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.frag
@@ -0,0 +1,10 @@
+#version 440
+
+layout(location = 0) in vec3 v_coord;
+layout(location = 0) out vec4 fragColor;
+layout(binding = 1) uniform samplerCube tex;
+
+void main()
+{
+ fragColor = vec4(texture(tex, v_coord).rgb, 1.0);
+}
diff --git a/tests/manual/rhi/cubemap/cubemap.frag.qsb b/tests/manual/rhi/cubemap/cubemap.frag.qsb
new file mode 100644
index 0000000000..d7cc025554
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/cubemap/cubemap.pro b/tests/manual/rhi/cubemap/cubemap.pro
new file mode 100644
index 0000000000..61910ffe20
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ cubemap.cpp
+
+RESOURCES = cubemap.qrc
diff --git a/tests/manual/rhi/cubemap/cubemap.qrc b/tests/manual/rhi/cubemap/cubemap.qrc
new file mode 100644
index 0000000000..bacd15446c
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>cubemap.vert.qsb</file>
+ <file>cubemap.frag.qsb</file>
+ <file>c.png</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/cubemap/cubemap.vert b/tests/manual/rhi/cubemap/cubemap.vert
new file mode 100644
index 0000000000..65216dd6b0
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.vert
@@ -0,0 +1,15 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 0) out vec3 v_coord;
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ v_coord = position.xyz;
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/manual/rhi/cubemap/cubemap.vert.qsb b/tests/manual/rhi/cubemap/cubemap.vert.qsb
new file mode 100644
index 0000000000..fae136337c
--- /dev/null
+++ b/tests/manual/rhi/cubemap/cubemap.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/cubemap_scissor/cubemap_scissor.cpp b/tests/manual/rhi/cubemap_scissor/cubemap_scissor.cpp
new file mode 100644
index 0000000000..25a7c64c8a
--- /dev/null
+++ b/tests/manual/rhi/cubemap_scissor/cubemap_scissor.cpp
@@ -0,0 +1,241 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+// This is a test for scissoring. Based on the cubemap test (because there the
+// rendering covers the entire viewport which is what we need here). The
+// scissor rectangle moves first up, then down, then from the center to the
+// left and then to right. The important part is to ensure that the behavior
+// identical between all backends, especially when the rectangle is partly or
+// fully off window.
+
+#include "../shared/examplefw.h"
+#include "../shared/cube.h"
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+
+ QPoint scissorBottomLeft;
+ QSize scissorSize;
+ int scissorAnimState = 0;
+ QSize outputSize;
+} d;
+
+void Window::customInit()
+{
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ const QSize cubeMapSize(512, 512);
+ d.tex = m_r->newTexture(QRhiTexture::RGBA8, cubeMapSize, 1, QRhiTexture::CubeMap);
+ d.releasePool << d.tex;
+ d.tex->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, cube);
+
+ QImage img = QImage(":/c.png").mirrored().convertToFormat(QImage::Format_RGBA8888);
+ // just use the same image for all faces for now
+ QRhiTextureSubresourceUploadDescription subresDesc(img);
+ QRhiTextureUploadDescription desc({
+ { 0, 0, subresDesc }, // +X
+ { 1, 0, subresDesc }, // -X
+ { 2, 0, subresDesc }, // +Y
+ { 3, 0, subresDesc }, // -Y
+ { 4, 0, subresDesc }, // +Z
+ { 5, 0, subresDesc } // -Z
+ });
+ d.initialUpdates->uploadTexture(d.tex, desc);
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::Repeat, QRhiSampler::Repeat);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+
+ d.ps->setFlags(QRhiGraphicsPipeline::UsesScissor);
+
+ d.ps->setDepthTest(true);
+ d.ps->setDepthWrite(true);
+ d.ps->setDepthOp(QRhiGraphicsPipeline::LessOrEqual);
+
+ d.ps->setCullMode(QRhiGraphicsPipeline::Front); // we are inside the cube so cull front, not back
+ d.ps->setFrontFace(QRhiGraphicsPipeline::CCW); // front is ccw in the cube data
+
+ QShader vs = getShader(QLatin1String(":/cubemap.vert.qsb"));
+ Q_ASSERT(vs.isValid());
+ QShader fs = getShader(QLatin1String(":/cubemap.frag.qsb"));
+ Q_ASSERT(fs.isValid());
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 }
+ });
+
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+
+ d.ps->build();
+
+ d.scissorAnimState = 0;
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+static void advanceScissor()
+{
+ switch (d.scissorAnimState) {
+ case 1: // up
+ d.scissorBottomLeft.setX(d.outputSize.width() / 4);
+ d.scissorBottomLeft.ry() += 1;
+ if (d.scissorBottomLeft.y() > d.outputSize.height() + 100)
+ d.scissorAnimState = 2;
+ break;
+ case 2: // down
+ d.scissorBottomLeft.ry() -= 1;
+ if (d.scissorBottomLeft.y() < -d.scissorSize.height() - 100)
+ d.scissorAnimState = 3;
+ break;
+ case 3: // left
+ d.scissorBottomLeft.setY(d.outputSize.height() / 4);
+ d.scissorBottomLeft.rx() += 1;
+ if (d.scissorBottomLeft.x() > d.outputSize.width() + 100)
+ d.scissorAnimState = 4;
+ break;
+ case 4: // right
+ d.scissorBottomLeft.rx() -= 1;
+ if (d.scissorBottomLeft.x() < -d.scissorSize.width() - 100)
+ d.scissorAnimState = 1;
+ break;
+ }
+
+ qDebug() << "scissor bottom-left" << d.scissorBottomLeft << "size" << d.scissorSize;
+}
+
+void Window::customRender()
+{
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ d.outputSize = outputSizeInPixels;
+ if (d.scissorAnimState == 0) {
+ d.scissorBottomLeft = QPoint(outputSizeInPixels.width() / 4, 0);
+ d.scissorSize = QSize(outputSizeInPixels.width() / 2, outputSizeInPixels.height() / 2);
+ d.scissorAnimState = 1;
+ }
+
+ QMatrix4x4 mvp = m_r->clipSpaceCorrMatrix();
+ mvp.perspective(90.0f, outputSizeInPixels.width() / (float) outputSizeInPixels.height(), 0.01f, 1000.0f);
+ // cube vertices go from -1..1
+ mvp.scale(10);
+ static float rx = 0;
+ mvp.rotate(rx, 1, 0, 0);
+ rx += 0.5f;
+ // no translation
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport(QRhiViewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()));
+
+ // Apply a scissor rectangle that moves around on the screen, also
+ // exercising the out of screen (negative x or y) case.
+ cb->setScissor(QRhiScissor(d.scissorBottomLeft.x(), d.scissorBottomLeft.y(),
+ d.scissorSize.width(), d.scissorSize.height()));
+
+ cb->setShaderResources();
+
+ const QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(36);
+ cb->endPass();
+
+ advanceScissor();
+}
diff --git a/tests/manual/rhi/cubemap_scissor/cubemap_scissor.pro b/tests/manual/rhi/cubemap_scissor/cubemap_scissor.pro
new file mode 100644
index 0000000000..1f02bda87a
--- /dev/null
+++ b/tests/manual/rhi/cubemap_scissor/cubemap_scissor.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ cubemap_scissor.cpp
+
+RESOURCES = cubemap_scissor.qrc
diff --git a/tests/manual/rhi/cubemap_scissor/cubemap_scissor.qrc b/tests/manual/rhi/cubemap_scissor/cubemap_scissor.qrc
new file mode 100644
index 0000000000..8a0ae17dc8
--- /dev/null
+++ b/tests/manual/rhi/cubemap_scissor/cubemap_scissor.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="cubemap.vert.qsb">../cubemap/cubemap.vert.qsb</file>
+ <file alias="cubemap.frag.qsb">../cubemap/cubemap.frag.qsb</file>
+ <file alias="c.png">../cubemap/c.png</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/floattexture/floattexture.cpp b/tests/manual/rhi/floattexture/floattexture.cpp
new file mode 100644
index 0000000000..0d24860c78
--- /dev/null
+++ b/tests/manual/rhi/floattexture/floattexture.cpp
@@ -0,0 +1,328 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include <qmath.h>
+
+QByteArray loadHdr(const QString &fn, QSize *size)
+{
+ QFile f(fn);
+ if (!f.open(QIODevice::ReadOnly)) {
+ qWarning("Failed to open %s", qPrintable(fn));
+ return QByteArray();
+ }
+
+ char sig[256];
+ f.read(sig, 11);
+ if (strncmp(sig, "#?RADIANCE\n", 11))
+ return QByteArray();
+
+ QByteArray buf = f.readAll();
+ const char *p = buf.constData();
+ const char *pEnd = p + buf.size();
+
+ // Process lines until the empty one.
+ QByteArray line;
+ while (p < pEnd) {
+ char c = *p++;
+ if (c == '\n') {
+ if (line.isEmpty())
+ break;
+ if (line.startsWith(QByteArrayLiteral("FORMAT="))) {
+ const QByteArray format = line.mid(7).trimmed();
+ if (format != QByteArrayLiteral("32-bit_rle_rgbe")) {
+ qWarning("HDR format '%s' is not supported", format.constData());
+ return QByteArray();
+ }
+ }
+ line.clear();
+ } else {
+ line.append(c);
+ }
+ }
+ if (p == pEnd) {
+ qWarning("Malformed HDR image data at property strings");
+ return QByteArray();
+ }
+
+ // Get the resolution string.
+ while (p < pEnd) {
+ char c = *p++;
+ if (c == '\n')
+ break;
+ line.append(c);
+ }
+ if (p == pEnd) {
+ qWarning("Malformed HDR image data at resolution string");
+ return QByteArray();
+ }
+
+ int w = 0, h = 0;
+ // We only care about the standard orientation.
+ if (!sscanf(line.constData(), "-Y %d +X %d", &h, &w)) {
+ qWarning("Unsupported HDR resolution string '%s'", line.constData());
+ return QByteArray();
+ }
+ if (w <= 0 || h <= 0) {
+ qWarning("Invalid HDR resolution");
+ return QByteArray();
+ }
+
+ // output is RGBA32F
+ const int blockSize = 4 * sizeof(float);
+ QByteArray data;
+ data.resize(w * h * blockSize);
+
+ typedef unsigned char RGBE[4];
+ RGBE *scanline = new RGBE[w];
+
+ for (int y = 0; y < h; ++y) {
+ if (pEnd - p < 4) {
+ qWarning("Unexpected end of HDR data");
+ delete[] scanline;
+ return QByteArray();
+ }
+
+ scanline[0][0] = *p++;
+ scanline[0][1] = *p++;
+ scanline[0][2] = *p++;
+ scanline[0][3] = *p++;
+
+ if (scanline[0][0] == 2 && scanline[0][1] == 2 && scanline[0][2] < 128) {
+ // new rle, the first pixel was a dummy
+ for (int channel = 0; channel < 4; ++channel) {
+ for (int x = 0; x < w && p < pEnd; ) {
+ unsigned char c = *p++;
+ if (c > 128) { // run
+ if (p < pEnd) {
+ int repCount = c & 127;
+ c = *p++;
+ while (repCount--)
+ scanline[x++][channel] = c;
+ }
+ } else { // not a run
+ while (c-- && p < pEnd)
+ scanline[x++][channel] = *p++;
+ }
+ }
+ }
+ } else {
+ // old rle
+ scanline[0][0] = 2;
+ int bitshift = 0;
+ int x = 1;
+ while (x < w && pEnd - p >= 4) {
+ scanline[x][0] = *p++;
+ scanline[x][1] = *p++;
+ scanline[x][2] = *p++;
+ scanline[x][3] = *p++;
+
+ if (scanline[x][0] == 1 && scanline[x][1] == 1 && scanline[x][2] == 1) { // run
+ int repCount = scanline[x][3] << bitshift;
+ while (repCount--) {
+ memcpy(scanline[x], scanline[x - 1], 4);
+ ++x;
+ }
+ bitshift += 8;
+ } else { // not a run
+ ++x;
+ bitshift = 0;
+ }
+ }
+ }
+
+ // adjust for -Y orientation
+ float *fp = reinterpret_cast<float *>(data.data() + (h - 1 - y) * blockSize * w);
+ for (int x = 0; x < w; ++x) {
+ float d = qPow(2.0f, float(scanline[x][3]) - 128.0f);
+ // r, g, b, a
+ *fp++ = scanline[x][0] / 256.0f * d;
+ *fp++ = scanline[x][1] / 256.0f * d;
+ *fp++ = scanline[x][2] / 256.0f * d;
+ *fp++ = 1.0f;
+ }
+ }
+
+ delete[] scanline;
+
+ if (size)
+ *size = QSize(w, h);
+
+ return data;
+}
+
+static float vertexData[] =
+{ // Y up, CCW
+ -0.5f, 0.5f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 1.0f, 1.0f,
+ 0.5f, 0.5f, 1.0f, 0.0f
+};
+
+static quint16 indexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ibuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ QMatrix4x4 winProj;
+} d;
+
+void Window::customInit()
+{
+ if (!m_r->isTextureFormatSupported(QRhiTexture::RGBA32F))
+ qWarning("RGBA32F texture format is not supported");
+
+ QSize size;
+ QByteArray floatData = loadHdr(QLatin1String(":/OpenfootageNET_fieldairport-512.hdr"), &size);
+ Q_ASSERT(!floatData.isEmpty());
+ qDebug() << size;
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(indexData));
+ d.ibuf->build();
+ d.releasePool << d.ibuf;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ d.tex = m_r->newTexture(QRhiTexture::RGBA32F, size);
+ d.releasePool << d.tex;
+ d.tex->build();
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 4 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+ d.ps->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, vertexData);
+ d.initialUpdates->uploadStaticBuffer(d.ibuf, indexData);
+
+ qint32 flip = 1;
+ d.initialUpdates->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+
+ QRhiTextureUploadDescription desc({ 0, 0, { floatData.constData(), floatData.size() } });
+ d.initialUpdates->uploadTexture(d.tex, desc);
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ if (d.winProj != m_proj) {
+ d.winProj = m_proj;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(2.5f);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ }
+
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding, d.ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ cb->drawIndexed(6);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/floattexture/floattexture.pro b/tests/manual/rhi/floattexture/floattexture.pro
new file mode 100644
index 0000000000..e566da2b94
--- /dev/null
+++ b/tests/manual/rhi/floattexture/floattexture.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ floattexture.cpp
+
+RESOURCES = floattexture.qrc
diff --git a/tests/manual/rhi/floattexture/floattexture.qrc b/tests/manual/rhi/floattexture/floattexture.qrc
new file mode 100644
index 0000000000..fefb56b910
--- /dev/null
+++ b/tests/manual/rhi/floattexture/floattexture.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+ <file alias="OpenfootageNET_fieldairport-512.hdr">../shared/OpenfootageNET_fieldairport-512.hdr</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp b/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
new file mode 100644
index 0000000000..ea1fefc308
--- /dev/null
+++ b/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
@@ -0,0 +1,550 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+// This is a compact, minimal, single-file demo of deciding the backend at
+// runtime while using the exact same shaders and rendering code without any
+// branching whatsoever once the QWindow is up and the RHI is initialized.
+
+#include <QGuiApplication>
+#include <QCommandLineParser>
+#include <QWindow>
+#include <QPlatformSurfaceEvent>
+#include <QElapsedTimer>
+
+#include <QtGui/private/qshader_p.h>
+#include <QFile>
+
+#include <QtGui/private/qrhinull_p.h>
+
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qrhigles2_p.h>
+#include <QOffscreenSurface>
+#endif
+
+#if QT_CONFIG(vulkan)
+#include <QLoggingCategory>
+#include <QtGui/private/qrhivulkan_p.h>
+#endif
+
+#ifdef Q_OS_WIN
+#include <QtGui/private/qrhid3d11_p.h>
+#endif
+
+#ifdef Q_OS_DARWIN
+#include <QtGui/private/qrhimetal_p.h>
+#endif
+
+static float vertexData[] = {
+ // Y up (note clipSpaceCorrMatrix in m_proj), CCW
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
+};
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+enum GraphicsApi
+{
+ OpenGL,
+ Vulkan,
+ D3D11,
+ Metal,
+ Null
+};
+
+static GraphicsApi graphicsApi;
+
+static QString graphicsApiName()
+{
+ switch (graphicsApi) {
+ case OpenGL:
+ return QLatin1String("OpenGL 2.x");
+ case Vulkan:
+ return QLatin1String("Vulkan");
+ case D3D11:
+ return QLatin1String("Direct3D 11");
+ case Metal:
+ return QLatin1String("Metal");
+ case Null:
+ return QLatin1String("Null");
+ default:
+ break;
+ }
+ return QString();
+}
+
+class Window : public QWindow
+{
+public:
+ Window();
+ ~Window();
+
+ void init();
+ void releaseResources();
+ void resizeSwapChain();
+ void releaseSwapChain();
+ void render();
+
+ void exposeEvent(QExposeEvent *) override;
+ bool event(QEvent *) override;
+
+private:
+ bool m_running = false;
+ bool m_notExposed = false;
+ bool m_newlyExposed = false;
+
+ QRhi *m_r = nullptr;
+ bool m_hasSwapChain = false;
+ QRhiSwapChain *m_sc = nullptr;
+ QRhiRenderBuffer *m_ds = nullptr;
+ QRhiRenderPassDescriptor *m_rp = nullptr;
+ QRhiBuffer *m_vbuf = nullptr;
+ bool m_vbufReady = false;
+ QRhiBuffer *m_ubuf = nullptr;
+ QRhiShaderResourceBindings *m_srb = nullptr;
+ QRhiGraphicsPipeline *m_ps = nullptr;
+ QVector<QRhiResource *> releasePool;
+
+ QMatrix4x4 m_proj;
+ float m_rotation = 0;
+ float m_opacity = 1;
+ int m_opacityDir = -1;
+
+ QElapsedTimer m_timer;
+ qint64 m_elapsedMs;
+ int m_elapsedCount;
+
+#ifndef QT_NO_OPENGL
+ QOffscreenSurface *m_fallbackSurface = nullptr;
+#endif
+};
+
+Window::Window()
+{
+ // Tell the platform plugin what we want.
+ switch (graphicsApi) {
+ case OpenGL:
+#if QT_CONFIG(opengl)
+ setSurfaceType(OpenGLSurface);
+ setFormat(QRhiGles2InitParams::adjustedFormat());
+#endif
+ break;
+ case Vulkan:
+ setSurfaceType(VulkanSurface);
+ break;
+ case D3D11:
+ setSurfaceType(OpenGLSurface); // not a typo
+ break;
+ case Metal:
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ setSurfaceType(MetalSurface);
+#endif
+ break;
+ default:
+ break;
+ }
+}
+
+Window::~Window()
+{
+ releaseResources();
+}
+
+void Window::exposeEvent(QExposeEvent *)
+{
+ // initialize and start rendering when the window becomes usable for graphics purposes
+ if (isExposed() && !m_running) {
+ m_running = true;
+ init();
+ resizeSwapChain();
+ }
+
+ // stop pushing frames when not exposed (or size is 0)
+ if ((!isExposed() || (m_hasSwapChain && m_sc->surfacePixelSize().isEmpty())) && m_running)
+ m_notExposed = true;
+
+ // continue when exposed again and the surface has a valid size.
+ // note that the surface size can be (0, 0) even though size() reports a valid one...
+ if (isExposed() && m_running && m_notExposed && !m_sc->surfacePixelSize().isEmpty()) {
+ m_notExposed = false;
+ m_newlyExposed = true;
+ }
+
+ // always render a frame on exposeEvent() (when exposed) in order to update
+ // immediately on window resize.
+ if (isExposed() && !m_sc->surfacePixelSize().isEmpty())
+ render();
+}
+
+bool Window::event(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::UpdateRequest:
+ render();
+ break;
+
+ case QEvent::PlatformSurface:
+ // this is the proper time to tear down the swapchain (while the native window and surface are still around)
+ if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
+ releaseSwapChain();
+ break;
+
+ default:
+ break;
+ }
+
+ return QWindow::event(e);
+}
+
+void Window::init()
+{
+ if (graphicsApi == Null) {
+ QRhiNullInitParams params;
+ m_r = QRhi::create(QRhi::Null, &params);
+ }
+
+#ifndef QT_NO_OPENGL
+ if (graphicsApi == OpenGL) {
+ m_fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
+ QRhiGles2InitParams params;
+ params.fallbackSurface = m_fallbackSurface;
+ params.window = this;
+ m_r = QRhi::create(QRhi::OpenGLES2, &params);
+ }
+#endif
+
+#if QT_CONFIG(vulkan)
+ if (graphicsApi == Vulkan) {
+ QRhiVulkanInitParams params;
+ params.inst = vulkanInstance();
+ params.window = this;
+ m_r = QRhi::create(QRhi::Vulkan, &params);
+ }
+#endif
+
+#ifdef Q_OS_WIN
+ if (graphicsApi == D3D11) {
+ QRhiD3D11InitParams params;
+ m_r = QRhi::create(QRhi::D3D11, &params);
+ }
+#endif
+
+#ifdef Q_OS_DARWIN
+ if (graphicsApi == Metal) {
+ QRhiMetalInitParams params;
+ m_r = QRhi::create(QRhi::Metal, &params);
+ }
+#endif
+
+ if (!m_r)
+ qFatal("Failed to create RHI backend");
+
+ // now onto the backend-independent init
+
+ m_sc = m_r->newSwapChain();
+ // allow depth-stencil, although we do not actually enable depth test/write for the triangle
+ m_ds = m_r->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
+ QSize(), // no need to set the size here, due to UsedWithSwapChainOnly
+ 1,
+ QRhiRenderBuffer::UsedWithSwapChainOnly);
+ releasePool << m_ds;
+ m_sc->setWindow(this);
+ m_sc->setDepthStencil(m_ds);
+ m_rp = m_sc->newCompatibleRenderPassDescriptor();
+ releasePool << m_rp;
+ m_sc->setRenderPassDescriptor(m_rp);
+
+ m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+ releasePool << m_vbuf;
+ m_vbuf->build();
+ m_vbufReady = false;
+
+ m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ releasePool << m_ubuf;
+ m_ubuf->build();
+
+ m_srb = m_r->newShaderResourceBindings();
+ releasePool << m_srb;
+ m_srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf)
+ });
+ m_srb->build();
+
+ m_ps = m_r->newGraphicsPipeline();
+ releasePool << m_ps;
+
+ QRhiGraphicsPipeline::TargetBlend premulAlphaBlend;
+ premulAlphaBlend.enable = true;
+ m_ps->setTargetBlends({ premulAlphaBlend });
+
+ const QShader vs = getShader(QLatin1String(":/color.vert.qsb"));
+ if (!vs.isValid())
+ qFatal("Failed to load shader pack (vertex)");
+ const QShader fs = getShader(QLatin1String(":/color.frag.qsb"));
+ if (!fs.isValid())
+ qFatal("Failed to load shader pack (fragment)");
+
+ m_ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+
+ m_ps->setVertexInputLayout(inputLayout);
+ m_ps->setShaderResourceBindings(m_srb);
+ m_ps->setRenderPassDescriptor(m_rp);
+
+ m_ps->build();
+}
+
+void Window::releaseResources()
+{
+ qDeleteAll(releasePool);
+ releasePool.clear();
+
+ delete m_sc; // native swapchain is likely released already
+ m_sc = nullptr;
+
+ delete m_r;
+
+#ifndef QT_NO_OPENGL
+ delete m_fallbackSurface;
+#endif
+}
+
+void Window::resizeSwapChain()
+{
+ m_hasSwapChain = m_sc->buildOrResize(); // also handles m_ds
+
+ m_elapsedMs = 0;
+ m_elapsedCount = 0;
+
+ const QSize outputSize = m_sc->currentPixelSize();
+ m_proj = m_r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, outputSize.width() / (float) outputSize.height(), 0.01f, 100.0f);
+ m_proj.translate(0, 0, -4);
+}
+
+void Window::releaseSwapChain()
+{
+ if (m_hasSwapChain) {
+ m_hasSwapChain = false;
+ m_sc->release();
+ }
+}
+
+void Window::render()
+{
+ if (!m_hasSwapChain || m_notExposed)
+ return;
+
+ // If the window got resized or got newly exposed, resize the swapchain.
+ // (the newly-exposed case is not actually required by some
+ // platforms/backends, but f.ex. Vulkan on Windows seems to need it)
+ if (m_sc->currentPixelSize() != m_sc->surfacePixelSize() || m_newlyExposed) {
+ resizeSwapChain();
+ if (!m_hasSwapChain)
+ return;
+ m_newlyExposed = false;
+ }
+
+ // Start a new frame. This is where we block when too far ahead of
+ // GPU/present, and that's what throttles the thread to the refresh rate.
+ // (except for OpenGL where it happens either in endFrame or somewhere else
+ // depending on the GL implementation)
+ QRhi::FrameOpResult r = m_r->beginFrame(m_sc);
+ if (r == QRhi::FrameOpSwapChainOutOfDate) {
+ resizeSwapChain();
+ if (!m_hasSwapChain)
+ return;
+ r = m_r->beginFrame(m_sc);
+ }
+ if (r != QRhi::FrameOpSuccess) {
+ requestUpdate();
+ return;
+ }
+
+ if (m_elapsedCount)
+ m_elapsedMs += m_timer.elapsed();
+ m_timer.restart();
+ m_elapsedCount += 1;
+ if (m_elapsedMs >= 4000) {
+ qDebug("%f", m_elapsedCount / 4.0f);
+ m_elapsedMs = 0;
+ m_elapsedCount = 0;
+ }
+
+ // Set up buffer updates.
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (!m_vbufReady) {
+ m_vbufReady = true;
+ u->uploadStaticBuffer(m_vbuf, vertexData);
+ }
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.rotate(m_rotation, 0, 1, 0);
+ u->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
+ m_opacity += m_opacityDir * 0.005f;
+ if (m_opacity < 0.0f || m_opacity > 1.0f) {
+ m_opacityDir *= -1;
+ m_opacity = qBound(0.0f, m_opacity, 1.0f);
+ }
+ u->updateDynamicBuffer(m_ubuf, 64, 4, &m_opacity);
+
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+
+ // Apply buffer updates, clear, start the renderpass (where applicable).
+ cb->beginPass(m_sc->currentFrameRenderTarget(), QColor::fromRgbF(0.4f, 0.7f, 0.0f, 1.0f), { 1.0f, 0 }, u);
+
+ cb->setGraphicsPipeline(m_ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+
+ const QRhiCommandBuffer::VertexInput vbufBinding(m_vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+
+ cb->endPass();
+
+ // Submit.
+ m_r->endFrame(m_sc);
+
+ requestUpdate(); // render continuously, throttled by the presentation rate (due to beginFrame above)
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QGuiApplication app(argc, argv);
+
+ // Defaults.
+#if defined(Q_OS_WIN)
+ graphicsApi = D3D11;
+#elif defined(Q_OS_DARWIN)
+ graphicsApi = Metal;
+#elif QT_CONFIG(vulkan)
+ graphicsApi = Vulkan;
+#else
+ graphicsApi = OpenGL;
+#endif
+
+ // Allow overriding via the command line.
+ QCommandLineParser cmdLineParser;
+ cmdLineParser.addHelpOption();
+ QCommandLineOption glOption({ "g", "opengl" }, QLatin1String("OpenGL (2.x)"));
+ cmdLineParser.addOption(glOption);
+ QCommandLineOption vkOption({ "v", "vulkan" }, QLatin1String("Vulkan"));
+ cmdLineParser.addOption(vkOption);
+ QCommandLineOption d3dOption({ "d", "d3d11" }, QLatin1String("Direct3D 11"));
+ cmdLineParser.addOption(d3dOption);
+ QCommandLineOption mtlOption({ "m", "metal" }, QLatin1String("Metal"));
+ cmdLineParser.addOption(mtlOption);
+ QCommandLineOption nullOption({ "n", "null" }, QLatin1String("Null"));
+ cmdLineParser.addOption(nullOption);
+ cmdLineParser.process(app);
+ if (cmdLineParser.isSet(glOption))
+ graphicsApi = OpenGL;
+ if (cmdLineParser.isSet(vkOption))
+ graphicsApi = Vulkan;
+ if (cmdLineParser.isSet(d3dOption))
+ graphicsApi = D3D11;
+ if (cmdLineParser.isSet(mtlOption))
+ graphicsApi = Metal;
+ if (cmdLineParser.isSet(nullOption))
+ graphicsApi = Null;
+
+ // Vulkan setup.
+#if QT_CONFIG(vulkan)
+ QVulkanInstance inst;
+ if (graphicsApi == Vulkan) {
+ if (!inst.create()) {
+ qWarning("Failed to create Vulkan instance, switching to OpenGL");
+ graphicsApi = OpenGL;
+ }
+ }
+#endif
+
+ // Create and show the window.
+ Window w;
+#if QT_CONFIG(vulkan)
+ if (graphicsApi == Vulkan)
+ w.setVulkanInstance(&inst);
+#endif
+ w.resize(1280, 720);
+ w.setTitle(graphicsApiName());
+ w.show();
+
+ // Window::event() will not get invoked when the
+ // PlatformSurfaceAboutToBeDestroyed event is sent during the QWindow
+ // destruction. That happens only when exiting via app::quit() instead of
+ // the more common QWindow::close(). Take care of it: if the
+ // QPlatformWindow is still around (there was no close() yet), get rid of
+ // the swapchain while it's not too late.
+ if (w.handle())
+ w.releaseSwapChain();
+
+ return app.exec();
+}
diff --git a/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.pro b/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.pro
new file mode 100644
index 0000000000..eeef33ff6a
--- /dev/null
+++ b/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ hellominimalcrossgfxtriangle.cpp
+
+RESOURCES = hellominimalcrossgfxtriangle.qrc
diff --git a/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.qrc b/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.qrc
new file mode 100644
index 0000000000..8cec4fa9ec
--- /dev/null
+++ b/tests/manual/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="color.vert.qsb">../shared/color.vert.qsb</file>
+ <file alias="color.frag.qsb">../shared/color.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/instancing/buildshaders.bat b/tests/manual/rhi/instancing/buildshaders.bat
new file mode 100644
index 0000000000..9053a1c54a
--- /dev/null
+++ b/tests/manual/rhi/instancing/buildshaders.bat
@@ -0,0 +1,2 @@
+qsb --glsl "330,300 es" --hlsl 50 --msl 12 inst.vert -o inst.vert.qsb
+qsb --glsl "330,300 es" --hlsl 50 --msl 12 inst.frag -o inst.frag.qsb
diff --git a/tests/manual/rhi/instancing/inst.frag b/tests/manual/rhi/instancing/inst.frag
new file mode 100644
index 0000000000..719fd79ff5
--- /dev/null
+++ b/tests/manual/rhi/instancing/inst.frag
@@ -0,0 +1,9 @@
+#version 440
+
+layout(location = 0) in vec3 vColor;
+layout(location = 0) out vec4 fragColor;
+
+void main()
+{
+ fragColor = vec4(vColor, 1.0);
+}
diff --git a/tests/manual/rhi/instancing/inst.frag.qsb b/tests/manual/rhi/instancing/inst.frag.qsb
new file mode 100644
index 0000000000..f19a2f0a71
--- /dev/null
+++ b/tests/manual/rhi/instancing/inst.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/instancing/inst.vert b/tests/manual/rhi/instancing/inst.vert
new file mode 100644
index 0000000000..3e1b117d58
--- /dev/null
+++ b/tests/manual/rhi/instancing/inst.vert
@@ -0,0 +1,25 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+
+// Instanced attributes to variate the translation and color of the cube
+layout(location = 1) in vec3 instTranslate;
+layout(location = 2) in vec3 instColor;
+
+layout(location = 0) out vec3 vColor;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+} ubuf;
+
+void main()
+{
+ vColor = instColor;
+ mat4 t = mat4(1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ instTranslate.x, instTranslate.y, instTranslate.z, 1);
+ gl_Position = ubuf.mvp * t * position;
+}
diff --git a/tests/manual/rhi/instancing/inst.vert.qsb b/tests/manual/rhi/instancing/inst.vert.qsb
new file mode 100644
index 0000000000..de05eae80f
--- /dev/null
+++ b/tests/manual/rhi/instancing/inst.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/instancing/instancing.cpp b/tests/manual/rhi/instancing/instancing.cpp
new file mode 100644
index 0000000000..bdafbd81bc
--- /dev/null
+++ b/tests/manual/rhi/instancing/instancing.cpp
@@ -0,0 +1,175 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include "../shared/cube.h"
+#include <QRandomGenerator>
+
+// Instanced draw example. When running with OpenGL, at least 3.3 or ES 3.0 is
+// needed.
+
+const int INSTANCE_COUNT = 1024;
+
+struct {
+ QVector<QRhiResource *> releasePool;
+
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *instBuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ QMatrix4x4 winProj;
+} d;
+
+void Window::customInit()
+{
+ if (!m_r->isFeatureSupported(QRhi::Instancing))
+ qFatal("Instanced drawing is not supported");
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, cube);
+
+ // translation + color (vec3 + vec3), interleaved, for each instance
+ d.instBuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, INSTANCE_COUNT * 6 * sizeof(float));
+ d.instBuf->build();
+ d.releasePool << d.instBuf;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 12);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage, d.ubuf)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/inst.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/inst.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) }, // cube vertices
+ { 6 * sizeof(float), QRhiVertexInputBinding::PerInstance } // per-instance translation and color
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 }, // position
+ { 1, 1, QRhiVertexInputAttribute::Float3, 0 }, // instTranslate
+ { 1, 2, QRhiVertexInputAttribute::Float3, 3 * sizeof(float) } // instColor
+ });
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+ d.ps->build();
+
+ QByteArray instData;
+ instData.resize(INSTANCE_COUNT * 6 * sizeof(float));
+ float *p = reinterpret_cast<float *>(instData.data());
+ QRandomGenerator *rgen = QRandomGenerator::global();
+ for (int i = 0; i < INSTANCE_COUNT; ++i) {
+ // translation
+ *p++ = rgen->bounded(8000) / 100.0f - 40.0f;
+ *p++ = rgen->bounded(8000) / 100.0f - 40.0f;
+ *p++ = 0.0f;
+ // color
+ *p++ = i / float(INSTANCE_COUNT);
+ *p++ = 0.0f;
+ *p++ = 0.0f;
+ }
+ d.initialUpdates->uploadStaticBuffer(d.instBuf, instData.constData());
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ if (d.winProj != m_proj) {
+ d.winProj = m_proj;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(0.05f);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ }
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBinding[] = {
+ { d.vbuf, 0 },
+ { d.instBuf, 0 }
+ };
+ cb->setVertexInput(0, 2, vbufBinding);
+ cb->draw(36, INSTANCE_COUNT);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/instancing/instancing.pro b/tests/manual/rhi/instancing/instancing.pro
new file mode 100644
index 0000000000..416c79f28a
--- /dev/null
+++ b/tests/manual/rhi/instancing/instancing.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ instancing.cpp
+
+RESOURCES = instancing.qrc
diff --git a/tests/manual/rhi/instancing/instancing.qrc b/tests/manual/rhi/instancing/instancing.qrc
new file mode 100644
index 0000000000..db21a9d8aa
--- /dev/null
+++ b/tests/manual/rhi/instancing/instancing.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>inst.vert.qsb</file>
+ <file>inst.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/mrt/buildshaders.bat b/tests/manual/rhi/mrt/buildshaders.bat
new file mode 100644
index 0000000000..75741448b1
--- /dev/null
+++ b/tests/manual/rhi/mrt/buildshaders.bat
@@ -0,0 +1,2 @@
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c mrt.vert -o mrt.vert.qsb
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c mrt.frag -o mrt.frag.qsb
diff --git a/tests/manual/rhi/mrt/mrt.cpp b/tests/manual/rhi/mrt/mrt.cpp
new file mode 100644
index 0000000000..dfec5bb1d1
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.cpp
@@ -0,0 +1,294 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+
+// Exercises MRT, by attaching 4 textures to a single QRhiTextureRenderTarget.
+// The fragment shader outputs to all four targets.
+// The textures are then used to render 4 quads, so their contents can be confirmed.
+
+const int ATTCOUNT = 4;
+
+static float quadVertexData[] =
+{ // Y up, CCW
+ -0.5f, 0.5f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 1.0f, 1.0f,
+ 0.5f, 0.5f, 1.0f, 0.0f
+};
+
+static quint16 quadIndexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+static float triangleData[] =
+{ // Y up, CCW
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
+};
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ibuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTextureRenderTarget *rt = nullptr;
+ QRhiRenderPassDescriptor *rtRp = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ QMatrix4x4 winProj;
+ struct PerColorBuffer {
+ QRhiTexture *tex = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ };
+ PerColorBuffer colData[ATTCOUNT];
+
+ QRhiBuffer *triUbuf = nullptr;
+ QRhiShaderResourceBindings *triSrb = nullptr;
+ QRhiGraphicsPipeline *triPs = nullptr;
+ float triRot = 0;
+ QMatrix4x4 triBaseMvp;
+} d;
+
+void Window::customInit()
+{
+ qDebug("Max color attachments: %d", m_r->resourceLimit(QRhi::MaxColorAttachments));
+ if (m_r->resourceLimit(QRhi::MaxColorAttachments) < 4)
+ qWarning("MRT is not supported");
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(quadVertexData) + sizeof(triangleData));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(quadIndexData));
+ d.ibuf->build();
+ d.releasePool << d.ibuf;
+
+ const int oneRoundedUniformBlockSize = m_r->ubufAligned(68);
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, oneRoundedUniformBlockSize * ATTCOUNT);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ for (int i = 0; i < ATTCOUNT; ++i) {
+ QRhiTexture *tex = m_r->newTexture(QRhiTexture::RGBA8, QSize(512, 512), 1, QRhiTexture::RenderTarget);
+ d.releasePool << tex;
+ tex->build();
+
+ QRhiShaderResourceBindings *srb = m_r->newShaderResourceBindings();
+ d.releasePool << srb;
+ srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage,
+ d.ubuf, i * oneRoundedUniformBlockSize, 68),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, tex, d.sampler)
+ });
+ srb->build();
+
+ d.colData[i].tex = tex;
+ d.colData[i].srb = srb;
+ }
+
+ QRhiTextureRenderTargetDescription rtDesc;
+ QRhiColorAttachment att[ATTCOUNT];
+ for (int i = 0; i < ATTCOUNT; ++i)
+ att[i] = QRhiColorAttachment(d.colData[i].tex);
+ rtDesc.setColorAttachments(att, att + ATTCOUNT);
+ d.rt = m_r->newTextureRenderTarget(rtDesc);
+ d.releasePool << d.rt;
+ d.rtRp = d.rt->newCompatibleRenderPassDescriptor();
+ d.releasePool << d.rtRp;
+ d.rt->setRenderPassDescriptor(d.rtRp);
+ d.rt->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 4 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.colData[0].srb); // all of them are layout-compatible
+ d.ps->setRenderPassDescriptor(m_rp);
+ d.ps->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, 0, sizeof(quadVertexData), quadVertexData);
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, sizeof(quadVertexData), sizeof(triangleData), triangleData);
+ d.initialUpdates->uploadStaticBuffer(d.ibuf, quadIndexData);
+
+ qint32 flip = m_r->isYUpInFramebuffer() ? 1 : 0;
+ for (int i = 0; i < ATTCOUNT; ++i)
+ d.initialUpdates->updateDynamicBuffer(d.ubuf, i * oneRoundedUniformBlockSize + 64, 4, &flip);
+
+ // triangle
+ d.triUbuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.releasePool << d.triUbuf;
+ d.triUbuf->build();
+
+ d.triSrb = m_r->newShaderResourceBindings();
+ d.releasePool << d.triSrb;
+ d.triSrb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.triUbuf)
+ });
+ d.triSrb->build();
+
+ d.triPs = m_r->newGraphicsPipeline();
+ d.releasePool << d.triPs;
+ d.triPs->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/mrt.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/mrt.frag.qsb")) }
+ });
+
+ QRhiGraphicsPipeline::TargetBlend blends[ATTCOUNT]; // defaults to blending == false
+ d.triPs->setTargetBlends(blends, blends + ATTCOUNT);
+
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+ d.triPs->setVertexInputLayout(inputLayout);
+ d.triPs->setShaderResourceBindings(d.triSrb);
+ d.triPs->setRenderPassDescriptor(d.rtRp);
+ d.triPs->build();
+
+ d.triBaseMvp = m_r->clipSpaceCorrMatrix();
+ d.triBaseMvp.perspective(45.0f, d.rt->pixelSize().width() / float(d.rt->pixelSize().height()), 0.01f, 1000.0f);
+ d.triBaseMvp.translate(0, 0, -2);
+ float opacity = 1.0f;
+ d.initialUpdates->updateDynamicBuffer(d.triUbuf, 64, 4, &opacity);
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ QMatrix4x4 triMvp = d.triBaseMvp;
+ triMvp.rotate(d.triRot, 0, 1, 0);
+ d.triRot += 1;
+ u->updateDynamicBuffer(d.triUbuf, 0, 64, triMvp.constData());
+
+ cb->beginPass(d.rt, QColor::fromRgbF(0.5f, 0.2f, 0.0f, 1.0f), { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.triPs);
+ cb->setViewport({ 0, 0, float(d.rt->pixelSize().width()), float(d.rt->pixelSize().height()) });
+ cb->setShaderResources();
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, sizeof(quadVertexData));
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+ cb->endPass();
+
+ u = m_r->nextResourceUpdateBatch();
+ if (d.winProj != m_proj) {
+ d.winProj = m_proj;
+ const int oneRoundedUniformBlockSize = m_r->ubufAligned(68);
+ for (int i = 0; i < ATTCOUNT; ++i) {
+ QMatrix4x4 mvp = m_proj;
+ switch (i) {
+ case 0:
+ mvp.translate(-2.0f, 0, 0);
+ break;
+ case 1:
+ mvp.translate(-0.8f, 0, 0);
+ break;
+ case 2:
+ mvp.translate(0.4f, 0, 0);
+ break;
+ case 3:
+ mvp.translate(1.6f, 0, 0);
+ break;
+ default:
+ Q_UNREACHABLE();
+ break;
+ }
+ u->updateDynamicBuffer(d.ubuf, i * oneRoundedUniformBlockSize, 64, mvp.constData());
+ }
+ }
+
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ vbufBinding.second = 0;
+ cb->setVertexInput(0, 1, &vbufBinding, d.ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ for (int i = 0; i < ATTCOUNT; ++i) {
+ cb->setShaderResources(d.colData[i].srb);
+ cb->drawIndexed(6);
+ }
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/mrt/mrt.frag b/tests/manual/rhi/mrt/mrt.frag
new file mode 100644
index 0000000000..9166b552b9
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.frag
@@ -0,0 +1,22 @@
+#version 440
+
+layout(location = 0) in vec3 v_color;
+
+layout(location = 0) out vec4 c0;
+layout(location = 1) out vec4 c1;
+layout(location = 2) out vec4 c2;
+layout(location = 3) out vec4 c3;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ float opacity;
+} ubuf;
+
+void main()
+{
+ vec4 c = vec4(v_color * ubuf.opacity, ubuf.opacity);
+ c0 = vec4(c.r, 0, 0, c.a);
+ c1 = vec4(0, c.g, 0, c.a);
+ c2 = vec4(0, 0, c.b, c.a);
+ c3 = c;
+}
diff --git a/tests/manual/rhi/mrt/mrt.frag.qsb b/tests/manual/rhi/mrt/mrt.frag.qsb
new file mode 100644
index 0000000000..389b6affa3
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/mrt/mrt.pro b/tests/manual/rhi/mrt/mrt.pro
new file mode 100644
index 0000000000..7cde425488
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ mrt.cpp
+
+RESOURCES = mrt.qrc
diff --git a/tests/manual/rhi/mrt/mrt.qrc b/tests/manual/rhi/mrt/mrt.qrc
new file mode 100644
index 0000000000..275f476013
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>mrt.vert.qsb</file>
+ <file>mrt.frag.qsb</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/mrt/mrt.vert b/tests/manual/rhi/mrt/mrt.vert
new file mode 100644
index 0000000000..43af543f44
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.vert
@@ -0,0 +1,19 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 1) in vec3 color;
+
+layout(location = 0) out vec3 v_color;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ float opacity;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ v_color = color;
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/manual/rhi/mrt/mrt.vert.qsb b/tests/manual/rhi/mrt/mrt.vert.qsb
new file mode 100644
index 0000000000..ff8c0e50bb
--- /dev/null
+++ b/tests/manual/rhi/mrt/mrt.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp
new file mode 100644
index 0000000000..27dabb2276
--- /dev/null
+++ b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp
@@ -0,0 +1,259 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+
+// Uses a multisample renderbuffer (whatever that may be on a given backend) to
+// render to and then resolves the samples into a non-multisample texture.
+
+static float vertexData[] =
+{ // Y up, CCW
+ -0.5f, 0.5f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 1.0f, 1.0f,
+ 0.5f, 0.5f, 1.0f, 0.0f
+};
+
+static quint16 indexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+static float triangleData[] =
+{ // Y up, CCW
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
+};
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ibuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiRenderBuffer *rb = nullptr;
+ QRhiTextureRenderTarget *rt = nullptr;
+ QRhiRenderPassDescriptor *rtRp = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiBuffer *triUbuf = nullptr;
+ QRhiShaderResourceBindings *triSrb = nullptr;
+ QRhiGraphicsPipeline *triPs = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ QMatrix4x4 triBaseMvp;
+ float triRot = 0;
+ QMatrix4x4 winProj;
+} d;
+
+void Window::customInit()
+{
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData) + sizeof(triangleData));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(indexData));
+ d.ibuf->build();
+ d.releasePool << d.ibuf;
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ d.rb = m_r->newRenderBuffer(QRhiRenderBuffer::Color, QSize(512, 512), 4); // 4x MSAA
+ d.rb->build();
+ d.releasePool << d.rb;
+
+ // the non-msaa texture that will be the destination in the resolve
+ d.tex = m_r->newTexture(QRhiTexture::RGBA8, d.rb->pixelSize(), 1, QRhiTexture::RenderTarget);
+ d.releasePool << d.tex;
+ d.tex->build();
+
+ // rb is multisample, instead of writing out the msaa data into it,
+ // resolve into d.tex at the end of each render pass
+ QRhiTextureRenderTargetDescription rtDesc;
+ QRhiColorAttachment rtAtt(d.rb);
+ rtAtt.setResolveTexture(d.tex);
+ rtDesc.setColorAttachments({ rtAtt });
+
+ d.rt = m_r->newTextureRenderTarget(rtDesc);
+ d.releasePool << d.rt;
+ d.rtRp = d.rt->newCompatibleRenderPassDescriptor();
+ d.releasePool << d.rtRp;
+ d.rt->setRenderPassDescriptor(d.rtRp);
+ d.rt->build();
+
+ d.triUbuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.releasePool << d.triUbuf;
+ d.triUbuf->build();
+
+ d.triSrb = m_r->newShaderResourceBindings();
+ d.releasePool << d.triSrb;
+ d.triSrb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.triUbuf)
+ });
+ d.triSrb->build();
+
+ d.triPs = m_r->newGraphicsPipeline();
+ d.releasePool << d.triPs;
+ d.triPs->setSampleCount(4); // must match the render target
+ d.triPs->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/color.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/color.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+ d.triPs->setVertexInputLayout(inputLayout);
+ d.triPs->setShaderResourceBindings(d.triSrb);
+ d.triPs->setRenderPassDescriptor(d.rtRp);
+ d.triPs->build();
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+ });
+ inputLayout.setBindings({
+ { 4 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+ d.ps->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, 0, sizeof(vertexData), vertexData);
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, sizeof(vertexData), sizeof(triangleData), triangleData);
+ d.initialUpdates->uploadStaticBuffer(d.ibuf, indexData);
+
+ d.triBaseMvp = m_r->clipSpaceCorrMatrix();
+ d.triBaseMvp.perspective(45.0f, d.rb->pixelSize().width() / float(d.rb->pixelSize().height()), 0.01f, 1000.0f);
+ d.triBaseMvp.translate(0, 0, -2);
+ float opacity = 1.0f;
+ d.initialUpdates->updateDynamicBuffer(d.triUbuf, 64, 4, &opacity);
+
+ qint32 flip = m_r->isYUpInFramebuffer() ? 1 : 0;
+ d.initialUpdates->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ QMatrix4x4 triMvp = d.triBaseMvp;
+ triMvp.rotate(d.triRot, 0, 1, 0);
+ d.triRot += 1;
+ u->updateDynamicBuffer(d.triUbuf, 0, 64, triMvp.constData());
+
+ if (d.winProj != m_proj) {
+ d.winProj = m_proj;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(2.5f);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ }
+
+ // offscreen (triangle, msaa)
+ cb->beginPass(d.rt, QColor::fromRgbF(0.5f, 0.2f, 0.0f, 1.0f), { 1.0f, 0 }, u);
+ cb->setGraphicsPipeline(d.triPs);
+ cb->setViewport({ 0, 0, float(d.rb->pixelSize().width()), float(d.rb->pixelSize().height()) });
+ cb->setShaderResources();
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, sizeof(vertexData));
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+ cb->endPass();
+
+ // onscreen (quad)
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ vbufBinding.second = 0;
+ cb->setVertexInput(0, 1, &vbufBinding, d.ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ cb->drawIndexed(6);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.pro b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.pro
new file mode 100644
index 0000000000..4b31e39e7d
--- /dev/null
+++ b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ msaarenderbuffer.cpp
+
+RESOURCES = msaarenderbuffer.qrc
diff --git a/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.qrc b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.qrc
new file mode 100644
index 0000000000..c7a2380a42
--- /dev/null
+++ b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="color.vert.qsb">../shared/color.vert.qsb</file>
+ <file alias="color.frag.qsb">../shared/color.frag.qsb</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/msaatexture/msaatexture.cpp b/tests/manual/rhi/msaatexture/msaatexture.cpp
new file mode 100644
index 0000000000..2fb466c8d6
--- /dev/null
+++ b/tests/manual/rhi/msaatexture/msaatexture.cpp
@@ -0,0 +1,329 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+
+// Renders into a non-multisample and a multisample (4x) texture, and then uses
+// those textures to draw two quads. Note that this uses an MSAA sampler in the
+// shader, not resolves. Not supported on the GL(ES) backend atm.
+
+static float vertexData[] =
+{ // Y up, CCW
+ -0.5f, 0.5f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 1.0f, 1.0f,
+ 0.5f, 0.5f, 1.0f, 0.0f
+};
+
+static quint16 indexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+static float triangleData[] =
+{ // Y up, CCW
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
+};
+
+const int UBUFSZ = 68;
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ibuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiTexture *msaaTex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srbLeft = nullptr;
+ QRhiShaderResourceBindings *srbRight = nullptr;
+ QRhiGraphicsPipeline *psLeft = nullptr;
+ QRhiGraphicsPipeline *psRight = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ int rightOfs;
+ QMatrix4x4 winProj;
+ QMatrix4x4 triBaseMvp;
+ float triRot = 0;
+
+ QRhiShaderResourceBindings *triSrb = nullptr;
+ QRhiGraphicsPipeline *msaaTriPs = nullptr;
+ QRhiGraphicsPipeline *triPs = nullptr;
+ QRhiBuffer *triUbuf = nullptr;
+ QRhiTextureRenderTarget *msaaRt = nullptr;
+ QRhiRenderPassDescriptor *msaaRtRp = nullptr;
+ QRhiTextureRenderTarget *rt = nullptr;
+ QRhiRenderPassDescriptor *rtRp = nullptr;
+} d;
+
+//#define NO_MSAA
+
+void Window::customInit()
+{
+ if (!m_r->isFeatureSupported(QRhi::MultisampleTexture))
+ qFatal("Multisample textures not supported by this backend");
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData) + sizeof(triangleData));
+ d.releasePool << d.vbuf;
+ d.vbuf->build();
+
+ d.ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(indexData));
+ d.releasePool << d.ibuf;
+ d.ibuf->build();
+
+ d.rightOfs = m_r->ubufAligned(UBUFSZ);
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, d.rightOfs + UBUFSZ);
+ d.releasePool << d.ubuf;
+ d.ubuf->build();
+
+ d.tex = m_r->newTexture(QRhiTexture::RGBA8, QSize(512, 512), 1, QRhiTexture::RenderTarget);
+ d.releasePool << d.tex;
+ d.tex->build();
+#ifndef NO_MSAA
+ d.msaaTex = m_r->newTexture(QRhiTexture::RGBA8, QSize(512, 512), 4, QRhiTexture::RenderTarget);
+#else
+ d.msaaTex = m_r->newTexture(QRhiTexture::RGBA8, QSize(512, 512), 1, QRhiTexture::RenderTarget);
+#endif
+ d.releasePool << d.msaaTex;
+ d.msaaTex->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, 0, sizeof(vertexData), vertexData);
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, sizeof(vertexData), sizeof(triangleData), triangleData);
+ d.initialUpdates->uploadStaticBuffer(d.ibuf, indexData);
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srbLeft = m_r->newShaderResourceBindings();
+ d.releasePool << d.srbLeft;
+ d.srbLeft->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf, 0, UBUFSZ),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler)
+ });
+ d.srbLeft->build();
+
+ d.srbRight = m_r->newShaderResourceBindings();
+ d.releasePool << d.srbRight;
+ d.srbRight->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf, d.rightOfs, UBUFSZ),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.msaaTex, d.sampler)
+ });
+ d.srbRight->build();
+
+ d.psLeft = m_r->newGraphicsPipeline();
+ d.releasePool << d.psLeft;
+ d.psLeft->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+ });
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({ { 4 * sizeof(float) } });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ });
+ d.psLeft->setVertexInputLayout(inputLayout);
+ d.psLeft->setShaderResourceBindings(d.srbLeft);
+ d.psLeft->setRenderPassDescriptor(m_rp);
+ d.psLeft->build();
+
+ d.psRight = m_r->newGraphicsPipeline();
+ d.releasePool << d.psRight;
+ d.psRight->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+#ifndef NO_MSAA
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture_ms4.frag.qsb")) }
+#else
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+#endif
+ });
+ d.psRight->setVertexInputLayout(d.psLeft->vertexInputLayout());
+ d.psRight->setShaderResourceBindings(d.srbRight);
+ d.psRight->setRenderPassDescriptor(m_rp);
+ d.psRight->build();
+
+ // set up the offscreen triangle that goes into tex and msaaTex
+ d.triUbuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.releasePool << d.triUbuf;
+ d.triUbuf->build();
+ d.triSrb = m_r->newShaderResourceBindings();
+ d.releasePool << d.triSrb;
+ d.triSrb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.triUbuf)
+ });
+ d.triSrb->build();
+ d.rt = m_r->newTextureRenderTarget({ d.tex });
+ d.releasePool << d.rt;
+ d.rtRp = d.rt->newCompatibleRenderPassDescriptor();
+ d.releasePool << d.rtRp;
+ d.rt->setRenderPassDescriptor(d.rtRp);
+ d.rt->build();
+ d.msaaRt = m_r->newTextureRenderTarget({ d.msaaTex });
+ d.releasePool << d.msaaRt;
+ d.msaaRtRp = d.msaaRt->newCompatibleRenderPassDescriptor();
+ d.releasePool << d.msaaRtRp;
+ d.msaaRt->setRenderPassDescriptor(d.msaaRtRp);
+ d.msaaRt->build();
+ d.triPs = m_r->newGraphicsPipeline();
+ d.releasePool << d.triPs;
+ d.triPs->setSampleCount(1);
+ d.triPs->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/color.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/color.frag.qsb")) }
+ });
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+ d.triPs->setVertexInputLayout(inputLayout);
+ d.triPs->setShaderResourceBindings(d.triSrb);
+ d.triPs->setRenderPassDescriptor(d.rtRp);
+ d.triPs->build();
+ d.msaaTriPs = m_r->newGraphicsPipeline();
+ d.releasePool << d.msaaTriPs;
+#ifndef NO_MSAA
+ d.msaaTriPs->setSampleCount(4);
+#else
+ d.msaaTriPs->setSampleCount(1);
+#endif
+ d.msaaTriPs->setShaderStages(d.triPs->cbeginShaderStages(), d.triPs->cendShaderStages());
+ d.msaaTriPs->setVertexInputLayout(d.triPs->vertexInputLayout());
+ d.msaaTriPs->setShaderResourceBindings(d.triSrb);
+ d.msaaTriPs->setRenderPassDescriptor(d.msaaRtRp);
+ d.msaaTriPs->build();
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+
+ // onscreen ubuf
+ qint32 flip = m_r->isYUpInFramebuffer() ? 1 : 0;
+ u->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+ u->updateDynamicBuffer(d.ubuf, d.rightOfs + 64, 4, &flip);
+
+ // offscreen ubuf
+ d.triBaseMvp = m_r->clipSpaceCorrMatrix();
+ d.triBaseMvp.perspective(45.0f, d.msaaTex->pixelSize().width() / float(d.msaaTex->pixelSize().height()), 0.01f, 1000.0f);
+ d.triBaseMvp.translate(0, 0, -2);
+ float opacity = 1.0f;
+ u->updateDynamicBuffer(d.triUbuf, 64, 4, &opacity);
+ }
+
+ if (d.winProj != m_proj) {
+ // onscreen buf, window size dependent
+ d.winProj = m_proj;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(2);
+ mvp.translate(-0.8f, 0, 0);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ mvp.translate(1.6f, 0, 0);
+ u->updateDynamicBuffer(d.ubuf, d.rightOfs, 64, mvp.constData());
+ }
+
+ // offscreen buf, apply the rotation on every frame
+ QMatrix4x4 triMvp = d.triBaseMvp;
+ triMvp.rotate(d.triRot, 0, 1, 0);
+ d.triRot += 1;
+ u->updateDynamicBuffer(d.triUbuf, 0, 64, triMvp.constData());
+
+ cb->resourceUpdate(u); // could have passed u to beginPass but exercise this one too
+
+ // offscreen
+ cb->beginPass(d.rt, QColor::fromRgbF(0.5f, 0.2f, 0.0f, 1.0f), { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.triPs);
+ cb->setViewport({ 0, 0, float(d.msaaTex->pixelSize().width()), float(d.msaaTex->pixelSize().height()) });
+ cb->setShaderResources();
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, sizeof(vertexData));
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+ cb->endPass();
+
+ // offscreen msaa
+ cb->beginPass(d.msaaRt, QColor::fromRgbF(0.5f, 0.2f, 0.0f, 1.0f), { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.msaaTriPs);
+ cb->setViewport({ 0, 0, float(d.msaaTex->pixelSize().width()), float(d.msaaTex->pixelSize().height()) });
+ cb->setShaderResources();
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+ cb->endPass();
+
+ // onscreen
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.psLeft); // showing the non-msaa version
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ vbufBinding.second = 0;
+ cb->setVertexInput(0, 1, &vbufBinding, d.ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ cb->drawIndexed(6);
+ cb->setGraphicsPipeline(d.psRight); // showing the msaa version, resolved in the shader
+ cb->setShaderResources();
+ cb->drawIndexed(6);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/msaatexture/msaatexture.pro b/tests/manual/rhi/msaatexture/msaatexture.pro
new file mode 100644
index 0000000000..0467e4dc9d
--- /dev/null
+++ b/tests/manual/rhi/msaatexture/msaatexture.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ msaatexture.cpp
+
+RESOURCES = msaatexture.qrc
diff --git a/tests/manual/rhi/msaatexture/msaatexture.qrc b/tests/manual/rhi/msaatexture/msaatexture.qrc
new file mode 100644
index 0000000000..ecd968481c
--- /dev/null
+++ b/tests/manual/rhi/msaatexture/msaatexture.qrc
@@ -0,0 +1,9 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="color.vert.qsb">../shared/color.vert.qsb</file>
+ <file alias="color.frag.qsb">../shared/color.frag.qsb</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+ <file alias="texture_ms4.frag.qsb">../shared/texture_ms4.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/multiwindow/multiwindow.cpp b/tests/manual/rhi/multiwindow/multiwindow.cpp
new file mode 100644
index 0000000000..4d5de16a58
--- /dev/null
+++ b/tests/manual/rhi/multiwindow/multiwindow.cpp
@@ -0,0 +1,640 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 <QApplication>
+#include <QWidget>
+#include <QLabel>
+#include <QPlainTextEdit>
+#include <QPushButton>
+#include <QCheckBox>
+#include <QVBoxLayout>
+
+#include <QCommandLineParser>
+#include <QWindow>
+#include <QPlatformSurfaceEvent>
+#include <QElapsedTimer>
+
+#include <QtGui/private/qshader_p.h>
+#include <QFile>
+
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qrhigles2_p.h>
+#include <QOffscreenSurface>
+#endif
+
+#if QT_CONFIG(vulkan)
+#include <QLoggingCategory>
+#include <QtGui/private/qrhivulkan_p.h>
+#endif
+
+#ifdef Q_OS_WIN
+#include <QtGui/private/qrhid3d11_p.h>
+#endif
+
+#ifdef Q_OS_DARWIN
+#include <QtGui/private/qrhimetal_p.h>
+#endif
+
+enum GraphicsApi
+{
+ OpenGL,
+ Vulkan,
+ D3D11,
+ Metal
+};
+
+static GraphicsApi graphicsApi;
+
+static QString graphicsApiName()
+{
+ switch (graphicsApi) {
+ case OpenGL:
+ return QLatin1String("OpenGL 2.x");
+ case Vulkan:
+ return QLatin1String("Vulkan");
+ case D3D11:
+ return QLatin1String("Direct3D 11");
+ case Metal:
+ return QLatin1String("Metal");
+ default:
+ break;
+ }
+ return QString();
+}
+
+static struct {
+#if QT_CONFIG(vulkan)
+ QVulkanInstance *instance = nullptr;
+#endif
+ QRhi *r = nullptr;
+#ifndef QT_NO_OPENGL
+ QOffscreenSurface *fallbackSurface = nullptr;
+#endif
+} r;
+
+void createRhi()
+{
+#ifndef QT_NO_OPENGL
+ if (graphicsApi == OpenGL) {
+ r.fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
+ QRhiGles2InitParams params;
+ params.fallbackSurface = r.fallbackSurface;
+ //params.window = this;
+ r.r = QRhi::create(QRhi::OpenGLES2, &params);
+ }
+#endif
+
+#if QT_CONFIG(vulkan)
+ if (graphicsApi == Vulkan) {
+ QRhiVulkanInitParams params;
+ params.inst = r.instance;
+ //params.window = this;
+ r.r = QRhi::create(QRhi::Vulkan, &params);
+ }
+#endif
+
+#ifdef Q_OS_WIN
+ if (graphicsApi == D3D11) {
+ QRhiD3D11InitParams params;
+ params.enableDebugLayer = true;
+ r.r = QRhi::create(QRhi::D3D11, &params);
+ }
+#endif
+
+#ifdef Q_OS_DARWIN
+ if (graphicsApi == Metal) {
+ QRhiMetalInitParams params;
+ r.r = QRhi::create(QRhi::Metal, &params);
+ }
+#endif
+
+ if (!r.r)
+ qFatal("Failed to create RHI backend");
+}
+
+void destroyRhi()
+{
+ delete r.r;
+
+#ifndef QT_NO_OPENGL
+ delete r.fallbackSurface;
+#endif
+}
+
+struct {
+ QVector<QWindow *> windows;
+
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+} d;
+
+static float vertexData[] = {
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
+};
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+// can use just one rpd from whichever window comes first since they are
+// actually compatible due to all windows using the same config (have
+// depth-stencil, sample count 1, same format). this means the same pso can be
+// reused too.
+void ensureSharedResources(QRhiRenderPassDescriptor *rp)
+{
+ if (!d.vbuf) {
+ d.vbuf = r.r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+ d.vbuf->build();
+ d.initialUpdates = r.r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, vertexData);
+ }
+
+ if (!d.ubuf) {
+ d.ubuf = r.r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.ubuf->build();
+ }
+
+ if (!d.srb) {
+ d.srb = r.r->newShaderResourceBindings();
+ d.srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf)
+ });
+ d.srb->build();
+ }
+
+ if (!d.ps) {
+ d.ps = r.r->newGraphicsPipeline();
+
+ QRhiGraphicsPipeline::TargetBlend premulAlphaBlend;
+ premulAlphaBlend.enable = true;
+ d.ps->setTargetBlends({ premulAlphaBlend });
+
+ const QShader vs = getShader(QLatin1String(":/color.vert.qsb"));
+ if (!vs.isValid())
+ qFatal("Failed to load shader pack (vertex)");
+ const QShader fs = getShader(QLatin1String(":/color.frag.qsb"));
+ if (!fs.isValid())
+ qFatal("Failed to load shader pack (fragment)");
+
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(rp);
+
+ d.ps->build();
+ }
+}
+
+void destroySharedResources()
+{
+ delete d.ps;
+ d.ps = nullptr;
+
+ delete d.srb;
+ d.srb = nullptr;
+
+ delete d.vbuf;
+ d.vbuf = nullptr;
+
+ delete d.ubuf;
+ d.ubuf = nullptr;
+}
+
+class Window : public QWindow
+{
+public:
+ Window(const QString &title, const QColor &bgColor, int axis, bool noVSync);
+ ~Window();
+
+protected:
+ void init();
+ void releaseResources();
+ void resizeSwapChain();
+ void releaseSwapChain();
+ void render();
+
+ void exposeEvent(QExposeEvent *) override;
+ bool event(QEvent *) override;
+
+ QColor m_bgColor;
+ int m_rotationAxis;
+ bool m_noVSync;
+
+ bool m_running = false;
+ bool m_notExposed = false;
+ bool m_newlyExposed = false;
+
+ QMatrix4x4 m_proj;
+ QVector<QRhiResource *> m_releasePool;
+
+ bool m_hasSwapChain = false;
+ QRhiSwapChain *m_sc = nullptr;
+ QRhiRenderBuffer *m_ds = nullptr;
+ QRhiRenderPassDescriptor *m_rp = nullptr;
+
+ float m_rotation = 0;
+ float m_opacity = 1;
+ int m_opacityDir = -1;
+};
+
+Window::Window(const QString &title, const QColor &bgColor, int axis, bool noVSync)
+ : m_bgColor(bgColor),
+ m_rotationAxis(axis),
+ m_noVSync(noVSync)
+{
+ switch (graphicsApi) {
+ case OpenGL:
+ {
+#if QT_CONFIG(opengl)
+ setSurfaceType(OpenGLSurface);
+ QSurfaceFormat fmt = QRhiGles2InitParams::adjustedFormat(); // default + depth/stencil
+ fmt.setSwapInterval(noVSync ? 0 : 1); // + swap interval
+ setFormat(fmt);
+#endif
+ }
+ break;
+ case Vulkan:
+#if QT_CONFIG(vulkan)
+ setSurfaceType(VulkanSurface);
+ setVulkanInstance(r.instance);
+#endif
+ break;
+ case D3D11:
+ setSurfaceType(OpenGLSurface); // not a typo
+ break;
+ case Metal:
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ setSurfaceType(MetalSurface);
+#endif
+ break;
+ default:
+ break;
+ }
+
+ resize(800, 600);
+ setTitle(title);
+}
+
+Window::~Window()
+{
+ releaseResources();
+}
+
+void Window::exposeEvent(QExposeEvent *)
+{
+ // initialize and start rendering when the window becomes usable for graphics purposes
+ if (isExposed() && !m_running) {
+ m_running = true;
+ init();
+ resizeSwapChain();
+ }
+
+ // stop pushing frames when not exposed (or size is 0)
+ if ((!isExposed() || (m_hasSwapChain && m_sc->surfacePixelSize().isEmpty())) && m_running)
+ m_notExposed = true;
+
+ // continue when exposed again and the surface has a valid size.
+ // note that the surface size can be (0, 0) even though size() reports a valid one...
+ if (isExposed() && m_running && m_notExposed && !m_sc->surfacePixelSize().isEmpty()) {
+ m_notExposed = false;
+ m_newlyExposed = true;
+ }
+
+ // always render a frame on exposeEvent() (when exposed) in order to update
+ // immediately on window resize.
+ if (isExposed() && !m_sc->surfacePixelSize().isEmpty())
+ render();
+}
+
+bool Window::event(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::UpdateRequest:
+ render();
+ break;
+
+ case QEvent::PlatformSurface:
+ // this is the proper time to tear down the swapchain (while the native window and surface are still around)
+ if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
+ releaseSwapChain();
+ break;
+
+ default:
+ break;
+ }
+
+ return QWindow::event(e);
+}
+
+void Window::init()
+{
+ m_sc = r.r->newSwapChain();
+ m_ds = r.r->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
+ QSize(),
+ 1,
+ QRhiRenderBuffer::UsedWithSwapChainOnly);
+ m_releasePool << m_ds;
+ m_sc->setWindow(this);
+ m_sc->setDepthStencil(m_ds);
+ if (m_noVSync)
+ m_sc->setFlags(QRhiSwapChain::NoVSync);
+
+ m_rp = m_sc->newCompatibleRenderPassDescriptor();
+ m_releasePool << m_rp;
+ m_sc->setRenderPassDescriptor(m_rp);
+
+ ensureSharedResources(m_rp);
+}
+
+void Window::releaseResources()
+{
+ qDeleteAll(m_releasePool);
+ m_releasePool.clear();
+
+ delete m_sc;
+ m_sc = nullptr;
+}
+
+void Window::resizeSwapChain()
+{
+ m_hasSwapChain = m_sc->buildOrResize();
+
+ const QSize outputSize = m_sc->currentPixelSize();
+ m_proj = r.r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, outputSize.width() / (float) outputSize.height(), 0.01f, 1000.0f);
+ m_proj.translate(0, 0, -4);
+}
+
+void Window::releaseSwapChain()
+{
+ if (m_hasSwapChain) {
+ m_hasSwapChain = false;
+ m_sc->release();
+ }
+}
+
+void Window::render()
+{
+ if (!m_hasSwapChain || m_notExposed)
+ return;
+
+ // If the window got resized or got newly exposed, resize the swapchain.
+ // (the newly-exposed case is not actually required by some
+ // platforms/backends, but f.ex. Vulkan on Windows seems to need it)
+ if (m_sc->currentPixelSize() != m_sc->surfacePixelSize() || m_newlyExposed) {
+ resizeSwapChain();
+ if (!m_hasSwapChain)
+ return;
+ m_newlyExposed = false;
+ }
+
+ QRhi::FrameOpResult result = r.r->beginFrame(m_sc);
+ if (result == QRhi::FrameOpSwapChainOutOfDate) {
+ resizeSwapChain();
+ if (!m_hasSwapChain)
+ return;
+ result = r.r->beginFrame(m_sc);
+ }
+ if (result != QRhi::FrameOpSuccess) {
+ requestUpdate();
+ return;
+ }
+
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+
+ QRhiResourceUpdateBatch *u = r.r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.rotate(m_rotation, m_rotationAxis == 0 ? 1 : 0, m_rotationAxis == 1 ? 1 : 0, m_rotationAxis == 2 ? 1 : 0);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ m_opacity += m_opacityDir * 0.005f;
+ if (m_opacity < 0.0f || m_opacity > 1.0f) {
+ m_opacityDir *= -1;
+ m_opacity = qBound(0.0f, m_opacity, 1.0f);
+ }
+ u->updateDynamicBuffer(d.ubuf, 64, 4, &m_opacity);
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(),
+ QColor::fromRgbF(float(m_bgColor.redF()), float(m_bgColor.greenF()), float(m_bgColor.blueF()), 1.0f),
+ { 1.0f, 0 },
+ u);
+
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+
+ cb->endPass();
+
+ r.r->endFrame(m_sc);
+
+ requestUpdate();
+}
+
+void createWindow(bool noVSync)
+{
+ static QColor colors[] = { Qt::red, Qt::green, Qt::blue, Qt::yellow, Qt::cyan, Qt::gray };
+ const int n = d.windows.count();
+ d.windows.append(new Window(QString::asprintf("Window #%d%s", n, noVSync ? " (no vsync)" : ""), colors[n % 6], n % 3, noVSync));
+ d.windows.last()->show();
+}
+
+void closeWindow()
+{
+ delete d.windows.takeLast();
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication app(argc, argv);
+
+#if defined(Q_OS_WIN)
+ graphicsApi = D3D11;
+#elif defined(Q_OS_DARWIN)
+ graphicsApi = Metal;
+#elif QT_CONFIG(vulkan)
+ graphicsApi = Vulkan;
+#else
+ graphicsApi = OpenGL;
+#endif
+
+ QCommandLineParser cmdLineParser;
+ cmdLineParser.addHelpOption();
+ QCommandLineOption glOption({ "g", "opengl" }, QLatin1String("OpenGL (2.x)"));
+ cmdLineParser.addOption(glOption);
+ QCommandLineOption vkOption({ "v", "vulkan" }, QLatin1String("Vulkan"));
+ cmdLineParser.addOption(vkOption);
+ QCommandLineOption d3dOption({ "d", "d3d11" }, QLatin1String("Direct3D 11"));
+ cmdLineParser.addOption(d3dOption);
+ QCommandLineOption mtlOption({ "m", "metal" }, QLatin1String("Metal"));
+ cmdLineParser.addOption(mtlOption);
+ cmdLineParser.process(app);
+ if (cmdLineParser.isSet(glOption))
+ graphicsApi = OpenGL;
+ if (cmdLineParser.isSet(vkOption))
+ graphicsApi = Vulkan;
+ if (cmdLineParser.isSet(d3dOption))
+ graphicsApi = D3D11;
+ if (cmdLineParser.isSet(mtlOption))
+ graphicsApi = Metal;
+
+ qDebug("Selected graphics API is %s", qPrintable(graphicsApiName()));
+ qDebug("This is a multi-api example, use command line arguments to override:\n%s", qPrintable(cmdLineParser.helpText()));
+
+#if QT_CONFIG(vulkan)
+ r.instance = new QVulkanInstance;
+ if (graphicsApi == Vulkan) {
+#ifndef Q_OS_ANDROID
+ r.instance->setLayers({ "VK_LAYER_LUNARG_standard_validation" });
+#else
+ r.instance->setLayers(QByteArrayList()
+ << "VK_LAYER_GOOGLE_threading"
+ << "VK_LAYER_LUNARG_parameter_validation"
+ << "VK_LAYER_LUNARG_object_tracker"
+ << "VK_LAYER_LUNARG_core_validation"
+ << "VK_LAYER_LUNARG_image"
+ << "VK_LAYER_LUNARG_swapchain"
+ << "VK_LAYER_GOOGLE_unique_objects");
+#endif
+ if (!r.instance->create()) {
+ qWarning("Failed to create Vulkan instance, switching to OpenGL");
+ graphicsApi = OpenGL;
+ }
+ }
+#endif
+
+ createRhi();
+
+ int winCount = 0;
+ QWidget w;
+ w.resize(800, 600);
+ w.setWindowTitle(QCoreApplication::applicationName() + QLatin1String(" - ") + graphicsApiName());
+ QVBoxLayout *layout = new QVBoxLayout(&w);
+
+ QPlainTextEdit *info = new QPlainTextEdit(
+ QLatin1String("This application tests rendering with the same QRhi instance (and so the same Vulkan/Metal/D3D device or OpenGL context) "
+ "to multiple windows via multiple QRhiSwapChain objects, from the same one thread. Some resources are shared across all windows.\n"
+ "\nNote that the behavior may differ depending on the underlying graphics API implementation and the number of windows. "
+ "One challenge here is the vsync throttling: with the default vsync/fifo presentation mode the behavior may differ between "
+ "platforms, drivers, and APIs as we present different swapchains' images in a row on the same thread. As a potential solution, "
+ "setting NoVSync on the second, third, and later window swapchains is offered as an option.\n"
+ "\n\nUsing API: ") + graphicsApiName());
+ info->setReadOnly(true);
+ layout->addWidget(info);
+ QLabel *label = new QLabel(QLatin1String("Window count: 0"));
+ layout->addWidget(label);
+ QCheckBox *vsCb = new QCheckBox(QLatin1String("Set NoVSync on all swapchains except the first"));
+ vsCb->setChecked(false);
+ layout->addWidget(vsCb);
+ QPushButton *btn = new QPushButton(QLatin1String("New window"));
+ QObject::connect(btn, &QPushButton::clicked, btn, [label, vsCb, &winCount] {
+ winCount += 1;
+ label->setText(QString::asprintf("Window count: %d", winCount));
+ const bool noVSync = vsCb->isChecked() && winCount > 1;
+ createWindow(noVSync);
+ });
+ layout->addWidget(btn);
+ btn = new QPushButton(QLatin1String("Close window"));
+ QObject::connect(btn, &QPushButton::clicked, btn, [label, &winCount] {
+ if (winCount > 0) {
+ winCount -= 1;
+ label->setText(QString::asprintf("Window count: %d", winCount));
+ closeWindow();
+ }
+ });
+ layout->addWidget(btn);
+ w.show();
+
+ int result = app.exec();
+
+ qDeleteAll(d.windows);
+
+ destroySharedResources();
+ destroyRhi();
+
+#if QT_CONFIG(vulkan)
+ delete r.instance;
+#endif
+
+ return result;
+}
diff --git a/tests/manual/rhi/multiwindow/multiwindow.pro b/tests/manual/rhi/multiwindow/multiwindow.pro
new file mode 100644
index 0000000000..b9c3867bf8
--- /dev/null
+++ b/tests/manual/rhi/multiwindow/multiwindow.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private widgets
+
+SOURCES = \
+ multiwindow.cpp
+
+RESOURCES = multiwindow.qrc
diff --git a/tests/manual/rhi/multiwindow/multiwindow.qrc b/tests/manual/rhi/multiwindow/multiwindow.qrc
new file mode 100644
index 0000000000..8cec4fa9ec
--- /dev/null
+++ b/tests/manual/rhi/multiwindow/multiwindow.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="color.vert.qsb">../shared/color.vert.qsb</file>
+ <file alias="color.frag.qsb">../shared/color.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp
new file mode 100644
index 0000000000..37c6cd04c3
--- /dev/null
+++ b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp
@@ -0,0 +1,831 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 <QApplication>
+#include <QWidget>
+#include <QLabel>
+#include <QPlainTextEdit>
+#include <QPushButton>
+#include <QCheckBox>
+#include <QVBoxLayout>
+
+#include <QThread>
+#include <QMutex>
+#include <QWaitCondition>
+#include <QQueue>
+#include <QEvent>
+#include <QCommandLineParser>
+#include <QElapsedTimer>
+
+#include <QtGui/private/qshader_p.h>
+#include <QFile>
+#include <QtGui/private/qrhiprofiler_p.h>
+
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qrhigles2_p.h>
+#include <QOffscreenSurface>
+#endif
+
+#if QT_CONFIG(vulkan)
+#include <QLoggingCategory>
+#include <QtGui/private/qrhivulkan_p.h>
+#endif
+
+#ifdef Q_OS_WIN
+#include <QtGui/private/qrhid3d11_p.h>
+#endif
+
+#ifdef Q_OS_DARWIN
+#include <QtGui/private/qrhimetal_p.h>
+#endif
+
+#include "window.h"
+
+#include "../shared/cube.h"
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+static GraphicsApi graphicsApi;
+
+static QString graphicsApiName()
+{
+ switch (graphicsApi) {
+ case OpenGL:
+ return QLatin1String("OpenGL 2.x");
+ case Vulkan:
+ return QLatin1String("Vulkan");
+ case D3D11:
+ return QLatin1String("Direct3D 11");
+ case Metal:
+ return QLatin1String("Metal");
+ default:
+ break;
+ }
+ return QString();
+}
+
+#if QT_CONFIG(vulkan)
+QVulkanInstance *instance = nullptr;
+#endif
+
+// Window (main thread) emit signals -> Renderer::send* (main thread) -> event queue (add on main, process on render thread) -> Renderer::renderEvent (render thread)
+
+// event queue is taken from the Qt Quick scenegraph as-is
+// all this below is conceptually the same as the QSG threaded render loop
+class RenderThreadEventQueue : public QQueue<QEvent *>
+{
+public:
+ RenderThreadEventQueue()
+ : waiting(false)
+ {
+ }
+
+ void addEvent(QEvent *e) {
+ mutex.lock();
+ enqueue(e);
+ if (waiting)
+ condition.wakeOne();
+ mutex.unlock();
+ }
+
+ QEvent *takeEvent(bool wait) {
+ mutex.lock();
+ if (isEmpty() && wait) {
+ waiting = true;
+ condition.wait(&mutex);
+ waiting = false;
+ }
+ QEvent *e = dequeue();
+ mutex.unlock();
+ return e;
+ }
+
+ bool hasMoreEvents() {
+ mutex.lock();
+ bool has = !isEmpty();
+ mutex.unlock();
+ return has;
+ }
+
+private:
+ QMutex mutex;
+ QWaitCondition condition;
+ bool waiting;
+};
+
+struct Renderer;
+
+struct Thread : public QThread
+{
+ Thread(Renderer *renderer_)
+ : renderer(renderer_)
+ {
+ active = true;
+ start();
+ }
+ void run() override;
+
+ Renderer *renderer;
+ bool active;
+ RenderThreadEventQueue eventQueue;
+ bool sleeping = false;
+ bool stopEventProcessing = false;
+ bool pendingRender = false;
+ bool pendingRenderIsNewExpose = false;
+ // mutex and cond used to allow the main thread waiting until something completes on the render thread
+ QMutex mutex;
+ QWaitCondition cond;
+};
+
+class RenderThreadEvent : public QEvent
+{
+public:
+ RenderThreadEvent(QEvent::Type type) : QEvent(type) { }
+};
+
+class InitEvent : public RenderThreadEvent
+{
+public:
+ static const QEvent::Type TYPE = QEvent::Type(QEvent::User + 1);
+ InitEvent() : RenderThreadEvent(TYPE)
+ { }
+};
+
+class RequestRenderEvent : public RenderThreadEvent
+{
+public:
+ static const QEvent::Type TYPE = QEvent::Type(QEvent::User + 2);
+ RequestRenderEvent(bool newlyExposed_) : RenderThreadEvent(TYPE), newlyExposed(newlyExposed_)
+ { }
+ bool newlyExposed;
+};
+
+class SurfaceCleanupEvent : public RenderThreadEvent
+{
+public:
+ static const QEvent::Type TYPE = QEvent::Type(QEvent::User + 3);
+ SurfaceCleanupEvent() : RenderThreadEvent(TYPE)
+ { }
+};
+
+class CloseEvent : public RenderThreadEvent
+{
+public:
+ static const QEvent::Type TYPE = QEvent::Type(QEvent::User + 4);
+ CloseEvent() : RenderThreadEvent(TYPE)
+ { }
+};
+
+class SyncSurfaceSizeEvent : public RenderThreadEvent
+{
+public:
+ static const QEvent::Type TYPE = QEvent::Type(QEvent::User + 5);
+ SyncSurfaceSizeEvent() : RenderThreadEvent(TYPE)
+ { }
+};
+
+struct Renderer
+{
+ // ctor and dtor and send* are called main thread, rest on the render thread
+
+ Renderer(QWindow *w, const QColor &bgColor, int rotationAxis);
+ ~Renderer();
+
+ void sendInit();
+ void sendRender(bool newlyExposed);
+ void sendSurfaceGoingAway();
+ void sendSyncSurfaceSize();
+
+ QWindow *window;
+ Thread *thread;
+ QRhi *r = nullptr;
+#ifndef QT_NO_OPENGL
+ QOffscreenSurface *fallbackSurface = nullptr;
+#endif
+
+ void createRhi();
+ void destroyRhi();
+ void renderEvent(QEvent *e);
+ void init();
+ void releaseSwapChain();
+ void releaseResources();
+ void render(bool newlyExposed, bool wakeBeforePresent);
+
+ QColor m_bgColor;
+ int m_rotationAxis;
+
+ QVector<QRhiResource *> m_releasePool;
+ bool m_hasSwapChain = false;
+ QRhiSwapChain *m_sc = nullptr;
+ QRhiRenderBuffer *m_ds = nullptr;
+ QRhiRenderPassDescriptor *m_rp = nullptr;
+
+ QRhiBuffer *m_vbuf = nullptr;
+ QRhiBuffer *m_ubuf = nullptr;
+ QRhiTexture *m_tex = nullptr;
+ QRhiSampler *m_sampler = nullptr;
+ QRhiShaderResourceBindings *m_srb = nullptr;
+ QRhiGraphicsPipeline *m_ps = nullptr;
+ QRhiResourceUpdateBatch *m_initialUpdates = nullptr;
+
+ QMatrix4x4 m_proj;
+ float m_rotation = 0;
+ int m_frameCount = 0;
+};
+
+void Thread::run()
+{
+ while (active) {
+#ifdef Q_OS_DARWIN
+ QMacAutoReleasePool autoReleasePool;
+#endif
+
+ if (pendingRender) {
+ pendingRender = false;
+ renderer->render(pendingRenderIsNewExpose, false);
+ }
+
+ while (eventQueue.hasMoreEvents()) {
+ QEvent *e = eventQueue.takeEvent(false);
+ renderer->renderEvent(e);
+ delete e;
+ }
+
+ if (active && !pendingRender) {
+ sleeping = true;
+ stopEventProcessing = false;
+ while (!stopEventProcessing) {
+ QEvent *e = eventQueue.takeEvent(true);
+ renderer->renderEvent(e);
+ delete e;
+ }
+ sleeping = false;
+ }
+ }
+}
+
+Renderer::Renderer(QWindow *w, const QColor &bgColor, int rotationAxis)
+ : window(w),
+ m_bgColor(bgColor),
+ m_rotationAxis(rotationAxis)
+{ // main thread
+ thread = new Thread(this);
+
+#ifndef QT_NO_OPENGL
+ if (graphicsApi == OpenGL)
+ fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
+#endif
+}
+
+Renderer::~Renderer()
+{ // main thread
+ thread->eventQueue.addEvent(new CloseEvent);
+ thread->wait();
+ delete thread;
+
+#ifndef QT_NO_OPENGL
+ delete fallbackSurface;
+#endif
+}
+
+void Renderer::createRhi()
+{
+ if (r)
+ return;
+
+ qDebug() << "renderer" << this << "creating rhi";
+ QRhi::Flags rhiFlags = QRhi::EnableProfiling;
+
+#ifndef QT_NO_OPENGL
+ if (graphicsApi == OpenGL) {
+ QRhiGles2InitParams params;
+ params.fallbackSurface = fallbackSurface;
+ params.window = window;
+ r = QRhi::create(QRhi::OpenGLES2, &params, rhiFlags);
+ }
+#endif
+
+#if QT_CONFIG(vulkan)
+ if (graphicsApi == Vulkan) {
+ QRhiVulkanInitParams params;
+ params.inst = instance;
+ params.window = window;
+ r = QRhi::create(QRhi::Vulkan, &params, rhiFlags);
+ }
+#endif
+
+#ifdef Q_OS_WIN
+ if (graphicsApi == D3D11) {
+ QRhiD3D11InitParams params;
+ params.enableDebugLayer = true;
+ r = QRhi::create(QRhi::D3D11, &params, rhiFlags);
+ }
+#endif
+
+#ifdef Q_OS_DARWIN
+ if (graphicsApi == Metal) {
+ QRhiMetalInitParams params;
+ r = QRhi::create(QRhi::Metal, &params, rhiFlags);
+ }
+#endif
+
+ if (!r)
+ qFatal("Failed to create RHI backend");
+}
+
+void Renderer::destroyRhi()
+{
+ qDebug() << "renderer" << this << "destroying rhi";
+ delete r;
+ r = nullptr;
+}
+
+void Renderer::renderEvent(QEvent *e)
+{
+ Q_ASSERT(QThread::currentThread() == thread);
+
+ if (thread->sleeping)
+ thread->stopEventProcessing = true;
+
+ switch (int(e->type())) {
+ case InitEvent::TYPE:
+ qDebug() << "renderer" << this << "for window" << window << "is initializing";
+ createRhi();
+ init();
+ break;
+ case RequestRenderEvent::TYPE:
+ thread->pendingRender = true;
+ thread->pendingRenderIsNewExpose = static_cast<RequestRenderEvent *>(e)->newlyExposed;
+ break;
+ case SurfaceCleanupEvent::TYPE: // when the QWindow is closed, before QPlatformWindow goes away
+ thread->mutex.lock();
+ qDebug() << "renderer" << this << "for window" << window << "is destroying swapchain";
+ thread->pendingRender = false;
+ releaseSwapChain();
+ thread->cond.wakeOne();
+ thread->mutex.unlock();
+ break;
+ case CloseEvent::TYPE: // when destroying the window+renderer (NB not the same as hitting X on the window, that's just QWindow close)
+ qDebug() << "renderer" << this << "for window" << window << "is shutting down";
+ thread->pendingRender = false;
+ thread->active = false;
+ thread->stopEventProcessing = true;
+ releaseResources();
+ destroyRhi();
+ break;
+ case SyncSurfaceSizeEvent::TYPE:
+ thread->mutex.lock();
+ thread->pendingRender = false;
+ render(false, true);
+ break;
+ default:
+ break;
+ }
+}
+
+void Renderer::init()
+{
+ m_sc = r->newSwapChain();
+ m_ds = r->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
+ QSize(),
+ 1,
+ QRhiRenderBuffer::UsedWithSwapChainOnly);
+ m_releasePool << m_ds;
+ m_sc->setWindow(window);
+ m_sc->setDepthStencil(m_ds);
+ m_rp = m_sc->newCompatibleRenderPassDescriptor();
+ m_releasePool << m_rp;
+ m_sc->setRenderPassDescriptor(m_rp);
+
+ m_vbuf = r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ m_releasePool << m_vbuf;
+ m_vbuf->build();
+
+ m_ubuf = r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4);
+ m_releasePool << m_ubuf;
+ m_ubuf->build();
+
+ QImage image = QImage(QLatin1String(":/qt256.png")).convertToFormat(QImage::Format_RGBA8888);
+ m_tex = r->newTexture(QRhiTexture::RGBA8, image.size());
+ m_releasePool << m_tex;
+ m_tex->build();
+
+ m_sampler = r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ m_releasePool << m_sampler;
+ m_sampler->build();
+
+ m_srb = r->newShaderResourceBindings();
+ m_releasePool << m_srb;
+ m_srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler)
+ });
+ m_srb->build();
+
+ m_ps = r->newGraphicsPipeline();
+ m_releasePool << m_ps;
+
+ m_ps->setDepthTest(true);
+ m_ps->setDepthWrite(true);
+ m_ps->setDepthOp(QRhiGraphicsPipeline::Less);
+
+ m_ps->setCullMode(QRhiGraphicsPipeline::Back);
+ m_ps->setFrontFace(QRhiGraphicsPipeline::CCW);
+
+ m_ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/texture.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/texture.frag.qsb")) }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+
+ m_ps->setVertexInputLayout(inputLayout);
+ m_ps->setShaderResourceBindings(m_srb);
+ m_ps->setRenderPassDescriptor(m_rp);
+
+ m_ps->build();
+
+ m_initialUpdates = r->nextResourceUpdateBatch();
+
+ m_initialUpdates->uploadStaticBuffer(m_vbuf, cube);
+
+ qint32 flip = 0;
+ m_initialUpdates->updateDynamicBuffer(m_ubuf, 64, 4, &flip);
+
+ m_initialUpdates->uploadTexture(m_tex, image);
+}
+
+void Renderer::releaseSwapChain()
+{
+ if (m_hasSwapChain) {
+ m_hasSwapChain = false;
+ m_sc->release();
+ }
+}
+
+void Renderer::releaseResources()
+{
+ qDeleteAll(m_releasePool);
+ m_releasePool.clear();
+
+ delete m_sc;
+ m_sc = nullptr;
+}
+
+void Renderer::render(bool newlyExposed, bool wakeBeforePresent)
+{
+ // This function handles both resizing and rendering. Resizes have some
+ // complications due to the threaded model (check exposeEvent and
+ // sendSyncSurfaceSize) but don't have to worry about that in here.
+
+ auto buildOrResizeSwapChain = [this] {
+ qDebug() << "renderer" << this << "build or resize swapchain for window" << window;
+ m_hasSwapChain = m_sc->buildOrResize();
+ const QSize outputSize = m_sc->currentPixelSize();
+ qDebug() << " size is" << outputSize;
+ m_proj = r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, outputSize.width() / (float) outputSize.height(), 0.01f, 100.0f);
+ m_proj.translate(0, 0, -4);
+ };
+
+ auto wakeUpIfNeeded = [wakeBeforePresent, this] {
+ // make sure the main/gui thread is not blocked when issuing the Present (or equivalent)
+ if (wakeBeforePresent) {
+ thread->cond.wakeOne();
+ thread->mutex.unlock();
+ }
+ };
+
+ const QSize surfaceSize = m_sc->surfacePixelSize();
+ if (surfaceSize.isEmpty()) {
+ wakeUpIfNeeded();
+ return;
+ }
+
+ if (newlyExposed || m_sc->currentPixelSize() != surfaceSize)
+ buildOrResizeSwapChain();
+
+ if (!m_hasSwapChain) {
+ wakeUpIfNeeded();
+ return;
+ }
+
+ QRhi::FrameOpResult result = r->beginFrame(m_sc);
+ if (result == QRhi::FrameOpSwapChainOutOfDate) {
+ buildOrResizeSwapChain();
+ if (!m_hasSwapChain) {
+ wakeUpIfNeeded();
+ return;
+ }
+ result = r->beginFrame(m_sc);
+ }
+ if (result != QRhi::FrameOpSuccess) {
+ wakeUpIfNeeded();
+ return;
+ }
+
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ const QSize outputSize = m_sc->currentPixelSize();
+
+ QRhiResourceUpdateBatch *u = r->nextResourceUpdateBatch();
+ if (m_initialUpdates) {
+ u->merge(m_initialUpdates);
+ m_initialUpdates->release();
+ m_initialUpdates = nullptr;
+ }
+
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(0.5f);
+ mvp.rotate(m_rotation, m_rotationAxis == 0 ? 1 : 0, m_rotationAxis == 1 ? 1 : 0, m_rotationAxis == 2 ? 1 : 0);
+ u->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(),
+ QColor::fromRgbF(float(m_bgColor.redF()), float(m_bgColor.greenF()), float(m_bgColor.blueF()), 1.0f),
+ { 1.0f, 0 },
+ u);
+
+ cb->setGraphicsPipeline(m_ps);
+ cb->setViewport(QRhiViewport(0, 0, outputSize.width(), outputSize.height()));
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { m_vbuf, 0 },
+ { m_vbuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ cb->draw(36);
+
+ cb->endPass();
+
+ wakeUpIfNeeded();
+
+ r->endFrame(m_sc);
+
+ m_frameCount += 1;
+ if ((m_frameCount % 300) == 0) {
+ const QRhiProfiler::CpuTime ff = r->profiler()->frameToFrameTimes(m_sc);
+ const QRhiProfiler::CpuTime be = r->profiler()->frameBuildTimes(m_sc);
+ const QRhiProfiler::GpuTime gp = r->profiler()->gpuFrameTimes(m_sc);
+ if (r->isFeatureSupported(QRhi::Timestamps)) {
+ qDebug("[renderer %p] frame-to-frame: min %lld max %lld avg %f. "
+ "frame build: min %lld max %lld avg %f. "
+ "gpu frame time: min %f max %f avg %f",
+ this,
+ ff.minTime, ff.maxTime, ff.avgTime,
+ be.minTime, be.maxTime, be.avgTime,
+ gp.minTime, gp.maxTime, gp.avgTime);
+ } else {
+ qDebug("[renderer %p] frame-to-frame: min %lld max %lld avg %f. "
+ "frame build: min %lld max %lld avg %f. ",
+ this,
+ ff.minTime, ff.maxTime, ff.avgTime,
+ be.minTime, be.maxTime, be.avgTime);
+ }
+ }
+}
+
+void Renderer::sendInit()
+{ // main thread
+ InitEvent *e = new InitEvent;
+ thread->eventQueue.addEvent(e);
+}
+
+void Renderer::sendRender(bool newlyExposed)
+{ // main thread
+ RequestRenderEvent *e = new RequestRenderEvent(newlyExposed);
+ thread->eventQueue.addEvent(e);
+}
+
+void Renderer::sendSurfaceGoingAway()
+{ // main thread
+ SurfaceCleanupEvent *e = new SurfaceCleanupEvent;
+
+ // cannot let this thread to proceed with tearing down the native window
+ // before the render thread completes the swapchain release
+ thread->mutex.lock();
+
+ thread->eventQueue.addEvent(e);
+
+ thread->cond.wait(&thread->mutex);
+ thread->mutex.unlock();
+}
+
+void Renderer::sendSyncSurfaceSize()
+{ // main thread
+ SyncSurfaceSizeEvent *e = new SyncSurfaceSizeEvent;
+ // must block to prevent surface size mess. the render thread will do a
+ // full rendering round before it unlocks which is good since it can thus
+ // pick up and the surface (window) size atomically.
+ thread->mutex.lock();
+ thread->eventQueue.addEvent(e);
+ thread->cond.wait(&thread->mutex);
+ thread->mutex.unlock();
+}
+
+struct WindowAndRenderer
+{
+ QWindow *window;
+ Renderer *renderer;
+};
+
+QVector<WindowAndRenderer> windows;
+
+void createWindow()
+{
+ static QColor colors[] = { Qt::red, Qt::green, Qt::blue, Qt::yellow, Qt::cyan, Qt::gray };
+ const int n = windows.count();
+ Window *w = new Window(QString::asprintf("Window+Thread #%d (%s)", n, qPrintable(graphicsApiName())), graphicsApi);
+ Renderer *renderer = new Renderer(w, colors[n % 6], n % 3);;
+ QObject::connect(w, &Window::initRequested, w, [renderer] {
+ renderer->sendInit();
+ });
+ QObject::connect(w, &Window::renderRequested, w, [w, renderer](bool newlyExposed) {
+ renderer->sendRender(newlyExposed);
+ w->requestUpdate();
+ });
+ QObject::connect(w, &Window::surfaceGoingAway, w, [renderer] {
+ renderer->sendSurfaceGoingAway();
+ });
+ QObject::connect(w, &Window::syncSurfaceSizeRequested, w, [renderer] {
+ renderer->sendSyncSurfaceSize();
+ });
+ windows.append({ w, renderer });
+ w->show();
+}
+
+void closeWindow()
+{
+ WindowAndRenderer wr = windows.takeLast();
+ delete wr.renderer;
+ delete wr.window;
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication app(argc, argv);
+
+#if defined(Q_OS_WIN)
+ graphicsApi = D3D11;
+#elif defined(Q_OS_DARWIN)
+ graphicsApi = Metal;
+#elif QT_CONFIG(vulkan)
+ graphicsApi = Vulkan;
+#else
+ graphicsApi = OpenGL;
+#endif
+
+ QCommandLineParser cmdLineParser;
+ cmdLineParser.addHelpOption();
+ QCommandLineOption glOption({ "g", "opengl" }, QLatin1String("OpenGL (2.x)"));
+ cmdLineParser.addOption(glOption);
+ QCommandLineOption vkOption({ "v", "vulkan" }, QLatin1String("Vulkan"));
+ cmdLineParser.addOption(vkOption);
+ QCommandLineOption d3dOption({ "d", "d3d11" }, QLatin1String("Direct3D 11"));
+ cmdLineParser.addOption(d3dOption);
+ QCommandLineOption mtlOption({ "m", "metal" }, QLatin1String("Metal"));
+ cmdLineParser.addOption(mtlOption);
+ cmdLineParser.process(app);
+ if (cmdLineParser.isSet(glOption))
+ graphicsApi = OpenGL;
+ if (cmdLineParser.isSet(vkOption))
+ graphicsApi = Vulkan;
+ if (cmdLineParser.isSet(d3dOption))
+ graphicsApi = D3D11;
+ if (cmdLineParser.isSet(mtlOption))
+ graphicsApi = Metal;
+
+ qDebug("Selected graphics API is %s", qPrintable(graphicsApiName()));
+ qDebug("This is a multi-api example, use command line arguments to override:\n%s", qPrintable(cmdLineParser.helpText()));
+
+#if QT_CONFIG(vulkan)
+ instance = new QVulkanInstance;
+ if (graphicsApi == Vulkan) {
+#ifndef Q_OS_ANDROID
+ instance->setLayers({ "VK_LAYER_LUNARG_standard_validation" });
+#else
+ instance->setLayers(QByteArrayList()
+ << "VK_LAYER_GOOGLE_threading"
+ << "VK_LAYER_LUNARG_parameter_validation"
+ << "VK_LAYER_LUNARG_object_tracker"
+ << "VK_LAYER_LUNARG_core_validation"
+ << "VK_LAYER_LUNARG_image"
+ << "VK_LAYER_LUNARG_swapchain"
+ << "VK_LAYER_GOOGLE_unique_objects");
+#endif
+ if (!instance->create()) {
+ qWarning("Failed to create Vulkan instance, switching to OpenGL");
+ graphicsApi = OpenGL;
+ }
+ }
+#endif
+
+ int winCount = 0;
+ QWidget w;
+ w.resize(800, 600);
+ w.setWindowTitle(QCoreApplication::applicationName() + QLatin1String(" - ") + graphicsApiName());
+ QVBoxLayout *layout = new QVBoxLayout(&w);
+
+ QPlainTextEdit *info = new QPlainTextEdit(
+ QLatin1String("This application tests rendering on a separate thread per window, with dedicated QRhi instances and resources. "
+ "\n\nThis is the same concept as the Qt Quick Scenegraph's threaded render loop. This should allow rendering to the different windows "
+ "without unintentionally throttling each other's threads."
+ "\n\nUsing API: ") + graphicsApiName());
+ info->setReadOnly(true);
+ layout->addWidget(info);
+ QLabel *label = new QLabel(QLatin1String("Window and thread count: 0"));
+ layout->addWidget(label);
+ QPushButton *btn = new QPushButton(QLatin1String("New window"));
+ QObject::connect(btn, &QPushButton::clicked, btn, [label, &winCount] {
+ winCount += 1;
+ label->setText(QString::asprintf("Window count: %d", winCount));
+ createWindow();
+ });
+ layout->addWidget(btn);
+ btn = new QPushButton(QLatin1String("Close window"));
+ QObject::connect(btn, &QPushButton::clicked, btn, [label, &winCount] {
+ if (winCount > 0) {
+ winCount -= 1;
+ label->setText(QString::asprintf("Window count: %d", winCount));
+ closeWindow();
+ }
+ });
+ layout->addWidget(btn);
+ w.show();
+
+ int result = app.exec();
+
+ for (const WindowAndRenderer &wr : windows) {
+ delete wr.renderer;
+ delete wr.window;
+ }
+
+#if QT_CONFIG(vulkan)
+ delete instance;
+#endif
+
+ return result;
+}
diff --git a/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.pro b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.pro
new file mode 100644
index 0000000000..0b78518b9b
--- /dev/null
+++ b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+
+QT += gui-private widgets
+
+SOURCES = \
+ multiwindow_threaded.cpp \
+ window.cpp
+
+HEADERS = \
+ window.h
+
+RESOURCES = multiwindow_threaded.qrc
diff --git a/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.qrc b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.qrc
new file mode 100644
index 0000000000..742b2b77af
--- /dev/null
+++ b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="qt256.png">../shared/qt256.png</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/multiwindow_threaded/window.cpp b/tests/manual/rhi/multiwindow_threaded/window.cpp
new file mode 100644
index 0000000000..aa7b479047
--- /dev/null
+++ b/tests/manual/rhi/multiwindow_threaded/window.cpp
@@ -0,0 +1,142 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "window.h"
+#include <QPlatformSurfaceEvent>
+
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qrhigles2_p.h>
+#endif
+
+#if QT_CONFIG(vulkan)
+extern QVulkanInstance *instance;
+#endif
+
+Window::Window(const QString &title, GraphicsApi api)
+{
+ switch (api) {
+ case OpenGL:
+#if QT_CONFIG(opengl)
+ setSurfaceType(OpenGLSurface);
+ setFormat(QRhiGles2InitParams::adjustedFormat());
+#endif
+ break;
+ case Vulkan:
+#if QT_CONFIG(vulkan)
+ setSurfaceType(VulkanSurface);
+ setVulkanInstance(instance);
+#endif
+ break;
+ case D3D11:
+ setSurfaceType(OpenGLSurface); // not a typo
+ break;
+ case Metal:
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ setSurfaceType(MetalSurface);
+#endif
+ break;
+ default:
+ break;
+ }
+
+ resize(800, 600);
+ setTitle(title);
+}
+
+Window::~Window()
+{
+}
+
+void Window::exposeEvent(QExposeEvent *)
+{
+ if (isExposed()) {
+ if (!m_running) {
+ // initialize and start rendering when the window becomes usable for graphics purposes
+ m_running = true;
+ m_notExposed = false;
+ emit initRequested();
+ emit renderRequested(true);
+ } else {
+ // continue when exposed again
+ if (m_notExposed) {
+ m_notExposed = false;
+ emit renderRequested(true);
+ } else {
+ // resize generates exposes - this is very important here (unlike in a single-threaded renderer)
+ emit syncSurfaceSizeRequested();
+ }
+ }
+ } else {
+ // stop pushing frames when not exposed (on some platforms this is essential, optional on others)
+ if (m_running)
+ m_notExposed = true;
+ }
+}
+
+bool Window::event(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::UpdateRequest:
+ if (!m_notExposed)
+ emit renderRequested(false);
+ break;
+
+ case QEvent::PlatformSurface:
+ // this is the proper time to tear down the swapchain (while the native window and surface are still around)
+ if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
+ emit surfaceGoingAway();
+ break;
+
+ default:
+ break;
+ }
+
+ return QWindow::event(e);
+}
diff --git a/tests/manual/rhi/multiwindow_threaded/window.h b/tests/manual/rhi/multiwindow_threaded/window.h
new file mode 100644
index 0000000000..7810858d0a
--- /dev/null
+++ b/tests/manual/rhi/multiwindow_threaded/window.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 WINDOW_H
+#define WINDOW_H
+
+#include <QWindow>
+
+enum GraphicsApi
+{
+ OpenGL,
+ Vulkan,
+ D3D11,
+ Metal
+};
+
+class Window : public QWindow
+{
+ Q_OBJECT
+
+public:
+ Window(const QString &title, GraphicsApi api);
+ ~Window();
+
+ void exposeEvent(QExposeEvent *) override;
+ bool event(QEvent *) override;
+
+signals:
+ void initRequested();
+ void renderRequested(bool newlyExposed);
+ void surfaceGoingAway();
+ void syncSurfaceSizeRequested();
+
+protected:
+ bool m_running = false;
+ bool m_notExposed = true;
+};
+
+#endif
diff --git a/tests/manual/rhi/offscreen/offscreen.cpp b/tests/manual/rhi/offscreen/offscreen.cpp
new file mode 100644
index 0000000000..79e50d3dd4
--- /dev/null
+++ b/tests/manual/rhi/offscreen/offscreen.cpp
@@ -0,0 +1,366 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 <QGuiApplication>
+#include <QImage>
+#include <QFileInfo>
+#include <QFile>
+#include <QLoggingCategory>
+#include <QCommandLineParser>
+#include <QtGui/private/qshader_p.h>
+
+#include <QtGui/private/qrhinull_p.h>
+
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qrhigles2_p.h>
+#include <QOffscreenSurface>
+#endif
+
+#if QT_CONFIG(vulkan)
+#include <QLoggingCategory>
+#include <QtGui/private/qrhivulkan_p.h>
+#endif
+
+#ifdef Q_OS_WIN
+#include <QtGui/private/qrhid3d11_p.h>
+#endif
+
+#ifdef Q_OS_DARWIN
+#include <QtGui/private/qrhimetal_p.h>
+#endif
+
+//#define TEST_FINISH
+
+static float vertexData[] = { // Y up (note m_proj), CCW
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f,
+};
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+enum GraphicsApi
+{
+ OpenGL,
+ Vulkan,
+ D3D11,
+ Metal,
+ Null
+};
+
+GraphicsApi graphicsApi;
+
+QString graphicsApiName()
+{
+ switch (graphicsApi) {
+ case OpenGL:
+ return QLatin1String("OpenGL 2.x");
+ case Vulkan:
+ return QLatin1String("Vulkan");
+ case D3D11:
+ return QLatin1String("Direct3D 11");
+ case Metal:
+ return QLatin1String("Metal");
+ case Null:
+ return QLatin1String("Null");
+ default:
+ break;
+ }
+ return QString();
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QGuiApplication app(argc, argv);
+
+#if defined(Q_OS_WIN)
+ graphicsApi = D3D11;
+#elif defined(Q_OS_DARWIN)
+ graphicsApi = Metal;
+#elif QT_CONFIG(vulkan)
+ graphicsApi = Vulkan;
+#else
+ graphicsApi = OpenGL;
+#endif
+
+ QCommandLineParser cmdLineParser;
+ cmdLineParser.addHelpOption();
+ QCommandLineOption glOption({ "g", "opengl" }, QLatin1String("OpenGL (2.x)"));
+ cmdLineParser.addOption(glOption);
+ QCommandLineOption vkOption({ "v", "vulkan" }, QLatin1String("Vulkan"));
+ cmdLineParser.addOption(vkOption);
+ QCommandLineOption d3dOption({ "d", "d3d11" }, QLatin1String("Direct3D 11"));
+ cmdLineParser.addOption(d3dOption);
+ QCommandLineOption mtlOption({ "m", "metal" }, QLatin1String("Metal"));
+ cmdLineParser.addOption(mtlOption);
+ QCommandLineOption nullOption({ "n", "null" }, QLatin1String("Null"));
+ cmdLineParser.addOption(nullOption);
+ cmdLineParser.process(app);
+ if (cmdLineParser.isSet(glOption))
+ graphicsApi = OpenGL;
+ if (cmdLineParser.isSet(vkOption))
+ graphicsApi = Vulkan;
+ if (cmdLineParser.isSet(d3dOption))
+ graphicsApi = D3D11;
+ if (cmdLineParser.isSet(mtlOption))
+ graphicsApi = Metal;
+ if (cmdLineParser.isSet(nullOption))
+ graphicsApi = Null;
+
+ qDebug("Selected graphics API is %s", qPrintable(graphicsApiName()));
+ qDebug("This is a multi-api example, use command line arguments to override:\n%s", qPrintable(cmdLineParser.helpText()));
+
+ QRhi *r = nullptr;
+
+ if (graphicsApi == Null) {
+ QRhiNullInitParams params;
+ r = QRhi::create(QRhi::Null, &params);
+ }
+
+#if QT_CONFIG(vulkan)
+ QVulkanInstance inst;
+ if (graphicsApi == Vulkan) {
+ QLoggingCategory::setFilterRules(QStringLiteral("qt.vulkan=true"));
+#ifndef Q_OS_ANDROID
+ inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation");
+#else
+ inst.setLayers(QByteArrayList()
+ << "VK_LAYER_GOOGLE_threading"
+ << "VK_LAYER_LUNARG_parameter_validation"
+ << "VK_LAYER_LUNARG_object_tracker"
+ << "VK_LAYER_LUNARG_core_validation"
+ << "VK_LAYER_LUNARG_image"
+ << "VK_LAYER_LUNARG_swapchain"
+ << "VK_LAYER_GOOGLE_unique_objects");
+#endif
+ if (inst.create()) {
+ QRhiVulkanInitParams params;
+ params.inst = &inst;
+ r = QRhi::create(QRhi::Vulkan, &params);
+ } else {
+ qWarning("Failed to create Vulkan instance, switching to OpenGL");
+ graphicsApi = OpenGL;
+ }
+ }
+#endif
+
+#ifndef QT_NO_OPENGL
+ QScopedPointer<QOffscreenSurface> offscreenSurface;
+ if (graphicsApi == OpenGL) {
+ offscreenSurface.reset(QRhiGles2InitParams::newFallbackSurface());
+ QRhiGles2InitParams params;
+ params.fallbackSurface = offscreenSurface.data();
+ r = QRhi::create(QRhi::OpenGLES2, &params);
+ }
+#endif
+
+#ifdef Q_OS_WIN
+ if (graphicsApi == D3D11) {
+ QRhiD3D11InitParams params;
+ params.enableDebugLayer = true;
+ r = QRhi::create(QRhi::D3D11, &params);
+ }
+#endif
+
+#ifdef Q_OS_DARWIN
+ if (graphicsApi == Metal) {
+ QRhiMetalInitParams params;
+ r = QRhi::create(QRhi::Metal, &params);
+ }
+#endif
+
+ if (!r)
+ qFatal("Failed to initialize RHI");
+
+ QRhiTexture *tex = r->newTexture(QRhiTexture::RGBA8, QSize(1280, 720), 1, QRhiTexture::RenderTarget | QRhiTexture::UsedAsTransferSource);
+ tex->build();
+ QRhiTextureRenderTarget *rt = r->newTextureRenderTarget({ tex });
+ QRhiRenderPassDescriptor *rp = rt->newCompatibleRenderPassDescriptor();
+ rt->setRenderPassDescriptor(rp);
+ rt->build();
+
+ QMatrix4x4 proj = r->clipSpaceCorrMatrix();
+ proj.perspective(45.0f, 1280 / 720.f, 0.01f, 1000.0f);
+ proj.translate(0, 0, -4);
+
+ QRhiBuffer *vbuf = r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+ vbuf->build();
+
+ QRhiBuffer *ubuf = r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ ubuf->build();
+
+ QRhiShaderResourceBindings *srb = r->newShaderResourceBindings();
+ srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, ubuf)
+ });
+ srb->build();
+
+ QRhiGraphicsPipeline *ps = r->newGraphicsPipeline();
+
+ QRhiGraphicsPipeline::TargetBlend premulAlphaBlend;
+ premulAlphaBlend.enable = true;
+ ps->setTargetBlends({ premulAlphaBlend });
+
+ const QShader vs = getShader(QLatin1String(":/color.vert.qsb"));
+ if (!vs.isValid())
+ qFatal("Failed to load shader pack (vertex)");
+ const QShader fs = getShader(QLatin1String(":/color.frag.qsb"));
+ if (!fs.isValid())
+ qFatal("Failed to load shader pack (fragment)");
+
+ ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 5 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+
+ ps->setVertexInputLayout(inputLayout);
+ ps->setShaderResourceBindings(srb);
+ ps->setRenderPassDescriptor(rp);
+ ps->build();
+
+ int frame = 0;
+ for (; frame < 20; ++frame) {
+ QRhiCommandBuffer *cb;
+ if (r->beginOffscreenFrame(&cb) != QRhi::FrameOpSuccess)
+ break;
+
+ qDebug("Generating offscreen frame %d", frame);
+ QRhiResourceUpdateBatch *u = r->nextResourceUpdateBatch();
+ if (frame == 0)
+ u->uploadStaticBuffer(vbuf, vertexData);
+
+ static float rotation = 0.0f;
+ QMatrix4x4 mvp = proj;
+ mvp.rotate(rotation, 0, 1, 0);
+ u->updateDynamicBuffer(ubuf, 0, 64, mvp.constData());
+ rotation += 5.0f;
+ static float opacity = 1.0f;
+ static int opacityDir= 1;
+ u->updateDynamicBuffer(ubuf, 64, 4, &opacity);
+ opacity += opacityDir * 0.005f;
+ if (opacity < 0.0f || opacity > 1.0f) {
+ opacityDir *= -1;
+ opacity = qBound(0.0f, opacity, 1.0f);
+ }
+
+ cb->beginPass(rt, QColor::fromRgbF(0.0f, 1.0f, 0.0f, 1.0f), { 1, 0 }, u);
+ cb->setGraphicsPipeline(ps);
+ cb->setViewport({ 0, 0, 1280, 720 });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBinding(vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+
+ u = r->nextResourceUpdateBatch();
+ QRhiReadbackDescription rb(tex);
+ QRhiReadbackResult rbResult;
+ rbResult.completed = [frame] { qDebug(" - readback %d completed", frame); };
+ u->readBackTexture(rb, &rbResult);
+
+ cb->endPass(u);
+
+ qDebug("Submit and wait");
+#ifdef TEST_FINISH
+ r->finish();
+#else
+ r->endOffscreenFrame();
+#endif
+ // The data should be ready either because endOffscreenFrame() waits
+ // for completion or because finish() did.
+ if (!rbResult.data.isEmpty()) {
+ const uchar *p = reinterpret_cast<const uchar *>(rbResult.data.constData());
+ QImage image(p, rbResult.pixelSize.width(), rbResult.pixelSize.height(), QImage::Format_RGBA8888);
+ QString fn = QString::asprintf("frame%d.png", frame);
+ fn = QFileInfo(fn).absoluteFilePath();
+ qDebug("Saving into %s", qPrintable(fn));
+ if (r->isYUpInFramebuffer())
+ image.mirrored().save(fn);
+ else
+ image.save(fn);
+ } else {
+ qWarning("Readback failed!");
+ }
+#ifdef TEST_FINISH
+ r->endOffscreenFrame();
+#endif
+ }
+
+ delete ps;
+ delete srb;
+ delete ubuf;
+ delete vbuf;
+
+ delete rt;
+ delete rp;
+ delete tex;
+
+ delete r;
+
+ qDebug("\nRendered and read back %d frames using %s", frame, qPrintable(graphicsApiName()));
+
+ return 0;
+}
diff --git a/tests/manual/rhi/offscreen/offscreen.pro b/tests/manual/rhi/offscreen/offscreen.pro
new file mode 100644
index 0000000000..ae040a4b6c
--- /dev/null
+++ b/tests/manual/rhi/offscreen/offscreen.pro
@@ -0,0 +1,9 @@
+TEMPLATE = app
+CONFIG += console
+
+QT += gui-private
+
+SOURCES = \
+ offscreen.cpp
+
+RESOURCES = offscreen.qrc
diff --git a/tests/manual/rhi/offscreen/offscreen.qrc b/tests/manual/rhi/offscreen/offscreen.qrc
new file mode 100644
index 0000000000..8cec4fa9ec
--- /dev/null
+++ b/tests/manual/rhi/offscreen/offscreen.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="color.vert.qsb">../shared/color.vert.qsb</file>
+ <file alias="color.frag.qsb">../shared/color.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/qrhiprof/qrhiprof.cpp b/tests/manual/rhi/qrhiprof/qrhiprof.cpp
new file mode 100644
index 0000000000..7e3027a951
--- /dev/null
+++ b/tests/manual/rhi/qrhiprof/qrhiprof.cpp
@@ -0,0 +1,671 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+// Simple QRhiProfiler receiver app. Start it and then in a QRhi-based
+// application connect with a QTcpSocket to 127.0.0.1:30667 and set that as the
+// QRhiProfiler's device.
+
+#include <QTcpServer>
+#include <QTcpSocket>
+#include <QApplication>
+#include <QWidget>
+#include <QVBoxLayout>
+#include <QGroupBox>
+#include <QTextEdit>
+#include <QLabel>
+#include <QTime>
+#include <QtGui/private/qrhiprofiler_p.h>
+
+const int MIN_KNOWN_OP = 1;
+const int MAX_KNOWN_OP = 18;
+
+class Parser : public QObject
+{
+ Q_OBJECT
+
+public:
+ void feed(const QByteArray &line);
+
+ struct Event {
+ QRhiProfiler::StreamOp op;
+ qint64 timestamp;
+ quint64 resource;
+ QByteArray resourceName;
+
+ struct Param {
+ enum ValueType {
+ Int64,
+ Float
+ };
+ QByteArray key;
+ ValueType valueType;
+ union {
+ qint64 intValue;
+ float floatValue;
+ };
+ };
+
+ QVector<Param> params;
+
+ const Param *param(const char *key) const {
+ auto it = std::find_if(params.cbegin(), params.cend(), [key](const Param &p) {
+ return !strcmp(p.key.constData(), key);
+ });
+ return it == params.cend() ? nullptr : &*it;
+ }
+ };
+
+signals:
+ void eventReceived(const Event &e);
+};
+
+void Parser::feed(const QByteArray &line)
+{
+ const QList<QByteArray> elems = line.split(',');
+ if (elems.count() < 4) {
+ qWarning("Malformed line '%s'", line.constData());
+ return;
+ }
+ bool ok = false;
+ const int op = elems[0].toInt(&ok);
+ if (!ok) {
+ qWarning("Invalid op %s", elems[0].constData());
+ return;
+ }
+ if (op < MIN_KNOWN_OP || op > MAX_KNOWN_OP) {
+ qWarning("Unknown op %d", op);
+ return;
+ }
+
+ Event e;
+ e.op = QRhiProfiler::StreamOp(op);
+ e.timestamp = elems[1].toLongLong();
+ e.resource = elems[2].toULongLong();
+ e.resourceName = elems[3];
+
+ const int elemCount = elems.count();
+ for (int i = 4; i < elemCount; i += 2) {
+ if (i + 1 < elemCount && !elems[i].isEmpty() && !elems[i + 1].isEmpty()) {
+ QByteArray key = elems[i];
+ if (key.startsWith('F')) {
+ key = key.mid(1);
+ bool ok = false;
+ const float value = elems[i + 1].toFloat(&ok);
+ if (!ok) {
+ qWarning("Failed to parse float %s in line '%s'", elems[i + 1].constData(), line.constData());
+ continue;
+ }
+ Event::Param param;
+ param.key = key;
+ param.valueType = Event::Param::Float;
+ param.floatValue = value;
+ e.params.append(param);
+ } else {
+ const qint64 value = elems[i + 1].toLongLong();
+ Event::Param param;
+ param.key = key;
+ param.valueType = Event::Param::Int64;
+ param.intValue = value;
+ e.params.append(param);
+ }
+ }
+ }
+
+ emit eventReceived(e);
+}
+
+class Tracker : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void handleEvent(const Parser::Event &e);
+
+signals:
+ void buffersTouched();
+ void texturesTouched();
+ void swapchainsTouched();
+ void frameTimeTouched();
+ void gpuFrameTimeTouched();
+ void gpuMemAllocStatsTouched();
+
+public:
+ Tracker() {
+ reset();
+ }
+
+ static const int MAX_STAGING_SLOTS = 3;
+
+ struct Buffer {
+ Buffer()
+ {
+ memset(stagingExtraSize, 0, sizeof(stagingExtraSize));
+ }
+ quint64 lastTimestamp;
+ QByteArray resourceName;
+ qint64 effectiveSize = 0;
+ int backingGpuBufCount = 1;
+ qint64 stagingExtraSize[MAX_STAGING_SLOTS];
+ };
+ QHash<qint64, Buffer> m_buffers;
+ qint64 m_totalBufferApproxByteSize;
+ qint64 m_peakBufferApproxByteSize;
+ qint64 m_totalStagingBufferApproxByteSize;
+ qint64 m_peakStagingBufferApproxByteSize;
+
+ struct Texture {
+ Texture()
+ {
+ memset(stagingExtraSize, 0, sizeof(stagingExtraSize));
+ }
+ quint64 lastTimestamp;
+ QByteArray resourceName;
+ qint64 approxByteSize = 0;
+ bool ownsNativeResource = true;
+ qint64 stagingExtraSize[MAX_STAGING_SLOTS];
+ };
+ QHash<qint64, Texture> m_textures;
+ qint64 m_totalTextureApproxByteSize;
+ qint64 m_peakTextureApproxByteSize;
+ qint64 m_totalTextureStagingBufferApproxByteSize;
+ qint64 m_peakTextureStagingBufferApproxByteSize;
+
+ struct SwapChain {
+ quint64 lastTimestamp;
+ QByteArray resourceName;
+ qint64 approxByteSize = 0;
+ };
+ QHash<qint64, SwapChain> m_swapchains;
+ qint64 m_totalSwapChainApproxByteSize;
+ qint64 m_peakSwapChainApproxByteSize;
+
+ struct FrameTime {
+ qint64 framesSinceResize = 0;
+ int minDelta = 0;
+ int maxDelta = 0;
+ float avgDelta = 0;
+ };
+ FrameTime m_lastFrameTime;
+
+ struct GpuFrameTime {
+ float minTime = 0;
+ float maxTime = 0;
+ float avgTime = 0;
+ };
+ GpuFrameTime m_lastGpuFrameTime;
+
+ struct GpuMemAllocStats {
+ qint64 realAllocCount;
+ qint64 subAllocCount;
+ qint64 totalSize;
+ qint64 unusedSize;
+ };
+ GpuMemAllocStats m_lastGpuMemAllocStats;
+
+ void reset() {
+ m_buffers.clear();
+ m_textures.clear();
+ m_totalBufferApproxByteSize = 0;
+ m_peakBufferApproxByteSize = 0;
+ m_totalStagingBufferApproxByteSize = 0;
+ m_peakStagingBufferApproxByteSize = 0;
+ m_totalTextureApproxByteSize = 0;
+ m_peakTextureApproxByteSize = 0;
+ m_totalTextureStagingBufferApproxByteSize = 0;
+ m_peakTextureStagingBufferApproxByteSize = 0;
+ m_totalSwapChainApproxByteSize = 0;
+ m_peakSwapChainApproxByteSize = 0;
+ m_lastFrameTime = FrameTime();
+ m_lastGpuFrameTime = GpuFrameTime();
+ m_lastGpuMemAllocStats = GpuMemAllocStats();
+ emit buffersTouched();
+ emit texturesTouched();
+ emit swapchainsTouched();
+ emit frameTimeTouched();
+ emit gpuFrameTimeTouched();
+ emit gpuMemAllocStatsTouched();
+ }
+};
+
+Q_DECLARE_TYPEINFO(Tracker::Buffer, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(Tracker::Texture, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(Tracker::FrameTime, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(Tracker::GpuFrameTime, Q_MOVABLE_TYPE);
+
+void Tracker::handleEvent(const Parser::Event &e)
+{
+ switch (e.op) {
+ case QRhiProfiler::NewBuffer:
+ {
+ Buffer b;
+ b.lastTimestamp = e.timestamp;
+ b.resourceName = e.resourceName;
+ // type,0,usage,1,logical_size,84,effective_size,84,backing_gpu_buf_count,1,backing_cpu_buf_count,0
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("effective_size"))
+ b.effectiveSize = p.intValue;
+ else if (p.key == QByteArrayLiteral("backing_gpu_buf_count"))
+ b.backingGpuBufCount = p.intValue;
+ }
+ m_totalBufferApproxByteSize += b.effectiveSize * b.backingGpuBufCount;
+ m_peakBufferApproxByteSize = qMax(m_peakBufferApproxByteSize, m_totalBufferApproxByteSize);
+ m_buffers.insert(e.resource, b);
+ emit buffersTouched();
+ }
+ break;
+ case QRhiProfiler::ReleaseBuffer:
+ {
+ auto it = m_buffers.find(e.resource);
+ if (it != m_buffers.end()) {
+ m_totalBufferApproxByteSize -= it->effectiveSize * it->backingGpuBufCount;
+ m_buffers.erase(it);
+ emit buffersTouched();
+ }
+ }
+ break;
+
+ case QRhiProfiler::NewBufferStagingArea:
+ {
+ qint64 slot = -1;
+ qint64 size = 0;
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("slot"))
+ slot = p.intValue;
+ else if (p.key == QByteArrayLiteral("size"))
+ size = p.intValue;
+ }
+ if (slot >= 0 && slot < MAX_STAGING_SLOTS) {
+ auto it = m_buffers.find(e.resource);
+ if (it != m_buffers.end()) {
+ it->stagingExtraSize[slot] = size;
+ m_totalStagingBufferApproxByteSize += size;
+ m_peakStagingBufferApproxByteSize = qMax(m_peakStagingBufferApproxByteSize, m_totalStagingBufferApproxByteSize);
+ emit buffersTouched();
+ }
+ }
+ }
+ break;
+ case QRhiProfiler::ReleaseBufferStagingArea:
+ {
+ qint64 slot = -1;
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("slot"))
+ slot = p.intValue;
+ }
+ if (slot >= 0 && slot < MAX_STAGING_SLOTS) {
+ auto it = m_buffers.find(e.resource);
+ if (it != m_buffers.end()) {
+ m_totalStagingBufferApproxByteSize -= it->stagingExtraSize[slot];
+ it->stagingExtraSize[slot] = 0;
+ emit buffersTouched();
+ }
+ }
+ }
+ break;
+
+ case QRhiProfiler::NewTexture:
+ {
+ Texture t;
+ t.lastTimestamp = e.timestamp;
+ t.resourceName = e.resourceName;
+ // width,256,height,256,format,1,owns_native_resource,1,mip_count,9,layer_count,1,effective_sample_count,1,approx_byte_size,349524
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("approx_byte_size"))
+ t.approxByteSize = p.intValue;
+ else if (p.key == QByteArrayLiteral("owns_native_resource"))
+ t.ownsNativeResource = p.intValue;
+ }
+ if (t.ownsNativeResource) {
+ m_totalTextureApproxByteSize += t.approxByteSize;
+ m_peakTextureApproxByteSize = qMax(m_peakTextureApproxByteSize, m_totalTextureApproxByteSize);
+ }
+ m_textures.insert(e.resource, t);
+ emit texturesTouched();
+ }
+ break;
+ case QRhiProfiler::ReleaseTexture:
+ {
+ auto it = m_textures.find(e.resource);
+ if (it != m_textures.end()) {
+ if (it->ownsNativeResource)
+ m_totalTextureApproxByteSize -= it->approxByteSize;
+ m_textures.erase(it);
+ emit texturesTouched();
+ }
+ }
+ break;
+
+ case QRhiProfiler::NewTextureStagingArea:
+ {
+ qint64 slot = -1;
+ qint64 size = 0;
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("slot"))
+ slot = p.intValue;
+ else if (p.key == QByteArrayLiteral("size"))
+ size = p.intValue;
+ }
+ if (slot >= 0 && slot < MAX_STAGING_SLOTS) {
+ auto it = m_textures.find(e.resource);
+ if (it != m_textures.end()) {
+ it->stagingExtraSize[slot] = size;
+ m_totalTextureStagingBufferApproxByteSize += size;
+ m_peakTextureStagingBufferApproxByteSize = qMax(m_peakTextureStagingBufferApproxByteSize, m_totalTextureStagingBufferApproxByteSize);
+ emit texturesTouched();
+ }
+ }
+ }
+ break;
+ case QRhiProfiler::ReleaseTextureStagingArea:
+ {
+ qint64 slot = -1;
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("slot"))
+ slot = p.intValue;
+ }
+ if (slot >= 0 && slot < MAX_STAGING_SLOTS) {
+ auto it = m_textures.find(e.resource);
+ if (it != m_textures.end()) {
+ m_totalTextureStagingBufferApproxByteSize -= it->stagingExtraSize[slot];
+ it->stagingExtraSize[slot] = 0;
+ emit texturesTouched();
+ }
+ }
+ }
+ break;
+
+ case QRhiProfiler::ResizeSwapChain:
+ {
+ auto it = m_swapchains.find(e.resource);
+ if (it != m_swapchains.end())
+ m_totalSwapChainApproxByteSize -= it->approxByteSize;
+
+ SwapChain s;
+ s.lastTimestamp = e.timestamp;
+ s.resourceName = e.resourceName;
+ // width,1280,height,720,buffer_count,2,msaa_buffer_count,0,effective_sample_count,1,approx_total_byte_size,7372800
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("approx_total_byte_size"))
+ s.approxByteSize = p.intValue;
+ }
+ m_totalSwapChainApproxByteSize += s.approxByteSize;
+ m_peakSwapChainApproxByteSize = qMax(m_peakSwapChainApproxByteSize, m_totalSwapChainApproxByteSize);
+ m_swapchains.insert(e.resource, s);
+ emit swapchainsTouched();
+ }
+ break;
+ case QRhiProfiler::ReleaseSwapChain:
+ {
+ auto it = m_swapchains.find(e.resource);
+ if (it != m_swapchains.end()) {
+ m_totalSwapChainApproxByteSize -= it->approxByteSize;
+ m_swapchains.erase(it);
+ emit swapchainsTouched();
+ }
+ }
+ break;
+
+ case QRhiProfiler::GpuFrameTime:
+ {
+ // Fmin_ms_gpu_frame_time,0.15488,Fmax_ms_gpu_frame_time,0.494592,Favg_ms_gpu_frame_time,0.33462
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("min_ms_gpu_frame_time"))
+ m_lastGpuFrameTime.minTime = p.floatValue;
+ else if (p.key == QByteArrayLiteral("max_ms_gpu_frame_time"))
+ m_lastGpuFrameTime.maxTime = p.floatValue;
+ else if (p.key == QByteArrayLiteral("avg_ms_gpu_frame_time"))
+ m_lastGpuFrameTime.avgTime = p.floatValue;
+ }
+ emit gpuFrameTimeTouched();
+ }
+ break;
+ case QRhiProfiler::FrameToFrameTime:
+ {
+ // frames_since_resize,121,min_ms_frame_delta,9,max_ms_frame_delta,33,Favg_ms_frame_delta,16.1167
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("frames_since_resize"))
+ m_lastFrameTime.framesSinceResize = p.intValue;
+ else if (p.key == QByteArrayLiteral("min_ms_frame_delta"))
+ m_lastFrameTime.minDelta = p.intValue;
+ else if (p.key == QByteArrayLiteral("max_ms_frame_delta"))
+ m_lastFrameTime.maxDelta = p.intValue;
+ else if (p.key == QByteArrayLiteral("avg_ms_frame_delta"))
+ m_lastFrameTime.avgDelta = p.floatValue;
+ }
+ emit frameTimeTouched();
+ }
+ break;
+
+ case QRhiProfiler::GpuMemAllocStats:
+ {
+ // real_alloc_count,2,sub_alloc_count,154,total_size,10752,unused_size,50320896
+ for (const Parser::Event::Param &p : e.params) {
+ if (p.key == QByteArrayLiteral("real_alloc_count"))
+ m_lastGpuMemAllocStats.realAllocCount = p.intValue;
+ else if (p.key == QByteArrayLiteral("sub_alloc_count"))
+ m_lastGpuMemAllocStats.subAllocCount = p.intValue;
+ else if (p.key == QByteArrayLiteral("total_size"))
+ m_lastGpuMemAllocStats.totalSize = p.intValue;
+ else if (p.key == QByteArrayLiteral("unused_size"))
+ m_lastGpuMemAllocStats.unusedSize = p.intValue;
+ }
+ emit gpuMemAllocStatsTouched();
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+class Server : public QTcpServer
+{
+ Q_OBJECT
+
+protected:
+ void incomingConnection(qintptr socketDescriptor) override;
+
+signals:
+ void clientConnected();
+ void clientDisconnected();
+ void receiveStarted();
+ void lineReceived(const QByteArray &line);
+
+private:
+ bool m_valid = false;
+ QTcpSocket m_socket;
+ QByteArray m_buf;
+};
+
+void Server::incomingConnection(qintptr socketDescriptor)
+{
+ if (m_valid)
+ return;
+
+ m_socket.setSocketDescriptor(socketDescriptor);
+ m_valid = true;
+ emit clientConnected();
+ connect(&m_socket, &QAbstractSocket::readyRead, this, [this] {
+ bool receiveStartedSent = false;
+ m_buf += m_socket.readAll();
+ while (m_buf.contains('\n')) {
+ const int lfpos = m_buf.indexOf('\n');
+ const QByteArray line = m_buf.left(lfpos).trimmed();
+ m_buf = m_buf.mid(lfpos + 1);
+ if (!receiveStartedSent) {
+ receiveStartedSent = true;
+ emit receiveStarted();
+ }
+ emit lineReceived(line);
+ }
+ });
+ connect(&m_socket, &QAbstractSocket::disconnected, this, [this] {
+ if (m_valid) {
+ m_valid = false;
+ emit clientDisconnected();
+ }
+ });
+}
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ Tracker tracker;
+ Parser parser;
+ QObject::connect(&parser, &Parser::eventReceived, &tracker, &Tracker::handleEvent);
+
+ Server server;
+ if (!server.listen(QHostAddress::Any, 30667))
+ qFatal("Failed to start server: %s", qPrintable(server.errorString()));
+
+ QVBoxLayout *layout = new QVBoxLayout;
+
+ QLabel *infoLabel = new QLabel(QLatin1String("<i>Launch a Qt Quick application with QSG_RHI_PROFILE=1 and QSG_RHI_PROFILE_HOST set to the IP address.<br>"
+ "(resource memory usage reporting works best with the Vulkan backend)</i>"));
+ layout->addWidget(infoLabel);
+
+ QGroupBox *groupBox = new QGroupBox(QLatin1String("RHI statistics"));
+ QVBoxLayout *groupLayout = new QVBoxLayout;
+
+ QLabel *buffersLabel = new QLabel;
+ QObject::connect(&tracker, &Tracker::buffersTouched, buffersLabel, [buffersLabel, &tracker] {
+ const QString msg = QString::asprintf("%d buffers with ca. %lld bytes of current memory (sub)allocations (peak %lld) + %lld bytes of known staging buffers (peak %lld)",
+ tracker.m_buffers.count(),
+ tracker.m_totalBufferApproxByteSize, tracker.m_peakBufferApproxByteSize,
+ tracker.m_totalStagingBufferApproxByteSize, tracker.m_peakStagingBufferApproxByteSize);
+ buffersLabel->setText(msg);
+ });
+ groupLayout->addWidget(buffersLabel);
+
+ QLabel *texturesLabel = new QLabel;
+ QObject::connect(&tracker, &Tracker::texturesTouched, texturesLabel, [texturesLabel, &tracker] {
+ const QString msg = QString::asprintf("%d textures with ca. %lld bytes of current memory (sub)allocations (peak %lld) + %lld bytes of known staging buffers (peak %lld)",
+ tracker.m_textures.count(),
+ tracker.m_totalTextureApproxByteSize, tracker.m_peakTextureApproxByteSize,
+ tracker.m_totalTextureStagingBufferApproxByteSize, tracker.m_peakTextureStagingBufferApproxByteSize);
+ texturesLabel->setText(msg);
+ });
+ groupLayout->addWidget(texturesLabel);
+
+ QLabel *swapchainsLabel = new QLabel;
+ QObject::connect(&tracker, &Tracker::swapchainsTouched, swapchainsLabel, [swapchainsLabel, &tracker] {
+ const QString msg = QString::asprintf("Estimated total swapchain color buffer size is %lld bytes (peak %lld)",
+ tracker.m_totalSwapChainApproxByteSize, tracker.m_peakSwapChainApproxByteSize);
+ swapchainsLabel->setText(msg);
+ });
+ groupLayout->addWidget(swapchainsLabel);
+
+ QLabel *frameTimeLabel = new QLabel;
+ QObject::connect(&tracker, &Tracker::frameTimeTouched, frameTimeLabel, [frameTimeLabel, &tracker] {
+ const QString msg = QString::asprintf("Frames since resize %lld Frame delta min %d ms max %d ms avg %f ms",
+ tracker.m_lastFrameTime.framesSinceResize,
+ tracker.m_lastFrameTime.minDelta,
+ tracker.m_lastFrameTime.maxDelta,
+ tracker.m_lastFrameTime.avgDelta);
+ frameTimeLabel->setText(msg);
+ });
+ groupLayout->addWidget(frameTimeLabel);
+
+ QLabel *gpuFrameTimeLabel = new QLabel;
+ QObject::connect(&tracker, &Tracker::gpuFrameTimeTouched, gpuFrameTimeLabel, [gpuFrameTimeLabel, &tracker] {
+ const QString msg = QString::asprintf("GPU frame time min %f ms max %f ms avg %f ms",
+ tracker.m_lastGpuFrameTime.minTime,
+ tracker.m_lastGpuFrameTime.maxTime,
+ tracker.m_lastGpuFrameTime.avgTime);
+ gpuFrameTimeLabel->setText(msg);
+ });
+ groupLayout->addWidget(gpuFrameTimeLabel);
+
+ QLabel *gpuMemAllocStatsLabel = new QLabel;
+ QObject::connect(&tracker, &Tracker::gpuMemAllocStatsTouched, gpuMemAllocStatsLabel, [gpuMemAllocStatsLabel, &tracker] {
+ const QString msg = QString::asprintf("GPU memory allocator status: %lld real allocations %lld sub-allocations %lld total bytes %lld unused bytes",
+ tracker.m_lastGpuMemAllocStats.realAllocCount,
+ tracker.m_lastGpuMemAllocStats.subAllocCount,
+ tracker.m_lastGpuMemAllocStats.totalSize,
+ tracker.m_lastGpuMemAllocStats.unusedSize);
+ gpuMemAllocStatsLabel->setText(msg);
+ });
+ groupLayout->addWidget(gpuMemAllocStatsLabel);
+
+ groupBox->setLayout(groupLayout);
+ layout->addWidget(groupBox);
+
+ QTextEdit *rawLog = new QTextEdit;
+ rawLog->setReadOnly(true);
+ layout->addWidget(rawLog);
+
+ QObject::connect(&server, &Server::clientConnected, rawLog, [rawLog] {
+ rawLog->append(QLatin1String("\nCONNECTED\n"));
+ });
+ QObject::connect(&server, &Server::clientDisconnected, rawLog, [rawLog, &tracker] {
+ rawLog->append(QLatin1String("\nDISCONNECTED\n"));
+ tracker.reset();
+ });
+ QObject::connect(&server, &Server::receiveStarted, rawLog, [rawLog] {
+ rawLog->setFontItalic(true);
+ rawLog->append(QLatin1String("[") + QTime::currentTime().toString() + QLatin1String("]"));
+ rawLog->setFontItalic(false);
+ });
+
+ QObject::connect(&server, &Server::lineReceived, rawLog, [rawLog, &parser](const QByteArray &line) {
+ rawLog->append(QString::fromUtf8(line));
+ parser.feed(line);
+ });
+
+ QWidget w;
+ w.resize(800, 600);
+ w.setLayout(layout);
+ w.show();
+
+ return app.exec();
+}
+
+#include "qrhiprof.moc"
diff --git a/tests/manual/rhi/qrhiprof/qrhiprof.pro b/tests/manual/rhi/qrhiprof/qrhiprof.pro
new file mode 100644
index 0000000000..2939dd7ce2
--- /dev/null
+++ b/tests/manual/rhi/qrhiprof/qrhiprof.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+
+QT += network widgets gui-private
+
+SOURCES = \
+ qrhiprof.cpp
diff --git a/tests/manual/rhi/rhi.pro b/tests/manual/rhi/rhi.pro
new file mode 100644
index 0000000000..4768ee1c6d
--- /dev/null
+++ b/tests/manual/rhi/rhi.pro
@@ -0,0 +1,26 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ hellominimalcrossgfxtriangle \
+ compressedtexture_bc1 \
+ compressedtexture_bc1_subupload \
+ texuploads \
+ msaatexture \
+ msaarenderbuffer \
+ cubemap \
+ cubemap_scissor \
+ multiwindow \
+ multiwindow_threaded \
+ triquadcube \
+ offscreen \
+ floattexture \
+ mrt \
+ shadowmap \
+ computebuffer \
+ computeimage \
+ instancing
+
+qtConfig(widgets) {
+ SUBDIRS += \
+ qrhiprof
+}
diff --git a/tests/manual/rhi/shadowmap/buildshaders.bat b/tests/manual/rhi/shadowmap/buildshaders.bat
new file mode 100644
index 0000000000..7b84cc0952
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/buildshaders.bat
@@ -0,0 +1,4 @@
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 -c shadowmap.vert -o shadowmap.vert.qsb
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 -c shadowmap.frag -o shadowmap.frag.qsb
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 -c main.vert -o main.vert.qsb
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 -c main.frag -o main.frag.qsb
diff --git a/tests/manual/rhi/shadowmap/buildshaders.sh b/tests/manual/rhi/shadowmap/buildshaders.sh
new file mode 100755
index 0000000000..8991bb074a
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/buildshaders.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 shadowmap.vert -o shadowmap.vert.qsb
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 shadowmap.frag -o shadowmap.frag.qsb
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 main.vert -o main.vert.qsb
+qsb --glsl "120,300 es" --hlsl 50 --msl 12 main.frag -o main.frag.qsb
diff --git a/tests/manual/rhi/shadowmap/main.frag b/tests/manual/rhi/shadowmap/main.frag
new file mode 100644
index 0000000000..8fefe2bb42
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/main.frag
@@ -0,0 +1,30 @@
+#version 440
+
+layout(location = 0) in vec4 vLCVertPos;
+
+layout(location = 0) out vec4 fragColor;
+
+layout(binding = 1) uniform sampler2DShadow shadowMap;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ mat4 lightMvp;
+ mat4 shadowBias;
+ int useShadow;
+} ubuf;
+
+void main()
+{
+ vec4 adjustedLcVertPos = vLCVertPos;
+ adjustedLcVertPos.z -= 0.0001; // bias to avoid acne
+
+ // no textureProj, that seems to end up not doing the perspective divide for z (?)
+ vec3 v = adjustedLcVertPos.xyz / adjustedLcVertPos.w;
+ float sc = texture(shadowMap, v); // sampler is comparison enabled so compares to z
+
+ float shadowFactor = 0.2;
+ if (sc > 0 || ubuf.useShadow == 0)
+ shadowFactor = 1.0;
+
+ fragColor = vec4(0.5, 0.3 + ubuf.useShadow * 0.2, 0.7, 1.0) * shadowFactor;
+}
diff --git a/tests/manual/rhi/shadowmap/main.frag.qsb b/tests/manual/rhi/shadowmap/main.frag.qsb
new file mode 100644
index 0000000000..3001908b85
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/main.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/shadowmap/main.vert b/tests/manual/rhi/shadowmap/main.vert
new file mode 100644
index 0000000000..9d6cade634
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/main.vert
@@ -0,0 +1,20 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ mat4 lightMvp;
+ mat4 shadowBias;
+ int useShadow;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+layout(location = 0) out vec4 vLCVertPos;
+
+void main()
+{
+ vLCVertPos = ubuf.shadowBias * ubuf.lightMvp * position;
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/manual/rhi/shadowmap/main.vert.qsb b/tests/manual/rhi/shadowmap/main.vert.qsb
new file mode 100644
index 0000000000..8b81a93c00
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/main.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/shadowmap/shadowmap.cpp b/tests/manual/rhi/shadowmap/shadowmap.cpp
new file mode 100644
index 0000000000..424a8b3783
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.cpp
@@ -0,0 +1,304 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include "../shared/cube.h"
+
+// Depth texture / shadow sampler / shadow map example.
+// Not available on GLES 2.0.
+
+static float quadVertexData[] =
+{ // Y up, CCW, x-y-z
+ -0.5f, 0.5f, 0.0f,
+ -0.5f, -0.5f, 0.0f,
+ 0.5f, -0.5f, 0.0f,
+ 0.5f, 0.5f, 0.0f,
+};
+
+static quint16 quadIndexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+struct {
+ QVector<QRhiResource *> releasePool;
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ibuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiSampler *shadowSampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ QMatrix4x4 winProj;
+ float cubeRot = 0;
+
+ QRhiTextureRenderTarget *rt = nullptr;
+ QRhiRenderPassDescriptor *rtRp = nullptr;
+ QRhiTexture *shadowMap = nullptr;
+ QRhiShaderResourceBindings *shadowSrb = nullptr;
+ QRhiGraphicsPipeline *shadowPs = nullptr;
+} d;
+
+const int UBLOCK_SIZE = 64 * 3 + 4;
+const int SHADOW_UBLOCK_SIZE = 64 * 1;
+const int UBUF_SLOTS = 4; // 2 objects * 2 passes with different cameras
+
+void Window::customInit()
+{
+ if (!m_r->isTextureFormatSupported(QRhiTexture::D32F))
+ qFatal("Depth texture is not supported");
+
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(quadVertexData) + sizeof(cube));
+ d.vbuf->build();
+ d.releasePool << d.vbuf;
+
+ d.ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(quadIndexData));
+ d.ibuf->build();
+ d.releasePool << d.ibuf;
+
+ const int oneRoundedUniformBlockSize = m_r->ubufAligned(UBLOCK_SIZE);
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, UBUF_SLOTS * oneRoundedUniformBlockSize);
+ d.ubuf->build();
+ d.releasePool << d.ubuf;
+
+ d.shadowMap = m_r->newTexture(QRhiTexture::D32F, QSize(1024, 1024), 1, QRhiTexture::RenderTarget);
+ d.releasePool << d.shadowMap;
+ d.shadowMap->build();
+
+ d.shadowSampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.shadowSampler;
+ d.shadowSampler->setTextureCompareOp(QRhiSampler::Less);
+ d.shadowSampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+ const QRhiShaderResourceBinding::StageFlags stages = QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage;
+ d.srb->setBindings({ QRhiShaderResourceBinding::uniformBufferWithDynamicOffset(0, stages, d.ubuf, UBLOCK_SIZE),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.shadowMap, d.shadowSampler) });
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/main.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/main.frag.qsb")) }
+ });
+ d.ps->setDepthTest(true);
+ d.ps->setDepthWrite(true);
+ // fits both the quad and cube vertex data
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ });
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+ d.ps->build();
+
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, 0, sizeof(quadVertexData), quadVertexData);
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, sizeof(quadVertexData), sizeof(cube), cube);
+ d.initialUpdates->uploadStaticBuffer(d.ibuf, quadIndexData);
+
+ QRhiTextureRenderTargetDescription rtDesc;
+ rtDesc.setDepthTexture(d.shadowMap);
+ d.rt = m_r->newTextureRenderTarget(rtDesc);
+ d.releasePool << d.rt;
+ d.rtRp = d.rt->newCompatibleRenderPassDescriptor();
+ d.releasePool << d.rtRp;
+ d.rt->setRenderPassDescriptor(d.rtRp);
+ d.rt->build();
+
+ d.shadowSrb = m_r->newShaderResourceBindings();
+ d.releasePool << d.shadowSrb;
+ d.shadowSrb->setBindings({ QRhiShaderResourceBinding::uniformBufferWithDynamicOffset(0, stages, d.ubuf, SHADOW_UBLOCK_SIZE) });
+ d.shadowSrb->build();
+
+ d.shadowPs = m_r->newGraphicsPipeline();
+ d.releasePool << d.shadowPs;
+ d.shadowPs->setShaderStages({
+ { QRhiShaderStage::Vertex, getShader(QLatin1String(":/shadowmap.vert.qsb")) },
+ { QRhiShaderStage::Fragment, getShader(QLatin1String(":/shadowmap.frag.qsb")) }
+ });
+ d.shadowPs->setDepthTest(true);
+ d.shadowPs->setDepthWrite(true);
+ inputLayout.setBindings({
+ { 3 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 }
+ });
+ d.shadowPs->setVertexInputLayout(inputLayout);
+ d.shadowPs->setShaderResourceBindings(d.shadowSrb);
+ d.shadowPs->setRenderPassDescriptor(d.rtRp);
+ d.shadowPs->build();
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+static void enqueueScene(QRhiCommandBuffer *cb, QRhiShaderResourceBindings *srb, int oneRoundedUniformBlockSize, int firstUbufSlot)
+{
+ QRhiCommandBuffer::DynamicOffset ubufOffset(0, quint32(firstUbufSlot * oneRoundedUniformBlockSize));
+ // draw the ground (the quad)
+ cb->setShaderResources(srb, 1, &ubufOffset);
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding, d.ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ cb->drawIndexed(6);
+
+ // Draw the object (the cube). Both vertex and uniform data are in the same
+ // buffer, right after the quad's.
+ ubufOffset.second += oneRoundedUniformBlockSize;
+ cb->setShaderResources(srb, 1, &ubufOffset);
+ vbufBinding.second = sizeof(quadVertexData);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(36);
+}
+
+void Window::customRender()
+{
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ const int oneRoundedUniformBlockSize = m_r->ubufAligned(UBLOCK_SIZE);
+
+ QMatrix4x4 shadowBias;
+ // fill it in column-major order to keep our sanity (ctor would take row-major)
+ float *sbp = shadowBias.data();
+ if (m_r->isClipDepthZeroToOne()) {
+ // convert x, y [-1, 1] -> [0, 1]
+ *sbp++ = 0.5f; *sbp++ = 0.0f; *sbp++ = 0.0f; *sbp++ = 0.0f;
+ *sbp++ = 0.0f; *sbp++ = m_r->isYUpInNDC() ? -0.5f : 0.5f; *sbp++ = 0.0f; *sbp++ = 0.0f;
+ *sbp++ = 0.0f; *sbp++ = 0.0f; *sbp++ = 1.0f; *sbp++ = 0.0f;
+ *sbp++ = 0.5f; *sbp++ = 0.5f; *sbp++ = 0.0f; *sbp++ = 1.0f;
+ } else {
+ // convert x, y, z [-1, 1] -> [0, 1]
+ *sbp++ = 0.5f; *sbp++ = 0.0f; *sbp++ = 0.0f; *sbp++ = 0.0f;
+ *sbp++ = 0.0f; *sbp++ = 0.5f; *sbp++ = 0.0f; *sbp++ = 0.0f;
+ *sbp++ = 0.0f; *sbp++ = 0.0f; *sbp++ = 0.5f; *sbp++ = 0.0f;
+ *sbp++ = 0.5f; *sbp++ = 0.5f; *sbp++ = 0.5f; *sbp++ = 1.0f;
+ }
+
+ const QVector3D lightPos(5, 10, 10);
+ QMatrix4x4 lightViewProj = m_r->clipSpaceCorrMatrix();
+ lightViewProj.perspective(45.0f, 1, 0.1f, 100.0f);
+ lightViewProj.lookAt(lightPos, QVector3D(0, 0, 0), QVector3D(0, 1, 0));
+
+ // uniform data for the ground
+ if (d.winProj != m_proj) {
+ d.winProj = m_proj;
+
+ QMatrix4x4 m;
+ m.scale(4.0f);
+ m.rotate(-60, 1, 0, 0);
+
+ // for the main pass
+ const QMatrix4x4 mvp = m_proj * m; // m_proj is in fact projection * view
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+ const QMatrix4x4 shadowMvp = lightViewProj * m;
+ u->updateDynamicBuffer(d.ubuf, 64, 64, shadowMvp.constData());
+ u->updateDynamicBuffer(d.ubuf, 128, 64, shadowBias.constData());
+ qint32 useShadows = 1;
+ u->updateDynamicBuffer(d.ubuf, 192, 4, &useShadows);
+
+ // for the shadow pass
+ u->updateDynamicBuffer(d.ubuf, 2 * oneRoundedUniformBlockSize, 64, shadowMvp.constData());
+ }
+
+ // uniform data for the rotating cube
+ QMatrix4x4 m;
+ m.translate(0, 0.5f, 2);
+ m.scale(0.2f);
+ m.rotate(d.cubeRot, 0, 1, 0);
+ m.rotate(45, 1, 0, 0);
+ d.cubeRot += 1;
+
+ // for the main pass
+ const QMatrix4x4 mvp = m_proj * m;
+ u->updateDynamicBuffer(d.ubuf, oneRoundedUniformBlockSize, 64, mvp.constData());
+ const QMatrix4x4 shadowMvp = lightViewProj * m;
+ u->updateDynamicBuffer(d.ubuf, oneRoundedUniformBlockSize + 64, 64, shadowMvp.constData());
+ u->updateDynamicBuffer(d.ubuf, oneRoundedUniformBlockSize + 128, 64, shadowBias.constData());
+ qint32 useShadows = 0;
+ u->updateDynamicBuffer(d.ubuf, oneRoundedUniformBlockSize + 192, 4, &useShadows);
+
+ // for the shadow pass
+ u->updateDynamicBuffer(d.ubuf, 3 * oneRoundedUniformBlockSize, 64, shadowMvp.constData());
+
+ cb->resourceUpdate(u);
+
+ // shadow pass
+ const QSize shadowMapSize = d.shadowMap->pixelSize();
+ cb->beginPass(d.rt, QColor(), { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.shadowPs);
+ cb->setViewport({ 0, 0, float(shadowMapSize.width()), float(shadowMapSize.height()) });
+ enqueueScene(cb, d.shadowSrb, oneRoundedUniformBlockSize, 2);
+ cb->endPass();
+
+ // main pass
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 });
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ enqueueScene(cb, d.srb, oneRoundedUniformBlockSize, 0);
+ cb->endPass();
+}
diff --git a/tests/manual/rhi/shadowmap/shadowmap.frag b/tests/manual/rhi/shadowmap/shadowmap.frag
new file mode 100644
index 0000000000..fa868f31a2
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.frag
@@ -0,0 +1,5 @@
+#version 440
+
+void main()
+{
+}
diff --git a/tests/manual/rhi/shadowmap/shadowmap.frag.qsb b/tests/manual/rhi/shadowmap/shadowmap.frag.qsb
new file mode 100644
index 0000000000..3cad114cf4
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/shadowmap/shadowmap.pro b/tests/manual/rhi/shadowmap/shadowmap.pro
new file mode 100644
index 0000000000..baf740927c
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ shadowmap.cpp
+
+RESOURCES = shadowmap.qrc
diff --git a/tests/manual/rhi/shadowmap/shadowmap.qrc b/tests/manual/rhi/shadowmap/shadowmap.qrc
new file mode 100644
index 0000000000..8256d5ca25
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>shadowmap.vert.qsb</file>
+ <file>shadowmap.frag.qsb</file>
+ <file>main.vert.qsb</file>
+ <file>main.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/shadowmap/shadowmap.vert b/tests/manual/rhi/shadowmap/shadowmap.vert
new file mode 100644
index 0000000000..72b5370aec
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.vert
@@ -0,0 +1,14 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/manual/rhi/shadowmap/shadowmap.vert.qsb b/tests/manual/rhi/shadowmap/shadowmap.vert.qsb
new file mode 100644
index 0000000000..37a5e6ecbf
--- /dev/null
+++ b/tests/manual/rhi/shadowmap/shadowmap.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/shared/OpenfootageNET_fieldairport-512.hdr b/tests/manual/rhi/shared/OpenfootageNET_fieldairport-512.hdr
new file mode 100644
index 0000000000..abdebdb74b
--- /dev/null
+++ b/tests/manual/rhi/shared/OpenfootageNET_fieldairport-512.hdr
Binary files differ
diff --git a/tests/manual/rhi/shared/buildshaders.bat b/tests/manual/rhi/shared/buildshaders.bat
new file mode 100644
index 0000000000..dde5f7b3d2
--- /dev/null
+++ b/tests/manual/rhi/shared/buildshaders.bat
@@ -0,0 +1,5 @@
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c color.vert -o color.vert.qsb
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c color.frag -o color.frag.qsb
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c texture.vert -o texture.vert.qsb
+qsb --glsl "100 es,120" --hlsl 50 --msl 12 -c texture.frag -o texture.frag.qsb
+qsb --hlsl 50 --msl 12 -c texture_ms4.frag -o texture_ms4.frag.qsb
diff --git a/tests/manual/rhi/shared/bwqt224_64.png b/tests/manual/rhi/shared/bwqt224_64.png
new file mode 100644
index 0000000000..8020cbb2a8
--- /dev/null
+++ b/tests/manual/rhi/shared/bwqt224_64.png
Binary files differ
diff --git a/tests/manual/rhi/shared/bwqt224_64_nomips.dds b/tests/manual/rhi/shared/bwqt224_64_nomips.dds
new file mode 100644
index 0000000000..393cfec9db
--- /dev/null
+++ b/tests/manual/rhi/shared/bwqt224_64_nomips.dds
Binary files differ
diff --git a/tests/manual/rhi/shared/color.frag b/tests/manual/rhi/shared/color.frag
new file mode 100644
index 0000000000..bb94a5a605
--- /dev/null
+++ b/tests/manual/rhi/shared/color.frag
@@ -0,0 +1,15 @@
+#version 440
+
+layout(location = 0) in vec3 v_color;
+
+layout(location = 0) out vec4 fragColor;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ float opacity;
+} ubuf;
+
+void main()
+{
+ fragColor = vec4(v_color * ubuf.opacity, ubuf.opacity);
+}
diff --git a/tests/manual/rhi/shared/color.frag.qsb b/tests/manual/rhi/shared/color.frag.qsb
new file mode 100644
index 0000000000..3a965682eb
--- /dev/null
+++ b/tests/manual/rhi/shared/color.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/shared/color.vert b/tests/manual/rhi/shared/color.vert
new file mode 100644
index 0000000000..43af543f44
--- /dev/null
+++ b/tests/manual/rhi/shared/color.vert
@@ -0,0 +1,19 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 1) in vec3 color;
+
+layout(location = 0) out vec3 v_color;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ float opacity;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ v_color = color;
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/manual/rhi/shared/color.vert.qsb b/tests/manual/rhi/shared/color.vert.qsb
new file mode 100644
index 0000000000..e34eae79a0
--- /dev/null
+++ b/tests/manual/rhi/shared/color.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/shared/cube.h b/tests/manual/rhi/shared/cube.h
new file mode 100644
index 0000000000..252e80c56c
--- /dev/null
+++ b/tests/manual/rhi/shared/cube.h
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2015-2016 The Khronos Group Inc.
+ * Copyright (c) 2015-2016 Valve Corporation
+ * Copyright (c) 2015-2016 LunarG, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Author: Chia-I Wu <olv@lunarg.com>
+ * Author: Courtney Goeltzenleuchter <courtney@LunarG.com>
+ * Author: Ian Elliott <ian@LunarG.com>
+ * Author: Ian Elliott <ianelliott@google.com>
+ * Author: Jon Ashburn <jon@lunarg.com>
+ * Author: Gwan-gyeong Mun <elongbug@gmail.com>
+ * Author: Tony Barbour <tony@LunarG.com>
+ * Author: Bill Hollings <bill.hollings@brenwill.com>
+ */
+
+#ifndef CUBE_H
+#define CUBE_H
+
+// clang-format off
+static const float cube[] = {
+ -1.0f,-1.0f,-1.0f, // -X side
+ -1.0f,-1.0f, 1.0f,
+ -1.0f, 1.0f, 1.0f,
+ -1.0f, 1.0f, 1.0f,
+ -1.0f, 1.0f,-1.0f,
+ -1.0f,-1.0f,-1.0f,
+
+ -1.0f,-1.0f,-1.0f, // -Z side
+ 1.0f, 1.0f,-1.0f,
+ 1.0f,-1.0f,-1.0f,
+ -1.0f,-1.0f,-1.0f,
+ -1.0f, 1.0f,-1.0f,
+ 1.0f, 1.0f,-1.0f,
+
+ -1.0f,-1.0f,-1.0f, // -Y side
+ 1.0f,-1.0f,-1.0f,
+ 1.0f,-1.0f, 1.0f,
+ -1.0f,-1.0f,-1.0f,
+ 1.0f,-1.0f, 1.0f,
+ -1.0f,-1.0f, 1.0f,
+
+ -1.0f, 1.0f,-1.0f, // +Y side
+ -1.0f, 1.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f,
+ -1.0f, 1.0f,-1.0f,
+ 1.0f, 1.0f, 1.0f,
+ 1.0f, 1.0f,-1.0f,
+
+ 1.0f, 1.0f,-1.0f, // +X side
+ 1.0f, 1.0f, 1.0f,
+ 1.0f,-1.0f, 1.0f,
+ 1.0f,-1.0f, 1.0f,
+ 1.0f,-1.0f,-1.0f,
+ 1.0f, 1.0f,-1.0f,
+
+ -1.0f, 1.0f, 1.0f, // +Z side
+ -1.0f,-1.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f,
+ -1.0f,-1.0f, 1.0f,
+ 1.0f,-1.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f,
+
+ 0.0f, 1.0f, // -X side
+ 1.0f, 1.0f,
+ 1.0f, 0.0f,
+ 1.0f, 0.0f,
+ 0.0f, 0.0f,
+ 0.0f, 1.0f,
+
+ 1.0f, 1.0f, // -Z side
+ 0.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f,
+ 1.0f, 0.0f,
+ 0.0f, 0.0f,
+
+ 1.0f, 0.0f, // -Y side
+ 1.0f, 1.0f,
+ 0.0f, 1.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+ 0.0f, 0.0f,
+
+ 1.0f, 0.0f, // +Y side
+ 0.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f,
+
+ 1.0f, 0.0f, // +X side
+ 0.0f, 0.0f,
+ 0.0f, 1.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f,
+ 1.0f, 0.0f,
+
+ 0.0f, 0.0f, // +Z side
+ 0.0f, 1.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+ 1.0f, 1.0f,
+ 1.0f, 0.0f,
+};
+// clang-format on
+
+#endif
diff --git a/tests/manual/rhi/shared/dds_bc1.h b/tests/manual/rhi/shared/dds_bc1.h
new file mode 100644
index 0000000000..3c98a94cfc
--- /dev/null
+++ b/tests/manual/rhi/shared/dds_bc1.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+static const quint32 DDS_MAGIC = 0x20534444; // 'DDS '
+static const quint32 DDS_FOURCC = 4;
+
+#define FOURCC(c0, c1, c2, c3) ((c0) | ((c1) << 8) | ((c2) << 16) | ((c3 << 24)))
+
+struct DDS_PIXELFORMAT {
+ quint32 size;
+ quint32 flags;
+ quint32 fourCC;
+ quint32 rgbBitCount;
+ quint32 rBitMask;
+ quint32 gBitMask;
+ quint32 bBitMask;
+ quint32 aBitMask;
+};
+
+struct DDS_HEADER {
+ quint32 size;
+ quint32 flags;
+ quint32 height;
+ quint32 width;
+ quint32 pitch;
+ quint32 depth;
+ quint32 mipMapCount;
+ quint32 reserved1[11];
+ DDS_PIXELFORMAT pixelFormat;
+ quint32 caps;
+ quint32 caps2;
+ quint32 caps3;
+ quint32 caps4;
+ quint32 reserved2;
+};
+
+static quint32 bc1size(const QSize &size)
+{
+ static const quint32 blockSize = 8; // 8 bytes for BC1
+ const quint32 bytesPerLine = qMax<quint32>(1, (size.width() + 3) / 4) * blockSize;
+ const quint32 ySize = qMax<quint32>(1, (size.height() + 3) / 4);
+ return bytesPerLine * ySize;
+}
+
+static QByteArrayList loadBC1(const QString &filename, QSize *size)
+{
+ QFile f(filename);
+ if (!f.open(QIODevice::ReadOnly)) {
+ qWarning("Failed to open %s", qPrintable(filename));
+ return QByteArrayList();
+ }
+
+ quint32 magic = 0;
+ f.read(reinterpret_cast<char *>(&magic), sizeof(magic));
+ if (magic != DDS_MAGIC) {
+ qWarning("%s is not a DDS file", qPrintable(filename));
+ return QByteArrayList();
+ }
+ DDS_HEADER header;
+ f.read(reinterpret_cast<char *>(&header), sizeof(header));
+ if (header.size != sizeof(DDS_HEADER)) {
+ qWarning("Invalid DDS header size");
+ return QByteArrayList();
+ }
+ if (header.pixelFormat.size != sizeof(DDS_PIXELFORMAT)) {
+ qWarning("Invalid DDS pixel format size");
+ return QByteArrayList();
+ }
+ if (!(header.pixelFormat.flags & DDS_FOURCC)) {
+ qWarning("Invalid DDS pixel format");
+ return QByteArrayList();
+ }
+ if (header.pixelFormat.fourCC != FOURCC('D', 'X', 'T', '1')) {
+ qWarning("Only DXT1 (BC1) is supported");
+ return QByteArrayList();
+ }
+
+ QByteArrayList data;
+ QSize sz(header.width, header.height);
+ for (quint32 level = 0; level < header.mipMapCount; ++level) {
+ data.append(f.read(bc1size(sz)));
+ sz.setWidth(qMax(1, sz.width() / 2));
+ sz.setHeight(qMax(1, sz.height() / 2));
+ }
+
+ if (size)
+ *size = QSize(header.width, header.height);
+
+ return data;
+}
diff --git a/tests/manual/rhi/shared/examplefw.h b/tests/manual/rhi/shared/examplefw.h
new file mode 100644
index 0000000000..d28bbea0a8
--- /dev/null
+++ b/tests/manual/rhi/shared/examplefw.h
@@ -0,0 +1,583 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+// Adapted from hellominimalcrossgfxtriangle with the frame rendering stripped out.
+// Include this file and implement Window::customInit, release and render.
+// Debug/validation layer is enabled for D3D and Vulkan.
+
+#include <QGuiApplication>
+#include <QCommandLineParser>
+#include <QWindow>
+#include <QPlatformSurfaceEvent>
+#include <QElapsedTimer>
+#include <QTimer>
+#include <QLoggingCategory>
+
+#include <QtGui/private/qshader_p.h>
+#include <QFile>
+#include <QtGui/private/qrhiprofiler_p.h>
+#include <QtGui/private/qrhinull_p.h>
+
+#ifndef QT_NO_OPENGL
+#include <QtGui/private/qrhigles2_p.h>
+#include <QOffscreenSurface>
+#endif
+
+#if QT_CONFIG(vulkan)
+#include <QtGui/private/qrhivulkan_p.h>
+#endif
+
+#ifdef Q_OS_WIN
+#include <QtGui/private/qrhid3d11_p.h>
+#endif
+
+#ifdef Q_OS_DARWIN
+#include <QtGui/private/qrhimetal_p.h>
+#endif
+
+QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+enum GraphicsApi
+{
+ Null,
+ OpenGL,
+ Vulkan,
+ D3D11,
+ Metal
+};
+
+GraphicsApi graphicsApi;
+
+QString graphicsApiName()
+{
+ switch (graphicsApi) {
+ case Null:
+ return QLatin1String("Null (no output)");
+ case OpenGL:
+ return QLatin1String("OpenGL 2.x");
+ case Vulkan:
+ return QLatin1String("Vulkan");
+ case D3D11:
+ return QLatin1String("Direct3D 11");
+ case Metal:
+ return QLatin1String("Metal");
+ default:
+ break;
+ }
+ return QString();
+}
+
+QRhi::Flags rhiFlags = QRhi::EnableDebugMarkers;
+int sampleCount = 1;
+QRhiSwapChain::Flags scFlags = 0;
+QRhi::BeginFrameFlags beginFrameFlags = 0;
+QRhi::EndFrameFlags endFrameFlags = 0;
+int framesUntilTdr = -1;
+bool transparentBackground = false;
+
+class Window : public QWindow
+{
+public:
+ Window();
+ ~Window();
+
+protected:
+ void init();
+ void releaseResources();
+ void resizeSwapChain();
+ void releaseSwapChain();
+ void render();
+
+ void customInit();
+ void customRelease();
+ void customRender();
+
+ void exposeEvent(QExposeEvent *) override;
+ bool event(QEvent *) override;
+
+ bool m_running = false;
+ bool m_notExposed = false;
+ bool m_newlyExposed = false;
+
+ QRhi *m_r = nullptr;
+ bool m_hasSwapChain = false;
+ QRhiSwapChain *m_sc = nullptr;
+ QRhiRenderBuffer *m_ds = nullptr;
+ QRhiRenderPassDescriptor *m_rp = nullptr;
+
+ QMatrix4x4 m_proj;
+
+ QElapsedTimer m_timer;
+ int m_frameCount;
+
+#ifndef QT_NO_OPENGL
+ QOffscreenSurface *m_fallbackSurface = nullptr;
+#endif
+
+ QColor m_clearColor;
+
+ friend int main(int, char**);
+};
+
+Window::Window()
+{
+ // Tell the platform plugin what we want.
+ switch (graphicsApi) {
+ case OpenGL:
+#if QT_CONFIG(opengl)
+ setSurfaceType(OpenGLSurface);
+ setFormat(QRhiGles2InitParams::adjustedFormat());
+#endif
+ break;
+ case Vulkan:
+ setSurfaceType(VulkanSurface);
+ break;
+ case D3D11:
+ setSurfaceType(OpenGLSurface); // not a typo
+ break;
+ case Metal:
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
+ setSurfaceType(MetalSurface);
+#endif
+ break;
+ default:
+ break;
+ }
+
+ m_clearColor = transparentBackground ? Qt::transparent : QColor::fromRgbF(0.4f, 0.7f, 0.0f, 1.0f);
+}
+
+Window::~Window()
+{
+ releaseResources();
+}
+
+void Window::exposeEvent(QExposeEvent *)
+{
+ // initialize and start rendering when the window becomes usable for graphics purposes
+ if (isExposed() && !m_running) {
+ m_running = true;
+ init();
+ resizeSwapChain();
+ }
+
+ const QSize surfaceSize = m_hasSwapChain ? m_sc->surfacePixelSize() : QSize();
+
+ // stop pushing frames when not exposed (or size is 0)
+ if ((!isExposed() || (m_hasSwapChain && surfaceSize.isEmpty())) && m_running)
+ m_notExposed = true;
+
+ // continue when exposed again and the surface has a valid size.
+ // note that the surface size can be (0, 0) even though size() reports a valid one...
+ if (isExposed() && m_running && m_notExposed && !surfaceSize.isEmpty()) {
+ m_notExposed = false;
+ m_newlyExposed = true;
+ }
+
+ // always render a frame on exposeEvent() (when exposed) in order to update
+ // immediately on window resize.
+ if (isExposed() && !surfaceSize.isEmpty())
+ render();
+}
+
+bool Window::event(QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::UpdateRequest:
+ render();
+ break;
+
+ case QEvent::PlatformSurface:
+ // this is the proper time to tear down the swapchain (while the native window and surface are still around)
+ if (static_cast<QPlatformSurfaceEvent *>(e)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed)
+ releaseSwapChain();
+ break;
+
+ default:
+ break;
+ }
+
+ return QWindow::event(e);
+}
+
+void Window::init()
+{
+ if (graphicsApi == Null) {
+ QRhiNullInitParams params;
+ m_r = QRhi::create(QRhi::Null, &params, rhiFlags);
+ }
+
+#ifndef QT_NO_OPENGL
+ if (graphicsApi == OpenGL) {
+ m_fallbackSurface = QRhiGles2InitParams::newFallbackSurface();
+ QRhiGles2InitParams params;
+ params.fallbackSurface = m_fallbackSurface;
+ params.window = this;
+ m_r = QRhi::create(QRhi::OpenGLES2, &params, rhiFlags);
+ }
+#endif
+
+#if QT_CONFIG(vulkan)
+ if (graphicsApi == Vulkan) {
+ QRhiVulkanInitParams params;
+ params.inst = vulkanInstance();
+ params.window = this;
+ m_r = QRhi::create(QRhi::Vulkan, &params, rhiFlags);
+ }
+#endif
+
+#ifdef Q_OS_WIN
+ if (graphicsApi == D3D11) {
+ QRhiD3D11InitParams params;
+ params.enableDebugLayer = true;
+ if (framesUntilTdr > 0) {
+ params.framesUntilKillingDeviceViaTdr = framesUntilTdr;
+ params.repeatDeviceKill = true;
+ }
+ m_r = QRhi::create(QRhi::D3D11, &params, rhiFlags);
+ }
+#endif
+
+#ifdef Q_OS_DARWIN
+ if (graphicsApi == Metal) {
+ QRhiMetalInitParams params;
+ m_r = QRhi::create(QRhi::Metal, &params, rhiFlags);
+ }
+#endif
+
+ if (!m_r)
+ qFatal("Failed to create RHI backend");
+
+ // now onto the backend-independent init
+
+ m_sc = m_r->newSwapChain();
+ // allow depth-stencil, although we do not actually enable depth test/write for the triangle
+ m_ds = m_r->newRenderBuffer(QRhiRenderBuffer::DepthStencil,
+ QSize(), // no need to set the size here, due to UsedWithSwapChainOnly
+ sampleCount,
+ QRhiRenderBuffer::UsedWithSwapChainOnly);
+ m_sc->setWindow(this);
+ m_sc->setDepthStencil(m_ds);
+ m_sc->setSampleCount(sampleCount);
+ m_sc->setFlags(scFlags);
+ m_rp = m_sc->newCompatibleRenderPassDescriptor();
+ m_sc->setRenderPassDescriptor(m_rp);
+
+ customInit();
+}
+
+void Window::releaseResources()
+{
+ customRelease();
+
+ delete m_rp;
+ m_rp = nullptr;
+
+ delete m_ds;
+ m_ds = nullptr;
+
+ delete m_sc;
+ m_sc = nullptr;
+
+ delete m_r;
+ m_r = nullptr;
+
+#ifndef QT_NO_OPENGL
+ delete m_fallbackSurface;
+ m_fallbackSurface = nullptr;
+#endif
+}
+
+void Window::resizeSwapChain()
+{
+ m_hasSwapChain = m_sc->buildOrResize(); // also handles m_ds
+
+ m_frameCount = 0;
+ m_timer.restart();
+
+ const QSize outputSize = m_sc->currentPixelSize();
+ m_proj = m_r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, outputSize.width() / (float) outputSize.height(), 0.01f, 1000.0f);
+ m_proj.translate(0, 0, -4);
+}
+
+void Window::releaseSwapChain()
+{
+ if (m_hasSwapChain) {
+ m_hasSwapChain = false;
+ m_sc->release();
+ }
+}
+
+void Window::render()
+{
+ if (!m_hasSwapChain || m_notExposed)
+ return;
+
+ // If the window got resized or got newly exposed, resize the swapchain.
+ // (the newly-exposed case is not actually required by some
+ // platforms/backends, but f.ex. Vulkan on Windows seems to need it)
+ if (m_sc->currentPixelSize() != m_sc->surfacePixelSize() || m_newlyExposed) {
+ resizeSwapChain();
+ if (!m_hasSwapChain)
+ return;
+ m_newlyExposed = false;
+ }
+
+ // Start a new frame. This is where we block when too far ahead of
+ // GPU/present, and that's what throttles the thread to the refresh rate.
+ // (except for OpenGL where it happens either in endFrame or somewhere else
+ // depending on the GL implementation)
+ QRhi::FrameOpResult r = m_r->beginFrame(m_sc, beginFrameFlags);
+ if (r == QRhi::FrameOpSwapChainOutOfDate) {
+ resizeSwapChain();
+ if (!m_hasSwapChain)
+ return;
+ r = m_r->beginFrame(m_sc);
+ }
+ if (r != QRhi::FrameOpSuccess) {
+ requestUpdate();
+ return;
+ }
+
+ m_frameCount += 1;
+ if (m_timer.elapsed() > 1000) {
+ if (rhiFlags.testFlag(QRhi::EnableProfiling)) {
+ const QRhiProfiler::CpuTime ff = m_r->profiler()->frameToFrameTimes(m_sc);
+ const QRhiProfiler::CpuTime be = m_r->profiler()->frameBuildTimes(m_sc);
+ const QRhiProfiler::GpuTime gp = m_r->profiler()->gpuFrameTimes(m_sc);
+ if (m_r->isFeatureSupported(QRhi::Timestamps)) {
+ qDebug("ca. %d fps. "
+ "frame-to-frame: min %lld max %lld avg %f. "
+ "frame build: min %lld max %lld avg %f. "
+ "gpu frame time: min %f max %f avg %f",
+ m_frameCount,
+ ff.minTime, ff.maxTime, ff.avgTime,
+ be.minTime, be.maxTime, be.avgTime,
+ gp.minTime, gp.maxTime, gp.avgTime);
+ } else {
+ qDebug("ca. %d fps. "
+ "frame-to-frame: min %lld max %lld avg %f. "
+ "frame build: min %lld max %lld avg %f. ",
+ m_frameCount,
+ ff.minTime, ff.maxTime, ff.avgTime,
+ be.minTime, be.maxTime, be.avgTime);
+ }
+ } else {
+ qDebug("ca. %d fps", m_frameCount);
+ }
+
+ m_timer.restart();
+ m_frameCount = 0;
+ }
+
+ customRender();
+
+ m_r->endFrame(m_sc, endFrameFlags);
+
+ if (!scFlags.testFlag(QRhiSwapChain::NoVSync))
+ requestUpdate();
+ else // try prevent all delays when NoVSync
+ QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
+}
+
+int main(int argc, char **argv)
+{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QGuiApplication app(argc, argv);
+
+ QLoggingCategory::setFilterRules(QLatin1String("qt.rhi.*=true"));
+
+ // Defaults.
+#if defined(Q_OS_WIN)
+ graphicsApi = D3D11;
+#elif defined(Q_OS_DARWIN)
+ graphicsApi = Metal;
+#elif QT_CONFIG(vulkan)
+ graphicsApi = Vulkan;
+#else
+ graphicsApi = OpenGL;
+#endif
+
+ // Allow overriding via the command line.
+ QCommandLineParser cmdLineParser;
+ cmdLineParser.addHelpOption();
+ QCommandLineOption nullOption({ "n", "null" }, QLatin1String("Null"));
+ cmdLineParser.addOption(nullOption);
+ QCommandLineOption glOption({ "g", "opengl" }, QLatin1String("OpenGL (2.x)"));
+ cmdLineParser.addOption(glOption);
+ QCommandLineOption vkOption({ "v", "vulkan" }, QLatin1String("Vulkan"));
+ cmdLineParser.addOption(vkOption);
+ QCommandLineOption d3dOption({ "d", "d3d11" }, QLatin1String("Direct3D 11"));
+ cmdLineParser.addOption(d3dOption);
+ QCommandLineOption mtlOption({ "m", "metal" }, QLatin1String("Metal"));
+ cmdLineParser.addOption(mtlOption);
+ // Testing cleanup both with QWindow::close() (hitting X or Alt-F4) and
+ // QCoreApplication::quit() (e.g. what a menu widget would do) is important.
+ // Use this parameter for the latter.
+ QCommandLineOption sdOption({ "s", "self-destruct" }, QLatin1String("Self-destruct after 5 seconds."));
+ cmdLineParser.addOption(sdOption);
+ // Attempt testing device lost situations on D3D at least.
+ QCommandLineOption tdrOption(QLatin1String("curse"), QLatin1String("Curse the graphics device. "
+ "(generate a device reset every <count> frames when on D3D11)"),
+ QLatin1String("count"));
+ cmdLineParser.addOption(tdrOption);
+ // Allow testing preferring the software adapter (D3D).
+ QCommandLineOption swOption(QLatin1String("software"), QLatin1String("Prefer a software renderer when choosing the adapter. "
+ "Only applicable with some APIs and platforms."));
+ cmdLineParser.addOption(swOption);
+ // Allow testing having a semi-transparent window.
+ QCommandLineOption transparentOption(QLatin1String("transparent"), QLatin1String("Make background transparent"));
+ cmdLineParser.addOption(transparentOption);
+
+ cmdLineParser.process(app);
+ if (cmdLineParser.isSet(nullOption))
+ graphicsApi = Null;
+ if (cmdLineParser.isSet(glOption))
+ graphicsApi = OpenGL;
+ if (cmdLineParser.isSet(vkOption))
+ graphicsApi = Vulkan;
+ if (cmdLineParser.isSet(d3dOption))
+ graphicsApi = D3D11;
+ if (cmdLineParser.isSet(mtlOption))
+ graphicsApi = Metal;
+
+ qDebug("Selected graphics API is %s", qPrintable(graphicsApiName()));
+ qDebug("This is a multi-api example, use command line arguments to override:\n%s", qPrintable(cmdLineParser.helpText()));
+
+ if (cmdLineParser.isSet(transparentOption)) {
+ transparentBackground = true;
+ scFlags |= QRhiSwapChain::SurfaceHasPreMulAlpha;
+ }
+
+#ifdef EXAMPLEFW_PREINIT
+ void preInit();
+ preInit();
+#endif
+
+ // OpenGL specifics.
+ QSurfaceFormat fmt;
+ fmt.setDepthBufferSize(24);
+ fmt.setStencilBufferSize(8);
+ if (sampleCount > 1)
+ fmt.setSamples(sampleCount);
+ if (scFlags.testFlag(QRhiSwapChain::NoVSync))
+ fmt.setSwapInterval(0);
+ if (scFlags.testFlag(QRhiSwapChain::sRGB))
+ fmt.setColorSpace(QSurfaceFormat::sRGBColorSpace);
+ // Exception: The alpha size is not necessarily OpenGL specific.
+ if (transparentBackground)
+ fmt.setAlphaBufferSize(8);
+ QSurfaceFormat::setDefaultFormat(fmt);
+
+ // Vulkan setup.
+#if QT_CONFIG(vulkan)
+ QVulkanInstance inst;
+ if (graphicsApi == Vulkan) {
+#ifndef Q_OS_ANDROID
+ inst.setLayers(QByteArrayList() << "VK_LAYER_LUNARG_standard_validation");
+#else
+ inst.setLayers(QByteArrayList()
+ << "VK_LAYER_GOOGLE_threading"
+ << "VK_LAYER_LUNARG_parameter_validation"
+ << "VK_LAYER_LUNARG_object_tracker"
+ << "VK_LAYER_LUNARG_core_validation"
+ << "VK_LAYER_LUNARG_image"
+ << "VK_LAYER_LUNARG_swapchain"
+ << "VK_LAYER_GOOGLE_unique_objects");
+#endif
+ inst.setExtensions(QByteArrayList()
+ << "VK_KHR_get_physical_device_properties2");
+ if (!inst.create()) {
+ qWarning("Failed to create Vulkan instance, switching to OpenGL");
+ graphicsApi = OpenGL;
+ }
+ }
+#endif
+
+ if (cmdLineParser.isSet(tdrOption))
+ framesUntilTdr = cmdLineParser.value(tdrOption).toInt();
+
+ if (cmdLineParser.isSet(swOption))
+ rhiFlags |= QRhi::PreferSoftwareRenderer;
+
+ // Create and show the window.
+ Window w;
+#if QT_CONFIG(vulkan)
+ if (graphicsApi == Vulkan)
+ w.setVulkanInstance(&inst);
+#endif
+ w.resize(1280, 720);
+ w.setTitle(QCoreApplication::applicationName() + QLatin1String(" - ") + graphicsApiName());
+ w.show();
+
+ if (cmdLineParser.isSet(sdOption))
+ QTimer::singleShot(5000, qGuiApp, SLOT(quit()));
+
+ int ret = app.exec();
+
+ // Window::event() will not get invoked when the
+ // PlatformSurfaceAboutToBeDestroyed event is sent during the QWindow
+ // destruction. That happens only when exiting via app::quit() instead of
+ // the more common QWindow::close(). Take care of it: if the
+ // QPlatformWindow is still around (there was no close() yet), get rid of
+ // the swapchain while it's not too late.
+ if (w.handle())
+ w.releaseSwapChain();
+
+ return ret;
+}
diff --git a/tests/manual/rhi/shared/qt256.png b/tests/manual/rhi/shared/qt256.png
new file mode 100644
index 0000000000..30c621c9c6
--- /dev/null
+++ b/tests/manual/rhi/shared/qt256.png
Binary files differ
diff --git a/tests/manual/rhi/shared/qt256_bc1_9mips.dds b/tests/manual/rhi/shared/qt256_bc1_9mips.dds
new file mode 100644
index 0000000000..734a5d184f
--- /dev/null
+++ b/tests/manual/rhi/shared/qt256_bc1_9mips.dds
Binary files differ
diff --git a/tests/manual/rhi/shared/texture.frag b/tests/manual/rhi/shared/texture.frag
new file mode 100644
index 0000000000..5405444c68
--- /dev/null
+++ b/tests/manual/rhi/shared/texture.frag
@@ -0,0 +1,18 @@
+#version 440
+
+layout(location = 0) in vec2 v_texcoord;
+
+layout(location = 0) out vec4 fragColor;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ int flip;
+} ubuf;
+
+layout(binding = 1) uniform sampler2D tex;
+
+void main()
+{
+ vec4 c = texture(tex, v_texcoord);
+ fragColor = vec4(c.rgb * c.a, c.a);
+}
diff --git a/tests/manual/rhi/shared/texture.frag.qsb b/tests/manual/rhi/shared/texture.frag.qsb
new file mode 100644
index 0000000000..31bcd7105e
--- /dev/null
+++ b/tests/manual/rhi/shared/texture.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/shared/texture.vert b/tests/manual/rhi/shared/texture.vert
new file mode 100644
index 0000000000..ad7e783dfb
--- /dev/null
+++ b/tests/manual/rhi/shared/texture.vert
@@ -0,0 +1,21 @@
+#version 440
+
+layout(location = 0) in vec4 position;
+layout(location = 1) in vec2 texcoord;
+
+layout(location = 0) out vec2 v_texcoord;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ int flip;
+} ubuf;
+
+out gl_PerVertex { vec4 gl_Position; };
+
+void main()
+{
+ v_texcoord = vec2(texcoord.x, texcoord.y);
+ if (ubuf.flip != 0)
+ v_texcoord.y = 1.0 - v_texcoord.y;
+ gl_Position = ubuf.mvp * position;
+}
diff --git a/tests/manual/rhi/shared/texture.vert.qsb b/tests/manual/rhi/shared/texture.vert.qsb
new file mode 100644
index 0000000000..1b9e52890d
--- /dev/null
+++ b/tests/manual/rhi/shared/texture.vert.qsb
Binary files differ
diff --git a/tests/manual/rhi/shared/texture_ms4.frag b/tests/manual/rhi/shared/texture_ms4.frag
new file mode 100644
index 0000000000..d4f2bd3654
--- /dev/null
+++ b/tests/manual/rhi/shared/texture_ms4.frag
@@ -0,0 +1,20 @@
+#version 440
+
+layout(location = 0) in vec2 v_texcoord;
+
+layout(location = 0) out vec4 fragColor;
+
+layout(std140, binding = 0) uniform buf {
+ mat4 mvp;
+ int flip;
+} ubuf;
+
+layout(binding = 1) uniform sampler2DMS tex;
+
+void main()
+{
+ ivec2 tc = ivec2(floor(vec2(textureSize(tex)) * v_texcoord));
+ vec4 c = texelFetch(tex, tc, 0) + texelFetch(tex, tc, 1) + texelFetch(tex, tc, 2) + texelFetch(tex, tc, 3);
+ c /= 4.0;
+ fragColor = vec4(c.rgb * c.a, c.a);
+}
diff --git a/tests/manual/rhi/shared/texture_ms4.frag.qsb b/tests/manual/rhi/shared/texture_ms4.frag.qsb
new file mode 100644
index 0000000000..7f187ce7f0
--- /dev/null
+++ b/tests/manual/rhi/shared/texture_ms4.frag.qsb
Binary files differ
diff --git a/tests/manual/rhi/texuploads/texuploads.cpp b/tests/manual/rhi/texuploads/texuploads.cpp
new file mode 100644
index 0000000000..4c10a6b965
--- /dev/null
+++ b/tests/manual/rhi/texuploads/texuploads.cpp
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "../shared/examplefw.h"
+#include "../shared/cube.h"
+#include <QPainter>
+
+struct {
+ QRhiBuffer *vbuf = nullptr;
+ QRhiBuffer *ubuf = nullptr;
+ QRhiTexture *tex = nullptr;
+ QRhiSampler *sampler = nullptr;
+ QRhiShaderResourceBindings *srb = nullptr;
+ QRhiGraphicsPipeline *ps = nullptr;
+ QVector<QRhiResource *> releasePool;
+
+ float rotation = 0;
+ QRhiResourceUpdateBatch *initialUpdates = nullptr;
+ int frameCount = 0;
+ QImage customImage;
+ QRhiTexture *newTex = nullptr;
+ QRhiTexture *importedTex = nullptr;
+ int testStage = 0;
+
+ QRhiShaderResourceBinding bindings[2];
+} d;
+
+void Window::customInit()
+{
+ d.vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ d.releasePool << d.vbuf;
+ d.vbuf->build();
+
+ d.ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ d.releasePool << d.ubuf;
+ d.ubuf->build();
+
+ QImage baseImage(QLatin1String(":/qt256.png"));
+ d.tex = m_r->newTexture(QRhiTexture::RGBA8, baseImage.size(), 1, QRhiTexture::UsedAsTransferSource);
+ d.releasePool << d.tex;
+ d.tex->build();
+
+ // As an alternative to what some of the other examples do, prepare an
+ // update batch right here instead of relying on vbufReady and similar flags.
+ d.initialUpdates = m_r->nextResourceUpdateBatch();
+ d.initialUpdates->uploadStaticBuffer(d.vbuf, cube);
+ qint32 flip = 0;
+ d.initialUpdates->updateDynamicBuffer(d.ubuf, 64, 4, &flip);
+ d.initialUpdates->uploadTexture(d.tex, baseImage);
+
+ d.sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ d.releasePool << d.sampler;
+ d.sampler->build();
+
+ d.srb = m_r->newShaderResourceBindings();
+ d.releasePool << d.srb;
+
+ d.bindings[0] = QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, d.ubuf);
+ d.bindings[1] = QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.tex, d.sampler);
+ d.srb->setBindings(d.bindings, d.bindings + 2);
+ d.srb->build();
+
+ d.ps = m_r->newGraphicsPipeline();
+ d.releasePool << d.ps;
+
+ d.ps->setDepthTest(true);
+ d.ps->setDepthWrite(true);
+ d.ps->setDepthOp(QRhiGraphicsPipeline::Less);
+
+ d.ps->setCullMode(QRhiGraphicsPipeline::Back);
+ d.ps->setFrontFace(QRhiGraphicsPipeline::CCW);
+
+ const QShader vs = getShader(QLatin1String(":/texture.vert.qsb"));
+ if (!vs.isValid())
+ qFatal("Failed to load shader pack (vertex)");
+ const QShader fs = getShader(QLatin1String(":/texture.frag.qsb"));
+ if (!fs.isValid())
+ qFatal("Failed to load shader pack (fragment)");
+
+ d.ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+
+ d.ps->setVertexInputLayout(inputLayout);
+ d.ps->setShaderResourceBindings(d.srb);
+ d.ps->setRenderPassDescriptor(m_rp);
+
+ d.ps->build();
+
+ d.customImage = QImage(128, 64, QImage::Format_RGBA8888);
+ d.customImage.fill(Qt::red);
+ QPainter painter(&d.customImage);
+ // the text may look different on different platforms, so no guarantee the
+ // output on the screen will be identical everywhere
+ painter.drawText(5, 25, "Hello world");
+ painter.end();
+}
+
+void Window::customRelease()
+{
+ qDeleteAll(d.releasePool);
+ d.releasePool.clear();
+}
+
+void Window::customRender()
+{
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+
+ // take the initial set of updates, if this is the first frame
+ if (d.initialUpdates) {
+ u->merge(d.initialUpdates);
+ d.initialUpdates->release();
+ d.initialUpdates = nullptr;
+ }
+
+ d.rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.scale(0.5f);
+ mvp.rotate(d.rotation, 0, 1, 0);
+ u->updateDynamicBuffer(d.ubuf, 0, 64, mvp.constData());
+
+ if (d.frameCount > 0 && (d.frameCount % 100) == 0) {
+ d.testStage += 1;
+ qDebug("testStage = %d", d.testStage);
+
+ // Partially change the texture.
+ if (d.testStage == 1) {
+ QRhiTextureSubresourceUploadDescription mipDesc(d.customImage);
+ // The image here is smaller than the original. Use a non-zero position
+ // to make it more interesting.
+ mipDesc.setDestinationTopLeft(QPoint(100, 20));
+ QRhiTextureUploadDescription desc({ 0, 0, mipDesc });
+ u->uploadTexture(d.tex, desc);
+ }
+
+ // Exercise image copying.
+ if (d.testStage == 2) {
+ const QSize sz = d.tex->pixelSize();
+ d.newTex = m_r->newTexture(QRhiTexture::RGBA8, sz);
+ d.releasePool << d.newTex;
+ d.newTex->build();
+
+ QImage empty(sz.width(), sz.height(), QImage::Format_RGBA8888);
+ empty.fill(Qt::blue);
+ u->uploadTexture(d.newTex, empty);
+
+ // Copy the left-half of tex to the right-half of newTex, while
+ // leaving the left-half of newTex blue. Keep a 20 pixel gap at
+ // the top.
+ QRhiTextureCopyDescription desc;
+ desc.setSourceTopLeft(QPoint(0, 20));
+ desc.setPixelSize(QSize(sz.width() / 2, sz.height() - 20));
+ desc.setDestinationTopLeft(QPoint(sz.width() / 2, 20));
+ u->copyTexture(d.newTex, d.tex, desc);
+
+ // Now replace d.tex with d.newTex as the shader resource.
+ d.bindings[1] = QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.newTex, d.sampler);
+ d.srb->setBindings(d.bindings, d.bindings + 2);
+ // "rebuild", whatever that means for a given backend. This srb is
+ // already live as the ps in the setGraphicsPipeline references it,
+ // but that's fine. Changes will be picked up automatically.
+ d.srb->build();
+ }
+
+ // Exercise simple, full texture copy.
+ if (d.testStage == 4)
+ u->copyTexture(d.newTex, d.tex);
+
+ // Now again upload customImage but this time only a part of it.
+ if (d.testStage == 5) {
+ QRhiTextureSubresourceUploadDescription mipDesc(d.customImage);
+ mipDesc.setDestinationTopLeft(QPoint(10, 120));
+ mipDesc.setSourceSize(QSize(50, 40));
+ mipDesc.setSourceTopLeft(QPoint(20, 10));
+ QRhiTextureUploadDescription desc({ 0, 0, mipDesc });
+ u->uploadTexture(d.newTex, desc);
+ }
+
+ // Exercise texture object export/import.
+ if (d.testStage == 6) {
+ const QRhiNativeHandles *h = d.tex->nativeHandles();
+ if (h) {
+#ifdef Q_OS_DARWIN
+ if (graphicsApi == Metal) {
+ qDebug() << "Metal texture: " << static_cast<const QRhiMetalTextureNativeHandles *>(h)->texture;
+ // Now could cast to id<MTLTexture> and do something with
+ // it, keeping in mind that copy operations are only done
+ // in beginPass, while rendering into a texture may only
+ // have proper results in current_frame + 2, or after a
+ // finish(). The QRhiTexture still owns the native object.
+ }
+#endif
+ // omit for other backends, the idea is the same
+
+ d.importedTex = m_r->newTexture(QRhiTexture::RGBA8, d.tex->pixelSize());
+ d.releasePool << d.importedTex;
+ if (!d.importedTex->buildFrom(h))
+ qWarning("Texture import failed");
+
+ // now d.tex and d.importedTex use the same MTLTexture
+ // underneath (owned by d.tex)
+
+ // switch to showing d.importedTex
+ d.bindings[1] = QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.importedTex, d.sampler);
+ d.srb->setBindings(d.bindings, d.bindings + 2);
+ d.srb->build();
+ } else {
+ qWarning("Accessing native texture object is not supported");
+ }
+ }
+
+ // Exercise uploading uncompressed data without a QImage.
+ if (d.testStage == 7) {
+ d.bindings[1] = QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, d.newTex, d.sampler);
+ d.srb->setBindings(d.bindings, d.bindings + 2);
+ d.srb->build();
+
+ const QSize sz(221, 139);
+ QByteArray data;
+ data.resize(sz.width() * sz.height() * 4);
+ for (int y = 0; y < sz.height(); ++y) {
+ uchar *p = reinterpret_cast<uchar *>(data.data()) + y * sz.width() * 4;
+ for (int x = 0; x < sz.width(); ++x) {
+ *p++ = 0; *p++ = 0; *p++ = y * (255 / sz.height());
+ *p++ = 255;
+ }
+ }
+ QRhiTextureSubresourceUploadDescription mipDesc(data.constData(), data.size());
+ mipDesc.setSourceSize(sz);
+ mipDesc.setDestinationTopLeft(QPoint(5, 25));
+ QRhiTextureUploadDescription desc({ 0, 0, mipDesc });
+ u->uploadTexture(d.newTex, desc);
+ }
+ }
+
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+ const QSize outputSizeInPixels = m_sc->currentPixelSize();
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+
+ cb->setGraphicsPipeline(d.ps);
+ cb->setViewport({ 0, 0, float(outputSizeInPixels.width()), float(outputSizeInPixels.height()) });
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { d.vbuf, 0 },
+ { d.vbuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ cb->draw(36);
+
+ cb->endPass();
+
+ d.frameCount += 1;
+}
diff --git a/tests/manual/rhi/texuploads/texuploads.pro b/tests/manual/rhi/texuploads/texuploads.pro
new file mode 100644
index 0000000000..64f204fb32
--- /dev/null
+++ b/tests/manual/rhi/texuploads/texuploads.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ texuploads.cpp
+
+RESOURCES = texuploads.qrc
diff --git a/tests/manual/rhi/texuploads/texuploads.qrc b/tests/manual/rhi/texuploads/texuploads.qrc
new file mode 100644
index 0000000000..742b2b77af
--- /dev/null
+++ b/tests/manual/rhi/texuploads/texuploads.qrc
@@ -0,0 +1,7 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="qt256.png">../shared/qt256.png</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/rhi/triquadcube/quadrenderer.cpp b/tests/manual/rhi/triquadcube/quadrenderer.cpp
new file mode 100644
index 0000000000..6137fb1b9a
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/quadrenderer.cpp
@@ -0,0 +1,148 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "quadrenderer.h"
+#include <QFile>
+#include <QtGui/private/qshader_p.h>
+
+// Renders a quad using indexed drawing. No QRhiGraphicsPipeline is created, it
+// expects to reuse the one created by TriangleRenderer. A separate
+// QRhiShaderResourceBindings is still needed, this will override the one the
+// QRhiGraphicsPipeline references.
+
+static float vertexData[] =
+{ // Y up (note m_proj), CCW
+ -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f,
+ 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f
+};
+
+static quint16 indexData[] =
+{
+ 0, 1, 2, 0, 2, 3
+};
+
+void QuadRenderer::initResources(QRhiRenderPassDescriptor *)
+{
+ m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+ m_vbuf->build();
+ m_vbufReady = false;
+
+ m_ibuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::IndexBuffer, sizeof(indexData));
+ m_ibuf->build();
+
+ m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ m_ubuf->build();
+
+ m_srb = m_r->newShaderResourceBindings();
+ m_srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf)
+ });
+ m_srb->build();
+}
+
+void QuadRenderer::setPipeline(QRhiGraphicsPipeline *ps)
+{
+ m_ps = ps;
+}
+
+void QuadRenderer::resize(const QSize &pixelSize)
+{
+ m_proj = m_r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, pixelSize.width() / (float) pixelSize.height(), 0.01f, 100.0f);
+ m_proj.translate(0, 0, -4);
+}
+
+void QuadRenderer::releaseResources()
+{
+ delete m_srb;
+ m_srb = nullptr;
+
+ delete m_ubuf;
+ m_ubuf = nullptr;
+
+ delete m_ibuf;
+ m_ibuf = nullptr;
+
+ delete m_vbuf;
+ m_vbuf = nullptr;
+}
+
+void QuadRenderer::queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (!m_vbufReady) {
+ m_vbufReady = true;
+ resourceUpdates->uploadStaticBuffer(m_vbuf, vertexData);
+ resourceUpdates->uploadStaticBuffer(m_ibuf, indexData);
+ }
+
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.translate(m_translation);
+ mvp.rotate(m_rotation, 0, 1, 0);
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
+
+ if (!m_opacityReady) {
+ m_opacityReady = true;
+ const float opacity = 1.0f;
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 64, 4, &opacity);
+ }
+}
+
+void QuadRenderer::queueDraw(QRhiCommandBuffer *cb, const QSize &/*outputSizeInPixels*/)
+{
+ cb->setGraphicsPipeline(m_ps);
+ //cb->setViewport(QRhiViewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()));
+ cb->setShaderResources(m_srb);
+ const QRhiCommandBuffer::VertexInput vbufBinding(m_vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding, m_ibuf, 0, QRhiCommandBuffer::IndexUInt16);
+ cb->drawIndexed(6);
+}
diff --git a/tests/manual/rhi/triquadcube/quadrenderer.h b/tests/manual/rhi/triquadcube/quadrenderer.h
new file mode 100644
index 0000000000..79d5b8209d
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/quadrenderer.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 QUADRENDERER_H
+#define QUADRENDERER_H
+
+#include <QtGui/private/qrhi_p.h>
+
+class QuadRenderer
+{
+public:
+ void setRhi(QRhi *r) { m_r = r; }
+ void setSampleCount(int samples) { m_sampleCount = samples; }
+ int sampleCount() const { return m_sampleCount; }
+ void setTranslation(const QVector3D &v) { m_translation = v; }
+ void initResources(QRhiRenderPassDescriptor *rp);
+ void releaseResources();
+ void setPipeline(QRhiGraphicsPipeline *ps);
+ void resize(const QSize &pixelSize);
+ void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
+ void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels);
+
+private:
+ QRhi *m_r;
+
+ QRhiBuffer *m_vbuf = nullptr;
+ bool m_vbufReady = false;
+ QRhiBuffer *m_ibuf = nullptr;
+ bool m_opacityReady = false;
+ QRhiBuffer *m_ubuf = nullptr;
+ QRhiGraphicsPipeline *m_ps = nullptr;
+ QRhiShaderResourceBindings *m_srb = nullptr;
+
+ QVector3D m_translation;
+ QMatrix4x4 m_proj;
+ float m_rotation = 0;
+ int m_sampleCount = 1; // no MSAA by default
+};
+
+#endif
diff --git a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
new file mode 100644
index 0000000000..8c5845d4fc
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
@@ -0,0 +1,224 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "texturedcuberenderer.h"
+#include <QFile>
+#include <QtGui/private/qshader_p.h>
+
+#include "../shared/cube.h"
+
+const bool MIPMAP = true;
+const bool AUTOGENMIPMAP = true;
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+void TexturedCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
+{
+ m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ m_vbuf->setName(QByteArrayLiteral("Cube vbuf (textured)"));
+ m_vbuf->build();
+ m_vbufReady = false;
+
+ m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4);
+ m_ubuf->setName(QByteArrayLiteral("Cube ubuf (textured)"));
+ m_ubuf->build();
+
+ m_image = QImage(QLatin1String(":/qt256.png")).convertToFormat(QImage::Format_RGBA8888);
+ QRhiTexture::Flags texFlags = 0;
+ if (MIPMAP)
+ texFlags |= QRhiTexture::MipMapped;
+ if (AUTOGENMIPMAP)
+ texFlags |= QRhiTexture::UsedWithGenerateMips;
+ m_tex = m_r->newTexture(QRhiTexture::RGBA8, QSize(m_image.width(), m_image.height()), 1, texFlags);
+ m_tex->setName(QByteArrayLiteral("Qt texture"));
+ m_tex->build();
+
+ m_sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, MIPMAP ? QRhiSampler::Linear : QRhiSampler::None,
+ QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ m_sampler->build();
+
+ m_srb = m_r->newShaderResourceBindings();
+ m_srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler)
+ });
+ m_srb->build();
+
+ m_ps = m_r->newGraphicsPipeline();
+
+ // No blending but the texture has alpha which we do not want to write out.
+ // Be nice. (would not matter for an onscreen window but makes a difference
+ // when reading back and saving into image files f.ex.)
+ QRhiGraphicsPipeline::TargetBlend blend;
+ blend.colorWrite = QRhiGraphicsPipeline::R | QRhiGraphicsPipeline::G | QRhiGraphicsPipeline::B;
+ m_ps->setTargetBlends({ blend });
+
+ m_ps->setDepthTest(true);
+ m_ps->setDepthWrite(true);
+ m_ps->setDepthOp(QRhiGraphicsPipeline::Less);
+
+ m_ps->setCullMode(QRhiGraphicsPipeline::Back);
+ m_ps->setFrontFace(QRhiGraphicsPipeline::CCW);
+
+ m_ps->setSampleCount(m_sampleCount);
+
+ QShader vs = getShader(QLatin1String(":/texture.vert.qsb"));
+ Q_ASSERT(vs.isValid());
+ QShader fs = getShader(QLatin1String(":/texture.frag.qsb"));
+ Q_ASSERT(fs.isValid());
+ m_ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+
+ m_ps->setVertexInputLayout(inputLayout);
+ m_ps->setShaderResourceBindings(m_srb);
+ m_ps->setRenderPassDescriptor(rp);
+
+ m_ps->build();
+}
+
+void TexturedCubeRenderer::resize(const QSize &pixelSize)
+{
+ m_proj = m_r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, pixelSize.width() / (float) pixelSize.height(), 0.01f, 100.0f);
+ m_proj.translate(0, 0, -4);
+}
+
+void TexturedCubeRenderer::releaseResources()
+{
+ delete m_ps;
+ m_ps = nullptr;
+
+ delete m_srb;
+ m_srb = nullptr;
+
+ delete m_sampler;
+ m_sampler = nullptr;
+
+ delete m_tex;
+ m_tex = nullptr;
+
+ delete m_ubuf;
+ m_ubuf = nullptr;
+
+ delete m_vbuf;
+ m_vbuf = nullptr;
+}
+
+void TexturedCubeRenderer::queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (!m_vbufReady) {
+ m_vbufReady = true;
+ resourceUpdates->uploadStaticBuffer(m_vbuf, cube);
+ qint32 flip = 0;
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 64, 4, &flip);
+ }
+
+ if (!m_image.isNull()) {
+ if (MIPMAP) {
+ QVarLengthArray<QRhiTextureUploadEntry, 16> descEntries;
+ if (!AUTOGENMIPMAP) {
+ // the ghetto mipmap generator...
+ for (int i = 0, ie = m_r->mipLevelsForSize(m_image.size()); i != ie; ++i) {
+ QImage image = m_image.scaled(m_r->sizeForMipLevel(i, m_image.size()));
+ descEntries.append({ 0, i, image });
+ }
+ } else {
+ descEntries.append({ 0, 0, m_image });
+ }
+ QRhiTextureUploadDescription desc;
+ desc.setEntries(descEntries.cbegin(), descEntries.cend());
+ resourceUpdates->uploadTexture(m_tex, desc);
+ if (AUTOGENMIPMAP)
+ resourceUpdates->generateMips(m_tex);
+ } else {
+ resourceUpdates->uploadTexture(m_tex, m_image);
+ }
+ m_image = QImage();
+ }
+
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.translate(m_translation);
+ mvp.scale(0.5f);
+ mvp.rotate(m_rotation, 0, 1, 0);
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
+}
+
+void TexturedCubeRenderer::queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels)
+{
+ cb->setGraphicsPipeline(m_ps);
+ cb->setViewport(QRhiViewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()));
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { m_vbuf, 0 },
+ { m_vbuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ cb->draw(36);
+}
diff --git a/tests/manual/rhi/triquadcube/texturedcuberenderer.h b/tests/manual/rhi/triquadcube/texturedcuberenderer.h
new file mode 100644
index 0000000000..879f875209
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/texturedcuberenderer.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 TEXTUREDCUBERENDERER_H
+#define TEXTUREDCUBERENDERER_H
+
+#include <QtGui/private/qrhi_p.h>
+
+class TexturedCubeRenderer
+{
+public:
+ void setRhi(QRhi *r) { m_r = r; }
+ void setSampleCount(int samples) { m_sampleCount = samples; }
+ void setTranslation(const QVector3D &v) { m_translation = v; }
+ void initResources(QRhiRenderPassDescriptor *rp);
+ void releaseResources();
+ void resize(const QSize &pixelSize);
+ void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
+ void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels);
+
+private:
+ QRhi *m_r;
+
+ QRhiBuffer *m_vbuf = nullptr;
+ bool m_vbufReady = false;
+ QRhiBuffer *m_ubuf = nullptr;
+ QImage m_image;
+ QRhiTexture *m_tex = nullptr;
+ QRhiSampler *m_sampler = nullptr;
+ QRhiShaderResourceBindings *m_srb = nullptr;
+ QRhiGraphicsPipeline *m_ps = nullptr;
+
+ QVector3D m_translation;
+ QMatrix4x4 m_proj;
+ float m_rotation = 0;
+ int m_sampleCount = 1; // no MSAA by default
+};
+
+#endif
diff --git a/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp b/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
new file mode 100644
index 0000000000..250ae3a2ee
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
@@ -0,0 +1,292 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "triangleoncuberenderer.h"
+#include <QFile>
+#include <QtGui/private/qshader_p.h>
+
+// toggle to test the preserved content (no clear) path
+const bool IMAGE_UNDER_OFFSCREEN_RENDERING = false;
+const bool UPLOAD_UNDERLAY_ON_EVERY_FRAME = false;
+
+const bool DS_ATT = false; // have a depth-stencil attachment for the offscreen pass
+
+const bool DEPTH_TEXTURE = false; // offscreen pass uses a depth texture (verify with renderdoc etc., ignore valid.layer about ps slot 0)
+const bool MRT = false; // two textures, the second is just cleared as the shader does not write anything (valid.layer may warn but for testing that's ok)
+
+#include "../shared/cube.h"
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+static const QSize OFFSCREEN_SIZE(512, 512);
+
+void TriangleOnCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
+{
+ m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(cube));
+ m_vbuf->setName(QByteArrayLiteral("Cube vbuf (textured with offscreen)"));
+ m_vbuf->build();
+ m_vbufReady = false;
+
+ m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 64 + 4);
+ m_ubuf->setName(QByteArrayLiteral("Cube ubuf (textured with offscreen)"));
+ m_ubuf->build();
+
+ if (IMAGE_UNDER_OFFSCREEN_RENDERING) {
+ m_image = QImage(QLatin1String(":/qt256.png")).scaled(OFFSCREEN_SIZE).convertToFormat(QImage::Format_RGBA8888);
+ if (m_r->isYUpInFramebuffer())
+ m_image = m_image.mirrored(); // just cause we'll flip texcoord Y when y up so accommodate our static background image as well
+ }
+
+ m_tex = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, 1, QRhiTexture::RenderTarget);
+ m_tex->setName(QByteArrayLiteral("Texture for offscreen content"));
+ m_tex->build();
+
+ if (MRT) {
+ m_tex2 = m_r->newTexture(QRhiTexture::RGBA8, OFFSCREEN_SIZE, 1, QRhiTexture::RenderTarget);
+ m_tex2->build();
+ }
+
+ if (DS_ATT) {
+ m_offscreenTriangle.setDepthWrite(true);
+ m_ds = m_r->newRenderBuffer(QRhiRenderBuffer::DepthStencil, m_tex->pixelSize());
+ m_ds->build();
+ }
+
+ if (DEPTH_TEXTURE) {
+ m_offscreenTriangle.setDepthWrite(true);
+ m_depthTex = m_r->newTexture(QRhiTexture::D32F, OFFSCREEN_SIZE, 1, QRhiTexture::RenderTarget);
+ m_depthTex->build();
+ }
+
+ m_sampler = m_r->newSampler(QRhiSampler::Linear, QRhiSampler::Linear, QRhiSampler::None, QRhiSampler::ClampToEdge, QRhiSampler::ClampToEdge);
+ m_sampler->build();
+
+ m_srb = m_r->newShaderResourceBindings();
+ m_srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf),
+ QRhiShaderResourceBinding::sampledTexture(1, QRhiShaderResourceBinding::FragmentStage, m_tex, m_sampler)
+ });
+ m_srb->build();
+
+ m_ps = m_r->newGraphicsPipeline();
+
+ m_ps->setDepthTest(true);
+ m_ps->setDepthWrite(true);
+ m_ps->setDepthOp(QRhiGraphicsPipeline::Less);
+
+ m_ps->setCullMode(QRhiGraphicsPipeline::Back);
+ m_ps->setFrontFace(QRhiGraphicsPipeline::CCW);
+
+ m_ps->setSampleCount(m_sampleCount);
+
+ QShader vs = getShader(QLatin1String(":/texture.vert.qsb"));
+ Q_ASSERT(vs.isValid());
+ QShader fs = getShader(QLatin1String(":/texture.frag.qsb"));
+ Q_ASSERT(fs.isValid());
+ m_ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 3 * sizeof(float) },
+ { 2 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float3, 0 },
+ { 1, 1, QRhiVertexInputAttribute::Float2, 0 }
+ });
+
+ m_ps->setVertexInputLayout(inputLayout);
+ m_ps->setShaderResourceBindings(m_srb);
+ m_ps->setRenderPassDescriptor(rp);
+
+ m_ps->build();
+
+ QRhiTextureRenderTarget::Flags rtFlags = 0;
+ if (IMAGE_UNDER_OFFSCREEN_RENDERING)
+ rtFlags |= QRhiTextureRenderTarget::PreserveColorContents;
+
+ if (DEPTH_TEXTURE) {
+ QRhiTextureRenderTargetDescription desc;
+ desc.setDepthTexture(m_depthTex);
+ m_rt = m_r->newTextureRenderTarget(desc, rtFlags);
+ } else {
+ QRhiTextureRenderTargetDescription desc;
+ QRhiColorAttachment color0 { m_tex };
+ if (DS_ATT)
+ desc.setDepthStencilBuffer(m_ds);
+ if (MRT) {
+ m_offscreenTriangle.setColorAttCount(2);
+ QRhiColorAttachment color1 { m_tex2 };
+ desc.setColorAttachments({ color0, color1 });
+ } else {
+ desc.setColorAttachments({ color0 });
+ }
+ m_rt = m_r->newTextureRenderTarget(desc, rtFlags);
+ }
+
+ m_rp = m_rt->newCompatibleRenderPassDescriptor();
+ m_rt->setRenderPassDescriptor(m_rp);
+
+ m_rt->build();
+
+ m_offscreenTriangle.setRhi(m_r);
+ m_offscreenTriangle.initResources(m_rp);
+ m_offscreenTriangle.setScale(2);
+ // m_tex and the offscreen triangle are never multisample
+}
+
+void TriangleOnCubeRenderer::resize(const QSize &pixelSize)
+{
+ m_proj = m_r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, pixelSize.width() / (float) pixelSize.height(), 0.01f, 100.0f);
+ m_proj.translate(0, 0, -4);
+
+ m_offscreenTriangle.resize(pixelSize);
+}
+
+void TriangleOnCubeRenderer::releaseResources()
+{
+ m_offscreenTriangle.releaseResources();
+
+ delete m_ps;
+ m_ps = nullptr;
+
+ delete m_srb;
+ m_srb = nullptr;
+
+ delete m_rt;
+ m_rt = nullptr;
+
+ delete m_rp;
+ m_rp = nullptr;
+
+ delete m_sampler;
+ m_sampler = nullptr;
+
+ delete m_depthTex;
+ m_depthTex = nullptr;
+
+ delete m_tex2;
+ m_tex2 = nullptr;
+
+ delete m_tex;
+ m_tex = nullptr;
+
+ delete m_ds;
+ m_ds = nullptr;
+
+ delete m_ubuf;
+ m_ubuf = nullptr;
+
+ delete m_vbuf;
+ m_vbuf = nullptr;
+}
+
+void TriangleOnCubeRenderer::queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates)
+{
+ if (!m_vbufReady) {
+ m_vbufReady = true;
+ resourceUpdates->uploadStaticBuffer(m_vbuf, cube);
+ qint32 flip = m_r->isYUpInFramebuffer() ? 1 : 0;
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 64, 4, &flip);
+ }
+
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.translate(m_translation);
+ mvp.scale(0.5f);
+ mvp.rotate(m_rotation, 1, 0, 0);
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
+
+ // ###
+// if (DEPTH_TEXTURE) {
+// // m_tex is basically undefined here, be nice and transition the layout properly at least
+// resourceUpdates->prepareTextureForUse(m_tex, QRhiResourceUpdateBatch::TextureRead);
+// }
+}
+
+void TriangleOnCubeRenderer::queueOffscreenPass(QRhiCommandBuffer *cb)
+{
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ m_offscreenTriangle.queueResourceUpdates(u);
+
+ if (IMAGE_UNDER_OFFSCREEN_RENDERING && !m_image.isNull()) {
+ u->uploadTexture(m_tex, m_image);
+ if (!UPLOAD_UNDERLAY_ON_EVERY_FRAME)
+ m_image = QImage();
+ }
+
+ cb->beginPass(m_rt, QColor::fromRgbF(0.0f, 0.4f, 0.7f, 1.0f), { 1.0f, 0 }, u);
+ m_offscreenTriangle.queueDraw(cb, OFFSCREEN_SIZE);
+ cb->endPass();
+}
+
+void TriangleOnCubeRenderer::queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels)
+{
+ cb->setGraphicsPipeline(m_ps);
+ cb->setViewport(QRhiViewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()));
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBindings[] = {
+ { m_vbuf, 0 },
+ { m_vbuf, 36 * 3 * sizeof(float) }
+ };
+ cb->setVertexInput(0, 2, vbufBindings);
+ cb->draw(36);
+}
diff --git a/tests/manual/rhi/triquadcube/triangleoncuberenderer.h b/tests/manual/rhi/triquadcube/triangleoncuberenderer.h
new file mode 100644
index 0000000000..5a56bf6bd1
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/triangleoncuberenderer.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 TRIANGLEONCUBERENDERER_H
+#define TRIANGLEONCUBERENDERER_H
+
+#include "trianglerenderer.h"
+
+class TriangleOnCubeRenderer
+{
+public:
+ void setRhi(QRhi *r) { m_r = r; }
+ void setSampleCount(int samples) { m_sampleCount = samples; }
+ void setTranslation(const QVector3D &v) { m_translation = v; }
+ void initResources(QRhiRenderPassDescriptor *rp);
+ void releaseResources();
+ void resize(const QSize &pixelSize);
+ void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
+ void queueOffscreenPass(QRhiCommandBuffer *cb);
+ void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels);
+
+private:
+ QRhi *m_r;
+
+ QRhiBuffer *m_vbuf = nullptr;
+ bool m_vbufReady = false;
+ QRhiBuffer *m_ubuf = nullptr;
+ QRhiTexture *m_tex = nullptr;
+ QRhiRenderBuffer *m_ds = nullptr;
+ QRhiTexture *m_tex2 = nullptr;
+ QRhiTexture *m_depthTex = nullptr;
+ QRhiSampler *m_sampler = nullptr;
+ QRhiTextureRenderTarget *m_rt = nullptr;
+ QRhiRenderPassDescriptor *m_rp = nullptr;
+ QRhiShaderResourceBindings *m_srb = nullptr;
+ QRhiGraphicsPipeline *m_ps = nullptr;
+
+ QVector3D m_translation;
+ QMatrix4x4 m_proj;
+ float m_rotation = 0;
+ int m_sampleCount = 1; // no MSAA by default
+
+ TriangleRenderer m_offscreenTriangle;
+
+ QImage m_image;
+};
+
+#endif
diff --git a/tests/manual/rhi/triquadcube/trianglerenderer.cpp b/tests/manual/rhi/triquadcube/trianglerenderer.cpp
new file mode 100644
index 0000000000..5d932aea52
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/trianglerenderer.cpp
@@ -0,0 +1,202 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 "trianglerenderer.h"
+#include <QFile>
+#include <QtGui/private/qshader_p.h>
+
+//#define VBUF_IS_DYNAMIC
+
+static float vertexData[] = { // Y up (note m_proj), CCW
+ 0.0f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+ -0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f,
+ 0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f
+};
+
+static QShader getShader(const QString &name)
+{
+ QFile f(name);
+ if (f.open(QIODevice::ReadOnly))
+ return QShader::fromSerialized(f.readAll());
+
+ return QShader();
+}
+
+void TriangleRenderer::initResources(QRhiRenderPassDescriptor *rp)
+{
+#ifdef VBUF_IS_DYNAMIC
+ m_vbuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+#else
+ m_vbuf = m_r->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertexData));
+#endif
+ m_vbuf->setName(QByteArrayLiteral("Triangle vbuf"));
+ m_vbuf->build();
+ m_vbufReady = false;
+
+ m_ubuf = m_r->newBuffer(QRhiBuffer::Dynamic, QRhiBuffer::UniformBuffer, 68);
+ m_ubuf->setName(QByteArrayLiteral("Triangle ubuf"));
+ m_ubuf->build();
+
+ m_srb = m_r->newShaderResourceBindings();
+ m_srb->setBindings({
+ QRhiShaderResourceBinding::uniformBuffer(0, QRhiShaderResourceBinding::VertexStage | QRhiShaderResourceBinding::FragmentStage, m_ubuf)
+ });
+ m_srb->build();
+
+ m_ps = m_r->newGraphicsPipeline();
+
+ QRhiGraphicsPipeline::TargetBlend premulAlphaBlend; // convenient defaults...
+ premulAlphaBlend.enable = true;
+ QVarLengthArray<QRhiGraphicsPipeline::TargetBlend, 4> rtblends;
+ for (int i = 0; i < m_colorAttCount; ++i)
+ rtblends << premulAlphaBlend;
+
+ m_ps->setTargetBlends(rtblends.cbegin(), rtblends.cend());
+ m_ps->setSampleCount(m_sampleCount);
+
+ if (m_depthWrite) { // TriangleOnCube may want to exercise this
+ m_ps->setDepthTest(true);
+ m_ps->setDepthOp(QRhiGraphicsPipeline::Always);
+ m_ps->setDepthWrite(true);
+ }
+
+ QShader vs = getShader(QLatin1String(":/color.vert.qsb"));
+ Q_ASSERT(vs.isValid());
+ QShader fs = getShader(QLatin1String(":/color.frag.qsb"));
+ Q_ASSERT(fs.isValid());
+ m_ps->setShaderStages({
+ { QRhiShaderStage::Vertex, vs },
+ { QRhiShaderStage::Fragment, fs }
+ });
+
+ QRhiVertexInputLayout inputLayout;
+ inputLayout.setBindings({
+ { 7 * sizeof(float) }
+ });
+ inputLayout.setAttributes({
+ { 0, 0, QRhiVertexInputAttribute::Float2, 0 },
+ { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ });
+
+ m_ps->setVertexInputLayout(inputLayout);
+ m_ps->setShaderResourceBindings(m_srb);
+ m_ps->setRenderPassDescriptor(rp);
+
+ m_ps->build();
+}
+
+void TriangleRenderer::resize(const QSize &pixelSize)
+{
+ m_proj = m_r->clipSpaceCorrMatrix();
+ m_proj.perspective(45.0f, pixelSize.width() / (float) pixelSize.height(), 0.01f, 100.0f);
+ m_proj.translate(0, 0, -4);
+}
+
+void TriangleRenderer::releaseResources()
+{
+ delete m_ps;
+ m_ps = nullptr;
+
+ delete m_srb;
+ m_srb = nullptr;
+
+ delete m_ubuf;
+ m_ubuf = nullptr;
+
+ delete m_vbuf;
+ m_vbuf = nullptr;
+}
+
+void TriangleRenderer::queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates)
+{
+#if 0
+ static int messWithBufferTrigger = 0;
+ // recreate the underlying VkBuffer every second frame
+ // to exercise setShaderResources' built-in smartness
+ if (!(messWithBufferTrigger & 1)) {
+ m_ubuf->release();
+ m_ubuf->build();
+ }
+ ++messWithBufferTrigger;
+#endif
+
+ if (!m_vbufReady) {
+ m_vbufReady = true;
+#ifdef VBUF_IS_DYNAMIC
+ resourceUpdates->updateDynamicBuffer(m_vbuf, 0, m_vbuf->size(), vertexData);
+#else
+ resourceUpdates->uploadStaticBuffer(m_vbuf, vertexData);
+#endif
+ }
+
+ m_rotation += 1.0f;
+ QMatrix4x4 mvp = m_proj;
+ mvp.translate(m_translation);
+ mvp.scale(m_scale);
+ mvp.rotate(m_rotation, 0, 1, 0);
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 0, 64, mvp.constData());
+
+ m_opacity += m_opacityDir * 0.005f;
+ if (m_opacity < 0.0f || m_opacity > 1.0f) {
+ m_opacityDir *= -1;
+ m_opacity = qBound(0.0f, m_opacity, 1.0f);
+ }
+ resourceUpdates->updateDynamicBuffer(m_ubuf, 64, 4, &m_opacity);
+}
+
+void TriangleRenderer::queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels)
+{
+ cb->setGraphicsPipeline(m_ps);
+ cb->setViewport(QRhiViewport(0, 0, outputSizeInPixels.width(), outputSizeInPixels.height()));
+ cb->setShaderResources();
+ const QRhiCommandBuffer::VertexInput vbufBinding(m_vbuf, 0);
+ cb->setVertexInput(0, 1, &vbufBinding);
+ cb->draw(3);
+}
diff --git a/tests/manual/rhi/triquadcube/trianglerenderer.h b/tests/manual/rhi/triquadcube/trianglerenderer.h
new file mode 100644
index 0000000000..53d6926a62
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/trianglerenderer.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 TRIANGLERENDERER_H
+#define TRIANGLERENDERER_H
+
+#include <QtGui/private/qrhi_p.h>
+
+class TriangleRenderer
+{
+public:
+ void setRhi(QRhi *r) { m_r = r; }
+ void setSampleCount(int samples) { m_sampleCount = samples; }
+ int sampleCount() const { return m_sampleCount; }
+ void setTranslation(const QVector3D &v) { m_translation = v; }
+ void setScale(float f) { m_scale = f; }
+ void setDepthWrite(bool enable) { m_depthWrite = enable; }
+ void setColorAttCount(int count) { m_colorAttCount = count; }
+ QRhiGraphicsPipeline *pipeline() const { return m_ps; }
+ void initResources(QRhiRenderPassDescriptor *rp);
+ void releaseResources();
+ void resize(const QSize &pixelSize);
+ void queueResourceUpdates(QRhiResourceUpdateBatch *resourceUpdates);
+ void queueDraw(QRhiCommandBuffer *cb, const QSize &outputSizeInPixels);
+
+private:
+ QRhi *m_r;
+
+ QRhiBuffer *m_vbuf = nullptr;
+ bool m_vbufReady = false;
+ QRhiBuffer *m_ubuf = nullptr;
+ QRhiShaderResourceBindings *m_srb = nullptr;
+ QRhiGraphicsPipeline *m_ps = nullptr;
+
+ QVector3D m_translation;
+ float m_scale = 1;
+ bool m_depthWrite = false;
+ int m_colorAttCount = 1;
+ QMatrix4x4 m_proj;
+ float m_rotation = 0;
+ float m_opacity = 1;
+ int m_opacityDir = -1;
+ int m_sampleCount = 1; // no MSAA by default
+};
+
+#endif
diff --git a/tests/manual/rhi/triquadcube/triquadcube.cpp b/tests/manual/rhi/triquadcube/triquadcube.cpp
new file mode 100644
index 0000000000..252ec63e21
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/triquadcube.cpp
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+// An example exercising more than a single feature. Enables profiling
+// (resource logging to a file) and inserts debug markers and sets some
+// object names. Can also be used to test MSAA swapchains, swapchain image
+// readback, requesting an sRGB swapchain, and some texture features.
+
+#define EXAMPLEFW_PREINIT
+#include "../shared/examplefw.h"
+#include "trianglerenderer.h"
+#include "quadrenderer.h"
+#include "texturedcuberenderer.h"
+#include "triangleoncuberenderer.h"
+
+#include <QFileInfo>
+#include <QFile>
+#include <QtGui/private/qrhiprofiler_p.h>
+
+#define PROFILE_TO_FILE
+//#define SKIP_PRESENT
+//#define USE_MSAA
+//#define USE_SRGB_SWAPCHAIN
+//#define READBACK_SWAPCHAIN
+//#define NO_VSYNC
+//#define USE_MIN_SWAPCHAIN_BUFFERS
+//#define DECLARE_EXT_CONTENTS
+
+struct {
+ TriangleRenderer triRenderer;
+ QuadRenderer quadRenderer;
+ TexturedCubeRenderer cubeRenderer;
+ TriangleOnCubeRenderer liveTexCubeRenderer;
+ bool onScreenOnly = false;
+ bool triangleOnly = false;
+ QSize lastOutputSize;
+ int frameCount = 0;
+ QFile profOut;
+} d;
+
+void preInit()
+{
+#ifdef PROFILE_TO_FILE
+ rhiFlags |= QRhi::EnableProfiling;
+ const QString profFn = QFileInfo(QLatin1String("rhiprof.txt")).absoluteFilePath();
+ qDebug("Writing profiling output to %s", qPrintable(profFn));
+ d.profOut.setFileName(profFn);
+ d.profOut.open(QIODevice::WriteOnly);
+#endif
+
+#ifdef SKIP_PRESENT
+ endFrameFlags |= QRhi::SkipPresent;
+#endif
+
+#ifdef USE_MSAA
+ sampleCount = 4; // enable 4x MSAA (except for the render-to-texture pass)
+#endif
+
+#ifdef READBACK_SWAPCHAIN
+ scFlags |= QRhiSwapChain::UsedAsTransferSource;
+#endif
+
+#ifdef USE_SRGB_SWAPCHAIN
+ scFlags |= QRhiSwapChain::sRGB;
+#endif
+
+#ifdef NO_VSYNC
+ scFlags |= QRhiSwapChain::NoVSync;
+#endif
+
+#ifdef USE_MIN_SWAPCHAIN_BUFFERS
+ scFlags |= QRhiSwapChain::MinimalBufferCount;
+#endif
+
+#ifdef DECLARE_EXT_CONTENTS
+ beginFrameFlags |= QRhi::ExternalContentsInPass;
+#endif
+
+ // For OpenGL some of these are incorporated into the QSurfaceFormat by
+ // examplefw.h after returning from here as that is out of the RHI's control.
+}
+
+void Window::customInit()
+{
+#ifdef PROFILE_TO_FILE
+ m_r->profiler()->setDevice(&d.profOut);
+#endif
+
+ d.triRenderer.setRhi(m_r);
+ d.triRenderer.setSampleCount(sampleCount);
+ d.triRenderer.initResources(m_rp);
+
+ if (!d.triangleOnly) {
+ d.triRenderer.setTranslation(QVector3D(0, 0.5f, 0));
+
+ d.quadRenderer.setRhi(m_r);
+ d.quadRenderer.setSampleCount(sampleCount);
+ d.quadRenderer.setPipeline(d.triRenderer.pipeline());
+ d.quadRenderer.initResources(m_rp);
+ d.quadRenderer.setTranslation(QVector3D(1.5f, -0.5f, 0));
+
+ d.cubeRenderer.setRhi(m_r);
+ d.cubeRenderer.setSampleCount(sampleCount);
+ d.cubeRenderer.initResources(m_rp);
+ d.cubeRenderer.setTranslation(QVector3D(0, -0.5f, 0));
+ }
+
+ if (!d.onScreenOnly) {
+ d.liveTexCubeRenderer.setRhi(m_r);
+ d.liveTexCubeRenderer.setSampleCount(sampleCount);
+ d.liveTexCubeRenderer.initResources(m_rp);
+ d.liveTexCubeRenderer.setTranslation(QVector3D(-2.0f, 0, 0));
+ }
+
+ // Put the gpu mem allocator statistics to the profiling stream after doing
+ // all the init. (where applicable)
+ m_r->profiler()->addVMemAllocatorStats();
+
+ // Check some features/limits.
+ qDebug("isFeatureSupported(MultisampleTexture): %d", m_r->isFeatureSupported(QRhi::MultisampleTexture));
+ qDebug("isFeatureSupported(MultisampleRenderBuffer): %d", m_r->isFeatureSupported(QRhi::MultisampleRenderBuffer));
+ qDebug("isFeatureSupported(DebugMarkers): %d", m_r->isFeatureSupported(QRhi::DebugMarkers));
+ qDebug("isFeatureSupported(Timestamps): %d", m_r->isFeatureSupported(QRhi::Timestamps));
+ qDebug("isFeatureSupported(Instancing): %d", m_r->isFeatureSupported(QRhi::Instancing));
+ qDebug("isFeatureSupported(CustomInstanceStepRate): %d", m_r->isFeatureSupported(QRhi::CustomInstanceStepRate));
+ qDebug("isFeatureSupported(PrimitiveRestart): %d", m_r->isFeatureSupported(QRhi::PrimitiveRestart));
+ qDebug("isFeatureSupported(NonDynamicUniformBuffers): %d", m_r->isFeatureSupported(QRhi::NonDynamicUniformBuffers));
+ qDebug("isFeatureSupported(NonFourAlignedEffectiveIndexBufferOffset): %d", m_r->isFeatureSupported(QRhi::NonFourAlignedEffectiveIndexBufferOffset));
+ qDebug("isFeatureSupported(NPOTTextureRepeat): %d", m_r->isFeatureSupported(QRhi::NPOTTextureRepeat));
+ qDebug("isFeatureSupported(RedOrAlpha8IsRed): %d", m_r->isFeatureSupported(QRhi::RedOrAlpha8IsRed));
+ qDebug("isFeatureSupported(ElementIndexUint): %d", m_r->isFeatureSupported(QRhi::ElementIndexUint));
+ qDebug("isFeatureSupported(Compute): %d", m_r->isFeatureSupported(QRhi::Compute));
+ qDebug("isFeatureSupported(WideLines): %d", m_r->isFeatureSupported(QRhi::WideLines));
+ qDebug("isFeatureSupported(VertexShaderPointSize): %d", m_r->isFeatureSupported(QRhi::VertexShaderPointSize));
+ qDebug("isFeatureSupported(BaseVertex): %d", m_r->isFeatureSupported(QRhi::BaseVertex));
+ qDebug("isFeatureSupported(BaseInstance): %d", m_r->isFeatureSupported(QRhi::BaseInstance));
+ qDebug("Min 2D texture width/height: %d", m_r->resourceLimit(QRhi::TextureSizeMin));
+ qDebug("Max 2D texture width/height: %d", m_r->resourceLimit(QRhi::TextureSizeMax));
+ qDebug("Max color attachment count: %d", m_r->resourceLimit(QRhi::MaxColorAttachments));
+}
+
+void Window::customRelease()
+{
+ d.triRenderer.releaseResources();
+
+ if (!d.triangleOnly) {
+ d.quadRenderer.releaseResources();
+ d.cubeRenderer.releaseResources();
+ }
+
+ if (!d.onScreenOnly)
+ d.liveTexCubeRenderer.releaseResources();
+}
+
+void Window::customRender()
+{
+ const QSize outputSize = m_sc->currentPixelSize();
+ QRhiCommandBuffer *cb = m_sc->currentFrameCommandBuffer();
+
+ if (outputSize != d.lastOutputSize) {
+ d.triRenderer.resize(outputSize);
+ if (!d.triangleOnly) {
+ d.quadRenderer.resize(outputSize);
+ d.cubeRenderer.resize(outputSize);
+ }
+ if (!d.onScreenOnly)
+ d.liveTexCubeRenderer.resize(outputSize);
+ d.lastOutputSize = outputSize;
+ }
+
+ if (!d.onScreenOnly) {
+ cb->debugMarkBegin("Offscreen triangle pass");
+ d.liveTexCubeRenderer.queueOffscreenPass(cb);
+ cb->debugMarkEnd();
+ }
+
+ QRhiResourceUpdateBatch *u = m_r->nextResourceUpdateBatch();
+ d.triRenderer.queueResourceUpdates(u);
+ if (!d.triangleOnly) {
+ d.quadRenderer.queueResourceUpdates(u);
+ d.cubeRenderer.queueResourceUpdates(u);
+ }
+ if (!d.onScreenOnly)
+ d.liveTexCubeRenderer.queueResourceUpdates(u);
+
+ cb->beginPass(m_sc->currentFrameRenderTarget(), m_clearColor, { 1.0f, 0 }, u);
+ cb->debugMarkBegin(QByteArrayLiteral("Triangle"));
+ d.triRenderer.queueDraw(cb, outputSize);
+ cb->debugMarkEnd();
+ if (!d.triangleOnly) {
+ cb->debugMarkMsg(QByteArrayLiteral("More stuff"));
+ cb->debugMarkBegin(QByteArrayLiteral("Quad"));
+ d.quadRenderer.queueDraw(cb, outputSize);
+ cb->debugMarkEnd();
+ cb->debugMarkBegin(QByteArrayLiteral("Cube"));
+ d.cubeRenderer.queueDraw(cb, outputSize);
+ cb->debugMarkEnd();
+ }
+ if (!d.onScreenOnly) {
+ cb->debugMarkMsg(QByteArrayLiteral("Even more stuff"));
+ cb->debugMarkBegin(QByteArrayLiteral("Cube with offscreen triangle"));
+ d.liveTexCubeRenderer.queueDraw(cb, outputSize);
+ cb->debugMarkEnd();
+ }
+
+ QRhiResourceUpdateBatch *passEndUpdates = nullptr;
+#ifdef READBACK_SWAPCHAIN
+ passEndUpdates = m_r->nextResourceUpdateBatch();
+ QRhiReadbackDescription rb; // no texture given -> backbuffer
+ QRhiReadbackResult *rbResult = new QRhiReadbackResult;
+ int frameNo = d.frameCount;
+ rbResult->completed = [this, rbResult, frameNo] {
+ {
+ QImage::Format fmt = rbResult->format == QRhiTexture::BGRA8 ? QImage::Format_ARGB32_Premultiplied
+ : QImage::Format_RGBA8888_Premultiplied;
+ const uchar *p = reinterpret_cast<const uchar *>(rbResult->data.constData());
+ QImage image(p, rbResult->pixelSize.width(), rbResult->pixelSize.height(), fmt);
+ QString fn = QString::asprintf("frame%d.png", frameNo);
+ fn = QFileInfo(fn).absoluteFilePath();
+ qDebug("Saving into %s", qPrintable(fn));
+ if (m_r->isYUpInFramebuffer())
+ image.mirrored().save(fn);
+ else
+ image.save(fn);
+ }
+ delete rbResult;
+ };
+ passEndUpdates->readBackTexture(rb, rbResult);
+#endif
+
+ cb->endPass(passEndUpdates);
+
+ d.frameCount += 1;
+}
diff --git a/tests/manual/rhi/triquadcube/triquadcube.pro b/tests/manual/rhi/triquadcube/triquadcube.pro
new file mode 100644
index 0000000000..0002b3cad1
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/triquadcube.pro
@@ -0,0 +1,18 @@
+TEMPLATE = app
+
+QT += gui-private
+
+SOURCES = \
+ triquadcube.cpp \
+ trianglerenderer.cpp \
+ quadrenderer.cpp \
+ texturedcuberenderer.cpp \
+ triangleoncuberenderer.cpp
+
+HEADERS = \
+ trianglerenderer.h \
+ quadrenderer.h \
+ texturedcuberenderer.h \
+ triangleoncuberenderer.h
+
+RESOURCES = triquadcube.qrc
diff --git a/tests/manual/rhi/triquadcube/triquadcube.qrc b/tests/manual/rhi/triquadcube/triquadcube.qrc
new file mode 100644
index 0000000000..41b72edc41
--- /dev/null
+++ b/tests/manual/rhi/triquadcube/triquadcube.qrc
@@ -0,0 +1,9 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file alias="color.vert.qsb">../shared/color.vert.qsb</file>
+ <file alias="color.frag.qsb">../shared/color.frag.qsb</file>
+ <file alias="texture.vert.qsb">../shared/texture.vert.qsb</file>
+ <file alias="texture.frag.qsb">../shared/texture.frag.qsb</file>
+ <file alias="qt256.png">../shared/qt256.png</file>
+</qresource>
+</RCC>
diff --git a/tests/manual/socketengine/main.cpp b/tests/manual/socketengine/main.cpp
index 0d491e7350..3e3e7e53e5 100644
--- a/tests/manual/socketengine/main.cpp
+++ b/tests/manual/socketengine/main.cpp
@@ -83,7 +83,7 @@ int main(int argc, char**argv)
// disconnected
exit(0);
}
- qFill(buf, buf + bufsize, 0);
+ std::fill(buf, buf + bufsize, 0);
ret = socketEngine->read(buf, available);
if (ret > 0) {
printf("%s", buf);
diff --git a/tests/manual/textrendering/glyphshaping/main.cpp b/tests/manual/textrendering/glyphshaping/main.cpp
index c3acda953d..c1e49b3b7e 100644
--- a/tests/manual/textrendering/glyphshaping/main.cpp
+++ b/tests/manual/textrendering/glyphshaping/main.cpp
@@ -160,8 +160,6 @@ bool dumpHtml(const QString &pathName)
QString platformName = QString::fromLatin1(
#if defined(Q_OS_WIN)
"Win32"
-#elif 0 // Used to be included in Qt4 for Q_WS_X11
- "X11"
#else
""
#endif
diff --git a/tests/manual/wasm/localfiles/localfiles.pro b/tests/manual/wasm/localfiles/localfiles.pro
new file mode 100644
index 0000000000..04ad4c0ce1
--- /dev/null
+++ b/tests/manual/wasm/localfiles/localfiles.pro
@@ -0,0 +1,8 @@
+TEMPLATE = app
+TARGET = localfiles
+QT += core gui widgets
+
+OBJECTS_DIR = .obj
+MOC_DIR = .moc
+
+SOURCES += main.cpp
diff --git a/tests/manual/wasm/localfiles/main.cpp b/tests/manual/wasm/localfiles/main.cpp
new file mode 100644
index 0000000000..9dfc30885c
--- /dev/null
+++ b/tests/manual/wasm/localfiles/main.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, 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 The Qt Company Ltd 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 <QtWidgets/QtWidgets>
+
+int main(int argc, char **argv)
+{
+ QApplication app(argc, argv);
+
+ QByteArray content;
+
+ QWidget loadFileUi;
+ QVBoxLayout *layout = new QVBoxLayout();
+ QPushButton *loadFile = new QPushButton("Load File");
+ QLabel *fileInfo = new QLabel("Opened file:");
+ fileInfo->setTextInteractionFlags(Qt::TextSelectableByMouse);
+ QLabel *fileHash = new QLabel("Sha256:");
+ fileHash->setTextInteractionFlags(Qt::TextSelectableByMouse);
+ QPushButton *saveFile = new QPushButton("Save File");
+ saveFile->setEnabled(false);
+
+ auto onFileReady = [=, &content](const QString &fileName, const QByteArray &fileContents) {
+ content = fileContents;
+ fileInfo->setText(QString("Opened file: %1 size: %2").arg(fileName).arg(fileContents.size()));
+ saveFile->setEnabled(true);
+
+ auto computeDisplayFileHash = [=](){
+ QByteArray hash = QCryptographicHash::hash(fileContents, QCryptographicHash::Sha256);
+ fileHash->setText(QString("Sha256: %1").arg(QString(hash.toHex())));
+ };
+
+ QTimer::singleShot(100, computeDisplayFileHash); // update UI before computing hash
+ };
+ auto onLoadClicked = [=](){
+ QFileDialog::getOpenFileContent("*.*", onFileReady);
+ };
+ QObject::connect(loadFile, &QPushButton::clicked, onLoadClicked);
+
+ auto onSaveClicked = [=, &content]() {
+ QFileDialog::saveFileContent(content, "qtsavefiletest.dat");
+ };
+ QObject::connect(saveFile, &QPushButton::clicked, onSaveClicked);
+
+ layout->addWidget(loadFile);
+ layout->addWidget(fileInfo);
+ layout->addWidget(fileHash);
+ layout->addWidget(saveFile);
+ layout->addStretch();
+
+ loadFileUi.setLayout(layout);
+ loadFileUi.show();
+
+ return app.exec();
+}
diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h
index 9f4527a992..0e7e6ba867 100644
--- a/tests/shared/filesystem.h
+++ b/tests/shared/filesystem.h
@@ -79,7 +79,7 @@ public:
return file.isNull() ? qint64(-1) : file->write(relativeFileName.toUtf8());
}
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
static DWORD createNtfsJunction(QString target, QString linkName, QString *errorMessage)
{
typedef struct {
diff --git a/tests/testserver/apache2/apache2.sh b/tests/testserver/apache2/apache2.sh
index 4b0c74e2c4..d5075c7096 100755
--- a/tests/testserver/apache2/apache2.sh
+++ b/tests/testserver/apache2/apache2.sh
@@ -73,5 +73,8 @@ touch -d "2007-05-22 12:04:57 GMT" /home/$USER/www/htdocs/fluke.gif
# Create 10MB file for use by tst_Q*::downloadBigFile and interruption tests:
su $USER -c "/bin/dd if=/dev/zero of=~/www/htdocs/mediumfile bs=1 count=0 seek=10000000"
+# Emulate test server's hierarchy:
+su $USER -c "ln -s ~/www/htdocs/rfcs/rfc2616.html ~/www/htdocs/deflate/"
+
# enable service with installed configurations
service apache2 restart
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol-expire.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol-expire.cgi
new file mode 100755
index 0000000000..7dc506fc1e
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol-expire.cgi
@@ -0,0 +1,7 @@
+#!/bin/bash
+# cache control takes precedence over expires
+echo "Cache-Control: max-age=-1"
+echo "Expires: Mon, 30 Oct 2028 14:19:41 GMT"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol.cgi
new file mode 100755
index 0000000000..f2edfc161f
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol.cgi
@@ -0,0 +1,13 @@
+#!/bin/bash
+if [ ! -z ${HTTP_IF_MODIFIED_SINCE} ] ; then
+ echo "Status: 304"
+ echo ""
+ exit;
+fi
+
+cc=`echo "${QUERY_STRING}" | sed -e s/%20/\ /g`
+echo "Cache-Control: $cc"
+echo "Last-Modified: Sat, 31 Oct 1981 06:00:00 GMT"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol200.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol200.cgi
new file mode 100755
index 0000000000..e44d5ed570
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_cachecontrol200.cgi
@@ -0,0 +1,9 @@
+#!/bin/bash
+cc=`echo "${QUERY_STRING}" | sed -e s/%20/\ /g`
+echo "Status: 200"
+echo "Cache-Control: $cc"
+echo "Last-Modified: Sat, 31 Oct 1981 06:00:00 GMT"
+echo "Content-type: text/html";
+echo "X-Script: $0"
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag200.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag200.cgi
new file mode 100755
index 0000000000..0966abfdd1
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag200.cgi
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo "ETag: foo"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag304.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag304.cgi
new file mode 100755
index 0000000000..91a4b922bd
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_etag304.cgi
@@ -0,0 +1,11 @@
+#!/bin/bash
+if [ ! -z ${HTTP_IF_NONE_MATCH} ] ; then
+ echo "Status: 304"
+ echo ""
+ exit;
+fi
+
+echo "ETag: foo"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires200.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires200.cgi
new file mode 100755
index 0000000000..e18ebc86ad
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires200.cgi
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo "Expires: Sat, 31 Oct 1981 6:00:00 GMT"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires304.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires304.cgi
new file mode 100755
index 0000000000..1c7de1cd77
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_expires304.cgi
@@ -0,0 +1,11 @@
+#!/bin/bash
+if [ ${HTTP_IF_MODIFIED_SINCE} == "Mon, 30 Oct 2028 14:19:41 GMT" ] ; then
+ echo "Status: 304"
+ echo ""
+ exit;
+fi
+
+echo "Expires: Mon, 30 Oct 2028 14:19:41 GMT"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified200.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified200.cgi
new file mode 100755
index 0000000000..5dc219b1e7
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified200.cgi
@@ -0,0 +1,5 @@
+#!/bin/bash
+echo "Last-Modified: Sat, 31 Oct 1981 6:00:00 GMT"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified304.cgi b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified304.cgi
new file mode 100755
index 0000000000..bdf23bed2f
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/cgi-bin/httpcachetest_lastModified304.cgi
@@ -0,0 +1,11 @@
+#!/bin/bash
+if [ ${HTTP_IF_MODIFIED_SINCE} == "Sat, 31 Oct 1981 06:00:00 GMT" ] ; then
+ echo "Status: 304"
+ echo ""
+ exit;
+fi
+
+echo "Last-Modified: Sat, 31 Oct 1981 06:00:00 GMT"
+echo "Content-type: text/html";
+echo ""
+echo "Hello World!"
diff --git a/tests/testserver/apache2/testdata/www/htdocs/rfcs/.gitattributes b/tests/testserver/apache2/testdata/www/htdocs/rfcs/.gitattributes
new file mode 100644
index 0000000000..1d09ee726e
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/htdocs/rfcs/.gitattributes
@@ -0,0 +1 @@
+rfc2616.html binary
diff --git a/tests/testserver/apache2/testdata/www/htdocs/rfcs/rfc2616.html b/tests/testserver/apache2/testdata/www/htdocs/rfcs/rfc2616.html
new file mode 100644
index 0000000000..0e3282fb8d
--- /dev/null
+++ b/tests/testserver/apache2/testdata/www/htdocs/rfcs/rfc2616.html
@@ -0,0 +1,8380 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html><head><title>RFC 2616 (rfc2616) - Hypertext Transfer Protocol -- HTTP/1.1</title>
+
+
+
+<meta name="description" content="RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1">
+<meta name="obsoletes" content="RFC2068">
+<script language="JavaScript1.2">
+function erfc(s)
+{document.write("<A href=\"/rfccomment.php?rfcnum="+s+"\" target=\"_blank\" onclick=\"window.open('/rfccomment.php?rfcnum="+s+"','Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=680,height=530,left=30,top=43'); return false;\")>Comment on RFC "+s+"</A>\n");}
+//-->
+</script></head><body bgcolor="#ffffff" text="#000000">
+<p align="center"><img src="rfc2616_files/library.htm" alt="" align="middle" border="0" height="62" width="150"></p>
+<h1 align="center">RFC 2616 (RFC2616)</h1>
+<p align="center">Internet RFC/STD/FYI/BCP Archives</p>
+
+<div align="center">[ <a href="http://firefly.troll.no/rfcs/">RFC Index</a> | <a href="http://firefly.troll.no/rfcs/rfcsearch.html">RFC Search</a> | <a href="http://firefly.troll.no/faqs/">Usenet FAQs</a> | <a href="http://firefly.troll.no/contrib/">Web FAQs</a> | <a href="http://firefly.troll.no/docs/">Documents</a> | <a href="http://www.city-data.com/">Cities</a> ]
+<p>
+<strong>Alternate Formats:</strong>
+ <a href="http://firefly.troll.no/ftp/rfc/rfc2616.txt">rfc2616.txt</a> |
+ <a href="http://firefly.troll.no/ftp/rfc/rfc2616.ps">rfc2616.ps</a> |
+ <a href="http://firefly.troll.no/ftp/rfc/rfc2616.pdf">rfc2616.pdf</a></p></div>
+<p align="center"><script language="JavaScript"><!--
+erfc("2616");
+// --></script><a href="http://firefly.troll.no/rfccomment.php?rfcnum=2616" target="_blank" onclick="window.open('/rfccomment.php?rfcnum=2616','Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=680,height=530,left=30,top=43'); return false;" )="">Comment on RFC 2616</a>
+</p>
+<h3 align="center">RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1</h3>
+<hr noshade="noshade" size="2">
+<pre>
+Network Working Group R. Fielding
+Request for Comments: 2616 UC Irvine
+Obsoletes: 2068 J. Gettys
+Category: Standards Track Compaq/W3C
+ J. Mogul
+ Compaq
+ H. Frystyk
+ W3C/MIT
+ L. Masinter
+ Xerox
+ P. Leach
+ Microsoft
+ T. Berners-Lee
+ W3C/MIT
+ June 1999
+
+ Hypertext Transfer Protocol -- HTTP/1.1
+
+Status of this Memo
+
+ This document specifies an Internet standards track protocol for the
+ Internet community, and requests discussion and suggestions for
+ improvements. Please refer to the current edition of the "Internet
+ Official Protocol Standards" (STD 1) for the standardization state
+ and status of this protocol. Distribution of this memo is unlimited.
+
+Copyright Notice
+
+ Copyright (C) The Internet Society (1999). All Rights Reserved.
+
+Abstract
+
+ The Hypertext Transfer Protocol (HTTP) is an application-level
+ protocol for distributed, collaborative, hypermedia information
+ systems. It is a generic, stateless, protocol which can be used for
+ many tasks beyond its use for hypertext, such as name servers and
+ distributed object management systems, through extension of its
+ request methods, error codes and headers [47]. A feature of HTTP is
+ the typing and negotiation of data representation, allowing systems
+ to be built independently of the data being transferred.
+
+ HTTP has been in use by the World-Wide Web global information
+ initiative since 1990. This specification defines the protocol
+ referred to as "HTTP/1.1", and is an update to <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> [33].
+
+Table of Contents
+
+ 1 Introduction ...................................................7
+ 1.1 Purpose......................................................7
+ 1.2 Requirements .................................................8
+ 1.3 Terminology ..................................................8
+ 1.4 Overall Operation ...........................................12
+ 2 Notational Conventions and Generic Grammar ....................14
+ 2.1 Augmented BNF ...............................................14
+ 2.2 Basic Rules .................................................15
+ 3 Protocol Parameters ...........................................17
+ 3.1 HTTP Version ................................................17
+ 3.2 Uniform Resource Identifiers ................................18
+ 3.2.1 General Syntax ...........................................19
+ 3.2.2 http URL .................................................19
+ 3.2.3 URI Comparison ...........................................20
+ 3.3 Date/Time Formats ...........................................20
+ 3.3.1 Full Date ................................................20
+ 3.3.2 Delta Seconds ............................................21
+ 3.4 Character Sets ..............................................21
+ 3.4.1 Missing Charset ..........................................22
+ 3.5 Content Codings .............................................23
+ 3.6 Transfer Codings ............................................24
+ 3.6.1 Chunked Transfer Coding ..................................25
+ 3.7 Media Types .................................................26
+ 3.7.1 Canonicalization and Text Defaults .......................27
+ 3.7.2 Multipart Types ..........................................27
+ 3.8 Product Tokens ..............................................28
+ 3.9 Quality Values ..............................................29
+ 3.10 Language Tags ...............................................29
+ 3.11 Entity Tags .................................................30
+ 3.12 Range Units .................................................30
+ 4 HTTP Message ..................................................31
+ 4.1 Message Types ...............................................31
+ 4.2 Message Headers .............................................31
+ 4.3 Message Body ................................................32
+ 4.4 Message Length ..............................................33
+ 4.5 General Header Fields .......................................34
+ 5 Request .......................................................35
+ 5.1 Request-Line ................................................35
+ 5.1.1 Method ...................................................36
+ 5.1.2 Request-URI ..............................................36
+ 5.2 The Resource Identified by a Request ........................38
+ 5.3 Request Header Fields .......................................38
+ 6 Response ......................................................39
+ 6.1 Status-Line .................................................39
+ 6.1.1 Status Code and Reason Phrase ............................39
+ 6.2 Response Header Fields ......................................41
+
+ 7 Entity ........................................................42
+ 7.1 Entity Header Fields ........................................42
+ 7.2 Entity Body .................................................43
+ 7.2.1 Type .....................................................43
+ 7.2.2 Entity Length ............................................43
+ 8 Connections ...................................................44
+ 8.1 Persistent Connections ......................................44
+ 8.1.1 Purpose ..................................................44
+ 8.1.2 Overall Operation ........................................45
+ 8.1.3 Proxy Servers ............................................46
+ 8.1.4 Practical Considerations .................................46
+ 8.2 Message Transmission Requirements ...........................47
+ 8.2.1 Persistent Connections and Flow Control ..................47
+ 8.2.2 Monitoring Connections for Error Status Messages .........48
+ 8.2.3 Use of the 100 (Continue) Status .........................48
+ 8.2.4 Client Behavior if Server Prematurely Closes Connection ..50
+ 9 Method Definitions ............................................51
+ 9.1 Safe and Idempotent Methods .................................51
+ 9.1.1 Safe Methods .............................................51
+ 9.1.2 Idempotent Methods .......................................51
+ 9.2 OPTIONS .....................................................52
+ 9.3 GET .........................................................53
+ 9.4 HEAD ........................................................54
+ 9.5 POST ........................................................54
+ 9.6 PUT .........................................................55
+ 9.7 DELETE ......................................................56
+ 9.8 TRACE .......................................................56
+ 9.9 CONNECT .....................................................57
+ 10 Status Code Definitions ......................................57
+ 10.1 Informational 1xx ...........................................57
+ 10.1.1 100 Continue .............................................58
+ 10.1.2 101 Switching Protocols ..................................58
+ 10.2 Successful 2xx ..............................................58
+ 10.2.1 200 OK ...................................................58
+ 10.2.2 201 Created ..............................................59
+ 10.2.3 202 Accepted .............................................59
+ 10.2.4 203 Non-Authoritative Information ........................59
+ 10.2.5 204 No Content ...........................................60
+ 10.2.6 205 Reset Content ........................................60
+ 10.2.7 206 Partial Content ......................................60
+ 10.3 Redirection 3xx .............................................61
+ 10.3.1 300 Multiple Choices .....................................61
+ 10.3.2 301 Moved Permanently ....................................62
+ 10.3.3 302 Found ................................................62
+ 10.3.4 303 See Other ............................................63
+ 10.3.5 304 Not Modified .........................................63
+ 10.3.6 305 Use Proxy ............................................64
+ 10.3.7 306 (Unused) .............................................64
+
+ 10.3.8 307 Temporary Redirect ...................................65
+ 10.4 Client Error 4xx ............................................65
+ 10.4.1 400 Bad Request .........................................65
+ 10.4.2 401 Unauthorized ........................................66
+ 10.4.3 402 Payment Required ....................................66
+ 10.4.4 403 Forbidden ...........................................66
+ 10.4.5 404 Not Found ...........................................66
+ 10.4.6 405 Method Not Allowed ..................................66
+ 10.4.7 406 Not Acceptable ......................................67
+ 10.4.8 407 Proxy Authentication Required .......................67
+ 10.4.9 408 Request Timeout .....................................67
+ 10.4.10 409 Conflict ............................................67
+ 10.4.11 410 Gone ................................................68
+ 10.4.12 411 Length Required .....................................68
+ 10.4.13 412 Precondition Failed .................................68
+ 10.4.14 413 Request Entity Too Large ............................69
+ 10.4.15 414 Request-URI Too Long ................................69
+ 10.4.16 415 Unsupported Media Type ..............................69
+ 10.4.17 416 Requested Range Not Satisfiable .....................69
+ 10.4.18 417 Expectation Failed ..................................70
+ 10.5 Server Error 5xx ............................................70
+ 10.5.1 500 Internal Server Error ................................70
+ 10.5.2 501 Not Implemented ......................................70
+ 10.5.3 502 Bad Gateway ..........................................70
+ 10.5.4 503 Service Unavailable ..................................70
+ 10.5.5 504 Gateway Timeout ......................................71
+ 10.5.6 505 HTTP Version Not Supported ...........................71
+ 11 Access Authentication ........................................71
+ 12 Content Negotiation ..........................................71
+ 12.1 Server-driven Negotiation ...................................72
+ 12.2 Agent-driven Negotiation ....................................73
+ 12.3 Transparent Negotiation .....................................74
+ 13 Caching in HTTP ..............................................74
+ 13.1.1 Cache Correctness ........................................75
+ 13.1.2 Warnings .................................................76
+ 13.1.3 Cache-control Mechanisms .................................77
+ 13.1.4 Explicit User Agent Warnings .............................78
+ 13.1.5 Exceptions to the Rules and Warnings .....................78
+ 13.1.6 Client-controlled Behavior ...............................79
+ 13.2 Expiration Model ............................................79
+ 13.2.1 Server-Specified Expiration ..............................79
+ 13.2.2 Heuristic Expiration .....................................80
+ 13.2.3 Age Calculations .........................................80
+ 13.2.4 Expiration Calculations ..................................83
+ 13.2.5 Disambiguating Expiration Values .........................84
+ 13.2.6 Disambiguating Multiple Responses ........................84
+ 13.3 Validation Model ............................................85
+ 13.3.1 Last-Modified Dates ......................................86
+
+ 13.3.2 Entity Tag Cache Validators ..............................86
+ 13.3.3 Weak and Strong Validators ...............................86
+ 13.3.4 Rules for When to Use Entity Tags and Last-Modified Dates.89
+ 13.3.5 Non-validating Conditionals ..............................90
+ 13.4 Response Cacheability .......................................91
+ 13.5 Constructing Responses From Caches ..........................92
+ 13.5.1 End-to-end and Hop-by-hop Headers ........................92
+ 13.5.2 Non-modifiable Headers ...................................92
+ 13.5.3 Combining Headers ........................................94
+ 13.5.4 Combining Byte Ranges ....................................95
+ 13.6 Caching Negotiated Responses ................................95
+ 13.7 Shared and Non-Shared Caches ................................96
+ 13.8 Errors or Incomplete Response Cache Behavior ................97
+ 13.9 Side Effects of GET and HEAD ................................97
+ 13.10 Invalidation After Updates or Deletions ...................97
+ 13.11 Write-Through Mandatory ...................................98
+ 13.12 Cache Replacement .........................................99
+ 13.13 History Lists .............................................99
+ 14 Header Field Definitions ....................................100
+ 14.1 Accept .....................................................100
+ 14.2 Accept-Charset .............................................102
+ 14.3 Accept-Encoding ............................................102
+ 14.4 Accept-Language ............................................104
+ 14.5 Accept-Ranges ..............................................105
+ 14.6 Age ........................................................106
+ 14.7 Allow ......................................................106
+ 14.8 Authorization ..............................................107
+ 14.9 Cache-Control ..............................................108
+ 14.9.1 What is Cacheable .......................................109
+ 14.9.2 What May be Stored by Caches ............................110
+ 14.9.3 Modifications of the Basic Expiration Mechanism .........111
+ 14.9.4 Cache Revalidation and Reload Controls ..................113
+ 14.9.5 No-Transform Directive ..................................115
+ 14.9.6 Cache Control Extensions ................................116
+ 14.10 Connection ...............................................117
+ 14.11 Content-Encoding .........................................118
+ 14.12 Content-Language .........................................118
+ 14.13 Content-Length ...........................................119
+ 14.14 Content-Location .........................................120
+ 14.15 Content-MD5 ..............................................121
+ 14.16 Content-Range ............................................122
+ 14.17 Content-Type .............................................124
+ 14.18 Date .....................................................124
+ 14.18.1 Clockless Origin Server Operation ......................125
+ 14.19 ETag .....................................................126
+ 14.20 Expect ...................................................126
+ 14.21 Expires ..................................................127
+ 14.22 From .....................................................128
+
+ 14.23 Host .....................................................128
+ 14.24 If-Match .................................................129
+ 14.25 If-Modified-Since ........................................130
+ 14.26 If-None-Match ............................................132
+ 14.27 If-Range .................................................133
+ 14.28 If-Unmodified-Since ......................................134
+ 14.29 Last-Modified ............................................134
+ 14.30 Location .................................................135
+ 14.31 Max-Forwards .............................................136
+ 14.32 Pragma ...................................................136
+ 14.33 Proxy-Authenticate .......................................137
+ 14.34 Proxy-Authorization ......................................137
+ 14.35 Range ....................................................138
+ 14.35.1 Byte Ranges ...........................................138
+ 14.35.2 Range Retrieval Requests ..............................139
+ 14.36 Referer ..................................................140
+ 14.37 Retry-After ..............................................141
+ 14.38 Server ...................................................141
+ 14.39 TE .......................................................142
+ 14.40 Trailer ..................................................143
+ 14.41 Transfer-Encoding..........................................143
+ 14.42 Upgrade ..................................................144
+ 14.43 User-Agent ...............................................145
+ 14.44 Vary .....................................................145
+ 14.45 Via ......................................................146
+ 14.46 Warning ..................................................148
+ 14.47 WWW-Authenticate .........................................150
+ 15 Security Considerations .......................................150
+ 15.1 Personal Information....................................151
+ 15.1.1 Abuse of Server Log Information .........................151
+ 15.1.2 Transfer of Sensitive Information .......................151
+ 15.1.3 Encoding Sensitive Information in URI's .................152
+ 15.1.4 Privacy Issues Connected to Accept Headers ..............152
+ 15.2 Attacks Based On File and Path Names .......................153
+ 15.3 DNS Spoofing ...............................................154
+ 15.4 Location Headers and Spoofing ..............................154
+ 15.5 Content-Disposition Issues .................................154
+ 15.6 Authentication Credentials and Idle Clients ................155
+ 15.7 Proxies and Caching ........................................155
+ 15.7.1 Denial of Service Attacks on Proxies....................156
+ 16 Acknowledgments .............................................156
+ 17 References ..................................................158
+ 18 Authors' Addresses ..........................................162
+ 19 Appendices ..................................................164
+ 19.1 Internet Media Type message/http and application/http ......164
+ 19.2 Internet Media Type multipart/byteranges ...................165
+ 19.3 Tolerant Applications ......................................166
+ 19.4 Differences Between HTTP Entities and <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a> Entities ....167
+
+ 19.4.1 MIME-Version ............................................167
+ 19.4.2 Conversion to Canonical Form ............................167
+ 19.4.3 Conversion of Date Formats ..............................168
+ 19.4.4 Introduction of Content-Encoding ........................168
+ 19.4.5 No Content-Transfer-Encoding ............................168
+ 19.4.6 Introduction of Transfer-Encoding .......................169
+ 19.4.7 MHTML and Line Length Limitations .......................169
+ 19.5 Additional Features ........................................169
+ 19.5.1 Content-Disposition .....................................170
+ 19.6 Compatibility with Previous Versions .......................170
+ 19.6.1 Changes from HTTP/1.0 ...................................171
+ 19.6.2 Compatibility with HTTP/1.0 Persistent Connections ......172
+ 19.6.3 Changes from <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> ...................................172
+ 20 Index .......................................................175
+ 21 Full Copyright Statement ....................................176
+
+1 Introduction
+
+1.1 Purpose
+
+ The Hypertext Transfer Protocol (HTTP) is an application-level
+ protocol for distributed, collaborative, hypermedia information
+ systems. HTTP has been in use by the World-Wide Web global
+ information initiative since 1990. The first version of HTTP,
+ referred to as HTTP/0.9, was a simple protocol for raw data transfer
+ across the Internet. HTTP/1.0, as defined by <a href="http://firefly.troll.no/rfcs/rfc1945.html">RFC 1945</a> [6], improved
+ the protocol by allowing messages to be in the format of MIME-like
+ messages, containing metainformation about the data transferred and
+ modifiers on the request/response semantics. However, HTTP/1.0 does
+ not sufficiently take into consideration the effects of hierarchical
+ proxies, caching, the need for persistent connections, or virtual
+ hosts. In addition, the proliferation of incompletely-implemented
+ applications calling themselves "HTTP/1.0" has necessitated a
+ protocol version change in order for two communicating applications
+ to determine each other's true capabilities.
+
+ This specification defines the protocol referred to as "HTTP/1.1".
+ This protocol includes more stringent requirements than HTTP/1.0 in
+ order to ensure reliable implementation of its features.
+
+ Practical information systems require more functionality than simple
+ retrieval, including search, front-end update, and annotation. HTTP
+ allows an open-ended set of methods and headers that indicate the
+ purpose of a request [47]. It builds on the discipline of reference
+ provided by the Uniform Resource Identifier (URI) [3], as a location
+ (URL) [4] or name (URN) [20], for indicating the resource to which a
+
+ method is to be applied. Messages are passed in a format similar to
+ that used by Internet mail [9] as defined by the Multipurpose
+ Internet Mail Extensions (MIME) [7].
+
+ HTTP is also used as a generic protocol for communication between
+ user agents and proxies/gateways to other Internet systems, including
+ those supported by the SMTP [16], NNTP [13], FTP [18], Gopher [2],
+ and WAIS [10] protocols. In this way, HTTP allows basic hypermedia
+ access to resources available from diverse applications.
+
+1.2 Requirements
+
+ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
+ "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
+ document are to be interpreted as described in <a href="http://firefly.troll.no/rfcs/rfc2119.html">RFC 2119</a> [34].
+
+ An implementation is not compliant if it fails to satisfy one or more
+ of the MUST or REQUIRED level requirements for the protocols it
+ implements. An implementation that satisfies all the MUST or REQUIRED
+ level and all the SHOULD level requirements for its protocols is said
+ to be "unconditionally compliant"; one that satisfies all the MUST
+ level requirements but not all the SHOULD level requirements for its
+ protocols is said to be "conditionally compliant."
+
+1.3 Terminology
+
+ This specification uses a number of terms to refer to the roles
+ played by participants in, and objects of, the HTTP communication.
+
+ connection
+ A transport layer virtual circuit established between two programs
+ for the purpose of communication.
+
+ message
+ The basic unit of HTTP communication, consisting of a structured
+ sequence of octets matching the syntax defined in section 4 and
+ transmitted via the connection.
+
+ request
+ An HTTP request message, as defined in section 5.
+
+ response
+ An HTTP response message, as defined in section 6.
+
+ resource
+ A network data object or service that can be identified by a URI,
+ as defined in section 3.2. Resources may be available in multiple
+ representations (e.g. multiple languages, data formats, size, and
+ resolutions) or vary in other ways.
+
+ entity
+ The information transferred as the payload of a request or
+ response. An entity consists of metainformation in the form of
+ entity-header fields and content in the form of an entity-body, as
+ described in section 7.
+
+ representation
+ An entity included with a response that is subject to content
+ negotiation, as described in section 12. There may exist multiple
+ representations associated with a particular response status.
+
+ content negotiation
+ The mechanism for selecting the appropriate representation when
+ servicing a request, as described in section 12. The
+ representation of entities in any response can be negotiated
+ (including error responses).
+
+ variant
+ A resource may have one, or more than one, representation(s)
+ associated with it at any given instant. Each of these
+ representations is termed a `varriant'. Use of the term `variant'
+ does not necessarily imply that the resource is subject to content
+ negotiation.
+
+ client
+ A program that establishes connections for the purpose of sending
+ requests.
+
+ user agent
+ The client which initiates a request. These are often browsers,
+ editors, spiders (web-traversing robots), or other end user tools.
+
+ server
+ An application program that accepts connections in order to
+ service requests by sending back responses. Any given program may
+ be capable of being both a client and a server; our use of these
+ terms refers only to the role being performed by the program for a
+ particular connection, rather than to the program's capabilities
+ in general. Likewise, any server may act as an origin server,
+ proxy, gateway, or tunnel, switching behavior based on the nature
+ of each request.
+
+ origin server
+ The server on which a given resource resides or is to be created.
+
+ proxy
+ An intermediary program which acts as both a server and a client
+ for the purpose of making requests on behalf of other clients.
+ Requests are serviced internally or by passing them on, with
+ possible translation, to other servers. A proxy MUST implement
+ both the client and server requirements of this specification. A
+ "transparent proxy" is a proxy that does not modify the request or
+ response beyond what is required for proxy authentication and
+ identification. A "non-transparent proxy" is a proxy that modifies
+ the request or response in order to provide some added service to
+ the user agent, such as group annotation services, media type
+ transformation, protocol reduction, or anonymity filtering. Except
+ where either transparent or non-transparent behavior is explicitly
+ stated, the HTTP proxy requirements apply to both types of
+ proxies.
+
+ gateway
+ A server which acts as an intermediary for some other server.
+ Unlike a proxy, a gateway receives requests as if it were the
+ origin server for the requested resource; the requesting client
+ may not be aware that it is communicating with a gateway.
+
+ tunnel
+ An intermediary program which is acting as a blind relay between
+ two connections. Once active, a tunnel is not considered a party
+ to the HTTP communication, though the tunnel may have been
+ initiated by an HTTP request. The tunnel ceases to exist when both
+ ends of the relayed connections are closed.
+
+ cache
+ A program's local store of response messages and the subsystem
+ that controls its message storage, retrieval, and deletion. A
+ cache stores cacheable responses in order to reduce the response
+ time and network bandwidth consumption on future, equivalent
+ requests. Any client or server may include a cache, though a cache
+ cannot be used by a server that is acting as a tunnel.
+
+ cacheable
+ A response is cacheable if a cache is allowed to store a copy of
+ the response message for use in answering subsequent requests. The
+ rules for determining the cacheability of HTTP responses are
+ defined in section 13. Even if a resource is cacheable, there may
+ be additional constraints on whether a cache can use the cached
+ copy for a particular request.
+
+ first-hand
+ A response is first-hand if it comes directly and without
+ unnecessary delay from the origin server, perhaps via one or more
+ proxies. A response is also first-hand if its validity has just
+ been checked directly with the origin server.
+
+ explicit expiration time
+ The time at which the origin server intends that an entity should
+ no longer be returned by a cache without further validation.
+
+ heuristic expiration time
+ An expiration time assigned by a cache when no explicit expiration
+ time is available.
+
+ age
+ The age of a response is the time since it was sent by, or
+ successfully validated with, the origin server.
+
+ freshness lifetime
+ The length of time between the generation of a response and its
+ expiration time.
+
+ fresh
+ A response is fresh if its age has not yet exceeded its freshness
+ lifetime.
+
+ stale
+ A response is stale if its age has passed its freshness lifetime.
+
+ semantically transparent
+ A cache behaves in a "semantically transparent" manner, with
+ respect to a particular response, when its use affects neither the
+ requesting client nor the origin server, except to improve
+ performance. When a cache is semantically transparent, the client
+ receives exactly the same response (except for hop-by-hop headers)
+ that it would have received had its request been handled directly
+ by the origin server.
+
+ validator
+ A protocol element (e.g., an entity tag or a Last-Modified time)
+ that is used to find out whether a cache entry is an equivalent
+ copy of an entity.
+
+ upstream/downstream
+ Upstream and downstream describe the flow of a message: all
+ messages flow from upstream to downstream.
+
+ inbound/outbound
+ Inbound and outbound refer to the request and response paths for
+ messages: "inbound" means "traveling toward the origin server",
+ and "outbound" means "traveling toward the user agent"
+
+1.4 Overall Operation
+
+ The HTTP protocol is a request/response protocol. A client sends a
+ request to the server in the form of a request method, URI, and
+ protocol version, followed by a MIME-like message containing request
+ modifiers, client information, and possible body content over a
+ connection with a server. The server responds with a status line,
+ including the message's protocol version and a success or error code,
+ followed by a MIME-like message containing server information, entity
+ metainformation, and possible entity-body content. The relationship
+ between HTTP and MIME is described in appendix 19.4.
+
+ Most HTTP communication is initiated by a user agent and consists of
+ a request to be applied to a resource on some origin server. In the
+ simplest case, this may be accomplished via a single connection (v)
+ between the user agent (UA) and the origin server (O).
+
+ request chain ------------------------&gt;
+ UA -------------------v------------------- O
+ &lt;----------------------- response chain
+
+ A more complicated situation occurs when one or more intermediaries
+ are present in the request/response chain. There are three common
+ forms of intermediary: proxy, gateway, and tunnel. A proxy is a
+ forwarding agent, receiving requests for a URI in its absolute form,
+ rewriting all or part of the message, and forwarding the reformatted
+ request toward the server identified by the URI. A gateway is a
+ receiving agent, acting as a layer above some other server(s) and, if
+ necessary, translating the requests to the underlying server's
+ protocol. A tunnel acts as a relay point between two connections
+ without changing the messages; tunnels are used when the
+ communication needs to pass through an intermediary (such as a
+ firewall) even when the intermediary cannot understand the contents
+ of the messages.
+
+ request chain --------------------------------------&gt;
+ UA -----v----- A -----v----- B -----v----- C -----v----- O
+ &lt;------------------------------------- response chain
+
+ The figure above shows three intermediaries (A, B, and C) between the
+ user agent and origin server. A request or response message that
+ travels the whole chain will pass through four separate connections.
+ This distinction is important because some HTTP communication options
+
+ may apply only to the connection with the nearest, non-tunnel
+ neighbor, only to the end-points of the chain, or to all connections
+ along the chain. Although the diagram is linear, each participant may
+ be engaged in multiple, simultaneous communications. For example, B
+ may be receiving requests from many clients other than A, and/or
+ forwarding requests to servers other than C, at the same time that it
+ is handling A's request.
+
+ Any party to the communication which is not acting as a tunnel may
+ employ an internal cache for handling requests. The effect of a cache
+ is that the request/response chain is shortened if one of the
+ participants along the chain has a cached response applicable to that
+ request. The following illustrates the resulting chain if B has a
+ cached copy of an earlier response from O (via C) for a request which
+ has not been cached by UA or A.
+
+ request chain ----------&gt;
+ UA -----v----- A -----v----- B - - - - - - C - - - - - - O
+ &lt;--------- response chain
+
+ Not all responses are usefully cacheable, and some requests may
+ contain modifiers which place special requirements on cache behavior.
+ HTTP requirements for cache behavior and cacheable responses are
+ defined in section 13.
+
+ In fact, there are a wide variety of architectures and configurations
+ of caches and proxies currently being experimented with or deployed
+ across the World Wide Web. These systems include national hierarchies
+ of proxy caches to save transoceanic bandwidth, systems that
+ broadcast or multicast cache entries, organizations that distribute
+ subsets of cached data via CD-ROM, and so on. HTTP systems are used
+ in corporate intranets over high-bandwidth links, and for access via
+ PDAs with low-power radio links and intermittent connectivity. The
+ goal of HTTP/1.1 is to support the wide diversity of configurations
+ already deployed while introducing protocol constructs that meet the
+ needs of those who build web applications that require high
+ reliability and, failing that, at least reliable indications of
+ failure.
+
+ HTTP communication usually takes place over TCP/IP connections. The
+ default port is TCP 80 [19], but other ports can be used. This does
+ not preclude HTTP from being implemented on top of any other protocol
+ on the Internet, or on other networks. HTTP only presumes a reliable
+ transport; any protocol that provides such guarantees can be used;
+ the mapping of the HTTP/1.1 request and response structures onto the
+ transport data units of the protocol in question is outside the scope
+ of this specification.
+
+ In HTTP/1.0, most implementations used a new connection for each
+ request/response exchange. In HTTP/1.1, a connection may be used for
+ one or more request/response exchanges, although connections may be
+ closed for a variety of reasons (see section 8.1).
+
+2 Notational Conventions and Generic Grammar
+
+2.1 Augmented BNF
+
+ All of the mechanisms specified in this document are described in
+ both prose and an augmented Backus-Naur Form (BNF) similar to that
+ used by <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9]. Implementors will need to be familiar with the
+ notation in order to understand this specification. The augmented BNF
+ includes the following constructs:
+
+ name = definition
+ The name of a rule is simply the name itself (without any
+ enclosing "&lt;" and "&gt;") and is separated from its definition by the
+ equal "=" character. White space is only significant in that
+ indentation of continuation lines is used to indicate a rule
+ definition that spans more than one line. Certain basic rules are
+ in uppercase, such as SP, LWS, HT, CRLF, DIGIT, ALPHA, etc. Angle
+ brackets are used within definitions whenever their presence will
+ facilitate discerning the use of rule names.
+
+ "literal"
+ Quotation marks surround literal text. Unless stated otherwise,
+ the text is case-insensitive.
+
+ rule1 | rule2
+ Elements separated by a bar ("|") are alternatives, e.g., "yes |
+ no" will accept yes or no.
+
+ (rule1 rule2)
+ Elements enclosed in parentheses are treated as a single element.
+ Thus, "(elem (foo | bar) elem)" allows the token sequences "elem
+ foo elem" and "elem bar elem".
+
+ *rule
+ The character "*" preceding an element indicates repetition. The
+ full form is "&lt;n&gt;*&lt;m&gt;element" indicating at least &lt;n&gt; and at most
+ &lt;m&gt; occurrences of element. Default values are 0 and infinity so
+ that "*(element)" allows any number, including zero; "1*element"
+ requires at least one; and "1*2element" allows one or two.
+
+ [rule]
+ Square brackets enclose optional elements; "[foo bar]" is
+ equivalent to "*1(foo bar)".
+
+ N rule
+ Specific repetition: "&lt;n&gt;(element)" is equivalent to
+ "&lt;n&gt;*&lt;n&gt;(element)"; that is, exactly &lt;n&gt; occurrences of (element).
+ Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
+ alphabetic characters.
+
+ #rule
+ A construct "#" is defined, similar to "*", for defining lists of
+ elements. The full form is "&lt;n&gt;#&lt;m&gt;element" indicating at least
+ &lt;n&gt; and at most &lt;m&gt; elements, each separated by one or more commas
+ (",") and OPTIONAL linear white space (LWS). This makes the usual
+ form of lists very easy; a rule such as
+ ( *LWS element *( *LWS "," *LWS element ))
+ can be shown as
+ 1#element
+ Wherever this construct is used, null elements are allowed, but do
+ not contribute to the count of elements present. That is,
+ "(element), , (element) " is permitted, but counts as only two
+ elements. Therefore, where at least one element is required, at
+ least one non-null element MUST be present. Default values are 0
+ and infinity so that "#element" allows any number, including zero;
+ "1#element" requires at least one; and "1#2element" allows one or
+ two.
+
+ ; comment
+ A semi-colon, set off some distance to the right of rule text,
+ starts a comment that continues to the end of line. This is a
+ simple way of including useful notes in parallel with the
+ specifications.
+
+ implied *LWS
+ The grammar described by this specification is word-based. Except
+ where noted otherwise, linear white space (LWS) can be included
+ between any two adjacent words (token or quoted-string), and
+ between adjacent words and separators, without changing the
+ interpretation of a field. At least one delimiter (LWS and/or
+
+ separators) MUST exist between any two tokens (for the definition
+ of "token" below), since they would otherwise be interpreted as a
+ single token.
+
+2.2 Basic Rules
+
+ The following rules are used throughout this specification to
+ describe basic parsing constructs. The US-ASCII coded character set
+ is defined by ANSI X3.4-1986 [21].
+
+ OCTET = &lt;any 8-bit sequence of data&gt;
+ CHAR = &lt;any US-ASCII character (octets 0 - 127)&gt;
+ UPALPHA = &lt;any US-ASCII uppercase letter "A".."Z"&gt;
+ LOALPHA = &lt;any US-ASCII lowercase letter "a".."z"&gt;
+ ALPHA = UPALPHA | LOALPHA
+ DIGIT = &lt;any US-ASCII digit "0".."9"&gt;
+ CTL = &lt;any US-ASCII control character
+ (octets 0 - 31) and DEL (127)&gt;
+ CR = &lt;US-ASCII CR, carriage return (13)&gt;
+ LF = &lt;US-ASCII LF, linefeed (10)&gt;
+ SP = &lt;US-ASCII SP, space (32)&gt;
+ HT = &lt;US-ASCII HT, horizontal-tab (9)&gt;
+ &lt;"&gt; = &lt;US-ASCII double-quote mark (34)&gt;
+
+ HTTP/1.1 defines the sequence CR LF as the end-of-line marker for all
+ protocol elements except the entity-body (see appendix 19.3 for
+ tolerant applications). The end-of-line marker within an entity-body
+ is defined by its associated media type, as described in section 3.7.
+
+ CRLF = CR LF
+
+ HTTP/1.1 header field values can be folded onto multiple lines if the
+ continuation line begins with a space or horizontal tab. All linear
+ white space, including folding, has the same semantics as SP. A
+ recipient MAY replace any linear white space with a single SP before
+ interpreting the field value or forwarding the message downstream.
+
+ LWS = [CRLF] 1*( SP | HT )
+
+ The TEXT rule is only used for descriptive field contents and values
+ that are not intended to be interpreted by the message parser. Words
+ of *TEXT MAY contain characters from character sets other than ISO-
+ 8859-1 [22] only when encoded according to the rules of <a href="http://firefly.troll.no/rfcs/rfc2047.html">RFC 2047</a>
+ [14].
+
+ TEXT = &lt;any OCTET except CTLs,
+ but including LWS&gt;
+
+ A CRLF is allowed in the definition of TEXT only as part of a header
+ field continuation. It is expected that the folding LWS will be
+ replaced with a single SP before interpretation of the TEXT value.
+
+ Hexadecimal numeric characters are used in several protocol elements.
+
+ HEX = "A" | "B" | "C" | "D" | "E" | "F"
+ | "a" | "b" | "c" | "d" | "e" | "f" | DIGIT
+
+ Many HTTP/1.1 header field values consist of words separated by LWS
+ or special characters. These special characters MUST be in a quoted
+ string to be used within a parameter value (as defined in section
+ 3.6).
+
+ token = 1*&lt;any CHAR except CTLs or separators&gt;
+ separators = "(" | ")" | "&lt;" | "&gt;" | "@"
+ | "," | ";" | ":" | "\" | &lt;"&gt;
+ | "/" | "[" | "]" | "?" | "="
+ | "{" | "}" | SP | HT
+
+ Comments can be included in some HTTP header fields by surrounding
+ the comment text with parentheses. Comments are only allowed in
+ fields containing "comment" as part of their field value definition.
+ In all other fields, parentheses are considered part of the field
+ value.
+
+ comment = "(" *( ctext | quoted-pair | comment ) ")"
+ ctext = &lt;any TEXT excluding "(" and ")"&gt;
+
+ A string of text is parsed as a single word if it is quoted using
+ double-quote marks.
+
+ quoted-string = ( &lt;"&gt; *(qdtext | quoted-pair ) &lt;"&gt; )
+ qdtext = &lt;any TEXT except &lt;"&gt;&gt;
+
+ The backslash character ("\") MAY be used as a single-character
+ quoting mechanism only within quoted-string and comment constructs.
+
+ quoted-pair = "\" CHAR
+
+3 Protocol Parameters
+
+3.1 HTTP Version
+
+ HTTP uses a "&lt;major&gt;.&lt;minor&gt;" numbering scheme to indicate versions
+ of the protocol. The protocol versioning policy is intended to allow
+ the sender to indicate the format of a message and its capacity for
+ understanding further HTTP communication, rather than the features
+ obtained via that communication. No change is made to the version
+ number for the addition of message components which do not affect
+ communication behavior or which only add to extensible field values.
+ The &lt;minor&gt; number is incremented when the changes made to the
+ protocol add features which do not change the general message parsing
+ algorithm, but which may add to the message semantics and imply
+ additional capabilities of the sender. The &lt;major&gt; number is
+ incremented when the format of a message within the protocol is
+ changed. See <a href="http://firefly.troll.no/rfcs/rfc2145.html">RFC 2145</a> [36] for a fuller explanation.
+
+ The version of an HTTP message is indicated by an HTTP-Version field
+ in the first line of the message.
+
+ HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
+
+ Note that the major and minor numbers MUST be treated as separate
+ integers and that each MAY be incremented higher than a single digit.
+ Thus, HTTP/2.4 is a lower version than HTTP/2.13, which in turn is
+ lower than HTTP/12.3. Leading zeros MUST be ignored by recipients and
+ MUST NOT be sent.
+
+ An application that sends a request or response message that includes
+ HTTP-Version of "HTTP/1.1" MUST be at least conditionally compliant
+ with this specification. Applications that are at least conditionally
+ compliant with this specification SHOULD use an HTTP-Version of
+ "HTTP/1.1" in their messages, and MUST do so for any message that is
+ not compatible with HTTP/1.0. For more details on when to send
+ specific HTTP-Version values, see <a href="http://firefly.troll.no/rfcs/rfc2145.html">RFC 2145</a> [36].
+
+ The HTTP version of an application is the highest HTTP version for
+ which the application is at least conditionally compliant.
+
+ Proxy and gateway applications need to be careful when forwarding
+ messages in protocol versions different from that of the application.
+ Since the protocol version indicates the protocol capability of the
+ sender, a proxy/gateway MUST NOT send a message with a version
+ indicator which is greater than its actual version. If a higher
+ version request is received, the proxy/gateway MUST either downgrade
+ the request version, or respond with an error, or switch to tunnel
+ behavior.
+
+ Due to interoperability problems with HTTP/1.0 proxies discovered
+ since the publication of <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>[33], caching proxies MUST, gateways
+ MAY, and tunnels MUST NOT upgrade the request to the highest version
+ they support. The proxy/gateway's response to that request MUST be in
+ the same major version as the request.
+
+ Note: Converting between versions of HTTP may involve modification
+ of header fields required or forbidden by the versions involved.
+
+3.2 Uniform Resource Identifiers
+
+ URIs have been known by many names: WWW addresses, Universal Document
+ Identifiers, Universal Resource Identifiers [3], and finally the
+ combination of Uniform Resource Locators (URL) [4] and Names (URN)
+ [20]. As far as HTTP is concerned, Uniform Resource Identifiers are
+ simply formatted strings which identify--via name, location, or any
+ other characteristic--a resource.
+
+3.2.1 General Syntax
+
+ URIs in HTTP can be represented in absolute form or relative to some
+ known base URI [11], depending upon the context of their use. The two
+ forms are differentiated by the fact that absolute URIs always begin
+ with a scheme name followed by a colon. For definitive information on
+ URL syntax and semantics, see "Uniform Resource Identifiers (URI):
+ Generic Syntax and Semantics," <a href="http://firefly.troll.no/rfcs/rfc2396.html">RFC 2396</a> [42] (which replaces RFCs
+ 1738 [4] and <a href="http://firefly.troll.no/rfcs/rfc1808.html">RFC 1808</a> [11]). This specification adopts the
+ definitions of "URI-reference", "absoluteURI", "relativeURI", "port",
+ "host","abs_path", "rel_path", and "authority" from that
+ specification.
+
+ The HTTP protocol does not place any a priori limit on the length of
+ a URI. Servers MUST be able to handle the URI of any resource they
+ serve, and SHOULD be able to handle URIs of unbounded length if they
+ provide GET-based forms that could generate such URIs. A server
+ SHOULD return 414 (Request-URI Too Long) status if a URI is longer
+ than the server can handle (see section 10.4.15).
+
+ Note: Servers ought to be cautious about depending on URI lengths
+ above 255 bytes, because some older client or proxy
+ implementations might not properly support these lengths.
+
+3.2.2 http URL
+
+ The "http" scheme is used to locate network resources via the HTTP
+ protocol. This section defines the scheme-specific syntax and
+ semantics for http URLs.
+
+ http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]]
+
+ If the port is empty or not given, port 80 is assumed. The semantics
+ are that the identified resource is located at the server listening
+ for TCP connections on that port of that host, and the Request-URI
+ for the resource is abs_path (section 5.1.2). The use of IP addresses
+ in URLs SHOULD be avoided whenever possible (see <a href="http://firefly.troll.no/rfcs/rfc1900.html">RFC 1900</a> [24]). If
+ the abs_path is not present in the URL, it MUST be given as "/" when
+ used as a Request-URI for a resource (section 5.1.2). If a proxy
+ receives a host name which is not a fully qualified domain name, it
+ MAY add its domain to the host name it received. If a proxy receives
+ a fully qualified domain name, the proxy MUST NOT change the host
+ name.
+
+3.2.3 URI Comparison
+
+ When comparing two URIs to decide if they match or not, a client
+ SHOULD use a case-sensitive octet-by-octet comparison of the entire
+ URIs, with these exceptions:
+
+ - A port that is empty or not given is equivalent to the default
+ port for that URI-reference;
+
+ - Comparisons of host names MUST be case-insensitive;
+
+ - Comparisons of scheme names MUST be case-insensitive;
+
+ - An empty abs_path is equivalent to an abs_path of "/".
+
+ Characters other than those in the "reserved" and "unsafe" sets (see
+ <a href="http://firefly.troll.no/rfcs/rfc2396.html">RFC 2396</a> [42]) are equivalent to their ""%" HEX HEX" encoding.
+
+ For example, the following three URIs are equivalent:
+
+ <a href="http://abc.com/%7Esmith/home.html">http://abc.com:80/~smith/home.html</a>
+ <a href="http://abc.com/%7Esmith/home.html">http://ABC.com/%7Esmith/home.html</a>
+ <a href="http://firefly.troll.no/%3CA%20HREF=" ftp:="" abc.com="" %7esmith="" home.html="">/ABC.com:/%7esmith/home.html</a>"&gt;http:/<a href="ftp://abc.com/%7esmith/home.html%3C/A%3E">/ABC.com:/%7esmith/home.html</a>
+
+3.3 Date/Time Formats
+
+3.3.1 Full Date
+
+ HTTP applications have historically allowed three different formats
+ for the representation of date/time stamps:
+
+ Sun, 06 Nov 1994 08:49:37 GMT ; <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a>, updated by <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a>
+ Sunday, 06-Nov-94 08:49:37 GMT ; <a href="http://firefly.troll.no/rfcs/rfc850.html">RFC 850</a>, obsoleted by <a href="http://firefly.troll.no/rfcs/rfc1036.html">RFC 1036</a>
+ Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
+
+ The first format is preferred as an Internet standard and represents
+ a fixed-length subset of that defined by <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a> [8] (an update to
+ <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9]). The second format is in common use, but is based on the
+ obsolete <a href="http://firefly.troll.no/rfcs/rfc850.html">RFC 850</a> [12] date format and lacks a four-digit year.
+ HTTP/1.1 clients and servers that parse the date value MUST accept
+ all three formats (for compatibility with HTTP/1.0), though they MUST
+ only generate the <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a> format for representing HTTP-date values
+ in header fields. See section 19.3 for further information.
+
+ Note: Recipients of date values are encouraged to be robust in
+ accepting date values that may have been sent by non-HTTP
+ applications, as is sometimes the case when retrieving or posting
+ messages via proxies/gateways to SMTP or NNTP.
+
+ All HTTP date/time stamps MUST be represented in Greenwich Mean Time
+ (GMT), without exception. For the purposes of HTTP, GMT is exactly
+ equal to UTC (Coordinated Universal Time). This is indicated in the
+ first two formats by the inclusion of "GMT" as the three-letter
+ abbreviation for time zone, and MUST be assumed when reading the
+ asctime format. HTTP-date is case sensitive and MUST NOT include
+ additional LWS beyond that specifically included as SP in the
+ grammar.
+
+ HTTP-date = <a href="http://firefly.troll.no/rfcs/rfc1123.html">rfc1123</a>-date | <a href="http://firefly.troll.no/rfcs/rfc850.html">rfc850</a>-date | asctime-date
+ <a href="http://firefly.troll.no/rfcs/rfc1123.html">rfc1123</a>-date = wkday "," SP date1 SP time SP "GMT"
+ <a href="http://firefly.troll.no/rfcs/rfc850.html">rfc850</a>-date = weekday "," SP date2 SP time SP "GMT"
+ asctime-date = wkday SP date3 SP time SP 4DIGIT
+ date1 = 2DIGIT SP month SP 4DIGIT
+ ; day month year (e.g., 02 Jun 1982)
+ date2 = 2DIGIT "-" month "-" 2DIGIT
+ ; day-month-year (e.g., 02-Jun-82)
+ date3 = month SP ( 2DIGIT | ( SP 1DIGIT ))
+ ; month day (e.g., Jun 2)
+ time = 2DIGIT ":" 2DIGIT ":" 2DIGIT
+ ; 00:00:00 - 23:59:59
+ wkday = "Mon" | "Tue" | "Wed"
+ | "Thu" | "Fri" | "Sat" | "Sun"
+ weekday = "Monday" | "Tuesday" | "Wednesday"
+ | "Thursday" | "Friday" | "Saturday" | "Sunday"
+ month = "Jan" | "Feb" | "Mar" | "Apr"
+ | "May" | "Jun" | "Jul" | "Aug"
+ | "Sep" | "Oct" | "Nov" | "Dec"
+
+ Note: HTTP requirements for the date/time stamp format apply only
+ to their usage within the protocol stream. Clients and servers are
+ not required to use these formats for user presentation, request
+ logging, etc.
+
+3.3.2 Delta Seconds
+
+ Some HTTP header fields allow a time value to be specified as an
+ integer number of seconds, represented in decimal, after the time
+ that the message was received.
+
+ delta-seconds = 1*DIGIT
+
+3.4 Character Sets
+
+ HTTP uses the same definition of the term "character set" as that
+ described for MIME:
+
+ The term "character set" is used in this document to refer to a
+ method used with one or more tables to convert a sequence of octets
+ into a sequence of characters. Note that unconditional conversion in
+ the other direction is not required, in that not all characters may
+ be available in a given character set and a character set may provide
+ more than one sequence of octets to represent a particular character.
+ This definition is intended to allow various kinds of character
+ encoding, from simple single-table mappings such as US-ASCII to
+ complex table switching methods such as those that use ISO-2022's
+ techniques. However, the definition associated with a MIME character
+ set name MUST fully specify the mapping to be performed from octets
+ to characters. In particular, use of external profiling information
+ to determine the exact mapping is not permitted.
+
+ Note: This use of the term "character set" is more commonly
+ referred to as a "character encoding." However, since HTTP and
+ MIME share the same registry, it is important that the terminology
+ also be shared.
+
+ HTTP character sets are identified by case-insensitive tokens. The
+ complete set of tokens is defined by the IANA Character Set registry
+ [19].
+
+ charset = token
+
+ Although HTTP allows an arbitrary token to be used as a charset
+ value, any token that has a predefined value within the IANA
+ Character Set registry [19] MUST represent the character set defined
+ by that registry. Applications SHOULD limit their use of character
+ sets to those defined by the IANA registry.
+
+ Implementors should be aware of IETF character set requirements [38]
+ [41].
+
+3.4.1 Missing Charset
+
+ Some HTTP/1.0 software has interpreted a Content-Type header without
+ charset parameter incorrectly to mean "recipient should guess."
+ Senders wishing to defeat this behavior MAY include a charset
+ parameter even when the charset is ISO-8859-1 and SHOULD do so when
+ it is known that it will not confuse the recipient.
+
+ Unfortunately, some older HTTP/1.0 clients did not deal properly with
+ an explicit charset parameter. HTTP/1.1 recipients MUST respect the
+ charset label provided by the sender; and those user agents that have
+ a provision to "guess" a charset MUST use the charset from the
+
+ content-type field if they support that charset, rather than the
+ recipient's preference, when initially displaying a document. See
+ section 3.7.1.
+
+3.5 Content Codings
+
+ Content coding values indicate an encoding transformation that has
+ been or can be applied to an entity. Content codings are primarily
+ used to allow a document to be compressed or otherwise usefully
+ transformed without losing the identity of its underlying media type
+ and without loss of information. Frequently, the entity is stored in
+ coded form, transmitted directly, and only decoded by the recipient.
+
+ content-coding = token
+
+ All content-coding values are case-insensitive. HTTP/1.1 uses
+ content-coding values in the Accept-Encoding (section 14.3) and
+ Content-Encoding (section 14.11) header fields. Although the value
+ describes the content-coding, what is more important is that it
+ indicates what decoding mechanism will be required to remove the
+ encoding.
+
+ The Internet Assigned Numbers Authority (IANA) acts as a registry for
+ content-coding value tokens. Initially, the registry contains the
+ following tokens:
+
+ gzip An encoding format produced by the file compression program
+ "gzip" (GNU zip) as described in <a href="http://firefly.troll.no/rfcs/rfc1952.html">RFC 1952</a> [25]. This format is a
+ Lempel-Ziv coding (LZ77) with a 32 bit CRC.
+
+ compress
+ The encoding format produced by the common UNIX file compression
+ program "compress". This format is an adaptive Lempel-Ziv-Welch
+ coding (LZW).
+
+ Use of program names for the identification of encoding formats
+ is not desirable and is discouraged for future encodings. Their
+ use here is representative of historical practice, not good
+ design. For compatibility with previous implementations of HTTP,
+ applications SHOULD consider "x-gzip" and "x-compress" to be
+ equivalent to "gzip" and "compress" respectively.
+
+ deflate
+ The "zlib" format defined in <a href="http://firefly.troll.no/rfcs/rfc1950.html">RFC 1950</a> [31] in combination with
+ the "deflate" compression mechanism described in <a href="http://firefly.troll.no/rfcs/rfc1951.html">RFC 1951</a> [29].
+
+ identity
+ The default (identity) encoding; the use of no transformation
+ whatsoever. This content-coding is used only in the Accept-
+ Encoding header, and SHOULD NOT be used in the Content-Encoding
+ header.
+
+ New content-coding value tokens SHOULD be registered; to allow
+ interoperability between clients and servers, specifications of the
+ content coding algorithms needed to implement a new value SHOULD be
+ publicly available and adequate for independent implementation, and
+ conform to the purpose of content coding defined in this section.
+
+3.6 Transfer Codings
+
+ Transfer-coding values are used to indicate an encoding
+ transformation that has been, can be, or may need to be applied to an
+ entity-body in order to ensure "safe transport" through the network.
+ This differs from a content coding in that the transfer-coding is a
+ property of the message, not of the original entity.
+
+ transfer-coding = "chunked" | transfer-extension
+ transfer-extension = token *( ";" parameter )
+
+ Parameters are in the form of attribute/value pairs.
+
+ parameter = attribute "=" value
+ attribute = token
+ value = token | quoted-string
+
+ All transfer-coding values are case-insensitive. HTTP/1.1 uses
+ transfer-coding values in the TE header field (section 14.39) and in
+ the Transfer-Encoding header field (section 14.41).
+
+ Whenever a transfer-coding is applied to a message-body, the set of
+ transfer-codings MUST include "chunked", unless the message is
+ terminated by closing the connection. When the "chunked" transfer-
+ coding is used, it MUST be the last transfer-coding applied to the
+ message-body. The "chunked" transfer-coding MUST NOT be applied more
+ than once to a message-body. These rules allow the recipient to
+ determine the transfer-length of the message (section 4.4).
+
+ Transfer-codings are analogous to the Content-Transfer-Encoding
+ values of MIME [7], which were designed to enable safe transport of
+ binary data over a 7-bit transport service. However, safe transport
+ has a different focus for an 8bit-clean transfer protocol. In HTTP,
+ the only unsafe characteristic of message-bodies is the difficulty in
+ determining the exact body length (section 7.2.2), or the desire to
+ encrypt data over a shared transport.
+
+ The Internet Assigned Numbers Authority (IANA) acts as a registry for
+ transfer-coding value tokens. Initially, the registry contains the
+ following tokens: "chunked" (section 3.6.1), "identity" (section
+ 3.6.2), "gzip" (section 3.5), "compress" (section 3.5), and "deflate"
+ (section 3.5).
+
+ New transfer-coding value tokens SHOULD be registered in the same way
+ as new content-coding value tokens (section 3.5).
+
+ A server which receives an entity-body with a transfer-coding it does
+ not understand SHOULD return 501 (Unimplemented), and close the
+ connection. A server MUST NOT send transfer-codings to an HTTP/1.0
+ client.
+
+3.6.1 Chunked Transfer Coding
+
+ The chunked encoding modifies the body of a message in order to
+ transfer it as a series of chunks, each with its own size indicator,
+ followed by an OPTIONAL trailer containing entity-header fields. This
+ allows dynamically produced content to be transferred along with the
+ information necessary for the recipient to verify that it has
+ received the full message.
+
+ Chunked-Body = *chunk
+ last-chunk
+ trailer
+ CRLF
+
+ chunk = chunk-size [ chunk-extension ] CRLF
+ chunk-data CRLF
+ chunk-size = 1*HEX
+ last-chunk = 1*("0") [ chunk-extension ] CRLF
+
+ chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
+ chunk-ext-name = token
+ chunk-ext-val = token | quoted-string
+ chunk-data = chunk-size(OCTET)
+ trailer = *(entity-header CRLF)
+
+ The chunk-size field is a string of hex digits indicating the size of
+ the chunk. The chunked encoding is ended by any chunk whose size is
+ zero, followed by the trailer, which is terminated by an empty line.
+
+ The trailer allows the sender to include additional HTTP header
+ fields at the end of the message. The Trailer header field can be
+ used to indicate which header fields are included in a trailer (see
+ section 14.40).
+
+ A server using chunked transfer-coding in a response MUST NOT use the
+ trailer for any header fields unless at least one of the following is
+ true:
+
+ a)the request included a TE header field that indicates "trailers" is
+ acceptable in the transfer-coding of the response, as described in
+ section 14.39; or,
+
+ b)the server is the origin server for the response, the trailer
+ fields consist entirely of optional metadata, and the recipient
+ could use the message (in a manner acceptable to the origin server)
+ without receiving this metadata. In other words, the origin server
+ is willing to accept the possibility that the trailer fields might
+ be silently discarded along the path to the client.
+
+ This requirement prevents an interoperability failure when the
+ message is being received by an HTTP/1.1 (or later) proxy and
+ forwarded to an HTTP/1.0 recipient. It avoids a situation where
+ compliance with the protocol would have necessitated a possibly
+ infinite buffer on the proxy.
+
+ An example process for decoding a Chunked-Body is presented in
+ appendix 19.4.6.
+
+ All HTTP/1.1 applications MUST be able to receive and decode the
+ "chunked" transfer-coding, and MUST ignore chunk-extension extensions
+ they do not understand.
+
+3.7 Media Types
+
+ HTTP uses Internet Media Types [17] in the Content-Type (section
+ 14.17) and Accept (section 14.1) header fields in order to provide
+ open and extensible data typing and type negotiation.
+
+ media-type = type "/" subtype *( ";" parameter )
+ type = token
+ subtype = token
+
+ Parameters MAY follow the type/subtype in the form of attribute/value
+ pairs (as defined in section 3.6).
+
+ The type, subtype, and parameter attribute names are case-
+ insensitive. Parameter values might or might not be case-sensitive,
+ depending on the semantics of the parameter name. Linear white space
+ (LWS) MUST NOT be used between the type and subtype, nor between an
+ attribute and its value. The presence or absence of a parameter might
+ be significant to the processing of a media-type, depending on its
+ definition within the media type registry.
+
+ Note that some older HTTP applications do not recognize media type
+ parameters. When sending data to older HTTP applications,
+ implementations SHOULD only use media type parameters when they are
+ required by that type/subtype definition.
+
+ Media-type values are registered with the Internet Assigned Number
+ Authority (IANA [19]). The media type registration process is
+ outlined in <a href="http://firefly.troll.no/rfcs/rfc1590.html">RFC 1590</a> [17]. Use of non-registered media types is
+ discouraged.
+
+3.7.1 Canonicalization and Text Defaults
+
+ Internet media types are registered with a canonical form. An
+ entity-body transferred via HTTP messages MUST be represented in the
+ appropriate canonical form prior to its transmission except for
+ "text" types, as defined in the next paragraph.
+
+ When in canonical form, media subtypes of the "text" type use CRLF as
+ the text line break. HTTP relaxes this requirement and allows the
+ transport of text media with plain CR or LF alone representing a line
+ break when it is done consistently for an entire entity-body. HTTP
+ applications MUST accept CRLF, bare CR, and bare LF as being
+ representative of a line break in text media received via HTTP. In
+ addition, if the text is represented in a character set that does not
+ use octets 13 and 10 for CR and LF respectively, as is the case for
+ some multi-byte character sets, HTTP allows the use of whatever octet
+ sequences are defined by that character set to represent the
+ equivalent of CR and LF for line breaks. This flexibility regarding
+ line breaks applies only to text media in the entity-body; a bare CR
+ or LF MUST NOT be substituted for CRLF within any of the HTTP control
+ structures (such as header fields and multipart boundaries).
+
+ If an entity-body is encoded with a content-coding, the underlying
+ data MUST be in a form defined above prior to being encoded.
+
+ The "charset" parameter is used with some media types to define the
+ character set (section 3.4) of the data. When no explicit charset
+ parameter is provided by the sender, media subtypes of the "text"
+ type are defined to have a default charset value of "ISO-8859-1" when
+ received via HTTP. Data in character sets other than "ISO-8859-1" or
+ its subsets MUST be labeled with an appropriate charset value. See
+ section 3.4.1 for compatibility problems.
+
+3.7.2 Multipart Types
+
+ MIME provides for a number of "multipart" types -- encapsulations of
+ one or more entities within a single message-body. All multipart
+ types share a common syntax, as defined in section 5.1.1 of <a href="http://firefly.troll.no/rfcs/rfc2046.html">RFC 2046</a>
+
+ [40], and MUST include a boundary parameter as part of the media type
+ value. The message body is itself a protocol element and MUST
+ therefore use only CRLF to represent line breaks between body-parts.
+ Unlike in <a href="http://firefly.troll.no/rfcs/rfc2046.html">RFC 2046</a>, the epilogue of any multipart message MUST be
+ empty; HTTP applications MUST NOT transmit the epilogue (even if the
+ original multipart contains an epilogue). These restrictions exist in
+ order to preserve the self-delimiting nature of a multipart message-
+ body, wherein the "end" of the message-body is indicated by the
+ ending multipart boundary.
+
+ In general, HTTP treats a multipart message-body no differently than
+ any other media type: strictly as payload. The one exception is the
+ "multipart/byteranges" type (appendix 19.2) when it appears in a 206
+ (Partial Content) response, which will be interpreted by some HTTP
+ caching mechanisms as described in sections 13.5.4 and 14.16. In all
+ other cases, an HTTP user agent SHOULD follow the same or similar
+ behavior as a MIME user agent would upon receipt of a multipart type.
+ The MIME header fields within each body-part of a multipart message-
+ body do not have any significance to HTTP beyond that defined by
+ their MIME semantics.
+
+ In general, an HTTP user agent SHOULD follow the same or similar
+ behavior as a MIME user agent would upon receipt of a multipart type.
+ If an application receives an unrecognized multipart subtype, the
+ application MUST treat it as being equivalent to "multipart/mixed".
+
+ Note: The "multipart/form-data" type has been specifically defined
+ for carrying form data suitable for processing via the POST
+ request method, as described in <a href="http://firefly.troll.no/rfcs/rfc1867.html">RFC 1867</a> [15].
+
+3.8 Product Tokens
+
+ Product tokens are used to allow communicating applications to
+ identify themselves by software name and version. Most fields using
+ product tokens also allow sub-products which form a significant part
+ of the application to be listed, separated by white space. By
+ convention, the products are listed in order of their significance
+ for identifying the application.
+
+ product = token ["/" product-version]
+ product-version = token
+
+ Examples:
+
+ User-Agent: CERN-LineMode/2.15 libwww/2.17b3
+ Server: Apache/0.8.4
+
+ Product tokens SHOULD be short and to the point. They MUST NOT be
+ used for advertising or other non-essential information. Although any
+ token character MAY appear in a product-version, this token SHOULD
+ only be used for a version identifier (i.e., successive versions of
+ the same product SHOULD only differ in the product-version portion of
+ the product value).
+
+3.9 Quality Values
+
+ HTTP content negotiation (section 12) uses short "floating point"
+ numbers to indicate the relative importance ("weight") of various
+ negotiable parameters. A weight is normalized to a real number in
+ the range 0 through 1, where 0 is the minimum and 1 the maximum
+ value. If a parameter has a quality value of 0, then content with
+ this parameter is `not acceptable' for the client. HTTP/1.1
+ applications MUST NOT generate more than three digits after the
+ decimal point. User configuration of these values SHOULD also be
+ limited in this fashion.
+
+ qvalue = ( "0" [ "." 0*3DIGIT ] )
+ | ( "1" [ "." 0*3("0") ] )
+
+ "Quality values" is a misnomer, since these values merely represent
+ relative degradation in desired quality.
+
+3.10 Language Tags
+
+ A language tag identifies a natural language spoken, written, or
+ otherwise conveyed by human beings for communication of information
+ to other human beings. Computer languages are explicitly excluded.
+ HTTP uses language tags within the Accept-Language and Content-
+ Language fields.
+
+ The syntax and registry of HTTP language tags is the same as that
+ defined by <a href="http://firefly.troll.no/rfcs/rfc1766.html">RFC 1766</a> [1]. In summary, a language tag is composed of 1
+ or more parts: A primary language tag and a possibly empty series of
+ subtags:
+
+ language-tag = primary-tag *( "-" subtag )
+ primary-tag = 1*8ALPHA
+ subtag = 1*8ALPHA
+
+ White space is not allowed within the tag and all tags are case-
+ insensitive. The name space of language tags is administered by the
+ IANA. Example tags include:
+
+ en, en-US, en-cockney, i-cherokee, x-pig-latin
+
+ where any two-letter primary-tag is an ISO-639 language abbreviation
+ and any two-letter initial subtag is an ISO-3166 country code. (The
+ last three tags above are not registered tags; all but the last are
+ examples of tags which could be registered in future.)
+
+3.11 Entity Tags
+
+ Entity tags are used for comparing two or more entities from the same
+ requested resource. HTTP/1.1 uses entity tags in the ETag (section
+ 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and
+ If-Range (section 14.27) header fields. The definition of how they
+ are used and compared as cache validators is in section 13.3.3. An
+ entity tag consists of an opaque quoted string, possibly prefixed by
+ a weakness indicator.
+
+ entity-tag = [ weak ] opaque-tag
+ weak = "W/"
+ opaque-tag = quoted-string
+
+ A "strong entity tag" MAY be shared by two entities of a resource
+ only if they are equivalent by octet equality.
+
+ A "weak entity tag," indicated by the "W/" prefix, MAY be shared by
+ two entities of a resource only if the entities are equivalent and
+ could be substituted for each other with no significant change in
+ semantics. A weak entity tag can only be used for weak comparison.
+
+ An entity tag MUST be unique across all versions of all entities
+ associated with a particular resource. A given entity tag value MAY
+ be used for entities obtained by requests on different URIs. The use
+ of the same entity tag value in conjunction with entities obtained by
+ requests on different URIs does not imply the equivalence of those
+ entities.
+
+3.12 Range Units
+
+ HTTP/1.1 allows a client to request that only part (a range of) the
+ response entity be included within the response. HTTP/1.1 uses range
+ units in the Range (section 14.35) and Content-Range (section 14.16)
+ header fields. An entity can be broken down into subranges according
+ to various structural units.
+
+ range-unit = bytes-unit | other-range-unit
+ bytes-unit = "bytes"
+ other-range-unit = token
+
+ The only range unit defined by HTTP/1.1 is "bytes". HTTP/1.1
+ implementations MAY ignore ranges specified using other units.
+
+ HTTP/1.1 has been designed to allow implementations of applications
+ that do not depend on knowledge of ranges.
+
+4 HTTP Message
+
+4.1 Message Types
+
+ HTTP messages consist of requests from client to server and responses
+ from server to client.
+
+ HTTP-message = Request | Response ; HTTP/1.1 messages
+
+ Request (section 5) and Response (section 6) messages use the generic
+ message format of <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9] for transferring entities (the payload
+ of the message). Both types of message consist of a start-line, zero
+ or more header fields (also known as "headers"), an empty line (i.e.,
+ a line with nothing preceding the CRLF) indicating the end of the
+ header fields, and possibly a message-body.
+
+ generic-message = start-line
+ *(message-header CRLF)
+ CRLF
+ [ message-body ]
+ start-line = Request-Line | Status-Line
+
+ In the interest of robustness, servers SHOULD ignore any empty
+ line(s) received where a Request-Line is expected. In other words, if
+ the server is reading the protocol stream at the beginning of a
+ message and receives a CRLF first, it should ignore the CRLF.
+
+ Certain buggy HTTP/1.0 client implementations generate extra CRLF's
+ after a POST request. To restate what is explicitly forbidden by the
+ BNF, an HTTP/1.1 client MUST NOT preface or follow a request with an
+ extra CRLF.
+
+4.2 Message Headers
+
+ HTTP header fields, which include general-header (section 4.5),
+ request-header (section 5.3), response-header (section 6.2), and
+ entity-header (section 7.1) fields, follow the same generic format as
+ that given in Section 3.1 of <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9]. Each header field consists
+ of a name followed by a colon (":") and the field value. Field names
+ are case-insensitive. The field value MAY be preceded by any amount
+ of LWS, though a single SP is preferred. Header fields can be
+ extended over multiple lines by preceding each extra line with at
+ least one SP or HT. Applications ought to follow "common form", where
+ one is known or indicated, when generating HTTP constructs, since
+ there might exist some implementations that fail to accept anything
+
+ beyond the common forms.
+
+ message-header = field-name ":" [ field-value ]
+ field-name = token
+ field-value = *( field-content | LWS )
+ field-content = &lt;the OCTETs making up the field-value
+ and consisting of either *TEXT or combinations
+ of token, separators, and quoted-string&gt;
+
+ The field-content does not include any leading or trailing LWS:
+ linear white space occurring before the first non-whitespace
+ character of the field-value or after the last non-whitespace
+ character of the field-value. Such leading or trailing LWS MAY be
+ removed without changing the semantics of the field value. Any LWS
+ that occurs between field-content MAY be replaced with a single SP
+ before interpreting the field value or forwarding the message
+ downstream.
+
+ The order in which header fields with differing field names are
+ received is not significant. However, it is "good practice" to send
+ general-header fields first, followed by request-header or response-
+ header fields, and ending with the entity-header fields.
+
+ Multiple message-header fields with the same field-name MAY be
+ present in a message if and only if the entire field-value for that
+ header field is defined as a comma-separated list [i.e., #(values)].
+ It MUST be possible to combine the multiple header fields into one
+ "field-name: field-value" pair, without changing the semantics of the
+ message, by appending each subsequent field-value to the first, each
+ separated by a comma. The order in which header fields with the same
+ field-name are received is therefore significant to the
+ interpretation of the combined field value, and thus a proxy MUST NOT
+ change the order of these field values when a message is forwarded.
+
+4.3 Message Body
+
+ The message-body (if any) of an HTTP message is used to carry the
+ entity-body associated with the request or response. The message-body
+ differs from the entity-body only when a transfer-coding has been
+ applied, as indicated by the Transfer-Encoding header field (section
+ 14.41).
+
+ message-body = entity-body
+ | &lt;entity-body encoded as per Transfer-Encoding&gt;
+
+ Transfer-Encoding MUST be used to indicate any transfer-codings
+ applied by an application to ensure safe and proper transfer of the
+ message. Transfer-Encoding is a property of the message, not of the
+
+ entity, and thus MAY be added or removed by any application along the
+ request/response chain. (However, section 3.6 places restrictions on
+ when certain transfer-codings may be used.)
+
+ The rules for when a message-body is allowed in a message differ for
+ requests and responses.
+
+ The presence of a message-body in a request is signaled by the
+ inclusion of a Content-Length or Transfer-Encoding header field in
+ the request's message-headers. A message-body MUST NOT be included in
+ a request if the specification of the request method (section 5.1.1)
+ does not allow sending an entity-body in requests. A server SHOULD
+ read and forward a message-body on any request; if the request method
+ does not include defined semantics for an entity-body, then the
+ message-body SHOULD be ignored when handling the request.
+
+ For response messages, whether or not a message-body is included with
+ a message is dependent on both the request method and the response
+ status code (section 6.1.1). All responses to the HEAD request method
+ MUST NOT include a message-body, even though the presence of entity-
+ header fields might lead one to believe they do. All 1xx
+ (informational), 204 (no content), and 304 (not modified) responses
+ MUST NOT include a message-body. All other responses do include a
+ message-body, although it MAY be of zero length.
+
+4.4 Message Length
+
+ The transfer-length of a message is the length of the message-body as
+ it appears in the message; that is, after any transfer-codings have
+ been applied. When a message-body is included with a message, the
+ transfer-length of that body is determined by one of the following
+ (in order of precedence):
+
+ 1.Any response message which "MUST NOT" include a message-body (such
+ as the 1xx, 204, and 304 responses and any response to a HEAD
+ request) is always terminated by the first empty line after the
+ header fields, regardless of the entity-header fields present in
+ the message.
+
+ 2.If a Transfer-Encoding header field (section 14.41) is present and
+ has any value other than "identity", then the transfer-length is
+ defined by use of the "chunked" transfer-coding (section 3.6),
+ unless the message is terminated by closing the connection.
+
+ 3.If a Content-Length header field (section 14.13) is present, its
+ decimal value in OCTETs represents both the entity-length and the
+ transfer-length. The Content-Length header field MUST NOT be sent
+ if these two lengths are different (i.e., if a Transfer-Encoding
+
+ header field is present). If a message is received with both a
+ Transfer-Encoding header field and a Content-Length header field,
+ the latter MUST be ignored.
+
+ 4.If the message uses the media type "multipart/byteranges", and the
+ ransfer-length is not otherwise specified, then this self-
+ elimiting media type defines the transfer-length. This media type
+ UST NOT be used unless the sender knows that the recipient can arse
+ it; the presence in a request of a Range header with ultiple byte-
+ range specifiers from a 1.1 client implies that the lient can parse
+ multipart/byteranges responses.
+
+ A range header might be forwarded by a 1.0 proxy that does not
+ understand multipart/byteranges; in this case the server MUST
+ delimit the message using methods defined in items 1,3 or 5 of
+ this section.
+
+ 5.By the server closing the connection. (Closing the connection
+ cannot be used to indicate the end of a request body, since that
+ would leave no possibility for the server to send back a response.)
+
+ For compatibility with HTTP/1.0 applications, HTTP/1.1 requests
+ containing a message-body MUST include a valid Content-Length header
+ field unless the server is known to be HTTP/1.1 compliant. If a
+ request contains a message-body and a Content-Length is not given,
+ the server SHOULD respond with 400 (bad request) if it cannot
+ determine the length of the message, or with 411 (length required) if
+ it wishes to insist on receiving a valid Content-Length.
+
+ All HTTP/1.1 applications that receive entities MUST accept the
+ "chunked" transfer-coding (section 3.6), thus allowing this mechanism
+ to be used for messages when the message length cannot be determined
+ in advance.
+
+ Messages MUST NOT include both a Content-Length header field and a
+ non-identity transfer-coding. If the message does include a non-
+ identity transfer-coding, the Content-Length MUST be ignored.
+
+ When a Content-Length is given in a message where a message-body is
+ allowed, its field value MUST exactly match the number of OCTETs in
+ the message-body. HTTP/1.1 user agents MUST notify the user when an
+ invalid length is received and detected.
+
+4.5 General Header Fields
+
+ There are a few header fields which have general applicability for
+ both request and response messages, but which do not apply to the
+ entity being transferred. These header fields apply only to the
+
+ message being transmitted.
+
+ general-header = Cache-Control ; Section 14.9
+ | Connection ; Section 14.10
+ | Date ; Section 14.18
+ | Pragma ; Section 14.32
+ | Trailer ; Section 14.40
+ | Transfer-Encoding ; Section 14.41
+ | Upgrade ; Section 14.42
+ | Via ; Section 14.45
+ | Warning ; Section 14.46
+
+ General-header field names can be extended reliably only in
+ combination with a change in the protocol version. However, new or
+ experimental header fields may be given the semantics of general
+ header fields if all parties in the communication recognize them to
+ be general-header fields. Unrecognized header fields are treated as
+ entity-header fields.
+
+5 Request
+
+ A request message from a client to a server includes, within the
+ first line of that message, the method to be applied to the resource,
+ the identifier of the resource, and the protocol version in use.
+
+ Request = Request-Line ; Section 5.1
+ *(( general-header ; Section 4.5
+ | request-header ; Section 5.3
+ | entity-header ) CRLF) ; Section 7.1
+ CRLF
+ [ message-body ] ; Section 4.3
+
+5.1 Request-Line
+
+ The Request-Line begins with a method token, followed by the
+ Request-URI and the protocol version, and ending with CRLF. The
+ elements are separated by SP characters. No CR or LF is allowed
+ except in the final CRLF sequence.
+
+ Request-Line = Method SP Request-URI SP HTTP-Version CRLF
+
+5.1.1 Method
+
+ The Method token indicates the method to be performed on the
+ resource identified by the Request-URI. The method is case-sensitive.
+
+ Method = "OPTIONS" ; Section 9.2
+ | "GET" ; Section 9.3
+ | "HEAD" ; Section 9.4
+ | "POST" ; Section 9.5
+ | "PUT" ; Section 9.6
+ | "DELETE" ; Section 9.7
+ | "TRACE" ; Section 9.8
+ | "CONNECT" ; Section 9.9
+ | extension-method
+ extension-method = token
+
+ The list of methods allowed by a resource can be specified in an
+ Allow header field (section 14.7). The return code of the response
+ always notifies the client whether a method is currently allowed on a
+ resource, since the set of allowed methods can change dynamically. An
+ origin server SHOULD return the status code 405 (Method Not Allowed)
+ if the method is known by the origin server but not allowed for the
+ requested resource, and 501 (Not Implemented) if the method is
+ unrecognized or not implemented by the origin server. The methods GET
+ and HEAD MUST be supported by all general-purpose servers. All other
+ methods are OPTIONAL; however, if the above methods are implemented,
+ they MUST be implemented with the same semantics as those specified
+ in section 9.
+
+5.1.2 Request-URI
+
+ The Request-URI is a Uniform Resource Identifier (section 3.2) and
+ identifies the resource upon which to apply the request.
+
+ Request-URI = "*" | absoluteURI | abs_path | authority
+
+ The four options for Request-URI are dependent on the nature of the
+ request. The asterisk "*" means that the request does not apply to a
+ particular resource, but to the server itself, and is only allowed
+ when the method used does not necessarily apply to a resource. One
+ example would be
+
+ OPTIONS * HTTP/1.1
+
+ The absoluteURI form is REQUIRED when the request is being made to a
+ proxy. The proxy is requested to forward the request or service it
+ from a valid cache, and return the response. Note that the proxy MAY
+ forward the request on to another proxy or directly to the server
+
+ specified by the absoluteURI. In order to avoid request loops, a
+ proxy MUST be able to recognize all of its server names, including
+ any aliases, local variations, and the numeric IP address. An example
+ Request-Line would be:
+
+ GET <a href="http://www.w3.org/pub/WWW/TheProject.html">http://www.w3.org/pub/WWW/TheProject.html</a> HTTP/1.1
+
+ To allow for transition to absoluteURIs in all requests in future
+ versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI
+ form in requests, even though HTTP/1.1 clients will only generate
+ them in requests to proxies.
+
+ The authority form is only used by the CONNECT method (section 9.9).
+
+ The most common form of Request-URI is that used to identify a
+ resource on an origin server or gateway. In this case the absolute
+ path of the URI MUST be transmitted (see section 3.2.1, abs_path) as
+ the Request-URI, and the network location of the URI (authority) MUST
+ be transmitted in a Host header field. For example, a client wishing
+ to retrieve the resource above directly from the origin server would
+ create a TCP connection to port 80 of the host "www.w3.org" and send
+ the lines:
+
+ GET /pub/WWW/TheProject.html HTTP/1.1
+ Host: www.w3.org
+
+ followed by the remainder of the Request. Note that the absolute path
+ cannot be empty; if none is present in the original URI, it MUST be
+ given as "/" (the server root).
+
+ The Request-URI is transmitted in the format specified in section
+ 3.2.1. If the Request-URI is encoded using the "% HEX HEX" encoding
+ [42], the origin server MUST decode the Request-URI in order to
+ properly interpret the request. Servers SHOULD respond to invalid
+ Request-URIs with an appropriate status code.
+
+ A transparent proxy MUST NOT rewrite the "abs_path" part of the
+ received Request-URI when forwarding it to the next inbound server,
+ except as noted above to replace a null abs_path with "/".
+
+ Note: The "no rewrite" rule prevents the proxy from changing the
+ meaning of the request when the origin server is improperly using
+ a non-reserved URI character for a reserved purpose. Implementors
+ should be aware that some pre-HTTP/1.1 proxies have been known to
+ rewrite the Request-URI.
+
+5.2 The Resource Identified by a Request
+
+ The exact resource identified by an Internet request is determined by
+ examining both the Request-URI and the Host header field.
+
+ An origin server that does not allow resources to differ by the
+ requested host MAY ignore the Host header field value when
+ determining the resource identified by an HTTP/1.1 request. (But see
+ section 19.6.1.1 for other requirements on Host support in HTTP/1.1.)
+
+ An origin server that does differentiate resources based on the host
+ requested (sometimes referred to as virtual hosts or vanity host
+ names) MUST use the following rules for determining the requested
+ resource on an HTTP/1.1 request:
+
+ 1. If Request-URI is an absoluteURI, the host is part of the
+ Request-URI. Any Host header field value in the request MUST be
+ ignored.
+
+ 2. If the Request-URI is not an absoluteURI, and the request includes
+ a Host header field, the host is determined by the Host header
+ field value.
+
+ 3. If the host as determined by rule 1 or 2 is not a valid host on
+ the server, the response MUST be a 400 (Bad Request) error message.
+
+ Recipients of an HTTP/1.0 request that lacks a Host header field MAY
+ attempt to use heuristics (e.g., examination of the URI path for
+ something unique to a particular host) in order to determine what
+ exact resource is being requested.
+
+5.3 Request Header Fields
+
+ The request-header fields allow the client to pass additional
+ information about the request, and about the client itself, to the
+ server. These fields act as request modifiers, with semantics
+ equivalent to the parameters on a programming language method
+ invocation.
+
+ request-header = Accept ; Section 14.1
+ | Accept-Charset ; Section 14.2
+ | Accept-Encoding ; Section 14.3
+ | Accept-Language ; Section 14.4
+ | Authorization ; Section 14.8
+ | Expect ; Section 14.20
+ | From ; Section 14.22
+ | Host ; Section 14.23
+ | If-Match ; Section 14.24
+
+ | If-Modified-Since ; Section 14.25
+ | If-None-Match ; Section 14.26
+ | If-Range ; Section 14.27
+ | If-Unmodified-Since ; Section 14.28
+ | Max-Forwards ; Section 14.31
+ | Proxy-Authorization ; Section 14.34
+ | Range ; Section 14.35
+ | Referer ; Section 14.36
+ | TE ; Section 14.39
+ | User-Agent ; Section 14.43
+
+ Request-header field names can be extended reliably only in
+ combination with a change in the protocol version. However, new or
+ experimental header fields MAY be given the semantics of request-
+ header fields if all parties in the communication recognize them to
+ be request-header fields. Unrecognized header fields are treated as
+ entity-header fields.
+
+6 Response
+
+ After receiving and interpreting a request message, a server responds
+ with an HTTP response message.
+
+ Response = Status-Line ; Section 6.1
+ *(( general-header ; Section 4.5
+ | response-header ; Section 6.2
+ | entity-header ) CRLF) ; Section 7.1
+ CRLF
+ [ message-body ] ; Section 7.2
+
+6.1 Status-Line
+
+ The first line of a Response message is the Status-Line, consisting
+ of the protocol version followed by a numeric status code and its
+ associated textual phrase, with each element separated by SP
+ characters. No CR or LF is allowed except in the final CRLF sequence.
+
+ Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
+
+6.1.1 Status Code and Reason Phrase
+
+ The Status-Code element is a 3-digit integer result code of the
+ attempt to understand and satisfy the request. These codes are fully
+ defined in section 10. The Reason-Phrase is intended to give a short
+ textual description of the Status-Code. The Status-Code is intended
+ for use by automata and the Reason-Phrase is intended for the human
+ user. The client is not required to examine or display the Reason-
+ Phrase.
+
+ The first digit of the Status-Code defines the class of response. The
+ last two digits do not have any categorization role. There are 5
+ values for the first digit:
+
+ - 1xx: Informational - Request received, continuing process
+
+ - 2xx: Success - The action was successfully received,
+ understood, and accepted
+
+ - 3xx: Redirection - Further action must be taken in order to
+ complete the request
+
+ - 4xx: Client Error - The request contains bad syntax or cannot
+ be fulfilled
+
+ - 5xx: Server Error - The server failed to fulfill an apparently
+ valid request
+
+ The individual values of the numeric status codes defined for
+ HTTP/1.1, and an example set of corresponding Reason-Phrase's, are
+ presented below. The reason phrases listed here are only
+ recommendations -- they MAY be replaced by local equivalents without
+ affecting the protocol.
+
+ Status-Code =
+ "100" ; Section 10.1.1: Continue
+ | "101" ; Section 10.1.2: Switching Protocols
+ | "200" ; Section 10.2.1: OK
+ | "201" ; Section 10.2.2: Created
+ | "202" ; Section 10.2.3: Accepted
+ | "203" ; Section 10.2.4: Non-Authoritative Information
+ | "204" ; Section 10.2.5: No Content
+ | "205" ; Section 10.2.6: Reset Content
+ | "206" ; Section 10.2.7: Partial Content
+ | "300" ; Section 10.3.1: Multiple Choices
+ | "301" ; Section 10.3.2: Moved Permanently
+ | "302" ; Section 10.3.3: Found
+ | "303" ; Section 10.3.4: See Other
+ | "304" ; Section 10.3.5: Not Modified
+ | "305" ; Section 10.3.6: Use Proxy
+ | "307" ; Section 10.3.8: Temporary Redirect
+ | "400" ; Section 10.4.1: Bad Request
+ | "401" ; Section 10.4.2: Unauthorized
+ | "402" ; Section 10.4.3: Payment Required
+ | "403" ; Section 10.4.4: Forbidden
+ | "404" ; Section 10.4.5: Not Found
+ | "405" ; Section 10.4.6: Method Not Allowed
+ | "406" ; Section 10.4.7: Not Acceptable
+
+ | "407" ; Section 10.4.8: Proxy Authentication Required
+ | "408" ; Section 10.4.9: Request Time-out
+ | "409" ; Section 10.4.10: Conflict
+ | "410" ; Section 10.4.11: Gone
+ | "411" ; Section 10.4.12: Length Required
+ | "412" ; Section 10.4.13: Precondition Failed
+ | "413" ; Section 10.4.14: Request Entity Too Large
+ | "414" ; Section 10.4.15: Request-URI Too Large
+ | "415" ; Section 10.4.16: Unsupported Media Type
+ | "416" ; Section 10.4.17: Requested range not satisfiable
+ | "417" ; Section 10.4.18: Expectation Failed
+ | "500" ; Section 10.5.1: Internal Server Error
+ | "501" ; Section 10.5.2: Not Implemented
+ | "502" ; Section 10.5.3: Bad Gateway
+ | "503" ; Section 10.5.4: Service Unavailable
+ | "504" ; Section 10.5.5: Gateway Time-out
+ | "505" ; Section 10.5.6: HTTP Version not supported
+ | extension-code
+
+ extension-code = 3DIGIT
+ Reason-Phrase = *&lt;TEXT, excluding CR, LF&gt;
+
+ HTTP status codes are extensible. HTTP applications are not required
+ to understand the meaning of all registered status codes, though such
+ understanding is obviously desirable. However, applications MUST
+ understand the class of any status code, as indicated by the first
+ digit, and treat any unrecognized response as being equivalent to the
+ x00 status code of that class, with the exception that an
+ unrecognized response MUST NOT be cached. For example, if an
+ unrecognized status code of 431 is received by the client, it can
+ safely assume that there was something wrong with its request and
+ treat the response as if it had received a 400 status code. In such
+ cases, user agents SHOULD present to the user the entity returned
+ with the response, since that entity is likely to include human-
+ readable information which will explain the unusual status.
+
+6.2 Response Header Fields
+
+ The response-header fields allow the server to pass additional
+ information about the response which cannot be placed in the Status-
+ Line. These header fields give information about the server and about
+ further access to the resource identified by the Request-URI.
+
+ response-header = Accept-Ranges ; Section 14.5
+ | Age ; Section 14.6
+ | ETag ; Section 14.19
+ | Location ; Section 14.30
+ | Proxy-Authenticate ; Section 14.33
+
+ | Retry-After ; Section 14.37
+ | Server ; Section 14.38
+ | Vary ; Section 14.44
+ | WWW-Authenticate ; Section 14.47
+
+ Response-header field names can be extended reliably only in
+ combination with a change in the protocol version. However, new or
+ experimental header fields MAY be given the semantics of response-
+ header fields if all parties in the communication recognize them to
+ be response-header fields. Unrecognized header fields are treated as
+ entity-header fields.
+
+7 Entity
+
+ Request and Response messages MAY transfer an entity if not otherwise
+ restricted by the request method or response status code. An entity
+ consists of entity-header fields and an entity-body, although some
+ responses will only include the entity-headers.
+
+ In this section, both sender and recipient refer to either the client
+ or the server, depending on who sends and who receives the entity.
+
+7.1 Entity Header Fields
+
+ Entity-header fields define metainformation about the entity-body or,
+ if no body is present, about the resource identified by the request.
+ Some of this metainformation is OPTIONAL; some might be REQUIRED by
+ portions of this specification.
+
+ entity-header = Allow ; Section 14.7
+ | Content-Encoding ; Section 14.11
+ | Content-Language ; Section 14.12
+ | Content-Length ; Section 14.13
+ | Content-Location ; Section 14.14
+ | Content-MD5 ; Section 14.15
+ | Content-Range ; Section 14.16
+ | Content-Type ; Section 14.17
+ | Expires ; Section 14.21
+ | Last-Modified ; Section 14.29
+ | extension-header
+
+ extension-header = message-header
+
+ The extension-header mechanism allows additional entity-header fields
+ to be defined without changing the protocol, but these fields cannot
+ be assumed to be recognizable by the recipient. Unrecognized header
+ fields SHOULD be ignored by the recipient and MUST be forwarded by
+ transparent proxies.
+
+7.2 Entity Body
+
+ The entity-body (if any) sent with an HTTP request or response is in
+ a format and encoding defined by the entity-header fields.
+
+ entity-body = *OCTET
+
+ An entity-body is only present in a message when a message-body is
+ present, as described in section 4.3. The entity-body is obtained
+ from the message-body by decoding any Transfer-Encoding that might
+ have been applied to ensure safe and proper transfer of the message.
+
+7.2.1 Type
+
+ When an entity-body is included with a message, the data type of that
+ body is determined via the header fields Content-Type and Content-
+ Encoding. These define a two-layer, ordered encoding model:
+
+ entity-body := Content-Encoding( Content-Type( data ) )
+
+ Content-Type specifies the media type of the underlying data.
+ Content-Encoding may be used to indicate any additional content
+ codings applied to the data, usually for the purpose of data
+ compression, that are a property of the requested resource. There is
+ no default encoding.
+
+ Any HTTP/1.1 message containing an entity-body SHOULD include a
+ Content-Type header field defining the media type of that body. If
+ and only if the media type is not given by a Content-Type field, the
+ recipient MAY attempt to guess the media type via inspection of its
+ content and/or the name extension(s) of the URI used to identify the
+ resource. If the media type remains unknown, the recipient SHOULD
+ treat it as type "application/octet-stream".
+
+7.2.2 Entity Length
+
+ The entity-length of a message is the length of the message-body
+ before any transfer-codings have been applied. Section 4.4 defines
+ how the transfer-length of a message-body is determined.
+
+8 Connections
+
+8.1 Persistent Connections
+
+8.1.1 Purpose
+
+ Prior to persistent connections, a separate TCP connection was
+ established to fetch each URL, increasing the load on HTTP servers
+ and causing congestion on the Internet. The use of inline images and
+ other associated data often require a client to make multiple
+ requests of the same server in a short amount of time. Analysis of
+ these performance problems and results from a prototype
+ implementation are available [26] [30]. Implementation experience and
+ measurements of actual HTTP/1.1 (<a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>) implementations show good
+ results [39]. Alternatives have also been explored, for example,
+ T/TCP [27].
+
+ Persistent HTTP connections have a number of advantages:
+
+ - By opening and closing fewer TCP connections, CPU time is saved
+ in routers and hosts (clients, servers, proxies, gateways,
+ tunnels, or caches), and memory used for TCP protocol control
+ blocks can be saved in hosts.
+
+ - HTTP requests and responses can be pipelined on a connection.
+ Pipelining allows a client to make multiple requests without
+ waiting for each response, allowing a single TCP connection to
+ be used much more efficiently, with much lower elapsed time.
+
+ - Network congestion is reduced by reducing the number of packets
+ caused by TCP opens, and by allowing TCP sufficient time to
+ determine the congestion state of the network.
+
+ - Latency on subsequent requests is reduced since there is no time
+ spent in TCP's connection opening handshake.
+
+ - HTTP can evolve more gracefully, since errors can be reported
+ without the penalty of closing the TCP connection. Clients using
+ future versions of HTTP might optimistically try a new feature,
+ but if communicating with an older server, retry with old
+ semantics after an error is reported.
+
+ HTTP implementations SHOULD implement persistent connections.
+
+8.1.2 Overall Operation
+
+ A significant difference between HTTP/1.1 and earlier versions of
+ HTTP is that persistent connections are the default behavior of any
+ HTTP connection. That is, unless otherwise indicated, the client
+ SHOULD assume that the server will maintain a persistent connection,
+ even after error responses from the server.
+
+ Persistent connections provide a mechanism by which a client and a
+ server can signal the close of a TCP connection. This signaling takes
+ place using the Connection header field (section 14.10). Once a close
+ has been signaled, the client MUST NOT send any more requests on that
+ connection.
+
+8.1.2.1 Negotiation
+
+ An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to
+ maintain a persistent connection unless a Connection header including
+ the connection-token "close" was sent in the request. If the server
+ chooses to close the connection immediately after sending the
+ response, it SHOULD send a Connection header including the
+ connection-token close.
+
+ An HTTP/1.1 client MAY expect a connection to remain open, but would
+ decide to keep it open based on whether the response from a server
+ contains a Connection header with the connection-token close. In case
+ the client does not want to maintain a connection for more than that
+ request, it SHOULD send a Connection header including the
+ connection-token close.
+
+ If either the client or the server sends the close token in the
+ Connection header, that request becomes the last one for the
+ connection.
+
+ Clients and servers SHOULD NOT assume that a persistent connection is
+ maintained for HTTP versions less than 1.1 unless it is explicitly
+ signaled. See section 19.6.2 for more information on backward
+ compatibility with HTTP/1.0 clients.
+
+ In order to remain persistent, all messages on the connection MUST
+ have a self-defined message length (i.e., one not defined by closure
+ of the connection), as described in section 4.4.
+
+8.1.2.2 Pipelining
+
+ A client that supports persistent connections MAY "pipeline" its
+ requests (i.e., send multiple requests without waiting for each
+ response). A server MUST send its responses to those requests in the
+ same order that the requests were received.
+
+ Clients which assume persistent connections and pipeline immediately
+ after connection establishment SHOULD be prepared to retry their
+ connection if the first pipelined attempt fails. If a client does
+ such a retry, it MUST NOT pipeline before it knows the connection is
+ persistent. Clients MUST also be prepared to resend their requests if
+ the server closes the connection before sending all of the
+ corresponding responses.
+
+ Clients SHOULD NOT pipeline requests using non-idempotent methods or
+ non-idempotent sequences of methods (see section 9.1.2). Otherwise, a
+ premature termination of the transport connection could lead to
+ indeterminate results. A client wishing to send a non-idempotent
+ request SHOULD wait to send that request until it has received the
+ response status for the previous request.
+
+8.1.3 Proxy Servers
+
+ It is especially important that proxies correctly implement the
+ properties of the Connection header field as specified in section
+ 14.10.
+
+ The proxy server MUST signal persistent connections separately with
+ its clients and the origin servers (or other proxy servers) that it
+ connects to. Each persistent connection applies to only one transport
+ link.
+
+ A proxy server MUST NOT establish a HTTP/1.1 persistent connection
+ with an HTTP/1.0 client (but see <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> [33] for information and
+ discussion of the problems with the Keep-Alive header implemented by
+ many HTTP/1.0 clients).
+
+8.1.4 Practical Considerations
+
+ Servers will usually have some time-out value beyond which they will
+ no longer maintain an inactive connection. Proxy servers might make
+ this a higher value since it is likely that the client will be making
+ more connections through the same server. The use of persistent
+ connections places no requirements on the length (or existence) of
+ this time-out for either the client or the server.
+
+ When a client or server wishes to time-out it SHOULD issue a graceful
+ close on the transport connection. Clients and servers SHOULD both
+ constantly watch for the other side of the transport close, and
+ respond to it as appropriate. If a client or server does not detect
+ the other side's close promptly it could cause unnecessary resource
+ drain on the network.
+
+ A client, server, or proxy MAY close the transport connection at any
+ time. For example, a client might have started to send a new request
+ at the same time that the server has decided to close the "idle"
+ connection. From the server's point of view, the connection is being
+ closed while it was idle, but from the client's point of view, a
+ request is in progress.
+
+ This means that clients, servers, and proxies MUST be able to recover
+ from asynchronous close events. Client software SHOULD reopen the
+ transport connection and retransmit the aborted sequence of requests
+ without user interaction so long as the request sequence is
+ idempotent (see section 9.1.2). Non-idempotent methods or sequences
+ MUST NOT be automatically retried, although user agents MAY offer a
+ human operator the choice of retrying the request(s). Confirmation by
+ user-agent software with semantic understanding of the application
+ MAY substitute for user confirmation. The automatic retry SHOULD NOT
+ be repeated if the second sequence of requests fails.
+
+ Servers SHOULD always respond to at least one request per connection,
+ if at all possible. Servers SHOULD NOT close a connection in the
+ middle of transmitting a response, unless a network or client failure
+ is suspected.
+
+ Clients that use persistent connections SHOULD limit the number of
+ simultaneous connections that they maintain to a given server. A
+ single-user client SHOULD NOT maintain more than 2 connections with
+ any server or proxy. A proxy SHOULD use up to 2*N connections to
+ another server or proxy, where N is the number of simultaneously
+ active users. These guidelines are intended to improve HTTP response
+ times and avoid congestion.
+
+8.2 Message Transmission Requirements
+
+8.2.1 Persistent Connections and Flow Control
+
+ HTTP/1.1 servers SHOULD maintain persistent connections and use TCP's
+ flow control mechanisms to resolve temporary overloads, rather than
+ terminating connections with the expectation that clients will retry.
+ The latter technique can exacerbate network congestion.
+
+8.2.2 Monitoring Connections for Error Status Messages
+
+ An HTTP/1.1 (or later) client sending a message-body SHOULD monitor
+ the network connection for an error status while it is transmitting
+ the request. If the client sees an error status, it SHOULD
+ immediately cease transmitting the body. If the body is being sent
+ using a "chunked" encoding (section 3.6), a zero length chunk and
+ empty trailer MAY be used to prematurely mark the end of the message.
+ If the body was preceded by a Content-Length header, the client MUST
+ close the connection.
+
+8.2.3 Use of the 100 (Continue) Status
+
+ The purpose of the 100 (Continue) status (see section 10.1.1) is to
+ allow a client that is sending a request message with a request body
+ to determine if the origin server is willing to accept the request
+ (based on the request headers) before the client sends the request
+ body. In some cases, it might either be inappropriate or highly
+ inefficient for the client to send the body if the server will reject
+ the message without looking at the body.
+
+ Requirements for HTTP/1.1 clients:
+
+ - If a client will wait for a 100 (Continue) response before
+ sending the request body, it MUST send an Expect request-header
+ field (section 14.20) with the "100-continue" expectation.
+
+ - A client MUST NOT send an Expect request-header field (section
+ 14.20) with the "100-continue" expectation if it does not intend
+ to send a request body.
+
+ Because of the presence of older implementations, the protocol allows
+ ambiguous situations in which a client may send "Expect: 100-
+ continue" without receiving either a 417 (Expectation Failed) status
+ or a 100 (Continue) status. Therefore, when a client sends this
+ header field to an origin server (possibly via a proxy) from which it
+ has never seen a 100 (Continue) status, the client SHOULD NOT wait
+ for an indefinite period before sending the request body.
+
+ Requirements for HTTP/1.1 origin servers:
+
+ - Upon receiving a request which includes an Expect request-header
+ field with the "100-continue" expectation, an origin server MUST
+ either respond with 100 (Continue) status and continue to read
+ from the input stream, or respond with a final status code. The
+ origin server MUST NOT wait for the request body before sending
+ the 100 (Continue) response. If it responds with a final status
+ code, it MAY close the transport connection or it MAY continue
+
+ to read and discard the rest of the request. It MUST NOT
+ perform the requested method if it returns a final status code.
+
+ - An origin server SHOULD NOT send a 100 (Continue) response if
+ the request message does not include an Expect request-header
+ field with the "100-continue" expectation, and MUST NOT send a
+ 100 (Continue) response if such a request comes from an HTTP/1.0
+ (or earlier) client. There is an exception to this rule: for
+ compatibility with <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>, a server MAY send a 100 (Continue)
+ status in response to an HTTP/1.1 PUT or POST request that does
+ not include an Expect request-header field with the "100-
+ continue" expectation. This exception, the purpose of which is
+ to minimize any client processing delays associated with an
+ undeclared wait for 100 (Continue) status, applies only to
+ HTTP/1.1 requests, and not to requests with any other HTTP-
+ version value.
+
+ - An origin server MAY omit a 100 (Continue) response if it has
+ already received some or all of the request body for the
+ corresponding request.
+
+ - An origin server that sends a 100 (Continue) response MUST
+ ultimately send a final status code, once the request body is
+ received and processed, unless it terminates the transport
+ connection prematurely.
+
+ - If an origin server receives a request that does not include an
+ Expect request-header field with the "100-continue" expectation,
+ the request includes a request body, and the server responds
+ with a final status code before reading the entire request body
+ from the transport connection, then the server SHOULD NOT close
+ the transport connection until it has read the entire request,
+ or until the client closes the connection. Otherwise, the client
+ might not reliably receive the response message. However, this
+ requirement is not be construed as preventing a server from
+ defending itself against denial-of-service attacks, or from
+ badly broken client implementations.
+
+ Requirements for HTTP/1.1 proxies:
+
+ - If a proxy receives a request that includes an Expect request-
+ header field with the "100-continue" expectation, and the proxy
+ either knows that the next-hop server complies with HTTP/1.1 or
+ higher, or does not know the HTTP version of the next-hop
+ server, it MUST forward the request, including the Expect header
+ field.
+
+ - If the proxy knows that the version of the next-hop server is
+ HTTP/1.0 or lower, it MUST NOT forward the request, and it MUST
+ respond with a 417 (Expectation Failed) status.
+
+ - Proxies SHOULD maintain a cache recording the HTTP version
+ numbers received from recently-referenced next-hop servers.
+
+ - A proxy MUST NOT forward a 100 (Continue) response if the
+ request message was received from an HTTP/1.0 (or earlier)
+ client and did not include an Expect request-header field with
+ the "100-continue" expectation. This requirement overrides the
+ general rule for forwarding of 1xx responses (see section 10.1).
+
+8.2.4 Client Behavior if Server Prematurely Closes Connection
+
+ If an HTTP/1.1 client sends a request which includes a request body,
+ but which does not include an Expect request-header field with the
+ "100-continue" expectation, and if the client is not directly
+ connected to an HTTP/1.1 origin server, and if the client sees the
+ connection close before receiving any status from the server, the
+ client SHOULD retry the request. If the client does retry this
+ request, it MAY use the following "binary exponential backoff"
+ algorithm to be assured of obtaining a reliable response:
+
+ 1. Initiate a new connection to the server
+
+ 2. Transmit the request-headers
+
+ 3. Initialize a variable R to the estimated round-trip time to the
+ server (e.g., based on the time it took to establish the
+ connection), or to a constant value of 5 seconds if the round-
+ trip time is not available.
+
+ 4. Compute T = R * (2**N), where N is the number of previous
+ retries of this request.
+
+ 5. Wait either for an error response from the server, or for T
+ seconds (whichever comes first)
+
+ 6. If no error response is received, after T seconds transmit the
+ body of the request.
+
+ 7. If client sees that the connection is closed prematurely,
+ repeat from step 1 until the request is accepted, an error
+ response is received, or the user becomes impatient and
+ terminates the retry process.
+
+ If at any point an error status is received, the client
+
+ - SHOULD NOT continue and
+
+ - SHOULD close the connection if it has not completed sending the
+ request message.
+
+9 Method Definitions
+
+ The set of common methods for HTTP/1.1 is defined below. Although
+ this set can be expanded, additional methods cannot be assumed to
+ share the same semantics for separately extended clients and servers.
+
+ The Host request-header field (section 14.23) MUST accompany all
+ HTTP/1.1 requests.
+
+9.1 Safe and Idempotent Methods
+
+9.1.1 Safe Methods
+
+ Implementors should be aware that the software represents the user in
+ their interactions over the Internet, and should be careful to allow
+ the user to be aware of any actions they might take which may have an
+ unexpected significance to themselves or others.
+
+ In particular, the convention has been established that the GET and
+ HEAD methods SHOULD NOT have the significance of taking an action
+ other than retrieval. These methods ought to be considered "safe".
+ This allows user agents to represent other methods, such as POST, PUT
+ and DELETE, in a special way, so that the user is made aware of the
+ fact that a possibly unsafe action is being requested.
+
+ Naturally, it is not possible to ensure that the server does not
+ generate side-effects as a result of performing a GET request; in
+ fact, some dynamic resources consider that a feature. The important
+ distinction here is that the user did not request the side-effects,
+ so therefore cannot be held accountable for them.
+
+9.1.2 Idempotent Methods
+
+ Methods can also have the property of "idempotence" in that (aside
+ from error or expiration issues) the side-effects of N &gt; 0 identical
+ requests is the same as for a single request. The methods GET, HEAD,
+ PUT and DELETE share this property. Also, the methods OPTIONS and
+ TRACE SHOULD NOT have side effects, and so are inherently idempotent.
+
+ However, it is possible that a sequence of several requests is non-
+ idempotent, even if all of the methods executed in that sequence are
+ idempotent. (A sequence is idempotent if a single execution of the
+ entire sequence always yields a result that is not changed by a
+ reexecution of all, or part, of that sequence.) For example, a
+ sequence is non-idempotent if its result depends on a value that is
+ later modified in the same sequence.
+
+ A sequence that never has side effects is idempotent, by definition
+ (provided that no concurrent operations are being executed on the
+ same set of resources).
+
+9.2 OPTIONS
+
+ The OPTIONS method represents a request for information about the
+ communication options available on the request/response chain
+ identified by the Request-URI. This method allows the client to
+ determine the options and/or requirements associated with a resource,
+ or the capabilities of a server, without implying a resource action
+ or initiating a resource retrieval.
+
+ Responses to this method are not cacheable.
+
+ If the OPTIONS request includes an entity-body (as indicated by the
+ presence of Content-Length or Transfer-Encoding), then the media type
+ MUST be indicated by a Content-Type field. Although this
+ specification does not define any use for such a body, future
+ extensions to HTTP might use the OPTIONS body to make more detailed
+ queries on the server. A server that does not support such an
+ extension MAY discard the request body.
+
+ If the Request-URI is an asterisk ("*"), the OPTIONS request is
+ intended to apply to the server in general rather than to a specific
+ resource. Since a server's communication options typically depend on
+ the resource, the "*" request is only useful as a "ping" or "no-op"
+ type of method; it does nothing beyond allowing the client to test
+ the capabilities of the server. For example, this can be used to test
+ a proxy for HTTP/1.1 compliance (or lack thereof).
+
+ If the Request-URI is not an asterisk, the OPTIONS request applies
+ only to the options that are available when communicating with that
+ resource.
+
+ A 200 response SHOULD include any header fields that indicate
+ optional features implemented by the server and applicable to that
+ resource (e.g., Allow), possibly including extensions not defined by
+ this specification. The response body, if any, SHOULD also include
+ information about the communication options. The format for such a
+
+ body is not defined by this specification, but might be defined by
+ future extensions to HTTP. Content negotiation MAY be used to select
+ the appropriate response format. If no response body is included, the
+ response MUST include a Content-Length field with a field-value of
+ "0".
+
+ The Max-Forwards request-header field MAY be used to target a
+ specific proxy in the request chain. When a proxy receives an OPTIONS
+ request on an absoluteURI for which request forwarding is permitted,
+ the proxy MUST check for a Max-Forwards field. If the Max-Forwards
+ field-value is zero ("0"), the proxy MUST NOT forward the message;
+ instead, the proxy SHOULD respond with its own communication options.
+ If the Max-Forwards field-value is an integer greater than zero, the
+ proxy MUST decrement the field-value when it forwards the request. If
+ no Max-Forwards field is present in the request, then the forwarded
+ request MUST NOT include a Max-Forwards field.
+
+9.3 GET
+
+ The GET method means retrieve whatever information (in the form of an
+ entity) is identified by the Request-URI. If the Request-URI refers
+ to a data-producing process, it is the produced data which shall be
+ returned as the entity in the response and not the source text of the
+ process, unless that text happens to be the output of the process.
+
+ The semantics of the GET method change to a "conditional GET" if the
+ request message includes an If-Modified-Since, If-Unmodified-Since,
+ If-Match, If-None-Match, or If-Range header field. A conditional GET
+ method requests that the entity be transferred only under the
+ circumstances described by the conditional header field(s). The
+ conditional GET method is intended to reduce unnecessary network
+ usage by allowing cached entities to be refreshed without requiring
+ multiple requests or transferring data already held by the client.
+
+ The semantics of the GET method change to a "partial GET" if the
+ request message includes a Range header field. A partial GET requests
+ that only part of the entity be transferred, as described in section
+ 14.35. The partial GET method is intended to reduce unnecessary
+ network usage by allowing partially-retrieved entities to be
+ completed without transferring data already held by the client.
+
+ The response to a GET request is cacheable if and only if it meets
+ the requirements for HTTP caching described in section 13.
+
+ See section 15.1.3 for security considerations when used for forms.
+
+9.4 HEAD
+
+ The HEAD method is identical to GET except that the server MUST NOT
+ return a message-body in the response. The metainformation contained
+ in the HTTP headers in response to a HEAD request SHOULD be identical
+ to the information sent in response to a GET request. This method can
+ be used for obtaining metainformation about the entity implied by the
+ request without transferring the entity-body itself. This method is
+ often used for testing hypertext links for validity, accessibility,
+ and recent modification.
+
+ The response to a HEAD request MAY be cacheable in the sense that the
+ information contained in the response MAY be used to update a
+ previously cached entity from that resource. If the new field values
+ indicate that the cached entity differs from the current entity (as
+ would be indicated by a change in Content-Length, Content-MD5, ETag
+ or Last-Modified), then the cache MUST treat the cache entry as
+ stale.
+
+9.5 POST
+
+ The POST method is used to request that the origin server accept the
+ entity enclosed in the request as a new subordinate of the resource
+ identified by the Request-URI in the Request-Line. POST is designed
+ to allow a uniform method to cover the following functions:
+
+ - Annotation of existing resources;
+
+ - Posting a message to a bulletin board, newsgroup, mailing list,
+ or similar group of articles;
+
+ - Providing a block of data, such as the result of submitting a
+ form, to a data-handling process;
+
+ - Extending a database through an append operation.
+
+ The actual function performed by the POST method is determined by the
+ server and is usually dependent on the Request-URI. The posted entity
+ is subordinate to that URI in the same way that a file is subordinate
+ to a directory containing it, a news article is subordinate to a
+ newsgroup to which it is posted, or a record is subordinate to a
+ database.
+
+ The action performed by the POST method might not result in a
+ resource that can be identified by a URI. In this case, either 200
+ (OK) or 204 (No Content) is the appropriate response status,
+ depending on whether or not the response includes an entity that
+ describes the result.
+
+ If a resource has been created on the origin server, the response
+ SHOULD be 201 (Created) and contain an entity which describes the
+ status of the request and refers to the new resource, and a Location
+ header (see section 14.30).
+
+ Responses to this method are not cacheable, unless the response
+ includes appropriate Cache-Control or Expires header fields. However,
+ the 303 (See Other) response can be used to direct the user agent to
+ retrieve a cacheable resource.
+
+ POST requests MUST obey the message transmission requirements set out
+ in section 8.2.
+
+ See section 15.1.3 for security considerations.
+
+9.6 PUT
+
+ The PUT method requests that the enclosed entity be stored under the
+ supplied Request-URI. If the Request-URI refers to an already
+ existing resource, the enclosed entity SHOULD be considered as a
+ modified version of the one residing on the origin server. If the
+ Request-URI does not point to an existing resource, and that URI is
+ capable of being defined as a new resource by the requesting user
+ agent, the origin server can create the resource with that URI. If a
+ new resource is created, the origin server MUST inform the user agent
+ via the 201 (Created) response. If an existing resource is modified,
+ either the 200 (OK) or 204 (No Content) response codes SHOULD be sent
+ to indicate successful completion of the request. If the resource
+ could not be created or modified with the Request-URI, an appropriate
+ error response SHOULD be given that reflects the nature of the
+ problem. The recipient of the entity MUST NOT ignore any Content-*
+ (e.g. Content-Range) headers that it does not understand or implement
+ and MUST return a 501 (Not Implemented) response in such cases.
+
+ If the request passes through a cache and the Request-URI identifies
+ one or more currently cached entities, those entries SHOULD be
+ treated as stale. Responses to this method are not cacheable.
+
+ The fundamental difference between the POST and PUT requests is
+ reflected in the different meaning of the Request-URI. The URI in a
+ POST request identifies the resource that will handle the enclosed
+ entity. That resource might be a data-accepting process, a gateway to
+ some other protocol, or a separate entity that accepts annotations.
+ In contrast, the URI in a PUT request identifies the entity enclosed
+ with the request -- the user agent knows what URI is intended and the
+ server MUST NOT attempt to apply the request to some other resource.
+ If the server desires that the request be applied to a different URI,
+
+ it MUST send a 301 (Moved Permanently) response; the user agent MAY
+ then make its own decision regarding whether or not to redirect the
+ request.
+
+ A single resource MAY be identified by many different URIs. For
+ example, an article might have a URI for identifying "the current
+ version" which is separate from the URI identifying each particular
+ version. In this case, a PUT request on a general URI might result in
+ several other URIs being defined by the origin server.
+
+ HTTP/1.1 does not define how a PUT method affects the state of an
+ origin server.
+
+ PUT requests MUST obey the message transmission requirements set out
+ in section 8.2.
+
+ Unless otherwise specified for a particular entity-header, the
+ entity-headers in the PUT request SHOULD be applied to the resource
+ created or modified by the PUT.
+
+9.7 DELETE
+
+ The DELETE method requests that the origin server delete the resource
+ identified by the Request-URI. This method MAY be overridden by human
+ intervention (or other means) on the origin server. The client cannot
+ be guaranteed that the operation has been carried out, even if the
+ status code returned from the origin server indicates that the action
+ has been completed successfully. However, the server SHOULD NOT
+ indicate success unless, at the time the response is given, it
+ intends to delete the resource or move it to an inaccessible
+ location.
+
+ A successful response SHOULD be 200 (OK) if the response includes an
+ entity describing the status, 202 (Accepted) if the action has not
+ yet been enacted, or 204 (No Content) if the action has been enacted
+ but the response does not include an entity.
+
+ If the request passes through a cache and the Request-URI identifies
+ one or more currently cached entities, those entries SHOULD be
+ treated as stale. Responses to this method are not cacheable.
+
+9.8 TRACE
+
+ The TRACE method is used to invoke a remote, application-layer loop-
+ back of the request message. The final recipient of the request
+ SHOULD reflect the message received back to the client as the
+ entity-body of a 200 (OK) response. The final recipient is either the
+
+ origin server or the first proxy or gateway to receive a Max-Forwards
+ value of zero (0) in the request (see section 14.31). A TRACE request
+ MUST NOT include an entity.
+
+ TRACE allows the client to see what is being received at the other
+ end of the request chain and use that data for testing or diagnostic
+ information. The value of the Via header field (section 14.45) is of
+ particular interest, since it acts as a trace of the request chain.
+ Use of the Max-Forwards header field allows the client to limit the
+ length of the request chain, which is useful for testing a chain of
+ proxies forwarding messages in an infinite loop.
+
+ If the request is valid, the response SHOULD contain the entire
+ request message in the entity-body, with a Content-Type of
+ "message/http". Responses to this method MUST NOT be cached.
+
+9.9 CONNECT
+
+ This specification reserves the method name CONNECT for use with a
+ proxy that can dynamically switch to being a tunnel (e.g. SSL
+ tunneling [44]).
+
+10 Status Code Definitions
+
+ Each Status-Code is described below, including a description of which
+ method(s) it can follow and any metainformation required in the
+ response.
+
+10.1 Informational 1xx
+
+ This class of status code indicates a provisional response,
+ consisting only of the Status-Line and optional headers, and is
+ terminated by an empty line. There are no required headers for this
+ class of status code. Since HTTP/1.0 did not define any 1xx status
+ codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client
+ except under experimental conditions.
+
+ A client MUST be prepared to accept one or more 1xx status responses
+ prior to a regular response, even if the client does not expect a 100
+ (Continue) status message. Unexpected 1xx status responses MAY be
+ ignored by a user agent.
+
+ Proxies MUST forward 1xx responses, unless the connection between the
+ proxy and its client has been closed, or unless the proxy itself
+ requested the generation of the 1xx response. (For example, if a
+
+ proxy adds a "Expect: 100-continue" field when it forwards a request,
+ then it need not forward the corresponding 100 (Continue)
+ response(s).)
+
+10.1.1 100 Continue
+
+ The client SHOULD continue with its request. This interim response is
+ used to inform the client that the initial part of the request has
+ been received and has not yet been rejected by the server. The client
+ SHOULD continue by sending the remainder of the request or, if the
+ request has already been completed, ignore this response. The server
+ MUST send a final response after the request has been completed. See
+ section 8.2.3 for detailed discussion of the use and handling of this
+ status code.
+
+10.1.2 101 Switching Protocols
+
+ The server understands and is willing to comply with the client's
+ request, via the Upgrade message header field (section 14.42), for a
+ change in the application protocol being used on this connection. The
+ server will switch protocols to those defined by the response's
+ Upgrade header field immediately after the empty line which
+ terminates the 101 response.
+
+ The protocol SHOULD be switched only when it is advantageous to do
+ so. For example, switching to a newer version of HTTP is advantageous
+ over older versions, and switching to a real-time, synchronous
+ protocol might be advantageous when delivering resources that use
+ such features.
+
+10.2 Successful 2xx
+
+ This class of status code indicates that the client's request was
+ successfully received, understood, and accepted.
+
+10.2.1 200 OK
+
+ The request has succeeded. The information returned with the response
+ is dependent on the method used in the request, for example:
+
+ GET an entity corresponding to the requested resource is sent in
+ the response;
+
+ HEAD the entity-header fields corresponding to the requested
+ resource are sent in the response without any message-body;
+
+ POST an entity describing or containing the result of the action;
+
+ TRACE an entity containing the request message as received by the
+ end server.
+
+10.2.2 201 Created
+
+ The request has been fulfilled and resulted in a new resource being
+ created. The newly created resource can be referenced by the URI(s)
+ returned in the entity of the response, with the most specific URI
+ for the resource given by a Location header field. The response
+ SHOULD include an entity containing a list of resource
+ characteristics and location(s) from which the user or user agent can
+ choose the one most appropriate. The entity format is specified by
+ the media type given in the Content-Type header field. The origin
+ server MUST create the resource before returning the 201 status code.
+ If the action cannot be carried out immediately, the server SHOULD
+ respond with 202 (Accepted) response instead.
+
+ A 201 response MAY contain an ETag response header field indicating
+ the current value of the entity tag for the requested variant just
+ created, see section 14.19.
+
+10.2.3 202 Accepted
+
+ The request has been accepted for processing, but the processing has
+ not been completed. The request might or might not eventually be
+ acted upon, as it might be disallowed when processing actually takes
+ place. There is no facility for re-sending a status code from an
+ asynchronous operation such as this.
+
+ The 202 response is intentionally non-committal. Its purpose is to
+ allow a server to accept a request for some other process (perhaps a
+ batch-oriented process that is only run once per day) without
+ requiring that the user agent's connection to the server persist
+ until the process is completed. The entity returned with this
+ response SHOULD include an indication of the request's current status
+ and either a pointer to a status monitor or some estimate of when the
+ user can expect the request to be fulfilled.
+
+10.2.4 203 Non-Authoritative Information
+
+ The returned metainformation in the entity-header is not the
+ definitive set as available from the origin server, but is gathered
+ from a local or a third-party copy. The set presented MAY be a subset
+ or superset of the original version. For example, including local
+ annotation information about the resource might result in a superset
+ of the metainformation known by the origin server. Use of this
+ response code is not required and is only appropriate when the
+ response would otherwise be 200 (OK).
+
+10.2.5 204 No Content
+
+ The server has fulfilled the request but does not need to return an
+ entity-body, and might want to return updated metainformation. The
+ response MAY include new or updated metainformation in the form of
+ entity-headers, which if present SHOULD be associated with the
+ requested variant.
+
+ If the client is a user agent, it SHOULD NOT change its document view
+ from that which caused the request to be sent. This response is
+ primarily intended to allow input for actions to take place without
+ causing a change to the user agent's active document view, although
+ any new or updated metainformation SHOULD be applied to the document
+ currently in the user agent's active view.
+
+ The 204 response MUST NOT include a message-body, and thus is always
+ terminated by the first empty line after the header fields.
+
+10.2.6 205 Reset Content
+
+ The server has fulfilled the request and the user agent SHOULD reset
+ the document view which caused the request to be sent. This response
+ is primarily intended to allow input for actions to take place via
+ user input, followed by a clearing of the form in which the input is
+ given so that the user can easily initiate another input action. The
+ response MUST NOT include an entity.
+
+10.2.7 206 Partial Content
+
+ The server has fulfilled the partial GET request for the resource.
+ The request MUST have included a Range header field (section 14.35)
+ indicating the desired range, and MAY have included an If-Range
+ header field (section 14.27) to make the request conditional.
+
+ The response MUST include the following header fields:
+
+ - Either a Content-Range header field (section 14.16) indicating
+ the range included with this response, or a multipart/byteranges
+ Content-Type including Content-Range fields for each part. If a
+ Content-Length header field is present in the response, its
+ value MUST match the actual number of OCTETs transmitted in the
+ message-body.
+
+ - Date
+
+ - ETag and/or Content-Location, if the header would have been sent
+ in a 200 response to the same request
+
+ - Expires, Cache-Control, and/or Vary, if the field-value might
+ differ from that sent in any previous response for the same
+ variant
+
+ If the 206 response is the result of an If-Range request that used a
+ strong cache validator (see section 13.3.3), the response SHOULD NOT
+ include other entity-headers. If the response is the result of an
+ If-Range request that used a weak validator, the response MUST NOT
+ include other entity-headers; this prevents inconsistencies between
+ cached entity-bodies and updated headers. Otherwise, the response
+ MUST include all of the entity-headers that would have been returned
+ with a 200 (OK) response to the same request.
+
+ A cache MUST NOT combine a 206 response with other previously cached
+ content if the ETag or Last-Modified headers do not match exactly,
+ see 13.5.4.
+
+ A cache that does not support the Range and Content-Range headers
+ MUST NOT cache 206 (Partial) responses.
+
+10.3 Redirection 3xx
+
+ This class of status code indicates that further action needs to be
+ taken by the user agent in order to fulfill the request. The action
+ required MAY be carried out by the user agent without interaction
+ with the user if and only if the method used in the second request is
+ GET or HEAD. A client SHOULD detect infinite redirection loops, since
+ such loops generate network traffic for each redirection.
+
+ Note: previous versions of this specification recommended a
+ maximum of five redirections. Content developers should be aware
+ that there might be clients that implement such a fixed
+ limitation.
+
+10.3.1 300 Multiple Choices
+
+ The requested resource corresponds to any one of a set of
+ representations, each with its own specific location, and agent-
+ driven negotiation information (section 12) is being provided so that
+ the user (or user agent) can select a preferred representation and
+ redirect its request to that location.
+
+ Unless it was a HEAD request, the response SHOULD include an entity
+ containing a list of resource characteristics and location(s) from
+ which the user or user agent can choose the one most appropriate. The
+ entity format is specified by the media type given in the Content-
+ Type header field. Depending upon the format and the capabilities of
+
+ the user agent, selection of the most appropriate choice MAY be
+ performed automatically. However, this specification does not define
+ any standard for such automatic selection.
+
+ If the server has a preferred choice of representation, it SHOULD
+ include the specific URI for that representation in the Location
+ field; user agents MAY use the Location field value for automatic
+ redirection. This response is cacheable unless indicated otherwise.
+
+10.3.2 301 Moved Permanently
+
+ The requested resource has been assigned a new permanent URI and any
+ future references to this resource SHOULD use one of the returned
+ URIs. Clients with link editing capabilities ought to automatically
+ re-link references to the Request-URI to one or more of the new
+ references returned by the server, where possible. This response is
+ cacheable unless indicated otherwise.
+
+ The new permanent URI SHOULD be given by the Location field in the
+ response. Unless the request method was HEAD, the entity of the
+ response SHOULD contain a short hypertext note with a hyperlink to
+ the new URI(s).
+
+ If the 301 status code is received in response to a request other
+ than GET or HEAD, the user agent MUST NOT automatically redirect the
+ request unless it can be confirmed by the user, since this might
+ change the conditions under which the request was issued.
+
+ Note: When automatically redirecting a POST request after
+ receiving a 301 status code, some existing HTTP/1.0 user agents
+ will erroneously change it into a GET request.
+
+10.3.3 302 Found
+
+ The requested resource resides temporarily under a different URI.
+ Since the redirection might be altered on occasion, the client SHOULD
+ continue to use the Request-URI for future requests. This response
+ is only cacheable if indicated by a Cache-Control or Expires header
+ field.
+
+ The temporary URI SHOULD be given by the Location field in the
+ response. Unless the request method was HEAD, the entity of the
+ response SHOULD contain a short hypertext note with a hyperlink to
+ the new URI(s).
+
+ If the 302 status code is received in response to a request other
+ than GET or HEAD, the user agent MUST NOT automatically redirect the
+ request unless it can be confirmed by the user, since this might
+ change the conditions under which the request was issued.
+
+ Note: <a href="http://firefly.troll.no/rfcs/rfc1945.html">RFC 1945</a> and <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> specify that the client is not allowed
+ to change the method on the redirected request. However, most
+ existing user agent implementations treat 302 as if it were a 303
+ response, performing a GET on the Location field-value regardless
+ of the original request method. The status codes 303 and 307 have
+ been added for servers that wish to make unambiguously clear which
+ kind of reaction is expected of the client.
+
+10.3.4 303 See Other
+
+ The response to the request can be found under a different URI and
+ SHOULD be retrieved using a GET method on that resource. This method
+ exists primarily to allow the output of a POST-activated script to
+ redirect the user agent to a selected resource. The new URI is not a
+ substitute reference for the originally requested resource. The 303
+ response MUST NOT be cached, but the response to the second
+ (redirected) request might be cacheable.
+
+ The different URI SHOULD be given by the Location field in the
+ response. Unless the request method was HEAD, the entity of the
+ response SHOULD contain a short hypertext note with a hyperlink to
+ the new URI(s).
+
+ Note: Many pre-HTTP/1.1 user agents do not understand the 303
+ status. When interoperability with such clients is a concern, the
+ 302 status code may be used instead, since most user agents react
+ to a 302 response as described here for 303.
+
+10.3.5 304 Not Modified
+
+ If the client has performed a conditional GET request and access is
+ allowed, but the document has not been modified, the server SHOULD
+ respond with this status code. The 304 response MUST NOT contain a
+ message-body, and thus is always terminated by the first empty line
+ after the header fields.
+
+ The response MUST include the following header fields:
+
+ - Date, unless its omission is required by section 14.18.1
+
+ If a clockless origin server obeys these rules, and proxies and
+ clients add their own Date to any response received without one (as
+ already specified by [<a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>], section 14.19), caches will operate
+ correctly.
+
+ - ETag and/or Content-Location, if the header would have been sent
+ in a 200 response to the same request
+
+ - Expires, Cache-Control, and/or Vary, if the field-value might
+ differ from that sent in any previous response for the same
+ variant
+
+ If the conditional GET used a strong cache validator (see section
+ 13.3.3), the response SHOULD NOT include other entity-headers.
+ Otherwise (i.e., the conditional GET used a weak validator), the
+ response MUST NOT include other entity-headers; this prevents
+ inconsistencies between cached entity-bodies and updated headers.
+
+ If a 304 response indicates an entity not currently cached, then the
+ cache MUST disregard the response and repeat the request without the
+ conditional.
+
+ If a cache uses a received 304 response to update a cache entry, the
+ cache MUST update the entry to reflect any new field values given in
+ the response.
+
+10.3.6 305 Use Proxy
+
+ The requested resource MUST be accessed through the proxy given by
+ the Location field. The Location field gives the URI of the proxy.
+ The recipient is expected to repeat this single request via the
+ proxy. 305 responses MUST only be generated by origin servers.
+
+ Note: <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> was not clear that 305 was intended to redirect a
+ single request, and to be generated by origin servers only. Not
+ observing these limitations has significant security consequences.
+
+10.3.7 306 (Unused)
+
+ The 306 status code was used in a previous version of the
+ specification, is no longer used, and the code is reserved.
+
+10.3.8 307 Temporary Redirect
+
+ The requested resource resides temporarily under a different URI.
+ Since the redirection MAY be altered on occasion, the client SHOULD
+ continue to use the Request-URI for future requests. This response
+ is only cacheable if indicated by a Cache-Control or Expires header
+ field.
+
+ The temporary URI SHOULD be given by the Location field in the
+ response. Unless the request method was HEAD, the entity of the
+ response SHOULD contain a short hypertext note with a hyperlink to
+ the new URI(s) , since many pre-HTTP/1.1 user agents do not
+ understand the 307 status. Therefore, the note SHOULD contain the
+ information necessary for a user to repeat the original request on
+ the new URI.
+
+ If the 307 status code is received in response to a request other
+ than GET or HEAD, the user agent MUST NOT automatically redirect the
+ request unless it can be confirmed by the user, since this might
+ change the conditions under which the request was issued.
+
+10.4 Client Error 4xx
+
+ The 4xx class of status code is intended for cases in which the
+ client seems to have erred. Except when responding to a HEAD request,
+ the server SHOULD include an entity containing an explanation of the
+ error situation, and whether it is a temporary or permanent
+ condition. These status codes are applicable to any request method.
+ User agents SHOULD display any included entity to the user.
+
+ If the client is sending data, a server implementation using TCP
+ SHOULD be careful to ensure that the client acknowledges receipt of
+ the packet(s) containing the response, before the server closes the
+ input connection. If the client continues sending data to the server
+ after the close, the server's TCP stack will send a reset packet to
+ the client, which may erase the client's unacknowledged input buffers
+ before they can be read and interpreted by the HTTP application.
+
+10.4.1 400 Bad Request
+
+ The request could not be understood by the server due to malformed
+ syntax. The client SHOULD NOT repeat the request without
+ modifications.
+
+10.4.2 401 Unauthorized
+
+ The request requires user authentication. The response MUST include a
+ WWW-Authenticate header field (section 14.47) containing a challenge
+ applicable to the requested resource. The client MAY repeat the
+ request with a suitable Authorization header field (section 14.8). If
+ the request already included Authorization credentials, then the 401
+ response indicates that authorization has been refused for those
+ credentials. If the 401 response contains the same challenge as the
+ prior response, and the user agent has already attempted
+ authentication at least once, then the user SHOULD be presented the
+ entity that was given in the response, since that entity might
+ include relevant diagnostic information. HTTP access authentication
+ is explained in "HTTP Authentication: Basic and Digest Access
+ Authentication" [43].
+
+10.4.3 402 Payment Required
+
+ This code is reserved for future use.
+
+10.4.4 403 Forbidden
+
+ The server understood the request, but is refusing to fulfill it.
+ Authorization will not help and the request SHOULD NOT be repeated.
+ If the request method was not HEAD and the server wishes to make
+ public why the request has not been fulfilled, it SHOULD describe the
+ reason for the refusal in the entity. If the server does not wish to
+ make this information available to the client, the status code 404
+ (Not Found) can be used instead.
+
+10.4.5 404 Not Found
+
+ The server has not found anything matching the Request-URI. No
+ indication is given of whether the condition is temporary or
+ permanent. The 410 (Gone) status code SHOULD be used if the server
+ knows, through some internally configurable mechanism, that an old
+ resource is permanently unavailable and has no forwarding address.
+ This status code is commonly used when the server does not wish to
+ reveal exactly why the request has been refused, or when no other
+ response is applicable.
+
+10.4.6 405 Method Not Allowed
+
+ The method specified in the Request-Line is not allowed for the
+ resource identified by the Request-URI. The response MUST include an
+ Allow header containing a list of valid methods for the requested
+ resource.
+
+10.4.7 406 Not Acceptable
+
+ The resource identified by the request is only capable of generating
+ response entities which have content characteristics not acceptable
+ according to the accept headers sent in the request.
+
+ Unless it was a HEAD request, the response SHOULD include an entity
+ containing a list of available entity characteristics and location(s)
+ from which the user or user agent can choose the one most
+ appropriate. The entity format is specified by the media type given
+ in the Content-Type header field. Depending upon the format and the
+ capabilities of the user agent, selection of the most appropriate
+ choice MAY be performed automatically. However, this specification
+ does not define any standard for such automatic selection.
+
+ Note: HTTP/1.1 servers are allowed to return responses which are
+ not acceptable according to the accept headers sent in the
+ request. In some cases, this may even be preferable to sending a
+ 406 response. User agents are encouraged to inspect the headers of
+ an incoming response to determine if it is acceptable.
+
+ If the response could be unacceptable, a user agent SHOULD
+ temporarily stop receipt of more data and query the user for a
+ decision on further actions.
+
+10.4.8 407 Proxy Authentication Required
+
+ This code is similar to 401 (Unauthorized), but indicates that the
+ client must first authenticate itself with the proxy. The proxy MUST
+ return a Proxy-Authenticate header field (section 14.33) containing a
+ challenge applicable to the proxy for the requested resource. The
+ client MAY repeat the request with a suitable Proxy-Authorization
+ header field (section 14.34). HTTP access authentication is explained
+ in "HTTP Authentication: Basic and Digest Access Authentication"
+ [43].
+
+10.4.9 408 Request Timeout
+
+ The client did not produce a request within the time that the server
+ was prepared to wait. The client MAY repeat the request without
+ modifications at any later time.
+
+10.4.10 409 Conflict
+
+ The request could not be completed due to a conflict with the current
+ state of the resource. This code is only allowed in situations where
+ it is expected that the user might be able to resolve the conflict
+ and resubmit the request. The response body SHOULD include enough
+
+ information for the user to recognize the source of the conflict.
+ Ideally, the response entity would include enough information for the
+ user or user agent to fix the problem; however, that might not be
+ possible and is not required.
+
+ Conflicts are most likely to occur in response to a PUT request. For
+ example, if versioning were being used and the entity being PUT
+ included changes to a resource which conflict with those made by an
+ earlier (third-party) request, the server might use the 409 response
+ to indicate that it can't complete the request. In this case, the
+ response entity would likely contain a list of the differences
+ between the two versions in a format defined by the response
+ Content-Type.
+
+10.4.11 410 Gone
+
+ The requested resource is no longer available at the server and no
+ forwarding address is known. This condition is expected to be
+ considered permanent. Clients with link editing capabilities SHOULD
+ delete references to the Request-URI after user approval. If the
+ server does not know, or has no facility to determine, whether or not
+ the condition is permanent, the status code 404 (Not Found) SHOULD be
+ used instead. This response is cacheable unless indicated otherwise.
+
+ The 410 response is primarily intended to assist the task of web
+ maintenance by notifying the recipient that the resource is
+ intentionally unavailable and that the server owners desire that
+ remote links to that resource be removed. Such an event is common for
+ limited-time, promotional services and for resources belonging to
+ individuals no longer working at the server's site. It is not
+ necessary to mark all permanently unavailable resources as "gone" or
+ to keep the mark for any length of time -- that is left to the
+ discretion of the server owner.
+
+10.4.12 411 Length Required
+
+ The server refuses to accept the request without a defined Content-
+ Length. The client MAY repeat the request if it adds a valid
+ Content-Length header field containing the length of the message-body
+ in the request message.
+
+10.4.13 412 Precondition Failed
+
+ The precondition given in one or more of the request-header fields
+ evaluated to false when it was tested on the server. This response
+ code allows the client to place preconditions on the current resource
+ metainformation (header field data) and thus prevent the requested
+ method from being applied to a resource other than the one intended.
+
+10.4.14 413 Request Entity Too Large
+
+ The server is refusing to process a request because the request
+ entity is larger than the server is willing or able to process. The
+ server MAY close the connection to prevent the client from continuing
+ the request.
+
+ If the condition is temporary, the server SHOULD include a Retry-
+ After header field to indicate that it is temporary and after what
+ time the client MAY try again.
+
+10.4.15 414 Request-URI Too Long
+
+ The server is refusing to service the request because the Request-URI
+ is longer than the server is willing to interpret. This rare
+ condition is only likely to occur when a client has improperly
+ converted a POST request to a GET request with long query
+ information, when the client has descended into a URI "black hole" of
+ redirection (e.g., a redirected URI prefix that points to a suffix of
+ itself), or when the server is under attack by a client attempting to
+ exploit security holes present in some servers using fixed-length
+ buffers for reading or manipulating the Request-URI.
+
+10.4.16 415 Unsupported Media Type
+
+ The server is refusing to service the request because the entity of
+ the request is in a format not supported by the requested resource
+ for the requested method.
+
+10.4.17 416 Requested Range Not Satisfiable
+
+ A server SHOULD return a response with this status code if a request
+ included a Range request-header field (section 14.35), and none of
+ the range-specifier values in this field overlap the current extent
+ of the selected resource, and the request did not include an If-Range
+ request-header field. (For byte-ranges, this means that the first-
+ byte-pos of all of the byte-range-spec values were greater than the
+ current length of the selected resource.)
+
+ When this status code is returned for a byte-range request, the
+ response SHOULD include a Content-Range entity-header field
+ specifying the current length of the selected resource (see section
+ 14.16). This response MUST NOT use the multipart/byteranges content-
+ type.
+
+10.4.18 417 Expectation Failed
+
+ The expectation given in an Expect request-header field (see section
+ 14.20) could not be met by this server, or, if the server is a proxy,
+ the server has unambiguous evidence that the request could not be met
+ by the next-hop server.
+
+10.5 Server Error 5xx
+
+ Response status codes beginning with the digit "5" indicate cases in
+ which the server is aware that it has erred or is incapable of
+ performing the request. Except when responding to a HEAD request, the
+ server SHOULD include an entity containing an explanation of the
+ error situation, and whether it is a temporary or permanent
+ condition. User agents SHOULD display any included entity to the
+ user. These response codes are applicable to any request method.
+
+10.5.1 500 Internal Server Error
+
+ The server encountered an unexpected condition which prevented it
+ from fulfilling the request.
+
+10.5.2 501 Not Implemented
+
+ The server does not support the functionality required to fulfill the
+ request. This is the appropriate response when the server does not
+ recognize the request method and is not capable of supporting it for
+ any resource.
+
+10.5.3 502 Bad Gateway
+
+ The server, while acting as a gateway or proxy, received an invalid
+ response from the upstream server it accessed in attempting to
+ fulfill the request.
+
+10.5.4 503 Service Unavailable
+
+ The server is currently unable to handle the request due to a
+ temporary overloading or maintenance of the server. The implication
+ is that this is a temporary condition which will be alleviated after
+ some delay. If known, the length of the delay MAY be indicated in a
+ Retry-After header. If no Retry-After is given, the client SHOULD
+ handle the response as it would for a 500 response.
+
+ Note: The existence of the 503 status code does not imply that a
+ server must use it when becoming overloaded. Some servers may wish
+ to simply refuse the connection.
+
+10.5.5 504 Gateway Timeout
+
+ The server, while acting as a gateway or proxy, did not receive a
+ timely response from the upstream server specified by the URI (e.g.
+ HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed
+ to access in attempting to complete the request.
+
+ Note: Note to implementors: some deployed proxies are known to
+ return 400 or 500 when DNS lookups time out.
+
+10.5.6 505 HTTP Version Not Supported
+
+ The server does not support, or refuses to support, the HTTP protocol
+ version that was used in the request message. The server is
+ indicating that it is unable or unwilling to complete the request
+ using the same major version as the client, as described in section
+ 3.1, other than with this error message. The response SHOULD contain
+ an entity describing why that version is not supported and what other
+ protocols are supported by that server.
+
+11 Access Authentication
+
+ HTTP provides several OPTIONAL challenge-response authentication
+ mechanisms which can be used by a server to challenge a client
+ request and by a client to provide authentication information. The
+ general framework for access authentication, and the specification of
+ "basic" and "digest" authentication, are specified in "HTTP
+ Authentication: Basic and Digest Access Authentication" [43]. This
+ specification adopts the definitions of "challenge" and "credentials"
+ from that specification.
+
+12 Content Negotiation
+
+ Most HTTP responses include an entity which contains information for
+ interpretation by a human user. Naturally, it is desirable to supply
+ the user with the "best available" entity corresponding to the
+ request. Unfortunately for servers and caches, not all users have the
+ same preferences for what is "best," and not all user agents are
+ equally capable of rendering all entity types. For that reason, HTTP
+ has provisions for several mechanisms for "content negotiation" --
+ the process of selecting the best representation for a given response
+ when there are multiple representations available.
+
+ Note: This is not called "format negotiation" because the
+ alternate representations may be of the same media type, but use
+ different capabilities of that type, be in different languages,
+ etc.
+
+ Any response containing an entity-body MAY be subject to negotiation,
+ including error responses.
+
+ There are two kinds of content negotiation which are possible in
+ HTTP: server-driven and agent-driven negotiation. These two kinds of
+ negotiation are orthogonal and thus may be used separately or in
+ combination. One method of combination, referred to as transparent
+ negotiation, occurs when a cache uses the agent-driven negotiation
+ information provided by the origin server in order to provide
+ server-driven negotiation for subsequent requests.
+
+12.1 Server-driven Negotiation
+
+ If the selection of the best representation for a response is made by
+ an algorithm located at the server, it is called server-driven
+ negotiation. Selection is based on the available representations of
+ the response (the dimensions over which it can vary; e.g. language,
+ content-coding, etc.) and the contents of particular header fields in
+ the request message or on other information pertaining to the request
+ (such as the network address of the client).
+
+ Server-driven negotiation is advantageous when the algorithm for
+ selecting from among the available representations is difficult to
+ describe to the user agent, or when the server desires to send its
+ "best guess" to the client along with the first response (hoping to
+ avoid the round-trip delay of a subsequent request if the "best
+ guess" is good enough for the user). In order to improve the server's
+ guess, the user agent MAY include request header fields (Accept,
+ Accept-Language, Accept-Encoding, etc.) which describe its
+ preferences for such a response.
+
+ Server-driven negotiation has disadvantages:
+
+ 1. It is impossible for the server to accurately determine what
+ might be "best" for any given user, since that would require
+ complete knowledge of both the capabilities of the user agent
+ and the intended use for the response (e.g., does the user want
+ to view it on screen or print it on paper?).
+
+ 2. Having the user agent describe its capabilities in every
+ request can be both very inefficient (given that only a small
+ percentage of responses have multiple representations) and a
+ potential violation of the user's privacy.
+
+ 3. It complicates the implementation of an origin server and the
+ algorithms for generating responses to a request.
+
+ 4. It may limit a public cache's ability to use the same response
+ for multiple user's requests.
+
+ HTTP/1.1 includes the following request-header fields for enabling
+ server-driven negotiation through description of user agent
+ capabilities and user preferences: Accept (section 14.1), Accept-
+ Charset (section 14.2), Accept-Encoding (section 14.3), Accept-
+ Language (section 14.4), and User-Agent (section 14.43). However, an
+ origin server is not limited to these dimensions and MAY vary the
+ response based on any aspect of the request, including information
+ outside the request-header fields or within extension header fields
+ not defined by this specification.
+
+ The Vary header field can be used to express the parameters the
+ server uses to select a representation that is subject to server-
+ driven negotiation. See section 13.6 for use of the Vary header field
+ by caches and section 14.44 for use of the Vary header field by
+ servers.
+
+12.2 Agent-driven Negotiation
+
+ With agent-driven negotiation, selection of the best representation
+ for a response is performed by the user agent after receiving an
+ initial response from the origin server. Selection is based on a list
+ of the available representations of the response included within the
+ header fields or entity-body of the initial response, with each
+ representation identified by its own URI. Selection from among the
+ representations may be performed automatically (if the user agent is
+ capable of doing so) or manually by the user selecting from a
+ generated (possibly hypertext) menu.
+
+ Agent-driven negotiation is advantageous when the response would vary
+ over commonly-used dimensions (such as type, language, or encoding),
+ when the origin server is unable to determine a user agent's
+ capabilities from examining the request, and generally when public
+ caches are used to distribute server load and reduce network usage.
+
+ Agent-driven negotiation suffers from the disadvantage of needing a
+ second request to obtain the best alternate representation. This
+ second request is only efficient when caching is used. In addition,
+ this specification does not define any mechanism for supporting
+ automatic selection, though it also does not prevent any such
+ mechanism from being developed as an extension and used within
+ HTTP/1.1.
+
+ HTTP/1.1 defines the 300 (Multiple Choices) and 406 (Not Acceptable)
+ status codes for enabling agent-driven negotiation when the server is
+ unwilling or unable to provide a varying response using server-driven
+ negotiation.
+
+12.3 Transparent Negotiation
+
+ Transparent negotiation is a combination of both server-driven and
+ agent-driven negotiation. When a cache is supplied with a form of the
+ list of available representations of the response (as in agent-driven
+ negotiation) and the dimensions of variance are completely understood
+ by the cache, then the cache becomes capable of performing server-
+ driven negotiation on behalf of the origin server for subsequent
+ requests on that resource.
+
+ Transparent negotiation has the advantage of distributing the
+ negotiation work that would otherwise be required of the origin
+ server and also removing the second request delay of agent-driven
+ negotiation when the cache is able to correctly guess the right
+ response.
+
+ This specification does not define any mechanism for transparent
+ negotiation, though it also does not prevent any such mechanism from
+ being developed as an extension that could be used within HTTP/1.1.
+
+13 Caching in HTTP
+
+ HTTP is typically used for distributed information systems, where
+ performance can be improved by the use of response caches. The
+ HTTP/1.1 protocol includes a number of elements intended to make
+ caching work as well as possible. Because these elements are
+ inextricable from other aspects of the protocol, and because they
+ interact with each other, it is useful to describe the basic caching
+ design of HTTP separately from the detailed descriptions of methods,
+ headers, response codes, etc.
+
+ Caching would be useless if it did not significantly improve
+ performance. The goal of caching in HTTP/1.1 is to eliminate the need
+ to send requests in many cases, and to eliminate the need to send
+ full responses in many other cases. The former reduces the number of
+ network round-trips required for many operations; we use an
+ "expiration" mechanism for this purpose (see section 13.2). The
+ latter reduces network bandwidth requirements; we use a "validation"
+ mechanism for this purpose (see section 13.3).
+
+ Requirements for performance, availability, and disconnected
+ operation require us to be able to relax the goal of semantic
+ transparency. The HTTP/1.1 protocol allows origin servers, caches,
+
+ and clients to explicitly reduce transparency when necessary.
+ However, because non-transparent operation may confuse non-expert
+ users, and might be incompatible with certain server applications
+ (such as those for ordering merchandise), the protocol requires that
+ transparency be relaxed
+
+ - only by an explicit protocol-level request when relaxed by
+ client or origin server
+
+ - only with an explicit warning to the end user when relaxed by
+ cache or client
+
+ Therefore, the HTTP/1.1 protocol provides these important elements:
+
+ 1. Protocol features that provide full semantic transparency when
+ this is required by all parties.
+
+ 2. Protocol features that allow an origin server or user agent to
+ explicitly request and control non-transparent operation.
+
+ 3. Protocol features that allow a cache to attach warnings to
+ responses that do not preserve the requested approximation of
+ semantic transparency.
+
+ A basic principle is that it must be possible for the clients to
+ detect any potential relaxation of semantic transparency.
+
+ Note: The server, cache, or client implementor might be faced with
+ design decisions not explicitly discussed in this specification.
+ If a decision might affect semantic transparency, the implementor
+ ought to err on the side of maintaining transparency unless a
+ careful and complete analysis shows significant benefits in
+ breaking transparency.
+
+13.1.1 Cache Correctness
+
+ A correct cache MUST respond to a request with the most up-to-date
+ response held by the cache that is appropriate to the request (see
+ sections 13.2.5, 13.2.6, and 13.12) which meets one of the following
+ conditions:
+
+ 1. It has been checked for equivalence with what the origin server
+ would have returned by revalidating the response with the
+ origin server (section 13.3);
+
+ 2. It is "fresh enough" (see section 13.2). In the default case,
+ this means it meets the least restrictive freshness requirement
+ of the client, origin server, and cache (see section 14.9); if
+ the origin server so specifies, it is the freshness requirement
+ of the origin server alone.
+
+ If a stored response is not "fresh enough" by the most
+ restrictive freshness requirement of both the client and the
+ origin server, in carefully considered circumstances the cache
+ MAY still return the response with the appropriate Warning
+ header (see section 13.1.5 and 14.46), unless such a response
+ is prohibited (e.g., by a "no-store" cache-directive, or by a
+ "no-cache" cache-request-directive; see section 14.9).
+
+ 3. It is an appropriate 304 (Not Modified), 305 (Proxy Redirect),
+ or error (4xx or 5xx) response message.
+
+ If the cache can not communicate with the origin server, then a
+ correct cache SHOULD respond as above if the response can be
+ correctly served from the cache; if not it MUST return an error or
+ warning indicating that there was a communication failure.
+
+ If a cache receives a response (either an entire response, or a 304
+ (Not Modified) response) that it would normally forward to the
+ requesting client, and the received response is no longer fresh, the
+ cache SHOULD forward it to the requesting client without adding a new
+ Warning (but without removing any existing Warning headers). A cache
+ SHOULD NOT attempt to revalidate a response simply because that
+ response became stale in transit; this might lead to an infinite
+ loop. A user agent that receives a stale response without a Warning
+ MAY display a warning indication to the user.
+
+13.1.2 Warnings
+
+ Whenever a cache returns a response that is neither first-hand nor
+ "fresh enough" (in the sense of condition 2 in section 13.1.1), it
+ MUST attach a warning to that effect, using a Warning general-header.
+ The Warning header and the currently defined warnings are described
+ in section 14.46. The warning allows clients to take appropriate
+ action.
+
+ Warnings MAY be used for other purposes, both cache-related and
+ otherwise. The use of a warning, rather than an error status code,
+ distinguish these responses from true failures.
+
+ Warnings are assigned three digit warn-codes. The first digit
+ indicates whether the Warning MUST or MUST NOT be deleted from a
+ stored cache entry after a successful revalidation:
+
+ 1xx Warnings that describe the freshness or revalidation status of
+ the response, and so MUST be deleted after a successful
+ revalidation. 1XX warn-codes MAY be generated by a cache only when
+ validating a cached entry. It MUST NOT be generated by clients.
+
+ 2xx Warnings that describe some aspect of the entity body or entity
+ headers that is not rectified by a revalidation (for example, a
+ lossy compression of the entity bodies) and which MUST NOT be
+ deleted after a successful revalidation.
+
+ See section 14.46 for the definitions of the codes themselves.
+
+ HTTP/1.0 caches will cache all Warnings in responses, without
+ deleting the ones in the first category. Warnings in responses that
+ are passed to HTTP/1.0 caches carry an extra warning-date field,
+ which prevents a future HTTP/1.1 recipient from believing an
+ erroneously cached Warning.
+
+ Warnings also carry a warning text. The text MAY be in any
+ appropriate natural language (perhaps based on the client's Accept
+ headers), and include an OPTIONAL indication of what character set is
+ used.
+
+ Multiple warnings MAY be attached to a response (either by the origin
+ server or by a cache), including multiple warnings with the same code
+ number. For example, a server might provide the same warning with
+ texts in both English and Basque.
+
+ When multiple warnings are attached to a response, it might not be
+ practical or reasonable to display all of them to the user. This
+ version of HTTP does not specify strict priority rules for deciding
+ which warnings to display and in what order, but does suggest some
+ heuristics.
+
+13.1.3 Cache-control Mechanisms
+
+ The basic cache mechanisms in HTTP/1.1 (server-specified expiration
+ times and validators) are implicit directives to caches. In some
+ cases, a server or client might need to provide explicit directives
+ to the HTTP caches. We use the Cache-Control header for this purpose.
+
+ The Cache-Control header allows a client or server to transmit a
+ variety of directives in either requests or responses. These
+ directives typically override the default caching algorithms. As a
+ general rule, if there is any apparent conflict between header
+ values, the most restrictive interpretation is applied (that is, the
+ one that is most likely to preserve semantic transparency). However,
+
+ in some cases, cache-control directives are explicitly specified as
+ weakening the approximation of semantic transparency (for example,
+ "max-stale" or "public").
+
+ The cache-control directives are described in detail in section 14.9.
+
+13.1.4 Explicit User Agent Warnings
+
+ Many user agents make it possible for users to override the basic
+ caching mechanisms. For example, the user agent might allow the user
+ to specify that cached entities (even explicitly stale ones) are
+ never validated. Or the user agent might habitually add "Cache-
+ Control: max-stale=3600" to every request. The user agent SHOULD NOT
+ default to either non-transparent behavior, or behavior that results
+ in abnormally ineffective caching, but MAY be explicitly configured
+ to do so by an explicit action of the user.
+
+ If the user has overridden the basic caching mechanisms, the user
+ agent SHOULD explicitly indicate to the user whenever this results in
+ the display of information that might not meet the server's
+ transparency requirements (in particular, if the displayed entity is
+ known to be stale). Since the protocol normally allows the user agent
+ to determine if responses are stale or not, this indication need only
+ be displayed when this actually happens. The indication need not be a
+ dialog box; it could be an icon (for example, a picture of a rotting
+ fish) or some other indicator.
+
+ If the user has overridden the caching mechanisms in a way that would
+ abnormally reduce the effectiveness of caches, the user agent SHOULD
+ continually indicate this state to the user (for example, by a
+ display of a picture of currency in flames) so that the user does not
+ inadvertently consume excess resources or suffer from excessive
+ latency.
+
+13.1.5 Exceptions to the Rules and Warnings
+
+ In some cases, the operator of a cache MAY choose to configure it to
+ return stale responses even when not requested by clients. This
+ decision ought not be made lightly, but may be necessary for reasons
+ of availability or performance, especially when the cache is poorly
+ connected to the origin server. Whenever a cache returns a stale
+ response, it MUST mark it as such (using a Warning header) enabling
+ the client software to alert the user that there might be a potential
+ problem.
+
+ It also allows the user agent to take steps to obtain a first-hand or
+ fresh response. For this reason, a cache SHOULD NOT return a stale
+ response if the client explicitly requests a first-hand or fresh one,
+ unless it is impossible to comply for technical or policy reasons.
+
+13.1.6 Client-controlled Behavior
+
+ While the origin server (and to a lesser extent, intermediate caches,
+ by their contribution to the age of a response) are the primary
+ source of expiration information, in some cases the client might need
+ to control a cache's decision about whether to return a cached
+ response without validating it. Clients do this using several
+ directives of the Cache-Control header.
+
+ A client's request MAY specify the maximum age it is willing to
+ accept of an unvalidated response; specifying a value of zero forces
+ the cache(s) to revalidate all responses. A client MAY also specify
+ the minimum time remaining before a response expires. Both of these
+ options increase constraints on the behavior of caches, and so cannot
+ further relax the cache's approximation of semantic transparency.
+
+ A client MAY also specify that it will accept stale responses, up to
+ some maximum amount of staleness. This loosens the constraints on the
+ caches, and so might violate the origin server's specified
+ constraints on semantic transparency, but might be necessary to
+ support disconnected operation, or high availability in the face of
+ poor connectivity.
+
+13.2 Expiration Model
+
+13.2.1 Server-Specified Expiration
+
+ HTTP caching works best when caches can entirely avoid making
+ requests to the origin server. The primary mechanism for avoiding
+ requests is for an origin server to provide an explicit expiration
+ time in the future, indicating that a response MAY be used to satisfy
+ subsequent requests. In other words, a cache can return a fresh
+ response without first contacting the server.
+
+ Our expectation is that servers will assign future explicit
+ expiration times to responses in the belief that the entity is not
+ likely to change, in a semantically significant way, before the
+ expiration time is reached. This normally preserves semantic
+ transparency, as long as the server's expiration times are carefully
+ chosen.
+
+ The expiration mechanism applies only to responses taken from a cache
+ and not to first-hand responses forwarded immediately to the
+ requesting client.
+
+ If an origin server wishes to force a semantically transparent cache
+ to validate every request, it MAY assign an explicit expiration time
+ in the past. This means that the response is always stale, and so the
+ cache SHOULD validate it before using it for subsequent requests. See
+ section 14.9.4 for a more restrictive way to force revalidation.
+
+ If an origin server wishes to force any HTTP/1.1 cache, no matter how
+ it is configured, to validate every request, it SHOULD use the "must-
+ revalidate" cache-control directive (see section 14.9).
+
+ Servers specify explicit expiration times using either the Expires
+ header, or the max-age directive of the Cache-Control header.
+
+ An expiration time cannot be used to force a user agent to refresh
+ its display or reload a resource; its semantics apply only to caching
+ mechanisms, and such mechanisms need only check a resource's
+ expiration status when a new request for that resource is initiated.
+ See section 13.13 for an explanation of the difference between caches
+ and history mechanisms.
+
+13.2.2 Heuristic Expiration
+
+ Since origin servers do not always provide explicit expiration times,
+ HTTP caches typically assign heuristic expiration times, employing
+ algorithms that use other header values (such as the Last-Modified
+ time) to estimate a plausible expiration time. The HTTP/1.1
+ specification does not provide specific algorithms, but does impose
+ worst-case constraints on their results. Since heuristic expiration
+ times might compromise semantic transparency, they ought to used
+ cautiously, and we encourage origin servers to provide explicit
+ expiration times as much as possible.
+
+13.2.3 Age Calculations
+
+ In order to know if a cached entry is fresh, a cache needs to know if
+ its age exceeds its freshness lifetime. We discuss how to calculate
+ the latter in section 13.2.4; this section describes how to calculate
+ the age of a response or cache entry.
+
+ In this discussion, we use the term "now" to mean "the current value
+ of the clock at the host performing the calculation." Hosts that use
+ HTTP, but especially hosts running origin servers and caches, SHOULD
+ use NTP [28] or some similar protocol to synchronize their clocks to
+ a globally accurate time standard.
+
+ HTTP/1.1 requires origin servers to send a Date header, if possible,
+ with every response, giving the time at which the response was
+ generated (see section 14.18). We use the term "date_value" to denote
+ the value of the Date header, in a form appropriate for arithmetic
+ operations.
+
+ HTTP/1.1 uses the Age response-header to convey the estimated age of
+ the response message when obtained from a cache. The Age field value
+ is the cache's estimate of the amount of time since the response was
+ generated or revalidated by the origin server.
+
+ In essence, the Age value is the sum of the time that the response
+ has been resident in each of the caches along the path from the
+ origin server, plus the amount of time it has been in transit along
+ network paths.
+
+ We use the term "age_value" to denote the value of the Age header, in
+ a form appropriate for arithmetic operations.
+
+ A response's age can be calculated in two entirely independent ways:
+
+ 1. now minus date_value, if the local clock is reasonably well
+ synchronized to the origin server's clock. If the result is
+ negative, the result is replaced by zero.
+
+ 2. age_value, if all of the caches along the response path
+ implement HTTP/1.1.
+
+ Given that we have two independent ways to compute the age of a
+ response when it is received, we can combine these as
+
+ corrected_received_age = max(now - date_value, age_value)
+
+ and as long as we have either nearly synchronized clocks or all-
+ HTTP/1.1 paths, one gets a reliable (conservative) result.
+
+ Because of network-imposed delays, some significant interval might
+ pass between the time that a server generates a response and the time
+ it is received at the next outbound cache or client. If uncorrected,
+ this delay could result in improperly low ages.
+
+ Because the request that resulted in the returned Age value must have
+ been initiated prior to that Age value's generation, we can correct
+ for delays imposed by the network by recording the time at which the
+ request was initiated. Then, when an Age value is received, it MUST
+ be interpreted relative to the time the request was initiated, not
+
+ the time that the response was received. This algorithm results in
+ conservative behavior no matter how much delay is experienced. So, we
+ compute:
+
+ corrected_initial_age = corrected_received_age
+ + (now - request_time)
+
+ where "request_time" is the time (according to the local clock) when
+ the request that elicited this response was sent.
+
+ Summary of age calculation algorithm, when a cache receives a
+ response:
+
+ /*
+ * age_value
+ * is the value of Age: header received by the cache with
+ * this response.
+ * date_value
+ * is the value of the origin server's Date: header
+ * request_time
+ * is the (local) time when the cache made the request
+ * that resulted in this cached response
+ * response_time
+ * is the (local) time when the cache received the
+ * response
+ * now
+ * is the current (local) time
+ */
+
+ apparent_age = max(0, response_time - date_value);
+ corrected_received_age = max(apparent_age, age_value);
+ response_delay = response_time - request_time;
+ corrected_initial_age = corrected_received_age + response_delay;
+ resident_time = now - response_time;
+ current_age = corrected_initial_age + resident_time;
+
+ The current_age of a cache entry is calculated by adding the amount
+ of time (in seconds) since the cache entry was last validated by the
+ origin server to the corrected_initial_age. When a response is
+ generated from a cache entry, the cache MUST include a single Age
+ header field in the response with a value equal to the cache entry's
+ current_age.
+
+ The presence of an Age header field in a response implies that a
+ response is not first-hand. However, the converse is not true, since
+ the lack of an Age header field in a response does not imply that the
+
+ response is first-hand unless all caches along the request path are
+ compliant with HTTP/1.1 (i.e., older HTTP caches did not implement
+ the Age header field).
+
+13.2.4 Expiration Calculations
+
+ In order to decide whether a response is fresh or stale, we need to
+ compare its freshness lifetime to its age. The age is calculated as
+ described in section 13.2.3; this section describes how to calculate
+ the freshness lifetime, and to determine if a response has expired.
+ In the discussion below, the values can be represented in any form
+ appropriate for arithmetic operations.
+
+ We use the term "expires_value" to denote the value of the Expires
+ header. We use the term "max_age_value" to denote an appropriate
+ value of the number of seconds carried by the "max-age" directive of
+ the Cache-Control header in a response (see section 14.9.3).
+
+ The max-age directive takes priority over Expires, so if max-age is
+ present in a response, the calculation is simply:
+
+ freshness_lifetime = max_age_value
+
+ Otherwise, if Expires is present in the response, the calculation is:
+
+ freshness_lifetime = expires_value - date_value
+
+ Note that neither of these calculations is vulnerable to clock skew,
+ since all of the information comes from the origin server.
+
+ If none of Expires, Cache-Control: max-age, or Cache-Control: s-
+ maxage (see section 14.9.3) appears in the response, and the response
+ does not include other restrictions on caching, the cache MAY compute
+ a freshness lifetime using a heuristic. The cache MUST attach Warning
+ 113 to any response whose age is more than 24 hours if such warning
+ has not already been added.
+
+ Also, if the response does have a Last-Modified time, the heuristic
+ expiration value SHOULD be no more than some fraction of the interval
+ since that time. A typical setting of this fraction might be 10%.
+
+ The calculation to determine if a response has expired is quite
+ simple:
+
+ response_is_fresh = (freshness_lifetime &gt; current_age)
+
+13.2.5 Disambiguating Expiration Values
+
+ Because expiration values are assigned optimistically, it is possible
+ for two caches to contain fresh values for the same resource that are
+ different.
+
+ If a client performing a retrieval receives a non-first-hand response
+ for a request that was already fresh in its own cache, and the Date
+ header in its existing cache entry is newer than the Date on the new
+ response, then the client MAY ignore the response. If so, it MAY
+ retry the request with a "Cache-Control: max-age=0" directive (see
+ section 14.9), to force a check with the origin server.
+
+ If a cache has two fresh responses for the same representation with
+ different validators, it MUST use the one with the more recent Date
+ header. This situation might arise because the cache is pooling
+ responses from other caches, or because a client has asked for a
+ reload or a revalidation of an apparently fresh cache entry.
+
+13.2.6 Disambiguating Multiple Responses
+
+ Because a client might be receiving responses via multiple paths, so
+ that some responses flow through one set of caches and other
+ responses flow through a different set of caches, a client might
+ receive responses in an order different from that in which the origin
+ server sent them. We would like the client to use the most recently
+ generated response, even if older responses are still apparently
+ fresh.
+
+ Neither the entity tag nor the expiration value can impose an
+ ordering on responses, since it is possible that a later response
+ intentionally carries an earlier expiration time. The Date values are
+ ordered to a granularity of one second.
+
+ When a client tries to revalidate a cache entry, and the response it
+ receives contains a Date header that appears to be older than the one
+ for the existing entry, then the client SHOULD repeat the request
+ unconditionally, and include
+
+ Cache-Control: max-age=0
+
+ to force any intermediate caches to validate their copies directly
+ with the origin server, or
+
+ Cache-Control: no-cache
+
+ to force any intermediate caches to obtain a new copy from the origin
+ server.
+
+ If the Date values are equal, then the client MAY use either response
+ (or MAY, if it is being extremely prudent, request a new response).
+ Servers MUST NOT depend on clients being able to choose
+ deterministically between responses generated during the same second,
+ if their expiration times overlap.
+
+13.3 Validation Model
+
+ When a cache has a stale entry that it would like to use as a
+ response to a client's request, it first has to check with the origin
+ server (or possibly an intermediate cache with a fresh response) to
+ see if its cached entry is still usable. We call this "validating"
+ the cache entry. Since we do not want to have to pay the overhead of
+ retransmitting the full response if the cached entry is good, and we
+ do not want to pay the overhead of an extra round trip if the cached
+ entry is invalid, the HTTP/1.1 protocol supports the use of
+ conditional methods.
+
+ The key protocol features for supporting conditional methods are
+ those concerned with "cache validators." When an origin server
+ generates a full response, it attaches some sort of validator to it,
+ which is kept with the cache entry. When a client (user agent or
+ proxy cache) makes a conditional request for a resource for which it
+ has a cache entry, it includes the associated validator in the
+ request.
+
+ The server then checks that validator against the current validator
+ for the entity, and, if they match (see section 13.3.3), it responds
+ with a special status code (usually, 304 (Not Modified)) and no
+ entity-body. Otherwise, it returns a full response (including
+ entity-body). Thus, we avoid transmitting the full response if the
+ validator matches, and we avoid an extra round trip if it does not
+ match.
+
+ In HTTP/1.1, a conditional request looks exactly the same as a normal
+ request for the same resource, except that it carries a special
+ header (which includes the validator) that implicitly turns the
+ method (usually, GET) into a conditional.
+
+ The protocol includes both positive and negative senses of cache-
+ validating conditions. That is, it is possible to request either that
+ a method be performed if and only if a validator matches or if and
+ only if no validators match.
+
+ Note: a response that lacks a validator may still be cached, and
+ served from cache until it expires, unless this is explicitly
+ prohibited by a cache-control directive. However, a cache cannot
+ do a conditional retrieval if it does not have a validator for the
+ entity, which means it will not be refreshable after it expires.
+
+13.3.1 Last-Modified Dates
+
+ The Last-Modified entity-header field value is often used as a cache
+ validator. In simple terms, a cache entry is considered to be valid
+ if the entity has not been modified since the Last-Modified value.
+
+13.3.2 Entity Tag Cache Validators
+
+ The ETag response-header field value, an entity tag, provides for an
+ "opaque" cache validator. This might allow more reliable validation
+ in situations where it is inconvenient to store modification dates,
+ where the one-second resolution of HTTP date values is not
+ sufficient, or where the origin server wishes to avoid certain
+ paradoxes that might arise from the use of modification dates.
+
+ Entity Tags are described in section 3.11. The headers used with
+ entity tags are described in sections 14.19, 14.24, 14.26 and 14.44.
+
+13.3.3 Weak and Strong Validators
+
+ Since both origin servers and caches will compare two validators to
+ decide if they represent the same or different entities, one normally
+ would expect that if the entity (the entity-body or any entity-
+ headers) changes in any way, then the associated validator would
+ change as well. If this is true, then we call this validator a
+ "strong validator."
+
+ However, there might be cases when a server prefers to change the
+ validator only on semantically significant changes, and not when
+ insignificant aspects of the entity change. A validator that does not
+ always change when the resource changes is a "weak validator."
+
+ Entity tags are normally "strong validators," but the protocol
+ provides a mechanism to tag an entity tag as "weak." One can think of
+ a strong validator as one that changes whenever the bits of an entity
+ changes, while a weak value changes whenever the meaning of an entity
+ changes. Alternatively, one can think of a strong validator as part
+ of an identifier for a specific entity, while a weak validator is
+ part of an identifier for a set of semantically equivalent entities.
+
+ Note: One example of a strong validator is an integer that is
+ incremented in stable storage every time an entity is changed.
+
+ An entity's modification time, if represented with one-second
+ resolution, could be a weak validator, since it is possible that
+ the resource might be modified twice during a single second.
+
+ Support for weak validators is optional. However, weak validators
+ allow for more efficient caching of equivalent objects; for
+ example, a hit counter on a site is probably good enough if it is
+ updated every few days or weeks, and any value during that period
+ is likely "good enough" to be equivalent.
+
+ A "use" of a validator is either when a client generates a request
+ and includes the validator in a validating header field, or when a
+ server compares two validators.
+
+ Strong validators are usable in any context. Weak validators are only
+ usable in contexts that do not depend on exact equality of an entity.
+ For example, either kind is usable for a conditional GET of a full
+ entity. However, only a strong validator is usable for a sub-range
+ retrieval, since otherwise the client might end up with an internally
+ inconsistent entity.
+
+ Clients MAY issue simple (non-subrange) GET requests with either weak
+ validators or strong validators. Clients MUST NOT use weak validators
+ in other forms of request.
+
+ The only function that the HTTP/1.1 protocol defines on validators is
+ comparison. There are two validator comparison functions, depending
+ on whether the comparison context allows the use of weak validators
+ or not:
+
+ - The strong comparison function: in order to be considered equal,
+ both validators MUST be identical in every way, and both MUST
+ NOT be weak.
+
+ - The weak comparison function: in order to be considered equal,
+ both validators MUST be identical in every way, but either or
+ both of them MAY be tagged as "weak" without affecting the
+ result.
+
+ An entity tag is strong unless it is explicitly tagged as weak.
+ Section 3.11 gives the syntax for entity tags.
+
+ A Last-Modified time, when used as a validator in a request, is
+ implicitly weak unless it is possible to deduce that it is strong,
+ using the following rules:
+
+ - The validator is being compared by an origin server to the
+ actual current validator for the entity and,
+
+ - That origin server reliably knows that the associated entity did
+ not change twice during the second covered by the presented
+ validator.
+
+ or
+
+ - The validator is about to be used by a client in an If-
+ Modified-Since or If-Unmodified-Since header, because the client
+ has a cache entry for the associated entity, and
+
+ - That cache entry includes a Date value, which gives the time
+ when the origin server sent the original response, and
+
+ - The presented Last-Modified time is at least 60 seconds before
+ the Date value.
+
+ or
+
+ - The validator is being compared by an intermediate cache to the
+ validator stored in its cache entry for the entity, and
+
+ - That cache entry includes a Date value, which gives the time
+ when the origin server sent the original response, and
+
+ - The presented Last-Modified time is at least 60 seconds before
+ the Date value.
+
+ This method relies on the fact that if two different responses were
+ sent by the origin server during the same second, but both had the
+ same Last-Modified time, then at least one of those responses would
+ have a Date value equal to its Last-Modified time. The arbitrary 60-
+ second limit guards against the possibility that the Date and Last-
+ Modified values are generated from different clocks, or at somewhat
+ different times during the preparation of the response. An
+ implementation MAY use a value larger than 60 seconds, if it is
+ believed that 60 seconds is too short.
+
+ If a client wishes to perform a sub-range retrieval on a value for
+ which it has only a Last-Modified time and no opaque validator, it
+ MAY do this only if the Last-Modified time is strong in the sense
+ described here.
+
+ A cache or origin server receiving a conditional request, other than
+ a full-body GET request, MUST use the strong comparison function to
+ evaluate the condition.
+
+ These rules allow HTTP/1.1 caches and clients to safely perform sub-
+ range retrievals on values that have been obtained from HTTP/1.0
+
+ servers.
+
+13.3.4 Rules for When to Use Entity Tags and Last-Modified Dates
+
+ We adopt a set of rules and recommendations for origin servers,
+ clients, and caches regarding when various validator types ought to
+ be used, and for what purposes.
+
+ HTTP/1.1 origin servers:
+
+ - SHOULD send an entity tag validator unless it is not feasible to
+ generate one.
+
+ - MAY send a weak entity tag instead of a strong entity tag, if
+ performance considerations support the use of weak entity tags,
+ or if it is unfeasible to send a strong entity tag.
+
+ - SHOULD send a Last-Modified value if it is feasible to send one,
+ unless the risk of a breakdown in semantic transparency that
+ could result from using this date in an If-Modified-Since header
+ would lead to serious problems.
+
+ In other words, the preferred behavior for an HTTP/1.1 origin server
+ is to send both a strong entity tag and a Last-Modified value.
+
+ In order to be legal, a strong entity tag MUST change whenever the
+ associated entity value changes in any way. A weak entity tag SHOULD
+ change whenever the associated entity changes in a semantically
+ significant way.
+
+ Note: in order to provide semantically transparent caching, an
+ origin server must avoid reusing a specific strong entity tag
+ value for two different entities, or reusing a specific weak
+ entity tag value for two semantically different entities. Cache
+ entries might persist for arbitrarily long periods, regardless of
+ expiration times, so it might be inappropriate to expect that a
+ cache will never again attempt to validate an entry using a
+ validator that it obtained at some point in the past.
+
+ HTTP/1.1 clients:
+
+ - If an entity tag has been provided by the origin server, MUST
+ use that entity tag in any cache-conditional request (using If-
+ Match or If-None-Match).
+
+ - If only a Last-Modified value has been provided by the origin
+ server, SHOULD use that value in non-subrange cache-conditional
+ requests (using If-Modified-Since).
+
+ - If only a Last-Modified value has been provided by an HTTP/1.0
+ origin server, MAY use that value in subrange cache-conditional
+ requests (using If-Unmodified-Since:). The user agent SHOULD
+ provide a way to disable this, in case of difficulty.
+
+ - If both an entity tag and a Last-Modified value have been
+ provided by the origin server, SHOULD use both validators in
+ cache-conditional requests. This allows both HTTP/1.0 and
+ HTTP/1.1 caches to respond appropriately.
+
+ An HTTP/1.1 origin server, upon receiving a conditional request that
+ includes both a Last-Modified date (e.g., in an If-Modified-Since or
+ If-Unmodified-Since header field) and one or more entity tags (e.g.,
+ in an If-Match, If-None-Match, or If-Range header field) as cache
+ validators, MUST NOT return a response status of 304 (Not Modified)
+ unless doing so is consistent with all of the conditional header
+ fields in the request.
+
+ An HTTP/1.1 caching proxy, upon receiving a conditional request that
+ includes both a Last-Modified date and one or more entity tags as
+ cache validators, MUST NOT return a locally cached response to the
+ client unless that cached response is consistent with all of the
+ conditional header fields in the request.
+
+ Note: The general principle behind these rules is that HTTP/1.1
+ servers and clients should transmit as much non-redundant
+ information as is available in their responses and requests.
+ HTTP/1.1 systems receiving this information will make the most
+ conservative assumptions about the validators they receive.
+
+ HTTP/1.0 clients and caches will ignore entity tags. Generally,
+ last-modified values received or used by these systems will
+ support transparent and efficient caching, and so HTTP/1.1 origin
+ servers should provide Last-Modified values. In those rare cases
+ where the use of a Last-Modified value as a validator by an
+ HTTP/1.0 system could result in a serious problem, then HTTP/1.1
+ origin servers should not provide one.
+
+13.3.5 Non-validating Conditionals
+
+ The principle behind entity tags is that only the service author
+ knows the semantics of a resource well enough to select an
+ appropriate cache validation mechanism, and the specification of any
+ validator comparison function more complex than byte-equality would
+ open up a can of worms. Thus, comparisons of any other headers
+ (except Last-Modified, for compatibility with HTTP/1.0) are never
+ used for purposes of validating a cache entry.
+
+13.4 Response Cacheability
+
+ Unless specifically constrained by a cache-control (section 14.9)
+ directive, a caching system MAY always store a successful response
+ (see section 13.8) as a cache entry, MAY return it without validation
+ if it is fresh, and MAY return it after successful validation. If
+ there is neither a cache validator nor an explicit expiration time
+ associated with a response, we do not expect it to be cached, but
+ certain caches MAY violate this expectation (for example, when little
+ or no network connectivity is available). A client can usually detect
+ that such a response was taken from a cache by comparing the Date
+ header to the current time.
+
+ Note: some HTTP/1.0 caches are known to violate this expectation
+ without providing any Warning.
+
+ However, in some cases it might be inappropriate for a cache to
+ retain an entity, or to return it in response to a subsequent
+ request. This might be because absolute semantic transparency is
+ deemed necessary by the service author, or because of security or
+ privacy considerations. Certain cache-control directives are
+ therefore provided so that the server can indicate that certain
+ resource entities, or portions thereof, are not to be cached
+ regardless of other considerations.
+
+ Note that section 14.8 normally prevents a shared cache from saving
+ and returning a response to a previous request if that request
+ included an Authorization header.
+
+ A response received with a status code of 200, 203, 206, 300, 301 or
+ 410 MAY be stored by a cache and used in reply to a subsequent
+ request, subject to the expiration mechanism, unless a cache-control
+ directive prohibits caching. However, a cache that does not support
+ the Range and Content-Range headers MUST NOT cache 206 (Partial
+ Content) responses.
+
+ A response received with any other status code (e.g. status codes 302
+ and 307) MUST NOT be returned in a reply to a subsequent request
+ unless there are cache-control directives or another header(s) that
+ explicitly allow it. For example, these include the following: an
+ Expires header (section 14.21); a "max-age", "s-maxage", "must-
+ revalidate", "proxy-revalidate", "public" or "private" cache-control
+ directive (section 14.9).
+
+13.5 Constructing Responses From Caches
+
+ The purpose of an HTTP cache is to store information received in
+ response to requests for use in responding to future requests. In
+ many cases, a cache simply returns the appropriate parts of a
+ response to the requester. However, if the cache holds a cache entry
+ based on a previous response, it might have to combine parts of a new
+ response with what is held in the cache entry.
+
+13.5.1 End-to-end and Hop-by-hop Headers
+
+ For the purpose of defining the behavior of caches and non-caching
+ proxies, we divide HTTP headers into two categories:
+
+ - End-to-end headers, which are transmitted to the ultimate
+ recipient of a request or response. End-to-end headers in
+ responses MUST be stored as part of a cache entry and MUST be
+ transmitted in any response formed from a cache entry.
+
+ - Hop-by-hop headers, which are meaningful only for a single
+ transport-level connection, and are not stored by caches or
+ forwarded by proxies.
+
+ The following HTTP/1.1 headers are hop-by-hop headers:
+
+ - Connection
+ - Keep-Alive
+ - Proxy-Authenticate
+ - Proxy-Authorization
+ - TE
+ - Trailers
+ - Transfer-Encoding
+ - Upgrade
+
+ All other headers defined by HTTP/1.1 are end-to-end headers.
+
+ Other hop-by-hop headers MUST be listed in a Connection header,
+ (section 14.10) to be introduced into HTTP/1.1 (or later).
+
+13.5.2 Non-modifiable Headers
+
+ Some features of the HTTP/1.1 protocol, such as Digest
+ Authentication, depend on the value of certain end-to-end headers. A
+ transparent proxy SHOULD NOT modify an end-to-end header unless the
+ definition of that header requires or specifically allows that.
+
+ A transparent proxy MUST NOT modify any of the following fields in a
+ request or response, and it MUST NOT add any of these fields if not
+ already present:
+
+ - Content-Location
+
+ - Content-MD5
+
+ - ETag
+
+ - Last-Modified
+
+ A transparent proxy MUST NOT modify any of the following fields in a
+ response:
+
+ - Expires
+
+ but it MAY add any of these fields if not already present. If an
+ Expires header is added, it MUST be given a field-value identical to
+ that of the Date header in that response.
+
+ A proxy MUST NOT modify or add any of the following fields in a
+ message that contains the no-transform cache-control directive, or in
+ any request:
+
+ - Content-Encoding
+
+ - Content-Range
+
+ - Content-Type
+
+ A non-transparent proxy MAY modify or add these fields to a message
+ that does not include no-transform, but if it does so, it MUST add a
+ Warning 214 (Transformation applied) if one does not already appear
+ in the message (see section 14.46).
+
+ Warning: unnecessary modification of end-to-end headers might
+ cause authentication failures if stronger authentication
+ mechanisms are introduced in later versions of HTTP. Such
+ authentication mechanisms MAY rely on the values of header fields
+ not listed here.
+
+ The Content-Length field of a request or response is added or deleted
+ according to the rules in section 4.4. A transparent proxy MUST
+ preserve the entity-length (section 7.2.2) of the entity-body,
+ although it MAY change the transfer-length (section 4.4).
+
+13.5.3 Combining Headers
+
+ When a cache makes a validating request to a server, and the server
+ provides a 304 (Not Modified) response or a 206 (Partial Content)
+ response, the cache then constructs a response to send to the
+ requesting client.
+
+ If the status code is 304 (Not Modified), the cache uses the entity-
+ body stored in the cache entry as the entity-body of this outgoing
+ response. If the status code is 206 (Partial Content) and the ETag or
+ Last-Modified headers match exactly, the cache MAY combine the
+ contents stored in the cache entry with the new contents received in
+ the response and use the result as the entity-body of this outgoing
+ response, (see 13.5.4).
+
+ The end-to-end headers stored in the cache entry are used for the
+ constructed response, except that
+
+ - any stored Warning headers with warn-code 1xx (see section
+ 14.46) MUST be deleted from the cache entry and the forwarded
+ response.
+
+ - any stored Warning headers with warn-code 2xx MUST be retained
+ in the cache entry and the forwarded response.
+
+ - any end-to-end headers provided in the 304 or 206 response MUST
+ replace the corresponding headers from the cache entry.
+
+ Unless the cache decides to remove the cache entry, it MUST also
+ replace the end-to-end headers stored with the cache entry with
+ corresponding headers received in the incoming response, except for
+ Warning headers as described immediately above. If a header field-
+ name in the incoming response matches more than one header in the
+ cache entry, all such old headers MUST be replaced.
+
+ In other words, the set of end-to-end headers received in the
+ incoming response overrides all corresponding end-to-end headers
+ stored with the cache entry (except for stored Warning headers with
+ warn-code 1xx, which are deleted even if not overridden).
+
+ Note: this rule allows an origin server to use a 304 (Not
+ Modified) or a 206 (Partial Content) response to update any header
+ associated with a previous response for the same entity or sub-
+ ranges thereof, although it might not always be meaningful or
+ correct to do so. This rule does not allow an origin server to use
+ a 304 (Not Modified) or a 206 (Partial Content) response to
+ entirely delete a header that it had provided with a previous
+ response.
+
+13.5.4 Combining Byte Ranges
+
+ A response might transfer only a subrange of the bytes of an entity-
+ body, either because the request included one or more Range
+ specifications, or because a connection was broken prematurely. After
+ several such transfers, a cache might have received several ranges of
+ the same entity-body.
+
+ If a cache has a stored non-empty set of subranges for an entity, and
+ an incoming response transfers another subrange, the cache MAY
+ combine the new subrange with the existing set if both the following
+ conditions are met:
+
+ - Both the incoming response and the cache entry have a cache
+ validator.
+
+ - The two cache validators match using the strong comparison
+ function (see section 13.3.3).
+
+ If either requirement is not met, the cache MUST use only the most
+ recent partial response (based on the Date values transmitted with
+ every response, and using the incoming response if these values are
+ equal or missing), and MUST discard the other partial information.
+
+13.6 Caching Negotiated Responses
+
+ Use of server-driven content negotiation (section 12.1), as indicated
+ by the presence of a Vary header field in a response, alters the
+ conditions and procedure by which a cache can use the response for
+ subsequent requests. See section 14.44 for use of the Vary header
+ field by servers.
+
+ A server SHOULD use the Vary header field to inform a cache of what
+ request-header fields were used to select among multiple
+ representations of a cacheable response subject to server-driven
+ negotiation. The set of header fields named by the Vary field value
+ is known as the "selecting" request-headers.
+
+ When the cache receives a subsequent request whose Request-URI
+ specifies one or more cache entries including a Vary header field,
+ the cache MUST NOT use such a cache entry to construct a response to
+ the new request unless all of the selecting request-headers present
+ in the new request match the corresponding stored request-headers in
+ the original request.
+
+ The selecting request-headers from two requests are defined to match
+ if and only if the selecting request-headers in the first request can
+ be transformed to the selecting request-headers in the second request
+
+ by adding or removing linear white space (LWS) at places where this
+ is allowed by the corresponding BNF, and/or combining multiple
+ message-header fields with the same field name following the rules
+ about message headers in section 4.2.
+
+ A Vary header field-value of "*" always fails to match and subsequent
+ requests on that resource can only be properly interpreted by the
+ origin server.
+
+ If the selecting request header fields for the cached entry do not
+ match the selecting request header fields of the new request, then
+ the cache MUST NOT use a cached entry to satisfy the request unless
+ it first relays the new request to the origin server in a conditional
+ request and the server responds with 304 (Not Modified), including an
+ entity tag or Content-Location that indicates the entity to be used.
+
+ If an entity tag was assigned to a cached representation, the
+ forwarded request SHOULD be conditional and include the entity tags
+ in an If-None-Match header field from all its cache entries for the
+ resource. This conveys to the server the set of entities currently
+ held by the cache, so that if any one of these entities matches the
+ requested entity, the server can use the ETag header field in its 304
+ (Not Modified) response to tell the cache which entry is appropriate.
+ If the entity-tag of the new response matches that of an existing
+ entry, the new response SHOULD be used to update the header fields of
+ the existing entry, and the result MUST be returned to the client.
+
+ If any of the existing cache entries contains only partial content
+ for the associated entity, its entity-tag SHOULD NOT be included in
+ the If-None-Match header field unless the request is for a range that
+ would be fully satisfied by that entry.
+
+ If a cache receives a successful response whose Content-Location
+ field matches that of an existing cache entry for the same Request-
+ ]URI, whose entity-tag differs from that of the existing entry, and
+ whose Date is more recent than that of the existing entry, the
+ existing entry SHOULD NOT be returned in response to future requests
+ and SHOULD be deleted from the cache.
+
+13.7 Shared and Non-Shared Caches
+
+ For reasons of security and privacy, it is necessary to make a
+ distinction between "shared" and "non-shared" caches. A non-shared
+ cache is one that is accessible only to a single user. Accessibility
+ in this case SHOULD be enforced by appropriate security mechanisms.
+ All other caches are considered to be "shared." Other sections of
+
+ this specification place certain constraints on the operation of
+ shared caches in order to prevent loss of privacy or failure of
+ access controls.
+
+13.8 Errors or Incomplete Response Cache Behavior
+
+ A cache that receives an incomplete response (for example, with fewer
+ bytes of data than specified in a Content-Length header) MAY store
+ the response. However, the cache MUST treat this as a partial
+ response. Partial responses MAY be combined as described in section
+ 13.5.4; the result might be a full response or might still be
+ partial. A cache MUST NOT return a partial response to a client
+ without explicitly marking it as such, using the 206 (Partial
+ Content) status code. A cache MUST NOT return a partial response
+ using a status code of 200 (OK).
+
+ If a cache receives a 5xx response while attempting to revalidate an
+ entry, it MAY either forward this response to the requesting client,
+ or act as if the server failed to respond. In the latter case, it MAY
+ return a previously received response unless the cached entry
+ includes the "must-revalidate" cache-control directive (see section
+ 14.9).
+
+13.9 Side Effects of GET and HEAD
+
+ Unless the origin server explicitly prohibits the caching of their
+ responses, the application of GET and HEAD methods to any resources
+ SHOULD NOT have side effects that would lead to erroneous behavior if
+ these responses are taken from a cache. They MAY still have side
+ effects, but a cache is not required to consider such side effects in
+ its caching decisions. Caches are always expected to observe an
+ origin server's explicit restrictions on caching.
+
+ We note one exception to this rule: since some applications have
+ traditionally used GETs and HEADs with query URLs (those containing a
+ "?" in the rel_path part) to perform operations with significant side
+ effects, caches MUST NOT treat responses to such URIs as fresh unless
+ the server provides an explicit expiration time. This specifically
+ means that responses from HTTP/1.0 servers for such URIs SHOULD NOT
+ be taken from a cache. See section 9.1.1 for related information.
+
+13.10 Invalidation After Updates or Deletions
+
+ The effect of certain methods performed on a resource at the origin
+ server might cause one or more existing cache entries to become non-
+ transparently invalid. That is, although they might continue to be
+ "fresh," they do not accurately reflect what the origin server would
+ return for a new request on that resource.
+
+ There is no way for the HTTP protocol to guarantee that all such
+ cache entries are marked invalid. For example, the request that
+ caused the change at the origin server might not have gone through
+ the proxy where a cache entry is stored. However, several rules help
+ reduce the likelihood of erroneous behavior.
+
+ In this section, the phrase "invalidate an entity" means that the
+ cache will either remove all instances of that entity from its
+ storage, or will mark these as "invalid" and in need of a mandatory
+ revalidation before they can be returned in response to a subsequent
+ request.
+
+ Some HTTP methods MUST cause a cache to invalidate an entity. This is
+ either the entity referred to by the Request-URI, or by the Location
+ or Content-Location headers (if present). These methods are:
+
+ - PUT
+
+ - DELETE
+
+ - POST
+
+ In order to prevent denial of service attacks, an invalidation based
+ on the URI in a Location or Content-Location header MUST only be
+ performed if the host part is the same as in the Request-URI.
+
+ A cache that passes through requests for methods it does not
+ understand SHOULD invalidate any entities referred to by the
+ Request-URI.
+
+13.11 Write-Through Mandatory
+
+ All methods that might be expected to cause modifications to the
+ origin server's resources MUST be written through to the origin
+ server. This currently includes all methods except for GET and HEAD.
+ A cache MUST NOT reply to such a request from a client before having
+ transmitted the request to the inbound server, and having received a
+ corresponding response from the inbound server. This does not prevent
+ a proxy cache from sending a 100 (Continue) response before the
+ inbound server has sent its final reply.
+
+ The alternative (known as "write-back" or "copy-back" caching) is not
+ allowed in HTTP/1.1, due to the difficulty of providing consistent
+ updates and the problems arising from server, cache, or network
+ failure prior to write-back.
+
+13.12 Cache Replacement
+
+ If a new cacheable (see sections 14.9.2, 13.2.5, 13.2.6 and 13.8)
+ response is received from a resource while any existing responses for
+ the same resource are cached, the cache SHOULD use the new response
+ to reply to the current request. It MAY insert it into cache storage
+ and MAY, if it meets all other requirements, use it to respond to any
+ future requests that would previously have caused the old response to
+ be returned. If it inserts the new response into cache storage the
+ rules in section 13.5.3 apply.
+
+ Note: a new response that has an older Date header value than
+ existing cached responses is not cacheable.
+
+13.13 History Lists
+
+ User agents often have history mechanisms, such as "Back" buttons and
+ history lists, which can be used to redisplay an entity retrieved
+ earlier in a session.
+
+ History mechanisms and caches are different. In particular history
+ mechanisms SHOULD NOT try to show a semantically transparent view of
+ the current state of a resource. Rather, a history mechanism is meant
+ to show exactly what the user saw at the time when the resource was
+ retrieved.
+
+ By default, an expiration time does not apply to history mechanisms.
+ If the entity is still in storage, a history mechanism SHOULD display
+ it even if the entity has expired, unless the user has specifically
+ configured the agent to refresh expired history documents.
+
+ This is not to be construed to prohibit the history mechanism from
+ telling the user that a view might be stale.
+
+ Note: if history list mechanisms unnecessarily prevent users from
+ viewing stale resources, this will tend to force service authors
+ to avoid using HTTP expiration controls and cache controls when
+ they would otherwise like to. Service authors may consider it
+ important that users not be presented with error messages or
+ warning messages when they use navigation controls (such as BACK)
+ to view previously fetched resources. Even though sometimes such
+ resources ought not to cached, or ought to expire quickly, user
+ interface considerations may force service authors to resort to
+ other means of preventing caching (e.g. "once-only" URLs) in order
+ not to suffer the effects of improperly functioning history
+ mechanisms.
+
+14 Header Field Definitions
+
+ This section defines the syntax and semantics of all standard
+ HTTP/1.1 header fields. For entity-header fields, both sender and
+ recipient refer to either the client or the server, depending on who
+ sends and who receives the entity.
+
+14.1 Accept
+
+ The Accept request-header field can be used to specify certain media
+ types which are acceptable for the response. Accept headers can be
+ used to indicate that the request is specifically limited to a small
+ set of desired types, as in the case of a request for an in-line
+ image.
+
+ Accept = "Accept" ":"
+ #( media-range [ accept-params ] )
+
+ media-range = ( "*/*"
+ | ( type "/" "*" )
+ | ( type "/" subtype )
+ ) *( ";" parameter )
+ accept-params = ";" "q" "=" qvalue *( accept-extension )
+ accept-extension = ";" token [ "=" ( token | quoted-string ) ]
+
+ The asterisk "*" character is used to group media types into ranges,
+ with "*/*" indicating all media types and "type/*" indicating all
+ subtypes of that type. The media-range MAY include media type
+ parameters that are applicable to that range.
+
+ Each media-range MAY be followed by one or more accept-params,
+ beginning with the "q" parameter for indicating a relative quality
+ factor. The first "q" parameter (if any) separates the media-range
+ parameter(s) from the accept-params. Quality factors allow the user
+ or user agent to indicate the relative degree of preference for that
+ media-range, using the qvalue scale from 0 to 1 (section 3.9). The
+ default value is q=1.
+
+ Note: Use of the "q" parameter name to separate media type
+ parameters from Accept extension parameters is due to historical
+ practice. Although this prevents any media type parameter named
+ "q" from being used with a media range, such an event is believed
+ to be unlikely given the lack of any "q" parameters in the IANA
+ media type registry and the rare usage of any media type
+ parameters in Accept. Future media types are discouraged from
+ registering any parameter named "q".
+
+ The example
+
+ Accept: audio/*; q=0.2, audio/basic
+
+ SHOULD be interpreted as "I prefer audio/basic, but send me any audio
+ type if it is the best available after an 80% mark-down in quality."
+
+ If no Accept header field is present, then it is assumed that the
+ client accepts all media types. If an Accept header field is present,
+ and if the server cannot send a response which is acceptable
+ according to the combined Accept field value, then the server SHOULD
+ send a 406 (not acceptable) response.
+
+ A more elaborate example is
+
+ Accept: text/plain; q=0.5, text/html,
+ text/x-dvi; q=0.8, text/x-c
+
+ Verbally, this would be interpreted as "text/html and text/x-c are
+ the preferred media types, but if they do not exist, then send the
+ text/x-dvi entity, and if that does not exist, send the text/plain
+ entity."
+
+ Media ranges can be overridden by more specific media ranges or
+ specific media types. If more than one media range applies to a given
+ type, the most specific reference has precedence. For example,
+
+ Accept: text/*, text/html, text/html;level=1, */*
+
+ have the following precedence:
+
+ 1) text/html;level=1
+ 2) text/html
+ 3) text/*
+ 4) */*
+
+ The media type quality factor associated with a given type is
+ determined by finding the media range with the highest precedence
+ which matches that type. For example,
+
+ Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
+ text/html;level=2;q=0.4, */*;q=0.5
+
+ would cause the following values to be associated:
+
+ text/html;level=1 = 1
+ text/html = 0.7
+ text/plain = 0.3
+
+ image/jpeg = 0.5
+ text/html;level=2 = 0.4
+ text/html;level=3 = 0.7
+
+ Note: A user agent might be provided with a default set of quality
+ values for certain media ranges. However, unless the user agent is
+ a closed system which cannot interact with other rendering agents,
+ this default set ought to be configurable by the user.
+
+14.2 Accept-Charset
+
+ The Accept-Charset request-header field can be used to indicate what
+ character sets are acceptable for the response. This field allows
+ clients capable of understanding more comprehensive or special-
+ purpose character sets to signal that capability to a server which is
+ capable of representing documents in those character sets.
+
+ Accept-Charset = "Accept-Charset" ":"
+ 1#( ( charset | "*" )[ ";" "q" "=" qvalue ] )
+
+ Character set values are described in section 3.4. Each charset MAY
+ be given an associated quality value which represents the user's
+ preference for that charset. The default value is q=1. An example is
+
+ Accept-Charset: iso-8859-5, unicode-1-1;q=0.8
+
+ The special value "*", if present in the Accept-Charset field,
+ matches every character set (including ISO-8859-1) which is not
+ mentioned elsewhere in the Accept-Charset field. If no "*" is present
+ in an Accept-Charset field, then all character sets not explicitly
+ mentioned get a quality value of 0, except for ISO-8859-1, which gets
+ a quality value of 1 if not explicitly mentioned.
+
+ If no Accept-Charset header is present, the default is that any
+ character set is acceptable. If an Accept-Charset header is present,
+ and if the server cannot send a response which is acceptable
+ according to the Accept-Charset header, then the server SHOULD send
+ an error response with the 406 (not acceptable) status code, though
+ the sending of an unacceptable response is also allowed.
+
+14.3 Accept-Encoding
+
+ The Accept-Encoding request-header field is similar to Accept, but
+ restricts the content-codings (section 3.5) that are acceptable in
+ the response.
+
+ Accept-Encoding = "Accept-Encoding" ":"
+
+ 1#( codings [ ";" "q" "=" qvalue ] )
+ codings = ( content-coding | "*" )
+
+ Examples of its use are:
+
+ Accept-Encoding: compress, gzip
+ Accept-Encoding:
+ Accept-Encoding: *
+ Accept-Encoding: compress;q=0.5, gzip;q=1.0
+ Accept-Encoding: gzip;q=1.0, identity; q=0.5, *;q=0
+
+ A server tests whether a content-coding is acceptable, according to
+ an Accept-Encoding field, using these rules:
+
+ 1. If the content-coding is one of the content-codings listed in
+ the Accept-Encoding field, then it is acceptable, unless it is
+ accompanied by a qvalue of 0. (As defined in section 3.9, a
+ qvalue of 0 means "not acceptable.")
+
+ 2. The special "*" symbol in an Accept-Encoding field matches any
+ available content-coding not explicitly listed in the header
+ field.
+
+ 3. If multiple content-codings are acceptable, then the acceptable
+ content-coding with the highest non-zero qvalue is preferred.
+
+ 4. The "identity" content-coding is always acceptable, unless
+ specifically refused because the Accept-Encoding field includes
+ "identity;q=0", or because the field includes "*;q=0" and does
+ not explicitly include the "identity" content-coding. If the
+ Accept-Encoding field-value is empty, then only the "identity"
+ encoding is acceptable.
+
+ If an Accept-Encoding field is present in a request, and if the
+ server cannot send a response which is acceptable according to the
+ Accept-Encoding header, then the server SHOULD send an error response
+ with the 406 (Not Acceptable) status code.
+
+ If no Accept-Encoding field is present in a request, the server MAY
+ assume that the client will accept any content coding. In this case,
+ if "identity" is one of the available content-codings, then the
+ server SHOULD use the "identity" content-coding, unless it has
+ additional information that a different content-coding is meaningful
+ to the client.
+
+ Note: If the request does not include an Accept-Encoding field,
+ and if the "identity" content-coding is unavailable, then
+ content-codings commonly understood by HTTP/1.0 clients (i.e.,
+
+ "gzip" and "compress") are preferred; some older clients
+ improperly display messages sent with other content-codings. The
+ server might also make this decision based on information about
+ the particular user-agent or client.
+
+ Note: Most HTTP/1.0 applications do not recognize or obey qvalues
+ associated with content-codings. This means that qvalues will not
+ work and are not permitted with x-gzip or x-compress.
+
+14.4 Accept-Language
+
+ The Accept-Language request-header field is similar to Accept, but
+ restricts the set of natural languages that are preferred as a
+ response to the request. Language tags are defined in section 3.10.
+
+ Accept-Language = "Accept-Language" ":"
+ 1#( language-range [ ";" "q" "=" qvalue ] )
+ language-range = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )
+
+ Each language-range MAY be given an associated quality value which
+ represents an estimate of the user's preference for the languages
+ specified by that range. The quality value defaults to "q=1". For
+ example,
+
+ Accept-Language: da, en-gb;q=0.8, en;q=0.7
+
+ would mean: "I prefer Danish, but will accept British English and
+ other types of English." A language-range matches a language-tag if
+ it exactly equals the tag, or if it exactly equals a prefix of the
+ tag such that the first tag character following the prefix is "-".
+ The special range "*", if present in the Accept-Language field,
+ matches every tag not matched by any other range present in the
+ Accept-Language field.
+
+ Note: This use of a prefix matching rule does not imply that
+ language tags are assigned to languages in such a way that it is
+ always true that if a user understands a language with a certain
+ tag, then this user will also understand all languages with tags
+ for which this tag is a prefix. The prefix rule simply allows the
+ use of prefix tags if this is the case.
+
+ The language quality factor assigned to a language-tag by the
+ Accept-Language field is the quality value of the longest language-
+ range in the field that matches the language-tag. If no language-
+ range in the field matches the tag, the language quality factor
+ assigned is 0. If no Accept-Language header is present in the
+ request, the server
+
+ SHOULD assume that all languages are equally acceptable. If an
+ Accept-Language header is present, then all languages which are
+ assigned a quality factor greater than 0 are acceptable.
+
+ It might be contrary to the privacy expectations of the user to send
+ an Accept-Language header with the complete linguistic preferences of
+ the user in every request. For a discussion of this issue, see
+ section 15.1.4.
+
+ As intelligibility is highly dependent on the individual user, it is
+ recommended that client applications make the choice of linguistic
+ preference available to the user. If the choice is not made
+ available, then the Accept-Language header field MUST NOT be given in
+ the request.
+
+ Note: When making the choice of linguistic preference available to
+ the user, we remind implementors of the fact that users are not
+ familiar with the details of language matching as described above,
+ and should provide appropriate guidance. As an example, users
+ might assume that on selecting "en-gb", they will be served any
+ kind of English document if British English is not available. A
+ user agent might suggest in such a case to add "en" to get the
+ best matching behavior.
+
+14.5 Accept-Ranges
+
+ The Accept-Ranges response-header field allows the server to
+ indicate its acceptance of range requests for a resource:
+
+ Accept-Ranges = "Accept-Ranges" ":" acceptable-ranges
+ acceptable-ranges = 1#range-unit | "none"
+
+ Origin servers that accept byte-range requests MAY send
+
+ Accept-Ranges: bytes
+
+ but are not required to do so. Clients MAY generate byte-range
+ requests without having received this header for the resource
+ involved. Range units are defined in section 3.12.
+
+ Servers that do not accept any kind of range request for a
+ resource MAY send
+
+ Accept-Ranges: none
+
+ to advise the client not to attempt a range request.
+
+14.6 Age
+
+ The Age response-header field conveys the sender's estimate of the
+ amount of time since the response (or its revalidation) was
+ generated at the origin server. A cached response is "fresh" if
+ its age does not exceed its freshness lifetime. Age values are
+ calculated as specified in section 13.2.3.
+
+ Age = "Age" ":" age-value
+ age-value = delta-seconds
+
+ Age values are non-negative decimal integers, representing time in
+ seconds.
+
+ If a cache receives a value larger than the largest positive
+ integer it can represent, or if any of its age calculations
+ overflows, it MUST transmit an Age header with a value of
+ 2147483648 (2^31). An HTTP/1.1 server that includes a cache MUST
+ include an Age header field in every response generated from its
+ own cache. Caches SHOULD use an arithmetic type of at least 31
+ bits of range.
+
+14.7 Allow
+
+ The Allow entity-header field lists the set of methods supported
+ by the resource identified by the Request-URI. The purpose of this
+ field is strictly to inform the recipient of valid methods
+ associated with the resource. An Allow header field MUST be
+ present in a 405 (Method Not Allowed) response.
+
+ Allow = "Allow" ":" #Method
+
+ Example of use:
+
+ Allow: GET, HEAD, PUT
+
+ This field cannot prevent a client from trying other methods.
+ However, the indications given by the Allow header field value
+ SHOULD be followed. The actual set of allowed methods is defined
+ by the origin server at the time of each request.
+
+ The Allow header field MAY be provided with a PUT request to
+ recommend the methods to be supported by the new or modified
+ resource. The server is not required to support these methods and
+ SHOULD include an Allow header in the response giving the actual
+ supported methods.
+
+ A proxy MUST NOT modify the Allow header field even if it does not
+ understand all the methods specified, since the user agent might
+ have other means of communicating with the origin server.
+
+14.8 Authorization
+
+ A user agent that wishes to authenticate itself with a server--
+ usually, but not necessarily, after receiving a 401 response--does
+ so by including an Authorization request-header field with the
+ request. The Authorization field value consists of credentials
+ containing the authentication information of the user agent for
+ the realm of the resource being requested.
+
+ Authorization = "Authorization" ":" credentials
+
+ HTTP access authentication is described in "HTTP Authentication:
+ Basic and Digest Access Authentication" [43]. If a request is
+ authenticated and a realm specified, the same credentials SHOULD
+ be valid for all other requests within this realm (assuming that
+ the authentication scheme itself does not require otherwise, such
+ as credentials that vary according to a challenge value or using
+ synchronized clocks).
+
+ When a shared cache (see section 13.7) receives a request
+ containing an Authorization field, it MUST NOT return the
+ corresponding response as a reply to any other request, unless one
+ of the following specific exceptions holds:
+
+ 1. If the response includes the "s-maxage" cache-control
+ directive, the cache MAY use that response in replying to a
+ subsequent request. But (if the specified maximum age has
+ passed) a proxy cache MUST first revalidate it with the origin
+ server, using the request-headers from the new request to allow
+ the origin server to authenticate the new request. (This is the
+ defined behavior for s-maxage.) If the response includes "s-
+ maxage=0", the proxy MUST always revalidate it before re-using
+ it.
+
+ 2. If the response includes the "must-revalidate" cache-control
+ directive, the cache MAY use that response in replying to a
+ subsequent request. But if the response is stale, all caches
+ MUST first revalidate it with the origin server, using the
+ request-headers from the new request to allow the origin server
+ to authenticate the new request.
+
+ 3. If the response includes the "public" cache-control directive,
+ it MAY be returned in reply to any subsequent request.
+
+14.9 Cache-Control
+
+ The Cache-Control general-header field is used to specify directives
+ that MUST be obeyed by all caching mechanisms along the
+ request/response chain. The directives specify behavior intended to
+ prevent caches from adversely interfering with the request or
+ response. These directives typically override the default caching
+ algorithms. Cache directives are unidirectional in that the presence
+ of a directive in a request does not imply that the same directive is
+ to be given in the response.
+
+ Note that HTTP/1.0 caches might not implement Cache-Control and
+ might only implement Pragma: no-cache (see section 14.32).
+
+ Cache directives MUST be passed through by a proxy or gateway
+ application, regardless of their significance to that application,
+ since the directives might be applicable to all recipients along the
+ request/response chain. It is not possible to specify a cache-
+ directive for a specific cache.
+
+ Cache-Control = "Cache-Control" ":" 1#cache-directive
+
+ cache-directive = cache-request-directive
+ | cache-response-directive
+
+ cache-request-directive =
+ "no-cache" ; Section 14.9.1
+ | "no-store" ; Section 14.9.2
+ | "max-age" "=" delta-seconds ; Section 14.9.3, 14.9.4
+ | "max-stale" [ "=" delta-seconds ] ; Section 14.9.3
+ | "min-fresh" "=" delta-seconds ; Section 14.9.3
+ | "no-transform" ; Section 14.9.5
+ | "only-if-cached" ; Section 14.9.4
+ | cache-extension ; Section 14.9.6
+
+ cache-response-directive =
+ "public" ; Section 14.9.1
+ | "private" [ "=" &lt;"&gt; 1#field-name &lt;"&gt; ] ; Section 14.9.1
+ | "no-cache" [ "=" &lt;"&gt; 1#field-name &lt;"&gt; ]; Section 14.9.1
+ | "no-store" ; Section 14.9.2
+ | "no-transform" ; Section 14.9.5
+ | "must-revalidate" ; Section 14.9.4
+ | "proxy-revalidate" ; Section 14.9.4
+ | "max-age" "=" delta-seconds ; Section 14.9.3
+ | "s-maxage" "=" delta-seconds ; Section 14.9.3
+ | cache-extension ; Section 14.9.6
+
+ cache-extension = token [ "=" ( token | quoted-string ) ]
+
+ When a directive appears without any 1#field-name parameter, the
+ directive applies to the entire request or response. When such a
+ directive appears with a 1#field-name parameter, it applies only to
+ the named field or fields, and not to the rest of the request or
+ response. This mechanism supports extensibility; implementations of
+ future versions of the HTTP protocol might apply these directives to
+ header fields not defined in HTTP/1.1.
+
+ The cache-control directives can be broken down into these general
+ categories:
+
+ - Restrictions on what are cacheable; these may only be imposed by
+ the origin server.
+
+ - Restrictions on what may be stored by a cache; these may be
+ imposed by either the origin server or the user agent.
+
+ - Modifications of the basic expiration mechanism; these may be
+ imposed by either the origin server or the user agent.
+
+ - Controls over cache revalidation and reload; these may only be
+ imposed by a user agent.
+
+ - Control over transformation of entities.
+
+ - Extensions to the caching system.
+
+14.9.1 What is Cacheable
+
+ By default, a response is cacheable if the requirements of the
+ request method, request header fields, and the response status
+ indicate that it is cacheable. Section 13.4 summarizes these defaults
+ for cacheability. The following Cache-Control response directives
+ allow an origin server to override the default cacheability of a
+ response:
+
+ public
+ Indicates that the response MAY be cached by any cache, even if it
+ would normally be non-cacheable or cacheable only within a non-
+ shared cache. (See also Authorization, section 14.8, for
+ additional details.)
+
+ private
+ Indicates that all or part of the response message is intended for
+ a single user and MUST NOT be cached by a shared cache. This
+ allows an origin server to state that the specified parts of the
+
+ response are intended for only one user and are not a valid
+ response for requests by other users. A private (non-shared) cache
+ MAY cache the response.
+
+ Note: This usage of the word private only controls where the
+ response may be cached, and cannot ensure the privacy of the
+ message content.
+
+ no-cache
+ If the no-cache directive does not specify a field-name, then a
+ cache MUST NOT use the response to satisfy a subsequent request
+ without successful revalidation with the origin server. This
+ allows an origin server to prevent caching even by caches that
+ have been configured to return stale responses to client requests.
+
+ If the no-cache directive does specify one or more field-names,
+ then a cache MAY use the response to satisfy a subsequent request,
+ subject to any other restrictions on caching. However, the
+ specified field-name(s) MUST NOT be sent in the response to a
+ subsequent request without successful revalidation with the origin
+ server. This allows an origin server to prevent the re-use of
+ certain header fields in a response, while still allowing caching
+ of the rest of the response.
+
+ Note: Most HTTP/1.0 caches will not recognize or obey this
+ directive.
+
+14.9.2 What May be Stored by Caches
+
+ no-store
+ The purpose of the no-store directive is to prevent the
+ inadvertent release or retention of sensitive information (for
+ example, on backup tapes). The no-store directive applies to the
+ entire message, and MAY be sent either in a response or in a
+ request. If sent in a request, a cache MUST NOT store any part of
+ either this request or any response to it. If sent in a response,
+ a cache MUST NOT store any part of either this response or the
+ request that elicited it. This directive applies to both non-
+ shared and shared caches. "MUST NOT store" in this context means
+ that the cache MUST NOT intentionally store the information in
+ non-volatile storage, and MUST make a best-effort attempt to
+ remove the information from volatile storage as promptly as
+ possible after forwarding it.
+
+ Even when this directive is associated with a response, users
+ might explicitly store such a response outside of the caching
+ system (e.g., with a "Save As" dialog). History buffers MAY store
+ such responses as part of their normal operation.
+
+ The purpose of this directive is to meet the stated requirements
+ of certain users and service authors who are concerned about
+ accidental releases of information via unanticipated accesses to
+ cache data structures. While the use of this directive might
+ improve privacy in some cases, we caution that it is NOT in any
+ way a reliable or sufficient mechanism for ensuring privacy. In
+ particular, malicious or compromised caches might not recognize or
+ obey this directive, and communications networks might be
+ vulnerable to eavesdropping.
+
+14.9.3 Modifications of the Basic Expiration Mechanism
+
+ The expiration time of an entity MAY be specified by the origin
+ server using the Expires header (see section 14.21). Alternatively,
+ it MAY be specified using the max-age directive in a response. When
+ the max-age cache-control directive is present in a cached response,
+ the response is stale if its current age is greater than the age
+ value given (in seconds) at the time of a new request for that
+ resource. The max-age directive on a response implies that the
+ response is cacheable (i.e., "public") unless some other, more
+ restrictive cache directive is also present.
+
+ If a response includes both an Expires header and a max-age
+ directive, the max-age directive overrides the Expires header, even
+ if the Expires header is more restrictive. This rule allows an origin
+ server to provide, for a given response, a longer expiration time to
+ an HTTP/1.1 (or later) cache than to an HTTP/1.0 cache. This might be
+ useful if certain HTTP/1.0 caches improperly calculate ages or
+ expiration times, perhaps due to desynchronized clocks.
+
+ Many HTTP/1.0 cache implementations will treat an Expires value that
+ is less than or equal to the response Date value as being equivalent
+ to the Cache-Control response directive "no-cache". If an HTTP/1.1
+ cache receives such a response, and the response does not include a
+ Cache-Control header field, it SHOULD consider the response to be
+ non-cacheable in order to retain compatibility with HTTP/1.0 servers.
+
+ Note: An origin server might wish to use a relatively new HTTP
+ cache control feature, such as the "private" directive, on a
+ network including older caches that do not understand that
+ feature. The origin server will need to combine the new feature
+ with an Expires field whose value is less than or equal to the
+ Date value. This will prevent older caches from improperly
+ caching the response.
+
+ s-maxage
+ If a response includes an s-maxage directive, then for a shared
+ cache (but not for a private cache), the maximum age specified by
+ this directive overrides the maximum age specified by either the
+ max-age directive or the Expires header. The s-maxage directive
+ also implies the semantics of the proxy-revalidate directive (see
+ section 14.9.4), i.e., that the shared cache must not use the
+ entry after it becomes stale to respond to a subsequent request
+ without first revalidating it with the origin server. The s-
+ maxage directive is always ignored by a private cache.
+
+ Note that most older caches, not compliant with this specification,
+ do not implement any cache-control directives. An origin server
+ wishing to use a cache-control directive that restricts, but does not
+ prevent, caching by an HTTP/1.1-compliant cache MAY exploit the
+ requirement that the max-age directive overrides the Expires header,
+ and the fact that pre-HTTP/1.1-compliant caches do not observe the
+ max-age directive.
+
+ Other directives allow a user agent to modify the basic expiration
+ mechanism. These directives MAY be specified on a request:
+
+ max-age
+ Indicates that the client is willing to accept a response whose
+ age is no greater than the specified time in seconds. Unless max-
+ stale directive is also included, the client is not willing to
+ accept a stale response.
+
+ min-fresh
+ Indicates that the client is willing to accept a response whose
+ freshness lifetime is no less than its current age plus the
+ specified time in seconds. That is, the client wants a response
+ that will still be fresh for at least the specified number of
+ seconds.
+
+ max-stale
+ Indicates that the client is willing to accept a response that has
+ exceeded its expiration time. If max-stale is assigned a value,
+ then the client is willing to accept a response that has exceeded
+ its expiration time by no more than the specified number of
+ seconds. If no value is assigned to max-stale, then the client is
+ willing to accept a stale response of any age.
+
+ If a cache returns a stale response, either because of a max-stale
+ directive on a request, or because the cache is configured to
+ override the expiration time of a response, the cache MUST attach a
+ Warning header to the stale response, using Warning 110 (Response is
+ stale).
+
+ A cache MAY be configured to return stale responses without
+ validation, but only if this does not conflict with any "MUST"-level
+ requirements concerning cache validation (e.g., a "must-revalidate"
+ cache-control directive).
+
+ If both the new request and the cached entry include "max-age"
+ directives, then the lesser of the two values is used for determining
+ the freshness of the cached entry for that request.
+
+14.9.4 Cache Revalidation and Reload Controls
+
+ Sometimes a user agent might want or need to insist that a cache
+ revalidate its cache entry with the origin server (and not just with
+ the next cache along the path to the origin server), or to reload its
+ cache entry from the origin server. End-to-end revalidation might be
+ necessary if either the cache or the origin server has overestimated
+ the expiration time of the cached response. End-to-end reload may be
+ necessary if the cache entry has become corrupted for some reason.
+
+ End-to-end revalidation may be requested either when the client does
+ not have its own local cached copy, in which case we call it
+ "unspecified end-to-end revalidation", or when the client does have a
+ local cached copy, in which case we call it "specific end-to-end
+ revalidation."
+
+ The client can specify these three kinds of action using Cache-
+ Control request directives:
+
+ End-to-end reload
+ The request includes a "no-cache" cache-control directive or, for
+ compatibility with HTTP/1.0 clients, "Pragma: no-cache". Field
+ names MUST NOT be included with the no-cache directive in a
+ request. The server MUST NOT use a cached copy when responding to
+ such a request.
+
+ Specific end-to-end revalidation
+ The request includes a "max-age=0" cache-control directive, which
+ forces each cache along the path to the origin server to
+ revalidate its own entry, if any, with the next cache or server.
+ The initial request includes a cache-validating conditional with
+ the client's current validator.
+
+ Unspecified end-to-end revalidation
+ The request includes "max-age=0" cache-control directive, which
+ forces each cache along the path to the origin server to
+ revalidate its own entry, if any, with the next cache or server.
+ The initial request does not include a cache-validating
+
+ conditional; the first cache along the path (if any) that holds a
+ cache entry for this resource includes a cache-validating
+ conditional with its current validator.
+
+ max-age
+ When an intermediate cache is forced, by means of a max-age=0
+ directive, to revalidate its own cache entry, and the client has
+ supplied its own validator in the request, the supplied validator
+ might differ from the validator currently stored with the cache
+ entry. In this case, the cache MAY use either validator in making
+ its own request without affecting semantic transparency.
+
+ However, the choice of validator might affect performance. The
+ best approach is for the intermediate cache to use its own
+ validator when making its request. If the server replies with 304
+ (Not Modified), then the cache can return its now validated copy
+ to the client with a 200 (OK) response. If the server replies with
+ a new entity and cache validator, however, the intermediate cache
+ can compare the returned validator with the one provided in the
+ client's request, using the strong comparison function. If the
+ client's validator is equal to the origin server's, then the
+ intermediate cache simply returns 304 (Not Modified). Otherwise,
+ it returns the new entity with a 200 (OK) response.
+
+ If a request includes the no-cache directive, it SHOULD NOT
+ include min-fresh, max-stale, or max-age.
+
+ only-if-cached
+ In some cases, such as times of extremely poor network
+ connectivity, a client may want a cache to return only those
+ responses that it currently has stored, and not to reload or
+ revalidate with the origin server. To do this, the client may
+ include the only-if-cached directive in a request. If it receives
+ this directive, a cache SHOULD either respond using a cached entry
+ that is consistent with the other constraints of the request, or
+ respond with a 504 (Gateway Timeout) status. However, if a group
+ of caches is being operated as a unified system with good internal
+ connectivity, such a request MAY be forwarded within that group of
+ caches.
+
+ must-revalidate
+ Because a cache MAY be configured to ignore a server's specified
+ expiration time, and because a client request MAY include a max-
+ stale directive (which has a similar effect), the protocol also
+ includes a mechanism for the origin server to require revalidation
+ of a cache entry on any subsequent use. When the must-revalidate
+ directive is present in a response received by a cache, that cache
+ MUST NOT use the entry after it becomes stale to respond to a
+
+ subsequent request without first revalidating it with the origin
+ server. (I.e., the cache MUST do an end-to-end revalidation every
+ time, if, based solely on the origin server's Expires or max-age
+ value, the cached response is stale.)
+
+ The must-revalidate directive is necessary to support reliable
+ operation for certain protocol features. In all circumstances an
+ HTTP/1.1 cache MUST obey the must-revalidate directive; in
+ particular, if the cache cannot reach the origin server for any
+ reason, it MUST generate a 504 (Gateway Timeout) response.
+
+ Servers SHOULD send the must-revalidate directive if and only if
+ failure to revalidate a request on the entity could result in
+ incorrect operation, such as a silently unexecuted financial
+ transaction. Recipients MUST NOT take any automated action that
+ violates this directive, and MUST NOT automatically provide an
+ unvalidated copy of the entity if revalidation fails.
+
+ Although this is not recommended, user agents operating under
+ severe connectivity constraints MAY violate this directive but, if
+ so, MUST explicitly warn the user that an unvalidated response has
+ been provided. The warning MUST be provided on each unvalidated
+ access, and SHOULD require explicit user confirmation.
+
+ proxy-revalidate
+ The proxy-revalidate directive has the same meaning as the must-
+ revalidate directive, except that it does not apply to non-shared
+ user agent caches. It can be used on a response to an
+ authenticated request to permit the user's cache to store and
+ later return the response without needing to revalidate it (since
+ it has already been authenticated once by that user), while still
+ requiring proxies that service many users to revalidate each time
+ (in order to make sure that each user has been authenticated).
+ Note that such authenticated responses also need the public cache
+ control directive in order to allow them to be cached at all.
+
+14.9.5 No-Transform Directive
+
+ no-transform
+ Implementors of intermediate caches (proxies) have found it useful
+ to convert the media type of certain entity bodies. A non-
+ transparent proxy might, for example, convert between image
+ formats in order to save cache space or to reduce the amount of
+ traffic on a slow link.
+
+ Serious operational problems occur, however, when these
+ transformations are applied to entity bodies intended for certain
+ kinds of applications. For example, applications for medical
+
+ imaging, scientific data analysis and those using end-to-end
+ authentication, all depend on receiving an entity body that is bit
+ for bit identical to the original entity-body.
+
+ Therefore, if a message includes the no-transform directive, an
+ intermediate cache or proxy MUST NOT change those headers that are
+ listed in section 13.5.2 as being subject to the no-transform
+ directive. This implies that the cache or proxy MUST NOT change
+ any aspect of the entity-body that is specified by these headers,
+ including the value of the entity-body itself.
+
+14.9.6 Cache Control Extensions
+
+ The Cache-Control header field can be extended through the use of one
+ or more cache-extension tokens, each with an optional assigned value.
+ Informational extensions (those which do not require a change in
+ cache behavior) MAY be added without changing the semantics of other
+ directives. Behavioral extensions are designed to work by acting as
+ modifiers to the existing base of cache directives. Both the new
+ directive and the standard directive are supplied, such that
+ applications which do not understand the new directive will default
+ to the behavior specified by the standard directive, and those that
+ understand the new directive will recognize it as modifying the
+ requirements associated with the standard directive. In this way,
+ extensions to the cache-control directives can be made without
+ requiring changes to the base protocol.
+
+ This extension mechanism depends on an HTTP cache obeying all of the
+ cache-control directives defined for its native HTTP-version, obeying
+ certain extensions, and ignoring all directives that it does not
+ understand.
+
+ For example, consider a hypothetical new response directive called
+ community which acts as a modifier to the private directive. We
+ define this new directive to mean that, in addition to any non-shared
+ cache, any cache which is shared only by members of the community
+ named within its value may cache the response. An origin server
+ wishing to allow the UCI community to use an otherwise private
+ response in their shared cache(s) could do so by including
+
+ Cache-Control: private, community="UCI"
+
+ A cache seeing this header field will act correctly even if the cache
+ does not understand the community cache-extension, since it will also
+ see and understand the private directive and thus default to the safe
+ behavior.
+
+ Unrecognized cache-directives MUST be ignored; it is assumed that any
+ cache-directive likely to be unrecognized by an HTTP/1.1 cache will
+ be combined with standard directives (or the response's default
+ cacheability) such that the cache behavior will remain minimally
+ correct even if the cache does not understand the extension(s).
+
+14.10 Connection
+
+ The Connection general-header field allows the sender to specify
+ options that are desired for that particular connection and MUST NOT
+ be communicated by proxies over further connections.
+
+ The Connection header has the following grammar:
+
+ Connection = "Connection" ":" 1#(connection-token)
+ connection-token = token
+
+ HTTP/1.1 proxies MUST parse the Connection header field before a
+ message is forwarded and, for each connection-token in this field,
+ remove any header field(s) from the message with the same name as the
+ connection-token. Connection options are signaled by the presence of
+ a connection-token in the Connection header field, not by any
+ corresponding additional header field(s), since the additional header
+ field may not be sent if there are no parameters associated with that
+ connection option.
+
+ Message headers listed in the Connection header MUST NOT include
+ end-to-end headers, such as Cache-Control.
+
+ HTTP/1.1 defines the "close" connection option for the sender to
+ signal that the connection will be closed after completion of the
+ response. For example,
+
+ Connection: close
+
+ in either the request or the response header fields indicates that
+ the connection SHOULD NOT be considered `persistent' (section 8.1)
+ after the current request/response is complete.
+
+ HTTP/1.1 applications that do not support persistent connections MUST
+ include the "close" connection option in every message.
+
+ A system receiving an HTTP/1.0 (or lower-version) message that
+ includes a Connection header MUST, for each connection-token in this
+ field, remove and ignore any header field(s) from the message with
+ the same name as the connection-token. This protects against mistaken
+ forwarding of such header fields by pre-HTTP/1.1 proxies. See section
+ 19.6.2.
+
+14.11 Content-Encoding
+
+ The Content-Encoding entity-header field is used as a modifier to the
+ media-type. When present, its value indicates what additional content
+ codings have been applied to the entity-body, and thus what decoding
+ mechanisms must be applied in order to obtain the media-type
+ referenced by the Content-Type header field. Content-Encoding is
+ primarily used to allow a document to be compressed without losing
+ the identity of its underlying media type.
+
+ Content-Encoding = "Content-Encoding" ":" 1#content-coding
+
+ Content codings are defined in section 3.5. An example of its use is
+
+ Content-Encoding: gzip
+
+ The content-coding is a characteristic of the entity identified by
+ the Request-URI. Typically, the entity-body is stored with this
+ encoding and is only decoded before rendering or analogous usage.
+ However, a non-transparent proxy MAY modify the content-coding if the
+ new coding is known to be acceptable to the recipient, unless the
+ "no-transform" cache-control directive is present in the message.
+
+ If the content-coding of an entity is not "identity", then the
+ response MUST include a Content-Encoding entity-header (section
+ 14.11) that lists the non-identity content-coding(s) used.
+
+ If the content-coding of an entity in a request message is not
+ acceptable to the origin server, the server SHOULD respond with a
+ status code of 415 (Unsupported Media Type).
+
+ If multiple encodings have been applied to an entity, the content
+ codings MUST be listed in the order in which they were applied.
+ Additional information about the encoding parameters MAY be provided
+ by other entity-header fields not defined by this specification.
+
+14.12 Content-Language
+
+ The Content-Language entity-header field describes the natural
+ language(s) of the intended audience for the enclosed entity. Note
+ that this might not be equivalent to all the languages used within
+ the entity-body.
+
+ Content-Language = "Content-Language" ":" 1#language-tag
+
+ Language tags are defined in section 3.10. The primary purpose of
+ Content-Language is to allow a user to identify and differentiate
+ entities according to the user's own preferred language. Thus, if the
+ body content is intended only for a Danish-literate audience, the
+ appropriate field is
+
+ Content-Language: da
+
+ If no Content-Language is specified, the default is that the content
+ is intended for all language audiences. This might mean that the
+ sender does not consider it to be specific to any natural language,
+ or that the sender does not know for which language it is intended.
+
+ Multiple languages MAY be listed for content that is intended for
+ multiple audiences. For example, a rendition of the "Treaty of
+ Waitangi," presented simultaneously in the original Maori and English
+ versions, would call for
+
+ Content-Language: mi, en
+
+ However, just because multiple languages are present within an entity
+ does not mean that it is intended for multiple linguistic audiences.
+ An example would be a beginner's language primer, such as "A First
+ Lesson in Latin," which is clearly intended to be used by an
+ English-literate audience. In this case, the Content-Language would
+ properly only include "en".
+
+ Content-Language MAY be applied to any media type -- it is not
+ limited to textual documents.
+
+14.13 Content-Length
+
+ The Content-Length entity-header field indicates the size of the
+ entity-body, in decimal number of OCTETs, sent to the recipient or,
+ in the case of the HEAD method, the size of the entity-body that
+ would have been sent had the request been a GET.
+
+ Content-Length = "Content-Length" ":" 1*DIGIT
+
+ An example is
+
+ Content-Length: 3495
+
+ Applications SHOULD use this field to indicate the transfer-length of
+ the message-body, unless this is prohibited by the rules in section
+ 4.4.
+
+ Any Content-Length greater than or equal to zero is a valid value.
+ Section 4.4 describes how to determine the length of a message-body
+ if a Content-Length is not given.
+
+ Note that the meaning of this field is significantly different from
+ the corresponding definition in MIME, where it is an optional field
+ used within the "message/external-body" content-type. In HTTP, it
+ SHOULD be sent whenever the message's length can be determined prior
+ to being transferred, unless this is prohibited by the rules in
+ section 4.4.
+
+14.14 Content-Location
+
+ The Content-Location entity-header field MAY be used to supply the
+ resource location for the entity enclosed in the message when that
+ entity is accessible from a location separate from the requested
+ resource's URI. A server SHOULD provide a Content-Location for the
+ variant corresponding to the response entity; especially in the case
+ where a resource has multiple entities associated with it, and those
+ entities actually have separate locations by which they might be
+ individually accessed, the server SHOULD provide a Content-Location
+ for the particular variant which is returned.
+
+ Content-Location = "Content-Location" ":"
+ ( absoluteURI | relativeURI )
+
+ The value of Content-Location also defines the base URI for the
+ entity.
+
+ The Content-Location value is not a replacement for the original
+ requested URI; it is only a statement of the location of the resource
+ corresponding to this particular entity at the time of the request.
+ Future requests MAY specify the Content-Location URI as the request-
+ URI if the desire is to identify the source of that particular
+ entity.
+
+ A cache cannot assume that an entity with a Content-Location
+ different from the URI used to retrieve it can be used to respond to
+ later requests on that Content-Location URI. However, the Content-
+ Location can be used to differentiate between multiple entities
+ retrieved from a single requested resource, as described in section
+ 13.6.
+
+ If the Content-Location is a relative URI, the relative URI is
+ interpreted relative to the Request-URI.
+
+ The meaning of the Content-Location header in PUT or POST requests is
+ undefined; servers are free to ignore it in those cases.
+
+14.15 Content-MD5
+
+ The Content-MD5 entity-header field, as defined in <a href="http://firefly.troll.no/rfcs/rfc1864.html">RFC 1864</a> [23], is
+ an MD5 digest of the entity-body for the purpose of providing an
+ end-to-end message integrity check (MIC) of the entity-body. (Note: a
+ MIC is good for detecting accidental modification of the entity-body
+ in transit, but is not proof against malicious attacks.)
+
+ Content-MD5 = "Content-MD5" ":" md5-digest
+ md5-digest = &lt;base64 of 128 bit MD5 digest as per <a href="http://firefly.troll.no/rfcs/rfc1864.html">RFC 1864</a>&gt;
+
+ The Content-MD5 header field MAY be generated by an origin server or
+ client to function as an integrity check of the entity-body. Only
+ origin servers or clients MAY generate the Content-MD5 header field;
+ proxies and gateways MUST NOT generate it, as this would defeat its
+ value as an end-to-end integrity check. Any recipient of the entity-
+ body, including gateways and proxies, MAY check that the digest value
+ in this header field matches that of the entity-body as received.
+
+ The MD5 digest is computed based on the content of the entity-body,
+ including any content-coding that has been applied, but not including
+ any transfer-encoding applied to the message-body. If the message is
+ received with a transfer-encoding, that encoding MUST be removed
+ prior to checking the Content-MD5 value against the received entity.
+
+ This has the result that the digest is computed on the octets of the
+ entity-body exactly as, and in the order that, they would be sent if
+ no transfer-encoding were being applied.
+
+ HTTP extends <a href="http://firefly.troll.no/rfcs/rfc1864.html">RFC 1864</a> to permit the digest to be computed for MIME
+ composite media-types (e.g., multipart/* and message/rfc822), but
+ this does not change how the digest is computed as defined in the
+ preceding paragraph.
+
+ There are several consequences of this. The entity-body for composite
+ types MAY contain many body-parts, each with its own MIME and HTTP
+ headers (including Content-MD5, Content-Transfer-Encoding, and
+ Content-Encoding headers). If a body-part has a Content-Transfer-
+ Encoding or Content-Encoding header, it is assumed that the content
+ of the body-part has had the encoding applied, and the body-part is
+ included in the Content-MD5 digest as is -- i.e., after the
+ application. The Transfer-Encoding header field is not allowed within
+ body-parts.
+
+ Conversion of all line breaks to CRLF MUST NOT be done before
+ computing or checking the digest: the line break convention used in
+ the text actually transmitted MUST be left unaltered when computing
+ the digest.
+
+ Note: while the definition of Content-MD5 is exactly the same for
+ HTTP as in <a href="http://firefly.troll.no/rfcs/rfc1864.html">RFC 1864</a> for MIME entity-bodies, there are several ways
+ in which the application of Content-MD5 to HTTP entity-bodies
+ differs from its application to MIME entity-bodies. One is that
+ HTTP, unlike MIME, does not use Content-Transfer-Encoding, and
+ does use Transfer-Encoding and Content-Encoding. Another is that
+ HTTP more frequently uses binary content types than MIME, so it is
+ worth noting that, in such cases, the byte order used to compute
+ the digest is the transmission byte order defined for the type.
+ Lastly, HTTP allows transmission of text types with any of several
+ line break conventions and not just the canonical form using CRLF.
+
+14.16 Content-Range
+
+ The Content-Range entity-header is sent with a partial entity-body to
+ specify where in the full entity-body the partial body should be
+ applied. Range units are defined in section 3.12.
+
+ Content-Range = "Content-Range" ":" content-range-spec
+
+ content-range-spec = byte-content-range-spec
+ byte-content-range-spec = bytes-unit SP
+ byte-range-resp-spec "/"
+ ( instance-length | "*" )
+
+ byte-range-resp-spec = (first-byte-pos "-" last-byte-pos)
+ | "*"
+ instance-length = 1*DIGIT
+
+ The header SHOULD indicate the total length of the full entity-body,
+ unless this length is unknown or difficult to determine. The asterisk
+ "*" character means that the instance-length is unknown at the time
+ when the response was generated.
+
+ Unlike byte-ranges-specifier values (see section 14.35.1), a byte-
+ range-resp-spec MUST only specify one range, and MUST contain
+ absolute byte positions for both the first and last byte of the
+ range.
+
+ A byte-content-range-spec with a byte-range-resp-spec whose last-
+ byte-pos value is less than its first-byte-pos value, or whose
+ instance-length value is less than or equal to its last-byte-pos
+ value, is invalid. The recipient of an invalid byte-content-range-
+ spec MUST ignore it and any content transferred along with it.
+
+ A server sending a response with status code 416 (Requested range not
+ satisfiable) SHOULD include a Content-Range field with a byte-range-
+ resp-spec of "*". The instance-length specifies the current length of
+
+ the selected resource. A response with status code 206 (Partial
+ Content) MUST NOT include a Content-Range field with a byte-range-
+ resp-spec of "*".
+
+ Examples of byte-content-range-spec values, assuming that the entity
+ contains a total of 1234 bytes:
+
+ . The first 500 bytes:
+ bytes 0-499/1234
+
+ . The second 500 bytes:
+ bytes 500-999/1234
+
+ . All except for the first 500 bytes:
+ bytes 500-1233/1234
+
+ . The last 500 bytes:
+ bytes 734-1233/1234
+
+ When an HTTP message includes the content of a single range (for
+ example, a response to a request for a single range, or to a request
+ for a set of ranges that overlap without any holes), this content is
+ transmitted with a Content-Range header, and a Content-Length header
+ showing the number of bytes actually transferred. For example,
+
+ HTTP/1.1 206 Partial content
+ Date: Wed, 15 Nov 1995 06:25:24 GMT
+ Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
+ Content-Range: bytes 21010-47021/47022
+ Content-Length: 26012
+ Content-Type: image/gif
+
+ When an HTTP message includes the content of multiple ranges (for
+ example, a response to a request for multiple non-overlapping
+ ranges), these are transmitted as a multipart message. The multipart
+ media type used for this purpose is "multipart/byteranges" as defined
+ in appendix 19.2. See appendix 19.6.3 for a compatibility issue.
+
+ A response to a request for a single range MUST NOT be sent using the
+ multipart/byteranges media type. A response to a request for
+ multiple ranges, whose result is a single range, MAY be sent as a
+ multipart/byteranges media type with one part. A client that cannot
+ decode a multipart/byteranges message MUST NOT ask for multiple
+ byte-ranges in a single request.
+
+ When a client requests multiple byte-ranges in one request, the
+ server SHOULD return them in the order that they appeared in the
+ request.
+
+ If the server ignores a byte-range-spec because it is syntactically
+ invalid, the server SHOULD treat the request as if the invalid Range
+ header field did not exist. (Normally, this means return a 200
+ response containing the full entity).
+
+ If the server receives a request (other than one including an If-
+ Range request-header field) with an unsatisfiable Range request-
+ header field (that is, all of whose byte-range-spec values have a
+ first-byte-pos value greater than the current length of the selected
+ resource), it SHOULD return a response code of 416 (Requested range
+ not satisfiable) (section 10.4.17).
+
+ Note: clients cannot depend on servers to send a 416 (Requested
+ range not satisfiable) response instead of a 200 (OK) response for
+ an unsatisfiable Range request-header, since not all servers
+ implement this request-header.
+
+14.17 Content-Type
+
+ The Content-Type entity-header field indicates the media type of the
+ entity-body sent to the recipient or, in the case of the HEAD method,
+ the media type that would have been sent had the request been a GET.
+
+ Content-Type = "Content-Type" ":" media-type
+
+ Media types are defined in section 3.7. An example of the field is
+
+ Content-Type: text/html; charset=ISO-8859-4
+
+ Further discussion of methods for identifying the media type of an
+ entity is provided in section 7.2.1.
+
+14.18 Date
+
+ The Date general-header field represents the date and time at which
+ the message was originated, having the same semantics as orig-date in
+ <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a>. The field value is an HTTP-date, as described in section
+ 3.3.1; it MUST be sent in <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a> [8]-date format.
+
+ Date = "Date" ":" HTTP-date
+
+ An example is
+
+ Date: Tue, 15 Nov 1994 08:12:31 GMT
+
+ Origin servers MUST include a Date header field in all responses,
+ except in these cases:
+
+ 1. If the response status code is 100 (Continue) or 101 (Switching
+ Protocols), the response MAY include a Date header field, at
+ the server's option.
+
+ 2. If the response status code conveys a server error, e.g. 500
+ (Internal Server Error) or 503 (Service Unavailable), and it is
+ inconvenient or impossible to generate a valid Date.
+
+ 3. If the server does not have a clock that can provide a
+ reasonable approximation of the current time, its responses
+ MUST NOT include a Date header field. In this case, the rules
+ in section 14.18.1 MUST be followed.
+
+ A received message that does not have a Date header field MUST be
+ assigned one by the recipient if the message will be cached by that
+ recipient or gatewayed via a protocol which requires a Date. An HTTP
+ implementation without a clock MUST NOT cache responses without
+ revalidating them on every use. An HTTP cache, especially a shared
+ cache, SHOULD use a mechanism, such as NTP [28], to synchronize its
+ clock with a reliable external standard.
+
+ Clients SHOULD only send a Date header field in messages that include
+ an entity-body, as in the case of the PUT and POST requests, and even
+ then it is optional. A client without a clock MUST NOT send a Date
+ header field in a request.
+
+ The HTTP-date sent in a Date header SHOULD NOT represent a date and
+ time subsequent to the generation of the message. It SHOULD represent
+ the best available approximation of the date and time of message
+ generation, unless the implementation has no means of generating a
+ reasonably accurate date and time. In theory, the date ought to
+ represent the moment just before the entity is generated. In
+ practice, the date can be generated at any time during the message
+ origination without affecting its semantic value.
+
+14.18.1 Clockless Origin Server Operation
+
+ Some origin server implementations might not have a clock available.
+ An origin server without a clock MUST NOT assign Expires or Last-
+ Modified values to a response, unless these values were associated
+ with the resource by a system or user with a reliable clock. It MAY
+ assign an Expires value that is known, at or before server
+ configuration time, to be in the past (this allows "pre-expiration"
+ of responses without storing separate Expires values for each
+ resource).
+
+14.19 ETag
+
+ The ETag response-header field provides the current value of the
+ entity tag for the requested variant. The headers used with entity
+ tags are described in sections 14.24, 14.26 and 14.44. The entity tag
+ MAY be used for comparison with other entities from the same resource
+ (see section 13.3.3).
+
+ ETag = "ETag" ":" entity-tag
+
+ Examples:
+
+ ETag: "xyzzy"
+ ETag: W/"xyzzy"
+ ETag: ""
+
+14.20 Expect
+
+ The Expect request-header field is used to indicate that particular
+ server behaviors are required by the client.
+
+ Expect = "Expect" ":" 1#expectation
+
+ expectation = "100-continue" | expectation-extension
+ expectation-extension = token [ "=" ( token | quoted-string )
+ *expect-params ]
+ expect-params = ";" token [ "=" ( token | quoted-string ) ]
+
+ A server that does not understand or is unable to comply with any of
+ the expectation values in the Expect field of a request MUST respond
+ with appropriate error status. The server MUST respond with a 417
+ (Expectation Failed) status if any of the expectations cannot be met
+ or, if there are other problems with the request, some other 4xx
+ status.
+
+ This header field is defined with extensible syntax to allow for
+ future extensions. If a server receives a request containing an
+ Expect field that includes an expectation-extension that it does not
+ support, it MUST respond with a 417 (Expectation Failed) status.
+
+ Comparison of expectation values is case-insensitive for unquoted
+ tokens (including the 100-continue token), and is case-sensitive for
+ quoted-string expectation-extensions.
+
+ The Expect mechanism is hop-by-hop: that is, an HTTP/1.1 proxy MUST
+ return a 417 (Expectation Failed) status if it receives a request
+ with an expectation that it cannot meet. However, the Expect
+ request-header itself is end-to-end; it MUST be forwarded if the
+ request is forwarded.
+
+ Many older HTTP/1.0 and HTTP/1.1 applications do not understand the
+ Expect header.
+
+ See section 8.2.3 for the use of the 100 (continue) status.
+
+14.21 Expires
+
+ The Expires entity-header field gives the date/time after which the
+ response is considered stale. A stale cache entry may not normally be
+ returned by a cache (either a proxy cache or a user agent cache)
+ unless it is first validated with the origin server (or with an
+ intermediate cache that has a fresh copy of the entity). See section
+ 13.2 for further discussion of the expiration model.
+
+ The presence of an Expires field does not imply that the original
+ resource will change or cease to exist at, before, or after that
+ time.
+
+ The format is an absolute date and time as defined by HTTP-date in
+ section 3.3.1; it MUST be in <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a> date format:
+
+ Expires = "Expires" ":" HTTP-date
+
+ An example of its use is
+
+ Expires: Thu, 01 Dec 1994 16:00:00 GMT
+
+ Note: if a response includes a Cache-Control field with the max-
+ age directive (see section 14.9.3), that directive overrides the
+ Expires field.
+
+ HTTP/1.1 clients and caches MUST treat other invalid date formats,
+ especially including the value "0", as in the past (i.e., "already
+ expired").
+
+ To mark a response as "already expired," an origin server sends an
+ Expires date that is equal to the Date header value. (See the rules
+ for expiration calculations in section 13.2.4.)
+
+ To mark a response as "never expires," an origin server sends an
+ Expires date approximately one year from the time the response is
+ sent. HTTP/1.1 servers SHOULD NOT send Expires dates more than one
+ year in the future.
+
+ The presence of an Expires header field with a date value of some
+ time in the future on a response that otherwise would by default be
+ non-cacheable indicates that the response is cacheable, unless
+ indicated otherwise by a Cache-Control header field (section 14.9).
+
+14.22 From
+
+ The From request-header field, if given, SHOULD contain an Internet
+ e-mail address for the human user who controls the requesting user
+ agent. The address SHOULD be machine-usable, as defined by "mailbox"
+ in <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9] as updated by <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a> [8]:
+
+ From = "From" ":" mailbox
+
+ An example is:
+
+ From: <a href="mailto:webmaster@w3.org">webmaster@w3.org</a>
+
+ This header field MAY be used for logging purposes and as a means for
+ identifying the source of invalid or unwanted requests. It SHOULD NOT
+ be used as an insecure form of access protection. The interpretation
+ of this field is that the request is being performed on behalf of the
+ person given, who accepts responsibility for the method performed. In
+ particular, robot agents SHOULD include this header so that the
+ person responsible for running the robot can be contacted if problems
+ occur on the receiving end.
+
+ The Internet e-mail address in this field MAY be separate from the
+ Internet host which issued the request. For example, when a request
+ is passed through a proxy the original issuer's address SHOULD be
+ used.
+
+ The client SHOULD NOT send the From header field without the user's
+ approval, as it might conflict with the user's privacy interests or
+ their site's security policy. It is strongly recommended that the
+ user be able to disable, enable, and modify the value of this field
+ at any time prior to a request.
+
+14.23 Host
+
+ The Host request-header field specifies the Internet host and port
+ number of the resource being requested, as obtained from the original
+ URI given by the user or referring resource (generally an HTTP URL,
+
+ as described in section 3.2.2). The Host field value MUST represent
+ the naming authority of the origin server or gateway given by the
+ original URL. This allows the origin server or gateway to
+ differentiate between internally-ambiguous URLs, such as the root "/"
+ URL of a server for multiple host names on a single IP address.
+
+ Host = "Host" ":" host [ ":" port ] ; Section 3.2.2
+
+ A "host" without any trailing port information implies the default
+ port for the service requested (e.g., "80" for an HTTP URL). For
+ example, a request on the origin server for
+ &lt;<a href="http://www.w3.org/pub/WWW/">http://www.w3.org/pub/WWW/</a>&gt; would properly include:
+
+ GET /pub/WWW/ HTTP/1.1
+ Host: www.w3.org
+
+ A client MUST include a Host header field in all HTTP/1.1 request
+ messages . If the requested URI does not include an Internet host
+ name for the service being requested, then the Host header field MUST
+ be given with an empty value. An HTTP/1.1 proxy MUST ensure that any
+ request message it forwards does contain an appropriate Host header
+ field that identifies the service being requested by the proxy. All
+ Internet-based HTTP/1.1 servers MUST respond with a 400 (Bad Request)
+ status code to any HTTP/1.1 request message which lacks a Host header
+ field.
+
+ See sections 5.2 and 19.6.1.1 for other requirements relating to
+ Host.
+
+14.24 If-Match
+
+ The If-Match request-header field is used with a method to make it
+ conditional. A client that has one or more entities previously
+ obtained from the resource can verify that one of those entities is
+ current by including a list of their associated entity tags in the
+ If-Match header field. Entity tags are defined in section 3.11. The
+ purpose of this feature is to allow efficient updates of cached
+ information with a minimum amount of transaction overhead. It is also
+ used, on updating requests, to prevent inadvertent modification of
+ the wrong version of a resource. As a special case, the value "*"
+ matches any current entity of the resource.
+
+ If-Match = "If-Match" ":" ( "*" | 1#entity-tag )
+
+ If any of the entity tags match the entity tag of the entity that
+ would have been returned in the response to a similar GET request
+ (without the If-Match header) on that resource, or if "*" is given
+
+ and any current entity exists for that resource, then the server MAY
+ perform the requested method as if the If-Match header field did not
+ exist.
+
+ A server MUST use the strong comparison function (see section 13.3.3)
+ to compare the entity tags in If-Match.
+
+ If none of the entity tags match, or if "*" is given and no current
+ entity exists, the server MUST NOT perform the requested method, and
+ MUST return a 412 (Precondition Failed) response. This behavior is
+ most useful when the client wants to prevent an updating method, such
+ as PUT, from modifying a resource that has changed since the client
+ last retrieved it.
+
+ If the request would, without the If-Match header field, result in
+ anything other than a 2xx or 412 status, then the If-Match header
+ MUST be ignored.
+
+ The meaning of "If-Match: *" is that the method SHOULD be performed
+ if the representation selected by the origin server (or by a cache,
+ possibly using the Vary mechanism, see section 14.44) exists, and
+ MUST NOT be performed if the representation does not exist.
+
+ A request intended to update a resource (e.g., a PUT) MAY include an
+ If-Match header field to signal that the request method MUST NOT be
+ applied if the entity corresponding to the If-Match value (a single
+ entity tag) is no longer a representation of that resource. This
+ allows the user to indicate that they do not wish the request to be
+ successful if the resource has been changed without their knowledge.
+ Examples:
+
+ If-Match: "xyzzy"
+ If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
+ If-Match: *
+
+ The result of a request having both an If-Match header field and
+ either an If-None-Match or an If-Modified-Since header fields is
+ undefined by this specification.
+
+14.25 If-Modified-Since
+
+ The If-Modified-Since request-header field is used with a method to
+ make it conditional: if the requested variant has not been modified
+ since the time specified in this field, an entity will not be
+ returned from the server; instead, a 304 (not modified) response will
+ be returned without any message-body.
+
+ If-Modified-Since = "If-Modified-Since" ":" HTTP-date
+
+ An example of the field is:
+
+ If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
+
+ A GET method with an If-Modified-Since header and no Range header
+ requests that the identified entity be transferred only if it has
+ been modified since the date given by the If-Modified-Since header.
+ The algorithm for determining this includes the following cases:
+
+ a) If the request would normally result in anything other than a
+ 200 (OK) status, or if the passed If-Modified-Since date is
+ invalid, the response is exactly the same as for a normal GET.
+ A date which is later than the server's current time is
+ invalid.
+
+ b) If the variant has been modified since the If-Modified-Since
+ date, the response is exactly the same as for a normal GET.
+
+ c) If the variant has not been modified since a valid If-
+ Modified-Since date, the server SHOULD return a 304 (Not
+ Modified) response.
+
+ The purpose of this feature is to allow efficient updates of cached
+ information with a minimum amount of transaction overhead.
+
+ Note: The Range request-header field modifies the meaning of If-
+ Modified-Since; see section 14.35 for full details.
+
+ Note: If-Modified-Since times are interpreted by the server, whose
+ clock might not be synchronized with the client.
+
+ Note: When handling an If-Modified-Since header field, some
+ servers will use an exact date comparison function, rather than a
+ less-than function, for deciding whether to send a 304 (Not
+ Modified) response. To get best results when sending an If-
+ Modified-Since header field for cache validation, clients are
+ advised to use the exact date string received in a previous Last-
+ Modified header field whenever possible.
+
+ Note: If a client uses an arbitrary date in the If-Modified-Since
+ header instead of a date taken from the Last-Modified header for
+ the same request, the client should be aware of the fact that this
+ date is interpreted in the server's understanding of time. The
+ client should consider unsynchronized clocks and rounding problems
+ due to the different encodings of time between the client and
+ server. This includes the possibility of race conditions if the
+ document has changed between the time it was first requested and
+ the If-Modified-Since date of a subsequent request, and the
+
+ possibility of clock-skew-related problems if the If-Modified-
+ Since date is derived from the client's clock without correction
+ to the server's clock. Corrections for different time bases
+ between client and server are at best approximate due to network
+ latency.
+
+ The result of a request having both an If-Modified-Since header field
+ and either an If-Match or an If-Unmodified-Since header fields is
+ undefined by this specification.
+
+14.26 If-None-Match
+
+ The If-None-Match request-header field is used with a method to make
+ it conditional. A client that has one or more entities previously
+ obtained from the resource can verify that none of those entities is
+ current by including a list of their associated entity tags in the
+ If-None-Match header field. The purpose of this feature is to allow
+ efficient updates of cached information with a minimum amount of
+ transaction overhead. It is also used to prevent a method (e.g. PUT)
+ from inadvertently modifying an existing resource when the client
+ believes that the resource does not exist.
+
+ As a special case, the value "*" matches any current entity of the
+ resource.
+
+ If-None-Match = "If-None-Match" ":" ( "*" | 1#entity-tag )
+
+ If any of the entity tags match the entity tag of the entity that
+ would have been returned in the response to a similar GET request
+ (without the If-None-Match header) on that resource, or if "*" is
+ given and any current entity exists for that resource, then the
+ server MUST NOT perform the requested method, unless required to do
+ so because the resource's modification date fails to match that
+ supplied in an If-Modified-Since header field in the request.
+ Instead, if the request method was GET or HEAD, the server SHOULD
+ respond with a 304 (Not Modified) response, including the cache-
+ related header fields (particularly ETag) of one of the entities that
+ matched. For all other request methods, the server MUST respond with
+ a status of 412 (Precondition Failed).
+
+ See section 13.3.3 for rules on how to determine if two entities tags
+ match. The weak comparison function can only be used with GET or HEAD
+ requests.
+
+ If none of the entity tags match, then the server MAY perform the
+ requested method as if the If-None-Match header field did not exist,
+ but MUST also ignore any If-Modified-Since header field(s) in the
+ request. That is, if no entity tags match, then the server MUST NOT
+ return a 304 (Not Modified) response.
+
+ If the request would, without the If-None-Match header field, result
+ in anything other than a 2xx or 304 status, then the If-None-Match
+ header MUST be ignored. (See section 13.3.4 for a discussion of
+ server behavior when both If-Modified-Since and If-None-Match appear
+ in the same request.)
+
+ The meaning of "If-None-Match: *" is that the method MUST NOT be
+ performed if the representation selected by the origin server (or by
+ a cache, possibly using the Vary mechanism, see section 14.44)
+ exists, and SHOULD be performed if the representation does not exist.
+ This feature is intended to be useful in preventing races between PUT
+ operations.
+
+ Examples:
+
+ If-None-Match: "xyzzy"
+ If-None-Match: W/"xyzzy"
+ If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
+ If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
+ If-None-Match: *
+
+ The result of a request having both an If-None-Match header field and
+ either an If-Match or an If-Unmodified-Since header fields is
+ undefined by this specification.
+
+14.27 If-Range
+
+ If a client has a partial copy of an entity in its cache, and wishes
+ to have an up-to-date copy of the entire entity in its cache, it
+ could use the Range request-header with a conditional GET (using
+ either or both of If-Unmodified-Since and If-Match.) However, if the
+ condition fails because the entity has been modified, the client
+ would then have to make a second request to obtain the entire current
+ entity-body.
+
+ The If-Range header allows a client to "short-circuit" the second
+ request. Informally, its meaning is `if the entity is unchanged, send
+ me the part(s) that I am missing; otherwise, send me the entire new
+ entity'.
+
+ If-Range = "If-Range" ":" ( entity-tag | HTTP-date )
+
+ If the client has no entity tag for an entity, but does have a Last-
+ Modified date, it MAY use that date in an If-Range header. (The
+ server can distinguish between a valid HTTP-date and any form of
+ entity-tag by examining no more than two characters.) The If-Range
+ header SHOULD only be used together with a Range header, and MUST be
+ ignored if the request does not include a Range header, or if the
+ server does not support the sub-range operation.
+
+ If the entity tag given in the If-Range header matches the current
+ entity tag for the entity, then the server SHOULD provide the
+ specified sub-range of the entity using a 206 (Partial content)
+ response. If the entity tag does not match, then the server SHOULD
+ return the entire entity using a 200 (OK) response.
+
+14.28 If-Unmodified-Since
+
+ The If-Unmodified-Since request-header field is used with a method to
+ make it conditional. If the requested resource has not been modified
+ since the time specified in this field, the server SHOULD perform the
+ requested operation as if the If-Unmodified-Since header were not
+ present.
+
+ If the requested variant has been modified since the specified time,
+ the server MUST NOT perform the requested operation, and MUST return
+ a 412 (Precondition Failed).
+
+ If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date
+
+ An example of the field is:
+
+ If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT
+
+ If the request normally (i.e., without the If-Unmodified-Since
+ header) would result in anything other than a 2xx or 412 status, the
+ If-Unmodified-Since header SHOULD be ignored.
+
+ If the specified date is invalid, the header is ignored.
+
+ The result of a request having both an If-Unmodified-Since header
+ field and either an If-None-Match or an If-Modified-Since header
+ fields is undefined by this specification.
+
+14.29 Last-Modified
+
+ The Last-Modified entity-header field indicates the date and time at
+ which the origin server believes the variant was last modified.
+
+ Last-Modified = "Last-Modified" ":" HTTP-date
+
+ An example of its use is
+
+ Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
+
+ The exact meaning of this header field depends on the implementation
+ of the origin server and the nature of the original resource. For
+ files, it may be just the file system last-modified time. For
+ entities with dynamically included parts, it may be the most recent
+ of the set of last-modify times for its component parts. For database
+ gateways, it may be the last-update time stamp of the record. For
+ virtual objects, it may be the last time the internal state changed.
+
+ An origin server MUST NOT send a Last-Modified date which is later
+ than the server's time of message origination. In such cases, where
+ the resource's last modification would indicate some time in the
+ future, the server MUST replace that date with the message
+ origination date.
+
+ An origin server SHOULD obtain the Last-Modified value of the entity
+ as close as possible to the time that it generates the Date value of
+ its response. This allows a recipient to make an accurate assessment
+ of the entity's modification time, especially if the entity changes
+ near the time that the response is generated.
+
+ HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.
+
+14.30 Location
+
+ The Location response-header field is used to redirect the recipient
+ to a location other than the Request-URI for completion of the
+ request or identification of a new resource. For 201 (Created)
+ responses, the Location is that of the new resource which was created
+ by the request. For 3xx responses, the location SHOULD indicate the
+ server's preferred URI for automatic redirection to the resource. The
+ field value consists of a single absolute URI.
+
+ Location = "Location" ":" absoluteURI
+
+ An example is:
+
+ Location: <a href="http://www.w3.org/pub/WWW/People.html">http://www.w3.org/pub/WWW/People.html</a>
+
+ Note: The Content-Location header field (section 14.14) differs
+ from Location in that the Content-Location identifies the original
+ location of the entity enclosed in the request. It is therefore
+ possible for a response to contain header fields for both Location
+ and Content-Location. Also see section 13.10 for cache
+ requirements of some methods.
+
+14.31 Max-Forwards
+
+ The Max-Forwards request-header field provides a mechanism with the
+ TRACE (section 9.8) and OPTIONS (section 9.2) methods to limit the
+ number of proxies or gateways that can forward the request to the
+ next inbound server. This can be useful when the client is attempting
+ to trace a request chain which appears to be failing or looping in
+ mid-chain.
+
+ Max-Forwards = "Max-Forwards" ":" 1*DIGIT
+
+ The Max-Forwards value is a decimal integer indicating the remaining
+ number of times this request message may be forwarded.
+
+ Each proxy or gateway recipient of a TRACE or OPTIONS request
+ containing a Max-Forwards header field MUST check and update its
+ value prior to forwarding the request. If the received value is zero
+ (0), the recipient MUST NOT forward the request; instead, it MUST
+ respond as the final recipient. If the received Max-Forwards value is
+ greater than zero, then the forwarded message MUST contain an updated
+ Max-Forwards field with a value decremented by one (1).
+
+ The Max-Forwards header field MAY be ignored for all other methods
+ defined by this specification and for any extension methods for which
+ it is not explicitly referred to as part of that method definition.
+
+14.32 Pragma
+
+ The Pragma general-header field is used to include implementation-
+ specific directives that might apply to any recipient along the
+ request/response chain. All pragma directives specify optional
+ behavior from the viewpoint of the protocol; however, some systems
+ MAY require that behavior be consistent with the directives.
+
+ Pragma = "Pragma" ":" 1#pragma-directive
+ pragma-directive = "no-cache" | extension-pragma
+ extension-pragma = token [ "=" ( token | quoted-string ) ]
+
+ When the no-cache directive is present in a request message, an
+ application SHOULD forward the request toward the origin server even
+ if it has a cached copy of what is being requested. This pragma
+ directive has the same semantics as the no-cache cache-directive (see
+ section 14.9) and is defined here for backward compatibility with
+ HTTP/1.0. Clients SHOULD include both header fields when a no-cache
+ request is sent to a server not known to be HTTP/1.1 compliant.
+
+ Pragma directives MUST be passed through by a proxy or gateway
+ application, regardless of their significance to that application,
+ since the directives might be applicable to all recipients along the
+ request/response chain. It is not possible to specify a pragma for a
+ specific recipient; however, any pragma directive not relevant to a
+ recipient SHOULD be ignored by that recipient.
+
+ HTTP/1.1 caches SHOULD treat "Pragma: no-cache" as if the client had
+ sent "Cache-Control: no-cache". No new Pragma directives will be
+ defined in HTTP.
+
+ Note: because the meaning of "Pragma: no-cache as a response
+ header field is not actually specified, it does not provide a
+ reliable replacement for "Cache-Control: no-cache" in a response
+
+14.33 Proxy-Authenticate
+
+ The Proxy-Authenticate response-header field MUST be included as part
+ of a 407 (Proxy Authentication Required) response. The field value
+ consists of a challenge that indicates the authentication scheme and
+ parameters applicable to the proxy for this Request-URI.
+
+ Proxy-Authenticate = "Proxy-Authenticate" ":" 1#challenge
+
+ The HTTP access authentication process is described in "HTTP
+ Authentication: Basic and Digest Access Authentication" [43]. Unlike
+ WWW-Authenticate, the Proxy-Authenticate header field applies only to
+ the current connection and SHOULD NOT be passed on to downstream
+ clients. However, an intermediate proxy might need to obtain its own
+ credentials by requesting them from the downstream client, which in
+ some circumstances will appear as if the proxy is forwarding the
+ Proxy-Authenticate header field.
+
+14.34 Proxy-Authorization
+
+ The Proxy-Authorization request-header field allows the client to
+ identify itself (or its user) to a proxy which requires
+ authentication. The Proxy-Authorization field value consists of
+ credentials containing the authentication information of the user
+ agent for the proxy and/or realm of the resource being requested.
+
+ Proxy-Authorization = "Proxy-Authorization" ":" credentials
+
+ The HTTP access authentication process is described in "HTTP
+ Authentication: Basic and Digest Access Authentication" [43] . Unlike
+ Authorization, the Proxy-Authorization header field applies only to
+ the next outbound proxy that demanded authentication using the Proxy-
+ Authenticate field. When multiple proxies are used in a chain, the
+
+ Proxy-Authorization header field is consumed by the first outbound
+ proxy that was expecting to receive credentials. A proxy MAY relay
+ the credentials from the client request to the next proxy if that is
+ the mechanism by which the proxies cooperatively authenticate a given
+ request.
+
+14.35 Range
+
+14.35.1 Byte Ranges
+
+ Since all HTTP entities are represented in HTTP messages as sequences
+ of bytes, the concept of a byte range is meaningful for any HTTP
+ entity. (However, not all clients and servers need to support byte-
+ range operations.)
+
+ Byte range specifications in HTTP apply to the sequence of bytes in
+ the entity-body (not necessarily the same as the message-body).
+
+ A byte range operation MAY specify a single range of bytes, or a set
+ of ranges within a single entity.
+
+ ranges-specifier = byte-ranges-specifier
+ byte-ranges-specifier = bytes-unit "=" byte-range-set
+ byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec )
+ byte-range-spec = first-byte-pos "-" [last-byte-pos]
+ first-byte-pos = 1*DIGIT
+ last-byte-pos = 1*DIGIT
+
+ The first-byte-pos value in a byte-range-spec gives the byte-offset
+ of the first byte in a range. The last-byte-pos value gives the
+ byte-offset of the last byte in the range; that is, the byte
+ positions specified are inclusive. Byte offsets start at zero.
+
+ If the last-byte-pos value is present, it MUST be greater than or
+ equal to the first-byte-pos in that byte-range-spec, or the byte-
+ range-spec is syntactically invalid. The recipient of a byte-range-
+ set that includes one or more syntactically invalid byte-range-spec
+ values MUST ignore the header field that includes that byte-range-
+ set.
+
+ If the last-byte-pos value is absent, or if the value is greater than
+ or equal to the current length of the entity-body, last-byte-pos is
+ taken to be equal to one less than the current length of the entity-
+ body in bytes.
+
+ By its choice of last-byte-pos, a client can limit the number of
+ bytes retrieved without knowing the size of the entity.
+
+ suffix-byte-range-spec = "-" suffix-length
+ suffix-length = 1*DIGIT
+
+ A suffix-byte-range-spec is used to specify the suffix of the
+ entity-body, of a length given by the suffix-length value. (That is,
+ this form specifies the last N bytes of an entity-body.) If the
+ entity is shorter than the specified suffix-length, the entire
+ entity-body is used.
+
+ If a syntactically valid byte-range-set includes at least one byte-
+ range-spec whose first-byte-pos is less than the current length of
+ the entity-body, or at least one suffix-byte-range-spec with a non-
+ zero suffix-length, then the byte-range-set is satisfiable.
+ Otherwise, the byte-range-set is unsatisfiable. If the byte-range-set
+ is unsatisfiable, the server SHOULD return a response with a status
+ of 416 (Requested range not satisfiable). Otherwise, the server
+ SHOULD return a response with a status of 206 (Partial Content)
+ containing the satisfiable ranges of the entity-body.
+
+ Examples of byte-ranges-specifier values (assuming an entity-body of
+ length 10000):
+
+ - The first 500 bytes (byte offsets 0-499, inclusive): bytes=0-
+ 499
+
+ - The second 500 bytes (byte offsets 500-999, inclusive):
+ bytes=500-999
+
+ - The final 500 bytes (byte offsets 9500-9999, inclusive):
+ bytes=-500
+
+ - Or bytes=9500-
+
+ - The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1
+
+ - Several legal but not canonical specifications of the second 500
+ bytes (byte offsets 500-999, inclusive):
+ bytes=500-600,601-999
+ bytes=500-700,601-999
+
+14.35.2 Range Retrieval Requests
+
+ HTTP retrieval requests using conditional or unconditional GET
+ methods MAY request one or more sub-ranges of the entity, instead of
+ the entire entity, using the Range request header, which applies to
+ the entity returned as the result of the request:
+
+ Range = "Range" ":" ranges-specifier
+
+ A server MAY ignore the Range header. However, HTTP/1.1 origin
+ servers and intermediate caches ought to support byte ranges when
+ possible, since Range supports efficient recovery from partially
+ failed transfers, and supports efficient partial retrieval of large
+ entities.
+
+ If the server supports the Range header and the specified range or
+ ranges are appropriate for the entity:
+
+ - The presence of a Range header in an unconditional GET modifies
+ what is returned if the GET is otherwise successful. In other
+ words, the response carries a status code of 206 (Partial
+ Content) instead of 200 (OK).
+
+ - The presence of a Range header in a conditional GET (a request
+ using one or both of If-Modified-Since and If-None-Match, or
+ one or both of If-Unmodified-Since and If-Match) modifies what
+ is returned if the GET is otherwise successful and the
+ condition is true. It does not affect the 304 (Not Modified)
+ response returned if the conditional is false.
+
+ In some cases, it might be more appropriate to use the If-Range
+ header (see section 14.27) in addition to the Range header.
+
+ If a proxy that supports ranges receives a Range request, forwards
+ the request to an inbound server, and receives an entire entity in
+ reply, it SHOULD only return the requested range to its client. It
+ SHOULD store the entire received response in its cache if that is
+ consistent with its cache allocation policies.
+
+14.36 Referer
+
+ The Referer[sic] request-header field allows the client to specify,
+ for the server's benefit, the address (URI) of the resource from
+ which the Request-URI was obtained (the "referrer", although the
+ header field is misspelled.) The Referer request-header allows a
+ server to generate lists of back-links to resources for interest,
+ logging, optimized caching, etc. It also allows obsolete or mistyped
+ links to be traced for maintenance. The Referer field MUST NOT be
+ sent if the Request-URI was obtained from a source that does not have
+ its own URI, such as input from the user keyboard.
+
+ Referer = "Referer" ":" ( absoluteURI | relativeURI )
+
+ Example:
+
+ Referer: <a href="http://www.w3.org/hypertext/DataSources/Overview.html">http://www.w3.org/hypertext/DataSources/Overview.html</a>
+
+ If the field value is a relative URI, it SHOULD be interpreted
+ relative to the Request-URI. The URI MUST NOT include a fragment. See
+ section 15.1.3 for security considerations.
+
+14.37 Retry-After
+
+ The Retry-After response-header field can be used with a 503 (Service
+ Unavailable) response to indicate how long the service is expected to
+ be unavailable to the requesting client. This field MAY also be used
+ with any 3xx (Redirection) response to indicate the minimum time the
+ user-agent is asked wait before issuing the redirected request. The
+ value of this field can be either an HTTP-date or an integer number
+ of seconds (in decimal) after the time of the response.
+
+ Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds )
+
+ Two examples of its use are
+
+ Retry-After: Fri, 31 Dec 1999 23:59:59 GMT
+ Retry-After: 120
+
+ In the latter example, the delay is 2 minutes.
+
+14.38 Server
+
+ The Server response-header field contains information about the
+ software used by the origin server to handle the request. The field
+ can contain multiple product tokens (section 3.8) and comments
+ identifying the server and any significant subproducts. The product
+ tokens are listed in order of their significance for identifying the
+ application.
+
+ Server = "Server" ":" 1*( product | comment )
+
+ Example:
+
+ Server: CERN/3.0 libwww/2.17
+
+ If the response is being forwarded through a proxy, the proxy
+ application MUST NOT modify the Server response-header. Instead, it
+ SHOULD include a Via field (as described in section 14.45).
+
+ Note: Revealing the specific software version of the server might
+ allow the server machine to become more vulnerable to attacks
+ against software that is known to contain security holes. Server
+ implementors are encouraged to make this field a configurable
+ option.
+
+14.39 TE
+
+ The TE request-header field indicates what extension transfer-codings
+ it is willing to accept in the response and whether or not it is
+ willing to accept trailer fields in a chunked transfer-coding. Its
+ value may consist of the keyword "trailers" and/or a comma-separated
+ list of extension transfer-coding names with optional accept
+ parameters (as described in section 3.6).
+
+ TE = "TE" ":" #( t-codings )
+ t-codings = "trailers" | ( transfer-extension [ accept-params ] )
+
+ The presence of the keyword "trailers" indicates that the client is
+ willing to accept trailer fields in a chunked transfer-coding, as
+ defined in section 3.6.1. This keyword is reserved for use with
+ transfer-coding values even though it does not itself represent a
+ transfer-coding.
+
+ Examples of its use are:
+
+ TE: deflate
+ TE:
+ TE: trailers, deflate;q=0.5
+
+ The TE header field only applies to the immediate connection.
+ Therefore, the keyword MUST be supplied within a Connection header
+ field (section 14.10) whenever TE is present in an HTTP/1.1 message.
+
+ A server tests whether a transfer-coding is acceptable, according to
+ a TE field, using these rules:
+
+ 1. The "chunked" transfer-coding is always acceptable. If the
+ keyword "trailers" is listed, the client indicates that it is
+ willing to accept trailer fields in the chunked response on
+ behalf of itself and any downstream clients. The implication is
+ that, if given, the client is stating that either all
+ downstream clients are willing to accept trailer fields in the
+ forwarded response, or that it will attempt to buffer the
+ response on behalf of downstream recipients.
+
+ Note: HTTP/1.1 does not define any means to limit the size of a
+ chunked response such that a client can be assured of buffering
+ the entire response.
+
+ 2. If the transfer-coding being tested is one of the transfer-
+ codings listed in the TE field, then it is acceptable unless it
+ is accompanied by a qvalue of 0. (As defined in section 3.9, a
+ qvalue of 0 means "not acceptable.")
+
+ 3. If multiple transfer-codings are acceptable, then the
+ acceptable transfer-coding with the highest non-zero qvalue is
+ preferred. The "chunked" transfer-coding always has a qvalue
+ of 1.
+
+ If the TE field-value is empty or if no TE field is present, the only
+ transfer-coding is "chunked". A message with no transfer-coding is
+ always acceptable.
+
+14.40 Trailer
+
+ The Trailer general field value indicates that the given set of
+ header fields is present in the trailer of a message encoded with
+ chunked transfer-coding.
+
+ Trailer = "Trailer" ":" 1#field-name
+
+ An HTTP/1.1 message SHOULD include a Trailer header field in a
+ message using chunked transfer-coding with a non-empty trailer. Doing
+ so allows the recipient to know which header fields to expect in the
+ trailer.
+
+ If no Trailer header field is present, the trailer SHOULD NOT include
+ any header fields. See section 3.6.1 for restrictions on the use of
+ trailer fields in a "chunked" transfer-coding.
+
+ Message header fields listed in the Trailer header field MUST NOT
+ include the following header fields:
+
+ . Transfer-Encoding
+
+ . Content-Length
+
+ . Trailer
+
+14.41 Transfer-Encoding
+
+ The Transfer-Encoding general-header field indicates what (if any)
+ type of transformation has been applied to the message body in order
+ to safely transfer it between the sender and the recipient. This
+ differs from the content-coding in that the transfer-coding is a
+ property of the message, not of the entity.
+
+ Transfer-Encoding = "Transfer-Encoding" ":" 1#transfer-coding
+
+ Transfer-codings are defined in section 3.6. An example is:
+
+ Transfer-Encoding: chunked
+
+ If multiple encodings have been applied to an entity, the transfer-
+ codings MUST be listed in the order in which they were applied.
+ Additional information about the encoding parameters MAY be provided
+ by other entity-header fields not defined by this specification.
+
+ Many older HTTP/1.0 applications do not understand the Transfer-
+ Encoding header.
+
+14.42 Upgrade
+
+ The Upgrade general-header allows the client to specify what
+ additional communication protocols it supports and would like to use
+ if the server finds it appropriate to switch protocols. The server
+ MUST use the Upgrade header field within a 101 (Switching Protocols)
+ response to indicate which protocol(s) are being switched.
+
+ Upgrade = "Upgrade" ":" 1#product
+
+ For example,
+
+ Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11
+
+ The Upgrade header field is intended to provide a simple mechanism
+ for transition from HTTP/1.1 to some other, incompatible protocol. It
+ does so by allowing the client to advertise its desire to use another
+ protocol, such as a later version of HTTP with a higher major version
+ number, even though the current request has been made using HTTP/1.1.
+ This eases the difficult transition between incompatible protocols by
+ allowing the client to initiate a request in the more commonly
+ supported protocol while indicating to the server that it would like
+ to use a "better" protocol if available (where "better" is determined
+ by the server, possibly according to the nature of the method and/or
+ resource being requested).
+
+ The Upgrade header field only applies to switching application-layer
+ protocols upon the existing transport-layer connection. Upgrade
+ cannot be used to insist on a protocol change; its acceptance and use
+ by the server is optional. The capabilities and nature of the
+ application-layer communication after the protocol change is entirely
+ dependent upon the new protocol chosen, although the first action
+ after changing the protocol MUST be a response to the initial HTTP
+ request containing the Upgrade header field.
+
+ The Upgrade header field only applies to the immediate connection.
+ Therefore, the upgrade keyword MUST be supplied within a Connection
+ header field (section 14.10) whenever Upgrade is present in an
+ HTTP/1.1 message.
+
+ The Upgrade header field cannot be used to indicate a switch to a
+ protocol on a different connection. For that purpose, it is more
+ appropriate to use a 301, 302, 303, or 305 redirection response.
+
+ This specification only defines the protocol name "HTTP" for use by
+ the family of Hypertext Transfer Protocols, as defined by the HTTP
+ version rules of section 3.1 and future updates to this
+ specification. Any token can be used as a protocol name; however, it
+ will only be useful if both the client and server associate the name
+ with the same protocol.
+
+14.43 User-Agent
+
+ The User-Agent request-header field contains information about the
+ user agent originating the request. This is for statistical purposes,
+ the tracing of protocol violations, and automated recognition of user
+ agents for the sake of tailoring responses to avoid particular user
+ agent limitations. User agents SHOULD include this field with
+ requests. The field can contain multiple product tokens (section 3.8)
+ and comments identifying the agent and any subproducts which form a
+ significant part of the user agent. By convention, the product tokens
+ are listed in order of their significance for identifying the
+ application.
+
+ User-Agent = "User-Agent" ":" 1*( product | comment )
+
+ Example:
+
+ User-Agent: CERN-LineMode/2.15 libwww/2.17b3
+
+14.44 Vary
+
+ The Vary field value indicates the set of request-header fields that
+ fully determines, while the response is fresh, whether a cache is
+ permitted to use the response to reply to a subsequent request
+ without revalidation. For uncacheable or stale responses, the Vary
+ field value advises the user agent about the criteria that were used
+ to select the representation. A Vary field value of "*" implies that
+ a cache cannot determine from the request headers of a subsequent
+ request whether this response is the appropriate representation. See
+ section 13.6 for use of the Vary header field by caches.
+
+ Vary = "Vary" ":" ( "*" | 1#field-name )
+
+ An HTTP/1.1 server SHOULD include a Vary header field with any
+ cacheable response that is subject to server-driven negotiation.
+ Doing so allows a cache to properly interpret future requests on that
+ resource and informs the user agent about the presence of negotiation
+
+ on that resource. A server MAY include a Vary header field with a
+ non-cacheable response that is subject to server-driven negotiation,
+ since this might provide the user agent with useful information about
+ the dimensions over which the response varies at the time of the
+ response.
+
+ A Vary field value consisting of a list of field-names signals that
+ the representation selected for the response is based on a selection
+ algorithm which considers ONLY the listed request-header field values
+ in selecting the most appropriate representation. A cache MAY assume
+ that the same selection will be made for future requests with the
+ same values for the listed field names, for the duration of time for
+ which the response is fresh.
+
+ The field-names given are not limited to the set of standard
+ request-header fields defined by this specification. Field names are
+ case-insensitive.
+
+ A Vary field value of "*" signals that unspecified parameters not
+ limited to the request-headers (e.g., the network address of the
+ client), play a role in the selection of the response representation.
+ The "*" value MUST NOT be generated by a proxy server; it may only be
+ generated by an origin server.
+
+14.45 Via
+
+ The Via general-header field MUST be used by gateways and proxies to
+ indicate the intermediate protocols and recipients between the user
+ agent and the server on requests, and between the origin server and
+ the client on responses. It is analogous to the "Received" field of
+ <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9] and is intended to be used for tracking message forwards,
+ avoiding request loops, and identifying the protocol capabilities of
+ all senders along the request/response chain.
+
+ Via = "Via" ":" 1#( received-protocol received-by [ comment ] )
+ received-protocol = [ protocol-name "/" ] protocol-version
+ protocol-name = token
+ protocol-version = token
+ received-by = ( host [ ":" port ] ) | pseudonym
+ pseudonym = token
+
+ The received-protocol indicates the protocol version of the message
+ received by the server or client along each segment of the
+ request/response chain. The received-protocol version is appended to
+ the Via field value when the message is forwarded so that information
+ about the protocol capabilities of upstream applications remains
+ visible to all recipients.
+
+ The protocol-name is optional if and only if it would be "HTTP". The
+ received-by field is normally the host and optional port number of a
+ recipient server or client that subsequently forwarded the message.
+ However, if the real host is considered to be sensitive information,
+ it MAY be replaced by a pseudonym. If the port is not given, it MAY
+ be assumed to be the default port of the received-protocol.
+
+ Multiple Via field values represents each proxy or gateway that has
+ forwarded the message. Each recipient MUST append its information
+ such that the end result is ordered according to the sequence of
+ forwarding applications.
+
+ Comments MAY be used in the Via header field to identify the software
+ of the recipient proxy or gateway, analogous to the User-Agent and
+ Server header fields. However, all comments in the Via field are
+ optional and MAY be removed by any recipient prior to forwarding the
+ message.
+
+ For example, a request message could be sent from an HTTP/1.0 user
+ agent to an internal proxy code-named "fred", which uses HTTP/1.1 to
+ forward the request to a public proxy at nowhere.com, which completes
+ the request by forwarding it to the origin server at www.ics.uci.edu.
+ The request received by www.ics.uci.edu would then have the following
+ Via header field:
+
+ Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1)
+
+ Proxies and gateways used as a portal through a network firewall
+ SHOULD NOT, by default, forward the names and ports of hosts within
+ the firewall region. This information SHOULD only be propagated if
+ explicitly enabled. If not enabled, the received-by host of any host
+ behind the firewall SHOULD be replaced by an appropriate pseudonym
+ for that host.
+
+ For organizations that have strong privacy requirements for hiding
+ internal structures, a proxy MAY combine an ordered subsequence of
+ Via header field entries with identical received-protocol values into
+ a single such entry. For example,
+
+ Via: 1.0 ricky, 1.1 ethel, 1.1 fred, 1.0 lucy
+
+ could be collapsed to
+
+ Via: 1.0 ricky, 1.1 mertz, 1.0 lucy
+
+ Applications SHOULD NOT combine multiple entries unless they are all
+ under the same organizational control and the hosts have already been
+ replaced by pseudonyms. Applications MUST NOT combine entries which
+ have different received-protocol values.
+
+14.46 Warning
+
+ The Warning general-header field is used to carry additional
+ information about the status or transformation of a message which
+ might not be reflected in the message. This information is typically
+ used to warn about a possible lack of semantic transparency from
+ caching operations or transformations applied to the entity body of
+ the message.
+
+ Warning headers are sent with responses using:
+
+ Warning = "Warning" ":" 1#warning-value
+
+ warning-value = warn-code SP warn-agent SP warn-text
+ [SP warn-date]
+
+ warn-code = 3DIGIT
+ warn-agent = ( host [ ":" port ] ) | pseudonym
+ ; the name or pseudonym of the server adding
+ ; the Warning header, for use in debugging
+ warn-text = quoted-string
+ warn-date = &lt;"&gt; HTTP-date &lt;"&gt;
+
+ A response MAY carry more than one Warning header.
+
+ The warn-text SHOULD be in a natural language and character set that
+ is most likely to be intelligible to the human user receiving the
+ response. This decision MAY be based on any available knowledge, such
+ as the location of the cache or user, the Accept-Language field in a
+ request, the Content-Language field in a response, etc. The default
+ language is English and the default character set is ISO-8859-1.
+
+ If a character set other than ISO-8859-1 is used, it MUST be encoded
+ in the warn-text using the method described in <a href="http://firefly.troll.no/rfcs/rfc2047.html">RFC 2047</a> [14].
+
+ Warning headers can in general be applied to any message, however
+ some specific warn-codes are specific to caches and can only be
+ applied to response messages. New Warning headers SHOULD be added
+ after any existing Warning headers. A cache MUST NOT delete any
+ Warning header that it received with a message. However, if a cache
+ successfully validates a cache entry, it SHOULD remove any Warning
+ headers previously attached to that entry except as specified for
+
+ specific Warning codes. It MUST then add any Warning headers received
+ in the validating response. In other words, Warning headers are those
+ that would be attached to the most recent relevant response.
+
+ When multiple Warning headers are attached to a response, the user
+ agent ought to inform the user of as many of them as possible, in the
+ order that they appear in the response. If it is not possible to
+ inform the user of all of the warnings, the user agent SHOULD follow
+ these heuristics:
+
+ - Warnings that appear early in the response take priority over
+ those appearing later in the response.
+
+ - Warnings in the user's preferred character set take priority
+ over warnings in other character sets but with identical warn-
+ codes and warn-agents.
+
+ Systems that generate multiple Warning headers SHOULD order them with
+ this user agent behavior in mind.
+
+ Requirements for the behavior of caches with respect to Warnings are
+ stated in section 13.1.2.
+
+ This is a list of the currently-defined warn-codes, each with a
+ recommended warn-text in English, and a description of its meaning.
+
+ 110 Response is stale
+ MUST be included whenever the returned response is stale.
+
+ 111 Revalidation failed
+ MUST be included if a cache returns a stale response because an
+ attempt to revalidate the response failed, due to an inability to
+ reach the server.
+
+ 112 Disconnected operation
+ SHOULD be included if the cache is intentionally disconnected from
+ the rest of the network for a period of time.
+
+ 113 Heuristic expiration
+ MUST be included if the cache heuristically chose a freshness
+ lifetime greater than 24 hours and the response's age is greater
+ than 24 hours.
+
+ 199 Miscellaneous warning
+ The warning text MAY include arbitrary information to be presented
+ to a human user, or logged. A system receiving this warning MUST
+ NOT take any automated action, besides presenting the warning to
+ the user.
+
+ 214 Transformation applied
+ MUST be added by an intermediate cache or proxy if it applies any
+ transformation changing the content-coding (as specified in the
+ Content-Encoding header) or media-type (as specified in the
+ Content-Type header) of the response, or the entity-body of the
+ response, unless this Warning code already appears in the response.
+
+ 299 Miscellaneous persistent warning
+ The warning text MAY include arbitrary information to be presented
+ to a human user, or logged. A system receiving this warning MUST
+ NOT take any automated action.
+
+ If an implementation sends a message with one or more Warning headers
+ whose version is HTTP/1.0 or lower, then the sender MUST include in
+ each warning-value a warn-date that matches the date in the response.
+
+ If an implementation receives a message with a warning-value that
+ includes a warn-date, and that warn-date is different from the Date
+ value in the response, then that warning-value MUST be deleted from
+ the message before storing, forwarding, or using it. (This prevents
+ bad consequences of naive caching of Warning header fields.) If all
+ of the warning-values are deleted for this reason, the Warning header
+ MUST be deleted as well.
+
+14.47 WWW-Authenticate
+
+ The WWW-Authenticate response-header field MUST be included in 401
+ (Unauthorized) response messages. The field value consists of at
+ least one challenge that indicates the authentication scheme(s) and
+ parameters applicable to the Request-URI.
+
+ WWW-Authenticate = "WWW-Authenticate" ":" 1#challenge
+
+ The HTTP access authentication process is described in "HTTP
+ Authentication: Basic and Digest Access Authentication" [43]. User
+ agents are advised to take special care in parsing the WWW-
+ Authenticate field value as it might contain more than one challenge,
+ or if more than one WWW-Authenticate header field is provided, the
+ contents of a challenge itself can contain a comma-separated list of
+ authentication parameters.
+
+15 Security Considerations
+
+ This section is meant to inform application developers, information
+ providers, and users of the security limitations in HTTP/1.1 as
+ described by this document. The discussion does not include
+ definitive solutions to the problems revealed, though it does make
+ some suggestions for reducing security risks.
+
+15.1 Personal Information
+
+ HTTP clients are often privy to large amounts of personal information
+ (e.g. the user's name, location, mail address, passwords, encryption
+ keys, etc.), and SHOULD be very careful to prevent unintentional
+ leakage of this information via the HTTP protocol to other sources.
+ We very strongly recommend that a convenient interface be provided
+ for the user to control dissemination of such information, and that
+ designers and implementors be particularly careful in this area.
+ History shows that errors in this area often create serious security
+ and/or privacy problems and generate highly adverse publicity for the
+ implementor's company.
+
+15.1.1 Abuse of Server Log Information
+
+ A server is in the position to save personal data about a user's
+ requests which might identify their reading patterns or subjects of
+ interest. This information is clearly confidential in nature and its
+ handling can be constrained by law in certain countries. People using
+ the HTTP protocol to provide data are responsible for ensuring that
+ such material is not distributed without the permission of any
+ individuals that are identifiable by the published results.
+
+15.1.2 Transfer of Sensitive Information
+
+ Like any generic data transfer protocol, HTTP cannot regulate the
+ content of the data that is transferred, nor is there any a priori
+ method of determining the sensitivity of any particular piece of
+ information within the context of any given request. Therefore,
+ applications SHOULD supply as much control over this information as
+ possible to the provider of that information. Four header fields are
+ worth special mention in this context: Server, Via, Referer and From.
+
+ Revealing the specific software version of the server might allow the
+ server machine to become more vulnerable to attacks against software
+ that is known to contain security holes. Implementors SHOULD make the
+ Server header field a configurable option.
+
+ Proxies which serve as a portal through a network firewall SHOULD
+ take special precautions regarding the transfer of header information
+ that identifies the hosts behind the firewall. In particular, they
+ SHOULD remove, or replace with sanitized versions, any Via fields
+ generated behind the firewall.
+
+ The Referer header allows reading patterns to be studied and reverse
+ links drawn. Although it can be very useful, its power can be abused
+ if user details are not separated from the information contained in
+
+ the Referer. Even when the personal information has been removed, the
+ Referer header might indicate a private document's URI whose
+ publication would be inappropriate.
+
+ The information sent in the From field might conflict with the user's
+ privacy interests or their site's security policy, and hence it
+ SHOULD NOT be transmitted without the user being able to disable,
+ enable, and modify the contents of the field. The user MUST be able
+ to set the contents of this field within a user preference or
+ application defaults configuration.
+
+ We suggest, though do not require, that a convenient toggle interface
+ be provided for the user to enable or disable the sending of From and
+ Referer information.
+
+ The User-Agent (section 14.43) or Server (section 14.38) header
+ fields can sometimes be used to determine that a specific client or
+ server have a particular security hole which might be exploited.
+ Unfortunately, this same information is often used for other valuable
+ purposes for which HTTP currently has no better mechanism.
+
+15.1.3 Encoding Sensitive Information in URI's
+
+ Because the source of a link might be private information or might
+ reveal an otherwise private information source, it is strongly
+ recommended that the user be able to select whether or not the
+ Referer field is sent. For example, a browser client could have a
+ toggle switch for browsing openly/anonymously, which would
+ respectively enable/disable the sending of Referer and From
+ information.
+
+ Clients SHOULD NOT include a Referer header field in a (non-secure)
+ HTTP request if the referring page was transferred with a secure
+ protocol.
+
+ Authors of services which use the HTTP protocol SHOULD NOT use GET
+ based forms for the submission of sensitive data, because this will
+ cause this data to be encoded in the Request-URI. Many existing
+ servers, proxies, and user agents will log the request URI in some
+ place where it might be visible to third parties. Servers can use
+ POST-based form submission instead
+
+15.1.4 Privacy Issues Connected to Accept Headers
+
+ Accept request-headers can reveal information about the user to all
+ servers which are accessed. The Accept-Language header in particular
+ can reveal information the user would consider to be of a private
+ nature, because the understanding of particular languages is often
+
+ strongly correlated to the membership of a particular ethnic group.
+ User agents which offer the option to configure the contents of an
+ Accept-Language header to be sent in every request are strongly
+ encouraged to let the configuration process include a message which
+ makes the user aware of the loss of privacy involved.
+
+ An approach that limits the loss of privacy would be for a user agent
+ to omit the sending of Accept-Language headers by default, and to ask
+ the user whether or not to start sending Accept-Language headers to a
+ server if it detects, by looking for any Vary response-header fields
+ generated by the server, that such sending could improve the quality
+ of service.
+
+ Elaborate user-customized accept header fields sent in every request,
+ in particular if these include quality values, can be used by servers
+ as relatively reliable and long-lived user identifiers. Such user
+ identifiers would allow content providers to do click-trail tracking,
+ and would allow collaborating content providers to match cross-server
+ click-trails or form submissions of individual users. Note that for
+ many users not behind a proxy, the network address of the host
+ running the user agent will also serve as a long-lived user
+ identifier. In environments where proxies are used to enhance
+ privacy, user agents ought to be conservative in offering accept
+ header configuration options to end users. As an extreme privacy
+ measure, proxies could filter the accept headers in relayed requests.
+ General purpose user agents which provide a high degree of header
+ configurability SHOULD warn users about the loss of privacy which can
+ be involved.
+
+15.2 Attacks Based On File and Path Names
+
+ Implementations of HTTP origin servers SHOULD be careful to restrict
+ the documents returned by HTTP requests to be only those that were
+ intended by the server administrators. If an HTTP server translates
+ HTTP URIs directly into file system calls, the server MUST take
+ special care not to serve files that were not intended to be
+ delivered to HTTP clients. For example, UNIX, Microsoft Windows, and
+ other operating systems use ".." as a path component to indicate a
+ directory level above the current one. On such a system, an HTTP
+ server MUST disallow any such construct in the Request-URI if it
+ would otherwise allow access to a resource outside those intended to
+ be accessible via the HTTP server. Similarly, files intended for
+ reference only internally to the server (such as access control
+ files, configuration files, and script code) MUST be protected from
+ inappropriate retrieval, since they might contain sensitive
+ information. Experience has shown that minor bugs in such HTTP server
+ implementations have turned into security risks.
+
+15.3 DNS Spoofing
+
+ Clients using HTTP rely heavily on the Domain Name Service, and are
+ thus generally prone to security attacks based on the deliberate
+ mis-association of IP addresses and DNS names. Clients need to be
+ cautious in assuming the continuing validity of an IP number/DNS name
+ association.
+
+ In particular, HTTP clients SHOULD rely on their name resolver for
+ confirmation of an IP number/DNS name association, rather than
+ caching the result of previous host name lookups. Many platforms
+ already can cache host name lookups locally when appropriate, and
+ they SHOULD be configured to do so. It is proper for these lookups to
+ be cached, however, only when the TTL (Time To Live) information
+ reported by the name server makes it likely that the cached
+ information will remain useful.
+
+ If HTTP clients cache the results of host name lookups in order to
+ achieve a performance improvement, they MUST observe the TTL
+ information reported by DNS.
+
+ If HTTP clients do not observe this rule, they could be spoofed when
+ a previously-accessed server's IP address changes. As network
+ renumbering is expected to become increasingly common [24], the
+ possibility of this form of attack will grow. Observing this
+ requirement thus reduces this potential security vulnerability.
+
+ This requirement also improves the load-balancing behavior of clients
+ for replicated servers using the same DNS name and reduces the
+ likelihood of a user's experiencing failure in accessing sites which
+ use that strategy.
+
+15.4 Location Headers and Spoofing
+
+ If a single server supports multiple organizations that do not trust
+ one another, then it MUST check the values of Location and Content-
+ Location headers in responses that are generated under control of
+ said organizations to make sure that they do not attempt to
+ invalidate resources over which they have no authority.
+
+15.5 Content-Disposition Issues
+
+ <a href="http://firefly.troll.no/rfcs/rfc1806.html">RFC 1806</a> [35], from which the often implemented Content-Disposition
+ (see section 19.5.1) header in HTTP is derived, has a number of very
+ serious security considerations. Content-Disposition is not part of
+ the HTTP standard, but since it is widely implemented, we are
+ documenting its use and risks for implementors. See <a href="http://firefly.troll.no/rfcs/rfc2183.html">RFC 2183</a> [49]
+ (which updates <a href="http://firefly.troll.no/rfcs/rfc1806.html">RFC 1806</a>) for details.
+
+15.6 Authentication Credentials and Idle Clients
+
+ Existing HTTP clients and user agents typically retain authentication
+ information indefinitely. HTTP/1.1. does not provide a method for a
+ server to direct clients to discard these cached credentials. This is
+ a significant defect that requires further extensions to HTTP.
+ Circumstances under which credential caching can interfere with the
+ application's security model include but are not limited to:
+
+ - Clients which have been idle for an extended period following
+ which the server might wish to cause the client to reprompt the
+ user for credentials.
+
+ - Applications which include a session termination indication
+ (such as a `logout' or `commit' button on a page) after which
+ the server side of the application `knows' that there is no
+ further reason for the client to retain the credentials.
+
+ This is currently under separate study. There are a number of work-
+ arounds to parts of this problem, and we encourage the use of
+ password protection in screen savers, idle time-outs, and other
+ methods which mitigate the security problems inherent in this
+ problem. In particular, user agents which cache credentials are
+ encouraged to provide a readily accessible mechanism for discarding
+ cached credentials under user control.
+
+15.7 Proxies and Caching
+
+ By their very nature, HTTP proxies are men-in-the-middle, and
+ represent an opportunity for man-in-the-middle attacks. Compromise of
+ the systems on which the proxies run can result in serious security
+ and privacy problems. Proxies have access to security-related
+ information, personal information about individual users and
+ organizations, and proprietary information belonging to users and
+ content providers. A compromised proxy, or a proxy implemented or
+ configured without regard to security and privacy considerations,
+ might be used in the commission of a wide range of potential attacks.
+
+ Proxy operators should protect the systems on which proxies run as
+ they would protect any system that contains or transports sensitive
+ information. In particular, log information gathered at proxies often
+ contains highly sensitive personal information, and/or information
+ about organizations. Log information should be carefully guarded, and
+ appropriate guidelines for use developed and followed. (Section
+ 15.1.1).
+
+ Caching proxies provide additional potential vulnerabilities, since
+ the contents of the cache represent an attractive target for
+ malicious exploitation. Because cache contents persist after an HTTP
+ request is complete, an attack on the cache can reveal information
+ long after a user believes that the information has been removed from
+ the network. Therefore, cache contents should be protected as
+ sensitive information.
+
+ Proxy implementors should consider the privacy and security
+ implications of their design and coding decisions, and of the
+ configuration options they provide to proxy operators (especially the
+ default configuration).
+
+ Users of a proxy need to be aware that they are no trustworthier than
+ the people who run the proxy; HTTP itself cannot solve this problem.
+
+ The judicious use of cryptography, when appropriate, may suffice to
+ protect against a broad range of security and privacy attacks. Such
+ cryptography is beyond the scope of the HTTP/1.1 specification.
+
+15.7.1 Denial of Service Attacks on Proxies
+
+ They exist. They are hard to defend against. Research continues.
+ Beware.
+
+16 Acknowledgments
+
+ This specification makes heavy use of the augmented BNF and generic
+ constructs defined by David H. Crocker for <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a> [9]. Similarly, it
+ reuses many of the definitions provided by Nathaniel Borenstein and
+ Ned Freed for MIME [7]. We hope that their inclusion in this
+ specification will help reduce past confusion over the relationship
+ between HTTP and Internet mail message formats.
+
+ The HTTP protocol has evolved considerably over the years. It has
+ benefited from a large and active developer community--the many
+ people who have participated on the www-talk mailing list--and it is
+ that community which has been most responsible for the success of
+ HTTP and of the World-Wide Web in general. Marc Andreessen, Robert
+ Cailliau, Daniel W. Connolly, Bob Denny, John Franks, Jean-Francois
+ Groff, Phillip M. Hallam-Baker, Hakon W. Lie, Ari Luotonen, Rob
+ McCool, Lou Montulli, Dave Raggett, Tony Sanders, and Marc
+ VanHeyningen deserve special recognition for their efforts in
+ defining early aspects of the protocol.
+
+ This document has benefited greatly from the comments of all those
+ participating in the HTTP-WG. In addition to those already mentioned,
+ the following individuals have contributed to this specification:
+
+ Gary Adams Ross Patterson
+ Harald Tveit Alvestrand Albert Lunde
+ Keith Ball John C. Mallery
+ Brian Behlendorf Jean-Philippe Martin-Flatin
+ Paul Burchard Mitra
+ Maurizio Codogno David Morris
+ Mike Cowlishaw Gavin Nicol
+ Roman Czyborra Bill Perry
+ Michael A. Dolan Jeffrey Perry
+ David J. Fiander Scott Powers
+ Alan Freier Owen Rees
+ Marc Hedlund Luigi Rizzo
+ Greg Herlihy David Robinson
+ Koen Holtman Marc Salomon
+ Alex Hopmann Rich Salz
+ Bob Jernigan Allan M. Schiffman
+ Shel Kaphan Jim Seidman
+ Rohit Khare Chuck Shotton
+ John Klensin Eric W. Sink
+ Martijn Koster Simon E. Spero
+ Alexei Kosut Richard N. Taylor
+ David M. Kristol Robert S. Thau
+ Daniel LaLiberte Bill (BearHeart) Weinman
+ Ben Laurie Francois Yergeau
+ Paul J. Leach Mary Ellen Zurko
+ Daniel DuBois Josh Cohen
+
+ Much of the content and presentation of the caching design is due to
+ suggestions and comments from individuals including: Shel Kaphan,
+ Paul Leach, Koen Holtman, David Morris, and Larry Masinter.
+
+ Most of the specification of ranges is based on work originally done
+ by Ari Luotonen and John Franks, with additional input from Steve
+ Zilles.
+
+ Thanks to the "cave men" of Palo Alto. You know who you are.
+
+ Jim Gettys (the current editor of this document) wishes particularly
+ to thank Roy Fielding, the previous editor of this document, along
+ with John Klensin, Jeff Mogul, Paul Leach, Dave Kristol, Koen
+ Holtman, John Franks, Josh Cohen, Alex Hopmann, Scott Lawrence, and
+ Larry Masinter for their help. And thanks go particularly to Jeff
+ Mogul and Scott Lawrence for performing the "MUST/MAY/SHOULD" audit.
+
+ The Apache Group, Anselm Baird-Smith, author of Jigsaw, and Henrik
+ Frystyk implemented <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> early, and we wish to thank them for the
+ discovery of many of the problems that this document attempts to
+ rectify.
+
+17 References
+
+ [1] Alvestrand, H., "Tags for the Identification of Languages", RFC
+ 1766, March 1995.
+
+ [2] Anklesaria, F., McCahill, M., Lindner, P., Johnson, D., Torrey,
+ D. and B. Alberti, "The Internet Gopher Protocol (a distributed
+ document search and retrieval protocol)", <a href="http://firefly.troll.no/rfcs/rfc1436.html">RFC 1436</a>, March 1993.
+
+ [3] Berners-Lee, T., "Universal Resource Identifiers in WWW", RFC
+ 1630, June 1994.
+
+ [4] Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform Resource
+ Locators (URL)", <a href="http://firefly.troll.no/rfcs/rfc1738.html">RFC 1738</a>, December 1994.
+
+ [5] Berners-Lee, T. and D. Connolly, "Hypertext Markup Language -
+ 2.0", <a href="http://firefly.troll.no/rfcs/rfc1866.html">RFC 1866</a>, November 1995.
+
+ [6] Berners-Lee, T., Fielding, R. and H. Frystyk, "Hypertext Transfer
+ Protocol -- HTTP/1.0", <a href="http://firefly.troll.no/rfcs/rfc1945.html">RFC 1945</a>, May 1996.
+
+ [7] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
+ Extensions (MIME) Part One: Format of Internet Message Bodies",
+ <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a>, November 1996.
+
+ [8] Braden, R., "Requirements for Internet Hosts -- Communication
+ Layers", STD 3, <a href="http://firefly.troll.no/rfcs/rfc1123.html">RFC 1123</a>, October 1989.
+
+ [9] Crocker, D., "Standard for The Format of ARPA Internet Text
+ Messages", STD 11, <a href="http://firefly.troll.no/rfcs/rfc822.html">RFC 822</a>, August 1982.
+
+ [10] Davis, F., Kahle, B., Morris, H., Salem, J., Shen, T., Wang, R.,
+ Sui, J., and M. Grinbaum, "WAIS Interface Protocol Prototype
+ Functional Specification," (v1.5), Thinking Machines
+ Corporation, April 1990.
+
+ [11] Fielding, R., "Relative Uniform Resource Locators", <a href="http://firefly.troll.no/rfcs/rfc1808.html">RFC 1808</a>,
+ June 1995.
+
+ [12] Horton, M. and R. Adams, "Standard for Interchange of USENET
+ Messages", <a href="http://firefly.troll.no/rfcs/rfc1036.html">RFC 1036</a>, December 1987.
+
+ [13] Kantor, B. and P. Lapsley, "Network News Transfer Protocol", RFC
+ 977, February 1986.
+
+ [14] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part
+ Three: Message Header Extensions for Non-ASCII Text", <a href="http://firefly.troll.no/rfcs/rfc2047.html">RFC 2047</a>,
+ November 1996.
+
+ [15] Nebel, E. and L. Masinter, "Form-based File Upload in HTML", RFC
+ 1867, November 1995.
+
+ [16] Postel, J., "Simple Mail Transfer Protocol", STD 10, <a href="http://firefly.troll.no/rfcs/rfc821.html">RFC 821</a>,
+ August 1982.
+
+ [17] Postel, J., "Media Type Registration Procedure", <a href="http://firefly.troll.no/rfcs/rfc1590.html">RFC 1590</a>,
+ November 1996.
+
+ [18] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9, RFC
+ 959, October 1985.
+
+ [19] Reynolds, J. and J. Postel, "Assigned Numbers", STD 2, <a href="http://firefly.troll.no/rfcs/rfc1700.html">RFC 1700</a>,
+ October 1994.
+
+ [20] Sollins, K. and L. Masinter, "Functional Requirements for
+ Uniform Resource Names", <a href="http://firefly.troll.no/rfcs/rfc1737.html">RFC 1737</a>, December 1994.
+
+ [21] US-ASCII. Coded Character Set - 7-Bit American Standard Code for
+ Information Interchange. Standard ANSI X3.4-1986, ANSI, 1986.
+
+ [22] ISO-8859. International Standard -- Information Processing --
+ 8-bit Single-Byte Coded Graphic Character Sets --
+ Part 1: Latin alphabet No. 1, ISO-8859-1:1987.
+ Part 2: Latin alphabet No. 2, ISO-8859-2, 1987.
+ Part 3: Latin alphabet No. 3, ISO-8859-3, 1988.
+ Part 4: Latin alphabet No. 4, ISO-8859-4, 1988.
+ Part 5: Latin/Cyrillic alphabet, ISO-8859-5, 1988.
+ Part 6: Latin/Arabic alphabet, ISO-8859-6, 1987.
+ Part 7: Latin/Greek alphabet, ISO-8859-7, 1987.
+ Part 8: Latin/Hebrew alphabet, ISO-8859-8, 1988.
+ Part 9: Latin alphabet No. 5, ISO-8859-9, 1990.
+
+ [23] Meyers, J. and M. Rose, "The Content-MD5 Header Field", RFC
+ 1864, October 1995.
+
+ [24] Carpenter, B. and Y. Rekhter, "Renumbering Needs Work", RFC
+ 1900, February 1996.
+
+ [25] Deutsch, P., "GZIP file format specification version 4.3", RFC
+ 1952, May 1996.
+
+ [26] Venkata N. Padmanabhan, and Jeffrey C. Mogul. "Improving HTTP
+ Latency", Computer Networks and ISDN Systems, v. 28, pp. 25-35,
+ Dec. 1995. Slightly revised version of paper in Proc. 2nd
+ International WWW Conference '94: Mosaic and the Web, Oct. 1994,
+ which is available at
+ <a href="http://www.ncsa.uiuc.edu/SDG/IT94/Proceedings/DDay/mogul/HTTPLat">http://www.ncsa.uiuc.edu/SDG/IT94/Proceedings/DDay/mogul/HTTPLat</a>
+ ency.html.
+
+ [27] Joe Touch, John Heidemann, and Katia Obraczka. "Analysis of HTTP
+ Performance", &lt;URL: <a href="http://www.isi.edu/touch/pubs/http-perf96/">http://www.isi.edu/touch/pubs/http-perf96/</a>&gt;,
+ ISI Research Report ISI/RR-98-463, (original report dated Aug.
+ 1996), USC/Information Sciences Institute, August 1998.
+
+ [28] Mills, D., "Network Time Protocol (Version 3) Specification,
+ Implementation and Analysis", <a href="http://firefly.troll.no/rfcs/rfc1305.html">RFC 1305</a>, March 1992.
+
+ [29] Deutsch, P., "DEFLATE Compressed Data Format Specification
+ version 1.3", <a href="http://firefly.troll.no/rfcs/rfc1951.html">RFC 1951</a>, May 1996.
+
+ [30] S. Spero, "Analysis of HTTP Performance Problems,"
+ <a href="http://sunsite.unc.edu/mdma-release/http-prob.html">http://sunsite.unc.edu/mdma-release/http-prob.html</a>.
+
+ [31] Deutsch, P. and J. Gailly, "ZLIB Compressed Data Format
+ Specification version 3.3", <a href="http://firefly.troll.no/rfcs/rfc1950.html">RFC 1950</a>, May 1996.
+
+ [32] Franks, J., Hallam-Baker, P., Hostetler, J., Leach, P.,
+ Luotonen, A., Sink, E. and L. Stewart, "An Extension to HTTP:
+ Digest Access Authentication", <a href="http://firefly.troll.no/rfcs/rfc2069.html">RFC 2069</a>, January 1997.
+
+ [33] Fielding, R., Gettys, J., Mogul, J., Frystyk, H. and T.
+ Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC
+ 2068, January 1997.
+
+ [34] Bradner, S., "Key words for use in RFCs to Indicate Requirement
+ Levels", BCP 14, <a href="http://firefly.troll.no/rfcs/rfc2119.html">RFC 2119</a>, March 1997.
+
+ [35] Troost, R. and Dorner, S., "Communicating Presentation
+ Information in Internet Messages: The Content-Disposition
+ Header", <a href="http://firefly.troll.no/rfcs/rfc1806.html">RFC 1806</a>, June 1995.
+
+ [36] Mogul, J., Fielding, R., Gettys, J. and H. Frystyk, "Use and
+ Interpretation of HTTP Version Numbers", <a href="http://firefly.troll.no/rfcs/rfc2145.html">RFC 2145</a>, May 1997.
+ [jg639]
+
+ [37] Palme, J., "Common Internet Message Headers", <a href="http://firefly.troll.no/rfcs/rfc2076.html">RFC 2076</a>, February
+ 1997. [jg640]
+
+ [38] Yergeau, F., "UTF-8, a transformation format of Unicode and
+ ISO-10646", <a href="http://firefly.troll.no/rfcs/rfc2279.html">RFC 2279</a>, January 1998. [jg641]
+
+ [39] Nielsen, H.F., Gettys, J., Baird-Smith, A., Prud'hommeaux, E.,
+ Lie, H., and C. Lilley. "Network Performance Effects of
+ HTTP/1.1, CSS1, and PNG," Proceedings of ACM SIGCOMM '97, Cannes
+ France, September 1997.[jg642]
+
+ [40] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
+ Extensions (MIME) Part Two: Media Types", <a href="http://firefly.troll.no/rfcs/rfc2046.html">RFC 2046</a>, November
+ 1996. [jg643]
+
+ [41] Alvestrand, H., "IETF Policy on Character Sets and Languages",
+ BCP 18, <a href="http://firefly.troll.no/rfcs/rfc2277.html">RFC 2277</a>, January 1998. [jg644]
+
+ [42] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource
+ Identifiers (URI): Generic Syntax and Semantics", <a href="http://firefly.troll.no/rfcs/rfc2396.html">RFC 2396</a>,
+ August 1998. [jg645]
+
+ [43] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S.,
+ Leach, P., Luotonen, A., Sink, E. and L. Stewart, "HTTP
+ Authentication: Basic and Digest Access Authentication", RFC
+ 2617, June 1999. [jg646]
+
+ [44] Luotonen, A., "Tunneling TCP based protocols through Web proxy
+ servers," Work in Progress. [jg647]
+
+ [45] Palme, J. and A. Hopmann, "MIME E-mail Encapsulation of
+ Aggregate Documents, such as HTML (MHTML)", <a href="http://firefly.troll.no/rfcs/rfc2110.html">RFC 2110</a>, March
+ 1997.
+
+ [46] Bradner, S., "The Internet Standards Process -- Revision 3", BCP
+ 9, <a href="http://firefly.troll.no/rfcs/rfc2026.html">RFC 2026</a>, October 1996.
+
+ [47] Masinter, L., "Hyper Text Coffee Pot Control Protocol
+ (HTCPCP/1.0)", <a href="http://firefly.troll.no/rfcs/rfc2324.html">RFC 2324</a>, 1 April 1998.
+
+ [48] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
+ Extensions (MIME) Part Five: Conformance Criteria and Examples",
+ <a href="http://firefly.troll.no/rfcs/rfc2049.html">RFC 2049</a>, November 1996.
+
+ [49] Troost, R., Dorner, S. and K. Moore, "Communicating Presentation
+ Information in Internet Messages: The Content-Disposition Header
+ Field", <a href="http://firefly.troll.no/rfcs/rfc2183.html">RFC 2183</a>, August 1997.
+
+18 Authors' Addresses
+
+ Roy T. Fielding
+ Information and Computer Science
+ University of California, Irvine
+ Irvine, CA 92697-3425, USA
+
+ Fax: +1 (949) 824-1715
+ EMail: <a href="mailto:fielding@ics.uci.edu">fielding@ics.uci.edu</a>
+
+ James Gettys
+ World Wide Web Consortium
+ MIT Laboratory for Computer Science
+ 545 Technology Square
+ Cambridge, MA 02139, USA
+
+ Fax: +1 (617) 258 8682
+ EMail: <a href="mailto:jg@w3.org">jg@w3.org</a>
+
+ Jeffrey C. Mogul
+ Western Research Laboratory
+ Compaq Computer Corporation
+ 250 University Avenue
+ Palo Alto, California, 94305, USA
+
+ EMail: <a href="mailto:mogul@wrl.dec.com">mogul@wrl.dec.com</a>
+
+ Henrik Frystyk Nielsen
+ World Wide Web Consortium
+ MIT Laboratory for Computer Science
+ 545 Technology Square
+ Cambridge, MA 02139, USA
+
+ Fax: +1 (617) 258 8682
+ EMail: <a href="mailto:frystyk@w3.org">frystyk@w3.org</a>
+
+ Larry Masinter
+ Xerox Corporation
+ 3333 Coyote Hill Road
+ Palo Alto, CA 94034, USA
+
+ EMail: <a href="mailto:masinter@parc.xerox.com">masinter@parc.xerox.com</a>
+
+ Paul J. Leach
+ Microsoft Corporation
+ 1 Microsoft Way
+ Redmond, WA 98052, USA
+
+ EMail: <a href="mailto:paulle@microsoft.com">paulle@microsoft.com</a>
+
+ Tim Berners-Lee
+ Director, World Wide Web Consortium
+ MIT Laboratory for Computer Science
+ 545 Technology Square
+ Cambridge, MA 02139, USA
+
+ Fax: +1 (617) 258 8682
+ EMail: <a href="mailto:timbl@w3.org">timbl@w3.org</a>
+
+19 Appendices
+
+19.1 Internet Media Type message/http and application/http
+
+ In addition to defining the HTTP/1.1 protocol, this document serves
+ as the specification for the Internet media type "message/http" and
+ "application/http". The message/http type can be used to enclose a
+ single HTTP request or response message, provided that it obeys the
+ MIME restrictions for all "message" types regarding line length and
+ encodings. The application/http type can be used to enclose a
+ pipeline of one or more HTTP request or response messages (not
+ intermixed). The following is to be registered with IANA [17].
+
+ Media Type name: message
+ Media subtype name: http
+ Required parameters: none
+ Optional parameters: version, msgtype
+ version: The HTTP-Version number of the enclosed message
+ (e.g., "1.1"). If not present, the version can be
+ determined from the first line of the body.
+ msgtype: The message type -- "request" or "response". If not
+ present, the type can be determined from the first
+ line of the body.
+ Encoding considerations: only "7bit", "8bit", or "binary" are
+ permitted
+ Security considerations: none
+
+ Media Type name: application
+ Media subtype name: http
+ Required parameters: none
+ Optional parameters: version, msgtype
+ version: The HTTP-Version number of the enclosed messages
+ (e.g., "1.1"). If not present, the version can be
+ determined from the first line of the body.
+ msgtype: The message type -- "request" or "response". If not
+ present, the type can be determined from the first
+ line of the body.
+ Encoding considerations: HTTP messages enclosed by this type
+ are in "binary" format; use of an appropriate
+ Content-Transfer-Encoding is required when
+ transmitted via E-mail.
+ Security considerations: none
+
+19.2 Internet Media Type multipart/byteranges
+
+ When an HTTP 206 (Partial Content) response message includes the
+ content of multiple ranges (a response to a request for multiple
+ non-overlapping ranges), these are transmitted as a multipart
+ message-body. The media type for this purpose is called
+ "multipart/byteranges".
+
+ The multipart/byteranges media type includes two or more parts, each
+ with its own Content-Type and Content-Range fields. The required
+ boundary parameter specifies the boundary string used to separate
+ each body-part.
+
+ Media Type name: multipart
+ Media subtype name: byteranges
+ Required parameters: boundary
+ Optional parameters: none
+ Encoding considerations: only "7bit", "8bit", or "binary" are
+ permitted
+ Security considerations: none
+
+ For example:
+
+ HTTP/1.1 206 Partial Content
+ Date: Wed, 15 Nov 1995 06:25:24 GMT
+ Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
+ Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
+
+ --THIS_STRING_SEPARATES
+ Content-type: application/pdf
+ Content-range: bytes 500-999/8000
+
+ ...the first range...
+ --THIS_STRING_SEPARATES
+ Content-type: application/pdf
+ Content-range: bytes 7000-7999/8000
+
+ ...the second range
+ --THIS_STRING_SEPARATES--
+
+ Notes:
+
+ 1) Additional CRLFs may precede the first boundary string in the
+ entity.
+
+ 2) Although <a href="http://firefly.troll.no/rfcs/rfc2046.html">RFC 2046</a> [40] permits the boundary string to be
+ quoted, some existing implementations handle a quoted boundary
+ string incorrectly.
+
+ 3) A number of browsers and servers were coded to an early draft
+ of the byteranges specification to use a media type of
+ multipart/x-byteranges, which is almost, but not quite
+ compatible with the version documented in HTTP/1.1.
+
+19.3 Tolerant Applications
+
+ Although this document specifies the requirements for the generation
+ of HTTP/1.1 messages, not all applications will be correct in their
+ implementation. We therefore recommend that operational applications
+ be tolerant of deviations whenever those deviations can be
+ interpreted unambiguously.
+
+ Clients SHOULD be tolerant in parsing the Status-Line and servers
+ tolerant when parsing the Request-Line. In particular, they SHOULD
+ accept any amount of SP or HT characters between fields, even though
+ only a single SP is required.
+
+ The line terminator for message-header fields is the sequence CRLF.
+ However, we recommend that applications, when parsing such headers,
+ recognize a single LF as a line terminator and ignore the leading CR.
+
+ The character set of an entity-body SHOULD be labeled as the lowest
+ common denominator of the character codes used within that body, with
+ the exception that not labeling the entity is preferred over labeling
+ the entity with the labels US-ASCII or ISO-8859-1. See section 3.7.1
+ and 3.4.1.
+
+ Additional rules for requirements on parsing and encoding of dates
+ and other potential problems with date encodings include:
+
+ - HTTP/1.1 clients and caches SHOULD assume that an <a href="http://firefly.troll.no/rfcs/rfc850.html">RFC-850</a> date
+ which appears to be more than 50 years in the future is in fact
+ in the past (this helps solve the "year 2000" problem).
+
+ - An HTTP/1.1 implementation MAY internally represent a parsed
+ Expires date as earlier than the proper value, but MUST NOT
+ internally represent a parsed Expires date as later than the
+ proper value.
+
+ - All expiration-related calculations MUST be done in GMT. The
+ local time zone MUST NOT influence the calculation or comparison
+ of an age or expiration time.
+
+ - If an HTTP header incorrectly carries a date value with a time
+ zone other than GMT, it MUST be converted into GMT using the
+ most conservative possible conversion.
+
+19.4 Differences Between HTTP Entities and <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a> Entities
+
+ HTTP/1.1 uses many of the constructs defined for Internet Mail (RFC
+ 822 [9]) and the Multipurpose Internet Mail Extensions (MIME [7]) to
+ allow entities to be transmitted in an open variety of
+ representations and with extensible mechanisms. However, <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a>
+ discusses mail, and HTTP has a few features that are different from
+ those described in <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a>. These differences were carefully chosen
+ to optimize performance over binary connections, to allow greater
+ freedom in the use of new media types, to make date comparisons
+ easier, and to acknowledge the practice of some early HTTP servers
+ and clients.
+
+ This appendix describes specific areas where HTTP differs from RFC
+ 2045. Proxies and gateways to strict MIME environments SHOULD be
+ aware of these differences and provide the appropriate conversions
+ where necessary. Proxies and gateways from MIME environments to HTTP
+ also need to be aware of the differences because some conversions
+ might be required.
+
+19.4.1 MIME-Version
+
+ HTTP is not a MIME-compliant protocol. However, HTTP/1.1 messages MAY
+ include a single MIME-Version general-header field to indicate what
+ version of the MIME protocol was used to construct the message. Use
+ of the MIME-Version header field indicates that the message is in
+ full compliance with the MIME protocol (as defined in <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a>[7]).
+ Proxies/gateways are responsible for ensuring full compliance (where
+ possible) when exporting HTTP messages to strict MIME environments.
+
+ MIME-Version = "MIME-Version" ":" 1*DIGIT "." 1*DIGIT
+
+ MIME version "1.0" is the default for use in HTTP/1.1. However,
+ HTTP/1.1 message parsing and semantics are defined by this document
+ and not the MIME specification.
+
+19.4.2 Conversion to Canonical Form
+
+ <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a> [7] requires that an Internet mail entity be converted to
+ canonical form prior to being transferred, as described in section 4
+ of <a href="http://firefly.troll.no/rfcs/rfc2049.html">RFC 2049</a> [48]. Section 3.7.1 of this document describes the forms
+ allowed for subtypes of the "text" media type when transmitted over
+ HTTP. <a href="http://firefly.troll.no/rfcs/rfc2046.html">RFC 2046</a> requires that content with a type of "text" represent
+ line breaks as CRLF and forbids the use of CR or LF outside of line
+
+ break sequences. HTTP allows CRLF, bare CR, and bare LF to indicate a
+ line break within text content when a message is transmitted over
+ HTTP.
+
+ Where it is possible, a proxy or gateway from HTTP to a strict MIME
+ environment SHOULD translate all line breaks within the text media
+ types described in section 3.7.1 of this document to the <a href="http://firefly.troll.no/rfcs/rfc2049.html">RFC 2049</a>
+ canonical form of CRLF. Note, however, that this might be complicated
+ by the presence of a Content-Encoding and by the fact that HTTP
+ allows the use of some character sets which do not use octets 13 and
+ 10 to represent CR and LF, as is the case for some multi-byte
+ character sets.
+
+ Implementors should note that conversion will break any cryptographic
+ checksums applied to the original content unless the original content
+ is already in canonical form. Therefore, the canonical form is
+ recommended for any content that uses such checksums in HTTP.
+
+19.4.3 Conversion of Date Formats
+
+ HTTP/1.1 uses a restricted set of date formats (section 3.3.1) to
+ simplify the process of date comparison. Proxies and gateways from
+ other protocols SHOULD ensure that any Date header field present in a
+ message conforms to one of the HTTP/1.1 formats and rewrite the date
+ if necessary.
+
+19.4.4 Introduction of Content-Encoding
+
+ <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a> does not include any concept equivalent to HTTP/1.1's
+ Content-Encoding header field. Since this acts as a modifier on the
+ media type, proxies and gateways from HTTP to MIME-compliant
+ protocols MUST either change the value of the Content-Type header
+ field or decode the entity-body before forwarding the message. (Some
+ experimental applications of Content-Type for Internet mail have used
+ a media-type parameter of ";conversions=&lt;content-coding&gt;" to perform
+ a function equivalent to Content-Encoding. However, this parameter is
+ not part of <a href="http://firefly.troll.no/rfcs/rfc2045.html">RFC 2045</a>.)
+
+19.4.5 No Content-Transfer-Encoding
+
+ HTTP does not use the Content-Transfer-Encoding (CTE) field of RFC
+ 2045. Proxies and gateways from MIME-compliant protocols to HTTP MUST
+ remove any non-identity CTE ("quoted-printable" or "base64") encoding
+ prior to delivering the response message to an HTTP client.
+
+ Proxies and gateways from HTTP to MIME-compliant protocols are
+ responsible for ensuring that the message is in the correct format
+ and encoding for safe transport on that protocol, where "safe
+
+ transport" is defined by the limitations of the protocol being used.
+ Such a proxy or gateway SHOULD label the data with an appropriate
+ Content-Transfer-Encoding if doing so will improve the likelihood of
+ safe transport over the destination protocol.
+
+19.4.6 Introduction of Transfer-Encoding
+
+ HTTP/1.1 introduces the Transfer-Encoding header field (section
+ 14.41). Proxies/gateways MUST remove any transfer-coding prior to
+ forwarding a message via a MIME-compliant protocol.
+
+ A process for decoding the "chunked" transfer-coding (section 3.6)
+ can be represented in pseudo-code as:
+
+ length := 0
+ read chunk-size, chunk-extension (if any) and CRLF
+ while (chunk-size &gt; 0) {
+ read chunk-data and CRLF
+ append chunk-data to entity-body
+ length := length + chunk-size
+ read chunk-size and CRLF
+ }
+ read entity-header
+ while (entity-header not empty) {
+ append entity-header to existing header fields
+ read entity-header
+ }
+ Content-Length := length
+ Remove "chunked" from Transfer-Encoding
+
+19.4.7 MHTML and Line Length Limitations
+
+ HTTP implementations which share code with MHTML [45] implementations
+ need to be aware of MIME line length limitations. Since HTTP does not
+ have this limitation, HTTP does not fold long lines. MHTML messages
+ being transported by HTTP follow all conventions of MHTML, including
+ line length limitations and folding, canonicalization, etc., since
+ HTTP transports all message-bodies as payload (see section 3.7.2) and
+ does not interpret the content or any MIME header lines that might be
+ contained therein.
+
+19.5 Additional Features
+
+ <a href="http://firefly.troll.no/rfcs/rfc1945.html">RFC 1945</a> and <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> document protocol elements used by some
+ existing HTTP implementations, but not consistently and correctly
+ across most HTTP/1.1 applications. Implementors are advised to be
+ aware of these features, but cannot rely upon their presence in, or
+ interoperability with, other HTTP/1.1 applications. Some of these
+
+ describe proposed experimental features, and some describe features
+ that experimental deployment found lacking that are now addressed in
+ the base HTTP/1.1 specification.
+
+ A number of other headers, such as Content-Disposition and Title,
+ from SMTP and MIME are also often implemented (see <a href="http://firefly.troll.no/rfcs/rfc2076.html">RFC 2076</a> [37]).
+
+19.5.1 Content-Disposition
+
+ The Content-Disposition response-header field has been proposed as a
+ means for the origin server to suggest a default filename if the user
+ requests that the content is saved to a file. This usage is derived
+ from the definition of Content-Disposition in <a href="http://firefly.troll.no/rfcs/rfc1806.html">RFC 1806</a> [35].
+
+ content-disposition = "Content-Disposition" ":"
+ disposition-type *( ";" disposition-parm )
+ disposition-type = "attachment" | disp-extension-token
+ disposition-parm = filename-parm | disp-extension-parm
+ filename-parm = "filename" "=" quoted-string
+ disp-extension-token = token
+ disp-extension-parm = token "=" ( token | quoted-string )
+
+ An example is
+
+ Content-Disposition: attachment; filename="fname.ext"
+
+ The receiving user agent SHOULD NOT respect any directory path
+ information present in the filename-parm parameter, which is the only
+ parameter believed to apply to HTTP implementations at this time. The
+ filename SHOULD be treated as a terminal component only.
+
+ If this header is used in a response with the application/octet-
+ stream content-type, the implied suggestion is that the user agent
+ should not display the response, but directly enter a `save response
+ as...' dialog.
+
+ See section 15.5 for Content-Disposition security issues.
+
+19.6 Compatibility with Previous Versions
+
+ It is beyond the scope of a protocol specification to mandate
+ compliance with previous versions. HTTP/1.1 was deliberately
+ designed, however, to make supporting previous versions easy. It is
+ worth noting that, at the time of composing this specification
+ (1996), we would expect commercial HTTP/1.1 servers to:
+
+ - recognize the format of the Request-Line for HTTP/0.9, 1.0, and
+ 1.1 requests;
+
+ - understand any valid request in the format of HTTP/0.9, 1.0, or
+ 1.1;
+
+ - respond appropriately with a message in the same major version
+ used by the client.
+
+ And we would expect HTTP/1.1 clients to:
+
+ - recognize the format of the Status-Line for HTTP/1.0 and 1.1
+ responses;
+
+ - understand any valid response in the format of HTTP/0.9, 1.0, or
+ 1.1.
+
+ For most implementations of HTTP/1.0, each connection is established
+ by the client prior to the request and closed by the server after
+ sending the response. Some implementations implement the Keep-Alive
+ version of persistent connections described in section 19.7.1 of RFC
+ 2068 [33].
+
+19.6.1 Changes from HTTP/1.0
+
+ This section summarizes major differences between versions HTTP/1.0
+ and HTTP/1.1.
+
+19.6.1.1 Changes to Simplify Multi-homed Web Servers and Conserve IP
+ Addresses
+
+ The requirements that clients and servers support the Host request-
+ header, report an error if the Host request-header (section 14.23) is
+ missing from an HTTP/1.1 request, and accept absolute URIs (section
+ 5.1.2) are among the most important changes defined by this
+ specification.
+
+ Older HTTP/1.0 clients assumed a one-to-one relationship of IP
+ addresses and servers; there was no other established mechanism for
+ distinguishing the intended server of a request than the IP address
+ to which that request was directed. The changes outlined above will
+ allow the Internet, once older HTTP clients are no longer common, to
+ support multiple Web sites from a single IP address, greatly
+ simplifying large operational Web servers, where allocation of many
+ IP addresses to a single host has created serious problems. The
+ Internet will also be able to recover the IP addresses that have been
+ allocated for the sole purpose of allowing special-purpose domain
+ names to be used in root-level HTTP URLs. Given the rate of growth of
+ the Web, and the number of servers already deployed, it is extremely
+
+ important that all implementations of HTTP (including updates to
+ existing HTTP/1.0 applications) correctly implement these
+ requirements:
+
+ - Both clients and servers MUST support the Host request-header.
+
+ - A client that sends an HTTP/1.1 request MUST send a Host header.
+
+ - Servers MUST report a 400 (Bad Request) error if an HTTP/1.1
+ request does not include a Host request-header.
+
+ - Servers MUST accept absolute URIs.
+
+19.6.2 Compatibility with HTTP/1.0 Persistent Connections
+
+ Some clients and servers might wish to be compatible with some
+ previous implementations of persistent connections in HTTP/1.0
+ clients and servers. Persistent connections in HTTP/1.0 are
+ explicitly negotiated as they are not the default behavior. HTTP/1.0
+ experimental implementations of persistent connections are faulty,
+ and the new facilities in HTTP/1.1 are designed to rectify these
+ problems. The problem was that some existing 1.0 clients may be
+ sending Keep-Alive to a proxy server that doesn't understand
+ Connection, which would then erroneously forward it to the next
+ inbound server, which would establish the Keep-Alive connection and
+ result in a hung HTTP/1.0 proxy waiting for the close on the
+ response. The result is that HTTP/1.0 clients must be prevented from
+ using Keep-Alive when talking to proxies.
+
+ However, talking to proxies is the most important use of persistent
+ connections, so that prohibition is clearly unacceptable. Therefore,
+ we need some other mechanism for indicating a persistent connection
+ is desired, which is safe to use even when talking to an old proxy
+ that ignores Connection. Persistent connections are the default for
+ HTTP/1.1 messages; we introduce a new keyword (Connection: close) for
+ declaring non-persistence. See section 14.10.
+
+ The original HTTP/1.0 form of persistent connections (the Connection:
+ Keep-Alive and Keep-Alive header) is documented in <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>. [33]
+
+19.6.3 Changes from <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>
+
+ This specification has been carefully audited to correct and
+ disambiguate key word usage; <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> had many problems in respect to
+ the conventions laid out in <a href="http://firefly.troll.no/rfcs/rfc2119.html">RFC 2119</a> [34].
+
+ Clarified which error code should be used for inbound server failures
+ (e.g. DNS failures). (Section 10.5.5).
+
+ CREATE had a race that required an Etag be sent when a resource is
+ first created. (Section 10.2.2).
+
+ Content-Base was deleted from the specification: it was not
+ implemented widely, and there is no simple, safe way to introduce it
+ without a robust extension mechanism. In addition, it is used in a
+ similar, but not identical fashion in MHTML [45].
+
+ Transfer-coding and message lengths all interact in ways that
+ required fixing exactly when chunked encoding is used (to allow for
+ transfer encoding that may not be self delimiting); it was important
+ to straighten out exactly how message lengths are computed. (Sections
+ 3.6, 4.4, 7.2.2, 13.5.2, 14.13, 14.16)
+
+ A content-coding of "identity" was introduced, to solve problems
+ discovered in caching. (section 3.5)
+
+ Quality Values of zero should indicate that "I don't want something"
+ to allow clients to refuse a representation. (Section 3.9)
+
+ The use and interpretation of HTTP version numbers has been clarified
+ by <a href="http://firefly.troll.no/rfcs/rfc2145.html">RFC 2145</a>. Require proxies to upgrade requests to highest protocol
+ version they support to deal with problems discovered in HTTP/1.0
+ implementations (Section 3.1)
+
+ Charset wildcarding is introduced to avoid explosion of character set
+ names in accept headers. (Section 14.2)
+
+ A case was missed in the Cache-Control model of HTTP/1.1; s-maxage
+ was introduced to add this missing case. (Sections 13.4, 14.8, 14.9,
+ 14.9.3)
+
+ The Cache-Control: max-age directive was not properly defined for
+ responses. (Section 14.9.3)
+
+ There are situations where a server (especially a proxy) does not
+ know the full length of a response but is capable of serving a
+ byterange request. We therefore need a mechanism to allow byteranges
+ with a content-range not indicating the full length of the message.
+ (Section 14.16)
+
+ Range request responses would become very verbose if all meta-data
+ were always returned; by allowing the server to only send needed
+ headers in a 206 response, this problem can be avoided. (Section
+ 10.2.7, 13.5.3, and 14.27)
+
+ Fix problem with unsatisfiable range requests; there are two cases:
+ syntactic problems, and range doesn't exist in the document. The 416
+ status code was needed to resolve this ambiguity needed to indicate
+ an error for a byte range request that falls outside of the actual
+ contents of a document. (Section 10.4.17, 14.16)
+
+ Rewrite of message transmission requirements to make it much harder
+ for implementors to get it wrong, as the consequences of errors here
+ can have significant impact on the Internet, and to deal with the
+ following problems:
+
+ 1. Changing "HTTP/1.1 or later" to "HTTP/1.1", in contexts where
+ this was incorrectly placing a requirement on the behavior of
+ an implementation of a future version of HTTP/1.x
+
+ 2. Made it clear that user-agents should retry requests, not
+ "clients" in general.
+
+ 3. Converted requirements for clients to ignore unexpected 100
+ (Continue) responses, and for proxies to forward 100 responses,
+ into a general requirement for 1xx responses.
+
+ 4. Modified some TCP-specific language, to make it clearer that
+ non-TCP transports are possible for HTTP.
+
+ 5. Require that the origin server MUST NOT wait for the request
+ body before it sends a required 100 (Continue) response.
+
+ 6. Allow, rather than require, a server to omit 100 (Continue) if
+ it has already seen some of the request body.
+
+ 7. Allow servers to defend against denial-of-service attacks and
+ broken clients.
+
+ This change adds the Expect header and 417 status code. The message
+ transmission requirements fixes are in sections 8.2, 10.4.18,
+ 8.1.2.2, 13.11, and 14.20.
+
+ Proxies should be able to add Content-Length when appropriate.
+ (Section 13.5.2)
+
+ Clean up confusion between 403 and 404 responses. (Section 10.4.4,
+ 10.4.5, and 10.4.11)
+
+ Warnings could be cached incorrectly, or not updated appropriately.
+ (Section 13.1.2, 13.2.4, 13.5.2, 13.5.3, 14.9.3, and 14.46) Warning
+ also needed to be a general header, as PUT or other methods may have
+ need for it in requests.
+
+ Transfer-coding had significant problems, particularly with
+ interactions with chunked encoding. The solution is that transfer-
+ codings become as full fledged as content-codings. This involves
+ adding an IANA registry for transfer-codings (separate from content
+ codings), a new header field (TE) and enabling trailer headers in the
+ future. Transfer encoding is a major performance benefit, so it was
+ worth fixing [39]. TE also solves another, obscure, downward
+ interoperability problem that could have occurred due to interactions
+ between authentication trailers, chunked encoding and HTTP/1.0
+ clients.(Section 3.6, 3.6.1, and 14.39)
+
+ The PATCH, LINK, UNLINK methods were defined but not commonly
+ implemented in previous versions of this specification. See <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a>
+ [33].
+
+ The Alternates, Content-Version, Derived-From, Link, URI, Public and
+ Content-Base header fields were defined in previous versions of this
+ specification, but not commonly implemented. See <a href="http://firefly.troll.no/rfcs/rfc2068.html">RFC 2068</a> [33].
+
+20 Index
+
+ Please see the PostScript version of this RFC for the INDEX.
+
+21. Full Copyright Statement
+
+ Copyright (C) The Internet Society (1999). All Rights Reserved.
+
+ This document and translations of it may be copied and furnished to
+ others, and derivative works that comment on or otherwise explain it
+ or assist in its implementation may be prepared, copied, published
+ and distributed, in whole or in part, without restriction of any
+ kind, provided that the above copyright notice and this paragraph are
+ included on all such copies and derivative works. However, this
+ document itself may not be modified in any way, such as by removing
+ the copyright notice or references to the Internet Society or other
+ Internet organizations, except as needed for the purpose of
+ developing Internet standards in which case the procedures for
+ copyrights defined in the Internet Standards process must be
+ followed, or as required to translate it into languages other than
+ English.
+
+ The limited permissions granted above are perpetual and will not be
+ revoked by the Internet Society or its successors or assigns.
+
+ This document and the information contained herein is provided on an
+ "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+ TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+ BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+ HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+Acknowledgement
+
+ Funding for the RFC Editor function is currently provided by the
+ Internet Society.
+
+</pre>
+<p align="center"><script language="JavaScript"><!--
+erfc("2616");
+// --></script><a href="http://firefly.troll.no/rfccomment.php?rfcnum=2616" target="_blank" onclick="window.open('/rfccomment.php?rfcnum=2616','Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=680,height=530,left=30,top=43'); return false;" )="">Comment on RFC 2616</a>
+</p>
+&nbsp;<br>
+<div align="center">
+<center>
+<table border="0" cellpadding="4" cellspacing="4" width="100%">
+<tbody><tr><td bgcolor="#d6d6c0" width="100%">
+<p><font face="Arial">Comments about this RFC:</font></p>
+<ul>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-869.html">RFC 2616: Very basic HTTP Server written in Emacs Lisp: http://www.chez.com/emarsden/downl...</a> by Alex Schrder (5/12/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-539.html">RFC 2616: If someone has got sample code for a basic HTTP/1.1 Server please let me know......</a> by Mike (2/4/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-486.html">RFC 2616: I am seeking ladies for nothing but sex that is all i want from the lady sorry...</a> by treblav (1/16/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-2360.html">RFC 2616: Hello.
+
+ I have realized that point 8.1.4 of the RFC 2616 is a big threat to...</a> by Doolyo (8/20/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-1522.html">RFC 2616: ::::::@::@"""@:&gt;c
+ :::@"$$%^^*^^*((((99(
+ &lt;&lt;&gt;:"? </a> by (12/16/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-2147.html">RFC 2616: Man Such a big and boring doc.. thats why ppl shy away from RFC stuff. Make it...</a> by AnurgaM (6/15/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-2277.html">RFC 2616: igeve uo 100 dolars
+
+ iwant password
+
+ farh51@hotmail.com </a> by farh (7/24/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-2349.html">RFC 2616: I have realized that point 8.1.4 of this RFC is a big threat to the load speed...</a> by Doolyo (8/15/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-1230.html">RFC 2616: Would it possible to extend the
+ protocol to allow another GET,
+ HEAD, POST,...</a> by CCaldwell (9/15/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-692.html">RFC 2616: Wonder if he got his lady? </a> by SinJax (3/26/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-2056.html">RFC 2616: it's for shareaza that the program go fasther </a> by sylle (5/24/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-2526.html">RFC 2616: Only 2 simultaneous connections is a big threat to the load speed of HTML...</a> by Doolyo (9/30/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-736.html">RFC 2616: yo to the southampton uni coursework massive </a> by anon (4/6/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-1574.html">RFC 2616: If you know everything about HTTP this rfc will be helpful to you (as a recap...</a> by just a developer (1/5/2005)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-1111.html">RFC 2616: Please note that section 3.6.2, referenced in section 3.5 (page 25)
+ may most...</a> by Patrick Powell (8/12/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-1354.html">RFC 2616: gtu87t 86t8o;koip]0-n df bhvfjkhfgfter6ecvgjlhhjuhjioy uftyei vn bk.jljpoi
+ =- ...</a> by jkl (10/20/2004)</font></li>
+<li><font face="Arial"><a href="http://firefly.troll.no/qa/rfcc-1973.html">RFC 2616: I HOPE KNOW MANY OF SOME RFC </a> by MARRY (5/5/2005)</font></li>
+</ul>
+</td></tr></tbody></table> <br></center></div>
+<div align="center">
+<table border="0" cellpadding="3" cellspacing="3" width="100%">
+<tbody><tr><td width="45%">
+<p align="left">Previous: <a href="http://firefly.troll.no/rfcs/rfc2615.html">RFC 2615 - PPP over SONET/SDH</a>
+</p></td><td width="10%">&nbsp;</td><td width="45%">
+<p align="right">Next: <a href="http://firefly.troll.no/rfcs/rfc2617.html">RFC 2617 - HTTP Authentication: Basic and Digest Access Authentication</a>
+</p></td></tr></tbody></table></div><p align="right">&nbsp;</p>
+<hr noshade="noshade" size="2">
+<div align="center">[ <a href="http://firefly.troll.no/rfcs/">RFC Index</a> | <a href="http://firefly.troll.no/rfcs/rfcsearch.html">RFC Search</a> | <a href="http://firefly.troll.no/faqs/">Usenet FAQs</a> | <a href="http://firefly.troll.no/contrib/">Web FAQs</a> | <a href="http://firefly.troll.no/docs/">Documents</a> | <a href="http://www.city-data.com/">Cities</a> ]
+<p>
+</p></div>
+ <a href="http://firefly.troll.no/ftp/rfc/rfc2616.pdf">rfc2616.pdf</a>
+<small>
+<address>
+<p align="center">
+
+</p>
+</address>
+</small>
+</body></html> \ No newline at end of file
diff --git a/tests/testserver/common/startup.sh b/tests/testserver/common/startup.sh
index 74990a47f6..1386314e38 100755
--- a/tests/testserver/common/startup.sh
+++ b/tests/testserver/common/startup.sh
@@ -34,7 +34,7 @@ set -ex
# export variables
export USER=qt-test-server
export PASS=password
-export CONFIG=common/testdata
+export CONFIG=service/testdata
export TESTDATA=service/testdata
# add users
@@ -43,17 +43,4 @@ useradd -m -s /bin/bash $USER; echo "$USER:$PASS" | chpasswd
# install configurations and test data
su $USER -c "cp $CONFIG/system/passwords ~/"
-# modules initialization (apache2.sh, ftp-proxy.sh ...)
-for RUN_CMD
-do $RUN_CMD
-done
-
-# start multicast DNS service discovery (mDNS)
-sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \
- -e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \
- /etc/avahi/avahi-daemon.conf
-service dbus restart
-service avahi-daemon restart
-
-# keep-alive in docker detach mode
-sleep infinity
+./startup.sh "$@"
diff --git a/tests/testserver/cyrus/cyrus.sh b/tests/testserver/cyrus/cyrus.sh
new file mode 100755
index 0000000000..92c3bfa703
--- /dev/null
+++ b/tests/testserver/cyrus/cyrus.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:GPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 or (at your option) any later version
+## approved by the KDE Free Qt Foundation. The licenses are as published by
+## the Free Software Foundation and appearing in the file LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+set -ex
+
+echo "tls_cert_file: /home/qt-test-server/ssl-certs/qt-test-server-cert.pem" >> /etc/imapd.conf
+echo "tls_key_file: /home/qt-test-server/ssl-certs/private/qt-test-server-key.pem" >> /etc/imapd.conf
+chmod +3 /home/qt-test-server/ssl-certs/private/
+mkdir -m 007 -p /run/cyrus/proc
+sed -i 's/#imaps\t\tcmd="imapd/imaps\t\tcmd="imapd/' /etc/cyrus.conf
+
+service cyrus-imapd restart
diff --git a/tests/testserver/docker-compose-bridge-network.yml b/tests/testserver/docker-compose-bridge-network.yml
new file mode 100644
index 0000000000..2cabeee1dc
--- /dev/null
+++ b/tests/testserver/docker-compose-bridge-network.yml
@@ -0,0 +1,157 @@
+version: '2.1'
+
+# The tag of images is used by docker compose file to launch the corresponding
+# docker containers. The value of tag comes from the provisioning script
+# (coin/provisioning/.../testserver/docker_testserver.sh). The script gets SHA-1
+# of each server context as the tag of docker images. If one of the server
+# contexts gets changes, please make sure to update this compose file as well.
+# You can run command 'docker images' to list all the tags of test server images.
+# For example:
+# REPOSITORY TAG
+# qt-test-server-apache2 537fe302f61851d1663f41495230d8e3554a4a13
+
+services:
+ apache2:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-apache2
+ hostname: ${HOST_NAME:-apache2}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13
+ shareDir: ./common
+ serviceDir: ./apache2
+ entrypoint: service/startup.sh
+ command: [service/ssl.sh, service/apache2.sh]
+
+ squid:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-squid
+ hostname: ${HOST_NAME:-squid}
+ depends_on:
+ - apache2
+ external_links:
+ - apache2:apache2.${TEST_DOMAIN}
+ - cyrus:cyrus.${TEST_DOMAIN}
+ - iptables:iptables.${TEST_DOMAIN}
+ - vsftpd:vsftpd.${TEST_DOMAIN}
+ - echo:echo.${TEST_DOMAIN}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c
+ shareDir: ./common
+ serviceDir: ./squid
+ entrypoint: service/startup.sh
+ command: service/squid.sh
+
+ vsftpd:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-vsftpd
+ hostname: ${HOST_NAME:-vsftpd}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e
+ shareDir: ./common
+ serviceDir: ./vsftpd
+ entrypoint: service/startup.sh
+ command: service/vsftpd.sh
+
+ ftp-proxy:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-ftp-proxy
+ hostname: ${HOST_NAME:-ftp-proxy}
+ depends_on:
+ - vsftpd
+ external_links:
+ - vsftpd:vsftpd.${TEST_DOMAIN}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae
+ shareDir: ./common
+ serviceDir: ./ftp-proxy
+ entrypoint: service/startup.sh
+ command: service/ftp-proxy.sh
+
+ danted:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-danted
+ hostname: ${HOST_NAME:-danted}
+ depends_on:
+ - apache2
+ - vsftpd
+ - ftp-proxy
+ external_links:
+ - apache2:apache2.${TEST_DOMAIN}
+ - vsftpd:vsftpd.${TEST_DOMAIN}
+ - ftp-proxy:ftp-proxy.${TEST_DOMAIN}
+ - cyrus:cyrus.${TEST_DOMAIN}
+ - echo:echo.${TEST_DOMAIN}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5
+ shareDir: ./common
+ serviceDir: ./danted
+ entrypoint: service/startup.sh
+ command: service/danted.sh
+
+ cyrus:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-cyrus
+ hostname: ${HOST_NAME:-cyrus}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-cyrus:c8d72754abc0e501afd624ce838e4df35505abc9
+ shareDir: ./common
+ serviceDir: ./cyrus
+ entrypoint: service/startup.sh
+ command: [service/ssl.sh, service/cyrus.sh]
+
+ iptables:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-iptables
+ hostname: ${HOST_NAME:-iptables}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-iptables:cb7a8bd6d28602085a88c8ced7d67e28e75781e2
+ shareDir: ./common
+ serviceDir: ./iptables
+ entrypoint: service/startup.sh
+ command: service/iptables.sh
+ cap_add:
+ - NET_ADMIN
+ - NET_RAW
+
+ echo:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-echo
+ hostname: ${HOST_NAME:-echo}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-echo:b29ad409e746a834c1055fd0f7a55fd5056da6ea
+ shareDir: ./common
+ serviceDir: ./echo
+ entrypoint: service/startup.sh
+ command: service/echo.sh
diff --git a/tests/testserver/docker-compose-for-macOS.yml b/tests/testserver/docker-compose-for-macOS.yml
deleted file mode 100644
index aa610dfb88..0000000000
--- a/tests/testserver/docker-compose-for-macOS.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-version: '3.4'
-
-# The tag of images is used by docker compose file to launch the corresponding
-# docker containers. The value of tag comes from the provisioning script
-# (coin/provisioning/.../testserver/docker_testserver.sh). The script gets SHA-1
-# of each server context as the tag of docker images. If one of the server
-# contexts gets changes, please make sure to update this compose file as well.
-# You can run command 'docker images' to list all the tags of test server images.
-# For example:
-# REPOSITORY TAG
-# qt-test-server-apache2 537fe302f61851d1663f41495230d8e3554a4a13
-
-services:
- apache2:
- image: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13
- container_name: qt-test-server-apache2
- domainname: ${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./apache2:/service:ro
- entrypoint: common/startup.sh
- command: [common/ssl.sh, service/apache2.sh]
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
- - test_cert="qt-test-server-host-network-cacert.pem"
-
- squid:
- image: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c
- container_name: qt-test-server-squid
- domainname: ${TEST_DOMAIN}
- depends_on:
- - apache2
- volumes:
- - ./common:/common:ro
- - ./squid:/service:ro
- entrypoint: common/startup.sh
- command: service/squid.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
-
- vsftpd:
- image: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e
- container_name: qt-test-server-vsftpd
- domainname: ${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./vsftpd:/service:ro
- entrypoint: common/startup.sh
- command: service/vsftpd.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
-
- ftp-proxy:
- image: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae
- container_name: qt-test-server-ftp-proxy
- domainname: ${TEST_DOMAIN}
- depends_on:
- - vsftpd
- volumes:
- - ./common:/common:ro
- - ./ftp-proxy:/service:ro
- entrypoint: common/startup.sh
- command: service/ftp-proxy.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
-
- danted:
- image: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5
- container_name: qt-test-server-danted
- domainname: ${TEST_DOMAIN}
- depends_on:
- - apache2
- - vsftpd
- - ftp-proxy
- volumes:
- - ./common:/common:ro
- - ./danted:/service:ro
- entrypoint: common/startup.sh
- command: service/danted.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - danted_internal=${MACHINE_IP}
- - danted_external=${MACHINE_IP}
- - danted_auth_internal=${MACHINE_IP}
- - danted_auth_external=${MACHINE_IP}
- - test_domain=${TEST_DOMAIN}
diff --git a/tests/testserver/docker-compose-for-windows.yml b/tests/testserver/docker-compose-for-windows.yml
deleted file mode 100644
index aa610dfb88..0000000000
--- a/tests/testserver/docker-compose-for-windows.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-version: '3.4'
-
-# The tag of images is used by docker compose file to launch the corresponding
-# docker containers. The value of tag comes from the provisioning script
-# (coin/provisioning/.../testserver/docker_testserver.sh). The script gets SHA-1
-# of each server context as the tag of docker images. If one of the server
-# contexts gets changes, please make sure to update this compose file as well.
-# You can run command 'docker images' to list all the tags of test server images.
-# For example:
-# REPOSITORY TAG
-# qt-test-server-apache2 537fe302f61851d1663f41495230d8e3554a4a13
-
-services:
- apache2:
- image: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13
- container_name: qt-test-server-apache2
- domainname: ${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./apache2:/service:ro
- entrypoint: common/startup.sh
- command: [common/ssl.sh, service/apache2.sh]
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
- - test_cert="qt-test-server-host-network-cacert.pem"
-
- squid:
- image: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c
- container_name: qt-test-server-squid
- domainname: ${TEST_DOMAIN}
- depends_on:
- - apache2
- volumes:
- - ./common:/common:ro
- - ./squid:/service:ro
- entrypoint: common/startup.sh
- command: service/squid.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
-
- vsftpd:
- image: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e
- container_name: qt-test-server-vsftpd
- domainname: ${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./vsftpd:/service:ro
- entrypoint: common/startup.sh
- command: service/vsftpd.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
-
- ftp-proxy:
- image: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae
- container_name: qt-test-server-ftp-proxy
- domainname: ${TEST_DOMAIN}
- depends_on:
- - vsftpd
- volumes:
- - ./common:/common:ro
- - ./ftp-proxy:/service:ro
- entrypoint: common/startup.sh
- command: service/ftp-proxy.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - test_domain=${TEST_DOMAIN}
-
- danted:
- image: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5
- container_name: qt-test-server-danted
- domainname: ${TEST_DOMAIN}
- depends_on:
- - apache2
- - vsftpd
- - ftp-proxy
- volumes:
- - ./common:/common:ro
- - ./danted:/service:ro
- entrypoint: common/startup.sh
- command: service/danted.sh
- network_mode: "host"
- extra_hosts:
- - "qt-test-server.${TEST_DOMAIN}:${MACHINE_IP}"
- environment:
- - danted_internal=${MACHINE_IP}
- - danted_external=${MACHINE_IP}
- - danted_auth_internal=${MACHINE_IP}
- - danted_auth_external=${MACHINE_IP}
- - test_domain=${TEST_DOMAIN}
diff --git a/tests/testserver/docker-compose-host-network.yml b/tests/testserver/docker-compose-host-network.yml
new file mode 100644
index 0000000000..4b2e1ebdab
--- /dev/null
+++ b/tests/testserver/docker-compose-host-network.yml
@@ -0,0 +1,102 @@
+version: '2.1'
+
+# The tag of images is used by docker compose file to launch the corresponding
+# docker containers. The value of tag comes from the provisioning script
+# (coin/provisioning/.../testserver/docker_testserver.sh). The script gets SHA-1
+# of each server context as the tag of docker images. If one of the server
+# contexts gets changes, please make sure to update this compose file as well.
+# You can run command 'docker images' to list all the tags of test server images.
+# For example:
+# REPOSITORY TAG
+# qt-test-server-apache2 537fe302f61851d1663f41495230d8e3554a4a13
+
+services:
+ apache2:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-apache2
+ hostname: ${HOST_NAME:-apache2}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13
+ shareDir: ./common
+ serviceDir: ./apache2
+ entrypoint: service/startup.sh
+ command: [service/ssl.sh, service/apache2.sh]
+ environment:
+ - test_cert="qt-test-server-host-network-cacert.pem"
+
+ squid:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-squid
+ hostname: ${HOST_NAME:-squid}
+ depends_on:
+ - apache2
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c
+ shareDir: ./common
+ serviceDir: ./squid
+ entrypoint: service/startup.sh
+ command: service/squid.sh
+
+ vsftpd:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-vsftpd
+ hostname: ${HOST_NAME:-vsftpd}
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e
+ shareDir: ./common
+ serviceDir: ./vsftpd
+ entrypoint: service/startup.sh
+ command: service/vsftpd.sh
+
+ ftp-proxy:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-ftp-proxy
+ hostname: ${HOST_NAME:-ftp-proxy}
+ depends_on:
+ - vsftpd
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae
+ shareDir: ./common
+ serviceDir: ./ftp-proxy
+ entrypoint: service/startup.sh
+ command: service/ftp-proxy.sh
+
+ danted:
+ extends:
+ file: ${SHARED_DATA}/docker-compose-common.yml
+ service: ${SHARED_SERVICE}
+ container_name: qt-test-server-danted
+ hostname: ${HOST_NAME:-danted}
+ depends_on:
+ - apache2
+ - vsftpd
+ - ftp-proxy
+ build:
+ context: .
+ args:
+ provisioningImage: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5
+ shareDir: ./common
+ serviceDir: ./danted
+ entrypoint: service/startup.sh
+ command: service/danted.sh
+ environment:
+ - danted_internal=${MACHINE_IP}
+ - danted_external=${MACHINE_IP}
+ - danted_auth_internal=${MACHINE_IP}
+ - danted_auth_external=${MACHINE_IP}
diff --git a/tests/testserver/docker-compose.yml b/tests/testserver/docker-compose.yml
deleted file mode 100644
index be65e5a26a..0000000000
--- a/tests/testserver/docker-compose.yml
+++ /dev/null
@@ -1,83 +0,0 @@
-version: '3.4'
-
-# The tag of images is used by docker compose file to launch the corresponding
-# docker containers. The value of tag comes from the provisioning script
-# (coin/provisioning/.../testserver/docker_testserver.sh). The script gets SHA-1
-# of each server context as the tag of docker images. If one of the server
-# contexts gets changes, please make sure to update this compose file as well.
-# You can run command 'docker images' to list all the tag of test server images.
-# For example:
-# REPOSITORY TAG
-# qt-test-server-apache2 537fe302f61851d1663f41495230d8e3554a4a13
-
-services:
- apache2:
- image: qt-test-server-apache2:537fe302f61851d1663f41495230d8e3554a4a13
- container_name: qt-test-server-apache2
- domainname: ${TEST_DOMAIN}
- hostname: apache2
- volumes:
- - ./common:/common:ro
- - ./apache2:/service:ro
- entrypoint: common/startup.sh
- command: [common/ssl.sh, service/apache2.sh]
-
- squid:
- image: qt-test-server-squid:9c32f41b19aca3d778733c4d8fb0ecc5955e893c
- container_name: qt-test-server-squid
- domainname: ${TEST_DOMAIN}
- hostname: squid
- depends_on:
- - apache2
- external_links:
- - apache2:apache2.${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./squid:/service:ro
- entrypoint: common/startup.sh
- command: service/squid.sh
-
- vsftpd:
- image: qt-test-server-vsftpd:f3a9c8d793a77cc007c0e4e481bec01f9e3eeb7e
- container_name: qt-test-server-vsftpd
- domainname: ${TEST_DOMAIN}
- hostname: vsftpd
- volumes:
- - ./common:/common:ro
- - ./vsftpd:/service:ro
- entrypoint: common/startup.sh
- command: service/vsftpd.sh
-
- ftp-proxy:
- image: qt-test-server-ftp-proxy:d7de8b28392d173db512a558ccc84ead8bece2ae
- container_name: qt-test-server-ftp-proxy
- domainname: ${TEST_DOMAIN}
- hostname: ftp-proxy
- depends_on:
- - vsftpd
- external_links:
- - vsftpd:vsftpd.${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./ftp-proxy:/service:ro
- entrypoint: common/startup.sh
- command: service/ftp-proxy.sh
-
- danted:
- image: qt-test-server-danted:35607f9b790524cf9690c7d12a9a401696b7b6b5
- container_name: qt-test-server-danted
- domainname: ${TEST_DOMAIN}
- hostname: danted
- depends_on:
- - apache2
- - vsftpd
- - ftp-proxy
- external_links:
- - apache2:apache2.${TEST_DOMAIN}
- - vsftpd:vsftpd.${TEST_DOMAIN}
- - ftp-proxy:ftp-proxy.${TEST_DOMAIN}
- volumes:
- - ./common:/common:ro
- - ./danted:/service:ro
- entrypoint: common/startup.sh
- command: service/danted.sh
diff --git a/tests/testserver/echo/echo.sh b/tests/testserver/echo/echo.sh
new file mode 100755
index 0000000000..f0da9627d5
--- /dev/null
+++ b/tests/testserver/echo/echo.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+# Disabled by default, enable it.
+sed -i 's/disable\t\t= yes/disable = no/' /etc/xinetd.d/echo
+sed -i 's/disable\t\t= yes/disable = no/' /etc/xinetd.d/daytime
+
+service xinetd restart
diff --git a/tests/testserver/ftp-proxy/ftp-proxy.sh b/tests/testserver/ftp-proxy/ftp-proxy.sh
index 087a7b7bcc..e5b9631bbb 100755
--- a/tests/testserver/ftp-proxy/ftp-proxy.sh
+++ b/tests/testserver/ftp-proxy/ftp-proxy.sh
@@ -34,7 +34,9 @@ set -ex
# package ftp-proxy
# install configurations and test data
-sed -i 's/# AllowMagicUser\tno/AllowMagicUser\tyes/' /etc/proxy-suite/ftp-proxy.conf
+sed -i -e 's/# AllowMagicUser\tno/AllowMagicUser\tyes/' \
+ -e 's/# ForkLimit\t\t40/ForkLimit\t\t2000/' \
+ /etc/proxy-suite/ftp-proxy.conf
# enable service with installed configurations
ftp-proxy -d
diff --git a/tests/testserver/iptables/iptables.sh b/tests/testserver/iptables/iptables.sh
new file mode 100755
index 0000000000..9a48686d8b
--- /dev/null
+++ b/tests/testserver/iptables/iptables.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:GPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 or (at your option) any later version
+## approved by the KDE Free Qt Foundation. The licenses are as published by
+## the Free Software Foundation and appearing in the file LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+set -ex
+
+iptables -A INPUT -p tcp --destination-port 1357 -j DROP
diff --git a/tests/testserver/vsftpd/testdata/vsftpd.conf b/tests/testserver/vsftpd/testdata/vsftpd.conf
index 6bdb186c9f..e67cccefcc 100644
--- a/tests/testserver/vsftpd/testdata/vsftpd.conf
+++ b/tests/testserver/vsftpd/testdata/vsftpd.conf
@@ -101,6 +101,10 @@ userlist_enable=YES
listen=YES
tcp_wrappers=YES
+# An internal setting used for testing the relative benefit of using the
+# sendfile() system call on your platform.
+use_sendfile=NO
+
# Enabling SFTP
#ssl_enable=YES
#allow_anon_ssl=YES
diff --git a/tests/testserver/vsftpd/vsftpd.sh b/tests/testserver/vsftpd/vsftpd.sh
index 14364f94c2..bd09ad3902 100755
--- a/tests/testserver/vsftpd/vsftpd.sh
+++ b/tests/testserver/vsftpd/vsftpd.sh
@@ -54,6 +54,10 @@ ln -s /home/$USER/ftp /var/ftp
su $USER -c "mkdir -p ~/ftp/qtest/"
su $USER -c "cp rfc3252.txt ~/ftp/qtest/"; rm rfc3252.txt
+# tst_QNetworkReply::proxy_data()
+su $USER -c "ln ~/ftp/qtest/rfc3252.txt ~/ftp/qtest/rfc3252"
+su $USER -c "mkdir -p ~/ftp/qtest/nonASCII/"
+
# Duplicate rfc3252.txt 20 times for bigfile tests:
su $USER -c "seq 20 | xargs -i cat ~/ftp/qtest/rfc3252.txt >> ~/ftp/qtest/bigfile"
diff --git a/util/corelib/qurl-generateTLDs/main.cpp b/util/corelib/qurl-generateTLDs/main.cpp
index e1fe97646f..c03da98510 100644
--- a/util/corelib/qurl-generateTLDs/main.cpp
+++ b/util/corelib/qurl-generateTLDs/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the utils of the Qt Toolkit.
@@ -28,33 +28,66 @@
#include <QtCore>
+const QString quadQuote = QStringLiteral("\"\""); // Closes one string, opens a new one.
+
static QString utf8encode(const QByteArray &array) // turns e.g. tranøy.no to tran\xc3\xb8y.no
{
QString result;
result.reserve(array.length() + array.length() / 3);
+ bool wasHex = false;
for (int i = 0; i < array.length(); ++i) {
char c = array.at(i);
// if char is non-ascii, escape it
if (c < 0x20 || uchar(c) >= 0x7f) {
result += "\\x" + QString::number(uchar(c), 16);
+ wasHex = true;
} else {
// if previous char was escaped, we need to make sure the next char is not
// interpreted as part of the hex value, e.g. "äc.com" -> "\xabc.com"; this
// should be "\xab""c.com"
- QRegExp hexEscape("\\\\x[a-fA-F0-9][a-fA-F0-9]$");
bool isHexChar = ((c >= '0' && c <= '9') ||
- (c >= 'a' && c <= 'f') ||
- (c >= 'A' && c <= 'F'));
- if (result.contains(hexEscape) && isHexChar)
- result += "\"\"";
+ (c >= 'a' && c <= 'f') ||
+ (c >= 'A' && c <= 'F'));
+ if (wasHex && isHexChar)
+ result += quadQuote;
result += c;
+ wasHex = false;
}
}
return result;
}
-int main(int argc, char **argv) {
+/*
+ Digest public suffix data into efficiently-searchable form.
+
+ Takes the public suffix list (see usage message), a list of DNS domains
+ whose child domains should not be presumed to trust one another, and
+ converts it to a form that lets qtbase/src/corelib/io/qtldurl.cpp's query
+ functions find entries efficiently.
+
+ Each line of the suffix file (aside from comments and blanks) gives a suffix
+ (starting with a dot) with an optional prefix of '*' (to include every
+ immediate child) or of '!' (to exclude the suffix, e.g. from a '*' line for
+ a tail of it). A line with neither of these prefixes is an exact match.
+
+ Each line is hashed and the hash is reduced modulo the number of lines
+ (tldCount); lines are grouped by reduced hash and separated by '\0' bytes
+ within each group. Conceptually, the groups are then emitted to a single
+ huge string, along with a table (tldIndices[tldCount]) of indices into that
+ string of the starts of the the various groups.
+
+ However, that huge string would exceed the 64k limit at least one compiler
+ imposes on a single string literal, so we actually split up the huge string
+ into an array of chunks, each less than 64k in size. Each group is written
+ to a single chunk (so we start a new chunk if the next group would take the
+ present chunk over the limit). There are tldChunkCount chunks; their lengths
+ are saved in tldChunks[tldChunkCount]; the chunks themselves in
+ tldData[tldChunkCount]. See qtldurl.cpp's containsTLDEntry() for how to
+ search for a string in the resulting data.
+*/
+int main(int argc, char **argv)
+{
QCoreApplication app(argc, argv);
if (argc < 3) {
printf("\nUsage: ./%s inputFile outputFile\n\n", argv[0]);
@@ -68,14 +101,20 @@ int main(int argc, char **argv) {
return 1;
}
QFile file(argv[1]);
- QFile outFile(argv[2]);
- file.open(QIODevice::ReadOnly);
- outFile.open(QIODevice::WriteOnly);
+ if (!file.open(QIODevice::ReadOnly)) {
+ fprintf(stderr, "Failed to open input file (%s); see %s -usage", argv[1], argv[0]);
+ return 1;
+ }
- QByteArray outIndicesBufferBA;
- QBuffer outIndicesBuffer(&outIndicesBufferBA);
- outIndicesBuffer.open(QIODevice::WriteOnly);
+ QFile outFile(argv[2]);
+ if (!outFile.open(QIODevice::WriteOnly)) {
+ file.close();
+ fprintf(stderr, "Failed to open output file (%s); see %s -usage", argv[2], argv[0]);
+ return 1;
+ }
+ // Write tldData[] and tldIndices[] in one scan of the (input) file, but
+ // buffer tldData[] so we don'te interleave them in the outFile.
QByteArray outDataBufferBA;
QBuffer outDataBuffer(&outDataBufferBA);
outDataBuffer.open(QIODevice::WriteOnly);
@@ -85,75 +124,65 @@ int main(int argc, char **argv) {
file.readLine();
lineCount++;
}
+ outFile.write("static const quint16 tldCount = ");
+ outFile.write(QByteArray::number(lineCount));
+ outFile.write(";\n");
+
file.reset();
QVector<QString> strings(lineCount);
while (!file.atEnd()) {
- QString s = QString::fromUtf8(file.readLine());
- QString st = s.trimmed();
+ QString st = QString::fromUtf8(file.readLine()).trimmed();
int num = qt_hash(st) % lineCount;
+ QString &entry = strings[num];
+ st = utf8encode(st.toUtf8());
- QString utf8String = utf8encode(st.toUtf8());
-
- // for domain 1.com, we could get something like
- // a.com\01.com, which would be interpreted as octal 01,
- // so we need to separate those strings with quotes
- QRegExp regexpOctalEscape(QLatin1String("^[0-9]"));
- if (!strings.at(num).isEmpty() && st.contains(regexpOctalEscape))
- strings[num].append("\"\"");
+ // For domain 1.com, we could get something like a.com\01.com, which
+ // would be misinterpreted as octal 01, so we need to separate such
+ // strings with quotes:
+ if (!entry.isEmpty() && st.at(0).isDigit())
+ entry.append(quadQuote);
- strings[num].append(utf8String);
- strings[num].append("\\0");
+ entry.append(st);
+ entry.append("\\0");
}
-
- outIndicesBuffer.write("static const quint16 tldCount = ");
- outIndicesBuffer.write(QByteArray::number(lineCount));
- outIndicesBuffer.write(";\n");
- outIndicesBuffer.write("static const quint32 tldIndices[");
-// outIndicesBuffer.write(QByteArray::number(lineCount+1)); // not needed
- outIndicesBuffer.write("] = {\n");
+ outFile.write("static const quint32 tldIndices[] = {\n");
+ outDataBuffer.write("\nstatic const char *tldData[] = {");
int totalUtf8Size = 0;
int chunkSize = 0; // strlen of the current chunk (sizeof is bigger by 1)
- int stringUtf8Size = 0;
QStringList chunks;
for (int a = 0; a < lineCount; a++) {
- bool lineIsEmpty = strings.at(a).isEmpty();
- if (!lineIsEmpty) {
- strings[a].prepend("\"");
- strings[a].append("\"");
- }
- int zeroCount = strings.at(a).count(QLatin1String("\\0"));
- int utf8CharsCount = strings.at(a).count(QLatin1String("\\x"));
- int quoteCount = strings.at(a).count('"');
- stringUtf8Size = strings.at(a).count() - (zeroCount + quoteCount + utf8CharsCount * 3);
- chunkSize += stringUtf8Size;
- // MSVC 2015 chokes if sizeof(a single string) > 0xffff
- if (chunkSize >= 0xffff) {
- static int chunkCount = 0;
- qWarning() << "chunk" << ++chunkCount << "has length" << chunkSize - stringUtf8Size;
- outDataBuffer.write(",\n\n");
- chunks.append(QByteArray::number(totalUtf8Size));
- chunkSize = 0;
+ outFile.write(QByteArray::number(totalUtf8Size));
+ outFile.write(",\n");
+ const QString &entry = strings.at(a);
+ if (!entry.isEmpty()) {
+ const int zeroCount = entry.count(QLatin1String("\\0"));
+ const int utf8CharsCount = entry.count(QLatin1String("\\x"));
+ const int quoteCount = entry.count('"');
+ const int stringUtf8Size = entry.count() - (zeroCount + quoteCount + utf8CharsCount * 3);
+ chunkSize += stringUtf8Size;
+ // MSVC 2015 chokes if sizeof(a single string) > 0xffff
+ if (chunkSize >= 0xffff) {
+ static int chunkCount = 0;
+ qWarning() << "chunk" << ++chunkCount << "has length" << chunkSize - stringUtf8Size;
+ outDataBuffer.write(",\n");
+ chunks.append(QString::number(totalUtf8Size));
+ chunkSize = 0;
+ }
+ totalUtf8Size += stringUtf8Size;
+
+ outDataBuffer.write("\n\"");
+ outDataBuffer.write(entry.toUtf8());
+ outDataBuffer.write("\"");
}
- outDataBuffer.write(strings.at(a).toUtf8());
- if (!lineIsEmpty)
- outDataBuffer.write("\n");
- outIndicesBuffer.write(QByteArray::number(totalUtf8Size));
- outIndicesBuffer.write(",\n");
- totalUtf8Size += stringUtf8Size;
}
- chunks.append(QByteArray::number(totalUtf8Size));
- outIndicesBuffer.write(QByteArray::number(totalUtf8Size));
- outIndicesBuffer.write("};\n");
- outIndicesBuffer.close();
- outFile.write(outIndicesBufferBA);
+ chunks.append(QString::number(totalUtf8Size));
+ outFile.write(QByteArray::number(totalUtf8Size));
+ outFile.write("\n};\n");
+ outDataBuffer.write("\n};\n");
outDataBuffer.close();
- outFile.write("\nstatic const char *tldData[");
-// outFile.write(QByteArray::number(charSize)); // not needed
- outFile.write("] = {\n");
outFile.write(outDataBufferBA);
- outFile.write("};\n");
// write chunk information
outFile.write("\nstatic const quint16 tldChunkCount = ");
@@ -162,6 +191,6 @@ int main(int argc, char **argv) {
outFile.write(chunks.join(", ").toLatin1());
outFile.write("};\n");
outFile.close();
- printf("data generated to %s . Now copy the data from this file to src/corelib/io/qurltlds_p.h in your Qt repo\n", argv[2]);
- exit(0);
+ printf("Data generated to %s - now revise qtbase/src/corelib/io/qurltlds_p.h to use this data.\n", argv[2]);
+ return 0;
}
diff --git a/util/glgen/codegenerator.cpp b/util/glgen/codegenerator.cpp
index 4627daa48b..08327a62f5 100644
--- a/util/glgen/codegenerator.cpp
+++ b/util/glgen/codegenerator.cpp
@@ -184,7 +184,7 @@ void CodeGenerator::writeCoreFactoryImplementation(const QString &fileName) cons
// Get the set of version functions classes we need to create
QList<Version> versions = m_parser->versions();
- qSort(versions.begin(), versions.end(), qGreater<Version>());
+ std::sort(m_versions.begin(), m_versions.end(), std::greater<Version>());
// Outout the #include statements
stream << QStringLiteral("#if !defined(QT_OPENGL_ES_2)") << endl;
diff --git a/util/glgen/legacyspecparser.cpp b/util/glgen/legacyspecparser.cpp
index 0f4d085bba..ab2c9495e7 100644
--- a/util/glgen/legacyspecparser.cpp
+++ b/util/glgen/legacyspecparser.cpp
@@ -291,7 +291,7 @@ void LegacySpecParser::parseFunctions(QTextStream &stream)
}
m_versions = versions.toList();
- qSort(m_versions);
+ std::sort(m_versions.begin(), m_versions.end());
}
bool LegacySpecParser::inDeprecationException(const QString &functionName) const
diff --git a/util/lexgen/generator.cpp b/util/lexgen/generator.cpp
index 481d586e73..3b966e025b 100644
--- a/util/lexgen/generator.cpp
+++ b/util/lexgen/generator.cpp
@@ -183,7 +183,7 @@ Generator::Generator(const DFA &_dfa, const Config &config)
: dfa(_dfa), cfg(config)
{
QList<InputType> lst = cfg.maxInputSet.toList();
- qSort(lst);
+ std::sort(lst.begin(), lst.end());
minInput = lst.first();
maxInput = lst.last();
@@ -230,7 +230,7 @@ static QVector<Generator::TransitionSequence> convertToSequences(const Transitio
return sequences;
QList<InputType> keys = transitions.keys();
- qSort(keys);
+ std::sort(keys.begin(), keys.end());
int i = 0;
Generator::TransitionSequence sequence;
sequence.first = keys.at(0);
@@ -359,7 +359,7 @@ void Generator::generateTransitions(CodeBlock &body, const TransitionMap &transi
}
} else {
QList<InputType> keys = transitions.keys();
- qSort(keys);
+ std::sort(keys.begin(), keys.end());
body << "switch (ch.unicode()) {";
body.indent();
diff --git a/util/lexgen/nfa.cpp b/util/lexgen/nfa.cpp
index 9047a17fde..f6e3a5c355 100644
--- a/util/lexgen/nfa.cpp
+++ b/util/lexgen/nfa.cpp
@@ -384,7 +384,7 @@ QSet<int> NFA::epsilonClosure(const QSet<int> &initialClosure) const
QStack<int> stateStack;
stateStack.resize(closure.count());
- qCopy(closure.constBegin(), closure.constEnd(), stateStack.begin());
+ std::copy(closure.constBegin(), closure.constEnd(), stateStack.begin());
while (!stateStack.isEmpty()) {
int t = stateStack.pop();
diff --git a/util/local_database/README b/util/local_database/README
deleted file mode 100644
index 23b6a33ad8..0000000000
--- a/util/local_database/README
+++ /dev/null
@@ -1 +0,0 @@
-local_database is used to generate qlocale data from the Common Locale Data Repository (The database for localized names (like date formats, country names etc)).
diff --git a/util/local_database/cldr2qtimezone.py b/util/local_database/cldr2qtimezone.py
deleted file mode 100755
index 7c10b1dfd2..0000000000
--- a/util/local_database/cldr2qtimezone.py
+++ /dev/null
@@ -1,431 +0,0 @@
-#!/usr/bin/env python2
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-"""Parse CLDR data for QTimeZone use with MS-Windows
-
-Script to parse the CLDR supplemental/windowsZones.xml file and encode
-for use in QTimeZone. See ``./cldr2qlocalexml.py`` for where to get
-the CLDR data. Pass its common/ directory as first parameter to this
-script and the qtbase root directory as second parameter. It shall
-update qtbase's src/corelib/tools/qtimezoneprivate_data_p.h ready for
-use.
-
-The XML structure is as follows:
-
- <supplementalData>
- <version number="$Revision: 7825 $"/>
- <generation date="$Date: 2012-10-10 14:45:31 -0700 (Wed, 10 Oct 2012) $"/>
- <windowsZones>
- <mapTimezones otherVersion="7dc0101" typeVersion="2012f">
- <!-- (UTC-08:00) Pacific Time (US & Canada) -->
- <mapZone other="Pacific Standard Time" territory="001" type="America/Los_Angeles"/>
- <mapZone other="Pacific Standard Time" territory="CA" type="America/Vancouver America/Dawson America/Whitehorse"/>
- <mapZone other="Pacific Standard Time" territory="MX" type="America/Tijuana"/>
- <mapZone other="Pacific Standard Time" territory="US" type="America/Los_Angeles"/>
- <mapZone other="Pacific Standard Time" territory="ZZ" type="PST8PDT"/>
- </mapTimezones>
- </windowsZones>
- </supplementalData>
-"""
-
-import os
-import sys
-import datetime
-import tempfile
-import enumdata
-import xpathlite
-from xpathlite import DraftResolution
-import re
-import qlocalexml2cpp
-
-findAlias = xpathlite.findAlias
-findEntry = xpathlite.findEntry
-findEntryInFile = xpathlite._findEntryInFile
-findTagsInFile = xpathlite.findTagsInFile
-unicode2hex = qlocalexml2cpp.unicode2hex
-wrap_list = qlocalexml2cpp.wrap_list
-
-class ByteArrayData:
- def __init__(self):
- self.data = []
- self.hash = {}
- def append(self, s):
- s = s + '\0'
- if s in self.hash:
- return self.hash[s]
-
- lst = unicode2hex(s)
- index = len(self.data)
- if index > 65535:
- print "\n\n\n#error Data index is too big!"
- sys.stderr.write ("\n\n\nERROR: index exceeds the uint16 range! index = %d\n" % index)
- sys.exit(1)
- self.hash[s] = index
- self.data += lst
- return index
-
-# List of currently known Windows IDs. If script fails on missing ID plase add it here
-# Not public so may be safely changed.
-# Windows Key : [ Windows Id, Offset Seconds ]
-windowsIdList = {
- 1 : [ u'Afghanistan Standard Time', 16200 ],
- 2 : [ u'Alaskan Standard Time', -32400 ],
- 3 : [ u'Arab Standard Time', 10800 ],
- 4 : [ u'Arabian Standard Time', 14400 ],
- 5 : [ u'Arabic Standard Time', 10800 ],
- 6 : [ u'Argentina Standard Time', -10800 ],
- 7 : [ u'Atlantic Standard Time', -14400 ],
- 8 : [ u'AUS Central Standard Time', 34200 ],
- 9 : [ u'AUS Eastern Standard Time', 36000 ],
- 10 : [ u'Azerbaijan Standard Time', 14400 ],
- 11 : [ u'Azores Standard Time', -3600 ],
- 12 : [ u'Bahia Standard Time', -10800 ],
- 13 : [ u'Bangladesh Standard Time', 21600 ],
- 14 : [ u'Belarus Standard Time', 10800 ],
- 15 : [ u'Canada Central Standard Time', -21600 ],
- 16 : [ u'Cape Verde Standard Time', -3600 ],
- 17 : [ u'Caucasus Standard Time', 14400 ],
- 18 : [ u'Cen. Australia Standard Time', 34200 ],
- 19 : [ u'Central America Standard Time', -21600 ],
- 20 : [ u'Central Asia Standard Time', 21600 ],
- 21 : [ u'Central Brazilian Standard Time', -14400 ],
- 22 : [ u'Central Europe Standard Time', 3600 ],
- 23 : [ u'Central European Standard Time', 3600 ],
- 24 : [ u'Central Pacific Standard Time', 39600 ],
- 25 : [ u'Central Standard Time (Mexico)', -21600 ],
- 26 : [ u'Central Standard Time', -21600 ],
- 27 : [ u'China Standard Time', 28800 ],
- 28 : [ u'Dateline Standard Time', -43200 ],
- 29 : [ u'E. Africa Standard Time', 10800 ],
- 30 : [ u'E. Australia Standard Time', 36000 ],
- 31 : [ u'E. South America Standard Time', -10800 ],
- 32 : [ u'Eastern Standard Time', -18000 ],
- 33 : [ u'Eastern Standard Time (Mexico)', -18000 ],
- 34 : [ u'Egypt Standard Time', 7200 ],
- 35 : [ u'Ekaterinburg Standard Time', 18000 ],
- 36 : [ u'Fiji Standard Time', 43200 ],
- 37 : [ u'FLE Standard Time', 7200 ],
- 38 : [ u'Georgian Standard Time', 14400 ],
- 39 : [ u'GMT Standard Time', 0 ],
- 40 : [ u'Greenland Standard Time', -10800 ],
- 41 : [ u'Greenwich Standard Time', 0 ],
- 42 : [ u'GTB Standard Time', 7200 ],
- 43 : [ u'Hawaiian Standard Time', -36000 ],
- 44 : [ u'India Standard Time', 19800 ],
- 45 : [ u'Iran Standard Time', 12600 ],
- 46 : [ u'Israel Standard Time', 7200 ],
- 47 : [ u'Jordan Standard Time', 7200 ],
- 48 : [ u'Kaliningrad Standard Time', 7200 ],
- 49 : [ u'Korea Standard Time', 32400 ],
- 50 : [ u'Libya Standard Time', 7200 ],
- 51 : [ u'Line Islands Standard Time', 50400 ],
- 52 : [ u'Magadan Standard Time', 36000 ],
- 53 : [ u'Mauritius Standard Time', 14400 ],
- 54 : [ u'Middle East Standard Time', 7200 ],
- 55 : [ u'Montevideo Standard Time', -10800 ],
- 56 : [ u'Morocco Standard Time', 0 ],
- 57 : [ u'Mountain Standard Time (Mexico)', -25200 ],
- 58 : [ u'Mountain Standard Time', -25200 ],
- 59 : [ u'Myanmar Standard Time', 23400 ],
- 60 : [ u'N. Central Asia Standard Time', 21600 ],
- 61 : [ u'Namibia Standard Time', 3600 ],
- 62 : [ u'Nepal Standard Time', 20700 ],
- 63 : [ u'New Zealand Standard Time', 43200 ],
- 64 : [ u'Newfoundland Standard Time', -12600 ],
- 65 : [ u'North Asia East Standard Time', 28800 ],
- 66 : [ u'North Asia Standard Time', 25200 ],
- 67 : [ u'Pacific SA Standard Time', -10800 ],
- 68 : [ u'E. Europe Standard Time', 7200 ],
- 69 : [ u'Pacific Standard Time', -28800 ],
- 70 : [ u'Pakistan Standard Time', 18000 ],
- 71 : [ u'Paraguay Standard Time', -14400 ],
- 72 : [ u'Romance Standard Time', 3600 ],
- 73 : [ u'Russia Time Zone 3', 14400 ],
- 74 : [ u'Russia Time Zone 10', 39600 ],
- 75 : [ u'Russia Time Zone 11', 43200 ],
- 76 : [ u'Russian Standard Time', 10800 ],
- 77 : [ u'SA Eastern Standard Time', -10800 ],
- 78 : [ u'SA Pacific Standard Time', -18000 ],
- 79 : [ u'SA Western Standard Time', -14400 ],
- 80 : [ u'Samoa Standard Time', 46800 ],
- 81 : [ u'SE Asia Standard Time', 25200 ],
- 82 : [ u'Singapore Standard Time', 28800 ],
- 83 : [ u'South Africa Standard Time', 7200 ],
- 84 : [ u'Sri Lanka Standard Time', 19800 ],
- 85 : [ u'Syria Standard Time', 7200 ],
- 86 : [ u'Taipei Standard Time', 28800 ],
- 87 : [ u'Tasmania Standard Time', 36000 ],
- 88 : [ u'Tokyo Standard Time', 32400 ],
- 89 : [ u'Tonga Standard Time', 46800 ],
- 90 : [ u'Turkey Standard Time', 7200 ],
- 91 : [ u'Ulaanbaatar Standard Time', 28800 ],
- 92 : [ u'US Eastern Standard Time', -18000 ],
- 93 : [ u'US Mountain Standard Time', -25200 ],
- 94 : [ u'UTC-02', -7200 ],
- 95 : [ u'UTC-11', -39600 ],
- 96 : [ u'UTC', 0 ],
- 97 : [ u'UTC+12', 43200 ],
- 98 : [ u'Venezuela Standard Time', -16200 ],
- 99 : [ u'Vladivostok Standard Time', 36000 ],
- 100: [ u'W. Australia Standard Time', 28800 ],
- 101: [ u'W. Central Africa Standard Time', 3600 ],
- 102: [ u'W. Europe Standard Time', 3600 ],
- 103: [ u'West Asia Standard Time', 18000 ],
- 104: [ u'West Pacific Standard Time', 36000 ],
- 105: [ u'Yakutsk Standard Time', 32400 ],
- 106: [ u'North Korea Standard Time', 30600 ]
-}
-
-def windowsIdToKey(windowsId):
- for windowsKey in windowsIdList:
- if windowsIdList[windowsKey][0] == windowsId:
- return windowsKey
- return 0
-
-# List of standard UTC IDs to use. Not public so may be safely changed.
-# Do not remove ID's as is part of API/behavior guarantee
-# Key : [ UTC Id, Offset Seconds ]
-utcIdList = {
- 0 : [ u'UTC', 0 ], # Goes first so is default
- 1 : [ u'UTC-14:00', -50400 ],
- 2 : [ u'UTC-13:00', -46800 ],
- 3 : [ u'UTC-12:00', -43200 ],
- 4 : [ u'UTC-11:00', -39600 ],
- 5 : [ u'UTC-10:00', -36000 ],
- 6 : [ u'UTC-09:00', -32400 ],
- 7 : [ u'UTC-08:00', -28800 ],
- 8 : [ u'UTC-07:00', -25200 ],
- 9 : [ u'UTC-06:00', -21600 ],
- 10 : [ u'UTC-05:00', -18000 ],
- 11 : [ u'UTC-04:30', -16200 ],
- 12 : [ u'UTC-04:00', -14400 ],
- 13 : [ u'UTC-03:30', -12600 ],
- 14 : [ u'UTC-03:00', -10800 ],
- 15 : [ u'UTC-02:00', -7200 ],
- 16 : [ u'UTC-01:00', -3600 ],
- 17 : [ u'UTC-00:00', 0 ],
- 18 : [ u'UTC+00:00', 0 ],
- 19 : [ u'UTC+01:00', 3600 ],
- 20 : [ u'UTC+02:00', 7200 ],
- 21 : [ u'UTC+03:00', 10800 ],
- 22 : [ u'UTC+03:30', 12600 ],
- 23 : [ u'UTC+04:00', 14400 ],
- 24 : [ u'UTC+04:30', 16200 ],
- 25 : [ u'UTC+05:00', 18000 ],
- 26 : [ u'UTC+05:30', 19800 ],
- 27 : [ u'UTC+05:45', 20700 ],
- 28 : [ u'UTC+06:00', 21600 ],
- 29 : [ u'UTC+06:30', 23400 ],
- 30 : [ u'UTC+07:00', 25200 ],
- 31 : [ u'UTC+08:00', 28800 ],
- 32 : [ u'UTC+09:00', 32400 ],
- 33 : [ u'UTC+09:30', 34200 ],
- 34 : [ u'UTC+10:00', 36000 ],
- 35 : [ u'UTC+11:00', 39600 ],
- 36 : [ u'UTC+12:00', 43200 ],
- 37 : [ u'UTC+13:00', 46800 ],
- 38 : [ u'UTC+14:00', 50400 ],
- 39 : [ u'UTC+08:30', 30600 ]
-}
-
-def usage():
- print "Usage: cldr2qtimezone.py <path to cldr core/common> <path to qtbase>"
- sys.exit()
-
-if len(sys.argv) != 3:
- usage()
-
-cldrPath = sys.argv[1]
-qtPath = sys.argv[2]
-
-if not os.path.isdir(cldrPath) or not os.path.isdir(qtPath):
- usage()
-
-windowsZonesPath = cldrPath + "/supplemental/windowsZones.xml"
-tempFileDir = qtPath
-dataFilePath = qtPath + "/src/corelib/tools/qtimezoneprivate_data_p.h"
-
-if not os.path.isfile(windowsZonesPath):
- usage()
-
-if not os.path.isfile(dataFilePath):
- usage()
-
-cldr_version = 'unknown'
-ldml = open(cldrPath + "/dtd/ldml.dtd", "r")
-for line in ldml:
- if 'version cldrVersion CDATA #FIXED' in line:
- cldr_version = line.split('"')[1]
-
-# [[u'version', [(u'number', u'$Revision: 7825 $')]]]
-versionNumber = findTagsInFile(windowsZonesPath, "version")[0][1][0][1]
-
-mapTimezones = findTagsInFile(windowsZonesPath, "windowsZones/mapTimezones")
-
-defaultDict = {}
-windowsIdDict = {}
-
-if mapTimezones:
- for mapZone in mapTimezones:
- # [u'mapZone', [(u'territory', u'MH'), (u'other', u'UTC+12'), (u'type', u'Pacific/Majuro Pacific/Kwajalein')]]
- if mapZone[0] == u'mapZone':
- data = {}
- for attribute in mapZone[1]:
- if attribute[0] == u'other':
- data['windowsId'] = attribute[1]
- if attribute[0] == u'territory':
- data['countryCode'] = attribute[1]
- if attribute[0] == u'type':
- data['ianaList'] = attribute[1]
-
- data['windowsKey'] = windowsIdToKey(data['windowsId'])
- if data['windowsKey'] <= 0:
- raise xpathlite.Error("Unknown Windows ID, please add \"%s\"" % data['windowsId'])
-
- countryId = 0
- if data['countryCode'] == u'001':
- defaultDict[data['windowsKey']] = data['ianaList']
- else:
- data['countryId'] = enumdata.countryCodeToId(data['countryCode'])
- if data['countryId'] < 0:
- raise xpathlite.Error("Unknown Country Code \"%s\"" % data['countryCode'])
- data['country'] = enumdata.country_list[data['countryId']][0]
- windowsIdDict[data['windowsKey'], data['countryId']] = data
-
-print "Input file parsed, now writing data"
-
-GENERATED_BLOCK_START = "// GENERATED PART STARTS HERE\n"
-GENERATED_BLOCK_END = "// GENERATED PART ENDS HERE\n"
-
-# Create a temp file to write the new data into
-(newTempFile, newTempFilePath) = tempfile.mkstemp("qtimezone_data_p", dir=tempFileDir)
-newTempFile = os.fdopen(newTempFile, "w")
-
-# Open the old file and copy over the first non-generated section to the new file
-oldDataFile = open(dataFilePath, "r")
-s = oldDataFile.readline()
-while s and s != GENERATED_BLOCK_START:
- newTempFile.write(s)
- s = oldDataFile.readline()
-
-# Write out generated block start tag and warning
-newTempFile.write(GENERATED_BLOCK_START)
-newTempFile.write("""
-/*
- This part of the file was generated on %s from the
- Common Locale Data Repository v%s supplemental/windowsZones.xml file %s
-
- http://www.unicode.org/cldr/
-
- Do not edit this code: run cldr2qtimezone.py on updated (or
- edited) CLDR data; see qtbase/util/local_database/.
-*/
-
-""" % (str(datetime.date.today()), cldr_version, versionNumber) )
-
-windowsIdData = ByteArrayData()
-ianaIdData = ByteArrayData()
-
-# Write Windows/IANA table
-newTempFile.write("// Windows ID Key, Country Enum, IANA ID Index\n")
-newTempFile.write("static const QZoneData zoneDataTable[] = {\n")
-for index in windowsIdDict:
- data = windowsIdDict[index]
- newTempFile.write(" { %6d,%6d,%6d }, // %s / %s\n"
- % (data['windowsKey'],
- data['countryId'],
- ianaIdData.append(data['ianaList']),
- data['windowsId'],
- data['country']))
-newTempFile.write(" { 0, 0, 0 } // Trailing zeroes\n")
-newTempFile.write("};\n\n")
-
-print "Done Zone Data"
-
-# Write Windows ID key table
-newTempFile.write("// Windows ID Key, Windows ID Index, IANA ID Index, UTC Offset\n")
-newTempFile.write("static const QWindowsData windowsDataTable[] = {\n")
-for windowsKey in windowsIdList:
- newTempFile.write(" { %6d,%6d,%6d,%6d }, // %s\n"
- % (windowsKey,
- windowsIdData.append(windowsIdList[windowsKey][0]),
- ianaIdData.append(defaultDict[windowsKey]),
- windowsIdList[windowsKey][1],
- windowsIdList[windowsKey][0]))
-newTempFile.write(" { 0, 0, 0, 0 } // Trailing zeroes\n")
-newTempFile.write("};\n\n")
-
-print "Done Windows Data Table"
-
-# Write UTC ID key table
-newTempFile.write("// IANA ID Index, UTC Offset\n")
-newTempFile.write("static const QUtcData utcDataTable[] = {\n")
-for index in utcIdList:
- data = utcIdList[index]
- newTempFile.write(" { %6d,%6d }, // %s\n"
- % (ianaIdData.append(data[0]),
- data[1],
- data[0]))
-newTempFile.write(" { 0, 0 } // Trailing zeroes\n")
-newTempFile.write("};\n\n")
-
-print "Done UTC Data Table"
-
-# Write out Windows ID's data
-newTempFile.write("static const char windowsIdData[] = {\n")
-newTempFile.write(wrap_list(windowsIdData.data))
-newTempFile.write("\n};\n\n")
-
-# Write out IANA ID's data
-newTempFile.write("static const char ianaIdData[] = {\n")
-newTempFile.write(wrap_list(ianaIdData.data))
-newTempFile.write("\n};\n")
-
-print "Done ID Data Table"
-
-# Write out the end of generated block tag
-newTempFile.write(GENERATED_BLOCK_END)
-s = oldDataFile.readline()
-
-# Skip through the old generated data in the old file
-while s and s != GENERATED_BLOCK_END:
- s = oldDataFile.readline()
-
-# Now copy the rest of the original file into the new file
-s = oldDataFile.readline()
-while s:
- newTempFile.write(s)
- s = oldDataFile.readline()
-
-# Now close the old and new file, delete the old file and copy the new file in its place
-newTempFile.close()
-oldDataFile.close()
-os.remove(dataFilePath)
-os.rename(newTempFilePath, dataFilePath)
-
-print "Data generation completed, please check the new file at " + dataFilePath
diff --git a/util/locale_database/README b/util/locale_database/README
new file mode 100644
index 0000000000..8654968d66
--- /dev/null
+++ b/util/locale_database/README
@@ -0,0 +1,5 @@
+locale_database is used to generate qlocale data from CLDR.
+
+CLDR is the Common Locale Data Repository, a database for localized
+data (like date formats, country names etc). It is provided by the
+Unicode consortium.
diff --git a/util/local_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py
index 4ce0a6e3b1..072ea9e4ed 100755
--- a/util/local_database/cldr2qlocalexml.py
+++ b/util/locale_database/cldr2qlocalexml.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python2
+# coding=utf8
#############################################################################
##
-## Copyright (C) 2017 The Qt Company Ltd.
+## Copyright (C) 2018 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of the Qt Toolkit.
@@ -38,13 +39,16 @@ command-line argument. Save its standard output (but not error) to a
file for later processing by ``./qlocalexml2cpp.py``
When you update the CLDR data, be sure to also update
-src/corelib/tools/qt_attribution.json's entry for unicode-cldr. Check
+src/corelib/text/qt_attribution.json's entry for unicode-cldr. Check
this script's output for unknown language, country or script messages;
if any can be resolved, use their entry in common/main/en.xml to
append new entries to enumdata.py's lists and update documentation in
-src/corelib/tools/qlocale.qdoc, adding the new entries in alphabetic
+src/corelib/text/qlocale.qdoc, adding the new entries in alphabetic
order.
+While updating the locale data, check also for updates to MS-Win's
+time zone names; see cldr2qtimezone.py for details.
+
.. _CLDR: ftp://unicode.org/Public/cldr/
"""
@@ -59,6 +63,8 @@ from xpathlite import DraftResolution, findAlias, findEntry, findTagsInFile
from dateconverter import convert_date
from localexml import Locale
+# TODO: make calendars a command-line option
+calendars = ['gregorian', 'persian', 'islamic'] # 'hebrew'
findEntryInFile = xpathlite._findEntryInFile
def wrappedwarn(prefix, tokens):
return sys.stderr.write(
@@ -95,6 +101,34 @@ def parse_number_format(patterns, data):
result.append(pattern)
return result
+def raiseUnknownCode(code, form, cache={}):
+ """Check whether an unknown code could be supported.
+
+ We declare a language, script or country code unknown if it's not
+ known to enumdata.py; however, if it's present in main/en.xml's
+ mapping of codes to names, we have the option of adding support.
+ This caches the necessary look-up (so we only read main/en.xml
+ once) and returns the name we should use if we do add support.
+
+ First parameter, code, is the unknown code. Second parameter,
+ form, is one of 'language', 'script' or 'country' to select the
+ type of code to look up. Do not pass further parameters (the next
+ will deprive you of the cache).
+
+ Raises xpathlite.Error with a suitable message, that includes the
+ unknown code's full name if found.
+
+ Relies on global cldr_dir being set before it's called; see tail
+ of this file.
+ """
+ if not cache:
+ cache.update(xpathlite.codeMapsFromFile(os.path.join(cldr_dir, 'en.xml')))
+ name = cache[form].get(code)
+ msg = 'unknown %s code "%s"' % (form, code)
+ if name:
+ msg += ' - could use "%s"' % name
+ raise xpathlite.Error(msg)
+
def parse_list_pattern_part_format(pattern):
# This is a very limited parsing of the format for list pattern part only.
return pattern.replace("{0}", "%1").replace("{1}", "%2").replace("{2}", "%3")
@@ -193,18 +227,18 @@ def _generateLocaleInfo(path, language_code, script_code, country_code, variant_
language_id = enumdata.languageCodeToId(language_code)
if language_id <= 0:
- raise xpathlite.Error('unknown language code "%s"' % language_code)
+ raiseUnknownCode(language_code, 'language')
script_id = enumdata.scriptCodeToId(script_code)
if script_id == -1:
- raise xpathlite.Error('unknown script code "%s"' % script_code)
+ raiseUnknownCode(script_code, 'script')
# we should handle fully qualified names with the territory
if not country_code:
return {}
country_id = enumdata.countryCodeToId(country_code)
if country_id <= 0:
- raise xpathlite.Error('unknown country code "%s"' % country_code)
+ raiseUnknownCode(country_code, 'country')
# So we say we accept only those values that have "contributed" or
# "approved" resolution. see http://www.unicode.org/cldr/process.html
@@ -364,12 +398,12 @@ def _generateLocaleInfo(path, language_code, script_code, country_code, variant_
('narrow', 'format', 'narrow'),
)
- # Month data:
- for cal in ('gregorian',): # We shall want to add to this
+ # Month names for 12-month calendars:
+ for cal in calendars:
stem = 'dates/calendars/calendar[' + cal + ']/months/'
for (key, mode, size) in namings:
prop = 'monthContext[' + mode + ']/monthWidth[' + size + ']/'
- result[key + 'Months'] = ';'.join(
+ result[key + 'Months_' + cal] = ';'.join(
findEntry(path, stem + prop + "month[%d]" % i)
for i in range(1, 13)) + ';'
@@ -655,9 +689,9 @@ if skips:
wrappedwarn('skipping likelySubtags (for unknown language codes): ', skips)
print " <localeList>"
-Locale.C().toXml()
+Locale.C(calendars).toXml(calendars)
for key in locale_keys:
- locale_database[key].toXml()
+ locale_database[key].toXml(calendars)
print " </localeList>"
print "</localeDatabase>"
diff --git a/util/locale_database/cldr2qtimezone.py b/util/locale_database/cldr2qtimezone.py
new file mode 100755
index 0000000000..4c3609056d
--- /dev/null
+++ b/util/locale_database/cldr2qtimezone.py
@@ -0,0 +1,459 @@
+#!/usr/bin/env python2
+#############################################################################
+##
+## Copyright (C) 2019 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of the Qt Toolkit.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+"""Parse CLDR data for QTimeZone use with MS-Windows
+
+Script to parse the CLDR supplemental/windowsZones.xml file and encode
+for use in QTimeZone. See ``./cldr2qlocalexml.py`` for where to get
+the CLDR data. Pass its common/ directory as first parameter to this
+script and the qtbase root directory as second parameter. It shall
+update qtbase's src/corelib/time/qtimezoneprivate_data_p.h ready for
+use.
+
+The XML structure is as follows:
+
+ <supplementalData>
+ <version number="$Revision:...$"/>
+ <generation date="$Date:...$"/>
+ <windowsZones>
+ <mapTimezones otherVersion="..." typeVersion="...">
+ <!-- (UTC-08:00) Pacific Time (US & Canada) -->
+ <mapZone other="Pacific Standard Time" territory="001" type="America/Los_Angeles"/>
+ <mapZone other="Pacific Standard Time" territory="CA" type="America/Vancouver America/Dawson America/Whitehorse"/>
+ <mapZone other="Pacific Standard Time" territory="US" type="America/Los_Angeles America/Metlakatla"/>
+ <mapZone other="Pacific Standard Time" territory="ZZ" type="PST8PDT"/>
+ </mapTimezones>
+ </windowsZones>
+ </supplementalData>
+"""
+
+import os
+import sys
+import datetime
+import tempfile
+import enumdata
+import xpathlite
+from xpathlite import DraftResolution
+import re
+import qlocalexml2cpp
+
+findAlias = xpathlite.findAlias
+findEntry = xpathlite.findEntry
+findEntryInFile = xpathlite._findEntryInFile
+findTagsInFile = xpathlite.findTagsInFile
+unicode2hex = qlocalexml2cpp.unicode2hex
+wrap_list = qlocalexml2cpp.wrap_list
+
+class ByteArrayData:
+ def __init__(self):
+ self.data = []
+ self.hash = {}
+ def append(self, s):
+ s = s + '\0'
+ if s in self.hash:
+ return self.hash[s]
+
+ lst = unicode2hex(s)
+ index = len(self.data)
+ if index > 65535:
+ print "\n\n\n#error Data index is too big!"
+ sys.stderr.write ("\n\n\nERROR: index exceeds the uint16 range! index = %d\n" % index)
+ sys.exit(1)
+ self.hash[s] = index
+ self.data += lst
+ return index
+
+# List of currently known Windows IDs.
+# If this script reports missing IDs, please add them here.
+# Look up the offset using (google and) timeanddate.com.
+# Not public so may safely be changed. Please keep in alphabetic order by ID.
+# ( Windows Id, Offset Seconds )
+windowsIdList = (
+ (u'Afghanistan Standard Time', 16200),
+ (u'Alaskan Standard Time', -32400),
+ (u'Aleutian Standard Time', -36000),
+ (u'Altai Standard Time', 25200),
+ (u'Arab Standard Time', 10800),
+ (u'Arabian Standard Time', 14400),
+ (u'Arabic Standard Time', 10800),
+ (u'Argentina Standard Time', -10800),
+ (u'Astrakhan Standard Time', 14400),
+ (u'Atlantic Standard Time', -14400),
+ (u'AUS Central Standard Time', 34200),
+ (u'Aus Central W. Standard Time', 31500),
+ (u'AUS Eastern Standard Time', 36000),
+ (u'Azerbaijan Standard Time', 14400),
+ (u'Azores Standard Time', -3600),
+ (u'Bahia Standard Time', -10800),
+ (u'Bangladesh Standard Time', 21600),
+ (u'Belarus Standard Time', 10800),
+ (u'Bougainville Standard Time', 39600),
+ (u'Canada Central Standard Time', -21600),
+ (u'Cape Verde Standard Time', -3600),
+ (u'Caucasus Standard Time', 14400),
+ (u'Cen. Australia Standard Time', 34200),
+ (u'Central America Standard Time', -21600),
+ (u'Central Asia Standard Time', 21600),
+ (u'Central Brazilian Standard Time', -14400),
+ (u'Central Europe Standard Time', 3600),
+ (u'Central European Standard Time', 3600),
+ (u'Central Pacific Standard Time', 39600),
+ (u'Central Standard Time (Mexico)', -21600),
+ (u'Central Standard Time', -21600),
+ (u'China Standard Time', 28800),
+ (u'Chatham Islands Standard Time', 45900),
+ (u'Cuba Standard Time', -18000),
+ (u'Dateline Standard Time', -43200),
+ (u'E. Africa Standard Time', 10800),
+ (u'E. Australia Standard Time', 36000),
+ (u'E. Europe Standard Time', 7200),
+ (u'E. South America Standard Time', -10800),
+ (u'Easter Island Standard Time', -21600),
+ (u'Eastern Standard Time', -18000),
+ (u'Eastern Standard Time (Mexico)', -18000),
+ (u'Egypt Standard Time', 7200),
+ (u'Ekaterinburg Standard Time', 18000),
+ (u'Fiji Standard Time', 43200),
+ (u'FLE Standard Time', 7200),
+ (u'Georgian Standard Time', 14400),
+ (u'GMT Standard Time', 0),
+ (u'Greenland Standard Time', -10800),
+ (u'Greenwich Standard Time', 0),
+ (u'GTB Standard Time', 7200),
+ (u'Haiti Standard Time', -18000),
+ (u'Hawaiian Standard Time', -36000),
+ (u'India Standard Time', 19800),
+ (u'Iran Standard Time', 12600),
+ (u'Israel Standard Time', 7200),
+ (u'Jordan Standard Time', 7200),
+ (u'Kaliningrad Standard Time', 7200),
+ (u'Korea Standard Time', 32400),
+ (u'Libya Standard Time', 7200),
+ (u'Line Islands Standard Time', 50400),
+ (u'Lord Howe Standard Time', 37800),
+ (u'Magadan Standard Time', 36000),
+ (u'Magallanes Standard Time', -10800), # permanent DST
+ (u'Marquesas Standard Time', -34200),
+ (u'Mauritius Standard Time', 14400),
+ (u'Middle East Standard Time', 7200),
+ (u'Montevideo Standard Time', -10800),
+ (u'Morocco Standard Time', 0),
+ (u'Mountain Standard Time (Mexico)', -25200),
+ (u'Mountain Standard Time', -25200),
+ (u'Myanmar Standard Time', 23400),
+ (u'N. Central Asia Standard Time', 21600),
+ (u'Namibia Standard Time', 3600),
+ (u'Nepal Standard Time', 20700),
+ (u'New Zealand Standard Time', 43200),
+ (u'Newfoundland Standard Time', -12600),
+ (u'Norfolk Standard Time', 39600),
+ (u'North Asia East Standard Time', 28800),
+ (u'North Asia Standard Time', 25200),
+ (u'North Korea Standard Time', 30600),
+ (u'Omsk Standard Time', 21600),
+ (u'Pacific SA Standard Time', -10800),
+ (u'Pacific Standard Time', -28800),
+ (u'Pacific Standard Time (Mexico)', -28800),
+ (u'Pakistan Standard Time', 18000),
+ (u'Paraguay Standard Time', -14400),
+ (u'Qyzylorda Standard Time', 18000), # a.k.a. Kyzylorda, in Kazakhstan
+ (u'Romance Standard Time', 3600),
+ (u'Russia Time Zone 3', 14400),
+ (u'Russia Time Zone 10', 39600),
+ (u'Russia Time Zone 11', 43200),
+ (u'Russian Standard Time', 10800),
+ (u'SA Eastern Standard Time', -10800),
+ (u'SA Pacific Standard Time', -18000),
+ (u'SA Western Standard Time', -14400),
+ (u'Saint Pierre Standard Time', -10800), # New France
+ (u'Sakhalin Standard Time', 39600),
+ (u'Samoa Standard Time', 46800),
+ (u'Sao Tome Standard Time', 0),
+ (u'Saratov Standard Time', 14400),
+ (u'SE Asia Standard Time', 25200),
+ (u'Singapore Standard Time', 28800),
+ (u'South Africa Standard Time', 7200),
+ (u'Sri Lanka Standard Time', 19800),
+ (u'Sudan Standard Time', 7200), # unless they mean South Sudan, +03:00
+ (u'Syria Standard Time', 7200),
+ (u'Taipei Standard Time', 28800),
+ (u'Tasmania Standard Time', 36000),
+ (u'Tocantins Standard Time', -10800),
+ (u'Tokyo Standard Time', 32400),
+ (u'Tomsk Standard Time', 25200),
+ (u'Tonga Standard Time', 46800),
+ (u'Transbaikal Standard Time', 32400), # Yakutsk
+ (u'Turkey Standard Time', 7200),
+ (u'Turks And Caicos Standard Time', -14400),
+ (u'Ulaanbaatar Standard Time', 28800),
+ (u'US Eastern Standard Time', -18000),
+ (u'US Mountain Standard Time', -25200),
+ (u'UTC-11', -39600),
+ (u'UTC-09', -32400),
+ (u'UTC-08', -28800),
+ (u'UTC-02', -7200),
+ (u'UTC', 0),
+ (u'UTC+12', 43200),
+ (u'UTC+13', 46800),
+ (u'Venezuela Standard Time', -16200),
+ (u'Vladivostok Standard Time', 36000),
+ (u'Volgograd Standard Time', 14400),
+ (u'W. Australia Standard Time', 28800),
+ (u'W. Central Africa Standard Time', 3600),
+ (u'W. Europe Standard Time', 3600),
+ (u'W. Mongolia Standard Time', 25200), # Hovd
+ (u'West Asia Standard Time', 18000),
+ (u'West Bank Standard Time', 7200),
+ (u'West Pacific Standard Time', 36000),
+ (u'Yakutsk Standard Time', 32400),
+)
+
+def windowsIdToKey(windowsId):
+ for index, pair in enumerate(windowsIdList):
+ if pair[0] == windowsId:
+ return index + 1
+ return 0
+
+# List of standard UTC IDs to use. Not public so may be safely changed.
+# Do not remove IDs, as each entry is part of the API/behavior guarantee.
+# ( UTC Id, Offset Seconds )
+utcIdList = (
+ (u'UTC', 0), # Goes first so is default
+ (u'UTC-14:00', -50400),
+ (u'UTC-13:00', -46800),
+ (u'UTC-12:00', -43200),
+ (u'UTC-11:00', -39600),
+ (u'UTC-10:00', -36000),
+ (u'UTC-09:00', -32400),
+ (u'UTC-08:00', -28800),
+ (u'UTC-07:00', -25200),
+ (u'UTC-06:00', -21600),
+ (u'UTC-05:00', -18000),
+ (u'UTC-04:30', -16200),
+ (u'UTC-04:00', -14400),
+ (u'UTC-03:30', -12600),
+ (u'UTC-03:00', -10800),
+ (u'UTC-02:00', -7200),
+ (u'UTC-01:00', -3600),
+ (u'UTC-00:00', 0),
+ (u'UTC+00:00', 0),
+ (u'UTC+01:00', 3600),
+ (u'UTC+02:00', 7200),
+ (u'UTC+03:00', 10800),
+ (u'UTC+03:30', 12600),
+ (u'UTC+04:00', 14400),
+ (u'UTC+04:30', 16200),
+ (u'UTC+05:00', 18000),
+ (u'UTC+05:30', 19800),
+ (u'UTC+05:45', 20700),
+ (u'UTC+06:00', 21600),
+ (u'UTC+06:30', 23400),
+ (u'UTC+07:00', 25200),
+ (u'UTC+08:00', 28800),
+ (u'UTC+08:30', 30600),
+ (u'UTC+09:00', 32400),
+ (u'UTC+09:30', 34200),
+ (u'UTC+10:00', 36000),
+ (u'UTC+11:00', 39600),
+ (u'UTC+12:00', 43200),
+ (u'UTC+13:00', 46800),
+ (u'UTC+14:00', 50400),
+)
+
+def usage():
+ print "Usage: cldr2qtimezone.py <path to cldr core/common> <path to qtbase>"
+ sys.exit()
+
+if len(sys.argv) != 3:
+ usage()
+
+cldrPath = sys.argv[1]
+qtPath = sys.argv[2]
+
+if not os.path.isdir(cldrPath) or not os.path.isdir(qtPath):
+ usage()
+
+windowsZonesPath = cldrPath + "/supplemental/windowsZones.xml"
+tempFileDir = qtPath
+dataFilePath = qtPath + "/src/corelib/time/qtimezoneprivate_data_p.h"
+
+if not (os.path.isfile(windowsZonesPath) and os.path.isfile(dataFilePath)):
+ usage()
+
+cldr_version = 'unknown'
+ldml = open(cldrPath + "/dtd/ldml.dtd", "r")
+for line in ldml:
+ if 'version cldrVersion CDATA #FIXED' in line:
+ cldr_version = line.split('"')[1]
+
+# [[u'version', [(u'number', u'$Revision: 7825 $')]]]
+versionNumber = findTagsInFile(windowsZonesPath, "version")[0][1][0][1]
+
+mapTimezones = findTagsInFile(windowsZonesPath, "windowsZones/mapTimezones")
+
+defaultDict = {}
+windowsIdDict = {}
+
+if mapTimezones:
+ badZones = set()
+ for mapZone in mapTimezones:
+ # [u'mapZone', [(u'territory', u'MH'), (u'other', u'UTC+12'), (u'type', u'Pacific/Majuro Pacific/Kwajalein')]]
+ if mapZone[0] == u'mapZone':
+ data = {}
+ for attribute in mapZone[1]:
+ if attribute[0] == u'other':
+ data['windowsId'] = attribute[1]
+ if attribute[0] == u'territory':
+ data['countryCode'] = attribute[1]
+ if attribute[0] == u'type':
+ data['ianaList'] = attribute[1]
+
+ data['windowsKey'] = windowsIdToKey(data['windowsId'])
+ if data['windowsKey'] <= 0:
+ badZones.add(data['windowsId'])
+
+ countryId = 0
+ if data['countryCode'] == u'001':
+ defaultDict[data['windowsKey']] = data['ianaList']
+ else:
+ data['countryId'] = enumdata.countryCodeToId(data['countryCode'])
+ if data['countryId'] < 0:
+ raise xpathlite.Error("Unknown Country Code \"%s\"" % data['countryCode'])
+ data['country'] = enumdata.country_list[data['countryId']][0]
+ windowsIdDict[data['windowsKey'], data['countryId']] = data
+ if badZones:
+ sys.stderr.write('\n\t'.join(["\nUnknown Windows ID, please add:"] + sorted(badZones))
+ + "\nto the windowIdList in cldr2qtimezone.py\n\n")
+ raise xpathlite.Error("Unknown Windows IDs")
+
+print "Input file parsed, now writing data"
+
+GENERATED_BLOCK_START = "// GENERATED PART STARTS HERE\n"
+GENERATED_BLOCK_END = "// GENERATED PART ENDS HERE\n"
+
+# Create a temp file to write the new data into
+(newTempFile, newTempFilePath) = tempfile.mkstemp("qtimezone_data_p", dir=tempFileDir)
+newTempFile = os.fdopen(newTempFile, "w")
+
+# Open the old file and copy over the first non-generated section to the new file
+oldDataFile = open(dataFilePath, "r")
+s = oldDataFile.readline()
+while s and s != GENERATED_BLOCK_START:
+ newTempFile.write(s)
+ s = oldDataFile.readline()
+
+# Write out generated block start tag and warning
+newTempFile.write(GENERATED_BLOCK_START)
+newTempFile.write("""
+/*
+ This part of the file was generated on %s from the
+ Common Locale Data Repository v%s supplemental/windowsZones.xml file %s
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this code: run cldr2qtimezone.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+""" % (str(datetime.date.today()), cldr_version, versionNumber) )
+
+windowsIdData = ByteArrayData()
+ianaIdData = ByteArrayData()
+
+# Write Windows/IANA table
+newTempFile.write("// Windows ID Key, Country Enum, IANA ID Index\n")
+newTempFile.write("static const QZoneData zoneDataTable[] = {\n")
+for index in sorted(windowsIdDict):
+ data = windowsIdDict[index]
+ newTempFile.write(" { %6d,%6d,%6d }, // %s / %s\n"
+ % (data['windowsKey'],
+ data['countryId'],
+ ianaIdData.append(data['ianaList']),
+ data['windowsId'],
+ data['country']))
+newTempFile.write(" { 0, 0, 0 } // Trailing zeroes\n")
+newTempFile.write("};\n\n")
+
+print "Done Zone Data"
+
+# Write Windows ID key table
+newTempFile.write("// Windows ID Key, Windows ID Index, IANA ID Index, UTC Offset\n")
+newTempFile.write("static const QWindowsData windowsDataTable[] = {\n")
+for index, pair in enumerate(windowsIdList):
+ newTempFile.write(" { %6d,%6d,%6d,%6d }, // %s\n"
+ % (index + 1, windowsIdData.append(pair[0]),
+ ianaIdData.append(defaultDict[index + 1]), pair[1], pair[0]))
+newTempFile.write(" { 0, 0, 0, 0 } // Trailing zeroes\n")
+newTempFile.write("};\n\n")
+
+print "Done Windows Data Table"
+
+# Write UTC ID key table
+newTempFile.write("// IANA ID Index, UTC Offset\n")
+newTempFile.write("static const QUtcData utcDataTable[] = {\n")
+for pair in utcIdList:
+ newTempFile.write(" { %6d,%6d }, // %s\n"
+ % (ianaIdData.append(pair[0]), pair[1], pair[0]))
+newTempFile.write(" { 0, 0 } // Trailing zeroes\n")
+newTempFile.write("};\n\n")
+
+print "Done UTC Data Table"
+
+# Write out Windows ID's data
+newTempFile.write("static const char windowsIdData[] = {\n")
+newTempFile.write(wrap_list(windowsIdData.data))
+newTempFile.write("\n};\n\n")
+
+# Write out IANA ID's data
+newTempFile.write("static const char ianaIdData[] = {\n")
+newTempFile.write(wrap_list(ianaIdData.data))
+newTempFile.write("\n};\n")
+
+print "Done ID Data Table"
+
+# Write out the end of generated block tag
+newTempFile.write(GENERATED_BLOCK_END)
+s = oldDataFile.readline()
+
+# Skip through the old generated data in the old file
+while s and s != GENERATED_BLOCK_END:
+ s = oldDataFile.readline()
+
+# Now copy the rest of the original file into the new file
+s = oldDataFile.readline()
+while s:
+ newTempFile.write(s)
+ s = oldDataFile.readline()
+
+# Now close the old and new file, delete the old file and copy the new file in its place
+newTempFile.close()
+oldDataFile.close()
+os.remove(dataFilePath)
+os.rename(newTempFilePath, dataFilePath)
+
+print "Data generation completed, please check the new file at " + dataFilePath
diff --git a/util/local_database/dateconverter.py b/util/locale_database/dateconverter.py
index 1990fe0c61..1990fe0c61 100755
--- a/util/local_database/dateconverter.py
+++ b/util/locale_database/dateconverter.py
diff --git a/util/local_database/enumdata.py b/util/locale_database/enumdata.py
index 26bb74d1fe..4b4febf002 100644
--- a/util/local_database/enumdata.py
+++ b/util/locale_database/enumdata.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2019 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of the Qt Toolkit.
@@ -402,6 +402,11 @@ language_list = {
362: ["Sicilian", "scn"],
363: ["Southern Kurdish", "sdh"],
364: ["Western Balochi", "bgn"],
+ 365: ["Cebuano", "ceb"],
+ 366: ["Erzya", "myv"],
+ 367: ["Chickasaw", "cic"],
+ 368: ["Muscogee", "mus"],
+ 369: ["Silesian", "szl"],
}
language_aliases = {
diff --git a/util/local_database/formattags.txt b/util/locale_database/formattags.txt
index 5138c37a81..5138c37a81 100644
--- a/util/local_database/formattags.txt
+++ b/util/locale_database/formattags.txt
diff --git a/util/local_database/localexml.py b/util/locale_database/localexml.py
index e95b3aebcc..9b353f5122 100644
--- a/util/local_database/localexml.py
+++ b/util/locale_database/localexml.py
@@ -1,6 +1,7 @@
+# coding=utf8
#############################################################################
##
-## Copyright (C) 2017 The Qt Company Ltd.
+## Copyright (C) 2018 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of the Qt Toolkit.
@@ -113,12 +114,11 @@ def convertFormat(format):
return result
class Locale:
- # Tool used during class body (see del below), not method:
- def propsMonthDay(lengths=('long', 'short', 'narrow'), scale=('months', 'days')):
+ @staticmethod
+ def propsMonthDay(scale, lengths=('long', 'short', 'narrow')):
for L in lengths:
- for S in scale:
- yield camelCase((L, S))
- yield camelCase(('standalone', L, S))
+ yield camelCase((L, scale))
+ yield camelCase(('standalone', L, scale))
# Expected to be numbers, read with int():
__asint = ("decimal", "group", "zero",
@@ -137,15 +137,13 @@ class Locale:
"listPatternPartEnd", "listPatternPartTwo", "am", "pm",
'byte_unit', 'byte_si_quantified', 'byte_iec_quantified',
"currencyIsoCode", "currencySymbol", "currencyDisplayName",
- "currencyFormat", "currencyNegativeFormat"
- ) + tuple(propsMonthDay())
- del propsMonthDay
+ "currencyFormat", "currencyNegativeFormat")
# Day-of-Week numbering used by Qt:
__qDoW = {"mon": 1, "tue": 2, "wed": 3, "thu": 4, "fri": 5, "sat": 6, "sun": 7}
@classmethod
- def fromXmlData(cls, lookup):
+ def fromXmlData(cls, lookup, calendars=('gregorian',)):
"""Constructor from the contents of XML elements.
Single parameter, lookup, is called with the names of XML
@@ -170,12 +168,15 @@ class Locale:
for k in cls.__asfmt:
data[k] = convertFormat(lookup(k))
- for k in cls.__astxt:
+ for k in cls.__astxt + tuple(cls.propsMonthDay('days')):
data[k] = lookup(k)
+ for k in cls.propsMonthDay('months'):
+ data[k] = dict((cal, lookup('_'.join((k, cal)))) for cal in calendars)
+
return cls(data)
- def toXml(self, indent=' ', tab=' '):
+ def toXml(self, calendars=('gregorian',), indent=' ', tab=' '):
print indent + '<locale>'
inner = indent + tab
get = lambda k: getattr(self, k)
@@ -199,13 +200,14 @@ class Locale:
'weekendStart', 'weekendEnd',
'longDateFormat', 'shortDateFormat',
'longTimeFormat', 'shortTimeFormat',
- 'standaloneLongMonths', 'standaloneShortMonths',
- 'standaloneNarrowMonths',
- 'longMonths', 'shortMonths', 'narrowMonths',
'longDays', 'shortDays', 'narrowDays',
'standaloneLongDays', 'standaloneShortDays', 'standaloneNarrowDays',
'currencyIsoCode', 'currencySymbol', 'currencyDisplayName',
- 'currencyFormat', 'currencyNegativeFormat'):
+ 'currencyFormat', 'currencyNegativeFormat'
+ ) + tuple(self.propsMonthDay('days')) + tuple(
+ '_'.join((k, cal))
+ for k in self.propsMonthDay('months')
+ for cal in calendars):
ent = camelCase(key.split('_')) if key.endswith('_endonym') else key
print inner + "<%s>%s</%s>" % (ent, escape(get(key)).encode('utf-8'), ent)
@@ -218,16 +220,70 @@ class Locale:
if data: self.__dict__.update(data)
if kw: self.__dict__.update(kw)
+ # Tools used by __monthNames:
+ def fullName(i, name): return name
+ def firstThree(i, name): return name[:3]
+ def initial(i, name): return name[:1]
+ def number(i, name): return str(i + 1)
+ def islamicShort(i, name):
+ if not name: return name
+ if name == 'Shawwal': return 'Shaw.'
+ words = name.split()
+ if words[0].startswith('Dhu'):
+ words[0] = words[0][:7] + '.'
+ elif len(words[0]) > 3:
+ words[0] = words[0][:3] + '.'
+ return ' '.join(words)
+ @staticmethod
+ def __monthNames(calendars,
+ known={ # Map calendar to (names, extractors...):
+ 'gregorian': (('January', 'February', 'March', 'April', 'May', 'June', 'July',
+ 'August', 'September', 'October', 'November', 'December'),
+ # Extractor pairs, (plain, standalone)
+ (fullName, fullName), # long
+ (firstThree, firstThree), # short
+ (number, initial)), # narrow
+ 'persian': (('Farvardin', 'Ordibehesht', 'Khordad', 'Tir', 'Mordad',
+ 'Shahrivar', 'Mehr', 'Aban', 'Azar', 'Dey', 'Bahman', 'Esfand'),
+ (fullName, fullName),
+ (firstThree, firstThree),
+ (number, initial)),
+ 'islamic': ((u'Muharram', u'Safar', u'Rabiʻ I', u'Rabiʻ II', u'Jumada I',
+ u'Jumada II', u'Rajab', u'Shaʻban', u'Ramadan', u'Shawwal',
+ u'Dhuʻl-Qiʻdah', u'Dhuʻl-Hijjah'),
+ (fullName, fullName),
+ (islamicShort, islamicShort),
+ (number, number)),
+ 'hebrew': (('Tishri', 'Heshvan', 'Kislev', 'Tevet', 'Shevat', 'Adar I',
+ 'Adar', 'Nisan', 'Iyar', 'Sivan', 'Tamuz', 'Av'),
+ (fullName, fullName),
+ (fullName, fullName),
+ (number, number)),
+ },
+ sizes=('long', 'short', 'narrow')):
+ for cal in calendars:
+ try:
+ data = known[cal]
+ except KeyError: # Need to add an entry to known, above.
+ print 'Unsupported calendar:', cal
+ raise
+ names, get = data[0] + ('',), data[1:]
+ for n, size in enumerate(sizes):
+ yield ('_'.join((camelCase((size, 'months')), cal)),
+ ';'.join(get[n][0](i, x) for i, x in enumerate(names)))
+ yield ('_'.join((camelCase(('standalone', size, 'months')), cal)),
+ ';'.join(get[n][1](i, x) for i, x in enumerate(names)))
+ del fullName, firstThree, initial, number, islamicShort
+
@classmethod
- def C(cls,
- # Empty entries at end to ensure final separator when join()ed:
- months = ('January', 'February', 'March', 'April', 'May', 'June', 'July',
- 'August', 'September', 'October', 'November', 'December', ''),
+ def C(cls, calendars=('gregorian',),
+ # Empty entry at end to ensure final separator when join()ed:
days = ('Sunday', 'Monday', 'Tuesday', 'Wednesday',
'Thursday', 'Friday', 'Saturday', ''),
quantifiers=('k', 'M', 'G', 'T', 'P', 'E')):
"""Returns an object representing the C locale."""
- return cls(language='C', language_code='0', language_endonym='',
+ return cls(dict(cls.__monthNames(calendars)),
+ language='C', language_code='0', language_endonym='',
script='AnyScript', script_code='0',
country='AnyCountry', country_code='0', country_endonym='',
decimal='.', group=',', list=';', percent='%',
@@ -245,12 +301,6 @@ class Locale:
weekendStart='sat', weekendEnd='sun',
longDateFormat='EEEE, d MMMM yyyy', shortDateFormat='d MMM yyyy',
longTimeFormat='HH:mm:ss z', shortTimeFormat='HH:mm:ss',
- longMonths=';'.join(months),
- shortMonths=';'.join(m[:3] for m in months),
- narrowMonths='1;2;3;4;5;6;7;8;9;10;11;12;',
- standaloneLongMonths=';'.join(months),
- standaloneShortMonths=';'.join(m[:3] for m in months),
- standaloneNarrowMonths=';'.join(m[:1] for m in months),
longDays=';'.join(days),
shortDays=';'.join(d[:3] for d in days),
narrowDays='7;1;2;3;4;5;6;',
diff --git a/util/local_database/qlocalexml2cpp.py b/util/locale_database/qlocalexml2cpp.py
index fb5ae5ba54..52e6331569 100755
--- a/util/local_database/qlocalexml2cpp.py
+++ b/util/locale_database/qlocalexml2cpp.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
#############################################################################
##
-## Copyright (C) 2017 The Qt Company Ltd.
+## Copyright (C) 2018 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of the Qt Toolkit.
@@ -42,6 +42,24 @@ from enumdata import language_aliases, country_aliases, script_aliases
from localexml import Locale
+# TODO: Make calendars a command-line parameter
+# map { CLDR name: Qt file name }
+calendars = {'gregorian': 'roman', 'persian': 'jalali', 'islamic': 'hijri',} # 'hebrew': 'hebrew',
+
+generated_template = """
+/*
+ This part of the file was generated on %s from the
+ Common Locale Data Repository v%s
+
+ http://www.unicode.org/cldr/
+
+ Do not edit this section: instead regenerate it using
+ cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
+ edited) CLDR data; see qtbase/util/locale_database/.
+*/
+
+"""
+
class Error:
def __init__(self, msg):
self.msg = msg
@@ -151,7 +169,7 @@ def loadLocaleMap(doc, language_map, script_map, country_map, likely_subtags_map
result = {}
for locale_elt in eachEltInGroup(doc.documentElement, "localeList", "locale"):
- locale = Locale.fromXmlData(lambda k: firstChildText(locale_elt, k))
+ locale = Locale.fromXmlData(lambda k: firstChildText(locale_elt, k), calendars.keys())
language_id = languageNameToId(locale.language, language_map)
if language_id == -1:
sys.stderr.write("Cannot find a language id for '%s'\n" % locale.language)
@@ -254,6 +272,7 @@ class StringData:
self.data = []
self.hash = {}
self.name = name
+
def append(self, s):
if s in self.hash:
return self.hash[s]
@@ -279,6 +298,11 @@ class StringData:
self.data += lst
return token
+ def write(self, fd):
+ fd.write("\nstatic const ushort %s[] = {\n" % self.name)
+ fd.write(wrap_list(self.data))
+ fd.write("\n};\n")
+
def escapedString(s):
result = ""
i = 0
@@ -333,13 +357,13 @@ def main():
qtsrcdir = sys.argv[2]
if not (os.path.isdir(qtsrcdir)
- and all(os.path.isfile(os.path.join(qtsrcdir, 'src', 'corelib', 'tools', leaf))
+ and all(os.path.isfile(os.path.join(qtsrcdir, 'src', 'corelib', 'text', leaf))
for leaf in ('qlocale_data_p.h', 'qlocale.h', 'qlocale.qdoc'))):
usage()
(data_temp_file, data_temp_file_path) = tempfile.mkstemp("qlocale_data_p", dir=qtsrcdir)
data_temp_file = os.fdopen(data_temp_file, "w")
- qlocaledata_file = open(qtsrcdir + "/src/corelib/tools/qlocale_data_p.h", "r")
+ qlocaledata_file = open(qtsrcdir + "/src/corelib/text/qlocale_data_p.h", "r")
s = qlocaledata_file.readline()
while s and s != GENERATED_BLOCK_START:
data_temp_file.write(s)
@@ -360,20 +384,7 @@ def main():
dupes = findDupes(language_map, country_map)
cldr_version = firstChildText(doc.documentElement, "version")
-
- data_temp_file.write("""
-/*
- This part of the file was generated on %s from the
- Common Locale Data Repository v%s
-
- http://www.unicode.org/cldr/
-
- Do not edit this section: instead regenerate it using
- cldr2qlocalexml.py and qlocalexml2cpp.py on updated (or
- edited) CLDR data; see qtbase/util/local_database/.
-*/
-
-""" % (str(datetime.date.today()), cldr_version) )
+ data_temp_file.write(generated_template % (datetime.date.today(), cldr_version))
# Likely subtags map
data_temp_file.write("static const QLocaleId likely_subtags[] = {\n")
@@ -442,7 +453,6 @@ def main():
list_pattern_part_data = StringData('list_pattern_part_data')
date_format_data = StringData('date_format_data')
time_format_data = StringData('time_format_data')
- months_data = StringData('months_data')
days_data = StringData('days_data')
am_data = StringData('am_data')
pm_data = StringData('pm_data')
@@ -482,12 +492,6 @@ def main():
+ ' lDtFmt '
+ ' sTmFmt ' # Time format
+ ' lTmFmt '
- + ' ssMonth ' # Months
- + ' slMonth '
- + ' snMonth '
- + ' sMonth '
- + ' lMonth '
- + ' nMonth '
+ ' ssDays ' # Days
+ ' slDays '
+ ' snDays '
@@ -532,7 +536,7 @@ def main():
# Quotation marks:
+ '%8d,' * 4
# List patterns, date/time formats, month/day names, am/pm:
- + '%11s,' * 22
+ + '%11s,' * 16
# SI/IEC byte-unit abbreviations:
+ '%8s,' * 3
# Currency ISO code:
@@ -568,12 +572,6 @@ def main():
date_format_data.append(l.longDateFormat),
time_format_data.append(l.shortTimeFormat),
time_format_data.append(l.longTimeFormat),
- months_data.append(l.standaloneShortMonths),
- months_data.append(l.standaloneLongMonths),
- months_data.append(l.standaloneNarrowMonths),
- months_data.append(l.shortMonths),
- months_data.append(l.longMonths),
- months_data.append(l.narrowMonths),
days_data.append(l.standaloneShortDays),
days_data.append(l.standaloneLongDays),
days_data.append(l.standaloneNarrowDays),
@@ -599,7 +597,7 @@ def main():
l.weekendEnd)
+ ", // %s/%s/%s\n" % (l.language, l.script, l.country))
data_temp_file.write(line_format # All zeros, matching the format:
- % ( (0,) * (3 + 8 + 4) + ("0,0",) * (22 + 3)
+ % ( (0,) * (3 + 8 + 4) + ("0,0",) * (16 + 3)
+ (currencyIsoCodeData(0),)
+ ("0,0",) * 6 + (0,) * (2 + 3))
+ " // trailing 0s\n")
@@ -607,13 +605,11 @@ def main():
# StringData tables:
for data in (list_pattern_part_data, date_format_data,
- time_format_data, months_data, days_data,
+ time_format_data, days_data,
byte_unit_data, am_data, pm_data, currency_symbol_data,
currency_display_name_data, currency_format_data,
endonyms_data):
- data_temp_file.write("\nstatic const ushort %s[] = {\n" % data.name)
- data_temp_file.write(wrap_list(data.data))
- data_temp_file.write("\n};\n")
+ data.write(data_temp_file)
data_temp_file.write("\n")
@@ -735,14 +731,70 @@ def main():
data_temp_file.close()
qlocaledata_file.close()
- os.remove(qtsrcdir + "/src/corelib/tools/qlocale_data_p.h")
- os.rename(data_temp_file_path, qtsrcdir + "/src/corelib/tools/qlocale_data_p.h")
+ os.remove(qtsrcdir + "/src/corelib/text/qlocale_data_p.h")
+ os.rename(data_temp_file_path, qtsrcdir + "/src/corelib/text/qlocale_data_p.h")
+
+ # Generate calendar data
+ calendar_format = ' {%6d,%6d,%6d,{%5s},{%5s},{%5s},{%5s},{%5s},{%5s}}, '
+ for calendar, stem in calendars.items():
+ months_data = StringData('months_data')
+ calendar_data_file = "q%scalendar_data_p.h" % stem
+ calendar_template_file = open(os.path.join(qtsrcdir, 'src', 'corelib', 'time',
+ calendar_data_file), "r")
+ (calendar_temp_file, calendar_temp_file_path) = tempfile.mkstemp(calendar_data_file, dir=qtsrcdir)
+ calendar_temp_file = os.fdopen(calendar_temp_file, "w")
+ s = calendar_template_file.readline()
+ while s and s != GENERATED_BLOCK_START:
+ calendar_temp_file.write(s)
+ s = calendar_template_file.readline()
+ calendar_temp_file.write(GENERATED_BLOCK_START)
+ calendar_temp_file.write(generated_template % (datetime.date.today(), cldr_version))
+ calendar_temp_file.write("static const QCalendarLocale locale_data[] = {\n")
+ calendar_temp_file.write(' // '
+ # IDs, width 7 (6 + comma)
+ + ' lang '
+ + ' script'
+ + ' terr '
+ # Month-name start-end pairs, width 8 (5 plus '{},'):
+ + ' sShort '
+ + ' sLong '
+ + ' sNarrow'
+ + ' short '
+ + ' long '
+ + ' narrow'
+ # No trailing space on last; be sure
+ # to pad before adding later entries.
+ + '\n')
+ for key in locale_keys:
+ l = locale_map[key]
+ calendar_temp_file.write(
+ calendar_format
+ % (key[0], key[1], key[2],
+ months_data.append(l.standaloneShortMonths[calendar]),
+ months_data.append(l.standaloneLongMonths[calendar]),
+ months_data.append(l.standaloneNarrowMonths[calendar]),
+ months_data.append(l.shortMonths[calendar]),
+ months_data.append(l.longMonths[calendar]),
+ months_data.append(l.narrowMonths[calendar]))
+ + "// %s/%s/%s\n " % (l.language, l.script, l.country))
+ calendar_temp_file.write(calendar_format % ( (0,) * 3 + ('0,0',) * 6 )
+ + '// trailing zeros\n')
+ calendar_temp_file.write("};\n")
+ months_data.write(calendar_temp_file)
+ s = calendar_template_file.readline()
+ while s and s != GENERATED_BLOCK_END:
+ s = calendar_template_file.readline()
+ while s:
+ calendar_temp_file.write(s)
+ s = calendar_template_file.readline()
+ os.rename(calendar_temp_file_path,
+ os.path.join(qtsrcdir, 'src', 'corelib', 'time', calendar_data_file))
# qlocale.h
(qlocaleh_temp_file, qlocaleh_temp_file_path) = tempfile.mkstemp("qlocale.h", dir=qtsrcdir)
qlocaleh_temp_file = os.fdopen(qlocaleh_temp_file, "w")
- qlocaleh_file = open(qtsrcdir + "/src/corelib/tools/qlocale.h", "r")
+ qlocaleh_file = open(qtsrcdir + "/src/corelib/text/qlocale.h", "r")
s = qlocaleh_file.readline()
while s and s != GENERATED_BLOCK_START:
qlocaleh_temp_file.write(s)
@@ -808,14 +860,14 @@ def main():
qlocaleh_temp_file.close()
qlocaleh_file.close()
- os.remove(qtsrcdir + "/src/corelib/tools/qlocale.h")
- os.rename(qlocaleh_temp_file_path, qtsrcdir + "/src/corelib/tools/qlocale.h")
+ os.remove(qtsrcdir + "/src/corelib/text/qlocale.h")
+ os.rename(qlocaleh_temp_file_path, qtsrcdir + "/src/corelib/text/qlocale.h")
# qlocale.qdoc
(qlocaleqdoc_temp_file, qlocaleqdoc_temp_file_path) = tempfile.mkstemp("qlocale.qdoc", dir=qtsrcdir)
qlocaleqdoc_temp_file = os.fdopen(qlocaleqdoc_temp_file, "w")
- qlocaleqdoc_file = open(qtsrcdir + "/src/corelib/tools/qlocale.qdoc", "r")
+ qlocaleqdoc_file = open(qtsrcdir + "/src/corelib/text/qlocale.qdoc", "r")
s = qlocaleqdoc_file.readline()
DOCSTRING = " QLocale's data is based on Common Locale Data Repository "
while s:
@@ -827,8 +879,8 @@ def main():
qlocaleqdoc_temp_file.close()
qlocaleqdoc_file.close()
- os.remove(qtsrcdir + "/src/corelib/tools/qlocale.qdoc")
- os.rename(qlocaleqdoc_temp_file_path, qtsrcdir + "/src/corelib/tools/qlocale.qdoc")
+ os.remove(qtsrcdir + "/src/corelib/text/qlocale.qdoc")
+ os.rename(qlocaleqdoc_temp_file_path, qtsrcdir + "/src/corelib/text/qlocale.qdoc")
if __name__ == "__main__":
main()
diff --git a/util/local_database/testlocales/localemodel.cpp b/util/locale_database/testlocales/localemodel.cpp
index d380d01e09..d380d01e09 100644
--- a/util/local_database/testlocales/localemodel.cpp
+++ b/util/locale_database/testlocales/localemodel.cpp
diff --git a/util/local_database/testlocales/localemodel.h b/util/locale_database/testlocales/localemodel.h
index b24fc5f4c6..b24fc5f4c6 100644
--- a/util/local_database/testlocales/localemodel.h
+++ b/util/locale_database/testlocales/localemodel.h
diff --git a/util/local_database/testlocales/localewidget.cpp b/util/locale_database/testlocales/localewidget.cpp
index 3ff7f73a98..3ff7f73a98 100644
--- a/util/local_database/testlocales/localewidget.cpp
+++ b/util/locale_database/testlocales/localewidget.cpp
diff --git a/util/local_database/testlocales/localewidget.h b/util/locale_database/testlocales/localewidget.h
index 896a6e5229..896a6e5229 100644
--- a/util/local_database/testlocales/localewidget.h
+++ b/util/locale_database/testlocales/localewidget.h
diff --git a/util/local_database/testlocales/main.cpp b/util/locale_database/testlocales/main.cpp
index 0c3c45f989..0c3c45f989 100644
--- a/util/local_database/testlocales/main.cpp
+++ b/util/locale_database/testlocales/main.cpp
diff --git a/util/local_database/testlocales/testlocales.pro b/util/locale_database/testlocales/testlocales.pro
index a9a6247f96..a9a6247f96 100644
--- a/util/local_database/testlocales/testlocales.pro
+++ b/util/locale_database/testlocales/testlocales.pro
diff --git a/util/local_database/xpathlite.py b/util/locale_database/xpathlite.py
index 218135d7a7..97efaaab41 100644
--- a/util/local_database/xpathlite.py
+++ b/util/locale_database/xpathlite.py
@@ -78,14 +78,38 @@ def findChild(parent, tag_name, arg_name=None, arg_value=None, draft=None):
return node
return False
+def codeMapsFromFile(file):
+ """Extract mappings of language, script and country codes to names.
+
+ The file shall typically be common/main/en.xml, which contains a
+ localeDisplayNames element with children languages, scripts and
+ territories; each element in each of these has a code as its type
+ attribute and its name as element content. This returns a mapping
+ withe keys 'language', 'script' and 'country', each of which
+ has, as value, a mapping of the relevant codes to names.
+ """
+ parent = findChild(findChild(parseDoc(file), 'ldml'), 'localeDisplayNames')
+ keys, result = {'languages': 'language', 'scripts': 'script', 'territories': 'country'}, {}
+ for src, dst in keys.items():
+ child = findChild(parent, src)
+ data = result[dst] = {}
+ for elt in child.childNodes:
+ if elt.attributes and elt.attributes.has_key('type'):
+ key, value = elt.attributes['type'].value, elt.childNodes[0].wholeText
+ # Don't over-write previously-read data for an alt form:
+ if elt.attributes.has_key('alt') and data.has_key(key):
+ continue
+ data[key] = value
+
+ return result
+
def findTagsInFile(file, path):
doc = parseDoc(file)
elt = doc.documentElement
tag_spec_list = path.split("/")
last_entry = None
- for i in range(len(tag_spec_list)):
- tag_spec = tag_spec_list[i]
+ for tag_spec in tag_spec_list:
tag_name = tag_spec
arg_name = 'type'
arg_value = ''
diff --git a/src/tools/qfloat16-tables/gen_qfloat16_tables.cpp b/util/qfloat16-tables/gen_qfloat16_tables.cpp
index 6f0997bc25..5d7bab01d2 100644
--- a/src/tools/qfloat16-tables/gen_qfloat16_tables.cpp
+++ b/util/qfloat16-tables/gen_qfloat16_tables.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 by Southwest Research Institute (R)
+** Copyright (C) 2019 Intel Corporation.
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -37,13 +38,25 @@
**
****************************************************************************/
-#include <qfile.h>
-#include <qdebug.h>
-
-quint32 convertmantissa(qint32 i)
+#include <stdint.h>
+#include <stdio.h>
+
+/*
+ * This tool generates the tables used by qfloat16 to implement a
+ * software-emulated version of IEEE 754 binary16. qfloat16 automatically uses
+ * CPU instructions to convert to and from float (IEEE 754 binary32), but if
+ * the CPU is not guaranteed to have those instructions available at compile
+ * time, then qfloat16 needs the tables to perform the conversion with
+ * reasonable performance.
+ *
+ * Because Qt requires float to be IEEE 754 binary32, these tables are
+ * platform-independent and will never change.
+ */
+
+uint32_t convertmantissa(int32_t i)
{
- quint32 m = i << 13; // Zero pad mantissa bits
- quint32 e = 0; // Zero exponent
+ uint32_t m = i << 13; // Zero pad mantissa bits
+ uint32_t e = 0; // Zero exponent
while (!(m & 0x00800000)) { // While not normalized
e -= 0x00800000; // Decrement exponent (1<<23)
@@ -56,60 +69,48 @@ quint32 convertmantissa(qint32 i)
// we first build these tables up and then print them out as a separate step in order
// to more closely map the implementation given in the paper.
-quint32 basetable[512];
-quint32 shifttable[512];
-
-#define PRINTHEX(a) "0x" + QByteArray::number(a,16).toUpper() + "U,\n"
+uint32_t basetable[512];
+uint32_t shifttable[512];
-qint32 main(qint32 argc, char **argv)
+int main()
{
- if (argc < 2) {
- qWarning() << "Must provide output filename as argument.";
- return -1;
- }
-
- QFile fid(QFile::decodeName(argv[1]));
- if (!fid.open(QIODevice::WriteOnly | QIODevice::Text)) {
- qWarning() << "Abort: Failed to open/create file" << fid.fileName();
- return -1;
- }
- quint32 i;
+ uint32_t i;
- fid.write("/* This file was generated by gen_qfloat16_tables.cpp */\n\n");
- fid.write("#include <QtCore/qfloat16.h>\n\n");
+ printf("/* This file was generated by util/qfloat16-tables/gen_qfloat16_tables.cpp */\n\n");
+ printf("#include <QtCore/qfloat16.h>\n\n");
- fid.write("QT_BEGIN_NAMESPACE\n\n");
- fid.write("#if !defined(__ARM_FP16_FORMAT_IEEE)\n\n");
+ printf("QT_BEGIN_NAMESPACE\n\n");
+ printf("#if !defined(__ARM_FP16_FORMAT_IEEE)\n\n");
- fid.write("const quint32 qfloat16::mantissatable[2048] = {\n");
- fid.write("0,\n");
+ printf("const quint32 qfloat16::mantissatable[2048] = {\n");
+ printf("0,\n");
for (i = 1; i < 1024; i++)
- fid.write(PRINTHEX(convertmantissa(i)));
+ printf("0x%XU,\n", convertmantissa(i));
for (i = 1024; i < 2048; i++)
- fid.write(PRINTHEX(0x38000000U + ((i - 1024) << 13)));
- fid.write("};\n\n");
+ printf("0x%XU,\n", 0x38000000U + ((i - 1024) << 13));
+ printf("};\n\n");
- fid.write("const quint32 qfloat16::exponenttable[64] = {\n");
- fid.write("0,\n");
+ printf("const quint32 qfloat16::exponenttable[64] = {\n");
+ printf("0,\n");
for (i = 1; i < 31; i++)
- fid.write(PRINTHEX(i << 23));
- fid.write("0x47800000U,\n"); // 31
- fid.write("0x80000000U,\n"); // 32
+ printf("0x%XU,\n", i << 23);
+ printf("0x47800000U,\n"); // 31
+ printf("0x80000000U,\n"); // 32
for (i = 33; i < 63; i++)
- fid.write(PRINTHEX(0x80000000U + ((i - 32) << 23)));
- fid.write("0xC7800000U,\n"); // 63
- fid.write("};\n\n");
+ printf("0x%XU,\n", 0x80000000U + ((i - 32) << 23));
+ printf("0xC7800000U,\n"); // 63
+ printf("};\n\n");
- fid.write("const quint32 qfloat16::offsettable[64] = {\n");
- fid.write("0,\n");
+ printf("const quint32 qfloat16::offsettable[64] = {\n");
+ printf("0,\n");
for (i = 1; i < 32; i++)
- fid.write("1024U,\n");
- fid.write("0,\n");
+ printf("1024U,\n");
+ printf("0,\n");
for (i = 33; i < 64; i++)
- fid.write("1024U,\n");
- fid.write("};\n\n");
+ printf("1024U,\n");
+ printf("};\n\n");
- qint32 e;
+ int32_t e;
for (i = 0; i < 256; ++i) {
e = i - 127;
if (e < -24) { // Very small numbers map to zero
@@ -144,20 +145,19 @@ qint32 main(qint32 argc, char **argv)
}
}
- fid.write("const quint32 qfloat16::basetable[512] = {\n");
+ printf("const quint32 qfloat16::basetable[512] = {\n");
for (i = 0; i < 512; i++)
- fid.write(PRINTHEX(basetable[i]));
+ printf("0x%XU,\n", basetable[i]);
- fid.write("};\n\n");
+ printf("};\n\n");
- fid.write("const quint32 qfloat16::shifttable[512] = {\n");
+ printf("const quint32 qfloat16::shifttable[512] = {\n");
for (i = 0; i < 512; i++)
- fid.write(PRINTHEX(shifttable[i]));
+ printf("0x%XU,\n", shifttable[i]);
- fid.write("};\n\n");
+ printf("};\n\n");
- fid.write("#endif // !__ARM_FP16_FORMAT_IEEE\n\n");
- fid.write("QT_END_NAMESPACE\n");
- fid.close();
+ printf("#endif // !__ARM_FP16_FORMAT_IEEE\n\n");
+ printf("QT_END_NAMESPACE\n");
return 0;
}
diff --git a/util/qfloat16-tables/qfloat16-tables.pro b/util/qfloat16-tables/qfloat16-tables.pro
new file mode 100644
index 0000000000..3c9a1e61a3
--- /dev/null
+++ b/util/qfloat16-tables/qfloat16-tables.pro
@@ -0,0 +1,2 @@
+QT = core
+SOURCES += gen_qfloat16_tables.cpp
diff --git a/util/unicode/README b/util/unicode/README
index e52f26175a..1f14459d14 100644
--- a/util/unicode/README
+++ b/util/unicode/README
@@ -1,4 +1,4 @@
-Unicode is used to generate the unicode data in src/corelib/tools.
+Unicode is used to generate the unicode data in src/corelib/text/.
To update:
* Find the data (UAX #44, UCD; not the XML version) at
@@ -19,9 +19,9 @@ To update:
need to be expanded, for example. In some cases QChar may need
additions to some of its enums.
* Build with the modified code, fix any compilation issues.
-* That may have updated qtbase/src/corelib/tools/qunicodetables.cpp;
+* That may have updated qtbase/src/corelib/text/qunicodetables.cpp;
if so the update matters; be sure to commit the changes to data/ at
- the same time and update tools/qt_attribution.json to match; use the
+ the same time and update text/qt_attribution.json to match; use the
UCD Revision number, rather than the Unicode standard number, as the
Version, for all that qunicodetables.cpp uses the latter.
diff --git a/util/unicode/codecs/big5/main.cpp b/util/unicode/codecs/big5/main.cpp
index 142db74ffd..54d3839755 100644
--- a/util/unicode/codecs/big5/main.cpp
+++ b/util/unicode/codecs/big5/main.cpp
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
list += QByteArray(" { 0x" + QByteArray::number(m.b5, 16) + ", 0x" + QByteArray::number(m.uc, 16) + " }\n");;
}
QByteArray ba;
- qSort(list);
+ std::sort(list.begin(), list.end());
foreach(QByteArray a, list)
ba += a;
qDebug() << "struct B5Map b5_to_uc_map = {\n" << ba + "\n};";
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
if (!b5_ok.contains(m.uc))
list += QByteArray(" { 0x" + QByteArray::number(m.uc, 16) + ", 0x" + QByteArray::number(m.b5, 16) + " }\n");;
ba = QByteArray();
- qSort(list);
+ std::sort(list.begin(), list.end());;
foreach(QByteArray a, list)
ba += a;
qDebug() << "struct B5Map uc_to_b5_map = {\n" << ba + "\n};";
diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp
index 22a4405ca9..26cdab87d6 100644
--- a/util/unicode/main.cpp
+++ b/util/unicode/main.cpp
@@ -789,6 +789,15 @@ static void initScriptMap()
// Keep this one in sync with the code in createPropertyInfo
static const char *property_string =
+ "enum Case {\n"
+ " LowerCase,\n"
+ " UpperCase,\n"
+ " TitleCase,\n"
+ " CaseFold,\n"
+ "\n"
+ " NumCases\n"
+ "};\n"
+ "\n"
"struct Properties {\n"
" ushort category : 8; /* 5 used */\n"
" ushort direction : 8; /* 5 used */\n"
@@ -796,84 +805,51 @@ static const char *property_string =
" ushort joining : 3;\n"
" signed short digitValue : 5;\n"
" signed short mirrorDiff : 16;\n"
- " ushort lowerCaseSpecial : 1;\n"
- " signed short lowerCaseDiff : 15;\n"
+ " ushort unicodeVersion : 8; /* 5 used */\n"
+ " ushort nfQuickCheck : 8;\n" // could be narrowed
"#ifdef Q_OS_WASM\n"
" unsigned char : 0; //wasm 64 packing trick\n"
"#endif\n"
- " ushort upperCaseSpecial : 1;\n"
- " signed short upperCaseDiff : 15;\n"
- " ushort titleCaseSpecial : 1;\n"
- " signed short titleCaseDiff : 15;\n"
- " ushort caseFoldSpecial : 1;\n"
- " signed short caseFoldDiff : 15;\n"
- " ushort unicodeVersion : 8; /* 5 used */\n"
- " ushort nfQuickCheck : 8;\n" // could be narrowed
+ " struct {\n"
+ " ushort special : 1;\n"
+ " signed short diff : 15;\n"
+ " } cases[NumCases];\n"
"#ifdef Q_OS_WASM\n"
" unsigned char : 0; //wasm 64 packing trick\n"
"#endif\n"
" ushort graphemeBreakClass : 5; /* 5 used */\n"
" ushort wordBreakClass : 5; /* 5 used */\n"
- " ushort sentenceBreakClass : 8; /* 4 used */\n"
" ushort lineBreakClass : 6; /* 6 used */\n"
+ " ushort sentenceBreakClass : 8; /* 4 used */\n"
" ushort script : 8;\n"
"};\n\n"
- "Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW;\n"
- "Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW;\n"
- "\n"
- "struct LowercaseTraits\n"
- "{\n"
- " static inline signed short caseDiff(const Properties *prop)\n"
- " { return prop->lowerCaseDiff; }\n"
- " static inline bool caseSpecial(const Properties *prop)\n"
- " { return prop->lowerCaseSpecial; }\n"
- "};\n"
- "\n"
- "struct UppercaseTraits\n"
- "{\n"
- " static inline signed short caseDiff(const Properties *prop)\n"
- " { return prop->upperCaseDiff; }\n"
- " static inline bool caseSpecial(const Properties *prop)\n"
- " { return prop->upperCaseSpecial; }\n"
- "};\n"
- "\n"
- "struct TitlecaseTraits\n"
- "{\n"
- " static inline signed short caseDiff(const Properties *prop)\n"
- " { return prop->titleCaseDiff; }\n"
- " static inline bool caseSpecial(const Properties *prop)\n"
- " { return prop->titleCaseSpecial; }\n"
- "};\n"
- "\n"
- "struct CasefoldTraits\n"
- "{\n"
- " static inline signed short caseDiff(const Properties *prop)\n"
- " { return prop->caseFoldDiff; }\n"
- " static inline bool caseSpecial(const Properties *prop)\n"
- " { return prop->caseFoldSpecial; }\n"
- "};\n"
+ "Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept;\n"
+ "Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept;\n"
"\n";
static const char *methods =
- "Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW;\n"
- "inline GraphemeBreakClass graphemeBreakClass(QChar ch) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept;\n"
+ "inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept\n"
"{ return graphemeBreakClass(ch.unicode()); }\n"
"\n"
- "Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW;\n"
- "inline WordBreakClass wordBreakClass(QChar ch) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept;\n"
+ "inline WordBreakClass wordBreakClass(QChar ch) noexcept\n"
"{ return wordBreakClass(ch.unicode()); }\n"
"\n"
- "Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW;\n"
- "inline SentenceBreakClass sentenceBreakClass(QChar ch) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept;\n"
+ "inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept\n"
"{ return sentenceBreakClass(ch.unicode()); }\n"
"\n"
- "Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW;\n"
- "inline LineBreakClass lineBreakClass(QChar ch) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept;\n"
+ "inline LineBreakClass lineBreakClass(QChar ch) noexcept\n"
"{ return lineBreakClass(ch.unicode()); }\n"
"\n";
static const int SizeOfPropertiesStruct = 20;
+static const QByteArray sizeOfPropertiesStructCheck =
+ "Q_STATIC_ASSERT(sizeof(Properties) == " + QByteArray::number(SizeOfPropertiesStruct) + ");\n\n";
+
struct PropertyFlags {
bool operator==(const PropertyFlags &o) const {
return (combiningClass == o.combiningClass
@@ -2470,48 +2446,45 @@ static QByteArray createPropertyInfo()
// " signed short mirrorDiff : 16;\n"
out += QByteArray::number( p.mirrorDiff );
out += ", ";
-// " ushort lowerCaseSpecial : 1;\n"
-// " signed short lowerCaseDiff : 15;\n"
+// " ushort unicodeVersion : 8; /* 5 used */\n"
+ out += QByteArray::number( p.age );
+ out += ", ";
+// " ushort nfQuickCheck : 8;\n"
+ out += QByteArray::number( p.nfQuickCheck );
+ out += ", ";
+// " struct {\n"
+// " ushort special : 1;\n"
+// " signed short diff : 15;\n"
+// " } cases[NumCases];\n"
+ out += " { {";
out += QByteArray::number( p.lowerCaseSpecial );
out += ", ";
out += QByteArray::number( p.lowerCaseDiff );
- out += ", ";
-// " ushort upperCaseSpecial : 1;\n"
-// " signed short upperCaseDiff : 15;\n"
+ out += "}, {";
out += QByteArray::number( p.upperCaseSpecial );
out += ", ";
out += QByteArray::number( p.upperCaseDiff );
- out += ", ";
-// " ushort titleCaseSpecial : 1;\n"
-// " signed short titleCaseDiff : 15;\n"
+ out += "}, {";
out += QByteArray::number( p.titleCaseSpecial );
out += ", ";
out += QByteArray::number( p.titleCaseDiff );
- out += ", ";
-// " ushort caseFoldSpecial : 1;\n"
-// " signed short caseFoldDiff : 15;\n"
+ out += "}, {";
out += QByteArray::number( p.caseFoldSpecial );
out += ", ";
out += QByteArray::number( p.caseFoldDiff );
- out += ", ";
-// " ushort unicodeVersion : 8; /* 5 used */\n"
- out += QByteArray::number( p.age );
- out += ", ";
-// " ushort nfQuickCheck : 8;\n"
- out += QByteArray::number( p.nfQuickCheck );
- out += ", ";
+ out += "} }, ";
// " ushort graphemeBreakClass : 5; /* 5 used */\n"
// " ushort wordBreakClass : 5; /* 5 used */\n"
-// " ushort sentenceBreakClass : 8; /* 4 used */\n"
// " ushort lineBreakClass : 6; /* 6 used */\n"
out += QByteArray::number( p.graphemeBreakClass );
out += ", ";
out += QByteArray::number( p.wordBreakClass );
out += ", ";
- out += QByteArray::number( p.sentenceBreakClass );
- out += ", ";
out += QByteArray::number( p.lineBreakClass );
out += ", ";
+// " ushort sentenceBreakClass : 8; /* 4 used */\n"
+ out += QByteArray::number( p.sentenceBreakClass );
+ out += ", ";
// " ushort script : 8;\n"
out += QByteArray::number( p.script );
out += " },";
@@ -2521,42 +2494,42 @@ static QByteArray createPropertyInfo()
out += "\n};\n\n";
- out += "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) Q_DECL_NOTHROW\n"
+ out += "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(uint ucs4) noexcept\n"
"{\n"
" return uc_properties + GET_PROP_INDEX(ucs4);\n"
"}\n"
"\n"
- "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) Q_DECL_NOTHROW\n"
+ "Q_DECL_CONST_FUNCTION static inline const Properties *qGetProp(ushort ucs2) noexcept\n"
"{\n"
" return uc_properties + GET_PROP_INDEX_UCS2(ucs2);\n"
"}\n"
"\n"
- "Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) Q_DECL_NOTHROW\n"
+ "Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept\n"
"{\n"
" return qGetProp(ucs4);\n"
"}\n"
"\n"
- "Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) Q_DECL_NOTHROW\n"
+ "Q_DECL_CONST_FUNCTION Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept\n"
"{\n"
" return qGetProp(ucs2);\n"
"}\n\n";
- out += "Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
+ out += "Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept\n"
"{\n"
" return static_cast<GraphemeBreakClass>(qGetProp(ucs4)->graphemeBreakClass);\n"
"}\n"
"\n"
- "Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept\n"
"{\n"
" return static_cast<WordBreakClass>(qGetProp(ucs4)->wordBreakClass);\n"
"}\n"
"\n"
- "Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept\n"
"{\n"
" return static_cast<SentenceBreakClass>(qGetProp(ucs4)->sentenceBreakClass);\n"
"}\n"
"\n"
- "Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) Q_DECL_NOTHROW\n"
+ "Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept\n"
"{\n"
" return static_cast<LineBreakClass>(qGetProp(ucs4)->lineBreakClass);\n"
"}\n"
@@ -2832,7 +2805,7 @@ static QByteArray createLigatureInfo()
QList<Ligature> l = ligatureHashes.value(uc);
if (!l.isEmpty()) {
Q_ASSERT(!QChar::requiresSurrogates(uc));
- qSort(l); // needed for bsearch in ligatureHelper code
+ std::sort(l.begin(), l.end()); // needed for bsearch in ligatureHelper code
ligatures.append(l.size());
for (int j = 0; j < l.size(); ++j) {
@@ -2864,7 +2837,7 @@ static QByteArray createLigatureInfo()
QList<Ligature> l = ligatureHashes.value(uc);
if (!l.isEmpty()) {
Q_ASSERT(QChar::requiresSurrogates(uc));
- qSort(l); // needed for bsearch in ligatureHelper code
+ std::sort(l.begin(), l.end()); // needed for bsearch in ligatureHelper code
ligatures.append(l.size());
for (int j = 0; j < l.size(); ++j) {
@@ -3096,7 +3069,7 @@ int main(int, char **)
"// We mean it.\n"
"//\n\n";
- QFile f("../../src/corelib/tools/qunicodetables.cpp");
+ QFile f("../../src/corelib/text/qunicodetables.cpp");
f.open(QFile::WriteOnly|QFile::Truncate);
f.write(header);
f.write(note);
@@ -3116,7 +3089,7 @@ int main(int, char **)
f.write("QT_END_NAMESPACE\n");
f.close();
- f.setFileName("../../src/corelib/tools/qunicodetables_p.h");
+ f.setFileName("../../src/corelib/text/qunicodetables_p.h");
f.open(QFile::WriteOnly | QFile::Truncate);
f.write(header);
f.write(note);
@@ -3129,6 +3102,7 @@ int main(int, char **)
f.write("#define UNICODE_DATA_VERSION " DATA_VERSION_STR "\n\n");
f.write("namespace QUnicodeTables {\n\n");
f.write(property_string);
+ f.write(sizeOfPropertiesStructCheck);
f.write(grapheme_break_class_string);
f.write(word_break_class_string);
f.write(sentence_break_class_string);